wrangler-action/node_modules/prettier/standalone.js

34 lines
80 KiB
JavaScript
Raw Normal View History

2023-08-07 22:11:15 +02:00
(function(t){function e(){var o=t();return o.default||o}if(typeof exports=="object"&&typeof module=="object")module.exports=e();else if(typeof define=="function"&&define.amd)define(e);else{var f=typeof globalThis<"u"?globalThis:typeof global<"u"?global:typeof self<"u"?self:this||{};f.prettier=e()}})(function(){"use strict";var zu=Object.create;var et=Object.defineProperty;var Wu=Object.getOwnPropertyDescriptor;var Gu=Object.getOwnPropertyNames;var Uu=Object.getPrototypeOf,Ku=Object.prototype.hasOwnProperty;var Ot=(e,t)=>()=>(e&&(t=e(e=0)),t);var E=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ge=(e,t)=>{for(var r in t)et(e,r,{get:t[r],enumerable:!0})},jr=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Gu(t))!Ku.call(e,i)&&i!==r&&et(e,i,{get:()=>t[i],enumerable:!(n=Wu(t,i))||n.enumerable});return e};var kt=(e,t,r)=>(r=e!=null?zu(Uu(e)):{},jr(t||!e||!e.__esModule?et(r,"default",{value:e,enumerable:!0}):r,e)),Y=e=>jr(et({},"__esModule",{value:!0}),e);var Hu=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)};var St=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)};var ye=(e,t,r)=>(Hu(e,t,"access private method"),r);var Mr=E(vt=>{"use strict";Object.defineProperty(vt,"__esModule",{value:!0});vt.default=Yr;function Yr(){}Yr.prototype={diff:function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=n.callback;typeof n=="function"&&(i=n,n={}),this.options=n;var u=this;function o(p){return i?(setTimeout(function(){i(void 0,p)},0),!0):p}t=this.castInput(t),r=this.castInput(r),t=this.removeEmpty(this.tokenize(t)),r=this.removeEmpty(this.tokenize(r));var s=r.length,a=t.length,D=1,c=s+a;n.maxEditLength&&(c=Math.min(c,n.maxEditLength));var d=[{newPos:-1,components:[]}],l=this.extractCommon(d[0],r,t,0);if(d[0].newPos+1>=s&&l+1>=a)return o([{value:this.join(r),count:r.length}]);function F(){for(var p=-1*D;p<=D;p+=2){var m=void 0,h=d[p-1],C=d[p+1],g=(C?C.newPos:0)-p;h&&(d[p-1]=void 0);var y=h&&h.newPos+1<s,b=C&&0<=g&&g<a;if(!y&&!b){d[p]=void 0;continue}if(!y||b&&h.newPos<C.newPos?(m=Zu(C),u.pushComponent(m.components,void 0,!0)):(m=h,m.newPos++,u.pushComponent(m.components,!0,void 0)),g=u.extractCommon(m,r,t,p),m.newPos+1>=s&&g+1>=a)return o(Xu(u,m.components,r,t,u.useLongestToken));d[p]=m}D++}if(i)(function p(){setTimeout(function(){if(D>c)return i();F()||p()},0)})();else for(;D<=c;){var f=F();if(f)return f}},pushComponent:function(t,r,n){var i=t[t.length-1];i&&i.added===r&&i.removed===n?t[t.length-1]={count:i.count+1,added:r,removed:n}:t.push({count:1,added:r,removed:n})},extractCommon:function(t,r,n,i){for(var u=r.length,o=n.length,s=t.newPos,a=s-i,D=0;s+1<u&&a+1<o&&this.equals(r[s+1],n[a+1]);)s++,a++,D++;return D&&t.components.push({count:D}),t.newPos=s,a},equals:function(t,r){return this.options.comparator?this.options.comparator(t,r):t===r||this.options.ignoreCase&&t.toLowerCase()===r.toLowerCase()},removeEmpty:function(t){for(var r=[],n=0;n<t.length;n++)t[n]&&r.push(t[n]);return r},castInput:function(t){return t},tokenize:function(t){return t.split("")},join:function(t){return t.join("")}};function Xu(e,t,r,n,i){for(var u=0,o=t.length,s=0,a=0;u<o;u++){var D=t[u];if(D.removed){if(D.value=e.join(n.slice(a,a+D.count)),a+=D.count,u&&t[u-1].added){var d=t[u-1];t[u-1]=t[u],t[u]=d}}else{if(!D.added&&i){var c=r.slice(s,s+D.count);c=c.map(function(F,f){var p=n[a+f];return p.length>F.length?p:F}),D.value=e.join(c)}else D.value=e.join(r.slice(s,s+D.count));s+=D.count,D.added||(a+=D.count)}}var l=t[o-1];return o>1&&typeof l.value=="string"&&(l.added||l.removed)&&e.equals("",l.value)&&(t[o-2].value+=l.value,t.pop()),t}function Zu(e){return{newPos:e.newPos,components:e.components.slice(0)}}});var qr=E(ve=>{"use strict";Object.defineProperty(ve,"__esModule",{value:!0});ve.diffArrays=ti;ve.arrayDiff=void 0;var Qu=ei(Mr());function ei(e){return e&&e.__esModule?e:{default:e}}var Se=new Qu.default;ve.arrayDiff=Se;Se.tokenize=function(e){return e.slice()};Se.join=Se.removeEmpty=function(e){return e};function ti(
`,o(u.gutter,g.replace(/\d/g," "))," ",G,o(u.marker,"^").repeat(ae)].join(""),b&&r.message&&(se+=" "+o(u.message,r.message))}return[o(u.marker,">"),o(u.gutter,g),p.length>0?` ${p}`:"",se].join("")}else return` ${o(u.gutter,g)}${p.length>0?` ${p}`:""}`}).join(`
`);return r.message&&!d&&(f=`${" ".repeat(l+1)}${r.message}
${f}`),n?i.reset(f):f}function So(e,t,r,n={}){if(!Zn){Zn=!0;let u="Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";{let o=new Error(u);o.name="DeprecationWarning",console.warn(new Error(u))}}return r=Math.max(r,0),eu(e,{start:{column:r,line:t}},n)}});var xs={};ge(xs,{__debug:()=>_s,check:()=>gs,doc:()=>wt,format:()=>Vu,formatWithCursor:()=>$u,getSupportInfo:()=>ys,util:()=>Bt,version:()=>qu});var Ju=(e,t,r,n)=>{if(!(e&&t==null))return t.replaceAll?t.replaceAll(r,n):r.global?t.replace(r,n):t.split(r).join(n)},De=Ju;var Bu=kt(qr(),1);var U="string",V="array",K="cursor",v="indent",T="align",N="trim",A="group",w="fill",B="if-break",P="indent-if-break",R="line-suffix",I="line-suffix-boundary",x="line",k="label",O="break-parent",tt=new Set([K,v,T,N,A,w,B,P,R,I,x,k,O]);function ri(e){if(typeof e=="string")return U;if(Array.isArray(e))return V;if(!e)return;let{type:t}=e;if(tt.has(t))return t}var H=ri;var ni=e=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(e);function ui(e){let t=e===null?"null":typeof e;if(t!=="string"&&t!=="object")return`Unexpected doc '${t}',
Expected it to be 'string' or 'object'.`;if(H(e))throw new Error("doc is valid.");let r=Object.prototype.toString.call(e);if(r!=="[object Object]")return`Unexpected doc '${r}'.`;let n=ni([...tt].map(i=>`'${i}'`));return`Unexpected doc.type '${e.type}'.
Expected it to be ${n}.`}var Tt=class extends Error{name="InvalidDocError";constructor(t){super(ui(t)),this.doc=t}},te=Tt;var $r={};function ii(e,t,r,n){let i=[e];for(;i.length>0;){let u=i.pop();if(u===$r){r(i.pop());continue}r&&i.push(u,$r);let o=H(u);if(!o)throw new te(u);if((t==null?void 0:t(u))!==!1)switch(o){case V:case w:{let s=o===V?u:u.parts;for(let a=s.length,D=a-1;D>=0;--D)i.push(s[D]);break}case B:i.push(u.flatContents,u.breakContents);break;case A:if(n&&u.expandedStates)for(let s=u.expandedStates.length,a=s-1;a>=0;--a)i.push(u.expandedStates[a]);else i.push(u.contents);break;case T:case v:case P:case k:case R:i.push(u.contents);break;case U:case K:case N:case I:case x:case O:break;default:throw new te(u)}}}var Te=ii;var Vr=()=>{},J=Vr,rt=Vr;function Fe(e){return J(e),{type:v,contents:e}}function de(e,t){return J(t),{type:T,contents:t,n:e}}function Nt(e,t={}){return J(e),rt(t.expandedStates,!0),{type:A,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function zr(e){return de(Number.NEGATIVE_INFINITY,e)}function Wr(e){return de({type:"root"},e)}function Gr(e){return de(-1,e)}function Ur(e,t){return Nt(e[0],{...t,expandedStates:e})}function nt(e){return rt(e),{type:w,parts:e}}function Kr(e,t="",r={}){return J(e),t!==""&&J(t),{type:B,breakContents:e,flatContents:t,groupId:r.groupId}}function Hr(e,t){return J(e),{type:P,contents:e,groupId:t.groupId,negate:t.negate}}function Ne(e){return J(e),{type:R,contents:e}}var Jr={type:I},_e={type:O},Xr={type:N},Pe={type:x,hard:!0},Pt={type:x,hard:!0,literal:!0},ut={type:x},Zr={type:x,soft:!0},X=[Pe,_e],it=[Pt,_e],Re={type:K};function Ie(e,t){J(e),rt(t);let r=[];for(let n=0;n<t.length;n++)n!==0&&r.push(e),r.push(t[n]);return r}function ot(e,t,r){J(e);let n=e;if(t>0){for(let i=0;i<Math.floor(t/r);++i)n=Fe(n);n=de(t%r,n),n=de(Number.NEGATIVE_INFINITY,n)}return n}function Qr(e,t){return J(t),e?{type:k,label:e,contents:t}:t}var oi=(e,t,r)=>{if(!(e&&t==null))return Array.isArray(t)||typeof t=="string"?t[r<0?t.length+r:r]:t.at(r)},_=oi;function en(e){let t=e.indexOf("\r");return t>=0?e.charAt(t+1)===`
`?"crlf":"cr":"lf"}function Le(e){switch(e){case"cr":return"\r";case"crlf":return`\r
`;default:return`
`}}function Rt(e,t){let r;switch(t){case`
`:r=/\n/g;break;case"\r":r=/\r/g;break;case`\r
`:r=/\r\n/g;break;default:throw new Error(`Unexpected "eol" ${JSON.stringify(t)}.`)}let n=e.match(r);return n?n.length:0}function tn(e){return De(!1,e,/\r\n?/g,`
`)}var rn=()=>/[#*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\u26D3\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](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\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]|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\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])?|[\uDFC3\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\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-\uDDF5\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]|\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(?:[\uDC08\uDC26](?:\u200D\u2B1B)?|[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\
`)):r)}function pi(e){if(e.type===x)return!0}function fn(e){return st(e,pi,!1)}function Dt(e,t){return e.type===k?{...e,contents:t(e.contents)}:t(e)}var L=Symbol("MODE_BREAK"),Z=Symbol("MODE_FLAT"),qe=Symbol("cursor");function pn(){return{value:"",length:0,queue:[]}}function di(e,t){return It(e,{type:"indent"},t)}function Fi(e,t,r){return t===Number.NEGATIVE_INFINITY?e.root||pn():t<0?It(e,{type:"dedent"},r):t?t.type==="root"?{...e,root:e}:It(e,{type:typeof t=="string"?"stringAlign":"numberAlign",n:t},r):e}function It(e,t,r){let n=t.type==="dedent"?e.queue.slice(0,-1):[...e.queue,t],i="",u=0,o=0,s=0;for(let f of n)switch(f.type){case"indent":c(),r.useTabs?a(1):D(r.tabWidth);break;case"stringAlign":c(),i+=f.n,u+=f.n.length;break;case"numberAlign":o+=1,s+=f.n;break;default:throw new Error(`Unexpected type '${f.type}'`)}return l(),{...e,value:i,length:u,queue:n};function a(f){i+=" ".repeat(f),u+=r.tabWidth*f}function D(f){i+=" ".repeat(f),u+=f}function c(){r.useTabs?d():l()}function d(){o>0&&a(o),F()}function l(){s>0&&D(s),F()}function F(){o=0,s=0}}function Lt(e){let t=0,r=0,n=e.length;e:for(;n--;){let i=e[n];if(i===qe){r++;continue}for(let u=i.length-1;u>=0;u--){let o=i[u];if(o===" "||o===" ")t++;else{e[n]=i.slice(0,u+1);break e}}}if(t>0||r>0)for(e.length=n+1;r-- >0;)e.push(qe);return t}function ct(e,t,r,n,i,u){if(r===Number.POSITIVE_INFINITY)return!0;let o=t.length,s=[e],a=[];for(;r>=0;){if(s.length===0){if(o===0)return!0;s.push(t[--o]);continue}let{mode:D,doc:c}=s.pop();switch(H(c)){case U:a.push(c),r-=je(c);break;case V:case w:{let d=sn(c);for(let l=d.length-1;l>=0;l--)s.push({mode:D,doc:d[l]});break}case v:case T:case P:case k:s.push({mode:D,doc:c.contents});break;case N:r+=Lt(a);break;case A:{if(u&&c.break)return!1;let d=c.break?L:D,l=c.expandedStates&&d===L?_(!1,c.expandedStates,-1):c.contents;s.push({mode:d,doc:l});break}case B:{let l=(c.groupId?i[c.groupId]||Z:D)===L?c.breakContents:c.flatContents;l&&s.push({mode:D,doc:l});break}case x:if(D===L||c.hard)return!0;c.soft||(a.push(" "),r--);break;case R:n=!0;break;case I:if(n)return!1;break}}return!1}function xe(e,t){let r={},n=t.printWidth,i=Le(t.endOfLine),u=0,o=[{ind:pn(),mode:L,doc:e}],s=[],a=!1,D=[],c=0;for(Dn(e);o.length>0;){let{ind:l,mode:F,doc:f}=o.pop();switch(H(f)){case U:{let p=i!==`
`?De(!1,f,`
`,i):f;s.push(p),o.length>0&&(u+=je(p));break}case V:for(let p=f.length-1;p>=0;p--)o.push({ind:l,mode:F,doc:f[p]});break;case K:if(c>=2)throw new Error("There are too many 'cursor' in doc.");s.push(qe),c++;break;case v:o.push({ind:di(l,t),mode:F,doc:f.contents});break;case T:o.push({ind:Fi(l,f.n,t),mode:F,doc:f.contents});break;case N:u-=Lt(s);break;case A:switch(F){case Z:if(!a){o.push({ind:l,mode:f.break?L:Z,doc:f.contents});break}case L:{a=!1;let p={ind:l,mode:Z,doc:f.contents},m=n-u,h=D.length>0;if(!f.break&&ct(p,o,m,h,r))o.push(p);else if(f.expandedStates){let C=_(!1,f.expandedStates,-1);if(f.break){o.push({ind:l,mode:L,doc:C});break}else for(let g=1;g<f.expandedStates.length+1;g++)if(g>=f.expandedStates.length){o.push({ind:l,mode:L,doc:C});break}else{let y=f.expandedStates[g],b={ind:l,mode:Z,doc:y};if(ct(b,o,m,h,r)){o.push(b);break}}}else o.push({ind:l,mode:L,doc:f.contents});break}}f.id&&(r[f.id]=_(!1,o,-1).mode);break;case w:{let p=n-u,{parts:m}=f;if(m.length===0)break;let[h,C]=m,g={ind:l,mode:Z,doc:h},y={ind:l,mode:L,doc:h},b=ct(g,[],p,D.length>0,r,!0);if(m.length===1){b?o.push(g):o.push(y);break}let se={ind:l,mode:Z,doc:C},G={ind:l,mode:L,doc:C};if(m.length===2){b?o.push(se,g):o.push(G,y);break}m.splice(0,2);let ae={ind:l,mode:F,doc:nt(m)},Lr=m[0];ct({ind:l,mode:Z,doc:[h,C,Lr]},[],p,D.length>0,r,!0)?o.push(ae,se,g):b?o.push(ae,G,g):o.push(ae,G,y);break}case B:case P:{let p=f.groupId?r[f.groupId]:F;if(p===L){let m=f.type===B?f.breakContents:f.negate?f.contents:Fe(f.contents);m&&o.push({ind:l,mode:F,doc:m})}if(p===Z){let m=f.type===B?f.flatContents:f.negate?Fe(f.contents):f.contents;m&&o.push({ind:l,mode:F,doc:m})}break}case R:D.push({ind:l,mode:F,doc:f.contents});break;case I:D.length>0&&o.push({ind:l,mode:F,doc:Pe});break;case x:switch(F){case Z:if(f.hard)a=!0;else{f.soft||(s.push(" "),u+=1);break}case L:if(D.length>0){o.push({ind:l,mode:F,doc:f},...D.reverse()),D.length=0;break}f.literal?l.root?(s.push(i,l.root.value),u=l.root.length):(s.push(i),u=0):(u-=Lt(s),s.push(i+l.value),u=l.length);break}break;case k:o.push({ind:l,mode:F,doc:f.contents});break;case O:break;default:throw new te(f)}o.length===0&&D.length>0&&(o.push(...D.reverse()),D.length=0)}let d=s.indexOf(qe);if(d!==-1){let l=s.indexOf(qe,d+1),F=s.slice(0,d).join(""),f=s.slice(d+1,l).join(""),p=s.slice(l+1).join("");return{formatted:F+f+p,cursorNodeStart:F.length,cursorNodeText:f}}return{formatted:s.join("")}}function re(e){var t;if(!e)return"";if(Array.isArray(e)){let r=[];for(let n of e)if(Array.isArray(n))r.push(...re(n));else{let i=re(n);i!==""&&r.push(i)}return r}return e.type===B?{...e,breakContents:re(e.breakContents),flatContents:re(e.flatContents)}:e.type===A?{...e,contents:re(e.contents),expandedStates:(t=e.expandedStates)==null?void 0:t.map(re)}:e.type===w?{type:"fill",parts:e.parts.map(re)}:e.contents?{...e,contents:re(e.contents)}:e}function dn(e){let t=Object.create(null),r=new Set;return n(re(e));function n(u,o,s){var a,D;if(typeof u=="string")return JSON.stringify(u);if(Array.isArray(u)){let c=u.map(n).filter(Boolean);return c.length===1?c[0]:`[${c.join(", ")}]`}if(u.type===x){let c=((a=s==null?void 0:s[o+1])==null?void 0:a.type)===O;return u.literal?c?"literalline":"literallineWithoutBreakParent":u.hard?c?"hardline":"hardlineWithoutBreakParent":u.soft?"softline":"line"}if(u.type===O)return((D=s==null?void 0:s[o-1])==null?void 0:D.type)===x&&s[o-1].hard?void 0:"breakParent";if(u.type===N)return"trim";if(u.type===v)return"indent("+n(u.contents)+")";if(u.type===T)return u.n===Number.NEGATIVE_INFINITY?"dedentToRoot("+n(u.contents)+")":u.n<0?"dedent("+n(u.contents)+")":u.n.type==="root"?"markAsRoot("+n(u.contents)+")":"align("+JSON.stringify(u.n)+", "+n(u.contents)+")";if(u.type===B)return"ifBreak("+n(u.breakContents)+(u.flatContents?", "+n(u.flatContents):"")+(u.groupId?(u.flatContents?"":', ""')+`, { groupId: ${i(u.groupId)} }`:"")+")";if(u.type===P){let c=[];u.negate&&c.push("negate: true"),u.groupId&&c.push(`groupId: ${i(u.groupId)}`);let d=c.length>0?`, { ${c.join(", ")} }`:"";return`indentIfBreak(${n(u.contents)}${d})`}if(u.type===A
This option cannot be used with --range-start and --range-end.`,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
(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:"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"}]},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).
The range will extend forwards to the end of the selected statement.
This option cannot be used with --cursor-offset.`,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.
The range will extend backwards to the start of the first line containing the selected statement.
This option cannot be used with --cursor-offset.`,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 lt({plugins:e=[],showDeprecated:t=!1}={}){let r=e.flatMap(i=>i.languages??[]),n=[];for(let i of Ei(Object.assign({},...e.map(({options:u})=>u),Fn)))!t&&i.deprecated||(Array.isArray(i.choices)&&(t||(i.choices=i.choices.filter(u=>!u.deprecated)),i.name==="parser"&&(i.choices=[...i.choices,...hi(i.choices,r,e)])),i.pluginDefaults=Object.fromEntries(e.filter(u=>{var o;return((o=u.defaultOptions)==null?void 0:o[i.name])!==void 0}).map(u=>[u.name,u.defaultOptions[i.name]])),n.push(i));return{languages:r,options:n}}function*hi(e,t,r){let n=new Set(e.map(i=>i.value));for(let i of t)if(i.parsers){for(let u of i.parsers)if(!n.has(u)){n.add(u);let o=r.find(a=>a.parsers&&Object.prototype.hasOwnProperty.call(a.parsers,u)),s=i.name;o!=null&&o.name&&(s+=` (plugin: ${o.name})`),yield{value:u,description:s}}}}function Ei(e){let t=[];for(let[r,n]of Object.entries(e)){let i={name:r,...n};Array.isArray(i.default)&&(i.default=_(!1,i.default,-1).value),t.push(i)}return t}var Ci=e=>e.split(/[/\\]/).pop();function mn(e,t){if(!t)return;let r=Ci(t).toLowerCase();return e.find(n=>{var i,u;return((i=n.extensions)==null?void 0:i.some(o=>r.endsWith(o)))||((u=n.filenames)==null?void 0:u.some(o=>o.toLowerCase()===r))})}function gi(e,t){if(t)return e.find(({name:r})=>r.toLowerCase()===t)??e.find(({aliases:r})=>r==null?void 0:r.includes(t))??e.find(({extensions:r})=>r==null?void 0:r.includes(`.${t}`))}function yi(e,t){let r=e.plugins.flatMap(i=>i.languages??[]),n=gi(r,t.language)??mn(r,t.physicalFile)??mn(r,t.file)??(t.physicalFile,void 0);return n==null?void 0:n.parsers[0]}var hn=yi;var z=kt(Vn(),1),gr;function Co(e,t,{logger:r=!1,isCLI:n=!1,passThrough:i=!1,FlagSchema:u,descriptor:o}={}){if(n){if(!u)throw new Error("'FlagSchema' option is required.");if(!o)throw new Error("'descriptor' option is required.")}else o=z.default.apiDescriptor;let s=i?Array.isArray(i)?(l,F)=>i.includes(l)?{[l]:F}:void 0:(l,F)=>({[l]:F}):(l,F,f)=>{let{_:p,...m}=f.schemas;return z.default.levenUnknownHandler(l,F,{...f,schemas:m})},a=go(t,{isCLI:n,FlagSchema:u}),D=new z.default.Normalizer(a,{logger:r,unknown:s,descriptor:o}),c=r!==!1;c&&gr&&(D._hasDeprecationWarned=gr);let d=D.normalize(e);return c&&(gr=D._hasDeprecationWarned),d}function go(e,{isCLI:t,FlagSchema:r}){let n=[];t&&n.push(z.default.AnySchema.create({name:"_"}));for(let i of e)n.push(yo(i,{isCLI:t,optionInfos:e,FlagSchema:r})),i.alias&&t&&n.push(z.default.AliasSchema.create({name:i.alias,sourceName:i.name}));return n}function yo(e,{isCLI:t,optionInfos:r,FlagSchema:n}){let{name:i}=e,u={name:i},o,s={};switch(e.type){case"int":o=z.default.IntegerSchema,t&&(u.preprocess=Number);break;case"string":o=z.default.StringSchema;break;case"choice":o=z.default.ChoiceSchema,u.choices=e.choices.map(a=>a!=null&&a.redirect?{...a,redirect:{to:{key:e.name,value:a.redirect}}}:a);break;case"boolean":o=z.default.BooleanSchema;break;case"flag":o=n,u.flags=r.flatMap(a=>[a.alias,a.description&&a.name,a.oppositeDescription&&`no-${a.name}`].filter(Boolean));break;case"path":o=z.default.StringSchema;break;default:throw new Error(`Unexpected type ${e.type}`)}if(e.exception?u.validate=(a,D,c)=>e.exception(a)||D.validate(a,c):u.validate=(a,D,c)=>a===void 0||D.validate(a,c),e.redirect&&(s.redirect=a=>a?{to:{key:e.redirect.option,value:e.redirect.value}}:void 0),e.deprecated&&(s.deprecated=!0),t&&!e.array){let a=u.preprocess||(D=>D);u.preprocess=(D,c,d)=>c.preprocess(a(Array.isArray(D)?_(!1,D,-1):D),d)}return e.array?z.default.A
`+n,e.codeFrame=n,e}throw e}var Ee=vo;var Ke,Ar,Be,yt,br=class{constructor(t){St(this,Ke);St(this,Be);this.stack=[t]}get key(){let{stack:t,siblings:r}=this;return _(!1,t,r===null?-2:-4)??null}get index(){return this.siblings===null?null:_(!1,this.stack,-2)}get node(){return _(!1,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:t}=this,r=_(!1,t,-3);return Array.isArray(r)?r:null}get next(){let{siblings:t}=this;return t===null?null:t[this.index+1]}get previous(){let{siblings:t}=this;return t===null?null:t[this.index-1]}get isFirst(){return this.index===0}get isLast(){let{siblings:t,index:r}=this;return t!==null&&r===t.length-1}get isRoot(){return this.stack.length===1}get root(){return this.stack[0]}get ancestors(){return[...ye(this,Be,yt).call(this)]}getName(){let{stack:t}=this,{length:r}=t;return r>1?_(!1,t,-2):null}getValue(){return _(!1,this.stack,-1)}getNode(t=0){let r=ye(this,Ke,Ar).call(this,t);return r===-1?null:this.stack[r]}getParentNode(t=0){return this.getNode(t+1)}call(t,...r){let{stack:n}=this,{length:i}=n,u=_(!1,n,-1);for(let o of r)u=u[o],n.push(o,u);try{return t(this)}finally{n.length=i}}callParent(t,r=0){let n=ye(this,Ke,Ar).call(this,r+1),i=this.stack.splice(n+1);try{return t(this)}finally{this.stack.push(...i)}}each(t,...r){let{stack:n}=this,{length:i}=n,u=_(!1,n,-1);for(let o of r)u=u[o],n.push(o,u);try{for(let o=0;o<u.length;++o)n.push(o,u[o]),t(this,o,u),n.length-=2}finally{n.length=i}}map(t,...r){let n=[];return this.each((i,u,o)=>{n[u]=t(i,u,o)},...r),n}match(...t){let r=this.stack.length-1,n=null,i=this.stack[r--];for(let u of t){if(i===void 0)return!1;let o=null;if(typeof n=="number"&&(o=n,n=this.stack[r--],i=this.stack[r--]),u&&!u(i,n,o))return!1;n=this.stack[r--],i=this.stack[r--]}return!0}findAncestor(t){for(let r of ye(this,Be,yt).call(this))if(t(r))return r}hasAncestor(t){for(let r of ye(this,Be,yt).call(this))if(t(r))return!0;return!1}};Ke=new WeakSet,Ar=function(t){let{stack:r}=this;for(let n=r.length-1;n>=0;n-=2)if(!Array.isArray(r[n])&&--t<0)return n;return-1},Be=new WeakSet,yt=function*(){let{stack:t}=this;for(let r=t.length-3;r>=0;r-=2){let n=t[r];Array.isArray(n)||(yield n)}};var nu=br;var He=()=>{};He.ok=He;He.strictEqual=He;var Je=He;function we(e){return(t,r,n)=>{let i=!!(n!=null&&n.backwards);if(r===!1)return!1;let{length:u}=t,o=r;for(;o>=0&&o<u;){let s=t.charAt(o);if(e instanceof RegExp){if(!e.test(s))return o}else if(!e.includes(s))return o;i?o--:o++}return o===-1||o===u?o:!1}}var uu=we(/\s/),S=we(" "),_t=we(",; "),xt=we(/[^\n\r]/);function No(e,t,r){let n=!!(r!=null&&r.backwards);if(t===!1)return!1;let i=e.charAt(t);if(n){if(e.charAt(t-1)==="\r"&&i===`
`)return t-2;if(i===`
`||i==="\r"||i==="\u2028"||i==="\u2029")return t-1}else{if(i==="\r"&&e.charAt(t+1)===`
`)return t+2;if(i===`
`||i==="\r"||i==="\u2028"||i==="\u2029")return t+1}return t}var $=No;function Po(e,t,r={}){let n=S(e,r.backwards?t-1:t,r),i=$(e,n,r);return n!==i}var W=Po;function Ro(e){return Array.isArray(e)&&e.length>0}var Br=Ro;function Io(e){return e!==null&&typeof e=="object"}var iu=Io;function*wr(e,t){let{getVisitorKeys:r,filter:n=()=>!0}=t,i=u=>iu(u)&&n(u);for(let u of r(e)){let o=e[u];if(Array.isArray(o))for(let s of o)i(s)&&(yield s);else i(o)&&(yield o)}}function*ou(e,t){let r=[e];for(let n=0;n<r.length;n++){let i=r[n];for(let u of wr(i,t))yield u,r.push(u)}}function Lo(e){let t=e.type||e.kind||"(unknown type)",r=String(e.name||e.id&&(typeof e.id=="object"?e.id.name:e.id)||e.key&&(typeof e.key=="object"?e.key.name:e.key)||e.value&&(typeof e.value=="object"?"":String(e.value))||e.operator||"");return r.length>20&&(r=r.slice(0,19)+"\u2026"),t+(r?" "+r:"")}function Or(e,t){(e.comments??(e.comments=[])).push(t),t.printed=!1,t.nodeDescription=Lo(e)}function fe(e,t){t.leading=!0,t.trailing=!1,Or(e,t)}function oe(e,t,r){t.leading=!1,t.trailing=!1,r&&(t.marker=r),Or(e,t)}function pe(e,t){t.leading=!1,t.trailing=!0,Or(e,t)}var kr=new WeakMap;function bt(e,t){if(kr.has(e))return kr.get(e);let{printer:{getCommentChildNodes:r,canAttachComment:n,getVisitorKeys:i},locStart:u,locEnd:o}=t;if(!n)return[];let s=((r==null?void 0:r(e,t))??[...wr(e,{getVisitorKeys:ee(i)})]).flatMap(a=>n(a)?[a]:bt(a,t));return s.sort((a,D)=>u(a)-u(D)||o(a)-o(D)),kr.set(e,s),s}function au(e,t,r,n){let{locStart:i,locEnd:u}=r,o=i(t),s=u(t),a=bt(e,r),D,c,d=0,l=a.length;for(;d<l;){let F=d+l>>1,f=a[F],p=i(f),m=u(f);if(p<=o&&s<=m)return au(f,t,r,f);if(m<=o){D=f,d=F+1;continue}if(s<=p){c=f,l=F;continue}throw new Error("Comment location overlaps with node location")}if((n==null?void 0:n.type)==="TemplateLiteral"){let{quasis:F}=n,f=vr(F,t,r);D&&vr(F,D,r)!==f&&(D=null),c&&vr(F,c,r)!==f&&(c=null)}return{enclosingNode:n,precedingNode:D,followingNode:c}}var Sr=()=>!1;function Du(e,t){let{comments:r}=e;if(delete e.comments,!Br(r)||!t.printer.canAttachComment)return;let n=[],{locStart:i,locEnd:u,printer:{experimentalFeatures:{avoidAstMutation:o=!1}={},handleComments:s={}},originalText:a}=t,{ownLine:D=Sr,endOfLine:c=Sr,remaining:d=Sr}=s,l=r.map((F,f)=>({...au(e,F,t),comment:F,text:a,options:t,ast:e,isLastComment:r.length-1===f}));for(let[F,f]of l.entries()){let{comment:p,precedingNode:m,enclosingNode:h,followingNode:C,text:g,options:y,ast:b,isLastComment:se}=f;if(y.parser==="json"||y.parser==="json5"||y.parser==="__js_expression"||y.parser==="__ts_expression"||y.parser==="__vue_expression"||y.parser==="__vue_ts_expression"){if(i(p)-i(b)<=0){fe(b,p);continue}if(u(p)-u(b)>=0){pe(b,p);continue}}let G;if(o?G=[f]:(p.enclosingNode=h,p.precedingNode=m,p.followingNode=C,G=[p,g,y,b,se]),jo(g,y,l,F))p.placement="ownLine",D(...G)||(C?fe(C,p):m?pe(m,p):h?oe(h,p):oe(b,p));else if(Yo(g,y,l,F))p.placement="endOfLine",c(...G)||(m?pe(m,p):C?fe(C,p):h?oe(h,p):oe(b,p));else if(p.placement="remaining",!d(...G))if(m&&C){let ae=n.length;ae>0&&n[ae-1].followingNode!==C&&su(n,y),n.push(f)}else m?pe(m,p):C?fe(C,p):h?oe(h,p):oe(b,p)}if(su(n,t),!o)for(let F of r)delete F.precedingNode,delete F.enclosingNode,delete F.followingNode}var cu=e=>!/[\S\n\u2028\u2029]/.test(e);function jo(e,t,r,n){let{comment:i,precedingNode:u}=r[n],{locStart:o,locEnd:s}=t,a=o(i);if(u)for(let D=n-1;D>=0;D--){let{comment:c,precedingNode:d}=r[D];if(d!==u||!cu(e.slice(s(c),a)))break;a=o(c)}return W(e,a,{backwards:!0})}function Yo(e,t,r,n){let{comment:i,followingNode:u}=r[n],{locStart:o,locEnd:s}=t,a=s(i);if(u)for(let D=n+1;D<r.length;D++){let{comment:c,followingNode:d}=r[D];if(d!==u||!cu(e.slice(a,o(c))))break;a=s(c)}return W(e,a)}function su(e,t){var s,a;let r=e.length;if(r===0)return;let{precedingNode:n,followingNode:i}=e[0],u=t.locStart(i),o;for(o=r;o>0;--o){let{comment:D,precedingNode:c,followingNode:d}=e[o-1];Je.strictEqual(c,n),Je.strictEqual(d,i);let l=t.originalText.slice(t.locEnd(D),u);if(((a=(s=t.printer).isGap)==null?void 0:a.call(s,l,t))??/^[\s(]*$/.test(l))u=t.locStart(D);else break}for(let[D,{comment:c}]of e.entries())D
`,i)+1),a=n.slice(s,i).match(/^\s*/)[0],D=be(a,t.tabWidth),c=await Ou(o,{...t,rangeStart:0,rangeEnd:Number.POSITIVE_INFINITY,cursorOffset:t.cursorOffset>i&&t.cursorOffset<=u?t.cursorOffset-i:-1,endOfLine:"lf"},D),d=c.formatted.trimEnd(),{cursorOffset:l}=t;l>u?l+=d.length-o.length:c.cursorOffset>=0&&(l=c.cursorOffset+i);let F=n.slice(0,i)+d+n.slice(u);if(t.endOfLine!=="lf"){let f=Le(t.endOfLine);l>=0&&f===`\r
`&&(l+=Rt(F.slice(0,l),`
`)),F=De(!1,F,`
`,f)}return{formatted:F,cursorOffset:l,comments:c.comments}}function Pr(e,t,r){return typeof t!="number"||Number.isNaN(t)||t<0||t>e.length?r:t}function bu(e,t){let{cursorOffset:r,rangeStart:n,rangeEnd:i}=t;return r=Pr(e,r,-1),n=Pr(e,n,0),i=Pr(e,i,e.length),{...t,cursorOffset:r,rangeStart:n,rangeEnd:i}}function ku(e,t){let{cursorOffset:r,rangeStart:n,rangeEnd:i,endOfLine:u}=bu(e,t),o=e.charAt(0)===wu;if(o&&(e=e.slice(1),r--,n--,i--),u==="auto"&&(u=en(e)),e.includes("\r")){let s=a=>Rt(e.slice(0,Math.max(a,0)),`\r
`);r-=s(r),n-=s(n),i-=s(i),e=tn(e)}return{hasBOM:o,text:e,options:bu(e,{...t,cursorOffset:r,rangeStart:n,rangeEnd:i,endOfLine:u})}}async function Au(e,t){let r=await Ct(t);return!r.hasPragma||r.hasPragma(e)}async function Rr(e,t){let{hasBOM:r,text:n,options:i}=ku(e,await le(t));if(i.rangeStart>=i.rangeEnd&&n!==""||i.requirePragma&&!await Au(n,i))return{formatted:e,cursorOffset:t.cursorOffset,comments:[]};let u;return i.rangeStart>0||i.rangeEnd<n.length?u=await Qo(n,i):(!i.requirePragma&&i.insertPragma&&i.printer.insertPragma&&!await Au(n,i)&&(n=i.printer.insertPragma(n)),u=await Ou(n,i)),r&&(u.formatted=wu+u.formatted,u.cursorOffset>=0&&u.cursorOffset++),u}async function Su(e,t,r){let{text:n,options:i}=ku(e,await le(t)),u=await Ee(n,i);return r&&(r.preprocessForPrint&&(u.ast=await Tr(u.ast,i)),r.massage&&(u.ast=Hn(u.ast,i))),u}async function vu(e,t){t=await le(t);let r=await Ze(e,t);return xe(r,t)}async function Tu(e,t){let r=dn(e),{formatted:n}=await Rr(r,{...t,parser:"__js_expression"});return n}async function Nu(e,t){t=await le(t);let{ast:r}=await Ee(e,t);return Ze(r,t)}async function Pu(e,t){return xe(e,await le(t))}var Bt={};ge(Bt,{addDanglingComment:()=>oe,addLeadingComment:()=>fe,addTrailingComment:()=>pe,getAlignmentSize:()=>be,getIndentSize:()=>Iu,getMaxContinuousCount:()=>Ru,getNextNonSpaceNonCommentCharacter:()=>Yu,getNextNonSpaceNonCommentCharacterIndex:()=>fs,getStringWidth:()=>je,hasNewline:()=>W,hasNewlineInRange:()=>Lu,hasSpaces:()=>ju,isNextLineEmpty:()=>ms,isNextLineEmptyAfterIndex:()=>At,isPreviousLineEmpty:()=>ds,makeString:()=>Mu,skip:()=>we,skipEverythingButNewLine:()=>xt,skipInlineComment:()=>Oe,skipNewline:()=>$,skipSpaces:()=>S,skipToLineEnd:()=>_t,skipTrailingComment:()=>ke,skipWhitespace:()=>uu});function ts(e,t){if(t===!1)return!1;if(e.charAt(t)==="/"&&e.charAt(t+1)==="*"){for(let r=t+2;r<e.length;++r)if(e.charAt(r)==="*"&&e.charAt(r+1)==="/")return r+2}return t}var Oe=ts;function rs(e,t){return t===!1?!1:e.charAt(t)==="/"&&e.charAt(t+1)==="/"?xt(e,t):t}var ke=rs;function ns(e,t){let r=null,n=t;for(;n!==r;)r=n,n=S(e,n),n=Oe(e,n),n=ke(e,n),n=$(e,n);return n}var Qe=ns;function us(e,t){let r=null,n=t;for(;n!==r;)r=n,n=_t(e,n),n=Oe(e,n),n=S(e,n);return n=ke(e,n),n=$(e,n),n!==!1&&W(e,n)}var At=us;function Ir(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function is(e,t){let r=e.match(new RegExp(`(${Ir(t)})+`,"g"));return r===null?0:r.reduce((n,i)=>Math.max(n,i.length/t.length),0)}var Ru=is;function os(e,t){let r=e.lastIndexOf(`
`);return r===-1?0:be(e.slice(r+1).match(/^[\t ]*/)[0],t)}var Iu=os;function ss(e,t,r){for(let n=t;n<r;++n)if(e.charAt(n)===`
`)return!0;return!1}var Lu=ss;function as(e,t,r={}){return S(e,r.backwards?t-1:t,r)!==t}var ju=as;function Ds(e,t){let r=Qe(e,t);return r===!1?"":e.charAt(r)}var Yu=Ds;function cs(e,t,r){let n=t==='"'?"'":'"',u=De(!1,e,/\\(.)|(["'])/gs,(o,s,a)=>s===n?s:a===t?"\\"+a:a||(r&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/.test(s)?s:"\\"+s));return t+u+t}var Mu=cs;function ls(e,t,r){return Qe(e,r(t))}function fs(e,t){return arguments.length===2||typeof t=="number"?Qe(e,t):ls(...arguments)}function ps(e,t,r){return Xe(e,r(t))}function ds(e,t){return arguments.length===2||typeof t=="number"?Xe(e,t):ps(...arguments)}function Fs(e,t,r){return At(e,r(t))}function ms(e,t){return arguments.length===2||typeof t=="number"?At(e,t):Fs(...arguments)}var wt={};ge(wt,{builders:()=>hs,printer:()=>Es,utils:()=>Cs});var hs={join:Ie,line:ut,softline:Zr,hardline:X,literalline:it,group:Nt,conditionalGroup:Ur,fill:nt,lineSuffix:Ne,lineSuffixBoundary:Jr,cursor:Re,breakParent:_e,ifBreak:Kr,trim:Xr,indent:Fe,indentIfBreak:Hr,align:de,addAlignmentToDoc:ot,markAsRoot:Wr,dedentToRoot:zr,dedent:Gr,hardlineWithoutBreakParent:Pe,literallineWithoutBreakParent:Pt,label:Qr,concat:e=>e},Es={printDocToString:xe},Cs={willBreak:an,traverseDoc:Te,findInDoc:st,mapDoc:Me,removeLines:cn,stripTrailingHardline:at,replaceEndOfLine:ln,canBreak:fn};var qu="3.0.0";function Ce(e,t=1){return async(...r)=>{let n=r[t]??{},i=n.plugins??[];return r[t]={...n,plugins:Array.isArray(i)?i:Object.values(i)},e(...r)}}var $u=Ce(Rr);async function Vu(e,t){let{formatted:r}=await $u(e,{...t,cursorOffset:-1});return r}async function gs(e,t){return await Vu(e,t)===e}var ys=Ce(lt,0),_s={parse:Ce(Su),formatAST:Ce(vu),formatDoc:Ce(Tu),printToDoc:Ce(Nu),printDocToString:Ce(Pu)};return Y(xs);});