@unocss/inspector 0.52.3 → 0.52.4

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.
@@ -0,0 +1 @@
1
+ import{s as j,t as C,d as W,x as D,y as U,r as N,u as Z,z as q,A as G,B as K,j as i,c as M,g,w as S,e as d,C as w,_ as H,o as P,k as R,D as k,E as z,n as B,h as J,v as L,i as Q,M as X,F as Y,m as ee,l as te,q as re,G as le}from"./index-c217f629.js";const T=/^(?!.*\[(?:[^:]+):(?:.+)\]$)((?:.+:)?!?)?(.*)$/;function se(e={}){const f=e.prefix??"un-",l=e.prefixedOnly??!1,x=e.trueToNonValued??!1;let u;return{name:"attributify",match(y,{generator:a}){var h,c;const m=j(y);if(!m)return;let r=m[1];if(r.startsWith(f))r=r.slice(f.length);else if(l)return;const t=m[2],[,v="",n=t]=t.match(T)||[];if(n==="~"||x&&n==="true"||!n)return`${v}${r}`;if(u==null){const s=(c=(h=a==null?void 0:a.config)==null?void 0:h.separators)==null?void 0:c.join("|");s?u=new RegExp(`^(.*\\](?:${s}))(\\[[^\\]]+?\\])$`):u=!1}if(u){const[,s,o]=t.match(u)||[];if(o)return`${s}${v}${r}-${o}`}return`${v}${r}-${n}`}}}const ae=/(<\w[\w:\.$-]*\s)((?:'[^>]*?'|"[^>]*?"|`[^>]*?`|\{[^>]*?\}|[^>]*?)*)/g,ne=/([?]|(?!\d|-{2}|-\d)[a-zA-Z0-9\u00A0-\uFFFF-_:%-]+)(?:=("[^"]*|'[^']*))?/g,F=/[\s'"`;>]+/;function ce(e){return{name:"attributify",extract:({content:f,cursor:l})=>{const x=f.matchAll(ae);let u,y=0;for(const _ of x){const[,b,V]=_,$=_.index+b.length;if(l>$&&l<=$+V.length){y=$,u=V;break}}if(!u)return null;const a=u.matchAll(ne);let m=0,r,t;for(const _ of a){const[b,V,$]=_,E=y+_.index;if(l>E&&l<=E+b.length){m=E,r=V,t=$==null?void 0:$.slice(1);break}}if(!r||r==="class"||r==="className"||r===":class")return null;const v=!!(e!=null&&e.prefix)&&r.startsWith(e.prefix);if(e!=null&&e.prefixedOnly&&!v)return null;const n=v?r.slice(e.prefix.length):r;if(t===void 0)return{extracted:n,resolveReplacement(_){const b=v?e.prefix.length:0;return{start:m+b,end:m+r.length,replacement:_}}};const h=m+r.length+2;let c=F.exec(t),s=0,o;for(;c;){const[_]=c;if(l>h+s&&l<=h+s+c.index){o=t.slice(s,s+c.index);break}s+=c.index+_.length,c=F.exec(t.slice(s))}o===void 0&&(o=t.slice(s));const[,p="",A]=o.match(T)||[];return{extracted:`${p}${n}-${A}`,transformSuggestions(_){return _.filter(b=>b.startsWith(`${p}${n}-`)).map(b=>p+b.slice(p.length+n.length+1))},resolveReplacement(_){return{start:s+h,end:s+h+o.length,replacement:p+_.slice(p.length+n.length+1)}}}}}}const ie=["v-bind:",":"],O=/[\s'"`;]+/g,ue=/<[^>\s]*\s((?:'.*?'|".*?"|`.*?`|\{.*?\}|[^>]*?)*)/g,oe=/([?]|(?!\d|-{2}|-\d)[a-zA-Z0-9\u00A0-\uFFFF-_:!%-.~<]+)=?(?:["]([^"]*)["]|[']([^']*)[']|[{]([^}]*)[}])?/gms,I=["placeholder","fill","opacity"];function de(e){const f=(e==null?void 0:e.ignoreAttributes)??I,l=(e==null?void 0:e.nonValuedAttribute)??!0,x=(e==null?void 0:e.trueToNonValued)??!1;return{name:"@unocss/preset-attributify/extractor",extract({code:u}){const y=Array.from(u.matchAll(ue)).flatMap(a=>Array.from((a[1]||"").matchAll(oe))).flatMap(([,a,...m])=>{const r=m.filter(Boolean).join("");if(f.includes(a))return[];for(const t of ie)if(a.startsWith(t)){a=a.slice(t.length);break}if(!r){if(C(a)&&l!==!1){const t=[`[${a}=""]`];return x&&t.push(`[${a}="true"]`),t}return[]}return["class","className"].includes(a)?r.split(O).filter(C):e!=null&&e.prefixedOnly&&e.prefix&&!a.startsWith(e.prefix)?[]:r.split(O).filter(t=>!!t&&t!==":").map(t=>`[${a}~="${t}"]`)});return new Set(y)}}}function fe(e={}){e.strict=e.strict??!1,e.prefix=e.prefix??"un-",e.prefixedOnly=e.prefixedOnly??!1,e.nonValuedAttribute=e.nonValuedAttribute??!0,e.ignoreAttributes=e.ignoreAttributes??I;const f=[se(e)],l=[de(e)],x=[ce(e)];return{name:"@unocss/preset-attributify",enforce:"post",variants:f,extractors:l,options:e,autocomplete:{extractors:x},extractorDefault:e.strict?!1:void 0}}const me={key:0,"h-full":"","of-hidden":""},he=d("div",{op50:""}," Module ",-1),_e=d("div",{"i-carbon-launch":""},null,-1),xe=d("div",{op50:""}," Matched Rules ",-1),pe=d("div",{op50:""}," CSS Size ",-1),ye=d("span",{op50:""},"gzipped",-1),ve={key:0,"row-span-3":""},be=d("div",{op50:""}," Potentially Unmatched ",-1),ge={"h-full":"","of-hidden":""},$e=W({__name:"ModuleInfo",props:{id:null},setup(e){const f=e,{data:l}=D(U(f,"id")),x=f.id.split(/\./g).pop(),u=N(null),y=Z(u,"module-scrolls");function a(){fetch(`/__open-in-editor?file=${encodeURIComponent(f.id)}`)}const{extractors:m}=fe({strict:!0}),r=q(async()=>{var h;const n=new Set;if(m){const c={code:((h=l.value)==null?void 0:h.code)||""};for(const s of m){const o=await s.extract(c);o==null||o.forEach(p=>n.add(p))}}return Array.from(n).filter(c=>!c.startsWith("[")).filter(c=>{var s;return!((s=l.value)!=null&&s.matched.includes(c))})}),t=N(!1),v=G(K(()=>{var n;return(n=l.value)==null?void 0:n.css}),t);return(n,h)=>{const c=Y,s=H,o=ee,p=te;return i(l)?(P(),M("div",me,[g(s,{ref_key:"status",ref:u,grid:"~ cols-3 gap-4"},{default:S(()=>{var A;return[d("div",null,[he,d("a",{"cursor-pointer":"",op80:"","hover:op100":"",onClick:a},[g(c,{id:i(l).id,"mr-1":""},null,8,["id"]),_e])]),d("div",null,[xe,R(" "+k(i(l).matched.length),1)]),d("div",null,[pe,R(" "+k(((((A=i(l))==null?void 0:A.gzipSize)||0)/1024).toFixed(2))+" KiB ",1),ye]),i(r).length?(P(),M("div",ve,[be,d("code",null,k(i(r).join(", ")),1)])):w("",!0)]}),_:1},512),d("div",ge,[g(i(X),null,{default:S(()=>[g(i(z),{size:"50"},{default:S(()=>[g(o,{"h-full":"","model-value":i(l).code,"read-only":!0,mode:i(x),matched:i(l).matched,class:"scrolls module-scrolls",style:B(i(y))},null,8,["model-value","mode","matched","style"])]),_:1}),g(i(z),{size:"50"},{default:S(()=>[d("div",null,[g(p,{border:"l b gray-400/20",title:"Output CSS"},{default:S(()=>[d("label",null,[J(d("input",{"onUpdate:modelValue":h[0]||(h[0]=A=>Q(t)?t.value=A:null),type:"checkbox"},null,512),[[L,i(t)]]),R(" Prettify ")])]),_:1}),g(o,{"h-full":"",b:"l main","model-value":i(v),"read-only":!0,mode:"css",class:"scrolls module-scrolls",style:B(i(y))},null,8,["model-value","style"])])]),_:1})]),_:1})])])):w("",!0)}}}),Se=W({__name:"[id]",setup(e){const f=le();return(l,x)=>{const u=$e;return P(),re(u,{id:i(f).params.id},null,8,["id"])}}});export{Se as default};
@@ -276,7 +276,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
276
276
  `),cooked:h===null?null:h.slice(1,D)},g.tail=y,this.next();let v=this.finishNode(g,"TemplateElement");return this.resetEndLocation(v,Ei(this.state.lastTokEndLoc,D)),v}parseTemplate(l){let o=this.startNode();o.expressions=[];let a=this.parseTemplateElement(l);for(o.quasis=[a];!a.tail;)o.expressions.push(this.parseTemplateSubstitution()),this.readTemplateContinuation(),o.quasis.push(a=this.parseTemplateElement(l));return this.finishNode(o,"TemplateLiteral")}parseTemplateSubstitution(){return this.parseExpression()}parseObjectLike(l,o,a,c){a&&this.expectPlugin("recordAndTuple");let h=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let d=Object.create(null),g=!0,y=this.startNode();for(y.properties=[],this.next();!this.match(l);){if(g)g=!1;else if(this.expect(12),this.match(l)){this.addTrailingCommaExtraToNode(y);break}let x;o?x=this.parseBindingProperty():(x=this.parsePropertyDefinition(c),this.checkProto(x,a,d,c)),a&&!this.isObjectProperty(x)&&x.type!=="SpreadElement"&&this.raise(Qe.InvalidRecordProperty,{at:x}),x.shorthand&&this.addExtra(x,"shorthand",!0),y.properties.push(x)}this.next(),this.state.inFSharpPipelineDirectBody=h;let D="ObjectExpression";return o?D="ObjectPattern":a&&(D="RecordExpression"),this.finishNode(y,D)}addTrailingCommaExtraToNode(l){this.addExtra(l,"trailingComma",this.state.lastTokStart),this.addExtra(l,"trailingCommaLoc",this.state.lastTokStartLoc,!1)}maybeAsyncOrAccessorProp(l){return!l.computed&&l.key.type==="Identifier"&&(this.isLiteralPropertyName()||this.match(0)||this.match(55))}parsePropertyDefinition(l){let o=[];if(this.match(26))for(this.hasPlugin("decorators")&&this.raise(Qe.UnsupportedPropertyDecorator,{at:this.state.startLoc});this.match(26);)o.push(this.parseDecorator());let a=this.startNode(),c=!1,h=!1,d;if(this.match(21))return o.length&&this.unexpected(),this.parseSpread();o.length&&(a.decorators=o,o=[]),a.method=!1,l&&(d=this.state.startLoc);let g=this.eat(55);this.parsePropertyNamePrefixOperator(a);let y=this.state.containsEsc,D=this.parsePropertyName(a,l);if(!g&&!y&&this.maybeAsyncOrAccessorProp(a)){let x=D.name;x==="async"&&!this.hasPrecedingLineBreak()&&(c=!0,this.resetPreviousNodeTrailingComments(D),g=this.eat(55),this.parsePropertyName(a)),(x==="get"||x==="set")&&(h=!0,this.resetPreviousNodeTrailingComments(D),a.kind=x,this.match(55)&&(g=!0,this.raise(Qe.AccessorIsGenerator,{at:this.state.curPosition(),kind:x}),this.next()),this.parsePropertyName(a))}return this.parseObjPropValue(a,d,g,c,!1,h,l)}getGetterSetterExpectedParamCount(l){return l.kind==="get"?0:1}getObjectOrClassMethodParams(l){return l.params}checkGetterSetterParams(l){var o;let a=this.getGetterSetterExpectedParamCount(l),c=this.getObjectOrClassMethodParams(l);c.length!==a&&this.raise(l.kind==="get"?Qe.BadGetterArity:Qe.BadSetterArity,{at:l}),l.kind==="set"&&((o=c[c.length-1])==null?void 0:o.type)==="RestElement"&&this.raise(Qe.BadSetterRestParameter,{at:l})}parseObjectMethod(l,o,a,c,h){if(h){let d=this.parseMethod(l,o,!1,!1,!1,"ObjectMethod");return this.checkGetterSetterParams(d),d}if(a||o||this.match(10))return c&&this.unexpected(),l.kind="method",l.method=!0,this.parseMethod(l,o,a,!1,!1,"ObjectMethod")}parseObjectProperty(l,o,a,c){if(l.shorthand=!1,this.eat(14))return l.value=a?this.parseMaybeDefault(this.state.startLoc):this.parseMaybeAssignAllowIn(c),this.finishNode(l,"ObjectProperty");if(!l.computed&&l.key.type==="Identifier"){if(this.checkReservedWord(l.key.name,l.key.loc.start,!0,!1),a)l.value=this.parseMaybeDefault(o,V(l.key));else if(this.match(29)){let h=this.state.startLoc;c!=null?c.shorthandAssignLoc===null&&(c.shorthandAssignLoc=h):this.raise(Qe.InvalidCoverInitializedName,{at:h}),l.value=this.parseMaybeDefault(o,V(l.key))}else l.value=V(l.key);return l.shorthand=!0,this.finishNode(l,"ObjectProperty")}}parseObjPropValue(l,o,a,c,h,d,g){let y=this.parseObjectMethod(l,a,c,h,d)||this.parseObjectProperty(l,o,h,g);return y||this.unexpected(),y}parsePropertyName(l,o){if(this.eat(0))l.computed=!0,l.key=this.parseMaybeAssignAllowIn(),this.expect(3);else{let{type:a,value:c}=this.state,h;if(Xe(a))h=this.parseIdentifier(!0);else switch(a){case 132:h=this.parseNumericLiteral(c);break;case 131:h=this.parseStringLiteral(c);break;case 133:h=this.parseBigIntLiteral(c);break;case 134:h=this.parseDecimalLiteral(c);break;case 136:{let d=this.state.startLoc;o!=null?o.privateKeyLoc===null&&(o.privateKeyLoc=d):this.raise(Qe.UnexpectedPrivateField,{at:d}),h=this.parsePrivateName();break}default:this.unexpected()}l.key=h,a!==136&&(l.computed=!1)}return l.key}initFunction(l,o){l.id=null,l.generator=!1,l.async=o}parseMethod(l,o,a,c,h,d){let g=arguments.length>6&&arguments[6]!==void 0?arguments[6]:!1;this.initFunction(l,a),l.generator=o,this.scope.enter(Oa|ou|(g?Fa:0)|(h?Sl:0)),this.prodParam.enter(de(a,l.generator)),this.parseFunctionParams(l,c);let y=this.parseFunctionBodyAndFinish(l,d,!0);return this.prodParam.exit(),this.scope.exit(),y}parseArrayLike(l,o,a,c){a&&this.expectPlugin("recordAndTuple");let h=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let d=this.startNode();return this.next(),d.elements=this.parseExprList(l,!a,c,d),this.state.inFSharpPipelineDirectBody=h,this.finishNode(d,a?"TupleExpression":"ArrayExpression")}parseArrowExpression(l,o,a,c){this.scope.enter(Oa|Cl);let h=de(a,!1);!this.match(5)&&this.prodParam.hasIn&&(h|=pe),this.prodParam.enter(h),this.initFunction(l,a);let d=this.state.maybeInArrowParameters;return o&&(this.state.maybeInArrowParameters=!0,this.setArrowFunctionParameters(l,o,c)),this.state.maybeInArrowParameters=!1,this.parseFunctionBody(l,!0),this.prodParam.exit(),this.scope.exit(),this.state.maybeInArrowParameters=d,this.finishNode(l,"ArrowFunctionExpression")}setArrowFunctionParameters(l,o,a){this.toAssignableList(o,a,!1),l.params=o}parseFunctionBodyAndFinish(l,o){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.parseFunctionBody(l,!1,a),this.finishNode(l,o)}parseFunctionBody(l,o){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,c=o&&!this.match(5);if(this.expressionScope.enter(E()),c)l.body=this.parseMaybeAssign(),this.checkParams(l,!1,o,!1);else{let h=this.state.strict,d=this.state.labels;this.state.labels=[],this.prodParam.enter(this.prodParam.currentFlags()|se),l.body=this.parseBlock(!0,!1,g=>{let y=!this.isSimpleParamList(l.params);g&&y&&this.raise(Qe.IllegalLanguageModeDirective,{at:(l.kind==="method"||l.kind==="constructor")&&l.key?l.key.loc.end:l});let D=!h&&this.state.strict;this.checkParams(l,!this.state.strict&&!o&&!a&&!y,o,D),this.state.strict&&l.id&&this.checkIdentifier(l.id,Qp,D)}),this.prodParam.exit(),this.state.labels=d}this.expressionScope.exit()}isSimpleParameter(l){return l.type==="Identifier"}isSimpleParamList(l){for(let o=0,a=l.length;o<a;o++)if(!this.isSimpleParameter(l[o]))return!1;return!0}checkParams(l,o,a){let c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,h=!o&&new Set,d={type:"FormalParameters"};for(let g of l.params)this.checkLVal(g,{in:d,binding:Uu,checkClashes:h,strictModeChanged:c})}parseExprList(l,o,a,c){let h=[],d=!0;for(;!this.eat(l);){if(d)d=!1;else if(this.expect(12),this.match(l)){c&&this.addTrailingCommaExtraToNode(c),this.next();break}h.push(this.parseExprListItem(o,a))}return h}parseExprListItem(l,o,a){let c;if(this.match(12))l||this.raise(Qe.UnexpectedToken,{at:this.state.curPosition(),unexpected:","}),c=null;else if(this.match(21)){let h=this.state.startLoc;c=this.parseParenItem(this.parseSpread(o),h)}else if(this.match(17)){this.expectPlugin("partialApplication"),a||this.raise(Qe.UnexpectedArgumentPlaceholder,{at:this.state.startLoc});let h=this.startNode();this.next(),c=this.finishNode(h,"ArgumentPlaceholder")}else c=this.parseMaybeAssignAllowIn(o,this.parseParenItem);return c}parseIdentifier(l){let o=this.startNode(),a=this.parseIdentifierName(l);return this.createIdentifier(o,a)}createIdentifier(l,o){return l.name=o,l.loc.identifierName=o,this.finishNode(l,"Identifier")}parseIdentifierName(l){let o,{startLoc:a,type:c}=this.state;Xe(c)?o=this.state.value:this.unexpected();let h=At(c);return l?h&&this.replaceToken(130):this.checkReservedWord(o,a,h,!1),this.next(),o}checkReservedWord(l,o,a,c){if(!(l.length>10||!Np(l))){if(a&&Qu(l)){this.raise(Qe.UnexpectedKeyword,{at:o,keyword:l});return}if((this.state.strict?c?ns:Ua:qc)(l,this.inModule)){this.raise(Qe.UnexpectedReservedWord,{at:o,reservedWord:l});return}else if(l==="yield"){if(this.prodParam.hasYield){this.raise(Qe.YieldBindingIdentifier,{at:o});return}}else if(l==="await"){if(this.prodParam.hasAwait){this.raise(Qe.AwaitBindingIdentifier,{at:o});return}if(this.scope.inStaticBlock){this.raise(Qe.AwaitBindingIdentifierInStaticBlock,{at:o});return}this.expressionScope.recordAsyncArrowParametersError({at:o})}else if(l==="arguments"&&this.scope.inClassAndNotInNonArrowFunction){this.raise(Qe.ArgumentsInClass,{at:o});return}}}isAwaitAllowed(){return!!(this.prodParam.hasAwait||this.options.allowAwaitOutsideFunction&&!this.scope.inFunction)}parseAwait(l){let o=this.startNodeAt(l);return this.expressionScope.recordParameterInitializerError(Qe.AwaitExpressionFormalParameter,{at:o}),this.eat(55)&&this.raise(Qe.ObsoleteAwaitStar,{at:o}),!this.scope.inFunction&&!this.options.allowAwaitOutsideFunction&&(this.isAmbiguousAwait()?this.ambiguousScriptDifferentAst=!0:this.sawUnambiguousESM=!0),this.state.soloAwait||(o.argument=this.parseMaybeUnary(null,!0)),this.finishNode(o,"AwaitExpression")}isAmbiguousAwait(){if(this.hasPrecedingLineBreak())return!0;let{type:l}=this.state;return l===53||l===10||l===0||es(l)||l===101&&!this.state.containsEsc||l===135||l===56||this.hasPlugin("v8intrinsic")&&l===54}parseYield(){let l=this.startNode();this.expressionScope.recordParameterInitializerError(Qe.YieldInParameter,{at:l}),this.next();let o=!1,a=null;if(!this.hasPrecedingLineBreak())switch(o=this.eat(55),this.state.type){case 13:case 137:case 8:case 11:case 3:case 9:case 14:case 12:if(!o)break;default:a=this.parseMaybeAssign()}return l.delegate=o,l.argument=a,this.finishNode(l,"YieldExpression")}checkPipelineAtInfixOperator(l,o){this.hasPlugin(["pipelineOperator",{proposal:"smart"}])&&l.type==="SequenceExpression"&&this.raise(Qe.PipelineHeadSequenceExpression,{at:o})}parseSmartPipelineBodyInStyle(l,o){if(this.isSimpleReference(l)){let a=this.startNodeAt(o);return a.callee=l,this.finishNode(a,"PipelineBareFunction")}else{let a=this.startNodeAt(o);return this.checkSmartPipeTopicBodyEarlyErrors(o),a.expression=l,this.finishNode(a,"PipelineTopicExpression")}}isSimpleReference(l){switch(l.type){case"MemberExpression":return!l.computed&&this.isSimpleReference(l.object);case"Identifier":return!0;default:return!1}}checkSmartPipeTopicBodyEarlyErrors(l){if(this.match(19))throw this.raise(Qe.PipelineBodyNoArrow,{at:this.state.startLoc});this.topicReferenceWasUsedInCurrentContext()||this.raise(Qe.PipelineTopicUnused,{at:l})}withTopicBindingContext(l){let o=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:1,maxTopicIndex:null};try{return l()}finally{this.state.topicContext=o}}withSmartMixTopicForbiddingContext(l){if(this.hasPlugin(["pipelineOperator",{proposal:"smart"}])){let o=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:0,maxTopicIndex:null};try{return l()}finally{this.state.topicContext=o}}else return l()}withSoloAwaitPermittingContext(l){let o=this.state.soloAwait;this.state.soloAwait=!0;try{return l()}finally{this.state.soloAwait=o}}allowInAnd(l){let o=this.prodParam.currentFlags();if(pe&~o){this.prodParam.enter(o|pe);try{return l()}finally{this.prodParam.exit()}}return l()}disallowInAnd(l){let o=this.prodParam.currentFlags();if(pe&o){this.prodParam.enter(o&~pe);try{return l()}finally{this.prodParam.exit()}}return l()}registerTopicReference(){this.state.topicContext.maxTopicIndex=0}topicReferenceIsAllowedInCurrentContext(){return this.state.topicContext.maxNumOfResolvableTopics>=1}topicReferenceWasUsedInCurrentContext(){return this.state.topicContext.maxTopicIndex!=null&&this.state.topicContext.maxTopicIndex>=0}parseFSharpPipelineBody(l){let o=this.state.startLoc;this.state.potentialArrowAt=this.state.start;let a=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!0;let c=this.parseExprOp(this.parseMaybeUnaryOrPrivate(),o,l);return this.state.inFSharpPipelineDirectBody=a,c}parseModuleExpression(){this.expectPlugin("moduleBlocks");let l=this.startNode();this.next(),this.match(5)||this.unexpected(null,5);let o=this.startNodeAt(this.state.endLoc);this.next();let a=this.initializeScopes(!0);this.enterInitialScopes();try{l.body=this.parseProgram(o,8,"module")}finally{a()}return this.finishNode(l,"ModuleExpression")}parsePropertyNamePrefixOperator(l){}},mc={kind:"loop"},Jp={kind:"switch"},xg=/[\uD800-\uDFFF]/u,Xh=/in(?:stanceof)?/y;function bg(l,o){for(let a=0;a<l.length;a++){let c=l[a],{type:h}=c;if(typeof h=="number"){{if(h===136){let{loc:d,start:g,value:y,end:D}=c,x=g+1,v=Ei(d.start,1);l.splice(a,1,new Jo({type:Sr(27),value:"#",start:g,end:x,startLoc:d.start,endLoc:v}),new Jo({type:Sr(130),value:y,start:x,end:D,startLoc:v,endLoc:d.end})),a++;continue}if(es(h)){let{loc:d,start:g,value:y,end:D}=c,x=g+1,v=Ei(d.start,1),S;o.charCodeAt(g)===96?S=new Jo({type:Sr(22),value:"`",start:g,end:x,startLoc:d.start,endLoc:v}):S=new Jo({type:Sr(8),value:"}",start:g,end:x,startLoc:d.start,endLoc:v});let k,T,$,w;h===24?(T=D-1,$=Ei(d.end,-1),k=y===null?null:y.slice(1,-1),w=new Jo({type:Sr(22),value:"`",start:T,end:D,startLoc:$,endLoc:d.end})):(T=D-2,$=Ei(d.end,-2),k=y===null?null:y.slice(1,-2),w=new Jo({type:Sr(23),value:"${",start:T,end:D,startLoc:$,endLoc:d.end})),l.splice(a,1,S,new Jo({type:Sr(20),value:k,start:x,end:T,startLoc:v,endLoc:$}),w),a+=2;continue}}c.type=Sr(h)}}return l}var vg=class extends to{parseTopLevel(l,o){return l.program=this.parseProgram(o),l.comments=this.state.comments,this.options.tokens&&(l.tokens=bg(this.tokens,this.input)),this.finishNode(l,"File")}parseProgram(l){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:137,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.options.sourceType;if(l.sourceType=a,l.interpreter=this.parseInterpreterDirective(),this.parseBlockBody(l,!0,!0,o),this.inModule&&!this.options.allowUndeclaredExports&&this.scope.undefinedExports.size>0)for(let[h,d]of Array.from(this.scope.undefinedExports))this.raise(Qe.ModuleExportUndefined,{at:d,localName:h});let c;return o===137?c=this.finishNode(l,"Program"):c=this.finishNodeAt(l,"Program",Ei(this.state.startLoc,-1)),c}stmtToDirective(l){let o=l;o.type="Directive",o.value=o.expression,delete o.expression;let a=o.value,c=a.value,h=this.input.slice(a.start,a.end),d=a.value=h.slice(1,-1);return this.addExtra(a,"raw",h),this.addExtra(a,"rawValue",d),this.addExtra(a,"expressionValue",c),a.type="DirectiveLiteral",o}parseInterpreterDirective(){if(!this.match(28))return null;let l=this.startNode();return l.value=this.state.value,this.next(),this.finishNode(l,"InterpreterDirective")}isLet(){return this.isContextual(99)?this.hasFollowingBindingAtom():!1}chStartsBindingIdentifier(l,o){if(Io(l)){if(Xh.lastIndex=o,Xh.test(this.input)){let a=this.codePointAtPos(Xh.lastIndex);if(!ya(a)&&a!==92)return!1}return!0}else return l===92}chStartsBindingPattern(l){return l===91||l===123}hasFollowingBindingAtom(){let l=this.nextTokenStart(),o=this.codePointAtPos(l);return this.chStartsBindingPattern(o)||this.chStartsBindingIdentifier(o,l)}hasFollowingBindingIdentifier(){let l=this.nextTokenStart(),o=this.codePointAtPos(l);return this.chStartsBindingIdentifier(o,l)}startsUsingForOf(){let l=this.lookahead();return l.type===101&&!l.containsEsc?!1:(this.expectPlugin("explicitResourceManagement"),!0)}parseModuleItem(){return this.parseStatementLike(15)}parseStatementListItem(){return this.parseStatementLike(6|(!this.options.annexB||this.state.strict?0:8))}parseStatementOrSloppyAnnexBFunctionDeclaration(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,o=0;return this.options.annexB&&!this.state.strict&&(o|=4,l&&(o|=8)),this.parseStatementLike(o)}parseStatement(){return this.parseStatementLike(0)}parseStatementLike(l){let o=null;return this.match(26)&&(o=this.parseDecorators(!0)),this.parseStatementContent(l,o)}parseStatementContent(l,o){let a=this.state.type,c=this.startNode(),h=!!(l&2),d=!!(l&4),g=l&1;switch(a){case 60:return this.parseBreakContinueStatement(c,!0);case 63:return this.parseBreakContinueStatement(c,!1);case 64:return this.parseDebuggerStatement(c);case 90:return this.parseDoWhileStatement(c);case 91:return this.parseForStatement(c);case 68:if(this.lookaheadCharCode()===46)break;return d||this.raise(this.state.strict?Qe.StrictFunction:this.options.annexB?Qe.SloppyFunctionAnnexB:Qe.SloppyFunction,{at:this.state.startLoc}),this.parseFunctionStatement(c,!1,!h&&d);case 80:return h||this.unexpected(),this.parseClass(this.maybeTakeDecorators(o,c),!0);case 69:return this.parseIfStatement(c);case 70:return this.parseReturnStatement(c);case 71:return this.parseSwitchStatement(c);case 72:return this.parseThrowStatement(c);case 73:return this.parseTryStatement(c);case 105:if(this.hasFollowingLineBreak()||this.state.containsEsc||!this.hasFollowingBindingIdentifier())break;return this.expectPlugin("explicitResourceManagement"),!this.scope.inModule&&this.scope.inTopLevel?this.raise(Qe.UnexpectedUsingDeclaration,{at:this.state.startLoc}):h||this.raise(Qe.UnexpectedLexicalDeclaration,{at:this.state.startLoc}),this.parseVarStatement(c,"using");case 99:{if(this.state.containsEsc)break;let x=this.nextTokenStart(),v=this.codePointAtPos(x);if(v!==91&&(!h&&this.hasFollowingLineBreak()||!this.chStartsBindingIdentifier(v,x)&&v!==123))break}case 75:h||this.raise(Qe.UnexpectedLexicalDeclaration,{at:this.state.startLoc});case 74:{let x=this.state.value;return this.parseVarStatement(c,x)}case 92:return this.parseWhileStatement(c);case 76:return this.parseWithStatement(c);case 5:return this.parseBlock();case 13:return this.parseEmptyStatement(c);case 83:{let x=this.lookaheadCharCode();if(x===40||x===46)break}case 82:{!this.options.allowImportExportEverywhere&&!g&&this.raise(Qe.UnexpectedImportExport,{at:this.state.startLoc}),this.next();let x;return a===83?(x=this.parseImport(c),x.type==="ImportDeclaration"&&(!x.importKind||x.importKind==="value")&&(this.sawUnambiguousESM=!0)):(x=this.parseExport(c,o),(x.type==="ExportNamedDeclaration"&&(!x.exportKind||x.exportKind==="value")||x.type==="ExportAllDeclaration"&&(!x.exportKind||x.exportKind==="value")||x.type==="ExportDefaultDeclaration")&&(this.sawUnambiguousESM=!0)),this.assertModuleNodeAllowed(x),x}default:if(this.isAsyncFunction())return h||this.raise(Qe.AsyncFunctionInSingleStatementContext,{at:this.state.startLoc}),this.next(),this.parseFunctionStatement(c,!0,!h&&d)}let y=this.state.value,D=this.parseExpression();return ot(a)&&D.type==="Identifier"&&this.eat(14)?this.parseLabeledStatement(c,y,D,l):this.parseExpressionStatement(c,D,o)}assertModuleNodeAllowed(l){!this.options.allowImportExportEverywhere&&!this.inModule&&this.raise(Qe.ImportOutsideModule,{at:l})}decoratorsEnabledBeforeExport(){return this.hasPlugin("decorators-legacy")?!0:this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")!==!1}maybeTakeDecorators(l,o,a){return l&&(o.decorators&&o.decorators.length>0?(typeof this.getPluginOption("decorators","decoratorsBeforeExport")!="boolean"&&this.raise(Qe.DecoratorsBeforeAfterExport,{at:o.decorators[0]}),o.decorators.unshift(...l)):o.decorators=l,this.resetStartLocationFromNode(o,l[0]),a&&this.resetStartLocationFromNode(a,o)),o}canHaveLeadingDecorator(){return this.match(80)}parseDecorators(l){let o=[];do o.push(this.parseDecorator());while(this.match(26));if(this.match(82))l||this.unexpected(),this.decoratorsEnabledBeforeExport()||this.raise(Qe.DecoratorExportClass,{at:this.state.startLoc});else if(!this.canHaveLeadingDecorator())throw this.raise(Qe.UnexpectedLeadingDecorator,{at:this.state.startLoc});return o}parseDecorator(){this.expectOnePlugin(["decorators","decorators-legacy"]);let l=this.startNode();if(this.next(),this.hasPlugin("decorators")){let o=this.state.startLoc,a;if(this.match(10)){let c=this.state.startLoc;this.next(),a=this.parseExpression(),this.expect(11),a=this.wrapParenthesis(c,a);let h=this.state.startLoc;l.expression=this.parseMaybeDecoratorArguments(a),this.getPluginOption("decorators","allowCallParenthesized")===!1&&l.expression!==a&&this.raise(Qe.DecoratorArgumentsOutsideParentheses,{at:h})}else{for(a=this.parseIdentifier(!1);this.eat(16);){let c=this.startNodeAt(o);c.object=a,this.match(136)?(this.classScope.usePrivateName(this.state.value,this.state.startLoc),c.property=this.parsePrivateName()):c.property=this.parseIdentifier(!0),c.computed=!1,a=this.finishNode(c,"MemberExpression")}l.expression=this.parseMaybeDecoratorArguments(a)}}else l.expression=this.parseExprSubscripts();return this.finishNode(l,"Decorator")}parseMaybeDecoratorArguments(l){if(this.eat(10)){let o=this.startNodeAtNode(l);return o.callee=l,o.arguments=this.parseCallExpressionArguments(11,!1),this.toReferencedList(o.arguments),this.finishNode(o,"CallExpression")}return l}parseBreakContinueStatement(l,o){return this.next(),this.isLineTerminator()?l.label=null:(l.label=this.parseIdentifier(),this.semicolon()),this.verifyBreakContinue(l,o),this.finishNode(l,o?"BreakStatement":"ContinueStatement")}verifyBreakContinue(l,o){let a;for(a=0;a<this.state.labels.length;++a){let c=this.state.labels[a];if((l.label==null||c.name===l.label.name)&&(c.kind!=null&&(o||c.kind==="loop")||l.label&&o))break}if(a===this.state.labels.length){let c=o?"BreakStatement":"ContinueStatement";this.raise(Qe.IllegalBreakContinue,{at:l,type:c})}}parseDebuggerStatement(l){return this.next(),this.semicolon(),this.finishNode(l,"DebuggerStatement")}parseHeaderExpression(){this.expect(10);let l=this.parseExpression();return this.expect(11),l}parseDoWhileStatement(l){return this.next(),this.state.labels.push(mc),l.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.expect(92),l.test=this.parseHeaderExpression(),this.eat(13),this.finishNode(l,"DoWhileStatement")}parseForStatement(l){this.next(),this.state.labels.push(mc);let o=null;if(this.isAwaitAllowed()&&this.eatContextual(96)&&(o=this.state.lastTokStartLoc),this.scope.enter(ju),this.expect(10),this.match(13))return o!==null&&this.unexpected(o),this.parseFor(l,null);let a=this.isContextual(99),c=this.isContextual(105)&&!this.hasFollowingLineBreak(),h=a&&this.hasFollowingBindingAtom()||c&&this.hasFollowingBindingIdentifier()&&this.startsUsingForOf();if(this.match(74)||this.match(75)||h){let x=this.startNode(),v=this.state.value;this.next(),this.parseVar(x,!0,v);let S=this.finishNode(x,"VariableDeclaration"),k=this.match(58);return k&&c&&this.raise(Qe.ForInUsing,{at:S}),(k||this.isContextual(101))&&S.declarations.length===1?this.parseForIn(l,S,o):(o!==null&&this.unexpected(o),this.parseFor(l,S))}let d=this.isContextual(95),g=new fe,y=this.parseExpression(!0,g),D=this.isContextual(101);if(D&&(a&&this.raise(Qe.ForOfLet,{at:y}),o===null&&d&&y.type==="Identifier"&&this.raise(Qe.ForOfAsync,{at:y})),D||this.match(58)){this.checkDestructuringPrivate(g),this.toAssignable(y,!0);let x=D?"ForOfStatement":"ForInStatement";return this.checkLVal(y,{in:{type:x}}),this.parseForIn(l,y,o)}else this.checkExpressionErrors(g,!0);return o!==null&&this.unexpected(o),this.parseFor(l,y)}parseFunctionStatement(l,o,a){return this.next(),this.parseFunction(l,1|(a?2:0)|(o?8:0))}parseIfStatement(l){return this.next(),l.test=this.parseHeaderExpression(),l.consequent=this.parseStatementOrSloppyAnnexBFunctionDeclaration(),l.alternate=this.eat(66)?this.parseStatementOrSloppyAnnexBFunctionDeclaration():null,this.finishNode(l,"IfStatement")}parseReturnStatement(l){return!this.prodParam.hasReturn&&!this.options.allowReturnOutsideFunction&&this.raise(Qe.IllegalReturn,{at:this.state.startLoc}),this.next(),this.isLineTerminator()?l.argument=null:(l.argument=this.parseExpression(),this.semicolon()),this.finishNode(l,"ReturnStatement")}parseSwitchStatement(l){this.next(),l.discriminant=this.parseHeaderExpression();let o=l.cases=[];this.expect(5),this.state.labels.push(Jp),this.scope.enter(ju);let a;for(let c;!this.match(8);)if(this.match(61)||this.match(65)){let h=this.match(61);a&&this.finishNode(a,"SwitchCase"),o.push(a=this.startNode()),a.consequent=[],this.next(),h?a.test=this.parseExpression():(c&&this.raise(Qe.MultipleDefaultsInSwitch,{at:this.state.lastTokStartLoc}),c=!0,a.test=null),this.expect(14)}else a?a.consequent.push(this.parseStatementListItem()):this.unexpected();return this.scope.exit(),a&&this.finishNode(a,"SwitchCase"),this.next(),this.state.labels.pop(),this.finishNode(l,"SwitchStatement")}parseThrowStatement(l){return this.next(),this.hasPrecedingLineBreak()&&this.raise(Qe.NewlineAfterThrow,{at:this.state.lastTokEndLoc}),l.argument=this.parseExpression(),this.semicolon(),this.finishNode(l,"ThrowStatement")}parseCatchClauseParam(){let l=this.parseBindingAtom();return this.scope.enter(this.options.annexB&&l.type==="Identifier"?Lu:0),this.checkLVal(l,{in:{type:"CatchClause"},binding:ac}),l}parseTryStatement(l){if(this.next(),l.block=this.parseBlock(),l.handler=null,this.match(62)){let o=this.startNode();this.next(),this.match(10)?(this.expect(10),o.param=this.parseCatchClauseParam(),this.expect(11)):(o.param=null,this.scope.enter(ju)),o.body=this.withSmartMixTopicForbiddingContext(()=>this.parseBlock(!1,!1)),this.scope.exit(),l.handler=this.finishNode(o,"CatchClause")}return l.finalizer=this.eat(67)?this.parseBlock():null,!l.handler&&!l.finalizer&&this.raise(Qe.NoCatchOrFinally,{at:l}),this.finishNode(l,"TryStatement")}parseVarStatement(l,o){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.next(),this.parseVar(l,!1,o,a),this.semicolon(),this.finishNode(l,"VariableDeclaration")}parseWhileStatement(l){return this.next(),l.test=this.parseHeaderExpression(),this.state.labels.push(mc),l.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.finishNode(l,"WhileStatement")}parseWithStatement(l){return this.state.strict&&this.raise(Qe.StrictWith,{at:this.state.startLoc}),this.next(),l.object=this.parseHeaderExpression(),l.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.finishNode(l,"WithStatement")}parseEmptyStatement(l){return this.next(),this.finishNode(l,"EmptyStatement")}parseLabeledStatement(l,o,a,c){for(let d of this.state.labels)d.name===o&&this.raise(Qe.LabelRedeclaration,{at:a,labelName:o});let h=Ct(this.state.type)?"loop":this.match(71)?"switch":null;for(let d=this.state.labels.length-1;d>=0;d--){let g=this.state.labels[d];if(g.statementStart===l.start)g.statementStart=this.state.start,g.kind=h;else break}return this.state.labels.push({name:o,kind:h,statementStart:this.state.start}),l.body=c&8?this.parseStatementOrSloppyAnnexBFunctionDeclaration(!0):this.parseStatement(),this.state.labels.pop(),l.label=a,this.finishNode(l,"LabeledStatement")}parseExpressionStatement(l,o,a){return l.expression=o,this.semicolon(),this.finishNode(l,"ExpressionStatement")}parseBlock(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,a=arguments.length>2?arguments[2]:void 0,c=this.startNode();return l&&this.state.strictErrors.clear(),this.expect(5),o&&this.scope.enter(ju),this.parseBlockBody(c,l,!1,8,a),o&&this.scope.exit(),this.finishNode(c,"BlockStatement")}isValidDirective(l){return l.type==="ExpressionStatement"&&l.expression.type==="StringLiteral"&&!l.expression.extra.parenthesized}parseBlockBody(l,o,a,c,h){let d=l.body=[],g=l.directives=[];this.parseBlockOrModuleBlockBody(d,o?g:void 0,a,c,h)}parseBlockOrModuleBlockBody(l,o,a,c,h){let d=this.state.strict,g=!1,y=!1;for(;!this.match(c);){let D=a?this.parseModuleItem():this.parseStatementListItem();if(o&&!y){if(this.isValidDirective(D)){let x=this.stmtToDirective(D);o.push(x),!g&&x.value.value==="use strict"&&(g=!0,this.setStrict(!0));continue}y=!0,this.state.strictErrors.clear()}l.push(D)}h&&h.call(this,g),d||this.setStrict(!1),this.next()}parseFor(l,o){return l.init=o,this.semicolon(!1),l.test=this.match(13)?null:this.parseExpression(),this.semicolon(!1),l.update=this.match(11)?null:this.parseExpression(),this.expect(11),l.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(l,"ForStatement")}parseForIn(l,o,a){let c=this.match(58);return this.next(),c?a!==null&&this.unexpected(a):l.await=a!==null,o.type==="VariableDeclaration"&&o.declarations[0].init!=null&&(!c||!this.options.annexB||this.state.strict||o.kind!=="var"||o.declarations[0].id.type!=="Identifier")&&this.raise(Qe.ForInOfLoopInitializer,{at:o,type:c?"ForInStatement":"ForOfStatement"}),o.type==="AssignmentPattern"&&this.raise(Qe.InvalidLhs,{at:o,ancestor:{type:"ForStatement"}}),l.left=o,l.right=c?this.parseExpression():this.parseMaybeAssignAllowIn(),this.expect(11),l.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(l,c?"ForInStatement":"ForOfStatement")}parseVar(l,o,a){let c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,h=l.declarations=[];for(l.kind=a;;){let d=this.startNode();if(this.parseVarId(d,a),d.init=this.eat(29)?o?this.parseMaybeAssignDisallowIn():this.parseMaybeAssignAllowIn():null,d.init===null&&!c&&(d.id.type!=="Identifier"&&!(o&&(this.match(58)||this.isContextual(101)))?this.raise(Qe.DeclarationMissingInitializer,{at:this.state.lastTokEndLoc,kind:"destructuring"}):a==="const"&&!(this.match(58)||this.isContextual(101))&&this.raise(Qe.DeclarationMissingInitializer,{at:this.state.lastTokEndLoc,kind:"const"})),h.push(this.finishNode(d,"VariableDeclarator")),!this.eat(12))break}return l}parseVarId(l,o){o==="using"&&!this.inModule&&this.match(96)&&this.raise(Qe.AwaitInUsingBinding,{at:this.state.startLoc});let a=this.parseBindingAtom();this.checkLVal(a,{in:{type:"VariableDeclarator"},binding:o==="var"?Uu:Ba}),l.id=a}parseAsyncFunctionExpression(l){return this.parseFunction(l,8)}parseFunction(l){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=o&2,c=!!(o&1),h=c&&!(o&4),d=!!(o&8);this.initFunction(l,d),this.match(55)&&(a&&this.raise(Qe.GeneratorInSingleStatementContext,{at:this.state.startLoc}),this.next(),l.generator=!0),c&&(l.id=this.parseFunctionId(h));let g=this.state.maybeInArrowParameters;return this.state.maybeInArrowParameters=!1,this.scope.enter(Oa),this.prodParam.enter(de(d,l.generator)),c||(l.id=this.parseFunctionId()),this.parseFunctionParams(l,!1),this.withSmartMixTopicForbiddingContext(()=>{this.parseFunctionBodyAndFinish(l,c?"FunctionDeclaration":"FunctionExpression")}),this.prodParam.exit(),this.scope.exit(),c&&!a&&this.registerFunctionStatementId(l),this.state.maybeInArrowParameters=g,l}parseFunctionId(l){return l||ot(this.state.type)?this.parseIdentifier():null}parseFunctionParams(l,o){this.expect(10),this.expressionScope.enter(ip()),l.params=this.parseBindingList(11,41,2|(o?4:0)),this.expressionScope.exit()}registerFunctionStatementId(l){l.id&&this.scope.declareName(l.id.name,!this.options.annexB||this.state.strict||l.generator||l.async?this.scope.treatFunctionsAsVar?Uu:Ba:uc,l.id.loc.start)}parseClass(l,o,a){this.next();let c=this.state.strict;return this.state.strict=!0,this.parseClassId(l,o,a),this.parseClassSuper(l),l.body=this.parseClassBody(!!l.superClass,c),this.finishNode(l,o?"ClassDeclaration":"ClassExpression")}isClassProperty(){return this.match(29)||this.match(13)||this.match(8)}isClassMethod(){return this.match(10)}isNonstaticConstructor(l){return!l.computed&&!l.static&&(l.key.name==="constructor"||l.key.value==="constructor")}parseClassBody(l,o){this.classScope.enter();let a={hadConstructor:!1,hadSuperClass:l},c=[],h=this.startNode();if(h.body=[],this.expect(5),this.withSmartMixTopicForbiddingContext(()=>{for(;!this.match(8);){if(this.eat(13)){if(c.length>0)throw this.raise(Qe.DecoratorSemicolon,{at:this.state.lastTokEndLoc});continue}if(this.match(26)){c.push(this.parseDecorator());continue}let d=this.startNode();c.length&&(d.decorators=c,this.resetStartLocationFromNode(d,c[0]),c=[]),this.parseClassMember(h,d,a),d.kind==="constructor"&&d.decorators&&d.decorators.length>0&&this.raise(Qe.DecoratorConstructor,{at:d})}}),this.state.strict=o,this.next(),c.length)throw this.raise(Qe.TrailingDecorator,{at:this.state.startLoc});return this.classScope.exit(),this.finishNode(h,"ClassBody")}parseClassMemberFromModifier(l,o){let a=this.parseIdentifier(!0);if(this.isClassMethod()){let c=o;return c.kind="method",c.computed=!1,c.key=a,c.static=!1,this.pushClassMethod(l,c,!1,!1,!1,!1),!0}else if(this.isClassProperty()){let c=o;return c.computed=!1,c.key=a,c.static=!1,l.body.push(this.parseClassProperty(c)),!0}return this.resetPreviousNodeTrailingComments(a),!1}parseClassMember(l,o,a){let c=this.isContextual(104);if(c){if(this.parseClassMemberFromModifier(l,o))return;if(this.eat(5)){this.parseClassStaticBlock(l,o);return}}this.parseClassMemberWithIsStatic(l,o,a,c)}parseClassMemberWithIsStatic(l,o,a,c){let h=o,d=o,g=o,y=o,D=o,x=h,v=h;if(o.static=c,this.parsePropertyNamePrefixOperator(o),this.eat(55)){x.kind="method";let w=this.match(136);if(this.parseClassElementName(x),w){this.pushClassPrivateMethod(l,d,!0,!1);return}this.isNonstaticConstructor(h)&&this.raise(Qe.ConstructorIsGenerator,{at:h.key}),this.pushClassMethod(l,h,!0,!1,!1,!1);return}let S=ot(this.state.type)&&!this.state.containsEsc,k=this.match(136),T=this.parseClassElementName(o),$=this.state.startLoc;if(this.parsePostMemberNameModifiers(v),this.isClassMethod()){if(x.kind="method",k){this.pushClassPrivateMethod(l,d,!1,!1);return}let w=this.isNonstaticConstructor(h),F=!1;w&&(h.kind="constructor",a.hadConstructor&&!this.hasPlugin("typescript")&&this.raise(Qe.DuplicateConstructor,{at:T}),w&&this.hasPlugin("typescript")&&o.override&&this.raise(Qe.OverrideOnConstructor,{at:T}),a.hadConstructor=!0,F=a.hadSuperClass),this.pushClassMethod(l,h,!1,!1,w,F)}else if(this.isClassProperty())k?this.pushClassPrivateProperty(l,y):this.pushClassProperty(l,g);else if(S&&T.name==="async"&&!this.isLineTerminator()){this.resetPreviousNodeTrailingComments(T);let w=this.eat(55);v.optional&&this.unexpected($),x.kind="method";let F=this.match(136);this.parseClassElementName(x),this.parsePostMemberNameModifiers(v),F?this.pushClassPrivateMethod(l,d,w,!0):(this.isNonstaticConstructor(h)&&this.raise(Qe.ConstructorIsAsync,{at:h.key}),this.pushClassMethod(l,h,w,!0,!1,!1))}else if(S&&(T.name==="get"||T.name==="set")&&!(this.match(55)&&this.isLineTerminator())){this.resetPreviousNodeTrailingComments(T),x.kind=T.name;let w=this.match(136);this.parseClassElementName(h),w?this.pushClassPrivateMethod(l,d,!1,!1):(this.isNonstaticConstructor(h)&&this.raise(Qe.ConstructorIsAccessor,{at:h.key}),this.pushClassMethod(l,h,!1,!1,!1,!1)),this.checkGetterSetterParams(h)}else if(S&&T.name==="accessor"&&!this.isLineTerminator()){this.expectPlugin("decoratorAutoAccessors"),this.resetPreviousNodeTrailingComments(T);let w=this.match(136);this.parseClassElementName(g),this.pushClassAccessorProperty(l,D,w)}else this.isLineTerminator()?k?this.pushClassPrivateProperty(l,y):this.pushClassProperty(l,g):this.unexpected()}parseClassElementName(l){let{type:o,value:a}=this.state;if((o===130||o===131)&&l.static&&a==="prototype"&&this.raise(Qe.StaticPrototype,{at:this.state.startLoc}),o===136){a==="constructor"&&this.raise(Qe.ConstructorClassPrivateField,{at:this.state.startLoc});let c=this.parsePrivateName();return l.key=c,c}return this.parsePropertyName(l)}parseClassStaticBlock(l,o){var a;this.scope.enter(Fa|Ru|ou);let c=this.state.labels;this.state.labels=[],this.prodParam.enter(K);let h=o.body=[];this.parseBlockOrModuleBlockBody(h,void 0,!1,8),this.prodParam.exit(),this.scope.exit(),this.state.labels=c,l.body.push(this.finishNode(o,"StaticBlock")),(a=o.decorators)!=null&&a.length&&this.raise(Qe.DecoratorStaticBlock,{at:o})}pushClassProperty(l,o){!o.computed&&(o.key.name==="constructor"||o.key.value==="constructor")&&this.raise(Qe.ConstructorClassField,{at:o.key}),l.body.push(this.parseClassProperty(o))}pushClassPrivateProperty(l,o){let a=this.parseClassPrivateProperty(o);l.body.push(a),this.classScope.declarePrivateName(this.getPrivateNameSV(a.key),Zu,a.key.loc.start)}pushClassAccessorProperty(l,o,a){if(!a&&!o.computed){let h=o.key;(h.name==="constructor"||h.value==="constructor")&&this.raise(Qe.ConstructorClassField,{at:h})}let c=this.parseClassAccessorProperty(o);l.body.push(c),a&&this.classScope.declarePrivateName(this.getPrivateNameSV(c.key),Zu,c.key.loc.start)}pushClassMethod(l,o,a,c,h,d){l.body.push(this.parseMethod(o,a,c,h,d,"ClassMethod",!0))}pushClassPrivateMethod(l,o,a,c){let h=this.parseMethod(o,a,c,!1,!1,"ClassPrivateMethod",!0);l.body.push(h);let d=h.kind==="get"?h.static?cc:pc:h.kind==="set"?h.static?qu:_l:Zu;this.declareClassPrivateMethodInScope(h,d)}declareClassPrivateMethodInScope(l,o){this.classScope.declarePrivateName(this.getPrivateNameSV(l.key),o,l.key.loc.start)}parsePostMemberNameModifiers(l){}parseClassPrivateProperty(l){return this.parseInitializer(l),this.semicolon(),this.finishNode(l,"ClassPrivateProperty")}parseClassProperty(l){return this.parseInitializer(l),this.semicolon(),this.finishNode(l,"ClassProperty")}parseClassAccessorProperty(l){return this.parseInitializer(l),this.semicolon(),this.finishNode(l,"ClassAccessorProperty")}parseInitializer(l){this.scope.enter(Fa|ou),this.expressionScope.enter(E()),this.prodParam.enter(K),l.value=this.eat(29)?this.parseMaybeAssignAllowIn():null,this.expressionScope.exit(),this.prodParam.exit(),this.scope.exit()}parseClassId(l,o,a){let c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Ip;if(ot(this.state.type))l.id=this.parseIdentifier(),o&&this.declareNameFromIdentifier(l.id,c);else if(a||!o)l.id=null;else throw this.raise(Qe.MissingClassName,{at:this.state.startLoc})}parseClassSuper(l){l.superClass=this.eat(81)?this.parseExprSubscripts():null}parseExport(l,o){let a=this.maybeParseExportDefaultSpecifier(l),c=!a||this.eat(12),h=c&&this.eatExportStar(l),d=h&&this.maybeParseExportNamespaceSpecifier(l),g=c&&(!d||this.eat(12)),y=a||h;if(h&&!d){if(a&&this.unexpected(),o)throw this.raise(Qe.UnsupportedDecoratorExport,{at:l});return this.parseExportFrom(l,!0),this.finishNode(l,"ExportAllDeclaration")}let D=this.maybeParseExportNamedSpecifiers(l);a&&c&&!h&&!D&&this.unexpected(null,5),d&&g&&this.unexpected(null,97);let x;if(y||D){if(x=!1,o)throw this.raise(Qe.UnsupportedDecoratorExport,{at:l});this.parseExportFrom(l,y)}else x=this.maybeParseExportDeclaration(l);if(y||D||x){var v;let S=l;if(this.checkExport(S,!0,!1,!!S.source),((v=S.declaration)==null?void 0:v.type)==="ClassDeclaration")this.maybeTakeDecorators(o,S.declaration,S);else if(o)throw this.raise(Qe.UnsupportedDecoratorExport,{at:l});return this.finishNode(S,"ExportNamedDeclaration")}if(this.eat(65)){let S=l,k=this.parseExportDefaultExpression();if(S.declaration=k,k.type==="ClassDeclaration")this.maybeTakeDecorators(o,k,S);else if(o)throw this.raise(Qe.UnsupportedDecoratorExport,{at:l});return this.checkExport(S,!0,!0),this.finishNode(S,"ExportDefaultDeclaration")}this.unexpected(null,5)}eatExportStar(l){return this.eat(55)}maybeParseExportDefaultSpecifier(l){if(this.isExportDefaultSpecifier()){this.expectPlugin("exportDefaultFrom");let o=this.startNode();return o.exported=this.parseIdentifier(!0),l.specifiers=[this.finishNode(o,"ExportDefaultSpecifier")],!0}return!1}maybeParseExportNamespaceSpecifier(l){if(this.isContextual(93)){l.specifiers||(l.specifiers=[]);let o=this.startNodeAt(this.state.lastTokStartLoc);return this.next(),o.exported=this.parseModuleExportName(),l.specifiers.push(this.finishNode(o,"ExportNamespaceSpecifier")),!0}return!1}maybeParseExportNamedSpecifiers(l){if(this.match(5)){l.specifiers||(l.specifiers=[]);let o=l.exportKind==="type";return l.specifiers.push(...this.parseExportSpecifiers(o)),l.source=null,l.declaration=null,this.hasPlugin("importAssertions")&&(l.assertions=[]),!0}return!1}maybeParseExportDeclaration(l){return this.shouldParseExportDeclaration()?(l.specifiers=[],l.source=null,this.hasPlugin("importAssertions")&&(l.assertions=[]),l.declaration=this.parseExportDeclaration(l),!0):!1}isAsyncFunction(){if(!this.isContextual(95))return!1;let l=this.nextTokenStart();return!Gc.test(this.input.slice(this.state.pos,l))&&this.isUnparsedContextual(l,"function")}parseExportDefaultExpression(){let l=this.startNode();if(this.match(68))return this.next(),this.parseFunction(l,5);if(this.isAsyncFunction())return this.next(),this.next(),this.parseFunction(l,13);if(this.match(80))return this.parseClass(l,!0,!0);if(this.match(26))return this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")===!0&&this.raise(Qe.DecoratorBeforeExport,{at:this.state.startLoc}),this.parseClass(this.maybeTakeDecorators(this.parseDecorators(!1),this.startNode()),!0,!0);if(this.match(75)||this.match(74)||this.isLet())throw this.raise(Qe.UnsupportedDefaultExport,{at:this.state.startLoc});let o=this.parseMaybeAssignAllowIn();return this.semicolon(),o}parseExportDeclaration(l){return this.match(80)?this.parseClass(this.startNode(),!0,!1):this.parseStatementListItem()}isExportDefaultSpecifier(){let{type:l}=this.state;if(ot(l)){if(l===95&&!this.state.containsEsc||l===99)return!1;if((l===128||l===127)&&!this.state.containsEsc){let{type:c}=this.lookahead();if(ot(c)&&c!==97||c===5)return this.expectOnePlugin(["flow","typescript"]),!1}}else if(!this.match(65))return!1;let o=this.nextTokenStart(),a=this.isUnparsedContextual(o,"from");if(this.input.charCodeAt(o)===44||ot(this.state.type)&&a)return!0;if(this.match(65)&&a){let c=this.input.charCodeAt(this.nextTokenStartSince(o+4));return c===34||c===39}return!1}parseExportFrom(l,o){if(this.eatContextual(97)){l.source=this.parseImportSource(),this.checkExport(l);let a=this.maybeParseImportAssertions();a&&(l.assertions=a,this.checkJSONModuleImport(l))}else o&&this.unexpected();this.semicolon()}shouldParseExportDeclaration(){let{type:l}=this.state;return l===26&&(this.expectOnePlugin(["decorators","decorators-legacy"]),this.hasPlugin("decorators"))?(this.getPluginOption("decorators","decoratorsBeforeExport")===!0&&this.raise(Qe.DecoratorBeforeExport,{at:this.state.startLoc}),!0):l===74||l===75||l===68||l===80||this.isLet()||this.isAsyncFunction()}checkExport(l,o,a,c){if(o){if(a){if(this.checkDuplicateExports(l,"default"),this.hasPlugin("exportDefaultFrom")){var h;let d=l.declaration;d.type==="Identifier"&&d.name==="from"&&d.end-d.start===4&&!((h=d.extra)!=null&&h.parenthesized)&&this.raise(Qe.ExportDefaultFromAsIdentifier,{at:d})}}else if(l.specifiers&&l.specifiers.length)for(let d of l.specifiers){let{exported:g}=d,y=g.type==="Identifier"?g.name:g.value;if(this.checkDuplicateExports(d,y),!c&&d.local){let{local:D}=d;D.type!=="Identifier"?this.raise(Qe.ExportBindingIsString,{at:d,localName:D.value,exportName:y}):(this.checkReservedWord(D.name,D.loc.start,!0,!1),this.scope.checkLocalExport(D))}}else if(l.declaration){if(l.declaration.type==="FunctionDeclaration"||l.declaration.type==="ClassDeclaration"){let d=l.declaration.id;if(!d)throw new Error("Assertion failure");this.checkDuplicateExports(l,d.name)}else if(l.declaration.type==="VariableDeclaration")for(let d of l.declaration.declarations)this.checkDeclaration(d.id)}}}checkDeclaration(l){if(l.type==="Identifier")this.checkDuplicateExports(l,l.name);else if(l.type==="ObjectPattern")for(let o of l.properties)this.checkDeclaration(o);else if(l.type==="ArrayPattern")for(let o of l.elements)o&&this.checkDeclaration(o);else l.type==="ObjectProperty"?this.checkDeclaration(l.value):l.type==="RestElement"?this.checkDeclaration(l.argument):l.type==="AssignmentPattern"&&this.checkDeclaration(l.left)}checkDuplicateExports(l,o){this.exportedIdentifiers.has(o)&&(o==="default"?this.raise(Qe.DuplicateDefaultExport,{at:l}):this.raise(Qe.DuplicateExport,{at:l,exportName:o})),this.exportedIdentifiers.add(o)}parseExportSpecifiers(l){let o=[],a=!0;for(this.expect(5);!this.eat(8);){if(a)a=!1;else if(this.expect(12),this.eat(8))break;let c=this.isContextual(128),h=this.match(131),d=this.startNode();d.local=this.parseModuleExportName(),o.push(this.parseExportSpecifier(d,h,l,c))}return o}parseExportSpecifier(l,o,a,c){return this.eatContextual(93)?l.exported=this.parseModuleExportName():o?l.exported=Se(l.local):l.exported||(l.exported=V(l.local)),this.finishNode(l,"ExportSpecifier")}parseModuleExportName(){if(this.match(131)){let l=this.parseStringLiteral(this.state.value),o=l.value.match(xg);return o&&this.raise(Qe.ModuleExportNameHasLoneSurrogate,{at:l,surrogateCharCode:o[0].charCodeAt(0)}),l}return this.parseIdentifier(!0)}isJSONModuleImport(l){return l.assertions!=null?l.assertions.some(o=>{let{key:a,value:c}=o;return c.value==="json"&&(a.type==="Identifier"?a.name==="type":a.value==="type")}):!1}checkImportReflection(l){if(l.module){var o;(l.specifiers.length!==1||l.specifiers[0].type!=="ImportDefaultSpecifier")&&this.raise(Qe.ImportReflectionNotBinding,{at:l.specifiers[0].loc.start}),((o=l.assertions)==null?void 0:o.length)>0&&this.raise(Qe.ImportReflectionHasAssertion,{at:l.specifiers[0].loc.start})}}checkJSONModuleImport(l){if(this.isJSONModuleImport(l)&&l.type!=="ExportAllDeclaration"){let{specifiers:o}=l;if(o!=null){let a=o.find(c=>{let h;if(c.type==="ExportSpecifier"?h=c.local:c.type==="ImportSpecifier"&&(h=c.imported),h!==void 0)return h.type==="Identifier"?h.name!=="default":h.value!=="default"});a!==void 0&&this.raise(Qe.ImportJSONBindingNotDefault,{at:a.loc.start})}}}parseMaybeImportReflection(l){let o=!1;if(this.isContextual(125)){let a=this.lookahead(),c=a.type;ot(c)?(c!==97||this.input.charCodeAt(this.nextTokenStartSince(a.end))===102)&&(o=!0):c!==12&&(o=!0)}o?(this.expectPlugin("importReflection"),this.next(),l.module=!0):this.hasPlugin("importReflection")&&(l.module=!1)}parseImport(l){if(l.specifiers=[],!this.match(131)){this.parseMaybeImportReflection(l);let a=!this.maybeParseDefaultImportSpecifier(l)||this.eat(12),c=a&&this.maybeParseStarImportSpecifier(l);a&&!c&&this.parseNamedImportSpecifiers(l),this.expectContextual(97)}l.source=this.parseImportSource();let o=this.maybeParseImportAssertions();if(o)l.assertions=o;else{let a=this.maybeParseModuleAttributes();a&&(l.attributes=a)}return this.checkImportReflection(l),this.checkJSONModuleImport(l),this.semicolon(),this.finishNode(l,"ImportDeclaration")}parseImportSource(){return this.match(131)||this.unexpected(),this.parseExprAtom()}shouldParseDefaultImport(l){return ot(this.state.type)}parseImportSpecifierLocal(l,o,a){o.local=this.parseIdentifier(),l.specifiers.push(this.finishImportSpecifier(o,a))}finishImportSpecifier(l,o){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ba;return this.checkLVal(l.local,{in:{type:o},binding:a}),this.finishNode(l,o)}parseAssertEntries(){let l=[],o=new Set;do{if(this.match(8))break;let a=this.startNode(),c=this.state.value;if(o.has(c)&&this.raise(Qe.ModuleAttributesWithDuplicateKeys,{at:this.state.startLoc,key:c}),o.add(c),this.match(131)?a.key=this.parseStringLiteral(c):a.key=this.parseIdentifier(!0),this.expect(14),!this.match(131))throw this.raise(Qe.ModuleAttributeInvalidValue,{at:this.state.startLoc});a.value=this.parseStringLiteral(this.state.value),l.push(this.finishNode(a,"ImportAttribute"))}while(this.eat(12));return l}maybeParseModuleAttributes(){if(this.match(76)&&!this.hasPrecedingLineBreak())this.expectPlugin("moduleAttributes"),this.next();else return this.hasPlugin("moduleAttributes")?[]:null;let l=[],o=new Set;do{let a=this.startNode();if(a.key=this.parseIdentifier(!0),a.key.name!=="type"&&this.raise(Qe.ModuleAttributeDifferentFromType,{at:a.key}),o.has(a.key.name)&&this.raise(Qe.ModuleAttributesWithDuplicateKeys,{at:a.key,key:a.key.name}),o.add(a.key.name),this.expect(14),!this.match(131))throw this.raise(Qe.ModuleAttributeInvalidValue,{at:this.state.startLoc});a.value=this.parseStringLiteral(this.state.value),this.finishNode(a,"ImportAttribute"),l.push(a)}while(this.eat(12));return l}maybeParseImportAssertions(){if(this.isContextual(94)&&!this.hasPrecedingLineBreak())this.expectPlugin("importAssertions"),this.next();else return this.hasPlugin("importAssertions")?[]:null;this.eat(5);let l=this.parseAssertEntries();return this.eat(8),l}maybeParseDefaultImportSpecifier(l){return this.shouldParseDefaultImport(l)?(this.parseImportSpecifierLocal(l,this.startNode(),"ImportDefaultSpecifier"),!0):!1}maybeParseStarImportSpecifier(l){if(this.match(55)){let o=this.startNode();return this.next(),this.expectContextual(93),this.parseImportSpecifierLocal(l,o,"ImportNamespaceSpecifier"),!0}return!1}parseNamedImportSpecifiers(l){let o=!0;for(this.expect(5);!this.eat(8);){if(o)o=!1;else{if(this.eat(14))throw this.raise(Qe.DestructureNamedImport,{at:this.state.startLoc});if(this.expect(12),this.eat(8))break}let a=this.startNode(),c=this.match(131),h=this.isContextual(128);a.imported=this.parseModuleExportName();let d=this.parseImportSpecifier(a,c,l.importKind==="type"||l.importKind==="typeof",h,void 0);l.specifiers.push(d)}}parseImportSpecifier(l,o,a,c,h){if(this.eatContextual(93))l.local=this.parseIdentifier();else{let{imported:d}=l;if(o)throw this.raise(Qe.ImportBindingIsString,{at:l,importName:d.value});this.checkReservedWord(d.name,l.loc.start,!0,!0),l.local||(l.local=V(d))}return this.finishImportSpecifier(l,"ImportSpecifier",h)}isThisParam(l){return l.type==="Identifier"&&l.name==="this"}},rd=class extends vg{constructor(l,o){l=Ur(l),super(l,o),this.options=l,this.initializeScopes(),this.plugins=Cg(this.options.plugins),this.filename=l.sourceFilename}getScopeHandler(){return pu}parse(){this.enterInitialScopes();let l=this.startNode(),o=this.startNode();return this.nextToken(),l.errors=null,this.parseTopLevel(l,o),l.errors=this.state.errors,l}};function Cg(l){let o=new Map;for(let a of l){let[c,h]=Array.isArray(a)?a:[a,{}];o.has(c)||o.set(c,h||{})}return o}function Sg(l,o){var a;if(((a=o)==null?void 0:a.sourceType)==="unambiguous"){o=Object.assign({},o);try{o.sourceType="module";let c=ap(o,l),h=c.parse();if(c.sawUnambiguousESM)return h;if(c.ambiguousScriptDifferentAst)try{return o.sourceType="script",ap(o,l).parse()}catch{}else h.program.sourceType="script";return h}catch(c){try{return o.sourceType="script",ap(o,l).parse()}catch{}throw c}}else return ap(o,l).parse()}function Eg(l,o){let a=ap(o,l);return a.options.strictMode&&(a.state.strict=!0),a.getExpression()}function gc(l){let o={};for(let a of Object.keys(l))o[a]=Sr(l[a]);return o}var Ag=gc(st);function ap(l,o){let a=rd;return l!=null&&l.plugins&&(Fo(l.plugins),a=wg(l.plugins)),new a(l,o)}var nd={};function wg(l){let o=Ms.filter(h=>Li(l,h)),a=o.join("/"),c=nd[a];if(!c){c=rd;for(let h of o)c=As[h](c);nd[a]=c}return c}xn.parse=Sg,xn.parseExpression=Eg,xn.tokTypes=Ag}}),xl=_e({"src/language-js/parse/json.js"(xn,Wr){oe();var Ur=gl(),Ar=tu(),fr=yl(),Nr=wa();function tr(){let Tn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{allowComments:wi=!0}=Tn;return function(Mr){let{parseExpression:Fi}=Tu(),Ps;try{Ps=Fi(Mr,{tokens:!0,ranges:!0})}catch(Ln){throw Nr(Ln)}if(!wi&&Ur(Ps.comments))throw bn(Ps.comments[0],"Comment");return oi(Ps),Ps}}function bn(Tn,wi){let[Mr,Fi]=[Tn.loc.start,Tn.loc.end].map(Ps=>{let{line:Ln,column:Pi}=Ps;return{line:Ln,column:Pi+1}});return Ar(`${wi} is not allowed in JSON.`,{start:Mr,end:Fi})}function oi(Tn){switch(Tn.type){case"ArrayExpression":for(let wi of Tn.elements)wi!==null&&oi(wi);return;case"ObjectExpression":for(let wi of Tn.properties)oi(wi);return;case"ObjectProperty":if(Tn.computed)throw bn(Tn.key,"Computed key");if(Tn.shorthand)throw bn(Tn.key,"Shorthand property");Tn.key.type!=="Identifier"&&oi(Tn.key),oi(Tn.value);return;case"UnaryExpression":{let{operator:wi,argument:Mr}=Tn;if(wi!=="+"&&wi!=="-")throw bn(Tn,`Operator '${Tn.operator}'`);if(Mr.type==="NumericLiteral"||Mr.type==="Identifier"&&(Mr.name==="Infinity"||Mr.name==="NaN"))return;throw bn(Mr,`Operator '${wi}' before '${Mr.type}'`)}case"Identifier":if(Tn.name!=="Infinity"&&Tn.name!=="NaN"&&Tn.name!=="undefined")throw bn(Tn,`Identifier '${Tn.name}'`);return;case"TemplateLiteral":if(Ur(Tn.expressions))throw bn(Tn.expressions[0],"'TemplateLiteral' with expression");for(let wi of Tn.quasis)oi(wi);return;case"NullLiteral":case"BooleanLiteral":case"NumericLiteral":case"StringLiteral":case"TemplateElement":return;default:throw bn(Tn,`'${Tn.type}'`)}}var bi=tr(),di={json:fr({parse:bi,hasPragma(){return!0}}),json5:fr(bi),"json-stringify":fr({parse:tr({allowComments:!1}),astFormat:"estree-json"})};Wr.exports=di}});oe();var Uc=Ce(),ec=De(),tc=xt(),ma=yl(),ku=wa(),ga=Dl(),rc=xl(),nc={sourceType:"module",allowImportExportEverywhere:!0,allowReturnOutsideFunction:!0,allowSuperOutsideMethod:!0,allowUndeclaredExports:!0,errorRecovery:!0,createParenthesizedExpressions:!0,plugins:["doExpressions","exportDefaultFrom","functionBind","functionSent","throwExpressions","partialApplication",["decorators",{decoratorsBeforeExport:!1}],"importAssertions","decimal","moduleBlocks","asyncDoExpressions","regexpUnicodeSets","destructuringPrivate","decoratorAutoAccessors"],tokens:!0,ranges:!0},Wc=["recordAndTuple",{syntaxType:"hash"}],Fu="v8intrinsic",Bu=[["pipelineOperator",{proposal:"hack",topicToken:"%"}],["pipelineOperator",{proposal:"minimal"}],["pipelineOperator",{proposal:"fsharp"}]],po=function(xn){let Wr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:nc;return Object.assign(Object.assign({},Wr),{},{plugins:[...Wr.plugins,...xn]})},zo=/@(?:no)?flow\b/;function Yo(xn,Wr){if(Wr.filepath&&Wr.filepath.endsWith(".js.flow"))return!0;let Ur=ec(xn);Ur&&(xn=xn.slice(Ur.length));let Ar=tc(xn,0);return Ar!==!1&&(xn=xn.slice(0,Ar)),zo.test(xn)}function No(xn,Wr,Ur){let Ar=Tu()[xn],fr=Ar(Wr,Ur),Nr=fr.errors.find(tr=>!$u.has(tr.reasonCode));if(Nr)throw Nr;return fr}function wo(xn){for(var Wr=arguments.length,Ur=new Array(Wr>1?Wr-1:0),Ar=1;Ar<Wr;Ar++)Ur[Ar-1]=arguments[Ar];return function(fr,Nr){let tr=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if((tr.parser==="babel"||tr.parser==="__babel_estree")&&Yo(fr,tr))return tr.parser="babel-flow",Pa(fr,Nr,tr);let bn=Ur;tr.__babelSourceType==="script"&&(bn=bn.map(Tn=>Object.assign(Object.assign({},Tn),{},{sourceType:"script"}))),/#[[{]/.test(fr)&&(bn=bn.map(Tn=>po([Wc],Tn)));let oi=/%[A-Z]/.test(fr);fr.includes("|>")?bn=(oi?[...Bu,Fu]:Bu).flatMap(Tn=>bn.map(wi=>po([Tn],wi))):oi&&(bn=bn.map(Tn=>po([Fu],Tn)));let{result:bi,error:di}=Uc(...bn.map(Tn=>()=>No(xn,fr,Tn)));if(!bi)throw ku(di);return tr.originalText=fr,ga(bi,tr)}}var pi=wo("parse",po(["jsx","flow"])),Pa=wo("parse",po(["jsx",["flow",{all:!0,enums:!0}]])),bl=wo("parse",po(["jsx","typescript"]),po(["typescript"])),ru=wo("parse",po(["jsx","flow","estree"])),_u=wo("parseExpression",po(["jsx"])),Ta=wo("parseExpression",po(["typescript"])),$u=new Set(["StrictNumericEscape","StrictWith","StrictOctalLiteral","StrictDelete","StrictEvalArguments","StrictEvalArgumentsBinding","StrictFunction","EmptyTypeArguments","EmptyTypeParameters","ConstructorHasTypeParameters","UnsupportedParameterPropertyKind","UnexpectedParameterModifier","MixedLabeledAndUnlabeledElements","InvalidTupleMemberLabel","NonClassMethodPropertyHasAbstractModifer","ReadonlyForMethodSignature","ClassMethodHasDeclare","ClassMethodHasReadonly","InvalidModifierOnTypeMember","DuplicateAccessibilityModifier","IndexSignatureHasDeclare","DecoratorExportClass","ParamDupe","InvalidDecimal","RestTrailingComma","UnsupportedParameterDecorator","UnterminatedJsxContent","UnexpectedReservedWord","ModuleAttributesWithDuplicateKeys","LineTerminatorBeforeArrow","InvalidEscapeSequenceTemplate","NonAbstractClassHasAbstractMethod","UnsupportedPropertyDecorator","OptionalTypeBeforeRequired","PatternIsOptional","OptionalBindingPattern","DeclareClassFieldHasInitializer","TypeImportCannotSpecifyDefaultAndNamed","DeclareFunctionHasImplementation","ConstructorClassField","VarRedeclaration","InvalidPrivateFieldResolution","DuplicateExport"]),Nu=ma(pi),nu=ma(bl),Iu=ma(_u),vl=ma(Ta);Ot.exports={parsers:Object.assign(Object.assign({babel:Nu,"babel-flow":ma(Pa),"babel-ts":nu},rc),{},{__js_expression:Iu,__vue_expression:Iu,__vue_ts_expression:vl,__vue_event_binding:Nu,__vue_ts_event_binding:nu,__babel_estree:ma(ru)})}});return fi()})})(mE);var HI=mE.exports;const JI=rg(HI);function KI(r,e,t){const n={css:zI,html:GI,babel:JI};return bs(()=>{if(!Ed(e))return Ed(r)||"/* empty */";try{return qI.format(Ed(r)||"",{parser:t,plugins:[n[t]],singleQuote:!0,semi:!1})}catch(i){return console.error(i),`/* Error on prettifying: ${i.message} */
