UNPKG

@sap/generator-fiori

Version:

Create an SAPUI5 application using SAP Fiori elements or a freestyle approach

43 lines (40 loc) 44.7 kB
const __esmImportMetaUrl = require('node:url').pathToFileURL(__filename).href; "use strict";var qn=Object.defineProperty;var i=(e,t)=>qn(e,"name",{value:t,configurable:!0});var p=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}};var ut=p((Zi,at)=>{"use strict";at.exports=function(e,t){t=t||{raw:!1};let r=this.store.get(e);if(r.contents===null){if("defaults"in t)return t.defaults;throw new Error(e+" doesn't exist")}return t.raw?r.contents:r.contents.toString()}});var ft=p((Ki,lt)=>{"use strict";lt.exports=function(e,t){if(this.exists(e))try{return JSON.parse(this.read(e))}catch(r){throw new Error("Could not parse JSON in file: "+e+". Detail: "+r.message)}else return t}});var pt=p((Qi,ht)=>{"use strict";ht.exports=function(e){return this.store.get(e).contents!==null}});var P=p((eo,bt)=>{var Tn=require("fs"),$="state",be="stateCleared",xe="modified",we="deleted",re="isNew",gt=i((e,t)=>{e[$]=t},"setFileState"),dt=i(e=>(e[re]===void 0&&(e[re]=!Tn.existsSync(e.path)),e[re]),"isFileNew"),yt=i(e=>e[$]===xe,"isFileStateModified"),jn=i(e=>gt(e,xe),"setModifiedFileState"),mt=i(e=>e[$]===we,"isFileStateDeleted"),Fn=i(e=>gt(e,we),"setDeletedFileState"),On=i(e=>yt(e)||mt(e)&&!dt(e),"isFilePending"),Dn=i(e=>{e.committed=!0},"setCommittedFile"),$n=i(e=>!!e.committed,"isFileCommitted"),vt=i(e=>{delete e[$]},"resetFileState"),Cn=i(e=>{e[$]&&(e[be]=e[$]),vt(e),delete e[re]},"clearFileState"),Mn=i(e=>!!e[$],"hasState"),Nn=i(e=>!!e[be],"hasClearedState");bt.exports={STATE:$,STATE_CLEARED:be,STATE_MODIFIED:xe,STATE_DELETED:we,isFileStateModified:yt,setModifiedFileState:jn,isFileStateDeleted:mt,setDeletedFileState:Fn,setCommittedFile:Dn,isFileCommitted:$n,isFileNew:dt,isFilePending:On,resetFileState:vt,clearFileState:Cn,hasState:Mn,hasClearedState:Nn}});var wt=p((ro,xt)=>{"use strict";var Pn=require("assert"),{isFileStateModified:Rn,setModifiedFileState:kn}=P();xt.exports=function(e,t,r){Pn(typeof t=="string"||Buffer.isBuffer(t),"Expected `contents` to be a String or a Buffer");let n=this.store.get(e),s=Buffer.isBuffer(t)?t:Buffer.from(t);return(!Rn(n)||!Buffer.isBuffer(n.contents)||!s.equals(n.contents)||r!==void 0&&n.stat!==r)&&(kn(n),n.contents=s,n.stat=r,this.store.add(n)),n.contents.toString()}});var St=p((no,Et)=>{"use strict";Et.exports=function(e,t,r,n){let s=JSON.stringify(t,r||null,n||2)+` `;return this.write(e,s)}});var Ft=p((so,jt)=>{"use strict";function At(e){return e instanceof Buffer||e instanceof Date||e instanceof RegExp}i(At,"isSpecificValue");function qt(e){if(e instanceof Buffer){var t=Buffer.alloc?Buffer.alloc(e.length):new Buffer(e.length);return e.copy(t),t}else{if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e);throw new Error("Unexpected situation")}}i(qt,"cloneSpecificValue");function Tt(e){var t=[];return e.forEach(function(r,n){typeof r=="object"&&r!==null?Array.isArray(r)?t[n]=Tt(r):At(r)?t[n]=qt(r):t[n]=Ee({},r):t[n]=r}),t}i(Tt,"deepCloneArray");function _t(e,t){return t==="__proto__"?void 0:e[t]}i(_t,"safeGetProperty");var Ee=jt.exports=function(){if(arguments.length<1||typeof arguments[0]!="object")return!1;if(arguments.length<2)return arguments[0];var e=arguments[0],t=Array.prototype.slice.call(arguments,1),r,n,s;return t.forEach(function(o){typeof o!="object"||o===null||Array.isArray(o)||Object.keys(o).forEach(function(c){if(n=_t(e,c),r=_t(o,c),r!==e)if(typeof r!="object"||r===null){e[c]=r;return}else if(Array.isArray(r)){e[c]=Tt(r);return}else if(At(r)){e[c]=qt(r);return}else if(typeof n!="object"||n===null||Array.isArray(n)){e[c]=Ee({},r);return}else{e[c]=Ee(n,r);return}})}),e}});var Dt=p((oo,Ot)=>{"use strict";var Gn=Ft();Ot.exports=function(e,t,r,n){let s=this.readJSON(e,{}),o=Gn({},s,t);this.writeJSON(e,o,r,n)}});var Ct=p((co,$t)=>{"use strict";var{EOL:Ln}=require("os");$t.exports=function(e,t,r){if(r={trimEnd:!0,separator:Ln,...r},!this.exists(e)&&r.create){this.write(e,t);return}let n=this.read(e);r.trimEnd&&(n=n.replace(/\s+$/,"")),this.write(e,n+r.separator+t)}});var Nt=p((ao,Mt)=>{"use strict";var Bn=require("../../commonlibs/ejs/index.js");Mt.exports=function(e,t,r,n,s){r=r||{},n=n||{},this.append(e,Bn.render(t.toString(),r,n),s)}});var Se=p((uo,Pt)=>{"use strict";Pt.exports=(...e)=>[...new Set([].concat(...e))]});var Lt=p((lo,Gt)=>{"use strict";var In=require("stream"),Rt=In.PassThrough,Xn=Array.prototype.slice;Gt.exports=Wn;function Wn(){let e=[],t=Xn.call(arguments),r=!1,n=t[t.length-1];n&&!Array.isArray(n)&&n.pipe==null?t.pop():n={};let s=n.end!==!1,o=n.pipeError===!0;n.objectMode==null&&(n.objectMode=!0),n.highWaterMark==null&&(n.highWaterMark=64*1024);let c=Rt(n);function l(){for(let u=0,h=arguments.length;u<h;u++)e.push(kt(arguments[u],n));return a(),this}i(l,"addStream");function a(){if(r)return;r=!0;let u=e.shift();if(!u){process.nextTick(f);return}Array.isArray(u)||(u=[u]);let h=u.length+1;function m(){--h>0||(r=!1,a())}i(m,"next");function b(g){function y(){g.removeListener("merge2UnpipeEnd",y),g.removeListener("end",y),o&&g.removeListener("error",S),m()}i(y,"onend");function S(d){c.emit("error",d)}if(i(S,"onerror"),g._readableState.endEmitted)return m();g.on("merge2UnpipeEnd",y),g.on("end",y),o&&g.on("error",S),g.pipe(c,{end:!1}),g.resume()}i(b,"pipe");for(let g=0;g<u.length;g++)b(u[g]);m()}i(a,"mergeStream");function f(){r=!1,c.emit("queueDrain"),s&&c.end()}return i(f,"endStream"),c.setMaxListeners(0),c.add=l,c.on("unpipe",function(u){u.emit("merge2UnpipeEnd")}),t.length&&l.apply(null,t),c}i(Wn,"merge2");function kt(e,t){if(Array.isArray(e))for(let r=0,n=e.length;r<n;r++)e[r]=kt(e[r],t);else{if(!e._readableState&&e.pipe&&(e=e.pipe(Rt(t))),!e._readableState||!e.pause||!e.pipe)throw new Error("Only readable stream can be merged.");e.pause()}return e}i(kt,"pauseStreams")});var It=p(R=>{"use strict";var{promisify:Un}=require("util"),Bt=require("fs");async function _e(e,t,r){if(typeof r!="string")throw new TypeError(`Expected a string, got ${typeof r}`);try{return(await Un(Bt[e])(r))[t]()}catch(n){if(n.code==="ENOENT")return!1;throw n}}i(_e,"isType");function Ae(e,t,r){if(typeof r!="string")throw new TypeError(`Expected a string, got ${typeof r}`);try{return Bt[e](r)[t]()}catch(n){if(n.code==="ENOENT")return!1;throw n}}i(Ae,"isTypeSync");R.isFile=_e.bind(null,"stat","isFile");R.isDirectory=_e.bind(null,"stat","isDirectory");R.isSymlink=_e.bind(null,"lstat","isSymbolicLink");R.isFileSync=Ae.bind(null,"statSync","isFile");R.isDirectorySync=Ae.bind(null,"statSync","isDirectory");R.isSymlinkSync=Ae.bind(null,"lstatSync","isSymbolicLink")});var Jt=p((go,qe)=>{"use strict";var k=require("path"),Xt=It(),Wt=i(e=>e.length>1?`{${e.join(",")}}`:e[0],"getExtensions"),Ut=i((e,t)=>{let r=e[0]==="!"?e.slice(1):e;return k.isAbsolute(r)?r:k.join(t,r)},"getPath"),zn=i((e,t)=>k.extname(e)?`**/${e}`:`**/${e}.${Wt(t)}`,"addExtensions"),zt=i((e,t)=>{if(t.files&&!Array.isArray(t.files))throw new TypeError(`Expected \`files\` to be of type \`Array\` but received type \`${typeof t.files}\``);if(t.extensions&&!Array.isArray(t.extensions))throw new TypeError(`Expected \`extensions\` to be of type \`Array\` but received type \`${typeof t.extensions}\``);return t.files&&t.extensions?t.files.map(r=>k.posix.join(e,zn(r,t.extensions))):t.files?t.files.map(r=>k.posix.join(e,`**/${r}`)):t.extensions?[k.posix.join(e,`**/*.${Wt(t.extensions)}`)]:[k.posix.join(e,"**")]},"getGlob");qe.exports=async(e,t)=>{if(t={cwd:process.cwd(),...t},typeof t.cwd!="string")throw new TypeError(`Expected \`cwd\` to be of type \`string\` but received type \`${typeof t.cwd}\``);let r=await Promise.all([].concat(e).map(async n=>await Xt.isDirectory(Ut(n,t.cwd))?zt(n,t):n));return[].concat.apply([],r)};qe.exports.sync=(e,t)=>{if(t={cwd:process.cwd(),...t},typeof t.cwd!="string")throw new TypeError(`Expected \`cwd\` to be of type \`string\` but received type \`${typeof t.cwd}\``);let r=[].concat(e).map(n=>Xt.isDirectorySync(Ut(n,t.cwd))?zt(n,t):n);return[].concat.apply([],r)}});var tr=p((mo,er)=>{function Ht(e){return Array.isArray(e)?e:[e]}i(Ht,"makeArray");var Kt="",Vt=" ",Te="\\",Jn=/^\s+$/,Hn=/^\\!/,Vn=/^\\#/,Yn=/\r?\n/g,Zn=/^\.*\/|^\.+$/,je="/",Yt=typeof Symbol<"u"?Symbol.for("node-ignore"):"node-ignore",Kn=i((e,t,r)=>Object.defineProperty(e,t,{value:r}),"define"),Qn=/([0-z])-([0-z])/g,es=i(e=>e.replace(Qn,(t,r,n)=>r.charCodeAt(0)<=n.charCodeAt(0)?t:Kt),"sanitizeRange"),ts=i(e=>{let{length:t}=e;return e.slice(0,t-t%2)},"cleanRangeBackSlash"),rs=[[/\\?\s+$/,e=>e.indexOf("\\")===0?Vt:Kt],[/\\\s/g,()=>Vt],[/[\\$.|*+(){^]/g,e=>`\\${e}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,i(function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"},"startingReplacer")],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,r)=>t+6<r.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)\\\*(?=.+)/g,(e,t)=>`${t}[^\\/]*`],[/\\\\\\(?=[$.|*+(){^])/g,()=>Te],[/\\\\/g,()=>Te],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,r,n,s)=>t===Te?`\\[${r}${ts(n)}${s}`:s==="]"&&n.length%2===0?`[${es(r)}${n}]`:"[]"],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(e,t)=>`${t?`${t}[^/]+`:"[^/]*"}(?=$|\\/$)`]],Zt=Object.create(null),ns=i((e,t,r)=>{let n=Zt[e];if(n)return n;let s=rs.reduce((o,c)=>o.replace(c[0],c[1].bind(e)),e);return Zt[e]=r?new RegExp(s,"i"):new RegExp(s)},"makeRegex"),De=i(e=>typeof e=="string","isString"),ss=i(e=>e&&De(e)&&!Jn.test(e)&&e.indexOf("#")!==0,"checkPattern"),is=i(e=>e.split(Yn),"splitPattern"),Fe=class{static{i(this,"IgnoreRule")}constructor(t,r,n,s){this.origin=t,this.pattern=r,this.negative=n,this.regex=s}},os=i((e,t)=>{let r=e,n=!1;e.indexOf("!")===0&&(n=!0,e=e.substr(1)),e=e.replace(Hn,"!").replace(Vn,"#");let s=ns(e,n,t);return new Fe(r,e,n,s)},"createRule"),cs=i((e,t)=>{throw new t(e)},"throwError"),F=i((e,t,r)=>De(e)?e?F.isNotRelative(e)?r(`path should be a \`path.relative()\`d string, but got "${t}"`,RangeError):!0:r("path must not be empty",TypeError):r(`path must be a string, but got \`${t}\``,TypeError),"checkPath"),Qt=i(e=>Zn.test(e),"isNotRelative");F.isNotRelative=Qt;F.convert=e=>e;var Oe=class{static{i(this,"Ignore")}constructor({ignorecase:t=!0}={}){this._rules=[],this._ignorecase=t,Kn(this,Yt,!0),this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(t){if(t&&t[Yt]){this._rules=this._rules.concat(t._rules),this._added=!0;return}if(ss(t)){let r=os(t,this._ignorecase);this._added=!0,this._rules.push(r)}}add(t){return this._added=!1,Ht(De(t)?is(t):t).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(t){return this.add(t)}_testOne(t,r){let n=!1,s=!1;return this._rules.forEach(o=>{let{negative:c}=o;if(s===c&&n!==s||c&&!n&&!s&&!r)return;o.regex.test(t)&&(n=!c,s=c)}),{ignored:n,unignored:s}}_test(t,r,n,s){let o=t&&F.convert(t);return F(o,t,cs),this._t(o,r,n,s)}_t(t,r,n,s){if(t in r)return r[t];if(s||(s=t.split(je)),s.pop(),!s.length)return r[t]=this._testOne(t,n);let o=this._t(s.join(je)+je,r,n,s);return r[t]=o.ignored?o:this._testOne(t,n)}ignores(t){return this._test(t,this._ignoreCache,!1).ignored}createFilter(){return t=>!this.ignores(t)}filter(t){return Ht(t).filter(this.createFilter())}test(t){return this._test(t,this._testCache,!0)}},ne=i(e=>new Oe(e),"factory"),as=i(()=>!1,"returnFalse"),us=i(e=>F(e&&F.convert(e),e,as),"isPathValid");ne.isPathValid=us;ne.default=ne;er.exports=ne;if(typeof process<"u"&&(process.env&&process.env.IGNORE_TEST_WIN32||process.platform==="win32")){let e=i(r=>/^\\\\\?\\/.test(r)||/["<>|\u0000-\u001F]+/u.test(r)?r:r.replace(/\\/g,"/"),"makePosix");F.convert=e;let t=/^[a-z]:\//i;F.isNotRelative=r=>t.test(r)||Qt(r)}});var nr=p((bo,rr)=>{"use strict";rr.exports=e=>{let t=/^\\\\\?\\/.test(e),r=/[^\u0000-\u0080]+/.test(e);return t||r?e:e.replace(/\\/g,"/")}});var lr=p((xo,$e)=>{"use strict";var{promisify:ls}=require("util"),sr=require("fs"),O=require("path"),ir=require("../../commonlibs/fast-glob/index.js"),fs=tr(),U=nr(),or=["**/node_modules/**","**/flow-typed/**","**/coverage/**","**/.git"],hs=ls(sr.readFile),ps=i(e=>t=>t.startsWith("!")?"!"+O.posix.join(e,t.slice(1)):O.posix.join(e,t),"mapGitIgnorePatternTo"),gs=i((e,t)=>{let r=U(O.relative(t.cwd,O.dirname(t.fileName)));return e.split(/\r?\n/).filter(Boolean).filter(n=>!n.startsWith("#")).map(ps(r))},"parseGitIgnore"),cr=i(e=>{let t=fs();for(let r of e)t.add(gs(r.content,{cwd:r.cwd,fileName:r.filePath}));return t},"reduceIgnore"),ds=i((e,t)=>{if(e=U(e),O.isAbsolute(t)){if(U(t).startsWith(e))return t;throw new Error(`Path ${t} is not in cwd ${e}`)}return O.join(e,t)},"ensureAbsolutePathForCwd"),ar=i((e,t)=>r=>e.ignores(U(O.relative(t,ds(t,r.path||r)))),"getIsIgnoredPredecate"),ys=i(async(e,t)=>{let r=O.join(t,e),n=await hs(r,"utf8");return{cwd:t,filePath:r,content:n}},"getFile"),ms=i((e,t)=>{let r=O.join(t,e),n=sr.readFileSync(r,"utf8");return{cwd:t,filePath:r,content:n}},"getFileSync"),ur=i(({ignore:e=[],cwd:t=U(process.cwd())}={})=>({ignore:e,cwd:t}),"normalizeOptions");$e.exports=async e=>{e=ur(e);let t=await ir("**/.gitignore",{ignore:or.concat(e.ignore),cwd:e.cwd}),r=await Promise.all(t.map(s=>ys(s,e.cwd))),n=cr(r);return ar(n,e.cwd)};$e.exports.sync=e=>{e=ur(e);let r=ir.sync("**/.gitignore",{ignore:or.concat(e.ignore),cwd:e.cwd}).map(s=>ms(s,e.cwd)),n=cr(r);return ar(n,e.cwd)}});var hr=p((Eo,fr)=>{"use strict";var{Transform:vs}=require("stream"),se=class extends vs{static{i(this,"ObjectTransform")}constructor(){super({objectMode:!0})}},Ce=class extends se{static{i(this,"FilterStream")}constructor(t){super(),this._filter=t}_transform(t,r,n){this._filter(t)&&this.push(t),n()}},Me=class extends se{static{i(this,"UniqueStream")}constructor(){super(),this._pushed=new Set}_transform(t,r,n){this._pushed.has(t)||(this.push(t),this._pushed.add(t)),n()}};fr.exports={FilterStream:Ce,UniqueStream:Me}});var z=p((_o,G)=>{"use strict";var gr=require("fs"),ie=Se(),bs=Lt(),oe=require("../../commonlibs/fast-glob/index.js"),ce=Jt(),Ne=lr(),{FilterStream:xs,UniqueStream:ws}=hr(),dr=i(()=>!1,"DEFAULT_FILTER"),pr=i(e=>e[0]==="!","isNegative"),Es=i(e=>{if(!e.every(t=>typeof t=="string"))throw new TypeError("Patterns must be a string or an array of strings")},"assertPatternsInput"),Ss=i((e={})=>{if(!e.cwd)return;let t;try{t=gr.statSync(e.cwd)}catch{return}if(!t.isDirectory())throw new Error("The `cwd` option must be a path to a directory")},"checkCwdOption"),_s=i(e=>e.stats instanceof gr.Stats?e.path:e,"getPathString"),ae=i((e,t)=>{e=ie([].concat(e)),Es(e),Ss(t);let r=[];t={ignore:[],expandDirectories:!0,...t};for(let[n,s]of e.entries()){if(pr(s))continue;let o=e.slice(n).filter(l=>pr(l)).map(l=>l.slice(1)),c={...t,ignore:t.ignore.concat(o)};r.push({pattern:s,options:c})}return r},"generateGlobTasks"),As=i((e,t)=>{let r={};return e.options.cwd&&(r.cwd=e.options.cwd),Array.isArray(e.options.expandDirectories)?r={...r,files:e.options.expandDirectories}:typeof e.options.expandDirectories=="object"&&(r={...r,...e.options.expandDirectories}),t(e.pattern,r)},"globDirs"),Pe=i((e,t)=>e.options.expandDirectories?As(e,t):[e.pattern],"getPattern"),yr=i(e=>e&&e.gitignore?Ne.sync({cwd:e.cwd,ignore:e.ignore}):dr,"getFilterSync"),Re=i(e=>t=>{let{options:r}=e;return r.ignore&&Array.isArray(r.ignore)&&r.expandDirectories&&(r.ignore=ce.sync(r.ignore)),{pattern:t,options:r}},"globToTask");G.exports=async(e,t)=>{let r=ae(e,t),n=i(async()=>t&&t.gitignore?Ne({cwd:t.cwd,ignore:t.ignore}):dr,"getFilter"),s=i(async()=>{let a=await Promise.all(r.map(async f=>{let u=await Pe(f,ce);return Promise.all(u.map(Re(f)))}));return ie(...a)},"getTasks"),[o,c]=await Promise.all([n(),s()]),l=await Promise.all(c.map(a=>oe(a.pattern,a.options)));return ie(...l).filter(a=>!o(_s(a)))};G.exports.sync=(e,t)=>{let r=ae(e,t),n=[];for(let c of r){let l=Pe(c,ce.sync).map(Re(c));n.push(...l)}let s=yr(t),o=[];for(let c of n)o=ie(o,oe.sync(c.pattern,c.options));return o.filter(c=>!s(c))};G.exports.stream=(e,t)=>{let r=ae(e,t),n=[];for(let l of r){let a=Pe(l,ce.sync).map(Re(l));n.push(...a)}let s=yr(t),o=new xs(l=>!s(l)),c=new ws;return bs(n.map(l=>oe.stream(l.pattern,l.options))).pipe(o).pipe(c)};G.exports.generateGlobTasks=ae;G.exports.hasMagic=(e,t)=>[].concat(e).some(r=>oe.isDynamicPattern(r,t));G.exports.gitignore=Ne});var vr=p((qo,mr)=>{mr.exports=function(e,t){for(var r=[],n=0;n<e.length;n++){var s=t(e[n],n);qs(s)?r.push.apply(r,s):r.push(s)}return r};var qs=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"}});var Sr=p((To,Er)=>{"use strict";Er.exports=xr;function xr(e,t,r){e instanceof RegExp&&(e=br(e,r)),t instanceof RegExp&&(t=br(t,r));var n=wr(e,t,r);return n&&{start:n[0],end:n[1],pre:r.slice(0,n[0]),body:r.slice(n[0]+e.length,n[1]),post:r.slice(n[1]+t.length)}}i(xr,"balanced");function br(e,t){var r=t.match(e);return r?r[0]:null}i(br,"maybeMatch");xr.range=wr;function wr(e,t,r){var n,s,o,c,l,a=r.indexOf(e),f=r.indexOf(t,a+1),u=a;if(a>=0&&f>0){if(e===t)return[a,f];for(n=[],o=r.length;u>=0&&!l;)u==a?(n.push(u),a=r.indexOf(e,u+1)):n.length==1?l=[n.pop(),f]:(s=n.pop(),s<o&&(o=s,c=f),f=r.indexOf(t,u+1)),u=a<f&&a>=0?a:f;n.length&&(l=[o,c])}return l}i(wr,"range")});var Dr=p((Fo,Or)=>{var Ts=vr(),_r=Sr();Or.exports=Os;var Ar="\0SLASH"+Math.random()+"\0",qr="\0OPEN"+Math.random()+"\0",Ge="\0CLOSE"+Math.random()+"\0",Tr="\0COMMA"+Math.random()+"\0",jr="\0PERIOD"+Math.random()+"\0";function ke(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0)}i(ke,"numeric");function js(e){return e.split("\\\\").join(Ar).split("\\{").join(qr).split("\\}").join(Ge).split("\\,").join(Tr).split("\\.").join(jr)}i(js,"escapeBraces");function Fs(e){return e.split(Ar).join("\\").split(qr).join("{").split(Ge).join("}").split(Tr).join(",").split(jr).join(".")}i(Fs,"unescapeBraces");function Fr(e){if(!e)return[""];var t=[],r=_r("{","}",e);if(!r)return e.split(",");var n=r.pre,s=r.body,o=r.post,c=n.split(",");c[c.length-1]+="{"+s+"}";var l=Fr(o);return o.length&&(c[c.length-1]+=l.shift(),c.push.apply(c,l)),t.push.apply(t,c),t}i(Fr,"parseCommaParts");function Os(e){return e?(e.substr(0,2)==="{}"&&(e="\\{\\}"+e.substr(2)),X(js(e),!0).map(Fs)):[]}i(Os,"expandTop");function Ds(e){return"{"+e+"}"}i(Ds,"embrace");function $s(e){return/^-?0\d/.test(e)}i($s,"isPadded");function Cs(e,t){return e<=t}i(Cs,"lte");function Ms(e,t){return e>=t}i(Ms,"gte");function X(e,t){var r=[],n=_r("{","}",e);if(!n||/\$$/.test(n.pre))return[e];var s=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body),o=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body),c=s||o,l=n.body.indexOf(",")>=0;if(!c&&!l)return n.post.match(/,(?!,).*\}/)?(e=n.pre+"{"+n.body+Ge+n.post,X(e)):[e];var a;if(c)a=n.body.split(/\.\./);else if(a=Fr(n.body),a.length===1&&(a=X(a[0],!1).map(Ds),a.length===1)){var u=n.post.length?X(n.post,!1):[""];return u.map(function(de){return n.pre+a[0]+de})}var f=n.pre,u=n.post.length?X(n.post,!1):[""],h;if(c){var m=ke(a[0]),b=ke(a[1]),g=Math.max(a[0].length,a[1].length),y=a.length==3?Math.max(Math.abs(ke(a[2])),1):1,S=Cs,d=b<m;d&&(y*=-1,S=Ms);var x=a.some($s);h=[];for(var _=m;S(_,b);_+=y){var w;if(o)w=String.fromCharCode(_),w==="\\"&&(w="");else if(w=String(_),x){var T=g-w.length;if(T>0){var I=new Array(T+1).join("0");_<0?w="-"+I+w.slice(1):w=I+w}}h.push(w)}}else h=Ts(a,function(te){return X(te,!1)});for(var D=0;D<h.length;D++)for(var q=0;q<u.length;q++){var j=f+h[D]+u[q];(!t||c||j)&&r.push(j)}return r}i(X,"expand")});var Ie=p((Do,Pr)=>{Pr.exports=A;A.Minimatch=E;var J=(function(){try{return require("path")}catch{}})()||{sep:"/"};A.sep=J.sep;var L=A.GLOBSTAR=E.GLOBSTAR={},Ns=Dr(),$r={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},Le="[^/]",Be=Le+"*?",Ps="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Rs="(?:(?!(?:\\/|^)\\.).)*?",Cr=ks("().*{}+?[]^$\\!");function ks(e){return e.split("").reduce(function(t,r){return t[r]=!0,t},{})}i(ks,"charSet");var Mr=/\/+/;A.filter=Gs;function Gs(e,t){return t=t||{},function(r,n,s){return A(r,e,t)}}i(Gs,"filter");function C(e,t){t=t||{};var r={};return Object.keys(e).forEach(function(n){r[n]=e[n]}),Object.keys(t).forEach(function(n){r[n]=t[n]}),r}i(C,"ext");A.defaults=function(e){if(!e||typeof e!="object"||!Object.keys(e).length)return A;var t=A,r=i(function(s,o,c){return t(s,o,C(e,c))},"minimatch");return r.Minimatch=i(function(s,o){return new t.Minimatch(s,C(e,o))},"Minimatch"),r.Minimatch.defaults=i(function(s){return t.defaults(C(e,s)).Minimatch},"defaults"),r.filter=i(function(s,o){return t.filter(s,C(e,o))},"filter"),r.defaults=i(function(s){return t.defaults(C(e,s))},"defaults"),r.makeRe=i(function(s,o){return t.makeRe(s,C(e,o))},"makeRe"),r.braceExpand=i(function(s,o){return t.braceExpand(s,C(e,o))},"braceExpand"),r.match=function(n,s,o){return t.match(n,s,C(e,o))},r};E.defaults=function(e){return A.defaults(e).Minimatch};function A(e,t,r){return le(t),r||(r={}),!r.nocomment&&t.charAt(0)==="#"?!1:new E(t,r).match(e)}i(A,"minimatch");function E(e,t){if(!(this instanceof E))return new E(e,t);le(e),t||(t={}),e=e.trim(),!t.allowWindowsEscape&&J.sep!=="/"&&(e=e.split(J.sep).join("/")),this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion!==void 0?t.maxGlobstarRecursion:200,this.set=[],this.pattern=e,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.make()}i(E,"Minimatch");E.prototype.debug=function(){};E.prototype.make=Ls;function Ls(){var e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate();var r=this.globSet=this.braceExpand();t.debug&&(this.debug=i(function(){console.error.apply(console,arguments)},"debug")),this.debug(this.pattern,r),r=this.globParts=r.map(function(n){return n.split(Mr)}),this.debug(this.pattern,r),r=r.map(function(n,s,o){return n.map(this.parse,this)},this),this.debug(this.pattern,r),r=r.filter(function(n){return n.indexOf(!1)===-1}),this.debug(this.pattern,r),this.set=r}i(Ls,"make");E.prototype.parseNegate=Bs;function Bs(){var e=this.pattern,t=!1,r=this.options,n=0;if(!r.nonegate){for(var s=0,o=e.length;s<o&&e.charAt(s)==="!";s++)t=!t,n++;n&&(this.pattern=e.substr(n)),this.negate=t}}i(Bs,"parseNegate");A.braceExpand=function(e,t){return Nr(e,t)};E.prototype.braceExpand=Nr;function Nr(e,t){return t||(this instanceof E?t=this.options:t={}),e=typeof e>"u"?this.pattern:e,le(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:Ns(e)}i(Nr,"braceExpand");var Is=1024*64,le=i(function(e){if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>Is)throw new TypeError("pattern is too long")},"assertValidPattern");E.prototype.parse=Xs;var ue={};function Xs(e,t){le(e);var r=this.options;if(e==="**")if(r.noglobstar)e="*";else return L;if(e==="")return"";var n="",s=!!r.nocase,o=!1,c=[],l=[],a,f=!1,u=-1,h=-1,m=e.charAt(0)==="."?"":r.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",b=this;function g(){if(a){switch(a){case"*":n+=Be,s=!0;break;case"?":n+=Le,s=!0;break;default:n+="\\"+a;break}b.debug("clearStateChar %j %j",a,n),a=!1}}i(g,"clearStateChar");for(var y=0,S=e.length,d;y<S&&(d=e.charAt(y));y++){if(this.debug("%s %s %s %j",e,y,n,d),o&&Cr[d]){n+="\\"+d,o=!1;continue}switch(d){case"/":return!1;case"\\":g(),o=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s %s %s %j <-- stateChar",e,y,n,d),f){this.debug(" in class"),d==="!"&&y===h+1&&(d="^"),n+=d;continue}if(d==="*"&&a==="*")continue;b.debug("call clearStateChar %j",a),g(),a=d,r.noext&&g();continue;case"(":if(f){n+="(";continue}if(!a){n+="\\(";continue}c.push({type:a,start:y-1,reStart:n.length,open:$r[a].open,close:$r[a].close}),n+=a==="!"?"(?:(?!(?:":"(?:",this.debug("plType %j %j",a,n),a=!1;continue;case")":if(f||!c.length){n+="\\)";continue}g(),s=!0;var x=c.pop();n+=x.close,x.type==="!"&&l.push(x),x.reEnd=n.length;continue;case"|":if(f||!c.length||o){n+="\\|",o=!1;continue}g(),n+="|";continue;case"[":if(g(),f){n+="\\"+d;continue}f=!0,h=y,u=n.length,n+=d;continue;case"]":if(y===h+1||!f){n+="\\"+d,o=!1;continue}var _=e.substring(h+1,y);try{RegExp("["+_+"]")}catch{var w=this.parse(_,ue);n=n.substr(0,u)+"\\["+w[0]+"\\]",s=s||w[1],f=!1;continue}s=!0,f=!1,n+=d;continue;default:g(),o?o=!1:Cr[d]&&!(d==="^"&&f)&&(n+="\\"),n+=d}}for(f&&(_=e.substr(h+1),w=this.parse(_,ue),n=n.substr(0,u)+"\\["+w[0],s=s||w[1]),x=c.pop();x;x=c.pop()){var T=n.slice(x.reStart+x.open.length);this.debug("setting tail",n,x),T=T.replace(/((?:\\{2}){0,64})(\\?)\|/g,function(ot,ct,ve){return ve||(ve="\\"),ct+ct+ve+"|"}),this.debug(`tail=%j %s`,T,T,x,n);var I=x.type==="*"?Be:x.type==="?"?Le:"\\"+x.type;s=!0,n=n.slice(0,x.reStart)+I+"\\("+T}g(),o&&(n+="\\\\");var D=!1;switch(n.charAt(0)){case"[":case".":case"(":D=!0}for(var q=l.length-1;q>-1;q--){var j=l[q],te=n.slice(0,j.reStart),de=n.slice(j.reStart,j.reEnd-8),st=n.slice(j.reEnd-8,j.reEnd),W=n.slice(j.reEnd);st+=W;var Sn=te.split("(").length-1,ye=W;for(y=0;y<Sn;y++)ye=ye.replace(/\)[+*?]?/,"");W=ye;var it="";W===""&&t!==ue&&(it="$");var _n=te+de+W+it+st;n=_n}if(n!==""&&s&&(n="(?=.)"+n),D&&(n=m+n),t===ue)return[n,s];if(!s)return Us(e);var An=r.nocase?"i":"";try{var me=new RegExp("^"+n+"$",An)}catch{return new RegExp("$.")}return me._glob=e,me._src=n,me}i(Xs,"parse");A.makeRe=function(e,t){return new E(e,t||{}).makeRe()};E.prototype.makeRe=Ws;function Ws(){if(this.regexp||this.regexp===!1)return this.regexp;var e=this.set;if(!e.length)return this.regexp=!1,this.regexp;var t=this.options,r=t.noglobstar?Be:t.dot?Ps:Rs,n=t.nocase?"i":"",s=e.map(function(o){return o.map(function(c){return c===L?r:typeof c=="string"?zs(c):c._src}).join("\\/")}).join("|");s="^(?:"+s+")$",this.negate&&(s="^(?!"+s+").*$");try{this.regexp=new RegExp(s,n)}catch{this.regexp=!1}return this.regexp}i(Ws,"makeRe");A.match=function(e,t,r){r=r||{};var n=new E(t,r);return e=e.filter(function(s){return n.match(s)}),n.options.nonull&&!e.length&&e.push(t),e};E.prototype.match=i(function(t,r){if(typeof r>"u"&&(r=this.partial),this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&r)return!0;var n=this.options;J.sep!=="/"&&(t=t.split(J.sep).join("/")),t=t.split(Mr),this.debug(this.pattern,"split",t);var s=this.set;this.debug(this.pattern,"set",s);var o,c;for(c=t.length-1;c>=0&&(o=t[c],!o);c--);for(c=0;c<s.length;c++){var l=s[c],a=t;n.matchBase&&l.length===1&&(a=[o]);var f=this.matchOne(a,l,r);if(f)return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate},"match");E.prototype.matchOne=function(e,t,r){return t.indexOf(L)!==-1?this._matchGlobstar(e,t,r,0,0):this._matchOne(e,t,r,0,0)};E.prototype._matchGlobstar=function(e,t,r,n,s){var o,c=-1;for(o=s;o<t.length;o++)if(t[o]===L){c=o;break}var l=-1;for(o=t.length-1;o>=0;o--)if(t[o]===L){l=o;break}var a=t.slice(s,c),f=r?t.slice(c+1):t.slice(c+1,l),u=r?[]:t.slice(l+1);if(a.length){var h=e.slice(n,n+a.length);if(!this._matchOne(h,a,r,0,0))return!1;n+=a.length}var m=0;if(u.length){if(u.length+n>e.length)return!1;var b=e.length-u.length;if(this._matchOne(e,u,r,b,0))m=u.length;else{if(e[e.length-1]!==""||n+u.length===e.length||(b--,!this._matchOne(e,u,r,b,0)))return!1;m=u.length+1}}if(!f.length){var g=!!m;for(o=n;o<e.length-m;o++){var y=String(e[o]);if(g=!0,y==="."||y===".."||!this.options.dot&&y.charAt(0)===".")return!1}return r||g}for(var S=[[[],0]],d=S[0],x=0,_=[0],w=0;w<f.length;w++){var T=f[w];T===L?(_.push(x),d=[[],0],S.push(d)):(d[0].push(T),x++)}for(var I=S.length-1,D=e.length-m,q=0;q<S.length;q++)S[q][1]=D-(_[I--]+S[q][0].length);return!!this._matchGlobStarBodySections(e,S,n,0,r,0,!!m)};E.prototype._matchGlobStarBodySections=function(e,t,r,n,s,o,c){var l=t[n];if(!l){for(var a=r;a<e.length;a++){c=!0;var f=e[a];if(f==="."||f===".."||!this.options.dot&&f.charAt(0)===".")return!1}return c}for(var u=l[0],h=l[1];r<=h;){var m=this._matchOne(e.slice(0,r+u.length),u,s,r,0);if(m&&o<this.maxGlobstarRecursion){var b=this._matchGlobStarBodySections(e,t,r+u.length,n+1,s,o+1,c);if(b!==!1)return b}var f=e[r];if(f==="."||f===".."||!this.options.dot&&f.charAt(0)===".")return!1;r++}return s||null};E.prototype._matchOne=function(e,t,r,n,s){var o,c,l,a;for(o=n,c=s,l=e.length,a=t.length;o<l&&c<a;o++,c++){this.debug("matchOne loop");var f=t[c],u=e[o];if(this.debug(t,f,u),f===!1||f===L)return!1;var h;if(typeof f=="string"?(h=u===f,this.debug("string match",f,u,h)):(h=u.match(f),this.debug("pattern match",f,u,h)),!h)return!1}if(o===l&&c===a)return!0;if(o===l)return r;if(c===a)return o===l-1&&e[o]==="";throw new Error("wtf?")};function Us(e){return e.replace(/\\(.)/g,"$1")}i(Us,"globUnescape");function zs(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}i(zs,"regExpEscape")});var kr=p((Co,Rr)=>{"use strict";var Js=i((e,...t)=>{let r=new Set([].concat(...t));return e.filter(n=>!r.has(n))},"arrayDiffer");Rr.exports=Js});var Lr=p((No,Gr)=>{"use strict";var Hs=i(e=>e==null?[]:Array.isArray(e)?e:typeof e=="string"?[e]:typeof e[Symbol.iterator]=="function"?[...e]:[e],"arrify");Gr.exports=Hs});var fe=p((Ro,Ir)=>{"use strict";var Vs=Ie(),Ys=Se(),Zs=kr(),Br=Lr();Ir.exports=(e,t,r={})=>{if(e=Br(e),t=Br(t),e.length===0||t.length===0)return[];let n=[];for(let s of e)for(let o of t){let c=Ys;o[0]==="!"&&(o=o.slice(1),c=Zs),n=c(n,Vs.match([s],o,r))}return n}});var Wr=p((ko,Xr)=>{var Ks=require("path");Xr.exports=function(e,t){if(t)var r=t.map(function(s){return Ks.resolve(e,s)});else var r=e;var n=r.slice(1).reduce(function(s,o){if(!o.match(/^([A-Za-z]:)?\/|\\/))throw new Error("relative path without a basedir");for(var c=o.split(/\/+|\\+/),l=0;s[l]===c[l]&&l<Math.min(s.length,c.length);l++);return s.slice(0,l)},r[0].split(/\/+|\\+/));return n.length>1?n.join("/"):"/"}});var H=p((Go,Ur)=>{Ur.exports=function(e,t){if(typeof e!="string")throw new TypeError("expected path to be a string");if(e==="\\"||e==="/")return"/";var r=e.length;if(r<=1)return e;var n="";if(r>4&&e[3]==="\\"){var s=e[2];(s==="?"||s===".")&&e.slice(0,2)==="\\\\"&&(e=e.slice(2),n="//")}var o=e.split(/[/\\]+/);return t!==!1&&o[o.length-1]===""&&o.pop(),n+o.join("/")}});var Hr=p(N=>{"use strict";var Qs=N&&N.__awaiter||function(e,t,r,n){function s(o){return o instanceof r?o:new r(function(c){c(o)})}return i(s,"adopt"),new(r||(r=Promise))(function(o,c){function l(u){try{f(n.next(u))}catch(h){c(h)}}i(l,"fulfilled");function a(u){try{f(n.throw(u))}catch(h){c(h)}}i(a,"rejected");function f(u){u.done?o(u.value):s(u.value).then(l,a)}i(f,"step"),f((n=n.apply(e,t||[])).next())})};Object.defineProperty(N,"__esModule",{value:!0});N.isBinaryFileSync=N.isBinaryFile=void 0;var M=require("fs"),Xe=require("util"),ei=Xe.promisify(M.stat),ti=Xe.promisify(M.open),ri=Xe.promisify(M.close),V=512;function ni(e,t){return Qs(this,void 0,void 0,function*(){if(zr(e)){let r=yield ei(e);Jr(r);let n=yield ti(e,"r"),s=Buffer.alloc(V);return new Promise((o,c)=>{M.read(n,s,0,V,0,(l,a,f)=>{ri(n),l?c(l):o(he(s,a))})})}else return t===void 0&&(t=e.length),he(e,t)})}i(ni,"isBinaryFile");N.isBinaryFile=ni;function si(e,t){if(zr(e)){let r=M.statSync(e);Jr(r);let n=M.openSync(e,"r"),s=Buffer.alloc(V),o=M.readSync(n,s,0,V,0);return M.closeSync(n),he(s,o)}else return t===void 0&&(t=e.length),he(e,t)}i(si,"isBinaryFileSync");N.isBinaryFileSync=si;function he(e,t){if(t===0)return!1;let r=0,n=Math.min(t,V);if(t>=3&&e[0]===239&&e[1]===187&&e[2]===191||t>=4&&e[0]===0&&e[1]===0&&e[2]===254&&e[3]===255||t>=4&&e[0]===255&&e[1]===254&&e[2]===0&&e[3]===0||t>=4&&e[0]===132&&e[1]===49&&e[2]===149&&e[3]===51)return!1;if(n>=5&&e.slice(0,5).toString()==="%PDF-")return!0;if(t>=2&&e[0]===254&&e[1]===255||t>=2&&e[0]===255&&e[1]===254)return!1;for(let s=0;s<n;s++){if(e[s]===0)return!0;if((e[s]<7||e[s]>14)&&(e[s]<32||e[s]>127)){if(e[s]>193&&e[s]<224&&s+1<n){if(s++,e[s]>127&&e[s]<192)continue}else if(e[s]>223&&e[s]<240&&s+2<n&&(s++,e[s]>127&&e[s]<192&&e[s+1]>127&&e[s+1]<192)){s++;continue}if(r++,s>32&&r*100/n>10)return!0}}return r*100/n>10}i(he,"isBinaryCheck");function zr(e){return typeof e=="string"}i(zr,"isString");function Jr(e){if(!e.isFile())throw new Error("Path provided was not a file!")}i(Jr,"isStatFile")});var Vr=p(We=>{"use strict";Object.defineProperty(We,"__esModule",{value:!0});var ii=["Makefile","Rakefile","ada","adb","ads","applescript","as","ascx","asm","asmx","asp","aspx","atom","bas","bash","bashrc","bat","bbcolors","bdsgroup","bdsproj","bib","bowerrc","c","cbl","cc","cfc","cfg","cfm","cfml","cgi","clj","cls","cmake","cmd","cnf","cob","coffee","coffeekup","conf","cpp","cpt","cpy","crt","cs","csh","cson","csr","css","csslintrc","csv","ctl","curlrc","cxx","dart","dfm","diff","dof","dpk","dproj","dtd","eco","editorconfig","ejs","el","emacs","eml","ent","erb","erl","eslintignore","eslintrc","ex","exs","f","f03","f77","f90","f95","fish","for","fpp","frm","ftn","gemrc","gitattributes","gitconfig","gitignore","gitkeep","gitmodules","go","gpp","gradle","groovy","groupproj","grunit","gtmpl","gvimrc","h","haml","hbs","hgignore","hh","hpp","hrl","hs","hta","htaccess","htc","htm","html","htpasswd","hxx","iced","inc","ini","ino","int","irbrc","itcl","itermcolors","itk","jade","java","jhtm","jhtml","js","jscsrc","jshintignore","jshintrc","json","json5","jsonld","jsp","jspx","jsx","ksh","less","lhs","lisp","log","ls","lsp","lua","m","mak","map","markdown","master","md","mdown","mdwn","mdx","metadata","mht","mhtml","mjs","mk","mkd","mkdn","mkdown","ml","mli","mm","mxml","nfm","nfo","njk","noon","npmignore","npmrc","nvmrc","ops","pas","pasm","patch","pbxproj","pch","pem","pg","php","php3","php4","php5","phpt","phtml","pir","pl","pm","pmc","pod","pot","properties","props","pt","pug","py","r","rake","rb","rdoc","rdoc_options","resx","rhtml","rjs","rlib","rmd","ron","rs","rss","rst","rtf","rvmrc","rxml","s","sass","scala","scm","scss","seestyle","sh","shtml","sls","spec","sql","sqlite","ss","sss","st","strings","sty","styl","stylus","sub","sublime-build","sublime-commands","sublime-completions","sublime-keymap","sublime-macro","sublime-menu","sublime-project","sublime-settings","sublime-workspace","sv","svc","svg","t","tcl","tcsh","terminal","tex","text","textile","tg","tmLanguage","tmTheme","tmpl","tpl","ts","tsv","tsx","tt","tt2","ttml","txt","v","vb","vbs","vh","vhd","vhdl","vim","viminfo","vimrc","vue","webapp","wxml","wxss","x-php","xht","xhtml","xml","xs","xsd","xsl","xslt","yaml","yml","zsh","zshrc"];We.default=ii});var Yr=p(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});var oi=["dds","eot","gif","ico","jar","jpeg","jpg","pdf","png","swf","tga","ttf","zip"];Ue.default=oi});var B=p(K=>{"use strict";var Y=require("fs"),Z=require("path"),ci=Wr(),ai=z(),pe=H(),{Transform:ui}=require("stream"),{isBinaryFileSync:Zr}=Hr(),{default:li}=Vr(),{default:fi}=Yr();function hi(e){return e!=null&&e.charAt(0)!=="!"}i(hi,"notNullOrExclusion");K.getCommonPath=function(e){if(Array.isArray(e))return e=e.filter(hi).map(this.getCommonPath.bind(this)),ci(e);let t=e.indexOf("*");if(t!==-1)e=e.substring(0,t+1);else if(Y.existsSync(e)&&Y.statSync(e).isDirectory())return e;return Z.dirname(e)};K.globify=function(e){if(Array.isArray(e))return e.reduce((r,n)=>r.concat(this.globify(pe(n))),[]);if(e=pe(e),ai.hasMagic(e))return e;if(!Y.existsSync(e))return[e,pe(Z.join(e,"**"))];let t=Y.statSync(e);if(t.isFile())return e;if(t.isDirectory())return pe(Z.join(e,"**"));throw new Error("Only file path or directory path are supported.")};K.createTransform=function(e){return new ui({objectMode:!0,transform(...r){return e.apply(this,r)}})};K.isBinary=(e,t)=>{let r=Z.extname(e).replace(/^\./,"")||Z.basename(e);return fi.includes(r)?!0:li.includes(r)?!1:Y.existsSync(e)&&Zr(e)||t&&Zr(Buffer.isBuffer(t)?t:Buffer.from(t))}});var en=p((zo,Qr)=>{"use strict";var pi=require("path"),gi=z(),di=fe(),yi=B(),{setDeletedFileState:mi}=P();function Kr(e,t){let r=t.get(e);mi(r),r.contents=null,t.add(r)}i(Kr,"deleteFile");Qr.exports=function(e,t){Array.isArray(e)||(e=[e]),e=e.map(s=>pi.resolve(s)),e=yi.globify(e),t=t||{};let r=t.globOptions||{};gi.sync(e,r).forEach(s=>{Kr(s,this.store)}),this.store.each(s=>{di([s.path],e).length!==0&&Kr(s.path,this.store)})}});var Ve=p(He=>{"use strict";var Je=require("assert"),tn=require("fs"),ge=require("path"),ze=z(),vi=fe(),bi=require("../../commonlibs/ejs/index.js"),rn=B(),nn=H();function xi(e,t,r){let n=e(t,r);return Buffer.isBuffer(n)?n:Buffer.from(n)}i(xi,"applyProcessingFunc");He.copy=function(e,t,r,n,s){t=ge.resolve(t),r=r||{};let o=rn.globify(e),c=[];if(r.noGlob)c=(Array.isArray(o)?o:[o]).filter(h=>tn.existsSync(h));else{let u={...r.globOptions,nodir:!0};c=ze.sync(o,u).map(h=>ge.resolve(h))}let l=[];this.store.each(u=>{!ze.hasMagic(nn(u.path))&&vi([u.path],o).length!==0&&!c.includes(u.path)&&l.push(u.path)});let a=c.concat(l),f=i(()=>t,"generateDestination");if(Array.isArray(e)||!this.exists(e)||ze.hasMagic(nn(e))&&!r.noGlob){Je(!this.exists(t)||tn.statSync(t).isDirectory(),"When copying multiple files, provide a directory as destination");let u=r.processDestinationPath||(m=>m),h=rn.getCommonPath(e);f=i(m=>{let b=ge.relative(h,m);return u(ge.join(t,b))},"generateDestination")}Je(r.ignoreNoMatch||a.length>0,"Trying to copy from a source that does not exist: "+e),a.forEach(u=>{let h=f(u);n&&(h=bi.render(h,n,s)),this._copySingle(u,h,r,n,s)})};He._copySingle=function(e,t,r={}){Je(this.exists(e),"Trying to copy from a source that does not exist: "+e);let n=this.store.get(e),{contents:s}=n;if(r.process&&(s=xi(r.process,n.contents,n.path)),r.append){if(!this.store.existsInMemory)throw new Error("Current mem-fs is not compatible with append");if(this.store.existsInMemory(t)){this.append(t,s,{create:!0,...r});return}}this.write(t,s,n.stat)}});var Ze=p((Yo,Ye)=>{"use strict";var wi=require("../../commonlibs/ejs/index.js"),{isBinary:Ei}=B();Ye.exports._processTpl=function({contents:e,filename:t,context:r,tplSettings:n}){return Ei(t,e)?e:wi.render(e.toString(),r,{filename:t,...n})};Ye.exports.copyTpl=function(e,t,r,n,s){r=r||{},n=n||{},this.copy(e,t,{processDestinationPath:i(o=>o.replace(/.ejs$/,""),"processDestinationPath"),...s,process:i((o,c)=>this._processTpl({contents:o,filename:c,context:r,tplSettings:n}),"process")},r,n)}});var tt=p(et=>{"use strict";var sn=require("assert"),Si=require("fs"),an=require("fs").promises,Q=require("path"),Ke=z(),_i=fe(),Ai=require("../../commonlibs/ejs/index.js"),on=B(),cn=H();async function qi(e,t){let r=await Promise.resolve(e.call(this,t));return Buffer.isBuffer(r)?r:Buffer.from(r)}i(qi,"applyProcessingFileFunc");function Qe(e,t,r){return t?Ai.render(e,t,r):e}i(Qe,"renderFilepath");async function Ti(e){let t;if(typeof e=="string")t=e;else return;let r=Q.resolve(t);try{if((await an.stat(r)).isFile())return r}catch{}}i(Ti,"getOneFile");et.copyAsync=async function(e,t,r,n,s){t=Q.resolve(t),r=r||{};let o=await Ti(e);if(o)return this._copySingleAsync(o,Qe(t,n,s),r);let c=on.globify(e),l={...r.globOptions,nodir:!0},a=Ke.sync(c,l).map(h=>Q.resolve(h)),f=[];this.store.each(h=>{!Ke.hasMagic(cn(h.path))&&_i([h.path],c).length!==0&&!a.includes(h.path)&&f.push(h.path)});let u=i(()=>t,"generateDestination");if(Array.isArray(e)||!this.exists(e)||Ke.hasMagic(cn(e))){sn(!this.exists(t)||Si.statSync(t).isDirectory(),"When copying multiple files, provide a directory as destination");let h=r.processDestinationPath||(b=>b),m=on.getCommonPath(e);u=i(b=>{let g=Q.relative(m,b);return h(Q.join(t,g))},"generateDestination")}sn(r.ignoreNoMatch||a.length>0||f.length>0,"Trying to copy from a source that does not exist: "+e),await Promise.all([...a.map(h=>this._copySingleAsync(h,Qe(u(h),n,s),r)),...f.map(h=>Promise.resolve(this._copySingle(h,Qe(u(h),n,s),r)))])};et._copySingleAsync=async function(e,t,r={}){if(!r.processFile)return this._copySingle(e,t,r);let n=await qi.call(this,r.processFile,e);if(r.append){if(!this.store.existsInMemory)throw new Error("Current mem-fs is not compatible with append");if(this.store.existsInMemory(t)){this.append(t,n,{create:!0,...r});return}}let s=await an.stat(e);this.write(t,n,s)}});var ln=p((ec,un)=>{"use strict";var ji=require("../../commonlibs/ejs/index.js"),Fi=require("fs").promises,{isBinary:Oi}=B();un.exports=async function(e,t,r,n,s){r=r||{},n=n||{},await this.copyAsync(e,t,{processDestinationPath:i(o=>o.replace(/.ejs$/,""),"processDestinationPath"),...s,async processFile(o){return Oi(o,null)?Fi.readFile(o):ji.renderFile(o,r,n)},process:i((o,c,l)=>this._processTpl({contents:o,filename:c,destination:l,context:r,tplSettings:n}),"process")},r,n)}});var hn=p((rc,fn)=>{"use strict";fn.exports=function(e,t,r){this.copy(e,t,r),this.delete(e,r)}});var dn=p((nc,gn)=>{var{createTransform:pn}=B(),{isFilePending:Di}=P(),$i=i(()=>pn((e,t,r)=>{r(void 0,Di(e)?e:void 0)}),"createPendingFilesPassthrough"),Ci=i(e=>pn((t,r,n)=>{e.commitFileAsync(t).then(()=>n()).catch(s=>n(s))}),"createCommitTransform");gn.exports={createPendingFilesPassthrough:$i,createCommitTransform:Ci}});var mn=p((ic,yn)=>{"use strict";var{promisify:Mi}=require("util"),{pipeline:Ni}=require("stream"),Pi=Mi(Ni),{createPendingFilesPassthrough:Ri,createCommitTransform:ki}=dn();yn.exports=function(e,t,r){typeof e=="function"?(r=e,e=[],t=void 0):typeof t=="function"&&(r=t,t=void 0),t=t||this.store.stream(),e=e||[];let n=Pi(t,Ri(),...e,ki(this));return r?n.then(()=>r(),r):n}});var xn=p((oc,bn)=>{"use strict";var ee=require("fs").promises,Gi=require("path"),{clearFileState:Li,isFileStateModified:Bi,isFileStateDeleted:Ii,setCommittedFile:vn}=P();async function Xi(e){let t=Gi.dirname(e.path);try{if(!(await ee.stat(t)).isDirectory())throw new Error(`${e.path} is not a directory`)}catch(n){if(n.code==="ENOENT")await ee.mkdir(t,{recursive:!0});else throw n}let r={};e.stat&&(r.mode=e.stat.mode),await ee.writeFile(e.path,e.contents,r)}i(Xi,"write");async function Wi(e){await(ee.rm||ee.rmdir)(e.path,{recursive:!0})}i(Wi,"remove");bn.exports=async function(e){let t=this.store.get(e.path);(!t||t!==e)&&this.store.add(e),Bi(e)?(vn(e),await Xi(e)):Ii(e)&&(vn(e),await Wi(e)),Li(e)}});var En=p((ac,wn)=>{"use strict";var Ui=require("path"),zi=H(),Ji=Ie(),{hasClearedState:Hi,hasState:Vi,STATE:rt,STATE_CLEARED:nt}=P();wn.exports=function(e=process.cwd(),t=r=>Hi(r)||Vi(r)){if(typeof t=="string"){let r=t;t=i(n=>Ji(n.path,r),"filter")}return Object.fromEntries(this.store.all().filter(r=>t(r,e)).map(r=>{let n=zi(e?Ui.relative(e,r.path):r.path),s={contents:r.contents?r.contents.toString():r.contents};return r[rt]&&(s[rt]=r[rt]),r[nt]&&(s[nt]=r[nt]),[n,s]}))}});function v(e){this.store=e}i(v,"EditionInterface");v.prototype.read=ut();v.prototype.readJSON=ft();v.prototype.exists=pt();v.prototype.write=wt();v.prototype.writeJSON=St();v.prototype.extendJSON=Dt();v.prototype.append=Ct();v.prototype.appendTpl=Nt();v.prototype.delete=en();v.prototype.copy=Ve().copy;v.prototype._copySingle=Ve()._copySingle;v.prototype.copyTpl=Ze().copyTpl;v.prototype._processTpl=Ze()._processTpl;v.prototype.copyAsync=tt().copyAsync;v.prototype._copySingleAsync=tt()._copySingleAsync;v.prototype.copyTplAsync=ln();v.prototype.move=hn();v.prototype.commit=mn();v.prototype.commitFileAsync=xn();v.prototype.dump=En();exports.create=function(e){return new v(e)};exports.State=P(); /*! Bundled license information: deep-extend/lib/deep-extend.js: (*! * @description Recursive object extending * @author Viacheslav Lotsmanov <lotsmanov89@gmail.com> * @license MIT * * The MIT License (MIT) * * Copyright (c) 2013-2018 Viacheslav Lotsmanov * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * the Software, and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *) normalize-path/index.js: (*! * normalize-path <https://github.com/jonschlinkert/normalize-path> * * Copyright (c) 2014-2018, Jon Schlinkert. * Released under the MIT License. *) */