UNPKG

prettier

Version:

Prettier is an opinionated code formatter

17 lines 95.2 kB
(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 Wn=Object.create;var Ve=Object.defineProperty;var $n=Object.getOwnPropertyDescriptor;var Vn=Object.getOwnPropertyNames;var Kn=Object.getPrototypeOf,Jn=Object.prototype.hasOwnProperty;var Gn=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),kt=(e,t)=>{for(var u in t)Ve(e,u,{get:t[u],enumerable:!0})},Nu=(e,t,u,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Vn(t))!Jn.call(e,o)&&o!==u&&Ve(e,o,{get:()=>t[o],enumerable:!(r=$n(t,o))||r.enumerable});return e};var zn=(e,t,u)=>(u=e!=null?Wn(Kn(e)):{},Nu(t||!e||!e.__esModule?Ve(u,"default",{value:e,enumerable:!0}):u,e)),Hn=e=>Nu(Ve({},"__esModule",{value:!0}),e);var nn=Gn((W0,rn)=>{var Ct,ht,gt,yt,bt,Ye,mu,Ue,At,tn,_t,je,xt,Bt,Tt,fe,un,Nt,St,ia;xt=/\/(?![*\/])(?:\[(?:[^\]\\\n\r\u2028\u2029]+|\\.)*\]|[^\/\\\n\r\u2028\u2029]+|\\.)*(\/[$_\u200C\u200D\p{ID_Continue}]*|\\)?/yu;je=/--|\+\+|=>|\.{3}|\??\.(?!\d)|(?:&&|\|\||\?\?|[+\-%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2}|\/(?![\/*]))=?|[?~,:;[\](){}]/y;Ct=/(\x23?)(?=[$_\p{ID_Start}\\])(?:[$_\u200C\u200D\p{ID_Continue}]+|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+/yu;Tt=/(['"])(?:[^'"\\\n\r]+|(?!\1)['"]|\\(?:\r\n|[^]))*(\1)?/y;_t=/(?:0[xX][\da-fA-F](?:_?[\da-fA-F])*|0[oO][0-7](?:_?[0-7])*|0[bB][01](?:_?[01])*)n?|0n|[1-9](?:_?\d)*n|(?:(?:0(?!\d)|0\d*[89]\d*|[1-9](?:_?\d)*)(?:\.(?:\d(?:_?\d)*)?)?|\.\d(?:_?\d)*)(?:[eE][+-]?\d(?:_?\d)*)?|0[0-7]+/y;fe=/[`}](?:[^`\\$]+|\\[^]|\$(?!\{))*(`|\$\{)?/y;St=/[\t\v\f\ufeff\p{Zs}]+/yu;Ue=/\r?\n|[\r\u2028\u2029]/y;At=/\/\*(?:[^*]+|\*(?!\/))*(\*\/)?/y;Bt=/\/\/.*/y;gt=/[<>.:={}]|\/(?![\/*])/y;ht=/[$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}-]*/yu;yt=/(['"])(?:[^'"]+|(?!\1)['"])*(\1)?/y;bt=/[^<>{}]+/y;Nt=/^(?:[\/+-]|\.{3}|\?(?:InterpolationIn(?:JSX|Template)|NoLineTerminatorHere|NonExpressionParenEnd|UnaryIncDec))?$|[{}([,;<>=*%&|^!~?:]$/;un=/^(?:=>|[;\]){}]|else|\?(?:NoLineTerminatorHere|NonExpressionParenEnd))?$/;Ye=/^(?:await|case|default|delete|do|else|instanceof|new|return|throw|typeof|void|yield)$/;mu=/^(?:return|throw|yield)$/;tn=RegExp(Ue.source);rn.exports=ia=function*(e,{jsx:t=!1}={}){var u,r,o,n,a,s,i,D,f,d,p,c,l,F;for({length:s}=e,n=0,a="",F=[{tag:"JS"}],u=[],p=0,c=!1;n<s;){switch(D=F[F.length-1],D.tag){case"JS":case"JSNonExpressionParen":case"InterpolationInTemplate":case"InterpolationInJSX":if(e[n]==="/"&&(Nt.test(a)||Ye.test(a))&&(xt.lastIndex=n,i=xt.exec(e))){n=xt.lastIndex,a=i[0],c=!0,yield{type:"RegularExpressionLiteral",value:i[0],closed:i[1]!==void 0&&i[1]!=="\\"};continue}if(je.lastIndex=n,i=je.exec(e)){switch(l=i[0],f=je.lastIndex,d=l,l){case"(":a==="?NonExpressionParenKeyword"&&F.push({tag:"JSNonExpressionParen",nesting:p}),p++,c=!1;break;case")":p--,c=!0,D.tag==="JSNonExpressionParen"&&p===D.nesting&&(F.pop(),d="?NonExpressionParenEnd",c=!1);break;case"{":je.lastIndex=0,o=!un.test(a)&&(Nt.test(a)||Ye.test(a)),u.push(o),c=!1;break;case"}":switch(D.tag){case"InterpolationInTemplate":if(u.length===D.nesting){fe.lastIndex=n,i=fe.exec(e),n=fe.lastIndex,a=i[0],i[1]==="${"?(a="?InterpolationInTemplate",c=!1,yield{type:"TemplateMiddle",value:i[0]}):(F.pop(),c=!0,yield{type:"TemplateTail",value:i[0],closed:i[1]==="`"});continue}break;case"InterpolationInJSX":if(u.length===D.nesting){F.pop(),n+=1,a="}",yield{type:"JSXPunctuator",value:"}"};continue}}c=u.pop(),d=c?"?ExpressionBraceEnd":"}";break;case"]":c=!0;break;case"++":case"--":d=c?"?PostfixIncDec":"?UnaryIncDec";break;case"<":if(t&&(Nt.test(a)||Ye.test(a))){F.push({tag:"JSXTag"}),n+=1,a="<",yield{type:"JSXPunctuator",value:l};continue}c=!1;break;default:c=!1}n=f,a=d,yield{type:"Punctuator",value:l};continue}if(Ct.lastIndex=n,i=Ct.exec(e)){switch(n=Ct.lastIndex,d=i[0],i[0]){case"for":case"if":case"while":case"with":a!=="."&&a!=="?."&&(d="?NonExpressionParenKeyword")}a=d,c=!Ye.test(i[0]),yield{type:i[1]==="#"?"PrivateIdentifier":"IdentifierName",value:i[0]};continue}if(Tt.lastIndex=n,i=Tt.exec(e)){n=Tt.lastIndex,a=i[0],c=!0,yield{type:"StringLiteral",value:i[0],closed:i[2]!==void 0};continue}if(_t.lastIndex=n,i=_t.exec(e)){n=_t.lastIndex,a=i[0],c=!0,yield{type:"NumericLiteral",value:i[0]};continue}if(fe.lastIndex=n,i=fe.exec(e)){n=fe.lastIndex,a=i[0],i[1]==="${"?(a="?InterpolationInTemplate",F.push({tag:"InterpolationInTemplate",nesting:u.length}),c=!1,yield{type:"TemplateHead",value:i[0]}):(c=!0,yield{type:"NoSubstitutionTemplate",value:i[0],closed:i[1]==="`"});continue}break;case"JSXTag":case"JSXTagEnd":if(gt.lastIndex=n,i=gt.exec(e)){switch(n=gt.lastIndex,d=i[0],i[0]){case"<":F.push({tag:"JSXTag"});break;case">":F.pop(),a==="/"||D.tag==="JSXTagEnd"?(d="?JSX",c=!0):F.push({tag:"JSXChildren"});break;case"{":F.push({tag:"InterpolationInJSX",nesting:u.length}),d="?InterpolationInJSX",c=!1;break;case"/":a==="<"&&(F.pop(),F[F.length-1].tag==="JSXChildren"&&F.pop(),F.push({tag:"JSXTagEnd"}))}a=d,yield{type:"JSXPunctuator",value:i[0]};continue}if(ht.lastIndex=n,i=ht.exec(e)){n=ht.lastIndex,a=i[0],yield{type:"JSXIdentifier",value:i[0]};continue}if(yt.lastIndex=n,i=yt.exec(e)){n=yt.lastIndex,a=i[0],yield{type:"JSXString",value:i[0],closed:i[2]!==void 0};continue}break;case"JSXChildren":if(bt.lastIndex=n,i=bt.exec(e)){n=bt.lastIndex,a=i[0],yield{type:"JSXText",value:i[0]};continue}switch(e[n]){case"<":F.push({tag:"JSXTag"}),n++,a="<",yield{type:"JSXPunctuator",value:"<"};continue;case"{":F.push({tag:"InterpolationInJSX",nesting:u.length}),n++,a="?InterpolationInJSX",c=!1,yield{type:"JSXPunctuator",value:"{"};continue}}if(St.lastIndex=n,i=St.exec(e)){n=St.lastIndex,yield{type:"WhiteSpace",value:i[0]};continue}if(Ue.lastIndex=n,i=Ue.exec(e)){n=Ue.lastIndex,c=!1,mu.test(a)&&(a="?NoLineTerminatorHere"),yield{type:"LineTerminatorSequence",value:i[0]};continue}if(At.lastIndex=n,i=At.exec(e)){n=At.lastIndex,tn.test(i[0])&&(c=!1,mu.test(a)&&(a="?NoLineTerminatorHere")),yield{type:"MultiLineComment",value:i[0],closed:i[1]!==void 0};continue}if(Bt.lastIndex=n,i=Bt.exec(e)){n=Bt.lastIndex,c=!1,yield{type:"SingleLineComment",value:i[0]};continue}r=String.fromCodePoint(e.codePointAt(n)),n+=r.length,a=r,c=!1,yield{type:D.tag.startsWith("JSX")?"JSXInvalid":"Invalid",value:r}}}});var Ha={};kt(Ha,{__debug:()=>za,check:()=>Ja,doc:()=>_u,format:()=>Mn,formatWithCursor:()=>Ln,getSupportInfo:()=>Ga,util:()=>Bu,version:()=>wn});var X=(e,t)=>(u,r,...o)=>u|1&&r==null?void 0:(t.call(r)??r[e]).apply(r,o);var Xn=String.prototype.replaceAll??function(e,t){return e.global?this.replace(e,t):this.split(e).join(t)},qn=X("replaceAll",function(){if(typeof this=="string")return Xn}),ue=qn;var _e=class{diff(t,u,r={}){let o;typeof r=="function"?(o=r,r={}):"callback"in r&&(o=r.callback);let n=this.castInput(t,r),a=this.castInput(u,r),s=this.removeEmpty(this.tokenize(n,r)),i=this.removeEmpty(this.tokenize(a,r));return this.diffWithOptionsObj(s,i,r,o)}diffWithOptionsObj(t,u,r,o){var n;let a=E=>{if(E=this.postProcess(E,r),o){setTimeout(function(){o(E)},0);return}else return E},s=u.length,i=t.length,D=1,f=s+i;r.maxEditLength!=null&&(f=Math.min(f,r.maxEditLength));let d=(n=r.timeout)!==null&&n!==void 0?n:1/0,p=Date.now()+d,c=[{oldPos:-1,lastComponent:void 0}],l=this.extractCommon(c[0],u,t,0,r);if(c[0].oldPos+1>=i&&l+1>=s)return a(this.buildValues(c[0].lastComponent,u,t));let F=-1/0,m=1/0,C=()=>{for(let E=Math.max(F,-D);E<=Math.min(m,D);E+=2){let y,x=c[E-1],b=c[E+1];x&&(c[E-1]=void 0);let Y=!1;if(b){let pe=b.oldPos-E;Y=b&&0<=pe&&pe<s}let J=x&&x.oldPos+1<i;if(!Y&&!J){c[E]=void 0;continue}if(!J||Y&&x.oldPos<b.oldPos?y=this.addToPath(b,!0,!1,0,r):y=this.addToPath(x,!1,!0,1,r),l=this.extractCommon(y,u,t,E,r),y.oldPos+1>=i&&l+1>=s)return a(this.buildValues(y.lastComponent,u,t))||!0;c[E]=y,y.oldPos+1>=i&&(m=Math.min(m,E-1)),l+1>=s&&(F=Math.max(F,E+1))}D++};if(o)(function E(){setTimeout(function(){if(D>f||Date.now()>p)return o(void 0);C()||E()},0)})();else for(;D<=f&&Date.now()<=p;){let E=C();if(E)return E}}addToPath(t,u,r,o,n){let a=t.lastComponent;return a&&!n.oneChangePerToken&&a.added===u&&a.removed===r?{oldPos:t.oldPos+o,lastComponent:{count:a.count+1,added:u,removed:r,previousComponent:a.previousComponent}}:{oldPos:t.oldPos+o,lastComponent:{count:1,added:u,removed:r,previousComponent:a}}}extractCommon(t,u,r,o,n){let a=u.length,s=r.length,i=t.oldPos,D=i-o,f=0;for(;D+1<a&&i+1<s&&this.equals(r[i+1],u[D+1],n);)D++,i++,f++,n.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return f&&!n.oneChangePerToken&&(t.lastComponent={count:f,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=i,D}equals(t,u,r){return r.comparator?r.comparator(t,u):t===u||!!r.ignoreCase&&t.toLowerCase()===u.toLowerCase()}removeEmpty(t){let u=[];for(let r=0;r<t.length;r++)t[r]&&u.push(t[r]);return u}castInput(t,u){return t}tokenize(t,u){return Array.from(t)}join(t){return t.join("")}postProcess(t,u){return t}get useLongestToken(){return!1}buildValues(t,u,r){let o=[],n;for(;t;)o.push(t),n=t.previousComponent,delete t.previousComponent,t=n;o.reverse();let a=o.length,s=0,i=0,D=0;for(;s<a;s++){let f=o[s];if(f.removed)f.value=this.join(r.slice(D,D+f.count)),D+=f.count;else{if(!f.added&&this.useLongestToken){let d=u.slice(i,i+f.count);d=d.map(function(p,c){let l=r[D+c];return l.length>p.length?l:p}),f.value=this.join(d)}else f.value=this.join(u.slice(i,i+f.count));i+=f.count,f.added||(D+=f.count)}}return o}};var vt=class extends _e{tokenize(t){return t.slice()}join(t){return t}removeEmpty(t){return t}},Su=new vt;function Rt(e,t,u){return Su.diff(e,t,u)}function wu(e){let t=e.indexOf("\r");return t!==-1?e.charAt(t+1)===` `?"crlf":"cr":"lf"}function xe(e){switch(e){case"cr":return"\r";case"crlf":return`\r `;default:return` `}}function Lt(e,t){let u;switch(t){case` `:u=/\n/gu;break;case"\r":u=/\r/gu;break;case`\r `:u=/\r\n/gu;break;default:throw new Error(`Unexpected "eol" ${JSON.stringify(t)}.`)}let r=e.match(u);return r?r.length:0}function Ou(e){return ue(0,e,/\r\n?/gu,` `)}function Qn(e){return this[e<0?this.length+e:e]}var Zn=X("at",function(){if(Array.isArray(this)||typeof this=="string")return Qn}),h=Zn;var eo=()=>{},O=eo;var G="string",j="array",U="cursor",P="indent",I="align",k="trim",A="group",S="fill",_="if-break",v="indent-if-break",R="line-suffix",L="line-suffix-boundary",g="line",w="label",B="break-parent",Ke=new Set([U,P,I,k,A,S,_,v,R,L,g,w,B]);function Pu(e){let t=e.length;for(;t>0&&(e[t-1]==="\r"||e[t-1]===` `);)t--;return t<e.length?e.slice(0,t):e}function to(e){if(typeof e=="string")return G;if(Array.isArray(e))return j;if(!e)return;let{type:t}=e;if(Ke.has(t))return t}var H=to;var uo=e=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(e);function ro(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 u=Object.prototype.toString.call(e);if(u!=="[object Object]")return`Unexpected doc '${u}'.`;let r=uo([...Ke].map(o=>`'${o}'`));return`Unexpected doc.type '${e.type}'. Expected it to be ${r}.`}var Mt=class extends Error{name="InvalidDocError";constructor(t){super(ro(t)),this.doc=t}},Q=Mt;var Iu={};function no(e,t,u,r){let o=[e];for(;o.length>0;){let n=o.pop();if(n===Iu){u(o.pop());continue}u&&o.push(n,Iu);let a=H(n);if(!a)throw new Q(n);if(t?.(n)!==!1)switch(a){case j:case S:{let s=a===j?n:n.parts;for(let i=s.length,D=i-1;D>=0;--D)o.push(s[D]);break}case _:o.push(n.flatContents,n.breakContents);break;case A:if(r&&n.expandedStates)for(let s=n.expandedStates.length,i=s-1;i>=0;--i)o.push(n.expandedStates[i]);else o.push(n.contents);break;case I:case P:case v:case w:case R:o.push(n.contents);break;case G:case U:case k:case L:case g:case B:break;default:throw new Q(n)}}}var Be=no;function Ne(e,t){if(typeof e=="string")return t(e);let u=new Map;return r(e);function r(n){if(u.has(n))return u.get(n);let a=o(n);return u.set(n,a),a}function o(n){switch(H(n)){case j:return t(n.map(r));case S:return t({...n,parts:n.parts.map(r)});case _:return t({...n,breakContents:r(n.breakContents),flatContents:r(n.flatContents)});case A:{let{expandedStates:a,contents:s}=n;return a?(a=a.map(r),s=a[0]):s=r(s),t({...n,contents:s,expandedStates:a})}case I:case P:case v:case w:case R:return t({...n,contents:r(n.contents)});case G:case U:case k:case L:case g:case B:return t(n);default:throw new Q(n)}}}function Je(e,t,u){let r=u,o=!1;function n(a){if(o)return!1;let s=t(a);s!==void 0&&(o=!0,r=s)}return Be(e,n),r}function oo(e){if(e.type===A&&e.break||e.type===g&&e.hard||e.type===B)return!0}function Ru(e){return Je(e,oo,!1)}function ku(e){if(e.length>0){let t=h(0,e,-1);!t.expandedStates&&!t.break&&(t.break="propagated")}return null}function Lu(e){let t=new Set,u=[];function r(n){if(n.type===B&&ku(u),n.type===A){if(u.push(n),t.has(n))return!1;t.add(n)}}function o(n){n.type===A&&u.pop().break&&ku(u)}Be(e,r,o,!0)}function ao(e){return e.type===g&&!e.hard?e.soft?"":" ":e.type===_?e.flatContents:e}function Mu(e){return Ne(e,ao)}function vu(e){for(e=[...e];e.length>=2&&h(0,e,-2).type===g&&h(0,e,-1).type===B;)e.length-=2;if(e.length>0){let t=Te(h(0,e,-1));e[e.length-1]=t}return e}function Te(e){switch(H(e)){case P:case v:case A:case R:case w:{let t=Te(e.contents);return{...e,contents:t}}case _:return{...e,breakContents:Te(e.breakContents),flatContents:Te(e.flatContents)};case S:return{...e,parts:vu(e.parts)};case j:return vu(e);case G:return Pu(e);case I:case U:case k:case L:case g:case B:break;default:throw new Q(e)}return e}function Ge(e){return Te(so(e))}function io(e){switch(H(e)){case S:if(e.parts.every(t=>t===""))return"";break;case A:if(!e.contents&&!e.id&&!e.break&&!e.expandedStates)return"";if(e.contents.type===A&&e.contents.id===e.id&&e.contents.break===e.break&&e.contents.expandedStates===e.expandedStates)return e.contents;break;case I:case P:case v:case R:if(!e.contents)return"";break;case _:if(!e.flatContents&&!e.breakContents)return"";break;case j:{let t=[];for(let u of e){if(!u)continue;let[r,...o]=Array.isArray(u)?u:[u];typeof r=="string"&&typeof h(0,t,-1)=="string"?t[t.length-1]+=r:t.push(r),t.push(...o)}return t.length===0?"":t.length===1?t[0]:t}case G:case U:case k:case L:case g:case w:case B:break;default:throw new Q(e)}return e}function so(e){return Ne(e,t=>io(t))}function Yu(e,t=ze){return Ne(e,u=>typeof u=="string"?Se(t,u.split(` `)):u)}function Do(e){if(e.type===g)return!0}function ju(e){return Je(e,Do,!1)}function Fe(e,t){return e.type===w?{...e,contents:t(e.contents)}:t(e)}var T=O,He=O,Uu=O,Wu=O;function re(e){return T(e),{type:P,contents:e}}function ae(e,t){return Wu(e),T(t),{type:I,contents:t,n:e}}function $u(e){return ae(Number.NEGATIVE_INFINITY,e)}function Xe(e){return ae({type:"root"},e)}function Vu(e){return ae(-1,e)}function qe(e,t,u){T(e);let r=e;if(t>0){for(let o=0;o<Math.floor(t/u);++o)r=re(r);r=ae(t%u,r),r=ae(Number.NEGATIVE_INFINITY,r)}return r}var ie={type:B};var Z={type:U};function Ku(e){return Uu(e),{type:S,parts:e}}function Yt(e,t={}){return T(e),He(t.expandedStates,!0),{type:A,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function Ju(e,t){return Yt(e[0],{...t,expandedStates:e})}function Gu(e,t="",u={}){return T(e),t!==""&&T(t),{type:_,breakContents:e,flatContents:t,groupId:u.groupId}}function zu(e,t){return T(e),{type:v,contents:e,groupId:t.groupId,negate:t.negate}}function Se(e,t){T(e),He(t);let u=[];for(let r=0;r<t.length;r++)r!==0&&u.push(e),u.push(t[r]);return u}function Hu(e,t){return T(t),e?{type:w,label:e,contents:t}:t}var Qe={type:g},Xu={type:g,soft:!0},we={type:g,hard:!0},V=[we,ie],jt={type:g,hard:!0,literal:!0},ze=[jt,ie];function Oe(e){return T(e),{type:R,contents:e}}var qu={type:L};var Qu={type:k};function ee(e){if(!e)return"";if(Array.isArray(e)){let t=[];for(let u of e)if(Array.isArray(u))t.push(...ee(u));else{let r=ee(u);r!==""&&t.push(r)}return t}return e.type===_?{...e,breakContents:ee(e.breakContents),flatContents:ee(e.flatContents)}:e.type===A?{...e,contents:ee(e.contents),expandedStates:e.expandedStates?.map(ee)}:e.type===S?{type:"fill",parts:e.parts.map(ee)}:e.contents?{...e,contents:ee(e.contents)}:e}function Zu(e){let t=Object.create(null),u=new Set;return r(ee(e));function r(n,a,s){if(typeof n=="string")return JSON.stringify(n);if(Array.isArray(n)){let i=n.map(r).filter(Boolean);return i.length===1?i[0]:`[${i.join(", ")}]`}if(n.type===g){let i=s?.[a+1]?.type===B;return n.literal?i?"literalline":"literallineWithoutBreakParent":n.hard?i?"hardline":"hardlineWithoutBreakParent":n.soft?"softline":"line"}if(n.type===B)return s?.[a-1]?.type===g&&s[a-1].hard?void 0:"breakParent";if(n.type===k)return"trim";if(n.type===P)return"indent("+r(n.contents)+")";if(n.type===I)return n.n===Number.NEGATIVE_INFINITY?"dedentToRoot("+r(n.contents)+")":n.n<0?"dedent("+r(n.contents)+")":n.n.type==="root"?"markAsRoot("+r(n.contents)+")":"align("+JSON.stringify(n.n)+", "+r(n.contents)+")";if(n.type===_)return"ifBreak("+r(n.breakContents)+(n.flatContents?", "+r(n.flatContents):"")+(n.groupId?(n.flatContents?"":', ""')+`, { groupId: ${o(n.groupId)} }`:"")+")";if(n.type===v){let i=[];n.negate&&i.push("negate: true"),n.groupId&&i.push(`groupId: ${o(n.groupId)}`);let D=i.length>0?`, { ${i.join(", ")} }`:"";return`indentIfBreak(${r(n.contents)}${D})`}if(n.type===A){let i=[];n.break&&n.break!=="propagated"&&i.push("shouldBreak: true"),n.id&&i.push(`id: ${o(n.id)}`);let D=i.length>0?`, { ${i.join(", ")} }`:"";return n.expandedStates?`conditionalGroup([${n.expandedStates.map(f=>r(f)).join(",")}]${D})`:`group(${r(n.contents)}${D})`}if(n.type===S)return`fill([${n.parts.map(i=>r(i)).join(", ")}])`;if(n.type===R)return"lineSuffix("+r(n.contents)+")";if(n.type===L)return"lineSuffixBoundary";if(n.type===w)return`label(${JSON.stringify(n.label)}, ${r(n.contents)})`;if(n.type===U)return"cursor";throw new Error("Unknown doc type "+n.type)}function o(n){if(typeof n!="symbol")return JSON.stringify(String(n));if(n in t)return t[n];let a=n.description||"symbol";for(let s=0;;s++){let i=a+(s>0?` #${s}`:"");if(!u.has(i))return u.add(i),t[n]=`Symbol.for(${JSON.stringify(i)})`}}}var er=()=>/[#*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-\uDED8\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-\uDEF8](?:\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-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\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;function Ut(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function Wt(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e>=94192&&e<=94198||e>=94208&&e<=101589||e>=101631&&e<=101662||e>=101760&&e<=101874||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128728||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129674||e>=129678&&e<=129734||e===129736||e>=129741&&e<=129756||e>=129759&&e<=129770||e>=129775&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}var tr="\xA9\xAE\u203C\u2049\u2122\u2139\u2194\u2195\u2196\u2197\u2198\u2199\u21A9\u21AA\u2328\u23CF\u23F1\u23F2\u23F8\u23F9\u23FA\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600\u2601\u2602\u2603\u2604\u260E\u2611\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638\u2639\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694\u2695\u2696\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F1\u26F7\u26F8\u26F9\u2702\u2708\u2709\u270C\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u2764\u27A1\u2934\u2935\u2B05\u2B06\u2B07";var co=/[^\x20-\x7F]/u,fo=new Set(tr);function lo(e){if(!e)return 0;if(!co.test(e))return e.length;e=e.replace(er(),u=>fo.has(u)?" ":" ");let t=0;for(let u of e){let r=u.codePointAt(0);r<=31||r>=127&&r<=159||r>=768&&r<=879||r>=65024&&r<=65039||(t+=Ut(r)||Wt(r)?2:1)}return t}var Pe=lo;var po={type:0},Fo={type:1},$t={value:"",length:0,queue:[],get root(){return $t}};function ur(e,t,u){let r=t.type===1?e.queue.slice(0,-1):[...e.queue,t],o="",n=0,a=0,s=0;for(let l of r)switch(l.type){case 0:f(),u.useTabs?i(1):D(u.tabWidth);break;case 3:{let{string:F}=l;f(),o+=F,n+=F.length;break}case 2:{let{width:F}=l;a+=1,s+=F;break}default:throw new Error(`Unexpected indent comment '${l.type}'.`)}return p(),{...e,value:o,length:n,queue:r};function i(l){o+=" ".repeat(l),n+=u.tabWidth*l}function D(l){o+=" ".repeat(l),n+=l}function f(){u.useTabs?d():p()}function d(){a>0&&i(a),c()}function p(){s>0&&D(s),c()}function c(){a=0,s=0}}function rr(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=Fo:r={type:2,width:t}:r={type:3,string:t},ur(e,r,u)}function nr(e,t){return ur(e,po,t)}function mo(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 Vt(e){let t=mo(e);return{text:t===0?e:e.slice(0,e.length-t),count:t}}var W=Symbol("MODE_BREAK"),q=Symbol("MODE_FLAT"),Kt=Symbol("DOC_FILL_PRINTED_LENGTH");function Ze(e,t,u,r,o,n){if(u===Number.POSITIVE_INFINITY)return!0;let a=t.length,s=!1,i=[e],D="";for(;u>=0;){if(i.length===0){if(a===0)return!0;i.push(t[--a]);continue}let{mode:f,doc:d}=i.pop(),p=H(d);switch(p){case G:d&&(s&&(D+=" ",u-=1,s=!1),D+=d,u-=Pe(d));break;case j:case S:{let c=p===j?d:d.parts,l=d[Kt]??0;for(let F=c.length-1;F>=l;F--)i.push({mode:f,doc:c[F]});break}case P:case I:case v:case w:i.push({mode:f,doc:d.contents});break;case k:{let{text:c,count:l}=Vt(D);D=c,u+=l;break}case A:{if(n&&d.break)return!1;let c=d.break?W:f,l=d.expandedStates&&c===W?h(0,d.expandedStates,-1):d.contents;i.push({mode:c,doc:l});break}case _:{let l=(d.groupId?o[d.groupId]||q:f)===W?d.breakContents:d.flatContents;l&&i.push({mode:f,doc:l});break}case g:if(f===W||d.hard)return!0;d.soft||(s=!0);break;case R:r=!0;break;case L:if(r)return!1;break}}return!1}function me(e,t){let u=Object.create(null),r=t.printWidth,o=xe(t.endOfLine),n=0,a=[{indent:$t,mode:W,doc:e}],s=[],i=!1,D=[],f=[];for(Lu(e);a.length>0;){let{indent:l,mode:F,doc:m}=a.pop();switch(H(m)){case G:{let C=o!==` `?ue(0,m,` `,o):m;C&&(s.push(C),a.length>0&&(n+=Pe(C)));break}case j:for(let C=m.length-1;C>=0;C--)a.push({indent:l,mode:F,doc:m[C]});break;case U:{if(f.length>=2)throw new Error("There are too many 'cursor' in doc.");let C=s.join("");s=[C],f.push(C.length-1);break}case P:a.push({indent:nr(l,t),mode:F,doc:m.contents});break;case I:a.push({indent:rr(l,m.n,t),mode:F,doc:m.contents});break;case k:c();break;case A:switch(F){case q:if(!i){a.push({indent:l,mode:m.break?W:q,doc:m.contents});break}case W:{i=!1;let C={indent:l,mode:q,doc:m.contents},E=r-n,y=D.length>0;if(!m.break&&Ze(C,a,E,y,u))a.push(C);else if(m.expandedStates){let x=h(0,m.expandedStates,-1);if(m.break){a.push({indent:l,mode:W,doc:x});break}else for(let b=1;b<m.expandedStates.length+1;b++)if(b>=m.expandedStates.length){a.push({indent:l,mode:W,doc:x});break}else{let Y=m.expandedStates[b],J={indent:l,mode:q,doc:Y};if(Ze(J,a,E,y,u)){a.push(J);break}}}else a.push({indent:l,mode:W,doc:m.contents});break}}m.id&&(u[m.id]=h(0,a,-1).mode);break;case S:{let C=r-n,E=m[Kt]??0,{parts:y}=m,x=y.length-E;if(x===0)break;let b=y[E+0],Y=y[E+1],J={indent:l,mode:q,doc:b},pe={indent:l,mode:W,doc:b},Pt=Ze(J,[],C,D.length>0,u,!0);if(x===1){Pt?a.push(J):a.push(pe);break}let Tu={indent:l,mode:q,doc:Y},It={indent:l,mode:W,doc:Y};if(x===2){Pt?a.push(Tu,J):a.push(It,pe);break}let Yn=y[E+2],jn={indent:l,mode:F,doc:{...m,[Kt]:E+2}},Un=Ze({indent:l,mode:q,doc:[b,Y,Yn]},[],C,D.length>0,u,!0);a.push(jn),Un?a.push(Tu,J):Pt?a.push(It,J):a.push(It,pe);break}case _:case v:{let C=m.groupId?u[m.groupId]:F;if(C===W){let E=m.type===_?m.breakContents:m.negate?m.contents:re(m.contents);E&&a.push({indent:l,mode:F,doc:E})}if(C===q){let E=m.type===_?m.flatContents:m.negate?re(m.contents):m.contents;E&&a.push({indent:l,mode:F,doc:E})}break}case R:D.push({indent:l,mode:F,doc:m.contents});break;case L:D.length>0&&a.push({indent:l,mode:F,doc:we});break;case g:switch(F){case q:if(m.hard)i=!0;else{m.soft||(s.push(" "),n+=1);break}case W:if(D.length>0){a.push({indent:l,mode:F,doc:m},...D.reverse()),D.length=0;break}m.literal?(s.push(o),n=0,l.root&&(l.root.value&&s.push(l.root.value),n=l.root.length)):(c(),s.push(o+l.value),n=l.length);break}break;case w:a.push({indent:l,mode:F,doc:m.contents});break;case B:break;default:throw new Q(m)}a.length===0&&D.length>0&&(a.push(...D.reverse()),D.length=0)}let d=s.join("");if(f.length!==2)return{formatted:d};let p=f[0]+1;return{formatted:d,cursorNodeStart:p,cursorNodeText:d.slice(p,h(0,f,-1)+1)};function c(){let{text:l,count:F}=Vt(s.join(""));s=[l],n-=F;for(let m=0;m<f.length;m++)f[m]=Math.min(f[m],l.length-1)}}function Eo(e,t,u=0){let r=0;for(let o=u;o<e.length;++o)e[o]===" "?r=r+t-r%t:r++;return r}var Ee=Eo;var Jt=class{constructor(t){this.stack=[t]}get key(){let{stack:t,siblings:u}=this;return h(0,t,u===null?-2:-4)??null}get index(){return this.siblings===null?null:h(0,this.stack,-2)}get node(){return h(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:t}=this,u=h(0,t,-3);return Array.isArray(u)?u: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:u}=this;return t!==null&&u===t.length-1}get isRoot(){return this.stack.length===1}get root(){return this.stack[0]}get ancestors(){return[...this.#e()]}getName(){let{stack:t}=this,{length:u}=t;return u>1?h(0,t,-2):null}getValue(){return h(0,this.stack,-1)}getNode(t=0){let u=this.#t(t);return u===-1?null:this.stack[u]}getParentNode(t=0){return this.getNode(t+1)}#t(t){let{stack:u}=this;for(let r=u.length-1;r>=0;r-=2)if(!Array.isArray(u[r])&&--t<0)return r;return-1}call(t,...u){let{stack:r}=this,{length:o}=r,n=h(0,r,-1);for(let a of u)n=n?.[a],r.push(a,n);try{return t(this)}finally{r.length=o}}callParent(t,u=0){let r=this.#t(u+1),o=this.stack.splice(r+1);try{return t(this)}finally{this.stack.push(...o)}}each(t,...u){let{stack:r}=this,{length:o}=r,n=h(0,r,-1);for(let a of u)n=n[a],r.push(a,n);try{for(let a=0;a<n.length;++a)r.push(a,n[a]),t(this,a,n),r.length-=2}finally{r.length=o}}map(t,...u){let r=[];return this.each((o,n,a)=>{r[n]=t(o,n,a)},...u),r}match(...t){let u=this.stack.length-1,r=null,o=this.stack[u--];for(let n of t){if(o===void 0)return!1;let a=null;if(typeof r=="number"&&(a=r,r=this.stack[u--],o=this.stack[u--]),n&&!n(o,r,a))return!1;r=this.stack[u--],o=this.stack[u--]}return!0}findAncestor(t){for(let u of this.#e())if(t(u))return u}hasAncestor(t){for(let u of this.#e())if(t(u))return!0;return!1}*#e(){let{stack:t}=this;for(let u=t.length-3;u>=0;u-=2){let r=t[u];Array.isArray(r)||(yield r)}}},or=Jt;function Ce(e){return(t,u,r)=>{let o=!!r?.backwards;if(u===!1)return!1;let{length:n}=t,a=u;for(;a>=0&&a<n;){let s=t.charAt(a);if(e instanceof RegExp){if(!e.test(s))return a}else if(!e.includes(s))return a;o?a--:a++}return a===-1||a===n?a:!1}}var ir=Ce(/\s/u),M=Ce(" "),et=Ce(",; "),tt=Ce(/[^\n\r]/u);var sr=e=>e===` `||e==="\r"||e==="\u2028"||e==="\u2029";function Co(e,t,u){let r=!!u?.backwards;if(t===!1)return!1;let o=e.charAt(t);if(r){if(e.charAt(t-1)==="\r"&&o===` `)return t-2;if(sr(o))return t-1}else{if(o==="\r"&&e.charAt(t+1)===` `)return t+2;if(sr(o))return t+1}return t}var K=Co;function ho(e,t,u={}){let r=M(e,u.backwards?t-1:t,u),o=K(e,r,u);return r!==o}var z=ho;function go(e){return Array.isArray(e)&&e.length>0}var Dr=go;function yo(e){return e!==null&&typeof e=="object"}var ut=yo;function*he(e,t){let{getVisitorKeys:u,filter:r=()=>!0}=t,o=n=>ut(n)&&r(n);for(let n of u(e)){let a=e[n];if(Array.isArray(a))for(let s of a)o(s)&&(yield s);else o(a)&&(yield a)}}function*cr(e,t){let u=[e];for(let r=0;r<u.length;r++){let o=u[r];for(let n of he(o,t))yield n,u.push(n)}}function fr(e,t){return he(e,t).next().done}function lr(e,t,u){let{cache:r}=u;if(r.has(e))return r.get(e);let{filter:o}=u;if(!o)return[];let n,a=(u.getChildren?.(e,u)??[...he(e,{getVisitorKeys:u.getVisitorKeys})]).flatMap(D=>(n??(n=[e,...t]),o(D,n)?[D]:lr(D,n,u))),{locStart:s,locEnd:i}=u;return a.sort((D,f)=>s(D)-s(f)||i(D)-i(f)),r.set(e,a),a}var rt=lr;function bo(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)+"\u2026"),t+(u?" "+u:"")}function Gt(e,t){(e.comments??(e.comments=[])).push(t),t.printed=!1,t.nodeDescription=bo(e)}function se(e,t){t.leading=!0,t.trailing=!1,Gt(e,t)}function te(e,t,u){t.leading=!1,t.trailing=!1,u&&(t.marker=u),Gt(e,t)}function De(e,t){t.leading=!1,t.trailing=!0,Gt(e,t)}var Xt=new WeakMap;function pr(e,t,u,r,o=[]){let{locStart:n,locEnd:a}=u,s=n(t),i=a(t),D=rt(e,o,{cache:Xt,locStart:n,locEnd:a,getVisitorKeys:u.getVisitorKeys,filter:u.printer.canAttachComment,getChildren:u.printer.getCommentChildNodes}),f,d,p=0,c=D.length;for(;p<c;){let l=p+c>>1,F=D[l],m=n(F),C=a(F);if(m<=s&&i<=C)return pr(F,t,u,F,[F,...o]);if(C<=s){f=F,p=l+1;continue}if(i<=m){d=F,c=l;continue}throw new Error("Comment location overlaps with node location")}if(r?.type==="TemplateLiteral"){let{quasis:l}=r,F=Ht(l,t,u);f&&Ht(l,f,u)!==F&&(f=null),d&&Ht(l,d,u)!==F&&(d=null)}return{enclosingNode:r,precedingNode:f,followingNode:d}}var zt=()=>!1;function Fr(e,t){let{comments:u}=e;if(delete e.comments,!Dr(u)||!t.printer.canAttachComment)return;let r=[],{printer:{features:{experimental_avoidAstMutation:o},handleComments:n={}},originalText:a}=t,{ownLine:s=zt,endOfLine:i=zt,remaining:D=zt}=n,f=u.map((d,p)=>({...pr(e,d,t),comment:d,text:a,options:t,ast:e,isLastComment:u.length-1===p}));for(let[d,p]of f.entries()){let{comment:c,precedingNode:l,enclosingNode:F,followingNode:m,text:C,options:E,ast:y,isLastComment:x}=p,b;if(o?b=[p]:(c.enclosingNode=F,c.precedingNode=l,c.followingNode=m,b=[c,C,E,y,x]),Ao(C,E,f,d))c.placement="ownLine",s(...b)||(m?se(m,c):l?De(l,c):F?te(F,c):te(y,c));else if(_o(C,E,f,d))c.placement="endOfLine",i(...b)||(l?De(l,c):m?se(m,c):F?te(F,c):te(y,c));else if(c.placement="remaining",!D(...b))if(l&&m){let Y=r.length;Y>0&&r[Y-1].followingNode!==m&&dr(r,E),r.push(p)}else l?De(l,c):m?se(m,c):F?te(F,c):te(y,c)}if(dr(r,t),!o)for(let d of u)delete d.precedingNode,delete d.enclosingNode,delete d.followingNode}var mr=e=>!/[\S\n\u2028\u2029]/u.test(e);function Ao(e,t,u,r){let{comment:o,precedingNode:n}=u[r],{locStart:a,locEnd:s}=t,i=a(o);if(n)for(let D=r-1;D>=0;D--){let{comment:f,precedingNode:d}=u[D];if(d!==n||!mr(e.slice(s(f),i)))break;i=a(f)}return z(e,i,{backwards:!0})}function _o(e,t,u,r){let{comment:o,followingNode:n}=u[r],{locStart:a,locEnd:s}=t,i=s(o);if(n)for(let D=r+1;D<u.length;D++){let{comment:f,followingNode:d}=u[D];if(d!==n||!mr(e.slice(i,a(f))))break;i=s(f)}return z(e,i)}function dr(e,t){let u=e.length;if(u===0)return;let{precedingNode:r,followingNode:o}=e[0],n=t.locStart(o),a;for(a=u;a>0;--a){let{comment:s,precedingNode:i,followingNode:D}=e[a-1];O(i,r),O(D,o);let f=t.originalText.slice(t.locEnd(s),n);if(t.printer.isGap?.(f,t)??/^[\s(]*$/u.test(f))n=t.locStart(s);else break}for(let[s,{comment:i}]of e.entries())s<a?De(r,i):se(o,i);for(let s of[r,o])s.comments&&s.comments.length>1&&s.comments.sort((i,D)=>t.locStart(i)-t.locStart(D));e.length=0}function Ht(e,t,u){let r=u.locStart(t)-1;for(let o=1;o<e.length;++o)if(r<u.locStart(e[o]))return o-1;return 0}function xo(e,t){let u=t-1;u=M(e,u,{backwards:!0}),u=K(e,u,{backwards:!0}),u=M(e,u,{backwards:!0});let r=K(e,u,{backwards:!0});return u!==r}var Ie=xo;function Er(e,t){let u=e.node;return u.printed=!0,t.printer.printComment(e,t)}function Bo(e,t){let u=e.node,r=[Er(e,t)],{printer:o,originalText:n,locStart:a,locEnd:s}=t;if(o.isBlockComment?.(u)){let f=z(n,s(u))?z(n,a(u),{backwards:!0})?V:Qe:" ";r.push(f)}else r.push(V);let D=K(n,M(n,s(u)));return D!==!1&&z(n,D)&&r.push(V),r}function To(e,t,u){let r=e.node,o=Er(e,t),{printer:n,originalText:a,locStart:s}=t,i=n.isBlockComment?.(r);if(u?.hasLineSuffix&&!u?.isBlock||z(a,s(r),{backwards:!0})){let D=Ie(a,s(r));return{doc:Oe([V,D?V:"",o]),isBlock:i,hasLineSuffix:!0}}return!i||u?.hasLineSuffix?{doc:[Oe([" ",o]),ie],isBlock:i,hasLineSuffix:!0}:{doc:[" ",o],isBlock:i,hasLineSuffix:!1}}function No(e,t){let u=e.node;if(!u)return{};let r=t[Symbol.for("printedComments")];if((u.comments||[]).filter(i=>!r.has(i)).length===0)return{leading:"",trailing:""};let n=[],a=[],s;return e.each(()=>{let i=e.node;if(r?.has(i))return;let{leading:D,trailing:f}=i;D?n.push(Bo(e,t)):f&&(s=To(e,t,s),a.push(s.doc))},"comments"),{leading:n,trailing:a}}function Cr(e,t,u){let{leading:r,trailing:o}=No(e,u);return!r&&!o?t:Fe(t,n=>[r,n,o])}function hr(e){let{[Symbol.for("comments")]: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 gr=()=>O;var ke=class extends Error{name="ConfigError"},ve=class extends Error{name="UndefinedParserError"};var yr={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 (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.