function x(e,t){if(void 0===t&&(t={}),!e)return S;if("string"==typeof e||I(e)){var i=E(e,t);if(i===w)return S;var o=function(e,t){return!!i(e,t)};return i.allBasenames&&(o.allBasenames=i.allBasenames),i.allPaths&&(o.allPaths=i.allPaths),o}return function(e,t){var i=M(Object.getOwnPropertyNames(e).map((function(n){return function(e,t,n){if(!1===t)return w;var i=E(e,n);if(i===w)return w;if("boolean"==typeof t)return i;if(t){var o=t.when;if("string"==typeof o){var r=function(t,n,r,s){if(!s||!i(t,n))return null;var l=s(o.replace("$(basename)",r));return a.isThenable(l)?l.then((function(t){return t?e:null})):l?e:null};return r.requiresSiblings=!0,r}}return i}(n,e[n],t)})).filter((function(e){return e!==w}))),o=i.length;if(!o)return w;if(!i.some((function(e){return!!e.requiresSiblings}))){if(1===o)return i[0];var s=function(e,t){for(var n=0,o=i.length;n<o;n++){
var r=i[n](e,t);if(r)return r}return null},l=n.first(i,(function(e){return!!e.allBasenames}));l&&(s.allBasenames=l.allBasenames);var u=i.reduce((function(e,t){return t.allPaths?e.concat(t.allPaths):e}),[]);return u.length&&(s.allPaths=u),s}var d=function(e,t,n){for(var o=void 0,s=0,a=i.length;s<a;s++){var l=i[s];l.requiresSiblings&&n&&(t||(t=r.basename(e)),o||(o=t.substr(0,t.length-r.extname(e).length)));var u=l(e,t,o,n);if(u)return u}return null},c=n.first(i,(function(e){return!!e.allBasenames}));c&&(d.allBasenames=c.allBasenames);var h=i.reduce((function(e,t){return t.allPaths?e.concat(t.allPaths):e}),[]);h.length&&(d.allPaths=h);return d}(e,t)}
")?e.substr(0,e.length-2):e}function N(e,t,n){var o=r.sep!==r.posix.sep?e.replace(h,r.sep):e,s=r.sep+o,a=n?function(e,n){
return"string"!=typeof e||e!==o&&!i.endsWith(e,s)?null:t}:function(e,n){return"string"==typeof e&&e===o?t:null};return a.allPaths=[(n?"