277
277
  ${Ed(r)||""}`}})}function e5(r,e=!0){return KI(r,e,"css")}const t5={"h-full":""},r5={p:"x4 y2",grid:"~ cols-4 gap-4"},n5=Di("div",{op80:""}," Presets ",-1),i5={op50:"","ws-pre":""},s5={overflow:"auto"},o5=Di("div",{op80:""}," Rules ",-1),a5=Di("span",{op50:""},"dynamic",-1),u5=Di("br",null,null,-1),l5=Di("span",{op50:""},"static",-1),c5=Di("div",{op80:""}," Variants ",-1),p5=Di("div",{op80:""}," Shortcuts ",-1),h5={key:0},f5=Di("div",{op80:""}," Config File ",-1),d5=Di("div",{op80:""}," Version ",-1),m5={op50:"","ws-pre":""},g5={b:"t main",p:"x4 y2",grid:"~ cols-4 gap-4"},y5=Di("div",{op80:""}," Included Files ",-1),O5=Di("div",{op80:""}," CSS Size ",-1),D5=Di("span",{op50:""},"gzipped",-1),x5=Di("div",{op80:""}," Matched Rules ",-1),b5=Di("div",{op80:""}," Layers ",-1),v5={op50:"","ws-pre":""},C5=Cu({__name:"Overview",setup(r){const e=mo(null),t=UI(e,"overview-scrolls");WO.execute();const n=mo(!1),i=e5(bs(()=>{var s;return(s=Id.value)==null?void 0:s.css}),n);return(s,u)=>{const p=XI,f=QI,m=_I,O=TI;return Ws(),Uo("div",t5,[ws(m,{ref_key:"status",ref:e,p0:""},{default:Vl(()=>{var b,N,U,he,Re,Ye,$e,yt,kt,Zt,Gt,Pr,vr,gr,Fr,Vr,mn,Mn;return[Di("div",r5,[Di("div",null,[n5,Di("div",i5,aa((U=(N=(b=Ri(Mo))==null?void 0:b.config)==null?void 0:N.presets)==null?void 0:U.map(Ai=>Ai.name).join(`
