@datalayer/agent-runtimes 1.6.21 → 1.6.23
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/dist-embed/chunks/{CollapsiblePlugin-B85HBp8b.js → CollapsiblePlugin-Bn70jFpi.js} +1 -1
- package/dist-embed/chunks/{DeckComponent-DnMHEQJo.js → DeckComponent-DuxVpxzx.js} +1 -1
- package/dist-embed/chunks/{DocumentView-3aE4btpU.js → DocumentView-DKLkbwvh.js} +1 -1
- package/dist-embed/chunks/{EphemeralDocument-DLAoDnRi.js → EphemeralDocument-CAXNOtEL.js} +1 -1
- package/dist-embed/chunks/{ExcalidrawComponent-BJYnSolA.js → ExcalidrawComponent-mHitiMde.js} +1 -1
- package/dist-embed/chunks/{ExcalidrawModal-DmcKDOu0.js → ExcalidrawModal-KB4MTQbk.js} +1 -1
- package/dist-embed/chunks/{JupyterLexicalExtension-D-dDKj_U.js → JupyterLexicalExtension-BtjDYMne.js} +5 -5
- package/dist-embed/chunks/{YouTubePlugin-B26ThLdI.js → YouTubePlugin-B6JmeO6g.js} +1 -1
- package/dist-embed/chunks/{ar-SA-G6X2FPQ2-DrKp-GT1.js → ar-SA-G6X2FPQ2-BtDm_vBV.js} +1 -1
- package/dist-embed/chunks/{az-AZ-76LH7QW2-kanwrGa7.js → az-AZ-76LH7QW2-CU9PzGa-.js} +1 -1
- package/dist-embed/chunks/babel-xT8DLG14.js +16 -0
- package/dist-embed/chunks/{bg-BG-XCXSNQG7-B-YkMqs9.js → bg-BG-XCXSNQG7-CcZG1sMf.js} +1 -1
- package/dist-embed/chunks/{bn-BD-2XOGV67Q-C2LRshMO.js → bn-BD-2XOGV67Q-CsBxRWS8.js} +1 -1
- package/dist-embed/chunks/{ca-ES-6MX7JW3Y-CH-XjE7A.js → ca-ES-6MX7JW3Y-DiPlBY-L.js} +1 -1
- package/dist-embed/chunks/{cs-CZ-2BRQDIVT-CZsinbV8.js → cs-CZ-2BRQDIVT-B2LG8kaF.js} +1 -1
- package/dist-embed/chunks/{da-DK-5WZEPLOC-BKE16CYd.js → da-DK-5WZEPLOC-CjiEJ2dL.js} +1 -1
- package/dist-embed/chunks/{de-DE-XR44H4JA-Bef67X55.js → de-DE-XR44H4JA-D2hSEI1m.js} +1 -1
- package/dist-embed/chunks/{el-GR-BZB4AONW-DdhJZ7Lx.js → el-GR-BZB4AONW-C7ps3kie.js} +1 -1
- package/dist-embed/chunks/{es-ES-U4NZUMDT-BYuerEZq.js → es-ES-U4NZUMDT-BfNMUvfg.js} +1 -1
- package/dist-embed/chunks/estree-BbkbXjhR.js +44 -0
- package/dist-embed/chunks/{eu-ES-A7QVB2H4-Bx1ZMbch.js → eu-ES-A7QVB2H4-CBQcRcNh.js} +1 -1
- package/dist-embed/chunks/{fa-IR-HGAKTJCU-DOlQSonG.js → fa-IR-HGAKTJCU-CKTkkQUk.js} +1 -1
- package/dist-embed/chunks/{fi-FI-Z5N7JZ37-CEvqx_B0.js → fi-FI-Z5N7JZ37-B2flJw4O.js} +1 -1
- package/dist-embed/chunks/{fr-FR-RHASNOE6-B6dmIROy.js → fr-FR-RHASNOE6-DCWxP6nh.js} +1 -1
- package/dist-embed/chunks/{gl-ES-HMX3MZ6V-DET0-zSB.js → gl-ES-HMX3MZ6V-BGEA0PhL.js} +1 -1
- package/dist-embed/chunks/{he-IL-6SHJWFNN-D8q7vnmN.js → he-IL-6SHJWFNN-BaHixqAA.js} +1 -1
- package/dist-embed/chunks/{hi-IN-IWLTKZ5I-WKOut6Ph.js → hi-IN-IWLTKZ5I-CrHbvHN0.js} +1 -1
- package/dist-embed/chunks/html-DVpylSNq.js +25 -0
- package/dist-embed/chunks/{hu-HU-A5ZG7DT2-D8S_FCMc.js → hu-HU-A5ZG7DT2-B9wQnRpK.js} +1 -1
- package/dist-embed/chunks/{id-ID-SAP4L64H-C1MpnR6j.js → id-ID-SAP4L64H-T0pQVB4m.js} +1 -1
- package/dist-embed/chunks/{it-IT-JPQ66NNP-CmSi2-kQ.js → it-IT-JPQ66NNP-ECgWHvcY.js} +1 -1
- package/dist-embed/chunks/{ja-JP-DBVTYXUO-f3Xycaxf.js → ja-JP-DBVTYXUO-Cz96ctDW.js} +1 -1
- package/dist-embed/chunks/{kaa-6HZHGXH3-CDjiUexP.js → kaa-6HZHGXH3-Cu7gLGxC.js} +1 -1
- package/dist-embed/chunks/{kab-KAB-ZGHBKWFO-C7pc9jkA.js → kab-KAB-ZGHBKWFO-CoJI939s.js} +1 -1
- package/dist-embed/chunks/{kk-KZ-P5N5QNE5-DKB4lHwJ.js → kk-KZ-P5N5QNE5-DiEAZ9si.js} +1 -1
- package/dist-embed/chunks/{km-KH-HSX4SM5Z-Tct1wYe_.js → km-KH-HSX4SM5Z-CNF1qzO2.js} +1 -1
- package/dist-embed/chunks/{ko-KR-MTYHY66A-D75KXFFg.js → ko-KR-MTYHY66A-BCvHfgyK.js} +1 -1
- package/dist-embed/chunks/{ku-TR-6OUDTVRD-DFFv9y6o.js → ku-TR-6OUDTVRD-BV9JoFXu.js} +1 -1
- package/dist-embed/chunks/{lib-CWYlnae_.js → lib-BkW0DwuV.js} +1 -1
- package/dist-embed/chunks/{lt-LT-XHIRWOB4-b_ZSHKuX.js → lt-LT-XHIRWOB4-BpoBiZvj.js} +1 -1
- package/dist-embed/chunks/{lv-LV-5QDEKY6T-DOkd9vjo.js → lv-LV-5QDEKY6T-DWPLOycm.js} +1 -1
- package/dist-embed/chunks/markdown-Czq15M7Q.js +70 -0
- package/dist-embed/chunks/{mr-IN-CRQNXWMA-DgtGEhds.js → mr-IN-CRQNXWMA-C3XokKLN.js} +1 -1
- package/dist-embed/chunks/{my-MM-5M5IBNSE-Wx2nX-HX.js → my-MM-5M5IBNSE-bPDcBtIx.js} +1 -1
- package/dist-embed/chunks/{nb-NO-T6EIAALU-Bxg1hz2F.js → nb-NO-T6EIAALU-zGQywuc4.js} +1 -1
- package/dist-embed/chunks/{nl-NL-IS3SIHDZ-CuTty8ZU.js → nl-NL-IS3SIHDZ-D0N-QxdB.js} +1 -1
- package/dist-embed/chunks/{nn-NO-6E72VCQL-yF9Qjmvy.js → nn-NO-6E72VCQL-BeiBipEM.js} +1 -1
- package/dist-embed/chunks/{oc-FR-POXYY2M6-DzhTICBK.js → oc-FR-POXYY2M6-BSmiDtLw.js} +1 -1
- package/dist-embed/chunks/{pa-IN-N4M65BXN-BLaNcNfP.js → pa-IN-N4M65BXN-YTioBliU.js} +1 -1
- package/dist-embed/chunks/{percentages-BXMCSKIN-BSFk0Tks.js → percentages-BXMCSKIN-B5BZ64UL.js} +3 -3
- package/dist-embed/chunks/{pl-PL-T2D74RX3-Cny-MZTY.js → pl-PL-T2D74RX3-BmA-mIoA.js} +1 -1
- package/dist-embed/chunks/postcss-ClUAhyQz.js +62 -0
- package/dist-embed/chunks/{pt-BR-5N22H2LF-B0D69qws.js → pt-BR-5N22H2LF-DF1nGVg3.js} +1 -1
- package/dist-embed/chunks/{pt-PT-UZXXM6DQ-BstfsxvV.js → pt-PT-UZXXM6DQ-DhiSFYNH.js} +1 -1
- package/dist-embed/chunks/{ro-RO-JPDTUUEW-BP5Qc7BF.js → ro-RO-JPDTUUEW-DN5nT_8E.js} +1 -1
- package/dist-embed/chunks/{ru-RU-B4JR7IUQ-CnAMP9Hu.js → ru-RU-B4JR7IUQ-DJAZColu.js} +1 -1
- package/dist-embed/chunks/{si-LK-N5RQ5JYF-KUaQDZ4v.js → si-LK-N5RQ5JYF-BcJdGNJf.js} +1 -1
- package/dist-embed/chunks/{sk-SK-C5VTKIMK-CG7XdLGl.js → sk-SK-C5VTKIMK-Bs43X2b-.js} +1 -1
- package/dist-embed/chunks/{sl-SI-NN7IZMDC-e_SFsMsv.js → sl-SI-NN7IZMDC-CVhBQ31i.js} +1 -1
- package/dist-embed/chunks/standalone-BmUQQ5LE.js +29 -0
- package/dist-embed/chunks/{subset-shared.chunk-Cn_vjsJA.js → subset-shared.chunk-BkTdi2-W.js} +1 -1
- package/dist-embed/chunks/{subset-worker.chunk-W_rTkgB8.js → subset-worker.chunk-SkNsdM6t.js} +1 -1
- package/dist-embed/chunks/{sv-SE-XGPEYMSR-DHzvVSOu.js → sv-SE-XGPEYMSR-BR0XZMXJ.js} +1 -1
- package/dist-embed/chunks/{ta-IN-2NMHFXQM-opB0ehqF.js → ta-IN-2NMHFXQM-4CfGQQ8v.js} +1 -1
- package/dist-embed/chunks/{th-TH-HPSO5L25-DLQWbRw6.js → th-TH-HPSO5L25-CjO8TBa6.js} +1 -1
- package/dist-embed/chunks/{tr-TR-DEFEU3FU-BB46Zv5P.js → tr-TR-DEFEU3FU-B3tO43YQ.js} +1 -1
- package/dist-embed/chunks/typescript-BLZ3EhMp.js +22 -0
- package/dist-embed/chunks/{uk-UA-QMV73CPH-PSr9uqn6.js → uk-UA-QMV73CPH-DYk01HNs.js} +1 -1
- package/dist-embed/chunks/{vi-VN-M7AON7JQ-B8XFOV9x.js → vi-VN-M7AON7JQ-Dyd2Hf1G.js} +1 -1
- package/dist-embed/chunks/{zh-CN-LNUGB5OW-Cw-MnTuW.js → zh-CN-LNUGB5OW-Bs2W1BrY.js} +1 -1
- package/dist-embed/chunks/{zh-HK-E62DVLB3-C6TwyE2U.js → zh-HK-E62DVLB3-BwN2oc_m.js} +1 -1
- package/dist-embed/chunks/{zh-TW-RAJ6MFWO-CLS-sbQC.js → zh-TW-RAJ6MFWO-qOevWsjt.js} +1 -1
- package/dist-embed/datalayer-app-main.js +15 -9
- package/lib/specs/actions.js +7 -0
- package/lib/specs/agents/agents.d.ts +1 -0
- package/lib/specs/agents/agents.js +139 -1
- package/lib/specs/apps.d.ts +1 -0
- package/lib/specs/apps.js +352 -0
- package/lib/specs/backendTools.d.ts +5 -0
- package/lib/specs/backendTools.js +95 -0
- package/lib/specs/policies.d.ts +1 -0
- package/lib/specs/policies.js +17 -0
- package/package.json +1 -1
- package/dist-embed/chunks/babel-DYThBADt.js +0 -16
- package/dist-embed/chunks/estree-C_HWBWad.js +0 -44
- package/dist-embed/chunks/html-BdbYoS8g.js +0 -25
- package/dist-embed/chunks/markdown-BWelGxUI.js +0 -70
- package/dist-embed/chunks/postcss-Bqhj58AT.js +0 -62
- package/dist-embed/chunks/standalone-Lm5oSWJc.js +0 -29
- package/dist-embed/chunks/typescript-Ctd41k9v.js +0 -22
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
var Iu=Object.defineProperty,$e=(e,t)=>{for(var u in t)Iu(e,u,{get:t[u],enumerable:!0})},Pu={};$e(Pu,{__debug:()=>Wi,check:()=>Ri,doc:()=>bu,format:()=>Nu,formatWithCursor:()=>xu,getSupportInfo:()=>Vi,util:()=>wu,version:()=>pi});var se=(e,t)=>(u,r,...n)=>u|1&&r==null?void 0:(t.call(r)??r[e]).apply(r,n),Lu=String.prototype.replaceAll??function(e,t){return e.global?this.replace(e,t):this.split(e).join(t)},ju=se("replaceAll",function(){if(typeof this=="string")return Lu}),he=ju,$u=class{diff(e,t,u={}){let r;typeof u=="function"?(r=u,u={}):"callback"in u&&(r=u.callback);let n=this.castInput(e,u),D=this.castInput(t,u),i=this.removeEmpty(this.tokenize(n,u)),a=this.removeEmpty(this.tokenize(D,u));return this.diffWithOptionsObj(i,a,u,r)}diffWithOptionsObj(e,t,u,r){var n;let D=C=>{if(C=this.postProcess(C,u),r){setTimeout(function(){r(C)},0);return}else return C},i=t.length,a=e.length,o=1,s=i+a;u.maxEditLength!=null&&(s=Math.min(s,u.maxEditLength));let F=(n=u.timeout)!==null&&n!==void 0?n:1/0,l=Date.now()+F,c=[{oldPos:-1,lastComponent:void 0}],p=this.extractCommon(c[0],t,e,0,u);if(c[0].oldPos+1>=a&&p+1>=i)return D(this.buildValues(c[0].lastComponent,t,e));let f=-1/0,h=1/0,d=()=>{for(let C=Math.max(f,-o);C<=Math.min(h,o);C+=2){let m,y=c[C-1],g=c[C+1];y&&(c[C-1]=void 0);let b=!1;if(g){let w=g.oldPos-C;b=g&&0<=w&&w<i}let A=y&&y.oldPos+1<a;if(!b&&!A){c[C]=void 0;continue}if(!A||b&&y.oldPos<g.oldPos?m=this.addToPath(g,!0,!1,0,u):m=this.addToPath(y,!1,!0,1,u),p=this.extractCommon(m,t,e,C,u),m.oldPos+1>=a&&p+1>=i)return D(this.buildValues(m.lastComponent,t,e))||!0;c[C]=m,m.oldPos+1>=a&&(h=Math.min(h,C-1)),p+1>=i&&(f=Math.max(f,C+1))}o++};if(r)(function C(){setTimeout(function(){if(o>s||Date.now()>l)return r(void 0);d()||C()},0)})();else for(;o<=s&&Date.now()<=l;){let C=d();if(C)return C}}addToPath(e,t,u,r,n){let D=e.lastComponent;return D&&!n.oneChangePerToken&&D.added===t&&D.removed===u?{oldPos:e.oldPos+r,lastComponent:{count:D.count+1,added:t,removed:u,previousComponent:D.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:u,previousComponent:D}}}extractCommon(e,t,u,r,n){let D=t.length,i=u.length,a=e.oldPos,o=a-r,s=0;for(;o+1<D&&a+1<i&&this.equals(u[a+1],t[o+1],n);)o++,a++,s++,n.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return s&&!n.oneChangePerToken&&(e.lastComponent={count:s,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=a,o}equals(e,t,u){return u.comparator?u.comparator(e,t):e===t||!!u.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let u=0;u<e.length;u++)e[u]&&t.push(e[u]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join("")}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,u){let r=[],n;for(;e;)r.push(e),n=e.previousComponent,delete e.previousComponent,e=n;r.reverse();let D=r.length,i=0,a=0,o=0;for(;i<D;i++){let s=r[i];if(s.removed)s.value=this.join(u.slice(o,o+s.count)),o+=s.count;else{if(!s.added&&this.useLongestToken){let F=t.slice(a,a+s.count);F=F.map(function(l,c){let p=u[o+c];return p.length>l.length?p:l}),s.value=this.join(F)}else s.value=this.join(t.slice(a,a+s.count));a+=s.count,s.added||(o+=s.count)}}return r}},Mu=class extends $u{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}},Ru=new Mu;function Vu(e,t,u){return Ru.diff(e,t,u)}var Wu=()=>{},zu=Wu,xt="cr",Nt="crlf",Ku="lf",Uu=Ku,Me="\r",Tt=`\r
|
|
2
|
+
`,Ce=`
|
|
3
|
+
`,qu=Ce;function Ju(e){let t=e.indexOf(Me);return t!==-1?e.charAt(t+1)===Ce?Nt:xt:Uu}function Re(e){return e===xt?Me:e===Nt?Tt:qu}var Gu=new Map([[Ce,/\n/g],[Me,/\r/g],[Tt,/\r\n/g]]);function Ot(e,t){let u=Gu.get(t);return e.match(u)?.length??0}var Hu=/\r\n?/g;function Yu(e){return he(0,e,Hu,Ce)}var Ee=Symbol.for("comments");function Xu(e){return this[e<0?this.length+e:e]}var Zu=se("at",function(){if(Array.isArray(this)||typeof this=="string")return Xu}),B=Zu,Z="string",j="array",q="cursor",$="indent",M="align",R="trim",k="group",_="fill",S="if-break",V="indent-if-break",W="line-suffix",z="line-suffix-boundary",v="line",I="label",N="break-parent",_t=new Set([q,$,M,R,k,_,S,V,W,z,v,I,N]);function Qu(e){let t=e.length;for(;t>0&&(e[t-1]==="\r"||e[t-1]===`
|
|
4
|
+
`);)t--;return t<e.length?e.slice(0,t):e}function Ve(e,t,u){if(!e.has(t)){let r=u(t);e.set(t,r)}return e.get(t)}function er(e){if(typeof e=="string")return Z;if(Array.isArray(e))return j;if(!e)return;let{type:t}=e;if(_t.has(t))return t}var Q=er,tr=e=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(e);function ur(e){let t=e===null?"null":typeof e;if(t!=="string"&&t!=="object")return`Unexpected doc '${t}',
|
|
5
|
+
Expected it to be 'string' or 'object'.`;if(Q(e))throw new Error("doc is valid.");let u=Object.prototype.toString.call(e);if(u!=="[object Object]")return`Unexpected doc '${u}'.`;let r=tr([..._t].map(n=>`'${n}'`));return`Unexpected doc.type '${e.type}'.
|
|
6
|
+
Expected it to be ${r}.`}var rr=class extends Error{name="InvalidDocError";constructor(e){super(ur(e)),this.doc=e}},re=rr,rt={};function nr(e,t,u,r){let n=[e];for(;n.length>0;){let D=n.pop();if(D===rt){u(n.pop());continue}u&&n.push(D,rt);let i=Q(D);if(!i)throw new re(D);if(t?.(D)!==!1)switch(i){case j:case _:{let a=i===j?D:D.parts;for(let o=a.length,s=o-1;s>=0;--s)n.push(a[s]);break}case S:n.push(D.flatContents,D.breakContents);break;case k:if(r&&D.expandedStates)for(let a=D.expandedStates.length,o=a-1;o>=0;--o)n.push(D.expandedStates[o]);else n.push(D.contents);break;case M:case $:case V:case I:case W:n.push(D.contents);break;case Z:case q:case R:case z:case v:case N:break;default:throw new re(D)}}}var We=nr;function me(e,t){if(typeof e=="string")return t(e);let u=new Map;return r(e);function r(D){return Ve(u,D,n)}function n(D){switch(Q(D)){case j:return t(D.map(r));case _:return t({...D,parts:D.parts.map(r)});case S:return t({...D,breakContents:r(D.breakContents),flatContents:r(D.flatContents)});case k:{let{expandedStates:i,contents:a}=D;return i?(i=i.map(r),a=i[0]):a=r(a),t({...D,contents:a,expandedStates:i})}case M:case $:case V:case I:case W:return t({...D,contents:r(D.contents)});case Z:case q:case R:case z:case v:case N:return t(D);default:throw new re(D)}}}function ze(e,t,u){let r=u,n=!1;function D(i){if(n)return!1;let a=t(i);a!==void 0&&(n=!0,r=a)}return We(e,D),r}function Dr(e){if(e.type===k&&e.break||e.type===v&&e.hard||e.type===N)return!0}function ir(e){return ze(e,Dr,!1)}function nt(e){if(e.length>0){let t=B(0,e,-1);!t.expandedStates&&!t.break&&(t.break="propagated")}return null}function or(e){let t=new Set,u=[];function r(D){if(D.type===N&&nt(u),D.type===k){if(u.push(D),t.has(D))return!1;t.add(D)}}function n(D){D.type===k&&u.pop().break&&nt(u)}We(e,r,n,!0)}function ar(e){return e.type===v&&!e.hard?e.soft?"":" ":e.type===S?e.flatContents:e}function sr(e){return me(e,ar)}function Dt(e){for(e=[...e];e.length>=2&&B(0,e,-2).type===v&&B(0,e,-1).type===N;)e.length-=2;if(e.length>0){let t=ie(B(0,e,-1));e[e.length-1]=t}return e}function ie(e){switch(Q(e)){case $:case V:case k:case W:case I:{let t=ie(e.contents);return{...e,contents:t}}case S:return{...e,breakContents:ie(e.breakContents),flatContents:ie(e.flatContents)};case _:return{...e,parts:Dt(e.parts)};case j:return Dt(e);case Z:return Qu(e);case M:case q:case R:case z:case v:case N:break;default:throw new re(e)}return e}function It(e){return ie(cr(e))}function lr(e){switch(Q(e)){case _:{let{parts:t}=e;if(t.every(u=>u===""))return"";if(t.length===1)return t[0];break}case k:if(!e.contents&&!e.id&&!e.break&&!e.expandedStates)return"";if(e.contents.type===k&&e.contents.id===e.id&&e.contents.break===e.break&&e.contents.expandedStates===e.expandedStates)return e.contents;break;case M:case $:case V:case W:if(!e.contents)return"";break;case S:if(!e.flatContents&&!e.breakContents)return"";break;case j:{let t=[];for(let u of e){if(!u)continue;let[r,...n]=Array.isArray(u)?u:[u];typeof r=="string"&&typeof B(0,t,-1)=="string"?t[t.length-1]+=r:t.push(r),t.push(...n)}return t.length===0?"":t.length===1?t[0]:t}case Z:case q:case R:case z:case v:case I:case N:break;default:throw new re(e)}return e}function cr(e){return me(e,t=>lr(t))}function fr(e,t=Vt){return me(e,u=>typeof u=="string"?$t(t,u.split(`
|
|
7
|
+
`)):u)}function Fr(e){if(e.type===v)return!0}function pr(e){return ze(e,Fr,!1)}function Fe(e,t){return e.type===I?{...e,contents:t(e.contents)}:t(e)}var dr=zu;function de(e){return{type:$,contents:e}}function ne(e,t){return{type:M,contents:t,n:e}}function hr(e){return ne(Number.NEGATIVE_INFINITY,e)}function Pt(e){return ne({type:"root"},e)}function Cr(e){return ne(-1,e)}function Lt(e,t,u){let r=e;if(t>0){for(let n=0;n<Math.floor(t/u);++n)r=de(r);r=ne(t%u,r),r=ne(Number.NEGATIVE_INFINITY,r)}return r}var ge={type:N},Y={type:q};function Er(e){return{type:_,parts:e}}function jt(e,t={}){return dr(t.expandedStates),{type:k,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function mr(e,t){return jt(e[0],{...t,expandedStates:e})}function gr(e,t="",u={}){return{type:S,breakContents:e,flatContents:t,groupId:u.groupId}}function yr(e,t){return{type:V,contents:e,groupId:t.groupId,negate:t.negate}}function $t(e,t){let u=[];for(let r=0;r<t.length;r++)r!==0&&u.push(e),u.push(t[r]);return u}function Br(e,t){return e?{type:I,label:e,contents:t}:t}var Mt={type:v},vr={type:v,soft:!0},Ke={type:v,hard:!0},L=[Ke,ge],Rt={type:v,hard:!0,literal:!0},Vt=[Rt,ge];function _e(e){return{type:W,contents:e}}var Ar={type:z},br={type:R};function P(e){if(!e)return"";if(Array.isArray(e)){let t=[];for(let u of e)if(Array.isArray(u))t.push(...P(u));else{let r=P(u);r!==""&&t.push(r)}return t}return e.type===S?{...e,breakContents:P(e.breakContents),flatContents:P(e.flatContents)}:e.type===k?{...e,contents:P(e.contents),expandedStates:e.expandedStates?.map(P)}:e.type===_?{type:"fill",parts:e.parts.map(P)}:e.contents?{...e,contents:P(e.contents)}:e}function wr(e){let t=Object.create(null),u=new Set;return r(P(e));function r(D,i,a){if(typeof D=="string")return JSON.stringify(D);if(Array.isArray(D)){let o=D.map(r).filter(Boolean);return o.length===1?o[0]:`[${o.join(", ")}]`}if(D.type===v){let o=a?.[i+1]?.type===N;return D.literal?o?"literalline":"literallineWithoutBreakParent":D.hard?o?"hardline":"hardlineWithoutBreakParent":D.soft?"softline":"line"}if(D.type===N)return a?.[i-1]?.type===v&&a[i-1].hard?void 0:"breakParent";if(D.type===R)return"trim";if(D.type===$)return"indent("+r(D.contents)+")";if(D.type===M)return D.n===Number.NEGATIVE_INFINITY?"dedentToRoot("+r(D.contents)+")":D.n<0?"dedent("+r(D.contents)+")":D.n.type==="root"?"markAsRoot("+r(D.contents)+")":"align("+JSON.stringify(D.n)+", "+r(D.contents)+")";if(D.type===S)return"ifBreak("+r(D.breakContents)+(D.flatContents?", "+r(D.flatContents):"")+(D.groupId?(D.flatContents?"":', ""')+`, { groupId: ${n(D.groupId)} }`:"")+")";if(D.type===V){let o=[];D.negate&&o.push("negate: true"),D.groupId&&o.push(`groupId: ${n(D.groupId)}`);let s=o.length>0?`, { ${o.join(", ")} }`:"";return`indentIfBreak(${r(D.contents)}${s})`}if(D.type===k){let o=[];D.break&&D.break!=="propagated"&&o.push("shouldBreak: true"),D.id&&o.push(`id: ${n(D.id)}`);let s=o.length>0?`, { ${o.join(", ")} }`:"";return D.expandedStates?`conditionalGroup([${D.expandedStates.map(F=>r(F)).join(",")}]${s})`:`group(${r(D.contents)}${s})`}if(D.type===_)return`fill([${D.parts.map(o=>r(o)).join(", ")}])`;if(D.type===W)return"lineSuffix("+r(D.contents)+")";if(D.type===z)return"lineSuffixBoundary";if(D.type===I)return`label(${JSON.stringify(D.label)}, ${r(D.contents)})`;if(D.type===q)return"cursor";throw new Error("Unknown doc type "+D.type)}function n(D){if(typeof D!="symbol")return JSON.stringify(String(D));if(D in t)return t[D];let i=D.description||"symbol";for(let a=0;;a++){let o=i+(a>0?` #${a}`:"");if(!u.has(o))return u.add(o),t[D]=`Symbol.for(${JSON.stringify(o)})`}}}var kr=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED9\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEFA](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDEC2\uDEC6\uDEC8\uDECC-\uDEDD\uDEDF-\uDEEB\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g,Sr=12288,xr=65510,Nr=[12288,12288,65281,65376,65504,65510],Tr=4352,Or=262141,Wt=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101594,101631,101664,101760,101874,101888,102801,102816,102866,110576,110579,110581,110587,110589,110590,110592,110888,110898,110898,110928,110930,110933,110933,110948,110952,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127406,127406,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128729,128732,128735,128747,128748,128756,128764,128986,128986,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129734,129736,129736,129740,129757,129759,129771,129775,129786,131072,196605,196608,262141],zt=(e,t)=>{let u=0,r=Math.floor(e.length/2)-1;for(;u<=r;){let n=Math.floor((u+r)/2),D=n*2;if(t<e[D])r=n-1;else if(t>e[D+1])u=n+1;else return!0}return!1},it=19968,[_r,Ir]=Pr(Wt);function Pr(e){let t=e[0],u=e[1];for(let r=0;r<e.length;r+=2){let n=e[r],D=e[r+1];if(it>=n&&it<=D)return[n,D];D-n>u-t&&(t=n,u=D)}return[t,u]}var Lr=e=>e<Sr||e>xr?!1:zt(Nr,e),jr=e=>e>=_r&&e<=Ir?!0:e<Tr||e>Or?!1:zt(Wt,e),$r=/^(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u2764\u27A1\u2934\u2935\u2B05-\u2B07]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF3\uDFF5\uDFF7]|\uD83D[\uDC3F\uDC41\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])$/,Mr=e=>$r.test(e),Rr=/[^\x20-\x7F]/,Vr=/[\p{Nonspacing_Mark}\p{Enclosing_Mark}]/u;function Wr(e){if(!e)return 0;if(!Rr.test(e))return e.length;let t=0;e=e.replace(kr(),u=>(t+=Mr(u)?1:2,""));for(let u of e){let r=u.codePointAt(0);r<=31||r>=127&&r<=159||Vr.test(u)||(t+=Lr(r)||jr(r)?2:1)}return t}var Ue=Wr,zr={type:0},Kr={type:1},Kt={value:"",length:0,queue:[],get root(){return Kt}};function Ut(e,t,u){let r=t.type===1?e.queue.slice(0,-1):[...e.queue,t],n="",D=0,i=0,a=0;for(let f of r)switch(f.type){case 0:F(),u.useTabs?o(1):s(u.tabWidth);break;case 3:{let{string:h}=f;F(),n+=h,D+=h.length;break}case 2:{let{width:h}=f;i+=1,a+=h;break}default:throw new Error(`Unexpected indent comment '${f.type}'.`)}return c(),{...e,value:n,length:D,queue:r};function o(f){n+=" ".repeat(f),D+=u.tabWidth*f}function s(f){n+=" ".repeat(f),D+=f}function F(){u.useTabs?l():c()}function l(){i>0&&o(i),p()}function c(){a>0&&s(a),p()}function p(){i=0,a=0}}function Ur(e,t,u){if(!t)return e;if(t.type==="root")return{...e,root:e};if(t===Number.NEGATIVE_INFINITY)return e.root;let r;return typeof t=="number"?t<0?r=Kr:r={type:2,width:t}:r={type:3,string:t},Ut(e,r,u)}function qr(e,t){return Ut(e,zr,t)}function Jr(e){let t=0;for(let u=e.length-1;u>=0;u--){let r=e[u];if(r===" "||r===" ")t++;else break}return t}function qt(e){let t=Jr(e);return{text:t===0?e:e.slice(0,e.length-t),count:t}}var Gr=class{#t=[];#e="";#r=0;#n=[];#u=[];#D(){let e=this.#e;e!==""&&(this.#t.push(e),this.#r+=e.length,this.#e="");for(let t of this.#u)this.#n.push(Math.min(t,this.#r));this.#u.length=0}markPosition(){if(this.#n.length+this.#u.length>=2)throw new Error("There are too many 'cursor' in doc.");this.#u.push(this.#r+this.#e.length)}write(e){this.#e+=e}trim(){let{text:e,count:t}=qt(this.#e);return this.#e=e,this.#D(),t}finish(){return this.#D(),{text:this.#t.join(""),positions:this.#n}}},Hr=Gr,x=Symbol("MODE_BREAK"),T=Symbol("MODE_FLAT"),Ie=Symbol("DOC_FILL_PRINTED_LENGTH");function fe(e,t,u,r,n,D){if(u===Number.POSITIVE_INFINITY)return!0;let i=t.length,a=!1,o=[e],s="";for(;u>=0;){if(o.length===0){if(i===0)return!0;o.push(t[--i]);continue}let{mode:F,doc:l}=o.pop(),c=Q(l);switch(c){case Z:l&&(a&&(s+=" ",u-=1,a=!1),s+=l,u-=Ue(l));break;case j:case _:{let p=c===j?l:l.parts,f=l[Ie]??0;for(let h=p.length-1;h>=f;h--)o.push({mode:F,doc:p[h]});break}case $:case M:case V:case I:o.push({mode:F,doc:l.contents});break;case R:{let{text:p,count:f}=qt(s);s=p,u+=f;break}case k:{if(D&&l.break)return!1;let p=l.break?x:F,f=l.expandedStates&&p===x?B(0,l.expandedStates,-1):l.contents;o.push({mode:p,doc:f});break}case S:{let p=(l.groupId?n[l.groupId]||T:F)===x?l.breakContents:l.flatContents;p&&o.push({mode:F,doc:p});break}case v:if(F===x||l.hard)return!0;l.soft||(a=!0);break;case W:r=!0;break;case z:if(r)return!1;break}}return!1}function ye(e,t){let u=Object.create(null),r=t.printWidth,n=Re(t.endOfLine),D=0,i=[{indent:Kt,mode:x,doc:e}],a=!1,o=[],s=new Hr;for(or(e);i.length>0;){let{indent:f,mode:h,doc:d}=i.pop();switch(Q(d)){case Z:{let C=n!==`
|
|
8
|
+
`?he(0,d,`
|
|
9
|
+
`,n):d;C&&(s.write(C),i.length>0&&(D+=Ue(C)));break}case j:for(let C=d.length-1;C>=0;C--)i.push({indent:f,mode:h,doc:d[C]});break;case q:s.markPosition();break;case $:i.push({indent:qr(f,t),mode:h,doc:d.contents});break;case M:i.push({indent:Ur(f,d.n,t),mode:h,doc:d.contents});break;case R:D-=s.trim();break;case k:{let C=(function(){if(h===T&&!a)return{indent:f,mode:d.break?x:T,doc:d.contents};a=!1;let m=r-D,y=o.length>0,g={indent:f,mode:T,doc:d.contents};if(!d.break&&fe(g,i,m,y,u))return g;if(!d.expandedStates)return{indent:f,mode:x,doc:d.contents};if(!d.break)for(let b=1;b<d.expandedStates.length-1;b++){let A={indent:f,mode:T,doc:d.expandedStates[b]};if(fe(A,i,m,y,u))return A}return{indent:f,mode:x,doc:B(0,d.expandedStates,-1)}})();i.push(C),d.id&&(u[d.id]=C.mode);break}case _:{let C=r-D,m=d[Ie]??0,{parts:y}=d,g=y.length-m;if(g===0)break;let b=y[m+0],A=y[m+1],w={indent:f,mode:T,doc:b},ee={indent:f,mode:x,doc:b},be=fe(w,[],C,o.length>0,u,!0);if(g===1){be?i.push(w):i.push(ee);break}let ut={indent:f,mode:T,doc:A},we={indent:f,mode:x,doc:A};if(g===2){be?i.push(ut,w):i.push(we,ee);break}let Tu=y[m+2],Ou={indent:f,mode:h,doc:{...d,[Ie]:m+2}},_u=fe({indent:f,mode:T,doc:[b,A,Tu]},[],C,o.length>0,u,!0);i.push(Ou),_u?i.push(ut,w):be?i.push(we,w):i.push(we,ee);break}case S:case V:{let C=d.groupId?u[d.groupId]:h;if(C===x){let m=d.type===S?d.breakContents:d.negate?d.contents:de(d.contents);m&&i.push({indent:f,mode:h,doc:m})}if(C===T){let m=d.type===S?d.flatContents:d.negate?de(d.contents):d.contents;m&&i.push({indent:f,mode:h,doc:m})}break}case W:o.push({indent:f,mode:h,doc:d.contents});break;case z:o.length>0&&i.push({indent:f,mode:h,doc:Ke});break;case v:switch(h){case T:if(!d.hard){d.soft||(s.write(" "),D+=1);break}a=!0;case x:if(o.length>0){i.push({indent:f,mode:h,doc:d},...o.reverse()),o.length=0;break}d.literal?(s.write(n),D=0,f.root&&(f.root.value&&s.write(f.root.value),D=f.root.length)):(s.trim(),s.write(n+f.value),D=f.length);break}break;case I:i.push({indent:f,mode:h,doc:d.contents});break;case N:break;default:throw new re(d)}i.length===0&&o.length>0&&(i.push(...o.reverse()),o.length=0)}let{text:F,positions:l}=s.finish();if(l.length!==2)return{formatted:F};let[c,p]=l;return{formatted:F,cursorNodeStart:c,cursorNodeText:F.slice(c,p)}}var Yr=e=>e.charAt(0)==="\uFEFF",Xr=e=>"\uFEFF"+e;function Zr(e,t,u=0){let r=0;for(let n=u;n<e.length;++n)e[n]===" "?r=r+t-r%t:r++;return r}var qe=Zr,Qr=class{constructor(e){this.stack=[e]}get key(){let{stack:e,siblings:t}=this;return B(0,e,t===null?-2:-4)??null}get index(){return this.siblings===null?null:B(0,this.stack,-2)}get node(){return B(0,this.stack,-1)}get parent(){return this.getNode(1)}get grandparent(){return this.getNode(2)}get isInArray(){return this.siblings!==null}get siblings(){let{stack:e}=this,t=B(0,e,-3);return Array.isArray(t)?t:null}get next(){let{siblings:e}=this;return e===null?null:e[this.index+1]}get previous(){let{siblings:e}=this;return e===null?null:e[this.index-1]}get isFirst(){return this.index===0}get isLast(){let{siblings:e,index:t}=this;return e!==null&&t===e.length-1}get isRoot(){return this.stack.length===1}get root(){return this.stack[0]}get ancestors(){return[...this.#e()]}getName(){let{stack:e}=this,{length:t}=e;return t>1?B(0,e,-2):null}getValue(){return B(0,this.stack,-1)}getNode(e=0){let t=this.#t(e);return t===-1?null:this.stack[t]}getParentNode(e=0){return this.getNode(e+1)}#t(e){let{stack:t}=this;for(let u=t.length-1;u>=0;u-=2)if(!Array.isArray(t[u])&&--e<0)return u;return-1}call(e,...t){let{stack:u}=this,{length:r}=u,n=B(0,u,-1);for(let D of t)n=n?.[D],u.push(D,n);try{return e(this)}finally{u.length=r}}callParent(e,t=0){let u=this.#t(t+1),r=this.stack.splice(u+1);try{return e(this)}finally{this.stack.push(...r)}}each(e,...t){let{stack:u}=this,{length:r}=u,n=B(0,u,-1);for(let D of t)n=n[D],u.push(D,n);try{for(let D=0;D<n.length;++D)u.push(D,n[D]),e(this,D,n),u.length-=2}finally{u.length=r}}map(e,...t){let u=[];return this.each((r,n,D)=>{u[n]=e(r,n,D)},...t),u}match(...e){let t=this.stack.length-1,u=null,r=this.stack[t--];for(let n of e){if(r===void 0)return!1;let D=null;if(typeof u=="number"&&(D=u,u=this.stack[t--],r=this.stack[t--]),n&&!n(r,u,D))return!1;u=this.stack[t--],r=this.stack[t--]}return!0}findAncestor(e){for(let t of this.#e())if(e(t))return t}hasAncestor(e){for(let t of this.#e())if(e(t))return!0;return!1}*#e(){let{stack:e}=this;for(let t=e.length-3;t>=0;t-=2){let u=e[t];Array.isArray(u)||(yield u)}}},en=Qr;function tn(e){return Array.isArray(e)&&e.length>0}var Jt=tn;function un(e){return e!==null&&typeof e=="object"}var Je=un;function le(e){return(t,u,r)=>{if(u===!1)return!1;let n=!!r?.backwards,{length:D}=t,i=u;for(;i>=0&&i<D;){let a=t.charAt(i);if(e instanceof RegExp){if(!e.test(a))return i}else if(!e.includes(a))return i;n?i--:i++}return i===-1||i===D?i:!1}}var rn=le(/\s/),U=le(" "),Gt=le(",; "),Ht=le(/[^\n\r]/),ot=e=>e===`
|
|
10
|
+
`||e==="\r"||e==="\u2028"||e==="\u2029";function nn(e,t,u){if(t===!1)return!1;let r=!!u?.backwards,n=e.charAt(t);if(r){if(e.charAt(t-1)==="\r"&&n===`
|
|
11
|
+
`)return t-2;if(ot(n))return t-1}else{if(n==="\r"&&e.charAt(t+1)===`
|
|
12
|
+
`)return t+2;if(ot(n))return t+1}return t}var X=nn;function Dn(e,t,u={}){let r=U(e,u.backwards?t-1:t,u),n=X(e,r,u);return r!==n}var K=Dn;function*Be(e,t){let{getVisitorKeys:u,filter:r=()=>!0}=t,n=D=>Je(D)&&r(D);for(let D of u(e)){let i=e[D];if(Array.isArray(i))for(let a of i)n(a)&&(yield a);else n(i)&&(yield i)}}function*on(e,t){let u=[e];for(let r=0;r<u.length;r++){let n=u[r];for(let D of Be(n,t))yield D,u.push(D)}}function an(e,t){return Be(e,t).next().done}function sn(e,t,u){let{filter:r}=u;if(!r)return[];let n,D=(u.getChildren?.(e,u)??[...Be(e,{getVisitorKeys:u.getVisitorKeys})]).flatMap(o=>(n??(n=[e,...t]),r(o,n)?[o]:Yt(o,n,u))),{locStart:i,locEnd:a}=u;return D.sort((o,s)=>i(o)-i(s)||a(o)-a(s)),D}function Yt(e,t,u){return Ve(u.cache,e,r=>sn(r,t,u))}var Xt=Yt;function ln(e){let t=e.type||e.kind||"(unknown type)",u=String(e.name||e.id&&(typeof e.id=="object"?e.id.name:e.id)||e.key&&(typeof e.key=="object"?e.key.name:e.key)||e.value&&(typeof e.value=="object"?"":String(e.value))||e.operator||"");return u.length>20&&(u=u.slice(0,19)+"…"),t+(u?" "+u:"")}function Ge(e,t){return(e.comments??(e.comments=[])).push(t),t.printed=!1,t.nodeDescription=ln(e),!0}function oe(e,t){return t.leading=!0,t.trailing=!1,Ge(e,t)}function G(e,t,u){return t.leading=!1,t.trailing=!1,u&&(t.marker=u),Ge(e,t)}function ae(e,t){return t.leading=!1,t.trailing=!0,Ge(e,t)}var Zt=new WeakMap;function Qt(e,t,u,r,n=[]){let{locStart:D,locEnd:i}=u,a=D(t),o=i(t),s=Xt(e,n,{cache:Zt,locStart:D,locEnd:i,getVisitorKeys:u.getVisitorKeys,filter:u.printer.canAttachComment,getChildren:u.printer.getCommentChildNodes}),F,l,c=0,p=s.length;for(;c<p;){let f=c+p>>1,h=s[f],d=D(h),C=i(h);if(d<=a&&o<=C)return Qt(h,t,u,h,[h,...n]);if(C<=a){F=h,c=f+1;continue}if(o<=d){l=h,p=f;continue}throw new Error("Comment location overlaps with node location")}if(r?.type==="TemplateLiteral"){let{quasis:f}=r,h=Se(f,t,u);F&&Se(f,F,u)!==h&&(F=null),l&&Se(f,l,u)!==h&&(l=null)}return{enclosingNode:r,precedingNode:F,followingNode:l,ancestors:n}}var ke=()=>!1;function cn(e,t){let{comments:u}=e;if(delete e.comments,!Jt(u)||!t.printer.canAttachComment)return;let r=[],{printer:{features:{experimental_avoidAstMutation:n},handleComments:D={}},originalText:i}=t,{ownLine:a=ke,endOfLine:o=ke,remaining:s=ke}=D,F=u.map((c,p)=>({...Qt(e,c,t),comment:c,text:i,options:t,ast:e,isLastComment:u.length-1===p,placement:void 0})),l=!n;for(let[c,p]of F.entries()){let{comment:f,precedingNode:h,enclosingNode:d,followingNode:C,text:m,options:y,ast:g,isLastComment:b}=p,A=fn(m,y,F,c)?"ownLine":Fn(m,y,F,c)?"endOfLine":"remaining",w;if(n?(p.placement=A,w=[p]):w=[f,m,y,g,b],l&&(f.enclosingNode=d,f.precedingNode=h,f.followingNode=C),f.placement=A,A==="ownLine")a(...w)||(C?oe(C,f):h?ae(h,f):G(d||g,f));else if(A==="endOfLine")o(...w)||(h?ae(h,f):C?oe(C,f):G(d||g,f));else if(!s(...w))if(h&&C){let ee=r.length;ee>0&&r[ee-1].followingNode!==C&&at(r,y),r.push(p)}else h?ae(h,f):C?oe(C,f):G(d||g,f)}if(at(r,t),l)for(let c of u)delete c.precedingNode,delete c.enclosingNode,delete c.followingNode}var eu=e=>!/[\S\n\u2028\u2029]/.test(e);function fn(e,t,u,r){let{comment:n,precedingNode:D}=u[r],{locStart:i,locEnd:a}=t,o=i(n);if(D)for(let s=r-1;s>=0;s--){let{comment:F,precedingNode:l}=u[s];if(l!==D||!eu(e.slice(a(F),o)))break;o=i(F)}return K(e,o,{backwards:!0})}function Fn(e,t,u,r){let{comment:n,followingNode:D}=u[r],{locStart:i,locEnd:a}=t,o=a(n);if(D)for(let s=r+1;s<u.length;s++){let{comment:F,followingNode:l}=u[s];if(l!==D||!eu(e.slice(o,i(F))))break;o=a(F)}return K(e,o)}function at(e,t){let u=e.length;if(u===0)return;let{precedingNode:r,followingNode:n}=e[0],D=t.locStart(n),i;for(i=u;i>0;--i){let{comment:a,precedingNode:o,followingNode:s}=e[i-1],F=t.originalText.slice(t.locEnd(a),D);if(t.printer.isGap?.(F,t)??/^[\s(]*$/.test(F))D=t.locStart(a);else break}for(let[a,{comment:o}]of e.entries())a<i?ae(r,o):oe(n,o);for(let a of[r,n])a.comments&&a.comments.length>1&&a.comments.sort((o,s)=>t.locStart(o)-t.locStart(s));e.length=0}function Se(e,t,u){let r=u.locStart(t)-1;for(let n=1;n<e.length;++n)if(r<u.locStart(e[n]))return n-1;return 0}function pn(e,t){let u=t-1;u=U(e,u,{backwards:!0}),u=X(e,u,{backwards:!0}),u=U(e,u,{backwards:!0});let r=X(e,u,{backwards:!0});return u!==r}var He=pn,tu=()=>!0;function uu(e,t){let u=e.node;return u.printed=!0,t.printer.printComment(e,t)}function dn(e,t){let u=e.node,r=[uu(e,t)],{printer:n,originalText:D,locStart:i,locEnd:a}=t;if(n.isBlockComment?.(u)){let s=" ";K(D,a(u))&&(K(D,i(u),{backwards:!0})?s=L:s=Mt),r.push(s)}else r.push(L);let o=X(D,U(D,a(u)));return o!==!1&&K(D,o)&&r.push(L),r}function hn(e,t,u){let r=e.node,n=uu(e,t),{printer:D,originalText:i,locStart:a}=t,o=D.isBlockComment?.(r);if(u?.hasLineSuffix&&!u?.isBlock||K(i,a(r),{backwards:!0})){let s=He(i,a(r));return{doc:_e([L,s?L:"",n]),isBlock:o,hasLineSuffix:!0}}return!o||u?.hasLineSuffix?{doc:[_e([" ",n]),ge],isBlock:o,hasLineSuffix:!0}:{doc:[" ",n],isBlock:o,hasLineSuffix:!1}}function Cn(e,t,u){let r=t[Symbol.for("printedComments")],n=tu,D=new Set(e.node?.comments?.filter(i=>!r?.has(i)&&i.leading&&n(i)));return D.size===0?"":e.map(({node:i})=>D.has(i)?dn(e,t):"","comments").filter(Boolean)}function En(e,t,u){let r=e.node?.comments,n=new Set(r?.filter(F=>F.trailing)),D=t[Symbol.for("printedComments")],i=tu,a=new Set(r?.filter(F=>n.has(F)&&!D?.has(F)&&i(F)));if(a.size===0)return"";let o=[],s;return e.each(({node:F})=>{n.has(F)&&(s=hn(e,t,s),a.has(F)&&o.push(s.doc))},"comments"),o}function mn(e,t,u,r){let n=Cn(e,u),D=En(e,u);return n||D?Fe(t,i=>[n,i,D]):t}function gn(e){let{[Ee]:t,[Symbol.for("printedComments")]:u}=e;for(let r of t){if(!r.printed&&!u.has(r))throw new Error('Comment "'+r.value.trim()+'" was not printed. Please report this error!');delete r.printed}}var ru=class extends Error{name="ConfigError"},st=class extends Error{name="UndefinedParserError"},yn=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),ve=yn,Bn={checkIgnorePragma:{category:"Special",type:"boolean",default:!1,description:"Check whether the file's first docblock comment contains '@noprettier' or '@noformat' to determine if it should be formatted.",cliCategory:"Other"},cursorOffset:{category:"Special",type:"int",default:-1,range:{start:-1,end:1/0,step:1},description:"Print (to stderr) where a cursor at the given position would move to after formatting.",cliCategory:"Editor"},endOfLine:{category:"Global",type:"choice",default:"lf",description:"Which end of line characters to apply.",choices:[{value:"lf",description:"Line Feed only (\\n), common on Linux and macOS as well as inside git repos"},{value:"crlf",description:"Carriage Return + Line Feed characters (\\r\\n), common on Windows"},{value:"cr",description:"Carriage Return character only (\\r), used very rarely"},{value:"auto",description:`Maintain existing
|
|
13
|
+
(mixed values within one file are normalised by looking at what's used after the first line)`}]},filepath:{category:"Special",type:"path",description:"Specify the input filepath. This will be used to do parser inference.",cliName:"stdin-filepath",cliCategory:"Other",cliDescription:"Path to the file to pretend that stdin comes from."},insertPragma:{category:"Special",type:"boolean",default:!1,description:"Insert @format pragma into file's first docblock comment.",cliCategory:"Other"},parser:{category:"Global",type:"choice",default:void 0,description:"Which parser to use.",exception:e=>typeof e=="string"||typeof e=="function",choices:[{value:"flow",description:"Flow"},{value:"babel",description:"JavaScript"},{value:"babel-flow",description:"Flow"},{value:"babel-ts",description:"TypeScript"},{value:"typescript",description:"TypeScript"},{value:"acorn",description:"JavaScript"},{value:"espree",description:"JavaScript"},{value:"meriyah",description:"JavaScript"},{value:"css",description:"CSS"},{value:"less",description:"Less"},{value:"scss",description:"SCSS"},{value:"json",description:"JSON"},{value:"json5",description:"JSON5"},{value:"jsonc",description:"JSON with Comments"},{value:"json-stringify",description:"JSON.stringify"},{value:"graphql",description:"GraphQL"},{value:"markdown",description:"Markdown"},{value:"mdx",description:"MDX"},{value:"vue",description:"Vue"},{value:"yaml",description:"YAML"},{value:"glimmer",description:"Ember / Handlebars"},{value:"html",description:"HTML"},{value:"angular",description:"Angular"},{value:"lwc",description:"Lightning Web Components"},{value:"mjml",description:"MJML"}]},plugins:{type:"path",array:!0,default:[{value:[]}],category:"Global",description:"Add a plugin. Multiple plugins can be passed as separate `--plugin`s.",exception:e=>typeof e=="string"||typeof e=="object",cliName:"plugin",cliCategory:"Config"},printWidth:{category:"Global",type:"int",default:80,description:"The line length where Prettier will try wrap.",range:{start:0,end:1/0,step:1}},rangeEnd:{category:"Special",type:"int",default:1/0,range:{start:0,end:1/0,step:1},description:`Format code ending at a given character offset (exclusive).
|
|
14
|
+
The range will extend forwards to the end of the selected statement.`,cliCategory:"Editor"},rangeStart:{category:"Special",type:"int",default:0,range:{start:0,end:1/0,step:1},description:`Format code starting at a given character offset.
|
|
15
|
+
The range will extend backwards to the start of the first line containing the selected statement.`,cliCategory:"Editor"},requirePragma:{category:"Special",type:"boolean",default:!1,description:"Require either '@prettier' or '@format' to be present in the file's first docblock comment in order for it to be formatted.",cliCategory:"Other"},tabWidth:{type:"int",category:"Global",default:2,description:"Number of spaces per indentation level.",range:{start:0,end:1/0,step:1}},useTabs:{category:"Global",type:"boolean",default:!1,description:"Indent with tabs instead of spaces."},embeddedLanguageFormatting:{category:"Global",type:"choice",default:"auto",description:"Control how Prettier formats quoted code embedded in the file.",choices:[{value:"auto",description:"Format embedded code if Prettier can automatically identify it."},{value:"off",description:"Never automatically format embedded code."}]}};function nu({plugins:e=[],showDeprecated:t=!1}={}){let u=e.flatMap(n=>n.languages??[]),r=[];for(let n of An(Object.assign({},...e.map(({options:D})=>D),Bn)))!t&&n.deprecated||(Array.isArray(n.choices)&&(t||(n.choices=n.choices.filter(D=>!D.deprecated)),n.name==="parser"&&(n.choices=[...n.choices,...vn(n.choices,u,e)])),n.pluginDefaults=Object.fromEntries(e.filter(D=>D.defaultOptions?.[n.name]!==void 0).map(D=>[D.name,D.defaultOptions[n.name]])),r.push(n));return{languages:u,options:r}}function*vn(e,t,u){let r=new Set(e.map(n=>n.value));for(let n of t)if(n.parsers){for(let D of n.parsers)if(!r.has(D)){r.add(D);let i=u.find(o=>o.parsers&&ve(o.parsers,D)),a=n.name;i?.name&&(a+=` (plugin: ${i.name})`),yield{value:D,description:a}}}}function An(e){let t=[];for(let[u,r]of Object.entries(e)){let n={name:u,...r};Array.isArray(n.default)&&(n.default=B(0,n.default,-1).value),t.push(n)}return t}var bn=Array.prototype.toReversed??function(){return[...this].reverse()},wn=se("toReversed",function(){if(Array.isArray(this))return bn}),kn=wn;function Sn(){let e=globalThis,t=e.process?.platform;if(typeof t=="string")return t.startsWith("win");let u=e.Deno?.build?.os;return typeof u=="string"?u==="windows":e.navigator?.platform?.startsWith("Win")??!1}var xn=Sn();function Du(e){if(e=e instanceof URL?e:new URL(e),e.protocol!=="file:")throw new TypeError(`URL must be a file URL: received "${e.protocol}"`);return e}function Nn(e){return e=Du(e),decodeURIComponent(e.pathname.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"))}function Tn(e){e=Du(e);let t=decodeURIComponent(e.pathname.replace(/\//g,"\\").replace(/%(?![0-9A-Fa-f]{2})/g,"%25")).replace(/^\\*([A-Za-z]:)(\\|$)/,"$1\\");return e.hostname!==""&&(t=`\\\\${e.hostname}${t}`),t}function On(e){return xn?Tn(e):Nn(e)}var _n=e=>String(e).split(/[/\\]/).pop(),In=e=>String(e).startsWith("file:");function lt(e,t){if(!t)return;let u=_n(t).toLowerCase();return e.find(({filenames:r})=>r?.some(n=>n.toLowerCase()===u))??e.find(({extensions:r})=>r?.some(n=>u.endsWith(n)))}function Pn(e,t){if(t)return e.find(({name:u})=>u.toLowerCase()===t)??e.find(({aliases:u})=>u?.includes(t))??e.find(({extensions:u})=>u?.includes(`.${t}`))}var Ln=void 0;function ct(e,t){if(t){if(In(t))try{t=On(t)}catch{return}if(typeof t=="string")return e.find(({isSupported:u})=>u?.({filepath:t}))}}function jn(e,t){let u=kn(0,e.plugins).flatMap(r=>r.languages??[]);return(Pn(u,t.language)??lt(u,t.physicalFile)??lt(u,t.file)??ct(u,t.physicalFile)??ct(u,t.file)??Ln?.(u,t.physicalFile))?.parsers[0]}var iu=jn,ue={key:e=>/^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(e)?e:JSON.stringify(e),value(e){if(e===null||typeof e!="object")return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(u=>ue.value(u)).join(", ")}]`;let t=Object.keys(e);return t.length===0?"{}":`{ ${t.map(u=>`${ue.key(u)}: ${ue.value(e[u])}`).join(", ")} }`},pair:({key:e,value:t})=>ue.value({[e]:t})},ou=new Proxy(String,{get:()=>ou}),O=ou,$n=(e,t,{descriptor:u})=>{let r=[`${O.yellow(typeof e=="string"?u.key(e):u.pair(e))} is deprecated`];return t&&r.push(`we now treat it as ${O.blue(typeof t=="string"?u.key(t):u.pair(t))}`),r.join("; ")+"."},au=Symbol.for("vnopts.VALUE_NOT_EXIST"),pe=Symbol.for("vnopts.VALUE_UNCHANGED"),ft=" ".repeat(2),Mn=(e,t,u)=>{let{text:r,list:n}=u.normalizeExpectedResult(u.schemas[e].expected(u)),D=[];return r&&D.push(Ft(e,t,r,u.descriptor)),n&&D.push([Ft(e,t,n.title,u.descriptor)].concat(n.values.map(i=>su(i,u.loggerPrintWidth))).join(`
|
|
16
|
+
`)),lu(D,u.loggerPrintWidth)};function Ft(e,t,u,r){return[`Invalid ${O.red(r.key(e))} value.`,`Expected ${O.blue(u)},`,`but received ${t===au?O.gray("nothing"):O.red(r.value(t))}.`].join(" ")}function su({text:e,list:t},u){let r=[];return e&&r.push(`- ${O.blue(e)}`),t&&r.push([`- ${O.blue(t.title)}:`].concat(t.values.map(n=>su(n,u-ft.length).replace(/^|\n/g,`$&${ft}`))).join(`
|
|
17
|
+
`)),lu(r,u)}function lu(e,t){if(e.length===1)return e[0];let[u,r]=e,[n,D]=e.map(i=>i.split(`
|
|
18
|
+
`,1)[0].length);return n>t&&n>D?r:u}var te=[],xe=[];function Ne(e,t,u){if(e===t)return 0;let r=u?.maxDistance,n=e;e.length>t.length&&(e=t,t=n);let D=e.length,i=t.length;for(;D>0&&e.charCodeAt(~-D)===t.charCodeAt(~-i);)D--,i--;let a=0;for(;a<D&&e.charCodeAt(a)===t.charCodeAt(a);)a++;if(D-=a,i-=a,r!==void 0&&i-D>r)return r;if(D===0)return r!==void 0&&i>r?r:i;let o,s,F,l,c=0,p=0;for(;c<D;)xe[c]=e.charCodeAt(a+c),te[c]=++c;for(;p<i;){for(o=t.charCodeAt(a+p),F=p++,s=p,c=0;c<D;c++)l=o===xe[c]?F:F+1,F=te[c],s=te[c]=F>s?l>s?s+1:l:l>F?F+1:l;if(r!==void 0){let f=s;for(c=0;c<D;c++)te[c]<f&&(f=te[c]);if(f>r)return r}}return te.length=D,xe.length=D,r!==void 0&&s>r?r:s}function Rn(e,t,u){if(!Array.isArray(t)||t.length===0)return;let r=u?.maxDistance,n=e.length;for(let o of t)if(o===e)return o;if(r===0)return;let D,i=Number.POSITIVE_INFINITY,a=new Set;for(let o of t){if(a.has(o))continue;a.add(o);let s=Math.abs(o.length-n);if(s>=i||r!==void 0&&s>r)continue;let F=Number.isFinite(i)?r===void 0?i:Math.min(i,r):r,l=F===void 0?Ne(e,o):Ne(e,o,{maxDistance:F});if(r!==void 0&&l>r)continue;let c=l;if(F!==void 0&&l===F&&F===r&&(c=Ne(e,o)),c<i&&(i=c,D=o,i===0))break}if(!(r!==void 0&&i>r))return D}var cu=(e,t,{descriptor:u,logger:r,schemas:n})=>{let D=[`Ignored unknown option ${O.yellow(u.pair({key:e,value:t}))}.`],i=Rn(e,Object.keys(n),{maxDistance:3});i&&D.push(`Did you mean ${O.blue(u.key(i))}?`),r.warn(D.join(" "))},Vn=["default","expected","validate","deprecated","forward","redirect","overlap","preprocess","postprocess"];function Wn(e,t){let u=new e(t),r=Object.create(u);for(let n of Vn)n in t&&(r[n]=zn(t[n],u,J.prototype[n].length));return r}var J=class{static create(e){return Wn(this,e)}constructor(e){this.name=e.name}default(e){}expected(e){return"nothing"}validate(e,t){return!1}deprecated(e,t){return!1}forward(e,t){}redirect(e,t){}overlap(e,t,u){return e}preprocess(e,t){return e}postprocess(e,t){return pe}};function zn(e,t,u){return typeof e=="function"?(...r)=>e(...r.slice(0,u-1),t,...r.slice(u-1)):()=>e}var Kn=class extends J{constructor(e){super(e),this._sourceName=e.sourceName}expected(e){return e.schemas[this._sourceName].expected(e)}validate(e,t){return t.schemas[this._sourceName].validate(e,t)}redirect(e,t){return this._sourceName}},Un=class extends J{expected(){return"anything"}validate(){return!0}},qn=class extends J{constructor({valueSchema:e,name:t=e.name,...u}){super({...u,name:t}),this._valueSchema=e}expected(e){let{text:t,list:u}=e.normalizeExpectedResult(this._valueSchema.expected(e));return{text:t&&`an array of ${t}`,list:u&&{title:"an array of the following values",values:[{list:u}]}}}validate(e,t){if(!Array.isArray(e))return!1;let u=[];for(let r of e){let n=t.normalizeValidateResult(this._valueSchema.validate(r,t),r);n!==!0&&u.push(n.value)}return u.length===0?!0:{value:u}}deprecated(e,t){let u=[];for(let r of e){let n=t.normalizeDeprecatedResult(this._valueSchema.deprecated(r,t),r);n!==!1&&u.push(...n.map(({value:D})=>({value:[D]})))}return u}forward(e,t){let u=[];for(let r of e){let n=t.normalizeForwardResult(this._valueSchema.forward(r,t),r);u.push(...n.map(pt))}return u}redirect(e,t){let u=[],r=[];for(let n of e){let D=t.normalizeRedirectResult(this._valueSchema.redirect(n,t),n);"remain"in D&&u.push(D.remain),r.push(...D.redirect.map(pt))}return u.length===0?{redirect:r}:{redirect:r,remain:u}}overlap(e,t){return e.concat(t)}};function pt({from:e,to:t}){return{from:[e],to:t}}var Jn=class extends J{expected(){return"true or false"}validate(e){return typeof e=="boolean"}};function Gn(e,t){let u=Object.create(null);for(let r of e){let n=r[t];if(u[n])throw new Error(`Duplicate ${t} ${JSON.stringify(n)}`);u[n]=r}return u}function Hn(e,t){let u=new Map;for(let r of e){let n=r[t];if(u.has(n))throw new Error(`Duplicate ${t} ${JSON.stringify(n)}`);u.set(n,r)}return u}function Yn(){let e=Object.create(null);return t=>{let u=JSON.stringify(t);return e[u]?!0:(e[u]=!0,!1)}}function Xn(e,t){let u=[],r=[];for(let n of e)t(n)?u.push(n):r.push(n);return[u,r]}function Zn(e){return e===Math.floor(e)}function Qn(e,t){if(e===t)return 0;let u=typeof e,r=typeof t,n=["undefined","object","boolean","number","string"];return u!==r?n.indexOf(u)-n.indexOf(r):u!=="string"?Number(e)-Number(t):e.localeCompare(t)}function eD(e){return(...t)=>{let u=e(...t);return typeof u=="string"?new Error(u):u}}function dt(e){return e===void 0?{}:e}function fu(e){if(typeof e=="string")return{text:e};let{text:t,list:u}=e;return tD((t||u)!==void 0,"Unexpected `expected` result, there should be at least one field."),u?{text:t,list:{title:u.title,values:u.values.map(fu)}}:{text:t}}function ht(e,t){return e===!0?!0:e===!1?{value:t}:e}function Ct(e,t,u=!1){return e===!1?!1:e===!0?u?!0:[{value:t}]:"value"in e?[e]:e.length===0?!1:e}function Et(e,t){return typeof e=="string"||"key"in e?{from:t,to:e}:"from"in e?{from:e.from,to:e.to}:{from:t,to:e.to}}function Pe(e,t){return e===void 0?[]:Array.isArray(e)?e.map(u=>Et(u,t)):[Et(e,t)]}function mt(e,t){let u=Pe(typeof e=="object"&&"redirect"in e?e.redirect:e,t);return u.length===0?{remain:t,redirect:u}:typeof e=="object"&&"remain"in e?{remain:e.remain,redirect:u}:{redirect:u}}function tD(e,t){if(!e)throw new Error(t)}var uD=class extends J{constructor(e){super(e),this._choices=Hn(e.choices.map(t=>t&&typeof t=="object"?t:{value:t}),"value")}expected({descriptor:e}){let t=Array.from(this._choices.keys()).map(n=>this._choices.get(n)).filter(({hidden:n})=>!n).map(n=>n.value).sort(Qn).map(e.value),u=t.slice(0,-2),r=t.slice(-2);return{text:u.concat(r.join(" or ")).join(", "),list:{title:"one of the following values",values:t}}}validate(e){return this._choices.has(e)}deprecated(e){let t=this._choices.get(e);return t&&t.deprecated?{value:e}:!1}forward(e){let t=this._choices.get(e);return t?t.forward:void 0}redirect(e){let t=this._choices.get(e);return t?t.redirect:void 0}},rD=class extends J{expected(){return"a number"}validate(e,t){return typeof e=="number"}},nD=class extends rD{expected(){return"an integer"}validate(e,t){return t.normalizeValidateResult(super.validate(e,t),e)===!0&&Zn(e)}},gt=class extends J{expected(){return"a string"}validate(e){return typeof e=="string"}},DD=ue,iD=cu,oD=Mn,aD=$n,sD=class{constructor(e,t){let{logger:u=console,loggerPrintWidth:r=80,descriptor:n=DD,unknown:D=iD,invalid:i=oD,deprecated:a=aD,missing:o=()=>!1,required:s=()=>!1,preprocess:F=c=>c,postprocess:l=()=>pe}=t||{};this._utils={descriptor:n,logger:u||{warn:()=>{}},loggerPrintWidth:r,schemas:Gn(e,"name"),normalizeDefaultResult:dt,normalizeExpectedResult:fu,normalizeDeprecatedResult:Ct,normalizeForwardResult:Pe,normalizeRedirectResult:mt,normalizeValidateResult:ht},this._unknownHandler=D,this._invalidHandler=eD(i),this._deprecatedHandler=a,this._identifyMissing=(c,p)=>!(c in p)||o(c,p),this._identifyRequired=s,this._preprocess=F,this._postprocess=l,this.cleanHistory()}cleanHistory(){this._hasDeprecationWarned=Yn()}normalize(e){let t={},u=[this._preprocess(e,this._utils)],r=()=>{for(;u.length!==0;){let n=u.shift(),D=this._applyNormalization(n,t);u.push(...D)}};r();for(let n of Object.keys(this._utils.schemas)){let D=this._utils.schemas[n];if(!(n in t)){let i=dt(D.default(this._utils));"value"in i&&u.push({[n]:i.value})}}r();for(let n of Object.keys(this._utils.schemas)){if(!(n in t))continue;let D=this._utils.schemas[n],i=t[n],a=D.postprocess(i,this._utils);a!==pe&&(this._applyValidation(a,n,D),t[n]=a)}return this._applyPostprocess(t),this._applyRequiredCheck(t),t}_applyNormalization(e,t){let u=[],{knownKeys:r,unknownKeys:n}=this._partitionOptionKeys(e);for(let D of r){let i=this._utils.schemas[D],a=i.preprocess(e[D],this._utils);this._applyValidation(a,D,i);let o=({from:l,to:c})=>{u.push(typeof c=="string"?{[c]:l}:{[c.key]:c.value})},s=({value:l,redirectTo:c})=>{let p=Ct(i.deprecated(l,this._utils),a,!0);if(p!==!1)if(p===!0)this._hasDeprecationWarned(D)||this._utils.logger.warn(this._deprecatedHandler(D,c,this._utils));else for(let{value:f}of p){let h={key:D,value:f};if(!this._hasDeprecationWarned(h)){let d=typeof c=="string"?{key:c,value:f}:c;this._utils.logger.warn(this._deprecatedHandler(h,d,this._utils))}}};Pe(i.forward(a,this._utils),a).forEach(o);let F=mt(i.redirect(a,this._utils),a);if(F.redirect.forEach(o),"remain"in F){let l=F.remain;t[D]=D in t?i.overlap(t[D],l,this._utils):l,s({value:l})}for(let{from:l,to:c}of F.redirect)s({value:l,redirectTo:c})}for(let D of n){let i=e[D];this._applyUnknownHandler(D,i,t,(a,o)=>{u.push({[a]:o})})}return u}_applyRequiredCheck(e){for(let t of Object.keys(this._utils.schemas))if(this._identifyMissing(t,e)&&this._identifyRequired(t))throw this._invalidHandler(t,au,this._utils)}_partitionOptionKeys(e){let[t,u]=Xn(Object.keys(e).filter(r=>!this._identifyMissing(r,e)),r=>r in this._utils.schemas);return{knownKeys:t,unknownKeys:u}}_applyValidation(e,t,u){let r=ht(u.validate(e,this._utils),e);if(r!==!0)throw this._invalidHandler(t,r.value,this._utils)}_applyUnknownHandler(e,t,u,r){let n=this._unknownHandler(e,t,this._utils);if(n)for(let D of Object.keys(n)){if(this._identifyMissing(D,n))continue;let i=n[D];D in this._utils.schemas?r(D,i):u[D]=i}}_applyPostprocess(e){let t=this._postprocess(e,this._utils);if(t!==pe){if(t.delete)for(let u of t.delete)delete e[u];if(t.override){let{knownKeys:u,unknownKeys:r}=this._partitionOptionKeys(t.override);for(let n of u){let D=t.override[n];this._applyValidation(D,n,this._utils.schemas[n]),e[n]=D}for(let n of r){let D=t.override[n];this._applyUnknownHandler(n,D,e,(i,a)=>{let o=this._utils.schemas[i];this._applyValidation(a,i,o),e[i]=a})}}}}},Te;function lD(e,t,{logger:u=!1,isCLI:r=!1,passThrough:n=!1,FlagSchema:D,descriptor:i}={}){if(r){if(!D)throw new Error("'FlagSchema' option is required.");if(!i)throw new Error("'descriptor' option is required.")}else i=ue;let a=n?Array.isArray(n)?(c,p)=>n.includes(c)?{[c]:p}:void 0:(c,p)=>({[c]:p}):(c,p,f)=>{let{_:h,...d}=f.schemas;return cu(c,p,{...f,schemas:d})},o=cD(t,{isCLI:r,FlagSchema:D}),s=new sD(o,{logger:u,unknown:a,descriptor:i}),F=u!==!1;F&&Te&&(s._hasDeprecationWarned=Te);let l=s.normalize(e);return F&&(Te=s._hasDeprecationWarned),l}function cD(e,{isCLI:t,FlagSchema:u}){let r=[];t&&r.push(Un.create({name:"_"}));for(let n of e)r.push(fD(n,{isCLI:t,optionInfos:e,FlagSchema:u})),n.alias&&t&&r.push(Kn.create({name:n.alias,sourceName:n.name}));return r}function fD(e,{isCLI:t,optionInfos:u,FlagSchema:r}){let{name:n}=e,D={name:n},i,a={};switch(e.type){case"int":i=nD,t&&(D.preprocess=Number);break;case"string":i=gt;break;case"choice":i=uD,D.choices=e.choices.map(o=>o?.redirect?{...o,redirect:{to:{key:e.name,value:o.redirect}}}:o);break;case"boolean":i=Jn;break;case"flag":i=r,D.flags=u.flatMap(o=>[o.alias,o.description&&o.name,o.oppositeDescription&&`no-${o.name}`].filter(Boolean));break;case"path":i=gt;break;default:throw new Error(`Unexpected type ${e.type}`)}if(e.exception?D.validate=(o,s,F)=>e.exception(o)||s.validate(o,F):D.validate=(o,s,F)=>o===void 0||s.validate(o,F),e.redirect&&(a.redirect=o=>o?{to:typeof e.redirect=="string"?e.redirect:{key:e.redirect.option,value:e.redirect.value}}:void 0),e.deprecated&&(a.deprecated=!0),t&&!e.array){let o=D.preprocess||(s=>s);D.preprocess=(s,F,l)=>F.preprocess(o(Array.isArray(s)?B(0,s,-1):s),l)}return e.array?qn.create({...t?{preprocess:o=>Array.isArray(o)?o:[o]}:{},...a,valueSchema:i.create(D)}):i.create({...D,...a})}var FD=lD,pD=Array.prototype.findLast??function(e){for(let t=this.length-1;t>=0;t--){let u=this[t];if(e(u,t,this))return u}},dD=se("findLast",function(){if(Array.isArray(this))return pD}),Fu=dD,hD=Symbol.for("PRETTIER_IS_FRONT_MATTER"),CD=[];function ED(e){return!!e?.[hD]}var Ye=ED,pu=new Set(["yaml","toml"]),du=({node:e})=>Ye(e)&&pu.has(e.language);async function mD(e,t,u,r){let{node:n}=u,{language:D}=n;if(!pu.has(D))return;let i=n.value.trim(),a;if(i){let o=D==="yaml"?D:iu(r,{language:D});if(!o)return;a=i?await e(i,{parser:o}):""}else a=i;return Pt([n.startDelimiter,n.explicitLanguage??"",L,a,a?L:"",n.endDelimiter])}function gD(e,t){return du({node:e})&&(delete t.end,delete t.raw,delete t.value),t}var yD=gD;function BD({node:e}){return e.raw}var vD=BD,hu=new Set(["tokens","comments","parent","enclosingNode","precedingNode","followingNode"]),AD=e=>Object.keys(e).filter(t=>!hu.has(t));function bD(e,t){let u=e?r=>e(r,hu):AD;return t?new Proxy(u,{apply:(r,n,D)=>Ye(D[0])?CD:Reflect.apply(r,n,D)}):u}var yt=bD;function Cu(e,t){if(!t)throw new Error("parserName is required.");let u=Fu(0,e,n=>n.parsers&&ve(n.parsers,t));if(u)return u;let r=`Couldn't resolve parser "${t}".`;throw r+=" Plugins must be explicitly added to the standalone bundle.",new ru(r)}function wD(e,t){if(!t)throw new Error("astFormat is required.");let u=Fu(0,e,n=>n.printers&&ve(n.printers,t));if(u)return u;let r=`Couldn't find plugin for AST format "${t}".`;throw r+=" Plugins must be explicitly added to the standalone bundle.",new ru(r)}function Xe({plugins:e,parser:t}){let u=Cu(e,t);return Eu(u,t)}function Eu(e,t){let u=e.parsers[t];return typeof u=="function"?u():u}async function kD(e,t){let u=e.printers[t],r=typeof u=="function"?await u():u;return ND(r)}function SD(e){let{features:t,getVisitorKeys:u,embed:r,massageAstNode:n,print:D,...i}=e;t=ID(t);let a=t.experimental_frontMatterSupport;u=yt(u,a.massageAstNode||a.embed||a.print);let o=n;n&&a.massageAstNode&&(o=new Proxy(n,{apply(l,c,p){return yD(...p),Reflect.apply(l,c,p)}}));let s=r;if(r){let l;s=new Proxy(r,{get(c,p,f){return p==="getVisitorKeys"?(l??(l=r.getVisitorKeys?yt(r.getVisitorKeys,a.massageAstNode||a.embed):u),l):Reflect.get(c,p,f)},apply:(c,p,f)=>a.embed&&du(...f)?mD:Reflect.apply(c,p,f)})}let F=D;return a.print&&(F=new Proxy(D,{apply(l,c,p){let[f]=p;return Ye(f.node)?vD(f):Reflect.apply(l,c,p)}})),{features:t,getVisitorKeys:u,embed:s,massageAstNode:o,print:F,...i}}var xD=new WeakMap;function ND(e){return Ve(xD,e,SD)}var TD=["clean","embed","print"],OD=Object.fromEntries(TD.map(e=>[e,!1]));function _D(e){return{...OD,...e}}function ID(e){return{experimental_avoidAstMutation:!1,...e,experimental_frontMatterSupport:_D(e?.experimental_frontMatterSupport)}}var Bt={astFormat:"estree",printer:{},originalText:void 0,locStart:null,locEnd:null,getVisitorKeys:null};async function PD(e,t={}){let u={...e};if(!u.parser){if(!u.filepath)throw new st("No parser and no file path given, couldn't infer a parser.");if(u.parser=iu(u,{physicalFile:u.filepath}),!u.parser)throw new st(`No parser could be inferred for file "${u.filepath}".`)}let r=nu({plugins:e.plugins,showDeprecated:!0}).options,n={...Bt,...Object.fromEntries(r.filter(l=>l.default!==void 0).map(l=>[l.name,l.default]))},D=Cu(u.plugins,u.parser),i=await Eu(D,u.parser);u.astFormat=i.astFormat,u.locEnd=i.locEnd,u.locStart=i.locStart;let a=D.printers?.[i.astFormat]?D:wD(u.plugins,i.astFormat),o=await kD(a,i.astFormat);u.printer=o,u.getVisitorKeys=o.getVisitorKeys;let s=a.defaultOptions?Object.fromEntries(Object.entries(a.defaultOptions).filter(([,l])=>l!==void 0)):{},F={...n,...s};for(let[l,c]of Object.entries(F))u[l]??(u[l]=c);return u.parser==="json"&&(u.trailingComma="none"),FD(u,r,{passThrough:Object.keys(Bt),...t})}var De=PD,vt=/\r\n|[\n\r\u2028\u2029]/;function LD(e,t,u,r){let n={column:null,line:-1,...e.start},D={...n,...e.end},{linesAbove:i=2,linesBelow:a=3}=u||{},o=n.line-r,s=n.column,F=D.line-r,l=D.column,c=Math.max(o-(i+1),0),p=Math.min(t.length,F+a);o===-1&&(c=0),F===-1&&(p=t.length);let f=F-o,h={};if(f)for(let d=0;d<=f;d++){let C=d+o;if(s==null)h[C]=!0;else if(d===0){let m=t[C-1].length;h[C]=[s,m-s]}else if(d===f)h[C]=[0,l];else{let m=t[C-1].length;h[C]=[0,m]}}else if(s===l)s!=null?h[o]=[s,0]:h[o]=!0;else{let d=s??0,C=l??d;h[o]=[d,C-d]}return{start:c,end:p,markerLines:h}}function jD(e,t,u={},r){let{defs:n,highlight:D}={defs:{gutter:String,marker:String,message:String,reset:String},highlight:String},i=(u.startLine||1)-1,a=e.split(vt),{start:o,end:s,markerLines:F}=LD(t,a,u,i),l=t.start&&typeof t.start.column=="number",c=String(s+i).length,p=D(e).split(vt,s).slice(o,s).map((f,h)=>{let d=o+1+h,C=` ${` ${d+i}`.slice(-c)} |`,m=F[d],y=!F[d+1];if(m){let g="";if(Array.isArray(m)){let b=f.slice(0,m[0]).replace(/[^\t]/g," "),A=m[1]||1;g=[`
|
|
19
|
+
`,n.gutter(C.replace(/\d/g," "))," ",b,n.marker("^").repeat(A)].join(""),y&&u.message&&(g+=" "+n.message(u.message))}return[n.marker(">"),n.gutter(C),f.length>0?` ${f}`:"",g].join("")}else return` ${n.gutter(C)}${f.length>0?` ${f}`:""}`}).join(`
|
|
20
|
+
`);return u.message&&!l&&(p=`${" ".repeat(c+1)}${u.message}
|
|
21
|
+
${p}`),n.reset(p)}function $D(e,t,u={}){return jD(e,t,u)}async function MD(e,t){let u=await Xe(t),r=u.preprocess?await u.preprocess(e,t):e;t.originalText=r;let n;try{n=await u.parse(r,t,t)}catch(D){RD(D,e)}return{text:r,ast:n}}function RD(e,t){let{loc:u}=e;if(u){let{start:r,end:n}=u;r&&(r={line:r.line,column:r.column-1}),n&&(n={line:n.line,column:n.column-1});let D=$D(t,{start:r,end:n},{});e.message+=`
|
|
22
|
+
`+D,e.codeFrame=D}throw e}var ce=MD;async function VD(e,t,u,r,n){if(u.embeddedLanguageFormatting!=="auto")return;let{printer:D}=u,{embed:i}=D;if(!i)return;if(i.length>2)throw new Error("printer.embed has too many parameters. The API changed in Prettier v3. Please update your plugin. See https://prettier.io/docs/plugins#optional-embed");let{hasPrettierIgnore:a}=D,{getVisitorKeys:o}=i,s=[];c();let F=e.stack;for(let{print:p,node:f,pathStack:h}of s)try{e.stack=h;let d=await p(l,t,e,u);d&&n.set(f,d)}catch(d){if(globalThis.PRETTIER_DEBUG)throw d}e.stack=F;function l(p,f){return WD(p,f,u,r)}function c(){let{node:p}=e;if(p===null||typeof p!="object"||a?.(e))return;for(let h of o(p))Array.isArray(p[h])?e.each(c,h):e.call(c,h);let f=i(e,u);if(f){if(typeof f=="function"){s.push({print:f,node:p,pathStack:[...e.stack]});return}n.set(p,f)}}}async function WD(e,t,u,r){let n=await De({...u,...t,parentParser:u.parser,originalText:e,cursorOffset:void 0,rangeStart:void 0,rangeEnd:void 0},{passThrough:!0}),{ast:D}=await ce(e,n),i=await r(D,n);return It(i)}function zD(e,t,u,r){let{originalText:n,[Ee]:D,locStart:i,locEnd:a,[Symbol.for("printedComments")]:o}=t,{node:s}=e,F=i(s),l=a(s);for(let p of D)i(p)>=F&&a(p)<=l&&o.add(p);let{printPrettierIgnored:c}=t.printer;return c?c(e,t,u,r):n.slice(F,l)}var KD=zD;async function Ae(e,t){({ast:e}=await mu(e,t));let u=new Map,r=new en(e),n=new Map;await VD(r,i,t,Ae,n);let D=await At(r,t,i,void 0,n);if(gn(t),t.cursorOffset>=0){if(t.nodeAfterCursor&&!t.nodeBeforeCursor)return[Y,D];if(t.nodeBeforeCursor&&!t.nodeAfterCursor)return[D,Y]}return D;function i(o,s){return o===void 0||o===r?a(s):Array.isArray(o)?r.call(()=>a(s),...o):r.call(()=>a(s),o)}function a(o){let s=r.node;if(s==null)return"";let F=Je(s)&&o===void 0;if(F&&u.has(s))return u.get(s);let l=At(r,t,i,o,n);return F&&u.set(s,l),l}}function At(e,t,u,r,n){let{node:D}=e,{printer:i}=t,a;switch(i.hasPrettierIgnore?.(e)?a=KD(e,t,u,r):n.has(D)?a=n.get(D):a=i.print(e,t,u,r),D){case t.cursorNode:a=Fe(a,o=>[Y,o,Y]);break;case t.nodeBeforeCursor:a=Fe(a,o=>[o,Y]);break;case t.nodeAfterCursor:a=Fe(a,o=>[Y,o]);break}return i.printComment&&Jt(D.comments)&&!i.willPrintOwnComments?.(e,t)&&(a=mn(e,a,t)),a}async function mu(e,t){let u=e.comments??[];t[Ee]=u,t[Symbol.for("printedComments")]=new Set,cn(e,t);let{printer:{preprocess:r}}=t;return e=r?await r(e,t):e,{ast:e,comments:u}}function UD(e,t){let{cursorOffset:u,locStart:r,locEnd:n,getVisitorKeys:D}=t,i=p=>r(p)<=u&&n(p)>=u,a=e,o=[e];for(let p of on(e,{getVisitorKeys:D,filter:i}))o.push(p),a=p;if(an(a,{getVisitorKeys:D}))return{cursorNode:a};let s,F,l=-1,c=Number.POSITIVE_INFINITY;for(;o.length>0&&(s===void 0||F===void 0);){a=o.pop();let p=s!==void 0,f=F!==void 0;for(let h of Be(a,{getVisitorKeys:D})){if(!p){let d=n(h);d<=u&&d>l&&(s=h,l=d)}if(!f){let d=r(h);d>=u&&d<c&&(F=h,c=d)}}}return{nodeBeforeCursor:s,nodeAfterCursor:F}}var gu=UD;function qD(e,t){let{printer:u}=t,r=u.massageAstNode;if(!r)return e;let{getVisitorKeys:n}=u,{ignoredProperties:D}=r;return i(e);function i(a,o){if(!Je(a))return a;if(Array.isArray(a))return a.map(c=>i(c,o)).filter(Boolean);let s={},F=new Set(n(a));for(let c in a)!ve(a,c)||D?.has(c)||(F.has(c)?s[c]=i(a[c],a):s[c]=a[c]);let l=r(a,s,o);if(l!==null)return l??s}}var JD=qD,GD=Array.prototype.findLastIndex??function(e){for(let t=this.length-1;t>=0;t--){let u=this[t];if(e(u,t,this))return t}return-1},HD=se("findLastIndex",function(){if(Array.isArray(this))return GD}),YD=HD;function E(e){let t=new Set(e);return u=>t.has(u?.type)}E(["TSAsExpression","TSSatisfiesExpression","AsExpression","AsConstExpression","SatisfiesExpression"]);E(["SatisfiesExpression","TSSatisfiesExpression"]);E(["TSUnionType","UnionTypeAnnotation"]);E(["TSIntersectionType","IntersectionTypeAnnotation"]);E(["TupleTypeAnnotation","TSTupleType"]);E(["TSConditionalType","ConditionalTypeAnnotation"]);E(["TSTemplateLiteralType","TemplateLiteralTypeAnnotation"]);E(["TSImportType","ImportType"]);E(["TSExternalModuleReference","ExternalModuleReference"]);E(["TSTypeAliasDeclaration","TypeAlias"]);E(["ReturnStatement","ThrowStatement"]);E(["ReturnStatement","ThrowStatement","YieldExpression","UnaryExpression"]);E(["ExportDefaultDeclaration","DeclareExportDeclaration","ExportNamedDeclaration","ExportAllDeclaration","DeclareExportAllDeclaration"]);var XD=E(["TSExportAssignment","ExportAssignment"]);E(["AbstractMethodDefinition","TSAbstractMethodDefinition"]);E(["AbstractPropertyDefinition","TSAbstractPropertyDefinition"]);E(["TSParameterProperty","ParameterProperty"]);E(["TSNonNullExpression","NonNullExpression"]);E(["ArrayExpression"]);E(["ObjectExpression"]);E(["Literal","BooleanLiteral","BigIntLiteral","DirectiveLiteral","NullLiteral","NumericLiteral","RegExpLiteral","StringLiteral"]);E(["ObjectTypeAnnotation","TSTypeLiteral","TSMappedType"]);E(["FunctionExpression","ArrowFunctionExpression"]);E(["JSXElement","JSXFragment"]);E(["BinaryExpression","LogicalExpression","NGPipeExpression"]);E(["CallExpression","OptionalCallExpression"]);E(["MemberExpression","OptionalMemberExpression"]);E(["CallExpression","OptionalCallExpression","NewExpression"]);E(["CallExpression","OptionalCallExpression","NewExpression","ImportExpression"]);E(["ChainExpression","TSNonNullExpression","NonNullExpression"]);E(["TSArrayType","ArrayTypeAnnotation"]);E(["TSTypeParameterInstantiation","TypeParameterInstantiation"]);E(["TSTypeAnnotation","TypeAnnotation"]);E(["TSModuleDeclaration","DeclareModule","DeclareNamespace"]);E(["TSConstructorType","ConstructorTypeAnnotation"]);E(["ClassDeclaration","ClassExpression"]);E(["ImportNamespaceSpecifier","ExportNamespaceSpecifier"]);E(["TSEnumDeclaration","EnumDeclaration","DeclareEnum"]);E(["TSEnumBody","EnumBody"]);function ZD(e,t){return t=new Set(t),e.find(u=>yu.has(u.type)&&t.has(u))}function bt(e){let t=YD(0,e,u=>u.type!=="Program"&&u.type!=="File");return t===-1?e:e.slice(0,t+1)}function QD(e,t,u){let{locStart:r,locEnd:n}=u,[D,...i]=e,[a,...o]=t;if(D===a)return[D,a];let s=r(D);for(let l of bt(o))if(r(l)>=s)a=l;else break;let F=n(a);for(let l of bt(i)){if(n(l)<=F)je(u,l)&&(D=l);else break;if(D===a)break}return[D,a]}function Le(e,t,u,r,n=[],D,i){let{locStart:a,locEnd:o}=i,s=a(e),F=o(e);if(t>F||t<s||D==="rangeEnd"&&t===s||D==="rangeStart"&&t===F)return;let l=[e,...n],c=Xt(e,l,{cache:Zt,locStart:a,locEnd:o,getVisitorKeys:u.getVisitorKeys,filter:u.printer.canAttachComment,getChildren:u.printer.getCommentChildNodes});for(let p of c){let f=Le(p,t,u,r,l,D,i);if(f)return f}if(r(e,n[0]))return l}function ei(e,t){return t?.type==="ForStatement"&&t.init===e||(t?.type==="ForInStatement"||t?.type==="ForOfStatement")&&t.left===e}function ti(e,t){let{type:u}=e;return t?.type!=="DeclareExportDeclaration"&&u!=="TypeParameterDeclaration"&&u!=="TSTypeParameterDeclaration"&&!(u==="VariableDeclaration"&&ei(e,t))&&(u==="Directive"||u==="TypeAlias"||XD(e)||u.startsWith("Declare")||u.startsWith("TSDeclare")||u.endsWith("Statement")||u.endsWith("Declaration"))}var yu=new Set(["JsonRoot","ObjectExpression","ArrayExpression","StringLiteral","NumericLiteral","BooleanLiteral","NullLiteral","UnaryExpression","TemplateLiteral"]),ui=new Set(["OperationDefinition","FragmentDefinition","VariableDefinition","TypeExtensionDefinition","ObjectTypeDefinition","FieldDefinition","DirectiveDefinition","EnumTypeDefinition","EnumValueDefinition","InputValueDefinition","InputObjectTypeDefinition","SchemaDefinition","OperationTypeDefinition","InterfaceTypeDefinition","UnionTypeDefinition","ScalarTypeDefinition"]);function je(e,t,u){if(!t)return!1;switch(e.parser){case"flow":case"hermes":case"babel":case"babel-flow":case"babel-ts":case"typescript":case"acorn":case"espree":case"meriyah":case"oxc":case"oxc-ts":case"yuku":case"yuku-ts":case"__babel_estree":return ti(t,u);case"json":case"json5":case"jsonc":case"json-stringify":return yu.has(t.type);case"graphql":return ui.has(t.kind);case"vue":return t.tag!=="root"}return!1}function ri(e,t,u){let{rangeStart:r,rangeEnd:n}=t,D=e.slice(r,n).search(/\S/),i=D===-1;if(!i)for(r+=D;n>r&&!/\S/.test(e[n-1]);--n);let a=t.printer.features?.experimental_locForRangeFormat??t,o=Le(u,r,t,(f,h)=>je(t,f,h),[],"rangeStart",a);if(!o)return;let s=i?o:Le(u,n,t,f=>je(t,f),[],"rangeEnd",a);if(!s)return;let F,l;if(u.type==="JsonRoot"){let f=ZD(o,s);F=f,l=f}else[F,l]=QD(o,s,t);let{locStart:c,locEnd:p}=a;return[Math.min(c(F),c(l)),Math.max(p(F),p(l))]}var wt=Symbol("cursor");async function Bu(e,t,u=0){if(!e||e.trim().length===0)return{formatted:"",cursorOffset:-1,comments:[]};let{ast:r,text:n}=await ce(e,t);t.cursorOffset>=0&&(t={...t,...gu(r,t)});let D=await Ae(r,t);u>0&&(D=Lt([L,D],u,t.tabWidth));let i=ye(D,t);if(u>0){let o=i.formatted.trim();i.cursorNodeStart!==void 0&&(i.cursorNodeStart-=i.formatted.indexOf(o),i.cursorNodeStart<0&&(i.cursorNodeStart=0,i.cursorNodeText=i.cursorNodeText.trimStart()),i.cursorNodeStart+i.cursorNodeText.length>o.length&&(i.cursorNodeText=i.cursorNodeText.trimEnd())),i.formatted=o+Re(t.endOfLine)}let a=t[Ee];if(t.cursorOffset>=0){let o,s,F,l;if((t.cursorNode||t.nodeBeforeCursor||t.nodeAfterCursor)&&i.cursorNodeText)if(F=i.cursorNodeStart,l=i.cursorNodeText,t.cursorNode)o=t.locStart(t.cursorNode),s=n.slice(o,t.locEnd(t.cursorNode));else{if(!t.nodeBeforeCursor&&!t.nodeAfterCursor)throw new Error("Cursor location must contain at least one of cursorNode, nodeBeforeCursor, nodeAfterCursor");o=t.nodeBeforeCursor?t.locEnd(t.nodeBeforeCursor):0;let C=t.nodeAfterCursor?t.locStart(t.nodeAfterCursor):n.length;s=n.slice(o,C)}else o=0,s=n,F=0,l=i.formatted;let c=t.cursorOffset-o;if(s===l)return{formatted:i.formatted,cursorOffset:F+c,comments:a};let p=s.split("");p.splice(c,0,wt);let f=l.split(""),h=Vu(p,f),d=F;for(let C of h)if(C.removed){if(C.value.includes(wt))break}else d+=C.count;return{formatted:i.formatted,cursorOffset:d,comments:a}}return{formatted:i.formatted,cursorOffset:-1,comments:a}}async function ni(e,t){let{ast:u,text:r}=await ce(e,t),[n,D]=ri(r,t,u)??[0,0],i=r.slice(n,D),a=Math.min(n,r.lastIndexOf(`
|
|
23
|
+
`,n)+1),o=r.slice(a,n).match(/^\s*/)[0],s=qe(o,t.tabWidth),F=await Bu(i,{...t,rangeStart:0,rangeEnd:Number.POSITIVE_INFINITY,cursorOffset:t.cursorOffset>n&&t.cursorOffset<=D?t.cursorOffset-n:-1,endOfLine:"lf"},s),l=F.formatted.trimEnd(),{cursorOffset:c}=t;c>D?c+=l.length-i.length:F.cursorOffset>=0&&(c=F.cursorOffset+n);let p=r.slice(0,n)+l+r.slice(D);if(t.endOfLine!=="lf"){let f=Re(t.endOfLine);c>=0&&f===`\r
|
|
24
|
+
`&&(c+=Ot(p.slice(0,c),`
|
|
25
|
+
`)),p=he(0,p,`
|
|
26
|
+
`,f)}return{formatted:p,cursorOffset:c,comments:F.comments}}function Oe(e,t,u){return typeof t!="number"||Number.isNaN(t)||t<0||t>e.length?u:t}function kt(e,t){let{cursorOffset:u,rangeStart:r,rangeEnd:n}=t;return u=Oe(e,u,-1),r=Oe(e,r,0),n=Oe(e,n,e.length),{...t,cursorOffset:u,rangeStart:r,rangeEnd:n}}function vu(e,t){let{cursorOffset:u,rangeStart:r,rangeEnd:n,endOfLine:D}=kt(e,t),i=Yr(e);if(i&&(e=e.slice(1),u--,r--,n--),D==="auto"&&(D=Ju(e)),e.includes("\r")){let a=o=>Ot(e.slice(0,Math.max(o,0)),`\r
|
|
27
|
+
`);u-=a(u),r-=a(r),n-=a(n),e=Yu(e)}return{hasBom:i,text:e,options:kt(e,{...t,cursorOffset:u,rangeStart:r,rangeEnd:n,endOfLine:D})}}async function St(e,t){let u=await Xe(t);return!u.hasPragma||u.hasPragma(e)}async function Di(e,t){return(await Xe(t)).hasIgnorePragma?.(e)}async function Au(e,t){let{hasBom:u,text:r,options:n}=vu(e,await De(t));if(n.rangeStart>=n.rangeEnd&&r!==""||n.requirePragma&&!await St(r,n)||n.checkIgnorePragma&&await Di(r,n))return{formatted:e,cursorOffset:t.cursorOffset,comments:[]};let D;return n.rangeStart>0||n.rangeEnd<r.length?D=await ni(r,n):(!n.requirePragma&&n.insertPragma&&n.printer.insertPragma&&!await St(r,n)&&(r=n.printer.insertPragma(r)),D=await Bu(r,n)),u&&(D.formatted=Xr(D.formatted),D.cursorOffset>=0&&D.cursorOffset++),D}async function ii(e,t,u){let{text:r,options:n}=vu(e,await De(t)),D=await ce(r,n);return u&&(u.preprocessForPrint&&(D.ast=await mu(D.ast,n)),u.massage&&(D.ast=JD(D.ast,n))),D}async function oi(e,t){t=await De(t);let u=await Ae(e,t);return ye(u,t)}async function ai(e,t){let u=wr(e),{formatted:r}=await Au(u,{...t,parser:"__js_expression"});return r}async function si(e,t){t=await De(t);let{ast:u}=await ce(e,t);return t.cursorOffset>=0&&(t={...t,...gu(u,t)}),Ae(u,t)}async function li(e,t){return ye(e,await De(t))}var bu={};$e(bu,{builders:()=>ci,printer:()=>fi,utils:()=>Fi});var ci={join:$t,line:Mt,softline:vr,hardline:L,literalline:Vt,group:jt,conditionalGroup:mr,fill:Er,lineSuffix:_e,lineSuffixBoundary:Ar,cursor:Y,breakParent:ge,ifBreak:gr,trim:br,indent:de,indentIfBreak:yr,align:ne,addAlignmentToDoc:Lt,markAsRoot:Pt,dedentToRoot:hr,dedent:Cr,hardlineWithoutBreakParent:Ke,literallineWithoutBreakParent:Rt,label:Br,concat:e=>e},fi={printDocToString:ye},Fi={willBreak:ir,traverseDoc:We,findInDoc:ze,mapDoc:me,removeLines:sr,stripTrailingHardline:It,replaceEndOfLine:fr,canBreak:pr},pi="3.10.0",wu={};$e(wu,{addDanglingComment:()=>G,addLeadingComment:()=>oe,addTrailingComment:()=>ae,getAlignmentSize:()=>qe,getIndentSize:()=>gi,getMaxContinuousCount:()=>vi,getNextNonSpaceNonCommentCharacter:()=>bi,getNextNonSpaceNonCommentCharacterIndex:()=>Ii,getPreferredQuote:()=>Si,getStringWidth:()=>Ue,hasNewline:()=>K,hasNewlineInRange:()=>Ni,hasSpaces:()=>Oi,isNextLineEmpty:()=>Mi,isNextLineEmptyAfterIndex:()=>tt,isPreviousLineEmpty:()=>Li,makeString:()=>$i,skip:()=>le,skipEverythingButNewLine:()=>Ht,skipInlineComment:()=>Ze,skipNewline:()=>X,skipSpaces:()=>U,skipToLineEnd:()=>Gt,skipTrailingComment:()=>Qe,skipWhitespace:()=>rn});function di(e,t){if(t===!1)return!1;if(e.charAt(t)==="/"&&e.charAt(t+1)==="*"){for(let u=t+2;u<e.length;++u)if(e.charAt(u)==="*"&&e.charAt(u+1)==="/")return u+2}return t}var Ze=di;function hi(e,t){return t===!1?!1:e.charAt(t)==="/"&&e.charAt(t+1)==="/"?Ht(e,t):t}var Qe=hi;function Ci(e,t){let u=null,r=t;for(;r!==u;)u=r,r=U(e,r),r=Ze(e,r),r=Qe(e,r),r=X(e,r);return r}var et=Ci;function Ei(e,t){let u=null,r=t;for(;r!==u;)u=r,r=Gt(e,r),r=Ze(e,r),r=U(e,r);return r=Qe(e,r),r=X(e,r),r!==!1&&K(e,r)}var tt=Ei;function mi(e,t){let u=e.lastIndexOf(`
|
|
28
|
+
`);return u===-1?0:qe(e.slice(u+1).match(/^[\t ]*/)[0],t)}var gi=mi;function yi(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Bi(e,t){let u=e.matchAll(new RegExp(`(?:${yi(t)})+`,"g"));return u.reduce||(u=[...u]),u.reduce((r,[n])=>Math.max(r,n.length),0)/t.length}var vi=Bi;function Ai(e,t){let u=et(e,t);return u===!1?"":e.charAt(u)}var bi=Ai,ku=Object.freeze({character:"'",codePoint:39}),Su=Object.freeze({character:'"',codePoint:34}),wi=Object.freeze({preferred:ku,alternate:Su}),ki=Object.freeze({preferred:Su,alternate:ku});function Si(e,t){let{preferred:u,alternate:r}=t===!0||t==="'"?wi:ki,{length:n}=e,D=0,i=0;for(let a=0;a<n;a++){let o=e.charCodeAt(a);o===u.codePoint?D++:o===r.codePoint&&i++}return(D>i?r:u).character}function xi(e,t,u){for(let r=t;r<u;++r)if(e.charAt(r)===`
|
|
29
|
+
`)return!0;return!1}var Ni=xi;function Ti(e,t,u={}){return U(e,u.backwards?t-1:t,u)!==t}var Oi=Ti;function _i(e,t,u){return et(e,u(t))}function Ii(e,t){return arguments.length===2||typeof t=="number"?et(e,t):_i(...arguments)}function Pi(e,t,u){return He(e,u(t))}function Li(e,t){return arguments.length===2||typeof t=="number"?He(e,t):Pi(...arguments)}function ji(e,t,u){return tt(e,u(t))}function $i(e,t,u){let r=t==='"'?"'":'"',n=he(0,e,/\\(.)|(["'])/gs,(D,i,a)=>i===r?i:a===t?"\\"+a:a||(u&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/.test(i)?i:"\\"+i));return t+n+t}function Mi(e,t){return arguments.length===2||typeof t=="number"?tt(e,t):ji(...arguments)}function H(e,t=1){return async(...u)=>{let r=u[t]??{},n=r.plugins??[];return u[t]={...r,plugins:Array.isArray(n)?n:Object.values(n)},await e(...u)}}var xu=H(Au);async function Nu(e,t){let{formatted:u}=await xu(e,{...t,cursorOffset:-1});return u}async function Ri(e,t){return await Nu(e,t)===e}var Vi=H(nu,0),Wi={parse:H(ii),formatAST:H(oi),formatDoc:H(ai),printToDoc:H(si),printDocToString:H(li)};export{Wi as __debug,Ri as check,Pu as default,bu as doc,Nu as format,xu as formatWithCursor,Vi as getSupportInfo,wu as util,pi as version};
|