@bem-plus/class-generator
Version:
The `@bem-plus/class-generator` allows you to generate boilerplate JavaScript or TypeScript code from your Stylesheets.
55 lines (43 loc) • 176 kB
JavaScript
import{createRequire as t}from"module";var e,i,s={2517:function(t,e,i){t=i.nmd(t);var s,r,n={};t.exports=n,n.themes={};var a=i(3837),o=n.styles=i(5784),l=Object.defineProperties,h=new RegExp(/[\r\n]+/g);n.supportsColor=i(6561).supportsColor,void 0===n.enabled&&(n.enabled=!1!==n.supportsColor()),n.enable=function(){n.enabled=!0},n.disable=function(){n.enabled=!1},n.stripColors=n.strip=function(t){return(""+t).replace(/\x1B\[\d+m/g,"")},n.stylize=function(t,e){if(!n.enabled)return t+"";var i=o[e];return!i&&e in n?n[e](t):i.open+t+i.close};var u=/[|\\{}()[\]^$+*?.]/g,c=function(t){if("string"!=typeof t)throw TypeError("Expected a string");return t.replace(u,"\\$&")};function d(t){var e=function t(){return m.apply(t,arguments)};return e._styles=t,e.__proto__=f,e}var p=(s={},o.grey=o.gray,Object.keys(o).forEach(function(t){o[t].closeRe=RegExp(c(o[t].close),"g"),s[t]={get:function(){return d(this._styles.concat(t))}}}),s),f=l(function(){},p);function m(){var t=Array.prototype.slice.call(arguments),e=t.map(function(t){return null!=t&&t.constructor===String?t:a.inspect(t)}).join(" ");if(!n.enabled||!e)return e;for(var i=-1!=e.indexOf("\n"),s=this._styles,r=s.length;r--;){var l=o[s[r]];e=l.open+e.replace(l.closeRe,l.open)+l.close,i&&(e=e.replace(h,function(t){return l.close+t+l.open}))}return e}n.setTheme=function(t){if("string"==typeof t){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}for(var e in t)!function(e){n[e]=function(i){if("object"==typeof t[e]){var s=i;for(var r in t[e])s=n[t[e][r]](s);return s}return n[t[e]](i)}}(e)};var g=function(t,e){var i=e.split("");return(i=i.map(t)).join("")};for(var y in n.trap=i(5117),n.zalgo=i(1492),n.maps={},n.maps.america=i(6260)(n),n.maps.zebra=i(3270)(n),n.maps.rainbow=i(5920)(n),n.maps.random=i(2449)(n),n.maps)!function(t){n[t]=function(e){return g(n.maps[t],e)}}(y);l(n,(r={},Object.keys(p).forEach(function(t){r[t]={get:function(){return d([t])}}}),r))},5117:function(t,e,i){(t=i.nmd(t)).exports=function(t,e){var i="";t=(t=t||"Run the trap, drop the bass").split("");var s={a:["@","Ą","Ⱥ","Ʌ","Δ","Λ","Д"],b:["\xdf","Ɓ","Ƀ","ɮ","β","฿"],c:["\xa9","Ȼ","Ͼ"],d:["\xd0","Ɗ","Ԁ","ԁ","Ԃ","ԃ"],e:["\xcb","ĕ","Ǝ","ɘ","Σ","ξ","Ҽ","੬"],f:["Ӻ"],g:["ɢ"],h:["Ħ","ƕ","Ң","Һ","Ӈ","Ԋ"],i:["༏"],j:["Ĵ"],k:["ĸ","Ҡ","Ӄ","Ԟ"],l:["Ĺ"],m:["ʍ","Ӎ","ӎ","Ԡ","ԡ","൩"],n:["\xd1","ŋ","Ɲ","Ͷ","Π","Ҋ"],o:["\xd8","\xf5","\xf8","Ǿ","ʘ","Ѻ","ם","","๏"],p:["Ƿ","Ҏ"],q:["্"],r:["\xae","Ʀ","Ȑ","Ɍ","ʀ","Я"],s:["\xa7","Ϟ","ϟ","Ϩ"],t:["Ł","Ŧ","ͳ"],u:["Ʊ","Ս"],v:["ט"],w:["Ш","Ѡ","Ѽ","൰"],x:["Ҳ","Ӿ","Ӽ","ӽ"],y:["\xa5","Ұ","Ӌ"],z:["Ƶ","ɀ"]};return t.forEach(function(t){var e=Math.floor(Math.random()*(s[t=t.toLowerCase()]||[" "]).length);void 0!==s[t]?i+=s[t][e]:i+=t}),i}},1492:function(t,e,i){(t=i.nmd(t)).exports=function(t,e){t=t||" he is here ";var i={up:["̍","̎","̄","̅","̿","̑","̆","̐","͒","͗","͑","̇","̈","̊","͂","̓","̈","͊","͋","͌","̃","̂","̌","͐","̀","́","̋","̏","̒","̓","̔","̽","̉","ͣ","ͤ","ͥ","ͦ","ͧ","ͨ","ͩ","ͪ","ͫ","ͬ","ͭ","ͮ","ͯ","̾","͛","͆","̚"],down:["̖","̗","̘","̙","̜","̝","̞","̟","̠","̤","̥","̦","̩","̪","̫","̬","̭","̮","̯","̰","̱","̲","̳","̹","̺","̻","̼","ͅ","͇","͈","͉","͍","͎","͓","͔","͕","͖","͙","͚","̣"],mid:["̕","̛","̀","́","͘","̡","̢","̧","̨","̴","̵","̶","͜","͝","͞","͟","͠","͢","̸","̷","͡"," ҉"]},s=[].concat(i.up,i.down,i.mid);function r(t){return Math.floor(Math.random()*t)}return function(t,e){var n,a,o="";for(a in(e=e||{}).up=void 0===e.up||e.up,e.mid=void 0===e.mid||e.mid,e.down=void 0===e.down||e.down,e.size=void 0!==e.size?e.size:"maxi",t=t.split("")){if(!function(t){var e=!1;return s.filter(function(i){e=i===t}),e}(a)){switch(o+=t[a],n={up:0,down:0,mid:0},e.size){case"mini":n.up=r(8),n.mid=r(2),n.down=r(8);break;case"maxi":n.up=r(16)+3,n.mid=r(4)+1,n.down=r(64)+3;break;default:n.up=r(8)+1,n.mid=r(6)/2,n.down=r(8)+1}var l=["up","mid","down"];for(var h in l){for(var u=l[h],c=0;c<=n[u];c++)e[u]&&(o+=i[u][r(i[u].length)])}}}return o}(t,e)}},9883:function(t,e,i){t=i.nmd(t);var s=i(2517);t.exports=function(){var t=function(t,e){String.prototype.__defineGetter__(t,e)};t("strip",function(){return s.strip(this)}),t("stripColors",function(){return s.strip(this)}),t("trap",function(){return s.trap(this)}),t("zalgo",function(){return s.zalgo(this)}),t("zebra",function(){return s.zebra(this)}),t("rainbow",function(){return s.rainbow(this)}),t("random",function(){return s.random(this)}),t("america",function(){return s.america(this)}),Object.keys(s.styles).forEach(function(e){t(e,function(){return s.stylize(this,e)})});s.setTheme=function(e){if("string"==typeof e){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}!function(e){var i=["__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","charAt","constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf","charCodeAt","indexOf","lastIndexOf","length","localeCompare","match","repeat","replace","search","slice","split","substring","toLocaleLowerCase","toLocaleUpperCase","toLowerCase","toUpperCase","trim","trimLeft","trimRight"];Object.keys(e).forEach(function(r){if(-1!==i.indexOf(r))console.log("warn: ".red+("String.prototype"+r).magenta+" is probably something you don't want to override. Ignoring style name");else if("string"==typeof e[r])s[r]=s[e[r]],t(r,function(){return s[r](this)});else{var n=function(t){for(var i=t||this,n=0;n<e[r].length;n++)i=s[e[r][n]](i);return i};t(r,n),s[r]=function(t){return n(t)}}})}(e)}}},3196:function(t,e,i){t=i.nmd(t);var s=i(2517);t.exports=s,i(9883)()},6260:function(t,e,i){(t=i.nmd(t)).exports=function(t){return function(e,i,s){if(" "===e)return e;switch(i%3){case 0:return t.red(e);case 1:return t.white(e);case 2:return t.blue(e)}}}},5920:function(t,e,i){(t=i.nmd(t)).exports=function(t){var e=["red","yellow","green","blue","magenta"];return function(i,s,r){return" "===i?i:t[e[s++%e.length]](i)}}},2449:function(t,e,i){(t=i.nmd(t)).exports=function(t){var e=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(i,s,r){return" "===i?i:t[e[Math.round(Math.random()*(e.length-2))]](i)}}},3270:function(t,e,i){(t=i.nmd(t)).exports=function(t){return function(e,i,s){return i%2==0?e:t.inverse(e)}}},5784:function(t,e,i){t=i.nmd(t);var s={};t.exports=s;var r={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(r).forEach(function(t){var e=r[t],i=s[t]=[];i.open="\x1b["+e[0]+"m",i.close="\x1b["+e[1]+"m"})},4340:function(t){t.exports=function(t,e){var i=(e=e||process.argv).indexOf("--"),s=/^-{1,2}/.test(t)?"":"--",r=e.indexOf(s+t);return -1!==r&&(-1===i||r<i)}},6561:function(t,e,i){var s=i(2037),r=i(4340),n=process.env,a=void 0;r("no-color")||r("no-colors")||r("color=false")?a=!1:(r("color")||r("colors")||r("color=true")||r("color=always"))&&(a=!0),"FORCE_COLOR"in n&&(a=0===n.FORCE_COLOR.length||0!==parseInt(n.FORCE_COLOR,10));function o(t){var e;return 0!==(e=function(t){if(!1===a)return 0;if(r("color=16m")||r("color=full")||r("color=truecolor"))return 3;if(r("color=256"))return 2;if(t&&!t.isTTY&&!0!==a)return 0;var e=a?1:0;if("win32"===process.platform){var i=s.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(i[0])>=10&&Number(i[2])>=10586?Number(i[2])>=14931?3:2:1}if("CI"in n)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(t){return t in n})||"codeship"===n.CI_NAME?1:e;if("TEAMCITY_VERSION"in n)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(n.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in n){var o=parseInt((n.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(n.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(n.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(n.TERM)||"COLORTERM"in n?1:(n.TERM,e)}(t))&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}t.exports={supportsColor:o,stdout:o(process.stdout),stderr:o(process.stderr)}},2763:function(t,e,i){i.d(e,{C:function(){return h}});var s=i(3460),r=i(9411),n=i.n(r),a=i(7147),o=i.n(a),l=i(1283);class h{constructor(t,e){this.config=t,this.blocks=e,this.matchers={export:RegExp("(?<=export \\* from ['\"`]).*(?=['\"`])","g")}}async write(){let t=`/* ${s.y9} */`,e=this.blocks.filter(t=>t.module.length).map(t=>t.autoloader).join(",\n"),i=`${t}
export default {
${e}
}
`,r=`autoloader.${this.config.output.language}`,a=n().resolve(this.config.output.path,r),h=await (0,l.nu)([a]);h.length&&JSON.stringify(h[0].contents)!==JSON.stringify(i)&&await o().promises.writeFile(a,i,{flag:"w"})}}},7216:function(t,e,i){i.d(e,{d:function(){return u}});var s=i(3460),r=i(9411),n=i.n(r),a=i(7147),o=i.n(a),l=i(3931),h=i(1283);class u{constructor(t,e){this.config=t,this.blocks=e,this.matchers={export:RegExp("(?<=export \\* from ['\"`]).*(?=['\"`])","g")},this.write=async()=>{let t=`/* ${s.y9} */`,e=this.blocks.filter(t=>t.module.length).map(t=>t.importExport).join("\n"),i=`${t}
${e}`,r=`index.${this.config.output.language}`,a=n().resolve(this.config.output.path,r),l=await (0,h.nu)([a]);l.length&&JSON.stringify(l[0].contents)!==JSON.stringify(i)&&await o().promises.writeFile(a,i,{flag:"w"})},this.clearObsoleteModules=async()=>{let t=this.config.output.language===l.iP.ts?l.iP.js:l.iP.ts,e=await (0,h.nu)([n().resolve(this.config.output.path,`index.${this.config.output.language}`)]);if(!e[0].success&&!(e=await (0,h.nu)([n().resolve(this.config.output.path,`index.${t}`)]))[0].success)return;let i=(e[0].contents.match(this.matchers.export)||[]).map(t=>n().resolve(this.config.output.path,t)),r=this.blocks.filter(t=>t.module.length).map(t=>{let e=n().parse(t.output);return n().resolve(n().join(e.dir,e.name))}),a=i.filter(t=>!r.includes(t)).map(t=>n().resolve(this.config.output.path,t)),u=a.map(t=>`${t}.${this.config.output.language}`),c=await (0,h.nu)(u),d=[],p=[];if(c.forEach((t,e)=>{t.success?t.contents.includes(s.y9)&&d.push(u[e]):p.push(a[e])}),p.length){let e=p.map(e=>`${e}.${t}`);(await (0,h.nu)(e)).forEach((t,e)=>{t.success&&t.contents.includes(s.y9)&&d.push(u[e])})}let f=d.map(t=>{let e=n().resolve(this.config.output.path,t);return o().promises.unlink(e)});await Promise.all(f),(0,h.Tw)(d.map(t=>n().dirname(t))).forEach(t=>{this.recursivelyDeleteEmptyDir(t)})},this.recursivelyDeleteEmptyDir=t=>{0===o().readdirSync(t).length&&(o().rmdirSync(t),this.recursivelyDeleteEmptyDir(n().resolve(t,"..")))}}}},5520:function(t,e,i){i.d(e,{g:function(){return p}});var s=i(8050),r=i(1283),n=i(3931),a=i(130),o=i(7147),l=i.n(o),h=i(9411),u=i.n(h),c=i(6002),d=i(3460);class p{constructor(t,e=""){this.config=t,this.name=e,this.elements=[],this.output="",this.module="",this.importExport="",this.autoloader="",this.generateModule=(t="HTMLElement")=>{let e=this.config.output.language===n.iP.ts,i=(0,a.v)({type:t,isTypeScript:e,className:(0,r.Y4)(this.name)}),o=this.elements.map(t=>t.generateTemplates(this.name,e));return(0,s.d)({rootSelector:`.${this.name}`,type:t,isTypeScript:e,elementClasses:o.map(t=>t.class).join("\n"),elementProperties:o.map(t=>t.property).filter(t=>t.length).join("\n"),elementReferences:o.map(t=>t.reference).filter(t=>t.length).join("\n"),className:this.config.output.moduleClass((0,r.Y4)(this.name)),rootReference:i,prefix:this.config.output.prefix,suffix:this.config.output.suffix,autoGeneratedDisclaimer:d.y9})},this.getImportExport=()=>{let t=u().relative(this.config.output.path,this.output).split(".").slice(0,-1).join("."),e=t.startsWith(".")?t:`./${t}`;return(0,c.F)(e)},this.getAutoloader=async()=>await new Promise(()=>""),this.writeModule=async()=>{this.autoloader=await this.getAutoloader();let t=u().dirname(this.output);if(!this.module.length)return;!l().existsSync(t)&&await l().promises.mkdir(t,{recursive:!0});let e=await (0,r.nu)([this.output]);e.length&&JSON.stringify(e[0].contents)!==JSON.stringify(this.module)&&await l().promises.writeFile(this.output,this.module,{flag:"w"})},this.init=async()=>{}}}},6404:function(t,e,i){i.d(e,{G:function(){return o}});var s=i(9411),r=i.n(s),n=i(5491),a=i(5520);class o extends a.g{constructor({config:t,name:e,elementStrings:i,allModifiers:s}){super(t,e),this.getAutoloader=async()=>` '.${this.name}': '${this.output}'`,this.getElements=(t,e)=>[this.config.input.rootMixinSuffix,...t].map(t=>new n.W({config:this.config,name:t.split(this.config.input.separators.element)[0],blockName:this.name,allModifiers:e,tags:[]}));let a=r().resolve(this.config.output.path,t.output.filename(this.name,t.output.language));this.output=r().relative(process.cwd(),a),this.importExport=this.getImportExport(),this.elements=this.getElements(i,s),this.module=this.generateModule()}}},5491:function(t,e,i){i.d(e,{W:function(){return c}});var s=i(1283),r=i(357),n=i(6637),a=i(4870),o=i(5337),l=i(3167),h=i(3460),u=i(5112);class c{constructor({config:t,name:e,blockName:i,allModifiers:c,context:d,tags:p}){this.props={},this.matchers={elementProps:(t,e)=>RegExp(`(?<=@mixin ${t}${this.config.input.separators.mixinElement}${e}\\s*\\()[^)]*`,"g"),invalidFirstCharacter:RegExp("^[\\d-].*","g")},this.getProps=(t,e)=>{let i=t.match(this.matchers.elementProps(e,this.name)),s={};return(null==i?void 0:i.length)&&i[0].substring(1).split(/,[ \t]*\$/g).forEach(t=>{let e=t.split(":");e[0]&&(s[e[0].trim()]=e[1].trim())}),{...this.props,...s}},this.generateTemplates=(t,e)=>{var i,l;let h=this.modifiers.map(i=>(0,r.H)({modifier:`${i.escaped?"_":""}${(0,s.qR)(i.name)}`,selector:`${t}${"root"===this.name?"":`${this.config.input.separators.element}${this.name}`}${this.config.input.separators.modifier}${i.name}`,isTypeScript:e})),c=this.config.output.elementClass((0,s.Y4)(t,this.name)),d=Object.entries(this.props).filter(([t])=>!["type","single"].includes(t)).map(([t,e])=>(0,u.V)({key:t,value:e})),p=null!==(i=this.props.type)&&void 0!==i?i:this.typeFromTags(),f=(0,n.v)({isTypeScript:e,className:c,selector:`.${t}${"root"===this.name?"":`${this.config.input.separators.element}${this.name}`}`,type:p,modifiers:h.join(""),args:d.join("")});return"root"===this.name?{class:f,reference:"",property:""}:{class:f,reference:(0,a.j)({isTypeScript:e,className:c,block:t,element:this,separators:this.config.input.separators,type:p}),property:(0,o.U)({isTypeScript:e,className:c,element:this.escapedName,single:JSON.parse(null!==(l=this.props.single)&&void 0!==l?l:"false")})}},this.typeFromTags=()=>{let t={a:"HTMLAnchorElement",area:"HTMLAreaElement",audio:"HTMLAudioElement",base:"HTMLBaseElement",blockquote:"HTMLQuoteElement",body:"HTMLBodyElement",br:"HTMLBRElement",button:"HTMLButtonElement",canvas:"HTMLCanvasElement",caption:"HTMLTableCaptionElement",col:"HTMLTableColElement",colgroup:"HTMLTableColElement",data:"HTMLDataElement",datalist:"HTMLDataListElement",del:"HTMLModElement",details:"HTMLDetailsElement",dialog:"HTMLDialogElement",div:"HTMLDivElement",dl:"HTMLDListElement",embed:"HTMLEmbedElement",fieldset:"HTMLFieldSetElement",form:"HTMLFormElement",h1:"HTMLHeadingElement",h2:"HTMLHeadingElement",h3:"HTMLHeadingElement",h4:"HTMLHeadingElement",h5:"HTMLHeadingElement",h6:"HTMLHeadingElement",head:"HTMLHeadElement",hr:"HTMLHRElement",html:"HTMLHtmlElement",iframe:"HTMLIFrameElement",img:"HTMLImageElement",input:"HTMLInputElement",ins:"HTMLModElement",label:"HTMLLabelElement",legend:"HTMLLegendElement",li:"HTMLLIElement",link:"HTMLLinkElement",map:"HTMLMapElement",menu:"HTMLMenuElement",meta:"HTMLMetaElement",meter:"HTMLMeterElement",object:"HTMLObjectElement",ol:"HTMLOListElement",optgroup:"HTMLOptGroupElement",option:"HTMLOptionElement",output:"HTMLOutputElement",p:"HTMLParagraphElement",picture:"HTMLPictureElement",pre:"HTMLPreElement",progress:"HTMLProgressElement",q:"HTMLQuoteElement",script:"HTMLScriptElement",select:"HTMLSelectElement",slot:"HTMLSlotElement",source:"HTMLSourceElement",span:"HTMLSpanElement",style:"HTMLStyleElement",table:"HTMLTableElement",tbody:"HTMLTableSectionElement",td:"HTMLTableCellElement",template:"HTMLTemplateElement",textarea:"HTMLTextAreaElement",tfoot:"HTMLTableSectionElement",th:"HTMLTableCellElement",thead:"HTMLTableSectionElement",time:"HTMLTimeElement",title:"HTMLTitleElement",tr:"HTMLTableRowElement",track:"HTMLTrackElement",ul:"HTMLUListElement",video:"HTMLVideoElement"};return this.tags.map(e=>{var i;return null!==(i=t[e])&&void 0!==i?i:"HTMLElement"}).sort().join(" | ")||"HTMLElement"},this.name=e,this.tags=p,this.config=t,this.selector="root"===e?i:`${i}${t.input.separators.element}${e}`;let f=h.wx.includes((0,s.qR)(e)),m=(e.match(this.matchers.invalidFirstCharacter)||[]).length>0;f&&console.warn(l.Z.reservedElement(i,e)),m&&console.warn(l.Z.numericElement(i,e)),this.escapedName=f||m?`_${e}`:e;let g=(0,s.Tw)(c.filter(e=>e.startsWith(`${this.selector}${t.input.separators.modifier}`)));this.modifiers=g.map(e=>{var i;let s;let r=null!==(i=e.split(t.input.separators.modifier).pop())&&void 0!==i?i:"";return h.wx.includes(r)?s=l.Z.reservedModifier(this.selector,r):(r.match(this.matchers.invalidFirstCharacter)||[]).length&&(s=l.Z.numericModifier(this.selector,r)),s&&console.warn(s),{name:r,escaped:!!s}}),d&&(this.props=this.getProps(d,i))}}},6377:function(t,e,i){i.d(e,{N:function(){return c}});var s=i(9411),r=i.n(s),n=i(7147),a=i.n(n),o=i(3931),l=i(5491),h=i(5520),u=i(1283);class c extends h.g{constructor({config:t,inputPath:e,allModifiers:i,templateTagMap:s}){super(t),this.input="",this.matchers={removeComments:t=>t.replace(/\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*/g,""),element:t=>RegExp(`(?<=&${this.config.input.separators.element})[^\\s{(]*(?=.*\\r?\\n.*@include ${t}${this.config.input.separators.mixinElement})`,"g"),templateElement:t=>RegExp(`(?<=\\s?${t}${this.config.input.separators.element})[^-\\s]+(?:-[^-\\s]+)*(?=--|\\s|$)`,"g"),hasIndex:t=>RegExp(`@mixin ${t}[^.-]*\\.${t} {`),hasAnElement:t=>RegExp(`@mixin ${t}${this.config.input.separators.mixinElement}.*`),rootProps:t=>RegExp(`(?<=@mixin ${t}${this.config.input.separators.mixinElement}root\\s*\\()[^)]*`,"g")},this.getAutoloader=async()=>{let t=r().relative(process.cwd(),r().resolve(`${r().dirname(this.inputPath)}/${r().parse(this.inputPath).name}.${this.config.output.language}`)),e=await (0,u.nu)([t]);return` '.${this.name}': '${e.length?t:this.output}'`},this.init=async()=>{let t=await a().promises.readFile(this.inputPath).then(t=>t.toString());if(this.input=this.matchers.removeComments(t),!this.verifyFileIsBlock())return;this.elements=this.getElements();let e=this.elements.find(t=>"root"===t.name);this.module=this.generateModule(null==e?void 0:e.props.type)},this.getElements=()=>{var t;let e=["root",...(null===(t=this.input)||void 0===t?void 0:t.match(this.matchers.element(this.name)))||[]],i=[...new Set(Object.values(this.templateTagMap).join(" ").match(this.matchers.templateElement(this.name))||[])].filter(t=>!e.includes(t)).map(t=>t.trim());return[...new Set([...e,...i])].sort().map(t=>{let e="root"===t?[]:Object.entries(this.templateTagMap).filter(([,e])=>` ${e} `.includes(` ${this.name}${this.config.input.separators.element}${t} `)).map(([t])=>t);return new l.W({config:this.config,name:t.trim(),blockName:this.name,allModifiers:this.allModifiers,context:this.input,tags:e})})},this.verifyFileIsBlock=()=>{let t=this.input.match(this.matchers.hasAnElement(this.name)),e=this.input.match(this.matchers.hasIndex(this.name));return(null==t?void 0:t.length)&&(null==e?void 0:e.length)},this.allModifiers=i,this.inputPath=e,this.templateTagMap=s;let n=r().parse(e).name;this.name=n.startsWith("_")?n.substring(1):n;let h=r().resolve(t.output.mode===o.HZ.relative?r().dirname(e):this.config.output.path,t.output.filename(this.name,t.output.language));this.output=r().relative(process.cwd(),h),this.importExport=this.getImportExport()}}},7690:function(t,e,i){i.d(e,{I:function(){return l}});var s=i(1017),r=i.n(s),n=i(7147),a=i.n(n),o=i(5401);class l{constructor(t){this.config=t,this.prevTimestamps=new Map,this.getChangedFiles=t=>{let e=[],i=new Set;for(let t of this.config.input.include)o.zA.sync(t,{absolute:!0}).forEach(t=>i.add(r().resolve(t)));if(t.fileDependencies)for(let s of t.fileDependencies){if(!i.has(r().resolve(s)))continue;let t=this.prevTimestamps.get(s),n=a().existsSync(s)?a().statSync(s):null,o=n?n.mtimeMs:1/0;this.prevTimestamps.set(s,o),(!t||t<o)&&e.push(s)}return e}}}},3460:function(t,e,i){i.d(e,{dj:function(){return s},wx:function(){return n},y9:function(){return r}});let s="@bem-plus/class-generator",r="This file was automatically generated by the bem-plus package.",n=["apply","bind","call","constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toString","toLocaleString","valueOf","prototype","length","el"]},3675:function(t,e,i){i.d(e,{I:function(){return r}});var s=i(3460);class r extends Error{constructor(t,e){super(`${s.dj}: ${t.length?`${e} cannot be separated by "${t}".`:`${e} must be separated by at least one character.`}`),this.name="InvalidSeparatorError"}}},1600:function(t,e,i){i.d(e,{o:function(){return r}});var s=i(3460);class r extends Error{constructor(){super(`${s.dj}: Cannot use the same separator for elements and modifiers`),this.name="SameSeparatorError"}}},782:function(t,e,i){i.d(e,{o:function(){return f}});var s=i(5401),r=i(3931),n=i(9411),a=i.n(n),o=i(6377),l=i(1283),h=i(6404),u=i(7216),c=i(1600),d=i(3675),p=i(2763);class f{constructor(t){this.config=t,this.distPath="",this.blocks=[],this.templateTagMap={},this.matchers={bemSeparator:RegExp(`${this.config.input.separators.element}|${this.config.input.separators.modifier}`),blockElement:RegExp(`[^(\\d.\\r\\n]*${this.config.input.separators.element}.+?(?=${this.config.input.separators.modifier}|[ .,[:#{)>+])`,"g"),blockElementModifier:RegExp(`(?<!(var\\(|{|;))[^(.\\n!{]*${this.config.input.separators.modifier}[^ .,[:#{)>+]*`,"g"),elementMixins:t=>RegExp(`(?<!(\\/\\/.*))@mixin ${t}${this.config.input.separators.mixinElement}[\\s\\S]*?(?<![ \\S])}`,"g"),elementName:t=>RegExp(`(?<!(\\/\\/.*))(?<=@mixin ${t}${this.config.input.separators.mixinElement})[^{ (]*`),subSelectors:RegExp("(?<!(\\/\\/.*))(&|@at-root|@scope| \\.).*(?<!([ {]))","g"),ampModifier:RegExp(`(?<!(\\/\\/.*))(?<=&${this.config.input.separators.modifier})[^ ,:>+~.#[|)\\s]*`,"g"),subModifier:RegExp(`(?<!(\\/\\/.*))(?<=\\.)[^)\\s.]*${this.config.input.separators.modifier}[^ ),:>+~.#[|\\s]*`,"g"),template:RegExp("(<[a-zA-Z-0-9]+)(?=[^>]*class(Name)?=[\"'][^\"']*(?=[ \"'])[^\"']*[\"'][^>]*>)|(?<=<[^>]*class(Name)?=[\"'])((?:[^\"']|@\\(.*?\\))*)(?=[\"'])","g")},this.generate=async t=>{if(this.distPath=t,this.templateTagMap=await this.getTemplateTagMap(),this.blocks=this.config.strategy===r.Dw.plus?await this.getPlusBlocks():await this.getDistBlocks(),await this.initBlocks(),await this.writeModules(),this.config.output.mode===r.HZ.absolute){let t=new u.d(this.config,this.blocks);await t.clearObsoleteModules(),await t.write()}if(this.config.output.autoloader){let t=new p.C(this.config,this.blocks);await t.write()}this.config.output.onComplete()},this.initBlocks=async()=>{let t=this.blocks.map(t=>t.init());await Promise.all(t)},this.writeModules=async()=>{let t=this.blocks.map(t=>t.writeModule());await Promise.all(t)},this.getPlusBlocks=async()=>{let t=await (0,s.zA)(this.config.input.include,{ignore:this.config.input.exclude}),e=await this.getPlusModifiers(t);return t.map(t=>new o.N({config:this.config,inputPath:t,allModifiers:e,templateTagMap:this.templateTagMap}))},this.getDistBlocks=async()=>{let t=await this.getBuiltContent(),e=t.match(this.matchers.blockElementModifier)||[],i=t.match(this.matchers.blockElement)||[],s=i.map(t=>t.split(this.config.input.separators.element)[0]),r=e.map(t=>t.split(this.matchers.bemSeparator)[0]);return(0,l.Tw)([...s,...r]).filter(t=>!this.config.input.excludeBlocks.includes(t)).map(t=>new h.G({config:this.config,name:t,elementStrings:i,allModifiers:e}))},this.getPlusModifiers=async t=>{let e=await (0,l.nu)(t),i=[];return e.forEach(t=>{let e=a().parse(t.filePath).name,s=e.startsWith("_")?e.substring(1):e;if(t.success){let e=t.contents.match(this.matchers.elementMixins(s));null==e||e.forEach(t=>{let e=t.match(this.matchers.elementName(s)),r=t.match(this.matchers.subSelectors);null==r||r.forEach(t=>{var r,n;let a=null!==(r=t.match(this.matchers.ampModifier))&&void 0!==r?r:[],o=null!==(n=t.match(this.matchers.subModifier))&&void 0!==n?n:[];i.push(...o),a.forEach(t=>{"root"===e[0]?i.push(`${s}${this.config.input.separators.modifier}${t}`):i.push(`${s}${this.config.input.separators.element}${e[0]}${this.config.input.separators.modifier}${t}`)})})})}}),(0,l.Tw)(i.sort())},this.getTemplateTagMap=async()=>{let t=await (0,s.zA)(this.config.input.templates,{ignore:this.config.input.exclude}),e=await (0,l.nu)(t),i={},r=e.flatMap(t=>t.contents.match(this.matchers.template)||[]);return r.forEach((t,e)=>{var s;if(t.startsWith("<")){let n=t.substring(1);r[e+1]&&!r[e+1].startsWith("<")&&(i[n]=`${null!==(s=i[n])&&void 0!==s?s:""} ${r[e+1].replace(/@\([^"']*(?=")|@[^ ]*|["'&|)]|\n/g,"")}`)}}),i},this.validateSeparators=()=>{if(this.config.input.separators.modifier===this.config.input.separators.element)throw new c.o;if(["-",""].includes(this.config.input.separators.modifier))throw new d.I(this.config.input.separators.modifier,"The modifier portion of a BEM selector");if(["-",""].includes(this.config.input.separators.element))throw new d.I(this.config.input.separators.element,"The element portion of a BEM selector");if([""].includes(this.config.input.separators.mixinElement))throw new d.I(this.config.input.separators.mixinElement,"The element portion of a mixin name")},this.getBuiltContent=async()=>{let t=await (0,s.zA)(`${this.distPath}/**/*.css`);return(await (0,l.nu)(t)).map(t=>t.contents).join(" ")},this.validateSeparators()}}},3167:function(t,e,i){var s=i(3460),r=i(3196),n=i.n(r),a=i(1283);e.Z={numericElement:(t,e)=>n().yellow(`${s.dj}: Element "${e}" of block "${t}" starts with a number or a "-". This is valid CSS but it does not result in a valid JavaScript property name. Because of this, element "${e} will be prefixed with "_": "_${(0,a.qR)(e)}".`),numericModifier:(t,e)=>n().yellow(`${s.dj}: Modifier "${e}" of selector "${t}" starts with a number or a "-". This is valid CSS but it does not result in valid JavaScript getters and setters. Because of this, modifier "${e}" will be prefixed with "_": "_${(0,a.qR)(e)}".`),reservedElement:(t,e)=>n().yellow(`${s.dj}: Element "${e}" of block "${t}" results in a method or property name that is reserved in JavaScript: "${(0,a.qR)(e)}". Because of this, element "${e}" will be prefixed with "_": "_${(0,a.qR)(e)}".`),reservedModifier:(t,e)=>n().yellow(`${s.dj}: Modifier "${e}" of selector "${t} results in a method or property name that is reserved in JavaScript: "${(0,a.qR)(e)}". Because of this, modifier "${e}" will be prefixed with "_": "_${(0,a.qR)(e)}".`)}},5795:function(t,e,i){i.d(e,{D:function(){return u},d:function(){return h}});var s=i(8932),r=i(3931);let n={strategy:r.Dw.dist,input:{include:["**/*.{scss,sass}"],templates:[],exclude:["node_modules/**"],excludeBlocks:[],rootMixinSuffix:"root",separators:{element:"__",modifier:"--",mixinElement:"-"}},output:{autoloader:!1,language:r.iP.ts,mode:r.HZ.absolute,path:"./.bem-plus",filename:(t,e)=>`${t}.generated.${e}`,prefix:"",suffix:"",elementClass:t=>`${t}Element`,moduleClass:t=>t,onComplete:()=>{}}},a=s.z.object({element:s.z.string().optional(),modifier:s.z.string().optional(),mixinElement:s.z.string().optional()}),o=s.z.object({include:s.z.array(s.z.string()).optional(),templates:s.z.array(s.z.string()).optional(),exclude:s.z.array(s.z.string()).optional(),excludeBlocks:s.z.array(s.z.string()).optional(),rootMixinSuffix:s.z.string().optional(),separators:a.optional()}),l=s.z.object({autoloader:s.z.boolean().optional(),language:s.z.union([s.z.literal("js"),s.z.literal("ts")]).optional(),mode:s.z.union([s.z.literal("relative"),s.z.literal("absolute")]).optional(),path:s.z.string().optional(),filename:s.z.function().args(s.z.string(),s.z.string()).returns(s.z.string()).optional(),prefix:s.z.string().optional(),suffix:s.z.string().optional(),elementClass:s.z.function().args(s.z.string()).returns(s.z.string()).optional(),moduleClass:s.z.function().args(s.z.string()).returns(s.z.string()).optional(),onComplete:s.z.function().optional()}),h=s.z.array(s.z.object({strategy:s.z.union([s.z.literal("plus"),s.z.literal("dist")]).optional(),input:o.optional(),output:l.optional()})),u=t=>h.parse(t).map(t=>{var e,i;return{strategy:null!==(e=t.strategy)&&void 0!==e?e:n.strategy,input:{...n.input,...t.input,separators:{...n.input.separators,...null===(i=t.input)||void 0===i?void 0:i.separators}},output:{...n.output,...t.output}}})},5112:function(t,e,i){i.d(e,{V:function(){return s}});let s=({key:t,value:e})=>`$${t} = ${e}
`},6637:function(t,e,i){i.d(e,{v:function(){return r}});var s=i(1283);let r=({isTypeScript:t,className:e,selector:i,type:r,modifiers:n,args:a})=>`export class ${e} {
${(0,s.WY)(n,1)}
static el = '${i}'
${(0,s.WY)(a,1)}
constructor(public el${(0,s.UR)(r,t)}) {}
}
`},5337:function(t,e,i){i.d(e,{U:function(){return r}});var s=i(1283);let r=({isTypeScript:t,className:e,element:i,single:r})=>`${(0,s.qR)(i)}${(0,s.UR)(`${e}${r?"":"[]"}`,t,r)}${r?"":" = []"}
`},4870:function(t,e,i){i.d(e,{j:function(){return r}});var s=i(1283);let r=({isTypeScript:t,className:e,block:i,element:r,separators:n,type:a})=>{if(r.props.single){let o=`this.root.el.querySelector${(0,s.Sl)(a,t)}('.${i}${n.element}${r.name}')`;return`
const ${(0,s.qR)(r.escapedName)} = ${o}
this.${(0,s.qR)(r.escapedName)} = ${(0,s.qR)(r.escapedName)} ? new ${e}(${(0,s.qR)(r.escapedName)}) : undefined`}return`this.${(0,s.qR)(r.escapedName)} = [...this.root.el.querySelectorAll${(0,s.Sl)(a,t)}('.${i}${n.element}${r.name}')].map((el) => new ${e}(el))`}},6002:function(t,e,i){i.d(e,{F:function(){return s}});let s=t=>`export * from '${t}'`},357:function(t,e,i){i.d(e,{H:function(){return r}});var s=i(1283);let r=({modifier:t,selector:e,isTypeScript:i})=>`
static ${t} = '.${e}'
get ${t}() {
return this.el.classList.contains('${e}')
}
set ${t}(value${(0,s.UR)("boolean",i)}) {
this.el.classList.toggle('${e}', value)
}
`},8050:function(t,e,i){i.d(e,{d:function(){return r}});var s=i(1283);let r=({rootSelector:t,type:e,isTypeScript:i,className:r,elementProperties:n,elementClasses:a,rootReference:o,elementReferences:l,autoGeneratedDisclaimer:h,prefix:u="",suffix:c=""})=>`/* ${h} */
${u}
import { BemPlusModule } from '@bem-plus/class-generator/module'
${a}
export class ${r} extends BemPlusModule {
root;
static selector = '${t}';
${(0,s.WY)(n,1)}
constructor(rootElement${(0,s.UR)("Element",i)}) {
super(${(0,s.Sl)(e,i)}rootElement)
${o}
this.refresh()
}
refresh = () => {
${(0,s.WY)(l,2)}
}
}
${c}
`},130:function(t,e,i){i.d(e,{v:function(){return r}});var s=i(1283);let r=({type:t,isTypeScript:e,className:i})=>`this.root = new ${i}RootElement(${(0,s.Sl)(t,e)}rootElement)`},3931:function(t,e,i){var s,r,n,a,o,l;i.d(e,{Dw:function(){return n},HZ:function(){return s},iP:function(){return r}}),(a=s||(s={})).absolute="absolute",a.relative="relative",(o=r||(r={})).js="js",o.ts="ts",(l=n||(n={})).dist="dist",l.plus="plus"},1283:function(t,e,i){i.d(e,{Sl:function(){return h},Tw:function(){return o},UR:function(){return u},WY:function(){return l},Y4:function(){return a},nu:function(){return c},qR:function(){return n}});var s=i(7147),r=i.n(s);let n=t=>{let e=t.startsWith("_"),i=t.replace(/[_-][^_\-A-Z]|(?<=[A-Z])[A-Z]/g,t=>t.toLowerCase()===t?t.toUpperCase():t.toLowerCase()).replace(/[-_]/g,"");return`${e?"_":""}${i.charAt(0).toLowerCase()}${i.slice(1)}`},a=(...t)=>{let e=n(t.join("-"));return e.charAt(0).toUpperCase()+e.slice(1)},o=t=>[...new Set(t)],l=(t,e)=>{let i=t.split(/\n/),s="";for(let t=0;t<e;t++)s=` ${s}`;return i.join(`
${s}`)},h=(t,e)=>e?`<${t}>`:"",u=(t,e,i)=>e?`${i?"?":""}: ${t}`:"",c=async t=>{let e=t.map(t=>r().promises.readFile(t));return(await Promise.allSettled(e)).map((e,i)=>"fulfilled"===e.status?{success:!0,contents:e.value.toString(),filePath:t[i]}:{success:!1,contents:""})}},1450:function(t,e,i){i.d(e,{Uv:function(){return s},WM:function(){return a}});class s{constructor(t,...e){this.refresh=()=>{},new MutationObserver(()=>{this.refresh()}).observe(t,{childList:!0,subtree:!0})}}let r=[],n=new class t{constructor(){this.factories=new Map}register(t,e){this.factories.set(t,e)}resolve(t){let e=this.factories.get(t);if(!e)throw Error(`No provider for ${t.toString()}`);return e()}},a=(t,e=[])=>{o(()=>{document.querySelectorAll(t.selector).forEach(i=>{e.forEach(t=>{i&&n.register(t,()=>{if(Array.isArray(t))return[...i.querySelectorAll(t[0].selector)].map(e=>new t[0](e));let e=i.querySelector(t.selector);if(e)return new t(e)})});let s=e.map(t=>n.resolve(t));r.push({selector:t.selector,module:new t(i,...s)})})})},o=t=>{"interactive"===document.readyState?t():document.addEventListener("DOMContentLoaded",t)}},7147:function(e){e.exports=t(import.meta.url)("fs")},5673:function(e){e.exports=t(import.meta.url)("node:events")},7561:function(e){e.exports=t(import.meta.url)("node:fs")},3977:function(e){e.exports=t(import.meta.url)("node:fs/promises")},9411:function(e){e.exports=t(import.meta.url)("node:path")},4492:function(e){e.exports=t(import.meta.url)("node:stream")},6915:function(e){e.exports=t(import.meta.url)("node:string_decoder")},1041:function(e){e.exports=t(import.meta.url)("node:url")},2037:function(e){e.exports=t(import.meta.url)("os")},1017:function(e){e.exports=t(import.meta.url)("path")},3837:function(e){e.exports=t(import.meta.url)("util")},9663:function(t,e,i){i.d(e,{j:function(){return _}});var s=i(3653);let r="\0SLASH"+Math.random()+"\0",n="\0OPEN"+Math.random()+"\0",a="\0CLOSE"+Math.random()+"\0",o="\0COMMA"+Math.random()+"\0",l="\0PERIOD"+Math.random()+"\0",h=RegExp(r,"g"),u=RegExp(n,"g"),c=RegExp(a,"g"),d=RegExp(o,"g"),p=RegExp(l,"g"),f=/\\\\/g,m=/\\{/g,g=/\\}/g,y=/\\,/g,v=/\\./g;function b(t){return isNaN(t)?t.charCodeAt(0):parseInt(t,10)}function w(t){return t.replace(h,"\\").replace(u,"{").replace(c,"}").replace(d,",").replace(p,".")}function _(t,e={}){if(!t)return[];let{max:i=1e5}=e;return"{}"===t.slice(0,2)&&(t="\\{\\}"+t.slice(2)),(function t(e,i,r){let n=[],o=(0,s.M)("{","}",e);if(!o)return[e];let l=o.pre,h=o.post.length?t(o.post,i,!1):[""];if(/\$$/.test(o.pre))for(let t=0;t<h.length&&t<i;t++){let e=l+"{"+o.body+"}"+h[t];n.push(e)}else{let u,c;let d=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(o.body),p=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(o.body),f=d||p,m=o.body.indexOf(",")>=0;if(!f&&!m)return o.post.match(/,(?!,).*\}/)?t(e=o.pre+"{"+o.body+a+o.post,i,!0):[e];if(f)u=o.body.split(/\.\./);else if(1===(u=function t(e){if(!e)return[""];let i=[],r=(0,s.M)("{","}",e);if(!r)return e.split(",");let{pre:n,body:a,post:o}=r,l=n.split(",");l[l.length-1]+="{"+a+"}";let h=t(o);return o.length&&(l[l.length-1]+=h.shift(),l.push.apply(l,h)),i.push.apply(i,l),i}(o.body)).length&&void 0!==u[0]&&1===(u=t(u[0],i,!1).map(x)).length)return h.map(t=>o.pre+u[0]+t);if(f&&void 0!==u[0]&&void 0!==u[1]){let t=b(u[0]),e=b(u[1]),i=Math.max(u[0].length,u[1].length),s=3===u.length&&void 0!==u[2]?Math.abs(b(u[2])):1,r=S;e<t&&(s*=-1,r=E);let n=u.some(k);c=[];for(let a=t;r(a,e);a+=s){let t;if(p)"\\"===(t=String.fromCharCode(a))&&(t="");else if(t=String(a),n){let e=i-t.length;if(e>0){let i=Array(e+1).join("0");t=a<0?"-"+i+t.slice(1):i+t}}c.push(t)}}else{c=[];for(let e=0;e<u.length;e++)c.push.apply(c,t(u[e],i,!1))}for(let t=0;t<c.length;t++)for(let e=0;e<h.length&&n.length<i;e++){let i=l+c[t]+h[e];(!r||f||i)&&n.push(i)}}return n})(t.replace(f,r).replace(m,n).replace(g,a).replace(y,o).replace(v,l),i,!0).map(w)}function x(t){return"{"+t+"}"}function k(t){return/^-?0\d/.test(t)}function S(t,e){return t<=e}function E(t,e){return t>=e}},3653:function(t,e,i){i.d(e,{M:function(){return s}});let s=(t,e,i)=>{let s=t instanceof RegExp?r(t,i):t,a=e instanceof RegExp?r(e,i):e,o=null!==s&&null!=a&&n(s,a,i);return o&&{start:o[0],end:o[1],pre:i.slice(0,o[0]),body:i.slice(o[0]+s.length,o[1]),post:i.slice(o[1]+a.length)}},r=(t,e)=>{let i=e.match(t);return i?i[0]:null},n=(t,e,i)=>{let s,r,n,a,o;let l=i.indexOf(t),h=i.indexOf(e,l+1),u=l;if(l>=0&&h>0){if(t===e)return[l,h];for(s=[],n=i.length;u>=0&&!o;){if(u===l)s.push(u),l=i.indexOf(t,u+1);else if(1===s.length){let t=s.pop();void 0!==t&&(o=[t,h])}else void 0!==(r=s.pop())&&r<n&&(n=r,a=h),h=i.indexOf(e,u+1);u=l<h&&l>=0?l:h}s.length&&void 0!==a&&(o=[n,a])}return o}},4107:function(t,e,i){i.d(e,{r:function(){return h}});var s=i(2832),r=i(1041),n=i(8913),a=i(539),o=i(6859);let l="object"==typeof process&&process&&"string"==typeof process.platform?process.platform:"linux";class h{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(t,e){if(!e)throw TypeError("glob options required");if(this.withFileTypes=!!e.withFileTypes,this.signal=e.signal,this.follow=!!e.follow,this.dot=!!e.dot,this.dotRelative=!!e.dotRelative,this.nodir=!!e.nodir,this.mark=!!e.mark,e.cwd?(e.cwd instanceof URL||e.cwd.startsWith("file://"))&&(e.cwd=(0,r.fileURLToPath)(e.cwd)):this.cwd="",this.cwd=e.cwd||"",this.root=e.root,this.magicalBraces=!!e.magicalBraces,this.nobrace=!!e.nobrace,this.noext=!!e.noext,this.realpath=!!e.realpath,this.absolute=e.absolute,this.includeChildMatches=!1!==e.includeChildMatches,this.noglobstar=!!e.noglobstar,this.matchBase=!!e.matchBase,this.maxDepth="number"==typeof e.maxDepth?e.maxDepth:1/0,this.stat=!!e.stat,this.ignore=e.ignore,this.withFileTypes&&void 0!==this.absolute)throw Error("cannot set absolute and withFileTypes:true");if("string"==typeof t&&(t=[t]),this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||!1===e.allowWindowsEscape,this.windowsPathsNoEscape&&(t=t.map(t=>t.replace(/\\/g,"/"))),this.matchBase){if(e.noglobstar)throw TypeError("base matching requires globstar");t=t.map(t=>t.includes("/")?t:`./**/${t}`)}if(this.pattern=t,this.platform=e.platform||l,this.opts={...e,platform:this.platform},e.scurry){if(this.scurry=e.scurry,void 0!==e.nocase&&e.nocase!==e.scurry.nocase)throw Error("nocase option contradicts provided scurry option")}else{let t="win32"===e.platform?n.U1:"darwin"===e.platform?n.FI:e.platform?n.uB:n.MA;this.scurry=new t(this.cwd,{nocase:e.nocase,fs:e.fs})}this.nocase=this.scurry.nocase;let i="darwin"===this.platform||"win32"===this.platform,o={...e,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:i,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},[h,u]=this.pattern.map(t=>new s.m8(t,o)).reduce((t,e)=>(t[0].push(...e.set),t[1].push(...e.globParts),t),[[],[]]);this.patterns=h.map((t,e)=>{let i=u[e];if(!i)throw Error("invalid pattern object");return new a.c(t,i,0,this.platform)})}async walk(){return[...await new o.MS(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new o.MS(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new o.bV(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new o.bV(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}}},724:function(t,e,i){i.d(e,{P:function(){return r}});var s=i(2832);let r=(t,e={})=>{for(let i of(!Array.isArray(t)&&(t=[t]),t))if(new s.m8(i,e).hasMagic())return!0;return!1}},6742:function(t,e,i){i.d(e,{j:function(){return a}});var s=i(2832),r=i(539);let n="object"==typeof process&&process&&"string"==typeof process.platform?process.platform:"linux";class a{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(t,{nobrace:e,nocase:i,noext:s,noglobstar:r,platform:a=n}){for(let n of(this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=a,this.mmopts={dot:!0,nobrace:e,nocase:i,noext:s,noglobstar:r,optimizationLevel:2,platform:a,nocomment:!0,nonegate:!0},t))this.add(n)}add(t){let e=new s.m8(t,this.mmopts);for(let t=0;t<e.set.length;t++){let i=e.set[t],n=e.globParts[t];if(!i||!n)throw Error("invalid pattern object");for(;"."===i[0]&&"."===n[0];)i.shift(),n.shift();let a=new r.c(i,n,0,this.platform),o=new s.m8(a.globString(),this.mmopts),l="**"===n[n.length-1],h=a.isAbsolute();h?this.absolute.push(o):this.relative.push(o),l&&(h?this.absoluteChildren.push(o):this.relativeChildren.push(o))}}ignored(t){let e=t.fullpath(),i=`${e}/`,s=t.relative()||".",r=`${s}/`;for(let t of this.relative)if(t.match(s)||t.match(r))return!0;for(let t of this.absolute)if(t.match(e)||t.match(i))return!0;return!1}childrenIgnored(t){let e=t.fullpath()+"/",i=(t.relative()||".")+"/";for(let t of this.relativeChildren)if(t.match(i))return!0;for(let t of this.absoluteChildren)if(t.match(e))return!0;return!1}}},5401:function(t,e,i){i.d(e,{zA:function(){return m}});var s=i(2832),r=i(4107),n=i(724);function a(t,e={}){return new r.r(t,e).streamSync()}function o(t,e={}){return new r.r(t,e).stream()}function l(t,e={}){return new r.r(t,e).walkSync()}async function h(t,e={}){return new r.r(t,e).walk()}function u(t,e={}){return new r.r(t,e).iterateSync()}function c(t,e={}){return new r.r(t,e).iterate()}i(6742);let d=Object.assign(o,{sync:a}),p=Object.assign(c,{sync:u}),f=Object.assign(l,{stream:a,iterate:u}),m=Object.assign(h,{glob:h,globSync:l,sync:f,globStream:o,stream:d,globStreamSync:a,streamSync:a,globIterate:c,iterate:p,globIterateSync:u,iterateSync:u,Glob:r.r,hasMagic:n.P,escape:s.YU,unescape:s.AK});m.glob=m},539:function(t,e,i){i.d(e,{c:function(){return a}});var s=i(2832);let r=t=>t.length>=1,n=t=>t.length>=1;class a{#t;#e;#i;length;#s;#r;#n;#a;#o;#l;#h=!0;constructor(t,e,i,s){if(!r(t))throw TypeError("empty pattern list");if(!n(e))throw TypeError("empty glob list");if(e.length!==t.length)throw TypeError("mismatched pattern list and glob list lengths");if(this.length=t.length,i<0||i>=this.length)throw TypeError("index out of range");if(this.#t=t,this.#e=e,this.#i=i,this.#s=s,0===this.#i){if(this.isUNC()){let[t,e,i,s,...r]=this.#t,[n,a,o,l,...h]=this.#e;""===r[0]&&(r.shift(),h.shift());let u=[t,e,i,s,""].join("/"),c=[n,a,o,l,""].join("/");this.#t=[u,...r],this.#e=[c,...h],this.length=this.#t.length}else if(this.isDrive()||this.isAbsolute()){let[t,...e]=this.#t,[i,...s]=this.#e;""===e[0]&&(e.shift(),s.shift());this.#t=[t+"/",...e],this.#e=[i+"/",...s],this.length=this.#t.length}}}pattern(){return this.#t[this.#i]}isString(){return"string"==typeof this.#t[this.#i]}isGlobstar(){return this.#t[this.#i]===s.k1}isRegExp(){return this.#t[this.#i]instanceof RegExp}globString(){return this.#n=this.#n||(0===this.#i?this.isAbsolute()?this.#e[0]+this.#e.slice(1).join("/"):this.#e.join("/"):this.#e.slice(this.#i).join("/"))}hasMore(){return this.length>this.#i+1}rest(){return void 0!==this.#r?this.#r:this.hasMore()?(this.#r=new a(this.#t,this.#e,this.#i+1,this.#s),this.#r.#l=this.#l,this.#r.#o=this.#o,this.#r.#a=this.#a,this.#r):this.#r=null}isUNC(){let t=this.#t;return void 0!==this.#o?this.#o:this.#o="win32"===this.#s&&0===this.#i&&""===t[0]&&""===t[1]&&"string"==typeof t[2]&&!!t[2]&&"string"==typeof t[3]&&!!t[3]}isDrive(){let t=this.#t;return void 0!==this.#a?this.#a:this.#a="win32"===this.#s&&0===this.#i&&this.length>1&&"string"==typeof t[0]&&/^[a-z]:$/i.test(t[0])}isAbsolute(){let t=this.#t;return void 0!==this.#l?this.#l:this.#l=""===t[0]&&t.length>1||this.isDrive()||this.isUNC()}root(){let t=this.#t[0];return"string"==typeof t&&this.isAbsolute()&&0===this.#i?t:""}checkFollowGlobstar(){return!(0===this.#i||!this.isGlobstar()||!this.#h)}markFollowGlobstar(){return!!(0!==this.#i&&this.isGlobstar())&&!!this.#h&&(this.#h=!1,!0)}}},5262:function(t,e,i){i.d(e,{wN:function(){return o}});var s=i(2832);class r{store;constructor(t=new Map){this.store=t}copy(){return new r(new Map(this.store))}hasWalked(t,e){return this.store.get(t.fullpath())?.has(e.globString())}storeWalked(t,e){let i=t.fullpath(),s=this.store.get(i);s?s.add(e.globString()):this.store.set(i,new Set([e.globString()]))}}class n{store=new Map;add(t,e,i){let s=(e?2:0)|(i?1:0),r=this.store.get(t);this.store.set(t,void 0===r?s:s&r)}entries(){return[...this.store.entries()].map(([t,e])=>[t,!!(2&e),!!(1&e)])}}class a{store=new Map;add(t,e){if(!t.canReaddir())return;let i=this.store.get(t);i?!i.find(t=>t.globString()===e.globString())&&i.push(e):this.store.set(t,[e])}get(t){let e=this.store.get(t);if(!e)throw Error("attempting to walk unknown path");return e}entries(){return this.keys().map(t=>[t,this.store.get(t)])}keys(){return[...this.store.keys()].filter(t=>t.canReaddir())}}class o{hasWalkedCache;matches=new n;subwalks=new a;patterns;follow;dot;opts;constructor(t,e){this.opts=t,this.follow=!!t.follow,this.dot=!!t.dot,this.hasWalkedCache=e?e.copy():new r}processPatterns(t,e){for(let[i,r]of(this.patterns=e,e.map(e=>[t,e]))){let t,e;this.hasWalkedCache.storeWalked(i,r);let n=r.root(),a=r.isAbsolute()&&!1!==this.opts.absolute;if(n){i=i.resolve("/"===n&&void 0!==this.opts.root?this.opts.root:n);let t=r.rest();if(t)r=t;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let o=!1;for(;"string"==typeof(t=r.pattern())&&(e=r.rest());)i=i.resolve(t),r=e,o=!0;if(t=r.pattern(),e=r.rest(),o){if(this.hasWalkedCache.hasWalked(i,r))continue;this.hasWalkedCache.storeWalked(i,r)}if("string"==typeof t){let e=".."===t||""===t||"."===t;this.matches.add(i.resolve(t),a,e);continue}if(t===s.k1){(!i.isSymbolicLink()||this.follow||r.checkFollowGlobstar())&&this.subwalks.add(i,r);let t=e?.pattern(),s=e?.rest();if(e&&(""!==t&&"."!==t||s)){if(".."===t){let t=i.parent||i;s?!this.hasWalkedCache.hasWalked(t,s)&&this.subwalks.add(t,s):this.matches.add(t,a,!0)}}else this.matches.add(i,a,""===t||"."===t)}else t instanceof RegExp&&this.subwalks.add(i,r)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new o(this.opts,this.hasWalkedCache)}filterEntries(t,e){let i=this.subwalks.get(t),r=this.child();for(let t of e)for(let e of i){let i=e.isAbsolute(),n=e.pattern(),a=e.rest();n===s.k1?r.testGlobstar(t,e,a,i):n instanceof RegExp?r.testRegExp(t,n,a,i):r.testString(t,n,a,i)}return r}testGlobstar(t,e,i,s){if((this.dot||!t.name.startsWith("."))&&(!e.hasMore()&&this.matches.add(t,s,!1),t.canReaddir()&&(this.follow||!t.isSymbolicLink()?this.subwalks.add(t,e):t.isSymbolicLink()&&(i&&e.checkFollowGlobstar()?this.subwalks.add(t,i):e.markFollowGlobstar()&&this.subwalks.add(t,e)))),i){let e=i.pattern();if("string"==typeof e&&".."!==e&&""!==e&&"."!==e)this.testString(t,e,i.rest(),s);else if(".."===e){let e=t.parent||t;this.subwalks.add(e,i)}else e instanceof RegExp&&this.testRegExp(t,e,i.rest(),s)}}testRegExp(t,e,i,s){e.test(t.name)&&(i?this.subwalks.add(t,i):this.matches.add(t,s,!1))}testString(t,e,i,s){t.isNamed(e)&&(i?this.subwalks.add(t,i):this.matches.add(t,s,!1))}}},6859:function(t,e,i){i.d(e,{MS:function(){return l},bV:function(){return h}});var s=i(1261),r=i(6742),n=i(5262);let a=(t,e)=>"string"==typeof t?new r.j([t],e):Array.isArray(t)?new r.j(t,e):t;class o{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#u=[];#c;#d;signal;maxDepth;includeChildMatches;constructor(t,e,i){if(this.patterns=t,this.path=e,this.opts=i,this.#d=i.posix||"win32"!==i.platform?"/":"\\",this.includeChildMatches=!1!==i.includeChildMatches,(i.ignore||!this.includeChildMatches)&&(this.#c=a(i.ignore??[],i),!this.includeChildMatches&&"function"!=typeof this.#c.add))throw Error("cannot ignore child matches, ignore lacks add() method.");this.maxDepth=i.maxDepth||1/0,i.signal&&(this.signal=i.signal,this.signal.addEventListener("abort",()=>{this.#u.length=0