svgfusion 1.15.0 → 1.15.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -3
- package/dist/browser.mjs +10 -10
- package/dist/cli.js +5 -2
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -635,6 +635,5 @@ console.log(vueResult.code); // Generated Vue component code
|
|
|
635
635
|
- Works in all modern browsers
|
|
636
636
|
- **Interactive Playground** with Monaco Editor
|
|
637
637
|
|
|
638
|
-
[
|
|
639
|
-
|
|
640
|
-
### Node.js Usage
|
|
638
|
+
[Full Browser API Documentation](./docs/docs/browser-api.md)
|
|
639
|
+
[Full Node API Documentation](./docs/docs/node-api.md)
|
package/dist/browser.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var Mr=Object.defineProperty;var Lr=(e,t,r)=>t in e?Mr(e,t,{enumerable:true,configurable:true,writable:true,value:r}):e[t]=r;var b=(e,t,r)=>Lr(e,typeof t!="symbol"?t+"":t,r);var Ce=class{parse(t){let r=this.cleanSvgContent(t),n=this.parseElement(r);return {root:n,viewBox:n.attributes.viewBox,width:n.attributes.width,height:n.attributes.height,namespace:n.attributes.xmlns}}extractColors(t){let r=[];return this.traverseElements(t.root,n=>{n.attributes.fill&&this.isValidColor(n.attributes.fill)&&r.push({value:n.attributes.fill,type:"fill",element:n,attribute:"fill"}),n.attributes.stroke&&this.isValidColor(n.attributes.stroke)&&r.push({value:n.attributes.stroke,type:"stroke",element:n,attribute:"stroke"}),n.attributes["stop-color"]&&this.isValidColor(n.attributes["stop-color"])&&r.push({value:n.attributes["stop-color"],type:"stop-color",element:n,attribute:"stop-color"});}),r}cleanSvgContent(t){return t.replace(/<\?xml[^>]*\?>/gi,"").replace(/<!--[\s\S]*?-->/g,"").trim()}parseElement(t){let r=t.match(/<svg([^>]*)>/i);if(!r)throw new Error("Invalid SVG: No svg element found");let n=this.parseAttributes(r[1]),i=this.parseChildren(t);return {tag:"svg",attributes:n,children:i}}parseAttributes(t){let r={},n=/(\w+(?:-\w+)*)=["']([^"']*)["']/g,i;for(;(i=n.exec(t))!==null;)r[i[1]]=i[2];return r}parseChildren(t){let r=[],n=t.match(/<svg[^>]*>(.*)<\/svg>/is);if(!n||!n[1])return r;let i=n[1],s=/<(\w+(?::\w+)?)([^>]*?)(?:\s*\/\s*>|>(.*?)<\/\1\s*>)/gs,o;for(;(o=s.exec(i))!==null;){let[,u,a,l]=o,c=this.parseAttributes(a),d={tag:u,attributes:c,children:[]};l!==void 0&&(l.includes("<")?d.children=this.parseNestedElements(l):l.trim()&&(d.content=l.trim())),r.push(d);}return r}parseNestedElements(t){let r=[],n=/<(\w+(?::\w+)?)([^>]*?)(?:\s*\/\s*>|>(.*?)<\/\1\s*>)/gs,i;for(;(i=n.exec(t))!==null;){let[,s,o,u]=i,a=this.parseAttributes(o),l={tag:s,attributes:a,children:[]};u!==void 0&&(u.includes("<")?l.children=this.parseNestedElements(u):u.trim()&&(l.content=u.trim())),r.push(l);}return r}traverseElements(t,r){r(t),t.children.forEach(n=>this.traverseElements(n,r));}isValidColor(t){return !t||t==="none"||t==="transparent"||t==="currentColor"?false:/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$/.test(t)||/^rgba?\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*(?:,\s*[\d.]+\s*)?\)$/.test(t)||/^hsla?\(\s*\d+\s*,\s*\d+%\s*,\s*\d+%\s*(?:,\s*[\d.]+\s*)?\)$/.test(t)?true:["red","green","blue","black","white","yellow","cyan","magenta"].includes(t.toLowerCase())}};var Ee=class{constructor(t={}){b(this,"options");this.options={preserveOriginalNames:t.preserveOriginalNames??false,generateClasses:t.generateClasses??true,colorPrefix:t.colorPrefix??"color"};}extractColors(t){let r=[];this.traverseElement(t,r);let n=new Map;return r.forEach(i=>{this.isValidColor(i.value)&&n.set(i.value,i);}),Array.from(n.values()).sort((i,s)=>i.value.localeCompare(s.value))}apply(t){let r=this.extractColors(t),n=this.generateColorMappings(r),i=this.replaceColorsWithVariables(t,n);return {mappings:n,processedElement:i,originalColors:r.map(s=>s.value)}}generateColorMappings(t){return t.map((r,n)=>({originalColor:r.value,variableName:n===0?this.options.colorPrefix:`${this.options.colorPrefix}${n+1}`,type:r.type}))}replaceColorsWithVariables(t,r){let n=new Map(r.map(i=>[i.originalColor,i.variableName]));return this.transformElement(t,i=>{let s={...i.attributes};if(s.fill&&n.has(s.fill)&&(s.fill=`{${n.get(s.fill)}}`),s.stroke&&n.has(s.stroke)&&(s.stroke=`{${n.get(s.stroke)}}`),s["stop-color"]&&n.has(s["stop-color"])&&(s["stop-color"]=`{${n.get(s["stop-color"])}}`),s.style){let o=s.style,u=o.match(/fill:\s*([^;]+)/);if(u){let c=u[1].trim();n.has(c)&&(o=o.replace(/fill:\s*[^;]+/,`fill: {${n.get(c)}}`));}let a=o.match(/stroke:\s*([^;]+)/);if(a){let c=a[1].trim();n.has(c)&&(o=o.replace(/stroke:\s*[^;]+/,`stroke: {${n.get(c)}}`));}let l=o.match(/stop-color:\s*([^;]+)/);if(l){let c=l[1].trim();n.has(c)&&(o=o.replace(/stop-color:\s*[^;]+/,`stop-color: {${n.get(c)}}`));}s.style=o;}if(this.isDrawableElement(i.tag)){let o=i.attributes.fill!==void 0&&i.attributes.fill!=="",u=i.attributes.stroke!==void 0&&i.attributes.stroke!=="";o&&!u&&!s.stroke&&(s.stroke="none"),u&&!o&&!s.fill&&(s.fill="none");}return {...i,attributes:s}})}traverseElement(t,r){t.attributes.fill&&r.push({value:t.attributes.fill,type:"fill",element:t,attribute:"fill"}),t.attributes.stroke&&r.push({value:t.attributes.stroke,type:"stroke",element:t,attribute:"stroke"}),t.attributes["stop-color"]&&r.push({value:t.attributes["stop-color"],type:"stop-color",element:t,attribute:"stop-color"}),t.attributes.style&&this.extractColorsFromStyle(t.attributes.style).forEach(i=>{r.push({value:i.value,type:i.type,element:t,attribute:"style"});}),t.children.forEach(n=>this.traverseElement(n,r));}transformElement(t,r){let n=r(t);return {...n,children:n.children.map(i=>this.transformElement(i,r))}}isDrawableElement(t){return ["path","circle","ellipse","line","rect","polygon","polyline","text","tspan","use"].includes(t)}isValidColor(t){return !t||t==="none"||t==="transparent"||t==="currentColor"?false:/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$/.test(t)||/^rgba?\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*(?:,\s*[\d.]+\s*)?\)$/.test(t)||/^hsla?\(\s*\d+\s*,\s*\d+%\s*,\s*\d+%\s*(?:,\s*[\d.]+\s*)?\)$/.test(t)?true:["red","green","blue","yellow","orange","purple","pink","brown","black","white","gray","grey","cyan","magenta","lime","navy"].includes(t.toLowerCase())}extractColorsFromStyle(t){let r=[],n=t.match(/fill:\s*([^;]+)/);if(n){let o=n[1].trim();this.isValidColor(o)&&r.push({value:o,type:"fill"});}let i=t.match(/stroke:\s*([^;]+)/);if(i){let o=i[1].trim();this.isValidColor(o)&&r.push({value:o,type:"stroke"});}let s=t.match(/stop-color:\s*([^;]+)/);if(s){let o=s[1].trim();this.isValidColor(o)&&r.push({value:o,type:"stop-color"});}return r}};var ye=class{constructor(t={}){b(this,"options");this.options={preserveExisting:t.preserveExisting??true,onlyIfStrokePresent:t.onlyIfStrokePresent??true};}apply(t){let r=0;return {processedElement:this.transformElement(t,i=>this.shouldAddVectorEffect(i)?(r++,{...i,attributes:{...i.attributes,"vector-effect":"non-scaling-stroke"}}):i),elementsModified:r}}shouldAddVectorEffect(t){return this.options.preserveExisting&&t.attributes["vector-effect"]?false:["path","line","polyline","polygon","rect","circle","ellipse"].includes(t.tag)}transformElement(t,r){let n=r(t);return {...n,children:n.children.map(i=>this.transformElement(i,r))}}};var ve=class{constructor(t={}){b(this,"options");this.options={preserveOriginalNames:t.preserveOriginalNames??false,strokeWidthPrefix:t.strokeWidthPrefix??"strokeWidth",generateClasses:t.generateClasses??true};}extractStrokeWidths(t){let r=[];this.traverseElement(t,r);let n=new Map;return r.forEach(i=>{this.isValidStrokeWidth(i.value)&&n.set(i.value,i);}),Array.from(n.values()).sort((i,s)=>{let o=parseFloat(i.value),u=parseFloat(s.value);return isNaN(o)&&isNaN(u)?i.value.localeCompare(s.value):isNaN(o)?1:isNaN(u)?-1:o-u})}apply(t){let r=this.extractStrokeWidths(t),n=this.generateStrokeWidthMappings(r),i=this.replaceStrokeWidthsWithVariables(t,n);return {mappings:n,processedElement:i,originalStrokeWidths:r.map(s=>s.value)}}traverseElement(t,r){if(t.attributes["stroke-width"]&&r.push({value:t.attributes["stroke-width"],element:t,attribute:"stroke-width"}),t.attributes.style){let n=this.extractStrokeWidthFromStyle(t.attributes.style);n&&r.push({value:n,element:t,attribute:"style",styleProperty:"stroke-width"});}t.children.forEach(n=>this.traverseElement(n,r));}extractStrokeWidthFromStyle(t){let r=t.match(/stroke-width\s*:\s*([^;]+)/);return r?r[1].trim():null}isValidStrokeWidth(t){return t==="inherit"||t==="none"||t==="initial"||t==="unset"||t.includes("var(")||t.includes("calc(")?false:/^[\d.]+(?:px|pt|pc|in|cm|mm|em|rem|ex|ch|vw|vh|vmin|vmax|%)?$/.test(t.trim())}generateStrokeWidthMappings(t){return t.map((r,n)=>({originalStrokeWidth:r.value,variableName:n===0?this.options.strokeWidthPrefix:`${this.options.strokeWidthPrefix}${n+1}`}))}replaceStrokeWidthsWithVariables(t,r){let n=new Map(r.map(i=>[i.originalStrokeWidth,i.variableName]));return this.transformElement(t,i=>{let s={...i.attributes};if(s["stroke-width"]&&n.has(s["stroke-width"])&&(s["stroke-width"]=`{${n.get(s["stroke-width"])}}`),s.style){let o=s.style;n.forEach((u,a)=>{let l=new RegExp(`stroke-width\\s*:\\s*${this.escapeRegExp(a)}`,"g");o=o.replace(l,`stroke-width: {${u}}`);}),s.style=o;}return {...i,attributes:s}})}transformElement(t,r){let n=r(t);return {...n,children:n.children.map(i=>this.transformElement(i,r))}}escapeRegExp(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}};var be=class{constructor(t={}){b(this,"options");this.options={addRole:t.addRole??true,addAriaHidden:t.addAriaHidden??false,addTitle:t.addTitle??true,addDesc:t.addDesc??true,defaultRole:t.defaultRole??"img",preserveExisting:t.preserveExisting??true};}apply(t){let r=[];if(t.tag!=="svg")return {processedElement:t,attributesAdded:r};let n={...t.attributes};return this.options.addRole&&(!this.options.preserveExisting||!n.role)&&(n.role=this.options.defaultRole,r.push("role")),this.options.addAriaHidden&&(!this.options.preserveExisting||!n["aria-hidden"])&&(n["aria-hidden"]="true",r.push("aria-hidden")),this.options.addTitle&&r.push("title-support"),this.options.addDesc&&r.push("desc-support"),this.options.addTitle&&this.options.addDesc&&(!this.options.preserveExisting||!n["aria-labelledby"])?(n["aria-labelledby"]="{titleId} {descId}",r.push("aria-labelledby")):this.options.addTitle&&(!this.options.preserveExisting||!n["aria-labelledby"])&&(n["aria-labelledby"]="{titleId}",r.push("aria-labelledby")),{processedElement:{...t,attributes:n},attributesAdded:r}}generateProps(){let t=[];return this.options.addTitle&&t.push("title?: string","titleId?: string"),this.options.addDesc&&t.push("desc?: string","descId?: string"),t}generateJSXElements(t){let r=[];return t==="react"?(this.options.addDesc&&r.push("{desc ? <desc id={descId}>{desc}</desc> : null}"),this.options.addTitle&&r.push("{title ? <title id={titleId}>{title}</title> : null}")):(this.options.addDesc&&r.push('<desc v-if="desc" :id="descId">{{ desc }}</desc>'),this.options.addTitle&&r.push('<title v-if="title" :id="titleId">{{ title }}</title>')),r.join(`
|
|
2
|
-
`)}};var Se=class{transform(t,r={}){let{optimize:n=true,splitColors:i=false,splitStrokeWidths:s=false,fixedStrokeWidth:o=false,accessibility:u=true,removeComments:a=true,removeDuplicates:l=true,minifyPaths:c=false}=r,d=this.deepCloneAst(t),p=[],f=[],D=[];return n&&(this.applyOptimizations(d,{removeComments:a,removeDuplicates:l,minifyPaths:c&&!i}),p.push("optimization")),i&&(f=this.applySplitColors(d),p.push("split-colors")),s&&(D=this.applySplitStrokeWidths(d),p.push("split-stroke-widths")),o&&(this.applyFixedStrokeWidth(d),p.push("fixed-stroke-width")),u&&(this.applyAccessibility(d),p.push("accessibility")),{ast:d,colorMappings:f,strokeWidthMappings:D,metadata:{originalColors:f.map(h=>h.originalColor),originalStrokeWidths:D.map(h=>h.originalStrokeWidth),optimizationApplied:n,features:p,hasClassAttributes:this.hasClassAttributes(d)}}}applySplitColors(t){let n=new Ee({generateClasses:true,colorPrefix:"color"}).apply(t.root);return t.root=n.processedElement,n.mappings}applyFixedStrokeWidth(t){let n=new ye({onlyIfStrokePresent:false,preserveExisting:true}).apply(t.root);t.root=n.processedElement;}applyAccessibility(t){let n=new be({addRole:true,addTitle:true,addDesc:true,defaultRole:"img",preserveExisting:true}).apply(t.root);t.root=n.processedElement;}applyOptimizations(t,r){r.removeDuplicates&&this.removeDuplicateElements(t),r.minifyPaths&&this.minifyPaths(t),this.removeEmptyGroups(t);}removeDuplicateElements(t){}minifyPaths(t){this.traverseElements(t.root,r=>{r.tag==="path"&&r.attributes.d&&(r.attributes.d=r.attributes.d.replace(/\s+/g," ").replace(/([MLHVCSQTAZ])\s+/gi,"$1").trim());});}removeEmptyGroups(t){let r=n=>(n.children=n.children.filter(r),!(n.tag==="g"&&n.children.length===0&&!n.content));t.root.children=t.root.children.filter(r);}traverseElements(t,r){r(t),t.children.forEach(n=>this.traverseElements(n,r));}isValidColor(t){return !t||t==="none"||t==="transparent"||t==="currentColor"?false:/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$/.test(t)||/^rgba?\(.+\)$/.test(t)||/^hsla?\(.+\)$/.test(t)}deepCloneAst(t){return {...t,root:this.deepCloneElement(t.root)}}deepCloneElement(t){return {...t,attributes:{...t.attributes},children:t.children.map(r=>this.deepCloneElement(r))}}hasClassAttributes(t){let r=n=>n.attributes.class||n.attributes.className?true:n.children.some(i=>r(i));return r(t.root)}applySplitStrokeWidths(t){let n=new ve({generateClasses:true,strokeWidthPrefix:"strokeWidth"}).apply(t.root);return t.root=n.processedElement,n.mappings}};var xe=e=>/^[A-Z][a-zA-Z0-9]*$/.test(e)&&/[a-z]/.test(e)?e:/^[a-z][a-zA-Z0-9]*$/.test(e)&&/[A-Z]/.test(e)?e.charAt(0).toUpperCase()+e.slice(1):e.split(/[\s\-_]+/).filter(Boolean).map(t=>t.length>3&&t===t.toUpperCase()&&/^[A-Z]+$/.test(t)?t.charAt(0).toUpperCase()+t.slice(1).toLowerCase():t.length<=3&&t===t.toUpperCase()&&/^[A-Z]+$/.test(t)?t:t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(""),Le=e=>e.replace(/-([a-z])/g,(t,r)=>r.toUpperCase()),vt=e=>{let t={class:"className",for:"htmlFor","accept-charset":"acceptCharset","http-equiv":"httpEquiv"};return t[e]?t[e]:e.startsWith("aria-")||e.startsWith("data-")?e:Le(e)};function ze(e,t,r){let n=e.replace(/\.svg$/i,"");return n=zr(n),St(n,t,r)}function zr(e){if(/^[a-zA-Z][a-zA-Z0-9]*$/.test(e))return e;let r=e.
|
|
2
|
+
`)}};var Se=class{transform(t,r={}){let{optimize:n=true,splitColors:i=false,splitStrokeWidths:s=false,fixedStrokeWidth:o=false,accessibility:u=true,removeComments:a=true,removeDuplicates:l=true,minifyPaths:c=false}=r,d=this.deepCloneAst(t),p=[],f=[],D=[];return n&&(this.applyOptimizations(d,{removeComments:a,removeDuplicates:l,minifyPaths:c&&!i}),p.push("optimization")),i&&(f=this.applySplitColors(d),p.push("split-colors")),s&&(D=this.applySplitStrokeWidths(d),p.push("split-stroke-widths")),o&&(this.applyFixedStrokeWidth(d),p.push("fixed-stroke-width")),u&&(this.applyAccessibility(d),p.push("accessibility")),{ast:d,colorMappings:f,strokeWidthMappings:D,metadata:{originalColors:f.map(h=>h.originalColor),originalStrokeWidths:D.map(h=>h.originalStrokeWidth),optimizationApplied:n,features:p,hasClassAttributes:this.hasClassAttributes(d)}}}applySplitColors(t){let n=new Ee({generateClasses:true,colorPrefix:"color"}).apply(t.root);return t.root=n.processedElement,n.mappings}applyFixedStrokeWidth(t){let n=new ye({onlyIfStrokePresent:false,preserveExisting:true}).apply(t.root);t.root=n.processedElement;}applyAccessibility(t){let n=new be({addRole:true,addTitle:true,addDesc:true,defaultRole:"img",preserveExisting:true}).apply(t.root);t.root=n.processedElement;}applyOptimizations(t,r){r.removeDuplicates&&this.removeDuplicateElements(t),r.minifyPaths&&this.minifyPaths(t),this.removeEmptyGroups(t);}removeDuplicateElements(t){}minifyPaths(t){this.traverseElements(t.root,r=>{r.tag==="path"&&r.attributes.d&&(r.attributes.d=r.attributes.d.replace(/\s+/g," ").replace(/([MLHVCSQTAZ])\s+/gi,"$1").trim());});}removeEmptyGroups(t){let r=n=>(n.children=n.children.filter(r),!(n.tag==="g"&&n.children.length===0&&!n.content));t.root.children=t.root.children.filter(r);}traverseElements(t,r){r(t),t.children.forEach(n=>this.traverseElements(n,r));}isValidColor(t){return !t||t==="none"||t==="transparent"||t==="currentColor"?false:/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$/.test(t)||/^rgba?\(.+\)$/.test(t)||/^hsla?\(.+\)$/.test(t)}deepCloneAst(t){return {...t,root:this.deepCloneElement(t.root)}}deepCloneElement(t){return {...t,attributes:{...t.attributes},children:t.children.map(r=>this.deepCloneElement(r))}}hasClassAttributes(t){let r=n=>n.attributes.class||n.attributes.className?true:n.children.some(i=>r(i));return r(t.root)}applySplitStrokeWidths(t){let n=new ve({generateClasses:true,strokeWidthPrefix:"strokeWidth"}).apply(t.root);return t.root=n.processedElement,n.mappings}};var xe=e=>/^[A-Z][a-zA-Z0-9]*$/.test(e)&&/[a-z]/.test(e)?e:/^[a-z][a-zA-Z0-9]*$/.test(e)&&/[A-Z]/.test(e)?e.charAt(0).toUpperCase()+e.slice(1):e.split(/[\s\-_]+/).filter(Boolean).map(t=>t.length>3&&t===t.toUpperCase()&&/^[A-Z]+$/.test(t)?t.charAt(0).toUpperCase()+t.slice(1).toLowerCase():t.length<=3&&t===t.toUpperCase()&&/^[A-Z]+$/.test(t)?t:/[a-z][A-Z]/.test(t)?t.charAt(0).toUpperCase()+t.slice(1):t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(""),Le=e=>e.replace(/-([a-z])/g,(t,r)=>r.toUpperCase()),vt=e=>{let t={class:"className",for:"htmlFor","accept-charset":"acceptCharset","http-equiv":"httpEquiv"};return t[e]?t[e]:e.startsWith("aria-")||e.startsWith("data-")?e:Le(e)};function ze(e,t,r){let n=e.replace(/\.svg$/i,"");return n=zr(n),St(n,t,r)}function zr(e){if(/^[a-zA-Z][a-zA-Z0-9]*$/.test(e))return e;let r=e.replace(/[^a-zA-Z0-9]/g," ");return r=r.replace(/\s+/g," ").trim(),r}function bt(e,t="main"){let r=e.replace(/=/g," ").replace(/,/g," ").replace(/[^a-zA-Z0-9]/g," ").replace(/\s+/g," ").trim();if(t==="prefix"){if(!/^[a-zA-Z]/.test(r))return ""}else t==="suffix"?r=r.replace(/^[^a-zA-Z0-9]+/,""):r=r.replace(/^[^a-zA-Z]+/,"");return xe(r)}function Jr(e){return e&&xe(e).split(/(?<=[a-z])(?=[0-9])|(?<=[0-9])(?=[A-Z])/).map(n=>n&&(/^\d/.test(n)?n.replace(/^(\d+)([a-z])/,(i,s,o)=>s+o.toUpperCase()):n)).join("")}function St(e,t,r){let n=e;t&&(n=`${t}-${n}`),r&&(n=`${n}-${r}`);let i=bt(n,"main");return Jr(i)}var ie=class{constructor(t={}){b(this,"options");this.options={typescript:true,memo:true,forwardRef:true,exportDefault:true,componentName:"Icon",prefix:"",suffix:"",includeTypes:true,...t};}astToJsx(t){return this.elementToJsx(t.root,0)}elementToJsx(t,r=0){let n=" ".repeat(r+1),{tag:i,attributes:s,children:o,content:u}=t,a=this.attributesToJsx(s),l=a.length>0?" "+a.join(" "):"";if(o.length===0&&!u)return `${n}<${i}${l} />`;let c=`${n}<${i}${l}>`;return u&&(c+=u),o.length>0&&(c+=`
|
|
3
3
|
`,c+=o.map(d=>this.elementToJsx(d,r+1)).join(`
|
|
4
4
|
`),c+=`
|
|
5
5
|
`+n),c+=`</${i}>`,c}attributesToJsx(t){return Object.entries(t).map(([r,n])=>{let i=this.convertAttributeName(r);return n.startsWith("{")&&n.endsWith("}")?`${i}=${n}`:`${i}="${n}"`})}convertAttributeName(t){let r={class:"className",for:"htmlFor",tabindex:"tabIndex",readonly:"readOnly",maxlength:"maxLength",cellpadding:"cellPadding",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"};return t.startsWith("aria-")||t.startsWith("data-")?t:t.includes("-")?t.replace(/-([a-z])/g,(n,i)=>i.toUpperCase()):r[t]||t}generateColorProps(t,r=true){return t.length===0?"":t.map(n=>{let i=n.variableName,s=`${i}Class`;if(this.options.typescript){let o=` ${i}?: string;`;return r&&(o+=`
|
|
@@ -8,7 +8,7 @@ var Mr=Object.defineProperty;var Lr=(e,t,r)=>t in e?Mr(e,t,{enumerable:true,conf
|
|
|
8
8
|
`)}generateColorDefaults(t){return t.length===0?"":t.map(r=>{let n=r.variableName,i=r.originalColor;return `${n} = "${i}"`}).join(", ")}generateStrokeWidthProps(t,r=true){return t.length===0?"":t.map(n=>{let i=n.variableName,s=`${i}Class`;if(this.options.typescript){let o=` ${i}?: string | number;`;return r&&(o+=`
|
|
9
9
|
${s}?: string;`),o}else {let o=` ${i}: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),`;return r&&(o+=`
|
|
10
10
|
${s}: PropTypes.string,`),o}}).join(`
|
|
11
|
-
`)}generateStrokeWidthDefaults(t){return t.length===0?"":t.map(r=>{let n=r.variableName,i=r.originalStrokeWidth;return `${n} = "${i}"`}).join(", ")}getComponentName(){return ze(this.options.componentName,this.options.prefix,this.options.suffix)}generateFilename(t,r){return `${t}.${r}`}sanitizeComponentName(t){return t.replace(/[^a-zA-Z0-9_$]/g,"").replace(/^[0-9]/,"_$&")}};var qr=Object.create,st=Object.defineProperty,Ur=Object.getOwnPropertyDescriptor,Hr=Object.getOwnPropertyNames,
|
|
11
|
+
`)}generateStrokeWidthDefaults(t){return t.length===0?"":t.map(r=>{let n=r.variableName,i=r.originalStrokeWidth;return `${n} = "${i}"`}).join(", ")}getComponentName(){return ze(this.options.componentName,this.options.prefix,this.options.suffix)}generateFilename(t,r){return `${t}.${r}`}sanitizeComponentName(t){return t.replace(/[^a-zA-Z0-9_$]/g,"").replace(/^[0-9]/,"_$&")}};var qr=Object.create,st=Object.defineProperty,Ur=Object.getOwnPropertyDescriptor,Hr=Object.getOwnPropertyNames,Zr=Object.getPrototypeOf,Kr=Object.prototype.hasOwnProperty,tr=e=>{throw TypeError(e)},Xr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ot=(e,t)=>{for(var r in t)st(e,r,{get:t[r],enumerable:true});},Yr=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Hr(t))!Kr.call(e,i)&&i!==r&&st(e,i,{get:()=>t[i],enumerable:!(n=Ur(t,i))||n.enumerable});return e},Qr=(e,t,r)=>(r=e!=null?qr(Zr(e)):{},Yr(st(r,"default",{value:e,enumerable:true}),e)),en=(e,t,r)=>t.has(e)||tr("Cannot "+r),tn=(e,t,r)=>t.has(e)?tr("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),De=(e,t,r)=>(en(e,t,"access private method"),r),rn=Xr(e=>{Object.defineProperty(e,"__esModule",{value:true});function t(){return new Proxy({},{get:()=>s=>s})}var r=/\r\n|[\n\r\u2028\u2029]/;function n(s,o,u){let a=Object.assign({column:0,line:-1},s.start),l=Object.assign({},a,s.end),{linesAbove:c=2,linesBelow:d=3}=u||{},p=a.line,f=a.column,D=l.line,h=l.column,m=Math.max(p-(c+1),0),g=Math.min(o.length,D+d);p===-1&&(m=0),D===-1&&(g=o.length);let E=D-p,F={};if(E)for(let y=0;y<=E;y++){let C=y+p;if(!f)F[C]=true;else if(y===0){let S=o[C-1].length;F[C]=[f,S-f+1];}else if(y===E)F[C]=[0,h];else {let S=o[C-y].length;F[C]=[0,S];}}else f===h?f?F[p]=[f,0]:F[p]=true:F[p]=[f,h-f];return {start:m,end:g,markerLines:F}}function i(s,o,u={}){let a=t(),l=s.split(r),{start:c,end:d,markerLines:p}=n(o,l,u),f=o.start&&typeof o.start.column=="number",D=String(d).length,h=s.split(r,d).slice(c,d).map((m,g)=>{let E=c+1+g,F=` ${` ${E}`.slice(-D)} |`,y=p[E],C=!p[E+1];if(y){let S="";if(Array.isArray(y)){let v=m.slice(0,Math.max(y[0]-1,0)).replace(/[^\t]/g," "),z=y[1]||1;S=[`
|
|
12
12
|
`,a.gutter(F.replace(/\d/g," "))," ",v,a.marker("^").repeat(z)].join(""),C&&u.message&&(S+=" "+a.message(u.message));}return [a.marker(">"),a.gutter(F),m.length>0?` ${m}`:"",S].join("")}else return ` ${a.gutter(F)}${m.length>0?` ${m}`:""}`}).join(`
|
|
13
13
|
`);return u.message&&!f&&(h=`${" ".repeat(D+1)}${u.message}
|
|
14
14
|
${h}`),h}e.codeFrameColumns=i;}),nn={};ot(nn,{__debug:()=>Co,check:()=>go,doc:()=>jr,format:()=>ce,formatWithCursor:()=>_r,getSupportInfo:()=>Fo,util:()=>Gr,version:()=>zs});var sn=(e,t,r,n)=>{if(!(e&&t==null))return t.replaceAll?t.replaceAll(r,n):r.global?t.replace(r,n):t.split(r).join(n)},Ne=sn,on=class{diff(e,t,r={}){let n;typeof r=="function"?(n=r,r={}):"callback"in r&&(n=r.callback);let i=this.castInput(e,r),s=this.castInput(t,r),o=this.removeEmpty(this.tokenize(i,r)),u=this.removeEmpty(this.tokenize(s,r));return this.diffWithOptionsObj(o,u,r,n)}diffWithOptionsObj(e,t,r,n){var i;let s=g=>{if(g=this.postProcess(g,r),n){setTimeout(function(){n(g);},0);return}else return g},o=t.length,u=e.length,a=1,l=o+u;r.maxEditLength!=null&&(l=Math.min(l,r.maxEditLength));let c=(i=r.timeout)!==null&&i!==void 0?i:1/0,d=Date.now()+c,p=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(p[0],t,e,0,r);if(p[0].oldPos+1>=u&&f+1>=o)return s(this.buildValues(p[0].lastComponent,t,e));let D=-1/0,h=1/0,m=()=>{for(let g=Math.max(D,-a);g<=Math.min(h,a);g+=2){let E,F=p[g-1],y=p[g+1];F&&(p[g-1]=void 0);let C=false;if(y){let v=y.oldPos-g;C=y&&0<=v&&v<o;}let S=F&&F.oldPos+1<u;if(!C&&!S){p[g]=void 0;continue}if(!S||C&&F.oldPos<y.oldPos?E=this.addToPath(y,true,false,0,r):E=this.addToPath(F,false,true,1,r),f=this.extractCommon(E,t,e,g,r),E.oldPos+1>=u&&f+1>=o)return s(this.buildValues(E.lastComponent,t,e))||true;p[g]=E,E.oldPos+1>=u&&(h=Math.min(h,g-1)),f+1>=o&&(D=Math.max(D,g+1));}a++;};if(n)(function g(){setTimeout(function(){if(a>l||Date.now()>d)return n(void 0);m()||g();},0);})();else for(;a<=l&&Date.now()<=d;){let g=m();if(g)return g}}addToPath(e,t,r,n,i){let s=e.lastComponent;return s&&!i.oneChangePerToken&&s.added===t&&s.removed===r?{oldPos:e.oldPos+n,lastComponent:{count:s.count+1,added:t,removed:r,previousComponent:s.previousComponent}}:{oldPos:e.oldPos+n,lastComponent:{count:1,added:t,removed:r,previousComponent:s}}}extractCommon(e,t,r,n,i){let s=t.length,o=r.length,u=e.oldPos,a=u-n,l=0;for(;a+1<s&&u+1<o&&this.equals(r[u+1],t[a+1],i);)a++,u++,l++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:false,removed:false});return l&&!i.oneChangePerToken&&(e.lastComponent={count:l,previousComponent:e.lastComponent,added:false,removed:false}),e.oldPos=u,a}equals(e,t,r){return r.comparator?r.comparator(e,t):e===t||!!r.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let r=0;r<e.length;r++)e[r]&&t.push(e[r]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join("")}postProcess(e,t){return e}get useLongestToken(){return false}buildValues(e,t,r){let n=[],i;for(;e;)n.push(e),i=e.previousComponent,delete e.previousComponent,e=i;n.reverse();let s=n.length,o=0,u=0,a=0;for(;o<s;o++){let l=n[o];if(l.removed)l.value=this.join(r.slice(a,a+l.count)),a+=l.count;else {if(!l.added&&this.useLongestToken){let c=t.slice(u,u+l.count);c=c.map(function(d,p){let f=r[a+p];return f.length>d.length?f:d}),l.value=this.join(c);}else l.value=this.join(t.slice(u,u+l.count));u+=l.count,l.added||(a+=l.count);}}return n}},un=class extends on{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}},an=new un;function ln(e,t,r){return an.diff(e,t,r)}function cn(e){let t=e.indexOf("\r");return t!==-1?e.charAt(t+1)===`
|
|
@@ -21,26 +21,26 @@ ${h}`),h}e.codeFrameColumns=i;}),nn={};ot(nn,{__debug:()=>Co,check:()=>go,doc:()
|
|
|
21
21
|
`);)t--;return t<e.length?e.slice(0,t):e}function fn(e){if(typeof e=="string")return te;if(Array.isArray(e))return R;if(!e)return;let{type:t}=e;if(nr.has(t))return t}var re=fn,hn=e=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(e);function mn(e){let t=e===null?"null":typeof e;if(t!=="string"&&t!=="object")return `Unexpected doc '${t}',
|
|
22
22
|
Expected it to be 'string' or 'object'.`;if(re(e))throw new Error("doc is valid.");let r=Object.prototype.toString.call(e);if(r!=="[object Object]")return `Unexpected doc '${r}'.`;let n=hn([...nr].map(i=>`'${i}'`));return `Unexpected doc.type '${e.type}'.
|
|
23
23
|
Expected it to be ${n}.`}var gn=class extends Error{constructor(t){super(mn(t));b(this,"name","InvalidDocError");this.doc=t;}},ue=gn,xt={};function Fn(e,t,r,n){let i=[e];for(;i.length>0;){let s=i.pop();if(s===xt){r(i.pop());continue}r&&i.push(s,xt);let o=re(s);if(!o)throw new ue(s);if(t?.(s)!==false)switch(o){case R:case T:{let u=o===R?s:s.parts;for(let a=u.length,l=a-1;l>=0;--l)i.push(u[l]);break}case B:i.push(s.flatContents,s.breakContents);break;case A:if(n&&s.expandedStates)for(let u=s.expandedStates.length,a=u-1;a>=0;--a)i.push(s.expandedStates[a]);else i.push(s.contents);break;case j:case I:case _:case V:case M:i.push(s.contents);break;case te:case U:case G:case L:case k:case $:break;default:throw new ue(s)}}}var at=Fn;function Pe(e,t){if(typeof e=="string")return t(e);let r=new Map;return n(e);function n(s){if(r.has(s))return r.get(s);let o=i(s);return r.set(s,o),o}function i(s){switch(re(s)){case R:return t(s.map(n));case T:return t({...s,parts:s.parts.map(n)});case B:return t({...s,breakContents:n(s.breakContents),flatContents:n(s.flatContents)});case A:{let{expandedStates:o,contents:u}=s;return o?(o=o.map(n),u=o[0]):u=n(u),t({...s,contents:u,expandedStates:o})}case j:case I:case _:case V:case M:return t({...s,contents:n(s.contents)});case te:case U:case G:case L:case k:case $:return t(s);default:throw new ue(s)}}}function lt(e,t,r){let n=r,i=false;function s(o){if(i)return false;let u=t(o);u!==void 0&&(i=true,n=u);}return at(e,s),n}function Cn(e){if(e.type===A&&e.break||e.type===k&&e.hard||e.type===$)return true}function En(e){return lt(e,Cn,false)}function kt(e){if(e.length>0){let t=x(false,e,-1);!t.expandedStates&&!t.break&&(t.break="propagated");}return null}function yn(e){let t=new Set,r=[];function n(s){if(s.type===$&&kt(r),s.type===A){if(r.push(s),t.has(s))return false;t.add(s);}}function i(s){s.type===A&&r.pop().break&&kt(r);}at(e,n,i,true);}function vn(e){return e.type===k&&!e.hard?e.soft?"":" ":e.type===B?e.flatContents:e}function bn(e){return Pe(e,vn)}function wt(e){for(e=[...e];e.length>=2&&x(false,e,-2).type===k&&x(false,e,-1).type===$;)e.length-=2;if(e.length>0){let t=de(x(false,e,-1));e[e.length-1]=t;}return e}function de(e){switch(re(e)){case I:case _:case A:case M:case V:{let t=de(e.contents);return {...e,contents:t}}case B:return {...e,breakContents:de(e.breakContents),flatContents:de(e.flatContents)};case T:return {...e,parts:wt(e.parts)};case R:return wt(e);case te:return dn(e);case j:case U:case G:case L:case k:case $:break;default:throw new ue(e)}return e}function ir(e){return de(xn(e))}function Sn(e){switch(re(e)){case T:if(e.parts.every(t=>t===""))return "";break;case A:if(!e.contents&&!e.id&&!e.break&&!e.expandedStates)return "";if(e.contents.type===A&&e.contents.id===e.id&&e.contents.break===e.break&&e.contents.expandedStates===e.expandedStates)return e.contents;break;case j:case I:case _:case M:if(!e.contents)return "";break;case B:if(!e.flatContents&&!e.breakContents)return "";break;case R:{let t=[];for(let r of e){if(!r)continue;let[n,...i]=Array.isArray(r)?r:[r];typeof n=="string"&&typeof x(false,t,-1)=="string"?t[t.length-1]+=n:t.push(n),t.push(...i);}return t.length===0?"":t.length===1?t[0]:t}case te:case U:case G:case L:case k:case V:case $:break;default:throw new ue(e)}return e}function xn(e){return Pe(e,t=>Sn(t))}function kn(e,t=lr){return Pe(e,r=>typeof r=="string"?cr(t,r.split(`
|
|
24
|
-
`)):r)}function wn(e){if(e.type===k)return true}function An(e){return lt(e,wn,false)}function Ae(e,t){return e.type===V?{...e,contents:t(e.contents)}:t(e)}var ct=()=>{},sr=ct;function Oe(e){return {type:I,contents:e}}function ae(e,t){return {type:j,contents:t,n:e}}function or(e,t={}){return sr(t.expandedStates),{type:A,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function $n(e){return ae(Number.NEGATIVE_INFINITY,e)}function On(e){return ae({type:"root"},e)}function Nn(e){return ae(-1,e)}function Pn(e,t){return or(e[0],{...t,expandedStates:e})}function Tn(e){return {type:T,parts:e}}function Vn(e,t="",r={}){return {type:B,breakContents:e,flatContents:t,groupId:r.groupId}}function Wn(e,t){return {type:_,contents:e,groupId:t.groupId,negate:t.negate}}function Xe(e){return {type:M,contents:e}}var Rn={type:L},Te={type:$},In={type:G},pt={type:k,hard:true},ur={type:k,hard:true,literal:true},ar={type:k},jn={type:k,soft:true},Q=[pt,Te],lr=[ur,Te],Y={type:U};function cr(e,t){let r=[];for(let n=0;n<t.length;n++)n!==0&&r.push(e),r.push(t[n]);return r}function pr(e,t,r){let n=e;if(t>0){for(let i=0;i<Math.floor(t/r);++i)n=Oe(n);n=ae(t%r,n),n=ae(Number.NEGATIVE_INFINITY,n);}return n}function Gn(e,t){return e?{type:V,label:e,contents:t}:t}function W(e){var t;if(!e)return "";if(Array.isArray(e)){let r=[];for(let n of e)if(Array.isArray(n))r.push(...W(n));else {let i=W(n);i!==""&&r.push(i);}return r}return e.type===B?{...e,breakContents:W(e.breakContents),flatContents:W(e.flatContents)}:e.type===A?{...e,contents:W(e.contents),expandedStates:(t=e.expandedStates)==null?void 0:t.map(W)}:e.type===T?{type:"fill",parts:e.parts.map(W)}:e.contents?{...e,contents:W(e.contents)}:e}function _n(e){let t=Object.create(null),r=new Set;return n(W(e));function n(s,o,u){var a,l;if(typeof s=="string")return JSON.stringify(s);if(Array.isArray(s)){let c=s.map(n).filter(Boolean);return c.length===1?c[0]:`[${c.join(", ")}]`}if(s.type===k){let c=((a=u?.[o+1])==null?void 0:a.type)===$;return s.literal?c?"literalline":"literallineWithoutBreakParent":s.hard?c?"hardline":"hardlineWithoutBreakParent":s.soft?"softline":"line"}if(s.type===$)return ((l=u?.[o-1])==null?void 0:l.type)===k&&u[o-1].hard?void 0:"breakParent";if(s.type===G)return "trim";if(s.type===I)return "indent("+n(s.contents)+")";if(s.type===j)return s.n===Number.NEGATIVE_INFINITY?"dedentToRoot("+n(s.contents)+")":s.n<0?"dedent("+n(s.contents)+")":s.n.type==="root"?"markAsRoot("+n(s.contents)+")":"align("+JSON.stringify(s.n)+", "+n(s.contents)+")";if(s.type===B)return "ifBreak("+n(s.breakContents)+(s.flatContents?", "+n(s.flatContents):"")+(s.groupId?(s.flatContents?"":', ""')+`, { groupId: ${i(s.groupId)} }`:"")+")";if(s.type===_){let c=[];s.negate&&c.push("negate: true"),s.groupId&&c.push(`groupId: ${i(s.groupId)}`);let d=c.length>0?`, { ${c.join(", ")} }`:"";return `indentIfBreak(${n(s.contents)}${d})`}if(s.type===A){let c=[];s.break&&s.break!=="propagated"&&c.push("shouldBreak: true"),s.id&&c.push(`id: ${i(s.id)}`);let d=c.length>0?`, { ${c.join(", ")} }`:"";return s.expandedStates?`conditionalGroup([${s.expandedStates.map(p=>n(p)).join(",")}]${d})`:`group(${n(s.contents)}${d})`}if(s.type===T)return `fill([${s.parts.map(c=>n(c)).join(", ")}])`;if(s.type===M)return "lineSuffix("+n(s.contents)+")";if(s.type===L)return "lineSuffixBoundary";if(s.type===V)return `label(${JSON.stringify(s.label)}, ${n(s.contents)})`;if(s.type===U)return "cursor";throw new Error("Unknown doc type "+s.type)}function i(s){if(typeof s!="symbol")return JSON.stringify(String(s));if(s in t)return t[s];let o=s.description||"symbol";for(let u=0;;u++){let a=o+(u>0?` #${u}`:"");if(!r.has(a))return r.add(a),t[s]=`Symbol.for(${JSON.stringify(a)})`}}}var Mn=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;function Ln(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function zn(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}var Jn=e=>!(Ln(e)||zn(e)),qn=/[^\x20-\x7F]/u;function Un(e){if(!e)return 0;if(!qn.test(e))return e.length;e=e.replace(Mn()," ");let t=0;for(let r of e){let n=r.codePointAt(0);n<=31||n>=127&&n<=159||n>=768&&n<=879||(t+=Jn(n)?1:2);}return t}var Dt=Un,w=Symbol("MODE_BREAK"),O=Symbol("MODE_FLAT"),se=Symbol("cursor"),Ye=Symbol("DOC_FILL_PRINTED_LENGTH");function Dr(){return {value:"",length:0,queue:[]}}function Hn(e,t){return Qe(e,{type:"indent"},t)}function Kn(e,t,r){return t===Number.NEGATIVE_INFINITY?e.root||Dr():t<0?Qe(e,{type:"dedent"},r):t?t.type==="root"?{...e,root:e}:Qe(e,{type:typeof t=="string"?"stringAlign":"numberAlign",n:t},r):e}function Qe(e,t,r){let n=t.type==="dedent"?e.queue.slice(0,-1):[...e.queue,t],i="",s=0,o=0,u=0;for(let D of n)switch(D.type){case "indent":c(),r.useTabs?a(1):l(r.tabWidth);break;case "stringAlign":c(),i+=D.n,s+=D.n.length;break;case "numberAlign":o+=1,u+=D.n;break;default:throw new Error(`Unexpected type '${D.type}'`)}return p(),{...e,value:i,length:s,queue:n};function a(D){i+=" ".repeat(D),s+=r.tabWidth*D;}function l(D){i+=" ".repeat(D),s+=D;}function c(){r.useTabs?d():p();}function d(){o>0&&a(o),f();}function p(){u>0&&l(u),f();}function f(){o=0,u=0;}}function et(e){let t=0,r=0,n=e.length;e:for(;n--;){let i=e[n];if(i===se){r++;continue}for(let s=i.length-1;s>=0;s--){let o=i[s];if(o===" "||o===" ")t++;else {e[n]=i.slice(0,s+1);break e}}}if(t>0||r>0)for(e.length=n+1;r-- >0;)e.push(se);return t}function ke(e,t,r,n,i,s){if(r===Number.POSITIVE_INFINITY)return true;let o=t.length,u=[e],a=[];for(;r>=0;){if(u.length===0){if(o===0)return true;u.push(t[--o]);continue}let{mode:l,doc:c}=u.pop(),d=re(c);switch(d){case te:a.push(c),r-=Dt(c);break;case R:case T:{let p=d===R?c:c.parts,f=c[Ye]??0;for(let D=p.length-1;D>=f;D--)u.push({mode:l,doc:p[D]});break}case I:case j:case _:case V:u.push({mode:l,doc:c.contents});break;case G:r+=et(a);break;case A:{if(s&&c.break)return false;let p=c.break?w:l,f=c.expandedStates&&p===w?x(false,c.expandedStates,-1):c.contents;u.push({mode:p,doc:f});break}case B:{let p=(c.groupId?i[c.groupId]||O:l)===w?c.breakContents:c.flatContents;p&&u.push({mode:l,doc:p});break}case k:if(l===w||c.hard)return true;c.soft||(a.push(" "),r--);break;case M:n=true;break;case L:if(n)return false;break}}return false}function Ve(e,t){let r={},n=t.printWidth,i=ut(t.endOfLine),s=0,o=[{ind:Dr(),mode:w,doc:e}],u=[],a=false,l=[],c=0;for(yn(e);o.length>0;){let{ind:p,mode:f,doc:D}=o.pop();switch(re(D)){case te:{let h=i!==`
|
|
24
|
+
`)):r)}function wn(e){if(e.type===k)return true}function An(e){return lt(e,wn,false)}function Ae(e,t){return e.type===V?{...e,contents:t(e.contents)}:t(e)}var ct=()=>{},sr=ct;function Oe(e){return {type:I,contents:e}}function ae(e,t){return {type:j,contents:t,n:e}}function or(e,t={}){return sr(t.expandedStates),{type:A,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function $n(e){return ae(Number.NEGATIVE_INFINITY,e)}function On(e){return ae({type:"root"},e)}function Nn(e){return ae(-1,e)}function Pn(e,t){return or(e[0],{...t,expandedStates:e})}function Tn(e){return {type:T,parts:e}}function Vn(e,t="",r={}){return {type:B,breakContents:e,flatContents:t,groupId:r.groupId}}function Wn(e,t){return {type:_,contents:e,groupId:t.groupId,negate:t.negate}}function Xe(e){return {type:M,contents:e}}var Rn={type:L},Te={type:$},In={type:G},pt={type:k,hard:true},ur={type:k,hard:true,literal:true},ar={type:k},jn={type:k,soft:true},Q=[pt,Te],lr=[ur,Te],Y={type:U};function cr(e,t){let r=[];for(let n=0;n<t.length;n++)n!==0&&r.push(e),r.push(t[n]);return r}function pr(e,t,r){let n=e;if(t>0){for(let i=0;i<Math.floor(t/r);++i)n=Oe(n);n=ae(t%r,n),n=ae(Number.NEGATIVE_INFINITY,n);}return n}function Gn(e,t){return e?{type:V,label:e,contents:t}:t}function W(e){var t;if(!e)return "";if(Array.isArray(e)){let r=[];for(let n of e)if(Array.isArray(n))r.push(...W(n));else {let i=W(n);i!==""&&r.push(i);}return r}return e.type===B?{...e,breakContents:W(e.breakContents),flatContents:W(e.flatContents)}:e.type===A?{...e,contents:W(e.contents),expandedStates:(t=e.expandedStates)==null?void 0:t.map(W)}:e.type===T?{type:"fill",parts:e.parts.map(W)}:e.contents?{...e,contents:W(e.contents)}:e}function _n(e){let t=Object.create(null),r=new Set;return n(W(e));function n(s,o,u){var a,l;if(typeof s=="string")return JSON.stringify(s);if(Array.isArray(s)){let c=s.map(n).filter(Boolean);return c.length===1?c[0]:`[${c.join(", ")}]`}if(s.type===k){let c=((a=u?.[o+1])==null?void 0:a.type)===$;return s.literal?c?"literalline":"literallineWithoutBreakParent":s.hard?c?"hardline":"hardlineWithoutBreakParent":s.soft?"softline":"line"}if(s.type===$)return ((l=u?.[o-1])==null?void 0:l.type)===k&&u[o-1].hard?void 0:"breakParent";if(s.type===G)return "trim";if(s.type===I)return "indent("+n(s.contents)+")";if(s.type===j)return s.n===Number.NEGATIVE_INFINITY?"dedentToRoot("+n(s.contents)+")":s.n<0?"dedent("+n(s.contents)+")":s.n.type==="root"?"markAsRoot("+n(s.contents)+")":"align("+JSON.stringify(s.n)+", "+n(s.contents)+")";if(s.type===B)return "ifBreak("+n(s.breakContents)+(s.flatContents?", "+n(s.flatContents):"")+(s.groupId?(s.flatContents?"":', ""')+`, { groupId: ${i(s.groupId)} }`:"")+")";if(s.type===_){let c=[];s.negate&&c.push("negate: true"),s.groupId&&c.push(`groupId: ${i(s.groupId)}`);let d=c.length>0?`, { ${c.join(", ")} }`:"";return `indentIfBreak(${n(s.contents)}${d})`}if(s.type===A){let c=[];s.break&&s.break!=="propagated"&&c.push("shouldBreak: true"),s.id&&c.push(`id: ${i(s.id)}`);let d=c.length>0?`, { ${c.join(", ")} }`:"";return s.expandedStates?`conditionalGroup([${s.expandedStates.map(p=>n(p)).join(",")}]${d})`:`group(${n(s.contents)}${d})`}if(s.type===T)return `fill([${s.parts.map(c=>n(c)).join(", ")}])`;if(s.type===M)return "lineSuffix("+n(s.contents)+")";if(s.type===L)return "lineSuffixBoundary";if(s.type===V)return `label(${JSON.stringify(s.label)}, ${n(s.contents)})`;if(s.type===U)return "cursor";throw new Error("Unknown doc type "+s.type)}function i(s){if(typeof s!="symbol")return JSON.stringify(String(s));if(s in t)return t[s];let o=s.description||"symbol";for(let u=0;;u++){let a=o+(u>0?` #${u}`:"");if(!r.has(a))return r.add(a),t[s]=`Symbol.for(${JSON.stringify(a)})`}}}var Mn=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;function Ln(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function zn(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}var Jn=e=>!(Ln(e)||zn(e)),qn=/[^\x20-\x7F]/u;function Un(e){if(!e)return 0;if(!qn.test(e))return e.length;e=e.replace(Mn()," ");let t=0;for(let r of e){let n=r.codePointAt(0);n<=31||n>=127&&n<=159||n>=768&&n<=879||(t+=Jn(n)?1:2);}return t}var Dt=Un,w=Symbol("MODE_BREAK"),O=Symbol("MODE_FLAT"),se=Symbol("cursor"),Ye=Symbol("DOC_FILL_PRINTED_LENGTH");function Dr(){return {value:"",length:0,queue:[]}}function Hn(e,t){return Qe(e,{type:"indent"},t)}function Zn(e,t,r){return t===Number.NEGATIVE_INFINITY?e.root||Dr():t<0?Qe(e,{type:"dedent"},r):t?t.type==="root"?{...e,root:e}:Qe(e,{type:typeof t=="string"?"stringAlign":"numberAlign",n:t},r):e}function Qe(e,t,r){let n=t.type==="dedent"?e.queue.slice(0,-1):[...e.queue,t],i="",s=0,o=0,u=0;for(let D of n)switch(D.type){case "indent":c(),r.useTabs?a(1):l(r.tabWidth);break;case "stringAlign":c(),i+=D.n,s+=D.n.length;break;case "numberAlign":o+=1,u+=D.n;break;default:throw new Error(`Unexpected type '${D.type}'`)}return p(),{...e,value:i,length:s,queue:n};function a(D){i+=" ".repeat(D),s+=r.tabWidth*D;}function l(D){i+=" ".repeat(D),s+=D;}function c(){r.useTabs?d():p();}function d(){o>0&&a(o),f();}function p(){u>0&&l(u),f();}function f(){o=0,u=0;}}function et(e){let t=0,r=0,n=e.length;e:for(;n--;){let i=e[n];if(i===se){r++;continue}for(let s=i.length-1;s>=0;s--){let o=i[s];if(o===" "||o===" ")t++;else {e[n]=i.slice(0,s+1);break e}}}if(t>0||r>0)for(e.length=n+1;r-- >0;)e.push(se);return t}function ke(e,t,r,n,i,s){if(r===Number.POSITIVE_INFINITY)return true;let o=t.length,u=[e],a=[];for(;r>=0;){if(u.length===0){if(o===0)return true;u.push(t[--o]);continue}let{mode:l,doc:c}=u.pop(),d=re(c);switch(d){case te:a.push(c),r-=Dt(c);break;case R:case T:{let p=d===R?c:c.parts,f=c[Ye]??0;for(let D=p.length-1;D>=f;D--)u.push({mode:l,doc:p[D]});break}case I:case j:case _:case V:u.push({mode:l,doc:c.contents});break;case G:r+=et(a);break;case A:{if(s&&c.break)return false;let p=c.break?w:l,f=c.expandedStates&&p===w?x(false,c.expandedStates,-1):c.contents;u.push({mode:p,doc:f});break}case B:{let p=(c.groupId?i[c.groupId]||O:l)===w?c.breakContents:c.flatContents;p&&u.push({mode:l,doc:p});break}case k:if(l===w||c.hard)return true;c.soft||(a.push(" "),r--);break;case M:n=true;break;case L:if(n)return false;break}}return false}function Ve(e,t){let r={},n=t.printWidth,i=ut(t.endOfLine),s=0,o=[{ind:Dr(),mode:w,doc:e}],u=[],a=false,l=[],c=0;for(yn(e);o.length>0;){let{ind:p,mode:f,doc:D}=o.pop();switch(re(D)){case te:{let h=i!==`
|
|
25
25
|
`?Ne(false,D,`
|
|
26
|
-
`,i):D;u.push(h),o.length>0&&(s+=Dt(h));break}case R:for(let h=D.length-1;h>=0;h--)o.push({ind:p,mode:f,doc:D[h]});break;case U:if(c>=2)throw new Error("There are too many 'cursor' in doc.");u.push(se),c++;break;case I:o.push({ind:Hn(p,t),mode:f,doc:D.contents});break;case j:o.push({ind:
|
|
26
|
+
`,i):D;u.push(h),o.length>0&&(s+=Dt(h));break}case R:for(let h=D.length-1;h>=0;h--)o.push({ind:p,mode:f,doc:D[h]});break;case U:if(c>=2)throw new Error("There are too many 'cursor' in doc.");u.push(se),c++;break;case I:o.push({ind:Hn(p,t),mode:f,doc:D.contents});break;case j:o.push({ind:Zn(p,D.n,t),mode:f,doc:D.contents});break;case G:s-=et(u);break;case A:switch(f){case O:if(!a){o.push({ind:p,mode:D.break?w:O,doc:D.contents});break}case w:{a=false;let h={ind:p,mode:O,doc:D.contents},m=n-s,g=l.length>0;if(!D.break&&ke(h,o,m,g,r))o.push(h);else if(D.expandedStates){let E=x(false,D.expandedStates,-1);if(D.break){o.push({ind:p,mode:w,doc:E});break}else for(let F=1;F<D.expandedStates.length+1;F++)if(F>=D.expandedStates.length){o.push({ind:p,mode:w,doc:E});break}else {let y=D.expandedStates[F],C={ind:p,mode:O,doc:y};if(ke(C,o,m,g,r)){o.push(C);break}}}else o.push({ind:p,mode:w,doc:D.contents});break}}D.id&&(r[D.id]=x(false,o,-1).mode);break;case T:{let h=n-s,m=D[Ye]??0,{parts:g}=D,E=g.length-m;if(E===0)break;let F=g[m+0],y=g[m+1],C={ind:p,mode:O,doc:F},S={ind:p,mode:w,doc:F},v=ke(C,[],h,l.length>0,r,true);if(E===1){v?o.push(C):o.push(S);break}let z={ind:p,mode:O,doc:y},pe={ind:p,mode:w,doc:y};if(E===2){v?o.push(z,C):o.push(pe,S);break}let _e=g[m+2],Me={ind:p,mode:f,doc:{...D,[Ye]:m+2}};ke({ind:p,mode:O,doc:[F,y,_e]},[],h,l.length>0,r,true)?o.push(Me,z,C):v?o.push(Me,pe,C):o.push(Me,pe,S);break}case B:case _:{let h=D.groupId?r[D.groupId]:f;if(h===w){let m=D.type===B?D.breakContents:D.negate?D.contents:Oe(D.contents);m&&o.push({ind:p,mode:f,doc:m});}if(h===O){let m=D.type===B?D.flatContents:D.negate?Oe(D.contents):D.contents;m&&o.push({ind:p,mode:f,doc:m});}break}case M:l.push({ind:p,mode:f,doc:D.contents});break;case L:l.length>0&&o.push({ind:p,mode:f,doc:pt});break;case k:switch(f){case O:if(D.hard)a=true;else {D.soft||(u.push(" "),s+=1);break}case w:if(l.length>0){o.push({ind:p,mode:f,doc:D},...l.reverse()),l.length=0;break}D.literal?p.root?(u.push(i,p.root.value),s=p.root.length):(u.push(i),s=0):(s-=et(u),u.push(i+p.value),s=p.length);break}break;case V:o.push({ind:p,mode:f,doc:D.contents});break;case $:break;default:throw new ue(D)}o.length===0&&l.length>0&&(o.push(...l.reverse()),l.length=0);}let d=u.indexOf(se);if(d!==-1){let p=u.indexOf(se,d+1);if(p===-1)return {formatted:u.filter(m=>m!==se).join("")};let f=u.slice(0,d).join(""),D=u.slice(d+1,p).join(""),h=u.slice(p+1).join("");return {formatted:f+D+h,cursorNodeStart:f.length,cursorNodeText:D}}return {formatted:u.join("")}}function Kn(e,t,r=0){let n=0;for(let i=r;i<e.length;++i)e[i]===" "?n=n+t-n%t:n++;return n}var dt=Kn,Z,tt,Be,Xn=class{constructor(e){tn(this,Z),this.stack=[e];}get key(){let{stack:e,siblings:t}=this;return x(false,e,t===null?-2:-4)??null}get index(){return this.siblings===null?null:x(false,this.stack,-2)}get node(){return x(false,this.stack,-1)}get parent(){return this.getNode(1)}get grandparent(){return this.getNode(2)}get isInArray(){return this.siblings!==null}get siblings(){let{stack:e}=this,t=x(false,e,-3);return Array.isArray(t)?t:null}get next(){let{siblings:e}=this;return e===null?null:e[this.index+1]}get previous(){let{siblings:e}=this;return e===null?null:e[this.index-1]}get isFirst(){return this.index===0}get isLast(){let{siblings:e,index:t}=this;return e!==null&&t===e.length-1}get isRoot(){return this.stack.length===1}get root(){return this.stack[0]}get ancestors(){return [...De(this,Z,Be).call(this)]}getName(){let{stack:e}=this,{length:t}=e;return t>1?x(false,e,-2):null}getValue(){return x(false,this.stack,-1)}getNode(e=0){let t=De(this,Z,tt).call(this,e);return t===-1?null:this.stack[t]}getParentNode(e=0){return this.getNode(e+1)}call(e,...t){let{stack:r}=this,{length:n}=r,i=x(false,r,-1);for(let s of t)i=i[s],r.push(s,i);try{return e(this)}finally{r.length=n;}}callParent(e,t=0){let r=De(this,Z,tt).call(this,t+1),n=this.stack.splice(r+1);try{return e(this)}finally{this.stack.push(...n);}}each(e,...t){let{stack:r}=this,{length:n}=r,i=x(false,r,-1);for(let s of t)i=i[s],r.push(s,i);try{for(let s=0;s<i.length;++s)r.push(s,i[s]),e(this,s,i),r.length-=2;}finally{r.length=n;}}map(e,...t){let r=[];return this.each((n,i,s)=>{r[i]=e(n,i,s);},...t),r}match(...e){let t=this.stack.length-1,r=null,n=this.stack[t--];for(let i of e){if(n===void 0)return false;let s=null;if(typeof r=="number"&&(s=r,r=this.stack[t--],n=this.stack[t--]),i&&!i(n,r,s))return false;r=this.stack[t--],n=this.stack[t--];}return true}findAncestor(e){for(let t of De(this,Z,Be).call(this))if(e(t))return t}hasAncestor(e){for(let t of De(this,Z,Be).call(this))if(e(t))return true;return false}};Z=new WeakSet,tt=function(e){let{stack:t}=this;for(let r=t.length-1;r>=0;r-=2)if(!Array.isArray(t[r])&&--e<0)return r;return -1},Be=function*(){let{stack:e}=this;for(let t=e.length-3;t>=0;t-=2){let r=e[t];Array.isArray(r)||(yield r);}};var Yn=Xn,dr=new Proxy(()=>{},{get:()=>dr}),rt=dr;function Qn(e){return e!==null&&typeof e=="object"}var ei=Qn;function*We(e,t){let{getVisitorKeys:r,filter:n=()=>true}=t,i=s=>ei(s)&&n(s);for(let s of r(e)){let o=e[s];if(Array.isArray(o))for(let u of o)i(u)&&(yield u);else i(o)&&(yield o);}}function*ti(e,t){let r=[e];for(let n=0;n<r.length;n++){let i=r[n];for(let s of We(i,t))yield s,r.push(s);}}function ri(e,t){return We(e,t).next().done}function me(e){return (t,r,n)=>{let i=!!(n!=null&&n.backwards);if(r===false)return false;let{length:s}=t,o=r;for(;o>=0&&o<s;){let u=t.charAt(o);if(e instanceof RegExp){if(!e.test(u))return o}else if(!e.includes(u))return o;i?o--:o++;}return o===-1||o===s?o:false}}var ni=me(/\s/u),q=me(" "),fr=me(",; "),hr=me(/[^\n\r]/u);function ii(e,t,r){let n=!!(r!=null&&r.backwards);if(t===false)return false;let i=e.charAt(t);if(n){if(e.charAt(t-1)==="\r"&&i===`
|
|
27
27
|
`)return t-2;if(i===`
|
|
28
28
|
`||i==="\r"||i==="\u2028"||i==="\u2029")return t-1}else {if(i==="\r"&&e.charAt(t+1)===`
|
|
29
29
|
`)return t+2;if(i===`
|
|
30
|
-
`||i==="\r"||i==="\u2028"||i==="\u2029")return t+1}return t}var ee=ii;function si(e,t,r={}){let n=q(e,r.backwards?t-1:t,r),i=ee(e,n,r);return n!==i}var J=si;function oi(e){return Array.isArray(e)&&e.length>0}var ui=oi,mr=new Set(["tokens","comments","parent","enclosingNode","precedingNode","followingNode"]),ai=e=>Object.keys(e).filter(t=>!mr.has(t));function li(e){return e?t=>e(t,mr):ai}var Re=li;function ci(e){let t=e.type||e.kind||"(unknown type)",r=String(e.name||e.id&&(typeof e.id=="object"?e.id.name:e.id)||e.key&&(typeof e.key=="object"?e.key.name:e.key)||e.value&&(typeof e.value=="object"?"":String(e.value))||e.operator||"");return r.length>20&&(r=r.slice(0,19)+"\u2026"),t+(r?" "+r:"")}function ft(e,t){(e.comments??(e.comments=[])).push(t),t.printed=false,t.nodeDescription=ci(e);}function fe(e,t){t.leading=true,t.trailing=false,ft(e,t);}function
|
|
30
|
+
`||i==="\r"||i==="\u2028"||i==="\u2029")return t+1}return t}var ee=ii;function si(e,t,r={}){let n=q(e,r.backwards?t-1:t,r),i=ee(e,n,r);return n!==i}var J=si;function oi(e){return Array.isArray(e)&&e.length>0}var ui=oi,mr=new Set(["tokens","comments","parent","enclosingNode","precedingNode","followingNode"]),ai=e=>Object.keys(e).filter(t=>!mr.has(t));function li(e){return e?t=>e(t,mr):ai}var Re=li;function ci(e){let t=e.type||e.kind||"(unknown type)",r=String(e.name||e.id&&(typeof e.id=="object"?e.id.name:e.id)||e.key&&(typeof e.key=="object"?e.key.name:e.key)||e.value&&(typeof e.value=="object"?"":String(e.value))||e.operator||"");return r.length>20&&(r=r.slice(0,19)+"\u2026"),t+(r?" "+r:"")}function ft(e,t){(e.comments??(e.comments=[])).push(t),t.printed=false,t.nodeDescription=ci(e);}function fe(e,t){t.leading=true,t.trailing=false,ft(e,t);}function K(e,t,r){t.leading=false,t.trailing=false,r&&(t.marker=r),ft(e,t);}function he(e,t){t.leading=false,t.trailing=true,ft(e,t);}var Je=new WeakMap;function ht(e,t){if(Je.has(e))return Je.get(e);let{printer:{getCommentChildNodes:r,canAttachComment:n,getVisitorKeys:i},locStart:s,locEnd:o}=t;if(!n)return [];let u=(r?.(e,t)??[...We(e,{getVisitorKeys:Re(i)})]).flatMap(a=>n(a)?[a]:ht(a,t));return u.sort((a,l)=>s(a)-s(l)||o(a)-o(l)),Je.set(e,u),u}function gr(e,t,r,n){let{locStart:i,locEnd:s}=r,o=i(t),u=s(t),a=ht(e,r),l,c,d=0,p=a.length;for(;d<p;){let f=d+p>>1,D=a[f],h=i(D),m=s(D);if(h<=o&&u<=m)return gr(D,t,r,D);if(m<=o){l=D,d=f+1;continue}if(u<=h){c=D,p=f;continue}throw new Error("Comment location overlaps with node location")}if(n?.type==="TemplateLiteral"){let{quasis:f}=n,D=Ue(f,t,r);l&&Ue(f,l,r)!==D&&(l=null),c&&Ue(f,c,r)!==D&&(c=null);}return {enclosingNode:n,precedingNode:l,followingNode:c}}var qe=()=>false;function pi(e,t){let{comments:r}=e;if(delete e.comments,!ui(r)||!t.printer.canAttachComment)return;let n=[],{printer:{experimentalFeatures:{avoidAstMutation:i=false}={},handleComments:s={}},originalText:o}=t,{ownLine:u=qe,endOfLine:a=qe,remaining:l=qe}=s,c=r.map((d,p)=>({...gr(e,d,t),comment:d,text:o,options:t,ast:e,isLastComment:r.length-1===p}));for(let[d,p]of c.entries()){let{comment:f,precedingNode:D,enclosingNode:h,followingNode:m,text:g,options:E,ast:F,isLastComment:y}=p,C;if(i?C=[p]:(f.enclosingNode=h,f.precedingNode=D,f.followingNode=m,C=[f,g,E,F,y]),Di(g,E,c,d))f.placement="ownLine",u(...C)||(m?fe(m,f):D?he(D,f):K(h||F,f));else if(di(g,E,c,d))f.placement="endOfLine",a(...C)||(D?he(D,f):m?fe(m,f):K(h||F,f));else if(f.placement="remaining",!l(...C))if(D&&m){let S=n.length;S>0&&n[S-1].followingNode!==m&&At(n,E),n.push(p);}else D?he(D,f):m?fe(m,f):K(h||F,f);}if(At(n,t),!i)for(let d of r)delete d.precedingNode,delete d.enclosingNode,delete d.followingNode;}var Fr=e=>!/[\S\n\u2028\u2029]/u.test(e);function Di(e,t,r,n){let{comment:i,precedingNode:s}=r[n],{locStart:o,locEnd:u}=t,a=o(i);if(s)for(let l=n-1;l>=0;l--){let{comment:c,precedingNode:d}=r[l];if(d!==s||!Fr(e.slice(u(c),a)))break;a=o(c);}return J(e,a,{backwards:true})}function di(e,t,r,n){let{comment:i,followingNode:s}=r[n],{locStart:o,locEnd:u}=t,a=u(i);if(s)for(let l=n+1;l<r.length;l++){let{comment:c,followingNode:d}=r[l];if(d!==s||!Fr(e.slice(a,o(c))))break;a=u(c);}return J(e,a)}function At(e,t){var r,n;let i=e.length;if(i===0)return;let{precedingNode:s,followingNode:o}=e[0],u=t.locStart(o),a;for(a=i;a>0;--a){let{comment:l,precedingNode:c,followingNode:d}=e[a-1];rt.strictEqual(c,s),rt.strictEqual(d,o);let p=t.originalText.slice(t.locEnd(l),u);if(((n=(r=t.printer).isGap)==null?void 0:n.call(r,p,t))??/^[\s(]*$/u.test(p))u=t.locStart(l);else break}for(let[l,{comment:c}]of e.entries())l<a?he(s,c):fe(o,c);for(let l of [s,o])l.comments&&l.comments.length>1&&l.comments.sort((c,d)=>t.locStart(c)-t.locStart(d));e.length=0;}function Ue(e,t,r){let n=r.locStart(t)-1;for(let i=1;i<e.length;++i)if(n<r.locStart(e[i]))return i-1;return 0}function fi(e,t){let r=t-1;r=q(e,r,{backwards:true}),r=ee(e,r,{backwards:true}),r=q(e,r,{backwards:true});let n=ee(e,r,{backwards:true});return r!==n}var mt=fi;function Cr(e,t){let r=e.node;return r.printed=true,t.printer.printComment(e,t)}function hi(e,t){var r;let n=e.node,i=[Cr(e,t)],{printer:s,originalText:o,locStart:u,locEnd:a}=t;if((r=s.isBlockComment)!=null&&r.call(s,n)){let c=J(o,a(n))?J(o,u(n),{backwards:true})?Q:ar:" ";i.push(c);}else i.push(Q);let l=ee(o,q(o,a(n)));return l!==false&&J(o,l)&&i.push(Q),i}function mi(e,t,r){var n;let i=e.node,s=Cr(e,t),{printer:o,originalText:u,locStart:a}=t,l=(n=o.isBlockComment)==null?void 0:n.call(o,i);if(r!=null&&r.hasLineSuffix&&!(r!=null&&r.isBlock)||J(u,a(i),{backwards:true})){let c=mt(u,a(i));return {doc:Xe([Q,c?Q:"",s]),isBlock:l,hasLineSuffix:true}}return !l||r!=null&&r.hasLineSuffix?{doc:[Xe([" ",s]),Te],isBlock:l,hasLineSuffix:true}:{doc:[" ",s],isBlock:l,hasLineSuffix:false}}function gi(e,t){let r=e.node;if(!r)return {};let n=t[Symbol.for("printedComments")];if((r.comments||[]).filter(u=>!n.has(u)).length===0)return {leading:"",trailing:""};let i=[],s=[],o;return e.each(()=>{let u=e.node;if(n!=null&&n.has(u))return;let{leading:a,trailing:l}=u;a?i.push(hi(e,t)):l&&(o=mi(e,t,o),s.push(o.doc));},"comments"),{leading:i,trailing:s}}function Fi(e,t,r){let{leading:n,trailing:i}=gi(e,r);return !n&&!i?t:Ae(t,s=>[n,s,i])}function Ci(e){let{[Symbol.for("comments")]:t,[Symbol.for("printedComments")]:r}=e;for(let n of t){if(!n.printed&&!r.has(n))throw new Error('Comment "'+n.value.trim()+'" was not printed. Please report this error!');delete n.printed;}}var Er=class extends Error{constructor(){super(...arguments);b(this,"name","ConfigError");}},Bt=class extends Error{constructor(){super(...arguments);b(this,"name","UndefinedParserError");}},vi={checkIgnorePragma:{category:"Special",type:"boolean",default:false,description:"Check whether the file's first docblock comment contains '@noprettier' or '@noformat' to determine if it should be formatted.",cliCategory:"Other"},cursorOffset:{category:"Special",type:"int",default:-1,range:{start:-1,end:1/0,step:1},description:"Print (to stderr) where a cursor at the given position would move to after formatting.",cliCategory:"Editor"},endOfLine:{category:"Global",type:"choice",default:"lf",description:"Which end of line characters to apply.",choices:[{value:"lf",description:"Line Feed only (\\n), common on Linux and macOS as well as inside git repos"},{value:"crlf",description:"Carriage Return + Line Feed characters (\\r\\n), common on Windows"},{value:"cr",description:"Carriage Return character only (\\r), used very rarely"},{value:"auto",description:`Maintain existing
|
|
31
31
|
(mixed values within one file are normalised by looking at what's used after the first line)`}]},filepath:{category:"Special",type:"path",description:"Specify the input filepath. This will be used to do parser inference.",cliName:"stdin-filepath",cliCategory:"Other",cliDescription:"Path to the file to pretend that stdin comes from."},insertPragma:{category:"Special",type:"boolean",default:false,description:"Insert @format pragma into file's first docblock comment.",cliCategory:"Other"},parser:{category:"Global",type:"choice",default:void 0,description:"Which parser to use.",exception:e=>typeof e=="string"||typeof e=="function",choices:[{value:"flow",description:"Flow"},{value:"babel",description:"JavaScript"},{value:"babel-flow",description:"Flow"},{value:"babel-ts",description:"TypeScript"},{value:"typescript",description:"TypeScript"},{value:"acorn",description:"JavaScript"},{value:"espree",description:"JavaScript"},{value:"meriyah",description:"JavaScript"},{value:"css",description:"CSS"},{value:"less",description:"Less"},{value:"scss",description:"SCSS"},{value:"json",description:"JSON"},{value:"json5",description:"JSON5"},{value:"jsonc",description:"JSON with Comments"},{value:"json-stringify",description:"JSON.stringify"},{value:"graphql",description:"GraphQL"},{value:"markdown",description:"Markdown"},{value:"mdx",description:"MDX"},{value:"vue",description:"Vue"},{value:"yaml",description:"YAML"},{value:"glimmer",description:"Ember / Handlebars"},{value:"html",description:"HTML"},{value:"angular",description:"Angular"},{value:"lwc",description:"Lightning Web Components"},{value:"mjml",description:"MJML"}]},plugins:{type:"path",array:true,default:[{value:[]}],category:"Global",description:"Add a plugin. Multiple plugins can be passed as separate `--plugin`s.",exception:e=>typeof e=="string"||typeof e=="object",cliName:"plugin",cliCategory:"Config"},printWidth:{category:"Global",type:"int",default:80,description:"The line length where Prettier will try wrap.",range:{start:0,end:1/0,step:1}},rangeEnd:{category:"Special",type:"int",default:1/0,range:{start:0,end:1/0,step:1},description:`Format code ending at a given character offset (exclusive).
|
|
32
32
|
The range will extend forwards to the end of the selected statement.`,cliCategory:"Editor"},rangeStart:{category:"Special",type:"int",default:0,range:{start:0,end:1/0,step:1},description:`Format code starting at a given character offset.
|
|
33
33
|
The range will extend backwards to the start of the first line containing the selected statement.`,cliCategory:"Editor"},requirePragma:{category:"Special",type:"boolean",default:false,description:"Require either '@prettier' or '@format' to be present in the file's first docblock comment in order for it to be formatted.",cliCategory:"Other"},tabWidth:{type:"int",category:"Global",default:2,description:"Number of spaces per indentation level.",range:{start:0,end:1/0,step:1}},useTabs:{category:"Global",type:"boolean",default:false,description:"Indent with tabs instead of spaces."},embeddedLanguageFormatting:{category:"Global",type:"choice",default:"auto",description:"Control how Prettier formats quoted code embedded in the file.",choices:[{value:"auto",description:"Format embedded code if Prettier can automatically identify it."},{value:"off",description:"Never automatically format embedded code."}]}};function yr({plugins:e=[],showDeprecated:t=false}={}){let r=e.flatMap(i=>i.languages??[]),n=[];for(let i of Si(Object.assign({},...e.map(({options:s})=>s),vi)))!t&&i.deprecated||(Array.isArray(i.choices)&&(t||(i.choices=i.choices.filter(s=>!s.deprecated)),i.name==="parser"&&(i.choices=[...i.choices,...bi(i.choices,r,e)])),i.pluginDefaults=Object.fromEntries(e.filter(s=>{var o;return ((o=s.defaultOptions)==null?void 0:o[i.name])!==void 0}).map(s=>[s.name,s.defaultOptions[i.name]])),n.push(i));return {languages:r,options:n}}function*bi(e,t,r){let n=new Set(e.map(i=>i.value));for(let i of t)if(i.parsers){for(let s of i.parsers)if(!n.has(s)){n.add(s);let o=r.find(a=>a.parsers&&Object.prototype.hasOwnProperty.call(a.parsers,s)),u=i.name;o!=null&&o.name&&(u+=` (plugin: ${o.name})`),yield {value:s,description:u};}}}function Si(e){let t=[];for(let[r,n]of Object.entries(e)){let i={name:r,...n};Array.isArray(i.default)&&(i.default=x(false,i.default,-1).value),t.push(i);}return t}var xi=(e,t)=>{if(!(e&&t==null))return t.toReversed||!Array.isArray(t)?t.toReversed():[...t].reverse()},ki=xi,$t,Ot,Nt,Pt,Tt,wi=(($t=globalThis.Deno)==null?void 0:$t.build.os)==="windows"||((Nt=(Ot=globalThis.navigator)==null?void 0:Ot.platform)==null?void 0:Nt.startsWith("Win"))||((Tt=(Pt=globalThis.process)==null?void 0:Pt.platform)==null?void 0:Tt.startsWith("win"))||false;function vr(e){if(e=e instanceof URL?e:new URL(e),e.protocol!=="file:")throw new TypeError(`URL must be a file URL: received "${e.protocol}"`);return e}function Ai(e){return e=vr(e),decodeURIComponent(e.pathname.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"))}function Bi(e){e=vr(e);let t=decodeURIComponent(e.pathname.replace(/\//g,"\\").replace(/%(?![0-9A-Fa-f]{2})/g,"%25")).replace(/^\\*([A-Za-z]:)(\\|$)/,"$1\\");return e.hostname!==""&&(t=`\\\\${e.hostname}${t}`),t}function $i(e){return wi?Bi(e):Ai(e)}var Oi=$i,Ni=e=>String(e).split(/[/\\]/u).pop();function Vt(e,t){if(!t)return;let r=Ni(t).toLowerCase();return e.find(({filenames:n})=>n?.some(i=>i.toLowerCase()===r))??e.find(({extensions:n})=>n?.some(i=>r.endsWith(i)))}function Pi(e,t){if(t)return e.find(({name:r})=>r.toLowerCase()===t)??e.find(({aliases:r})=>r?.includes(t))??e.find(({extensions:r})=>r?.includes(`.${t}`))}function Wt(e,t){if(t){if(String(t).startsWith("file:"))try{t=Oi(t);}catch{return}if(typeof t=="string")return e.find(({isSupported:r})=>r?.({filepath:t}))}}function Ti(e,t){let r=ki(false,e.plugins).flatMap(i=>i.languages??[]),n=Pi(r,t.language)??Vt(r,t.physicalFile)??Vt(r,t.file)??Wt(r,t.physicalFile)??Wt(r,t.file)??(t.physicalFile,void 0);return n?.parsers[0]}var Vi=Ti,oe={key:e=>/^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(e)?e:JSON.stringify(e),value(e){if(e===null||typeof e!="object")return JSON.stringify(e);if(Array.isArray(e))return `[${e.map(r=>oe.value(r)).join(", ")}]`;let t=Object.keys(e);return t.length===0?"{}":`{ ${t.map(r=>`${oe.key(r)}: ${oe.value(e[r])}`).join(", ")} }`},pair:({key:e,value:t})=>oe.value({[e]:t})},br=new Proxy(String,{get:()=>br}),N=br,Wi=(e,t,{descriptor:r})=>{let n=[`${N.yellow(typeof e=="string"?r.key(e):r.pair(e))} is deprecated`];return t&&n.push(`we now treat it as ${N.blue(typeof t=="string"?r.key(t):r.pair(t))}`),n.join("; ")+"."},Sr=Symbol.for("vnopts.VALUE_NOT_EXIST"),$e=Symbol.for("vnopts.VALUE_UNCHANGED"),Rt=" ".repeat(2),Ri=(e,t,r)=>{let{text:n,list:i}=r.normalizeExpectedResult(r.schemas[e].expected(r)),s=[];return n&&s.push(It(e,t,n,r.descriptor)),i&&s.push([It(e,t,i.title,r.descriptor)].concat(i.values.map(o=>xr(o,r.loggerPrintWidth))).join(`
|
|
34
34
|
`)),kr(s,r.loggerPrintWidth)};function It(e,t,r,n){return [`Invalid ${N.red(n.key(e))} value.`,`Expected ${N.blue(r)},`,`but received ${t===Sr?N.gray("nothing"):N.red(n.value(t))}.`].join(" ")}function xr({text:e,list:t},r){let n=[];return e&&n.push(`- ${N.blue(e)}`),t&&n.push([`- ${N.blue(t.title)}:`].concat(t.values.map(i=>xr(i,r-Rt.length).replace(/^|\n/g,`$&${Rt}`))).join(`
|
|
35
35
|
`)),kr(n,r)}function kr(e,t){if(e.length===1)return e[0];let[r,n]=e,[i,s]=e.map(o=>o.split(`
|
|
36
|
-
`,1)[0].length);return i>t&&i>s?n:r}var He=[],jt=[];function Ii(e,t){if(e===t)return 0;let r=e;e.length>t.length&&(e=t,t=r);let n=e.length,i=t.length;for(;n>0&&e.charCodeAt(~-n)===t.charCodeAt(~-i);)n--,i--;let s=0;for(;s<n&&e.charCodeAt(s)===t.charCodeAt(s);)s++;if(n-=s,i-=s,n===0)return i;let o,u,a,l,c=0,d=0;for(;c<n;)jt[c]=e.charCodeAt(s+c),He[c]=++c;for(;d<i;)for(o=t.charCodeAt(s+d),a=d++,u=d,c=0;c<n;c++)l=o===jt[c]?a:a+1,a=He[c],u=He[c]=a>u?l>u?u+1:l:l>a?a+1:l;return u}var wr=(e,t,{descriptor:r,logger:n,schemas:i})=>{let s=[`Ignored unknown option ${N.yellow(r.pair({key:e,value:t}))}.`],o=Object.keys(i).sort().find(u=>Ii(e,u)<3);o&&s.push(`Did you mean ${N.blue(r.key(o))}?`),n.warn(s.join(" "));},ji=["default","expected","validate","deprecated","forward","redirect","overlap","preprocess","postprocess"];function Gi(e,t){let r=new e(t),n=Object.create(r);for(let i of ji)i in t&&(n[i]=_i(t[i],r,H.prototype[i].length));return n}var H=class{static create(e){return Gi(this,e)}constructor(e){this.name=e.name;}default(e){}expected(e){return "nothing"}validate(e,t){return false}deprecated(e,t){return false}forward(e,t){}redirect(e,t){}overlap(e,t,r){return e}preprocess(e,t){return e}postprocess(e,t){return $e}};function _i(e,t,r){return typeof e=="function"?(...n)=>e(...n.slice(0,r-1),t,...n.slice(r-1)):()=>e}var Mi=class extends H{constructor(e){super(e),this._sourceName=e.sourceName;}expected(e){return e.schemas[this._sourceName].expected(e)}validate(e,t){return t.schemas[this._sourceName].validate(e,t)}redirect(e,t){return this._sourceName}},Li=class extends H{expected(){return "anything"}validate(){return true}},zi=class extends H{constructor({valueSchema:e,name:t=e.name,...r}){super({...r,name:t}),this._valueSchema=e;}expected(e){let{text:t,list:r}=e.normalizeExpectedResult(this._valueSchema.expected(e));return {text:t&&`an array of ${t}`,list:r&&{title:"an array of the following values",values:[{list:r}]}}}validate(e,t){if(!Array.isArray(e))return false;let r=[];for(let n of e){let i=t.normalizeValidateResult(this._valueSchema.validate(n,t),n);i!==true&&r.push(i.value);}return r.length===0?true:{value:r}}deprecated(e,t){let r=[];for(let n of e){let i=t.normalizeDeprecatedResult(this._valueSchema.deprecated(n,t),n);i!==false&&r.push(...i.map(({value:s})=>({value:[s]})));}return r}forward(e,t){let r=[];for(let n of e){let i=t.normalizeForwardResult(this._valueSchema.forward(n,t),n);r.push(...i.map(Gt));}return r}redirect(e,t){let r=[],n=[];for(let i of e){let s=t.normalizeRedirectResult(this._valueSchema.redirect(i,t),i);"remain"in s&&r.push(s.remain),n.push(...s.redirect.map(Gt));}return r.length===0?{redirect:n}:{redirect:n,remain:r}}overlap(e,t){return e.concat(t)}};function Gt({from:e,to:t}){return {from:[e],to:t}}var Ji=class extends H{expected(){return "true or false"}validate(e){return typeof e=="boolean"}};function qi(e,t){let r=Object.create(null);for(let n of e){let i=n[t];if(r[i])throw new Error(`Duplicate ${t} ${JSON.stringify(i)}`);r[i]=n;}return r}function Ui(e,t){let r=new Map;for(let n of e){let i=n[t];if(r.has(i))throw new Error(`Duplicate ${t} ${JSON.stringify(i)}`);r.set(i,n);}return r}function Hi(){let e=Object.create(null);return t=>{let r=JSON.stringify(t);return e[r]?true:(e[r]=true,false)}}function Ki(e,t){let r=[],n=[];for(let i of e)t(i)?r.push(i):n.push(i);return [r,n]}function Zi(e){return e===Math.floor(e)}function Xi(e,t){if(e===t)return 0;let r=typeof e,n=typeof t,i=["undefined","object","boolean","number","string"];return r!==n?i.indexOf(r)-i.indexOf(n):r!=="string"?Number(e)-Number(t):e.localeCompare(t)}function Yi(e){return (...t)=>{let r=e(...t);return typeof r=="string"?new Error(r):r}}function _t(e){return e===void 0?{}:e}function Ar(e){if(typeof e=="string")return {text:e};let{text:t,list:r}=e;return Qi((t||r)!==void 0,"Unexpected `expected` result, there should be at least one field."),r?{text:t,list:{title:r.title,values:r.values.map(Ar)}}:{text:t}}function Mt(e,t){return e===true?true:e===false?{value:t}:e}function Lt(e,t,r=false){return e===false?false:e===true?r?true:[{value:t}]:"value"in e?[e]:e.length===0?false:e}function zt(e,t){return typeof e=="string"||"key"in e?{from:t,to:e}:"from"in e?{from:e.from,to:e.to}:{from:t,to:e.to}}function nt(e,t){return e===void 0?[]:Array.isArray(e)?e.map(r=>zt(r,t)):[zt(e,t)]}function Jt(e,t){let r=nt(typeof e=="object"&&"redirect"in e?e.redirect:e,t);return r.length===0?{remain:t,redirect:r}:typeof e=="object"&&"remain"in e?{remain:e.remain,redirect:r}:{redirect:r}}function Qi(e,t){if(!e)throw new Error(t)}var es=class extends H{constructor(e){super(e),this._choices=Ui(e.choices.map(t=>t&&typeof t=="object"?t:{value:t}),"value");}expected({descriptor:e}){let t=Array.from(this._choices.keys()).map(i=>this._choices.get(i)).filter(({hidden:i})=>!i).map(i=>i.value).sort(Xi).map(e.value),r=t.slice(0,-2),n=t.slice(-2);return {text:r.concat(n.join(" or ")).join(", "),list:{title:"one of the following values",values:t}}}validate(e){return this._choices.has(e)}deprecated(e){let t=this._choices.get(e);return t&&t.deprecated?{value:e}:false}forward(e){let t=this._choices.get(e);return t?t.forward:void 0}redirect(e){let t=this._choices.get(e);return t?t.redirect:void 0}},ts=class extends H{expected(){return "a number"}validate(e,t){return typeof e=="number"}},rs=class extends ts{expected(){return "an integer"}validate(e,t){return t.normalizeValidateResult(super.validate(e,t),e)===true&&Zi(e)}},qt=class extends H{expected(){return "a string"}validate(e){return typeof e=="string"}},ns=oe,is=wr,ss=Ri,os=Wi,us=class{constructor(e,t){let{logger:r=console,loggerPrintWidth:n=80,descriptor:i=ns,unknown:s=is,invalid:o=ss,deprecated:u=os,missing:a=()=>false,required:l=()=>false,preprocess:c=p=>p,postprocess:d=()=>$e}=t||{};this._utils={descriptor:i,logger:r||{warn:()=>{}},loggerPrintWidth:n,schemas:qi(e,"name"),normalizeDefaultResult:_t,normalizeExpectedResult:Ar,normalizeDeprecatedResult:Lt,normalizeForwardResult:nt,normalizeRedirectResult:Jt,normalizeValidateResult:Mt},this._unknownHandler=s,this._invalidHandler=Yi(o),this._deprecatedHandler=u,this._identifyMissing=(p,f)=>!(p in f)||a(p,f),this._identifyRequired=l,this._preprocess=c,this._postprocess=d,this.cleanHistory();}cleanHistory(){this._hasDeprecationWarned=Hi();}normalize(e){let t={},r=[this._preprocess(e,this._utils)],n=()=>{for(;r.length!==0;){let i=r.shift(),s=this._applyNormalization(i,t);r.push(...s);}};n();for(let i of Object.keys(this._utils.schemas)){let s=this._utils.schemas[i];if(!(i in t)){let o=_t(s.default(this._utils));"value"in o&&r.push({[i]:o.value});}}n();for(let i of Object.keys(this._utils.schemas)){if(!(i in t))continue;let s=this._utils.schemas[i],o=t[i],u=s.postprocess(o,this._utils);u!==$e&&(this._applyValidation(u,i,s),t[i]=u);}return this._applyPostprocess(t),this._applyRequiredCheck(t),t}_applyNormalization(e,t){let r=[],{knownKeys:n,unknownKeys:i}=this._partitionOptionKeys(e);for(let s of n){let o=this._utils.schemas[s],u=o.preprocess(e[s],this._utils);this._applyValidation(u,s,o);let a=({from:d,to:p})=>{r.push(typeof p=="string"?{[p]:d}:{[p.key]:p.value});},l=({value:d,redirectTo:p})=>{let f=Lt(o.deprecated(d,this._utils),u,true);if(f!==false)if(f===true)this._hasDeprecationWarned(s)||this._utils.logger.warn(this._deprecatedHandler(s,p,this._utils));else for(let{value:D}of f){let h={key:s,value:D};if(!this._hasDeprecationWarned(h)){let m=typeof p=="string"?{key:p,value:D}:p;this._utils.logger.warn(this._deprecatedHandler(h,m,this._utils));}}};nt(o.forward(u,this._utils),u).forEach(a);let c=Jt(o.redirect(u,this._utils),u);if(c.redirect.forEach(a),"remain"in c){let d=c.remain;t[s]=s in t?o.overlap(t[s],d,this._utils):d,l({value:d});}for(let{from:d,to:p}of c.redirect)l({value:d,redirectTo:p});}for(let s of i){let o=e[s];this._applyUnknownHandler(s,o,t,(u,a)=>{r.push({[u]:a});});}return r}_applyRequiredCheck(e){for(let t of Object.keys(this._utils.schemas))if(this._identifyMissing(t,e)&&this._identifyRequired(t))throw this._invalidHandler(t,Sr,this._utils)}_partitionOptionKeys(e){let[t,r]=Ki(Object.keys(e).filter(n=>!this._identifyMissing(n,e)),n=>n in this._utils.schemas);return {knownKeys:t,unknownKeys:r}}_applyValidation(e,t,r){let n=Mt(r.validate(e,this._utils),e);if(n!==true)throw this._invalidHandler(t,n.value,this._utils)}_applyUnknownHandler(e,t,r,n){let i=this._unknownHandler(e,t,this._utils);if(i)for(let s of Object.keys(i)){if(this._identifyMissing(s,i))continue;let o=i[s];s in this._utils.schemas?n(s,o):r[s]=o;}}_applyPostprocess(e){let t=this._postprocess(e,this._utils);if(t!==$e){if(t.delete)for(let r of t.delete)delete e[r];if(t.override){let{knownKeys:r,unknownKeys:n}=this._partitionOptionKeys(t.override);for(let i of r){let s=t.override[i];this._applyValidation(s,i,this._utils.schemas[i]),e[i]=s;}for(let i of n){let s=t.override[i];this._applyUnknownHandler(i,s,e,(o,u)=>{let a=this._utils.schemas[o];this._applyValidation(u,o,a),e[o]=u;});}}}}},Ke;function as(e,t,{logger:r=false,isCLI:n=false,passThrough:i=false,FlagSchema:s,descriptor:o}={}){if(n){if(!s)throw new Error("'FlagSchema' option is required.");if(!o)throw new Error("'descriptor' option is required.")}else o=oe;let u=i?Array.isArray(i)?(p,f)=>i.includes(p)?{[p]:f}:void 0:(p,f)=>({[p]:f}):(p,f,D)=>{let{_:h,...m}=D.schemas;return wr(p,f,{...D,schemas:m})},a=ls(t,{isCLI:n,FlagSchema:s}),l=new us(a,{logger:r,unknown:u,descriptor:o}),c=r!==false;c&&Ke&&(l._hasDeprecationWarned=Ke);let d=l.normalize(e);return c&&(Ke=l._hasDeprecationWarned),d}function ls(e,{isCLI:t,FlagSchema:r}){let n=[];t&&n.push(Li.create({name:"_"}));for(let i of e)n.push(cs(i,{isCLI:t,optionInfos:e,FlagSchema:r})),i.alias&&t&&n.push(Mi.create({name:i.alias,sourceName:i.name}));return n}function cs(e,{isCLI:t,optionInfos:r,FlagSchema:n}){let{name:i}=e,s={name:i},o,u={};switch(e.type){case "int":o=rs,t&&(s.preprocess=Number);break;case "string":o=qt;break;case "choice":o=es,s.choices=e.choices.map(a=>a!=null&&a.redirect?{...a,redirect:{to:{key:e.name,value:a.redirect}}}:a);break;case "boolean":o=Ji;break;case "flag":o=n,s.flags=r.flatMap(a=>[a.alias,a.description&&a.name,a.oppositeDescription&&`no-${a.name}`].filter(Boolean));break;case "path":o=qt;break;default:throw new Error(`Unexpected type ${e.type}`)}if(e.exception?s.validate=(a,l,c)=>e.exception(a)||l.validate(a,c):s.validate=(a,l,c)=>a===void 0||l.validate(a,c),e.redirect&&(u.redirect=a=>a?{to:typeof e.redirect=="string"?e.redirect:{key:e.redirect.option,value:e.redirect.value}}:void 0),e.deprecated&&(u.deprecated=true),t&&!e.array){let a=s.preprocess||(l=>l);s.preprocess=(l,c,d)=>c.preprocess(a(Array.isArray(l)?x(false,l,-1):l),d);}return e.array?zi.create({...t?{preprocess:a=>Array.isArray(a)?a:[a]}:{},...u,valueSchema:o.create(s)}):o.create({...s,...u})}var ps=as,Ds=(e,t,r)=>{if(!(e&&t==null)){if(t.findLast)return t.findLast(r);for(let n=t.length-1;n>=0;n--){let i=t[n];if(r(i,n,t))return i}}},Br=Ds;function $r(e,t){if(!t)throw new Error("parserName is required.");let r=Br(false,e,i=>i.parsers&&Object.prototype.hasOwnProperty.call(i.parsers,t));if(r)return r;let n=`Couldn't resolve parser "${t}".`;throw n+=" Plugins must be explicitly added to the standalone bundle.",new Er(n)}function ds(e,t){if(!t)throw new Error("astFormat is required.");let r=Br(false,e,i=>i.printers&&Object.prototype.hasOwnProperty.call(i.printers,t));if(r)return r;let n=`Couldn't find plugin for AST format "${t}".`;throw n+=" Plugins must be explicitly added to the standalone bundle.",new Er(n)}function gt({plugins:e,parser:t}){let r=$r(e,t);return Or(r,t)}function Or(e,t){let r=e.parsers[t];return typeof r=="function"?r():r}function fs(e,t){let r=e.printers[t];return typeof r=="function"?r():r}var Ut={astFormat:"estree",printer:{},originalText:void 0,locStart:null,locEnd:null};async function hs(e,t={}){var r;let n={...e};if(!n.parser)if(n.filepath){if(n.parser=Vi(n,{physicalFile:n.filepath}),!n.parser)throw new Bt(`No parser could be inferred for file "${n.filepath}".`)}else throw new Bt("No parser and no file path given, couldn't infer a parser.");let i=yr({plugins:e.plugins,showDeprecated:true}).options,s={...Ut,...Object.fromEntries(i.filter(p=>p.default!==void 0).map(p=>[p.name,p.default]))},o=$r(n.plugins,n.parser),u=await Or(o,n.parser);n.astFormat=u.astFormat,n.locEnd=u.locEnd,n.locStart=u.locStart;let a=(r=o.printers)!=null&&r[u.astFormat]?o:ds(n.plugins,u.astFormat),l=await fs(a,u.astFormat);n.printer=l;let c=a.defaultOptions?Object.fromEntries(Object.entries(a.defaultOptions).filter(([,p])=>p!==void 0)):{},d={...s,...c};for(let[p,f]of Object.entries(d))(n[p]===null||n[p]===void 0)&&(n[p]=f);return n.parser==="json"&&(n.trailingComma="none"),ps(n,i,{passThrough:Object.keys(Ut),...t})}var le=hs,ms=Qr(rn());async function gs(e,t){let r=await gt(t),n=r.preprocess?r.preprocess(e,t):e;t.originalText=n;let i;try{i=await r.parse(n,t,t);}catch(s){Fs(s,e);}return {text:n,ast:i}}function Fs(e,t){let{loc:r}=e;if(r){let n=(0, ms.codeFrameColumns)(t,r,{highlightCode:true});throw e.message+=`
|
|
37
|
-
`+n,e.codeFrame=n,e}throw e}var ge=gs;async function Cs(e,t,r,n,i){let{embeddedLanguageFormatting:s,printer:{embed:o,hasPrettierIgnore:u=()=>false,getVisitorKeys:a}}=r;if(!o||s!=="auto")return;if(o.length>2)throw new Error("printer.embed has too many parameters. The API changed in Prettier v3. Please update your plugin. See https://prettier.io/docs/plugins#optional-embed");let l=Re(o.getVisitorKeys??a),c=[];f();let d=e.stack;for(let{print:D,node:h,pathStack:m}of c)try{e.stack=m;let g=await D(p,t,e,r);g&&i.set(h,g);}catch(g){if(globalThis.PRETTIER_DEBUG)throw g}e.stack=d;function p(D,h){return Es(D,h,r,n)}function f(){let{node:D}=e;if(D===null||typeof D!="object"||u(e))return;for(let m of l(D))Array.isArray(D[m])?e.each(f,m):e.call(f,m);let h=o(e,r);if(h){if(typeof h=="function"){c.push({print:h,node:D,pathStack:[...e.stack]});return}i.set(D,h);}}}async function Es(e,t,r,n){let i=await le({...r,...t,parentParser:r.parser,originalText:e,cursorOffset:void 0,rangeStart:void 0,rangeEnd:void 0},{passThrough:true}),{ast:s}=await ge(e,i),o=await n(s,i);return ir(o)}function ys(e,t){let{originalText:r,[Symbol.for("comments")]:n,locStart:i,locEnd:s,[Symbol.for("printedComments")]:o}=t,{node:u}=e,a=i(u),l=s(u);for(let c of n)i(c)>=a&&s(c)<=l&&o.add(c);return r.slice(a,l)}var vs=ys;async function Ie(e,t){({ast:e}=await Nr(e,t));let r=new Map,n=new Yn(e),s=new Map;await Cs(n,u,t,Ie,s);let o=await Ht(n,t,u,void 0,s);if(Ci(t),t.cursorOffset>=0){if(t.nodeAfterCursor&&!t.nodeBeforeCursor)return [Y,o];if(t.nodeBeforeCursor&&!t.nodeAfterCursor)return [o,Y]}return o;function u(l,c){return l===void 0||l===n?a(c):Array.isArray(l)?n.call(()=>a(c),...l):n.call(()=>a(c),l)}function a(l){let c=n.node;if(c==null)return "";let d=c&&typeof c=="object"&&l===void 0;if(d&&r.has(c))return r.get(c);let p=Ht(n,t,u,l,s);return d&&r.set(c,p),p}}function Ht(e,t,r,n,i){var s;let{node:o}=e,{printer:u}=t,a;switch((s=u.hasPrettierIgnore)!=null&&s.call(u,e)?a=vs(e,t):i.has(o)?a=i.get(o):a=u.print(e,t,r,n),o){case t.cursorNode:a=Ae(a,l=>[Y,l,Y]);break;case t.nodeBeforeCursor:a=Ae(a,l=>[l,Y]);break;case t.nodeAfterCursor:a=Ae(a,l=>[Y,l]);break}return u.printComment&&(!u.willPrintOwnComments||!u.willPrintOwnComments(e,t))&&(a=Fi(e,a,t)),a}async function Nr(e,t){let r=e.comments??[];t[Symbol.for("comments")]=r,t[Symbol.for("printedComments")]=new Set,pi(e,t);let{printer:{preprocess:n}}=t;return e=n?await n(e,t):e,{ast:e,comments:r}}function bs(e,t){let{cursorOffset:r,locStart:n,locEnd:i}=t,s=Re(t.printer.getVisitorKeys),o=f=>n(f)<=r&&i(f)>=r,u=e,a=[e];for(let f of ti(e,{getVisitorKeys:s,filter:o}))a.push(f),u=f;if(ri(u,{getVisitorKeys:s}))return {cursorNode:u};let l,c,d=-1,p=Number.POSITIVE_INFINITY;for(;a.length>0&&(l===void 0||c===void 0);){u=a.pop();let f=l!==void 0,D=c!==void 0;for(let h of We(u,{getVisitorKeys:s})){if(!f){let m=i(h);m<=r&&m>d&&(l=h,d=m);}if(!D){let m=n(h);m>=r&&m<p&&(c=h,p=m);}}}return {nodeBeforeCursor:l,nodeAfterCursor:c}}var Pr=bs;function Ss(e,t){let{printer:{massageAstNode:r,getVisitorKeys:n}}=t;if(!r)return e;let i=Re(n),s=r.ignoredProperties??new Set;return o(e);function o(u,a){if(!(u!==null&&typeof u=="object"))return u;if(Array.isArray(u))return u.map(p=>o(p,a)).filter(Boolean);let l={},c=new Set(i(u));for(let p in u)!Object.prototype.hasOwnProperty.call(u,p)||s.has(p)||(c.has(p)?l[p]=o(u[p],u):l[p]=u[p]);let d=r(u,l,a);if(d!==null)return d??l}}var xs=Ss,ks=(e,t,r)=>{if(!(e&&t==null)){if(t.findLastIndex)return t.findLastIndex(r);for(let n=t.length-1;n>=0;n--){let i=t[n];if(r(i,n,t))return n}return -1}},ws=ks,As=({parser:e})=>e==="json"||e==="json5"||e==="jsonc"||e==="json-stringify";function Bs(e,t){let r=[e.node,...e.parentNodes],n=new Set([t.node,...t.parentNodes]);return r.find(i=>Tr.has(i.type)&&n.has(i))}function
|
|
36
|
+
`,1)[0].length);return i>t&&i>s?n:r}var He=[],jt=[];function Ii(e,t){if(e===t)return 0;let r=e;e.length>t.length&&(e=t,t=r);let n=e.length,i=t.length;for(;n>0&&e.charCodeAt(~-n)===t.charCodeAt(~-i);)n--,i--;let s=0;for(;s<n&&e.charCodeAt(s)===t.charCodeAt(s);)s++;if(n-=s,i-=s,n===0)return i;let o,u,a,l,c=0,d=0;for(;c<n;)jt[c]=e.charCodeAt(s+c),He[c]=++c;for(;d<i;)for(o=t.charCodeAt(s+d),a=d++,u=d,c=0;c<n;c++)l=o===jt[c]?a:a+1,a=He[c],u=He[c]=a>u?l>u?u+1:l:l>a?a+1:l;return u}var wr=(e,t,{descriptor:r,logger:n,schemas:i})=>{let s=[`Ignored unknown option ${N.yellow(r.pair({key:e,value:t}))}.`],o=Object.keys(i).sort().find(u=>Ii(e,u)<3);o&&s.push(`Did you mean ${N.blue(r.key(o))}?`),n.warn(s.join(" "));},ji=["default","expected","validate","deprecated","forward","redirect","overlap","preprocess","postprocess"];function Gi(e,t){let r=new e(t),n=Object.create(r);for(let i of ji)i in t&&(n[i]=_i(t[i],r,H.prototype[i].length));return n}var H=class{static create(e){return Gi(this,e)}constructor(e){this.name=e.name;}default(e){}expected(e){return "nothing"}validate(e,t){return false}deprecated(e,t){return false}forward(e,t){}redirect(e,t){}overlap(e,t,r){return e}preprocess(e,t){return e}postprocess(e,t){return $e}};function _i(e,t,r){return typeof e=="function"?(...n)=>e(...n.slice(0,r-1),t,...n.slice(r-1)):()=>e}var Mi=class extends H{constructor(e){super(e),this._sourceName=e.sourceName;}expected(e){return e.schemas[this._sourceName].expected(e)}validate(e,t){return t.schemas[this._sourceName].validate(e,t)}redirect(e,t){return this._sourceName}},Li=class extends H{expected(){return "anything"}validate(){return true}},zi=class extends H{constructor({valueSchema:e,name:t=e.name,...r}){super({...r,name:t}),this._valueSchema=e;}expected(e){let{text:t,list:r}=e.normalizeExpectedResult(this._valueSchema.expected(e));return {text:t&&`an array of ${t}`,list:r&&{title:"an array of the following values",values:[{list:r}]}}}validate(e,t){if(!Array.isArray(e))return false;let r=[];for(let n of e){let i=t.normalizeValidateResult(this._valueSchema.validate(n,t),n);i!==true&&r.push(i.value);}return r.length===0?true:{value:r}}deprecated(e,t){let r=[];for(let n of e){let i=t.normalizeDeprecatedResult(this._valueSchema.deprecated(n,t),n);i!==false&&r.push(...i.map(({value:s})=>({value:[s]})));}return r}forward(e,t){let r=[];for(let n of e){let i=t.normalizeForwardResult(this._valueSchema.forward(n,t),n);r.push(...i.map(Gt));}return r}redirect(e,t){let r=[],n=[];for(let i of e){let s=t.normalizeRedirectResult(this._valueSchema.redirect(i,t),i);"remain"in s&&r.push(s.remain),n.push(...s.redirect.map(Gt));}return r.length===0?{redirect:n}:{redirect:n,remain:r}}overlap(e,t){return e.concat(t)}};function Gt({from:e,to:t}){return {from:[e],to:t}}var Ji=class extends H{expected(){return "true or false"}validate(e){return typeof e=="boolean"}};function qi(e,t){let r=Object.create(null);for(let n of e){let i=n[t];if(r[i])throw new Error(`Duplicate ${t} ${JSON.stringify(i)}`);r[i]=n;}return r}function Ui(e,t){let r=new Map;for(let n of e){let i=n[t];if(r.has(i))throw new Error(`Duplicate ${t} ${JSON.stringify(i)}`);r.set(i,n);}return r}function Hi(){let e=Object.create(null);return t=>{let r=JSON.stringify(t);return e[r]?true:(e[r]=true,false)}}function Zi(e,t){let r=[],n=[];for(let i of e)t(i)?r.push(i):n.push(i);return [r,n]}function Ki(e){return e===Math.floor(e)}function Xi(e,t){if(e===t)return 0;let r=typeof e,n=typeof t,i=["undefined","object","boolean","number","string"];return r!==n?i.indexOf(r)-i.indexOf(n):r!=="string"?Number(e)-Number(t):e.localeCompare(t)}function Yi(e){return (...t)=>{let r=e(...t);return typeof r=="string"?new Error(r):r}}function _t(e){return e===void 0?{}:e}function Ar(e){if(typeof e=="string")return {text:e};let{text:t,list:r}=e;return Qi((t||r)!==void 0,"Unexpected `expected` result, there should be at least one field."),r?{text:t,list:{title:r.title,values:r.values.map(Ar)}}:{text:t}}function Mt(e,t){return e===true?true:e===false?{value:t}:e}function Lt(e,t,r=false){return e===false?false:e===true?r?true:[{value:t}]:"value"in e?[e]:e.length===0?false:e}function zt(e,t){return typeof e=="string"||"key"in e?{from:t,to:e}:"from"in e?{from:e.from,to:e.to}:{from:t,to:e.to}}function nt(e,t){return e===void 0?[]:Array.isArray(e)?e.map(r=>zt(r,t)):[zt(e,t)]}function Jt(e,t){let r=nt(typeof e=="object"&&"redirect"in e?e.redirect:e,t);return r.length===0?{remain:t,redirect:r}:typeof e=="object"&&"remain"in e?{remain:e.remain,redirect:r}:{redirect:r}}function Qi(e,t){if(!e)throw new Error(t)}var es=class extends H{constructor(e){super(e),this._choices=Ui(e.choices.map(t=>t&&typeof t=="object"?t:{value:t}),"value");}expected({descriptor:e}){let t=Array.from(this._choices.keys()).map(i=>this._choices.get(i)).filter(({hidden:i})=>!i).map(i=>i.value).sort(Xi).map(e.value),r=t.slice(0,-2),n=t.slice(-2);return {text:r.concat(n.join(" or ")).join(", "),list:{title:"one of the following values",values:t}}}validate(e){return this._choices.has(e)}deprecated(e){let t=this._choices.get(e);return t&&t.deprecated?{value:e}:false}forward(e){let t=this._choices.get(e);return t?t.forward:void 0}redirect(e){let t=this._choices.get(e);return t?t.redirect:void 0}},ts=class extends H{expected(){return "a number"}validate(e,t){return typeof e=="number"}},rs=class extends ts{expected(){return "an integer"}validate(e,t){return t.normalizeValidateResult(super.validate(e,t),e)===true&&Ki(e)}},qt=class extends H{expected(){return "a string"}validate(e){return typeof e=="string"}},ns=oe,is=wr,ss=Ri,os=Wi,us=class{constructor(e,t){let{logger:r=console,loggerPrintWidth:n=80,descriptor:i=ns,unknown:s=is,invalid:o=ss,deprecated:u=os,missing:a=()=>false,required:l=()=>false,preprocess:c=p=>p,postprocess:d=()=>$e}=t||{};this._utils={descriptor:i,logger:r||{warn:()=>{}},loggerPrintWidth:n,schemas:qi(e,"name"),normalizeDefaultResult:_t,normalizeExpectedResult:Ar,normalizeDeprecatedResult:Lt,normalizeForwardResult:nt,normalizeRedirectResult:Jt,normalizeValidateResult:Mt},this._unknownHandler=s,this._invalidHandler=Yi(o),this._deprecatedHandler=u,this._identifyMissing=(p,f)=>!(p in f)||a(p,f),this._identifyRequired=l,this._preprocess=c,this._postprocess=d,this.cleanHistory();}cleanHistory(){this._hasDeprecationWarned=Hi();}normalize(e){let t={},r=[this._preprocess(e,this._utils)],n=()=>{for(;r.length!==0;){let i=r.shift(),s=this._applyNormalization(i,t);r.push(...s);}};n();for(let i of Object.keys(this._utils.schemas)){let s=this._utils.schemas[i];if(!(i in t)){let o=_t(s.default(this._utils));"value"in o&&r.push({[i]:o.value});}}n();for(let i of Object.keys(this._utils.schemas)){if(!(i in t))continue;let s=this._utils.schemas[i],o=t[i],u=s.postprocess(o,this._utils);u!==$e&&(this._applyValidation(u,i,s),t[i]=u);}return this._applyPostprocess(t),this._applyRequiredCheck(t),t}_applyNormalization(e,t){let r=[],{knownKeys:n,unknownKeys:i}=this._partitionOptionKeys(e);for(let s of n){let o=this._utils.schemas[s],u=o.preprocess(e[s],this._utils);this._applyValidation(u,s,o);let a=({from:d,to:p})=>{r.push(typeof p=="string"?{[p]:d}:{[p.key]:p.value});},l=({value:d,redirectTo:p})=>{let f=Lt(o.deprecated(d,this._utils),u,true);if(f!==false)if(f===true)this._hasDeprecationWarned(s)||this._utils.logger.warn(this._deprecatedHandler(s,p,this._utils));else for(let{value:D}of f){let h={key:s,value:D};if(!this._hasDeprecationWarned(h)){let m=typeof p=="string"?{key:p,value:D}:p;this._utils.logger.warn(this._deprecatedHandler(h,m,this._utils));}}};nt(o.forward(u,this._utils),u).forEach(a);let c=Jt(o.redirect(u,this._utils),u);if(c.redirect.forEach(a),"remain"in c){let d=c.remain;t[s]=s in t?o.overlap(t[s],d,this._utils):d,l({value:d});}for(let{from:d,to:p}of c.redirect)l({value:d,redirectTo:p});}for(let s of i){let o=e[s];this._applyUnknownHandler(s,o,t,(u,a)=>{r.push({[u]:a});});}return r}_applyRequiredCheck(e){for(let t of Object.keys(this._utils.schemas))if(this._identifyMissing(t,e)&&this._identifyRequired(t))throw this._invalidHandler(t,Sr,this._utils)}_partitionOptionKeys(e){let[t,r]=Zi(Object.keys(e).filter(n=>!this._identifyMissing(n,e)),n=>n in this._utils.schemas);return {knownKeys:t,unknownKeys:r}}_applyValidation(e,t,r){let n=Mt(r.validate(e,this._utils),e);if(n!==true)throw this._invalidHandler(t,n.value,this._utils)}_applyUnknownHandler(e,t,r,n){let i=this._unknownHandler(e,t,this._utils);if(i)for(let s of Object.keys(i)){if(this._identifyMissing(s,i))continue;let o=i[s];s in this._utils.schemas?n(s,o):r[s]=o;}}_applyPostprocess(e){let t=this._postprocess(e,this._utils);if(t!==$e){if(t.delete)for(let r of t.delete)delete e[r];if(t.override){let{knownKeys:r,unknownKeys:n}=this._partitionOptionKeys(t.override);for(let i of r){let s=t.override[i];this._applyValidation(s,i,this._utils.schemas[i]),e[i]=s;}for(let i of n){let s=t.override[i];this._applyUnknownHandler(i,s,e,(o,u)=>{let a=this._utils.schemas[o];this._applyValidation(u,o,a),e[o]=u;});}}}}},Ze;function as(e,t,{logger:r=false,isCLI:n=false,passThrough:i=false,FlagSchema:s,descriptor:o}={}){if(n){if(!s)throw new Error("'FlagSchema' option is required.");if(!o)throw new Error("'descriptor' option is required.")}else o=oe;let u=i?Array.isArray(i)?(p,f)=>i.includes(p)?{[p]:f}:void 0:(p,f)=>({[p]:f}):(p,f,D)=>{let{_:h,...m}=D.schemas;return wr(p,f,{...D,schemas:m})},a=ls(t,{isCLI:n,FlagSchema:s}),l=new us(a,{logger:r,unknown:u,descriptor:o}),c=r!==false;c&&Ze&&(l._hasDeprecationWarned=Ze);let d=l.normalize(e);return c&&(Ze=l._hasDeprecationWarned),d}function ls(e,{isCLI:t,FlagSchema:r}){let n=[];t&&n.push(Li.create({name:"_"}));for(let i of e)n.push(cs(i,{isCLI:t,optionInfos:e,FlagSchema:r})),i.alias&&t&&n.push(Mi.create({name:i.alias,sourceName:i.name}));return n}function cs(e,{isCLI:t,optionInfos:r,FlagSchema:n}){let{name:i}=e,s={name:i},o,u={};switch(e.type){case "int":o=rs,t&&(s.preprocess=Number);break;case "string":o=qt;break;case "choice":o=es,s.choices=e.choices.map(a=>a!=null&&a.redirect?{...a,redirect:{to:{key:e.name,value:a.redirect}}}:a);break;case "boolean":o=Ji;break;case "flag":o=n,s.flags=r.flatMap(a=>[a.alias,a.description&&a.name,a.oppositeDescription&&`no-${a.name}`].filter(Boolean));break;case "path":o=qt;break;default:throw new Error(`Unexpected type ${e.type}`)}if(e.exception?s.validate=(a,l,c)=>e.exception(a)||l.validate(a,c):s.validate=(a,l,c)=>a===void 0||l.validate(a,c),e.redirect&&(u.redirect=a=>a?{to:typeof e.redirect=="string"?e.redirect:{key:e.redirect.option,value:e.redirect.value}}:void 0),e.deprecated&&(u.deprecated=true),t&&!e.array){let a=s.preprocess||(l=>l);s.preprocess=(l,c,d)=>c.preprocess(a(Array.isArray(l)?x(false,l,-1):l),d);}return e.array?zi.create({...t?{preprocess:a=>Array.isArray(a)?a:[a]}:{},...u,valueSchema:o.create(s)}):o.create({...s,...u})}var ps=as,Ds=(e,t,r)=>{if(!(e&&t==null)){if(t.findLast)return t.findLast(r);for(let n=t.length-1;n>=0;n--){let i=t[n];if(r(i,n,t))return i}}},Br=Ds;function $r(e,t){if(!t)throw new Error("parserName is required.");let r=Br(false,e,i=>i.parsers&&Object.prototype.hasOwnProperty.call(i.parsers,t));if(r)return r;let n=`Couldn't resolve parser "${t}".`;throw n+=" Plugins must be explicitly added to the standalone bundle.",new Er(n)}function ds(e,t){if(!t)throw new Error("astFormat is required.");let r=Br(false,e,i=>i.printers&&Object.prototype.hasOwnProperty.call(i.printers,t));if(r)return r;let n=`Couldn't find plugin for AST format "${t}".`;throw n+=" Plugins must be explicitly added to the standalone bundle.",new Er(n)}function gt({plugins:e,parser:t}){let r=$r(e,t);return Or(r,t)}function Or(e,t){let r=e.parsers[t];return typeof r=="function"?r():r}function fs(e,t){let r=e.printers[t];return typeof r=="function"?r():r}var Ut={astFormat:"estree",printer:{},originalText:void 0,locStart:null,locEnd:null};async function hs(e,t={}){var r;let n={...e};if(!n.parser)if(n.filepath){if(n.parser=Vi(n,{physicalFile:n.filepath}),!n.parser)throw new Bt(`No parser could be inferred for file "${n.filepath}".`)}else throw new Bt("No parser and no file path given, couldn't infer a parser.");let i=yr({plugins:e.plugins,showDeprecated:true}).options,s={...Ut,...Object.fromEntries(i.filter(p=>p.default!==void 0).map(p=>[p.name,p.default]))},o=$r(n.plugins,n.parser),u=await Or(o,n.parser);n.astFormat=u.astFormat,n.locEnd=u.locEnd,n.locStart=u.locStart;let a=(r=o.printers)!=null&&r[u.astFormat]?o:ds(n.plugins,u.astFormat),l=await fs(a,u.astFormat);n.printer=l;let c=a.defaultOptions?Object.fromEntries(Object.entries(a.defaultOptions).filter(([,p])=>p!==void 0)):{},d={...s,...c};for(let[p,f]of Object.entries(d))(n[p]===null||n[p]===void 0)&&(n[p]=f);return n.parser==="json"&&(n.trailingComma="none"),ps(n,i,{passThrough:Object.keys(Ut),...t})}var le=hs,ms=Qr(rn());async function gs(e,t){let r=await gt(t),n=r.preprocess?r.preprocess(e,t):e;t.originalText=n;let i;try{i=await r.parse(n,t,t);}catch(s){Fs(s,e);}return {text:n,ast:i}}function Fs(e,t){let{loc:r}=e;if(r){let n=(0, ms.codeFrameColumns)(t,r,{highlightCode:true});throw e.message+=`
|
|
37
|
+
`+n,e.codeFrame=n,e}throw e}var ge=gs;async function Cs(e,t,r,n,i){let{embeddedLanguageFormatting:s,printer:{embed:o,hasPrettierIgnore:u=()=>false,getVisitorKeys:a}}=r;if(!o||s!=="auto")return;if(o.length>2)throw new Error("printer.embed has too many parameters. The API changed in Prettier v3. Please update your plugin. See https://prettier.io/docs/plugins#optional-embed");let l=Re(o.getVisitorKeys??a),c=[];f();let d=e.stack;for(let{print:D,node:h,pathStack:m}of c)try{e.stack=m;let g=await D(p,t,e,r);g&&i.set(h,g);}catch(g){if(globalThis.PRETTIER_DEBUG)throw g}e.stack=d;function p(D,h){return Es(D,h,r,n)}function f(){let{node:D}=e;if(D===null||typeof D!="object"||u(e))return;for(let m of l(D))Array.isArray(D[m])?e.each(f,m):e.call(f,m);let h=o(e,r);if(h){if(typeof h=="function"){c.push({print:h,node:D,pathStack:[...e.stack]});return}i.set(D,h);}}}async function Es(e,t,r,n){let i=await le({...r,...t,parentParser:r.parser,originalText:e,cursorOffset:void 0,rangeStart:void 0,rangeEnd:void 0},{passThrough:true}),{ast:s}=await ge(e,i),o=await n(s,i);return ir(o)}function ys(e,t){let{originalText:r,[Symbol.for("comments")]:n,locStart:i,locEnd:s,[Symbol.for("printedComments")]:o}=t,{node:u}=e,a=i(u),l=s(u);for(let c of n)i(c)>=a&&s(c)<=l&&o.add(c);return r.slice(a,l)}var vs=ys;async function Ie(e,t){({ast:e}=await Nr(e,t));let r=new Map,n=new Yn(e),s=new Map;await Cs(n,u,t,Ie,s);let o=await Ht(n,t,u,void 0,s);if(Ci(t),t.cursorOffset>=0){if(t.nodeAfterCursor&&!t.nodeBeforeCursor)return [Y,o];if(t.nodeBeforeCursor&&!t.nodeAfterCursor)return [o,Y]}return o;function u(l,c){return l===void 0||l===n?a(c):Array.isArray(l)?n.call(()=>a(c),...l):n.call(()=>a(c),l)}function a(l){let c=n.node;if(c==null)return "";let d=c&&typeof c=="object"&&l===void 0;if(d&&r.has(c))return r.get(c);let p=Ht(n,t,u,l,s);return d&&r.set(c,p),p}}function Ht(e,t,r,n,i){var s;let{node:o}=e,{printer:u}=t,a;switch((s=u.hasPrettierIgnore)!=null&&s.call(u,e)?a=vs(e,t):i.has(o)?a=i.get(o):a=u.print(e,t,r,n),o){case t.cursorNode:a=Ae(a,l=>[Y,l,Y]);break;case t.nodeBeforeCursor:a=Ae(a,l=>[l,Y]);break;case t.nodeAfterCursor:a=Ae(a,l=>[Y,l]);break}return u.printComment&&(!u.willPrintOwnComments||!u.willPrintOwnComments(e,t))&&(a=Fi(e,a,t)),a}async function Nr(e,t){let r=e.comments??[];t[Symbol.for("comments")]=r,t[Symbol.for("printedComments")]=new Set,pi(e,t);let{printer:{preprocess:n}}=t;return e=n?await n(e,t):e,{ast:e,comments:r}}function bs(e,t){let{cursorOffset:r,locStart:n,locEnd:i}=t,s=Re(t.printer.getVisitorKeys),o=f=>n(f)<=r&&i(f)>=r,u=e,a=[e];for(let f of ti(e,{getVisitorKeys:s,filter:o}))a.push(f),u=f;if(ri(u,{getVisitorKeys:s}))return {cursorNode:u};let l,c,d=-1,p=Number.POSITIVE_INFINITY;for(;a.length>0&&(l===void 0||c===void 0);){u=a.pop();let f=l!==void 0,D=c!==void 0;for(let h of We(u,{getVisitorKeys:s})){if(!f){let m=i(h);m<=r&&m>d&&(l=h,d=m);}if(!D){let m=n(h);m>=r&&m<p&&(c=h,p=m);}}}return {nodeBeforeCursor:l,nodeAfterCursor:c}}var Pr=bs;function Ss(e,t){let{printer:{massageAstNode:r,getVisitorKeys:n}}=t;if(!r)return e;let i=Re(n),s=r.ignoredProperties??new Set;return o(e);function o(u,a){if(!(u!==null&&typeof u=="object"))return u;if(Array.isArray(u))return u.map(p=>o(p,a)).filter(Boolean);let l={},c=new Set(i(u));for(let p in u)!Object.prototype.hasOwnProperty.call(u,p)||s.has(p)||(c.has(p)?l[p]=o(u[p],u):l[p]=u[p]);let d=r(u,l,a);if(d!==null)return d??l}}var xs=Ss,ks=(e,t,r)=>{if(!(e&&t==null)){if(t.findLastIndex)return t.findLastIndex(r);for(let n=t.length-1;n>=0;n--){let i=t[n];if(r(i,n,t))return n}return -1}},ws=ks,As=({parser:e})=>e==="json"||e==="json5"||e==="jsonc"||e==="json-stringify";function Bs(e,t){let r=[e.node,...e.parentNodes],n=new Set([t.node,...t.parentNodes]);return r.find(i=>Tr.has(i.type)&&n.has(i))}function Zt(e){let t=ws(false,e,r=>r.type!=="Program"&&r.type!=="File");return t===-1?e:e.slice(0,t+1)}function $s(e,t,{locStart:r,locEnd:n}){let i=e.node,s=t.node;if(i===s)return {startNode:i,endNode:s};let o=r(e.node);for(let a of Zt(t.parentNodes))if(r(a)>=o)s=a;else break;let u=n(t.node);for(let a of Zt(e.parentNodes)){if(n(a)<=u)i=a;else break;if(i===s)break}return {startNode:i,endNode:s}}function it(e,t,r,n,i=[],s){let{locStart:o,locEnd:u}=r,a=o(e),l=u(e);if(!(t>l||t<a||s==="rangeEnd"&&t===a||s==="rangeStart"&&t===l)){for(let c of ht(e,r)){let d=it(c,t,r,n,[e,...i],s);if(d)return d}if(!n||n(e,i[0]))return {node:e,parentNodes:i}}}function Os(e,t){return t!=="DeclareExportDeclaration"&&e!=="TypeParameterDeclaration"&&(e==="Directive"||e==="TypeAlias"||e==="TSExportAssignment"||e.startsWith("Declare")||e.startsWith("TSDeclare")||e.endsWith("Statement")||e.endsWith("Declaration"))}var Tr=new Set(["JsonRoot","ObjectExpression","ArrayExpression","StringLiteral","NumericLiteral","BooleanLiteral","NullLiteral","UnaryExpression","TemplateLiteral"]),Ns=new Set(["OperationDefinition","FragmentDefinition","VariableDefinition","TypeExtensionDefinition","ObjectTypeDefinition","FieldDefinition","DirectiveDefinition","EnumTypeDefinition","EnumValueDefinition","InputValueDefinition","InputObjectTypeDefinition","SchemaDefinition","OperationTypeDefinition","InterfaceTypeDefinition","UnionTypeDefinition","ScalarTypeDefinition"]);function Kt(e,t,r){if(!t)return false;switch(e.parser){case "flow":case "hermes":case "babel":case "babel-flow":case "babel-ts":case "typescript":case "acorn":case "espree":case "meriyah":case "oxc":case "oxc-ts":case "__babel_estree":return Os(t.type,r?.type);case "json":case "json5":case "jsonc":case "json-stringify":return Tr.has(t.type);case "graphql":return Ns.has(t.kind);case "vue":return t.tag!=="root"}return false}function Ps(e,t,r){let{rangeStart:n,rangeEnd:i,locStart:s,locEnd:o}=t;rt.ok(i>n);let u=e.slice(n,i).search(/\S/u),a=u===-1;if(!a)for(n+=u;i>n&&!/\S/u.test(e[i-1]);--i);let l=it(r,n,t,(f,D)=>Kt(t,f,D),[],"rangeStart"),c=a?l:it(r,i,t,f=>Kt(t,f),[],"rangeEnd");if(!l||!c)return {rangeStart:0,rangeEnd:0};let d,p;if(As(t)){let f=Bs(l,c);d=f,p=f;}else ({startNode:d,endNode:p}=$s(l,c,t));return {rangeStart:Math.min(s(d),s(p)),rangeEnd:Math.max(o(d),o(p))}}var Vr="\uFEFF",Xt=Symbol("cursor");async function Wr(e,t,r=0){if(!e||e.trim().length===0)return {formatted:"",cursorOffset:-1,comments:[]};let{ast:n,text:i}=await ge(e,t);t.cursorOffset>=0&&(t={...t,...Pr(n,t)});let s=await Ie(n,t);r>0&&(s=pr([Q,s],r,t.tabWidth));let o=Ve(s,t);if(r>0){let a=o.formatted.trim();o.cursorNodeStart!==void 0&&(o.cursorNodeStart-=o.formatted.indexOf(a),o.cursorNodeStart<0&&(o.cursorNodeStart=0,o.cursorNodeText=o.cursorNodeText.trimStart()),o.cursorNodeStart+o.cursorNodeText.length>a.length&&(o.cursorNodeText=o.cursorNodeText.trimEnd())),o.formatted=a+ut(t.endOfLine);}let u=t[Symbol.for("comments")];if(t.cursorOffset>=0){let a,l,c,d;if((t.cursorNode||t.nodeBeforeCursor||t.nodeAfterCursor)&&o.cursorNodeText)if(c=o.cursorNodeStart,d=o.cursorNodeText,t.cursorNode)a=t.locStart(t.cursorNode),l=i.slice(a,t.locEnd(t.cursorNode));else {if(!t.nodeBeforeCursor&&!t.nodeAfterCursor)throw new Error("Cursor location must contain at least one of cursorNode, nodeBeforeCursor, nodeAfterCursor");a=t.nodeBeforeCursor?t.locEnd(t.nodeBeforeCursor):0;let g=t.nodeAfterCursor?t.locStart(t.nodeAfterCursor):i.length;l=i.slice(a,g);}else a=0,l=i,c=0,d=o.formatted;let p=t.cursorOffset-a;if(l===d)return {formatted:o.formatted,cursorOffset:c+p,comments:u};let f=l.split("");f.splice(p,0,Xt);let D=d.split(""),h=ln(f,D),m=c;for(let g of h)if(g.removed){if(g.value.includes(Xt))break}else m+=g.count;return {formatted:o.formatted,cursorOffset:m,comments:u}}return {formatted:o.formatted,cursorOffset:-1,comments:u}}async function Ts(e,t){let{ast:r,text:n}=await ge(e,t),{rangeStart:i,rangeEnd:s}=Ps(n,t,r),o=n.slice(i,s),u=Math.min(i,n.lastIndexOf(`
|
|
38
38
|
`,i)+1),a=n.slice(u,i).match(/^\s*/u)[0],l=dt(a,t.tabWidth),c=await Wr(o,{...t,rangeStart:0,rangeEnd:Number.POSITIVE_INFINITY,cursorOffset:t.cursorOffset>i&&t.cursorOffset<=s?t.cursorOffset-i:-1,endOfLine:"lf"},l),d=c.formatted.trimEnd(),{cursorOffset:p}=t;p>s?p+=d.length-o.length:c.cursorOffset>=0&&(p=c.cursorOffset+i);let f=n.slice(0,i)+d+n.slice(s);if(t.endOfLine!=="lf"){let D=ut(t.endOfLine);p>=0&&D===`\r
|
|
39
39
|
`&&(p+=rr(f.slice(0,p),`
|
|
40
40
|
`)),f=Ne(false,f,`
|
|
41
|
-
`,D);}return {formatted:f,cursorOffset:p,comments:c.comments}}function
|
|
42
|
-
`);r-=u(r),n-=u(n),i-=u(i),e=pn(e);}return {hasBOM:o,text:e,options:Yt(e,{...t,cursorOffset:r,rangeStart:n,rangeEnd:i,endOfLine:s})}}async function Qt(e,t){let r=await gt(t);return !r.hasPragma||r.hasPragma(e)}async function Vs(e,t){var r;let n=await gt(t);return (r=n.hasIgnorePragma)==null?void 0:r.call(n,e)}async function Ir(e,t){let{hasBOM:r,text:n,options:i}=Rr(e,await le(t));if(i.rangeStart>=i.rangeEnd&&n!==""||i.requirePragma&&!await Qt(n,i)||i.checkIgnorePragma&&await Vs(n,i))return {formatted:e,cursorOffset:t.cursorOffset,comments:[]};let s;return i.rangeStart>0||i.rangeEnd<n.length?s=await Ts(n,i):(!i.requirePragma&&i.insertPragma&&i.printer.insertPragma&&!await Qt(n,i)&&(n=i.printer.insertPragma(n)),s=await Wr(n,i)),r&&(s.formatted=Vr+s.formatted,s.cursorOffset>=0&&s.cursorOffset++),s}async function Ws(e,t,r){let{text:n,options:i}=Rr(e,await le(t)),s=await ge(n,i);return r&&(r.preprocessForPrint&&(s.ast=await Nr(s.ast,i)),r.massage&&(s.ast=xs(s.ast,i))),s}async function Rs(e,t){t=await le(t);let r=await Ie(e,t);return Ve(r,t)}async function Is(e,t){let r=_n(e),{formatted:n}=await Ir(r,{...t,parser:"__js_expression"});return n}async function js(e,t){t=await le(t);let{ast:r}=await ge(e,t);return t.cursorOffset>=0&&(t={...t,...Pr(r,t)}),Ie(r,t)}async function Gs(e,t){return Ve(e,await le(t))}var jr={};ot(jr,{builders:()=>_s,printer:()=>Ms,utils:()=>Ls});var _s={join:cr,line:ar,softline:jn,hardline:Q,literalline:lr,group:or,conditionalGroup:Pn,fill:Tn,lineSuffix:Xe,lineSuffixBoundary:Rn,cursor:Y,breakParent:Te,ifBreak:Vn,trim:In,indent:Oe,indentIfBreak:Wn,align:ae,addAlignmentToDoc:pr,markAsRoot:On,dedentToRoot:$n,dedent:Nn,hardlineWithoutBreakParent:pt,literallineWithoutBreakParent:ur,label:Gn,concat:e=>e},Ms={printDocToString:Ve},Ls={willBreak:En,traverseDoc:at,findInDoc:lt,mapDoc:Pe,removeLines:bn,stripTrailingHardline:ir,replaceEndOfLine:kn,canBreak:An},zs="3.6.2",Gr={};ot(Gr,{addDanglingComment:()=>
|
|
43
|
-
`);return r===-1?0:dt(e.slice(r+1).match(/^[\t ]*/u)[0],t)}var Zs
|
|
41
|
+
`,D);}return {formatted:f,cursorOffset:p,comments:c.comments}}function Ke(e,t,r){return typeof t!="number"||Number.isNaN(t)||t<0||t>e.length?r:t}function Yt(e,t){let{cursorOffset:r,rangeStart:n,rangeEnd:i}=t;return r=Ke(e,r,-1),n=Ke(e,n,0),i=Ke(e,i,e.length),{...t,cursorOffset:r,rangeStart:n,rangeEnd:i}}function Rr(e,t){let{cursorOffset:r,rangeStart:n,rangeEnd:i,endOfLine:s}=Yt(e,t),o=e.charAt(0)===Vr;if(o&&(e=e.slice(1),r--,n--,i--),s==="auto"&&(s=cn(e)),e.includes("\r")){let u=a=>rr(e.slice(0,Math.max(a,0)),`\r
|
|
42
|
+
`);r-=u(r),n-=u(n),i-=u(i),e=pn(e);}return {hasBOM:o,text:e,options:Yt(e,{...t,cursorOffset:r,rangeStart:n,rangeEnd:i,endOfLine:s})}}async function Qt(e,t){let r=await gt(t);return !r.hasPragma||r.hasPragma(e)}async function Vs(e,t){var r;let n=await gt(t);return (r=n.hasIgnorePragma)==null?void 0:r.call(n,e)}async function Ir(e,t){let{hasBOM:r,text:n,options:i}=Rr(e,await le(t));if(i.rangeStart>=i.rangeEnd&&n!==""||i.requirePragma&&!await Qt(n,i)||i.checkIgnorePragma&&await Vs(n,i))return {formatted:e,cursorOffset:t.cursorOffset,comments:[]};let s;return i.rangeStart>0||i.rangeEnd<n.length?s=await Ts(n,i):(!i.requirePragma&&i.insertPragma&&i.printer.insertPragma&&!await Qt(n,i)&&(n=i.printer.insertPragma(n)),s=await Wr(n,i)),r&&(s.formatted=Vr+s.formatted,s.cursorOffset>=0&&s.cursorOffset++),s}async function Ws(e,t,r){let{text:n,options:i}=Rr(e,await le(t)),s=await ge(n,i);return r&&(r.preprocessForPrint&&(s.ast=await Nr(s.ast,i)),r.massage&&(s.ast=xs(s.ast,i))),s}async function Rs(e,t){t=await le(t);let r=await Ie(e,t);return Ve(r,t)}async function Is(e,t){let r=_n(e),{formatted:n}=await Ir(r,{...t,parser:"__js_expression"});return n}async function js(e,t){t=await le(t);let{ast:r}=await ge(e,t);return t.cursorOffset>=0&&(t={...t,...Pr(r,t)}),Ie(r,t)}async function Gs(e,t){return Ve(e,await le(t))}var jr={};ot(jr,{builders:()=>_s,printer:()=>Ms,utils:()=>Ls});var _s={join:cr,line:ar,softline:jn,hardline:Q,literalline:lr,group:or,conditionalGroup:Pn,fill:Tn,lineSuffix:Xe,lineSuffixBoundary:Rn,cursor:Y,breakParent:Te,ifBreak:Vn,trim:In,indent:Oe,indentIfBreak:Wn,align:ae,addAlignmentToDoc:pr,markAsRoot:On,dedentToRoot:$n,dedent:Nn,hardlineWithoutBreakParent:pt,literallineWithoutBreakParent:ur,label:Gn,concat:e=>e},Ms={printDocToString:Ve},Ls={willBreak:En,traverseDoc:at,findInDoc:lt,mapDoc:Pe,removeLines:bn,stripTrailingHardline:ir,replaceEndOfLine:kn,canBreak:An},zs="3.6.2",Gr={};ot(Gr,{addDanglingComment:()=>K,addLeadingComment:()=>fe,addTrailingComment:()=>he,getAlignmentSize:()=>dt,getIndentSize:()=>Ks,getMaxContinuousCount:()=>Qs,getNextNonSpaceNonCommentCharacter:()=>to,getNextNonSpaceNonCommentCharacterIndex:()=>po,getPreferredQuote:()=>no,getStringWidth:()=>Dt,hasNewline:()=>J,hasNewlineInRange:()=>so,hasSpaces:()=>uo,isNextLineEmpty:()=>mo,isNextLineEmptyAfterIndex:()=>yt,isPreviousLineEmpty:()=>fo,makeString:()=>lo,skip:()=>me,skipEverythingButNewLine:()=>hr,skipInlineComment:()=>Ft,skipNewline:()=>ee,skipSpaces:()=>q,skipToLineEnd:()=>fr,skipTrailingComment:()=>Ct,skipWhitespace:()=>ni});function Js(e,t){if(t===false)return false;if(e.charAt(t)==="/"&&e.charAt(t+1)==="*"){for(let r=t+2;r<e.length;++r)if(e.charAt(r)==="*"&&e.charAt(r+1)==="/")return r+2}return t}var Ft=Js;function qs(e,t){return t===false?false:e.charAt(t)==="/"&&e.charAt(t+1)==="/"?hr(e,t):t}var Ct=qs;function Us(e,t){let r=null,n=t;for(;n!==r;)r=n,n=q(e,n),n=Ft(e,n),n=Ct(e,n),n=ee(e,n);return n}var Et=Us;function Hs(e,t){let r=null,n=t;for(;n!==r;)r=n,n=fr(e,n),n=Ft(e,n),n=q(e,n);return n=Ct(e,n),n=ee(e,n),n!==false&&J(e,n)}var yt=Hs;function Zs(e,t){let r=e.lastIndexOf(`
|
|
43
|
+
`);return r===-1?0:dt(e.slice(r+1).match(/^[\t ]*/u)[0],t)}var Ks=Zs;function Xs(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Ys(e,t){let r=e.match(new RegExp(`(${Xs(t)})+`,"gu"));return r===null?0:r.reduce((n,i)=>Math.max(n,i.length/t.length),0)}var Qs=Ys;function eo(e,t){let r=Et(e,t);return r===false?"":e.charAt(r)}var to=eo,we="'",er='"';function ro(e,t){let r=t===true||t===we?we:er,n=r===we?er:we,i=0,s=0;for(let o of e)o===r?i++:o===n&&s++;return i>s?n:r}var no=ro;function io(e,t,r){for(let n=t;n<r;++n)if(e.charAt(n)===`
|
|
44
44
|
`)return true;return false}var so=io;function oo(e,t,r={}){return q(e,r.backwards?t-1:t,r)!==t}var uo=oo;function ao(e,t,r){let n=t==='"'?"'":'"',i=Ne(false,e,/\\(.)|(["'])/gsu,(s,o,u)=>o===n?o:u===t?"\\"+u:u||(r&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(o)?o:"\\"+o));return t+i+t}var lo=ao;function co(e,t,r){return Et(e,r(t))}function po(e,t){return arguments.length===2||typeof t=="number"?Et(e,t):co(...arguments)}function Do(e,t,r){return mt(e,r(t))}function fo(e,t){return arguments.length===2||typeof t=="number"?mt(e,t):Do(...arguments)}function ho(e,t,r){return yt(e,r(t))}function mo(e,t){return arguments.length===2||typeof t=="number"?yt(e,t):ho(...arguments)}function X(e,t=1){return async(...r)=>{let n=r[t]??{},i=n.plugins??[];return r[t]={...n,plugins:Array.isArray(i)?i:Object.values(i)},e(...r)}}var _r=X(Ir);async function ce(e,t){let{formatted:r}=await _r(e,{...t,cursorOffset:-1});return r}async function go(e,t){return await ce(e,t)===e}var Fo=X(yr,0),Co={parse:X(Ws),formatAST:X(Rs),formatDoc:X(Is),printToDoc:X(js),printDocToString:X(Gs)};var je=class extends ie{constructor(r={}){super(r);b(this,"reactOptions");this.reactOptions={...this.options,memo:r.memo??true,forwardRef:r.forwardRef??true,propTypes:r.propTypes??false,defaultProps:r.defaultProps??false,namedExport:r.namedExport??false};}async generate(r){let n=this.getComponentName(),{colorMappings:i,strokeWidthMappings:s,metadata:o}=r,u=this.generateImports(),a=this.generateInterfaces(i,s,o.features),l=this.generateComponent(r),c=this.generateExports(n),d=[u,a,l,c].filter(Boolean).join(`
|
|
45
45
|
|
|
46
46
|
`),p=this.reactOptions.typescript?"tsx":"jsx",f=this.generateFilename(n,p),D;try{D=await ce(d,{parser:p==="tsx"?"typescript":"babel",semi:!0,singleQuote:!0,trailingComma:"es5",tabWidth:2,printWidth:80,bracketSpacing:!0,arrowParens:"avoid"});}catch(h){console.warn("Prettier formatting failed, using unformatted code:",h),D=d;}return {code:D,filename:f,componentName:n,dependencies:this.getDependencies()}}generateImports(){let r=[];if(this.reactOptions.typescript){let n=[];this.reactOptions.forwardRef&&(n.push("Ref"),n.push("forwardRef")),this.reactOptions.memo&&n.push("memo"),n.length>0?r.push(`import React, { ${n.join(", ")} } from 'react';`):r.push("import React from 'react';");}else {let n=[];this.reactOptions.forwardRef&&n.push("forwardRef"),this.reactOptions.memo&&n.push("memo"),n.length>0?r.push(`import React, { ${n.join(", ")} } from 'react';`):r.push("import React from 'react';"),this.reactOptions.propTypes&&r.push("import PropTypes from 'prop-types';");}return r.join(`
|
package/dist/cli.js
CHANGED
|
@@ -81496,6 +81496,9 @@ var pascalCase = (str) => {
|
|
|
81496
81496
|
if (word.length <= 3 && word === word.toUpperCase() && /^[A-Z]+$/.test(word)) {
|
|
81497
81497
|
return word;
|
|
81498
81498
|
}
|
|
81499
|
+
if (/[a-z][A-Z]/.test(word)) {
|
|
81500
|
+
return word.charAt(0).toUpperCase() + word.slice(1);
|
|
81501
|
+
}
|
|
81499
81502
|
return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();
|
|
81500
81503
|
}).join("");
|
|
81501
81504
|
};
|
|
@@ -81529,7 +81532,7 @@ function processComplexFilename(filename) {
|
|
|
81529
81532
|
if (isCleanCase) {
|
|
81530
81533
|
return filename;
|
|
81531
81534
|
}
|
|
81532
|
-
let processed = filename.
|
|
81535
|
+
let processed = filename.replace(/[^a-zA-Z0-9]/g, " ");
|
|
81533
81536
|
processed = processed.replace(/\s+/g, " ").trim();
|
|
81534
81537
|
return processed;
|
|
81535
81538
|
}
|
|
@@ -81553,7 +81556,7 @@ function finalPascalCase(str) {
|
|
|
81553
81556
|
return parts.map((part) => {
|
|
81554
81557
|
if (!part) return part;
|
|
81555
81558
|
if (/^\d/.test(part)) {
|
|
81556
|
-
return part.replace(/^(\d+)([a-z])/, (
|
|
81559
|
+
return part.replace(/^(\d+)([a-z])/, (_7, numbers, firstLetter) => {
|
|
81557
81560
|
return numbers + firstLetter.toUpperCase();
|
|
81558
81561
|
});
|
|
81559
81562
|
}
|
package/dist/index.js
CHANGED
|
@@ -454,7 +454,7 @@ ${Ui.join(`
|
|
|
454
454
|
`,Mr)+1)+4;function Xr(ba){vr||(vr=xr),Vc.push(ba),xr+=ba.length;}for(va();D1(5););D1(4)&&(jt=0,xr=0);e:for(;;){switch(ne()){case 60:n2(Vc),ip||(ip=$t()),Ln(Zt(xr)),jt=0,vr=void 0;break;case 4:Vc.push(t.getTokenText()),jt=0,xr=0;break;case 42:let ba=t.getTokenText();jt===1?(jt=2,Xr(ba)):(or.assert(jt===0),jt=1,xr+=ba.length);break;case 5:or.assert(jt!==2,"whitespace shouldn't come from the scanner while saving top-level comment text");let bo=t.getTokenText();vr!==void 0&&xr+bo.length>vr&&Vc.push(bo.slice(vr-xr)),xr+=bo.length;break;case 1:break e;case 82:jt=2,Xr(t.getTokenValue());break;case 19:jt=2;let cc=t.getTokenFullStart(),Ru=t.getTokenEnd()-1,Mu=R(Ru);if(Mu){_l||ap(Vc),$d.push(Et(p.createJSDocText(Vc.join("")),_l??Mr,cc)),$d.push(Mu),Vc=[],_l=t.getTokenEnd();break}default:jt=2,Xr(t.getTokenText());break}jt===2?Cu(false):va();}let Lr=Vc.join("").trimEnd();$d.length&&Lr.length&&$d.push(Et(p.createJSDocText(Lr),_l??Mr,ip)),$d.length&&ki&&or.assertIsDefined(ip,"having parsed tags implies that the end of the comment span should be set");let ta=ki&&is(ki,uc,$c);return Et(p.createJSDocComment($d.length?is($d,Mr,ip):Lr.length?Lr:void 0,ta),Mr,ca)}function ap(jt){for(;jt.length&&(jt[0]===`
|
|
455
455
|
`||jt[0]==="\r");)jt.shift();}function n2(jt){for(;jt.length;){let vr=jt[jt.length-1].trimEnd();if(vr==="")jt.pop();else if(vr.length<jt[jt.length-1].length){jt[jt.length-1]=vr;break}else break}}function Jp(){for(;;){if(va(),ne()===1)return true;if(!(ne()===5||ne()===4))return false}}function yu(){if(!((ne()===5||ne()===4)&&yr(Jp)))for(;ne()===5||ne()===4;)va();}function B_(){if((ne()===5||ne()===4)&&yr(Jp))return "";let jt=t.hasPrecedingLineBreak(),vr=false,xr="";for(;jt&&ne()===42||ne()===5||ne()===4;)xr+=t.getTokenText(),ne()===4?(jt=true,vr=true,xr=""):ne()===42&&(jt=false),va();return vr?xr:""}function Zt(jt){or.assert(ne()===60);let vr=t.getTokenStart();va();let xr=Vd(void 0),Xr=B_(),Lr;switch(xr.escapedText){case "author":Lr=hT(vr,xr,jt,Xr);break;case "implements":Lr=yT(vr,xr,jt,Xr);break;case "augments":case "extends":Lr=SN(vr,xr,jt,Xr);break;case "class":case "constructor":Lr=x1(vr,p.createJSDocClassTag,xr,jt,Xr);break;case "public":Lr=x1(vr,p.createJSDocPublicTag,xr,jt,Xr);break;case "private":Lr=x1(vr,p.createJSDocPrivateTag,xr,jt,Xr);break;case "protected":Lr=x1(vr,p.createJSDocProtectedTag,xr,jt,Xr);break;case "readonly":Lr=x1(vr,p.createJSDocReadonlyTag,xr,jt,Xr);break;case "override":Lr=x1(vr,p.createJSDocOverrideTag,xr,jt,Xr);break;case "deprecated":ci=true,Lr=x1(vr,p.createJSDocDeprecatedTag,xr,jt,Xr);break;case "this":Lr=$A(vr,xr,jt,Xr);break;case "enum":Lr=Wf(vr,xr,jt,Xr);break;case "arg":case "argument":case "param":return x0(vr,xr,2,jt);case "return":case "returns":Lr=Vf(vr,xr,jt,Xr);break;case "template":Lr=JA(vr,xr,jt,Xr);break;case "type":Lr=WE(vr,xr,jt,Xr);break;case "typedef":Lr=vT(vr,xr,jt,Xr);break;case "callback":Lr=PN(vr,xr,jt,Xr);break;case "overload":Lr=NN(vr,xr,jt,Xr);break;case "satisfies":Lr=Jf(vr,xr,jt,Xr);break;case "see":Lr=fT(vr,xr,jt,Xr);break;case "exception":case "throws":Lr=b1(vr,xr,jt,Xr);break;case "import":Lr=gT(vr,xr,jt,Xr);break;default:Lr=cr(vr,xr,jt,Xr);break}return Lr}function y(jt,vr,xr,Xr){return Xr||(xr+=vr-jt),k(xr,Xr.slice(xr))}function k(jt,vr){let xr=$t(),Xr=[],Lr=[],ta,ba=0,bo;function cc(E0){bo||(bo=jt),Xr.push(E0),jt+=E0.length;}vr!==void 0&&(vr!==""&&cc(vr),ba=1);let Ru=ne();e:for(;;){switch(Ru){case 4:ba=0,Xr.push(t.getTokenText()),jt=0;break;case 60:t.resetTokenState(t.getTokenEnd()-1);break e;case 1:break e;case 5:or.assert(ba!==2&&ba!==3,"whitespace shouldn't come from the scanner while saving comment text");let E0=t.getTokenText();bo!==void 0&&jt+E0.length>bo&&(Xr.push(E0.slice(bo-jt)),ba=2),jt+=E0.length;break;case 19:ba=2;let Jb=t.getTokenFullStart(),C0=t.getTokenEnd()-1,G3=R(C0);G3?(Lr.push(Et(p.createJSDocText(Xr.join("")),ta??xr,Jb)),Lr.push(G3),Xr=[],ta=t.getTokenEnd()):cc(t.getTokenText());break;case 62:ba===3?ba=2:ba=3,cc(t.getTokenText());break;case 82:ba!==3&&(ba=2),cc(t.getTokenValue());break;case 42:if(ba===0){ba=1,jt+=1;break}default:ba!==3&&(ba=2),cc(t.getTokenText());break}ba===2||ba===3?Ru=Cu(ba===3):Ru=va();}ap(Xr);let Mu=Xr.join("").trimEnd();if(Lr.length)return Mu.length&&Lr.push(Et(p.createJSDocText(Mu),ta??xr)),is(Lr,xr,t.getTokenEnd());if(Mu.length)return Mu}function R(jt){let vr=Cn(ve);if(!vr)return;va(),yu();let xr=X(),Xr=[];for(;ne()!==20&&ne()!==4&&ne()!==1;)Xr.push(t.getTokenText()),va();let Lr=vr==="link"?p.createJSDocLink:vr==="linkcode"?p.createJSDocLinkCode:p.createJSDocLinkPlain;return Et(Lr(xr,Xr.join("")),jt,t.getTokenEnd())}function X(){if(Nu(ne())){let jt=$t(),vr=mu();for(;di(25);)vr=Et(p.createQualifiedName(vr,ne()===81?So(80,false):mu()),jt);for(;ne()===81;)_u(),va(),vr=Et(p.createJSDocMemberName(vr,Ts()),jt);return vr}}function ve(){if(B_(),ne()===19&&va()===60&&Nu(va())){let jt=t.getTokenValue();if(_t(jt))return jt}}function _t(jt){return jt==="link"||jt==="linkcode"||jt==="linkplain"}function cr(jt,vr,xr,Xr){return Et(p.createJSDocUnknownTag(vr,y(jt,$t(),xr,Xr)),jt)}function Ln(jt){jt&&(ki?ki.push(jt):(ki=[jt],uc=jt.pos),$c=jt.end);}function ha(){return B_(),ne()===19?Ae():void 0}function iu(){let jt=D1(23);jt&&yu();let vr=D1(62),xr=ET();return vr&&ob(62),jt&&(yu(),Ns(64)&&fu(),Gt(24)),{name:xr,isBracketed:jt}}function lc(jt){switch(jt.kind){case 151:return true;case 188:return lc(jt.elementType);default:return bwe(jt)&&Qs(jt.typeName)&&jt.typeName.escapedText==="Object"&&!jt.typeArguments}}function x0(jt,vr,xr,Xr){let Lr=ha(),ta=!Lr;B_();let{name:ba,isBracketed:bo}=iu(),cc=B_();ta&&!yr(ve)&&(Lr=ha());let Ru=y(jt,$t(),Xr,cc),Mu=D0(Lr,ba,xr,Xr);Mu&&(Lr=Mu,ta=true);let E0=xr===1?p.createJSDocPropertyTag(vr,ba,bo,Lr,ta,Ru):p.createJSDocParameterTag(vr,ba,bo,Lr,ta,Ru);return Et(E0,jt)}function D0(jt,vr,xr,Xr){if(jt&&lc(jt.type)){let Lr=$t(),ta,ba;for(;ta=Cn(()=>O_(xr,Xr,vr));)ta.kind===341||ta.kind===348?ba=wd(ba,ta):ta.kind===345&&ul(ta.tagName,Dt.A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag);if(ba){let bo=Et(p.createJSDocTypeLiteral(ba,jt.type.kind===188),Lr);return Et(p.createJSDocTypeExpression(bo),Lr)}}}function Vf(jt,vr,xr,Xr){J0(ki,hXt)&&ks(vr.pos,t.getTokenStart(),Dt._0_tag_already_specified,QP(vr.escapedText));let Lr=ha();return Et(p.createJSDocReturnTag(vr,Lr,y(jt,$t(),xr,Xr)),jt)}function WE(jt,vr,xr,Xr){J0(ki,Yse)&&ks(vr.pos,t.getTokenStart(),Dt._0_tag_already_specified,QP(vr.escapedText));let Lr=Ae(true),ta=xr!==void 0&&Xr!==void 0?y(jt,$t(),xr,Xr):void 0;return Et(p.createJSDocTypeTag(vr,Lr,ta),jt)}function fT(jt,vr,xr,Xr){let Lr=ne()===23||yr(()=>va()===60&&Nu(va())&&_t(t.getTokenValue()))?void 0:ze(),ta=xr!==void 0&&Xr!==void 0?y(jt,$t(),xr,Xr):void 0;return Et(p.createJSDocSeeTag(vr,Lr,ta),jt)}function b1(jt,vr,xr,Xr){let Lr=ha(),ta=y(jt,$t(),xr,Xr);return Et(p.createJSDocThrowsTag(vr,Lr,ta),jt)}function hT(jt,vr,xr,Xr){let Lr=$t(),ta=mT(),ba=t.getTokenFullStart(),bo=y(jt,ba,xr,Xr);bo||(ba=t.getTokenFullStart());let cc=typeof bo!="string"?is(Cse([Et(ta,Lr,ba)],bo),Lr):ta.text+bo;return Et(p.createJSDocAuthorTag(vr,cc),jt)}function mT(){let jt=[],vr=false,xr=t.getToken();for(;xr!==1&&xr!==4;){if(xr===30)vr=true;else {if(xr===60&&!vr)break;if(xr===32&&vr){jt.push(t.getTokenText()),t.resetTokenState(t.getTokenEnd());break}}jt.push(t.getTokenText()),xr=va();}return p.createJSDocText(jt.join(""))}function yT(jt,vr,xr,Xr){let Lr=UA();return Et(p.createJSDocImplementsTag(vr,Lr,y(jt,$t(),xr,Xr)),jt)}function SN(jt,vr,xr,Xr){let Lr=UA();return Et(p.createJSDocAugmentsTag(vr,Lr,y(jt,$t(),xr,Xr)),jt)}function Jf(jt,vr,xr,Xr){let Lr=Ae(false),ta=xr!==void 0&&Xr!==void 0?y(jt,$t(),xr,Xr):void 0;return Et(p.createJSDocSatisfiesTag(vr,Lr,ta),jt)}function gT(jt,vr,xr,Xr){let Lr=t.getTokenFullStart(),ta;oi()&&(ta=Ts());let ba=Uf(ta,Lr,true,true),bo=v1(),cc=V3(),Ru=xr!==void 0&&Xr!==void 0?y(jt,$t(),xr,Xr):void 0;return Et(p.createJSDocImportTag(vr,ba,bo,cc,Ru),jt)}function UA(){let jt=di(19),vr=$t(),xr=FN();t.setSkipJsDocLeadingAsterisks(true);let Xr=F_();t.setSkipJsDocLeadingAsterisks(false);let Lr=p.createExpressionWithTypeArguments(xr,Xr),ta=Et(Lr,vr);return jt&&(yu(),Gt(20)),ta}function FN(){let jt=$t(),vr=Vd();for(;di(25);){let xr=Vd();vr=Et(O(vr,xr),jt);}return vr}function x1(jt,vr,xr,Xr,Lr){return Et(vr(xr,y(jt,$t(),Xr,Lr)),jt)}function $A(jt,vr,xr,Xr){let Lr=Ae(true);return yu(),Et(p.createJSDocThisTag(vr,Lr,y(jt,$t(),xr,Xr)),jt)}function Wf(jt,vr,xr,Xr){let Lr=Ae(true);return yu(),Et(p.createJSDocEnumTag(vr,Lr,y(jt,$t(),xr,Xr)),jt)}function vT(jt,vr,xr,Xr){let Lr=ha();B_();let ta=I_();yu();let ba=k(xr),bo;if(!Lr||lc(Lr.type)){let Ru,Mu,E0,Jb=false;for(;(Ru=Cn(()=>xT(xr)))&&Ru.kind!==345;)if(Jb=true,Ru.kind===344)if(Mu){let C0=Pi(Dt.A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags);C0&&Gq(C0,Ok(Re,Se,0,0,Dt.The_tag_was_first_specified_here));break}else Mu=Ru;else E0=wd(E0,Ru);if(Jb){let C0=Lr&&Lr.type.kind===188,G3=p.createJSDocTypeLiteral(E0,C0);Lr=Mu&&Mu.typeExpression&&!lc(Mu.typeExpression.type)?Mu.typeExpression:Et(G3,jt),bo=Lr.end;}}bo=bo||ba!==void 0?$t():(ta??Lr??vr).end,ba||(ba=y(jt,bo,xr,Xr));let cc=p.createJSDocTypedefTag(vr,Lr,ta,ba);return Et(cc,jt,bo)}function I_(jt){let vr=t.getTokenStart();if(!Nu(ne()))return;let xr=Vd();if(di(25)){let Xr=I_(true),Lr=p.createModuleDeclaration(void 0,xr,Xr,jt?8:void 0);return Et(Lr,vr)}return jt&&(xr.flags|=4096),xr}function bT(jt){let vr=$t(),xr,Xr;for(;xr=Cn(()=>O_(4,jt));){if(xr.kind===345){ul(xr.tagName,Dt.A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag);break}Xr=wd(Xr,xr);}return is(Xr||[],vr)}function VA(jt,vr){let xr=bT(vr),Xr=Cn(()=>{if(D1(60)){let Lr=Zt(vr);if(Lr&&Lr.kind===342)return Lr}});return Et(p.createJSDocSignature(void 0,xr,Xr),jt)}function PN(jt,vr,xr,Xr){let Lr=I_();yu();let ta=k(xr),ba=VA(jt,xr);ta||(ta=y(jt,$t(),xr,Xr));let bo=ta!==void 0?$t():ba.end;return Et(p.createJSDocCallbackTag(vr,ba,Lr,ta),jt,bo)}function NN(jt,vr,xr,Xr){yu();let Lr=k(xr),ta=VA(jt,xr);Lr||(Lr=y(jt,$t(),xr,Xr));let ba=Lr!==void 0?$t():ta.end;return Et(p.createJSDocOverloadTag(vr,ta,Lr),jt,ba)}function zf(jt,vr){for(;!Qs(jt)||!Qs(vr);)if(!Qs(jt)&&!Qs(vr)&&jt.right.escapedText===vr.right.escapedText)jt=jt.left,vr=vr.left;else return false;return jt.escapedText===vr.escapedText}function xT(jt){return O_(1,jt)}function O_(jt,vr,xr){let Xr=true,Lr=false;for(;;)switch(va()){case 60:if(Xr){let ta=Hf(jt,vr);return ta&&(ta.kind===341||ta.kind===348)&&xr&&(Qs(ta.name)||!zf(xr,ta.name.left))?false:ta}Lr=false;break;case 4:Xr=true,Lr=false;break;case 42:Lr&&(Xr=false),Lr=true;break;case 80:Xr=false;break;case 1:return false}}function Hf(jt,vr){or.assert(ne()===60);let xr=t.getTokenFullStart();va();let Xr=Vd(),Lr=B_(),ta;switch(Xr.escapedText){case "type":return jt===1&&WE(xr,Xr);case "prop":case "property":ta=1;break;case "arg":case "argument":case "param":ta=6;break;case "template":return JA(xr,Xr,vr,Lr);case "this":return $A(xr,Xr,vr,Lr);default:return false}return jt&ta?x0(xr,Xr,jt,vr):false}function DT(){let jt=$t(),vr=D1(23);vr&&yu();let xr=nu(false,true),Xr=Vd(Dt.Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces),Lr;if(vr&&(yu(),Gt(64),Lr=en(16777216,u1),Gt(24)),!_A(Xr))return Et(p.createTypeParameterDeclaration(xr,Xr,void 0,Lr),jt)}function Gf(){let jt=$t(),vr=[];do{yu();let xr=DT();xr!==void 0&&vr.push(xr),B_();}while(D1(28));return is(vr,jt)}function JA(jt,vr,xr,Xr){let Lr=ne()===19?Ae():void 0,ta=Gf();return Et(p.createJSDocTemplateTag(vr,Lr,ta,y(jt,$t(),xr,Xr)),jt)}function D1(jt){return ne()===jt?(va(),true):false}function ET(){let jt=Vd();for(di(23)&&Gt(24);di(25);){let vr=Vd();di(23)&&Gt(24),jt=N(jt,vr);}return jt}function Vd(jt){if(!Nu(ne()))return So(80,!jt,jt||Dt.Identifier_expected);Fr++;let vr=t.getTokenStart(),xr=t.getTokenEnd(),Xr=ne(),Lr=Pp(t.getTokenValue()),ta=Et(P(Lr,Xr),vr,xr);return va(),ta}}})(Vp=e.JSDocParser||(e.JSDocParser={}));})(fA||(fA={}));JAe=new WeakSet;Jwe=new WeakSet;(e=>{function t(b,C,P,U){if(U=U||or.shouldAssert(2),p(b,C,P,U),Bzt(P))return b;if(b.statements.length===0)return fA.parseSourceFile(b.fileName,C,b.languageVersion,void 0,true,b.scriptKind,b.setExternalModuleIndicator,b.jsDocParsingMode);$Xt(b),fA.fixupParentReferences(b);let $=b.text,S=f(b),T=l(b,P);p(b,C,T,U),or.assert(T.span.start<=P.span.start),or.assert(Zv(T.span)===Zv(P.span)),or.assert(Zv(OP(T))===Zv(OP(P)));let O=OP(T).length-T.span.length;c(b,T.span.start,Zv(T.span),Zv(OP(T)),O,$,C,U);let F=fA.parseSourceFile(b.fileName,C,b.languageVersion,S,true,b.scriptKind,b.setExternalModuleIndicator,b.jsDocParsingMode);return F.commentDirectives=r(b.commentDirectives,F.commentDirectives,T.span.start,Zv(T.span),O,$,C,U),F.impliedNodeFormat=b.impliedNodeFormat,bXt(b,F),F}e.updateSourceFile=t;function r(b,C,P,U,$,S,T,O){if(!b)return C;let F,B=false;for(let q of b){let{range:H,type:te}=q;if(H.end<P)F=wd(F,q);else if(H.pos>U){L();let Z={range:{pos:H.pos+$,end:H.end+$},type:te};F=wd(F,Z),O&&or.assert(S.substring(H.pos,H.end)===T.substring(Z.range.pos,Z.range.end));}}return L(),F;function L(){B||(B=true,F?C&&F.push(...C):F=C);}}function i(b,C,P,U,$,S,T){P?F(b):O(b);return;function O(B){let L="";if(T&&a(B)&&(L=$.substring(B.pos,B.end)),bAe(B,C),j4(B,B.pos+U,B.end+U),T&&a(B)&&or.assert(L===S.substring(B.pos,B.end)),W0(B,O,F),pA(B))for(let q of B.jsDoc)O(q);u(B,T);}function F(B){j4(B,B.pos+U,B.end+U);for(let L of B)O(L);}}function a(b){switch(b.kind){case 11:case 9:case 80:return true}return false}function o(b,C,P,U,$){or.assert(b.end>=C,"Adjusting an element that was entirely before the change range"),or.assert(b.pos<=P,"Adjusting an element that was entirely after the change range"),or.assert(b.pos<=b.end);let S=Math.min(b.pos,U),T=b.end>=P?b.end+$:Math.min(b.end,U);if(or.assert(S<=T),b.parent){let O=b.parent;or.assertGreaterThanOrEqual(S,O.pos),or.assertLessThanOrEqual(T,O.end);}j4(b,S,T);}function u(b,C){if(C){let P=b.pos,U=$=>{or.assert($.pos>=P),P=$.end;};if(pA(b))for(let $ of b.jsDoc)U($);W0(b,U),or.assert(P<=b.end);}}function c(b,C,P,U,$,S,T,O){F(b);return;function F(L){if(or.assert(L.pos<=L.end),L.pos>P){i(L,b,false,$,S,T,O);return}let q=L.end;if(q>=C){if(fse(L),bAe(L,b),o(L,C,P,U,$),W0(L,F,B),pA(L))for(let H of L.jsDoc)F(H);u(L,O);return}or.assert(q<C);}function B(L){if(or.assert(L.pos<=L.end),L.pos>P){i(L,b,true,$,S,T,O);return}let q=L.end;if(q>=C){fse(L),o(L,C,P,U,$);for(let H of L)F(H);return}or.assert(q<C);}}function l(b,C){let P=C.span.start;for(let S=0;P>0&&S<=1;S++){let T=h(b,P);or.assert(T.pos<=P);let O=T.pos;P=Math.max(0,O-1);}let U=Nzt(P,Zv(C.span)),$=C.newLength+(C.span.start-P);return j5e(U,$)}function h(b,C){let P=b,U;if(W0(b,S),U){let T=$(U);T.pos>P.pos&&(P=T);}return P;function $(T){for(;;){let O=EGt(T);if(O)T=O;else return T}}function S(T){if(!_A(T))if(T.pos<=C){if(T.pos>=P.pos&&(P=T),C<T.end)return W0(T,S),true;or.assert(T.end<=C),U=T;}else return or.assert(T.pos>C),true}}function p(b,C,P,U){let $=b.text;if(P&&(or.assert($.length-P.span.length+P.newLength===C.length),U||or.shouldAssert(3))){let S=$.substr(0,P.span.start),T=C.substr(0,P.span.start);or.assert(S===T);let O=$.substring(Zv(P.span),$.length),F=C.substring(Zv(OP(P)),C.length);or.assert(O===F);}}function f(b){let C=b.statements,P=0;or.assert(P<C.length);let U=C[P],$=-1;return {currentNode(T){return T!==$&&(U&&U.end===T&&P<C.length-1&&(P++,U=C[P]),(!U||U.pos!==T)&&S(T)),$=T,or.assert(!U||U.pos===T),U}};function S(T){C=void 0,P=-1,U=void 0,W0(b,O,F);return;function O(B){return T>=B.pos&&T<B.end?(W0(B,O,F),true):false}function F(B){if(T>=B.pos&&T<B.end)for(let L=0;L<B.length;L++){let q=B[L];if(q){if(q.pos===T)return C=B,P=L,U=q,true;if(q.pos<T&&T<q.end)return W0(q,O,F),true}}return false}}}e.createSyntaxCursor=f;let v;(b=>{b[b.Value=-1]="Value";})(v||(v={}));})(fU||(fU={}));Hae=new Map;XXt=/^\/\/\/\s*<(\S+)\s.*?\/>/m,YXt=/^\/\/\/?\s*@([^\s:]+)((?:[^\S\r\n]|:).*)?$/m;HP=Bse(Tse.Latest,true);eoe=class{constructor(e,t,r){this.pos=t,this.end=r,this.kind=e,this.id=0,this.flags=0,this.modifierFlagsCache=0,this.transformFlags=0,this.parent=void 0,this.original=void 0,this.emitNode=void 0;}assertHasRealPosition(e){or.assert(!rN(this.pos)&&!rN(this.end),e||"Node must have a real position for this operation");}getSourceFile(){return M4(this)}getStart(e,t){return this.assertHasRealPosition(),uU(this,e,t)}getFullStart(){return this.assertHasRealPosition(),this.pos}getEnd(){return this.assertHasRealPosition(),this.end}getWidth(e){return this.assertHasRealPosition(),this.getEnd()-this.getStart(e)}getFullWidth(){return this.assertHasRealPosition(),this.end-this.pos}getLeadingTriviaWidth(e){return this.assertHasRealPosition(),this.getStart(e)-this.pos}getFullText(e){return this.assertHasRealPosition(),(e||this.getSourceFile()).text.substring(this.pos,this.end)}getText(e){return this.assertHasRealPosition(),e||(e=this.getSourceFile()),e.text.substring(this.getStart(e),this.getEnd())}getChildCount(e){return this.getChildren(e).length}getChildAt(e,t){return this.getChildren(t)[e]}getChildren(e=M4(this)){return this.assertHasRealPosition("Node without a real position cannot be scanned and thus has no token nodes - use forEachChild and collect the result if that's fine"),jwe(this,e)??vXt(this,e,eYt(this,e))}getFirstToken(e){this.assertHasRealPosition();let t=this.getChildren(e);if(!t.length)return;let r=u5e(t,i=>i.kind<309||i.kind>351);return r.kind<166?r:r.getFirstToken(e)}getLastToken(e){this.assertHasRealPosition();let t=this.getChildren(e),r=Hk(t);if(r)return r.kind<166?r:r.getLastToken(e)}forEachChild(e,t){return W0(this,e,t)}};toe=class{constructor(e,t,r){this.pos=t,this.end=r,this.kind=e,this.id=0,this.flags=0,this.transformFlags=0,this.parent=void 0,this.emitNode=void 0;}getSourceFile(){return M4(this)}getStart(e,t){return uU(this,e,t)}getFullStart(){return this.pos}getEnd(){return this.end}getWidth(e){return this.getEnd()-this.getStart(e)}getFullWidth(){return this.end-this.pos}getLeadingTriviaWidth(e){return this.getStart(e)-this.pos}getFullText(e){return (e||this.getSourceFile()).text.substring(this.pos,this.end)}getText(e){return e||(e=this.getSourceFile()),e.text.substring(this.getStart(e),this.getEnd())}getChildCount(){return this.getChildren().length}getChildAt(e){return this.getChildren()[e]}getChildren(){return this.kind===1&&this.jsDoc||Xu}getFirstToken(){}getLastToken(){}forEachChild(){}},rYt=class{constructor(e,t){this.flags=e,this.escapedName=t,this.declarations=void 0,this.valueDeclaration=void 0,this.id=0,this.mergeId=0,this.parent=void 0,this.members=void 0,this.exports=void 0,this.exportSymbol=void 0,this.constEnumOnlyModule=void 0,this.isReferenced=void 0,this.lastAssignmentPos=void 0,this.links=void 0;}getFlags(){return this.flags}get name(){return ise(this)}getEscapedName(){return this.escapedName}getName(){return this.name}getDeclarations(){return this.declarations}getDocumentationComment(e){if(!this.documentationComment)if(this.documentationComment=Xu,!this.declarations&&iAe(this)&&this.links.target&&iAe(this.links.target)&&this.links.target.links.tupleLabelDeclaration){let t=this.links.target.links.tupleLabelDeclaration;this.documentationComment=zP([t],e);}else this.documentationComment=zP(this.declarations,e);return this.documentationComment}getContextualDocumentationComment(e,t){if(e){if(Hq(e)&&(this.contextualGetAccessorDocumentationComment||(this.contextualGetAccessorDocumentationComment=Xu,this.contextualGetAccessorDocumentationComment=zP(fD(this.declarations,Hq),t)),qP(this.contextualGetAccessorDocumentationComment)))return this.contextualGetAccessorDocumentationComment;if(zq(e)&&(this.contextualSetAccessorDocumentationComment||(this.contextualSetAccessorDocumentationComment=Xu,this.contextualSetAccessorDocumentationComment=zP(fD(this.declarations,zq),t)),qP(this.contextualSetAccessorDocumentationComment)))return this.contextualSetAccessorDocumentationComment}return this.getDocumentationComment(t)}getJsDocTags(e){return this.tags===void 0&&(this.tags=Xu,this.tags=rU(this.declarations,e)),this.tags}getContextualJsDocTags(e,t){if(e){if(Hq(e)&&(this.contextualGetAccessorTags||(this.contextualGetAccessorTags=Xu,this.contextualGetAccessorTags=rU(fD(this.declarations,Hq),t)),qP(this.contextualGetAccessorTags)))return this.contextualGetAccessorTags;if(zq(e)&&(this.contextualSetAccessorTags||(this.contextualSetAccessorTags=Xu,this.contextualSetAccessorTags=rU(fD(this.declarations,zq),t)),qP(this.contextualSetAccessorTags)))return this.contextualSetAccessorTags}return this.getJsDocTags(t)}},zwe=class extends toe{constructor(e,t,r){super(e,t,r);}},Hwe=class extends toe{constructor(e,t,r){super(e,t,r);}get text(){return Sd(this)}},Gwe=class extends toe{constructor(e,t,r){super(e,t,r);}get text(){return Sd(this)}},nYt=class{constructor(e,t){this.flags=t,this.checker=e;}getFlags(){return this.flags}getSymbol(){return this.symbol}getProperties(){return this.checker.getPropertiesOfType(this)}getProperty(e){return this.checker.getPropertyOfType(this,e)}getApparentProperties(){return this.checker.getAugmentedPropertiesOfType(this)}getCallSignatures(){return this.checker.getSignaturesOfType(this,0)}getConstructSignatures(){return this.checker.getSignaturesOfType(this,1)}getStringIndexType(){return this.checker.getIndexTypeOfType(this,0)}getNumberIndexType(){return this.checker.getIndexTypeOfType(this,1)}getBaseTypes(){return this.isClassOrInterface()?this.checker.getBaseTypes(this):void 0}isNullableType(){return this.checker.isNullableType(this)}getNonNullableType(){return this.checker.getNonNullableType(this)}getNonOptionalType(){return this.checker.getNonOptionalType(this)}getConstraint(){return this.checker.getBaseConstraintOfType(this)}getDefault(){return this.checker.getDefaultFromTypeParameter(this)}isUnion(){return !!(this.flags&1048576)}isIntersection(){return !!(this.flags&2097152)}isUnionOrIntersection(){return !!(this.flags&3145728)}isLiteral(){return !!(this.flags&2432)}isStringLiteral(){return !!(this.flags&128)}isNumberLiteral(){return !!(this.flags&256)}isTypeParameter(){return !!(this.flags&262144)}isClassOrInterface(){return !!(Vae(this)&3)}isClass(){return !!(Vae(this)&1)}isIndexType(){return !!(this.flags&4194304)}get typeArguments(){if(Vae(this)&4)return this.checker.getTypeArguments(this)}},iYt=class{constructor(e,t){this.flags=t,this.checker=e;}getDeclaration(){return this.declaration}getTypeParameters(){return this.typeParameters}getParameters(){return this.parameters}getReturnType(){return this.checker.getReturnTypeOfSignature(this)}getTypeParameterAtPosition(e){let t=this.checker.getParameterType(this,e);if(t.isIndexType()&&KGt(t.type)){let r=t.type.getConstraint();if(r)return this.checker.getIndexType(r)}return t}getDocumentationComment(){return this.documentationComment||(this.documentationComment=zP(ese(this.declaration),this.checker))}getJsDocTags(){return this.jsDocTags||(this.jsDocTags=rU(ese(this.declaration),this.checker))}};aYt=class extends eoe{constructor(e,t,r){super(e,t,r);}update(e,t){return UXt(this,e,t)}getLineAndCharacterOfPosition(e){return B5e(this,e)}getLineStarts(){return rse(this)}getPositionOfLineAndCharacter(e,t,r){return bzt(rse(this),e,t,this.text,r)}getLineEndOfPosition(e){let{line:t}=this.getLineAndCharacterOfPosition(e),r=this.getLineStarts(),i;t+1>=r.length&&(i=this.getEnd()),i||(i=r[t+1]-1);let a=this.getFullText();return a[i]===`
|
|
456
456
|
`&&a[i-1]==="\r"?i-1:i}getNamedDeclarations(){return this.namedDeclarations||(this.namedDeclarations=this.computeNamedDeclarations()),this.namedDeclarations}computeNamedDeclarations(){let e=RWt();return this.forEachChild(a),e;function t(o){let u=i(o);u&&e.add(u,o);}function r(o){let u=e.get(o);return u||e.set(o,u=[]),u}function i(o){let u=Ose(o);return u&&(mwe(u)&&yD(u.expression)?u.expression.name.text:K5e(u)?getNameFromPropertyName(u):void 0)}function a(o){switch(o.kind){case 262:case 218:case 174:case 173:let u=o,c=i(u);if(c){let p=r(c),f=Hk(p);f&&u.parent===f.parent&&u.symbol===f.symbol?u.body&&!f.body&&(p[p.length-1]=u):p.push(u);}W0(o,a);break;case 263:case 231:case 264:case 265:case 266:case 267:case 271:case 281:case 276:case 273:case 274:case 177:case 178:case 187:t(o),W0(o,a);break;case 169:if(!aN(o,31))break;case 260:case 208:{let p=o;if(hHt(p.name)){W0(p.name,a);break}p.initializer&&a(p.initializer);}case 306:case 172:case 171:t(o);break;case 278:let l=o;l.exportClause&&(YKt(l.exportClause)?Ef(l.exportClause.elements,a):a(l.exportClause.name));break;case 272:let h=o.importClause;h&&(h.name&&t(h.name),h.namedBindings&&(h.namedBindings.kind===274?t(h.namedBindings):Ef(h.namedBindings.elements,a)));break;case 226:qse(o)!==0&&t(o);default:W0(o,a);}}}},sYt=class{constructor(e,t,r){this.fileName=e,this.text=t,this.skipTrivia=r||(i=>i);}getLineAndCharacterOfPosition(e){return B5e(this,e)}};uYt=["getSemanticDiagnostics","getSuggestionDiagnostics","getCompilerOptionsDiagnostics","getSemanticClassifications","getEncodedSemanticClassifications","getCodeFixesAtPosition","getCombinedCodeFix","applyCodeActionCommand","organizeImports","getEditsForFileRename","getEmitOutput","getApplicableRefactors","getEditsForRefactor","prepareCallHierarchy","provideCallHierarchyIncomingCalls","provideCallHierarchyOutgoingCalls","provideInlayHints","getSupportedCodeFixes","getPasteEdits"],[...uYt,"getCompletionsAtPosition","getCompletionEntryDetails","getCompletionEntrySymbol","getSignatureHelpItems","getQuickInfoAtPosition","getDefinitionAtPosition","getDefinitionAndBoundSpan","getImplementationAtPosition","getTypeDefinitionAtPosition","getReferencesAtPosition","findReferences","getDocumentHighlights","getNavigateToItems","getRenameInfo","findRenameLocations","getApplicableRefactors","preparePasteEditsForFile"];NGt(oYt());Ywe=new Proxy({},{get:()=>true}),Qwe=Ywe["4.8"];lYt={},Zwe=new Proxy({},{get:(e,t)=>t}),cYt=Zwe,pYt=Zwe,kt=cYt,Vl=pYt,eke=Ywe["5.0"],Sn=Ca,_Yt=new Set([Sn.AmpersandAmpersandToken,Sn.BarBarToken,Sn.QuestionQuestionToken]),dYt=new Set([Ca.AmpersandAmpersandEqualsToken,Ca.AmpersandEqualsToken,Ca.AsteriskAsteriskEqualsToken,Ca.AsteriskEqualsToken,Ca.BarBarEqualsToken,Ca.BarEqualsToken,Ca.CaretEqualsToken,Ca.EqualsToken,Ca.GreaterThanGreaterThanEqualsToken,Ca.GreaterThanGreaterThanGreaterThanEqualsToken,Ca.LessThanLessThanEqualsToken,Ca.MinusEqualsToken,Ca.PercentEqualsToken,Ca.PlusEqualsToken,Ca.QuestionQuestionEqualsToken,Ca.SlashEqualsToken]),fYt=new Set([Sn.AmpersandAmpersandToken,Sn.AmpersandToken,Sn.AsteriskAsteriskToken,Sn.AsteriskToken,Sn.BarBarToken,Sn.BarToken,Sn.CaretToken,Sn.EqualsEqualsEqualsToken,Sn.EqualsEqualsToken,Sn.ExclamationEqualsEqualsToken,Sn.ExclamationEqualsToken,Sn.GreaterThanEqualsToken,Sn.GreaterThanGreaterThanGreaterThanToken,Sn.GreaterThanGreaterThanToken,Sn.GreaterThanToken,Sn.InKeyword,Sn.InstanceOfKeyword,Sn.LessThanEqualsToken,Sn.LessThanLessThanToken,Sn.LessThanToken,Sn.MinusToken,Sn.PercentToken,Sn.PlusToken,Sn.SlashToken]);NYt=class extends Error{fileName;location;constructor(e,t,r){super(e),this.fileName=t,this.location=r,Object.defineProperty(this,"name",{configurable:true,enumerable:false,value:new.target.name});}get index(){return this.location.start.offset}get lineNumber(){return this.location.start.line}get column(){return this.location.start.column}};Qe=Ca;HYt=class{constructor(e,t){gWt(this,si),BP(this,"allowPattern",false),BP(this,"ast"),BP(this,"esTreeNodeToTSNodeMap",new WeakMap),BP(this,"options"),BP(this,"tsNodeToESTreeNodeMap",new WeakMap),this.ast=e,this.options={...t};}assertModuleSpecifier(e,t){var r;!t&&e.moduleSpecifier==null&&li(this,si,Sc).call(this,e,"Module specifier must be a string literal."),e.moduleSpecifier&&((r=e.moduleSpecifier)==null?void 0:r.kind)!==Qe.StringLiteral&&li(this,si,Sc).call(this,e.moduleSpecifier,"Module specifier must be a string literal.");}convertBindingNameWithTypeAnnotation(e,t,r){let i=this.convertPattern(e);return t&&(i.typeAnnotation=this.convertTypeAnnotation(t,r),this.fixParentLocation(i,i.typeAnnotation.range)),i}convertBodyExpressions(e,t){let r=CYt(t);return e.map(i=>{let a=this.convertChild(i);if(r){if(a!=null&&a.expression&&kwe(i)&&Qk(i.expression)){let o=a.expression.raw;return a.directive=o.slice(1,-1),a}r=false;}return a}).filter(i=>i)}convertChainExpression(e,t){let{child:r,isOptional:i}=e.type===kt.MemberExpression?{child:e.object,isOptional:e.optional}:e.type===kt.CallExpression?{child:e.callee,isOptional:e.optional}:{child:e.expression,isOptional:false},a=TYt(t,r);if(!a&&!i)return e;if(a&&rke(r)){let o=r.expression;e.type===kt.MemberExpression?e.object=o:e.type===kt.CallExpression?e.callee=o:e.expression=o;}return this.createNode(t,{type:kt.ChainExpression,expression:e})}convertChild(e,t){return this.converter(e,t,false)}convertPattern(e,t){return this.converter(e,t,true)}convertTypeAnnotation(e,t){let r=t?.kind===Qe.FunctionType||t?.kind===Qe.ConstructorType?2:1,i=[e.getFullStart()-r,e.end],a=cA(i,this.ast);return {type:kt.TSTypeAnnotation,loc:a,range:i,typeAnnotation:this.convertChild(e)}}convertTypeArgumentsToTypeParameterInstantiation(e,t){let r=eb(e,this.ast,this.ast);return this.createNode(t,{type:kt.TSTypeParameterInstantiation,range:[e.pos-1,r.end],params:e.map(i=>this.convertChild(i))})}convertTSTypeParametersToTypeParametersDeclaration(e){let t=eb(e,this.ast,this.ast),r=[e.pos-1,t.end];return {type:kt.TSTypeParameterDeclaration,loc:cA(r,this.ast),range:r,params:e.map(i=>this.convertChild(i))}}convertParameters(e){return e!=null&&e.length?e.map(t=>{var r;let i=this.convertChild(t);return i.decorators=((r=$k(t))==null?void 0:r.map(a=>this.convertChild(a)))??[],i}):[]}converter(e,t,r){if(!e)return null;li(this,si,ske).call(this,e);let i=this.allowPattern;r!=null&&(this.allowPattern=r);let a=this.convertNode(e,t??e.parent);return this.registerTSNodeInNodeMap(e,a),this.allowPattern=i,a}convertImportAttributes(e){return e==null?[]:e.elements.map(t=>this.convertChild(t))}convertJSXIdentifier(e){let t=this.createNode(e,{type:kt.JSXIdentifier,name:e.getText()});return this.registerTSNodeInNodeMap(e,t),t}convertJSXNamespaceOrIdentifier(e){if(e.kind===Ca.JsxNamespacedName){let i=this.createNode(e,{type:kt.JSXNamespacedName,name:this.createNode(e.name,{type:kt.JSXIdentifier,name:e.name.text}),namespace:this.createNode(e.namespace,{type:kt.JSXIdentifier,name:e.namespace.text})});return this.registerTSNodeInNodeMap(e,i),i}let t=e.getText(),r=t.indexOf(":");if(r>0){let i=Lk(e,this.ast),a=this.createNode(e,{type:kt.JSXNamespacedName,range:i,name:this.createNode(e,{type:kt.JSXIdentifier,range:[i[0]+r+1,i[1]],name:t.slice(r+1)}),namespace:this.createNode(e,{type:kt.JSXIdentifier,range:[i[0],i[0]+r],name:t.slice(0,r)})});return this.registerTSNodeInNodeMap(e,a),a}return this.convertJSXIdentifier(e)}convertJSXTagName(e,t){let r;switch(e.kind){case Qe.PropertyAccessExpression:e.name.kind===Qe.PrivateIdentifier&&li(this,si,ka).call(this,e.name,"Non-private identifier expected."),r=this.createNode(e,{type:kt.JSXMemberExpression,object:this.convertJSXTagName(e.expression,t),property:this.convertJSXIdentifier(e.name)});break;case Qe.ThisKeyword:case Qe.Identifier:default:return this.convertJSXNamespaceOrIdentifier(e)}return this.registerTSNodeInNodeMap(e,r),r}convertMethodSignature(e){return this.createNode(e,{type:kt.TSMethodSignature,accessibility:oA(e),computed:Rk(e.name),key:this.convertChild(e.name),kind:(()=>{switch(e.kind){case Qe.GetAccessor:return "get";case Qe.SetAccessor:return "set";case Qe.MethodSignature:return "method"}})(),optional:HAe(e),params:this.convertParameters(e.parameters),readonly:gs(Qe.ReadonlyKeyword,e),returnType:e.type&&this.convertTypeAnnotation(e.type,e),static:gs(Qe.StaticKeyword,e),typeParameters:e.typeParameters&&this.convertTSTypeParametersToTypeParametersDeclaration(e.typeParameters)})}fixParentLocation(e,t){t[0]<e.range[0]&&(e.range[0]=t[0],e.loc.start=nU(e.range[0],this.ast)),t[1]>e.range[1]&&(e.range[1]=t[1],e.loc.end=nU(e.range[1],this.ast));}convertNode(e,t){var r,i,a,o,u,c,l,h;switch(e.kind){case Qe.SourceFile:return this.createNode(e,{type:kt.Program,range:[e.getStart(this.ast),e.endOfFileToken.end],body:this.convertBodyExpressions(e.statements,e),comments:void 0,sourceType:e.externalModuleIndicator?"module":"script",tokens:void 0});case Qe.Block:return this.createNode(e,{type:kt.BlockStatement,body:this.convertBodyExpressions(e.statements,e)});case Qe.Identifier:return RYt(e)?this.createNode(e,{type:kt.ThisExpression}):this.createNode(e,{type:kt.Identifier,decorators:[],name:e.text,optional:false,typeAnnotation:void 0});case Qe.PrivateIdentifier:return this.createNode(e,{type:kt.PrivateIdentifier,name:e.text.slice(1)});case Qe.WithStatement:return this.createNode(e,{type:kt.WithStatement,body:this.convertChild(e.statement),object:this.convertChild(e.expression)});case Qe.ReturnStatement:return this.createNode(e,{type:kt.ReturnStatement,argument:this.convertChild(e.expression)});case Qe.LabeledStatement:return this.createNode(e,{type:kt.LabeledStatement,body:this.convertChild(e.statement),label:this.convertChild(e.label)});case Qe.ContinueStatement:return this.createNode(e,{type:kt.ContinueStatement,label:this.convertChild(e.label)});case Qe.BreakStatement:return this.createNode(e,{type:kt.BreakStatement,label:this.convertChild(e.label)});case Qe.IfStatement:return this.createNode(e,{type:kt.IfStatement,alternate:this.convertChild(e.elseStatement),consequent:this.convertChild(e.thenStatement),test:this.convertChild(e.expression)});case Qe.SwitchStatement:return e.caseBlock.clauses.filter(p=>p.kind===Qe.DefaultClause).length>1&&li(this,si,ka).call(this,e,"A 'default' clause cannot appear more than once in a 'switch' statement."),this.createNode(e,{type:kt.SwitchStatement,cases:e.caseBlock.clauses.map(p=>this.convertChild(p)),discriminant:this.convertChild(e.expression)});case Qe.CaseClause:case Qe.DefaultClause:return this.createNode(e,{type:kt.SwitchCase,consequent:e.statements.map(p=>this.convertChild(p)),test:e.kind===Qe.CaseClause?this.convertChild(e.expression):null});case Qe.ThrowStatement:return e.expression.end===e.expression.pos&&li(this,si,Sc).call(this,e,"A throw statement must throw an expression."),this.createNode(e,{type:kt.ThrowStatement,argument:this.convertChild(e.expression)});case Qe.TryStatement:return this.createNode(e,{type:kt.TryStatement,block:this.convertChild(e.tryBlock),finalizer:this.convertChild(e.finallyBlock),handler:this.convertChild(e.catchClause)});case Qe.CatchClause:return (r=e.variableDeclaration)!=null&&r.initializer&&li(this,si,ka).call(this,e.variableDeclaration.initializer,"Catch clause variable cannot have an initializer."),this.createNode(e,{type:kt.CatchClause,body:this.convertChild(e.block),param:e.variableDeclaration?this.convertBindingNameWithTypeAnnotation(e.variableDeclaration.name,e.variableDeclaration.type):null});case Qe.WhileStatement:return this.createNode(e,{type:kt.WhileStatement,body:this.convertChild(e.statement),test:this.convertChild(e.expression)});case Qe.DoStatement:return this.createNode(e,{type:kt.DoWhileStatement,body:this.convertChild(e.statement),test:this.convertChild(e.expression)});case Qe.ForStatement:return this.createNode(e,{type:kt.ForStatement,body:this.convertChild(e.statement),init:this.convertChild(e.initializer),test:this.convertChild(e.condition),update:this.convertChild(e.incrementor)});case Qe.ForInStatement:return li(this,si,mse).call(this,e.initializer,e.kind),this.createNode(e,{type:kt.ForInStatement,body:this.convertChild(e.statement),left:this.convertPattern(e.initializer),right:this.convertChild(e.expression)});case Qe.ForOfStatement:return li(this,si,mse).call(this,e.initializer,e.kind),this.createNode(e,{type:kt.ForOfStatement,await:!!(e.awaitModifier&&e.awaitModifier.kind===Qe.AwaitKeyword),body:this.convertChild(e.statement),left:this.convertPattern(e.initializer),right:this.convertChild(e.expression)});case Qe.FunctionDeclaration:{let p=gs(Qe.DeclareKeyword,e),f=gs(Qe.AsyncKeyword,e),v=!!e.asteriskToken;p?e.body?li(this,si,ka).call(this,e,"An implementation cannot be declared in ambient contexts."):f?li(this,si,ka).call(this,e,"'async' modifier cannot be used in an ambient context."):v&&li(this,si,ka).call(this,e,"Generators are not allowed in an ambient context."):!e.body&&v&&li(this,si,ka).call(this,e,"A function signature cannot be declared as a generator.");let b=this.createNode(e,{type:e.body?kt.FunctionDeclaration:kt.TSDeclareFunction,async:f,body:this.convertChild(e.body)||void 0,declare:p,expression:false,generator:v,id:this.convertChild(e.name),params:this.convertParameters(e.parameters),returnType:e.type&&this.convertTypeAnnotation(e.type,e),typeParameters:e.typeParameters&&this.convertTSTypeParametersToTypeParametersDeclaration(e.typeParameters)});return this.fixExports(e,b)}case Qe.VariableDeclaration:{let p=!!e.exclamationToken,f=this.convertChild(e.initializer),v=this.convertBindingNameWithTypeAnnotation(e.name,e.type,e);return p&&(f?li(this,si,ka).call(this,e,"Declarations with initializers cannot also have definite assignment assertions."):(v.type!==kt.Identifier||!v.typeAnnotation)&&li(this,si,ka).call(this,e,"Declarations with definite assignment assertions must also have type annotations.")),this.createNode(e,{type:kt.VariableDeclarator,definite:p,id:v,init:f})}case Qe.VariableStatement:{let p=this.createNode(e,{type:kt.VariableDeclaration,declarations:e.declarationList.declarations.map(f=>this.convertChild(f)),declare:gs(Qe.DeclareKeyword,e),kind:hse(e.declarationList)});return p.declarations.length||li(this,si,Sc).call(this,e,"A variable declaration list must have at least one variable declarator."),(p.kind==="using"||p.kind==="await using")&&e.declarationList.declarations.forEach((f,v)=>{p.declarations[v].init==null&&li(this,si,ka).call(this,f,`'${p.kind}' declarations must be initialized.`),p.declarations[v].id.type!==kt.Identifier&&li(this,si,ka).call(this,f.name,`'${p.kind}' declarations may not have binding patterns.`);}),(p.declare||["await using","const","using"].includes(p.kind))&&e.declarationList.declarations.forEach((f,v)=>{p.declarations[v].definite&&li(this,si,ka).call(this,f,"A definite assignment assertion '!' is not permitted in this context.");}),p.declare&&e.declarationList.declarations.forEach((f,v)=>{p.declarations[v].init&&(["let","var"].includes(p.kind)||p.declarations[v].id.typeAnnotation)&&li(this,si,ka).call(this,f,"Initializers are not permitted in ambient contexts.");}),this.fixExports(e,p)}case Qe.VariableDeclarationList:{let p=this.createNode(e,{type:kt.VariableDeclaration,declarations:e.declarations.map(f=>this.convertChild(f)),declare:false,kind:hse(e)});return (p.kind==="using"||p.kind==="await using")&&e.declarations.forEach((f,v)=>{p.declarations[v].init!=null&&li(this,si,ka).call(this,f,`'${p.kind}' declarations may not be initialized in for statement.`),p.declarations[v].id.type!==kt.Identifier&&li(this,si,ka).call(this,f.name,`'${p.kind}' declarations may not have binding patterns.`);}),p}case Qe.ExpressionStatement:return this.createNode(e,{type:kt.ExpressionStatement,directive:void 0,expression:this.convertChild(e.expression)});case Qe.ThisKeyword:return this.createNode(e,{type:kt.ThisExpression});case Qe.ArrayLiteralExpression:return this.allowPattern?this.createNode(e,{type:kt.ArrayPattern,decorators:[],elements:e.elements.map(p=>this.convertPattern(p)),optional:false,typeAnnotation:void 0}):this.createNode(e,{type:kt.ArrayExpression,elements:e.elements.map(p=>this.convertChild(p))});case Qe.ObjectLiteralExpression:{if(this.allowPattern)return this.createNode(e,{type:kt.ObjectPattern,decorators:[],optional:false,properties:e.properties.map(f=>this.convertPattern(f)),typeAnnotation:void 0});let p=[];for(let f of e.properties)(f.kind===Qe.GetAccessor||f.kind===Qe.SetAccessor||f.kind===Qe.MethodDeclaration)&&!f.body&&li(this,si,Sc).call(this,f.end-1,"'{' expected."),p.push(this.convertChild(f));return this.createNode(e,{type:kt.ObjectExpression,properties:p})}case Qe.PropertyAssignment:{let{exclamationToken:p,questionToken:f}=e;return f&&li(this,si,ka).call(this,f,"A property assignment cannot have a question token."),p&&li(this,si,ka).call(this,p,"A property assignment cannot have an exclamation token."),this.createNode(e,{type:kt.Property,computed:Rk(e.name),key:this.convertChild(e.name),kind:"init",method:false,optional:false,shorthand:false,value:this.converter(e.initializer,e,this.allowPattern)})}case Qe.ShorthandPropertyAssignment:{let{exclamationToken:p,modifiers:f,questionToken:v}=e;return f&&li(this,si,ka).call(this,f[0],"A shorthand property assignment cannot have modifiers."),v&&li(this,si,ka).call(this,v,"A shorthand property assignment cannot have a question token."),p&&li(this,si,ka).call(this,p,"A shorthand property assignment cannot have an exclamation token."),e.objectAssignmentInitializer?this.createNode(e,{type:kt.Property,computed:false,key:this.convertChild(e.name),kind:"init",method:false,optional:false,shorthand:true,value:this.createNode(e,{type:kt.AssignmentPattern,decorators:[],left:this.convertPattern(e.name),optional:false,right:this.convertChild(e.objectAssignmentInitializer),typeAnnotation:void 0})}):this.createNode(e,{type:kt.Property,computed:false,key:this.convertChild(e.name),kind:"init",method:false,optional:false,shorthand:true,value:this.convertChild(e.name)})}case Qe.ComputedPropertyName:return this.convertChild(e.expression);case Qe.PropertyDeclaration:{let p=gs(Qe.AbstractKeyword,e);p&&e.initializer&&li(this,si,ka).call(this,e.initializer,"Abstract property cannot have an initializer.");let f=gs(Qe.AccessorKeyword,e),v=f?p?kt.TSAbstractAccessorProperty:kt.AccessorProperty:p?kt.TSAbstractPropertyDefinition:kt.PropertyDefinition,b=this.convertChild(e.name);return this.createNode(e,{type:v,accessibility:oA(e),computed:Rk(e.name),declare:gs(Qe.DeclareKeyword,e),decorators:((i=$k(e))==null?void 0:i.map(C=>this.convertChild(C)))??[],definite:!!e.exclamationToken,key:b,optional:(b.type===kt.Literal||e.name.kind===Qe.Identifier||e.name.kind===Qe.ComputedPropertyName||e.name.kind===Qe.PrivateIdentifier)&&!!e.questionToken,override:gs(Qe.OverrideKeyword,e),readonly:gs(Qe.ReadonlyKeyword,e),static:gs(Qe.StaticKeyword,e),typeAnnotation:e.type&&this.convertTypeAnnotation(e.type,e),value:p?null:this.convertChild(e.initializer)})}case Qe.GetAccessor:case Qe.SetAccessor:if(e.parent.kind===Qe.InterfaceDeclaration||e.parent.kind===Qe.TypeLiteral)return this.convertMethodSignature(e);case Qe.MethodDeclaration:{let p=this.createNode(e,{type:e.body?kt.FunctionExpression:kt.TSEmptyBodyFunctionExpression,range:[e.parameters.pos-1,e.end],async:gs(Qe.AsyncKeyword,e),body:this.convertChild(e.body),declare:false,expression:false,generator:!!e.asteriskToken,id:null,params:[],returnType:e.type&&this.convertTypeAnnotation(e.type,e),typeParameters:e.typeParameters&&this.convertTSTypeParametersToTypeParametersDeclaration(e.typeParameters)});p.typeParameters&&this.fixParentLocation(p,p.typeParameters.range);let f;if(t.kind===Qe.ObjectLiteralExpression)p.params=e.parameters.map(v=>this.convertChild(v)),f=this.createNode(e,{type:kt.Property,computed:Rk(e.name),key:this.convertChild(e.name),kind:"init",method:e.kind===Qe.MethodDeclaration,optional:!!e.questionToken,shorthand:false,value:p});else {p.params=this.convertParameters(e.parameters);let v=gs(Qe.AbstractKeyword,e)?kt.TSAbstractMethodDefinition:kt.MethodDefinition;f=this.createNode(e,{type:v,accessibility:oA(e),computed:Rk(e.name),decorators:((a=$k(e))==null?void 0:a.map(b=>this.convertChild(b)))??[],key:this.convertChild(e.name),kind:"method",optional:!!e.questionToken,override:gs(Qe.OverrideKeyword,e),static:gs(Qe.StaticKeyword,e),value:p});}return e.kind===Qe.GetAccessor?f.kind="get":e.kind===Qe.SetAccessor?f.kind="set":!f.static&&e.name.kind===Qe.StringLiteral&&e.name.text==="constructor"&&f.type!==kt.Property&&(f.kind="constructor"),f}case Qe.Constructor:{let p=vYt(e),f=(p&&eb(p,e,this.ast))??e.getFirstToken(),v=this.createNode(e,{type:e.body?kt.FunctionExpression:kt.TSEmptyBodyFunctionExpression,range:[e.parameters.pos-1,e.end],async:false,body:this.convertChild(e.body),declare:false,expression:false,generator:false,id:null,params:this.convertParameters(e.parameters),returnType:e.type&&this.convertTypeAnnotation(e.type,e),typeParameters:e.typeParameters&&this.convertTSTypeParametersToTypeParametersDeclaration(e.typeParameters)});v.typeParameters&&this.fixParentLocation(v,v.typeParameters.range);let b=f.kind===Qe.StringLiteral?this.createNode(f,{type:kt.Literal,raw:f.getText(),value:"constructor"}):this.createNode(e,{type:kt.Identifier,range:[f.getStart(this.ast),f.end],decorators:[],name:"constructor",optional:false,typeAnnotation:void 0}),C=gs(Qe.StaticKeyword,e);return this.createNode(e,{type:gs(Qe.AbstractKeyword,e)?kt.TSAbstractMethodDefinition:kt.MethodDefinition,accessibility:oA(e),computed:false,decorators:[],key:b,kind:C?"method":"constructor",optional:false,override:false,static:C,value:v})}case Qe.FunctionExpression:return this.createNode(e,{type:kt.FunctionExpression,async:gs(Qe.AsyncKeyword,e),body:this.convertChild(e.body),declare:false,expression:false,generator:!!e.asteriskToken,id:this.convertChild(e.name),params:this.convertParameters(e.parameters),returnType:e.type&&this.convertTypeAnnotation(e.type,e),typeParameters:e.typeParameters&&this.convertTSTypeParametersToTypeParametersDeclaration(e.typeParameters)});case Qe.SuperKeyword:return this.createNode(e,{type:kt.Super});case Qe.ArrayBindingPattern:return this.createNode(e,{type:kt.ArrayPattern,decorators:[],elements:e.elements.map(p=>this.convertPattern(p)),optional:false,typeAnnotation:void 0});case Qe.OmittedExpression:return null;case Qe.ObjectBindingPattern:return this.createNode(e,{type:kt.ObjectPattern,decorators:[],optional:false,properties:e.elements.map(p=>this.convertPattern(p)),typeAnnotation:void 0});case Qe.BindingElement:{if(t.kind===Qe.ArrayBindingPattern){let f=this.convertChild(e.name,t);return e.initializer?this.createNode(e,{type:kt.AssignmentPattern,decorators:[],left:f,optional:false,right:this.convertChild(e.initializer),typeAnnotation:void 0}):e.dotDotDotToken?this.createNode(e,{type:kt.RestElement,argument:f,decorators:[],optional:false,typeAnnotation:void 0,value:void 0}):f}let p;return e.dotDotDotToken?p=this.createNode(e,{type:kt.RestElement,argument:this.convertChild(e.propertyName??e.name),decorators:[],optional:false,typeAnnotation:void 0,value:void 0}):p=this.createNode(e,{type:kt.Property,computed:!!(e.propertyName&&e.propertyName.kind===Qe.ComputedPropertyName),key:this.convertChild(e.propertyName??e.name),kind:"init",method:false,optional:false,shorthand:!e.propertyName,value:this.convertChild(e.name)}),e.initializer&&(p.value=this.createNode(e,{type:kt.AssignmentPattern,range:[e.name.getStart(this.ast),e.initializer.end],decorators:[],left:this.convertChild(e.name),optional:false,right:this.convertChild(e.initializer),typeAnnotation:void 0})),p}case Qe.ArrowFunction:return this.createNode(e,{type:kt.ArrowFunctionExpression,async:gs(Qe.AsyncKeyword,e),body:this.convertChild(e.body),expression:e.body.kind!==Qe.Block,generator:false,id:null,params:this.convertParameters(e.parameters),returnType:e.type&&this.convertTypeAnnotation(e.type,e),typeParameters:e.typeParameters&&this.convertTSTypeParametersToTypeParametersDeclaration(e.typeParameters)});case Qe.YieldExpression:return this.createNode(e,{type:kt.YieldExpression,argument:this.convertChild(e.expression),delegate:!!e.asteriskToken});case Qe.AwaitExpression:return this.createNode(e,{type:kt.AwaitExpression,argument:this.convertChild(e.expression)});case Qe.NoSubstitutionTemplateLiteral:return this.createNode(e,{type:kt.TemplateLiteral,expressions:[],quasis:[this.createNode(e,{type:kt.TemplateElement,tail:true,value:{cooked:e.text,raw:this.ast.text.slice(e.getStart(this.ast)+1,e.end-1)}})]});case Qe.TemplateExpression:{let p=this.createNode(e,{type:kt.TemplateLiteral,expressions:[],quasis:[this.convertChild(e.head)]});return e.templateSpans.forEach(f=>{p.expressions.push(this.convertChild(f.expression)),p.quasis.push(this.convertChild(f.literal));}),p}case Qe.TaggedTemplateExpression:return this.createNode(e,{type:kt.TaggedTemplateExpression,quasi:this.convertChild(e.template),tag:this.convertChild(e.tag),typeArguments:e.typeArguments&&this.convertTypeArgumentsToTypeParameterInstantiation(e.typeArguments,e)});case Qe.TemplateHead:case Qe.TemplateMiddle:case Qe.TemplateTail:{let p=e.kind===Qe.TemplateTail;return this.createNode(e,{type:kt.TemplateElement,tail:p,value:{cooked:e.text,raw:this.ast.text.slice(e.getStart(this.ast)+1,e.end-(p?1:2))}})}case Qe.SpreadAssignment:case Qe.SpreadElement:return this.allowPattern?this.createNode(e,{type:kt.RestElement,argument:this.convertPattern(e.expression),decorators:[],optional:false,typeAnnotation:void 0,value:void 0}):this.createNode(e,{type:kt.SpreadElement,argument:this.convertChild(e.expression)});case Qe.Parameter:{let p,f;return e.dotDotDotToken?p=f=this.createNode(e,{type:kt.RestElement,argument:this.convertChild(e.name),decorators:[],optional:false,typeAnnotation:void 0,value:void 0}):e.initializer?(p=this.convertChild(e.name),f=this.createNode(e,{type:kt.AssignmentPattern,range:[e.name.getStart(this.ast),e.initializer.end],decorators:[],left:p,optional:false,right:this.convertChild(e.initializer),typeAnnotation:void 0}),ib(e)&&(f.range[0]=p.range[0],f.loc=cA(f.range,this.ast))):p=f=this.convertChild(e.name,t),e.type&&(p.typeAnnotation=this.convertTypeAnnotation(e.type,e),this.fixParentLocation(p,p.typeAnnotation.range)),e.questionToken&&(e.questionToken.end>p.range[1]&&(p.range[1]=e.questionToken.end,p.loc.end=nU(p.range[1],this.ast)),p.optional=true),ib(e)?this.createNode(e,{type:kt.TSParameterProperty,accessibility:oA(e),decorators:[],override:gs(Qe.OverrideKeyword,e),parameter:f,readonly:gs(Qe.ReadonlyKeyword,e),static:gs(Qe.StaticKeyword,e)}):f}case Qe.ClassDeclaration:!e.name&&(!gs(Ca.ExportKeyword,e)||!gs(Ca.DefaultKeyword,e))&&li(this,si,Sc).call(this,e,"A class declaration without the 'default' modifier must have a name.");case Qe.ClassExpression:{let p=e.heritageClauses??[],f=e.kind===Qe.ClassDeclaration?kt.ClassDeclaration:kt.ClassExpression,v,b;for(let P of p){let{token:U,types:$}=P;$.length===0&&li(this,si,Sc).call(this,P,`'${tu(U)}' list cannot be empty.`),U===Qe.ExtendsKeyword?(v&&li(this,si,Sc).call(this,P,"'extends' clause already seen."),b&&li(this,si,Sc).call(this,P,"'extends' clause must precede 'implements' clause."),$.length>1&&li(this,si,Sc).call(this,$[1],"Classes can only extend a single class."),v??(v=P)):U===Qe.ImplementsKeyword&&(b&&li(this,si,Sc).call(this,P,"'implements' clause already seen."),b??(b=P));}let C=this.createNode(e,{type:f,abstract:gs(Qe.AbstractKeyword,e),body:this.createNode(e,{type:kt.ClassBody,range:[e.members.pos-1,e.end],body:e.members.filter(gYt).map(P=>this.convertChild(P))}),declare:gs(Qe.DeclareKeyword,e),decorators:((o=$k(e))==null?void 0:o.map(P=>this.convertChild(P)))??[],id:this.convertChild(e.name),implements:b?.types.map(P=>this.convertChild(P))??[],superClass:v!=null&&v.types[0]?this.convertChild(v.types[0].expression):null,superTypeArguments:void 0,typeParameters:e.typeParameters&&this.convertTSTypeParametersToTypeParametersDeclaration(e.typeParameters)});return (u=v?.types[0])!=null&&u.typeArguments&&(C.superTypeArguments=this.convertTypeArgumentsToTypeParameterInstantiation(v.types[0].typeArguments,v.types[0])),this.fixExports(e,C)}case Qe.ModuleBlock:return this.createNode(e,{type:kt.TSModuleBlock,body:this.convertBodyExpressions(e.statements,e)});case Qe.ImportDeclaration:{this.assertModuleSpecifier(e,false);let p=this.createNode(e,li(this,si,Vk).call(this,{type:kt.ImportDeclaration,attributes:this.convertImportAttributes(e.attributes??e.assertClause),importKind:"value",source:this.convertChild(e.moduleSpecifier),specifiers:[]},"assertions","attributes",true));if(e.importClause&&(e.importClause.isTypeOnly&&(p.importKind="type"),e.importClause.name&&p.specifiers.push(this.convertChild(e.importClause)),e.importClause.namedBindings))switch(e.importClause.namedBindings.kind){case Qe.NamespaceImport:p.specifiers.push(this.convertChild(e.importClause.namedBindings));break;case Qe.NamedImports:p.specifiers.push(...e.importClause.namedBindings.elements.map(f=>this.convertChild(f)));break}return p}case Qe.NamespaceImport:return this.createNode(e,{type:kt.ImportNamespaceSpecifier,local:this.convertChild(e.name)});case Qe.ImportSpecifier:return this.createNode(e,{type:kt.ImportSpecifier,imported:this.convertChild(e.propertyName??e.name),importKind:e.isTypeOnly?"type":"value",local:this.convertChild(e.name)});case Qe.ImportClause:{let p=this.convertChild(e.name);return this.createNode(e,{type:kt.ImportDefaultSpecifier,range:p.range,local:p})}case Qe.ExportDeclaration:return ((c=e.exportClause)==null?void 0:c.kind)===Qe.NamedExports?(this.assertModuleSpecifier(e,true),this.createNode(e,li(this,si,Vk).call(this,{type:kt.ExportNamedDeclaration,attributes:this.convertImportAttributes(e.attributes??e.assertClause),declaration:null,exportKind:e.isTypeOnly?"type":"value",source:this.convertChild(e.moduleSpecifier),specifiers:e.exportClause.elements.map(p=>this.convertChild(p,e))},"assertions","attributes",true))):(this.assertModuleSpecifier(e,false),this.createNode(e,li(this,si,Vk).call(this,{type:kt.ExportAllDeclaration,attributes:this.convertImportAttributes(e.attributes??e.assertClause),exported:((l=e.exportClause)==null?void 0:l.kind)===Qe.NamespaceExport?this.convertChild(e.exportClause.name):null,exportKind:e.isTypeOnly?"type":"value",source:this.convertChild(e.moduleSpecifier)},"assertions","attributes",true)));case Qe.ExportSpecifier:{let p=e.propertyName??e.name;return p.kind===Qe.StringLiteral&&t.kind===Qe.ExportDeclaration&&((h=t.moduleSpecifier)==null?void 0:h.kind)!==Qe.StringLiteral&&li(this,si,ka).call(this,p,"A string literal cannot be used as a local exported binding without `from`."),this.createNode(e,{type:kt.ExportSpecifier,exported:this.convertChild(e.name),exportKind:e.isTypeOnly?"type":"value",local:this.convertChild(p)})}case Qe.ExportAssignment:return e.isExportEquals?this.createNode(e,{type:kt.TSExportAssignment,expression:this.convertChild(e.expression)}):this.createNode(e,{type:kt.ExportDefaultDeclaration,declaration:this.convertChild(e.expression),exportKind:"value"});case Qe.PrefixUnaryExpression:case Qe.PostfixUnaryExpression:{let p=R4(e.operator);return p==="++"||p==="--"?(roe(e.operand)||li(this,si,Sc).call(this,e.operand,"Invalid left-hand side expression in unary operation"),this.createNode(e,{type:kt.UpdateExpression,argument:this.convertChild(e.operand),operator:p,prefix:e.kind===Qe.PrefixUnaryExpression})):this.createNode(e,{type:kt.UnaryExpression,argument:this.convertChild(e.operand),operator:p,prefix:e.kind===Qe.PrefixUnaryExpression})}case Qe.DeleteExpression:return this.createNode(e,{type:kt.UnaryExpression,argument:this.convertChild(e.expression),operator:"delete",prefix:true});case Qe.VoidExpression:return this.createNode(e,{type:kt.UnaryExpression,argument:this.convertChild(e.expression),operator:"void",prefix:true});case Qe.TypeOfExpression:return this.createNode(e,{type:kt.UnaryExpression,argument:this.convertChild(e.expression),operator:"typeof",prefix:true});case Qe.TypeOperator:return this.createNode(e,{type:kt.TSTypeOperator,operator:R4(e.operator),typeAnnotation:this.convertChild(e.type)});case Qe.BinaryExpression:{if(bYt(e.operatorToken)){let f=this.createNode(e,{type:kt.SequenceExpression,expressions:[]}),v=this.convertChild(e.left);return v.type===kt.SequenceExpression&&e.left.kind!==Qe.ParenthesizedExpression?f.expressions.push(...v.expressions):f.expressions.push(v),f.expressions.push(this.convertChild(e.right)),f}let p=EYt(e.operatorToken);return this.allowPattern&&p.type===kt.AssignmentExpression?this.createNode(e,{type:kt.AssignmentPattern,decorators:[],left:this.convertPattern(e.left,e),optional:false,right:this.convertChild(e.right),typeAnnotation:void 0}):this.createNode(e,{...p,left:this.converter(e.left,e,p.type===kt.AssignmentExpression),right:this.convertChild(e.right)})}case Qe.PropertyAccessExpression:{let p=this.convertChild(e.expression),f=this.convertChild(e.name),v=this.createNode(e,{type:kt.MemberExpression,computed:false,object:p,optional:e.questionDotToken!=null,property:f});return this.convertChainExpression(v,e)}case Qe.ElementAccessExpression:{let p=this.convertChild(e.expression),f=this.convertChild(e.argumentExpression),v=this.createNode(e,{type:kt.MemberExpression,computed:true,object:p,optional:e.questionDotToken!=null,property:f});return this.convertChainExpression(v,e)}case Qe.CallExpression:{if(e.expression.kind===Qe.ImportKeyword)return e.arguments.length!==1&&e.arguments.length!==2&&li(this,si,Sc).call(this,e.arguments[2]??e,"Dynamic import requires exactly one or two arguments."),this.createNode(e,li(this,si,Vk).call(this,{type:kt.ImportExpression,options:e.arguments[1]?this.convertChild(e.arguments[1]):null,source:this.convertChild(e.arguments[0])},"attributes","options",true));let p=this.convertChild(e.expression),f=e.arguments.map(C=>this.convertChild(C)),v=e.typeArguments&&this.convertTypeArgumentsToTypeParameterInstantiation(e.typeArguments,e),b=this.createNode(e,{type:kt.CallExpression,arguments:f,callee:p,optional:e.questionDotToken!=null,typeArguments:v});return this.convertChainExpression(b,e)}case Qe.NewExpression:{let p=e.typeArguments&&this.convertTypeArgumentsToTypeParameterInstantiation(e.typeArguments,e);return this.createNode(e,{type:kt.NewExpression,arguments:e.arguments?e.arguments.map(f=>this.convertChild(f)):[],callee:this.convertChild(e.expression),typeArguments:p})}case Qe.ConditionalExpression:return this.createNode(e,{type:kt.ConditionalExpression,alternate:this.convertChild(e.whenFalse),consequent:this.convertChild(e.whenTrue),test:this.convertChild(e.condition)});case Qe.MetaProperty:return this.createNode(e,{type:kt.MetaProperty,meta:this.createNode(e.getFirstToken(),{type:kt.Identifier,decorators:[],name:R4(e.keywordToken),optional:false,typeAnnotation:void 0}),property:this.convertChild(e.name)});case Qe.Decorator:return this.createNode(e,{type:kt.Decorator,expression:this.convertChild(e.expression)});case Qe.StringLiteral:return this.createNode(e,{type:kt.Literal,raw:e.getText(),value:t.kind===Qe.JsxAttribute?zAe(e.text):e.text});case Qe.NumericLiteral:return this.createNode(e,{type:kt.Literal,raw:e.getText(),value:Number(e.text)});case Qe.BigIntLiteral:{let p=Lk(e,this.ast),f=this.ast.text.slice(p[0],p[1]),v=Jk(false,f.slice(0,-1),"_",""),b=typeof BigInt<"u"?BigInt(v):null;return this.createNode(e,{type:kt.Literal,range:p,bigint:b==null?v:String(b),raw:f,value:b})}case Qe.RegularExpressionLiteral:{let p=e.text.slice(1,e.text.lastIndexOf("/")),f=e.text.slice(e.text.lastIndexOf("/")+1),v=null;try{v=new RegExp(p,f);}catch{}return this.createNode(e,{type:kt.Literal,raw:e.text,regex:{flags:f,pattern:p},value:v})}case Qe.TrueKeyword:return this.createNode(e,{type:kt.Literal,raw:"true",value:true});case Qe.FalseKeyword:return this.createNode(e,{type:kt.Literal,raw:"false",value:false});case Qe.NullKeyword:return this.createNode(e,{type:kt.Literal,raw:"null",value:null});case Qe.EmptyStatement:return this.createNode(e,{type:kt.EmptyStatement});case Qe.DebuggerStatement:return this.createNode(e,{type:kt.DebuggerStatement});case Qe.JsxElement:return this.createNode(e,{type:kt.JSXElement,children:e.children.map(p=>this.convertChild(p)),closingElement:this.convertChild(e.closingElement),openingElement:this.convertChild(e.openingElement)});case Qe.JsxFragment:return this.createNode(e,{type:kt.JSXFragment,children:e.children.map(p=>this.convertChild(p)),closingFragment:this.convertChild(e.closingFragment),openingFragment:this.convertChild(e.openingFragment)});case Qe.JsxSelfClosingElement:return this.createNode(e,{type:kt.JSXElement,children:[],closingElement:null,openingElement:this.createNode(e,{type:kt.JSXOpeningElement,range:Lk(e,this.ast),attributes:e.attributes.properties.map(p=>this.convertChild(p)),name:this.convertJSXTagName(e.tagName,e),selfClosing:true,typeArguments:e.typeArguments?this.convertTypeArgumentsToTypeParameterInstantiation(e.typeArguments,e):void 0})});case Qe.JsxOpeningElement:return this.createNode(e,{type:kt.JSXOpeningElement,attributes:e.attributes.properties.map(p=>this.convertChild(p)),name:this.convertJSXTagName(e.tagName,e),selfClosing:false,typeArguments:e.typeArguments&&this.convertTypeArgumentsToTypeParameterInstantiation(e.typeArguments,e)});case Qe.JsxClosingElement:return this.createNode(e,{type:kt.JSXClosingElement,name:this.convertJSXTagName(e.tagName,e)});case Qe.JsxOpeningFragment:return this.createNode(e,{type:kt.JSXOpeningFragment});case Qe.JsxClosingFragment:return this.createNode(e,{type:kt.JSXClosingFragment});case Qe.JsxExpression:{let p=e.expression?this.convertChild(e.expression):this.createNode(e,{type:kt.JSXEmptyExpression,range:[e.getStart(this.ast)+1,e.getEnd()-1]});return e.dotDotDotToken?this.createNode(e,{type:kt.JSXSpreadChild,expression:p}):this.createNode(e,{type:kt.JSXExpressionContainer,expression:p})}case Qe.JsxAttribute:return this.createNode(e,{type:kt.JSXAttribute,name:this.convertJSXNamespaceOrIdentifier(e.name),value:this.convertChild(e.initializer)});case Qe.JsxText:{let p=e.getFullStart(),f=e.getEnd(),v=this.ast.text.slice(p,f);return this.createNode(e,{type:kt.JSXText,range:[p,f],raw:v,value:zAe(v)})}case Qe.JsxSpreadAttribute:return this.createNode(e,{type:kt.JSXSpreadAttribute,argument:this.convertChild(e.expression)});case Qe.QualifiedName:return this.createNode(e,{type:kt.TSQualifiedName,left:this.convertChild(e.left),right:this.convertChild(e.right)});case Qe.TypeReference:return this.createNode(e,{type:kt.TSTypeReference,typeArguments:e.typeArguments&&this.convertTypeArgumentsToTypeParameterInstantiation(e.typeArguments,e),typeName:this.convertChild(e.typeName)});case Qe.TypeParameter:return this.createNode(e,{type:kt.TSTypeParameter,const:gs(Qe.ConstKeyword,e),constraint:e.constraint&&this.convertChild(e.constraint),default:e.default?this.convertChild(e.default):void 0,in:gs(Qe.InKeyword,e),name:this.convertChild(e.name),out:gs(Qe.OutKeyword,e)});case Qe.ThisType:return this.createNode(e,{type:kt.TSThisType});case Qe.AnyKeyword:case Qe.BigIntKeyword:case Qe.BooleanKeyword:case Qe.NeverKeyword:case Qe.NumberKeyword:case Qe.ObjectKeyword:case Qe.StringKeyword:case Qe.SymbolKeyword:case Qe.UnknownKeyword:case Qe.VoidKeyword:case Qe.UndefinedKeyword:case Qe.IntrinsicKeyword:return this.createNode(e,{type:kt[`TS${Qe[e.kind]}`]});case Qe.NonNullExpression:{let p=this.createNode(e,{type:kt.TSNonNullExpression,expression:this.convertChild(e.expression)});return this.convertChainExpression(p,e)}case Qe.TypeLiteral:return this.createNode(e,{type:kt.TSTypeLiteral,members:e.members.map(p=>this.convertChild(p))});case Qe.ArrayType:return this.createNode(e,{type:kt.TSArrayType,elementType:this.convertChild(e.elementType)});case Qe.IndexedAccessType:return this.createNode(e,{type:kt.TSIndexedAccessType,indexType:this.convertChild(e.indexType),objectType:this.convertChild(e.objectType)});case Qe.ConditionalType:return this.createNode(e,{type:kt.TSConditionalType,checkType:this.convertChild(e.checkType),extendsType:this.convertChild(e.extendsType),falseType:this.convertChild(e.falseType),trueType:this.convertChild(e.trueType)});case Qe.TypeQuery:return this.createNode(e,{type:kt.TSTypeQuery,exprName:this.convertChild(e.exprName),typeArguments:e.typeArguments&&this.convertTypeArgumentsToTypeParameterInstantiation(e.typeArguments,e)});case Qe.MappedType:return e.members&&e.members.length>0&&li(this,si,Sc).call(this,e.members[0],"A mapped type may not declare properties or methods."),this.createNode(e,li(this,si,yse).call(this,{type:kt.TSMappedType,constraint:this.convertChild(e.typeParameter.constraint),key:this.convertChild(e.typeParameter.name),nameType:this.convertChild(e.nameType)??null,optional:e.questionToken?e.questionToken.kind===Qe.QuestionToken||R4(e.questionToken.kind):false,readonly:e.readonlyToken?e.readonlyToken.kind===Qe.ReadonlyKeyword||R4(e.readonlyToken.kind):void 0,typeAnnotation:e.type&&this.convertChild(e.type)},"typeParameter","'constraint' and 'key'",this.convertChild(e.typeParameter)));case Qe.ParenthesizedExpression:return this.convertChild(e.expression,t);case Qe.TypeAliasDeclaration:{let p=this.createNode(e,{type:kt.TSTypeAliasDeclaration,declare:gs(Qe.DeclareKeyword,e),id:this.convertChild(e.name),typeAnnotation:this.convertChild(e.type),typeParameters:e.typeParameters&&this.convertTSTypeParametersToTypeParametersDeclaration(e.typeParameters)});return this.fixExports(e,p)}case Qe.MethodSignature:return this.convertMethodSignature(e);case Qe.PropertySignature:{let{initializer:p}=e;return p&&li(this,si,ka).call(this,p,"A property signature cannot have an initializer."),this.createNode(e,{type:kt.TSPropertySignature,accessibility:oA(e),computed:Rk(e.name),key:this.convertChild(e.name),optional:HAe(e),readonly:gs(Qe.ReadonlyKeyword,e),static:gs(Qe.StaticKeyword,e),typeAnnotation:e.type&&this.convertTypeAnnotation(e.type,e)})}case Qe.IndexSignature:return this.createNode(e,{type:kt.TSIndexSignature,accessibility:oA(e),parameters:e.parameters.map(p=>this.convertChild(p)),readonly:gs(Qe.ReadonlyKeyword,e),static:gs(Qe.StaticKeyword,e),typeAnnotation:e.type&&this.convertTypeAnnotation(e.type,e)});case Qe.ConstructorType:return this.createNode(e,{type:kt.TSConstructorType,abstract:gs(Qe.AbstractKeyword,e),params:this.convertParameters(e.parameters),returnType:e.type&&this.convertTypeAnnotation(e.type,e),typeParameters:e.typeParameters&&this.convertTSTypeParametersToTypeParametersDeclaration(e.typeParameters)});case Qe.FunctionType:{let{modifiers:p}=e;p&&li(this,si,ka).call(this,p[0],"A function type cannot have modifiers.");}case Qe.ConstructSignature:case Qe.CallSignature:{let p=e.kind===Qe.ConstructSignature?kt.TSConstructSignatureDeclaration:e.kind===Qe.CallSignature?kt.TSCallSignatureDeclaration:kt.TSFunctionType;return this.createNode(e,{type:p,params:this.convertParameters(e.parameters),returnType:e.type&&this.convertTypeAnnotation(e.type,e),typeParameters:e.typeParameters&&this.convertTSTypeParametersToTypeParametersDeclaration(e.typeParameters)})}case Qe.ExpressionWithTypeArguments:{let p=t.kind,f=p===Qe.InterfaceDeclaration?kt.TSInterfaceHeritage:p===Qe.HeritageClause?kt.TSClassImplements:kt.TSInstantiationExpression;return this.createNode(e,{type:f,expression:this.convertChild(e.expression),typeArguments:e.typeArguments&&this.convertTypeArgumentsToTypeParameterInstantiation(e.typeArguments,e)})}case Qe.InterfaceDeclaration:{let p=e.heritageClauses??[],f=[],v=false;for(let C of p){C.token!==Qe.ExtendsKeyword&&li(this,si,ka).call(this,C,C.token===Qe.ImplementsKeyword?"Interface declaration cannot have 'implements' clause.":"Unexpected token."),v&&li(this,si,ka).call(this,C,"'extends' clause already seen."),v=true;for(let P of C.types)(!ake(P.expression)||rHt(P.expression))&&li(this,si,ka).call(this,P,"Interface declaration can only extend an identifier/qualified name with optional type arguments."),f.push(this.convertChild(P,e));}let b=this.createNode(e,{type:kt.TSInterfaceDeclaration,body:this.createNode(e,{type:kt.TSInterfaceBody,range:[e.members.pos-1,e.end],body:e.members.map(C=>this.convertChild(C))}),declare:gs(Qe.DeclareKeyword,e),extends:f,id:this.convertChild(e.name),typeParameters:e.typeParameters&&this.convertTSTypeParametersToTypeParametersDeclaration(e.typeParameters)});return this.fixExports(e,b)}case Qe.TypePredicate:{let p=this.createNode(e,{type:kt.TSTypePredicate,asserts:e.assertsModifier!=null,parameterName:this.convertChild(e.parameterName),typeAnnotation:null});return e.type&&(p.typeAnnotation=this.convertTypeAnnotation(e.type,e),p.typeAnnotation.loc=p.typeAnnotation.typeAnnotation.loc,p.typeAnnotation.range=p.typeAnnotation.typeAnnotation.range),p}case Qe.ImportType:{let p=Lk(e,this.ast);if(e.isTypeOf){let b=eb(e.getFirstToken(),e,this.ast);p[0]=b.getStart(this.ast);}let f=null;if(e.attributes){let b=this.createNode(e.attributes,{type:kt.ObjectExpression,properties:e.attributes.elements.map(O=>this.createNode(O,{type:kt.Property,computed:false,key:this.convertChild(O.name),kind:"init",method:false,optional:false,shorthand:false,value:this.convertChild(O.value)}))}),C=eb(e.argument,e,this.ast),P=eb(C,e,this.ast),U=eb(e.attributes,e,this.ast),$=eb(P,e,this.ast),S=Lk($,this.ast),T=$.kind===Ca.AssertKeyword?"assert":"with";f=this.createNode(e,{type:kt.ObjectExpression,range:[P.getStart(this.ast),U.end],properties:[this.createNode(e,{type:kt.Property,range:[S[0],e.attributes.end],computed:false,key:this.createNode(e,{type:kt.Identifier,range:S,decorators:[],name:T,optional:false,typeAnnotation:void 0}),kind:"init",method:false,optional:false,shorthand:false,value:b})]});}let v=this.createNode(e,{type:kt.TSImportType,range:p,argument:this.convertChild(e.argument),options:f,qualifier:this.convertChild(e.qualifier),typeArguments:e.typeArguments?this.convertTypeArgumentsToTypeParameterInstantiation(e.typeArguments,e):null});return e.isTypeOf?this.createNode(e,{type:kt.TSTypeQuery,exprName:v,typeArguments:void 0}):v}case Qe.EnumDeclaration:{let p=e.members.map(v=>this.convertChild(v)),f=this.createNode(e,li(this,si,yse).call(this,{type:kt.TSEnumDeclaration,body:this.createNode(e,{type:kt.TSEnumBody,range:[e.members.pos-1,e.end],members:p}),const:gs(Qe.ConstKeyword,e),declare:gs(Qe.DeclareKeyword,e),id:this.convertChild(e.name)},"members","'body.members'",e.members.map(v=>this.convertChild(v))));return this.fixExports(e,f)}case Qe.EnumMember:return this.createNode(e,{type:kt.TSEnumMember,computed:e.name.kind===Ca.ComputedPropertyName,id:this.convertChild(e.name),initializer:e.initializer&&this.convertChild(e.initializer)});case Qe.ModuleDeclaration:{let p=gs(Qe.DeclareKeyword,e),f=this.createNode(e,{type:kt.TSModuleDeclaration,...(()=>{if(e.flags&Kh.GlobalAugmentation){let b=this.convertChild(e.name),C=this.convertChild(e.body);return (C==null||C.type===kt.TSModuleDeclaration)&&li(this,si,Sc).call(this,e.body??e,"Expected a valid module body"),b.type!==kt.Identifier&&li(this,si,Sc).call(this,e.name,"global module augmentation must have an Identifier id"),{body:C,declare:false,global:false,id:b,kind:"global"}}if(Qk(e.name)){let b=this.convertChild(e.body);return {kind:"module",...b!=null?{body:b}:{},declare:false,global:false,id:this.convertChild(e.name)}}e.body==null&&li(this,si,Sc).call(this,e,"Expected a module body"),e.name.kind!==Ca.Identifier&&li(this,si,Sc).call(this,e.name,"`namespace`s must have an Identifier id");let v=this.createNode(e.name,{type:kt.Identifier,range:[e.name.getStart(this.ast),e.name.getEnd()],decorators:[],name:e.name.text,optional:false,typeAnnotation:void 0});for(;e.body&&nN(e.body)&&e.body.name;){e=e.body,p||(p=gs(Qe.DeclareKeyword,e));let b=e.name,C=this.createNode(b,{type:kt.Identifier,range:[b.getStart(this.ast),b.getEnd()],decorators:[],name:b.text,optional:false,typeAnnotation:void 0});v=this.createNode(b,{type:kt.TSQualifiedName,range:[v.range[0],C.range[1]],left:v,right:C});}return {body:this.convertChild(e.body),declare:false,global:false,id:v,kind:e.flags&Kh.Namespace?"namespace":"module"}})()});return f.declare=p,e.flags&Kh.GlobalAugmentation&&(f.global=true),this.fixExports(e,f)}case Qe.ParenthesizedType:return this.convertChild(e.type);case Qe.UnionType:return this.createNode(e,{type:kt.TSUnionType,types:e.types.map(p=>this.convertChild(p))});case Qe.IntersectionType:return this.createNode(e,{type:kt.TSIntersectionType,types:e.types.map(p=>this.convertChild(p))});case Qe.AsExpression:return this.createNode(e,{type:kt.TSAsExpression,expression:this.convertChild(e.expression),typeAnnotation:this.convertChild(e.type)});case Qe.InferType:return this.createNode(e,{type:kt.TSInferType,typeParameter:this.convertChild(e.typeParameter)});case Qe.LiteralType:return e.literal.kind===Qe.NullKeyword?this.createNode(e.literal,{type:kt.TSNullKeyword}):this.createNode(e,{type:kt.TSLiteralType,literal:this.convertChild(e.literal)});case Qe.TypeAssertionExpression:return this.createNode(e,{type:kt.TSTypeAssertion,expression:this.convertChild(e.expression),typeAnnotation:this.convertChild(e.type)});case Qe.ImportEqualsDeclaration:return this.fixExports(e,this.createNode(e,{type:kt.TSImportEqualsDeclaration,id:this.convertChild(e.name),importKind:e.isTypeOnly?"type":"value",moduleReference:this.convertChild(e.moduleReference)}));case Qe.ExternalModuleReference:return e.expression.kind!==Qe.StringLiteral&&li(this,si,ka).call(this,e.expression,"String literal expected."),this.createNode(e,{type:kt.TSExternalModuleReference,expression:this.convertChild(e.expression)});case Qe.NamespaceExportDeclaration:return this.createNode(e,{type:kt.TSNamespaceExportDeclaration,id:this.convertChild(e.name)});case Qe.AbstractKeyword:return this.createNode(e,{type:kt.TSAbstractKeyword});case Qe.TupleType:{let p=e.elements.map(f=>this.convertChild(f));return this.createNode(e,{type:kt.TSTupleType,elementTypes:p})}case Qe.NamedTupleMember:{let p=this.createNode(e,{type:kt.TSNamedTupleMember,elementType:this.convertChild(e.type,e),label:this.convertChild(e.name,e),optional:e.questionToken!=null});return e.dotDotDotToken?(p.range[0]=p.label.range[0],p.loc.start=p.label.loc.start,this.createNode(e,{type:kt.TSRestType,typeAnnotation:p})):p}case Qe.OptionalType:return this.createNode(e,{type:kt.TSOptionalType,typeAnnotation:this.convertChild(e.type)});case Qe.RestType:return this.createNode(e,{type:kt.TSRestType,typeAnnotation:this.convertChild(e.type)});case Qe.TemplateLiteralType:{let p=this.createNode(e,{type:kt.TSTemplateLiteralType,quasis:[this.convertChild(e.head)],types:[]});return e.templateSpans.forEach(f=>{p.types.push(this.convertChild(f.type)),p.quasis.push(this.convertChild(f.literal));}),p}case Qe.ClassStaticBlockDeclaration:return this.createNode(e,{type:kt.StaticBlock,body:this.convertBodyExpressions(e.body.statements,e)});case Qe.AssertEntry:case Qe.ImportAttribute:return this.createNode(e,{type:kt.ImportAttribute,key:this.convertChild(e.name),value:this.convertChild(e.value)});case Qe.SatisfiesExpression:return this.createNode(e,{type:kt.TSSatisfiesExpression,expression:this.convertChild(e.expression),typeAnnotation:this.convertChild(e.type)});default:return this.deeplyCopy(e)}}createNode(e,t){let r=t;return r.range??(r.range=Lk(e,this.ast)),r.loc??(r.loc=cA(r.range,this.ast)),r&&this.options.shouldPreserveNodeMaps&&this.esTreeNodeToTSNodeMap.set(r,e),r}convertProgram(){return this.converter(this.ast)}deeplyCopy(e){e.kind===Ca.JSDocFunctionType&&li(this,si,ka).call(this,e,"JSDoc types can only be used inside documentation comments.");let t=`TS${Qe[e.kind]}`;if(this.options.errorOnUnknownASTType&&!kt[t])throw new Error(`Unknown AST_NODE_TYPE: "${t}"`);let r=this.createNode(e,{type:t});"type"in e&&(r.typeAnnotation=e.type&&"kind"in e.type&&fHt(e.type)?this.convertTypeAnnotation(e.type,e):null),"typeArguments"in e&&(r.typeArguments=e.typeArguments&&"pos"in e.typeArguments?this.convertTypeArgumentsToTypeParameterInstantiation(e.typeArguments,e):null),"typeParameters"in e&&(r.typeParameters=e.typeParameters&&"pos"in e.typeParameters?this.convertTSTypeParametersToTypeParametersDeclaration(e.typeParameters):null);let i=$k(e);i!=null&&i.length&&(r.decorators=i.map(o=>this.convertChild(o)));let a=new Set(["_children","decorators","end","flags","heritageClauses","illegalDecorators","jsDoc","kind","locals","localSymbol","modifierFlagsCache","modifiers","nextContainer","parent","pos","symbol","transformFlags","type","typeArguments","typeParameters"]);return Object.entries(e).filter(([o])=>!a.has(o)).forEach(([o,u])=>{Array.isArray(u)?r[o]=u.map(c=>this.convertChild(c)):u&&typeof u=="object"&&u.kind?r[o]=this.convertChild(u):r[o]=u;}),r}fixExports(e,t){let r=nN(e)&&!Qk(e.name)?JYt(e):ib(e);if(r?.[0].kind===Qe.ExportKeyword){this.registerTSNodeInNodeMap(e,t);let i=r[0],a=r[1],o=a?.kind===Qe.DefaultKeyword,u=o?eb(a,this.ast,this.ast):eb(i,this.ast,this.ast);if(t.range[0]=u.getStart(this.ast),t.loc=cA(t.range,this.ast),o)return this.createNode(e,{type:kt.ExportDefaultDeclaration,range:[i.getStart(this.ast),t.range[1]],declaration:t,exportKind:"value"});let c=t.type===kt.TSInterfaceDeclaration||t.type===kt.TSTypeAliasDeclaration,l="declare"in t&&t.declare;return this.createNode(e,li(this,si,Vk).call(this,{type:kt.ExportNamedDeclaration,range:[i.getStart(this.ast),t.range[1]],attributes:[],declaration:t,exportKind:c||l?"type":"value",source:null,specifiers:[]},"assertions","attributes",true))}return t}getASTMaps(){return {esTreeNodeToTSNodeMap:this.esTreeNodeToTSNodeMap,tsNodeToESTreeNodeMap:this.tsNodeToESTreeNodeMap}}registerTSNodeInNodeMap(e,t){t&&this.options.shouldPreserveNodeMaps&&!this.tsNodeToESTreeNodeMap.has(e)&&this.tsNodeToESTreeNodeMap.set(e,t);}};si=new WeakSet,mse=function(e,t){let r=t===Ca.ForInStatement?"for...in":"for...of";if(KKt(e)){e.declarations.length!==1&&li(this,si,ka).call(this,e,`Only a single variable declaration is allowed in a '${r}' statement.`);let i=e.declarations[0];i.initializer?li(this,si,ka).call(this,i,`The variable declaration of a '${r}' statement cannot have an initializer.`):i.type&&li(this,si,ka).call(this,i,`The variable declaration of a '${r}' statement cannot have a type annotation.`),t===Ca.ForInStatement&&e.flags&Kh.Using&&li(this,si,ka).call(this,e,"The left-hand side of a 'for...in' statement cannot be a 'using' declaration.");}else !roe(e)&&e.kind!==Ca.ObjectLiteralExpression&&e.kind!==Ca.ArrayLiteralExpression&&li(this,si,ka).call(this,e,`The left-hand side of a '${r}' statement must be a variable or a property access.`);},ske=function(e){if(!this.options.allowInvalidAST){BYt(e)&&li(this,si,ka).call(this,e.illegalDecorators[0],"Decorators are not valid here.");for(let t of $k(e,true)??[])VYt(e)||(cse(e)&&!GAe(e.body)?li(this,si,ka).call(this,t,"A decorator can only decorate a method implementation, not an overload."):li(this,si,ka).call(this,t,"Decorators are not valid here."));for(let t of ib(e,true)??[]){if(t.kind!==Qe.ReadonlyKeyword&&((e.kind===Qe.PropertySignature||e.kind===Qe.MethodSignature)&&li(this,si,ka).call(this,t,`'${tu(t.kind)}' modifier cannot appear on a type member`),e.kind===Qe.IndexSignature&&(t.kind!==Qe.StaticKeyword||!Kk(e.parent))&&li(this,si,ka).call(this,t,`'${tu(t.kind)}' modifier cannot appear on an index signature`)),t.kind!==Qe.InKeyword&&t.kind!==Qe.OutKeyword&&t.kind!==Qe.ConstKeyword&&e.kind===Qe.TypeParameter&&li(this,si,ka).call(this,t,`'${tu(t.kind)}' modifier cannot appear on a type parameter`),(t.kind===Qe.InKeyword||t.kind===Qe.OutKeyword)&&(e.kind!==Qe.TypeParameter||!(Xse(e.parent)||Kk(e.parent)||Fwe(e.parent)))&&li(this,si,ka).call(this,t,`'${tu(t.kind)}' modifier can only appear on a type parameter of a class, interface or type alias`),t.kind===Qe.ReadonlyKeyword&&e.kind!==Qe.PropertyDeclaration&&e.kind!==Qe.PropertySignature&&e.kind!==Qe.IndexSignature&&e.kind!==Qe.Parameter&&li(this,si,ka).call(this,t,"'readonly' modifier can only appear on a property declaration or index signature."),t.kind===Qe.DeclareKeyword&&Kk(e.parent)&&!pU(e)&&li(this,si,ka).call(this,t,`'${tu(t.kind)}' modifier cannot appear on class elements of this kind.`),t.kind===Qe.DeclareKeyword&&yU(e)){let r=hse(e.declarationList);(r==="using"||r==="await using")&&li(this,si,ka).call(this,t,`'declare' modifier cannot appear on a '${r}' declaration.`);}if(t.kind===Qe.AbstractKeyword&&e.kind!==Qe.ClassDeclaration&&e.kind!==Qe.ConstructorType&&e.kind!==Qe.MethodDeclaration&&e.kind!==Qe.PropertyDeclaration&&e.kind!==Qe.GetAccessor&&e.kind!==Qe.SetAccessor&&li(this,si,ka).call(this,t,`'${tu(t.kind)}' modifier can only appear on a class, method, or property declaration.`),(t.kind===Qe.StaticKeyword||t.kind===Qe.PublicKeyword||t.kind===Qe.ProtectedKeyword||t.kind===Qe.PrivateKeyword)&&(e.parent.kind===Qe.ModuleBlock||e.parent.kind===Qe.SourceFile)&&li(this,si,ka).call(this,t,`'${tu(t.kind)}' modifier cannot appear on a module or namespace element.`),t.kind===Qe.AccessorKeyword&&e.kind!==Qe.PropertyDeclaration&&li(this,si,ka).call(this,t,"'accessor' modifier can only appear on a property declaration."),t.kind===Qe.AsyncKeyword&&e.kind!==Qe.MethodDeclaration&&e.kind!==Qe.FunctionDeclaration&&e.kind!==Qe.FunctionExpression&&e.kind!==Qe.ArrowFunction&&li(this,si,ka).call(this,t,"'async' modifier cannot be used here."),e.kind===Qe.Parameter&&(t.kind===Qe.StaticKeyword||t.kind===Qe.ExportKeyword||t.kind===Qe.DeclareKeyword||t.kind===Qe.AsyncKeyword)&&li(this,si,ka).call(this,t,`'${tu(t.kind)}' modifier cannot appear on a parameter.`),t.kind===Qe.PublicKeyword||t.kind===Qe.ProtectedKeyword||t.kind===Qe.PrivateKeyword)for(let r of ib(e)??[])r!==t&&(r.kind===Qe.PublicKeyword||r.kind===Qe.ProtectedKeyword||r.kind===Qe.PrivateKeyword)&&li(this,si,ka).call(this,r,"Accessibility modifier already seen.");if(e.kind===Qe.Parameter&&(t.kind===Qe.PublicKeyword||t.kind===Qe.PrivateKeyword||t.kind===Qe.ProtectedKeyword||t.kind===Qe.ReadonlyKeyword||t.kind===Qe.OverrideKeyword)){let r=jYt(e);r.kind===Qe.Constructor&&GAe(r.body)||li(this,si,ka).call(this,t,"A parameter property is only allowed in a constructor implementation.");}}}},ka=function(e,t){let r,i;throw typeof e=="number"?r=i=e:(r=e.getStart(this.ast),i=e.getEnd()),nke(t,this.ast,r,i)},Sc=function(e,t){this.options.allowInvalidAST||li(this,si,ka).call(this,e,t);},Vk=function(e,t,r,i=false){let a=i;return Object.defineProperty(e,t,{configurable:true,get:this.options.suppressDeprecatedPropertyWarnings?()=>e[r]:()=>(a||((void 0)(`The '${t}' property is deprecated on ${e.type} nodes. Use '${r}' instead. See https://typescript-eslint.io/troubleshooting/faqs/general#the-key-property-is-deprecated-on-type-nodes-use-key-instead-warnings.`,"DeprecationWarning"),a=true),e[r]),set(o){Object.defineProperty(e,t,{enumerable:true,value:o,writable:true});}}),e},yse=function(e,t,r,i){let a=false;return Object.defineProperty(e,t,{configurable:true,get:this.options.suppressDeprecatedPropertyWarnings?()=>i:()=>(a||((void 0)(`The '${t}' property is deprecated on ${e.type} nodes. Use ${r} instead. See https://typescript-eslint.io/troubleshooting/faqs/general#the-key-property-is-deprecated-on-type-nodes-use-key-instead-warnings.`,"DeprecationWarning"),a=true),i),set(o){Object.defineProperty(e,t,{enumerable:true,value:o,writable:true});}}),e};[ofr,ufr]=xWt.split(".").map(e=>Number.parseInt(e,10)),Sp.Intrinsic??Sp.Any|Sp.Unknown|Sp.String|Sp.Number|Sp.BigInt|Sp.Boolean|Sp.BooleanLiteral|Sp.ESSymbol|Sp.Void|Sp.Undefined|Sp.Null|Sp.Never|Sp.NonPrimitive;QYt=()=>{};eQt=function(e){return e&&e.__esModule?e:{default:e}},tQt=eQt({extname:e=>"."+e.split(".").pop()});nQt={default:Dse},iQt=(0, nQt.default)("typescript-eslint:typescript-estree:create-program:createSourceFile");sQt=e=>e,oQt=()=>{},uQt=class{},lQt=()=>false,cQt=()=>{},pQt=function(e){return e&&e.__esModule?e:{default:e}},_Qt={},gse={default:Dse},dQt=pQt({extname:e=>"."+e.split(".").pop()}),fQt=(0, gse.default)("typescript-eslint:typescript-estree:parseSettings:createParseSettings"),Kae=null,MP={ParseAll:(XAe=$P)==null?void 0:XAe.ParseAll,ParseForTypeErrors:(YAe=$P)==null?void 0:YAe.ParseForTypeErrors,ParseForTypeInfo:(QAe=$P)==null?void 0:QAe.ParseForTypeInfo,ParseNone:(ZAe=$P)==null?void 0:ZAe.ParseNone};vQt={default:Dse},(0, vQt.default)("typescript-eslint:typescript-estree:parser");EQt=DQt;AQt=CQt,wQt=(e,t,r)=>{if(!(e&&t==null)){if(t.findLast)return t.findLast(r);for(let i=t.length-1;i>=0;i--){let a=t[i];if(r(a,i,t))return a}}},kQt=wQt,TQt=(e,t,r)=>{if(!(e&&t==null))return Array.isArray(t)||typeof t=="string"?t[r<0?t.length+r:r]:t.at(r)},SQt=TQt,FQt=new Proxy(()=>{},{get:()=>FQt});noe=PQt;BQt=NQt,IQt=noe(["Block","CommentBlock","MultiLine"]),ioe=IQt,OQt=noe(["Line","CommentLine","SingleLine","HashbangComment","HTMLOpen","HTMLClose","Hashbang","InterpreterDirective"]),LQt=OQt,Xae=new WeakMap;MQt=RQt;Yae=new WeakMap;e5e=qQt;$Qt=UQt,jP=null;VQt=10;for(let e=0;e<=VQt;e++)KP();zQt=WQt,HQt={ArrayExpression:["elements"],AssignmentExpression:["left","right"],BinaryExpression:["left","right"],InterpreterDirective:[],Directive:["value"],DirectiveLiteral:[],BlockStatement:["directives","body"],BreakStatement:["label"],CallExpression:["callee","typeParameters","typeArguments","arguments"],CatchClause:["param","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExpressionStatement:["expression"],File:["program"],ForInStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","typeParameters","params","predicate","returnType","body"],FunctionExpression:["id","typeParameters","params","returnType","body"],Identifier:["typeAnnotation","decorators"],IfStatement:["test","consequent","alternate"],LabeledStatement:["label","body"],StringLiteral:[],NumericLiteral:[],NullLiteral:[],BooleanLiteral:[],RegExpLiteral:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],NewExpression:["callee","typeParameters","typeArguments","arguments"],Program:["directives","body"],ObjectExpression:["properties"],ObjectMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectProperty:["decorators","key","value"],RestElement:["argument","typeAnnotation","decorators"],ReturnStatement:["argument"],SequenceExpression:["expressions"],ParenthesizedExpression:["expression"],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],AssignmentPattern:["left","right","decorators","typeAnnotation"],ArrayPattern:["elements","typeAnnotation","decorators"],ArrowFunctionExpression:["typeParameters","params","predicate","returnType","body"],ClassBody:["body"],ClassExpression:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body","superTypeArguments"],ClassDeclaration:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body","superTypeArguments"],ExportAllDeclaration:["source","attributes","exported"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source","attributes"],ExportSpecifier:["local","exported"],ForOfStatement:["left","right","body"],ImportDeclaration:["specifiers","source","attributes"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],ImportExpression:["source","options"],MetaProperty:["meta","property"],ClassMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectPattern:["decorators","properties","typeAnnotation"],SpreadElement:["argument"],Super:[],TaggedTemplateExpression:["tag","typeParameters","quasi","typeArguments"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],YieldExpression:["argument"],AwaitExpression:["argument"],BigIntLiteral:[],ExportNamespaceSpecifier:["exported"],OptionalMemberExpression:["object","property"],OptionalCallExpression:["callee","typeParameters","typeArguments","arguments"],ClassProperty:["decorators","variance","key","typeAnnotation","value"],ClassAccessorProperty:["decorators","key","typeAnnotation","value"],ClassPrivateProperty:["decorators","variance","key","typeAnnotation","value"],ClassPrivateMethod:["decorators","key","typeParameters","params","returnType","body"],PrivateName:["id"],StaticBlock:["body"],ImportAttribute:["key","value"],AnyTypeAnnotation:[],ArrayTypeAnnotation:["elementType"],BooleanTypeAnnotation:[],BooleanLiteralTypeAnnotation:[],NullLiteralTypeAnnotation:[],ClassImplements:["id","typeParameters"],DeclareClass:["id","typeParameters","extends","mixins","implements","body"],DeclareFunction:["id","predicate"],DeclareInterface:["id","typeParameters","extends","body"],DeclareModule:["id","body"],DeclareModuleExports:["typeAnnotation"],DeclareTypeAlias:["id","typeParameters","right"],DeclareOpaqueType:["id","typeParameters","supertype"],DeclareVariable:["id"],DeclareExportDeclaration:["declaration","specifiers","source","attributes"],DeclareExportAllDeclaration:["source","attributes"],DeclaredPredicate:["value"],ExistsTypeAnnotation:[],FunctionTypeAnnotation:["typeParameters","this","params","rest","returnType"],FunctionTypeParam:["name","typeAnnotation"],GenericTypeAnnotation:["id","typeParameters"],InferredPredicate:[],InterfaceExtends:["id","typeParameters"],InterfaceDeclaration:["id","typeParameters","extends","body"],InterfaceTypeAnnotation:["extends","body"],IntersectionTypeAnnotation:["types"],MixedTypeAnnotation:[],EmptyTypeAnnotation:[],NullableTypeAnnotation:["typeAnnotation"],NumberLiteralTypeAnnotation:[],NumberTypeAnnotation:[],ObjectTypeAnnotation:["properties","indexers","callProperties","internalSlots"],ObjectTypeInternalSlot:["id","value"],ObjectTypeCallProperty:["value"],ObjectTypeIndexer:["variance","id","key","value"],ObjectTypeProperty:["key","value","variance"],ObjectTypeSpreadProperty:["argument"],OpaqueType:["id","typeParameters","supertype","impltype"],QualifiedTypeIdentifier:["qualification","id"],StringLiteralTypeAnnotation:[],StringTypeAnnotation:[],SymbolTypeAnnotation:[],ThisTypeAnnotation:[],TupleTypeAnnotation:["types","elementTypes"],TypeofTypeAnnotation:["argument","typeArguments"],TypeAlias:["id","typeParameters","right"],TypeAnnotation:["typeAnnotation"],TypeCastExpression:["expression","typeAnnotation"],TypeParameter:["bound","default","variance"],TypeParameterDeclaration:["params"],TypeParameterInstantiation:["params"],UnionTypeAnnotation:["types"],Variance:[],VoidTypeAnnotation:[],EnumDeclaration:["id","body"],EnumBooleanBody:["members"],EnumNumberBody:["members"],EnumStringBody:["members"],EnumSymbolBody:["members"],EnumBooleanMember:["id","init"],EnumNumberMember:["id","init"],EnumStringMember:["id","init"],EnumDefaultedMember:["id"],IndexedAccessType:["objectType","indexType"],OptionalIndexedAccessType:["objectType","indexType"],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXSpreadChild:["expression"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","typeParameters","typeArguments","attributes"],JSXSpreadAttribute:["argument"],JSXText:[],JSXFragment:["openingFragment","children","closingFragment"],JSXOpeningFragment:[],JSXClosingFragment:[],Noop:[],Placeholder:[],V8IntrinsicIdentifier:[],ArgumentPlaceholder:[],BindExpression:["object","callee"],Decorator:["expression"],DoExpression:["body"],ExportDefaultSpecifier:["exported"],ModuleExpression:["body"],TopicReference:[],PipelineTopicExpression:["expression"],PipelineBareFunction:["callee"],PipelinePrimaryTopicReference:[],TSParameterProperty:["parameter","decorators"],TSDeclareFunction:["id","typeParameters","params","returnType","body"],TSDeclareMethod:["decorators","key","typeParameters","params","returnType"],TSQualifiedName:["left","right"],TSCallSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSPropertySignature:["key","typeAnnotation"],TSMethodSignature:["key","typeParameters","parameters","typeAnnotation","params","returnType"],TSIndexSignature:["parameters","typeAnnotation"],TSAnyKeyword:[],TSBooleanKeyword:[],TSBigIntKeyword:[],TSIntrinsicKeyword:[],TSNeverKeyword:[],TSNullKeyword:[],TSNumberKeyword:[],TSObjectKeyword:[],TSStringKeyword:[],TSSymbolKeyword:[],TSUndefinedKeyword:[],TSUnknownKeyword:[],TSVoidKeyword:[],TSThisType:[],TSFunctionType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructorType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSTypeReference:["typeName","typeParameters","typeArguments"],TSTypePredicate:["parameterName","typeAnnotation"],TSTypeQuery:["exprName","typeParameters","typeArguments"],TSTypeLiteral:["members"],TSArrayType:["elementType"],TSTupleType:["elementTypes"],TSOptionalType:["typeAnnotation"],TSRestType:["typeAnnotation"],TSNamedTupleMember:["label","elementType"],TSUnionType:["types"],TSIntersectionType:["types"],TSConditionalType:["checkType","extendsType","trueType","falseType"],TSInferType:["typeParameter"],TSParenthesizedType:["typeAnnotation"],TSTypeOperator:["typeAnnotation"],TSIndexedAccessType:["objectType","indexType"],TSMappedType:["nameType","typeAnnotation","key","constraint"],TSTemplateLiteralType:["quasis","types"],TSLiteralType:["literal"],TSExpressionWithTypeArguments:["expression","typeParameters"],TSInterfaceDeclaration:["id","typeParameters","extends","body"],TSInterfaceBody:["body"],TSTypeAliasDeclaration:["id","typeParameters","typeAnnotation"],TSInstantiationExpression:["expression","typeParameters","typeArguments"],TSAsExpression:["expression","typeAnnotation"],TSSatisfiesExpression:["expression","typeAnnotation"],TSTypeAssertion:["typeAnnotation","expression"],TSEnumBody:["members"],TSEnumDeclaration:["id","body"],TSEnumMember:["id","initializer"],TSModuleDeclaration:["id","body"],TSModuleBlock:["body"],TSImportType:["argument","options","qualifier","typeParameters","typeArguments"],TSImportEqualsDeclaration:["id","moduleReference"],TSExternalModuleReference:["expression"],TSNonNullExpression:["expression"],TSExportAssignment:["expression"],TSNamespaceExportDeclaration:["id"],TSTypeAnnotation:["typeAnnotation"],TSTypeParameterInstantiation:["params"],TSTypeParameterDeclaration:["params"],TSTypeParameter:["constraint","default","name"],ChainExpression:["expression"],ExperimentalRestProperty:["argument"],ExperimentalSpreadProperty:["argument"],Literal:[],MethodDefinition:["decorators","key","value"],PrivateIdentifier:[],Property:["key","value"],PropertyDefinition:["decorators","key","typeAnnotation","value","variance"],AccessorProperty:["decorators","key","typeAnnotation","value"],TSAbstractAccessorProperty:["decorators","key","typeAnnotation"],TSAbstractKeyword:[],TSAbstractMethodDefinition:["key","value"],TSAbstractPropertyDefinition:["decorators","key","typeAnnotation"],TSAsyncKeyword:[],TSClassImplements:["expression","typeArguments","typeParameters"],TSDeclareKeyword:[],TSEmptyBodyFunctionExpression:["id","typeParameters","params","returnType"],TSExportKeyword:[],TSInterfaceHeritage:["expression","typeArguments","typeParameters"],TSPrivateKeyword:[],TSProtectedKeyword:[],TSPublicKeyword:[],TSReadonlyKeyword:[],TSStaticKeyword:[],AsConstExpression:["expression"],AsExpression:["expression","typeAnnotation"],BigIntLiteralTypeAnnotation:[],BigIntTypeAnnotation:[],ComponentDeclaration:["id","params","body","typeParameters","rendersType"],ComponentParameter:["name","local"],ComponentTypeAnnotation:["params","rest","typeParameters","rendersType"],ComponentTypeParameter:["name","typeAnnotation"],ConditionalTypeAnnotation:["checkType","extendsType","trueType","falseType"],DeclareComponent:["id","params","rest","typeParameters","rendersType"],DeclareEnum:["id","body"],DeclareHook:["id"],DeclareNamespace:["id","body"],EnumBigIntBody:["members"],EnumBigIntMember:["id","init"],HookDeclaration:["id","params","body","typeParameters","returnType"],HookTypeAnnotation:["params","returnType","rest","typeParameters"],InferTypeAnnotation:["typeParameter"],KeyofTypeAnnotation:["argument"],ObjectTypeMappedTypeProperty:["keyTparam","propType","sourceType","variance"],QualifiedTypeofIdentifier:["qualification","id"],TupleTypeLabeledElement:["label","elementType","variance"],TupleTypeSpreadElement:["label","typeAnnotation"],TypeOperator:["typeAnnotation"],TypePredicate:["parameterName","typeAnnotation","asserts"],NGChainedExpression:["expressions"],NGEmptyExpression:[],NGPipeExpression:["left","right","arguments"],NGMicrosyntax:["body"],NGMicrosyntaxAs:["key","alias"],NGMicrosyntaxExpression:["expression","alias"],NGMicrosyntaxKey:[],NGMicrosyntaxKeyedExpression:["key","expression"],NGMicrosyntaxLet:["key","value"],NGRoot:["node"],JsExpressionRoot:["node"],JsonRoot:["node"],TSJSDocAllType:[],TSJSDocUnknownType:[],TSJSDocNullableType:["typeAnnotation"],TSJSDocNonNullableType:["typeAnnotation"],NeverTypeAnnotation:[],SatisfiesExpression:["expression","typeAnnotation"],UndefinedTypeAnnotation:[],UnknownTypeAnnotation:[]},GQt=zQt(HQt),KQt=GQt;XQt=vse,noe(["RegExpLiteral","BigIntLiteral","NumericLiteral","StringLiteral","DirectiveLiteral","Literal","JSXText","TemplateElement","StringLiteralTypeAnnotation","NumberLiteralTypeAnnotation","BigIntLiteralTypeAnnotation"]);QQt=YQt,ZQt=/\*\/$/,eZt=/^\/\*\*?/,tZt=/^\s*(\/\*\*?(.|\r?\n)*?\*\/)/,rZt=/(^|\s+)\/\/([^\n\r]*)/g,r5e=/^(\r?\n)+/,nZt=/(?:^|\r?\n) *(@[^\n\r]*?) *\r?\n *(?![^\n\r@]*\/\/[^]*)([^\s@][^\n\r@]+?) *\r?\n/g,n5e=/(?:^|\r?\n) *@(\S+) *([^\n\r]*)/g,iZt=/(\r?\n|^) *\* ?/g,aZt=[];uZt=["noformat","noprettier"],lZt=["format","prettier"];pZt=cZt;hZt=fZt,mZt=/^[^"'`]*<\/|^[^/]{2}.*\/>/mu;gZt=yZt,cke="module",pke="script",vZt=[cke,pke];xZt={loc:true,range:true,comment:true,tokens:false,loggerFn:false,project:false,jsDocParsingMode:"none",suppressDeprecatedPropertyWarnings:true};EZt=e=>e&&/\.(?:js|mjs|cjs|jsx|ts|mts|cts|tsx)$/iu.test(e);wZt=hZt(AZt),kZt=o5e;});Gi();Gi();Gi();var fS=class{parse(t){let r=this.cleanSvgContent(t),i=this.parseElement(r);return {root:i,viewBox:i.attributes.viewBox,width:i.attributes.width,height:i.attributes.height,namespace:i.attributes.xmlns}}extractColors(t){let r=[];return this.traverseElements(t.root,i=>{i.attributes.fill&&this.isValidColor(i.attributes.fill)&&r.push({value:i.attributes.fill,type:"fill",element:i,attribute:"fill"}),i.attributes.stroke&&this.isValidColor(i.attributes.stroke)&&r.push({value:i.attributes.stroke,type:"stroke",element:i,attribute:"stroke"}),i.attributes["stop-color"]&&this.isValidColor(i.attributes["stop-color"])&&r.push({value:i.attributes["stop-color"],type:"stop-color",element:i,attribute:"stop-color"});}),r}cleanSvgContent(t){return t.replace(/<\?xml[^>]*\?>/gi,"").replace(/<!--[\s\S]*?-->/g,"").trim()}parseElement(t){let r=t.match(/<svg([^>]*)>/i);if(!r)throw new Error("Invalid SVG: No svg element found");let i=this.parseAttributes(r[1]),a=this.parseChildren(t);return {tag:"svg",attributes:i,children:a}}parseAttributes(t){let r={},i=/(\w+(?:-\w+)*)=["']([^"']*)["']/g,a;for(;(a=i.exec(t))!==null;)r[a[1]]=a[2];return r}parseChildren(t){let r=[],i=t.match(/<svg[^>]*>(.*)<\/svg>/is);if(!i||!i[1])return r;let a=i[1],o=/<(\w+(?::\w+)?)([^>]*?)(?:\s*\/\s*>|>(.*?)<\/\1\s*>)/gs,u;for(;(u=o.exec(a))!==null;){let[,c,l,h]=u,p=this.parseAttributes(l),f={tag:c,attributes:p,children:[]};h!==void 0&&(h.includes("<")?f.children=this.parseNestedElements(h):h.trim()&&(f.content=h.trim())),r.push(f);}return r}parseNestedElements(t){let r=[],i=/<(\w+(?::\w+)?)([^>]*?)(?:\s*\/\s*>|>(.*?)<\/\1\s*>)/gs,a;for(;(a=i.exec(t))!==null;){let[,o,u,c]=a,l=this.parseAttributes(u),h={tag:o,attributes:l,children:[]};c!==void 0&&(c.includes("<")?h.children=this.parseNestedElements(c):c.trim()&&(h.content=c.trim())),r.push(h);}return r}traverseElements(t,r){r(t),t.children.forEach(i=>this.traverseElements(i,r));}isValidColor(t){return !t||t==="none"||t==="transparent"||t==="currentColor"?false:/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$/.test(t)||/^rgba?\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*(?:,\s*[\d.]+\s*)?\)$/.test(t)||/^hsla?\(\s*\d+\s*,\s*\d+%\s*,\s*\d+%\s*(?:,\s*[\d.]+\s*)?\)$/.test(t)?true:["red","green","blue","black","white","yellow","cyan","magenta"].includes(t.toLowerCase())}};Gi();Gi();var hS=class{options;constructor(t={}){this.options={preserveOriginalNames:t.preserveOriginalNames??false,generateClasses:t.generateClasses??true,colorPrefix:t.colorPrefix??"color"};}extractColors(t){let r=[];this.traverseElement(t,r);let i=new Map;return r.forEach(a=>{this.isValidColor(a.value)&&i.set(a.value,a);}),Array.from(i.values()).sort((a,o)=>a.value.localeCompare(o.value))}apply(t){let r=this.extractColors(t),i=this.generateColorMappings(r),a=this.replaceColorsWithVariables(t,i);return {mappings:i,processedElement:a,originalColors:r.map(o=>o.value)}}generateColorMappings(t){return t.map((r,i)=>({originalColor:r.value,variableName:i===0?this.options.colorPrefix:`${this.options.colorPrefix}${i+1}`,type:r.type}))}replaceColorsWithVariables(t,r){let i=new Map(r.map(a=>[a.originalColor,a.variableName]));return this.transformElement(t,a=>{let o={...a.attributes};if(o.fill&&i.has(o.fill)&&(o.fill=`{${i.get(o.fill)}}`),o.stroke&&i.has(o.stroke)&&(o.stroke=`{${i.get(o.stroke)}}`),o["stop-color"]&&i.has(o["stop-color"])&&(o["stop-color"]=`{${i.get(o["stop-color"])}}`),o.style){let u=o.style,c=u.match(/fill:\s*([^;]+)/);if(c){let p=c[1].trim();i.has(p)&&(u=u.replace(/fill:\s*[^;]+/,`fill: {${i.get(p)}}`));}let l=u.match(/stroke:\s*([^;]+)/);if(l){let p=l[1].trim();i.has(p)&&(u=u.replace(/stroke:\s*[^;]+/,`stroke: {${i.get(p)}}`));}let h=u.match(/stop-color:\s*([^;]+)/);if(h){let p=h[1].trim();i.has(p)&&(u=u.replace(/stop-color:\s*[^;]+/,`stop-color: {${i.get(p)}}`));}o.style=u;}if(this.isDrawableElement(a.tag)){let u=a.attributes.fill!==void 0&&a.attributes.fill!=="",c=a.attributes.stroke!==void 0&&a.attributes.stroke!=="";u&&!c&&!o.stroke&&(o.stroke="none"),c&&!u&&!o.fill&&(o.fill="none");}return {...a,attributes:o}})}traverseElement(t,r){t.attributes.fill&&r.push({value:t.attributes.fill,type:"fill",element:t,attribute:"fill"}),t.attributes.stroke&&r.push({value:t.attributes.stroke,type:"stroke",element:t,attribute:"stroke"}),t.attributes["stop-color"]&&r.push({value:t.attributes["stop-color"],type:"stop-color",element:t,attribute:"stop-color"}),t.attributes.style&&this.extractColorsFromStyle(t.attributes.style).forEach(a=>{r.push({value:a.value,type:a.type,element:t,attribute:"style"});}),t.children.forEach(i=>this.traverseElement(i,r));}transformElement(t,r){let i=r(t);return {...i,children:i.children.map(a=>this.transformElement(a,r))}}isDrawableElement(t){return ["path","circle","ellipse","line","rect","polygon","polyline","text","tspan","use"].includes(t)}isValidColor(t){return !t||t==="none"||t==="transparent"||t==="currentColor"?false:/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$/.test(t)||/^rgba?\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*(?:,\s*[\d.]+\s*)?\)$/.test(t)||/^hsla?\(\s*\d+\s*,\s*\d+%\s*,\s*\d+%\s*(?:,\s*[\d.]+\s*)?\)$/.test(t)?true:["red","green","blue","yellow","orange","purple","pink","brown","black","white","gray","grey","cyan","magenta","lime","navy"].includes(t.toLowerCase())}extractColorsFromStyle(t){let r=[],i=t.match(/fill:\s*([^;]+)/);if(i){let u=i[1].trim();this.isValidColor(u)&&r.push({value:u,type:"fill"});}let a=t.match(/stroke:\s*([^;]+)/);if(a){let u=a[1].trim();this.isValidColor(u)&&r.push({value:u,type:"stroke"});}let o=t.match(/stop-color:\s*([^;]+)/);if(o){let u=o[1].trim();this.isValidColor(u)&&r.push({value:u,type:"stop-color"});}return r}};Gi();var mS=class{options;constructor(t={}){this.options={preserveExisting:t.preserveExisting??true,onlyIfStrokePresent:t.onlyIfStrokePresent??true};}apply(t){let r=0;return {processedElement:this.transformElement(t,a=>this.shouldAddVectorEffect(a)?(r++,{...a,attributes:{...a.attributes,"vector-effect":"non-scaling-stroke"}}):a),elementsModified:r}}shouldAddVectorEffect(t){return this.options.preserveExisting&&t.attributes["vector-effect"]?false:["path","line","polyline","polygon","rect","circle","ellipse"].includes(t.tag)}transformElement(t,r){let i=r(t);return {...i,children:i.children.map(a=>this.transformElement(a,r))}}};Gi();var yS=class{options;constructor(t={}){this.options={preserveOriginalNames:t.preserveOriginalNames??false,strokeWidthPrefix:t.strokeWidthPrefix??"strokeWidth",generateClasses:t.generateClasses??true};}extractStrokeWidths(t){let r=[];this.traverseElement(t,r);let i=new Map;return r.forEach(a=>{this.isValidStrokeWidth(a.value)&&i.set(a.value,a);}),Array.from(i.values()).sort((a,o)=>{let u=parseFloat(a.value),c=parseFloat(o.value);return isNaN(u)&&isNaN(c)?a.value.localeCompare(o.value):isNaN(u)?1:isNaN(c)?-1:u-c})}apply(t){let r=this.extractStrokeWidths(t),i=this.generateStrokeWidthMappings(r),a=this.replaceStrokeWidthsWithVariables(t,i);return {mappings:i,processedElement:a,originalStrokeWidths:r.map(o=>o.value)}}traverseElement(t,r){if(t.attributes["stroke-width"]&&r.push({value:t.attributes["stroke-width"],element:t,attribute:"stroke-width"}),t.attributes.style){let i=this.extractStrokeWidthFromStyle(t.attributes.style);i&&r.push({value:i,element:t,attribute:"style",styleProperty:"stroke-width"});}t.children.forEach(i=>this.traverseElement(i,r));}extractStrokeWidthFromStyle(t){let r=t.match(/stroke-width\s*:\s*([^;]+)/);return r?r[1].trim():null}isValidStrokeWidth(t){return t==="inherit"||t==="none"||t==="initial"||t==="unset"||t.includes("var(")||t.includes("calc(")?false:/^[\d.]+(?:px|pt|pc|in|cm|mm|em|rem|ex|ch|vw|vh|vmin|vmax|%)?$/.test(t.trim())}generateStrokeWidthMappings(t){return t.map((r,i)=>({originalStrokeWidth:r.value,variableName:i===0?this.options.strokeWidthPrefix:`${this.options.strokeWidthPrefix}${i+1}`}))}replaceStrokeWidthsWithVariables(t,r){let i=new Map(r.map(a=>[a.originalStrokeWidth,a.variableName]));return this.transformElement(t,a=>{let o={...a.attributes};if(o["stroke-width"]&&i.has(o["stroke-width"])&&(o["stroke-width"]=`{${i.get(o["stroke-width"])}}`),o.style){let u=o.style;i.forEach((c,l)=>{let h=new RegExp(`stroke-width\\s*:\\s*${this.escapeRegExp(l)}`,"g");u=u.replace(h,`stroke-width: {${c}}`);}),o.style=u;}return {...a,attributes:o}})}transformElement(t,r){let i=r(t);return {...i,children:i.children.map(a=>this.transformElement(a,r))}}escapeRegExp(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}};Gi();var gS=class{options;constructor(t={}){this.options={addRole:t.addRole??true,addAriaHidden:t.addAriaHidden??false,addTitle:t.addTitle??true,addDesc:t.addDesc??true,defaultRole:t.defaultRole??"img",preserveExisting:t.preserveExisting??true};}apply(t){let r=[];if(t.tag!=="svg")return {processedElement:t,attributesAdded:r};let i={...t.attributes};return this.options.addRole&&(!this.options.preserveExisting||!i.role)&&(i.role=this.options.defaultRole,r.push("role")),this.options.addAriaHidden&&(!this.options.preserveExisting||!i["aria-hidden"])&&(i["aria-hidden"]="true",r.push("aria-hidden")),this.options.addTitle&&r.push("title-support"),this.options.addDesc&&r.push("desc-support"),this.options.addTitle&&this.options.addDesc&&(!this.options.preserveExisting||!i["aria-labelledby"])?(i["aria-labelledby"]="{titleId} {descId}",r.push("aria-labelledby")):this.options.addTitle&&(!this.options.preserveExisting||!i["aria-labelledby"])&&(i["aria-labelledby"]="{titleId}",r.push("aria-labelledby")),{processedElement:{...t,attributes:i},attributesAdded:r}}generateProps(){let t=[];return this.options.addTitle&&t.push("title?: string","titleId?: string"),this.options.addDesc&&t.push("desc?: string","descId?: string"),t}generateJSXElements(t){let r=[];return t==="react"?(this.options.addDesc&&r.push("{desc ? <desc id={descId}>{desc}</desc> : null}"),this.options.addTitle&&r.push("{title ? <title id={titleId}>{title}</title> : null}")):(this.options.addDesc&&r.push('<desc v-if="desc" :id="descId">{{ desc }}</desc>'),this.options.addTitle&&r.push('<title v-if="title" :id="titleId">{{ title }}</title>')),r.join(`
|
|
457
|
-
`)}};var vS=class{transform(t,r={}){let{optimize:i=true,splitColors:a=false,splitStrokeWidths:o=false,fixedStrokeWidth:u=false,accessibility:c=true,removeComments:l=true,removeDuplicates:h=true,minifyPaths:p=false}=r,f=this.deepCloneAst(t),v=[],b=[],C=[];return i&&(this.applyOptimizations(f,{removeComments:l,removeDuplicates:h,minifyPaths:p&&!a}),v.push("optimization")),a&&(b=this.applySplitColors(f),v.push("split-colors")),o&&(C=this.applySplitStrokeWidths(f),v.push("split-stroke-widths")),u&&(this.applyFixedStrokeWidth(f),v.push("fixed-stroke-width")),c&&(this.applyAccessibility(f),v.push("accessibility")),{ast:f,colorMappings:b,strokeWidthMappings:C,metadata:{originalColors:b.map(P=>P.originalColor),originalStrokeWidths:C.map(P=>P.originalStrokeWidth),optimizationApplied:i,features:v,hasClassAttributes:this.hasClassAttributes(f)}}}applySplitColors(t){let i=new hS({generateClasses:true,colorPrefix:"color"}).apply(t.root);return t.root=i.processedElement,i.mappings}applyFixedStrokeWidth(t){let i=new mS({onlyIfStrokePresent:false,preserveExisting:true}).apply(t.root);t.root=i.processedElement;}applyAccessibility(t){let i=new gS({addRole:true,addTitle:true,addDesc:true,defaultRole:"img",preserveExisting:true}).apply(t.root);t.root=i.processedElement;}applyOptimizations(t,r){r.removeDuplicates&&this.removeDuplicateElements(t),r.minifyPaths&&this.minifyPaths(t),this.removeEmptyGroups(t);}removeDuplicateElements(t){}minifyPaths(t){this.traverseElements(t.root,r=>{r.tag==="path"&&r.attributes.d&&(r.attributes.d=r.attributes.d.replace(/\s+/g," ").replace(/([MLHVCSQTAZ])\s+/gi,"$1").trim());});}removeEmptyGroups(t){let r=i=>(i.children=i.children.filter(r),!(i.tag==="g"&&i.children.length===0&&!i.content));t.root.children=t.root.children.filter(r);}traverseElements(t,r){r(t),t.children.forEach(i=>this.traverseElements(i,r));}isValidColor(t){return !t||t==="none"||t==="transparent"||t==="currentColor"?false:/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$/.test(t)||/^rgba?\(.+\)$/.test(t)||/^hsla?\(.+\)$/.test(t)}deepCloneAst(t){return {...t,root:this.deepCloneElement(t.root)}}deepCloneElement(t){return {...t,attributes:{...t.attributes},children:t.children.map(r=>this.deepCloneElement(r))}}hasClassAttributes(t){let r=i=>i.attributes.class||i.attributes.className?true:i.children.some(a=>r(a));return r(t.root)}applySplitStrokeWidths(t){let i=new yS({generateClasses:true,strokeWidthPrefix:"strokeWidth"}).apply(t.root);return t.root=i.processedElement,i.mappings}};Gi();Gi();Gi();Gi();var LR=e=>/^[A-Z][a-zA-Z0-9]*$/.test(e)&&/[a-z]/.test(e)?e:/^[a-z][a-zA-Z0-9]*$/.test(e)&&/[A-Z]/.test(e)?e.charAt(0).toUpperCase()+e.slice(1):e.split(/[\s\-_]+/).filter(Boolean).map(t=>t.length>3&&t===t.toUpperCase()&&/^[A-Z]+$/.test(t)?t.charAt(0).toUpperCase()+t.slice(1).toLowerCase():t.length<=3&&t===t.toUpperCase()&&/^[A-Z]+$/.test(t)?t:t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(""),mZ=e=>e.replace(/-([a-z])/g,(t,r)=>r.toUpperCase()),P1e=e=>{let t={class:"className",for:"htmlFor","accept-charset":"acceptCharset","http-equiv":"httpEquiv"};return t[e]?t[e]:e.startsWith("aria-")||e.startsWith("data-")?e:mZ(e)};function yZ(e,t,r){let i=e.replace(/\.svg$/i,"");return i=Tyt(i),B1e(i,t,r)}function Tyt(e){if(/^[a-zA-Z][a-zA-Z0-9]*$/.test(e))return e;let r=e.
|
|
457
|
+
`)}};var vS=class{transform(t,r={}){let{optimize:i=true,splitColors:a=false,splitStrokeWidths:o=false,fixedStrokeWidth:u=false,accessibility:c=true,removeComments:l=true,removeDuplicates:h=true,minifyPaths:p=false}=r,f=this.deepCloneAst(t),v=[],b=[],C=[];return i&&(this.applyOptimizations(f,{removeComments:l,removeDuplicates:h,minifyPaths:p&&!a}),v.push("optimization")),a&&(b=this.applySplitColors(f),v.push("split-colors")),o&&(C=this.applySplitStrokeWidths(f),v.push("split-stroke-widths")),u&&(this.applyFixedStrokeWidth(f),v.push("fixed-stroke-width")),c&&(this.applyAccessibility(f),v.push("accessibility")),{ast:f,colorMappings:b,strokeWidthMappings:C,metadata:{originalColors:b.map(P=>P.originalColor),originalStrokeWidths:C.map(P=>P.originalStrokeWidth),optimizationApplied:i,features:v,hasClassAttributes:this.hasClassAttributes(f)}}}applySplitColors(t){let i=new hS({generateClasses:true,colorPrefix:"color"}).apply(t.root);return t.root=i.processedElement,i.mappings}applyFixedStrokeWidth(t){let i=new mS({onlyIfStrokePresent:false,preserveExisting:true}).apply(t.root);t.root=i.processedElement;}applyAccessibility(t){let i=new gS({addRole:true,addTitle:true,addDesc:true,defaultRole:"img",preserveExisting:true}).apply(t.root);t.root=i.processedElement;}applyOptimizations(t,r){r.removeDuplicates&&this.removeDuplicateElements(t),r.minifyPaths&&this.minifyPaths(t),this.removeEmptyGroups(t);}removeDuplicateElements(t){}minifyPaths(t){this.traverseElements(t.root,r=>{r.tag==="path"&&r.attributes.d&&(r.attributes.d=r.attributes.d.replace(/\s+/g," ").replace(/([MLHVCSQTAZ])\s+/gi,"$1").trim());});}removeEmptyGroups(t){let r=i=>(i.children=i.children.filter(r),!(i.tag==="g"&&i.children.length===0&&!i.content));t.root.children=t.root.children.filter(r);}traverseElements(t,r){r(t),t.children.forEach(i=>this.traverseElements(i,r));}isValidColor(t){return !t||t==="none"||t==="transparent"||t==="currentColor"?false:/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$/.test(t)||/^rgba?\(.+\)$/.test(t)||/^hsla?\(.+\)$/.test(t)}deepCloneAst(t){return {...t,root:this.deepCloneElement(t.root)}}deepCloneElement(t){return {...t,attributes:{...t.attributes},children:t.children.map(r=>this.deepCloneElement(r))}}hasClassAttributes(t){let r=i=>i.attributes.class||i.attributes.className?true:i.children.some(a=>r(a));return r(t.root)}applySplitStrokeWidths(t){let i=new yS({generateClasses:true,strokeWidthPrefix:"strokeWidth"}).apply(t.root);return t.root=i.processedElement,i.mappings}};Gi();Gi();Gi();Gi();var LR=e=>/^[A-Z][a-zA-Z0-9]*$/.test(e)&&/[a-z]/.test(e)?e:/^[a-z][a-zA-Z0-9]*$/.test(e)&&/[A-Z]/.test(e)?e.charAt(0).toUpperCase()+e.slice(1):e.split(/[\s\-_]+/).filter(Boolean).map(t=>t.length>3&&t===t.toUpperCase()&&/^[A-Z]+$/.test(t)?t.charAt(0).toUpperCase()+t.slice(1).toLowerCase():t.length<=3&&t===t.toUpperCase()&&/^[A-Z]+$/.test(t)?t:/[a-z][A-Z]/.test(t)?t.charAt(0).toUpperCase()+t.slice(1):t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(""),mZ=e=>e.replace(/-([a-z])/g,(t,r)=>r.toUpperCase()),P1e=e=>{let t={class:"className",for:"htmlFor","accept-charset":"acceptCharset","http-equiv":"httpEquiv"};return t[e]?t[e]:e.startsWith("aria-")||e.startsWith("data-")?e:mZ(e)};function yZ(e,t,r){let i=e.replace(/\.svg$/i,"");return i=Tyt(i),B1e(i,t,r)}function Tyt(e){if(/^[a-zA-Z][a-zA-Z0-9]*$/.test(e))return e;let r=e.replace(/[^a-zA-Z0-9]/g," ");return r=r.replace(/\s+/g," ").trim(),r}function N1e(e,t="main"){let r=e.replace(/=/g," ").replace(/,/g," ").replace(/[^a-zA-Z0-9]/g," ").replace(/\s+/g," ").trim();if(t==="prefix"){if(!/^[a-zA-Z]/.test(r))return ""}else t==="suffix"?r=r.replace(/^[^a-zA-Z0-9]+/,""):r=r.replace(/^[^a-zA-Z]+/,"");return LR(r)}function Syt(e){return e&&LR(e).split(/(?<=[a-z])(?=[0-9])|(?<=[0-9])(?=[A-Z])/).map(i=>i&&(/^\d/.test(i)?i.replace(/^(\d+)([a-z])/,(a,o,u)=>o+u.toUpperCase()):i)).join("")}function B1e(e,t,r){let i=e;t&&(i=`${t}-${i}`),r&&(i=`${i}-${r}`);let a=N1e(i,"main");return Syt(a)}var cC=class{options;constructor(t={}){this.options={typescript:true,memo:true,forwardRef:true,exportDefault:true,componentName:"Icon",prefix:"",suffix:"",includeTypes:true,...t};}astToJsx(t){return this.elementToJsx(t.root,0)}elementToJsx(t,r=0){let i=" ".repeat(r+1),{tag:a,attributes:o,children:u,content:c}=t,l=this.attributesToJsx(o),h=l.length>0?" "+l.join(" "):"";if(u.length===0&&!c)return `${i}<${a}${h} />`;let p=`${i}<${a}${h}>`;return c&&(p+=c),u.length>0&&(p+=`
|
|
458
458
|
`,p+=u.map(f=>this.elementToJsx(f,r+1)).join(`
|
|
459
459
|
`),p+=`
|
|
460
460
|
`+i),p+=`</${a}>`,p}attributesToJsx(t){return Object.entries(t).map(([r,i])=>{let a=this.convertAttributeName(r);return i.startsWith("{")&&i.endsWith("}")?`${a}=${i}`:`${a}="${i}"`})}convertAttributeName(t){let r={class:"className",for:"htmlFor",tabindex:"tabIndex",readonly:"readOnly",maxlength:"maxLength",cellpadding:"cellPadding",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"};return t.startsWith("aria-")||t.startsWith("data-")?t:t.includes("-")?t.replace(/-([a-z])/g,(i,a)=>a.toUpperCase()):r[t]||t}generateColorProps(t,r=true){return t.length===0?"":t.map(i=>{let a=i.variableName,o=`${a}Class`;if(this.options.typescript){let u=` ${a}?: string;`;return r&&(u+=`
|
package/dist/index.mjs
CHANGED
|
@@ -454,7 +454,7 @@ ${Ui.join(`
|
|
|
454
454
|
`,Mr)+1)+4;function Xr(ba){vr||(vr=xr),Jc.push(ba),xr+=ba.length;}for(va();E1(5););E1(4)&&(jt=0,xr=0);e:for(;;){switch(ne()){case 60:i2(Jc),ap||(ap=$t()),Ln(Zt(xr)),jt=0,vr=void 0;break;case 4:Jc.push(t.getTokenText()),jt=0,xr=0;break;case 42:let ba=t.getTokenText();jt===1?(jt=2,Xr(ba)):(or.assert(jt===0),jt=1,xr+=ba.length);break;case 5:or.assert(jt!==2,"whitespace shouldn't come from the scanner while saving top-level comment text");let vo=t.getTokenText();vr!==void 0&&xr+vo.length>vr&&Jc.push(vo.slice(vr-xr)),xr+=vo.length;break;case 1:break e;case 82:jt=2,Xr(t.getTokenValue());break;case 19:jt=2;let pc=t.getTokenFullStart(),Mu=t.getTokenEnd()-1,ju=R(Mu);if(ju){dl||sp(Jc),Vd.push(Et(p.createJSDocText(Jc.join("")),dl??Mr,pc)),Vd.push(ju),Jc=[],dl=t.getTokenEnd();break}default:jt=2,Xr(t.getTokenText());break}jt===2?Au(false):va();}let Lr=Jc.join("").trimEnd();Vd.length&&Lr.length&&Vd.push(Et(p.createJSDocText(Lr),dl??Mr,ap)),Vd.length&&ki&&or.assertIsDefined(ap,"having parsed tags implies that the end of the comment span should be set");let ta=ki&&is(ki,lc,Vc);return Et(p.createJSDocComment(Vd.length?is(Vd,Mr,ap):Lr.length?Lr:void 0,ta),Mr,ca)}function sp(jt){for(;jt.length&&(jt[0]===`
|
|
455
455
|
`||jt[0]==="\r");)jt.shift();}function i2(jt){for(;jt.length;){let vr=jt[jt.length-1].trimEnd();if(vr==="")jt.pop();else if(vr.length<jt[jt.length-1].length){jt[jt.length-1]=vr;break}else break}}function Wp(){for(;;){if(va(),ne()===1)return true;if(!(ne()===5||ne()===4))return false}}function gu(){if(!((ne()===5||ne()===4)&&yr(Wp)))for(;ne()===5||ne()===4;)va();}function I_(){if((ne()===5||ne()===4)&&yr(Wp))return "";let jt=t.hasPrecedingLineBreak(),vr=false,xr="";for(;jt&&ne()===42||ne()===5||ne()===4;)xr+=t.getTokenText(),ne()===4?(jt=true,vr=true,xr=""):ne()===42&&(jt=false),va();return vr?xr:""}function Zt(jt){or.assert(ne()===60);let vr=t.getTokenStart();va();let xr=Jd(void 0),Xr=I_(),Lr;switch(xr.escapedText){case "author":Lr=mT(vr,xr,jt,Xr);break;case "implements":Lr=gT(vr,xr,jt,Xr);break;case "augments":case "extends":Lr=FN(vr,xr,jt,Xr);break;case "class":case "constructor":Lr=D1(vr,p.createJSDocClassTag,xr,jt,Xr);break;case "public":Lr=D1(vr,p.createJSDocPublicTag,xr,jt,Xr);break;case "private":Lr=D1(vr,p.createJSDocPrivateTag,xr,jt,Xr);break;case "protected":Lr=D1(vr,p.createJSDocProtectedTag,xr,jt,Xr);break;case "readonly":Lr=D1(vr,p.createJSDocReadonlyTag,xr,jt,Xr);break;case "override":Lr=D1(vr,p.createJSDocOverrideTag,xr,jt,Xr);break;case "deprecated":ci=true,Lr=D1(vr,p.createJSDocDeprecatedTag,xr,jt,Xr);break;case "this":Lr=VA(vr,xr,jt,Xr);break;case "enum":Lr=zf(vr,xr,jt,Xr);break;case "arg":case "argument":case "param":return D0(vr,xr,2,jt);case "return":case "returns":Lr=Jf(vr,xr,jt,Xr);break;case "template":Lr=WA(vr,xr,jt,Xr);break;case "type":Lr=zE(vr,xr,jt,Xr);break;case "typedef":Lr=bT(vr,xr,jt,Xr);break;case "callback":Lr=NN(vr,xr,jt,Xr);break;case "overload":Lr=BN(vr,xr,jt,Xr);break;case "satisfies":Lr=Wf(vr,xr,jt,Xr);break;case "see":Lr=hT(vr,xr,jt,Xr);break;case "exception":case "throws":Lr=x1(vr,xr,jt,Xr);break;case "import":Lr=vT(vr,xr,jt,Xr);break;default:Lr=cr(vr,xr,jt,Xr);break}return Lr}function y(jt,vr,xr,Xr){return Xr||(xr+=vr-jt),k(xr,Xr.slice(xr))}function k(jt,vr){let xr=$t(),Xr=[],Lr=[],ta,ba=0,vo;function pc(C0){vo||(vo=jt),Xr.push(C0),jt+=C0.length;}vr!==void 0&&(vr!==""&&pc(vr),ba=1);let Mu=ne();e:for(;;){switch(Mu){case 4:ba=0,Xr.push(t.getTokenText()),jt=0;break;case 60:t.resetTokenState(t.getTokenEnd()-1);break e;case 1:break e;case 5:or.assert(ba!==2&&ba!==3,"whitespace shouldn't come from the scanner while saving comment text");let C0=t.getTokenText();vo!==void 0&&jt+C0.length>vo&&(Xr.push(C0.slice(vo-jt)),ba=2),jt+=C0.length;break;case 19:ba=2;let Wb=t.getTokenFullStart(),A0=t.getTokenEnd()-1,K3=R(A0);K3?(Lr.push(Et(p.createJSDocText(Xr.join("")),ta??xr,Wb)),Lr.push(K3),Xr=[],ta=t.getTokenEnd()):pc(t.getTokenText());break;case 62:ba===3?ba=2:ba=3,pc(t.getTokenText());break;case 82:ba!==3&&(ba=2),pc(t.getTokenValue());break;case 42:if(ba===0){ba=1,jt+=1;break}default:ba!==3&&(ba=2),pc(t.getTokenText());break}ba===2||ba===3?Mu=Au(ba===3):Mu=va();}sp(Xr);let ju=Xr.join("").trimEnd();if(Lr.length)return ju.length&&Lr.push(Et(p.createJSDocText(ju),ta??xr)),is(Lr,xr,t.getTokenEnd());if(ju.length)return ju}function R(jt){let vr=Cn(ve);if(!vr)return;va(),gu();let xr=X(),Xr=[];for(;ne()!==20&&ne()!==4&&ne()!==1;)Xr.push(t.getTokenText()),va();let Lr=vr==="link"?p.createJSDocLink:vr==="linkcode"?p.createJSDocLinkCode:p.createJSDocLinkPlain;return Et(Lr(xr,Xr.join("")),jt,t.getTokenEnd())}function X(){if(Bu(ne())){let jt=$t(),vr=yu();for(;di(25);)vr=Et(p.createQualifiedName(vr,ne()===81?To(80,false):yu()),jt);for(;ne()===81;)du(),va(),vr=Et(p.createJSDocMemberName(vr,Ts()),jt);return vr}}function ve(){if(I_(),ne()===19&&va()===60&&Bu(va())){let jt=t.getTokenValue();if(_t(jt))return jt}}function _t(jt){return jt==="link"||jt==="linkcode"||jt==="linkplain"}function cr(jt,vr,xr,Xr){return Et(p.createJSDocUnknownTag(vr,y(jt,$t(),xr,Xr)),jt)}function Ln(jt){jt&&(ki?ki.push(jt):(ki=[jt],lc=jt.pos),Vc=jt.end);}function ha(){return I_(),ne()===19?Ae():void 0}function au(){let jt=E1(23);jt&&gu();let vr=E1(62),xr=CT();return vr&&ub(62),jt&&(gu(),Ns(64)&&hu(),Gt(24)),{name:xr,isBracketed:jt}}function cc(jt){switch(jt.kind){case 151:return true;case 188:return cc(jt.elementType);default:return xwe(jt)&&Qs(jt.typeName)&&jt.typeName.escapedText==="Object"&&!jt.typeArguments}}function D0(jt,vr,xr,Xr){let Lr=ha(),ta=!Lr;I_();let{name:ba,isBracketed:vo}=au(),pc=I_();ta&&!yr(ve)&&(Lr=ha());let Mu=y(jt,$t(),Xr,pc),ju=E0(Lr,ba,xr,Xr);ju&&(Lr=ju,ta=true);let C0=xr===1?p.createJSDocPropertyTag(vr,ba,vo,Lr,ta,Mu):p.createJSDocParameterTag(vr,ba,vo,Lr,ta,Mu);return Et(C0,jt)}function E0(jt,vr,xr,Xr){if(jt&&cc(jt.type)){let Lr=$t(),ta,ba;for(;ta=Cn(()=>L_(xr,Xr,vr));)ta.kind===341||ta.kind===348?ba=kd(ba,ta):ta.kind===345&&ll(ta.tagName,Dt.A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag);if(ba){let vo=Et(p.createJSDocTypeLiteral(ba,jt.type.kind===188),Lr);return Et(p.createJSDocTypeExpression(vo),Lr)}}}function Jf(jt,vr,xr,Xr){W0(ki,hXt)&&ks(vr.pos,t.getTokenStart(),Dt._0_tag_already_specified,ZP(vr.escapedText));let Lr=ha();return Et(p.createJSDocReturnTag(vr,Lr,y(jt,$t(),xr,Xr)),jt)}function zE(jt,vr,xr,Xr){W0(ki,Qse)&&ks(vr.pos,t.getTokenStart(),Dt._0_tag_already_specified,ZP(vr.escapedText));let Lr=Ae(true),ta=xr!==void 0&&Xr!==void 0?y(jt,$t(),xr,Xr):void 0;return Et(p.createJSDocTypeTag(vr,Lr,ta),jt)}function hT(jt,vr,xr,Xr){let Lr=ne()===23||yr(()=>va()===60&&Bu(va())&&_t(t.getTokenValue()))?void 0:ze(),ta=xr!==void 0&&Xr!==void 0?y(jt,$t(),xr,Xr):void 0;return Et(p.createJSDocSeeTag(vr,Lr,ta),jt)}function x1(jt,vr,xr,Xr){let Lr=ha(),ta=y(jt,$t(),xr,Xr);return Et(p.createJSDocThrowsTag(vr,Lr,ta),jt)}function mT(jt,vr,xr,Xr){let Lr=$t(),ta=yT(),ba=t.getTokenFullStart(),vo=y(jt,ba,xr,Xr);vo||(ba=t.getTokenFullStart());let pc=typeof vo!="string"?is(Ase([Et(ta,Lr,ba)],vo),Lr):ta.text+vo;return Et(p.createJSDocAuthorTag(vr,pc),jt)}function yT(){let jt=[],vr=false,xr=t.getToken();for(;xr!==1&&xr!==4;){if(xr===30)vr=true;else {if(xr===60&&!vr)break;if(xr===32&&vr){jt.push(t.getTokenText()),t.resetTokenState(t.getTokenEnd());break}}jt.push(t.getTokenText()),xr=va();}return p.createJSDocText(jt.join(""))}function gT(jt,vr,xr,Xr){let Lr=$A();return Et(p.createJSDocImplementsTag(vr,Lr,y(jt,$t(),xr,Xr)),jt)}function FN(jt,vr,xr,Xr){let Lr=$A();return Et(p.createJSDocAugmentsTag(vr,Lr,y(jt,$t(),xr,Xr)),jt)}function Wf(jt,vr,xr,Xr){let Lr=Ae(false),ta=xr!==void 0&&Xr!==void 0?y(jt,$t(),xr,Xr):void 0;return Et(p.createJSDocSatisfiesTag(vr,Lr,ta),jt)}function vT(jt,vr,xr,Xr){let Lr=t.getTokenFullStart(),ta;oi()&&(ta=Ts());let ba=$f(ta,Lr,true,true),vo=b1(),pc=J3(),Mu=xr!==void 0&&Xr!==void 0?y(jt,$t(),xr,Xr):void 0;return Et(p.createJSDocImportTag(vr,ba,vo,pc,Mu),jt)}function $A(){let jt=di(19),vr=$t(),xr=PN();t.setSkipJsDocLeadingAsterisks(true);let Xr=P_();t.setSkipJsDocLeadingAsterisks(false);let Lr=p.createExpressionWithTypeArguments(xr,Xr),ta=Et(Lr,vr);return jt&&(gu(),Gt(20)),ta}function PN(){let jt=$t(),vr=Jd();for(;di(25);){let xr=Jd();vr=Et(O(vr,xr),jt);}return vr}function D1(jt,vr,xr,Xr,Lr){return Et(vr(xr,y(jt,$t(),Xr,Lr)),jt)}function VA(jt,vr,xr,Xr){let Lr=Ae(true);return gu(),Et(p.createJSDocThisTag(vr,Lr,y(jt,$t(),xr,Xr)),jt)}function zf(jt,vr,xr,Xr){let Lr=Ae(true);return gu(),Et(p.createJSDocEnumTag(vr,Lr,y(jt,$t(),xr,Xr)),jt)}function bT(jt,vr,xr,Xr){let Lr=ha();I_();let ta=O_();gu();let ba=k(xr),vo;if(!Lr||cc(Lr.type)){let Mu,ju,C0,Wb=false;for(;(Mu=Cn(()=>DT(xr)))&&Mu.kind!==345;)if(Wb=true,Mu.kind===344)if(ju){let A0=Pi(Dt.A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags);A0&&Kq(A0,Lk(Re,Se,0,0,Dt.The_tag_was_first_specified_here));break}else ju=Mu;else C0=kd(C0,Mu);if(Wb){let A0=Lr&&Lr.type.kind===188,K3=p.createJSDocTypeLiteral(C0,A0);Lr=ju&&ju.typeExpression&&!cc(ju.typeExpression.type)?ju.typeExpression:Et(K3,jt),vo=Lr.end;}}vo=vo||ba!==void 0?$t():(ta??Lr??vr).end,ba||(ba=y(jt,vo,xr,Xr));let pc=p.createJSDocTypedefTag(vr,Lr,ta,ba);return Et(pc,jt,vo)}function O_(jt){let vr=t.getTokenStart();if(!Bu(ne()))return;let xr=Jd();if(di(25)){let Xr=O_(true),Lr=p.createModuleDeclaration(void 0,xr,Xr,jt?8:void 0);return Et(Lr,vr)}return jt&&(xr.flags|=4096),xr}function xT(jt){let vr=$t(),xr,Xr;for(;xr=Cn(()=>L_(4,jt));){if(xr.kind===345){ll(xr.tagName,Dt.A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag);break}Xr=kd(Xr,xr);}return is(Xr||[],vr)}function JA(jt,vr){let xr=xT(vr),Xr=Cn(()=>{if(E1(60)){let Lr=Zt(vr);if(Lr&&Lr.kind===342)return Lr}});return Et(p.createJSDocSignature(void 0,xr,Xr),jt)}function NN(jt,vr,xr,Xr){let Lr=O_();gu();let ta=k(xr),ba=JA(jt,xr);ta||(ta=y(jt,$t(),xr,Xr));let vo=ta!==void 0?$t():ba.end;return Et(p.createJSDocCallbackTag(vr,ba,Lr,ta),jt,vo)}function BN(jt,vr,xr,Xr){gu();let Lr=k(xr),ta=JA(jt,xr);Lr||(Lr=y(jt,$t(),xr,Xr));let ba=Lr!==void 0?$t():ta.end;return Et(p.createJSDocOverloadTag(vr,ta,Lr),jt,ba)}function Hf(jt,vr){for(;!Qs(jt)||!Qs(vr);)if(!Qs(jt)&&!Qs(vr)&&jt.right.escapedText===vr.right.escapedText)jt=jt.left,vr=vr.left;else return false;return jt.escapedText===vr.escapedText}function DT(jt){return L_(1,jt)}function L_(jt,vr,xr){let Xr=true,Lr=false;for(;;)switch(va()){case 60:if(Xr){let ta=Gf(jt,vr);return ta&&(ta.kind===341||ta.kind===348)&&xr&&(Qs(ta.name)||!Hf(xr,ta.name.left))?false:ta}Lr=false;break;case 4:Xr=true,Lr=false;break;case 42:Lr&&(Xr=false),Lr=true;break;case 80:Xr=false;break;case 1:return false}}function Gf(jt,vr){or.assert(ne()===60);let xr=t.getTokenFullStart();va();let Xr=Jd(),Lr=I_(),ta;switch(Xr.escapedText){case "type":return jt===1&&zE(xr,Xr);case "prop":case "property":ta=1;break;case "arg":case "argument":case "param":ta=6;break;case "template":return WA(xr,Xr,vr,Lr);case "this":return VA(xr,Xr,vr,Lr);default:return false}return jt&ta?D0(xr,Xr,jt,vr):false}function ET(){let jt=$t(),vr=E1(23);vr&&gu();let xr=iu(false,true),Xr=Jd(Dt.Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces),Lr;if(vr&&(gu(),Gt(64),Lr=en(16777216,l1),Gt(24)),!dA(Xr))return Et(p.createTypeParameterDeclaration(xr,Xr,void 0,Lr),jt)}function Kf(){let jt=$t(),vr=[];do{gu();let xr=ET();xr!==void 0&&vr.push(xr),I_();}while(E1(28));return is(vr,jt)}function WA(jt,vr,xr,Xr){let Lr=ne()===19?Ae():void 0,ta=Kf();return Et(p.createJSDocTemplateTag(vr,Lr,ta,y(jt,$t(),xr,Xr)),jt)}function E1(jt){return ne()===jt?(va(),true):false}function CT(){let jt=Jd();for(di(23)&&Gt(24);di(25);){let vr=Jd();di(23)&&Gt(24),jt=N(jt,vr);}return jt}function Jd(jt){if(!Bu(ne()))return To(80,!jt,jt||Dt.Identifier_expected);Fr++;let vr=t.getTokenStart(),xr=t.getTokenEnd(),Xr=ne(),Lr=Np(t.getTokenValue()),ta=Et(P(Lr,Xr),vr,xr);return va(),ta}}})(Jp=e.JSDocParser||(e.JSDocParser={}));})(hA||(hA={}));WAe=new WeakSet;Wwe=new WeakSet;(e=>{function t(b,C,P,U){if(U=U||or.shouldAssert(2),p(b,C,P,U),Bzt(P))return b;if(b.statements.length===0)return hA.parseSourceFile(b.fileName,C,b.languageVersion,void 0,true,b.scriptKind,b.setExternalModuleIndicator,b.jsDocParsingMode);$Xt(b),hA.fixupParentReferences(b);let $=b.text,S=f(b),T=l(b,P);p(b,C,T,U),or.assert(T.span.start<=P.span.start),or.assert(eb(T.span)===eb(P.span)),or.assert(eb(LP(T))===eb(LP(P)));let O=LP(T).length-T.span.length;c(b,T.span.start,eb(T.span),eb(LP(T)),O,$,C,U);let F=hA.parseSourceFile(b.fileName,C,b.languageVersion,S,true,b.scriptKind,b.setExternalModuleIndicator,b.jsDocParsingMode);return F.commentDirectives=r(b.commentDirectives,F.commentDirectives,T.span.start,eb(T.span),O,$,C,U),F.impliedNodeFormat=b.impliedNodeFormat,bXt(b,F),F}e.updateSourceFile=t;function r(b,C,P,U,$,S,T,O){if(!b)return C;let F,B=false;for(let q of b){let{range:H,type:te}=q;if(H.end<P)F=kd(F,q);else if(H.pos>U){L();let Z={range:{pos:H.pos+$,end:H.end+$},type:te};F=kd(F,Z),O&&or.assert(S.substring(H.pos,H.end)===T.substring(Z.range.pos,Z.range.end));}}return L(),F;function L(){B||(B=true,F?C&&F.push(...C):F=C);}}function i(b,C,P,U,$,S,T){P?F(b):O(b);return;function O(B){let L="";if(T&&a(B)&&(L=$.substring(B.pos,B.end)),xAe(B,C),q4(B,B.pos+U,B.end+U),T&&a(B)&&or.assert(L===S.substring(B.pos,B.end)),z0(B,O,F),_A(B))for(let q of B.jsDoc)O(q);u(B,T);}function F(B){q4(B,B.pos+U,B.end+U);for(let L of B)O(L);}}function a(b){switch(b.kind){case 11:case 9:case 80:return true}return false}function o(b,C,P,U,$){or.assert(b.end>=C,"Adjusting an element that was entirely before the change range"),or.assert(b.pos<=P,"Adjusting an element that was entirely after the change range"),or.assert(b.pos<=b.end);let S=Math.min(b.pos,U),T=b.end>=P?b.end+$:Math.min(b.end,U);if(or.assert(S<=T),b.parent){let O=b.parent;or.assertGreaterThanOrEqual(S,O.pos),or.assertLessThanOrEqual(T,O.end);}q4(b,S,T);}function u(b,C){if(C){let P=b.pos,U=$=>{or.assert($.pos>=P),P=$.end;};if(_A(b))for(let $ of b.jsDoc)U($);z0(b,U),or.assert(P<=b.end);}}function c(b,C,P,U,$,S,T,O){F(b);return;function F(L){if(or.assert(L.pos<=L.end),L.pos>P){i(L,b,false,$,S,T,O);return}let q=L.end;if(q>=C){if(hse(L),xAe(L,b),o(L,C,P,U,$),z0(L,F,B),_A(L))for(let H of L.jsDoc)F(H);u(L,O);return}or.assert(q<C);}function B(L){if(or.assert(L.pos<=L.end),L.pos>P){i(L,b,true,$,S,T,O);return}let q=L.end;if(q>=C){hse(L),o(L,C,P,U,$);for(let H of L)F(H);return}or.assert(q<C);}}function l(b,C){let P=C.span.start;for(let S=0;P>0&&S<=1;S++){let T=h(b,P);or.assert(T.pos<=P);let O=T.pos;P=Math.max(0,O-1);}let U=Nzt(P,eb(C.span)),$=C.newLength+(C.span.start-P);return q5e(U,$)}function h(b,C){let P=b,U;if(z0(b,S),U){let T=$(U);T.pos>P.pos&&(P=T);}return P;function $(T){for(;;){let O=EGt(T);if(O)T=O;else return T}}function S(T){if(!dA(T))if(T.pos<=C){if(T.pos>=P.pos&&(P=T),C<T.end)return z0(T,S),true;or.assert(T.end<=C),U=T;}else return or.assert(T.pos>C),true}}function p(b,C,P,U){let $=b.text;if(P&&(or.assert($.length-P.span.length+P.newLength===C.length),U||or.shouldAssert(3))){let S=$.substr(0,P.span.start),T=C.substr(0,P.span.start);or.assert(S===T);let O=$.substring(eb(P.span),$.length),F=C.substring(eb(LP(P)),C.length);or.assert(O===F);}}function f(b){let C=b.statements,P=0;or.assert(P<C.length);let U=C[P],$=-1;return {currentNode(T){return T!==$&&(U&&U.end===T&&P<C.length-1&&(P++,U=C[P]),(!U||U.pos!==T)&&S(T)),$=T,or.assert(!U||U.pos===T),U}};function S(T){C=void 0,P=-1,U=void 0,z0(b,O,F);return;function O(B){return T>=B.pos&&T<B.end?(z0(B,O,F),true):false}function F(B){if(T>=B.pos&&T<B.end)for(let L=0;L<B.length;L++){let q=B[L];if(q){if(q.pos===T)return C=B,P=L,U=q,true;if(q.pos<T&&T<q.end)return z0(q,O,F),true}}return false}}}e.createSyntaxCursor=f;let v;(b=>{b[b.Value=-1]="Value";})(v||(v={}));})(hU||(hU={}));Gae=new Map;XXt=/^\/\/\/\s*<(\S+)\s.*?\/>/m,YXt=/^\/\/\/?\s*@([^\s:]+)((?:[^\S\r\n]|:).*)?$/m;GP=Ise(Sse.Latest,true);toe=class{constructor(e,t,r){this.pos=t,this.end=r,this.kind=e,this.id=0,this.flags=0,this.modifierFlagsCache=0,this.transformFlags=0,this.parent=void 0,this.original=void 0,this.emitNode=void 0;}assertHasRealPosition(e){or.assert(!nN(this.pos)&&!nN(this.end),e||"Node must have a real position for this operation");}getSourceFile(){return j4(this)}getStart(e,t){return this.assertHasRealPosition(),lU(this,e,t)}getFullStart(){return this.assertHasRealPosition(),this.pos}getEnd(){return this.assertHasRealPosition(),this.end}getWidth(e){return this.assertHasRealPosition(),this.getEnd()-this.getStart(e)}getFullWidth(){return this.assertHasRealPosition(),this.end-this.pos}getLeadingTriviaWidth(e){return this.assertHasRealPosition(),this.getStart(e)-this.pos}getFullText(e){return this.assertHasRealPosition(),(e||this.getSourceFile()).text.substring(this.pos,this.end)}getText(e){return this.assertHasRealPosition(),e||(e=this.getSourceFile()),e.text.substring(this.getStart(e),this.getEnd())}getChildCount(e){return this.getChildren(e).length}getChildAt(e,t){return this.getChildren(t)[e]}getChildren(e=j4(this)){return this.assertHasRealPosition("Node without a real position cannot be scanned and thus has no token nodes - use forEachChild and collect the result if that's fine"),qwe(this,e)??vXt(this,e,eYt(this,e))}getFirstToken(e){this.assertHasRealPosition();let t=this.getChildren(e);if(!t.length)return;let r=l5e(t,i=>i.kind<309||i.kind>351);return r.kind<166?r:r.getFirstToken(e)}getLastToken(e){this.assertHasRealPosition();let t=this.getChildren(e),r=Gk(t);if(r)return r.kind<166?r:r.getLastToken(e)}forEachChild(e,t){return z0(this,e,t)}};roe=class{constructor(e,t,r){this.pos=t,this.end=r,this.kind=e,this.id=0,this.flags=0,this.transformFlags=0,this.parent=void 0,this.emitNode=void 0;}getSourceFile(){return j4(this)}getStart(e,t){return lU(this,e,t)}getFullStart(){return this.pos}getEnd(){return this.end}getWidth(e){return this.getEnd()-this.getStart(e)}getFullWidth(){return this.end-this.pos}getLeadingTriviaWidth(e){return this.getStart(e)-this.pos}getFullText(e){return (e||this.getSourceFile()).text.substring(this.pos,this.end)}getText(e){return e||(e=this.getSourceFile()),e.text.substring(this.getStart(e),this.getEnd())}getChildCount(){return this.getChildren().length}getChildAt(e){return this.getChildren()[e]}getChildren(){return this.kind===1&&this.jsDoc||Yu}getFirstToken(){}getLastToken(){}forEachChild(){}},rYt=class{constructor(e,t){this.flags=e,this.escapedName=t,this.declarations=void 0,this.valueDeclaration=void 0,this.id=0,this.mergeId=0,this.parent=void 0,this.members=void 0,this.exports=void 0,this.exportSymbol=void 0,this.constEnumOnlyModule=void 0,this.isReferenced=void 0,this.lastAssignmentPos=void 0,this.links=void 0;}getFlags(){return this.flags}get name(){return ase(this)}getEscapedName(){return this.escapedName}getName(){return this.name}getDeclarations(){return this.declarations}getDocumentationComment(e){if(!this.documentationComment)if(this.documentationComment=Yu,!this.declarations&&aAe(this)&&this.links.target&&aAe(this.links.target)&&this.links.target.links.tupleLabelDeclaration){let t=this.links.target.links.tupleLabelDeclaration;this.documentationComment=HP([t],e);}else this.documentationComment=HP(this.declarations,e);return this.documentationComment}getContextualDocumentationComment(e,t){if(e){if(Gq(e)&&(this.contextualGetAccessorDocumentationComment||(this.contextualGetAccessorDocumentationComment=Yu,this.contextualGetAccessorDocumentationComment=HP(hD(this.declarations,Gq),t)),UP(this.contextualGetAccessorDocumentationComment)))return this.contextualGetAccessorDocumentationComment;if(Hq(e)&&(this.contextualSetAccessorDocumentationComment||(this.contextualSetAccessorDocumentationComment=Yu,this.contextualSetAccessorDocumentationComment=HP(hD(this.declarations,Hq),t)),UP(this.contextualSetAccessorDocumentationComment)))return this.contextualSetAccessorDocumentationComment}return this.getDocumentationComment(t)}getJsDocTags(e){return this.tags===void 0&&(this.tags=Yu,this.tags=nU(this.declarations,e)),this.tags}getContextualJsDocTags(e,t){if(e){if(Gq(e)&&(this.contextualGetAccessorTags||(this.contextualGetAccessorTags=Yu,this.contextualGetAccessorTags=nU(hD(this.declarations,Gq),t)),UP(this.contextualGetAccessorTags)))return this.contextualGetAccessorTags;if(Hq(e)&&(this.contextualSetAccessorTags||(this.contextualSetAccessorTags=Yu,this.contextualSetAccessorTags=nU(hD(this.declarations,Hq),t)),UP(this.contextualSetAccessorTags)))return this.contextualSetAccessorTags}return this.getJsDocTags(t)}},Hwe=class extends roe{constructor(e,t,r){super(e,t,r);}},Gwe=class extends roe{constructor(e,t,r){super(e,t,r);}get text(){return Fd(this)}},Kwe=class extends roe{constructor(e,t,r){super(e,t,r);}get text(){return Fd(this)}},nYt=class{constructor(e,t){this.flags=t,this.checker=e;}getFlags(){return this.flags}getSymbol(){return this.symbol}getProperties(){return this.checker.getPropertiesOfType(this)}getProperty(e){return this.checker.getPropertyOfType(this,e)}getApparentProperties(){return this.checker.getAugmentedPropertiesOfType(this)}getCallSignatures(){return this.checker.getSignaturesOfType(this,0)}getConstructSignatures(){return this.checker.getSignaturesOfType(this,1)}getStringIndexType(){return this.checker.getIndexTypeOfType(this,0)}getNumberIndexType(){return this.checker.getIndexTypeOfType(this,1)}getBaseTypes(){return this.isClassOrInterface()?this.checker.getBaseTypes(this):void 0}isNullableType(){return this.checker.isNullableType(this)}getNonNullableType(){return this.checker.getNonNullableType(this)}getNonOptionalType(){return this.checker.getNonOptionalType(this)}getConstraint(){return this.checker.getBaseConstraintOfType(this)}getDefault(){return this.checker.getDefaultFromTypeParameter(this)}isUnion(){return !!(this.flags&1048576)}isIntersection(){return !!(this.flags&2097152)}isUnionOrIntersection(){return !!(this.flags&3145728)}isLiteral(){return !!(this.flags&2432)}isStringLiteral(){return !!(this.flags&128)}isNumberLiteral(){return !!(this.flags&256)}isTypeParameter(){return !!(this.flags&262144)}isClassOrInterface(){return !!(Jae(this)&3)}isClass(){return !!(Jae(this)&1)}isIndexType(){return !!(this.flags&4194304)}get typeArguments(){if(Jae(this)&4)return this.checker.getTypeArguments(this)}},iYt=class{constructor(e,t){this.flags=t,this.checker=e;}getDeclaration(){return this.declaration}getTypeParameters(){return this.typeParameters}getParameters(){return this.parameters}getReturnType(){return this.checker.getReturnTypeOfSignature(this)}getTypeParameterAtPosition(e){let t=this.checker.getParameterType(this,e);if(t.isIndexType()&&KGt(t.type)){let r=t.type.getConstraint();if(r)return this.checker.getIndexType(r)}return t}getDocumentationComment(){return this.documentationComment||(this.documentationComment=HP(tse(this.declaration),this.checker))}getJsDocTags(){return this.jsDocTags||(this.jsDocTags=nU(tse(this.declaration),this.checker))}};aYt=class extends toe{constructor(e,t,r){super(e,t,r);}update(e,t){return UXt(this,e,t)}getLineAndCharacterOfPosition(e){return I5e(this,e)}getLineStarts(){return nse(this)}getPositionOfLineAndCharacter(e,t,r){return bzt(nse(this),e,t,this.text,r)}getLineEndOfPosition(e){let{line:t}=this.getLineAndCharacterOfPosition(e),r=this.getLineStarts(),i;t+1>=r.length&&(i=this.getEnd()),i||(i=r[t+1]-1);let a=this.getFullText();return a[i]===`
|
|
456
456
|
`&&a[i-1]==="\r"?i-1:i}getNamedDeclarations(){return this.namedDeclarations||(this.namedDeclarations=this.computeNamedDeclarations()),this.namedDeclarations}computeNamedDeclarations(){let e=RWt();return this.forEachChild(a),e;function t(o){let u=i(o);u&&e.add(u,o);}function r(o){let u=e.get(o);return u||e.set(o,u=[]),u}function i(o){let u=Lse(o);return u&&(ywe(u)&&gD(u.expression)?u.expression.name.text:X5e(u)?getNameFromPropertyName(u):void 0)}function a(o){switch(o.kind){case 262:case 218:case 174:case 173:let u=o,c=i(u);if(c){let p=r(c),f=Gk(p);f&&u.parent===f.parent&&u.symbol===f.symbol?u.body&&!f.body&&(p[p.length-1]=u):p.push(u);}z0(o,a);break;case 263:case 231:case 264:case 265:case 266:case 267:case 271:case 281:case 276:case 273:case 274:case 177:case 178:case 187:t(o),z0(o,a);break;case 169:if(!sN(o,31))break;case 260:case 208:{let p=o;if(hHt(p.name)){z0(p.name,a);break}p.initializer&&a(p.initializer);}case 306:case 172:case 171:t(o);break;case 278:let l=o;l.exportClause&&(YKt(l.exportClause)?Cf(l.exportClause.elements,a):a(l.exportClause.name));break;case 272:let h=o.importClause;h&&(h.name&&t(h.name),h.namedBindings&&(h.namedBindings.kind===274?t(h.namedBindings):Cf(h.namedBindings.elements,a)));break;case 226:Use(o)!==0&&t(o);default:z0(o,a);}}}},sYt=class{constructor(e,t,r){this.fileName=e,this.text=t,this.skipTrivia=r||(i=>i);}getLineAndCharacterOfPosition(e){return I5e(this,e)}};uYt=["getSemanticDiagnostics","getSuggestionDiagnostics","getCompilerOptionsDiagnostics","getSemanticClassifications","getEncodedSemanticClassifications","getCodeFixesAtPosition","getCombinedCodeFix","applyCodeActionCommand","organizeImports","getEditsForFileRename","getEmitOutput","getApplicableRefactors","getEditsForRefactor","prepareCallHierarchy","provideCallHierarchyIncomingCalls","provideCallHierarchyOutgoingCalls","provideInlayHints","getSupportedCodeFixes","getPasteEdits"],[...uYt,"getCompletionsAtPosition","getCompletionEntryDetails","getCompletionEntrySymbol","getSignatureHelpItems","getQuickInfoAtPosition","getDefinitionAtPosition","getDefinitionAndBoundSpan","getImplementationAtPosition","getTypeDefinitionAtPosition","getReferencesAtPosition","findReferences","getDocumentHighlights","getNavigateToItems","getRenameInfo","findRenameLocations","getApplicableRefactors","preparePasteEditsForFile"];NGt(oYt());Qwe=new Proxy({},{get:()=>true}),Zwe=Qwe["4.8"];lYt={},eke=new Proxy({},{get:(e,t)=>t}),cYt=eke,pYt=eke,kt=cYt,Jl=pYt,tke=Qwe["5.0"],Sn=Ca,_Yt=new Set([Sn.AmpersandAmpersandToken,Sn.BarBarToken,Sn.QuestionQuestionToken]),dYt=new Set([Ca.AmpersandAmpersandEqualsToken,Ca.AmpersandEqualsToken,Ca.AsteriskAsteriskEqualsToken,Ca.AsteriskEqualsToken,Ca.BarBarEqualsToken,Ca.BarEqualsToken,Ca.CaretEqualsToken,Ca.EqualsToken,Ca.GreaterThanGreaterThanEqualsToken,Ca.GreaterThanGreaterThanGreaterThanEqualsToken,Ca.LessThanLessThanEqualsToken,Ca.MinusEqualsToken,Ca.PercentEqualsToken,Ca.PlusEqualsToken,Ca.QuestionQuestionEqualsToken,Ca.SlashEqualsToken]),fYt=new Set([Sn.AmpersandAmpersandToken,Sn.AmpersandToken,Sn.AsteriskAsteriskToken,Sn.AsteriskToken,Sn.BarBarToken,Sn.BarToken,Sn.CaretToken,Sn.EqualsEqualsEqualsToken,Sn.EqualsEqualsToken,Sn.ExclamationEqualsEqualsToken,Sn.ExclamationEqualsToken,Sn.GreaterThanEqualsToken,Sn.GreaterThanGreaterThanGreaterThanToken,Sn.GreaterThanGreaterThanToken,Sn.GreaterThanToken,Sn.InKeyword,Sn.InstanceOfKeyword,Sn.LessThanEqualsToken,Sn.LessThanLessThanToken,Sn.LessThanToken,Sn.MinusToken,Sn.PercentToken,Sn.PlusToken,Sn.SlashToken]);NYt=class extends Error{fileName;location;constructor(e,t,r){super(e),this.fileName=t,this.location=r,Object.defineProperty(this,"name",{configurable:true,enumerable:false,value:new.target.name});}get index(){return this.location.start.offset}get lineNumber(){return this.location.start.line}get column(){return this.location.start.column}};Qe=Ca;HYt=class{constructor(e,t){gWt(this,si),IP(this,"allowPattern",false),IP(this,"ast"),IP(this,"esTreeNodeToTSNodeMap",new WeakMap),IP(this,"options"),IP(this,"tsNodeToESTreeNodeMap",new WeakMap),this.ast=e,this.options={...t};}assertModuleSpecifier(e,t){var r;!t&&e.moduleSpecifier==null&&li(this,si,Fc).call(this,e,"Module specifier must be a string literal."),e.moduleSpecifier&&((r=e.moduleSpecifier)==null?void 0:r.kind)!==Qe.StringLiteral&&li(this,si,Fc).call(this,e.moduleSpecifier,"Module specifier must be a string literal.");}convertBindingNameWithTypeAnnotation(e,t,r){let i=this.convertPattern(e);return t&&(i.typeAnnotation=this.convertTypeAnnotation(t,r),this.fixParentLocation(i,i.typeAnnotation.range)),i}convertBodyExpressions(e,t){let r=CYt(t);return e.map(i=>{let a=this.convertChild(i);if(r){if(a!=null&&a.expression&&Twe(i)&&Zk(i.expression)){let o=a.expression.raw;return a.directive=o.slice(1,-1),a}r=false;}return a}).filter(i=>i)}convertChainExpression(e,t){let{child:r,isOptional:i}=e.type===kt.MemberExpression?{child:e.object,isOptional:e.optional}:e.type===kt.CallExpression?{child:e.callee,isOptional:e.optional}:{child:e.expression,isOptional:false},a=TYt(t,r);if(!a&&!i)return e;if(a&&nke(r)){let o=r.expression;e.type===kt.MemberExpression?e.object=o:e.type===kt.CallExpression?e.callee=o:e.expression=o;}return this.createNode(t,{type:kt.ChainExpression,expression:e})}convertChild(e,t){return this.converter(e,t,false)}convertPattern(e,t){return this.converter(e,t,true)}convertTypeAnnotation(e,t){let r=t?.kind===Qe.FunctionType||t?.kind===Qe.ConstructorType?2:1,i=[e.getFullStart()-r,e.end],a=pA(i,this.ast);return {type:kt.TSTypeAnnotation,loc:a,range:i,typeAnnotation:this.convertChild(e)}}convertTypeArgumentsToTypeParameterInstantiation(e,t){let r=tb(e,this.ast,this.ast);return this.createNode(t,{type:kt.TSTypeParameterInstantiation,range:[e.pos-1,r.end],params:e.map(i=>this.convertChild(i))})}convertTSTypeParametersToTypeParametersDeclaration(e){let t=tb(e,this.ast,this.ast),r=[e.pos-1,t.end];return {type:kt.TSTypeParameterDeclaration,loc:pA(r,this.ast),range:r,params:e.map(i=>this.convertChild(i))}}convertParameters(e){return e!=null&&e.length?e.map(t=>{var r;let i=this.convertChild(t);return i.decorators=((r=Vk(t))==null?void 0:r.map(a=>this.convertChild(a)))??[],i}):[]}converter(e,t,r){if(!e)return null;li(this,si,oke).call(this,e);let i=this.allowPattern;r!=null&&(this.allowPattern=r);let a=this.convertNode(e,t??e.parent);return this.registerTSNodeInNodeMap(e,a),this.allowPattern=i,a}convertImportAttributes(e){return e==null?[]:e.elements.map(t=>this.convertChild(t))}convertJSXIdentifier(e){let t=this.createNode(e,{type:kt.JSXIdentifier,name:e.getText()});return this.registerTSNodeInNodeMap(e,t),t}convertJSXNamespaceOrIdentifier(e){if(e.kind===Ca.JsxNamespacedName){let i=this.createNode(e,{type:kt.JSXNamespacedName,name:this.createNode(e.name,{type:kt.JSXIdentifier,name:e.name.text}),namespace:this.createNode(e.namespace,{type:kt.JSXIdentifier,name:e.namespace.text})});return this.registerTSNodeInNodeMap(e,i),i}let t=e.getText(),r=t.indexOf(":");if(r>0){let i=Rk(e,this.ast),a=this.createNode(e,{type:kt.JSXNamespacedName,range:i,name:this.createNode(e,{type:kt.JSXIdentifier,range:[i[0]+r+1,i[1]],name:t.slice(r+1)}),namespace:this.createNode(e,{type:kt.JSXIdentifier,range:[i[0],i[0]+r],name:t.slice(0,r)})});return this.registerTSNodeInNodeMap(e,a),a}return this.convertJSXIdentifier(e)}convertJSXTagName(e,t){let r;switch(e.kind){case Qe.PropertyAccessExpression:e.name.kind===Qe.PrivateIdentifier&&li(this,si,ka).call(this,e.name,"Non-private identifier expected."),r=this.createNode(e,{type:kt.JSXMemberExpression,object:this.convertJSXTagName(e.expression,t),property:this.convertJSXIdentifier(e.name)});break;case Qe.ThisKeyword:case Qe.Identifier:default:return this.convertJSXNamespaceOrIdentifier(e)}return this.registerTSNodeInNodeMap(e,r),r}convertMethodSignature(e){return this.createNode(e,{type:kt.TSMethodSignature,accessibility:uA(e),computed:Mk(e.name),key:this.convertChild(e.name),kind:(()=>{switch(e.kind){case Qe.GetAccessor:return "get";case Qe.SetAccessor:return "set";case Qe.MethodSignature:return "method"}})(),optional:GAe(e),params:this.convertParameters(e.parameters),readonly:gs(Qe.ReadonlyKeyword,e),returnType:e.type&&this.convertTypeAnnotation(e.type,e),static:gs(Qe.StaticKeyword,e),typeParameters:e.typeParameters&&this.convertTSTypeParametersToTypeParametersDeclaration(e.typeParameters)})}fixParentLocation(e,t){t[0]<e.range[0]&&(e.range[0]=t[0],e.loc.start=iU(e.range[0],this.ast)),t[1]>e.range[1]&&(e.range[1]=t[1],e.loc.end=iU(e.range[1],this.ast));}convertNode(e,t){var r,i,a,o,u,c,l,h;switch(e.kind){case Qe.SourceFile:return this.createNode(e,{type:kt.Program,range:[e.getStart(this.ast),e.endOfFileToken.end],body:this.convertBodyExpressions(e.statements,e),comments:void 0,sourceType:e.externalModuleIndicator?"module":"script",tokens:void 0});case Qe.Block:return this.createNode(e,{type:kt.BlockStatement,body:this.convertBodyExpressions(e.statements,e)});case Qe.Identifier:return RYt(e)?this.createNode(e,{type:kt.ThisExpression}):this.createNode(e,{type:kt.Identifier,decorators:[],name:e.text,optional:false,typeAnnotation:void 0});case Qe.PrivateIdentifier:return this.createNode(e,{type:kt.PrivateIdentifier,name:e.text.slice(1)});case Qe.WithStatement:return this.createNode(e,{type:kt.WithStatement,body:this.convertChild(e.statement),object:this.convertChild(e.expression)});case Qe.ReturnStatement:return this.createNode(e,{type:kt.ReturnStatement,argument:this.convertChild(e.expression)});case Qe.LabeledStatement:return this.createNode(e,{type:kt.LabeledStatement,body:this.convertChild(e.statement),label:this.convertChild(e.label)});case Qe.ContinueStatement:return this.createNode(e,{type:kt.ContinueStatement,label:this.convertChild(e.label)});case Qe.BreakStatement:return this.createNode(e,{type:kt.BreakStatement,label:this.convertChild(e.label)});case Qe.IfStatement:return this.createNode(e,{type:kt.IfStatement,alternate:this.convertChild(e.elseStatement),consequent:this.convertChild(e.thenStatement),test:this.convertChild(e.expression)});case Qe.SwitchStatement:return e.caseBlock.clauses.filter(p=>p.kind===Qe.DefaultClause).length>1&&li(this,si,ka).call(this,e,"A 'default' clause cannot appear more than once in a 'switch' statement."),this.createNode(e,{type:kt.SwitchStatement,cases:e.caseBlock.clauses.map(p=>this.convertChild(p)),discriminant:this.convertChild(e.expression)});case Qe.CaseClause:case Qe.DefaultClause:return this.createNode(e,{type:kt.SwitchCase,consequent:e.statements.map(p=>this.convertChild(p)),test:e.kind===Qe.CaseClause?this.convertChild(e.expression):null});case Qe.ThrowStatement:return e.expression.end===e.expression.pos&&li(this,si,Fc).call(this,e,"A throw statement must throw an expression."),this.createNode(e,{type:kt.ThrowStatement,argument:this.convertChild(e.expression)});case Qe.TryStatement:return this.createNode(e,{type:kt.TryStatement,block:this.convertChild(e.tryBlock),finalizer:this.convertChild(e.finallyBlock),handler:this.convertChild(e.catchClause)});case Qe.CatchClause:return (r=e.variableDeclaration)!=null&&r.initializer&&li(this,si,ka).call(this,e.variableDeclaration.initializer,"Catch clause variable cannot have an initializer."),this.createNode(e,{type:kt.CatchClause,body:this.convertChild(e.block),param:e.variableDeclaration?this.convertBindingNameWithTypeAnnotation(e.variableDeclaration.name,e.variableDeclaration.type):null});case Qe.WhileStatement:return this.createNode(e,{type:kt.WhileStatement,body:this.convertChild(e.statement),test:this.convertChild(e.expression)});case Qe.DoStatement:return this.createNode(e,{type:kt.DoWhileStatement,body:this.convertChild(e.statement),test:this.convertChild(e.expression)});case Qe.ForStatement:return this.createNode(e,{type:kt.ForStatement,body:this.convertChild(e.statement),init:this.convertChild(e.initializer),test:this.convertChild(e.condition),update:this.convertChild(e.incrementor)});case Qe.ForInStatement:return li(this,si,yse).call(this,e.initializer,e.kind),this.createNode(e,{type:kt.ForInStatement,body:this.convertChild(e.statement),left:this.convertPattern(e.initializer),right:this.convertChild(e.expression)});case Qe.ForOfStatement:return li(this,si,yse).call(this,e.initializer,e.kind),this.createNode(e,{type:kt.ForOfStatement,await:!!(e.awaitModifier&&e.awaitModifier.kind===Qe.AwaitKeyword),body:this.convertChild(e.statement),left:this.convertPattern(e.initializer),right:this.convertChild(e.expression)});case Qe.FunctionDeclaration:{let p=gs(Qe.DeclareKeyword,e),f=gs(Qe.AsyncKeyword,e),v=!!e.asteriskToken;p?e.body?li(this,si,ka).call(this,e,"An implementation cannot be declared in ambient contexts."):f?li(this,si,ka).call(this,e,"'async' modifier cannot be used in an ambient context."):v&&li(this,si,ka).call(this,e,"Generators are not allowed in an ambient context."):!e.body&&v&&li(this,si,ka).call(this,e,"A function signature cannot be declared as a generator.");let b=this.createNode(e,{type:e.body?kt.FunctionDeclaration:kt.TSDeclareFunction,async:f,body:this.convertChild(e.body)||void 0,declare:p,expression:false,generator:v,id:this.convertChild(e.name),params:this.convertParameters(e.parameters),returnType:e.type&&this.convertTypeAnnotation(e.type,e),typeParameters:e.typeParameters&&this.convertTSTypeParametersToTypeParametersDeclaration(e.typeParameters)});return this.fixExports(e,b)}case Qe.VariableDeclaration:{let p=!!e.exclamationToken,f=this.convertChild(e.initializer),v=this.convertBindingNameWithTypeAnnotation(e.name,e.type,e);return p&&(f?li(this,si,ka).call(this,e,"Declarations with initializers cannot also have definite assignment assertions."):(v.type!==kt.Identifier||!v.typeAnnotation)&&li(this,si,ka).call(this,e,"Declarations with definite assignment assertions must also have type annotations.")),this.createNode(e,{type:kt.VariableDeclarator,definite:p,id:v,init:f})}case Qe.VariableStatement:{let p=this.createNode(e,{type:kt.VariableDeclaration,declarations:e.declarationList.declarations.map(f=>this.convertChild(f)),declare:gs(Qe.DeclareKeyword,e),kind:mse(e.declarationList)});return p.declarations.length||li(this,si,Fc).call(this,e,"A variable declaration list must have at least one variable declarator."),(p.kind==="using"||p.kind==="await using")&&e.declarationList.declarations.forEach((f,v)=>{p.declarations[v].init==null&&li(this,si,ka).call(this,f,`'${p.kind}' declarations must be initialized.`),p.declarations[v].id.type!==kt.Identifier&&li(this,si,ka).call(this,f.name,`'${p.kind}' declarations may not have binding patterns.`);}),(p.declare||["await using","const","using"].includes(p.kind))&&e.declarationList.declarations.forEach((f,v)=>{p.declarations[v].definite&&li(this,si,ka).call(this,f,"A definite assignment assertion '!' is not permitted in this context.");}),p.declare&&e.declarationList.declarations.forEach((f,v)=>{p.declarations[v].init&&(["let","var"].includes(p.kind)||p.declarations[v].id.typeAnnotation)&&li(this,si,ka).call(this,f,"Initializers are not permitted in ambient contexts.");}),this.fixExports(e,p)}case Qe.VariableDeclarationList:{let p=this.createNode(e,{type:kt.VariableDeclaration,declarations:e.declarations.map(f=>this.convertChild(f)),declare:false,kind:mse(e)});return (p.kind==="using"||p.kind==="await using")&&e.declarations.forEach((f,v)=>{p.declarations[v].init!=null&&li(this,si,ka).call(this,f,`'${p.kind}' declarations may not be initialized in for statement.`),p.declarations[v].id.type!==kt.Identifier&&li(this,si,ka).call(this,f.name,`'${p.kind}' declarations may not have binding patterns.`);}),p}case Qe.ExpressionStatement:return this.createNode(e,{type:kt.ExpressionStatement,directive:void 0,expression:this.convertChild(e.expression)});case Qe.ThisKeyword:return this.createNode(e,{type:kt.ThisExpression});case Qe.ArrayLiteralExpression:return this.allowPattern?this.createNode(e,{type:kt.ArrayPattern,decorators:[],elements:e.elements.map(p=>this.convertPattern(p)),optional:false,typeAnnotation:void 0}):this.createNode(e,{type:kt.ArrayExpression,elements:e.elements.map(p=>this.convertChild(p))});case Qe.ObjectLiteralExpression:{if(this.allowPattern)return this.createNode(e,{type:kt.ObjectPattern,decorators:[],optional:false,properties:e.properties.map(f=>this.convertPattern(f)),typeAnnotation:void 0});let p=[];for(let f of e.properties)(f.kind===Qe.GetAccessor||f.kind===Qe.SetAccessor||f.kind===Qe.MethodDeclaration)&&!f.body&&li(this,si,Fc).call(this,f.end-1,"'{' expected."),p.push(this.convertChild(f));return this.createNode(e,{type:kt.ObjectExpression,properties:p})}case Qe.PropertyAssignment:{let{exclamationToken:p,questionToken:f}=e;return f&&li(this,si,ka).call(this,f,"A property assignment cannot have a question token."),p&&li(this,si,ka).call(this,p,"A property assignment cannot have an exclamation token."),this.createNode(e,{type:kt.Property,computed:Mk(e.name),key:this.convertChild(e.name),kind:"init",method:false,optional:false,shorthand:false,value:this.converter(e.initializer,e,this.allowPattern)})}case Qe.ShorthandPropertyAssignment:{let{exclamationToken:p,modifiers:f,questionToken:v}=e;return f&&li(this,si,ka).call(this,f[0],"A shorthand property assignment cannot have modifiers."),v&&li(this,si,ka).call(this,v,"A shorthand property assignment cannot have a question token."),p&&li(this,si,ka).call(this,p,"A shorthand property assignment cannot have an exclamation token."),e.objectAssignmentInitializer?this.createNode(e,{type:kt.Property,computed:false,key:this.convertChild(e.name),kind:"init",method:false,optional:false,shorthand:true,value:this.createNode(e,{type:kt.AssignmentPattern,decorators:[],left:this.convertPattern(e.name),optional:false,right:this.convertChild(e.objectAssignmentInitializer),typeAnnotation:void 0})}):this.createNode(e,{type:kt.Property,computed:false,key:this.convertChild(e.name),kind:"init",method:false,optional:false,shorthand:true,value:this.convertChild(e.name)})}case Qe.ComputedPropertyName:return this.convertChild(e.expression);case Qe.PropertyDeclaration:{let p=gs(Qe.AbstractKeyword,e);p&&e.initializer&&li(this,si,ka).call(this,e.initializer,"Abstract property cannot have an initializer.");let f=gs(Qe.AccessorKeyword,e),v=f?p?kt.TSAbstractAccessorProperty:kt.AccessorProperty:p?kt.TSAbstractPropertyDefinition:kt.PropertyDefinition,b=this.convertChild(e.name);return this.createNode(e,{type:v,accessibility:uA(e),computed:Mk(e.name),declare:gs(Qe.DeclareKeyword,e),decorators:((i=Vk(e))==null?void 0:i.map(C=>this.convertChild(C)))??[],definite:!!e.exclamationToken,key:b,optional:(b.type===kt.Literal||e.name.kind===Qe.Identifier||e.name.kind===Qe.ComputedPropertyName||e.name.kind===Qe.PrivateIdentifier)&&!!e.questionToken,override:gs(Qe.OverrideKeyword,e),readonly:gs(Qe.ReadonlyKeyword,e),static:gs(Qe.StaticKeyword,e),typeAnnotation:e.type&&this.convertTypeAnnotation(e.type,e),value:p?null:this.convertChild(e.initializer)})}case Qe.GetAccessor:case Qe.SetAccessor:if(e.parent.kind===Qe.InterfaceDeclaration||e.parent.kind===Qe.TypeLiteral)return this.convertMethodSignature(e);case Qe.MethodDeclaration:{let p=this.createNode(e,{type:e.body?kt.FunctionExpression:kt.TSEmptyBodyFunctionExpression,range:[e.parameters.pos-1,e.end],async:gs(Qe.AsyncKeyword,e),body:this.convertChild(e.body),declare:false,expression:false,generator:!!e.asteriskToken,id:null,params:[],returnType:e.type&&this.convertTypeAnnotation(e.type,e),typeParameters:e.typeParameters&&this.convertTSTypeParametersToTypeParametersDeclaration(e.typeParameters)});p.typeParameters&&this.fixParentLocation(p,p.typeParameters.range);let f;if(t.kind===Qe.ObjectLiteralExpression)p.params=e.parameters.map(v=>this.convertChild(v)),f=this.createNode(e,{type:kt.Property,computed:Mk(e.name),key:this.convertChild(e.name),kind:"init",method:e.kind===Qe.MethodDeclaration,optional:!!e.questionToken,shorthand:false,value:p});else {p.params=this.convertParameters(e.parameters);let v=gs(Qe.AbstractKeyword,e)?kt.TSAbstractMethodDefinition:kt.MethodDefinition;f=this.createNode(e,{type:v,accessibility:uA(e),computed:Mk(e.name),decorators:((a=Vk(e))==null?void 0:a.map(b=>this.convertChild(b)))??[],key:this.convertChild(e.name),kind:"method",optional:!!e.questionToken,override:gs(Qe.OverrideKeyword,e),static:gs(Qe.StaticKeyword,e),value:p});}return e.kind===Qe.GetAccessor?f.kind="get":e.kind===Qe.SetAccessor?f.kind="set":!f.static&&e.name.kind===Qe.StringLiteral&&e.name.text==="constructor"&&f.type!==kt.Property&&(f.kind="constructor"),f}case Qe.Constructor:{let p=vYt(e),f=(p&&tb(p,e,this.ast))??e.getFirstToken(),v=this.createNode(e,{type:e.body?kt.FunctionExpression:kt.TSEmptyBodyFunctionExpression,range:[e.parameters.pos-1,e.end],async:false,body:this.convertChild(e.body),declare:false,expression:false,generator:false,id:null,params:this.convertParameters(e.parameters),returnType:e.type&&this.convertTypeAnnotation(e.type,e),typeParameters:e.typeParameters&&this.convertTSTypeParametersToTypeParametersDeclaration(e.typeParameters)});v.typeParameters&&this.fixParentLocation(v,v.typeParameters.range);let b=f.kind===Qe.StringLiteral?this.createNode(f,{type:kt.Literal,raw:f.getText(),value:"constructor"}):this.createNode(e,{type:kt.Identifier,range:[f.getStart(this.ast),f.end],decorators:[],name:"constructor",optional:false,typeAnnotation:void 0}),C=gs(Qe.StaticKeyword,e);return this.createNode(e,{type:gs(Qe.AbstractKeyword,e)?kt.TSAbstractMethodDefinition:kt.MethodDefinition,accessibility:uA(e),computed:false,decorators:[],key:b,kind:C?"method":"constructor",optional:false,override:false,static:C,value:v})}case Qe.FunctionExpression:return this.createNode(e,{type:kt.FunctionExpression,async:gs(Qe.AsyncKeyword,e),body:this.convertChild(e.body),declare:false,expression:false,generator:!!e.asteriskToken,id:this.convertChild(e.name),params:this.convertParameters(e.parameters),returnType:e.type&&this.convertTypeAnnotation(e.type,e),typeParameters:e.typeParameters&&this.convertTSTypeParametersToTypeParametersDeclaration(e.typeParameters)});case Qe.SuperKeyword:return this.createNode(e,{type:kt.Super});case Qe.ArrayBindingPattern:return this.createNode(e,{type:kt.ArrayPattern,decorators:[],elements:e.elements.map(p=>this.convertPattern(p)),optional:false,typeAnnotation:void 0});case Qe.OmittedExpression:return null;case Qe.ObjectBindingPattern:return this.createNode(e,{type:kt.ObjectPattern,decorators:[],optional:false,properties:e.elements.map(p=>this.convertPattern(p)),typeAnnotation:void 0});case Qe.BindingElement:{if(t.kind===Qe.ArrayBindingPattern){let f=this.convertChild(e.name,t);return e.initializer?this.createNode(e,{type:kt.AssignmentPattern,decorators:[],left:f,optional:false,right:this.convertChild(e.initializer),typeAnnotation:void 0}):e.dotDotDotToken?this.createNode(e,{type:kt.RestElement,argument:f,decorators:[],optional:false,typeAnnotation:void 0,value:void 0}):f}let p;return e.dotDotDotToken?p=this.createNode(e,{type:kt.RestElement,argument:this.convertChild(e.propertyName??e.name),decorators:[],optional:false,typeAnnotation:void 0,value:void 0}):p=this.createNode(e,{type:kt.Property,computed:!!(e.propertyName&&e.propertyName.kind===Qe.ComputedPropertyName),key:this.convertChild(e.propertyName??e.name),kind:"init",method:false,optional:false,shorthand:!e.propertyName,value:this.convertChild(e.name)}),e.initializer&&(p.value=this.createNode(e,{type:kt.AssignmentPattern,range:[e.name.getStart(this.ast),e.initializer.end],decorators:[],left:this.convertChild(e.name),optional:false,right:this.convertChild(e.initializer),typeAnnotation:void 0})),p}case Qe.ArrowFunction:return this.createNode(e,{type:kt.ArrowFunctionExpression,async:gs(Qe.AsyncKeyword,e),body:this.convertChild(e.body),expression:e.body.kind!==Qe.Block,generator:false,id:null,params:this.convertParameters(e.parameters),returnType:e.type&&this.convertTypeAnnotation(e.type,e),typeParameters:e.typeParameters&&this.convertTSTypeParametersToTypeParametersDeclaration(e.typeParameters)});case Qe.YieldExpression:return this.createNode(e,{type:kt.YieldExpression,argument:this.convertChild(e.expression),delegate:!!e.asteriskToken});case Qe.AwaitExpression:return this.createNode(e,{type:kt.AwaitExpression,argument:this.convertChild(e.expression)});case Qe.NoSubstitutionTemplateLiteral:return this.createNode(e,{type:kt.TemplateLiteral,expressions:[],quasis:[this.createNode(e,{type:kt.TemplateElement,tail:true,value:{cooked:e.text,raw:this.ast.text.slice(e.getStart(this.ast)+1,e.end-1)}})]});case Qe.TemplateExpression:{let p=this.createNode(e,{type:kt.TemplateLiteral,expressions:[],quasis:[this.convertChild(e.head)]});return e.templateSpans.forEach(f=>{p.expressions.push(this.convertChild(f.expression)),p.quasis.push(this.convertChild(f.literal));}),p}case Qe.TaggedTemplateExpression:return this.createNode(e,{type:kt.TaggedTemplateExpression,quasi:this.convertChild(e.template),tag:this.convertChild(e.tag),typeArguments:e.typeArguments&&this.convertTypeArgumentsToTypeParameterInstantiation(e.typeArguments,e)});case Qe.TemplateHead:case Qe.TemplateMiddle:case Qe.TemplateTail:{let p=e.kind===Qe.TemplateTail;return this.createNode(e,{type:kt.TemplateElement,tail:p,value:{cooked:e.text,raw:this.ast.text.slice(e.getStart(this.ast)+1,e.end-(p?1:2))}})}case Qe.SpreadAssignment:case Qe.SpreadElement:return this.allowPattern?this.createNode(e,{type:kt.RestElement,argument:this.convertPattern(e.expression),decorators:[],optional:false,typeAnnotation:void 0,value:void 0}):this.createNode(e,{type:kt.SpreadElement,argument:this.convertChild(e.expression)});case Qe.Parameter:{let p,f;return e.dotDotDotToken?p=f=this.createNode(e,{type:kt.RestElement,argument:this.convertChild(e.name),decorators:[],optional:false,typeAnnotation:void 0,value:void 0}):e.initializer?(p=this.convertChild(e.name),f=this.createNode(e,{type:kt.AssignmentPattern,range:[e.name.getStart(this.ast),e.initializer.end],decorators:[],left:p,optional:false,right:this.convertChild(e.initializer),typeAnnotation:void 0}),ab(e)&&(f.range[0]=p.range[0],f.loc=pA(f.range,this.ast))):p=f=this.convertChild(e.name,t),e.type&&(p.typeAnnotation=this.convertTypeAnnotation(e.type,e),this.fixParentLocation(p,p.typeAnnotation.range)),e.questionToken&&(e.questionToken.end>p.range[1]&&(p.range[1]=e.questionToken.end,p.loc.end=iU(p.range[1],this.ast)),p.optional=true),ab(e)?this.createNode(e,{type:kt.TSParameterProperty,accessibility:uA(e),decorators:[],override:gs(Qe.OverrideKeyword,e),parameter:f,readonly:gs(Qe.ReadonlyKeyword,e),static:gs(Qe.StaticKeyword,e)}):f}case Qe.ClassDeclaration:!e.name&&(!gs(Ca.ExportKeyword,e)||!gs(Ca.DefaultKeyword,e))&&li(this,si,Fc).call(this,e,"A class declaration without the 'default' modifier must have a name.");case Qe.ClassExpression:{let p=e.heritageClauses??[],f=e.kind===Qe.ClassDeclaration?kt.ClassDeclaration:kt.ClassExpression,v,b;for(let P of p){let{token:U,types:$}=P;$.length===0&&li(this,si,Fc).call(this,P,`'${ru(U)}' list cannot be empty.`),U===Qe.ExtendsKeyword?(v&&li(this,si,Fc).call(this,P,"'extends' clause already seen."),b&&li(this,si,Fc).call(this,P,"'extends' clause must precede 'implements' clause."),$.length>1&&li(this,si,Fc).call(this,$[1],"Classes can only extend a single class."),v??(v=P)):U===Qe.ImplementsKeyword&&(b&&li(this,si,Fc).call(this,P,"'implements' clause already seen."),b??(b=P));}let C=this.createNode(e,{type:f,abstract:gs(Qe.AbstractKeyword,e),body:this.createNode(e,{type:kt.ClassBody,range:[e.members.pos-1,e.end],body:e.members.filter(gYt).map(P=>this.convertChild(P))}),declare:gs(Qe.DeclareKeyword,e),decorators:((o=Vk(e))==null?void 0:o.map(P=>this.convertChild(P)))??[],id:this.convertChild(e.name),implements:b?.types.map(P=>this.convertChild(P))??[],superClass:v!=null&&v.types[0]?this.convertChild(v.types[0].expression):null,superTypeArguments:void 0,typeParameters:e.typeParameters&&this.convertTSTypeParametersToTypeParametersDeclaration(e.typeParameters)});return (u=v?.types[0])!=null&&u.typeArguments&&(C.superTypeArguments=this.convertTypeArgumentsToTypeParameterInstantiation(v.types[0].typeArguments,v.types[0])),this.fixExports(e,C)}case Qe.ModuleBlock:return this.createNode(e,{type:kt.TSModuleBlock,body:this.convertBodyExpressions(e.statements,e)});case Qe.ImportDeclaration:{this.assertModuleSpecifier(e,false);let p=this.createNode(e,li(this,si,Jk).call(this,{type:kt.ImportDeclaration,attributes:this.convertImportAttributes(e.attributes??e.assertClause),importKind:"value",source:this.convertChild(e.moduleSpecifier),specifiers:[]},"assertions","attributes",true));if(e.importClause&&(e.importClause.isTypeOnly&&(p.importKind="type"),e.importClause.name&&p.specifiers.push(this.convertChild(e.importClause)),e.importClause.namedBindings))switch(e.importClause.namedBindings.kind){case Qe.NamespaceImport:p.specifiers.push(this.convertChild(e.importClause.namedBindings));break;case Qe.NamedImports:p.specifiers.push(...e.importClause.namedBindings.elements.map(f=>this.convertChild(f)));break}return p}case Qe.NamespaceImport:return this.createNode(e,{type:kt.ImportNamespaceSpecifier,local:this.convertChild(e.name)});case Qe.ImportSpecifier:return this.createNode(e,{type:kt.ImportSpecifier,imported:this.convertChild(e.propertyName??e.name),importKind:e.isTypeOnly?"type":"value",local:this.convertChild(e.name)});case Qe.ImportClause:{let p=this.convertChild(e.name);return this.createNode(e,{type:kt.ImportDefaultSpecifier,range:p.range,local:p})}case Qe.ExportDeclaration:return ((c=e.exportClause)==null?void 0:c.kind)===Qe.NamedExports?(this.assertModuleSpecifier(e,true),this.createNode(e,li(this,si,Jk).call(this,{type:kt.ExportNamedDeclaration,attributes:this.convertImportAttributes(e.attributes??e.assertClause),declaration:null,exportKind:e.isTypeOnly?"type":"value",source:this.convertChild(e.moduleSpecifier),specifiers:e.exportClause.elements.map(p=>this.convertChild(p,e))},"assertions","attributes",true))):(this.assertModuleSpecifier(e,false),this.createNode(e,li(this,si,Jk).call(this,{type:kt.ExportAllDeclaration,attributes:this.convertImportAttributes(e.attributes??e.assertClause),exported:((l=e.exportClause)==null?void 0:l.kind)===Qe.NamespaceExport?this.convertChild(e.exportClause.name):null,exportKind:e.isTypeOnly?"type":"value",source:this.convertChild(e.moduleSpecifier)},"assertions","attributes",true)));case Qe.ExportSpecifier:{let p=e.propertyName??e.name;return p.kind===Qe.StringLiteral&&t.kind===Qe.ExportDeclaration&&((h=t.moduleSpecifier)==null?void 0:h.kind)!==Qe.StringLiteral&&li(this,si,ka).call(this,p,"A string literal cannot be used as a local exported binding without `from`."),this.createNode(e,{type:kt.ExportSpecifier,exported:this.convertChild(e.name),exportKind:e.isTypeOnly?"type":"value",local:this.convertChild(p)})}case Qe.ExportAssignment:return e.isExportEquals?this.createNode(e,{type:kt.TSExportAssignment,expression:this.convertChild(e.expression)}):this.createNode(e,{type:kt.ExportDefaultDeclaration,declaration:this.convertChild(e.expression),exportKind:"value"});case Qe.PrefixUnaryExpression:case Qe.PostfixUnaryExpression:{let p=M4(e.operator);return p==="++"||p==="--"?(noe(e.operand)||li(this,si,Fc).call(this,e.operand,"Invalid left-hand side expression in unary operation"),this.createNode(e,{type:kt.UpdateExpression,argument:this.convertChild(e.operand),operator:p,prefix:e.kind===Qe.PrefixUnaryExpression})):this.createNode(e,{type:kt.UnaryExpression,argument:this.convertChild(e.operand),operator:p,prefix:e.kind===Qe.PrefixUnaryExpression})}case Qe.DeleteExpression:return this.createNode(e,{type:kt.UnaryExpression,argument:this.convertChild(e.expression),operator:"delete",prefix:true});case Qe.VoidExpression:return this.createNode(e,{type:kt.UnaryExpression,argument:this.convertChild(e.expression),operator:"void",prefix:true});case Qe.TypeOfExpression:return this.createNode(e,{type:kt.UnaryExpression,argument:this.convertChild(e.expression),operator:"typeof",prefix:true});case Qe.TypeOperator:return this.createNode(e,{type:kt.TSTypeOperator,operator:M4(e.operator),typeAnnotation:this.convertChild(e.type)});case Qe.BinaryExpression:{if(bYt(e.operatorToken)){let f=this.createNode(e,{type:kt.SequenceExpression,expressions:[]}),v=this.convertChild(e.left);return v.type===kt.SequenceExpression&&e.left.kind!==Qe.ParenthesizedExpression?f.expressions.push(...v.expressions):f.expressions.push(v),f.expressions.push(this.convertChild(e.right)),f}let p=EYt(e.operatorToken);return this.allowPattern&&p.type===kt.AssignmentExpression?this.createNode(e,{type:kt.AssignmentPattern,decorators:[],left:this.convertPattern(e.left,e),optional:false,right:this.convertChild(e.right),typeAnnotation:void 0}):this.createNode(e,{...p,left:this.converter(e.left,e,p.type===kt.AssignmentExpression),right:this.convertChild(e.right)})}case Qe.PropertyAccessExpression:{let p=this.convertChild(e.expression),f=this.convertChild(e.name),v=this.createNode(e,{type:kt.MemberExpression,computed:false,object:p,optional:e.questionDotToken!=null,property:f});return this.convertChainExpression(v,e)}case Qe.ElementAccessExpression:{let p=this.convertChild(e.expression),f=this.convertChild(e.argumentExpression),v=this.createNode(e,{type:kt.MemberExpression,computed:true,object:p,optional:e.questionDotToken!=null,property:f});return this.convertChainExpression(v,e)}case Qe.CallExpression:{if(e.expression.kind===Qe.ImportKeyword)return e.arguments.length!==1&&e.arguments.length!==2&&li(this,si,Fc).call(this,e.arguments[2]??e,"Dynamic import requires exactly one or two arguments."),this.createNode(e,li(this,si,Jk).call(this,{type:kt.ImportExpression,options:e.arguments[1]?this.convertChild(e.arguments[1]):null,source:this.convertChild(e.arguments[0])},"attributes","options",true));let p=this.convertChild(e.expression),f=e.arguments.map(C=>this.convertChild(C)),v=e.typeArguments&&this.convertTypeArgumentsToTypeParameterInstantiation(e.typeArguments,e),b=this.createNode(e,{type:kt.CallExpression,arguments:f,callee:p,optional:e.questionDotToken!=null,typeArguments:v});return this.convertChainExpression(b,e)}case Qe.NewExpression:{let p=e.typeArguments&&this.convertTypeArgumentsToTypeParameterInstantiation(e.typeArguments,e);return this.createNode(e,{type:kt.NewExpression,arguments:e.arguments?e.arguments.map(f=>this.convertChild(f)):[],callee:this.convertChild(e.expression),typeArguments:p})}case Qe.ConditionalExpression:return this.createNode(e,{type:kt.ConditionalExpression,alternate:this.convertChild(e.whenFalse),consequent:this.convertChild(e.whenTrue),test:this.convertChild(e.condition)});case Qe.MetaProperty:return this.createNode(e,{type:kt.MetaProperty,meta:this.createNode(e.getFirstToken(),{type:kt.Identifier,decorators:[],name:M4(e.keywordToken),optional:false,typeAnnotation:void 0}),property:this.convertChild(e.name)});case Qe.Decorator:return this.createNode(e,{type:kt.Decorator,expression:this.convertChild(e.expression)});case Qe.StringLiteral:return this.createNode(e,{type:kt.Literal,raw:e.getText(),value:t.kind===Qe.JsxAttribute?HAe(e.text):e.text});case Qe.NumericLiteral:return this.createNode(e,{type:kt.Literal,raw:e.getText(),value:Number(e.text)});case Qe.BigIntLiteral:{let p=Rk(e,this.ast),f=this.ast.text.slice(p[0],p[1]),v=Wk(false,f.slice(0,-1),"_",""),b=typeof BigInt<"u"?BigInt(v):null;return this.createNode(e,{type:kt.Literal,range:p,bigint:b==null?v:String(b),raw:f,value:b})}case Qe.RegularExpressionLiteral:{let p=e.text.slice(1,e.text.lastIndexOf("/")),f=e.text.slice(e.text.lastIndexOf("/")+1),v=null;try{v=new RegExp(p,f);}catch{}return this.createNode(e,{type:kt.Literal,raw:e.text,regex:{flags:f,pattern:p},value:v})}case Qe.TrueKeyword:return this.createNode(e,{type:kt.Literal,raw:"true",value:true});case Qe.FalseKeyword:return this.createNode(e,{type:kt.Literal,raw:"false",value:false});case Qe.NullKeyword:return this.createNode(e,{type:kt.Literal,raw:"null",value:null});case Qe.EmptyStatement:return this.createNode(e,{type:kt.EmptyStatement});case Qe.DebuggerStatement:return this.createNode(e,{type:kt.DebuggerStatement});case Qe.JsxElement:return this.createNode(e,{type:kt.JSXElement,children:e.children.map(p=>this.convertChild(p)),closingElement:this.convertChild(e.closingElement),openingElement:this.convertChild(e.openingElement)});case Qe.JsxFragment:return this.createNode(e,{type:kt.JSXFragment,children:e.children.map(p=>this.convertChild(p)),closingFragment:this.convertChild(e.closingFragment),openingFragment:this.convertChild(e.openingFragment)});case Qe.JsxSelfClosingElement:return this.createNode(e,{type:kt.JSXElement,children:[],closingElement:null,openingElement:this.createNode(e,{type:kt.JSXOpeningElement,range:Rk(e,this.ast),attributes:e.attributes.properties.map(p=>this.convertChild(p)),name:this.convertJSXTagName(e.tagName,e),selfClosing:true,typeArguments:e.typeArguments?this.convertTypeArgumentsToTypeParameterInstantiation(e.typeArguments,e):void 0})});case Qe.JsxOpeningElement:return this.createNode(e,{type:kt.JSXOpeningElement,attributes:e.attributes.properties.map(p=>this.convertChild(p)),name:this.convertJSXTagName(e.tagName,e),selfClosing:false,typeArguments:e.typeArguments&&this.convertTypeArgumentsToTypeParameterInstantiation(e.typeArguments,e)});case Qe.JsxClosingElement:return this.createNode(e,{type:kt.JSXClosingElement,name:this.convertJSXTagName(e.tagName,e)});case Qe.JsxOpeningFragment:return this.createNode(e,{type:kt.JSXOpeningFragment});case Qe.JsxClosingFragment:return this.createNode(e,{type:kt.JSXClosingFragment});case Qe.JsxExpression:{let p=e.expression?this.convertChild(e.expression):this.createNode(e,{type:kt.JSXEmptyExpression,range:[e.getStart(this.ast)+1,e.getEnd()-1]});return e.dotDotDotToken?this.createNode(e,{type:kt.JSXSpreadChild,expression:p}):this.createNode(e,{type:kt.JSXExpressionContainer,expression:p})}case Qe.JsxAttribute:return this.createNode(e,{type:kt.JSXAttribute,name:this.convertJSXNamespaceOrIdentifier(e.name),value:this.convertChild(e.initializer)});case Qe.JsxText:{let p=e.getFullStart(),f=e.getEnd(),v=this.ast.text.slice(p,f);return this.createNode(e,{type:kt.JSXText,range:[p,f],raw:v,value:HAe(v)})}case Qe.JsxSpreadAttribute:return this.createNode(e,{type:kt.JSXSpreadAttribute,argument:this.convertChild(e.expression)});case Qe.QualifiedName:return this.createNode(e,{type:kt.TSQualifiedName,left:this.convertChild(e.left),right:this.convertChild(e.right)});case Qe.TypeReference:return this.createNode(e,{type:kt.TSTypeReference,typeArguments:e.typeArguments&&this.convertTypeArgumentsToTypeParameterInstantiation(e.typeArguments,e),typeName:this.convertChild(e.typeName)});case Qe.TypeParameter:return this.createNode(e,{type:kt.TSTypeParameter,const:gs(Qe.ConstKeyword,e),constraint:e.constraint&&this.convertChild(e.constraint),default:e.default?this.convertChild(e.default):void 0,in:gs(Qe.InKeyword,e),name:this.convertChild(e.name),out:gs(Qe.OutKeyword,e)});case Qe.ThisType:return this.createNode(e,{type:kt.TSThisType});case Qe.AnyKeyword:case Qe.BigIntKeyword:case Qe.BooleanKeyword:case Qe.NeverKeyword:case Qe.NumberKeyword:case Qe.ObjectKeyword:case Qe.StringKeyword:case Qe.SymbolKeyword:case Qe.UnknownKeyword:case Qe.VoidKeyword:case Qe.UndefinedKeyword:case Qe.IntrinsicKeyword:return this.createNode(e,{type:kt[`TS${Qe[e.kind]}`]});case Qe.NonNullExpression:{let p=this.createNode(e,{type:kt.TSNonNullExpression,expression:this.convertChild(e.expression)});return this.convertChainExpression(p,e)}case Qe.TypeLiteral:return this.createNode(e,{type:kt.TSTypeLiteral,members:e.members.map(p=>this.convertChild(p))});case Qe.ArrayType:return this.createNode(e,{type:kt.TSArrayType,elementType:this.convertChild(e.elementType)});case Qe.IndexedAccessType:return this.createNode(e,{type:kt.TSIndexedAccessType,indexType:this.convertChild(e.indexType),objectType:this.convertChild(e.objectType)});case Qe.ConditionalType:return this.createNode(e,{type:kt.TSConditionalType,checkType:this.convertChild(e.checkType),extendsType:this.convertChild(e.extendsType),falseType:this.convertChild(e.falseType),trueType:this.convertChild(e.trueType)});case Qe.TypeQuery:return this.createNode(e,{type:kt.TSTypeQuery,exprName:this.convertChild(e.exprName),typeArguments:e.typeArguments&&this.convertTypeArgumentsToTypeParameterInstantiation(e.typeArguments,e)});case Qe.MappedType:return e.members&&e.members.length>0&&li(this,si,Fc).call(this,e.members[0],"A mapped type may not declare properties or methods."),this.createNode(e,li(this,si,gse).call(this,{type:kt.TSMappedType,constraint:this.convertChild(e.typeParameter.constraint),key:this.convertChild(e.typeParameter.name),nameType:this.convertChild(e.nameType)??null,optional:e.questionToken?e.questionToken.kind===Qe.QuestionToken||M4(e.questionToken.kind):false,readonly:e.readonlyToken?e.readonlyToken.kind===Qe.ReadonlyKeyword||M4(e.readonlyToken.kind):void 0,typeAnnotation:e.type&&this.convertChild(e.type)},"typeParameter","'constraint' and 'key'",this.convertChild(e.typeParameter)));case Qe.ParenthesizedExpression:return this.convertChild(e.expression,t);case Qe.TypeAliasDeclaration:{let p=this.createNode(e,{type:kt.TSTypeAliasDeclaration,declare:gs(Qe.DeclareKeyword,e),id:this.convertChild(e.name),typeAnnotation:this.convertChild(e.type),typeParameters:e.typeParameters&&this.convertTSTypeParametersToTypeParametersDeclaration(e.typeParameters)});return this.fixExports(e,p)}case Qe.MethodSignature:return this.convertMethodSignature(e);case Qe.PropertySignature:{let{initializer:p}=e;return p&&li(this,si,ka).call(this,p,"A property signature cannot have an initializer."),this.createNode(e,{type:kt.TSPropertySignature,accessibility:uA(e),computed:Mk(e.name),key:this.convertChild(e.name),optional:GAe(e),readonly:gs(Qe.ReadonlyKeyword,e),static:gs(Qe.StaticKeyword,e),typeAnnotation:e.type&&this.convertTypeAnnotation(e.type,e)})}case Qe.IndexSignature:return this.createNode(e,{type:kt.TSIndexSignature,accessibility:uA(e),parameters:e.parameters.map(p=>this.convertChild(p)),readonly:gs(Qe.ReadonlyKeyword,e),static:gs(Qe.StaticKeyword,e),typeAnnotation:e.type&&this.convertTypeAnnotation(e.type,e)});case Qe.ConstructorType:return this.createNode(e,{type:kt.TSConstructorType,abstract:gs(Qe.AbstractKeyword,e),params:this.convertParameters(e.parameters),returnType:e.type&&this.convertTypeAnnotation(e.type,e),typeParameters:e.typeParameters&&this.convertTSTypeParametersToTypeParametersDeclaration(e.typeParameters)});case Qe.FunctionType:{let{modifiers:p}=e;p&&li(this,si,ka).call(this,p[0],"A function type cannot have modifiers.");}case Qe.ConstructSignature:case Qe.CallSignature:{let p=e.kind===Qe.ConstructSignature?kt.TSConstructSignatureDeclaration:e.kind===Qe.CallSignature?kt.TSCallSignatureDeclaration:kt.TSFunctionType;return this.createNode(e,{type:p,params:this.convertParameters(e.parameters),returnType:e.type&&this.convertTypeAnnotation(e.type,e),typeParameters:e.typeParameters&&this.convertTSTypeParametersToTypeParametersDeclaration(e.typeParameters)})}case Qe.ExpressionWithTypeArguments:{let p=t.kind,f=p===Qe.InterfaceDeclaration?kt.TSInterfaceHeritage:p===Qe.HeritageClause?kt.TSClassImplements:kt.TSInstantiationExpression;return this.createNode(e,{type:f,expression:this.convertChild(e.expression),typeArguments:e.typeArguments&&this.convertTypeArgumentsToTypeParameterInstantiation(e.typeArguments,e)})}case Qe.InterfaceDeclaration:{let p=e.heritageClauses??[],f=[],v=false;for(let C of p){C.token!==Qe.ExtendsKeyword&&li(this,si,ka).call(this,C,C.token===Qe.ImplementsKeyword?"Interface declaration cannot have 'implements' clause.":"Unexpected token."),v&&li(this,si,ka).call(this,C,"'extends' clause already seen."),v=true;for(let P of C.types)(!ske(P.expression)||rHt(P.expression))&&li(this,si,ka).call(this,P,"Interface declaration can only extend an identifier/qualified name with optional type arguments."),f.push(this.convertChild(P,e));}let b=this.createNode(e,{type:kt.TSInterfaceDeclaration,body:this.createNode(e,{type:kt.TSInterfaceBody,range:[e.members.pos-1,e.end],body:e.members.map(C=>this.convertChild(C))}),declare:gs(Qe.DeclareKeyword,e),extends:f,id:this.convertChild(e.name),typeParameters:e.typeParameters&&this.convertTSTypeParametersToTypeParametersDeclaration(e.typeParameters)});return this.fixExports(e,b)}case Qe.TypePredicate:{let p=this.createNode(e,{type:kt.TSTypePredicate,asserts:e.assertsModifier!=null,parameterName:this.convertChild(e.parameterName),typeAnnotation:null});return e.type&&(p.typeAnnotation=this.convertTypeAnnotation(e.type,e),p.typeAnnotation.loc=p.typeAnnotation.typeAnnotation.loc,p.typeAnnotation.range=p.typeAnnotation.typeAnnotation.range),p}case Qe.ImportType:{let p=Rk(e,this.ast);if(e.isTypeOf){let b=tb(e.getFirstToken(),e,this.ast);p[0]=b.getStart(this.ast);}let f=null;if(e.attributes){let b=this.createNode(e.attributes,{type:kt.ObjectExpression,properties:e.attributes.elements.map(O=>this.createNode(O,{type:kt.Property,computed:false,key:this.convertChild(O.name),kind:"init",method:false,optional:false,shorthand:false,value:this.convertChild(O.value)}))}),C=tb(e.argument,e,this.ast),P=tb(C,e,this.ast),U=tb(e.attributes,e,this.ast),$=tb(P,e,this.ast),S=Rk($,this.ast),T=$.kind===Ca.AssertKeyword?"assert":"with";f=this.createNode(e,{type:kt.ObjectExpression,range:[P.getStart(this.ast),U.end],properties:[this.createNode(e,{type:kt.Property,range:[S[0],e.attributes.end],computed:false,key:this.createNode(e,{type:kt.Identifier,range:S,decorators:[],name:T,optional:false,typeAnnotation:void 0}),kind:"init",method:false,optional:false,shorthand:false,value:b})]});}let v=this.createNode(e,{type:kt.TSImportType,range:p,argument:this.convertChild(e.argument),options:f,qualifier:this.convertChild(e.qualifier),typeArguments:e.typeArguments?this.convertTypeArgumentsToTypeParameterInstantiation(e.typeArguments,e):null});return e.isTypeOf?this.createNode(e,{type:kt.TSTypeQuery,exprName:v,typeArguments:void 0}):v}case Qe.EnumDeclaration:{let p=e.members.map(v=>this.convertChild(v)),f=this.createNode(e,li(this,si,gse).call(this,{type:kt.TSEnumDeclaration,body:this.createNode(e,{type:kt.TSEnumBody,range:[e.members.pos-1,e.end],members:p}),const:gs(Qe.ConstKeyword,e),declare:gs(Qe.DeclareKeyword,e),id:this.convertChild(e.name)},"members","'body.members'",e.members.map(v=>this.convertChild(v))));return this.fixExports(e,f)}case Qe.EnumMember:return this.createNode(e,{type:kt.TSEnumMember,computed:e.name.kind===Ca.ComputedPropertyName,id:this.convertChild(e.name),initializer:e.initializer&&this.convertChild(e.initializer)});case Qe.ModuleDeclaration:{let p=gs(Qe.DeclareKeyword,e),f=this.createNode(e,{type:kt.TSModuleDeclaration,...(()=>{if(e.flags&Xh.GlobalAugmentation){let b=this.convertChild(e.name),C=this.convertChild(e.body);return (C==null||C.type===kt.TSModuleDeclaration)&&li(this,si,Fc).call(this,e.body??e,"Expected a valid module body"),b.type!==kt.Identifier&&li(this,si,Fc).call(this,e.name,"global module augmentation must have an Identifier id"),{body:C,declare:false,global:false,id:b,kind:"global"}}if(Zk(e.name)){let b=this.convertChild(e.body);return {kind:"module",...b!=null?{body:b}:{},declare:false,global:false,id:this.convertChild(e.name)}}e.body==null&&li(this,si,Fc).call(this,e,"Expected a module body"),e.name.kind!==Ca.Identifier&&li(this,si,Fc).call(this,e.name,"`namespace`s must have an Identifier id");let v=this.createNode(e.name,{type:kt.Identifier,range:[e.name.getStart(this.ast),e.name.getEnd()],decorators:[],name:e.name.text,optional:false,typeAnnotation:void 0});for(;e.body&&iN(e.body)&&e.body.name;){e=e.body,p||(p=gs(Qe.DeclareKeyword,e));let b=e.name,C=this.createNode(b,{type:kt.Identifier,range:[b.getStart(this.ast),b.getEnd()],decorators:[],name:b.text,optional:false,typeAnnotation:void 0});v=this.createNode(b,{type:kt.TSQualifiedName,range:[v.range[0],C.range[1]],left:v,right:C});}return {body:this.convertChild(e.body),declare:false,global:false,id:v,kind:e.flags&Xh.Namespace?"namespace":"module"}})()});return f.declare=p,e.flags&Xh.GlobalAugmentation&&(f.global=true),this.fixExports(e,f)}case Qe.ParenthesizedType:return this.convertChild(e.type);case Qe.UnionType:return this.createNode(e,{type:kt.TSUnionType,types:e.types.map(p=>this.convertChild(p))});case Qe.IntersectionType:return this.createNode(e,{type:kt.TSIntersectionType,types:e.types.map(p=>this.convertChild(p))});case Qe.AsExpression:return this.createNode(e,{type:kt.TSAsExpression,expression:this.convertChild(e.expression),typeAnnotation:this.convertChild(e.type)});case Qe.InferType:return this.createNode(e,{type:kt.TSInferType,typeParameter:this.convertChild(e.typeParameter)});case Qe.LiteralType:return e.literal.kind===Qe.NullKeyword?this.createNode(e.literal,{type:kt.TSNullKeyword}):this.createNode(e,{type:kt.TSLiteralType,literal:this.convertChild(e.literal)});case Qe.TypeAssertionExpression:return this.createNode(e,{type:kt.TSTypeAssertion,expression:this.convertChild(e.expression),typeAnnotation:this.convertChild(e.type)});case Qe.ImportEqualsDeclaration:return this.fixExports(e,this.createNode(e,{type:kt.TSImportEqualsDeclaration,id:this.convertChild(e.name),importKind:e.isTypeOnly?"type":"value",moduleReference:this.convertChild(e.moduleReference)}));case Qe.ExternalModuleReference:return e.expression.kind!==Qe.StringLiteral&&li(this,si,ka).call(this,e.expression,"String literal expected."),this.createNode(e,{type:kt.TSExternalModuleReference,expression:this.convertChild(e.expression)});case Qe.NamespaceExportDeclaration:return this.createNode(e,{type:kt.TSNamespaceExportDeclaration,id:this.convertChild(e.name)});case Qe.AbstractKeyword:return this.createNode(e,{type:kt.TSAbstractKeyword});case Qe.TupleType:{let p=e.elements.map(f=>this.convertChild(f));return this.createNode(e,{type:kt.TSTupleType,elementTypes:p})}case Qe.NamedTupleMember:{let p=this.createNode(e,{type:kt.TSNamedTupleMember,elementType:this.convertChild(e.type,e),label:this.convertChild(e.name,e),optional:e.questionToken!=null});return e.dotDotDotToken?(p.range[0]=p.label.range[0],p.loc.start=p.label.loc.start,this.createNode(e,{type:kt.TSRestType,typeAnnotation:p})):p}case Qe.OptionalType:return this.createNode(e,{type:kt.TSOptionalType,typeAnnotation:this.convertChild(e.type)});case Qe.RestType:return this.createNode(e,{type:kt.TSRestType,typeAnnotation:this.convertChild(e.type)});case Qe.TemplateLiteralType:{let p=this.createNode(e,{type:kt.TSTemplateLiteralType,quasis:[this.convertChild(e.head)],types:[]});return e.templateSpans.forEach(f=>{p.types.push(this.convertChild(f.type)),p.quasis.push(this.convertChild(f.literal));}),p}case Qe.ClassStaticBlockDeclaration:return this.createNode(e,{type:kt.StaticBlock,body:this.convertBodyExpressions(e.body.statements,e)});case Qe.AssertEntry:case Qe.ImportAttribute:return this.createNode(e,{type:kt.ImportAttribute,key:this.convertChild(e.name),value:this.convertChild(e.value)});case Qe.SatisfiesExpression:return this.createNode(e,{type:kt.TSSatisfiesExpression,expression:this.convertChild(e.expression),typeAnnotation:this.convertChild(e.type)});default:return this.deeplyCopy(e)}}createNode(e,t){let r=t;return r.range??(r.range=Rk(e,this.ast)),r.loc??(r.loc=pA(r.range,this.ast)),r&&this.options.shouldPreserveNodeMaps&&this.esTreeNodeToTSNodeMap.set(r,e),r}convertProgram(){return this.converter(this.ast)}deeplyCopy(e){e.kind===Ca.JSDocFunctionType&&li(this,si,ka).call(this,e,"JSDoc types can only be used inside documentation comments.");let t=`TS${Qe[e.kind]}`;if(this.options.errorOnUnknownASTType&&!kt[t])throw new Error(`Unknown AST_NODE_TYPE: "${t}"`);let r=this.createNode(e,{type:t});"type"in e&&(r.typeAnnotation=e.type&&"kind"in e.type&&fHt(e.type)?this.convertTypeAnnotation(e.type,e):null),"typeArguments"in e&&(r.typeArguments=e.typeArguments&&"pos"in e.typeArguments?this.convertTypeArgumentsToTypeParameterInstantiation(e.typeArguments,e):null),"typeParameters"in e&&(r.typeParameters=e.typeParameters&&"pos"in e.typeParameters?this.convertTSTypeParametersToTypeParametersDeclaration(e.typeParameters):null);let i=Vk(e);i!=null&&i.length&&(r.decorators=i.map(o=>this.convertChild(o)));let a=new Set(["_children","decorators","end","flags","heritageClauses","illegalDecorators","jsDoc","kind","locals","localSymbol","modifierFlagsCache","modifiers","nextContainer","parent","pos","symbol","transformFlags","type","typeArguments","typeParameters"]);return Object.entries(e).filter(([o])=>!a.has(o)).forEach(([o,u])=>{Array.isArray(u)?r[o]=u.map(c=>this.convertChild(c)):u&&typeof u=="object"&&u.kind?r[o]=this.convertChild(u):r[o]=u;}),r}fixExports(e,t){let r=iN(e)&&!Zk(e.name)?JYt(e):ab(e);if(r?.[0].kind===Qe.ExportKeyword){this.registerTSNodeInNodeMap(e,t);let i=r[0],a=r[1],o=a?.kind===Qe.DefaultKeyword,u=o?tb(a,this.ast,this.ast):tb(i,this.ast,this.ast);if(t.range[0]=u.getStart(this.ast),t.loc=pA(t.range,this.ast),o)return this.createNode(e,{type:kt.ExportDefaultDeclaration,range:[i.getStart(this.ast),t.range[1]],declaration:t,exportKind:"value"});let c=t.type===kt.TSInterfaceDeclaration||t.type===kt.TSTypeAliasDeclaration,l="declare"in t&&t.declare;return this.createNode(e,li(this,si,Jk).call(this,{type:kt.ExportNamedDeclaration,range:[i.getStart(this.ast),t.range[1]],attributes:[],declaration:t,exportKind:c||l?"type":"value",source:null,specifiers:[]},"assertions","attributes",true))}return t}getASTMaps(){return {esTreeNodeToTSNodeMap:this.esTreeNodeToTSNodeMap,tsNodeToESTreeNodeMap:this.tsNodeToESTreeNodeMap}}registerTSNodeInNodeMap(e,t){t&&this.options.shouldPreserveNodeMaps&&!this.tsNodeToESTreeNodeMap.has(e)&&this.tsNodeToESTreeNodeMap.set(e,t);}};si=new WeakSet,yse=function(e,t){let r=t===Ca.ForInStatement?"for...in":"for...of";if(KKt(e)){e.declarations.length!==1&&li(this,si,ka).call(this,e,`Only a single variable declaration is allowed in a '${r}' statement.`);let i=e.declarations[0];i.initializer?li(this,si,ka).call(this,i,`The variable declaration of a '${r}' statement cannot have an initializer.`):i.type&&li(this,si,ka).call(this,i,`The variable declaration of a '${r}' statement cannot have a type annotation.`),t===Ca.ForInStatement&&e.flags&Xh.Using&&li(this,si,ka).call(this,e,"The left-hand side of a 'for...in' statement cannot be a 'using' declaration.");}else !noe(e)&&e.kind!==Ca.ObjectLiteralExpression&&e.kind!==Ca.ArrayLiteralExpression&&li(this,si,ka).call(this,e,`The left-hand side of a '${r}' statement must be a variable or a property access.`);},oke=function(e){if(!this.options.allowInvalidAST){BYt(e)&&li(this,si,ka).call(this,e.illegalDecorators[0],"Decorators are not valid here.");for(let t of Vk(e,true)??[])VYt(e)||(pse(e)&&!KAe(e.body)?li(this,si,ka).call(this,t,"A decorator can only decorate a method implementation, not an overload."):li(this,si,ka).call(this,t,"Decorators are not valid here."));for(let t of ab(e,true)??[]){if(t.kind!==Qe.ReadonlyKeyword&&((e.kind===Qe.PropertySignature||e.kind===Qe.MethodSignature)&&li(this,si,ka).call(this,t,`'${ru(t.kind)}' modifier cannot appear on a type member`),e.kind===Qe.IndexSignature&&(t.kind!==Qe.StaticKeyword||!Xk(e.parent))&&li(this,si,ka).call(this,t,`'${ru(t.kind)}' modifier cannot appear on an index signature`)),t.kind!==Qe.InKeyword&&t.kind!==Qe.OutKeyword&&t.kind!==Qe.ConstKeyword&&e.kind===Qe.TypeParameter&&li(this,si,ka).call(this,t,`'${ru(t.kind)}' modifier cannot appear on a type parameter`),(t.kind===Qe.InKeyword||t.kind===Qe.OutKeyword)&&(e.kind!==Qe.TypeParameter||!(Yse(e.parent)||Xk(e.parent)||Pwe(e.parent)))&&li(this,si,ka).call(this,t,`'${ru(t.kind)}' modifier can only appear on a type parameter of a class, interface or type alias`),t.kind===Qe.ReadonlyKeyword&&e.kind!==Qe.PropertyDeclaration&&e.kind!==Qe.PropertySignature&&e.kind!==Qe.IndexSignature&&e.kind!==Qe.Parameter&&li(this,si,ka).call(this,t,"'readonly' modifier can only appear on a property declaration or index signature."),t.kind===Qe.DeclareKeyword&&Xk(e.parent)&&!_U(e)&&li(this,si,ka).call(this,t,`'${ru(t.kind)}' modifier cannot appear on class elements of this kind.`),t.kind===Qe.DeclareKeyword&&gU(e)){let r=mse(e.declarationList);(r==="using"||r==="await using")&&li(this,si,ka).call(this,t,`'declare' modifier cannot appear on a '${r}' declaration.`);}if(t.kind===Qe.AbstractKeyword&&e.kind!==Qe.ClassDeclaration&&e.kind!==Qe.ConstructorType&&e.kind!==Qe.MethodDeclaration&&e.kind!==Qe.PropertyDeclaration&&e.kind!==Qe.GetAccessor&&e.kind!==Qe.SetAccessor&&li(this,si,ka).call(this,t,`'${ru(t.kind)}' modifier can only appear on a class, method, or property declaration.`),(t.kind===Qe.StaticKeyword||t.kind===Qe.PublicKeyword||t.kind===Qe.ProtectedKeyword||t.kind===Qe.PrivateKeyword)&&(e.parent.kind===Qe.ModuleBlock||e.parent.kind===Qe.SourceFile)&&li(this,si,ka).call(this,t,`'${ru(t.kind)}' modifier cannot appear on a module or namespace element.`),t.kind===Qe.AccessorKeyword&&e.kind!==Qe.PropertyDeclaration&&li(this,si,ka).call(this,t,"'accessor' modifier can only appear on a property declaration."),t.kind===Qe.AsyncKeyword&&e.kind!==Qe.MethodDeclaration&&e.kind!==Qe.FunctionDeclaration&&e.kind!==Qe.FunctionExpression&&e.kind!==Qe.ArrowFunction&&li(this,si,ka).call(this,t,"'async' modifier cannot be used here."),e.kind===Qe.Parameter&&(t.kind===Qe.StaticKeyword||t.kind===Qe.ExportKeyword||t.kind===Qe.DeclareKeyword||t.kind===Qe.AsyncKeyword)&&li(this,si,ka).call(this,t,`'${ru(t.kind)}' modifier cannot appear on a parameter.`),t.kind===Qe.PublicKeyword||t.kind===Qe.ProtectedKeyword||t.kind===Qe.PrivateKeyword)for(let r of ab(e)??[])r!==t&&(r.kind===Qe.PublicKeyword||r.kind===Qe.ProtectedKeyword||r.kind===Qe.PrivateKeyword)&&li(this,si,ka).call(this,r,"Accessibility modifier already seen.");if(e.kind===Qe.Parameter&&(t.kind===Qe.PublicKeyword||t.kind===Qe.PrivateKeyword||t.kind===Qe.ProtectedKeyword||t.kind===Qe.ReadonlyKeyword||t.kind===Qe.OverrideKeyword)){let r=jYt(e);r.kind===Qe.Constructor&&KAe(r.body)||li(this,si,ka).call(this,t,"A parameter property is only allowed in a constructor implementation.");}}}},ka=function(e,t){let r,i;throw typeof e=="number"?r=i=e:(r=e.getStart(this.ast),i=e.getEnd()),ike(t,this.ast,r,i)},Fc=function(e,t){this.options.allowInvalidAST||li(this,si,ka).call(this,e,t);},Jk=function(e,t,r,i=false){let a=i;return Object.defineProperty(e,t,{configurable:true,get:this.options.suppressDeprecatedPropertyWarnings?()=>e[r]:()=>(a||((void 0)(`The '${t}' property is deprecated on ${e.type} nodes. Use '${r}' instead. See https://typescript-eslint.io/troubleshooting/faqs/general#the-key-property-is-deprecated-on-type-nodes-use-key-instead-warnings.`,"DeprecationWarning"),a=true),e[r]),set(o){Object.defineProperty(e,t,{enumerable:true,value:o,writable:true});}}),e},gse=function(e,t,r,i){let a=false;return Object.defineProperty(e,t,{configurable:true,get:this.options.suppressDeprecatedPropertyWarnings?()=>i:()=>(a||((void 0)(`The '${t}' property is deprecated on ${e.type} nodes. Use ${r} instead. See https://typescript-eslint.io/troubleshooting/faqs/general#the-key-property-is-deprecated-on-type-nodes-use-key-instead-warnings.`,"DeprecationWarning"),a=true),i),set(o){Object.defineProperty(e,t,{enumerable:true,value:o,writable:true});}}),e};[pfr,_fr]=xWt.split(".").map(e=>Number.parseInt(e,10)),Fp.Intrinsic??Fp.Any|Fp.Unknown|Fp.String|Fp.Number|Fp.BigInt|Fp.Boolean|Fp.BooleanLiteral|Fp.ESSymbol|Fp.Void|Fp.Undefined|Fp.Null|Fp.Never|Fp.NonPrimitive;QYt=()=>{};eQt=function(e){return e&&e.__esModule?e:{default:e}},tQt=eQt({extname:e=>"."+e.split(".").pop()});nQt={default:Ese},iQt=(0, nQt.default)("typescript-eslint:typescript-estree:create-program:createSourceFile");sQt=e=>e,oQt=()=>{},uQt=class{},lQt=()=>false,cQt=()=>{},pQt=function(e){return e&&e.__esModule?e:{default:e}},_Qt={},vse={default:Ese},dQt=pQt({extname:e=>"."+e.split(".").pop()}),fQt=(0, vse.default)("typescript-eslint:typescript-estree:parseSettings:createParseSettings"),Xae=null,jP={ParseAll:(YAe=VP)==null?void 0:YAe.ParseAll,ParseForTypeErrors:(QAe=VP)==null?void 0:QAe.ParseForTypeErrors,ParseForTypeInfo:(ZAe=VP)==null?void 0:ZAe.ParseForTypeInfo,ParseNone:(e5e=VP)==null?void 0:e5e.ParseNone};vQt={default:Ese},(0, vQt.default)("typescript-eslint:typescript-estree:parser");EQt=DQt;AQt=CQt,wQt=(e,t,r)=>{if(!(e&&t==null)){if(t.findLast)return t.findLast(r);for(let i=t.length-1;i>=0;i--){let a=t[i];if(r(a,i,t))return a}}},kQt=wQt,TQt=(e,t,r)=>{if(!(e&&t==null))return Array.isArray(t)||typeof t=="string"?t[r<0?t.length+r:r]:t.at(r)},SQt=TQt,FQt=new Proxy(()=>{},{get:()=>FQt});ioe=PQt;BQt=NQt,IQt=ioe(["Block","CommentBlock","MultiLine"]),aoe=IQt,OQt=ioe(["Line","CommentLine","SingleLine","HashbangComment","HTMLOpen","HTMLClose","Hashbang","InterpreterDirective"]),LQt=OQt,Yae=new WeakMap;MQt=RQt;Qae=new WeakMap;t5e=qQt;$Qt=UQt,qP=null;VQt=10;for(let e=0;e<=VQt;e++)XP();zQt=WQt,HQt={ArrayExpression:["elements"],AssignmentExpression:["left","right"],BinaryExpression:["left","right"],InterpreterDirective:[],Directive:["value"],DirectiveLiteral:[],BlockStatement:["directives","body"],BreakStatement:["label"],CallExpression:["callee","typeParameters","typeArguments","arguments"],CatchClause:["param","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExpressionStatement:["expression"],File:["program"],ForInStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","typeParameters","params","predicate","returnType","body"],FunctionExpression:["id","typeParameters","params","returnType","body"],Identifier:["typeAnnotation","decorators"],IfStatement:["test","consequent","alternate"],LabeledStatement:["label","body"],StringLiteral:[],NumericLiteral:[],NullLiteral:[],BooleanLiteral:[],RegExpLiteral:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],NewExpression:["callee","typeParameters","typeArguments","arguments"],Program:["directives","body"],ObjectExpression:["properties"],ObjectMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectProperty:["decorators","key","value"],RestElement:["argument","typeAnnotation","decorators"],ReturnStatement:["argument"],SequenceExpression:["expressions"],ParenthesizedExpression:["expression"],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],AssignmentPattern:["left","right","decorators","typeAnnotation"],ArrayPattern:["elements","typeAnnotation","decorators"],ArrowFunctionExpression:["typeParameters","params","predicate","returnType","body"],ClassBody:["body"],ClassExpression:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body","superTypeArguments"],ClassDeclaration:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body","superTypeArguments"],ExportAllDeclaration:["source","attributes","exported"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source","attributes"],ExportSpecifier:["local","exported"],ForOfStatement:["left","right","body"],ImportDeclaration:["specifiers","source","attributes"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],ImportExpression:["source","options"],MetaProperty:["meta","property"],ClassMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectPattern:["decorators","properties","typeAnnotation"],SpreadElement:["argument"],Super:[],TaggedTemplateExpression:["tag","typeParameters","quasi","typeArguments"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],YieldExpression:["argument"],AwaitExpression:["argument"],BigIntLiteral:[],ExportNamespaceSpecifier:["exported"],OptionalMemberExpression:["object","property"],OptionalCallExpression:["callee","typeParameters","typeArguments","arguments"],ClassProperty:["decorators","variance","key","typeAnnotation","value"],ClassAccessorProperty:["decorators","key","typeAnnotation","value"],ClassPrivateProperty:["decorators","variance","key","typeAnnotation","value"],ClassPrivateMethod:["decorators","key","typeParameters","params","returnType","body"],PrivateName:["id"],StaticBlock:["body"],ImportAttribute:["key","value"],AnyTypeAnnotation:[],ArrayTypeAnnotation:["elementType"],BooleanTypeAnnotation:[],BooleanLiteralTypeAnnotation:[],NullLiteralTypeAnnotation:[],ClassImplements:["id","typeParameters"],DeclareClass:["id","typeParameters","extends","mixins","implements","body"],DeclareFunction:["id","predicate"],DeclareInterface:["id","typeParameters","extends","body"],DeclareModule:["id","body"],DeclareModuleExports:["typeAnnotation"],DeclareTypeAlias:["id","typeParameters","right"],DeclareOpaqueType:["id","typeParameters","supertype"],DeclareVariable:["id"],DeclareExportDeclaration:["declaration","specifiers","source","attributes"],DeclareExportAllDeclaration:["source","attributes"],DeclaredPredicate:["value"],ExistsTypeAnnotation:[],FunctionTypeAnnotation:["typeParameters","this","params","rest","returnType"],FunctionTypeParam:["name","typeAnnotation"],GenericTypeAnnotation:["id","typeParameters"],InferredPredicate:[],InterfaceExtends:["id","typeParameters"],InterfaceDeclaration:["id","typeParameters","extends","body"],InterfaceTypeAnnotation:["extends","body"],IntersectionTypeAnnotation:["types"],MixedTypeAnnotation:[],EmptyTypeAnnotation:[],NullableTypeAnnotation:["typeAnnotation"],NumberLiteralTypeAnnotation:[],NumberTypeAnnotation:[],ObjectTypeAnnotation:["properties","indexers","callProperties","internalSlots"],ObjectTypeInternalSlot:["id","value"],ObjectTypeCallProperty:["value"],ObjectTypeIndexer:["variance","id","key","value"],ObjectTypeProperty:["key","value","variance"],ObjectTypeSpreadProperty:["argument"],OpaqueType:["id","typeParameters","supertype","impltype"],QualifiedTypeIdentifier:["qualification","id"],StringLiteralTypeAnnotation:[],StringTypeAnnotation:[],SymbolTypeAnnotation:[],ThisTypeAnnotation:[],TupleTypeAnnotation:["types","elementTypes"],TypeofTypeAnnotation:["argument","typeArguments"],TypeAlias:["id","typeParameters","right"],TypeAnnotation:["typeAnnotation"],TypeCastExpression:["expression","typeAnnotation"],TypeParameter:["bound","default","variance"],TypeParameterDeclaration:["params"],TypeParameterInstantiation:["params"],UnionTypeAnnotation:["types"],Variance:[],VoidTypeAnnotation:[],EnumDeclaration:["id","body"],EnumBooleanBody:["members"],EnumNumberBody:["members"],EnumStringBody:["members"],EnumSymbolBody:["members"],EnumBooleanMember:["id","init"],EnumNumberMember:["id","init"],EnumStringMember:["id","init"],EnumDefaultedMember:["id"],IndexedAccessType:["objectType","indexType"],OptionalIndexedAccessType:["objectType","indexType"],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXSpreadChild:["expression"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","typeParameters","typeArguments","attributes"],JSXSpreadAttribute:["argument"],JSXText:[],JSXFragment:["openingFragment","children","closingFragment"],JSXOpeningFragment:[],JSXClosingFragment:[],Noop:[],Placeholder:[],V8IntrinsicIdentifier:[],ArgumentPlaceholder:[],BindExpression:["object","callee"],Decorator:["expression"],DoExpression:["body"],ExportDefaultSpecifier:["exported"],ModuleExpression:["body"],TopicReference:[],PipelineTopicExpression:["expression"],PipelineBareFunction:["callee"],PipelinePrimaryTopicReference:[],TSParameterProperty:["parameter","decorators"],TSDeclareFunction:["id","typeParameters","params","returnType","body"],TSDeclareMethod:["decorators","key","typeParameters","params","returnType"],TSQualifiedName:["left","right"],TSCallSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSPropertySignature:["key","typeAnnotation"],TSMethodSignature:["key","typeParameters","parameters","typeAnnotation","params","returnType"],TSIndexSignature:["parameters","typeAnnotation"],TSAnyKeyword:[],TSBooleanKeyword:[],TSBigIntKeyword:[],TSIntrinsicKeyword:[],TSNeverKeyword:[],TSNullKeyword:[],TSNumberKeyword:[],TSObjectKeyword:[],TSStringKeyword:[],TSSymbolKeyword:[],TSUndefinedKeyword:[],TSUnknownKeyword:[],TSVoidKeyword:[],TSThisType:[],TSFunctionType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructorType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSTypeReference:["typeName","typeParameters","typeArguments"],TSTypePredicate:["parameterName","typeAnnotation"],TSTypeQuery:["exprName","typeParameters","typeArguments"],TSTypeLiteral:["members"],TSArrayType:["elementType"],TSTupleType:["elementTypes"],TSOptionalType:["typeAnnotation"],TSRestType:["typeAnnotation"],TSNamedTupleMember:["label","elementType"],TSUnionType:["types"],TSIntersectionType:["types"],TSConditionalType:["checkType","extendsType","trueType","falseType"],TSInferType:["typeParameter"],TSParenthesizedType:["typeAnnotation"],TSTypeOperator:["typeAnnotation"],TSIndexedAccessType:["objectType","indexType"],TSMappedType:["nameType","typeAnnotation","key","constraint"],TSTemplateLiteralType:["quasis","types"],TSLiteralType:["literal"],TSExpressionWithTypeArguments:["expression","typeParameters"],TSInterfaceDeclaration:["id","typeParameters","extends","body"],TSInterfaceBody:["body"],TSTypeAliasDeclaration:["id","typeParameters","typeAnnotation"],TSInstantiationExpression:["expression","typeParameters","typeArguments"],TSAsExpression:["expression","typeAnnotation"],TSSatisfiesExpression:["expression","typeAnnotation"],TSTypeAssertion:["typeAnnotation","expression"],TSEnumBody:["members"],TSEnumDeclaration:["id","body"],TSEnumMember:["id","initializer"],TSModuleDeclaration:["id","body"],TSModuleBlock:["body"],TSImportType:["argument","options","qualifier","typeParameters","typeArguments"],TSImportEqualsDeclaration:["id","moduleReference"],TSExternalModuleReference:["expression"],TSNonNullExpression:["expression"],TSExportAssignment:["expression"],TSNamespaceExportDeclaration:["id"],TSTypeAnnotation:["typeAnnotation"],TSTypeParameterInstantiation:["params"],TSTypeParameterDeclaration:["params"],TSTypeParameter:["constraint","default","name"],ChainExpression:["expression"],ExperimentalRestProperty:["argument"],ExperimentalSpreadProperty:["argument"],Literal:[],MethodDefinition:["decorators","key","value"],PrivateIdentifier:[],Property:["key","value"],PropertyDefinition:["decorators","key","typeAnnotation","value","variance"],AccessorProperty:["decorators","key","typeAnnotation","value"],TSAbstractAccessorProperty:["decorators","key","typeAnnotation"],TSAbstractKeyword:[],TSAbstractMethodDefinition:["key","value"],TSAbstractPropertyDefinition:["decorators","key","typeAnnotation"],TSAsyncKeyword:[],TSClassImplements:["expression","typeArguments","typeParameters"],TSDeclareKeyword:[],TSEmptyBodyFunctionExpression:["id","typeParameters","params","returnType"],TSExportKeyword:[],TSInterfaceHeritage:["expression","typeArguments","typeParameters"],TSPrivateKeyword:[],TSProtectedKeyword:[],TSPublicKeyword:[],TSReadonlyKeyword:[],TSStaticKeyword:[],AsConstExpression:["expression"],AsExpression:["expression","typeAnnotation"],BigIntLiteralTypeAnnotation:[],BigIntTypeAnnotation:[],ComponentDeclaration:["id","params","body","typeParameters","rendersType"],ComponentParameter:["name","local"],ComponentTypeAnnotation:["params","rest","typeParameters","rendersType"],ComponentTypeParameter:["name","typeAnnotation"],ConditionalTypeAnnotation:["checkType","extendsType","trueType","falseType"],DeclareComponent:["id","params","rest","typeParameters","rendersType"],DeclareEnum:["id","body"],DeclareHook:["id"],DeclareNamespace:["id","body"],EnumBigIntBody:["members"],EnumBigIntMember:["id","init"],HookDeclaration:["id","params","body","typeParameters","returnType"],HookTypeAnnotation:["params","returnType","rest","typeParameters"],InferTypeAnnotation:["typeParameter"],KeyofTypeAnnotation:["argument"],ObjectTypeMappedTypeProperty:["keyTparam","propType","sourceType","variance"],QualifiedTypeofIdentifier:["qualification","id"],TupleTypeLabeledElement:["label","elementType","variance"],TupleTypeSpreadElement:["label","typeAnnotation"],TypeOperator:["typeAnnotation"],TypePredicate:["parameterName","typeAnnotation","asserts"],NGChainedExpression:["expressions"],NGEmptyExpression:[],NGPipeExpression:["left","right","arguments"],NGMicrosyntax:["body"],NGMicrosyntaxAs:["key","alias"],NGMicrosyntaxExpression:["expression","alias"],NGMicrosyntaxKey:[],NGMicrosyntaxKeyedExpression:["key","expression"],NGMicrosyntaxLet:["key","value"],NGRoot:["node"],JsExpressionRoot:["node"],JsonRoot:["node"],TSJSDocAllType:[],TSJSDocUnknownType:[],TSJSDocNullableType:["typeAnnotation"],TSJSDocNonNullableType:["typeAnnotation"],NeverTypeAnnotation:[],SatisfiesExpression:["expression","typeAnnotation"],UndefinedTypeAnnotation:[],UnknownTypeAnnotation:[]},GQt=zQt(HQt),KQt=GQt;XQt=bse,ioe(["RegExpLiteral","BigIntLiteral","NumericLiteral","StringLiteral","DirectiveLiteral","Literal","JSXText","TemplateElement","StringLiteralTypeAnnotation","NumberLiteralTypeAnnotation","BigIntLiteralTypeAnnotation"]);QQt=YQt,ZQt=/\*\/$/,eZt=/^\/\*\*?/,tZt=/^\s*(\/\*\*?(.|\r?\n)*?\*\/)/,rZt=/(^|\s+)\/\/([^\n\r]*)/g,n5e=/^(\r?\n)+/,nZt=/(?:^|\r?\n) *(@[^\n\r]*?) *\r?\n *(?![^\n\r@]*\/\/[^]*)([^\s@][^\n\r@]+?) *\r?\n/g,i5e=/(?:^|\r?\n) *@(\S+) *([^\n\r]*)/g,iZt=/(\r?\n|^) *\* ?/g,aZt=[];uZt=["noformat","noprettier"],lZt=["format","prettier"];pZt=cZt;hZt=fZt,mZt=/^[^"'`]*<\/|^[^/]{2}.*\/>/mu;gZt=yZt,pke="module",_ke="script",vZt=[pke,_ke];xZt={loc:true,range:true,comment:true,tokens:false,loggerFn:false,project:false,jsDocParsingMode:"none",suppressDeprecatedPropertyWarnings:true};EZt=e=>e&&/\.(?:js|mjs|cjs|jsx|ts|mts|cts|tsx)$/iu.test(e);wZt=hZt(AZt),kZt=u5e;});Gi();Gi();Gi();var hS=class{parse(t){let r=this.cleanSvgContent(t),i=this.parseElement(r);return {root:i,viewBox:i.attributes.viewBox,width:i.attributes.width,height:i.attributes.height,namespace:i.attributes.xmlns}}extractColors(t){let r=[];return this.traverseElements(t.root,i=>{i.attributes.fill&&this.isValidColor(i.attributes.fill)&&r.push({value:i.attributes.fill,type:"fill",element:i,attribute:"fill"}),i.attributes.stroke&&this.isValidColor(i.attributes.stroke)&&r.push({value:i.attributes.stroke,type:"stroke",element:i,attribute:"stroke"}),i.attributes["stop-color"]&&this.isValidColor(i.attributes["stop-color"])&&r.push({value:i.attributes["stop-color"],type:"stop-color",element:i,attribute:"stop-color"});}),r}cleanSvgContent(t){return t.replace(/<\?xml[^>]*\?>/gi,"").replace(/<!--[\s\S]*?-->/g,"").trim()}parseElement(t){let r=t.match(/<svg([^>]*)>/i);if(!r)throw new Error("Invalid SVG: No svg element found");let i=this.parseAttributes(r[1]),a=this.parseChildren(t);return {tag:"svg",attributes:i,children:a}}parseAttributes(t){let r={},i=/(\w+(?:-\w+)*)=["']([^"']*)["']/g,a;for(;(a=i.exec(t))!==null;)r[a[1]]=a[2];return r}parseChildren(t){let r=[],i=t.match(/<svg[^>]*>(.*)<\/svg>/is);if(!i||!i[1])return r;let a=i[1],o=/<(\w+(?::\w+)?)([^>]*?)(?:\s*\/\s*>|>(.*?)<\/\1\s*>)/gs,u;for(;(u=o.exec(a))!==null;){let[,c,l,h]=u,p=this.parseAttributes(l),f={tag:c,attributes:p,children:[]};h!==void 0&&(h.includes("<")?f.children=this.parseNestedElements(h):h.trim()&&(f.content=h.trim())),r.push(f);}return r}parseNestedElements(t){let r=[],i=/<(\w+(?::\w+)?)([^>]*?)(?:\s*\/\s*>|>(.*?)<\/\1\s*>)/gs,a;for(;(a=i.exec(t))!==null;){let[,o,u,c]=a,l=this.parseAttributes(u),h={tag:o,attributes:l,children:[]};c!==void 0&&(c.includes("<")?h.children=this.parseNestedElements(c):c.trim()&&(h.content=c.trim())),r.push(h);}return r}traverseElements(t,r){r(t),t.children.forEach(i=>this.traverseElements(i,r));}isValidColor(t){return !t||t==="none"||t==="transparent"||t==="currentColor"?false:/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$/.test(t)||/^rgba?\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*(?:,\s*[\d.]+\s*)?\)$/.test(t)||/^hsla?\(\s*\d+\s*,\s*\d+%\s*,\s*\d+%\s*(?:,\s*[\d.]+\s*)?\)$/.test(t)?true:["red","green","blue","black","white","yellow","cyan","magenta"].includes(t.toLowerCase())}};Gi();Gi();var mS=class{options;constructor(t={}){this.options={preserveOriginalNames:t.preserveOriginalNames??false,generateClasses:t.generateClasses??true,colorPrefix:t.colorPrefix??"color"};}extractColors(t){let r=[];this.traverseElement(t,r);let i=new Map;return r.forEach(a=>{this.isValidColor(a.value)&&i.set(a.value,a);}),Array.from(i.values()).sort((a,o)=>a.value.localeCompare(o.value))}apply(t){let r=this.extractColors(t),i=this.generateColorMappings(r),a=this.replaceColorsWithVariables(t,i);return {mappings:i,processedElement:a,originalColors:r.map(o=>o.value)}}generateColorMappings(t){return t.map((r,i)=>({originalColor:r.value,variableName:i===0?this.options.colorPrefix:`${this.options.colorPrefix}${i+1}`,type:r.type}))}replaceColorsWithVariables(t,r){let i=new Map(r.map(a=>[a.originalColor,a.variableName]));return this.transformElement(t,a=>{let o={...a.attributes};if(o.fill&&i.has(o.fill)&&(o.fill=`{${i.get(o.fill)}}`),o.stroke&&i.has(o.stroke)&&(o.stroke=`{${i.get(o.stroke)}}`),o["stop-color"]&&i.has(o["stop-color"])&&(o["stop-color"]=`{${i.get(o["stop-color"])}}`),o.style){let u=o.style,c=u.match(/fill:\s*([^;]+)/);if(c){let p=c[1].trim();i.has(p)&&(u=u.replace(/fill:\s*[^;]+/,`fill: {${i.get(p)}}`));}let l=u.match(/stroke:\s*([^;]+)/);if(l){let p=l[1].trim();i.has(p)&&(u=u.replace(/stroke:\s*[^;]+/,`stroke: {${i.get(p)}}`));}let h=u.match(/stop-color:\s*([^;]+)/);if(h){let p=h[1].trim();i.has(p)&&(u=u.replace(/stop-color:\s*[^;]+/,`stop-color: {${i.get(p)}}`));}o.style=u;}if(this.isDrawableElement(a.tag)){let u=a.attributes.fill!==void 0&&a.attributes.fill!=="",c=a.attributes.stroke!==void 0&&a.attributes.stroke!=="";u&&!c&&!o.stroke&&(o.stroke="none"),c&&!u&&!o.fill&&(o.fill="none");}return {...a,attributes:o}})}traverseElement(t,r){t.attributes.fill&&r.push({value:t.attributes.fill,type:"fill",element:t,attribute:"fill"}),t.attributes.stroke&&r.push({value:t.attributes.stroke,type:"stroke",element:t,attribute:"stroke"}),t.attributes["stop-color"]&&r.push({value:t.attributes["stop-color"],type:"stop-color",element:t,attribute:"stop-color"}),t.attributes.style&&this.extractColorsFromStyle(t.attributes.style).forEach(a=>{r.push({value:a.value,type:a.type,element:t,attribute:"style"});}),t.children.forEach(i=>this.traverseElement(i,r));}transformElement(t,r){let i=r(t);return {...i,children:i.children.map(a=>this.transformElement(a,r))}}isDrawableElement(t){return ["path","circle","ellipse","line","rect","polygon","polyline","text","tspan","use"].includes(t)}isValidColor(t){return !t||t==="none"||t==="transparent"||t==="currentColor"?false:/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$/.test(t)||/^rgba?\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*(?:,\s*[\d.]+\s*)?\)$/.test(t)||/^hsla?\(\s*\d+\s*,\s*\d+%\s*,\s*\d+%\s*(?:,\s*[\d.]+\s*)?\)$/.test(t)?true:["red","green","blue","yellow","orange","purple","pink","brown","black","white","gray","grey","cyan","magenta","lime","navy"].includes(t.toLowerCase())}extractColorsFromStyle(t){let r=[],i=t.match(/fill:\s*([^;]+)/);if(i){let u=i[1].trim();this.isValidColor(u)&&r.push({value:u,type:"fill"});}let a=t.match(/stroke:\s*([^;]+)/);if(a){let u=a[1].trim();this.isValidColor(u)&&r.push({value:u,type:"stroke"});}let o=t.match(/stop-color:\s*([^;]+)/);if(o){let u=o[1].trim();this.isValidColor(u)&&r.push({value:u,type:"stop-color"});}return r}};Gi();var yS=class{options;constructor(t={}){this.options={preserveExisting:t.preserveExisting??true,onlyIfStrokePresent:t.onlyIfStrokePresent??true};}apply(t){let r=0;return {processedElement:this.transformElement(t,a=>this.shouldAddVectorEffect(a)?(r++,{...a,attributes:{...a.attributes,"vector-effect":"non-scaling-stroke"}}):a),elementsModified:r}}shouldAddVectorEffect(t){return this.options.preserveExisting&&t.attributes["vector-effect"]?false:["path","line","polyline","polygon","rect","circle","ellipse"].includes(t.tag)}transformElement(t,r){let i=r(t);return {...i,children:i.children.map(a=>this.transformElement(a,r))}}};Gi();var gS=class{options;constructor(t={}){this.options={preserveOriginalNames:t.preserveOriginalNames??false,strokeWidthPrefix:t.strokeWidthPrefix??"strokeWidth",generateClasses:t.generateClasses??true};}extractStrokeWidths(t){let r=[];this.traverseElement(t,r);let i=new Map;return r.forEach(a=>{this.isValidStrokeWidth(a.value)&&i.set(a.value,a);}),Array.from(i.values()).sort((a,o)=>{let u=parseFloat(a.value),c=parseFloat(o.value);return isNaN(u)&&isNaN(c)?a.value.localeCompare(o.value):isNaN(u)?1:isNaN(c)?-1:u-c})}apply(t){let r=this.extractStrokeWidths(t),i=this.generateStrokeWidthMappings(r),a=this.replaceStrokeWidthsWithVariables(t,i);return {mappings:i,processedElement:a,originalStrokeWidths:r.map(o=>o.value)}}traverseElement(t,r){if(t.attributes["stroke-width"]&&r.push({value:t.attributes["stroke-width"],element:t,attribute:"stroke-width"}),t.attributes.style){let i=this.extractStrokeWidthFromStyle(t.attributes.style);i&&r.push({value:i,element:t,attribute:"style",styleProperty:"stroke-width"});}t.children.forEach(i=>this.traverseElement(i,r));}extractStrokeWidthFromStyle(t){let r=t.match(/stroke-width\s*:\s*([^;]+)/);return r?r[1].trim():null}isValidStrokeWidth(t){return t==="inherit"||t==="none"||t==="initial"||t==="unset"||t.includes("var(")||t.includes("calc(")?false:/^[\d.]+(?:px|pt|pc|in|cm|mm|em|rem|ex|ch|vw|vh|vmin|vmax|%)?$/.test(t.trim())}generateStrokeWidthMappings(t){return t.map((r,i)=>({originalStrokeWidth:r.value,variableName:i===0?this.options.strokeWidthPrefix:`${this.options.strokeWidthPrefix}${i+1}`}))}replaceStrokeWidthsWithVariables(t,r){let i=new Map(r.map(a=>[a.originalStrokeWidth,a.variableName]));return this.transformElement(t,a=>{let o={...a.attributes};if(o["stroke-width"]&&i.has(o["stroke-width"])&&(o["stroke-width"]=`{${i.get(o["stroke-width"])}}`),o.style){let u=o.style;i.forEach((c,l)=>{let h=new RegExp(`stroke-width\\s*:\\s*${this.escapeRegExp(l)}`,"g");u=u.replace(h,`stroke-width: {${c}}`);}),o.style=u;}return {...a,attributes:o}})}transformElement(t,r){let i=r(t);return {...i,children:i.children.map(a=>this.transformElement(a,r))}}escapeRegExp(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}};Gi();var vS=class{options;constructor(t={}){this.options={addRole:t.addRole??true,addAriaHidden:t.addAriaHidden??false,addTitle:t.addTitle??true,addDesc:t.addDesc??true,defaultRole:t.defaultRole??"img",preserveExisting:t.preserveExisting??true};}apply(t){let r=[];if(t.tag!=="svg")return {processedElement:t,attributesAdded:r};let i={...t.attributes};return this.options.addRole&&(!this.options.preserveExisting||!i.role)&&(i.role=this.options.defaultRole,r.push("role")),this.options.addAriaHidden&&(!this.options.preserveExisting||!i["aria-hidden"])&&(i["aria-hidden"]="true",r.push("aria-hidden")),this.options.addTitle&&r.push("title-support"),this.options.addDesc&&r.push("desc-support"),this.options.addTitle&&this.options.addDesc&&(!this.options.preserveExisting||!i["aria-labelledby"])?(i["aria-labelledby"]="{titleId} {descId}",r.push("aria-labelledby")):this.options.addTitle&&(!this.options.preserveExisting||!i["aria-labelledby"])&&(i["aria-labelledby"]="{titleId}",r.push("aria-labelledby")),{processedElement:{...t,attributes:i},attributesAdded:r}}generateProps(){let t=[];return this.options.addTitle&&t.push("title?: string","titleId?: string"),this.options.addDesc&&t.push("desc?: string","descId?: string"),t}generateJSXElements(t){let r=[];return t==="react"?(this.options.addDesc&&r.push("{desc ? <desc id={descId}>{desc}</desc> : null}"),this.options.addTitle&&r.push("{title ? <title id={titleId}>{title}</title> : null}")):(this.options.addDesc&&r.push('<desc v-if="desc" :id="descId">{{ desc }}</desc>'),this.options.addTitle&&r.push('<title v-if="title" :id="titleId">{{ title }}</title>')),r.join(`
|
|
457
|
-
`)}};var bS=class{transform(t,r={}){let{optimize:i=true,splitColors:a=false,splitStrokeWidths:o=false,fixedStrokeWidth:u=false,accessibility:c=true,removeComments:l=true,removeDuplicates:h=true,minifyPaths:p=false}=r,f=this.deepCloneAst(t),v=[],b=[],C=[];return i&&(this.applyOptimizations(f,{removeComments:l,removeDuplicates:h,minifyPaths:p&&!a}),v.push("optimization")),a&&(b=this.applySplitColors(f),v.push("split-colors")),o&&(C=this.applySplitStrokeWidths(f),v.push("split-stroke-widths")),u&&(this.applyFixedStrokeWidth(f),v.push("fixed-stroke-width")),c&&(this.applyAccessibility(f),v.push("accessibility")),{ast:f,colorMappings:b,strokeWidthMappings:C,metadata:{originalColors:b.map(P=>P.originalColor),originalStrokeWidths:C.map(P=>P.originalStrokeWidth),optimizationApplied:i,features:v,hasClassAttributes:this.hasClassAttributes(f)}}}applySplitColors(t){let i=new mS({generateClasses:true,colorPrefix:"color"}).apply(t.root);return t.root=i.processedElement,i.mappings}applyFixedStrokeWidth(t){let i=new yS({onlyIfStrokePresent:false,preserveExisting:true}).apply(t.root);t.root=i.processedElement;}applyAccessibility(t){let i=new vS({addRole:true,addTitle:true,addDesc:true,defaultRole:"img",preserveExisting:true}).apply(t.root);t.root=i.processedElement;}applyOptimizations(t,r){r.removeDuplicates&&this.removeDuplicateElements(t),r.minifyPaths&&this.minifyPaths(t),this.removeEmptyGroups(t);}removeDuplicateElements(t){}minifyPaths(t){this.traverseElements(t.root,r=>{r.tag==="path"&&r.attributes.d&&(r.attributes.d=r.attributes.d.replace(/\s+/g," ").replace(/([MLHVCSQTAZ])\s+/gi,"$1").trim());});}removeEmptyGroups(t){let r=i=>(i.children=i.children.filter(r),!(i.tag==="g"&&i.children.length===0&&!i.content));t.root.children=t.root.children.filter(r);}traverseElements(t,r){r(t),t.children.forEach(i=>this.traverseElements(i,r));}isValidColor(t){return !t||t==="none"||t==="transparent"||t==="currentColor"?false:/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$/.test(t)||/^rgba?\(.+\)$/.test(t)||/^hsla?\(.+\)$/.test(t)}deepCloneAst(t){return {...t,root:this.deepCloneElement(t.root)}}deepCloneElement(t){return {...t,attributes:{...t.attributes},children:t.children.map(r=>this.deepCloneElement(r))}}hasClassAttributes(t){let r=i=>i.attributes.class||i.attributes.className?true:i.children.some(a=>r(a));return r(t.root)}applySplitStrokeWidths(t){let i=new gS({generateClasses:true,strokeWidthPrefix:"strokeWidth"}).apply(t.root);return t.root=i.processedElement,i.mappings}};Gi();Gi();Gi();Gi();var RR=e=>/^[A-Z][a-zA-Z0-9]*$/.test(e)&&/[a-z]/.test(e)?e:/^[a-z][a-zA-Z0-9]*$/.test(e)&&/[A-Z]/.test(e)?e.charAt(0).toUpperCase()+e.slice(1):e.split(/[\s\-_]+/).filter(Boolean).map(t=>t.length>3&&t===t.toUpperCase()&&/^[A-Z]+$/.test(t)?t.charAt(0).toUpperCase()+t.slice(1).toLowerCase():t.length<=3&&t===t.toUpperCase()&&/^[A-Z]+$/.test(t)?t:t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(""),yZ=e=>e.replace(/-([a-z])/g,(t,r)=>r.toUpperCase()),N1e=e=>{let t={class:"className",for:"htmlFor","accept-charset":"acceptCharset","http-equiv":"httpEquiv"};return t[e]?t[e]:e.startsWith("aria-")||e.startsWith("data-")?e:yZ(e)};function gZ(e,t,r){let i=e.replace(/\.svg$/i,"");return i=Tyt(i),I1e(i,t,r)}function Tyt(e){if(/^[a-zA-Z][a-zA-Z0-9]*$/.test(e))return e;let r=e.
|
|
457
|
+
`)}};var bS=class{transform(t,r={}){let{optimize:i=true,splitColors:a=false,splitStrokeWidths:o=false,fixedStrokeWidth:u=false,accessibility:c=true,removeComments:l=true,removeDuplicates:h=true,minifyPaths:p=false}=r,f=this.deepCloneAst(t),v=[],b=[],C=[];return i&&(this.applyOptimizations(f,{removeComments:l,removeDuplicates:h,minifyPaths:p&&!a}),v.push("optimization")),a&&(b=this.applySplitColors(f),v.push("split-colors")),o&&(C=this.applySplitStrokeWidths(f),v.push("split-stroke-widths")),u&&(this.applyFixedStrokeWidth(f),v.push("fixed-stroke-width")),c&&(this.applyAccessibility(f),v.push("accessibility")),{ast:f,colorMappings:b,strokeWidthMappings:C,metadata:{originalColors:b.map(P=>P.originalColor),originalStrokeWidths:C.map(P=>P.originalStrokeWidth),optimizationApplied:i,features:v,hasClassAttributes:this.hasClassAttributes(f)}}}applySplitColors(t){let i=new mS({generateClasses:true,colorPrefix:"color"}).apply(t.root);return t.root=i.processedElement,i.mappings}applyFixedStrokeWidth(t){let i=new yS({onlyIfStrokePresent:false,preserveExisting:true}).apply(t.root);t.root=i.processedElement;}applyAccessibility(t){let i=new vS({addRole:true,addTitle:true,addDesc:true,defaultRole:"img",preserveExisting:true}).apply(t.root);t.root=i.processedElement;}applyOptimizations(t,r){r.removeDuplicates&&this.removeDuplicateElements(t),r.minifyPaths&&this.minifyPaths(t),this.removeEmptyGroups(t);}removeDuplicateElements(t){}minifyPaths(t){this.traverseElements(t.root,r=>{r.tag==="path"&&r.attributes.d&&(r.attributes.d=r.attributes.d.replace(/\s+/g," ").replace(/([MLHVCSQTAZ])\s+/gi,"$1").trim());});}removeEmptyGroups(t){let r=i=>(i.children=i.children.filter(r),!(i.tag==="g"&&i.children.length===0&&!i.content));t.root.children=t.root.children.filter(r);}traverseElements(t,r){r(t),t.children.forEach(i=>this.traverseElements(i,r));}isValidColor(t){return !t||t==="none"||t==="transparent"||t==="currentColor"?false:/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$/.test(t)||/^rgba?\(.+\)$/.test(t)||/^hsla?\(.+\)$/.test(t)}deepCloneAst(t){return {...t,root:this.deepCloneElement(t.root)}}deepCloneElement(t){return {...t,attributes:{...t.attributes},children:t.children.map(r=>this.deepCloneElement(r))}}hasClassAttributes(t){let r=i=>i.attributes.class||i.attributes.className?true:i.children.some(a=>r(a));return r(t.root)}applySplitStrokeWidths(t){let i=new gS({generateClasses:true,strokeWidthPrefix:"strokeWidth"}).apply(t.root);return t.root=i.processedElement,i.mappings}};Gi();Gi();Gi();Gi();var RR=e=>/^[A-Z][a-zA-Z0-9]*$/.test(e)&&/[a-z]/.test(e)?e:/^[a-z][a-zA-Z0-9]*$/.test(e)&&/[A-Z]/.test(e)?e.charAt(0).toUpperCase()+e.slice(1):e.split(/[\s\-_]+/).filter(Boolean).map(t=>t.length>3&&t===t.toUpperCase()&&/^[A-Z]+$/.test(t)?t.charAt(0).toUpperCase()+t.slice(1).toLowerCase():t.length<=3&&t===t.toUpperCase()&&/^[A-Z]+$/.test(t)?t:/[a-z][A-Z]/.test(t)?t.charAt(0).toUpperCase()+t.slice(1):t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(""),yZ=e=>e.replace(/-([a-z])/g,(t,r)=>r.toUpperCase()),N1e=e=>{let t={class:"className",for:"htmlFor","accept-charset":"acceptCharset","http-equiv":"httpEquiv"};return t[e]?t[e]:e.startsWith("aria-")||e.startsWith("data-")?e:yZ(e)};function gZ(e,t,r){let i=e.replace(/\.svg$/i,"");return i=Tyt(i),I1e(i,t,r)}function Tyt(e){if(/^[a-zA-Z][a-zA-Z0-9]*$/.test(e))return e;let r=e.replace(/[^a-zA-Z0-9]/g," ");return r=r.replace(/\s+/g," ").trim(),r}function B1e(e,t="main"){let r=e.replace(/=/g," ").replace(/,/g," ").replace(/[^a-zA-Z0-9]/g," ").replace(/\s+/g," ").trim();if(t==="prefix"){if(!/^[a-zA-Z]/.test(r))return ""}else t==="suffix"?r=r.replace(/^[^a-zA-Z0-9]+/,""):r=r.replace(/^[^a-zA-Z]+/,"");return RR(r)}function Syt(e){return e&&RR(e).split(/(?<=[a-z])(?=[0-9])|(?<=[0-9])(?=[A-Z])/).map(i=>i&&(/^\d/.test(i)?i.replace(/^(\d+)([a-z])/,(a,o,u)=>o+u.toUpperCase()):i)).join("")}function I1e(e,t,r){let i=e;t&&(i=`${t}-${i}`),r&&(i=`${i}-${r}`);let a=B1e(i,"main");return Syt(a)}var pC=class{options;constructor(t={}){this.options={typescript:true,memo:true,forwardRef:true,exportDefault:true,componentName:"Icon",prefix:"",suffix:"",includeTypes:true,...t};}astToJsx(t){return this.elementToJsx(t.root,0)}elementToJsx(t,r=0){let i=" ".repeat(r+1),{tag:a,attributes:o,children:u,content:c}=t,l=this.attributesToJsx(o),h=l.length>0?" "+l.join(" "):"";if(u.length===0&&!c)return `${i}<${a}${h} />`;let p=`${i}<${a}${h}>`;return c&&(p+=c),u.length>0&&(p+=`
|
|
458
458
|
`,p+=u.map(f=>this.elementToJsx(f,r+1)).join(`
|
|
459
459
|
`),p+=`
|
|
460
460
|
`+i),p+=`</${a}>`,p}attributesToJsx(t){return Object.entries(t).map(([r,i])=>{let a=this.convertAttributeName(r);return i.startsWith("{")&&i.endsWith("}")?`${a}=${i}`:`${a}="${i}"`})}convertAttributeName(t){let r={class:"className",for:"htmlFor",tabindex:"tabIndex",readonly:"readOnly",maxlength:"maxLength",cellpadding:"cellPadding",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"};return t.startsWith("aria-")||t.startsWith("data-")?t:t.includes("-")?t.replace(/-([a-z])/g,(i,a)=>a.toUpperCase()):r[t]||t}generateColorProps(t,r=true){return t.length===0?"":t.map(i=>{let a=i.variableName,o=`${a}Class`;if(this.options.typescript){let u=` ${a}?: string;`;return r&&(u+=`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svgfusion",
|
|
3
|
-
"version": "1.15.
|
|
3
|
+
"version": "1.15.2",
|
|
4
4
|
"description": "A powerful CLI tool and library that converts SVG files into production-ready React and Vue 3 components with native SVG props inheritance, TypeScript support, and custom SVGFusion engine.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|