278
278
  `)),1)]),Di("div",s5,[o5,yu(" "+aa((Ye=(Re=(he=Ri(Mo))==null?void 0:he.config)==null?void 0:Re.rulesDynamic)==null?void 0:Ye.length)+" ",1),a5,u5,yu(" "+aa(Object.keys(((yt=($e=Ri(Mo))==null?void 0:$e.config)==null?void 0:yt.rulesStaticMap)||{}).length)+" ",1),l5]),Di("div",null,[c5,yu(" "+aa((Gt=(Zt=(kt=Ri(Mo))==null?void 0:kt.config)==null?void 0:Zt.variants)==null?void 0:Gt.length),1)]),Di("div",null,[p5,yu(" "+aa((Pr=Ri(Mo))==null?void 0:Pr.config.shortcuts.length),1)]),(vr=Ri(Mo))!=null&&vr.configPath?(Ws(),Uo("div",h5,[f5,ws(p,{id:Ri(Mo).configPath},null,8,["id"])])):uf("",!0),Di("div",null,[d5,Di("div",m5,aa((gr=Ri(Mo))==null?void 0:gr.version),1)])]),Di("div",g5,[Di("div",null,[y5,yu(" "+aa((Fr=Ri(Mo))==null?void 0:Fr.modules.length),1)]),Di("div",null,[O5,yu(" "+aa(((((Vr=Ri(Id))==null?void 0:Vr.gzipSize)||0)/1024).toFixed(2))+" KiB ",1),D5]),Di("div",null,[x5,yu(" "+aa((mn=Ri(Id))==null?void 0:mn.matched.length),1)]),Di("div",null,[b5,Di("div",v5,aa((Mn=Ri(Id))==null?void 0:Mn.layers.join(`
