sveld 0.37.3 → 0.37.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.
- package/README.md +14 -2
- package/lib/browser.d.ts +32 -4
- package/lib/browser.js +150 -136
- package/lib/chunk-49hdrj4n.js +6 -0
- package/lib/chunk-7e36grhy.js +1 -0
- package/lib/{chunk-m2bfvdte.js → chunk-nxa0q3f3.js} +5 -5
- package/lib/chunk-rftengvg.js +331 -0
- package/lib/chunk-w37f2cq2.js +1 -0
- package/lib/{chunk-s4f6b34h.js → chunk-yzb9k33r.js} +1 -1
- package/lib/cli-entry.js +1 -1
- package/lib/index.js +1 -1
- package/package.json +1 -1
- package/schema/component-api.schema.json +20 -1
- package/lib/chunk-ag202nwj.js +0 -317
- package/lib/chunk-n14td14g.js +0 -1
- package/lib/chunk-te52wx32.js +0 -1
- package/lib/chunk-v4be4g6y.js +0 -6
package/lib/chunk-ag202nwj.js
DELETED
|
@@ -1,317 +0,0 @@
|
|
|
1
|
-
import{createRequire as Wu}from"node:module";var Ru=Object.create;var{getPrototypeOf:Lu,defineProperty:oi,getOwnPropertyNames:Ou}=Object;var oa=Object.prototype.hasOwnProperty;function Mu(i){return this[i]}var $u,Bu,Ce=(i,Ae,Ne)=>{var _e=i!=null&&typeof i==="object";if(_e){var De=Ae?$u??=new WeakMap:Bu??=new WeakMap,Re=De.get(i);if(Re)return Re}Ne=i!=null?Ru(Lu(i)):{};let Ie=Ae||!i||!i.__esModule||!oa.call(i,"default")?oi(Ne,"default",{value:i,enumerable:!0}):Ne;if(i&&typeof i==="object"||typeof i==="function"){for(let Oe of Ou(i))if(!oa.call(Ie,Oe))oi(Ie,Oe,{get:Mu.bind(i,Oe),enumerable:!0})}if(_e)De.set(i,Ie);return Ie};var a=(i,Ae)=>()=>(Ae||i((Ae={exports:{}}).exports,Ae),Ae.exports);var Fu=(i)=>i;function ju(i,Ae){this[i]=Fu.bind(null,Ae)}var Vu=(i,Ae)=>{for(var Ne in Ae)oi(i,Ne,{get:Ae[Ne],enumerable:!0,configurable:!0,set:ju.bind(Ae,Ne)})};var C=Wu(import.meta.url);var qu={li:{direct:["li"]},dt:{descendant:["dt","dd"]},dd:{descendant:["dt","dd"]},p:{descendant:["address","article","aside","blockquote","div","dl","fieldset","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","main","menu","nav","ol","p","pre","section","table","ul"]},rt:{descendant:["rt","rp"]},rp:{descendant:["rt","rp"]},optgroup:{descendant:["optgroup"]},option:{descendant:["option","optgroup"]},thead:{direct:["tbody","tfoot"]},tbody:{direct:["tbody","tfoot"]},tfoot:{direct:["tbody"]},tr:{direct:["tr","tbody"]},td:{direct:["td","th","tr"]},th:{direct:["td","th","tr"]}};function aa(i,Ae){let Ne=qu[i];if(!Ne)return!1;if(!Ae)return!0;return(Ne.direct??Ne.descendant??[]).includes(Ae)}var Ci={};Vu(Ci,{Node:()=>Cr,Parser:()=>Pt,Position:()=>Zn,SourceLocation:()=>br,TokContext:()=>an,Token:()=>rs,TokenType:()=>Ct,defaultOptions:()=>Kr,getLineInfo:()=>hi,isIdentifierChar:()=>Qt,isIdentifierStart:()=>Ut,isNewLine:()=>qn,keywordTypes:()=>Qr,lineBreak:()=>Ht,lineBreakG:()=>ma,nonASCIIwhitespace:()=>fi,parse:()=>Ei,parseExpressionAt:()=>kd,tokContexts:()=>wt,tokTypes:()=>We,tokenizer:()=>Ad,version:()=>za});var Gu=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],da=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],Uu="·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ--ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",fa="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ--ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",ai={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},ci="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",Hu={5:ci,"5module":ci+" export import",6:ci+" const class extends export import super"},ha=/^in(stanceof)?$/,Ku=new RegExp("["+fa+"]"),zu=new RegExp("["+fa+Uu+"]");function li(i,Ae){var Ne=65536;for(var _e=0;_e<Ae.length;_e+=2){if(Ne+=Ae[_e],Ne>i)return!1;if(Ne+=Ae[_e+1],Ne>=i)return!0}return!1}function Ut(i,Ae){if(i<65)return i===36;if(i<91)return!0;if(i<97)return i===95;if(i<123)return!0;if(i<=65535)return i>=170&&Ku.test(String.fromCharCode(i));if(Ae===!1)return!1;return li(i,da)}function Qt(i,Ae){if(i<48)return i===36;if(i<58)return!0;if(i<65)return!1;if(i<91)return!0;if(i<97)return i===95;if(i<123)return!0;if(i<=65535)return i>=170&&zu.test(String.fromCharCode(i));if(Ae===!1)return!1;return li(i,da)||li(i,Gu)}var Ct=function(Ae,Ne){if(Ne===void 0)Ne={};this.label=Ae,this.keyword=Ne.keyword,this.beforeExpr=!!Ne.beforeExpr,this.startsExpr=!!Ne.startsExpr,this.isLoop=!!Ne.isLoop,this.isAssign=!!Ne.isAssign,this.prefix=!!Ne.prefix,this.postfix=!!Ne.postfix,this.binop=Ne.binop||null,this.updateContext=null};function sn(i,Ae){return new Ct(i,{beforeExpr:!0,binop:Ae})}var on={beforeExpr:!0},Yt={startsExpr:!0},Qr={};function Et(i,Ae){if(Ae===void 0)Ae={};return Ae.keyword=i,Qr[i]=new Ct(i,Ae)}var We={num:new Ct("num",Yt),regexp:new Ct("regexp",Yt),string:new Ct("string",Yt),name:new Ct("name",Yt),privateId:new Ct("privateId",Yt),eof:new Ct("eof"),bracketL:new Ct("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new Ct("]"),braceL:new Ct("{",{beforeExpr:!0,startsExpr:!0}),braceR:new Ct("}"),parenL:new Ct("(",{beforeExpr:!0,startsExpr:!0}),parenR:new Ct(")"),comma:new Ct(",",on),semi:new Ct(";",on),colon:new Ct(":",on),dot:new Ct("."),question:new Ct("?",on),questionDot:new Ct("?."),arrow:new Ct("=>",on),template:new Ct("template"),invalidTemplate:new Ct("invalidTemplate"),ellipsis:new Ct("...",on),backQuote:new Ct("`",Yt),dollarBraceL:new Ct("${",{beforeExpr:!0,startsExpr:!0}),eq:new Ct("=",{beforeExpr:!0,isAssign:!0}),assign:new Ct("_=",{beforeExpr:!0,isAssign:!0}),incDec:new Ct("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new Ct("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:sn("||",1),logicalAND:sn("&&",2),bitwiseOR:sn("|",3),bitwiseXOR:sn("^",4),bitwiseAND:sn("&",5),equality:sn("==/!=/===/!==",6),relational:sn("</>/<=/>=",7),bitShift:sn("<</>>/>>>",8),plusMin:new Ct("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:sn("%",10),star:sn("*",10),slash:sn("/",10),starstar:new Ct("**",{beforeExpr:!0}),coalesce:sn("??",1),_break:Et("break"),_case:Et("case",on),_catch:Et("catch"),_continue:Et("continue"),_debugger:Et("debugger"),_default:Et("default",on),_do:Et("do",{isLoop:!0,beforeExpr:!0}),_else:Et("else",on),_finally:Et("finally"),_for:Et("for",{isLoop:!0}),_function:Et("function",Yt),_if:Et("if"),_return:Et("return",on),_switch:Et("switch"),_throw:Et("throw",on),_try:Et("try"),_var:Et("var"),_const:Et("const"),_while:Et("while",{isLoop:!0}),_with:Et("with"),_new:Et("new",{beforeExpr:!0,startsExpr:!0}),_this:Et("this",Yt),_super:Et("super",Yt),_class:Et("class",Yt),_extends:Et("extends",on),_export:Et("export"),_import:Et("import",Yt),_null:Et("null",Yt),_true:Et("true",Yt),_false:Et("false",Yt),_in:Et("in",{beforeExpr:!0,binop:7}),_instanceof:Et("instanceof",{beforeExpr:!0,binop:7}),_typeof:Et("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:Et("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:Et("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},Ht=/\r\n?|\n|\u2028|\u2029/,ma=new RegExp(Ht.source,"g");function qn(i){return i===10||i===13||i===8232||i===8233}function ya(i,Ae,Ne){if(Ne===void 0)Ne=i.length;for(var _e=Ae;_e<Ne;_e++){var De=i.charCodeAt(_e);if(qn(De))return _e<Ne-1&&De===13&&i.charCodeAt(_e+1)===10?_e+2:_e+1}return-1}var fi=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,Bt=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,ga=Object.prototype,{hasOwnProperty:Xu,toString:Ju}=ga,er=Object.hasOwn||function(i,Ae){return Xu.call(i,Ae)},ca=Array.isArray||function(i){return Ju.call(i)==="[object Array]"},la=Object.create(null);function Ln(i){return la[i]||(la[i]=new RegExp("^(?:"+i.replace(/ /g,"|")+")$"))}function Tn(i){if(i<=65535)return String.fromCharCode(i);return i-=65536,String.fromCharCode((i>>10)+55296,(i&1023)+56320)}var Yu=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Zn=function(Ae,Ne){this.line=Ae,this.column=Ne};Zn.prototype.offset=function(Ae){return new Zn(this.line,this.column+Ae)};var br=function(Ae,Ne,_e){if(this.start=Ne,this.end=_e,Ae.sourceFile!==null)this.source=Ae.sourceFile};function hi(i,Ae){for(var Ne=1,_e=0;;){var De=ya(i,_e,Ae);if(De<0)return new Zn(Ne,Ae-_e);++Ne,_e=De}}var Kr={ecmaVersion:null,sourceType:"script",strict:!1,onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,startLocation:null,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},pa=!1;function Qu(i){var Ae={};for(var Ne in Kr)Ae[Ne]=i&&er(i,Ne)?i[Ne]:Kr[Ne];if(Ae.ecmaVersion==="latest")Ae.ecmaVersion=1e8;else if(Ae.ecmaVersion==null){if(!pa&&typeof console==="object"&&console.warn)pa=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
|
2
|
-
Defaulting to 2020, but this will stop working in the future.`);Ae.ecmaVersion=11}else if(Ae.ecmaVersion>=2015)Ae.ecmaVersion-=2009;if(Ae.allowReserved==null)Ae.allowReserved=Ae.ecmaVersion<5;if(!i||i.allowHashBang==null)Ae.allowHashBang=Ae.ecmaVersion>=14;if(ca(Ae.onToken)){var _e=Ae.onToken;Ae.onToken=function(De){return _e.push(De)}}if(ca(Ae.onComment))Ae.onComment=Zu(Ae,Ae.onComment);if(Ae.sourceType==="commonjs"&&Ae.allowAwaitOutsideFunction)throw Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");return Ae}function Zu(i,Ae){return function(Ne,_e,De,Re,Ie,Oe){var Me={type:Ne?"Block":"Line",value:_e,start:De,end:Re};if(i.locations)Me.loc=new br(this,Ie,Oe);if(i.ranges)Me.range=[De,Re];Ae.push(Me)}}var Wn=1,Gn=2,mi=4,xa=8,yi=16,ba=32,Zr=64,Ea=128,Un=256,Er=512,Ca=1024,es=Wn|Gn|Un;function gi(i,Ae){return Gn|(i?mi:0)|(Ae?xa:0)}var zr=0,xi=1,An=2,Sa=3,va=4,Ta=5,Pt=function(Ae,Ne,_e){this.options=Ae=Qu(Ae),this.sourceFile=Ae.sourceFile,this.keywords=Ln(Hu[Ae.ecmaVersion>=6?6:Ae.sourceType==="module"?"5module":5]);var De="";if(Ae.allowReserved!==!0){if(De=ai[Ae.ecmaVersion>=6?6:Ae.ecmaVersion===5?5:3],Ae.sourceType==="module")De+=" await"}this.reservedWords=Ln(De);var Re=(De?De+" ":"")+ai.strict;if(this.reservedWordsStrict=Ln(Re),this.reservedWordsStrictBind=Ln(Re+" "+ai.strictBind),this.input=String(Ne),this.containsEsc=!1,this.pos=_e||0,this.curLine=1,Ae.startLocation)this.lineStart=this.pos-Ae.startLocation.column,this.curLine=Ae.startLocation.line;else if(_e){if(this.lineStart=this.input.lastIndexOf(`
|
|
3
|
-
`,_e-1)+1,this.options.locations)this.curLine=this.input.slice(0,this.lineStart).split(Ht).length}else this.lineStart=0;if(this.type=We.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=Ae.sourceType==="module",this.strict=this.inModule||Ae.strict===!0||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&Ae.allowHashBang&&this.input.slice(0,2)==="#!")this.skipLineComment(2);this.scopeStack=[],this.enterScope(this.options.sourceType==="commonjs"?Gn:Wn),this.regexpState=null,this.privateNameStack=[]},ln={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowReturn:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},allowUsing:{configurable:!0},inClassStaticBlock:{configurable:!0}};Pt.prototype.parse=function(){var Ae=this,Ne=this.options.program||this.startNode();return this.nextToken(),this.catchStackOverflow(function(){return Ae.parseTopLevel(Ne)})};ln.inFunction.get=function(){return(this.currentVarScope().flags&Gn)>0};ln.inGenerator.get=function(){return(this.currentVarScope().flags&xa)>0};ln.inAsync.get=function(){return(this.currentVarScope().flags&mi)>0};ln.canAwait.get=function(){for(var i=this.scopeStack.length-1;i>=0;i--){var Ae=this.scopeStack[i],Ne=Ae.flags;if(Ne&(Un|Er))return!1;if(Ne&Gn)return(Ne&mi)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};ln.allowReturn.get=function(){if(this.inFunction)return!0;if(this.options.allowReturnOutsideFunction&&this.currentVarScope().flags&Wn)return!0;return!1};ln.allowSuper.get=function(){var i=this.currentThisScope(),Ae=i.flags;return(Ae&Zr)>0||this.options.allowSuperOutsideMethod};ln.allowDirectSuper.get=function(){return(this.currentThisScope().flags&Ea)>0};ln.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};ln.allowNewDotTarget.get=function(){for(var i=this.scopeStack.length-1;i>=0;i--){var Ae=this.scopeStack[i],Ne=Ae.flags;if(Ne&(Un|Er)||Ne&Gn&&!(Ne&yi))return!0}return!1};ln.allowUsing.get=function(){var i=this.currentScope(),Ae=i.flags;if(Ae&Ca)return!1;if(!this.inModule&&Ae&Wn)return!1;return!0};ln.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&Un)>0};Pt.extend=function(){var Ae=[],Ne=arguments.length;while(Ne--)Ae[Ne]=arguments[Ne];var _e=this;for(var De=0;De<Ae.length;De++)_e=Ae[De](_e);return _e};Pt.parse=function(Ae,Ne){return new this(Ne,Ae).parse()};Pt.parseExpressionAt=function(Ae,Ne,_e){var De=new this(_e,Ae,Ne);return De.nextToken(),De.parseExpression()};Pt.tokenizer=function(Ae,Ne){return new this(Ne,Ae)};Object.defineProperties(Pt.prototype,ln);var Wt=Pt.prototype,ed=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;Wt.strictDirective=function(i){if(this.options.ecmaVersion<5)return!1;for(;;){Bt.lastIndex=i,i+=Bt.exec(this.input)[0].length;var Ae=ed.exec(this.input.slice(i));if(!Ae)return!1;if((Ae[1]||Ae[2])==="use strict"){Bt.lastIndex=i+Ae[0].length;var Ne=Bt.exec(this.input),_e=Ne.index+Ne[0].length,De=this.input.charAt(_e);return De===";"||De==="}"||Ht.test(Ne[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(De)||De==="!"&&this.input.charAt(_e+1)==="=")}if(i+=Ae[0].length,Bt.lastIndex=i,i+=Bt.exec(this.input)[0].length,this.input[i]===";")i++}};Wt.eat=function(i){if(this.type===i)return this.next(),!0;else return!1};Wt.isContextual=function(i){return this.type===We.name&&this.value===i&&!this.containsEsc};Wt.eatContextual=function(i){if(!this.isContextual(i))return!1;return this.next(),!0};Wt.catchStackOverflow=function(i){try{return i()}catch(Ae){if(Ae instanceof Error&&(/\bstack\b.*\b(exceeded|overflow)\b/i.test(Ae.message)||/\btoo much recursion\b/i.test(Ae.message)))this.raise(this.start,"Not enough stack space to parse input");else throw Ae}};Wt.expectContextual=function(i){if(!this.eatContextual(i))this.unexpected()};Wt.canInsertSemicolon=function(){return this.type===We.eof||this.type===We.braceR||Ht.test(this.input.slice(this.lastTokEnd,this.start))};Wt.insertSemicolon=function(){if(this.canInsertSemicolon()){if(this.options.onInsertedSemicolon)this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc);return!0}};Wt.semicolon=function(){if(!this.eat(We.semi)&&!this.insertSemicolon())this.unexpected()};Wt.afterTrailingComma=function(i,Ae){if(this.type===i){if(this.options.onTrailingComma)this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc);if(!Ae)this.next();return!0}};Wt.expect=function(i){this.eat(i)||this.unexpected()};Wt.unexpected=function(i){this.raise(i!=null?i:this.start,"Unexpected token")};var ts=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};Wt.checkPatternErrors=function(i,Ae){if(!i)return;if(i.trailingComma>-1)this.raiseRecoverable(i.trailingComma,"Comma is not permitted after the rest element");var Ne=Ae?i.parenthesizedAssign:i.parenthesizedBind;if(Ne>-1)this.raiseRecoverable(Ne,Ae?"Assigning to rvalue":"Parenthesized pattern")};Wt.checkExpressionErrors=function(i,Ae){if(!i)return!1;var{shorthandAssign:Ne,doubleProto:_e}=i;if(!Ae)return Ne>=0||_e>=0;if(Ne>=0)this.raise(Ne,"Shorthand property assignments are valid only in destructuring patterns");if(_e>=0)this.raiseRecoverable(_e,"Redefinition of __proto__ property")};Wt.checkYieldAwaitInDefaultParams=function(){if(this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos))this.raise(this.yieldPos,"Yield expression cannot be a default value");if(this.awaitPos)this.raise(this.awaitPos,"Await expression cannot be a default value")};Wt.isSimpleAssignTarget=function(i){if(i.type==="ParenthesizedExpression")return this.isSimpleAssignTarget(i.expression);return i.type==="Identifier"||i.type==="MemberExpression"};var lt=Pt.prototype;lt.parseTopLevel=function(i){var Ae=Object.create(null);if(!i.body)i.body=[];while(this.type!==We.eof){var Ne=this.parseStatement(null,!0,Ae);i.body.push(Ne)}if(this.inModule)for(var _e=0,De=Object.keys(this.undefinedExports);_e<De.length;_e+=1){var Re=De[_e];this.raiseRecoverable(this.undefinedExports[Re].start,"Export '"+Re+"' is not defined")}return this.adaptDirectivePrologue(i.body),this.next(),i.sourceType=this.options.sourceType==="commonjs"?"script":this.options.sourceType,this.finishNode(i,"Program")};var bi={kind:"loop"},td={kind:"switch"};lt.isLet=function(i){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;Bt.lastIndex=this.pos;var Ae=Bt.exec(this.input),Ne=this.pos+Ae[0].length,_e=this.fullCharCodeAt(Ne);if(_e===91||_e===92)return!0;if(i)return!1;if(_e===123)return!0;if(Ut(_e)){var De=Ne;do Ne+=_e<=65535?1:2;while(Qt(_e=this.fullCharCodeAt(Ne)));if(_e===92)return!0;var Re=this.input.slice(De,Ne);if(!ha.test(Re))return!0}return!1};lt.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;Bt.lastIndex=this.pos;var i=Bt.exec(this.input),Ae=this.pos+i[0].length,Ne;return!Ht.test(this.input.slice(this.pos,Ae))&&this.input.slice(Ae,Ae+8)==="function"&&(Ae+8===this.input.length||!(Qt(Ne=this.fullCharCodeAt(Ae+8))||Ne===92))};lt.isUsingKeyword=function(i,Ae){if(this.options.ecmaVersion<17||!this.isContextual(i?"await":"using"))return!1;Bt.lastIndex=this.pos;var Ne=Bt.exec(this.input),_e=this.pos+Ne[0].length;if(Ht.test(this.input.slice(this.pos,_e)))return!1;if(i){var De=_e+5,Re;if(this.input.slice(_e,De)!=="using"||De===this.input.length||Qt(Re=this.fullCharCodeAt(De))||Re===92)return!1;Bt.lastIndex=De;var Ie=Bt.exec(this.input);if(_e=De+Ie[0].length,Ie&&Ht.test(this.input.slice(De,_e)))return!1}var Oe=this.fullCharCodeAt(_e);if(!Ut(Oe)&&Oe!==92)return!1;var Me=_e;do _e+=Oe<=65535?1:2;while(Qt(Oe=this.fullCharCodeAt(_e)));if(Oe===92)return!0;var Fe=this.input.slice(Me,_e);if(ha.test(Fe))return!1;if(Ae&&!i&&Fe==="of"){Bt.lastIndex=_e;var Be=Bt.exec(this.input);if(_e=_e+Be[0].length,this.input.charCodeAt(_e)!==61||(Oe=this.input.charCodeAt(_e+1))===61||Oe===62)return!1}return!0};lt.isAwaitUsing=function(i){return this.isUsingKeyword(!0,i)};lt.isUsing=function(i){return this.isUsingKeyword(!1,i)};lt.parseStatement=function(i,Ae,Ne){var _e=this.type,De=this.startNode(),Re;if(this.isLet(i))_e=We._var,Re="let";switch(_e){case We._break:case We._continue:return this.parseBreakContinueStatement(De,_e.keyword);case We._debugger:return this.parseDebuggerStatement(De);case We._do:return this.parseDoStatement(De);case We._for:return this.parseForStatement(De);case We._function:if(i&&(this.strict||i!=="if"&&i!=="label")&&this.options.ecmaVersion>=6)this.unexpected();return this.parseFunctionStatement(De,!1,!i);case We._class:if(i)this.unexpected();return this.parseClass(De,!0);case We._if:return this.parseIfStatement(De);case We._return:return this.parseReturnStatement(De);case We._switch:return this.parseSwitchStatement(De);case We._throw:return this.parseThrowStatement(De);case We._try:return this.parseTryStatement(De);case We._const:case We._var:if(Re=Re||this.value,i&&Re!=="var")this.unexpected();return this.parseVarStatement(De,Re);case We._while:return this.parseWhileStatement(De);case We._with:return this.parseWithStatement(De);case We.braceL:return this.parseBlock(!0,De);case We.semi:return this.parseEmptyStatement(De);case We._export:case We._import:if(this.options.ecmaVersion>10&&_e===We._import){Bt.lastIndex=this.pos;var Ie=Bt.exec(this.input),Oe=this.pos+Ie[0].length,Me=this.input.charCodeAt(Oe);if(Me===40||Me===46)return this.parseExpressionStatement(De,this.parseExpression())}if(!this.options.allowImportExportEverywhere){if(!Ae)this.raise(this.start,"'import' and 'export' may only appear at the top level");if(!this.inModule)this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")}return _e===We._import?this.parseImport(De):this.parseExport(De,Ne);default:if(this.isAsyncFunction()){if(i)this.unexpected();return this.next(),this.parseFunctionStatement(De,!0,!i)}var Fe=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if(Fe){if(!this.allowUsing)this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement");if(i)this.raise(this.start,"Using declaration is not allowed in single-statement positions");if(Fe==="await using"){if(!this.canAwait)this.raise(this.start,"Await using cannot appear outside of async function");this.next()}return this.next(),this.parseVar(De,!1,Fe),this.semicolon(),this.finishNode(De,"VariableDeclaration")}var Be=this.value,Ve=this.parseExpression();if(_e===We.name&&Ve.type==="Identifier"&&this.eat(We.colon))return this.parseLabeledStatement(De,Be,Ve,i);else return this.parseExpressionStatement(De,Ve)}};lt.parseBreakContinueStatement=function(i,Ae){var Ne=Ae==="break";if(this.next(),this.eat(We.semi)||this.insertSemicolon())i.label=null;else if(this.type!==We.name)this.unexpected();else i.label=this.parseIdent(),this.semicolon();var _e=0;for(;_e<this.labels.length;++_e){var De=this.labels[_e];if(i.label==null||De.name===i.label.name){if(De.kind!=null&&(Ne||De.kind==="loop"))break;if(i.label&&Ne)break}}if(_e===this.labels.length)this.raise(i.start,"Unsyntactic "+Ae);return this.finishNode(i,Ne?"BreakStatement":"ContinueStatement")};lt.parseDebuggerStatement=function(i){return this.next(),this.semicolon(),this.finishNode(i,"DebuggerStatement")};lt.parseDoStatement=function(i){if(this.next(),this.labels.push(bi),i.body=this.parseStatement("do"),this.labels.pop(),this.expect(We._while),i.test=this.parseParenExpression(),this.options.ecmaVersion>=6)this.eat(We.semi);else this.semicolon();return this.finishNode(i,"DoWhileStatement")};lt.parseForStatement=function(i){this.next();var Ae=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(bi),this.enterScope(0),this.expect(We.parenL),this.type===We.semi){if(Ae>-1)this.unexpected(Ae);return this.parseFor(i,null)}var Ne=this.isLet();if(this.type===We._var||this.type===We._const||Ne){var _e=this.startNode(),De=Ne?"let":this.value;return this.next(),this.parseVar(_e,!0,De),this.finishNode(_e,"VariableDeclaration"),this.parseForAfterInit(i,_e,Ae)}var Re=this.isContextual("let"),Ie=!1,Oe=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(Oe){var Me=this.startNode();if(this.next(),Oe==="await using"){if(!this.canAwait)this.raise(this.start,"Await using cannot appear outside of async function");this.next()}return this.parseVar(Me,!0,Oe),this.finishNode(Me,"VariableDeclaration"),this.parseForAfterInit(i,Me,Ae)}var Fe=this.containsEsc,Be=new ts,Ve=this.start,Ge=Ae>-1?this.parseExprSubscripts(Be,"await"):this.parseExpression(!0,Be);if(this.type===We._in||(Ie=this.options.ecmaVersion>=6&&this.isContextual("of"))){if(Ae>-1){if(this.type===We._in)this.unexpected(Ae);i.await=!0}else if(Ie&&this.options.ecmaVersion>=8){if(Ge.start===Ve&&!Fe&&Ge.type==="Identifier"&&Ge.name==="async")this.unexpected();else if(this.options.ecmaVersion>=9)i.await=!1}if(Re&&Ie)this.raise(Ge.start,"The left-hand side of a for-of loop may not start with 'let'.");return this.toAssignable(Ge,!1,Be),this.checkLValPattern(Ge),this.parseForIn(i,Ge)}else this.checkExpressionErrors(Be,!0);if(Ae>-1)this.unexpected(Ae);return this.parseFor(i,Ge)};lt.parseForAfterInit=function(i,Ae,Ne){if((this.type===We._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&Ae.declarations.length===1){if(this.type===We._in){if((Ae.kind==="using"||Ae.kind==="await using")&&!Ae.declarations[0].init)this.raise(this.start,"Using declaration is not allowed in for-in loops");if(this.options.ecmaVersion>=9&&Ne>-1)this.unexpected(Ne)}else if(this.options.ecmaVersion>=9)i.await=Ne>-1;return this.parseForIn(i,Ae)}if(Ne>-1)this.unexpected(Ne);return this.parseFor(i,Ae)};lt.parseFunctionStatement=function(i,Ae,Ne){return this.next(),this.parseFunction(i,xr|(Ne?0:pi),!1,Ae)};lt.parseIfStatement=function(i){return this.next(),i.test=this.parseParenExpression(),i.consequent=this.parseStatement("if"),i.alternate=this.eat(We._else)?this.parseStatement("if"):null,this.finishNode(i,"IfStatement")};lt.parseReturnStatement=function(i){if(!this.allowReturn)this.raise(this.start,"'return' outside of function");if(this.next(),this.eat(We.semi)||this.insertSemicolon())i.argument=null;else i.argument=this.parseExpression(),this.semicolon();return this.finishNode(i,"ReturnStatement")};lt.parseSwitchStatement=function(i){this.next(),i.discriminant=this.parseParenExpression(),i.cases=[],this.expect(We.braceL),this.labels.push(td),this.enterScope(Ca);var Ae;for(var Ne=!1;this.type!==We.braceR;)if(this.type===We._case||this.type===We._default){var _e=this.type===We._case;if(Ae)this.finishNode(Ae,"SwitchCase");if(i.cases.push(Ae=this.startNode()),Ae.consequent=[],this.next(),_e)Ae.test=this.parseExpression();else{if(Ne)this.raiseRecoverable(this.lastTokStart,"Multiple default clauses");Ne=!0,Ae.test=null}this.expect(We.colon)}else{if(!Ae)this.unexpected();Ae.consequent.push(this.parseStatement(null))}if(this.exitScope(),Ae)this.finishNode(Ae,"SwitchCase");return this.next(),this.labels.pop(),this.finishNode(i,"SwitchStatement")};lt.parseThrowStatement=function(i){if(this.next(),Ht.test(this.input.slice(this.lastTokEnd,this.start)))this.raise(this.lastTokEnd,"Illegal newline after throw");return i.argument=this.parseExpression(),this.semicolon(),this.finishNode(i,"ThrowStatement")};var nd=[];lt.parseCatchClauseParam=function(){var i=this.parseBindingAtom(),Ae=i.type==="Identifier";return this.enterScope(Ae?ba:0),this.checkLValPattern(i,Ae?va:An),this.expect(We.parenR),i};lt.parseTryStatement=function(i){if(this.next(),i.block=this.parseBlock(),i.handler=null,this.type===We._catch){var Ae=this.startNode();if(this.next(),this.eat(We.parenL))Ae.param=this.parseCatchClauseParam();else{if(this.options.ecmaVersion<10)this.unexpected();Ae.param=null,this.enterScope(0)}Ae.body=this.parseBlock(!1),this.exitScope(),i.handler=this.finishNode(Ae,"CatchClause")}if(i.finalizer=this.eat(We._finally)?this.parseBlock():null,!i.handler&&!i.finalizer)this.raise(i.start,"Missing catch or finally clause");return this.finishNode(i,"TryStatement")};lt.parseVarStatement=function(i,Ae,Ne){return this.next(),this.parseVar(i,!1,Ae,Ne),this.semicolon(),this.finishNode(i,"VariableDeclaration")};lt.parseWhileStatement=function(i){return this.next(),i.test=this.parseParenExpression(),this.labels.push(bi),i.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(i,"WhileStatement")};lt.parseWithStatement=function(i){if(this.strict)this.raise(this.start,"'with' in strict mode");return this.next(),i.object=this.parseParenExpression(),i.body=this.parseStatement("with"),this.finishNode(i,"WithStatement")};lt.parseEmptyStatement=function(i){return this.next(),this.finishNode(i,"EmptyStatement")};lt.parseLabeledStatement=function(i,Ae,Ne,_e){for(var De=0,Re=this.labels;De<Re.length;De+=1){var Ie=Re[De];if(Ie.name===Ae)this.raise(Ne.start,"Label '"+Ae+"' is already declared")}var Oe=this.type.isLoop?"loop":this.type===We._switch?"switch":null;for(var Me=this.labels.length-1;Me>=0;Me--){var Fe=this.labels[Me];if(Fe.statementStart===i.start)Fe.statementStart=this.start,Fe.kind=Oe;else break}return this.labels.push({name:Ae,kind:Oe,statementStart:this.start}),i.body=this.parseStatement(_e?_e.indexOf("label")===-1?_e+"label":_e:"label"),this.labels.pop(),i.label=Ne,this.finishNode(i,"LabeledStatement")};lt.parseExpressionStatement=function(i,Ae){return i.expression=Ae,this.semicolon(),this.finishNode(i,"ExpressionStatement")};lt.parseBlock=function(i,Ae,Ne){if(i===void 0)i=!0;if(Ae===void 0)Ae=this.startNode();if(Ae.body=[],this.expect(We.braceL),i)this.enterScope(0);while(this.type!==We.braceR){var _e=this.parseStatement(null);Ae.body.push(_e)}if(Ne)this.strict=!1;if(this.next(),i)this.exitScope();return this.finishNode(Ae,"BlockStatement")};lt.parseFor=function(i,Ae){return i.init=Ae,this.expect(We.semi),i.test=this.type===We.semi?null:this.parseExpression(),this.expect(We.semi),i.update=this.type===We.parenR?null:this.parseExpression(),this.expect(We.parenR),i.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(i,"ForStatement")};lt.parseForIn=function(i,Ae){var Ne=this.type===We._in;if(this.next(),Ae.type==="VariableDeclaration"&&Ae.declarations[0].init!=null&&(!Ne||this.options.ecmaVersion<8||this.strict||Ae.kind!=="var"||Ae.declarations[0].id.type!=="Identifier"))this.raise(Ae.start,(Ne?"for-in":"for-of")+" loop variable declaration may not have an initializer");return i.left=Ae,i.right=Ne?this.parseExpression():this.parseMaybeAssign(),this.expect(We.parenR),i.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(i,Ne?"ForInStatement":"ForOfStatement")};lt.parseVar=function(i,Ae,Ne,_e){i.declarations=[],i.kind=Ne;for(;;){var De=this.startNode();if(this.parseVarId(De,Ne),this.eat(We.eq))De.init=this.parseMaybeAssign(Ae);else if(!_e&&Ne==="const"&&!(this.type===We._in||this.options.ecmaVersion>=6&&this.isContextual("of")))this.unexpected();else if(!_e&&(Ne==="using"||Ne==="await using")&&this.options.ecmaVersion>=17&&this.type!==We._in&&!this.isContextual("of"))this.raise(this.lastTokEnd,"Missing initializer in "+Ne+" declaration");else if(!_e&&De.id.type!=="Identifier"&&!(Ae&&(this.type===We._in||this.isContextual("of"))))this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value");else De.init=null;if(i.declarations.push(this.finishNode(De,"VariableDeclarator")),!this.eat(We.comma))break}return i};lt.parseVarId=function(i,Ae){i.id=Ae==="using"||Ae==="await using"?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(i.id,Ae==="var"?xi:An,!1)};var xr=1,pi=2,ka=4;lt.parseFunction=function(i,Ae,Ne,_e,De){if(this.initFunction(i),this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!_e){if(this.type===We.star&&Ae&pi)this.unexpected();i.generator=this.eat(We.star)}if(this.options.ecmaVersion>=8)i.async=!!_e;if(Ae&xr){if(i.id=Ae&ka&&this.type!==We.name?null:this.parseIdent(),i.id&&!(Ae&pi))this.checkLValSimple(i.id,this.strict||i.generator||i.async?this.treatFunctionsAsVar?xi:An:Sa)}var Re=this.yieldPos,Ie=this.awaitPos,Oe=this.awaitIdentPos;if(this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(gi(i.async,i.generator)),!(Ae&xr))i.id=this.type===We.name?this.parseIdent():null;return this.parseFunctionParams(i),this.parseFunctionBody(i,Ne,!1,De),this.yieldPos=Re,this.awaitPos=Ie,this.awaitIdentPos=Oe,this.finishNode(i,Ae&xr?"FunctionDeclaration":"FunctionExpression")};lt.parseFunctionParams=function(i){this.expect(We.parenL),i.params=this.parseBindingList(We.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};lt.parseClass=function(i,Ae){this.next();var Ne=this.strict;this.strict=!0,this.parseClassId(i,Ae),this.parseClassSuper(i);var _e=this.enterClassBody(),De=this.startNode(),Re=!1;De.body=[],this.expect(We.braceL);while(this.type!==We.braceR){var Ie=this.parseClassElement(i.superClass!==null);if(Ie){if(De.body.push(Ie),Ie.type==="MethodDefinition"&&Ie.kind==="constructor"){if(Re)this.raiseRecoverable(Ie.start,"Duplicate constructor in the same class");Re=!0}else if(Ie.key&&Ie.key.type==="PrivateIdentifier"&&rd(_e,Ie))this.raiseRecoverable(Ie.key.start,"Identifier '#"+Ie.key.name+"' has already been declared")}}return this.strict=Ne,this.next(),i.body=this.finishNode(De,"ClassBody"),this.exitClassBody(),this.finishNode(i,Ae?"ClassDeclaration":"ClassExpression")};lt.parseClassElement=function(i){if(this.eat(We.semi))return null;var Ae=this.options.ecmaVersion,Ne=this.startNode(),_e="",De=!1,Re=!1,Ie="method",Oe=!1;if(this.eatContextual("static")){if(Ae>=13&&this.eat(We.braceL))return this.parseClassStaticBlock(Ne),Ne;if(this.isClassElementNameStart()||this.type===We.star)Oe=!0;else _e="static"}if(Ne.static=Oe,!_e&&Ae>=8&&this.eatContextual("async"))if((this.isClassElementNameStart()||this.type===We.star)&&!this.canInsertSemicolon())Re=!0;else _e="async";if(!_e&&(Ae>=9||!Re)&&this.eat(We.star))De=!0;if(!_e&&!Re&&!De){var Me=this.value;if(this.eatContextual("get")||this.eatContextual("set"))if(this.isClassElementNameStart())Ie=Me;else _e=Me}if(_e)Ne.computed=!1,Ne.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),Ne.key.name=_e,this.finishNode(Ne.key,"Identifier");else this.parseClassElementName(Ne);if(Ae<13||this.type===We.parenL||Ie!=="method"||De||Re){var Fe=!Ne.static&&Xr(Ne,"constructor"),Be=Fe&&i;if(Fe&&Ie!=="method")this.raise(Ne.key.start,"Constructor can't have get/set modifier");Ne.kind=Fe?"constructor":Ie,this.parseClassMethod(Ne,De,Re,Be)}else this.parseClassField(Ne);return Ne};lt.isClassElementNameStart=function(){return this.type===We.name||this.type===We.privateId||this.type===We.num||this.type===We.string||this.type===We.bracketL||this.type.keyword};lt.parseClassElementName=function(i){if(this.type===We.privateId){if(this.value==="constructor")this.raise(this.start,"Classes can't have an element named '#constructor'");i.computed=!1,i.key=this.parsePrivateIdent()}else this.parsePropertyName(i)};lt.parseClassMethod=function(i,Ae,Ne,_e){var De=i.key;if(i.kind==="constructor"){if(Ae)this.raise(De.start,"Constructor can't be a generator");if(Ne)this.raise(De.start,"Constructor can't be an async method")}else if(i.static&&Xr(i,"prototype"))this.raise(De.start,"Classes may not have a static property named prototype");var Re=i.value=this.parseMethod(Ae,Ne,_e);if(i.kind==="get"&&Re.params.length!==0)this.raiseRecoverable(Re.start,"getter should have no params");if(i.kind==="set"&&Re.params.length!==1)this.raiseRecoverable(Re.start,"setter should have exactly one param");if(i.kind==="set"&&Re.params[0].type==="RestElement")this.raiseRecoverable(Re.params[0].start,"Setter cannot use rest params");return this.finishNode(i,"MethodDefinition")};lt.parseClassField=function(i){if(Xr(i,"constructor"))this.raise(i.key.start,"Classes can't have a field named 'constructor'");else if(i.static&&Xr(i,"prototype"))this.raise(i.key.start,"Classes can't have a static field named 'prototype'");if(this.eat(We.eq))this.enterScope(Er|Zr),i.value=this.parseMaybeAssign(),this.exitScope();else i.value=null;return this.semicolon(),this.finishNode(i,"PropertyDefinition")};lt.parseClassStaticBlock=function(i){i.body=[];var Ae=this.labels;this.labels=[],this.enterScope(Un|Zr);while(this.type!==We.braceR){var Ne=this.parseStatement(null);i.body.push(Ne)}return this.next(),this.exitScope(),this.labels=Ae,this.finishNode(i,"StaticBlock")};lt.parseClassId=function(i,Ae){if(this.type===We.name){if(i.id=this.parseIdent(),Ae)this.checkLValSimple(i.id,An,!1)}else{if(Ae===!0)this.unexpected();i.id=null}};lt.parseClassSuper=function(i){i.superClass=this.eat(We._extends)?this.parseExprSubscripts(null,!1):null};lt.enterClassBody=function(){var i={declared:Object.create(null),used:[]};return this.privateNameStack.push(i),i.declared};lt.exitClassBody=function(){var i=this.privateNameStack.pop(),{declared:Ae,used:Ne}=i;if(!this.options.checkPrivateFields)return;var _e=this.privateNameStack.length,De=_e===0?null:this.privateNameStack[_e-1];for(var Re=0;Re<Ne.length;++Re){var Ie=Ne[Re];if(!er(Ae,Ie.name))if(De)De.used.push(Ie);else this.raiseRecoverable(Ie.start,"Private field '#"+Ie.name+"' must be declared in an enclosing class")}};function rd(i,Ae){var Ne=Ae.key.name,_e=i[Ne],De="true";if(Ae.type==="MethodDefinition"&&(Ae.kind==="get"||Ae.kind==="set"))De=(Ae.static?"s":"i")+Ae.kind;if(_e==="iget"&&De==="iset"||_e==="iset"&&De==="iget"||_e==="sget"&&De==="sset"||_e==="sset"&&De==="sget")return i[Ne]="true",!1;else if(!_e)return i[Ne]=De,!1;else return!0}function Xr(i,Ae){var{computed:Ne,key:_e}=i;return!Ne&&(_e.type==="Identifier"&&_e.name===Ae||_e.type==="Literal"&&_e.value===Ae)}lt.parseExportAllDeclaration=function(i,Ae){if(this.options.ecmaVersion>=11)if(this.eatContextual("as"))i.exported=this.parseModuleExportName(),this.checkExport(Ae,i.exported,this.lastTokStart);else i.exported=null;if(this.expectContextual("from"),this.type!==We.string)this.unexpected();if(i.source=this.parseExprAtom(),this.options.ecmaVersion>=16)i.attributes=this.parseWithClause();return this.semicolon(),this.finishNode(i,"ExportAllDeclaration")};lt.parseExport=function(i,Ae){if(this.next(),this.eat(We.star))return this.parseExportAllDeclaration(i,Ae);if(this.eat(We._default))return this.checkExport(Ae,"default",this.lastTokStart),i.declaration=this.parseExportDefaultDeclaration(),this.finishNode(i,"ExportDefaultDeclaration");if(this.shouldParseExportStatement()){if(i.declaration=this.parseExportDeclaration(i),i.declaration.type==="VariableDeclaration")this.checkVariableExport(Ae,i.declaration.declarations);else this.checkExport(Ae,i.declaration.id,i.declaration.id.start);if(i.specifiers=[],i.source=null,this.options.ecmaVersion>=16)i.attributes=[]}else{if(i.declaration=null,i.specifiers=this.parseExportSpecifiers(Ae),this.eatContextual("from")){if(this.type!==We.string)this.unexpected();if(i.source=this.parseExprAtom(),this.options.ecmaVersion>=16)i.attributes=this.parseWithClause()}else{for(var Ne=0,_e=i.specifiers;Ne<_e.length;Ne+=1){var De=_e[Ne];if(this.checkUnreserved(De.local),this.checkLocalExport(De.local),De.local.type==="Literal")this.raise(De.local.start,"A string literal cannot be used as an exported binding without `from`.")}if(i.source=null,this.options.ecmaVersion>=16)i.attributes=[]}this.semicolon()}return this.finishNode(i,"ExportNamedDeclaration")};lt.parseExportDeclaration=function(i){return this.parseStatement(null)};lt.parseExportDefaultDeclaration=function(){var i;if(this.type===We._function||(i=this.isAsyncFunction())){var Ae=this.startNode();if(this.next(),i)this.next();return this.parseFunction(Ae,xr|ka,!1,i)}else if(this.type===We._class){var Ne=this.startNode();return this.parseClass(Ne,"nullableID")}else{var _e=this.parseMaybeAssign();return this.semicolon(),_e}};lt.checkExport=function(i,Ae,Ne){if(!i)return;if(typeof Ae!=="string")Ae=Ae.type==="Identifier"?Ae.name:Ae.value;if(er(i,Ae))this.raiseRecoverable(Ne,"Duplicate export '"+Ae+"'");i[Ae]=!0};lt.checkPatternExport=function(i,Ae){var Ne=Ae.type;if(Ne==="Identifier")this.checkExport(i,Ae,Ae.start);else if(Ne==="ObjectPattern")for(var _e=0,De=Ae.properties;_e<De.length;_e+=1){var Re=De[_e];this.checkPatternExport(i,Re)}else if(Ne==="ArrayPattern")for(var Ie=0,Oe=Ae.elements;Ie<Oe.length;Ie+=1){var Me=Oe[Ie];if(Me)this.checkPatternExport(i,Me)}else if(Ne==="Property")this.checkPatternExport(i,Ae.value);else if(Ne==="AssignmentPattern")this.checkPatternExport(i,Ae.left);else if(Ne==="RestElement")this.checkPatternExport(i,Ae.argument)};lt.checkVariableExport=function(i,Ae){if(!i)return;for(var Ne=0,_e=Ae;Ne<_e.length;Ne+=1){var De=_e[Ne];this.checkPatternExport(i,De.id)}};lt.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};lt.parseExportSpecifier=function(i){var Ae=this.startNode();return Ae.local=this.parseModuleExportName(),Ae.exported=this.eatContextual("as")?this.parseModuleExportName():Ae.local,this.checkExport(i,Ae.exported,Ae.exported.start),this.finishNode(Ae,"ExportSpecifier")};lt.parseExportSpecifiers=function(i){var Ae=[],Ne=!0;this.expect(We.braceL);while(!this.eat(We.braceR)){if(!Ne){if(this.expect(We.comma),this.afterTrailingComma(We.braceR))break}else Ne=!1;Ae.push(this.parseExportSpecifier(i))}return Ae};lt.parseImport=function(i){if(this.next(),this.type===We.string)i.specifiers=nd,i.source=this.parseExprAtom();else i.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),i.source=this.type===We.string?this.parseExprAtom():this.unexpected();if(this.options.ecmaVersion>=16)i.attributes=this.parseWithClause();return this.semicolon(),this.finishNode(i,"ImportDeclaration")};lt.parseImportSpecifier=function(){var i=this.startNode();if(i.imported=this.parseModuleExportName(),this.eatContextual("as"))i.local=this.parseIdent();else this.checkUnreserved(i.imported),i.local=i.imported;return this.checkLValSimple(i.local,An),this.finishNode(i,"ImportSpecifier")};lt.parseImportDefaultSpecifier=function(){var i=this.startNode();return i.local=this.parseIdent(),this.checkLValSimple(i.local,An),this.finishNode(i,"ImportDefaultSpecifier")};lt.parseImportNamespaceSpecifier=function(){var i=this.startNode();return this.next(),this.expectContextual("as"),i.local=this.parseIdent(),this.checkLValSimple(i.local,An),this.finishNode(i,"ImportNamespaceSpecifier")};lt.parseImportSpecifiers=function(){var i=[],Ae=!0;if(this.type===We.name){if(i.push(this.parseImportDefaultSpecifier()),!this.eat(We.comma))return i}if(this.type===We.star)return i.push(this.parseImportNamespaceSpecifier()),i;this.expect(We.braceL);while(!this.eat(We.braceR)){if(!Ae){if(this.expect(We.comma),this.afterTrailingComma(We.braceR))break}else Ae=!1;i.push(this.parseImportSpecifier())}return i};lt.parseWithClause=function(){var i=[];if(!this.eat(We._with))return i;this.expect(We.braceL);var Ae={},Ne=!0;while(!this.eat(We.braceR)){if(!Ne){if(this.expect(We.comma),this.afterTrailingComma(We.braceR))break}else Ne=!1;var _e=this.parseImportAttribute(),De=_e.key.type==="Identifier"?_e.key.name:_e.key.value;if(er(Ae,De))this.raiseRecoverable(_e.key.start,"Duplicate attribute key '"+De+"'");Ae[De]=!0,i.push(_e)}return i};lt.parseImportAttribute=function(){var i=this.startNode();if(i.key=this.type===We.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(We.colon),this.type!==We.string)this.unexpected();return i.value=this.parseExprAtom(),this.finishNode(i,"ImportAttribute")};lt.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===We.string){var i=this.parseLiteral(this.value);if(Yu.test(i.value))this.raise(i.start,"An export name cannot include a lone surrogate.");return i}return this.parseIdent(!0)};lt.adaptDirectivePrologue=function(i){for(var Ae=0;Ae<i.length&&this.isDirectiveCandidate(i[Ae]);++Ae)i[Ae].directive=i[Ae].expression.raw.slice(1,-1)};lt.isDirectiveCandidate=function(i){return this.options.ecmaVersion>=5&&i.type==="ExpressionStatement"&&i.expression.type==="Literal"&&typeof i.expression.value==="string"&&(this.input[i.start]==='"'||this.input[i.start]==="'")};var pn=Pt.prototype;pn.toAssignable=function(i,Ae,Ne){if(this.options.ecmaVersion>=6&&i)switch(i.type){case"Identifier":if(this.inAsync&&i.name==="await")this.raise(i.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":if(i.type="ObjectPattern",Ne)this.checkPatternErrors(Ne,!0);for(var _e=0,De=i.properties;_e<De.length;_e+=1){var Re=De[_e];if(this.toAssignable(Re,Ae),Re.type==="RestElement"&&(Re.argument.type==="ArrayPattern"||Re.argument.type==="ObjectPattern"))this.raise(Re.argument.start,"Unexpected token")}break;case"Property":if(i.kind!=="init")this.raise(i.key.start,"Object pattern can't contain getter or setter");this.toAssignable(i.value,Ae);break;case"ArrayExpression":if(i.type="ArrayPattern",Ne)this.checkPatternErrors(Ne,!0);this.toAssignableList(i.elements,Ae);break;case"SpreadElement":if(i.type="RestElement",this.toAssignable(i.argument,Ae),i.argument.type==="AssignmentPattern")this.raise(i.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":if(i.operator!=="=")this.raise(i.left.end,"Only '=' operator can be used for specifying default value.");i.type="AssignmentPattern",delete i.operator,this.toAssignable(i.left,Ae);break;case"ParenthesizedExpression":this.toAssignable(i.expression,Ae,Ne);break;case"ChainExpression":this.raiseRecoverable(i.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!Ae)break;default:this.raise(i.start,"Assigning to rvalue")}else if(Ne)this.checkPatternErrors(Ne,!0);return i};pn.toAssignableList=function(i,Ae){var Ne=i.length;for(var _e=0;_e<Ne;_e++){var De=i[_e];if(De)this.toAssignable(De,Ae)}if(Ne){var Re=i[Ne-1];if(this.options.ecmaVersion===6&&Ae&&Re&&Re.type==="RestElement"&&Re.argument.type!=="Identifier")this.unexpected(Re.argument.start)}return i};pn.parseSpread=function(i){var Ae=this.startNode();return this.next(),Ae.argument=this.parseMaybeAssign(!1,i),this.finishNode(Ae,"SpreadElement")};pn.parseRestBinding=function(){var i=this.startNode();if(this.next(),this.options.ecmaVersion===6&&this.type!==We.name)this.unexpected();return i.argument=this.parseBindingAtom(),this.finishNode(i,"RestElement")};pn.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case We.bracketL:var i=this.startNode();return this.next(),i.elements=this.parseBindingList(We.bracketR,!0,!0),this.finishNode(i,"ArrayPattern");case We.braceL:return this.parseObj(!0)}return this.parseIdent()};pn.parseBindingList=function(i,Ae,Ne,_e){var De=[],Re=!0;while(!this.eat(i)){if(Re)Re=!1;else this.expect(We.comma);if(Ae&&this.type===We.comma)De.push(null);else if(Ne&&this.afterTrailingComma(i))break;else if(this.type===We.ellipsis){var Ie=this.parseRestBinding();if(this.parseBindingListItem(Ie),De.push(Ie),this.type===We.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");this.expect(i);break}else De.push(this.parseAssignableListItem(_e))}return De};pn.parseAssignableListItem=function(i){var Ae=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(Ae),Ae};pn.parseBindingListItem=function(i){return i};pn.parseMaybeDefault=function(i,Ae,Ne){if(Ne=Ne||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(We.eq))return Ne;var _e=this.startNodeAt(i,Ae);return _e.left=Ne,_e.right=this.parseMaybeAssign(),this.finishNode(_e,"AssignmentPattern")};pn.checkLValSimple=function(i,Ae,Ne){if(Ae===void 0)Ae=zr;var _e=Ae!==zr;switch(i.type){case"Identifier":if(this.strict&&this.reservedWordsStrictBind.test(i.name))this.raiseRecoverable(i.start,(_e?"Binding ":"Assigning to ")+i.name+" in strict mode");if(_e){if(Ae===An&&i.name==="let")this.raiseRecoverable(i.start,"let is disallowed as a lexically bound name");if(Ne){if(er(Ne,i.name))this.raiseRecoverable(i.start,"Argument name clash");Ne[i.name]=!0}if(Ae!==Ta)this.declareName(i.name,Ae,i.start)}break;case"ChainExpression":this.raiseRecoverable(i.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(_e)this.raiseRecoverable(i.start,"Binding member expression");break;case"ParenthesizedExpression":if(_e)this.raiseRecoverable(i.start,"Binding parenthesized expression");return this.checkLValSimple(i.expression,Ae,Ne);default:this.raise(i.start,(_e?"Binding":"Assigning to")+" rvalue")}};pn.checkLValPattern=function(i,Ae,Ne){if(Ae===void 0)Ae=zr;switch(i.type){case"ObjectPattern":for(var _e=0,De=i.properties;_e<De.length;_e+=1){var Re=De[_e];this.checkLValInnerPattern(Re,Ae,Ne)}break;case"ArrayPattern":for(var Ie=0,Oe=i.elements;Ie<Oe.length;Ie+=1){var Me=Oe[Ie];if(Me)this.checkLValInnerPattern(Me,Ae,Ne)}break;default:this.checkLValSimple(i,Ae,Ne)}};pn.checkLValInnerPattern=function(i,Ae,Ne){if(Ae===void 0)Ae=zr;switch(i.type){case"Property":this.checkLValInnerPattern(i.value,Ae,Ne);break;case"AssignmentPattern":this.checkLValPattern(i.left,Ae,Ne);break;case"RestElement":this.checkLValPattern(i.argument,Ae,Ne);break;default:this.checkLValPattern(i,Ae,Ne)}};var an=function(Ae,Ne,_e,De,Re){this.token=Ae,this.isExpr=!!Ne,this.preserveSpace=!!_e,this.override=De,this.generator=!!Re},wt={b_stat:new an("{",!1),b_expr:new an("{",!0),b_tmpl:new an("${",!1),p_stat:new an("(",!1),p_expr:new an("(",!0),q_tmpl:new an("`",!0,!0,function(i){return i.tryReadTemplateToken()}),f_stat:new an("function",!1),f_expr:new an("function",!0),f_expr_gen:new an("function",!0,!1,null,!0),f_gen:new an("function",!1,!1,null,!0)},tr=Pt.prototype;tr.initialContext=function(){return[wt.b_stat]};tr.curContext=function(){return this.context[this.context.length-1]};tr.braceIsBlock=function(i){var Ae=this.curContext();if(Ae===wt.f_expr||Ae===wt.f_stat)return!0;if(i===We.colon&&(Ae===wt.b_stat||Ae===wt.b_expr))return!Ae.isExpr;if(i===We._return||i===We.name&&this.exprAllowed)return Ht.test(this.input.slice(this.lastTokEnd,this.start));if(i===We._else||i===We.semi||i===We.eof||i===We.parenR||i===We.arrow)return!0;if(i===We.braceL)return Ae===wt.b_stat;if(i===We._var||i===We._const||i===We.name)return!1;return!this.exprAllowed};tr.inGeneratorContext=function(){for(var i=this.context.length-1;i>=1;i--){var Ae=this.context[i];if(Ae.token==="function")return Ae.generator}return!1};tr.updateContext=function(i){var Ae,Ne=this.type;if(Ne.keyword&&i===We.dot)this.exprAllowed=!1;else if(Ae=Ne.updateContext)Ae.call(this,i);else this.exprAllowed=Ne.beforeExpr};tr.overrideContext=function(i){if(this.curContext()!==i)this.context[this.context.length-1]=i};We.parenR.updateContext=We.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var i=this.context.pop();if(i===wt.b_stat&&this.curContext().token==="function")i=this.context.pop();this.exprAllowed=!i.isExpr};We.braceL.updateContext=function(i){this.context.push(this.braceIsBlock(i)?wt.b_stat:wt.b_expr),this.exprAllowed=!0};We.dollarBraceL.updateContext=function(){this.context.push(wt.b_tmpl),this.exprAllowed=!0};We.parenL.updateContext=function(i){var Ae=i===We._if||i===We._for||i===We._with||i===We._while;this.context.push(Ae?wt.p_stat:wt.p_expr),this.exprAllowed=!0};We.incDec.updateContext=function(){};We._function.updateContext=We._class.updateContext=function(i){if(i.beforeExpr&&i!==We._else&&!(i===We.semi&&this.curContext()!==wt.p_stat)&&!(i===We._return&&Ht.test(this.input.slice(this.lastTokEnd,this.start)))&&!((i===We.colon||i===We.braceL)&&this.curContext()===wt.b_stat))this.context.push(wt.f_expr);else this.context.push(wt.f_stat);this.exprAllowed=!1};We.colon.updateContext=function(){if(this.curContext().token==="function")this.context.pop();this.exprAllowed=!0};We.backQuote.updateContext=function(){if(this.curContext()===wt.q_tmpl)this.context.pop();else this.context.push(wt.q_tmpl);this.exprAllowed=!1};We.star.updateContext=function(i){if(i===We._function){var Ae=this.context.length-1;if(this.context[Ae]===wt.f_expr)this.context[Ae]=wt.f_expr_gen;else this.context[Ae]=wt.f_gen}this.exprAllowed=!0};We.name.updateContext=function(i){var Ae=!1;if(this.options.ecmaVersion>=6&&i!==We.dot){if(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())Ae=!0}this.exprAllowed=Ae};var ft=Pt.prototype;ft.checkPropClash=function(i,Ae,Ne){if(this.options.ecmaVersion>=9&&i.type==="SpreadElement")return;if(this.options.ecmaVersion>=6&&(i.computed||i.method||i.shorthand))return;var _e=i.key,De;switch(_e.type){case"Identifier":De=_e.name;break;case"Literal":De=String(_e.value);break;default:return}var Re=i.kind;if(this.options.ecmaVersion>=6){if(De==="__proto__"&&Re==="init"){if(Ae.proto)if(Ne){if(Ne.doubleProto<0)Ne.doubleProto=_e.start}else this.raiseRecoverable(_e.start,"Redefinition of __proto__ property");Ae.proto=!0}return}De="$"+De;var Ie=Ae[De];if(Ie){var Oe;if(Re==="init")Oe=this.strict&&Ie.init||Ie.get||Ie.set;else Oe=Ie.init||Ie[Re];if(Oe)this.raiseRecoverable(_e.start,"Redefinition of property")}else Ie=Ae[De]={init:!1,get:!1,set:!1};Ie[Re]=!0};ft.parseExpression=function(i,Ae){var Ne=this;return this.catchStackOverflow(function(){var{start:_e,startLoc:De}=Ne,Re=Ne.parseMaybeAssign(i,Ae);if(Ne.type===We.comma){var Ie=Ne.startNodeAt(_e,De);Ie.expressions=[Re];while(Ne.eat(We.comma))Ie.expressions.push(Ne.parseMaybeAssign(i,Ae));return Ne.finishNode(Ie,"SequenceExpression")}return Re})};ft.parseMaybeAssign=function(i,Ae,Ne){if(this.isContextual("yield"))if(this.inGenerator)return this.parseYield(i);else this.exprAllowed=!1;var _e=!1,De=-1,Re=-1,Ie=-1;if(Ae)De=Ae.parenthesizedAssign,Re=Ae.trailingComma,Ie=Ae.doubleProto,Ae.parenthesizedAssign=Ae.trailingComma=-1;else Ae=new ts,_e=!0;var Oe=this.start,Me=this.startLoc;if(this.type===We.parenL||this.type===We.name)this.potentialArrowAt=this.start,this.potentialArrowInForAwait=i==="await";var Fe=this.parseMaybeConditional(i,Ae);if(Ne)Fe=Ne.call(this,Fe,Oe,Me);if(this.type.isAssign){var Be=this.startNodeAt(Oe,Me);if(Be.operator=this.value,this.type===We.eq)Fe=this.toAssignable(Fe,!1,Ae);if(!_e)Ae.parenthesizedAssign=Ae.trailingComma=Ae.doubleProto=-1;if(Ae.shorthandAssign>=Fe.start)Ae.shorthandAssign=-1;if(this.type===We.eq)this.checkLValPattern(Fe);else this.checkLValSimple(Fe);if(Be.left=Fe,this.next(),Be.right=this.parseMaybeAssign(i),Ie>-1)Ae.doubleProto=Ie;return this.finishNode(Be,"AssignmentExpression")}else if(_e)this.checkExpressionErrors(Ae,!0);if(De>-1)Ae.parenthesizedAssign=De;if(Re>-1)Ae.trailingComma=Re;return Fe};ft.parseMaybeConditional=function(i,Ae){var Ne=this.start,_e=this.startLoc,De=this.parseExprOps(i,Ae);if(this.checkExpressionErrors(Ae))return De;if(!(De.type==="ArrowFunctionExpression"&&De.start===Ne)&&this.eat(We.question)){var Re=this.startNodeAt(Ne,_e);return Re.test=De,Re.consequent=this.parseMaybeAssign(),this.expect(We.colon),Re.alternate=this.parseMaybeAssign(i),this.finishNode(Re,"ConditionalExpression")}return De};ft.parseExprOps=function(i,Ae){var Ne=this.start,_e=this.startLoc,De=this.parseMaybeUnary(Ae,!1,!1,i);if(this.checkExpressionErrors(Ae))return De;return De.start===Ne&&De.type==="ArrowFunctionExpression"?De:this.parseExprOp(De,Ne,_e,-1,i)};ft.parseExprOp=function(i,Ae,Ne,_e,De){var Re=this.type.binop;if(Re!=null&&(!De||this.type!==We._in)){if(Re>_e){var Ie=this.type===We.logicalOR||this.type===We.logicalAND,Oe=this.type===We.coalesce;if(Oe)Re=We.logicalAND.binop;var Me=this.value;this.next();var Fe=this.start,Be=this.startLoc,Ve=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,De),Fe,Be,Re,De),Ge=this.buildBinary(Ae,Ne,i,Ve,Me,Ie||Oe);if(Ie&&this.type===We.coalesce||Oe&&(this.type===We.logicalOR||this.type===We.logicalAND))this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses");return this.parseExprOp(Ge,Ae,Ne,_e,De)}}return i};ft.buildBinary=function(i,Ae,Ne,_e,De,Re){if(_e.type==="PrivateIdentifier")this.raise(_e.start,"Private identifier can only be left side of binary expression");var Ie=this.startNodeAt(i,Ae);return Ie.left=Ne,Ie.operator=De,Ie.right=_e,this.finishNode(Ie,Re?"LogicalExpression":"BinaryExpression")};ft.parseMaybeUnary=function(i,Ae,Ne,_e){var De=this.start,Re=this.startLoc,Ie;if(this.isContextual("await")&&this.canAwait)Ie=this.parseAwait(_e),Ae=!0;else if(this.type.prefix){var Oe=this.startNode(),Me=this.type===We.incDec;if(Oe.operator=this.value,Oe.prefix=!0,this.next(),Oe.argument=this.parseMaybeUnary(null,!0,Me,_e),this.checkExpressionErrors(i,!0),Me)this.checkLValSimple(Oe.argument);else if(this.strict&&Oe.operator==="delete"&&Aa(Oe.argument))this.raiseRecoverable(Oe.start,"Deleting local variable in strict mode");else if(Oe.operator==="delete"&&ui(Oe.argument))this.raiseRecoverable(Oe.start,"Private fields can not be deleted");else Ae=!0;Ie=this.finishNode(Oe,Me?"UpdateExpression":"UnaryExpression")}else if(!Ae&&this.type===We.privateId){if((_e||this.privateNameStack.length===0)&&this.options.checkPrivateFields)this.unexpected();if(Ie=this.parsePrivateIdent(),this.type!==We._in)this.unexpected()}else{if(Ie=this.parseExprSubscripts(i,_e),this.checkExpressionErrors(i))return Ie;while(this.type.postfix&&!this.canInsertSemicolon()){var Fe=this.startNodeAt(De,Re);Fe.operator=this.value,Fe.prefix=!1,Fe.argument=Ie,this.checkLValSimple(Ie),this.next(),Ie=this.finishNode(Fe,"UpdateExpression")}}if(!Ne&&!(Ie.type==="ArrowFunctionExpression"&&Ie.start===De)&&this.eat(We.starstar))if(Ae)this.unexpected(this.lastTokStart);else return this.buildBinary(De,Re,Ie,this.parseMaybeUnary(null,!1,!1,_e),"**",!1);else return Ie};function Aa(i){return i.type==="Identifier"||i.type==="ParenthesizedExpression"&&Aa(i.expression)}function ui(i){return i.type==="MemberExpression"&&i.property.type==="PrivateIdentifier"||i.type==="ChainExpression"&&ui(i.expression)||i.type==="ParenthesizedExpression"&&ui(i.expression)}ft.parseExprSubscripts=function(i,Ae){var Ne=this.start,_e=this.startLoc,De=this.parseExprAtom(i,Ae);if(De.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return De;var Re=this.parseSubscripts(De,Ne,_e,!1,Ae);if(i&&Re.type==="MemberExpression"){if(i.parenthesizedAssign>=Re.start)i.parenthesizedAssign=-1;if(i.parenthesizedBind>=Re.start)i.parenthesizedBind=-1;if(i.trailingComma>=Re.start)i.trailingComma=-1}return Re};ft.parseSubscripts=function(i,Ae,Ne,_e,De){var Re=this.options.ecmaVersion>=8&&i.type==="Identifier"&&i.name==="async"&&this.lastTokEnd===i.end&&!this.canInsertSemicolon()&&i.end-i.start===5&&this.potentialArrowAt===i.start,Ie=!1;while(!0){var Oe=this.parseSubscript(i,Ae,Ne,_e,Re,Ie,De);if(Oe.optional)Ie=!0;if(Oe===i||Oe.type==="ArrowFunctionExpression"){if(Ie){var Me=this.startNodeAt(Ae,Ne);Me.expression=Oe,Oe=this.finishNode(Me,"ChainExpression")}return Oe}i=Oe}};ft.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(We.arrow)};ft.parseSubscriptAsyncArrow=function(i,Ae,Ne,_e){return this.parseArrowExpression(this.startNodeAt(i,Ae),Ne,!0,_e)};ft.parseSubscript=function(i,Ae,Ne,_e,De,Re,Ie){var Oe=this.options.ecmaVersion>=11,Me=Oe&&this.eat(We.questionDot);if(_e&&Me)this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var Fe=this.eat(We.bracketL);if(Fe||Me&&this.type!==We.parenL&&this.type!==We.backQuote||this.eat(We.dot)){var Be=this.startNodeAt(Ae,Ne);if(Be.object=i,Fe)Be.property=this.parseExpression(),this.expect(We.bracketR);else if(this.type===We.privateId&&i.type!=="Super")Be.property=this.parsePrivateIdent();else Be.property=this.parseIdent(this.options.allowReserved!=="never");if(Be.computed=!!Fe,Oe)Be.optional=Me;i=this.finishNode(Be,"MemberExpression")}else if(!_e&&this.eat(We.parenL)){var Ve=new ts,Ge=this.yieldPos,Ue=this.awaitPos,Xe=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var ze=this.parseExprList(We.parenR,this.options.ecmaVersion>=8,!1,Ve);if(De&&!Me&&this.shouldParseAsyncArrow()){if(this.checkPatternErrors(Ve,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0)this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function");return this.yieldPos=Ge,this.awaitPos=Ue,this.awaitIdentPos=Xe,this.parseSubscriptAsyncArrow(Ae,Ne,ze,Ie)}this.checkExpressionErrors(Ve,!0),this.yieldPos=Ge||this.yieldPos,this.awaitPos=Ue||this.awaitPos,this.awaitIdentPos=Xe||this.awaitIdentPos;var Qe=this.startNodeAt(Ae,Ne);if(Qe.callee=i,Qe.arguments=ze,Oe)Qe.optional=Me;i=this.finishNode(Qe,"CallExpression")}else if(this.type===We.backQuote){if(Me||Re)this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var rt=this.startNodeAt(Ae,Ne);rt.tag=i,rt.quasi=this.parseTemplate({isTagged:!0}),i=this.finishNode(rt,"TaggedTemplateExpression")}return i};ft.parseExprAtom=function(i,Ae,Ne){if(this.type===We.slash)this.readRegexp();var _e,De=this.potentialArrowAt===this.start;switch(this.type){case We._super:if(!this.allowSuper)this.raise(this.start,"'super' keyword outside a method");if(_e=this.startNode(),this.next(),this.type===We.parenL&&!this.allowDirectSuper)this.raise(_e.start,"super() call outside constructor of a subclass");if(this.type!==We.dot&&this.type!==We.bracketL&&this.type!==We.parenL)this.unexpected();return this.finishNode(_e,"Super");case We._this:return _e=this.startNode(),this.next(),this.finishNode(_e,"ThisExpression");case We.name:var Re=this.start,Ie=this.startLoc,Oe=this.containsEsc,Me=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!Oe&&Me.name==="async"&&!this.canInsertSemicolon()&&this.eat(We._function))return this.overrideContext(wt.f_expr),this.parseFunction(this.startNodeAt(Re,Ie),0,!1,!0,Ae);if(De&&!this.canInsertSemicolon()){if(this.eat(We.arrow))return this.parseArrowExpression(this.startNodeAt(Re,Ie),[Me],!1,Ae);if(this.options.ecmaVersion>=8&&Me.name==="async"&&this.type===We.name&&!Oe&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc)){if(Me=this.parseIdent(!1),this.canInsertSemicolon()||!this.eat(We.arrow))this.unexpected();return this.parseArrowExpression(this.startNodeAt(Re,Ie),[Me],!0,Ae)}}return Me;case We.regexp:var Fe=this.value;return _e=this.parseLiteral(Fe.value),_e.regex={pattern:Fe.pattern,flags:Fe.flags},_e;case We.num:case We.string:return this.parseLiteral(this.value);case We._null:case We._true:case We._false:return _e=this.startNode(),_e.value=this.type===We._null?null:this.type===We._true,_e.raw=this.type.keyword,this.next(),this.finishNode(_e,"Literal");case We.parenL:var Be=this.start,Ve=this.parseParenAndDistinguishExpression(De,Ae);if(i){if(i.parenthesizedAssign<0&&!this.isSimpleAssignTarget(Ve))i.parenthesizedAssign=Be;if(i.parenthesizedBind<0)i.parenthesizedBind=Be}return Ve;case We.bracketL:return _e=this.startNode(),this.next(),_e.elements=this.parseExprList(We.bracketR,!0,!0,i),this.finishNode(_e,"ArrayExpression");case We.braceL:return this.overrideContext(wt.b_expr),this.parseObj(!1,i);case We._function:return _e=this.startNode(),this.next(),this.parseFunction(_e,0);case We._class:return this.parseClass(this.startNode(),!1);case We._new:return this.parseNew();case We.backQuote:return this.parseTemplate();case We._import:if(this.options.ecmaVersion>=11)return this.parseExprImport(Ne);else return this.unexpected();default:return this.parseExprAtomDefault()}};ft.parseExprAtomDefault=function(){this.unexpected()};ft.parseExprImport=function(i){var Ae=this.startNode();if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword import");if(this.next(),this.type===We.parenL&&!i)return this.parseDynamicImport(Ae);else if(this.type===We.dot){var Ne=this.startNodeAt(Ae.start,Ae.loc&&Ae.loc.start);return Ne.name="import",Ae.meta=this.finishNode(Ne,"Identifier"),this.parseImportMeta(Ae)}else this.unexpected()};ft.parseDynamicImport=function(i){if(this.next(),i.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)if(!this.eat(We.parenR))if(this.expect(We.comma),!this.afterTrailingComma(We.parenR)){if(i.options=this.parseMaybeAssign(),!this.eat(We.parenR)){if(this.expect(We.comma),!this.afterTrailingComma(We.parenR))this.unexpected()}}else i.options=null;else i.options=null;else if(!this.eat(We.parenR)){var Ae=this.start;if(this.eat(We.comma)&&this.eat(We.parenR))this.raiseRecoverable(Ae,"Trailing comma is not allowed in import()");else this.unexpected(Ae)}return this.finishNode(i,"ImportExpression")};ft.parseImportMeta=function(i){this.next();var Ae=this.containsEsc;if(i.property=this.parseIdent(!0),i.property.name!=="meta")this.raiseRecoverable(i.property.start,"The only valid meta property for import is 'import.meta'");if(Ae)this.raiseRecoverable(i.start,"'import.meta' must not contain escaped characters");if(this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere)this.raiseRecoverable(i.start,"Cannot use 'import.meta' outside a module");return this.finishNode(i,"MetaProperty")};ft.parseLiteral=function(i){var Ae=this.startNode();if(Ae.value=i,Ae.raw=this.input.slice(this.start,this.end),Ae.raw.charCodeAt(Ae.raw.length-1)===110)Ae.bigint=Ae.value!=null?Ae.value.toString():Ae.raw.slice(0,-1).replace(/_/g,"");return this.next(),this.finishNode(Ae,"Literal")};ft.parseParenExpression=function(){this.expect(We.parenL);var i=this.parseExpression();return this.expect(We.parenR),i};ft.shouldParseArrow=function(i){return!this.canInsertSemicolon()};ft.parseParenAndDistinguishExpression=function(i,Ae){var Ne=this.start,_e=this.startLoc,De,Re=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var Ie=this.start,Oe=this.startLoc,Me=[],Fe=!0,Be=!1,Ve=new ts,Ge=this.yieldPos,Ue=this.awaitPos,Xe;this.yieldPos=0,this.awaitPos=0;while(this.type!==We.parenR)if(Fe?Fe=!1:this.expect(We.comma),Re&&this.afterTrailingComma(We.parenR,!0)){Be=!0;break}else if(this.type===We.ellipsis){if(Xe=this.start,Me.push(this.parseParenItem(this.parseRestBinding())),this.type===We.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else Me.push(this.parseMaybeAssign(!1,Ve,this.parseParenItem));var ze=this.lastTokEnd,Qe=this.lastTokEndLoc;if(this.expect(We.parenR),i&&this.shouldParseArrow(Me)&&this.eat(We.arrow))return this.checkPatternErrors(Ve,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=Ge,this.awaitPos=Ue,this.parseParenArrowList(Ne,_e,Me,Ae);if(!Me.length||Be)this.unexpected(this.lastTokStart);if(Xe)this.unexpected(Xe);if(this.checkExpressionErrors(Ve,!0),this.yieldPos=Ge||this.yieldPos,this.awaitPos=Ue||this.awaitPos,Me.length>1)De=this.startNodeAt(Ie,Oe),De.expressions=Me,this.finishNodeAt(De,"SequenceExpression",ze,Qe);else De=Me[0]}else De=this.parseParenExpression();if(this.options.preserveParens){var rt=this.startNodeAt(Ne,_e);return rt.expression=De,this.finishNode(rt,"ParenthesizedExpression")}else return De};ft.parseParenItem=function(i){return i};ft.parseParenArrowList=function(i,Ae,Ne,_e){return this.parseArrowExpression(this.startNodeAt(i,Ae),Ne,!1,_e)};var sd=[];ft.parseNew=function(){if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword new");var i=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===We.dot){var Ae=this.startNodeAt(i.start,i.loc&&i.loc.start);Ae.name="new",i.meta=this.finishNode(Ae,"Identifier"),this.next();var Ne=this.containsEsc;if(i.property=this.parseIdent(!0),i.property.name!=="target")this.raiseRecoverable(i.property.start,"The only valid meta property for new is 'new.target'");if(Ne)this.raiseRecoverable(i.start,"'new.target' must not contain escaped characters");if(!this.allowNewDotTarget)this.raiseRecoverable(i.start,"'new.target' can only be used in functions and class static block");return this.finishNode(i,"MetaProperty")}var _e=this.start,De=this.startLoc;if(i.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),_e,De,!0,!1),i.callee.type==="Super")this.raiseRecoverable(_e,"Invalid use of 'super'");if(this.eat(We.parenL))i.arguments=this.parseExprList(We.parenR,this.options.ecmaVersion>=8,!1);else i.arguments=sd;return this.finishNode(i,"NewExpression")};ft.parseTemplateElement=function(i){var Ae=i.isTagged,Ne=this.startNode();if(this.type===We.invalidTemplate){if(!Ae)this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal");Ne.value={raw:this.value.replace(/\r\n?/g,`
|
|
4
|
-
`),cooked:null}}else Ne.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
|
|
5
|
-
`),cooked:this.value};return this.next(),Ne.tail=this.type===We.backQuote,this.finishNode(Ne,"TemplateElement")};ft.parseTemplate=function(i){if(i===void 0)i={};var Ae=i.isTagged;if(Ae===void 0)Ae=!1;var Ne=this.startNode();this.next(),Ne.expressions=[];var _e=this.parseTemplateElement({isTagged:Ae});Ne.quasis=[_e];while(!_e.tail){if(this.type===We.eof)this.raise(this.pos,"Unterminated template literal");this.expect(We.dollarBraceL),Ne.expressions.push(this.parseExpression()),this.expect(We.braceR),Ne.quasis.push(_e=this.parseTemplateElement({isTagged:Ae}))}return this.next(),this.finishNode(Ne,"TemplateLiteral")};ft.isAsyncProp=function(i){return!i.computed&&i.key.type==="Identifier"&&i.key.name==="async"&&(this.type===We.name||this.type===We.num||this.type===We.string||this.type===We.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===We.star)&&!Ht.test(this.input.slice(this.lastTokEnd,this.start))};ft.parseObj=function(i,Ae){var Ne=this.startNode(),_e=!0,De={};Ne.properties=[],this.next();while(!this.eat(We.braceR)){if(!_e){if(this.expect(We.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(We.braceR))break}else _e=!1;var Re=this.parseProperty(i,Ae);if(!i)this.checkPropClash(Re,De,Ae);Ne.properties.push(Re)}return this.finishNode(Ne,i?"ObjectPattern":"ObjectExpression")};ft.parseProperty=function(i,Ae){var Ne=this.startNode(),_e,De,Re,Ie;if(this.options.ecmaVersion>=9&&this.eat(We.ellipsis)){if(i){if(Ne.argument=this.parseIdent(!1),this.type===We.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");return this.finishNode(Ne,"RestElement")}if(Ne.argument=this.parseMaybeAssign(!1,Ae),this.type===We.comma&&Ae&&Ae.trailingComma<0)Ae.trailingComma=this.start;return this.finishNode(Ne,"SpreadElement")}if(this.options.ecmaVersion>=6){if(Ne.method=!1,Ne.shorthand=!1,i||Ae)Re=this.start,Ie=this.startLoc;if(!i)_e=this.eat(We.star)}var Oe=this.containsEsc;if(this.parsePropertyName(Ne),!i&&!Oe&&this.options.ecmaVersion>=8&&!_e&&this.isAsyncProp(Ne))De=!0,_e=this.options.ecmaVersion>=9&&this.eat(We.star),this.parsePropertyName(Ne);else De=!1;return this.parsePropertyValue(Ne,i,_e,De,Re,Ie,Ae,Oe),this.finishNode(Ne,"Property")};ft.parseGetterSetter=function(i){var Ae=i.key.name;this.parsePropertyName(i),i.value=this.parseMethod(!1),i.kind=Ae;var Ne=i.kind==="get"?0:1;if(i.value.params.length!==Ne){var _e=i.value.start;if(i.kind==="get")this.raiseRecoverable(_e,"getter should have no params");else this.raiseRecoverable(_e,"setter should have exactly one param")}else if(i.kind==="set"&&i.value.params[0].type==="RestElement")this.raiseRecoverable(i.value.params[0].start,"Setter cannot use rest params")};ft.parsePropertyValue=function(i,Ae,Ne,_e,De,Re,Ie,Oe){if((Ne||_e)&&this.type===We.colon)this.unexpected();if(this.eat(We.colon))i.value=Ae?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,Ie),i.kind="init";else if(this.options.ecmaVersion>=6&&this.type===We.parenL){if(Ae)this.unexpected();i.method=!0,i.value=this.parseMethod(Ne,_e),i.kind="init"}else if(!Ae&&!Oe&&this.options.ecmaVersion>=5&&!i.computed&&i.key.type==="Identifier"&&(i.key.name==="get"||i.key.name==="set")&&(this.type!==We.comma&&this.type!==We.braceR&&this.type!==We.eq)){if(Ne||_e)this.unexpected();this.parseGetterSetter(i)}else if(this.options.ecmaVersion>=6&&!i.computed&&i.key.type==="Identifier"){if(Ne||_e)this.unexpected();if(this.checkUnreserved(i.key),i.key.name==="await"&&!this.awaitIdentPos)this.awaitIdentPos=De;if(Ae)i.value=this.parseMaybeDefault(De,Re,this.copyNode(i.key));else if(this.type===We.eq&&Ie){if(Ie.shorthandAssign<0)Ie.shorthandAssign=this.start;i.value=this.parseMaybeDefault(De,Re,this.copyNode(i.key))}else i.value=this.copyNode(i.key);i.kind="init",i.shorthand=!0}else this.unexpected()};ft.parsePropertyName=function(i){if(this.options.ecmaVersion>=6)if(this.eat(We.bracketL))return i.computed=!0,i.key=this.parseMaybeAssign(),this.expect(We.bracketR),i.key;else i.computed=!1;return i.key=this.type===We.num||this.type===We.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};ft.initFunction=function(i){if(i.id=null,this.options.ecmaVersion>=6)i.generator=i.expression=!1;if(this.options.ecmaVersion>=8)i.async=!1};ft.parseMethod=function(i,Ae,Ne){var _e=this.startNode(),De=this.yieldPos,Re=this.awaitPos,Ie=this.awaitIdentPos;if(this.initFunction(_e),this.options.ecmaVersion>=6)_e.generator=i;if(this.options.ecmaVersion>=8)_e.async=!!Ae;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(gi(Ae,_e.generator)|Zr|(Ne?Ea:0)),this.expect(We.parenL),_e.params=this.parseBindingList(We.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(_e,!1,!0,!1),this.yieldPos=De,this.awaitPos=Re,this.awaitIdentPos=Ie,this.finishNode(_e,"FunctionExpression")};ft.parseArrowExpression=function(i,Ae,Ne,_e){var De=this.yieldPos,Re=this.awaitPos,Ie=this.awaitIdentPos;if(this.enterScope(gi(Ne,!1)|yi),this.initFunction(i),this.options.ecmaVersion>=8)i.async=!!Ne;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,i.params=this.toAssignableList(Ae,!0),this.parseFunctionBody(i,!0,!1,_e),this.yieldPos=De,this.awaitPos=Re,this.awaitIdentPos=Ie,this.finishNode(i,"ArrowFunctionExpression")};ft.parseFunctionBody=function(i,Ae,Ne,_e){var De=Ae&&this.type!==We.braceL,Re=this.strict,Ie=!1;if(De)i.body=this.parseMaybeAssign(_e),i.expression=!0,this.checkParams(i,!1);else{var Oe=this.options.ecmaVersion>=7&&!this.isSimpleParamList(i.params);if(!Re||Oe){if(Ie=this.strictDirective(this.end),Ie&&Oe)this.raiseRecoverable(i.start,"Illegal 'use strict' directive in function with non-simple parameter list")}var Me=this.labels;if(this.labels=[],Ie)this.strict=!0;if(this.checkParams(i,!Re&&!Ie&&!Ae&&!Ne&&this.isSimpleParamList(i.params)),this.strict&&i.id)this.checkLValSimple(i.id,Ta);i.body=this.parseBlock(!1,void 0,Ie&&!Re),i.expression=!1,this.adaptDirectivePrologue(i.body.body),this.labels=Me}this.exitScope()};ft.isSimpleParamList=function(i){for(var Ae=0,Ne=i;Ae<Ne.length;Ae+=1){var _e=Ne[Ae];if(_e.type!=="Identifier")return!1}return!0};ft.checkParams=function(i,Ae){var Ne=Object.create(null);for(var _e=0,De=i.params;_e<De.length;_e+=1){var Re=De[_e];this.checkLValInnerPattern(Re,xi,Ae?null:Ne)}};ft.parseExprList=function(i,Ae,Ne,_e){var De=[],Re=!0;while(!this.eat(i)){if(!Re){if(this.expect(We.comma),Ae&&this.afterTrailingComma(i))break}else Re=!1;var Ie=void 0;if(Ne&&this.type===We.comma)Ie=null;else if(this.type===We.ellipsis){if(Ie=this.parseSpread(_e),_e&&this.type===We.comma&&_e.trailingComma<0)_e.trailingComma=this.start}else Ie=this.parseMaybeAssign(!1,_e);De.push(Ie)}return De};ft.checkUnreserved=function(i){var{start:Ae,end:Ne,name:_e}=i;if(this.inGenerator&&_e==="yield")this.raiseRecoverable(Ae,"Cannot use 'yield' as identifier inside a generator");if(this.inAsync&&_e==="await")this.raiseRecoverable(Ae,"Cannot use 'await' as identifier inside an async function");if(!(this.currentThisScope().flags&es)&&_e==="arguments")this.raiseRecoverable(Ae,"Cannot use 'arguments' in class field initializer");if(this.inClassStaticBlock&&(_e==="arguments"||_e==="await"))this.raise(Ae,"Cannot use "+_e+" in class static initialization block");if(this.keywords.test(_e))this.raise(Ae,"Unexpected keyword '"+_e+"'");if(this.options.ecmaVersion<6&&this.input.slice(Ae,Ne).indexOf("\\")!==-1)return;var De=this.strict?this.reservedWordsStrict:this.reservedWords;if(De.test(_e)){if(!this.inAsync&&_e==="await")this.raiseRecoverable(Ae,"Cannot use keyword 'await' outside an async function");this.raiseRecoverable(Ae,"The keyword '"+_e+"' is reserved")}};ft.parseIdent=function(i){var Ae=this.parseIdentNode();if(this.next(!!i),this.finishNode(Ae,"Identifier"),!i){if(this.checkUnreserved(Ae),Ae.name==="await"&&!this.awaitIdentPos)this.awaitIdentPos=Ae.start}return Ae};ft.parseIdentNode=function(){var i=this.startNode();if(this.type===We.name)i.name=this.value;else if(this.type.keyword){if(i.name=this.type.keyword,(i.name==="class"||i.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46))this.context.pop();this.type=We.name}else this.unexpected();return i};ft.parsePrivateIdent=function(){var i=this.startNode();if(this.type===We.privateId)i.name=this.value;else this.unexpected();if(this.next(),this.finishNode(i,"PrivateIdentifier"),this.options.checkPrivateFields)if(this.privateNameStack.length===0)this.raise(i.start,"Private field '#"+i.name+"' must be declared in an enclosing class");else this.privateNameStack[this.privateNameStack.length-1].used.push(i);return i};ft.parseYield=function(i){if(!this.yieldPos)this.yieldPos=this.start;var Ae=this.startNode();if(this.next(),this.type===We.semi||this.canInsertSemicolon()||this.type!==We.star&&!this.type.startsExpr)Ae.delegate=!1,Ae.argument=null;else Ae.delegate=this.eat(We.star),Ae.argument=this.parseMaybeAssign(i);return this.finishNode(Ae,"YieldExpression")};ft.parseAwait=function(i){if(!this.awaitPos)this.awaitPos=this.start;var Ae=this.startNode();return this.next(),Ae.argument=this.parseMaybeUnary(null,!0,!1,i),this.finishNode(Ae,"AwaitExpression")};var Jr=Pt.prototype;Jr.raise=function(i,Ae){var Ne=hi(this.input,i);if(Ae+=" ("+Ne.line+":"+Ne.column+")",this.sourceFile)Ae+=" in "+this.sourceFile;var _e=SyntaxError(Ae);throw _e.pos=i,_e.loc=Ne,_e.raisedAt=this.pos,_e};Jr.raiseRecoverable=Jr.raise;Jr.curPosition=function(){if(this.options.locations)return new Zn(this.curLine,this.pos-this.lineStart)};var On=Pt.prototype,id=function(Ae){this.flags=Ae,this.var=[],this.lexical=[],this.functions=[]};On.enterScope=function(i){this.scopeStack.push(new id(i))};On.exitScope=function(){this.scopeStack.pop()};On.treatFunctionsAsVarInScope=function(i){return i.flags&Gn||!this.inModule&&i.flags&Wn};On.declareName=function(i,Ae,Ne){var _e=!1;if(Ae===An){var De=this.currentScope();if(_e=De.lexical.indexOf(i)>-1||De.functions.indexOf(i)>-1||De.var.indexOf(i)>-1,De.lexical.push(i),this.inModule&&De.flags&Wn)delete this.undefinedExports[i]}else if(Ae===va){var Re=this.currentScope();Re.lexical.push(i)}else if(Ae===Sa){var Ie=this.currentScope();if(this.treatFunctionsAsVar)_e=Ie.lexical.indexOf(i)>-1;else _e=Ie.lexical.indexOf(i)>-1||Ie.var.indexOf(i)>-1;Ie.functions.push(i)}else for(var Oe=this.scopeStack.length-1;Oe>=0;--Oe){var Me=this.scopeStack[Oe];if(Me.lexical.indexOf(i)>-1&&!(Me.flags&ba&&Me.lexical[0]===i)||!this.treatFunctionsAsVarInScope(Me)&&Me.functions.indexOf(i)>-1){_e=!0;break}if(Me.var.push(i),this.inModule&&Me.flags&Wn)delete this.undefinedExports[i];if(Me.flags&es)break}if(_e)this.raiseRecoverable(Ne,"Identifier '"+i+"' has already been declared")};On.checkLocalExport=function(i){if(this.scopeStack[0].lexical.indexOf(i.name)===-1&&this.scopeStack[0].var.indexOf(i.name)===-1)this.undefinedExports[i.name]=i};On.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};On.currentVarScope=function(){for(var i=this.scopeStack.length-1;;i--){var Ae=this.scopeStack[i];if(Ae.flags&(es|Er|Un))return Ae}};On.currentThisScope=function(){for(var i=this.scopeStack.length-1;;i--){var Ae=this.scopeStack[i];if(Ae.flags&(es|Er|Un)&&!(Ae.flags&yi))return Ae}};var Cr=function(Ae,Ne,_e){if(this.type="",this.start=Ne,this.end=0,Ae.options.locations)this.loc=new br(Ae,_e);if(Ae.options.directSourceFile)this.sourceFile=Ae.options.directSourceFile;if(Ae.options.ranges)this.range=[Ne,0]},Sr=Pt.prototype;Sr.startNode=function(){return new Cr(this,this.start,this.startLoc)};Sr.startNodeAt=function(i,Ae){return new Cr(this,i,Ae)};function wa(i,Ae,Ne,_e){if(i.type=Ae,i.end=Ne,this.options.locations)i.loc.end=_e;if(this.options.ranges)i.range[1]=Ne;return i}Sr.finishNode=function(i,Ae){return wa.call(this,i,Ae,this.lastTokEnd,this.lastTokEndLoc)};Sr.finishNodeAt=function(i,Ae,Ne,_e){return wa.call(this,i,Ae,Ne,_e)};Sr.copyNode=function(i){var Ae=new Cr(this,i.start,this.startLoc);for(var Ne in i)Ae[Ne]=i[Ne];return Ae};var od="Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz",Pa="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",Na=Pa+" Extended_Pictographic",_a=Na,Da=_a+" EBase EComp EMod EPres ExtPict",Ia=Da,ad=Ia,cd={9:Pa,10:Na,11:_a,12:Da,13:Ia,14:ad},ld="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",pd={9:"",10:"",11:"",12:"",13:"",14:ld},ua="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",Ra="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",La=Ra+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",Oa=La+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",Ma=Oa+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",$a=Ma+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",ud=$a+" "+od,dd={9:Ra,10:La,11:Oa,12:Ma,13:$a,14:ud},Ba={};function fd(i){var Ae=Ba[i]={binary:Ln(cd[i]+" "+ua),binaryOfStrings:Ln(pd[i]),nonBinary:{General_Category:Ln(ua),Script:Ln(dd[i])}};Ae.nonBinary.Script_Extensions=Ae.nonBinary.Script,Ae.nonBinary.gc=Ae.nonBinary.General_Category,Ae.nonBinary.sc=Ae.nonBinary.Script,Ae.nonBinary.scx=Ae.nonBinary.Script_Extensions}for(gr=0,Hr=[9,10,11,12,13,14];gr<Hr.length;gr+=1)di=Hr[gr],fd(di);var di,gr,Hr,at=Pt.prototype,Yr=function(Ae,Ne){this.parent=Ae,this.base=Ne||this};Yr.prototype.separatedFrom=function(Ae){for(var Ne=this;Ne;Ne=Ne.parent)for(var _e=Ae;_e;_e=_e.parent)if(Ne.base===_e.base&&Ne!==_e)return!0;return!1};Yr.prototype.sibling=function(){return new Yr(this.parent,this.base)};var hn=function(Ae){this.parser=Ae,this.validFlags="gim"+(Ae.options.ecmaVersion>=6?"uy":"")+(Ae.options.ecmaVersion>=9?"s":"")+(Ae.options.ecmaVersion>=13?"d":"")+(Ae.options.ecmaVersion>=15?"v":""),this.unicodeProperties=Ba[Ae.options.ecmaVersion>=14?14:Ae.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};hn.prototype.reset=function(Ae,Ne,_e){var De=_e.indexOf("v")!==-1,Re=_e.indexOf("u")!==-1;if(this.start=Ae|0,this.source=Ne+"",this.flags=_e,De&&this.parser.options.ecmaVersion>=15)this.switchU=!0,this.switchV=!0,this.switchN=!0;else this.switchU=Re&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=Re&&this.parser.options.ecmaVersion>=9};hn.prototype.raise=function(Ae){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+Ae)};hn.prototype.at=function(Ae,Ne){if(Ne===void 0)Ne=!1;var _e=this.source,De=_e.length;if(Ae>=De)return-1;var Re=_e.charCodeAt(Ae);if(!(Ne||this.switchU)||Re<=55295||Re>=57344||Ae+1>=De)return Re;var Ie=_e.charCodeAt(Ae+1);return Ie>=56320&&Ie<=57343?(Re<<10)+Ie-56613888:Re};hn.prototype.nextIndex=function(Ae,Ne){if(Ne===void 0)Ne=!1;var _e=this.source,De=_e.length;if(Ae>=De)return De;var Re=_e.charCodeAt(Ae),Ie;if(!(Ne||this.switchU)||Re<=55295||Re>=57344||Ae+1>=De||(Ie=_e.charCodeAt(Ae+1))<56320||Ie>57343)return Ae+1;return Ae+2};hn.prototype.current=function(Ae){if(Ae===void 0)Ae=!1;return this.at(this.pos,Ae)};hn.prototype.lookahead=function(Ae){if(Ae===void 0)Ae=!1;return this.at(this.nextIndex(this.pos,Ae),Ae)};hn.prototype.advance=function(Ae){if(Ae===void 0)Ae=!1;this.pos=this.nextIndex(this.pos,Ae)};hn.prototype.eat=function(Ae,Ne){if(Ne===void 0)Ne=!1;if(this.current(Ne)===Ae)return this.advance(Ne),!0;return!1};hn.prototype.eatChars=function(Ae,Ne){if(Ne===void 0)Ne=!1;var _e=this.pos;for(var De=0,Re=Ae;De<Re.length;De+=1){var Ie=Re[De],Oe=this.at(_e,Ne);if(Oe===-1||Oe!==Ie)return!1;_e=this.nextIndex(_e,Ne)}return this.pos=_e,!0};at.validateRegExpFlags=function(i){var{validFlags:Ae,flags:Ne}=i,_e=!1,De=!1;for(var Re=0;Re<Ne.length;Re++){var Ie=Ne.charAt(Re);if(Ae.indexOf(Ie)===-1)this.raise(i.start,"Invalid regular expression flag");if(Ne.indexOf(Ie,Re+1)>-1)this.raise(i.start,"Duplicate regular expression flag");if(Ie==="u")_e=!0;if(Ie==="v")De=!0}if(this.options.ecmaVersion>=15&&_e&&De)this.raise(i.start,"Invalid regular expression flag")};function hd(i){for(var Ae in i)return!0;return!1}at.validateRegExpPattern=function(i){if(this.regexp_pattern(i),!i.switchN&&this.options.ecmaVersion>=9&&hd(i.groupNames))i.switchN=!0,this.regexp_pattern(i)};at.regexp_pattern=function(i){if(i.pos=0,i.lastIntValue=0,i.lastStringValue="",i.lastAssertionIsQuantifiable=!1,i.numCapturingParens=0,i.maxBackReference=0,i.groupNames=Object.create(null),i.backReferenceNames.length=0,i.branchID=null,this.regexp_disjunction(i),i.pos!==i.source.length){if(i.eat(41))i.raise("Unmatched ')'");if(i.eat(93)||i.eat(125))i.raise("Lone quantifier brackets")}if(i.maxBackReference>i.numCapturingParens)i.raise("Invalid escape");for(var Ae=0,Ne=i.backReferenceNames;Ae<Ne.length;Ae+=1){var _e=Ne[Ae];if(!i.groupNames[_e])i.raise("Invalid named capture referenced")}};at.regexp_disjunction=function(i){var Ae=this.options.ecmaVersion>=16;if(Ae)i.branchID=new Yr(i.branchID,null);this.regexp_alternative(i);while(i.eat(124)){if(Ae)i.branchID=i.branchID.sibling();this.regexp_alternative(i)}if(Ae)i.branchID=i.branchID.parent;if(this.regexp_eatQuantifier(i,!0))i.raise("Nothing to repeat");if(i.eat(123))i.raise("Lone quantifier brackets")};at.regexp_alternative=function(i){while(i.pos<i.source.length&&this.regexp_eatTerm(i));};at.regexp_eatTerm=function(i){if(this.regexp_eatAssertion(i)){if(i.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(i)){if(i.switchU)i.raise("Invalid quantifier")}return!0}if(i.switchU?this.regexp_eatAtom(i):this.regexp_eatExtendedAtom(i))return this.regexp_eatQuantifier(i),!0;return!1};at.regexp_eatAssertion=function(i){var Ae=i.pos;if(i.lastAssertionIsQuantifiable=!1,i.eat(94)||i.eat(36))return!0;if(i.eat(92)){if(i.eat(66)||i.eat(98))return!0;i.pos=Ae}if(i.eat(40)&&i.eat(63)){var Ne=!1;if(this.options.ecmaVersion>=9)Ne=i.eat(60);if(i.eat(61)||i.eat(33)){if(this.regexp_disjunction(i),!i.eat(41))i.raise("Unterminated group");return i.lastAssertionIsQuantifiable=!Ne,!0}}return i.pos=Ae,!1};at.regexp_eatQuantifier=function(i,Ae){if(Ae===void 0)Ae=!1;if(this.regexp_eatQuantifierPrefix(i,Ae))return i.eat(63),!0;return!1};at.regexp_eatQuantifierPrefix=function(i,Ae){return i.eat(42)||i.eat(43)||i.eat(63)||this.regexp_eatBracedQuantifier(i,Ae)};at.regexp_eatBracedQuantifier=function(i,Ae){var Ne=i.pos;if(i.eat(123)){var _e=0,De=-1;if(this.regexp_eatDecimalDigits(i)){if(_e=i.lastIntValue,i.eat(44)&&this.regexp_eatDecimalDigits(i))De=i.lastIntValue;if(i.eat(125)){if(De!==-1&&De<_e&&!Ae)i.raise("numbers out of order in {} quantifier");return!0}}if(i.switchU&&!Ae)i.raise("Incomplete quantifier");i.pos=Ne}return!1};at.regexp_eatAtom=function(i){return this.regexp_eatPatternCharacters(i)||i.eat(46)||this.regexp_eatReverseSolidusAtomEscape(i)||this.regexp_eatCharacterClass(i)||this.regexp_eatUncapturingGroup(i)||this.regexp_eatCapturingGroup(i)};at.regexp_eatReverseSolidusAtomEscape=function(i){var Ae=i.pos;if(i.eat(92)){if(this.regexp_eatAtomEscape(i))return!0;i.pos=Ae}return!1};at.regexp_eatUncapturingGroup=function(i){var Ae=i.pos;if(i.eat(40)){if(i.eat(63)){if(this.options.ecmaVersion>=16){var Ne=this.regexp_eatModifiers(i),_e=i.eat(45);if(Ne||_e){for(var De=0;De<Ne.length;De++){var Re=Ne.charAt(De);if(Ne.indexOf(Re,De+1)>-1)i.raise("Duplicate regular expression modifiers")}if(_e){var Ie=this.regexp_eatModifiers(i);if(!Ne&&!Ie&&i.current()===58)i.raise("Invalid regular expression modifiers");for(var Oe=0;Oe<Ie.length;Oe++){var Me=Ie.charAt(Oe);if(Ie.indexOf(Me,Oe+1)>-1||Ne.indexOf(Me)>-1)i.raise("Duplicate regular expression modifiers")}}}}if(i.eat(58)){if(this.regexp_disjunction(i),i.eat(41))return!0;i.raise("Unterminated group")}}i.pos=Ae}return!1};at.regexp_eatCapturingGroup=function(i){if(i.eat(40)){if(this.options.ecmaVersion>=9)this.regexp_groupSpecifier(i);else if(i.current()===63)i.raise("Invalid group");if(this.regexp_disjunction(i),i.eat(41))return i.numCapturingParens+=1,!0;i.raise("Unterminated group")}return!1};at.regexp_eatModifiers=function(i){var Ae="",Ne=0;while((Ne=i.current())!==-1&&md(Ne))Ae+=Tn(Ne),i.advance();return Ae};function md(i){return i===105||i===109||i===115}at.regexp_eatExtendedAtom=function(i){return i.eat(46)||this.regexp_eatReverseSolidusAtomEscape(i)||this.regexp_eatCharacterClass(i)||this.regexp_eatUncapturingGroup(i)||this.regexp_eatCapturingGroup(i)||this.regexp_eatInvalidBracedQuantifier(i)||this.regexp_eatExtendedPatternCharacter(i)};at.regexp_eatInvalidBracedQuantifier=function(i){if(this.regexp_eatBracedQuantifier(i,!0))i.raise("Nothing to repeat");return!1};at.regexp_eatSyntaxCharacter=function(i){var Ae=i.current();if(Fa(Ae))return i.lastIntValue=Ae,i.advance(),!0;return!1};function Fa(i){return i===36||i>=40&&i<=43||i===46||i===63||i>=91&&i<=94||i>=123&&i<=125}at.regexp_eatPatternCharacters=function(i){var Ae=i.pos,Ne=0;while((Ne=i.current())!==-1&&!Fa(Ne))i.advance();return i.pos!==Ae};at.regexp_eatExtendedPatternCharacter=function(i){var Ae=i.current();if(Ae!==-1&&Ae!==36&&!(Ae>=40&&Ae<=43)&&Ae!==46&&Ae!==63&&Ae!==91&&Ae!==94&&Ae!==124)return i.advance(),!0;return!1};at.regexp_groupSpecifier=function(i){if(i.eat(63)){if(!this.regexp_eatGroupName(i))i.raise("Invalid group");var Ae=this.options.ecmaVersion>=16,Ne=i.groupNames[i.lastStringValue];if(Ne)if(Ae)for(var _e=0,De=Ne;_e<De.length;_e+=1){var Re=De[_e];if(!Re.separatedFrom(i.branchID))i.raise("Duplicate capture group name")}else i.raise("Duplicate capture group name");if(Ae)(Ne||(i.groupNames[i.lastStringValue]=[])).push(i.branchID);else i.groupNames[i.lastStringValue]=!0}};at.regexp_eatGroupName=function(i){if(i.lastStringValue="",i.eat(60)){if(this.regexp_eatRegExpIdentifierName(i)&&i.eat(62))return!0;i.raise("Invalid capture group name")}return!1};at.regexp_eatRegExpIdentifierName=function(i){if(i.lastStringValue="",this.regexp_eatRegExpIdentifierStart(i)){i.lastStringValue+=Tn(i.lastIntValue);while(this.regexp_eatRegExpIdentifierPart(i))i.lastStringValue+=Tn(i.lastIntValue);return!0}return!1};at.regexp_eatRegExpIdentifierStart=function(i){var Ae=i.pos,Ne=this.options.ecmaVersion>=11,_e=i.current(Ne);if(i.advance(Ne),_e===92&&this.regexp_eatRegExpUnicodeEscapeSequence(i,Ne))_e=i.lastIntValue;if(yd(_e))return i.lastIntValue=_e,!0;return i.pos=Ae,!1};function yd(i){return Ut(i,!0)||i===36||i===95}at.regexp_eatRegExpIdentifierPart=function(i){var Ae=i.pos,Ne=this.options.ecmaVersion>=11,_e=i.current(Ne);if(i.advance(Ne),_e===92&&this.regexp_eatRegExpUnicodeEscapeSequence(i,Ne))_e=i.lastIntValue;if(gd(_e))return i.lastIntValue=_e,!0;return i.pos=Ae,!1};function gd(i){return Qt(i,!0)||i===36||i===95||i===8204||i===8205}at.regexp_eatAtomEscape=function(i){if(this.regexp_eatBackReference(i)||this.regexp_eatCharacterClassEscape(i)||this.regexp_eatCharacterEscape(i)||i.switchN&&this.regexp_eatKGroupName(i))return!0;if(i.switchU){if(i.current()===99)i.raise("Invalid unicode escape");i.raise("Invalid escape")}return!1};at.regexp_eatBackReference=function(i){var Ae=i.pos;if(this.regexp_eatDecimalEscape(i)){var Ne=i.lastIntValue;if(i.switchU){if(Ne>i.maxBackReference)i.maxBackReference=Ne;return!0}if(Ne<=i.numCapturingParens)return!0;i.pos=Ae}return!1};at.regexp_eatKGroupName=function(i){if(i.eat(107)){if(this.regexp_eatGroupName(i))return i.backReferenceNames.push(i.lastStringValue),!0;i.raise("Invalid named reference")}return!1};at.regexp_eatCharacterEscape=function(i){return this.regexp_eatControlEscape(i)||this.regexp_eatCControlLetter(i)||this.regexp_eatZero(i)||this.regexp_eatHexEscapeSequence(i)||this.regexp_eatRegExpUnicodeEscapeSequence(i,!1)||!i.switchU&&this.regexp_eatLegacyOctalEscapeSequence(i)||this.regexp_eatIdentityEscape(i)};at.regexp_eatCControlLetter=function(i){var Ae=i.pos;if(i.eat(99)){if(this.regexp_eatControlLetter(i))return!0;i.pos=Ae}return!1};at.regexp_eatZero=function(i){if(i.current()===48&&!ns(i.lookahead()))return i.lastIntValue=0,i.advance(),!0;return!1};at.regexp_eatControlEscape=function(i){var Ae=i.current();if(Ae===116)return i.lastIntValue=9,i.advance(),!0;if(Ae===110)return i.lastIntValue=10,i.advance(),!0;if(Ae===118)return i.lastIntValue=11,i.advance(),!0;if(Ae===102)return i.lastIntValue=12,i.advance(),!0;if(Ae===114)return i.lastIntValue=13,i.advance(),!0;return!1};at.regexp_eatControlLetter=function(i){var Ae=i.current();if(ja(Ae))return i.lastIntValue=Ae%32,i.advance(),!0;return!1};function ja(i){return i>=65&&i<=90||i>=97&&i<=122}at.regexp_eatRegExpUnicodeEscapeSequence=function(i,Ae){if(Ae===void 0)Ae=!1;var Ne=i.pos,_e=Ae||i.switchU;if(i.eat(117)){if(this.regexp_eatFixedHexDigits(i,4)){var De=i.lastIntValue;if(_e&&De>=55296&&De<=56319){var Re=i.pos;if(i.eat(92)&&i.eat(117)&&this.regexp_eatFixedHexDigits(i,4)){var Ie=i.lastIntValue;if(Ie>=56320&&Ie<=57343)return i.lastIntValue=(De-55296)*1024+(Ie-56320)+65536,!0}i.pos=Re,i.lastIntValue=De}return!0}if(_e&&i.eat(123)&&this.regexp_eatHexDigits(i)&&i.eat(125)&&xd(i.lastIntValue))return!0;if(_e)i.raise("Invalid unicode escape");i.pos=Ne}return!1};function xd(i){return i>=0&&i<=1114111}at.regexp_eatIdentityEscape=function(i){if(i.switchU){if(this.regexp_eatSyntaxCharacter(i))return!0;if(i.eat(47))return i.lastIntValue=47,!0;return!1}var Ae=i.current();if(Ae!==99&&(!i.switchN||Ae!==107))return i.lastIntValue=Ae,i.advance(),!0;return!1};at.regexp_eatDecimalEscape=function(i){i.lastIntValue=0;var Ae=i.current();if(Ae>=49&&Ae<=57){do i.lastIntValue=10*i.lastIntValue+(Ae-48),i.advance();while((Ae=i.current())>=48&&Ae<=57);return!0}return!1};var Va=0,kn=1,cn=2;at.regexp_eatCharacterClassEscape=function(i){var Ae=i.current();if(bd(Ae))return i.lastIntValue=-1,i.advance(),kn;var Ne=!1;if(i.switchU&&this.options.ecmaVersion>=9&&((Ne=Ae===80)||Ae===112)){i.lastIntValue=-1,i.advance();var _e;if(i.eat(123)&&(_e=this.regexp_eatUnicodePropertyValueExpression(i))&&i.eat(125)){if(Ne&&_e===cn)i.raise("Invalid property name");return _e}i.raise("Invalid property name")}return Va};function bd(i){return i===100||i===68||i===115||i===83||i===119||i===87}at.regexp_eatUnicodePropertyValueExpression=function(i){var Ae=i.pos;if(this.regexp_eatUnicodePropertyName(i)&&i.eat(61)){var Ne=i.lastStringValue;if(this.regexp_eatUnicodePropertyValue(i)){var _e=i.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(i,Ne,_e),kn}}if(i.pos=Ae,this.regexp_eatLoneUnicodePropertyNameOrValue(i)){var De=i.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(i,De)}return Va};at.regexp_validateUnicodePropertyNameAndValue=function(i,Ae,Ne){if(!er(i.unicodeProperties.nonBinary,Ae))i.raise("Invalid property name");if(!i.unicodeProperties.nonBinary[Ae].test(Ne))i.raise("Invalid property value")};at.regexp_validateUnicodePropertyNameOrValue=function(i,Ae){if(i.unicodeProperties.binary.test(Ae))return kn;if(i.switchV&&i.unicodeProperties.binaryOfStrings.test(Ae))return cn;i.raise("Invalid property name")};at.regexp_eatUnicodePropertyName=function(i){var Ae=0;i.lastStringValue="";while(Wa(Ae=i.current()))i.lastStringValue+=Tn(Ae),i.advance();return i.lastStringValue!==""};function Wa(i){return ja(i)||i===95}at.regexp_eatUnicodePropertyValue=function(i){var Ae=0;i.lastStringValue="";while(Ed(Ae=i.current()))i.lastStringValue+=Tn(Ae),i.advance();return i.lastStringValue!==""};function Ed(i){return Wa(i)||ns(i)}at.regexp_eatLoneUnicodePropertyNameOrValue=function(i){return this.regexp_eatUnicodePropertyValue(i)};at.regexp_eatCharacterClass=function(i){if(i.eat(91)){var Ae=i.eat(94),Ne=this.regexp_classContents(i);if(!i.eat(93))i.raise("Unterminated character class");if(Ae&&Ne===cn)i.raise("Negated character class may contain strings");return!0}return!1};at.regexp_classContents=function(i){if(i.current()===93)return kn;if(i.switchV)return this.regexp_classSetExpression(i);return this.regexp_nonEmptyClassRanges(i),kn};at.regexp_nonEmptyClassRanges=function(i){while(this.regexp_eatClassAtom(i)){var Ae=i.lastIntValue;if(i.eat(45)&&this.regexp_eatClassAtom(i)){var Ne=i.lastIntValue;if(i.switchU&&(Ae===-1||Ne===-1))i.raise("Invalid character class");if(Ae!==-1&&Ne!==-1&&Ae>Ne)i.raise("Range out of order in character class")}}};at.regexp_eatClassAtom=function(i){var Ae=i.pos;if(i.eat(92)){if(this.regexp_eatClassEscape(i))return!0;if(i.switchU){var Ne=i.current();if(Ne===99||Ua(Ne))i.raise("Invalid class escape");i.raise("Invalid escape")}i.pos=Ae}var _e=i.current();if(_e!==93)return i.lastIntValue=_e,i.advance(),!0;return!1};at.regexp_eatClassEscape=function(i){var Ae=i.pos;if(i.eat(98))return i.lastIntValue=8,!0;if(i.switchU&&i.eat(45))return i.lastIntValue=45,!0;if(!i.switchU&&i.eat(99)){if(this.regexp_eatClassControlLetter(i))return!0;i.pos=Ae}return this.regexp_eatCharacterClassEscape(i)||this.regexp_eatCharacterEscape(i)};at.regexp_classSetExpression=function(i){var Ae=kn,Ne;if(this.regexp_eatClassSetRange(i));else if(Ne=this.regexp_eatClassSetOperand(i)){if(Ne===cn)Ae=cn;var _e=i.pos;while(i.eatChars([38,38])){if(i.current()!==38&&(Ne=this.regexp_eatClassSetOperand(i))){if(Ne!==cn)Ae=kn;continue}i.raise("Invalid character in character class")}if(_e!==i.pos)return Ae;while(i.eatChars([45,45])){if(this.regexp_eatClassSetOperand(i))continue;i.raise("Invalid character in character class")}if(_e!==i.pos)return Ae}else i.raise("Invalid character in character class");for(;;){if(this.regexp_eatClassSetRange(i))continue;if(Ne=this.regexp_eatClassSetOperand(i),!Ne)return Ae;if(Ne===cn)Ae=cn}};at.regexp_eatClassSetRange=function(i){var Ae=i.pos;if(this.regexp_eatClassSetCharacter(i)){var Ne=i.lastIntValue;if(i.eat(45)&&this.regexp_eatClassSetCharacter(i)){var _e=i.lastIntValue;if(Ne!==-1&&_e!==-1&&Ne>_e)i.raise("Range out of order in character class");return!0}i.pos=Ae}return!1};at.regexp_eatClassSetOperand=function(i){if(this.regexp_eatClassSetCharacter(i))return kn;return this.regexp_eatClassStringDisjunction(i)||this.regexp_eatNestedClass(i)};at.regexp_eatNestedClass=function(i){var Ae=i.pos;if(i.eat(91)){var Ne=i.eat(94),_e=this.regexp_classContents(i);if(i.eat(93)){if(Ne&&_e===cn)i.raise("Negated character class may contain strings");return _e}i.pos=Ae}if(i.eat(92)){var De=this.regexp_eatCharacterClassEscape(i);if(De)return De;i.pos=Ae}return null};at.regexp_eatClassStringDisjunction=function(i){var Ae=i.pos;if(i.eatChars([92,113])){if(i.eat(123)){var Ne=this.regexp_classStringDisjunctionContents(i);if(i.eat(125))return Ne}else i.raise("Invalid escape");i.pos=Ae}return null};at.regexp_classStringDisjunctionContents=function(i){var Ae=this.regexp_classString(i);while(i.eat(124))if(this.regexp_classString(i)===cn)Ae=cn;return Ae};at.regexp_classString=function(i){var Ae=0;while(this.regexp_eatClassSetCharacter(i))Ae++;return Ae===1?kn:cn};at.regexp_eatClassSetCharacter=function(i){var Ae=i.pos;if(i.eat(92)){if(this.regexp_eatCharacterEscape(i)||this.regexp_eatClassSetReservedPunctuator(i))return!0;if(i.eat(98))return i.lastIntValue=8,!0;return i.pos=Ae,!1}var Ne=i.current();if(Ne<0||Ne===i.lookahead()&&Cd(Ne))return!1;if(Sd(Ne))return!1;return i.advance(),i.lastIntValue=Ne,!0};function Cd(i){return i===33||i>=35&&i<=38||i>=42&&i<=44||i===46||i>=58&&i<=64||i===94||i===96||i===126}function Sd(i){return i===40||i===41||i===45||i===47||i>=91&&i<=93||i>=123&&i<=125}at.regexp_eatClassSetReservedPunctuator=function(i){var Ae=i.current();if(vd(Ae))return i.lastIntValue=Ae,i.advance(),!0;return!1};function vd(i){return i===33||i===35||i===37||i===38||i===44||i===45||i>=58&&i<=62||i===64||i===96||i===126}at.regexp_eatClassControlLetter=function(i){var Ae=i.current();if(ns(Ae)||Ae===95)return i.lastIntValue=Ae%32,i.advance(),!0;return!1};at.regexp_eatHexEscapeSequence=function(i){var Ae=i.pos;if(i.eat(120)){if(this.regexp_eatFixedHexDigits(i,2))return!0;if(i.switchU)i.raise("Invalid escape");i.pos=Ae}return!1};at.regexp_eatDecimalDigits=function(i){var Ae=i.pos,Ne=0;i.lastIntValue=0;while(ns(Ne=i.current()))i.lastIntValue=10*i.lastIntValue+(Ne-48),i.advance();return i.pos!==Ae};function ns(i){return i>=48&&i<=57}at.regexp_eatHexDigits=function(i){var Ae=i.pos,Ne=0;i.lastIntValue=0;while(qa(Ne=i.current()))i.lastIntValue=16*i.lastIntValue+Ga(Ne),i.advance();return i.pos!==Ae};function qa(i){return i>=48&&i<=57||i>=65&&i<=70||i>=97&&i<=102}function Ga(i){if(i>=65&&i<=70)return 10+(i-65);if(i>=97&&i<=102)return 10+(i-97);return i-48}at.regexp_eatLegacyOctalEscapeSequence=function(i){if(this.regexp_eatOctalDigit(i)){var Ae=i.lastIntValue;if(this.regexp_eatOctalDigit(i)){var Ne=i.lastIntValue;if(Ae<=3&&this.regexp_eatOctalDigit(i))i.lastIntValue=Ae*64+Ne*8+i.lastIntValue;else i.lastIntValue=Ae*8+Ne}else i.lastIntValue=Ae;return!0}return!1};at.regexp_eatOctalDigit=function(i){var Ae=i.current();if(Ua(Ae))return i.lastIntValue=Ae-48,i.advance(),!0;return i.lastIntValue=0,!1};function Ua(i){return i>=48&&i<=55}at.regexp_eatFixedHexDigits=function(i,Ae){var Ne=i.pos;i.lastIntValue=0;for(var _e=0;_e<Ae;++_e){var De=i.current();if(!qa(De))return i.pos=Ne,!1;i.lastIntValue=16*i.lastIntValue+Ga(De),i.advance()}return!0};var rs=function(Ae){if(this.type=Ae.type,this.value=Ae.value,this.start=Ae.start,this.end=Ae.end,Ae.options.locations)this.loc=new br(Ae,Ae.startLoc,Ae.endLoc);if(Ae.options.ranges)this.range=[Ae.start,Ae.end]},gt=Pt.prototype;gt.next=function(i){if(!i&&this.type.keyword&&this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword);if(this.options.onToken)this.options.onToken(new rs(this));this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()};gt.getToken=function(){return this.next(),new rs(this)};if(typeof Symbol<"u")gt[Symbol.iterator]=function(){var i=this;return{next:function(){var Ae=i.getToken();return{done:Ae.type===We.eof,value:Ae}}}};gt.nextToken=function(){var i=this.curContext();if(!i||!i.preserveSpace)this.skipSpace();if(this.start=this.pos,this.options.locations)this.startLoc=this.curPosition();if(this.pos>=this.input.length)return this.finishToken(We.eof);if(i.override)return i.override(this);else this.readToken(this.fullCharCodeAtPos())};gt.readToken=function(i){if(Ut(i,this.options.ecmaVersion>=6)||i===92)return this.readWord();return this.getTokenFromCode(i)};gt.fullCharCodeAt=function(i){var Ae=this.input.charCodeAt(i);if(Ae<=55295||Ae>=56320)return Ae;var Ne=this.input.charCodeAt(i+1);return Ne<=56319||Ne>=57344?Ae:(Ae<<10)+Ne-56613888};gt.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)};gt.skipBlockComment=function(){var i=this.options.onComment&&this.curPosition(),Ae=this.pos,Ne=this.input.indexOf("*/",this.pos+=2);if(Ne===-1)this.raise(this.pos-2,"Unterminated comment");if(this.pos=Ne+2,this.options.locations)for(var _e=void 0,De=Ae;(_e=ya(this.input,De,this.pos))>-1;)++this.curLine,De=this.lineStart=_e;if(this.options.onComment)this.options.onComment(!0,this.input.slice(Ae+2,Ne),Ae,this.pos,i,this.curPosition())};gt.skipLineComment=function(i){var Ae=this.pos,Ne=this.options.onComment&&this.curPosition(),_e=this.input.charCodeAt(this.pos+=i);while(this.pos<this.input.length&&!qn(_e))_e=this.input.charCodeAt(++this.pos);if(this.options.onComment)this.options.onComment(!1,this.input.slice(Ae+i,this.pos),Ae,this.pos,Ne,this.curPosition())};gt.skipSpace=function(){e:while(this.pos<this.input.length){var i=this.input.charCodeAt(this.pos);switch(i){case 32:case 160:++this.pos;break;case 13:if(this.input.charCodeAt(this.pos+1)===10)++this.pos;case 10:case 8232:case 8233:if(++this.pos,this.options.locations)++this.curLine,this.lineStart=this.pos;break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(i>8&&i<14||i>=5760&&fi.test(String.fromCharCode(i)))++this.pos;else break e}}};gt.finishToken=function(i,Ae){if(this.end=this.pos,this.options.locations)this.endLoc=this.curPosition();var Ne=this.type;this.type=i,this.value=Ae,this.updateContext(Ne)};gt.readToken_dot=function(){var i=this.input.charCodeAt(this.pos+1);if(i>=48&&i<=57)return this.readNumber(!0);var Ae=this.input.charCodeAt(this.pos+2);if(this.options.ecmaVersion>=6&&i===46&&Ae===46)return this.pos+=3,this.finishToken(We.ellipsis);else return++this.pos,this.finishToken(We.dot)};gt.readToken_slash=function(){var i=this.input.charCodeAt(this.pos+1);if(this.exprAllowed)return++this.pos,this.readRegexp();if(i===61)return this.finishOp(We.assign,2);return this.finishOp(We.slash,1)};gt.readToken_mult_modulo_exp=function(i){var Ae=this.input.charCodeAt(this.pos+1),Ne=1,_e=i===42?We.star:We.modulo;if(this.options.ecmaVersion>=7&&i===42&&Ae===42)++Ne,_e=We.starstar,Ae=this.input.charCodeAt(this.pos+2);if(Ae===61)return this.finishOp(We.assign,Ne+1);return this.finishOp(_e,Ne)};gt.readToken_pipe_amp=function(i){var Ae=this.input.charCodeAt(this.pos+1);if(Ae===i){if(this.options.ecmaVersion>=12){var Ne=this.input.charCodeAt(this.pos+2);if(Ne===61)return this.finishOp(We.assign,3)}return this.finishOp(i===124?We.logicalOR:We.logicalAND,2)}if(Ae===61)return this.finishOp(We.assign,2);return this.finishOp(i===124?We.bitwiseOR:We.bitwiseAND,1)};gt.readToken_caret=function(){var i=this.input.charCodeAt(this.pos+1);if(i===61)return this.finishOp(We.assign,2);return this.finishOp(We.bitwiseXOR,1)};gt.readToken_plus_min=function(i){var Ae=this.input.charCodeAt(this.pos+1);if(Ae===i){if(Ae===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||Ht.test(this.input.slice(this.lastTokEnd,this.pos))))return this.skipLineComment(3),this.skipSpace(),this.nextToken();return this.finishOp(We.incDec,2)}if(Ae===61)return this.finishOp(We.assign,2);return this.finishOp(We.plusMin,1)};gt.readToken_lt_gt=function(i){var Ae=this.input.charCodeAt(this.pos+1),Ne=1;if(Ae===i){if(Ne=i===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+Ne)===61)return this.finishOp(We.assign,Ne+1);return this.finishOp(We.bitShift,Ne)}if(Ae===33&&i===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45)return this.skipLineComment(4),this.skipSpace(),this.nextToken();if(Ae===61)Ne=2;return this.finishOp(We.relational,Ne)};gt.readToken_eq_excl=function(i){var Ae=this.input.charCodeAt(this.pos+1);if(Ae===61)return this.finishOp(We.equality,this.input.charCodeAt(this.pos+2)===61?3:2);if(i===61&&Ae===62&&this.options.ecmaVersion>=6)return this.pos+=2,this.finishToken(We.arrow);return this.finishOp(i===61?We.eq:We.prefix,1)};gt.readToken_question=function(){var i=this.options.ecmaVersion;if(i>=11){var Ae=this.input.charCodeAt(this.pos+1);if(Ae===46){var Ne=this.input.charCodeAt(this.pos+2);if(Ne<48||Ne>57)return this.finishOp(We.questionDot,2)}if(Ae===63){if(i>=12){var _e=this.input.charCodeAt(this.pos+2);if(_e===61)return this.finishOp(We.assign,3)}return this.finishOp(We.coalesce,2)}}return this.finishOp(We.question,1)};gt.readToken_numberSign=function(){var i=this.options.ecmaVersion,Ae=35;if(i>=13){if(++this.pos,Ae=this.fullCharCodeAtPos(),Ut(Ae,!0)||Ae===92)return this.finishToken(We.privateId,this.readWord1())}this.raise(this.pos,"Unexpected character '"+Tn(Ae)+"'")};gt.getTokenFromCode=function(i){switch(i){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(We.parenL);case 41:return++this.pos,this.finishToken(We.parenR);case 59:return++this.pos,this.finishToken(We.semi);case 44:return++this.pos,this.finishToken(We.comma);case 91:return++this.pos,this.finishToken(We.bracketL);case 93:return++this.pos,this.finishToken(We.bracketR);case 123:return++this.pos,this.finishToken(We.braceL);case 125:return++this.pos,this.finishToken(We.braceR);case 58:return++this.pos,this.finishToken(We.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(We.backQuote);case 48:var Ae=this.input.charCodeAt(this.pos+1);if(Ae===120||Ae===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(Ae===111||Ae===79)return this.readRadixNumber(8);if(Ae===98||Ae===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(i);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(i);case 124:case 38:return this.readToken_pipe_amp(i);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(i);case 60:case 62:return this.readToken_lt_gt(i);case 61:case 33:return this.readToken_eq_excl(i);case 63:return this.readToken_question();case 126:return this.finishOp(We.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+Tn(i)+"'")};gt.finishOp=function(i,Ae){var Ne=this.input.slice(this.pos,this.pos+Ae);return this.pos+=Ae,this.finishToken(i,Ne)};gt.readRegexp=function(){var i,Ae,Ne=this.pos;for(;;){if(this.pos>=this.input.length)this.raise(Ne,"Unterminated regular expression");var _e=this.input.charAt(this.pos);if(Ht.test(_e))this.raise(Ne,"Unterminated regular expression");if(!i){if(_e==="[")Ae=!0;else if(_e==="]"&&Ae)Ae=!1;else if(_e==="/"&&!Ae)break;i=_e==="\\"}else i=!1;++this.pos}var De=this.input.slice(Ne,this.pos);++this.pos;var Re=this.pos,Ie=this.readWord1();if(this.containsEsc)this.unexpected(Re);var Oe=this.regexpState||(this.regexpState=new hn(this));Oe.reset(Ne,De,Ie),this.validateRegExpFlags(Oe),this.validateRegExpPattern(Oe);var Me=null;try{Me=new RegExp(De,Ie)}catch(Fe){}return this.finishToken(We.regexp,{pattern:De,flags:Ie,value:Me})};gt.readInt=function(i,Ae,Ne){var _e=this.options.ecmaVersion>=12&&Ae===void 0,De=Ne&&this.input.charCodeAt(this.pos)===48,Re=this.pos,Ie=0,Oe=0;for(var Me=0,Fe=Ae==null?1/0:Ae;Me<Fe;++Me,++this.pos){var Be=this.input.charCodeAt(this.pos),Ve=void 0;if(_e&&Be===95){if(De)this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals");if(Oe===95)this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore");if(Me===0)this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits");Oe=Be;continue}if(Be>=97)Ve=Be-97+10;else if(Be>=65)Ve=Be-65+10;else if(Be>=48&&Be<=57)Ve=Be-48;else Ve=1/0;if(Ve>=i)break;Oe=Be,Ie=Ie*i+Ve}if(_e&&Oe===95)this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits");if(this.pos===Re||Ae!=null&&this.pos-Re!==Ae)return null;return Ie};function Td(i,Ae){if(Ae)return parseInt(i,8);return parseFloat(i.replace(/_/g,""))}function Ha(i){if(typeof BigInt!=="function")return null;return BigInt(i.replace(/_/g,""))}gt.readRadixNumber=function(i){var Ae=this.pos;this.pos+=2;var Ne=this.readInt(i);if(Ne==null)this.raise(this.start+2,"Expected number in radix "+i);if(this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110)Ne=Ha(this.input.slice(Ae,this.pos)),++this.pos;else if(Ut(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");return this.finishToken(We.num,Ne)};gt.readNumber=function(i){var Ae=this.pos;if(!i&&this.readInt(10,void 0,!0)===null)this.raise(Ae,"Invalid number");var Ne=this.pos-Ae>=2&&this.input.charCodeAt(Ae)===48;if(Ne&&this.strict)this.raise(Ae,"Invalid number");var _e=this.input.charCodeAt(this.pos);if(!Ne&&!i&&this.options.ecmaVersion>=11&&_e===110){var De=Ha(this.input.slice(Ae,this.pos));if(++this.pos,Ut(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");return this.finishToken(We.num,De)}if(Ne&&/[89]/.test(this.input.slice(Ae,this.pos)))Ne=!1;if(_e===46&&!Ne)++this.pos,this.readInt(10),_e=this.input.charCodeAt(this.pos);if((_e===69||_e===101)&&!Ne){if(_e=this.input.charCodeAt(++this.pos),_e===43||_e===45)++this.pos;if(this.readInt(10)===null)this.raise(Ae,"Invalid number")}if(Ut(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");var Re=Td(this.input.slice(Ae,this.pos),Ne);return this.finishToken(We.num,Re)};gt.readCodePoint=function(){var i=this.input.charCodeAt(this.pos),Ae;if(i===123){if(this.options.ecmaVersion<6)this.unexpected();var Ne=++this.pos;if(Ae=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,Ae>1114111)this.invalidStringToken(Ne,"Code point out of bounds")}else Ae=this.readHexChar(4);return Ae};gt.readString=function(i){var Ae="",Ne=++this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated string constant");var _e=this.input.charCodeAt(this.pos);if(_e===i)break;if(_e===92)Ae+=this.input.slice(Ne,this.pos),Ae+=this.readEscapedChar(!1),Ne=this.pos;else if(_e===8232||_e===8233){if(this.options.ecmaVersion<10)this.raise(this.start,"Unterminated string constant");if(++this.pos,this.options.locations)this.curLine++,this.lineStart=this.pos}else{if(qn(_e))this.raise(this.start,"Unterminated string constant");++this.pos}}return Ae+=this.input.slice(Ne,this.pos++),this.finishToken(We.string,Ae)};var Ka={};gt.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(i){if(i===Ka)this.readInvalidTemplateToken();else throw i}this.inTemplateElement=!1};gt.invalidStringToken=function(i,Ae){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Ka;else this.raise(i,Ae)};gt.readTmplToken=function(){var i="",Ae=this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated template");var Ne=this.input.charCodeAt(this.pos);if(Ne===96||Ne===36&&this.input.charCodeAt(this.pos+1)===123){if(this.pos===this.start&&(this.type===We.template||this.type===We.invalidTemplate))if(Ne===36)return this.pos+=2,this.finishToken(We.dollarBraceL);else return++this.pos,this.finishToken(We.backQuote);return i+=this.input.slice(Ae,this.pos),this.finishToken(We.template,i)}if(Ne===92)i+=this.input.slice(Ae,this.pos),i+=this.readEscapedChar(!0),Ae=this.pos;else if(qn(Ne)){switch(i+=this.input.slice(Ae,this.pos),++this.pos,Ne){case 13:if(this.input.charCodeAt(this.pos)===10)++this.pos;case 10:i+=`
|
|
6
|
-
`;break;default:i+=String.fromCharCode(Ne);break}if(this.options.locations)++this.curLine,this.lineStart=this.pos;Ae=this.pos}else++this.pos}};gt.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if(this.input[this.pos+1]!=="{")break;case"`":return this.finishToken(We.invalidTemplate,this.input.slice(this.start,this.pos));case"\r":if(this.input[this.pos+1]===`
|
|
7
|
-
`)++this.pos;case`
|
|
8
|
-
`:case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template")};gt.readEscapedChar=function(i){var Ae=this.input.charCodeAt(++this.pos);switch(++this.pos,Ae){case 110:return`
|
|
9
|
-
`;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return Tn(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:if(this.input.charCodeAt(this.pos)===10)++this.pos;case 10:if(this.options.locations)this.lineStart=this.pos,++this.curLine;return"";case 56:case 57:if(this.strict)this.invalidStringToken(this.pos-1,"Invalid escape sequence");if(i){var Ne=this.pos-1;this.invalidStringToken(Ne,"Invalid escape sequence in template string")}default:if(Ae>=48&&Ae<=55){var _e=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],De=parseInt(_e,8);if(De>255)_e=_e.slice(0,-1),De=parseInt(_e,8);if(this.pos+=_e.length-1,Ae=this.input.charCodeAt(this.pos),(_e!=="0"||Ae===56||Ae===57)&&(this.strict||i))this.invalidStringToken(this.pos-1-_e.length,i?"Octal literal in template string":"Octal literal in strict mode");return String.fromCharCode(De)}if(qn(Ae)){if(this.options.locations)this.lineStart=this.pos,++this.curLine;return""}return String.fromCharCode(Ae)}};gt.readHexChar=function(i){var Ae=this.pos,Ne=this.readInt(16,i);if(Ne===null)this.invalidStringToken(Ae,"Bad character escape sequence");return Ne};gt.readWord1=function(){this.containsEsc=!1;var i="",Ae=!0,Ne=this.pos,_e=this.options.ecmaVersion>=6;while(this.pos<this.input.length){var De=this.fullCharCodeAtPos();if(Qt(De,_e))this.pos+=De<=65535?1:2;else if(De===92){this.containsEsc=!0,i+=this.input.slice(Ne,this.pos);var Re=this.pos;if(this.input.charCodeAt(++this.pos)!==117)this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX");++this.pos;var Ie=this.readCodePoint();if(!(Ae?Ut:Qt)(Ie,_e))this.invalidStringToken(Re,"Invalid Unicode escape");i+=Tn(Ie),Ne=this.pos}else break;Ae=!1}return i+this.input.slice(Ne,this.pos)};gt.readWord=function(){var i=this.readWord1(),Ae=We.name;if(this.keywords.test(i))Ae=Qr[i];return this.finishToken(Ae,i)};var za="8.18.0";Pt.acorn={Parser:Pt,version:za,defaultOptions:Kr,Position:Zn,SourceLocation:br,getLineInfo:hi,Node:Cr,TokenType:Ct,tokTypes:We,keywordTypes:Qr,TokContext:an,tokContexts:wt,isIdentifierChar:Qt,isIdentifierStart:Ut,Token:rs,isNewLine:qn,lineBreak:Ht,lineBreakG:ma,nonASCIIwhitespace:fi};function Ei(i,Ae){return Pt.parse(i,Ae)}function kd(i,Ae,Ne){return Pt.parseExpressionAt(i,Ae,Ne)}function Ad(i,Ae){return Pt.tokenizer(i,Ae)}var rn=!0,wd=new WeakMap;function Pd(i){let Ae=i.Parser.acorn||i,Ne=wd.get(Ae);if(!Ne){let Oe=function(it){return it===Ue.name||it===Ue.string||it===Ue.num||ze.includes(it)||rt.includes(it)},Me=function(it){return it===Ue.name||ze.includes(it)||rt.includes(it)},Fe=function(it){return it===Ue.name||rt.includes(it)},Be=function(it){return it===Qe.abstract||it===Qe.declare||it===Qe.enum||it===Qe.module||it===Qe.namespace||it===Qe.interface||it===Qe.type},Ve=function(it){return it===Qe.keyof||it===Qe.readonly||it===Qe.unique},Ge=function(it){return it===Ue.invalidTemplate},{tokTypes:Ue,keywordTypes:Xe}=Ae,ze=Object.values(Xe),Qe=Ie(),rt=Object.values(Qe),ot=Re(),Ye=De(),nt=new RegExp(`^(?:${Object.keys(Qe).join("|")})$`);ot.jsxTagStart.updateContext=function(){this.context.push(Ye.tc_expr),this.context.push(Ye.tc_oTag),this.exprAllowed=!1},ot.jsxTagEnd.updateContext=function(it){let bt=this.context.pop();if(bt===Ye.tc_oTag&&it===Ue.slash||bt===Ye.tc_cTag)this.context.pop(),this.exprAllowed=this.curContext()===Ye.tc_expr;else this.exprAllowed=!0},Ne={tokTypes:{...Qe,...ot},tokContexts:{...Ye},keywordsRegExp:nt,tokenIsLiteralPropertyName:Oe,tokenIsKeywordOrIdentifier:Me,tokenIsIdentifier:Fe,tokenIsTSDeclarationStart:Be,tokenIsTSTypeOperator:Ve,tokenIsTemplate:Ge}}return Ne;function _e(Oe,Me={}){return new Ae.TokenType("name",Me)}function De(){return{tc_oTag:new Ae.TokContext("<tag",!1,!1),tc_cTag:new Ae.TokContext("</tag",!1,!1),tc_expr:new Ae.TokContext("<tag>...</tag>",!0,!0)}}function Re(){return{at:new Ae.TokenType("@"),jsxName:new Ae.TokenType("jsxName"),jsxText:new Ae.TokenType("jsxText",{beforeExpr:!0}),jsxTagStart:new Ae.TokenType("jsxTagStart",{startsExpr:!0}),jsxTagEnd:new Ae.TokenType("jsxTagEnd")}}function Ie(){return{assert:_e("assert",{startsExpr:rn}),asserts:_e("asserts",{startsExpr:rn}),global:_e("global",{startsExpr:rn}),keyof:_e("keyof",{startsExpr:rn}),readonly:_e("readonly",{startsExpr:rn}),unique:_e("unique",{startsExpr:rn}),abstract:_e("abstract",{startsExpr:rn}),declare:_e("declare",{startsExpr:rn}),enum:_e("enum",{startsExpr:rn}),module:_e("module",{startsExpr:rn}),namespace:_e("namespace",{startsExpr:rn}),interface:_e("interface",{startsExpr:rn}),type:_e("type",{startsExpr:rn})}}}var Nd=1048576,vr=2097152,rr=1,os=2,_d=4,ki=8,Dd=16,nc=64,rc=128,Id=256,Rd=512,sc=1024,nb=rr|os|ki|rc,rb=rr|0|ki|0,sb=rr|0|_d|0,ib=rr|0|Dd|0,ob=0|os|0|rc,ab=0|os|0|0,Ld=rr|os|ki|Id,cb=0|sc,lb=0|nc,pb=rr|0|0|nc,ub=Ld|Rd,db=0|sc,ic=4,oc=2,ac=1,fb=oc|ac,hb=oc|ic,mb=ac|ic,Od=/(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/y,Xa=new RegExp("(?=("+Od.source+"))\\1"+/(?=[\n\r\u2028\u2029]|\/\*(?!.*?\*\/)|$)/.source,"y"),Tr=class{constructor(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1}};function Md(i,Ae){let Ne="true";if(Ae.type==="MethodDefinition"&&(Ae.kind==="get"||Ae.kind==="set"))Ne=(Ae.static?"s":"i")+Ae.kind;if(i==="iget"&&Ne==="iset"||i==="iset"&&Ne==="iget"||i==="sget"&&Ne==="sset"||i==="sset"&&Ne==="sget")return[!1,"true"];if(!i)return[!1,Ne];return[!0,i]}function Ja(i,Ae){let{computed:Ne,key:_e}=i;return!Ne&&(_e.type==="Identifier"&&_e.name===Ae||_e.type==="Literal"&&_e.value===Ae)}var ct={AbstractMethodHasImplementation:({methodName:i})=>`Method '${i}' cannot have an implementation because it is marked abstract.`,AbstractPropertyHasInitializer:({propertyName:i})=>`Property '${i}' cannot have an initializer because it is marked abstract.`,AccesorCannotDeclareThisParameter:"'get' and 'set' accessors cannot declare 'this' parameters.",AccesorCannotHaveTypeParameters:"An accessor cannot have type parameters.",CannotFindName:({name:i})=>`Cannot find name '${i}'.`,ClassMethodHasDeclare:"Class methods cannot have the 'declare' modifier.",ClassMethodHasReadonly:"Class methods cannot have the 'readonly' modifier.",ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference:"A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.",ConstructorHasTypeParameters:"Type parameters cannot appear on a constructor declaration.",DeclareAccessor:({kind:i})=>`'declare' is not allowed in ${i}ters.`,DeclareClassFieldHasInitializer:"Initializers are not allowed in ambient contexts.",DeclareFunctionHasImplementation:"An implementation cannot be declared in ambient contexts.",DuplicateAccessibilityModifier:()=>"Accessibility modifier already seen.",DuplicateModifier:({modifier:i})=>`Duplicate modifier: '${i}'.`,EmptyHeritageClauseType:({token:i})=>`'${i}' list cannot be empty.`,EmptyTypeArguments:"Type argument list cannot be empty.",EmptyTypeParameters:"Type parameter list cannot be empty.",ExpectedAmbientAfterExportDeclare:"'export declare' must be followed by an ambient declaration.",ImportAliasHasImportType:"An import alias can not use 'import type'.",IncompatibleModifiers:({modifiers:i})=>`'${i[0]}' modifier cannot be used with '${i[1]}' modifier.`,IndexSignatureHasAbstract:"Index signatures cannot have the 'abstract' modifier.",IndexSignatureHasAccessibility:({modifier:i})=>`Index signatures cannot have an accessibility modifier ('${i}').`,IndexSignatureHasDeclare:"Index signatures cannot have the 'declare' modifier.",IndexSignatureHasOverride:"'override' modifier cannot appear on an index signature.",IndexSignatureHasStatic:"Index signatures cannot have the 'static' modifier.",InitializerNotAllowedInAmbientContext:"Initializers are not allowed in ambient contexts.",InvalidModifierOnTypeMember:({modifier:i})=>`'${i}' modifier cannot appear on a type member.`,InvalidModifierOnTypeParameter:({modifier:i})=>`'${i}' modifier cannot appear on a type parameter.`,InvalidModifierOnTypeParameterPositions:({modifier:i})=>`'${i}' modifier can only appear on a type parameter of a class, interface or type alias.`,InvalidModifiersOrder:({orderedModifiers:i})=>`'${i[0]}' modifier must precede '${i[1]}' modifier.`,InvalidPropertyAccessAfterInstantiationExpression:"Invalid property access after an instantiation expression. You can either wrap the instantiation expression in parentheses, or delete the type arguments.",InvalidTupleMemberLabel:"Tuple members must be labeled with a simple identifier.",MissingInterfaceName:"'interface' declarations must be followed by an identifier.",NonAbstractClassHasAbstractMethod:"Abstract methods can only appear within an abstract class.",NonClassMethodPropertyHasAbstractModifer:"'abstract' modifier can only appear on a class, method, or property declaration.",OptionalTypeBeforeRequired:"A required element cannot follow an optional element.",OverrideNotInSubClass:"This member cannot have an 'override' modifier because its containing class does not extend another class.",PatternIsOptional:"A binding pattern parameter cannot be optional in an implementation signature.",PrivateElementHasAbstract:"Private elements cannot have the 'abstract' modifier.",PrivateElementHasAccessibility:({modifier:i})=>`Private elements cannot have an accessibility modifier ('${i}').`,PrivateMethodsHasAccessibility:({modifier:i})=>`Private methods cannot have an accessibility modifier ('${i}').`,ReadonlyForMethodSignature:"'readonly' modifier can only appear on a property declaration or index signature.",ReservedArrowTypeParam:"This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `<T,>() => ...`.",ReservedTypeAssertion:"This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.",SetAccesorCannotHaveOptionalParameter:"A 'set' accessor cannot have an optional parameter.",SetAccesorCannotHaveRestParameter:"A 'set' accessor cannot have rest parameter.",SetAccesorCannotHaveReturnType:"A 'set' accessor cannot have a return type annotation.",SingleTypeParameterWithoutTrailingComma:({typeParameterName:i})=>`Single type parameter ${i} should have a trailing comma. Example usage: <${i},>.`,StaticBlockCannotHaveModifier:"Static class blocks cannot have any modifier.",TypeAnnotationAfterAssign:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeImportCannotSpecifyDefaultAndNamed:"A type-only import can specify a default import or named bindings, but not both.",TypeModifierIsUsedInTypeExports:"The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.",TypeModifierIsUsedInTypeImports:"The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.",UnexpectedParameterModifier:"A parameter property is only allowed in a constructor implementation.",UnexpectedReadonly:"'readonly' type modifier is only permitted on array and tuple literal types.",GenericsEndWithComma:"Trailing comma is not allowed at the end of generics.",UnexpectedTypeAnnotation:"Did not expect a type annotation here.",UnexpectedTypeCastInParameter:"Unexpected type cast in parameter position.",UnsupportedImportTypeArgument:"Argument in a type import must be a string literal.",UnsupportedParameterPropertyKind:"A parameter property may not be declared using a binding pattern.",UnsupportedSignatureParameterKind:({type:i})=>`Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${i}.`,LetInLexicalBinding:"'let' is not allowed to be used as a name in 'let' or 'const' declarations."},is={UnexpectedLeadingDecorator:"Leading decorators must be attached to a class declaration.",DecoratorConstructor:"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",TrailingDecorator:"Decorators must be attached to a class element.",SpreadElementDecorator:"Decorators can't be used with SpreadElement"};function $d(i,Ae,Ne){let{tokTypes:_e}=Ne,{tokTypes:De}=Ae;return class extends i{takeDecorators(Ie){let Oe=this.decoratorStack[this.decoratorStack.length-1];if(Oe.length)Ie.decorators=Oe,this.resetStartLocationFromNode(Ie,Oe[0]),this.decoratorStack[this.decoratorStack.length-1]=[]}parseDecorators(Ie){let Oe=this.decoratorStack[this.decoratorStack.length-1];while(this.match(De.at)){let Me=this.parseDecorator();Oe.push(Me)}if(this.match(_e._export)){if(!Ie)this.unexpected()}else if(!this.canHaveLeadingDecorator())this.raise(this.start,is.UnexpectedLeadingDecorator)}parseDecorator(){let Ie=this.startNode();this.next(),this.decoratorStack.push([]);let Oe=this.start,Me=this.startLoc,Fe;if(this.match(_e.parenL)){let Be=this.start,Ve=this.startLoc;if(this.next(),Fe=this.parseExpression(),this.expect(_e.parenR),this.options.preserveParens){let Ge=this.startNodeAt(Be,Ve);Ge.expression=Fe,Fe=this.finishNode(Ge,"ParenthesizedExpression")}}else{Fe=this.parseIdent(!1);while(this.eat(_e.dot)){let Be=this.startNodeAt(Oe,Me);Be.object=Fe,Be.property=this.parseIdent(!0),Be.computed=!1,Fe=this.finishNode(Be,"MemberExpression")}}return Ie.expression=this.parseMaybeDecoratorArguments(Fe),this.decoratorStack.pop(),this.finishNode(Ie,"Decorator")}parseMaybeDecoratorArguments(Ie){if(this.eat(_e.parenL)){let Oe=this.startNodeAtNode(Ie);return Oe.callee=Ie,Oe.arguments=this.parseExprList(_e.parenR,!1),this.finishNode(Oe,"CallExpression")}return Ie}}}var Ya={quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"},Bd=/^[\da-fA-F]+$/,Fd=/^\d+$/;function kr(i){if(!i)return i;if(i.type==="JSXIdentifier")return i.name;if(i.type==="JSXNamespacedName")return i.namespace.name+":"+i.name.name;if(i.type==="JSXMemberExpression")return kr(i.object)+"."+kr(i.property)}function jd(i,Ae,Ne,_e){let De=i.tokTypes,Re=Ae.tokTypes,{isNewLine:Ie,isIdentifierChar:Oe}=i,Me=Object.assign({allowNamespaces:!0,allowNamespacedObjects:!0},_e||{});return class extends Ne{jsx_readToken(){let Be="",Ve=this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated JSX contents");let Ge=this.input.charCodeAt(this.pos);switch(Ge){case 60:case 123:if(this.pos===this.start){if(Ge===60&&this.exprAllowed)return++this.pos,this.finishToken(Re.jsxTagStart);return this.getTokenFromCode(Ge)}return Be+=this.input.slice(Ve,this.pos),this.finishToken(Re.jsxText,Be);case 38:Be+=this.input.slice(Ve,this.pos),Be+=this.jsx_readEntity(),Ve=this.pos;break;case 62:case 125:this.raise(this.pos,"Unexpected token `"+this.input[this.pos]+"`. Did you mean `"+(Ge===62?">":"}")+'` or `{"'+this.input[this.pos]+'"}`?');default:if(Ie(Ge))Be+=this.input.slice(Ve,this.pos),Be+=this.jsx_readNewLine(!0),Ve=this.pos;else++this.pos}}}jsx_readNewLine(Be){let Ve=this.input.charCodeAt(this.pos),Ge;if(++this.pos,Ve===13&&this.input.charCodeAt(this.pos)===10)++this.pos,Ge=Be?`
|
|
10
|
-
`:`\r
|
|
11
|
-
`;else Ge=String.fromCharCode(Ve);if(this.options.locations)++this.curLine,this.lineStart=this.pos;return Ge}jsx_readString(Be){let Ve="",Ge=++this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated string constant");let Ue=this.input.charCodeAt(this.pos);if(Ue===Be)break;if(Ue===38)Ve+=this.input.slice(Ge,this.pos),Ve+=this.jsx_readEntity(),Ge=this.pos;else if(Ie(Ue))Ve+=this.input.slice(Ge,this.pos),Ve+=this.jsx_readNewLine(!1),Ge=this.pos;else++this.pos}return Ve+=this.input.slice(Ge,this.pos++),this.finishToken(De.string,Ve)}jsx_readEntity(){let Be="",Ve=0,Ge,Ue=this.input[this.pos];if(Ue!=="&")this.raise(this.pos,"Entity must start with an ampersand");let Xe=++this.pos;while(this.pos<this.input.length&&Ve++<10){if(Ue=this.input[this.pos++],Ue===";"){if(Be[0]==="#"){let ze;if(Be[1]==="x"||Be[1]==="X"){if(Be=Be.substr(2),Bd.test(Be))ze=parseInt(Be,16)}else if(Be=Be.substr(1),Fd.test(Be))ze=parseInt(Be,10);if(ze!==void 0&&ze<=1114111)Ge=String.fromCodePoint(ze)}else if(Object.prototype.hasOwnProperty.call(Ya,Be))Ge=Ya[Be];break}Be+=Ue}if(Ge===void 0)return this.pos=Xe,"&";return Ge}jsx_readWord(){let Be,Ve=this.pos;do Be=this.input.charCodeAt(++this.pos);while(Oe(Be)||Be===45);return this.finishToken(Re.jsxName,this.input.slice(Ve,this.pos))}jsx_parseIdentifier(){let Be=this.startNode();if(this.type===Re.jsxName)Be.name=this.value;else if(this.type.keyword)Be.name=this.type.keyword;else this.unexpected();return this.next(),this.finishNode(Be,"JSXIdentifier")}jsx_parseNamespacedName(){let Be=this.start,Ve=this.startLoc,Ge=this.jsx_parseIdentifier();if(!Me.allowNamespaces||!this.eat(De.colon))return Ge;var Ue=this.startNodeAt(Be,Ve);return Ue.namespace=Ge,Ue.name=this.jsx_parseIdentifier(),this.finishNode(Ue,"JSXNamespacedName")}jsx_parseElementName(){if(this.type===Re.jsxTagEnd)return"";let Be=this.start,Ve=this.startLoc,Ge=this.jsx_parseNamespacedName();if(this.type===De.dot&&Ge.type==="JSXNamespacedName"&&!Me.allowNamespacedObjects)this.unexpected();while(this.eat(De.dot)){let Ue=this.startNodeAt(Be,Ve);Ue.object=Ge,Ue.property=this.jsx_parseIdentifier(),Ge=this.finishNode(Ue,"JSXMemberExpression")}return Ge}jsx_parseAttributeValue(){switch(this.type){case De.braceL:let Be=this.jsx_parseExpressionContainer();if(Be.expression.type==="JSXEmptyExpression")this.raise(Be.start,"JSX attributes must only be assigned a non-empty expression");return Be;case Re.jsxTagStart:case De.string:return this.parseExprAtom();default:this.raise(this.start,"JSX value should be either an expression or a quoted JSX text")}}jsx_parseEmptyExpression(){let Be=this.startNodeAt(this.lastTokEnd,this.lastTokEndLoc);return this.finishNodeAt(Be,"JSXEmptyExpression",this.start,this.startLoc)}jsx_parseExpressionContainer(){let Be=this.startNode();if(this.next(),this.eat(De.ellipsis))return Be.expression=this.parseExpression(),this.expect(De.braceR),this.finishNode(Be,"JSXSpreadChild");return Be.expression=this.type===De.braceR?this.jsx_parseEmptyExpression():this.parseExpression(),this.expect(De.braceR),this.finishNode(Be,"JSXExpressionContainer")}jsx_parseAttribute(){let Be=this.startNode();if(this.eat(De.braceL))return this.expect(De.ellipsis),Be.argument=this.parseMaybeAssign(),this.expect(De.braceR),this.finishNode(Be,"JSXSpreadAttribute");return Be.name=this.jsx_parseNamespacedName(),Be.value=this.eat(De.eq)?this.jsx_parseAttributeValue():null,this.finishNode(Be,"JSXAttribute")}jsx_parseOpeningElementAt(Be,Ve){let Ge=this.startNodeAt(Be,Ve);Ge.attributes=[];let Ue=this.jsx_parseElementName();if(Ue)Ge.name=Ue;while(this.type!==De.slash&&this.type!==Re.jsxTagEnd)Ge.attributes.push(this.jsx_parseAttribute());return Ge.selfClosing=this.eat(De.slash),this.expect(Re.jsxTagEnd),this.finishNode(Ge,Ue?"JSXOpeningElement":"JSXOpeningFragment")}jsx_parseClosingElementAt(Be,Ve){let Ge=this.startNodeAt(Be,Ve),Ue=this.jsx_parseElementName();if(Ue)Ge.name=Ue;return this.expect(Re.jsxTagEnd),this.finishNode(Ge,Ue?"JSXClosingElement":"JSXClosingFragment")}jsx_parseElementAt(Be,Ve){let Ge=this.startNodeAt(Be,Ve),Ue=[],Xe=this.jsx_parseOpeningElementAt(Be,Ve),ze=null;if(!Xe.selfClosing){e:for(;;)switch(this.type){case Re.jsxTagStart:if(Be=this.start,Ve=this.startLoc,this.next(),this.eat(De.slash)){ze=this.jsx_parseClosingElementAt(Be,Ve);break e}Ue.push(this.jsx_parseElementAt(Be,Ve));break;case Re.jsxText:Ue.push(this.parseExprAtom());break;case De.braceL:Ue.push(this.jsx_parseExpressionContainer());break;default:this.unexpected()}if(kr(ze.name)!==kr(Xe.name))this.raise(ze.start,"Expected corresponding JSX closing tag for <"+kr(Xe.name)+">")}let Qe=Xe.name?"Element":"Fragment";if(Ge["opening"+Qe]=Xe,Ge["closing"+Qe]=ze,Ge.children=Ue,this.type===De.relational&&this.value==="<")this.raise(this.start,"Adjacent JSX elements must be wrapped in an enclosing tag");return this.finishNode(Ge,"JSX"+Qe)}jsx_parseText(){let Be=this.parseLiteral(this.value);return Be.type="JSXText",Be}jsx_parseElement(){let Be=this.start,Ve=this.startLoc;return this.next(),this.jsx_parseElementAt(Be,Ve)}}}function Vd(i,Ae,Ne){let{tokTypes:_e}=Ae,{tokTypes:De}=Ne;return class extends i{parseMaybeImportAttributes(Ie){if(this.type===De._with||this.type===_e.assert){this.next();let Oe=this.parseImportAttributes();if(Oe)Ie.attributes=Oe}}parseImportAttributes(){this.expect(De.braceL);let Ie=this.parseWithEntries();return this.expect(De.braceR),Ie}parseWithEntries(){let Ie=[],Oe=new Set;do{if(this.type===De.braceR)break;let Me=this.startNode(),Fe;if(this.type===De.string)Fe=this.parseLiteral(this.value);else Fe=this.parseIdent(!0);if(this.next(),Me.key=Fe,Oe.has(Me.key.name))this.raise(this.pos,"Duplicated key in attributes");if(Oe.add(Me.key.name),this.type!==De.string)this.raise(this.pos,"Only string is supported as an attribute value");Me.value=this.parseLiteral(this.value),Ie.push(this.finishNode(Me,"ImportAttribute"))}while(this.eat(De.comma));return Ie}}}var Si=["onToken","onComment","onInsertedSemicolon","onTrailingComma"];function cc(){return{_tag:"BufferedParserEvents",segments:[]}}var Wd=cc();function Qa(i){return i.segments.length>0}var qd=class{constructor(i,Ae){this.options=i,this.state=Ae,this.callbacks={},this.callbackWrappers={},this.frames=[],this.undoLog=[],this.hasCallbacks=this.captureCallbacks()}get active(){return this.frames.length>0}begin(){let i={_tag:"ParseEffectFrame",depth:this.frames.length,undoMark:this.undoLog.length,checkpoint:this.state?.capture()};if(this.frames.push(i),i.depth===0&&this.hasCallbacks)this.activateCallbacks();return i}commit(i){this.close(i);let Ae=this.currentFrame();if(Ae){if(i.output)this.appendOutput(this.outputFor(Ae),i.output);return}if(this.undoLog.length=i.undoMark,i.output)this.flush(i.output)}rollback(i){this.close(i),this.unwind(i.undoMark),this.restore(i)}rollbackWithEvents(i){return this.close(i),this.unwind(i.undoMark),this.restore(i),i.output??Wd}replay(i){if(!Qa(i))return;let Ae=this.currentFrame();if(Ae){this.appendOutput(this.outputFor(Ae),i);return}this.flush(i)}set(i,Ae,Ne){this.willSet(i,Ae),i[Ae]=Ne}remove(i,Ae){this.willSet(i,Ae),delete i[Ae]}append(i,Ae){this.willAppend(i),i.push(Ae)}pop(i){return this.willMutateTail(i,1),i.pop()}truncate(i,Ae){if(Ae<i.length)this.willMutateTail(i,i.length-Ae);else this.willAppend(i);i.length=Ae}modify(i,Ae,Ne){let[_e,De]=Ne(i[Ae]);return this.set(i,Ae,De),_e}willAppend(i){if(!this.active)return;this.undoLog.push({_tag:"ArrayLength",target:i,length:i.length})}willMutateTail(i,Ae){if(!this.active)return;let Ne=Math.max(0,i.length-Ae);this.undoLog.push({_tag:"ArrayTail",target:i,start:Ne,values:i.slice(Ne)})}willSet(i,Ae){if(!this.active)return;let Ne=i;this.undoLog.push({_tag:"Property",target:Ne,key:Ae,had:Object.prototype.hasOwnProperty.call(Ne,Ae),value:Ne[Ae]})}captureCallbacks(){let i=!1;for(let Ae of Si){let Ne=this.options[Ae];if(!Ne)continue;i=!0,this.callbacks[Ae]=Ne,this.callbackWrappers[Ae]=(..._e)=>{this.emit({name:Ae,args:_e})}}return i}activateCallbacks(){for(let i of Si){let Ae=this.callbackWrappers[i];if(Ae)this.options[i]=Ae}}deactivateCallbacks(){for(let i of Si){let Ae=this.callbacks[i];if(Ae)this.options[i]=Ae}}emit(i){let Ae=this.currentFrame();if(!Ae){this.invoke(i);return}let Ne=this.outputFor(Ae).segments,_e=Ne[Ne.length-1];if(Array.isArray(_e))_e.push(i);else Ne.push([i])}appendOutput(i,Ae){if(Qa(Ae))i.segments.push(Ae)}outputFor(i){return i.output??=cc()}flush(i){let Ae=[];for(let Ne=i.segments.length-1;Ne>=0;Ne--)Ae.push(i.segments[Ne]);while(Ae.length>0){let Ne=Ae.pop();if(Array.isArray(Ne)){for(let _e of Ne)this.invoke(_e);continue}for(let _e=Ne.segments.length-1;_e>=0;_e--)Ae.push(Ne.segments[_e])}}invoke(i){this.callbacks[i.name]?.apply(this.options,i.args)}currentFrame(){return this.frames[this.frames.length-1]}close(i){if(this.currentFrame()!==i||i.depth!==this.frames.length-1)throw Error("Parse effect scopes must be closed in order");if(this.frames.pop(),this.frames.length===0&&this.hasCallbacks)this.deactivateCallbacks()}restore(i){if(this.state)this.state.restore(i.checkpoint)}unwind(i){for(let Ae=this.undoLog.length-1;Ae>=i;Ae--){let Ne=this.undoLog[Ae];switch(Ne._tag){case"ArrayLength":if(Ne.target.length<Ne.length)throw Error("A parse effect shortened an append-only array");Ne.target.length=Ne.length;break;case"ArrayTail":Ne.target.length=Ne.start;for(let _e of Ne.values)Ne.target.push(_e);break;case"Property":if(Ne.had)Ne.target[Ne.key]=Ne.value;else delete Ne.target[Ne.key];break}}this.undoLog.length=i}};function nr(i,Ae,Ne){if(i.length===Ae)return i;if(i.length<Ae)throw Error(`A parse branch shortened the ${Ne} below its checkpoint`);return i.length=Ae,i}function Gd(i){return{lookahead:i.getCurLookaheadState(),context:i.context,contextLength:i.context.length,scopeStack:i.scopeStack,scopeStackLength:i.scopeStack.length,importsStack:i.importsStack,importsStackLength:i.importsStack.length,labels:i.labels,labelsLength:i.labels.length,privateNameStack:i.privateNameStack,privateNameStackLength:i.privateNameStack.length,decoratorStack:i.decoratorStack,decoratorStackLength:i.decoratorStack.length,strict:i.strict,potentialArrowAt:i.potentialArrowAt,potentialArrowInForAwait:i.potentialArrowInForAwait,yieldPos:i.yieldPos,awaitPos:i.awaitPos,awaitIdentPos:i.awaitIdentPos,preValue:i.preValue,preToken:i.preToken,isLookahead:i.isLookahead,isAmbientContext:i.isAmbientContext,inAbstractClass:i.inAbstractClass,inType:i.inType,inDisallowConditionalTypesContext:i.inDisallowConditionalTypesContext,maybeInArrowParameters:i.maybeInArrowParameters,shouldParseArrowReturnType:i.shouldParseArrowReturnType,shouldParseAsyncArrowReturnType:i.shouldParseAsyncArrowReturnType,importOrExportOuterKind:i.importOrExportOuterKind}}function Ud(i,Ae){i.setLookaheadTokenState(Ae.lookahead),i.context=nr(Ae.context,Ae.contextLength,"token context stack"),i.scopeStack=nr(Ae.scopeStack,Ae.scopeStackLength,"scope stack"),i.importsStack=nr(Ae.importsStack,Ae.importsStackLength,"import stack"),i.labels=nr(Ae.labels,Ae.labelsLength,"label stack"),i.privateNameStack=nr(Ae.privateNameStack,Ae.privateNameStackLength,"private-name stack"),i.decoratorStack=nr(Ae.decoratorStack,Ae.decoratorStackLength,"decorator stack"),i.strict=Ae.strict,i.potentialArrowAt=Ae.potentialArrowAt,i.potentialArrowInForAwait=Ae.potentialArrowInForAwait,i.yieldPos=Ae.yieldPos,i.awaitPos=Ae.awaitPos,i.awaitIdentPos=Ae.awaitIdentPos,i.regexpState=null,i.preValue=Ae.preValue,i.preToken=Ae.preToken,i.isLookahead=Ae.isLookahead,i.isAmbientContext=Ae.isAmbientContext,i.inAbstractClass=Ae.inAbstractClass,i.inType=Ae.inType,i.inDisallowConditionalTypesContext=Ae.inDisallowConditionalTypesContext,i.maybeInArrowParameters=Ae.maybeInArrowParameters,i.shouldParseArrowReturnType=Ae.shouldParseArrowReturnType,i.shouldParseAsyncArrowReturnType=Ae.shouldParseAsyncArrowReturnType,i.importOrExportOuterKind=Ae.importOrExportOuterKind}function Hd(i){return{capture:()=>Gd(i),restore:(Ae)=>Ud(i,Ae)}}function Kd(i,Ae){let{acornTokenTypes:Ne,typeScriptTokenTypes:_e,scope:De}=Ae,Re=De.SCOPE_TOP|De.SCOPE_FUNCTION|De.SCOPE_CLASS_STATIC_BLOCK;return class extends i{constructor(Oe,Me,Fe){super(Oe,Me,Fe);this.parseEffects=new qd(this.options,Hd(this))}overrideContext(Oe){if(this.curContext()!==Oe)this.parseEffects?.willMutateTail(this.context,1);return super.overrideContext(Oe)}takeDecorators(Oe){let Me=this.decoratorStack.length-1;if(this.decoratorStack[Me].length>0)this.parseEffects?.willSet(this.decoratorStack,String(Me));return super.takeDecorators(Oe)}parseDecorators(Oe){let Me=this.decoratorStack[this.decoratorStack.length-1];return this.parseEffects?.willAppend(Me),super.parseDecorators(Oe)}parseDecorator(){return this.parseEffects?.willAppend(this.decoratorStack),super.parseDecorator()}parseIdentNode(){if((this.type.keyword==="class"||this.type.keyword==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46))this.parseEffects?.willMutateTail(this.context,1);return super.parseIdentNode()}parseLabeledStatement(Oe,Me,Fe,Be){for(let Ve=this.labels.length-1;Ve>=0;Ve--){let Ge=this.labels[Ve];if(Ge.statementStart!==Oe.start)break;this.parseEffects?.willSet(Ge,"statementStart"),this.parseEffects?.willSet(Ge,"kind")}return this.parseEffects?.willAppend(this.labels),super.parseLabeledStatement(Oe,Me,Fe,Be)}enterClassBody(){return this.parseEffects?.willAppend(this.privateNameStack),super.enterClassBody()}exitClassBody(){let Oe=this.privateNameStack[this.privateNameStack.length-2];if(Oe)this.parseEffects?.willAppend(Oe.used);return this.parseEffects?.willMutateTail(this.privateNameStack,1),super.exitClassBody()}parsePrivateIdent(){if(this.options.checkPrivateFields&&this.privateNameStack.length>0){let Oe=this.privateNameStack[this.privateNameStack.length-1];this.parseEffects?.willAppend(Oe.used)}return super.parsePrivateIdent()}parseClassField(Oe){return this.parseEffects?.willSet(this.currentThisScope(),"inClassFieldInit"),super.parseClassField(Oe)}updateContext(Oe){let{type:Me}=this;if(Me===Ne.parenR||Me===Ne.braceR||Me===Ne.braceL||Me===Ne.dollarBraceL||Me===Ne.parenL||Me===Ne._function||Me===Ne._class||Me===Ne.colon||Me===Ne.backQuote||Me===Ne.star||Me===_e.jsxTagStart||Me===_e.jsxTagEnd||Me===Ne.slash&&Oe===_e.jsxTagStart)this.parseEffects?.willMutateTail(this.context,2);return super.updateContext(Oe)}enterScope(Oe){return this.parseEffects?.willAppend(this.scopeStack),super.enterScope(Oe)}exitScope(){return this.parseEffects?.willMutateTail(this.scopeStack,1),super.exitScope()}declareName(Oe,Me,Fe){let Be=this.parseEffects;if(Be?.active)if(Me===De.BIND_LEXICAL){let Ve=this.currentScope();if(Be.willAppend(Ve.lexical),this.inModule&&Ve.flags&De.SCOPE_TOP)Be.willSet(this.undefinedExports,Oe)}else if(Me===De.BIND_SIMPLE_CATCH)Be.willAppend(this.currentScope().lexical);else if(Me===De.BIND_FUNCTION)Be.willAppend(this.currentScope().functions);else for(let Ve=this.scopeStack.length-1;Ve>=0;Ve--){let Ge=this.scopeStack[Ve];if(Be.willAppend(Ge.var),this.inModule&&Ge.flags&De.SCOPE_TOP)Be.willSet(this.undefinedExports,Oe);if(Ge.flags&Re)break}return super.declareName(Oe,Me,Fe)}checkLocalExport(Oe){return this.parseEffects?.willSet(this.undefinedExports,Oe.name),super.checkLocalExport(Oe)}}}var vi=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;function Za(i){if(!i)throw Error("Assert fail")}function zd(i){return i==="accessor"}function Xd(i){return i==="in"||i==="out"}var ss=1,ec=2,Jd=4,xt={SCOPE_TOP:1,SCOPE_FUNCTION:2,SCOPE_ASYNC:4,SCOPE_GENERATOR:8,SCOPE_ARROW:16,SCOPE_SIMPLE_CATCH:32,SCOPE_SUPER:64,SCOPE_DIRECT_SUPER:128,SCOPE_CLASS_STATIC_BLOCK:256,SCOPE_VAR:256,BIND_NONE:0,BIND_VAR:1,BIND_LEXICAL:2,BIND_FUNCTION:3,BIND_SIMPLE_CATCH:4,BIND_OUTSIDE:5,BIND_TS_TYPE:6,BIND_TS_INTERFACE:7,BIND_TS_NAMESPACE:1032,BIND_FLAGS_TS_EXPORT_ONLY:1024,BIND_FLAGS_TS_IMPORT:4096,BIND_FLAGS_TS_ENUM:256,BIND_FLAGS_TS_CONST_ENUM:512,BIND_TS_ENUM:258,BIND_TS_CONST_ENUM:770,BIND_FLAGS_CLASS:128};function Ti(i,Ae){return xt.SCOPE_FUNCTION|(i?xt.SCOPE_ASYNC:0)|(Ae?xt.SCOPE_GENERATOR:0)}function Yd(i){if(i.type!=="MemberExpression")return!1;let{computed:Ae,property:Ne}=i;if(Ae&&(Ne.type!=="TemplateLiteral"||Ne.expressions.length>0))return!1;return lc(i.object)}function Qd(i){return i.type==="UnaryExpression"&&(i.operator==="-"||i.operator==="+")&&i.argument.type==="Literal"&&(typeof i.argument.value==="number"||typeof i.argument.value==="bigint")}function lc(i){if(i.type==="Identifier")return!0;if(i.type!=="MemberExpression")return!1;if(i.computed)return!1;return lc(i.object)}function tc(i){return i==="private"||i==="public"||i==="protected"}function Zd(i){return Boolean(i.startsExpr)}function ef(i){if(i==null)throw Error(`Unexpected ${i} value.`);return i}function tf(i){switch(i){case"any":return"TSAnyKeyword";case"boolean":return"TSBooleanKeyword";case"bigint":return"TSBigIntKeyword";case"never":return"TSNeverKeyword";case"number":return"TSNumberKeyword";case"object":return"TSObjectKeyword";case"string":return"TSStringKeyword";case"symbol":return"TSSymbolKeyword";case"undefined":return"TSUndefinedKeyword";case"unknown":return"TSUnknownKeyword";default:return}}function pc(i){let{dts:Ae=!1}=i||{},Ne=!!i?.jsx;return function(_e){let De=_e.acorn||Ci,Re=Pd(De),{tokTypes:Ie,keywordTypes:Oe,isIdentifierStart:Me,lineBreak:Fe,isNewLine:Be,tokContexts:Ve,isIdentifierChar:Ge}=De,{tokTypes:Ue,tokContexts:Xe,keywordsRegExp:ze,tokenIsLiteralPropertyName:Qe,tokenIsTemplate:rt,tokenIsTSDeclarationStart:ot,tokenIsIdentifier:Ye,tokenIsKeywordOrIdentifier:nt,tokenIsTSTypeOperator:it}=Re;function bt(Le,$e,je=Le.length){for(let qe=$e;qe<je;qe++){let He=Le.charCodeAt(qe);if(Be(He))return qe<je-1&&He===13&&Le.charCodeAt(qe+1)===10?qe+2:qe+1}return-1}if(_e=$d(_e,Re,De),i?.jsx)_e=jd(De,Re,_e,typeof i.jsx==="boolean"?{}:i.jsx);_e=Vd(_e,Re,De);let _t=Kd(_e,{acornTokenTypes:Ie,typeScriptTokenTypes:Ue,scope:xt});class Dt extends _t{constructor(Le,$e,je){super(Le,$e,je);this.preValue=null,this.preToken=null,this.isLookahead=!1,this.isAmbientContext=!1,this.inAbstractClass=!1,this.inType=!1,this.inDisallowConditionalTypesContext=!1,this.maybeInArrowParameters=!1,this.shouldParseArrowReturnType=void 0,this.shouldParseAsyncArrowReturnType=void 0,this.decoratorStack=[[]],this.importsStack=[[]],this.importOrExportOuterKind=void 0,this.tsParseConstModifier=(qe)=>{this.tsParseModifiers({modified:qe,allowedModifiers:["const"],disallowedModifiers:["in","out"],errorTemplate:ct.InvalidModifierOnTypeParameterPositions})},this.ecmaVersion=this.options.ecmaVersion}static get acornTypeScript(){return Re}get acornTypeScript(){return Re}getTokenFromCodeInType(Le){if(Le===62)return this.finishOp(Ie.relational,1);if(Le===60)return this.finishOp(Ie.relational,1);return super.getTokenFromCode(Le)}readToken(Le){if(!this.inType){let $e=this.curContext();if($e===Xe.tc_expr)return this.jsx_readToken();if($e===Xe.tc_oTag||$e===Xe.tc_cTag){if(Me(Le))return this.jsx_readWord();if(Le==62)return++this.pos,this.finishToken(Ue.jsxTagEnd);if((Le===34||Le===39)&&$e==Xe.tc_oTag)return this.jsx_readString(Le)}if(Le===60&&this.exprAllowed&&this.input.charCodeAt(this.pos+1)!==33)if(++this.pos,i?.jsx)return this.finishToken(Ue.jsxTagStart);else return this.finishToken(Ie.relational,"<")}return super.readToken(Le)}getTokenFromCode(Le){if(this.inType)return this.getTokenFromCodeInType(Le);if(Le===64)return++this.pos,this.finishToken(Ue.at);return super.getTokenFromCode(Le)}isAbstractClass(){return this.ts_isContextual(Ue.abstract)&&this.lookahead().type===Ie._class}isDeclareClass(){if(!this.ts_isContextual(Ue.declare))return!1;let Le=this.nextTokenStart();if(this.isUnparsedContextual(Le,"class"))return!0;if(!this.isUnparsedContextual(Le,"abstract"))return!1;let $e=this.nextTokenStartSince(Le+8);return this.isUnparsedContextual($e,"class")}finishNode(Le,$e){if(Le.type!==""&&Le.end!==0)return Le;return super.finishNode(Le,$e)}tryParse(Le){let $e={},je=this.beginParseEffectScope(),qe;try{qe=Le(()=>{throw $e})}catch(He){let Ke=He===$e;if(!Ke&&!(He instanceof SyntaxError))throw this.parseEffects.rollback(je),He;let Ze={events:this.parseEffects.rollbackWithEvents(je),selected:!1};return Ke?{node:null,error:null,thrown:!1,aborted:!0,failState:Ze}:{node:null,error:He,thrown:!0,aborted:!1,failState:Ze}}return this.parseEffects.commit(je),{node:qe,error:null,thrown:!1,aborted:!1,failState:null}}setOptionalParametersError(Le,$e){Le.optionalParametersLoc=$e?.loc??this.startLoc}reScan_lt_gt(){if(this.type===Ie.relational)this.pos-=1,this.readToken_lt_gt(this.fullCharCodeAtPos())}reScan_lt(){let{type:Le}=this;if(Le===Ie.bitShift)return this.pos-=2,this.finishOp(Ie.relational,1),Ie.relational;return Le}resetEndLocation(Le,$e=this.lastTokEnd,je=this.lastTokEndLoc){if(Le.end=$e,Le.loc.end=je,this.options.ranges)Le.range[1]=$e}startNodeAtNode(Le){return super.startNodeAt(Le.start,Le.loc.start)}nextTokenStart(){return this.nextTokenStartSince(this.pos)}tsHasSomeModifiers(Le,$e){return $e.some((je)=>{if(tc(je))return Le.accessibility===je;return!!Le[je]})}tsIsStartOfStaticBlocks(){return this.isContextual("static")&&this.lookaheadCharCode()===123}tsCheckForInvalidTypeCasts(Le){Le.forEach(($e)=>{if($e?.type==="TSTypeCastExpression")this.raise($e.typeAnnotation.start,ct.UnexpectedTypeAnnotation)})}atPossibleAsyncArrow(Le){return Le.type==="Identifier"&&Le.name==="async"&&this.lastTokEnd===Le.end&&!this.canInsertSemicolon()&&Le.end-Le.start===5&&Le.start===this.potentialArrowAt}tsIsIdentifier(){return Ye(this.type)}tsTryParseTypeOrTypePredicateAnnotation(){return this.match(Ie.colon)?this.tsParseTypeOrTypePredicateAnnotation(Ie.colon):void 0}tsTryParseGenericAsyncArrowFunction(Le,$e,je){if(!this.tsMatchLeftRelational())return;let qe=this.maybeInArrowParameters;this.maybeInArrowParameters=!0;let He=this.tsTryParseAndCatch(()=>{let Ke=this.startNodeAt(Le,$e);return Ke.typeParameters=this.tsParseTypeParameters(this.tsParseConstModifier),super.parseFunctionParams(Ke),Ke.returnType=this.tsTryParseTypeOrTypePredicateAnnotation(),this.expect(Ie.arrow),Ke});if(this.maybeInArrowParameters=qe,!He)return;return this.parseArrowExpression(He,He.params,!0,je)}tsParseTypeArgumentsInExpression(){if(this.reScan_lt()!==Ie.relational)return;return this.tsParseTypeArguments(!0)}tsInNoContext(Le){let $e=this.context;this.context=[$e[0]];try{return Le()}finally{this.context=$e}}tsTryParseTypeAnnotation(){return this.match(Ie.colon)?this.tsParseTypeAnnotation():void 0}isUnparsedContextual(Le,$e){let je=Le+$e.length;if(this.input.slice(Le,je)===$e){let qe=this.input.charCodeAt(je);return!(Ge(qe)||(qe&64512)===55296)}return!1}isAbstractConstructorSignature(){return this.ts_isContextual(Ue.abstract)&&this.lookahead().type===Ie._new}nextTokenStartSince(Le){return vi.lastIndex=Le,vi.test(this.input)?vi.lastIndex:Le}lookaheadCharCode(){return this.input.charCodeAt(this.nextTokenStart())}createLookaheadState(){this.value=null,this.context=[this.curContext()]}getCurLookaheadState(){return{endLoc:this.endLoc,lastTokEnd:this.lastTokEnd,lastTokStart:this.lastTokStart,lastTokStartLoc:this.lastTokStartLoc,pos:this.pos,value:this.value,type:this.type,exprAllowed:this.exprAllowed,start:this.start,end:this.end,context:this.context,startLoc:this.startLoc,lastTokEndLoc:this.lastTokEndLoc,curLine:this.curLine,lineStart:this.lineStart,containsEsc:this.containsEsc}}setLookaheadTokenState(Le){this.pos=Le.pos,this.value=Le.value,this.exprAllowed=Le.exprAllowed,this.endLoc=Le.endLoc,this.lastTokEnd=Le.lastTokEnd,this.lastTokStart=Le.lastTokStart,this.lastTokStartLoc=Le.lastTokStartLoc,this.type=Le.type,this.start=Le.start,this.end=Le.end,this.startLoc=Le.startLoc,this.lastTokEndLoc=Le.lastTokEndLoc,this.curLine=Le.curLine,this.lineStart=Le.lineStart,this.containsEsc=Le.containsEsc}setLookaheadState(Le){this.setLookaheadTokenState(Le),this.context=Le.context&&Le.context.slice()}beginParseEffectScope(){return this.parseEffects.begin()}selectTryParseResult(Le){let $e=Le.failState;if(!$e)return;if($e.selected)throw Error("A parse branch result can only be selected once");$e.selected=!0,this.parseEffects.replay($e.events)}tsLookAhead(Le){let $e=this.beginParseEffectScope();try{return Le()}finally{this.parseEffects.rollback($e)}}lookahead(Le){let $e=this.getCurLookaheadState(),je=this.context,qe=this.preValue,He=this.preToken,Ke=this.isLookahead;try{if(this.createLookaheadState(),this.isLookahead=!0,Le!==void 0)for(let Ze=0;Ze<Le;Ze++)this.nextToken();else this.nextToken();return this.getCurLookaheadState()}finally{this.setLookaheadTokenState($e),this.context=je,this.preValue=qe,this.preToken=He,this.isLookahead=Ke}}readWord(){let Le=this.readWord1(),$e=Ie.name;if(this.keywords.test(Le))$e=Oe[Le];else if(new RegExp(ze).test(Le))$e=Ue[Le];return this.finishToken($e,Le)}skipBlockComment(){let Le;if(!this.isLookahead)Le=this.options.onComment&&this.curPosition();let $e=this.pos,je=this.input.indexOf("*/",this.pos+=2);if(je===-1)this.raise(this.pos-2,"Unterminated comment");if(this.pos=je+2,this.options.locations)for(let qe,He=$e;(qe=bt(this.input,He,this.pos))>-1;)++this.curLine,He=this.lineStart=qe;if(this.isLookahead)return;if(this.options.onComment)this.options.onComment(!0,this.input.slice($e+2,je),$e,this.pos,Le,this.curPosition())}skipLineComment(Le){let $e=this.pos,je;if(!this.isLookahead)je=this.options.onComment&&this.curPosition();let qe=this.input.charCodeAt(this.pos+=Le);while(this.pos<this.input.length&&!Be(qe))qe=this.input.charCodeAt(++this.pos);if(this.isLookahead)return;if(this.options.onComment)this.options.onComment(!1,this.input.slice($e+Le,this.pos),$e,this.pos,je,this.curPosition())}finishToken(Le,$e){if(this.preValue=this.value,this.preToken=this.type,this.end=this.pos,this.options.locations)this.endLoc=this.curPosition();let je=this.type;if(this.type=Le,this.value=$e,!this.isLookahead)this.updateContext(je)}resetStartLocation(Le,$e,je){if(Le.start=$e,Le.loc.start=je,this.options.ranges)Le.range[0]=$e}isLineTerminator(){return this.eat(Ie.semi)||super.canInsertSemicolon()}hasFollowingLineBreak(){return Xa.lastIndex=this.end,Xa.test(this.input)}addExtra(Le,$e,je,qe=!0){if(!Le)return;let He=Le.extra=Le.extra||{};if(qe)He[$e]=je;else Object.defineProperty(He,$e,{enumerable:qe,value:je})}isLiteralPropertyName(){return Qe(this.type)}hasPrecedingLineBreak(){return Fe.test(this.input.slice(this.lastTokEnd,this.start))}createIdentifier(Le,$e){return Le.name=$e,this.finishNode(Le,"Identifier")}resetStartLocationFromNode(Le,$e){this.resetStartLocation(Le,$e.start,$e.loc.start)}isThisParam(Le){return Le.type==="Identifier"&&Le.name==="this"}isLookaheadContextual(Le){let $e=this.nextTokenStart();return this.isUnparsedContextual($e,Le)}ts_type_isContextual(Le,$e){return Le===$e&&!this.containsEsc}ts_isContextual(Le){return this.type===Le&&!this.containsEsc}ts_isContextualWithState(Le,$e){return Le.type===$e&&!Le.containsEsc}isContextualWithState(Le,$e){return $e.type===Ie.name&&$e.value===Le&&!$e.containsEsc}tsIsStartOfMappedType(){if(this.next(),this.eat(Ie.plusMin))return this.ts_isContextual(Ue.readonly);if(this.ts_isContextual(Ue.readonly))this.next();if(!this.match(Ie.bracketL))return!1;if(this.next(),!this.tsIsIdentifier())return!1;return this.next(),this.match(Ie._in)}tsInDisallowConditionalTypesContext(Le){let $e=this.inDisallowConditionalTypesContext;this.inDisallowConditionalTypesContext=!0;try{return Le()}finally{this.inDisallowConditionalTypesContext=$e}}tsTryParseType(){return this.tsEatThenParseType(Ie.colon)}match(Le){return this.type===Le}matchJsx(Le){return this.type===Re.tokTypes[Le]}ts_eatWithState(Le,$e,je){let qe=je.type;if(Le===qe){for(let He=0;He<$e;He++)this.next();return!0}else return!1}ts_eatContextualWithState(Le,$e,je){if(ze.test(Le)){if(this.ts_isContextualWithState(je,Ue[Le])){for(let qe=0;qe<$e;qe++)this.next();return!0}return!1}else{if(!this.isContextualWithState(Le,je))return!1;for(let qe=0;qe<$e;qe++)this.next();return!0}}canHaveLeadingDecorator(){return this.match(Ie._class)||this.isAbstractClass()||this.isDeclareClass()}eatContextual(Le){if(ze.test(Le)){if(this.ts_isContextual(Ue[Le]))return this.next(),!0;return!1}else return super.eatContextual(Le)}tsIsExternalModuleReference(){return this.isContextual("require")&&this.lookaheadCharCode()===40}tsParseExternalModuleReference(){let Le=this.startNode();if(this.expectContextual("require"),this.expect(Ie.parenL),!this.match(Ie.string))this.unexpected();return Le.expression=this.parseExprAtom(),this.expect(Ie.parenR),this.finishNode(Le,"TSExternalModuleReference")}tsParseEntityName(Le=!0){let $e=this.parseIdent(Le);while(this.eat(Ie.dot)){let je=this.startNodeAtNode($e);je.left=$e,je.right=this.parseIdent(Le),$e=this.finishNode(je,"TSQualifiedName")}return $e}tsParseEnumMember(){let Le=this.startNode();if(Le.id=this.match(Ie.string)?this.parseLiteral(this.value):this.parseIdent(!0),this.eat(Ie.eq))Le.initializer=this.parseMaybeAssign();return this.finishNode(Le,"TSEnumMember")}tsParseEnumDeclaration(Le,$e={}){if($e.const)Le.const=!0;if($e.declare)Le.declare=!0;this.expectContextual("enum"),Le.id=this.parseIdent();let je=$e.const?xt.BIND_TS_CONST_ENUM:xt.BIND_TS_ENUM;return this.checkLValSimple(Le.id,je),this.expect(Ie.braceL),Le.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(Ie.braceR),this.finishNode(Le,"TSEnumDeclaration")}tsParseModuleBlock(){let Le=this.startNode();this.enterScope(Nd),this.expect(Ie.braceL),Le.body=[];while(this.type!==Ie.braceR){let $e=this.parseStatement(null,!0);Le.body.push($e)}return this.next(),super.exitScope(),this.finishNode(Le,"TSModuleBlock")}tsParseAmbientExternalModuleDeclaration(Le){if(this.ts_isContextual(Ue.global))Le.global=!0,Le.id=this.parseIdent();else if(this.match(Ie.string))Le.id=this.parseLiteral(this.value);else this.unexpected();if(this.match(Ie.braceL))this.enterScope(vr),Le.body=this.tsParseModuleBlock(),super.exitScope();else super.semicolon();return this.finishNode(Le,"TSModuleDeclaration")}tsTryParseDeclare(Le){if(this.isLineTerminator())return;let $e=this.type,je;if(this.isContextual("let"))$e=Ie._var,je="let";return this.tsInAmbientContext(()=>{if($e===Ie._function)return Le.declare=!0,this.parseFunctionStatement(Le,!1,!0);if($e===Ie._class)return Le.declare=!0,this.parseClass(Le,!0);if($e===Ue.enum)return this.tsParseEnumDeclaration(Le,{declare:!0});if($e===Ue.global)return this.tsParseAmbientExternalModuleDeclaration(Le);if($e===Ie._const||$e===Ie._var){if(!this.match(Ie._const)||!this.isLookaheadContextual("enum"))return Le.declare=!0,this.parseVarStatement(Le,je||this.value,!0);return this.expect(Ie._const),this.tsParseEnumDeclaration(Le,{const:!0,declare:!0})}if($e===Ue.interface){let qe=this.tsParseInterfaceDeclaration(Le,{declare:!0});if(qe)return qe}if(Ye($e))return this.tsParseDeclaration(Le,this.value,!0)})}tsIsListTerminator(Le){switch(Le){case"EnumMembers":case"TypeMembers":return this.match(Ie.braceR);case"HeritageClauseElement":return this.match(Ie.braceL);case"TupleElementTypes":return this.match(Ie.bracketR);case"TypeParametersOrArguments":return this.tsMatchRightRelational()}}tsParseDelimitedListWorker(Le,$e,je,qe){let He=[],Ke=-1;for(;;){if(this.tsIsListTerminator(Le))break;Ke=-1;let Ze=$e();if(Ze==null)return;if(He.push(Ze),this.eat(Ie.comma)){Ke=this.lastTokStart;continue}if(this.tsIsListTerminator(Le))break;if(je)this.expect(Ie.comma);return}if(qe)qe.value=Ke;return He}tsParseDelimitedList(Le,$e,je){return ef(this.tsParseDelimitedListWorker(Le,$e,!0,je))}tsParseBracketedList(Le,$e,je,qe,He){if(!qe)if(je)this.expect(Ie.bracketL);else this.expect(Ie.relational);let Ke=this.tsParseDelimitedList(Le,$e,He);if(je)this.expect(Ie.bracketR);else this.expect(Ie.relational);return Ke}tsParseTypeParameterName(){return this.parseIdent().name}tsEatThenParseType(Le){return!this.match(Le)?void 0:this.tsNextThenParseType()}tsExpectThenParseType(Le){return this.tsDoThenParseType(()=>this.expect(Le))}tsNextThenParseType(){return this.tsDoThenParseType(()=>this.next())}tsDoThenParseType(Le){return this.tsInType(()=>(Le(),this.tsParseType()))}tsSkipParameterStart(){if(Ye(this.type)||this.match(Ie._this))return this.next(),!0;if(this.match(Ie.braceL))try{return this.parseObj(!0),!0}catch{return!1}if(this.match(Ie.bracketL)){this.next();try{return this.parseBindingList(Ie.bracketR,!0,!0),!0}catch{return!1}}return!1}tsIsUnambiguouslyStartOfFunctionType(){if(this.next(),this.match(Ie.parenR)||this.match(Ie.ellipsis))return!0;if(this.tsSkipParameterStart()){if(this.match(Ie.colon)||this.match(Ie.comma)||this.match(Ie.question)||this.match(Ie.eq))return!0;if(this.match(Ie.parenR)){if(this.next(),this.match(Ie.arrow))return!0}}return!1}tsIsStartOfFunctionType(){if(this.tsMatchLeftRelational())return!0;return this.match(Ie.parenL)&&this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))}tsInAllowConditionalTypesContext(Le){let $e=this.inDisallowConditionalTypesContext;this.inDisallowConditionalTypesContext=!1;try{return Le()}finally{this.inDisallowConditionalTypesContext=$e}}tsParseBindingListForSignature(){return super.parseBindingList(Ie.parenR,!0,!0).map((Le)=>{if(Le.type!=="Identifier"&&Le.type!=="RestElement"&&Le.type!=="ObjectPattern"&&Le.type!=="ArrayPattern")this.raise(Le.start,ct.UnsupportedSignatureParameterKind({type:Le.type}));return Le})}tsParseTypePredicateAsserts(){if(this.type!==Ue.asserts)return!1;let Le=this.containsEsc;if(this.next(),!Ye(this.type)&&!this.match(Ie._this))return!1;if(Le)this.raise(this.lastTokStart,"Escape sequence in keyword asserts");return!0}tsParseThisTypeNode(){let Le=this.startNode();return this.next(),this.finishNode(Le,"TSThisType")}tsParseTypeAnnotation(Le=!0,$e=this.startNode()){return this.tsInType(()=>{if(Le)this.expect(Ie.colon);$e.typeAnnotation=this.tsParseType()}),this.finishNode($e,"TSTypeAnnotation")}tsParseThisTypePredicate(Le){this.next();let $e=this.startNodeAtNode(Le);return $e.parameterName=Le,$e.typeAnnotation=this.tsParseTypeAnnotation(!1),$e.asserts=!1,this.finishNode($e,"TSTypePredicate")}tsParseThisTypeOrThisTypePredicate(){let Le=this.tsParseThisTypeNode();if(this.isContextual("is")&&!this.hasPrecedingLineBreak())return this.tsParseThisTypePredicate(Le);else return Le}tsParseTypePredicatePrefix(){let Le=this.parseIdent();if(this.isContextual("is")&&!this.hasPrecedingLineBreak())return this.next(),Le}tsParseTypeOrTypePredicateAnnotation(Le){return this.tsInType(()=>{let $e=this.startNode();this.expect(Le);let je=this.startNode(),qe=this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(qe){let tt=this.tsParseTypeAnnotation(!1);return je.parameterName=qe,je.typeAnnotation=tt,je.asserts=!1,$e.typeAnnotation=this.finishNode(je,"TSTypePredicate"),this.finishNode($e,"TSTypeAnnotation")}let He=!!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));if(He&&this.match(Ie._this)){let tt=this.tsParseThisTypeOrThisTypePredicate();if(tt.type==="TSThisType")je.parameterName=tt,je.asserts=!0,je.typeAnnotation=null,tt=this.finishNode(je,"TSTypePredicate");else this.resetStartLocationFromNode(tt,je),tt.asserts=!0;return $e.typeAnnotation=tt,this.finishNode($e,"TSTypeAnnotation")}let Ke=He&&this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(!Ke){if(!He)return this.tsParseTypeAnnotation(!1,$e);return je.parameterName=this.parseIdent(),je.asserts=He,je.typeAnnotation=null,$e.typeAnnotation=this.finishNode(je,"TSTypePredicate"),this.finishNode($e,"TSTypeAnnotation")}let Ze=this.tsParseTypeAnnotation(!1);return je.parameterName=Ke,je.typeAnnotation=Ze,je.asserts=He,$e.typeAnnotation=this.finishNode(je,"TSTypePredicate"),this.finishNode($e,"TSTypeAnnotation")})}tsFillSignature(Le,$e){let je=Le===Ie.arrow,qe="parameters",He="typeAnnotation";if($e.typeParameters=this.tsTryParseTypeParameters(),this.expect(Ie.parenL),$e.parameters=this.tsParseBindingListForSignature(),je)$e.typeAnnotation=this.tsParseTypeOrTypePredicateAnnotation(Le);else if(this.match(Le))$e.typeAnnotation=this.tsParseTypeOrTypePredicateAnnotation(Le)}tsTryNextParseConstantContext(){if(this.lookahead().type!==Ie._const)return null;this.next();let Le=this.tsParseTypeReference();if(Le.typeParameters||Le.typeArguments)this.raise(Le.typeName.start,ct.CannotFindName({name:"const"}));return Le}tsParseFunctionOrConstructorType(Le,$e){let je=this.startNode();if(Le==="TSConstructorType"){if(je.abstract=!!$e,$e)this.next();this.next()}return this.tsInAllowConditionalTypesContext(()=>this.tsFillSignature(Ie.arrow,je)),this.finishNode(je,Le)}tsParseUnionOrIntersectionType(Le,$e,je){let qe=this.startNode(),He=this.eat(je),Ke=[];do Ke.push($e());while(this.eat(je));if(Ke.length===1&&!He)return Ke[0];return qe.types=Ke,this.finishNode(qe,Le)}tsCheckTypeAnnotationForReadOnly(Le){switch(Le.typeAnnotation.type){case"TSTupleType":case"TSArrayType":return;default:this.raise(Le.start,ct.UnexpectedReadonly)}}tsParseTypeOperator(){let Le=this.startNode(),$e=this.value;if(this.next(),Le.operator=$e,Le.typeAnnotation=this.tsParseTypeOperatorOrHigher(),$e==="readonly")this.tsCheckTypeAnnotationForReadOnly(Le);return this.finishNode(Le,"TSTypeOperator")}tsParseConstraintForInferType(){if(this.eat(Ie._extends)){let Le=this.tsInDisallowConditionalTypesContext(()=>this.tsParseType());if(this.inDisallowConditionalTypesContext||!this.match(Ie.question))return Le}}tsParseInferType(){let Le=this.startNode();this.expectContextual("infer");let $e=this.startNode();return $e.name=this.tsParseTypeParameterName(),$e.constraint=this.tsTryParse(()=>this.tsParseConstraintForInferType()),Le.typeParameter=this.finishNode($e,"TSTypeParameter"),this.finishNode(Le,"TSInferType")}tsParseLiteralTypeNode(){let Le=this.startNode();return Le.literal=(()=>{switch(this.type){case Ie.num:case Ie.string:case Ie._true:case Ie._false:return this.parseExprAtom();default:this.unexpected()}})(),this.finishNode(Le,"TSLiteralType")}tsParseImportType(){let Le=this.startNode();if(this.expect(Ie._import),this.expect(Ie.parenL),!this.match(Ie.string))this.raise(this.start,ct.UnsupportedImportTypeArgument);if(Le.argument=this.parseExprAtom(),this.expect(Ie.parenR),this.eat(Ie.dot))Le.qualifier=this.tsParseEntityName();if(this.tsMatchLeftRelational())Le.typeArguments=this.tsParseTypeArguments();return this.finishNode(Le,"TSImportType")}tsParseTypeQuery(){let Le=this.startNode();if(this.expect(Ie._typeof),this.match(Ie._import))Le.exprName=this.tsParseImportType();else Le.exprName=this.tsParseEntityName();if(!this.hasPrecedingLineBreak()&&this.tsMatchLeftRelational())Le.typeArguments=this.tsParseTypeArguments();return this.finishNode(Le,"TSTypeQuery")}tsParseMappedTypeParameter(){let Le=this.startNode();return Le.name=this.tsParseTypeParameterName(),Le.constraint=this.tsExpectThenParseType(Ie._in),this.finishNode(Le,"TSTypeParameter")}tsParseMappedType(){let Le=this.startNode();if(this.expect(Ie.braceL),this.match(Ie.plusMin))Le.readonly=this.value,this.next(),this.expectContextual("readonly");else if(this.eatContextual("readonly"))Le.readonly=!0;if(this.expect(Ie.bracketL),Le.typeParameter=this.tsParseMappedTypeParameter(),Le.nameType=this.eatContextual("as")?this.tsParseType():null,this.expect(Ie.bracketR),this.match(Ie.plusMin))Le.optional=this.value,this.next(),this.expect(Ie.question);else if(this.eat(Ie.question))Le.optional=!0;return Le.typeAnnotation=this.tsTryParseType(),this.semicolon(),this.expect(Ie.braceR),this.finishNode(Le,"TSMappedType")}tsParseTypeLiteral(){let Le=this.startNode();return Le.members=this.tsParseObjectTypeMembers(),this.finishNode(Le,"TSTypeLiteral")}tsIsTupleElementLabel(){if(!nt(this.type))return!1;let Le=this.lookahead();if(Le.type===Ie.colon)return!0;if(Le.type!==Ie.question)return!1;return this.lookahead(2).type===Ie.colon}tsParseTupleElementType(){let Le=this.startLoc,$e=this.start,je=this.eat(Ie.ellipsis),qe;if(this.tsIsTupleElementLabel()){let He=this.startNode();He.label=this.parseIdent(!0),He.optional=this.eat(Ie.question),this.expect(Ie.colon),He.elementType=this.tsParseType(),qe=this.finishNode(He,"TSNamedTupleMember")}else{qe=this.tsParseType();let He=this.eat(Ie.question);if(this.eat(Ie.colon))this.raise(qe.start,ct.InvalidTupleMemberLabel);if(He){let Ke=this.startNodeAtNode(qe);Ke.typeAnnotation=qe,qe=this.finishNode(Ke,"TSOptionalType")}}if(je){let He=this.startNodeAt($e,Le);He.typeAnnotation=qe,qe=this.finishNode(He,"TSRestType")}return qe}tsParseTupleType(){let Le=this.startNode();Le.elementTypes=this.tsParseBracketedList("TupleElementTypes",this.tsParseTupleElementType.bind(this),!0,!1);let $e=!1;return Le.elementTypes.forEach((je)=>{let{type:qe}=je;if($e&&qe!=="TSRestType"&&qe!=="TSOptionalType"&&!(qe==="TSNamedTupleMember"&&je.optional))this.raise(je.start,ct.OptionalTypeBeforeRequired);if($e||=qe==="TSNamedTupleMember"&&je.optional||qe==="TSOptionalType",qe==="TSRestType")je=je.typeAnnotation}),this.finishNode(Le,"TSTupleType")}tsParseTemplateLiteralType(){let Le=this.startNode();return Le.literal=this.parseTemplate({isTagged:!1}),this.finishNode(Le,"TSLiteralType")}tsParseTypeReference(){let Le=this.startNode();if(Le.typeName=this.tsParseEntityName(),!this.hasPrecedingLineBreak()&&this.tsMatchLeftRelational())Le.typeArguments=this.tsParseTypeArguments();return this.finishNode(Le,"TSTypeReference")}tsMatchLeftRelational(){return this.match(Ie.relational)&&this.value==="<"}tsMatchRightRelational(){return this.match(Ie.relational)&&this.value===">"}tsParseParenthesizedType(){let Le=this.startNode();return this.expect(Ie.parenL),Le.typeAnnotation=this.tsParseType(),this.expect(Ie.parenR),this.finishNode(Le,"TSParenthesizedType")}tsParseNonArrayType(){switch(this.type){case Ie.string:case Ie.num:case Ie._true:case Ie._false:return this.tsParseLiteralTypeNode();case Ie.plusMin:if(this.value==="-"){let Le=this.startNode();if(this.lookahead().type!==Ie.num)this.unexpected();return Le.literal=this.parseMaybeUnary(),this.finishNode(Le,"TSLiteralType")}break;case Ie._this:return this.tsParseThisTypeOrThisTypePredicate();case Ie._typeof:return this.tsParseTypeQuery();case Ie._import:return this.tsParseImportType();case Ie.braceL:return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))?this.tsParseMappedType():this.tsParseTypeLiteral();case Ie.bracketL:return this.tsParseTupleType();case Ie.parenL:return this.tsParseParenthesizedType();case Ie.backQuote:case Ie.dollarBraceL:return this.tsParseTemplateLiteralType();default:{let{type:Le}=this;if(nt(Le)||Le===Ie._void||Le===Ie._null){let $e=Le===Ie._void?"TSVoidKeyword":Le===Ie._null?"TSNullKeyword":tf(this.value);if($e!==void 0&&this.lookaheadCharCode()!==46){let je=this.startNode();return this.next(),this.finishNode(je,$e)}return this.tsParseTypeReference()}}}this.unexpected()}tsParseArrayTypeOrHigher(){let Le=this.tsParseNonArrayType();while(!this.hasPrecedingLineBreak()&&this.eat(Ie.bracketL))if(this.match(Ie.bracketR)){let $e=this.startNodeAtNode(Le);$e.elementType=Le,this.expect(Ie.bracketR),Le=this.finishNode($e,"TSArrayType")}else{let $e=this.startNodeAtNode(Le);$e.objectType=Le,$e.indexType=this.tsParseType(),this.expect(Ie.bracketR),Le=this.finishNode($e,"TSIndexedAccessType")}return Le}tsParseTypeOperatorOrHigher(){return it(this.type)&&!this.containsEsc?this.tsParseTypeOperator():this.isContextual("infer")?this.tsParseInferType():this.tsInAllowConditionalTypesContext(()=>this.tsParseArrayTypeOrHigher())}tsParseIntersectionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSIntersectionType",this.tsParseTypeOperatorOrHigher.bind(this),Ie.bitwiseAND)}tsParseUnionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSUnionType",this.tsParseIntersectionTypeOrHigher.bind(this),Ie.bitwiseOR)}tsParseNonConditionalType(){if(this.tsIsStartOfFunctionType())return this.tsParseFunctionOrConstructorType("TSFunctionType");if(this.match(Ie._new))return this.tsParseFunctionOrConstructorType("TSConstructorType");else if(this.isAbstractConstructorSignature())return this.tsParseFunctionOrConstructorType("TSConstructorType",!0);return this.tsParseUnionTypeOrHigher()}tsParseType(){Za(this.inType);let Le=this.tsParseNonConditionalType();if(this.inDisallowConditionalTypesContext||this.hasPrecedingLineBreak()||!this.eat(Ie._extends))return Le;let $e=this.startNodeAtNode(Le);return $e.checkType=Le,$e.extendsType=this.tsInDisallowConditionalTypesContext(()=>this.tsParseNonConditionalType()),this.expect(Ie.question),$e.trueType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.expect(Ie.colon),$e.falseType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.finishNode($e,"TSConditionalType")}tsIsUnambiguouslyIndexSignature(){if(this.next(),Ye(this.type))return this.next(),this.match(Ie.colon);return!1}tsInType(Le){let $e=this.inType;this.inType=!0;try{return Le()}finally{this.inType=$e}}tsTryParseIndexSignature(Le){if(!(this.match(Ie.bracketL)&&this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this))))return;this.expect(Ie.bracketL);let $e=this.parseIdent();$e.typeAnnotation=this.tsParseTypeAnnotation(),this.resetEndLocation($e),this.expect(Ie.bracketR),Le.parameters=[$e];let je=this.tsTryParseTypeAnnotation();if(je)Le.typeAnnotation=je;return this.tsParseTypeMemberSemicolon(),this.finishNode(Le,"TSIndexSignature")}tsParseNoneModifiers(Le){this.tsParseModifiers({modified:Le,allowedModifiers:[],disallowedModifiers:["in","out"],errorTemplate:ct.InvalidModifierOnTypeParameterPositions})}tsParseTypeParameter(Le=this.tsParseNoneModifiers.bind(this)){let $e=this.startNode();return Le($e),$e.name=this.tsParseTypeParameterName(),$e.constraint=this.tsEatThenParseType(Ie._extends),$e.default=this.tsEatThenParseType(Ie.eq),this.finishNode($e,"TSTypeParameter")}tsParseTypeParameters(Le){let $e=this.startNode();if(this.tsMatchLeftRelational()||this.matchJsx("jsxTagStart"))this.next();else this.unexpected();let je={value:-1};if($e.params=this.tsParseBracketedList("TypeParametersOrArguments",this.tsParseTypeParameter.bind(this,Le),!1,!0,je),$e.params.length===0)this.raise(this.start,ct.EmptyTypeParameters);if(je.value!==-1)this.addExtra($e,"trailingComma",je.value);return this.finishNode($e,"TSTypeParameterDeclaration")}tsTryParseTypeParameters(Le){if(this.tsMatchLeftRelational())return this.tsParseTypeParameters(Le)}tsTryParse(Le){let $e=this.beginParseEffectScope(),je;try{je=Le()}catch(qe){throw this.parseEffects.rollback($e),qe}if(je!==void 0&&je!==!1)return this.parseEffects.commit($e),je;this.parseEffects.rollback($e);return}tsTokenCanFollowModifier(){return(this.match(Ie.bracketL)||this.match(Ie.braceL)||this.match(Ie.star)||this.match(Ie.ellipsis)||this.match(Ie.privateId)||this.isLiteralPropertyName())&&!this.hasPrecedingLineBreak()}tsNextTokenCanFollowModifier(){return this.next(!0),this.tsTokenCanFollowModifier()}tsParseModifier(Le,$e){let je=this.value;if(Le.indexOf(je)!==-1&&!this.containsEsc){if($e&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return je}return}tsParseModifiersByMap({modified:Le,map:$e}){for(let je of Object.keys($e))Le[je]=$e[je]}tsParseModifiers({modified:Le,allowedModifiers:$e,disallowedModifiers:je,stopOnStartOfClassStaticBlock:qe,errorTemplate:He=ct.InvalidModifierOnTypeMember}){let Ke={},Ze=(et,Je,st,pt)=>{if(Je===st&&Le[pt])this.raise(et.column,ct.InvalidModifiersOrder({orderedModifiers:[st,pt]}))},tt=(et,Je,st,pt)=>{if(Le[st]&&Je===pt||Le[pt]&&Je===st)this.raise(et.column,ct.IncompatibleModifiers({modifiers:[st,pt]}))};for(;;){let et=this.startLoc,Je=this.tsParseModifier($e.concat(je??[]),qe);if(!Je)break;if(tc(Je))if(Le.accessibility)this.raise(this.start,ct.DuplicateAccessibilityModifier());else Ze(et,Je,Je,"override"),Ze(et,Je,Je,"static"),Ze(et,Je,Je,"readonly"),Ze(et,Je,Je,"accessor"),Ke.accessibility=Je,Le.accessibility=Je;else if(Xd(Je))if(Le[Je])this.raise(this.start,ct.DuplicateModifier({modifier:Je}));else Ze(et,Je,"in","out"),Ke[Je]=Je,Le[Je]=!0;else if(zd(Je))if(Le[Je])this.raise(this.start,ct.DuplicateModifier({modifier:Je}));else tt(et,Je,"accessor","readonly"),tt(et,Je,"accessor","override"),Ke[Je]=Je,Le[Je]=!0;else if(Je==="const")if(Le[Je])this.raise(this.start,ct.DuplicateModifier({modifier:Je}));else Ke[Je]=Je,Le[Je]=!0;else if(Object.hasOwnProperty.call(Le,Je))this.raise(this.start,ct.DuplicateModifier({modifier:Je}));else Ze(et,Je,"static","readonly"),Ze(et,Je,"static","override"),Ze(et,Je,"override","readonly"),Ze(et,Je,"abstract","override"),tt(et,Je,"declare","override"),tt(et,Je,"static","abstract"),Ke[Je]=Je,Le[Je]=!0;if(je?.includes(Je))this.raise(this.start,He)}return Ke}tsParseInOutModifiers(Le){this.tsParseModifiers({modified:Le,allowedModifiers:["in","out"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:ct.InvalidModifierOnTypeParameter})}tsParseClassTypeParameterModifiers(Le){this.tsParseModifiers({modified:Le,allowedModifiers:["const","in","out"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:ct.InvalidModifierOnTypeParameter})}parseMaybeUnary(Le,$e,je,qe){if(!i?.jsx&&this.tsMatchLeftRelational())return this.tsParseTypeAssertion();else return super.parseMaybeUnary(Le,$e,je,qe)}tsParseTypeAssertion(){if(Ne)this.raise(this.start,ct.ReservedTypeAssertion);let Le=this.tryParse(()=>{let $e=this.startNode(),je=this.tsTryNextParseConstantContext();return $e.typeAnnotation=je||this.tsNextThenParseType(),this.expect(Ie.relational),$e.expression=this.parseMaybeUnary(),this.finishNode($e,"TSTypeAssertion")});if(Le.error)return this.tsParseTypeParameters(this.tsParseConstModifier);else return Le.node}tsParseTypeArguments(Le=!1){let $e=this.startNode();if($e.params=this.tsInType(()=>this.tsInNoContext(()=>(this.expect(Ie.relational),this.tsParseDelimitedList("TypeParametersOrArguments",this.tsParseType.bind(this))))),$e.params.length===0)this.raise(this.start,ct.EmptyTypeArguments);if(Le&&this.curContext()!==Xe.tc_oTag)this.reScan_lt_gt();if(!this.tsMatchRightRelational())this.unexpected();return this.exprAllowed=!1,this.next(),this.finishNode($e,"TSTypeParameterInstantiation")}tsParseHeritageClause(Le){let $e=this.start,je=this.tsParseDelimitedList("HeritageClauseElement",()=>{let qe=this.startNode();if(qe.expression=this.tsParseEntityName(),this.tsMatchLeftRelational())qe.typeParameters=this.tsParseTypeArguments();return this.finishNode(qe,"TSExpressionWithTypeArguments")});if(!je.length)this.raise($e,ct.EmptyHeritageClauseType({token:Le}));return je}tsParseTypeMemberSemicolon(){if(!this.eat(Ie.comma)&&!this.isLineTerminator())this.expect(Ie.semi)}tsTryParseAndCatch(Le){let $e=this.tryParse((je)=>Le()||je());if($e.aborted||!$e.node)return;return $e.node}tsParseSignatureMember(Le,$e){return this.tsFillSignature(Ie.colon,$e),this.tsParseTypeMemberSemicolon(),this.finishNode($e,Le)}tsParsePropertyOrMethodSignature(Le,$e){if(this.eat(Ie.question))Le.optional=!0;let je=Le;if(this.match(Ie.parenL)||this.tsMatchLeftRelational()){if($e)this.raise(Le.start,ct.ReadonlyForMethodSignature);let qe=je;if(qe.kind&&this.tsMatchLeftRelational())this.raise(this.start,ct.AccesorCannotHaveTypeParameters);this.tsFillSignature(Ie.colon,qe),this.tsParseTypeMemberSemicolon();let He="parameters",Ke="typeAnnotation";if(qe.kind==="get"){if(qe[He].length>0){if(this.raise(this.start,"A 'get' accesor must not have any formal parameters."),this.isThisParam(qe[He][0]))this.raise(this.start,ct.AccesorCannotDeclareThisParameter)}}else if(qe.kind==="set"){if(qe[He].length!==1)this.raise(this.start,"A 'get' accesor must not have any formal parameters.");else{let Ze=qe[He][0];if(this.isThisParam(Ze))this.raise(this.start,ct.AccesorCannotDeclareThisParameter);if(Ze.type==="Identifier"&&Ze.optional)this.raise(this.start,ct.SetAccesorCannotHaveOptionalParameter);if(Ze.type==="RestElement")this.raise(this.start,ct.SetAccesorCannotHaveRestParameter)}if(qe[Ke])this.raise(qe[Ke].start,ct.SetAccesorCannotHaveReturnType)}else qe.kind="method";return this.finishNode(qe,"TSMethodSignature")}else{let qe=je;if($e)qe.readonly=!0;let He=this.tsTryParseTypeAnnotation();if(He)qe.typeAnnotation=He;return this.tsParseTypeMemberSemicolon(),this.finishNode(qe,"TSPropertySignature")}}tsParseTypeMember(){let Le=this.startNode();if(this.match(Ie.parenL)||this.tsMatchLeftRelational())return this.tsParseSignatureMember("TSCallSignatureDeclaration",Le);if(this.match(Ie._new)){let je=this.startNode();if(this.next(),this.match(Ie.parenL)||this.tsMatchLeftRelational())return this.tsParseSignatureMember("TSConstructSignatureDeclaration",Le);else return Le.key=this.createIdentifier(je,"new"),this.tsParsePropertyOrMethodSignature(Le,!1)}this.tsParseModifiers({modified:Le,allowedModifiers:["readonly"],disallowedModifiers:["declare","abstract","private","protected","public","static","override"]});let $e=this.tsTryParseIndexSignature(Le);if($e)return $e;if(this.parsePropertyName(Le),!Le.computed&&Le.key.type==="Identifier"&&(Le.key.name==="get"||Le.key.name==="set")&&this.tsTokenCanFollowModifier())Le.kind=Le.key.name,this.parsePropertyName(Le);return this.tsParsePropertyOrMethodSignature(Le,!!Le.readonly)}tsParseList(Le,$e){let je=[];while(!this.tsIsListTerminator(Le))je.push($e());return je}tsParseObjectTypeMembers(){this.expect(Ie.braceL);let Le=this.tsParseList("TypeMembers",this.tsParseTypeMember.bind(this));return this.expect(Ie.braceR),Le}tsParseInterfaceDeclaration(Le,$e={}){if(this.hasFollowingLineBreak())return null;if(this.expectContextual("interface"),$e.declare)Le.declare=!0;if(Ye(this.type)){Le.id=this.parseIdent(),this.checkLValSimple(Le.id,xt.BIND_TS_INTERFACE);let qe=this.currentScope();this.maybeExportDefined(qe,Le.id.name)}else Le.id=null,this.raise(this.start,ct.MissingInterfaceName);if(Le.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this)),this.eat(Ie._extends))Le.extends=this.tsParseHeritageClause("extends");let je=this.startNode();return je.body=this.tsParseInterfaceBody(),Le.body=this.finishNode(je,"TSInterfaceBody"),this.finishNode(Le,"TSInterfaceDeclaration")}tsParseInterfaceBody(){this.expect(Ie.braceL);let Le=this.inType;this.inType=!0;let $e=this.tsParseList("TypeMembers",this.tsParseTypeMember.bind(this));return this.inType=Le,this.expect(Ie.braceR),$e}tsParseAbstractDeclaration(Le){if(this.match(Ie._class))return Le.abstract=!0,this.parseClass(Le,!0);else if(this.ts_isContextual(Ue.interface)){if(!this.hasFollowingLineBreak())return Le.abstract=!0,this.tsParseInterfaceDeclaration(Le)}else this.unexpected(Le.start)}tsIsDeclarationStart(){return ot(this.type)}tsParseExpressionStatement(Le,$e){switch($e.name){case"declare":{let je=this.tsTryParseDeclare(Le);if(je)return je.declare=!0,je;break}case"global":if(this.match(Ie.braceL)){this.enterScope(vr);let je=Le;return je.global=!0,je.id=$e,je.body=this.tsParseModuleBlock(),super.exitScope(),this.finishNode(je,"TSModuleDeclaration")}break;default:return this.tsParseDeclaration(Le,$e.name,!1)}}tsParseModuleReference(){return this.tsIsExternalModuleReference()?this.tsParseExternalModuleReference():this.tsParseEntityName(!1)}tsIsExportDefaultSpecifier(){let{type:Le}=this,$e=this.isAsyncFunction(),je=this.isLet();if(Ye(Le)){if($e&&!this.containsEsc||je)return!1;if((Le===Ue.type||Le===Ue.interface)&&!this.containsEsc){let Ke=this.lookahead();if(Ye(Ke.type)&&!this.isContextualWithState("from",Ke)||Ke.type===Ie.braceL)return!1}}else if(!this.match(Ie._default))return!1;let qe=this.nextTokenStart(),He=this.isUnparsedContextual(qe,"from");if(this.input.charCodeAt(qe)===44||Ye(this.type)&&He)return!0;if(this.match(Ie._default)&&He){let Ke=this.input.charCodeAt(this.nextTokenStartSince(qe+4));return Ke===34||Ke===39}return!1}tsInAmbientContext(Le){let $e=this.isAmbientContext;this.isAmbientContext=!0;try{return Le()}finally{this.isAmbientContext=$e}}tsCheckLineTerminator(Le){if(Le){if(this.hasFollowingLineBreak())return!1;return this.next(),!0}return!this.isLineTerminator()}tsParseModuleOrNamespaceDeclaration(Le,$e=!1){if(Le.id=this.parseIdent(),!$e)this.checkLValSimple(Le.id,xt.BIND_TS_NAMESPACE);if(this.eat(Ie.dot)){let je=this.startNode();this.tsParseModuleOrNamespaceDeclaration(je,!0),Le.body=je}else this.enterScope(vr),Le.body=this.tsParseModuleBlock(),super.exitScope();return this.finishNode(Le,"TSModuleDeclaration")}checkLValSimple(Le,$e=xt.BIND_NONE,je){while(Le.type==="TSNonNullExpression"||Le.type==="TSAsExpression"||Le.type==="TSSatisfiesExpression"||Le.type==="TSTypeAssertion")Le=Le.expression;return super.checkLValSimple(Le,$e,je)}isSimpleAssignTarget(Le){while(Le.type==="TSNonNullExpression"||Le.type==="TSAsExpression"||Le.type==="TSSatisfiesExpression"||Le.type==="TSTypeAssertion")Le=Le.expression;return super.isSimpleAssignTarget(Le)}tsParseTypeAliasDeclaration(Le){Le.id=this.parseIdent(),this.checkLValSimple(Le.id,xt.BIND_TS_TYPE);let $e=this.currentScope();return this.maybeExportDefined($e,Le.id.name),Le.typeAnnotation=this.tsInType(()=>{if(Le.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this)),this.expect(Ie.eq),this.ts_isContextual(Ue.interface)&&this.lookahead().type!==Ie.dot){let je=this.startNode();return this.next(),this.finishNode(je,"TSIntrinsicKeyword")}return this.tsParseType()}),this.semicolon(),this.finishNode(Le,"TSTypeAliasDeclaration")}tsParseDeclaration(Le,$e,je){switch($e){case"abstract":if(this.tsCheckLineTerminator(je)&&(this.match(Ie._class)||Ye(this.type)))return this.tsParseAbstractDeclaration(Le);break;case"module":if(this.tsCheckLineTerminator(je)){if(this.match(Ie.string))return this.tsParseAmbientExternalModuleDeclaration(Le);else if(Ye(this.type))return this.tsParseModuleOrNamespaceDeclaration(Le)}break;case"namespace":if(this.tsCheckLineTerminator(je)&&Ye(this.type))return this.tsParseModuleOrNamespaceDeclaration(Le);break;case"type":if(this.tsCheckLineTerminator(je)&&Ye(this.type))return this.tsParseTypeAliasDeclaration(Le);break}}tsTryParseExportDeclaration(){return this.tsParseDeclaration(this.startNode(),this.value,!0)}tsParseImportEqualsDeclaration(Le,$e){Le.isExport=$e||!1,Le.id=this.parseIdent(),this.checkLValSimple(Le.id,xt.BIND_LEXICAL),super.expect(Ie.eq);let je=this.tsParseModuleReference();if(Le.importKind==="type"&&je.type!=="TSExternalModuleReference")this.raise(je.start,ct.ImportAliasHasImportType);return Le.moduleReference=je,super.semicolon(),this.finishNode(Le,"TSImportEqualsDeclaration")}isExportDefaultSpecifier(){if(this.tsIsDeclarationStart())return!1;let{type:Le}=this;if(Ye(Le)){if(this.isContextual("async")||this.isContextual("let"))return!1;if((Le===Ue.type||Le===Ue.interface)&&!this.containsEsc){let qe=this.lookahead();if(Ye(qe.type)&&!this.isContextualWithState("from",qe)||qe.type===Ie.braceL)return!1}}else if(!this.match(Ie._default))return!1;let $e=this.nextTokenStart(),je=this.isUnparsedContextual($e,"from");if(this.input.charCodeAt($e)===44||Ye(this.type)&&je)return!0;if(this.match(Ie._default)&&je){let qe=this.input.charCodeAt(this.nextTokenStartSince($e+4));return qe===34||qe===39}return!1}parseTemplate({isTagged:Le=!1}={}){let $e=this.startNode();this.next(),$e.expressions=[];let je=this.parseTemplateElement({isTagged:Le});$e.quasis=[je];while(!je.tail){if(this.type===Ie.eof)this.raise(this.pos,"Unterminated template literal");this.expect(Ie.dollarBraceL),$e.expressions.push(this.inType?this.tsParseType():this.parseExpression()),this.expect(Ie.braceR),$e.quasis.push(je=this.parseTemplateElement({isTagged:Le}))}return this.next(),this.finishNode($e,"TemplateLiteral")}parseFunction(Le,$e,je,qe,He){if(this.initFunction(Le),this.ecmaVersion>=9||this.ecmaVersion>=6&&!qe){if(this.type===Ie.star&&$e&ec)this.unexpected();Le.generator=this.eat(Ie.star)}if(this.ecmaVersion>=8)Le.async=!!qe;if($e&ss)Le.id=$e&Jd&&this.type!==Ie.name?null:this.parseIdent();let Ke=this.yieldPos,Ze=this.awaitPos,tt=this.awaitIdentPos,et=this.maybeInArrowParameters;if(this.maybeInArrowParameters=!1,this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Ti(Le.async,Le.generator)),!($e&ss))Le.id=this.type===Ie.name?this.parseIdent():null;this.parseFunctionParams(Le);let Je=$e&ss;if(this.parseFunctionBody(Le,je,!1,He,{isFunctionDeclaration:Je}),Je&&this.isAmbientContext&&Le.id){if(this.currentScope().flags&xt.SCOPE_TOP)this.declareName(Le.id.name,xt.BIND_FLAGS_TS_EXPORT_ONLY,Le.id.start)}if(this.yieldPos=Ke,this.awaitPos=Ze,this.awaitIdentPos=tt,$e&ss&&Le.id&&!($e&ec))if(Le.body)this.checkLValSimple(Le.id,this.strict||Le.generator||Le.async?this.treatFunctionsAsVar?xt.BIND_VAR:xt.BIND_LEXICAL:xt.BIND_FUNCTION);else this.checkLValSimple(Le.id,xt.BIND_NONE);return this.maybeInArrowParameters=et,this.finishNode(Le,Je?"FunctionDeclaration":"FunctionExpression")}parseFunctionBody(Le,$e=!1,je=!1,qe=!1,He){if(this.match(Ie.colon))Le.returnType=this.tsParseTypeOrTypePredicateAnnotation(Ie.colon);let Ke=He?.isFunctionDeclaration?"TSDeclareFunction":He?.isClassMethod?"TSDeclareMethod":void 0;if(Ke&&!this.match(Ie.braceL)&&this.isLineTerminator())return this.exitScope(),this.finishNode(Le,Ke);if(Ke==="TSDeclareFunction"&&this.isAmbientContext){if(this.raise(Le.start,ct.DeclareFunctionHasImplementation),Le.declare)return super.parseFunctionBody(Le,$e,je,!1),this.finishNode(Le,Ke)}return super.parseFunctionBody(Le,$e,je,qe),Le}parseNew(){if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword new");let Le=this.startNode(),$e=this.parseIdent(!0);if(this.ecmaVersion>=6&&this.eat(Ie.dot)){Le.meta=$e;let Ze=this.containsEsc;if(Le.property=this.parseIdent(!0),Le.property.name!=="target")this.raiseRecoverable(Le.property.start,"The only valid meta property for new is 'new.target'");if(Ze)this.raiseRecoverable(Le.start,"'new.target' must not contain escaped characters");if(!this.allowNewDotTarget)this.raiseRecoverable(Le.start,"'new.target' can only be used in functions and class static block");return this.finishNode(Le,"MetaProperty")}let je=this.start,qe=this.startLoc,He=this.type===Ie._import;if(Le.callee=this.parseSubscripts(this.parseExprAtom(),je,qe,!0,!1),He&&Le.callee.type==="ImportExpression")this.raise(je,"Cannot use new with import()");let{callee:Ke}=Le;if(Ke.type==="TSInstantiationExpression"&&!Ke.extra?.parenthesized)Le.typeArguments=Ke.typeArguments,Le.callee=Ke.expression;if(this.eat(Ie.parenL))Le.arguments=this.parseExprList(Ie.parenR,this.ecmaVersion>=8,!1);else Le.arguments=[];return this.finishNode(Le,"NewExpression")}parseExprOp(Le,$e,je,qe,He){if(Ie._in.binop>qe&&!this.hasPrecedingLineBreak()){let Ke;if(this.isContextual("as"))Ke="TSAsExpression";if(this.isContextual("satisfies"))Ke="TSSatisfiesExpression";if(Ke){let Ze=this.startNodeAt($e,je);Ze.expression=Le;let tt=this.tsTryNextParseConstantContext();if(tt)Ze.typeAnnotation=tt;else Ze.typeAnnotation=this.tsNextThenParseType();return this.finishNode(Ze,Ke),this.reScan_lt_gt(),this.parseExprOp(Ze,$e,je,qe,He)}}return super.parseExprOp(Le,$e,je,qe,He)}parseImportSpecifiers(){let Le=[],$e=!0;if(Re.tokenIsIdentifier(this.type)){if(Le.push(this.parseImportDefaultSpecifier()),!this.eat(Ie.comma))return Le}if(this.type===Ie.star)return Le.push(this.parseImportNamespaceSpecifier()),Le;this.expect(Ie.braceL);while(!this.eat(Ie.braceR)){if(!$e){if(this.expect(Ie.comma),this.afterTrailingComma(Ie.braceR))break}else $e=!1;Le.push(this.parseImportSpecifier())}return Le}parseImport(Le){let $e=this.lookahead();if(Le.importKind="value",this.importOrExportOuterKind="value",Ye($e.type)||this.match(Ie.star)||this.match(Ie.braceL)){let je=this.lookahead(2);if(je.type!==Ie.comma&&!this.isContextualWithState("from",je)&&je.type!==Ie.eq&&this.ts_eatContextualWithState("type",1,$e))this.importOrExportOuterKind="type",Le.importKind="type",$e=this.lookahead(),je=this.lookahead(2);if(Ye($e.type)&&je.type===Ie.eq){this.next();let qe=this.tsParseImportEqualsDeclaration(Le);return this.importOrExportOuterKind="value",qe}}if(this.next(),this.type===Ie.string)Le.specifiers=[],Le.source=this.parseExprAtom();else Le.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),Le.source=this.type===Ie.string?this.parseExprAtom():this.unexpected();if(this.parseMaybeImportAttributes(Le),this.semicolon(),this.finishNode(Le,"ImportDeclaration"),this.importOrExportOuterKind="value",Le.importKind==="type"&&Le.specifiers.length>1&&Le.specifiers[0].type==="ImportDefaultSpecifier")this.raise(Le.start,ct.TypeImportCannotSpecifyDefaultAndNamed);return Le}parseExportDefaultDeclaration(){if(this.isAbstractClass()){let Le=this.startNode();return this.next(),Le.abstract=!0,this.parseClass(Le,!0)}if(this.match(Ue.interface)){let Le=this.tsParseInterfaceDeclaration(this.startNode());if(Le)return Le}return super.parseExportDefaultDeclaration()}parseExportAllDeclaration(Le,$e){if(this.ecmaVersion>=11)if(this.eatContextual("as"))Le.exported=this.parseModuleExportName(),this.checkExport($e,Le.exported,this.lastTokStart);else Le.exported=null;if(this.expectContextual("from"),this.type!==Ie.string)this.unexpected();return Le.source=this.parseExprAtom(),this.parseMaybeImportAttributes(Le),this.semicolon(),this.finishNode(Le,"ExportAllDeclaration")}parseDynamicImport(Le){if(this.next(),Le.source=this.parseMaybeAssign(),this.eat(Ie.comma)){let $e=this.parseExpression();Le.arguments=[$e]}if(!this.eat(Ie.parenR)){let $e=this.start;if(this.eat(Ie.comma)&&this.eat(Ie.parenR))this.raiseRecoverable($e,"Trailing comma is not allowed in import()");else this.unexpected($e)}return this.finishNode(Le,"ImportExpression")}parseExport(Le,$e){let je=this.lookahead();if(this.ts_eatWithState(Ie._import,2,je)){if(this.ts_isContextual(Ue.type)&&this.lookaheadCharCode()!==61)Le.importKind="type",this.importOrExportOuterKind="type",this.next();else Le.importKind="value",this.importOrExportOuterKind="value";let qe=this.tsParseImportEqualsDeclaration(Le,!0);return this.importOrExportOuterKind=void 0,qe}else if(this.ts_eatWithState(Ie.eq,2,je)){let qe=Le;return qe.expression=this.parseExpression(),this.semicolon(),this.importOrExportOuterKind=void 0,this.finishNode(qe,"TSExportAssignment")}else if(this.ts_eatContextualWithState("as",2,je)){let qe=Le;return this.expectContextual("namespace"),qe.id=this.parseIdent(),this.semicolon(),this.importOrExportOuterKind=void 0,this.finishNode(qe,"TSNamespaceExportDeclaration")}else{let qe=this.lookahead(2).type;if(this.ts_isContextualWithState(je,Ue.type)&&(qe===Ie.braceL||qe===Ie.star))this.next(),this.importOrExportOuterKind="type",Le.exportKind="type";else this.importOrExportOuterKind="value",Le.exportKind="value";if(this.next(),this.eat(Ie.star))return this.parseExportAllDeclaration(Le,$e);if(this.eat(Ie._default))return this.checkExport($e,"default",this.lastTokStart),Le.declaration=this.parseExportDefaultDeclaration(),this.finishNode(Le,"ExportDefaultDeclaration");if(this.shouldParseExportStatement()){if(Le.declaration=this.parseExportDeclaration(Le),Le.declaration.type==="VariableDeclaration")this.checkVariableExport($e,Le.declaration.declarations);else this.checkExport($e,Le.declaration.id,Le.declaration.id.start);Le.specifiers=[],Le.source=null}else{if(Le.declaration=null,Le.specifiers=this.parseExportSpecifiers($e),this.eatContextual("from")){if(this.type!==Ie.string)this.unexpected();Le.source=this.parseExprAtom(),this.parseMaybeImportAttributes(Le)}else{for(let He of Le.specifiers)if(this.checkUnreserved(He.local),this.checkLocalExport(He.local),He.local.type==="Literal")this.raise(He.local.start,"A string literal cannot be used as an exported binding without `from`.");Le.source=null}this.semicolon()}return this.finishNode(Le,"ExportNamedDeclaration")}}checkExport(Le,$e,je){if(!Le)return;if(typeof $e!=="string")$e=$e.type==="Identifier"?$e.name:$e.value;Le[$e]=!0}parseMaybeDefault(Le,$e,je){let qe=super.parseMaybeDefault(Le,$e,je);if(qe.type==="AssignmentPattern"&&qe.typeAnnotation&&qe.right.start<qe.typeAnnotation.start)this.raise(qe.typeAnnotation.start,ct.TypeAnnotationAfterAssign);return qe}typeCastToParameter(Le){return Le.expression.typeAnnotation=Le.typeAnnotation,this.resetEndLocation(Le.expression,Le.typeAnnotation.end,Le.typeAnnotation.loc?.end),Le.expression}toAssignableList(Le,$e){if(!Le)Le=[];for(let je=0;je<Le.length;je++){let qe=Le[je];if(qe?.type==="TSTypeCastExpression")Le[je]=this.typeCastToParameter(qe)}return super.toAssignableList(Le,$e)}reportReservedArrowTypeParam(Le){if(Le.params.length===1&&!Le.extra?.trailingComma&&Ne)this.raise(Le.start,ct.ReservedArrowTypeParam)}parseExprAtom(Le,$e,je){if(this.type===Ue.jsxText)return this.jsx_parseText();else if(this.type===Ue.jsxTagStart)return this.jsx_parseElement();else if(this.type===Ue.at)return this.parseDecorators(),this.parseExprAtom();else if(Ye(this.type)){let qe=this.potentialArrowAt===this.start,He=this.start,Ke=this.startLoc,Ze=this.containsEsc,tt=this.parseIdent(!1);if(this.ecmaVersion>=8&&!Ze&&tt.name==="async"&&!this.canInsertSemicolon()&&this.eat(Ie._function))return this.overrideContext(Ve.f_expr),this.parseFunction(this.startNodeAt(He,Ke),0,!1,!0,$e);if(qe&&!this.canInsertSemicolon()){if(this.eat(Ie.arrow))return this.parseArrowExpression(this.startNodeAt(He,Ke),[tt],!1,$e);if(this.ecmaVersion>=8&&tt.name==="async"&&this.type===Ie.name&&!Ze&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc)){if(tt=this.parseIdent(!1),this.canInsertSemicolon()||!this.eat(Ie.arrow))this.unexpected();return this.parseArrowExpression(this.startNodeAt(He,Ke),[tt],!0,$e)}}return tt}else return super.parseExprAtom(Le,$e,je)}parseExprAtomDefault(){if(Ye(this.type)){let Le=this.potentialArrowAt===this.start,$e=this.containsEsc,je=this.parseIdent();if(!$e&&je.name==="async"&&!this.canInsertSemicolon()){let{type:qe}=this;if(qe===Ie._function)return this.next(),this.parseFunction(this.startNodeAtNode(je),void 0,!0,!0);else if(Ye(qe))if(this.lookaheadCharCode()===61){let He=this.parseIdent(!1);if(this.canInsertSemicolon()||!this.eat(Ie.arrow))this.unexpected();return this.parseArrowExpression(this.startNodeAtNode(je),[He],!0)}else return je}if(Le&&this.match(Ie.arrow)&&!this.canInsertSemicolon())return this.next(),this.parseArrowExpression(this.startNodeAtNode(je),[je],!1);return je}else this.unexpected()}parseIdentNode(){let Le=this.startNode();if(nt(this.type)&&!((this.type.keyword==="class"||this.type.keyword==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)))Le.name=this.value;else return super.parseIdentNode();return Le}parseVarStatement(Le,$e,je=!1){let{isAmbientContext:qe}=this;this.next(),super.parseVar(Le,!1,$e,je||qe),this.semicolon();let He=this.finishNode(Le,"VariableDeclaration");if(!qe)return He;for(let{id:Ke,init:Ze}of He.declarations){if(!Ze)continue;if($e!=="const"||!!Ke.typeAnnotation)this.raise(Ze.start,ct.InitializerNotAllowedInAmbientContext);else if(Ze.type!=="Literal"&&(Ze.type!=="TemplateLiteral"||Ze.expressions.length>0)&&!Qd(Ze)&&!Yd(Ze))this.raise(Ze.start,ct.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference)}return He}parseStatement(Le,$e,je){if(this.match(Ue.at))this.parseDecorators(!0);if(this.match(Ie._const)&&this.isLookaheadContextual("enum")){let qe=this.startNode();return this.expect(Ie._const),this.tsParseEnumDeclaration(qe,{const:!0})}if(this.ts_isContextual(Ue.enum))return this.tsParseEnumDeclaration(this.startNode());if(this.ts_isContextual(Ue.interface)){let qe=this.tsParseInterfaceDeclaration(this.startNode());if(qe)return qe}return super.parseStatement(Le,$e,je)}parseAccessModifier(){return this.tsParseModifier(["public","protected","private"])}parsePostMemberNameModifiers(Le){if(this.eat(Ie.question))Le.optional=!0;if(Le.readonly&&this.match(Ie.parenL))this.raise(Le.start,ct.ClassMethodHasReadonly);if(Le.declare&&this.match(Ie.parenL))this.raise(Le.start,ct.ClassMethodHasDeclare)}parseExpressionStatement(Le,$e){return($e.type==="Identifier"?this.tsParseExpressionStatement(Le,$e):void 0)||super.parseExpressionStatement(Le,$e)}shouldParseExportStatement(){if(this.tsIsDeclarationStart())return!0;if(this.match(Ue.at))return!0;return super.shouldParseExportStatement()}parseConditional(Le,$e,je,qe,He){if(this.eat(Ie.question)){let Ke=this.startNodeAt($e,je);return Ke.test=Le,Ke.consequent=this.parseMaybeAssign(),this.expect(Ie.colon),Ke.alternate=this.parseMaybeAssign(qe),this.finishNode(Ke,"ConditionalExpression")}return Le}parseMaybeConditional(Le,$e){let je=this.start,qe=this.startLoc,He=this.parseExprOps(Le,$e);if(this.checkExpressionErrors($e))return He;if(!this.maybeInArrowParameters||!this.match(Ie.question))return this.parseConditional(He,je,qe,Le,$e);let Ke=this.tryParse(()=>this.parseConditional(He,je,qe,Le,$e));if(!Ke.node){if(Ke.error)this.setOptionalParametersError($e,Ke.error);return He}return Ke.node}parseParenItem(Le){let $e=this.start,je=this.startLoc;if(Le=super.parseParenItem(Le),this.eat(Ie.question))Le.optional=!0,this.resetEndLocation(Le);if(this.match(Ie.colon)){let qe=this.startNodeAt($e,je);return qe.expression=Le,qe.typeAnnotation=this.tsParseTypeAnnotation(),this.finishNode(qe,"TSTypeCastExpression")}return Le}parseExportDeclaration(Le){if(!this.isAmbientContext&&this.ts_isContextual(Ue.declare))return this.tsInAmbientContext(()=>this.parseExportDeclaration(Le));let $e=this.start,je=this.startLoc,qe=this.eatContextual("declare");if(qe&&(this.ts_isContextual(Ue.declare)||!this.shouldParseExportStatement()))this.raise(this.start,ct.ExpectedAmbientAfterExportDeclare);let Ke=Ye(this.type)&&this.tsTryParseExportDeclaration()||this.parseStatement(null);if(!Ke)return null;if(Ke.type==="TSInterfaceDeclaration"||Ke.type==="TSTypeAliasDeclaration"||qe)Le.exportKind="type";if(qe)this.resetStartLocation(Ke,$e,je),Ke.declare=!0;return Ke}parseClassId(Le,$e){if(!$e&&this.isContextual("implements"))return;super.parseClassId(Le,$e);let je=this.tsTryParseTypeParameters(this.tsParseClassTypeParameterModifiers.bind(this));if(je)Le.typeParameters=je}parseClassPropertyAnnotation(Le){if(!Le.optional){if(this.value==="!"&&this.eat(Ie.prefix))Le.definite=!0;else if(this.eat(Ie.question))Le.optional=!0}let $e=this.tsTryParseTypeAnnotation();if($e)Le.typeAnnotation=$e}parseClassField(Le){if(Le.key.type==="PrivateIdentifier"){if(Le.abstract)this.raise(Le.start,ct.PrivateElementHasAbstract);if(Le.accessibility)this.raise(Le.start,ct.PrivateElementHasAccessibility({modifier:Le.accessibility}));this.parseClassPropertyAnnotation(Le)}else{if(this.parseClassPropertyAnnotation(Le),this.isAmbientContext&&!(Le.readonly&&!Le.typeAnnotation)&&this.match(Ie.eq))this.raise(this.start,ct.DeclareClassFieldHasInitializer);if(Le.abstract&&this.match(Ie.eq)){let{key:je}=Le;this.raise(this.start,ct.AbstractPropertyHasInitializer({propertyName:je.type==="Identifier"&&!Le.computed?je.name:`[${this.input.slice(je.start,je.end)}]`}))}}return super.parseClassField(Le)}parseClassMethod(Le,$e,je,qe){let He=Le.kind==="constructor",Ke=Le.key.type==="PrivateIdentifier",Ze=this.tsTryParseTypeParameters(this.tsParseConstModifier);if(Ke){if(Ze)Le.typeParameters=Ze;if(Le.accessibility)this.raise(Le.start,ct.PrivateMethodsHasAccessibility({modifier:Le.accessibility}))}else if(Ze&&He)this.raise(Ze.start,ct.ConstructorHasTypeParameters);let{declare:tt=!1,kind:et}=Le;if(tt&&(et==="get"||et==="set"))this.raise(Le.start,ct.DeclareAccessor({kind:et}));if(Ze)Le.typeParameters=Ze;let Je=Le.key;if(Le.kind==="constructor"){if($e)this.raise(Je.start,"Constructor can't be a generator");if(je)this.raise(Je.start,"Constructor can't be an async method")}else if(Le.static&&Ja(Le,"prototype"))this.raise(Je.start,"Classes may not have a static property named prototype");let st=Le.value=this.parseMethod($e,je,qe,!0,Le);if(Le.kind==="get"&&st.params.length!==0)this.raiseRecoverable(st.start,"getter should have no params");if(Le.kind==="set"&&st.params.length!==1)this.raiseRecoverable(st.start,"setter should have exactly one param");if(Le.kind==="set"&&st.params[0].type==="RestElement")this.raiseRecoverable(st.params[0].start,"Setter cannot use rest params");return this.finishNode(Le,"MethodDefinition")}isClassMethod(){return this.match(Ie.relational)}parseClassElement(Le){if(this.eat(Ie.semi))return null;let $e=this.startNode(),je="",qe=!1,He=!1,Ke="method",Ze=!1,tt=["declare","private","public","protected","accessor","override","abstract","readonly","static"],et=this.tsParseModifiers({modified:$e,allowedModifiers:tt,disallowedModifiers:["in","out"],stopOnStartOfClassStaticBlock:!0,errorTemplate:ct.InvalidModifierOnTypeParameterPositions});Ze=Boolean(et.static);let Je=()=>{if(this.tsIsStartOfStaticBlocks()){if(this.next(),this.next(),this.tsHasSomeModifiers($e,tt))this.raise(this.start,ct.StaticBlockCannotHaveModifier);if(this.ecmaVersion>=13)return super.parseClassStaticBlock($e),$e}else{let st=this.tsTryParseIndexSignature($e);if(st){if($e.abstract)this.raise($e.start,ct.IndexSignatureHasAbstract);if($e.accessibility)this.raise($e.start,ct.IndexSignatureHasAccessibility({modifier:$e.accessibility}));if($e.declare)this.raise($e.start,ct.IndexSignatureHasDeclare);if($e.override)this.raise($e.start,ct.IndexSignatureHasOverride);return st}if(!this.inAbstractClass&&$e.abstract)this.raise($e.start,ct.NonAbstractClassHasAbstractMethod);if($e.override){if(!Le)this.raise($e.start,ct.OverrideNotInSubClass)}if($e.static=Ze,Ze){if(!(this.isClassElementNameStart()||this.type===Ie.star))je="static"}if(!je&&this.ecmaVersion>=8&&this.eatContextual("async"))if((this.isClassElementNameStart()||this.type===Ie.star)&&!this.canInsertSemicolon())He=!0;else je="async";if(!je&&(this.ecmaVersion>=9||!He)&&this.eat(Ie.star))qe=!0;if(!je&&!He&&!qe){let pt=this.value;if(this.eatContextual("get")||this.eatContextual("set"))if(this.isClassElementNameStart())Ke=pt;else je=pt}if(je)$e.computed=!1,$e.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),$e.key.name=je,this.finishNode($e.key,"Identifier");else this.parseClassElementName($e);if(this.parsePostMemberNameModifiers($e),this.isClassMethod()||this.ecmaVersion<13||this.type===Ie.parenL||Ke!=="method"||qe||He){let pt=!$e.static&&Ja($e,"constructor"),ut=pt&&Le;if(pt&&Ke!=="method")this.raise($e.key.start,"Constructor can't have get/set modifier");$e.kind=pt?"constructor":Ke,this.parseClassMethod($e,qe,He,ut)}else this.parseClassField($e);return $e}};if($e.declare)this.tsInAmbientContext(Je);else Je();return $e}isClassElementNameStart(){if(this.tsIsIdentifier())return!0;return super.isClassElementNameStart()}parseClassSuper(Le){if(super.parseClassSuper(Le),Le.superClass&&(this.tsMatchLeftRelational()||this.match(Ie.bitShift)))Le.superTypeParameters=this.tsParseTypeArgumentsInExpression();if(this.eatContextual("implements"))Le.implements=this.tsParseHeritageClause("implements")}parseFunctionParams(Le){let $e=this.tsTryParseTypeParameters(this.tsParseConstModifier);if($e)Le.typeParameters=$e;super.parseFunctionParams(Le)}parseVarId(Le,$e){if(super.parseVarId(Le,$e),Le.id.type==="Identifier"&&!this.hasPrecedingLineBreak()&&this.value==="!"&&this.eat(Ie.prefix))Le.definite=!0;let je=this.tsTryParseTypeAnnotation();if(je)Le.id.typeAnnotation=je,this.resetEndLocation(Le.id)}parseArrowExpression(Le,$e,je,qe){if(this.match(Ie.colon))Le.returnType=this.tsParseTypeAnnotation();let He=this.yieldPos,Ke=this.awaitPos,Ze=this.awaitIdentPos;this.enterScope(Ti(je,!1)|xt.SCOPE_ARROW),this.initFunction(Le);let tt=this.maybeInArrowParameters;if(this.ecmaVersion>=8)Le.async=!!je;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.maybeInArrowParameters=!0,Le.params=this.toAssignableList($e,!0),this.maybeInArrowParameters=!1,this.parseFunctionBody(Le,!0,!1,qe),this.yieldPos=He,this.awaitPos=Ke,this.awaitIdentPos=Ze,this.maybeInArrowParameters=tt,this.finishNode(Le,"ArrowFunctionExpression")}parseYield(Le){if(!this.yieldPos)this.yieldPos=this.start;let $e=this.startNode();this.next();let je=this.tsMatchLeftRelational();if(!(!this.match(Ie.semi)&&!this.canInsertSemicolon()&&(this.match(Ie.star)||this.type.startsExpr||je)))return $e.delegate=!1,$e.argument=null,this.finishNode($e,"YieldExpression");return $e.delegate=this.eat(Ie.star),$e.argument=this.parseMaybeAssign(Le),this.finishNode($e,"YieldExpression")}parseMaybeAssignOrigin(Le,$e,je){if(this.isContextual("yield"))if(this.inGenerator)return this.parseYield(Le);else this.exprAllowed=!1;let qe=!1,He=-1,Ke=-1,Ze=-1;if($e)He=$e.parenthesizedAssign,Ke=$e.trailingComma,Ze=$e.doubleProto,$e.parenthesizedAssign=$e.trailingComma=-1;else $e=new Tr,qe=!0;let tt=this.start,et=this.startLoc;if(this.type===Ie.parenL||Ye(this.type))this.potentialArrowAt=this.start,this.potentialArrowInForAwait=Le==="await";let Je=this.parseMaybeConditional(Le,$e);if(je)Je=je.call(this,Je,tt,et);if(this.type.isAssign){let st=this.startNodeAt(tt,et);if(st.operator=this.value,this.type===Ie.eq)Je=this.toAssignable(Je,!0,$e,!0);if(!qe)$e.parenthesizedAssign=$e.trailingComma=$e.doubleProto=-1;if($e.shorthandAssign>=Je.start)$e.shorthandAssign=-1;if(!this.maybeInArrowParameters)if(this.type===Ie.eq)this.checkLValPattern(Je);else this.checkLValSimple(Je);if(st.left=Je,this.next(),st.right=this.parseMaybeAssign(Le),Ze>-1)$e.doubleProto=Ze;return this.finishNode(st,"AssignmentExpression")}else if(qe)this.checkExpressionErrors($e,!0);if(He>-1)$e.parenthesizedAssign=He;if(Ke>-1)$e.trailingComma=Ke;return Je}parseMaybeAssign(Le,$e,je){let qe,He;if(i?.jsx&&(this.matchJsx("jsxTagStart")||this.tsMatchLeftRelational())){if(qe=this.tryParse(()=>this.parseMaybeAssignOrigin(Le,$e,je)),!qe.error)return qe.node;let tt=this.context,et=tt[tt.length-1],Je=tt[tt.length-2];if(et===Re.tokContexts.tc_oTag&&Je===Re.tokContexts.tc_expr)this.parseEffects.pop(tt),this.parseEffects.pop(tt);else if(et===Re.tokContexts.tc_oTag||et===Re.tokContexts.tc_expr)this.parseEffects.pop(tt)}if(!qe?.error&&!this.tsMatchLeftRelational())return this.parseMaybeAssignOrigin(Le,$e,je);let Ke,Ze=this.tryParse((tt)=>{Ke=this.tsParseTypeParameters(this.tsParseConstModifier);let et=this.parseMaybeAssignOrigin(Le,$e,je);if(et.type!=="ArrowFunctionExpression"||et.extra?.parenthesized)tt();if(Ke?.params.length!==0)this.resetStartLocationFromNode(et,Ke);return et.typeParameters=Ke,et});if(!Ze.error&&!Ze.aborted){if(Ke)this.reportReservedArrowTypeParam(Ke);return Ze.node}if(!qe){if(Za(!0),He=this.tryParse(()=>this.parseMaybeAssignOrigin(Le,$e,je)),!He.error)return He.node}if(qe?.thrown)throw this.selectTryParseResult(qe),qe.error;if(Ze.thrown)throw this.selectTryParseResult(Ze),Ze.error;if(He?.thrown)throw this.selectTryParseResult(He),He.error;throw qe?.error||Ze.error||He?.error}parseAssignableListItem(Le){let $e=[];while(this.match(Ue.at))$e.push(this.parseDecorator());let je=this.start,qe=this.startLoc,He,Ke=!1,Ze=!1;if(Le!==void 0){let Je={};if(this.tsParseModifiers({modified:Je,allowedModifiers:["public","private","protected","override","readonly"]}),He=Je.accessibility,Ze=Je.override,Ke=Je.readonly,Le===!1&&(He||Ke||Ze))this.raise(qe.column,ct.UnexpectedParameterModifier)}let tt=this.parseMaybeDefault(je,qe);this.parseBindingListItem(tt);let et=this.parseMaybeDefault(tt.start,tt.loc.start,tt);if($e.length)et.decorators=$e;if(He||Ke||Ze){let Je=this.startNodeAt(je,qe);if(He)Je.accessibility=He;if(Ke)Je.readonly=Ke;if(Ze)Je.override=Ze;if(et.type!=="Identifier"&&et.type!=="AssignmentPattern")this.raise(Je.start,ct.UnsupportedParameterPropertyKind);return Je.parameter=et,this.finishNode(Je,"TSParameterProperty")}return et}checkLValInnerPattern(Le,$e=xt.BIND_NONE,je){switch(Le.type){case"TSParameterProperty":this.checkLValInnerPattern(Le.parameter,$e,je);break;default:{super.checkLValInnerPattern(Le,$e,je);break}}}parseBindingListItem(Le){if(this.eat(Ie.question)){if(Le.type!=="Identifier"&&!this.isAmbientContext&&!this.inType)this.raise(Le.start,ct.PatternIsOptional);Le.optional=!0}let $e=this.tsTryParseTypeAnnotation();if($e)Le.typeAnnotation=$e;return this.resetEndLocation(Le),Le}isAssignable(Le,$e){switch(Le.type){case"TSTypeCastExpression":return this.isAssignable(Le.expression,$e);case"TSParameterProperty":return!0;case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":return!0;case"ObjectExpression":{let je=Le.properties.length-1;return Le.properties.every((qe,He)=>qe.type!=="ObjectMethod"&&(He===je||qe.type!=="SpreadElement")&&this.isAssignable(qe))}case"Property":case"ObjectProperty":return this.isAssignable(Le.value);case"SpreadElement":return this.isAssignable(Le.argument);case"ArrayExpression":return Le.elements.every((je)=>je===null||this.isAssignable(je));case"AssignmentExpression":return Le.operator==="=";case"ParenthesizedExpression":return this.isAssignable(Le.expression);case"MemberExpression":case"OptionalMemberExpression":return!$e;default:return!1}}toAssignable(Le,$e=!1,je=new Tr,qe=!1){switch(Le.type){case"ParenthesizedExpression":return this.toAssignableParenthesizedExpression(Le,$e,je,qe);case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":if($e);else this.raise(Le.start,ct.UnexpectedTypeCastInParameter);let He=this.toAssignable(Le.expression,$e,je,qe);if(qe)return Le.expression=He,Le;return He;case"MemberExpression":break;case"AssignmentExpression":if(!$e&&Le.left.type==="TSTypeCastExpression")Le.left=this.typeCastToParameter(Le.left);return super.toAssignable(Le,$e,je);case"TSTypeCastExpression":return this.typeCastToParameter(Le);default:return super.toAssignable(Le,$e,je)}return Le}toAssignableParenthesizedExpression(Le,$e,je,qe=!1){switch(Le.expression.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":case"ParenthesizedExpression":let He=this.toAssignable(Le.expression,$e,je,qe);if(qe)return Le.expression=He,Le;return He;default:return super.toAssignable(Le,$e,je)}}parseBindingAtom(){switch(this.type){case Ie._this:return this.parseIdent(!0);default:return super.parseBindingAtom()}}shouldParseArrow(Le){let $e;if(this.match(Ie.colon))$e=Le.every((je)=>this.isAssignable(je,!0));else $e=!this.canInsertSemicolon();if($e){if(this.match(Ie.colon)){let je=this.tryParse((qe)=>{let He=this.tsParseTypeOrTypePredicateAnnotation(Ie.colon);if(this.canInsertSemicolon()||!this.match(Ie.arrow))qe();return He});if(je.aborted)return this.shouldParseArrowReturnType=void 0,!1;if(!je.thrown)this.shouldParseArrowReturnType=je.node}if(!this.match(Ie.arrow))return this.shouldParseArrowReturnType=void 0,!1;return!0}return this.shouldParseArrowReturnType=void 0,$e}parseParenArrowList(Le,$e,je,qe){let He=this.startNodeAt(Le,$e);return He.returnType=this.shouldParseArrowReturnType,this.shouldParseArrowReturnType=void 0,this.parseArrowExpression(He,je,!1,qe)}parseParenAndDistinguishExpression(Le,$e){let je=this.start,qe=this.startLoc,He,Ke=this.ecmaVersion>=8;if(this.ecmaVersion>=6){let Ze=this.maybeInArrowParameters;this.maybeInArrowParameters=!0,this.next();let tt=this.start,et=this.startLoc,Je=[],st=!0,pt=!1,ut=new Tr,ht=this.yieldPos,yt=this.awaitPos,It;this.yieldPos=0,this.awaitPos=0;while(this.type!==Ie.parenR)if(st?st=!1:this.expect(Ie.comma),Ke&&this.afterTrailingComma(Ie.parenR,!0)){pt=!0;break}else if(this.type===Ie.ellipsis){if(It=this.start,Je.push(this.parseParenItem(this.parseRestBinding())),this.type===Ie.comma)this.raise(this.start,"Comma is not permitted after the rest element");break}else Je.push(this.parseMaybeAssign(!1,ut,this.parseParenItem));let Mt=this.lastTokEnd,jt=this.lastTokEndLoc;if(this.expect(Ie.parenR),this.maybeInArrowParameters=Ze,Le&&this.shouldParseArrow(Je)&&this.eat(Ie.arrow))return this.checkPatternErrors(ut,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=ht,this.awaitPos=yt,this.parseParenArrowList(je,qe,Je,$e);if(!Je.length||pt)this.unexpected(this.lastTokStart);if(It)this.unexpected(It);if(this.checkExpressionErrors(ut,!0),this.yieldPos=ht||this.yieldPos,this.awaitPos=yt||this.awaitPos,Je.length>1)He=this.startNodeAt(tt,et),He.expressions=Je,this.finishNodeAt(He,"SequenceExpression",Mt,jt);else He=Je[0]}else He=this.parseParenExpression();if(this.options.preserveParens){let Ze=this.startNodeAt(je,qe);return Ze.expression=He,this.finishNode(Ze,"ParenthesizedExpression")}else return He}parseTaggedTemplateExpression(Le,$e,je,qe){let He=this.startNodeAt($e,je);if(He.tag=Le,He.quasi=this.parseTemplate({isTagged:!0}),qe)this.raise($e,"Tagged Template Literals are not allowed in optionalChain.");return this.finishNode(He,"TaggedTemplateExpression")}shouldParseAsyncArrow(){if(this.match(Ie.colon)){let Le=this.tryParse(($e)=>{let je=this.tsParseTypeOrTypePredicateAnnotation(Ie.colon);if(this.canInsertSemicolon()||!this.match(Ie.arrow))$e();return je});if(Le.aborted)return this.shouldParseAsyncArrowReturnType=void 0,!1;if(!Le.thrown)return this.shouldParseAsyncArrowReturnType=Le.node,!this.canInsertSemicolon()&&this.eat(Ie.arrow)}else return!this.canInsertSemicolon()&&this.eat(Ie.arrow)}parseSubscriptAsyncArrow(Le,$e,je,qe){let He=this.startNodeAt(Le,$e);return He.returnType=this.shouldParseAsyncArrowReturnType,this.shouldParseAsyncArrowReturnType=void 0,this.parseArrowExpression(He,je,!0,qe)}parseExprList(Le,$e,je,qe){let He=[],Ke=!0;while(!this.eat(Le)){if(!Ke){if(this.expect(Ie.comma),$e&&this.afterTrailingComma(Le))break}else Ke=!1;let Ze;if(je&&this.type===Ie.comma)Ze=null;else if(this.type===Ie.ellipsis){if(Ze=this.parseSpread(qe),this.maybeInArrowParameters&&this.match(Ie.colon))Ze.typeAnnotation=this.tsParseTypeAnnotation();if(qe&&this.type===Ie.comma&&qe.trailingComma<0)qe.trailingComma=this.start}else Ze=this.parseMaybeAssign(!1,qe,this.parseParenItem);He.push(Ze)}return He}parseMaybeDecoratorArguments(Le){let $e=this.tsMatchLeftRelational()||this.match(Ie.bitShift)?this.tsParseTypeArgumentsInExpression():void 0;if(this.eat(Ie.parenL)){let je=this.startNodeAtNode(Le);if(je.callee=Le,je.arguments=this.parseExprList(Ie.parenR,!1),$e)je.typeArguments=$e;return this.finishNode(je,"CallExpression")}if($e){let je=this.startNodeAtNode(Le);return je.expression=Le,je.typeArguments=$e,this.finishNode(je,"TSInstantiationExpression")}return Le}parseSubscript(Le,$e,je,qe,He,Ke,Ze){let tt=Ke;if(!this.hasPrecedingLineBreak()&&this.value==="!"&&this.match(Ie.prefix)){this.exprAllowed=!1,this.next();let ut=this.startNodeAt($e,je);return ut.expression=Le,Le=this.finishNode(ut,"TSNonNullExpression"),Le}let et=!1;if(this.match(Ie.questionDot)&&this.lookaheadCharCode()===60){if(qe)return Le;Le.optional=!0,tt=et=!0,this.next()}if(this.tsMatchLeftRelational()||this.match(Ie.bitShift)){let ut,ht=this.tsTryParseAndCatch(()=>{if(!qe&&this.atPossibleAsyncArrow(Le)){let jt=this.tsTryParseGenericAsyncArrowFunction($e,je,Ze);if(jt)return Le=jt,Le}let yt=this.tsParseTypeArgumentsInExpression();if(!yt)return Le;if(et&&!this.match(Ie.parenL))return ut=this.curPosition(),Le;if(rt(this.type)||this.type===Ie.backQuote){let jt=this.parseTaggedTemplateExpression(Le,$e,je,tt);return jt.typeArguments=yt,jt}if(!qe&&this.eat(Ie.parenL)){let jt=new Tr,$t=this.startNodeAt($e,je);if($t.callee=Le,$t.arguments=this.parseExprList(Ie.parenR,this.ecmaVersion>=8,!1,jt),this.tsCheckForInvalidTypeCasts($t.arguments),$t.typeArguments=yt,tt)$t.optional=et;return this.checkExpressionErrors(jt,!0),Le=this.finishNode($t,"CallExpression"),Le}let It=this.type;if(this.tsMatchRightRelational()||It===Ie.bitShift||It!==Ie.parenL&&Zd(It)&&!this.hasPrecedingLineBreak())return;let Mt=this.startNodeAt($e,je);return Mt.expression=Le,Mt.typeArguments=yt,this.finishNode(Mt,"TSInstantiationExpression")});if(ut)this.unexpected(ut);if(ht){if(ht.type==="TSInstantiationExpression"&&(this.match(Ie.dot)||this.match(Ie.questionDot)&&this.lookaheadCharCode()!==40))this.raise(this.start,ct.InvalidPropertyAccessAfterInstantiationExpression);return Le=ht,Le}}let Je=this.ecmaVersion>=11,st=Je&&this.eat(Ie.questionDot);if(qe&&st)this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");let pt=this.eat(Ie.bracketL);if(pt||st&&this.type!==Ie.parenL&&this.type!==Ie.backQuote||this.eat(Ie.dot)){let ut=this.startNodeAt($e,je);if(ut.object=Le,pt)ut.property=this.parseExpression(),this.expect(Ie.bracketR);else if(this.type===Ie.privateId&&Le.type!=="Super")ut.property=this.parsePrivateIdent();else ut.property=this.parseIdent(this.options.allowReserved!=="never");if(ut.computed=!!pt,Je)ut.optional=st;Le=this.finishNode(ut,"MemberExpression")}else if(!qe&&this.eat(Ie.parenL)){let ut=this.maybeInArrowParameters;this.maybeInArrowParameters=!0;let ht=new Tr,yt=this.yieldPos,It=this.awaitPos,Mt=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;let jt=this.parseExprList(Ie.parenR,this.ecmaVersion>=8,!1,ht);if(He&&!st&&this.shouldParseAsyncArrow()){if(this.checkPatternErrors(ht,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0)this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function");this.yieldPos=yt,this.awaitPos=It,this.awaitIdentPos=Mt,Le=this.parseSubscriptAsyncArrow($e,je,jt,Ze)}else{this.checkExpressionErrors(ht,!0),this.yieldPos=yt||this.yieldPos,this.awaitPos=It||this.awaitPos,this.awaitIdentPos=Mt||this.awaitIdentPos;let $t=this.startNodeAt($e,je);if($t.callee=Le,$t.arguments=jt,Je)$t.optional=st;Le=this.finishNode($t,"CallExpression")}this.maybeInArrowParameters=ut}else if(this.type===Ie.backQuote){if(st||tt)this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");let ut=this.startNodeAt($e,je);ut.tag=Le,ut.quasi=this.parseTemplate({isTagged:!0}),Le=this.finishNode(ut,"TaggedTemplateExpression")}return Le}parseGetterSetter(Le){Le.kind=Le.key.name,this.parsePropertyName(Le);let $e=this.tsTryParseTypeParameters(this.tsParseConstModifier);if(Le.value=this.parseMethod(!1),$e)Le.value.typeParameters=$e;let je=Le.kind==="get"?0:1,qe=Le.value.params[0];if(je=qe&&this.isThisParam(qe)?je+1:je,Le.value.params.length!==je){let Ke=Le.value.start;if(Le.kind==="get")this.raiseRecoverable(Ke,"getter should have no params");else this.raiseRecoverable(Ke,"setter should have exactly one param")}else if(Le.kind==="set"&&Le.value.params[0].type==="RestElement")this.raiseRecoverable(Le.value.params[0].start,"Setter cannot use rest params")}parsePropertyValue(Le,$e,je,qe,He,Ke,Ze,tt){if(this.tsMatchLeftRelational()){if($e)this.unexpected();Le.kind="init",Le.method=!0;let et=this.tsTryParseTypeParameters(this.tsParseConstModifier);if(Le.value=this.parseMethod(je,qe),et)Le.value.typeParameters=et;return}return super.parsePropertyValue(Le,$e,je,qe,He,Ke,Ze,tt)}parseProperty(Le,$e){if(!Le){let je=[];if(this.match(Ue.at))while(this.match(Ue.at))je.push(this.parseDecorator());let qe=super.parseProperty(Le,$e);if(qe.type==="SpreadElement"){if(je.length)this.raise(qe.start,is.SpreadElementDecorator)}if(je.length)qe.decorators=je,je=[];return qe}return super.parseProperty(Le,$e)}parseCatchClauseParam(){let Le=this.parseBindingAtom(),$e=Le.type==="Identifier";this.enterScope($e?xt.SCOPE_SIMPLE_CATCH:0),this.checkLValPattern(Le,$e?xt.BIND_SIMPLE_CATCH:xt.BIND_LEXICAL);let je=this.tsTryParseTypeAnnotation();if(je)Le.typeAnnotation=je,this.resetEndLocation(Le);return this.expect(Ie.parenR),Le}parseClass(Le,$e){let je=this.inAbstractClass;this.inAbstractClass=!!Le.abstract;try{this.next(),this.takeDecorators(Le);let qe=this.strict;this.strict=!0,this.parseClassId(Le,$e),this.parseClassSuper(Le);let He=this.enterClassBody(),Ke=this.startNode(),Ze=!1;Ke.body=[];let tt=[];this.expect(Ie.braceL);while(this.type!==Ie.braceR){if(this.match(Ue.at)){tt.push(this.parseDecorator());continue}let et=this.parseClassElement(Le.superClass!==null);if(tt.length)et.decorators=tt,this.resetStartLocationFromNode(et,tt[0]),tt=[];if(et){if(Ke.body.push(et),et.type==="MethodDefinition"&&et.kind==="constructor"&&et.value.type==="FunctionExpression"){if(Ze)this.raiseRecoverable(et.start,"Duplicate constructor in the same class");if(Ze=!0,et.decorators&&et.decorators.length>0)this.raise(et.start,is.DecoratorConstructor)}else if(et.key&&et.key.type==="PrivateIdentifier"&&et.value?.type!=="TSDeclareMethod"){let Je=et.key.name;if(this.parseEffects.modify(He,Je,(pt)=>Md(pt,et)))this.raiseRecoverable(et.key.start,`Identifier '#${Je}' has already been declared`)}}}if(this.strict=qe,this.next(),tt.length)this.raise(this.start,is.TrailingDecorator);return Le.body=this.finishNode(Ke,"ClassBody"),this.exitClassBody(),this.finishNode(Le,$e?"ClassDeclaration":"ClassExpression")}finally{this.inAbstractClass=je}}parseClassFunctionParams(){let Le=this.tsTryParseTypeParameters(),$e=this.parseBindingList(Ie.parenR,!1,this.ecmaVersion>=8,!0);if(Le)$e.typeParameters=Le;return $e}parseMethod(Le,$e,je,qe,He){let Ke=this.startNode(),Ze=this.yieldPos,tt=this.awaitPos,et=this.awaitIdentPos;if(this.initFunction(Ke),this.ecmaVersion>=6)Ke.generator=Le;if(this.ecmaVersion>=8)Ke.async=!!$e;if(this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Ti($e,Ke.generator)|xt.SCOPE_SUPER|(je?xt.SCOPE_DIRECT_SUPER:0)),this.expect(Ie.parenL),Ke.params=this.parseClassFunctionParams(),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(Ke,!1,!0,!1,{isClassMethod:qe}),this.yieldPos=Ze,this.awaitPos=tt,this.awaitIdentPos=et,He&&He.abstract){if(!!Ke.body){let{key:st}=He;this.raise(He.start,ct.AbstractMethodHasImplementation({methodName:st.type==="Identifier"&&!He.computed?st.name:`[${this.input.slice(st.start,st.end)}]`}))}}return this.finishNode(Ke,"FunctionExpression")}static parse(Le,$e){if($e.locations===!1)throw Error("You have to enable options.locations while using acorn-typescript");else $e.locations=!0;let je=new this($e,Le);if(Ae)je.isAmbientContext=!0;return je.parse()}static parseExpressionAt(Le,$e,je){if(je.locations===!1)throw Error("You have to enable options.locations while using acorn-typescript");else je.locations=!0;let qe=new this(je,Le,$e);if(Ae)qe.isAmbientContext=!0;return qe.nextToken(),qe.parseExpression()}parseImportSpecifier(){if(this.ts_isContextual(Ue.type)){let $e=this.startNode();return $e.imported=this.parseModuleExportName(),this.parseTypeOnlyImportExportSpecifier($e,!0,this.importOrExportOuterKind==="type"),this.finishNode($e,"ImportSpecifier")}else{let $e=super.parseImportSpecifier();return $e.importKind="value",$e}}parseExportSpecifier(Le){let $e=this.ts_isContextual(Ue.type);if(!this.match(Ie.string)&&$e){let qe=this.startNode();return qe.local=this.parseModuleExportName(),this.parseTypeOnlyImportExportSpecifier(qe,!1,this.importOrExportOuterKind==="type"),this.finishNode(qe,"ExportSpecifier"),this.checkExport(Le,qe.exported,qe.exported.start),qe}else{let qe=super.parseExportSpecifier(Le);return qe.exportKind="value",qe}}parseTypeOnlyImportExportSpecifier(Le,$e,je){let qe=$e?"imported":"local",He=$e?"local":"exported",Ke=Le[qe],Ze,tt=!1,et=!0,Je=Ke.start;if(this.isContextual("as")){let pt=this.parseIdent();if(this.isContextual("as")){let ut=this.parseIdent();if(nt(this.type))tt=!0,Ke=pt,Ze=$e?this.parseIdent():this.parseModuleExportName(),et=!1;else Ze=ut,et=!1}else if(nt(this.type))et=!1,Ze=$e?this.parseIdent():this.parseModuleExportName();else tt=!0,Ke=pt}else if(nt(this.type))if(tt=!0,$e){if(Ke=super.parseIdent(!0),!this.isContextual("as"))this.checkUnreserved(Ke)}else Ke=this.parseModuleExportName();if(tt&&je)this.raise(Je,$e?ct.TypeModifierIsUsedInTypeImports:ct.TypeModifierIsUsedInTypeExports);Le[qe]=Ke,Le[He]=Ze;let st=$e?"importKind":"exportKind";if(Le[st]=tt?"type":"value",et&&this.eatContextual("as"))Le[He]=$e?this.parseIdent():this.parseModuleExportName();if(!Le[He])Le[He]=this.copyNode(Le[qe]);if($e)this.checkLValSimple(Le[He],xt.BIND_LEXICAL)}raiseCommonCheck(Le,$e,je){switch($e){case"Comma is not permitted after the rest element":if(this.isAmbientContext&&this.match(Ie.comma)&&this.lookaheadCharCode()===41){this.next();return}else return super.raise(Le,$e)}return je?super.raiseRecoverable(Le,$e):super.raise(Le,$e)}raiseRecoverable(Le,$e){return this.raiseCommonCheck(Le,$e,!0)}raise(Le,$e){return this.raiseCommonCheck(Le,$e,!0)}updateContext(Le){let{type:$e}=this;if($e==Ie.braceL){var je=this.curContext();if(je==Xe.tc_oTag)this.parseEffects.append(this.context,Ve.b_expr);else if(je==Xe.tc_expr)this.parseEffects.append(this.context,Ve.b_tmpl);else super.updateContext(Le);this.exprAllowed=!0}else if($e===Ie.slash&&Le===Ue.jsxTagStart)this.parseEffects.truncate(this.context,this.context.length-2),this.parseEffects.append(this.context,Xe.tc_cTag),this.exprAllowed=!1;else return super.updateContext(Le)}jsx_parseOpeningElementAt(Le,$e){let je=this.startNodeAt(Le,$e),qe=this.jsx_parseElementName();if(qe)je.name=qe;if(this.match(Ie.relational)||this.match(Ie.bitShift)){let He=this.tsTryParseAndCatch(()=>this.tsParseTypeArgumentsInExpression());if(He)je.typeArguments=He}je.attributes=[];while(this.type!==Ie.slash&&this.type!==Ue.jsxTagEnd)je.attributes.push(this.jsx_parseAttribute());return je.selfClosing=this.eat(Ie.slash),this.expect(Ue.jsxTagEnd),this.finishNode(je,qe?"JSXOpeningElement":"JSXOpeningFragment")}enterScope(Le){let $e=Le===vr;if($e)this.parseEffects.append(this.importsStack,[]);let je=$e?Le|xt.SCOPE_CLASS_STATIC_BLOCK:Le;super.enterScope(je);let qe=super.currentScope();qe.types=[],qe.enums=[],qe.constEnums=[],qe.classes=[],qe.exportOnlyBindings=[]}exitScope(){if(super.currentScope().flags&vr)this.parseEffects.pop(this.importsStack);super.exitScope()}hasImport(Le,$e){let je=this.importsStack.length;if(this.importsStack[je-1].indexOf(Le)>-1)return!0;if(!$e&&je>1){for(let qe=0;qe<je-1;qe++)if(this.importsStack[qe].indexOf(Le)>-1)return!0}return!1}maybeExportDefined(Le,$e){if(this.inModule&&Le.flags&xt.SCOPE_TOP)this.parseEffects.remove(this.undefinedExports,$e)}declareName(Le,$e,je){if($e&xt.BIND_FLAGS_TS_IMPORT){if(this.hasImport(Le,!0))this.raise(je,`Identifier '${Le}' has already been declared.`);this.parseEffects.append(this.importsStack[this.importsStack.length-1],Le);return}let qe=this.currentScope();if($e&xt.BIND_FLAGS_TS_EXPORT_ONLY){this.maybeExportDefined(qe,Le),this.parseEffects.append(qe.exportOnlyBindings,Le);return}if($e===xt.BIND_TS_TYPE||$e===xt.BIND_TS_INTERFACE){if($e===xt.BIND_TS_TYPE&&qe.types.includes(Le))this.raise(je,`type '${Le}' has already been declared.`);this.parseEffects.append(qe.types,Le)}else if($e&xt.BIND_FLAGS_TS_ENUM){if(qe.enums.includes(Le))return;super.declareName(Le,xt.BIND_LEXICAL,je)}else super.declareName(Le,$e,je);if($e&xt.BIND_FLAGS_TS_ENUM)this.parseEffects.append(qe.enums,Le);if($e&xt.BIND_FLAGS_TS_CONST_ENUM)this.parseEffects.append(qe.constEnums,Le);if($e&xt.BIND_FLAGS_CLASS)this.parseEffects.append(qe.classes,Le)}checkLocalExport(Le){let{name:$e}=Le;if(this.hasImport($e))return;let je=this.scopeStack.length;for(let qe=je-1;qe>=0;qe--){let He=this.scopeStack[qe];if(He.types.indexOf($e)>-1||He.exportOnlyBindings.indexOf($e)>-1)return}super.checkLocalExport(Le)}}return Dt}}var nf=/\n/,rf=/[ \t]/,sf=/^[,) \t]*$/,as="",uc=[];function cs(i,Ae){as=i,uc=Ae}function ls(i,Ae,Ne,_e){let De=Ae;if(i&&nf.test(De)){let Re=Ne;while(Re>0&&as[Re-1]!==`
|
|
12
|
-
`)Re-=1;let Ie=Re;while(rf.test(as[Ie]))Ie+=1;let Oe=as.slice(Re,Ie);De=of(De,Oe)}uc.push({type:i?"Block":"Line",value:De,start:Ne,end:_e})}function of(i,Ae){if(Ae==="")return i;return(i.startsWith(Ae)?i.slice(Ae.length):i).replaceAll(`
|
|
13
|
-
${Ae}`,`
|
|
14
|
-
`)}function Pi(i,Ae,Ne,_e){let De=af(Ne,_e);if(De>=Ne.length)return;wi(i,void 0,Ne,{index:De},Ae)}function af(i,Ae){let Ne=0,_e=i.length;while(Ne<_e){let De=Ne+_e>>>1;if(i[De].start<Ae)Ne=De+1;else _e=De}return Ne}function wi(i,Ae,Ne,_e,De){while(_e.index<Ne.length&&Ne[_e.index].start<(i.start??0))i.leadingComments??=[],i.leadingComments.push(Ne[_e.index]),_e.index++;if(_e.index>=Ne.length)return;let Re=Ne[_e.index].start,Ie=i.end,Me=Ie===void 0||Ie>Re?Object.keys(i):[];for(let Fe=0;Fe<Me.length;Fe++){let Be=Me[Fe];if(Be==="type"||Be==="leadingComments")continue;let Ve=i[Be];if(!Ve||typeof Ve!=="object")continue;if(Array.isArray(Ve)){for(let Ge of Ve)if(Ge&&typeof Ge==="object"&&typeof Ge.type==="string"){if(wi(Ge,i,Ne,_e,De),_e.index>=Ne.length)return}}else if(typeof Ve.type==="string"){if(wi(Ve,i,Ne,_e,De),_e.index>=Ne.length)return}}if(_e.index<Ne.length){let Fe=Ne[_e.index];if(Ae===void 0||i.end!==Ae.end){let Be=De.slice(i.end??0,Fe.start);if((Ae?.type==="BlockStatement"||Ae?.type==="Program")&&Ai(Ae.body,i)||Ae?.type==="ArrayExpression"&&Ai(Ae.elements,i)||Ae?.type==="ObjectExpression"&&Ai(Ae.properties,i))while(_e.index<Ne.length){if(Ae&&Ne[_e.index].start>=(Ae.end??Number.POSITIVE_INFINITY))break;_e.index++}else if((i.end??0)<=Fe.start&&sf.test(Be))_e.index++}}}function Ai(i,Ae){return!!i&&i.indexOf(Ae)===i.length-1}var ps={sawParenthesized:!1},hc=(i)=>class extends i{parseParenAndDistinguishExpression(Ae,Ne){let _e=super.parseParenAndDistinguishExpression(Ae,Ne);if(_e.type==="ParenthesizedExpression")ps.sawParenthesized=!0;return _e}parseDecorator(){return ps.sawParenthesized=!0,super.parseDecorator()}},cf=Pt.extend(hc),lf=Pt.extend(pc(),hc);function Ii(i){return i?lf:cf}var pf={onComment:ls,sourceType:"module",ecmaVersion:16},mc={onComment:ls,sourceType:"module",ecmaVersion:16,preserveParens:!0},uf={onComment:ls,sourceType:"module",ecmaVersion:16},dc={...mc,startLocation:null},Ni=/\r\n?|\n|\u2028|\u2029/g;function df(i,Ae){if(Ae?.breakEnds)return Ae.breakEnds;let Ne=[];Ni.lastIndex=0;while(Ni.test(i))Ne.push(Ni.lastIndex);if(Ae)Ae.breakEnds=Ne;return Ne}function ff(i,Ae,Ne){let _e=i.lastIndexOf(`
|
|
15
|
-
`,Ae-1)+1,De=df(i,Ne),Re=0,Ie=De.length;while(Re<Ie){let Oe=Re+Ie>>>1;if(De[Oe]<=_e)Re=Oe+1;else Ie=Oe}return{line:Re+1,column:Ae-_e}}function yc(i,Ae,Ne,_e,De){if(Ne.length===De)return;Pi(i,Ae,Ne,_e)}function sr(i,Ae,Ne){let _e=Ne.length;cs(i,Ne);let De=Ii(Ae).parse(i,pf);if(Ne.length>0)Pi(De,i,Ne,_e);return De}var hf={count:0};function ir(i,Ae,Ne,_e,De){hf.count+=1;let Re=_e.length;cs(i,_e),ps.sawParenthesized=!1;let Ie=mc;if(Ne)dc.startLocation=ff(i,Ae,De),Ie=dc;let Oe=Ii(Ne).parseExpressionAt(i,Ae,Ie);yc(Oe,i,_e,Ae,Re);let Me=_e.length>Re?_e.at(-1):void 0,Fe=Me&&Me.end>(Oe.end??0)?Me.end:Oe.end??0;return{node:ps.sawParenthesized?mf(Oe):Oe,end:Fe}}function gc(i,Ae,Ne,_e){let De=_e.length,Re=Ii(Ne);cs(i,_e);let Ie=new Re(uf,i,Ae);Ie.nextToken();let Oe=Ie.parseStatement(null,!0,Object.create(null));return yc(Oe,i,_e,Ae,De),Oe}function fc(i){return i!==null&&typeof i==="object"&&typeof i.type==="string"}function _i(i){let Ae=i;while(Ae.type==="ParenthesizedExpression"&&Ae.expression)Ae=Ae.expression;return Ae}function mf(i){let Ae=_i(i);return Di(Ae),Ae}function Di(i){for(let Ae in i){let Ne=i[Ae];if(!Ne||typeof Ne!=="object")continue;if(Array.isArray(Ne))for(let _e=0;_e<Ne.length;_e++){let De=Ne[_e];if(!fc(De))continue;let Re=_i(De);if(Re!==De)Ne[_e]=Re;Di(Re)}else if(fc(Ne)){let _e=_i(Ne);if(_e!==Ne)i[Ae]=_e;Di(_e)}}}function Hn(i){if(i===32||i<=13&&i>=9)return!0;if(i<160)return!1;return i===160||i===5760||i>=8192&&i<=8202||i===8232||i===8233||i===8239||i===8287||i===12288||i===65279}class Ri{source;index=0;constructor(i){this.source=i}match(i){if(i.length===1)return this.source.charCodeAt(this.index)===i.charCodeAt(0);return this.source.startsWith(i,this.index)}matchRegex(i){i.lastIndex=this.index;let Ae=i.exec(this.source);if(!Ae||Ae.index!==this.index)return null;return Ae[0]}eat(i,Ae=!1){if(this.match(i))return this.index+=i.length,!0;if(Ae)throw new Mn(`Expected token ${JSON.stringify(i)}`,this.index);return!1}read(i){let Ae=this.matchRegex(i);if(Ae)this.index+=Ae.length;return Ae}readUntil(i){if(this.index>=this.source.length)throw new Mn("Unexpected end of input",this.source.length);let Ae=this.index;i.lastIndex=Ae;let Ne=i.exec(this.source);if(Ne)return this.index=Ne.index,this.source.slice(Ae,this.index);return this.index=this.source.length,this.source.slice(Ae)}readUntilString(i){if(this.index>=this.source.length)throw new Mn("Unexpected end of input",this.source.length);let Ae=this.source.indexOf(i,this.index),Ne=Ae===-1?this.source.length:Ae,_e=this.source.slice(this.index,Ne);return this.index=Ne,_e}allowWhitespace(){while(this.index<this.source.length&&Hn(this.source.charCodeAt(this.index)))this.index++}requireWhitespace(){if(!Hn(this.source.charCodeAt(this.index)))throw new Mn("Expected whitespace",this.index);this.allowWhitespace()}readIdentifierName(){let i=this.index,Ae=i,Ne="",_e=this.source.codePointAt(this.index);if(_e!==void 0&&Ut(_e,!0)){Ae+=_e<=65535?1:2;while(Ae<this.source.length){let De=this.source.codePointAt(Ae);if(De===void 0||!Qt(De,!0))break;Ae+=De<=65535?1:2}Ne=this.source.slice(i,Ae),this.index=Ae}return{type:"Identifier",name:Ne,start:i,end:Ae}}}class Mn extends Error{position;constructor(i,Ae){super(`${i} (at index ${Ae})`);this.name="TemplateSyntaxError",this.position=Ae}}function Kt(){return{type:"Fragment",nodes:[]}}var yf=new Set(["await","break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","finally","for","function","if","implements","import","in","instanceof","interface","let","new","package","private","protected","public","return","static","super","switch","this","throw","try","typeof","var","void","while","with","yield"]),gf=["&&","||","??"],xf=["===","!==","==","!="];function xc(i,Ae){let Ne=i.codePointAt(Ae);if(Ne===void 0||!Ut(Ne,!0))return Ae;let _e=Ae+(Ne<=65535?1:2);while(_e<i.length){let De=i.codePointAt(_e);if(!Qt(De,!0))break;_e+=De<=65535?1:2}return _e}function bf(i,Ae){let Ne=Ae;while(Ne<i.length){let _e=i.charCodeAt(Ne);if(_e<48||_e>57)break;Ne++}return Ne}function us(i,Ae){let Ne=Ae;while(Ne<i.length&&Hn(i.charCodeAt(Ne)))Ne++;return Ne}function bc(i,Ae){let Ne=bf(i,Ae);if(Ne===Ae)return null;if(i.charCodeAt(Ae)===48&&Ne-Ae>1)return null;if(Ne<i.length){let De=i.codePointAt(Ne);if(De===46||Qt(De,!0))return null}let _e=i.slice(Ae,Ne);return{type:"Literal",start:Ae,end:Ne,value:Number(_e),raw:_e}}function Ec(i,Ae){let Ne=i.charCodeAt(Ae),_e=Ae+1;while(_e<i.length){let De=i.charCodeAt(_e);if(De===Ne){let Re=i.slice(Ae,_e+1);return{type:"Literal",start:Ae,end:_e+1,value:i.slice(Ae+1,_e),raw:Re}}if(De===92||De===10||De===13)return null;_e++}return null}function Ef(i,Ae){let Ne=i.charCodeAt(Ae);if(Ne===34||Ne===39)return Ec(i,Ae);let _e=xc(i,Ae);if(_e===Ae)return bc(i,Ae);let De=i.slice(Ae,_e);if(De==="true"||De==="false")return{type:"Literal",start:Ae,end:_e,value:De==="true",raw:De};if(De==="null")return{type:"Literal",start:Ae,end:_e,value:null,raw:De};if(yf.has(De))return null;let Re={type:"Identifier",start:Ae,end:_e,name:De},Ie=_e;while(Ie<i.length){let Oe=i.charCodeAt(Ie);if(Oe===46){let Me=Ie+1,Fe=xc(i,Me);if(Fe===Me)return null;let Be={type:"Identifier",start:Me,end:Fe,name:i.slice(Me,Fe)};Re={type:"MemberExpression",start:Ae,end:Fe,object:Re,property:Be,computed:!1,optional:!1},Ie=Fe}else if(Oe===91){let Me=Ie+1,Fe=i.charCodeAt(Me),Be=Fe===34||Fe===39?Ec(i,Me):bc(i,Me);if(!Be||i.charCodeAt(Be.end)!==93)return null;Re={type:"MemberExpression",start:Ae,end:Be.end+1,object:Re,property:Be,computed:!0,optional:!1},Ie=Be.end+1}else break}return Re}function Li(i,Ae){if(i.charCodeAt(Ae)!==33||i.charCodeAt(Ae+1)===61)return Ef(i,Ae);let Ne=Li(i,us(i,Ae+1));if(!Ne)return null;return{type:"UnaryExpression",start:Ae,end:Ne.end,operator:"!",prefix:!0,argument:Ne}}function Cf(i,Ae){for(let Ne of xf)if(i.startsWith(Ne,Ae))return{operator:Ne,logical:!1};for(let Ne of gf)if(i.startsWith(Ne,Ae))return{operator:Ne,logical:!0};return null}function Cc(i,Ae){let Ne=us(i,Ae);if(Ne>=i.length)return!1;let _e=i.charCodeAt(Ne);return _e===125||_e===41}function Sf(i){let Ae=i.source,Ne=Li(Ae,i.index);if(!Ne)return null;if(Cc(Ae,Ne.end))return i.index=Ne.end,Ne;let _e=us(Ae,Ne.end),De=Cf(Ae,_e);if(!De)return null;let Re=Li(Ae,us(Ae,_e+De.operator.length));if(!Re||!Cc(Ae,Re.end))return null;return i.index=Re.end,{type:De.logical?"LogicalExpression":"BinaryExpression",start:Ne.start,end:Re.end,left:Ne,operator:De.operator,right:Re}}function Ft(i){let Ae=Sf(i);if(Ae)return Ae;let{node:Ne,end:_e}=ir(i.source,i.index,i.isTypeScript,i.root.comments,i.lineTable);return i.index=_e,Ne}var vf={"CounterClockwiseContourIntegral;":8755,"ClockwiseContourIntegral;":8754,"DoubleLongLeftRightArrow;":10234,"NotNestedGreaterGreater;":10914,"DiacriticalDoubleAcute;":733,"NotSquareSupersetEqual;":8931,"CloseCurlyDoubleQuote;":8221,"DoubleContourIntegral;":8751,"FilledVerySmallSquare;":9642,"NegativeVeryThinSpace;":8203,"NotPrecedesSlantEqual;":8928,"NotRightTriangleEqual;":8941,"NotSucceedsSlantEqual;":8929,"CapitalDifferentialD;":8517,"DoubleLeftRightArrow;":8660,"DoubleLongRightArrow;":10233,"EmptyVerySmallSquare;":9643,"NestedGreaterGreater;":8811,"NotDoubleVerticalBar;":8742,"NotGreaterSlantEqual;":10878,"NotLeftTriangleEqual;":8940,"NotSquareSubsetEqual;":8930,"OpenCurlyDoubleQuote;":8220,"ReverseUpEquilibrium;":10607,"DoubleLongLeftArrow;":10232,"DownLeftRightVector;":10576,"LeftArrowRightArrow;":8646,"NegativeMediumSpace;":8203,"NotGreaterFullEqual;":8807,"NotRightTriangleBar;":10704,"RightArrowLeftArrow;":8644,"SquareSupersetEqual;":8850,"leftrightsquigarrow;":8621,"DownRightTeeVector;":10591,"DownRightVectorBar;":10583,"LongLeftRightArrow;":10231,"Longleftrightarrow;":10234,"NegativeThickSpace;":8203,"NotLeftTriangleBar;":10703,"PrecedesSlantEqual;":8828,"ReverseEquilibrium;":8651,"RightDoubleBracket;":10215,"RightDownTeeVector;":10589,"RightDownVectorBar;":10581,"RightTriangleEqual;":8885,"SquareIntersection;":8851,"SucceedsSlantEqual;":8829,"blacktriangleright;":9656,"longleftrightarrow;":10231,"DoubleUpDownArrow;":8661,"DoubleVerticalBar;":8741,"DownLeftTeeVector;":10590,"DownLeftVectorBar;":10582,"FilledSmallSquare;":9724,"GreaterSlantEqual;":10878,"LeftDoubleBracket;":10214,"LeftDownTeeVector;":10593,"LeftDownVectorBar;":10585,"LeftTriangleEqual;":8884,"NegativeThinSpace;":8203,"NotGreaterGreater;":8811,"NotLessSlantEqual;":10877,"NotNestedLessLess;":10913,"NotReverseElement;":8716,"NotSquareSuperset;":8848,"NotTildeFullEqual;":8775,"RightAngleBracket;":10217,"RightUpDownVector;":10575,"SquareSubsetEqual;":8849,"VerticalSeparator;":10072,"blacktriangledown;":9662,"blacktriangleleft;":9666,"leftrightharpoons;":8651,"rightleftharpoons;":8652,"twoheadrightarrow;":8608,"DiacriticalAcute;":180,"DiacriticalGrave;":96,"DiacriticalTilde;":732,"DoubleRightArrow;":8658,"DownArrowUpArrow;":8693,"EmptySmallSquare;":9723,"GreaterEqualLess;":8923,"GreaterFullEqual;":8807,"LeftAngleBracket;":10216,"LeftUpDownVector;":10577,"LessEqualGreater;":8922,"NonBreakingSpace;":160,"NotPrecedesEqual;":10927,"NotRightTriangle;":8939,"NotSucceedsEqual;":10928,"NotSucceedsTilde;":8831,"NotSupersetEqual;":8841,"RightTriangleBar;":10704,"RightUpTeeVector;":10588,"RightUpVectorBar;":10580,"UnderParenthesis;":9181,"UpArrowDownArrow;":8645,"circlearrowright;":8635,"downharpoonright;":8642,"ntrianglerighteq;":8941,"rightharpoondown;":8641,"rightrightarrows;":8649,"twoheadleftarrow;":8606,"vartriangleright;":8883,"CloseCurlyQuote;":8217,"ContourIntegral;":8750,"DoubleDownArrow;":8659,"DoubleLeftArrow;":8656,"DownRightVector;":8641,"LeftRightVector;":10574,"LeftTriangleBar;":10703,"LeftUpTeeVector;":10592,"LeftUpVectorBar;":10584,"LowerRightArrow;":8600,"NotGreaterEqual;":8817,"NotGreaterTilde;":8821,"NotHumpDownHump;":8782,"NotLeftTriangle;":8938,"NotSquareSubset;":8847,"OverParenthesis;":9180,"RightDownVector;":8642,"ShortRightArrow;":8594,"UpperRightArrow;":8599,"bigtriangledown;":9661,"circlearrowleft;":8634,"curvearrowright;":8631,"downharpoonleft;":8643,"leftharpoondown;":8637,"leftrightarrows;":8646,"nLeftrightarrow;":8654,"nleftrightarrow;":8622,"ntrianglelefteq;":8940,"rightleftarrows;":8644,"rightsquigarrow;":8605,"rightthreetimes;":8908,"straightepsilon;":1013,"trianglerighteq;":8885,"vartriangleleft;":8882,"DiacriticalDot;":729,"DoubleRightTee;":8872,"DownLeftVector;":8637,"GreaterGreater;":10914,"HorizontalLine;":9472,"InvisibleComma;":8291,"InvisibleTimes;":8290,"LeftDownVector;":8643,"LeftRightArrow;":8596,"Leftrightarrow;":8660,"LessSlantEqual;":10877,"LongRightArrow;":10230,"Longrightarrow;":10233,"LowerLeftArrow;":8601,"NestedLessLess;":8810,"NotGreaterLess;":8825,"NotLessGreater;":8824,"NotSubsetEqual;":8840,"NotVerticalBar;":8740,"OpenCurlyQuote;":8216,"ReverseElement;":8715,"RightTeeVector;":10587,"RightVectorBar;":10579,"ShortDownArrow;":8595,"ShortLeftArrow;":8592,"SquareSuperset;":8848,"TildeFullEqual;":8773,"UpperLeftArrow;":8598,"ZeroWidthSpace;":8203,"curvearrowleft;":8630,"doublebarwedge;":8966,"downdownarrows;":8650,"hookrightarrow;":8618,"leftleftarrows;":8647,"leftrightarrow;":8596,"leftthreetimes;":8907,"longrightarrow;":10230,"looparrowright;":8620,"nshortparallel;":8742,"ntriangleright;":8939,"rightarrowtail;":8611,"rightharpoonup;":8640,"trianglelefteq;":8884,"upharpoonright;":8638,"ApplyFunction;":8289,"DifferentialD;":8518,"DoubleLeftTee;":10980,"DoubleUpArrow;":8657,"LeftTeeVector;":10586,"LeftVectorBar;":10578,"LessFullEqual;":8806,"LongLeftArrow;":10229,"Longleftarrow;":10232,"NotEqualTilde;":8770,"NotTildeEqual;":8772,"NotTildeTilde;":8777,"Poincareplane;":8460,"PrecedesEqual;":10927,"PrecedesTilde;":8830,"RightArrowBar;":8677,"RightTeeArrow;":8614,"RightTriangle;":8883,"RightUpVector;":8638,"SucceedsEqual;":10928,"SucceedsTilde;":8831,"SupersetEqual;":8839,"UpEquilibrium;":10606,"VerticalTilde;":8768,"VeryThinSpace;":8202,"bigtriangleup;":9651,"blacktriangle;":9652,"divideontimes;":8903,"fallingdotseq;":8786,"hookleftarrow;":8617,"leftarrowtail;":8610,"leftharpoonup;":8636,"longleftarrow;":10229,"looparrowleft;":8619,"measuredangle;":8737,"ntriangleleft;":8938,"shortparallel;":8741,"smallsetminus;":8726,"triangleright;":9657,"upharpoonleft;":8639,"varsubsetneqq;":10955,"varsupsetneqq;":10956,"DownArrowBar;":10515,"DownTeeArrow;":8615,"ExponentialE;":8519,"GreaterEqual;":8805,"GreaterTilde;":8819,"HilbertSpace;":8459,"HumpDownHump;":8782,"Intersection;":8898,"LeftArrowBar;":8676,"LeftTeeArrow;":8612,"LeftTriangle;":8882,"LeftUpVector;":8639,"NotCongruent;":8802,"NotHumpEqual;":8783,"NotLessEqual;":8816,"NotLessTilde;":8820,"Proportional;":8733,"RightCeiling;":8969,"RoundImplies;":10608,"ShortUpArrow;":8593,"SquareSubset;":8847,"UnderBracket;":9141,"VerticalLine;":124,"blacklozenge;":10731,"exponentiale;":8519,"risingdotseq;":8787,"triangledown;":9663,"triangleleft;":9667,"varsubsetneq;":8842,"varsupsetneq;":8843,"CircleMinus;":8854,"CircleTimes;":8855,"Equilibrium;":8652,"GreaterLess;":8823,"LeftCeiling;":8968,"LessGreater;":8822,"MediumSpace;":8287,"NotLessLess;":8810,"NotPrecedes;":8832,"NotSucceeds;":8833,"NotSuperset;":8835,"OverBracket;":9140,"RightVector;":8640,"Rrightarrow;":8667,"RuleDelayed;":10740,"SmallCircle;":8728,"SquareUnion;":8852,"SubsetEqual;":8838,"UpDownArrow;":8597,"Updownarrow;":8661,"VerticalBar;":8739,"backepsilon;":1014,"blacksquare;":9642,"circledcirc;":8858,"circleddash;":8861,"curlyeqprec;":8926,"curlyeqsucc;":8927,"diamondsuit;":9830,"eqslantless;":10901,"expectation;":8496,"nRightarrow;":8655,"nrightarrow;":8603,"preccurlyeq;":8828,"precnapprox;":10937,"quaternions;":8461,"straightphi;":981,"succcurlyeq;":8829,"succnapprox;":10938,"thickapprox;":8776,"updownarrow;":8597,"Bernoullis;":8492,"CirclePlus;":8853,"EqualTilde;":8770,"Fouriertrf;":8497,"ImaginaryI;":8520,"Laplacetrf;":8466,"LeftVector;":8636,"Lleftarrow;":8666,"NotElement;":8713,"NotGreater;":8815,"Proportion;":8759,"RightArrow;":8594,"RightFloor;":8971,"Rightarrow;":8658,"ThickSpace;":8287,"TildeEqual;":8771,"TildeTilde;":8776,"UnderBrace;":9183,"UpArrowBar;":10514,"UpTeeArrow;":8613,"circledast;":8859,"complement;":8705,"curlywedge;":8911,"eqslantgtr;":10902,"gtreqqless;":10892,"lessapprox;":10885,"lesseqqgtr;":10891,"lmoustache;":9136,"longmapsto;":10236,"mapstodown;":8615,"mapstoleft;":8612,"nLeftarrow;":8653,"nleftarrow;":8602,"nsubseteqq;":10949,"nsupseteqq;":10950,"precapprox;":10935,"rightarrow;":8594,"rmoustache;":9137,"sqsubseteq;":8849,"sqsupseteq;":8850,"subsetneqq;":10955,"succapprox;":10936,"supsetneqq;":10956,"upuparrows;":8648,"varepsilon;":1013,"varnothing;":8709,"Backslash;":8726,"CenterDot;":183,"CircleDot;":8857,"Congruent;":8801,"Coproduct;":8720,"DoubleDot;":168,"DownArrow;":8595,"DownBreve;":785,"Downarrow;":8659,"HumpEqual;":8783,"LeftArrow;":8592,"LeftFloor;":8970,"Leftarrow;":8656,"LessTilde;":8818,"Mellintrf;":8499,"MinusPlus;":8723,"NotCupCap;":8813,"NotExists;":8708,"NotSubset;":8834,"OverBrace;":9182,"PlusMinus;":177,"Therefore;":8756,"ThinSpace;":8201,"TripleDot;":8411,"UnionPlus;":8846,"backprime;":8245,"backsimeq;":8909,"bigotimes;":10754,"centerdot;":183,"checkmark;":10003,"complexes;":8450,"dotsquare;":8865,"downarrow;":8595,"gtrapprox;":10886,"gtreqless;":8923,"gvertneqq;":8809,"heartsuit;":9829,"leftarrow;":8592,"lesseqgtr;":8922,"lvertneqq;":8808,"ngeqslant;":10878,"nleqslant;":10877,"nparallel;":8742,"nshortmid;":8740,"nsubseteq;":8840,"nsupseteq;":8841,"pitchfork;":8916,"rationals;":8474,"spadesuit;":9824,"subseteqq;":10949,"subsetneq;":8842,"supseteqq;":10950,"supsetneq;":8843,"therefore;":8756,"triangleq;":8796,"varpropto;":8733,"DDotrahd;":10513,"DotEqual;":8784,"Integral;":8747,"LessLess;":10913,"NotEqual;":8800,"NotTilde;":8769,"PartialD;":8706,"Precedes;":8826,"RightTee;":8866,"Succeeds;":8827,"SuchThat;":8715,"Superset;":8835,"Uarrocir;":10569,"UnderBar;":95,"andslope;":10840,"angmsdaa;":10664,"angmsdab;":10665,"angmsdac;":10666,"angmsdad;":10667,"angmsdae;":10668,"angmsdaf;":10669,"angmsdag;":10670,"angmsdah;":10671,"angrtvbd;":10653,"approxeq;":8778,"awconint;":8755,"backcong;":8780,"barwedge;":8965,"bbrktbrk;":9142,"bigoplus;":10753,"bigsqcup;":10758,"biguplus;":10756,"bigwedge;":8896,"boxminus;":8863,"boxtimes;":8864,"bsolhsub;":10184,"capbrcup;":10825,"circledR;":174,"circledS;":9416,"cirfnint;":10768,"clubsuit;":9827,"cupbrcap;":10824,"curlyvee;":8910,"cwconint;":8754,"doteqdot;":8785,"dotminus;":8760,"drbkarow;":10512,"dzigrarr;":10239,"elinters;":9191,"emptyset;":8709,"eqvparsl;":10725,"fpartint;":10765,"geqslant;":10878,"gesdotol;":10884,"gnapprox;":10890,"hksearow;":10533,"hkswarow;":10534,"imagline;":8464,"imagpart;":8465,"infintie;":10717,"integers;":8484,"intercal;":8890,"intlarhk;":10775,"laemptyv;":10676,"ldrushar;":10571,"leqslant;":10877,"lesdotor;":10883,"llcorner;":8990,"lnapprox;":10889,"lrcorner;":8991,"lurdshar;":10570,"mapstoup;":8613,"multimap;":8888,"naturals;":8469,"ncongdot;":10861,"notindot;":8949,"otimesas;":10806,"parallel;":8741,"plusacir;":10787,"pointint;":10773,"precneqq;":10933,"precnsim;":8936,"profalar;":9006,"profline;":8978,"profsurf;":8979,"raemptyv;":10675,"realpart;":8476,"rppolint;":10770,"rtriltri;":10702,"scpolint;":10771,"setminus;":8726,"shortmid;":8739,"smeparsl;":10724,"sqsubset;":8847,"sqsupset;":8848,"subseteq;":8838,"succneqq;":10934,"succnsim;":8937,"supseteq;":8839,"thetasym;":977,"thicksim;":8764,"timesbar;":10801,"triangle;":9653,"triminus;":10810,"trpezium;":9186,"ulcorner;":8988,"urcorner;":8989,"varkappa;":1008,"varsigma;":962,"vartheta;":977,"Because;":8757,"Cayleys;":8493,"Cconint;":8752,"Cedilla;":184,"Diamond;":8900,"DownTee;":8868,"Element;":8712,"Epsilon;":917,"Implies;":8658,"LeftTee;":8867,"NewLine;":10,"NoBreak;":8288,"NotLess;":8814,"Omicron;":927,"OverBar;":8254,"Product;":8719,"UpArrow;":8593,"Uparrow;":8657,"Upsilon;":933,"alefsym;":8501,"angrtvb;":8894,"angzarr;":9084,"asympeq;":8781,"backsim;":8765,"because;":8757,"bemptyv;":10672,"between;":8812,"bigcirc;":9711,"bigodot;":10752,"bigstar;":9733,"bnequiv;":8801,"boxplus;":8862,"ccupssm;":10832,"cemptyv;":10674,"cirscir;":10690,"coloneq;":8788,"congdot;":10861,"cudarrl;":10552,"cudarrr;":10549,"cularrp;":10557,"curarrm;":10556,"dbkarow;":10511,"ddagger;":8225,"ddotseq;":10871,"demptyv;":10673,"diamond;":8900,"digamma;":989,"dotplus;":8724,"dwangle;":10662,"epsilon;":949,"eqcolon;":8789,"equivDD;":10872,"gesdoto;":10882,"gtquest;":10876,"gtrless;":8823,"harrcir;":10568,"intprod;":10812,"isindot;":8949,"larrbfs;":10527,"larrsim;":10611,"lbrksld;":10639,"lbrkslu;":10637,"ldrdhar;":10599,"lesdoto;":10881,"lessdot;":8918,"lessgtr;":8822,"lesssim;":8818,"lotimes;":10804,"lozenge;":9674,"ltquest;":10875,"luruhar;":10598,"maltese;":10016,"minusdu;":10794,"napprox;":8777,"natural;":9838,"nearrow;":8599,"nexists;":8708,"notinva;":8713,"notinvb;":8951,"notinvc;":8950,"notniva;":8716,"notnivb;":8958,"notnivc;":8957,"npolint;":10772,"npreceq;":10927,"nsqsube;":8930,"nsqsupe;":8931,"nsubset;":8834,"nsucceq;":10928,"nsupset;":8835,"nvinfin;":10718,"nvltrie;":8884,"nvrtrie;":8885,"nwarrow;":8598,"olcross;":10683,"omicron;":959,"orderof;":8500,"orslope;":10839,"pertenk;":8241,"planckh;":8462,"pluscir;":10786,"plussim;":10790,"plustwo;":10791,"precsim;":8830,"quatint;":10774,"questeq;":8799,"rarrbfs;":10528,"rarrsim;":10612,"rbrksld;":10638,"rbrkslu;":10640,"rdldhar;":10601,"realine;":8475,"rotimes;":10805,"ruluhar;":10600,"searrow;":8600,"simplus;":10788,"simrarr;":10610,"subedot;":10947,"submult;":10945,"subplus;":10943,"subrarr;":10617,"succsim;":8831,"supdsub;":10968,"supedot;":10948,"suphsol;":10185,"suphsub;":10967,"suplarr;":10619,"supmult;":10946,"supplus;":10944,"swarrow;":8601,"topfork;":10970,"triplus;":10809,"tritime;":10811,"uparrow;":8593,"upsilon;":965,"uwangle;":10663,"vzigzag;":10650,"zigrarr;":8669,"Aacute;":193,"Abreve;":258,"Agrave;":192,"Assign;":8788,"Atilde;":195,"Barwed;":8966,"Bumpeq;":8782,"Cacute;":262,"Ccaron;":268,"Ccedil;":199,"Colone;":10868,"Conint;":8751,"CupCap;":8781,"Dagger;":8225,"Dcaron;":270,"DotDot;":8412,"Dstrok;":272,"Eacute;":201,"Ecaron;":282,"Egrave;":200,"Exists;":8707,"ForAll;":8704,"Gammad;":988,"Gbreve;":286,"Gcedil;":290,"HARDcy;":1066,"Hstrok;":294,"Iacute;":205,"Igrave;":204,"Itilde;":296,"Jsercy;":1032,"Kcedil;":310,"Lacute;":313,"Lambda;":923,"Lcaron;":317,"Lcedil;":315,"Lmidot;":319,"Lstrok;":321,"Nacute;":323,"Ncaron;":327,"Ncedil;":325,"Ntilde;":209,"Oacute;":211,"Odblac;":336,"Ograve;":210,"Oslash;":216,"Otilde;":213,"Otimes;":10807,"Racute;":340,"Rarrtl;":10518,"Rcaron;":344,"Rcedil;":342,"SHCHcy;":1065,"SOFTcy;":1068,"Sacute;":346,"Scaron;":352,"Scedil;":350,"Square;":9633,"Subset;":8912,"Supset;":8913,"Tcaron;":356,"Tcedil;":354,"Tstrok;":358,"Uacute;":218,"Ubreve;":364,"Udblac;":368,"Ugrave;":217,"Utilde;":360,"Vdashl;":10982,"Verbar;":8214,"Vvdash;":8874,"Yacute;":221,"Zacute;":377,"Zcaron;":381,"aacute;":225,"abreve;":259,"agrave;":224,"andand;":10837,"angmsd;":8737,"angsph;":8738,"apacir;":10863,"approx;":8776,"atilde;":227,"barvee;":8893,"barwed;":8965,"becaus;":8757,"bernou;":8492,"bigcap;":8898,"bigcup;":8899,"bigvee;":8897,"bkarow;":10509,"bottom;":8869,"bowtie;":8904,"boxbox;":10697,"bprime;":8245,"brvbar;":166,"bullet;":8226,"bumpeq;":8783,"cacute;":263,"capand;":10820,"capcap;":10827,"capcup;":10823,"capdot;":10816,"ccaron;":269,"ccedil;":231,"circeq;":8791,"cirmid;":10991,"colone;":8788,"commat;":64,"compfn;":8728,"conint;":8750,"coprod;":8720,"copysr;":8471,"cularr;":8630,"cupcap;":10822,"cupcup;":10826,"cupdot;":8845,"curarr;":8631,"curren;":164,"cylcty;":9005,"dagger;":8224,"daleth;":8504,"dcaron;":271,"dfisht;":10623,"divide;":247,"divonx;":8903,"dlcorn;":8990,"dlcrop;":8973,"dollar;":36,"drcorn;":8991,"drcrop;":8972,"dstrok;":273,"eacute;":233,"easter;":10862,"ecaron;":283,"ecolon;":8789,"egrave;":232,"egsdot;":10904,"elsdot;":10903,"emptyv;":8709,"emsp13;":8196,"emsp14;":8197,"eparsl;":10723,"eqcirc;":8790,"equals;":61,"equest;":8799,"female;":9792,"ffilig;":64259,"ffllig;":64260,"forall;":8704,"frac12;":189,"frac13;":8531,"frac14;":188,"frac15;":8533,"frac16;":8537,"frac18;":8539,"frac23;":8532,"frac25;":8534,"frac34;":190,"frac35;":8535,"frac38;":8540,"frac45;":8536,"frac56;":8538,"frac58;":8541,"frac78;":8542,"gacute;":501,"gammad;":989,"gbreve;":287,"gesdot;":10880,"gesles;":10900,"gtlPar;":10645,"gtrarr;":10616,"gtrdot;":8919,"gtrsim;":8819,"hairsp;":8202,"hamilt;":8459,"hardcy;":1098,"hearts;":9829,"hellip;":8230,"hercon;":8889,"homtht;":8763,"horbar;":8213,"hslash;":8463,"hstrok;":295,"hybull;":8259,"hyphen;":8208,"iacute;":237,"igrave;":236,"iiiint;":10764,"iinfin;":10716,"incare;":8453,"inodot;":305,"intcal;":8890,"iquest;":191,"isinsv;":8947,"itilde;":297,"jsercy;":1112,"kappav;":1008,"kcedil;":311,"kgreen;":312,"lAtail;":10523,"lacute;":314,"lagran;":8466,"lambda;":955,"langle;":10216,"larrfs;":10525,"larrhk;":8617,"larrlp;":8619,"larrpl;":10553,"larrtl;":8610,"latail;":10521,"lbrace;":123,"lbrack;":91,"lcaron;":318,"lcedil;":316,"ldquor;":8222,"lesdot;":10879,"lesges;":10899,"lfisht;":10620,"lfloor;":8970,"lharul;":10602,"llhard;":10603,"lmidot;":320,"lmoust;":9136,"loplus;":10797,"lowast;":8727,"lowbar;":95,"lparlt;":10643,"lrhard;":10605,"lsaquo;":8249,"lsquor;":8218,"lstrok;":322,"lthree;":8907,"ltimes;":8905,"ltlarr;":10614,"ltrPar;":10646,"mapsto;":8614,"marker;":9646,"mcomma;":10793,"midast;":42,"midcir;":10992,"middot;":183,"minusb;":8863,"minusd;":8760,"mnplus;":8723,"models;":8871,"mstpos;":8766,"nVDash;":8879,"nVdash;":8878,"nacute;":324,"nbumpe;":8783,"ncaron;":328,"ncedil;":326,"nearhk;":10532,"nequiv;":8802,"nesear;":10536,"nexist;":8708,"nltrie;":8940,"notinE;":8953,"nparsl;":11005,"nprcue;":8928,"nrarrc;":10547,"nrarrw;":8605,"nrtrie;":8941,"nsccue;":8929,"nsimeq;":8772,"ntilde;":241,"numero;":8470,"nvDash;":8877,"nvHarr;":10500,"nvdash;":8876,"nvlArr;":10498,"nvrArr;":10499,"nwarhk;":10531,"nwnear;":10535,"oacute;":243,"odblac;":337,"odsold;":10684,"ograve;":242,"ominus;":8854,"origof;":8886,"oslash;":248,"otilde;":245,"otimes;":8855,"parsim;":10995,"percnt;":37,"period;":46,"permil;":8240,"phmmat;":8499,"planck;":8463,"plankv;":8463,"plusdo;":8724,"plusdu;":10789,"plusmn;":177,"preceq;":10927,"primes;":8473,"prnsim;":8936,"propto;":8733,"prurel;":8880,"puncsp;":8200,"qprime;":8279,"rAtail;":10524,"racute;":341,"rangle;":10217,"rarrap;":10613,"rarrfs;":10526,"rarrhk;":8618,"rarrlp;":8620,"rarrpl;":10565,"rarrtl;":8611,"ratail;":10522,"rbrace;":125,"rbrack;":93,"rcaron;":345,"rcedil;":343,"rdquor;":8221,"rfisht;":10621,"rfloor;":8971,"rharul;":10604,"rmoust;":9137,"roplus;":10798,"rpargt;":10644,"rsaquo;":8250,"rsquor;":8217,"rthree;":8908,"rtimes;":8906,"sacute;":347,"scaron;":353,"scedil;":351,"scnsim;":8937,"searhk;":10533,"seswar;":10537,"sfrown;":8994,"shchcy;":1097,"sigmaf;":962,"sigmav;":962,"simdot;":10858,"smashp;":10803,"softcy;":1100,"solbar;":9023,"spades;":9824,"sqcaps;":8851,"sqcups;":8852,"sqsube;":8849,"sqsupe;":8850,"square;":9633,"squarf;":9642,"ssetmn;":8726,"ssmile;":8995,"sstarf;":8902,"subdot;":10941,"subset;":8834,"subsim;":10951,"subsub;":10965,"subsup;":10963,"succeq;":10928,"supdot;":10942,"supset;":8835,"supsim;":10952,"supsub;":10964,"supsup;":10966,"swarhk;":10534,"swnwar;":10538,"target;":8982,"tcaron;":357,"tcedil;":355,"telrec;":8981,"there4;":8756,"thetav;":977,"thinsp;":8201,"thksim;":8764,"timesb;":8864,"timesd;":10800,"topbot;":9014,"topcir;":10993,"tprime;":8244,"tridot;":9708,"tstrok;":359,"uacute;":250,"ubreve;":365,"udblac;":369,"ufisht;":10622,"ugrave;":249,"ulcorn;":8988,"ulcrop;":8975,"urcorn;":8989,"urcrop;":8974,"utilde;":361,"vangrt;":10652,"varphi;":981,"varrho;":1009,"veebar;":8891,"vellip;":8942,"verbar;":124,"vsubnE;":10955,"vsubne;":8842,"vsupnE;":10956,"vsupne;":8843,"wedbar;":10847,"wedgeq;":8793,"weierp;":8472,"wreath;":8768,"xoplus;":10753,"xotime;":10754,"xsqcup;":10758,"xuplus;":10756,"xwedge;":8896,"yacute;":253,"zacute;":378,"zcaron;":382,"zeetrf;":8488,"AElig;":198,Aacute:193,"Acirc;":194,Agrave:192,"Alpha;":913,"Amacr;":256,"Aogon;":260,"Aring;":197,Atilde:195,"Breve;":728,Ccedil:199,"Ccirc;":264,"Colon;":8759,"Cross;":10799,"Dashv;":10980,"Delta;":916,Eacute:201,"Ecirc;":202,Egrave:200,"Emacr;":274,"Eogon;":280,"Equal;":10869,"Gamma;":915,"Gcirc;":284,"Hacek;":711,"Hcirc;":292,"IJlig;":306,Iacute:205,"Icirc;":206,Igrave:204,"Imacr;":298,"Iogon;":302,"Iukcy;":1030,"Jcirc;":308,"Jukcy;":1028,"Kappa;":922,Ntilde:209,"OElig;":338,Oacute:211,"Ocirc;":212,Ograve:210,"Omacr;":332,"Omega;":937,Oslash:216,Otilde:213,"Prime;":8243,"RBarr;":10512,"Scirc;":348,"Sigma;":931,"THORN;":222,"TRADE;":8482,"TSHcy;":1035,"Theta;":920,"Tilde;":8764,Uacute:218,"Ubrcy;":1038,"Ucirc;":219,Ugrave:217,"Umacr;":362,"Union;":8899,"Uogon;":370,"UpTee;":8869,"Uring;":366,"VDash;":8875,"Vdash;":8873,"Wcirc;":372,"Wedge;":8896,Yacute:221,"Ycirc;":374,aacute:225,"acirc;":226,"acute;":180,"aelig;":230,agrave:224,"aleph;":8501,"alpha;":945,"amacr;":257,"amalg;":10815,"angle;":8736,"angrt;":8735,"angst;":197,"aogon;":261,"aring;":229,"asymp;":8776,atilde:227,"awint;":10769,"bcong;":8780,"bdquo;":8222,"bepsi;":1014,"blank;":9251,"blk12;":9618,"blk14;":9617,"blk34;":9619,"block;":9608,"boxDL;":9559,"boxDR;":9556,"boxDl;":9558,"boxDr;":9555,"boxHD;":9574,"boxHU;":9577,"boxHd;":9572,"boxHu;":9575,"boxUL;":9565,"boxUR;":9562,"boxUl;":9564,"boxUr;":9561,"boxVH;":9580,"boxVL;":9571,"boxVR;":9568,"boxVh;":9579,"boxVl;":9570,"boxVr;":9567,"boxdL;":9557,"boxdR;":9554,"boxdl;":9488,"boxdr;":9484,"boxhD;":9573,"boxhU;":9576,"boxhd;":9516,"boxhu;":9524,"boxuL;":9563,"boxuR;":9560,"boxul;":9496,"boxur;":9492,"boxvH;":9578,"boxvL;":9569,"boxvR;":9566,"boxvh;":9532,"boxvl;":9508,"boxvr;":9500,"breve;":728,brvbar:166,"bsemi;":8271,"bsime;":8909,"bsolb;":10693,"bumpE;":10926,"bumpe;":8783,"caret;":8257,"caron;":711,"ccaps;":10829,ccedil:231,"ccirc;":265,"ccups;":10828,"cedil;":184,"check;":10003,"clubs;":9827,"colon;":58,"comma;":44,"crarr;":8629,"cross;":10007,"csube;":10961,"csupe;":10962,"ctdot;":8943,"cuepr;":8926,"cuesc;":8927,"cupor;":10821,curren:164,"cuvee;":8910,"cuwed;":8911,"cwint;":8753,"dashv;":8867,"dblac;":733,"ddarr;":8650,"delta;":948,"dharl;":8643,"dharr;":8642,"diams;":9830,"disin;":8946,divide:247,"doteq;":8784,"dtdot;":8945,"dtrif;":9662,"duarr;":8693,"duhar;":10607,"eDDot;":10871,eacute:233,"ecirc;":234,"efDot;":8786,egrave:232,"emacr;":275,"empty;":8709,"eogon;":281,"eplus;":10865,"epsiv;":1013,"eqsim;":8770,"equiv;":8801,"erDot;":8787,"erarr;":10609,"esdot;":8784,"exist;":8707,"fflig;":64256,"filig;":64257,"fjlig;":102,"fllig;":64258,"fltns;":9649,"forkv;":10969,frac12:189,frac14:188,frac34:190,"frasl;":8260,"frown;":8994,"gamma;":947,"gcirc;":285,"gescc;":10921,"gimel;":8503,"gneqq;":8809,"gnsim;":8935,"grave;":96,"gsime;":10894,"gsiml;":10896,"gtcir;":10874,"gtdot;":8919,"harrw;":8621,"hcirc;":293,"hoarr;":8703,iacute:237,"icirc;":238,"iexcl;":161,igrave:236,"iiint;":8749,"iiota;":8489,"ijlig;":307,"imacr;":299,"image;":8465,"imath;":305,"imped;":437,"infin;":8734,"iogon;":303,"iprod;":10812,iquest:191,"isinE;":8953,"isins;":8948,"isinv;":8712,"iukcy;":1110,"jcirc;":309,"jmath;":567,"jukcy;":1108,"kappa;":954,"lAarr;":8666,"lBarr;":10510,"langd;":10641,"laquo;":171,"larrb;":8676,"lates;":10925,"lbarr;":10508,"lbbrk;":10098,"lbrke;":10635,"lceil;":8968,"ldquo;":8220,"lescc;":10920,"lhard;":8637,"lharu;":8636,"lhblk;":9604,"llarr;":8647,"lltri;":9722,"lneqq;":8808,"lnsim;":8934,"loang;":10220,"loarr;":8701,"lobrk;":10214,"lopar;":10629,"lrarr;":8646,"lrhar;":8651,"lrtri;":8895,"lsime;":10893,"lsimg;":10895,"lsquo;":8216,"ltcir;":10873,"ltdot;":8918,"ltrie;":8884,"ltrif;":9666,"mDDot;":8762,"mdash;":8212,"micro;":181,middot:183,"minus;":8722,"mumap;":8888,"nabla;":8711,"napid;":8779,"napos;":329,"natur;":9838,"nbump;":8782,"ncong;":8775,"ndash;":8211,"neArr;":8663,"nearr;":8599,"nedot;":8784,"nesim;":8770,"ngeqq;":8807,"ngsim;":8821,"nhArr;":8654,"nharr;":8622,"nhpar;":10994,"nlArr;":8653,"nlarr;":8602,"nleqq;":8806,"nless;":8814,"nlsim;":8820,"nltri;":8938,"notin;":8713,"notni;":8716,"npart;":8706,"nprec;":8832,"nrArr;":8655,"nrarr;":8603,"nrtri;":8939,"nsime;":8772,"nsmid;":8740,"nspar;":8742,"nsubE;":10949,"nsube;":8840,"nsucc;":8833,"nsupE;":10950,"nsupe;":8841,ntilde:241,"numsp;":8199,"nvsim;":8764,"nwArr;":8662,"nwarr;":8598,oacute:243,"ocirc;":244,"odash;":8861,"oelig;":339,"ofcir;":10687,ograve:242,"ohbar;":10677,"olarr;":8634,"olcir;":10686,"oline;":8254,"omacr;":333,"omega;":969,"operp;":10681,"oplus;":8853,"orarr;":8635,"order;":8500,oslash:248,otilde:245,"ovbar;":9021,"parsl;":11005,"phone;":9742,"plusb;":8862,"pluse;":10866,plusmn:177,"pound;":163,"prcue;":8828,"prime;":8242,"prnap;":10937,"prsim;":8830,"quest;":63,"rAarr;":8667,"rBarr;":10511,"radic;":8730,"rangd;":10642,"range;":10661,"raquo;":187,"rarrb;":8677,"rarrc;":10547,"rarrw;":8605,"ratio;":8758,"rbarr;":10509,"rbbrk;":10099,"rbrke;":10636,"rceil;":8969,"rdquo;":8221,"reals;":8477,"rhard;":8641,"rharu;":8640,"rlarr;":8644,"rlhar;":8652,"rnmid;":10990,"roang;":10221,"roarr;":8702,"robrk;":10215,"ropar;":10630,"rrarr;":8649,"rsquo;":8217,"rtrie;":8885,"rtrif;":9656,"sbquo;":8218,"sccue;":8829,"scirc;":349,"scnap;":10938,"scsim;":8831,"sdotb;":8865,"sdote;":10854,"seArr;":8664,"searr;":8600,"setmn;":8726,"sharp;":9839,"sigma;":963,"simeq;":8771,"simgE;":10912,"simlE;":10911,"simne;":8774,"slarr;":8592,"smile;":8995,"smtes;":10924,"sqcap;":8851,"sqcup;":8852,"sqsub;":8847,"sqsup;":8848,"srarr;":8594,"starf;":9733,"strns;":175,"subnE;":10955,"subne;":8842,"supnE;":10956,"supne;":8843,"swArr;":8665,"swarr;":8601,"szlig;":223,"theta;":952,"thkap;":8776,"thorn;":254,"tilde;":732,"times;":215,"trade;":8482,"trisb;":10701,"tshcy;":1115,"twixt;":8812,uacute:250,"ubrcy;":1118,"ucirc;":251,"udarr;":8645,"udhar;":10606,ugrave:249,"uharl;":8639,"uharr;":8638,"uhblk;":9600,"ultri;":9720,"umacr;":363,"uogon;":371,"uplus;":8846,"upsih;":978,"uring;":367,"urtri;":9721,"utdot;":8944,"utrif;":9652,"uuarr;":8648,"vBarv;":10985,"vDash;":8872,"varpi;":982,"vdash;":8866,"veeeq;":8794,"vltri;":8882,"vnsub;":8834,"vnsup;":8835,"vprop;":8733,"vrtri;":8883,"wcirc;":373,"wedge;":8743,"xcirc;":9711,"xdtri;":9661,"xhArr;":10234,"xharr;":10231,"xlArr;":10232,"xlarr;":10229,"xodot;":10752,"xrArr;":10233,"xrarr;":10230,"xutri;":9651,yacute:253,"ycirc;":375,AElig:198,Acirc:194,"Aopf;":120120,Aring:197,"Ascr;":119964,"Auml;":196,"Barv;":10983,"Beta;":914,"Bopf;":120121,"Bscr;":8492,"CHcy;":1063,"COPY;":169,"Cdot;":266,"Copf;":8450,"Cscr;":119966,"DJcy;":1026,"DScy;":1029,"DZcy;":1039,"Darr;":8609,"Dopf;":120123,"Dscr;":119967,Ecirc:202,"Edot;":278,"Eopf;":120124,"Escr;":8496,"Esim;":10867,"Euml;":203,"Fopf;":120125,"Fscr;":8497,"GJcy;":1027,"Gdot;":288,"Gopf;":120126,"Gscr;":119970,"Hopf;":8461,"Hscr;":8459,"IEcy;":1045,"IOcy;":1025,Icirc:206,"Idot;":304,"Iopf;":120128,"Iota;":921,"Iscr;":8464,"Iuml;":207,"Jopf;":120129,"Jscr;":119973,"KHcy;":1061,"KJcy;":1036,"Kopf;":120130,"Kscr;":119974,"LJcy;":1033,"Lang;":10218,"Larr;":8606,"Lopf;":120131,"Lscr;":8466,"Mopf;":120132,"Mscr;":8499,"NJcy;":1034,"Nopf;":8469,"Nscr;":119977,Ocirc:212,"Oopf;":120134,"Oscr;":119978,"Ouml;":214,"Popf;":8473,"Pscr;":119979,"QUOT;":34,"Qopf;":8474,"Qscr;":119980,"Rang;":10219,"Rarr;":8608,"Ropf;":8477,"Rscr;":8475,"SHcy;":1064,"Sopf;":120138,"Sqrt;":8730,"Sscr;":119982,"Star;":8902,THORN:222,"TScy;":1062,"Topf;":120139,"Tscr;":119983,"Uarr;":8607,Ucirc:219,"Uopf;":120140,"Upsi;":978,"Uscr;":119984,"Uuml;":220,"Vbar;":10987,"Vert;":8214,"Vopf;":120141,"Vscr;":119985,"Wopf;":120142,"Wscr;":119986,"Xopf;":120143,"Xscr;":119987,"YAcy;":1071,"YIcy;":1031,"YUcy;":1070,"Yopf;":120144,"Yscr;":119988,"Yuml;":376,"ZHcy;":1046,"Zdot;":379,"Zeta;":918,"Zopf;":8484,"Zscr;":119989,acirc:226,acute:180,aelig:230,"andd;":10844,"andv;":10842,"ange;":10660,"aopf;":120146,"apid;":8779,"apos;":39,aring:229,"ascr;":119990,"auml;":228,"bNot;":10989,"bbrk;":9141,"beta;":946,"beth;":8502,"bnot;":8976,"bopf;":120147,"boxH;":9552,"boxV;":9553,"boxh;":9472,"boxv;":9474,"bscr;":119991,"bsim;":8765,"bsol;":92,"bull;":8226,"bump;":8782,"caps;":8745,"cdot;":267,cedil:184,"cent;":162,"chcy;":1095,"cirE;":10691,"circ;":710,"cire;":8791,"comp;":8705,"cong;":8773,"copf;":120148,"copy;":169,"cscr;":119992,"csub;":10959,"csup;":10960,"cups;":8746,"dArr;":8659,"dHar;":10597,"darr;":8595,"dash;":8208,"diam;":8900,"djcy;":1106,"dopf;":120149,"dscr;":119993,"dscy;":1109,"dsol;":10742,"dtri;":9663,"dzcy;":1119,"eDot;":8785,"ecir;":8790,ecirc:234,"edot;":279,"emsp;":8195,"ensp;":8194,"eopf;":120150,"epar;":8917,"epsi;":949,"escr;":8495,"esim;":8770,"euml;":235,"euro;":8364,"excl;":33,"flat;":9837,"fnof;":402,"fopf;":120151,"fork;":8916,"fscr;":119995,"gdot;":289,"geqq;":8807,"gesl;":8923,"gjcy;":1107,"gnap;":10890,"gneq;":10888,"gopf;":120152,"gscr;":8458,"gsim;":8819,"gtcc;":10919,"gvnE;":8809,"hArr;":8660,"half;":189,"harr;":8596,"hbar;":8463,"hopf;":120153,"hscr;":119997,icirc:238,"iecy;":1077,iexcl:161,"imof;":8887,"iocy;":1105,"iopf;":120154,"iota;":953,"iscr;":119998,"isin;":8712,"iuml;":239,"jopf;":120155,"jscr;":119999,"khcy;":1093,"kjcy;":1116,"kopf;":120156,"kscr;":120000,"lArr;":8656,"lHar;":10594,"lang;":10216,laquo:171,"larr;":8592,"late;":10925,"lcub;":123,"ldca;":10550,"ldsh;":8626,"leqq;":8806,"lesg;":8922,"ljcy;":1113,"lnap;":10889,"lneq;":10887,"lopf;":120157,"lozf;":10731,"lpar;":40,"lscr;":120001,"lsim;":8818,"lsqb;":91,"ltcc;":10918,"ltri;":9667,"lvnE;":8808,"macr;":175,"male;":9794,"malt;":10016,micro:181,"mlcp;":10971,"mldr;":8230,"mopf;":120158,"mscr;":120002,"nGtv;":8811,"nLtv;":8810,"nang;":8736,"napE;":10864,"nbsp;":160,"ncap;":10819,"ncup;":10818,"ngeq;":8817,"nges;":10878,"ngtr;":8815,"nisd;":8954,"njcy;":1114,"nldr;":8229,"nleq;":8816,"nles;":10877,"nmid;":8740,"nopf;":120159,"npar;":8742,"npre;":10927,"nsce;":10928,"nscr;":120003,"nsim;":8769,"nsub;":8836,"nsup;":8837,"ntgl;":8825,"ntlg;":8824,"nvap;":8781,"nvge;":8805,"nvgt;":62,"nvle;":8804,"nvlt;":60,"oast;":8859,"ocir;":8858,ocirc:244,"odiv;":10808,"odot;":8857,"ogon;":731,"oint;":8750,"omid;":10678,"oopf;":120160,"opar;":10679,"ordf;":170,"ordm;":186,"oror;":10838,"oscr;":8500,"osol;":8856,"ouml;":246,"para;":182,"part;":8706,"perp;":8869,"phiv;":981,"plus;":43,"popf;":120161,pound:163,"prap;":10935,"prec;":8826,"prnE;":10933,"prod;":8719,"prop;":8733,"pscr;":120005,"qint;":10764,"qopf;":120162,"qscr;":120006,"quot;":34,"rArr;":8658,"rHar;":10596,"race;":8765,"rang;":10217,raquo:187,"rarr;":8594,"rcub;":125,"rdca;":10551,"rdsh;":8627,"real;":8476,"rect;":9645,"rhov;":1009,"ring;":730,"ropf;":120163,"rpar;":41,"rscr;":120007,"rsqb;":93,"rtri;":9657,"scap;":10936,"scnE;":10934,"sdot;":8901,"sect;":167,"semi;":59,"sext;":10038,"shcy;":1096,"sime;":8771,"simg;":10910,"siml;":10909,"smid;":8739,"smte;":10924,"solb;":10692,"sopf;":120164,"spar;":8741,"squf;":9642,"sscr;":120008,"star;":9734,"subE;":10949,"sube;":8838,"succ;":8827,"sung;":9834,"sup1;":185,"sup2;":178,"sup3;":179,"supE;":10950,"supe;":8839,szlig:223,"tbrk;":9140,"tdot;":8411,thorn:254,times:215,"tint;":8749,"toea;":10536,"topf;":120165,"tosa;":10537,"trie;":8796,"tscr;":120009,"tscy;":1094,"uArr;":8657,"uHar;":10595,"uarr;":8593,ucirc:251,"uopf;":120166,"upsi;":965,"uscr;":120010,"utri;":9653,"uuml;":252,"vArr;":8661,"vBar;":10984,"varr;":8597,"vert;":124,"vopf;":120167,"vscr;":120011,"wopf;":120168,"wscr;":120012,"xcap;":8898,"xcup;":8899,"xmap;":10236,"xnis;":8955,"xopf;":120169,"xscr;":120013,"xvee;":8897,"yacy;":1103,"yicy;":1111,"yopf;":120170,"yscr;":120014,"yucy;":1102,"yuml;":255,"zdot;":380,"zeta;":950,"zhcy;":1078,"zopf;":120171,"zscr;":120015,"zwnj;":8204,"AMP;":38,"Acy;":1040,"Afr;":120068,"And;":10835,Auml:196,"Bcy;":1041,"Bfr;":120069,COPY:169,"Cap;":8914,"Cfr;":8493,"Chi;":935,"Cup;":8915,"Dcy;":1044,"Del;":8711,"Dfr;":120071,"Dot;":168,"ENG;":330,"ETH;":208,"Ecy;":1069,"Efr;":120072,"Eta;":919,Euml:203,"Fcy;":1060,"Ffr;":120073,"Gcy;":1043,"Gfr;":120074,"Hat;":94,"Hfr;":8460,"Icy;":1048,"Ifr;":8465,"Int;":8748,Iuml:207,"Jcy;":1049,"Jfr;":120077,"Kcy;":1050,"Kfr;":120078,"Lcy;":1051,"Lfr;":120079,"Lsh;":8624,"Map;":10501,"Mcy;":1052,"Mfr;":120080,"Ncy;":1053,"Nfr;":120081,"Not;":10988,"Ocy;":1054,"Ofr;":120082,Ouml:214,"Pcy;":1055,"Pfr;":120083,"Phi;":934,"Psi;":936,QUOT:34,"Qfr;":120084,"REG;":174,"Rcy;":1056,"Rfr;":8476,"Rho;":929,"Rsh;":8625,"Scy;":1057,"Sfr;":120086,"Sub;":8912,"Sum;":8721,"Sup;":8913,"Tab;":9,"Tau;":932,"Tcy;":1058,"Tfr;":120087,"Ucy;":1059,"Ufr;":120088,Uuml:220,"Vcy;":1042,"Vee;":8897,"Vfr;":120089,"Wfr;":120090,"Xfr;":120091,"Ycy;":1067,"Yfr;":120092,"Zcy;":1047,"Zfr;":8488,"acE;":8766,"acd;":8767,"acy;":1072,"afr;":120094,"amp;":38,"and;":8743,"ang;":8736,"apE;":10864,"ape;":8778,"ast;":42,auml:228,"bcy;":1073,"bfr;":120095,"bne;":61,"bot;":8869,"cap;":8745,cent:162,"cfr;":120096,"chi;":967,"cir;":9675,copy:169,"cup;":8746,"dcy;":1076,"deg;":176,"dfr;":120097,"die;":168,"div;":247,"dot;":729,"ecy;":1101,"efr;":120098,"egs;":10902,"ell;":8467,"els;":10901,"eng;":331,"eta;":951,"eth;":240,euml:235,"fcy;":1092,"ffr;":120099,"gEl;":10892,"gap;":10886,"gcy;":1075,"gel;":8923,"geq;":8805,"ges;":10878,"gfr;":120100,"ggg;":8921,"glE;":10898,"gla;":10917,"glj;":10916,"gnE;":8809,"gne;":10888,"hfr;":120101,"icy;":1080,"iff;":8660,"ifr;":120102,"int;":8747,iuml:239,"jcy;":1081,"jfr;":120103,"kcy;":1082,"kfr;":120104,"lEg;":10891,"lap;":10885,"lat;":10923,"lcy;":1083,"leg;":8922,"leq;":8804,"les;":10877,"lfr;":120105,"lgE;":10897,"lnE;":8808,"lne;":10887,"loz;":9674,"lrm;":8206,"lsh;":8624,macr:175,"map;":8614,"mcy;":1084,"mfr;":120106,"mho;":8487,"mid;":8739,"nGg;":8921,"nGt;":8811,"nLl;":8920,"nLt;":8810,"nap;":8777,nbsp:160,"ncy;":1085,"nfr;":120107,"ngE;":8807,"nge;":8817,"ngt;":8815,"nis;":8956,"niv;":8715,"nlE;":8806,"nle;":8816,"nlt;":8814,"not;":172,"npr;":8832,"nsc;":8833,"num;":35,"ocy;":1086,"ofr;":120108,"ogt;":10689,"ohm;":937,"olt;":10688,"ord;":10845,ordf:170,ordm:186,"orv;":10843,ouml:246,"par;":8741,para:182,"pcy;":1087,"pfr;":120109,"phi;":966,"piv;":982,"prE;":10931,"pre;":10927,"psi;":968,"qfr;":120110,quot:34,"rcy;":1088,"reg;":174,"rfr;":120111,"rho;":961,"rlm;":8207,"rsh;":8625,"scE;":10932,"sce;":10928,"scy;":1089,sect:167,"sfr;":120112,"shy;":173,"sim;":8764,"smt;":10922,"sol;":47,"squ;":9633,"sub;":8834,"sum;":8721,sup1:185,sup2:178,sup3:179,"sup;":8835,"tau;":964,"tcy;":1090,"tfr;":120113,"top;":8868,"ucy;":1091,"ufr;":120114,"uml;":168,uuml:252,"vcy;":1074,"vee;":8744,"vfr;":120115,"wfr;":120116,"xfr;":120117,"ycy;":1099,"yen;":165,"yfr;":120118,yuml:255,"zcy;":1079,"zfr;":120119,"zwj;":8205,AMP:38,"DD;":8517,ETH:208,"GT;":62,"Gg;":8921,"Gt;":8811,"Im;":8465,"LT;":60,"Ll;":8920,"Lt;":8810,"Mu;":924,"Nu;":925,"Or;":10836,"Pi;":928,"Pr;":10939,REG:174,"Re;":8476,"Sc;":10940,"Xi;":926,"ac;":8766,"af;":8289,amp:38,"ap;":8776,"dd;":8518,deg:176,"ee;":8519,"eg;":10906,"el;":10905,eth:240,"gE;":8807,"ge;":8805,"gg;":8811,"gl;":8823,"gt;":62,"ic;":8291,"ii;":8520,"in;":8712,"it;":8290,"lE;":8806,"le;":8804,"lg;":8822,"ll;":8810,"lt;":60,"mp;":8723,"mu;":956,"ne;":8800,"ni;":8715,not:172,"nu;":957,"oS;":9416,"or;":8744,"pi;":960,"pm;":177,"pr;":8826,reg:174,"rx;":8478,"sc;":8827,shy:173,uml:168,"wp;":8472,"wr;":8768,"xi;":958,yen:165,GT:62,LT:60,gt:62,lt:60},Oi=vf;var Tf=[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376];function kf(i,Ae){if(Ae&&!i.endsWith(";"))return`${i}\\b(?!=)`;return i}function Sc(i){let Ne=Object.keys(Oi).map((_e)=>kf(_e,i));return new RegExp(`&(#(?:x[a-fA-F\\d]+|\\d+)(?:;)?|${Ne.join("|")})`,"g")}var Mi,$i;function Af(i){if(i){if(!$i)$i=Sc(!0);return $i}if(!Mi)Mi=Sc(!1);return Mi}var vc=0;function wf(i){if(i===10)return 32;if(i<128)return i;if(i<=159)return Tf[i-128];if(i<55296)return i;if(i<=57343)return vc;if(i<=65535)return i;if(i>=65536&&i<=131071)return i;if(i>=131072&&i<=196607)return i;if(i>=917504&&i<=917631||i>=917760&&i<=917999)return i;return vc}function Bi(i,Ae){if(i.indexOf("&")===-1)return i;return i.replace(Af(Ae),(Ne,_e)=>{let De;if(_e[0]!=="#")De=Oi[_e];else if(_e[1]==="x")De=Number.parseInt(_e.substring(2),16);else De=Number.parseInt(_e.substring(1),10);if(!De)return Ne;return String.fromCodePoint(wf(De))})}class T extends Error{constructor(i){super(`sveld's template parser doesn't support ${i} yet.`);this.name="TemplateParseNotImplementedError"}}var Pf=/<\/script\s*>/g,Nf=/<\/script\s*>/y,_f=/[^\n]/g,Df=new Set(["server","client","worker","test","default"]);function Tc(i,Ae,Ne){let _e=i.index,De=i.readUntil(Pf);if(i.index>=i.source.length)throw Error("sveld: unclosed <script> tag");let Re=i.source.slice(0,_e).replace(_f," ")+De;i.read(Nf);let Ie=sr(Re,i.isTypeScript,i.root.comments);Ie.start=_e;let Oe="default";for(let Me of Ne){if(Df.has(Me.name))throw Error(`sveld: "${Me.name}" is a reserved <script> attribute name.`);if(Me.name==="module"){if(Me.value!==!0)throw Error("sveld: <script module> does not take a value.");Oe="module"}if(Me.name==="context"){let Fe=Me.value;if(Fe===!0||!Array.isArray(Fe)||Fe.length!==1||Fe[0].type!=="Text")throw Error("sveld: context attribute must be a plain string.");if(Fe[0].data!=="module")throw Error('sveld: only context="module" is valid.');Oe="module"}}return{type:"Script",start:Ae,end:i.index,context:Oe,content:Ie,attributes:Ne}}function kc(i,Ae,Ne){let _e=i.index,De=i.source.indexOf("</style",i.index),Re=De===-1?i.source.length:De;return i.index=Re,i.eat("</style",!0),i.read(/\s*>/y),{type:"StyleSheet",start:Ae,end:i.index,attributes:Ne,children:[],comments:[],content:{start:_e,end:Re,styles:i.source.slice(_e,Re),comment:null}}}var If=new Set(["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]);function Fi(i){return If.has(i)||i.charCodeAt(0)===33&&i.toLowerCase()==="!doctype"}var Rf="^[a-zA-Z][a-zA-Z0-9]*(-[a-zA-Z0-9.\\-_\\u00B7\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u203F-\\u2040\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\u{10000}-\\u{EFFFF}]*)?$",Lf=new RegExp(Rf,"u");function Ac(i){return Lf.test(i)}var Of=/(?:"([^"]*)"|'([^'])*'|([^>\s]+))/y,Dc=/["']/y,Mf=/(\/>|[\s"'=<>`])/y,ji=/<\/textarea(\s[^>]*)?>/iy,$f=/^![a-zA-Z]+$/,Bf=/^[a-zA-Z][a-zA-Z0-9]*:[a-zA-Z][a-zA-Z0-9-]*[a-zA-Z0-9]$/,Ff=/^(?:\p{Lu}[$\u200c\u200d\p{ID_Continue}.]*|\p{ID_Start}[$\u200c\u200d\p{ID_Continue}]*(?:\.[$\u200c\u200d\p{ID_Continue}]+)+)$/u,Ic={"svelte:head":"SvelteHead","svelte:options":"SvelteOptions","svelte:window":"SvelteWindow","svelte:document":"SvelteDocument","svelte:body":"SvelteBody"},wc={...Ic,"svelte:element":"SvelteElement","svelte:component":"SvelteComponent","svelte:self":"SvelteSelf","svelte:fragment":"SvelteFragment","svelte:boundary":"SvelteBoundary"};function jf(i){let Ae=i.charCodeAt(0);if(Ae<97||Ae>122)return!1;for(let Ne=1;Ne<i.length;Ne++){let _e=i.charCodeAt(Ne);if((_e<97||_e>122)&&(_e<48||_e>57))return!1}return!0}function Vf(i){if(jf(i))return!0;if($f.test(i))return!0;if(Bf.test(i))return!0;return Ac(i)}function Wf(i){let Ae=i.charCodeAt(0);if(Ae>=97&&Ae<=122&&!i.includes("."))return!1;return!0}function qf(i){return`Svelte${i.slice(7).split("-").map((Ne)=>Ne.charAt(0).toUpperCase()+Ne.slice(1)).join("")}`}function Gf(i){for(let Ae=i.length-1;Ae>=0;Ae--){let Ne=i[Ae].type;if(Ne==="SvelteHead")return!0;if(Ne==="RegularElement"||Ne==="Component")return!1}return!1}function Uf(i){for(let Ae=i.length-1;Ae>=0;Ae--){let Ne=i[Ae];if(Ne.type==="RegularElement"&&Ne.attributes?.some((_e)=>_e.type==="Attribute"&&_e.name==="shadowrootmode"))return!0}return!1}function Pc(i){let{source:Ae,index:Ne}=i;if(Ne>=Ae.length)throw new Mn("Unexpected end of input",Ae.length);let _e=Ne;while(_e<Ae.length){let De=Ae.charCodeAt(_e);if(De===47||De===62||Hn(De))break;_e++}return i.index=_e,{name:Ae.slice(Ne,_e),start:Ne,end:_e}}function Rc(i){let{source:Ae,index:Ne}=i;if(Ne>=Ae.length)throw new Mn("Unexpected end of input",Ae.length);let _e=Ne;while(_e<Ae.length){let De=Ae.charCodeAt(_e);if(De===61||De===47||De===62||De===34||De===39||Hn(De))break;_e++}return i.index=_e,{name:Ae.slice(Ne,_e),start:Ne,end:_e}}function Hf(i){let Ae=i.index;if(i.eat("//")){let Ne=i.readUntilString(`
|
|
16
|
-
`),_e=i.index;i.root.comments.push({type:"Line",value:Ne,start:Ae,end:_e});return}if(i.eat("/*")){let Ne=i.readUntilString("*/");i.eat("*/");let _e=i.index;i.root.comments.push({type:"Block",value:Ne,start:Ae,end:_e})}}function Kf(i){if(i==="use")return"UseDirective";if(i==="animate")return"AnimateDirective";if(i==="bind")return"BindDirective";if(i==="class")return"ClassDirective";if(i==="style")return"StyleDirective";if(i==="on")return"OnDirective";if(i==="let")return"LetDirective";if(i==="in"||i==="out"||i==="transition")return"TransitionDirective";return!1}function Lc(i,Ae,Ne){let _e={start:i.index,end:-1,type:"Text",raw:"",data:""},De=[],Re=(Ie)=>{if(Ie>_e.start)_e.raw=i.source.slice(_e.start,Ie),_e.data=Bi(_e.raw,!0),_e.end=Ie,De.push(_e)};while(i.index<i.source.length){if(Ae())return Re(i.index),De;if(i.eat("{")){if(i.match("#")||i.match("@"))throw new T("blocks/tags inside attribute value sequences");let Ie=i.index-1;Re(Ie),i.allowWhitespace();let Oe=Ft(i);i.allowWhitespace(),i.eat("}",!0),De.push({type:"ExpressionTag",start:Ie,end:i.index,expression:Oe}),_e={start:i.index,end:-1,type:"Text",raw:"",data:""}}else{let Ie=i.index+1;if(Ne!==void 0){let Oe=i.source;while(Ie<Oe.length){let Me=Oe.charCodeAt(Ie);if(Me===123||Me===Ne)break;Ie++}}i.index=Ie}}throw new T("unterminated attribute value / sequence (loose mode)")}function zf(i){let Ae=i.eat("'")?"'":i.eat('"')?'"':null;if(Ae&&i.eat(Ae))return[{start:i.index-1,end:i.index-1,type:"Text",raw:"",data:""}];let Ne=Lc(i,()=>{if(Ae)return i.match(Ae);return!!i.matchRegex(Mf)},Ae===null?void 0:Ae.charCodeAt(0));if(Ne.length===0&&!Ae)throw Error("sveld: expected attribute value");if(Ae)i.index+=1;if(Ae||Ne.length>1||Ne[0].type==="Text")return Ne;return Ne[0]}function Vi(i,Ae,Ne,_e){return{type:"Attribute",start:Ae,end:Ne,name:i,value:_e}}function Xf(i){let Ae=i.index,Ne=Rc(i);if(!Ne.name)return null;let _e=!0;if(i.eat("=")){i.allowWhitespace();let De=i.matchRegex(Of);if(!De)throw Error("sveld: expected attribute value");i.index+=De.length;let Re=De[0]==='"'||De[0]==="'";if(Re)De=De.slice(1,-1);_e=[{start:i.index-De.length-(Re?1:0),end:Re?i.index-1:i.index,type:"Text",raw:De,data:Bi(De,!0)}]}if(i.matchRegex(Dc))throw Error("sveld: expected '='");return Vi(Ne.name,Ae,i.index,_e)}function Jf(i){while(!0){let Oe=i.index;if(Hf(i),i.index===Oe)break;i.allowWhitespace()}let Ae=i.index;if(i.eat("{")){if(i.allowWhitespace(),i.eat("@attach")){i.requireWhitespace();let Fe=Ft(i);return i.allowWhitespace(),i.eat("}",!0),{type:"AttachTag",start:Ae,end:i.index,expression:Fe}}if(i.eat("...")){let Fe=Ft(i);return i.allowWhitespace(),i.eat("}",!0),{type:"SpreadAttribute",start:Ae,end:i.index,expression:Fe}}let Oe=i.readIdentifierName();if(Oe.name==="")throw Error("sveld: empty attribute shorthand");i.allowWhitespace(),i.eat("}",!0);let Me={type:"ExpressionTag",start:Oe.start,end:Oe.end,expression:Oe};return Vi(Oe.name,Ae,i.index,Me)}let Ne=Rc(i);if(!Ne.name)return null;let _e=i.index;i.allowWhitespace();let De=Ne.name.indexOf(":"),Re=De!==-1&&Kf(Ne.name.slice(0,De)),Ie=!0;if(i.eat("="))if(i.allowWhitespace(),i.source[i.index]==="/"&&i.source[i.index+1]===">"){let Oe=i.index;i.index++,Ie=[{start:Oe,end:Oe+1,type:"Text",raw:"/",data:"/"}],_e=i.index}else Ie=zf(i),_e=i.index;else if(i.matchRegex(Dc))throw Error("sveld: expected '='");if(Re){let Oe=Ne.name.slice(De+1).split("|",1)[0];if(Oe==="")throw Error("sveld: directive missing a name");if(Re==="StyleDirective")return{start:Ae,end:_e,type:Re,name:Oe,value:Ie};let Me=Ie===!0?void 0:Array.isArray(Ie)?Ie[0]:Ie,Fe=null;if(Me){if((Array.isArray(Ie)?Ie.length>1:!1)||Me.type==="Text")throw Error("sveld: directive value must be a single expression");Fe=Me.expression}let Be={start:Ae,end:_e,type:Re,name:Oe,expression:Fe};if((Be.type==="BindDirective"||Be.type==="ClassDirective")&&!Be.expression)Be.expression={start:Ae+De+1,end:_e,type:"Identifier",name:Be.name};return Be}return Vi(Ne.name,Ae,_e,Ie)}function Oc(i){let Ae=i.index++,Ne=i.current();if(i.eat("!--")){let Ge=i.readUntilString("-->");i.eat("-->",!0),i.append({type:"Comment",start:Ae,end:i.index,data:Ge});return}if(i.eat("/")){let{name:Ge}=Pc(i);if(i.allowWhitespace(),i.eat(">",!0),Fi(Ge))throw Error(`sveld: <${Ge}> is a void element and cannot have a closing tag`);while(Ne.name!==Ge){if(Ne.type==="RegularElement");else throw Error(`sveld: invalid closing tag </${Ge}>`);Ne.end=Ae,i.pop(),Ne=i.current()}if(Ne.end=i.index,i.pop(),i.lastAutoClosedTag&&i.stack.length<i.lastAutoClosedTag.depth)i.lastAutoClosedTag=void 0;return}let _e=Pc(i),De=Wf(_e.name)&&Ff.test(_e.name);if(!Vf(_e.name)&&!De)throw Error(`sveld: "${_e.name}" is not a valid element or component name`);if(_e.name in Ic&&Ne.type!=="Root")throw Error(`sveld: <${_e.name}> must be a top-level element`);let Re;if(_e.name in wc)Re=wc[_e.name];else if(_e.name.startsWith("svelte:"))Re=qf(_e.name);else if(De)Re="Component";else if(_e.name==="title"&&Gf(i.stack))Re="TitleElement";else if(_e.name==="slot"&&!Uf(i.stack))Re="SlotElement";else Re="RegularElement";let Ie={type:Re,start:Ae,end:-1,name:_e.name,attributes:[],fragment:{type:"Fragment",nodes:[]}};if(i.allowWhitespace(),Ne.type==="RegularElement"&&aa(Ne.name,_e.name))Ne.end=Ae,i.pop(),i.lastAutoClosedTag={tag:Ne.name,reason:_e.name,depth:i.stack.length},Ne=i.current();let Oe=i.current(),Me=(_e.name==="script"||_e.name==="style")&&Oe.type==="Root",Fe=Me?Xf:Jf,Be;while(Be=Fe(i))Ie.attributes.push(Be),i.allowWhitespace();if(Ie.type==="SvelteComponent")Ie.expression=_c(Nc(Ie));if(Ie.type==="SvelteElement"){let Ge=Nc(Ie);if(Ge.value===!0)throw Error("sveld: <svelte:element> `this` attribute needs a value");if(Yf(Ge))Ie.tag=_c(Ge);else{let Ue=Ge.value[0];Ie.tag=Ue.type==="Text"?{type:"Literal",value:Ue.data,raw:`'${Ue.raw}'`,start:Ue.start,end:Ue.end}:Ue.expression}}if(Me){if(i.eat(">",!0),_e.name==="script"){let Ge=Tc(i,Ae,Ie.attributes);if(Ge.context==="module"){if(i.root.module)throw Error("sveld: duplicate <script module>");i.root.module=Ge}else{if(i.root.instance)throw Error("sveld: duplicate <script>");i.root.instance=Ge}}else{if(i.root.css)throw Error("sveld: duplicate <style>");i.root.css=kc(i,Ae,Ie.attributes)}return}i.append(Ie);let Ve=i.eat("/")||Fi(_e.name);if(i.eat(">",!0),Ve)Ie.end=i.index;else if(_e.name==="textarea")Ie.fragment.nodes=Lc(i,()=>(ji.lastIndex=i.index,ji.test(i.source))),i.read(ji),Ie.end=i.index;else i.push(Ie,Ie.fragment)}function Nc(i){let Ae=i.attributes,Ne=Ae.findIndex((_e)=>_e.type==="Attribute"&&_e.name==="this");if(Ne===-1)throw Error(`sveld: <${i.name}> requires a \`this\` attribute`);return Ae.splice(Ne,1)[0]}function _c(i){return Array.isArray(i.value)?i.value[0].expression:i.value.expression}function Yf(i){return i.value!==!0&&!Array.isArray(i.value)||Array.isArray(i.value)&&i.value.length===1&&i.value[0].type==="ExpressionTag"}function Mc(i){let Ae={start:i.start,end:i.end,attributes:i.attributes};for(let Ne of i.attributes){if(Ne.type!=="Attribute")continue;if(Ne.name==="runes"){let _e=$c(Ne);if(typeof _e==="boolean")Ae.runes=_e}if(Ne.name==="customElement"){let _e=eh(Ne);if(_e!==void 0)Ae.customElement=_e}}return Ae}function $c(i){let{value:Ae}=i;if(Ae===!0)return!0;let Ne=Array.isArray(Ae)?Ae[0]:Ae;if(!Ne)return!0;if(Array.isArray(Ae)&&Ae.length>1)return null;if(Ne.type==="Text")return Ne.data;if(Ne.expression.type!=="Literal")return null;return Ne.expression.value}var Qf=new Set(["String","Boolean","Number","Array","Object"]);function Wi(i){let Ae=[];for(let Ne of i.properties){if(!Ne||typeof Ne!=="object"||Ne.type!=="Property"||Ne.computed||Ne.key?.type!=="Identifier")continue;let{key:_e,value:De}=Ne;Ae.push([_e.name,De])}return Ae}function Zf(i){let Ae={};if(!i||typeof i!=="object"||i.type!=="ObjectExpression")return Ae;for(let[Ne,_e]of Wi(i)){if(!_e||typeof _e!=="object"||_e.type!=="Literal")continue;let De=_e.value;if(Ne==="attribute"&&typeof De==="string")Ae.attribute=De;else if(Ne==="reflect"&&typeof De==="boolean")Ae.reflect=De;else if(Ne==="type"&&typeof De==="string"&&Qf.has(De))Ae.type=De}return Ae}function eh(i){let{value:Ae}=i;if(Ae===!0)return;let Ne=Array.isArray(Ae)?Ae[0]:Ae;if(!Ne)return;if(Ne.type==="Text"){let Be=$c(i);return typeof Be==="string"?{tag:Be}:void 0}let _e=Ne.expression;if(_e.type==="Literal"&&_e.value===null)return;if(_e.type!=="ObjectExpression")return;let De=Wi(_e),Re={},Ie=De.find(([Be])=>Be==="tag")?.[1];if(Ie&&typeof Ie==="object"&&Ie.type==="Literal"&&typeof Ie.value==="string")Re.tag=Ie.value;let Oe=De.find(([Be])=>Be==="props")?.[1];if(Oe&&typeof Oe==="object"&&Oe.type==="ObjectExpression"){Re.props={};for(let[Be,Ve]of Wi(Oe))Re.props[Be]=Zf(Ve)}let Me=De.find(([Be])=>Be==="shadow")?.[1];if(Me&&typeof Me==="object"){let Be=Me;if(Be.type==="Literal"&&(Be.value==="open"||Be.value==="none"))Re.shadow=Be.value;else if(Be.type==="ObjectExpression")Re.shadow=Me}let Fe=De.find(([Be])=>Be==="extend")?.[1];if(Fe!==void 0)Re.extend=Fe;return Re}var th=/<script\s+(?:[^>]*|(?:[^=>'"/]+=(?:"[^"]*"|'[^']*'|[^>\s]+)\s+)*)lang=(["'])?ts\1[^>]*>/;class qi extends Ri{root;stack=[];fragments=[];isTypeScript;lineTable={};lastAutoClosedTag;constructor(i,Ae){super(i);this.isTypeScript=th.test(i);let Ne=Kt();this.root={type:"Root",start:0,end:Ae,css:null,js:[],options:null,fragment:Ne,comments:[]},this.stack.push(this.root),this.fragments.push(Ne)}current(){return this.stack[this.stack.length-1]}currentFragment(){return this.fragments[this.fragments.length-1]}push(i,Ae){this.stack.push(i),this.fragments.push(Ae)}pop(){return this.fragments.pop(),this.stack.pop()}append(i){return this.currentFragment().nodes.push(i),i}}var Gi={"{":"}","(":")","[":"]"},nh=new Set(Object.values(Gi));function Ar(i,Ae,Ne=Gi){let _e=Ne===Gi?nh:new Set(Object.values(Ne)),De=[],Re=Ae;while(Re<i.source.length){let Ie=i.source[Re++];if(Ie==="'"||Ie==='"'||Ie==="`"){Re=rh(i,Re,Ie);continue}if(Object.hasOwn(Ne,Ie))De.push(Ie);else if(_e.has(Ie)){let Oe=De.pop(),Me=Oe?Ne[Oe]:void 0;if(Ie!==Me)throw Error(`sveld: expected "${Me}"`);if(De.length===0)return Re}}throw Error("sveld: unexpected end of input")}function rh(i,Ae,Ne){let _e=!1,De=Ae;while(De<i.source.length){let Re=i.source[De++];if(_e){_e=!1;continue}if(Re===Ne)return De;if(Re==="\\")_e=!0;if(Ne==="`"&&Re==="$"&&i.source[De]==="{")De=Ar(i,De)}throw Error("sveld: unterminated string constant")}var Fc=/[^\n]/g,sh=/\?\s*:/g;function $n(i){let Ae=i.index,Ne=i.readIdentifierName();if(Ne.name!==""){let Ge=Bc(i);return{...Ne,typeAnnotation:Ge}}let _e=i.source[i.index];if(_e!=="{"&&_e!=="[")throw Error("sveld: expected a binding pattern");let De=Ar(i,Ae);i.index=De;let Re=i.source.slice(Ae,De),Ie=i.source.slice(0,Ae).replace(Fc," "),Oe=Ie.indexOf(" ");Ie=Ie.slice(0,Oe)+Ie.slice(Oe+1);let Me=`${Ie}(${Re} = 1)`,{node:Fe}=ir(Me,Ae-1,i.isTypeScript,i.root.comments),Be=Fe.left,Ve=Bc(i);if(Ve)Be.typeAnnotation=Ve,Be.end=Ve.end;return Be}function Bc(i){let Ae=i.index;if(i.allowWhitespace(),!i.eat(":")){i.index=Ae;return}let Ne="_ as ",_e=i.index-Ne.length,De=i.source.slice(0,_e).replace(Fc," ")+Ne+i.source.slice(i.index).replace(sh,":"),{node:Re}=ir(De,_e,i.isTypeScript,i.root.comments),Ie=Re;if(Ie.type==="AssignmentExpression"){let Oe=Ie.right.start;while(De[Oe]!=="=")Oe-=1;({node:Re}=ir(De.slice(0,Oe),_e,i.isTypeScript,i.root.comments)),Ie=Re}if(Ie.type==="SequenceExpression"&&Ie.expressions)Ie=Ie.expressions[0];return i.index=Ie.end,{type:"TSTypeAnnotation",start:Ae,end:i.index,typeAnnotation:Ie.typeAnnotation}}var jc=/\s*}/y,ih={"<":">"};function Vc(i){let Ae=i.index-2;while(i.source[Ae]!=="{")Ae-=1;if(i.eat("if")){i.requireWhitespace();let Ne={type:"IfBlock",elseif:!1,start:Ae,end:-1,test:Ft(i),consequent:Kt(),alternate:null};i.append(Ne),i.allowWhitespace(),i.eat("}",!0),i.push(Ne,Ne.consequent);return}if(i.eat("each")){i.requireWhitespace();let Ne=Ft(i);if(i.allowWhitespace(),!i.match("as")){let Oe=Ne;if(Oe.type==="SequenceExpression"&&Oe.expressions)Oe=Oe.expressions[0];if(Oe.type==="TSAsExpression"){let Me=Oe;Ne=Me.expression;let Fe=Me.typeAnnotation.start-2;while(Fe>=0&&!(i.source[Fe]==="a"&&i.source[Fe+1]==="s"))Fe-=1;i.index=Fe}}let _e=null,De,Re;if(i.eat("as"))i.requireWhitespace(),_e=$n(i);if(i.allowWhitespace(),i.eat(",")){i.allowWhitespace();let Oe=i.readIdentifierName();if(!Oe.name)throw Error("sveld: expected an identifier");De=Oe.name,i.allowWhitespace()}if(i.eat("("))i.allowWhitespace(),Re=Ft(i),i.allowWhitespace(),i.eat(")",!0),i.allowWhitespace();i.eat("}",!0);let Ie={type:"EachBlock",start:Ae,end:-1,expression:Ne,body:Kt(),context:_e,index:De,key:Re};i.append(Ie),i.push(Ie,Ie.body);return}if(i.eat("await")){i.requireWhitespace();let Ne=Ft(i);i.allowWhitespace();let _e={type:"AwaitBlock",start:Ae,end:-1,expression:Ne,value:null,error:null,pending:null,then:null,catch:null};if(i.eat("then")){if(!i.matchRegex(jc))i.requireWhitespace(),_e.value=$n(i),i.allowWhitespace();_e.then=Kt()}else if(i.eat("catch")){if(!i.matchRegex(jc))i.requireWhitespace(),_e.error=$n(i),i.allowWhitespace();_e.catch=Kt()}else _e.pending=Kt();i.eat("}",!0),i.append(_e),i.push(_e,_e.then??_e.catch??_e.pending);return}if(i.eat("key")){i.requireWhitespace();let Ne=Ft(i);i.allowWhitespace(),i.eat("}",!0);let _e={type:"KeyBlock",start:Ae,end:-1,expression:Ne,fragment:Kt()};i.append(_e),i.push(_e,_e.fragment);return}if(i.eat("snippet")){i.requireWhitespace();let Ne=i.readIdentifierName();if(Ne.name==="")throw Error("sveld: expected a snippet name");i.allowWhitespace();let _e;if(i.isTypeScript&&i.match("<")){let Re=i.index,Ie=Ar(i,Re,ih);_e=i.source.slice(Re+1,Ie-1),i.index=Ie}if(i.allowWhitespace(),i.eat("(")){let Re=1;while(i.index<i.source.length&&(!i.match(")")||Re!==1)){if(i.match("("))Re++;if(i.match(")"))Re--;i.index+=1}i.eat(")",!0)}i.allowWhitespace(),i.eat("}",!0);let De={type:"SnippetBlock",start:Ae,end:-1,expression:Ne,typeParams:_e,parameters:[],body:Kt()};i.append(De),i.push(De,De.body);return}throw Error("sveld: expected if/each/await/key/snippet")}function Wc(i){let Ae=i.index-1,Ne=i.current();if(Ne.type==="IfBlock"){if(!i.eat("else"))throw Error("sveld: expected {:else} or {:else if}");if(i.eat("if"))throw Error("sveld: {:else if} cannot follow {:else if} directly");if(i.allowWhitespace(),i.fragments.pop(),Ne.alternate=Kt(),i.fragments.push(Ne.alternate),i.eat("if")){i.requireWhitespace();let _e=Ft(i);i.allowWhitespace(),i.eat("}",!0);let De=Ae-1;while(i.source[De]!=="{")De-=1;let Re={type:"IfBlock",start:De,end:-1,elseif:!0,test:_e,consequent:Kt(),alternate:null};i.append(Re),i.stack.push(Re),i.fragments.pop(),i.fragments.push(Re.consequent)}else i.allowWhitespace(),i.eat("}",!0);return}if(Ne.type==="EachBlock"){if(!i.eat("else"))throw Error("sveld: expected {:else}");i.allowWhitespace(),i.eat("}",!0),Ne.fallback=Kt(),i.fragments.pop(),i.fragments.push(Ne.fallback);return}if(Ne.type==="AwaitBlock"){if(i.eat("then")){if(Ne.then)throw Error("sveld: duplicate {:then}");if(!i.eat("}"))i.requireWhitespace(),Ne.value=$n(i),i.allowWhitespace(),i.eat("}",!0);Ne.then=Kt(),i.fragments.pop(),i.fragments.push(Ne.then);return}if(i.eat("catch")){if(Ne.catch)throw Error("sveld: duplicate {:catch}");if(!i.eat("}"))i.requireWhitespace(),Ne.error=$n(i),i.allowWhitespace(),i.eat("}",!0);Ne.catch=Kt(),i.fragments.pop(),i.fragments.push(Ne.catch);return}throw Error("sveld: expected {:then ...} or {:catch ...}")}throw Error("sveld: {:...} not valid here")}function qc(i){let Ae=i.current();switch(Ae.type){case"IfBlock":{i.eat("if",!0),i.allowWhitespace(),i.eat("}",!0);while(Ae.type==="IfBlock"&&Ae.elseif)Ae.end=i.index,i.stack.pop(),Ae=i.current();Ae.end=i.index,i.pop();return}case"EachBlock":i.eat("each",!0);break;case"KeyBlock":i.eat("key",!0);break;case"AwaitBlock":i.eat("await",!0);break;case"SnippetBlock":i.eat("snippet",!0);break;default:throw Error("sveld: unexpected closing block tag")}i.allowWhitespace(),i.eat("}",!0),Ae.end=i.index,i.pop()}var oh=/(?:let|const)\b/y,ah=/(?:var|interface|enum)\b/y,ch=/type\b/y;function Gc(i){let Ae=i.index;if(i.matchRegex(ah))throw Error("sveld: `var`/`interface`/`enum` are not valid here");if(!i.matchRegex(oh)&&!i.matchRegex(ch))return null;let Ne=i.root.comments.length,_e=gc(i.source,Ae,i.isTypeScript,i.root.comments);if(_e.type!=="VariableDeclaration"){if(_e.type==="ExpressionStatement")return i.root.comments.length=Ne,null;throw Error("sveld: expected a `let`/`const` declaration")}if(_e.kind!=="let"&&_e.kind!=="const")throw Error("sveld: expected a `let`/`const` declaration");return i.index=_e.end,i.allowWhitespace(),i.eat("}",!0),_e}var lh=/\s*}/y;function Uc(i){let Ae=i.index;while(i.source[Ae]!=="{")Ae-=1;if(i.eat("html")){i.requireWhitespace();let Ne=Ft(i);i.allowWhitespace(),i.eat("}",!0);let _e={type:"HtmlTag",start:Ae,end:i.index,expression:Ne};i.append(_e);return}if(i.eat("debug")){let Ne;if(i.read(lh))Ne=[];else{let De=Ft(i);Ne=De.type==="SequenceExpression"?De.expressions:[De];for(let Re of Ne)if(Re.type!=="Identifier")throw Error("sveld: {@debug} arguments must be identifiers");i.allowWhitespace(),i.eat("}",!0)}let _e={type:"DebugTag",start:Ae,end:i.index,identifiers:Ne};i.append(_e);return}if(i.eat("const")){i.requireWhitespace();let Ne=$n(i);i.allowWhitespace(),i.eat("=",!0),i.allowWhitespace();let _e=Ft(i),De=i.index;i.allowWhitespace(),i.eat("}",!0);let Re={type:"VariableDeclarator",id:Ne,init:_e,start:Ne.start,end:De},Ie={type:"ConstTag",start:Ae,end:i.index,declaration:{type:"VariableDeclaration",kind:"const",declarations:[Re],start:Ae+2,end:i.index-1}};i.append(Ie);return}if(i.eat("render")){i.requireWhitespace();let Ne=Ft(i);if(!(Ne.type==="CallExpression"||Ne.type==="ChainExpression"&&Ne.expression.type==="CallExpression"))throw Error("sveld: {@render ...} must be a function call");i.allowWhitespace(),i.eat("}",!0);let De={type:"RenderTag",start:Ae,end:i.index,expression:Ne};i.append(De);return}throw Error("sveld: expected html/debug/const/render")}function Hc(i){let Ae=i.index;if(i.index+=1,i.allowWhitespace(),i.eat("#")){Vc(i);return}if(i.eat(":")){Wc(i);return}if(i.eat("@")){Uc(i);return}if(i.match("/")&&!i.match("/*")&&!i.match("//")){i.eat("/"),qc(i);return}let Ne=Gc(i);if(Ne){let Re={type:"DeclarationTag",start:Ae,end:i.index,declaration:Ne};i.append(Re);return}let _e=Ft(i);i.allowWhitespace(),i.eat("}",!0);let De={type:"ExpressionTag",start:Ae,end:i.index,expression:_e};i.append(De)}function Kc(i){let{index:Ae,source:Ne}=i,_e=Ne.indexOf("<",Ae),De=Ne.indexOf("{",Ae),Re;if(_e===-1)Re=De===-1?Ne.length:De;else Re=De===-1?_e:Math.min(_e,De);i.index=Re;let Ie=Ne.slice(Ae,Re),Oe={type:"Text",start:Ae,end:i.index,raw:Ie,data:Ie};i.append(Oe)}function A(i){let Ae=i.trimEnd(),Ne=new qi(Ae,i.length);while(Ne.index<Ne.source.length)if(Ne.match("<"))Oc(Ne);else if(Ne.match("{"))Hc(Ne);else Kc(Ne);let _e=Ne.root.fragment.nodes.findIndex((De)=>De.type==="SvelteOptions");if(_e!==-1){let[De]=Ne.root.fragment.nodes.splice(_e,1);Ne.root.options=Mc(De)}return Ne.root}function Nt(i){return typeof i==="object"&&i!==null}function se(i){return Nt(i)&&i.type==="VariableDeclaration"&&Array.isArray(i.declarations)}function l(i){return Nt(i)&&i.type==="Literal"}function s(i){return Nt(i)&&i.type==="Identifier"&&typeof i.name==="string"}function ie(i){return Nt(i)&&i.type==="MemberExpression"}function wn(i){return Nt(i)&&i.type==="ObjectExpression"&&Array.isArray(i.properties)}function ph(i){return Nt(i)&&i.type==="CallExpression"}function p(i,Ae){if(!ph(i))return!1;return!!i.callee&&Nt(i.callee)&&i.callee.type==="Identifier"&&i.callee.name===Ae}function f(i){if(Nt(i)&&(i.type==="TSAsExpression"||i.type==="TSSatisfiesExpression")&&"expression"in i)return f(i.expression);return i}function oe(i){if(Nt(i)&&(i.type==="TSAsExpression"||i.type==="TSSatisfiesExpression")&&"typeAnnotation"in i)return i.typeAnnotation;return}function uh(i){return Nt(i)&&i.type==="NewExpression"}function Ui(i,Ae){if(!uh(i))return!1;return!!i.callee&&Nt(i.callee)&&i.callee.type==="Identifier"&&i.callee.name===Ae}function Kn(i){if(!Nt(i)||typeof i.type!=="string")return null;if(i.type==="Literal"){let Ae=i.value;if(typeof Ae==="string")return Ae;return Ae==null?null:String(Ae)}if(i.type==="TemplateLiteral"){let Ae=i.quasis;if(Ae?.length===1){let Ne=Ae[0]?.value?.cooked;return Ne==null?null:Ne}}return null}var g=Symbol("sveld.parsedComponentTypeScriptMetadata");function mn(i){return i[g]}function zc(i,Ae){if(Ae.length===0)return;let Ne=new Set(i.props.map((_e)=>_e.name));for(let _e of Ae){if(Ne.has(_e.name))continue;Ne.add(_e.name),i.props.push({name:_e.name,kind:"let",constant:!1,type:_e.type,typeSource:"typescript",..._e.description?{description:_e.description}:{},isFunction:_e.type.includes("=>"),isFunctionDeclaration:!1,isRequired:_e.isRequired,reactive:!1})}}var dh=/\w/;function fh(i,Ae){let Ne=i.trim();if(!Ne.startsWith("{")||!Ne.endsWith("}"))return;let _e=Ne.slice(1,-1),De=[],Re=0,Ie="";for(let Oe of _e)if(Oe==="{"||Oe==="<"||Oe==="("||Oe==="[")Re++,Ie+=Oe;else if(Oe==="}"||Oe===">"||Oe===")"||Oe==="]")Re--,Ie+=Oe;else if((Oe===";"||Oe===",")&&Re===0)De.push(Ie.trim()),Ie="";else Ie+=Oe;if(Ie.trim())De.push(Ie.trim());for(let Oe of De){if(!Oe.startsWith(Ae))continue;let Me=Oe.slice(Ae.length);if(Me.length>0&&dh.test(Me[0]))continue;let Fe=Me.trimStart();if(Fe.startsWith("?"))Fe=Fe.slice(1).trimStart();if(Fe.startsWith(":"))return Fe.slice(1).trim()}return}function B(i,Ae,Ne){let _e=Ne;if(_e.computed||_e.object?.type!=="Identifier"||_e.property?.type!=="Identifier")return;let De=_e.object.name,Re=_e.property.name;if(!De||!Re)return;if(i.wholePropsLocals.has(De))return Ae.getPropTypeByLocalOrPublic(Re);let Ie=Ae.getPropTypeByLocalOrPublic(De)??Ae.findVariableTypeAndDescription(De)?.type;if(!Ie)return;return fh(Ie,Re)}function hh(i){let Ae="";for(let Ne=0;Ne<i.length;Ne++){let _e=i[Ne];if(_e==="*"&&i[Ne+1]==="*"){if(Ae+=".*",Ne++,i[Ne+1]==="/")Ne++;continue}if(_e==="*"){Ae+="[^/]*";continue}if(_e==="?"){Ae+="[^/]";continue}Ae+=".+^$()[]{}|\\".includes(_e)?`\\${_e}`:_e}return Ae}function Xc(i,Ae){return new RegExp(`^${hh(i)}$`).test(Ae)}var j={"prop-unknown-type":"sveld/prop-unknown-type","context-any-type":"sveld/context-any-type","slot-missing-type":"sveld/slot-missing-type","event-no-source":"sveld/event-no-source","example-compile-error":"sveld/example-compile-error","example-syntax-error":"sveld/example-syntax-error","syntax-skipped":"sveld/syntax-skipped","rest-props-unresolved":"sveld/rest-props-unresolved","context-duplicate-key":"sveld/context-duplicate-key","spread-unresolved":"sveld/spread-unresolved","export-unresolved":"sveld/export-unresolved","extend-props-target-missing":"sveld/extend-props-target-missing","extend-props-duplicate":"sveld/extend-props-duplicate","extend-props-override":"sveld/extend-props-override","jsdoc-unknown-tag":"sveld/jsdoc-unknown-tag","typedef-duplicate":"sveld/typedef-duplicate","property-duplicate":"sveld/property-duplicate","generics-conflict":"sveld/generics-conflict","jsdoc-tag-dropped":"sveld/jsdoc-tag-dropped","internal-typedef-referenced":"sveld/internal-typedef-referenced","types-inline-unresolved":"sveld/types-inline-unresolved"},mh={"prop-unknown-type":"warning","context-any-type":"warning","slot-missing-type":"warning","event-no-source":"warning","example-compile-error":"error","example-syntax-error":"error","syntax-skipped":"error","rest-props-unresolved":"warning","context-duplicate-key":"warning","spread-unresolved":"warning","export-unresolved":"warning","extend-props-target-missing":"error","extend-props-duplicate":"warning","extend-props-override":"warning","jsdoc-unknown-tag":"warning","typedef-duplicate":"warning","property-duplicate":"warning","generics-conflict":"warning","jsdoc-tag-dropped":"warning","internal-typedef-referenced":"error","types-inline-unresolved":"warning"};function yn(i){return{...i,code:j[i.kind],severity:mh[i.kind]}}function F(i,Ae){if(Ae)return i;return i.filter((Ne)=>Ne.kind!=="jsdoc-unknown-tag")}function J(i,Ae){if(!Ae)return[];return i.filter((Ne)=>!Ne.ignored&&(Ae!=="errors"||Ne.severity==="error"))}function yh(i,Ae){if(Ae.code!==void 0&&Ae.code!==i.code)return!1;if(Ae.name!==void 0&&Ae.name!==i.name)return!1;if(Ae.component!==void 0&&!Xc(Ae.component,i.component))return!1;return!0}function Jc(i,Ae){if(!Ae||Ae.length===0)return i;return i.map((Ne)=>Ne.ignored||Ae.some((_e)=>yh(Ne,_e))?{...Ne,ignored:!0}:Ne)}var gh={"prop-unknown-type":"Props without inferred types","context-any-type":"Context values typed as `any`","slot-missing-type":"@slot/@snippet tags missing a {Type} annotation","event-no-source":"@event tags with no dispatch or callback","example-compile-error":"@example blocks that failed to compile","example-syntax-error":"@example blocks that failed to parse","syntax-skipped":"Component syntax sveld skipped","rest-props-unresolved":"$$restProps spread only onto components","context-duplicate-key":"Duplicate setContext keys","spread-unresolved":"Unresolved spreads widened to Record<string, any>","export-unresolved":"Unresolved named export specifiers","extend-props-target-missing":"@extends/@extendProps targets that couldn't be verified","extend-props-duplicate":"Duplicate @extends/@extendProps tags","extend-props-override":"Own props overriding an @extends target's prop","jsdoc-unknown-tag":"Unknown JSDoc tags","typedef-duplicate":"Duplicate @typedef/@callback names","property-duplicate":"Duplicate @property names","generics-conflict":"Duplicate @generics/@template names","jsdoc-tag-dropped":"Passthrough JSDoc tags that couldn't attach","internal-typedef-referenced":"Public types referencing an @internal typedef","types-inline-unresolved":"typesOptions.inline could not safely copy an imported type"},xh=["prop-unknown-type","context-any-type","slot-missing-type","event-no-source","example-compile-error","example-syntax-error","syntax-skipped","rest-props-unresolved","context-duplicate-key","spread-unresolved","export-unresolved","extend-props-target-missing","extend-props-duplicate","extend-props-override","jsdoc-unknown-tag","typedef-duplicate","property-duplicate","generics-conflict","jsdoc-tag-dropped","internal-typedef-referenced","types-inline-unresolved"];function ds(i){let Ae=new Set,Ne=[];for(let _e of i){let De=`${_e.component}:${_e.kind}:${_e.name}`;if(Ae.has(De))continue;Ae.add(De),Ne.push(_e)}return Ne}function q(i){let Ae=i.filter((Ie)=>!Ie.ignored),Ne=i.length-Ae.length,_e=Ne>0?` (${Ne} ignored)`:"";if(Ae.length===0)return`sveld: all types resolved${_e}.`;let De=[],Re=Ae.length;De.push(`sveld: ${Re} unresolved type${Re===1?"":"s"} found${_e}.`);for(let Ie of xh){let Oe=Ae.filter((Fe)=>Fe.kind===Ie);if(Oe.length===0)continue;De.push(""),De.push(`${gh[Ie]} (${Oe.length}):`);let Me=new Map;for(let Fe of Oe){let Be=Me.get(Fe.component)??[];Be.push(Fe),Me.set(Fe.component,Be)}for(let[Fe,Be]of Me){De.push(` ${Fe}`);for(let Ve of Be){let Ge=Ve.source?` (${Fe}:${Ve.source.start.line}:${Ve.source.start.column})`:"";De.push(` - ${Ve.message}${Ge} [${Ve.code}]`)}}}return De.join(`
|
|
17
|
-
`)}var ae=1;function V(i){return`${JSON.stringify({kind:"diagnostics",schemaVersion:ae,diagnostics:i},null,2)}
|
|
18
|
-
`}function n(i,Ae,Ne,_e,De){i.diagnosticRecords.push(yn({component:i.componentFilePath,kind:Ae,name:Ne,message:_e,...De?{source:De}:{},...bh(i,Ae,Ne)?{ignored:!0}:{}}))}function Yc(i,Ae){return`${i}:${Ae}`}function d(i,Ae,Ne,_e){if(!_e||_e.length===0)return;let De=Yc(Ae,Ne),Re=i.sveldIgnoreDirectives.get(De)??new Set;for(let Ie of _e)Re.add(Ie);i.sveldIgnoreDirectives.set(De,Re)}function bh(i,Ae,Ne){let _e=i.sveldIgnoreDirectives.get(Yc(Ae,Ne));if(!_e)return!1;return _e.has("")||_e.has(j[Ae])}var Hi=/[\r\n]+/g;function Eh(i){if(i.sourceLineStartOffsetsCache)return i.sourceLineStartOffsetsCache;let Ae=[0];if(i.source){let Ne=i.source.indexOf(`
|
|
19
|
-
`);while(Ne!==-1)Ae.push(Ne+1),Ne=i.source.indexOf(`
|
|
20
|
-
`,Ne+1)}return i.sourceLineStartOffsetsCache=Ae,Ae}function Qc(i,Ae){if(!i.source||Ae<0||Ae>i.source.length)return;let Ne=Eh(i),_e=i.sourceLineHint;if(_e!==void 0)for(let Ie=_e;Ie<=_e+1&&Ie<Ne.length;Ie++){let Oe=Ne[Ie],Me=Ne[Ie+1]??Number.POSITIVE_INFINITY;if(Ae>=Oe&&Ae<Me)return i.sourceLineHint=Ie,{line:Ie+1,column:Ae-Oe}}let De=0,Re=Ne.length-1;while(De<=Re){let Ie=De+Re>>>1,Oe=Ne[Ie],Me=Ne[Ie+1]??Number.POSITIVE_INFINITY;if(Ae<Oe)Re=Ie-1;else if(Ae>=Me)De=Ie+1;else return i.sourceLineHint=Ie,{line:Ie+1,column:Ae-Oe}}return}function U(i,Ae,Ne){if(Ae===void 0||Ne===void 0||Ne<Ae)return;let _e=Qc(i,Ae),De=Qc(i,Ne);if(!_e||!De)return;return{start:_e,end:De}}function t(i,Ae){if(!Ae||typeof Ae!=="object")return;let Ne="start"in Ae&&typeof Ae.start==="number"?Ae.start:void 0,_e="end"in Ae&&typeof Ae.end==="number"?Ae.end:void 0;return U(i,Ne,_e)}function un(i,Ae){if(!Ae||Ae.length===0)return;let Ne=[...Ae];while(Ne.length>1){let Me=Ne[Ne.length-1];if(Me.tag!==void 0||!Me.raw.trim().endsWith("*/"))break;Ne.pop()}let _e=Ne[0],De=_e.raw.indexOf(`@${_e.tag??""}`),Re=_e.start+Math.max(De,0),Ie=Ne[Ne.length-1],Oe=Ie.start+Ie.raw.length;return U(i,Re,Oe)}function r(i,Ae,Ne){return i.source?.slice(Ae,Ne)}function fs(i,Ae){if(!Ae||typeof Ae!=="object")return;let Ne="start"in Ae&&typeof Ae.start==="number"?Ae.start:void 0,_e="end"in Ae&&typeof Ae.end==="number"?Ae.end:void 0;if(Ne===void 0||_e===void 0)return;return r(i,Ne,_e)?.replace(Hi," ")}function u(i){return i===void 0||i===""?void 0:i}function R(i,Ae,Ne,_e){if(u(Ne)===void 0)return;if(i.trackPropLocalName(Ne),Ae.props.has(Ne)){let De=Ae.props.get(Ne);Ae.props.set(Ne,{...De,..._e})}else Ae.props.set(Ne,_e)}function m(i,Ae,Ne,_e=0){let De,Re,Ie=!1;if(!Ne||typeof Ne!=="object"||!("type"in Ne))return{value:De,type:Re,isFunction:Ie};let Oe=el(i,Ae,Ne);if(Ne.type==="ObjectExpression"||Ne.type==="BinaryExpression"||Ne.type==="ArrayExpression"||Ne.type==="ArrowFunctionExpression"||Ne.type==="FunctionExpression"){let Me=Ne;if("start"in Me&&"end"in Me&&typeof Me.start==="number"&&typeof Me.end==="number")De=r(Ae,Me.start,Me.end)?.replace(Hi," ");if(Re=De,Ie=Ne.type==="ArrowFunctionExpression"||Ne.type==="FunctionExpression",Ne.type==="BinaryExpression"){let Fe=Ne;if(Fe.left&&typeof Fe.left==="object"&&"type"in Fe.left&&Fe.left.type==="Literal"&&"value"in Fe.left&&typeof Fe.left.value==="string")Re="string"}if(Ne.type==="ArrowFunctionExpression"||Ne.type==="FunctionExpression")Re=rl(Ne),De=Zc(Ae,Ne)}else if(Ne.type==="UnaryExpression"){let Me=Ne;if("start"in Me&&"end"in Me&&typeof Me.start==="number"&&typeof Me.end==="number")De=r(Ae,Me.start,Me.end);if(Me.argument){if(typeof Me.argument==="object"&&"type"in Me.argument&&Me.argument.type==="UnaryExpression")Re=m(i,Ae,Me.argument).type;else if(typeof Me.argument==="object"&&"value"in Me.argument)Re=typeof Me.argument.value}}else if(Ne.type==="NewExpression"){let Me=Ne;if("start"in Me&&"end"in Me&&typeof Me.start==="number"&&typeof Me.end==="number")De=r(Ae,Me.start,Me.end);if(Me.callee&&typeof Me.callee==="object"&&"type"in Me.callee&&Me.callee.type==="Identifier"){let Fe=Me.callee.name;if(Fe==="Date")Re="Date";else if(Fe==="Map")Re="Map<any, any>";else if(Fe==="Set")Re="Set<any>";else if(Fe==="WeakMap")Re="WeakMap<object, any>";else if(Fe==="WeakSet")Re="WeakSet<object>";else if(Fe==="Array")Re="any[]";else if(Fe==="RegExp"||Fe==="Regexp")Re="RegExp";else if(Fe==="Error")Re="Error";else Re=Fe}}else if(Ne.type==="CallExpression"){let Me=Ne;if("start"in Me&&"end"in Me&&typeof Me.start==="number"&&typeof Me.end==="number")De=r(Ae,Me.start,Me.end);let Fe=Me.callee,Be=Fe&&typeof Fe==="object"&&"type"in Fe&&Fe.type==="Identifier"?Fe.name:void 0;if((Be==="$derived"||Be==="$state")&&Me.arguments.length===1&&_e<5)return{...m(i,Ae,Me.arguments[0],_e+1),value:De,defaultValue:Oe};if(Be){let Ve=Sh(i,Ae,Be);if(Ve)return{value:De,type:void 0,isFunction:!1,defaultValue:Oe,resolvedType:Ve};if(Ae.funcDecls.has(Be)||vh(Ae,Be))return{value:De,type:void 0,isFunction:!1,defaultValue:Oe,pendingCallDefault:{calleeName:Be}};let Ge=Ae.valueImportBindingsByLocalName.get(Be);if(Ge)return{value:De,type:void 0,isFunction:!1,defaultValue:Oe,pendingCallDefault:{calleeName:Be,importSource:Ge.source,importedName:Ge.importedName}}}return{value:De,type:void 0,isFunction:!1,defaultValue:Oe,pendingCallDefault:{calleeName:Be??Ch(Ae,Fe)}}}else if(Ne.type==="Identifier"){let Me=Ne;if(_e<5){let Fe=tl(Ae,Me.name);if(Fe){let Be=m(i,Ae,Fe,_e+1),Ve=i.resolveLocalVarJSDoc(Me.name);return{...Be,resolvedType:Ve?.type??Be.resolvedType,resolvedDescription:Ve?.description??Be.resolvedDescription,resolvedParams:Ve?.params??Be.resolvedParams,resolvedReturnType:Ve?.returnType??Be.resolvedReturnType}}if(Ae.funcDecls.has(Me.name)){let Be=i.resolveLocalVarJSDoc(Me.name),Ve=Ae.funcDecls.get(Me.name);return{value:Ve?Zc(Ae,Ve):void 0,type:void 0,isFunction:!0,defaultValue:Ve?el(i,Ae,Ve):void 0,resolvedType:Be?.type??wh(Be,Ve),resolvedDescription:Be?.description,resolvedParams:Be?.params,resolvedReturnType:Be?.returnType}}}if("start"in Me&&"end"in Me&&typeof Me.start==="number"&&typeof Me.end==="number")De=r(Ae,Me.start,Me.end)}else if(Ne.type==="MemberExpression"){let Me=Ne;if("start"in Me&&"end"in Me&&typeof Me.start==="number"&&typeof Me.end==="number")De=r(Ae,Me.start,Me.end);if(i.isNumericConstant(Ne))Re="number"}else if(Ne.type==="TemplateLiteral"){let Me=Ne;if("start"in Me&&"end"in Me&&typeof Me.start==="number"&&typeof Me.end==="number")De=r(Ae,Me.start,Me.end);Re="string"}else if("raw"in Ne&&typeof Ne.raw==="string"){if(De=Ne.raw,"value"in Ne)Re=Ne.value==null?void 0:typeof Ne.value}return{value:De,type:Re,isFunction:Ie,defaultValue:Oe}}function tl(i,Ae){for(let Ne of i.vars)for(let _e of Ne.declarations)if(_e.id&&typeof _e.id==="object"&&"type"in _e.id&&_e.id.type==="Identifier"&&"name"in _e.id&&_e.id.name===Ae&&_e.init)return _e.init;return}function wr(i,Ae){for(let Ne of i.vars){if(Ne.kind!=="const")continue;for(let _e of Ne.declarations)if(_e.id&&typeof _e.id==="object"&&"type"in _e.id&&_e.id.type==="Identifier"&&"name"in _e.id&&_e.id.name===Ae&&_e.init)return _e.init}return}function Ch(i,Ae){if(Ae&&typeof Ae==="object"&&"start"in Ae&&"end"in Ae&&typeof Ae.start==="number"&&typeof Ae.end==="number")return r(i,Ae.start,Ae.end)??"call";return"call"}function Sh(i,Ae,Ne){let _e=i.resolveLocalVarJSDoc(Ne);if(_e?.returnType)return _e.returnType;let De=Ae.funcDecls.get(Ne)??nl(Ae,Ne);if(!De)return;let Re=Ah(Ae,De);if(Re)return Re;let Ie=Th(Ae,Ne);if(Ie)return Ie;let Oe=sl(De);return Oe==="any"?void 0:Oe}function vh(i,Ae){return nl(i,Ae)!==void 0}function nl(i,Ae){let Ne=tl(i,Ae);if(!Ne||typeof Ne!=="object"||!("type"in Ne))return;if(Ne.type==="ArrowFunctionExpression"||Ne.type==="FunctionExpression")return Ne;return}function Th(i,Ae){for(let Ne of i.vars)for(let _e of Ne.declarations){let De=_e.id;if(!De||typeof De!=="object"||!("type"in De)||De.type!=="Identifier"||!("name"in De)||De.name!==Ae)continue;let Re=De.typeAnnotation;if(Re?.type!=="TSTypeAnnotation")return;let Ie=Re.typeAnnotation;if(!Ie||typeof Ie.start!=="number"||typeof Ie.end!=="number")return;return kh(r(i,Ie.start,Ie.end))}return}function kh(i){if(!i)return;let Ae=i.lastIndexOf("=>");if(Ae===-1)return;return i.slice(Ae+2).trim()||void 0}function Ah(i,Ae){let Ne=Ae.returnType;if(Ne?.type!=="TSTypeAnnotation")return;let _e=Ne.typeAnnotation;if(!_e||typeof _e.start!=="number"||typeof _e.end!=="number")return;return r(i,_e.start,_e.end)}function wh(i,Ae){let Ne=i?.returnType??"any",_e=i?.params;if(_e&&_e.length>0)return`(${_e.map((Re)=>`${Re.name}${Re.optional?"?":""}: ${Re.type}`).join(", ")}) => ${Ne}`;if(i?.returnType)return`() => ${Ne}`;if(Ae)return rl(Ae);return"(...args: any[]) => any"}function rl(i){return`(${Ph(i)}) => ${sl(i)}`}function Ph(i){let Ae=i.params;if(!Array.isArray(Ae)||Ae.length===0)return"...args: any[]";let Ne=[];for(let _e of Ae)if(_e&&typeof _e==="object"&&"type"in _e&&_e.type==="Identifier"&&"name"in _e&&typeof _e.name==="string")Ne.push(`${_e.name}: any`);else return"...args: any[]";return Ne.join(", ")}function sl(i){if(i.async||i.generator)return"any";let Ae=i.body,Ne;if(Ae&&typeof Ae==="object"&&"type"in Ae&&Ae.type==="BlockStatement"){if(Ne=Nh(Ae),Ne.length===0)return"any"}else Ne=[Ae];let _e=null;for(let De of Ne){let Re=_h(De);if(!Re)return"any";if(_e===null)_e=Re;else if(_e!==Re)return"any"}return _e??"any"}function Nh(i){let Ae=[];return Ki(i,Ae),Ae}function Ki(i,Ae){if(!i||typeof i!=="object")return;let Ne=i;if(typeof Ne.type!=="string")return;if(Ne.type==="FunctionDeclaration"||Ne.type==="FunctionExpression"||Ne.type==="ArrowFunctionExpression")return;if(Ne.type==="ReturnStatement")Ae.push(Ne.argument??null);for(let _e in Ne){if(_e==="leadingComments")continue;let De=Ne[_e];if(!De||typeof De!=="object")continue;if(Array.isArray(De))for(let Re=0;Re<De.length;Re++)Ki(De[Re],Ae);else Ki(De,Ae)}}function _h(i){if(!i||typeof i!=="object"||!("type"in i))return null;switch(i.type){case"Literal":{let Ae=i.value;if(typeof Ae==="string")return"string";if(typeof Ae==="number")return"number";if(typeof Ae==="boolean")return"boolean";return null}case"TemplateLiteral":return"string";case"CallExpression":{let Ae=i.callee;if(Ae&&typeof Ae==="object"&&"type"in Ae&&Ae.type==="Identifier"){let Ne=Ae.name;if(Ne==="String")return"string";if(Ne==="Number")return"number";if(Ne==="Boolean")return"boolean"}return null}default:return null}}function ce(i){if(p(i,"$bindable"))return{init:i.arguments[0],bindable:!0};return{init:i,bindable:!1}}function Dh(i,Ae){let Ne=Ae.params;if(!Array.isArray(Ne)||Ne.length===0)return"";let _e=Ne[0],De=Ne[Ne.length-1];if(typeof _e.start!=="number"||typeof De.end!=="number")return"";return r(i,_e.start,De.end)??""}function Zc(i,Ae){if(Ae.generator)return;let Ne=Ae.body;if(!Ne||typeof Ne!=="object"||!("type"in Ne))return;let _e=Dh(i,Ae),De=Ae.async?"async ":"",Re=(Oe,Me)=>Oe&&typeof Oe==="object"&&("type"in Oe)&&Oe.type==="ObjectExpression"?`(${Me})`:Me;if(Ne.type!=="BlockStatement"){let Oe=fs(i,Ne);return Oe===void 0?void 0:`${De}(${_e}) => ${Re(Ne,Oe)}`}let Ie=Ne.body;if(Ie.length===0)return`${De}(${_e}) => {}`;if(Ie.length===1){let Oe=Ie[0];if(Oe&&typeof Oe==="object"&&"type"in Oe&&Oe.type==="ReturnStatement"){let Me=Oe.argument;if(Me){let Fe=fs(i,Me);if(Fe!==void 0)return`${De}(${_e}) => ${Re(Me,Fe)}`}}}return}function el(i,Ae,Ne){let _e=fs(Ae,Ne);if(!_e||!Ne||typeof Ne!=="object"||!("type"in Ne))return;let De="expression";if(Ne.type==="Literal"||Ne.type==="UnaryExpression")De="literal";else if(Ne.type==="TemplateLiteral")De=Ne.expressions.length===0?"literal":"expression";else if(Ne.type==="ArrayExpression")De="array";else if(Ne.type==="ObjectExpression")De="object";else if(Ne.type==="ArrowFunctionExpression"||Ne.type==="FunctionExpression"||Ne.type==="FunctionDeclaration")De="function";let Re={raw:_e,kind:De};if(De==="literal"||De==="array"||De==="object"){let Ie=zi(i,Ne);if(Ie.ok)Re.value=Ie.value}return Re}function zi(i,Ae){if(!Ae||typeof Ae!=="object"||!("type"in Ae))return{ok:!1};if(Ae.type==="Literal"){let Ne=Ae.value;return typeof Ne==="bigint"?{ok:!1}:{ok:!0,value:Ne}}if(Ae.type==="UnaryExpression"){let Ne=Ae,_e=Ne.argument;if(!_e||typeof _e!=="object"||!("type"in _e)||_e.type!=="Literal")return{ok:!1};let De=_e.value;if(typeof De==="number"){if(Ne.operator==="-")return{ok:!0,value:-De};if(Ne.operator==="+")return{ok:!0,value:De}}if(typeof De==="boolean"&&Ne.operator==="!")return{ok:!0,value:!De};return{ok:!1}}if(Ae.type==="TemplateLiteral"){let Ne=Ae;if(Ne.expressions.length>0||Ne.quasis.length!==1)return{ok:!1};return{ok:!0,value:Ne.quasis[0].value.cooked??Ne.quasis[0].value.raw}}if(Ae.type==="ArrayExpression"){let Ne=Ae,_e=[];for(let De of Ne.elements){if(!De)return{ok:!1};let Re=zi(i,De);if(!Re.ok)return{ok:!1};_e.push(Re.value)}return{ok:!0,value:_e}}if(Ae.type==="ObjectExpression"){let Ne=Ae,_e={};for(let De of Ne.properties){if(De.type!=="Property"||De.computed)return{ok:!1};let Re=i.getPropertyName(De.key);if(!Re)return{ok:!1};let Ie=zi(i,De.value);if(!Ie.ok)return{ok:!1};_e[Re]=Ie.value}return{ok:!0,value:_e}}return{ok:!1}}function Ih(i){let Ae=[],Ne=0,_e=0;for(let De=0;De<i.length;De++){let Re=i[De];if(Re==="<"||Re==="("||Re==="["||Re==="{")Ne++;else if(Re===">"||Re===")"||Re==="]"||Re==="}")Ne=Math.max(Ne-1,0);else if(Ne===0&&(Re===";"||Re===","))Ae.push(i.slice(_e,De)),_e=De+1}return Ae.push(i.slice(_e)),Ae}function Rh(i){let Ae=0;for(let Ne=0;Ne<i.length;Ne++){let _e=i[Ne];if(_e==="<"||_e==="("||_e==="["||_e==="{")Ae++;else if(_e===">"||_e===")"||_e==="]"||_e==="}")Ae=Math.max(Ae-1,0);else if(Ae===0&&_e===":")return Ne}return-1}var Lh=/^\{([\s\S]*)\}$/,Oh=/^[A-Za-z_$][\w$]*$/;function hs(i){let Ae=i.trim(),Ne=Lh.exec(Ae);if(!Ne)return null;let _e=Ne[1].trim();if(_e==="")return[];let De=[];for(let Re of Ih(_e)){let Ie=Re.trim();if(!Ie)continue;let Oe=Rh(Ie);if(Oe===-1)return null;let Me=Ie.slice(0,Oe).trim(),Fe=Ie.slice(Oe+1).trim();if(!Fe)return null;let Be=!1;if(Me.endsWith("?"))Be=!0,Me=Me.slice(0,-1).trim();if(!Oh.test(Me))return null;De.push({name:Me,type:Fe,optional:Be})}return De}function Mh(i,Ae,Ne,_e){if(!s(Ne))return null;let De=wr(i,Ne.name);if(wn(De))return al(i,Ae,De,_e).properties;let Re=Ae.findVariableTypeAndDescription(Ne.name);if(!Re)return null;let Ie=hs(Re.type);if(!Ie)return null;return Ie.map((Oe)=>({name:Oe.name,type:Oe.type,optional:Oe.optional}))}function al(i,Ae,Ne,_e){let De=[],Re=!1;for(let Ie of Ne.properties){if(Ie.type==="SpreadElement"){let Ve=Mh(i,Ae,Ie.argument,_e);if(Ve)De.push(...Ve);else Re=!0,n(i,"spread-unresolved",_e,`Context "${_e}" spreads a value sveld can't resolve; its shape is widened to "Record<string, any>".`,t(i,Ie));continue}if(Ie.type!=="Property")continue;let Oe=Ae.getPropertyName(Ie.key);if(!Oe)continue;let Me="any",Fe,Be;if(s(Ie.value)){let Ve=Ie.value.name,Ge=Ae.findVariableTypeAndDescription(Ve);if(Ge)Me=Ge.type,Fe=Ge.description,Be=Ge.internal;else n(i,"context-any-type",Oe,`Context "${_e}" property "${Oe}" has no type annotation; defaulted to "any".`,t(i,Ie))}else if(Ie.value&&typeof Ie.value==="object"&&"type"in Ie.value&&(Ie.value.type==="ArrowFunctionExpression"||Ie.value.type==="FunctionExpression"))Me=`(${Ie.value.params?.map((Ue)=>{if(s(Ue))return`${Ue.name||"arg"}: any`;return"arg: any"}).join(", ")||""}) => any`;else if(l(Ie.value))Me=Ie.value.value==null?"null":typeof Ie.value.value;De.push({name:Oe,type:Me,description:Fe,optional:!1,...Be?{internal:!0}:{}})}return{properties:De,hasUnresolvedSpread:Re}}var $h=/[-_.:/\s]+/;function Pr(i){return`${i.split($h).map((_e)=>_e.charAt(0).toUpperCase()+_e.slice(1)).join("")}Context`}function il(i,Ae,Ne,_e){if(!Ne||typeof Ne!=="object"||!("type"in Ne))return null;if(Ne.type==="ObjectExpression"){if(!wn(Ne))return null;let{properties:De,hasUnresolvedSpread:Re}=al(i,Ae,Ne,_e);return{key:_e,typeName:Pr(_e),properties:De,description:void 0,...Re?{hasUnresolvedSpread:Re}:{}}}else if(s(Ne)){let De=Ne.name,Re=Ae.findVariableTypeAndDescription(De);if(Re)return{key:_e,typeName:Pr(_e),properties:[{name:De,type:Re.type,description:Re.description,optional:!1}],description:void 0,...Re.internal?{internal:!0}:{}};return n(i,"context-any-type",De,`Context "${_e}" variable "${De}" has no type annotation; defaulted to "any".`,t(i,Ne)),{key:_e,typeName:Pr(_e),properties:[{name:De,type:"any",description:void 0,optional:!1}]}}return null}function ol(i){let Ae=i.callee;if(!Ae||typeof Ae!=="object"||!("type"in Ae))return null;let Ne=Ae.type==="Identifier"&&Ae.name==="Symbol",_e=Ae.type==="MemberExpression"&&!Ae.computed&&Ae.object.type==="Identifier"&&Ae.object.name==="Symbol"&&Ae.property.type==="Identifier"&&Ae.property.name==="for";if(!Ne&&!_e)return null;let De=i.arguments[0];if(!De||typeof De!=="object"||!("type"in De))return"";if(De.type==="Literal"&&typeof De.value==="string")return De.value;if(De.type==="TemplateLiteral"&&De.quasis?.length===1)return De.quasis[0].value.cooked??"";return""}function cl(i,Ae,Ne=0){if(!Ae||typeof Ae!=="object"||!("type"in Ae))return{kind:"unresolved"};let _e=Ae;if(_e.type==="Literal"||_e.type==="TemplateLiteral"){let De=Kn(_e);return De==null?{kind:"unresolved"}:{kind:"resolved",key:De}}if(_e.type==="CallExpression"||_e.type==="NewExpression"){let De=ol(_e);return De==null?{kind:"unresolved"}:{kind:"resolved",key:De}}if(_e.type==="Identifier"){if(Ne>=5)return{kind:"unresolved"};let De=wr(i,_e.name);if(De&&typeof De==="object"&&"type"in De){let Ie=De;if((Ie.type==="CallExpression"||Ie.type==="NewExpression")&&ol(Ie)==="")return{kind:"resolved",key:_e.name};return cl(i,Ie,Ne+1)}let Re=i.valueImportBindingsByLocalName.get(_e.name);if(Re)return{kind:"pending",importSource:Re.source,importedName:Re.importedName};return{kind:"unresolved"}}return{kind:"unresolved"}}function ue(i,Ae,Ne,_e){if(!Ne||typeof Ne!=="object"||!("type"in Ne)||Ne.type!=="CallExpression")return;let De=Ne,Re=De.arguments[0];if(!Re)return;let Ie=cl(i,Re);if(Ie.kind==="unresolved"||Ie.kind==="resolved"&&!Ie.key){let Ve=i.componentFilePath?` in ${i.componentFilePath}`:"";console.warn(`Warning: Could not resolve setContext key${Ve}. Use a string literal, const-bound string, or Symbol(). Skipping context type generation.`);return}let Oe=De.arguments[1];if(!Oe)return;let Me=t(i,Ne);if(Ie.kind==="pending"){let Ve=il(i,Ae,Oe,"");if(Ve)i.pendingContextKeyCandidates.push({importSource:Ie.importSource,importedName:Ie.importedName,properties:Ve.properties,description:Ve.description,source:Me});return}let Fe=Ie.key,Be=il(i,Ae,Oe,Fe);if(!Be)return;if(i.contexts.has(Fe)){n(i,"context-duplicate-key",Fe,`setContext("${Fe}", ...) was called more than once; only the first call's shape is used.`,Me);return}i.contexts.set(Fe,{...Be,source:Me})}function pe(i,Ae){if(!Ae||typeof Ae!=="object"||!("type"in Ae))return;if(wn(Ae))return pl(i,Ae);if(Ae.type==="ArrayExpression")return ul(i,Ae);return}function ll(i,Ae){if(!Ae||typeof Ae!=="object"||!("type"in Ae))return"any";if(s(Ae))return i.findVariableTypeAndDescription(Ae.name)?.type??"any";if(l(Ae)){let Ne=Ae.value;return Ne===null?"null":typeof Ne}if(wn(Ae))return pl(i,Ae);if(Ae.type==="ArrayExpression")return ul(i,Ae);return"any"}function pl(i,Ae){let Ne=[];for(let _e of Ae.properties){if(_e.type!=="Property"||_e.computed)continue;let De=i.getPropertyName(_e.key);if(!De)continue;Ne.push({name:De,type:ll(i,_e.value)})}return ms(Ne)}function ul(i,Ae){let Ne=new Set(Ae.elements.filter((_e)=>_e!=null).map((_e)=>ll(i,_e)));if(Ne.size===0)return"any[]";if(Ne.size===1)return`${[...Ne][0]}[]`;return`(${[...Ne].join(" | ")})[]`}function z(i){return typeof i==="string"?JSON.stringify(i):String(i)}function h(i,{name:Ae,detail:Ne,has_argument:_e,description:De,deprecated:Re,tags:Ie,internal:Oe,source:Me}){if(Ae===void 0)return;let Fe=!_e&&!Ne?"null":u(Ne),Be=De,Ve=i.events.get(Ae);if(Ve?.type==="forwarded")i.events.set(Ae,{type:"dispatched",name:Ae,detail:Fe,description:Be||Ve.description,deprecated:Re??Ve.deprecated,tags:Ie??Ve.tags,...Oe||Ve.internal?{internal:!0}:{},source:Me||Ve.source});else if(Ve){let Ge=Ve.tags??Ie;i.events.set(Ae,{...Ve,detail:Ve.detail===void 0?Fe:Ve.detail,description:Ve.description||Be,deprecated:Ve.deprecated??Re,tags:Ge,...Ve.internal||Oe?{internal:!0}:{},source:Me||Ve.source})}else i.events.set(Ae,{type:"dispatched",name:Ae,detail:Fe,description:Be,deprecated:Re,tags:Ie,...Oe?{internal:!0}:{},source:Me})}function le(i,Ae){let Ne=Ae.arguments[0],_e=Ui(Ne,"CustomEvent");if(!_e&&!Ui(Ne,"Event"))return;let De=Ne.arguments[0],Re=l(De)?De.value:void 0;if(Re==null)return;let Ie=_e?Ne.arguments[1]:void 0,Oe=!1,Me;if(wn(Ie)){let Fe=Ie.properties.find((Be)=>Be.type==="Property"&&s(Be.key)&&Be.key.name==="detail");if(Fe?.type==="Property")Oe=!0,Me=l(Fe.value)?Fe.value.value:void 0}return h(i,{name:String(Re),detail:Me==null?"":z(Me),has_argument:Oe,source:t(i,Ae)}),String(Re)}function ms(i,Ae,Ne=!1){if(i.length===0)return"null";let _e=i.map(({name:De,type:Re,description:Ie,optional:Oe,default:Me})=>{let Fe=Oe?"?":"",Be=Ie||"";if(Me&&Be)Be=`${Be} @default ${Me}`;else if(Me)Be=`@default ${Me}`;if(Be){if(Ne)return`/** ${Be} */
|
|
21
|
-
${De}${Fe}: ${Re};`;return`/** ${Be} */ ${De}${Fe}: ${Re};`}return`${De}${Fe}: ${Re};`}).join(Ne?`
|
|
22
|
-
`:" ");return Ne?`{
|
|
23
|
-
${_e}
|
|
24
|
-
}`:`{ ${_e} }`}var Bh=/[A-Za-z_$][\w$]*/g;function Fh(i,Ae){if(!Ae)return!1;let Ne=new Set(Ae[0].split(",").map((_e)=>_e.trim()));for(let[_e]of i.matchAll(Bh))if(Ne.has(_e))return!0;return!1}function X(i,Ae){if(Ae===void 0)return;return i.runesPropsDeclarationMetadataByDeclaratorStart.get(Ae)}function fe(i,Ae,Ne){return X(i,Ae)?.props.get(Ne)}function de(i){if(!i||typeof i!=="object"||!("type"in i))return;if(i.type==="Identifier"&&"name"in i&&typeof i.name==="string")return i.name;if(i.type==="TSQualifiedName"&&"right"in i&&i.right&&typeof i.right==="object"&&"name"in i.right&&typeof i.right.name==="string")return i.right.name;return}function dl(i){if(!i||typeof i!=="object"||!("type"in i))return;if(i.type==="Identifier"&&"name"in i&&typeof i.name==="string")return i.name;if(i.type==="TSQualifiedName"&&"left"in i&&i.left&&typeof i.left==="object")return dl(i.left);return}function x(i,Ae){let Ne=Ae?.start,_e=Ae?.end;if(Ne===void 0||_e===void 0)return;return r(i,Ne+1,_e)?.trim()}function me(i,Ae){let Ne=Ae?.start,_e=Ae?.end;if(Ne===void 0||_e===void 0)return;return r(i,Ne,_e)?.trim()}function c(i,Ae,Ne,_e,De=new Set){if(!Ae?.type)return;switch(Ae.type){case"TSInterfaceDeclaration":c(i,{type:"TSTypeLiteral",members:Ae.body?.body},Ne,_e,De);return;case"TSTypeAliasDeclaration":case"TSParenthesizedType":case"TSTypeAnnotation":c(i,Ae.typeAnnotation,Ne,_e,De);return;case"TSIntersectionType":case"TSUnionType":for(let Re of Ae.types??[])c(i,Re,Ne,_e,De);return;case"TSTypeLiteral":for(let Re of Ae.members??[]){if(Re?.type!=="TSPropertySignature")continue;c(i,Re.typeAnnotation?.typeAnnotation,Ne,_e,De)}return;case"TSTypeReference":{let Re=dl(Ae.typeName);if(Re){if(i.typeImportBindingsByLocalName.has(Re)||i.valueImportBindingsByLocalName.has(Re))Ne.add(Re);let Ie=i.localTypeDeclarationsByName.get(Re);if(Ie&&!De.has(Re))_e.add(Re),De.add(Re),c(i,Ie.node,Ne,_e,De),De.delete(Re)}if("typeParameters"in Ae&&Ae.typeParameters&&typeof Ae.typeParameters==="object"){let Ie=Ae.typeParameters;for(let Oe of Ie.params??[])c(i,Oe,Ne,_e,De)}return}case"TSArrayType":case"TSRestType":case"TSOptionalType":case"TSIndexedAccessType":case"TSTypeOperator":case"TSExpressionWithTypeArguments":case"TSTupleType":case"TSConditionalType":case"TSInferType":case"TSMappedType":case"TSFunctionType":case"TSConstructorType":case"TSTypeQuery":case"TSImportType":case"TSLiteralType":case"TSTypePredicate":case"TSNamedTupleMember":break;default:break}for(let Re in Ae){let Ie=Ae[Re];if(!Ie||typeof Ie!=="object")continue;if(Array.isArray(Ie)){for(let Oe of Ie){if(!Oe||typeof Oe!=="object"||!("type"in Oe))continue;c(i,Oe,Ne,_e,De)}continue}if("type"in Ie)c(i,Ie,Ne,_e,De)}}function jh(i,Ae){let Ne=new Map;for(let _e of Array.from(Ae).sort()){let De=i.typeImportBindingsByLocalName.get(_e),Re=De?void 0:i.valueImportBindingsByLocalName.get(_e),Ie=De??(Re?{importedName:Re.importedName,localName:Re.localName,source:Re.source,specifierType:"named"}:void 0);if(!Ie)continue;let Oe=Ne.get(Ie.source)??{default:[],named:[],namespace:[]};if(Ie.specifierType==="default")Oe.default.push(Ie.localName);else if(Ie.specifierType==="namespace")Oe.namespace.push(Ie.localName);else Oe.named.push({imported:Ie.importedName,local:Ie.localName});Ne.set(Ie.source,Oe)}return Array.from(Ne.entries()).sort(([_e],[De])=>_e.localeCompare(De)).map(([_e,De])=>{if(De.namespace.length>0)return De.namespace.map((Me)=>`import type * as ${Me} from "${_e}";`).join(`
|
|
25
|
-
`);let Re=De.named.map(({imported:Me,local:Fe})=>{if(!Me||Me===Fe)return Fe;return`${Me} as ${Fe}`}),Ie=De.default[0],Oe=Re.length>0?`{ ${Re.join(", ")} }`:"";if(Ie&&Oe)return`import type ${Ie}, ${Oe} from "${_e}";`;if(Ie)return`import type ${Ie} from "${_e}";`;return`import type ${Oe} from "${_e}";`})}function P(i,Ae){if(Ae)i.additionalTypeDependencyNodes.push(Ae)}function Vh(i){if(!i.const)return;let Ae=i.id?.name;if(!Ae)return;let Ne=[];for(let _e of i.members??[]){let De=_e.initializer;if(De?.type!=="Literal")return;let Re=De.value;if(typeof Re==="string")Ne.push(JSON.stringify(Re));else if(typeof Re==="number")Ne.push(String(Re));else return}if(Ne.length===0)return;return`type ${Ae} = ${Ne.join(" | ")};`}function he(i,Ae){let Ne=Vh(Ae);if(Ne)return Ne;if(Ae.start===void 0||Ae.end===void 0)return;let _e=r(i,Ae.start,Ae.end)?.trim();return _e?`declare ${_e}`:void 0}function Q(i,Ae){let Ne=!1,_e=[];for(let Re of Ae.params??[]){if(Re.type==="RestElement"){let Ve=Re.argument?.name??"rest",Ge=x(i,Re.typeAnnotation);if(Ge)Ne=!0;P(i,Re.typeAnnotation?.typeAnnotation),_e.push(`...${Ve}: ${Ge??"any[]"}`);continue}let Ie=Re.type==="AssignmentPattern",Oe=Ie?Re.left:Re,Me=Oe?.name??"arg",Fe=x(i,Oe?.typeAnnotation);if(Fe)Ne=!0;P(i,Oe?.typeAnnotation?.typeAnnotation);let Be=Ie||Re.optional===!0;_e.push(`${Me}${Be?"?":""}: ${Fe??"any"}`)}let De=x(i,Ae.returnType);if(De)Ne=!0;return P(i,Ae.returnType?.typeAnnotation),{signature:`(${_e.join(", ")}) => ${De??"any"}`,hasAnnotations:Ne}}function ye(i){let Ae=i.pendingCallDefaultCandidates.length>0?i.pendingCallDefaultCandidates.slice():void 0,Ne=i.pendingContextKeyCandidates.length>0?i.pendingContextKeyCandidates.slice():void 0,_e={...Ae?{pendingCallDefaultCandidates:Ae}:{},...Ne?{pendingContextKeyCandidates:Ne}:{}},De=Ae!==void 0||Ne!==void 0,Re=new Set,Ie=new Set;for(let Be of i.additionalTypeDependencyNodes)c(i,Be,Re,Ie);let Oe=i.typedRunesPropsDeclarations.length===1?i.typedRunesPropsDeclarations[0]:void 0,Me=Oe?.canonicalType;if(Oe&&Me){for(let Be of Oe.referencedImportedTypes)Re.add(Be);for(let Be of Oe.referencedLocalTypes)Ie.add(Be)}if(!Me&&Re.size===0&&Ie.size===0)return De?{canonicalPropNames:[],localTypeDeclarations:[],typeImportStatements:[],..._e}:void 0;let Fe=Array.from(Ie).map((Be)=>i.localTypeDeclarationsByName.get(Be)).filter((Be)=>Be!==void 0).sort((Be,Ve)=>Be.start-Ve.start).map((Be)=>Be.code);return{...Me?{canonicalPropsType:Me}:{},canonicalPropNames:Oe&&Me?Array.from(Oe.props.keys()).sort():[],localTypeDeclarations:Fe,typeImportStatements:jh(i,Re),referencesComponentGenerics:Me?Fh(Me,i.generics):!1,..._e}}var Wh=/^[A-Za-z_$][\w$]*/,qh=/[A-Za-z_$][\w$]*/g,fl=/^(?:const|in|out)\s+/;function gn(i){let Ae=[],Ne=0,_e=0;for(let De=0;De<i.length;De++){let Re=i[De];if(Re==="<"||Re==="("||Re==="["||Re==="{")Ne++;else if(Re===">"||Re===")"||Re==="]"||Re==="}")Ne=Math.max(Ne-1,0);else if(Re===","&&Ne===0)Ae.push(i.slice(_e,De)),_e=De+1}return Ae.push(i.slice(_e)),Ae}function ge(i){let Ae=gn(i).map((_e)=>_e.trim()).filter((_e)=>_e.length>0);if(Ae.length===0)return null;return[Ae.map((_e)=>{let De=_e;while(fl.test(De))De=De.replace(fl,"");return De.match(Wh)?.[0]??_e}).join(", "),Ae.join(", ")]}function xe(i,Ae,Ne){let _e=i.scriptGenericsAttribute?.value;if(!_e)return;for(let[De]of _e.matchAll(qh)){if(i.typeImportBindingsByLocalName.has(De))Ae.add(De);if(Ne.has(De))continue;let Re=i.localTypeDeclarationsByName.get(De);if(!Re)continue;Ne.add(De),c(i,Re.node,Ae,Ne)}}var Gh=null;function Uh(i,Ae,Ne){let _e={value:void 0,replace:!1};if(!Ne||typeof Ne!=="object"||!("type"in Ne))return _e;if(Ne.type==="Identifier")_e.value=Ne.name,_e.replace=!0;else if(Ne.type==="Literal")_e.value=String(Ne.value);else if(Ne.type==="MemberExpression")_e.value=B(i,Ae,Ne);else if((Ne.type==="ObjectExpression"||Ne.type==="TemplateLiteral")&&"start"in Ne&&"end"in Ne&&typeof Ne.start==="number"&&typeof Ne.end==="number")_e.value=r(i,Ne.start,Ne.end);return _e}function Hh(i,Ae,Ne){if(!s(Ne))return null;let _e=wr(i,Ne.name);if(wn(_e))return Y(i,Ae,_e).slot_props;let De=Ae.findVariableTypeAndDescription(Ne.name);if(!De)return null;let Re=hs(De.type);if(!Re)return null;let Ie={};for(let Oe of Re)Ie[Oe.name]={value:Oe.type,replace:!1};return Ie}function Y(i,Ae,Ne){let _e={},De=!1;for(let Re of Ne.properties){if(Re.type==="SpreadElement"){let Oe=Hh(i,Ae,Re.argument);if(Oe)Object.assign(_e,Oe);else De=!0,n(i,"spread-unresolved","slot_props",`Slot props spread a value sveld can't resolve; its shape is widened to "Record<string, any>".`,t(i,Re));continue}if(Re.type!=="Property"||Re.computed)continue;let Ie=Ae.getPropertyName(Re.key);if(!Ie)continue;_e[Ie]=Uh(i,Ae,Re.value)}return{slot_props:_e,hasUnresolvedSpread:De}}function Kh(i,Ae){if(!Ae||typeof Ae!=="object"||!("type"in Ae))return null;if(Ae.type==="Identifier"){let Re=Ae,Ie=i.propLocalToPublicName.get(Re.name);if(!Ie)return null;return{publicName:Ie,trackingName:Re.name}}if(Ae.type!=="MemberExpression")return null;let Ne=Ae,_e=Ne.object&&typeof Ne.object==="object"&&"type"in Ne.object&&Ne.object.type==="Identifier"?Ne.object.name:void 0;if(!_e||!i.wholePropsLocals.has(_e))return null;let De;if(!Ne.computed&&Ne.property&&typeof Ne.property==="object"&&"type"in Ne.property){if(Ne.property.type==="Identifier")De=Ne.property.name;else if(Ne.property.type==="Literal"&&Ne.property.value!=null)De=String(Ne.property.value)}else if(Ne.computed&&Ne.property&&typeof Ne.property==="object"&&"type"in Ne.property&&Ne.property.type==="Literal"&&"value"in Ne.property&&Ne.property.value!=null)De=String(Ne.property.value);if(!De)return null;return{publicName:De,trackingName:De}}function Te(i,Ae){let Ne=Ae;if(Ne&&typeof Ne==="object"&&"type"in Ne&&Ne.type==="ChainExpression")Ne=Ne.expression;if(!Ne||typeof Ne!=="object"||!("type"in Ne)||Ne.type!=="CallExpression")return null;let _e=Ne;if(!_e.callee||typeof _e.callee!=="object"||!("type"in _e.callee))return null;let De=Kh(i,_e.callee);if(!De)return null;return{...De,arguments:_e.arguments}}function L(i,{slot_name:Ae,slot_props:Ne,slot_props_unresolved_spread:_e,slot_fallback:De,slot_description:Re,slot_deprecated:Ie,slot_tags:Oe,slot_internal:Me,source:Fe}){let Be=Ae===void 0||Ae==="",Ve=Be?Gh:Ae??"",Ge=u(De),Ue=Ne===void 0||Ne===""?void 0:Ne,Xe=Re?.trim()||void 0;if(i.slots.has(Ve)){let ze=i.slots.get(Ve);if(ze)i.slots.set(Ve,{...ze,default:ze.default??Be,fallback:Ge,slot_props:ze.slot_props===void 0?Ue:ze.slot_props,slot_props_unresolved_spread:ze.slot_props_unresolved_spread||_e,description:ze.description||Xe,deprecated:ze.deprecated??Ie,tags:ze.tags||Oe,...ze.internal||Me?{internal:!0}:{},source:Fe||ze.source})}else i.slots.set(Ve,{name:Ve,default:Be,fallback:Ge,slot_props:Ue,slot_props_unresolved_spread:_e,description:Xe,deprecated:Ie,tags:Oe,...Me?{internal:!0}:{},source:Fe})}var Xi=/^\s+/,ml=/\s/,zh=/^@[^\s/]+(?=\s|$)/,Xh=/^@(\S+)\s*/;function hl(i){let Ae=0;while(Ae<i.length){let Ne=i.charCodeAt(Ae);if(Ne!==32&&Ne!==9&&Ne!==13&&Ne!==10&&!ml.test(i[Ae]))break;Ae++}return Ae}function Jh(i,Ae){let Ne=i.slice(hl(i)),_e=!1;if(Ae)Ne=Ne.slice(3),_e=!0;else if(Ne.startsWith("*")&&!Ne.startsWith("*/"))Ne=Ne.slice(1),_e=!0;let De=Ne.slice(0,hl(Ne));Ne=Ne.slice(De.length);let Re=Ne.trimEnd(),Ie=Re.endsWith("*/")?Re.slice(0,-2):Ne;return{indent:_e?De.slice(1):De,separator:De,content:Ie}}function Yh(i,Ae,Ne){let _e=Ne>Ae&&i.charCodeAt(Ne-1)===13?Ne-1:Ne;return i.slice(Ae,_e)}function Qh(i){let Ae=[],Ne=0;while(!0){let _e=i.indexOf("/**",Ne);if(_e===-1)break;let De=i.lastIndexOf(`
|
|
26
|
-
`,_e-1)+1;if(i.charCodeAt(_e+3)===42||i.slice(De,_e).trim()!==""){Ne=_e+1;continue}let Re=[],Ie=De,Oe=!1,Me=0;while(Ie<=i.length){let Fe=i.indexOf(`
|
|
27
|
-
`,Ie),Be=Fe===-1?i.length:Fe,Ve=Yh(i,Ie,Be),{indent:Ge,separator:Ue,content:Xe}=Jh(Ve,Re.length===0);Re.push({raw:Ve,start:Ie,number:Re.length,indent:Ge,separator:Ue,content:Xe});let ze=Ve.trimEnd();if(ze.endsWith("*/")){Oe=!0,Me=Ie+ze.length,Ne=Be;break}if(Fe===-1)break;Ie=Fe+1}if(!Oe)break;Ae.push({start:_e,end:Me,lines:Re})}return Ae}function Zh(i){let Ae=i;if(Ae.length>0&&Ae[0].content==="")Ae=Ae.slice(1);if(Ae.length>0&&Ae[Ae.length-1].content==="")Ae=Ae.slice(0,-1);return Ae}function em(i){let Ae=[[]],Ne=!1;for(let _e of i){if(zh.test(_e.content)&&!Ne)Ae.push([_e]);else Ae[Ae.length-1].push(_e);if(tm(_e.content,"```")%2===1)Ne=!Ne}return Ae}function tm(i,Ae){let Ne=0,_e=i.indexOf(Ae);while(_e!==-1)Ne++,_e=i.indexOf(Ae,_e+Ae.length);return Ne}function yl(i){return i.map((Ae)=>Ae.indent+Ae.content).join(`
|
|
28
|
-
`)}function nm(i,Ae){let Ne=Ae;while(Ne<i.length-1&&i[Ne].content.trim()==="")Ne++;if(i[Ne].content[0]!=="{")return null;let _e=0,De=[],Re=Ne;for(;Re<i.length;Re++){let Me=i[Re].content,Fe=0;for(let Be of Me){if(Be==="{")_e++;else if(Be==="}")_e--;if(Fe++,_e===0)break}if(De.push(Fe),_e===0)break}if(_e!==0)return null;let Ie=Re;return{type:De.map((Me,Fe)=>{let Be=Ne+Fe,Ve=i[Be].content.slice(0,Me);return i[Be].content=i[Be].content.slice(Me).replace(Xi,""),Fe===0?Ve:i[Be].indent+Ve}).join(`
|
|
29
|
-
`).slice(1,-1),endIndex:Ie}}function rm(i){let Ae=i.content.match(Xi)?.[0]??"",Ne=i.content.slice(Ae.length),_e=0,De=0;for(let Fe of Ne){if(_e===0&&ml.test(Fe))break;if(Fe==="[")_e++;if(Fe==="]")_e--;De++}let Re=_e===0?Ne.slice(0,De):"";if(!Re)return null;let Ie=Re,Oe=!1,Me;if(Re.startsWith("[")&&Re.endsWith("]")){Oe=!0;let Be=Re.slice(1,-1).split("=");if(Ie=Be[0].trim(),Be.length>1)Me=Be.slice(1).join("=").trim();if(!Ie)return null}if(Ie.length>1&&(Ie[0]==='"'||Ie[0]==="'")&&Ie[Ie.length-1]===Ie[0])Ie=Ie.slice(1,-1);return i.content=Ne.slice(De).replace(Xi,""),{name:Ie,optional:Oe,default:Me}}function sm(i){let Ae=i[0],Ne=Ae.content.match(Xh),_e=Ne?Ne[1]:"",De=Ne?Ae.content.slice(Ne[0].length):Ae.content,Re=De.trimEnd(),Ie=i.slice(1).map((Ue)=>Ue.separator+Ue.content),Oe=(Re?[Re,...Ie]:Ie).join(`
|
|
30
|
-
`);Ae.content=De,Ae.tag=_e;let Me=nm(i,0),Fe=Me?.type??"",Be=0;if(Me){Be=Me.endIndex;while(Be<i.length-1&&i[Be].content.trim()==="")Be++}let Ve=rm(i[Be]),Ge=yl(i.slice(Me?Me.endIndex:0));return{tag:_e,name:Ve?.name??"",type:Fe,optional:Ve?.optional??!1,default:Ve?.default,description:Ge,raw:Oe,lines:i}}function im(i,Ae,Ne){let _e=Zh(i);_e.forEach((Ie,Oe)=>{Ie.number=Oe});let De=em(_e),Re=De.slice(1).map(sm);return{description:yl(De[0]),tags:Re,start:Ae,end:Ne,lines:_e}}function Nr(i){return Qh(i).map(({start:Ae,end:Ne,lines:_e})=>im(_e,Ae,Ne))}var om=/\s*=\s*/;function gl(i){let Ae=i.indexOf("<");if(Ae===-1||!i.endsWith(">"))return i;let Ne=i.slice(0,Ae),_e=i.slice(Ae+1,-1),De=gn(_e).map((Re)=>Re.trim().replace(om," = ")).join(", ");return`${Ne}<${De}>`}var Z=/^\s*$/,am=/;$/,cm=/^-\s*/;function Pn(i){if(i===void 0)return;let Ae=i.replace(cm,"").trim();return Ae===""?"":Ae}function zn(i){if(!i||i.length===0)return;return i[0].content}var xl=new Set(["since","example","see"]),lm=new Set(["bindable","default","required"]);function pm(i){let Ae=i.trim();return Ae===""?!0:Ae}function bl(i,Ae){return pm(`${i??""}${Ae?` ${Ae}`:""}`)}function um(i){let Ae=i.trim().replace(am,"").trimEnd();if(!Ae.startsWith("{")||!Ae.endsWith("}"))return!1;let Ne=0,_e=null;for(let De=0;De<Ae.length;De++){let Re=Ae[De];if(_e!==null){if(Re==="\\"){De++;continue}if(Re===_e)_e=null;continue}if(Re==='"'||Re==="'"||Re==="`"){_e=Re;continue}if(Re==="{"||Re==="["||Re==="(")Ne++;else if(Re==="}"||Re==="]"||Re===")"){if(Ne--,Ne===0&&De<Ae.length-1)return!1}}return Ne===0}function Ji(i){let Ae=i;if(!Ae.startsWith("/*"))Ae=`/*${Ae}`;if(!Ae.endsWith("*/"))Ae+="*/";return Ae}function dm(i){if(i==="*")return"any";return i.trim()}function El(i){let Ae=Nr(Ji(i)),{returns:Ne}=O(Ae);return Ne?dm(Ne.type):void 0}function Cl(i){let Ae=Nr(Ji(i)),{deprecated:Ne,passthrough:_e,internal:De}=O(Ae),Re=_e.length>0?_e.map((Ie)=>({name:Ie.tag,body:Ie.raw})):void 0;return{deprecated:Ne,tags:Re,internal:De}}var fm=new Set(["type","param","returns","return","extends","extendProps","restProps","slot","snippet","event","typedef","callback","bindable","deprecated","ignore","internal","csspart","cssprop","cssproperty"]);function K(i,Ae){let Ne=i.parsedJsDocByText.get(Ae);if(Ne===void 0)Ne=Nr(Ae),i.parsedJsDocByText.set(Ae,Ne);return Ne}function O(i){let Ae=i[0]?.tags??[],Ne,_e=[],De,Re,Ie,Oe=!1,Me=[],Fe=[],Be=[];for(let Ve of Ae)if(Ve.tag==="type")Ne=Ve;else if(Ve.tag==="param")_e.push(Ve);else if(Ve.tag==="returns"||Ve.tag==="return")De=Ve;else if(Ve.tag==="deprecated")Ie??=bl(Ve.name,Ve.description);else if(Ve.tag==="ignore"||Ve.tag==="internal")Oe=!0;else if(Ve.tag==="sveld-ignore")Be.push(Ve.name);else if(xl.has(Ve.tag))Fe.push(Ve);else if(Ve.tag==="bindable"){if(Ve.type)continue;let Ge=`${Ve.name}${Ve.description?` ${Ve.description}`:""}`.trim();if(Ge==="readonly"||Ge==="writable")Re??=Ge}else if(!fm.has(Ve.tag))Me.push(Ve);return{type:Ne,param:_e,returns:De,binding:Re,deprecated:Ie,internal:Oe,additional:Me,passthrough:Fe,ignore:Be,description:i[0]?.description}}function hm(i,Ae){if(typeof Ae.start!=="number"||typeof Ae.end!=="number")return;let Ne=i.jsDocBlocksByStart.get(Ae.start);if(Ne===void 0||Ne.end!==Ae.end)return;return[Ne]}function mm(i){if(!i||i.length===0)return;let Ae=i[i.length-1];return Ae&&typeof Ae==="object"&&"value"in Ae?Ae:void 0}function Sl(i,Ae,Ne){if(!Ae||Ae.length===0||Ne===void 0||!i.source)return;for(let _e=Ae.length-1;_e>=0;_e--){let De=Ae[_e];if(!De||typeof De!=="object"||!("value"in De)||!("end"in De))continue;if(typeof De.end!=="number"||!("start"in De)||typeof De.start!=="number")continue;let Re=i.source.slice(De.end,Ne);if(Z.test(Re))return De}return}function ym(i){let Ae=new Set;for(let Ne of i.funcDecls.values()){let{leadingComments:_e,start:De}=Ne,Re=Sl(i,_e,De);if(Re)Ae.add(Re.start)}return Ae}function y(i,Ae,Ne){if(!Ne?.leadingComments)return;let _e=Sl(i,Ne.leadingComments,Ne.start);if(!_e)return;return gm(i,Ae,[_e])}function Ee(i,Ae,Ne){if(!Ne?.leadingComments)return;return y(i,Ae,Ne)}function gm(i,Ae,Ne){if(!Ne)return;let _e=mm(Ne);if(!_e)return;let De=hm(i,_e)??K(i,Ji(_e.value)),{type:Re,param:Ie,returns:Oe,binding:Me,deprecated:Fe,internal:Be,additional:Ve,passthrough:Ge,ignore:Ue,description:Xe}=O(De),ze,Qe,rt,ot;if(Re)ze=Ae.aliasType(Re.type);if(Ie.length>0)Qe=Ie.filter((it)=>!it.name.includes(".")).map((it)=>({name:it.name,type:Ae.aliasType(it.type),description:Pn(it.description),optional:it.optional||!1}));if(Oe)rt=Ae.aliasType(Oe.type);let Ye=u(Xe?.trim());if(Ye||Ve.length>0){let it=[];if(Ye)it.push(Ye);for(let bt of Ve){let _t=`@${bt.tag}${bt.name?` ${bt.name}`:""}${bt.description?` ${bt.description}`:""}`;it.push(_t)}ot=it.join(`
|
|
31
|
-
`)}let nt=Ge.length>0?Ge.map((it)=>({name:it.tag,body:it.raw})):void 0;return{type:ze,params:Qe,returnType:rt,description:ot,binding:Me,deprecated:Fe,tags:nt,sveldIgnore:Ue.length>0?Ue:void 0,internal:Be}}function be(i,Ae,Ne=i.source){if(!Ne)return;let _e=!1,De=!1,Re=!1,Ie=new Set,Oe=()=>{if(_e&&De&&!Re){Re=!0;let Xe=i.componentFilePath?` in ${i.componentFilePath}`:"";console.warn(`Warning: Both @generics and @template tags are used to declare component generics${Xe}; their declarations are combined in the order encountered.`)}},Me=(Xe,ze)=>{if(Ie.has(Xe))n(i,"generics-conflict",Xe,`Duplicate generic name "${Xe}".`,ze);else Ie.add(Xe)},Fe=(Xe,ze)=>{if(i.generics){let rt=gn(i.generics[0]).map((ot)=>ot.trim()).indexOf(Xe.trim());if(rt!==-1){let ot=gn(i.generics[1]).map((Ye)=>Ye.trim());ot[rt]=ze,i.generics=[i.generics[0],ot.join(", ")];return}}Ae.accumulateGeneric(Xe,ze)},Be=(Xe,ze)=>{if(i.typedefs.has(Xe))n(i,"typedef-duplicate",Xe,`Duplicate typedef/callback name "${Xe}"; the later declaration overwrites the earlier one.`,ze)},Ve=(Xe,ze,Qe,rt)=>{let ot=Xe.findIndex((Ye)=>Ye.name===ze.name);if(ot===-1)Xe.push(ze);else{let Ye=Qe?` of "${Qe}"`:"";n(i,"property-duplicate",ze.name,`Duplicate property "${ze.name}"${Ye}; the later declaration overwrites the earlier one.`,rt),Xe[ot]=ze}},Ge=ym(i),Ue=Nr(Ne);for(let Xe of Ue)i.jsDocBlocksByStart.set(Xe.start,Xe);for(let{tags:Xe,description:ze,lines:Qe,start:rt}of Ue){let ot=Ge.has(rt),Ye,nt,it,bt,_t=!1,Dt,Le,$e=[],je=[],qe=[],He,Ke,Ze,tt,et=[],Je=!1,st=[],pt,ut,ht,yt=[],It=!1,Mt=[],jt,$t,fn=!1,Rt=!0,Vt=[],ri,Vn=!1,Ur=new Map,na=new Set,si=new Set;for(let dt of Xe)if(dt.lines.length>0)na.add(dt.lines[0].number);for(let dt of Qe)if(!dt.tag&&dt.content&&dt.content.trim()!=="}")Ur.set(dt.number,dt.content);let wu=(dt)=>{if(!dt||dt.length===0)return;let Xt=dt[0].number,mt=[],tn=[],vn=!1;for(let Tt=Xt-1;Tt>=0;Tt--){if(na.has(Tt))break;let nn=Ur.get(Tt);if(nn)mt.unshift(nn),tn.unshift(Tt),vn=!0;else if(vn){let kt=Qe[Tt];if(!(!kt||!kt.tag&&(!kt.content||kt.content.trim()==="")))break}}if(mt.length===0)return;for(let Tt of tn)si.add(Tt);return mt.join(`
|
|
32
|
-
`).trim()},ra=()=>{if(Ye!==void 0){let dt=nt&&nt!=="object"&&nt!=="Object"?nt:void 0,Xt;if(dt)Xt=dt;else if(qe.length>0)Xt=ms(qe,Ye,!0);else Xt=nt||"";if(Le!==void 0){let mt;for(let Tt of Xe){let nn=Tt.lines[0]?.number;if(typeof nn!=="number")continue;if(nn<=Le)continue;if(Tt.tag==="property"||Tt.tag==="type")continue;mt=nn;break}let tn=[],vn=Array.from(Ur.keys()).sort((Tt,nn)=>Tt-nn);for(let Tt of vn){if(Tt<=Le)continue;if(mt!==void 0&&Tt>=mt)continue;if(si.has(Tt))continue;let kt=Ur.get(Tt)?.trim();if(kt)tn.push(kt),si.add(Tt)}if(tn.length>0){let Tt=tn.join(`
|
|
33
|
-
`);it=it?`${it}
|
|
34
|
-
${Tt}`:Tt}}h(i,{name:Ye,detail:Xt,has_argument:!1,description:it,deprecated:bt,tags:$e.length>0?$e:void 0,internal:_t||void 0,source:Dt}),i.eventDescriptions.set(Ye,it),i.jsDocEventNames.add(Ye),i.jsDocEventSources.set(Ye,Dt),d(i,"event-no-source",Ye,je),qe.length=0,Ye=void 0,nt=void 0,it=void 0,bt=void 0,_t=!1,Dt=void 0,Le=void 0,$e=[],je=[]}},sa=()=>{if(He!==void 0){let dt,Xt;if(st.length>0)dt=ms(st,void 0,!0),Xt=`type ${He} = ${dt};`;else if(Ke)dt=Ke,Xt=um(dt)?`interface ${He} ${dt}`:`type ${He} = ${dt};`;else dt="{}",Xt=`type ${He} = ${dt};`;Be(He,tt),i.typedefs.set(He,{type:dt,name:He,description:u(Ze),ts:Xt,tags:et.length>0?et:void 0,...Je?{internal:!0}:{},source:tt}),st.length=0,He=void 0,Ke=void 0,Ze=void 0,tt=void 0,et=[],Je=!1}},ia=()=>{if(pt!==void 0){let mt=`(${Mt.map(({name:vn,type:Tt,optional:nn})=>`${vn}${nn?"?":""}: ${Tt}`).join(", ")}) => ${jt||"void"}`,tn=`type ${pt} = ${mt};`;Be(pt,ht),i.typedefs.set(pt,{type:mt,name:pt,description:u(ut),ts:tn,tags:yt.length>0?yt:void 0,...It?{internal:!0}:{},source:ht}),Mt.length=0,jt=void 0,pt=void 0,ut=void 0,ht=void 0,yt=[],It=!1}},Pu=Xe.some((dt)=>dt.tag==="slot"||dt.tag==="snippet"),Nu=Xe.some((dt)=>dt.tag==="extends"||dt.tag==="extendProps"),_u=Xe.some((dt)=>dt.tag==="slot"||dt.tag==="snippet"||dt.tag==="event"||dt.tag==="typedef"||dt.tag==="callback");for(let{tag:dt,type:Xt,name:mt,description:tn,optional:vn,default:Tt,raw:nn,lines:kt}of Xe){let Gt=Ae.aliasType(Xt),yr=wu(kt);switch(dt){case"extends":case"extendProps":if(i.extends!==void 0)n(i,"extend-props-duplicate",mt,`A second @extends/@extendProps tag ("${mt}") overwrote the first ("${i.extends.interface}"); only one is used.`,un(i,kt));if(i.extends={interface:mt,import:Gt},Rt)Rt=!1;break;case"restProps":{let At=mt?tn?`${mt} ${tn}`:mt:tn,Rn=Pn(At)||yr;if(!Rn&&Rt&&!fn&&ze)Rn=ze,fn=!0;if(i.rest_props={type:"Element",name:Gt,description:Rn||void 0},Rt)Rt=!1;break}case"slot":case"snippet":{let Jt=Pn(zn(kt));if(!Jt&&Rt&&!fn&&ze)Jt=ze,fn=!0;if(!Jt&&Vt.length===0)Jt=yr;if(Rt)Rt=!1;let Rn=Gt;if(!Rn)Rn="Record<string, never>",n(i,"slot-missing-type",mt||"default",`@${dt}${mt?` "${mt}"`:""} is missing a required {Type} annotation; falling back to "${Rn}".`,un(i,kt));L(i,{slot_name:mt,slot_props:Rn,slot_description:Jt||void 0,slot_deprecated:ri,slot_tags:Vt.length>0?[...Vt]:void 0,slot_internal:Vn||void 0,source:un(i,kt)}),Vt.length=0,ri=void 0,Vn=!1;{let Du=mt===void 0||mt===""?null:mt;$t=(Iu)=>{let ii=i.slots.get(Du);if(ii)ii.tags=[...ii.tags??[],Iu]}}break}case"csspart":{let At=Pn(zn(kt));i.cssParts.push({name:mt,...At?{description:At}:{}});break}case"cssprop":case"cssproperty":{let At=Pn(zn(kt));i.cssProperties.push({name:mt,...Gt?{type:Gt}:{},...Tt===void 0?{}:{default:Tt},...At?{description:At}:{}});break}case"event":{if(ra(),Ye=mt,nt=Gt,Le=kt.length>0?kt[0].number:void 0,it=Pn(zn(kt))||yr,!it&&Rt&&!fn&&ze)it=ze,fn=!0;if(Dt=un(i,kt),Vt.length>0)$e.push(...Vt),Vt.length=0;if($t=(Jt)=>$e.push(Jt),Rt)Rt=!1;break}case"type":if(Ye!==void 0)nt=Gt;break;case"param":if(pt!==void 0)Mt.push({name:mt,type:Gt,optional:vn||!1});break;case"returns":case"return":if(pt!==void 0)jt=Gt;break;case"property":{let At={name:mt,type:Gt,description:Pn(zn(kt)),optional:vn||!1,default:Tt};if(Ye!==void 0)Ve(qe,At,Ye,un(i,kt));else if(He!==void 0)Ve(st,At,He,un(i,kt));break}case"typedef":{if(sa(),He=gl(mt),Ke=Gt,tt=un(i,kt),Ze=Pn(zn(kt))||yr,!Ze&&Rt&&!fn&&ze)Ze=ze,fn=!0;if(Vt.length>0)et.push(...Vt),Vt.length=0;if(Je=Vn,Vn=!1,$t=(Jt)=>et.push(Jt),Rt)Rt=!1;break}case"callback":{if(ia(),pt=gl(mt),ht=un(i,kt),ut=Pn(zn(kt))||yr,!ut&&Rt&&!fn&&ze)ut=ze,fn=!0;if(Vt.length>0)yt.push(...Vt),Vt.length=0;if(It=Vn,Vn=!1,$t=(Jt)=>yt.push(Jt),Rt)Rt=!1;break}case"generics":{let At=Gt||mt;for(let Jt of gn(mt))Me(Jt.trim(),un(i,kt));if(_e=!0,Oe(),Fe(mt,At),Rt)Rt=!1;break}case"template":{let At=mt;if(Gt)At=`${mt} extends ${Gt}`;if(Tt)At+=` = ${Tt}`;if(Pu&&!Nu){i.deferredSlotBlockGenerics.push({name:mt,constraint:At});break}if(ot)break;if(Me(mt,un(i,kt)),De=!0,Oe(),Fe(mt,At),Rt)Rt=!1;break}case"deprecated":{let At=bl(mt,tn);if(Ye===void 0)ri??=At;else bt??=At;break}case"ignore":case"internal":{if(Ye===void 0)Vn=!0;else _t=!0;break}case"sveld-ignore":if(Ye!==void 0)je.push(mt);break;case"enum":case"class":case"implements":case"this":case"namespace":case"memberof":case"module":case"file":case"overview":break;default:{let At={name:dt,body:nn};if(!xl.has(dt)&&!lm.has(dt))n(i,"jsdoc-unknown-tag",dt,`Unknown JSDoc tag "@${dt}"; passed through unchanged. If this is a typo, fix the tag name.`,un(i,kt));if($t)$t(At);else Vt.push(At)}break}}if(ra(),sa(),ia(),_u&&Vt.length>0){for(let dt of Vt)n(i,"jsdoc-tag-dropped",dt.name,`@${dt.name} could not attach to a @slot/@snippet/@event/@typedef/@callback tag in the same comment block and was dropped.`);Vt.length=0}}}function ee(i){return i==="TSTypeAnnotation"||i==="TSTypeAliasDeclaration"||i==="TSInterfaceDeclaration"||i==="TSTypeParameterDeclaration"||i==="TSTypeParameterInstantiation"}function v(i,Ae,Ne,_e){Yi(i,null,null,Ae,Ne,_e?.skipTypeOnlySubtrees===!0)}function Yi(i,Ae,Ne,_e,De,Re){_e(i,Ae,Ne);let Ie=i.type;if((Ie==="Identifier"||Ie==="Literal"||Ie==="Text")&&i.typeAnnotation===void 0){if(De)De(i);return}if(Re&&Ie.charCodeAt(0)===84&&ee(Ie)){if(De)De(i);return}for(let Oe in i){if(Oe==="leadingComments")continue;let Me=i[Oe];if(!Me||typeof Me!=="object")continue;if(Array.isArray(Me))for(let Fe=0;Fe<Me.length;Fe++){let Be=Me[Fe];if(Be&&typeof Be==="object"&&typeof Be.type==="string")Yi(Be,i,Oe,_e,De,Re)}else if(typeof Me.type==="string")Yi(Me,i,Oe,_e,De,Re)}if(De)De(i)}import vl,{sep as Qi}from"node:path";var xn=/\.svelte$/,Tl=/\.(?:svelte|[mc]?ts|[mc]?js)$/;function ys(i){if(!i.endsWith(".svelte"))return!1;let Ae=i.length-7;if(Ae===0)return!1;let Ne=i.charCodeAt(Ae-1);return Ne!==47&&(Qi==="/"||Ne!==92)}function e(i){return Qi==="/"?i:i.split(Qi).join("/")}function gs(i,Ae){return e(vl.join(Ae,vl.normalize(i)))}function Xn(i){return`${JSON.stringify(i,null,2)}
|
|
35
|
-
`}var kl="sveld",xs="0.37.3";var Al={name:kl,version:xs,license:"Apache-2.0",description:"Generate TypeScript definitions and component documentation for your Svelte components.",type:"module",main:"./lib/index.js",types:"./lib/index.d.ts",exports:{".":{types:"./lib/index.d.ts",import:"./lib/index.js",default:"./lib/index.js"},"./browser":{types:"./lib/browser.d.ts",import:"./lib/browser.js",default:"./lib/browser.js"},"./schema/component-api.schema.json":"./schema/component-api.schema.json"},scripts:{test:"bun test --parallel","test:fixtures-types":"tsc --project tsconfig.fixtures.json","test:e2e":"bun tests/test-e2e.ts",format:"biome format --write .",lint:"biome lint .","lint:fix":"biome check --write --unsafe .","lint:fix:changed":"biome check --write --unsafe --changed --no-errors-on-unmatched",build:"bun scripts/build.ts",bench:"bun scripts/bench.ts","bench:cache":"bun scripts/bench.ts --cache","bench:ostia":"ostia bench scripts/bench-ostia.ts",fuzz:"bun scripts/fuzz-parser.ts",typecheck:"tsc --noEmit"},devDependencies:{"@biomejs/biome":"2.5.14","@sveltejs/acorn-typescript":"1.0.13","@types/bun":"^1.4.2","@types/jest":"^30.0.0","@typescript/typescript6":"^6.0.2",acorn:"^8.18.0",ajv:"^8.20.0",culls:"^0.2.0","custom-elements-manifest":"^2.1.0",ostia:"0.2.5",svelte:"^5.57.0",typescript:"^7.0.2"},bin:{sveld:"cli.js"},files:["lib","cli.js","schema"],repository:{type:"git",url:"git+https://github.com/carbon-design-system/sveld.git"},homepage:"https://github.com/carbon-design-system/sveld",bugs:"https://github.com/carbon-design-system/sveld/issues",keywords:["svelte","svelte component","documentation","docgen","typescript","definitions","JSDocs","vite","vite-plugin"],maintainers:["Eric Liu (https://github.com/metonym)"]};var _r="5.57.0";var bs=1,wl=new WeakMap;function Bn(i){return i.some((Ae)=>Ae.internal)?i.filter((Ae)=>!Ae.internal):i}function bm(i){return{...i,props:Bn(i.props),moduleExports:Bn(i.moduleExports),slots:Bn(i.slots),events:Bn(i.events),typedefs:Bn(i.typedefs),...i.contexts?{contexts:Bn(i.contexts).map((Ae)=>({...Ae,properties:Bn(Ae.properties)}))}:{}}}function o(i,Ae={}){let Ne=wl.get(i),_e=Ne?.get(Ae.entryExports);if(_e)return _e;let De=Array.from(i,([,Oe])=>{let{diagnostics:Me,...Fe}=Oe;return bm(Fe)}).sort((Oe,Me)=>Oe.moduleName.localeCompare(Me.moduleName)),Re={schemaVersion:bs,generator:{name:kl,version:xs,svelteVersion:_r},total:De.length,components:De},Ie=Ae.entryExports?Bn(Ae.entryExports):void 0;if(Ie&&Ie.length>0)Re.totalExports=Ie.length,Re.exports=Ie;if(!Ne)Ne=new Map,wl.set(i,Ne);return Ne.set(Ae.entryExports,Re),Re}import{readFile as Em}from"node:fs/promises";import Cm from"node:path";var Sm=/[:=]/,Es={none:0,patch:1,minor:2,major:3};function vm(i,Ae){return Es[Ae]>Es[i]?Ae:i}function Tm(i){return i.reduce((Ae,Ne)=>vm(Ae,Ne.bump),"none")}function Ss(i,Ae){return Es[i]>=Es[Ae]}function Rl(i,Ae){let Ne=[],_e=0,De="",Re=null;for(let Ie=0;Ie<i.length;Ie++){let Oe=i[Ie];if(Re){if(De+=Oe,Oe==="\\")Ie++,De+=i[Ie]??"";else if(Oe===Re)Re=null;continue}if(Oe==='"'||Oe==="'"||Oe==="`"){Re=Oe,De+=Oe;continue}if(Oe==="<"||Oe==="("||Oe==="{"||Oe==="[")_e++;if(Oe===">"||Oe===")"||Oe==="}"||Oe==="]")_e--;if(Oe===Ae&&_e===0){Ne.push(De.trim()),De="";continue}De+=Oe}return Ne.push(De.trim()),Ne}function Pl(i){return new Set(Rl(i,"|").filter((Ae)=>Ae.length>0))}function km(i){let Ae=0,Ne=null;for(let _e=0;_e<i.length;_e++){let De=i[_e];if(Ne){if(De==="\\")_e++;else if(De===Ne)Ne=null;continue}if(De==='"'||De==="'"||De==="`"){Ne=De;continue}if(De==="<"||De==="("||De==="{"||De==="[")Ae++;if(De===">"||De===")"||De==="}"||De==="]")Ae--;if(Ae===0&&De==="="&&i[_e+1]===">")return _e}return-1}function Nl(i){let Ae=km(i);if(Ae===-1)return;let Ne=i.slice(0,Ae).trim(),_e=i.slice(Ae+2).trim();if(!Ne.startsWith("(")||!Ne.endsWith(")"))return;let De=Ne.slice(1,-1).trim();return{params:De.length===0?[]:Rl(De,","),returnType:_e}}function Am(i){return(i.split(Sm,1)[0]??"").trimEnd().endsWith("?")}function wm(i,Ae){if(i.returnType!==Ae.returnType)return"major";if(Ae.params.length<i.params.length)return"major";for(let _e=0;_e<i.params.length;_e++)if(i.params[_e]!==Ae.params[_e])return"major";if(Ae.params.length===i.params.length)return"none";return Ae.params.slice(i.params.length).every(Am)?"minor":"major"}function eo(i,Ae){if(i===Ae)return"none";if(i===void 0||Ae===void 0)return"major";let Ne=Nl(i),_e=Nl(Ae);if(Ne&&_e)return wm(Ne,_e);let De=Pl(i),Re=Pl(Ae),Ie=[...Re].some((Me)=>!De.has(Me)),Oe=[...De].some((Me)=>!Re.has(Me));if(!Ie&&!Oe)return"none";if(Ie&&!Oe)return"minor";if(Oe&&!Ie)return"major";return"major"}function _l(i){return i.bindable===!0||i.binding==="writable"}function Dl(i,Ae,Ne,_e){let De=Ae==="prop"?"prop":"export",Re=[],Ie=new Map(Ne.map((Me)=>[Me.name,Me])),Oe=new Map(_e.map((Me)=>[Me.name,Me]));for(let[Me,Fe]of Oe){if(Ie.has(Me))continue;Re.push({component:i,kind:Ae,name:Me,bump:Fe.isRequired?"major":"minor",message:`${De} "${Me}" added${Fe.isRequired?" (required)":""}`})}for(let[Me]of Ie){if(Oe.has(Me))continue;Re.push({component:i,kind:Ae,name:Me,bump:"major",message:`${De} "${Me}" removed`})}for(let[Me,Fe]of Ie){let Be=Oe.get(Me);if(!Be)continue;if(Fe.isRequired!==Be.isRequired)Re.push({component:i,kind:Ae,name:Me,bump:Be.isRequired?"major":"minor",message:`${De} "${Me}" became ${Be.isRequired?"required":"optional"}`});let Ve=eo(Fe.type,Be.type);if(Ve!=="none")Re.push({component:i,kind:Ae,name:Me,bump:Ve,message:`${De} "${Me}" type changed from \`${Fe.type??"unknown"}\` to \`${Be.type??"unknown"}\``});let Ge=_l(Fe),Ue=_l(Be);if(Ge!==Ue)Re.push({component:i,kind:Ae,name:Me,bump:Ue?"minor":"major",message:`${De} "${Me}" ${Ue?"gained a writable binding":"lost its writable binding"}`});if(Fe.value!==Be.value&&Ve==="none")Re.push({component:i,kind:Ae,name:Me,bump:"patch",message:`${De} "${Me}" default changed from \`${Fe.value??"none"}\` to \`${Be.value??"none"}\``});let Xe=Fe.deprecated!==void 0,ze=Be.deprecated!==void 0;if(Xe!==ze)Re.push({component:i,kind:Ae,name:Me,bump:ze?"minor":"patch",message:`${De} "${Me}" ${ze?"marked as deprecated":"no longer deprecated"}`});if(Fe.constant!==Be.constant)Re.push({component:i,kind:Ae,name:Me,bump:"minor",message:`${De} "${Me}" ${Be.constant?"became constant":"became mutable"}`});if(Fe.reactive!==Be.reactive)Re.push({component:i,kind:Ae,name:Me,bump:"minor",message:`${De} "${Me}" ${Be.reactive?"became reactive":"stopped being reactive"}`})}return Re}function Pm(i,Ae,Ne){let _e=[],De=new Map(Ae.map((Ie)=>[Ie.name,Ie])),Re=new Map(Ne.map((Ie)=>[Ie.name,Ie]));for(let[Ie]of Re){if(De.has(Ie))continue;_e.push({component:i,kind:"event",name:Ie,bump:"minor",message:`event "${Ie}" added`})}for(let[Ie]of De){if(Re.has(Ie))continue;_e.push({component:i,kind:"event",name:Ie,bump:"major",message:`event "${Ie}" removed`})}for(let[Ie,Oe]of De){let Me=Re.get(Ie);if(!Me)continue;if(Oe.type!==Me.type){_e.push({component:i,kind:"event",name:Ie,bump:"major",message:`event "${Ie}" changed from ${Oe.type} to ${Me.type}`});continue}let Fe=Oe.type==="dispatched"?Oe.detail:void 0,Be=Me.type==="dispatched"?Me.detail:void 0,Ve=eo(Fe,Be);if(Ve!=="none")_e.push({component:i,kind:"event",name:Ie,bump:Ve,message:`event "${Ie}" detail changed from \`${Fe??"unknown"}\` to \`${Be??"unknown"}\``})}return _e}function Il(i){return i.name??"default"}function Nm(i,Ae,Ne){let _e=[],De=new Map(Ae.map((Ie)=>[Il(Ie),Ie])),Re=new Map(Ne.map((Ie)=>[Il(Ie),Ie]));for(let[Ie]of Re){if(De.has(Ie))continue;_e.push({component:i,kind:"slot",name:Ie,bump:"minor",message:`slot "${Ie}" added`})}for(let[Ie]of De){if(Re.has(Ie))continue;_e.push({component:i,kind:"slot",name:Ie,bump:"major",message:`slot "${Ie}" removed`})}for(let[Ie,Oe]of De){let Me=Re.get(Ie);if(!Me)continue;let Fe=eo(Oe.slot_props,Me.slot_props);if(Fe!=="none")_e.push({component:i,kind:"slot",name:Ie,bump:Fe,message:`slot "${Ie}" props changed from \`${Oe.slot_props??"none"}\` to \`${Me.slot_props??"none"}\``})}return _e}var _m=new Set(["description","source","componentCommentSource","tags"]);function Cs(i){if(Array.isArray(i))return i.map(Cs);if(i!==null&&typeof i==="object"){let Ae={};for(let[Ne,_e]of Object.entries(i)){if(_m.has(Ne))continue;Ae[Ne]=Cs(_e)}return Ae}return i}var Dm=["generics","rest_props","extends","contexts","typedefs"];function Im(i,Ae,Ne){let _e=[];for(let De of Dm){let Re=JSON.stringify(Cs(Ae[De])),Ie=JSON.stringify(Cs(Ne[De]));if(Re!==Ie)_e.push({component:i,kind:"shape",name:De,bump:"major",message:`"${De}" changed (breaking)`})}return _e}function Rm(i,Ae){let Ne=Ae.moduleName;return[...Dl(Ne,"prop",i.props,Ae.props),...Dl(Ne,"moduleExport",i.moduleExports,Ae.moduleExports),...Pm(Ne,i.events,Ae.events),...Nm(Ne,i.slots,Ae.slots),...Im(Ne,i,Ae)]}function Se(i,Ae){let Ne=[],_e=new Map(i.components.map((Re)=>[Re.moduleName,Re])),De=new Map(Ae.components.map((Re)=>[Re.moduleName,Re]));for(let[Re]of De){if(_e.has(Re))continue;Ne.push({component:Re,kind:"component",bump:"minor",message:`component "${Re}" added`})}for(let[Re]of _e){if(De.has(Re))continue;Ne.push({component:Re,kind:"component",bump:"major",message:`component "${Re}" removed`})}for(let[Re,Ie]of _e){let Oe=De.get(Re);if(!Oe)continue;Ne.push(...Rm(Ie,Oe))}return Ne}async function Lm(i){let Ae;try{Ae=await Em(Cm.resolve(i),"utf-8")}catch(Ne){if(Ne.code==="ENOENT")return null;throw Ne}try{return JSON.parse(Ae)}catch{throw Error(`sveld: could not parse "${i}" as JSON. Is it a sveld COMPONENT_API.json snapshot?`)}}function W(i){if(typeof i.check==="string")return i.check;return i.jsonOptions?.outFile??"COMPONENT_API.json"}async function M(i,Ae,Ne={}){let _e=await Lm(Ae);if(_e===null)return{snapshotExists:!1,snapshotFile:Ae,changes:[],bump:"none"};if(_e.schemaVersion!==bs)return{snapshotExists:!0,snapshotFile:Ae,changes:[{component:"*",kind:"schema",bump:"none",message:`snapshot schemaVersion ${_e.schemaVersion} differs from ${bs}; regenerate the snapshot`}],bump:"none"};let De=o(i,{entryExports:Ne.entryExports}),Re=Se(_e,De);return{snapshotExists:!0,snapshotFile:Ae,changes:Re,bump:Tm(Re)}}var Om={major:"BREAKING",minor:"additive",patch:"patch",none:"no change"};function te(i){if(!i.snapshotExists)return`sveld --check: no snapshot found at "${i.snapshotFile}". Run \`sveld --json\` and commit the output first.`;if(i.changes.length===0)return`sveld --check: no API changes detected against "${i.snapshotFile}".`;let Ae=[],Ne=i.changes.length;Ae.push(`sveld --check: ${Ne} API change${Ne===1?"":"s"} detected against "${i.snapshotFile}".`),Ae.push(`Suggested semver bump: ${i.bump}.`);let _e=new Map;for(let De of i.changes){let Re=_e.get(De.component)??[];Re.push(De),_e.set(De.component,Re)}for(let[De,Re]of _e){Ae.push(""),Ae.push(` ${De}`);for(let Ie of Re){let Oe=Ie.kind==="schema"?"schema":Om[Ie.bump];Ae.push(` [${Oe}] ${Ie.message}`)}}return Ae.join(`
|
|
36
|
-
`)}var ke=1;function re(i){let Ae={kind:"check-report",schemaVersion:ke,...i};return Xn(Ae)}import{existsSync as $m}from"node:fs";import{join as Bm}from"node:path";import{pathToFileURL as Fm}from"node:url";function Mm(i,Ae){let Ne=i.length+1,_e=Ae.length+1,De=Array.from({length:Ne},()=>Array(_e).fill(0));for(let Re=0;Re<Ne;Re++)De[Re][0]=Re;for(let Re=0;Re<_e;Re++)De[0][Re]=Re;for(let Re=1;Re<Ne;Re++)for(let Ie=1;Ie<_e;Ie++){let Oe=i[Re-1]===Ae[Ie-1]?0:1;De[Re][Ie]=Math.min(De[Re-1][Ie]+1,De[Re][Ie-1]+1,De[Re-1][Ie-1]+Oe)}return De[Ne-1][_e-1]}function vs(i,Ae){let Ne,_e=Number.POSITIVE_INFINITY;for(let De of Ae){let Re=Mm(i,De);if(Re<_e)Ne=De,_e=Re}if(Ne===void 0||_e>3)return;return Ne}var jm=["sveld.config.js","sveld.config.mjs","sveld.config.ts"];function Pe(i){return i}function Vm(i=process.cwd()){for(let Ae of jm){let Ne=Bm(i,Ae);if($m(Ne))return Ne}return null}async function to(i){let Ae;try{Ae=await import(`${Fm(i).href}?t=${Date.now()}`)}catch(_e){let De=_e instanceof Error?_e.message:String(_e);throw Error(`sveld: failed to load config file "${i}".
|
|
37
|
-
${De}`)}let Ne=Ae.default;if(!Nt(Ne)||Array.isArray(Ne))throw Error(`sveld: config file "${i}" must export a configuration object as its default export. Did you forget \`export default defineConfig({ ... })\`?`);return Ne}async function _(i=process.cwd()){let Ae=Vm(i);if(Ae===null)return{};return to(Ae)}function E(...i){let Ae={};for(let Ne of i){if(!Ne)continue;for(let[_e,De]of Object.entries(Ne)){let Re=Ae[_e];Ae[_e]=Nt(Re)&&!Array.isArray(Re)&&Nt(De)&&!Array.isArray(De)?{...Re,...De}:De}}return Ae}var Wm={ci:{strict:!0,reportDiagnostics:!0,check:!0,checkExamples:!0},local:{reportDiagnostics:!0}};function H(i){let{strict:Ae,...Ne}=i;if(Ae!=="ci"&&Ae!=="local")return i;return{...Wm[Ae],...Ne}}var Ll=["entry","glob","quiet","documentExports","types","typesOptions","json","jsonOptions","markdown","markdownOptions","customElements","customElementsOptions","llms","llmsOptions","additionalWriters","failFast","watch","config","resolveTypes","cache","checkExamples","reportDiagnostics","strict","check","checkLevel","stdout","format","dryRun","diagnostics"],qm={typesOptions:["outDir","preamble","format","exportTypes","typeNames","comments","propsDeclaration","transform","indexTypes","inline","exports","dryRun","cache","resolvedPathByFilePath"],jsonOptions:["input","outFile","outDir","entryExports","dryRun","source"],markdownOptions:["write","outFile","outDir","entryExports","onAppend","dryRun"],customElementsOptions:["outFile","dryRun"],llmsOptions:["outDir","linkBase","title","summary","entryExports","dryRun"],diagnostics:["ignore"]};function Ol(i,Ae,Ne){let _e=i===null?Ae:`${i}.${Ae}`,De=vs(Ae,Ne),Re=De===void 0?void 0:i===null?De:`${i}.${De}`;console.warn(`sveld: unknown option "${_e}".${Re?` Did you mean "${Re}"?`:""}`)}function N(i){for(let Ae of Object.keys(i))if(!Ll.includes(Ae))Ol(null,Ae,Ll);for(let[Ae,Ne]of Object.entries(qm)){let _e=i[Ae];if(!Nt(_e))continue;for(let De of Object.keys(_e))if(!Ne.includes(De))Ol(Ae,De,Ne)}}var Ts=new Map;function k(i,Ae){if(!Ae?.replace&&Ts.has(i.name))throw Error(`sveld: a writer named "${i.name}" is already registered. Pass { replace: true } to overwrite it.`);Ts.set(i.name,i)}function G(i){return Ts.get(i)}function ve(){return Array.from(Ts.values())}import{dirname as hu,isAbsolute as _0,resolve as D0}from"node:path";import{existsSync as $p,lstatSync as jp,readFileSync as cx,realpathSync as lx,statSync as Vp}from"node:fs";import{readFile as px}from"node:fs/promises";import{basename as ux,dirname as Wp,extname as dx,isAbsolute as fx,join as Bp,parse as hx,relative as Io,resolve as fr}from"node:path";function Dr(i){return i}function Nn(i){if(i==="")return i;return i.startsWith(".")?i:`./${i}`}import{dirname as $l,resolve as Bl}from"node:path";var Gm=/^(['"])(.*)\1$/,Fl=/^[./]/,Um=/import\(\s*(['"])((?:(?!\1).)+)\1\s*\)/g;function Hm(i,Ae){let Ne=i.extends?.import;if(Ne===void 0)return null;let _e=Ne.replace(Gm,"$2");if(!Fl.test(_e))return null;return Bl($l(Ae),_e)}function Ml(i,Ae){let Ne=[];for(let _e of i.matchAll(Um)){let De=_e[2];if(!Fl.test(De))continue;Ne.push(Bl($l(Ae),De))}return Ne}function Km(i,Ae){let Ne=[],_e=Hm(i,Ae);if(_e!==null)Ne.push(_e);for(let De of i.typedefs??[])Ne.push(...Ml(De.type,Ae));for(let De of i.props)if(De.type)Ne.push(...Ml(De.type,Ae));return Ne}function Ir(i,Ae){let Ne=new Map;for(let _e of i.values()){let De=Ae(_e.filePath);for(let Re of Km(_e,De)){let Ie=Ne.get(Re);if(Ie===void 0)Ie=new Set,Ne.set(Re,Ie);Ie.add(De)}}return Ne}function ks(i,Ae){let Ne=new Set,_e=[];for(let De of i)if(!Ne.has(De))Ne.add(De),_e.push(De);while(_e.length>0){let De=_e.shift(),Re=Ae.get(De);if(Re===void 0)continue;for(let Ie of Re)if(!Ne.has(Ie))Ne.add(Ie),_e.push(Ie)}return Ne}var zm=/^```([\w-]*)\r?\n([\s\S]*?)\r?\n?```$/,Xm=new Set(["","js","jsx","ts","tsx","javascript","typescript"]),Jm=new Set(["svelte","html"]);function Ym(i){let Ae=i.trim();if(Ae==="")return null;let Ne=Ae.match(zm);if(Ne){let _e=Ne[1].toLowerCase(),De=Ne[2].trim();if(De==="")return null;if(Xm.has(_e))return{kind:"compile",code:De};if(Jm.has(_e))return{kind:"syntax",code:De};return null}if(Ae.startsWith("<"))return null;return{kind:"compile",code:Ae}}function jl(i){if(!i.isFunction)return"any";return`(${(i.params??[]).map((Ne)=>`${Ne.name}${Ne.optional?"?":""}: any`).join(", ")}) => any`}function As(i,Ae,Ne,_e,De){let Re=(i??[]).filter((Oe)=>Oe.name==="example"),Ie=[];return Re.forEach((Oe,Me)=>{let Fe=Ym(Oe.body);if(Fe===null)return;let Be=Re.length>1;Ie.push({id:Be?`${Ae}#${Me}`:Ae,name:Be?`${Ne} (example ${Me+1})`:Ne,type:_e,code:Fe.code,kind:Fe.kind,...De?{source:De}:{}})}),Ie}function Vl(i){return i.name??"default"}function Wl(i){let Ae=[];for(let Ne of i.props)Ae.push(...As(Ne.tags,`prop:${Ne.name}`,Ne.name,jl(Ne),Ne.source));for(let Ne of i.moduleExports)Ae.push(...As(Ne.tags,`export:${Ne.name}`,Ne.name,jl(Ne),Ne.source));for(let Ne of i.slots)Ae.push(...As(Ne.tags,`slot:${Vl(Ne)}`,Vl(Ne),"any",Ne.source));for(let Ne of i.events)Ae.push(...As(Ne.tags,`event:${Ne.name}`,Ne.name,"any",Ne.source));return Ae}import{existsSync as Qm,readdirSync as Zm}from"node:fs";import{join as ey}from"node:path";var no=new Map;function ws(){no.clear()}function Ps(i){let Ae=no.get(i);if(Ae!==void 0)return Ae;try{let Ne=Zm(i,{withFileTypes:!0}),_e=new Set;for(let De of Ne)_e.add(De.name);Ae={entries:Ne,names:_e}}catch{Ae=null}return no.set(i,Ae),Ae}function Ns(i,Ae){let Ne=Ps(i);if(Ne===null)return;if(Ne.byName===void 0){Ne.byName=new Map;for(let _e of Ne.entries)Ne.byName.set(_e.name,_e)}return Ne.byName.get(Ae)}function ql(i){return i.normalize("NFC").toLowerCase()}function bn(i,Ae){let Ne=Ps(i);if(Ne===null)return!1;if(Ne.names.has(Ae))return!0;if(Ne.folded===void 0){Ne.folded=new Map;for(let De of Ne.names)Ne.folded.set(ql(De),De)}let _e=Ne.folded.get(ql(Ae));return _e!==void 0&&_e!==Ae&&Qm(ey(i,Ae))}import{lstatSync as pg,readFileSync as ug}from"node:fs";import{basename as dg,dirname as bo,join as gp,resolve as fg}from"node:path";import{existsSync as Is,readFileSync as ty}from"node:fs";import{dirname as ro,isAbsolute as ny,join as ry,relative as sy,resolve as Rs}from"node:path";function _s(i){if(!Nt(i))return{};let Ae={};if(typeof i.svelte==="string")Ae.svelte=i.svelte;if(typeof i.name==="string")Ae.name=i.name;if(typeof i.description==="string")Ae.description=i.description;return Ae}function Gl(i){if(!Nt(i))return{};let Ae={};if(typeof i.extends==="string")Ae.extends=i.extends;if(Nt(i.compilerOptions)){let Ne={};if(typeof i.compilerOptions.baseUrl==="string")Ne.baseUrl=i.compilerOptions.baseUrl;if(Nt(i.compilerOptions.paths)){let _e={};for(let[De,Re]of Object.entries(i.compilerOptions.paths))if(Array.isArray(Re)&&Re.every((Ie)=>typeof Ie==="string"))_e[De]=Re;if(Object.keys(_e).length>0)Ne.paths=_e}if(Object.keys(Ne).length>0)Ae.compilerOptions=Ne}return Ae}var Ds=new Map,Ul=new Map,iy=/\/\*[\s\S]*?\*\/|\/\/.*/g,oy=/[.+?^${}()|[\]\\]/g,ay=[".svelte",".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".d.ts"];class or extends Error{specifier;fromFile;searched;constructor(i,Ae,Ne){super(`cannot resolve "${i}" from ${Ae||"."} (${Ne})`);this.name="UnresolvedModuleError",this.specifier=i,this.fromFile=Ae,this.searched=Ne}}function cy(i){if(Is(i))return!0;return ay.some((Ae)=>Is(i+Ae))}function Hl(i){let Ae=i.indexOf("*");return Ae===-1?i.length:Ae}function ly(i){let Ae=i,Ne=Rs(Ae,"/");while(Ae!==Ne){for(let _e of["tsconfig.json","jsconfig.json"]){let De=ry(Ae,_e);if(Is(De))return De}Ae=ro(Ae)}return null}function Kl(i){if(Ds.has(i))return Ds.get(i)??null;try{let Ae=ty(i,"utf-8"),Ne;try{Ne=JSON.parse(Ae)}catch{let De=Ae.replace(iy,"");Ne=JSON.parse(De)}let _e=Gl(Ne);if(_e.extends){let De=ny(_e.extends)?_e.extends:Rs(ro(i),_e.extends),Re=De.endsWith(".json")?De:`${De}.json`;if(Is(Re)){let Ie=Kl(Re);if(Ie)_e.compilerOptions={...Ie.compilerOptions,..._e.compilerOptions,paths:{...Ie.compilerOptions?.paths,..._e.compilerOptions?.paths}}}}return Ds.set(i,_e),_e}catch{return Ds.set(i,null),null}}function py(i){let Ae=Ul.get(i);if(!Ae){let Ne=i.split("*").map((_e)=>_e.replace(oy,"\\$&")).join("(.*)");Ae=new RegExp(`^${Ne}$`),Ul.set(i,Ae)}return Ae}function ar(i,Ae){if(i.startsWith(".")||i.startsWith("/"))return{resolved:i,unresolved:!1,searched:""};let Ne=ly(Ae);if(!Ne)return{resolved:i,unresolved:!0,searched:"no tsconfig/jsconfig paths found"};let _e=Kl(Ne);if(!_e?.compilerOptions?.paths)return{resolved:i,unresolved:!0,searched:"no tsconfig/jsconfig paths found"};let{baseUrl:De=".",paths:Re}=_e.compilerOptions,Ie=ro(Ne),Oe=Rs(Ie,De),Me=Object.entries(Re).sort(([Fe],[Be])=>Hl(Be)-Hl(Fe));for(let[Fe,Be]of Me){let Ve=i.match(py(Fe));if(!Ve)continue;let Ge;for(let Ue of Be){let Xe=Ue;for(let Qe=1;Qe<Ve.length;Qe++)Xe=Xe.replace("*",Ve[Qe]);let ze=Rs(Oe,Xe);if(Ge===void 0)Ge=ze;if(cy(ze))return{resolved:ze,unresolved:!1,searched:Ne}}return{resolved:Ge??i,unresolved:!1,searched:Ne}}return{resolved:i,unresolved:!0,searched:`tsconfig paths (${Ne})`}}function so(i,Ae){return ar(i,Ae).resolved}function Ls(i,Ae){if(i.startsWith(".")||i.startsWith("/"))return i;let Ne=so(i,Ae);if(Ne===i)return i;let _e=sy(Ae,Ne);return _e=e(_e),_e.startsWith(".")?_e:`./${_e}`}var uy=/\binterface\s+[A-Za-z_$][\w$]*(\s*<[^{};]*>)?\s*$/;var Jl=/\s/,dy=/\s{2}|[^\S ]/,fy=/["'`{}/]/g,hy=/["'`{};/]/g;function my(i){return uy.test(i.slice(-200))}var zl=[""];function yy(i){let Ae=zl[i];if(Ae===void 0)Ae=" ".repeat(i),zl[i]=Ae;return Ae}function gy(i,Ae){let Ne="";for(let _e=i.length-1;_e>=0&&Ne.length<Ae;_e--)Ne=i[_e]+Ne;return Ne.length>Ae?Ne.slice(-Ae):Ne}function xy(i){if(i.length===0)return!1;let Ae=i[i.length-1];return Ae.charCodeAt(Ae.length-1)===10}function by(i){while(i.length>0){let Ae=i[i.length-1],Ne=Ae.length;while(Ne>0){let _e=Ae.charCodeAt(Ne-1);if(_e!==32&&_e!==9)break;Ne--}if(Ne===Ae.length)return;if(Ne===0){i.pop();continue}i[i.length-1]=Ae.slice(0,Ne);return}}function Ey(i){while(i.length>0){let Ae=i[i.length-1];if(!Jl.test(Ae[Ae.length-1]))return;let Ne=Ae.trimEnd();if(Ne.length===Ae.length)return;if(Ne.length===0){i.pop();continue}i[i.length-1]=Ne;return}}function Cy(i){if(i.includes("{"))return!1;let Ae=0,Ne=0;for(let _e=0;_e<i.length;_e++){let De=i.charCodeAt(_e);if(Ae!==0){if(De===Ae&&i.charCodeAt(_e-1)!==92)Ae=0;continue}if(De===34||De===39||De===96){Ae=De;continue}if(De===59&&++Ne>=2)return!0}return!1}function Sy(i){if(!dy.test(i))return i.trimEnd();let Ae="",Ne=null,_e=!1;for(let De=0;De<i.length;De++){let Re=i[De],Ie=i[De-1];if(Ne){if(Ae+=Re,Ne==="double"&&Re==='"'&&Ie!=="\\"||Ne==="single"&&Re==="'"&&Ie!=="\\"||Ne==="template"&&Re==="`"&&Ie!=="\\")Ne=null;_e=!1;continue}if(Re==='"'||Re==="'"||Re==="`"){Ne=Re==='"'?"double":Re==="'"?"single":"template",Ae+=Re,_e=!1;continue}if(Jl.test(Re)){if(!_e&&Ae.length>0)Ae+=" ",_e=!0;continue}Ae+=Re,_e=!1}return Ae.trimEnd()}function Yl(i,Ae){let Ne=i[Ae],_e=i.indexOf(Ne,Ae+1);while(_e!==-1&&i.charCodeAt(_e-1)===92)_e=i.indexOf(Ne,_e+1);return _e}function Ql(i,Ae){let Ne=i.indexOf("*/",Ae+1);return Ne===-1?-1:Ne+1}function vy(i){let Ae=new Map,Ne=[],_e=fy,De=0;while(De<i.length){if(_e.lastIndex=De,!_e.test(i))break;De=_e.lastIndex-1;let Re=i.charCodeAt(De);if(Re===47){if(i.charCodeAt(De+1)===42){let Ie=Ql(i,De);if(Ie===-1)break;De=Ie}}else if(Re===34||Re===39||Re===96){let Ie=Yl(i,De);if(Ie===-1)break;De=Ie}else if(Re===123)Ne.push(De);else if(Re===125&&Ne.length>0)Ae.set(Ne.pop(),De);De++}return Ae}function Ty(i,Ae,Ne){for(let _e=Ae;_e<Ne;_e++)if(!io(i.charCodeAt(_e)))return!1;return!0}function io(i){if(i<=32)return i===32||i>=9&&i<=13;if(i<160)return!1;return i===160||i===5760||i>=8192&&i<=8202||i===8232||i===8233||i===8239||i===8287||i===12288||i===65279}function Zl(i,Ae,Ne,_e){let De=[],Re=hy,Ie=Ae,Oe=Ae;while(Oe<Ne){if(Re.lastIndex=Oe,!Re.test(i))break;if(Oe=Re.lastIndex-1,Oe>=Ne)break;let Me=i.charCodeAt(Oe);if(Me===47){if(i.charCodeAt(Oe+1)===42){let Fe=Ql(i,Oe);if(Fe===-1)break;Oe=Fe}Oe++;continue}if(Me===34||Me===39||Me===96){let Fe=Yl(i,Oe);if(Fe===-1)break;Oe=Fe+1;continue}if(Me===123){let Fe=_e.get(Oe);if(Fe===void 0||Fe>=Ne){Oe++;continue}if(Ie<Oe)De.push(i.slice(Ie,Oe));let Be=Oe+1;if(Ty(i,Be,Fe)){De.push("{}"),Oe=Fe+1,Ie=Oe;continue}let Ve=i.slice(Be,Fe),Ge=i.charCodeAt(Be)===10;if(!Ge&&!Ve.includes("/*")&&!Cy(Ve)&&!my(gy(De,200))){let Ue=Zl(i,Be,Fe,_e),Xe=Ue.trim();if(!Xe.includes(`
|
|
38
|
-
`)){let ze=Xe.endsWith(";")?Xe.slice(0,-1):Xe,Qe=`{ ${Sy(ze)} }`;if(Qe.length<=120){De.push(Qe),Oe=Fe+1,Ie=Oe;continue}}if(De.push("{"),Ue.charCodeAt(0)!==59)De.push(`
|
|
39
|
-
`);if(Ue.length>0)De.push(Ue);Oe=Fe,Ie=Fe;continue}if(De.push("{"),!Ge)De.push(`
|
|
40
|
-
`);Oe=Be,Ie=Be;continue}if(Me===125){if(Ie<Oe)De.push(i.slice(Ie,Oe));if(by(De),!xy(De))De.push(`
|
|
41
|
-
`);De.push("}"),Oe++,Ie=Oe;continue}if(Ie<Oe)De.push(i.slice(Ie,Oe));if(Ey(De),De.push(";"),i.charCodeAt(Oe+1)!==10)De.push(`
|
|
42
|
-
`);Oe++,Ie=Oe}if(Ie<Ne)De.push(i.slice(Ie,Ne));return De.join("")}function ky(i){return Zl(i,0,i.length,vy(i))}function Ay(i){if(!i.includes(" "))return i;let Ae="",Ne=0;for(let _e=0;_e<i.length;_e++){let De=i.charCodeAt(_e);if(Ne!==0){if(Ae+=i[_e],De===Ne&&i.charCodeAt(_e-1)!==92)Ne=0;continue}if(De===34||De===39||De===96){Ne=De,Ae+=i[_e];continue}if(De===32&&Ae.charCodeAt(Ae.length-1)===32)continue;Ae+=i[_e]}return Ae}function wy(i){return i===125||i===93||i===41||i===62}function Py(i,Ae,Ne){return Ne-Ae>=3&&i.charCodeAt(Ae)===47&&i.charCodeAt(Ae+1)===42&&i.charCodeAt(Ae+2)===42}function Xl(i,Ae,Ne){let _e=i.indexOf("*/",Ae);return _e!==-1&&_e+2<=Ne}function Ny(i){let Ae=[],Ne=[],_e=i.length,De=0,Re=!1,Ie=0,Oe=0;while(Oe<=_e){let Be=i.indexOf(`
|
|
43
|
-
`,Oe);if(Be===-1)Be=_e;let Ve=Be+1,Ge=Oe,Ue=Be;while(Ge<Ue&&io(i.charCodeAt(Ge)))Ge++;while(Ue>Ge&&io(i.charCodeAt(Ue-1)))Ue--;if(Ge===Ue){let Ye=Ne.length>0?Ne[Ne.length-1]:void 0;if(Ye!==void 0&&Ye!==""){let nt=Ye.charCodeAt(Ye.length-1);if(nt!==123&&nt!==40&&nt!==91)Ae.push(0),Ne.push("")}Oe=Ve;continue}if(Re){if(Ae.push(Ie),Ne.push(` ${i.slice(Ge,Ue)}`),Xl(i,Ge,Ue))Re=!1;Oe=Ve;continue}let Xe=Py(i,Ge,Ue),ze=Xe&&Xl(i,Ge,Ue);if(Xe&&!ze){Ae.push(De),Ne.push(i.slice(Ge,Ue)),Re=!0,Ie=De,Oe=Ve;continue}let Qe=wy(i.charCodeAt(Ge)),rt=Math.max(0,De-(Qe?1:0));if(Qe&&rt===0&&Ne.length>0&&Ne[Ne.length-1]==="")Ae.pop(),Ne.pop();if(Ae.push(rt),Ne.push(Ay(i.slice(Ge,Ue))),Oe=Ve,ze)continue;let ot=0;for(let Ye=Ge;Ye<Ue;Ye++){let nt=i.charCodeAt(Ye);if(ot!==0){if(nt===ot&&i.charCodeAt(Ye-1)!==92)ot=0;continue}if(nt===34||nt===39||nt===96)ot=nt;else if(nt===123||nt===40||nt===91||nt===60)De++;else if(nt===125||nt===41||nt===93)De=Math.max(0,De-1);else if(nt===62&&i.charCodeAt(Ye-1)!==61)De=Math.max(0,De-1)}}let Me=Ne.length;while(Me>0&&Ne[Me-1]==="")Me--;let Fe=[];for(let Be=0;Be<Me;Be++){if(Be>0)Fe.push(`
|
|
44
|
-
`);let Ve=Ae[Be];if(Ve>0)Fe.push(yy(Ve));Fe.push(Ne[Be])}return Fe.join("")}function ep(i){return`${Ny(ky(i))}
|
|
45
|
-
`}var _n="any",Zt="",_y="Record<string, any>",ao="Record<string, never>",sp=/^[A-Za-z_$][A-Za-z0-9_$]*$/,Dy=/CustomEvent/,Iy=/^[A-Z]/,Ry=/\n/,ip=/=>/,Ly=/(?:^|\n)@default\b/,co=/\n/g,Oy=/\s+/g,cr=/(^|[^.\w])Snippet(?:\s*<|\b)/,My=/import\s+type\s+[^;]*\bSnippet\b[^;]*from\s+"svelte";/,$y=/[.*+?^${}()|[\]\\]/g,By=/^const\s+/,Fy=/\{name\}/g;function lo(i){return i.replace(By,"")}function jy(i){if(!i)return;return i.replace(co,`
|
|
46
|
-
* `)}function Os(i){if(!i)return"";return`/** ${i} */`}function Ms(i){if(!i)return"";return`/**
|
|
47
|
-
* ${i.replace(co,`
|
|
48
|
-
* `)}
|
|
49
|
-
*/`}function op(i){if(i===void 0)return;return i===!0?"@deprecated":`@deprecated ${i}`}function Vy(i){let Ae=op(i);if(Ae===void 0)return;return`* ${Ae.replace(co,`
|
|
50
|
-
* `)}
|
|
51
|
-
`}function Wy(i,Ae){if(!Ae)return[`@${i}`];if(!Ae.includes(`
|
|
52
|
-
`))return[`@${i} ${Ae}`];return[`@${i}`,...Ae.split(`
|
|
53
|
-
`)]}function po(i){let Ae=[];for(let{name:Ne,body:_e}of i??[])Ae.push(...Wy(Ne,_e));return Ae}function Rr(i,Ae,Ne){let _e=op(Ne),De=po(Ae),Re=De.length>0;if(!i&&!Re&&!_e)return"";if(!Re&&!_e)return i?.includes(`
|
|
54
|
-
`)?Ms(i):Os(i);let Ie=[];if(i)Ie.push(...i.split(`
|
|
55
|
-
`));if(Ie.push(...De),_e)Ie.push(..._e.split(`
|
|
56
|
-
`));return`/**
|
|
57
|
-
* ${Ie.join(`
|
|
58
|
-
* `)}
|
|
59
|
-
*/`}function qy(i){let Ae=po(i);if(Ae.length===0)return"";return Ae.map((Ne)=>`* ${Ne}
|
|
60
|
-
`).join("")}function $s(i){if(i===void 0)return _n;return`${i}
|
|
61
|
-
`}function pr(i,Ae={export:!0},Ne="all"){if(i.typedefs.length===0)return Zt;let _e=Ae.export?"export ":"";return i.typedefs.map((De)=>{let Re=Zt;if(Ne!=="none"){let Ie=Ne==="all"?po(De.tags):[];if(Ie.length===0)Re=De.description?`${Ms(De.description)}
|
|
62
|
-
`:"";else Re=`/**
|
|
63
|
-
* ${(De.description?[...De.description.split(`
|
|
64
|
-
`),...Ie]:Ie).join(`
|
|
65
|
-
* `)}
|
|
66
|
-
*/
|
|
67
|
-
`}return`${Re}${_e}${De.ts}`}).join(`
|
|
68
|
-
|
|
69
|
-
`)}var tp=new Map;function ap(i,Ae){let Ne=tp.get(Ae);if(Ne===void 0){let _e=Ae.replace($y,"\\$&");Ne=new RegExp(`\\b${_e}\\b`),tp.set(Ae,Ne)}return Ne.test(i)}var np,rp=[];function uo(i){if(i!==np)np=i,rp=gn(i);return rp}function Gy(i){if(i===null)return[];return i[0].split(",").map((Ae,Ne)=>({name:Ae.trim(),constraint:(uo(i[1]??"")[Ne]??Ae).trim()}))}function Uy(i,Ae){let Ne=Gy(i).filter(({name:_e})=>ap(Ae,_e));if(Ne.length===0)return{declSuffix:Zt,refSuffix:Zt};return{declSuffix:`<${Ne.map(({constraint:_e})=>lo(_e)).join(", ")}>`,refSuffix:`<${Ne.map(({name:_e})=>_e).join(", ")}>`}}function cp(i,Ae={export:!0},Ne="all"){if(!i.contexts||i.contexts.length===0)return Zt;let _e=Ae.export?"export ":"",De=i.generics===null?[]:i.generics[0].split(",").map((Re,Ie)=>({name:Re.trim(),constraint:(uo(i.generics?.[1]??"")[Ie]??Re).trim()}));return i.contexts.map((Re)=>{let Ie=Re.properties.map((Ve)=>{let Ge=Ne!=="none"&&Ve.description?`${Os(Ve.description)}
|
|
70
|
-
`:"",Ue=Ve.optional?"?":"";return`${Ge}${Ve.name}${Ue}: ${Ve.type};`}).join(`
|
|
71
|
-
`),Oe=Ne!=="none"&&Re.description?`${Ms(Re.description)}
|
|
72
|
-
`:"",Me=De.filter(({name:Ve})=>Re.properties.some((Ge)=>ap(Ge.type,Ve))).map(({constraint:Ve})=>Ve),Fe=Me.length>0?`<${Me.map(lo).join(", ")}>`:"";if(Re.properties.length===0)return Re.hasUnresolvedSpread?`${Oe}${_e}type ${Re.typeName} = Record<string, any>;`:`${Oe}${_e}type ${Re.typeName} = Record<string, never>;`;let Be=Re.hasUnresolvedSpread?" & Record<string, any>":"";return`${Oe}${_e}type ${Re.typeName}${Fe} = {
|
|
73
|
-
${Ie}
|
|
74
|
-
}${Be};`}).join(`
|
|
75
|
-
|
|
76
|
-
`)}function lr(i){return sp.test(i)?i:JSON.stringify(i)}function lp(i,Ae){if(!i)return;return`* ${Ae||i}
|
|
77
|
-
`}function fo(i,Ae,Ne,_e="all"){if(_e==="none")return Zt;return[lp(jy(i)),Vy(Ae),_e==="all"?qy(Ne):void 0].filter(Boolean).join("")}function ho(i){return i.length>0?`/**
|
|
78
|
-
${i}*/`:Zt}function Hy(i,Ae={export:!0},Ne="all"){let _e=Ae.export?"export ":"",De=i.props.filter((Ye)=>!Ye.isFunctionDeclaration&&Ye.kind!=="const"),Re=new Set([...De.map((Ye)=>Ye.name),...Array.from(i.canonicalPropNames??[])]),Ie=De.map((Ye)=>{let nt=typeof Ye.value==="string"?Ye.value.replace(Oy," "):Ye.value,bt=Ly.test(Ye.description??"")||Ye.value===void 0,_t=[fo(Ye.description,Ye.deprecated,Ye.tags,Ne),Ne==="all"?lp(Ye.constant,"@constant"):null,Ne==="all"&&!bt?`* @default ${nt}
|
|
79
|
-
`:null].filter(Boolean).join(""),Dt=Ye.constant&&!Ye.isFunction?Ye.value:Ye.type||_n;return`
|
|
80
|
-
${ho(_t)}
|
|
81
|
-
${lr(Ye.name)}${Ye.isRequired?"":"?"}: ${Dt};`}),Oe=i.canonicalPropsType?Ie.filter((Ye,nt)=>{let it=De[nt];return it?!(i.canonicalPropNames?.has(it.name)??!1):!0}):Ie,Me=(i.slots||[]).filter((Ye)=>!Ye.default&&Ye.name!=null&&!Re.has(Ye.name)).map((Ye)=>{let nt=Ye.name,it=lr(nt),bt=Rr(Ye.description,Ye.tags,Ye.deprecated),_t=bt?`${bt}
|
|
82
|
-
`:"",Le=Ye.slot_props&&Ye.slot_props!=="Record<string, never>"?`(this: void, ...args: [${Ye.slot_props}]) => void`:"(this: void) => void";return`
|
|
83
|
-
${_t}${it}?: ${Le};`}),Fe=(i.slots||[]).find((Ye)=>Ye.default||Ye.name===null),Be=Fe&&!Re.has("children")?(()=>{let Ye=Rr(Fe.description,Fe.tags,Fe.deprecated),nt=Ye?`${Ye}
|
|
84
|
-
`:"",bt=Fe.slot_props&&Fe.slot_props!=="Record<string, never>"?`(this: void, ...args: [${Fe.slot_props}]) => void`:"(this: void) => void";return`
|
|
85
|
-
${nt}children?: ${bt};`})():"",Ve=i.events?Qy({events:i.events},Re):[],Ge=[...Me,Be,...Ve].filter(Boolean),Ue=[...Oe,...Ge].join(`
|
|
86
|
-
`),Xe=Fn(i.moduleName,Ae.typeNames),ze=Zt,Qe=i.generics?`<${uo(i.generics[1]).map((Ye)=>lo(Ye.trim())).join(", ")}>`:"",rt=i.generics?`<${i.generics[0]}>`:"",ot=i.canonicalPropsType?`
|
|
87
|
-
type $Props${Qe} = ${i.canonicalPropsType}${Ue.trim()===""?"":` & {${Ue}
|
|
88
|
-
}`};
|
|
89
|
-
`:`
|
|
90
|
-
type $Props${Qe} = {
|
|
91
|
-
${Ue}
|
|
92
|
-
};
|
|
93
|
-
`;if(i.rest_props?.type==="Element"){let Ye;if(i.rest_props.name==="svelte:element")if(i.rest_props.thisValue)Ye=`SvelteHTMLElements["${i.rest_props.thisValue}"]`;else Ye="HTMLAttributes<HTMLElement>";else Ye=i.rest_props.name.split("|").map((bt)=>`SvelteHTMLElements["${bt.trim()}"]`).join(" & ");let nt="[key: `data-${string}`]: unknown;",it=i.rest_props.description?i.rest_props.description.includes(`
|
|
94
|
-
`)?`${Ms(i.rest_props.description)}
|
|
95
|
-
`:`${Os(i.rest_props.description)}
|
|
96
|
-
`:"";if(i.extends===void 0)ze=`
|
|
97
|
-
${it}${Ye?`type $RestProps = ${Ye};
|
|
98
|
-
`:""}
|
|
99
|
-
${i.canonicalPropsType?`type $Props${Qe} = (${i.canonicalPropsType}) & {${Ue}
|
|
100
|
-
|
|
101
|
-
${nt}
|
|
102
|
-
};`:`type $Props${Qe} = {
|
|
103
|
-
${Ue}
|
|
104
|
-
|
|
105
|
-
${nt}
|
|
106
|
-
};`}
|
|
107
|
-
|
|
108
|
-
${_e}type ${Xe}${Qe} = Omit<$RestProps, keyof $Props${rt}> & $Props${rt};
|
|
109
|
-
`;else ze=`
|
|
110
|
-
${it}${Ye?`type $RestProps = ${Ye};
|
|
111
|
-
`:""}
|
|
112
|
-
${i.canonicalPropsType?`type $Props${Qe} = (${i.canonicalPropsType}) & {${Ue}
|
|
113
|
-
|
|
114
|
-
${nt}
|
|
115
|
-
};`:`type $Props${Qe} = {
|
|
116
|
-
${Ue}
|
|
117
|
-
|
|
118
|
-
${nt}
|
|
119
|
-
};`}
|
|
120
|
-
|
|
121
|
-
${_e}type ${Xe}${Qe} = Omit<$RestProps, keyof ($Props${rt} & ${i.extends.interface})> & Omit<${i.extends.interface}, keyof $Props${rt}> & $Props${rt};
|
|
122
|
-
`}else if(Ue.trim()===""&&i.extends===void 0&&!i.canonicalPropsType)ze=`
|
|
123
|
-
${_e}type ${Xe}${Qe} = ${ao};
|
|
124
|
-
`;else if(i.canonicalPropsType)ze=`
|
|
125
|
-
${ot}
|
|
126
|
-
${_e}type ${Xe}${Qe} = ${i.extends===void 0?"":`Omit<${i.extends.interface}, keyof $Props${rt}> & `}$Props${rt};
|
|
127
|
-
`;else if(i.extends===void 0)ze=Ae.propsDeclaration==="interface"&&Ue.trim()!==""?`
|
|
128
|
-
${_e}interface ${Xe}${Qe} {
|
|
129
|
-
${Ue}
|
|
130
|
-
}
|
|
131
|
-
`:`
|
|
132
|
-
${_e}type ${Xe}${Qe} = {
|
|
133
|
-
${Ue}
|
|
134
|
-
};
|
|
135
|
-
`;else ze=`
|
|
136
|
-
type $Props${Qe} = {
|
|
137
|
-
${Ue}
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
${_e}type ${Xe}${Qe} = Omit<${i.extends.interface}, keyof $Props${rt}> & $Props${rt};
|
|
141
|
-
`;return{props_name:Xe,prop_def:ze}}function Ky(i){if(i.slots.length===0)return ao;let Ae=i.slots.map(({name:Ne,slot_props:_e,...De})=>{let Re=De.default||Ne===null?"default":lr(Ne??""),Ie=Rr(De.description,De.tags,De.deprecated);return`${Ie?`${Ie}
|
|
142
|
-
`:""}${Re}: ${$s(_e)};`}).join(`
|
|
143
|
-
`);return i.slots.length===1?`{${Ae}}`:`{
|
|
144
|
-
${Ae}
|
|
145
|
-
}`}var zy=()=>"WindowEventMap",Xy=new Set(["click","dblclick","mousedown","mouseup","mousemove","mouseover","mouseout","mouseenter","mouseleave","contextmenu","wheel","keydown","keyup","keypress","submit","change","input","focus","blur","focusin","focusout","reset","select","touchstart","touchend","touchmove","touchcancel","drag","dragstart","dragend","dragover","dragenter","dragleave","drop","pointerdown","pointerup","pointermove","pointerover","pointerout","pointerenter","pointerleave","pointercancel","gotpointercapture","lostpointercapture","play","pause","ended","volumechange","timeupdate","loadeddata","loadedmetadata","canplay","canplaythrough","seeking","seeked","playing","waiting","stalled","suspend","abort","error","emptied","ratechange","durationchange","loadstart","progress","loadend","animationstart","animationend","animationiteration","animationcancel","transitionstart","transitionend","transitionrun","transitioncancel","scroll","resize","load","unload","beforeunload","cut","copy","paste","compositionstart","compositionupdate","compositionend"]);function oo(i=_n){if(Dy.test(i))return i;return`CustomEvent<${i}>`}function Jy(i){return Xy.has(i)}function pp(i){switch(i.type){case"dispatched":return oo(i.detail);case"forwarded":{let Ae=i.element,_e=!(Ae&&Iy.test(Ae))||Jy(i.name),De=i.detail!==void 0&&i.detail!=="undefined"&&!(i.detail==="null"&&_e),Re=i.detail==="null"&&!_e;if(De||Re)return oo(i.detail);else if(_e)return`${zy()}["${i.name}"]`;else return oo()}default:return i}}function Yy(i){if(i.events.length===0)return _y;let Ae=i.events.map((Ne)=>{let _e="",De=Rr(Ne.description,Ne.tags,Ne.deprecated);if(De)_e=`${De}
|
|
146
|
-
`;return`${_e}${lr(Ne.name)}: ${pp(Ne)};
|
|
147
|
-
`}).join("");return i.events.length===1?`{${Ae}}`:`{
|
|
148
|
-
${Ae}}`}function Qy(i,Ae){return i.events.map((Ne)=>{let _e=`on${Ne.name}`;if(Ae.has(_e))return;let De="",Re=Rr(Ne.description,Ne.tags,Ne.deprecated);if(Re)De=`${Re}
|
|
149
|
-
`;return`
|
|
150
|
-
${De}${lr(_e)}?: (event: ${pp(Ne)}) => void;`}).filter((Ne)=>Ne!==void 0)}function Zy(i){let Ae=i.type==="() => any";if(i.type&&ip.test(i.type)&&!Ae)return i.type;else if(i.params&&i.params.length>0){let _e=i.params.map((Re)=>{let Ie=Re.optional?"?":"";return`${Re.name}${Ie}: ${Re.type}`}).join(", "),De=i.returnType||_n;return`(${_e}) => ${De}`}else if(i.returnType)return`() => ${i.returnType}`;else return i.type||_n}function up(i,Ae="all"){return i.props.filter((Ne)=>Ne.isFunctionDeclaration||Ne.kind==="const").map((Ne)=>{let _e=fo(Ne.description,Ne.deprecated,Ne.tags,Ae),De=Zy(Ne);return`
|
|
151
|
-
${ho(_e)}
|
|
152
|
-
${lr(Ne.name)}: ${De};`}).join(`
|
|
153
|
-
`)}function eg(i,Ae={export:!0},Ne="all"){let _e=Ae.export?"export ":"",De=Lr(i.moduleName,Ae.typeNames),Re=up({props:i.props},Ne);if(Re.trim()==="")return{exports_name:De,exports_ref:De,exports_def:`${_e}type ${De} = ${ao};`};let{declSuffix:Ie,refSuffix:Oe}=Uy(i.generics,Re);return{exports_name:De,exports_ref:`${De}${Oe}`,exports_def:`${_e}type ${De}${Ie} = {${Re}
|
|
154
|
-
};`}}function tg(i){let Ae=i.props.filter((Ne)=>Ne.bindable===!0||Ne.binding==="writable").map((Ne)=>JSON.stringify(Ne.name));return Ae.length===0?Zt:Ae.join(" | ")}function ng(i){let Ae=i.moduleName==="default"?"$$Component":i.moduleName,Ne=i.bindings===Zt?'""':i.bindings;return`declare const ${Ae}: Component<
|
|
155
|
-
${i.propsRef},
|
|
156
|
-
${i.exportsRef},
|
|
157
|
-
${Ne}
|
|
158
|
-
>;
|
|
159
|
-
export default ${Ae};`}function rg(i){let Ae=i.moduleName==="default"?"$$Component":i.moduleName,Ne=`${Ae}Component`,_e=i.bindings===Zt?'""':i.bindings;return`interface ${Ne} {
|
|
160
|
-
new ${i.generic}(
|
|
161
|
-
options: ComponentConstructorOptions<${i.propsRef}>
|
|
162
|
-
): SvelteComponent<${i.propsRef}> & ${i.exportsRef};
|
|
163
|
-
${i.generic}(
|
|
164
|
-
this: void,
|
|
165
|
-
internals: ComponentInternals,
|
|
166
|
-
props: ${i.propsRef}
|
|
167
|
-
): {
|
|
168
|
-
$on?(type: string, callback: (e: any) => void): () => void;
|
|
169
|
-
$set?(props: Partial<${i.propsRef}>): void;
|
|
170
|
-
} & ${i.exportsRef};
|
|
171
|
-
element?: typeof HTMLElement;
|
|
172
|
-
z_$$bindings?: ${_e};
|
|
173
|
-
}
|
|
174
|
-
declare const ${Ae}: ${Ne};
|
|
175
|
-
export default ${Ae};`}function sg(i){if(i.extends===void 0)return"";return`import type { ${i.extends.interface} } from ${i.extends.import};`}function ig(i,Ae="all"){if(Ae==="none"||!i.componentComment)return"";if(!Ry.test(i.componentComment))return Os(i.componentComment.trim());return`/*${i.componentComment.split(`
|
|
176
|
-
`).map((Ne)=>`* ${Ne}`).join(`
|
|
177
|
-
`)}
|
|
178
|
-
*/`}function og(i,Ae="all"){return i.moduleExports.map((Ne)=>{let _e=fo(Ne.description,Ne.deprecated,Ne.tags,Ae),De,Re=Ne.type&&ip.test(Ne.type),Ie=Ne.type==="() => any";if(Ne.kind==="const"&&!Re)De=`export declare const ${Ne.name}: ${Ne.type||_n};
|
|
179
|
-
`;else if(Ne.params&&Ne.params.length>0){let Me=Ne.params.map((Be)=>{let Ve=Be.optional?"?":"";return`${Be.name}${Ve}: ${Be.type}`}).join(", "),Fe=Ne.returnType||_n;De=`export declare function ${Ne.name}(${Me}): ${Fe};`}else if(Ne.returnType)De=`export declare function ${Ne.name}(): ${Ne.returnType};`;else if(Re&&Ne.type&&!Ie){let[Oe,Me,...Fe]=Ne.type.split("=>"),Be=Fe.map((Ve)=>` => ${Ve.trim()}`).join("");De=`export declare function ${Ne.name}${Oe.trimEnd()}: ${Me.trim()}${Be};`}else if(Re&&Ne.type){let[Oe,Me,...Fe]=Ne.type.split("=>"),Be=Fe.map((Ve)=>` => ${Ve.trim()}`).join("");De=`export declare function ${Ne.name}${Oe.trimEnd()}: ${Me.trim()}${Be};`}else if(Ne.kind==="const")De=`export declare const ${Ne.name}: ${Ne.type||_n};
|
|
180
|
-
`;else De=`export type ${Ne.name} = ${Ne.type||_n};`;return`
|
|
181
|
-
${ho(_e)}
|
|
182
|
-
${De}`}).join(`
|
|
183
|
-
`)}var ag=120;function cg(i){let Ne=`export default class ${i.moduleName==="default"?"":i.moduleName}${i.generic} extends SvelteComponentTyped<`,_e=[i.genericProps,i.events,i.slots];if(i.accessors.trim()===""&&_e.every((De)=>!De.includes(`
|
|
184
|
-
`))){let De=`${Ne}${_e.join(", ")}> {}`;if(De.length<=ag)return De}return`${Ne}
|
|
185
|
-
${i.genericProps},
|
|
186
|
-
${i.events},
|
|
187
|
-
${i.slots}
|
|
188
|
-
> {
|
|
189
|
-
${i.accessors}
|
|
190
|
-
}`}function dp(i,Ae,Ne){let _e=Ne.replace(Fy,Ae);if(!Ne.includes("{name}")||!sp.test(_e))throw Error(`sveld: typesOptions.typeNames.${i} must contain "{name}" and produce a valid identifier; got "${Ne}".`);return _e}function Fn(i,Ae){return dp("props",i,Ae?.props??"{name}Props")}function Lr(i,Ae){return dp("exports",i,Ae?.exports??"{name}Exports")}function Bs(i,Ae,Ne){if(i===void 0||i===!0)return{...Ae};if(i===!1)return{props:!1,exports:!1,typedefs:!1,contexts:!1};return{props:i.props??Ne,exports:i.exports??Ne,typedefs:i.typedefs??Ne,contexts:i.contexts??Ne}}var mo={props:!0,exports:!0,typedefs:!0,contexts:!0};function yo(i){let Ae=Bs(i?.exportTypes,mo,!0);if(i?.forceExportProps===!0)Ae.props=!0;return Ae}function go(i){return{format:i.format,exportTypes:i.exportTypes,forceExportProps:i.forceExportProps,typeNames:i.typeNames,comments:i.comments,propsDeclaration:i.propsDeclaration,inline:i.inline}}var lg={format:"class",exportTypes:!0,forceExportProps:!1,typeNames:null,comments:"all",propsDeclaration:"type",inline:!1};function fp(i){let Ae=go(i??{}),Ne={};for(let[_e,De]of Object.entries(Ae))Ne[_e]=De??lg[_e];return JSON.stringify(Ne)}function xo(i,Ae){let Ne=mn(i),{moduleName:_e,typedefs:De,generics:Re,props:Ie,moduleExports:Oe,slots:Me,events:Fe,rest_props:Be,extends:Ve,componentComment:Ge,contexts:Ue,syntaxMode:Xe}=i,ze=Ae?.format==="component",Qe=Re!==null,rt=yo(Ae),ot=Ae?.comments??"all",{props_name:Ye,prop_def:nt}=Hy({moduleName:_e,props:Ie,rest_props:Be,extends:Ve,generics:Re,slots:Me,canonicalPropNames:new Set(Ne?.canonicalPropNames??[]),canonicalPropsType:Ne?.canonicalPropsType,events:ze&&Xe==="legacy"?Fe:void 0},{export:rt.props,typeNames:Ae?.typeNames,propsDeclaration:Ae?.propsDeclaration},ot),it=Re?`<${Re[1]}>`:"",bt=Re?`${Ye}<${Re[0]}>`:Ye,_t=og({moduleExports:Oe},ot),Dt=pr({typedefs:De},{export:rt.typedefs},ot),Le=cp({contexts:Ue,generics:Re},{export:rt.contexts},ot),$e=new Set(Ae?.inlined?.droppedImportStatements??[]),je=(Ne?.typeImportStatements??[]).filter((yt)=>!$e.has(yt)).join(`
|
|
191
|
-
`),qe=[...Ae?.inlined?.declarations??[],...Ne?.localTypeDeclarations??[]].join(`
|
|
192
|
-
|
|
193
|
-
`),{exports_ref:He,exports_def:Ke}=ze?eg({props:Ie,moduleName:_e,generics:Re},{export:rt.exports,typeNames:Ae?.typeNames},ot):{exports_ref:Zt,exports_def:Zt},Ze=ze?tg({props:Ie}):Zt,tt=!My.test(je)&&(cr.test(nt)||cr.test(_t)||cr.test(Dt)||cr.test(Le)||cr.test(qe)||cr.test(Ke)),et=Be?.type==="Element"&&(Be.name!=="svelte:element"||Be.name==="svelte:element"&&Be.thisValue),Je=Be?.type==="Element"&&Be.name==="svelte:element"&&!Be.thisValue,pt=[ze?Qe?`import type { SvelteComponent, ComponentConstructorOptions, ComponentInternals${tt?", Snippet":""} } from "svelte";`:`import type { Component${tt?", Snippet":""} } from "svelte";`:`import { SvelteComponentTyped${tt?", type Snippet":""} } from "svelte";`,et?'import type { SvelteHTMLElements } from "svelte/elements";':"",Je?'import type { HTMLAttributes } from "svelte/elements";':"",je,sg({extends:Ve})].filter(Boolean).join(`
|
|
194
|
-
`),ut=ze?Qe?rg({moduleName:_e,generic:it,propsRef:bt,exportsRef:He,bindings:Ze}):ng({moduleName:_e,propsRef:bt,exportsRef:He,bindings:Ze}):cg({moduleName:_e,generic:it,genericProps:bt,events:Yy({events:Fe}),slots:Ky({slots:Me}),accessors:up({props:Ie},ot)}),ht=[_t,Dt,qe,Le,nt,Ke,[ig({componentComment:Ge},ot),ut].filter(Boolean).join(`
|
|
195
|
-
`)].map((yt)=>yt.trim()).filter(Boolean).join(`
|
|
196
|
-
|
|
197
|
-
`);return ep([pt,ht].filter(Boolean).join(`
|
|
198
|
-
|
|
199
|
-
`))}var hg=[".ts",".d.ts",".mts",".cts"],mg=["index.ts","index.d.ts"],yg=10,gg=/^\s*(?:export\s+)?(?:declare\s+)?(?:type|interface)\s+([A-Za-z_$][\w$]*)/,xg=new Set(["svelte","svelte/elements"]);function Eo(i){return xg.has(i)}function Mr(i,Ae){let Ne=bo(Ae),_e;if(i.startsWith(".")||i.startsWith("/"))_e=fg(Ne,i);else{let Ie=ar(i,Ne);if(Ie.unresolved)return{kind:"bare"};_e=Ie.resolved}let De=bo(_e),Re=dg(_e);if(bn(De,Re)){let Ie=Ns(De,Re);if(Ie?Ie.isFile():pg(_e,{throwIfNoEntry:!1})?.isFile())return _e.endsWith(".svelte")?{kind:"svelte"}:{kind:"resolved",path:_e}}if(bn(De,`${Re}.svelte`))return{kind:"svelte"};for(let Ie of hg)if(bn(De,`${Re}${Ie}`))return{kind:"resolved",path:`${_e}${Ie}`};for(let Ie of mg)if(bn(_e,Ie))return{kind:"resolved",path:gp(_e,Ie)};return{kind:"missing"}}function St(i){return Nt(i)&&typeof i.type==="string"?i:void 0}function Jn(i){if(!Array.isArray(i))return[];let Ae=[];for(let Ne of i){let _e=St(Ne);if(_e)Ae.push(_e)}return Ae}function Ot(i){if(!i)return;if(s(i))return i.name;return Kn(i)??void 0}function $r(i){return Kn(i)??void 0}function Co(i,Ae){let Ne=i.files.get(Ae);if(Ne!==void 0)return Ne;let _e;try{let De=ug(Ae,"utf-8"),Re=sr(De,!0,[]);_e={source:De,program:Re}}catch{_e=null}return i.files.set(Ae,_e),_e}function bg(i){let Ae=i;while(Ae?.type==="TSQualifiedName")Ae=St(Ae.left);return Ae?Ot(Ae):void 0}function Eg(i){let Ae=new Set,Ne=[],_e=(De)=>{if(De.type!=="TSTypeReference")return;let Re=bg(St(De.typeName));if(Re&&!Ae.has(Re))Ae.add(Re),Ne.push(Re)};for(let De in i){if(De==="id"||De==="typeParameters")continue;let Re=i[De];if(Array.isArray(Re))for(let Ie of Re){let Oe=St(Ie);if(Oe)v(Oe,_e)}else{let Ie=St(Re);if(Ie)v(Ie,_e)}}return Ne}function Cg(i){let Ae=new Set,Ne=St(i.typeParameters);for(let _e of Jn(Ne?.params)){let De=Ot(St(_e.name));if(De)Ae.add(De)}return Ae}function So(i,Ae){for(let Ne of i.body){let _e=Ne.type==="ExportNamedDeclaration"?St(Ne.declaration)??Ne:Ne;switch(_e.type){case"TSTypeAliasDeclaration":if(Ot(St(_e.id))===Ae)return{kind:"type",node:_e};break;case"TSInterfaceDeclaration":if(Ot(St(_e.id))===Ae)return{kind:"interface",node:_e};break;case"TSEnumDeclaration":if(Ot(St(_e.id))===Ae)return{kind:"unsupported",reason:"enum"};break;case"ClassDeclaration":if(Ot(St(_e.id))===Ae)return{kind:"unsupported",reason:"class"};break;case"FunctionDeclaration":if(Ot(St(_e.id))===Ae)return{kind:"unsupported",reason:"function"};break;case"TSModuleDeclaration":if(Ot(St(_e.id))===Ae)return{kind:"unsupported",reason:"namespace"};break;case"VariableDeclaration":for(let De of Jn(_e.declarations))if(Ot(St(De.id))===Ae)return{kind:"unsupported",reason:"const"};break;default:break}}return}function Sg(i,Ae){for(let Ne of i.body){if(Ne.type!=="ImportDeclaration")continue;let _e=$r(St(Ne.source));if(_e===void 0)continue;for(let De of Jn(Ne.specifiers)){let Re=St(De.local),Ie=Ot(Re);if(Ie!==Ae)continue;if(De.type==="ImportNamespaceSpecifier")return{kind:"namespace"};let Oe=typeof Re?.start==="number"?Re.start:void 0;if(De.type==="ImportDefaultSpecifier")return{kind:"named",source:_e,importedName:"default",localNameStart:Oe};if(De.type==="ImportSpecifier")return{kind:"named",source:_e,importedName:Ot(St(De.imported))??Ie,localNameStart:Oe}}}return}function vo(i,Ae){return`${i}\x00${Ae}`}function vg(i,Ae){let Ne=new Set,_e=[];for(let De of i){let Re;try{Re=sr(De,!0,[])}catch{continue}for(let Ie of Re.body){if(Ie.type!=="ImportDeclaration")continue;let Oe=$r(St(Ie.source));if(Oe===void 0||Eo(Oe))continue;if(Mr(Oe,Ae).kind!=="bare")continue;for(let Me of Jn(Ie.specifiers)){if(Me.type==="ImportNamespaceSpecifier")continue;let Fe=Me.type==="ImportDefaultSpecifier"?"default":Ot(St(Me.imported))??void 0;if(!Fe)continue;let Be=vo(Oe,Fe);if(Ne.has(Be))continue;Ne.add(Be),_e.push({source:Oe,importedName:Fe})}}}return _e}function To(i,Ae){return e(gp(bo(i),`__sveld_inline_all_${Ae}.ts`))}function xp(i,Ae,Ne){let _e=vg(Ne,i);if(_e.length===0)return null;let De=_e.map(({source:Me,importedName:Fe},Be)=>`import type { ${Fe} as __sveld_bare_${Be} } from ${JSON.stringify(Me)};`),Re=new Map,Ie=`${De.join(`
|
|
200
|
-
`)}
|
|
201
|
-
`;return _e.forEach(({source:Me,importedName:Fe},Be)=>{Ie+=`type __sveld_ref_${Be} = `,Re.set(vo(Me,Fe),Ie.length),Ie+=`__sveld_bare_${Be};
|
|
202
|
-
`}),{virtualFile:To(i,Ae),content:Ie,positions:Re}}function js(i,Ae){let Ne=new Map;for(let _e of i.values()){let De=mn(_e)?.typeImportStatements??[];if(De.length===0)continue;let Re=xp(Ae(_e.filePath),_e.moduleName,De);if(Re)Ne.set(Re.virtualFile,Re.content)}return Ne}function hp(i){switch(i.type){case"TSTypeAliasDeclaration":return{kind:"type"};case"TSInterfaceDeclaration":return{kind:"interface"};case"TSEnumDeclaration":return{reason:"enum"};case"ClassDeclaration":return{reason:"class"};case"FunctionDeclaration":return{reason:"function"};case"TSModuleDeclaration":return{reason:"namespace"};default:return{reason:i.type}}}function Fs(i,Ae,Ne,_e,De){let Re=`${Ae}#${Ne}`;if(De>yg||_e.has(Re))return{kind:"not-found"};_e.add(Re);let Ie=Co(i,Ae);if(!Ie)return{kind:"not-found"};i.dependencies.add(Ae);for(let Oe of Ie.program.body){if(Oe.type==="ExportNamedDeclaration"){let Me=St(Oe.declaration);if(!Me)continue;if(Me.type==="VariableDeclaration"){for(let Be of Jn(Me.declarations))if(Ot(St(Be.id))===Ne)return{kind:"unsupported",reason:"const"};continue}if(Ot(St(Me.id))!==Ne)continue;let Fe=hp(Me);return"reason"in Fe?{kind:"unsupported",reason:Fe.reason}:{kind:"found",node:Me,filePath:Ae,source:Ie.source}}if(Oe.type==="ExportDefaultDeclaration"&&Ne==="default"){let Me=St(Oe.declaration);if(!Me)return{kind:"not-found"};let Fe=hp(Me);return"reason"in Fe?{kind:"unsupported",reason:Fe.reason}:{kind:"found",node:Me,filePath:Ae,source:Ie.source}}}for(let Oe of Ie.program.body){if(Oe.type!=="ExportNamedDeclaration"||Oe.declaration)continue;for(let Me of Jn(Oe.specifiers)){if(Ot(St(Me.exported))!==Ne)continue;let Fe=Ot(St(Me.local));if(!Fe)return{kind:"not-found"};if(!Oe.source){let Ge=So(Ie.program,Fe);if(!Ge)return{kind:"not-found"};if(Ge.kind==="unsupported")return Ge;return{kind:"found",node:Ge.node,filePath:Ae,source:Ie.source}}let Be=$r(St(Oe.source));if(Be===void 0)return{kind:"not-found"};let Ve=Mr(Be,Ae);if(Ve.kind!=="resolved")return{kind:"not-found"};return Fs(i,Ve.path,Fe,_e,De+1)}}for(let Oe of Ie.program.body){if(Oe.type!=="ExportAllDeclaration"||St(Oe.exported))continue;let Me=$r(St(Oe.source));if(Me===void 0)continue;let Fe=Mr(Me,Ae);if(Fe.kind!=="resolved")continue;let Be=Fs(i,Fe.path,Ne,_e,De+1);if(Be.kind!=="not-found")return Be}return{kind:"not-found"}}function mp(i,Ae,Ne){if(Ne===Ae)return{ok:!0};let _e=`alias#${Ne}`;if(i.textByKey.has(_e))return{ok:!0};let De=i.nameOwner.get(Ne);if(De!==void 0&&De!==_e)return{ok:!1,reason:`"${Ne}" was already inlined from a different source`};if(i.reservedNames.has(Ne))return{ok:!1,reason:`"${Ne}" collides with an existing declaration in the component`};return i.nameOwner.set(Ne,_e),i.tx.keys.push(_e),i.textByKey.set(_e,`type ${Ne} = ${Ae};`),i.order.push(_e),{ok:!0}}async function bp(i,Ae,Ne){let _e=await i.bareSession.resolveAt(Ae,Ne);if(_e.kind==="default-lib")return{status:"left-alone"};if(_e.kind==="unresolved")return{status:"unresolved"};let De=Co(i,_e.filePath);if(!De)return{status:"unlocatable",filePath:_e.filePath,declaredName:_e.declaredName};let Re=So(De.program,_e.declaredName);if(!Re)return{status:"unlocatable",filePath:_e.filePath,declaredName:_e.declaredName};if(Re.kind==="unsupported")return{status:"unsupported",reason:Re.reason};return{status:"found",node:Re.node,filePath:_e.filePath,source:De.source}}async function Or(i,Ae,Ne,_e,De){let Re=Ot(St(Ae.id)),{start:Ie,end:Oe}=Ae;if(!Re||typeof Ie!=="number"||typeof Oe!=="number")return{ok:!1,reason:"has no name or source position"};let Me=`${Ne}#${Re}`;if(i.pending.has(Me)||i.textByKey.has(Me))return mp(i,Re,De);let Fe=i.nameOwner.get(Re);if(Fe!==void 0&&Fe!==Me)return{ok:!1,reason:`"${Re}" was already inlined from a different source`};if(i.reservedNames.has(Re))return{ok:!1,reason:`"${Re}" collides with an existing declaration in the component`};i.pending.add(Me),i.nameOwner.set(Re,Me),i.tx.keys.push(Me),i.dependencies.add(Ne);let Be=Cg(Ae),Ve=Co(i,Ne);for(let Ge of Eg(Ae)){if(Be.has(Ge)||Ge===Re)continue;if(!Ve)continue;let Ue=So(Ve.program,Ge);if(Ue){if(Ue.kind==="unsupported")return i.pending.delete(Me),{ok:!1,reason:`references "${Ge}", a ${Ue.reason} that cannot be inlined`};let ot=await Or(i,Ue.node,Ne,_e,Ge);if(!ot.ok)return i.pending.delete(Me),ot;continue}let Xe=Sg(Ve.program,Ge);if(!Xe||Xe.kind==="namespace")continue;let ze=Mr(Xe.source,Ne);if(ze.kind==="resolved"){let ot=Fs(i,ze.path,Xe.importedName,new Set,0);if(ot.kind==="not-found")return i.pending.delete(Me),{ok:!1,reason:`references "${Ge}", which is not exported from "${Xe.source}"`};if(ot.kind==="unsupported")return i.pending.delete(Me),{ok:!1,reason:`references "${Ge}", a ${ot.reason} that cannot be inlined`};let Ye=await Or(i,ot.node,ot.filePath,ot.source,Ge);if(!Ye.ok)return i.pending.delete(Me),Ye;continue}if(ze.kind!=="bare"||Eo(Xe.source)||!i.bareSession||Xe.localNameStart===void 0)continue;let Qe=await bp(i,Ne,Xe.localNameStart);if(Qe.status==="left-alone")continue;if(Qe.status!=="found"){i.pending.delete(Me);let ot=Qe.status==="unresolved"?`which could not be resolved from "${Xe.source}"`:Qe.status==="unlocatable"?`which resolves to "${Qe.declaredName}" in "${Qe.filePath}", where sveld could not locate that declaration`:`a ${Qe.reason} that cannot be inlined`;return{ok:!1,reason:`references "${Ge}", ${ot}`}}let rt=await Or(i,Qe.node,Qe.filePath,Qe.source,Ge);if(!rt.ok)return i.pending.delete(Me),rt}return i.pending.delete(Me),i.textByKey.set(Me,_e.slice(Ie,Oe).trim()),i.order.push(Me),mp(i,Re,De)}async function Tg(i,Ae,Ne,_e){let De=Fs(i,Ae,Ne,new Set,0);if(De.kind==="not-found")return{ok:!1,reason:`"${Ne}" is not exported from "${Ae}"`};if(De.kind==="unsupported")return{ok:!1,reason:`"${Ne}" is a ${De.reason}, which cannot be inlined`};return Or(i,De.node,De.filePath,De.source,_e)}async function kg(i,Ae,Ne,_e){let De=i.barePlan?.positions.get(vo(Ae,Ne));if(!i.bareSession||!i.barePlan||De===void 0)return{ok:!1,reason:`"${Ne}" is a package import that sveld could not verify`};let Re=await bp(i,i.barePlan.virtualFile,De);switch(Re.status){case"left-alone":return{ok:!1,reason:`"${Ne}" resolves to a built-in TypeScript type, which cannot be inlined`};case"unresolved":return{ok:!1,reason:`"${Ne}" could not be resolved from "${Ae}"`};case"unlocatable":return{ok:!1,reason:`"${Ne}" resolves to "${Re.declaredName}" in "${Re.filePath}", where sveld could not locate that declaration`};case"unsupported":return{ok:!1,reason:`"${Ne}" is a ${Re.reason}, which cannot be inlined`};case"found":return Or(i,Re.node,Re.filePath,Re.source,_e);default:return Re}}function yp(i){i.order.length=i.tx.orderStart;let Ae=new Set(i.tx.keys);for(let Ne of Ae)i.textByKey.delete(Ne);for(let[Ne,_e]of i.nameOwner)if(Ae.has(_e))i.nameOwner.delete(Ne)}async function Ag(i,Ae,Ne){let _e;try{_e=sr(Ae,!0,[])}catch{return{status:"kept"}}let De=_e.body.filter((Be)=>Be.type==="ImportDeclaration");if(De.length===0)return{status:"kept"};let Re=De.flatMap((Be)=>Jn(Be.specifiers).map((Ve)=>({decl:Be,spec:Ve})));if(Re.some(({spec:Be})=>Be.type==="ImportNamespaceSpecifier"))return{status:"kept"};let Ie=$r(St(De[0]?.source));if(Ie===void 0)return{status:"kept"};let Oe=Mr(Ie,Ne);if(Oe.kind==="svelte")return{status:"kept"};let Me=[];for(let{spec:Be}of Re){let Ve=Ot(St(Be.local));if(!Ve)continue;let Ge=Be.type==="ImportDefaultSpecifier"?"default":Ot(St(Be.imported))??Ve;Me.push({importedName:Ge,localName:Ve})}if(Oe.kind==="missing")return{status:"refused",failures:Me.map(({localName:Be})=>({name:Be,reason:`"${Ie}" was not found on disk`}))};if(Oe.kind==="bare"){if(Eo(Ie)||!i.bareSession)return{status:"kept"};i.tx={orderStart:i.order.length,keys:[]};let Be=[];for(let{importedName:Ve,localName:Ge}of Me){let Ue=await kg(i,Ie,Ve,Ge);if(!Ue.ok)Be.push({name:Ge,reason:Ue.reason})}if(Be.length>0)return yp(i),{status:"refused",failures:Be};return{status:"inlined"}}i.tx={orderStart:i.order.length,keys:[]};let Fe=[];for(let{importedName:Be,localName:Ve}of Me){let Ge=await Tg(i,Oe.path,Be,Ve);if(!Ge.ok)Fe.push({name:Ve,reason:Ge.reason})}if(Fe.length>0)return yp(i),{status:"refused",failures:Fe};return{status:"inlined"}}function wg(i,Ae){let Ne=new Set;for(let De of i.typedefs)Ne.add(De.name);for(let De of i.contexts??[])Ne.add(De.typeName);let _e=mn(i);for(let De of _e?.localTypeDeclarations??[]){let Re=gg.exec(De);if(Re)Ne.add(Re[1])}return Ne.add(Fn(i.moduleName,Ae)),Ne.add(Lr(i.moduleName,Ae)),Ne}async function Vs(i,Ae,Ne,_e){let De=new Map;return await Promise.all(Array.from(i.values()).map(async(Re)=>{let Oe=mn(Re)?.typeImportStatements??[];if(Oe.length===0)return;let Me=Ae(Re.filePath),Fe=_e?xp(Me,Re.moduleName,Oe):null,Be={files:new Map,reservedNames:wg(Re,Ne),nameOwner:new Map,textByKey:new Map,order:[],pending:new Set,dependencies:new Set,tx:{orderStart:0,keys:[]},bareSession:_e,barePlan:Fe},Ve=[],Ge=(Re.diagnostics??[]).filter((Ue)=>Ue.kind!=="types-inline-unresolved");for(let Ue of Oe){let Xe=await Ag(Be,Ue,Me);if(Xe.status==="inlined")Ve.push(Ue);else if(Xe.status==="refused")for(let ze of Xe.failures)Ge.push(yn({component:Re.filePath,kind:"types-inline-unresolved",name:ze.name,message:`Cannot inline "${ze.name}": ${ze.reason}.`}))}if(Re.diagnostics=Ge,Ve.length===0&&Be.order.length===0)return;De.set(Re.filePath,{droppedImportStatements:Ve,declarations:Be.order.map((Ue)=>Be.textByKey.get(Ue)??""),dependencies:Array.from(Be.dependencies)})})),De}import{hash as Pg}from"node:crypto";import{mkdirSync as Ng,readFileSync as _g,renameSync as Dg,writeFileSync as Ep}from"node:fs";import{dirname as Ig,isAbsolute as Rg,join as Lg,resolve as Cp}from"node:path";var ko=3,Og=Lg("node_modules",".cache","sveld","parse-cache.json");function Ao(){return`${xs}+svelte@${_r}`}function vp(i,Ae){if(typeof Ae==="string")return Rg(Ae)?Ae:Cp(i,Ae);return Cp(i,Og)}function Tp(i){return Pg("sha256",i,"hex")}function Sp(){return{formatVersion:ko,toolchainVersion:Ao(),entries:{}}}function Mg(i){try{let Ae=_g(i,"utf-8"),Ne=JSON.parse(Ae);if(Ne.formatVersion!==ko||Ne.toolchainVersion!==Ao())return Sp();return Ne}catch{return Sp()}}class wo{cacheFilePath;file;next=new Map;blocked=new Set;constructor(i){this.cacheFilePath=i,this.file=Mg(i)}has(i,Ae){if(this.blocked.has(i))return!1;let Ne=this.file.entries[i];return Ne!==void 0&&Ne.hash===Ae}get(i,Ae){if(this.blocked.has(i))return null;let Ne=this.file.entries[i];if(Ne===void 0||Ne.hash!==Ae)return null;if(this.next.set(i,Ne),Ne.typeScriptMetadata!==void 0)Ne.parsed[g]=Ne.typeScriptMetadata;return Ne.parsed}set(i,Ae,Ne){this.next.set(i,{hash:Ae,parsed:Ne,typeScriptMetadata:Ne[g]})}invalidate(i){this.blocked.add(i)}getGeneratedText(i,Ae){let Ne=this.next.get(i);if(Ne?.generatedText===void 0||Ne.generatedText.key!==Ae)return;return Ne.generatedText.text}setGeneratedText(i,Ae,Ne){let _e=this.next.get(i);if(_e===void 0)return;_e.generatedText={key:Ae,text:Ne}}save(){Ng(Ig(this.cacheFilePath),{recursive:!0});let i={formatVersion:ko,toolchainVersion:Ao(),entries:Object.fromEntries(this.next)},Ae=JSON.stringify(i),Ne=`${this.cacheFilePath}.${process.pid}.tmp`;try{Ep(Ne,Ae),Dg(Ne,this.cacheFilePath)}catch{try{Ep(this.cacheFilePath,Ae)}catch{}}}}import{lstatSync as $g,readFileSync as Bg}from"node:fs";import{basename as Fg,dirname as Do,join as jg,relative as Vg,resolve as Pp}from"node:path";var ur=null,Po=null;function Yn(){if(ur)return Promise.resolve(ur);if(!Po)Po=Promise.all([import("./chunk-n14td14g.js"),import("./chunk-te52wx32.js")]).then(([i,Ae])=>(ur={ComponentParser:i.default,parseSvelte:Ae.parse},ur));return Po}function Ws(){if(!ur)throw Error("sveld: internal error, parser stack read before loadParserStack() resolved.");return ur}var No=[".ts",".mts",".cts",".tsx",".js",".mjs",".cjs",".jsx",".d.ts"],Wg=/\r?\n/,qg=/^\s*\*+/;function vt(i){return i&&typeof i==="object"?i:void 0}function Qn(i){return Array.isArray(i)?i:[]}function En(i){return s(i)?i.name:void 0}function Cn(i,Ae){let Ne=so(i,Ae),_e=Pp(Ae,Ne),De=Do(_e),Re=Fg(_e);if(bn(De,Re)){let Oe=Ns(De,Re)??$g(_e,{throwIfNoEntry:!1});if(Oe?.isFile())return _e;for(let Me of No)if(bn(De,Re+Me))return _e+Me;if(Oe?.isDirectory()){for(let Me of No)if(bn(_e,`index${Me}`))return jg(_e,`index${Me}`)}return null}for(let Ie of No)if(bn(De,Re+Ie))return _e+Ie;return null}function Gg(i,Ae){let Ne=i.slice(0,Ae).trimEnd();if(!Ne.endsWith("*/"))return;let _e=Ne.length-2,De=Ne.lastIndexOf("/**",_e);if(De===-1)return;let Re=[];for(let Ie of Ne.slice(De+3,_e).split(Wg)){let Oe=Ie.replace(qg,"").trim();if(Oe.startsWith("@"))break;if(Oe)Re.push(Oe)}return Re.join(" ")||void 0}function Ug(i,Ae){let Ne=i.slice(0,Ae).trimEnd();if(!Ne.endsWith("*/"))return;let _e=Ne.length-2,De=Ne.lastIndexOf("/**",_e);if(De===-1)return;return Ne.slice(De,_e+2)}function dr(i,Ae){if(!Ae)return;return i.text.slice(Ae.start,Ae.end)}function Hg(i,Ae){let Ne=vt(Ae?.typeAnnotation);if(Ne?.type!=="TSTypeAnnotation")return;return dr(i,vt(Ne.typeAnnotation))}function _o(i,Ae){let Ne=vt(Ae.returnType);return Ne?.type==="TSTypeAnnotation"?dr(i,vt(Ne.typeAnnotation)):void 0}function kp(i,Ae){let Ne=Qn(Ae.params).map((De)=>dr(i,De)??"").join(", "),_e=_o(i,Ae);return`(${Ne})${_e?` => ${_e}`:""}`}function Np(i){if(i.type==="Literal"){let Ae=i.value;if(typeof Ae==="string")return"string";if(typeof Ae==="number")return"number";if(typeof Ae==="boolean")return"boolean"}if(i.type==="TemplateLiteral")return"string";return}function Kg(i){if(!i)return;let Ae=i.lastIndexOf("=>");if(Ae===-1)return;return i.slice(Ae+2).trim()||void 0}function Ap(i){if(i.async||i.generator)return;let Ae=vt(i.body);if(!Ae)return;let Ne=[];if(Ae.type==="BlockStatement"){if(Br(Ae,Ne),Ne.length===0)return}else Ne.push(Ae);let _e;for(let De of Ne){if(!De)return;let Re=Np(De);if(!Re)return;if(_e===void 0)_e=Re;else if(_e!==Re)return}return _e}function Br(i,Ae){for(let Ne of Qn(i.body)){if(Ne.type==="FunctionDeclaration"||Ne.type==="FunctionExpression"||Ne.type==="ArrowFunctionExpression")continue;if(Ne.type==="ReturnStatement"){Ae.push(vt(Ne.argument)??null);continue}if(Ne.type==="BlockStatement"){Br(Ne,Ae);continue}let _e=vt(Ne.consequent);if(_e?.type==="BlockStatement")Br(_e,Ae);else if(_e?.type==="ReturnStatement")Ae.push(vt(_e.argument)??null);let De=vt(Ne.alternate);if(De?.type==="BlockStatement")Br(De,Ae);else if(De?.type==="ReturnStatement")Ae.push(vt(De.argument)??null);let Re=vt(Ne.body);if(Re?.type==="BlockStatement")Br(Re,Ae)}}function zg(i){let Ae=vt(i.initializer);if(!Ae)return;if(Ae.type==="Literal"){let Ne=Ae.value;return typeof Ne==="string"||typeof Ne==="number"?Ne:void 0}if(Ae.type==="UnaryExpression"){let Ne=vt(Ae.argument);if(Ae.operator==="-"&&Ne?.type==="Literal"){let De=Ne.value;if(typeof De==="number")return-De}}return}function Xg(i){let Ae=Qn(i.members);if(Ae.length===0)return;let Ne=[],_e=0;for(let De of Ae){if(!vt(De.initializer)){Ne.push(String(_e)),_e+=1;continue}let Ie=zg(De);if(Ie===void 0)return;Ne.push(typeof Ie==="string"?JSON.stringify(Ie):String(Ie)),_e=typeof Ie==="number"?Ie+1:_e}return Ne.join(" | ")}function wp(i,Ae,Ne){let _e=i.filePath,De=Gg(i.text,Ne),Re=Ug(i.text,Ne),Ie=Re?El(Re):void 0,{deprecated:Oe,tags:Me,internal:Fe}=Re?Cl(Re):{deprecated:void 0,tags:void 0,internal:!1},Be=Fe?{internal:!0}:{};if(Ae.type==="VariableDeclaration"){let Ve=Ae.kind??"const",Ge=[];for(let Ue of Qn(Ae.declarations)){let Xe=vt(Ue.id),ze=En(Xe);if(!ze)continue;let Qe=Hg(i,Xe),rt,ot,Ye,nt=vt(Ue.init);if(nt)if(nt.type==="ArrowFunctionExpression"||nt.type==="FunctionExpression"){if(!Qe)Qe=kp(i,nt);ot=_o(i,nt)??Ie??Kg(Qe)??Ap(nt)}else{if(rt=dr(i,nt),!Qe)Qe=Np(nt);Ye=Kn(nt)??void 0}Ge.push({name:ze,kind:Ve,type:Qe,value:rt,returnType:ot,literalValue:Ye,description:De,deprecated:Oe,tags:Me,...Be,declFile:_e,isTypeOnly:!1})}return Ge}if(Ae.type==="FunctionDeclaration"||Ae.type==="TSDeclareFunction"){let Ve=En(vt(Ae.id));if(!Ve)return[];return[{name:Ve,kind:"function",type:kp(i,Ae),returnType:_o(i,Ae)??Ie??Ap(Ae),description:De,deprecated:Oe,tags:Me,...Be,declFile:_e,isTypeOnly:!1}]}if(Ae.type==="ClassDeclaration"){let Ve=En(vt(Ae.id));if(!Ve)return[];return[{name:Ve,kind:"class",type:Ve,description:De,deprecated:Oe,tags:Me,...Be,declFile:_e,isTypeOnly:!1}]}if(Ae.type==="TSTypeAliasDeclaration"){let Ve=En(vt(Ae.id));if(!Ve)return[];return[{name:Ve,kind:"type",type:dr(i,vt(Ae.typeAnnotation)),description:De,deprecated:Oe,tags:Me,...Be,declFile:_e,isTypeOnly:!0}]}if(Ae.type==="TSInterfaceDeclaration"){let Ve=En(vt(Ae.id));if(!Ve)return[];return[{name:Ve,kind:"interface",type:dr(i,vt(Ae.body)),description:De,deprecated:Oe,tags:Me,...Be,declFile:_e,isTypeOnly:!0}]}if(Ae.type==="TSEnumDeclaration"){let Ve=En(vt(Ae.id));if(!Ve)return[];return[{name:Ve,kind:"enum",type:Xg(Ae)??Ve,description:De,deprecated:Oe,tags:Me,...Be,declFile:_e,isTypeOnly:!1}]}return[]}function Jg(i){let Ae;try{Ae=Bg(i,"utf-8")}catch{return null}let Ne=`<script lang="ts">
|
|
203
|
-
${Ae}
|
|
204
|
-
</script>`;try{let _e=Ws().parseSvelte(Ne),De=Qn(_e.instance?.content?.body);return{source:{text:Ne,filePath:i,dir:Do(i)},body:De}}catch(_e){let De=_e instanceof Error?_e.message:String(_e);return console.warn(`Warning: Failed to parse entry export module ${i}: ${De}`),null}}function Yg(i,Ae){for(let Ne of i){if(Ne.type!=="ImportDeclaration")continue;let _e=vt(Ne.source)?.value;if(typeof _e!=="string")continue;for(let De of Qn(Ne.specifiers)){if(De.type!=="ImportSpecifier")continue;if(En(vt(De.local))===Ae){let Re=En(vt(De.imported))??Ae;return{specifier:_e,importedName:Re}}}}return null}function Dn(i,Ae){let Ne=Ae.cache.get(i);if(Ne)return Ne;if(Ae.computing.has(i))return[];Ae.computing.add(i);let _e=Jg(i);if(!_e)return Ae.computing.delete(i),Ae.cache.set(i,[]),[];let{source:De,body:Re}=_e,Ie=[],Oe=new Map;for(let Fe of Re){let Be=Fe.type==="ExportNamedDeclaration"?vt(Fe.declaration):Fe;if(!Be)continue;for(let Ve of wp(De,Be,Be.start))Oe.set(Ve.name,Ve)}let Me=(Fe)=>{let Be=Oe.get(Fe);if(Be)return Be;let Ve=Yg(Re,Fe);if(!Ve||Ve.specifier.endsWith(".svelte"))return null;let Ge=Cn(Ve.specifier,De.dir);if(!Ge)return null;return Dn(Ge,Ae).findLast((Ue)=>Ue.name===Ve.importedName)??null};for(let Fe of Re){if(Fe.type==="ExportAllDeclaration"){let Xe=vt(Fe.source)?.value;if(typeof Xe!=="string"||Xe.endsWith(".svelte"))continue;let ze=Cn(Xe,De.dir);if(!ze)continue;let Qe=Fe.exportKind==="type";for(let rt of Dn(ze,Ae))Ie.push(Qe?{...rt,isTypeOnly:!0}:rt);continue}if(Fe.type!=="ExportNamedDeclaration")continue;let Be=vt(Fe.declaration);if(Be){Ie.push(...wp(De,Be,Fe.start));continue}let Ve=vt(Fe.source)?.value,Ge=typeof Ve==="string"?Ve:void 0;if(Ge?.endsWith(".svelte"))continue;let Ue=Fe.exportKind==="type";for(let Xe of Qn(Fe.specifiers)){if(Xe.type!=="ExportSpecifier")continue;let ze=En(vt(Xe.exported)),Qe=En(vt(Xe.local));if(!ze||!Qe||Qe==="default"||ze==="default")continue;let rt=Ue||Xe.exportKind==="type",ot=null;if(Ge){let Ye=Cn(Ge,De.dir);if(Ye)ot=Dn(Ye,Ae).findLast((nt)=>nt.name===Qe)??null}else ot=Me(Qe);if(ot?.declFile.endsWith(".svelte"))continue;if(ot)Ie.push({...ot,name:ze,isTypeOnly:ot.isTypeOnly||rt});else Ie.push({name:ze,kind:rt?"type":"const",declFile:i,isTypeOnly:rt})}}return Ae.computing.delete(i),Ae.cache.set(i,Ie),Ie}async function Fr(i){await Yn();let Ae=Pp(i),Ne=Do(Ae),_e=Dn(Ae,{cache:new Map,computing:new Set}),De=(Oe)=>e(`./${Vg(Ne,Oe)}`),Re=new Map,Ie=new Map;for(let Oe of _e){let Me=Ie.get(Oe.name);if(Me!==void 0&&Me!==Oe.declFile){console.warn(`Warning: "${Oe.name}" is exported from both "${De(Me)}" and "${De(Oe.declFile)}"; keeping the first and dropping the rest.`);continue}Ie.set(Oe.name,Oe.declFile);let{declFile:Fe,returnType:Be,literalValue:Ve,...Ge}=Oe;Re.set(Oe.name,{...Ge,source:De(Fe)})}return Array.from(Re.values()).sort((Oe,Me)=>Oe.name.localeCompare(Me.name))}import{readFileSync as Dp}from"node:fs";import{dirname as Ip,join as Qg,relative as Zg,resolve as ex}from"node:path";var _p=new Map;function tx(i){return Ei(i,{ecmaVersion:"latest",sourceType:"module"})}function nx(i,Ae,Ne){let _e=Cn(i,Ae);if(!_e)return null;let De=Ip(_e);if(Ne.has(_e))return{dir:De,exports:{}};Ne.add(_e);try{return{dir:De,exports:qs(Dp(_e,"utf-8"),De,Ne,_e)}}catch{return{dir:De,exports:{}}}finally{Ne.delete(_e)}}function qs(i,Ae,Ne=new Set,_e=Ae){let De=_p.get(i);if(!De)De=tx(i),_p.set(i,De);let Re={};for(let Ie of De.body)if(Ie.type==="ExportDefaultDeclaration"){let Oe=Ie.declaration.name;if(Oe in Re)Re[Oe].default=!0;else Re[Oe]={source:Nn(""),default:!0}}else if(Ie.type==="ExportAllDeclaration"){if(!Ie.source)continue;let Oe=Ie.source.value,Me=Cn(Oe,Ae);if(!Me){let Ve=ar(Oe,Ae);throw new or(Oe,_e,Ve.unresolved?Ve.searched:"no matching file or index found")}if(Ne.has(Me))continue;Ne.add(Me);let Fe=Dp(Me,"utf-8"),Be=qs(Fe,Ip(Me),Ne,Me);Ne.delete(Me);for(let[Ve,Ge]of Object.entries(Be)){let Ue=Nn(e(`./${Qg(Oe,Ge.source)}`));Re[Ve]={...Ge,source:Ue}}}else if(Ie.type==="ExportNamedDeclaration"){let Oe=Ie.source?.value,Me=Oe!==void 0&&xn.test(Oe);if(Me){let Ve=ar(Oe,Ae);if(Ve.unresolved)throw new or(Oe,_e,Ve.searched)}let Be=Oe!==void 0&&!Me?nx(Oe,Ae,Ne):void 0;if(Be===null)console.warn(`sveld: could not resolve re-exported module "${Oe}" from barrel "${Ae||"."}"; skipping.`);for(let Ve of Ie.specifiers){let Ge=Ve.exported.name,Ue=Ve.local.name,Xe=Ge||Ue;if(Be===null)continue;let ze=Be?.exports[Ue],Qe=ze?Nn(e(`./${Zg(Ae,ex(Be.dir,ze.source))}`)):Nn(Ls(Oe??"",Ae)),rt=ze?ze.default:Ue==="default";if(Xe in Re){if(Re[Xe].mixed=!0,!Re[Xe].source)Re[Xe].source=Qe}else Re[Xe]={source:Qe,default:rt}}}else if(Ie.type==="ImportDeclaration"){let Oe=Ie.specifiers[0].local.name;if(Oe in Re){if(!Re[Oe].source)Re[Oe].source=Nn(Ls(Ie.source?.value??"",Ae))}else Re[Oe]={source:Nn(Ls(Ie.source?.value??"",Ae)),default:Oe==="default"}}return Re}import{existsSync as rx}from"node:fs";import{dirname as sx}from"node:path";function Rp(){return{cache:new Map,computing:new Set}}var ix=/\.[^./\\]+$/;function ox(i){if(i.endsWith(".d.ts"))return null;let Ae=i.replace(ix,".d.ts");return rx(Ae)?Ae:null}function Lp(i,Ae,Ne){let _e=sx(i);return Ae.map((De)=>{if(!De.importSource||!De.importedName)return{candidate:De};let Re=Cn(De.importSource,_e);if(!Re)return{candidate:De,failureReason:"module-not-found"};let Ie=Dn(Re,Ne).find((Me)=>Me.name===De.importedName);if(!Ie)return{candidate:De,failureReason:"export-not-found"};if(Ie.returnType)return{candidate:De,type:Ie.returnType};let Oe=ox(Re);if(Oe){let Me=Dn(Oe,Ne).find((Fe)=>Fe.name===De.importedName);if(Me?.returnType)return{candidate:De,type:Me.returnType}}return{candidate:De,failureReason:"return-type-unresolved"}})}function Op(i,Ae){switch(Ae){case"module-not-found":return`Prop "${i.propName}" default calls "${i.calleeName}()", but "${i.importSource}" could not be resolved; falling back to "any".`;case"export-not-found":return`Prop "${i.propName}" default calls "${i.calleeName}()", but "${i.importedName}" is not exported from "${i.importSource}"; falling back to "any".`;case"return-type-unresolved":return`Prop "${i.propName}" default calls "${i.calleeName}()" imported from "${i.importSource}", but its return type could not be resolved; falling back to "any".`}}import{dirname as ax}from"node:path";function Mp(i,Ae,Ne){let _e=ax(i);return Ae.map((De)=>{let Re=Cn(De.importSource,_e);if(!Re)return{candidate:De};let Ie=Dn(Re,Ne).find((Oe)=>Oe.name===De.importedName);if(Ie?.kind!=="const"||Ie.literalValue===void 0)return{candidate:De};return{candidate:De,key:Ie.literalValue}})}function b(i){return{failFast:i?.failFast,resolveTypes:i?.resolveTypes===!0,documentExports:i?.documentExports===!0,cache:i?.cache,checkExamples:i?.checkExamples==="syntax"?"syntax":i?.checkExamples===!0,dryRun:i?.dryRun===!0,diagnostics:i?.diagnostics,typesTypeNames:i?.typesOptions?.typeNames,typesInline:i?.typesOptions?.inline}}var mx=/-/g,yx=/[^A-Za-z0-9_$]/g,gx=/^[0-9]/;function xx(i){let Ae=i.replace(yx,""),Ne=gx.test(Ae)?`_${Ae}`:Ae;if(Ne!==i)console.warn(`Warning: "${i}" is not a valid identifier; using "${Ne}" instead.`);return Ne}function qp(i,Ae=[],Ne=new Set,_e){let De;try{De=_e??lx(i)}catch{return Ae}if(Ne.has(De))return Ae;Ne.add(De);let Re=Ps(i);if(Re===null)return Ae;let Ie=Re.entries;for(let Oe of Ie){if(Oe.name.startsWith("."))continue;let Me=Bp(i,Oe.name),Fe=Oe.isSymbolicLink(),Be=Fe?Vp(Me,{throwIfNoEntry:!1}):Oe;if(!Be)continue;if(Be.isDirectory())qp(Me,Ae,Ne,Fe?void 0:Bp(De,Oe.name));else if(Be.isFile()&&Oe.name.endsWith(".svelte"))Ae.push(Me)}return Ae}function bx(i){return qp(i).map((Ae)=>{let Ne=xx(ux(Ae,".svelte").replace(mx,"")),_e=Nn(e(`./${Io(i,Ae)}`));return{moduleName:Ne,source:_e}}).sort((Ae,Ne)=>Ae.source.localeCompare(Ne.source))}function Ex(i){return!ys(i)}function Cx(i,Ae){let Ne=i.endsWith("/")?i:`${i}/`;return Ae.startsWith(Ne)}function Gs(i,Ae){return{seenPaths:new Set(i.map(([,Ne])=>Ae(Ne.source))),seenModuleNamePaths:new Map(i.map(([Ne,_e])=>[Ne,Ae(_e.source)])),warnedModuleNames:new Set}}function Ro(i,Ae,Ne,_e,De){for(let{moduleName:Re,source:Ie}of bx(i)){let Oe=_e(Ie),Me=Ae[Re];if(Me&&Ex(Me.source)&&Cx(Me.source,Ie)){De.seenPaths.delete(_e(Me.source)),Me.source=Ie,De.seenPaths.add(Oe),De.seenModuleNamePaths.set(Re,Oe);continue}if(De.seenPaths.has(Oe))continue;De.seenPaths.add(Oe);let Fe=De.seenModuleNamePaths.get(Re);if(Fe===void 0)De.seenModuleNamePaths.set(Re,Oe);else if(Fe!==Oe&&!De.warnedModuleNames.has(Re))De.warnedModuleNames.add(Re),console.warn(`Warning: multiple components named "${Re}" found (${e(Io(i,Fe))} and ${e(Io(i,Oe))}). Both are included in TypeScript definitions, but only one can be the named export.`);Ne.push([Re,{source:Ie,default:!1}])}}function Us(i,Ae,Ne=!1){ws();let _e=jp(i).isFile(),De=_e?Wp(i):i,Re=fr(De),Ie=new Map,Oe=(Be)=>{let Ve=Ie.get(Be);if(Ve===void 0)Ve=fx(Be)?fr(Be):fr(Re,Be),Ie.set(Be,Ve);return Ve},Me={};if(_e){let Be=cx(i,"utf-8");try{Me=qs(Be,Re,new Set([fr(i)]))}catch(Ve){if(!Ne)throw Ve;let Ge=Ve instanceof Error?Ve.message:String(Ve);console.warn(`Warning: Failed to parse component exports from ${i}: ${Ge}`)}}let Fe=Object.entries(Me);if(Ae){let Be=Gs(Fe,Oe);if(Ro(Re,Me,Fe,Oe,Be),!_e)Me=Object.fromEntries(Fe.map(([Ve,Ge])=>[Ve,{...Ge,default:!0}]))}return{exports:Me,allComponentEntries:Fe,rootDir:Re,resolveComponentFilePath:Oe}}async function Hs(i){let Ae=await Promise.all(Array.from(i).map(async(Ne)=>{try{let _e=await px(Ne,"utf-8");return{path:Ne,content:_e}}catch(_e){return console.warn(`Warning: Failed to read file ${Ne}:`,_e),{path:Ne,content:null}}}));return new Map(Ae.map(({path:Ne,content:_e})=>[Ne,_e]))}function jn([i,Ae],Ne,_e,De,Re={}){let Ie=Ae.source,Oe=i;if(Ne.length===1&&i==="default")Oe=hx(Ie).name;if(ys(Ie)){let Me=De(Ie),Fe=_e.get(Me);if(Fe===null||Fe===void 0)return null;let Be=e(Ie),Ve=Re.memo?.get(Me),Ge=Re.hashes?.get(Me),Ue=Ve===void 0?Ge===void 0?null:Re.cache?.get(Me,Ge):null,Xe;if(Ve!==void 0)Xe=Ve;else if(Ue)Xe=Ue;else{let ze=new(Ws()).ComponentParser;try{Xe=ze.parseSvelteComponent(Fe,{moduleName:Oe,filePath:Be})}catch(Qe){if(Re.failFast)throw Qe;let rt=Qe instanceof Error?Qe.message:String(Qe),ot=Qe instanceof Error?Qe.stack:void 0;return Re.onParseError?.({filePath:Be,moduleName:Oe,message:rt,stack:ot}),null}if(Ge!==void 0)Re.cache?.set(Me,Ge,Xe);Re.memo?.set(Me,Xe)}return{moduleName:Oe,filePath:Be,...Xe}}return null}function Lo(i,Ae){let Ne=new Set;for(let _e of i)for(let[,De]of _e)if(ys(De.source))Ne.add(Ae(De.source));return Ne}function Ks(i){if(i.length===0)return;console.error(`sveld: failed to parse ${i.length} component(s):`);for(let{filePath:Ae,message:Ne}of i)console.error(` - ${Ae}: ${Ne}`)}async function S(i,Ae,Ne={}){let _e=Ne.documentExports===!0,{exports:De,allComponentEntries:Re,rootDir:Ie,resolveComponentFilePath:Oe}=Us(i,Ae,_e),Me=_e&&jp(i).isFile()?await Fr(fr(i)):[],Fe=Object.entries(De),Be=Lo([Fe,Re],Oe),Ve=await Hs(Be),Ge=new Map,Ue=new Map,Xe=Ne.cache===!1?void 0:new wo(vp(Ie,Ne.cache??!0)),ze=Xe?new Map:void 0,Qe=new Set,rt=new Map;if(Xe)for(let et of Be){let Je=Ve.get(et);if(Je===null||Je===void 0)continue;let st=Tp(Je);if(rt.set(et,st),!Xe.has(et,st))Qe.add(et)}if(Be.size>0&&(!Xe||Qe.size>0))await Yn();let ot=new Map,Ye=new Map,nt={failFast:Ne.failFast===!0,onParseError:(et)=>ot.set(et.filePath,et),cache:Xe,hashes:rt,memo:Ye};for(let et of Fe){let Je=jn(et,Fe,Ve,Oe,nt);if(Je)Ge.set(Je.moduleName,Je)}for(let et of Re){let Je=jn(et,Re,Ve,Oe,nt);if(Je)Ue.set(Je.filePath,Je),ze?.set(Je.filePath,Oe(et[1].source))}if(Xe&&Qe.size>0){let et=Ir(Ue,Oe),Je=ks(Qe,et);for(let st of Je){if(Qe.has(st))continue;Xe.invalidate(st),Ye.delete(st)}for(let st of Fe){let pt=Oe(st[1].source);if(!Je.has(pt)||Qe.has(pt))continue;let ut=jn(st,Fe,Ve,Oe,nt);if(ut)Ge.set(ut.moduleName,ut)}for(let st of Re){let pt=Oe(st[1].source);if(!Je.has(pt)||Qe.has(pt))continue;let ut=jn(st,Re,Ve,Oe,nt);if(ut)Ue.set(ut.filePath,ut),ze?.set(ut.filePath,pt)}}let it=Array.from(ot.values());if(Ks(it),!Ne.dryRun)Xe?.save();let bt=Ne.resolveTypes?Ax(Ge):[],_t=Ne.checkExamples?Px(Ue):[],Dt=Ne.checkExamples===!0?Fp(_t,"compile"):[],Le=Ne.checkExamples?Fp(_t,"syntax"):[];if(Le.length>0)Nx(Le);let $e=Ne.typesInline==="all"?js(Ue,Oe):new Map,je,qe;if(bt.length>0||Dt.length>0||$e.size>0){let{TypeResolver:et}=await import("./chunk-s4f6b34h.js"),Je=await et.create(Ie);if(!Je.ok){let pt=[bt.length>0?"resolveTypes":null,Dt.length>0?"checkExamples":null,$e.size>0?'typesOptions.inline: "all"':null].filter((ut)=>ut!==null).join(" and ");throw Error(`sveld: \`${pt}\` ${Je.message}.`)}let st=Je.resolver;try{if(bt.length>0)await wx(bt,st,Oe);if(Dt.length>0)await _x(Dt,st,Oe);if($e.size>0)je=await st.openBareTypeSession($e),qe=st;else await st.dispose()}catch(pt){throw await st.dispose(),pt}}let He=Sx(Ue),Ke=Tx(Ue);if(He.length>0||Ke.length>0){await Yn();let et=Rp();for(let{component:Je,candidates:st}of He){let pt=Lp(Oe(Je.filePath),st,et);vx(Je,pt)}for(let{component:Je,candidates:st}of Ke){let pt=Mp(Oe(Je.filePath),st,et);kx(Je,pt)}}Lx(Ue,Oe,Ne.typesTypeNames);let Ze;try{Ze=Ne.typesInline==="local"||Ne.typesInline==="all"?await Vs(Ue,Oe,Ne.typesTypeNames,je):void 0}finally{if(je)await je.dispose();if(qe)await qe.dispose()}let tt=Jc(ds(Array.from(Ue.values()).flatMap((et)=>et.diagnostics??[])),Ne.diagnostics?.ignore);return{exports:De,entryExports:Me,components:Ge,allComponentsForTypes:Ue,errors:it,diagnostics:tt,cache:Xe,resolvedPathByFilePath:ze,inlinedTypesByFilePath:Ze}}function Sx(i){let Ae=[];for(let Ne of i.values()){let _e=mn(Ne)?.pendingCallDefaultCandidates?.filter((De)=>De.importSource!==void 0);if(!_e||_e.length===0)continue;Ae.push({component:Ne,candidates:_e})}return Ae}function vx(i,Ae){for(let{candidate:Ne,type:_e,failureReason:De}of Ae){let Ie=(Ne.location==="props"?i.props:i.moduleExports).find((Oe)=>Oe.name===Ne.propName);if(Ie?.typeSource!=="unknown")continue;if(_e){if(Ie.type=_e,Ie.typeSource="typescript",Ne.location==="props")i.diagnostics=(i.diagnostics??[]).filter((Oe)=>!(Oe.kind==="prop-unknown-type"&&Oe.name===Ne.propName));continue}if(Ne.location==="props"&&De){let Oe=i.diagnostics?.find((Me)=>Me.kind==="prop-unknown-type"&&Me.name===Ne.propName);if(Oe)Oe.message=Op(Ne,De)}}}function Tx(i){let Ae=[];for(let Ne of i.values()){let _e=mn(Ne)?.pendingContextKeyCandidates;if(!_e||_e.length===0)continue;Ae.push({component:Ne,candidates:_e})}return Ae}function kx(i,Ae){for(let{candidate:Ne,key:_e}of Ae){if(!_e){console.warn(`Warning: Could not resolve setContext key in ${i.filePath}. Use a string literal, const-bound string, or Symbol(). Skipping context type generation.`);continue}if(i.contexts?.some((De)=>De.key===_e))continue;i.contexts=[...i.contexts??[],{key:_e,typeName:Pr(_e),description:Ne.description,properties:Ne.properties,source:Ne.source}]}}function Ax(i){let Ae=[];for(let Ne of i.values()){let _e=mn(Ne);if(!_e?.canonicalPropsType||Ne.props.length>0)continue;Ae.push({component:Ne,metadata:_e})}return Ae}async function wx(i,Ae,Ne){let _e=await Ae.expandAll(i.map(({component:De,metadata:Re})=>({moduleName:De.moduleName,metadata:Re,filePath:Ne(De.filePath)})));for(let{component:De}of i){let Re=_e.get(Ne(De.filePath));if(Re)zc(De,Re)}}function Px(i){let Ae=[];for(let Ne of i.values()){let _e=Wl(Ne);if(_e.length===0)continue;Ae.push({component:Ne,sources:_e})}return Ae}function Fp(i,Ae){let Ne=[];for(let{component:_e,sources:De}of i){let Re=De.filter((Ie)=>Ie.kind===Ae);if(Re.length===0)continue;Ne.push({component:_e,sources:Re})}return Ne}function Nx(i){for(let{component:Ae,sources:Ne}of i){let _e=Ae.diagnostics??[];for(let De of Ne)try{A(De.code)}catch(Re){if(Re instanceof T)continue;_e.push(yn({component:Ae.filePath,kind:"example-syntax-error",name:De.name,message:Re instanceof Error?Re.message:String(Re),...De.source?{source:De.source}:{}}))}Ae.diagnostics=_e}}async function _x(i,Ae,Ne){let _e=await Ae.checkExamples(i.map(({component:De,sources:Re})=>({moduleName:De.moduleName,filePath:Ne(De.filePath),sources:Re})));for(let{component:De,sources:Re}of i){let Ie=_e.get(Ne(De.filePath));if(!Ie||Ie.length===0)continue;let Oe=new Map(Re.map((Fe)=>[Fe.id,Fe.source])),Me=De.diagnostics??[];for(let Fe of Ie){let Be=Oe.get(Fe.id);Me.push(yn({component:De.filePath,kind:"example-compile-error",name:Fe.name,message:Fe.message,...Be?{source:Be}:{}}))}De.diagnostics=Me}}var Dx=[".ts",".tsx",".d.ts",".svelte"];function Ix(i){let Ae=i.trim();if(Ae.length<2)return;let Ne=Ae[0],_e=Ae[Ae.length-1];if((Ne==='"'||Ne==="'"||Ne==="`")&&Ne===_e)return Ae.slice(1,-1);return}function Rx(i,Ae){let Ne=fr(Wp(i),Ae);if($p(Ne)&&Vp(Ne).isFile())return Ne;if(dx(Ae)!=="")return;for(let _e of Dx){let De=`${Ne}${_e}`;if($p(De))return De}return}function Lx(i,Ae,Ne){let _e=new Map(Array.from(i.values()).map((De)=>[Ae(De.filePath),De]));for(let De of i.values()){let Re=De.extends;if(!Re)continue;let Ie=Ix(Re.import);if(Ie===void 0||!Ie.startsWith(".")&&!Ie.startsWith("/"))continue;let Oe=Ae(De.filePath),Me=Rx(Oe,Ie),Fe=De.diagnostics??[];if(Me===void 0){Fe.push(yn({component:De.filePath,kind:"extend-props-target-missing",name:Re.interface,message:`@extends/@extendProps target "${Ie}" was not found on disk.`})),De.diagnostics=Fe;continue}let Be=_e.get(Me);if(!Be)continue;let Ve=Fn(Be.moduleName,Ne);if(Re.interface!==Ve){Fe.push(yn({component:De.filePath,kind:"extend-props-target-missing",name:Re.interface,message:`@extends/@extendProps names "${Re.interface}", but "${Ie}" generates "${Ve}".`})),De.diagnostics=Fe;continue}for(let Ge of De.props){let Ue=Be.props.find((Xe)=>Xe.name===Ge.name);if(Ue&&Ue.type!==Ge.type)Fe.push(yn({component:De.filePath,kind:"extend-props-override",name:Ge.name,message:`Own prop "${Ge.name}" (${Ge.type}) overrides "${Ve}"'s "${Ge.name}" (${Ue.type}).`}))}De.diagnostics=Fe}}import{existsSync as Gp,readFileSync as Ox}from"node:fs";import{join as Up}from"node:path";function D(i){if(i){let Ne=Up(process.cwd(),i);if(Gp(Ne))return Dr(i);return console.error(`Invalid entry point: ${Ne}. Pass a valid --entry (or "entry" option), or unset it and`),console.error('set the "svelte" field in your package.json instead.'),null}let Ae=Up(process.cwd(),"package.json");if(!Gp(Ae))return console.error("Could not locate a package.json file."),console.error(`Specify an entry point with --entry (or the "entry" option) instead.
|
|
205
|
-
`),null;try{let Ne=_s(JSON.parse(Ox(Ae,"utf-8")));if(Ne.svelte?.trim())return Dr(Ne.svelte);return console.error(`Could not determine an entry point.
|
|
206
|
-
`),console.error(`Specify an entry point to your Svelte code in the "svelte" field of your package.json, or pass --entry (or the "entry" option).
|
|
207
|
-
`),null}catch(Ne){throw console.error("Error reading package.json:",Ne),Ne}}var Oo=!1;function I(i){Oo=i}function en(i){if(!Oo)console.error(i)}function Hp(i){if(!Oo)console.error(i)}import{lstatSync as Mx}from"node:fs";import{resolve as zs}from"node:path";async function Kp(i,Ae,Ne=!1,_e,De){let Re=Mx(i).isFile(),Ie=Re?zs(i):null,Oe=Us(i,Ae,Ne),{rootDir:Me,exports:Fe,allComponentEntries:Be,resolveComponentFilePath:Ve}=Oe,Ge;if(_e==="all"){let{TypeResolver:je}=await import("./chunk-s4f6b34h.js"),qe=await je.create(Me);if(!qe.ok)throw Error(`sveld: \`typesOptions.inline: "all"\` ${qe.message}.`);Ge=qe.resolver}let Ue=Ne&&Re?await Fr(zs(i)):[],Xe=Object.entries(Fe),ze=Gs(Be,Ve),Qe=new Map,rt=new Map;await Yn();let ot=new Map,Ye={onParseError:(je)=>ot.set(je.filePath,je)},nt=new Map,it=new Map,bt=async(je)=>{if(_e!=="local"&&_e!=="all")return;for(let Ke of je.values()){nt.delete(Ke.filePath);for(let Ze of it.values())Ze.delete(Ke.filePath)}let qe=new Map;if(_e==="all"&&Ge)Ge.forgetOverlayFiles(Array.from(je.values(),(Ke)=>To(Ve(Ke.filePath),Ke.moduleName))),qe=js(je,Ve);let He;try{if(Ge&&qe.size>0)He=await Ge.openBareTypeSession(qe);let Ke=await Vs(je,Ve,De,He);for(let[Ze,tt]of Ke){nt.set(Ze,tt);for(let et of tt.dependencies){let Je=it.get(et);if(!Je)Je=new Set,it.set(et,Je);Je.add(Ze)}}}finally{if(He)await He.dispose()}},_t=()=>({exports:Fe,entryExports:Ue,components:Qe,allComponentsForTypes:rt,errors:Array.from(ot.values()),diagnostics:ds(Array.from(rt.values()).flatMap((je)=>je.diagnostics??[])),inlinedTypesByFilePath:_e==="local"||_e==="all"?nt:void 0});{let je=Lo([Xe,Be],Ve),qe=await Hs(je);for(let He of Xe){let Ke=jn(He,Xe,qe,Ve,Ye);if(Ke)Qe.set(Ke.moduleName,Ke)}for(let He of Be){let Ke=jn(He,Be,qe,Ve,Ye);if(Ke)rt.set(Ke.filePath,Ke)}await bt(rt),Ks(Array.from(ot.values()))}let Dt=Ir(rt,Ve),Le=(je,qe,He,Ke,Ze)=>{let tt=new Set;for(let et of He){let Je=Ve(et[1].source);if(!Ke.has(Je))continue;let st=jn(et,He,Ze,Ve,Ye);if(st)je.set(qe(st),st),tt.add(Je);else for(let[pt,ut]of je)if(Ve(ut.filePath)===Je)je.delete(pt)}return tt};return{get result(){return Promise.resolve(_t())},update:async(je)=>{let qe=je.map((ht)=>zs(ht));if(ws(),qe.length===0)return{result:_t(),reparsed:[]};let He=new Set;for(let ht of qe){let yt=it.get(ht);if(yt)for(let It of yt)He.add(It)}let Ke=Ie!==null&&qe.includes(Ie),Ze=[];if(Ke){let ht=Us(i,Ae,Ne),yt=new Set(Object.keys(Fe)),It=new Set(Object.keys(ht.exports));for(let Mt of yt)if(!It.has(Mt))Qe.delete(Mt);for(let Mt of It)if(!yt.has(Mt))Ze.push(ht.resolveComponentFilePath(ht.exports[Mt].source));if(Fe=ht.exports,Be=ht.allComponentEntries,Ve=ht.resolveComponentFilePath,Xe=Object.entries(Fe),ze=Gs(Be,Ve),Ne&&Re)Ue=await Fr(zs(i))}if(Ae)Ro(Me,Fe,Be,Ve,ze);let tt=qe.filter((ht)=>xn.test(ht)||Dt.has(ht));if(tt.length===0&&Ze.length===0){if(He.size>0){let ht=new Map;for(let[yt,It]of rt)if(He.has(It.filePath))ht.set(yt,It);await bt(ht)}return{result:_t(),reparsed:[]}}let et=ks([...tt,...Ze],Dt);for(let[ht,yt]of ot)if(et.has(Ve(yt.filePath)))ot.delete(ht);let Je=await Hs(et),st=new Set;for(let ht of Le(Qe,(yt)=>yt.moduleName,Xe,et,Je))st.add(ht);for(let ht of Le(rt,(yt)=>yt.filePath,Be,et,Je))st.add(ht);Dt=Ir(rt,Ve);let pt=new Map;for(let[ht,yt]of rt)if(st.has(Ve(yt.filePath))||He.has(yt.filePath))pt.set(ht,yt);await bt(pt);for(let ht of nt.keys())if(!rt.has(ht))nt.delete(ht);let ut=_t();return Ks(ut.errors),{result:ut,reparsed:Array.from(st)}}}}import Qx from"node:path";import{mkdir as $x,readFile as Bx,writeFile as Fx}from"node:fs/promises";import{parse as jx}from"node:path";class qt{dryRun;ensuredDirs=new Set;constructor(i){this.dryRun=i?.dryRun===!0}async write(i,Ae){if(this.dryRun)return console.log(`would write "${e(i)}"`),!0;try{if(await Bx(i,"utf-8")===Ae)return!1}catch{}let Ne=jx(i).dir;if(!this.ensuredDirs.has(Ne))await $x(Ne,{recursive:!0}),this.ensuredDirs.add(Ne);return await Fx(i,Ae),!0}}var Vx=/^=>\s*/;function Wx(i){let Ae=i.trim();if(!Ae.startsWith("("))return{parameters:[],returnTypeText:Ae||"any"};let Ne=0,_e=-1;for(let Oe=0;Oe<Ae.length;Oe++)if(Ae[Oe]==="(")Ne++;else if(Ae[Oe]===")"){if(Ne--,Ne===0){_e=Oe;break}}if(_e===-1)return{parameters:[],returnTypeText:"any"};let De=Ae.slice(1,_e).trim(),Re=Ae.slice(_e+1).trim().replace(Vx,"");return{parameters:De===""?[]:gn(De).map((Oe)=>{let Me=Oe.trim(),Fe=Me.startsWith("..."),Be=Fe?Me.slice(3):Me,Ve=Be.indexOf(":"),Ge=(Ve===-1?Be:Be.slice(0,Ve)).trim(),Ue=Ve===-1?void 0:Be.slice(Ve+1).trim(),Xe=Ge.endsWith("?"),ze={name:Xe?Ge.slice(0,-1):Ge};if(Ue)ze.type={text:Ue};if(Xe)ze.optional=!0;if(Fe)ze.rest=!0;return ze}),returnTypeText:Re||"any"}}function qx(i){if(i.params!==void 0||i.returnType!==void 0)return{parameters:(i.params??[]).map((Ne)=>{let _e={name:Ne.name};if(Ne.type)_e.type={text:Ne.type};if(Ne.optional)_e.optional=!0;return _e}),returnTypeText:i.returnType??"any"};return i.type?Wx(i.type):{parameters:[],returnTypeText:"any"}}function Gx(i){return i.map((Ae)=>{if(Ae.isFunctionDeclaration){let{parameters:_e,returnTypeText:De}=qx(Ae),Re={kind:"method",name:Ae.name,static:!1};if(_e.length>0)Re.parameters=_e;if(Re.return={type:{text:De}},Ae.description)Re.description=Ae.description;if(Ae.deprecated!==void 0)Re.deprecated=Ae.deprecated;return Re}let Ne={kind:"field",name:Ae.name};if(Ae.type)Ne.type={text:Ae.type};if(Ae.value!==void 0)Ne.default=Ae.value;if(Ae.description)Ne.description=Ae.description;if(Ae.deprecated!==void 0)Ne.deprecated=Ae.deprecated;if(Ae.kind==="const")Ne.readonly=!0;return Ne})}function Ux(i){let Ae=i.customElement?.props,Ne=new Map,_e=[];for(let De of i.props){if(De.isFunctionDeclaration)continue;let Re=Ae?.[De.name];if(Re?.attribute===!1)continue;let Ie=Re?.attribute||De.name.toLowerCase(),Oe=Ne.get(Ie);if(Oe!==void 0){console.warn(`sveld: props "${Oe}" and "${De.name}" of component "${i.moduleName}" both map to the custom-element attribute "${Ie}"; only "${Oe}" is included.`);continue}Ne.set(Ie,De.name);let Fe=Re?.type==="Array"||Re?.type==="Object"?[De.description,"Serialized to/from JSON for the attribute."].filter(Boolean).join(" "):De.description,Be={name:Ie,fieldName:De.name};if(De.type)Be.type={text:De.type};if(De.value!==void 0)Be.default=De.value;if(Fe)Be.description=Fe;if(Re?.reflect)Be.reflects=!0;_e.push(Be)}return _e}function Hx(i){if(!i||i.length===0)return;return i.map((Ae)=>{let Ne={name:Ae.name};if(Ae.description)Ne.description=Ae.description;return Ne})}function Kx(i){if(!i||i.length===0)return;return i.map((Ae)=>{let Ne={name:Ae.name};if(Ae.type)Ne.type={text:Ae.type};if(Ae.default!==void 0)Ne.default=Ae.default;if(Ae.description)Ne.description=Ae.description;return Ne})}function zx(i){return i.filter((Ae)=>Ae.type==="dispatched").map((Ae)=>{let Ne={name:Ae.name,type:{text:`CustomEvent<${Ae.detail??"unknown"}>`}};if(Ae.description)Ne.description=Ae.description;if(Ae.deprecated!==void 0)Ne.deprecated=Ae.deprecated;return Ne})}function Xx(i){return i.map((Ae)=>{let Ne={name:Ae.default?"":Ae.name??""};if(Ae.description)Ne.description=Ae.description;if(Ae.deprecated!==void 0)Ne.deprecated=Ae.deprecated;return Ne})}function Jx(i){let Ae=Hx(i.cssParts),Ne=Kx(i.cssProperties),_e=Gx(i.props),De=Ux(i),Re=zx(i.events),Ie=Xx(i.slots),Oe=i.moduleName,Me=i.componentComment?{kind:"class",name:Oe,description:i.componentComment,members:_e,attributes:De,events:Re,slots:Ie}:{kind:"class",name:Oe,members:_e,attributes:De,events:Re,slots:Ie};if(Ae)Me.cssParts=Ae;if(Ne)Me.cssProperties=Ne;if(i.customElementTag)Me.tagName=i.customElementTag,Me.customElement=!0;return Me}function Yx(i,Ae){let Ne=[{kind:"js",name:i.moduleName,declaration:{name:i.moduleName,module:Ae}}];if(i.customElementTag)Ne.push({kind:"custom-element-definition",name:i.customElementTag,declaration:{name:i.moduleName,module:Ae}});return Ne}function zp(i,Ae={}){let Ne=o(i),_e=Ae.resolveModulePath??((Re)=>Re.filePath);return{schemaVersion:"1.0.0",modules:Ne.components.map((Re)=>{let Ie=_e(Re);return{kind:"javascript-module",path:Ie,declarations:[Jx(Re)],exports:Yx(Re,Ie)}})}}function Mo(i,Ae){let Ne=zp(i,{resolveModulePath:(_e)=>gs(_e.filePath,Ae.inputDir)});return Xn(Ne)}async function $o(i,Ae){let Ne=Mo(i,Ae),_e=Qx.join(process.cwd(),Ae.outFile),Re=await new qt({dryRun:Ae.dryRun}).write(_e,Ne);if(!Ae.dryRun)en(`${Re?"created":"unchanged"} "${Ae.outFile}".`)}import Fo from"node:path";function Xp(i){let Ae=new Map;for(let[_e,De]of Object.entries(i)){let Re=Ae.get(De.source)||[];Re.push({id:_e,exportee:De}),Ae.set(De.source,Re)}let Ne=[];for(let[_e,De]of Ae){let Re=xn.test(_e),Ie=De.some(({id:Ge,exportee:Ue})=>Ge!=="default"&&Ue.default),Oe=De.some(({exportee:Ge})=>!Ge.default),Me=Re&&Ie&&Oe,Fe=[],Be=[],Ve=[];for(let{id:Ge,exportee:Ue}of De){if(Ge==="default"){Be.push(`export { default } from "${_e}";`);continue}if(Ue.default)if(Ue.mixed)Be.push(`export { default as ${Ge} } from "${_e}";`),Be.push(`export { default } from "${_e}";`);else Ve.push(`default as ${Ge}`);else if(Re&&!Me)Ve.push(`default as ${Ge}`);else Fe.push(Ge)}if(Ve.length>0&&Fe.length>0)Ne.push(`export { ${[...Ve,...Fe].join(", ")} } from "${_e}";`);else{if(Fe.length>0)Ne.push(`export { ${Fe.join(", ")} } from "${_e}";`);if(Ve.length>0)Ne.push(`export { ${Ve.join(", ")} } from "${_e}";`)}Ne.push(...Be)}return Ne.join(`
|
|
208
|
-
`)}function Jp(i){return i.filter((Ae)=>Ae.names.length>0).map((Ae)=>`export type { ${Ae.names.join(", ")} } from "${Ae.source}";`).join(`
|
|
209
|
-
`)}function Yp(i){return i.replace(xn,"")}function Bo(i){return i.replace(xn,".svelte.d.ts")}function Zx(i){return typeof i==="object"&&i!==null&&!Array.isArray(i)&&"start"in i&&"end"in i}function jr(i){if(Array.isArray(i))return i.map((Ae)=>jr(Ae));if(i!==null&&typeof i==="object"){let Ae={};for(let[Ne,_e]of Object.entries(i)){if((Ne==="source"||Ne==="componentCommentSource")&&Zx(_e))continue;Ae[Ne]=jr(_e)}return Ae}return i}function jo(i,Ae){return i.map((Ne)=>({...Ne,filePath:gs(Ne.filePath,Ae)}))}function e0(i,Ae,Ne){if(!Ae)return`${i.moduleName}.api.json`;if(!Ne.has(i.moduleName))Ne.add(i.moduleName),console.warn(`Warning: multiple components named "${i.moduleName}" found. Their JSON files are keyed by source path instead of name to avoid overwriting each other.`);return`${Yp(i.filePath)}.api.json`}async function t0(i,Ae){let Ne=o(i),_e=jo(Ne.components,Ae.inputDir);if(Ae.source===!1)_e=jr(_e);let De=new Map;for(let Ie of _e)De.set(Ie.moduleName,(De.get(Ie.moduleName)??0)+1);let Re=new Set;await Promise.all(_e.map(async(Ie)=>{let Oe=(De.get(Ie.moduleName)??0)>1,Me=e0(Ie,Oe,Re),Fe=Fo.resolve(Fo.join(Ae.outDir||"",Me)),Ve=await new qt({dryRun:Ae.dryRun}).write(Fe,Xn(Ie));if(!Ae.dryRun)en(`${Ve?"created":"unchanged"} "${Fe}".`)}))}function Vo(i,Ae){let Ne=o(i,{entryExports:Ae.entryExports}),_e={...Ne,components:jo(Ne.components,Ae.inputDir)};if(Ae.source===!1)_e=jr(_e);return Xn(_e)}function Qp(i,Ae){let Ne=o(i,{entryExports:Ae.entryExports}),_e=jo(Ne.components,Ae.inputDir);if(Ae.source===!1)_e=jr(_e);return`${_e.map((De)=>JSON.stringify(De)).join(`
|
|
210
|
-
`)}
|
|
211
|
-
`}async function n0(i,Ae){let Ne=Vo(i,Ae),_e=Fo.join(process.cwd(),Ae.outFile),Re=await new qt({dryRun:Ae.dryRun}).write(_e,Ne);if(!Ae.dryRun)en(`${Re?"created":"unchanged"} "${Ae.outFile}".`)}async function Wo(i,Ae){if(Ae.outDir)await t0(i,Ae);else await n0(i,Ae)}import ti from"node:path";import{readFileSync as r0}from"node:fs";import{join as s0}from"node:path";function Zp(){try{let{name:i,description:Ae}=_s(JSON.parse(r0(s0(process.cwd(),"package.json"),"utf-8")));return{name:i,description:Ae}}catch{return{}}}var Go=/`/g,eu=/\s+/g,zt="--",tu=`| Prop name | Required | Kind | Reactive | Binding | Type | Default value | Description |
|
|
212
|
-
| :- | :- | :- | :- | :- | :- | :- | :- |
|
|
213
|
-
`,Xs=`| Slot name | Default | Props | Fallback | Description |
|
|
214
|
-
| :- | :- | :- | :- | :- |
|
|
215
|
-
`,Js=`| Event name | Type | Detail | Description |
|
|
216
|
-
| :- | :- | :- | :- |
|
|
217
|
-
`,Uo=`| Name | Kind | Type | Description |
|
|
218
|
-
| :- | :- | :- | :- |
|
|
219
|
-
`,nu=`| Part name | Description |
|
|
220
|
-
| :- | :- |
|
|
221
|
-
`,ru=`| Property name | Type | Default value | Description |
|
|
222
|
-
| :- | :- | :- | :- |
|
|
223
|
-
`,Wr=/\|/g,i0=/</g,o0=/>/g,hr=/\n/g,a0=/\{@link\s+([^{}\s|]+)(?:\|([^{}]+))?\}/g;function qo(i){return i.replace(a0,(Ae,Ne,_e)=>`[${_e===void 0?Ne:_e.trim()}](${Ne})`)}function dn(i){if(i===void 0)return zt;return`<code>${i.replace(Wr,"|")}</code>`}function Vr(i){return i.replace(i0,"<").replace(o0,">")}function qr(i){if(i===void 0)return zt;return`<code>${i.replace(Go,"\\`").replace(Wr,"|")}</code>`}function Sn(i,Ae){if(Ae===void 0)return i;let Ne=typeof Ae==="string"&&Ae.trim().length>0?`: ${Vr(Ae).replace(hr," ").replace(Wr,"|")}`:"";return`<s>${i}</s><br />**Deprecated**${Ne}`}function Ys(i){if(i===void 0||i.trim().length===0)return zt;return Vr(qo(i)).replace(Wr,"|").replace(hr,"<br />")}function Qs(i){if(i===void 0||i==="{}")return zt;return dn($s(i).replace(hr," "))}function Zs(i){if(i===void 0)return zt;return dn(Vr(i).replace(hr,"<br />"))}function In(i,Ae){let Ne=[];if(i!==void 0&&i.trim().length>0)Ne.push(Vr(qo(i)));for(let{name:_e,body:De}of Ae??[]){let Re=De?.trim();Ne.push(Re?`@${_e} ${Vr(qo(Re))}`:`@${_e}`)}if(Ne.length===0)return zt;return Ne.join(`
|
|
224
|
-
`).replace(Wr,"|").replace(hr,"<br />")}function ei(i){if(i===void 0)return zt;return dn(i.replace(hr," "))}var c0=/[^\w\- ]+/g,l0=/\s+/g;function p0(i,Ae){let Ne=i.toLowerCase().replace(Go,"").replace(c0,"").replace(l0,"-"),_e=Ae.get(Ne)??0;return Ae.set(Ne,_e+1),_e===0?Ne:`${Ne}-${_e}`}class mr{sourceParts=[];hasToC=!1;toc=[];get source(){return this.sourceParts.join("")}appendLineBreaks(){return this.sourceParts.push(`
|
|
225
|
-
|
|
226
|
-
`),this}append(i,Ae){switch(i){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":{let Ne=Number(i.slice(-1));if(this.sourceParts.push(`${"#".repeat(Ne)} ${Ae}`),this.hasToC&&i==="h2")this.toc.push({indent:0,raw:Ae??""});break}case"quote":this.sourceParts.push(`> ${Ae}`);break;case"p":this.sourceParts.push(Ae??"");break;case"divider":this.sourceParts.push("---");break;case"raw":this.sourceParts.push(Ae??"");break}if(i!=="raw")this.appendLineBreaks();return this}tableOfContents(){return this.sourceParts.push("<!-- __TOC__ -->"),this.hasToC=!0,this.appendLineBreaks(),this}end(){let i=this.sourceParts.join("");if(!this.hasToC)return i;let Ae="<!-- __TOC__ -->",Ne=i.indexOf(Ae);if(Ne===-1)return i;let _e=new Map,De=this.toc.map(({indent:Re,raw:Ie})=>`${" ".repeat(Re)}- [${Ie}](#${p0(Ie,_e)})`).join(`
|
|
227
|
-
`);return i.slice(0,Ne)+De+i.slice(Ne+Ae.length)}}var u0=`| Name | Type | Default | Required | Description |
|
|
228
|
-
| :- | :- | :- | :- | :- |
|
|
229
|
-
`,d0=/[.!?](?:\s|$)/,f0=/\r?\n[ \t]*\r?\n/,h0=/\s+/g;function su(i,Ae){if(!i)return Ae;let Ne=i.trim().split(f0)[0]?.replace(h0," ").trim();if(!Ne)return Ae;let _e=d0.exec(Ne);return _e?Ne.slice(0,_e.index+1):Ne}function Ho(i,Ae,Ne){if(Ne.length===0)return;i.append("h3",Ae),i.append("raw",u0);for(let _e of Ne)i.append("raw",`| ${Sn(_e.name,_e.deprecated)} | ${dn(_e.type)} | ${qr(_e.value)} | ${_e.isRequired?"Yes":"No"} | ${In(_e.description,_e.tags)} |
|
|
230
|
-
`);i.append("raw",`
|
|
231
|
-
`)}function m0(i,Ae){if(Ae.length===0)return;i.append("h3","Events"),i.append("raw",Js);for(let Ne of Ae)i.append("raw",`| ${Sn(Ne.name,Ne.deprecated)} | ${Ne.type} | ${Ne.type==="dispatched"?ei(Ne.detail):zt} | ${In(Ne.description,Ne.tags)} |
|
|
232
|
-
`);i.append("raw",`
|
|
233
|
-
`)}function y0(i,Ae,Ne){if(Ne.length===0)return;i.append("h3",Ae),i.append("raw",Xs);for(let _e of Ne)i.append("raw",`| ${Sn(_e.default?zt:_e.name??zt,_e.deprecated)} | ${_e.default?"Yes":"No"} | ${Qs(_e.slot_props)} | ${Zs(_e.fallback)} | ${In(_e.description,_e.tags)} |
|
|
234
|
-
`);i.append("raw",`
|
|
235
|
-
`)}function g0(i,Ae){if(Ae.typedefs.length===0)return;i.append("h3","Typedefs"),i.append("raw",`\`\`\`ts
|
|
236
|
-
${pr({typedefs:Ae.typedefs})}
|
|
237
|
-
\`\`\`
|
|
238
|
-
|
|
239
|
-
`)}function x0(i,Ae){if(i.append("h2",Ae.moduleName),Ae.generics)i.append("p",`Type parameters: ${dn(`<${Ae.generics[1]}>`)}`);if(Ae.componentComment?.trim())i.append("p",Ae.componentComment.trim());Ho(i,"Props",Ae.props),Ho(i,"Bindings",Ae.props.filter((Ne)=>Ne.reactive)),m0(i,Ae.events),y0(i,Ae.syntaxMode==="runes"?"Snippets":"Slots",Ae.slots),g0(i,Ae),Ho(i,"Module exports",Ae.moduleExports)}function b0(i,Ae,Ne,_e){let De=new mr,Re=_e.linkBase??"";if(De.append("h1",Ae),Ne)De.append("quote",Ne);De.append("h2","Components");for(let Ie of i)De.append("raw",`- [${Ie.moduleName}](${Re}/${Ie.moduleName}): ${su(Ie.componentComment,"Component")}
|
|
240
|
-
`);if(De.append("raw",`
|
|
241
|
-
`),_e.entryExports&&_e.entryExports.length>0){De.append("h2","Exports");for(let Ie of _e.entryExports)De.append("raw",`- \`${Ie.name}\`: ${su(Ie.description,Ie.kind)}
|
|
242
|
-
`);De.append("raw",`
|
|
243
|
-
`)}return De.end()}function E0(i,Ae,Ne){let _e=new mr;if(_e.append("h1",Ae),Ne)_e.append("quote",Ne);for(let De of i)x0(_e,De);return _e.end()}function C0(i,Ae){let Ne=o(i,{entryExports:Ae.entryExports}),_e=Zp(),De=Ae.title??_e.name??"Components",Re=Ae.summary??_e.description;return{llmsTxt:b0(Ne.components,De,Re,Ae),llmsFullTxt:E0(Ne.components,De,Re)}}async function Ko(i,Ae){let{llmsTxt:Ne,llmsFullTxt:_e}=C0(i,Ae),De=new qt({dryRun:Ae.dryRun}),Re=e(ti.join(Ae.outDir??"","llms.txt")),Ie=e(ti.join(Ae.outDir??"","llms-full.txt")),[Oe,Me]=await Promise.all([De.write(ti.join(process.cwd(),Re),Ne),De.write(ti.join(process.cwd(),Ie),_e)]);if(!Ae.dryRun)en(`${Oe?"created":"unchanged"} "${Re}".`),en(`${Me?"created":"unchanged"} "${Ie}".`)}import{join as Xo,resolve as pu}from"node:path";function iu(i,Ae,Ne){if(i.append("h1","Component Index"),i.append("h2","Components").tableOfContents(),i.append("divider"),Ne&&Ne.length>0)au(i,Ne);let _e=o(Ae);for(let De of _e.components)lu(i,De)}function ou(i,Ae,Ne){i.append("h1","Component Index"),i.append("h2","Components");for(let _e of Ae)i.append("raw",`- [${_e.moduleName}](./${_e.moduleName}.md)
|
|
244
|
-
`);if(i.append("raw",`
|
|
245
|
-
`),i.append("divider"),Ne&&Ne.length>0)au(i,Ne)}function au(i,Ae){i.append("h2","Exports"),i.append("raw",Uo);for(let Ne of Ae){let _e=(Ne.type??Ne.value)?.replace(eu," ").trim();i.append("raw",`| ${Sn(Ne.name,Ne.deprecated)} | ${`<code>${Ne.kind}</code>`} | ${dn(_e)} | ${Ys(Ne.description)} |
|
|
246
|
-
`)}i.append("raw",`
|
|
247
|
-
`),i.append("divider")}function S0(i){return i.kind==="const"||i.isFunctionDeclaration}function v0(i,Ae){i.append("h3","Module exports"),i.append("raw",Uo);for(let Ne of Ae)i.append("raw",`| ${Sn(Ne.name,Ne.deprecated)} | ${`<code>${Ne.kind}</code>`} | ${dn(Ne.type)} | ${In(Ne.description,Ne.tags)} |
|
|
248
|
-
`);i.append("raw",`
|
|
249
|
-
`)}function zo(i,Ae,Ne,_e){if(Ae.length>0)Ne(),i.append("raw",`
|
|
250
|
-
`);else i.append("p",_e??"None.")}function cu(i,Ae){lu(i,Ae)}function lu(i,Ae){if(i.append("h2",`\`${Ae.moduleName}\``),Ae.generics)i.append("p",`**Type parameters:** ${dn(`<${Ae.generics[1]}>`)}`);if(Ae.typedefs.length>0)i.append("h3","Types").append("raw",`\`\`\`ts
|
|
251
|
-
${pr({typedefs:Ae.typedefs})}
|
|
252
|
-
\`\`\`
|
|
253
|
-
|
|
254
|
-
`);if(i.append("h3","Props"),zo(i,Ae.props,()=>{i.append("raw",tu);let Ne=(De)=>De.reactive?0:De.constant?2:1,_e=Ae.props.map((De,Re)=>({prop:De,index:Re})).sort((De,Re)=>Ne(De.prop)-Ne(Re.prop)||De.index-Re.index).map(({prop:De})=>De);for(let De of _e){let Re=S0(De)?"accessor":De.kind;i.append("raw",`| ${Sn(De.name,De.deprecated)} | ${De.isRequired?"Yes":"No"} | ${`<code>${Re}</code>`} | ${De.reactive?"Yes":"No"} | ${De.binding??"--"} | ${dn(De.type)} | ${qr(De.value)} | ${In(De.description,De.tags)} |
|
|
255
|
-
`)}}),Ae.moduleExports.length>0)v0(i,Ae.moduleExports);if(i.append("h3","Slots"),zo(i,Ae.slots,()=>{i.append("raw",Xs);for(let Ne of Ae.slots)i.append("raw",`| ${Sn(Ne.default?zt:Ne.name??zt,Ne.deprecated)} | ${Ne.default?"Yes":"No"} | ${Qs(Ne.slot_props)} | ${Zs(Ne.fallback)} | ${In(Ne.description,Ne.tags)} |
|
|
256
|
-
`)}),i.append("h3","Events"),zo(i,Ae.events,()=>{i.append("raw",Js);for(let Ne of Ae.events)i.append("raw",`| ${Sn(Ne.name,Ne.deprecated)} | ${Ne.type} | ${Ne.type==="dispatched"?ei(Ne.detail):zt} | ${In(Ne.description,Ne.tags)} |
|
|
257
|
-
`)}),Ae.cssParts&&Ae.cssParts.length>0){i.append("h3","CSS Parts"),i.append("raw",nu);for(let Ne of Ae.cssParts)i.append("raw",`| ${Ne.name} | ${Ys(Ne.description)} |
|
|
258
|
-
`);i.append("raw",`
|
|
259
|
-
`)}if(Ae.cssProperties&&Ae.cssProperties.length>0){i.append("h3","CSS Custom Properties"),i.append("raw",ru);for(let Ne of Ae.cssProperties)i.append("raw",`| ${Ne.name} | ${dn(Ne.type)} | ${qr(Ne.default)} | ${Ys(Ne.description)} |
|
|
260
|
-
`);i.append("raw",`
|
|
261
|
-
`)}}class ni extends qt{onAppend;markdownBase;constructor(i){super();this.onAppend=i.onAppend,this.markdownBase=new mr}get source(){return this.markdownBase.source}get hasToC(){return this.markdownBase.hasToC}get toc(){return this.markdownBase.toc}appendLineBreaks(){return this.markdownBase.appendLineBreaks(),this}append(i,Ae){return this.markdownBase.append(i,Ae),this.onAppend?.call(this,i,this),this}tableOfContents(){return this.markdownBase.tableOfContents(),this}end(){return this.markdownBase.end()}}function Jo(i,Ae){return new ni({onAppend:(Ne,_e)=>{i.onAppend?.call(null,Ne,_e,Ae)}})}async function T0(i,Ae){let Ne=Ae.outDir,_e=o(i,{entryExports:Ae.entryExports}),De=new qt({dryRun:Ae.dryRun}),Re=Jo(Ae,i);ou(Re,_e.components,Ae.entryExports);let Ie=pu(Xo(Ne,"README.md")),Oe=await De.write(Ie,Re.end());if(!Ae.dryRun)en(`${Oe?"created":"unchanged"} "${Ie}".`);await Promise.all(_e.components.map(async(Me)=>{let Fe=Jo(Ae,i);cu(Fe,Me);let Be=pu(Xo(Ne,`${Me.moduleName}.md`)),Ve=await De.write(Be,Fe.end());if(!Ae.dryRun)en(`${Ve?"created":"unchanged"} "${Be}".`)}))}function Yo(i,Ae){let Ne=Jo(Ae,i);return iu(Ne,i,Ae.entryExports),Ne.end()}async function Qo(i,Ae){if(Ae.outDir){if(Ae.write!==!1)await T0(i,Ae);return}let Ne=Ae?.write!==!1,_e=Yo(i,Ae);if(Ne){let De=Xo(process.cwd(),Ae.outFile),Re=await new qt({dryRun:Ae.dryRun}).write(De,_e);if(!Ae.dryRun)en(`${Re?"created":"unchanged"} "${Ae.outFile}".`)}return _e}import{join as uu}from"node:path";function k0(i){let Ae=new Set;for(let Ne of i)if(Ne.extends)Ae.add(Ne.extends.interface);return Ae}function A0(i){return Bs(i,mo,!0).props}var w0={props:!0,exports:!0,typedefs:!1,contexts:!1};function P0(i){if(!i)return;return Bs(i,w0,!1)}function N0(i,Ae,Ne){let _e=P0(Ae.indexTypes);if(!_e)return[];let De=yo(Ae),Re=Ae.format==="component",Ie=new Map,Oe=new Set,Me=[];for(let[,Fe]of Object.entries(Ae.exports)){if(!Fe.default||!xn.test(Fe.source))continue;let Be=e(Fe.source);if(Oe.has(Be))continue;Oe.add(Be);let Ve=i.components.find((Qe)=>Qe.filePath===Be);if(!Ve)continue;let Ge=Fn(Ve.moduleName,Ae.typeNames),Ue=Ne.has(Ge),Xe=[];if(_e.props&&(De.props||Ue))Xe.push(Ge);if(_e.exports&&Re&&De.exports)Xe.push(Lr(Ve.moduleName,Ae.typeNames));if(_e.typedefs&&De.typedefs)for(let Qe of Ve.typedefs)Xe.push(Qe.name);if(_e.contexts&&De.contexts)for(let Qe of Ve.contexts??[])Xe.push(Qe.typeName);let ze=[];for(let Qe of Xe){let rt=Ie.get(Qe);if(rt!==void 0){Hp(`sveld: index.d.ts skips duplicate type export "${Qe}" from "${Fe.source}" (already exported from "${rt}").`);continue}Ie.set(Qe,Fe.source),ze.push(Qe)}if(ze.length>0)Me.push({source:Fe.source,names:ze})}return Me}async function du(i,Ae,Ne){if(!i)return Ae;try{let _e=await i(Ae,Ne);if(typeof _e!=="string")throw TypeError(`must return a string, got ${typeof _e}`);return _e}catch(_e){let De=_e instanceof Error?_e.message:String(_e);throw Error(`sveld: typesOptions.transform failed for "${Ne.filePath}": ${De}`,{cause:_e})}}async function Zo(i,Ae){let Ne=uu(process.cwd(),Ae.outDir,"index.d.ts"),_e=new qt({dryRun:Ae.dryRun}),De=o(i),Re=k0(De.components),Ie=Jp(N0(De,Ae,Re)),Oe=Ae.preamble+[Xp(Ae.exports),Ie].filter((Ve)=>Ve!=="").join(`
|
|
262
|
-
|
|
263
|
-
`),Me=go(Ae),Fe=De.components.map(async(Ve)=>{let Ge=Bo(uu(Ae.outDir,Ve.filePath)),Ue=e(Bo(Ve.filePath)),Xe=Ae.resolvedPathByFilePath?.get(Ve.filePath),ze=Ae.inlinedTypesByFilePath?.get(Ve.filePath),Qe=Re.has(Fn(Ve.moduleName,Ae.typeNames))&&!A0(Me.exportTypes)?{...Me,forceExportProps:!0}:Me,rt=ze?{...Qe,inlined:ze}:Qe,ot=(ze?.declarations.length??0)>0,Ye=fp(rt),nt=!ot&&Xe?Ae.cache?.getGeneratedText(Xe,Ye):void 0;if(nt===void 0){if(nt=xo(Ve,rt),!ot&&Xe)Ae.cache?.setGeneratedText(Xe,Ye,nt)}let it=await du(Ae.transform,nt,{kind:"component",component:Ve,filePath:Ue});await _e.write(Ge,it)}),Be=(async()=>{let Ve=await du(Ae.transform,Oe,{kind:"index",filePath:"index.d.ts"});await _e.write(Ne,`${Ve}
|
|
264
|
-
`)})();if(await Promise.all([...Fe,Be]),!Ae.dryRun)en("created TypeScript definitions.")}k({name:"json",componentSet:"exported",write:Wo});k({name:"markdown",componentSet:"exported",write:Qo});k({name:"types",componentSet:"all",write:Zo});k({name:"custom-elements",componentSet:"exported",write:$o});k({name:"llms",componentSet:"exported",write:Ko});var fu='sveld: could not resolve a Svelte entry point. Set package.json#svelte, or pass the "entry" option.',I0=50;function R0(i){let Ae=Promise.resolve();return()=>{Ae=Ae.then(i,i)}}function we(i){let Ae=i?.watch===!0,Ne,_e,De=i??{},Re,Ie=null,Oe,Me=new Set,Be=R0(async()=>{if(Ie==null||_e==null||Me.size===0)return;let Ge=Array.from(Me);Me.clear();try{let{result:Ue}=await Ie.update(Ge);await w(Ue,De,_e)}catch(Ue){console.error("sveld: failed to regenerate types in watch mode:",Ue)}}),Ve=(Ge)=>{if(!Ae||Ie==null||!Tl.test(Ge))return;Me.add(Ge),clearTimeout(Oe),Oe=setTimeout(Be,I0)};return{name:"vite-plugin-sveld",apply:Ae?void 0:"build",enforce:"post",configResolved(Ge){Re=Ge.root},async buildStart(){if(i?.config){let Ge=Re??process.cwd(),Ue=typeof i.config==="string"?await to(_0(i.config)?i.config:D0(Ge,i.config)):await _(Ge);De=E(Ue,i)}if(N(De),I(De.quiet===!0),_e=D(De.entry),Ae&&_e!=null)try{Ie=await Kp(_e,De.glob===!0,De.documentExports===!0,De.typesOptions?.inline,De.typesOptions?.typeNames),await w(await Ie.result,De,_e)}catch(Ge){console.error("sveld: failed to generate initial types in watch mode:",Ge)}},async generateBundle(){if(Ae)return;if(_e==null)this.error(fu);Ne=await S(_e,De.glob===!0,b(De))},async writeBundle(){if(Ae)return;if(_e==null)this.error(fu);await w(Ne,De,_e),Ne.cache?.save()},handleHotUpdate(Ge){Ve(Ge.file)},watchChange(Ge){Ve(Ge)}}}function Gr(i,Ae,Ne){let _e=G(i);if(!_e)throw Error(`sveld: built-in writer "${i}" is not registered.`);return _e.write(Ae,Ne)}async function w(i,Ae,Ne){let _e=hu(Ne),De=Ae?.dryRun===!0;if(Ae?.types!==!1)await Gr("types",i.allComponentsForTypes,{outDir:"types",preamble:"",...Ae?.typesOptions,exports:i.exports,inputDir:_e,dryRun:De,cache:i.cache,resolvedPathByFilePath:i.resolvedPathByFilePath,inlinedTypesByFilePath:i.inlinedTypesByFilePath});if(Ae?.json)await Gr("json",i.components,{outFile:"COMPONENT_API.json",...Ae?.jsonOptions,input:Ne,inputDir:_e,entryExports:i.entryExports,dryRun:De});if(Ae?.markdown)await Gr("markdown",i.components,{outFile:"COMPONENT_INDEX.md",...Ae?.markdownOptions,entryExports:i.entryExports,dryRun:De});if(Ae?.customElements)await Gr("custom-elements",i.components,{outFile:"custom-elements.json",...Ae?.customElementsOptions,inputDir:_e,dryRun:De});if(Ae?.llms)await Gr("llms",i.components,{...Ae?.llmsOptions,entryExports:i.entryExports,dryRun:De});let Re=Object.entries(Ae?.additionalWriters??{}).map(([Ie,Oe])=>{let Me=G(Ie);if(!Me){console.warn(`sveld: no writer registered with name "${Ie}"; skipping.`);return}let Fe=Me.componentSet==="all"?i.allComponentsForTypes:i.components,Be={...Oe,dryRun:De};return L0(Ie,Me,Fe,Be)});await Promise.all(Re)}async function L0(i,Ae,Ne,_e){try{return await Ae.write(Ne,_e)}catch(De){let Re=De instanceof Error?De.message:String(De);throw Error(`sveld: writer "${i}" failed: ${Re}`,{cause:De})}}async function mu(i,Ae,Ne){let _e=hu(Ne);if(Ae?.json){let De={...Ae?.jsonOptions,inputDir:_e,entryExports:i.entryExports},Re=Ae.stdout==="ndjson"?Qp(i.components,De):Vo(i.components,De);process.stdout.write(Re);return}if(Ae?.markdown){let De=Yo(i.components,{...Ae?.markdownOptions,entryExports:i.entryExports});process.stdout.write(De);return}if(Ae?.customElements){let De=Mo(i.components,{...Ae?.customElementsOptions,inputDir:_e});process.stdout.write(De)}}import{appendFileSync as B0,existsSync as F0}from"node:fs";import{join as j0}from"node:path";var gu=/%/g,xu=/\r/g,bu=/\n/g,O0=/,/g,M0=/:/g,Eu=/\|/g;function yu(i){return i.replace(gu,"%25").replace(xu,"%0D").replace(bu,"%0A").replace(O0,"%2C").replace(M0,"%3A")}function $0(i){return i.replace(gu,"%25").replace(xu,"%0D").replace(bu,"%0A")}function Cu(i,Ae,Ne,_e,De,Re){let Ie=i==="error"?"error":"warning",Oe=[];if(_e!==void 0)Oe.push(`file=${yu(_e)}`);if(De!==void 0)Oe.push(`line=${De}`);if(Re!==void 0)Oe.push(`col=${Re}`);return Oe.push(`title=${yu(Ae)}`),`::${Ie} ${Oe.join(",")}::${$0(Ne)}`}function Su(i){return i.filter((Ae)=>!Ae.ignored).map((Ae)=>Cu(Ae.severity,`sveld ${Ae.code}`,Ae.message,Ae.component,Ae.source?.start.line,Ae.source?.start.column)).join(`
|
|
265
|
-
`)}function vu(i){let Ae=i.filter((_e)=>!_e.ignored);if(Ae.length===0)return"";return["### sveld diagnostics","","| Severity | Code | Location | Message |","| --- | --- | --- | --- |",...Ae.map((_e)=>{let De=_e.source?`${_e.component}:${_e.source.start.line}`:_e.component;return`| ${_e.severity} | ${_e.code} | ${De} | ${_e.message.replace(Eu,"\\|")} |`})].join(`
|
|
266
|
-
`)}function Tu(i,Ae){return i.changes.filter((Ne)=>Ss(Ne.bump,Ae))}function ku(i,Ae){return Tu(i,Ae).map((Ne)=>Cu("error","sveld breaking change",Ne.message,Ne.component==="*"?void 0:Ne.component)).join(`
|
|
267
|
-
`)}function Au(i,Ae){let Ne=Tu(i,Ae);if(Ne.length===0)return"";return["### sveld breaking changes","","| Component | Kind | Message |","| --- | --- | --- |",...Ne.map((De)=>`| ${De.component} | ${De.kind} | ${De.message.replace(Eu,"\\|")} |`)].join(`
|
|
268
|
-
`)}var ea="src/index.js",Lt={SUCCESS:0,USAGE_ERROR:1,GENERATION_FAILURE:2,BREAKING_CHANGE:3,DIAGNOSTICS:4},V0=`Usage: sveld [options]
|
|
269
|
-
|
|
270
|
-
Generate TypeScript definitions and component documentation for a Svelte
|
|
271
|
-
library. With no flags, only TypeScript definitions are generated for the
|
|
272
|
-
entry resolved from package.json#svelte.
|
|
273
|
-
|
|
274
|
-
--entry, --cache, --check, --types-format, --types-export,
|
|
275
|
-
--types-comments, --types-inline, and --types-props-declaration accept
|
|
276
|
-
their value as --flag=value or as a separate --flag value argument.
|
|
277
|
-
|
|
278
|
-
Options:
|
|
279
|
-
--entry=<path> Entry point to uncompiled Svelte source (default: package.json "svelte" field)
|
|
280
|
-
--glob Analyze all *.svelte files instead of the entry barrel
|
|
281
|
-
--types Generate TypeScript definitions (default: true)
|
|
282
|
-
--json Generate component documentation in JSON format
|
|
283
|
-
--markdown Generate component documentation in Markdown format
|
|
284
|
-
--custom-elements Generate a Custom Elements Manifest (custom-elements.json)
|
|
285
|
-
--llms Generate an llms.txt / llms-full.txt pair (https://llmstxt.org)
|
|
286
|
-
--fail-fast Abort the run when a single component fails to parse
|
|
287
|
-
--dry-run Resolve, parse, and print "would write" lines for each output file instead of writing anything (including the parse cache)
|
|
288
|
-
--quiet Suppress progress logs (errors, the diagnostics summary, and the --check report are unaffected)
|
|
289
|
-
--stdout[=json|ndjson] Print the document from exactly one of --json, --markdown, or --custom-elements to stdout and write nothing to disk (rejects --types and --check); --stdout=ndjson prints one JSON object per component per line and requires --json
|
|
290
|
-
--cache[=<path>] Persist parsed output and skip re-parsing unchanged files (on by default, default path: node_modules/.cache/sveld/parse-cache.json; pass --cache=false to disable)
|
|
291
|
-
--resolve-types Expand opaque imported $props() types into JSON (alias: --resolveTypes, deprecated)
|
|
292
|
-
--check-examples[=syntax] Check @example blocks: TS/JS against the TypeScript program, svelte/html markup against sveld's own parser (alias: --checkExamples, deprecated); --check-examples=syntax runs only the markup path and never loads TypeScript
|
|
293
|
-
--report-diagnostics Print unresolved-type diagnostics to stderr
|
|
294
|
-
--strict[=errors|ci|local] Exit with code 4 when diagnostics exist (implies --report-diagnostics); --strict=errors only fails on error-severity diagnostics; --strict=ci expands to {strict:true, reportDiagnostics:true, check:true, checkExamples:true}, --strict=local to {reportDiagnostics:true}
|
|
295
|
-
--types-format=<format> ".d.ts" output format: "class" (default) or "component" (Svelte 5 Component<...>)
|
|
296
|
-
--types-export=<all|none> Sets typesOptions.exportTypes; "all" exports every generated type (default), "none" keeps them all local
|
|
297
|
-
--types-comments=<all|descriptions|none> Sets typesOptions.comments; how much JSDoc lands in the generated .d.ts (default: all)
|
|
298
|
-
--types-inline=<local|all> Sets typesOptions.inline; copies imported types into the .d.ts instead of importing them (default: false; pass --types-inline=false to reset)
|
|
299
|
-
--types-index-types Sets typesOptions.indexTypes; also re-exports generated types from index.d.ts (pass --types-index-types=false to disable)
|
|
300
|
-
--types-props-declaration=<type|interface> Sets typesOptions.propsDeclaration; emits the props type as a type alias (default) or an interface
|
|
301
|
-
--check[=<path>] Diff the parsed API against a committed snapshot; exit 3 on a breaking change (default path: COMPONENT_API.json)
|
|
302
|
-
--check-level=<major|minor|patch> Minimum bump --check fails the run on (default: major)
|
|
303
|
-
--format=<text|json|github> Output format for the --check report and the diagnostics summary (default: text); "github" prints GitHub Actions ::error/::warning lines and appends a GITHUB_STEP_SUMMARY table when that env var is set
|
|
304
|
-
--help Print this help message and exit
|
|
305
|
-
--version Print the installed sveld version and exit
|
|
306
|
-
|
|
307
|
-
Exit codes:
|
|
308
|
-
0 success
|
|
309
|
-
1 usage or configuration error
|
|
310
|
-
2 generation failure
|
|
311
|
-
3 breaking API change detected by --check
|
|
312
|
-
4 diagnostics present under --strict
|
|
313
|
-
`,ta={resolveTypes:"resolve-types",checkExamples:"check-examples"},W0=["help","version","glob","types","json","markdown","quiet","stdout","custom-elements","llms","strict","report-diagnostics","resolve-types","check-examples","fail-fast","dry-run","entry","cache","check","check-level","types-format","types-export","types-comments","types-inline","types-index-types","types-props-declaration","format"],q0=[...W0,...Object.keys(ta)],G0=new Set(["glob","types","json","markdown","quiet","custom-elements","llms","strict","report-diagnostics","resolve-types","check-examples","fail-fast","dry-run","types-index-types"]),U0=new Set(["entry","cache","check","types-format","types-export","types-comments","types-inline","types-props-declaration"]),H0=new Set(["entry","types-format","types-export","types-comments","types-inline","types-props-declaration"]);function K0(i){let Ae=vs(i,q0);return Ae===void 0?void 0:ta[Ae]??Ae}function z0(i,Ae){let Ne=i.indexOf("="),_e=Ne===-1?i.slice(2):i.slice(2,Ne),De=ta[_e]??_e,Re=Ne===-1?!0:i.slice(Ne+1),Ie=!1;if(Ne===-1&&U0.has(De)){if(Ae!==void 0&&!Ae.startsWith("--"))Re=Ae,Ie=!0;else if(H0.has(De))return{result:{kind:"usage-error",message:`sveld: --${De} requires a value (pass --${De}=<value> or --${De} <value>).`},consumedNext:!1,flag:De}}return{result:X0(De,Re,i,_e),consumedNext:Ie,flag:De}}function X0(i,Ae,Ne,_e){switch(i){case"help":return{kind:"help"};case"version":return{kind:"version"};case"glob":case"types":case"json":case"markdown":case"quiet":return{kind:"option",option:{[i]:Ae===!0||Ae==="true"}};case"stdout":if(Ae===!0||Ae==="true")return{kind:"option",option:{stdout:!0}};if(Ae==="false")return{kind:"option",option:{stdout:!1}};return{kind:"option",option:{stdout:Ae}};case"custom-elements":return{kind:"option",option:{customElements:Ae===!0||Ae==="true"}};case"llms":return{kind:"option",option:{llms:Ae===!0||Ae==="true"}};case"strict":if(Ae===!0||Ae==="true")return{kind:"option",option:{strict:!0}};if(Ae==="false")return{kind:"option",option:{strict:!1}};return{kind:"option",option:{strict:Ae}};case"report-diagnostics":return{kind:"option",option:{reportDiagnostics:Ae===!0||Ae==="true"}};case"resolve-types":return{kind:"option",option:{resolveTypes:Ae===!0||Ae==="true"}};case"check-examples":if(Ae===!0||Ae==="true")return{kind:"option",option:{checkExamples:!0}};if(Ae==="false")return{kind:"option",option:{checkExamples:!1}};return{kind:"option",option:{checkExamples:Ae}};case"fail-fast":return{kind:"option",option:{failFast:Ae===!0||Ae==="true"}};case"dry-run":return{kind:"option",option:{dryRun:Ae===!0||Ae==="true"}};case"entry":return typeof Ae==="string"?{kind:"option",option:{entry:Ae}}:{kind:"option",option:{}};case"cache":if(Ae==="false")return{kind:"option",option:{cache:!1}};return{kind:"option",option:{cache:typeof Ae==="string"?Ae:!0}};case"check":if(Ae==="false")return{kind:"option",option:{check:!1}};return{kind:"option",option:{check:typeof Ae==="string"?Ae:!0}};case"types-format":return typeof Ae==="string"?{kind:"option",option:{typesOptions:{format:Ae}}}:{kind:"option",option:{}};case"types-export":return typeof Ae==="string"?{kind:"option",option:{typesOptions:{exportTypes:Ae}}}:{kind:"option",option:{}};case"types-comments":return typeof Ae==="string"?{kind:"option",option:{typesOptions:{comments:Ae}}}:{kind:"option",option:{}};case"types-inline":if(Ae==="false")return{kind:"option",option:{typesOptions:{inline:!1}}};return typeof Ae==="string"?{kind:"option",option:{typesOptions:{inline:Ae}}}:{kind:"option",option:{}};case"types-index-types":return{kind:"option",option:{typesOptions:{indexTypes:Ae===!0||Ae==="true"}}};case"types-props-declaration":return typeof Ae==="string"?{kind:"option",option:{typesOptions:{propsDeclaration:Ae}}}:{kind:"option",option:{}};case"format":return typeof Ae==="string"?{kind:"option",option:{format:Ae}}:{kind:"option",option:{}};case"check-level":return typeof Ae==="string"?{kind:"option",option:{checkLevel:Ae}}:{kind:"option",option:{}};default:return{kind:"unknown",arg:Ne,suggestion:K0(_e)}}}function J0(i){let Ae={},Ne=!1;for(let _e=0;_e<i.length;_e++){let De=i[_e];if(!De.startsWith("--"))return{kind:"unknown",arg:De,positionalHint:Ne?!0:void 0};let{result:Re,consumedNext:Ie,flag:Oe}=z0(De,i[_e+1]);if(Re.kind!=="option")return Re;if(Ae=E(Ae,Re.option),Ne=G0.has(Oe),Ie)_e++}return{kind:"options",options:Ae}}var Y0=[{flagName:"types-format",key:"format",values:["class","component"]},{flagName:"types-comments",key:"comments",values:["all","descriptions","none"]},{flagName:"types-inline",key:"inline",values:["local","all"]},{flagName:"types-props-declaration",key:"propsDeclaration",values:["type","interface"]}];function Q0(i){let Ae=i.map((Ne)=>`"${Ne}"`);return Ae.length<=2?Ae.join(" or "):`${Ae.slice(0,-1).join(", ")}, or ${Ae.at(-1)}`}async function ne(i){let Ae=J0(i.argv.slice(2));if(Ae.kind==="help"){console.log(V0);return}if(Ae.kind==="version"){console.log(Al.version);return}if(Ae.kind==="usage-error"){console.error(Ae.message),i.exitCode=Lt.USAGE_ERROR;return}if(Ae.kind==="unknown"){let ze=`Unknown flag: ${Ae.arg}`;if(Ae.suggestion)ze+=` Did you mean --${Ae.suggestion}?`;if(Ae.positionalHint)ze+=" (values are passed as --flag=value or --flag value)";console.error(ze),console.error("Run sveld --help for a list of available flags."),i.exitCode=Lt.USAGE_ERROR;return}let Ne=Ae.options,_e=await _(),De=H(E(_e,Ne));if(N(De),De.stdout){if(De.stdout!==!0&&De.stdout!=="json"&&De.stdout!=="ndjson"){console.error(`sveld: --stdout must be "json" or "ndjson"; got "${De.stdout}".`),i.exitCode=Lt.USAGE_ERROR;return}if([De.json,De.markdown,De.customElements].filter(Boolean).length!==1){console.error("sveld: --stdout requires exactly one of --json, --markdown, or --custom-elements."),i.exitCode=Lt.USAGE_ERROR;return}if(De.stdout==="ndjson"&&!De.json){console.error("sveld: --stdout=ndjson is only valid with --json."),i.exitCode=Lt.USAGE_ERROR;return}if(De.types===!0){console.error("sveld: --stdout cannot be combined with --types; type definitions span multiple files."),i.exitCode=Lt.USAGE_ERROR;return}if(De.check){console.error("sveld: --stdout cannot be combined with --check; both write their document to stdout."),i.exitCode=Lt.USAGE_ERROR;return}}if(De.format!==void 0&&De.format!=="text"&&De.format!=="json"&&De.format!=="github"){console.error(`sveld: --format must be "text", "json", or "github"; got "${De.format}".`),i.exitCode=Lt.USAGE_ERROR;return}if(De.strict!==void 0&&De.strict!==!0&&De.strict!==!1&&De.strict!=="errors"){console.error(`sveld: --strict must be "errors", "ci", or "local" when given a value; got "${De.strict}".`),i.exitCode=Lt.USAGE_ERROR;return}if(De.checkLevel!==void 0&&De.checkLevel!=="major"&&De.checkLevel!=="minor"&&De.checkLevel!=="patch"){console.error(`sveld: --check-level must be "major", "minor", or "patch"; got "${De.checkLevel}".`),i.exitCode=Lt.USAGE_ERROR;return}if(De.checkExamples!==void 0&&De.checkExamples!==!0&&De.checkExamples!==!1&&De.checkExamples!=="syntax"){console.error(`sveld: --check-examples must be "syntax" when given a value; got "${De.checkExamples}".`),i.exitCode=Lt.USAGE_ERROR;return}let Re=De.typesOptions?.exportTypes;if(typeof Re==="string"){if(Re!=="all"&&Re!=="none"){console.error(`sveld: --types-export must be "all" or "none"; got "${Re}".`),i.exitCode=Lt.USAGE_ERROR;return}De.typesOptions={...De.typesOptions,exportTypes:Re==="all"}}for(let{flagName:ze,key:Qe,values:rt}of Y0){let ot=De.typesOptions?.[Qe];if(ot===void 0||ot===!1)continue;if(!rt.includes(ot)){console.error(`sveld: --${ze} must be ${Q0(rt)}; got "${ot}".`),i.exitCode=Lt.USAGE_ERROR;return}}I(De.quiet===!0);let Ie=D(De.entry),Oe;if(Ie!==null)Oe=Ie;else if(F0(j0(i.cwd(),ea)))console.error(`sveld: could not resolve an entry point; falling back to "${ea}". Set package.json#svelte (or pass --entry) to avoid relying on this fallback.`),Oe=Dr(e(ea));else{i.exitCode=Lt.USAGE_ERROR;return}let Me,Fe;try{if(Me=await S(Oe,De.glob===!0,b(De)),De.check)Fe=await M(Me.components,W(De),{entryExports:Me.entryExports});if(De.stdout)await mu(Me,De,Oe);else if(await w(Me,De,Oe),!De.dryRun)Me.cache?.save()}catch(ze){if(ze instanceof or){console.error(`sveld: ${ze.message}`),i.exitCode=Lt.USAGE_ERROR;return}console.error(ze instanceof Error?ze.message:String(ze)),i.exitCode=Lt.GENERATION_FAILURE;return}let Be=De.reportDiagnostics||De.strict,Ve=F(Me.diagnostics,Be),Ge=[];if(Be&&Ve.length>0)if(De.format==="json")i.stderr.write(V(Ve));else if(De.format==="github"){let ze=Su(Ve);if(ze)console.error(ze);let Qe=vu(Ve);if(Qe)Ge.push(Qe)}else console.error(q(Ve));if(Fe)if(De.format==="json")i.stdout.write(re(Fe));else if(De.format==="github"){let ze=ku(Fe,De.checkLevel??"major");if(ze)console.log(ze);let Qe=Au(Fe,De.checkLevel??"major");if(Qe)Ge.push(Qe)}else console.log(te(Fe));if(De.format==="github"&&Ge.length>0&&i.env.GITHUB_STEP_SUMMARY)B0(i.env.GITHUB_STEP_SUMMARY,`${Ge.join(`
|
|
314
|
-
|
|
315
|
-
`)}
|
|
316
|
-
`);let Ue;if(Fe?.changes.some((ze)=>ze.kind==="schema")??!1)Ue=Lt.USAGE_ERROR;else if(Fe&&Ss(Fe.bump,De.checkLevel??"major"))Ue=Lt.BREAKING_CHANGE;if(J(Ve,De.strict).length>0)Ue=Ue===void 0?Lt.DIAGNOSTICS:Math.min(Ue,Lt.DIAGNOSTICS);if(Ue!==void 0)i.exitCode=Ue}
|
|
317
|
-
export{Ce,a,C,se,l,s,ie,p,f,oe,g,B,j,F,J,q,ae,V,n,d,U,t,r,u,R,m,ce,ue,pe,z,h,le,X,fe,de,x,me,c,P,he,Q,ye,ge,xe,Y,Te,L,Z,K,O,y,Ee,be,ee,v,T,A,e,o,Se,W,M,te,ke,re,D,Pe,_,E,H,N,I,b,S,k,G,ve,we,w,ne};
|