sveld 0.37.0 → 0.37.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser.d.ts +3 -3
- package/lib/browser.js +130 -130
- package/lib/{chunk-eybp3ae7.js → chunk-0mgphvte.js} +1 -1
- package/lib/chunk-fc72j0vd.js +1 -0
- package/lib/chunk-fj7dbych.js +1 -0
- package/lib/chunk-szfpvrdq.js +6 -0
- package/lib/chunk-xt4vdey6.js +301 -0
- package/lib/{chunk-550yx3gf.js → chunk-z1dy5a6k.js} +5 -5
- package/lib/cli-entry.js +1 -1
- package/lib/index.js +1 -1
- package/package.json +1 -1
- package/lib/chunk-6n4d12tf.js +0 -1
- package/lib/chunk-74rbv9gf.js +0 -1
- package/lib/chunk-jtm65qmd.js +0 -300
- package/lib/chunk-s1v2vjye.js +0 -7
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
import{createRequire as cu}from"node:module";var Zp=Object.create;var{getPrototypeOf:eu,defineProperty:Gs,getOwnPropertyNames:tu}=Object;var Ia=Object.prototype.hasOwnProperty;function nu(i){return this[i]}var ru,su,ke=(i,ve,Ae)=>{var Pe=i!=null&&typeof i==="object";if(Pe){var Ne=ve?ru??=new WeakMap:su??=new WeakMap,De=Ne.get(i);if(De)return De}Ae=i!=null?Zp(eu(i)):{};let _e=ve||!i||!i.__esModule||!Ia.call(i,"default")?Gs(Ae,"default",{value:i,enumerable:!0}):Ae;if(i&&typeof i==="object"||typeof i==="function"){for(let Re of tu(i))if(!Ia.call(_e,Re))Gs(_e,Re,{get:nu.bind(i,Re),enumerable:!0})}if(Pe)Ne.set(i,_e);return _e};var o=(i,ve)=>()=>(ve||i((ve={exports:{}}).exports,ve),ve.exports);var iu=(i)=>i;function au(i,ve){this[i]=iu.bind(null,ve)}var ou=(i,ve)=>{for(var Ae in ve)Gs(i,Ae,{get:ve[Ae],enumerable:!0,configurable:!0,set:au.bind(ve,Ae)})};var w=cu(import.meta.url);var lu={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 Da(i,ve){let Ae=lu[i];if(!Ae)return!1;if(!ve)return!0;return(Ae.direct??Ae.descendant??[]).includes(ve)}var ii={};ou(ii,{Node:()=>ur,Parser:()=>Tt,Position:()=>Gn,SourceLocation:()=>lr,TokContext:()=>tn,Token:()=>Gr,TokenType:()=>gt,defaultOptions:()=>Lr,getLineInfo:()=>Qs,isIdentifierChar:()=>Kt,isIdentifierStart:()=>Ft,isNewLine:()=>Mn,keywordTypes:()=>Fr,lineBreak:()=>jt,lineBreakG:()=>ja,nonASCIIwhitespace:()=>Ys,parse:()=>si,parseExpressionAt:()=>Uu,tokContexts:()=>St,tokTypes:()=>Fe,tokenizer:()=>Hu,version:()=>Eo});var pu=[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],Ba=[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_・",$a="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ--ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",Us={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"},Hs="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",du={5:Hs,"5module":Hs+" export import",6:Hs+" const class extends export import super"},Fa=/^in(stanceof)?$/,fu=new RegExp("["+$a+"]"),hu=new RegExp("["+$a+uu+"]");function Ks(i,ve){var Ae=65536;for(var Pe=0;Pe<ve.length;Pe+=2){if(Ae+=ve[Pe],Ae>i)return!1;if(Ae+=ve[Pe+1],Ae>=i)return!0}return!1}function Ft(i,ve){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&&fu.test(String.fromCharCode(i));if(ve===!1)return!1;return Ks(i,Ba)}function Kt(i,ve){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&&hu.test(String.fromCharCode(i));if(ve===!1)return!1;return Ks(i,Ba)||Ks(i,pu)}var gt=function(ve,Ae){if(Ae===void 0)Ae={};this.label=ve,this.keyword=Ae.keyword,this.beforeExpr=!!Ae.beforeExpr,this.startsExpr=!!Ae.startsExpr,this.isLoop=!!Ae.isLoop,this.isAssign=!!Ae.isAssign,this.prefix=!!Ae.prefix,this.postfix=!!Ae.postfix,this.binop=Ae.binop||null,this.updateContext=null};function Zt(i,ve){return new gt(i,{beforeExpr:!0,binop:ve})}var en={beforeExpr:!0},Ht={startsExpr:!0},Fr={};function ht(i,ve){if(ve===void 0)ve={};return ve.keyword=i,Fr[i]=new gt(i,ve)}var Fe={num:new gt("num",Ht),regexp:new gt("regexp",Ht),string:new gt("string",Ht),name:new gt("name",Ht),privateId:new gt("privateId",Ht),eof:new gt("eof"),bracketL:new gt("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new gt("]"),braceL:new gt("{",{beforeExpr:!0,startsExpr:!0}),braceR:new gt("}"),parenL:new gt("(",{beforeExpr:!0,startsExpr:!0}),parenR:new gt(")"),comma:new gt(",",en),semi:new gt(";",en),colon:new gt(":",en),dot:new gt("."),question:new gt("?",en),questionDot:new gt("?."),arrow:new gt("=>",en),template:new gt("template"),invalidTemplate:new gt("invalidTemplate"),ellipsis:new gt("...",en),backQuote:new gt("`",Ht),dollarBraceL:new gt("${",{beforeExpr:!0,startsExpr:!0}),eq:new gt("=",{beforeExpr:!0,isAssign:!0}),assign:new gt("_=",{beforeExpr:!0,isAssign:!0}),incDec:new gt("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new gt("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:Zt("||",1),logicalAND:Zt("&&",2),bitwiseOR:Zt("|",3),bitwiseXOR:Zt("^",4),bitwiseAND:Zt("&",5),equality:Zt("==/!=/===/!==",6),relational:Zt("</>/<=/>=",7),bitShift:Zt("<</>>/>>>",8),plusMin:new gt("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:Zt("%",10),star:Zt("*",10),slash:Zt("/",10),starstar:new gt("**",{beforeExpr:!0}),coalesce:Zt("??",1),_break:ht("break"),_case:ht("case",en),_catch:ht("catch"),_continue:ht("continue"),_debugger:ht("debugger"),_default:ht("default",en),_do:ht("do",{isLoop:!0,beforeExpr:!0}),_else:ht("else",en),_finally:ht("finally"),_for:ht("for",{isLoop:!0}),_function:ht("function",Ht),_if:ht("if"),_return:ht("return",en),_switch:ht("switch"),_throw:ht("throw",en),_try:ht("try"),_var:ht("var"),_const:ht("const"),_while:ht("while",{isLoop:!0}),_with:ht("with"),_new:ht("new",{beforeExpr:!0,startsExpr:!0}),_this:ht("this",Ht),_super:ht("super",Ht),_class:ht("class",Ht),_extends:ht("extends",en),_export:ht("export"),_import:ht("import",Ht),_null:ht("null",Ht),_true:ht("true",Ht),_false:ht("false",Ht),_in:ht("in",{beforeExpr:!0,binop:7}),_instanceof:ht("instanceof",{beforeExpr:!0,binop:7}),_typeof:ht("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:ht("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:ht("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},jt=/\r\n?|\n|\u2028|\u2029/,ja=new RegExp(jt.source,"g");function Mn(i){return i===10||i===13||i===8232||i===8233}function Va(i,ve,Ae){if(Ae===void 0)Ae=i.length;for(var Pe=ve;Pe<Ae;Pe++){var Ne=i.charCodeAt(Pe);if(Mn(Ne))return Pe<Ae-1&&Ne===13&&i.charCodeAt(Pe+1)===10?Pe+2:Pe+1}return-1}var Ys=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,Nt=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,qa=Object.prototype,{hasOwnProperty:mu,toString:gu}=qa,Un=Object.hasOwn||function(i,ve){return mu.call(i,ve)},Ra=Array.isArray||function(i){return gu.call(i)==="[object Array]"},La=Object.create(null);function kn(i){return La[i]||(La[i]=new RegExp("^(?:"+i.replace(/ /g,"|")+")$"))}function gn(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])/,Gn=function(ve,Ae){this.line=ve,this.column=Ae};Gn.prototype.offset=function(ve){return new Gn(this.line,this.column+ve)};var lr=function(ve,Ae,Pe){if(this.start=Ae,this.end=Pe,ve.sourceFile!==null)this.source=ve.sourceFile};function Qs(i,ve){for(var Ae=1,Pe=0;;){var Ne=Va(i,Pe,ve);if(Ne<0)return new Gn(Ae,ve-Pe);++Ae,Pe=Ne}}var Lr={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},Oa=!1;function xu(i){var ve={};for(var Ae in Lr)ve[Ae]=i&&Un(i,Ae)?i[Ae]:Lr[Ae];if(ve.ecmaVersion==="latest")ve.ecmaVersion=1e8;else if(ve.ecmaVersion==null){if(!Oa&&typeof console==="object"&&console.warn)Oa=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
|
2
|
+
Defaulting to 2020, but this will stop working in the future.`);ve.ecmaVersion=11}else if(ve.ecmaVersion>=2015)ve.ecmaVersion-=2009;if(ve.allowReserved==null)ve.allowReserved=ve.ecmaVersion<5;if(!i||i.allowHashBang==null)ve.allowHashBang=ve.ecmaVersion>=14;if(Ra(ve.onToken)){var Pe=ve.onToken;ve.onToken=function(Ne){return Pe.push(Ne)}}if(Ra(ve.onComment))ve.onComment=bu(ve,ve.onComment);if(ve.sourceType==="commonjs"&&ve.allowAwaitOutsideFunction)throw Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");return ve}function bu(i,ve){return function(Ae,Pe,Ne,De,_e,Re){var Oe={type:Ae?"Block":"Line",value:Pe,start:Ne,end:De};if(i.locations)Oe.loc=new lr(this,_e,Re);if(i.ranges)Oe.range=[Ne,De];ve.push(Oe)}}var On=1,Bn=2,Zs=4,Wa=8,ei=16,Ga=32,jr=64,Ua=128,$n=256,pr=512,Ha=1024,Vr=On|Bn|$n;function ti(i,ve){return Bn|(i?Zs:0)|(ve?Wa:0)}var Or=0,ni=1,xn=2,Ka=3,za=4,Xa=5,Tt=function(ve,Ae,Pe){this.options=ve=xu(ve),this.sourceFile=ve.sourceFile,this.keywords=kn(du[ve.ecmaVersion>=6?6:ve.sourceType==="module"?"5module":5]);var Ne="";if(ve.allowReserved!==!0){if(Ne=Us[ve.ecmaVersion>=6?6:ve.ecmaVersion===5?5:3],ve.sourceType==="module")Ne+=" await"}this.reservedWords=kn(Ne);var De=(Ne?Ne+" ":"")+Us.strict;if(this.reservedWordsStrict=kn(De),this.reservedWordsStrictBind=kn(De+" "+Us.strictBind),this.input=String(Ae),this.containsEsc=!1,this.pos=Pe||0,this.curLine=1,ve.startLocation)this.lineStart=this.pos-ve.startLocation.column,this.curLine=ve.startLocation.line;else if(Pe){if(this.lineStart=this.input.lastIndexOf(`
|
|
3
|
+
`,Pe-1)+1,this.options.locations)this.curLine=this.input.slice(0,this.lineStart).split(jt).length}else this.lineStart=0;if(this.type=Fe.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=ve.sourceType==="module",this.strict=this.inModule||ve.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&&ve.allowHashBang&&this.input.slice(0,2)==="#!")this.skipLineComment(2);this.scopeStack=[],this.enterScope(this.options.sourceType==="commonjs"?Bn:On),this.regexpState=null,this.privateNameStack=[]},rn={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}};Tt.prototype.parse=function(){var ve=this,Ae=this.options.program||this.startNode();return this.nextToken(),this.catchStackOverflow(function(){return ve.parseTopLevel(Ae)})};rn.inFunction.get=function(){return(this.currentVarScope().flags&Bn)>0};rn.inGenerator.get=function(){return(this.currentVarScope().flags&Wa)>0};rn.inAsync.get=function(){return(this.currentVarScope().flags&Zs)>0};rn.canAwait.get=function(){for(var i=this.scopeStack.length-1;i>=0;i--){var ve=this.scopeStack[i],Ae=ve.flags;if(Ae&($n|pr))return!1;if(Ae&Bn)return(Ae&Zs)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};rn.allowReturn.get=function(){if(this.inFunction)return!0;if(this.options.allowReturnOutsideFunction&&this.currentVarScope().flags&On)return!0;return!1};rn.allowSuper.get=function(){var i=this.currentThisScope(),ve=i.flags;return(ve&jr)>0||this.options.allowSuperOutsideMethod};rn.allowDirectSuper.get=function(){return(this.currentThisScope().flags&Ua)>0};rn.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};rn.allowNewDotTarget.get=function(){for(var i=this.scopeStack.length-1;i>=0;i--){var ve=this.scopeStack[i],Ae=ve.flags;if(Ae&($n|pr)||Ae&Bn&&!(Ae&ei))return!0}return!1};rn.allowUsing.get=function(){var i=this.currentScope(),ve=i.flags;if(ve&Ha)return!1;if(!this.inModule&&ve&On)return!1;return!0};rn.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&$n)>0};Tt.extend=function(){var ve=[],Ae=arguments.length;while(Ae--)ve[Ae]=arguments[Ae];var Pe=this;for(var Ne=0;Ne<ve.length;Ne++)Pe=ve[Ne](Pe);return Pe};Tt.parse=function(ve,Ae){return new this(Ae,ve).parse()};Tt.parseExpressionAt=function(ve,Ae,Pe){var Ne=new this(Pe,ve,Ae);return Ne.nextToken(),Ne.parseExpression()};Tt.tokenizer=function(ve,Ae){return new this(Ae,ve)};Object.defineProperties(Tt.prototype,rn);var Ot=Tt.prototype,Eu=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;Ot.strictDirective=function(i){if(this.options.ecmaVersion<5)return!1;for(;;){Nt.lastIndex=i,i+=Nt.exec(this.input)[0].length;var ve=Eu.exec(this.input.slice(i));if(!ve)return!1;if((ve[1]||ve[2])==="use strict"){Nt.lastIndex=i+ve[0].length;var Ae=Nt.exec(this.input),Pe=Ae.index+Ae[0].length,Ne=this.input.charAt(Pe);return Ne===";"||Ne==="}"||jt.test(Ae[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(Ne)||Ne==="!"&&this.input.charAt(Pe+1)==="=")}if(i+=ve[0].length,Nt.lastIndex=i,i+=Nt.exec(this.input)[0].length,this.input[i]===";")i++}};Ot.eat=function(i){if(this.type===i)return this.next(),!0;else return!1};Ot.isContextual=function(i){return this.type===Fe.name&&this.value===i&&!this.containsEsc};Ot.eatContextual=function(i){if(!this.isContextual(i))return!1;return this.next(),!0};Ot.catchStackOverflow=function(i){try{return i()}catch(ve){if(ve instanceof Error&&(/\bstack\b.*\b(exceeded|overflow)\b/i.test(ve.message)||/\btoo much recursion\b/i.test(ve.message)))this.raise(this.start,"Not enough stack space to parse input");else throw ve}};Ot.expectContextual=function(i){if(!this.eatContextual(i))this.unexpected()};Ot.canInsertSemicolon=function(){return this.type===Fe.eof||this.type===Fe.braceR||jt.test(this.input.slice(this.lastTokEnd,this.start))};Ot.insertSemicolon=function(){if(this.canInsertSemicolon()){if(this.options.onInsertedSemicolon)this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc);return!0}};Ot.semicolon=function(){if(!this.eat(Fe.semi)&&!this.insertSemicolon())this.unexpected()};Ot.afterTrailingComma=function(i,ve){if(this.type===i){if(this.options.onTrailingComma)this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc);if(!ve)this.next();return!0}};Ot.expect=function(i){this.eat(i)||this.unexpected()};Ot.unexpected=function(i){this.raise(i!=null?i:this.start,"Unexpected token")};var qr=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};Ot.checkPatternErrors=function(i,ve){if(!i)return;if(i.trailingComma>-1)this.raiseRecoverable(i.trailingComma,"Comma is not permitted after the rest element");var Ae=ve?i.parenthesizedAssign:i.parenthesizedBind;if(Ae>-1)this.raiseRecoverable(Ae,ve?"Assigning to rvalue":"Parenthesized pattern")};Ot.checkExpressionErrors=function(i,ve){if(!i)return!1;var{shorthandAssign:Ae,doubleProto:Pe}=i;if(!ve)return Ae>=0||Pe>=0;if(Ae>=0)this.raise(Ae,"Shorthand property assignments are valid only in destructuring patterns");if(Pe>=0)this.raiseRecoverable(Pe,"Redefinition of __proto__ property")};Ot.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")};Ot.isSimpleAssignTarget=function(i){if(i.type==="ParenthesizedExpression")return this.isSimpleAssignTarget(i.expression);return i.type==="Identifier"||i.type==="MemberExpression"};var it=Tt.prototype;it.parseTopLevel=function(i){var ve=Object.create(null);if(!i.body)i.body=[];while(this.type!==Fe.eof){var Ae=this.parseStatement(null,!0,ve);i.body.push(Ae)}if(this.inModule)for(var Pe=0,Ne=Object.keys(this.undefinedExports);Pe<Ne.length;Pe+=1){var De=Ne[Pe];this.raiseRecoverable(this.undefinedExports[De].start,"Export '"+De+"' 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 ri={kind:"loop"},Cu={kind:"switch"};it.isLet=function(i){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;Nt.lastIndex=this.pos;var ve=Nt.exec(this.input),Ae=this.pos+ve[0].length,Pe=this.fullCharCodeAt(Ae);if(Pe===91||Pe===92)return!0;if(i)return!1;if(Pe===123)return!0;if(Ft(Pe)){var Ne=Ae;do Ae+=Pe<=65535?1:2;while(Kt(Pe=this.fullCharCodeAt(Ae)));if(Pe===92)return!0;var De=this.input.slice(Ne,Ae);if(!Fa.test(De))return!0}return!1};it.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;Nt.lastIndex=this.pos;var i=Nt.exec(this.input),ve=this.pos+i[0].length,Ae;return!jt.test(this.input.slice(this.pos,ve))&&this.input.slice(ve,ve+8)==="function"&&(ve+8===this.input.length||!(Kt(Ae=this.fullCharCodeAt(ve+8))||Ae===92))};it.isUsingKeyword=function(i,ve){if(this.options.ecmaVersion<17||!this.isContextual(i?"await":"using"))return!1;Nt.lastIndex=this.pos;var Ae=Nt.exec(this.input),Pe=this.pos+Ae[0].length;if(jt.test(this.input.slice(this.pos,Pe)))return!1;if(i){var Ne=Pe+5,De;if(this.input.slice(Pe,Ne)!=="using"||Ne===this.input.length||Kt(De=this.fullCharCodeAt(Ne))||De===92)return!1;Nt.lastIndex=Ne;var _e=Nt.exec(this.input);if(Pe=Ne+_e[0].length,_e&&jt.test(this.input.slice(Ne,Pe)))return!1}var Re=this.fullCharCodeAt(Pe);if(!Ft(Re)&&Re!==92)return!1;var Oe=Pe;do Pe+=Re<=65535?1:2;while(Kt(Re=this.fullCharCodeAt(Pe)));if(Re===92)return!0;var Be=this.input.slice(Oe,Pe);if(Fa.test(Be))return!1;if(ve&&!i&&Be==="of"){Nt.lastIndex=Pe;var Me=Nt.exec(this.input);if(Pe=Pe+Me[0].length,this.input.charCodeAt(Pe)!==61||(Re=this.input.charCodeAt(Pe+1))===61||Re===62)return!1}return!0};it.isAwaitUsing=function(i){return this.isUsingKeyword(!0,i)};it.isUsing=function(i){return this.isUsingKeyword(!1,i)};it.parseStatement=function(i,ve,Ae){var Pe=this.type,Ne=this.startNode(),De;if(this.isLet(i))Pe=Fe._var,De="let";switch(Pe){case Fe._break:case Fe._continue:return this.parseBreakContinueStatement(Ne,Pe.keyword);case Fe._debugger:return this.parseDebuggerStatement(Ne);case Fe._do:return this.parseDoStatement(Ne);case Fe._for:return this.parseForStatement(Ne);case Fe._function:if(i&&(this.strict||i!=="if"&&i!=="label")&&this.options.ecmaVersion>=6)this.unexpected();return this.parseFunctionStatement(Ne,!1,!i);case Fe._class:if(i)this.unexpected();return this.parseClass(Ne,!0);case Fe._if:return this.parseIfStatement(Ne);case Fe._return:return this.parseReturnStatement(Ne);case Fe._switch:return this.parseSwitchStatement(Ne);case Fe._throw:return this.parseThrowStatement(Ne);case Fe._try:return this.parseTryStatement(Ne);case Fe._const:case Fe._var:if(De=De||this.value,i&&De!=="var")this.unexpected();return this.parseVarStatement(Ne,De);case Fe._while:return this.parseWhileStatement(Ne);case Fe._with:return this.parseWithStatement(Ne);case Fe.braceL:return this.parseBlock(!0,Ne);case Fe.semi:return this.parseEmptyStatement(Ne);case Fe._export:case Fe._import:if(this.options.ecmaVersion>10&&Pe===Fe._import){Nt.lastIndex=this.pos;var _e=Nt.exec(this.input),Re=this.pos+_e[0].length,Oe=this.input.charCodeAt(Re);if(Oe===40||Oe===46)return this.parseExpressionStatement(Ne,this.parseExpression())}if(!this.options.allowImportExportEverywhere){if(!ve)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 Pe===Fe._import?this.parseImport(Ne):this.parseExport(Ne,Ae);default:if(this.isAsyncFunction()){if(i)this.unexpected();return this.next(),this.parseFunctionStatement(Ne,!0,!i)}var Be=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if(Be){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(Be==="await using"){if(!this.canAwait)this.raise(this.start,"Await using cannot appear outside of async function");this.next()}return this.next(),this.parseVar(Ne,!1,Be),this.semicolon(),this.finishNode(Ne,"VariableDeclaration")}var Me=this.value,je=this.parseExpression();if(Pe===Fe.name&&je.type==="Identifier"&&this.eat(Fe.colon))return this.parseLabeledStatement(Ne,Me,je,i);else return this.parseExpressionStatement(Ne,je)}};it.parseBreakContinueStatement=function(i,ve){var Ae=ve==="break";if(this.next(),this.eat(Fe.semi)||this.insertSemicolon())i.label=null;else if(this.type!==Fe.name)this.unexpected();else i.label=this.parseIdent(),this.semicolon();var Pe=0;for(;Pe<this.labels.length;++Pe){var Ne=this.labels[Pe];if(i.label==null||Ne.name===i.label.name){if(Ne.kind!=null&&(Ae||Ne.kind==="loop"))break;if(i.label&&Ae)break}}if(Pe===this.labels.length)this.raise(i.start,"Unsyntactic "+ve);return this.finishNode(i,Ae?"BreakStatement":"ContinueStatement")};it.parseDebuggerStatement=function(i){return this.next(),this.semicolon(),this.finishNode(i,"DebuggerStatement")};it.parseDoStatement=function(i){if(this.next(),this.labels.push(ri),i.body=this.parseStatement("do"),this.labels.pop(),this.expect(Fe._while),i.test=this.parseParenExpression(),this.options.ecmaVersion>=6)this.eat(Fe.semi);else this.semicolon();return this.finishNode(i,"DoWhileStatement")};it.parseForStatement=function(i){this.next();var ve=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(ri),this.enterScope(0),this.expect(Fe.parenL),this.type===Fe.semi){if(ve>-1)this.unexpected(ve);return this.parseFor(i,null)}var Ae=this.isLet();if(this.type===Fe._var||this.type===Fe._const||Ae){var Pe=this.startNode(),Ne=Ae?"let":this.value;return this.next(),this.parseVar(Pe,!0,Ne),this.finishNode(Pe,"VariableDeclaration"),this.parseForAfterInit(i,Pe,ve)}var De=this.isContextual("let"),_e=!1,Re=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(Re){var Oe=this.startNode();if(this.next(),Re==="await using"){if(!this.canAwait)this.raise(this.start,"Await using cannot appear outside of async function");this.next()}return this.parseVar(Oe,!0,Re),this.finishNode(Oe,"VariableDeclaration"),this.parseForAfterInit(i,Oe,ve)}var Be=this.containsEsc,Me=new qr,je=this.start,qe=ve>-1?this.parseExprSubscripts(Me,"await"):this.parseExpression(!0,Me);if(this.type===Fe._in||(_e=this.options.ecmaVersion>=6&&this.isContextual("of"))){if(ve>-1){if(this.type===Fe._in)this.unexpected(ve);i.await=!0}else if(_e&&this.options.ecmaVersion>=8){if(qe.start===je&&!Be&&qe.type==="Identifier"&&qe.name==="async")this.unexpected();else if(this.options.ecmaVersion>=9)i.await=!1}if(De&&_e)this.raise(qe.start,"The left-hand side of a for-of loop may not start with 'let'.");return this.toAssignable(qe,!1,Me),this.checkLValPattern(qe),this.parseForIn(i,qe)}else this.checkExpressionErrors(Me,!0);if(ve>-1)this.unexpected(ve);return this.parseFor(i,qe)};it.parseForAfterInit=function(i,ve,Ae){if((this.type===Fe._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&ve.declarations.length===1){if(this.type===Fe._in){if((ve.kind==="using"||ve.kind==="await using")&&!ve.declarations[0].init)this.raise(this.start,"Using declaration is not allowed in for-in loops");if(this.options.ecmaVersion>=9&&Ae>-1)this.unexpected(Ae)}else if(this.options.ecmaVersion>=9)i.await=Ae>-1;return this.parseForIn(i,ve)}if(Ae>-1)this.unexpected(Ae);return this.parseFor(i,ve)};it.parseFunctionStatement=function(i,ve,Ae){return this.next(),this.parseFunction(i,cr|(Ae?0:zs),!1,ve)};it.parseIfStatement=function(i){return this.next(),i.test=this.parseParenExpression(),i.consequent=this.parseStatement("if"),i.alternate=this.eat(Fe._else)?this.parseStatement("if"):null,this.finishNode(i,"IfStatement")};it.parseReturnStatement=function(i){if(!this.allowReturn)this.raise(this.start,"'return' outside of function");if(this.next(),this.eat(Fe.semi)||this.insertSemicolon())i.argument=null;else i.argument=this.parseExpression(),this.semicolon();return this.finishNode(i,"ReturnStatement")};it.parseSwitchStatement=function(i){this.next(),i.discriminant=this.parseParenExpression(),i.cases=[],this.expect(Fe.braceL),this.labels.push(Cu),this.enterScope(Ha);var ve;for(var Ae=!1;this.type!==Fe.braceR;)if(this.type===Fe._case||this.type===Fe._default){var Pe=this.type===Fe._case;if(ve)this.finishNode(ve,"SwitchCase");if(i.cases.push(ve=this.startNode()),ve.consequent=[],this.next(),Pe)ve.test=this.parseExpression();else{if(Ae)this.raiseRecoverable(this.lastTokStart,"Multiple default clauses");Ae=!0,ve.test=null}this.expect(Fe.colon)}else{if(!ve)this.unexpected();ve.consequent.push(this.parseStatement(null))}if(this.exitScope(),ve)this.finishNode(ve,"SwitchCase");return this.next(),this.labels.pop(),this.finishNode(i,"SwitchStatement")};it.parseThrowStatement=function(i){if(this.next(),jt.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 vu=[];it.parseCatchClauseParam=function(){var i=this.parseBindingAtom(),ve=i.type==="Identifier";return this.enterScope(ve?Ga:0),this.checkLValPattern(i,ve?za:xn),this.expect(Fe.parenR),i};it.parseTryStatement=function(i){if(this.next(),i.block=this.parseBlock(),i.handler=null,this.type===Fe._catch){var ve=this.startNode();if(this.next(),this.eat(Fe.parenL))ve.param=this.parseCatchClauseParam();else{if(this.options.ecmaVersion<10)this.unexpected();ve.param=null,this.enterScope(0)}ve.body=this.parseBlock(!1),this.exitScope(),i.handler=this.finishNode(ve,"CatchClause")}if(i.finalizer=this.eat(Fe._finally)?this.parseBlock():null,!i.handler&&!i.finalizer)this.raise(i.start,"Missing catch or finally clause");return this.finishNode(i,"TryStatement")};it.parseVarStatement=function(i,ve,Ae){return this.next(),this.parseVar(i,!1,ve,Ae),this.semicolon(),this.finishNode(i,"VariableDeclaration")};it.parseWhileStatement=function(i){return this.next(),i.test=this.parseParenExpression(),this.labels.push(ri),i.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(i,"WhileStatement")};it.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")};it.parseEmptyStatement=function(i){return this.next(),this.finishNode(i,"EmptyStatement")};it.parseLabeledStatement=function(i,ve,Ae,Pe){for(var Ne=0,De=this.labels;Ne<De.length;Ne+=1){var _e=De[Ne];if(_e.name===ve)this.raise(Ae.start,"Label '"+ve+"' is already declared")}var Re=this.type.isLoop?"loop":this.type===Fe._switch?"switch":null;for(var Oe=this.labels.length-1;Oe>=0;Oe--){var Be=this.labels[Oe];if(Be.statementStart===i.start)Be.statementStart=this.start,Be.kind=Re;else break}return this.labels.push({name:ve,kind:Re,statementStart:this.start}),i.body=this.parseStatement(Pe?Pe.indexOf("label")===-1?Pe+"label":Pe:"label"),this.labels.pop(),i.label=Ae,this.finishNode(i,"LabeledStatement")};it.parseExpressionStatement=function(i,ve){return i.expression=ve,this.semicolon(),this.finishNode(i,"ExpressionStatement")};it.parseBlock=function(i,ve,Ae){if(i===void 0)i=!0;if(ve===void 0)ve=this.startNode();if(ve.body=[],this.expect(Fe.braceL),i)this.enterScope(0);while(this.type!==Fe.braceR){var Pe=this.parseStatement(null);ve.body.push(Pe)}if(Ae)this.strict=!1;if(this.next(),i)this.exitScope();return this.finishNode(ve,"BlockStatement")};it.parseFor=function(i,ve){return i.init=ve,this.expect(Fe.semi),i.test=this.type===Fe.semi?null:this.parseExpression(),this.expect(Fe.semi),i.update=this.type===Fe.parenR?null:this.parseExpression(),this.expect(Fe.parenR),i.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(i,"ForStatement")};it.parseForIn=function(i,ve){var Ae=this.type===Fe._in;if(this.next(),ve.type==="VariableDeclaration"&&ve.declarations[0].init!=null&&(!Ae||this.options.ecmaVersion<8||this.strict||ve.kind!=="var"||ve.declarations[0].id.type!=="Identifier"))this.raise(ve.start,(Ae?"for-in":"for-of")+" loop variable declaration may not have an initializer");return i.left=ve,i.right=Ae?this.parseExpression():this.parseMaybeAssign(),this.expect(Fe.parenR),i.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(i,Ae?"ForInStatement":"ForOfStatement")};it.parseVar=function(i,ve,Ae,Pe){i.declarations=[],i.kind=Ae;for(;;){var Ne=this.startNode();if(this.parseVarId(Ne,Ae),this.eat(Fe.eq))Ne.init=this.parseMaybeAssign(ve);else if(!Pe&&Ae==="const"&&!(this.type===Fe._in||this.options.ecmaVersion>=6&&this.isContextual("of")))this.unexpected();else if(!Pe&&(Ae==="using"||Ae==="await using")&&this.options.ecmaVersion>=17&&this.type!==Fe._in&&!this.isContextual("of"))this.raise(this.lastTokEnd,"Missing initializer in "+Ae+" declaration");else if(!Pe&&Ne.id.type!=="Identifier"&&!(ve&&(this.type===Fe._in||this.isContextual("of"))))this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value");else Ne.init=null;if(i.declarations.push(this.finishNode(Ne,"VariableDeclarator")),!this.eat(Fe.comma))break}return i};it.parseVarId=function(i,ve){i.id=ve==="using"||ve==="await using"?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(i.id,ve==="var"?ni:xn,!1)};var cr=1,zs=2,Ja=4;it.parseFunction=function(i,ve,Ae,Pe,Ne){if(this.initFunction(i),this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!Pe){if(this.type===Fe.star&&ve&zs)this.unexpected();i.generator=this.eat(Fe.star)}if(this.options.ecmaVersion>=8)i.async=!!Pe;if(ve&cr){if(i.id=ve&Ja&&this.type!==Fe.name?null:this.parseIdent(),i.id&&!(ve&zs))this.checkLValSimple(i.id,this.strict||i.generator||i.async?this.treatFunctionsAsVar?ni:xn:Ka)}var De=this.yieldPos,_e=this.awaitPos,Re=this.awaitIdentPos;if(this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(ti(i.async,i.generator)),!(ve&cr))i.id=this.type===Fe.name?this.parseIdent():null;return this.parseFunctionParams(i),this.parseFunctionBody(i,Ae,!1,Ne),this.yieldPos=De,this.awaitPos=_e,this.awaitIdentPos=Re,this.finishNode(i,ve&cr?"FunctionDeclaration":"FunctionExpression")};it.parseFunctionParams=function(i){this.expect(Fe.parenL),i.params=this.parseBindingList(Fe.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};it.parseClass=function(i,ve){this.next();var Ae=this.strict;this.strict=!0,this.parseClassId(i,ve),this.parseClassSuper(i);var Pe=this.enterClassBody(),Ne=this.startNode(),De=!1;Ne.body=[],this.expect(Fe.braceL);while(this.type!==Fe.braceR){var _e=this.parseClassElement(i.superClass!==null);if(_e){if(Ne.body.push(_e),_e.type==="MethodDefinition"&&_e.kind==="constructor"){if(De)this.raiseRecoverable(_e.start,"Duplicate constructor in the same class");De=!0}else if(_e.key&&_e.key.type==="PrivateIdentifier"&&Su(Pe,_e))this.raiseRecoverable(_e.key.start,"Identifier '#"+_e.key.name+"' has already been declared")}}return this.strict=Ae,this.next(),i.body=this.finishNode(Ne,"ClassBody"),this.exitClassBody(),this.finishNode(i,ve?"ClassDeclaration":"ClassExpression")};it.parseClassElement=function(i){if(this.eat(Fe.semi))return null;var ve=this.options.ecmaVersion,Ae=this.startNode(),Pe="",Ne=!1,De=!1,_e="method",Re=!1;if(this.eatContextual("static")){if(ve>=13&&this.eat(Fe.braceL))return this.parseClassStaticBlock(Ae),Ae;if(this.isClassElementNameStart()||this.type===Fe.star)Re=!0;else Pe="static"}if(Ae.static=Re,!Pe&&ve>=8&&this.eatContextual("async"))if((this.isClassElementNameStart()||this.type===Fe.star)&&!this.canInsertSemicolon())De=!0;else Pe="async";if(!Pe&&(ve>=9||!De)&&this.eat(Fe.star))Ne=!0;if(!Pe&&!De&&!Ne){var Oe=this.value;if(this.eatContextual("get")||this.eatContextual("set"))if(this.isClassElementNameStart())_e=Oe;else Pe=Oe}if(Pe)Ae.computed=!1,Ae.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),Ae.key.name=Pe,this.finishNode(Ae.key,"Identifier");else this.parseClassElementName(Ae);if(ve<13||this.type===Fe.parenL||_e!=="method"||Ne||De){var Be=!Ae.static&&Mr(Ae,"constructor"),Me=Be&&i;if(Be&&_e!=="method")this.raise(Ae.key.start,"Constructor can't have get/set modifier");Ae.kind=Be?"constructor":_e,this.parseClassMethod(Ae,Ne,De,Me)}else this.parseClassField(Ae);return Ae};it.isClassElementNameStart=function(){return this.type===Fe.name||this.type===Fe.privateId||this.type===Fe.num||this.type===Fe.string||this.type===Fe.bracketL||this.type.keyword};it.parseClassElementName=function(i){if(this.type===Fe.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)};it.parseClassMethod=function(i,ve,Ae,Pe){var Ne=i.key;if(i.kind==="constructor"){if(ve)this.raise(Ne.start,"Constructor can't be a generator");if(Ae)this.raise(Ne.start,"Constructor can't be an async method")}else if(i.static&&Mr(i,"prototype"))this.raise(Ne.start,"Classes may not have a static property named prototype");var De=i.value=this.parseMethod(ve,Ae,Pe);if(i.kind==="get"&&De.params.length!==0)this.raiseRecoverable(De.start,"getter should have no params");if(i.kind==="set"&&De.params.length!==1)this.raiseRecoverable(De.start,"setter should have exactly one param");if(i.kind==="set"&&De.params[0].type==="RestElement")this.raiseRecoverable(De.params[0].start,"Setter cannot use rest params");return this.finishNode(i,"MethodDefinition")};it.parseClassField=function(i){if(Mr(i,"constructor"))this.raise(i.key.start,"Classes can't have a field named 'constructor'");else if(i.static&&Mr(i,"prototype"))this.raise(i.key.start,"Classes can't have a static field named 'prototype'");if(this.eat(Fe.eq))this.enterScope(pr|jr),i.value=this.parseMaybeAssign(),this.exitScope();else i.value=null;return this.semicolon(),this.finishNode(i,"PropertyDefinition")};it.parseClassStaticBlock=function(i){i.body=[];var ve=this.labels;this.labels=[],this.enterScope($n|jr);while(this.type!==Fe.braceR){var Ae=this.parseStatement(null);i.body.push(Ae)}return this.next(),this.exitScope(),this.labels=ve,this.finishNode(i,"StaticBlock")};it.parseClassId=function(i,ve){if(this.type===Fe.name){if(i.id=this.parseIdent(),ve)this.checkLValSimple(i.id,xn,!1)}else{if(ve===!0)this.unexpected();i.id=null}};it.parseClassSuper=function(i){i.superClass=this.eat(Fe._extends)?this.parseExprSubscripts(null,!1):null};it.enterClassBody=function(){var i={declared:Object.create(null),used:[]};return this.privateNameStack.push(i),i.declared};it.exitClassBody=function(){var i=this.privateNameStack.pop(),{declared:ve,used:Ae}=i;if(!this.options.checkPrivateFields)return;var Pe=this.privateNameStack.length,Ne=Pe===0?null:this.privateNameStack[Pe-1];for(var De=0;De<Ae.length;++De){var _e=Ae[De];if(!Un(ve,_e.name))if(Ne)Ne.used.push(_e);else this.raiseRecoverable(_e.start,"Private field '#"+_e.name+"' must be declared in an enclosing class")}};function Su(i,ve){var Ae=ve.key.name,Pe=i[Ae],Ne="true";if(ve.type==="MethodDefinition"&&(ve.kind==="get"||ve.kind==="set"))Ne=(ve.static?"s":"i")+ve.kind;if(Pe==="iget"&&Ne==="iset"||Pe==="iset"&&Ne==="iget"||Pe==="sget"&&Ne==="sset"||Pe==="sset"&&Ne==="sget")return i[Ae]="true",!1;else if(!Pe)return i[Ae]=Ne,!1;else return!0}function Mr(i,ve){var{computed:Ae,key:Pe}=i;return!Ae&&(Pe.type==="Identifier"&&Pe.name===ve||Pe.type==="Literal"&&Pe.value===ve)}it.parseExportAllDeclaration=function(i,ve){if(this.options.ecmaVersion>=11)if(this.eatContextual("as"))i.exported=this.parseModuleExportName(),this.checkExport(ve,i.exported,this.lastTokStart);else i.exported=null;if(this.expectContextual("from"),this.type!==Fe.string)this.unexpected();if(i.source=this.parseExprAtom(),this.options.ecmaVersion>=16)i.attributes=this.parseWithClause();return this.semicolon(),this.finishNode(i,"ExportAllDeclaration")};it.parseExport=function(i,ve){if(this.next(),this.eat(Fe.star))return this.parseExportAllDeclaration(i,ve);if(this.eat(Fe._default))return this.checkExport(ve,"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(ve,i.declaration.declarations);else this.checkExport(ve,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(ve),this.eatContextual("from")){if(this.type!==Fe.string)this.unexpected();if(i.source=this.parseExprAtom(),this.options.ecmaVersion>=16)i.attributes=this.parseWithClause()}else{for(var Ae=0,Pe=i.specifiers;Ae<Pe.length;Ae+=1){var Ne=Pe[Ae];if(this.checkUnreserved(Ne.local),this.checkLocalExport(Ne.local),Ne.local.type==="Literal")this.raise(Ne.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")};it.parseExportDeclaration=function(i){return this.parseStatement(null)};it.parseExportDefaultDeclaration=function(){var i;if(this.type===Fe._function||(i=this.isAsyncFunction())){var ve=this.startNode();if(this.next(),i)this.next();return this.parseFunction(ve,cr|Ja,!1,i)}else if(this.type===Fe._class){var Ae=this.startNode();return this.parseClass(Ae,"nullableID")}else{var Pe=this.parseMaybeAssign();return this.semicolon(),Pe}};it.checkExport=function(i,ve,Ae){if(!i)return;if(typeof ve!=="string")ve=ve.type==="Identifier"?ve.name:ve.value;if(Un(i,ve))this.raiseRecoverable(Ae,"Duplicate export '"+ve+"'");i[ve]=!0};it.checkPatternExport=function(i,ve){var Ae=ve.type;if(Ae==="Identifier")this.checkExport(i,ve,ve.start);else if(Ae==="ObjectPattern")for(var Pe=0,Ne=ve.properties;Pe<Ne.length;Pe+=1){var De=Ne[Pe];this.checkPatternExport(i,De)}else if(Ae==="ArrayPattern")for(var _e=0,Re=ve.elements;_e<Re.length;_e+=1){var Oe=Re[_e];if(Oe)this.checkPatternExport(i,Oe)}else if(Ae==="Property")this.checkPatternExport(i,ve.value);else if(Ae==="AssignmentPattern")this.checkPatternExport(i,ve.left);else if(Ae==="RestElement")this.checkPatternExport(i,ve.argument)};it.checkVariableExport=function(i,ve){if(!i)return;for(var Ae=0,Pe=ve;Ae<Pe.length;Ae+=1){var Ne=Pe[Ae];this.checkPatternExport(i,Ne.id)}};it.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};it.parseExportSpecifier=function(i){var ve=this.startNode();return ve.local=this.parseModuleExportName(),ve.exported=this.eatContextual("as")?this.parseModuleExportName():ve.local,this.checkExport(i,ve.exported,ve.exported.start),this.finishNode(ve,"ExportSpecifier")};it.parseExportSpecifiers=function(i){var ve=[],Ae=!0;this.expect(Fe.braceL);while(!this.eat(Fe.braceR)){if(!Ae){if(this.expect(Fe.comma),this.afterTrailingComma(Fe.braceR))break}else Ae=!1;ve.push(this.parseExportSpecifier(i))}return ve};it.parseImport=function(i){if(this.next(),this.type===Fe.string)i.specifiers=vu,i.source=this.parseExprAtom();else i.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),i.source=this.type===Fe.string?this.parseExprAtom():this.unexpected();if(this.options.ecmaVersion>=16)i.attributes=this.parseWithClause();return this.semicolon(),this.finishNode(i,"ImportDeclaration")};it.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,xn),this.finishNode(i,"ImportSpecifier")};it.parseImportDefaultSpecifier=function(){var i=this.startNode();return i.local=this.parseIdent(),this.checkLValSimple(i.local,xn),this.finishNode(i,"ImportDefaultSpecifier")};it.parseImportNamespaceSpecifier=function(){var i=this.startNode();return this.next(),this.expectContextual("as"),i.local=this.parseIdent(),this.checkLValSimple(i.local,xn),this.finishNode(i,"ImportNamespaceSpecifier")};it.parseImportSpecifiers=function(){var i=[],ve=!0;if(this.type===Fe.name){if(i.push(this.parseImportDefaultSpecifier()),!this.eat(Fe.comma))return i}if(this.type===Fe.star)return i.push(this.parseImportNamespaceSpecifier()),i;this.expect(Fe.braceL);while(!this.eat(Fe.braceR)){if(!ve){if(this.expect(Fe.comma),this.afterTrailingComma(Fe.braceR))break}else ve=!1;i.push(this.parseImportSpecifier())}return i};it.parseWithClause=function(){var i=[];if(!this.eat(Fe._with))return i;this.expect(Fe.braceL);var ve={},Ae=!0;while(!this.eat(Fe.braceR)){if(!Ae){if(this.expect(Fe.comma),this.afterTrailingComma(Fe.braceR))break}else Ae=!1;var Pe=this.parseImportAttribute(),Ne=Pe.key.type==="Identifier"?Pe.key.name:Pe.key.value;if(Un(ve,Ne))this.raiseRecoverable(Pe.key.start,"Duplicate attribute key '"+Ne+"'");ve[Ne]=!0,i.push(Pe)}return i};it.parseImportAttribute=function(){var i=this.startNode();if(i.key=this.type===Fe.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(Fe.colon),this.type!==Fe.string)this.unexpected();return i.value=this.parseExprAtom(),this.finishNode(i,"ImportAttribute")};it.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===Fe.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)};it.adaptDirectivePrologue=function(i){for(var ve=0;ve<i.length&&this.isDirectiveCandidate(i[ve]);++ve)i[ve].directive=i[ve].expression.raw.slice(1,-1)};it.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 sn=Tt.prototype;sn.toAssignable=function(i,ve,Ae){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",Ae)this.checkPatternErrors(Ae,!0);for(var Pe=0,Ne=i.properties;Pe<Ne.length;Pe+=1){var De=Ne[Pe];if(this.toAssignable(De,ve),De.type==="RestElement"&&(De.argument.type==="ArrayPattern"||De.argument.type==="ObjectPattern"))this.raise(De.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,ve);break;case"ArrayExpression":if(i.type="ArrayPattern",Ae)this.checkPatternErrors(Ae,!0);this.toAssignableList(i.elements,ve);break;case"SpreadElement":if(i.type="RestElement",this.toAssignable(i.argument,ve),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,ve);break;case"ParenthesizedExpression":this.toAssignable(i.expression,ve,Ae);break;case"ChainExpression":this.raiseRecoverable(i.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!ve)break;default:this.raise(i.start,"Assigning to rvalue")}else if(Ae)this.checkPatternErrors(Ae,!0);return i};sn.toAssignableList=function(i,ve){var Ae=i.length;for(var Pe=0;Pe<Ae;Pe++){var Ne=i[Pe];if(Ne)this.toAssignable(Ne,ve)}if(Ae){var De=i[Ae-1];if(this.options.ecmaVersion===6&&ve&&De&&De.type==="RestElement"&&De.argument.type!=="Identifier")this.unexpected(De.argument.start)}return i};sn.parseSpread=function(i){var ve=this.startNode();return this.next(),ve.argument=this.parseMaybeAssign(!1,i),this.finishNode(ve,"SpreadElement")};sn.parseRestBinding=function(){var i=this.startNode();if(this.next(),this.options.ecmaVersion===6&&this.type!==Fe.name)this.unexpected();return i.argument=this.parseBindingAtom(),this.finishNode(i,"RestElement")};sn.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case Fe.bracketL:var i=this.startNode();return this.next(),i.elements=this.parseBindingList(Fe.bracketR,!0,!0),this.finishNode(i,"ArrayPattern");case Fe.braceL:return this.parseObj(!0)}return this.parseIdent()};sn.parseBindingList=function(i,ve,Ae,Pe){var Ne=[],De=!0;while(!this.eat(i)){if(De)De=!1;else this.expect(Fe.comma);if(ve&&this.type===Fe.comma)Ne.push(null);else if(Ae&&this.afterTrailingComma(i))break;else if(this.type===Fe.ellipsis){var _e=this.parseRestBinding();if(this.parseBindingListItem(_e),Ne.push(_e),this.type===Fe.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");this.expect(i);break}else Ne.push(this.parseAssignableListItem(Pe))}return Ne};sn.parseAssignableListItem=function(i){var ve=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(ve),ve};sn.parseBindingListItem=function(i){return i};sn.parseMaybeDefault=function(i,ve,Ae){if(Ae=Ae||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(Fe.eq))return Ae;var Pe=this.startNodeAt(i,ve);return Pe.left=Ae,Pe.right=this.parseMaybeAssign(),this.finishNode(Pe,"AssignmentPattern")};sn.checkLValSimple=function(i,ve,Ae){if(ve===void 0)ve=Or;var Pe=ve!==Or;switch(i.type){case"Identifier":if(this.strict&&this.reservedWordsStrictBind.test(i.name))this.raiseRecoverable(i.start,(Pe?"Binding ":"Assigning to ")+i.name+" in strict mode");if(Pe){if(ve===xn&&i.name==="let")this.raiseRecoverable(i.start,"let is disallowed as a lexically bound name");if(Ae){if(Un(Ae,i.name))this.raiseRecoverable(i.start,"Argument name clash");Ae[i.name]=!0}if(ve!==Xa)this.declareName(i.name,ve,i.start)}break;case"ChainExpression":this.raiseRecoverable(i.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(Pe)this.raiseRecoverable(i.start,"Binding member expression");break;case"ParenthesizedExpression":if(Pe)this.raiseRecoverable(i.start,"Binding parenthesized expression");return this.checkLValSimple(i.expression,ve,Ae);default:this.raise(i.start,(Pe?"Binding":"Assigning to")+" rvalue")}};sn.checkLValPattern=function(i,ve,Ae){if(ve===void 0)ve=Or;switch(i.type){case"ObjectPattern":for(var Pe=0,Ne=i.properties;Pe<Ne.length;Pe+=1){var De=Ne[Pe];this.checkLValInnerPattern(De,ve,Ae)}break;case"ArrayPattern":for(var _e=0,Re=i.elements;_e<Re.length;_e+=1){var Oe=Re[_e];if(Oe)this.checkLValInnerPattern(Oe,ve,Ae)}break;default:this.checkLValSimple(i,ve,Ae)}};sn.checkLValInnerPattern=function(i,ve,Ae){if(ve===void 0)ve=Or;switch(i.type){case"Property":this.checkLValInnerPattern(i.value,ve,Ae);break;case"AssignmentPattern":this.checkLValPattern(i.left,ve,Ae);break;case"RestElement":this.checkLValPattern(i.argument,ve,Ae);break;default:this.checkLValPattern(i,ve,Ae)}};var tn=function(ve,Ae,Pe,Ne,De){this.token=ve,this.isExpr=!!Ae,this.preserveSpace=!!Pe,this.override=Ne,this.generator=!!De},St={b_stat:new tn("{",!1),b_expr:new tn("{",!0),b_tmpl:new tn("${",!1),p_stat:new tn("(",!1),p_expr:new tn("(",!0),q_tmpl:new tn("`",!0,!0,function(i){return i.tryReadTemplateToken()}),f_stat:new tn("function",!1),f_expr:new tn("function",!0),f_expr_gen:new tn("function",!0,!1,null,!0),f_gen:new tn("function",!1,!1,null,!0)},Hn=Tt.prototype;Hn.initialContext=function(){return[St.b_stat]};Hn.curContext=function(){return this.context[this.context.length-1]};Hn.braceIsBlock=function(i){var ve=this.curContext();if(ve===St.f_expr||ve===St.f_stat)return!0;if(i===Fe.colon&&(ve===St.b_stat||ve===St.b_expr))return!ve.isExpr;if(i===Fe._return||i===Fe.name&&this.exprAllowed)return jt.test(this.input.slice(this.lastTokEnd,this.start));if(i===Fe._else||i===Fe.semi||i===Fe.eof||i===Fe.parenR||i===Fe.arrow)return!0;if(i===Fe.braceL)return ve===St.b_stat;if(i===Fe._var||i===Fe._const||i===Fe.name)return!1;return!this.exprAllowed};Hn.inGeneratorContext=function(){for(var i=this.context.length-1;i>=1;i--){var ve=this.context[i];if(ve.token==="function")return ve.generator}return!1};Hn.updateContext=function(i){var ve,Ae=this.type;if(Ae.keyword&&i===Fe.dot)this.exprAllowed=!1;else if(ve=Ae.updateContext)ve.call(this,i);else this.exprAllowed=Ae.beforeExpr};Hn.overrideContext=function(i){if(this.curContext()!==i)this.context[this.context.length-1]=i};Fe.parenR.updateContext=Fe.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var i=this.context.pop();if(i===St.b_stat&&this.curContext().token==="function")i=this.context.pop();this.exprAllowed=!i.isExpr};Fe.braceL.updateContext=function(i){this.context.push(this.braceIsBlock(i)?St.b_stat:St.b_expr),this.exprAllowed=!0};Fe.dollarBraceL.updateContext=function(){this.context.push(St.b_tmpl),this.exprAllowed=!0};Fe.parenL.updateContext=function(i){var ve=i===Fe._if||i===Fe._for||i===Fe._with||i===Fe._while;this.context.push(ve?St.p_stat:St.p_expr),this.exprAllowed=!0};Fe.incDec.updateContext=function(){};Fe._function.updateContext=Fe._class.updateContext=function(i){if(i.beforeExpr&&i!==Fe._else&&!(i===Fe.semi&&this.curContext()!==St.p_stat)&&!(i===Fe._return&&jt.test(this.input.slice(this.lastTokEnd,this.start)))&&!((i===Fe.colon||i===Fe.braceL)&&this.curContext()===St.b_stat))this.context.push(St.f_expr);else this.context.push(St.f_stat);this.exprAllowed=!1};Fe.colon.updateContext=function(){if(this.curContext().token==="function")this.context.pop();this.exprAllowed=!0};Fe.backQuote.updateContext=function(){if(this.curContext()===St.q_tmpl)this.context.pop();else this.context.push(St.q_tmpl);this.exprAllowed=!1};Fe.star.updateContext=function(i){if(i===Fe._function){var ve=this.context.length-1;if(this.context[ve]===St.f_expr)this.context[ve]=St.f_expr_gen;else this.context[ve]=St.f_gen}this.exprAllowed=!0};Fe.name.updateContext=function(i){var ve=!1;if(this.options.ecmaVersion>=6&&i!==Fe.dot){if(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())ve=!0}this.exprAllowed=ve};var lt=Tt.prototype;lt.checkPropClash=function(i,ve,Ae){if(this.options.ecmaVersion>=9&&i.type==="SpreadElement")return;if(this.options.ecmaVersion>=6&&(i.computed||i.method||i.shorthand))return;var Pe=i.key,Ne;switch(Pe.type){case"Identifier":Ne=Pe.name;break;case"Literal":Ne=String(Pe.value);break;default:return}var De=i.kind;if(this.options.ecmaVersion>=6){if(Ne==="__proto__"&&De==="init"){if(ve.proto)if(Ae){if(Ae.doubleProto<0)Ae.doubleProto=Pe.start}else this.raiseRecoverable(Pe.start,"Redefinition of __proto__ property");ve.proto=!0}return}Ne="$"+Ne;var _e=ve[Ne];if(_e){var Re;if(De==="init")Re=this.strict&&_e.init||_e.get||_e.set;else Re=_e.init||_e[De];if(Re)this.raiseRecoverable(Pe.start,"Redefinition of property")}else _e=ve[Ne]={init:!1,get:!1,set:!1};_e[De]=!0};lt.parseExpression=function(i,ve){var Ae=this;return this.catchStackOverflow(function(){var{start:Pe,startLoc:Ne}=Ae,De=Ae.parseMaybeAssign(i,ve);if(Ae.type===Fe.comma){var _e=Ae.startNodeAt(Pe,Ne);_e.expressions=[De];while(Ae.eat(Fe.comma))_e.expressions.push(Ae.parseMaybeAssign(i,ve));return Ae.finishNode(_e,"SequenceExpression")}return De})};lt.parseMaybeAssign=function(i,ve,Ae){if(this.isContextual("yield"))if(this.inGenerator)return this.parseYield(i);else this.exprAllowed=!1;var Pe=!1,Ne=-1,De=-1,_e=-1;if(ve)Ne=ve.parenthesizedAssign,De=ve.trailingComma,_e=ve.doubleProto,ve.parenthesizedAssign=ve.trailingComma=-1;else ve=new qr,Pe=!0;var Re=this.start,Oe=this.startLoc;if(this.type===Fe.parenL||this.type===Fe.name)this.potentialArrowAt=this.start,this.potentialArrowInForAwait=i==="await";var Be=this.parseMaybeConditional(i,ve);if(Ae)Be=Ae.call(this,Be,Re,Oe);if(this.type.isAssign){var Me=this.startNodeAt(Re,Oe);if(Me.operator=this.value,this.type===Fe.eq)Be=this.toAssignable(Be,!1,ve);if(!Pe)ve.parenthesizedAssign=ve.trailingComma=ve.doubleProto=-1;if(ve.shorthandAssign>=Be.start)ve.shorthandAssign=-1;if(this.type===Fe.eq)this.checkLValPattern(Be);else this.checkLValSimple(Be);if(Me.left=Be,this.next(),Me.right=this.parseMaybeAssign(i),_e>-1)ve.doubleProto=_e;return this.finishNode(Me,"AssignmentExpression")}else if(Pe)this.checkExpressionErrors(ve,!0);if(Ne>-1)ve.parenthesizedAssign=Ne;if(De>-1)ve.trailingComma=De;return Be};lt.parseMaybeConditional=function(i,ve){var Ae=this.start,Pe=this.startLoc,Ne=this.parseExprOps(i,ve);if(this.checkExpressionErrors(ve))return Ne;if(!(Ne.type==="ArrowFunctionExpression"&&Ne.start===Ae)&&this.eat(Fe.question)){var De=this.startNodeAt(Ae,Pe);return De.test=Ne,De.consequent=this.parseMaybeAssign(),this.expect(Fe.colon),De.alternate=this.parseMaybeAssign(i),this.finishNode(De,"ConditionalExpression")}return Ne};lt.parseExprOps=function(i,ve){var Ae=this.start,Pe=this.startLoc,Ne=this.parseMaybeUnary(ve,!1,!1,i);if(this.checkExpressionErrors(ve))return Ne;return Ne.start===Ae&&Ne.type==="ArrowFunctionExpression"?Ne:this.parseExprOp(Ne,Ae,Pe,-1,i)};lt.parseExprOp=function(i,ve,Ae,Pe,Ne){var De=this.type.binop;if(De!=null&&(!Ne||this.type!==Fe._in)){if(De>Pe){var _e=this.type===Fe.logicalOR||this.type===Fe.logicalAND,Re=this.type===Fe.coalesce;if(Re)De=Fe.logicalAND.binop;var Oe=this.value;this.next();var Be=this.start,Me=this.startLoc,je=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,Ne),Be,Me,De,Ne),qe=this.buildBinary(ve,Ae,i,je,Oe,_e||Re);if(_e&&this.type===Fe.coalesce||Re&&(this.type===Fe.logicalOR||this.type===Fe.logicalAND))this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses");return this.parseExprOp(qe,ve,Ae,Pe,Ne)}}return i};lt.buildBinary=function(i,ve,Ae,Pe,Ne,De){if(Pe.type==="PrivateIdentifier")this.raise(Pe.start,"Private identifier can only be left side of binary expression");var _e=this.startNodeAt(i,ve);return _e.left=Ae,_e.operator=Ne,_e.right=Pe,this.finishNode(_e,De?"LogicalExpression":"BinaryExpression")};lt.parseMaybeUnary=function(i,ve,Ae,Pe){var Ne=this.start,De=this.startLoc,_e;if(this.isContextual("await")&&this.canAwait)_e=this.parseAwait(Pe),ve=!0;else if(this.type.prefix){var Re=this.startNode(),Oe=this.type===Fe.incDec;if(Re.operator=this.value,Re.prefix=!0,this.next(),Re.argument=this.parseMaybeUnary(null,!0,Oe,Pe),this.checkExpressionErrors(i,!0),Oe)this.checkLValSimple(Re.argument);else if(this.strict&&Re.operator==="delete"&&Ya(Re.argument))this.raiseRecoverable(Re.start,"Deleting local variable in strict mode");else if(Re.operator==="delete"&&Xs(Re.argument))this.raiseRecoverable(Re.start,"Private fields can not be deleted");else ve=!0;_e=this.finishNode(Re,Oe?"UpdateExpression":"UnaryExpression")}else if(!ve&&this.type===Fe.privateId){if((Pe||this.privateNameStack.length===0)&&this.options.checkPrivateFields)this.unexpected();if(_e=this.parsePrivateIdent(),this.type!==Fe._in)this.unexpected()}else{if(_e=this.parseExprSubscripts(i,Pe),this.checkExpressionErrors(i))return _e;while(this.type.postfix&&!this.canInsertSemicolon()){var Be=this.startNodeAt(Ne,De);Be.operator=this.value,Be.prefix=!1,Be.argument=_e,this.checkLValSimple(_e),this.next(),_e=this.finishNode(Be,"UpdateExpression")}}if(!Ae&&!(_e.type==="ArrowFunctionExpression"&&_e.start===Ne)&&this.eat(Fe.starstar))if(ve)this.unexpected(this.lastTokStart);else return this.buildBinary(Ne,De,_e,this.parseMaybeUnary(null,!1,!1,Pe),"**",!1);else return _e};function Ya(i){return i.type==="Identifier"||i.type==="ParenthesizedExpression"&&Ya(i.expression)}function Xs(i){return i.type==="MemberExpression"&&i.property.type==="PrivateIdentifier"||i.type==="ChainExpression"&&Xs(i.expression)||i.type==="ParenthesizedExpression"&&Xs(i.expression)}lt.parseExprSubscripts=function(i,ve){var Ae=this.start,Pe=this.startLoc,Ne=this.parseExprAtom(i,ve);if(Ne.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return Ne;var De=this.parseSubscripts(Ne,Ae,Pe,!1,ve);if(i&&De.type==="MemberExpression"){if(i.parenthesizedAssign>=De.start)i.parenthesizedAssign=-1;if(i.parenthesizedBind>=De.start)i.parenthesizedBind=-1;if(i.trailingComma>=De.start)i.trailingComma=-1}return De};lt.parseSubscripts=function(i,ve,Ae,Pe,Ne){var De=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,_e=!1;while(!0){var Re=this.parseSubscript(i,ve,Ae,Pe,De,_e,Ne);if(Re.optional)_e=!0;if(Re===i||Re.type==="ArrowFunctionExpression"){if(_e){var Oe=this.startNodeAt(ve,Ae);Oe.expression=Re,Re=this.finishNode(Oe,"ChainExpression")}return Re}i=Re}};lt.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(Fe.arrow)};lt.parseSubscriptAsyncArrow=function(i,ve,Ae,Pe){return this.parseArrowExpression(this.startNodeAt(i,ve),Ae,!0,Pe)};lt.parseSubscript=function(i,ve,Ae,Pe,Ne,De,_e){var Re=this.options.ecmaVersion>=11,Oe=Re&&this.eat(Fe.questionDot);if(Pe&&Oe)this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var Be=this.eat(Fe.bracketL);if(Be||Oe&&this.type!==Fe.parenL&&this.type!==Fe.backQuote||this.eat(Fe.dot)){var Me=this.startNodeAt(ve,Ae);if(Me.object=i,Be)Me.property=this.parseExpression(),this.expect(Fe.bracketR);else if(this.type===Fe.privateId&&i.type!=="Super")Me.property=this.parsePrivateIdent();else Me.property=this.parseIdent(this.options.allowReserved!=="never");if(Me.computed=!!Be,Re)Me.optional=Oe;i=this.finishNode(Me,"MemberExpression")}else if(!Pe&&this.eat(Fe.parenL)){var je=new qr,qe=this.yieldPos,Ge=this.awaitPos,He=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var Xe=this.parseExprList(Fe.parenR,this.options.ecmaVersion>=8,!1,je);if(Ne&&!Oe&&this.shouldParseAsyncArrow()){if(this.checkPatternErrors(je,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0)this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function");return this.yieldPos=qe,this.awaitPos=Ge,this.awaitIdentPos=He,this.parseSubscriptAsyncArrow(ve,Ae,Xe,_e)}this.checkExpressionErrors(je,!0),this.yieldPos=qe||this.yieldPos,this.awaitPos=Ge||this.awaitPos,this.awaitIdentPos=He||this.awaitIdentPos;var ze=this.startNodeAt(ve,Ae);if(ze.callee=i,ze.arguments=Xe,Re)ze.optional=Oe;i=this.finishNode(ze,"CallExpression")}else if(this.type===Fe.backQuote){if(Oe||De)this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var tt=this.startNodeAt(ve,Ae);tt.tag=i,tt.quasi=this.parseTemplate({isTagged:!0}),i=this.finishNode(tt,"TaggedTemplateExpression")}return i};lt.parseExprAtom=function(i,ve,Ae){if(this.type===Fe.slash)this.readRegexp();var Pe,Ne=this.potentialArrowAt===this.start;switch(this.type){case Fe._super:if(!this.allowSuper)this.raise(this.start,"'super' keyword outside a method");if(Pe=this.startNode(),this.next(),this.type===Fe.parenL&&!this.allowDirectSuper)this.raise(Pe.start,"super() call outside constructor of a subclass");if(this.type!==Fe.dot&&this.type!==Fe.bracketL&&this.type!==Fe.parenL)this.unexpected();return this.finishNode(Pe,"Super");case Fe._this:return Pe=this.startNode(),this.next(),this.finishNode(Pe,"ThisExpression");case Fe.name:var De=this.start,_e=this.startLoc,Re=this.containsEsc,Oe=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!Re&&Oe.name==="async"&&!this.canInsertSemicolon()&&this.eat(Fe._function))return this.overrideContext(St.f_expr),this.parseFunction(this.startNodeAt(De,_e),0,!1,!0,ve);if(Ne&&!this.canInsertSemicolon()){if(this.eat(Fe.arrow))return this.parseArrowExpression(this.startNodeAt(De,_e),[Oe],!1,ve);if(this.options.ecmaVersion>=8&&Oe.name==="async"&&this.type===Fe.name&&!Re&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc)){if(Oe=this.parseIdent(!1),this.canInsertSemicolon()||!this.eat(Fe.arrow))this.unexpected();return this.parseArrowExpression(this.startNodeAt(De,_e),[Oe],!0,ve)}}return Oe;case Fe.regexp:var Be=this.value;return Pe=this.parseLiteral(Be.value),Pe.regex={pattern:Be.pattern,flags:Be.flags},Pe;case Fe.num:case Fe.string:return this.parseLiteral(this.value);case Fe._null:case Fe._true:case Fe._false:return Pe=this.startNode(),Pe.value=this.type===Fe._null?null:this.type===Fe._true,Pe.raw=this.type.keyword,this.next(),this.finishNode(Pe,"Literal");case Fe.parenL:var Me=this.start,je=this.parseParenAndDistinguishExpression(Ne,ve);if(i){if(i.parenthesizedAssign<0&&!this.isSimpleAssignTarget(je))i.parenthesizedAssign=Me;if(i.parenthesizedBind<0)i.parenthesizedBind=Me}return je;case Fe.bracketL:return Pe=this.startNode(),this.next(),Pe.elements=this.parseExprList(Fe.bracketR,!0,!0,i),this.finishNode(Pe,"ArrayExpression");case Fe.braceL:return this.overrideContext(St.b_expr),this.parseObj(!1,i);case Fe._function:return Pe=this.startNode(),this.next(),this.parseFunction(Pe,0);case Fe._class:return this.parseClass(this.startNode(),!1);case Fe._new:return this.parseNew();case Fe.backQuote:return this.parseTemplate();case Fe._import:if(this.options.ecmaVersion>=11)return this.parseExprImport(Ae);else return this.unexpected();default:return this.parseExprAtomDefault()}};lt.parseExprAtomDefault=function(){this.unexpected()};lt.parseExprImport=function(i){var ve=this.startNode();if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword import");if(this.next(),this.type===Fe.parenL&&!i)return this.parseDynamicImport(ve);else if(this.type===Fe.dot){var Ae=this.startNodeAt(ve.start,ve.loc&&ve.loc.start);return Ae.name="import",ve.meta=this.finishNode(Ae,"Identifier"),this.parseImportMeta(ve)}else this.unexpected()};lt.parseDynamicImport=function(i){if(this.next(),i.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)if(!this.eat(Fe.parenR))if(this.expect(Fe.comma),!this.afterTrailingComma(Fe.parenR)){if(i.options=this.parseMaybeAssign(),!this.eat(Fe.parenR)){if(this.expect(Fe.comma),!this.afterTrailingComma(Fe.parenR))this.unexpected()}}else i.options=null;else i.options=null;else if(!this.eat(Fe.parenR)){var ve=this.start;if(this.eat(Fe.comma)&&this.eat(Fe.parenR))this.raiseRecoverable(ve,"Trailing comma is not allowed in import()");else this.unexpected(ve)}return this.finishNode(i,"ImportExpression")};lt.parseImportMeta=function(i){this.next();var ve=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(ve)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")};lt.parseLiteral=function(i){var ve=this.startNode();if(ve.value=i,ve.raw=this.input.slice(this.start,this.end),ve.raw.charCodeAt(ve.raw.length-1)===110)ve.bigint=ve.value!=null?ve.value.toString():ve.raw.slice(0,-1).replace(/_/g,"");return this.next(),this.finishNode(ve,"Literal")};lt.parseParenExpression=function(){this.expect(Fe.parenL);var i=this.parseExpression();return this.expect(Fe.parenR),i};lt.shouldParseArrow=function(i){return!this.canInsertSemicolon()};lt.parseParenAndDistinguishExpression=function(i,ve){var Ae=this.start,Pe=this.startLoc,Ne,De=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var _e=this.start,Re=this.startLoc,Oe=[],Be=!0,Me=!1,je=new qr,qe=this.yieldPos,Ge=this.awaitPos,He;this.yieldPos=0,this.awaitPos=0;while(this.type!==Fe.parenR)if(Be?Be=!1:this.expect(Fe.comma),De&&this.afterTrailingComma(Fe.parenR,!0)){Me=!0;break}else if(this.type===Fe.ellipsis){if(He=this.start,Oe.push(this.parseParenItem(this.parseRestBinding())),this.type===Fe.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else Oe.push(this.parseMaybeAssign(!1,je,this.parseParenItem));var Xe=this.lastTokEnd,ze=this.lastTokEndLoc;if(this.expect(Fe.parenR),i&&this.shouldParseArrow(Oe)&&this.eat(Fe.arrow))return this.checkPatternErrors(je,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=qe,this.awaitPos=Ge,this.parseParenArrowList(Ae,Pe,Oe,ve);if(!Oe.length||Me)this.unexpected(this.lastTokStart);if(He)this.unexpected(He);if(this.checkExpressionErrors(je,!0),this.yieldPos=qe||this.yieldPos,this.awaitPos=Ge||this.awaitPos,Oe.length>1)Ne=this.startNodeAt(_e,Re),Ne.expressions=Oe,this.finishNodeAt(Ne,"SequenceExpression",Xe,ze);else Ne=Oe[0]}else Ne=this.parseParenExpression();if(this.options.preserveParens){var tt=this.startNodeAt(Ae,Pe);return tt.expression=Ne,this.finishNode(tt,"ParenthesizedExpression")}else return Ne};lt.parseParenItem=function(i){return i};lt.parseParenArrowList=function(i,ve,Ae,Pe){return this.parseArrowExpression(this.startNodeAt(i,ve),Ae,!1,Pe)};var Tu=[];lt.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===Fe.dot){var ve=this.startNodeAt(i.start,i.loc&&i.loc.start);ve.name="new",i.meta=this.finishNode(ve,"Identifier"),this.next();var Ae=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(Ae)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 Pe=this.start,Ne=this.startLoc;if(i.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),Pe,Ne,!0,!1),i.callee.type==="Super")this.raiseRecoverable(Pe,"Invalid use of 'super'");if(this.eat(Fe.parenL))i.arguments=this.parseExprList(Fe.parenR,this.options.ecmaVersion>=8,!1);else i.arguments=Tu;return this.finishNode(i,"NewExpression")};lt.parseTemplateElement=function(i){var ve=i.isTagged,Ae=this.startNode();if(this.type===Fe.invalidTemplate){if(!ve)this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal");Ae.value={raw:this.value.replace(/\r\n?/g,`
|
|
4
|
+
`),cooked:null}}else Ae.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
|
|
5
|
+
`),cooked:this.value};return this.next(),Ae.tail=this.type===Fe.backQuote,this.finishNode(Ae,"TemplateElement")};lt.parseTemplate=function(i){if(i===void 0)i={};var ve=i.isTagged;if(ve===void 0)ve=!1;var Ae=this.startNode();this.next(),Ae.expressions=[];var Pe=this.parseTemplateElement({isTagged:ve});Ae.quasis=[Pe];while(!Pe.tail){if(this.type===Fe.eof)this.raise(this.pos,"Unterminated template literal");this.expect(Fe.dollarBraceL),Ae.expressions.push(this.parseExpression()),this.expect(Fe.braceR),Ae.quasis.push(Pe=this.parseTemplateElement({isTagged:ve}))}return this.next(),this.finishNode(Ae,"TemplateLiteral")};lt.isAsyncProp=function(i){return!i.computed&&i.key.type==="Identifier"&&i.key.name==="async"&&(this.type===Fe.name||this.type===Fe.num||this.type===Fe.string||this.type===Fe.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===Fe.star)&&!jt.test(this.input.slice(this.lastTokEnd,this.start))};lt.parseObj=function(i,ve){var Ae=this.startNode(),Pe=!0,Ne={};Ae.properties=[],this.next();while(!this.eat(Fe.braceR)){if(!Pe){if(this.expect(Fe.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(Fe.braceR))break}else Pe=!1;var De=this.parseProperty(i,ve);if(!i)this.checkPropClash(De,Ne,ve);Ae.properties.push(De)}return this.finishNode(Ae,i?"ObjectPattern":"ObjectExpression")};lt.parseProperty=function(i,ve){var Ae=this.startNode(),Pe,Ne,De,_e;if(this.options.ecmaVersion>=9&&this.eat(Fe.ellipsis)){if(i){if(Ae.argument=this.parseIdent(!1),this.type===Fe.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");return this.finishNode(Ae,"RestElement")}if(Ae.argument=this.parseMaybeAssign(!1,ve),this.type===Fe.comma&&ve&&ve.trailingComma<0)ve.trailingComma=this.start;return this.finishNode(Ae,"SpreadElement")}if(this.options.ecmaVersion>=6){if(Ae.method=!1,Ae.shorthand=!1,i||ve)De=this.start,_e=this.startLoc;if(!i)Pe=this.eat(Fe.star)}var Re=this.containsEsc;if(this.parsePropertyName(Ae),!i&&!Re&&this.options.ecmaVersion>=8&&!Pe&&this.isAsyncProp(Ae))Ne=!0,Pe=this.options.ecmaVersion>=9&&this.eat(Fe.star),this.parsePropertyName(Ae);else Ne=!1;return this.parsePropertyValue(Ae,i,Pe,Ne,De,_e,ve,Re),this.finishNode(Ae,"Property")};lt.parseGetterSetter=function(i){var ve=i.key.name;this.parsePropertyName(i),i.value=this.parseMethod(!1),i.kind=ve;var Ae=i.kind==="get"?0:1;if(i.value.params.length!==Ae){var Pe=i.value.start;if(i.kind==="get")this.raiseRecoverable(Pe,"getter should have no params");else this.raiseRecoverable(Pe,"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")};lt.parsePropertyValue=function(i,ve,Ae,Pe,Ne,De,_e,Re){if((Ae||Pe)&&this.type===Fe.colon)this.unexpected();if(this.eat(Fe.colon))i.value=ve?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,_e),i.kind="init";else if(this.options.ecmaVersion>=6&&this.type===Fe.parenL){if(ve)this.unexpected();i.method=!0,i.value=this.parseMethod(Ae,Pe),i.kind="init"}else if(!ve&&!Re&&this.options.ecmaVersion>=5&&!i.computed&&i.key.type==="Identifier"&&(i.key.name==="get"||i.key.name==="set")&&(this.type!==Fe.comma&&this.type!==Fe.braceR&&this.type!==Fe.eq)){if(Ae||Pe)this.unexpected();this.parseGetterSetter(i)}else if(this.options.ecmaVersion>=6&&!i.computed&&i.key.type==="Identifier"){if(Ae||Pe)this.unexpected();if(this.checkUnreserved(i.key),i.key.name==="await"&&!this.awaitIdentPos)this.awaitIdentPos=Ne;if(ve)i.value=this.parseMaybeDefault(Ne,De,this.copyNode(i.key));else if(this.type===Fe.eq&&_e){if(_e.shorthandAssign<0)_e.shorthandAssign=this.start;i.value=this.parseMaybeDefault(Ne,De,this.copyNode(i.key))}else i.value=this.copyNode(i.key);i.kind="init",i.shorthand=!0}else this.unexpected()};lt.parsePropertyName=function(i){if(this.options.ecmaVersion>=6)if(this.eat(Fe.bracketL))return i.computed=!0,i.key=this.parseMaybeAssign(),this.expect(Fe.bracketR),i.key;else i.computed=!1;return i.key=this.type===Fe.num||this.type===Fe.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};lt.initFunction=function(i){if(i.id=null,this.options.ecmaVersion>=6)i.generator=i.expression=!1;if(this.options.ecmaVersion>=8)i.async=!1};lt.parseMethod=function(i,ve,Ae){var Pe=this.startNode(),Ne=this.yieldPos,De=this.awaitPos,_e=this.awaitIdentPos;if(this.initFunction(Pe),this.options.ecmaVersion>=6)Pe.generator=i;if(this.options.ecmaVersion>=8)Pe.async=!!ve;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(ti(ve,Pe.generator)|jr|(Ae?Ua:0)),this.expect(Fe.parenL),Pe.params=this.parseBindingList(Fe.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(Pe,!1,!0,!1),this.yieldPos=Ne,this.awaitPos=De,this.awaitIdentPos=_e,this.finishNode(Pe,"FunctionExpression")};lt.parseArrowExpression=function(i,ve,Ae,Pe){var Ne=this.yieldPos,De=this.awaitPos,_e=this.awaitIdentPos;if(this.enterScope(ti(Ae,!1)|ei),this.initFunction(i),this.options.ecmaVersion>=8)i.async=!!Ae;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,i.params=this.toAssignableList(ve,!0),this.parseFunctionBody(i,!0,!1,Pe),this.yieldPos=Ne,this.awaitPos=De,this.awaitIdentPos=_e,this.finishNode(i,"ArrowFunctionExpression")};lt.parseFunctionBody=function(i,ve,Ae,Pe){var Ne=ve&&this.type!==Fe.braceL,De=this.strict,_e=!1;if(Ne)i.body=this.parseMaybeAssign(Pe),i.expression=!0,this.checkParams(i,!1);else{var Re=this.options.ecmaVersion>=7&&!this.isSimpleParamList(i.params);if(!De||Re){if(_e=this.strictDirective(this.end),_e&&Re)this.raiseRecoverable(i.start,"Illegal 'use strict' directive in function with non-simple parameter list")}var Oe=this.labels;if(this.labels=[],_e)this.strict=!0;if(this.checkParams(i,!De&&!_e&&!ve&&!Ae&&this.isSimpleParamList(i.params)),this.strict&&i.id)this.checkLValSimple(i.id,Xa);i.body=this.parseBlock(!1,void 0,_e&&!De),i.expression=!1,this.adaptDirectivePrologue(i.body.body),this.labels=Oe}this.exitScope()};lt.isSimpleParamList=function(i){for(var ve=0,Ae=i;ve<Ae.length;ve+=1){var Pe=Ae[ve];if(Pe.type!=="Identifier")return!1}return!0};lt.checkParams=function(i,ve){var Ae=Object.create(null);for(var Pe=0,Ne=i.params;Pe<Ne.length;Pe+=1){var De=Ne[Pe];this.checkLValInnerPattern(De,ni,ve?null:Ae)}};lt.parseExprList=function(i,ve,Ae,Pe){var Ne=[],De=!0;while(!this.eat(i)){if(!De){if(this.expect(Fe.comma),ve&&this.afterTrailingComma(i))break}else De=!1;var _e=void 0;if(Ae&&this.type===Fe.comma)_e=null;else if(this.type===Fe.ellipsis){if(_e=this.parseSpread(Pe),Pe&&this.type===Fe.comma&&Pe.trailingComma<0)Pe.trailingComma=this.start}else _e=this.parseMaybeAssign(!1,Pe);Ne.push(_e)}return Ne};lt.checkUnreserved=function(i){var{start:ve,end:Ae,name:Pe}=i;if(this.inGenerator&&Pe==="yield")this.raiseRecoverable(ve,"Cannot use 'yield' as identifier inside a generator");if(this.inAsync&&Pe==="await")this.raiseRecoverable(ve,"Cannot use 'await' as identifier inside an async function");if(!(this.currentThisScope().flags&Vr)&&Pe==="arguments")this.raiseRecoverable(ve,"Cannot use 'arguments' in class field initializer");if(this.inClassStaticBlock&&(Pe==="arguments"||Pe==="await"))this.raise(ve,"Cannot use "+Pe+" in class static initialization block");if(this.keywords.test(Pe))this.raise(ve,"Unexpected keyword '"+Pe+"'");if(this.options.ecmaVersion<6&&this.input.slice(ve,Ae).indexOf("\\")!==-1)return;var Ne=this.strict?this.reservedWordsStrict:this.reservedWords;if(Ne.test(Pe)){if(!this.inAsync&&Pe==="await")this.raiseRecoverable(ve,"Cannot use keyword 'await' outside an async function");this.raiseRecoverable(ve,"The keyword '"+Pe+"' is reserved")}};lt.parseIdent=function(i){var ve=this.parseIdentNode();if(this.next(!!i),this.finishNode(ve,"Identifier"),!i){if(this.checkUnreserved(ve),ve.name==="await"&&!this.awaitIdentPos)this.awaitIdentPos=ve.start}return ve};lt.parseIdentNode=function(){var i=this.startNode();if(this.type===Fe.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=Fe.name}else this.unexpected();return i};lt.parsePrivateIdent=function(){var i=this.startNode();if(this.type===Fe.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};lt.parseYield=function(i){if(!this.yieldPos)this.yieldPos=this.start;var ve=this.startNode();if(this.next(),this.type===Fe.semi||this.canInsertSemicolon()||this.type!==Fe.star&&!this.type.startsExpr)ve.delegate=!1,ve.argument=null;else ve.delegate=this.eat(Fe.star),ve.argument=this.parseMaybeAssign(i);return this.finishNode(ve,"YieldExpression")};lt.parseAwait=function(i){if(!this.awaitPos)this.awaitPos=this.start;var ve=this.startNode();return this.next(),ve.argument=this.parseMaybeUnary(null,!0,!1,i),this.finishNode(ve,"AwaitExpression")};var Br=Tt.prototype;Br.raise=function(i,ve){var Ae=Qs(this.input,i);if(ve+=" ("+Ae.line+":"+Ae.column+")",this.sourceFile)ve+=" in "+this.sourceFile;var Pe=SyntaxError(ve);throw Pe.pos=i,Pe.loc=Ae,Pe.raisedAt=this.pos,Pe};Br.raiseRecoverable=Br.raise;Br.curPosition=function(){if(this.options.locations)return new Gn(this.curLine,this.pos-this.lineStart)};var wn=Tt.prototype,Au=function(ve){this.flags=ve,this.var=[],this.lexical=[],this.functions=[]};wn.enterScope=function(i){this.scopeStack.push(new Au(i))};wn.exitScope=function(){this.scopeStack.pop()};wn.treatFunctionsAsVarInScope=function(i){return i.flags&Bn||!this.inModule&&i.flags&On};wn.declareName=function(i,ve,Ae){var Pe=!1;if(ve===xn){var Ne=this.currentScope();if(Pe=Ne.lexical.indexOf(i)>-1||Ne.functions.indexOf(i)>-1||Ne.var.indexOf(i)>-1,Ne.lexical.push(i),this.inModule&&Ne.flags&On)delete this.undefinedExports[i]}else if(ve===za){var De=this.currentScope();De.lexical.push(i)}else if(ve===Ka){var _e=this.currentScope();if(this.treatFunctionsAsVar)Pe=_e.lexical.indexOf(i)>-1;else Pe=_e.lexical.indexOf(i)>-1||_e.var.indexOf(i)>-1;_e.functions.push(i)}else for(var Re=this.scopeStack.length-1;Re>=0;--Re){var Oe=this.scopeStack[Re];if(Oe.lexical.indexOf(i)>-1&&!(Oe.flags&Ga&&Oe.lexical[0]===i)||!this.treatFunctionsAsVarInScope(Oe)&&Oe.functions.indexOf(i)>-1){Pe=!0;break}if(Oe.var.push(i),this.inModule&&Oe.flags&On)delete this.undefinedExports[i];if(Oe.flags&Vr)break}if(Pe)this.raiseRecoverable(Ae,"Identifier '"+i+"' has already been declared")};wn.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};wn.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};wn.currentVarScope=function(){for(var i=this.scopeStack.length-1;;i--){var ve=this.scopeStack[i];if(ve.flags&(Vr|pr|$n))return ve}};wn.currentThisScope=function(){for(var i=this.scopeStack.length-1;;i--){var ve=this.scopeStack[i];if(ve.flags&(Vr|pr|$n)&&!(ve.flags&ei))return ve}};var ur=function(ve,Ae,Pe){if(this.type="",this.start=Ae,this.end=0,ve.options.locations)this.loc=new lr(ve,Pe);if(ve.options.directSourceFile)this.sourceFile=ve.options.directSourceFile;if(ve.options.ranges)this.range=[Ae,0]},dr=Tt.prototype;dr.startNode=function(){return new ur(this,this.start,this.startLoc)};dr.startNodeAt=function(i,ve){return new ur(this,i,ve)};function Qa(i,ve,Ae,Pe){if(i.type=ve,i.end=Ae,this.options.locations)i.loc.end=Pe;if(this.options.ranges)i.range[1]=Ae;return i}dr.finishNode=function(i,ve){return Qa.call(this,i,ve,this.lastTokEnd,this.lastTokEndLoc)};dr.finishNodeAt=function(i,ve,Ae,Pe){return Qa.call(this,i,ve,Ae,Pe)};dr.copyNode=function(i){var ve=new ur(this,i.start,this.startLoc);for(var Ae in i)ve[Ae]=i[Ae];return ve};var ku="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",Za="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",eo=Za+" Extended_Pictographic",to=eo,no=to+" EBase EComp EMod EPres ExtPict",ro=no,wu=ro,Pu={9:Za,10:eo,11:to,12:no,13:ro,14:wu},Nu="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",_u={9:"",10:"",11:"",12:"",13:"",14:Nu},Ma="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",so="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",io=so+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",ao=io+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",oo=ao+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",co=oo+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",Iu=co+" "+ku,Du={9:so,10:io,11:ao,12:oo,13:co,14:Iu},lo={};function Ru(i){var ve=lo[i]={binary:kn(Pu[i]+" "+Ma),binaryOfStrings:kn(_u[i]),nonBinary:{General_Category:kn(Ma),Script:kn(Du[i])}};ve.nonBinary.Script_Extensions=ve.nonBinary.Script,ve.nonBinary.gc=ve.nonBinary.General_Category,ve.nonBinary.sc=ve.nonBinary.Script,ve.nonBinary.scx=ve.nonBinary.Script_Extensions}for(or=0,Rr=[9,10,11,12,13,14];or<Rr.length;or+=1)Js=Rr[or],Ru(Js);var Js,or,Rr,rt=Tt.prototype,$r=function(ve,Ae){this.parent=ve,this.base=Ae||this};$r.prototype.separatedFrom=function(ve){for(var Ae=this;Ae;Ae=Ae.parent)for(var Pe=ve;Pe;Pe=Pe.parent)if(Ae.base===Pe.base&&Ae!==Pe)return!0;return!1};$r.prototype.sibling=function(){return new $r(this.parent,this.base)};var pn=function(ve){this.parser=ve,this.validFlags="gim"+(ve.options.ecmaVersion>=6?"uy":"")+(ve.options.ecmaVersion>=9?"s":"")+(ve.options.ecmaVersion>=13?"d":"")+(ve.options.ecmaVersion>=15?"v":""),this.unicodeProperties=lo[ve.options.ecmaVersion>=14?14:ve.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};pn.prototype.reset=function(ve,Ae,Pe){var Ne=Pe.indexOf("v")!==-1,De=Pe.indexOf("u")!==-1;if(this.start=ve|0,this.source=Ae+"",this.flags=Pe,Ne&&this.parser.options.ecmaVersion>=15)this.switchU=!0,this.switchV=!0,this.switchN=!0;else this.switchU=De&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=De&&this.parser.options.ecmaVersion>=9};pn.prototype.raise=function(ve){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+ve)};pn.prototype.at=function(ve,Ae){if(Ae===void 0)Ae=!1;var Pe=this.source,Ne=Pe.length;if(ve>=Ne)return-1;var De=Pe.charCodeAt(ve);if(!(Ae||this.switchU)||De<=55295||De>=57344||ve+1>=Ne)return De;var _e=Pe.charCodeAt(ve+1);return _e>=56320&&_e<=57343?(De<<10)+_e-56613888:De};pn.prototype.nextIndex=function(ve,Ae){if(Ae===void 0)Ae=!1;var Pe=this.source,Ne=Pe.length;if(ve>=Ne)return Ne;var De=Pe.charCodeAt(ve),_e;if(!(Ae||this.switchU)||De<=55295||De>=57344||ve+1>=Ne||(_e=Pe.charCodeAt(ve+1))<56320||_e>57343)return ve+1;return ve+2};pn.prototype.current=function(ve){if(ve===void 0)ve=!1;return this.at(this.pos,ve)};pn.prototype.lookahead=function(ve){if(ve===void 0)ve=!1;return this.at(this.nextIndex(this.pos,ve),ve)};pn.prototype.advance=function(ve){if(ve===void 0)ve=!1;this.pos=this.nextIndex(this.pos,ve)};pn.prototype.eat=function(ve,Ae){if(Ae===void 0)Ae=!1;if(this.current(Ae)===ve)return this.advance(Ae),!0;return!1};pn.prototype.eatChars=function(ve,Ae){if(Ae===void 0)Ae=!1;var Pe=this.pos;for(var Ne=0,De=ve;Ne<De.length;Ne+=1){var _e=De[Ne],Re=this.at(Pe,Ae);if(Re===-1||Re!==_e)return!1;Pe=this.nextIndex(Pe,Ae)}return this.pos=Pe,!0};rt.validateRegExpFlags=function(i){var{validFlags:ve,flags:Ae}=i,Pe=!1,Ne=!1;for(var De=0;De<Ae.length;De++){var _e=Ae.charAt(De);if(ve.indexOf(_e)===-1)this.raise(i.start,"Invalid regular expression flag");if(Ae.indexOf(_e,De+1)>-1)this.raise(i.start,"Duplicate regular expression flag");if(_e==="u")Pe=!0;if(_e==="v")Ne=!0}if(this.options.ecmaVersion>=15&&Pe&&Ne)this.raise(i.start,"Invalid regular expression flag")};function Lu(i){for(var ve in i)return!0;return!1}rt.validateRegExpPattern=function(i){if(this.regexp_pattern(i),!i.switchN&&this.options.ecmaVersion>=9&&Lu(i.groupNames))i.switchN=!0,this.regexp_pattern(i)};rt.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 ve=0,Ae=i.backReferenceNames;ve<Ae.length;ve+=1){var Pe=Ae[ve];if(!i.groupNames[Pe])i.raise("Invalid named capture referenced")}};rt.regexp_disjunction=function(i){var ve=this.options.ecmaVersion>=16;if(ve)i.branchID=new $r(i.branchID,null);this.regexp_alternative(i);while(i.eat(124)){if(ve)i.branchID=i.branchID.sibling();this.regexp_alternative(i)}if(ve)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")};rt.regexp_alternative=function(i){while(i.pos<i.source.length&&this.regexp_eatTerm(i));};rt.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};rt.regexp_eatAssertion=function(i){var ve=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=ve}if(i.eat(40)&&i.eat(63)){var Ae=!1;if(this.options.ecmaVersion>=9)Ae=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=!Ae,!0}}return i.pos=ve,!1};rt.regexp_eatQuantifier=function(i,ve){if(ve===void 0)ve=!1;if(this.regexp_eatQuantifierPrefix(i,ve))return i.eat(63),!0;return!1};rt.regexp_eatQuantifierPrefix=function(i,ve){return i.eat(42)||i.eat(43)||i.eat(63)||this.regexp_eatBracedQuantifier(i,ve)};rt.regexp_eatBracedQuantifier=function(i,ve){var Ae=i.pos;if(i.eat(123)){var Pe=0,Ne=-1;if(this.regexp_eatDecimalDigits(i)){if(Pe=i.lastIntValue,i.eat(44)&&this.regexp_eatDecimalDigits(i))Ne=i.lastIntValue;if(i.eat(125)){if(Ne!==-1&&Ne<Pe&&!ve)i.raise("numbers out of order in {} quantifier");return!0}}if(i.switchU&&!ve)i.raise("Incomplete quantifier");i.pos=Ae}return!1};rt.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)};rt.regexp_eatReverseSolidusAtomEscape=function(i){var ve=i.pos;if(i.eat(92)){if(this.regexp_eatAtomEscape(i))return!0;i.pos=ve}return!1};rt.regexp_eatUncapturingGroup=function(i){var ve=i.pos;if(i.eat(40)){if(i.eat(63)){if(this.options.ecmaVersion>=16){var Ae=this.regexp_eatModifiers(i),Pe=i.eat(45);if(Ae||Pe){for(var Ne=0;Ne<Ae.length;Ne++){var De=Ae.charAt(Ne);if(Ae.indexOf(De,Ne+1)>-1)i.raise("Duplicate regular expression modifiers")}if(Pe){var _e=this.regexp_eatModifiers(i);if(!Ae&&!_e&&i.current()===58)i.raise("Invalid regular expression modifiers");for(var Re=0;Re<_e.length;Re++){var Oe=_e.charAt(Re);if(_e.indexOf(Oe,Re+1)>-1||Ae.indexOf(Oe)>-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=ve}return!1};rt.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};rt.regexp_eatModifiers=function(i){var ve="",Ae=0;while((Ae=i.current())!==-1&&Ou(Ae))ve+=gn(Ae),i.advance();return ve};function Ou(i){return i===105||i===109||i===115}rt.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)};rt.regexp_eatInvalidBracedQuantifier=function(i){if(this.regexp_eatBracedQuantifier(i,!0))i.raise("Nothing to repeat");return!1};rt.regexp_eatSyntaxCharacter=function(i){var ve=i.current();if(po(ve))return i.lastIntValue=ve,i.advance(),!0;return!1};function po(i){return i===36||i>=40&&i<=43||i===46||i===63||i>=91&&i<=94||i>=123&&i<=125}rt.regexp_eatPatternCharacters=function(i){var ve=i.pos,Ae=0;while((Ae=i.current())!==-1&&!po(Ae))i.advance();return i.pos!==ve};rt.regexp_eatExtendedPatternCharacter=function(i){var ve=i.current();if(ve!==-1&&ve!==36&&!(ve>=40&&ve<=43)&&ve!==46&&ve!==63&&ve!==91&&ve!==94&&ve!==124)return i.advance(),!0;return!1};rt.regexp_groupSpecifier=function(i){if(i.eat(63)){if(!this.regexp_eatGroupName(i))i.raise("Invalid group");var ve=this.options.ecmaVersion>=16,Ae=i.groupNames[i.lastStringValue];if(Ae)if(ve)for(var Pe=0,Ne=Ae;Pe<Ne.length;Pe+=1){var De=Ne[Pe];if(!De.separatedFrom(i.branchID))i.raise("Duplicate capture group name")}else i.raise("Duplicate capture group name");if(ve)(Ae||(i.groupNames[i.lastStringValue]=[])).push(i.branchID);else i.groupNames[i.lastStringValue]=!0}};rt.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};rt.regexp_eatRegExpIdentifierName=function(i){if(i.lastStringValue="",this.regexp_eatRegExpIdentifierStart(i)){i.lastStringValue+=gn(i.lastIntValue);while(this.regexp_eatRegExpIdentifierPart(i))i.lastStringValue+=gn(i.lastIntValue);return!0}return!1};rt.regexp_eatRegExpIdentifierStart=function(i){var ve=i.pos,Ae=this.options.ecmaVersion>=11,Pe=i.current(Ae);if(i.advance(Ae),Pe===92&&this.regexp_eatRegExpUnicodeEscapeSequence(i,Ae))Pe=i.lastIntValue;if(Mu(Pe))return i.lastIntValue=Pe,!0;return i.pos=ve,!1};function Mu(i){return Ft(i,!0)||i===36||i===95}rt.regexp_eatRegExpIdentifierPart=function(i){var ve=i.pos,Ae=this.options.ecmaVersion>=11,Pe=i.current(Ae);if(i.advance(Ae),Pe===92&&this.regexp_eatRegExpUnicodeEscapeSequence(i,Ae))Pe=i.lastIntValue;if(Bu(Pe))return i.lastIntValue=Pe,!0;return i.pos=ve,!1};function Bu(i){return Kt(i,!0)||i===36||i===95||i===8204||i===8205}rt.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};rt.regexp_eatBackReference=function(i){var ve=i.pos;if(this.regexp_eatDecimalEscape(i)){var Ae=i.lastIntValue;if(i.switchU){if(Ae>i.maxBackReference)i.maxBackReference=Ae;return!0}if(Ae<=i.numCapturingParens)return!0;i.pos=ve}return!1};rt.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};rt.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)};rt.regexp_eatCControlLetter=function(i){var ve=i.pos;if(i.eat(99)){if(this.regexp_eatControlLetter(i))return!0;i.pos=ve}return!1};rt.regexp_eatZero=function(i){if(i.current()===48&&!Wr(i.lookahead()))return i.lastIntValue=0,i.advance(),!0;return!1};rt.regexp_eatControlEscape=function(i){var ve=i.current();if(ve===116)return i.lastIntValue=9,i.advance(),!0;if(ve===110)return i.lastIntValue=10,i.advance(),!0;if(ve===118)return i.lastIntValue=11,i.advance(),!0;if(ve===102)return i.lastIntValue=12,i.advance(),!0;if(ve===114)return i.lastIntValue=13,i.advance(),!0;return!1};rt.regexp_eatControlLetter=function(i){var ve=i.current();if(uo(ve))return i.lastIntValue=ve%32,i.advance(),!0;return!1};function uo(i){return i>=65&&i<=90||i>=97&&i<=122}rt.regexp_eatRegExpUnicodeEscapeSequence=function(i,ve){if(ve===void 0)ve=!1;var Ae=i.pos,Pe=ve||i.switchU;if(i.eat(117)){if(this.regexp_eatFixedHexDigits(i,4)){var Ne=i.lastIntValue;if(Pe&&Ne>=55296&&Ne<=56319){var De=i.pos;if(i.eat(92)&&i.eat(117)&&this.regexp_eatFixedHexDigits(i,4)){var _e=i.lastIntValue;if(_e>=56320&&_e<=57343)return i.lastIntValue=(Ne-55296)*1024+(_e-56320)+65536,!0}i.pos=De,i.lastIntValue=Ne}return!0}if(Pe&&i.eat(123)&&this.regexp_eatHexDigits(i)&&i.eat(125)&&$u(i.lastIntValue))return!0;if(Pe)i.raise("Invalid unicode escape");i.pos=Ae}return!1};function $u(i){return i>=0&&i<=1114111}rt.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 ve=i.current();if(ve!==99&&(!i.switchN||ve!==107))return i.lastIntValue=ve,i.advance(),!0;return!1};rt.regexp_eatDecimalEscape=function(i){i.lastIntValue=0;var ve=i.current();if(ve>=49&&ve<=57){do i.lastIntValue=10*i.lastIntValue+(ve-48),i.advance();while((ve=i.current())>=48&&ve<=57);return!0}return!1};var fo=0,yn=1,nn=2;rt.regexp_eatCharacterClassEscape=function(i){var ve=i.current();if(Fu(ve))return i.lastIntValue=-1,i.advance(),yn;var Ae=!1;if(i.switchU&&this.options.ecmaVersion>=9&&((Ae=ve===80)||ve===112)){i.lastIntValue=-1,i.advance();var Pe;if(i.eat(123)&&(Pe=this.regexp_eatUnicodePropertyValueExpression(i))&&i.eat(125)){if(Ae&&Pe===nn)i.raise("Invalid property name");return Pe}i.raise("Invalid property name")}return fo};function Fu(i){return i===100||i===68||i===115||i===83||i===119||i===87}rt.regexp_eatUnicodePropertyValueExpression=function(i){var ve=i.pos;if(this.regexp_eatUnicodePropertyName(i)&&i.eat(61)){var Ae=i.lastStringValue;if(this.regexp_eatUnicodePropertyValue(i)){var Pe=i.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(i,Ae,Pe),yn}}if(i.pos=ve,this.regexp_eatLoneUnicodePropertyNameOrValue(i)){var Ne=i.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(i,Ne)}return fo};rt.regexp_validateUnicodePropertyNameAndValue=function(i,ve,Ae){if(!Un(i.unicodeProperties.nonBinary,ve))i.raise("Invalid property name");if(!i.unicodeProperties.nonBinary[ve].test(Ae))i.raise("Invalid property value")};rt.regexp_validateUnicodePropertyNameOrValue=function(i,ve){if(i.unicodeProperties.binary.test(ve))return yn;if(i.switchV&&i.unicodeProperties.binaryOfStrings.test(ve))return nn;i.raise("Invalid property name")};rt.regexp_eatUnicodePropertyName=function(i){var ve=0;i.lastStringValue="";while(ho(ve=i.current()))i.lastStringValue+=gn(ve),i.advance();return i.lastStringValue!==""};function ho(i){return uo(i)||i===95}rt.regexp_eatUnicodePropertyValue=function(i){var ve=0;i.lastStringValue="";while(ju(ve=i.current()))i.lastStringValue+=gn(ve),i.advance();return i.lastStringValue!==""};function ju(i){return ho(i)||Wr(i)}rt.regexp_eatLoneUnicodePropertyNameOrValue=function(i){return this.regexp_eatUnicodePropertyValue(i)};rt.regexp_eatCharacterClass=function(i){if(i.eat(91)){var ve=i.eat(94),Ae=this.regexp_classContents(i);if(!i.eat(93))i.raise("Unterminated character class");if(ve&&Ae===nn)i.raise("Negated character class may contain strings");return!0}return!1};rt.regexp_classContents=function(i){if(i.current()===93)return yn;if(i.switchV)return this.regexp_classSetExpression(i);return this.regexp_nonEmptyClassRanges(i),yn};rt.regexp_nonEmptyClassRanges=function(i){while(this.regexp_eatClassAtom(i)){var ve=i.lastIntValue;if(i.eat(45)&&this.regexp_eatClassAtom(i)){var Ae=i.lastIntValue;if(i.switchU&&(ve===-1||Ae===-1))i.raise("Invalid character class");if(ve!==-1&&Ae!==-1&&ve>Ae)i.raise("Range out of order in character class")}}};rt.regexp_eatClassAtom=function(i){var ve=i.pos;if(i.eat(92)){if(this.regexp_eatClassEscape(i))return!0;if(i.switchU){var Ae=i.current();if(Ae===99||yo(Ae))i.raise("Invalid class escape");i.raise("Invalid escape")}i.pos=ve}var Pe=i.current();if(Pe!==93)return i.lastIntValue=Pe,i.advance(),!0;return!1};rt.regexp_eatClassEscape=function(i){var ve=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=ve}return this.regexp_eatCharacterClassEscape(i)||this.regexp_eatCharacterEscape(i)};rt.regexp_classSetExpression=function(i){var ve=yn,Ae;if(this.regexp_eatClassSetRange(i));else if(Ae=this.regexp_eatClassSetOperand(i)){if(Ae===nn)ve=nn;var Pe=i.pos;while(i.eatChars([38,38])){if(i.current()!==38&&(Ae=this.regexp_eatClassSetOperand(i))){if(Ae!==nn)ve=yn;continue}i.raise("Invalid character in character class")}if(Pe!==i.pos)return ve;while(i.eatChars([45,45])){if(this.regexp_eatClassSetOperand(i))continue;i.raise("Invalid character in character class")}if(Pe!==i.pos)return ve}else i.raise("Invalid character in character class");for(;;){if(this.regexp_eatClassSetRange(i))continue;if(Ae=this.regexp_eatClassSetOperand(i),!Ae)return ve;if(Ae===nn)ve=nn}};rt.regexp_eatClassSetRange=function(i){var ve=i.pos;if(this.regexp_eatClassSetCharacter(i)){var Ae=i.lastIntValue;if(i.eat(45)&&this.regexp_eatClassSetCharacter(i)){var Pe=i.lastIntValue;if(Ae!==-1&&Pe!==-1&&Ae>Pe)i.raise("Range out of order in character class");return!0}i.pos=ve}return!1};rt.regexp_eatClassSetOperand=function(i){if(this.regexp_eatClassSetCharacter(i))return yn;return this.regexp_eatClassStringDisjunction(i)||this.regexp_eatNestedClass(i)};rt.regexp_eatNestedClass=function(i){var ve=i.pos;if(i.eat(91)){var Ae=i.eat(94),Pe=this.regexp_classContents(i);if(i.eat(93)){if(Ae&&Pe===nn)i.raise("Negated character class may contain strings");return Pe}i.pos=ve}if(i.eat(92)){var Ne=this.regexp_eatCharacterClassEscape(i);if(Ne)return Ne;i.pos=ve}return null};rt.regexp_eatClassStringDisjunction=function(i){var ve=i.pos;if(i.eatChars([92,113])){if(i.eat(123)){var Ae=this.regexp_classStringDisjunctionContents(i);if(i.eat(125))return Ae}else i.raise("Invalid escape");i.pos=ve}return null};rt.regexp_classStringDisjunctionContents=function(i){var ve=this.regexp_classString(i);while(i.eat(124))if(this.regexp_classString(i)===nn)ve=nn;return ve};rt.regexp_classString=function(i){var ve=0;while(this.regexp_eatClassSetCharacter(i))ve++;return ve===1?yn:nn};rt.regexp_eatClassSetCharacter=function(i){var ve=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=ve,!1}var Ae=i.current();if(Ae<0||Ae===i.lookahead()&&Vu(Ae))return!1;if(qu(Ae))return!1;return i.advance(),i.lastIntValue=Ae,!0};function Vu(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 qu(i){return i===40||i===41||i===45||i===47||i>=91&&i<=93||i>=123&&i<=125}rt.regexp_eatClassSetReservedPunctuator=function(i){var ve=i.current();if(Wu(ve))return i.lastIntValue=ve,i.advance(),!0;return!1};function Wu(i){return i===33||i===35||i===37||i===38||i===44||i===45||i>=58&&i<=62||i===64||i===96||i===126}rt.regexp_eatClassControlLetter=function(i){var ve=i.current();if(Wr(ve)||ve===95)return i.lastIntValue=ve%32,i.advance(),!0;return!1};rt.regexp_eatHexEscapeSequence=function(i){var ve=i.pos;if(i.eat(120)){if(this.regexp_eatFixedHexDigits(i,2))return!0;if(i.switchU)i.raise("Invalid escape");i.pos=ve}return!1};rt.regexp_eatDecimalDigits=function(i){var ve=i.pos,Ae=0;i.lastIntValue=0;while(Wr(Ae=i.current()))i.lastIntValue=10*i.lastIntValue+(Ae-48),i.advance();return i.pos!==ve};function Wr(i){return i>=48&&i<=57}rt.regexp_eatHexDigits=function(i){var ve=i.pos,Ae=0;i.lastIntValue=0;while(mo(Ae=i.current()))i.lastIntValue=16*i.lastIntValue+go(Ae),i.advance();return i.pos!==ve};function mo(i){return i>=48&&i<=57||i>=65&&i<=70||i>=97&&i<=102}function go(i){if(i>=65&&i<=70)return 10+(i-65);if(i>=97&&i<=102)return 10+(i-97);return i-48}rt.regexp_eatLegacyOctalEscapeSequence=function(i){if(this.regexp_eatOctalDigit(i)){var ve=i.lastIntValue;if(this.regexp_eatOctalDigit(i)){var Ae=i.lastIntValue;if(ve<=3&&this.regexp_eatOctalDigit(i))i.lastIntValue=ve*64+Ae*8+i.lastIntValue;else i.lastIntValue=ve*8+Ae}else i.lastIntValue=ve;return!0}return!1};rt.regexp_eatOctalDigit=function(i){var ve=i.current();if(yo(ve))return i.lastIntValue=ve-48,i.advance(),!0;return i.lastIntValue=0,!1};function yo(i){return i>=48&&i<=55}rt.regexp_eatFixedHexDigits=function(i,ve){var Ae=i.pos;i.lastIntValue=0;for(var Pe=0;Pe<ve;++Pe){var Ne=i.current();if(!mo(Ne))return i.pos=Ae,!1;i.lastIntValue=16*i.lastIntValue+go(Ne),i.advance()}return!0};var Gr=function(ve){if(this.type=ve.type,this.value=ve.value,this.start=ve.start,this.end=ve.end,ve.options.locations)this.loc=new lr(ve,ve.startLoc,ve.endLoc);if(ve.options.ranges)this.range=[ve.start,ve.end]},dt=Tt.prototype;dt.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 Gr(this));this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()};dt.getToken=function(){return this.next(),new Gr(this)};if(typeof Symbol<"u")dt[Symbol.iterator]=function(){var i=this;return{next:function(){var ve=i.getToken();return{done:ve.type===Fe.eof,value:ve}}}};dt.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(Fe.eof);if(i.override)return i.override(this);else this.readToken(this.fullCharCodeAtPos())};dt.readToken=function(i){if(Ft(i,this.options.ecmaVersion>=6)||i===92)return this.readWord();return this.getTokenFromCode(i)};dt.fullCharCodeAt=function(i){var ve=this.input.charCodeAt(i);if(ve<=55295||ve>=56320)return ve;var Ae=this.input.charCodeAt(i+1);return Ae<=56319||Ae>=57344?ve:(ve<<10)+Ae-56613888};dt.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)};dt.skipBlockComment=function(){var i=this.options.onComment&&this.curPosition(),ve=this.pos,Ae=this.input.indexOf("*/",this.pos+=2);if(Ae===-1)this.raise(this.pos-2,"Unterminated comment");if(this.pos=Ae+2,this.options.locations)for(var Pe=void 0,Ne=ve;(Pe=Va(this.input,Ne,this.pos))>-1;)++this.curLine,Ne=this.lineStart=Pe;if(this.options.onComment)this.options.onComment(!0,this.input.slice(ve+2,Ae),ve,this.pos,i,this.curPosition())};dt.skipLineComment=function(i){var ve=this.pos,Ae=this.options.onComment&&this.curPosition(),Pe=this.input.charCodeAt(this.pos+=i);while(this.pos<this.input.length&&!Mn(Pe))Pe=this.input.charCodeAt(++this.pos);if(this.options.onComment)this.options.onComment(!1,this.input.slice(ve+i,this.pos),ve,this.pos,Ae,this.curPosition())};dt.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&&Ys.test(String.fromCharCode(i)))++this.pos;else break e}}};dt.finishToken=function(i,ve){if(this.end=this.pos,this.options.locations)this.endLoc=this.curPosition();var Ae=this.type;this.type=i,this.value=ve,this.updateContext(Ae)};dt.readToken_dot=function(){var i=this.input.charCodeAt(this.pos+1);if(i>=48&&i<=57)return this.readNumber(!0);var ve=this.input.charCodeAt(this.pos+2);if(this.options.ecmaVersion>=6&&i===46&&ve===46)return this.pos+=3,this.finishToken(Fe.ellipsis);else return++this.pos,this.finishToken(Fe.dot)};dt.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(Fe.assign,2);return this.finishOp(Fe.slash,1)};dt.readToken_mult_modulo_exp=function(i){var ve=this.input.charCodeAt(this.pos+1),Ae=1,Pe=i===42?Fe.star:Fe.modulo;if(this.options.ecmaVersion>=7&&i===42&&ve===42)++Ae,Pe=Fe.starstar,ve=this.input.charCodeAt(this.pos+2);if(ve===61)return this.finishOp(Fe.assign,Ae+1);return this.finishOp(Pe,Ae)};dt.readToken_pipe_amp=function(i){var ve=this.input.charCodeAt(this.pos+1);if(ve===i){if(this.options.ecmaVersion>=12){var Ae=this.input.charCodeAt(this.pos+2);if(Ae===61)return this.finishOp(Fe.assign,3)}return this.finishOp(i===124?Fe.logicalOR:Fe.logicalAND,2)}if(ve===61)return this.finishOp(Fe.assign,2);return this.finishOp(i===124?Fe.bitwiseOR:Fe.bitwiseAND,1)};dt.readToken_caret=function(){var i=this.input.charCodeAt(this.pos+1);if(i===61)return this.finishOp(Fe.assign,2);return this.finishOp(Fe.bitwiseXOR,1)};dt.readToken_plus_min=function(i){var ve=this.input.charCodeAt(this.pos+1);if(ve===i){if(ve===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||jt.test(this.input.slice(this.lastTokEnd,this.pos))))return this.skipLineComment(3),this.skipSpace(),this.nextToken();return this.finishOp(Fe.incDec,2)}if(ve===61)return this.finishOp(Fe.assign,2);return this.finishOp(Fe.plusMin,1)};dt.readToken_lt_gt=function(i){var ve=this.input.charCodeAt(this.pos+1),Ae=1;if(ve===i){if(Ae=i===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+Ae)===61)return this.finishOp(Fe.assign,Ae+1);return this.finishOp(Fe.bitShift,Ae)}if(ve===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(ve===61)Ae=2;return this.finishOp(Fe.relational,Ae)};dt.readToken_eq_excl=function(i){var ve=this.input.charCodeAt(this.pos+1);if(ve===61)return this.finishOp(Fe.equality,this.input.charCodeAt(this.pos+2)===61?3:2);if(i===61&&ve===62&&this.options.ecmaVersion>=6)return this.pos+=2,this.finishToken(Fe.arrow);return this.finishOp(i===61?Fe.eq:Fe.prefix,1)};dt.readToken_question=function(){var i=this.options.ecmaVersion;if(i>=11){var ve=this.input.charCodeAt(this.pos+1);if(ve===46){var Ae=this.input.charCodeAt(this.pos+2);if(Ae<48||Ae>57)return this.finishOp(Fe.questionDot,2)}if(ve===63){if(i>=12){var Pe=this.input.charCodeAt(this.pos+2);if(Pe===61)return this.finishOp(Fe.assign,3)}return this.finishOp(Fe.coalesce,2)}}return this.finishOp(Fe.question,1)};dt.readToken_numberSign=function(){var i=this.options.ecmaVersion,ve=35;if(i>=13){if(++this.pos,ve=this.fullCharCodeAtPos(),Ft(ve,!0)||ve===92)return this.finishToken(Fe.privateId,this.readWord1())}this.raise(this.pos,"Unexpected character '"+gn(ve)+"'")};dt.getTokenFromCode=function(i){switch(i){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(Fe.parenL);case 41:return++this.pos,this.finishToken(Fe.parenR);case 59:return++this.pos,this.finishToken(Fe.semi);case 44:return++this.pos,this.finishToken(Fe.comma);case 91:return++this.pos,this.finishToken(Fe.bracketL);case 93:return++this.pos,this.finishToken(Fe.bracketR);case 123:return++this.pos,this.finishToken(Fe.braceL);case 125:return++this.pos,this.finishToken(Fe.braceR);case 58:return++this.pos,this.finishToken(Fe.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(Fe.backQuote);case 48:var ve=this.input.charCodeAt(this.pos+1);if(ve===120||ve===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(ve===111||ve===79)return this.readRadixNumber(8);if(ve===98||ve===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(Fe.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+gn(i)+"'")};dt.finishOp=function(i,ve){var Ae=this.input.slice(this.pos,this.pos+ve);return this.pos+=ve,this.finishToken(i,Ae)};dt.readRegexp=function(){var i,ve,Ae=this.pos;for(;;){if(this.pos>=this.input.length)this.raise(Ae,"Unterminated regular expression");var Pe=this.input.charAt(this.pos);if(jt.test(Pe))this.raise(Ae,"Unterminated regular expression");if(!i){if(Pe==="[")ve=!0;else if(Pe==="]"&&ve)ve=!1;else if(Pe==="/"&&!ve)break;i=Pe==="\\"}else i=!1;++this.pos}var Ne=this.input.slice(Ae,this.pos);++this.pos;var De=this.pos,_e=this.readWord1();if(this.containsEsc)this.unexpected(De);var Re=this.regexpState||(this.regexpState=new pn(this));Re.reset(Ae,Ne,_e),this.validateRegExpFlags(Re),this.validateRegExpPattern(Re);var Oe=null;try{Oe=new RegExp(Ne,_e)}catch(Be){}return this.finishToken(Fe.regexp,{pattern:Ne,flags:_e,value:Oe})};dt.readInt=function(i,ve,Ae){var Pe=this.options.ecmaVersion>=12&&ve===void 0,Ne=Ae&&this.input.charCodeAt(this.pos)===48,De=this.pos,_e=0,Re=0;for(var Oe=0,Be=ve==null?1/0:ve;Oe<Be;++Oe,++this.pos){var Me=this.input.charCodeAt(this.pos),je=void 0;if(Pe&&Me===95){if(Ne)this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals");if(Re===95)this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore");if(Oe===0)this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits");Re=Me;continue}if(Me>=97)je=Me-97+10;else if(Me>=65)je=Me-65+10;else if(Me>=48&&Me<=57)je=Me-48;else je=1/0;if(je>=i)break;Re=Me,_e=_e*i+je}if(Pe&&Re===95)this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits");if(this.pos===De||ve!=null&&this.pos-De!==ve)return null;return _e};function Gu(i,ve){if(ve)return parseInt(i,8);return parseFloat(i.replace(/_/g,""))}function xo(i){if(typeof BigInt!=="function")return null;return BigInt(i.replace(/_/g,""))}dt.readRadixNumber=function(i){var ve=this.pos;this.pos+=2;var Ae=this.readInt(i);if(Ae==null)this.raise(this.start+2,"Expected number in radix "+i);if(this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110)Ae=xo(this.input.slice(ve,this.pos)),++this.pos;else if(Ft(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");return this.finishToken(Fe.num,Ae)};dt.readNumber=function(i){var ve=this.pos;if(!i&&this.readInt(10,void 0,!0)===null)this.raise(ve,"Invalid number");var Ae=this.pos-ve>=2&&this.input.charCodeAt(ve)===48;if(Ae&&this.strict)this.raise(ve,"Invalid number");var Pe=this.input.charCodeAt(this.pos);if(!Ae&&!i&&this.options.ecmaVersion>=11&&Pe===110){var Ne=xo(this.input.slice(ve,this.pos));if(++this.pos,Ft(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");return this.finishToken(Fe.num,Ne)}if(Ae&&/[89]/.test(this.input.slice(ve,this.pos)))Ae=!1;if(Pe===46&&!Ae)++this.pos,this.readInt(10),Pe=this.input.charCodeAt(this.pos);if((Pe===69||Pe===101)&&!Ae){if(Pe=this.input.charCodeAt(++this.pos),Pe===43||Pe===45)++this.pos;if(this.readInt(10)===null)this.raise(ve,"Invalid number")}if(Ft(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");var De=Gu(this.input.slice(ve,this.pos),Ae);return this.finishToken(Fe.num,De)};dt.readCodePoint=function(){var i=this.input.charCodeAt(this.pos),ve;if(i===123){if(this.options.ecmaVersion<6)this.unexpected();var Ae=++this.pos;if(ve=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,ve>1114111)this.invalidStringToken(Ae,"Code point out of bounds")}else ve=this.readHexChar(4);return ve};dt.readString=function(i){var ve="",Ae=++this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated string constant");var Pe=this.input.charCodeAt(this.pos);if(Pe===i)break;if(Pe===92)ve+=this.input.slice(Ae,this.pos),ve+=this.readEscapedChar(!1),Ae=this.pos;else if(Pe===8232||Pe===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(Mn(Pe))this.raise(this.start,"Unterminated string constant");++this.pos}}return ve+=this.input.slice(Ae,this.pos++),this.finishToken(Fe.string,ve)};var bo={};dt.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(i){if(i===bo)this.readInvalidTemplateToken();else throw i}this.inTemplateElement=!1};dt.invalidStringToken=function(i,ve){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw bo;else this.raise(i,ve)};dt.readTmplToken=function(){var i="",ve=this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated template");var Ae=this.input.charCodeAt(this.pos);if(Ae===96||Ae===36&&this.input.charCodeAt(this.pos+1)===123){if(this.pos===this.start&&(this.type===Fe.template||this.type===Fe.invalidTemplate))if(Ae===36)return this.pos+=2,this.finishToken(Fe.dollarBraceL);else return++this.pos,this.finishToken(Fe.backQuote);return i+=this.input.slice(ve,this.pos),this.finishToken(Fe.template,i)}if(Ae===92)i+=this.input.slice(ve,this.pos),i+=this.readEscapedChar(!0),ve=this.pos;else if(Mn(Ae)){switch(i+=this.input.slice(ve,this.pos),++this.pos,Ae){case 13:if(this.input.charCodeAt(this.pos)===10)++this.pos;case 10:i+=`
|
|
6
|
+
`;break;default:i+=String.fromCharCode(Ae);break}if(this.options.locations)++this.curLine,this.lineStart=this.pos;ve=this.pos}else++this.pos}};dt.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(Fe.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")};dt.readEscapedChar=function(i){var ve=this.input.charCodeAt(++this.pos);switch(++this.pos,ve){case 110:return`
|
|
9
|
+
`;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return gn(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 Ae=this.pos-1;this.invalidStringToken(Ae,"Invalid escape sequence in template string")}default:if(ve>=48&&ve<=55){var Pe=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],Ne=parseInt(Pe,8);if(Ne>255)Pe=Pe.slice(0,-1),Ne=parseInt(Pe,8);if(this.pos+=Pe.length-1,ve=this.input.charCodeAt(this.pos),(Pe!=="0"||ve===56||ve===57)&&(this.strict||i))this.invalidStringToken(this.pos-1-Pe.length,i?"Octal literal in template string":"Octal literal in strict mode");return String.fromCharCode(Ne)}if(Mn(ve)){if(this.options.locations)this.lineStart=this.pos,++this.curLine;return""}return String.fromCharCode(ve)}};dt.readHexChar=function(i){var ve=this.pos,Ae=this.readInt(16,i);if(Ae===null)this.invalidStringToken(ve,"Bad character escape sequence");return Ae};dt.readWord1=function(){this.containsEsc=!1;var i="",ve=!0,Ae=this.pos,Pe=this.options.ecmaVersion>=6;while(this.pos<this.input.length){var Ne=this.fullCharCodeAtPos();if(Kt(Ne,Pe))this.pos+=Ne<=65535?1:2;else if(Ne===92){this.containsEsc=!0,i+=this.input.slice(Ae,this.pos);var De=this.pos;if(this.input.charCodeAt(++this.pos)!==117)this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX");++this.pos;var _e=this.readCodePoint();if(!(ve?Ft:Kt)(_e,Pe))this.invalidStringToken(De,"Invalid Unicode escape");i+=gn(_e),Ae=this.pos}else break;ve=!1}return i+this.input.slice(Ae,this.pos)};dt.readWord=function(){var i=this.readWord1(),ve=Fe.name;if(this.keywords.test(i))ve=Fr[i];return this.finishToken(ve,i)};var Eo="8.18.0";Tt.acorn={Parser:Tt,version:Eo,defaultOptions:Lr,Position:Gn,SourceLocation:lr,getLineInfo:Qs,Node:ur,TokenType:gt,tokTypes:Fe,keywordTypes:Fr,TokContext:tn,tokContexts:St,isIdentifierChar:Kt,isIdentifierStart:Ft,Token:Gr,isNewLine:Mn,lineBreak:jt,lineBreakG:ja,nonASCIIwhitespace:Ys};function si(i,ve){return Tt.parse(i,ve)}function Uu(i,ve,Ae){return Tt.parseExpressionAt(i,ve,Ae)}function Hu(i,ve){return Tt.tokenizer(i,ve)}var Yt=!0,Ku=new WeakMap;function zu(i){let ve=i.Parser.acorn||i,Ae=Ku.get(ve);if(!Ae){let Re=function(et){return et===Ge.name||et===Ge.string||et===Ge.num||Xe.includes(et)||tt.includes(et)},Oe=function(et){return et===Ge.name||Xe.includes(et)||tt.includes(et)},Be=function(et){return et===Ge.name||tt.includes(et)},Me=function(et){return et===ze.abstract||et===ze.declare||et===ze.enum||et===ze.module||et===ze.namespace||et===ze.interface||et===ze.type},je=function(et){return et===ze.keyof||et===ze.readonly||et===ze.unique},qe=function(et){return et===Ge.invalidTemplate},{tokTypes:Ge,keywordTypes:He}=ve,Xe=Object.values(He),ze=_e(),tt=Object.values(ze),at=De(),Ze=Ne(),nt=new RegExp(`^(?:${Object.keys(ze).join("|")})$`);at.jsxTagStart.updateContext=function(){this.context.push(Ze.tc_expr),this.context.push(Ze.tc_oTag),this.exprAllowed=!1},at.jsxTagEnd.updateContext=function(et){let yt=this.context.pop();if(yt===Ze.tc_oTag&&et===Ge.slash||yt===Ze.tc_cTag)this.context.pop(),this.exprAllowed=this.curContext()===Ze.tc_expr;else this.exprAllowed=!0},Ae={tokTypes:{...ze,...at},tokContexts:{...Ze},keywordsRegExp:nt,tokenIsLiteralPropertyName:Re,tokenIsKeywordOrIdentifier:Oe,tokenIsIdentifier:Be,tokenIsTSDeclarationStart:Me,tokenIsTSTypeOperator:je,tokenIsTemplate:qe}}return Ae;function Pe(Re,Oe={}){return new ve.TokenType("name",Oe)}function Ne(){return{tc_oTag:new ve.TokContext("<tag",!1,!1),tc_cTag:new ve.TokContext("</tag",!1,!1),tc_expr:new ve.TokContext("<tag>...</tag>",!0,!0)}}function De(){return{at:new ve.TokenType("@"),jsxName:new ve.TokenType("jsxName"),jsxText:new ve.TokenType("jsxText",{beforeExpr:!0}),jsxTagStart:new ve.TokenType("jsxTagStart",{startsExpr:!0}),jsxTagEnd:new ve.TokenType("jsxTagEnd")}}function _e(){return{assert:Pe("assert",{startsExpr:Yt}),asserts:Pe("asserts",{startsExpr:Yt}),global:Pe("global",{startsExpr:Yt}),keyof:Pe("keyof",{startsExpr:Yt}),readonly:Pe("readonly",{startsExpr:Yt}),unique:Pe("unique",{startsExpr:Yt}),abstract:Pe("abstract",{startsExpr:Yt}),declare:Pe("declare",{startsExpr:Yt}),enum:Pe("enum",{startsExpr:Yt}),module:Pe("module",{startsExpr:Yt}),namespace:Pe("namespace",{startsExpr:Yt}),interface:Pe("interface",{startsExpr:Yt}),type:Pe("type",{startsExpr:Yt})}}}var Xu=1048576,fr=2097152,zn=1,Kr=2,Ju=4,li=8,Yu=16,Po=64,No=128,Qu=256,Zu=512,_o=1024,Jx=zn|Kr|li|No,Yx=zn|0|li|0,Qx=zn|0|Ju|0,Zx=zn|0|Yu|0,e0=0|Kr|0|No,t0=0|Kr|0|0,ed=zn|Kr|li|Qu,n0=0|_o,r0=0|Po,s0=zn|0|0|Po,i0=ed|Zu,a0=0|_o,Io=4,Do=2,Ro=1,o0=Do|Ro,c0=Do|Io,l0=Ro|Io,td=/(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/y,Co=new RegExp("(?=("+td.source+"))\\1"+/(?=[\n\r\u2028\u2029]|\/\*(?!.*?\*\/)|$)/.source,"y"),hr=class{constructor(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1}};function nd(i,ve){let Ae="true";if(ve.type==="MethodDefinition"&&(ve.kind==="get"||ve.kind==="set"))Ae=(ve.static?"s":"i")+ve.kind;if(i==="iget"&&Ae==="iset"||i==="iset"&&Ae==="iget"||i==="sget"&&Ae==="sset"||i==="sset"&&Ae==="sget")return[!1,"true"];if(!i)return[!1,Ae];return[!0,i]}function vo(i,ve){let{computed:Ae,key:Pe}=i;return!Ae&&(Pe.type==="Identifier"&&Pe.name===ve||Pe.type==="Literal"&&Pe.value===ve)}var st={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."},Hr={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 rd(i,ve,Ae){let{tokTypes:Pe}=Ae,{tokTypes:Ne}=ve;return class extends i{takeDecorators(_e){let Re=this.decoratorStack[this.decoratorStack.length-1];if(Re.length)_e.decorators=Re,this.resetStartLocationFromNode(_e,Re[0]),this.decoratorStack[this.decoratorStack.length-1]=[]}parseDecorators(_e){let Re=this.decoratorStack[this.decoratorStack.length-1];while(this.match(Ne.at)){let Oe=this.parseDecorator();Re.push(Oe)}if(this.match(Pe._export)){if(!_e)this.unexpected()}else if(!this.canHaveLeadingDecorator())this.raise(this.start,Hr.UnexpectedLeadingDecorator)}parseDecorator(){let _e=this.startNode();this.next(),this.decoratorStack.push([]);let Re=this.start,Oe=this.startLoc,Be;if(this.match(Pe.parenL)){let Me=this.start,je=this.startLoc;if(this.next(),Be=this.parseExpression(),this.expect(Pe.parenR),this.options.preserveParens){let qe=this.startNodeAt(Me,je);qe.expression=Be,Be=this.finishNode(qe,"ParenthesizedExpression")}}else{Be=this.parseIdent(!1);while(this.eat(Pe.dot)){let Me=this.startNodeAt(Re,Oe);Me.object=Be,Me.property=this.parseIdent(!0),Me.computed=!1,Be=this.finishNode(Me,"MemberExpression")}}return _e.expression=this.parseMaybeDecoratorArguments(Be),this.decoratorStack.pop(),this.finishNode(_e,"Decorator")}parseMaybeDecoratorArguments(_e){if(this.eat(Pe.parenL)){let Re=this.startNodeAtNode(_e);return Re.callee=_e,Re.arguments=this.parseExprList(Pe.parenR,!1),this.finishNode(Re,"CallExpression")}return _e}}}var So={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:"♦"},sd=/^[\da-fA-F]+$/,id=/^\d+$/;function mr(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 mr(i.object)+"."+mr(i.property)}function ad(i,ve,Ae,Pe){let Ne=i.tokTypes,De=ve.tokTypes,{isNewLine:_e,isIdentifierChar:Re}=i,Oe=Object.assign({allowNamespaces:!0,allowNamespacedObjects:!0},Pe||{});return class extends Ae{jsx_readToken(){let Me="",je=this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated JSX contents");let qe=this.input.charCodeAt(this.pos);switch(qe){case 60:case 123:if(this.pos===this.start){if(qe===60&&this.exprAllowed)return++this.pos,this.finishToken(De.jsxTagStart);return this.getTokenFromCode(qe)}return Me+=this.input.slice(je,this.pos),this.finishToken(De.jsxText,Me);case 38:Me+=this.input.slice(je,this.pos),Me+=this.jsx_readEntity(),je=this.pos;break;case 62:case 125:this.raise(this.pos,"Unexpected token `"+this.input[this.pos]+"`. Did you mean `"+(qe===62?">":"}")+'` or `{"'+this.input[this.pos]+'"}`?');default:if(_e(qe))Me+=this.input.slice(je,this.pos),Me+=this.jsx_readNewLine(!0),je=this.pos;else++this.pos}}}jsx_readNewLine(Me){let je=this.input.charCodeAt(this.pos),qe;if(++this.pos,je===13&&this.input.charCodeAt(this.pos)===10)++this.pos,qe=Me?`
|
|
10
|
+
`:`\r
|
|
11
|
+
`;else qe=String.fromCharCode(je);if(this.options.locations)++this.curLine,this.lineStart=this.pos;return qe}jsx_readString(Me){let je="",qe=++this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated string constant");let Ge=this.input.charCodeAt(this.pos);if(Ge===Me)break;if(Ge===38)je+=this.input.slice(qe,this.pos),je+=this.jsx_readEntity(),qe=this.pos;else if(_e(Ge))je+=this.input.slice(qe,this.pos),je+=this.jsx_readNewLine(!1),qe=this.pos;else++this.pos}return je+=this.input.slice(qe,this.pos++),this.finishToken(Ne.string,je)}jsx_readEntity(){let Me="",je=0,qe,Ge=this.input[this.pos];if(Ge!=="&")this.raise(this.pos,"Entity must start with an ampersand");let He=++this.pos;while(this.pos<this.input.length&&je++<10){if(Ge=this.input[this.pos++],Ge===";"){if(Me[0]==="#"){let Xe;if(Me[1]==="x"||Me[1]==="X"){if(Me=Me.substr(2),sd.test(Me))Xe=parseInt(Me,16)}else if(Me=Me.substr(1),id.test(Me))Xe=parseInt(Me,10);if(Xe!==void 0&&Xe<=1114111)qe=String.fromCodePoint(Xe)}else if(Object.prototype.hasOwnProperty.call(So,Me))qe=So[Me];break}Me+=Ge}if(qe===void 0)return this.pos=He,"&";return qe}jsx_readWord(){let Me,je=this.pos;do Me=this.input.charCodeAt(++this.pos);while(Re(Me)||Me===45);return this.finishToken(De.jsxName,this.input.slice(je,this.pos))}jsx_parseIdentifier(){let Me=this.startNode();if(this.type===De.jsxName)Me.name=this.value;else if(this.type.keyword)Me.name=this.type.keyword;else this.unexpected();return this.next(),this.finishNode(Me,"JSXIdentifier")}jsx_parseNamespacedName(){let Me=this.start,je=this.startLoc,qe=this.jsx_parseIdentifier();if(!Oe.allowNamespaces||!this.eat(Ne.colon))return qe;var Ge=this.startNodeAt(Me,je);return Ge.namespace=qe,Ge.name=this.jsx_parseIdentifier(),this.finishNode(Ge,"JSXNamespacedName")}jsx_parseElementName(){if(this.type===De.jsxTagEnd)return"";let Me=this.start,je=this.startLoc,qe=this.jsx_parseNamespacedName();if(this.type===Ne.dot&&qe.type==="JSXNamespacedName"&&!Oe.allowNamespacedObjects)this.unexpected();while(this.eat(Ne.dot)){let Ge=this.startNodeAt(Me,je);Ge.object=qe,Ge.property=this.jsx_parseIdentifier(),qe=this.finishNode(Ge,"JSXMemberExpression")}return qe}jsx_parseAttributeValue(){switch(this.type){case Ne.braceL:let Me=this.jsx_parseExpressionContainer();if(Me.expression.type==="JSXEmptyExpression")this.raise(Me.start,"JSX attributes must only be assigned a non-empty expression");return Me;case De.jsxTagStart:case Ne.string:return this.parseExprAtom();default:this.raise(this.start,"JSX value should be either an expression or a quoted JSX text")}}jsx_parseEmptyExpression(){let Me=this.startNodeAt(this.lastTokEnd,this.lastTokEndLoc);return this.finishNodeAt(Me,"JSXEmptyExpression",this.start,this.startLoc)}jsx_parseExpressionContainer(){let Me=this.startNode();if(this.next(),this.eat(Ne.ellipsis))return Me.expression=this.parseExpression(),this.expect(Ne.braceR),this.finishNode(Me,"JSXSpreadChild");return Me.expression=this.type===Ne.braceR?this.jsx_parseEmptyExpression():this.parseExpression(),this.expect(Ne.braceR),this.finishNode(Me,"JSXExpressionContainer")}jsx_parseAttribute(){let Me=this.startNode();if(this.eat(Ne.braceL))return this.expect(Ne.ellipsis),Me.argument=this.parseMaybeAssign(),this.expect(Ne.braceR),this.finishNode(Me,"JSXSpreadAttribute");return Me.name=this.jsx_parseNamespacedName(),Me.value=this.eat(Ne.eq)?this.jsx_parseAttributeValue():null,this.finishNode(Me,"JSXAttribute")}jsx_parseOpeningElementAt(Me,je){let qe=this.startNodeAt(Me,je);qe.attributes=[];let Ge=this.jsx_parseElementName();if(Ge)qe.name=Ge;while(this.type!==Ne.slash&&this.type!==De.jsxTagEnd)qe.attributes.push(this.jsx_parseAttribute());return qe.selfClosing=this.eat(Ne.slash),this.expect(De.jsxTagEnd),this.finishNode(qe,Ge?"JSXOpeningElement":"JSXOpeningFragment")}jsx_parseClosingElementAt(Me,je){let qe=this.startNodeAt(Me,je),Ge=this.jsx_parseElementName();if(Ge)qe.name=Ge;return this.expect(De.jsxTagEnd),this.finishNode(qe,Ge?"JSXClosingElement":"JSXClosingFragment")}jsx_parseElementAt(Me,je){let qe=this.startNodeAt(Me,je),Ge=[],He=this.jsx_parseOpeningElementAt(Me,je),Xe=null;if(!He.selfClosing){e:for(;;)switch(this.type){case De.jsxTagStart:if(Me=this.start,je=this.startLoc,this.next(),this.eat(Ne.slash)){Xe=this.jsx_parseClosingElementAt(Me,je);break e}Ge.push(this.jsx_parseElementAt(Me,je));break;case De.jsxText:Ge.push(this.parseExprAtom());break;case Ne.braceL:Ge.push(this.jsx_parseExpressionContainer());break;default:this.unexpected()}if(mr(Xe.name)!==mr(He.name))this.raise(Xe.start,"Expected corresponding JSX closing tag for <"+mr(He.name)+">")}let ze=He.name?"Element":"Fragment";if(qe["opening"+ze]=He,qe["closing"+ze]=Xe,qe.children=Ge,this.type===Ne.relational&&this.value==="<")this.raise(this.start,"Adjacent JSX elements must be wrapped in an enclosing tag");return this.finishNode(qe,"JSX"+ze)}jsx_parseText(){let Me=this.parseLiteral(this.value);return Me.type="JSXText",Me}jsx_parseElement(){let Me=this.start,je=this.startLoc;return this.next(),this.jsx_parseElementAt(Me,je)}}}function od(i,ve,Ae){let{tokTypes:Pe}=ve,{tokTypes:Ne}=Ae;return class extends i{parseMaybeImportAttributes(_e){if(this.type===Ne._with||this.type===Pe.assert){this.next();let Re=this.parseImportAttributes();if(Re)_e.attributes=Re}}parseImportAttributes(){this.expect(Ne.braceL);let _e=this.parseWithEntries();return this.expect(Ne.braceR),_e}parseWithEntries(){let _e=[],Re=new Set;do{if(this.type===Ne.braceR)break;let Oe=this.startNode(),Be;if(this.type===Ne.string)Be=this.parseLiteral(this.value);else Be=this.parseIdent(!0);if(this.next(),Oe.key=Be,Re.has(Oe.key.name))this.raise(this.pos,"Duplicated key in attributes");if(Re.add(Oe.key.name),this.type!==Ne.string)this.raise(this.pos,"Only string is supported as an attribute value");Oe.value=this.parseLiteral(this.value),_e.push(this.finishNode(Oe,"ImportAttribute"))}while(this.eat(Ne.comma));return _e}}}var ai=["onToken","onComment","onInsertedSemicolon","onTrailingComma"];function Lo(){return{_tag:"BufferedParserEvents",segments:[]}}var cd=Lo();function To(i){return i.segments.length>0}var ld=class{constructor(i,ve){this.options=i,this.state=ve,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 ve=this.currentFrame();if(ve){if(i.output)this.appendOutput(this.outputFor(ve),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??cd}replay(i){if(!To(i))return;let ve=this.currentFrame();if(ve){this.appendOutput(this.outputFor(ve),i);return}this.flush(i)}set(i,ve,Ae){this.willSet(i,ve),i[ve]=Ae}remove(i,ve){this.willSet(i,ve),delete i[ve]}append(i,ve){this.willAppend(i),i.push(ve)}pop(i){return this.willMutateTail(i,1),i.pop()}truncate(i,ve){if(ve<i.length)this.willMutateTail(i,i.length-ve);else this.willAppend(i);i.length=ve}modify(i,ve,Ae){let[Pe,Ne]=Ae(i[ve]);return this.set(i,ve,Ne),Pe}willAppend(i){if(!this.active)return;this.undoLog.push({_tag:"ArrayLength",target:i,length:i.length})}willMutateTail(i,ve){if(!this.active)return;let Ae=Math.max(0,i.length-ve);this.undoLog.push({_tag:"ArrayTail",target:i,start:Ae,values:i.slice(Ae)})}willSet(i,ve){if(!this.active)return;let Ae=i;this.undoLog.push({_tag:"Property",target:Ae,key:ve,had:Object.prototype.hasOwnProperty.call(Ae,ve),value:Ae[ve]})}captureCallbacks(){let i=!1;for(let ve of ai){let Ae=this.options[ve];if(!Ae)continue;i=!0,this.callbacks[ve]=Ae,this.callbackWrappers[ve]=(...Pe)=>{this.emit({name:ve,args:Pe})}}return i}activateCallbacks(){for(let i of ai){let ve=this.callbackWrappers[i];if(ve)this.options[i]=ve}}deactivateCallbacks(){for(let i of ai){let ve=this.callbacks[i];if(ve)this.options[i]=ve}}emit(i){let ve=this.currentFrame();if(!ve){this.invoke(i);return}let Ae=this.outputFor(ve).segments,Pe=Ae[Ae.length-1];if(Array.isArray(Pe))Pe.push(i);else Ae.push([i])}appendOutput(i,ve){if(To(ve))i.segments.push(ve)}outputFor(i){return i.output??=Lo()}flush(i){let ve=[];for(let Ae=i.segments.length-1;Ae>=0;Ae--)ve.push(i.segments[Ae]);while(ve.length>0){let Ae=ve.pop();if(Array.isArray(Ae)){for(let Pe of Ae)this.invoke(Pe);continue}for(let Pe=Ae.segments.length-1;Pe>=0;Pe--)ve.push(Ae.segments[Pe])}}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 ve=this.undoLog.length-1;ve>=i;ve--){let Ae=this.undoLog[ve];switch(Ae._tag){case"ArrayLength":if(Ae.target.length<Ae.length)throw Error("A parse effect shortened an append-only array");Ae.target.length=Ae.length;break;case"ArrayTail":Ae.target.length=Ae.start;for(let Pe of Ae.values)Ae.target.push(Pe);break;case"Property":if(Ae.had)Ae.target[Ae.key]=Ae.value;else delete Ae.target[Ae.key];break}}this.undoLog.length=i}};function Kn(i,ve,Ae){if(i.length===ve)return i;if(i.length<ve)throw Error(`A parse branch shortened the ${Ae} below its checkpoint`);return i.length=ve,i}function pd(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,ve){i.setLookaheadTokenState(ve.lookahead),i.context=Kn(ve.context,ve.contextLength,"token context stack"),i.scopeStack=Kn(ve.scopeStack,ve.scopeStackLength,"scope stack"),i.importsStack=Kn(ve.importsStack,ve.importsStackLength,"import stack"),i.labels=Kn(ve.labels,ve.labelsLength,"label stack"),i.privateNameStack=Kn(ve.privateNameStack,ve.privateNameStackLength,"private-name stack"),i.decoratorStack=Kn(ve.decoratorStack,ve.decoratorStackLength,"decorator stack"),i.strict=ve.strict,i.potentialArrowAt=ve.potentialArrowAt,i.potentialArrowInForAwait=ve.potentialArrowInForAwait,i.yieldPos=ve.yieldPos,i.awaitPos=ve.awaitPos,i.awaitIdentPos=ve.awaitIdentPos,i.regexpState=null,i.preValue=ve.preValue,i.preToken=ve.preToken,i.isLookahead=ve.isLookahead,i.isAmbientContext=ve.isAmbientContext,i.inAbstractClass=ve.inAbstractClass,i.inType=ve.inType,i.inDisallowConditionalTypesContext=ve.inDisallowConditionalTypesContext,i.maybeInArrowParameters=ve.maybeInArrowParameters,i.shouldParseArrowReturnType=ve.shouldParseArrowReturnType,i.shouldParseAsyncArrowReturnType=ve.shouldParseAsyncArrowReturnType,i.importOrExportOuterKind=ve.importOrExportOuterKind}function dd(i){return{capture:()=>pd(i),restore:(ve)=>ud(i,ve)}}function fd(i,ve){let{acornTokenTypes:Ae,typeScriptTokenTypes:Pe,scope:Ne}=ve,De=Ne.SCOPE_TOP|Ne.SCOPE_FUNCTION|Ne.SCOPE_CLASS_STATIC_BLOCK;return class extends i{constructor(Re,Oe,Be){super(Re,Oe,Be);this.parseEffects=new ld(this.options,dd(this))}overrideContext(Re){if(this.curContext()!==Re)this.parseEffects?.willMutateTail(this.context,1);return super.overrideContext(Re)}takeDecorators(Re){let Oe=this.decoratorStack.length-1;if(this.decoratorStack[Oe].length>0)this.parseEffects?.willSet(this.decoratorStack,String(Oe));return super.takeDecorators(Re)}parseDecorators(Re){let Oe=this.decoratorStack[this.decoratorStack.length-1];return this.parseEffects?.willAppend(Oe),super.parseDecorators(Re)}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(Re,Oe,Be,Me){for(let je=this.labels.length-1;je>=0;je--){let qe=this.labels[je];if(qe.statementStart!==Re.start)break;this.parseEffects?.willSet(qe,"statementStart"),this.parseEffects?.willSet(qe,"kind")}return this.parseEffects?.willAppend(this.labels),super.parseLabeledStatement(Re,Oe,Be,Me)}enterClassBody(){return this.parseEffects?.willAppend(this.privateNameStack),super.enterClassBody()}exitClassBody(){let Re=this.privateNameStack[this.privateNameStack.length-2];if(Re)this.parseEffects?.willAppend(Re.used);return this.parseEffects?.willMutateTail(this.privateNameStack,1),super.exitClassBody()}parsePrivateIdent(){if(this.options.checkPrivateFields&&this.privateNameStack.length>0){let Re=this.privateNameStack[this.privateNameStack.length-1];this.parseEffects?.willAppend(Re.used)}return super.parsePrivateIdent()}parseClassField(Re){return this.parseEffects?.willSet(this.currentThisScope(),"inClassFieldInit"),super.parseClassField(Re)}updateContext(Re){let{type:Oe}=this;if(Oe===Ae.parenR||Oe===Ae.braceR||Oe===Ae.braceL||Oe===Ae.dollarBraceL||Oe===Ae.parenL||Oe===Ae._function||Oe===Ae._class||Oe===Ae.colon||Oe===Ae.backQuote||Oe===Ae.star||Oe===Pe.jsxTagStart||Oe===Pe.jsxTagEnd||Oe===Ae.slash&&Re===Pe.jsxTagStart)this.parseEffects?.willMutateTail(this.context,2);return super.updateContext(Re)}enterScope(Re){return this.parseEffects?.willAppend(this.scopeStack),super.enterScope(Re)}exitScope(){return this.parseEffects?.willMutateTail(this.scopeStack,1),super.exitScope()}declareName(Re,Oe,Be){let Me=this.parseEffects;if(Me?.active)if(Oe===Ne.BIND_LEXICAL){let je=this.currentScope();if(Me.willAppend(je.lexical),this.inModule&&je.flags&Ne.SCOPE_TOP)Me.willSet(this.undefinedExports,Re)}else if(Oe===Ne.BIND_SIMPLE_CATCH)Me.willAppend(this.currentScope().lexical);else if(Oe===Ne.BIND_FUNCTION)Me.willAppend(this.currentScope().functions);else for(let je=this.scopeStack.length-1;je>=0;je--){let qe=this.scopeStack[je];if(Me.willAppend(qe.var),this.inModule&&qe.flags&Ne.SCOPE_TOP)Me.willSet(this.undefinedExports,Re);if(qe.flags&De)break}return super.declareName(Re,Oe,Be)}checkLocalExport(Re){return this.parseEffects?.willSet(this.undefinedExports,Re.name),super.checkLocalExport(Re)}}}var oi=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;function Ao(i){if(!i)throw Error("Assert fail")}function hd(i){return i==="accessor"}function md(i){return i==="in"||i==="out"}var Ur=1,ko=2,gd=4,ft={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 ci(i,ve){return ft.SCOPE_FUNCTION|(i?ft.SCOPE_ASYNC:0)|(ve?ft.SCOPE_GENERATOR:0)}function yd(i){if(i.type!=="MemberExpression")return!1;let{computed:ve,property:Ae}=i;if(ve&&(Ae.type!=="TemplateLiteral"||Ae.expressions.length>0))return!1;return Oo(i.object)}function xd(i){return i.type==="UnaryExpression"&&(i.operator==="-"||i.operator==="+")&&i.argument.type==="Literal"&&(typeof i.argument.value==="number"||typeof i.argument.value==="bigint")}function Oo(i){if(i.type==="Identifier")return!0;if(i.type!=="MemberExpression")return!1;if(i.computed)return!1;return Oo(i.object)}function wo(i){return i==="private"||i==="public"||i==="protected"}function bd(i){return Boolean(i.startsExpr)}function Ed(i){if(i==null)throw Error(`Unexpected ${i} value.`);return i}function Cd(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 Mo(i){let{dts:ve=!1}=i||{},Ae=!!i?.jsx;return function(Pe){let Ne=Pe.acorn||ii,De=zu(Ne),{tokTypes:_e,keywordTypes:Re,isIdentifierStart:Oe,lineBreak:Be,isNewLine:Me,tokContexts:je,isIdentifierChar:qe}=Ne,{tokTypes:Ge,tokContexts:He,keywordsRegExp:Xe,tokenIsLiteralPropertyName:ze,tokenIsTemplate:tt,tokenIsTSDeclarationStart:at,tokenIsIdentifier:Ze,tokenIsKeywordOrIdentifier:nt,tokenIsTSTypeOperator:et}=De;function yt(Ie,Le,$e=Ie.length){for(let Ve=Le;Ve<$e;Ve++){let We=Ie.charCodeAt(Ve);if(Me(We))return Ve<$e-1&&We===13&&Ie.charCodeAt(Ve+1)===10?Ve+2:Ve+1}return-1}if(Pe=rd(Pe,De,Ne),i?.jsx)Pe=ad(Ne,De,Pe,typeof i.jsx==="boolean"?{}:i.jsx);Pe=od(Pe,De,Ne);let At=fd(Pe,{acornTokenTypes:_e,typeScriptTokenTypes:Ge,scope:ft});class Ct extends At{constructor(Ie,Le,$e){super(Ie,Le,$e);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=(Ve)=>{this.tsParseModifiers({modified:Ve,allowedModifiers:["const"],disallowedModifiers:["in","out"],errorTemplate:st.InvalidModifierOnTypeParameterPositions})},this.ecmaVersion=this.options.ecmaVersion}static get acornTypeScript(){return De}get acornTypeScript(){return De}getTokenFromCodeInType(Ie){if(Ie===62)return this.finishOp(_e.relational,1);if(Ie===60)return this.finishOp(_e.relational,1);return super.getTokenFromCode(Ie)}readToken(Ie){if(!this.inType){let Le=this.curContext();if(Le===He.tc_expr)return this.jsx_readToken();if(Le===He.tc_oTag||Le===He.tc_cTag){if(Oe(Ie))return this.jsx_readWord();if(Ie==62)return++this.pos,this.finishToken(Ge.jsxTagEnd);if((Ie===34||Ie===39)&&Le==He.tc_oTag)return this.jsx_readString(Ie)}if(Ie===60&&this.exprAllowed&&this.input.charCodeAt(this.pos+1)!==33)if(++this.pos,i?.jsx)return this.finishToken(Ge.jsxTagStart);else return this.finishToken(_e.relational,"<")}return super.readToken(Ie)}getTokenFromCode(Ie){if(this.inType)return this.getTokenFromCodeInType(Ie);if(Ie===64)return++this.pos,this.finishToken(Ge.at);return super.getTokenFromCode(Ie)}isAbstractClass(){return this.ts_isContextual(Ge.abstract)&&this.lookahead().type===_e._class}isDeclareClass(){if(!this.ts_isContextual(Ge.declare))return!1;let Ie=this.nextTokenStart();if(this.isUnparsedContextual(Ie,"class"))return!0;if(!this.isUnparsedContextual(Ie,"abstract"))return!1;let Le=this.nextTokenStartSince(Ie+8);return this.isUnparsedContextual(Le,"class")}finishNode(Ie,Le){if(Ie.type!==""&&Ie.end!==0)return Ie;return super.finishNode(Ie,Le)}tryParse(Ie){let Le={},$e=this.beginParseEffectScope(),Ve;try{Ve=Ie(()=>{throw Le})}catch(We){let Ue=We===Le;if(!Ue&&!(We instanceof SyntaxError))throw this.parseEffects.rollback($e),We;let Ke={events:this.parseEffects.rollbackWithEvents($e),selected:!1};return Ue?{node:null,error:null,thrown:!1,aborted:!0,failState:Ke}:{node:null,error:We,thrown:!0,aborted:!1,failState:Ke}}return this.parseEffects.commit($e),{node:Ve,error:null,thrown:!1,aborted:!1,failState:null}}setOptionalParametersError(Ie,Le){Ie.optionalParametersLoc=Le?.loc??this.startLoc}reScan_lt_gt(){if(this.type===_e.relational)this.pos-=1,this.readToken_lt_gt(this.fullCharCodeAtPos())}reScan_lt(){let{type:Ie}=this;if(Ie===_e.bitShift)return this.pos-=2,this.finishOp(_e.relational,1),_e.relational;return Ie}resetEndLocation(Ie,Le=this.lastTokEnd,$e=this.lastTokEndLoc){if(Ie.end=Le,Ie.loc.end=$e,this.options.ranges)Ie.range[1]=Le}startNodeAtNode(Ie){return super.startNodeAt(Ie.start,Ie.loc.start)}nextTokenStart(){return this.nextTokenStartSince(this.pos)}tsHasSomeModifiers(Ie,Le){return Le.some(($e)=>{if(wo($e))return Ie.accessibility===$e;return!!Ie[$e]})}tsIsStartOfStaticBlocks(){return this.isContextual("static")&&this.lookaheadCharCode()===123}tsCheckForInvalidTypeCasts(Ie){Ie.forEach((Le)=>{if(Le?.type==="TSTypeCastExpression")this.raise(Le.typeAnnotation.start,st.UnexpectedTypeAnnotation)})}atPossibleAsyncArrow(Ie){return Ie.type==="Identifier"&&Ie.name==="async"&&this.lastTokEnd===Ie.end&&!this.canInsertSemicolon()&&Ie.end-Ie.start===5&&Ie.start===this.potentialArrowAt}tsIsIdentifier(){return Ze(this.type)}tsTryParseTypeOrTypePredicateAnnotation(){return this.match(_e.colon)?this.tsParseTypeOrTypePredicateAnnotation(_e.colon):void 0}tsTryParseGenericAsyncArrowFunction(Ie,Le,$e){if(!this.tsMatchLeftRelational())return;let Ve=this.maybeInArrowParameters;this.maybeInArrowParameters=!0;let We=this.tsTryParseAndCatch(()=>{let Ue=this.startNodeAt(Ie,Le);return Ue.typeParameters=this.tsParseTypeParameters(this.tsParseConstModifier),super.parseFunctionParams(Ue),Ue.returnType=this.tsTryParseTypeOrTypePredicateAnnotation(),this.expect(_e.arrow),Ue});if(this.maybeInArrowParameters=Ve,!We)return;return this.parseArrowExpression(We,We.params,!0,$e)}tsParseTypeArgumentsInExpression(){if(this.reScan_lt()!==_e.relational)return;return this.tsParseTypeArguments(!0)}tsInNoContext(Ie){let Le=this.context;this.context=[Le[0]];try{return Ie()}finally{this.context=Le}}tsTryParseTypeAnnotation(){return this.match(_e.colon)?this.tsParseTypeAnnotation():void 0}isUnparsedContextual(Ie,Le){let $e=Ie+Le.length;if(this.input.slice(Ie,$e)===Le){let Ve=this.input.charCodeAt($e);return!(qe(Ve)||(Ve&64512)===55296)}return!1}isAbstractConstructorSignature(){return this.ts_isContextual(Ge.abstract)&&this.lookahead().type===_e._new}nextTokenStartSince(Ie){return oi.lastIndex=Ie,oi.test(this.input)?oi.lastIndex:Ie}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(Ie){this.pos=Ie.pos,this.value=Ie.value,this.exprAllowed=Ie.exprAllowed,this.endLoc=Ie.endLoc,this.lastTokEnd=Ie.lastTokEnd,this.lastTokStart=Ie.lastTokStart,this.lastTokStartLoc=Ie.lastTokStartLoc,this.type=Ie.type,this.start=Ie.start,this.end=Ie.end,this.startLoc=Ie.startLoc,this.lastTokEndLoc=Ie.lastTokEndLoc,this.curLine=Ie.curLine,this.lineStart=Ie.lineStart,this.containsEsc=Ie.containsEsc}setLookaheadState(Ie){this.setLookaheadTokenState(Ie),this.context=Ie.context&&Ie.context.slice()}beginParseEffectScope(){return this.parseEffects.begin()}selectTryParseResult(Ie){let Le=Ie.failState;if(!Le)return;if(Le.selected)throw Error("A parse branch result can only be selected once");Le.selected=!0,this.parseEffects.replay(Le.events)}tsLookAhead(Ie){let Le=this.beginParseEffectScope();try{return Ie()}finally{this.parseEffects.rollback(Le)}}lookahead(Ie){let Le=this.getCurLookaheadState(),$e=this.context,Ve=this.preValue,We=this.preToken,Ue=this.isLookahead;try{if(this.createLookaheadState(),this.isLookahead=!0,Ie!==void 0)for(let Ke=0;Ke<Ie;Ke++)this.nextToken();else this.nextToken();return this.getCurLookaheadState()}finally{this.setLookaheadTokenState(Le),this.context=$e,this.preValue=Ve,this.preToken=We,this.isLookahead=Ue}}readWord(){let Ie=this.readWord1(),Le=_e.name;if(this.keywords.test(Ie))Le=Re[Ie];else if(new RegExp(Xe).test(Ie))Le=Ge[Ie];return this.finishToken(Le,Ie)}skipBlockComment(){let Ie;if(!this.isLookahead)Ie=this.options.onComment&&this.curPosition();let Le=this.pos,$e=this.input.indexOf("*/",this.pos+=2);if($e===-1)this.raise(this.pos-2,"Unterminated comment");if(this.pos=$e+2,this.options.locations)for(let Ve,We=Le;(Ve=yt(this.input,We,this.pos))>-1;)++this.curLine,We=this.lineStart=Ve;if(this.isLookahead)return;if(this.options.onComment)this.options.onComment(!0,this.input.slice(Le+2,$e),Le,this.pos,Ie,this.curPosition())}skipLineComment(Ie){let Le=this.pos,$e;if(!this.isLookahead)$e=this.options.onComment&&this.curPosition();let Ve=this.input.charCodeAt(this.pos+=Ie);while(this.pos<this.input.length&&!Me(Ve))Ve=this.input.charCodeAt(++this.pos);if(this.isLookahead)return;if(this.options.onComment)this.options.onComment(!1,this.input.slice(Le+Ie,this.pos),Le,this.pos,$e,this.curPosition())}finishToken(Ie,Le){if(this.preValue=this.value,this.preToken=this.type,this.end=this.pos,this.options.locations)this.endLoc=this.curPosition();let $e=this.type;if(this.type=Ie,this.value=Le,!this.isLookahead)this.updateContext($e)}resetStartLocation(Ie,Le,$e){if(Ie.start=Le,Ie.loc.start=$e,this.options.ranges)Ie.range[0]=Le}isLineTerminator(){return this.eat(_e.semi)||super.canInsertSemicolon()}hasFollowingLineBreak(){return Co.lastIndex=this.end,Co.test(this.input)}addExtra(Ie,Le,$e,Ve=!0){if(!Ie)return;let We=Ie.extra=Ie.extra||{};if(Ve)We[Le]=$e;else Object.defineProperty(We,Le,{enumerable:Ve,value:$e})}isLiteralPropertyName(){return ze(this.type)}hasPrecedingLineBreak(){return Be.test(this.input.slice(this.lastTokEnd,this.start))}createIdentifier(Ie,Le){return Ie.name=Le,this.finishNode(Ie,"Identifier")}resetStartLocationFromNode(Ie,Le){this.resetStartLocation(Ie,Le.start,Le.loc.start)}isThisParam(Ie){return Ie.type==="Identifier"&&Ie.name==="this"}isLookaheadContextual(Ie){let Le=this.nextTokenStart();return this.isUnparsedContextual(Le,Ie)}ts_type_isContextual(Ie,Le){return Ie===Le&&!this.containsEsc}ts_isContextual(Ie){return this.type===Ie&&!this.containsEsc}ts_isContextualWithState(Ie,Le){return Ie.type===Le&&!Ie.containsEsc}isContextualWithState(Ie,Le){return Le.type===_e.name&&Le.value===Ie&&!Le.containsEsc}tsIsStartOfMappedType(){if(this.next(),this.eat(_e.plusMin))return this.ts_isContextual(Ge.readonly);if(this.ts_isContextual(Ge.readonly))this.next();if(!this.match(_e.bracketL))return!1;if(this.next(),!this.tsIsIdentifier())return!1;return this.next(),this.match(_e._in)}tsInDisallowConditionalTypesContext(Ie){let Le=this.inDisallowConditionalTypesContext;this.inDisallowConditionalTypesContext=!0;try{return Ie()}finally{this.inDisallowConditionalTypesContext=Le}}tsTryParseType(){return this.tsEatThenParseType(_e.colon)}match(Ie){return this.type===Ie}matchJsx(Ie){return this.type===De.tokTypes[Ie]}ts_eatWithState(Ie,Le,$e){let Ve=$e.type;if(Ie===Ve){for(let We=0;We<Le;We++)this.next();return!0}else return!1}ts_eatContextualWithState(Ie,Le,$e){if(Xe.test(Ie)){if(this.ts_isContextualWithState($e,Ge[Ie])){for(let Ve=0;Ve<Le;Ve++)this.next();return!0}return!1}else{if(!this.isContextualWithState(Ie,$e))return!1;for(let Ve=0;Ve<Le;Ve++)this.next();return!0}}canHaveLeadingDecorator(){return this.match(_e._class)||this.isAbstractClass()||this.isDeclareClass()}eatContextual(Ie){if(Xe.test(Ie)){if(this.ts_isContextual(Ge[Ie]))return this.next(),!0;return!1}else return super.eatContextual(Ie)}tsIsExternalModuleReference(){return this.isContextual("require")&&this.lookaheadCharCode()===40}tsParseExternalModuleReference(){let Ie=this.startNode();if(this.expectContextual("require"),this.expect(_e.parenL),!this.match(_e.string))this.unexpected();return Ie.expression=this.parseExprAtom(),this.expect(_e.parenR),this.finishNode(Ie,"TSExternalModuleReference")}tsParseEntityName(Ie=!0){let Le=this.parseIdent(Ie);while(this.eat(_e.dot)){let $e=this.startNodeAtNode(Le);$e.left=Le,$e.right=this.parseIdent(Ie),Le=this.finishNode($e,"TSQualifiedName")}return Le}tsParseEnumMember(){let Ie=this.startNode();if(Ie.id=this.match(_e.string)?this.parseLiteral(this.value):this.parseIdent(!0),this.eat(_e.eq))Ie.initializer=this.parseMaybeAssign();return this.finishNode(Ie,"TSEnumMember")}tsParseEnumDeclaration(Ie,Le={}){if(Le.const)Ie.const=!0;if(Le.declare)Ie.declare=!0;this.expectContextual("enum"),Ie.id=this.parseIdent();let $e=Le.const?ft.BIND_TS_CONST_ENUM:ft.BIND_TS_ENUM;return this.checkLValSimple(Ie.id,$e),this.expect(_e.braceL),Ie.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(_e.braceR),this.finishNode(Ie,"TSEnumDeclaration")}tsParseModuleBlock(){let Ie=this.startNode();this.enterScope(Xu),this.expect(_e.braceL),Ie.body=[];while(this.type!==_e.braceR){let Le=this.parseStatement(null,!0);Ie.body.push(Le)}return this.next(),super.exitScope(),this.finishNode(Ie,"TSModuleBlock")}tsParseAmbientExternalModuleDeclaration(Ie){if(this.ts_isContextual(Ge.global))Ie.global=!0,Ie.id=this.parseIdent();else if(this.match(_e.string))Ie.id=this.parseLiteral(this.value);else this.unexpected();if(this.match(_e.braceL))this.enterScope(fr),Ie.body=this.tsParseModuleBlock(),super.exitScope();else super.semicolon();return this.finishNode(Ie,"TSModuleDeclaration")}tsTryParseDeclare(Ie){if(this.isLineTerminator())return;let Le=this.type,$e;if(this.isContextual("let"))Le=_e._var,$e="let";return this.tsInAmbientContext(()=>{if(Le===_e._function)return Ie.declare=!0,this.parseFunctionStatement(Ie,!1,!0);if(Le===_e._class)return Ie.declare=!0,this.parseClass(Ie,!0);if(Le===Ge.enum)return this.tsParseEnumDeclaration(Ie,{declare:!0});if(Le===Ge.global)return this.tsParseAmbientExternalModuleDeclaration(Ie);if(Le===_e._const||Le===_e._var){if(!this.match(_e._const)||!this.isLookaheadContextual("enum"))return Ie.declare=!0,this.parseVarStatement(Ie,$e||this.value,!0);return this.expect(_e._const),this.tsParseEnumDeclaration(Ie,{const:!0,declare:!0})}if(Le===Ge.interface){let Ve=this.tsParseInterfaceDeclaration(Ie,{declare:!0});if(Ve)return Ve}if(Ze(Le))return this.tsParseDeclaration(Ie,this.value,!0)})}tsIsListTerminator(Ie){switch(Ie){case"EnumMembers":case"TypeMembers":return this.match(_e.braceR);case"HeritageClauseElement":return this.match(_e.braceL);case"TupleElementTypes":return this.match(_e.bracketR);case"TypeParametersOrArguments":return this.tsMatchRightRelational()}}tsParseDelimitedListWorker(Ie,Le,$e,Ve){let We=[],Ue=-1;for(;;){if(this.tsIsListTerminator(Ie))break;Ue=-1;let Ke=Le();if(Ke==null)return;if(We.push(Ke),this.eat(_e.comma)){Ue=this.lastTokStart;continue}if(this.tsIsListTerminator(Ie))break;if($e)this.expect(_e.comma);return}if(Ve)Ve.value=Ue;return We}tsParseDelimitedList(Ie,Le,$e){return Ed(this.tsParseDelimitedListWorker(Ie,Le,!0,$e))}tsParseBracketedList(Ie,Le,$e,Ve,We){if(!Ve)if($e)this.expect(_e.bracketL);else this.expect(_e.relational);let Ue=this.tsParseDelimitedList(Ie,Le,We);if($e)this.expect(_e.bracketR);else this.expect(_e.relational);return Ue}tsParseTypeParameterName(){return this.parseIdent().name}tsEatThenParseType(Ie){return!this.match(Ie)?void 0:this.tsNextThenParseType()}tsExpectThenParseType(Ie){return this.tsDoThenParseType(()=>this.expect(Ie))}tsNextThenParseType(){return this.tsDoThenParseType(()=>this.next())}tsDoThenParseType(Ie){return this.tsInType(()=>(Ie(),this.tsParseType()))}tsSkipParameterStart(){if(Ze(this.type)||this.match(_e._this))return this.next(),!0;if(this.match(_e.braceL))try{return this.parseObj(!0),!0}catch{return!1}if(this.match(_e.bracketL)){this.next();try{return this.parseBindingList(_e.bracketR,!0,!0),!0}catch{return!1}}return!1}tsIsUnambiguouslyStartOfFunctionType(){if(this.next(),this.match(_e.parenR)||this.match(_e.ellipsis))return!0;if(this.tsSkipParameterStart()){if(this.match(_e.colon)||this.match(_e.comma)||this.match(_e.question)||this.match(_e.eq))return!0;if(this.match(_e.parenR)){if(this.next(),this.match(_e.arrow))return!0}}return!1}tsIsStartOfFunctionType(){if(this.tsMatchLeftRelational())return!0;return this.match(_e.parenL)&&this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))}tsInAllowConditionalTypesContext(Ie){let Le=this.inDisallowConditionalTypesContext;this.inDisallowConditionalTypesContext=!1;try{return Ie()}finally{this.inDisallowConditionalTypesContext=Le}}tsParseBindingListForSignature(){return super.parseBindingList(_e.parenR,!0,!0).map((Ie)=>{if(Ie.type!=="Identifier"&&Ie.type!=="RestElement"&&Ie.type!=="ObjectPattern"&&Ie.type!=="ArrayPattern")this.raise(Ie.start,st.UnsupportedSignatureParameterKind({type:Ie.type}));return Ie})}tsParseTypePredicateAsserts(){if(this.type!==Ge.asserts)return!1;let Ie=this.containsEsc;if(this.next(),!Ze(this.type)&&!this.match(_e._this))return!1;if(Ie)this.raise(this.lastTokStart,"Escape sequence in keyword asserts");return!0}tsParseThisTypeNode(){let Ie=this.startNode();return this.next(),this.finishNode(Ie,"TSThisType")}tsParseTypeAnnotation(Ie=!0,Le=this.startNode()){return this.tsInType(()=>{if(Ie)this.expect(_e.colon);Le.typeAnnotation=this.tsParseType()}),this.finishNode(Le,"TSTypeAnnotation")}tsParseThisTypePredicate(Ie){this.next();let Le=this.startNodeAtNode(Ie);return Le.parameterName=Ie,Le.typeAnnotation=this.tsParseTypeAnnotation(!1),Le.asserts=!1,this.finishNode(Le,"TSTypePredicate")}tsParseThisTypeOrThisTypePredicate(){let Ie=this.tsParseThisTypeNode();if(this.isContextual("is")&&!this.hasPrecedingLineBreak())return this.tsParseThisTypePredicate(Ie);else return Ie}tsParseTypePredicatePrefix(){let Ie=this.parseIdent();if(this.isContextual("is")&&!this.hasPrecedingLineBreak())return this.next(),Ie}tsParseTypeOrTypePredicateAnnotation(Ie){return this.tsInType(()=>{let Le=this.startNode();this.expect(Ie);let $e=this.startNode(),Ve=this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(Ve){let Qe=this.tsParseTypeAnnotation(!1);return $e.parameterName=Ve,$e.typeAnnotation=Qe,$e.asserts=!1,Le.typeAnnotation=this.finishNode($e,"TSTypePredicate"),this.finishNode(Le,"TSTypeAnnotation")}let We=!!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));if(We&&this.match(_e._this)){let Qe=this.tsParseThisTypeOrThisTypePredicate();if(Qe.type==="TSThisType")$e.parameterName=Qe,$e.asserts=!0,$e.typeAnnotation=null,Qe=this.finishNode($e,"TSTypePredicate");else this.resetStartLocationFromNode(Qe,$e),Qe.asserts=!0;return Le.typeAnnotation=Qe,this.finishNode(Le,"TSTypeAnnotation")}let Ue=We&&this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(!Ue){if(!We)return this.tsParseTypeAnnotation(!1,Le);return $e.parameterName=this.parseIdent(),$e.asserts=We,$e.typeAnnotation=null,Le.typeAnnotation=this.finishNode($e,"TSTypePredicate"),this.finishNode(Le,"TSTypeAnnotation")}let Ke=this.tsParseTypeAnnotation(!1);return $e.parameterName=Ue,$e.typeAnnotation=Ke,$e.asserts=We,Le.typeAnnotation=this.finishNode($e,"TSTypePredicate"),this.finishNode(Le,"TSTypeAnnotation")})}tsFillSignature(Ie,Le){let $e=Ie===_e.arrow,Ve="parameters",We="typeAnnotation";if(Le.typeParameters=this.tsTryParseTypeParameters(),this.expect(_e.parenL),Le.parameters=this.tsParseBindingListForSignature(),$e)Le.typeAnnotation=this.tsParseTypeOrTypePredicateAnnotation(Ie);else if(this.match(Ie))Le.typeAnnotation=this.tsParseTypeOrTypePredicateAnnotation(Ie)}tsTryNextParseConstantContext(){if(this.lookahead().type!==_e._const)return null;this.next();let Ie=this.tsParseTypeReference();if(Ie.typeParameters||Ie.typeArguments)this.raise(Ie.typeName.start,st.CannotFindName({name:"const"}));return Ie}tsParseFunctionOrConstructorType(Ie,Le){let $e=this.startNode();if(Ie==="TSConstructorType"){if($e.abstract=!!Le,Le)this.next();this.next()}return this.tsInAllowConditionalTypesContext(()=>this.tsFillSignature(_e.arrow,$e)),this.finishNode($e,Ie)}tsParseUnionOrIntersectionType(Ie,Le,$e){let Ve=this.startNode(),We=this.eat($e),Ue=[];do Ue.push(Le());while(this.eat($e));if(Ue.length===1&&!We)return Ue[0];return Ve.types=Ue,this.finishNode(Ve,Ie)}tsCheckTypeAnnotationForReadOnly(Ie){switch(Ie.typeAnnotation.type){case"TSTupleType":case"TSArrayType":return;default:this.raise(Ie.start,st.UnexpectedReadonly)}}tsParseTypeOperator(){let Ie=this.startNode(),Le=this.value;if(this.next(),Ie.operator=Le,Ie.typeAnnotation=this.tsParseTypeOperatorOrHigher(),Le==="readonly")this.tsCheckTypeAnnotationForReadOnly(Ie);return this.finishNode(Ie,"TSTypeOperator")}tsParseConstraintForInferType(){if(this.eat(_e._extends)){let Ie=this.tsInDisallowConditionalTypesContext(()=>this.tsParseType());if(this.inDisallowConditionalTypesContext||!this.match(_e.question))return Ie}}tsParseInferType(){let Ie=this.startNode();this.expectContextual("infer");let Le=this.startNode();return Le.name=this.tsParseTypeParameterName(),Le.constraint=this.tsTryParse(()=>this.tsParseConstraintForInferType()),Ie.typeParameter=this.finishNode(Le,"TSTypeParameter"),this.finishNode(Ie,"TSInferType")}tsParseLiteralTypeNode(){let Ie=this.startNode();return Ie.literal=(()=>{switch(this.type){case _e.num:case _e.string:case _e._true:case _e._false:return this.parseExprAtom();default:this.unexpected()}})(),this.finishNode(Ie,"TSLiteralType")}tsParseImportType(){let Ie=this.startNode();if(this.expect(_e._import),this.expect(_e.parenL),!this.match(_e.string))this.raise(this.start,st.UnsupportedImportTypeArgument);if(Ie.argument=this.parseExprAtom(),this.expect(_e.parenR),this.eat(_e.dot))Ie.qualifier=this.tsParseEntityName();if(this.tsMatchLeftRelational())Ie.typeArguments=this.tsParseTypeArguments();return this.finishNode(Ie,"TSImportType")}tsParseTypeQuery(){let Ie=this.startNode();if(this.expect(_e._typeof),this.match(_e._import))Ie.exprName=this.tsParseImportType();else Ie.exprName=this.tsParseEntityName();if(!this.hasPrecedingLineBreak()&&this.tsMatchLeftRelational())Ie.typeArguments=this.tsParseTypeArguments();return this.finishNode(Ie,"TSTypeQuery")}tsParseMappedTypeParameter(){let Ie=this.startNode();return Ie.name=this.tsParseTypeParameterName(),Ie.constraint=this.tsExpectThenParseType(_e._in),this.finishNode(Ie,"TSTypeParameter")}tsParseMappedType(){let Ie=this.startNode();if(this.expect(_e.braceL),this.match(_e.plusMin))Ie.readonly=this.value,this.next(),this.expectContextual("readonly");else if(this.eatContextual("readonly"))Ie.readonly=!0;if(this.expect(_e.bracketL),Ie.typeParameter=this.tsParseMappedTypeParameter(),Ie.nameType=this.eatContextual("as")?this.tsParseType():null,this.expect(_e.bracketR),this.match(_e.plusMin))Ie.optional=this.value,this.next(),this.expect(_e.question);else if(this.eat(_e.question))Ie.optional=!0;return Ie.typeAnnotation=this.tsTryParseType(),this.semicolon(),this.expect(_e.braceR),this.finishNode(Ie,"TSMappedType")}tsParseTypeLiteral(){let Ie=this.startNode();return Ie.members=this.tsParseObjectTypeMembers(),this.finishNode(Ie,"TSTypeLiteral")}tsIsTupleElementLabel(){if(!nt(this.type))return!1;let Ie=this.lookahead();if(Ie.type===_e.colon)return!0;if(Ie.type!==_e.question)return!1;return this.lookahead(2).type===_e.colon}tsParseTupleElementType(){let Ie=this.startLoc,Le=this.start,$e=this.eat(_e.ellipsis),Ve;if(this.tsIsTupleElementLabel()){let We=this.startNode();We.label=this.parseIdent(!0),We.optional=this.eat(_e.question),this.expect(_e.colon),We.elementType=this.tsParseType(),Ve=this.finishNode(We,"TSNamedTupleMember")}else{Ve=this.tsParseType();let We=this.eat(_e.question);if(this.eat(_e.colon))this.raise(Ve.start,st.InvalidTupleMemberLabel);if(We){let Ue=this.startNodeAtNode(Ve);Ue.typeAnnotation=Ve,Ve=this.finishNode(Ue,"TSOptionalType")}}if($e){let We=this.startNodeAt(Le,Ie);We.typeAnnotation=Ve,Ve=this.finishNode(We,"TSRestType")}return Ve}tsParseTupleType(){let Ie=this.startNode();Ie.elementTypes=this.tsParseBracketedList("TupleElementTypes",this.tsParseTupleElementType.bind(this),!0,!1);let Le=!1;return Ie.elementTypes.forEach(($e)=>{let{type:Ve}=$e;if(Le&&Ve!=="TSRestType"&&Ve!=="TSOptionalType"&&!(Ve==="TSNamedTupleMember"&&$e.optional))this.raise($e.start,st.OptionalTypeBeforeRequired);if(Le||=Ve==="TSNamedTupleMember"&&$e.optional||Ve==="TSOptionalType",Ve==="TSRestType")$e=$e.typeAnnotation}),this.finishNode(Ie,"TSTupleType")}tsParseTemplateLiteralType(){let Ie=this.startNode();return Ie.literal=this.parseTemplate({isTagged:!1}),this.finishNode(Ie,"TSLiteralType")}tsParseTypeReference(){let Ie=this.startNode();if(Ie.typeName=this.tsParseEntityName(),!this.hasPrecedingLineBreak()&&this.tsMatchLeftRelational())Ie.typeArguments=this.tsParseTypeArguments();return this.finishNode(Ie,"TSTypeReference")}tsMatchLeftRelational(){return this.match(_e.relational)&&this.value==="<"}tsMatchRightRelational(){return this.match(_e.relational)&&this.value===">"}tsParseParenthesizedType(){let Ie=this.startNode();return this.expect(_e.parenL),Ie.typeAnnotation=this.tsParseType(),this.expect(_e.parenR),this.finishNode(Ie,"TSParenthesizedType")}tsParseNonArrayType(){switch(this.type){case _e.string:case _e.num:case _e._true:case _e._false:return this.tsParseLiteralTypeNode();case _e.plusMin:if(this.value==="-"){let Ie=this.startNode();if(this.lookahead().type!==_e.num)this.unexpected();return Ie.literal=this.parseMaybeUnary(),this.finishNode(Ie,"TSLiteralType")}break;case _e._this:return this.tsParseThisTypeOrThisTypePredicate();case _e._typeof:return this.tsParseTypeQuery();case _e._import:return this.tsParseImportType();case _e.braceL:return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))?this.tsParseMappedType():this.tsParseTypeLiteral();case _e.bracketL:return this.tsParseTupleType();case _e.parenL:return this.tsParseParenthesizedType();case _e.backQuote:case _e.dollarBraceL:return this.tsParseTemplateLiteralType();default:{let{type:Ie}=this;if(nt(Ie)||Ie===_e._void||Ie===_e._null){let Le=Ie===_e._void?"TSVoidKeyword":Ie===_e._null?"TSNullKeyword":Cd(this.value);if(Le!==void 0&&this.lookaheadCharCode()!==46){let $e=this.startNode();return this.next(),this.finishNode($e,Le)}return this.tsParseTypeReference()}}}this.unexpected()}tsParseArrayTypeOrHigher(){let Ie=this.tsParseNonArrayType();while(!this.hasPrecedingLineBreak()&&this.eat(_e.bracketL))if(this.match(_e.bracketR)){let Le=this.startNodeAtNode(Ie);Le.elementType=Ie,this.expect(_e.bracketR),Ie=this.finishNode(Le,"TSArrayType")}else{let Le=this.startNodeAtNode(Ie);Le.objectType=Ie,Le.indexType=this.tsParseType(),this.expect(_e.bracketR),Ie=this.finishNode(Le,"TSIndexedAccessType")}return Ie}tsParseTypeOperatorOrHigher(){return et(this.type)&&!this.containsEsc?this.tsParseTypeOperator():this.isContextual("infer")?this.tsParseInferType():this.tsInAllowConditionalTypesContext(()=>this.tsParseArrayTypeOrHigher())}tsParseIntersectionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSIntersectionType",this.tsParseTypeOperatorOrHigher.bind(this),_e.bitwiseAND)}tsParseUnionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSUnionType",this.tsParseIntersectionTypeOrHigher.bind(this),_e.bitwiseOR)}tsParseNonConditionalType(){if(this.tsIsStartOfFunctionType())return this.tsParseFunctionOrConstructorType("TSFunctionType");if(this.match(_e._new))return this.tsParseFunctionOrConstructorType("TSConstructorType");else if(this.isAbstractConstructorSignature())return this.tsParseFunctionOrConstructorType("TSConstructorType",!0);return this.tsParseUnionTypeOrHigher()}tsParseType(){Ao(this.inType);let Ie=this.tsParseNonConditionalType();if(this.inDisallowConditionalTypesContext||this.hasPrecedingLineBreak()||!this.eat(_e._extends))return Ie;let Le=this.startNodeAtNode(Ie);return Le.checkType=Ie,Le.extendsType=this.tsInDisallowConditionalTypesContext(()=>this.tsParseNonConditionalType()),this.expect(_e.question),Le.trueType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.expect(_e.colon),Le.falseType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.finishNode(Le,"TSConditionalType")}tsIsUnambiguouslyIndexSignature(){if(this.next(),Ze(this.type))return this.next(),this.match(_e.colon);return!1}tsInType(Ie){let Le=this.inType;this.inType=!0;try{return Ie()}finally{this.inType=Le}}tsTryParseIndexSignature(Ie){if(!(this.match(_e.bracketL)&&this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this))))return;this.expect(_e.bracketL);let Le=this.parseIdent();Le.typeAnnotation=this.tsParseTypeAnnotation(),this.resetEndLocation(Le),this.expect(_e.bracketR),Ie.parameters=[Le];let $e=this.tsTryParseTypeAnnotation();if($e)Ie.typeAnnotation=$e;return this.tsParseTypeMemberSemicolon(),this.finishNode(Ie,"TSIndexSignature")}tsParseNoneModifiers(Ie){this.tsParseModifiers({modified:Ie,allowedModifiers:[],disallowedModifiers:["in","out"],errorTemplate:st.InvalidModifierOnTypeParameterPositions})}tsParseTypeParameter(Ie=this.tsParseNoneModifiers.bind(this)){let Le=this.startNode();return Ie(Le),Le.name=this.tsParseTypeParameterName(),Le.constraint=this.tsEatThenParseType(_e._extends),Le.default=this.tsEatThenParseType(_e.eq),this.finishNode(Le,"TSTypeParameter")}tsParseTypeParameters(Ie){let Le=this.startNode();if(this.tsMatchLeftRelational()||this.matchJsx("jsxTagStart"))this.next();else this.unexpected();let $e={value:-1};if(Le.params=this.tsParseBracketedList("TypeParametersOrArguments",this.tsParseTypeParameter.bind(this,Ie),!1,!0,$e),Le.params.length===0)this.raise(this.start,st.EmptyTypeParameters);if($e.value!==-1)this.addExtra(Le,"trailingComma",$e.value);return this.finishNode(Le,"TSTypeParameterDeclaration")}tsTryParseTypeParameters(Ie){if(this.tsMatchLeftRelational())return this.tsParseTypeParameters(Ie)}tsTryParse(Ie){let Le=this.beginParseEffectScope(),$e;try{$e=Ie()}catch(Ve){throw this.parseEffects.rollback(Le),Ve}if($e!==void 0&&$e!==!1)return this.parseEffects.commit(Le),$e;this.parseEffects.rollback(Le);return}tsTokenCanFollowModifier(){return(this.match(_e.bracketL)||this.match(_e.braceL)||this.match(_e.star)||this.match(_e.ellipsis)||this.match(_e.privateId)||this.isLiteralPropertyName())&&!this.hasPrecedingLineBreak()}tsNextTokenCanFollowModifier(){return this.next(!0),this.tsTokenCanFollowModifier()}tsParseModifier(Ie,Le){let $e=this.value;if(Ie.indexOf($e)!==-1&&!this.containsEsc){if(Le&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return $e}return}tsParseModifiersByMap({modified:Ie,map:Le}){for(let $e of Object.keys(Le))Ie[$e]=Le[$e]}tsParseModifiers({modified:Ie,allowedModifiers:Le,disallowedModifiers:$e,stopOnStartOfClassStaticBlock:Ve,errorTemplate:We=st.InvalidModifierOnTypeMember}){let Ue={},Ke=(Ye,Je,ct,ut)=>{if(Je===ct&&Ie[ut])this.raise(Ye.column,st.InvalidModifiersOrder({orderedModifiers:[ct,ut]}))},Qe=(Ye,Je,ct,ut)=>{if(Ie[ct]&&Je===ut||Ie[ut]&&Je===ct)this.raise(Ye.column,st.IncompatibleModifiers({modifiers:[ct,ut]}))};for(;;){let Ye=this.startLoc,Je=this.tsParseModifier(Le.concat($e??[]),Ve);if(!Je)break;if(wo(Je))if(Ie.accessibility)this.raise(this.start,st.DuplicateAccessibilityModifier());else Ke(Ye,Je,Je,"override"),Ke(Ye,Je,Je,"static"),Ke(Ye,Je,Je,"readonly"),Ke(Ye,Je,Je,"accessor"),Ue.accessibility=Je,Ie.accessibility=Je;else if(md(Je))if(Ie[Je])this.raise(this.start,st.DuplicateModifier({modifier:Je}));else Ke(Ye,Je,"in","out"),Ue[Je]=Je,Ie[Je]=!0;else if(hd(Je))if(Ie[Je])this.raise(this.start,st.DuplicateModifier({modifier:Je}));else Qe(Ye,Je,"accessor","readonly"),Qe(Ye,Je,"accessor","override"),Ue[Je]=Je,Ie[Je]=!0;else if(Je==="const")if(Ie[Je])this.raise(this.start,st.DuplicateModifier({modifier:Je}));else Ue[Je]=Je,Ie[Je]=!0;else if(Object.hasOwnProperty.call(Ie,Je))this.raise(this.start,st.DuplicateModifier({modifier:Je}));else Ke(Ye,Je,"static","readonly"),Ke(Ye,Je,"static","override"),Ke(Ye,Je,"override","readonly"),Ke(Ye,Je,"abstract","override"),Qe(Ye,Je,"declare","override"),Qe(Ye,Je,"static","abstract"),Ue[Je]=Je,Ie[Je]=!0;if($e?.includes(Je))this.raise(this.start,We)}return Ue}tsParseInOutModifiers(Ie){this.tsParseModifiers({modified:Ie,allowedModifiers:["in","out"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:st.InvalidModifierOnTypeParameter})}tsParseClassTypeParameterModifiers(Ie){this.tsParseModifiers({modified:Ie,allowedModifiers:["const","in","out"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:st.InvalidModifierOnTypeParameter})}parseMaybeUnary(Ie,Le,$e,Ve){if(!i?.jsx&&this.tsMatchLeftRelational())return this.tsParseTypeAssertion();else return super.parseMaybeUnary(Ie,Le,$e,Ve)}tsParseTypeAssertion(){if(Ae)this.raise(this.start,st.ReservedTypeAssertion);let Ie=this.tryParse(()=>{let Le=this.startNode(),$e=this.tsTryNextParseConstantContext();return Le.typeAnnotation=$e||this.tsNextThenParseType(),this.expect(_e.relational),Le.expression=this.parseMaybeUnary(),this.finishNode(Le,"TSTypeAssertion")});if(Ie.error)return this.tsParseTypeParameters(this.tsParseConstModifier);else return Ie.node}tsParseTypeArguments(Ie=!1){let Le=this.startNode();if(Le.params=this.tsInType(()=>this.tsInNoContext(()=>(this.expect(_e.relational),this.tsParseDelimitedList("TypeParametersOrArguments",this.tsParseType.bind(this))))),Le.params.length===0)this.raise(this.start,st.EmptyTypeArguments);if(Ie&&this.curContext()!==He.tc_oTag)this.reScan_lt_gt();if(!this.tsMatchRightRelational())this.unexpected();return this.exprAllowed=!1,this.next(),this.finishNode(Le,"TSTypeParameterInstantiation")}tsParseHeritageClause(Ie){let Le=this.start,$e=this.tsParseDelimitedList("HeritageClauseElement",()=>{let Ve=this.startNode();if(Ve.expression=this.tsParseEntityName(),this.tsMatchLeftRelational())Ve.typeParameters=this.tsParseTypeArguments();return this.finishNode(Ve,"TSExpressionWithTypeArguments")});if(!$e.length)this.raise(Le,st.EmptyHeritageClauseType({token:Ie}));return $e}tsParseTypeMemberSemicolon(){if(!this.eat(_e.comma)&&!this.isLineTerminator())this.expect(_e.semi)}tsTryParseAndCatch(Ie){let Le=this.tryParse(($e)=>Ie()||$e());if(Le.aborted||!Le.node)return;return Le.node}tsParseSignatureMember(Ie,Le){return this.tsFillSignature(_e.colon,Le),this.tsParseTypeMemberSemicolon(),this.finishNode(Le,Ie)}tsParsePropertyOrMethodSignature(Ie,Le){if(this.eat(_e.question))Ie.optional=!0;let $e=Ie;if(this.match(_e.parenL)||this.tsMatchLeftRelational()){if(Le)this.raise(Ie.start,st.ReadonlyForMethodSignature);let Ve=$e;if(Ve.kind&&this.tsMatchLeftRelational())this.raise(this.start,st.AccesorCannotHaveTypeParameters);this.tsFillSignature(_e.colon,Ve),this.tsParseTypeMemberSemicolon();let We="parameters",Ue="typeAnnotation";if(Ve.kind==="get"){if(Ve[We].length>0){if(this.raise(this.start,"A 'get' accesor must not have any formal parameters."),this.isThisParam(Ve[We][0]))this.raise(this.start,st.AccesorCannotDeclareThisParameter)}}else if(Ve.kind==="set"){if(Ve[We].length!==1)this.raise(this.start,"A 'get' accesor must not have any formal parameters.");else{let Ke=Ve[We][0];if(this.isThisParam(Ke))this.raise(this.start,st.AccesorCannotDeclareThisParameter);if(Ke.type==="Identifier"&&Ke.optional)this.raise(this.start,st.SetAccesorCannotHaveOptionalParameter);if(Ke.type==="RestElement")this.raise(this.start,st.SetAccesorCannotHaveRestParameter)}if(Ve[Ue])this.raise(Ve[Ue].start,st.SetAccesorCannotHaveReturnType)}else Ve.kind="method";return this.finishNode(Ve,"TSMethodSignature")}else{let Ve=$e;if(Le)Ve.readonly=!0;let We=this.tsTryParseTypeAnnotation();if(We)Ve.typeAnnotation=We;return this.tsParseTypeMemberSemicolon(),this.finishNode(Ve,"TSPropertySignature")}}tsParseTypeMember(){let Ie=this.startNode();if(this.match(_e.parenL)||this.tsMatchLeftRelational())return this.tsParseSignatureMember("TSCallSignatureDeclaration",Ie);if(this.match(_e._new)){let $e=this.startNode();if(this.next(),this.match(_e.parenL)||this.tsMatchLeftRelational())return this.tsParseSignatureMember("TSConstructSignatureDeclaration",Ie);else return Ie.key=this.createIdentifier($e,"new"),this.tsParsePropertyOrMethodSignature(Ie,!1)}this.tsParseModifiers({modified:Ie,allowedModifiers:["readonly"],disallowedModifiers:["declare","abstract","private","protected","public","static","override"]});let Le=this.tsTryParseIndexSignature(Ie);if(Le)return Le;if(this.parsePropertyName(Ie),!Ie.computed&&Ie.key.type==="Identifier"&&(Ie.key.name==="get"||Ie.key.name==="set")&&this.tsTokenCanFollowModifier())Ie.kind=Ie.key.name,this.parsePropertyName(Ie);return this.tsParsePropertyOrMethodSignature(Ie,!!Ie.readonly)}tsParseList(Ie,Le){let $e=[];while(!this.tsIsListTerminator(Ie))$e.push(Le());return $e}tsParseObjectTypeMembers(){this.expect(_e.braceL);let Ie=this.tsParseList("TypeMembers",this.tsParseTypeMember.bind(this));return this.expect(_e.braceR),Ie}tsParseInterfaceDeclaration(Ie,Le={}){if(this.hasFollowingLineBreak())return null;if(this.expectContextual("interface"),Le.declare)Ie.declare=!0;if(Ze(this.type)){Ie.id=this.parseIdent(),this.checkLValSimple(Ie.id,ft.BIND_TS_INTERFACE);let Ve=this.currentScope();this.maybeExportDefined(Ve,Ie.id.name)}else Ie.id=null,this.raise(this.start,st.MissingInterfaceName);if(Ie.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this)),this.eat(_e._extends))Ie.extends=this.tsParseHeritageClause("extends");let $e=this.startNode();return $e.body=this.tsParseInterfaceBody(),Ie.body=this.finishNode($e,"TSInterfaceBody"),this.finishNode(Ie,"TSInterfaceDeclaration")}tsParseInterfaceBody(){this.expect(_e.braceL);let Ie=this.inType;this.inType=!0;let Le=this.tsParseList("TypeMembers",this.tsParseTypeMember.bind(this));return this.inType=Ie,this.expect(_e.braceR),Le}tsParseAbstractDeclaration(Ie){if(this.match(_e._class))return Ie.abstract=!0,this.parseClass(Ie,!0);else if(this.ts_isContextual(Ge.interface)){if(!this.hasFollowingLineBreak())return Ie.abstract=!0,this.tsParseInterfaceDeclaration(Ie)}else this.unexpected(Ie.start)}tsIsDeclarationStart(){return at(this.type)}tsParseExpressionStatement(Ie,Le){switch(Le.name){case"declare":{let $e=this.tsTryParseDeclare(Ie);if($e)return $e.declare=!0,$e;break}case"global":if(this.match(_e.braceL)){this.enterScope(fr);let $e=Ie;return $e.global=!0,$e.id=Le,$e.body=this.tsParseModuleBlock(),super.exitScope(),this.finishNode($e,"TSModuleDeclaration")}break;default:return this.tsParseDeclaration(Ie,Le.name,!1)}}tsParseModuleReference(){return this.tsIsExternalModuleReference()?this.tsParseExternalModuleReference():this.tsParseEntityName(!1)}tsIsExportDefaultSpecifier(){let{type:Ie}=this,Le=this.isAsyncFunction(),$e=this.isLet();if(Ze(Ie)){if(Le&&!this.containsEsc||$e)return!1;if((Ie===Ge.type||Ie===Ge.interface)&&!this.containsEsc){let Ue=this.lookahead();if(Ze(Ue.type)&&!this.isContextualWithState("from",Ue)||Ue.type===_e.braceL)return!1}}else if(!this.match(_e._default))return!1;let Ve=this.nextTokenStart(),We=this.isUnparsedContextual(Ve,"from");if(this.input.charCodeAt(Ve)===44||Ze(this.type)&&We)return!0;if(this.match(_e._default)&&We){let Ue=this.input.charCodeAt(this.nextTokenStartSince(Ve+4));return Ue===34||Ue===39}return!1}tsInAmbientContext(Ie){let Le=this.isAmbientContext;this.isAmbientContext=!0;try{return Ie()}finally{this.isAmbientContext=Le}}tsCheckLineTerminator(Ie){if(Ie){if(this.hasFollowingLineBreak())return!1;return this.next(),!0}return!this.isLineTerminator()}tsParseModuleOrNamespaceDeclaration(Ie,Le=!1){if(Ie.id=this.parseIdent(),!Le)this.checkLValSimple(Ie.id,ft.BIND_TS_NAMESPACE);if(this.eat(_e.dot)){let $e=this.startNode();this.tsParseModuleOrNamespaceDeclaration($e,!0),Ie.body=$e}else this.enterScope(fr),Ie.body=this.tsParseModuleBlock(),super.exitScope();return this.finishNode(Ie,"TSModuleDeclaration")}checkLValSimple(Ie,Le=ft.BIND_NONE,$e){while(Ie.type==="TSNonNullExpression"||Ie.type==="TSAsExpression"||Ie.type==="TSSatisfiesExpression"||Ie.type==="TSTypeAssertion")Ie=Ie.expression;return super.checkLValSimple(Ie,Le,$e)}isSimpleAssignTarget(Ie){while(Ie.type==="TSNonNullExpression"||Ie.type==="TSAsExpression"||Ie.type==="TSSatisfiesExpression"||Ie.type==="TSTypeAssertion")Ie=Ie.expression;return super.isSimpleAssignTarget(Ie)}tsParseTypeAliasDeclaration(Ie){Ie.id=this.parseIdent(),this.checkLValSimple(Ie.id,ft.BIND_TS_TYPE);let Le=this.currentScope();return this.maybeExportDefined(Le,Ie.id.name),Ie.typeAnnotation=this.tsInType(()=>{if(Ie.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this)),this.expect(_e.eq),this.ts_isContextual(Ge.interface)&&this.lookahead().type!==_e.dot){let $e=this.startNode();return this.next(),this.finishNode($e,"TSIntrinsicKeyword")}return this.tsParseType()}),this.semicolon(),this.finishNode(Ie,"TSTypeAliasDeclaration")}tsParseDeclaration(Ie,Le,$e){switch(Le){case"abstract":if(this.tsCheckLineTerminator($e)&&(this.match(_e._class)||Ze(this.type)))return this.tsParseAbstractDeclaration(Ie);break;case"module":if(this.tsCheckLineTerminator($e)){if(this.match(_e.string))return this.tsParseAmbientExternalModuleDeclaration(Ie);else if(Ze(this.type))return this.tsParseModuleOrNamespaceDeclaration(Ie)}break;case"namespace":if(this.tsCheckLineTerminator($e)&&Ze(this.type))return this.tsParseModuleOrNamespaceDeclaration(Ie);break;case"type":if(this.tsCheckLineTerminator($e)&&Ze(this.type))return this.tsParseTypeAliasDeclaration(Ie);break}}tsTryParseExportDeclaration(){return this.tsParseDeclaration(this.startNode(),this.value,!0)}tsParseImportEqualsDeclaration(Ie,Le){Ie.isExport=Le||!1,Ie.id=this.parseIdent(),this.checkLValSimple(Ie.id,ft.BIND_LEXICAL),super.expect(_e.eq);let $e=this.tsParseModuleReference();if(Ie.importKind==="type"&&$e.type!=="TSExternalModuleReference")this.raise($e.start,st.ImportAliasHasImportType);return Ie.moduleReference=$e,super.semicolon(),this.finishNode(Ie,"TSImportEqualsDeclaration")}isExportDefaultSpecifier(){if(this.tsIsDeclarationStart())return!1;let{type:Ie}=this;if(Ze(Ie)){if(this.isContextual("async")||this.isContextual("let"))return!1;if((Ie===Ge.type||Ie===Ge.interface)&&!this.containsEsc){let Ve=this.lookahead();if(Ze(Ve.type)&&!this.isContextualWithState("from",Ve)||Ve.type===_e.braceL)return!1}}else if(!this.match(_e._default))return!1;let Le=this.nextTokenStart(),$e=this.isUnparsedContextual(Le,"from");if(this.input.charCodeAt(Le)===44||Ze(this.type)&&$e)return!0;if(this.match(_e._default)&&$e){let Ve=this.input.charCodeAt(this.nextTokenStartSince(Le+4));return Ve===34||Ve===39}return!1}parseTemplate({isTagged:Ie=!1}={}){let Le=this.startNode();this.next(),Le.expressions=[];let $e=this.parseTemplateElement({isTagged:Ie});Le.quasis=[$e];while(!$e.tail){if(this.type===_e.eof)this.raise(this.pos,"Unterminated template literal");this.expect(_e.dollarBraceL),Le.expressions.push(this.inType?this.tsParseType():this.parseExpression()),this.expect(_e.braceR),Le.quasis.push($e=this.parseTemplateElement({isTagged:Ie}))}return this.next(),this.finishNode(Le,"TemplateLiteral")}parseFunction(Ie,Le,$e,Ve,We){if(this.initFunction(Ie),this.ecmaVersion>=9||this.ecmaVersion>=6&&!Ve){if(this.type===_e.star&&Le&ko)this.unexpected();Ie.generator=this.eat(_e.star)}if(this.ecmaVersion>=8)Ie.async=!!Ve;if(Le&Ur)Ie.id=Le&gd&&this.type!==_e.name?null:this.parseIdent();let Ue=this.yieldPos,Ke=this.awaitPos,Qe=this.awaitIdentPos,Ye=this.maybeInArrowParameters;if(this.maybeInArrowParameters=!1,this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(ci(Ie.async,Ie.generator)),!(Le&Ur))Ie.id=this.type===_e.name?this.parseIdent():null;this.parseFunctionParams(Ie);let Je=Le&Ur;if(this.parseFunctionBody(Ie,$e,!1,We,{isFunctionDeclaration:Je}),Je&&this.isAmbientContext&&Ie.id){if(this.currentScope().flags&ft.SCOPE_TOP)this.declareName(Ie.id.name,ft.BIND_FLAGS_TS_EXPORT_ONLY,Ie.id.start)}if(this.yieldPos=Ue,this.awaitPos=Ke,this.awaitIdentPos=Qe,Le&Ur&&Ie.id&&!(Le&ko))if(Ie.body)this.checkLValSimple(Ie.id,this.strict||Ie.generator||Ie.async?this.treatFunctionsAsVar?ft.BIND_VAR:ft.BIND_LEXICAL:ft.BIND_FUNCTION);else this.checkLValSimple(Ie.id,ft.BIND_NONE);return this.maybeInArrowParameters=Ye,this.finishNode(Ie,Je?"FunctionDeclaration":"FunctionExpression")}parseFunctionBody(Ie,Le=!1,$e=!1,Ve=!1,We){if(this.match(_e.colon))Ie.returnType=this.tsParseTypeOrTypePredicateAnnotation(_e.colon);let Ue=We?.isFunctionDeclaration?"TSDeclareFunction":We?.isClassMethod?"TSDeclareMethod":void 0;if(Ue&&!this.match(_e.braceL)&&this.isLineTerminator())return this.exitScope(),this.finishNode(Ie,Ue);if(Ue==="TSDeclareFunction"&&this.isAmbientContext){if(this.raise(Ie.start,st.DeclareFunctionHasImplementation),Ie.declare)return super.parseFunctionBody(Ie,Le,$e,!1),this.finishNode(Ie,Ue)}return super.parseFunctionBody(Ie,Le,$e,Ve),Ie}parseNew(){if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword new");let Ie=this.startNode(),Le=this.parseIdent(!0);if(this.ecmaVersion>=6&&this.eat(_e.dot)){Ie.meta=Le;let Ke=this.containsEsc;if(Ie.property=this.parseIdent(!0),Ie.property.name!=="target")this.raiseRecoverable(Ie.property.start,"The only valid meta property for new is 'new.target'");if(Ke)this.raiseRecoverable(Ie.start,"'new.target' must not contain escaped characters");if(!this.allowNewDotTarget)this.raiseRecoverable(Ie.start,"'new.target' can only be used in functions and class static block");return this.finishNode(Ie,"MetaProperty")}let $e=this.start,Ve=this.startLoc,We=this.type===_e._import;if(Ie.callee=this.parseSubscripts(this.parseExprAtom(),$e,Ve,!0,!1),We&&Ie.callee.type==="ImportExpression")this.raise($e,"Cannot use new with import()");let{callee:Ue}=Ie;if(Ue.type==="TSInstantiationExpression"&&!Ue.extra?.parenthesized)Ie.typeArguments=Ue.typeArguments,Ie.callee=Ue.expression;if(this.eat(_e.parenL))Ie.arguments=this.parseExprList(_e.parenR,this.ecmaVersion>=8,!1);else Ie.arguments=[];return this.finishNode(Ie,"NewExpression")}parseExprOp(Ie,Le,$e,Ve,We){if(_e._in.binop>Ve&&!this.hasPrecedingLineBreak()){let Ue;if(this.isContextual("as"))Ue="TSAsExpression";if(this.isContextual("satisfies"))Ue="TSSatisfiesExpression";if(Ue){let Ke=this.startNodeAt(Le,$e);Ke.expression=Ie;let Qe=this.tsTryNextParseConstantContext();if(Qe)Ke.typeAnnotation=Qe;else Ke.typeAnnotation=this.tsNextThenParseType();return this.finishNode(Ke,Ue),this.reScan_lt_gt(),this.parseExprOp(Ke,Le,$e,Ve,We)}}return super.parseExprOp(Ie,Le,$e,Ve,We)}parseImportSpecifiers(){let Ie=[],Le=!0;if(De.tokenIsIdentifier(this.type)){if(Ie.push(this.parseImportDefaultSpecifier()),!this.eat(_e.comma))return Ie}if(this.type===_e.star)return Ie.push(this.parseImportNamespaceSpecifier()),Ie;this.expect(_e.braceL);while(!this.eat(_e.braceR)){if(!Le){if(this.expect(_e.comma),this.afterTrailingComma(_e.braceR))break}else Le=!1;Ie.push(this.parseImportSpecifier())}return Ie}parseImport(Ie){let Le=this.lookahead();if(Ie.importKind="value",this.importOrExportOuterKind="value",Ze(Le.type)||this.match(_e.star)||this.match(_e.braceL)){let $e=this.lookahead(2);if($e.type!==_e.comma&&!this.isContextualWithState("from",$e)&&$e.type!==_e.eq&&this.ts_eatContextualWithState("type",1,Le))this.importOrExportOuterKind="type",Ie.importKind="type",Le=this.lookahead(),$e=this.lookahead(2);if(Ze(Le.type)&&$e.type===_e.eq){this.next();let Ve=this.tsParseImportEqualsDeclaration(Ie);return this.importOrExportOuterKind="value",Ve}}if(this.next(),this.type===_e.string)Ie.specifiers=[],Ie.source=this.parseExprAtom();else Ie.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),Ie.source=this.type===_e.string?this.parseExprAtom():this.unexpected();if(this.parseMaybeImportAttributes(Ie),this.semicolon(),this.finishNode(Ie,"ImportDeclaration"),this.importOrExportOuterKind="value",Ie.importKind==="type"&&Ie.specifiers.length>1&&Ie.specifiers[0].type==="ImportDefaultSpecifier")this.raise(Ie.start,st.TypeImportCannotSpecifyDefaultAndNamed);return Ie}parseExportDefaultDeclaration(){if(this.isAbstractClass()){let Ie=this.startNode();return this.next(),Ie.abstract=!0,this.parseClass(Ie,!0)}if(this.match(Ge.interface)){let Ie=this.tsParseInterfaceDeclaration(this.startNode());if(Ie)return Ie}return super.parseExportDefaultDeclaration()}parseExportAllDeclaration(Ie,Le){if(this.ecmaVersion>=11)if(this.eatContextual("as"))Ie.exported=this.parseModuleExportName(),this.checkExport(Le,Ie.exported,this.lastTokStart);else Ie.exported=null;if(this.expectContextual("from"),this.type!==_e.string)this.unexpected();return Ie.source=this.parseExprAtom(),this.parseMaybeImportAttributes(Ie),this.semicolon(),this.finishNode(Ie,"ExportAllDeclaration")}parseDynamicImport(Ie){if(this.next(),Ie.source=this.parseMaybeAssign(),this.eat(_e.comma)){let Le=this.parseExpression();Ie.arguments=[Le]}if(!this.eat(_e.parenR)){let Le=this.start;if(this.eat(_e.comma)&&this.eat(_e.parenR))this.raiseRecoverable(Le,"Trailing comma is not allowed in import()");else this.unexpected(Le)}return this.finishNode(Ie,"ImportExpression")}parseExport(Ie,Le){let $e=this.lookahead();if(this.ts_eatWithState(_e._import,2,$e)){if(this.ts_isContextual(Ge.type)&&this.lookaheadCharCode()!==61)Ie.importKind="type",this.importOrExportOuterKind="type",this.next();else Ie.importKind="value",this.importOrExportOuterKind="value";let Ve=this.tsParseImportEqualsDeclaration(Ie,!0);return this.importOrExportOuterKind=void 0,Ve}else if(this.ts_eatWithState(_e.eq,2,$e)){let Ve=Ie;return Ve.expression=this.parseExpression(),this.semicolon(),this.importOrExportOuterKind=void 0,this.finishNode(Ve,"TSExportAssignment")}else if(this.ts_eatContextualWithState("as",2,$e)){let Ve=Ie;return this.expectContextual("namespace"),Ve.id=this.parseIdent(),this.semicolon(),this.importOrExportOuterKind=void 0,this.finishNode(Ve,"TSNamespaceExportDeclaration")}else{let Ve=this.lookahead(2).type;if(this.ts_isContextualWithState($e,Ge.type)&&(Ve===_e.braceL||Ve===_e.star))this.next(),this.importOrExportOuterKind="type",Ie.exportKind="type";else this.importOrExportOuterKind="value",Ie.exportKind="value";if(this.next(),this.eat(_e.star))return this.parseExportAllDeclaration(Ie,Le);if(this.eat(_e._default))return this.checkExport(Le,"default",this.lastTokStart),Ie.declaration=this.parseExportDefaultDeclaration(),this.finishNode(Ie,"ExportDefaultDeclaration");if(this.shouldParseExportStatement()){if(Ie.declaration=this.parseExportDeclaration(Ie),Ie.declaration.type==="VariableDeclaration")this.checkVariableExport(Le,Ie.declaration.declarations);else this.checkExport(Le,Ie.declaration.id,Ie.declaration.id.start);Ie.specifiers=[],Ie.source=null}else{if(Ie.declaration=null,Ie.specifiers=this.parseExportSpecifiers(Le),this.eatContextual("from")){if(this.type!==_e.string)this.unexpected();Ie.source=this.parseExprAtom(),this.parseMaybeImportAttributes(Ie)}else{for(let We of Ie.specifiers)if(this.checkUnreserved(We.local),this.checkLocalExport(We.local),We.local.type==="Literal")this.raise(We.local.start,"A string literal cannot be used as an exported binding without `from`.");Ie.source=null}this.semicolon()}return this.finishNode(Ie,"ExportNamedDeclaration")}}checkExport(Ie,Le,$e){if(!Ie)return;if(typeof Le!=="string")Le=Le.type==="Identifier"?Le.name:Le.value;Ie[Le]=!0}parseMaybeDefault(Ie,Le,$e){let Ve=super.parseMaybeDefault(Ie,Le,$e);if(Ve.type==="AssignmentPattern"&&Ve.typeAnnotation&&Ve.right.start<Ve.typeAnnotation.start)this.raise(Ve.typeAnnotation.start,st.TypeAnnotationAfterAssign);return Ve}typeCastToParameter(Ie){return Ie.expression.typeAnnotation=Ie.typeAnnotation,this.resetEndLocation(Ie.expression,Ie.typeAnnotation.end,Ie.typeAnnotation.loc?.end),Ie.expression}toAssignableList(Ie,Le){if(!Ie)Ie=[];for(let $e=0;$e<Ie.length;$e++){let Ve=Ie[$e];if(Ve?.type==="TSTypeCastExpression")Ie[$e]=this.typeCastToParameter(Ve)}return super.toAssignableList(Ie,Le)}reportReservedArrowTypeParam(Ie){if(Ie.params.length===1&&!Ie.extra?.trailingComma&&Ae)this.raise(Ie.start,st.ReservedArrowTypeParam)}parseExprAtom(Ie,Le,$e){if(this.type===Ge.jsxText)return this.jsx_parseText();else if(this.type===Ge.jsxTagStart)return this.jsx_parseElement();else if(this.type===Ge.at)return this.parseDecorators(),this.parseExprAtom();else if(Ze(this.type)){let Ve=this.potentialArrowAt===this.start,We=this.start,Ue=this.startLoc,Ke=this.containsEsc,Qe=this.parseIdent(!1);if(this.ecmaVersion>=8&&!Ke&&Qe.name==="async"&&!this.canInsertSemicolon()&&this.eat(_e._function))return this.overrideContext(je.f_expr),this.parseFunction(this.startNodeAt(We,Ue),0,!1,!0,Le);if(Ve&&!this.canInsertSemicolon()){if(this.eat(_e.arrow))return this.parseArrowExpression(this.startNodeAt(We,Ue),[Qe],!1,Le);if(this.ecmaVersion>=8&&Qe.name==="async"&&this.type===_e.name&&!Ke&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc)){if(Qe=this.parseIdent(!1),this.canInsertSemicolon()||!this.eat(_e.arrow))this.unexpected();return this.parseArrowExpression(this.startNodeAt(We,Ue),[Qe],!0,Le)}}return Qe}else return super.parseExprAtom(Ie,Le,$e)}parseExprAtomDefault(){if(Ze(this.type)){let Ie=this.potentialArrowAt===this.start,Le=this.containsEsc,$e=this.parseIdent();if(!Le&&$e.name==="async"&&!this.canInsertSemicolon()){let{type:Ve}=this;if(Ve===_e._function)return this.next(),this.parseFunction(this.startNodeAtNode($e),void 0,!0,!0);else if(Ze(Ve))if(this.lookaheadCharCode()===61){let We=this.parseIdent(!1);if(this.canInsertSemicolon()||!this.eat(_e.arrow))this.unexpected();return this.parseArrowExpression(this.startNodeAtNode($e),[We],!0)}else return $e}if(Ie&&this.match(_e.arrow)&&!this.canInsertSemicolon())return this.next(),this.parseArrowExpression(this.startNodeAtNode($e),[$e],!1);return $e}else this.unexpected()}parseIdentNode(){let Ie=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)))Ie.name=this.value;else return super.parseIdentNode();return Ie}parseVarStatement(Ie,Le,$e=!1){let{isAmbientContext:Ve}=this;this.next(),super.parseVar(Ie,!1,Le,$e||Ve),this.semicolon();let We=this.finishNode(Ie,"VariableDeclaration");if(!Ve)return We;for(let{id:Ue,init:Ke}of We.declarations){if(!Ke)continue;if(Le!=="const"||!!Ue.typeAnnotation)this.raise(Ke.start,st.InitializerNotAllowedInAmbientContext);else if(Ke.type!=="Literal"&&(Ke.type!=="TemplateLiteral"||Ke.expressions.length>0)&&!xd(Ke)&&!yd(Ke))this.raise(Ke.start,st.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference)}return We}parseStatement(Ie,Le,$e){if(this.match(Ge.at))this.parseDecorators(!0);if(this.match(_e._const)&&this.isLookaheadContextual("enum")){let Ve=this.startNode();return this.expect(_e._const),this.tsParseEnumDeclaration(Ve,{const:!0})}if(this.ts_isContextual(Ge.enum))return this.tsParseEnumDeclaration(this.startNode());if(this.ts_isContextual(Ge.interface)){let Ve=this.tsParseInterfaceDeclaration(this.startNode());if(Ve)return Ve}return super.parseStatement(Ie,Le,$e)}parseAccessModifier(){return this.tsParseModifier(["public","protected","private"])}parsePostMemberNameModifiers(Ie){if(this.eat(_e.question))Ie.optional=!0;if(Ie.readonly&&this.match(_e.parenL))this.raise(Ie.start,st.ClassMethodHasReadonly);if(Ie.declare&&this.match(_e.parenL))this.raise(Ie.start,st.ClassMethodHasDeclare)}parseExpressionStatement(Ie,Le){return(Le.type==="Identifier"?this.tsParseExpressionStatement(Ie,Le):void 0)||super.parseExpressionStatement(Ie,Le)}shouldParseExportStatement(){if(this.tsIsDeclarationStart())return!0;if(this.match(Ge.at))return!0;return super.shouldParseExportStatement()}parseConditional(Ie,Le,$e,Ve,We){if(this.eat(_e.question)){let Ue=this.startNodeAt(Le,$e);return Ue.test=Ie,Ue.consequent=this.parseMaybeAssign(),this.expect(_e.colon),Ue.alternate=this.parseMaybeAssign(Ve),this.finishNode(Ue,"ConditionalExpression")}return Ie}parseMaybeConditional(Ie,Le){let $e=this.start,Ve=this.startLoc,We=this.parseExprOps(Ie,Le);if(this.checkExpressionErrors(Le))return We;if(!this.maybeInArrowParameters||!this.match(_e.question))return this.parseConditional(We,$e,Ve,Ie,Le);let Ue=this.tryParse(()=>this.parseConditional(We,$e,Ve,Ie,Le));if(!Ue.node){if(Ue.error)this.setOptionalParametersError(Le,Ue.error);return We}return Ue.node}parseParenItem(Ie){let Le=this.start,$e=this.startLoc;if(Ie=super.parseParenItem(Ie),this.eat(_e.question))Ie.optional=!0,this.resetEndLocation(Ie);if(this.match(_e.colon)){let Ve=this.startNodeAt(Le,$e);return Ve.expression=Ie,Ve.typeAnnotation=this.tsParseTypeAnnotation(),this.finishNode(Ve,"TSTypeCastExpression")}return Ie}parseExportDeclaration(Ie){if(!this.isAmbientContext&&this.ts_isContextual(Ge.declare))return this.tsInAmbientContext(()=>this.parseExportDeclaration(Ie));let Le=this.start,$e=this.startLoc,Ve=this.eatContextual("declare");if(Ve&&(this.ts_isContextual(Ge.declare)||!this.shouldParseExportStatement()))this.raise(this.start,st.ExpectedAmbientAfterExportDeclare);let Ue=Ze(this.type)&&this.tsTryParseExportDeclaration()||this.parseStatement(null);if(!Ue)return null;if(Ue.type==="TSInterfaceDeclaration"||Ue.type==="TSTypeAliasDeclaration"||Ve)Ie.exportKind="type";if(Ve)this.resetStartLocation(Ue,Le,$e),Ue.declare=!0;return Ue}parseClassId(Ie,Le){if(!Le&&this.isContextual("implements"))return;super.parseClassId(Ie,Le);let $e=this.tsTryParseTypeParameters(this.tsParseClassTypeParameterModifiers.bind(this));if($e)Ie.typeParameters=$e}parseClassPropertyAnnotation(Ie){if(!Ie.optional){if(this.value==="!"&&this.eat(_e.prefix))Ie.definite=!0;else if(this.eat(_e.question))Ie.optional=!0}let Le=this.tsTryParseTypeAnnotation();if(Le)Ie.typeAnnotation=Le}parseClassField(Ie){if(Ie.key.type==="PrivateIdentifier"){if(Ie.abstract)this.raise(Ie.start,st.PrivateElementHasAbstract);if(Ie.accessibility)this.raise(Ie.start,st.PrivateElementHasAccessibility({modifier:Ie.accessibility}));this.parseClassPropertyAnnotation(Ie)}else{if(this.parseClassPropertyAnnotation(Ie),this.isAmbientContext&&!(Ie.readonly&&!Ie.typeAnnotation)&&this.match(_e.eq))this.raise(this.start,st.DeclareClassFieldHasInitializer);if(Ie.abstract&&this.match(_e.eq)){let{key:$e}=Ie;this.raise(this.start,st.AbstractPropertyHasInitializer({propertyName:$e.type==="Identifier"&&!Ie.computed?$e.name:`[${this.input.slice($e.start,$e.end)}]`}))}}return super.parseClassField(Ie)}parseClassMethod(Ie,Le,$e,Ve){let We=Ie.kind==="constructor",Ue=Ie.key.type==="PrivateIdentifier",Ke=this.tsTryParseTypeParameters(this.tsParseConstModifier);if(Ue){if(Ke)Ie.typeParameters=Ke;if(Ie.accessibility)this.raise(Ie.start,st.PrivateMethodsHasAccessibility({modifier:Ie.accessibility}))}else if(Ke&&We)this.raise(Ke.start,st.ConstructorHasTypeParameters);let{declare:Qe=!1,kind:Ye}=Ie;if(Qe&&(Ye==="get"||Ye==="set"))this.raise(Ie.start,st.DeclareAccessor({kind:Ye}));if(Ke)Ie.typeParameters=Ke;let Je=Ie.key;if(Ie.kind==="constructor"){if(Le)this.raise(Je.start,"Constructor can't be a generator");if($e)this.raise(Je.start,"Constructor can't be an async method")}else if(Ie.static&&vo(Ie,"prototype"))this.raise(Je.start,"Classes may not have a static property named prototype");let ct=Ie.value=this.parseMethod(Le,$e,Ve,!0,Ie);if(Ie.kind==="get"&&ct.params.length!==0)this.raiseRecoverable(ct.start,"getter should have no params");if(Ie.kind==="set"&&ct.params.length!==1)this.raiseRecoverable(ct.start,"setter should have exactly one param");if(Ie.kind==="set"&&ct.params[0].type==="RestElement")this.raiseRecoverable(ct.params[0].start,"Setter cannot use rest params");return this.finishNode(Ie,"MethodDefinition")}isClassMethod(){return this.match(_e.relational)}parseClassElement(Ie){if(this.eat(_e.semi))return null;let Le=this.startNode(),$e="",Ve=!1,We=!1,Ue="method",Ke=!1,Qe=["declare","private","public","protected","accessor","override","abstract","readonly","static"],Ye=this.tsParseModifiers({modified:Le,allowedModifiers:Qe,disallowedModifiers:["in","out"],stopOnStartOfClassStaticBlock:!0,errorTemplate:st.InvalidModifierOnTypeParameterPositions});Ke=Boolean(Ye.static);let Je=()=>{if(this.tsIsStartOfStaticBlocks()){if(this.next(),this.next(),this.tsHasSomeModifiers(Le,Qe))this.raise(this.start,st.StaticBlockCannotHaveModifier);if(this.ecmaVersion>=13)return super.parseClassStaticBlock(Le),Le}else{let ct=this.tsTryParseIndexSignature(Le);if(ct){if(Le.abstract)this.raise(Le.start,st.IndexSignatureHasAbstract);if(Le.accessibility)this.raise(Le.start,st.IndexSignatureHasAccessibility({modifier:Le.accessibility}));if(Le.declare)this.raise(Le.start,st.IndexSignatureHasDeclare);if(Le.override)this.raise(Le.start,st.IndexSignatureHasOverride);return ct}if(!this.inAbstractClass&&Le.abstract)this.raise(Le.start,st.NonAbstractClassHasAbstractMethod);if(Le.override){if(!Ie)this.raise(Le.start,st.OverrideNotInSubClass)}if(Le.static=Ke,Ke){if(!(this.isClassElementNameStart()||this.type===_e.star))$e="static"}if(!$e&&this.ecmaVersion>=8&&this.eatContextual("async"))if((this.isClassElementNameStart()||this.type===_e.star)&&!this.canInsertSemicolon())We=!0;else $e="async";if(!$e&&(this.ecmaVersion>=9||!We)&&this.eat(_e.star))Ve=!0;if(!$e&&!We&&!Ve){let ut=this.value;if(this.eatContextual("get")||this.eatContextual("set"))if(this.isClassElementNameStart())Ue=ut;else $e=ut}if($e)Le.computed=!1,Le.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),Le.key.name=$e,this.finishNode(Le.key,"Identifier");else this.parseClassElementName(Le);if(this.parsePostMemberNameModifiers(Le),this.isClassMethod()||this.ecmaVersion<13||this.type===_e.parenL||Ue!=="method"||Ve||We){let ut=!Le.static&&vo(Le,"constructor"),mt=ut&&Ie;if(ut&&Ue!=="method")this.raise(Le.key.start,"Constructor can't have get/set modifier");Le.kind=ut?"constructor":Ue,this.parseClassMethod(Le,Ve,We,mt)}else this.parseClassField(Le);return Le}};if(Le.declare)this.tsInAmbientContext(Je);else Je();return Le}isClassElementNameStart(){if(this.tsIsIdentifier())return!0;return super.isClassElementNameStart()}parseClassSuper(Ie){if(super.parseClassSuper(Ie),Ie.superClass&&(this.tsMatchLeftRelational()||this.match(_e.bitShift)))Ie.superTypeParameters=this.tsParseTypeArgumentsInExpression();if(this.eatContextual("implements"))Ie.implements=this.tsParseHeritageClause("implements")}parseFunctionParams(Ie){let Le=this.tsTryParseTypeParameters(this.tsParseConstModifier);if(Le)Ie.typeParameters=Le;super.parseFunctionParams(Ie)}parseVarId(Ie,Le){if(super.parseVarId(Ie,Le),Ie.id.type==="Identifier"&&!this.hasPrecedingLineBreak()&&this.value==="!"&&this.eat(_e.prefix))Ie.definite=!0;let $e=this.tsTryParseTypeAnnotation();if($e)Ie.id.typeAnnotation=$e,this.resetEndLocation(Ie.id)}parseArrowExpression(Ie,Le,$e,Ve){if(this.match(_e.colon))Ie.returnType=this.tsParseTypeAnnotation();let We=this.yieldPos,Ue=this.awaitPos,Ke=this.awaitIdentPos;this.enterScope(ci($e,!1)|ft.SCOPE_ARROW),this.initFunction(Ie);let Qe=this.maybeInArrowParameters;if(this.ecmaVersion>=8)Ie.async=!!$e;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.maybeInArrowParameters=!0,Ie.params=this.toAssignableList(Le,!0),this.maybeInArrowParameters=!1,this.parseFunctionBody(Ie,!0,!1,Ve),this.yieldPos=We,this.awaitPos=Ue,this.awaitIdentPos=Ke,this.maybeInArrowParameters=Qe,this.finishNode(Ie,"ArrowFunctionExpression")}parseYield(Ie){if(!this.yieldPos)this.yieldPos=this.start;let Le=this.startNode();this.next();let $e=this.tsMatchLeftRelational();if(!(!this.match(_e.semi)&&!this.canInsertSemicolon()&&(this.match(_e.star)||this.type.startsExpr||$e)))return Le.delegate=!1,Le.argument=null,this.finishNode(Le,"YieldExpression");return Le.delegate=this.eat(_e.star),Le.argument=this.parseMaybeAssign(Ie),this.finishNode(Le,"YieldExpression")}parseMaybeAssignOrigin(Ie,Le,$e){if(this.isContextual("yield"))if(this.inGenerator)return this.parseYield(Ie);else this.exprAllowed=!1;let Ve=!1,We=-1,Ue=-1,Ke=-1;if(Le)We=Le.parenthesizedAssign,Ue=Le.trailingComma,Ke=Le.doubleProto,Le.parenthesizedAssign=Le.trailingComma=-1;else Le=new hr,Ve=!0;let Qe=this.start,Ye=this.startLoc;if(this.type===_e.parenL||Ze(this.type))this.potentialArrowAt=this.start,this.potentialArrowInForAwait=Ie==="await";let Je=this.parseMaybeConditional(Ie,Le);if($e)Je=$e.call(this,Je,Qe,Ye);if(this.type.isAssign){let ct=this.startNodeAt(Qe,Ye);if(ct.operator=this.value,this.type===_e.eq)Je=this.toAssignable(Je,!0,Le,!0);if(!Ve)Le.parenthesizedAssign=Le.trailingComma=Le.doubleProto=-1;if(Le.shorthandAssign>=Je.start)Le.shorthandAssign=-1;if(!this.maybeInArrowParameters)if(this.type===_e.eq)this.checkLValPattern(Je);else this.checkLValSimple(Je);if(ct.left=Je,this.next(),ct.right=this.parseMaybeAssign(Ie),Ke>-1)Le.doubleProto=Ke;return this.finishNode(ct,"AssignmentExpression")}else if(Ve)this.checkExpressionErrors(Le,!0);if(We>-1)Le.parenthesizedAssign=We;if(Ue>-1)Le.trailingComma=Ue;return Je}parseMaybeAssign(Ie,Le,$e){let Ve,We;if(i?.jsx&&(this.matchJsx("jsxTagStart")||this.tsMatchLeftRelational())){if(Ve=this.tryParse(()=>this.parseMaybeAssignOrigin(Ie,Le,$e)),!Ve.error)return Ve.node;let Qe=this.context,Ye=Qe[Qe.length-1],Je=Qe[Qe.length-2];if(Ye===De.tokContexts.tc_oTag&&Je===De.tokContexts.tc_expr)this.parseEffects.pop(Qe),this.parseEffects.pop(Qe);else if(Ye===De.tokContexts.tc_oTag||Ye===De.tokContexts.tc_expr)this.parseEffects.pop(Qe)}if(!Ve?.error&&!this.tsMatchLeftRelational())return this.parseMaybeAssignOrigin(Ie,Le,$e);let Ue,Ke=this.tryParse((Qe)=>{Ue=this.tsParseTypeParameters(this.tsParseConstModifier);let Ye=this.parseMaybeAssignOrigin(Ie,Le,$e);if(Ye.type!=="ArrowFunctionExpression"||Ye.extra?.parenthesized)Qe();if(Ue?.params.length!==0)this.resetStartLocationFromNode(Ye,Ue);return Ye.typeParameters=Ue,Ye});if(!Ke.error&&!Ke.aborted){if(Ue)this.reportReservedArrowTypeParam(Ue);return Ke.node}if(!Ve){if(Ao(!0),We=this.tryParse(()=>this.parseMaybeAssignOrigin(Ie,Le,$e)),!We.error)return We.node}if(Ve?.thrown)throw this.selectTryParseResult(Ve),Ve.error;if(Ke.thrown)throw this.selectTryParseResult(Ke),Ke.error;if(We?.thrown)throw this.selectTryParseResult(We),We.error;throw Ve?.error||Ke.error||We?.error}parseAssignableListItem(Ie){let Le=[];while(this.match(Ge.at))Le.push(this.parseDecorator());let $e=this.start,Ve=this.startLoc,We,Ue=!1,Ke=!1;if(Ie!==void 0){let Je={};if(this.tsParseModifiers({modified:Je,allowedModifiers:["public","private","protected","override","readonly"]}),We=Je.accessibility,Ke=Je.override,Ue=Je.readonly,Ie===!1&&(We||Ue||Ke))this.raise(Ve.column,st.UnexpectedParameterModifier)}let Qe=this.parseMaybeDefault($e,Ve);this.parseBindingListItem(Qe);let Ye=this.parseMaybeDefault(Qe.start,Qe.loc.start,Qe);if(Le.length)Ye.decorators=Le;if(We||Ue||Ke){let Je=this.startNodeAt($e,Ve);if(We)Je.accessibility=We;if(Ue)Je.readonly=Ue;if(Ke)Je.override=Ke;if(Ye.type!=="Identifier"&&Ye.type!=="AssignmentPattern")this.raise(Je.start,st.UnsupportedParameterPropertyKind);return Je.parameter=Ye,this.finishNode(Je,"TSParameterProperty")}return Ye}checkLValInnerPattern(Ie,Le=ft.BIND_NONE,$e){switch(Ie.type){case"TSParameterProperty":this.checkLValInnerPattern(Ie.parameter,Le,$e);break;default:{super.checkLValInnerPattern(Ie,Le,$e);break}}}parseBindingListItem(Ie){if(this.eat(_e.question)){if(Ie.type!=="Identifier"&&!this.isAmbientContext&&!this.inType)this.raise(Ie.start,st.PatternIsOptional);Ie.optional=!0}let Le=this.tsTryParseTypeAnnotation();if(Le)Ie.typeAnnotation=Le;return this.resetEndLocation(Ie),Ie}isAssignable(Ie,Le){switch(Ie.type){case"TSTypeCastExpression":return this.isAssignable(Ie.expression,Le);case"TSParameterProperty":return!0;case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":return!0;case"ObjectExpression":{let $e=Ie.properties.length-1;return Ie.properties.every((Ve,We)=>Ve.type!=="ObjectMethod"&&(We===$e||Ve.type!=="SpreadElement")&&this.isAssignable(Ve))}case"Property":case"ObjectProperty":return this.isAssignable(Ie.value);case"SpreadElement":return this.isAssignable(Ie.argument);case"ArrayExpression":return Ie.elements.every(($e)=>$e===null||this.isAssignable($e));case"AssignmentExpression":return Ie.operator==="=";case"ParenthesizedExpression":return this.isAssignable(Ie.expression);case"MemberExpression":case"OptionalMemberExpression":return!Le;default:return!1}}toAssignable(Ie,Le=!1,$e=new hr,Ve=!1){switch(Ie.type){case"ParenthesizedExpression":return this.toAssignableParenthesizedExpression(Ie,Le,$e,Ve);case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":if(Le);else this.raise(Ie.start,st.UnexpectedTypeCastInParameter);let We=this.toAssignable(Ie.expression,Le,$e,Ve);if(Ve)return Ie.expression=We,Ie;return We;case"MemberExpression":break;case"AssignmentExpression":if(!Le&&Ie.left.type==="TSTypeCastExpression")Ie.left=this.typeCastToParameter(Ie.left);return super.toAssignable(Ie,Le,$e);case"TSTypeCastExpression":return this.typeCastToParameter(Ie);default:return super.toAssignable(Ie,Le,$e)}return Ie}toAssignableParenthesizedExpression(Ie,Le,$e,Ve=!1){switch(Ie.expression.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":case"ParenthesizedExpression":let We=this.toAssignable(Ie.expression,Le,$e,Ve);if(Ve)return Ie.expression=We,Ie;return We;default:return super.toAssignable(Ie,Le,$e)}}parseBindingAtom(){switch(this.type){case _e._this:return this.parseIdent(!0);default:return super.parseBindingAtom()}}shouldParseArrow(Ie){let Le;if(this.match(_e.colon))Le=Ie.every(($e)=>this.isAssignable($e,!0));else Le=!this.canInsertSemicolon();if(Le){if(this.match(_e.colon)){let $e=this.tryParse((Ve)=>{let We=this.tsParseTypeOrTypePredicateAnnotation(_e.colon);if(this.canInsertSemicolon()||!this.match(_e.arrow))Ve();return We});if($e.aborted)return this.shouldParseArrowReturnType=void 0,!1;if(!$e.thrown)this.shouldParseArrowReturnType=$e.node}if(!this.match(_e.arrow))return this.shouldParseArrowReturnType=void 0,!1;return!0}return this.shouldParseArrowReturnType=void 0,Le}parseParenArrowList(Ie,Le,$e,Ve){let We=this.startNodeAt(Ie,Le);return We.returnType=this.shouldParseArrowReturnType,this.shouldParseArrowReturnType=void 0,this.parseArrowExpression(We,$e,!1,Ve)}parseParenAndDistinguishExpression(Ie,Le){let $e=this.start,Ve=this.startLoc,We,Ue=this.ecmaVersion>=8;if(this.ecmaVersion>=6){let Ke=this.maybeInArrowParameters;this.maybeInArrowParameters=!0,this.next();let Qe=this.start,Ye=this.startLoc,Je=[],ct=!0,ut=!1,mt=new hr,Bt=this.yieldPos,Lt=this.awaitPos,Wt;this.yieldPos=0,this.awaitPos=0;while(this.type!==_e.parenR)if(ct?ct=!1:this.expect(_e.comma),Ue&&this.afterTrailingComma(_e.parenR,!0)){ut=!0;break}else if(this.type===_e.ellipsis){if(Wt=this.start,Je.push(this.parseParenItem(this.parseRestBinding())),this.type===_e.comma)this.raise(this.start,"Comma is not permitted after the rest element");break}else Je.push(this.parseMaybeAssign(!1,mt,this.parseParenItem));let Qt=this.lastTokEnd,Dt=this.lastTokEndLoc;if(this.expect(_e.parenR),this.maybeInArrowParameters=Ke,Ie&&this.shouldParseArrow(Je)&&this.eat(_e.arrow))return this.checkPatternErrors(mt,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=Bt,this.awaitPos=Lt,this.parseParenArrowList($e,Ve,Je,Le);if(!Je.length||ut)this.unexpected(this.lastTokStart);if(Wt)this.unexpected(Wt);if(this.checkExpressionErrors(mt,!0),this.yieldPos=Bt||this.yieldPos,this.awaitPos=Lt||this.awaitPos,Je.length>1)We=this.startNodeAt(Qe,Ye),We.expressions=Je,this.finishNodeAt(We,"SequenceExpression",Qt,Dt);else We=Je[0]}else We=this.parseParenExpression();if(this.options.preserveParens){let Ke=this.startNodeAt($e,Ve);return Ke.expression=We,this.finishNode(Ke,"ParenthesizedExpression")}else return We}parseTaggedTemplateExpression(Ie,Le,$e,Ve){let We=this.startNodeAt(Le,$e);if(We.tag=Ie,We.quasi=this.parseTemplate({isTagged:!0}),Ve)this.raise(Le,"Tagged Template Literals are not allowed in optionalChain.");return this.finishNode(We,"TaggedTemplateExpression")}shouldParseAsyncArrow(){if(this.match(_e.colon)){let Ie=this.tryParse((Le)=>{let $e=this.tsParseTypeOrTypePredicateAnnotation(_e.colon);if(this.canInsertSemicolon()||!this.match(_e.arrow))Le();return $e});if(Ie.aborted)return this.shouldParseAsyncArrowReturnType=void 0,!1;if(!Ie.thrown)return this.shouldParseAsyncArrowReturnType=Ie.node,!this.canInsertSemicolon()&&this.eat(_e.arrow)}else return!this.canInsertSemicolon()&&this.eat(_e.arrow)}parseSubscriptAsyncArrow(Ie,Le,$e,Ve){let We=this.startNodeAt(Ie,Le);return We.returnType=this.shouldParseAsyncArrowReturnType,this.shouldParseAsyncArrowReturnType=void 0,this.parseArrowExpression(We,$e,!0,Ve)}parseExprList(Ie,Le,$e,Ve){let We=[],Ue=!0;while(!this.eat(Ie)){if(!Ue){if(this.expect(_e.comma),Le&&this.afterTrailingComma(Ie))break}else Ue=!1;let Ke;if($e&&this.type===_e.comma)Ke=null;else if(this.type===_e.ellipsis){if(Ke=this.parseSpread(Ve),this.maybeInArrowParameters&&this.match(_e.colon))Ke.typeAnnotation=this.tsParseTypeAnnotation();if(Ve&&this.type===_e.comma&&Ve.trailingComma<0)Ve.trailingComma=this.start}else Ke=this.parseMaybeAssign(!1,Ve,this.parseParenItem);We.push(Ke)}return We}parseMaybeDecoratorArguments(Ie){let Le=this.tsMatchLeftRelational()||this.match(_e.bitShift)?this.tsParseTypeArgumentsInExpression():void 0;if(this.eat(_e.parenL)){let $e=this.startNodeAtNode(Ie);if($e.callee=Ie,$e.arguments=this.parseExprList(_e.parenR,!1),Le)$e.typeArguments=Le;return this.finishNode($e,"CallExpression")}if(Le){let $e=this.startNodeAtNode(Ie);return $e.expression=Ie,$e.typeArguments=Le,this.finishNode($e,"TSInstantiationExpression")}return Ie}parseSubscript(Ie,Le,$e,Ve,We,Ue,Ke){let Qe=Ue;if(!this.hasPrecedingLineBreak()&&this.value==="!"&&this.match(_e.prefix)){this.exprAllowed=!1,this.next();let mt=this.startNodeAt(Le,$e);return mt.expression=Ie,Ie=this.finishNode(mt,"TSNonNullExpression"),Ie}let Ye=!1;if(this.match(_e.questionDot)&&this.lookaheadCharCode()===60){if(Ve)return Ie;Ie.optional=!0,Qe=Ye=!0,this.next()}if(this.tsMatchLeftRelational()||this.match(_e.bitShift)){let mt,Bt=this.tsTryParseAndCatch(()=>{if(!Ve&&this.atPossibleAsyncArrow(Ie)){let Dt=this.tsTryParseGenericAsyncArrowFunction(Le,$e,Ke);if(Dt)return Ie=Dt,Ie}let Lt=this.tsParseTypeArgumentsInExpression();if(!Lt)return Ie;if(Ye&&!this.match(_e.parenL))return mt=this.curPosition(),Ie;if(tt(this.type)||this.type===_e.backQuote){let Dt=this.parseTaggedTemplateExpression(Ie,Le,$e,Qe);return Dt.typeArguments=Lt,Dt}if(!Ve&&this.eat(_e.parenL)){let Dt=new hr,Pt=this.startNodeAt(Le,$e);if(Pt.callee=Ie,Pt.arguments=this.parseExprList(_e.parenR,this.ecmaVersion>=8,!1,Dt),this.tsCheckForInvalidTypeCasts(Pt.arguments),Pt.typeArguments=Lt,Qe)Pt.optional=Ye;return this.checkExpressionErrors(Dt,!0),Ie=this.finishNode(Pt,"CallExpression"),Ie}let Wt=this.type;if(this.tsMatchRightRelational()||Wt===_e.bitShift||Wt!==_e.parenL&&bd(Wt)&&!this.hasPrecedingLineBreak())return;let Qt=this.startNodeAt(Le,$e);return Qt.expression=Ie,Qt.typeArguments=Lt,this.finishNode(Qt,"TSInstantiationExpression")});if(mt)this.unexpected(mt);if(Bt){if(Bt.type==="TSInstantiationExpression"&&(this.match(_e.dot)||this.match(_e.questionDot)&&this.lookaheadCharCode()!==40))this.raise(this.start,st.InvalidPropertyAccessAfterInstantiationExpression);return Ie=Bt,Ie}}let Je=this.ecmaVersion>=11,ct=Je&&this.eat(_e.questionDot);if(Ve&&ct)this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");let ut=this.eat(_e.bracketL);if(ut||ct&&this.type!==_e.parenL&&this.type!==_e.backQuote||this.eat(_e.dot)){let mt=this.startNodeAt(Le,$e);if(mt.object=Ie,ut)mt.property=this.parseExpression(),this.expect(_e.bracketR);else if(this.type===_e.privateId&&Ie.type!=="Super")mt.property=this.parsePrivateIdent();else mt.property=this.parseIdent(this.options.allowReserved!=="never");if(mt.computed=!!ut,Je)mt.optional=ct;Ie=this.finishNode(mt,"MemberExpression")}else if(!Ve&&this.eat(_e.parenL)){let mt=this.maybeInArrowParameters;this.maybeInArrowParameters=!0;let Bt=new hr,Lt=this.yieldPos,Wt=this.awaitPos,Qt=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;let Dt=this.parseExprList(_e.parenR,this.ecmaVersion>=8,!1,Bt);if(We&&!ct&&this.shouldParseAsyncArrow()){if(this.checkPatternErrors(Bt,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0)this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function");this.yieldPos=Lt,this.awaitPos=Wt,this.awaitIdentPos=Qt,Ie=this.parseSubscriptAsyncArrow(Le,$e,Dt,Ke)}else{this.checkExpressionErrors(Bt,!0),this.yieldPos=Lt||this.yieldPos,this.awaitPos=Wt||this.awaitPos,this.awaitIdentPos=Qt||this.awaitIdentPos;let Pt=this.startNodeAt(Le,$e);if(Pt.callee=Ie,Pt.arguments=Dt,Je)Pt.optional=ct;Ie=this.finishNode(Pt,"CallExpression")}this.maybeInArrowParameters=mt}else if(this.type===_e.backQuote){if(ct||Qe)this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");let mt=this.startNodeAt(Le,$e);mt.tag=Ie,mt.quasi=this.parseTemplate({isTagged:!0}),Ie=this.finishNode(mt,"TaggedTemplateExpression")}return Ie}parseGetterSetter(Ie){Ie.kind=Ie.key.name,this.parsePropertyName(Ie);let Le=this.tsTryParseTypeParameters(this.tsParseConstModifier);if(Ie.value=this.parseMethod(!1),Le)Ie.value.typeParameters=Le;let $e=Ie.kind==="get"?0:1,Ve=Ie.value.params[0];if($e=Ve&&this.isThisParam(Ve)?$e+1:$e,Ie.value.params.length!==$e){let Ue=Ie.value.start;if(Ie.kind==="get")this.raiseRecoverable(Ue,"getter should have no params");else this.raiseRecoverable(Ue,"setter should have exactly one param")}else if(Ie.kind==="set"&&Ie.value.params[0].type==="RestElement")this.raiseRecoverable(Ie.value.params[0].start,"Setter cannot use rest params")}parsePropertyValue(Ie,Le,$e,Ve,We,Ue,Ke,Qe){if(this.tsMatchLeftRelational()){if(Le)this.unexpected();Ie.kind="init",Ie.method=!0;let Ye=this.tsTryParseTypeParameters(this.tsParseConstModifier);if(Ie.value=this.parseMethod($e,Ve),Ye)Ie.value.typeParameters=Ye;return}return super.parsePropertyValue(Ie,Le,$e,Ve,We,Ue,Ke,Qe)}parseProperty(Ie,Le){if(!Ie){let $e=[];if(this.match(Ge.at))while(this.match(Ge.at))$e.push(this.parseDecorator());let Ve=super.parseProperty(Ie,Le);if(Ve.type==="SpreadElement"){if($e.length)this.raise(Ve.start,Hr.SpreadElementDecorator)}if($e.length)Ve.decorators=$e,$e=[];return Ve}return super.parseProperty(Ie,Le)}parseCatchClauseParam(){let Ie=this.parseBindingAtom(),Le=Ie.type==="Identifier";this.enterScope(Le?ft.SCOPE_SIMPLE_CATCH:0),this.checkLValPattern(Ie,Le?ft.BIND_SIMPLE_CATCH:ft.BIND_LEXICAL);let $e=this.tsTryParseTypeAnnotation();if($e)Ie.typeAnnotation=$e,this.resetEndLocation(Ie);return this.expect(_e.parenR),Ie}parseClass(Ie,Le){let $e=this.inAbstractClass;this.inAbstractClass=!!Ie.abstract;try{this.next(),this.takeDecorators(Ie);let Ve=this.strict;this.strict=!0,this.parseClassId(Ie,Le),this.parseClassSuper(Ie);let We=this.enterClassBody(),Ue=this.startNode(),Ke=!1;Ue.body=[];let Qe=[];this.expect(_e.braceL);while(this.type!==_e.braceR){if(this.match(Ge.at)){Qe.push(this.parseDecorator());continue}let Ye=this.parseClassElement(Ie.superClass!==null);if(Qe.length)Ye.decorators=Qe,this.resetStartLocationFromNode(Ye,Qe[0]),Qe=[];if(Ye){if(Ue.body.push(Ye),Ye.type==="MethodDefinition"&&Ye.kind==="constructor"&&Ye.value.type==="FunctionExpression"){if(Ke)this.raiseRecoverable(Ye.start,"Duplicate constructor in the same class");if(Ke=!0,Ye.decorators&&Ye.decorators.length>0)this.raise(Ye.start,Hr.DecoratorConstructor)}else if(Ye.key&&Ye.key.type==="PrivateIdentifier"&&Ye.value?.type!=="TSDeclareMethod"){let Je=Ye.key.name;if(this.parseEffects.modify(We,Je,(ut)=>nd(ut,Ye)))this.raiseRecoverable(Ye.key.start,`Identifier '#${Je}' has already been declared`)}}}if(this.strict=Ve,this.next(),Qe.length)this.raise(this.start,Hr.TrailingDecorator);return Ie.body=this.finishNode(Ue,"ClassBody"),this.exitClassBody(),this.finishNode(Ie,Le?"ClassDeclaration":"ClassExpression")}finally{this.inAbstractClass=$e}}parseClassFunctionParams(){let Ie=this.tsTryParseTypeParameters(),Le=this.parseBindingList(_e.parenR,!1,this.ecmaVersion>=8,!0);if(Ie)Le.typeParameters=Ie;return Le}parseMethod(Ie,Le,$e,Ve,We){let Ue=this.startNode(),Ke=this.yieldPos,Qe=this.awaitPos,Ye=this.awaitIdentPos;if(this.initFunction(Ue),this.ecmaVersion>=6)Ue.generator=Ie;if(this.ecmaVersion>=8)Ue.async=!!Le;if(this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(ci(Le,Ue.generator)|ft.SCOPE_SUPER|($e?ft.SCOPE_DIRECT_SUPER:0)),this.expect(_e.parenL),Ue.params=this.parseClassFunctionParams(),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(Ue,!1,!0,!1,{isClassMethod:Ve}),this.yieldPos=Ke,this.awaitPos=Qe,this.awaitIdentPos=Ye,We&&We.abstract){if(!!Ue.body){let{key:ct}=We;this.raise(We.start,st.AbstractMethodHasImplementation({methodName:ct.type==="Identifier"&&!We.computed?ct.name:`[${this.input.slice(ct.start,ct.end)}]`}))}}return this.finishNode(Ue,"FunctionExpression")}static parse(Ie,Le){if(Le.locations===!1)throw Error("You have to enable options.locations while using acorn-typescript");else Le.locations=!0;let $e=new this(Le,Ie);if(ve)$e.isAmbientContext=!0;return $e.parse()}static parseExpressionAt(Ie,Le,$e){if($e.locations===!1)throw Error("You have to enable options.locations while using acorn-typescript");else $e.locations=!0;let Ve=new this($e,Ie,Le);if(ve)Ve.isAmbientContext=!0;return Ve.nextToken(),Ve.parseExpression()}parseImportSpecifier(){if(this.ts_isContextual(Ge.type)){let Le=this.startNode();return Le.imported=this.parseModuleExportName(),this.parseTypeOnlyImportExportSpecifier(Le,!0,this.importOrExportOuterKind==="type"),this.finishNode(Le,"ImportSpecifier")}else{let Le=super.parseImportSpecifier();return Le.importKind="value",Le}}parseExportSpecifier(Ie){let Le=this.ts_isContextual(Ge.type);if(!this.match(_e.string)&&Le){let Ve=this.startNode();return Ve.local=this.parseModuleExportName(),this.parseTypeOnlyImportExportSpecifier(Ve,!1,this.importOrExportOuterKind==="type"),this.finishNode(Ve,"ExportSpecifier"),this.checkExport(Ie,Ve.exported,Ve.exported.start),Ve}else{let Ve=super.parseExportSpecifier(Ie);return Ve.exportKind="value",Ve}}parseTypeOnlyImportExportSpecifier(Ie,Le,$e){let Ve=Le?"imported":"local",We=Le?"local":"exported",Ue=Ie[Ve],Ke,Qe=!1,Ye=!0,Je=Ue.start;if(this.isContextual("as")){let ut=this.parseIdent();if(this.isContextual("as")){let mt=this.parseIdent();if(nt(this.type))Qe=!0,Ue=ut,Ke=Le?this.parseIdent():this.parseModuleExportName(),Ye=!1;else Ke=mt,Ye=!1}else if(nt(this.type))Ye=!1,Ke=Le?this.parseIdent():this.parseModuleExportName();else Qe=!0,Ue=ut}else if(nt(this.type))if(Qe=!0,Le){if(Ue=super.parseIdent(!0),!this.isContextual("as"))this.checkUnreserved(Ue)}else Ue=this.parseModuleExportName();if(Qe&&$e)this.raise(Je,Le?st.TypeModifierIsUsedInTypeImports:st.TypeModifierIsUsedInTypeExports);Ie[Ve]=Ue,Ie[We]=Ke;let ct=Le?"importKind":"exportKind";if(Ie[ct]=Qe?"type":"value",Ye&&this.eatContextual("as"))Ie[We]=Le?this.parseIdent():this.parseModuleExportName();if(!Ie[We])Ie[We]=this.copyNode(Ie[Ve]);if(Le)this.checkLValSimple(Ie[We],ft.BIND_LEXICAL)}raiseCommonCheck(Ie,Le,$e){switch(Le){case"Comma is not permitted after the rest element":if(this.isAmbientContext&&this.match(_e.comma)&&this.lookaheadCharCode()===41){this.next();return}else return super.raise(Ie,Le)}return $e?super.raiseRecoverable(Ie,Le):super.raise(Ie,Le)}raiseRecoverable(Ie,Le){return this.raiseCommonCheck(Ie,Le,!0)}raise(Ie,Le){return this.raiseCommonCheck(Ie,Le,!0)}updateContext(Ie){let{type:Le}=this;if(Le==_e.braceL){var $e=this.curContext();if($e==He.tc_oTag)this.parseEffects.append(this.context,je.b_expr);else if($e==He.tc_expr)this.parseEffects.append(this.context,je.b_tmpl);else super.updateContext(Ie);this.exprAllowed=!0}else if(Le===_e.slash&&Ie===Ge.jsxTagStart)this.parseEffects.truncate(this.context,this.context.length-2),this.parseEffects.append(this.context,He.tc_cTag),this.exprAllowed=!1;else return super.updateContext(Ie)}jsx_parseOpeningElementAt(Ie,Le){let $e=this.startNodeAt(Ie,Le),Ve=this.jsx_parseElementName();if(Ve)$e.name=Ve;if(this.match(_e.relational)||this.match(_e.bitShift)){let We=this.tsTryParseAndCatch(()=>this.tsParseTypeArgumentsInExpression());if(We)$e.typeArguments=We}$e.attributes=[];while(this.type!==_e.slash&&this.type!==Ge.jsxTagEnd)$e.attributes.push(this.jsx_parseAttribute());return $e.selfClosing=this.eat(_e.slash),this.expect(Ge.jsxTagEnd),this.finishNode($e,Ve?"JSXOpeningElement":"JSXOpeningFragment")}enterScope(Ie){let Le=Ie===fr;if(Le)this.parseEffects.append(this.importsStack,[]);let $e=Le?Ie|ft.SCOPE_CLASS_STATIC_BLOCK:Ie;super.enterScope($e);let Ve=super.currentScope();Ve.types=[],Ve.enums=[],Ve.constEnums=[],Ve.classes=[],Ve.exportOnlyBindings=[]}exitScope(){if(super.currentScope().flags&fr)this.parseEffects.pop(this.importsStack);super.exitScope()}hasImport(Ie,Le){let $e=this.importsStack.length;if(this.importsStack[$e-1].indexOf(Ie)>-1)return!0;if(!Le&&$e>1){for(let Ve=0;Ve<$e-1;Ve++)if(this.importsStack[Ve].indexOf(Ie)>-1)return!0}return!1}maybeExportDefined(Ie,Le){if(this.inModule&&Ie.flags&ft.SCOPE_TOP)this.parseEffects.remove(this.undefinedExports,Le)}declareName(Ie,Le,$e){if(Le&ft.BIND_FLAGS_TS_IMPORT){if(this.hasImport(Ie,!0))this.raise($e,`Identifier '${Ie}' has already been declared.`);this.parseEffects.append(this.importsStack[this.importsStack.length-1],Ie);return}let Ve=this.currentScope();if(Le&ft.BIND_FLAGS_TS_EXPORT_ONLY){this.maybeExportDefined(Ve,Ie),this.parseEffects.append(Ve.exportOnlyBindings,Ie);return}if(Le===ft.BIND_TS_TYPE||Le===ft.BIND_TS_INTERFACE){if(Le===ft.BIND_TS_TYPE&&Ve.types.includes(Ie))this.raise($e,`type '${Ie}' has already been declared.`);this.parseEffects.append(Ve.types,Ie)}else if(Le&ft.BIND_FLAGS_TS_ENUM){if(Ve.enums.includes(Ie))return;super.declareName(Ie,ft.BIND_LEXICAL,$e)}else super.declareName(Ie,Le,$e);if(Le&ft.BIND_FLAGS_TS_ENUM)this.parseEffects.append(Ve.enums,Ie);if(Le&ft.BIND_FLAGS_TS_CONST_ENUM)this.parseEffects.append(Ve.constEnums,Ie);if(Le&ft.BIND_FLAGS_CLASS)this.parseEffects.append(Ve.classes,Ie)}checkLocalExport(Ie){let{name:Le}=Ie;if(this.hasImport(Le))return;let $e=this.scopeStack.length;for(let Ve=$e-1;Ve>=0;Ve--){let We=this.scopeStack[Ve];if(We.types.indexOf(Le)>-1||We.exportOnlyBindings.indexOf(Le)>-1)return}super.checkLocalExport(Ie)}}return Ct}}var vd=/\n/,Sd=/[ \t]/,Td=/^[,) \t]*$/,zr="",Bo=[];function Xr(i,ve){zr=i,Bo=ve}function Jr(i,ve,Ae,Pe){let Ne=ve;if(i&&vd.test(Ne)){let De=Ae;while(De>0&&zr[De-1]!==`
|
|
12
|
+
`)De-=1;let _e=De;while(Sd.test(zr[_e]))_e+=1;let Re=zr.slice(De,_e);Ne=Ad(Ne,Re)}Bo.push({type:i?"Block":"Line",value:Ne,start:Ae,end:Pe})}function Ad(i,ve){if(ve==="")return i;return(i.startsWith(ve)?i.slice(ve.length):i).replaceAll(`
|
|
13
|
+
${ve}`,`
|
|
14
|
+
`)}function di(i,ve,Ae,Pe){let Ne=kd(Ae,Pe);if(Ne>=Ae.length)return;ui(i,void 0,Ae,{index:Ne},ve)}function kd(i,ve){let Ae=0,Pe=i.length;while(Ae<Pe){let Ne=Ae+Pe>>>1;if(i[Ne].start<ve)Ae=Ne+1;else Pe=Ne}return Ae}function ui(i,ve,Ae,Pe,Ne){while(Pe.index<Ae.length&&Ae[Pe.index].start<(i.start??0))i.leadingComments??=[],i.leadingComments.push(Ae[Pe.index]),Pe.index++;if(Pe.index>=Ae.length)return;let De=Ae[Pe.index].start,_e=i.end,Oe=_e===void 0||_e>De?Object.keys(i):[];for(let Be=0;Be<Oe.length;Be++){let Me=Oe[Be];if(Me==="type"||Me==="leadingComments")continue;let je=i[Me];if(!je||typeof je!=="object")continue;if(Array.isArray(je)){for(let qe of je)if(qe&&typeof qe==="object"&&typeof qe.type==="string"){if(ui(qe,i,Ae,Pe,Ne),Pe.index>=Ae.length)return}}else if(typeof je.type==="string"){if(ui(je,i,Ae,Pe,Ne),Pe.index>=Ae.length)return}}if(Pe.index<Ae.length){let Be=Ae[Pe.index];if(ve===void 0||i.end!==ve.end){let Me=Ne.slice(i.end??0,Be.start);if((ve?.type==="BlockStatement"||ve?.type==="Program")&&pi(ve.body,i)||ve?.type==="ArrayExpression"&&pi(ve.elements,i)||ve?.type==="ObjectExpression"&&pi(ve.properties,i))while(Pe.index<Ae.length){if(ve&&Ae[Pe.index].start>=(ve.end??Number.POSITIVE_INFINITY))break;Pe.index++}else if((i.end??0)<=Be.start&&Td.test(Me))Pe.index++}}}function pi(i,ve){return!!i&&i.indexOf(ve)===i.length-1}var Yr={sawParenthesized:!1},jo=(i)=>class extends i{parseParenAndDistinguishExpression(ve,Ae){let Pe=super.parseParenAndDistinguishExpression(ve,Ae);if(Pe.type==="ParenthesizedExpression")Yr.sawParenthesized=!0;return Pe}parseDecorator(){return Yr.sawParenthesized=!0,super.parseDecorator()}},wd=Tt.extend(jo),Pd=Tt.extend(Mo(),jo);function gi(i){return i?Pd:wd}var Nd={onComment:Jr,sourceType:"module",ecmaVersion:16},Vo={onComment:Jr,sourceType:"module",ecmaVersion:16,preserveParens:!0},_d={onComment:Jr,sourceType:"module",ecmaVersion:16},$o={...Vo,startLocation:null},fi=/\r\n?|\n|\u2028|\u2029/g;function Id(i,ve){if(ve?.breakEnds)return ve.breakEnds;let Ae=[];fi.lastIndex=0;while(fi.test(i))Ae.push(fi.lastIndex);if(ve)ve.breakEnds=Ae;return Ae}function Dd(i,ve,Ae){let Pe=i.lastIndexOf(`
|
|
15
|
+
`,ve-1)+1,Ne=Id(i,Ae),De=0,_e=Ne.length;while(De<_e){let Re=De+_e>>>1;if(Ne[Re]<=Pe)De=Re+1;else _e=Re}return{line:De+1,column:ve-Pe}}function qo(i,ve,Ae,Pe,Ne){if(Ae.length===Ne)return;di(i,ve,Ae,Pe)}function Wo(i,ve,Ae){let Pe=Ae.length;Xr(i,Ae);let Ne=gi(ve).parse(i,Nd);if(Ae.length>0)di(Ne,i,Ae,Pe);return Ne}var Rd={count:0};function Xn(i,ve,Ae,Pe,Ne){Rd.count+=1;let De=Pe.length;Xr(i,Pe),Yr.sawParenthesized=!1;let _e=Vo;if(Ae)$o.startLocation=Dd(i,ve,Ne),_e=$o;let Re=gi(Ae).parseExpressionAt(i,ve,_e);qo(Re,i,Pe,ve,De);let Oe=Pe.length>De?Pe.at(-1):void 0,Be=Oe&&Oe.end>(Re.end??0)?Oe.end:Re.end??0;return{node:Yr.sawParenthesized?Ld(Re):Re,end:Be}}function Go(i,ve,Ae,Pe){let Ne=Pe.length,De=gi(Ae);Xr(i,Pe);let _e=new De(_d,i,ve);_e.nextToken();let Re=_e.parseStatement(null,!0,Object.create(null));return qo(Re,i,Pe,ve,Ne),Re}function Fo(i){return i!==null&&typeof i==="object"&&typeof i.type==="string"}function hi(i){let ve=i;while(ve.type==="ParenthesizedExpression"&&ve.expression)ve=ve.expression;return ve}function Ld(i){let ve=hi(i);return mi(ve),ve}function mi(i){for(let ve in i){let Ae=i[ve];if(!Ae||typeof Ae!=="object")continue;if(Array.isArray(Ae))for(let Pe=0;Pe<Ae.length;Pe++){let Ne=Ae[Pe];if(!Fo(Ne))continue;let De=hi(Ne);if(De!==Ne)Ae[Pe]=De;mi(De)}else if(Fo(Ae)){let Pe=hi(Ae);if(Pe!==Ae)i[ve]=Pe;mi(Pe)}}}function Fn(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 yi{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 ve=i.exec(this.source);if(!ve||ve.index!==this.index)return null;return ve[0]}eat(i,ve=!1){if(this.match(i))return this.index+=i.length,!0;if(ve)throw new Pn(`Expected token ${JSON.stringify(i)}`,this.index);return!1}read(i){let ve=this.matchRegex(i);if(ve)this.index+=ve.length;return ve}readUntil(i){if(this.index>=this.source.length)throw new Pn("Unexpected end of input",this.source.length);let ve=this.index;i.lastIndex=ve;let Ae=i.exec(this.source);if(Ae)return this.index=Ae.index,this.source.slice(ve,this.index);return this.index=this.source.length,this.source.slice(ve)}readUntilString(i){if(this.index>=this.source.length)throw new Pn("Unexpected end of input",this.source.length);let ve=this.source.indexOf(i,this.index),Ae=ve===-1?this.source.length:ve,Pe=this.source.slice(this.index,Ae);return this.index=Ae,Pe}allowWhitespace(){while(this.index<this.source.length&&Fn(this.source.charCodeAt(this.index)))this.index++}requireWhitespace(){if(!Fn(this.source.charCodeAt(this.index)))throw new Pn("Expected whitespace",this.index);this.allowWhitespace()}readIdentifierName(){let i=this.index,ve=i,Ae="",Pe=this.source.codePointAt(this.index);if(Pe!==void 0&&Ft(Pe,!0)){ve+=Pe<=65535?1:2;while(ve<this.source.length){let Ne=this.source.codePointAt(ve);if(Ne===void 0||!Kt(Ne,!0))break;ve+=Ne<=65535?1:2}Ae=this.source.slice(i,ve),this.index=ve}return{type:"Identifier",name:Ae,start:i,end:ve}}}class Pn extends Error{position;constructor(i,ve){super(`${i} (at index ${ve})`);this.name="TemplateSyntaxError",this.position=ve}}function Vt(){return{type:"Fragment",nodes:[]}}var Od=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"]),Md=["&&","||","??"],Bd=["===","!==","==","!="];function Uo(i,ve){let Ae=i.codePointAt(ve);if(Ae===void 0||!Ft(Ae,!0))return ve;let Pe=ve+(Ae<=65535?1:2);while(Pe<i.length){let Ne=i.codePointAt(Pe);if(!Kt(Ne,!0))break;Pe+=Ne<=65535?1:2}return Pe}function $d(i,ve){let Ae=ve;while(Ae<i.length){let Pe=i.charCodeAt(Ae);if(Pe<48||Pe>57)break;Ae++}return Ae}function Qr(i,ve){let Ae=ve;while(Ae<i.length&&Fn(i.charCodeAt(Ae)))Ae++;return Ae}function Ho(i,ve){let Ae=$d(i,ve);if(Ae===ve)return null;if(i.charCodeAt(ve)===48&&Ae-ve>1)return null;if(Ae<i.length){let Ne=i.codePointAt(Ae);if(Ne===46||Kt(Ne,!0))return null}let Pe=i.slice(ve,Ae);return{type:"Literal",start:ve,end:Ae,value:Number(Pe),raw:Pe}}function Ko(i,ve){let Ae=i.charCodeAt(ve),Pe=ve+1;while(Pe<i.length){let Ne=i.charCodeAt(Pe);if(Ne===Ae){let De=i.slice(ve,Pe+1);return{type:"Literal",start:ve,end:Pe+1,value:i.slice(ve+1,Pe),raw:De}}if(Ne===92||Ne===10||Ne===13)return null;Pe++}return null}function Fd(i,ve){let Ae=i.charCodeAt(ve);if(Ae===34||Ae===39)return Ko(i,ve);let Pe=Uo(i,ve);if(Pe===ve)return Ho(i,ve);let Ne=i.slice(ve,Pe);if(Ne==="true"||Ne==="false")return{type:"Literal",start:ve,end:Pe,value:Ne==="true",raw:Ne};if(Ne==="null")return{type:"Literal",start:ve,end:Pe,value:null,raw:Ne};if(Od.has(Ne))return null;let De={type:"Identifier",start:ve,end:Pe,name:Ne},_e=Pe;while(_e<i.length){let Re=i.charCodeAt(_e);if(Re===46){let Oe=_e+1,Be=Uo(i,Oe);if(Be===Oe)return null;let Me={type:"Identifier",start:Oe,end:Be,name:i.slice(Oe,Be)};De={type:"MemberExpression",start:ve,end:Be,object:De,property:Me,computed:!1,optional:!1},_e=Be}else if(Re===91){let Oe=_e+1,Be=i.charCodeAt(Oe),Me=Be===34||Be===39?Ko(i,Oe):Ho(i,Oe);if(!Me||i.charCodeAt(Me.end)!==93)return null;De={type:"MemberExpression",start:ve,end:Me.end+1,object:De,property:Me,computed:!0,optional:!1},_e=Me.end+1}else break}return De}function xi(i,ve){if(i.charCodeAt(ve)!==33||i.charCodeAt(ve+1)===61)return Fd(i,ve);let Ae=xi(i,Qr(i,ve+1));if(!Ae)return null;return{type:"UnaryExpression",start:ve,end:Ae.end,operator:"!",prefix:!0,argument:Ae}}function jd(i,ve){for(let Ae of Bd)if(i.startsWith(Ae,ve))return{operator:Ae,logical:!1};for(let Ae of Md)if(i.startsWith(Ae,ve))return{operator:Ae,logical:!0};return null}function zo(i,ve){let Ae=Qr(i,ve);if(Ae>=i.length)return!1;let Pe=i.charCodeAt(Ae);return Pe===125||Pe===41}function Vd(i){let ve=i.source,Ae=xi(ve,i.index);if(!Ae)return null;if(zo(ve,Ae.end))return i.index=Ae.end,Ae;let Pe=Qr(ve,Ae.end),Ne=jd(ve,Pe);if(!Ne)return null;let De=xi(ve,Qr(ve,Pe+Ne.operator.length));if(!De||!zo(ve,De.end))return null;return i.index=De.end,{type:Ne.logical?"LogicalExpression":"BinaryExpression",start:Ae.start,end:De.end,left:Ae,operator:Ne.operator,right:De}}function _t(i){let ve=Vd(i);if(ve)return ve;let{node:Ae,end:Pe}=Xn(i.source,i.index,i.isTypeScript,i.root.comments,i.lineTable);return i.index=Pe,Ae}var qd={"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},bi=qd;var Wd=[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 Gd(i,ve){if(ve&&!i.endsWith(";"))return`${i}\\b(?!=)`;return i}function Xo(i){let Ae=Object.keys(bi).map((Pe)=>Gd(Pe,i));return new RegExp(`&(#(?:x[a-fA-F\\d]+|\\d+)(?:;)?|${Ae.join("|")})`,"g")}var Ei,Ci;function Ud(i){if(i){if(!Ci)Ci=Xo(!0);return Ci}if(!Ei)Ei=Xo(!1);return Ei}var Jo=0;function Hd(i){if(i===10)return 32;if(i<128)return i;if(i<=159)return Wd[i-128];if(i<55296)return i;if(i<=57343)return Jo;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 Jo}function vi(i,ve){if(i.indexOf("&")===-1)return i;return i.replace(Ud(ve),(Ae,Pe)=>{let Ne;if(Pe[0]!=="#")Ne=bi[Pe];else if(Pe[1]==="x")Ne=Number.parseInt(Pe.substring(2),16);else Ne=Number.parseInt(Pe.substring(1),10);if(!Ne)return Ae;return String.fromCodePoint(Hd(Ne))})}class T extends Error{constructor(i){super(`sveld's template parser doesn't support ${i} yet.`);this.name="TemplateParseNotImplementedError"}}var Kd=/<\/script\s*>/g,zd=/<\/script\s*>/y,Xd=/[^\n]/g,Jd=new Set(["server","client","worker","test","default"]);function Yo(i,ve,Ae){let Pe=i.index,Ne=i.readUntil(Kd);if(i.index>=i.source.length)throw Error("sveld: unclosed <script> tag");let De=i.source.slice(0,Pe).replace(Xd," ")+Ne;i.read(zd);let _e=Wo(De,i.isTypeScript,i.root.comments);_e.start=Pe;let Re="default";for(let Oe of Ae){if(Jd.has(Oe.name))throw Error(`sveld: "${Oe.name}" is a reserved <script> attribute name.`);if(Oe.name==="module"){if(Oe.value!==!0)throw Error("sveld: <script module> does not take a value.");Re="module"}if(Oe.name==="context"){let Be=Oe.value;if(Be===!0||!Array.isArray(Be)||Be.length!==1||Be[0].type!=="Text")throw Error("sveld: context attribute must be a plain string.");if(Be[0].data!=="module")throw Error('sveld: only context="module" is valid.');Re="module"}}return{type:"Script",start:ve,end:i.index,context:Re,content:_e,attributes:Ae}}function Qo(i,ve,Ae){let Pe=i.index,Ne=i.source.indexOf("</style",i.index),De=Ne===-1?i.source.length:Ne;return i.index=De,i.eat("</style",!0),i.read(/\s*>/y),{type:"StyleSheet",start:ve,end:i.index,attributes:Ae,children:[],comments:[],content:{start:Pe,end:De,styles:i.source.slice(Pe,De),comment:null}}}var Yd=new Set(["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]);function Si(i){return Yd.has(i)||i.charCodeAt(0)===33&&i.toLowerCase()==="!doctype"}var Qd="^[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}]*)?$",Zd=new RegExp(Qd,"u");function Zo(i){return Zd.test(i)}var ef=/(?:"([^"]*)"|'([^'])*'|([^>\s]+))/y,sc=/["']/y,tf=/(\/>|[\s"'=<>`])/y,Ti=/<\/textarea(\s[^>]*)?>/iy,nf=/^![a-zA-Z]+$/,rf=/^[a-zA-Z][a-zA-Z0-9]*:[a-zA-Z][a-zA-Z0-9-]*[a-zA-Z0-9]$/,sf=/^(?:\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"},ec={...ic,"svelte:element":"SvelteElement","svelte:component":"SvelteComponent","svelte:self":"SvelteSelf","svelte:fragment":"SvelteFragment","svelte:boundary":"SvelteBoundary"};function af(i){let ve=i.charCodeAt(0);if(ve<97||ve>122)return!1;for(let Ae=1;Ae<i.length;Ae++){let Pe=i.charCodeAt(Ae);if((Pe<97||Pe>122)&&(Pe<48||Pe>57))return!1}return!0}function of(i){if(af(i))return!0;if(nf.test(i))return!0;if(rf.test(i))return!0;return Zo(i)}function cf(i){let ve=i.charCodeAt(0);if(ve>=97&&ve<=122&&!i.includes("."))return!1;return!0}function lf(i){return`Svelte${i.slice(7).split("-").map((Ae)=>Ae.charAt(0).toUpperCase()+Ae.slice(1)).join("")}`}function pf(i){for(let ve=i.length-1;ve>=0;ve--){let Ae=i[ve].type;if(Ae==="SvelteHead")return!0;if(Ae==="RegularElement"||Ae==="Component")return!1}return!1}function uf(i){for(let ve=i.length-1;ve>=0;ve--){let Ae=i[ve];if(Ae.type==="RegularElement"&&Ae.attributes?.some((Pe)=>Pe.type==="Attribute"&&Pe.name==="shadowrootmode"))return!0}return!1}function tc(i){let{source:ve,index:Ae}=i;if(Ae>=ve.length)throw new Pn("Unexpected end of input",ve.length);let Pe=Ae;while(Pe<ve.length){let Ne=ve.charCodeAt(Pe);if(Ne===47||Ne===62||Fn(Ne))break;Pe++}return i.index=Pe,{name:ve.slice(Ae,Pe),start:Ae,end:Pe}}function ac(i){let{source:ve,index:Ae}=i;if(Ae>=ve.length)throw new Pn("Unexpected end of input",ve.length);let Pe=Ae;while(Pe<ve.length){let Ne=ve.charCodeAt(Pe);if(Ne===61||Ne===47||Ne===62||Ne===34||Ne===39||Fn(Ne))break;Pe++}return i.index=Pe,{name:ve.slice(Ae,Pe),start:Ae,end:Pe}}function df(i){let ve=i.index;if(i.eat("//")){let Ae=i.readUntilString(`
|
|
16
|
+
`),Pe=i.index;i.root.comments.push({type:"Line",value:Ae,start:ve,end:Pe});return}if(i.eat("/*")){let Ae=i.readUntilString("*/");i.eat("*/");let Pe=i.index;i.root.comments.push({type:"Block",value:Ae,start:ve,end:Pe})}}function ff(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 oc(i,ve,Ae){let Pe={start:i.index,end:-1,type:"Text",raw:"",data:""},Ne=[],De=(_e)=>{if(_e>Pe.start)Pe.raw=i.source.slice(Pe.start,_e),Pe.data=vi(Pe.raw,!0),Pe.end=_e,Ne.push(Pe)};while(i.index<i.source.length){if(ve())return De(i.index),Ne;if(i.eat("{")){if(i.match("#")||i.match("@"))throw new T("blocks/tags inside attribute value sequences");let _e=i.index-1;De(_e),i.allowWhitespace();let Re=_t(i);i.allowWhitespace(),i.eat("}",!0),Ne.push({type:"ExpressionTag",start:_e,end:i.index,expression:Re}),Pe={start:i.index,end:-1,type:"Text",raw:"",data:""}}else{let _e=i.index+1;if(Ae!==void 0){let Re=i.source;while(_e<Re.length){let Oe=Re.charCodeAt(_e);if(Oe===123||Oe===Ae)break;_e++}}i.index=_e}}throw new T("unterminated attribute value / sequence (loose mode)")}function hf(i){let ve=i.eat("'")?"'":i.eat('"')?'"':null;if(ve&&i.eat(ve))return[{start:i.index-1,end:i.index-1,type:"Text",raw:"",data:""}];let Ae=oc(i,()=>{if(ve)return i.match(ve);return!!i.matchRegex(tf)},ve===null?void 0:ve.charCodeAt(0));if(Ae.length===0&&!ve)throw Error("sveld: expected attribute value");if(ve)i.index+=1;if(ve||Ae.length>1||Ae[0].type==="Text")return Ae;return Ae[0]}function Ai(i,ve,Ae,Pe){return{type:"Attribute",start:ve,end:Ae,name:i,value:Pe}}function mf(i){let ve=i.index,Ae=ac(i);if(!Ae.name)return null;let Pe=!0;if(i.eat("=")){i.allowWhitespace();let Ne=i.matchRegex(ef);if(!Ne)throw Error("sveld: expected attribute value");i.index+=Ne.length;let De=Ne[0]==='"'||Ne[0]==="'";if(De)Ne=Ne.slice(1,-1);Pe=[{start:i.index-Ne.length-(De?1:0),end:De?i.index-1:i.index,type:"Text",raw:Ne,data:vi(Ne,!0)}]}if(i.matchRegex(sc))throw Error("sveld: expected '='");return Ai(Ae.name,ve,i.index,Pe)}function gf(i){while(!0){let Re=i.index;if(df(i),i.index===Re)break;i.allowWhitespace()}let ve=i.index;if(i.eat("{")){if(i.allowWhitespace(),i.eat("@attach")){i.requireWhitespace();let Be=_t(i);return i.allowWhitespace(),i.eat("}",!0),{type:"AttachTag",start:ve,end:i.index,expression:Be}}if(i.eat("...")){let Be=_t(i);return i.allowWhitespace(),i.eat("}",!0),{type:"SpreadAttribute",start:ve,end:i.index,expression:Be}}let Re=i.readIdentifierName();if(Re.name==="")throw Error("sveld: empty attribute shorthand");i.allowWhitespace(),i.eat("}",!0);let Oe={type:"ExpressionTag",start:Re.start,end:Re.end,expression:Re};return Ai(Re.name,ve,i.index,Oe)}let Ae=ac(i);if(!Ae.name)return null;let Pe=i.index;i.allowWhitespace();let Ne=Ae.name.indexOf(":"),De=Ne!==-1&&ff(Ae.name.slice(0,Ne)),_e=!0;if(i.eat("="))if(i.allowWhitespace(),i.source[i.index]==="/"&&i.source[i.index+1]===">"){let Re=i.index;i.index++,_e=[{start:Re,end:Re+1,type:"Text",raw:"/",data:"/"}],Pe=i.index}else _e=hf(i),Pe=i.index;else if(i.matchRegex(sc))throw Error("sveld: expected '='");if(De){let Re=Ae.name.slice(Ne+1).split("|",1)[0];if(Re==="")throw Error("sveld: directive missing a name");if(De==="StyleDirective")return{start:ve,end:Pe,type:De,name:Re,value:_e};let Oe=_e===!0?void 0:Array.isArray(_e)?_e[0]:_e,Be=null;if(Oe){if((Array.isArray(_e)?_e.length>1:!1)||Oe.type==="Text")throw Error("sveld: directive value must be a single expression");Be=Oe.expression}let Me={start:ve,end:Pe,type:De,name:Re,expression:Be};if((Me.type==="BindDirective"||Me.type==="ClassDirective")&&!Me.expression)Me.expression={start:ve+Ne+1,end:Pe,type:"Identifier",name:Me.name};return Me}return Ai(Ae.name,ve,Pe,_e)}function cc(i){let ve=i.index++,Ae=i.current();if(i.eat("!--")){let qe=i.readUntilString("-->");i.eat("-->",!0),i.append({type:"Comment",start:ve,end:i.index,data:qe});return}if(i.eat("/")){let{name:qe}=tc(i);if(i.allowWhitespace(),i.eat(">",!0),Si(qe))throw Error(`sveld: <${qe}> is a void element and cannot have a closing tag`);while(Ae.name!==qe){if(Ae.type==="RegularElement");else throw Error(`sveld: invalid closing tag </${qe}>`);Ae.end=ve,i.pop(),Ae=i.current()}if(Ae.end=i.index,i.pop(),i.lastAutoClosedTag&&i.stack.length<i.lastAutoClosedTag.depth)i.lastAutoClosedTag=void 0;return}let Pe=tc(i),Ne=cf(Pe.name)&&sf.test(Pe.name);if(!of(Pe.name)&&!Ne)throw Error(`sveld: "${Pe.name}" is not a valid element or component name`);if(Pe.name in ic&&Ae.type!=="Root")throw Error(`sveld: <${Pe.name}> must be a top-level element`);let De;if(Pe.name in ec)De=ec[Pe.name];else if(Pe.name.startsWith("svelte:"))De=lf(Pe.name);else if(Ne)De="Component";else if(Pe.name==="title"&&pf(i.stack))De="TitleElement";else if(Pe.name==="slot"&&!uf(i.stack))De="SlotElement";else De="RegularElement";let _e={type:De,start:ve,end:-1,name:Pe.name,attributes:[],fragment:{type:"Fragment",nodes:[]}};if(i.allowWhitespace(),Ae.type==="RegularElement"&&Da(Ae.name,Pe.name))Ae.end=ve,i.pop(),i.lastAutoClosedTag={tag:Ae.name,reason:Pe.name,depth:i.stack.length},Ae=i.current();let Re=i.current(),Oe=(Pe.name==="script"||Pe.name==="style")&&Re.type==="Root",Be=Oe?mf:gf,Me;while(Me=Be(i))_e.attributes.push(Me),i.allowWhitespace();if(_e.type==="SvelteComponent")_e.expression=rc(nc(_e));if(_e.type==="SvelteElement"){let qe=nc(_e);if(qe.value===!0)throw Error("sveld: <svelte:element> `this` attribute needs a value");if(yf(qe))_e.tag=rc(qe);else{let Ge=qe.value[0];_e.tag=Ge.type==="Text"?{type:"Literal",value:Ge.data,raw:`'${Ge.raw}'`,start:Ge.start,end:Ge.end}:Ge.expression}}if(Oe){if(i.eat(">",!0),Pe.name==="script"){let qe=Yo(i,ve,_e.attributes);if(qe.context==="module"){if(i.root.module)throw Error("sveld: duplicate <script module>");i.root.module=qe}else{if(i.root.instance)throw Error("sveld: duplicate <script>");i.root.instance=qe}}else{if(i.root.css)throw Error("sveld: duplicate <style>");i.root.css=Qo(i,ve,_e.attributes)}return}i.append(_e);let je=i.eat("/")||Si(Pe.name);if(i.eat(">",!0),je)_e.end=i.index;else if(Pe.name==="textarea")_e.fragment.nodes=oc(i,()=>(Ti.lastIndex=i.index,Ti.test(i.source))),i.read(Ti),_e.end=i.index;else i.push(_e,_e.fragment)}function nc(i){let ve=i.attributes,Ae=ve.findIndex((Pe)=>Pe.type==="Attribute"&&Pe.name==="this");if(Ae===-1)throw Error(`sveld: <${i.name}> requires a \`this\` attribute`);return ve.splice(Ae,1)[0]}function rc(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 lc(i){let ve={start:i.start,end:i.end,attributes:i.attributes};for(let Ae of i.attributes){if(Ae.type!=="Attribute")continue;if(Ae.name==="runes"){let Pe=pc(Ae);if(typeof Pe==="boolean")ve.runes=Pe}if(Ae.name==="customElement"){let Pe=Ef(Ae);if(Pe!==void 0)ve.customElement=Pe}}return ve}function pc(i){let{value:ve}=i;if(ve===!0)return!0;let Ae=Array.isArray(ve)?ve[0]:ve;if(!Ae)return!0;if(Array.isArray(ve)&&ve.length>1)return null;if(Ae.type==="Text")return Ae.data;if(Ae.expression.type!=="Literal")return null;return Ae.expression.value}var xf=new Set(["String","Boolean","Number","Array","Object"]);function ki(i){let ve=[];for(let Ae of i.properties){if(!Ae||typeof Ae!=="object"||Ae.type!=="Property"||Ae.computed||Ae.key?.type!=="Identifier")continue;let{key:Pe,value:Ne}=Ae;ve.push([Pe.name,Ne])}return ve}function bf(i){let ve={};if(!i||typeof i!=="object"||i.type!=="ObjectExpression")return ve;for(let[Ae,Pe]of ki(i)){if(!Pe||typeof Pe!=="object"||Pe.type!=="Literal")continue;let Ne=Pe.value;if(Ae==="attribute"&&typeof Ne==="string")ve.attribute=Ne;else if(Ae==="reflect"&&typeof Ne==="boolean")ve.reflect=Ne;else if(Ae==="type"&&typeof Ne==="string"&&xf.has(Ne))ve.type=Ne}return ve}function Ef(i){let{value:ve}=i;if(ve===!0)return;let Ae=Array.isArray(ve)?ve[0]:ve;if(!Ae)return;if(Ae.type==="Text"){let Me=pc(i);return typeof Me==="string"?{tag:Me}:void 0}let Pe=Ae.expression;if(Pe.type==="Literal"&&Pe.value===null)return;if(Pe.type!=="ObjectExpression")return;let Ne=ki(Pe),De={},_e=Ne.find(([Me])=>Me==="tag")?.[1];if(_e&&typeof _e==="object"&&_e.type==="Literal"&&typeof _e.value==="string")De.tag=_e.value;let Re=Ne.find(([Me])=>Me==="props")?.[1];if(Re&&typeof Re==="object"&&Re.type==="ObjectExpression"){De.props={};for(let[Me,je]of ki(Re))De.props[Me]=bf(je)}let Oe=Ne.find(([Me])=>Me==="shadow")?.[1];if(Oe&&typeof Oe==="object"){let Me=Oe;if(Me.type==="Literal"&&(Me.value==="open"||Me.value==="none"))De.shadow=Me.value;else if(Me.type==="ObjectExpression")De.shadow=Oe}let Be=Ne.find(([Me])=>Me==="extend")?.[1];if(Be!==void 0)De.extend=Be;return De}var Cf=/<script\s+(?:[^>]*|(?:[^=>'"/]+=(?:"[^"]*"|'[^']*'|[^>\s]+)\s+)*)lang=(["'])?ts\1[^>]*>/;class wi extends yi{root;stack=[];fragments=[];isTypeScript;lineTable={};lastAutoClosedTag;constructor(i,ve){super(i);this.isTypeScript=Cf.test(i);let Ae=Vt();this.root={type:"Root",start:0,end:ve,css:null,js:[],options:null,fragment:Ae,comments:[]},this.stack.push(this.root),this.fragments.push(Ae)}current(){return this.stack[this.stack.length-1]}currentFragment(){return this.fragments[this.fragments.length-1]}push(i,ve){this.stack.push(i),this.fragments.push(ve)}pop(){return this.fragments.pop(),this.stack.pop()}append(i){return this.currentFragment().nodes.push(i),i}}var Pi={"{":"}","(":")","[":"]"},vf=new Set(Object.values(Pi));function gr(i,ve,Ae=Pi){let Pe=Ae===Pi?vf:new Set(Object.values(Ae)),Ne=[],De=ve;while(De<i.source.length){let _e=i.source[De++];if(_e==="'"||_e==='"'||_e==="`"){De=Sf(i,De,_e);continue}if(Object.hasOwn(Ae,_e))Ne.push(_e);else if(Pe.has(_e)){let Re=Ne.pop(),Oe=Re?Ae[Re]:void 0;if(_e!==Oe)throw Error(`sveld: expected "${Oe}"`);if(Ne.length===0)return De}}throw Error("sveld: unexpected end of input")}function Sf(i,ve,Ae){let Pe=!1,Ne=ve;while(Ne<i.source.length){let De=i.source[Ne++];if(Pe){Pe=!1;continue}if(De===Ae)return Ne;if(De==="\\")Pe=!0;if(Ae==="`"&&De==="$"&&i.source[Ne]==="{")Ne=gr(i,Ne)}throw Error("sveld: unterminated string constant")}var dc=/[^\n]/g,Tf=/\?\s*:/g;function Nn(i){let ve=i.index,Ae=i.readIdentifierName();if(Ae.name!==""){let qe=uc(i);return{...Ae,typeAnnotation:qe}}let Pe=i.source[i.index];if(Pe!=="{"&&Pe!=="[")throw Error("sveld: expected a binding pattern");let Ne=gr(i,ve);i.index=Ne;let De=i.source.slice(ve,Ne),_e=i.source.slice(0,ve).replace(dc," "),Re=_e.indexOf(" ");_e=_e.slice(0,Re)+_e.slice(Re+1);let Oe=`${_e}(${De} = 1)`,{node:Be}=Xn(Oe,ve-1,i.isTypeScript,i.root.comments),Me=Be.left,je=uc(i);if(je)Me.typeAnnotation=je,Me.end=je.end;return Me}function uc(i){let ve=i.index;if(i.allowWhitespace(),!i.eat(":")){i.index=ve;return}let Ae="_ as ",Pe=i.index-Ae.length,Ne=i.source.slice(0,Pe).replace(dc," ")+Ae+i.source.slice(i.index).replace(Tf,":"),{node:De}=Xn(Ne,Pe,i.isTypeScript,i.root.comments),_e=De;if(_e.type==="AssignmentExpression"){let Re=_e.right.start;while(Ne[Re]!=="=")Re-=1;({node:De}=Xn(Ne.slice(0,Re),Pe,i.isTypeScript,i.root.comments)),_e=De}if(_e.type==="SequenceExpression"&&_e.expressions)_e=_e.expressions[0];return i.index=_e.end,{type:"TSTypeAnnotation",start:ve,end:i.index,typeAnnotation:_e.typeAnnotation}}var fc=/\s*}/y,Af={"<":">"};function hc(i){let ve=i.index-2;while(i.source[ve]!=="{")ve-=1;if(i.eat("if")){i.requireWhitespace();let Ae={type:"IfBlock",elseif:!1,start:ve,end:-1,test:_t(i),consequent:Vt(),alternate:null};i.append(Ae),i.allowWhitespace(),i.eat("}",!0),i.push(Ae,Ae.consequent);return}if(i.eat("each")){i.requireWhitespace();let Ae=_t(i);if(i.allowWhitespace(),!i.match("as")){let Re=Ae;if(Re.type==="SequenceExpression"&&Re.expressions)Re=Re.expressions[0];if(Re.type==="TSAsExpression"){let Oe=Re;Ae=Oe.expression;let Be=Oe.typeAnnotation.start-2;while(Be>=0&&!(i.source[Be]==="a"&&i.source[Be+1]==="s"))Be-=1;i.index=Be}}let Pe=null,Ne,De;if(i.eat("as"))i.requireWhitespace(),Pe=Nn(i);if(i.allowWhitespace(),i.eat(",")){i.allowWhitespace();let Re=i.readIdentifierName();if(!Re.name)throw Error("sveld: expected an identifier");Ne=Re.name,i.allowWhitespace()}if(i.eat("("))i.allowWhitespace(),De=_t(i),i.allowWhitespace(),i.eat(")",!0),i.allowWhitespace();i.eat("}",!0);let _e={type:"EachBlock",start:ve,end:-1,expression:Ae,body:Vt(),context:Pe,index:Ne,key:De};i.append(_e),i.push(_e,_e.body);return}if(i.eat("await")){i.requireWhitespace();let Ae=_t(i);i.allowWhitespace();let Pe={type:"AwaitBlock",start:ve,end:-1,expression:Ae,value:null,error:null,pending:null,then:null,catch:null};if(i.eat("then")){if(!i.matchRegex(fc))i.requireWhitespace(),Pe.value=Nn(i),i.allowWhitespace();Pe.then=Vt()}else if(i.eat("catch")){if(!i.matchRegex(fc))i.requireWhitespace(),Pe.error=Nn(i),i.allowWhitespace();Pe.catch=Vt()}else Pe.pending=Vt();i.eat("}",!0),i.append(Pe),i.push(Pe,Pe.then??Pe.catch??Pe.pending);return}if(i.eat("key")){i.requireWhitespace();let Ae=_t(i);i.allowWhitespace(),i.eat("}",!0);let Pe={type:"KeyBlock",start:ve,end:-1,expression:Ae,fragment:Vt()};i.append(Pe),i.push(Pe,Pe.fragment);return}if(i.eat("snippet")){i.requireWhitespace();let Ae=i.readIdentifierName();if(Ae.name==="")throw Error("sveld: expected a snippet name");i.allowWhitespace();let Pe;if(i.isTypeScript&&i.match("<")){let De=i.index,_e=gr(i,De,Af);Pe=i.source.slice(De+1,_e-1),i.index=_e}if(i.allowWhitespace(),i.eat("(")){let De=1;while(i.index<i.source.length&&(!i.match(")")||De!==1)){if(i.match("("))De++;if(i.match(")"))De--;i.index+=1}i.eat(")",!0)}i.allowWhitespace(),i.eat("}",!0);let Ne={type:"SnippetBlock",start:ve,end:-1,expression:Ae,typeParams:Pe,parameters:[],body:Vt()};i.append(Ne),i.push(Ne,Ne.body);return}throw Error("sveld: expected if/each/await/key/snippet")}function mc(i){let ve=i.index-1,Ae=i.current();if(Ae.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(),Ae.alternate=Vt(),i.fragments.push(Ae.alternate),i.eat("if")){i.requireWhitespace();let Pe=_t(i);i.allowWhitespace(),i.eat("}",!0);let Ne=ve-1;while(i.source[Ne]!=="{")Ne-=1;let De={type:"IfBlock",start:Ne,end:-1,elseif:!0,test:Pe,consequent:Vt(),alternate:null};i.append(De),i.stack.push(De),i.fragments.pop(),i.fragments.push(De.consequent)}else i.allowWhitespace(),i.eat("}",!0);return}if(Ae.type==="EachBlock"){if(!i.eat("else"))throw Error("sveld: expected {:else}");i.allowWhitespace(),i.eat("}",!0),Ae.fallback=Vt(),i.fragments.pop(),i.fragments.push(Ae.fallback);return}if(Ae.type==="AwaitBlock"){if(i.eat("then")){if(Ae.then)throw Error("sveld: duplicate {:then}");if(!i.eat("}"))i.requireWhitespace(),Ae.value=Nn(i),i.allowWhitespace(),i.eat("}",!0);Ae.then=Vt(),i.fragments.pop(),i.fragments.push(Ae.then);return}if(i.eat("catch")){if(Ae.catch)throw Error("sveld: duplicate {:catch}");if(!i.eat("}"))i.requireWhitespace(),Ae.error=Nn(i),i.allowWhitespace(),i.eat("}",!0);Ae.catch=Vt(),i.fragments.pop(),i.fragments.push(Ae.catch);return}throw Error("sveld: expected {:then ...} or {:catch ...}")}throw Error("sveld: {:...} not valid here")}function gc(i){let ve=i.current();switch(ve.type){case"IfBlock":{i.eat("if",!0),i.allowWhitespace(),i.eat("}",!0);while(ve.type==="IfBlock"&&ve.elseif)ve.end=i.index,i.stack.pop(),ve=i.current();ve.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),ve.end=i.index,i.pop()}var kf=/(?:let|const)\b/y,wf=/(?:var|interface|enum)\b/y,Pf=/type\b/y;function yc(i){let ve=i.index;if(i.matchRegex(wf))throw Error("sveld: `var`/`interface`/`enum` are not valid here");if(!i.matchRegex(kf)&&!i.matchRegex(Pf))return null;let Ae=i.root.comments.length,Pe=Go(i.source,ve,i.isTypeScript,i.root.comments);if(Pe.type!=="VariableDeclaration"){if(Pe.type==="ExpressionStatement")return i.root.comments.length=Ae,null;throw Error("sveld: expected a `let`/`const` declaration")}if(Pe.kind!=="let"&&Pe.kind!=="const")throw Error("sveld: expected a `let`/`const` declaration");return i.index=Pe.end,i.allowWhitespace(),i.eat("}",!0),Pe}var Nf=/\s*}/y;function xc(i){let ve=i.index;while(i.source[ve]!=="{")ve-=1;if(i.eat("html")){i.requireWhitespace();let Ae=_t(i);i.allowWhitespace(),i.eat("}",!0);let Pe={type:"HtmlTag",start:ve,end:i.index,expression:Ae};i.append(Pe);return}if(i.eat("debug")){let Ae;if(i.read(Nf))Ae=[];else{let Ne=_t(i);Ae=Ne.type==="SequenceExpression"?Ne.expressions:[Ne];for(let De of Ae)if(De.type!=="Identifier")throw Error("sveld: {@debug} arguments must be identifiers");i.allowWhitespace(),i.eat("}",!0)}let Pe={type:"DebugTag",start:ve,end:i.index,identifiers:Ae};i.append(Pe);return}if(i.eat("const")){i.requireWhitespace();let Ae=Nn(i);i.allowWhitespace(),i.eat("=",!0),i.allowWhitespace();let Pe=_t(i),Ne=i.index;i.allowWhitespace(),i.eat("}",!0);let De={type:"VariableDeclarator",id:Ae,init:Pe,start:Ae.start,end:Ne},_e={type:"ConstTag",start:ve,end:i.index,declaration:{type:"VariableDeclaration",kind:"const",declarations:[De],start:ve+2,end:i.index-1}};i.append(_e);return}if(i.eat("render")){i.requireWhitespace();let Ae=_t(i);if(!(Ae.type==="CallExpression"||Ae.type==="ChainExpression"&&Ae.expression.type==="CallExpression"))throw Error("sveld: {@render ...} must be a function call");i.allowWhitespace(),i.eat("}",!0);let Ne={type:"RenderTag",start:ve,end:i.index,expression:Ae};i.append(Ne);return}throw Error("sveld: expected html/debug/const/render")}function bc(i){let ve=i.index;if(i.index+=1,i.allowWhitespace(),i.eat("#")){hc(i);return}if(i.eat(":")){mc(i);return}if(i.eat("@")){xc(i);return}if(i.match("/")&&!i.match("/*")&&!i.match("//")){i.eat("/"),gc(i);return}let Ae=yc(i);if(Ae){let De={type:"DeclarationTag",start:ve,end:i.index,declaration:Ae};i.append(De);return}let Pe=_t(i);i.allowWhitespace(),i.eat("}",!0);let Ne={type:"ExpressionTag",start:ve,end:i.index,expression:Pe};i.append(Ne)}function Ec(i){let{index:ve,source:Ae}=i,Pe=Ae.indexOf("<",ve),Ne=Ae.indexOf("{",ve),De;if(Pe===-1)De=Ne===-1?Ae.length:Ne;else De=Ne===-1?Pe:Math.min(Pe,Ne);i.index=De;let _e=Ae.slice(ve,De),Re={type:"Text",start:ve,end:i.index,raw:_e,data:_e};i.append(Re)}function P(i){let ve=i.trimEnd(),Ae=new wi(ve,i.length);while(Ae.index<Ae.source.length)if(Ae.match("<"))cc(Ae);else if(Ae.match("{"))bc(Ae);else Ec(Ae);let Pe=Ae.root.fragment.nodes.findIndex((Ne)=>Ne.type==="SvelteOptions");if(Pe!==-1){let[Ne]=Ae.root.fragment.nodes.splice(Pe,1);Ae.root.options=lc(Ne)}return Ae.root}function kt(i){return typeof i==="object"&&i!==null}function re(i){return kt(i)&&i.type==="VariableDeclaration"&&Array.isArray(i.declarations)}function l(i){return kt(i)&&i.type==="Literal"}function a(i){return kt(i)&&i.type==="Identifier"&&typeof i.name==="string"}function ne(i){return kt(i)&&i.type==="MemberExpression"}function bn(i){return kt(i)&&i.type==="ObjectExpression"&&Array.isArray(i.properties)}function _f(i){return kt(i)&&i.type==="CallExpression"}function p(i,ve){if(!_f(i))return!1;return!!i.callee&&kt(i.callee)&&i.callee.type==="Identifier"&&i.callee.name===ve}function f(i){if(kt(i)&&(i.type==="TSAsExpression"||i.type==="TSSatisfiesExpression")&&"expression"in i)return f(i.expression);return i}function ie(i){if(kt(i)&&(i.type==="TSAsExpression"||i.type==="TSSatisfiesExpression")&&"typeAnnotation"in i)return i.typeAnnotation;return}function If(i){return kt(i)&&i.type==="NewExpression"}function Ni(i,ve){if(!If(i))return!1;return!!i.callee&&kt(i.callee)&&i.callee.type==="Identifier"&&i.callee.name===ve}function Zr(i){if(!kt(i)||typeof i.type!=="string")return null;if(i.type==="Literal"){let ve=i.value;if(typeof ve==="string")return ve;return ve==null?null:String(ve)}if(i.type==="TemplateLiteral"){let ve=i.quasis;if(ve?.length===1){let Ae=ve[0]?.value?.cooked;return Ae==null?null:Ae}}return null}var y=Symbol("sveld.parsedComponentTypeScriptMetadata");function Jn(i){return i[y]}function Cc(i,ve){if(ve.length===0)return;let Ae=new Set(i.props.map((Pe)=>Pe.name));for(let Pe of ve){if(Ae.has(Pe.name))continue;Ae.add(Pe.name),i.props.push({name:Pe.name,kind:"let",constant:!1,type:Pe.type,typeSource:"typescript",...Pe.description?{description:Pe.description}:{},isFunction:Pe.type.includes("=>"),isFunctionDeclaration:!1,isRequired:Pe.isRequired,reactive:!1})}}var Df=/\w/;function Rf(i,ve){let Ae=i.trim();if(!Ae.startsWith("{")||!Ae.endsWith("}"))return;let Pe=Ae.slice(1,-1),Ne=[],De=0,_e="";for(let Re of Pe)if(Re==="{"||Re==="<"||Re==="("||Re==="[")De++,_e+=Re;else if(Re==="}"||Re===">"||Re===")"||Re==="]")De--,_e+=Re;else if((Re===";"||Re===",")&&De===0)Ne.push(_e.trim()),_e="";else _e+=Re;if(_e.trim())Ne.push(_e.trim());for(let Re of Ne){if(!Re.startsWith(ve))continue;let Oe=Re.slice(ve.length);if(Oe.length>0&&Df.test(Oe[0]))continue;let Be=Oe.trimStart();if(Be.startsWith("?"))Be=Be.slice(1).trimStart();if(Be.startsWith(":"))return Be.slice(1).trim()}return}function M(i,ve,Ae){let Pe=Ae;if(Pe.computed||Pe.object?.type!=="Identifier"||Pe.property?.type!=="Identifier")return;let Ne=Pe.object.name,De=Pe.property.name;if(!Ne||!De)return;if(i.wholePropsLocals.has(Ne))return ve.getPropTypeByLocalOrPublic(De);let _e=ve.getPropTypeByLocalOrPublic(Ne)??ve.findVariableTypeAndDescription(Ne)?.type;if(!_e)return;return Rf(_e,De)}function Lf(i){let ve="";for(let Ae=0;Ae<i.length;Ae++){let Pe=i[Ae];if(Pe==="*"&&i[Ae+1]==="*"){if(ve+=".*",Ae++,i[Ae+1]==="/")Ae++;continue}if(Pe==="*"){ve+="[^/]*";continue}if(Pe==="?"){ve+="[^/]";continue}ve+=".+^$()[]{}|\\".includes(Pe)?`\\${Pe}`:Pe}return ve}function vc(i,ve){return new RegExp(`^${Lf(i)}$`).test(ve)}var B={"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"},Of={"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"};function _n(i){return{...i,code:B[i.kind],severity:Of[i.kind]}}function j(i,ve){if(ve)return i;return i.filter((Ae)=>Ae.kind!=="jsdoc-unknown-tag")}function J(i,ve){if(!ve)return[];return i.filter((Ae)=>!Ae.ignored&&(ve!=="errors"||Ae.severity==="error"))}function Mf(i,ve){if(ve.code!==void 0&&ve.code!==i.code)return!1;if(ve.name!==void 0&&ve.name!==i.name)return!1;if(ve.component!==void 0&&!vc(ve.component,i.component))return!1;return!0}function Sc(i,ve){if(!ve||ve.length===0)return i;return i.map((Ae)=>Ae.ignored||ve.some((Pe)=>Mf(Ae,Pe))?{...Ae,ignored:!0}:Ae)}var Bf={"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"},$f=["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"];function es(i){let ve=new Set,Ae=[];for(let Pe of i){let Ne=`${Pe.component}:${Pe.kind}:${Pe.name}`;if(ve.has(Ne))continue;ve.add(Ne),Ae.push(Pe)}return Ae}function F(i){let ve=i.filter((_e)=>!_e.ignored),Ae=i.length-ve.length,Pe=Ae>0?` (${Ae} ignored)`:"";if(ve.length===0)return`sveld: all types resolved${Pe}.`;let Ne=[],De=ve.length;Ne.push(`sveld: ${De} unresolved type${De===1?"":"s"} found${Pe}.`);for(let _e of $f){let Re=ve.filter((Be)=>Be.kind===_e);if(Re.length===0)continue;Ne.push(""),Ne.push(`${Bf[_e]} (${Re.length}):`);let Oe=new Map;for(let Be of Re){let Me=Oe.get(Be.component)??[];Me.push(Be),Oe.set(Be.component,Me)}for(let[Be,Me]of Oe){Ne.push(` ${Be}`);for(let je of Me){let qe=je.source?` (${Be}:${je.source.start.line}:${je.source.start.column})`:"";Ne.push(` - ${je.message}${qe} [${je.code}]`)}}}return Ne.join(`
|
|
17
|
+
`)}var se=1;function q(i){return`${JSON.stringify({kind:"diagnostics",schemaVersion:se,diagnostics:i},null,2)}
|
|
18
|
+
`}function n(i,ve,Ae,Pe,Ne){i.diagnosticRecords.push(_n({component:i.componentFilePath,kind:ve,name:Ae,message:Pe,...Ne?{source:Ne}:{},...Ff(i,ve,Ae)?{ignored:!0}:{}}))}function Tc(i,ve){return`${i}:${ve}`}function d(i,ve,Ae,Pe){if(!Pe||Pe.length===0)return;let Ne=Tc(ve,Ae),De=i.sveldIgnoreDirectives.get(Ne)??new Set;for(let _e of Pe)De.add(_e);i.sveldIgnoreDirectives.set(Ne,De)}function Ff(i,ve,Ae){let Pe=i.sveldIgnoreDirectives.get(Tc(ve,Ae));if(!Pe)return!1;return Pe.has("")||Pe.has(B[ve])}var _i=/[\r\n]+/g;function jf(i){if(i.sourceLineStartOffsetsCache)return i.sourceLineStartOffsetsCache;let ve=[0];if(i.source){let Ae=i.source.indexOf(`
|
|
19
|
+
`);while(Ae!==-1)ve.push(Ae+1),Ae=i.source.indexOf(`
|
|
20
|
+
`,Ae+1)}return i.sourceLineStartOffsetsCache=ve,ve}function Ac(i,ve){if(!i.source||ve<0||ve>i.source.length)return;let Ae=jf(i),Pe=i.sourceLineHint;if(Pe!==void 0)for(let _e=Pe;_e<=Pe+1&&_e<Ae.length;_e++){let Re=Ae[_e],Oe=Ae[_e+1]??Number.POSITIVE_INFINITY;if(ve>=Re&&ve<Oe)return i.sourceLineHint=_e,{line:_e+1,column:ve-Re}}let Ne=0,De=Ae.length-1;while(Ne<=De){let _e=Ne+De>>>1,Re=Ae[_e],Oe=Ae[_e+1]??Number.POSITIVE_INFINITY;if(ve<Re)De=_e-1;else if(ve>=Oe)Ne=_e+1;else return i.sourceLineHint=_e,{line:_e+1,column:ve-Re}}return}function V(i,ve,Ae){if(ve===void 0||Ae===void 0||Ae<ve)return;let Pe=Ac(i,ve),Ne=Ac(i,Ae);if(!Pe||!Ne)return;return{start:Pe,end:Ne}}function t(i,ve){if(!ve||typeof ve!=="object")return;let Ae="start"in ve&&typeof ve.start==="number"?ve.start:void 0,Pe="end"in ve&&typeof ve.end==="number"?ve.end:void 0;return V(i,Ae,Pe)}function an(i,ve){if(!ve||ve.length===0)return;let Ae=[...ve];while(Ae.length>1){let Oe=Ae[Ae.length-1];if(Oe.tag!==void 0||!Oe.raw.trim().endsWith("*/"))break;Ae.pop()}let Pe=Ae[0],Ne=Pe.raw.indexOf(`@${Pe.tag??""}`),De=Pe.start+Math.max(Ne,0),_e=Ae[Ae.length-1],Re=_e.start+_e.raw.length;return V(i,De,Re)}function r(i,ve,Ae){return i.source?.slice(ve,Ae)}function ts(i,ve){if(!ve||typeof ve!=="object")return;let Ae="start"in ve&&typeof ve.start==="number"?ve.start:void 0,Pe="end"in ve&&typeof ve.end==="number"?ve.end:void 0;if(Ae===void 0||Pe===void 0)return;return r(i,Ae,Pe)?.replace(_i," ")}function u(i){return i===void 0||i===""?void 0:i}function I(i,ve,Ae,Pe){if(u(Ae)===void 0)return;if(i.trackPropLocalName(Ae),ve.props.has(Ae)){let Ne=ve.props.get(Ae);ve.props.set(Ae,{...Ne,...Pe})}else ve.props.set(Ae,Pe)}function m(i,ve,Ae,Pe=0){let Ne,De,_e=!1;if(!Ae||typeof Ae!=="object"||!("type"in Ae))return{value:Ne,type:De,isFunction:_e};let Re=wc(i,ve,Ae);if(Ae.type==="ObjectExpression"||Ae.type==="BinaryExpression"||Ae.type==="ArrayExpression"||Ae.type==="ArrowFunctionExpression"||Ae.type==="FunctionExpression"){let Oe=Ae;if("start"in Oe&&"end"in Oe&&typeof Oe.start==="number"&&typeof Oe.end==="number")Ne=r(ve,Oe.start,Oe.end)?.replace(_i," ");if(De=Ne,_e=Ae.type==="ArrowFunctionExpression"||Ae.type==="FunctionExpression",Ae.type==="BinaryExpression"){let Be=Ae;if(Be.left&&typeof Be.left==="object"&&"type"in Be.left&&Be.left.type==="Literal"&&"value"in Be.left&&typeof Be.left.value==="string")De="string"}if(Ae.type==="ArrowFunctionExpression"||Ae.type==="FunctionExpression")De=_c(Ae),Ne=kc(ve,Ae)}else if(Ae.type==="UnaryExpression"){let Oe=Ae;if("start"in Oe&&"end"in Oe&&typeof Oe.start==="number"&&typeof Oe.end==="number")Ne=r(ve,Oe.start,Oe.end);if(Oe.argument){if(typeof Oe.argument==="object"&&"type"in Oe.argument&&Oe.argument.type==="UnaryExpression")De=m(i,ve,Oe.argument).type;else if(typeof Oe.argument==="object"&&"value"in Oe.argument)De=typeof Oe.argument.value}}else if(Ae.type==="NewExpression"){let Oe=Ae;if("start"in Oe&&"end"in Oe&&typeof Oe.start==="number"&&typeof Oe.end==="number")Ne=r(ve,Oe.start,Oe.end);if(Oe.callee&&typeof Oe.callee==="object"&&"type"in Oe.callee&&Oe.callee.type==="Identifier"){let Be=Oe.callee.name;if(Be==="Date")De="Date";else if(Be==="Map")De="Map<any, any>";else if(Be==="Set")De="Set<any>";else if(Be==="WeakMap")De="WeakMap<object, any>";else if(Be==="WeakSet")De="WeakSet<object>";else if(Be==="Array")De="any[]";else if(Be==="RegExp"||Be==="Regexp")De="RegExp";else if(Be==="Error")De="Error";else De=Be}}else if(Ae.type==="CallExpression"){let Oe=Ae;if("start"in Oe&&"end"in Oe&&typeof Oe.start==="number"&&typeof Oe.end==="number")Ne=r(ve,Oe.start,Oe.end);let Be=Oe.callee,Me=Be&&typeof Be==="object"&&"type"in Be&&Be.type==="Identifier"?Be.name:void 0;if((Me==="$derived"||Me==="$state")&&Oe.arguments.length===1&&Pe<5)return{...m(i,ve,Oe.arguments[0],Pe+1),value:Ne,defaultValue:Re};if(Me){let je=qf(i,ve,Me);if(je)return{value:Ne,type:void 0,isFunction:!1,defaultValue:Re,resolvedType:je};if(ve.funcDecls.has(Me)||Wf(ve,Me))return{value:Ne,type:void 0,isFunction:!1,defaultValue:Re,pendingCallDefault:{calleeName:Me}};let qe=ve.valueImportBindingsByLocalName.get(Me);if(qe)return{value:Ne,type:void 0,isFunction:!1,defaultValue:Re,pendingCallDefault:{calleeName:Me,importSource:qe.source,importedName:qe.importedName}}}return{value:Ne,type:void 0,isFunction:!1,defaultValue:Re,pendingCallDefault:{calleeName:Me??Vf(ve,Be)}}}else if(Ae.type==="Identifier"){let Oe=Ae;if(Pe<5){let Be=Pc(ve,Oe.name);if(Be){let Me=m(i,ve,Be,Pe+1),je=i.resolveLocalVarJSDoc(Oe.name);return{...Me,resolvedType:je?.type??Me.resolvedType,resolvedDescription:je?.description??Me.resolvedDescription,resolvedParams:je?.params??Me.resolvedParams,resolvedReturnType:je?.returnType??Me.resolvedReturnType}}if(ve.funcDecls.has(Oe.name)){let Me=i.resolveLocalVarJSDoc(Oe.name),je=ve.funcDecls.get(Oe.name);return{value:je?kc(ve,je):void 0,type:void 0,isFunction:!0,defaultValue:je?wc(i,ve,je):void 0,resolvedType:Me?.type??Kf(Me,je),resolvedDescription:Me?.description,resolvedParams:Me?.params,resolvedReturnType:Me?.returnType}}}if("start"in Oe&&"end"in Oe&&typeof Oe.start==="number"&&typeof Oe.end==="number")Ne=r(ve,Oe.start,Oe.end)}else if(Ae.type==="MemberExpression"){let Oe=Ae;if("start"in Oe&&"end"in Oe&&typeof Oe.start==="number"&&typeof Oe.end==="number")Ne=r(ve,Oe.start,Oe.end);if(i.isNumericConstant(Ae))De="number"}else if(Ae.type==="TemplateLiteral"){let Oe=Ae;if("start"in Oe&&"end"in Oe&&typeof Oe.start==="number"&&typeof Oe.end==="number")Ne=r(ve,Oe.start,Oe.end);De="string"}else if("raw"in Ae&&typeof Ae.raw==="string"){if(Ne=Ae.raw,"value"in Ae)De=Ae.value==null?void 0:typeof Ae.value}return{value:Ne,type:De,isFunction:_e,defaultValue:Re}}function Pc(i,ve){for(let Ae of i.vars)for(let Pe of Ae.declarations)if(Pe.id&&typeof Pe.id==="object"&&"type"in Pe.id&&Pe.id.type==="Identifier"&&"name"in Pe.id&&Pe.id.name===ve&&Pe.init)return Pe.init;return}function yr(i,ve){for(let Ae of i.vars){if(Ae.kind!=="const")continue;for(let Pe of Ae.declarations)if(Pe.id&&typeof Pe.id==="object"&&"type"in Pe.id&&Pe.id.type==="Identifier"&&"name"in Pe.id&&Pe.id.name===ve&&Pe.init)return Pe.init}return}function Vf(i,ve){if(ve&&typeof ve==="object"&&"start"in ve&&"end"in ve&&typeof ve.start==="number"&&typeof ve.end==="number")return r(i,ve.start,ve.end)??"call";return"call"}function qf(i,ve,Ae){let Pe=i.resolveLocalVarJSDoc(Ae);if(Pe?.returnType)return Pe.returnType;let Ne=ve.funcDecls.get(Ae)??Nc(ve,Ae);if(!Ne)return;let De=Hf(ve,Ne);if(De)return De;let _e=Gf(ve,Ae);if(_e)return _e;let Re=Ic(Ne);return Re==="any"?void 0:Re}function Wf(i,ve){return Nc(i,ve)!==void 0}function Nc(i,ve){let Ae=Pc(i,ve);if(!Ae||typeof Ae!=="object"||!("type"in Ae))return;if(Ae.type==="ArrowFunctionExpression"||Ae.type==="FunctionExpression")return Ae;return}function Gf(i,ve){for(let Ae of i.vars)for(let Pe of Ae.declarations){let Ne=Pe.id;if(!Ne||typeof Ne!=="object"||!("type"in Ne)||Ne.type!=="Identifier"||!("name"in Ne)||Ne.name!==ve)continue;let De=Ne.typeAnnotation;if(De?.type!=="TSTypeAnnotation")return;let _e=De.typeAnnotation;if(!_e||typeof _e.start!=="number"||typeof _e.end!=="number")return;return Uf(r(i,_e.start,_e.end))}return}function Uf(i){if(!i)return;let ve=i.lastIndexOf("=>");if(ve===-1)return;return i.slice(ve+2).trim()||void 0}function Hf(i,ve){let Ae=ve.returnType;if(Ae?.type!=="TSTypeAnnotation")return;let Pe=Ae.typeAnnotation;if(!Pe||typeof Pe.start!=="number"||typeof Pe.end!=="number")return;return r(i,Pe.start,Pe.end)}function Kf(i,ve){let Ae=i?.returnType??"any",Pe=i?.params;if(Pe&&Pe.length>0)return`(${Pe.map((De)=>`${De.name}${De.optional?"?":""}: ${De.type}`).join(", ")}) => ${Ae}`;if(i?.returnType)return`() => ${Ae}`;if(ve)return _c(ve);return"(...args: any[]) => any"}function _c(i){return`(${zf(i)}) => ${Ic(i)}`}function zf(i){let ve=i.params;if(!Array.isArray(ve)||ve.length===0)return"...args: any[]";let Ae=[];for(let Pe of ve)if(Pe&&typeof Pe==="object"&&"type"in Pe&&Pe.type==="Identifier"&&"name"in Pe&&typeof Pe.name==="string")Ae.push(`${Pe.name}: any`);else return"...args: any[]";return Ae.join(", ")}function Ic(i){if(i.async||i.generator)return"any";let ve=i.body,Ae;if(ve&&typeof ve==="object"&&"type"in ve&&ve.type==="BlockStatement"){if(Ae=Xf(ve),Ae.length===0)return"any"}else Ae=[ve];let Pe=null;for(let Ne of Ae){let De=Jf(Ne);if(!De)return"any";if(Pe===null)Pe=De;else if(Pe!==De)return"any"}return Pe??"any"}function Xf(i){let ve=[];return Ii(i,ve),ve}function Ii(i,ve){if(!i||typeof i!=="object")return;let Ae=i;if(typeof Ae.type!=="string")return;if(Ae.type==="FunctionDeclaration"||Ae.type==="FunctionExpression"||Ae.type==="ArrowFunctionExpression")return;if(Ae.type==="ReturnStatement")ve.push(Ae.argument??null);for(let Pe in Ae){if(Pe==="leadingComments")continue;let Ne=Ae[Pe];if(!Ne||typeof Ne!=="object")continue;if(Array.isArray(Ne))for(let De=0;De<Ne.length;De++)Ii(Ne[De],ve);else Ii(Ne,ve)}}function Jf(i){if(!i||typeof i!=="object"||!("type"in i))return null;switch(i.type){case"Literal":{let ve=i.value;if(typeof ve==="string")return"string";if(typeof ve==="number")return"number";if(typeof ve==="boolean")return"boolean";return null}case"TemplateLiteral":return"string";case"CallExpression":{let ve=i.callee;if(ve&&typeof ve==="object"&&"type"in ve&&ve.type==="Identifier"){let Ae=ve.name;if(Ae==="String")return"string";if(Ae==="Number")return"number";if(Ae==="Boolean")return"boolean"}return null}default:return null}}function oe(i){if(p(i,"$bindable"))return{init:i.arguments[0],bindable:!0};return{init:i,bindable:!1}}function Yf(i,ve){let Ae=ve.params;if(!Array.isArray(Ae)||Ae.length===0)return"";let Pe=Ae[0],Ne=Ae[Ae.length-1];if(typeof Pe.start!=="number"||typeof Ne.end!=="number")return"";return r(i,Pe.start,Ne.end)??""}function kc(i,ve){if(ve.generator)return;let Ae=ve.body;if(!Ae||typeof Ae!=="object"||!("type"in Ae))return;let Pe=Yf(i,ve),Ne=ve.async?"async ":"",De=(Re,Oe)=>Re&&typeof Re==="object"&&("type"in Re)&&Re.type==="ObjectExpression"?`(${Oe})`:Oe;if(Ae.type!=="BlockStatement"){let Re=ts(i,Ae);return Re===void 0?void 0:`${Ne}(${Pe}) => ${De(Ae,Re)}`}let _e=Ae.body;if(_e.length===0)return`${Ne}(${Pe}) => {}`;if(_e.length===1){let Re=_e[0];if(Re&&typeof Re==="object"&&"type"in Re&&Re.type==="ReturnStatement"){let Oe=Re.argument;if(Oe){let Be=ts(i,Oe);if(Be!==void 0)return`${Ne}(${Pe}) => ${De(Oe,Be)}`}}}return}function wc(i,ve,Ae){let Pe=ts(ve,Ae);if(!Pe||!Ae||typeof Ae!=="object"||!("type"in Ae))return;let Ne="expression";if(Ae.type==="Literal"||Ae.type==="UnaryExpression")Ne="literal";else if(Ae.type==="TemplateLiteral")Ne=Ae.expressions.length===0?"literal":"expression";else if(Ae.type==="ArrayExpression")Ne="array";else if(Ae.type==="ObjectExpression")Ne="object";else if(Ae.type==="ArrowFunctionExpression"||Ae.type==="FunctionExpression"||Ae.type==="FunctionDeclaration")Ne="function";let De={raw:Pe,kind:Ne};if(Ne==="literal"||Ne==="array"||Ne==="object"){let _e=Di(i,Ae);if(_e.ok)De.value=_e.value}return De}function Di(i,ve){if(!ve||typeof ve!=="object"||!("type"in ve))return{ok:!1};if(ve.type==="Literal"){let Ae=ve.value;return typeof Ae==="bigint"?{ok:!1}:{ok:!0,value:Ae}}if(ve.type==="UnaryExpression"){let Ae=ve,Pe=Ae.argument;if(!Pe||typeof Pe!=="object"||!("type"in Pe)||Pe.type!=="Literal")return{ok:!1};let Ne=Pe.value;if(typeof Ne==="number"){if(Ae.operator==="-")return{ok:!0,value:-Ne};if(Ae.operator==="+")return{ok:!0,value:Ne}}if(typeof Ne==="boolean"&&Ae.operator==="!")return{ok:!0,value:!Ne};return{ok:!1}}if(ve.type==="TemplateLiteral"){let Ae=ve;if(Ae.expressions.length>0||Ae.quasis.length!==1)return{ok:!1};return{ok:!0,value:Ae.quasis[0].value.cooked??Ae.quasis[0].value.raw}}if(ve.type==="ArrayExpression"){let Ae=ve,Pe=[];for(let Ne of Ae.elements){if(!Ne)return{ok:!1};let De=Di(i,Ne);if(!De.ok)return{ok:!1};Pe.push(De.value)}return{ok:!0,value:Pe}}if(ve.type==="ObjectExpression"){let Ae=ve,Pe={};for(let Ne of Ae.properties){if(Ne.type!=="Property"||Ne.computed)return{ok:!1};let De=i.getPropertyName(Ne.key);if(!De)return{ok:!1};let _e=Di(i,Ne.value);if(!_e.ok)return{ok:!1};Pe[De]=_e.value}return{ok:!0,value:Pe}}return{ok:!1}}function Qf(i){let ve=[],Ae=0,Pe=0;for(let Ne=0;Ne<i.length;Ne++){let De=i[Ne];if(De==="<"||De==="("||De==="["||De==="{")Ae++;else if(De===">"||De===")"||De==="]"||De==="}")Ae=Math.max(Ae-1,0);else if(Ae===0&&(De===";"||De===","))ve.push(i.slice(Pe,Ne)),Pe=Ne+1}return ve.push(i.slice(Pe)),ve}function Zf(i){let ve=0;for(let Ae=0;Ae<i.length;Ae++){let Pe=i[Ae];if(Pe==="<"||Pe==="("||Pe==="["||Pe==="{")ve++;else if(Pe===">"||Pe===")"||Pe==="]"||Pe==="}")ve=Math.max(ve-1,0);else if(ve===0&&Pe===":")return Ae}return-1}var eh=/^\{([\s\S]*)\}$/,th=/^[A-Za-z_$][\w$]*$/;function ns(i){let ve=i.trim(),Ae=eh.exec(ve);if(!Ae)return null;let Pe=Ae[1].trim();if(Pe==="")return[];let Ne=[];for(let De of Qf(Pe)){let _e=De.trim();if(!_e)continue;let Re=Zf(_e);if(Re===-1)return null;let Oe=_e.slice(0,Re).trim(),Be=_e.slice(Re+1).trim();if(!Be)return null;let Me=!1;if(Oe.endsWith("?"))Me=!0,Oe=Oe.slice(0,-1).trim();if(!th.test(Oe))return null;Ne.push({name:Oe,type:Be,optional:Me})}return Ne}function nh(i,ve,Ae,Pe){if(!a(Ae))return null;let Ne=yr(i,Ae.name);if(bn(Ne))return Lc(i,ve,Ne,Pe).properties;let De=ve.findVariableTypeAndDescription(Ae.name);if(!De)return null;let _e=ns(De.type);if(!_e)return null;return _e.map((Re)=>({name:Re.name,type:Re.type,optional:Re.optional}))}function Lc(i,ve,Ae,Pe){let Ne=[],De=!1;for(let _e of Ae.properties){if(_e.type==="SpreadElement"){let je=nh(i,ve,_e.argument,Pe);if(je)Ne.push(...je);else De=!0,n(i,"spread-unresolved",Pe,`Context "${Pe}" spreads a value sveld can't resolve; its shape is widened to "Record<string, any>".`,t(i,_e));continue}if(_e.type!=="Property")continue;let Re=ve.getPropertyName(_e.key);if(!Re)continue;let Oe="any",Be,Me;if(a(_e.value)){let je=_e.value.name,qe=ve.findVariableTypeAndDescription(je);if(qe)Oe=qe.type,Be=qe.description,Me=qe.internal;else n(i,"context-any-type",Re,`Context "${Pe}" property "${Re}" has no type annotation; defaulted to "any".`,t(i,_e))}else if(_e.value&&typeof _e.value==="object"&&"type"in _e.value&&(_e.value.type==="ArrowFunctionExpression"||_e.value.type==="FunctionExpression"))Oe=`(${_e.value.params?.map((Ge)=>{if(a(Ge))return`${Ge.name||"arg"}: any`;return"arg: any"}).join(", ")||""}) => any`;else if(l(_e.value))Oe=_e.value.value==null?"null":typeof _e.value.value;Ne.push({name:Re,type:Oe,description:Be,optional:!1,...Me?{internal:!0}:{}})}return{properties:Ne,hasUnresolvedSpread:De}}var rh=/[-_.:/\s]+/;function xr(i){return`${i.split(rh).map((Pe)=>Pe.charAt(0).toUpperCase()+Pe.slice(1)).join("")}Context`}function Dc(i,ve,Ae,Pe){if(!Ae||typeof Ae!=="object"||!("type"in Ae))return null;if(Ae.type==="ObjectExpression"){if(!bn(Ae))return null;let{properties:Ne,hasUnresolvedSpread:De}=Lc(i,ve,Ae,Pe);return{key:Pe,typeName:xr(Pe),properties:Ne,description:void 0,...De?{hasUnresolvedSpread:De}:{}}}else if(a(Ae)){let Ne=Ae.name,De=ve.findVariableTypeAndDescription(Ne);if(De)return{key:Pe,typeName:xr(Pe),properties:[{name:Ne,type:De.type,description:De.description,optional:!1}],description:void 0,...De.internal?{internal:!0}:{}};return n(i,"context-any-type",Ne,`Context "${Pe}" variable "${Ne}" has no type annotation; defaulted to "any".`,t(i,Ae)),{key:Pe,typeName:xr(Pe),properties:[{name:Ne,type:"any",description:void 0,optional:!1}]}}return null}function Rc(i){let ve=i.callee;if(!ve||typeof ve!=="object"||!("type"in ve))return null;let Ae=ve.type==="Identifier"&&ve.name==="Symbol",Pe=ve.type==="MemberExpression"&&!ve.computed&&ve.object.type==="Identifier"&&ve.object.name==="Symbol"&&ve.property.type==="Identifier"&&ve.property.name==="for";if(!Ae&&!Pe)return null;let Ne=i.arguments[0];if(!Ne||typeof Ne!=="object"||!("type"in Ne))return"";if(Ne.type==="Literal"&&typeof Ne.value==="string")return Ne.value;if(Ne.type==="TemplateLiteral"&&Ne.quasis?.length===1)return Ne.quasis[0].value.cooked??"";return""}function Oc(i,ve,Ae=0){if(!ve||typeof ve!=="object"||!("type"in ve))return{kind:"unresolved"};let Pe=ve;if(Pe.type==="Literal"||Pe.type==="TemplateLiteral"){let Ne=Zr(Pe);return Ne==null?{kind:"unresolved"}:{kind:"resolved",key:Ne}}if(Pe.type==="CallExpression"||Pe.type==="NewExpression"){let Ne=Rc(Pe);return Ne==null?{kind:"unresolved"}:{kind:"resolved",key:Ne}}if(Pe.type==="Identifier"){if(Ae>=5)return{kind:"unresolved"};let Ne=yr(i,Pe.name);if(Ne&&typeof Ne==="object"&&"type"in Ne){let _e=Ne;if((_e.type==="CallExpression"||_e.type==="NewExpression")&&Rc(_e)==="")return{kind:"resolved",key:Pe.name};return Oc(i,_e,Ae+1)}let De=i.valueImportBindingsByLocalName.get(Pe.name);if(De)return{kind:"pending",importSource:De.source,importedName:De.importedName};return{kind:"unresolved"}}return{kind:"unresolved"}}function ae(i,ve,Ae,Pe){if(!Ae||typeof Ae!=="object"||!("type"in Ae)||Ae.type!=="CallExpression")return;let Ne=Ae,De=Ne.arguments[0];if(!De)return;let _e=Oc(i,De);if(_e.kind==="unresolved"||_e.kind==="resolved"&&!_e.key){let je=i.componentFilePath?` in ${i.componentFilePath}`:"";console.warn(`Warning: Could not resolve setContext key${je}. Use a string literal, const-bound string, or Symbol(). Skipping context type generation.`);return}let Re=Ne.arguments[1];if(!Re)return;let Oe=t(i,Ae);if(_e.kind==="pending"){let je=Dc(i,ve,Re,"");if(je)i.pendingContextKeyCandidates.push({importSource:_e.importSource,importedName:_e.importedName,properties:je.properties,description:je.description,source:Oe});return}let Be=_e.key,Me=Dc(i,ve,Re,Be);if(!Me)return;if(i.contexts.has(Be)){n(i,"context-duplicate-key",Be,`setContext("${Be}", ...) was called more than once; only the first call's shape is used.`,Oe);return}i.contexts.set(Be,{...Me,source:Oe})}function ce(i,ve){if(!ve||typeof ve!=="object"||!("type"in ve))return;if(bn(ve))return Bc(i,ve);if(ve.type==="ArrayExpression")return $c(i,ve);return}function Mc(i,ve){if(!ve||typeof ve!=="object"||!("type"in ve))return"any";if(a(ve))return i.findVariableTypeAndDescription(ve.name)?.type??"any";if(l(ve)){let Ae=ve.value;return Ae===null?"null":typeof Ae}if(bn(ve))return Bc(i,ve);if(ve.type==="ArrayExpression")return $c(i,ve);return"any"}function Bc(i,ve){let Ae=[];for(let Pe of ve.properties){if(Pe.type!=="Property"||Pe.computed)continue;let Ne=i.getPropertyName(Pe.key);if(!Ne)continue;Ae.push({name:Ne,type:Mc(i,Pe.value)})}return rs(Ae)}function $c(i,ve){let Ae=new Set(ve.elements.filter((Pe)=>Pe!=null).map((Pe)=>Mc(i,Pe)));if(Ae.size===0)return"any[]";if(Ae.size===1)return`${[...Ae][0]}[]`;return`(${[...Ae].join(" | ")})[]`}function G(i){return typeof i==="string"?JSON.stringify(i):String(i)}function h(i,{name:ve,detail:Ae,has_argument:Pe,description:Ne,deprecated:De,tags:_e,internal:Re,source:Oe}){if(ve===void 0)return;let Be=!Pe&&!Ae?"null":u(Ae),Me=Ne,je=i.events.get(ve);if(je?.type==="forwarded")i.events.set(ve,{type:"dispatched",name:ve,detail:Be,description:Me||je.description,deprecated:De??je.deprecated,tags:_e??je.tags,...Re||je.internal?{internal:!0}:{},source:Oe||je.source});else if(je){let qe=je.tags??_e;i.events.set(ve,{...je,detail:je.detail===void 0?Be:je.detail,description:je.description||Me,deprecated:je.deprecated??De,tags:qe,...je.internal||Re?{internal:!0}:{},source:Oe||je.source})}else i.events.set(ve,{type:"dispatched",name:ve,detail:Be,description:Me,deprecated:De,tags:_e,...Re?{internal:!0}:{},source:Oe})}function ue(i,ve){let Ae=ve.arguments[0],Pe=Ni(Ae,"CustomEvent");if(!Pe&&!Ni(Ae,"Event"))return;let Ne=Ae.arguments[0],De=l(Ne)?Ne.value:void 0;if(De==null)return;let _e=Pe?Ae.arguments[1]:void 0,Re=!1,Oe;if(bn(_e)){let Be=_e.properties.find((Me)=>Me.type==="Property"&&a(Me.key)&&Me.key.name==="detail");if(Be?.type==="Property")Re=!0,Oe=l(Be.value)?Be.value.value:void 0}return h(i,{name:String(De),detail:Oe==null?"":G(Oe),has_argument:Re,source:t(i,ve)}),String(De)}function rs(i,ve,Ae=!1){if(i.length===0)return"null";let Pe=i.map(({name:Ne,type:De,description:_e,optional:Re,default:Oe})=>{let Be=Re?"?":"",Me=_e||"";if(Oe&&Me)Me=`${Me} @default ${Oe}`;else if(Oe)Me=`@default ${Oe}`;if(Me){if(Ae)return`/** ${Me} */
|
|
21
|
+
${Ne}${Be}: ${De};`;return`/** ${Me} */ ${Ne}${Be}: ${De};`}return`${Ne}${Be}: ${De};`}).join(Ae?`
|
|
22
|
+
`:" ");return Ae?`{
|
|
23
|
+
${Pe}
|
|
24
|
+
}`:`{ ${Pe} }`}var sh=/[A-Za-z_$][\w$]*/g;function ih(i,ve){if(!ve)return!1;let Ae=new Set(ve[0].split(",").map((Pe)=>Pe.trim()));for(let[Pe]of i.matchAll(sh))if(Ae.has(Pe))return!0;return!1}function z(i,ve){if(ve===void 0)return;return i.runesPropsDeclarationMetadataByDeclaratorStart.get(ve)}function pe(i,ve,Ae){return z(i,ve)?.props.get(Ae)}function le(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 Fc(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 Fc(i.left);return}function x(i,ve){let Ae=ve?.start,Pe=ve?.end;if(Ae===void 0||Pe===void 0)return;return r(i,Ae+1,Pe)?.trim()}function fe(i,ve){let Ae=ve?.start,Pe=ve?.end;if(Ae===void 0||Pe===void 0)return;return r(i,Ae,Pe)?.trim()}function c(i,ve,Ae,Pe,Ne=new Set){if(!ve?.type)return;switch(ve.type){case"TSInterfaceDeclaration":c(i,{type:"TSTypeLiteral",members:ve.body?.body},Ae,Pe,Ne);return;case"TSTypeAliasDeclaration":case"TSParenthesizedType":case"TSTypeAnnotation":c(i,ve.typeAnnotation,Ae,Pe,Ne);return;case"TSIntersectionType":case"TSUnionType":for(let De of ve.types??[])c(i,De,Ae,Pe,Ne);return;case"TSTypeLiteral":for(let De of ve.members??[]){if(De?.type!=="TSPropertySignature")continue;c(i,De.typeAnnotation?.typeAnnotation,Ae,Pe,Ne)}return;case"TSTypeReference":{let De=Fc(ve.typeName);if(De){if(i.typeImportBindingsByLocalName.has(De)||i.valueImportBindingsByLocalName.has(De))Ae.add(De);let _e=i.localTypeDeclarationsByName.get(De);if(_e&&!Ne.has(De))Pe.add(De),Ne.add(De),c(i,_e.node,Ae,Pe,Ne),Ne.delete(De)}if("typeParameters"in ve&&ve.typeParameters&&typeof ve.typeParameters==="object"){let _e=ve.typeParameters;for(let Re of _e.params??[])c(i,Re,Ae,Pe,Ne)}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 De in ve){let _e=ve[De];if(!_e||typeof _e!=="object")continue;if(Array.isArray(_e)){for(let Re of _e){if(!Re||typeof Re!=="object"||!("type"in Re))continue;c(i,Re,Ae,Pe,Ne)}continue}if("type"in _e)c(i,_e,Ae,Pe,Ne)}}function ah(i,ve){let Ae=new Map;for(let Pe of Array.from(ve).sort()){let Ne=i.typeImportBindingsByLocalName.get(Pe),De=Ne?void 0:i.valueImportBindingsByLocalName.get(Pe),_e=Ne??(De?{importedName:De.importedName,localName:De.localName,source:De.source,specifierType:"named"}:void 0);if(!_e)continue;let Re=Ae.get(_e.source)??{default:[],named:[],namespace:[]};if(_e.specifierType==="default")Re.default.push(_e.localName);else if(_e.specifierType==="namespace")Re.namespace.push(_e.localName);else Re.named.push({imported:_e.importedName,local:_e.localName});Ae.set(_e.source,Re)}return Array.from(Ae.entries()).sort(([Pe],[Ne])=>Pe.localeCompare(Ne)).map(([Pe,Ne])=>{if(Ne.namespace.length>0)return Ne.namespace.map((Oe)=>`import type * as ${Oe} from "${Pe}";`).join(`
|
|
25
|
+
`);let De=Ne.named.map(({imported:Oe,local:Be})=>{if(!Oe||Oe===Be)return Be;return`${Oe} as ${Be}`}),_e=Ne.default[0],Re=De.length>0?`{ ${De.join(", ")} }`:"";if(_e&&Re)return`import type ${_e}, ${Re} from "${Pe}";`;if(_e)return`import type ${_e} from "${Pe}";`;return`import type ${Re} from "${Pe}";`})}function C(i,ve){if(ve)i.additionalTypeDependencyNodes.push(ve)}function oh(i){if(!i.const)return;let ve=i.id?.name;if(!ve)return;let Ae=[];for(let Pe of i.members??[]){let Ne=Pe.initializer;if(Ne?.type!=="Literal")return;let De=Ne.value;if(typeof De==="string")Ae.push(JSON.stringify(De));else if(typeof De==="number")Ae.push(String(De));else return}if(Ae.length===0)return;return`type ${ve} = ${Ae.join(" | ")};`}function de(i,ve){let Ae=oh(ve);if(Ae)return Ae;if(ve.start===void 0||ve.end===void 0)return;let Pe=r(i,ve.start,ve.end)?.trim();return Pe?`declare ${Pe}`:void 0}function X(i,ve){let Ae=!1,Pe=[];for(let De of ve.params??[]){if(De.type==="RestElement"){let je=De.argument?.name??"rest",qe=x(i,De.typeAnnotation);if(qe)Ae=!0;C(i,De.typeAnnotation?.typeAnnotation),Pe.push(`...${je}: ${qe??"any[]"}`);continue}let _e=De.type==="AssignmentPattern",Re=_e?De.left:De,Oe=Re?.name??"arg",Be=x(i,Re?.typeAnnotation);if(Be)Ae=!0;C(i,Re?.typeAnnotation?.typeAnnotation);let Me=_e||De.optional===!0;Pe.push(`${Oe}${Me?"?":""}: ${Be??"any"}`)}let Ne=x(i,ve.returnType);if(Ne)Ae=!0;return C(i,ve.returnType?.typeAnnotation),{signature:`(${Pe.join(", ")}) => ${Ne??"any"}`,hasAnnotations:Ae}}function me(i){let ve=i.pendingCallDefaultCandidates.length>0?i.pendingCallDefaultCandidates.slice():void 0,Ae=i.pendingContextKeyCandidates.length>0?i.pendingContextKeyCandidates.slice():void 0,Pe={...ve?{pendingCallDefaultCandidates:ve}:{},...Ae?{pendingContextKeyCandidates:Ae}:{}},Ne=ve!==void 0||Ae!==void 0,De=new Set,_e=new Set;for(let Me of i.additionalTypeDependencyNodes)c(i,Me,De,_e);let Re=i.typedRunesPropsDeclarations.length===1?i.typedRunesPropsDeclarations[0]:void 0,Oe=Re?.canonicalType;if(Re&&Oe){for(let Me of Re.referencedImportedTypes)De.add(Me);for(let Me of Re.referencedLocalTypes)_e.add(Me)}if(!Oe&&De.size===0&&_e.size===0)return Ne?{canonicalPropNames:[],localTypeDeclarations:[],typeImportStatements:[],...Pe}:void 0;let Be=Array.from(_e).map((Me)=>i.localTypeDeclarationsByName.get(Me)).filter((Me)=>Me!==void 0).sort((Me,je)=>Me.start-je.start).map((Me)=>Me.code);return{...Oe?{canonicalPropsType:Oe}:{},canonicalPropNames:Re&&Oe?Array.from(Re.props.keys()).sort():[],localTypeDeclarations:Be,typeImportStatements:ah(i,De),referencesComponentGenerics:Oe?ih(Oe,i.generics):!1,...Pe}}var ch=/^[A-Za-z_$][\w$]*/,lh=/[A-Za-z_$][\w$]*/g,jc=/^(?:const|in|out)\s+/;function un(i){let ve=[],Ae=0,Pe=0;for(let Ne=0;Ne<i.length;Ne++){let De=i[Ne];if(De==="<"||De==="("||De==="["||De==="{")Ae++;else if(De===">"||De===")"||De==="]"||De==="}")Ae=Math.max(Ae-1,0);else if(De===","&&Ae===0)ve.push(i.slice(Pe,Ne)),Pe=Ne+1}return ve.push(i.slice(Pe)),ve}function he(i){let ve=un(i).map((Pe)=>Pe.trim()).filter((Pe)=>Pe.length>0);if(ve.length===0)return null;return[ve.map((Pe)=>{let Ne=Pe;while(jc.test(Ne))Ne=Ne.replace(jc,"");return Ne.match(ch)?.[0]??Pe}).join(", "),ve.join(", ")]}function ge(i,ve,Ae){let Pe=i.scriptGenericsAttribute?.value;if(!Pe)return;for(let[Ne]of Pe.matchAll(lh)){if(i.typeImportBindingsByLocalName.has(Ne))ve.add(Ne);if(Ae.has(Ne))continue;let De=i.localTypeDeclarationsByName.get(Ne);if(!De)continue;Ae.add(Ne),c(i,De.node,ve,Ae)}}var ph=null;function uh(i,ve,Ae){let Pe={value:void 0,replace:!1};if(!Ae||typeof Ae!=="object"||!("type"in Ae))return Pe;if(Ae.type==="Identifier")Pe.value=Ae.name,Pe.replace=!0;else if(Ae.type==="Literal")Pe.value=String(Ae.value);else if(Ae.type==="MemberExpression")Pe.value=M(i,ve,Ae);else if((Ae.type==="ObjectExpression"||Ae.type==="TemplateLiteral")&&"start"in Ae&&"end"in Ae&&typeof Ae.start==="number"&&typeof Ae.end==="number")Pe.value=r(i,Ae.start,Ae.end);return Pe}function dh(i,ve,Ae){if(!a(Ae))return null;let Pe=yr(i,Ae.name);if(bn(Pe))return Q(i,ve,Pe).slot_props;let Ne=ve.findVariableTypeAndDescription(Ae.name);if(!Ne)return null;let De=ns(Ne.type);if(!De)return null;let _e={};for(let Re of De)_e[Re.name]={value:Re.type,replace:!1};return _e}function Q(i,ve,Ae){let Pe={},Ne=!1;for(let De of Ae.properties){if(De.type==="SpreadElement"){let Re=dh(i,ve,De.argument);if(Re)Object.assign(Pe,Re);else Ne=!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,De));continue}if(De.type!=="Property"||De.computed)continue;let _e=ve.getPropertyName(De.key);if(!_e)continue;Pe[_e]=uh(i,ve,De.value)}return{slot_props:Pe,hasUnresolvedSpread:Ne}}function fh(i,ve){if(!ve||typeof ve!=="object"||!("type"in ve))return null;if(ve.type==="Identifier"){let De=ve,_e=i.propLocalToPublicName.get(De.name);if(!_e)return null;return{publicName:_e,trackingName:De.name}}if(ve.type!=="MemberExpression")return null;let Ae=ve,Pe=Ae.object&&typeof Ae.object==="object"&&"type"in Ae.object&&Ae.object.type==="Identifier"?Ae.object.name:void 0;if(!Pe||!i.wholePropsLocals.has(Pe))return null;let Ne;if(!Ae.computed&&Ae.property&&typeof Ae.property==="object"&&"type"in Ae.property){if(Ae.property.type==="Identifier")Ne=Ae.property.name;else if(Ae.property.type==="Literal"&&Ae.property.value!=null)Ne=String(Ae.property.value)}else if(Ae.computed&&Ae.property&&typeof Ae.property==="object"&&"type"in Ae.property&&Ae.property.type==="Literal"&&"value"in Ae.property&&Ae.property.value!=null)Ne=String(Ae.property.value);if(!Ne)return null;return{publicName:Ne,trackingName:Ne}}function ye(i,ve){let Ae=ve;if(Ae&&typeof Ae==="object"&&"type"in Ae&&Ae.type==="ChainExpression")Ae=Ae.expression;if(!Ae||typeof Ae!=="object"||!("type"in Ae)||Ae.type!=="CallExpression")return null;let Pe=Ae;if(!Pe.callee||typeof Pe.callee!=="object"||!("type"in Pe.callee))return null;let Ne=fh(i,Pe.callee);if(!Ne)return null;return{...Ne,arguments:Pe.arguments}}function R(i,{slot_name:ve,slot_props:Ae,slot_props_unresolved_spread:Pe,slot_fallback:Ne,slot_description:De,slot_deprecated:_e,slot_tags:Re,slot_internal:Oe,source:Be}){let Me=ve===void 0||ve==="",je=Me?ph:ve??"",qe=u(Ne),Ge=Ae===void 0||Ae===""?void 0:Ae,He=De?.trim()||void 0;if(i.slots.has(je)){let Xe=i.slots.get(je);if(Xe)i.slots.set(je,{...Xe,default:Xe.default??Me,fallback:qe,slot_props:Xe.slot_props===void 0?Ge:Xe.slot_props,slot_props_unresolved_spread:Xe.slot_props_unresolved_spread||Pe,description:Xe.description||He,deprecated:Xe.deprecated??_e,tags:Xe.tags||Re,...Xe.internal||Oe?{internal:!0}:{},source:Be||Xe.source})}else i.slots.set(je,{name:je,default:Me,fallback:qe,slot_props:Ge,slot_props_unresolved_spread:Pe,description:He,deprecated:_e,tags:Re,...Oe?{internal:!0}:{},source:Be})}var Ri=/^\s+/,qc=/\s/,hh=/^@[^\s/]+(?=\s|$)/,mh=/^@(\S+)\s*/;function Vc(i){let ve=0;while(ve<i.length){let Ae=i.charCodeAt(ve);if(Ae!==32&&Ae!==9&&Ae!==13&&Ae!==10&&!qc.test(i[ve]))break;ve++}return ve}function gh(i,ve){let Ae=i.slice(Vc(i)),Pe=!1;if(ve)Ae=Ae.slice(3),Pe=!0;else if(Ae.startsWith("*")&&!Ae.startsWith("*/"))Ae=Ae.slice(1),Pe=!0;let Ne=Ae.slice(0,Vc(Ae));Ae=Ae.slice(Ne.length);let De=Ae.trimEnd(),_e=De.endsWith("*/")?De.slice(0,-2):Ae;return{indent:Pe?Ne.slice(1):Ne,separator:Ne,content:_e}}function yh(i,ve,Ae){let Pe=Ae>ve&&i.charCodeAt(Ae-1)===13?Ae-1:Ae;return i.slice(ve,Pe)}function xh(i){let ve=[],Ae=0;while(!0){let Pe=i.indexOf("/**",Ae);if(Pe===-1)break;let Ne=i.lastIndexOf(`
|
|
26
|
+
`,Pe-1)+1;if(i.charCodeAt(Pe+3)===42||i.slice(Ne,Pe).trim()!==""){Ae=Pe+1;continue}let De=[],_e=Ne,Re=!1,Oe=0;while(_e<=i.length){let Be=i.indexOf(`
|
|
27
|
+
`,_e),Me=Be===-1?i.length:Be,je=yh(i,_e,Me),{indent:qe,separator:Ge,content:He}=gh(je,De.length===0);De.push({raw:je,start:_e,number:De.length,indent:qe,separator:Ge,content:He});let Xe=je.trimEnd();if(Xe.endsWith("*/")){Re=!0,Oe=_e+Xe.length,Ae=Me;break}if(Be===-1)break;_e=Be+1}if(!Re)break;ve.push({start:Pe,end:Oe,lines:De})}return ve}function bh(i){let ve=i;if(ve.length>0&&ve[0].content==="")ve=ve.slice(1);if(ve.length>0&&ve[ve.length-1].content==="")ve=ve.slice(0,-1);return ve}function Eh(i){let ve=[[]],Ae=!1;for(let Pe of i){if(hh.test(Pe.content)&&!Ae)ve.push([Pe]);else ve[ve.length-1].push(Pe);if(Ch(Pe.content,"```")%2===1)Ae=!Ae}return ve}function Ch(i,ve){let Ae=0,Pe=i.indexOf(ve);while(Pe!==-1)Ae++,Pe=i.indexOf(ve,Pe+ve.length);return Ae}function Wc(i){return i.map((ve)=>ve.indent+ve.content).join(`
|
|
28
|
+
`)}function vh(i,ve){let Ae=ve;while(Ae<i.length-1&&i[Ae].content.trim()==="")Ae++;if(i[Ae].content[0]!=="{")return null;let Pe=0,Ne=[],De=Ae;for(;De<i.length;De++){let Oe=i[De].content,Be=0;for(let Me of Oe){if(Me==="{")Pe++;else if(Me==="}")Pe--;if(Be++,Pe===0)break}if(Ne.push(Be),Pe===0)break}if(Pe!==0)return null;let _e=De;return{type:Ne.map((Oe,Be)=>{let Me=Ae+Be,je=i[Me].content.slice(0,Oe);return i[Me].content=i[Me].content.slice(Oe).replace(Ri,""),Be===0?je:i[Me].indent+je}).join(`
|
|
29
|
+
`).slice(1,-1),endIndex:_e}}function Sh(i){let ve=i.content.match(Ri)?.[0]??"",Ae=i.content.slice(ve.length),Pe=0,Ne=0;for(let Be of Ae){if(Pe===0&&qc.test(Be))break;if(Be==="[")Pe++;if(Be==="]")Pe--;Ne++}let De=Pe===0?Ae.slice(0,Ne):"";if(!De)return null;let _e=De,Re=!1,Oe;if(De.startsWith("[")&&De.endsWith("]")){Re=!0;let Me=De.slice(1,-1).split("=");if(_e=Me[0].trim(),Me.length>1)Oe=Me.slice(1).join("=").trim();if(!_e)return null}if(_e.length>1&&(_e[0]==='"'||_e[0]==="'")&&_e[_e.length-1]===_e[0])_e=_e.slice(1,-1);return i.content=Ae.slice(Ne).replace(Ri,""),{name:_e,optional:Re,default:Oe}}function Th(i){let ve=i[0],Ae=ve.content.match(mh),Pe=Ae?Ae[1]:"",Ne=Ae?ve.content.slice(Ae[0].length):ve.content,De=Ne.trimEnd(),_e=i.slice(1).map((Ge)=>Ge.separator+Ge.content),Re=(De?[De,..._e]:_e).join(`
|
|
30
|
+
`);ve.content=Ne,ve.tag=Pe;let Oe=vh(i,0),Be=Oe?.type??"",Me=0;if(Oe){Me=Oe.endIndex;while(Me<i.length-1&&i[Me].content.trim()==="")Me++}let je=Sh(i[Me]),qe=Wc(i.slice(Oe?Oe.endIndex:0));return{tag:Pe,name:je?.name??"",type:Be,optional:je?.optional??!1,default:je?.default,description:qe,raw:Re,lines:i}}function Ah(i,ve,Ae){let Pe=bh(i);Pe.forEach((_e,Re)=>{_e.number=Re});let Ne=Eh(Pe),De=Ne.slice(1).map(Th);return{description:Wc(Ne[0]),tags:De,start:ve,end:Ae,lines:Pe}}function br(i){return xh(i).map(({start:ve,end:Ae,lines:Pe})=>Ah(Pe,ve,Ae))}var kh=/\s*=\s*/;function Gc(i){let ve=i.indexOf("<");if(ve===-1||!i.endsWith(">"))return i;let Ae=i.slice(0,ve),Pe=i.slice(ve+1,-1),Ne=un(Pe).map((De)=>De.trim().replace(kh," = ")).join(", ");return`${Ae}<${Ne}>`}var Y=/^\s*$/,wh=/;$/,Ph=/^-\s*/;function En(i){if(i===void 0)return;let ve=i.replace(Ph,"").trim();return ve===""?"":ve}function jn(i){if(!i||i.length===0)return;return i[0].content}var Uc=new Set(["since","example","see"]),Nh=new Set(["bindable","default","required"]);function _h(i){let ve=i.trim();return ve===""?!0:ve}function Hc(i,ve){return _h(`${i??""}${ve?` ${ve}`:""}`)}function Ih(i){let ve=i.trim().replace(wh,"").trimEnd();if(!ve.startsWith("{")||!ve.endsWith("}"))return!1;let Ae=0,Pe=null;for(let Ne=0;Ne<ve.length;Ne++){let De=ve[Ne];if(Pe!==null){if(De==="\\"){Ne++;continue}if(De===Pe)Pe=null;continue}if(De==='"'||De==="'"||De==="`"){Pe=De;continue}if(De==="{"||De==="["||De==="(")Ae++;else if(De==="}"||De==="]"||De===")"){if(Ae--,Ae===0&&Ne<ve.length-1)return!1}}return Ae===0}function Li(i){let ve=i;if(!ve.startsWith("/*"))ve=`/*${ve}`;if(!ve.endsWith("*/"))ve+="*/";return ve}function Dh(i){if(i==="*")return"any";return i.trim()}function Kc(i){let ve=br(Li(i)),{returns:Ae}=L(ve);return Ae?Dh(Ae.type):void 0}function zc(i){let ve=br(Li(i)),{deprecated:Ae,passthrough:Pe,internal:Ne}=L(ve),De=Pe.length>0?Pe.map((_e)=>({name:_e.tag,body:_e.raw})):void 0;return{deprecated:Ae,tags:De,internal:Ne}}var Rh=new Set(["type","param","returns","return","extends","extendProps","restProps","slot","snippet","event","typedef","callback","bindable","deprecated","ignore","internal","csspart","cssprop","cssproperty"]);function Z(i,ve){let Ae=i.parsedJsDocByText.get(ve);if(Ae===void 0)Ae=br(ve),i.parsedJsDocByText.set(ve,Ae);return Ae}function L(i){let ve=i[0]?.tags??[],Ae,Pe=[],Ne,De,_e,Re=!1,Oe=[],Be=[],Me=[];for(let je of ve)if(je.tag==="type")Ae=je;else if(je.tag==="param")Pe.push(je);else if(je.tag==="returns"||je.tag==="return")Ne=je;else if(je.tag==="deprecated")_e??=Hc(je.name,je.description);else if(je.tag==="ignore"||je.tag==="internal")Re=!0;else if(je.tag==="sveld-ignore")Me.push(je.name);else if(Uc.has(je.tag))Be.push(je);else if(je.tag==="bindable"){if(je.type)continue;let qe=`${je.name}${je.description?` ${je.description}`:""}`.trim();if(qe==="readonly"||qe==="writable")De??=qe}else if(!Rh.has(je.tag))Oe.push(je);return{type:Ae,param:Pe,returns:Ne,binding:De,deprecated:_e,internal:Re,additional:Oe,passthrough:Be,ignore:Me,description:i[0]?.description}}function Lh(i,ve){if(typeof ve.start!=="number"||typeof ve.end!=="number")return;let Ae=i.jsDocBlocksByStart.get(ve.start);if(Ae===void 0||Ae.end!==ve.end)return;return[Ae]}function Oh(i){if(!i||i.length===0)return;let ve=i[i.length-1];return ve&&typeof ve==="object"&&"value"in ve?ve:void 0}function Xc(i,ve,Ae){if(!ve||ve.length===0||Ae===void 0||!i.source)return;for(let Pe=ve.length-1;Pe>=0;Pe--){let Ne=ve[Pe];if(!Ne||typeof Ne!=="object"||!("value"in Ne)||!("end"in Ne))continue;if(typeof Ne.end!=="number"||!("start"in Ne)||typeof Ne.start!=="number")continue;let De=i.source.slice(Ne.end,Ae);if(Y.test(De))return Ne}return}function Mh(i){let ve=new Set;for(let Ae of i.funcDecls.values()){let{leadingComments:Pe,start:Ne}=Ae,De=Xc(i,Pe,Ne);if(De)ve.add(De.start)}return ve}function g(i,ve,Ae){if(!Ae?.leadingComments)return;let Pe=Xc(i,Ae.leadingComments,Ae.start);if(!Pe)return;return Bh(i,ve,[Pe])}function xe(i,ve,Ae){if(!Ae?.leadingComments)return;return g(i,ve,Ae)}function Bh(i,ve,Ae){if(!Ae)return;let Pe=Oh(Ae);if(!Pe)return;let Ne=Lh(i,Pe)??Z(i,Li(Pe.value)),{type:De,param:_e,returns:Re,binding:Oe,deprecated:Be,internal:Me,additional:je,passthrough:qe,ignore:Ge,description:He}=L(Ne),Xe,ze,tt,at;if(De)Xe=ve.aliasType(De.type);if(_e.length>0)ze=_e.filter((et)=>!et.name.includes(".")).map((et)=>({name:et.name,type:ve.aliasType(et.type),description:En(et.description),optional:et.optional||!1}));if(Re)tt=ve.aliasType(Re.type);let Ze=u(He?.trim());if(Ze||je.length>0){let et=[];if(Ze)et.push(Ze);for(let yt of je){let At=`@${yt.tag}${yt.name?` ${yt.name}`:""}${yt.description?` ${yt.description}`:""}`;et.push(At)}at=et.join(`
|
|
31
|
+
`)}let nt=qe.length>0?qe.map((et)=>({name:et.tag,body:et.raw})):void 0;return{type:Xe,params:ze,returnType:tt,description:at,binding:Oe,deprecated:Be,tags:nt,sveldIgnore:Ge.length>0?Ge:void 0,internal:Me}}function Te(i,ve,Ae=i.source){if(!Ae)return;let Pe=!1,Ne=!1,De=!1,_e=new Set,Re=()=>{if(Pe&&Ne&&!De){De=!0;let He=i.componentFilePath?` in ${i.componentFilePath}`:"";console.warn(`Warning: Both @generics and @template tags are used to declare component generics${He}; their declarations are combined in the order encountered.`)}},Oe=(He,Xe)=>{if(_e.has(He))n(i,"generics-conflict",He,`Duplicate generic name "${He}".`,Xe);else _e.add(He)},Be=(He,Xe)=>{if(i.generics){let tt=un(i.generics[0]).map((at)=>at.trim()).indexOf(He.trim());if(tt!==-1){let at=un(i.generics[1]).map((Ze)=>Ze.trim());at[tt]=Xe,i.generics=[i.generics[0],at.join(", ")];return}}ve.accumulateGeneric(He,Xe)},Me=(He,Xe)=>{if(i.typedefs.has(He))n(i,"typedef-duplicate",He,`Duplicate typedef/callback name "${He}"; the later declaration overwrites the earlier one.`,Xe)},je=(He,Xe,ze,tt)=>{let at=He.findIndex((Ze)=>Ze.name===Xe.name);if(at===-1)He.push(Xe);else{let Ze=ze?` of "${ze}"`:"";n(i,"property-duplicate",Xe.name,`Duplicate property "${Xe.name}"${Ze}; the later declaration overwrites the earlier one.`,tt),He[at]=Xe}},qe=Mh(i),Ge=br(Ae);for(let He of Ge)i.jsDocBlocksByStart.set(He.start,He);for(let{tags:He,description:Xe,lines:ze,start:tt}of Ge){let at=qe.has(tt),Ze,nt,et,yt,At=!1,Ct,Ie,Le=[],$e=[],Ve=[],We,Ue,Ke,Qe,Ye=[],Je=!1,ct=[],ut,mt,Bt,Lt=[],Wt=!1,Qt=[],Dt,Pt,ln=!1,wt=!0,Rt=[],Vs,Ln=!1,Dr=new Map,wa=new Set,qs=new Set;for(let ot of He)if(ot.lines.length>0)wa.add(ot.lines[0].number);for(let ot of ze)if(!ot.tag&&ot.content&&ot.content.trim()!=="}")Dr.set(ot.number,ot.content);let Kp=(ot)=>{if(!ot||ot.length===0)return;let Gt=ot[0].number,pt=[],Xt=[],mn=!1;for(let bt=Gt-1;bt>=0;bt--){if(wa.has(bt))break;let Jt=Dr.get(bt);if(Jt)pt.unshift(Jt),Xt.unshift(bt),mn=!0;else if(mn){let Et=ze[bt];if(!(!Et||!Et.tag&&(!Et.content||Et.content.trim()==="")))break}}if(pt.length===0)return;for(let bt of Xt)qs.add(bt);return pt.join(`
|
|
32
|
+
`).trim()},Pa=()=>{if(Ze!==void 0){let ot=nt&&nt!=="object"&&nt!=="Object"?nt:void 0,Gt;if(ot)Gt=ot;else if(Ve.length>0)Gt=rs(Ve,Ze,!0);else Gt=nt||"";if(Ie!==void 0){let pt;for(let bt of He){let Jt=bt.lines[0]?.number;if(typeof Jt!=="number")continue;if(Jt<=Ie)continue;if(bt.tag==="property"||bt.tag==="type")continue;pt=Jt;break}let Xt=[],mn=Array.from(Dr.keys()).sort((bt,Jt)=>bt-Jt);for(let bt of mn){if(bt<=Ie)continue;if(pt!==void 0&&bt>=pt)continue;if(qs.has(bt))continue;let Et=Dr.get(bt)?.trim();if(Et)Xt.push(Et),qs.add(bt)}if(Xt.length>0){let bt=Xt.join(`
|
|
33
|
+
`);et=et?`${et}
|
|
34
|
+
${bt}`:bt}}h(i,{name:Ze,detail:Gt,has_argument:!1,description:et,deprecated:yt,tags:Le.length>0?Le:void 0,internal:At||void 0,source:Ct}),i.eventDescriptions.set(Ze,et),i.jsDocEventNames.add(Ze),i.jsDocEventSources.set(Ze,Ct),d(i,"event-no-source",Ze,$e),Ve.length=0,Ze=void 0,nt=void 0,et=void 0,yt=void 0,At=!1,Ct=void 0,Ie=void 0,Le=[],$e=[]}},Na=()=>{if(We!==void 0){let ot,Gt;if(ct.length>0)ot=rs(ct,void 0,!0),Gt=`type ${We} = ${ot};`;else if(Ue)ot=Ue,Gt=Ih(ot)?`interface ${We} ${ot}`:`type ${We} = ${ot};`;else ot="{}",Gt=`type ${We} = ${ot};`;Me(We,Qe),i.typedefs.set(We,{type:ot,name:We,description:u(Ke),ts:Gt,tags:Ye.length>0?Ye:void 0,...Je?{internal:!0}:{},source:Qe}),ct.length=0,We=void 0,Ue=void 0,Ke=void 0,Qe=void 0,Ye=[],Je=!1}},_a=()=>{if(ut!==void 0){let pt=`(${Qt.map(({name:mn,type:bt,optional:Jt})=>`${mn}${Jt?"?":""}: ${bt}`).join(", ")}) => ${Dt||"void"}`,Xt=`type ${ut} = ${pt};`;Me(ut,Bt),i.typedefs.set(ut,{type:pt,name:ut,description:u(mt),ts:Xt,tags:Lt.length>0?Lt:void 0,...Wt?{internal:!0}:{},source:Bt}),Qt.length=0,Dt=void 0,ut=void 0,mt=void 0,Bt=void 0,Lt=[],Wt=!1}},zp=He.some((ot)=>ot.tag==="slot"||ot.tag==="snippet"),Xp=He.some((ot)=>ot.tag==="extends"||ot.tag==="extendProps"),Jp=He.some((ot)=>ot.tag==="slot"||ot.tag==="snippet"||ot.tag==="event"||ot.tag==="typedef"||ot.tag==="callback");for(let{tag:ot,type:Gt,name:pt,description:Xt,optional:mn,default:bt,raw:Jt,lines:Et}of He){let $t=ve.aliasType(Gt),ar=Kp(Et);switch(ot){case"extends":case"extendProps":if(i.extends!==void 0)n(i,"extend-props-duplicate",pt,`A second @extends/@extendProps tag ("${pt}") overwrote the first ("${i.extends.interface}"); only one is used.`,an(i,Et));if(i.extends={interface:pt,import:$t},wt)wt=!1;break;case"restProps":{let vt=pt?Xt?`${pt} ${Xt}`:pt:Xt,An=En(vt)||ar;if(!An&&wt&&!ln&&Xe)An=Xe,ln=!0;if(i.rest_props={type:"Element",name:$t,description:An||void 0},wt)wt=!1;break}case"slot":case"snippet":{let Ut=En(jn(Et));if(!Ut&&wt&&!ln&&Xe)Ut=Xe,ln=!0;if(!Ut&&Rt.length===0)Ut=ar;if(wt)wt=!1;let An=$t;if(!An)An="Record<string, never>",n(i,"slot-missing-type",pt||"default",`@${ot}${pt?` "${pt}"`:""} is missing a required {Type} annotation; falling back to "${An}".`,an(i,Et));R(i,{slot_name:pt,slot_props:An,slot_description:Ut||void 0,slot_deprecated:Vs,slot_tags:Rt.length>0?[...Rt]:void 0,slot_internal:Ln||void 0,source:an(i,Et)}),Rt.length=0,Vs=void 0,Ln=!1;{let Yp=pt===void 0||pt===""?null:pt;Pt=(Qp)=>{let Ws=i.slots.get(Yp);if(Ws)Ws.tags=[...Ws.tags??[],Qp]}}break}case"csspart":{let vt=En(jn(Et));i.cssParts.push({name:pt,...vt?{description:vt}:{}});break}case"cssprop":case"cssproperty":{let vt=En(jn(Et));i.cssProperties.push({name:pt,...$t?{type:$t}:{},...bt===void 0?{}:{default:bt},...vt?{description:vt}:{}});break}case"event":{if(Pa(),Ze=pt,nt=$t,Ie=Et.length>0?Et[0].number:void 0,et=En(jn(Et))||ar,!et&&wt&&!ln&&Xe)et=Xe,ln=!0;if(Ct=an(i,Et),Rt.length>0)Le.push(...Rt),Rt.length=0;if(Pt=(Ut)=>Le.push(Ut),wt)wt=!1;break}case"type":if(Ze!==void 0)nt=$t;break;case"param":if(ut!==void 0)Qt.push({name:pt,type:$t,optional:mn||!1});break;case"returns":case"return":if(ut!==void 0)Dt=$t;break;case"property":{let vt={name:pt,type:$t,description:En(jn(Et)),optional:mn||!1,default:bt};if(Ze!==void 0)je(Ve,vt,Ze,an(i,Et));else if(We!==void 0)je(ct,vt,We,an(i,Et));break}case"typedef":{if(Na(),We=Gc(pt),Ue=$t,Qe=an(i,Et),Ke=En(jn(Et))||ar,!Ke&&wt&&!ln&&Xe)Ke=Xe,ln=!0;if(Rt.length>0)Ye.push(...Rt),Rt.length=0;if(Je=Ln,Ln=!1,Pt=(Ut)=>Ye.push(Ut),wt)wt=!1;break}case"callback":{if(_a(),ut=Gc(pt),Bt=an(i,Et),mt=En(jn(Et))||ar,!mt&&wt&&!ln&&Xe)mt=Xe,ln=!0;if(Rt.length>0)Lt.push(...Rt),Rt.length=0;if(Wt=Ln,Ln=!1,Pt=(Ut)=>Lt.push(Ut),wt)wt=!1;break}case"generics":{let vt=$t||pt;for(let Ut of un(pt))Oe(Ut.trim(),an(i,Et));if(Pe=!0,Re(),Be(pt,vt),wt)wt=!1;break}case"template":{let vt=pt;if($t)vt=`${pt} extends ${$t}`;if(bt)vt+=` = ${bt}`;if(zp&&!Xp){i.deferredSlotBlockGenerics.push({name:pt,constraint:vt});break}if(at)break;if(Oe(pt,an(i,Et)),Ne=!0,Re(),Be(pt,vt),wt)wt=!1;break}case"deprecated":{let vt=Hc(pt,Xt);if(Ze===void 0)Vs??=vt;else yt??=vt;break}case"ignore":case"internal":{if(Ze===void 0)Ln=!0;else At=!0;break}case"sveld-ignore":if(Ze!==void 0)$e.push(pt);break;case"enum":case"class":case"implements":case"this":case"namespace":case"memberof":case"module":case"file":case"overview":break;default:{let vt={name:ot,body:Jt};if(!Uc.has(ot)&&!Nh.has(ot))n(i,"jsdoc-unknown-tag",ot,`Unknown JSDoc tag "@${ot}"; passed through unchanged. If this is a typo, fix the tag name.`,an(i,Et));if(Pt)Pt(vt);else Rt.push(vt)}break}}if(Pa(),Na(),_a(),Jp&&Rt.length>0){for(let ot of Rt)n(i,"jsdoc-tag-dropped",ot.name,`@${ot.name} could not attach to a @slot/@snippet/@event/@typedef/@callback tag in the same comment block and was dropped.`);Rt.length=0}}}import Jc,{sep as Oi}from"node:path";var In=/\.svelte$/,Yc=/\.(?:svelte|[mc]?ts|[mc]?js)$/;function ss(i){if(!i.endsWith(".svelte"))return!1;let ve=i.length-7;if(ve===0)return!1;let Ae=i.charCodeAt(ve-1);return Ae!==47&&(Oi==="/"||Ae!==92)}function e(i){return Oi==="/"?i:i.split(Oi).join("/")}function is(i,ve){return e(Jc.join(ve,Jc.normalize(i)))}function Vn(i){return`${JSON.stringify(i,null,2)}
|
|
35
|
+
`}var Qc="sveld",as="0.37.2";var Zc={name:Qc,version:as,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 Er="5.57.0";var os=1,el=new WeakMap;function Dn(i){return i.some((ve)=>ve.internal)?i.filter((ve)=>!ve.internal):i}function Fh(i){return{...i,props:Dn(i.props),moduleExports:Dn(i.moduleExports),slots:Dn(i.slots),events:Dn(i.events),typedefs:Dn(i.typedefs),...i.contexts?{contexts:Dn(i.contexts).map((ve)=>({...ve,properties:Dn(ve.properties)}))}:{}}}function s(i,ve={}){let Ae=el.get(i),Pe=Ae?.get(ve.entryExports);if(Pe)return Pe;let Ne=Array.from(i,([,Re])=>{let{diagnostics:Oe,...Be}=Re;return Fh(Be)}).sort((Re,Oe)=>Re.moduleName.localeCompare(Oe.moduleName)),De={schemaVersion:os,generator:{name:Qc,version:as,svelteVersion:Er},total:Ne.length,components:Ne},_e=ve.entryExports?Dn(ve.entryExports):void 0;if(_e&&_e.length>0)De.totalExports=_e.length,De.exports=_e;if(!Ae)Ae=new Map,el.set(i,Ae);return Ae.set(ve.entryExports,De),De}import{readFile as jh}from"node:fs/promises";import Vh from"node:path";var qh=/[:=]/,cs={none:0,patch:1,minor:2,major:3};function Wh(i,ve){return cs[ve]>cs[i]?ve:i}function Gh(i){return i.reduce((ve,Ae)=>Wh(ve,Ae.bump),"none")}function ps(i,ve){return cs[i]>=cs[ve]}function al(i,ve){let Ae=[],Pe=0,Ne="",De=null;for(let _e=0;_e<i.length;_e++){let Re=i[_e];if(De){if(Ne+=Re,Re==="\\")_e++,Ne+=i[_e]??"";else if(Re===De)De=null;continue}if(Re==='"'||Re==="'"||Re==="`"){De=Re,Ne+=Re;continue}if(Re==="<"||Re==="("||Re==="{"||Re==="[")Pe++;if(Re===">"||Re===")"||Re==="}"||Re==="]")Pe--;if(Re===ve&&Pe===0){Ae.push(Ne.trim()),Ne="";continue}Ne+=Re}return Ae.push(Ne.trim()),Ae}function tl(i){return new Set(al(i,"|").filter((ve)=>ve.length>0))}function Uh(i){let ve=0,Ae=null;for(let Pe=0;Pe<i.length;Pe++){let Ne=i[Pe];if(Ae){if(Ne==="\\")Pe++;else if(Ne===Ae)Ae=null;continue}if(Ne==='"'||Ne==="'"||Ne==="`"){Ae=Ne;continue}if(Ne==="<"||Ne==="("||Ne==="{"||Ne==="[")ve++;if(Ne===">"||Ne===")"||Ne==="}"||Ne==="]")ve--;if(ve===0&&Ne==="="&&i[Pe+1]===">")return Pe}return-1}function nl(i){let ve=Uh(i);if(ve===-1)return;let Ae=i.slice(0,ve).trim(),Pe=i.slice(ve+2).trim();if(!Ae.startsWith("(")||!Ae.endsWith(")"))return;let Ne=Ae.slice(1,-1).trim();return{params:Ne.length===0?[]:al(Ne,","),returnType:Pe}}function Hh(i){return(i.split(qh,1)[0]??"").trimEnd().endsWith("?")}function Kh(i,ve){if(i.returnType!==ve.returnType)return"major";if(ve.params.length<i.params.length)return"major";for(let Pe=0;Pe<i.params.length;Pe++)if(i.params[Pe]!==ve.params[Pe])return"major";if(ve.params.length===i.params.length)return"none";return ve.params.slice(i.params.length).every(Hh)?"minor":"major"}function Bi(i,ve){if(i===ve)return"none";if(i===void 0||ve===void 0)return"major";let Ae=nl(i),Pe=nl(ve);if(Ae&&Pe)return Kh(Ae,Pe);let Ne=tl(i),De=tl(ve),_e=[...De].some((Oe)=>!Ne.has(Oe)),Re=[...Ne].some((Oe)=>!De.has(Oe));if(!_e&&!Re)return"none";if(_e&&!Re)return"minor";if(Re&&!_e)return"major";return"major"}function rl(i){return i.bindable===!0||i.binding==="writable"}function sl(i,ve,Ae,Pe){let Ne=ve==="prop"?"prop":"export",De=[],_e=new Map(Ae.map((Oe)=>[Oe.name,Oe])),Re=new Map(Pe.map((Oe)=>[Oe.name,Oe]));for(let[Oe,Be]of Re){if(_e.has(Oe))continue;De.push({component:i,kind:ve,name:Oe,bump:Be.isRequired?"major":"minor",message:`${Ne} "${Oe}" added${Be.isRequired?" (required)":""}`})}for(let[Oe]of _e){if(Re.has(Oe))continue;De.push({component:i,kind:ve,name:Oe,bump:"major",message:`${Ne} "${Oe}" removed`})}for(let[Oe,Be]of _e){let Me=Re.get(Oe);if(!Me)continue;if(Be.isRequired!==Me.isRequired)De.push({component:i,kind:ve,name:Oe,bump:Me.isRequired?"major":"minor",message:`${Ne} "${Oe}" became ${Me.isRequired?"required":"optional"}`});let je=Bi(Be.type,Me.type);if(je!=="none")De.push({component:i,kind:ve,name:Oe,bump:je,message:`${Ne} "${Oe}" type changed from \`${Be.type??"unknown"}\` to \`${Me.type??"unknown"}\``});let qe=rl(Be),Ge=rl(Me);if(qe!==Ge)De.push({component:i,kind:ve,name:Oe,bump:Ge?"minor":"major",message:`${Ne} "${Oe}" ${Ge?"gained a writable binding":"lost its writable binding"}`});if(Be.value!==Me.value&&je==="none")De.push({component:i,kind:ve,name:Oe,bump:"patch",message:`${Ne} "${Oe}" default changed from \`${Be.value??"none"}\` to \`${Me.value??"none"}\``});let He=Be.deprecated!==void 0,Xe=Me.deprecated!==void 0;if(He!==Xe)De.push({component:i,kind:ve,name:Oe,bump:Xe?"minor":"patch",message:`${Ne} "${Oe}" ${Xe?"marked as deprecated":"no longer deprecated"}`});if(Be.constant!==Me.constant)De.push({component:i,kind:ve,name:Oe,bump:"minor",message:`${Ne} "${Oe}" ${Me.constant?"became constant":"became mutable"}`});if(Be.reactive!==Me.reactive)De.push({component:i,kind:ve,name:Oe,bump:"minor",message:`${Ne} "${Oe}" ${Me.reactive?"became reactive":"stopped being reactive"}`})}return De}function zh(i,ve,Ae){let Pe=[],Ne=new Map(ve.map((_e)=>[_e.name,_e])),De=new Map(Ae.map((_e)=>[_e.name,_e]));for(let[_e]of De){if(Ne.has(_e))continue;Pe.push({component:i,kind:"event",name:_e,bump:"minor",message:`event "${_e}" added`})}for(let[_e]of Ne){if(De.has(_e))continue;Pe.push({component:i,kind:"event",name:_e,bump:"major",message:`event "${_e}" removed`})}for(let[_e,Re]of Ne){let Oe=De.get(_e);if(!Oe)continue;if(Re.type!==Oe.type){Pe.push({component:i,kind:"event",name:_e,bump:"major",message:`event "${_e}" changed from ${Re.type} to ${Oe.type}`});continue}let Be=Re.type==="dispatched"?Re.detail:void 0,Me=Oe.type==="dispatched"?Oe.detail:void 0,je=Bi(Be,Me);if(je!=="none")Pe.push({component:i,kind:"event",name:_e,bump:je,message:`event "${_e}" detail changed from \`${Be??"unknown"}\` to \`${Me??"unknown"}\``})}return Pe}function il(i){return i.name??"default"}function Xh(i,ve,Ae){let Pe=[],Ne=new Map(ve.map((_e)=>[il(_e),_e])),De=new Map(Ae.map((_e)=>[il(_e),_e]));for(let[_e]of De){if(Ne.has(_e))continue;Pe.push({component:i,kind:"slot",name:_e,bump:"minor",message:`slot "${_e}" added`})}for(let[_e]of Ne){if(De.has(_e))continue;Pe.push({component:i,kind:"slot",name:_e,bump:"major",message:`slot "${_e}" removed`})}for(let[_e,Re]of Ne){let Oe=De.get(_e);if(!Oe)continue;let Be=Bi(Re.slot_props,Oe.slot_props);if(Be!=="none")Pe.push({component:i,kind:"slot",name:_e,bump:Be,message:`slot "${_e}" props changed from \`${Re.slot_props??"none"}\` to \`${Oe.slot_props??"none"}\``})}return Pe}var Jh=new Set(["description","source","componentCommentSource","tags"]);function ls(i){if(Array.isArray(i))return i.map(ls);if(i!==null&&typeof i==="object"){let ve={};for(let[Ae,Pe]of Object.entries(i)){if(Jh.has(Ae))continue;ve[Ae]=ls(Pe)}return ve}return i}var Yh=["generics","rest_props","extends","contexts","typedefs"];function Qh(i,ve,Ae){let Pe=[];for(let Ne of Yh){let De=JSON.stringify(ls(ve[Ne])),_e=JSON.stringify(ls(Ae[Ne]));if(De!==_e)Pe.push({component:i,kind:"shape",name:Ne,bump:"major",message:`"${Ne}" changed (breaking)`})}return Pe}function Zh(i,ve){let Ae=ve.moduleName;return[...sl(Ae,"prop",i.props,ve.props),...sl(Ae,"moduleExport",i.moduleExports,ve.moduleExports),...zh(Ae,i.events,ve.events),...Xh(Ae,i.slots,ve.slots),...Qh(Ae,i,ve)]}function Ee(i,ve){let Ae=[],Pe=new Map(i.components.map((De)=>[De.moduleName,De])),Ne=new Map(ve.components.map((De)=>[De.moduleName,De]));for(let[De]of Ne){if(Pe.has(De))continue;Ae.push({component:De,kind:"component",bump:"minor",message:`component "${De}" added`})}for(let[De]of Pe){if(Ne.has(De))continue;Ae.push({component:De,kind:"component",bump:"major",message:`component "${De}" removed`})}for(let[De,_e]of Pe){let Re=Ne.get(De);if(!Re)continue;Ae.push(...Zh(_e,Re))}return Ae}async function em(i){let ve;try{ve=await jh(Vh.resolve(i),"utf-8")}catch(Ae){if(Ae.code==="ENOENT")return null;throw Ae}try{return JSON.parse(ve)}catch{throw Error(`sveld: could not parse "${i}" as JSON. Is it a sveld COMPONENT_API.json snapshot?`)}}function U(i){if(typeof i.check==="string")return i.check;return i.jsonOptions?.outFile??"COMPONENT_API.json"}async function O(i,ve,Ae={}){let Pe=await em(ve);if(Pe===null)return{snapshotExists:!1,snapshotFile:ve,changes:[],bump:"none"};if(Pe.schemaVersion!==os)return{snapshotExists:!0,snapshotFile:ve,changes:[{component:"*",kind:"schema",bump:"none",message:`snapshot schemaVersion ${Pe.schemaVersion} differs from ${os}; regenerate the snapshot`}],bump:"none"};let Ne=s(i,{entryExports:Ae.entryExports}),De=Ee(Pe,Ne);return{snapshotExists:!0,snapshotFile:ve,changes:De,bump:Gh(De)}}var tm={major:"BREAKING",minor:"additive",patch:"patch",none:"no change"};function K(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 ve=[],Ae=i.changes.length;ve.push(`sveld --check: ${Ae} API change${Ae===1?"":"s"} detected against "${i.snapshotFile}".`),ve.push(`Suggested semver bump: ${i.bump}.`);let Pe=new Map;for(let Ne of i.changes){let De=Pe.get(Ne.component)??[];De.push(Ne),Pe.set(Ne.component,De)}for(let[Ne,De]of Pe){ve.push(""),ve.push(` ${Ne}`);for(let _e of De){let Re=_e.kind==="schema"?"schema":tm[_e.bump];ve.push(` [${Re}] ${_e.message}`)}}return ve.join(`
|
|
36
|
+
`)}var be=1;function ee(i){let ve={kind:"check-report",schemaVersion:be,...i};return Vn(ve)}import{existsSync as rm}from"node:fs";import{join as sm}from"node:path";import{pathToFileURL as im}from"node:url";function nm(i,ve){let Ae=i.length+1,Pe=ve.length+1,Ne=Array.from({length:Ae},()=>Array(Pe).fill(0));for(let De=0;De<Ae;De++)Ne[De][0]=De;for(let De=0;De<Pe;De++)Ne[0][De]=De;for(let De=1;De<Ae;De++)for(let _e=1;_e<Pe;_e++){let Re=i[De-1]===ve[_e-1]?0:1;Ne[De][_e]=Math.min(Ne[De-1][_e]+1,Ne[De][_e-1]+1,Ne[De-1][_e-1]+Re)}return Ne[Ae-1][Pe-1]}function us(i,ve){let Ae,Pe=Number.POSITIVE_INFINITY;for(let Ne of ve){let De=nm(i,Ne);if(De<Pe)Ae=Ne,Pe=De}if(Ae===void 0||Pe>3)return;return Ae}var am=["sveld.config.js","sveld.config.mjs","sveld.config.ts"];function we(i){return i}function om(i=process.cwd()){for(let ve of am){let Ae=sm(i,ve);if(rm(Ae))return Ae}return null}async function $i(i){let ve;try{ve=await import(`${im(i).href}?t=${Date.now()}`)}catch(Pe){let Ne=Pe instanceof Error?Pe.message:String(Pe);throw Error(`sveld: failed to load config file "${i}".
|
|
37
|
+
${Ne}`)}let Ae=ve.default;if(!kt(Ae)||Array.isArray(Ae))throw Error(`sveld: config file "${i}" must export a configuration object as its default export. Did you forget \`export default defineConfig({ ... })\`?`);return Ae}async function v(i=process.cwd()){let ve=om(i);if(ve===null)return{};return $i(ve)}function D(...i){let ve={};for(let Ae of i){if(!Ae)continue;for(let[Pe,Ne]of Object.entries(Ae)){let De=ve[Pe];ve[Pe]=kt(De)&&!Array.isArray(De)&&kt(Ne)&&!Array.isArray(Ne)?{...De,...Ne}:Ne}}return ve}var cm={ci:{strict:!0,reportDiagnostics:!0,check:!0,checkExamples:!0},local:{reportDiagnostics:!0}};function H(i){let{strict:ve,...Ae}=i;if(ve!=="ci"&&ve!=="local")return i;return{...cm[ve],...Ae}}var ol=["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"],lm={typesOptions:["outDir","preamble","format","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 cl(i,ve,Ae){let Pe=i===null?ve:`${i}.${ve}`,Ne=us(ve,Ae),De=Ne===void 0?void 0:i===null?Ne:`${i}.${Ne}`;console.warn(`sveld: unknown option "${Pe}".${De?` Did you mean "${De}"?`:""}`)}function _(i){for(let ve of Object.keys(i))if(!ol.includes(ve))cl(null,ve,ol);for(let[ve,Ae]of Object.entries(lm)){let Pe=i[ve];if(!kt(Pe))continue;for(let Ne of Object.keys(Pe))if(!Ae.includes(Ne))cl(ve,Ne,Ae)}}var ds=new Map;function S(i,ve){if(!ve?.replace&&ds.has(i.name))throw Error(`sveld: a writer named "${i.name}" is already registered. Pass { replace: true } to overwrite it.`);ds.set(i.name,i)}function W(i){return ds.get(i)}function Ce(){return Array.from(ds.values())}import{dirname as Lp,isAbsolute as kx,resolve as wx}from"node:path";import{existsSync as Vl,lstatSync as Gl,readFileSync as ug,realpathSync as dg,statSync as Ul}from"node:fs";import{readFile as fg}from"node:fs/promises";import{basename as hg,dirname as Hl,extname as mg,isAbsolute as gg,join as ql,parse as yg,relative as Xi,resolve as er}from"node:path";function Cr(i){return i}function Cn(i){if(i==="")return i;return i.startsWith(".")?i:`./${i}`}import{dirname as pl,resolve as ul}from"node:path";var pm=/^(['"])(.*)\1$/,dl=/^[./]/,um=/import\(\s*(['"])((?:(?!\1).)+)\1\s*\)/g;function dm(i,ve){let Ae=i.extends?.import;if(Ae===void 0)return null;let Pe=Ae.replace(pm,"$2");if(!dl.test(Pe))return null;return ul(pl(ve),Pe)}function ll(i,ve){let Ae=[];for(let Pe of i.matchAll(um)){let Ne=Pe[2];if(!dl.test(Ne))continue;Ae.push(ul(pl(ve),Ne))}return Ae}function fm(i,ve){let Ae=[],Pe=dm(i,ve);if(Pe!==null)Ae.push(Pe);for(let Ne of i.typedefs??[])Ae.push(...ll(Ne.type,ve));for(let Ne of i.props)if(Ne.type)Ae.push(...ll(Ne.type,ve));return Ae}function vr(i,ve){let Ae=new Map;for(let Pe of i.values()){let Ne=ve(Pe.filePath);for(let De of fm(Pe,Ne)){let _e=Ae.get(De);if(_e===void 0)_e=new Set,Ae.set(De,_e);_e.add(Ne)}}return Ae}function fs(i,ve){let Ae=new Set,Pe=[];for(let Ne of i)if(!Ae.has(Ne))Ae.add(Ne),Pe.push(Ne);while(Pe.length>0){let Ne=Pe.shift(),De=ve.get(Ne);if(De===void 0)continue;for(let _e of De)if(!Ae.has(_e))Ae.add(_e),Pe.push(_e)}return Ae}var hm=/^```([\w-]*)\r?\n([\s\S]*?)\r?\n?```$/,mm=new Set(["","js","jsx","ts","tsx","javascript","typescript"]),gm=new Set(["svelte","html"]);function ym(i){let ve=i.trim();if(ve==="")return null;let Ae=ve.match(hm);if(Ae){let Pe=Ae[1].toLowerCase(),Ne=Ae[2].trim();if(Ne==="")return null;if(mm.has(Pe))return{kind:"compile",code:Ne};if(gm.has(Pe))return{kind:"syntax",code:Ne};return null}if(ve.startsWith("<"))return null;return{kind:"compile",code:ve}}function fl(i){if(!i.isFunction)return"any";return`(${(i.params??[]).map((Ae)=>`${Ae.name}${Ae.optional?"?":""}: any`).join(", ")}) => any`}function hs(i,ve,Ae,Pe,Ne){let De=(i??[]).filter((Re)=>Re.name==="example"),_e=[];return De.forEach((Re,Oe)=>{let Be=ym(Re.body);if(Be===null)return;let Me=De.length>1;_e.push({id:Me?`${ve}#${Oe}`:ve,name:Me?`${Ae} (example ${Oe+1})`:Ae,type:Pe,code:Be.code,kind:Be.kind,...Ne?{source:Ne}:{}})}),_e}function hl(i){return i.name??"default"}function ml(i){let ve=[];for(let Ae of i.props)ve.push(...hs(Ae.tags,`prop:${Ae.name}`,Ae.name,fl(Ae),Ae.source));for(let Ae of i.moduleExports)ve.push(...hs(Ae.tags,`export:${Ae.name}`,Ae.name,fl(Ae),Ae.source));for(let Ae of i.slots)ve.push(...hs(Ae.tags,`slot:${hl(Ae)}`,hl(Ae),"any",Ae.source));for(let Ae of i.events)ve.push(...hs(Ae.tags,`event:${Ae.name}`,Ae.name,"any",Ae.source));return ve}import{existsSync as xm,readdirSync as bm}from"node:fs";import{join as Em}from"node:path";var Fi=new Map;function ms(){Fi.clear()}function gs(i){let ve=Fi.get(i);if(ve!==void 0)return ve;try{let Ae=bm(i,{withFileTypes:!0}),Pe=new Set;for(let Ne of Ae)Pe.add(Ne.name);ve={entries:Ae,names:Pe}}catch{ve=null}return Fi.set(i,ve),ve}function yl(i,ve){let Ae=gs(i);if(Ae===null)return;if(Ae.byName===void 0){Ae.byName=new Map;for(let Pe of Ae.entries)Ae.byName.set(Pe.name,Pe)}return Ae.byName.get(ve)}function gl(i){return i.normalize("NFC").toLowerCase()}function Sr(i,ve){let Ae=gs(i);if(Ae===null)return!1;if(Ae.names.has(ve))return!0;if(Ae.folded===void 0){Ae.folded=new Map;for(let Ne of Ae.names)Ae.folded.set(gl(Ne),Ne)}let Pe=Ae.folded.get(gl(ve));return Pe!==void 0&&Pe!==ve&&xm(Em(i,ve))}import{createHash as Cm,hash as xl}from"node:crypto";import{mkdirSync as vm,readFileSync as Sm,renameSync as Tm,writeFileSync as bl}from"node:fs";import{dirname as Am,isAbsolute as km,join as wm,resolve as El}from"node:path";var ji=2,Pm=wm("node_modules",".cache","sveld","parse-cache.json");function Vi(){return`${as}+svelte@${Er}`}function Sl(i,ve){if(typeof ve==="string")return km(ve)?ve:El(i,ve);return El(i,Pm)}var Cl=typeof xl==="function"?xl:void 0;function Tl(i){if(Cl)return Cl("sha256",i,"hex");return Cm("sha256").update(i).digest("hex")}function vl(){return{formatVersion:ji,toolchainVersion:Vi(),entries:{}}}function Nm(i){try{let ve=Sm(i,"utf-8"),Ae=JSON.parse(ve);if(Ae.formatVersion!==ji||Ae.toolchainVersion!==Vi())return vl();return Ae}catch{return vl()}}class qi{cacheFilePath;file;next=new Map;blocked=new Set;constructor(i){this.cacheFilePath=i,this.file=Nm(i)}has(i,ve){if(this.blocked.has(i))return!1;let Ae=this.file.entries[i];return Ae!==void 0&&Ae.hash===ve}get(i,ve){if(this.blocked.has(i))return null;let Ae=this.file.entries[i];if(Ae===void 0||Ae.hash!==ve)return null;if(this.next.set(i,Ae),Ae.typeScriptMetadata!==void 0)Ae.parsed[y]=Ae.typeScriptMetadata;return Ae.parsed}set(i,ve,Ae){this.next.set(i,{hash:ve,parsed:Ae,typeScriptMetadata:Ae[y]})}invalidate(i){this.blocked.add(i)}getGeneratedText(i,ve){let Ae=this.next.get(i);if(Ae?.generatedText===void 0||Ae.generatedText.format!==ve)return;return Ae.generatedText.text}setGeneratedText(i,ve,Ae){let Pe=this.next.get(i);if(Pe===void 0)return;Pe.generatedText={format:ve,text:Ae}}save(){vm(Am(this.cacheFilePath),{recursive:!0});let i={formatVersion:ji,toolchainVersion:Vi(),entries:Object.fromEntries(this.next)},ve=JSON.stringify(i),Ae=`${this.cacheFilePath}.${process.pid}.tmp`;try{bl(Ae,ve),Tm(Ae,this.cacheFilePath)}catch{try{bl(this.cacheFilePath,ve)}catch{}}}}import{lstatSync as jm,readFileSync as Vm}from"node:fs";import{basename as qm,dirname as zi,join as Wm,relative as Gm,resolve as Dl}from"node:path";var Yn=null,Wi=null;function qn(){if(Yn)return Promise.resolve(Yn);if(!Wi)Wi=Promise.all([import("./chunk-fj7dbych.js"),import("./chunk-fc72j0vd.js")]).then(([i,ve])=>(Yn={ComponentParser:i.default,parseSvelte:ve.parse},Yn));return Wi}function ys(){if(!Yn)throw Error("sveld: internal error, parser stack read before loadParserStack() resolved.");return Yn}import{existsSync as Es,readFileSync as _m}from"node:fs";import{dirname as Gi,isAbsolute as Im,join as Dm,relative as Rm,resolve as Cs}from"node:path";function xs(i){if(!kt(i))return{};let ve={};if(typeof i.svelte==="string")ve.svelte=i.svelte;if(typeof i.name==="string")ve.name=i.name;if(typeof i.description==="string")ve.description=i.description;return ve}function Al(i){if(!kt(i))return{};let ve={};if(typeof i.extends==="string")ve.extends=i.extends;if(kt(i.compilerOptions)){let Ae={};if(typeof i.compilerOptions.baseUrl==="string")Ae.baseUrl=i.compilerOptions.baseUrl;if(kt(i.compilerOptions.paths)){let Pe={};for(let[Ne,De]of Object.entries(i.compilerOptions.paths))if(Array.isArray(De)&&De.every((_e)=>typeof _e==="string"))Pe[Ne]=De;if(Object.keys(Pe).length>0)Ae.paths=Pe}if(Object.keys(Ae).length>0)ve.compilerOptions=Ae}return ve}var bs=new Map,kl=new Map,Lm=/\/\*[\s\S]*?\*\/|\/\/.*/g,Om=/[.+?^${}()|[\]\\]/g,Mm=[".svelte",".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".d.ts"];class Qn extends Error{specifier;fromFile;searched;constructor(i,ve,Ae){super(`cannot resolve "${i}" from ${ve||"."} (${Ae})`);this.name="UnresolvedModuleError",this.specifier=i,this.fromFile=ve,this.searched=Ae}}function Bm(i){if(Es(i))return!0;return Mm.some((ve)=>Es(i+ve))}function wl(i){let ve=i.indexOf("*");return ve===-1?i.length:ve}function $m(i){let ve=i,Ae=Cs(ve,"/");while(ve!==Ae){for(let Pe of["tsconfig.json","jsconfig.json"]){let Ne=Dm(ve,Pe);if(Es(Ne))return Ne}ve=Gi(ve)}return null}function Pl(i){if(bs.has(i))return bs.get(i)??null;try{let ve=_m(i,"utf-8"),Ae;try{Ae=JSON.parse(ve)}catch{let Ne=ve.replace(Lm,"");Ae=JSON.parse(Ne)}let Pe=Al(Ae);if(Pe.extends){let Ne=Im(Pe.extends)?Pe.extends:Cs(Gi(i),Pe.extends),De=Ne.endsWith(".json")?Ne:`${Ne}.json`;if(Es(De)){let _e=Pl(De);if(_e)Pe.compilerOptions={..._e.compilerOptions,...Pe.compilerOptions,paths:{..._e.compilerOptions?.paths,...Pe.compilerOptions?.paths}}}}return bs.set(i,Pe),Pe}catch{return bs.set(i,null),null}}function Fm(i){let ve=kl.get(i);if(!ve){let Ae=i.split("*").map((Pe)=>Pe.replace(Om,"\\$&")).join("(.*)");ve=new RegExp(`^${Ae}$`),kl.set(i,ve)}return ve}function vs(i,ve){if(i.startsWith(".")||i.startsWith("/"))return{resolved:i,unresolved:!1,searched:""};let Ae=$m(ve);if(!Ae)return{resolved:i,unresolved:!0,searched:"no tsconfig/jsconfig paths found"};let Pe=Pl(Ae);if(!Pe?.compilerOptions?.paths)return{resolved:i,unresolved:!0,searched:"no tsconfig/jsconfig paths found"};let{baseUrl:Ne=".",paths:De}=Pe.compilerOptions,_e=Gi(Ae),Re=Cs(_e,Ne),Oe=Object.entries(De).sort(([Be],[Me])=>wl(Me)-wl(Be));for(let[Be,Me]of Oe){let je=i.match(Fm(Be));if(!je)continue;let qe;for(let Ge of Me){let He=Ge;for(let ze=1;ze<je.length;ze++)He=He.replace("*",je[ze]);let Xe=Cs(Re,He);if(qe===void 0)qe=Xe;if(Bm(Xe))return{resolved:Xe,unresolved:!1,searched:Ae}}return{resolved:qe??i,unresolved:!1,searched:Ae}}return{resolved:i,unresolved:!0,searched:`tsconfig paths (${Ae})`}}function Ui(i,ve){return vs(i,ve).resolved}function Ss(i,ve){if(i.startsWith(".")||i.startsWith("/"))return i;let Ae=Ui(i,ve);if(Ae===i)return i;let Pe=Rm(ve,Ae);return Pe=e(Pe),Pe.startsWith(".")?Pe:`./${Pe}`}var Hi=[".ts",".mts",".cts",".tsx",".js",".mjs",".cjs",".jsx",".d.ts"],Um=/\r?\n/,Hm=/^\s*\*+/;function xt(i){return i&&typeof i==="object"?i:void 0}function Wn(i){return Array.isArray(i)?i:[]}function dn(i){return a(i)?i.name:void 0}function fn(i,ve){let Ae=Ui(i,ve),Pe=Dl(ve,Ae),Ne=zi(Pe),De=qm(Pe);if(Sr(Ne,De)){let Re=yl(Ne,De)??jm(Pe,{throwIfNoEntry:!1});if(Re?.isFile())return Pe;for(let Oe of Hi)if(Sr(Ne,De+Oe))return Pe+Oe;if(Re?.isDirectory()){for(let Oe of Hi)if(Sr(Pe,`index${Oe}`))return Wm(Pe,`index${Oe}`)}return null}for(let _e of Hi)if(Sr(Ne,De+_e))return Pe+_e;return null}function Km(i,ve){let Ae=i.slice(0,ve).trimEnd();if(!Ae.endsWith("*/"))return;let Pe=Ae.length-2,Ne=Ae.lastIndexOf("/**",Pe);if(Ne===-1)return;let De=[];for(let _e of Ae.slice(Ne+3,Pe).split(Um)){let Re=_e.replace(Hm,"").trim();if(Re.startsWith("@"))break;if(Re)De.push(Re)}return De.join(" ")||void 0}function zm(i,ve){let Ae=i.slice(0,ve).trimEnd();if(!Ae.endsWith("*/"))return;let Pe=Ae.length-2,Ne=Ae.lastIndexOf("/**",Pe);if(Ne===-1)return;return Ae.slice(Ne,Pe+2)}function Zn(i,ve){if(!ve)return;return i.text.slice(ve.start,ve.end)}function Xm(i,ve){let Ae=xt(ve?.typeAnnotation);if(Ae?.type!=="TSTypeAnnotation")return;return Zn(i,xt(Ae.typeAnnotation))}function Ki(i,ve){let Ae=xt(ve.returnType);return Ae?.type==="TSTypeAnnotation"?Zn(i,xt(Ae.typeAnnotation)):void 0}function Nl(i,ve){let Ae=Wn(ve.params).map((Ne)=>Zn(i,Ne)??"").join(", "),Pe=Ki(i,ve);return`(${Ae})${Pe?` => ${Pe}`:""}`}function Rl(i){if(i.type==="Literal"){let ve=i.value;if(typeof ve==="string")return"string";if(typeof ve==="number")return"number";if(typeof ve==="boolean")return"boolean"}if(i.type==="TemplateLiteral")return"string";return}function Jm(i){if(!i)return;let ve=i.lastIndexOf("=>");if(ve===-1)return;return i.slice(ve+2).trim()||void 0}function _l(i){if(i.async||i.generator)return;let ve=xt(i.body);if(!ve)return;let Ae=[];if(ve.type==="BlockStatement"){if(Tr(ve,Ae),Ae.length===0)return}else Ae.push(ve);let Pe;for(let Ne of Ae){if(!Ne)return;let De=Rl(Ne);if(!De)return;if(Pe===void 0)Pe=De;else if(Pe!==De)return}return Pe}function Tr(i,ve){for(let Ae of Wn(i.body)){if(Ae.type==="FunctionDeclaration"||Ae.type==="FunctionExpression"||Ae.type==="ArrowFunctionExpression")continue;if(Ae.type==="ReturnStatement"){ve.push(xt(Ae.argument)??null);continue}if(Ae.type==="BlockStatement"){Tr(Ae,ve);continue}let Pe=xt(Ae.consequent);if(Pe?.type==="BlockStatement")Tr(Pe,ve);else if(Pe?.type==="ReturnStatement")ve.push(xt(Pe.argument)??null);let Ne=xt(Ae.alternate);if(Ne?.type==="BlockStatement")Tr(Ne,ve);else if(Ne?.type==="ReturnStatement")ve.push(xt(Ne.argument)??null);let De=xt(Ae.body);if(De?.type==="BlockStatement")Tr(De,ve)}}function Ym(i){let ve=xt(i.initializer);if(!ve)return;if(ve.type==="Literal"){let Ae=ve.value;return typeof Ae==="string"||typeof Ae==="number"?Ae:void 0}if(ve.type==="UnaryExpression"){let Ae=xt(ve.argument);if(ve.operator==="-"&&Ae?.type==="Literal"){let Ne=Ae.value;if(typeof Ne==="number")return-Ne}}return}function Qm(i){let ve=Wn(i.members);if(ve.length===0)return;let Ae=[],Pe=0;for(let Ne of ve){if(!xt(Ne.initializer)){Ae.push(String(Pe)),Pe+=1;continue}let _e=Ym(Ne);if(_e===void 0)return;Ae.push(typeof _e==="string"?JSON.stringify(_e):String(_e)),Pe=typeof _e==="number"?_e+1:Pe}return Ae.join(" | ")}function Il(i,ve,Ae){let Pe=i.filePath,Ne=Km(i.text,Ae),De=zm(i.text,Ae),_e=De?Kc(De):void 0,{deprecated:Re,tags:Oe,internal:Be}=De?zc(De):{deprecated:void 0,tags:void 0,internal:!1},Me=Be?{internal:!0}:{};if(ve.type==="VariableDeclaration"){let je=ve.kind??"const",qe=[];for(let Ge of Wn(ve.declarations)){let He=xt(Ge.id),Xe=dn(He);if(!Xe)continue;let ze=Xm(i,He),tt,at,Ze,nt=xt(Ge.init);if(nt)if(nt.type==="ArrowFunctionExpression"||nt.type==="FunctionExpression"){if(!ze)ze=Nl(i,nt);at=Ki(i,nt)??_e??Jm(ze)??_l(nt)}else{if(tt=Zn(i,nt),!ze)ze=Rl(nt);Ze=Zr(nt)??void 0}qe.push({name:Xe,kind:je,type:ze,value:tt,returnType:at,literalValue:Ze,description:Ne,deprecated:Re,tags:Oe,...Me,declFile:Pe,isTypeOnly:!1})}return qe}if(ve.type==="FunctionDeclaration"||ve.type==="TSDeclareFunction"){let je=dn(xt(ve.id));if(!je)return[];return[{name:je,kind:"function",type:Nl(i,ve),returnType:Ki(i,ve)??_e??_l(ve),description:Ne,deprecated:Re,tags:Oe,...Me,declFile:Pe,isTypeOnly:!1}]}if(ve.type==="ClassDeclaration"){let je=dn(xt(ve.id));if(!je)return[];return[{name:je,kind:"class",type:je,description:Ne,deprecated:Re,tags:Oe,...Me,declFile:Pe,isTypeOnly:!1}]}if(ve.type==="TSTypeAliasDeclaration"){let je=dn(xt(ve.id));if(!je)return[];return[{name:je,kind:"type",type:Zn(i,xt(ve.typeAnnotation)),description:Ne,deprecated:Re,tags:Oe,...Me,declFile:Pe,isTypeOnly:!0}]}if(ve.type==="TSInterfaceDeclaration"){let je=dn(xt(ve.id));if(!je)return[];return[{name:je,kind:"interface",type:Zn(i,xt(ve.body)),description:Ne,deprecated:Re,tags:Oe,...Me,declFile:Pe,isTypeOnly:!0}]}if(ve.type==="TSEnumDeclaration"){let je=dn(xt(ve.id));if(!je)return[];return[{name:je,kind:"enum",type:Qm(ve)??je,description:Ne,deprecated:Re,tags:Oe,...Me,declFile:Pe,isTypeOnly:!1}]}return[]}function Zm(i){let ve;try{ve=Vm(i,"utf-8")}catch{return null}let Ae=`<script lang="ts">
|
|
38
|
+
${ve}
|
|
39
|
+
</script>`;try{let Pe=ys().parseSvelte(Ae),Ne=Wn(Pe.instance?.content?.body);return{source:{text:Ae,filePath:i,dir:zi(i)},body:Ne}}catch(Pe){let Ne=Pe instanceof Error?Pe.message:String(Pe);return console.warn(`Warning: Failed to parse entry export module ${i}: ${Ne}`),null}}function eg(i,ve){for(let Ae of i){if(Ae.type!=="ImportDeclaration")continue;let Pe=xt(Ae.source)?.value;if(typeof Pe!=="string")continue;for(let Ne of Wn(Ae.specifiers)){if(Ne.type!=="ImportSpecifier")continue;if(dn(xt(Ne.local))===ve){let De=dn(xt(Ne.imported))??ve;return{specifier:Pe,importedName:De}}}}return null}function vn(i,ve){let Ae=ve.cache.get(i);if(Ae)return Ae;if(ve.computing.has(i))return[];ve.computing.add(i);let Pe=Zm(i);if(!Pe)return ve.computing.delete(i),ve.cache.set(i,[]),[];let{source:Ne,body:De}=Pe,_e=[],Re=new Map;for(let Be of De){let Me=Be.type==="ExportNamedDeclaration"?xt(Be.declaration):Be;if(!Me)continue;for(let je of Il(Ne,Me,Me.start))Re.set(je.name,je)}let Oe=(Be)=>{let Me=Re.get(Be);if(Me)return Me;let je=eg(De,Be);if(!je||je.specifier.endsWith(".svelte"))return null;let qe=fn(je.specifier,Ne.dir);if(!qe)return null;return vn(qe,ve).findLast((Ge)=>Ge.name===je.importedName)??null};for(let Be of De){if(Be.type==="ExportAllDeclaration"){let He=xt(Be.source)?.value;if(typeof He!=="string"||He.endsWith(".svelte"))continue;let Xe=fn(He,Ne.dir);if(!Xe)continue;let ze=Be.exportKind==="type";for(let tt of vn(Xe,ve))_e.push(ze?{...tt,isTypeOnly:!0}:tt);continue}if(Be.type!=="ExportNamedDeclaration")continue;let Me=xt(Be.declaration);if(Me){_e.push(...Il(Ne,Me,Be.start));continue}let je=xt(Be.source)?.value,qe=typeof je==="string"?je:void 0;if(qe?.endsWith(".svelte"))continue;let Ge=Be.exportKind==="type";for(let He of Wn(Be.specifiers)){if(He.type!=="ExportSpecifier")continue;let Xe=dn(xt(He.exported)),ze=dn(xt(He.local));if(!Xe||!ze||ze==="default"||Xe==="default")continue;let tt=Ge||He.exportKind==="type",at=null;if(qe){let Ze=fn(qe,Ne.dir);if(Ze)at=vn(Ze,ve).findLast((nt)=>nt.name===ze)??null}else at=Oe(ze);if(at?.declFile.endsWith(".svelte"))continue;if(at)_e.push({...at,name:Xe,isTypeOnly:at.isTypeOnly||tt});else _e.push({name:Xe,kind:tt?"type":"const",declFile:i,isTypeOnly:tt})}}return ve.computing.delete(i),ve.cache.set(i,_e),_e}async function Ar(i){await qn();let ve=Dl(i),Ae=zi(ve),Pe=vn(ve,{cache:new Map,computing:new Set}),Ne=(Re)=>e(`./${Gm(Ae,Re)}`),De=new Map,_e=new Map;for(let Re of Pe){let Oe=_e.get(Re.name);if(Oe!==void 0&&Oe!==Re.declFile){console.warn(`Warning: "${Re.name}" is exported from both "${Ne(Oe)}" and "${Ne(Re.declFile)}"; keeping the first and dropping the rest.`);continue}_e.set(Re.name,Re.declFile);let{declFile:Be,returnType:Me,literalValue:je,...qe}=Re;De.set(Re.name,{...qe,source:Ne(Be)})}return Array.from(De.values()).sort((Re,Oe)=>Re.name.localeCompare(Oe.name))}import{readFileSync as Ol}from"node:fs";import{dirname as Ml,join as tg,relative as ng,resolve as rg}from"node:path";var Ll=new Map;function sg(i){return si(i,{ecmaVersion:"latest",sourceType:"module"})}function ig(i,ve,Ae){let Pe=fn(i,ve);if(!Pe)return null;let Ne=Ml(Pe);if(Ae.has(Pe))return{dir:Ne,exports:{}};Ae.add(Pe);try{return{dir:Ne,exports:Ts(Ol(Pe,"utf-8"),Ne,Ae,Pe)}}catch{return{dir:Ne,exports:{}}}finally{Ae.delete(Pe)}}function Ts(i,ve,Ae=new Set,Pe=ve){let Ne=Ll.get(i);if(!Ne)Ne=sg(i),Ll.set(i,Ne);let De={};for(let _e of Ne.body)if(_e.type==="ExportDefaultDeclaration"){let Re=_e.declaration.name;if(Re in De)De[Re].default=!0;else De[Re]={source:Cn(""),default:!0}}else if(_e.type==="ExportAllDeclaration"){if(!_e.source)continue;let Re=_e.source.value,Oe=fn(Re,ve);if(!Oe){let je=vs(Re,ve);throw new Qn(Re,Pe,je.unresolved?je.searched:"no matching file or index found")}if(Ae.has(Oe))continue;Ae.add(Oe);let Be=Ol(Oe,"utf-8"),Me=Ts(Be,Ml(Oe),Ae,Oe);Ae.delete(Oe);for(let[je,qe]of Object.entries(Me)){let Ge=Cn(e(`./${tg(Re,qe.source)}`));De[je]={...qe,source:Ge}}}else if(_e.type==="ExportNamedDeclaration"){let Re=_e.source?.value,Oe=Re!==void 0&&In.test(Re);if(Oe){let je=vs(Re,ve);if(je.unresolved)throw new Qn(Re,Pe,je.searched)}let Me=Re!==void 0&&!Oe?ig(Re,ve,Ae):void 0;if(Me===null)console.warn(`sveld: could not resolve re-exported module "${Re}" from barrel "${ve||"."}"; skipping.`);for(let je of _e.specifiers){let qe=je.exported.name,Ge=je.local.name,He=qe||Ge;if(Me===null)continue;let Xe=Me?.exports[Ge],ze=Xe?Cn(e(`./${ng(ve,rg(Me.dir,Xe.source))}`)):Cn(Ss(Re??"",ve)),tt=Xe?Xe.default:Ge==="default";if(He in De){if(De[He].mixed=!0,!De[He].source)De[He].source=ze}else De[He]={source:ze,default:tt}}}else if(_e.type==="ImportDeclaration"){let Re=_e.specifiers[0].local.name;if(Re in De){if(!De[Re].source)De[Re].source=Cn(Ss(_e.source?.value??"",ve))}else De[Re]={source:Cn(Ss(_e.source?.value??"",ve)),default:Re==="default"}}return De}import{existsSync as ag}from"node:fs";import{dirname as og}from"node:path";function Bl(){return{cache:new Map,computing:new Set}}var cg=/\.[^./\\]+$/;function lg(i){if(i.endsWith(".d.ts"))return null;let ve=i.replace(cg,".d.ts");return ag(ve)?ve:null}function $l(i,ve,Ae){let Pe=og(i);return ve.map((Ne)=>{if(!Ne.importSource||!Ne.importedName)return{candidate:Ne};let De=fn(Ne.importSource,Pe);if(!De)return{candidate:Ne,failureReason:"module-not-found"};let _e=vn(De,Ae).find((Oe)=>Oe.name===Ne.importedName);if(!_e)return{candidate:Ne,failureReason:"export-not-found"};if(_e.returnType)return{candidate:Ne,type:_e.returnType};let Re=lg(De);if(Re){let Oe=vn(Re,Ae).find((Be)=>Be.name===Ne.importedName);if(Oe?.returnType)return{candidate:Ne,type:Oe.returnType}}return{candidate:Ne,failureReason:"return-type-unresolved"}})}function Fl(i,ve){switch(ve){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 pg}from"node:path";function jl(i,ve,Ae){let Pe=pg(i);return ve.map((Ne)=>{let De=fn(Ne.importSource,Pe);if(!De)return{candidate:Ne};let _e=vn(De,Ae).find((Re)=>Re.name===Ne.importedName);if(_e?.kind!=="const"||_e.literalValue===void 0)return{candidate:Ne};return{candidate:Ne,key:_e.literalValue}})}function E(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}}var xg=/-/g,bg=/[^A-Za-z0-9_$]/g,Eg=/^[0-9]/;function Cg(i){let ve=i.replace(bg,""),Ae=Eg.test(ve)?`_${ve}`:ve;if(Ae!==i)console.warn(`Warning: "${i}" is not a valid identifier; using "${Ae}" instead.`);return Ae}function Kl(i,ve=[],Ae=new Set,Pe){let Ne;try{Ne=Pe??dg(i)}catch{return ve}if(Ae.has(Ne))return ve;Ae.add(Ne);let De=gs(i);if(De===null)return ve;let _e=De.entries;for(let Re of _e){if(Re.name.startsWith("."))continue;let Oe=ql(i,Re.name),Be=Re.isSymbolicLink(),Me=Be?Ul(Oe,{throwIfNoEntry:!1}):Re;if(!Me)continue;if(Me.isDirectory())Kl(Oe,ve,Ae,Be?void 0:ql(Ne,Re.name));else if(Me.isFile()&&Re.name.endsWith(".svelte"))ve.push(Oe)}return ve}function vg(i){return Kl(i).map((ve)=>{let Ae=Cg(hg(ve,".svelte").replace(xg,"")),Pe=Cn(e(`./${Xi(i,ve)}`));return{moduleName:Ae,source:Pe}}).sort((ve,Ae)=>ve.source.localeCompare(Ae.source))}function Sg(i){return!ss(i)}function Tg(i,ve){let Ae=i.endsWith("/")?i:`${i}/`;return ve.startsWith(Ae)}function As(i,ve){return{seenPaths:new Set(i.map(([,Ae])=>ve(Ae.source))),seenModuleNamePaths:new Map(i.map(([Ae,Pe])=>[Ae,ve(Pe.source)])),warnedModuleNames:new Set}}function Ji(i,ve,Ae,Pe,Ne){for(let{moduleName:De,source:_e}of vg(i)){let Re=Pe(_e),Oe=ve[De];if(Oe&&Sg(Oe.source)&&Tg(Oe.source,_e)){Ne.seenPaths.delete(Pe(Oe.source)),Oe.source=_e,Ne.seenPaths.add(Re),Ne.seenModuleNamePaths.set(De,Re);continue}if(Ne.seenPaths.has(Re))continue;Ne.seenPaths.add(Re);let Be=Ne.seenModuleNamePaths.get(De);if(Be===void 0)Ne.seenModuleNamePaths.set(De,Re);else if(Be!==Re&&!Ne.warnedModuleNames.has(De))Ne.warnedModuleNames.add(De),console.warn(`Warning: multiple components named "${De}" found (${e(Xi(i,Be))} and ${e(Xi(i,Re))}). Both are included in TypeScript definitions, but only one can be the named export.`);Ae.push([De,{source:_e,default:!1}])}}function ks(i,ve,Ae=!1){ms();let Pe=Gl(i).isFile(),Ne=Pe?Hl(i):i,De=er(Ne),_e=new Map,Re=(Me)=>{let je=_e.get(Me);if(je===void 0)je=gg(Me)?er(Me):er(De,Me),_e.set(Me,je);return je},Oe={};if(Pe){let Me=ug(i,"utf-8");try{Oe=Ts(Me,De,new Set([er(i)]))}catch(je){if(!Ae)throw je;let qe=je instanceof Error?je.message:String(je);console.warn(`Warning: Failed to parse component exports from ${i}: ${qe}`)}}let Be=Object.entries(Oe);if(ve){let Me=As(Be,Re);if(Ji(De,Oe,Be,Re,Me),!Pe)Oe=Object.fromEntries(Be.map(([je,qe])=>[je,{...qe,default:!0}]))}return{exports:Oe,allComponentEntries:Be,rootDir:De,resolveComponentFilePath:Re}}async function ws(i){let ve=await Promise.all(Array.from(i).map(async(Ae)=>{try{let Pe=await fg(Ae,"utf-8");return{path:Ae,content:Pe}}catch(Pe){return console.warn(`Warning: Failed to read file ${Ae}:`,Pe),{path:Ae,content:null}}}));return new Map(ve.map(({path:Ae,content:Pe})=>[Ae,Pe]))}function Rn([i,ve],Ae,Pe,Ne,De={}){let _e=ve.source,Re=i;if(Ae.length===1&&i==="default")Re=yg(_e).name;if(ss(_e)){let Oe=Ne(_e),Be=Pe.get(Oe);if(Be===null||Be===void 0)return null;let Me=e(_e),je=De.memo?.get(Oe),qe=De.hashes?.get(Oe),Ge=je===void 0?qe===void 0?null:De.cache?.get(Oe,qe):null,He;if(je!==void 0)He=je;else if(Ge)He=Ge;else{let Xe=new(ys()).ComponentParser;try{He=Xe.parseSvelteComponent(Be,{moduleName:Re,filePath:Me})}catch(ze){if(De.failFast)throw ze;let tt=ze instanceof Error?ze.message:String(ze),at=ze instanceof Error?ze.stack:void 0;return De.onParseError?.({filePath:Me,moduleName:Re,message:tt,stack:at}),null}if(qe!==void 0)De.cache?.set(Oe,qe,He);De.memo?.set(Oe,He)}return{moduleName:Re,filePath:Me,...He}}return null}function Yi(i,ve){let Ae=new Set;for(let Pe of i)for(let[,Ne]of Pe)if(ss(Ne.source))Ae.add(ve(Ne.source));return Ae}function Ps(i){if(i.length===0)return;console.error(`sveld: failed to parse ${i.length} component(s):`);for(let{filePath:ve,message:Ae}of i)console.error(` - ${ve}: ${Ae}`)}async function b(i,ve,Ae={}){let Pe=Ae.documentExports===!0,{exports:Ne,allComponentEntries:De,rootDir:_e,resolveComponentFilePath:Re}=ks(i,ve,Pe),Oe=Pe&&Gl(i).isFile()?await Ar(er(i)):[],Be=Object.entries(Ne),Me=Yi([Be,De],Re),je=await ws(Me),qe=new Map,Ge=new Map,He=Ae.cache===!1?void 0:new qi(Sl(_e,Ae.cache??!0)),Xe=He?new Map:void 0,ze=new Set,tt=new Map;if(He)for(let We of Me){let Ue=je.get(We);if(Ue===null||Ue===void 0)continue;let Ke=Tl(Ue);if(tt.set(We,Ke),!He.has(We,Ke))ze.add(We)}if(Me.size>0&&(!He||ze.size>0))await qn();let at=new Map,Ze=new Map,nt={failFast:Ae.failFast===!0,onParseError:(We)=>at.set(We.filePath,We),cache:He,hashes:tt,memo:Ze};for(let We of Be){let Ue=Rn(We,Be,je,Re,nt);if(Ue)qe.set(Ue.moduleName,Ue)}for(let We of De){let Ue=Rn(We,De,je,Re,nt);if(Ue)Ge.set(Ue.filePath,Ue),Xe?.set(Ue.filePath,Re(We[1].source))}if(He&&ze.size>0){let We=vr(Ge,Re),Ue=fs(ze,We);for(let Ke of Ue){if(ze.has(Ke))continue;He.invalidate(Ke),Ze.delete(Ke)}for(let Ke of Be){let Qe=Re(Ke[1].source);if(!Ue.has(Qe)||ze.has(Qe))continue;let Ye=Rn(Ke,Be,je,Re,nt);if(Ye)qe.set(Ye.moduleName,Ye)}for(let Ke of De){let Qe=Re(Ke[1].source);if(!Ue.has(Qe)||ze.has(Qe))continue;let Ye=Rn(Ke,De,je,Re,nt);if(Ye)Ge.set(Ye.filePath,Ye),Xe?.set(Ye.filePath,Qe)}}let et=Array.from(at.values());if(Ps(et),!Ae.dryRun)He?.save();let yt=Ae.resolveTypes?Ng(qe):[],At=Ae.checkExamples?Ig(Ge):[],Ct=Ae.checkExamples===!0?Wl(At,"compile"):[],Ie=Ae.checkExamples?Wl(At,"syntax"):[];if(Ie.length>0)Dg(Ie);if(yt.length>0||Ct.length>0){let{TypeResolver:We}=await import("./chunk-0mgphvte.js"),Ue=await We.create(_e);if(!Ue.ok){let Qe=[yt.length>0?"resolveTypes":null,Ct.length>0?"checkExamples":null].filter((Ye)=>Ye!==null).join(" and ");throw Error(`sveld: \`${Qe}\` ${Ue.message}.`)}let Ke=Ue.resolver;try{if(yt.length>0)await _g(yt,Ke,Re);if(Ct.length>0)await Rg(Ct,Ke,Re)}finally{await Ke?.dispose()}}let Le=Ag(Ge),$e=wg(Ge);if(Le.length>0||$e.length>0){await qn();let We=Bl();for(let{component:Ue,candidates:Ke}of Le){let Qe=$l(Re(Ue.filePath),Ke,We);kg(Ue,Qe)}for(let{component:Ue,candidates:Ke}of $e){let Qe=jl(Re(Ue.filePath),Ke,We);Pg(Ue,Qe)}}Bg(Ge,Re);let Ve=Sc(es(Array.from(Ge.values()).flatMap((We)=>We.diagnostics??[])),Ae.diagnostics?.ignore);return{exports:Ne,entryExports:Oe,components:qe,allComponentsForTypes:Ge,errors:et,diagnostics:Ve,cache:He,resolvedPathByFilePath:Xe}}function Ag(i){let ve=[];for(let Ae of i.values()){let Pe=Jn(Ae)?.pendingCallDefaultCandidates?.filter((Ne)=>Ne.importSource!==void 0);if(!Pe||Pe.length===0)continue;ve.push({component:Ae,candidates:Pe})}return ve}function kg(i,ve){for(let{candidate:Ae,type:Pe,failureReason:Ne}of ve){let _e=(Ae.location==="props"?i.props:i.moduleExports).find((Re)=>Re.name===Ae.propName);if(_e?.typeSource!=="unknown")continue;if(Pe){if(_e.type=Pe,_e.typeSource="typescript",Ae.location==="props")i.diagnostics=(i.diagnostics??[]).filter((Re)=>!(Re.kind==="prop-unknown-type"&&Re.name===Ae.propName));continue}if(Ae.location==="props"&&Ne){let Re=i.diagnostics?.find((Oe)=>Oe.kind==="prop-unknown-type"&&Oe.name===Ae.propName);if(Re)Re.message=Fl(Ae,Ne)}}}function wg(i){let ve=[];for(let Ae of i.values()){let Pe=Jn(Ae)?.pendingContextKeyCandidates;if(!Pe||Pe.length===0)continue;ve.push({component:Ae,candidates:Pe})}return ve}function Pg(i,ve){for(let{candidate:Ae,key:Pe}of ve){if(!Pe){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((Ne)=>Ne.key===Pe))continue;i.contexts=[...i.contexts??[],{key:Pe,typeName:xr(Pe),description:Ae.description,properties:Ae.properties,source:Ae.source}]}}function Ng(i){let ve=[];for(let Ae of i.values()){let Pe=Jn(Ae);if(!Pe?.canonicalPropsType||Ae.props.length>0)continue;ve.push({component:Ae,metadata:Pe})}return ve}async function _g(i,ve,Ae){let Pe=await ve.expandAll(i.map(({component:Ne,metadata:De})=>({moduleName:Ne.moduleName,metadata:De,filePath:Ae(Ne.filePath)})));for(let{component:Ne}of i){let De=Pe.get(Ae(Ne.filePath));if(De)Cc(Ne,De)}}function Ig(i){let ve=[];for(let Ae of i.values()){let Pe=ml(Ae);if(Pe.length===0)continue;ve.push({component:Ae,sources:Pe})}return ve}function Wl(i,ve){let Ae=[];for(let{component:Pe,sources:Ne}of i){let De=Ne.filter((_e)=>_e.kind===ve);if(De.length===0)continue;Ae.push({component:Pe,sources:De})}return Ae}function Dg(i){for(let{component:ve,sources:Ae}of i){let Pe=ve.diagnostics??[];for(let Ne of Ae)try{P(Ne.code)}catch(De){if(De instanceof T)continue;Pe.push(_n({component:ve.filePath,kind:"example-syntax-error",name:Ne.name,message:De instanceof Error?De.message:String(De),...Ne.source?{source:Ne.source}:{}}))}ve.diagnostics=Pe}}async function Rg(i,ve,Ae){let Pe=await ve.checkExamples(i.map(({component:Ne,sources:De})=>({moduleName:Ne.moduleName,filePath:Ae(Ne.filePath),sources:De})));for(let{component:Ne,sources:De}of i){let _e=Pe.get(Ae(Ne.filePath));if(!_e||_e.length===0)continue;let Re=new Map(De.map((Be)=>[Be.id,Be.source])),Oe=Ne.diagnostics??[];for(let Be of _e){let Me=Re.get(Be.id);Oe.push(_n({component:Ne.filePath,kind:"example-compile-error",name:Be.name,message:Be.message,...Me?{source:Me}:{}}))}Ne.diagnostics=Oe}}var Lg=[".ts",".tsx",".d.ts",".svelte"];function Og(i){let ve=i.trim();if(ve.length<2)return;let Ae=ve[0],Pe=ve[ve.length-1];if((Ae==='"'||Ae==="'"||Ae==="`")&&Ae===Pe)return ve.slice(1,-1);return}function Mg(i,ve){let Ae=er(Hl(i),ve);if(Vl(Ae)&&Ul(Ae).isFile())return Ae;if(mg(ve)!=="")return;for(let Pe of Lg){let Ne=`${Ae}${Pe}`;if(Vl(Ne))return Ne}return}function Bg(i,ve){let Ae=new Map(Array.from(i.values()).map((Pe)=>[ve(Pe.filePath),Pe]));for(let Pe of i.values()){let Ne=Pe.extends;if(!Ne)continue;let De=Og(Ne.import);if(De===void 0||!De.startsWith(".")&&!De.startsWith("/"))continue;let _e=ve(Pe.filePath),Re=Mg(_e,De),Oe=Pe.diagnostics??[];if(Re===void 0){Oe.push(_n({component:Pe.filePath,kind:"extend-props-target-missing",name:Ne.interface,message:`@extends/@extendProps target "${De}" was not found on disk.`})),Pe.diagnostics=Oe;continue}let Be=Ae.get(Re);if(!Be)continue;let Me=`${Be.moduleName}Props`;if(Ne.interface!==Me){Oe.push(_n({component:Pe.filePath,kind:"extend-props-target-missing",name:Ne.interface,message:`@extends/@extendProps names "${Ne.interface}", but "${De}" generates "${Me}".`})),Pe.diagnostics=Oe;continue}for(let je of Pe.props){let qe=Be.props.find((Ge)=>Ge.name===je.name);if(qe&&qe.type!==je.type)Oe.push(_n({component:Pe.filePath,kind:"extend-props-override",name:je.name,message:`Own prop "${je.name}" (${je.type}) overrides "${Me}"'s "${je.name}" (${qe.type}).`}))}Pe.diagnostics=Oe}}import{existsSync as zl,readFileSync as $g}from"node:fs";import{join as Xl}from"node:path";function A(i){if(i){let Ae=Xl(process.cwd(),i);if(zl(Ae))return Cr(i);return console.error(`Invalid entry point: ${Ae}. Pass a valid --entry (or "entry" option), or unset it and`),console.error('set the "svelte" field in your package.json instead.'),null}let ve=Xl(process.cwd(),"package.json");if(!zl(ve))return console.error("Could not locate a package.json file."),console.error(`Specify an entry point with --entry (or the "entry" option) instead.
|
|
40
|
+
`),null;try{let Ae=xs(JSON.parse($g(ve,"utf-8")));if(Ae.svelte?.trim())return Cr(Ae.svelte);return console.error(`Could not determine an entry point.
|
|
41
|
+
`),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).
|
|
42
|
+
`),null}catch(Ae){throw console.error("Error reading package.json:",Ae),Ae}}var Jl=!1;function N(i){Jl=i}function zt(i){if(!Jl)console.error(i)}import{lstatSync as Fg}from"node:fs";import{resolve as Ns}from"node:path";async function Yl(i,ve,Ae=!1){let Pe=Fg(i).isFile(),Ne=Pe?Ns(i):null,De=ks(i,ve,Ae),{rootDir:_e,exports:Re,allComponentEntries:Oe,resolveComponentFilePath:Be}=De,Me=Ae&&Pe?await Ar(Ns(i)):[],je=Object.entries(Re),qe=As(Oe,Be),Ge=new Map,He=new Map;await qn();let Xe=new Map,ze={onParseError:(et)=>Xe.set(et.filePath,et)},tt=()=>({exports:Re,entryExports:Me,components:Ge,allComponentsForTypes:He,errors:Array.from(Xe.values()),diagnostics:es(Array.from(He.values()).flatMap((et)=>et.diagnostics??[]))});{let et=Yi([je,Oe],Be),yt=await ws(et);for(let At of je){let Ct=Rn(At,je,yt,Be,ze);if(Ct)Ge.set(Ct.moduleName,Ct)}for(let At of Oe){let Ct=Rn(At,Oe,yt,Be,ze);if(Ct)He.set(Ct.filePath,Ct)}Ps(tt().errors)}let at=vr(He,Be),Ze=(et,yt,At,Ct,Ie)=>{let Le=new Set;for(let $e of At){let Ve=Be($e[1].source);if(!Ct.has(Ve))continue;let We=Rn($e,At,Ie,Be,ze);if(We)et.set(yt(We),We),Le.add(Ve);else for(let[Ue,Ke]of et)if(Be(Ke.filePath)===Ve)et.delete(Ue)}return Le};return{get result(){return tt()},update:async(et)=>{let yt=et.map((Ue)=>Ns(Ue));if(ms(),yt.length===0)return{result:tt(),reparsed:[]};let At=Ne!==null&&yt.includes(Ne),Ct=[];if(At){let Ue=ks(i,ve,Ae),Ke=new Set(Object.keys(Re)),Qe=new Set(Object.keys(Ue.exports));for(let Ye of Ke)if(!Qe.has(Ye))Ge.delete(Ye);for(let Ye of Qe)if(!Ke.has(Ye))Ct.push(Ue.resolveComponentFilePath(Ue.exports[Ye].source));if(Re=Ue.exports,Oe=Ue.allComponentEntries,Be=Ue.resolveComponentFilePath,je=Object.entries(Re),qe=As(Oe,Be),Ae&&Pe)Me=await Ar(Ns(i))}if(ve)Ji(_e,Re,Oe,Be,qe);let Ie=yt.filter((Ue)=>In.test(Ue)||at.has(Ue));if(Ie.length===0&&Ct.length===0)return{result:tt(),reparsed:[]};let Le=fs([...Ie,...Ct],at);for(let[Ue,Ke]of Xe)if(Le.has(Be(Ke.filePath)))Xe.delete(Ue);let $e=await ws(Le),Ve=new Set;for(let Ue of Ze(Ge,(Ke)=>Ke.moduleName,je,Le,$e))Ve.add(Ue);for(let Ue of Ze(He,(Ke)=>Ke.filePath,Oe,Le,$e))Ve.add(Ue);at=vr(He,Be);let We=tt();return Ps(We.errors),{result:We,reparsed:Array.from(Ve)}}}}import ty from"node:path";import{mkdir as jg,readFile as Vg,writeFile as qg}from"node:fs/promises";import{parse as Wg}from"node:path";class Mt{dryRun;ensuredDirs=new Set;constructor(i){this.dryRun=i?.dryRun===!0}async write(i,ve){if(this.dryRun)return console.log(`would write "${e(i)}"`),!0;try{if(await Vg(i,"utf-8")===ve)return!1}catch{}let Ae=Wg(i).dir;if(!this.ensuredDirs.has(Ae))await jg(Ae,{recursive:!0}),this.ensuredDirs.add(Ae);return await qg(i,ve),!0}}var Gg=/^=>\s*/;function Ug(i){let ve=i.trim();if(!ve.startsWith("("))return{parameters:[],returnTypeText:ve||"any"};let Ae=0,Pe=-1;for(let Re=0;Re<ve.length;Re++)if(ve[Re]==="(")Ae++;else if(ve[Re]===")"){if(Ae--,Ae===0){Pe=Re;break}}if(Pe===-1)return{parameters:[],returnTypeText:"any"};let Ne=ve.slice(1,Pe).trim(),De=ve.slice(Pe+1).trim().replace(Gg,"");return{parameters:Ne===""?[]:un(Ne).map((Re)=>{let Oe=Re.trim(),Be=Oe.startsWith("..."),Me=Be?Oe.slice(3):Oe,je=Me.indexOf(":"),qe=(je===-1?Me:Me.slice(0,je)).trim(),Ge=je===-1?void 0:Me.slice(je+1).trim(),He=qe.endsWith("?"),Xe={name:He?qe.slice(0,-1):qe};if(Ge)Xe.type={text:Ge};if(He)Xe.optional=!0;if(Be)Xe.rest=!0;return Xe}),returnTypeText:De||"any"}}function Hg(i){if(i.params!==void 0||i.returnType!==void 0)return{parameters:(i.params??[]).map((Ae)=>{let Pe={name:Ae.name};if(Ae.type)Pe.type={text:Ae.type};if(Ae.optional)Pe.optional=!0;return Pe}),returnTypeText:i.returnType??"any"};return i.type?Ug(i.type):{parameters:[],returnTypeText:"any"}}function Kg(i){return i.map((ve)=>{if(ve.isFunctionDeclaration){let{parameters:Pe,returnTypeText:Ne}=Hg(ve),De={kind:"method",name:ve.name,static:!1};if(Pe.length>0)De.parameters=Pe;if(De.return={type:{text:Ne}},ve.description)De.description=ve.description;if(ve.deprecated!==void 0)De.deprecated=ve.deprecated;return De}let Ae={kind:"field",name:ve.name};if(ve.type)Ae.type={text:ve.type};if(ve.value!==void 0)Ae.default=ve.value;if(ve.description)Ae.description=ve.description;if(ve.deprecated!==void 0)Ae.deprecated=ve.deprecated;if(ve.kind==="const")Ae.readonly=!0;return Ae})}function zg(i){let ve=i.customElement?.props,Ae=new Map,Pe=[];for(let Ne of i.props){if(Ne.isFunctionDeclaration)continue;let De=ve?.[Ne.name];if(De?.attribute===!1)continue;let _e=De?.attribute||Ne.name.toLowerCase(),Re=Ae.get(_e);if(Re!==void 0){console.warn(`sveld: props "${Re}" and "${Ne.name}" of component "${i.moduleName}" both map to the custom-element attribute "${_e}"; only "${Re}" is included.`);continue}Ae.set(_e,Ne.name);let Be=De?.type==="Array"||De?.type==="Object"?[Ne.description,"Serialized to/from JSON for the attribute."].filter(Boolean).join(" "):Ne.description,Me={name:_e,fieldName:Ne.name};if(Ne.type)Me.type={text:Ne.type};if(Ne.value!==void 0)Me.default=Ne.value;if(Be)Me.description=Be;if(De?.reflect)Me.reflects=!0;Pe.push(Me)}return Pe}function Xg(i){if(!i||i.length===0)return;return i.map((ve)=>{let Ae={name:ve.name};if(ve.description)Ae.description=ve.description;return Ae})}function Jg(i){if(!i||i.length===0)return;return i.map((ve)=>{let Ae={name:ve.name};if(ve.type)Ae.type={text:ve.type};if(ve.default!==void 0)Ae.default=ve.default;if(ve.description)Ae.description=ve.description;return Ae})}function Yg(i){return i.filter((ve)=>ve.type==="dispatched").map((ve)=>{let Ae={name:ve.name,type:{text:`CustomEvent<${ve.detail??"unknown"}>`}};if(ve.description)Ae.description=ve.description;if(ve.deprecated!==void 0)Ae.deprecated=ve.deprecated;return Ae})}function Qg(i){return i.map((ve)=>{let Ae={name:ve.default?"":ve.name??""};if(ve.description)Ae.description=ve.description;if(ve.deprecated!==void 0)Ae.deprecated=ve.deprecated;return Ae})}function Zg(i){let ve=Xg(i.cssParts),Ae=Jg(i.cssProperties),Pe=Kg(i.props),Ne=zg(i),De=Yg(i.events),_e=Qg(i.slots),Re=i.moduleName,Oe=i.componentComment?{kind:"class",name:Re,description:i.componentComment,members:Pe,attributes:Ne,events:De,slots:_e}:{kind:"class",name:Re,members:Pe,attributes:Ne,events:De,slots:_e};if(ve)Oe.cssParts=ve;if(Ae)Oe.cssProperties=Ae;if(i.customElementTag)Oe.tagName=i.customElementTag,Oe.customElement=!0;return Oe}function ey(i,ve){let Ae=[{kind:"js",name:i.moduleName,declaration:{name:i.moduleName,module:ve}}];if(i.customElementTag)Ae.push({kind:"custom-element-definition",name:i.customElementTag,declaration:{name:i.moduleName,module:ve}});return Ae}function Ql(i,ve={}){let Ae=s(i),Pe=ve.resolveModulePath??((De)=>De.filePath);return{schemaVersion:"1.0.0",modules:Ae.components.map((De)=>{let _e=Pe(De);return{kind:"javascript-module",path:_e,declarations:[Zg(De)],exports:ey(De,_e)}})}}function Qi(i,ve){let Ae=Ql(i,{resolveModulePath:(Pe)=>is(Pe.filePath,ve.inputDir)});return Vn(Ae)}async function Zi(i,ve){let Ae=Qi(i,ve),Pe=ty.join(process.cwd(),ve.outFile),De=await new Mt({dryRun:ve.dryRun}).write(Pe,Ae);if(!ve.dryRun)zt(`${De?"created":"unchanged"} "${ve.outFile}".`)}import ea from"node:path";function Zl(i){let ve=new Map;for(let[Pe,Ne]of Object.entries(i)){let De=ve.get(Ne.source)||[];De.push({id:Pe,exportee:Ne}),ve.set(Ne.source,De)}let Ae=[];for(let[Pe,Ne]of ve){let De=In.test(Pe),_e=Ne.some(({id:qe,exportee:Ge})=>qe!=="default"&&Ge.default),Re=Ne.some(({exportee:qe})=>!qe.default),Oe=De&&_e&&Re,Be=[],Me=[],je=[];for(let{id:qe,exportee:Ge}of Ne){if(qe==="default"){Me.push(`export { default } from "${Pe}";`);continue}if(Ge.default)if(Ge.mixed)Me.push(`export { default as ${qe} } from "${Pe}";`),Me.push(`export { default } from "${Pe}";`);else je.push(`default as ${qe}`);else if(De&&!Oe)je.push(`default as ${qe}`);else Be.push(qe)}if(je.length>0&&Be.length>0)Ae.push(`export { ${[...je,...Be].join(", ")} } from "${Pe}";`);else{if(Be.length>0)Ae.push(`export { ${Be.join(", ")} } from "${Pe}";`);if(je.length>0)Ae.push(`export { ${je.join(", ")} } from "${Pe}";`)}Ae.push(...Me)}return Ae.join(`
|
|
43
|
+
`)}function ep(i){return i.replace(In,"")}function tp(i){return i.replace(In,".svelte.d.ts")}function ny(i){return typeof i==="object"&&i!==null&&!Array.isArray(i)&&"start"in i&&"end"in i}function kr(i){if(Array.isArray(i))return i.map((ve)=>kr(ve));if(i!==null&&typeof i==="object"){let ve={};for(let[Ae,Pe]of Object.entries(i)){if((Ae==="source"||Ae==="componentCommentSource")&&ny(Pe))continue;ve[Ae]=kr(Pe)}return ve}return i}function ta(i,ve){return i.map((Ae)=>({...Ae,filePath:is(Ae.filePath,ve)}))}function ry(i,ve,Ae){if(!ve)return`${i.moduleName}.api.json`;if(!Ae.has(i.moduleName))Ae.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`${ep(i.filePath)}.api.json`}async function sy(i,ve){let Ae=s(i),Pe=ta(Ae.components,ve.inputDir);if(ve.source===!1)Pe=kr(Pe);let Ne=new Map;for(let _e of Pe)Ne.set(_e.moduleName,(Ne.get(_e.moduleName)??0)+1);let De=new Set;await Promise.all(Pe.map(async(_e)=>{let Re=(Ne.get(_e.moduleName)??0)>1,Oe=ry(_e,Re,De),Be=ea.resolve(ea.join(ve.outDir||"",Oe)),je=await new Mt({dryRun:ve.dryRun}).write(Be,Vn(_e));if(!ve.dryRun)zt(`${je?"created":"unchanged"} "${Be}".`)}))}function na(i,ve){let Ae=s(i,{entryExports:ve.entryExports}),Pe={...Ae,components:ta(Ae.components,ve.inputDir)};if(ve.source===!1)Pe=kr(Pe);return Vn(Pe)}function np(i,ve){let Ae=s(i,{entryExports:ve.entryExports}),Pe=ta(Ae.components,ve.inputDir);if(ve.source===!1)Pe=kr(Pe);return`${Pe.map((Ne)=>JSON.stringify(Ne)).join(`
|
|
44
|
+
`)}
|
|
45
|
+
`}async function iy(i,ve){let Ae=na(i,ve),Pe=ea.join(process.cwd(),ve.outFile),De=await new Mt({dryRun:ve.dryRun}).write(Pe,Ae);if(!ve.dryRun)zt(`${De?"created":"unchanged"} "${ve.outFile}".`)}async function ra(i,ve){if(ve.outDir)await sy(i,ve);else await iy(i,ve)}import Fs from"node:path";import{readFileSync as ay}from"node:fs";import{join as oy}from"node:path";function rp(){try{let{name:i,description:ve}=xs(JSON.parse(ay(oy(process.cwd(),"package.json"),"utf-8")));return{name:i,description:ve}}catch{return{}}}var cy=/\binterface\s+[A-Za-z_$][\w$]*(\s*<[^{};]*>)?\s*$/;var ap=/\s/,ly=/\s{2}|[^\S ]/,py=/["'`{}/]/g,uy=/["'`{};/]/g;function dy(i){return cy.test(i.slice(-200))}var sp=[""];function fy(i){let ve=sp[i];if(ve===void 0)ve=" ".repeat(i),sp[i]=ve;return ve}function hy(i,ve){let Ae="";for(let Pe=i.length-1;Pe>=0&&Ae.length<ve;Pe--)Ae=i[Pe]+Ae;return Ae.length>ve?Ae.slice(-ve):Ae}function my(i){if(i.length===0)return!1;let ve=i[i.length-1];return ve.charCodeAt(ve.length-1)===10}function gy(i){while(i.length>0){let ve=i[i.length-1],Ae=ve.length;while(Ae>0){let Pe=ve.charCodeAt(Ae-1);if(Pe!==32&&Pe!==9)break;Ae--}if(Ae===ve.length)return;if(Ae===0){i.pop();continue}i[i.length-1]=ve.slice(0,Ae);return}}function yy(i){while(i.length>0){let ve=i[i.length-1];if(!ap.test(ve[ve.length-1]))return;let Ae=ve.trimEnd();if(Ae.length===ve.length)return;if(Ae.length===0){i.pop();continue}i[i.length-1]=Ae;return}}function xy(i){if(i.includes("{"))return!1;let ve=0,Ae=0;for(let Pe=0;Pe<i.length;Pe++){let Ne=i.charCodeAt(Pe);if(ve!==0){if(Ne===ve&&i.charCodeAt(Pe-1)!==92)ve=0;continue}if(Ne===34||Ne===39||Ne===96){ve=Ne;continue}if(Ne===59&&++Ae>=2)return!0}return!1}function by(i){if(!ly.test(i))return i.trimEnd();let ve="",Ae=null,Pe=!1;for(let Ne=0;Ne<i.length;Ne++){let De=i[Ne],_e=i[Ne-1];if(Ae){if(ve+=De,Ae==="double"&&De==='"'&&_e!=="\\"||Ae==="single"&&De==="'"&&_e!=="\\"||Ae==="template"&&De==="`"&&_e!=="\\")Ae=null;Pe=!1;continue}if(De==='"'||De==="'"||De==="`"){Ae=De==='"'?"double":De==="'"?"single":"template",ve+=De,Pe=!1;continue}if(ap.test(De)){if(!Pe&&ve.length>0)ve+=" ",Pe=!0;continue}ve+=De,Pe=!1}return ve.trimEnd()}function op(i,ve){let Ae=i[ve],Pe=i.indexOf(Ae,ve+1);while(Pe!==-1&&i.charCodeAt(Pe-1)===92)Pe=i.indexOf(Ae,Pe+1);return Pe}function cp(i,ve){let Ae=i.indexOf("*/",ve+1);return Ae===-1?-1:Ae+1}function Ey(i){let ve=new Map,Ae=[],Pe=py,Ne=0;while(Ne<i.length){if(Pe.lastIndex=Ne,!Pe.test(i))break;Ne=Pe.lastIndex-1;let De=i.charCodeAt(Ne);if(De===47){if(i.charCodeAt(Ne+1)===42){let _e=cp(i,Ne);if(_e===-1)break;Ne=_e}}else if(De===34||De===39||De===96){let _e=op(i,Ne);if(_e===-1)break;Ne=_e}else if(De===123)Ae.push(Ne);else if(De===125&&Ae.length>0)ve.set(Ae.pop(),Ne);Ne++}return ve}function Cy(i,ve,Ae){for(let Pe=ve;Pe<Ae;Pe++)if(!sa(i.charCodeAt(Pe)))return!1;return!0}function sa(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 lp(i,ve,Ae,Pe){let Ne=[],De=uy,_e=ve,Re=ve;while(Re<Ae){if(De.lastIndex=Re,!De.test(i))break;if(Re=De.lastIndex-1,Re>=Ae)break;let Oe=i.charCodeAt(Re);if(Oe===47){if(i.charCodeAt(Re+1)===42){let Be=cp(i,Re);if(Be===-1)break;Re=Be}Re++;continue}if(Oe===34||Oe===39||Oe===96){let Be=op(i,Re);if(Be===-1)break;Re=Be+1;continue}if(Oe===123){let Be=Pe.get(Re);if(Be===void 0||Be>=Ae){Re++;continue}if(_e<Re)Ne.push(i.slice(_e,Re));let Me=Re+1;if(Cy(i,Me,Be)){Ne.push("{}"),Re=Be+1,_e=Re;continue}let je=i.slice(Me,Be),qe=i.charCodeAt(Me)===10;if(!qe&&!je.includes("/*")&&!xy(je)&&!dy(hy(Ne,200))){let Ge=lp(i,Me,Be,Pe),He=Ge.trim();if(!He.includes(`
|
|
46
|
+
`)){let Xe=He.endsWith(";")?He.slice(0,-1):He,ze=`{ ${by(Xe)} }`;if(ze.length<=120){Ne.push(ze),Re=Be+1,_e=Re;continue}}if(Ne.push("{"),Ge.charCodeAt(0)!==59)Ne.push(`
|
|
47
|
+
`);if(Ge.length>0)Ne.push(Ge);Re=Be,_e=Be;continue}if(Ne.push("{"),!qe)Ne.push(`
|
|
48
|
+
`);Re=Me,_e=Me;continue}if(Oe===125){if(_e<Re)Ne.push(i.slice(_e,Re));if(gy(Ne),!my(Ne))Ne.push(`
|
|
49
|
+
`);Ne.push("}"),Re++,_e=Re;continue}if(_e<Re)Ne.push(i.slice(_e,Re));if(yy(Ne),Ne.push(";"),i.charCodeAt(Re+1)!==10)Ne.push(`
|
|
50
|
+
`);Re++,_e=Re}if(_e<Ae)Ne.push(i.slice(_e,Ae));return Ne.join("")}function vy(i){return lp(i,0,i.length,Ey(i))}function Sy(i){if(!i.includes(" "))return i;let ve="",Ae=0;for(let Pe=0;Pe<i.length;Pe++){let Ne=i.charCodeAt(Pe);if(Ae!==0){if(ve+=i[Pe],Ne===Ae&&i.charCodeAt(Pe-1)!==92)Ae=0;continue}if(Ne===34||Ne===39||Ne===96){Ae=Ne,ve+=i[Pe];continue}if(Ne===32&&ve.charCodeAt(ve.length-1)===32)continue;ve+=i[Pe]}return ve}function Ty(i){return i===125||i===93||i===41||i===62}function Ay(i,ve,Ae){return Ae-ve>=3&&i.charCodeAt(ve)===47&&i.charCodeAt(ve+1)===42&&i.charCodeAt(ve+2)===42}function ip(i,ve,Ae){let Pe=i.indexOf("*/",ve);return Pe!==-1&&Pe+2<=Ae}function ky(i){let ve=[],Ae=[],Pe=i.length,Ne=0,De=!1,_e=0,Re=0;while(Re<=Pe){let Me=i.indexOf(`
|
|
51
|
+
`,Re);if(Me===-1)Me=Pe;let je=Me+1,qe=Re,Ge=Me;while(qe<Ge&&sa(i.charCodeAt(qe)))qe++;while(Ge>qe&&sa(i.charCodeAt(Ge-1)))Ge--;if(qe===Ge){let Ze=Ae.length>0?Ae[Ae.length-1]:void 0;if(Ze!==void 0&&Ze!==""){let nt=Ze.charCodeAt(Ze.length-1);if(nt!==123&&nt!==40&&nt!==91)ve.push(0),Ae.push("")}Re=je;continue}if(De){if(ve.push(_e),Ae.push(` ${i.slice(qe,Ge)}`),ip(i,qe,Ge))De=!1;Re=je;continue}let He=Ay(i,qe,Ge),Xe=He&&ip(i,qe,Ge);if(He&&!Xe){ve.push(Ne),Ae.push(i.slice(qe,Ge)),De=!0,_e=Ne,Re=je;continue}let ze=Ty(i.charCodeAt(qe)),tt=Math.max(0,Ne-(ze?1:0));if(ze&&tt===0&&Ae.length>0&&Ae[Ae.length-1]==="")ve.pop(),Ae.pop();if(ve.push(tt),Ae.push(Sy(i.slice(qe,Ge))),Re=je,Xe)continue;let at=0;for(let Ze=qe;Ze<Ge;Ze++){let nt=i.charCodeAt(Ze);if(at!==0){if(nt===at&&i.charCodeAt(Ze-1)!==92)at=0;continue}if(nt===34||nt===39||nt===96)at=nt;else if(nt===123||nt===40||nt===91||nt===60)Ne++;else if(nt===125||nt===41||nt===93)Ne=Math.max(0,Ne-1);else if(nt===62&&i.charCodeAt(Ze-1)!==61)Ne=Math.max(0,Ne-1)}}let Oe=Ae.length;while(Oe>0&&Ae[Oe-1]==="")Oe--;let Be=[];for(let Me=0;Me<Oe;Me++){if(Me>0)Be.push(`
|
|
52
|
+
`);let je=ve[Me];if(je>0)Be.push(fy(je));Be.push(Ae[Me])}return Be.join("")}function pp(i){return`${ky(vy(i))}
|
|
53
|
+
`}var Sn="any",on="",wy="Record<string, any>",aa="Record<string, never>",Py=/^[A-Za-z_$][A-Za-z0-9_$]*$/,Ny=/CustomEvent/,_y=/^[A-Z]/,Iy=/\n/,hp=/=>/,Dy=/(?:^|\n)@default\b/,oa=/\n/g,Ry=/\s+/g,tr=/(^|[^.\w])Snippet(?:\s*<|\b)/,Ly=/import\s+type\s+[^;]*\bSnippet\b[^;]*from\s+"svelte";/,Oy=/[.*+?^${}()|[\]\\]/g,My=/^const\s+/;function ca(i){return i.replace(My,"")}function By(i){if(!i)return;return i.replace(oa,`
|
|
54
|
+
* `)}function _s(i){if(!i)return"";return`/** ${i} */`}function Is(i){if(!i)return"";return`/**
|
|
55
|
+
* ${i.replace(oa,`
|
|
56
|
+
* `)}
|
|
57
|
+
*/`}function mp(i){if(i===void 0)return;return i===!0?"@deprecated":`@deprecated ${i}`}function $y(i){let ve=mp(i);if(ve===void 0)return;return`* ${ve.replace(oa,`
|
|
58
|
+
* `)}
|
|
59
|
+
`}function Fy(i,ve){if(!ve)return[`@${i}`];if(!ve.includes(`
|
|
60
|
+
`))return[`@${i} ${ve}`];return[`@${i}`,...ve.split(`
|
|
61
|
+
`)]}function la(i){let ve=[];for(let{name:Ae,body:Pe}of i??[])ve.push(...Fy(Ae,Pe));return ve}function wr(i,ve,Ae){let Pe=mp(Ae),Ne=la(ve),De=Ne.length>0;if(!i&&!De&&!Pe)return"";if(!De&&!Pe)return i?.includes(`
|
|
62
|
+
`)?Is(i):_s(i);let _e=[];if(i)_e.push(...i.split(`
|
|
63
|
+
`));if(_e.push(...Ne),Pe)_e.push(...Pe.split(`
|
|
64
|
+
`));return`/**
|
|
65
|
+
* ${_e.join(`
|
|
66
|
+
* `)}
|
|
67
|
+
*/`}function jy(i){let ve=la(i);if(ve.length===0)return"";return ve.map((Ae)=>`* ${Ae}
|
|
68
|
+
`).join("")}function Ds(i){if(i===void 0)return Sn;return`${i}
|
|
69
|
+
`}function rr(i){if(i.typedefs.length===0)return on;return i.typedefs.map((ve)=>{let Ae=la(ve.tags),Pe;if(Ae.length===0)Pe=ve.description?`${Is(ve.description)}
|
|
70
|
+
`:"";else Pe=`/**
|
|
71
|
+
* ${(ve.description?[...ve.description.split(`
|
|
72
|
+
`),...Ae]:Ae).join(`
|
|
73
|
+
* `)}
|
|
74
|
+
*/
|
|
75
|
+
`;return`${Pe}export ${ve.ts}`}).join(`
|
|
76
|
+
|
|
77
|
+
`)}var up=new Map;function gp(i,ve){let Ae=up.get(ve);if(Ae===void 0){let Pe=ve.replace(Oy,"\\$&");Ae=new RegExp(`\\b${Pe}\\b`),up.set(ve,Ae)}return Ae.test(i)}var dp,fp=[];function pa(i){if(i!==dp)dp=i,fp=un(i);return fp}function Vy(i){if(i===null)return[];return i[0].split(",").map((ve,Ae)=>({name:ve.trim(),constraint:(pa(i[1]??"")[Ae]??ve).trim()}))}function qy(i,ve){let Ae=Vy(i).filter(({name:Pe})=>gp(ve,Pe));if(Ae.length===0)return{declSuffix:on,refSuffix:on};return{declSuffix:`<${Ae.map(({constraint:Pe})=>ca(Pe)).join(", ")}>`,refSuffix:`<${Ae.map(({name:Pe})=>Pe).join(", ")}>`}}function yp(i){if(!i.contexts||i.contexts.length===0)return on;let ve=i.generics===null?[]:i.generics[0].split(",").map((Ae,Pe)=>({name:Ae.trim(),constraint:(pa(i.generics?.[1]??"")[Pe]??Ae).trim()}));return i.contexts.map((Ae)=>{let Pe=Ae.properties.map((Oe)=>{let Be=Oe.description?`${_s(Oe.description)}
|
|
78
|
+
`:"",Me=Oe.optional?"?":"";return`${Be}${Oe.name}${Me}: ${Oe.type};`}).join(`
|
|
79
|
+
`),Ne=Ae.description?`${Is(Ae.description)}
|
|
80
|
+
`:"",De=ve.filter(({name:Oe})=>Ae.properties.some((Be)=>gp(Be.type,Oe))).map(({constraint:Oe})=>Oe),_e=De.length>0?`<${De.map(ca).join(", ")}>`:"";if(Ae.properties.length===0)return Ae.hasUnresolvedSpread?`${Ne}export type ${Ae.typeName} = Record<string, any>;`:`${Ne}export type ${Ae.typeName} = Record<string, never>;`;let Re=Ae.hasUnresolvedSpread?" & Record<string, any>":"";return`${Ne}export type ${Ae.typeName}${_e} = {
|
|
81
|
+
${Pe}
|
|
82
|
+
}${Re};`}).join(`
|
|
83
|
+
|
|
84
|
+
`)}function nr(i){return Py.test(i)?i:JSON.stringify(i)}function xp(i,ve){if(!i)return;return`* ${ve||i}
|
|
85
|
+
`}function ua(i,ve,Ae){return[xp(By(i)),$y(ve),jy(Ae)].filter(Boolean).join("")}function da(i){return i.length>0?`/**
|
|
86
|
+
${i}*/`:on}function Wy(i){let ve=i.props.filter((ze)=>!ze.isFunctionDeclaration&&ze.kind!=="const"),Ae=new Set([...ve.map((ze)=>ze.name),...Array.from(i.canonicalPropNames??[])]),Pe=ve.map((ze)=>{let tt=typeof ze.value==="string"?ze.value.replace(Ry," "):ze.value,Ze=Dy.test(ze.description??"")||ze.value===void 0,nt=[ua(ze.description,ze.deprecated,ze.tags),xp(ze.constant,"@constant"),Ze?null:`* @default ${tt}
|
|
87
|
+
`].filter(Boolean).join(""),et=ze.constant&&!ze.isFunction?ze.value:ze.type||Sn;return`
|
|
88
|
+
${da(nt)}
|
|
89
|
+
${nr(ze.name)}${ze.isRequired?"":"?"}: ${et};`}),Ne=i.canonicalPropsType?Pe.filter((ze,tt)=>{let at=ve[tt];return at?!(i.canonicalPropNames?.has(at.name)??!1):!0}):Pe,De=(i.slots||[]).filter((ze)=>!ze.default&&ze.name!=null&&!Ae.has(ze.name)).map((ze)=>{let tt=ze.name,at=nr(tt),Ze=wr(ze.description,ze.tags,ze.deprecated),nt=Ze?`${Ze}
|
|
90
|
+
`:"",yt=ze.slot_props&&ze.slot_props!=="Record<string, never>"?`(this: void, ...args: [${ze.slot_props}]) => void`:"(this: void) => void";return`
|
|
91
|
+
${nt}${at}?: ${yt};`}),_e=(i.slots||[]).find((ze)=>ze.default||ze.name===null),Re=_e&&!Ae.has("children")?(()=>{let ze=wr(_e.description,_e.tags,_e.deprecated),tt=ze?`${ze}
|
|
92
|
+
`:"",Ze=_e.slot_props&&_e.slot_props!=="Record<string, never>"?`(this: void, ...args: [${_e.slot_props}]) => void`:"(this: void) => void";return`
|
|
93
|
+
${tt}children?: ${Ze};`})():"",Oe=i.events?Xy({events:i.events},Ae):[],Be=[...De,Re,...Oe].filter(Boolean),Me=[...Ne,...Be].join(`
|
|
94
|
+
`),je=`${i.moduleName}Props`,qe=on,Ge=i.generics?`<${pa(i.generics[1]).map((ze)=>ca(ze.trim())).join(", ")}>`:"",He=i.generics?`<${i.generics[0]}>`:"",Xe=i.canonicalPropsType?`
|
|
95
|
+
type $Props${Ge} = ${i.canonicalPropsType}${Me.trim()===""?"":` & {${Me}
|
|
96
|
+
}`};
|
|
97
|
+
`:`
|
|
98
|
+
type $Props${Ge} = {
|
|
99
|
+
${Me}
|
|
100
|
+
};
|
|
101
|
+
`;if(i.rest_props?.type==="Element"){let ze;if(i.rest_props.name==="svelte:element")if(i.rest_props.thisValue)ze=`SvelteHTMLElements["${i.rest_props.thisValue}"]`;else ze="HTMLAttributes<HTMLElement>";else ze=i.rest_props.name.split("|").map((Ze)=>`SvelteHTMLElements["${Ze.trim()}"]`).join(" & ");let tt="[key: `data-${string}`]: unknown;",at=i.rest_props.description?i.rest_props.description.includes(`
|
|
102
|
+
`)?`${Is(i.rest_props.description)}
|
|
103
|
+
`:`${_s(i.rest_props.description)}
|
|
104
|
+
`:"";if(i.extends===void 0)qe=`
|
|
105
|
+
${at}${ze?`type $RestProps = ${ze};
|
|
106
|
+
`:""}
|
|
107
|
+
${i.canonicalPropsType?`type $Props${Ge} = (${i.canonicalPropsType}) & {${Me}
|
|
108
|
+
|
|
109
|
+
${tt}
|
|
110
|
+
};`:`type $Props${Ge} = {
|
|
111
|
+
${Me}
|
|
112
|
+
|
|
113
|
+
${tt}
|
|
114
|
+
};`}
|
|
115
|
+
|
|
116
|
+
export type ${je}${Ge} = Omit<$RestProps, keyof $Props${He}> & $Props${He};
|
|
117
|
+
`;else qe=`
|
|
118
|
+
${at}${ze?`type $RestProps = ${ze};
|
|
119
|
+
`:""}
|
|
120
|
+
${i.canonicalPropsType?`type $Props${Ge} = (${i.canonicalPropsType}) & {${Me}
|
|
121
|
+
|
|
122
|
+
${tt}
|
|
123
|
+
};`:`type $Props${Ge} = {
|
|
124
|
+
${Me}
|
|
125
|
+
|
|
126
|
+
${tt}
|
|
127
|
+
};`}
|
|
128
|
+
|
|
129
|
+
export type ${je}${Ge} = Omit<$RestProps, keyof ($Props${He} & ${i.extends.interface})> & Omit<${i.extends.interface}, keyof $Props${He}> & $Props${He};
|
|
130
|
+
`}else if(Me.trim()===""&&i.extends===void 0&&!i.canonicalPropsType)qe=`
|
|
131
|
+
export type ${je}${Ge} = ${aa};
|
|
132
|
+
`;else if(i.canonicalPropsType)qe=`
|
|
133
|
+
${Xe}
|
|
134
|
+
export type ${je}${Ge} = ${i.extends===void 0?"":`Omit<${i.extends.interface}, keyof $Props${He}> & `}$Props${He};
|
|
135
|
+
`;else if(i.extends===void 0)qe=`
|
|
136
|
+
export type ${je}${Ge} = {
|
|
137
|
+
${Me}
|
|
138
|
+
};
|
|
139
|
+
`;else qe=`
|
|
140
|
+
type $Props${Ge} = {
|
|
141
|
+
${Me}
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
export type ${je}${Ge} = Omit<${i.extends.interface}, keyof $Props${He}> & $Props${He};
|
|
145
|
+
`;return{props_name:je,prop_def:qe}}function Gy(i){if(i.slots.length===0)return aa;let ve=i.slots.map(({name:Ae,slot_props:Pe,...Ne})=>{let De=Ne.default||Ae===null?"default":nr(Ae??""),_e=wr(Ne.description,Ne.tags,Ne.deprecated);return`${_e?`${_e}
|
|
146
|
+
`:""}${De}: ${Ds(Pe)};`}).join(`
|
|
147
|
+
`);return i.slots.length===1?`{${ve}}`:`{
|
|
148
|
+
${ve}
|
|
149
|
+
}`}var Uy=()=>"WindowEventMap",Hy=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 ia(i=Sn){if(Ny.test(i))return i;return`CustomEvent<${i}>`}function Ky(i){return Hy.has(i)}function bp(i){switch(i.type){case"dispatched":return ia(i.detail);case"forwarded":{let ve=i.element,Pe=!(ve&&_y.test(ve))||Ky(i.name),Ne=i.detail!==void 0&&i.detail!=="undefined"&&!(i.detail==="null"&&Pe),De=i.detail==="null"&&!Pe;if(Ne||De)return ia(i.detail);else if(Pe)return`${Uy()}["${i.name}"]`;else return ia()}default:return i}}function zy(i){if(i.events.length===0)return wy;let ve=i.events.map((Ae)=>{let Pe="",Ne=wr(Ae.description,Ae.tags,Ae.deprecated);if(Ne)Pe=`${Ne}
|
|
150
|
+
`;return`${Pe}${nr(Ae.name)}: ${bp(Ae)};
|
|
151
|
+
`}).join("");return i.events.length===1?`{${ve}}`:`{
|
|
152
|
+
${ve}}`}function Xy(i,ve){return i.events.map((Ae)=>{let Pe=`on${Ae.name}`;if(ve.has(Pe))return;let Ne="",De=wr(Ae.description,Ae.tags,Ae.deprecated);if(De)Ne=`${De}
|
|
153
|
+
`;return`
|
|
154
|
+
${Ne}${nr(Pe)}?: (event: ${bp(Ae)}) => void;`}).filter((Ae)=>Ae!==void 0)}function Jy(i){let ve=i.type==="() => any";if(i.type&&hp.test(i.type)&&!ve)return i.type;else if(i.params&&i.params.length>0){let Pe=i.params.map((De)=>{let _e=De.optional?"?":"";return`${De.name}${_e}: ${De.type}`}).join(", "),Ne=i.returnType||Sn;return`(${Pe}) => ${Ne}`}else if(i.returnType)return`() => ${i.returnType}`;else return i.type||Sn}function Ep(i){return i.props.filter((ve)=>ve.isFunctionDeclaration||ve.kind==="const").map((ve)=>{let Ae=ua(ve.description,ve.deprecated,ve.tags),Pe=Jy(ve);return`
|
|
155
|
+
${da(Ae)}
|
|
156
|
+
${nr(ve.name)}: ${Pe};`}).join(`
|
|
157
|
+
`)}function Yy(i){let ve=`${i.moduleName}Exports`,Ae=Ep({props:i.props});if(Ae.trim()==="")return{exports_name:ve,exports_ref:ve,exports_def:`export type ${ve} = ${aa};`};let{declSuffix:Pe,refSuffix:Ne}=qy(i.generics,Ae);return{exports_name:ve,exports_ref:`${ve}${Ne}`,exports_def:`export type ${ve}${Pe} = {${Ae}
|
|
158
|
+
};`}}function Qy(i){let ve=i.props.filter((Ae)=>Ae.bindable===!0||Ae.binding==="writable").map((Ae)=>JSON.stringify(Ae.name));return ve.length===0?on:ve.join(" | ")}function Zy(i){let ve=i.moduleName==="default"?"$$Component":i.moduleName,Ae=i.bindings===on?'""':i.bindings;return`declare const ${ve}: Component<
|
|
159
|
+
${i.propsRef},
|
|
160
|
+
${i.exportsRef},
|
|
161
|
+
${Ae}
|
|
162
|
+
>;
|
|
163
|
+
export default ${ve};`}function ex(i){let ve=i.moduleName==="default"?"$$Component":i.moduleName,Ae=`${ve}Component`,Pe=i.bindings===on?'""':i.bindings;return`interface ${Ae} {
|
|
164
|
+
new ${i.generic}(
|
|
165
|
+
options: ComponentConstructorOptions<${i.propsRef}>
|
|
166
|
+
): SvelteComponent<${i.propsRef}> & ${i.exportsRef};
|
|
167
|
+
${i.generic}(
|
|
168
|
+
this: void,
|
|
169
|
+
internals: ComponentInternals,
|
|
170
|
+
props: ${i.propsRef}
|
|
171
|
+
): {
|
|
172
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
173
|
+
$set?(props: Partial<${i.propsRef}>): void;
|
|
174
|
+
} & ${i.exportsRef};
|
|
175
|
+
element?: typeof HTMLElement;
|
|
176
|
+
z_$$bindings?: ${Pe};
|
|
177
|
+
}
|
|
178
|
+
declare const ${ve}: ${Ae};
|
|
179
|
+
export default ${ve};`}function tx(i){if(i.extends===void 0)return"";return`import type { ${i.extends.interface} } from ${i.extends.import};`}function nx(i){if(!i.componentComment)return"";if(!Iy.test(i.componentComment))return _s(i.componentComment.trim());return`/*${i.componentComment.split(`
|
|
180
|
+
`).map((ve)=>`* ${ve}`).join(`
|
|
181
|
+
`)}
|
|
182
|
+
*/`}function rx(i){return i.moduleExports.map((ve)=>{let Ae=ua(ve.description,ve.deprecated,ve.tags),Pe,Ne=ve.type&&hp.test(ve.type),De=ve.type==="() => any";if(ve.kind==="const"&&!Ne)Pe=`export declare const ${ve.name}: ${ve.type||Sn};
|
|
183
|
+
`;else if(ve.params&&ve.params.length>0){let Re=ve.params.map((Be)=>{let Me=Be.optional?"?":"";return`${Be.name}${Me}: ${Be.type}`}).join(", "),Oe=ve.returnType||Sn;Pe=`export declare function ${ve.name}(${Re}): ${Oe};`}else if(ve.returnType)Pe=`export declare function ${ve.name}(): ${ve.returnType};`;else if(Ne&&ve.type&&!De){let[_e,Re,...Oe]=ve.type.split("=>"),Be=Oe.map((Me)=>` => ${Me.trim()}`).join("");Pe=`export declare function ${ve.name}${_e.trimEnd()}: ${Re.trim()}${Be};`}else if(Ne&&ve.type){let[_e,Re,...Oe]=ve.type.split("=>"),Be=Oe.map((Me)=>` => ${Me.trim()}`).join("");Pe=`export declare function ${ve.name}${_e.trimEnd()}: ${Re.trim()}${Be};`}else if(ve.kind==="const")Pe=`export declare const ${ve.name}: ${ve.type||Sn};
|
|
184
|
+
`;else Pe=`export type ${ve.name} = ${ve.type||Sn};`;return`
|
|
185
|
+
${da(Ae)}
|
|
186
|
+
${Pe}`}).join(`
|
|
187
|
+
`)}var sx=120;function ix(i){let Ae=`export default class ${i.moduleName==="default"?"":i.moduleName}${i.generic} extends SvelteComponentTyped<`,Pe=[i.genericProps,i.events,i.slots];if(i.accessors.trim()===""&&Pe.every((Ne)=>!Ne.includes(`
|
|
188
|
+
`))){let Ne=`${Ae}${Pe.join(", ")}> {}`;if(Ne.length<=sx)return Ne}return`${Ae}
|
|
189
|
+
${i.genericProps},
|
|
190
|
+
${i.events},
|
|
191
|
+
${i.slots}
|
|
192
|
+
> {
|
|
193
|
+
${i.accessors}
|
|
194
|
+
}`}function fa(i,ve){let Ae=Jn(i),{moduleName:Pe,typedefs:Ne,generics:De,props:_e,moduleExports:Re,slots:Oe,events:Be,rest_props:Me,extends:je,componentComment:qe,contexts:Ge,syntaxMode:He}=i,Xe=ve?.format==="component",ze=De!==null,{props_name:tt,prop_def:at}=Wy({moduleName:Pe,props:_e,rest_props:Me,extends:je,generics:De,slots:Oe,canonicalPropNames:new Set(Ae?.canonicalPropNames??[]),canonicalPropsType:Ae?.canonicalPropsType,events:Xe&&He==="legacy"?Be:void 0}),Ze=De?`<${De[1]}>`:"",nt=De?`${tt}<${De[0]}>`:tt,et=rx({moduleExports:Re}),yt=rr({typedefs:Ne}),At=yp({contexts:Ge,generics:De}),Ct=(Ae?.typeImportStatements??[]).join(`
|
|
195
|
+
`),Ie=(Ae?.localTypeDeclarations??[]).join(`
|
|
196
|
+
|
|
197
|
+
`),{exports_ref:Le,exports_def:$e}=Xe?Yy({props:_e,moduleName:Pe,generics:De}):{exports_ref:on,exports_def:on},Ve=Xe?Qy({props:_e}):on,We=!Ly.test(Ct)&&(tr.test(at)||tr.test(et)||tr.test(yt)||tr.test(At)||tr.test(Ie)||tr.test($e)),Ue=Me?.type==="Element"&&(Me.name!=="svelte:element"||Me.name==="svelte:element"&&Me.thisValue),Ke=Me?.type==="Element"&&Me.name==="svelte:element"&&!Me.thisValue,Ye=[Xe?ze?`import type { SvelteComponent, ComponentConstructorOptions, ComponentInternals${We?", Snippet":""} } from "svelte";`:`import type { Component${We?", Snippet":""} } from "svelte";`:`import { SvelteComponentTyped${We?", type Snippet":""} } from "svelte";`,Ue?'import type { SvelteHTMLElements } from "svelte/elements";':"",Ke?'import type { HTMLAttributes } from "svelte/elements";':"",Ct,tx({extends:je})].filter(Boolean).join(`
|
|
198
|
+
`),Je=Xe?ze?ex({moduleName:Pe,generic:Ze,propsRef:nt,exportsRef:Le,bindings:Ve}):Zy({moduleName:Pe,propsRef:nt,exportsRef:Le,bindings:Ve}):ix({moduleName:Pe,generic:Ze,genericProps:nt,events:zy({events:Be}),slots:Gy({slots:Oe}),accessors:Ep({props:_e})}),ct=[et,yt,Ie,At,at,$e,[nx({componentComment:qe}),Je].filter(Boolean).join(`
|
|
199
|
+
`)].map((ut)=>ut.trim()).filter(Boolean).join(`
|
|
200
|
+
|
|
201
|
+
`);return pp([Ye,ct].filter(Boolean).join(`
|
|
202
|
+
|
|
203
|
+
`))}var ma=/`/g,Cp=/\s+/g,qt="--",vp=`| Prop name | Required | Kind | Reactive | Binding | Type | Default value | Description |
|
|
204
|
+
| :- | :- | :- | :- | :- | :- | :- | :- |
|
|
205
|
+
`,Rs=`| Slot name | Default | Props | Fallback | Description |
|
|
206
|
+
| :- | :- | :- | :- | :- |
|
|
207
|
+
`,Ls=`| Event name | Type | Detail | Description |
|
|
208
|
+
| :- | :- | :- | :- |
|
|
209
|
+
`,ga=`| Name | Kind | Type | Description |
|
|
210
|
+
| :- | :- | :- | :- |
|
|
211
|
+
`,Sp=`| Part name | Description |
|
|
212
|
+
| :- | :- |
|
|
213
|
+
`,Tp=`| Property name | Type | Default value | Description |
|
|
214
|
+
| :- | :- | :- | :- |
|
|
215
|
+
`,Nr=/\|/g,ax=/</g,ox=/>/g,sr=/\n/g,cx=/\{@link\s+([^{}\s|]+)(?:\|([^{}]+))?\}/g;function ha(i){return i.replace(cx,(ve,Ae,Pe)=>`[${Pe===void 0?Ae:Pe.trim()}](${Ae})`)}function cn(i){if(i===void 0)return qt;return`<code>${i.replace(Nr,"|")}</code>`}function Pr(i){return i.replace(ax,"<").replace(ox,">")}function _r(i){if(i===void 0)return qt;return`<code>${i.replace(ma,"\\`").replace(Nr,"|")}</code>`}function hn(i,ve){if(ve===void 0)return i;let Ae=typeof ve==="string"&&ve.trim().length>0?`: ${Pr(ve).replace(sr," ").replace(Nr,"|")}`:"";return`<s>${i}</s><br />**Deprecated**${Ae}`}function Os(i){if(i===void 0||i.trim().length===0)return qt;return Pr(ha(i)).replace(Nr,"|").replace(sr,"<br />")}function Ms(i){if(i===void 0||i==="{}")return qt;return cn(Ds(i).replace(sr," "))}function Bs(i){if(i===void 0)return qt;return cn(Pr(i).replace(sr,"<br />"))}function Tn(i,ve){let Ae=[];if(i!==void 0&&i.trim().length>0)Ae.push(Pr(ha(i)));for(let{name:Pe,body:Ne}of ve??[]){let De=Ne?.trim();Ae.push(De?`@${Pe} ${Pr(ha(De))}`:`@${Pe}`)}if(Ae.length===0)return qt;return Ae.join(`
|
|
216
|
+
`).replace(Nr,"|").replace(sr,"<br />")}function $s(i){if(i===void 0)return qt;return cn(i.replace(sr," "))}var lx=/[^\w\- ]+/g,px=/\s+/g;function ux(i,ve){let Ae=i.toLowerCase().replace(ma,"").replace(lx,"").replace(px,"-"),Pe=ve.get(Ae)??0;return ve.set(Ae,Pe+1),Pe===0?Ae:`${Ae}-${Pe}`}class ir{sourceParts=[];hasToC=!1;toc=[];get source(){return this.sourceParts.join("")}appendLineBreaks(){return this.sourceParts.push(`
|
|
217
|
+
|
|
218
|
+
`),this}append(i,ve){switch(i){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":{let Ae=Number(i.slice(-1));if(this.sourceParts.push(`${"#".repeat(Ae)} ${ve}`),this.hasToC&&i==="h2")this.toc.push({indent:0,raw:ve??""});break}case"quote":this.sourceParts.push(`> ${ve}`);break;case"p":this.sourceParts.push(ve??"");break;case"divider":this.sourceParts.push("---");break;case"raw":this.sourceParts.push(ve??"");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 ve="<!-- __TOC__ -->",Ae=i.indexOf(ve);if(Ae===-1)return i;let Pe=new Map,Ne=this.toc.map(({indent:De,raw:_e})=>`${" ".repeat(De)}- [${_e}](#${ux(_e,Pe)})`).join(`
|
|
219
|
+
`);return i.slice(0,Ae)+Ne+i.slice(Ae+ve.length)}}var dx=`| Name | Type | Default | Required | Description |
|
|
220
|
+
| :- | :- | :- | :- | :- |
|
|
221
|
+
`,fx=/[.!?](?:\s|$)/,hx=/\r?\n[ \t]*\r?\n/,mx=/\s+/g;function Ap(i,ve){if(!i)return ve;let Ae=i.trim().split(hx)[0]?.replace(mx," ").trim();if(!Ae)return ve;let Pe=fx.exec(Ae);return Pe?Ae.slice(0,Pe.index+1):Ae}function ya(i,ve,Ae){if(Ae.length===0)return;i.append("h3",ve),i.append("raw",dx);for(let Pe of Ae)i.append("raw",`| ${hn(Pe.name,Pe.deprecated)} | ${cn(Pe.type)} | ${_r(Pe.value)} | ${Pe.isRequired?"Yes":"No"} | ${Tn(Pe.description,Pe.tags)} |
|
|
222
|
+
`);i.append("raw",`
|
|
223
|
+
`)}function gx(i,ve){if(ve.length===0)return;i.append("h3","Events"),i.append("raw",Ls);for(let Ae of ve)i.append("raw",`| ${hn(Ae.name,Ae.deprecated)} | ${Ae.type} | ${Ae.type==="dispatched"?$s(Ae.detail):qt} | ${Tn(Ae.description,Ae.tags)} |
|
|
224
|
+
`);i.append("raw",`
|
|
225
|
+
`)}function yx(i,ve,Ae){if(Ae.length===0)return;i.append("h3",ve),i.append("raw",Rs);for(let Pe of Ae)i.append("raw",`| ${hn(Pe.default?qt:Pe.name??qt,Pe.deprecated)} | ${Pe.default?"Yes":"No"} | ${Ms(Pe.slot_props)} | ${Bs(Pe.fallback)} | ${Tn(Pe.description,Pe.tags)} |
|
|
226
|
+
`);i.append("raw",`
|
|
227
|
+
`)}function xx(i,ve){if(ve.typedefs.length===0)return;i.append("h3","Typedefs"),i.append("raw",`\`\`\`ts
|
|
228
|
+
${rr({typedefs:ve.typedefs})}
|
|
229
|
+
\`\`\`
|
|
230
|
+
|
|
231
|
+
`)}function bx(i,ve){if(i.append("h2",ve.moduleName),ve.generics)i.append("p",`Type parameters: ${cn(`<${ve.generics[1]}>`)}`);if(ve.componentComment?.trim())i.append("p",ve.componentComment.trim());ya(i,"Props",ve.props),ya(i,"Bindings",ve.props.filter((Ae)=>Ae.reactive)),gx(i,ve.events),yx(i,ve.syntaxMode==="runes"?"Snippets":"Slots",ve.slots),xx(i,ve),ya(i,"Module exports",ve.moduleExports)}function Ex(i,ve,Ae,Pe){let Ne=new ir,De=Pe.linkBase??"";if(Ne.append("h1",ve),Ae)Ne.append("quote",Ae);Ne.append("h2","Components");for(let _e of i)Ne.append("raw",`- [${_e.moduleName}](${De}/${_e.moduleName}): ${Ap(_e.componentComment,"Component")}
|
|
232
|
+
`);if(Ne.append("raw",`
|
|
233
|
+
`),Pe.entryExports&&Pe.entryExports.length>0){Ne.append("h2","Exports");for(let _e of Pe.entryExports)Ne.append("raw",`- \`${_e.name}\`: ${Ap(_e.description,_e.kind)}
|
|
234
|
+
`);Ne.append("raw",`
|
|
235
|
+
`)}return Ne.end()}function Cx(i,ve,Ae){let Pe=new ir;if(Pe.append("h1",ve),Ae)Pe.append("quote",Ae);for(let Ne of i)bx(Pe,Ne);return Pe.end()}function vx(i,ve){let Ae=s(i,{entryExports:ve.entryExports}),Pe=rp(),Ne=ve.title??Pe.name??"Components",De=ve.summary??Pe.description;return{llmsTxt:Ex(Ae.components,Ne,De,ve),llmsFullTxt:Cx(Ae.components,Ne,De)}}async function xa(i,ve){let{llmsTxt:Ae,llmsFullTxt:Pe}=vx(i,ve),Ne=new Mt({dryRun:ve.dryRun}),De=e(Fs.join(ve.outDir??"","llms.txt")),_e=e(Fs.join(ve.outDir??"","llms-full.txt")),[Re,Oe]=await Promise.all([Ne.write(Fs.join(process.cwd(),De),Ae),Ne.write(Fs.join(process.cwd(),_e),Pe)]);if(!ve.dryRun)zt(`${Re?"created":"unchanged"} "${De}".`),zt(`${Oe?"created":"unchanged"} "${_e}".`)}import{join as Ea,resolve as Ip}from"node:path";function kp(i,ve,Ae){if(i.append("h1","Component Index"),i.append("h2","Components").tableOfContents(),i.append("divider"),Ae&&Ae.length>0)Pp(i,Ae);let Pe=s(ve);for(let Ne of Pe.components)_p(i,Ne)}function wp(i,ve,Ae){i.append("h1","Component Index"),i.append("h2","Components");for(let Pe of ve)i.append("raw",`- [${Pe.moduleName}](./${Pe.moduleName}.md)
|
|
236
|
+
`);if(i.append("raw",`
|
|
237
|
+
`),i.append("divider"),Ae&&Ae.length>0)Pp(i,Ae)}function Pp(i,ve){i.append("h2","Exports"),i.append("raw",ga);for(let Ae of ve){let Pe=(Ae.type??Ae.value)?.replace(Cp," ").trim();i.append("raw",`| ${hn(Ae.name,Ae.deprecated)} | ${`<code>${Ae.kind}</code>`} | ${cn(Pe)} | ${Os(Ae.description)} |
|
|
238
|
+
`)}i.append("raw",`
|
|
239
|
+
`),i.append("divider")}function Sx(i){return i.kind==="const"||i.isFunctionDeclaration}function Tx(i,ve){i.append("h3","Module exports"),i.append("raw",ga);for(let Ae of ve)i.append("raw",`| ${hn(Ae.name,Ae.deprecated)} | ${`<code>${Ae.kind}</code>`} | ${cn(Ae.type)} | ${Tn(Ae.description,Ae.tags)} |
|
|
240
|
+
`);i.append("raw",`
|
|
241
|
+
`)}function ba(i,ve,Ae,Pe){if(ve.length>0)Ae(),i.append("raw",`
|
|
242
|
+
`);else i.append("p",Pe??"None.")}function Np(i,ve){_p(i,ve)}function _p(i,ve){if(i.append("h2",`\`${ve.moduleName}\``),ve.generics)i.append("p",`**Type parameters:** ${cn(`<${ve.generics[1]}>`)}`);if(ve.typedefs.length>0)i.append("h3","Types").append("raw",`\`\`\`ts
|
|
243
|
+
${rr({typedefs:ve.typedefs})}
|
|
244
|
+
\`\`\`
|
|
245
|
+
|
|
246
|
+
`);if(i.append("h3","Props"),ba(i,ve.props,()=>{i.append("raw",vp);let Ae=(Ne)=>Ne.reactive?0:Ne.constant?2:1,Pe=ve.props.map((Ne,De)=>({prop:Ne,index:De})).sort((Ne,De)=>Ae(Ne.prop)-Ae(De.prop)||Ne.index-De.index).map(({prop:Ne})=>Ne);for(let Ne of Pe){let De=Sx(Ne)?"accessor":Ne.kind;i.append("raw",`| ${hn(Ne.name,Ne.deprecated)} | ${Ne.isRequired?"Yes":"No"} | ${`<code>${De}</code>`} | ${Ne.reactive?"Yes":"No"} | ${Ne.binding??"--"} | ${cn(Ne.type)} | ${_r(Ne.value)} | ${Tn(Ne.description,Ne.tags)} |
|
|
247
|
+
`)}}),ve.moduleExports.length>0)Tx(i,ve.moduleExports);if(i.append("h3","Slots"),ba(i,ve.slots,()=>{i.append("raw",Rs);for(let Ae of ve.slots)i.append("raw",`| ${hn(Ae.default?qt:Ae.name??qt,Ae.deprecated)} | ${Ae.default?"Yes":"No"} | ${Ms(Ae.slot_props)} | ${Bs(Ae.fallback)} | ${Tn(Ae.description,Ae.tags)} |
|
|
248
|
+
`)}),i.append("h3","Events"),ba(i,ve.events,()=>{i.append("raw",Ls);for(let Ae of ve.events)i.append("raw",`| ${hn(Ae.name,Ae.deprecated)} | ${Ae.type} | ${Ae.type==="dispatched"?$s(Ae.detail):qt} | ${Tn(Ae.description,Ae.tags)} |
|
|
249
|
+
`)}),ve.cssParts&&ve.cssParts.length>0){i.append("h3","CSS Parts"),i.append("raw",Sp);for(let Ae of ve.cssParts)i.append("raw",`| ${Ae.name} | ${Os(Ae.description)} |
|
|
250
|
+
`);i.append("raw",`
|
|
251
|
+
`)}if(ve.cssProperties&&ve.cssProperties.length>0){i.append("h3","CSS Custom Properties"),i.append("raw",Tp);for(let Ae of ve.cssProperties)i.append("raw",`| ${Ae.name} | ${cn(Ae.type)} | ${_r(Ae.default)} | ${Os(Ae.description)} |
|
|
252
|
+
`);i.append("raw",`
|
|
253
|
+
`)}}class js extends Mt{onAppend;markdownBase;constructor(i){super();this.onAppend=i.onAppend,this.markdownBase=new ir}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,ve){return this.markdownBase.append(i,ve),this.onAppend?.call(this,i,this),this}tableOfContents(){return this.markdownBase.tableOfContents(),this}end(){return this.markdownBase.end()}}function Ca(i,ve){return new js({onAppend:(Ae,Pe)=>{i.onAppend?.call(null,Ae,Pe,ve)}})}async function Ax(i,ve){let Ae=ve.outDir,Pe=s(i,{entryExports:ve.entryExports}),Ne=new Mt({dryRun:ve.dryRun}),De=Ca(ve,i);wp(De,Pe.components,ve.entryExports);let _e=Ip(Ea(Ae,"README.md")),Re=await Ne.write(_e,De.end());if(!ve.dryRun)zt(`${Re?"created":"unchanged"} "${_e}".`);await Promise.all(Pe.components.map(async(Oe)=>{let Be=Ca(ve,i);Np(Be,Oe);let Me=Ip(Ea(Ae,`${Oe.moduleName}.md`)),je=await Ne.write(Me,Be.end());if(!ve.dryRun)zt(`${je?"created":"unchanged"} "${Me}".`)}))}function va(i,ve){let Ae=Ca(ve,i);return kp(Ae,i,ve.entryExports),Ae.end()}async function Sa(i,ve){if(ve.outDir){if(ve.write!==!1)await Ax(i,ve);return}let Ae=ve?.write!==!1,Pe=va(i,ve);if(Ae){let Ne=Ea(process.cwd(),ve.outFile),De=await new Mt({dryRun:ve.dryRun}).write(Ne,Pe);if(!ve.dryRun)zt(`${De?"created":"unchanged"} "${ve.outFile}".`)}return Pe}import{join as Dp}from"node:path";async function Ta(i,ve){let Ae=Dp(process.cwd(),ve.outDir,"index.d.ts"),Pe=new Mt({dryRun:ve.dryRun}),Ne=ve.preamble+Zl(ve.exports),De=s(i),_e=ve.format??"class",Re=De.components.map(async(Oe)=>{let Be=tp(Dp(ve.outDir,Oe.filePath)),Me=ve.resolvedPathByFilePath?.get(Oe.filePath),je=Me?ve.cache?.getGeneratedText(Me,_e):void 0;if(je===void 0){if(je=fa(Oe,{format:ve.format}),Me)ve.cache?.setGeneratedText(Me,_e,je)}await Pe.write(Be,je)});if(await Promise.all([...Re,Pe.write(Ae,`${Ne}
|
|
254
|
+
`)]),!ve.dryRun)zt("created TypeScript definitions.")}S({name:"json",componentSet:"exported",write:ra});S({name:"markdown",componentSet:"exported",write:Sa});S({name:"types",componentSet:"all",write:Ta});S({name:"custom-elements",componentSet:"exported",write:Zi});S({name:"llms",componentSet:"exported",write:xa});var Rp='sveld: could not resolve a Svelte entry point. Set package.json#svelte, or pass the "entry" option.',Px=50;function Nx(i){let ve=Promise.resolve();return()=>{ve=ve.then(i,i)}}function Se(i){let ve=i?.watch===!0,Ae,Pe,Ne=i??{},De,_e=null,Re,Oe=new Set,Me=Nx(async()=>{if(_e==null||Pe==null||Oe.size===0)return;let qe=Array.from(Oe);Oe.clear();try{let{result:Ge}=await _e.update(qe);await k(Ge,Ne,Pe)}catch(Ge){console.error("sveld: failed to regenerate types in watch mode:",Ge)}}),je=(qe)=>{if(!ve||_e==null||!Yc.test(qe))return;Oe.add(qe),clearTimeout(Re),Re=setTimeout(Me,Px)};return{name:"vite-plugin-sveld",apply:ve?void 0:"build",enforce:"post",configResolved(qe){De=qe.root},async buildStart(){if(i?.config){let qe=De??process.cwd(),Ge=typeof i.config==="string"?await $i(kx(i.config)?i.config:wx(qe,i.config)):await v(qe);Ne=D(Ge,i)}if(_(Ne),N(Ne.quiet===!0),Pe=A(Ne.entry),ve&&Pe!=null)_e=await Yl(Pe,Ne.glob===!0,Ne.documentExports===!0),await k(_e.result,Ne,Pe)},async generateBundle(){if(ve)return;if(Pe==null)this.error(Rp);Ae=await b(Pe,Ne.glob===!0,E(Ne))},async writeBundle(){if(ve)return;if(Pe==null)this.error(Rp);await k(Ae,Ne,Pe),Ae.cache?.save()},handleHotUpdate(qe){je(qe.file)},watchChange(qe){je(qe)}}}function Ir(i,ve,Ae){let Pe=W(i);if(!Pe)throw Error(`sveld: built-in writer "${i}" is not registered.`);return Pe.write(ve,Ae)}async function k(i,ve,Ae){let Pe=Lp(Ae),Ne=ve?.dryRun===!0;if(ve?.types!==!1)await Ir("types",i.allComponentsForTypes,{outDir:"types",preamble:"",...ve?.typesOptions,exports:i.exports,inputDir:Pe,dryRun:Ne,cache:i.cache,resolvedPathByFilePath:i.resolvedPathByFilePath});if(ve?.json)await Ir("json",i.components,{outFile:"COMPONENT_API.json",...ve?.jsonOptions,input:Ae,inputDir:Pe,entryExports:i.entryExports,dryRun:Ne});if(ve?.markdown)await Ir("markdown",i.components,{outFile:"COMPONENT_INDEX.md",...ve?.markdownOptions,entryExports:i.entryExports,dryRun:Ne});if(ve?.customElements)await Ir("custom-elements",i.components,{outFile:"custom-elements.json",...ve?.customElementsOptions,inputDir:Pe,dryRun:Ne});if(ve?.llms)await Ir("llms",i.components,{...ve?.llmsOptions,entryExports:i.entryExports,dryRun:Ne});let De=Object.entries(ve?.additionalWriters??{}).map(([_e,Re])=>{let Oe=W(_e);if(!Oe){console.warn(`sveld: no writer registered with name "${_e}"; skipping.`);return}let Be=Oe.componentSet==="all"?i.allComponentsForTypes:i.components,Me={...Re,dryRun:Ne};return _x(_e,Oe,Be,Me)});await Promise.all(De)}async function _x(i,ve,Ae,Pe){try{return await ve.write(Ae,Pe)}catch(Ne){let De=Ne instanceof Error?Ne.message:String(Ne);throw Error(`sveld: writer "${i}" failed: ${De}`,{cause:Ne})}}async function Op(i,ve,Ae){let Pe=Lp(Ae);if(ve?.json){let Ne={...ve?.jsonOptions,inputDir:Pe,entryExports:i.entryExports},De=ve.stdout==="ndjson"?np(i.components,Ne):na(i.components,Ne);process.stdout.write(De);return}if(ve?.markdown){let Ne=va(i.components,{...ve?.markdownOptions,entryExports:i.entryExports});process.stdout.write(Ne);return}if(ve?.customElements){let Ne=Qi(i.components,{...ve?.customElementsOptions,inputDir:Pe});process.stdout.write(Ne)}}import{appendFileSync as Lx,existsSync as Ox}from"node:fs";import{join as Mx}from"node:path";var Bp=/%/g,$p=/\r/g,Fp=/\n/g,Ix=/,/g,Dx=/:/g,jp=/\|/g;function Mp(i){return i.replace(Bp,"%25").replace($p,"%0D").replace(Fp,"%0A").replace(Ix,"%2C").replace(Dx,"%3A")}function Rx(i){return i.replace(Bp,"%25").replace($p,"%0D").replace(Fp,"%0A")}function Vp(i,ve,Ae,Pe,Ne,De){let _e=i==="error"?"error":"warning",Re=[];if(Pe!==void 0)Re.push(`file=${Mp(Pe)}`);if(Ne!==void 0)Re.push(`line=${Ne}`);if(De!==void 0)Re.push(`col=${De}`);return Re.push(`title=${Mp(ve)}`),`::${_e} ${Re.join(",")}::${Rx(Ae)}`}function qp(i){return i.filter((ve)=>!ve.ignored).map((ve)=>Vp(ve.severity,`sveld ${ve.code}`,ve.message,ve.component,ve.source?.start.line,ve.source?.start.column)).join(`
|
|
255
|
+
`)}function Wp(i){let ve=i.filter((Pe)=>!Pe.ignored);if(ve.length===0)return"";return["### sveld diagnostics","","| Severity | Code | Location | Message |","| --- | --- | --- | --- |",...ve.map((Pe)=>{let Ne=Pe.source?`${Pe.component}:${Pe.source.start.line}`:Pe.component;return`| ${Pe.severity} | ${Pe.code} | ${Ne} | ${Pe.message.replace(jp,"\\|")} |`})].join(`
|
|
256
|
+
`)}function Gp(i,ve){return i.changes.filter((Ae)=>ps(Ae.bump,ve))}function Up(i,ve){return Gp(i,ve).map((Ae)=>Vp("error","sveld breaking change",Ae.message,Ae.component==="*"?void 0:Ae.component)).join(`
|
|
257
|
+
`)}function Hp(i,ve){let Ae=Gp(i,ve);if(Ae.length===0)return"";return["### sveld breaking changes","","| Component | Kind | Message |","| --- | --- | --- |",...Ae.map((Ne)=>`| ${Ne.component} | ${Ne.kind} | ${Ne.message.replace(jp,"\\|")} |`)].join(`
|
|
258
|
+
`)}var Aa="src/index.js",It={SUCCESS:0,USAGE_ERROR:1,GENERATION_FAILURE:2,BREAKING_CHANGE:3,DIAGNOSTICS:4},Bx=`Usage: sveld [options]
|
|
259
|
+
|
|
260
|
+
Generate TypeScript definitions and component documentation for a Svelte
|
|
261
|
+
library. With no flags, only TypeScript definitions are generated for the
|
|
262
|
+
entry resolved from package.json#svelte.
|
|
263
|
+
|
|
264
|
+
--entry, --cache, --check, and --types-format accept their value as
|
|
265
|
+
--flag=value or as a separate --flag value argument.
|
|
266
|
+
|
|
267
|
+
Options:
|
|
268
|
+
--entry=<path> Entry point to uncompiled Svelte source (default: package.json "svelte" field)
|
|
269
|
+
--glob Analyze all *.svelte files instead of the entry barrel
|
|
270
|
+
--types Generate TypeScript definitions (default: true)
|
|
271
|
+
--json Generate component documentation in JSON format
|
|
272
|
+
--markdown Generate component documentation in Markdown format
|
|
273
|
+
--custom-elements Generate a Custom Elements Manifest (custom-elements.json)
|
|
274
|
+
--llms Generate an llms.txt / llms-full.txt pair (https://llmstxt.org)
|
|
275
|
+
--fail-fast Abort the run when a single component fails to parse
|
|
276
|
+
--dry-run Resolve, parse, and print "would write" lines for each output file instead of writing anything (including the parse cache)
|
|
277
|
+
--quiet Suppress progress logs (errors, the diagnostics summary, and the --check report are unaffected)
|
|
278
|
+
--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
|
|
279
|
+
--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)
|
|
280
|
+
--resolve-types Expand opaque imported $props() types into JSON (alias: --resolveTypes, deprecated)
|
|
281
|
+
--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
|
|
282
|
+
--report-diagnostics Print unresolved-type diagnostics to stderr
|
|
283
|
+
--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}
|
|
284
|
+
--types-format=<format> ".d.ts" output format: "class" (default) or "component" (Svelte 5 Component<...>)
|
|
285
|
+
--check[=<path>] Diff the parsed API against a committed snapshot; exit 3 on a breaking change (default path: COMPONENT_API.json)
|
|
286
|
+
--check-level=<major|minor|patch> Minimum bump --check fails the run on (default: major)
|
|
287
|
+
--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
|
|
288
|
+
--help Print this help message and exit
|
|
289
|
+
--version Print the installed sveld version and exit
|
|
290
|
+
|
|
291
|
+
Exit codes:
|
|
292
|
+
0 success
|
|
293
|
+
1 usage or configuration error
|
|
294
|
+
2 generation failure
|
|
295
|
+
3 breaking API change detected by --check
|
|
296
|
+
4 diagnostics present under --strict
|
|
297
|
+
`,ka={resolveTypes:"resolve-types",checkExamples:"check-examples"},$x=["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","format"],Fx=[...$x,...Object.keys(ka)],jx=new Set(["glob","types","json","markdown","quiet","custom-elements","llms","strict","report-diagnostics","resolve-types","check-examples","fail-fast","dry-run"]),Vx=new Set(["entry","cache","check","types-format"]),qx=new Set(["entry","types-format"]);function Wx(i){let ve=us(i,Fx);return ve===void 0?void 0:ka[ve]??ve}function Gx(i,ve){let Ae=i.indexOf("="),Pe=Ae===-1?i.slice(2):i.slice(2,Ae),Ne=ka[Pe]??Pe,De=Ae===-1?!0:i.slice(Ae+1),_e=!1;if(Ae===-1&&Vx.has(Ne)){if(ve!==void 0&&!ve.startsWith("--"))De=ve,_e=!0;else if(qx.has(Ne))return{result:{kind:"usage-error",message:`sveld: --${Ne} requires a value (pass --${Ne}=<value> or --${Ne} <value>).`},consumedNext:!1,flag:Ne}}return{result:Ux(Ne,De,i,Pe),consumedNext:_e,flag:Ne}}function Ux(i,ve,Ae,Pe){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]:ve===!0||ve==="true"}};case"stdout":if(ve===!0||ve==="true")return{kind:"option",option:{stdout:!0}};if(ve==="false")return{kind:"option",option:{stdout:!1}};return{kind:"option",option:{stdout:ve}};case"custom-elements":return{kind:"option",option:{customElements:ve===!0||ve==="true"}};case"llms":return{kind:"option",option:{llms:ve===!0||ve==="true"}};case"strict":if(ve===!0||ve==="true")return{kind:"option",option:{strict:!0}};if(ve==="false")return{kind:"option",option:{strict:!1}};return{kind:"option",option:{strict:ve}};case"report-diagnostics":return{kind:"option",option:{reportDiagnostics:ve===!0||ve==="true"}};case"resolve-types":return{kind:"option",option:{resolveTypes:ve===!0||ve==="true"}};case"check-examples":if(ve===!0||ve==="true")return{kind:"option",option:{checkExamples:!0}};if(ve==="false")return{kind:"option",option:{checkExamples:!1}};return{kind:"option",option:{checkExamples:ve}};case"fail-fast":return{kind:"option",option:{failFast:ve===!0||ve==="true"}};case"dry-run":return{kind:"option",option:{dryRun:ve===!0||ve==="true"}};case"entry":return typeof ve==="string"?{kind:"option",option:{entry:ve}}:{kind:"option",option:{}};case"cache":if(ve==="false")return{kind:"option",option:{cache:!1}};return{kind:"option",option:{cache:typeof ve==="string"?ve:!0}};case"check":if(ve==="false")return{kind:"option",option:{check:!1}};return{kind:"option",option:{check:typeof ve==="string"?ve:!0}};case"types-format":return typeof ve==="string"?{kind:"option",option:{typesOptions:{format:ve}}}:{kind:"option",option:{}};case"format":return typeof ve==="string"?{kind:"option",option:{format:ve}}:{kind:"option",option:{}};case"check-level":return typeof ve==="string"?{kind:"option",option:{checkLevel:ve}}:{kind:"option",option:{}};default:return{kind:"unknown",arg:Ae,suggestion:Wx(Pe)}}}function Hx(i){let ve={},Ae=!1;for(let Pe=0;Pe<i.length;Pe++){let Ne=i[Pe];if(!Ne.startsWith("--"))return{kind:"unknown",arg:Ne,positionalHint:Ae?!0:void 0};let{result:De,consumedNext:_e,flag:Re}=Gx(Ne,i[Pe+1]);if(De.kind!=="option")return De;if(Object.assign(ve,De.option),Ae=jx.has(Re),_e)Pe++}return{kind:"options",options:ve}}async function te(i){let ve=Hx(i.argv.slice(2));if(ve.kind==="help"){console.log(Bx);return}if(ve.kind==="version"){console.log(Zc.version);return}if(ve.kind==="usage-error"){console.error(ve.message),i.exitCode=It.USAGE_ERROR;return}if(ve.kind==="unknown"){let He=`Unknown flag: ${ve.arg}`;if(ve.suggestion)He+=` Did you mean --${ve.suggestion}?`;if(ve.positionalHint)He+=" (values are passed as --flag=value or --flag value)";console.error(He),console.error("Run sveld --help for a list of available flags."),i.exitCode=It.USAGE_ERROR;return}let Ae=ve.options,Pe=await v(),Ne=H(D(Pe,Ae));if(_(Ne),Ne.stdout){if(Ne.stdout!==!0&&Ne.stdout!=="json"&&Ne.stdout!=="ndjson"){console.error(`sveld: --stdout must be "json" or "ndjson"; got "${Ne.stdout}".`),i.exitCode=It.USAGE_ERROR;return}if([Ne.json,Ne.markdown,Ne.customElements].filter(Boolean).length!==1){console.error("sveld: --stdout requires exactly one of --json, --markdown, or --custom-elements."),i.exitCode=It.USAGE_ERROR;return}if(Ne.stdout==="ndjson"&&!Ne.json){console.error("sveld: --stdout=ndjson is only valid with --json."),i.exitCode=It.USAGE_ERROR;return}if(Ne.types===!0){console.error("sveld: --stdout cannot be combined with --types; type definitions span multiple files."),i.exitCode=It.USAGE_ERROR;return}if(Ne.check){console.error("sveld: --stdout cannot be combined with --check; both write their document to stdout."),i.exitCode=It.USAGE_ERROR;return}}if(Ne.format!==void 0&&Ne.format!=="text"&&Ne.format!=="json"&&Ne.format!=="github"){console.error(`sveld: --format must be "text", "json", or "github"; got "${Ne.format}".`),i.exitCode=It.USAGE_ERROR;return}if(Ne.strict!==void 0&&Ne.strict!==!0&&Ne.strict!==!1&&Ne.strict!=="errors"){console.error(`sveld: --strict must be "errors", "ci", or "local" when given a value; got "${Ne.strict}".`),i.exitCode=It.USAGE_ERROR;return}if(Ne.checkLevel!==void 0&&Ne.checkLevel!=="major"&&Ne.checkLevel!=="minor"&&Ne.checkLevel!=="patch"){console.error(`sveld: --check-level must be "major", "minor", or "patch"; got "${Ne.checkLevel}".`),i.exitCode=It.USAGE_ERROR;return}if(Ne.checkExamples!==void 0&&Ne.checkExamples!==!0&&Ne.checkExamples!==!1&&Ne.checkExamples!=="syntax"){console.error(`sveld: --check-examples must be "syntax" when given a value; got "${Ne.checkExamples}".`),i.exitCode=It.USAGE_ERROR;return}N(Ne.quiet===!0);let De=A(Ne.entry),_e;if(De!==null)_e=De;else if(Ox(Mx(i.cwd(),Aa)))console.error(`sveld: could not resolve an entry point; falling back to "${Aa}". Set package.json#svelte (or pass --entry) to avoid relying on this fallback.`),_e=Cr(e(Aa));else{i.exitCode=It.USAGE_ERROR;return}let Re,Oe;try{if(Re=await b(_e,Ne.glob===!0,E(Ne)),Ne.check)Oe=await O(Re.components,U(Ne),{entryExports:Re.entryExports});if(Ne.stdout)await Op(Re,Ne,_e);else if(await k(Re,Ne,_e),!Ne.dryRun)Re.cache?.save()}catch(He){if(He instanceof Qn){console.error(`sveld: ${He.message}`),i.exitCode=It.USAGE_ERROR;return}console.error(He instanceof Error?He.message:String(He)),i.exitCode=It.GENERATION_FAILURE;return}let Be=Ne.reportDiagnostics||Ne.strict,Me=j(Re.diagnostics,Be),je=[];if(Be&&Me.length>0)if(Ne.format==="json")i.stderr.write(q(Me));else if(Ne.format==="github"){let He=qp(Me);if(He)console.error(He);let Xe=Wp(Me);if(Xe)je.push(Xe)}else console.error(F(Me));if(Oe)if(Ne.format==="json")i.stdout.write(ee(Oe));else if(Ne.format==="github"){let He=Up(Oe,Ne.checkLevel??"major");if(He)console.log(He);let Xe=Hp(Oe,Ne.checkLevel??"major");if(Xe)je.push(Xe)}else console.log(K(Oe));if(Ne.format==="github"&&je.length>0&&i.env.GITHUB_STEP_SUMMARY)Lx(i.env.GITHUB_STEP_SUMMARY,`${je.join(`
|
|
298
|
+
|
|
299
|
+
`)}
|
|
300
|
+
`);let qe;if(Oe?.changes.some((He)=>He.kind==="schema")??!1)qe=It.USAGE_ERROR;else if(Oe&&ps(Oe.bump,Ne.checkLevel??"major"))qe=It.BREAKING_CHANGE;if(J(Me,Ne.strict).length>0)qe=qe===void 0?It.DIAGNOSTICS:Math.min(qe,It.DIAGNOSTICS);if(qe!==void 0)i.exitCode=qe}
|
|
301
|
+
export{ke,o,w,re,l,a,ne,p,f,ie,y,M,B,j,J,F,se,q,n,d,V,t,r,u,I,m,oe,ae,ce,G,h,ue,z,pe,le,x,fe,c,C,de,X,me,he,ge,Q,ye,R,Y,Z,L,g,xe,Te,T,P,e,s,Ee,U,O,K,be,ee,A,we,v,D,H,_,N,E,b,S,W,Ce,Se,k,te};
|