279
- `)),1)])]),ws(f,{border:"t gray-400/20",title:"Output CSS"},{default:Vl(()=>[Di("label",null,[rw(Di("input",{"onUpdate:modelValue":u[0]||(u[0]=Ai=>ro(n)?n.value=Ai:null),type:"checkbox"},null,512),[[tP,Ri(n)]]),yu(" Prettify ")])]),_:1})]}),_:1},512),ws(O,{"model-value":Ri(i),"read-only":!0,mode:"css",class:"overview-scrolls",style:Lf(Ri(t))},null,8,["model-value","style"])])}}}),S5={};function E5(r,e){const t=C5;return Ws(),bp(t)}const A5=aE(S5,[["render",E5]]),w5=()=>Iy(()=>import("./repl-476ed53a.js"),[]),P5=()=>Iy(()=>import("./_id_-7edafef9.js"),[]),T5=[{name:"repl",path:"/repl",component:w5,props:!0},{name:"index",path:"/",component:A5,props:!0},{name:"module-id",path:"/module/:id",component:P5,props:!0}];/*!
279
+ `)),1)])]),ws(f,{border:"t gray-400/20",title:"Output CSS"},{default:Vl(()=>[Di("label",null,[rw(Di("input",{"onUpdate:modelValue":u[0]||(u[0]=Ai=>ro(n)?n.value=Ai:null),type:"checkbox"},null,512),[[tP,Ri(n)]]),yu(" Prettify ")])]),_:1})]}),_:1},512),ws(O,{"model-value":Ri(i),"read-only":!0,mode:"css",class:"overview-scrolls",style:Lf(Ri(t))},null,8,["model-value","style"])])}}}),S5={};function E5(r,e){const t=C5;return Ws(),bp(t)}const A5=aE(S5,[["render",E5]]),w5=()=>Iy(()=>import("./repl-ea649f7e.js"),[]),P5=()=>Iy(()=>import("./_id_-379b5357.js"),[]),T5=[{name:"repl",path:"/repl",component:w5,props:!0},{name:"index",path:"/",component:A5,props:!0},{name:"module-id",path:"/module/:id",component:P5,props:!0}];/*!
280
280
  * vue-router v4.2.1
281
281
  * (c) 2023 Eduardo San Martin Morote
282
282
  * @license MIT
@@ -1,3 +1,3 @@
1
- import{d as x,r as b,u as S,a as k,b as V,f as B,o as h,c as w,e as s,g as a,w as m,h as C,i as p,v as R,j as e,k as P,n as f,_ as E,l as N,m as U,p as $,q as I}from"./index-1b92be1e.js";const L={"h-full":"",grid:"~ rows-[max-content_1fr]","of-hidden":""},M=s("div",null," REPL Playground ",-1),T=s("div",{op60:""}," Edit your code below to test and play UnoCSS's matching and generating. ",-1),j={"h-full":"","of-hidden":"",grid:"","grid-cols-2":""},q=x({__name:"ReplPlayground",setup(y){const r=b(null),l=S(r,"repl-scrolls"),t=k("unocss:inspector:repl",`<div class="text-sm hover:text-red">
1
+ import{d as x,r as b,u as S,a as k,b as V,f as B,o as h,c as w,e as s,g as a,w as m,h as C,i as p,v as R,j as e,k as P,n as f,_ as E,l as N,m as U,p as $,q as I}from"./index-c217f629.js";const L={"h-full":"",grid:"~ rows-[max-content_1fr]","of-hidden":""},M=s("div",null," REPL Playground ",-1),T=s("div",{op60:""}," Edit your code below to test and play UnoCSS's matching and generating. ",-1),j={"h-full":"","of-hidden":"",grid:"","grid-cols-2":""},q=x({__name:"ReplPlayground",setup(y){const r=b(null),l=S(r,"repl-scrolls"),t=k("unocss:inspector:repl",`<div class="text-sm hover:text-red">
2
2
  Hello World
3
3
  </div>`),o=V("unocss-inspector-safelist",!1),{data:d}=B(t,o);return(H,n)=>{var i,_;const v=E,g=N,u=U;return h(),w("div",L,[s("div",{ref_key:"status",ref:r},[a(v,null,{default:m(()=>[M,T]),_:1}),a(g,{border:"b gray-400/20",title:""},{default:m(()=>[s("label",null,[C(s("input",{"onUpdate:modelValue":n[0]||(n[0]=c=>p(o)?o.value=c:null),type:"checkbox"},null,512),[[R,e(o)]]),P(" Include safelist ")])]),_:1})],512),s("div",j,[a(u,{modelValue:e(t),"onUpdate:modelValue":n[1]||(n[1]=c=>p(t)?t.value=c:null),mode:"html",matched:((i=e(d))==null?void 0:i.matched)||[],class:"scrolls repl-scrolls",style:f(e(l))},null,8,["modelValue","matched","style"]),a(u,{"b-l":"","b-main":"","model-value":((_=e(d))==null?void 0:_.css)||"/* empty */","read-only":!0,mode:"css",class:"scrolls repl-scrolls",style:f(e(l))},null,8,["model-value","style"])])])}}}),z={};function D(y,r){const l=q;return h(),I(l)}const A=$(z,[["render",D]]);export{A as default};
@@ -8,7 +8,7 @@
8
8
  <link rel="preconnect" href="https://fonts.googleapis.com" />
9
9
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
10
10
  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@100;200;400&family=Fira+Code&display=swap" rel="stylesheet" />
11
- <script type="module" crossorigin src="/__unocss/assets/index-1b92be1e.js"></script>
11
+ <script type="module" crossorigin src="/__unocss/assets/index-c217f629.js"></script>
12
12
  <link rel="stylesheet" href="/__unocss/assets/index-f6a4fc7d.css">
13
13
  </head>
14
14
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/inspector",
3
- "version": "0.52.3",
3
+ "version": "0.52.4",
4
4
  "description": "The inspector UI for UnoCSS",
5
5
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -1 +0,0 @@
1
- import{s as j,t as C,d as W,x as D,y as U,r as N,u as Z,z as q,A as G,B as K,j as i,c as M,g,w as S,e as f,C as w,_ as H,o as P,k as R,D as k,E as z,n as B,h as J,v as L,i as Q,M as X,F as Y,m as ee,l as te,q as re,G as le}from"./index-1b92be1e.js";const T=/^(?!.*\[(?:[^:]+):(?:.+)\]$)((?:.+:)?!?)?(.*)$/;function se(e={}){const m=e.prefix??"un-",l=e.prefixedOnly??!1,x=e.trueToNonValued??!1;let u;return{name:"attributify",match(y,{generator:a}){var _,c;const h=j(y);if(!h)return;let r=h[1];if(r.startsWith(m))r=r.slice(m.length);else if(l)return;const t=h[2],[,v="",n=t]=t.match(T)||[];if(n==="~"||x&&n==="true"||!n)return`${v}${r}`;if(u==null){const s=(c=(_=a==null?void 0:a.config)==null?void 0:_.separators)==null?void 0:c.join("|");s?u=new RegExp(`^(.*\\](?:${s}))(\\[[^\\]]+?\\])$`):u=!1}if(u){const[,s,d]=t.match(u)||[];if(d)return`${s}${v}${r}-${d}`}return`${v}${r}-${n}`}}}const ae=/(<\w[\w:\.$-]*\s)((?:'[^>]*?'|"[^>]*?"|`[^>]*?`|\{[^>]*?\}|[^>]*?)*)/g,ne=/([?]|(?!\d|-{2}|-\d)[a-zA-Z0-9\u00A0-\uFFFF-_:%-]+)(?:=("[^"]*|'[^']*))?/g,F=/[\s'"`;>]+/;function ce(e){return{name:"attributify",extract:({content:m,cursor:l})=>{const x=m.matchAll(ae);let u,y=0;for(const o of x){const[,b,V]=o,$=o.index+b.length;if(l>$&&l<=$+V.length){y=$,u=V;break}}if(!u)return null;const a=u.matchAll(ne);let h=0,r,t;for(const o of a){const[b,V,$]=o,E=y+o.index;if(l>E&&l<=E+b.length){h=E,r=V,t=$==null?void 0:$.slice(1);break}}if(!r||r==="class"||r==="className"||r===":class")return null;const v=!!(e!=null&&e.prefix)&&r.startsWith(e.prefix);if(e!=null&&e.prefixedOnly&&!v)return null;const n=v?r.slice(e.prefix.length):r;if(t===void 0)return{extracted:n,transformSuggestions(o){return v?o.map(b=>e.prefix+b):o},resolveReplacement(o){return{start:h,end:h+r.length,replacement:o}}};const _=h+r.length+2;let c=F.exec(t),s=0,d;for(;c;){const[o]=c;if(l>_+s&&l<=_+s+c.index){d=t.slice(s,s+c.index);break}s+=c.index+o.length,c=F.exec(t.slice(s))}d===void 0&&(d=t.slice(s));const[,p="",A]=d.match(T)||[];return{extracted:`${p}${n}-${A}`,transformSuggestions(o){return o.filter(b=>b.startsWith(`${p}${n}-`)).map(b=>p+b.slice(p.length+n.length+1))},resolveReplacement(o){return{start:s+_,end:s+_+d.length,replacement:p+o.slice(p.length+n.length+1)}}}}}}const ie=["v-bind:",":"],O=/[\s'"`;]+/g,ue=/<[^>\s]*\s((?:'.*?'|".*?"|`.*?`|\{.*?\}|[^>]*?)*)/g,oe=/([?]|(?!\d|-{2}|-\d)[a-zA-Z0-9\u00A0-\uFFFF-_:!%-.~<]+)=?(?:["]([^"]*)["]|[']([^']*)[']|[{]([^}]*)[}])?/gms,I=["placeholder","fill","opacity"];function de(e){const m=(e==null?void 0:e.ignoreAttributes)??I,l=(e==null?void 0:e.nonValuedAttribute)??!0,x=(e==null?void 0:e.trueToNonValued)??!1;return{name:"@unocss/preset-attributify/extractor",extract({code:u}){const y=Array.from(u.matchAll(ue)).flatMap(a=>Array.from((a[1]||"").matchAll(oe))).flatMap(([,a,...h])=>{const r=h.filter(Boolean).join("");if(m.includes(a))return[];for(const t of ie)if(a.startsWith(t)){a=a.slice(t.length);break}if(!r){if(C(a)&&l!==!1){const t=[`[${a}=""]`];return x&&t.push(`[${a}="true"]`),t}return[]}return["class","className"].includes(a)?r.split(O).filter(C):e!=null&&e.prefixedOnly&&e.prefix&&!a.startsWith(e.prefix)?[]:r.split(O).filter(t=>!!t&&t!==":").map(t=>`[${a}~="${t}"]`)});return new Set(y)}}}function fe(e={}){e.strict=e.strict??!1,e.prefix=e.prefix??"un-",e.prefixedOnly=e.prefixedOnly??!1,e.nonValuedAttribute=e.nonValuedAttribute??!0,e.ignoreAttributes=e.ignoreAttributes??I;const m=[se(e)],l=[de(e)],x=[ce(e)];return{name:"@unocss/preset-attributify",enforce:"post",variants:m,extractors:l,options:e,autocomplete:{extractors:x},extractorDefault:e.strict?!1:void 0}}const me={key:0,"h-full":"","of-hidden":""},he=f("div",{op50:""}," Module ",-1),_e=f("div",{"i-carbon-launch":""},null,-1),xe=f("div",{op50:""}," Matched Rules ",-1),pe=f("div",{op50:""}," CSS Size ",-1),ye=f("span",{op50:""},"gzipped",-1),ve={key:0,"row-span-3":""},be=f("div",{op50:""}," Potentially Unmatched ",-1),ge={"h-full":"","of-hidden":""},$e=W({__name:"ModuleInfo",props:{id:null},setup(e){const m=e,{data:l}=D(U(m,"id")),x=m.id.split(/\./g).pop(),u=N(null),y=Z(u,"module-scrolls");function a(){fetch(`/__open-in-editor?file=${encodeURIComponent(m.id)}`)}const{extractors:h}=fe({strict:!0}),r=q(async()=>{var _;const n=new Set;if(h){const c={code:((_=l.value)==null?void 0:_.code)||""};for(const s of h){const d=await s.extract(c);d==null||d.forEach(p=>n.add(p))}}return Array.from(n).filter(c=>!c.startsWith("[")).filter(c=>{var s;return!((s=l.value)!=null&&s.matched.includes(c))})}),t=N(!1),v=G(K(()=>{var n;return(n=l.value)==null?void 0:n.css}),t);return(n,_)=>{const c=Y,s=H,d=ee,p=te;return i(l)?(P(),M("div",me,[g(s,{ref_key:"status",ref:u,grid:"~ cols-3 gap-4"},{default:S(()=>{var A;return[f("div",null,[he,f("a",{"cursor-pointer":"",op80:"","hover:op100":"",onClick:a},[g(c,{id:i(l).id,"mr-1":""},null,8,["id"]),_e])]),f("div",null,[xe,R(" "+k(i(l).matched.length),1)]),f("div",null,[pe,R(" "+k(((((A=i(l))==null?void 0:A.gzipSize)||0)/1024).toFixed(2))+" KiB ",1),ye]),i(r).length?(P(),M("div",ve,[be,f("code",null,k(i(r).join(", ")),1)])):w("",!0)]}),_:1},512),f("div",ge,[g(i(X),null,{default:S(()=>[g(i(z),{size:"50"},{default:S(()=>[g(d,{"h-full":"","model-value":i(l).code,"read-only":!0,mode:i(x),matched:i(l).matched,class:"scrolls module-scrolls",style:B(i(y))},null,8,["model-value","mode","matched","style"])]),_:1}),g(i(z),{size:"50"},{default:S(()=>[f("div",null,[g(p,{border:"l b gray-400/20",title:"Output CSS"},{default:S(()=>[f("label",null,[J(f("input",{"onUpdate:modelValue":_[0]||(_[0]=A=>Q(t)?t.value=A:null),type:"checkbox"},null,512),[[L,i(t)]]),R(" Prettify ")])]),_:1}),g(d,{"h-full":"",b:"l main","model-value":i(v),"read-only":!0,mode:"css",class:"scrolls module-scrolls",style:B(i(y))},null,8,["model-value","style"])])]),_:1})]),_:1})])])):w("",!0)}}}),Se=W({__name:"[id]",setup(e){const m=le();return(l,x)=>{const u=$e;return P(),re(u,{id:i(m).params.id},null,8,["id"])}}});export{Se as default};