@redocly/replay 0.18.0-next.10 → 0.18.0-next.11

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.
@@ -219,7 +219,7 @@ ${n.message}`})}}}}),wH=({filePath:u})=>({Info:{leave(e,{report:a,location:t,con
219
219
  ${n.message}`,location:t.child("description")})}}}}),OH=u=>({Info:{leave(e){if(typeof u!="object"||Array.isArray(u)||u===null)throw new Error('"info-override" decorator should be called with an object');const{severity:a,...t}=u;Object.assign(e,t)}}});function PH(u){return Array.isArray(u)&&u.length===0}const hhe="x-internal",jH=({internalFlagProperty:u=hhe})=>{function e(t,r,n){const{parent:i,key:o}=r;let s=!1;if(Array.isArray(t))for(let l=0;l<t.length;l++){if(Ra(t[l])&&r.resolve(t[l]).node?.[u]){if(Du(i.discriminator?.mapping))for(const d in i.discriminator.mapping)n?.[d]===t[l].$ref&&delete i.discriminator.mapping[d];t.splice(l,1),s=!0,l--}t[l]?.[u]&&(t.splice(l,1),s=!0,l--)}else if(Du(t))for(const l of Object.keys(t)){if(Ra(t[l])){const c=r.resolve(t[l]);Du(c.node)&&c.node?.[u]&&(delete t[l],s=!0)}Du(t[l])&&t[l]?.[u]&&(delete t[l],s=!0)}s&&(Ad(t)||PH(t))&&delete i[o]}let a={};return{DiscriminatorMapping:{enter:t=>{a=JSON.parse(JSON.stringify(t))}},any:{enter:(t,r)=>{e(t,r,a)}}}};function MH(u,e,a){const{parent:t,key:r}=e;let n=!1;if(Array.isArray(u))for(let i=0;i<u.length;i++){if(Ra(u[i])){const o=e.resolve(u[i]);a(o.node)&&(u.splice(i,1),n=!0,i--)}a(u[i])&&(u.splice(i,1),n=!0,i--)}else if(Du(u))for(const i of Object.keys(u)){if(u=u,Ra(u[i])){const o=e.resolve(u[i]);a(o.node)&&(delete u[i],n=!0)}a(u[i])&&(delete u[i],n=!0)}n&&(Ad(u)||PH(u))&&delete t[r]}function TH(u,e,a){return u===void 0||e===void 0?!1:!Array.isArray(e)&&!Array.isArray(u)?u===e:(e=Oz(e),u=Oz(u),a==="any"?e.some(t=>u.includes(t)):a==="all"?e.every(t=>u.includes(t)):!1)}function Oz(u){return Array.isArray(u)?u:[u]}const xhe="any",$H=({property:u,value:e,matchStrategy:a})=>{const t=a||xhe,r=n=>n?.[u]&&!TH(n?.[u],e,t);return{any:{enter:(n,i)=>{MH(n,i,r)}}}},Dhe="any",RH=({property:u,value:e,matchStrategy:a})=>{const t=a||Dhe,r=n=>TH(n?.[u],e,t);return{any:{enter:(n,i)=>{MH(n,i,r)}}}},fhe=({operationIds:u})=>({Operation:{enter(e,a){const t=e.operationId;if(!t)return;const r=u[t];if(r){if(r.responses&&e.responses)for(const n of Object.keys(r.responses)){const i=Pz(e.responses[n],a.resolve);i&&(i.content=i.content?i.content:{},Object.keys(r.responses[n]).forEach(o=>{const s=r.responses[n][o];i.content[o]={...i.content[o],examples:wz(jd(s,a.config?.configPath))}}),e.responses[n]=i)}if(r.request&&e.requestBody){const n=Pz(e.requestBody,a.resolve);if(!n)return;n.content=n.content?n.content:{},Object.keys(r.request).forEach(i=>{const o=r.request[i];n.content[i]={...n.content[i],examples:wz(jd(o,a.config?.configPath))}}),e.requestBody=n}}}}});function Pz(u,e){if(!Ra(u))return u;const a=e(u);return a.error?void 0:JSON.parse(JSON.stringify(a.node))}const NH=()=>{const u=new Map;function e(t,r,n){u.set(t.absolutePointer,{usedIn:u.get(t.absolutePointer)?.usedIn??[],componentType:r,name:n})}function a(t,r){const n=r.length;for(const[i,{usedIn:o,name:s,componentType:l}]of u)if(!o.some(d=>!r.some(E=>d.absolutePointer.startsWith(E)&&(d.absolutePointer.length===E.length||d.absolutePointer[E.length]==="/")))&&l&&t.components){r.push(i);const d=t.components[l];delete d[s],u.delete(i),Ad(d)&&delete t.components[l]}return r.length>n?a(t,r):r.length}return{ref:{leave(t,{location:r,type:n,resolve:i,key:o}){if(["Schema","Header","Parameter","Response","Example","RequestBody"].includes(n.name)){const s=i(t);if(!s.location)return;const[l,c]=s.location.absolutePointer.split("#",2);if(!c)return;const d=c.split("/").slice(0,4).join("/"),E=`${l}#${d}`,p=u.get(E);p?p.usedIn.push(r):u.set(E,{usedIn:[r],name:o.toString()})}}},Root:{leave(t,r){const n=r.getVisitorData();n.removedCount=a(t,[]),Ad(t.components)&&delete t.components}},NamedSchemas:{Schema(t,{location:r,key:n}){t.allOf||e(r,"schemas",n.toString())}},NamedParameters:{Parameter(t,{location:r,key:n}){e(r,"parameters",n.toString())}},NamedResponses:{Response(t,{location:r,key:n}){e(r,"responses",n.toString())}},NamedExamples:{Example(t,{location:r,key:n}){e(r,"examples",n.toString())}},NamedRequestBodies:{RequestBody(t,{location:r,key:n}){e(r,"requestBodies",n.toString())}},NamedHeaders:{Header(t,{location:r,key:n}){e(r,"headers",n.toString())}}}},ghe={"operation-description-override":SH,"tag-description-override":zH,"info-description-override":wH,"info-override":OH,"remove-x-internal":jH,"remove-unused-components":NH,"filter-in":$H,"filter-out":RH,"media-type-examples-override":fhe},_H=()=>{const u=new Map;function e(t,r,n){u.set(t.absolutePointer,{usedIn:u.get(t.absolutePointer)?.usedIn??[],componentType:r,name:n})}function a(t,r){const n=r.length;for(const[i,{usedIn:o,name:s,componentType:l}]of u)!o.some(d=>!r.some(E=>d.absolutePointer.startsWith(E)&&(d.absolutePointer.length===E.length||d.absolutePointer[E.length]==="/")))&&l&&(r.push(i),delete t[l][s],u.delete(i),Ad(t[l])&&delete t[l]);return r.length>n?a(t,r):r.length}return{ref:{leave(t,{location:r,type:n,resolve:i,key:o}){if(["Schema","Parameter","Response","SecurityScheme"].includes(n.name)){const s=i(t);if(!s.location)return;const[l,c]=s.location.absolutePointer.split("#",2);if(!c)return;const d=c.split("/").slice(0,3).join("/"),E=`${l}#${d}`,p=u.get(E);p?p.usedIn.push(r):u.set(E,{usedIn:[r],name:o.toString()})}}},Root:{leave(t,r){const n=r.getVisitorData();n.removedCount=a(t,[])}},NamedSchemas:{Schema(t,{location:r,key:n}){t.allOf||e(r,"definitions",n.toString())}},NamedParameters:{Parameter(t,{location:r,key:n}){e(r,"parameters",n.toString())}},NamedResponses:{Response(t,{location:r,key:n}){e(r,"responses",n.toString())}},NamedSecuritySchemes:{SecurityScheme(t,{location:r,key:n}){e(r,"securityDefinitions",n.toString())}}}},vhe={"operation-description-override":SH,"tag-description-override":zH,"info-description-override":wH,"info-override":OH,"remove-x-internal":jH,"remove-unused-components":_H,"filter-in":$H,"filter-out":RH},khe={},bhe={},yhe={},Che={},Fhe={recommended:C3e,"recommended-strict":F3e,minimal:B3e,all:A3e,spec:S3e},jz={id:"",rules:{oas3:Pme,oas2:Nme,async2:Kme,async3:qme,arazzo1:dhe,overlay1:phe},preprocessors:{oas3:jme,oas2:_me,async2:Vme,async3:Wme,arazzo1:Ehe,overlay1:mhe},decorators:{oas3:ghe,oas2:vhe,async2:khe,async3:bhe,arazzo1:yhe,overlay1:Che},configs:Fhe};function Ahe(u){return!zt(u)}function Bhe(){return new Promise(u=>{setTimeout(u)})}function id(u,e){return u+"::"+e}class L1{constructor(e,a,t){this.absoluteRef=e,this.body=a,this.mimeType=t}getAst(e){return this._ast===void 0&&(this._ast=e(this.body,{filename:this.absoluteRef})??void 0,this._ast&&this._ast.kind===0&&this._ast.value===""&&this._ast.startPosition!==1&&(this._ast.startPosition=1,this._ast.endPosition=1)),this._ast}getLines(){return this._lines===void 0&&(this._lines=this.body.split(/\r\n|[\n\r]/g)),this._lines}}class O2 extends Error{constructor(e){super(e.message),this.originalError=e,Object.setPrototypeOf(this,O2.prototype)}}function She(u,e){const a=new L1(e,u);try{return{source:a,parsed:y2(u,{filename:e})}}catch(t){throw new Dc(t,a)}}class Rf{constructor(e={http:{headers:[]}}){this.config=e,this.cache=new Map}getFiles(){return new Set(Array.from(this.cache.keys()))}resolveExternalRef(e,a){return Xa(a)?a:e&&Xa(e)?new URL(a,e).href:$u.resolve(e?$u.dirname(e):process.cwd(),a)}async loadExternalRef(e){try{if(Xa(e)){const{body:a,mimeType:t}=await JI(e,this.config.http);return new L1(e,a,t)}else{if((void 0)(e).isDirectory())throw new Error(`Expected a file but received a folder at ${e}.`);const a=await(void 0).readFile(e,"utf-8");return new L1(e,a.replace(/\r\n/g,`
220
220
  `))}}catch(a){throw a.message=a.message.replace(", lstat",""),new O2(a)}}parseDocument(e,a=!1){const t=e.absoluteRef.substr(e.absoluteRef.lastIndexOf("."));if(![".json",".json",".yml",".yaml"].includes(t)&&!e.mimeType?.match(/(json|yaml|openapi)/)&&!a)return{source:e,parsed:e.body};try{return{source:e,parsed:y2(e.body,{filename:e.absoluteRef})}}catch(r){throw new Dc(r,e)}}async resolveDocument(e,a,t=!1){const r=this.resolveExternalRef(e,a),n=this.cache.get(r);if(n)return n;const i=this.loadExternalRef(r).then(o=>this.parseDocument(o,t));return this.cache.set(r,i),i}}function Mz(u,e){return{prev:u,node:e}}function zhe(u,e){for(;u;){if(u.node===e)return!0;u=u.prev}return!1}const r4={name:"unknown",properties:{}},whe={name:"scalar",properties:{}};async function Md(u){const{rootDocument:e,externalRefResolver:a,rootType:t}=u,r=new Map,n=new Set,i=[];s(e.parsed,e,"#/",t);let o;do o=await Promise.all(i);while(i.length!==o.length);return r;function s(l,c,d,E){const p=c.source.absoluteRef,x=new Map;m(l,E,p+d);function m(h,f,k){if(typeof h!="object"||h===null)return;const y=`${f.name}::${k}`;if(n.has(y))return;n.add(y);const[v,b]=Object.entries(h).find(([C])=>C==="$anchor")||[];if(b&&x.set(`#${b}`,h),Array.isArray(h)){const C=f.items;if(C===void 0&&f!==r4&&f!==As)return;const B=typeof C=="function";for(let z=0;z<h.length;z++){let P=B?C(h[z],Ql(k,z)):C;if(P===void 0&&f!==r4&&f!==As)continue;const L=P?.directResolveAs?{$ref:h[z]}:h[z];P=P?.directResolveAs||P,m(L,Bs(P)?P:r4,Ql(k,z))}return}for(const C of Object.keys(h)){let B=h[C],z=N1(f.properties,C);z===void 0&&(z=f.additionalProperties),typeof z=="function"&&(z=z(B,C)),z===void 0&&(z=r4),f.extensionsPrefix&&C.startsWith(f.extensionsPrefix)&&z===r4&&(z=As),!Bs(z)&&z?.directResolveAs&&(z=z.directResolveAs,B={$ref:B}),z&&z.name===void 0&&z.resolvable!==!1&&(z=whe),!(!Bs(z)||typeof B!="object")&&m(B,z,Ql(k,rd(C)))}if(Ra(h)){const C=g(c,h,{prev:null,node:h}).then(B=>{B.resolved&&s(B.node,B.document,B.nodePointer,f)});i.push(C)}if(UI(h)){const C=g(c,{$ref:h.externalValue},{prev:null,node:h}).then(B=>{B.resolved&&s(B.node,B.document,B.nodePointer,f)});i.push(C)}}async function g(h,f,k){if(zhe(k.prev,f))throw new Error("Self-referencing circular pointer");if(Gne(f.$ref)){await Bhe();const I={resolved:!0,isRemote:!1,node:x.get(f.$ref),document:h,nodePointer:f.$ref},G=id(h.source.absoluteRef,f.$ref);return r.set(G,I),I}const{uri:y,pointer:v}=Ine(f.$ref),b=y!==null&&a.resolveExternalRef(h.source.absoluteRef,y)!==h.source.absoluteRef;let C;try{C=b?await a.resolveDocument(h.source.absoluteRef,y):h}catch(I){const G={resolved:!1,isRemote:b,document:void 0,error:I},X=id(h.source.absoluteRef,f.$ref);return r.set(X,G),G}let B={resolved:!0,document:C,isRemote:b,node:h.parsed,nodePointer:"#/"},z=C.parsed;const P=v;for(const I of P)if(typeof z!="object"){z=void 0;break}else if(z[I]!==void 0)z=z[I],B.nodePointer=Ql(B.nodePointer,rd(I));else if(Ra(z)){if(B=await g(C,z,Mz(k,z)),C=B.document||C,typeof B.node!="object"){z=void 0;break}z=B.node[I],B.nodePointer=Ql(B.nodePointer,rd(I))}else{z=void 0;break}B.node=z,B.document=C;const L=id(h.source.absoluteRef,f.$ref);return B.document&&Ra(z)&&(B=await g(B.document,z,Mz(k,z))),r.set(L,B),{...B}}}}const ta=(u,e)=>{if(e)for(const a of Object.keys(e))Du(u[a])&&typeof e[a]=="string"?u[a]={...u[a],severity:e[a]}:u[a]=e[a]};function ga(u,e){if(e)for(const a of Object.keys(e))u.hasOwnProperty(a)&&(Du(u[a])&&typeof e[a]=="string"?u[a]={...u[a],severity:e[a]}:u[a]=e[a])}function Ohe(u){if(u.indexOf("/")>-1){const[e,a]=u.split("/");return{pluginId:e,configName:a}}else return{pluginId:"",configName:u}}function Qa(u,e){if(!e)return u;const a={};for(const t of Object.keys(u))a[`${e}/${t}`]=u[t];return a}function LH(u){const e={rules:{},oas2Rules:{},oas3_0Rules:{},oas3_1Rules:{},oas3_2Rules:{},async2Rules:{},async3Rules:{},arazzo1Rules:{},overlay1Rules:{},preprocessors:{},oas2Preprocessors:{},oas3_0Preprocessors:{},oas3_1Preprocessors:{},oas3_2Preprocessors:{},async2Preprocessors:{},async3Preprocessors:{},arazzo1Preprocessors:{},overlay1Preprocessors:{},decorators:{},oas2Decorators:{},oas3_0Decorators:{},oas3_1Decorators:{},oas3_2Decorators:{},async2Decorators:{},async3Decorators:{},arazzo1Decorators:{},overlay1Decorators:{}};for(const a of u){if(Du(a)&&"extends"in a&&a.extends!==void 0)throw new Error(`'extends' is not supported in shared configs yet:
221
221
  ${JSON.stringify(a,null,2)}`);ta(e.rules,a.rules),ta(e.oas2Rules,a.oas2Rules),ga(e.oas2Rules,a.rules),ta(e.oas3_0Rules,a.oas3_0Rules),ga(e.oas3_0Rules,a.rules),ta(e.oas3_1Rules,a.oas3_1Rules),ga(e.oas3_1Rules,a.rules),ta(e.oas3_2Rules,a.oas3_2Rules),ga(e.oas3_2Rules,a.rules),ta(e.async2Rules,a.async2Rules),ga(e.async2Rules,a.rules),ta(e.async3Rules,a.async3Rules),ga(e.async3Rules,a.rules),ta(e.arazzo1Rules,a.arazzo1Rules),ga(e.arazzo1Rules,a.rules),ta(e.overlay1Rules,a.overlay1Rules),ga(e.overlay1Rules,a.rules),ta(e.preprocessors,a.preprocessors),ta(e.oas2Preprocessors,a.oas2Preprocessors),ga(e.oas2Preprocessors,a.preprocessors),ta(e.oas3_0Preprocessors,a.oas3_0Preprocessors),ga(e.oas3_0Preprocessors,a.preprocessors),ta(e.oas3_1Preprocessors,a.oas3_1Preprocessors),ga(e.oas3_1Preprocessors,a.preprocessors),ta(e.oas3_2Preprocessors,a.oas3_2Preprocessors),ga(e.oas3_2Preprocessors,a.preprocessors),ta(e.async2Preprocessors,a.async2Preprocessors),ga(e.async2Preprocessors,a.preprocessors),ta(e.async3Preprocessors,a.async3Preprocessors),ga(e.async3Preprocessors,a.preprocessors),ta(e.arazzo1Preprocessors,a.arazzo1Preprocessors),ga(e.arazzo1Preprocessors,a.preprocessors),ta(e.overlay1Preprocessors,a.overlay1Preprocessors),ga(e.overlay1Preprocessors,a.preprocessors),ta(e.decorators,a.decorators),ta(e.oas2Decorators,a.oas2Decorators),ga(e.oas2Decorators,a.decorators),ta(e.oas3_0Decorators,a.oas3_0Decorators),ga(e.oas3_0Decorators,a.decorators),ta(e.oas3_1Decorators,a.oas3_1Decorators),ga(e.oas3_1Decorators,a.decorators),ta(e.oas3_2Decorators,a.oas3_2Decorators),ga(e.oas3_2Decorators,a.decorators),ta(e.async2Decorators,a.async2Decorators),ga(e.async2Decorators,a.decorators),ta(e.async3Decorators,a.async3Decorators),ga(e.async3Decorators,a.decorators),ta(e.arazzo1Decorators,a.arazzo1Decorators),ga(e.arazzo1Decorators,a.decorators),ta(e.overlay1Decorators,a.overlay1Decorators),ga(e.overlay1Decorators,a.decorators)}return e}function Phe(u){return new Map(JSON.parse(JSON.stringify([...u])))}function Tz(u){return u!==void 0&&typeof u=="object"&&"id"in u}function jhe(u){return typeof u=="function"}function $z(u,e){return{prev:u,value:e}}function Rz(u){return u?.prev??null}function Mhe(u){const e={};for(;u.parent;)e[u.parent.type.name]=u.parent.activatedOn?.value.node,u=u.parent;return e}function The(u){const e={};for(;u.parent;)u.parent.activatedOn?.value.location&&(e[u.parent.type.name]=u.parent.activatedOn?.value.location),u=u.parent;return e}function I1(u){const{document:e,rootType:a,normalizedVisitors:t,resolvedRefMap:r,ctx:n}=u,i={},o=new Set;s(e.parsed,a,new ox(e.source,"#/"),void 0,"");function s(l,c,d,E,p){const x=(B,z=g.source.absoluteRef)=>{if(!Ra(B))return{location:d,node:B};const P=id(z,B.$ref),L=r.get(P);if(!L)return{location:void 0,node:void 0};const{resolved:I,node:G,document:X,nodePointer:U,error:ae}=L;return{location:I?new ox(X.source,U):ae instanceof Dc?new ox(ae.source,""):void 0,node:G,error:ae}},m=d;let g=d;const{node:h,location:f,error:k}=x(l),y=new Set;if(Ra(l)){const B=t.ref.enter;for(const{visit:z,ruleId:P,severity:L,message:I,context:G}of B){y.add(G);const X=b.bind(void 0,P,L,I);z(l,{report:X,resolve:x,rawNode:l,rawLocation:m,location:d,type:c,parent:E,key:p,parentLocations:{},specVersion:n.specVersion,config:n.config,getVisitorData:C.bind(void 0,P)},{node:h,location:f,error:k}),f?.source.absoluteRef&&n.refTypes&&n.refTypes.set(f?.source.absoluteRef,c)}}if(h!==void 0&&f&&c.name!=="scalar"){g=f;const B=i[c.name]?.has?.(h);let z=!1;const L=t.any.enter.concat(t[c.name]?.enter||[]),I=[];for(const{context:U,visit:ae,skip:Ee,ruleId:re,severity:he,message:j}of L){if(o.has(`${g.absolutePointer}${g.pointer}`))break;if(U.isSkippedLevel)U.parent.activatedOn&&!U.parent.activatedOn.value.nextLevelTypeActivated&&!U.seen.has(l)&&(U.seen.add(l),z=!0,I.push(U));else if(U.parent&&U.parent.activatedOn&&U.activatedOn?.value.withParentNode!==U.parent.activatedOn.value.node&&U.parent.activatedOn.value.nextLevelTypeActivated?.value!==c||!U.parent&&!B){I.push(U);const T={node:h,location:f,nextLevelTypeActivated:null,withParentNode:U.parent?.activatedOn?.value.node,skipped:(U.parent?.activatedOn?.value.skipped||Ee?.(h,p,{location:d,rawLocation:m,resolve:x,rawNode:l}))??!1};U.activatedOn=$z(U.activatedOn,T);let V=U.parent;for(;V;)V.activatedOn.value.nextLevelTypeActivated=$z(V.activatedOn.value.nextLevelTypeActivated,c),V=V.parent;T.skipped||(z=!0,y.add(U),v(ae,h,l,U,re,he,j))}}if(z||!B){if(i[c.name]=i[c.name]||new Set,i[c.name].add(h),Array.isArray(h)){const U=c.items;if(U!==void 0){const ae=typeof U=="function";for(let Ee=0;Ee<h.length;Ee++){let re=ae?U(h[Ee],f.child([Ee]).absolutePointer):U,he=h[Ee];re?.directResolveAs&&(re=re.directResolveAs,he={$ref:he}),Bs(re)&&s(he,re,f.child([Ee]),h,Ee)}}}else if(typeof h=="object"&&h!==null){const U=Object.keys(c.properties);c.additionalProperties?U.push(...Object.keys(h).filter(ae=>!U.includes(ae))):c.extensionsPrefix&&U.push(...Object.keys(h).filter(ae=>ae.startsWith(c.extensionsPrefix))),Ra(l)&&U.push(...Object.keys(l).filter(ae=>ae!=="$ref"&&!U.includes(ae)));for(const ae of U){let Ee=h[ae],re=f;Ee===void 0&&(Ee=l[ae],re=d);let he=N1(c.properties,ae);if(he===void 0&&(he=c.additionalProperties),typeof he=="function"&&(he=he(Ee,ae)),he===void 0&&c.extensionsPrefix&&ae.startsWith(c.extensionsPrefix)&&(he=As),!Bs(he)&&he?.directResolveAs&&(he=he.directResolveAs,Ee={$ref:Ee}),he&&he.name===void 0&&he.resolvable!==!1&&(he={name:"scalar",properties:{}}),Ra(l[ae])&&he?.name==="scalar"){s(l[ae],he,d.child([ae]),l,ae);continue}!Bs(he)||he.name==="scalar"&&!Ra(Ee)||s(Ee,he,re.child([ae]),h,ae)}}}const G=t.any.leave,X=(t[c.name]?.leave||[]).concat(G);for(const U of I.reverse())if(U.isSkippedLevel)U.seen.delete(h);else if(U.activatedOn=Rz(U.activatedOn),U.parent){let ae=U.parent;for(;ae;)ae.activatedOn.value.nextLevelTypeActivated=Rz(ae.activatedOn.value.nextLevelTypeActivated),ae=ae.parent}for(const{context:U,visit:ae,ruleId:Ee,severity:re,message:he}of X)!U.isSkippedLevel&&y.has(U)&&v(ae,h,l,U,Ee,re,he)}if(g=d,Ra(l)){const B=t.ref.leave;for(const{visit:z,ruleId:P,severity:L,context:I,message:G}of B)if(y.has(I)){const X=b.bind(void 0,P,L,G);z(l,{report:X,resolve:x,rawNode:l,rawLocation:m,location:d,type:c,parent:E,key:p,parentLocations:{},specVersion:n.specVersion,config:n.config,getVisitorData:C.bind(void 0,P)},{node:h,location:f,error:k})}}function v(B,z,P,L,I,G,X){const U=b.bind(void 0,I,G,X);B(z,{report:U,resolve:x,rawNode:P,location:g,rawLocation:m,type:c,parent:E,key:p,parentLocations:The(L),specVersion:n.specVersion,config:n.config,ignoreNextVisitorsOnNode:()=>{o.add(`${g.absolutePointer}${g.pointer}`)},getVisitorData:C.bind(void 0,I)},Mhe(L),L)}function b(B,z,P,L){const G=(L.location?Array.isArray(L.location)?L.location:[L.location]:[{...g,reportOnKey:!1}]).map(U=>({...g,reportOnKey:!1,...U})),X=L.forceSeverity||z;X!=="off"&&n.problems.push({ruleId:L.ruleId||B,severity:X,...L,message:P?P.replace("{{message}}",L.message):L.message,suggest:L.suggest||[],location:G})}function C(B){return n.visitorsData[B]=n.visitorsData[B]||{},n.visitorsData[B]}}}const $he={Root:"DefinitionRoot",ServerVariablesMap:"ServerVariableMap",Paths:["PathMap","PathsMap"],CallbacksMap:"CallbackMap",MediaTypesMap:"MediaTypeMap",ExamplesMap:"ExampleMap",EncodingMap:"EncodingsMap",HeadersMap:"HeaderMap",LinksMap:"LinkMap",OAuth2Flows:"SecuritySchemeFlows",Responses:"ResponsesMap"};function K1(u,e){const a={};a.any={enter:[],leave:[]};for(const i of Object.keys(e))a[i]={enter:[],leave:[]};a.ref={enter:[],leave:[]};for(const{ruleId:i,severity:o,message:s,visitor:l}of u)n({ruleId:i,severity:o,message:s},l,null);for(const i of Object.keys(a))a[i].enter.sort((o,s)=>s.depth-o.depth),a[i].leave.sort((o,s)=>o.depth-s.depth);return a;function t(i,o,s,l,c=[]){if(c.includes(o))return;c=[...c,o];const d=new Set;for(const p of Object.values(o.properties)){if(p===s){E(i,c);continue}typeof p=="object"&&p!==null&&p.name&&d.add(p)}o.additionalProperties&&typeof o.additionalProperties!="function"&&(o.additionalProperties===s?E(i,c):o.additionalProperties.name!==void 0&&d.add(o.additionalProperties)),o.items&&typeof o.items!="function"&&(o.items===s?E(i,c):o.items.name!==void 0&&d.add(o.items)),o.extensionsPrefix&&d.add(As);for(const p of Array.from(d.values()))t(i,p,s,l,c);function E(p,x){for(const m of x.slice(1))a[m.name]=a[m.name]||{enter:[],leave:[]},a[m.name].enter.push({...p,visit:()=>{},depth:0,context:{isSkippedLevel:!0,seen:new Set,parent:l}})}}function r(i,o){if(Array.isArray(o)){const s=o.find(l=>i[l])||void 0;return s&&i[s]}return i[o]}function n(i,o,s,l=0){const c=Object.keys(e);if(l===0)c.push("any"),c.push("ref");else{if(o.any)throw new Error("any() is allowed only on top level");if(o.ref)throw new Error("ref() is allowed only on top level")}for(const d of c){const E=o[d]||r(o,$he[d]),p=a[d];if(!E)continue;let x,m,g;const h=Du(E);if(d==="ref"&&h&&E.skip)throw new Error("ref() visitor does not support skip");typeof E=="function"?x=E:h&&(x=E.enter,m=E.leave,g=E.skip);const f=(x?1:0)+(m?1:0)+(g?1:0),k=h&&Object.keys(E).length>f,y={activatedOn:null,type:e[d],parent:s,isSkippedLevel:!1};if(k&&n(i,E,y,l+1),s&&t(i,s.type,e[d],s),x||h){if(x&&typeof x!="function")throw new Error("DEV: should be function");p.enter.push({...i,visit:x||(()=>{}),skip:g,depth:l,context:y})}if(m){if(typeof m!="function")throw new Error("DEV: should be function");p.leave.push({...i,visit:m,depth:l,context:y})}}}}function IH({node:u,ctx:e,plugins:a}){if(!u.extends)return u;const t=(u.extends||[]).map(r=>{if(!Xa(r)&&!Ms.extname(r))return Whe(r,a);const n=e.resolve({$ref:r});return n.location&&n.node!==void 0?n.node:null}).filter(Ht);return LH([...t.map(r=>IH({node:r,ctx:e,plugins:a})),{...u,extends:void 0}])}function Jp(u,e){if(Du(u)&&Array.isArray(u.plugins)){const{plugins:a,rootConfigDir:t}=e.getVisitorData();a.push(...u.plugins.map(r=>KH(r,e.location.source.absoluteRef.replace(/^file:\/\//,""),t)))}}const Rhe=K1([{severity:"error",ruleId:VG,visitor:{ref:{},ConfigGovernance:{leave(u,e){Jp(u,e)}},ConfigApisProperties:{leave(u,e){Jp(u,e)}},"rootRedoclyConfigSchema.scorecard.levels_items":{leave(u,e){Jp(u,e)}},ConfigRoot:{leave(u,e){Jp(u,e)}}}}],bE);function Up(u,e){if(Du(u)&&u.extends){const{plugins:a}=e.getVisitorData(),t=IH({node:u,ctx:e,plugins:a});Object.assign(u,t),delete u.extends}}const Nhe=K1([{severity:"error",ruleId:KG,visitor:{ref:{leave(u,e,a){qb(u,a,e)}},ConfigGovernance:{leave(u,e){Up(u,e)}},ConfigApisProperties:{leave(u,e){Up(u,e)}},"rootRedoclyConfigSchema.scorecard.levels_items":{leave(u,e){Up(u,e)}},ConfigRoot:{leave(u,e){Up(u,e)}}}}],bE);function Nz(u,e){switch(e){case"oas3":switch(u){case"Schema":return"schemas";case"Parameter":return"parameters";case"Response":return"responses";case"Example":return"examples";case"RequestBody":return"requestBodies";case"Header":return"headers";case"SecuritySchema":return"securitySchemes";case"Link":return"links";case"Callback":return"callbacks";default:return null}case"oas2":switch(u){case"Schema":return"definitions";case"Parameter":return"parameters";case"Response":return"responses";default:return null}case"async2":switch(u){case"Schema":return"schemas";case"Parameter":return"parameters";default:return null}case"async3":switch(u){case"Schema":return"schemas";case"Parameter":return"parameters";default:return null}case"arazzo1":switch(u){case"Root.workflows_items.parameters_items":case"Root.workflows_items.steps_items.parameters_items":return"parameters";default:return null}case"overlay1":return null}}function _he(u,e,a,t,r){let n,i;const o={ref:{leave(E,p,x){if(!x.location||x.node===void 0){nd(x,p.report,p.location);return}if(x.location.source===a.source&&x.location.source===p.location.source&&p.type.name!=="scalar"&&!e){E.$ref!==x.location.pointer&&(E.$ref=x.location.pointer);return}if(r&&Xa(E.$ref))return;const m=Nz(p.type.name,u);m?e?(l(m,x,p),qb(E,x,p)):(E.$ref=l(m,x,p),s(E,x,p)):qb(E,x,p)}},Example:{leave(E,p){if(UI(E)&&E.value===void 0){const x=p.resolve({$ref:E.externalValue});if(!x.location||x.node===void 0){nd(x,p.report,p.location);return}if(r&&Xa(E.externalValue))return;E.value=p.resolve({$ref:E.externalValue}).node,delete E.externalValue}}},Root:{enter(E,p){i=p.location,u==="oas3"?n=E.components=E.components||{}:u==="oas2"?n=E:u==="async2"?n=E.components=E.components||{}:u==="async3"?n=E.components=E.components||{}:u==="arazzo1"&&(n=E.components=E.components||{})}}};u==="oas3"&&(o.DiscriminatorMapping={leave(E,p){for(const x of Object.keys(E)){const m=E[x],g=p.resolve({$ref:m});if(!g.location||g.node===void 0){nd(g,p.report,p.location.child(x));return}const h=Nz("Schema",u);E[x]=l(h,g,p)}}});function s(E,p,x){const m=id(x.location.source.absoluteRef,E.$ref);t.set(m,{document:a,isRemote:!1,node:p.node,nodePointer:E.$ref,resolved:!0})}function l(E,p,x){n[E]=n[E]||{};const m=d(p,E,x);return n[E][m]=p.node,u==="oas3"||u==="async2"||u==="async3"?`#/components/${E}/${m}`:`#/${E}/${m}`}function c(E,p,x){return Ra(E)&&x.resolve(E,i.absolutePointer).location?.absolutePointer===p.location.absolutePointer?!0:Gb(E,p.node)}function d(E,p,x){const[m,g]=[E.location.source.absoluteRef,E.location.pointer],h=n[p];let f="";const k=g.slice(2).split("/").filter(Ht);for(;k.length>0;)if(f=k.pop()+(f?`-${f}`:""),!h||!h[f]||c(h[f],E,x))return f;if(f=Vne(m)+(f?`_${f}`:""),!h[f]||c(h[f],E,x))return f;const y=f;let v=2;for(;h[f]&&!c(h[f],E,x);)f=`${y}-${v}`,v++;return h[f]||x.report({message:`Two schemas are referenced with the same name but different content. Renamed ${y} to ${f}.`,location:x.location,forceSeverity:"warn"}),f}return o}async function Lhe(u){const{document:e,config:a,types:t,externalRefResolver:r,dereference:n=!1,removeUnusedComponents:i=!1,keepUrlRefs:o=!1}=u,s=Sf(e.parsed),l=LG(s),c=a.getRulesForSpecVersion(l),d=n2(a.extendTypes(t,s),a),E=v5(c,a,"preprocessors",s),p=v5(c,a,"decorators",s),x={problems:[],specVersion:s,config:a,refTypes:new Map,visitorsData:{}};i&&!p.some(h=>h.ruleId==="remove-unused-components")&&p.push({severity:"error",ruleId:"remove-unused-components",visitor:l==="oas2"?_H():NH()});let m=await Md({rootDocument:e,rootType:d.Root,externalRefResolver:r});E.length>0&&(I1({document:e,rootType:d.Root,normalizedVisitors:K1(E,d),resolvedRefMap:m,ctx:x}),m=await Md({rootDocument:e,rootType:d.Root,externalRefResolver:r}));const g=K1([{severity:"error",ruleId:"bundler",visitor:_he(l,n,e,m,o)},...p],d);return I1({document:e,rootType:d.Root,normalizedVisitors:g,resolvedRefMap:m,ctx:x}),{bundle:e,problems:x.problems.map(h=>a.addProblemToIgnore(h)),fileDependencies:r.getFiles(),rootType:d.Root,refTypes:x.refTypes,visitorsData:x.visitorsData}}function Ihe(u,e,a){const t={plugins:[],rootConfigDir:a},r={problems:[],specVersion:"oas3_0",refTypes:new Map,visitorsData:{[VG]:t}};return I1({document:u,rootType:bE.ConfigRoot,normalizedVisitors:Rhe,resolvedRefMap:e,ctx:r}),t.plugins}function Khe(u,e,a){const t={plugins:a},r={problems:[],specVersion:"oas3_0",refTypes:new Map,visitorsData:{[KG]:t}};return I1({document:u,rootType:bE.ConfigRoot,normalizedVisitors:Nhe,resolvedRefMap:e,ctx:r}),u.parsed??{}}async function Vhe(u){const{ref:e,doc:a,externalRefResolver:t=new Rf(u.config.resolve),base:r=null}=u;if(!(e||a))throw new Error(`Document or reference is required.
222
- `);const n=a===void 0?await t.resolveDocument(r,e,!0):a;if(n instanceof Error)throw n;return u.collectSpecData?.(n.parsed),Lhe({document:n,...u,externalRefResolver:t,types:d2(Sf(n.parsed))})}const R6=new Map;async function Ghe({rawConfigDocument:u,configPath:e,externalRefResolver:a,customExtends:t}){const r=u===void 0?v3e:u.parsed;if(t!==void 0&&Du(r)&&(r.extends=t),Du(r)&&r?.extends?.some(Ahe))throw new Error("Configuration format not detected in extends: values must be strings.");const n=u??{source:new L1(e??"",JSON.stringify(r)),parsed:r},i=await Md({rootDocument:n,rootType:bE.ConfigRoot,externalRefResolver:a??new Rf(IG(r?.resolve))});let o=[],s,l="";Ya?s=[...(r?.plugins||[]).filter(p=>!zt(p)),jz]:(l=$u.dirname(e??""),o=Ihe(n,i,l),s=[...await qhe(o.map(p=>_z(p)?p.absolutePath:p),l),jz]);const c=Khe(n,Phe(i),s);c.apis&&(c.apis=Object.fromEntries(Object.entries(c.apis).map(([E,p])=>{const x=LH([c,p]);return[E,{...p,...x}]})));const d=o.length?o.map(E=>_z(E)&&E.isModule?E.rawPath:E.absolutePath&&$u.relative(l,E.absolutePath)).filter(g5):void 0;return{resolvedConfig:{...c,plugins:d},resolvedRefMap:i,plugins:s}}function Hhe(u){for(const e of b3e)(void 0)($u.resolve(u,e))}function _z(u){return"isModule"in u}const KH=(u,e,a)=>{if(!zt(u))return u;const t=$u.resolve($u.dirname(e),u);return(void 0)(t)?{absolutePath:t,rawPath:u,isModule:!1}:{absolutePath:VI.createRequire((typeof document>"u"?require("url").pathToFileURL(__filename).href:_n&&_n.tagName.toUpperCase()==="SCRIPT"&&_n.src||new URL("replay-index-BSVE3Man.js",document.baseURI).href)??__dirname).resolve(u,{paths:[a,(typeof document>"u"?require("url").pathToFileURL(__filename).href:_n&&_n.tagName.toUpperCase()==="SCRIPT"&&_n.src||new URL("replay-index-BSVE3Man.js",document.baseURI).href)?$u.dirname((void 0)(typeof document>"u"?require("url").pathToFileURL(__filename).href:_n&&_n.tagName.toUpperCase()==="SCRIPT"&&_n.src||new URL("replay-index-BSVE3Man.js",document.baseURI).href)):__dirname]}),isModule:!0,rawPath:u}};async function qhe(u,e){if(!u)return[];const a=async o=>{if(!zt(o))return o;try{const s=$u.isAbsolute(o)?o:KH(o,$u.join(e,g3e),e).absolutePath;if(!R6.has(s)){let l;if(typeof __webpack_require__=="function")l=__non_webpack_require__(s);else{const x=await import((void 0)(s).pathname);l=x.default||x}const c={contentDir:e},d=Array.isArray(l)?l:[l];for(const x of d)x?.id&&Tz(x)&&na.info(`Deprecated plugin format detected: ${x.id}
222
+ `);const n=a===void 0?await t.resolveDocument(r,e,!0):a;if(n instanceof Error)throw n;return u.collectSpecData?.(n.parsed),Lhe({document:n,...u,externalRefResolver:t,types:d2(Sf(n.parsed))})}const R6=new Map;async function Ghe({rawConfigDocument:u,configPath:e,externalRefResolver:a,customExtends:t}){const r=u===void 0?v3e:u.parsed;if(t!==void 0&&Du(r)&&(r.extends=t),Du(r)&&r?.extends?.some(Ahe))throw new Error("Configuration format not detected in extends: values must be strings.");const n=u??{source:new L1(e??"",JSON.stringify(r)),parsed:r},i=await Md({rootDocument:n,rootType:bE.ConfigRoot,externalRefResolver:a??new Rf(IG(r?.resolve))});let o=[],s,l="";Ya?s=[...(r?.plugins||[]).filter(p=>!zt(p)),jz]:(l=$u.dirname(e??""),o=Ihe(n,i,l),s=[...await qhe(o.map(p=>_z(p)?p.absolutePath:p),l),jz]);const c=Khe(n,Phe(i),s);c.apis&&(c.apis=Object.fromEntries(Object.entries(c.apis).map(([E,p])=>{const x=LH([c,p]);return[E,{...p,...x}]})));const d=o.length?o.map(E=>_z(E)&&E.isModule?E.rawPath:E.absolutePath&&$u.relative(l,E.absolutePath)).filter(g5):void 0;return{resolvedConfig:{...c,plugins:d},resolvedRefMap:i,plugins:s}}function Hhe(u){for(const e of b3e)(void 0)($u.resolve(u,e))}function _z(u){return"isModule"in u}const KH=(u,e,a)=>{if(!zt(u))return u;const t=$u.resolve($u.dirname(e),u);return(void 0)(t)?{absolutePath:t,rawPath:u,isModule:!1}:{absolutePath:VI.createRequire((typeof document>"u"?require("url").pathToFileURL(__filename).href:_n&&_n.tagName.toUpperCase()==="SCRIPT"&&_n.src||new URL("replay-index-C4h35ymL.js",document.baseURI).href)??__dirname).resolve(u,{paths:[a,(typeof document>"u"?require("url").pathToFileURL(__filename).href:_n&&_n.tagName.toUpperCase()==="SCRIPT"&&_n.src||new URL("replay-index-C4h35ymL.js",document.baseURI).href)?$u.dirname((void 0)(typeof document>"u"?require("url").pathToFileURL(__filename).href:_n&&_n.tagName.toUpperCase()==="SCRIPT"&&_n.src||new URL("replay-index-C4h35ymL.js",document.baseURI).href)):__dirname]}),isModule:!0,rawPath:u}};async function qhe(u,e){if(!u)return[];const a=async o=>{if(!zt(o))return o;try{const s=$u.isAbsolute(o)?o:KH(o,$u.join(e,g3e),e).absolutePath;if(!R6.has(s)){let l;if(typeof __webpack_require__=="function")l=__non_webpack_require__(s);else{const x=await import((void 0)(s).pathname);l=x.default||x}const c={contentDir:e},d=Array.isArray(l)?l:[l];for(const x of d)x?.id&&Tz(x)&&na.info(`Deprecated plugin format detected: ${x.id}
223
223
  `);const E=Tz(l)?l:jhe(l)?await l(c):await l?.default?.(c),p=Array.isArray(E)?E:[E];E&&R6.set(s,p.map(x=>({...x,path:o,absolutePath:s})))}return R6.get(s)}catch(s){throw new Error(`Failed to load plugin "${o}": ${s.message}
224
224
 
225
225
  ${s.stack}`)}},t=new Map,r=Hhe(e);r&&u.push(r);const n=new Set;return(await Promise.all(u.map(async o=>{if(zt(o)){if(Xa(o))throw new Error(Ru.red("We don't support remote plugins yet."));if(n.has(o))return;n.add(o)}const s=await a(o);if(!s)return;const l=Array.isArray(s)?s:[s];return(await Promise.all(l.map(async c=>{if(!c)return;const d=c.id;if(typeof d!="string")throw new Error(Ru.red(`Plugin must define \`id\` property in ${Ru.blue(o.toString())}.`));const E=c.absolutePath??o.toString(),p=t.get(d);if(p){if(E!==p)throw new Error(Ru.red(`Plugin "id" must be unique. Plugin ${Ru.blue(E)} uses id "${Ru.blue(d)}" already seen in ${Ru.blue(E)}`));return}t.set(d,E);const x={id:d,...c.configs?{configs:c.configs}:{},...c.typeExtension?{typeExtension:c.typeExtension}:{}};if(c.rules){if(!c.rules.oas3&&!c.rules.oas2&&!c.rules.async2&&!c.rules.async3&&!c.rules.arazzo1&&!c.rules.overlay1)throw new Error(`Plugin rules must have \`oas3\`, \`oas2\`, \`async2\`, \`async3\`, \`arazzo\`, or \`overlay1\` rules "${o}.`);x.rules={},c.rules.oas3&&(x.rules.oas3=Qa(c.rules.oas3,d)),c.rules.oas2&&(x.rules.oas2=Qa(c.rules.oas2,d)),c.rules.async2&&(x.rules.async2=Qa(c.rules.async2,d)),c.rules.async3&&(x.rules.async3=Qa(c.rules.async3,d)),c.rules.arazzo1&&(x.rules.arazzo1=Qa(c.rules.arazzo1,d)),c.rules.overlay1&&(x.rules.overlay1=Qa(c.rules.overlay1,d))}if(c.preprocessors){if(!c.preprocessors.oas3&&!c.preprocessors.oas2&&!c.preprocessors.async2&&!c.preprocessors.async3&&!c.preprocessors.arazzo1&&!c.preprocessors.overlay1)throw new Error(`Plugin \`preprocessors\` must have \`oas3\`, \`oas2\`, \`async2\`, \`async3\`, \`arazzo1\`, or \`overlay1\` preprocessors "${o}.`);x.preprocessors={},c.preprocessors.oas3&&(x.preprocessors.oas3=Qa(c.preprocessors.oas3,d)),c.preprocessors.oas2&&(x.preprocessors.oas2=Qa(c.preprocessors.oas2,d)),c.preprocessors.async2&&(x.preprocessors.async2=Qa(c.preprocessors.async2,d)),c.preprocessors.async3&&(x.preprocessors.async3=Qa(c.preprocessors.async3,d)),c.preprocessors.arazzo1&&(x.preprocessors.arazzo1=Qa(c.preprocessors.arazzo1,d)),c.preprocessors.overlay1&&(x.preprocessors.overlay1=Qa(c.preprocessors.overlay1,d))}if(c.decorators){if(!c.decorators.oas3&&!c.decorators.oas2&&!c.decorators.async2&&!c.decorators.async3&&!c.decorators.arazzo1&&!c.decorators.overlay1)throw new Error(`Plugin \`decorators\` must have \`oas3\`, \`oas2\`, \`async2\`, \`async3\`, \`arazzo1\`, or \`overlay1\` decorators "${o}.`);x.decorators={},c.decorators.oas3&&(x.decorators.oas3=Qa(c.decorators.oas3,d)),c.decorators.oas2&&(x.decorators.oas2=Qa(c.decorators.oas2,d)),c.decorators.async2&&(x.decorators.async2=Qa(c.decorators.async2,d)),c.decorators.async3&&(x.decorators.async3=Qa(c.decorators.async3,d)),c.decorators.arazzo1&&(x.decorators.arazzo1=Qa(c.decorators.arazzo1,d)),c.decorators.overlay1&&(x.decorators.overlay1=Qa(c.decorators.overlay1,d))}return c.assertions&&(x.assertions=c.assertions),{...c,...x}}))).filter(g5)}))).filter(g5).flat()}function Whe(u,e){const{pluginId:a,configName:t}=Ohe(u),r=e.find(i=>i.id===a);if(!r)throw new Error(`Invalid config ${Ru.red(u)}: plugin ${a} is not included.`);const n=r.configs?.[t];if(!n)throw new Error(a?`Invalid config ${Ru.red(u)}: plugin ${a} doesn't export config with name ${t}.`:`Invalid config ${Ru.red(u)}: there is no such built-in config.`);return n}async function VH(u,{configPath:e,externalRefResolver:a}={}){const r=She(typeof u=="string"?u:"",e??"");typeof u!="string"&&u&&(r.parsed=u);const{resolvedConfig:n,resolvedRefMap:i,plugins:o}=await Ghe({rawConfigDocument:Jhe(r),configPath:e,externalRefResolver:a});return new C2(n,{configPath:e,document:r,resolvedRefMap:i,plugins:o})}function Jhe(u){if(!u.parsed)return u;const{plugins:e,resolve:a,...t}=u.parsed,r={...structuredClone(t),plugins:e?.slice(),...a&&{resolve:{...a}}};return{...u,parsed:r}}var N6={},dr={},_6={},Lz;function Nf(){return Lz||(Lz=1,(function(u){Object.defineProperty(u,"__esModule",{value:!0});var e;(function(s){s[s.SCALAR=0]="SCALAR",s[s.MAPPING=1]="MAPPING",s[s.MAP=2]="MAP",s[s.SEQ=3]="SEQ",s[s.ANCHOR_REF=4]="ANCHOR_REF",s[s.INCLUDE_REF=5]="INCLUDE_REF"})(e=u.Kind||(u.Kind={}));function a(s,l){var c=l?l.endPosition:s.endPosition+1,d={key:s,value:l,startPosition:s.startPosition,endPosition:c,kind:e.MAPPING,parent:null,errors:[]};return d}u.newMapping=a;function t(s,l,c,d){return{errors:[],referencesAnchor:s,value:d,startPosition:l,endPosition:c,kind:e.ANCHOR_REF,parent:null}}u.newAnchorRef=t;function r(s){s===void 0&&(s="");var l={errors:[],startPosition:-1,endPosition:-1,value:""+s,kind:e.SCALAR,parent:null,doubleQuoted:!1,rawValue:""+s};return typeof s!="string"&&(l.valueObject=s),l}u.newScalar=r;function n(){return{errors:[],startPosition:-1,endPosition:-1,items:[],kind:e.SEQ,parent:null}}u.newItems=n;function i(){return n()}u.newSeq=i;function o(s){return{errors:[],startPosition:-1,endPosition:-1,mappings:s||[],kind:e.MAP,parent:null}}u.newMap=o})(_6)),_6}var qn={},Iz;function gc(){if(Iz)return qn;Iz=1,Object.defineProperty(qn,"__esModule",{value:!0});function u(i){return typeof i>"u"||i===null}qn.isNothing=u;function e(i){return typeof i=="object"&&i!==null}qn.isObject=e;function a(i){return Array.isArray(i)?i:u(i)?[]:[i]}qn.toArray=a;function t(i,o){var s,l,c,d;if(o)for(d=Object.keys(o),s=0,l=d.length;s<l;s+=1)c=d[s],i[c]=o[c];return i}qn.extend=t;function r(i,o){var s="",l;for(l=0;l<o;l+=1)s+=i;return s}qn.repeat=r;function n(i){return i===0&&Number.NEGATIVE_INFINITY===1/i}return qn.isNegativeZero=n,qn}var L6,Kz;function BE(){if(Kz)return L6;Kz=1;var u=(function(){function e(a,t,r){t===void 0&&(t=null),r===void 0&&(r=!1),this.name="YAMLException",this.reason=a,this.mark=t,this.message=this.toString(!1),this.isWarning=r}return e.isInstance=function(a){if(a!=null&&a.getClassIdentifier&&typeof a.getClassIdentifier=="function")for(var t=0,r=a.getClassIdentifier();t<r.length;t++){var n=r[t];if(n==e.CLASS_IDENTIFIER)return!0}return!1},e.prototype.getClassIdentifier=function(){var a=[];return a.concat(e.CLASS_IDENTIFIER)},e.prototype.toString=function(a){a===void 0&&(a=!1);var t;return t="JS-YAML: "+(this.reason||"(unknown reason)"),!a&&this.mark&&(t+=" "+this.mark.toString()),t},e.CLASS_IDENTIFIER="yaml-ast-parser.YAMLException",e})();return L6=u,L6}var I6,Vz;function Uhe(){if(Vz)return I6;Vz=1;var u=gc(),e=(function(){function a(t,r,n,i,o){this.name=t,this.buffer=r,this.position=n,this.line=i,this.column=o}return a.prototype.getSnippet=function(t,r){t===void 0&&(t=0),r===void 0&&(r=75);var n,i,o,s,l;if(!this.buffer)return null;for(t=t||4,r=r||75,n="",i=this.position;i>0&&`\0\r
@@ -472,7 +472,7 @@ html body {
472
472
  align-self: flex-end;
473
473
  padding-top: var(--spacing-xxs);
474
474
  gap: var(--spacing-xs);
475
- `;function Y2({input:u,onSave:e,onCancel:a,...t}){const[r,n]=H.useState(!!u.isSecret),i=({name:o,value:s})=>{e({...u,name:o,value:s,isSecret:r})};return D.jsx(nJ,{variable:u,onSave:i,onCancel:a,...t,children:D.jsx(Ld,{children:D.jsx(rJ,{value:r,onChange:o=>n(o),title:"Make it secret"})})})}const zy=()=>({name:"",value:"",isSecret:!1}),va=u=>KI+"$inputs."+u+r2,E1u=(u,e)=>e.inputs.find(a=>a.get().name===u.match(`^${ff}$`)?.[1]);function p1u({environments:u,activeEnvironmentId:e}){return u.get().find(t=>t.name===e.get())?.inputs||[]}function qi(u){const e=new RegExp(ff,"g"),a=new Set;if(!u)return a;for(const[t,r,n]of u.matchAll(e)){const i=r||n;i&&a.add(i)}return a}function X2(u){const e=/^\{?\$inputs\.([^\}\s]+)\}?$/,a=u.match(e);return a?a[1]:null}function mx(u){var e=new Error(u);return e.source="ulid",e}var eA="0123456789ABCDEFGHJKMNPQRSTVWXYZ",sd=eA.length,yj=Math.pow(2,48)-1,m1u=10,h1u=16;function x1u(u){var e=Math.floor(u()*sd);return e===sd&&(e=sd-1),eA.charAt(e)}function D1u(u,e){if(isNaN(u))throw new Error(u+" must be a number");if(u>yj)throw mx("cannot encode time greater than "+yj);if(u<0)throw mx("time must be positive");if(Number.isInteger(u)===!1)throw mx("time must be an integer");for(var a=void 0,t="";e>0;e--)a=u%sd,t=eA.charAt(a)+t,u=(u-a)/sd;return t}function f1u(u,e){for(var a="";u>0;u--)a=x1u(e)+a;return a}function g1u(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=arguments[1];e||(e=typeof window<"u"?window:null);var a=e&&(e.crypto||e.msCrypto);if(a)return function(){var r=new Uint8Array(1);return a.getRandomValues(r),r[0]/255};try{var t=require("crypto");return function(){return t.randomBytes(1).readUInt8()/255}}catch{}if(u){try{console.error("secure crypto unusable, falling back to insecure Math.random()!")}catch{}return function(){return Math.random()}}throw mx("secure crypto unusable, insecure Math.random not allowed")}function v1u(u){return u||(u=g1u()),function(a){return isNaN(a)&&(a=Date.now()),D1u(a,m1u)+f1u(h1u,u)}}var L5=v1u(),k1u=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{},bs="1.9.0",Cj=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function b1u(u){var e=new Set([u]),a=new Set,t=u.match(Cj);if(!t)return function(){return!1};var r={major:+t[1],minor:+t[2],patch:+t[3],prerelease:t[4]};if(r.prerelease!=null)return function(s){return s===u};function n(o){return a.add(o),!1}function i(o){return e.add(o),!0}return function(s){if(e.has(s))return!0;if(a.has(s))return!1;var l=s.match(Cj);if(!l)return n(s);var c={major:+l[1],minor:+l[2],patch:+l[3],prerelease:l[4]};return c.prerelease!=null||r.major!==c.major?n(s):r.major===0?r.minor===c.minor&&r.patch<=c.patch?i(s):n(s):r.minor<=c.minor?i(s):n(s)}}var y1u=b1u(bs),C1u=bs.split(".")[0],Id=Symbol.for("opentelemetry.js.api."+C1u),Kd=k1u;function PE(u,e,a,t){var r;t===void 0&&(t=!1);var n=Kd[Id]=(r=Kd[Id])!==null&&r!==void 0?r:{version:bs};if(!t&&n[u]){var i=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+u);return a.error(i.stack||i.message),!1}if(n.version!==bs){var i=new Error("@opentelemetry/api: Registration of version v"+n.version+" for "+u+" does not match previously registered API v"+bs);return a.error(i.stack||i.message),!1}return n[u]=e,a.debug("@opentelemetry/api: Registered a global for "+u+" v"+bs+"."),!0}function $s(u){var e,a,t=(e=Kd[Id])===null||e===void 0?void 0:e.version;if(!(!t||!y1u(t)))return(a=Kd[Id])===null||a===void 0?void 0:a[u]}function jE(u,e){e.debug("@opentelemetry/api: Unregistering a global for "+u+" v"+bs+".");var a=Kd[Id];a&&delete a[u]}var F1u=function(u,e){var a=typeof Symbol=="function"&&u[Symbol.iterator];if(!a)return u;var t=a.call(u),r,n=[],i;try{for(;(e===void 0||e-- >0)&&!(r=t.next()).done;)n.push(r.value)}catch(o){i={error:o}}finally{try{r&&!r.done&&(a=t.return)&&a.call(t)}finally{if(i)throw i.error}}return n},A1u=function(u,e,a){if(a||arguments.length===2)for(var t=0,r=e.length,n;t<r;t++)(n||!(t in e))&&(n||(n=Array.prototype.slice.call(e,0,t)),n[t]=e[t]);return u.concat(n||Array.prototype.slice.call(e))},B1u=(function(){function u(e){this._namespace=e.namespace||"DiagComponentLogger"}return u.prototype.debug=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];return f4("debug",this._namespace,e)},u.prototype.error=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];return f4("error",this._namespace,e)},u.prototype.info=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];return f4("info",this._namespace,e)},u.prototype.warn=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];return f4("warn",this._namespace,e)},u.prototype.verbose=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];return f4("verbose",this._namespace,e)},u})();function f4(u,e,a){var t=$s("diag");if(t)return a.unshift(e),t[u].apply(t,A1u([],F1u(a),!1))}var At;(function(u){u[u.NONE=0]="NONE",u[u.ERROR=30]="ERROR",u[u.WARN=50]="WARN",u[u.INFO=60]="INFO",u[u.DEBUG=70]="DEBUG",u[u.VERBOSE=80]="VERBOSE",u[u.ALL=9999]="ALL"})(At||(At={}));function S1u(u,e){u<At.NONE?u=At.NONE:u>At.ALL&&(u=At.ALL),e=e||{};function a(t,r){var n=e[t];return typeof n=="function"&&u>=r?n.bind(e):function(){}}return{error:a("error",At.ERROR),warn:a("warn",At.WARN),info:a("info",At.INFO),debug:a("debug",At.DEBUG),verbose:a("verbose",At.VERBOSE)}}var z1u=function(u,e){var a=typeof Symbol=="function"&&u[Symbol.iterator];if(!a)return u;var t=a.call(u),r,n=[],i;try{for(;(e===void 0||e-- >0)&&!(r=t.next()).done;)n.push(r.value)}catch(o){i={error:o}}finally{try{r&&!r.done&&(a=t.return)&&a.call(t)}finally{if(i)throw i.error}}return n},w1u=function(u,e,a){if(a||arguments.length===2)for(var t=0,r=e.length,n;t<r;t++)(n||!(t in e))&&(n||(n=Array.prototype.slice.call(e,0,t)),n[t]=e[t]);return u.concat(n||Array.prototype.slice.call(e))},O1u="diag",vn=(function(){function u(){function e(r){return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var o=$s("diag");if(o)return o[r].apply(o,w1u([],z1u(n),!1))}}var a=this,t=function(r,n){var i,o,s;if(n===void 0&&(n={logLevel:At.INFO}),r===a){var l=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return a.error((i=l.stack)!==null&&i!==void 0?i:l.message),!1}typeof n=="number"&&(n={logLevel:n});var c=$s("diag"),d=S1u((o=n.logLevel)!==null&&o!==void 0?o:At.INFO,r);if(c&&!n.suppressOverrideMessage){var E=(s=new Error().stack)!==null&&s!==void 0?s:"<failed to generate stacktrace>";c.warn("Current logger will be overwritten from "+E),d.warn("Current logger will overwrite one already registered from "+E)}return PE("diag",d,a,!0)};a.setLogger=t,a.disable=function(){jE(O1u,a)},a.createComponentLogger=function(r){return new B1u(r)},a.verbose=e("verbose"),a.debug=e("debug"),a.info=e("info"),a.warn=e("warn"),a.error=e("error")}return u.instance=function(){return this._instance||(this._instance=new u),this._instance},u})(),P1u=function(u,e){var a=typeof Symbol=="function"&&u[Symbol.iterator];if(!a)return u;var t=a.call(u),r,n=[],i;try{for(;(e===void 0||e-- >0)&&!(r=t.next()).done;)n.push(r.value)}catch(o){i={error:o}}finally{try{r&&!r.done&&(a=t.return)&&a.call(t)}finally{if(i)throw i.error}}return n},j1u=function(u){var e=typeof Symbol=="function"&&Symbol.iterator,a=e&&u[e],t=0;if(a)return a.call(u);if(u&&typeof u.length=="number")return{next:function(){return u&&t>=u.length&&(u=void 0),{value:u&&u[t++],done:!u}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},M1u=(function(){function u(e){this._entries=e?new Map(e):new Map}return u.prototype.getEntry=function(e){var a=this._entries.get(e);if(a)return Object.assign({},a)},u.prototype.getAllEntries=function(){return Array.from(this._entries.entries()).map(function(e){var a=P1u(e,2),t=a[0],r=a[1];return[t,r]})},u.prototype.setEntry=function(e,a){var t=new u(this._entries);return t._entries.set(e,a),t},u.prototype.removeEntry=function(e){var a=new u(this._entries);return a._entries.delete(e),a},u.prototype.removeEntries=function(){for(var e,a,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=new u(this._entries);try{for(var i=j1u(t),o=i.next();!o.done;o=i.next()){var s=o.value;n._entries.delete(s)}}catch(l){e={error:l}}finally{try{o&&!o.done&&(a=i.return)&&a.call(i)}finally{if(e)throw e.error}}return n},u.prototype.clear=function(){return new u},u})(),T1u=Symbol("BaggageEntryMetadata"),$1u=vn.instance();function R1u(u){return u===void 0&&(u={}),new M1u(new Map(Object.entries(u)))}function N1u(u){return typeof u!="string"&&($1u.error("Cannot create baggage metadata from unknown type: "+typeof u),u=""),{__TYPE__:T1u,toString:function(){return u}}}function uA(u){return Symbol.for(u)}var _1u=(function(){function u(e){var a=this;a._currentContext=e?new Map(e):new Map,a.getValue=function(t){return a._currentContext.get(t)},a.setValue=function(t,r){var n=new u(a._currentContext);return n._currentContext.set(t,r),n},a.deleteValue=function(t){var r=new u(a._currentContext);return r._currentContext.delete(t),r}}return u})(),u1=new _1u,Ys=(function(){var u=function(e,a){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])},u(e,a)};return function(e,a){if(typeof a!="function"&&a!==null)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");u(e,a);function t(){this.constructor=e}e.prototype=a===null?Object.create(a):(t.prototype=a.prototype,new t)}})(),L1u=(function(){function u(){}return u.prototype.createGauge=function(e,a){return Z1u},u.prototype.createHistogram=function(e,a){return Q1u},u.prototype.createCounter=function(e,a){return U1u},u.prototype.createUpDownCounter=function(e,a){return Y1u},u.prototype.createObservableGauge=function(e,a){return ecu},u.prototype.createObservableCounter=function(e,a){return X1u},u.prototype.createObservableUpDownCounter=function(e,a){return ucu},u.prototype.addBatchObservableCallback=function(e,a){},u.prototype.removeBatchObservableCallback=function(e){},u})(),Yf=(function(){function u(){}return u})(),I1u=(function(u){Ys(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e.prototype.add=function(a,t){},e})(Yf),K1u=(function(u){Ys(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e.prototype.add=function(a,t){},e})(Yf),V1u=(function(u){Ys(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e.prototype.record=function(a,t){},e})(Yf),G1u=(function(u){Ys(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e.prototype.record=function(a,t){},e})(Yf),aA=(function(){function u(){}return u.prototype.addCallback=function(e){},u.prototype.removeCallback=function(e){},u})(),H1u=(function(u){Ys(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e})(aA),q1u=(function(u){Ys(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e})(aA),W1u=(function(u){Ys(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e})(aA),J1u=new L1u,U1u=new I1u,Z1u=new V1u,Q1u=new G1u,Y1u=new K1u,X1u=new H1u,ecu=new q1u,ucu=new W1u,acu={get:function(u,e){if(u!=null)return u[e]},keys:function(u){return u==null?[]:Object.keys(u)}},tcu={set:function(u,e,a){u!=null&&(u[e]=a)}},rcu=function(u,e){var a=typeof Symbol=="function"&&u[Symbol.iterator];if(!a)return u;var t=a.call(u),r,n=[],i;try{for(;(e===void 0||e-- >0)&&!(r=t.next()).done;)n.push(r.value)}catch(o){i={error:o}}finally{try{r&&!r.done&&(a=t.return)&&a.call(t)}finally{if(i)throw i.error}}return n},ncu=function(u,e,a){if(a||arguments.length===2)for(var t=0,r=e.length,n;t<r;t++)(n||!(t in e))&&(n||(n=Array.prototype.slice.call(e,0,t)),n[t]=e[t]);return u.concat(n||Array.prototype.slice.call(e))},icu=(function(){function u(){}return u.prototype.active=function(){return u1},u.prototype.with=function(e,a,t){for(var r=[],n=3;n<arguments.length;n++)r[n-3]=arguments[n];return a.call.apply(a,ncu([t],rcu(r),!1))},u.prototype.bind=function(e,a){return a},u.prototype.enable=function(){return this},u.prototype.disable=function(){return this},u})(),ocu=function(u,e){var a=typeof Symbol=="function"&&u[Symbol.iterator];if(!a)return u;var t=a.call(u),r,n=[],i;try{for(;(e===void 0||e-- >0)&&!(r=t.next()).done;)n.push(r.value)}catch(o){i={error:o}}finally{try{r&&!r.done&&(a=t.return)&&a.call(t)}finally{if(i)throw i.error}}return n},scu=function(u,e,a){if(a||arguments.length===2)for(var t=0,r=e.length,n;t<r;t++)(n||!(t in e))&&(n||(n=Array.prototype.slice.call(e,0,t)),n[t]=e[t]);return u.concat(n||Array.prototype.slice.call(e))},Jv="context",lcu=new icu,Xf=(function(){function u(){}return u.getInstance=function(){return this._instance||(this._instance=new u),this._instance},u.prototype.setGlobalContextManager=function(e){return PE(Jv,e,vn.instance())},u.prototype.active=function(){return this._getContextManager().active()},u.prototype.with=function(e,a,t){for(var r,n=[],i=3;i<arguments.length;i++)n[i-3]=arguments[i];return(r=this._getContextManager()).with.apply(r,scu([e,a,t],ocu(n),!1))},u.prototype.bind=function(e,a){return this._getContextManager().bind(e,a)},u.prototype._getContextManager=function(){return $s(Jv)||lcu},u.prototype.disable=function(){this._getContextManager().disable(),jE(Jv,vn.instance())},u})(),fi;(function(u){u[u.NONE=0]="NONE",u[u.SAMPLED=1]="SAMPLED"})(fi||(fi={}));var iJ="0000000000000000",oJ="00000000000000000000000000000000",sJ={traceId:oJ,spanId:iJ,traceFlags:fi.NONE},ld=(function(){function u(e){e===void 0&&(e=sJ),this._spanContext=e}return u.prototype.spanContext=function(){return this._spanContext},u.prototype.setAttribute=function(e,a){return this},u.prototype.setAttributes=function(e){return this},u.prototype.addEvent=function(e,a){return this},u.prototype.addLink=function(e){return this},u.prototype.addLinks=function(e){return this},u.prototype.setStatus=function(e){return this},u.prototype.updateName=function(e){return this},u.prototype.end=function(e){},u.prototype.isRecording=function(){return!1},u.prototype.recordException=function(e,a){},u})(),tA=uA("OpenTelemetry Context Key SPAN");function rA(u){return u.getValue(tA)||void 0}function ccu(){return rA(Xf.getInstance().active())}function nA(u,e){return u.setValue(tA,e)}function dcu(u){return u.deleteValue(tA)}function Ecu(u,e){return nA(u,new ld(e))}function lJ(u){var e;return(e=rA(u))===null||e===void 0?void 0:e.spanContext()}var pcu=/^([0-9a-f]{32})$/i,mcu=/^[0-9a-f]{16}$/i;function cJ(u){return pcu.test(u)&&u!==oJ}function hcu(u){return mcu.test(u)&&u!==iJ}function eg(u){return cJ(u.traceId)&&hcu(u.spanId)}function xcu(u){return new ld(u)}var Uv=Xf.getInstance(),dJ=(function(){function u(){}return u.prototype.startSpan=function(e,a,t){t===void 0&&(t=Uv.active());var r=!!a?.root;if(r)return new ld;var n=t&&lJ(t);return Dcu(n)&&eg(n)?new ld(n):new ld},u.prototype.startActiveSpan=function(e,a,t,r){var n,i,o;if(!(arguments.length<2)){arguments.length===2?o=a:arguments.length===3?(n=a,o=t):(n=a,i=t,o=r);var s=i??Uv.active(),l=this.startSpan(e,n,s),c=nA(s,l);return Uv.with(c,o,void 0,l)}},u})();function Dcu(u){return typeof u=="object"&&typeof u.spanId=="string"&&typeof u.traceId=="string"&&typeof u.traceFlags=="number"}var fcu=new dJ,gcu=(function(){function u(e,a,t,r){this._provider=e,this.name=a,this.version=t,this.options=r}return u.prototype.startSpan=function(e,a,t){return this._getTracer().startSpan(e,a,t)},u.prototype.startActiveSpan=function(e,a,t,r){var n=this._getTracer();return Reflect.apply(n.startActiveSpan,n,arguments)},u.prototype._getTracer=function(){if(this._delegate)return this._delegate;var e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):fcu},u})(),vcu=(function(){function u(){}return u.prototype.getTracer=function(e,a,t){return new dJ},u})(),kcu=new vcu,Fj=(function(){function u(){}return u.prototype.getTracer=function(e,a,t){var r;return(r=this.getDelegateTracer(e,a,t))!==null&&r!==void 0?r:new gcu(this,e,a,t)},u.prototype.getDelegate=function(){var e;return(e=this._delegate)!==null&&e!==void 0?e:kcu},u.prototype.setDelegate=function(e){this._delegate=e},u.prototype.getDelegateTracer=function(e,a,t){var r;return(r=this._delegate)===null||r===void 0?void 0:r.getTracer(e,a,t)},u})(),I5;(function(u){u[u.NOT_RECORD=0]="NOT_RECORD",u[u.RECORD=1]="RECORD",u[u.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(I5||(I5={}));var wy;(function(u){u[u.INTERNAL=0]="INTERNAL",u[u.SERVER=1]="SERVER",u[u.CLIENT=2]="CLIENT",u[u.PRODUCER=3]="PRODUCER",u[u.CONSUMER=4]="CONSUMER"})(wy||(wy={}));var Vd;(function(u){u[u.UNSET=0]="UNSET",u[u.OK=1]="OK",u[u.ERROR=2]="ERROR"})(Vd||(Vd={}));var si=Xf.getInstance(),Gu=vn.instance(),bcu=(function(){function u(){}return u.prototype.getMeter=function(e,a,t){return J1u},u})(),ycu=new bcu,Zv="metrics",Ccu=(function(){function u(){}return u.getInstance=function(){return this._instance||(this._instance=new u),this._instance},u.prototype.setGlobalMeterProvider=function(e){return PE(Zv,e,vn.instance())},u.prototype.getMeterProvider=function(){return $s(Zv)||ycu},u.prototype.getMeter=function(e,a,t){return this.getMeterProvider().getMeter(e,a,t)},u.prototype.disable=function(){jE(Zv,vn.instance())},u})(),Fcu=Ccu.getInstance(),Acu=(function(){function u(){}return u.prototype.inject=function(e,a){},u.prototype.extract=function(e,a){return e},u.prototype.fields=function(){return[]},u})(),iA=uA("OpenTelemetry Baggage Key");function EJ(u){return u.getValue(iA)||void 0}function Bcu(){return EJ(Xf.getInstance().active())}function Scu(u,e){return u.setValue(iA,e)}function zcu(u){return u.deleteValue(iA)}var Qv="propagation",wcu=new Acu,Ocu=(function(){function u(){this.createBaggage=R1u,this.getBaggage=EJ,this.getActiveBaggage=Bcu,this.setBaggage=Scu,this.deleteBaggage=zcu}return u.getInstance=function(){return this._instance||(this._instance=new u),this._instance},u.prototype.setGlobalPropagator=function(e){return PE(Qv,e,vn.instance())},u.prototype.inject=function(e,a,t){return t===void 0&&(t=tcu),this._getGlobalPropagator().inject(e,a,t)},u.prototype.extract=function(e,a,t){return t===void 0&&(t=acu),this._getGlobalPropagator().extract(e,a,t)},u.prototype.fields=function(){return this._getGlobalPropagator().fields()},u.prototype.disable=function(){jE(Qv,vn.instance())},u.prototype._getGlobalPropagator=function(){return $s(Qv)||wcu},u})(),cd=Ocu.getInstance(),Yv="trace",Pcu=(function(){function u(){this._proxyTracerProvider=new Fj,this.wrapSpanContext=xcu,this.isSpanContextValid=eg,this.deleteSpan=dcu,this.getSpan=rA,this.getActiveSpan=ccu,this.getSpanContext=lJ,this.setSpan=nA,this.setSpanContext=Ecu}return u.getInstance=function(){return this._instance||(this._instance=new u),this._instance},u.prototype.setGlobalTracerProvider=function(e){var a=PE(Yv,this._proxyTracerProvider,vn.instance());return a&&this._proxyTracerProvider.setDelegate(e),a},u.prototype.getTracerProvider=function(){return $s(Yv)||this._proxyTracerProvider},u.prototype.getTracer=function(e,a){return this.getTracerProvider().getTracer(e,a)},u.prototype.disable=function(){jE(Yv,vn.instance()),this._proxyTracerProvider=new Fj},u})(),Ot=Pcu.getInstance();const pJ=uA("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function jcu(u){return u.setValue(pJ,!0)}function oA(u){return u.getValue(pJ)===!0}const Mcu="=",Oy=";",Py=",",Xv="baggage",Tcu=180,$cu=4096,Rcu=8192;function Ncu(u){return u.reduce((e,a)=>{const t=`${e}${e!==""?Py:""}${a}`;return t.length>Rcu?e:t},"")}function _cu(u){return u.getAllEntries().map(([e,a])=>{let t=`${encodeURIComponent(e)}=${encodeURIComponent(a.value)}`;return a.metadata!==void 0&&(t+=Oy+a.metadata.toString()),t})}function Lcu(u){const e=u.split(Oy);if(e.length<=0)return;const a=e.shift();if(!a)return;const t=a.indexOf(Mcu);if(t<=0)return;const r=decodeURIComponent(a.substring(0,t).trim()),n=decodeURIComponent(a.substring(t+1).trim());let i;return e.length>0&&(i=N1u(e.join(Oy))),{key:r,value:n,metadata:i}}class Icu{inject(e,a,t){const r=cd.getBaggage(e);if(!r||oA(e))return;const n=_cu(r).filter(o=>o.length<=$cu).slice(0,Tcu),i=Ncu(n);i.length>0&&t.set(a,Xv,i)}extract(e,a,t){const r=t.get(a,Xv),n=Array.isArray(r)?r.join(Py):r;if(!n)return e;const i={};return n.length===0||(n.split(Py).forEach(s=>{const l=Lcu(s);if(l){const c={value:l.value};l.metadata&&(c.metadata=l.metadata),i[l.key]=c}}),Object.entries(i).length===0)?e:cd.setBaggage(e,cd.createBaggage(i))}fields(){return[Xv]}}function hx(u){const e={};if(typeof u!="object"||u==null)return e;for(const[a,t]of Object.entries(u)){if(!Kcu(a)){Gu.warn(`Invalid attribute key: ${a}`);continue}if(!mJ(t)){Gu.warn(`Invalid attribute value set for key: ${a}`);continue}Array.isArray(t)?e[a]=t.slice():e[a]=t}return e}function Kcu(u){return typeof u=="string"&&u.length>0}function mJ(u){return u==null?!0:Array.isArray(u)?Vcu(u):hJ(u)}function Vcu(u){let e;for(const a of u)if(a!=null){if(!e){if(hJ(a)){e=typeof a;continue}return!1}if(typeof a!==e)return!1}return!0}function hJ(u){switch(typeof u){case"number":case"boolean":case"string":return!0}return!1}function Gcu(){return u=>{Gu.error(Hcu(u))}}function Hcu(u){return typeof u=="string"?u:JSON.stringify(qcu(u))}function qcu(u){const e={};let a=u;for(;a!==null;)Object.getOwnPropertyNames(a).forEach(t=>{if(e[t])return;const r=a[t];r&&(e[t]=String(r))}),a=Object.getPrototypeOf(a);return e}let Wcu=Gcu();function H1(u){try{Wcu(u)}catch{}}const v1=performance,Jcu="2.0.1",ek="exception.message",Ucu="exception.stacktrace",uk="exception.type",xJ="service.name",Zcu="service.version",jy="telemetry.sdk.language",Qcu="webjs",My="telemetry.sdk.name",Ty="telemetry.sdk.version",Ycu="process.runtime.name",ak={[My]:"opentelemetry",[Ycu]:"browser",[jy]:Qcu,[Ty]:Jcu};const Xcu=9,e4u=6,u4u=Math.pow(10,e4u),K5=Math.pow(10,Xcu);function c1(u){const e=u/1e3,a=Math.trunc(e),t=Math.round(u%1e3*u4u);return[a,t]}function DJ(){let u=v1.timeOrigin;if(typeof u!="number"){const e=v1;u=e.timing&&e.timing.fetchStart}return u}function a4u(u){const e=c1(DJ()),a=c1(typeof u=="number"?u:v1.now());return gJ(e,a)}function t4u(u,e){let a=e[0]-u[0],t=e[1]-u[1];return t<0&&(a-=1,t+=K5),[a,t]}function r4u(u){return u[0]*K5+u[1]}function fJ(u){return Array.isArray(u)&&u.length===2&&typeof u[0]=="number"&&typeof u[1]=="number"}function Aj(u){return fJ(u)||typeof u=="number"||u instanceof Date}function gJ(u,e){const a=[u[0]+e[0],u[1]+e[1]];return a[1]>=K5&&(a[1]-=K5,a[0]+=1),a}var Zr;(function(u){u[u.SUCCESS=0]="SUCCESS",u[u.FAILED=1]="FAILED"})(Zr||(Zr={}));class n4u{_propagators;_fields;constructor(e={}){this._propagators=e.propagators??[],this._fields=Array.from(new Set(this._propagators.map(a=>typeof a.fields=="function"?a.fields():[]).reduce((a,t)=>a.concat(t),[])))}inject(e,a,t){for(const r of this._propagators)try{r.inject(e,a,t)}catch(n){Gu.warn(`Failed to inject with ${r.constructor.name}. Err: ${n.message}`)}}extract(e,a,t){return this._propagators.reduce((r,n)=>{try{return n.extract(r,a,t)}catch(i){Gu.warn(`Failed to extract with ${n.constructor.name}. Err: ${i.message}`)}return r},e)}fields(){return this._fields.slice()}}const $y="[_0-9a-z-*/]",i4u=`[a-z]${$y}{0,255}`,o4u=`[a-z0-9]${$y}{0,240}@[a-z]${$y}{0,13}`,s4u=new RegExp(`^(?:${i4u}|${o4u})$`),l4u=/^[ -~]{0,255}[!-~]$/,c4u=/,|=/;function d4u(u){return s4u.test(u)}function E4u(u){return l4u.test(u)&&!c4u.test(u)}const Bj=32,p4u=512,Sj=",",zj="=";class sA{_internalState=new Map;constructor(e){e&&this._parse(e)}set(e,a){const t=this._clone();return t._internalState.has(e)&&t._internalState.delete(e),t._internalState.set(e,a),t}unset(e){const a=this._clone();return a._internalState.delete(e),a}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,a)=>(e.push(a+zj+this.get(a)),e),[]).join(Sj)}_parse(e){e.length>p4u||(this._internalState=e.split(Sj).reverse().reduce((a,t)=>{const r=t.trim(),n=r.indexOf(zj);if(n!==-1){const i=r.slice(0,n),o=r.slice(n+1,t.length);d4u(i)&&E4u(o)&&a.set(i,o)}return a},new Map),this._internalState.size>Bj&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,Bj))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){const e=new sA;return e._internalState=new Map(this._internalState),e}}const tk="traceparent",rk="tracestate",m4u="00",h4u="(?!ff)[\\da-f]{2}",x4u="(?![0]{32})[\\da-f]{32}",D4u="(?![0]{16})[\\da-f]{16}",f4u="[\\da-f]{2}",g4u=new RegExp(`^\\s?(${h4u})-(${x4u})-(${D4u})-(${f4u})(-.*)?\\s?$`);function v4u(u){const e=g4u.exec(u);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}class k4u{inject(e,a,t){const r=Ot.getSpanContext(e);if(!r||oA(e)||!eg(r))return;const n=`${m4u}-${r.traceId}-${r.spanId}-0${Number(r.traceFlags||fi.NONE).toString(16)}`;t.set(a,tk,n),r.traceState&&t.set(a,rk,r.traceState.serialize())}extract(e,a,t){const r=t.get(a,tk);if(!r)return e;const n=Array.isArray(r)?r[0]:r;if(typeof n!="string")return e;const i=v4u(n);if(!i)return e;i.isRemote=!0;const o=t.get(a,rk);if(o){const s=Array.isArray(o)?o.join(","):o;i.traceState=new sA(typeof s=="string"?s:void 0)}return Ot.setSpanContext(e,i)}fields(){return[tk,rk]}}const b4u="[object Object]",y4u="[object Null]",C4u="[object Undefined]",F4u=Function.prototype,vJ=F4u.toString,A4u=vJ.call(Object),B4u=Object.getPrototypeOf,kJ=Object.prototype,bJ=kJ.hasOwnProperty,ms=Symbol?Symbol.toStringTag:void 0,yJ=kJ.toString;function wj(u){if(!S4u(u)||z4u(u)!==b4u)return!1;const e=B4u(u);if(e===null)return!0;const a=bJ.call(e,"constructor")&&e.constructor;return typeof a=="function"&&a instanceof a&&vJ.call(a)===A4u}function S4u(u){return u!=null&&typeof u=="object"}function z4u(u){return u==null?u===void 0?C4u:y4u:ms&&ms in Object(u)?w4u(u):O4u(u)}function w4u(u){const e=bJ.call(u,ms),a=u[ms];let t=!1;try{u[ms]=void 0,t=!0}catch{}const r=yJ.call(u);return t&&(e?u[ms]=a:delete u[ms]),r}function O4u(u){return yJ.call(u)}const P4u=20;function j4u(...u){let e=u.shift();const a=new WeakMap;for(;u.length>0;)e=CJ(e,u.shift(),0,a);return e}function nk(u){return V5(u)?u.slice():u}function CJ(u,e,a=0,t){let r;if(!(a>P4u)){if(a++,xx(u)||xx(e)||FJ(e))r=nk(e);else if(V5(u)){if(r=u.slice(),V5(e))for(let n=0,i=e.length;n<i;n++)r.push(nk(e[n]));else if(g4(e)){const n=Object.keys(e);for(let i=0,o=n.length;i<o;i++){const s=n[i];r[s]=nk(e[s])}}}else if(g4(u))if(g4(e)){if(!M4u(u,e))return e;r=Object.assign({},u);const n=Object.keys(e);for(let i=0,o=n.length;i<o;i++){const s=n[i],l=e[s];if(xx(l))typeof l>"u"?delete r[s]:r[s]=l;else{const c=r[s],d=l;if(Oj(u,s,t)||Oj(e,s,t))delete r[s];else{if(g4(c)&&g4(d)){const E=t.get(c)||[],p=t.get(d)||[];E.push({obj:u,key:s}),p.push({obj:e,key:s}),t.set(c,E),t.set(d,p)}r[s]=CJ(r[s],l,a,t)}}}}else r=e;return r}}function Oj(u,e,a){const t=a.get(u[e])||[];for(let r=0,n=t.length;r<n;r++){const i=t[r];if(i.key===e&&i.obj===u)return!0}return!1}function V5(u){return Array.isArray(u)}function FJ(u){return typeof u=="function"}function g4(u){return!xx(u)&&!V5(u)&&!FJ(u)&&typeof u=="object"}function xx(u){return typeof u=="string"||typeof u=="number"||typeof u=="boolean"||typeof u>"u"||u instanceof Date||u instanceof RegExp||u===null}function M4u(u,e){return!(!wj(u)||!wj(e))}class T4u{_promise;_resolve;_reject;constructor(){this._promise=new Promise((e,a)=>{this._resolve=e,this._reject=a})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}class $4u{_callback;_that;_isCalled=!1;_deferred=new T4u;constructor(e,a){this._callback=e,this._that=a}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(a=>this._deferred.resolve(a),a=>this._deferred.reject(a))}catch(a){this._deferred.reject(a)}}return this._deferred.promise}}function R4u(){return"unknown_service"}const G4=u=>u!==null&&typeof u=="object"&&typeof u.then=="function";class G5{_rawAttributes;_asyncAttributesPending=!1;_memoizedAttributes;static FromAttributeList(e){const a=new G5({});return a._rawAttributes=Pj(e),a._asyncAttributesPending=e.filter(([t,r])=>G4(r)).length>0,a}constructor(e){const a=e.attributes??{};this._rawAttributes=Object.entries(a).map(([t,r])=>(G4(r)&&(this._asyncAttributesPending=!0),[t,r])),this._rawAttributes=Pj(this._rawAttributes)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let e=0;e<this._rawAttributes.length;e++){const[a,t]=this._rawAttributes[e];this._rawAttributes[e]=[a,G4(t)?await t:t]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&Gu.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;const e={};for(const[a,t]of this._rawAttributes){if(G4(t)){Gu.debug(`Unsettled resource attribute ${a} skipped`);continue}t!=null&&(e[a]??=t)}return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}merge(e){return e==null?this:G5.FromAttributeList([...e.getRawAttributes(),...this.getRawAttributes()])}}function AJ(u){return G5.FromAttributeList(Object.entries(u))}function N4u(){return AJ({[xJ]:R4u(),[jy]:ak[jy],[My]:ak[My],[Ty]:ak[Ty]})}function Pj(u){return u.map(([e,a])=>G4(a)?[e,a.catch(t=>{Gu.debug("promise rejection for resource attribute: %s - %s",e,t)})]:[e,a])}const _4u="exception";class L4u{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;name;status={code:Vd.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(e){const a=Date.now();this._spanContext=e.spanContext,this._performanceStartTime=v1.now(),this._performanceOffset=a-(this._performanceStartTime+DJ()),this._startTimeProvided=e.startTime!=null,this._spanLimits=e.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit||0,this._spanProcessor=e.spanProcessor,this.name=e.name,this.parentSpanContext=e.parentSpanContext,this.kind=e.kind,this.links=e.links||[],this.startTime=this._getTime(e.startTime??a),this.resource=e.resource,this.instrumentationScope=e.scope,e.attributes!=null&&this.setAttributes(e.attributes),this._spanProcessor.onStart(this,e.context)}spanContext(){return this._spanContext}setAttribute(e,a){if(a==null||this._isSpanEnded())return this;if(e.length===0)return Gu.warn(`Invalid attribute key: ${e}`),this;if(!mJ(a))return Gu.warn(`Invalid attribute value set for key: ${e}`),this;const{attributeCountLimit:t}=this._spanLimits;return t!==void 0&&Object.keys(this.attributes).length>=t&&!Object.prototype.hasOwnProperty.call(this.attributes,e)?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(a),this)}setAttributes(e){for(const[a,t]of Object.entries(e))this.setAttribute(a,t);return this}addEvent(e,a,t){if(this._isSpanEnded())return this;const{eventCountLimit:r}=this._spanLimits;if(r===0)return Gu.warn("No events allowed."),this._droppedEventsCount++,this;r!==void 0&&this.events.length>=r&&(this._droppedEventsCount===0&&Gu.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),Aj(a)&&(Aj(t)||(t=a),a=void 0);const n=hx(a);return this.events.push({name:e,attributes:n,time:this._getTime(t),droppedAttributesCount:0}),this}addLink(e){return this.links.push(e),this}addLinks(e){return this.links.push(...e),this}setStatus(e){return this._isSpanEnded()?this:(this.status={...e},this.status.message!=null&&typeof e.message!="string"&&(Gu.warn(`Dropping invalid status.message of type '${typeof e.message}', expected 'string'`),delete this.status.message),this)}updateName(e){return this._isSpanEnded()?this:(this.name=e,this)}end(e){if(this._isSpanEnded()){Gu.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this._ended=!0,this.endTime=this._getTime(e),this._duration=t4u(this.startTime,this.endTime),this._duration[0]<0&&(Gu.warn("Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.",this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount>0&&Gu.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._spanProcessor.onEnd(this)}_getTime(e){if(typeof e=="number"&&e<=v1.now())return a4u(e+this._performanceOffset);if(typeof e=="number")return c1(e);if(e instanceof Date)return c1(e.getTime());if(fJ(e))return e;if(this._startTimeProvided)return c1(Date.now());const a=v1.now()-this._performanceStartTime;return gJ(this.startTime,c1(a))}isRecording(){return this._ended===!1}recordException(e,a){const t={};typeof e=="string"?t[ek]=e:e&&(e.code?t[uk]=e.code.toString():e.name&&(t[uk]=e.name),e.message&&(t[ek]=e.message),e.stack&&(t[Ucu]=e.stack)),t[uk]||t[ek]?this.addEvent(_4u,t,a):Gu.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){const e=new Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);Gu.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,e)}return this._ended}_truncateToLimitUtil(e,a){return e.length<=a?e:e.substring(0,a)}_truncateToSize(e){const a=this._attributeValueLengthLimit;return a<=0?(Gu.warn(`Attribute value limit must be positive, got ${a}`),e):typeof e=="string"?this._truncateToLimitUtil(e,a):Array.isArray(e)?e.map(t=>typeof t=="string"?this._truncateToLimitUtil(t,a):t):e}}var q1;(function(u){u[u.NOT_RECORD=0]="NOT_RECORD",u[u.RECORD=1]="RECORD",u[u.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(q1||(q1={}));class H5{shouldSample(){return{decision:q1.NOT_RECORD}}toString(){return"AlwaysOffSampler"}}class k1{shouldSample(){return{decision:q1.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}}class sh{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(e){this._root=e.root,this._root||(H1(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new k1),this._remoteParentSampled=e.remoteParentSampled??new k1,this._remoteParentNotSampled=e.remoteParentNotSampled??new H5,this._localParentSampled=e.localParentSampled??new k1,this._localParentNotSampled=e.localParentNotSampled??new H5}shouldSample(e,a,t,r,n,i){const o=Ot.getSpanContext(e);return!o||!eg(o)?this._root.shouldSample(e,a,t,r,n,i):o.isRemote?o.traceFlags&fi.SAMPLED?this._remoteParentSampled.shouldSample(e,a,t,r,n,i):this._remoteParentNotSampled.shouldSample(e,a,t,r,n,i):o.traceFlags&fi.SAMPLED?this._localParentSampled.shouldSample(e,a,t,r,n,i):this._localParentNotSampled.shouldSample(e,a,t,r,n,i)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}class jj{_ratio;_upperBound;constructor(e=0){this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,a){return{decision:cJ(a)&&this._accumulate(a)<this._upperBound?q1.RECORD_AND_SAMPLED:q1.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!="number"||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let a=0;for(let t=0;t<e.length/8;t++){const r=t*8,n=parseInt(e.slice(r,r+8),16);a=(a^n)>>>0}return a}}const Mj=1;function BJ(){return{sampler:SJ(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},spanLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128,linkCountLimit:128,eventCountLimit:128,attributePerEventCountLimit:128,attributePerLinkCountLimit:128}}}function SJ(){const u="parentbased_always_on";switch(u){case"always_on":return new k1;case"always_off":return new H5;case"parentbased_always_on":return new sh({root:new k1});case"parentbased_always_off":return new sh({root:new H5});case"traceidratio":return new jj(Tj());case"parentbased_traceidratio":return new sh({root:new jj(Tj())});default:return Gu.error(`OTEL_TRACES_SAMPLER value "${u}" invalid, defaulting to "parentbased_always_on".`),new sh({root:new k1})}}function Tj(){return Gu.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${Mj}.`),Mj}const I4u=128,K4u=1/0;function V4u(u){const e={sampler:SJ()},a=BJ(),t=Object.assign({},a,e,u);return t.generalLimits=Object.assign({},a.generalLimits,u.generalLimits||{}),t.spanLimits=Object.assign({},a.spanLimits,u.spanLimits||{}),t}function G4u(u){const e=Object.assign({},u.spanLimits);return e.attributeCountLimit=u.spanLimits?.attributeCountLimit??u.generalLimits?.attributeCountLimit??void 0??void 0??I4u,e.attributeValueLengthLimit=u.spanLimits?.attributeValueLengthLimit??u.generalLimits?.attributeValueLengthLimit??void 0??void 0??K4u,Object.assign({},u,{spanLimits:e})}class H4u{_exporter;_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_isExporting=!1;_finishedSpans=[];_timer;_shutdownOnce;_droppedSpansCount=0;constructor(e,a){this._exporter=e,this._maxExportBatchSize=typeof a?.maxExportBatchSize=="number"?a.maxExportBatchSize:512,this._maxQueueSize=typeof a?.maxQueueSize=="number"?a.maxQueueSize:2048,this._scheduledDelayMillis=typeof a?.scheduledDelayMillis=="number"?a.scheduledDelayMillis:5e3,this._exportTimeoutMillis=typeof a?.exportTimeoutMillis=="number"?a.exportTimeoutMillis:3e4,this._shutdownOnce=new $4u(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(Gu.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,a){}onEnd(e){this._shutdownOnce.isCalled||(e.spanContext().traceFlags&fi.SAMPLED)!==0&&this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(e){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&Gu.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(Gu.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,a)=>{const t=[],r=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let n=0,i=r;n<i;n++)t.push(this._flushOneBatch());Promise.all(t).then(()=>{e()}).catch(a)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((e,a)=>{const t=setTimeout(()=>{a(new Error("Timeout"))},this._exportTimeoutMillis);si.with(jcu(si.active()),()=>{let r;this._finishedSpans.length<=this._maxExportBatchSize?(r=this._finishedSpans,this._finishedSpans=[]):r=this._finishedSpans.splice(0,this._maxExportBatchSize);const n=()=>this._exporter.export(r,o=>{clearTimeout(t),o.code===Zr.SUCCESS?e():a(o.error??new Error("BatchSpanProcessor: span export failed"))});let i=null;for(let o=0,s=r.length;o<s;o++){const l=r[o];l.resource.asyncAttributesPending&&l.resource.waitForAsyncAttributes&&(i??=[],i.push(l.resource.waitForAsyncAttributes()))}i===null?n():Promise.all(i).then(n,o=>{H1(o),a(o)})})})}_maybeStartTimer(){if(this._isExporting)return;const e=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(a=>{this._isExporting=!1,H1(a)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();this._timer===void 0&&(this._timer=setTimeout(()=>e(),this._scheduledDelayMillis),this._timer,void 0)}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}}class q4u extends H4u{_visibilityChangeListener;_pageHideListener;constructor(e,a){super(e,a),this.onInit(a)}onInit(e){e?.disableAutoFlushOnDocumentHide!==!0&&typeof document<"u"&&(this._visibilityChangeListener=()=>{document.visibilityState==="hidden"&&this.forceFlush().catch(a=>{H1(a)})},this._pageHideListener=()=>{this.forceFlush().catch(a=>{H1(a)})},document.addEventListener("visibilitychange",this._visibilityChangeListener),document.addEventListener("pagehide",this._pageHideListener))}onShutdown(){typeof document<"u"&&(this._visibilityChangeListener&&document.removeEventListener("visibilitychange",this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener("pagehide",this._pageHideListener))}}const W4u=8,J4u=16;class U4u{generateTraceId=$j(J4u);generateSpanId=$j(W4u)}const lh=Array(32);function $j(u){return function(){for(let a=0;a<u*2;a++)lh[a]=Math.floor(Math.random()*16)+48,lh[a]>=58&&(lh[a]+=39);return String.fromCharCode.apply(null,lh.slice(0,u*2))}}class Z4u{_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;constructor(e,a,t,r){const n=V4u(a);this._sampler=n.sampler,this._generalLimits=n.generalLimits,this._spanLimits=n.spanLimits,this._idGenerator=a.idGenerator||new U4u,this._resource=t,this._spanProcessor=r,this.instrumentationScope=e}startSpan(e,a={},t=si.active()){a.root&&(t=Ot.deleteSpan(t));const r=Ot.getSpan(t);if(oA(t))return Gu.debug("Instrumentation suppressed, returning Noop Span"),Ot.wrapSpanContext(sJ);const n=r?.spanContext(),i=this._idGenerator.generateSpanId();let o,s,l;!n||!Ot.isSpanContextValid(n)?s=this._idGenerator.generateTraceId():(s=n.traceId,l=n.traceState,o=n);const c=a.kind??wy.INTERNAL,d=(a.links??[]).map(f=>({context:f.context,attributes:hx(f.attributes)})),E=hx(a.attributes),p=this._sampler.shouldSample(t,s,e,c,E,d);l=p.traceState??l;const x=p.decision===I5.RECORD_AND_SAMPLED?fi.SAMPLED:fi.NONE,m={traceId:s,spanId:i,traceFlags:x,traceState:l};if(p.decision===I5.NOT_RECORD)return Gu.debug("Recording is off, propagating context in a non-recording span"),Ot.wrapSpanContext(m);const g=hx(Object.assign(E,p.attributes));return new L4u({resource:this._resource,scope:this.instrumentationScope,context:t,spanContext:m,name:e,kind:c,links:d,parentSpanContext:o,attributes:g,startTime:a.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits})}startActiveSpan(e,a,t,r){let n,i,o;if(arguments.length<2)return;arguments.length===2?o=a:arguments.length===3?(n=a,o=t):(n=a,i=t,o=r);const s=i??si.active(),l=this.startSpan(e,n,s),c=Ot.setSpan(s,l);return si.with(c,o,void 0,l)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}}class Q4u{_spanProcessors;constructor(e){this._spanProcessors=e}forceFlush(){const e=[];for(const a of this._spanProcessors)e.push(a.forceFlush());return new Promise(a=>{Promise.all(e).then(()=>{a()}).catch(t=>{H1(t||new Error("MultiSpanProcessor: forceFlush failed")),a()})})}onStart(e,a){for(const t of this._spanProcessors)t.onStart(e,a)}onEnd(e){for(const a of this._spanProcessors)a.onEnd(e)}shutdown(){const e=[];for(const a of this._spanProcessors)e.push(a.shutdown());return new Promise((a,t)=>{Promise.all(e).then(()=>{a()},t)})}}var hs;(function(u){u[u.resolved=0]="resolved",u[u.timeout=1]="timeout",u[u.error=2]="error",u[u.unresolved=3]="unresolved"})(hs||(hs={}));class Y4u{_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(e={}){const a=j4u({},BJ(),G4u(e));this._resource=a.resource??N4u(),this._config=Object.assign({},a,{resource:this._resource});const t=[];e.spanProcessors?.length&&t.push(...e.spanProcessors),this._activeSpanProcessor=new Q4u(t)}getTracer(e,a,t){const r=`${e}@${a||""}:${t?.schemaUrl||""}`;return this._tracers.has(r)||this._tracers.set(r,new Z4u({name:e,version:a,schemaUrl:t?.schemaUrl},this._config,this._resource,this._activeSpanProcessor)),this._tracers.get(r)}forceFlush(){const e=this._config.forceFlushTimeoutMillis,a=this._activeSpanProcessor._spanProcessors.map(t=>new Promise(r=>{let n;const i=setTimeout(()=>{r(new Error(`Span processor did not completed within timeout period of ${e} ms`)),n=hs.timeout},e);t.forceFlush().then(()=>{clearTimeout(i),n!==hs.timeout&&(n=hs.resolved,r(n))}).catch(o=>{clearTimeout(i),n=hs.error,r(o)})}));return new Promise((t,r)=>{Promise.all(a).then(n=>{const i=n.filter(o=>o!==hs.resolved);i.length>0?r(i):t()}).catch(n=>r([n]))})}shutdown(){return this._activeSpanProcessor.shutdown()}}class X4u{_enabled=!1;_currentContext=u1;_bindFunction(e=u1,a){const t=this,r=function(...n){return t.with(e,()=>a.apply(this,n))};return Object.defineProperty(r,"length",{enumerable:!1,configurable:!0,writable:!1,value:a.length}),r}active(){return this._currentContext}bind(e,a){return e===void 0&&(e=this.active()),typeof a=="function"?this._bindFunction(e,a):a}disable(){return this._currentContext=u1,this._enabled=!1,this}enable(){return this._enabled?this:(this._enabled=!0,this._currentContext=u1,this)}with(e,a,t,...r){const n=this._currentContext;this._currentContext=e||u1;try{return a.call(t,...r)}finally{this._currentContext=n}}}function edu(u){if(u!==null){if(u===void 0){const e=new X4u;e.enable(),si.setGlobalContextManager(e);return}u.enable(),si.setGlobalContextManager(u)}}function udu(u){if(u!==null){if(u===void 0){cd.setGlobalPropagator(new n4u({propagators:[new k4u,new Icu]}));return}cd.setGlobalPropagator(u)}}class adu extends Y4u{constructor(e={}){super(e)}register(e={}){Ot.setGlobalTracerProvider(this),udu(e.propagator),edu(e.contextManager)}}class tdu{_delegate;constructor(e){this._delegate=e}export(e,a){this._delegate.export(e,a)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}}class Rj extends Error{code;name="OTLPExporterError";data;constructor(e,a,t){super(e),this.data=t,this.code=a}}function rdu(u){if(Number.isFinite(u)&&u>0)return u;throw new Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${u}')`)}function ndu(u){if(u!=null)return()=>u}function idu(u,e,a){return{timeoutMillis:rdu(u.timeoutMillis??e.timeoutMillis??a.timeoutMillis),concurrencyLimit:u.concurrencyLimit??e.concurrencyLimit??a.concurrencyLimit,compression:u.compression??e.compression??a.compression}}function odu(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:"none"}}class sdu{_concurrencyLimit;_sendingPromises=[];constructor(e){this._concurrencyLimit=e}pushPromise(e){if(this.hasReachedLimit())throw new Error("Concurrency Limit reached");this._sendingPromises.push(e);const a=()=>{const t=this._sendingPromises.indexOf(e);this._sendingPromises.splice(t,1)};e.then(a,a)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}async awaitAll(){await Promise.all(this._sendingPromises)}}function ldu(u){return new sdu(u.concurrencyLimit)}function cdu(u){return Object.prototype.hasOwnProperty.call(u,"partialSuccess")}function ddu(){return{handleResponse(u){u==null||!cdu(u)||u.partialSuccess==null||Object.keys(u.partialSuccess).length===0||Gu.warn("Received Partial Success response:",JSON.stringify(u.partialSuccess))}}}class Edu{_transport;_serializer;_responseHandler;_promiseQueue;_timeout;_diagLogger;constructor(e,a,t,r,n){this._transport=e,this._serializer=a,this._responseHandler=t,this._promiseQueue=r,this._timeout=n,this._diagLogger=Gu.createComponentLogger({namespace:"OTLPExportDelegate"})}export(e,a){if(this._diagLogger.debug("items to be sent",e),this._promiseQueue.hasReachedLimit()){a({code:Zr.FAILED,error:new Error("Concurrent export limit reached")});return}const t=this._serializer.serializeRequest(e);if(t==null){a({code:Zr.FAILED,error:new Error("Nothing to send")});return}this._promiseQueue.pushPromise(this._transport.send(t,this._timeout).then(r=>{if(r.status==="success"){if(r.data!=null)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(r.data))}catch(n){this._diagLogger.warn("Export succeeded but could not deserialize response - is the response specification compliant?",n,r.data)}a({code:Zr.SUCCESS});return}else if(r.status==="failure"&&r.error){a({code:Zr.FAILED,error:r.error});return}else r.status==="retryable"?a({code:Zr.FAILED,error:new Rj("Export failed with retryable status")}):a({code:Zr.FAILED,error:new Rj("Export failed with unknown error")})},r=>a({code:Zr.FAILED,error:r})))}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug("shutdown started"),await this.forceFlush(),this._transport.shutdown()}}function pdu(u,e){return new Edu(u.transport,u.serializer,ddu(),u.promiseHandler,e.timeout)}function zJ(u,e,a){return pdu({transport:a,serializer:e,promiseHandler:ldu(u)},{timeout:u.timeoutMillis})}function Nj(u){return u>=48&&u<=57?u-48:u>=97&&u<=102?u-87:u-55}function wJ(u){const e=new Uint8Array(u.length/2);let a=0;for(let t=0;t<u.length;t+=2){const r=Nj(u.charCodeAt(t)),n=Nj(u.charCodeAt(t+1));e[a++]=r<<4|n}return e}function OJ(u){const e=BigInt(1e9);return BigInt(u[0])*e+BigInt(u[1])}function mdu(u){const e=Number(BigInt.asUintN(32,u)),a=Number(BigInt.asUintN(32,u>>BigInt(32)));return{low:e,high:a}}function hdu(u){const e=OJ(u);return mdu(e)}function xdu(u){return OJ(u).toString()}const Ddu=typeof BigInt<"u"?xdu:r4u;function _j(u){return u}function fdu(u){if(u!==void 0)return wJ(u)}const gdu={encodeHrTime:hdu,encodeSpanContext:wJ,encodeOptionalSpanContext:fdu};function vdu(u){return u===void 0?gdu:{encodeHrTime:Ddu,encodeSpanContext:_j,encodeOptionalSpanContext:_j}}function kdu(u){return{attributes:ug(u.attributes),droppedAttributesCount:0}}function bdu(u){return{name:u.name,version:u.version}}function ug(u){return Object.keys(u).map(e=>PJ(e,u[e]))}function PJ(u,e){return{key:u,value:jJ(e)}}function jJ(u){const e=typeof u;return e==="string"?{stringValue:u}:e==="number"?Number.isInteger(u)?{intValue:u}:{doubleValue:u}:e==="boolean"?{boolValue:u}:u instanceof Uint8Array?{bytesValue:u}:Array.isArray(u)?{arrayValue:{values:u.map(jJ)}}:e==="object"&&u!=null?{kvlistValue:{values:Object.entries(u).map(([a,t])=>PJ(a,t))}}:{}}function ydu(u,e){const a=u.spanContext(),t=u.status,r=u.parentSpanContext?.spanId?e.encodeSpanContext(u.parentSpanContext?.spanId):void 0;return{traceId:e.encodeSpanContext(a.traceId),spanId:e.encodeSpanContext(a.spanId),parentSpanId:r,traceState:a.traceState?.serialize(),name:u.name,kind:u.kind==null?0:u.kind+1,startTimeUnixNano:e.encodeHrTime(u.startTime),endTimeUnixNano:e.encodeHrTime(u.endTime),attributes:ug(u.attributes),droppedAttributesCount:u.droppedAttributesCount,events:u.events.map(n=>Fdu(n,e)),droppedEventsCount:u.droppedEventsCount,status:{code:t.code,message:t.message},links:u.links.map(n=>Cdu(n,e)),droppedLinksCount:u.droppedLinksCount}}function Cdu(u,e){return{attributes:u.attributes?ug(u.attributes):[],spanId:e.encodeSpanContext(u.context.spanId),traceId:e.encodeSpanContext(u.context.traceId),traceState:u.context.traceState?.serialize(),droppedAttributesCount:u.droppedAttributesCount||0}}function Fdu(u,e){return{attributes:u.attributes?ug(u.attributes):[],name:u.name,timeUnixNano:e.encodeHrTime(u.time),droppedAttributesCount:u.droppedAttributesCount||0}}function Adu(u,e){const a=vdu(e);return{resourceSpans:Sdu(u,a)}}function Bdu(u){const e=new Map;for(const a of u){let t=e.get(a.resource);t||(t=new Map,e.set(a.resource,t));const r=`${a.instrumentationScope.name}@${a.instrumentationScope.version||""}:${a.instrumentationScope.schemaUrl||""}`;let n=t.get(r);n||(n=[],t.set(r,n)),n.push(a)}return e}function Sdu(u,e){const a=Bdu(u),t=[],r=a.entries();let n=r.next();for(;!n.done;){const[i,o]=n.value,s=[],l=o.values();let c=l.next();for(;!c.done;){const E=c.value;if(E.length>0){const p=E.map(x=>ydu(x,e));s.push({scope:bdu(E[0].instrumentationScope),spans:p,schemaUrl:E[0].instrumentationScope.schemaUrl})}c=l.next()}const d={resource:kdu(i),scopeSpans:s,schemaUrl:void 0};t.push(d),n=r.next()}return t}const zdu={serializeRequest:u=>{const e=Adu(u,{});return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:u=>{if(u.length===0)return{};const e=new TextDecoder;return JSON.parse(e.decode(u))}},wdu=5,Odu=1e3,Pdu=5e3,jdu=1.5,Lj=.2;function Mdu(){return Math.random()*(2*Lj)-Lj}class Tdu{_transport;constructor(e){this._transport=e}retry(e,a,t){return new Promise((r,n)=>{setTimeout(()=>{this._transport.send(e,a).then(r,n)},t)})}async send(e,a){const t=Date.now()+a;let r=await this._transport.send(e,a),n=wdu,i=Odu;for(;r.status==="retryable"&&n>0;){n--;const o=Math.max(Math.min(i,Pdu)+Mdu(),0);i=i*jdu;const s=r.retryInMillis??o,l=t-Date.now();if(s>l)return r;r=await this.retry(e,l,s)}return r}shutdown(){return this._transport.shutdown()}}function MJ(u){return new Tdu(u.transport)}function $du(u){return[429,502,503,504].includes(u)}function Rdu(u){if(u==null)return;const e=Number.parseInt(u,10);if(Number.isInteger(e))return e>0?e*1e3:-1;const a=new Date(u).getTime()-Date.now();return a>=0?a:0}class Ndu{_parameters;constructor(e){this._parameters=e}send(e,a){return new Promise(t=>{const r=new XMLHttpRequest;r.timeout=a,r.open("POST",this._parameters.url);const n=this._parameters.headers();Object.entries(n).forEach(([i,o])=>{r.setRequestHeader(i,o)}),r.ontimeout=i=>{t({status:"failure",error:new Error("XHR request timed out")})},r.onreadystatechange=()=>{r.status>=200&&r.status<=299?(Gu.debug("XHR success"),t({status:"success"})):r.status&&$du(r.status)?t({status:"retryable",retryInMillis:Rdu(r.getResponseHeader("Retry-After"))}):r.status!==0&&t({status:"failure",error:new Error("XHR request failed with non-retryable status")})},r.onabort=()=>{t({status:"failure",error:new Error("XHR request aborted")})},r.onerror=()=>{t({status:"failure",error:new Error("XHR request errored")})},r.send(e)})}shutdown(){}}function _du(u){return new Ndu(u)}class Ldu{_params;constructor(e){this._params=e}send(e){return new Promise(a=>{navigator.sendBeacon(this._params.url,new Blob([e],{type:this._params.blobType}))?(Gu.debug("SendBeacon success"),a({status:"success"})):a({status:"failure",error:new Error("SendBeacon failed")})})}shutdown(){}}function Idu(u){return new Ldu(u)}function Kdu(u,e){return zJ(u,e,MJ({transport:_du(u)}))}function Vdu(u,e){return zJ(u,e,MJ({transport:Idu({url:u.url,blobType:u.headers()["Content-Type"]})}))}function Gdu(u){return()=>{const e={};return Object.entries(u?.()??{}).forEach(([a,t])=>{typeof t<"u"?e[a]=String(t):Gu.warn(`Header "${a}" has invalid value (${t}) and will be ignored`)}),e}}function Hdu(u,e,a){const t={...a()},r={};return()=>(e!=null&&Object.assign(r,e()),u!=null&&Object.assign(r,u()),Object.assign(r,t))}function qdu(u){if(u!=null)try{return new URL(u),u}catch{throw new Error(`Configuration: Could not parse user-provided export URL: '${u}'`)}}function Wdu(u,e,a){return{...idu(u,e,a),headers:Hdu(Gdu(u.headers),e.headers,a.headers),url:qdu(u.url)??e.url??a.url,agentOptions:u.agentOptions??e.agentOptions??a.agentOptions}}function Jdu(u,e){return{...odu(),headers:()=>u,url:"http://localhost:4318/"+e,agentOptions:{keepAlive:!0}}}function Udu(u,e,a){return Wdu({url:u.url,timeoutMillis:u.timeoutMillis,headers:ndu(u.headers),concurrencyLimit:u.concurrencyLimit},{},Jdu(a,e))}function Zdu(u,e,a,t){const r=!!u.headers||typeof navigator.sendBeacon!="function",n=Udu(u,a,t);return r?Kdu(n,e):Vdu(n,e)}class Qdu extends tdu{constructor(e={}){super(Zdu(e,zdu,"v1/traces",{"Content-Type":"application/json"}))}}class TJ{emit(e){}}const Ydu=new TJ;class Xdu{getLogger(e,a,t){return new TJ}}const $J=new Xdu;class eEu{constructor(e,a,t,r){this._provider=e,this.name=a,this.version=t,this.options=r}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;const e=this._provider.getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):Ydu}}class Ij{getLogger(e,a,t){var r;return(r=this.getDelegateLogger(e,a,t))!==null&&r!==void 0?r:new eEu(this,e,a,t)}getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:$J}setDelegate(e){this._delegate=e}getDelegateLogger(e,a,t){var r;return(r=this._delegate)===null||r===void 0?void 0:r.getLogger(e,a,t)}}const uEu=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{},ch=Symbol.for("io.opentelemetry.js.api.logs"),v4=uEu;function aEu(u,e,a){return t=>t===u?e:a}const Kj=1;class lA{constructor(){this._proxyLoggerProvider=new Ij}static getInstance(){return this._instance||(this._instance=new lA),this._instance}setGlobalLoggerProvider(e){return v4[ch]?this.getLoggerProvider():(v4[ch]=aEu(Kj,e,$J),this._proxyLoggerProvider.setDelegate(e),e)}getLoggerProvider(){var e,a;return(a=(e=v4[ch])===null||e===void 0?void 0:e.call(v4,Kj))!==null&&a!==void 0?a:this._proxyLoggerProvider}getLogger(e,a,t){return this.getLoggerProvider().getLogger(e,a,t)}disable(){delete v4[ch],this._proxyLoggerProvider=new Ij}}const tEu=lA.getInstance();function rEu(u,e,a,t){for(let r=0,n=u.length;r<n;r++){const i=u[r];e&&i.setTracerProvider(e),a&&i.setMeterProvider(a),t&&i.setLoggerProvider&&i.setLoggerProvider(t),i.getConfig().enabled||i.enable()}}function nEu(u){u.forEach(e=>e.disable())}function iEu(u){const e=u.tracerProvider||Ot.getTracerProvider(),a=u.meterProvider||Fcu.getMeterProvider(),t=u.loggerProvider||tEu.getLoggerProvider(),r=u.instrumentations?.flat()??[];return rEu(r,e,a,t),()=>{nEu(r)}}class oEu{span=void 0;constructor(e){this.span=e}get context(){return this.span?.context}error(e){this.span&&(this.span.setStatus(Vd.ERROR,e.message),this.span.recordException(e),this.span.end())}setAttribute(e,a){this.span&&this.span.setAttribute(e,a)}end(){this.span&&(this.span.setStatus(Vd.OK),this.span.end())}}class sEu{config=null;tracer=null;tracerProvider=null;initialized=!1;initTracer(e){throw new Error("initTracer must be implemented by the environment-specific client")}init(e){this.config=e,this.initTracer(e)}send(e){try{if(!this.tracer||!this.config)return;const a=e.time?new Date(e.time):new Date;this.tracer.startSpan(`event.${e.type}`,{attributes:this.processAttributes(e,a),startTime:a}).end(a)}catch(a){this.config?.isProd||console.error("Event reporting failed:",a)}}processAttributes(e,a){const r={"cloudevents.event_id":L5(),"cloudevents.event_type":e.type,"cloudevents.event_source":e.source,"cloudevents.event_spec_version":e.specversion,"cloudevents.event_data_content_type":e.datacontenttype||"application/json; charset=utf-8","cloudevents.event_time":a.toISOString(),"cloudevents.event_subject":e.subject??"","cloudevents.page.uri":location.href,"cloudevents.event_version":this.config?.version,"cloudevents.event_origin":this.config?.serviceName,"cloudevents.event_source_details.id":e.sourceDetails?.id??"anonymous","cloudevents.event_source_details.object":e.sourceDetails?.object??"anonymous","cloudevents.event_source_details.uri":e.sourceDetails?.uri};if(e.data&&typeof e.data=="object"&&Object.entries(e.data).forEach(([n,i])=>{const o=n.replace(/([A-Z])/g,"_$1").toLowerCase();i!==void 0&&(r[`cloudevents.event_data.${o}`]=i)}),"subjects"in e&&Array.isArray(e.subjects)){const n=e.subjects.reduce((i,o)=>{if(!o||typeof o!="object")return i;const s=o.object;if(!s||typeof s!="string")return i;const l=i.notUpdated.find(({object:c})=>c===s);return l?(i.updated=[l,o],i.notUpdated=i.notUpdated.filter(({object:c})=>c!==s)):i.updated.some(({object:c})=>c===s)||i.notUpdated.push(o),i},{updated:[],notUpdated:[]});n.updated.forEach((i,o)=>{const s=o===0?"after.":"before.",l=`${i.object}.`;Object.entries(i).forEach(([c,d])=>{d!==void 0&&(r[`cloudevents.subjects.${s}${l}${c}`]=d)})}),n.notUpdated.forEach(i=>{const o=`${i.object}.`;Object.entries(i).forEach(([s,l])=>{l!==void 0&&(r[`cloudevents.subjects.${o}${s}`]=l)})})}return Object.entries(e).forEach(([n,i])=>{["id","source","type","specversion","time","datacontenttype","data","subject","sourceDetails","analyticsMetadata","context"].includes(n)||i!==void 0&&(i instanceof Object?Object.entries(i).forEach(([o,s])=>{s!==void 0&&(r[`cloudevents.${n}.${o}`]=s)}):r[`cloudevents.${n}`]=i)}),r}startSpan(e,a){try{if(!this.tracer)return;let t;const r=e.time?new Date(e.time):new Date,n=this.tracer.startSpan(`event.${e.type}`,{attributes:this.processAttributes(e,r),root:!a},a);return a||(t=Ot.setSpan(si.active(),n)),{end:()=>n.end(),setAttribute:(i,o)=>{n.setAttribute(`cloudevents.event_data.${this.getKeySnakeValue(i)}`,o)},setStatus:(i,o)=>n.setStatus({code:i,message:o}),parentCtx:t}}catch(t){this.config?.isProd||console.error("Event reporting failed:",t)}}startStepSpan(e){try{if(!this.tracer)return;const a=si.active(),t=e.time?new Date(e.time):new Date,r=this.tracer.startSpan(`event.${e.type}`,{attributes:this.processAttributes(e,t)},a),n=Ot.setSpan(a,r);return{end:()=>r.end(),setAttribute:(i,o)=>{r.setAttribute(`cloudevents.event_data.${this.getKeySnakeValue(i)}`,o)},setStatus:(i,o)=>r.setStatus({code:i,message:o}),recordException:i=>r.recordException(i),context:n}}catch(a){this.config?.isProd||console.error("Event reporting failed:",a)}}traceStep(e){const a=this.startStepSpan(e);if(a)return new oEu(a)}async forceFlush(){return this.tracerProvider?.forceFlush()}getKeySnakeValue=e=>e.replace(/([A-Z])/g,"_$1").toLowerCase()}class lEu extends sEu{tracerProvider=null;tracer=null;initialized=!1;constructor(){super()}initTracer(e){if(!e.collectorUrl&&!e.collectorTraceUrl)return;const a=`ses_${L5()}`,t=AJ({[xJ]:e.serviceName,[Zcu]:e.serviceVersion,session_id:a}),r=e.collectorTraceUrl||`${e.collectorUrl}/v1/traces`;this.tracerProvider=new adu({resource:t,spanProcessors:[new q4u(new Qdu({url:r,headers:{}}))]}),this.tracer=this.tracerProvider.getTracer(e.tracerName),this.tracerProvider.register(),iEu({instrumentations:e.instrumentations??[]}),this.initialized=!0}}class cEu{config=null;initialized=!1;useCloudEventData;otelClient;tracer;constructor(){this.useCloudEventData=()=>({organization:{id:"",slug:""},project:{id:"",slug:""},productType:"",sourceDetails:{user:"Anonymous",object:"user",uri:""},request:{source:""}}),this.otelClient=new lEu,this.tracer={traceStep:(e,a)=>{const t=this.constructCloudEvent(e,a);return this.otelClient.traceStep(t)}}}updateCloudEventData=e=>{this.config?.disabled||(this.useCloudEventData=e)};send(e,a){try{if(!this.config?.otel.isProd)return;const t=this.constructCloudEvent(e,a);this.sendToOtelService(t)}catch(t){this.config?.otel.isProd||console.error("Event reporting failed:",t)}}init(e){e.disabled||this.initialized||(this.config=e,this.initialized=!0,this.otelClient.init({serviceVersion:e.otel.serviceVersion,version:e.otel.version,isProd:e.otel.isProd,collectorUrl:e.otel.collectorUrl,collectorTraceUrl:e.otel.collectorTraceUrl,serviceName:e.otel.serviceName,tracerName:e.otel.tracerName,instrumentations:[...e.otel.instrumentations||[]]}))}startSpan(e,a,t){if(this.config?.disabled)return;const r=this.constructCloudEvent(e,a);return this.otelClient.startSpan(r,t)}constructCloudEvent(e,a){const t=this.useCloudEventData();return{id:`evt_${L5()}`,type:e,source:t.request.source||"",specversion:"1.0",datacontenttype:"application/json",time:new Date().toISOString(),data:a,origin:"ui",sourceDetails:{id:t.sourceDetails.user||`usr_${L5()}`,object:t.sourceDetails.object||"user",uri:t.sourceDetails.uri||""},organization:t.organization,project:t.project,productType:t.productType}}sendToOtelService(e){this.config?.otel.isProd||console.log("CloudEvent to be sent to OTEL service:",e),this.otelClient.send(e)}forceFlush(){return this.config?.disabled?Promise.resolve():this.otelClient.forceFlush()}sendTabChangeMessage(e){this.send("tab.change",e)}sendButtonClickMessage(e){this.send("button.click",e)}sendChangeMessage(e){this.send("change",e)}sendContentCopyMessage(e){this.send("content.copy",e)}sendUrlClickMessage(e){this.send("url.click",e)}sendRequestSendMessage(e){this.send("request.send",e)}sendTokenGenerateMessage(e){this.send("token.generate",e)}sendAppLifecycleMessage(e){this.send("app.lifecycle",e)}sendEnvironmentManagementMessage(e){this.send("environment.management",e)}sendServerManagementMessage(e){this.send("server.management",e)}sendInputManagementMessage(e){this.send("input.management",e)}sendNodeManagementMessage(e){this.send("node.management",e)}sendHistoryManagementMessage(e){this.send("history.management",e)}sendCredentialManagementMessage(e){this.send("credential.management",e)}sendPanelToggleMessage(e){this.send("panel.toggle",e)}sendWorkflowRunClickMessage(e){this.send("workflow.run.click",e)}sendWorkflowRunResultMessage(e){this.send("workflow.run.result",e)}}const dEu=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],RJ="https://cors.redocly.com/";function EEu(u,e,a){return e in u?Object.defineProperty(u,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):u[e]=a,u}function Vj(u,e){var a=Object.keys(u);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(u);e&&(t=t.filter(function(r){return Object.getOwnPropertyDescriptor(u,r).enumerable})),a.push.apply(a,t)}return a}function Gj(u){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Vj(Object(a),!0).forEach(function(t){EEu(u,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(a)):Vj(Object(a)).forEach(function(t){Object.defineProperty(u,t,Object.getOwnPropertyDescriptor(a,t))})}return u}function d0(u){return"Minified Redux error #"+u+"; visit https://redux.js.org/Errors?code="+u+" for the full message or use the non-minified dev environment for full errors. "}var Hj=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),ik=function(){return Math.random().toString(36).substring(7).split("").join(".")},Do={INIT:"@@redux/INIT"+ik(),REPLACE:"@@redux/REPLACE"+ik(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+ik()}};function NJ(u){if(typeof u!="object"||u===null)return!1;for(var e=u;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(u)===e}function pEu(u){if(u===void 0)return"undefined";if(u===null)return"null";var e=typeof u;switch(e){case"boolean":case"string":case"number":case"symbol":case"function":return e}if(Array.isArray(u))return"array";if(xEu(u))return"date";if(hEu(u))return"error";var a=mEu(u);switch(a){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return a}return e.slice(8,-1).toLowerCase().replace(/\s/g,"")}function mEu(u){return typeof u.constructor=="function"?u.constructor.name:null}function hEu(u){return u instanceof Error||typeof u.message=="string"&&u.constructor&&typeof u.constructor.stackTraceLimit=="number"}function xEu(u){return u instanceof Date?!0:typeof u.toDateString=="function"&&typeof u.getDate=="function"&&typeof u.setDate=="function"}function Xi(u){var e=typeof u;return process.env.NODE_ENV!=="production"&&(e=pEu(u)),e}function ag(u,e,a){var t;if(typeof e=="function"&&typeof a=="function"||typeof a=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?d0(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof e=="function"&&typeof a>"u"&&(a=e,e=void 0),typeof a<"u"){if(typeof a!="function")throw new Error(process.env.NODE_ENV==="production"?d0(1):"Expected the enhancer to be a function. Instead, received: '"+Xi(a)+"'");return a(ag)(u,e)}if(typeof u!="function")throw new Error(process.env.NODE_ENV==="production"?d0(2):"Expected the root reducer to be a function. Instead, received: '"+Xi(u)+"'");var r=u,n=e,i=[],o=i,s=!1;function l(){o===i&&(o=i.slice())}function c(){if(s)throw new Error(process.env.NODE_ENV==="production"?d0(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return n}function d(m){if(typeof m!="function")throw new Error(process.env.NODE_ENV==="production"?d0(4):"Expected the listener to be a function. Instead, received: '"+Xi(m)+"'");if(s)throw new Error(process.env.NODE_ENV==="production"?d0(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");var g=!0;return l(),o.push(m),function(){if(g){if(s)throw new Error(process.env.NODE_ENV==="production"?d0(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");g=!1,l();var f=o.indexOf(m);o.splice(f,1),i=null}}}function E(m){if(!NJ(m))throw new Error(process.env.NODE_ENV==="production"?d0(7):"Actions must be plain objects. Instead, the actual type was: '"+Xi(m)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof m.type>"u")throw new Error(process.env.NODE_ENV==="production"?d0(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(s)throw new Error(process.env.NODE_ENV==="production"?d0(9):"Reducers may not dispatch actions.");try{s=!0,n=r(n,m)}finally{s=!1}for(var g=i=o,h=0;h<g.length;h++){var f=g[h];f()}return m}function p(m){if(typeof m!="function")throw new Error(process.env.NODE_ENV==="production"?d0(10):"Expected the nextReducer to be a function. Instead, received: '"+Xi(m));r=m,E({type:Do.REPLACE})}function x(){var m,g=d;return m={subscribe:function(f){if(typeof f!="object"||f===null)throw new Error(process.env.NODE_ENV==="production"?d0(11):"Expected the observer to be an object. Instead, received: '"+Xi(f)+"'");function k(){f.next&&f.next(c())}k();var y=g(k);return{unsubscribe:y}}},m[Hj]=function(){return this},m}return E({type:Do.INIT}),t={dispatch:E,subscribe:d,getState:c,replaceReducer:p},t[Hj]=x,t}var DEu=ag;function Ry(u){typeof console<"u"&&typeof console.error=="function"&&console.error(u);try{throw new Error(u)}catch{}}function fEu(u,e,a,t){var r=Object.keys(e),n=a&&a.type===Do.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(r.length===0)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!NJ(u))return"The "+n+' has unexpected type of "'+Xi(u)+'". Expected argument to be an object with the following '+('keys: "'+r.join('", "')+'"');var i=Object.keys(u).filter(function(o){return!e.hasOwnProperty(o)&&!t[o]});if(i.forEach(function(o){t[o]=!0}),!(a&&a.type===Do.REPLACE)&&i.length>0)return"Unexpected "+(i.length>1?"keys":"key")+" "+('"'+i.join('", "')+'" found in '+n+". ")+"Expected to find one of the known reducer keys instead: "+('"'+r.join('", "')+'". Unexpected keys will be ignored.')}function gEu(u){Object.keys(u).forEach(function(e){var a=u[e],t=a(void 0,{type:Do.INIT});if(typeof t>"u")throw new Error(process.env.NODE_ENV==="production"?d0(12):'The slice reducer for key "'+e+`" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);if(typeof a(void 0,{type:Do.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?d0(13):'The slice reducer for key "'+e+'" returned undefined when probed with a random type. '+("Don't try to handle '"+Do.INIT+`' or other actions in "redux/*" `)+"namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.")})}function vEu(u){for(var e=Object.keys(u),a={},t=0;t<e.length;t++){var r=e[t];process.env.NODE_ENV!=="production"&&typeof u[r]>"u"&&Ry('No reducer provided for key "'+r+'"'),typeof u[r]=="function"&&(a[r]=u[r])}var n=Object.keys(a),i;process.env.NODE_ENV!=="production"&&(i={});var o;try{gEu(a)}catch(s){o=s}return function(l,c){if(l===void 0&&(l={}),o)throw o;if(process.env.NODE_ENV!=="production"){var d=fEu(l,a,c,i);d&&Ry(d)}for(var E=!1,p={},x=0;x<n.length;x++){var m=n[x],g=a[m],h=l[m],f=g(h,c);if(typeof f>"u"){var k=c&&c.type;throw new Error(process.env.NODE_ENV==="production"?d0(14):"When called with an action of type "+(k?'"'+String(k)+'"':"(unknown type)")+', the slice reducer for key "'+m+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.')}p[m]=f,E=E||f!==h}return E=E||n.length!==Object.keys(l).length,E?p:l}}function qj(u,e){return function(){return e(u.apply(this,arguments))}}function kEu(u,e){if(typeof u=="function")return qj(u,e);if(typeof u!="object"||u===null)throw new Error(process.env.NODE_ENV==="production"?d0(16):"bindActionCreators expected an object or a function, but instead received: '"+Xi(u)+`'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?`);var a={};for(var t in u){var r=u[t];typeof r=="function"&&(a[t]=qj(r,e))}return a}function _J(){for(var u=arguments.length,e=new Array(u),a=0;a<u;a++)e[a]=arguments[a];return e.length===0?function(t){return t}:e.length===1?e[0]:e.reduce(function(t,r){return function(){return t(r.apply(void 0,arguments))}})}function bEu(){for(var u=arguments.length,e=new Array(u),a=0;a<u;a++)e[a]=arguments[a];return function(t){return function(){var r=t.apply(void 0,arguments),n=function(){throw new Error(process.env.NODE_ENV==="production"?d0(15):"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},i={getState:r.getState,dispatch:function(){return n.apply(void 0,arguments)}},o=e.map(function(s){return s(i)});return n=_J.apply(void 0,o)(r.dispatch),Gj(Gj({},r),{},{dispatch:n})}}}function Wj(){}process.env.NODE_ENV!=="production"&&typeof Wj.name=="string"&&Wj.name!=="isCrushed"&&Ry('You are currently using minified code outside of NODE_ENV === "production". This means that you are running a slower development build of Redux. You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify or setting mode to production in webpack (https://webpack.js.org/concepts/mode/) to ensure you have the correct code for your production build.');var yEu=Object.freeze({__proto__:null,__DO_NOT_USE__ActionTypes:Do,applyMiddleware:bEu,bindActionCreators:kEu,combineReducers:vEu,compose:_J,createStore:ag,legacy_createStore:DEu});function CEu(u){var e=u.default;if(typeof e=="function"){var a=function(){return e.apply(this,arguments)};a.prototype=e.prototype}else a={};return Object.defineProperty(a,"__esModule",{value:!0}),Object.keys(u).forEach(function(t){var r=Object.getOwnPropertyDescriptor(u,t);Object.defineProperty(a,t,r.get?r:{enumerable:!0,get:function(){return u[t]}})}),a}var FEu=CEu(yEu);FEu.compose;var AEu=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(u){return u}};function BEu(u,e,a){var t=!1,r=!1,n=ag(function(o,s){if(!r){var l=function(g){return Array.isArray(g)&&g.findIndex(function(h){return typeof h!="string"&&typeof h!="number"})===-1};if(s.type.startsWith("SET")){var c=function(g){try{t=!0,"value"in s?g.set(s.value):g.set(lu)}finally{t=!1}};if(s.path){if(l(s.path)){s.path.length===0&&c(u);for(var d=u,E=!0,p=0,x=s.path;p<x.length;p++){var m=x[p];d[m]?d=d[m]:E=!1}E&&c(d)}}else c(u)}else s.type==="BREAKPOINT"&&a()}return u.promised||u.error?lu:u.get({noproxy:!0})},AEu({name:"".concat(window.location.hostname,": ").concat(e),trace:!0,traceLimit:16,autoPause:!0,shouldHotReload:!1,features:{persist:!0,pause:!0,lock:!1,export:"custom",import:"custom",jump:!1,skip:!1,reorder:!1,dispatch:!0,test:!1}})),i=function(o,s){if(t)s&&s();else try{r=!0,n.dispatch(o)}finally{r=!1}};return i}function SEu(u){return function(){var e,a,t=!1;return{onInit:function(r,n){if(!(typeof window>"u"||!("__REDUX_DEVTOOLS_EXTENSION__"in window))){if(u?.key===void 0){if(n.identifier===void 0)throw Error("State is missing Identifiable extension or Devtools key option");e=n.identifier(r)}else e=u.key;a=BEu(r,e,function(){t=!t}),r.promise||a?.({type:"CREATE",state:r.get({noproxy:!0,stealth:!0})})}},onSet:function(r,n){if(a?.({type:"SET [".concat(r.path.join("/"),"]"),state:r.get({noproxy:!0,stealth:!0}),descriptor:n}),t)debugger},onDestroy:function(){a?.({type:"DESTROY"})}}}}var Nu=(u=>(u.Normal="Normal",u.Edit="Edit",u.Draft="Draft",u))(Nu||{});const ME="default",LJ=[{name:ME,inputs:[],servers:[],state:Nu.Normal}],IJ={activeTabIdx:0,tabs:[]};var Jr=(u=>(u.Idle="idle",u.Loading="loading",u.Success="success",u.Error="error",u))(Jr||{});function li(u){const e=new WeakMap;function a(t){if(typeof t!="object"||t===null)return t;if(e.has(t))return e.get(t);const r=Array.isArray(t)?[]:{};e.set(t,r);for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=a(t[n]));return r}return a(u)}function Jj(u){return Object.keys(u).forEach(e=>{u[e]===void 0&&delete u[e]}),u}const pn={FS:"fs",WEB:"web"},mn=window.__TAURI__?.http.fetch??globalThis.fetch;function kc(){return!!window?.__TAURI__}function Dx(u){return/(?:^[a-z][a-z0-9+.-]*:|\/\/)/i.test(u)}function q5(u){return u.endsWith("/")?u.substring(0,u.length-1):u}function zEu(u){return u.startsWith("/")?u.substring(1):u}function wEu(u){try{const e=new URL(u);return e.search="",e.hash="",e.toString()}catch{return u}}function KJ(u){return/^https?:\/\//i.test(u)}function OEu(u,e){let a;if(e.startsWith("//")){const{protocol:t}=new URL(u);a=`${t||"https:"}${e}`}else if(Dx(e))a=e;else if(!e.startsWith("/"))a=q5(u)+"/"+e;else{const t=new URL(u);t.pathname=e,a=t.toString()}return q5(a)}function W5(u,e){let a=u;return e.forEach(({key:t,value:r,active:n})=>{r&&n&&(a=a.replaceAll(`{${t}}`,r))}),a}function cA(u,e){let a=u;return e.forEach(({name:t,value:r})=>{r&&(a=a.replaceAll(`{${t}}`,r))}),a}function PEu(u){return u.startsWith("http://")||u.startsWith("https://")}function dh({url:u,serverUrl:e,corsProxyUrl:a}){const t=PEu(u)||!e?u:`${q5(e)}/${zEu(u)}`;return a?`${a}${t}`:t}class Uj{constructor(e){this.baseDir=e}async ls(e=""){const a=this.makeKey(e);return Object.keys(localStorage).filter(t=>t.startsWith(a)).map(t=>t.replace(a,""))}async get(e){const a=this.makeKey(e);return localStorage.getItem(a)??null}async set(e,a){const t=this.makeKey(e);localStorage.setItem(t,a)}async remove(e){const a=this.makeKey(e);localStorage.removeItem(a)}makeKey(e){return`replay:fs:${this.baseDir}/${e}`}}class jEu{baseDir="";async ls(e=""){return[]}async get(e){return null}async set(e,a){}async remove(e){}}async function ut(u,e={},a){return window.__TAURI_INTERNALS__.invoke(u,e,a)}var J5;(function(u){u[u.Audio=1]="Audio",u[u.Cache=2]="Cache",u[u.Config=3]="Config",u[u.Data=4]="Data",u[u.LocalData=5]="LocalData",u[u.Document=6]="Document",u[u.Download=7]="Download",u[u.Picture=8]="Picture",u[u.Public=9]="Public",u[u.Video=10]="Video",u[u.Resource=11]="Resource",u[u.Temp=12]="Temp",u[u.AppConfig=13]="AppConfig",u[u.AppData=14]="AppData",u[u.AppLocalData=15]="AppLocalData",u[u.AppCache=16]="AppCache",u[u.AppLog=17]="AppLog",u[u.Desktop=18]="Desktop",u[u.Executable=19]="Executable",u[u.Font=20]="Font",u[u.Home=21]="Home",u[u.Runtime=22]="Runtime",u[u.Template=23]="Template"})(J5||(J5={}));async function MEu(){return ut("plugin:path|resolve_directory",{directory:J5.AppData})}async function TEu(){return ut("plugin:path|resolve_directory",{directory:J5.Desktop})}function VJ(){return window.__TAURI_INTERNALS__.plugins.path.sep}async function $Eu(...u){return ut("plugin:path|resolve",{paths:u})}async function dd(...u){return ut("plugin:path|join",{paths:u})}async function REu(u){return ut("plugin:path|extname",{path:u})}async function GJ(u,e){return ut("plugin:path|basename",{path:u,ext:e})}async function NEu(u){return ut("plugin:path|is_absolute",{path:u})}var Zj;(function(u){u[u.Start=0]="Start",u[u.Current=1]="Current",u[u.End=2]="End"})(Zj||(Zj={}));async function Qj(u,e){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");await ut("plugin:fs|mkdir",{path:u instanceof URL?u.toString():u,options:e})}async function HJ(u,e){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");return await ut("plugin:fs|read_dir",{path:u instanceof URL?u.toString():u,options:e})}async function _Eu(u,e){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");const a=await ut("plugin:fs|read_file",{path:u instanceof URL?u.toString():u,options:e});return a instanceof ArrayBuffer?new Uint8Array(a):Uint8Array.from(a)}async function dA(u,e){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");return await ut("plugin:fs|read_text_file",{path:u instanceof URL?u.toString():u,options:e})}async function LEu(u,e){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");await ut("plugin:fs|remove",{path:u instanceof URL?u.toString():u,options:e})}async function IEu(u,e,a){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");await ut("plugin:fs|write_text_file",{path:u instanceof URL?u.toString():u,data:e,options:a})}async function qJ(u,e){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");return await ut("plugin:fs|exists",{path:u instanceof URL?u.toString():u,options:e})}class za{static utils=null;static async getUtils(){return za.utils||(za.utils=kc()?await Promise.resolve().then(()=>require("./replay-tauri-path-Du3fO9cI.js")):await Promise.resolve().then(()=>ene)),za.utils}static async join(...e){return(await za.getUtils()).join(...e)}static async resolve(e){return(await za.getUtils()).resolve(e)}static async isAbsolute(e){return(await za.getUtils()).isAbsolute(e)}static async relative(e,a){return(await za.getUtils()).relative(e,a)}static async extname(e){return(await za.getUtils()).extname(e)}}const KEu=new Set(["node_modules"]);class Yj{constructor(e){this.baseDir=e,this.initializeDirectory(e)}async initializeDirectory(e){await Qj(e,{recursive:!0})}async ls(e){const a=await this.getFullPath(e);return this.getDirEntryFilesRecursively(a)}async getDirEntryFilesRecursively(e){try{const a=[],t=await HJ(e);for(const r of t)if(r.isDirectory){if(KEu.has(r.name))continue;const n=await dd(e,r.name),i=await this.getDirEntryFilesRecursively(n);a.push(...i)}else{const n=await dd(e,r.name),i=await za.relative(this.baseDir,n);a.push(i)}return a}catch(a){return a.includes("forbidden path")||console.error(a),[]}}async get(e){const a=await this.getFullPath(e);try{return await dA(a)}catch(t){return!t.includes("No such file or directory")&&!t.includes("forbidden path")&&console.error(t),null}}async set(e,a){const t=await this.getFullPath(e),r=VJ(),n=t.split(r).slice(0,-1).join(r);await Qj(n,{recursive:!0}),await IEu(t,a)}async remove(e){const a=await this.getFullPath(e);try{await LEu(a)}catch(t){!t.includes("No such file or directory")&&!t.includes("forbidden path")&&console.error(t)}}async getFullPath(e){return await dd(this.baseDir,e??"")}}class VEu{constructor(e){this.projectId=e}async get(){const e=this.getKey();return localStorage.getItem(e)??null}async set(e){const a=this.getKey();localStorage.setItem(a,e)}async remove(){const e=this.getKey();localStorage.removeItem(e)}getKey(){return`replay:secrets:${this.projectId}`}}class WJ{constructor(e){this.storage=e}itemIds=[];async parseMany(e,a){const r=(await Promise.all(e.map(async n=>{try{return await this.parse(n,a)}catch(i){return console.error(`Error parsing from ${n.type} ${n.uri}:`,i),null}}))).filter(n=>n!==null);return this.itemIds=r.map(n=>n.id),r}async write(e){e.state===Nu.Draft||e.srcType!==pn.FS||await this.storage.set(e.id,await this.stringify(e))}async remove(e){await this.storage.remove(e)}async updateRoot(e,a){const t=e.actions;if(t){for(const n in t){const i=parseInt(n);switch(t[n]){case"D":await this.remove(this.itemIds[i]);break;case"I":case"U":await this.write(a[i]);break}}return}const r=this.itemIds.filter(n=>!a.some(i=>i.id===n));await Promise.all([...a.map(n=>this.write(n)),...r.map(n=>this.remove(n))])}async update(e,a){const r={path:e.path.slice(1),actions:e.actions};if(r.path.length===0&&await this.updateRoot(r,a),r.path.length>0){const n=r.path[0];r.path.length===1&&r.actions&&r.actions.id==="U"&&await this.remove(this.itemIds[n]),r.path[1]&&r.path[1]==="id"&&await this.remove(this.itemIds[n]),await this.write(a[n])}this.itemIds=a.map(n=>n.id)}}class GEu extends WJ{parse(e){return{...e.content,id:e.uri,srcType:e.type}}async stringify(e){const{id:a,srcType:t,...r}=e;return await za.extname(a)===".json"?JSON.stringify(r,null,2):xi.dump(r)}}var w0=(u=>(u.SIMPLE="simple",u.REGEX="regex",u.JSONPATH="jsonpath",u.XPATH="xpath",u))(w0||{});const JJ=1024;let HEu=0,Ut=class{constructor(e,a){this.from=e,this.to=a}};class vu{constructor(e={}){this.id=HEu++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Z0.match(e)),a=>{let t=e(a);return t===void 0?null:[this,t]}}}vu.closedBy=new vu({deserialize:u=>u.split(" ")});vu.openedBy=new vu({deserialize:u=>u.split(" ")});vu.group=new vu({deserialize:u=>u.split(" ")});vu.isolate=new vu({deserialize:u=>{if(u&&u!="rtl"&&u!="ltr"&&u!="auto")throw new RangeError("Invalid value for isolate: "+u);return u||"auto"}});vu.contextHash=new vu({perNode:!0});vu.lookAhead=new vu({perNode:!0});vu.mounted=new vu({perNode:!0});class Gd{constructor(e,a,t){this.tree=e,this.overlay=a,this.parser=t}static get(e){return e&&e.props&&e.props[vu.mounted.id]}}const qEu=Object.create(null);class Z0{constructor(e,a,t,r=0){this.name=e,this.props=a,this.id=t,this.flags=r}static define(e){let a=e.props&&e.props.length?Object.create(null):qEu,t=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new Z0(e.name||"",a,e.id,t);if(e.props){for(let n of e.props)if(Array.isArray(n)||(n=n(r)),n){if(n[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");a[n[0].id]=n[1]}}return r}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let a=this.prop(vu.group);return a?a.indexOf(e)>-1:!1}return this.id==e}static match(e){let a=Object.create(null);for(let t in e)for(let r of t.split(" "))a[r]=e[t];return t=>{for(let r=t.prop(vu.group),n=-1;n<(r?r.length:0);n++){let i=a[n<0?t.name:r[n]];if(i)return i}}}}Z0.none=new Z0("",Object.create(null),0,8);class EA{constructor(e){this.types=e;for(let a=0;a<e.length;a++)if(e[a].id!=a)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let a=[];for(let t of this.types){let r=null;for(let n of e){let i=n(t);i&&(r||(r=Object.assign({},t.props)),r[i[0].id]=i[1])}a.push(r?new Z0(t.name,r,t.id,t.flags):t)}return new EA(a)}}const Eh=new WeakMap,Xj=new WeakMap;var Ea;(function(u){u[u.ExcludeBuffers=1]="ExcludeBuffers",u[u.IncludeAnonymous=2]="IncludeAnonymous",u[u.IgnoreMounts=4]="IgnoreMounts",u[u.IgnoreOverlays=8]="IgnoreOverlays"})(Ea||(Ea={}));let Va=class Ny{constructor(e,a,t,r,n){if(this.type=e,this.children=a,this.positions=t,this.length=r,this.props=null,n&&n.length){this.props=Object.create(null);for(let[i,o]of n)this.props[typeof i=="number"?i:i.id]=o}}toString(){let e=Gd.get(this);if(e&&!e.overlay)return e.tree.toString();let a="";for(let t of this.children){let r=t.toString();r&&(a&&(a+=","),a+=r)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(a.length?"("+a+")":""):a}cursor(e=0){return new U5(this.topNode,e)}cursorAt(e,a=0,t=0){let r=Eh.get(this)||this.topNode,n=new U5(r);return n.moveTo(e,a),Eh.set(this,n._tree),n}get topNode(){return new ur(this,0,0,null)}resolve(e,a=0){let t=Hd(Eh.get(this)||this.topNode,e,a,!1);return Eh.set(this,t),t}resolveInner(e,a=0){let t=Hd(Xj.get(this)||this.topNode,e,a,!0);return Xj.set(this,t),t}resolveStack(e,a=0){return UEu(this,e,a)}iterate(e){let{enter:a,leave:t,from:r=0,to:n=this.length}=e,i=e.mode||0,o=(i&Ea.IncludeAnonymous)>0;for(let s=this.cursor(i|Ea.IncludeAnonymous);;){let l=!1;if(s.from<=n&&s.to>=r&&(!o&&s.type.isAnonymous||a(s)!==!1)){if(s.firstChild())continue;l=!0}for(;l&&t&&(o||!s.type.isAnonymous)&&t(s),!s.nextSibling();){if(!s.parent())return;l=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let a in this.props)e.push([+a,this.props[a]]);return e}balance(e={}){return this.children.length<=8?this:hA(Z0.none,this.children,this.positions,0,this.children.length,0,this.length,(a,t,r)=>new Ny(this.type,a,t,r,this.propValues),e.makeTree||((a,t,r)=>new Ny(Z0.none,a,t,r)))}static build(e){return ZEu(e)}};Va.empty=new Va(Z0.none,[],[],0);class pA{constructor(e,a){this.buffer=e,this.index=a}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new pA(this.buffer,this.index)}}class yo{constructor(e,a,t){this.buffer=e,this.length=a,this.set=t}get type(){return Z0.none}toString(){let e=[];for(let a=0;a<this.buffer.length;)e.push(this.childString(a)),a=this.buffer[a+3];return e.join(",")}childString(e){let a=this.buffer[e],t=this.buffer[e+3],r=this.set.types[a],n=r.name;if(/\W/.test(n)&&!r.isError&&(n=JSON.stringify(n)),e+=4,t==e)return n;let i=[];for(;e<t;)i.push(this.childString(e)),e=this.buffer[e+3];return n+"("+i.join(",")+")"}findChild(e,a,t,r,n){let{buffer:i}=this,o=-1;for(let s=e;s!=a&&!(UJ(n,r,i[s+1],i[s+2])&&(o=s,t>0));s=i[s+3]);return o}slice(e,a,t){let r=this.buffer,n=new Uint16Array(a-e),i=0;for(let o=e,s=0;o<a;){n[s++]=r[o++],n[s++]=r[o++]-t;let l=n[s++]=r[o++]-t;n[s++]=r[o++]-e,i=Math.max(i,l)}return new yo(n,i,this.set)}}function UJ(u,e,a,t){switch(u){case-2:return a<e;case-1:return t>=e&&a<e;case 0:return a<e&&t>e;case 1:return a<=e&&t>e;case 2:return t>e;case 4:return!0}}function Hd(u,e,a,t){for(var r;u.from==u.to||(a<1?u.from>=e:u.from>e)||(a>-1?u.to<=e:u.to<e);){let i=!t&&u instanceof ur&&u.index<0?null:u.parent;if(!i)return u;u=i}let n=t?0:Ea.IgnoreOverlays;if(t)for(let i=u,o=i.parent;o;i=o,o=i.parent)i instanceof ur&&i.index<0&&((r=o.enter(e,a,n))===null||r===void 0?void 0:r.from)!=i.from&&(u=o);for(;;){let i=u.enter(e,a,n);if(!i)return u;u=i}}class ZJ{cursor(e=0){return new U5(this,e)}getChild(e,a=null,t=null){let r=eM(this,e,a,t);return r.length?r[0]:null}getChildren(e,a=null,t=null){return eM(this,e,a,t)}resolve(e,a=0){return Hd(this,e,a,!1)}resolveInner(e,a=0){return Hd(this,e,a,!0)}matchContext(e){return _y(this.parent,e)}enterUnfinishedNodesBefore(e){let a=this.childBefore(e),t=this;for(;a;){let r=a.lastChild;if(!r||r.to!=a.to)break;r.type.isError&&r.from==r.to?(t=a,a=r.prevSibling):a=r}return t}get node(){return this}get next(){return this.parent}}let ur=class fx extends ZJ{constructor(e,a,t,r){super(),this._tree=e,this.from=a,this.index=t,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,a,t,r,n=0){for(let i=this;;){for(let{children:o,positions:s}=i._tree,l=a>0?o.length:-1;e!=l;e+=a){let c=o[e],d=s[e]+i.from;if(UJ(r,t,d,d+c.length)){if(c instanceof yo){if(n&Ea.ExcludeBuffers)continue;let E=c.findChild(0,c.buffer.length,a,t-d,r);if(E>-1)return new rn(new WEu(i,c,e,d),null,E)}else if(n&Ea.IncludeAnonymous||!c.type.isAnonymous||mA(c)){let E;if(!(n&Ea.IgnoreMounts)&&(E=Gd.get(c))&&!E.overlay)return new fx(E.tree,d,e,i);let p=new fx(c,d,e,i);return n&Ea.IncludeAnonymous||!p.type.isAnonymous?p:p.nextChild(a<0?c.children.length-1:0,a,t,r)}}}if(n&Ea.IncludeAnonymous||!i.type.isAnonymous||(i.index>=0?e=i.index+a:e=a<0?-1:i._parent._tree.children.length,i=i._parent,!i))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,a,t=0){let r;if(!(t&Ea.IgnoreOverlays)&&(r=Gd.get(this._tree))&&r.overlay){let n=e-this.from;for(let{from:i,to:o}of r.overlay)if((a>0?i<=n:i<n)&&(a<0?o>=n:o>n))return new fx(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,a,t)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}};function eM(u,e,a,t){let r=u.cursor(),n=[];if(!r.firstChild())return n;if(a!=null){for(let i=!1;!i;)if(i=r.type.is(a),!r.nextSibling())return n}for(;;){if(t!=null&&r.type.is(t))return n;if(r.type.is(e)&&n.push(r.node),!r.nextSibling())return t==null?n:[]}}function _y(u,e,a=e.length-1){for(let t=u;a>=0;t=t.parent){if(!t)return!1;if(!t.type.isAnonymous){if(e[a]&&e[a]!=t.name)return!1;a--}}return!0}class WEu{constructor(e,a,t,r){this.parent=e,this.buffer=a,this.index=t,this.start=r}}class rn extends ZJ{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,a,t){super(),this.context=e,this._parent=a,this.index=t,this.type=e.buffer.set.types[e.buffer.buffer[t]]}child(e,a,t){let{buffer:r}=this.context,n=r.findChild(this.index+4,r.buffer[this.index+3],e,a-this.context.start,t);return n<0?null:new rn(this.context,this,n)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,a,t=0){if(t&Ea.ExcludeBuffers)return null;let{buffer:r}=this.context,n=r.findChild(this.index+4,r.buffer[this.index+3],a>0?1:-1,e-this.context.start,a);return n<0?null:new rn(this.context,this,n)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,a=e.buffer[this.index+3];return a<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new rn(this.context,this._parent,a):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,a=this._parent?this._parent.index+4:0;return this.index==a?this.externalSibling(-1):new rn(this.context,this._parent,e.findChild(a,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],a=[],{buffer:t}=this.context,r=this.index+4,n=t.buffer[this.index+3];if(n>r){let i=t.buffer[this.index+1];e.push(t.slice(r,n,i)),a.push(0)}return new Va(this.type,e,a,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function QJ(u){if(!u.length)return null;let e=0,a=u[0];for(let n=1;n<u.length;n++){let i=u[n];(i.from>a.from||i.to<a.to)&&(a=i,e=n)}let t=a instanceof ur&&a.index<0?null:a.parent,r=u.slice();return t?r[e]=t:r.splice(e,1),new JEu(r,a)}class JEu{constructor(e,a){this.heads=e,this.node=a}get next(){return QJ(this.heads)}}function UEu(u,e,a){let t=u.resolveInner(e,a),r=null;for(let n=t instanceof ur?t:t.context.parent;n;n=n.parent)if(n.index<0){let i=n.parent;(r||(r=[t])).push(i.resolve(e,a)),n=i}else{let i=Gd.get(n.tree);if(i&&i.overlay&&i.overlay[0].from<=e&&i.overlay[i.overlay.length-1].to>=e){let o=new ur(i.tree,i.overlay[0].from+n.from,-1,n);(r||(r=[t])).push(Hd(o,e,a,!1))}}return r?QJ(r):t}class U5{get name(){return this.type.name}constructor(e,a=0){if(this.mode=a,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof ur)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let t=e._parent;t;t=t._parent)this.stack.unshift(t.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,a){this.index=e;let{start:t,buffer:r}=this.buffer;return this.type=a||r.set.types[r.buffer[e]],this.from=t+r.buffer[e+1],this.to=t+r.buffer[e+2],!0}yield(e){return e?e instanceof ur?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,a,t){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,a,t,this.mode));let{buffer:r}=this.buffer,n=r.findChild(this.index+4,r.buffer[this.index+3],e,a-this.buffer.start,t);return n<0?!1:(this.stack.push(this.index),this.yieldBuf(n))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,a,t=this.mode){return this.buffer?t&Ea.ExcludeBuffers?!1:this.enterChild(1,e,a):this.yield(this._tree.enter(e,a,t))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Ea.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Ea.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:a}=this.buffer,t=this.stack.length-1;if(e<0){let r=t<0?0:this.stack[t]+4;if(this.index!=r)return this.yieldBuf(a.findChild(r,this.index,-1,0,4))}else{let r=a.buffer[this.index+3];if(r<(t<0?a.buffer.length:a.buffer[this.stack[t]+3]))return this.yieldBuf(r)}return t<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let a,t,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let n=0;n<this.index;n++)if(r.buffer.buffer[n+3]<this.index)return!1;({index:a,parent:t}=r)}else({index:a,_parent:t}=this._tree);for(;t;{index:a,_parent:t}=t)if(a>-1)for(let n=a+e,i=e<0?-1:t._tree.children.length;n!=i;n+=e){let o=t._tree.children[n];if(this.mode&Ea.IncludeAnonymous||o instanceof yo||!o.type.isAnonymous||mA(o))return!1}return!0}move(e,a){if(a&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,a=0){for(;(this.from==this.to||(a<1?this.from>=e:this.from>e)||(a>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,a););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,a=null,t=0;if(e&&e.context==this.buffer)e:for(let r=this.index,n=this.stack.length;n>=0;){for(let i=e;i;i=i._parent)if(i.index==r){if(r==this.index)return i;a=i,t=n+1;break e}r=this.stack[--n]}for(let r=t;r<this.stack.length;r++)a=new rn(this.buffer,a,this.stack[r]);return this.bufferNode=new rn(this.buffer,a,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,a){for(let t=0;;){let r=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){t++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&a&&a(this),r=this.type.isAnonymous,!t)return;if(this.nextSibling())break;this.parent(),t--,r=!0}}}matchContext(e){if(!this.buffer)return _y(this.node.parent,e);let{buffer:a}=this.buffer,{types:t}=a.set;for(let r=e.length-1,n=this.stack.length-1;r>=0;n--){if(n<0)return _y(this._tree,e,r);let i=t[a.buffer[this.stack[n]]];if(!i.isAnonymous){if(e[r]&&e[r]!=i.name)return!1;r--}}return!0}}function mA(u){return u.children.some(e=>e instanceof yo||!e.type.isAnonymous||mA(e))}function ZEu(u){var e;let{buffer:a,nodeSet:t,maxBufferLength:r=JJ,reused:n=[],minRepeatType:i=t.types.length}=u,o=Array.isArray(a)?new pA(a,a.length):a,s=t.types,l=0,c=0;function d(v,b,C,B,z,P){let{id:L,start:I,end:G,size:X}=o,U=c,ae=l;for(;X<0;)if(o.next(),X==-1){let T=n[L];C.push(T),B.push(I-v);return}else if(X==-3){l=L;return}else if(X==-4){c=L;return}else throw new RangeError(`Unrecognized record size: ${X}`);let Ee=s[L],re,he,j=I-v;if(G-I<=r&&(he=g(o.pos-b,z))){let T=new Uint16Array(he.size-he.skip),V=o.pos-he.size,O=T.length;for(;o.pos>V;)O=h(he.start,T,O);re=new yo(T,G-he.start,t),j=he.start-v}else{let T=o.pos-X;o.next();let V=[],O=[],F=L>=i?L:-1,S=0,$=G;for(;o.pos>T;)F>=0&&o.id==F&&o.size>=0?(o.end<=$-r&&(x(V,O,I,S,o.end,$,F,U,ae),S=V.length,$=o.end),o.next()):P>2500?E(I,T,V,O):d(I,T,V,O,F,P+1);if(F>=0&&S>0&&S<V.length&&x(V,O,I,S,I,$,F,U,ae),V.reverse(),O.reverse(),F>-1&&S>0){let q=p(Ee,ae);re=hA(Ee,V,O,0,V.length,0,G-I,q,q)}else re=m(Ee,V,O,G-I,U-G,ae)}C.push(re),B.push(j)}function E(v,b,C,B){let z=[],P=0,L=-1;for(;o.pos>b;){let{id:I,start:G,end:X,size:U}=o;if(U>4)o.next();else{if(L>-1&&G<L)break;L<0&&(L=X-r),z.push(I,G,X),P++,o.next()}}if(P){let I=new Uint16Array(P*4),G=z[z.length-2];for(let X=z.length-3,U=0;X>=0;X-=3)I[U++]=z[X],I[U++]=z[X+1]-G,I[U++]=z[X+2]-G,I[U++]=U;C.push(new yo(I,z[2]-G,t)),B.push(G-v)}}function p(v,b){return(C,B,z)=>{let P=0,L=C.length-1,I,G;if(L>=0&&(I=C[L])instanceof Va){if(!L&&I.type==v&&I.length==z)return I;(G=I.prop(vu.lookAhead))&&(P=B[L]+I.length+G)}return m(v,C,B,z,P,b)}}function x(v,b,C,B,z,P,L,I,G){let X=[],U=[];for(;v.length>B;)X.push(v.pop()),U.push(b.pop()+C-z);v.push(m(t.types[L],X,U,P-z,I-P,G)),b.push(z-C)}function m(v,b,C,B,z,P,L){if(P){let I=[vu.contextHash,P];L=L?[I].concat(L):[I]}if(z>25){let I=[vu.lookAhead,z];L=L?[I].concat(L):[I]}return new Va(v,b,C,B,L)}function g(v,b){let C=o.fork(),B=0,z=0,P=0,L=C.end-r,I={size:0,start:0,skip:0};e:for(let G=C.pos-v;C.pos>G;){let X=C.size;if(C.id==b&&X>=0){I.size=B,I.start=z,I.skip=P,P+=4,B+=4,C.next();continue}let U=C.pos-X;if(X<0||U<G||C.start<L)break;let ae=C.id>=i?4:0,Ee=C.start;for(C.next();C.pos>U;){if(C.size<0)if(C.size==-3)ae+=4;else break e;else C.id>=i&&(ae+=4);C.next()}z=Ee,B+=X,P+=ae}return(b<0||B==v)&&(I.size=B,I.start=z,I.skip=P),I.size>4?I:void 0}function h(v,b,C){let{id:B,start:z,end:P,size:L}=o;if(o.next(),L>=0&&B<i){let I=C;if(L>4){let G=o.pos-(L-4);for(;o.pos>G;)C=h(v,b,C)}b[--C]=I,b[--C]=P-v,b[--C]=z-v,b[--C]=B}else L==-3?l=B:L==-4&&(c=B);return C}let f=[],k=[];for(;o.pos>0;)d(u.start||0,u.bufferStart||0,f,k,-1,0);let y=(e=u.length)!==null&&e!==void 0?e:f.length?k[0]+f[0].length:0;return new Va(s[u.topID],f.reverse(),k.reverse(),y)}const uM=new WeakMap;function gx(u,e){if(!u.isAnonymous||e instanceof yo||e.type!=u)return 1;let a=uM.get(e);if(a==null){a=1;for(let t of e.children){if(t.type!=u||!(t instanceof Va)){a=1;break}a+=gx(u,t)}uM.set(e,a)}return a}function hA(u,e,a,t,r,n,i,o,s){let l=0;for(let x=t;x<r;x++)l+=gx(u,e[x]);let c=Math.ceil(l*1.5/8),d=[],E=[];function p(x,m,g,h,f){for(let k=g;k<h;){let y=k,v=m[k],b=gx(u,x[k]);for(k++;k<h;k++){let C=gx(u,x[k]);if(b+C>=c)break;b+=C}if(k==y+1){if(b>c){let C=x[y];p(C.children,C.positions,0,C.children.length,m[y]+f);continue}d.push(x[y])}else{let C=m[k-1]+x[k-1].length-v;d.push(hA(u,x,m,y,k,v,C,null,s))}E.push(v+f-n)}}return p(e,a,t,r,0),(o||s)(d,E,i)}class YJ{constructor(){this.map=new WeakMap}setBuffer(e,a,t){let r=this.map.get(e);r||this.map.set(e,r=new Map),r.set(a,t)}getBuffer(e,a){let t=this.map.get(e);return t&&t.get(a)}set(e,a){e instanceof rn?this.setBuffer(e.context.buffer,e.index,a):e instanceof ur&&this.map.set(e.tree,a)}get(e){return e instanceof rn?this.getBuffer(e.context.buffer,e.index):e instanceof ur?this.map.get(e.tree):void 0}cursorSet(e,a){e.buffer?this.setBuffer(e.buffer.buffer,e.index,a):this.map.set(e.tree,a)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class ci{constructor(e,a,t,r,n=!1,i=!1){this.from=e,this.to=a,this.tree=t,this.offset=r,this.open=(n?1:0)|(i?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,a=[],t=!1){let r=[new ci(0,e.length,e,0,!1,t)];for(let n of a)n.to>e.length&&r.push(n);return r}static applyChanges(e,a,t=128){if(!a.length)return e;let r=[],n=1,i=e.length?e[0]:null;for(let o=0,s=0,l=0;;o++){let c=o<a.length?a[o]:null,d=c?c.fromA:1e9;if(d-s>=t)for(;i&&i.from<d;){let E=i;if(s>=E.from||d<=E.to||l){let p=Math.max(E.from,s)-l,x=Math.min(E.to,d)-l;E=p>=x?null:new ci(p,x,E.tree,E.offset+l,o>0,!!c)}if(E&&r.push(E),i.to>d)break;i=n<e.length?e[n++]:null}if(!c)break;s=c.toA,l=c.toA-c.toB}return r}}let XJ=class{startParse(e,a,t){return typeof e=="string"&&(e=new QEu(e)),t=t?t.length?t.map(r=>new Ut(r.from,r.to)):[new Ut(0,0)]:[new Ut(0,e.length)],this.createParse(e,a||[],t)}parse(e,a,t){let r=this.startParse(e,a,t);for(;;){let n=r.advance();if(n)return n}}};class QEu{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,a){return this.string.slice(e,a)}}function YEu(u){return(e,a,t,r)=>new e3u(e,u,a,t,r)}class aM{constructor(e,a,t,r,n){this.parser=e,this.parse=a,this.overlay=t,this.target=r,this.from=n}}function tM(u){if(!u.length||u.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(u))}class XEu{constructor(e,a,t,r,n,i,o){this.parser=e,this.predicate=a,this.mounts=t,this.index=r,this.start=n,this.target=i,this.prev=o,this.depth=0,this.ranges=[]}}const Ly=new vu({perNode:!0});class e3u{constructor(e,a,t,r,n){this.nest=a,this.input=t,this.fragments=r,this.ranges=n,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let t=this.baseParse.advance();if(!t)return null;if(this.baseParse=null,this.baseTree=t,this.startInner(),this.stoppedAt!=null)for(let r of this.inner)r.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let t=this.baseTree;return this.stoppedAt!=null&&(t=new Va(t.type,t.children,t.positions,t.length,t.propValues.concat([[Ly,this.stoppedAt]]))),t}let e=this.inner[this.innerDone],a=e.parse.advance();if(a){this.innerDone++;let t=Object.assign(Object.create(null),e.target.props);t[vu.mounted.id]=new Gd(a,e.overlay,e.parser),e.target.props=t}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let a=this.innerDone;a<this.inner.length;a++)this.inner[a].from<e&&(e=Math.min(e,this.inner[a].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let a=this.innerDone;a<this.inner.length;a++)this.inner[a].parse.stopAt(e)}startInner(){let e=new t3u(this.fragments),a=null,t=null,r=new U5(new ur(this.baseTree,this.ranges[0].from,0,null),Ea.IncludeAnonymous|Ea.IgnoreMounts);e:for(let n,i;;){let o=!0,s;if(this.stoppedAt!=null&&r.from>=this.stoppedAt)o=!1;else if(e.hasNode(r)){if(a){let l=a.mounts.find(c=>c.frag.from<=r.from&&c.frag.to>=r.to&&c.mount.overlay);if(l)for(let c of l.mount.overlay){let d=c.from+l.pos,E=c.to+l.pos;d>=r.from&&E<=r.to&&!a.ranges.some(p=>p.from<E&&p.to>d)&&a.ranges.push({from:d,to:E})}}o=!1}else if(t&&(i=u3u(t.ranges,r.from,r.to)))o=i!=2;else if(!r.type.isAnonymous&&(n=this.nest(r,this.input))&&(r.from<r.to||!n.overlay)){r.tree||a3u(r);let l=e.findMounts(r.from,n.parser);if(typeof n.overlay=="function")a=new XEu(n.parser,n.overlay,l,this.inner.length,r.from,r.tree,a);else{let c=iM(this.ranges,n.overlay||(r.from<r.to?[new Ut(r.from,r.to)]:[]));c.length&&tM(c),(c.length||!n.overlay)&&this.inner.push(new aM(n.parser,c.length?n.parser.startParse(this.input,oM(l,c),c):n.parser.startParse(""),n.overlay?n.overlay.map(d=>new Ut(d.from-r.from,d.to-r.from)):null,r.tree,c.length?c[0].from:r.from)),n.overlay?c.length&&(t={ranges:c,depth:0,prev:t}):o=!1}}else if(a&&(s=a.predicate(r))&&(s===!0&&(s=new Ut(r.from,r.to)),s.from<s.to)){let l=a.ranges.length-1;l>=0&&a.ranges[l].to==s.from?a.ranges[l]={from:a.ranges[l].from,to:s.to}:a.ranges.push(s)}if(o&&r.firstChild())a&&a.depth++,t&&t.depth++;else for(;!r.nextSibling();){if(!r.parent())break e;if(a&&!--a.depth){let l=iM(this.ranges,a.ranges);l.length&&(tM(l),this.inner.splice(a.index,0,new aM(a.parser,a.parser.startParse(this.input,oM(a.mounts,l),l),a.ranges.map(c=>new Ut(c.from-a.start,c.to-a.start)),a.target,l[0].from))),a=a.prev}t&&!--t.depth&&(t=t.prev)}}}}function u3u(u,e,a){for(let t of u){if(t.from>=a)break;if(t.to>e)return t.from<=e&&t.to>=a?2:1}return 0}function rM(u,e,a,t,r,n){if(e<a){let i=u.buffer[e+1];t.push(u.slice(e,a,i)),r.push(i-n)}}function a3u(u){let{node:e}=u,a=[],t=e.context.buffer;do a.push(u.index),u.parent();while(!u.tree);let r=u.tree,n=r.children.indexOf(t),i=r.children[n],o=i.buffer,s=[n];function l(c,d,E,p,x,m){let g=a[m],h=[],f=[];rM(i,c,g,h,f,p);let k=o[g+1],y=o[g+2];s.push(h.length);let v=m?l(g+4,o[g+3],i.set.types[o[g]],k,y-k,m-1):e.toTree();return h.push(v),f.push(k-p),rM(i,o[g+3],d,h,f,p),new Va(E,h,f,x)}r.children[n]=l(0,o.length,Z0.none,0,i.length,a.length-1);for(let c of s){let d=u.tree.children[c],E=u.tree.positions[c];u.yield(new ur(d,E+u.from,c,u._tree))}}class nM{constructor(e,a){this.offset=a,this.done=!1,this.cursor=e.cursor(Ea.IncludeAnonymous|Ea.IgnoreMounts)}moveTo(e){let{cursor:a}=this,t=e-this.offset;for(;!this.done&&a.from<t;)a.to>=e&&a.enter(t,1,Ea.IgnoreOverlays|Ea.ExcludeBuffers)||a.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let a=this.cursor.tree;;){if(a==e.tree)return!0;if(a.children.length&&a.positions[0]==0&&a.children[0]instanceof Va)a=a.children[0];else break}return!1}}let t3u=class{constructor(e){var a;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let t=this.curFrag=e[0];this.curTo=(a=t.tree.prop(Ly))!==null&&a!==void 0?a:t.to,this.inner=new nM(t.tree,-t.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let a=this.curFrag=this.fragments[this.fragI];this.curTo=(e=a.tree.prop(Ly))!==null&&e!==void 0?e:a.to,this.inner=new nM(a.tree,-a.offset)}}findMounts(e,a){var t;let r=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let n=this.inner.cursor.node;n;n=n.parent){let i=(t=n.tree)===null||t===void 0?void 0:t.prop(vu.mounted);if(i&&i.parser==a)for(let o=this.fragI;o<this.fragments.length;o++){let s=this.fragments[o];if(s.from>=n.to)break;s.tree==this.curFrag.tree&&r.push({frag:s,pos:n.from-s.offset,mount:i})}}}return r}};function iM(u,e){let a=null,t=e;for(let r=1,n=0;r<u.length;r++){let i=u[r-1].to,o=u[r].from;for(;n<t.length;n++){let s=t[n];if(s.from>=o)break;s.to<=i||(a||(t=a=e.slice()),s.from<i?(a[n]=new Ut(s.from,i),s.to>o&&a.splice(n+1,0,new Ut(o,s.to))):s.to>o?a[n--]=new Ut(o,s.to):a.splice(n--,1))}}return t}function r3u(u,e,a,t){let r=0,n=0,i=!1,o=!1,s=-1e9,l=[];for(;;){let c=r==u.length?1e9:i?u[r].to:u[r].from,d=n==e.length?1e9:o?e[n].to:e[n].from;if(i!=o){let E=Math.max(s,a),p=Math.min(c,d,t);E<p&&l.push(new Ut(E,p))}if(s=Math.min(c,d),s==1e9)break;c==s&&(i?(i=!1,r++):i=!0),d==s&&(o?(o=!1,n++):o=!0)}return l}function oM(u,e){let a=[];for(let{pos:t,mount:r,frag:n}of u){let i=t+(r.overlay?r.overlay[0].from:0),o=i+r.tree.length,s=Math.max(n.from,i),l=Math.min(n.to,o);if(r.overlay){let c=r.overlay.map(E=>new Ut(E.from+t,E.to+t)),d=r3u(e,c,s,l);for(let E=0,p=s;;E++){let x=E==d.length,m=x?l:d[E].from;if(m>p&&a.push(new ci(p,m,r.tree,-i,n.from>=p||n.openStart,n.to<=m||n.openEnd)),x)break;p=d[E].to}}else a.push(new ci(s,l,r.tree,-i,n.from>=i||n.openStart,n.to<=o||n.openEnd))}return a}class Z5{constructor(e,a,t,r,n,i,o,s,l,c=0,d){this.p=e,this.stack=a,this.state=t,this.reducePos=r,this.pos=n,this.score=i,this.buffer=o,this.bufferBase=s,this.curContext=l,this.lookAhead=c,this.parent=d}toString(){return`[${this.stack.filter((e,a)=>a%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,a,t=0){let r=e.parser.context;return new Z5(e,[],a,t,t,0,[],0,r?new sM(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,a){this.stack.push(this.state,a,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var a;let t=e>>19,r=e&65535,{parser:n}=this.p,i=this.reducePos<this.pos-25;i&&this.setLookAhead(this.pos);let o=n.dynamicPrecedence(r);if(o&&(this.score+=o),t==0){this.pushState(n.getGoto(this.state,r,!0),this.reducePos),r<n.minRepeatTerm&&this.storeNode(r,this.reducePos,this.reducePos,i?8:4,!0),this.reduceContext(r,this.reducePos);return}let s=this.stack.length-(t-1)*3-(e&262144?6:0),l=s?this.stack[s-2]:this.p.ranges[0].from,c=this.reducePos-l;c>=2e3&&!(!((a=this.p.parser.nodeSet.types[r])===null||a===void 0)&&a.isAnonymous)&&(l==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSize<c&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=l,this.p.lastBigReductionSize=c));let d=s?this.stack[s-1]:0,E=this.bufferBase+this.buffer.length-d;if(r<n.minRepeatTerm||e&131072){let p=n.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(r,l,p,E+4,!0)}if(e&262144)this.state=this.stack[s];else{let p=this.stack[s-3];this.state=n.getGoto(p,r,!0)}for(;this.stack.length>s;)this.stack.pop();this.reduceContext(r,l)}storeNode(e,a,t,r=4,n=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let i=this,o=this.buffer.length;if(o==0&&i.parent&&(o=i.bufferBase-i.parent.bufferBase,i=i.parent),o>0&&i.buffer[o-4]==0&&i.buffer[o-1]>-1){if(a==t)return;if(i.buffer[o-2]>=a){i.buffer[o-2]=t;return}}}if(!n||this.pos==t)this.buffer.push(e,a,t,r);else{let i=this.buffer.length;if(i>0&&this.buffer[i-4]!=0){let o=!1;for(let s=i;s>0&&this.buffer[s-2]>t;s-=4)if(this.buffer[s-1]>=0){o=!0;break}if(o)for(;i>0&&this.buffer[i-2]>t;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4)}this.buffer[i]=e,this.buffer[i+1]=a,this.buffer[i+2]=t,this.buffer[i+3]=r}}shift(e,a,t,r){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let n=e,{parser:i}=this.p;(r>this.pos||a<=i.maxNode)&&(this.pos=r,i.stateFlag(n,1)||(this.reducePos=r)),this.pushState(n,t),this.shiftContext(a,t),a<=i.maxNode&&this.buffer.push(a,t,r,4)}else this.pos=r,this.shiftContext(a,t),a<=this.p.parser.maxNode&&this.buffer.push(a,t,r,4)}apply(e,a,t,r){e&65536?this.reduce(e):this.shift(e,a,t,r)}useNode(e,a){let t=this.p.reused.length-1;(t<0||this.p.reused[t]!=e)&&(this.p.reused.push(e),t++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(a,r),this.buffer.push(t,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,a=e.buffer.length;for(;a>0&&e.buffer[a-2]>e.reducePos;)a-=4;let t=e.buffer.slice(a),r=e.bufferBase+a;for(;e&&r==e.bufferBase;)e=e.parent;return new Z5(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,t,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,a){let t=e<=this.p.parser.maxNode;t&&this.storeNode(e,this.pos,a,4),this.storeNode(0,this.pos,a,t?8:4),this.pos=this.reducePos=a,this.score-=190}canShift(e){for(let a=new n3u(this);;){let t=this.p.parser.stateSlot(a.state,4)||this.p.parser.hasAction(a.state,e);if(t==0)return!1;if((t&65536)==0)return!0;a.reduce(t)}}recoverByInsert(e){if(this.stack.length>=300)return[];let a=this.p.parser.nextStates(this.state);if(a.length>8||this.stack.length>=120){let r=[];for(let n=0,i;n<a.length;n+=2)(i=a[n+1])!=this.state&&this.p.parser.hasAction(i,e)&&r.push(a[n],i);if(this.stack.length<120)for(let n=0;r.length<8&&n<a.length;n+=2){let i=a[n+1];r.some((o,s)=>s&1&&o==i)||r.push(a[n],i)}a=r}let t=[];for(let r=0;r<a.length&&t.length<4;r+=2){let n=a[r+1];if(n==this.state)continue;let i=this.split();i.pushState(n,this.pos),i.storeNode(0,i.pos,i.pos,4,!0),i.shiftContext(a[r],this.pos),i.reducePos=this.pos,i.score-=200,t.push(i)}return t}forceReduce(){let{parser:e}=this.p,a=e.stateSlot(this.state,5);if((a&65536)==0)return!1;if(!e.validAction(this.state,a)){let t=a>>19,r=a&65535,n=this.stack.length-t*3;if(n<0||e.getGoto(this.stack[n],r,!1)<0){let i=this.findForcedReduction();if(i==null)return!1;a=i}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(a),!0}findForcedReduction(){let{parser:e}=this.p,a=[],t=(r,n)=>{if(!a.includes(r))return a.push(r),e.allActions(r,i=>{if(!(i&393216))if(i&65536){let o=(i>>19)-n;if(o>1){let s=i&65535,l=this.stack.length-o*3;if(l>=0&&e.getGoto(this.stack[l],s,!1)>=0)return o<<19|65536|s}}else{let o=t(i,n+1);if(o!=null)return o}})};return t(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let a=0;a<this.stack.length;a+=3)if(this.stack[a]!=e.stack[a])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,a){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(a)))}reduceContext(e,a){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(a)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let a=new sM(this.curContext.tracker,e);a.hash!=this.curContext.hash&&this.emitContext(),this.curContext=a}}setLookAhead(e){e>this.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class sM{constructor(e,a){this.tracker=e,this.context=a,this.hash=e.strict?e.hash(a):0}}class n3u{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let a=e&65535,t=e>>19;t==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(t-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],a,!0);this.state=r}}class Q5{constructor(e,a,t){this.stack=e,this.pos=a,this.index=t,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,a=e.bufferBase+e.buffer.length){return new Q5(e,a,a-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new Q5(this.stack,this.pos,this.index)}}function H4(u,e=Uint16Array){if(typeof u!="string")return u;let a=null;for(let t=0,r=0;t<u.length;){let n=0;for(;;){let i=u.charCodeAt(t++),o=!1;if(i==126){n=65535;break}i>=92&&i--,i>=34&&i--;let s=i-32;if(s>=46&&(s-=46,o=!0),n+=s,o)break;n*=46}a?a[r++]=n:a=new e(n)}return a}class vx{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const lM=new vx;class i3u{constructor(e,a){this.input=e,this.ranges=a,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=lM,this.rangeIndex=0,this.pos=this.chunkPos=a[0].from,this.range=a[0],this.end=a[a.length-1].to,this.readNext()}resolveOffset(e,a){let t=this.range,r=this.rangeIndex,n=this.pos+e;for(;n<t.from;){if(!r)return null;let i=this.ranges[--r];n-=t.from-i.to,t=i}for(;a<0?n>t.to:n>=t.to;){if(r==this.ranges.length-1)return null;let i=this.ranges[++r];n+=i.from-t.to,t=i}return n}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let a of this.ranges)if(a.to>e)return Math.max(e,a.from);return this.end}peek(e){let a=this.chunkOff+e,t,r;if(a>=0&&a<this.chunk.length)t=this.pos+e,r=this.chunk.charCodeAt(a);else{let n=this.resolveOffset(e,1);if(n==null)return-1;if(t=n,t>=this.chunk2Pos&&t<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(t-this.chunk2Pos);else{let i=this.rangeIndex,o=this.range;for(;o.to<=t;)o=this.ranges[++i];this.chunk2=this.input.chunk(this.chunk2Pos=t),t+this.chunk2.length>o.to&&(this.chunk2=this.chunk2.slice(0,o.to-t)),r=this.chunk2.charCodeAt(0)}}return t>=this.token.lookAhead&&(this.token.lookAhead=t+1),r}acceptToken(e,a=0){let t=a?this.resolveOffset(a,-1):this.pos;if(t==null||t<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=t}acceptTokenTo(e,a){this.token.value=e,this.token.end=a}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:a}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=a,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),a=this.pos+e.length;this.chunk=a>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,a){if(a?(this.token=a,a.start=e,a.lookAhead=e+1,a.value=a.extended=-1):this.token=lM,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,a){if(e>=this.chunkPos&&a<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,a-this.chunkPos);if(e>=this.chunk2Pos&&a<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,a-this.chunk2Pos);if(e>=this.range.from&&a<=this.range.to)return this.input.read(e,a);let t="";for(let r of this.ranges){if(r.from>=a)break;r.to>e&&(t+=this.input.read(Math.max(r.from,e),Math.min(r.to,a)))}return t}}class b1{constructor(e,a){this.data=e,this.id=a}token(e,a){let{parser:t}=a.p;eU(this.data,e,a,this.id,t.data,t.tokenPrecTable)}}b1.prototype.contextual=b1.prototype.fallback=b1.prototype.extend=!1;class Y5{constructor(e,a,t){this.precTable=a,this.elseToken=t,this.data=typeof e=="string"?H4(e):e}token(e,a){let t=e.pos,r=0;for(;;){let n=e.next<0,i=e.resolveOffset(1,1);if(eU(this.data,e,a,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(n||r++,i==null)break;e.reset(i,e.token)}r&&(e.reset(t,e.token),e.acceptToken(this.elseToken,r))}}Y5.prototype.contextual=b1.prototype.fallback=b1.prototype.extend=!1;class v0{constructor(e,a={}){this.token=e,this.contextual=!!a.contextual,this.fallback=!!a.fallback,this.extend=!!a.extend}}function eU(u,e,a,t,r,n){let i=0,o=1<<t,{dialect:s}=a.p.parser;e:for(;(o&u[i])!=0;){let l=u[i+1];for(let p=i+3;p<l;p+=2)if((u[p+1]&o)>0){let x=u[p];if(s.allows(x)&&(e.token.value==-1||e.token.value==x||o3u(x,e.token.value,r,n))){e.acceptToken(x);break}}let c=e.next,d=0,E=u[i+2];if(e.next<0&&E>d&&u[l+E*3-3]==65535){i=u[l+E*3-1];continue e}for(;d<E;){let p=d+E>>1,x=l+p+(p<<1),m=u[x],g=u[x+1]||65536;if(c<m)E=p;else if(c>=g)d=p+1;else{i=u[x+2],e.advance();continue e}}break}}function cM(u,e,a){for(let t=e,r;(r=u[t])!=65535;t++)if(r==a)return t-e;return-1}function o3u(u,e,a,t){let r=cM(a,t,e);return r<0||cM(a,t,u)<r}const gt=typeof process<"u"&&process.env&&/\bparse\b/.test(process.env.LOG);let ok=null;function dM(u,e,a){let t=u.cursor(Ea.IncludeAnonymous);for(t.moveTo(e);;)if(!(a<0?t.childBefore(e):t.childAfter(e)))for(;;){if((a<0?t.to<e:t.from>e)&&!t.type.isError)return a<0?Math.max(0,Math.min(t.to-1,e-25)):Math.min(u.length,Math.max(t.from+1,e+25));if(a<0?t.prevSibling():t.nextSibling())break;if(!t.parent())return a<0?0:u.length}}class s3u{constructor(e,a){this.fragments=e,this.nodeSet=a,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?dM(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?dM(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let a=this.trees.length-1;if(a<0)return this.nextFragment(),null;let t=this.trees[a],r=this.index[a];if(r==t.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let n=t.children[r],i=this.start[a]+t.positions[r];if(i>e)return this.nextStart=i,null;if(n instanceof Va){if(i==e){if(i<this.safeFrom)return null;let o=i+n.length;if(o<=this.safeTo){let s=n.prop(vu.lookAhead);if(!s||o+s<this.fragment.to)return n}}this.index[a]++,i+n.length>=Math.max(this.safeFrom,e)&&(this.trees.push(n),this.start.push(i),this.index.push(0))}else this.index[a]++,this.nextStart=i+n.length}}}class l3u{constructor(e,a){this.stream=a,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(t=>new vx)}getActions(e){let a=0,t=null,{parser:r}=e.p,{tokenizers:n}=r,i=r.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,s=0;for(let l=0;l<n.length;l++){if((1<<l&i)==0)continue;let c=n[l],d=this.tokens[l];if(!(t&&!c.fallback)&&((c.contextual||d.start!=e.pos||d.mask!=i||d.context!=o)&&(this.updateCachedToken(d,c,e),d.mask=i,d.context=o),d.lookAhead>d.end+25&&(s=Math.max(d.lookAhead,s)),d.value!=0)){let E=a;if(d.extended>-1&&(a=this.addActions(e,d.extended,d.end,a)),a=this.addActions(e,d.value,d.end,a),!c.extend&&(t=d,a>E))break}}for(;this.actions.length>a;)this.actions.pop();return s&&e.setLookAhead(s),!t&&e.pos==this.stream.end&&(t=new vx,t.value=e.p.parser.eofTerm,t.start=t.end=e.pos,a=this.addActions(e,t.value,t.end,a)),this.mainToken=t,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let a=new vx,{pos:t,p:r}=e;return a.start=t,a.end=Math.min(t+1,r.stream.end),a.value=t==r.stream.end?r.parser.eofTerm:0,a}updateCachedToken(e,a,t){let r=this.stream.clipPos(t.pos);if(a.token(this.stream.reset(r,e),t),e.value>-1){let{parser:n}=t.p;for(let i=0;i<n.specialized.length;i++)if(n.specialized[i]==e.value){let o=n.specializers[i](this.stream.read(e.start,e.end),t);if(o>=0&&t.p.parser.dialect.allows(o>>1)){(o&1)==0?e.value=o>>1:e.extended=o>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,a,t,r){for(let n=0;n<r;n+=3)if(this.actions[n]==e)return r;return this.actions[r++]=e,this.actions[r++]=a,this.actions[r++]=t,r}addActions(e,a,t,r){let{state:n}=e,{parser:i}=e.p,{data:o}=i;for(let s=0;s<2;s++)for(let l=i.stateSlot(n,s?2:1);;l+=3){if(o[l]==65535)if(o[l+1]==1)l=ai(o,l+2);else{r==0&&o[l+1]==2&&(r=this.putAction(ai(o,l+2),a,t,r));break}o[l]==a&&(r=this.putAction(ai(o,l+1),a,t,r))}return r}}class c3u{constructor(e,a,t,r){this.parser=e,this.input=a,this.ranges=r,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new i3u(a,r),this.tokens=new l3u(e,this.stream),this.topTerm=e.top[1];let{from:n}=r[0];this.stacks=[Z5.start(this,e.top[0],n)],this.fragments=t.length&&this.stream.end-n>e.bufferLength*4?new s3u(t,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,a=this.minStackPos,t=this.stacks=[],r,n;if(this.bigReductionCount>300&&e.length==1){let[i]=e;for(;i.forceReduce()&&i.stack.length&&i.stack[i.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let i=0;i<e.length;i++){let o=e[i];for(;;){if(this.tokens.mainToken=null,o.pos>a)t.push(o);else{if(this.advanceStack(o,t,e))continue;{r||(r=[],n=[]),r.push(o);let s=this.tokens.getMainToken(o);n.push(s.value,s.end)}}break}}if(!t.length){let i=r&&E3u(r);if(i)return gt&&console.log("Finish with "+this.stackID(i)),this.stackToTree(i);if(this.parser.strict)throw gt&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+a);this.recovering||(this.recovering=5)}if(this.recovering&&r){let i=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,n,t);if(i)return gt&&console.log("Force-finish "+this.stackID(i)),this.stackToTree(i.forceAll())}if(this.recovering){let i=this.recovering==1?1:this.recovering*3;if(t.length>i)for(t.sort((o,s)=>s.score-o.score);t.length>i;)t.pop();t.some(o=>o.reducePos>a)&&this.recovering--}else if(t.length>1){e:for(let i=0;i<t.length-1;i++){let o=t[i];for(let s=i+1;s<t.length;s++){let l=t[s];if(o.sameState(l)||o.buffer.length>500&&l.buffer.length>500)if((o.score-l.score||o.buffer.length-l.buffer.length)>0)t.splice(s--,1);else{t.splice(i--,1);continue e}}}t.length>12&&t.splice(12,t.length-12)}this.minStackPos=t[0].pos;for(let i=1;i<t.length;i++)t[i].pos<this.minStackPos&&(this.minStackPos=t[i].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,a,t){let r=e.pos,{parser:n}=this,i=gt?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let l=e.curContext&&e.curContext.tracker.strict,c=l?e.curContext.hash:0;for(let d=this.fragments.nodeAt(r);d;){let E=this.parser.nodeSet.types[d.type.id]==d.type?n.getGoto(e.state,d.type.id):-1;if(E>-1&&d.length&&(!l||(d.prop(vu.contextHash)||0)==c))return e.useNode(d,E),gt&&console.log(i+this.stackID(e)+` (via reuse of ${n.getName(d.type.id)})`),!0;if(!(d instanceof Va)||d.children.length==0||d.positions[0]>0)break;let p=d.children[0];if(p instanceof Va&&d.positions[0]==0)d=p;else break}}let o=n.stateSlot(e.state,4);if(o>0)return e.reduce(o),gt&&console.log(i+this.stackID(e)+` (via always-reduce ${n.getName(o&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let s=this.tokens.getActions(e);for(let l=0;l<s.length;){let c=s[l++],d=s[l++],E=s[l++],p=l==s.length||!t,x=p?e:e.split(),m=this.tokens.mainToken;if(x.apply(c,d,m?m.start:x.pos,E),gt&&console.log(i+this.stackID(x)+` (via ${(c&65536)==0?"shift":`reduce of ${n.getName(c&65535)}`} for ${n.getName(d)} @ ${r}${x==e?"":", split"})`),p)return!0;x.pos>r?a.push(x):t.push(x)}return!1}advanceFully(e,a){let t=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>t)return EM(e,a),!0}}runRecovery(e,a,t){let r=null,n=!1;for(let i=0;i<e.length;i++){let o=e[i],s=a[i<<1],l=a[(i<<1)+1],c=gt?this.stackID(o)+" -> ":"";if(o.deadEnd&&(n||(n=!0,o.restart(),gt&&console.log(c+this.stackID(o)+" (restarted)"),this.advanceFully(o,t))))continue;let d=o.split(),E=c;for(let p=0;d.forceReduce()&&p<10&&(gt&&console.log(E+this.stackID(d)+" (via force-reduce)"),!this.advanceFully(d,t));p++)gt&&(E=this.stackID(d)+" -> ");for(let p of o.recoverByInsert(s))gt&&console.log(c+this.stackID(p)+" (via recover-insert)"),this.advanceFully(p,t);this.stream.end>o.pos?(l==o.pos&&(l++,s=0),o.recoverByDelete(s,l),gt&&console.log(c+this.stackID(o)+` (via recover-delete ${this.parser.getName(s)})`),EM(o,t)):(!r||r.score<o.score)&&(r=o)}return r}stackToTree(e){return e.close(),Va.build({buffer:Q5.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let a=(ok||(ok=new WeakMap)).get(e);return a||ok.set(e,a=String.fromCodePoint(this.nextStackID++)),a+e}}function EM(u,e){for(let a=0;a<e.length;a++){let t=e[a];if(t.pos==u.pos&&t.sameState(u)){e[a].score<u.score&&(e[a]=u);return}}e.push(u)}class d3u{constructor(e,a,t){this.source=e,this.flags=a,this.disabled=t}allows(e){return!this.disabled||this.disabled[e]==0}}const sk=u=>u;class tg{constructor(e){this.start=e.start,this.shift=e.shift||sk,this.reduce=e.reduce||sk,this.reuse=e.reuse||sk,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class gi extends XJ{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let a=e.nodeNames.split(" ");this.minRepeatTerm=a.length;for(let o=0;o<e.repeatNodeCount;o++)a.push("");let t=Object.keys(e.topRules).map(o=>e.topRules[o][1]),r=[];for(let o=0;o<a.length;o++)r.push([]);function n(o,s,l){r[o].push([s,s.deserialize(String(l))])}if(e.nodeProps)for(let o of e.nodeProps){let s=o[0];typeof s=="string"&&(s=vu[s]);for(let l=1;l<o.length;){let c=o[l++];if(c>=0)n(c,s,o[l++]);else{let d=o[l+-c];for(let E=-c;E>0;E--)n(o[l++],s,d);l++}}}this.nodeSet=new EA(a.map((o,s)=>Z0.define({name:s>=this.minRepeatTerm?void 0:o,id:s,props:r[s],top:t.indexOf(s)>-1,error:s==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(s)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=JJ;let i=H4(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let o=0;o<this.specializerSpecs.length;o++)this.specialized[o]=this.specializerSpecs[o].term;this.specializers=this.specializerSpecs.map(pM),this.states=H4(e.states,Uint32Array),this.data=H4(e.stateData),this.goto=H4(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(o=>typeof o=="number"?new b1(i,o):o),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,a,t){let r=new c3u(this,e,a,t);for(let n of this.wrappers)r=n(r,e,a,t);return r}getGoto(e,a,t=!1){let r=this.goto;if(a>=r[0])return-1;for(let n=r[a+1];;){let i=r[n++],o=i&1,s=r[n++];if(o&&t)return s;for(let l=n+(i>>1);n<l;n++)if(r[n]==e)return s;if(o)return-1}}hasAction(e,a){let t=this.data;for(let r=0;r<2;r++)for(let n=this.stateSlot(e,r?2:1),i;;n+=3){if((i=t[n])==65535)if(t[n+1]==1)i=t[n=ai(t,n+2)];else{if(t[n+1]==2)return ai(t,n+2);break}if(i==a||i==0)return ai(t,n+1)}return 0}stateSlot(e,a){return this.states[e*6+a]}stateFlag(e,a){return(this.stateSlot(e,0)&a)>0}validAction(e,a){return!!this.allActions(e,t=>t==a?!0:null)}allActions(e,a){let t=this.stateSlot(e,4),r=t?a(t):void 0;for(let n=this.stateSlot(e,1);r==null;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=ai(this.data,n+2);else break;r=a(ai(this.data,n+1))}return r}nextStates(e){let a=[];for(let t=this.stateSlot(e,1);;t+=3){if(this.data[t]==65535)if(this.data[t+1]==1)t=ai(this.data,t+2);else break;if((this.data[t+2]&1)==0){let r=this.data[t+1];a.some((n,i)=>i&1&&n==r)||a.push(this.data[t],r)}}return a}configure(e){let a=Object.assign(Object.create(gi.prototype),this);if(e.props&&(a.nodeSet=this.nodeSet.extend(...e.props)),e.top){let t=this.topRules[e.top];if(!t)throw new RangeError(`Invalid top rule name ${e.top}`);a.top=t}return e.tokenizers&&(a.tokenizers=this.tokenizers.map(t=>{let r=e.tokenizers.find(n=>n.from==t);return r?r.to:t})),e.specializers&&(a.specializers=this.specializers.slice(),a.specializerSpecs=this.specializerSpecs.map((t,r)=>{let n=e.specializers.find(o=>o.from==t.external);if(!n)return t;let i=Object.assign(Object.assign({},t),{external:n.to});return a.specializers[r]=pM(i),i})),e.contextTracker&&(a.context=e.contextTracker),e.dialect&&(a.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(a.strict=e.strict),e.wrap&&(a.wrappers=a.wrappers.concat(e.wrap)),e.bufferLength!=null&&(a.bufferLength=e.bufferLength),a}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let a=this.dynamicPrecedences;return a==null?0:a[e]||0}parseDialect(e){let a=Object.keys(this.dialects),t=a.map(()=>!1);if(e)for(let n of e.split(" ")){let i=a.indexOf(n);i>=0&&(t[i]=!0)}let r=null;for(let n=0;n<a.length;n++)if(!t[n])for(let i=this.dialects[a[n]],o;(o=this.data[i++])!=65535;)(r||(r=new Uint8Array(this.maxTerm+1)))[o]=1;return new d3u(e,t,r)}static deserialize(e){return new gi(e)}}function ai(u,e){return u[e]|u[e+1]<<16}function E3u(u){let e=null;for(let a of u){let t=a.p.stoppedAt;(a.pos==a.p.stream.end||t!=null&&a.pos>t)&&a.p.parser.stateFlag(a.state,2)&&(!e||e.score<a.score)&&(e=a)}return e}function pM(u){if(u.external){let e=u.extend?1:0;return(a,t)=>u.external(a,t)<<1|e}return u.get}let p3u=0,ti=class Iy{constructor(e,a,t,r){this.name=e,this.set=a,this.base=t,this.modified=r,this.id=p3u++}toString(){let{name:e}=this;for(let a of this.modified)a.name&&(e=`${a.name}(${e})`);return e}static define(e,a){let t=typeof e=="string"?e:"?";if(e instanceof Iy&&(a=e),a?.base)throw new Error("Can not derive from a modified tag");let r=new Iy(t,[],null,[]);if(r.set.push(r),a)for(let n of a.set)r.set.push(n);return r}static defineModifier(e){let a=new X5(e);return t=>t.modified.indexOf(a)>-1?t:X5.get(t.base||t,t.modified.concat(a).sort((r,n)=>r.id-n.id))}},m3u=0;class X5{constructor(e){this.name=e,this.instances=[],this.id=m3u++}static get(e,a){if(!a.length)return e;let t=a[0].instances.find(o=>o.base==e&&h3u(a,o.modified));if(t)return t;let r=[],n=new ti(e.name,r,e,a);for(let o of a)o.instances.push(n);let i=x3u(a);for(let o of e.set)if(!o.modified.length)for(let s of i)r.push(X5.get(o,s));return n}}function h3u(u,e){return u.length==e.length&&u.every((a,t)=>a==e[t])}function x3u(u){let e=[[]];for(let a=0;a<u.length;a++)for(let t=0,r=e.length;t<r;t++)e.push(e[t].concat(u[a]));return e.sort((a,t)=>t.length-a.length)}function Xs(u){let e=Object.create(null);for(let a in u){let t=u[a];Array.isArray(t)||(t=[t]);for(let r of a.split(" "))if(r){let n=[],i=2,o=r;for(let d=0;;){if(o=="..."&&d>0&&d+3==r.length){i=1;break}let E=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(o);if(!E)throw new RangeError("Invalid path: "+r);if(n.push(E[0]=="*"?"":E[0][0]=='"'?JSON.parse(E[0]):E[0]),d+=E[0].length,d==r.length)break;let p=r[d++];if(d==r.length&&p=="!"){i=0;break}if(p!="/")throw new RangeError("Invalid path: "+r);o=r.slice(d)}let s=n.length-1,l=n[s];if(!l)throw new RangeError("Invalid path: "+r);let c=new eD(t,i,s>0?n.slice(0,s):null);e[l]=c.sort(e[l])}}return uU.add(e)}const uU=new vu;class eD{constructor(e,a,t,r){this.tags=e,this.mode=a,this.context=t,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}eD.empty=new eD([],2,null);function aU(u,e){let a=Object.create(null);for(let n of u)if(!Array.isArray(n.tag))a[n.tag.id]=n.class;else for(let i of n.tag)a[i.id]=n.class;let{scope:t,all:r=null}=e||{};return{style:n=>{let i=r;for(let o of n)for(let s of o.set){let l=a[s.id];if(l){i=i?i+" "+l:l;break}}return i},scope:t}}function D3u(u,e){let a=null;for(let t of u){let r=t.style(e);r&&(a=a?a+" "+r:r)}return a}function f3u(u,e,a,t=0,r=u.length){let n=new g3u(t,Array.isArray(e)?e:[e],a);n.highlightRange(u.cursor(),t,r,"",n.highlighters),n.flush(r)}class g3u{constructor(e,a,t){this.at=e,this.highlighters=a,this.span=t,this.class=""}startSpan(e,a){a!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=a)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,a,t,r,n){let{type:i,from:o,to:s}=e;if(o>=t||s<=a)return;i.isTop&&(n=this.highlighters.filter(p=>!p.scope||p.scope(i)));let l=r,c=v3u(e)||eD.empty,d=D3u(n,c.tags);if(d&&(l&&(l+=" "),l+=d,c.mode==1&&(r+=(r?" ":"")+d)),this.startSpan(Math.max(a,o),l),c.opaque)return;let E=e.tree&&e.tree.prop(vu.mounted);if(E&&E.overlay){let p=e.node.enter(E.overlay[0].from+o,1),x=this.highlighters.filter(g=>!g.scope||g.scope(E.tree.type)),m=e.firstChild();for(let g=0,h=o;;g++){let f=g<E.overlay.length?E.overlay[g]:null,k=f?f.from+o:s,y=Math.max(a,h),v=Math.min(t,k);if(y<v&&m)for(;e.from<v&&(this.highlightRange(e,y,v,r,n),this.startSpan(Math.min(v,e.to),l),!(e.to>=k||!e.nextSibling())););if(!f||k>t)break;h=f.to+o,h>a&&(this.highlightRange(p.cursor(),Math.max(a,f.from+o),Math.min(t,h),"",x),this.startSpan(Math.min(t,h),l))}m&&e.parent()}else if(e.firstChild()){E&&(r="");do if(!(e.to<=a)){if(e.from>=t)break;this.highlightRange(e,a,t,r,n),this.startSpan(Math.min(t,e.to),l)}while(e.nextSibling());e.parent()}}}function v3u(u){let e=u.type.prop(uU);for(;e&&e.context&&!u.matchContext(e.context);)e=e.next;return e||null}const $e=ti.define,ph=$e(),eo=$e(),mM=$e(eo),hM=$e(eo),uo=$e(),mh=$e(uo),lk=$e(uo),qr=$e(),ss=$e(qr),Ir=$e(),Kr=$e(),Ky=$e(),k4=$e(Ky),hh=$e(),Z={comment:ph,lineComment:$e(ph),blockComment:$e(ph),docComment:$e(ph),name:eo,variableName:$e(eo),typeName:mM,tagName:$e(mM),propertyName:hM,attributeName:$e(hM),className:$e(eo),labelName:$e(eo),namespace:$e(eo),macroName:$e(eo),literal:uo,string:mh,docString:$e(mh),character:$e(mh),attributeValue:$e(mh),number:lk,integer:$e(lk),float:$e(lk),bool:$e(uo),regexp:$e(uo),escape:$e(uo),color:$e(uo),url:$e(uo),keyword:Ir,self:$e(Ir),null:$e(Ir),atom:$e(Ir),unit:$e(Ir),modifier:$e(Ir),operatorKeyword:$e(Ir),controlKeyword:$e(Ir),definitionKeyword:$e(Ir),moduleKeyword:$e(Ir),operator:Kr,derefOperator:$e(Kr),arithmeticOperator:$e(Kr),logicOperator:$e(Kr),bitwiseOperator:$e(Kr),compareOperator:$e(Kr),updateOperator:$e(Kr),definitionOperator:$e(Kr),typeOperator:$e(Kr),controlOperator:$e(Kr),punctuation:Ky,separator:$e(Ky),bracket:k4,angleBracket:$e(k4),squareBracket:$e(k4),paren:$e(k4),brace:$e(k4),content:qr,heading:ss,heading1:$e(ss),heading2:$e(ss),heading3:$e(ss),heading4:$e(ss),heading5:$e(ss),heading6:$e(ss),contentSeparator:$e(qr),list:$e(qr),quote:$e(qr),emphasis:$e(qr),strong:$e(qr),link:$e(qr),monospace:$e(qr),strikethrough:$e(qr),inserted:$e(),deleted:$e(),changed:$e(),invalid:$e(),meta:hh,documentMeta:$e(hh),annotation:$e(hh),processingInstruction:$e(hh),definition:ti.defineModifier("definition"),constant:ti.defineModifier("constant"),function:ti.defineModifier("function"),standard:ti.defineModifier("standard"),local:ti.defineModifier("local"),special:ti.defineModifier("special")};for(let u in Z){let e=Z[u];e instanceof ti&&(e.name=u)}aU([{tag:Z.link,class:"tok-link"},{tag:Z.heading,class:"tok-heading"},{tag:Z.emphasis,class:"tok-emphasis"},{tag:Z.strong,class:"tok-strong"},{tag:Z.keyword,class:"tok-keyword"},{tag:Z.atom,class:"tok-atom"},{tag:Z.bool,class:"tok-bool"},{tag:Z.url,class:"tok-url"},{tag:Z.labelName,class:"tok-labelName"},{tag:Z.inserted,class:"tok-inserted"},{tag:Z.deleted,class:"tok-deleted"},{tag:Z.literal,class:"tok-literal"},{tag:Z.string,class:"tok-string"},{tag:Z.number,class:"tok-number"},{tag:[Z.regexp,Z.escape,Z.special(Z.string)],class:"tok-string2"},{tag:Z.variableName,class:"tok-variableName"},{tag:Z.local(Z.variableName),class:"tok-variableName tok-local"},{tag:Z.definition(Z.variableName),class:"tok-variableName tok-definition"},{tag:Z.special(Z.variableName),class:"tok-variableName2"},{tag:Z.definition(Z.propertyName),class:"tok-propertyName tok-definition"},{tag:Z.typeName,class:"tok-typeName"},{tag:Z.namespace,class:"tok-namespace"},{tag:Z.className,class:"tok-className"},{tag:Z.macroName,class:"tok-macroName"},{tag:Z.propertyName,class:"tok-propertyName"},{tag:Z.operator,class:"tok-operator"},{tag:Z.comment,class:"tok-comment"},{tag:Z.meta,class:"tok-meta"},{tag:Z.invalid,class:"tok-invalid"},{tag:Z.punctuation,class:"tok-punctuation"}]);const k3u=Xs({String:Z.string,Number:Z.number,"True False":Z.bool,PropertyName:Z.propertyName,Null:Z.null,",":Z.separator,"[ ]":Z.squareBracket,"{ }":Z.brace}),b3u=gi.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j",stateData:"#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O",goto:"!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName ] [ Array",maxTerm:25,nodeProps:[["openedBy",7,"{",12,"["],["closedBy",8,"}",13,"]"]],propSources:[k3u],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oc~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Oe~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zOh~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yOg~~'OO]~~'TO[~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0});let Vy=[],tU=[];(()=>{let u="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,a=0;e<u.length;e++)(e%2?tU:Vy).push(a=a+u[e])})();function y3u(u){if(u<768)return!1;for(let e=0,a=Vy.length;;){let t=e+a>>1;if(u<Vy[t])a=t;else if(u>=tU[t])e=t+1;else return!0;if(e==a)return!1}}function xM(u){return u>=127462&&u<=127487}const DM=8205;function C3u(u,e,a=!0,t=!0){return(a?rU:F3u)(u,e,t)}function rU(u,e,a){if(e==u.length)return e;e&&nU(u.charCodeAt(e))&&iU(u.charCodeAt(e-1))&&e--;let t=ck(u,e);for(e+=fM(t);e<u.length;){let r=ck(u,e);if(t==DM||r==DM||a&&y3u(r))e+=fM(r),t=r;else if(xM(r)){let n=0,i=e-2;for(;i>=0&&xM(ck(u,i));)n++,i-=2;if(n%2==0)break;e+=2}else break}return e}function F3u(u,e,a){for(;e>0;){let t=rU(u,e-2,a);if(t<e)return t;e--}return 0}function ck(u,e){let a=u.charCodeAt(e);if(!iU(a)||e+1==u.length)return a;let t=u.charCodeAt(e+1);return nU(t)?(a-55296<<10)+(t-56320)+65536:a}function nU(u){return u>=56320&&u<57344}function iU(u){return u>=55296&&u<56320}function fM(u){return u<65536?1:2}class Mu{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,a,t){[e,a]=W1(this,e,a);let r=[];return this.decompose(0,e,r,2),t.length&&t.decompose(0,t.length,r,3),this.decompose(a,this.length,r,1),en.from(r,this.length-(a-e)+t.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,a=this.length){[e,a]=W1(this,e,a);let t=[];return this.decompose(e,a,t,0),en.from(t,a-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let a=this.scanIdentical(e,1),t=this.length-this.scanIdentical(e,-1),r=new Ed(this),n=new Ed(e);for(let i=a,o=a;;){if(r.next(i),n.next(i),i=0,r.lineBreak!=n.lineBreak||r.done!=n.done||r.value!=n.value)return!1;if(o+=r.value.length,r.done||o>=t)return!0}}iter(e=1){return new Ed(this,e)}iterRange(e,a=this.length){return new oU(this,e,a)}iterLines(e,a){let t;if(e==null)t=this.iter();else{a==null&&(a=this.lines+1);let r=this.line(e).from;t=this.iterRange(r,Math.max(r,a==this.lines+1?this.length:a<=1?0:this.line(a-1).to))}return new sU(t)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?Mu.empty:e.length<=32?new $a(e):en.from($a.split(e,[]))}}class $a extends Mu{constructor(e,a=A3u(e)){super(),this.text=e,this.length=a}get lines(){return this.text.length}get children(){return null}lineInner(e,a,t,r){for(let n=0;;n++){let i=this.text[n],o=r+i.length;if((a?t:o)>=e)return new B3u(r,o,t,i);r=o+1,t++}}decompose(e,a,t,r){let n=e<=0&&a>=this.length?this:new $a(gM(this.text,e,a),Math.min(a,this.length)-Math.max(0,e));if(r&1){let i=t.pop(),o=kx(n.text,i.text.slice(),0,n.length);if(o.length<=32)t.push(new $a(o,i.length+n.length));else{let s=o.length>>1;t.push(new $a(o.slice(0,s)),new $a(o.slice(s)))}}else t.push(n)}replace(e,a,t){if(!(t instanceof $a))return super.replace(e,a,t);[e,a]=W1(this,e,a);let r=kx(this.text,kx(t.text,gM(this.text,0,e)),a),n=this.length+t.length-(a-e);return r.length<=32?new $a(r,n):en.from($a.split(r,[]),n)}sliceString(e,a=this.length,t=`
475
+ `;function Y2({input:u,onSave:e,onCancel:a,...t}){const[r,n]=H.useState(!!u.isSecret),i=({name:o,value:s})=>{e({...u,name:o,value:s,isSecret:r})};return D.jsx(nJ,{variable:u,onSave:i,onCancel:a,...t,children:D.jsx(Ld,{children:D.jsx(rJ,{value:r,onChange:o=>n(o),title:"Make it secret"})})})}const zy=()=>({name:"",value:"",isSecret:!1}),va=u=>KI+"$inputs."+u+r2,E1u=(u,e)=>e.inputs.find(a=>a.get().name===u.match(`^${ff}$`)?.[1]);function p1u({environments:u,activeEnvironmentId:e}){return u.get().find(t=>t.name===e.get())?.inputs||[]}function qi(u){const e=new RegExp(ff,"g"),a=new Set;if(!u)return a;for(const[t,r,n]of u.matchAll(e)){const i=r||n;i&&a.add(i)}return a}function X2(u){const e=/^\{?\$inputs\.([^\}\s]+)\}?$/,a=u.match(e);return a?a[1]:null}function mx(u){var e=new Error(u);return e.source="ulid",e}var eA="0123456789ABCDEFGHJKMNPQRSTVWXYZ",sd=eA.length,yj=Math.pow(2,48)-1,m1u=10,h1u=16;function x1u(u){var e=Math.floor(u()*sd);return e===sd&&(e=sd-1),eA.charAt(e)}function D1u(u,e){if(isNaN(u))throw new Error(u+" must be a number");if(u>yj)throw mx("cannot encode time greater than "+yj);if(u<0)throw mx("time must be positive");if(Number.isInteger(u)===!1)throw mx("time must be an integer");for(var a=void 0,t="";e>0;e--)a=u%sd,t=eA.charAt(a)+t,u=(u-a)/sd;return t}function f1u(u,e){for(var a="";u>0;u--)a=x1u(e)+a;return a}function g1u(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=arguments[1];e||(e=typeof window<"u"?window:null);var a=e&&(e.crypto||e.msCrypto);if(a)return function(){var r=new Uint8Array(1);return a.getRandomValues(r),r[0]/255};try{var t=require("crypto");return function(){return t.randomBytes(1).readUInt8()/255}}catch{}if(u){try{console.error("secure crypto unusable, falling back to insecure Math.random()!")}catch{}return function(){return Math.random()}}throw mx("secure crypto unusable, insecure Math.random not allowed")}function v1u(u){return u||(u=g1u()),function(a){return isNaN(a)&&(a=Date.now()),D1u(a,m1u)+f1u(h1u,u)}}var L5=v1u(),k1u=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{},bs="1.9.0",Cj=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function b1u(u){var e=new Set([u]),a=new Set,t=u.match(Cj);if(!t)return function(){return!1};var r={major:+t[1],minor:+t[2],patch:+t[3],prerelease:t[4]};if(r.prerelease!=null)return function(s){return s===u};function n(o){return a.add(o),!1}function i(o){return e.add(o),!0}return function(s){if(e.has(s))return!0;if(a.has(s))return!1;var l=s.match(Cj);if(!l)return n(s);var c={major:+l[1],minor:+l[2],patch:+l[3],prerelease:l[4]};return c.prerelease!=null||r.major!==c.major?n(s):r.major===0?r.minor===c.minor&&r.patch<=c.patch?i(s):n(s):r.minor<=c.minor?i(s):n(s)}}var y1u=b1u(bs),C1u=bs.split(".")[0],Id=Symbol.for("opentelemetry.js.api."+C1u),Kd=k1u;function PE(u,e,a,t){var r;t===void 0&&(t=!1);var n=Kd[Id]=(r=Kd[Id])!==null&&r!==void 0?r:{version:bs};if(!t&&n[u]){var i=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+u);return a.error(i.stack||i.message),!1}if(n.version!==bs){var i=new Error("@opentelemetry/api: Registration of version v"+n.version+" for "+u+" does not match previously registered API v"+bs);return a.error(i.stack||i.message),!1}return n[u]=e,a.debug("@opentelemetry/api: Registered a global for "+u+" v"+bs+"."),!0}function $s(u){var e,a,t=(e=Kd[Id])===null||e===void 0?void 0:e.version;if(!(!t||!y1u(t)))return(a=Kd[Id])===null||a===void 0?void 0:a[u]}function jE(u,e){e.debug("@opentelemetry/api: Unregistering a global for "+u+" v"+bs+".");var a=Kd[Id];a&&delete a[u]}var F1u=function(u,e){var a=typeof Symbol=="function"&&u[Symbol.iterator];if(!a)return u;var t=a.call(u),r,n=[],i;try{for(;(e===void 0||e-- >0)&&!(r=t.next()).done;)n.push(r.value)}catch(o){i={error:o}}finally{try{r&&!r.done&&(a=t.return)&&a.call(t)}finally{if(i)throw i.error}}return n},A1u=function(u,e,a){if(a||arguments.length===2)for(var t=0,r=e.length,n;t<r;t++)(n||!(t in e))&&(n||(n=Array.prototype.slice.call(e,0,t)),n[t]=e[t]);return u.concat(n||Array.prototype.slice.call(e))},B1u=(function(){function u(e){this._namespace=e.namespace||"DiagComponentLogger"}return u.prototype.debug=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];return f4("debug",this._namespace,e)},u.prototype.error=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];return f4("error",this._namespace,e)},u.prototype.info=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];return f4("info",this._namespace,e)},u.prototype.warn=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];return f4("warn",this._namespace,e)},u.prototype.verbose=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];return f4("verbose",this._namespace,e)},u})();function f4(u,e,a){var t=$s("diag");if(t)return a.unshift(e),t[u].apply(t,A1u([],F1u(a),!1))}var At;(function(u){u[u.NONE=0]="NONE",u[u.ERROR=30]="ERROR",u[u.WARN=50]="WARN",u[u.INFO=60]="INFO",u[u.DEBUG=70]="DEBUG",u[u.VERBOSE=80]="VERBOSE",u[u.ALL=9999]="ALL"})(At||(At={}));function S1u(u,e){u<At.NONE?u=At.NONE:u>At.ALL&&(u=At.ALL),e=e||{};function a(t,r){var n=e[t];return typeof n=="function"&&u>=r?n.bind(e):function(){}}return{error:a("error",At.ERROR),warn:a("warn",At.WARN),info:a("info",At.INFO),debug:a("debug",At.DEBUG),verbose:a("verbose",At.VERBOSE)}}var z1u=function(u,e){var a=typeof Symbol=="function"&&u[Symbol.iterator];if(!a)return u;var t=a.call(u),r,n=[],i;try{for(;(e===void 0||e-- >0)&&!(r=t.next()).done;)n.push(r.value)}catch(o){i={error:o}}finally{try{r&&!r.done&&(a=t.return)&&a.call(t)}finally{if(i)throw i.error}}return n},w1u=function(u,e,a){if(a||arguments.length===2)for(var t=0,r=e.length,n;t<r;t++)(n||!(t in e))&&(n||(n=Array.prototype.slice.call(e,0,t)),n[t]=e[t]);return u.concat(n||Array.prototype.slice.call(e))},O1u="diag",vn=(function(){function u(){function e(r){return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var o=$s("diag");if(o)return o[r].apply(o,w1u([],z1u(n),!1))}}var a=this,t=function(r,n){var i,o,s;if(n===void 0&&(n={logLevel:At.INFO}),r===a){var l=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return a.error((i=l.stack)!==null&&i!==void 0?i:l.message),!1}typeof n=="number"&&(n={logLevel:n});var c=$s("diag"),d=S1u((o=n.logLevel)!==null&&o!==void 0?o:At.INFO,r);if(c&&!n.suppressOverrideMessage){var E=(s=new Error().stack)!==null&&s!==void 0?s:"<failed to generate stacktrace>";c.warn("Current logger will be overwritten from "+E),d.warn("Current logger will overwrite one already registered from "+E)}return PE("diag",d,a,!0)};a.setLogger=t,a.disable=function(){jE(O1u,a)},a.createComponentLogger=function(r){return new B1u(r)},a.verbose=e("verbose"),a.debug=e("debug"),a.info=e("info"),a.warn=e("warn"),a.error=e("error")}return u.instance=function(){return this._instance||(this._instance=new u),this._instance},u})(),P1u=function(u,e){var a=typeof Symbol=="function"&&u[Symbol.iterator];if(!a)return u;var t=a.call(u),r,n=[],i;try{for(;(e===void 0||e-- >0)&&!(r=t.next()).done;)n.push(r.value)}catch(o){i={error:o}}finally{try{r&&!r.done&&(a=t.return)&&a.call(t)}finally{if(i)throw i.error}}return n},j1u=function(u){var e=typeof Symbol=="function"&&Symbol.iterator,a=e&&u[e],t=0;if(a)return a.call(u);if(u&&typeof u.length=="number")return{next:function(){return u&&t>=u.length&&(u=void 0),{value:u&&u[t++],done:!u}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},M1u=(function(){function u(e){this._entries=e?new Map(e):new Map}return u.prototype.getEntry=function(e){var a=this._entries.get(e);if(a)return Object.assign({},a)},u.prototype.getAllEntries=function(){return Array.from(this._entries.entries()).map(function(e){var a=P1u(e,2),t=a[0],r=a[1];return[t,r]})},u.prototype.setEntry=function(e,a){var t=new u(this._entries);return t._entries.set(e,a),t},u.prototype.removeEntry=function(e){var a=new u(this._entries);return a._entries.delete(e),a},u.prototype.removeEntries=function(){for(var e,a,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=new u(this._entries);try{for(var i=j1u(t),o=i.next();!o.done;o=i.next()){var s=o.value;n._entries.delete(s)}}catch(l){e={error:l}}finally{try{o&&!o.done&&(a=i.return)&&a.call(i)}finally{if(e)throw e.error}}return n},u.prototype.clear=function(){return new u},u})(),T1u=Symbol("BaggageEntryMetadata"),$1u=vn.instance();function R1u(u){return u===void 0&&(u={}),new M1u(new Map(Object.entries(u)))}function N1u(u){return typeof u!="string"&&($1u.error("Cannot create baggage metadata from unknown type: "+typeof u),u=""),{__TYPE__:T1u,toString:function(){return u}}}function uA(u){return Symbol.for(u)}var _1u=(function(){function u(e){var a=this;a._currentContext=e?new Map(e):new Map,a.getValue=function(t){return a._currentContext.get(t)},a.setValue=function(t,r){var n=new u(a._currentContext);return n._currentContext.set(t,r),n},a.deleteValue=function(t){var r=new u(a._currentContext);return r._currentContext.delete(t),r}}return u})(),u1=new _1u,Ys=(function(){var u=function(e,a){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])},u(e,a)};return function(e,a){if(typeof a!="function"&&a!==null)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");u(e,a);function t(){this.constructor=e}e.prototype=a===null?Object.create(a):(t.prototype=a.prototype,new t)}})(),L1u=(function(){function u(){}return u.prototype.createGauge=function(e,a){return Z1u},u.prototype.createHistogram=function(e,a){return Q1u},u.prototype.createCounter=function(e,a){return U1u},u.prototype.createUpDownCounter=function(e,a){return Y1u},u.prototype.createObservableGauge=function(e,a){return ecu},u.prototype.createObservableCounter=function(e,a){return X1u},u.prototype.createObservableUpDownCounter=function(e,a){return ucu},u.prototype.addBatchObservableCallback=function(e,a){},u.prototype.removeBatchObservableCallback=function(e){},u})(),Yf=(function(){function u(){}return u})(),I1u=(function(u){Ys(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e.prototype.add=function(a,t){},e})(Yf),K1u=(function(u){Ys(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e.prototype.add=function(a,t){},e})(Yf),V1u=(function(u){Ys(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e.prototype.record=function(a,t){},e})(Yf),G1u=(function(u){Ys(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e.prototype.record=function(a,t){},e})(Yf),aA=(function(){function u(){}return u.prototype.addCallback=function(e){},u.prototype.removeCallback=function(e){},u})(),H1u=(function(u){Ys(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e})(aA),q1u=(function(u){Ys(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e})(aA),W1u=(function(u){Ys(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e})(aA),J1u=new L1u,U1u=new I1u,Z1u=new V1u,Q1u=new G1u,Y1u=new K1u,X1u=new H1u,ecu=new q1u,ucu=new W1u,acu={get:function(u,e){if(u!=null)return u[e]},keys:function(u){return u==null?[]:Object.keys(u)}},tcu={set:function(u,e,a){u!=null&&(u[e]=a)}},rcu=function(u,e){var a=typeof Symbol=="function"&&u[Symbol.iterator];if(!a)return u;var t=a.call(u),r,n=[],i;try{for(;(e===void 0||e-- >0)&&!(r=t.next()).done;)n.push(r.value)}catch(o){i={error:o}}finally{try{r&&!r.done&&(a=t.return)&&a.call(t)}finally{if(i)throw i.error}}return n},ncu=function(u,e,a){if(a||arguments.length===2)for(var t=0,r=e.length,n;t<r;t++)(n||!(t in e))&&(n||(n=Array.prototype.slice.call(e,0,t)),n[t]=e[t]);return u.concat(n||Array.prototype.slice.call(e))},icu=(function(){function u(){}return u.prototype.active=function(){return u1},u.prototype.with=function(e,a,t){for(var r=[],n=3;n<arguments.length;n++)r[n-3]=arguments[n];return a.call.apply(a,ncu([t],rcu(r),!1))},u.prototype.bind=function(e,a){return a},u.prototype.enable=function(){return this},u.prototype.disable=function(){return this},u})(),ocu=function(u,e){var a=typeof Symbol=="function"&&u[Symbol.iterator];if(!a)return u;var t=a.call(u),r,n=[],i;try{for(;(e===void 0||e-- >0)&&!(r=t.next()).done;)n.push(r.value)}catch(o){i={error:o}}finally{try{r&&!r.done&&(a=t.return)&&a.call(t)}finally{if(i)throw i.error}}return n},scu=function(u,e,a){if(a||arguments.length===2)for(var t=0,r=e.length,n;t<r;t++)(n||!(t in e))&&(n||(n=Array.prototype.slice.call(e,0,t)),n[t]=e[t]);return u.concat(n||Array.prototype.slice.call(e))},Jv="context",lcu=new icu,Xf=(function(){function u(){}return u.getInstance=function(){return this._instance||(this._instance=new u),this._instance},u.prototype.setGlobalContextManager=function(e){return PE(Jv,e,vn.instance())},u.prototype.active=function(){return this._getContextManager().active()},u.prototype.with=function(e,a,t){for(var r,n=[],i=3;i<arguments.length;i++)n[i-3]=arguments[i];return(r=this._getContextManager()).with.apply(r,scu([e,a,t],ocu(n),!1))},u.prototype.bind=function(e,a){return this._getContextManager().bind(e,a)},u.prototype._getContextManager=function(){return $s(Jv)||lcu},u.prototype.disable=function(){this._getContextManager().disable(),jE(Jv,vn.instance())},u})(),fi;(function(u){u[u.NONE=0]="NONE",u[u.SAMPLED=1]="SAMPLED"})(fi||(fi={}));var iJ="0000000000000000",oJ="00000000000000000000000000000000",sJ={traceId:oJ,spanId:iJ,traceFlags:fi.NONE},ld=(function(){function u(e){e===void 0&&(e=sJ),this._spanContext=e}return u.prototype.spanContext=function(){return this._spanContext},u.prototype.setAttribute=function(e,a){return this},u.prototype.setAttributes=function(e){return this},u.prototype.addEvent=function(e,a){return this},u.prototype.addLink=function(e){return this},u.prototype.addLinks=function(e){return this},u.prototype.setStatus=function(e){return this},u.prototype.updateName=function(e){return this},u.prototype.end=function(e){},u.prototype.isRecording=function(){return!1},u.prototype.recordException=function(e,a){},u})(),tA=uA("OpenTelemetry Context Key SPAN");function rA(u){return u.getValue(tA)||void 0}function ccu(){return rA(Xf.getInstance().active())}function nA(u,e){return u.setValue(tA,e)}function dcu(u){return u.deleteValue(tA)}function Ecu(u,e){return nA(u,new ld(e))}function lJ(u){var e;return(e=rA(u))===null||e===void 0?void 0:e.spanContext()}var pcu=/^([0-9a-f]{32})$/i,mcu=/^[0-9a-f]{16}$/i;function cJ(u){return pcu.test(u)&&u!==oJ}function hcu(u){return mcu.test(u)&&u!==iJ}function eg(u){return cJ(u.traceId)&&hcu(u.spanId)}function xcu(u){return new ld(u)}var Uv=Xf.getInstance(),dJ=(function(){function u(){}return u.prototype.startSpan=function(e,a,t){t===void 0&&(t=Uv.active());var r=!!a?.root;if(r)return new ld;var n=t&&lJ(t);return Dcu(n)&&eg(n)?new ld(n):new ld},u.prototype.startActiveSpan=function(e,a,t,r){var n,i,o;if(!(arguments.length<2)){arguments.length===2?o=a:arguments.length===3?(n=a,o=t):(n=a,i=t,o=r);var s=i??Uv.active(),l=this.startSpan(e,n,s),c=nA(s,l);return Uv.with(c,o,void 0,l)}},u})();function Dcu(u){return typeof u=="object"&&typeof u.spanId=="string"&&typeof u.traceId=="string"&&typeof u.traceFlags=="number"}var fcu=new dJ,gcu=(function(){function u(e,a,t,r){this._provider=e,this.name=a,this.version=t,this.options=r}return u.prototype.startSpan=function(e,a,t){return this._getTracer().startSpan(e,a,t)},u.prototype.startActiveSpan=function(e,a,t,r){var n=this._getTracer();return Reflect.apply(n.startActiveSpan,n,arguments)},u.prototype._getTracer=function(){if(this._delegate)return this._delegate;var e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):fcu},u})(),vcu=(function(){function u(){}return u.prototype.getTracer=function(e,a,t){return new dJ},u})(),kcu=new vcu,Fj=(function(){function u(){}return u.prototype.getTracer=function(e,a,t){var r;return(r=this.getDelegateTracer(e,a,t))!==null&&r!==void 0?r:new gcu(this,e,a,t)},u.prototype.getDelegate=function(){var e;return(e=this._delegate)!==null&&e!==void 0?e:kcu},u.prototype.setDelegate=function(e){this._delegate=e},u.prototype.getDelegateTracer=function(e,a,t){var r;return(r=this._delegate)===null||r===void 0?void 0:r.getTracer(e,a,t)},u})(),I5;(function(u){u[u.NOT_RECORD=0]="NOT_RECORD",u[u.RECORD=1]="RECORD",u[u.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(I5||(I5={}));var wy;(function(u){u[u.INTERNAL=0]="INTERNAL",u[u.SERVER=1]="SERVER",u[u.CLIENT=2]="CLIENT",u[u.PRODUCER=3]="PRODUCER",u[u.CONSUMER=4]="CONSUMER"})(wy||(wy={}));var Vd;(function(u){u[u.UNSET=0]="UNSET",u[u.OK=1]="OK",u[u.ERROR=2]="ERROR"})(Vd||(Vd={}));var si=Xf.getInstance(),Gu=vn.instance(),bcu=(function(){function u(){}return u.prototype.getMeter=function(e,a,t){return J1u},u})(),ycu=new bcu,Zv="metrics",Ccu=(function(){function u(){}return u.getInstance=function(){return this._instance||(this._instance=new u),this._instance},u.prototype.setGlobalMeterProvider=function(e){return PE(Zv,e,vn.instance())},u.prototype.getMeterProvider=function(){return $s(Zv)||ycu},u.prototype.getMeter=function(e,a,t){return this.getMeterProvider().getMeter(e,a,t)},u.prototype.disable=function(){jE(Zv,vn.instance())},u})(),Fcu=Ccu.getInstance(),Acu=(function(){function u(){}return u.prototype.inject=function(e,a){},u.prototype.extract=function(e,a){return e},u.prototype.fields=function(){return[]},u})(),iA=uA("OpenTelemetry Baggage Key");function EJ(u){return u.getValue(iA)||void 0}function Bcu(){return EJ(Xf.getInstance().active())}function Scu(u,e){return u.setValue(iA,e)}function zcu(u){return u.deleteValue(iA)}var Qv="propagation",wcu=new Acu,Ocu=(function(){function u(){this.createBaggage=R1u,this.getBaggage=EJ,this.getActiveBaggage=Bcu,this.setBaggage=Scu,this.deleteBaggage=zcu}return u.getInstance=function(){return this._instance||(this._instance=new u),this._instance},u.prototype.setGlobalPropagator=function(e){return PE(Qv,e,vn.instance())},u.prototype.inject=function(e,a,t){return t===void 0&&(t=tcu),this._getGlobalPropagator().inject(e,a,t)},u.prototype.extract=function(e,a,t){return t===void 0&&(t=acu),this._getGlobalPropagator().extract(e,a,t)},u.prototype.fields=function(){return this._getGlobalPropagator().fields()},u.prototype.disable=function(){jE(Qv,vn.instance())},u.prototype._getGlobalPropagator=function(){return $s(Qv)||wcu},u})(),cd=Ocu.getInstance(),Yv="trace",Pcu=(function(){function u(){this._proxyTracerProvider=new Fj,this.wrapSpanContext=xcu,this.isSpanContextValid=eg,this.deleteSpan=dcu,this.getSpan=rA,this.getActiveSpan=ccu,this.getSpanContext=lJ,this.setSpan=nA,this.setSpanContext=Ecu}return u.getInstance=function(){return this._instance||(this._instance=new u),this._instance},u.prototype.setGlobalTracerProvider=function(e){var a=PE(Yv,this._proxyTracerProvider,vn.instance());return a&&this._proxyTracerProvider.setDelegate(e),a},u.prototype.getTracerProvider=function(){return $s(Yv)||this._proxyTracerProvider},u.prototype.getTracer=function(e,a){return this.getTracerProvider().getTracer(e,a)},u.prototype.disable=function(){jE(Yv,vn.instance()),this._proxyTracerProvider=new Fj},u})(),Ot=Pcu.getInstance();const pJ=uA("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function jcu(u){return u.setValue(pJ,!0)}function oA(u){return u.getValue(pJ)===!0}const Mcu="=",Oy=";",Py=",",Xv="baggage",Tcu=180,$cu=4096,Rcu=8192;function Ncu(u){return u.reduce((e,a)=>{const t=`${e}${e!==""?Py:""}${a}`;return t.length>Rcu?e:t},"")}function _cu(u){return u.getAllEntries().map(([e,a])=>{let t=`${encodeURIComponent(e)}=${encodeURIComponent(a.value)}`;return a.metadata!==void 0&&(t+=Oy+a.metadata.toString()),t})}function Lcu(u){const e=u.split(Oy);if(e.length<=0)return;const a=e.shift();if(!a)return;const t=a.indexOf(Mcu);if(t<=0)return;const r=decodeURIComponent(a.substring(0,t).trim()),n=decodeURIComponent(a.substring(t+1).trim());let i;return e.length>0&&(i=N1u(e.join(Oy))),{key:r,value:n,metadata:i}}class Icu{inject(e,a,t){const r=cd.getBaggage(e);if(!r||oA(e))return;const n=_cu(r).filter(o=>o.length<=$cu).slice(0,Tcu),i=Ncu(n);i.length>0&&t.set(a,Xv,i)}extract(e,a,t){const r=t.get(a,Xv),n=Array.isArray(r)?r.join(Py):r;if(!n)return e;const i={};return n.length===0||(n.split(Py).forEach(s=>{const l=Lcu(s);if(l){const c={value:l.value};l.metadata&&(c.metadata=l.metadata),i[l.key]=c}}),Object.entries(i).length===0)?e:cd.setBaggage(e,cd.createBaggage(i))}fields(){return[Xv]}}function hx(u){const e={};if(typeof u!="object"||u==null)return e;for(const[a,t]of Object.entries(u)){if(!Kcu(a)){Gu.warn(`Invalid attribute key: ${a}`);continue}if(!mJ(t)){Gu.warn(`Invalid attribute value set for key: ${a}`);continue}Array.isArray(t)?e[a]=t.slice():e[a]=t}return e}function Kcu(u){return typeof u=="string"&&u.length>0}function mJ(u){return u==null?!0:Array.isArray(u)?Vcu(u):hJ(u)}function Vcu(u){let e;for(const a of u)if(a!=null){if(!e){if(hJ(a)){e=typeof a;continue}return!1}if(typeof a!==e)return!1}return!0}function hJ(u){switch(typeof u){case"number":case"boolean":case"string":return!0}return!1}function Gcu(){return u=>{Gu.error(Hcu(u))}}function Hcu(u){return typeof u=="string"?u:JSON.stringify(qcu(u))}function qcu(u){const e={};let a=u;for(;a!==null;)Object.getOwnPropertyNames(a).forEach(t=>{if(e[t])return;const r=a[t];r&&(e[t]=String(r))}),a=Object.getPrototypeOf(a);return e}let Wcu=Gcu();function H1(u){try{Wcu(u)}catch{}}const v1=performance,Jcu="2.0.1",ek="exception.message",Ucu="exception.stacktrace",uk="exception.type",xJ="service.name",Zcu="service.version",jy="telemetry.sdk.language",Qcu="webjs",My="telemetry.sdk.name",Ty="telemetry.sdk.version",Ycu="process.runtime.name",ak={[My]:"opentelemetry",[Ycu]:"browser",[jy]:Qcu,[Ty]:Jcu};const Xcu=9,e4u=6,u4u=Math.pow(10,e4u),K5=Math.pow(10,Xcu);function c1(u){const e=u/1e3,a=Math.trunc(e),t=Math.round(u%1e3*u4u);return[a,t]}function DJ(){let u=v1.timeOrigin;if(typeof u!="number"){const e=v1;u=e.timing&&e.timing.fetchStart}return u}function a4u(u){const e=c1(DJ()),a=c1(typeof u=="number"?u:v1.now());return gJ(e,a)}function t4u(u,e){let a=e[0]-u[0],t=e[1]-u[1];return t<0&&(a-=1,t+=K5),[a,t]}function r4u(u){return u[0]*K5+u[1]}function fJ(u){return Array.isArray(u)&&u.length===2&&typeof u[0]=="number"&&typeof u[1]=="number"}function Aj(u){return fJ(u)||typeof u=="number"||u instanceof Date}function gJ(u,e){const a=[u[0]+e[0],u[1]+e[1]];return a[1]>=K5&&(a[1]-=K5,a[0]+=1),a}var Zr;(function(u){u[u.SUCCESS=0]="SUCCESS",u[u.FAILED=1]="FAILED"})(Zr||(Zr={}));class n4u{_propagators;_fields;constructor(e={}){this._propagators=e.propagators??[],this._fields=Array.from(new Set(this._propagators.map(a=>typeof a.fields=="function"?a.fields():[]).reduce((a,t)=>a.concat(t),[])))}inject(e,a,t){for(const r of this._propagators)try{r.inject(e,a,t)}catch(n){Gu.warn(`Failed to inject with ${r.constructor.name}. Err: ${n.message}`)}}extract(e,a,t){return this._propagators.reduce((r,n)=>{try{return n.extract(r,a,t)}catch(i){Gu.warn(`Failed to extract with ${n.constructor.name}. Err: ${i.message}`)}return r},e)}fields(){return this._fields.slice()}}const $y="[_0-9a-z-*/]",i4u=`[a-z]${$y}{0,255}`,o4u=`[a-z0-9]${$y}{0,240}@[a-z]${$y}{0,13}`,s4u=new RegExp(`^(?:${i4u}|${o4u})$`),l4u=/^[ -~]{0,255}[!-~]$/,c4u=/,|=/;function d4u(u){return s4u.test(u)}function E4u(u){return l4u.test(u)&&!c4u.test(u)}const Bj=32,p4u=512,Sj=",",zj="=";class sA{_internalState=new Map;constructor(e){e&&this._parse(e)}set(e,a){const t=this._clone();return t._internalState.has(e)&&t._internalState.delete(e),t._internalState.set(e,a),t}unset(e){const a=this._clone();return a._internalState.delete(e),a}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,a)=>(e.push(a+zj+this.get(a)),e),[]).join(Sj)}_parse(e){e.length>p4u||(this._internalState=e.split(Sj).reverse().reduce((a,t)=>{const r=t.trim(),n=r.indexOf(zj);if(n!==-1){const i=r.slice(0,n),o=r.slice(n+1,t.length);d4u(i)&&E4u(o)&&a.set(i,o)}return a},new Map),this._internalState.size>Bj&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,Bj))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){const e=new sA;return e._internalState=new Map(this._internalState),e}}const tk="traceparent",rk="tracestate",m4u="00",h4u="(?!ff)[\\da-f]{2}",x4u="(?![0]{32})[\\da-f]{32}",D4u="(?![0]{16})[\\da-f]{16}",f4u="[\\da-f]{2}",g4u=new RegExp(`^\\s?(${h4u})-(${x4u})-(${D4u})-(${f4u})(-.*)?\\s?$`);function v4u(u){const e=g4u.exec(u);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}class k4u{inject(e,a,t){const r=Ot.getSpanContext(e);if(!r||oA(e)||!eg(r))return;const n=`${m4u}-${r.traceId}-${r.spanId}-0${Number(r.traceFlags||fi.NONE).toString(16)}`;t.set(a,tk,n),r.traceState&&t.set(a,rk,r.traceState.serialize())}extract(e,a,t){const r=t.get(a,tk);if(!r)return e;const n=Array.isArray(r)?r[0]:r;if(typeof n!="string")return e;const i=v4u(n);if(!i)return e;i.isRemote=!0;const o=t.get(a,rk);if(o){const s=Array.isArray(o)?o.join(","):o;i.traceState=new sA(typeof s=="string"?s:void 0)}return Ot.setSpanContext(e,i)}fields(){return[tk,rk]}}const b4u="[object Object]",y4u="[object Null]",C4u="[object Undefined]",F4u=Function.prototype,vJ=F4u.toString,A4u=vJ.call(Object),B4u=Object.getPrototypeOf,kJ=Object.prototype,bJ=kJ.hasOwnProperty,ms=Symbol?Symbol.toStringTag:void 0,yJ=kJ.toString;function wj(u){if(!S4u(u)||z4u(u)!==b4u)return!1;const e=B4u(u);if(e===null)return!0;const a=bJ.call(e,"constructor")&&e.constructor;return typeof a=="function"&&a instanceof a&&vJ.call(a)===A4u}function S4u(u){return u!=null&&typeof u=="object"}function z4u(u){return u==null?u===void 0?C4u:y4u:ms&&ms in Object(u)?w4u(u):O4u(u)}function w4u(u){const e=bJ.call(u,ms),a=u[ms];let t=!1;try{u[ms]=void 0,t=!0}catch{}const r=yJ.call(u);return t&&(e?u[ms]=a:delete u[ms]),r}function O4u(u){return yJ.call(u)}const P4u=20;function j4u(...u){let e=u.shift();const a=new WeakMap;for(;u.length>0;)e=CJ(e,u.shift(),0,a);return e}function nk(u){return V5(u)?u.slice():u}function CJ(u,e,a=0,t){let r;if(!(a>P4u)){if(a++,xx(u)||xx(e)||FJ(e))r=nk(e);else if(V5(u)){if(r=u.slice(),V5(e))for(let n=0,i=e.length;n<i;n++)r.push(nk(e[n]));else if(g4(e)){const n=Object.keys(e);for(let i=0,o=n.length;i<o;i++){const s=n[i];r[s]=nk(e[s])}}}else if(g4(u))if(g4(e)){if(!M4u(u,e))return e;r=Object.assign({},u);const n=Object.keys(e);for(let i=0,o=n.length;i<o;i++){const s=n[i],l=e[s];if(xx(l))typeof l>"u"?delete r[s]:r[s]=l;else{const c=r[s],d=l;if(Oj(u,s,t)||Oj(e,s,t))delete r[s];else{if(g4(c)&&g4(d)){const E=t.get(c)||[],p=t.get(d)||[];E.push({obj:u,key:s}),p.push({obj:e,key:s}),t.set(c,E),t.set(d,p)}r[s]=CJ(r[s],l,a,t)}}}}else r=e;return r}}function Oj(u,e,a){const t=a.get(u[e])||[];for(let r=0,n=t.length;r<n;r++){const i=t[r];if(i.key===e&&i.obj===u)return!0}return!1}function V5(u){return Array.isArray(u)}function FJ(u){return typeof u=="function"}function g4(u){return!xx(u)&&!V5(u)&&!FJ(u)&&typeof u=="object"}function xx(u){return typeof u=="string"||typeof u=="number"||typeof u=="boolean"||typeof u>"u"||u instanceof Date||u instanceof RegExp||u===null}function M4u(u,e){return!(!wj(u)||!wj(e))}class T4u{_promise;_resolve;_reject;constructor(){this._promise=new Promise((e,a)=>{this._resolve=e,this._reject=a})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}class $4u{_callback;_that;_isCalled=!1;_deferred=new T4u;constructor(e,a){this._callback=e,this._that=a}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(a=>this._deferred.resolve(a),a=>this._deferred.reject(a))}catch(a){this._deferred.reject(a)}}return this._deferred.promise}}function R4u(){return"unknown_service"}const G4=u=>u!==null&&typeof u=="object"&&typeof u.then=="function";class G5{_rawAttributes;_asyncAttributesPending=!1;_memoizedAttributes;static FromAttributeList(e){const a=new G5({});return a._rawAttributes=Pj(e),a._asyncAttributesPending=e.filter(([t,r])=>G4(r)).length>0,a}constructor(e){const a=e.attributes??{};this._rawAttributes=Object.entries(a).map(([t,r])=>(G4(r)&&(this._asyncAttributesPending=!0),[t,r])),this._rawAttributes=Pj(this._rawAttributes)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let e=0;e<this._rawAttributes.length;e++){const[a,t]=this._rawAttributes[e];this._rawAttributes[e]=[a,G4(t)?await t:t]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&Gu.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;const e={};for(const[a,t]of this._rawAttributes){if(G4(t)){Gu.debug(`Unsettled resource attribute ${a} skipped`);continue}t!=null&&(e[a]??=t)}return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}merge(e){return e==null?this:G5.FromAttributeList([...e.getRawAttributes(),...this.getRawAttributes()])}}function AJ(u){return G5.FromAttributeList(Object.entries(u))}function N4u(){return AJ({[xJ]:R4u(),[jy]:ak[jy],[My]:ak[My],[Ty]:ak[Ty]})}function Pj(u){return u.map(([e,a])=>G4(a)?[e,a.catch(t=>{Gu.debug("promise rejection for resource attribute: %s - %s",e,t)})]:[e,a])}const _4u="exception";class L4u{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;name;status={code:Vd.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(e){const a=Date.now();this._spanContext=e.spanContext,this._performanceStartTime=v1.now(),this._performanceOffset=a-(this._performanceStartTime+DJ()),this._startTimeProvided=e.startTime!=null,this._spanLimits=e.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit||0,this._spanProcessor=e.spanProcessor,this.name=e.name,this.parentSpanContext=e.parentSpanContext,this.kind=e.kind,this.links=e.links||[],this.startTime=this._getTime(e.startTime??a),this.resource=e.resource,this.instrumentationScope=e.scope,e.attributes!=null&&this.setAttributes(e.attributes),this._spanProcessor.onStart(this,e.context)}spanContext(){return this._spanContext}setAttribute(e,a){if(a==null||this._isSpanEnded())return this;if(e.length===0)return Gu.warn(`Invalid attribute key: ${e}`),this;if(!mJ(a))return Gu.warn(`Invalid attribute value set for key: ${e}`),this;const{attributeCountLimit:t}=this._spanLimits;return t!==void 0&&Object.keys(this.attributes).length>=t&&!Object.prototype.hasOwnProperty.call(this.attributes,e)?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(a),this)}setAttributes(e){for(const[a,t]of Object.entries(e))this.setAttribute(a,t);return this}addEvent(e,a,t){if(this._isSpanEnded())return this;const{eventCountLimit:r}=this._spanLimits;if(r===0)return Gu.warn("No events allowed."),this._droppedEventsCount++,this;r!==void 0&&this.events.length>=r&&(this._droppedEventsCount===0&&Gu.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),Aj(a)&&(Aj(t)||(t=a),a=void 0);const n=hx(a);return this.events.push({name:e,attributes:n,time:this._getTime(t),droppedAttributesCount:0}),this}addLink(e){return this.links.push(e),this}addLinks(e){return this.links.push(...e),this}setStatus(e){return this._isSpanEnded()?this:(this.status={...e},this.status.message!=null&&typeof e.message!="string"&&(Gu.warn(`Dropping invalid status.message of type '${typeof e.message}', expected 'string'`),delete this.status.message),this)}updateName(e){return this._isSpanEnded()?this:(this.name=e,this)}end(e){if(this._isSpanEnded()){Gu.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this._ended=!0,this.endTime=this._getTime(e),this._duration=t4u(this.startTime,this.endTime),this._duration[0]<0&&(Gu.warn("Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.",this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount>0&&Gu.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._spanProcessor.onEnd(this)}_getTime(e){if(typeof e=="number"&&e<=v1.now())return a4u(e+this._performanceOffset);if(typeof e=="number")return c1(e);if(e instanceof Date)return c1(e.getTime());if(fJ(e))return e;if(this._startTimeProvided)return c1(Date.now());const a=v1.now()-this._performanceStartTime;return gJ(this.startTime,c1(a))}isRecording(){return this._ended===!1}recordException(e,a){const t={};typeof e=="string"?t[ek]=e:e&&(e.code?t[uk]=e.code.toString():e.name&&(t[uk]=e.name),e.message&&(t[ek]=e.message),e.stack&&(t[Ucu]=e.stack)),t[uk]||t[ek]?this.addEvent(_4u,t,a):Gu.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){const e=new Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);Gu.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,e)}return this._ended}_truncateToLimitUtil(e,a){return e.length<=a?e:e.substring(0,a)}_truncateToSize(e){const a=this._attributeValueLengthLimit;return a<=0?(Gu.warn(`Attribute value limit must be positive, got ${a}`),e):typeof e=="string"?this._truncateToLimitUtil(e,a):Array.isArray(e)?e.map(t=>typeof t=="string"?this._truncateToLimitUtil(t,a):t):e}}var q1;(function(u){u[u.NOT_RECORD=0]="NOT_RECORD",u[u.RECORD=1]="RECORD",u[u.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(q1||(q1={}));class H5{shouldSample(){return{decision:q1.NOT_RECORD}}toString(){return"AlwaysOffSampler"}}class k1{shouldSample(){return{decision:q1.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}}class sh{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(e){this._root=e.root,this._root||(H1(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new k1),this._remoteParentSampled=e.remoteParentSampled??new k1,this._remoteParentNotSampled=e.remoteParentNotSampled??new H5,this._localParentSampled=e.localParentSampled??new k1,this._localParentNotSampled=e.localParentNotSampled??new H5}shouldSample(e,a,t,r,n,i){const o=Ot.getSpanContext(e);return!o||!eg(o)?this._root.shouldSample(e,a,t,r,n,i):o.isRemote?o.traceFlags&fi.SAMPLED?this._remoteParentSampled.shouldSample(e,a,t,r,n,i):this._remoteParentNotSampled.shouldSample(e,a,t,r,n,i):o.traceFlags&fi.SAMPLED?this._localParentSampled.shouldSample(e,a,t,r,n,i):this._localParentNotSampled.shouldSample(e,a,t,r,n,i)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}class jj{_ratio;_upperBound;constructor(e=0){this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,a){return{decision:cJ(a)&&this._accumulate(a)<this._upperBound?q1.RECORD_AND_SAMPLED:q1.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!="number"||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let a=0;for(let t=0;t<e.length/8;t++){const r=t*8,n=parseInt(e.slice(r,r+8),16);a=(a^n)>>>0}return a}}const Mj=1;function BJ(){return{sampler:SJ(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},spanLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128,linkCountLimit:128,eventCountLimit:128,attributePerEventCountLimit:128,attributePerLinkCountLimit:128}}}function SJ(){const u="parentbased_always_on";switch(u){case"always_on":return new k1;case"always_off":return new H5;case"parentbased_always_on":return new sh({root:new k1});case"parentbased_always_off":return new sh({root:new H5});case"traceidratio":return new jj(Tj());case"parentbased_traceidratio":return new sh({root:new jj(Tj())});default:return Gu.error(`OTEL_TRACES_SAMPLER value "${u}" invalid, defaulting to "parentbased_always_on".`),new sh({root:new k1})}}function Tj(){return Gu.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${Mj}.`),Mj}const I4u=128,K4u=1/0;function V4u(u){const e={sampler:SJ()},a=BJ(),t=Object.assign({},a,e,u);return t.generalLimits=Object.assign({},a.generalLimits,u.generalLimits||{}),t.spanLimits=Object.assign({},a.spanLimits,u.spanLimits||{}),t}function G4u(u){const e=Object.assign({},u.spanLimits);return e.attributeCountLimit=u.spanLimits?.attributeCountLimit??u.generalLimits?.attributeCountLimit??void 0??void 0??I4u,e.attributeValueLengthLimit=u.spanLimits?.attributeValueLengthLimit??u.generalLimits?.attributeValueLengthLimit??void 0??void 0??K4u,Object.assign({},u,{spanLimits:e})}class H4u{_exporter;_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_isExporting=!1;_finishedSpans=[];_timer;_shutdownOnce;_droppedSpansCount=0;constructor(e,a){this._exporter=e,this._maxExportBatchSize=typeof a?.maxExportBatchSize=="number"?a.maxExportBatchSize:512,this._maxQueueSize=typeof a?.maxQueueSize=="number"?a.maxQueueSize:2048,this._scheduledDelayMillis=typeof a?.scheduledDelayMillis=="number"?a.scheduledDelayMillis:5e3,this._exportTimeoutMillis=typeof a?.exportTimeoutMillis=="number"?a.exportTimeoutMillis:3e4,this._shutdownOnce=new $4u(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(Gu.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,a){}onEnd(e){this._shutdownOnce.isCalled||(e.spanContext().traceFlags&fi.SAMPLED)!==0&&this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(e){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&Gu.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(Gu.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,a)=>{const t=[],r=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let n=0,i=r;n<i;n++)t.push(this._flushOneBatch());Promise.all(t).then(()=>{e()}).catch(a)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((e,a)=>{const t=setTimeout(()=>{a(new Error("Timeout"))},this._exportTimeoutMillis);si.with(jcu(si.active()),()=>{let r;this._finishedSpans.length<=this._maxExportBatchSize?(r=this._finishedSpans,this._finishedSpans=[]):r=this._finishedSpans.splice(0,this._maxExportBatchSize);const n=()=>this._exporter.export(r,o=>{clearTimeout(t),o.code===Zr.SUCCESS?e():a(o.error??new Error("BatchSpanProcessor: span export failed"))});let i=null;for(let o=0,s=r.length;o<s;o++){const l=r[o];l.resource.asyncAttributesPending&&l.resource.waitForAsyncAttributes&&(i??=[],i.push(l.resource.waitForAsyncAttributes()))}i===null?n():Promise.all(i).then(n,o=>{H1(o),a(o)})})})}_maybeStartTimer(){if(this._isExporting)return;const e=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(a=>{this._isExporting=!1,H1(a)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();this._timer===void 0&&(this._timer=setTimeout(()=>e(),this._scheduledDelayMillis),this._timer,void 0)}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}}class q4u extends H4u{_visibilityChangeListener;_pageHideListener;constructor(e,a){super(e,a),this.onInit(a)}onInit(e){e?.disableAutoFlushOnDocumentHide!==!0&&typeof document<"u"&&(this._visibilityChangeListener=()=>{document.visibilityState==="hidden"&&this.forceFlush().catch(a=>{H1(a)})},this._pageHideListener=()=>{this.forceFlush().catch(a=>{H1(a)})},document.addEventListener("visibilitychange",this._visibilityChangeListener),document.addEventListener("pagehide",this._pageHideListener))}onShutdown(){typeof document<"u"&&(this._visibilityChangeListener&&document.removeEventListener("visibilitychange",this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener("pagehide",this._pageHideListener))}}const W4u=8,J4u=16;class U4u{generateTraceId=$j(J4u);generateSpanId=$j(W4u)}const lh=Array(32);function $j(u){return function(){for(let a=0;a<u*2;a++)lh[a]=Math.floor(Math.random()*16)+48,lh[a]>=58&&(lh[a]+=39);return String.fromCharCode.apply(null,lh.slice(0,u*2))}}class Z4u{_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;constructor(e,a,t,r){const n=V4u(a);this._sampler=n.sampler,this._generalLimits=n.generalLimits,this._spanLimits=n.spanLimits,this._idGenerator=a.idGenerator||new U4u,this._resource=t,this._spanProcessor=r,this.instrumentationScope=e}startSpan(e,a={},t=si.active()){a.root&&(t=Ot.deleteSpan(t));const r=Ot.getSpan(t);if(oA(t))return Gu.debug("Instrumentation suppressed, returning Noop Span"),Ot.wrapSpanContext(sJ);const n=r?.spanContext(),i=this._idGenerator.generateSpanId();let o,s,l;!n||!Ot.isSpanContextValid(n)?s=this._idGenerator.generateTraceId():(s=n.traceId,l=n.traceState,o=n);const c=a.kind??wy.INTERNAL,d=(a.links??[]).map(f=>({context:f.context,attributes:hx(f.attributes)})),E=hx(a.attributes),p=this._sampler.shouldSample(t,s,e,c,E,d);l=p.traceState??l;const x=p.decision===I5.RECORD_AND_SAMPLED?fi.SAMPLED:fi.NONE,m={traceId:s,spanId:i,traceFlags:x,traceState:l};if(p.decision===I5.NOT_RECORD)return Gu.debug("Recording is off, propagating context in a non-recording span"),Ot.wrapSpanContext(m);const g=hx(Object.assign(E,p.attributes));return new L4u({resource:this._resource,scope:this.instrumentationScope,context:t,spanContext:m,name:e,kind:c,links:d,parentSpanContext:o,attributes:g,startTime:a.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits})}startActiveSpan(e,a,t,r){let n,i,o;if(arguments.length<2)return;arguments.length===2?o=a:arguments.length===3?(n=a,o=t):(n=a,i=t,o=r);const s=i??si.active(),l=this.startSpan(e,n,s),c=Ot.setSpan(s,l);return si.with(c,o,void 0,l)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}}class Q4u{_spanProcessors;constructor(e){this._spanProcessors=e}forceFlush(){const e=[];for(const a of this._spanProcessors)e.push(a.forceFlush());return new Promise(a=>{Promise.all(e).then(()=>{a()}).catch(t=>{H1(t||new Error("MultiSpanProcessor: forceFlush failed")),a()})})}onStart(e,a){for(const t of this._spanProcessors)t.onStart(e,a)}onEnd(e){for(const a of this._spanProcessors)a.onEnd(e)}shutdown(){const e=[];for(const a of this._spanProcessors)e.push(a.shutdown());return new Promise((a,t)=>{Promise.all(e).then(()=>{a()},t)})}}var hs;(function(u){u[u.resolved=0]="resolved",u[u.timeout=1]="timeout",u[u.error=2]="error",u[u.unresolved=3]="unresolved"})(hs||(hs={}));class Y4u{_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(e={}){const a=j4u({},BJ(),G4u(e));this._resource=a.resource??N4u(),this._config=Object.assign({},a,{resource:this._resource});const t=[];e.spanProcessors?.length&&t.push(...e.spanProcessors),this._activeSpanProcessor=new Q4u(t)}getTracer(e,a,t){const r=`${e}@${a||""}:${t?.schemaUrl||""}`;return this._tracers.has(r)||this._tracers.set(r,new Z4u({name:e,version:a,schemaUrl:t?.schemaUrl},this._config,this._resource,this._activeSpanProcessor)),this._tracers.get(r)}forceFlush(){const e=this._config.forceFlushTimeoutMillis,a=this._activeSpanProcessor._spanProcessors.map(t=>new Promise(r=>{let n;const i=setTimeout(()=>{r(new Error(`Span processor did not completed within timeout period of ${e} ms`)),n=hs.timeout},e);t.forceFlush().then(()=>{clearTimeout(i),n!==hs.timeout&&(n=hs.resolved,r(n))}).catch(o=>{clearTimeout(i),n=hs.error,r(o)})}));return new Promise((t,r)=>{Promise.all(a).then(n=>{const i=n.filter(o=>o!==hs.resolved);i.length>0?r(i):t()}).catch(n=>r([n]))})}shutdown(){return this._activeSpanProcessor.shutdown()}}class X4u{_enabled=!1;_currentContext=u1;_bindFunction(e=u1,a){const t=this,r=function(...n){return t.with(e,()=>a.apply(this,n))};return Object.defineProperty(r,"length",{enumerable:!1,configurable:!0,writable:!1,value:a.length}),r}active(){return this._currentContext}bind(e,a){return e===void 0&&(e=this.active()),typeof a=="function"?this._bindFunction(e,a):a}disable(){return this._currentContext=u1,this._enabled=!1,this}enable(){return this._enabled?this:(this._enabled=!0,this._currentContext=u1,this)}with(e,a,t,...r){const n=this._currentContext;this._currentContext=e||u1;try{return a.call(t,...r)}finally{this._currentContext=n}}}function edu(u){if(u!==null){if(u===void 0){const e=new X4u;e.enable(),si.setGlobalContextManager(e);return}u.enable(),si.setGlobalContextManager(u)}}function udu(u){if(u!==null){if(u===void 0){cd.setGlobalPropagator(new n4u({propagators:[new k4u,new Icu]}));return}cd.setGlobalPropagator(u)}}class adu extends Y4u{constructor(e={}){super(e)}register(e={}){Ot.setGlobalTracerProvider(this),udu(e.propagator),edu(e.contextManager)}}class tdu{_delegate;constructor(e){this._delegate=e}export(e,a){this._delegate.export(e,a)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}}class Rj extends Error{code;name="OTLPExporterError";data;constructor(e,a,t){super(e),this.data=t,this.code=a}}function rdu(u){if(Number.isFinite(u)&&u>0)return u;throw new Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${u}')`)}function ndu(u){if(u!=null)return()=>u}function idu(u,e,a){return{timeoutMillis:rdu(u.timeoutMillis??e.timeoutMillis??a.timeoutMillis),concurrencyLimit:u.concurrencyLimit??e.concurrencyLimit??a.concurrencyLimit,compression:u.compression??e.compression??a.compression}}function odu(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:"none"}}class sdu{_concurrencyLimit;_sendingPromises=[];constructor(e){this._concurrencyLimit=e}pushPromise(e){if(this.hasReachedLimit())throw new Error("Concurrency Limit reached");this._sendingPromises.push(e);const a=()=>{const t=this._sendingPromises.indexOf(e);this._sendingPromises.splice(t,1)};e.then(a,a)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}async awaitAll(){await Promise.all(this._sendingPromises)}}function ldu(u){return new sdu(u.concurrencyLimit)}function cdu(u){return Object.prototype.hasOwnProperty.call(u,"partialSuccess")}function ddu(){return{handleResponse(u){u==null||!cdu(u)||u.partialSuccess==null||Object.keys(u.partialSuccess).length===0||Gu.warn("Received Partial Success response:",JSON.stringify(u.partialSuccess))}}}class Edu{_transport;_serializer;_responseHandler;_promiseQueue;_timeout;_diagLogger;constructor(e,a,t,r,n){this._transport=e,this._serializer=a,this._responseHandler=t,this._promiseQueue=r,this._timeout=n,this._diagLogger=Gu.createComponentLogger({namespace:"OTLPExportDelegate"})}export(e,a){if(this._diagLogger.debug("items to be sent",e),this._promiseQueue.hasReachedLimit()){a({code:Zr.FAILED,error:new Error("Concurrent export limit reached")});return}const t=this._serializer.serializeRequest(e);if(t==null){a({code:Zr.FAILED,error:new Error("Nothing to send")});return}this._promiseQueue.pushPromise(this._transport.send(t,this._timeout).then(r=>{if(r.status==="success"){if(r.data!=null)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(r.data))}catch(n){this._diagLogger.warn("Export succeeded but could not deserialize response - is the response specification compliant?",n,r.data)}a({code:Zr.SUCCESS});return}else if(r.status==="failure"&&r.error){a({code:Zr.FAILED,error:r.error});return}else r.status==="retryable"?a({code:Zr.FAILED,error:new Rj("Export failed with retryable status")}):a({code:Zr.FAILED,error:new Rj("Export failed with unknown error")})},r=>a({code:Zr.FAILED,error:r})))}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug("shutdown started"),await this.forceFlush(),this._transport.shutdown()}}function pdu(u,e){return new Edu(u.transport,u.serializer,ddu(),u.promiseHandler,e.timeout)}function zJ(u,e,a){return pdu({transport:a,serializer:e,promiseHandler:ldu(u)},{timeout:u.timeoutMillis})}function Nj(u){return u>=48&&u<=57?u-48:u>=97&&u<=102?u-87:u-55}function wJ(u){const e=new Uint8Array(u.length/2);let a=0;for(let t=0;t<u.length;t+=2){const r=Nj(u.charCodeAt(t)),n=Nj(u.charCodeAt(t+1));e[a++]=r<<4|n}return e}function OJ(u){const e=BigInt(1e9);return BigInt(u[0])*e+BigInt(u[1])}function mdu(u){const e=Number(BigInt.asUintN(32,u)),a=Number(BigInt.asUintN(32,u>>BigInt(32)));return{low:e,high:a}}function hdu(u){const e=OJ(u);return mdu(e)}function xdu(u){return OJ(u).toString()}const Ddu=typeof BigInt<"u"?xdu:r4u;function _j(u){return u}function fdu(u){if(u!==void 0)return wJ(u)}const gdu={encodeHrTime:hdu,encodeSpanContext:wJ,encodeOptionalSpanContext:fdu};function vdu(u){return u===void 0?gdu:{encodeHrTime:Ddu,encodeSpanContext:_j,encodeOptionalSpanContext:_j}}function kdu(u){return{attributes:ug(u.attributes),droppedAttributesCount:0}}function bdu(u){return{name:u.name,version:u.version}}function ug(u){return Object.keys(u).map(e=>PJ(e,u[e]))}function PJ(u,e){return{key:u,value:jJ(e)}}function jJ(u){const e=typeof u;return e==="string"?{stringValue:u}:e==="number"?Number.isInteger(u)?{intValue:u}:{doubleValue:u}:e==="boolean"?{boolValue:u}:u instanceof Uint8Array?{bytesValue:u}:Array.isArray(u)?{arrayValue:{values:u.map(jJ)}}:e==="object"&&u!=null?{kvlistValue:{values:Object.entries(u).map(([a,t])=>PJ(a,t))}}:{}}function ydu(u,e){const a=u.spanContext(),t=u.status,r=u.parentSpanContext?.spanId?e.encodeSpanContext(u.parentSpanContext?.spanId):void 0;return{traceId:e.encodeSpanContext(a.traceId),spanId:e.encodeSpanContext(a.spanId),parentSpanId:r,traceState:a.traceState?.serialize(),name:u.name,kind:u.kind==null?0:u.kind+1,startTimeUnixNano:e.encodeHrTime(u.startTime),endTimeUnixNano:e.encodeHrTime(u.endTime),attributes:ug(u.attributes),droppedAttributesCount:u.droppedAttributesCount,events:u.events.map(n=>Fdu(n,e)),droppedEventsCount:u.droppedEventsCount,status:{code:t.code,message:t.message},links:u.links.map(n=>Cdu(n,e)),droppedLinksCount:u.droppedLinksCount}}function Cdu(u,e){return{attributes:u.attributes?ug(u.attributes):[],spanId:e.encodeSpanContext(u.context.spanId),traceId:e.encodeSpanContext(u.context.traceId),traceState:u.context.traceState?.serialize(),droppedAttributesCount:u.droppedAttributesCount||0}}function Fdu(u,e){return{attributes:u.attributes?ug(u.attributes):[],name:u.name,timeUnixNano:e.encodeHrTime(u.time),droppedAttributesCount:u.droppedAttributesCount||0}}function Adu(u,e){const a=vdu(e);return{resourceSpans:Sdu(u,a)}}function Bdu(u){const e=new Map;for(const a of u){let t=e.get(a.resource);t||(t=new Map,e.set(a.resource,t));const r=`${a.instrumentationScope.name}@${a.instrumentationScope.version||""}:${a.instrumentationScope.schemaUrl||""}`;let n=t.get(r);n||(n=[],t.set(r,n)),n.push(a)}return e}function Sdu(u,e){const a=Bdu(u),t=[],r=a.entries();let n=r.next();for(;!n.done;){const[i,o]=n.value,s=[],l=o.values();let c=l.next();for(;!c.done;){const E=c.value;if(E.length>0){const p=E.map(x=>ydu(x,e));s.push({scope:bdu(E[0].instrumentationScope),spans:p,schemaUrl:E[0].instrumentationScope.schemaUrl})}c=l.next()}const d={resource:kdu(i),scopeSpans:s,schemaUrl:void 0};t.push(d),n=r.next()}return t}const zdu={serializeRequest:u=>{const e=Adu(u,{});return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:u=>{if(u.length===0)return{};const e=new TextDecoder;return JSON.parse(e.decode(u))}},wdu=5,Odu=1e3,Pdu=5e3,jdu=1.5,Lj=.2;function Mdu(){return Math.random()*(2*Lj)-Lj}class Tdu{_transport;constructor(e){this._transport=e}retry(e,a,t){return new Promise((r,n)=>{setTimeout(()=>{this._transport.send(e,a).then(r,n)},t)})}async send(e,a){const t=Date.now()+a;let r=await this._transport.send(e,a),n=wdu,i=Odu;for(;r.status==="retryable"&&n>0;){n--;const o=Math.max(Math.min(i,Pdu)+Mdu(),0);i=i*jdu;const s=r.retryInMillis??o,l=t-Date.now();if(s>l)return r;r=await this.retry(e,l,s)}return r}shutdown(){return this._transport.shutdown()}}function MJ(u){return new Tdu(u.transport)}function $du(u){return[429,502,503,504].includes(u)}function Rdu(u){if(u==null)return;const e=Number.parseInt(u,10);if(Number.isInteger(e))return e>0?e*1e3:-1;const a=new Date(u).getTime()-Date.now();return a>=0?a:0}class Ndu{_parameters;constructor(e){this._parameters=e}send(e,a){return new Promise(t=>{const r=new XMLHttpRequest;r.timeout=a,r.open("POST",this._parameters.url);const n=this._parameters.headers();Object.entries(n).forEach(([i,o])=>{r.setRequestHeader(i,o)}),r.ontimeout=i=>{t({status:"failure",error:new Error("XHR request timed out")})},r.onreadystatechange=()=>{r.status>=200&&r.status<=299?(Gu.debug("XHR success"),t({status:"success"})):r.status&&$du(r.status)?t({status:"retryable",retryInMillis:Rdu(r.getResponseHeader("Retry-After"))}):r.status!==0&&t({status:"failure",error:new Error("XHR request failed with non-retryable status")})},r.onabort=()=>{t({status:"failure",error:new Error("XHR request aborted")})},r.onerror=()=>{t({status:"failure",error:new Error("XHR request errored")})},r.send(e)})}shutdown(){}}function _du(u){return new Ndu(u)}class Ldu{_params;constructor(e){this._params=e}send(e){return new Promise(a=>{navigator.sendBeacon(this._params.url,new Blob([e],{type:this._params.blobType}))?(Gu.debug("SendBeacon success"),a({status:"success"})):a({status:"failure",error:new Error("SendBeacon failed")})})}shutdown(){}}function Idu(u){return new Ldu(u)}function Kdu(u,e){return zJ(u,e,MJ({transport:_du(u)}))}function Vdu(u,e){return zJ(u,e,MJ({transport:Idu({url:u.url,blobType:u.headers()["Content-Type"]})}))}function Gdu(u){return()=>{const e={};return Object.entries(u?.()??{}).forEach(([a,t])=>{typeof t<"u"?e[a]=String(t):Gu.warn(`Header "${a}" has invalid value (${t}) and will be ignored`)}),e}}function Hdu(u,e,a){const t={...a()},r={};return()=>(e!=null&&Object.assign(r,e()),u!=null&&Object.assign(r,u()),Object.assign(r,t))}function qdu(u){if(u!=null)try{return new URL(u),u}catch{throw new Error(`Configuration: Could not parse user-provided export URL: '${u}'`)}}function Wdu(u,e,a){return{...idu(u,e,a),headers:Hdu(Gdu(u.headers),e.headers,a.headers),url:qdu(u.url)??e.url??a.url,agentOptions:u.agentOptions??e.agentOptions??a.agentOptions}}function Jdu(u,e){return{...odu(),headers:()=>u,url:"http://localhost:4318/"+e,agentOptions:{keepAlive:!0}}}function Udu(u,e,a){return Wdu({url:u.url,timeoutMillis:u.timeoutMillis,headers:ndu(u.headers),concurrencyLimit:u.concurrencyLimit},{},Jdu(a,e))}function Zdu(u,e,a,t){const r=!!u.headers||typeof navigator.sendBeacon!="function",n=Udu(u,a,t);return r?Kdu(n,e):Vdu(n,e)}class Qdu extends tdu{constructor(e={}){super(Zdu(e,zdu,"v1/traces",{"Content-Type":"application/json"}))}}class TJ{emit(e){}}const Ydu=new TJ;class Xdu{getLogger(e,a,t){return new TJ}}const $J=new Xdu;class eEu{constructor(e,a,t,r){this._provider=e,this.name=a,this.version=t,this.options=r}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;const e=this._provider.getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):Ydu}}class Ij{getLogger(e,a,t){var r;return(r=this.getDelegateLogger(e,a,t))!==null&&r!==void 0?r:new eEu(this,e,a,t)}getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:$J}setDelegate(e){this._delegate=e}getDelegateLogger(e,a,t){var r;return(r=this._delegate)===null||r===void 0?void 0:r.getLogger(e,a,t)}}const uEu=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{},ch=Symbol.for("io.opentelemetry.js.api.logs"),v4=uEu;function aEu(u,e,a){return t=>t===u?e:a}const Kj=1;class lA{constructor(){this._proxyLoggerProvider=new Ij}static getInstance(){return this._instance||(this._instance=new lA),this._instance}setGlobalLoggerProvider(e){return v4[ch]?this.getLoggerProvider():(v4[ch]=aEu(Kj,e,$J),this._proxyLoggerProvider.setDelegate(e),e)}getLoggerProvider(){var e,a;return(a=(e=v4[ch])===null||e===void 0?void 0:e.call(v4,Kj))!==null&&a!==void 0?a:this._proxyLoggerProvider}getLogger(e,a,t){return this.getLoggerProvider().getLogger(e,a,t)}disable(){delete v4[ch],this._proxyLoggerProvider=new Ij}}const tEu=lA.getInstance();function rEu(u,e,a,t){for(let r=0,n=u.length;r<n;r++){const i=u[r];e&&i.setTracerProvider(e),a&&i.setMeterProvider(a),t&&i.setLoggerProvider&&i.setLoggerProvider(t),i.getConfig().enabled||i.enable()}}function nEu(u){u.forEach(e=>e.disable())}function iEu(u){const e=u.tracerProvider||Ot.getTracerProvider(),a=u.meterProvider||Fcu.getMeterProvider(),t=u.loggerProvider||tEu.getLoggerProvider(),r=u.instrumentations?.flat()??[];return rEu(r,e,a,t),()=>{nEu(r)}}class oEu{span=void 0;constructor(e){this.span=e}get context(){return this.span?.context}error(e){this.span&&(this.span.setStatus(Vd.ERROR,e.message),this.span.recordException(e),this.span.end())}setAttribute(e,a){this.span&&this.span.setAttribute(e,a)}end(){this.span&&(this.span.setStatus(Vd.OK),this.span.end())}}class sEu{config=null;tracer=null;tracerProvider=null;initialized=!1;initTracer(e){throw new Error("initTracer must be implemented by the environment-specific client")}init(e){this.config=e,this.initTracer(e)}send(e){try{if(!this.tracer||!this.config)return;const a=e.time?new Date(e.time):new Date;this.tracer.startSpan(`event.${e.type}`,{attributes:this.processAttributes(e,a),startTime:a}).end(a)}catch(a){this.config?.isProd||console.error("Event reporting failed:",a)}}processAttributes(e,a){const r={"cloudevents.event_id":L5(),"cloudevents.event_type":e.type,"cloudevents.event_source":e.source,"cloudevents.event_spec_version":e.specversion,"cloudevents.event_data_content_type":e.datacontenttype||"application/json; charset=utf-8","cloudevents.event_time":a.toISOString(),"cloudevents.event_subject":e.subject??"","cloudevents.page.uri":location.href,"cloudevents.event_version":this.config?.version,"cloudevents.event_origin":this.config?.serviceName,"cloudevents.event_source_details.id":e.sourceDetails?.id??"anonymous","cloudevents.event_source_details.object":e.sourceDetails?.object??"anonymous","cloudevents.event_source_details.uri":e.sourceDetails?.uri};if(e.data&&typeof e.data=="object"&&Object.entries(e.data).forEach(([n,i])=>{const o=n.replace(/([A-Z])/g,"_$1").toLowerCase();i!==void 0&&(r[`cloudevents.event_data.${o}`]=i)}),"subjects"in e&&Array.isArray(e.subjects)){const n=e.subjects.reduce((i,o)=>{if(!o||typeof o!="object")return i;const s=o.object;if(!s||typeof s!="string")return i;const l=i.notUpdated.find(({object:c})=>c===s);return l?(i.updated=[l,o],i.notUpdated=i.notUpdated.filter(({object:c})=>c!==s)):i.updated.some(({object:c})=>c===s)||i.notUpdated.push(o),i},{updated:[],notUpdated:[]});n.updated.forEach((i,o)=>{const s=o===0?"after.":"before.",l=`${i.object}.`;Object.entries(i).forEach(([c,d])=>{d!==void 0&&(r[`cloudevents.subjects.${s}${l}${c}`]=d)})}),n.notUpdated.forEach(i=>{const o=`${i.object}.`;Object.entries(i).forEach(([s,l])=>{l!==void 0&&(r[`cloudevents.subjects.${o}${s}`]=l)})})}return Object.entries(e).forEach(([n,i])=>{["id","source","type","specversion","time","datacontenttype","data","subject","sourceDetails","analyticsMetadata","context"].includes(n)||i!==void 0&&(i instanceof Object?Object.entries(i).forEach(([o,s])=>{s!==void 0&&(r[`cloudevents.${n}.${o}`]=s)}):r[`cloudevents.${n}`]=i)}),r}startSpan(e,a){try{if(!this.tracer)return;let t;const r=e.time?new Date(e.time):new Date,n=this.tracer.startSpan(`event.${e.type}`,{attributes:this.processAttributes(e,r),root:!a},a);return a||(t=Ot.setSpan(si.active(),n)),{end:()=>n.end(),setAttribute:(i,o)=>{n.setAttribute(`cloudevents.event_data.${this.getKeySnakeValue(i)}`,o)},setStatus:(i,o)=>n.setStatus({code:i,message:o}),parentCtx:t}}catch(t){this.config?.isProd||console.error("Event reporting failed:",t)}}startStepSpan(e){try{if(!this.tracer)return;const a=si.active(),t=e.time?new Date(e.time):new Date,r=this.tracer.startSpan(`event.${e.type}`,{attributes:this.processAttributes(e,t)},a),n=Ot.setSpan(a,r);return{end:()=>r.end(),setAttribute:(i,o)=>{r.setAttribute(`cloudevents.event_data.${this.getKeySnakeValue(i)}`,o)},setStatus:(i,o)=>r.setStatus({code:i,message:o}),recordException:i=>r.recordException(i),context:n}}catch(a){this.config?.isProd||console.error("Event reporting failed:",a)}}traceStep(e){const a=this.startStepSpan(e);if(a)return new oEu(a)}async forceFlush(){return this.tracerProvider?.forceFlush()}getKeySnakeValue=e=>e.replace(/([A-Z])/g,"_$1").toLowerCase()}class lEu extends sEu{tracerProvider=null;tracer=null;initialized=!1;constructor(){super()}initTracer(e){if(!e.collectorUrl&&!e.collectorTraceUrl)return;const a=`ses_${L5()}`,t=AJ({[xJ]:e.serviceName,[Zcu]:e.serviceVersion,session_id:a}),r=e.collectorTraceUrl||`${e.collectorUrl}/v1/traces`;this.tracerProvider=new adu({resource:t,spanProcessors:[new q4u(new Qdu({url:r,headers:{}}))]}),this.tracer=this.tracerProvider.getTracer(e.tracerName),this.tracerProvider.register(),iEu({instrumentations:e.instrumentations??[]}),this.initialized=!0}}class cEu{config=null;initialized=!1;useCloudEventData;otelClient;tracer;constructor(){this.useCloudEventData=()=>({organization:{id:"",slug:""},project:{id:"",slug:""},productType:"",sourceDetails:{user:"Anonymous",object:"user",uri:""},request:{source:""}}),this.otelClient=new lEu,this.tracer={traceStep:(e,a)=>{const t=this.constructCloudEvent(e,a);return this.otelClient.traceStep(t)}}}updateCloudEventData=e=>{this.config?.disabled||(this.useCloudEventData=e)};send(e,a){try{if(!this.config?.otel.isProd)return;const t=this.constructCloudEvent(e,a);this.sendToOtelService(t)}catch(t){this.config?.otel.isProd||console.error("Event reporting failed:",t)}}init(e){e.disabled||this.initialized||(this.config=e,this.initialized=!0,this.otelClient.init({serviceVersion:e.otel.serviceVersion,version:e.otel.version,isProd:e.otel.isProd,collectorUrl:e.otel.collectorUrl,collectorTraceUrl:e.otel.collectorTraceUrl,serviceName:e.otel.serviceName,tracerName:e.otel.tracerName,instrumentations:[...e.otel.instrumentations||[]]}))}startSpan(e,a,t){if(this.config?.disabled)return;const r=this.constructCloudEvent(e,a);return this.otelClient.startSpan(r,t)}constructCloudEvent(e,a){const t=this.useCloudEventData();return{id:`evt_${L5()}`,type:e,source:t.request.source||"",specversion:"1.0",datacontenttype:"application/json",time:new Date().toISOString(),data:a,origin:"ui",sourceDetails:{id:t.sourceDetails.user||`usr_${L5()}`,object:t.sourceDetails.object||"user",uri:t.sourceDetails.uri||""},organization:t.organization,project:t.project,productType:t.productType}}sendToOtelService(e){this.config?.otel.isProd||console.log("CloudEvent to be sent to OTEL service:",e),this.otelClient.send(e)}forceFlush(){return this.config?.disabled?Promise.resolve():this.otelClient.forceFlush()}sendTabChangeMessage(e){this.send("tab.change",e)}sendButtonClickMessage(e){this.send("button.click",e)}sendChangeMessage(e){this.send("change",e)}sendContentCopyMessage(e){this.send("content.copy",e)}sendUrlClickMessage(e){this.send("url.click",e)}sendRequestSendMessage(e){this.send("request.send",e)}sendTokenGenerateMessage(e){this.send("token.generate",e)}sendAppLifecycleMessage(e){this.send("app.lifecycle",e)}sendEnvironmentManagementMessage(e){this.send("environment.management",e)}sendServerManagementMessage(e){this.send("server.management",e)}sendInputManagementMessage(e){this.send("input.management",e)}sendNodeManagementMessage(e){this.send("node.management",e)}sendHistoryManagementMessage(e){this.send("history.management",e)}sendCredentialManagementMessage(e){this.send("credential.management",e)}sendPanelToggleMessage(e){this.send("panel.toggle",e)}sendWorkflowRunClickMessage(e){this.send("workflow.run.click",e)}sendWorkflowRunResultMessage(e){this.send("workflow.run.result",e)}}const dEu=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],RJ="https://cors.redocly.com/";function EEu(u,e,a){return e in u?Object.defineProperty(u,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):u[e]=a,u}function Vj(u,e){var a=Object.keys(u);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(u);e&&(t=t.filter(function(r){return Object.getOwnPropertyDescriptor(u,r).enumerable})),a.push.apply(a,t)}return a}function Gj(u){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Vj(Object(a),!0).forEach(function(t){EEu(u,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(a)):Vj(Object(a)).forEach(function(t){Object.defineProperty(u,t,Object.getOwnPropertyDescriptor(a,t))})}return u}function d0(u){return"Minified Redux error #"+u+"; visit https://redux.js.org/Errors?code="+u+" for the full message or use the non-minified dev environment for full errors. "}var Hj=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),ik=function(){return Math.random().toString(36).substring(7).split("").join(".")},Do={INIT:"@@redux/INIT"+ik(),REPLACE:"@@redux/REPLACE"+ik(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+ik()}};function NJ(u){if(typeof u!="object"||u===null)return!1;for(var e=u;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(u)===e}function pEu(u){if(u===void 0)return"undefined";if(u===null)return"null";var e=typeof u;switch(e){case"boolean":case"string":case"number":case"symbol":case"function":return e}if(Array.isArray(u))return"array";if(xEu(u))return"date";if(hEu(u))return"error";var a=mEu(u);switch(a){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return a}return e.slice(8,-1).toLowerCase().replace(/\s/g,"")}function mEu(u){return typeof u.constructor=="function"?u.constructor.name:null}function hEu(u){return u instanceof Error||typeof u.message=="string"&&u.constructor&&typeof u.constructor.stackTraceLimit=="number"}function xEu(u){return u instanceof Date?!0:typeof u.toDateString=="function"&&typeof u.getDate=="function"&&typeof u.setDate=="function"}function Xi(u){var e=typeof u;return process.env.NODE_ENV!=="production"&&(e=pEu(u)),e}function ag(u,e,a){var t;if(typeof e=="function"&&typeof a=="function"||typeof a=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?d0(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof e=="function"&&typeof a>"u"&&(a=e,e=void 0),typeof a<"u"){if(typeof a!="function")throw new Error(process.env.NODE_ENV==="production"?d0(1):"Expected the enhancer to be a function. Instead, received: '"+Xi(a)+"'");return a(ag)(u,e)}if(typeof u!="function")throw new Error(process.env.NODE_ENV==="production"?d0(2):"Expected the root reducer to be a function. Instead, received: '"+Xi(u)+"'");var r=u,n=e,i=[],o=i,s=!1;function l(){o===i&&(o=i.slice())}function c(){if(s)throw new Error(process.env.NODE_ENV==="production"?d0(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return n}function d(m){if(typeof m!="function")throw new Error(process.env.NODE_ENV==="production"?d0(4):"Expected the listener to be a function. Instead, received: '"+Xi(m)+"'");if(s)throw new Error(process.env.NODE_ENV==="production"?d0(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");var g=!0;return l(),o.push(m),function(){if(g){if(s)throw new Error(process.env.NODE_ENV==="production"?d0(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");g=!1,l();var f=o.indexOf(m);o.splice(f,1),i=null}}}function E(m){if(!NJ(m))throw new Error(process.env.NODE_ENV==="production"?d0(7):"Actions must be plain objects. Instead, the actual type was: '"+Xi(m)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof m.type>"u")throw new Error(process.env.NODE_ENV==="production"?d0(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(s)throw new Error(process.env.NODE_ENV==="production"?d0(9):"Reducers may not dispatch actions.");try{s=!0,n=r(n,m)}finally{s=!1}for(var g=i=o,h=0;h<g.length;h++){var f=g[h];f()}return m}function p(m){if(typeof m!="function")throw new Error(process.env.NODE_ENV==="production"?d0(10):"Expected the nextReducer to be a function. Instead, received: '"+Xi(m));r=m,E({type:Do.REPLACE})}function x(){var m,g=d;return m={subscribe:function(f){if(typeof f!="object"||f===null)throw new Error(process.env.NODE_ENV==="production"?d0(11):"Expected the observer to be an object. Instead, received: '"+Xi(f)+"'");function k(){f.next&&f.next(c())}k();var y=g(k);return{unsubscribe:y}}},m[Hj]=function(){return this},m}return E({type:Do.INIT}),t={dispatch:E,subscribe:d,getState:c,replaceReducer:p},t[Hj]=x,t}var DEu=ag;function Ry(u){typeof console<"u"&&typeof console.error=="function"&&console.error(u);try{throw new Error(u)}catch{}}function fEu(u,e,a,t){var r=Object.keys(e),n=a&&a.type===Do.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(r.length===0)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!NJ(u))return"The "+n+' has unexpected type of "'+Xi(u)+'". Expected argument to be an object with the following '+('keys: "'+r.join('", "')+'"');var i=Object.keys(u).filter(function(o){return!e.hasOwnProperty(o)&&!t[o]});if(i.forEach(function(o){t[o]=!0}),!(a&&a.type===Do.REPLACE)&&i.length>0)return"Unexpected "+(i.length>1?"keys":"key")+" "+('"'+i.join('", "')+'" found in '+n+". ")+"Expected to find one of the known reducer keys instead: "+('"'+r.join('", "')+'". Unexpected keys will be ignored.')}function gEu(u){Object.keys(u).forEach(function(e){var a=u[e],t=a(void 0,{type:Do.INIT});if(typeof t>"u")throw new Error(process.env.NODE_ENV==="production"?d0(12):'The slice reducer for key "'+e+`" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);if(typeof a(void 0,{type:Do.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?d0(13):'The slice reducer for key "'+e+'" returned undefined when probed with a random type. '+("Don't try to handle '"+Do.INIT+`' or other actions in "redux/*" `)+"namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.")})}function vEu(u){for(var e=Object.keys(u),a={},t=0;t<e.length;t++){var r=e[t];process.env.NODE_ENV!=="production"&&typeof u[r]>"u"&&Ry('No reducer provided for key "'+r+'"'),typeof u[r]=="function"&&(a[r]=u[r])}var n=Object.keys(a),i;process.env.NODE_ENV!=="production"&&(i={});var o;try{gEu(a)}catch(s){o=s}return function(l,c){if(l===void 0&&(l={}),o)throw o;if(process.env.NODE_ENV!=="production"){var d=fEu(l,a,c,i);d&&Ry(d)}for(var E=!1,p={},x=0;x<n.length;x++){var m=n[x],g=a[m],h=l[m],f=g(h,c);if(typeof f>"u"){var k=c&&c.type;throw new Error(process.env.NODE_ENV==="production"?d0(14):"When called with an action of type "+(k?'"'+String(k)+'"':"(unknown type)")+', the slice reducer for key "'+m+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.')}p[m]=f,E=E||f!==h}return E=E||n.length!==Object.keys(l).length,E?p:l}}function qj(u,e){return function(){return e(u.apply(this,arguments))}}function kEu(u,e){if(typeof u=="function")return qj(u,e);if(typeof u!="object"||u===null)throw new Error(process.env.NODE_ENV==="production"?d0(16):"bindActionCreators expected an object or a function, but instead received: '"+Xi(u)+`'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?`);var a={};for(var t in u){var r=u[t];typeof r=="function"&&(a[t]=qj(r,e))}return a}function _J(){for(var u=arguments.length,e=new Array(u),a=0;a<u;a++)e[a]=arguments[a];return e.length===0?function(t){return t}:e.length===1?e[0]:e.reduce(function(t,r){return function(){return t(r.apply(void 0,arguments))}})}function bEu(){for(var u=arguments.length,e=new Array(u),a=0;a<u;a++)e[a]=arguments[a];return function(t){return function(){var r=t.apply(void 0,arguments),n=function(){throw new Error(process.env.NODE_ENV==="production"?d0(15):"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},i={getState:r.getState,dispatch:function(){return n.apply(void 0,arguments)}},o=e.map(function(s){return s(i)});return n=_J.apply(void 0,o)(r.dispatch),Gj(Gj({},r),{},{dispatch:n})}}}function Wj(){}process.env.NODE_ENV!=="production"&&typeof Wj.name=="string"&&Wj.name!=="isCrushed"&&Ry('You are currently using minified code outside of NODE_ENV === "production". This means that you are running a slower development build of Redux. You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify or setting mode to production in webpack (https://webpack.js.org/concepts/mode/) to ensure you have the correct code for your production build.');var yEu=Object.freeze({__proto__:null,__DO_NOT_USE__ActionTypes:Do,applyMiddleware:bEu,bindActionCreators:kEu,combineReducers:vEu,compose:_J,createStore:ag,legacy_createStore:DEu});function CEu(u){var e=u.default;if(typeof e=="function"){var a=function(){return e.apply(this,arguments)};a.prototype=e.prototype}else a={};return Object.defineProperty(a,"__esModule",{value:!0}),Object.keys(u).forEach(function(t){var r=Object.getOwnPropertyDescriptor(u,t);Object.defineProperty(a,t,r.get?r:{enumerable:!0,get:function(){return u[t]}})}),a}var FEu=CEu(yEu);FEu.compose;var AEu=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(u){return u}};function BEu(u,e,a){var t=!1,r=!1,n=ag(function(o,s){if(!r){var l=function(g){return Array.isArray(g)&&g.findIndex(function(h){return typeof h!="string"&&typeof h!="number"})===-1};if(s.type.startsWith("SET")){var c=function(g){try{t=!0,"value"in s?g.set(s.value):g.set(lu)}finally{t=!1}};if(s.path){if(l(s.path)){s.path.length===0&&c(u);for(var d=u,E=!0,p=0,x=s.path;p<x.length;p++){var m=x[p];d[m]?d=d[m]:E=!1}E&&c(d)}}else c(u)}else s.type==="BREAKPOINT"&&a()}return u.promised||u.error?lu:u.get({noproxy:!0})},AEu({name:"".concat(window.location.hostname,": ").concat(e),trace:!0,traceLimit:16,autoPause:!0,shouldHotReload:!1,features:{persist:!0,pause:!0,lock:!1,export:"custom",import:"custom",jump:!1,skip:!1,reorder:!1,dispatch:!0,test:!1}})),i=function(o,s){if(t)s&&s();else try{r=!0,n.dispatch(o)}finally{r=!1}};return i}function SEu(u){return function(){var e,a,t=!1;return{onInit:function(r,n){if(!(typeof window>"u"||!("__REDUX_DEVTOOLS_EXTENSION__"in window))){if(u?.key===void 0){if(n.identifier===void 0)throw Error("State is missing Identifiable extension or Devtools key option");e=n.identifier(r)}else e=u.key;a=BEu(r,e,function(){t=!t}),r.promise||a?.({type:"CREATE",state:r.get({noproxy:!0,stealth:!0})})}},onSet:function(r,n){if(a?.({type:"SET [".concat(r.path.join("/"),"]"),state:r.get({noproxy:!0,stealth:!0}),descriptor:n}),t)debugger},onDestroy:function(){a?.({type:"DESTROY"})}}}}var Nu=(u=>(u.Normal="Normal",u.Edit="Edit",u.Draft="Draft",u))(Nu||{});const ME="default",LJ=[{name:ME,inputs:[],servers:[],state:Nu.Normal}],IJ={activeTabIdx:0,tabs:[]};var Jr=(u=>(u.Idle="idle",u.Loading="loading",u.Success="success",u.Error="error",u))(Jr||{});function li(u){const e=new WeakMap;function a(t){if(typeof t!="object"||t===null)return t;if(e.has(t))return e.get(t);const r=Array.isArray(t)?[]:{};e.set(t,r);for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=a(t[n]));return r}return a(u)}function Jj(u){return Object.keys(u).forEach(e=>{u[e]===void 0&&delete u[e]}),u}const pn={FS:"fs",WEB:"web"},mn=window.__TAURI__?.http.fetch??globalThis.fetch;function kc(){return!!window?.__TAURI__}function Dx(u){return/(?:^[a-z][a-z0-9+.-]*:|\/\/)/i.test(u)}function q5(u){return u.endsWith("/")?u.substring(0,u.length-1):u}function zEu(u){return u.startsWith("/")?u.substring(1):u}function wEu(u){try{const e=new URL(u);return e.search="",e.hash="",e.toString()}catch{return u}}function KJ(u){return/^https?:\/\//i.test(u)}function OEu(u,e){let a;if(e.startsWith("//")){const{protocol:t}=new URL(u);a=`${t||"https:"}${e}`}else if(Dx(e))a=e;else if(!e.startsWith("/"))a=q5(u)+"/"+e;else{const t=new URL(u);t.pathname=e,a=t.toString()}return q5(a)}function W5(u,e){let a=u;return e.forEach(({key:t,value:r,active:n})=>{r&&n&&(a=a.replaceAll(`{${t}}`,r))}),a}function cA(u,e){let a=u;return e.forEach(({name:t,value:r})=>{r&&(a=a.replaceAll(`{${t}}`,r))}),a}function PEu(u){return u.startsWith("http://")||u.startsWith("https://")}function dh({url:u,serverUrl:e,corsProxyUrl:a}){const t=PEu(u)||!e?u:`${q5(e)}/${zEu(u)}`;return a?`${a}${t}`:t}class Uj{constructor(e){this.baseDir=e}async ls(e=""){const a=this.makeKey(e);return Object.keys(localStorage).filter(t=>t.startsWith(a)).map(t=>t.replace(a,""))}async get(e){const a=this.makeKey(e);return localStorage.getItem(a)??null}async set(e,a){const t=this.makeKey(e);localStorage.setItem(t,a)}async remove(e){const a=this.makeKey(e);localStorage.removeItem(a)}makeKey(e){return`replay:fs:${this.baseDir}/${e}`}}class jEu{baseDir="";async ls(e=""){return[]}async get(e){return null}async set(e,a){}async remove(e){}}async function ut(u,e={},a){return window.__TAURI_INTERNALS__.invoke(u,e,a)}var J5;(function(u){u[u.Audio=1]="Audio",u[u.Cache=2]="Cache",u[u.Config=3]="Config",u[u.Data=4]="Data",u[u.LocalData=5]="LocalData",u[u.Document=6]="Document",u[u.Download=7]="Download",u[u.Picture=8]="Picture",u[u.Public=9]="Public",u[u.Video=10]="Video",u[u.Resource=11]="Resource",u[u.Temp=12]="Temp",u[u.AppConfig=13]="AppConfig",u[u.AppData=14]="AppData",u[u.AppLocalData=15]="AppLocalData",u[u.AppCache=16]="AppCache",u[u.AppLog=17]="AppLog",u[u.Desktop=18]="Desktop",u[u.Executable=19]="Executable",u[u.Font=20]="Font",u[u.Home=21]="Home",u[u.Runtime=22]="Runtime",u[u.Template=23]="Template"})(J5||(J5={}));async function MEu(){return ut("plugin:path|resolve_directory",{directory:J5.AppData})}async function TEu(){return ut("plugin:path|resolve_directory",{directory:J5.Desktop})}function VJ(){return window.__TAURI_INTERNALS__.plugins.path.sep}async function $Eu(...u){return ut("plugin:path|resolve",{paths:u})}async function dd(...u){return ut("plugin:path|join",{paths:u})}async function REu(u){return ut("plugin:path|extname",{path:u})}async function GJ(u,e){return ut("plugin:path|basename",{path:u,ext:e})}async function NEu(u){return ut("plugin:path|is_absolute",{path:u})}var Zj;(function(u){u[u.Start=0]="Start",u[u.Current=1]="Current",u[u.End=2]="End"})(Zj||(Zj={}));async function Qj(u,e){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");await ut("plugin:fs|mkdir",{path:u instanceof URL?u.toString():u,options:e})}async function HJ(u,e){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");return await ut("plugin:fs|read_dir",{path:u instanceof URL?u.toString():u,options:e})}async function _Eu(u,e){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");const a=await ut("plugin:fs|read_file",{path:u instanceof URL?u.toString():u,options:e});return a instanceof ArrayBuffer?new Uint8Array(a):Uint8Array.from(a)}async function dA(u,e){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");return await ut("plugin:fs|read_text_file",{path:u instanceof URL?u.toString():u,options:e})}async function LEu(u,e){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");await ut("plugin:fs|remove",{path:u instanceof URL?u.toString():u,options:e})}async function IEu(u,e,a){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");await ut("plugin:fs|write_text_file",{path:u instanceof URL?u.toString():u,data:e,options:a})}async function qJ(u,e){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");return await ut("plugin:fs|exists",{path:u instanceof URL?u.toString():u,options:e})}class za{static utils=null;static async getUtils(){return za.utils||(za.utils=kc()?await Promise.resolve().then(()=>require("./replay-tauri-path-CKzwm1ID.js")):await Promise.resolve().then(()=>ene)),za.utils}static async join(...e){return(await za.getUtils()).join(...e)}static async resolve(e){return(await za.getUtils()).resolve(e)}static async isAbsolute(e){return(await za.getUtils()).isAbsolute(e)}static async relative(e,a){return(await za.getUtils()).relative(e,a)}static async extname(e){return(await za.getUtils()).extname(e)}}const KEu=new Set(["node_modules"]);class Yj{constructor(e){this.baseDir=e,this.initializeDirectory(e)}async initializeDirectory(e){await Qj(e,{recursive:!0})}async ls(e){const a=await this.getFullPath(e);return this.getDirEntryFilesRecursively(a)}async getDirEntryFilesRecursively(e){try{const a=[],t=await HJ(e);for(const r of t)if(r.isDirectory){if(KEu.has(r.name))continue;const n=await dd(e,r.name),i=await this.getDirEntryFilesRecursively(n);a.push(...i)}else{const n=await dd(e,r.name),i=await za.relative(this.baseDir,n);a.push(i)}return a}catch(a){return a.includes("forbidden path")||console.error(a),[]}}async get(e){const a=await this.getFullPath(e);try{return await dA(a)}catch(t){return!t.includes("No such file or directory")&&!t.includes("forbidden path")&&console.error(t),null}}async set(e,a){const t=await this.getFullPath(e),r=VJ(),n=t.split(r).slice(0,-1).join(r);await Qj(n,{recursive:!0}),await IEu(t,a)}async remove(e){const a=await this.getFullPath(e);try{await LEu(a)}catch(t){!t.includes("No such file or directory")&&!t.includes("forbidden path")&&console.error(t)}}async getFullPath(e){return await dd(this.baseDir,e??"")}}class VEu{constructor(e){this.projectId=e}async get(){const e=this.getKey();return localStorage.getItem(e)??null}async set(e){const a=this.getKey();localStorage.setItem(a,e)}async remove(){const e=this.getKey();localStorage.removeItem(e)}getKey(){return`replay:secrets:${this.projectId}`}}class WJ{constructor(e){this.storage=e}itemIds=[];async parseMany(e,a){const r=(await Promise.all(e.map(async n=>{try{return await this.parse(n,a)}catch(i){return console.error(`Error parsing from ${n.type} ${n.uri}:`,i),null}}))).filter(n=>n!==null);return this.itemIds=r.map(n=>n.id),r}async write(e){e.state===Nu.Draft||e.srcType!==pn.FS||await this.storage.set(e.id,await this.stringify(e))}async remove(e){await this.storage.remove(e)}async updateRoot(e,a){const t=e.actions;if(t){for(const n in t){const i=parseInt(n);switch(t[n]){case"D":await this.remove(this.itemIds[i]);break;case"I":case"U":await this.write(a[i]);break}}return}const r=this.itemIds.filter(n=>!a.some(i=>i.id===n));await Promise.all([...a.map(n=>this.write(n)),...r.map(n=>this.remove(n))])}async update(e,a){const r={path:e.path.slice(1),actions:e.actions};if(r.path.length===0&&await this.updateRoot(r,a),r.path.length>0){const n=r.path[0];r.path.length===1&&r.actions&&r.actions.id==="U"&&await this.remove(this.itemIds[n]),r.path[1]&&r.path[1]==="id"&&await this.remove(this.itemIds[n]),await this.write(a[n])}this.itemIds=a.map(n=>n.id)}}class GEu extends WJ{parse(e){return{...e.content,id:e.uri,srcType:e.type}}async stringify(e){const{id:a,srcType:t,...r}=e;return await za.extname(a)===".json"?JSON.stringify(r,null,2):xi.dump(r)}}var w0=(u=>(u.SIMPLE="simple",u.REGEX="regex",u.JSONPATH="jsonpath",u.XPATH="xpath",u))(w0||{});const JJ=1024;let HEu=0,Ut=class{constructor(e,a){this.from=e,this.to=a}};class vu{constructor(e={}){this.id=HEu++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Z0.match(e)),a=>{let t=e(a);return t===void 0?null:[this,t]}}}vu.closedBy=new vu({deserialize:u=>u.split(" ")});vu.openedBy=new vu({deserialize:u=>u.split(" ")});vu.group=new vu({deserialize:u=>u.split(" ")});vu.isolate=new vu({deserialize:u=>{if(u&&u!="rtl"&&u!="ltr"&&u!="auto")throw new RangeError("Invalid value for isolate: "+u);return u||"auto"}});vu.contextHash=new vu({perNode:!0});vu.lookAhead=new vu({perNode:!0});vu.mounted=new vu({perNode:!0});class Gd{constructor(e,a,t){this.tree=e,this.overlay=a,this.parser=t}static get(e){return e&&e.props&&e.props[vu.mounted.id]}}const qEu=Object.create(null);class Z0{constructor(e,a,t,r=0){this.name=e,this.props=a,this.id=t,this.flags=r}static define(e){let a=e.props&&e.props.length?Object.create(null):qEu,t=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new Z0(e.name||"",a,e.id,t);if(e.props){for(let n of e.props)if(Array.isArray(n)||(n=n(r)),n){if(n[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");a[n[0].id]=n[1]}}return r}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let a=this.prop(vu.group);return a?a.indexOf(e)>-1:!1}return this.id==e}static match(e){let a=Object.create(null);for(let t in e)for(let r of t.split(" "))a[r]=e[t];return t=>{for(let r=t.prop(vu.group),n=-1;n<(r?r.length:0);n++){let i=a[n<0?t.name:r[n]];if(i)return i}}}}Z0.none=new Z0("",Object.create(null),0,8);class EA{constructor(e){this.types=e;for(let a=0;a<e.length;a++)if(e[a].id!=a)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let a=[];for(let t of this.types){let r=null;for(let n of e){let i=n(t);i&&(r||(r=Object.assign({},t.props)),r[i[0].id]=i[1])}a.push(r?new Z0(t.name,r,t.id,t.flags):t)}return new EA(a)}}const Eh=new WeakMap,Xj=new WeakMap;var Ea;(function(u){u[u.ExcludeBuffers=1]="ExcludeBuffers",u[u.IncludeAnonymous=2]="IncludeAnonymous",u[u.IgnoreMounts=4]="IgnoreMounts",u[u.IgnoreOverlays=8]="IgnoreOverlays"})(Ea||(Ea={}));let Va=class Ny{constructor(e,a,t,r,n){if(this.type=e,this.children=a,this.positions=t,this.length=r,this.props=null,n&&n.length){this.props=Object.create(null);for(let[i,o]of n)this.props[typeof i=="number"?i:i.id]=o}}toString(){let e=Gd.get(this);if(e&&!e.overlay)return e.tree.toString();let a="";for(let t of this.children){let r=t.toString();r&&(a&&(a+=","),a+=r)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(a.length?"("+a+")":""):a}cursor(e=0){return new U5(this.topNode,e)}cursorAt(e,a=0,t=0){let r=Eh.get(this)||this.topNode,n=new U5(r);return n.moveTo(e,a),Eh.set(this,n._tree),n}get topNode(){return new ur(this,0,0,null)}resolve(e,a=0){let t=Hd(Eh.get(this)||this.topNode,e,a,!1);return Eh.set(this,t),t}resolveInner(e,a=0){let t=Hd(Xj.get(this)||this.topNode,e,a,!0);return Xj.set(this,t),t}resolveStack(e,a=0){return UEu(this,e,a)}iterate(e){let{enter:a,leave:t,from:r=0,to:n=this.length}=e,i=e.mode||0,o=(i&Ea.IncludeAnonymous)>0;for(let s=this.cursor(i|Ea.IncludeAnonymous);;){let l=!1;if(s.from<=n&&s.to>=r&&(!o&&s.type.isAnonymous||a(s)!==!1)){if(s.firstChild())continue;l=!0}for(;l&&t&&(o||!s.type.isAnonymous)&&t(s),!s.nextSibling();){if(!s.parent())return;l=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let a in this.props)e.push([+a,this.props[a]]);return e}balance(e={}){return this.children.length<=8?this:hA(Z0.none,this.children,this.positions,0,this.children.length,0,this.length,(a,t,r)=>new Ny(this.type,a,t,r,this.propValues),e.makeTree||((a,t,r)=>new Ny(Z0.none,a,t,r)))}static build(e){return ZEu(e)}};Va.empty=new Va(Z0.none,[],[],0);class pA{constructor(e,a){this.buffer=e,this.index=a}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new pA(this.buffer,this.index)}}class yo{constructor(e,a,t){this.buffer=e,this.length=a,this.set=t}get type(){return Z0.none}toString(){let e=[];for(let a=0;a<this.buffer.length;)e.push(this.childString(a)),a=this.buffer[a+3];return e.join(",")}childString(e){let a=this.buffer[e],t=this.buffer[e+3],r=this.set.types[a],n=r.name;if(/\W/.test(n)&&!r.isError&&(n=JSON.stringify(n)),e+=4,t==e)return n;let i=[];for(;e<t;)i.push(this.childString(e)),e=this.buffer[e+3];return n+"("+i.join(",")+")"}findChild(e,a,t,r,n){let{buffer:i}=this,o=-1;for(let s=e;s!=a&&!(UJ(n,r,i[s+1],i[s+2])&&(o=s,t>0));s=i[s+3]);return o}slice(e,a,t){let r=this.buffer,n=new Uint16Array(a-e),i=0;for(let o=e,s=0;o<a;){n[s++]=r[o++],n[s++]=r[o++]-t;let l=n[s++]=r[o++]-t;n[s++]=r[o++]-e,i=Math.max(i,l)}return new yo(n,i,this.set)}}function UJ(u,e,a,t){switch(u){case-2:return a<e;case-1:return t>=e&&a<e;case 0:return a<e&&t>e;case 1:return a<=e&&t>e;case 2:return t>e;case 4:return!0}}function Hd(u,e,a,t){for(var r;u.from==u.to||(a<1?u.from>=e:u.from>e)||(a>-1?u.to<=e:u.to<e);){let i=!t&&u instanceof ur&&u.index<0?null:u.parent;if(!i)return u;u=i}let n=t?0:Ea.IgnoreOverlays;if(t)for(let i=u,o=i.parent;o;i=o,o=i.parent)i instanceof ur&&i.index<0&&((r=o.enter(e,a,n))===null||r===void 0?void 0:r.from)!=i.from&&(u=o);for(;;){let i=u.enter(e,a,n);if(!i)return u;u=i}}class ZJ{cursor(e=0){return new U5(this,e)}getChild(e,a=null,t=null){let r=eM(this,e,a,t);return r.length?r[0]:null}getChildren(e,a=null,t=null){return eM(this,e,a,t)}resolve(e,a=0){return Hd(this,e,a,!1)}resolveInner(e,a=0){return Hd(this,e,a,!0)}matchContext(e){return _y(this.parent,e)}enterUnfinishedNodesBefore(e){let a=this.childBefore(e),t=this;for(;a;){let r=a.lastChild;if(!r||r.to!=a.to)break;r.type.isError&&r.from==r.to?(t=a,a=r.prevSibling):a=r}return t}get node(){return this}get next(){return this.parent}}let ur=class fx extends ZJ{constructor(e,a,t,r){super(),this._tree=e,this.from=a,this.index=t,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,a,t,r,n=0){for(let i=this;;){for(let{children:o,positions:s}=i._tree,l=a>0?o.length:-1;e!=l;e+=a){let c=o[e],d=s[e]+i.from;if(UJ(r,t,d,d+c.length)){if(c instanceof yo){if(n&Ea.ExcludeBuffers)continue;let E=c.findChild(0,c.buffer.length,a,t-d,r);if(E>-1)return new rn(new WEu(i,c,e,d),null,E)}else if(n&Ea.IncludeAnonymous||!c.type.isAnonymous||mA(c)){let E;if(!(n&Ea.IgnoreMounts)&&(E=Gd.get(c))&&!E.overlay)return new fx(E.tree,d,e,i);let p=new fx(c,d,e,i);return n&Ea.IncludeAnonymous||!p.type.isAnonymous?p:p.nextChild(a<0?c.children.length-1:0,a,t,r)}}}if(n&Ea.IncludeAnonymous||!i.type.isAnonymous||(i.index>=0?e=i.index+a:e=a<0?-1:i._parent._tree.children.length,i=i._parent,!i))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,a,t=0){let r;if(!(t&Ea.IgnoreOverlays)&&(r=Gd.get(this._tree))&&r.overlay){let n=e-this.from;for(let{from:i,to:o}of r.overlay)if((a>0?i<=n:i<n)&&(a<0?o>=n:o>n))return new fx(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,a,t)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}};function eM(u,e,a,t){let r=u.cursor(),n=[];if(!r.firstChild())return n;if(a!=null){for(let i=!1;!i;)if(i=r.type.is(a),!r.nextSibling())return n}for(;;){if(t!=null&&r.type.is(t))return n;if(r.type.is(e)&&n.push(r.node),!r.nextSibling())return t==null?n:[]}}function _y(u,e,a=e.length-1){for(let t=u;a>=0;t=t.parent){if(!t)return!1;if(!t.type.isAnonymous){if(e[a]&&e[a]!=t.name)return!1;a--}}return!0}class WEu{constructor(e,a,t,r){this.parent=e,this.buffer=a,this.index=t,this.start=r}}class rn extends ZJ{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,a,t){super(),this.context=e,this._parent=a,this.index=t,this.type=e.buffer.set.types[e.buffer.buffer[t]]}child(e,a,t){let{buffer:r}=this.context,n=r.findChild(this.index+4,r.buffer[this.index+3],e,a-this.context.start,t);return n<0?null:new rn(this.context,this,n)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,a,t=0){if(t&Ea.ExcludeBuffers)return null;let{buffer:r}=this.context,n=r.findChild(this.index+4,r.buffer[this.index+3],a>0?1:-1,e-this.context.start,a);return n<0?null:new rn(this.context,this,n)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,a=e.buffer[this.index+3];return a<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new rn(this.context,this._parent,a):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,a=this._parent?this._parent.index+4:0;return this.index==a?this.externalSibling(-1):new rn(this.context,this._parent,e.findChild(a,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],a=[],{buffer:t}=this.context,r=this.index+4,n=t.buffer[this.index+3];if(n>r){let i=t.buffer[this.index+1];e.push(t.slice(r,n,i)),a.push(0)}return new Va(this.type,e,a,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function QJ(u){if(!u.length)return null;let e=0,a=u[0];for(let n=1;n<u.length;n++){let i=u[n];(i.from>a.from||i.to<a.to)&&(a=i,e=n)}let t=a instanceof ur&&a.index<0?null:a.parent,r=u.slice();return t?r[e]=t:r.splice(e,1),new JEu(r,a)}class JEu{constructor(e,a){this.heads=e,this.node=a}get next(){return QJ(this.heads)}}function UEu(u,e,a){let t=u.resolveInner(e,a),r=null;for(let n=t instanceof ur?t:t.context.parent;n;n=n.parent)if(n.index<0){let i=n.parent;(r||(r=[t])).push(i.resolve(e,a)),n=i}else{let i=Gd.get(n.tree);if(i&&i.overlay&&i.overlay[0].from<=e&&i.overlay[i.overlay.length-1].to>=e){let o=new ur(i.tree,i.overlay[0].from+n.from,-1,n);(r||(r=[t])).push(Hd(o,e,a,!1))}}return r?QJ(r):t}class U5{get name(){return this.type.name}constructor(e,a=0){if(this.mode=a,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof ur)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let t=e._parent;t;t=t._parent)this.stack.unshift(t.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,a){this.index=e;let{start:t,buffer:r}=this.buffer;return this.type=a||r.set.types[r.buffer[e]],this.from=t+r.buffer[e+1],this.to=t+r.buffer[e+2],!0}yield(e){return e?e instanceof ur?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,a,t){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,a,t,this.mode));let{buffer:r}=this.buffer,n=r.findChild(this.index+4,r.buffer[this.index+3],e,a-this.buffer.start,t);return n<0?!1:(this.stack.push(this.index),this.yieldBuf(n))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,a,t=this.mode){return this.buffer?t&Ea.ExcludeBuffers?!1:this.enterChild(1,e,a):this.yield(this._tree.enter(e,a,t))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Ea.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Ea.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:a}=this.buffer,t=this.stack.length-1;if(e<0){let r=t<0?0:this.stack[t]+4;if(this.index!=r)return this.yieldBuf(a.findChild(r,this.index,-1,0,4))}else{let r=a.buffer[this.index+3];if(r<(t<0?a.buffer.length:a.buffer[this.stack[t]+3]))return this.yieldBuf(r)}return t<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let a,t,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let n=0;n<this.index;n++)if(r.buffer.buffer[n+3]<this.index)return!1;({index:a,parent:t}=r)}else({index:a,_parent:t}=this._tree);for(;t;{index:a,_parent:t}=t)if(a>-1)for(let n=a+e,i=e<0?-1:t._tree.children.length;n!=i;n+=e){let o=t._tree.children[n];if(this.mode&Ea.IncludeAnonymous||o instanceof yo||!o.type.isAnonymous||mA(o))return!1}return!0}move(e,a){if(a&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,a=0){for(;(this.from==this.to||(a<1?this.from>=e:this.from>e)||(a>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,a););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,a=null,t=0;if(e&&e.context==this.buffer)e:for(let r=this.index,n=this.stack.length;n>=0;){for(let i=e;i;i=i._parent)if(i.index==r){if(r==this.index)return i;a=i,t=n+1;break e}r=this.stack[--n]}for(let r=t;r<this.stack.length;r++)a=new rn(this.buffer,a,this.stack[r]);return this.bufferNode=new rn(this.buffer,a,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,a){for(let t=0;;){let r=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){t++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&a&&a(this),r=this.type.isAnonymous,!t)return;if(this.nextSibling())break;this.parent(),t--,r=!0}}}matchContext(e){if(!this.buffer)return _y(this.node.parent,e);let{buffer:a}=this.buffer,{types:t}=a.set;for(let r=e.length-1,n=this.stack.length-1;r>=0;n--){if(n<0)return _y(this._tree,e,r);let i=t[a.buffer[this.stack[n]]];if(!i.isAnonymous){if(e[r]&&e[r]!=i.name)return!1;r--}}return!0}}function mA(u){return u.children.some(e=>e instanceof yo||!e.type.isAnonymous||mA(e))}function ZEu(u){var e;let{buffer:a,nodeSet:t,maxBufferLength:r=JJ,reused:n=[],minRepeatType:i=t.types.length}=u,o=Array.isArray(a)?new pA(a,a.length):a,s=t.types,l=0,c=0;function d(v,b,C,B,z,P){let{id:L,start:I,end:G,size:X}=o,U=c,ae=l;for(;X<0;)if(o.next(),X==-1){let T=n[L];C.push(T),B.push(I-v);return}else if(X==-3){l=L;return}else if(X==-4){c=L;return}else throw new RangeError(`Unrecognized record size: ${X}`);let Ee=s[L],re,he,j=I-v;if(G-I<=r&&(he=g(o.pos-b,z))){let T=new Uint16Array(he.size-he.skip),V=o.pos-he.size,O=T.length;for(;o.pos>V;)O=h(he.start,T,O);re=new yo(T,G-he.start,t),j=he.start-v}else{let T=o.pos-X;o.next();let V=[],O=[],F=L>=i?L:-1,S=0,$=G;for(;o.pos>T;)F>=0&&o.id==F&&o.size>=0?(o.end<=$-r&&(x(V,O,I,S,o.end,$,F,U,ae),S=V.length,$=o.end),o.next()):P>2500?E(I,T,V,O):d(I,T,V,O,F,P+1);if(F>=0&&S>0&&S<V.length&&x(V,O,I,S,I,$,F,U,ae),V.reverse(),O.reverse(),F>-1&&S>0){let q=p(Ee,ae);re=hA(Ee,V,O,0,V.length,0,G-I,q,q)}else re=m(Ee,V,O,G-I,U-G,ae)}C.push(re),B.push(j)}function E(v,b,C,B){let z=[],P=0,L=-1;for(;o.pos>b;){let{id:I,start:G,end:X,size:U}=o;if(U>4)o.next();else{if(L>-1&&G<L)break;L<0&&(L=X-r),z.push(I,G,X),P++,o.next()}}if(P){let I=new Uint16Array(P*4),G=z[z.length-2];for(let X=z.length-3,U=0;X>=0;X-=3)I[U++]=z[X],I[U++]=z[X+1]-G,I[U++]=z[X+2]-G,I[U++]=U;C.push(new yo(I,z[2]-G,t)),B.push(G-v)}}function p(v,b){return(C,B,z)=>{let P=0,L=C.length-1,I,G;if(L>=0&&(I=C[L])instanceof Va){if(!L&&I.type==v&&I.length==z)return I;(G=I.prop(vu.lookAhead))&&(P=B[L]+I.length+G)}return m(v,C,B,z,P,b)}}function x(v,b,C,B,z,P,L,I,G){let X=[],U=[];for(;v.length>B;)X.push(v.pop()),U.push(b.pop()+C-z);v.push(m(t.types[L],X,U,P-z,I-P,G)),b.push(z-C)}function m(v,b,C,B,z,P,L){if(P){let I=[vu.contextHash,P];L=L?[I].concat(L):[I]}if(z>25){let I=[vu.lookAhead,z];L=L?[I].concat(L):[I]}return new Va(v,b,C,B,L)}function g(v,b){let C=o.fork(),B=0,z=0,P=0,L=C.end-r,I={size:0,start:0,skip:0};e:for(let G=C.pos-v;C.pos>G;){let X=C.size;if(C.id==b&&X>=0){I.size=B,I.start=z,I.skip=P,P+=4,B+=4,C.next();continue}let U=C.pos-X;if(X<0||U<G||C.start<L)break;let ae=C.id>=i?4:0,Ee=C.start;for(C.next();C.pos>U;){if(C.size<0)if(C.size==-3)ae+=4;else break e;else C.id>=i&&(ae+=4);C.next()}z=Ee,B+=X,P+=ae}return(b<0||B==v)&&(I.size=B,I.start=z,I.skip=P),I.size>4?I:void 0}function h(v,b,C){let{id:B,start:z,end:P,size:L}=o;if(o.next(),L>=0&&B<i){let I=C;if(L>4){let G=o.pos-(L-4);for(;o.pos>G;)C=h(v,b,C)}b[--C]=I,b[--C]=P-v,b[--C]=z-v,b[--C]=B}else L==-3?l=B:L==-4&&(c=B);return C}let f=[],k=[];for(;o.pos>0;)d(u.start||0,u.bufferStart||0,f,k,-1,0);let y=(e=u.length)!==null&&e!==void 0?e:f.length?k[0]+f[0].length:0;return new Va(s[u.topID],f.reverse(),k.reverse(),y)}const uM=new WeakMap;function gx(u,e){if(!u.isAnonymous||e instanceof yo||e.type!=u)return 1;let a=uM.get(e);if(a==null){a=1;for(let t of e.children){if(t.type!=u||!(t instanceof Va)){a=1;break}a+=gx(u,t)}uM.set(e,a)}return a}function hA(u,e,a,t,r,n,i,o,s){let l=0;for(let x=t;x<r;x++)l+=gx(u,e[x]);let c=Math.ceil(l*1.5/8),d=[],E=[];function p(x,m,g,h,f){for(let k=g;k<h;){let y=k,v=m[k],b=gx(u,x[k]);for(k++;k<h;k++){let C=gx(u,x[k]);if(b+C>=c)break;b+=C}if(k==y+1){if(b>c){let C=x[y];p(C.children,C.positions,0,C.children.length,m[y]+f);continue}d.push(x[y])}else{let C=m[k-1]+x[k-1].length-v;d.push(hA(u,x,m,y,k,v,C,null,s))}E.push(v+f-n)}}return p(e,a,t,r,0),(o||s)(d,E,i)}class YJ{constructor(){this.map=new WeakMap}setBuffer(e,a,t){let r=this.map.get(e);r||this.map.set(e,r=new Map),r.set(a,t)}getBuffer(e,a){let t=this.map.get(e);return t&&t.get(a)}set(e,a){e instanceof rn?this.setBuffer(e.context.buffer,e.index,a):e instanceof ur&&this.map.set(e.tree,a)}get(e){return e instanceof rn?this.getBuffer(e.context.buffer,e.index):e instanceof ur?this.map.get(e.tree):void 0}cursorSet(e,a){e.buffer?this.setBuffer(e.buffer.buffer,e.index,a):this.map.set(e.tree,a)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class ci{constructor(e,a,t,r,n=!1,i=!1){this.from=e,this.to=a,this.tree=t,this.offset=r,this.open=(n?1:0)|(i?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,a=[],t=!1){let r=[new ci(0,e.length,e,0,!1,t)];for(let n of a)n.to>e.length&&r.push(n);return r}static applyChanges(e,a,t=128){if(!a.length)return e;let r=[],n=1,i=e.length?e[0]:null;for(let o=0,s=0,l=0;;o++){let c=o<a.length?a[o]:null,d=c?c.fromA:1e9;if(d-s>=t)for(;i&&i.from<d;){let E=i;if(s>=E.from||d<=E.to||l){let p=Math.max(E.from,s)-l,x=Math.min(E.to,d)-l;E=p>=x?null:new ci(p,x,E.tree,E.offset+l,o>0,!!c)}if(E&&r.push(E),i.to>d)break;i=n<e.length?e[n++]:null}if(!c)break;s=c.toA,l=c.toA-c.toB}return r}}let XJ=class{startParse(e,a,t){return typeof e=="string"&&(e=new QEu(e)),t=t?t.length?t.map(r=>new Ut(r.from,r.to)):[new Ut(0,0)]:[new Ut(0,e.length)],this.createParse(e,a||[],t)}parse(e,a,t){let r=this.startParse(e,a,t);for(;;){let n=r.advance();if(n)return n}}};class QEu{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,a){return this.string.slice(e,a)}}function YEu(u){return(e,a,t,r)=>new e3u(e,u,a,t,r)}class aM{constructor(e,a,t,r,n){this.parser=e,this.parse=a,this.overlay=t,this.target=r,this.from=n}}function tM(u){if(!u.length||u.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(u))}class XEu{constructor(e,a,t,r,n,i,o){this.parser=e,this.predicate=a,this.mounts=t,this.index=r,this.start=n,this.target=i,this.prev=o,this.depth=0,this.ranges=[]}}const Ly=new vu({perNode:!0});class e3u{constructor(e,a,t,r,n){this.nest=a,this.input=t,this.fragments=r,this.ranges=n,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let t=this.baseParse.advance();if(!t)return null;if(this.baseParse=null,this.baseTree=t,this.startInner(),this.stoppedAt!=null)for(let r of this.inner)r.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let t=this.baseTree;return this.stoppedAt!=null&&(t=new Va(t.type,t.children,t.positions,t.length,t.propValues.concat([[Ly,this.stoppedAt]]))),t}let e=this.inner[this.innerDone],a=e.parse.advance();if(a){this.innerDone++;let t=Object.assign(Object.create(null),e.target.props);t[vu.mounted.id]=new Gd(a,e.overlay,e.parser),e.target.props=t}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let a=this.innerDone;a<this.inner.length;a++)this.inner[a].from<e&&(e=Math.min(e,this.inner[a].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let a=this.innerDone;a<this.inner.length;a++)this.inner[a].parse.stopAt(e)}startInner(){let e=new t3u(this.fragments),a=null,t=null,r=new U5(new ur(this.baseTree,this.ranges[0].from,0,null),Ea.IncludeAnonymous|Ea.IgnoreMounts);e:for(let n,i;;){let o=!0,s;if(this.stoppedAt!=null&&r.from>=this.stoppedAt)o=!1;else if(e.hasNode(r)){if(a){let l=a.mounts.find(c=>c.frag.from<=r.from&&c.frag.to>=r.to&&c.mount.overlay);if(l)for(let c of l.mount.overlay){let d=c.from+l.pos,E=c.to+l.pos;d>=r.from&&E<=r.to&&!a.ranges.some(p=>p.from<E&&p.to>d)&&a.ranges.push({from:d,to:E})}}o=!1}else if(t&&(i=u3u(t.ranges,r.from,r.to)))o=i!=2;else if(!r.type.isAnonymous&&(n=this.nest(r,this.input))&&(r.from<r.to||!n.overlay)){r.tree||a3u(r);let l=e.findMounts(r.from,n.parser);if(typeof n.overlay=="function")a=new XEu(n.parser,n.overlay,l,this.inner.length,r.from,r.tree,a);else{let c=iM(this.ranges,n.overlay||(r.from<r.to?[new Ut(r.from,r.to)]:[]));c.length&&tM(c),(c.length||!n.overlay)&&this.inner.push(new aM(n.parser,c.length?n.parser.startParse(this.input,oM(l,c),c):n.parser.startParse(""),n.overlay?n.overlay.map(d=>new Ut(d.from-r.from,d.to-r.from)):null,r.tree,c.length?c[0].from:r.from)),n.overlay?c.length&&(t={ranges:c,depth:0,prev:t}):o=!1}}else if(a&&(s=a.predicate(r))&&(s===!0&&(s=new Ut(r.from,r.to)),s.from<s.to)){let l=a.ranges.length-1;l>=0&&a.ranges[l].to==s.from?a.ranges[l]={from:a.ranges[l].from,to:s.to}:a.ranges.push(s)}if(o&&r.firstChild())a&&a.depth++,t&&t.depth++;else for(;!r.nextSibling();){if(!r.parent())break e;if(a&&!--a.depth){let l=iM(this.ranges,a.ranges);l.length&&(tM(l),this.inner.splice(a.index,0,new aM(a.parser,a.parser.startParse(this.input,oM(a.mounts,l),l),a.ranges.map(c=>new Ut(c.from-a.start,c.to-a.start)),a.target,l[0].from))),a=a.prev}t&&!--t.depth&&(t=t.prev)}}}}function u3u(u,e,a){for(let t of u){if(t.from>=a)break;if(t.to>e)return t.from<=e&&t.to>=a?2:1}return 0}function rM(u,e,a,t,r,n){if(e<a){let i=u.buffer[e+1];t.push(u.slice(e,a,i)),r.push(i-n)}}function a3u(u){let{node:e}=u,a=[],t=e.context.buffer;do a.push(u.index),u.parent();while(!u.tree);let r=u.tree,n=r.children.indexOf(t),i=r.children[n],o=i.buffer,s=[n];function l(c,d,E,p,x,m){let g=a[m],h=[],f=[];rM(i,c,g,h,f,p);let k=o[g+1],y=o[g+2];s.push(h.length);let v=m?l(g+4,o[g+3],i.set.types[o[g]],k,y-k,m-1):e.toTree();return h.push(v),f.push(k-p),rM(i,o[g+3],d,h,f,p),new Va(E,h,f,x)}r.children[n]=l(0,o.length,Z0.none,0,i.length,a.length-1);for(let c of s){let d=u.tree.children[c],E=u.tree.positions[c];u.yield(new ur(d,E+u.from,c,u._tree))}}class nM{constructor(e,a){this.offset=a,this.done=!1,this.cursor=e.cursor(Ea.IncludeAnonymous|Ea.IgnoreMounts)}moveTo(e){let{cursor:a}=this,t=e-this.offset;for(;!this.done&&a.from<t;)a.to>=e&&a.enter(t,1,Ea.IgnoreOverlays|Ea.ExcludeBuffers)||a.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let a=this.cursor.tree;;){if(a==e.tree)return!0;if(a.children.length&&a.positions[0]==0&&a.children[0]instanceof Va)a=a.children[0];else break}return!1}}let t3u=class{constructor(e){var a;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let t=this.curFrag=e[0];this.curTo=(a=t.tree.prop(Ly))!==null&&a!==void 0?a:t.to,this.inner=new nM(t.tree,-t.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let a=this.curFrag=this.fragments[this.fragI];this.curTo=(e=a.tree.prop(Ly))!==null&&e!==void 0?e:a.to,this.inner=new nM(a.tree,-a.offset)}}findMounts(e,a){var t;let r=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let n=this.inner.cursor.node;n;n=n.parent){let i=(t=n.tree)===null||t===void 0?void 0:t.prop(vu.mounted);if(i&&i.parser==a)for(let o=this.fragI;o<this.fragments.length;o++){let s=this.fragments[o];if(s.from>=n.to)break;s.tree==this.curFrag.tree&&r.push({frag:s,pos:n.from-s.offset,mount:i})}}}return r}};function iM(u,e){let a=null,t=e;for(let r=1,n=0;r<u.length;r++){let i=u[r-1].to,o=u[r].from;for(;n<t.length;n++){let s=t[n];if(s.from>=o)break;s.to<=i||(a||(t=a=e.slice()),s.from<i?(a[n]=new Ut(s.from,i),s.to>o&&a.splice(n+1,0,new Ut(o,s.to))):s.to>o?a[n--]=new Ut(o,s.to):a.splice(n--,1))}}return t}function r3u(u,e,a,t){let r=0,n=0,i=!1,o=!1,s=-1e9,l=[];for(;;){let c=r==u.length?1e9:i?u[r].to:u[r].from,d=n==e.length?1e9:o?e[n].to:e[n].from;if(i!=o){let E=Math.max(s,a),p=Math.min(c,d,t);E<p&&l.push(new Ut(E,p))}if(s=Math.min(c,d),s==1e9)break;c==s&&(i?(i=!1,r++):i=!0),d==s&&(o?(o=!1,n++):o=!0)}return l}function oM(u,e){let a=[];for(let{pos:t,mount:r,frag:n}of u){let i=t+(r.overlay?r.overlay[0].from:0),o=i+r.tree.length,s=Math.max(n.from,i),l=Math.min(n.to,o);if(r.overlay){let c=r.overlay.map(E=>new Ut(E.from+t,E.to+t)),d=r3u(e,c,s,l);for(let E=0,p=s;;E++){let x=E==d.length,m=x?l:d[E].from;if(m>p&&a.push(new ci(p,m,r.tree,-i,n.from>=p||n.openStart,n.to<=m||n.openEnd)),x)break;p=d[E].to}}else a.push(new ci(s,l,r.tree,-i,n.from>=i||n.openStart,n.to<=o||n.openEnd))}return a}class Z5{constructor(e,a,t,r,n,i,o,s,l,c=0,d){this.p=e,this.stack=a,this.state=t,this.reducePos=r,this.pos=n,this.score=i,this.buffer=o,this.bufferBase=s,this.curContext=l,this.lookAhead=c,this.parent=d}toString(){return`[${this.stack.filter((e,a)=>a%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,a,t=0){let r=e.parser.context;return new Z5(e,[],a,t,t,0,[],0,r?new sM(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,a){this.stack.push(this.state,a,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var a;let t=e>>19,r=e&65535,{parser:n}=this.p,i=this.reducePos<this.pos-25;i&&this.setLookAhead(this.pos);let o=n.dynamicPrecedence(r);if(o&&(this.score+=o),t==0){this.pushState(n.getGoto(this.state,r,!0),this.reducePos),r<n.minRepeatTerm&&this.storeNode(r,this.reducePos,this.reducePos,i?8:4,!0),this.reduceContext(r,this.reducePos);return}let s=this.stack.length-(t-1)*3-(e&262144?6:0),l=s?this.stack[s-2]:this.p.ranges[0].from,c=this.reducePos-l;c>=2e3&&!(!((a=this.p.parser.nodeSet.types[r])===null||a===void 0)&&a.isAnonymous)&&(l==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSize<c&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=l,this.p.lastBigReductionSize=c));let d=s?this.stack[s-1]:0,E=this.bufferBase+this.buffer.length-d;if(r<n.minRepeatTerm||e&131072){let p=n.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(r,l,p,E+4,!0)}if(e&262144)this.state=this.stack[s];else{let p=this.stack[s-3];this.state=n.getGoto(p,r,!0)}for(;this.stack.length>s;)this.stack.pop();this.reduceContext(r,l)}storeNode(e,a,t,r=4,n=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let i=this,o=this.buffer.length;if(o==0&&i.parent&&(o=i.bufferBase-i.parent.bufferBase,i=i.parent),o>0&&i.buffer[o-4]==0&&i.buffer[o-1]>-1){if(a==t)return;if(i.buffer[o-2]>=a){i.buffer[o-2]=t;return}}}if(!n||this.pos==t)this.buffer.push(e,a,t,r);else{let i=this.buffer.length;if(i>0&&this.buffer[i-4]!=0){let o=!1;for(let s=i;s>0&&this.buffer[s-2]>t;s-=4)if(this.buffer[s-1]>=0){o=!0;break}if(o)for(;i>0&&this.buffer[i-2]>t;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4)}this.buffer[i]=e,this.buffer[i+1]=a,this.buffer[i+2]=t,this.buffer[i+3]=r}}shift(e,a,t,r){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let n=e,{parser:i}=this.p;(r>this.pos||a<=i.maxNode)&&(this.pos=r,i.stateFlag(n,1)||(this.reducePos=r)),this.pushState(n,t),this.shiftContext(a,t),a<=i.maxNode&&this.buffer.push(a,t,r,4)}else this.pos=r,this.shiftContext(a,t),a<=this.p.parser.maxNode&&this.buffer.push(a,t,r,4)}apply(e,a,t,r){e&65536?this.reduce(e):this.shift(e,a,t,r)}useNode(e,a){let t=this.p.reused.length-1;(t<0||this.p.reused[t]!=e)&&(this.p.reused.push(e),t++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(a,r),this.buffer.push(t,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,a=e.buffer.length;for(;a>0&&e.buffer[a-2]>e.reducePos;)a-=4;let t=e.buffer.slice(a),r=e.bufferBase+a;for(;e&&r==e.bufferBase;)e=e.parent;return new Z5(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,t,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,a){let t=e<=this.p.parser.maxNode;t&&this.storeNode(e,this.pos,a,4),this.storeNode(0,this.pos,a,t?8:4),this.pos=this.reducePos=a,this.score-=190}canShift(e){for(let a=new n3u(this);;){let t=this.p.parser.stateSlot(a.state,4)||this.p.parser.hasAction(a.state,e);if(t==0)return!1;if((t&65536)==0)return!0;a.reduce(t)}}recoverByInsert(e){if(this.stack.length>=300)return[];let a=this.p.parser.nextStates(this.state);if(a.length>8||this.stack.length>=120){let r=[];for(let n=0,i;n<a.length;n+=2)(i=a[n+1])!=this.state&&this.p.parser.hasAction(i,e)&&r.push(a[n],i);if(this.stack.length<120)for(let n=0;r.length<8&&n<a.length;n+=2){let i=a[n+1];r.some((o,s)=>s&1&&o==i)||r.push(a[n],i)}a=r}let t=[];for(let r=0;r<a.length&&t.length<4;r+=2){let n=a[r+1];if(n==this.state)continue;let i=this.split();i.pushState(n,this.pos),i.storeNode(0,i.pos,i.pos,4,!0),i.shiftContext(a[r],this.pos),i.reducePos=this.pos,i.score-=200,t.push(i)}return t}forceReduce(){let{parser:e}=this.p,a=e.stateSlot(this.state,5);if((a&65536)==0)return!1;if(!e.validAction(this.state,a)){let t=a>>19,r=a&65535,n=this.stack.length-t*3;if(n<0||e.getGoto(this.stack[n],r,!1)<0){let i=this.findForcedReduction();if(i==null)return!1;a=i}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(a),!0}findForcedReduction(){let{parser:e}=this.p,a=[],t=(r,n)=>{if(!a.includes(r))return a.push(r),e.allActions(r,i=>{if(!(i&393216))if(i&65536){let o=(i>>19)-n;if(o>1){let s=i&65535,l=this.stack.length-o*3;if(l>=0&&e.getGoto(this.stack[l],s,!1)>=0)return o<<19|65536|s}}else{let o=t(i,n+1);if(o!=null)return o}})};return t(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let a=0;a<this.stack.length;a+=3)if(this.stack[a]!=e.stack[a])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,a){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(a)))}reduceContext(e,a){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(a)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let a=new sM(this.curContext.tracker,e);a.hash!=this.curContext.hash&&this.emitContext(),this.curContext=a}}setLookAhead(e){e>this.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class sM{constructor(e,a){this.tracker=e,this.context=a,this.hash=e.strict?e.hash(a):0}}class n3u{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let a=e&65535,t=e>>19;t==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(t-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],a,!0);this.state=r}}class Q5{constructor(e,a,t){this.stack=e,this.pos=a,this.index=t,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,a=e.bufferBase+e.buffer.length){return new Q5(e,a,a-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new Q5(this.stack,this.pos,this.index)}}function H4(u,e=Uint16Array){if(typeof u!="string")return u;let a=null;for(let t=0,r=0;t<u.length;){let n=0;for(;;){let i=u.charCodeAt(t++),o=!1;if(i==126){n=65535;break}i>=92&&i--,i>=34&&i--;let s=i-32;if(s>=46&&(s-=46,o=!0),n+=s,o)break;n*=46}a?a[r++]=n:a=new e(n)}return a}class vx{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const lM=new vx;class i3u{constructor(e,a){this.input=e,this.ranges=a,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=lM,this.rangeIndex=0,this.pos=this.chunkPos=a[0].from,this.range=a[0],this.end=a[a.length-1].to,this.readNext()}resolveOffset(e,a){let t=this.range,r=this.rangeIndex,n=this.pos+e;for(;n<t.from;){if(!r)return null;let i=this.ranges[--r];n-=t.from-i.to,t=i}for(;a<0?n>t.to:n>=t.to;){if(r==this.ranges.length-1)return null;let i=this.ranges[++r];n+=i.from-t.to,t=i}return n}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let a of this.ranges)if(a.to>e)return Math.max(e,a.from);return this.end}peek(e){let a=this.chunkOff+e,t,r;if(a>=0&&a<this.chunk.length)t=this.pos+e,r=this.chunk.charCodeAt(a);else{let n=this.resolveOffset(e,1);if(n==null)return-1;if(t=n,t>=this.chunk2Pos&&t<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(t-this.chunk2Pos);else{let i=this.rangeIndex,o=this.range;for(;o.to<=t;)o=this.ranges[++i];this.chunk2=this.input.chunk(this.chunk2Pos=t),t+this.chunk2.length>o.to&&(this.chunk2=this.chunk2.slice(0,o.to-t)),r=this.chunk2.charCodeAt(0)}}return t>=this.token.lookAhead&&(this.token.lookAhead=t+1),r}acceptToken(e,a=0){let t=a?this.resolveOffset(a,-1):this.pos;if(t==null||t<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=t}acceptTokenTo(e,a){this.token.value=e,this.token.end=a}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:a}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=a,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),a=this.pos+e.length;this.chunk=a>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,a){if(a?(this.token=a,a.start=e,a.lookAhead=e+1,a.value=a.extended=-1):this.token=lM,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,a){if(e>=this.chunkPos&&a<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,a-this.chunkPos);if(e>=this.chunk2Pos&&a<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,a-this.chunk2Pos);if(e>=this.range.from&&a<=this.range.to)return this.input.read(e,a);let t="";for(let r of this.ranges){if(r.from>=a)break;r.to>e&&(t+=this.input.read(Math.max(r.from,e),Math.min(r.to,a)))}return t}}class b1{constructor(e,a){this.data=e,this.id=a}token(e,a){let{parser:t}=a.p;eU(this.data,e,a,this.id,t.data,t.tokenPrecTable)}}b1.prototype.contextual=b1.prototype.fallback=b1.prototype.extend=!1;class Y5{constructor(e,a,t){this.precTable=a,this.elseToken=t,this.data=typeof e=="string"?H4(e):e}token(e,a){let t=e.pos,r=0;for(;;){let n=e.next<0,i=e.resolveOffset(1,1);if(eU(this.data,e,a,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(n||r++,i==null)break;e.reset(i,e.token)}r&&(e.reset(t,e.token),e.acceptToken(this.elseToken,r))}}Y5.prototype.contextual=b1.prototype.fallback=b1.prototype.extend=!1;class v0{constructor(e,a={}){this.token=e,this.contextual=!!a.contextual,this.fallback=!!a.fallback,this.extend=!!a.extend}}function eU(u,e,a,t,r,n){let i=0,o=1<<t,{dialect:s}=a.p.parser;e:for(;(o&u[i])!=0;){let l=u[i+1];for(let p=i+3;p<l;p+=2)if((u[p+1]&o)>0){let x=u[p];if(s.allows(x)&&(e.token.value==-1||e.token.value==x||o3u(x,e.token.value,r,n))){e.acceptToken(x);break}}let c=e.next,d=0,E=u[i+2];if(e.next<0&&E>d&&u[l+E*3-3]==65535){i=u[l+E*3-1];continue e}for(;d<E;){let p=d+E>>1,x=l+p+(p<<1),m=u[x],g=u[x+1]||65536;if(c<m)E=p;else if(c>=g)d=p+1;else{i=u[x+2],e.advance();continue e}}break}}function cM(u,e,a){for(let t=e,r;(r=u[t])!=65535;t++)if(r==a)return t-e;return-1}function o3u(u,e,a,t){let r=cM(a,t,e);return r<0||cM(a,t,u)<r}const gt=typeof process<"u"&&process.env&&/\bparse\b/.test(process.env.LOG);let ok=null;function dM(u,e,a){let t=u.cursor(Ea.IncludeAnonymous);for(t.moveTo(e);;)if(!(a<0?t.childBefore(e):t.childAfter(e)))for(;;){if((a<0?t.to<e:t.from>e)&&!t.type.isError)return a<0?Math.max(0,Math.min(t.to-1,e-25)):Math.min(u.length,Math.max(t.from+1,e+25));if(a<0?t.prevSibling():t.nextSibling())break;if(!t.parent())return a<0?0:u.length}}class s3u{constructor(e,a){this.fragments=e,this.nodeSet=a,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?dM(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?dM(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let a=this.trees.length-1;if(a<0)return this.nextFragment(),null;let t=this.trees[a],r=this.index[a];if(r==t.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let n=t.children[r],i=this.start[a]+t.positions[r];if(i>e)return this.nextStart=i,null;if(n instanceof Va){if(i==e){if(i<this.safeFrom)return null;let o=i+n.length;if(o<=this.safeTo){let s=n.prop(vu.lookAhead);if(!s||o+s<this.fragment.to)return n}}this.index[a]++,i+n.length>=Math.max(this.safeFrom,e)&&(this.trees.push(n),this.start.push(i),this.index.push(0))}else this.index[a]++,this.nextStart=i+n.length}}}class l3u{constructor(e,a){this.stream=a,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(t=>new vx)}getActions(e){let a=0,t=null,{parser:r}=e.p,{tokenizers:n}=r,i=r.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,s=0;for(let l=0;l<n.length;l++){if((1<<l&i)==0)continue;let c=n[l],d=this.tokens[l];if(!(t&&!c.fallback)&&((c.contextual||d.start!=e.pos||d.mask!=i||d.context!=o)&&(this.updateCachedToken(d,c,e),d.mask=i,d.context=o),d.lookAhead>d.end+25&&(s=Math.max(d.lookAhead,s)),d.value!=0)){let E=a;if(d.extended>-1&&(a=this.addActions(e,d.extended,d.end,a)),a=this.addActions(e,d.value,d.end,a),!c.extend&&(t=d,a>E))break}}for(;this.actions.length>a;)this.actions.pop();return s&&e.setLookAhead(s),!t&&e.pos==this.stream.end&&(t=new vx,t.value=e.p.parser.eofTerm,t.start=t.end=e.pos,a=this.addActions(e,t.value,t.end,a)),this.mainToken=t,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let a=new vx,{pos:t,p:r}=e;return a.start=t,a.end=Math.min(t+1,r.stream.end),a.value=t==r.stream.end?r.parser.eofTerm:0,a}updateCachedToken(e,a,t){let r=this.stream.clipPos(t.pos);if(a.token(this.stream.reset(r,e),t),e.value>-1){let{parser:n}=t.p;for(let i=0;i<n.specialized.length;i++)if(n.specialized[i]==e.value){let o=n.specializers[i](this.stream.read(e.start,e.end),t);if(o>=0&&t.p.parser.dialect.allows(o>>1)){(o&1)==0?e.value=o>>1:e.extended=o>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,a,t,r){for(let n=0;n<r;n+=3)if(this.actions[n]==e)return r;return this.actions[r++]=e,this.actions[r++]=a,this.actions[r++]=t,r}addActions(e,a,t,r){let{state:n}=e,{parser:i}=e.p,{data:o}=i;for(let s=0;s<2;s++)for(let l=i.stateSlot(n,s?2:1);;l+=3){if(o[l]==65535)if(o[l+1]==1)l=ai(o,l+2);else{r==0&&o[l+1]==2&&(r=this.putAction(ai(o,l+2),a,t,r));break}o[l]==a&&(r=this.putAction(ai(o,l+1),a,t,r))}return r}}class c3u{constructor(e,a,t,r){this.parser=e,this.input=a,this.ranges=r,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new i3u(a,r),this.tokens=new l3u(e,this.stream),this.topTerm=e.top[1];let{from:n}=r[0];this.stacks=[Z5.start(this,e.top[0],n)],this.fragments=t.length&&this.stream.end-n>e.bufferLength*4?new s3u(t,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,a=this.minStackPos,t=this.stacks=[],r,n;if(this.bigReductionCount>300&&e.length==1){let[i]=e;for(;i.forceReduce()&&i.stack.length&&i.stack[i.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let i=0;i<e.length;i++){let o=e[i];for(;;){if(this.tokens.mainToken=null,o.pos>a)t.push(o);else{if(this.advanceStack(o,t,e))continue;{r||(r=[],n=[]),r.push(o);let s=this.tokens.getMainToken(o);n.push(s.value,s.end)}}break}}if(!t.length){let i=r&&E3u(r);if(i)return gt&&console.log("Finish with "+this.stackID(i)),this.stackToTree(i);if(this.parser.strict)throw gt&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+a);this.recovering||(this.recovering=5)}if(this.recovering&&r){let i=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,n,t);if(i)return gt&&console.log("Force-finish "+this.stackID(i)),this.stackToTree(i.forceAll())}if(this.recovering){let i=this.recovering==1?1:this.recovering*3;if(t.length>i)for(t.sort((o,s)=>s.score-o.score);t.length>i;)t.pop();t.some(o=>o.reducePos>a)&&this.recovering--}else if(t.length>1){e:for(let i=0;i<t.length-1;i++){let o=t[i];for(let s=i+1;s<t.length;s++){let l=t[s];if(o.sameState(l)||o.buffer.length>500&&l.buffer.length>500)if((o.score-l.score||o.buffer.length-l.buffer.length)>0)t.splice(s--,1);else{t.splice(i--,1);continue e}}}t.length>12&&t.splice(12,t.length-12)}this.minStackPos=t[0].pos;for(let i=1;i<t.length;i++)t[i].pos<this.minStackPos&&(this.minStackPos=t[i].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,a,t){let r=e.pos,{parser:n}=this,i=gt?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let l=e.curContext&&e.curContext.tracker.strict,c=l?e.curContext.hash:0;for(let d=this.fragments.nodeAt(r);d;){let E=this.parser.nodeSet.types[d.type.id]==d.type?n.getGoto(e.state,d.type.id):-1;if(E>-1&&d.length&&(!l||(d.prop(vu.contextHash)||0)==c))return e.useNode(d,E),gt&&console.log(i+this.stackID(e)+` (via reuse of ${n.getName(d.type.id)})`),!0;if(!(d instanceof Va)||d.children.length==0||d.positions[0]>0)break;let p=d.children[0];if(p instanceof Va&&d.positions[0]==0)d=p;else break}}let o=n.stateSlot(e.state,4);if(o>0)return e.reduce(o),gt&&console.log(i+this.stackID(e)+` (via always-reduce ${n.getName(o&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let s=this.tokens.getActions(e);for(let l=0;l<s.length;){let c=s[l++],d=s[l++],E=s[l++],p=l==s.length||!t,x=p?e:e.split(),m=this.tokens.mainToken;if(x.apply(c,d,m?m.start:x.pos,E),gt&&console.log(i+this.stackID(x)+` (via ${(c&65536)==0?"shift":`reduce of ${n.getName(c&65535)}`} for ${n.getName(d)} @ ${r}${x==e?"":", split"})`),p)return!0;x.pos>r?a.push(x):t.push(x)}return!1}advanceFully(e,a){let t=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>t)return EM(e,a),!0}}runRecovery(e,a,t){let r=null,n=!1;for(let i=0;i<e.length;i++){let o=e[i],s=a[i<<1],l=a[(i<<1)+1],c=gt?this.stackID(o)+" -> ":"";if(o.deadEnd&&(n||(n=!0,o.restart(),gt&&console.log(c+this.stackID(o)+" (restarted)"),this.advanceFully(o,t))))continue;let d=o.split(),E=c;for(let p=0;d.forceReduce()&&p<10&&(gt&&console.log(E+this.stackID(d)+" (via force-reduce)"),!this.advanceFully(d,t));p++)gt&&(E=this.stackID(d)+" -> ");for(let p of o.recoverByInsert(s))gt&&console.log(c+this.stackID(p)+" (via recover-insert)"),this.advanceFully(p,t);this.stream.end>o.pos?(l==o.pos&&(l++,s=0),o.recoverByDelete(s,l),gt&&console.log(c+this.stackID(o)+` (via recover-delete ${this.parser.getName(s)})`),EM(o,t)):(!r||r.score<o.score)&&(r=o)}return r}stackToTree(e){return e.close(),Va.build({buffer:Q5.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let a=(ok||(ok=new WeakMap)).get(e);return a||ok.set(e,a=String.fromCodePoint(this.nextStackID++)),a+e}}function EM(u,e){for(let a=0;a<e.length;a++){let t=e[a];if(t.pos==u.pos&&t.sameState(u)){e[a].score<u.score&&(e[a]=u);return}}e.push(u)}class d3u{constructor(e,a,t){this.source=e,this.flags=a,this.disabled=t}allows(e){return!this.disabled||this.disabled[e]==0}}const sk=u=>u;class tg{constructor(e){this.start=e.start,this.shift=e.shift||sk,this.reduce=e.reduce||sk,this.reuse=e.reuse||sk,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class gi extends XJ{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let a=e.nodeNames.split(" ");this.minRepeatTerm=a.length;for(let o=0;o<e.repeatNodeCount;o++)a.push("");let t=Object.keys(e.topRules).map(o=>e.topRules[o][1]),r=[];for(let o=0;o<a.length;o++)r.push([]);function n(o,s,l){r[o].push([s,s.deserialize(String(l))])}if(e.nodeProps)for(let o of e.nodeProps){let s=o[0];typeof s=="string"&&(s=vu[s]);for(let l=1;l<o.length;){let c=o[l++];if(c>=0)n(c,s,o[l++]);else{let d=o[l+-c];for(let E=-c;E>0;E--)n(o[l++],s,d);l++}}}this.nodeSet=new EA(a.map((o,s)=>Z0.define({name:s>=this.minRepeatTerm?void 0:o,id:s,props:r[s],top:t.indexOf(s)>-1,error:s==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(s)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=JJ;let i=H4(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let o=0;o<this.specializerSpecs.length;o++)this.specialized[o]=this.specializerSpecs[o].term;this.specializers=this.specializerSpecs.map(pM),this.states=H4(e.states,Uint32Array),this.data=H4(e.stateData),this.goto=H4(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(o=>typeof o=="number"?new b1(i,o):o),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,a,t){let r=new c3u(this,e,a,t);for(let n of this.wrappers)r=n(r,e,a,t);return r}getGoto(e,a,t=!1){let r=this.goto;if(a>=r[0])return-1;for(let n=r[a+1];;){let i=r[n++],o=i&1,s=r[n++];if(o&&t)return s;for(let l=n+(i>>1);n<l;n++)if(r[n]==e)return s;if(o)return-1}}hasAction(e,a){let t=this.data;for(let r=0;r<2;r++)for(let n=this.stateSlot(e,r?2:1),i;;n+=3){if((i=t[n])==65535)if(t[n+1]==1)i=t[n=ai(t,n+2)];else{if(t[n+1]==2)return ai(t,n+2);break}if(i==a||i==0)return ai(t,n+1)}return 0}stateSlot(e,a){return this.states[e*6+a]}stateFlag(e,a){return(this.stateSlot(e,0)&a)>0}validAction(e,a){return!!this.allActions(e,t=>t==a?!0:null)}allActions(e,a){let t=this.stateSlot(e,4),r=t?a(t):void 0;for(let n=this.stateSlot(e,1);r==null;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=ai(this.data,n+2);else break;r=a(ai(this.data,n+1))}return r}nextStates(e){let a=[];for(let t=this.stateSlot(e,1);;t+=3){if(this.data[t]==65535)if(this.data[t+1]==1)t=ai(this.data,t+2);else break;if((this.data[t+2]&1)==0){let r=this.data[t+1];a.some((n,i)=>i&1&&n==r)||a.push(this.data[t],r)}}return a}configure(e){let a=Object.assign(Object.create(gi.prototype),this);if(e.props&&(a.nodeSet=this.nodeSet.extend(...e.props)),e.top){let t=this.topRules[e.top];if(!t)throw new RangeError(`Invalid top rule name ${e.top}`);a.top=t}return e.tokenizers&&(a.tokenizers=this.tokenizers.map(t=>{let r=e.tokenizers.find(n=>n.from==t);return r?r.to:t})),e.specializers&&(a.specializers=this.specializers.slice(),a.specializerSpecs=this.specializerSpecs.map((t,r)=>{let n=e.specializers.find(o=>o.from==t.external);if(!n)return t;let i=Object.assign(Object.assign({},t),{external:n.to});return a.specializers[r]=pM(i),i})),e.contextTracker&&(a.context=e.contextTracker),e.dialect&&(a.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(a.strict=e.strict),e.wrap&&(a.wrappers=a.wrappers.concat(e.wrap)),e.bufferLength!=null&&(a.bufferLength=e.bufferLength),a}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let a=this.dynamicPrecedences;return a==null?0:a[e]||0}parseDialect(e){let a=Object.keys(this.dialects),t=a.map(()=>!1);if(e)for(let n of e.split(" ")){let i=a.indexOf(n);i>=0&&(t[i]=!0)}let r=null;for(let n=0;n<a.length;n++)if(!t[n])for(let i=this.dialects[a[n]],o;(o=this.data[i++])!=65535;)(r||(r=new Uint8Array(this.maxTerm+1)))[o]=1;return new d3u(e,t,r)}static deserialize(e){return new gi(e)}}function ai(u,e){return u[e]|u[e+1]<<16}function E3u(u){let e=null;for(let a of u){let t=a.p.stoppedAt;(a.pos==a.p.stream.end||t!=null&&a.pos>t)&&a.p.parser.stateFlag(a.state,2)&&(!e||e.score<a.score)&&(e=a)}return e}function pM(u){if(u.external){let e=u.extend?1:0;return(a,t)=>u.external(a,t)<<1|e}return u.get}let p3u=0,ti=class Iy{constructor(e,a,t,r){this.name=e,this.set=a,this.base=t,this.modified=r,this.id=p3u++}toString(){let{name:e}=this;for(let a of this.modified)a.name&&(e=`${a.name}(${e})`);return e}static define(e,a){let t=typeof e=="string"?e:"?";if(e instanceof Iy&&(a=e),a?.base)throw new Error("Can not derive from a modified tag");let r=new Iy(t,[],null,[]);if(r.set.push(r),a)for(let n of a.set)r.set.push(n);return r}static defineModifier(e){let a=new X5(e);return t=>t.modified.indexOf(a)>-1?t:X5.get(t.base||t,t.modified.concat(a).sort((r,n)=>r.id-n.id))}},m3u=0;class X5{constructor(e){this.name=e,this.instances=[],this.id=m3u++}static get(e,a){if(!a.length)return e;let t=a[0].instances.find(o=>o.base==e&&h3u(a,o.modified));if(t)return t;let r=[],n=new ti(e.name,r,e,a);for(let o of a)o.instances.push(n);let i=x3u(a);for(let o of e.set)if(!o.modified.length)for(let s of i)r.push(X5.get(o,s));return n}}function h3u(u,e){return u.length==e.length&&u.every((a,t)=>a==e[t])}function x3u(u){let e=[[]];for(let a=0;a<u.length;a++)for(let t=0,r=e.length;t<r;t++)e.push(e[t].concat(u[a]));return e.sort((a,t)=>t.length-a.length)}function Xs(u){let e=Object.create(null);for(let a in u){let t=u[a];Array.isArray(t)||(t=[t]);for(let r of a.split(" "))if(r){let n=[],i=2,o=r;for(let d=0;;){if(o=="..."&&d>0&&d+3==r.length){i=1;break}let E=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(o);if(!E)throw new RangeError("Invalid path: "+r);if(n.push(E[0]=="*"?"":E[0][0]=='"'?JSON.parse(E[0]):E[0]),d+=E[0].length,d==r.length)break;let p=r[d++];if(d==r.length&&p=="!"){i=0;break}if(p!="/")throw new RangeError("Invalid path: "+r);o=r.slice(d)}let s=n.length-1,l=n[s];if(!l)throw new RangeError("Invalid path: "+r);let c=new eD(t,i,s>0?n.slice(0,s):null);e[l]=c.sort(e[l])}}return uU.add(e)}const uU=new vu;class eD{constructor(e,a,t,r){this.tags=e,this.mode=a,this.context=t,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}eD.empty=new eD([],2,null);function aU(u,e){let a=Object.create(null);for(let n of u)if(!Array.isArray(n.tag))a[n.tag.id]=n.class;else for(let i of n.tag)a[i.id]=n.class;let{scope:t,all:r=null}=e||{};return{style:n=>{let i=r;for(let o of n)for(let s of o.set){let l=a[s.id];if(l){i=i?i+" "+l:l;break}}return i},scope:t}}function D3u(u,e){let a=null;for(let t of u){let r=t.style(e);r&&(a=a?a+" "+r:r)}return a}function f3u(u,e,a,t=0,r=u.length){let n=new g3u(t,Array.isArray(e)?e:[e],a);n.highlightRange(u.cursor(),t,r,"",n.highlighters),n.flush(r)}class g3u{constructor(e,a,t){this.at=e,this.highlighters=a,this.span=t,this.class=""}startSpan(e,a){a!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=a)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,a,t,r,n){let{type:i,from:o,to:s}=e;if(o>=t||s<=a)return;i.isTop&&(n=this.highlighters.filter(p=>!p.scope||p.scope(i)));let l=r,c=v3u(e)||eD.empty,d=D3u(n,c.tags);if(d&&(l&&(l+=" "),l+=d,c.mode==1&&(r+=(r?" ":"")+d)),this.startSpan(Math.max(a,o),l),c.opaque)return;let E=e.tree&&e.tree.prop(vu.mounted);if(E&&E.overlay){let p=e.node.enter(E.overlay[0].from+o,1),x=this.highlighters.filter(g=>!g.scope||g.scope(E.tree.type)),m=e.firstChild();for(let g=0,h=o;;g++){let f=g<E.overlay.length?E.overlay[g]:null,k=f?f.from+o:s,y=Math.max(a,h),v=Math.min(t,k);if(y<v&&m)for(;e.from<v&&(this.highlightRange(e,y,v,r,n),this.startSpan(Math.min(v,e.to),l),!(e.to>=k||!e.nextSibling())););if(!f||k>t)break;h=f.to+o,h>a&&(this.highlightRange(p.cursor(),Math.max(a,f.from+o),Math.min(t,h),"",x),this.startSpan(Math.min(t,h),l))}m&&e.parent()}else if(e.firstChild()){E&&(r="");do if(!(e.to<=a)){if(e.from>=t)break;this.highlightRange(e,a,t,r,n),this.startSpan(Math.min(t,e.to),l)}while(e.nextSibling());e.parent()}}}function v3u(u){let e=u.type.prop(uU);for(;e&&e.context&&!u.matchContext(e.context);)e=e.next;return e||null}const $e=ti.define,ph=$e(),eo=$e(),mM=$e(eo),hM=$e(eo),uo=$e(),mh=$e(uo),lk=$e(uo),qr=$e(),ss=$e(qr),Ir=$e(),Kr=$e(),Ky=$e(),k4=$e(Ky),hh=$e(),Z={comment:ph,lineComment:$e(ph),blockComment:$e(ph),docComment:$e(ph),name:eo,variableName:$e(eo),typeName:mM,tagName:$e(mM),propertyName:hM,attributeName:$e(hM),className:$e(eo),labelName:$e(eo),namespace:$e(eo),macroName:$e(eo),literal:uo,string:mh,docString:$e(mh),character:$e(mh),attributeValue:$e(mh),number:lk,integer:$e(lk),float:$e(lk),bool:$e(uo),regexp:$e(uo),escape:$e(uo),color:$e(uo),url:$e(uo),keyword:Ir,self:$e(Ir),null:$e(Ir),atom:$e(Ir),unit:$e(Ir),modifier:$e(Ir),operatorKeyword:$e(Ir),controlKeyword:$e(Ir),definitionKeyword:$e(Ir),moduleKeyword:$e(Ir),operator:Kr,derefOperator:$e(Kr),arithmeticOperator:$e(Kr),logicOperator:$e(Kr),bitwiseOperator:$e(Kr),compareOperator:$e(Kr),updateOperator:$e(Kr),definitionOperator:$e(Kr),typeOperator:$e(Kr),controlOperator:$e(Kr),punctuation:Ky,separator:$e(Ky),bracket:k4,angleBracket:$e(k4),squareBracket:$e(k4),paren:$e(k4),brace:$e(k4),content:qr,heading:ss,heading1:$e(ss),heading2:$e(ss),heading3:$e(ss),heading4:$e(ss),heading5:$e(ss),heading6:$e(ss),contentSeparator:$e(qr),list:$e(qr),quote:$e(qr),emphasis:$e(qr),strong:$e(qr),link:$e(qr),monospace:$e(qr),strikethrough:$e(qr),inserted:$e(),deleted:$e(),changed:$e(),invalid:$e(),meta:hh,documentMeta:$e(hh),annotation:$e(hh),processingInstruction:$e(hh),definition:ti.defineModifier("definition"),constant:ti.defineModifier("constant"),function:ti.defineModifier("function"),standard:ti.defineModifier("standard"),local:ti.defineModifier("local"),special:ti.defineModifier("special")};for(let u in Z){let e=Z[u];e instanceof ti&&(e.name=u)}aU([{tag:Z.link,class:"tok-link"},{tag:Z.heading,class:"tok-heading"},{tag:Z.emphasis,class:"tok-emphasis"},{tag:Z.strong,class:"tok-strong"},{tag:Z.keyword,class:"tok-keyword"},{tag:Z.atom,class:"tok-atom"},{tag:Z.bool,class:"tok-bool"},{tag:Z.url,class:"tok-url"},{tag:Z.labelName,class:"tok-labelName"},{tag:Z.inserted,class:"tok-inserted"},{tag:Z.deleted,class:"tok-deleted"},{tag:Z.literal,class:"tok-literal"},{tag:Z.string,class:"tok-string"},{tag:Z.number,class:"tok-number"},{tag:[Z.regexp,Z.escape,Z.special(Z.string)],class:"tok-string2"},{tag:Z.variableName,class:"tok-variableName"},{tag:Z.local(Z.variableName),class:"tok-variableName tok-local"},{tag:Z.definition(Z.variableName),class:"tok-variableName tok-definition"},{tag:Z.special(Z.variableName),class:"tok-variableName2"},{tag:Z.definition(Z.propertyName),class:"tok-propertyName tok-definition"},{tag:Z.typeName,class:"tok-typeName"},{tag:Z.namespace,class:"tok-namespace"},{tag:Z.className,class:"tok-className"},{tag:Z.macroName,class:"tok-macroName"},{tag:Z.propertyName,class:"tok-propertyName"},{tag:Z.operator,class:"tok-operator"},{tag:Z.comment,class:"tok-comment"},{tag:Z.meta,class:"tok-meta"},{tag:Z.invalid,class:"tok-invalid"},{tag:Z.punctuation,class:"tok-punctuation"}]);const k3u=Xs({String:Z.string,Number:Z.number,"True False":Z.bool,PropertyName:Z.propertyName,Null:Z.null,",":Z.separator,"[ ]":Z.squareBracket,"{ }":Z.brace}),b3u=gi.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j",stateData:"#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O",goto:"!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName ] [ Array",maxTerm:25,nodeProps:[["openedBy",7,"{",12,"["],["closedBy",8,"}",13,"]"]],propSources:[k3u],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oc~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Oe~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zOh~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yOg~~'OO]~~'TO[~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0});let Vy=[],tU=[];(()=>{let u="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,a=0;e<u.length;e++)(e%2?tU:Vy).push(a=a+u[e])})();function y3u(u){if(u<768)return!1;for(let e=0,a=Vy.length;;){let t=e+a>>1;if(u<Vy[t])a=t;else if(u>=tU[t])e=t+1;else return!0;if(e==a)return!1}}function xM(u){return u>=127462&&u<=127487}const DM=8205;function C3u(u,e,a=!0,t=!0){return(a?rU:F3u)(u,e,t)}function rU(u,e,a){if(e==u.length)return e;e&&nU(u.charCodeAt(e))&&iU(u.charCodeAt(e-1))&&e--;let t=ck(u,e);for(e+=fM(t);e<u.length;){let r=ck(u,e);if(t==DM||r==DM||a&&y3u(r))e+=fM(r),t=r;else if(xM(r)){let n=0,i=e-2;for(;i>=0&&xM(ck(u,i));)n++,i-=2;if(n%2==0)break;e+=2}else break}return e}function F3u(u,e,a){for(;e>0;){let t=rU(u,e-2,a);if(t<e)return t;e--}return 0}function ck(u,e){let a=u.charCodeAt(e);if(!iU(a)||e+1==u.length)return a;let t=u.charCodeAt(e+1);return nU(t)?(a-55296<<10)+(t-56320)+65536:a}function nU(u){return u>=56320&&u<57344}function iU(u){return u>=55296&&u<56320}function fM(u){return u<65536?1:2}class Mu{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,a,t){[e,a]=W1(this,e,a);let r=[];return this.decompose(0,e,r,2),t.length&&t.decompose(0,t.length,r,3),this.decompose(a,this.length,r,1),en.from(r,this.length-(a-e)+t.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,a=this.length){[e,a]=W1(this,e,a);let t=[];return this.decompose(e,a,t,0),en.from(t,a-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let a=this.scanIdentical(e,1),t=this.length-this.scanIdentical(e,-1),r=new Ed(this),n=new Ed(e);for(let i=a,o=a;;){if(r.next(i),n.next(i),i=0,r.lineBreak!=n.lineBreak||r.done!=n.done||r.value!=n.value)return!1;if(o+=r.value.length,r.done||o>=t)return!0}}iter(e=1){return new Ed(this,e)}iterRange(e,a=this.length){return new oU(this,e,a)}iterLines(e,a){let t;if(e==null)t=this.iter();else{a==null&&(a=this.lines+1);let r=this.line(e).from;t=this.iterRange(r,Math.max(r,a==this.lines+1?this.length:a<=1?0:this.line(a-1).to))}return new sU(t)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?Mu.empty:e.length<=32?new $a(e):en.from($a.split(e,[]))}}class $a extends Mu{constructor(e,a=A3u(e)){super(),this.text=e,this.length=a}get lines(){return this.text.length}get children(){return null}lineInner(e,a,t,r){for(let n=0;;n++){let i=this.text[n],o=r+i.length;if((a?t:o)>=e)return new B3u(r,o,t,i);r=o+1,t++}}decompose(e,a,t,r){let n=e<=0&&a>=this.length?this:new $a(gM(this.text,e,a),Math.min(a,this.length)-Math.max(0,e));if(r&1){let i=t.pop(),o=kx(n.text,i.text.slice(),0,n.length);if(o.length<=32)t.push(new $a(o,i.length+n.length));else{let s=o.length>>1;t.push(new $a(o.slice(0,s)),new $a(o.slice(s)))}}else t.push(n)}replace(e,a,t){if(!(t instanceof $a))return super.replace(e,a,t);[e,a]=W1(this,e,a);let r=kx(this.text,kx(t.text,gM(this.text,0,e)),a),n=this.length+t.length-(a-e);return r.length<=32?new $a(r,n):en.from($a.split(r,[]),n)}sliceString(e,a=this.length,t=`
476
476
  `){[e,a]=W1(this,e,a);let r="";for(let n=0,i=0;n<=a&&i<this.text.length;i++){let o=this.text[i],s=n+o.length;n>e&&i&&(r+=t),e<s&&a>n&&(r+=o.slice(Math.max(0,e-n),a-n)),n=s+1}return r}flatten(e){for(let a of this.text)e.push(a)}scanIdentical(){return 0}static split(e,a){let t=[],r=-1;for(let n of e)t.push(n),r+=n.length+1,t.length==32&&(a.push(new $a(t,r)),t=[],r=-1);return r>-1&&a.push(new $a(t,r)),a}}class en extends Mu{constructor(e,a){super(),this.children=e,this.length=a,this.lines=0;for(let t of e)this.lines+=t.lines}lineInner(e,a,t,r){for(let n=0;;n++){let i=this.children[n],o=r+i.length,s=t+i.lines-1;if((a?s:o)>=e)return i.lineInner(e,a,t,r);r=o+1,t=s+1}}decompose(e,a,t,r){for(let n=0,i=0;i<=a&&n<this.children.length;n++){let o=this.children[n],s=i+o.length;if(e<=s&&a>=i){let l=r&((i<=e?1:0)|(s>=a?2:0));i>=e&&s<=a&&!l?t.push(o):o.decompose(e-i,a-i,t,l)}i=s+1}}replace(e,a,t){if([e,a]=W1(this,e,a),t.lines<this.lines)for(let r=0,n=0;r<this.children.length;r++){let i=this.children[r],o=n+i.length;if(e>=n&&a<=o){let s=i.replace(e-n,a-n,t),l=this.lines-i.lines+s.lines;if(s.lines<l>>4&&s.lines>l>>6){let c=this.children.slice();return c[r]=s,new en(c,this.length-(a-e)+t.length)}return super.replace(n,o,s)}n=o+1}return super.replace(e,a,t)}sliceString(e,a=this.length,t=`
477
477
  `){[e,a]=W1(this,e,a);let r="";for(let n=0,i=0;n<this.children.length&&i<=a;n++){let o=this.children[n],s=i+o.length;i>e&&n&&(r+=t),e<s&&a>i&&(r+=o.sliceString(e-i,a-i,t)),i=s+1}return r}flatten(e){for(let a of this.children)a.flatten(e)}scanIdentical(e,a){if(!(e instanceof en))return 0;let t=0,[r,n,i,o]=a>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=a,n+=a){if(r==i||n==o)return t;let s=this.children[r],l=e.children[n];if(s!=l)return t+s.scanIdentical(l,a);t+=s.length+1}}static from(e,a=e.reduce((t,r)=>t+r.length+1,-1)){let t=0;for(let p of e)t+=p.lines;if(t<32){let p=[];for(let x of e)x.flatten(p);return new $a(p,a)}let r=Math.max(32,t>>5),n=r<<1,i=r>>1,o=[],s=0,l=-1,c=[];function d(p){let x;if(p.lines>n&&p instanceof en)for(let m of p.children)d(m);else p.lines>i&&(s>i||!s)?(E(),o.push(p)):p instanceof $a&&s&&(x=c[c.length-1])instanceof $a&&p.lines+x.lines<=32?(s+=p.lines,l+=p.length+1,c[c.length-1]=new $a(x.text.concat(p.text),x.length+1+p.length)):(s+p.lines>r&&E(),s+=p.lines,l+=p.length+1,c.push(p))}function E(){s!=0&&(o.push(c.length==1?c[0]:en.from(c,l)),l=-1,s=c.length=0)}for(let p of e)d(p);return E(),o.length==1?o[0]:new en(o,a)}}Mu.empty=new $a([""],0);function A3u(u){let e=-1;for(let a of u)e+=a.length+1;return e}function kx(u,e,a=0,t=1e9){for(let r=0,n=0,i=!0;n<u.length&&r<=t;n++){let o=u[n],s=r+o.length;s>=a&&(s>t&&(o=o.slice(0,t-r)),r<a&&(o=o.slice(a-r)),i?(e[e.length-1]+=o,i=!1):e.push(o)),r=s+1}return e}function gM(u,e,a){return kx(u,[""],e,a)}class Ed{constructor(e,a=1){this.dir=a,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[a>0?1:(e instanceof $a?e.text.length:e.children.length)<<1]}nextInner(e,a){for(this.done=this.lineBreak=!1;;){let t=this.nodes.length-1,r=this.nodes[t],n=this.offsets[t],i=n>>1,o=r instanceof $a?r.text.length:r.children.length;if(i==(a>0?o:0)){if(t==0)return this.done=!0,this.value="",this;a>0&&this.offsets[t-1]++,this.nodes.pop(),this.offsets.pop()}else if((n&1)==(a>0?0:1)){if(this.offsets[t]+=a,e==0)return this.lineBreak=!0,this.value=`
478
478
  `,this;e--}else if(r instanceof $a){let s=r.text[i+(a<0?-1:0)];if(this.offsets[t]+=a,s.length>Math.max(0,e))return this.value=e==0?s:a>0?s.slice(e):s.slice(0,s.length-e),this;e-=s.length}else{let s=r.children[i+(a<0?-1:0)];e>s.length?(e-=s.length,this.offsets[t]+=a):(a<0&&this.offsets[t]--,this.nodes.push(s),this.offsets.push(a>0?1:(s instanceof $a?s.text.length:s.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class oU{constructor(e,a,t){this.value="",this.done=!1,this.cursor=new Ed(e,a>t?-1:1),this.pos=a>t?e.length:0,this.from=Math.min(a,t),this.to=Math.max(a,t)}nextInner(e,a){if(a<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,a<0?this.pos-this.to:this.from-this.pos);let t=a<0?this.pos-this.from:this.to-this.pos;e>t&&(e=t),t-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*a,this.value=r.length<=t?r:a<0?r.slice(r.length-t):r.slice(0,t),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class sU{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:a,lineBreak:t,value:r}=this.inner.next(e);return a&&this.afterBreak?(this.value="",this.afterBreak=!1):a?(this.done=!0,this.value=""):t?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Mu.prototype[Symbol.iterator]=function(){return this.iter()},Ed.prototype[Symbol.iterator]=oU.prototype[Symbol.iterator]=sU.prototype[Symbol.iterator]=function(){return this});let B3u=class{constructor(e,a,t,r){this.from=e,this.to=a,this.number=t,this.text=r}get length(){return this.to-this.from}};function W1(u,e,a){return e=Math.max(0,Math.min(u.length,e)),[e,Math.max(e,Math.min(u.length,a))]}function x0(u,e,a=!0,t=!0){return C3u(u,e,a,t)}function S3u(u){return u>=56320&&u<57344}function z3u(u){return u>=55296&&u<56320}function st(u,e){let a=u.charCodeAt(e);if(!z3u(a)||e+1==u.length)return a;let t=u.charCodeAt(e+1);return S3u(t)?(a-55296<<10)+(t-56320)+65536:a}function xA(u){return u<=65535?String.fromCharCode(u):(u-=65536,String.fromCharCode((u>>10)+55296,(u&1023)+56320))}function un(u){return u<65536?1:2}const Gy=/\r\n?|\n/;var h0=(function(u){return u[u.Simple=0]="Simple",u[u.TrackDel=1]="TrackDel",u[u.TrackBefore=2]="TrackBefore",u[u.TrackAfter=3]="TrackAfter",u})(h0||(h0={}));class hn{constructor(e){this.sections=e}get length(){let e=0;for(let a=0;a<this.sections.length;a+=2)e+=this.sections[a];return e}get newLength(){let e=0;for(let a=0;a<this.sections.length;a+=2){let t=this.sections[a+1];e+=t<0?this.sections[a]:t}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let a=0,t=0,r=0;a<this.sections.length;){let n=this.sections[a++],i=this.sections[a++];i<0?(e(t,r,n),r+=n):r+=i,t+=n}}iterChangedRanges(e,a=!1){Hy(this,e,a)}get invertedDesc(){let e=[];for(let a=0;a<this.sections.length;){let t=this.sections[a++],r=this.sections[a++];r<0?e.push(t,r):e.push(r,t)}return new hn(e)}composeDesc(e){return this.empty?e:e.empty?this:lU(this,e)}mapDesc(e,a=!1){return e.empty?this:qy(this,e,a)}mapPos(e,a=-1,t=h0.Simple){let r=0,n=0;for(let i=0;i<this.sections.length;){let o=this.sections[i++],s=this.sections[i++],l=r+o;if(s<0){if(l>e)return n+(e-r);n+=o}else{if(t!=h0.Simple&&l>=e&&(t==h0.TrackDel&&r<e&&l>e||t==h0.TrackBefore&&r<e||t==h0.TrackAfter&&l>e))return null;if(l>e||l==e&&a<0&&!o)return e==r||a<0?n:n+s;n+=s}r=l}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return n}touchesRange(e,a=e){for(let t=0,r=0;t<this.sections.length&&r<=a;){let n=this.sections[t++],i=this.sections[t++],o=r+n;if(i>=0&&r<=a&&o>=e)return r<e&&o>a?"cover":!0;r=o}return!1}toString(){let e="";for(let a=0;a<this.sections.length;){let t=this.sections[a++],r=this.sections[a++];e+=(e?" ":"")+t+(r>=0?":"+r:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(a=>typeof a!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new hn(e)}static create(e){return new hn(e)}}class Ja extends hn{constructor(e,a){super(e),this.inserted=a}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return Hy(this,(a,t,r,n,i)=>e=e.replace(r,r+(t-a),i),!1),e}mapDesc(e,a=!1){return qy(this,e,a,!0)}invert(e){let a=this.sections.slice(),t=[];for(let r=0,n=0;r<a.length;r+=2){let i=a[r],o=a[r+1];if(o>=0){a[r]=o,a[r+1]=i;let s=r>>1;for(;t.length<s;)t.push(Mu.empty);t.push(i?e.slice(n,n+i):Mu.empty)}n+=i}return new Ja(a,t)}compose(e){return this.empty?e:e.empty?this:lU(this,e,!0)}map(e,a=!1){return e.empty?this:qy(this,e,a,!0)}iterChanges(e,a=!1){Hy(this,e,a)}get desc(){return hn.create(this.sections)}filter(e){let a=[],t=[],r=[],n=new qd(this);e:for(let i=0,o=0;;){let s=i==e.length?1e9:e[i++];for(;o<s||o==s&&n.len==0;){if(n.done)break e;let c=Math.min(n.len,s-o);O0(r,c,-1);let d=n.ins==-1?-1:n.off==0?n.ins:0;O0(a,c,d),d>0&&io(t,a,n.text),n.forward(c),o+=c}let l=e[i++];for(;o<l;){if(n.done)break e;let c=Math.min(n.len,l-o);O0(a,c,-1),O0(r,c,n.ins==-1?-1:n.off==0?n.ins:0),n.forward(c),o+=c}}return{changes:new Ja(a,t),filtered:hn.create(r)}}toJSON(){let e=[];for(let a=0;a<this.sections.length;a+=2){let t=this.sections[a],r=this.sections[a+1];r<0?e.push(t):r==0?e.push([t]):e.push([t].concat(this.inserted[a>>1].toJSON()))}return e}static of(e,a,t){let r=[],n=[],i=0,o=null;function s(c=!1){if(!c&&!r.length)return;i<a&&O0(r,a-i,-1);let d=new Ja(r,n);o=o?o.compose(d.map(o)):d,r=[],n=[],i=0}function l(c){if(Array.isArray(c))for(let d of c)l(d);else if(c instanceof Ja){if(c.length!=a)throw new RangeError(`Mismatched change set length (got ${c.length}, expected ${a})`);s(),o=o?o.compose(c.map(o)):c}else{let{from:d,to:E=d,insert:p}=c;if(d>E||d<0||E>a)throw new RangeError(`Invalid change range ${d} to ${E} (in doc of length ${a})`);let x=p?typeof p=="string"?Mu.of(p.split(t||Gy)):p:Mu.empty,m=x.length;if(d==E&&m==0)return;d<i&&s(),d>i&&O0(r,d-i,-1),O0(r,E-d,m),io(n,r,x),i=E}}return l(e),s(!o),o}static empty(e){return new Ja(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let a=[],t=[];for(let r=0;r<e.length;r++){let n=e[r];if(typeof n=="number")a.push(n,-1);else{if(!Array.isArray(n)||typeof n[0]!="number"||n.some((i,o)=>o&&typeof i!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(n.length==1)a.push(n[0],0);else{for(;t.length<r;)t.push(Mu.empty);t[r]=Mu.of(n.slice(1)),a.push(n[0],t[r].length)}}}return new Ja(a,t)}static createSet(e,a){return new Ja(e,a)}}function O0(u,e,a,t=!1){if(e==0&&a<=0)return;let r=u.length-2;r>=0&&a<=0&&a==u[r+1]?u[r]+=e:r>=0&&e==0&&u[r]==0?u[r+1]+=a:t?(u[r]+=e,u[r+1]+=a):u.push(e,a)}function io(u,e,a){if(a.length==0)return;let t=e.length-2>>1;if(t<u.length)u[u.length-1]=u[u.length-1].append(a);else{for(;u.length<t;)u.push(Mu.empty);u.push(a)}}function Hy(u,e,a){let t=u.inserted;for(let r=0,n=0,i=0;i<u.sections.length;){let o=u.sections[i++],s=u.sections[i++];if(s<0)r+=o,n+=o;else{let l=r,c=n,d=Mu.empty;for(;l+=o,c+=s,s&&t&&(d=d.append(t[i-2>>1])),!(a||i==u.sections.length||u.sections[i+1]<0);)o=u.sections[i++],s=u.sections[i++];e(r,l,n,c,d),r=l,n=c}}}function qy(u,e,a,t=!1){let r=[],n=t?[]:null,i=new qd(u),o=new qd(e);for(let s=-1;;){if(i.done&&o.len||o.done&&i.len)throw new Error("Mismatched change set lengths");if(i.ins==-1&&o.ins==-1){let l=Math.min(i.len,o.len);O0(r,l,-1),i.forward(l),o.forward(l)}else if(o.ins>=0&&(i.ins<0||s==i.i||i.off==0&&(o.len<i.len||o.len==i.len&&!a))){let l=o.len;for(O0(r,o.ins,-1);l;){let c=Math.min(i.len,l);i.ins>=0&&s<i.i&&i.len<=c&&(O0(r,0,i.ins),n&&io(n,r,i.text),s=i.i),i.forward(c),l-=c}o.next()}else if(i.ins>=0){let l=0,c=i.len;for(;c;)if(o.ins==-1){let d=Math.min(c,o.len);l+=d,c-=d,o.forward(d)}else if(o.ins==0&&o.len<c)c-=o.len,o.next();else break;O0(r,l,s<i.i?i.ins:0),n&&s<i.i&&io(n,r,i.text),s=i.i,i.forward(i.len-c)}else{if(i.done&&o.done)return n?Ja.createSet(r,n):hn.create(r);throw new Error("Mismatched change set lengths")}}}function lU(u,e,a=!1){let t=[],r=a?[]:null,n=new qd(u),i=new qd(e);for(let o=!1;;){if(n.done&&i.done)return r?Ja.createSet(t,r):hn.create(t);if(n.ins==0)O0(t,n.len,0,o),n.next();else if(i.len==0&&!i.done)O0(t,0,i.ins,o),r&&io(r,t,i.text),i.next();else{if(n.done||i.done)throw new Error("Mismatched change set lengths");{let s=Math.min(n.len2,i.len),l=t.length;if(n.ins==-1){let c=i.ins==-1?-1:i.off?0:i.ins;O0(t,s,c,o),r&&c&&io(r,t,i.text)}else i.ins==-1?(O0(t,n.off?0:n.len,s,o),r&&io(r,t,n.textBit(s))):(O0(t,n.off?0:n.len,i.off?0:i.ins,o),r&&!i.off&&io(r,t,i.text));o=(n.ins>s||i.ins>=0&&i.len>s)&&(o||t.length>l),n.forward2(s),i.forward(s)}}}}class qd{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,a=this.i-2>>1;return a>=e.length?Mu.empty:e[a]}textBit(e){let{inserted:a}=this.set,t=this.i-2>>1;return t>=a.length&&!e?Mu.empty:a[t].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}let xh=class Wy{constructor(e,a,t){this.from=e,this.to=a,this.flags=t}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,a=-1){let t,r;return this.empty?t=r=e.mapPos(this.from,a):(t=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),t==this.from&&r==this.to?this:new Wy(t,r,this.flags)}extend(e,a=e){if(e<=this.anchor&&a>=this.anchor)return Se.range(e,a);let t=Math.abs(e-this.anchor)>Math.abs(a-this.anchor)?e:a;return Se.range(this.anchor,t)}eq(e,a=!1){return this.anchor==e.anchor&&this.head==e.head&&(!a||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return Se.range(e.anchor,e.head)}static create(e,a,t){return new Wy(e,a,t)}};class Se{constructor(e,a){this.ranges=e,this.mainIndex=a}map(e,a=-1){return e.empty?this:Se.create(this.ranges.map(t=>t.map(e,a)),this.mainIndex)}eq(e,a=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let t=0;t<this.ranges.length;t++)if(!this.ranges[t].eq(e.ranges[t],a))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new Se([this.main],0)}addRange(e,a=!0){return Se.create([e].concat(this.ranges),a?0:this.mainIndex+1)}replaceRange(e,a=this.mainIndex){let t=this.ranges.slice();return t[a]=e,Se.create(t,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new Se(e.ranges.map(a=>xh.fromJSON(a)),e.main)}static single(e,a=e){return new Se([Se.range(e,a)],0)}static create(e,a=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let t=0,r=0;r<e.length;r++){let n=e[r];if(n.empty?n.from<=t:n.from<t)return Se.normalized(e.slice(),a);t=n.to}return new Se(e,a)}static cursor(e,a=0,t,r){return xh.create(e,e,(a==0?0:a<0?8:16)|(t==null?7:Math.min(6,t))|(r??16777215)<<6)}static range(e,a,t,r){let n=(t??16777215)<<6|(r==null?7:Math.min(6,r));return a<e?xh.create(a,e,48|n):xh.create(e,a,(a>e?8:0)|n)}static normalized(e,a=0){let t=e[a];e.sort((r,n)=>r.from-n.from),a=e.indexOf(t);for(let r=1;r<e.length;r++){let n=e[r],i=e[r-1];if(n.empty?n.from<=i.to:n.from<i.to){let o=i.from,s=Math.max(n.to,i.to);r<=a&&a--,e.splice(--r,2,n.anchor>n.head?Se.range(s,o):Se.range(o,s))}}return new Se(e,a)}}function cU(u,e){for(let a of u.ranges)if(a.to>e)throw new RangeError("Selection points outside of document")}let DA=0;class Ne{constructor(e,a,t,r,n){this.combine=e,this.compareInput=a,this.compare=t,this.isStatic=r,this.id=DA++,this.default=e([]),this.extensions=typeof n=="function"?n(this):n}get reader(){return this}static define(e={}){return new Ne(e.combine||(a=>a),e.compareInput||((a,t)=>a===t),e.compare||(e.combine?(a,t)=>a===t:fA),!!e.static,e.enables)}of(e){return new bx([],this,0,e)}compute(e,a){if(this.isStatic)throw new Error("Can't compute a static facet");return new bx(e,this,1,a)}computeN(e,a){if(this.isStatic)throw new Error("Can't compute a static facet");return new bx(e,this,2,a)}from(e,a){return a||(a=t=>t),this.compute([e],t=>a(t.field(e)))}}function fA(u,e){return u==e||u.length==e.length&&u.every((a,t)=>a===e[t])}class bx{constructor(e,a,t,r){this.dependencies=e,this.facet=a,this.type=t,this.value=r,this.id=DA++}dynamicSlot(e){var a;let t=this.value,r=this.facet.compareInput,n=this.id,i=e[n]>>1,o=this.type==2,s=!1,l=!1,c=[];for(let d of this.dependencies)d=="doc"?s=!0:d=="selection"?l=!0:(((a=e[d.id])!==null&&a!==void 0?a:1)&1)==0&&c.push(e[d.id]);return{create(d){return d.values[i]=t(d),1},update(d,E){if(s&&E.docChanged||l&&(E.docChanged||E.selection)||Jy(d,c)){let p=t(d);if(o?!vM(p,d.values[i],r):!r(p,d.values[i]))return d.values[i]=p,1}return 0},reconfigure:(d,E)=>{let p,x=E.config.address[n];if(x!=null){let m=aD(E,x);if(this.dependencies.every(g=>g instanceof Ne?E.facet(g)===d.facet(g):g instanceof Za?E.field(g,!1)==d.field(g,!1):!0)||(o?vM(p=t(d),m,r):r(p=t(d),m)))return d.values[i]=m,0}else p=t(d);return d.values[i]=p,1}}}}function vM(u,e,a){if(u.length!=e.length)return!1;for(let t=0;t<u.length;t++)if(!a(u[t],e[t]))return!1;return!0}function Jy(u,e){let a=!1;for(let t of e)pd(u,t)&1&&(a=!0);return a}function w3u(u,e,a){let t=a.map(s=>u[s.id]),r=a.map(s=>s.type),n=t.filter(s=>!(s&1)),i=u[e.id]>>1;function o(s){let l=[];for(let c=0;c<t.length;c++){let d=aD(s,t[c]);if(r[c]==2)for(let E of d)l.push(E);else l.push(d)}return e.combine(l)}return{create(s){for(let l of t)pd(s,l);return s.values[i]=o(s),1},update(s,l){if(!Jy(s,n))return 0;let c=o(s);return e.compare(c,s.values[i])?0:(s.values[i]=c,1)},reconfigure(s,l){let c=Jy(s,t),d=l.config.facets[e.id],E=l.facet(e);if(d&&!c&&fA(a,d))return s.values[i]=E,0;let p=o(s);return e.compare(p,E)?(s.values[i]=E,0):(s.values[i]=p,1)}}}const Dh=Ne.define({static:!0});class Za{constructor(e,a,t,r,n){this.id=e,this.createF=a,this.updateF=t,this.compareF=r,this.spec=n,this.provides=void 0}static define(e){let a=new Za(DA++,e.create,e.update,e.compare||((t,r)=>t===r),e);return e.provide&&(a.provides=e.provide(a)),a}create(e){let a=e.facet(Dh).find(t=>t.field==this);return(a?.create||this.createF)(e)}slot(e){let a=e[this.id]>>1;return{create:t=>(t.values[a]=this.create(t),1),update:(t,r)=>{let n=t.values[a],i=this.updateF(n,r);return this.compareF(n,i)?0:(t.values[a]=i,1)},reconfigure:(t,r)=>{let n=t.facet(Dh),i=r.facet(Dh),o;return(o=n.find(s=>s.field==this))&&o!=i.find(s=>s.field==this)?(t.values[a]=o.create(t),1):r.config.address[this.id]!=null?(t.values[a]=r.field(this),0):(t.values[a]=this.create(t),1)}}}init(e){return[this,Dh.of({field:this,create:e})]}get extension(){return this}}const xs={lowest:4,low:3,default:2,high:1,highest:0};function b4(u){return e=>new dU(e,u)}const yn={highest:b4(xs.highest),high:b4(xs.high),default:b4(xs.default),low:b4(xs.low),lowest:b4(xs.lowest)};class dU{constructor(e,a){this.inner=e,this.prec=a}}class rg{of(e){return new Uy(this,e)}reconfigure(e){return rg.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Uy{constructor(e,a){this.compartment=e,this.inner=a}}class uD{constructor(e,a,t,r,n,i){for(this.base=e,this.compartments=a,this.dynamicSlots=t,this.address=r,this.staticValues=n,this.facets=i,this.statusTemplate=[];this.statusTemplate.length<t.length;)this.statusTemplate.push(0)}staticFacet(e){let a=this.address[e.id];return a==null?e.default:this.staticValues[a>>1]}static resolve(e,a,t){let r=[],n=Object.create(null),i=new Map;for(let E of O3u(e,a,i))E instanceof Za?r.push(E):(n[E.facet.id]||(n[E.facet.id]=[])).push(E);let o=Object.create(null),s=[],l=[];for(let E of r)o[E.id]=l.length<<1,l.push(p=>E.slot(p));let c=t?.config.facets;for(let E in n){let p=n[E],x=p[0].facet,m=c&&c[E]||[];if(p.every(g=>g.type==0))if(o[x.id]=s.length<<1|1,fA(m,p))s.push(t.facet(x));else{let g=x.combine(p.map(h=>h.value));s.push(t&&x.compare(g,t.facet(x))?t.facet(x):g)}else{for(let g of p)g.type==0?(o[g.id]=s.length<<1|1,s.push(g.value)):(o[g.id]=l.length<<1,l.push(h=>g.dynamicSlot(h)));o[x.id]=l.length<<1,l.push(g=>w3u(g,x,p))}}let d=l.map(E=>E(o));return new uD(e,i,d,o,s,n)}}function O3u(u,e,a){let t=[[],[],[],[],[]],r=new Map;function n(i,o){let s=r.get(i);if(s!=null){if(s<=o)return;let l=t[s].indexOf(i);l>-1&&t[s].splice(l,1),i instanceof Uy&&a.delete(i.compartment)}if(r.set(i,o),Array.isArray(i))for(let l of i)n(l,o);else if(i instanceof Uy){if(a.has(i.compartment))throw new RangeError("Duplicate use of compartment in extensions");let l=e.get(i.compartment)||i.inner;a.set(i.compartment,l),n(l,o)}else if(i instanceof dU)n(i.inner,i.prec);else if(i instanceof Za)t[o].push(i),i.provides&&n(i.provides,o);else if(i instanceof bx)t[o].push(i),i.facet.extensions&&n(i.facet.extensions,xs.default);else{let l=i.extension;if(!l)throw new Error(`Unrecognized extension value in extension set (${i}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);n(l,o)}}return n(u,xs.default),t.reduce((i,o)=>i.concat(o))}function pd(u,e){if(e&1)return 2;let a=e>>1,t=u.status[a];if(t==4)throw new Error("Cyclic dependency between fields and/or facets");if(t&2)return t;u.status[a]=4;let r=u.computeSlot(u,u.config.dynamicSlots[a]);return u.status[a]=2|r}function aD(u,e){return e&1?u.config.staticValues[e>>1]:u.values[e>>1]}const EU=Ne.define(),Zy=Ne.define({combine:u=>u.some(e=>e),static:!0}),pU=Ne.define({combine:u=>u.length?u[0]:void 0,static:!0}),mU=Ne.define(),hU=Ne.define(),xU=Ne.define(),DU=Ne.define({combine:u=>u.length?u[0]:!1});class Cn{constructor(e,a){this.type=e,this.value=a}static define(){return new P3u}}class P3u{of(e){return new Cn(this,e)}}class j3u{constructor(e){this.map=e}of(e){return new iu(this,e)}}class iu{constructor(e,a){this.type=e,this.value=a}map(e){let a=this.type.map(this.value,e);return a===void 0?void 0:a==this.value?this:new iu(this.type,a)}is(e){return this.type==e}static define(e={}){return new j3u(e.map||(a=>a))}static mapEffects(e,a){if(!e.length)return e;let t=[];for(let r of e){let n=r.map(a);n&&t.push(n)}return t}}iu.reconfigure=iu.define();iu.appendConfig=iu.define();class Ga{constructor(e,a,t,r,n,i){this.startState=e,this.changes=a,this.selection=t,this.effects=r,this.annotations=n,this.scrollIntoView=i,this._doc=null,this._state=null,t&&cU(t,a.newLength),n.some(o=>o.type==Ga.time)||(this.annotations=n.concat(Ga.time.of(Date.now())))}static create(e,a,t,r,n,i){return new Ga(e,a,t,r,n,i)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let a of this.annotations)if(a.type==e)return a.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let a=this.annotation(Ga.userEvent);return!!(a&&(a==e||a.length>e.length&&a.slice(0,e.length)==e&&a[e.length]=="."))}}Ga.time=Cn.define();Ga.userEvent=Cn.define();Ga.addToHistory=Cn.define();Ga.remote=Cn.define();function M3u(u,e){let a=[];for(let t=0,r=0;;){let n,i;if(t<u.length&&(r==e.length||e[r]>=u[t]))n=u[t++],i=u[t++];else if(r<e.length)n=e[r++],i=e[r++];else return a;!a.length||a[a.length-1]<n?a.push(n,i):a[a.length-1]<i&&(a[a.length-1]=i)}}function fU(u,e,a){var t;let r,n,i;return a?(r=e.changes,n=Ja.empty(e.changes.length),i=u.changes.compose(e.changes)):(r=e.changes.map(u.changes),n=u.changes.mapDesc(e.changes,!0),i=u.changes.compose(r)),{changes:i,selection:e.selection?e.selection.map(n):(t=u.selection)===null||t===void 0?void 0:t.map(r),effects:iu.mapEffects(u.effects,r).concat(iu.mapEffects(e.effects,n)),annotations:u.annotations.length?u.annotations.concat(e.annotations):e.annotations,scrollIntoView:u.scrollIntoView||e.scrollIntoView}}function Qy(u,e,a){let t=e.selection,r=y1(e.annotations);return e.userEvent&&(r=r.concat(Ga.userEvent.of(e.userEvent))),{changes:e.changes instanceof Ja?e.changes:Ja.of(e.changes||[],a,u.facet(pU)),selection:t&&(t instanceof Se?t:Se.single(t.anchor,t.head)),effects:y1(e.effects),annotations:r,scrollIntoView:!!e.scrollIntoView}}function gU(u,e,a){let t=Qy(u,e.length?e[0]:{},u.doc.length);e.length&&e[0].filter===!1&&(a=!1);for(let n=1;n<e.length;n++){e[n].filter===!1&&(a=!1);let i=!!e[n].sequential;t=fU(t,Qy(u,e[n],i?t.changes.newLength:u.doc.length),i)}let r=Ga.create(u,t.changes,t.selection,t.effects,t.annotations,t.scrollIntoView);return $3u(a?T3u(r):r)}function T3u(u){let e=u.startState,a=!0;for(let r of e.facet(mU)){let n=r(u);if(n===!1){a=!1;break}Array.isArray(n)&&(a=a===!0?n:M3u(a,n))}if(a!==!0){let r,n;if(a===!1)n=u.changes.invertedDesc,r=Ja.empty(e.doc.length);else{let i=u.changes.filter(a);r=i.changes,n=i.filtered.mapDesc(i.changes).invertedDesc}u=Ga.create(e,r,u.selection&&u.selection.map(n),iu.mapEffects(u.effects,n),u.annotations,u.scrollIntoView)}let t=e.facet(hU);for(let r=t.length-1;r>=0;r--){let n=t[r](u);n instanceof Ga?u=n:Array.isArray(n)&&n.length==1&&n[0]instanceof Ga?u=n[0]:u=gU(e,y1(n),!1)}return u}function $3u(u){let e=u.startState,a=e.facet(xU),t=u;for(let r=a.length-1;r>=0;r--){let n=a[r](u);n&&Object.keys(n).length&&(t=fU(t,Qy(e,n,u.changes.newLength),!0))}return t==u?u:Ga.create(e,u.changes,u.selection,t.effects,t.annotations,t.scrollIntoView)}const R3u=[];function y1(u){return u==null?R3u:Array.isArray(u)?u:[u]}var ba=(function(u){return u[u.Word=0]="Word",u[u.Space=1]="Space",u[u.Other=2]="Other",u})(ba||(ba={}));const N3u=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Yy;try{Yy=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function _3u(u){if(Yy)return Yy.test(u);for(let e=0;e<u.length;e++){let a=u[e];if(/\w/.test(a)||a>"€"&&(a.toUpperCase()!=a.toLowerCase()||N3u.test(a)))return!0}return!1}function L3u(u){return e=>{if(!/\S/.test(e))return ba.Space;if(_3u(e))return ba.Word;for(let a=0;a<u.length;a++)if(e.indexOf(u[a])>-1)return ba.Word;return ba.Other}}class Ou{constructor(e,a,t,r,n,i){this.config=e,this.doc=a,this.selection=t,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=n,i&&(i._state=this);for(let o=0;o<this.config.dynamicSlots.length;o++)pd(this,o<<1);this.computeSlot=null}field(e,a=!0){let t=this.config.address[e.id];if(t==null){if(a)throw new RangeError("Field is not present in this state");return}return pd(this,t),aD(this,t)}update(...e){return gU(this,e,!0)}applyTransaction(e){let a=this.config,{base:t,compartments:r}=a;for(let o of e.effects)o.is(rg.reconfigure)?(a&&(r=new Map,a.compartments.forEach((s,l)=>r.set(l,s)),a=null),r.set(o.value.compartment,o.value.extension)):o.is(iu.reconfigure)?(a=null,t=o.value):o.is(iu.appendConfig)&&(a=null,t=y1(t).concat(o.value));let n;a?n=e.startState.values.slice():(a=uD.resolve(t,r,this),n=new Ou(a,this.doc,this.selection,a.dynamicSlots.map(()=>null),(s,l)=>l.reconfigure(s,this),null).values);let i=e.startState.facet(Zy)?e.newSelection:e.newSelection.asSingle();new Ou(a,e.newDoc,i,n,(o,s)=>s.update(o,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(a=>({changes:{from:a.from,to:a.to,insert:e},range:Se.cursor(a.from+e.length)}))}changeByRange(e){let a=this.selection,t=e(a.ranges[0]),r=this.changes(t.changes),n=[t.range],i=y1(t.effects);for(let o=1;o<a.ranges.length;o++){let s=e(a.ranges[o]),l=this.changes(s.changes),c=l.map(r);for(let E=0;E<o;E++)n[E]=n[E].map(c);let d=r.mapDesc(l,!0);n.push(s.range.map(d)),r=r.compose(c),i=iu.mapEffects(i,c).concat(iu.mapEffects(y1(s.effects),d))}return{changes:r,selection:Se.create(n,a.mainIndex),effects:i}}changes(e=[]){return e instanceof Ja?e:Ja.of(e,this.doc.length,this.facet(Ou.lineSeparator))}toText(e){return Mu.of(e.split(this.facet(Ou.lineSeparator)||Gy))}sliceDoc(e=0,a=this.doc.length){return this.doc.sliceString(e,a,this.lineBreak)}facet(e){let a=this.config.address[e.id];return a==null?e.default:(pd(this,a),aD(this,a))}toJSON(e){let a={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let t in e){let r=e[t];r instanceof Za&&this.config.address[r.id]!=null&&(a[t]=r.spec.toJSON(this.field(e[t]),this))}return a}static fromJSON(e,a={},t){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let r=[];if(t){for(let n in t)if(Object.prototype.hasOwnProperty.call(e,n)){let i=t[n],o=e[n];r.push(i.init(s=>i.spec.fromJSON(o,s)))}}return Ou.create({doc:e.doc,selection:Se.fromJSON(e.selection),extensions:a.extensions?r.concat([a.extensions]):r})}static create(e={}){let a=uD.resolve(e.extensions||[],new Map),t=e.doc instanceof Mu?e.doc:Mu.of((e.doc||"").split(a.staticFacet(Ou.lineSeparator)||Gy)),r=e.selection?e.selection instanceof Se?e.selection:Se.single(e.selection.anchor,e.selection.head):Se.single(0);return cU(r,t.length),a.staticFacet(Zy)||(r=r.asSingle()),new Ou(a,t,r,a.dynamicSlots.map(()=>null),(n,i)=>i.create(n),null)}get tabSize(){return this.facet(Ou.tabSize)}get lineBreak(){return this.facet(Ou.lineSeparator)||`
@@ -521,7 +521,7 @@ html body {
521
521
  `),y+="`"+Avu(k)+"`: "+f),l([y])}return null})},u})();function Jk(u){if(u){var e=u.replace(/([^\n\r])(\r?\n)([^\n\r])/gm,`$1
522
522
 
523
523
  $3`);return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}}function Avu(u){return u.indexOf("`")!==-1?"`` "+u+" ``":u}var Bvu=(function(){var u=function(e,a){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var n in r)r.hasOwnProperty(n)&&(t[n]=r[n])},u(e,a)};return function(e,a){u(e,a);function t(){this.constructor=e}e.prototype=a===null?Object.create(a):(t.prototype=a.prototype,new t)}})(),Ma,lE;if(typeof process=="object")lE=process.platform==="win32";else if(typeof navigator=="object"){var Svu=navigator.userAgent;lE=Svu.indexOf("Windows")>=0}var zvu=/^\w[\w\d+.-]*$/,wvu=/^\//,Ovu=/^\/\//;function Pvu(u,e){if(!u.scheme&&e)throw new Error('[UriError]: Scheme is missing: {scheme: "", authority: "'+u.authority+'", path: "'+u.path+'", query: "'+u.query+'", fragment: "'+u.fragment+'"}');if(u.scheme&&!zvu.test(u.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(u.path){if(u.authority){if(!wvu.test(u.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(Ovu.test(u.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function jvu(u,e){return!u&&!e?"file":u}function Mvu(u,e){switch(u){case"https":case"http":case"file":e?e[0]!==fr&&(e=fr+e):e=fr;break}return e}var ra="",fr="/",Tvu=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,lF=(function(){function u(e,a,t,r,n,i){i===void 0&&(i=!1),typeof e=="object"?(this.scheme=e.scheme||ra,this.authority=e.authority||ra,this.path=e.path||ra,this.query=e.query||ra,this.fragment=e.fragment||ra):(this.scheme=jvu(e,i),this.authority=a||ra,this.path=Mvu(this.scheme,t||ra),this.query=r||ra,this.fragment=n||ra,Pvu(this,i))}return u.isUri=function(e){return e instanceof u?!0:e?typeof e.authority=="string"&&typeof e.fragment=="string"&&typeof e.path=="string"&&typeof e.query=="string"&&typeof e.scheme=="string"&&typeof e.fsPath=="function"&&typeof e.with=="function"&&typeof e.toString=="function":!1},Object.defineProperty(u.prototype,"fsPath",{get:function(){return LY(this)},enumerable:!0,configurable:!0}),u.prototype.with=function(e){if(!e)return this;var a=e.scheme,t=e.authority,r=e.path,n=e.query,i=e.fragment;return a===void 0?a=this.scheme:a===null&&(a=ra),t===void 0?t=this.authority:t===null&&(t=ra),r===void 0?r=this.path:r===null&&(r=ra),n===void 0?n=this.query:n===null&&(n=ra),i===void 0?i=this.fragment:i===null&&(i=ra),a===this.scheme&&t===this.authority&&r===this.path&&n===this.query&&i===this.fragment?this:new _l(a,t,r,n,i)},u.parse=function(e,a){a===void 0&&(a=!1);var t=Tvu.exec(e);return t?new _l(t[2]||ra,$h(t[4]||ra),$h(t[5]||ra),$h(t[7]||ra),$h(t[9]||ra),a):new _l(ra,ra,ra,ra,ra)},u.file=function(e){var a=ra;if(lE&&(e=e.replace(/\\/g,fr)),e[0]===fr&&e[1]===fr){var t=e.indexOf(fr,2);t===-1?(a=e.substring(2),e=fr):(a=e.substring(2,t),e=e.substring(t)||fr)}return new _l("file",a,e,ra,ra)},u.from=function(e){return new _l(e.scheme,e.authority,e.path,e.query,e.fragment)},u.prototype.toString=function(e){return e===void 0&&(e=!1),cF(this,e)},u.prototype.toJSON=function(){return this},u.revive=function(e){if(e){if(e instanceof u)return e;var a=new _l(e);return a._formatted=e.external,a._fsPath=e._sep===NY?e.fsPath:null,a}else return e},u})(),NY=lE?1:void 0,_l=(function(u){Bvu(e,u);function e(){var a=u!==null&&u.apply(this,arguments)||this;return a._formatted=null,a._fsPath=null,a}return Object.defineProperty(e.prototype,"fsPath",{get:function(){return this._fsPath||(this._fsPath=LY(this)),this._fsPath},enumerable:!0,configurable:!0}),e.prototype.toString=function(a){return a===void 0&&(a=!1),a?cF(this,!0):(this._formatted||(this._formatted=cF(this,!1)),this._formatted)},e.prototype.toJSON=function(){var a={$mid:1};return this._fsPath&&(a.fsPath=this._fsPath,a._sep=NY),this._formatted&&(a.external=this._formatted),this.path&&(a.path=this.path),this.scheme&&(a.scheme=this.scheme),this.authority&&(a.authority=this.authority),this.query&&(a.query=this.query),this.fragment&&(a.fragment=this.fragment),a},e})(lF),_Y=(Ma={},Ma[58]="%3A",Ma[47]="%2F",Ma[63]="%3F",Ma[35]="%23",Ma[91]="%5B",Ma[93]="%5D",Ma[64]="%40",Ma[33]="%21",Ma[36]="%24",Ma[38]="%26",Ma[39]="%27",Ma[40]="%28",Ma[41]="%29",Ma[42]="%2A",Ma[43]="%2B",Ma[44]="%2C",Ma[59]="%3B",Ma[61]="%3D",Ma[32]="%20",Ma);function zR(u,e){for(var a=void 0,t=-1,r=0;r<u.length;r++){var n=u.charCodeAt(r);if(n>=97&&n<=122||n>=65&&n<=90||n>=48&&n<=57||n===45||n===46||n===95||n===126||e&&n===47)t!==-1&&(a+=encodeURIComponent(u.substring(t,r)),t=-1),a!==void 0&&(a+=u.charAt(r));else{a===void 0&&(a=u.substr(0,r));var i=_Y[n];i!==void 0?(t!==-1&&(a+=encodeURIComponent(u.substring(t,r)),t=-1),a+=i):t===-1&&(t=r)}}return t!==-1&&(a+=encodeURIComponent(u.substring(t))),a!==void 0?a:u}function $vu(u){for(var e=void 0,a=0;a<u.length;a++){var t=u.charCodeAt(a);t===35||t===63?(e===void 0&&(e=u.substr(0,a)),e+=_Y[t]):e!==void 0&&(e+=u[a])}return e!==void 0?e:u}function LY(u,e){var a;return u.authority&&u.path.length>1&&u.scheme==="file"?a="//"+u.authority+u.path:u.path.charCodeAt(0)===47&&(u.path.charCodeAt(1)>=65&&u.path.charCodeAt(1)<=90||u.path.charCodeAt(1)>=97&&u.path.charCodeAt(1)<=122)&&u.path.charCodeAt(2)===58?a=u.path[1].toLowerCase()+u.path.substr(2):a=u.path,lE&&(a=a.replace(/\//g,"\\")),a}function cF(u,e){var a=e?$vu:zR,t="",r=u.scheme,n=u.authority,i=u.path,o=u.query,s=u.fragment;if(r&&(t+=r,t+=":"),(n||r==="file")&&(t+=fr,t+=fr),n){var l=n.indexOf("@");if(l!==-1){var c=n.substr(0,l);n=n.substr(l+1),l=c.indexOf(":"),l===-1?t+=a(c,!1):(t+=a(c.substr(0,l),!1),t+=":",t+=a(c.substr(l+1),!1)),t+="@"}n=n.toLowerCase(),l=n.indexOf(":"),l===-1?t+=a(n,!1):(t+=a(n.substr(0,l),!1),t+=n.substr(l))}if(i){if(i.length>=3&&i.charCodeAt(0)===47&&i.charCodeAt(2)===58){var d=i.charCodeAt(1);d>=65&&d<=90&&(i="/"+String.fromCharCode(d+32)+":"+i.substr(3))}else if(i.length>=2&&i.charCodeAt(1)===58){var d=i.charCodeAt(0);d>=65&&d<=90&&(i=String.fromCharCode(d+32)+":"+i.substr(2))}t+=a(i,!0)}return o&&(t+="?",t+=a(o,!1)),s&&(t+="#",t+=e?s:zR(s,!1)),t}function IY(u){try{return decodeURIComponent(u)}catch{return u.length>3?u.substr(0,3)+IY(u.substr(3)):u}}var wR=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function $h(u){return u.match(wR)?u.replace(wR,function(e){return IY(e)}):u}var Rvu=(function(){function u(e){try{this.patternRegExp=new RegExp(kvu(e)+"$")}catch{this.patternRegExp=null}this.schemas=[]}return u.prototype.addSchema=function(e){this.schemas.push(e)},u.prototype.matchesPattern=function(e){return this.patternRegExp&&this.patternRegExp.test(e)},u.prototype.getSchemas=function(){return this.schemas},u})(),Nvu=(function(){function u(e,a,t){this.service=e,this.url=a,this.dependencies={},t&&(this.unresolvedSchema=this.service.promise.resolve(new h1(t)))}return u.prototype.getUnresolvedSchema=function(){return this.unresolvedSchema||(this.unresolvedSchema=this.service.loadSchema(this.url)),this.unresolvedSchema},u.prototype.getResolvedSchema=function(){var e=this;return this.resolvedSchema||(this.resolvedSchema=this.getUnresolvedSchema().then(function(a){return e.service.resolveSchemaContent(a,e.url,e.dependencies)})),this.resolvedSchema},u.prototype.clearSchema=function(){this.resolvedSchema=null,this.unresolvedSchema=null,this.dependencies={}},u})(),h1=(function(){function u(e,a){a===void 0&&(a=[]),this.schema=e,this.errors=a}return u})(),OR=(function(){function u(e,a){a===void 0&&(a=[]),this.schema=e,this.errors=a}return u.prototype.getSection=function(e){return tt(this.getSectionRecursive(e,this.schema))},u.prototype.getSectionRecursive=function(e,a){if(!a||typeof a=="boolean"||e.length===0)return a;var t=e.shift();if(a.properties&&typeof a.properties[t])return this.getSectionRecursive(e,a.properties[t]);if(a.patternProperties)for(var r=0,n=Object.keys(a.patternProperties);r<n.length;r++){var i=n[r],o=new RegExp(i);if(o.test(t))return this.getSectionRecursive(e,a.patternProperties[i])}else{if(typeof a.additionalProperties=="object")return this.getSectionRecursive(e,a.additionalProperties);if(t.match("[0-9]+")){if(Array.isArray(a.items)){var s=parseInt(t,10);if(!isNaN(s)&&a.items[s])return this.getSectionRecursive(e,a.items[s])}else if(a.items)return this.getSectionRecursive(e,a.items)}}return null},u})(),_vu=(function(){function u(e,a,t){this.contextService=a,this.requestService=e,this.promiseConstructor=t||Promise,this.callOnDispose=[],this.contributionSchemas={},this.contributionAssociations={},this.schemasById={},this.filePatternAssociations=[],this.filePatternAssociationById={},this.registeredSchemasIds={}}return u.prototype.getRegisteredSchemaIds=function(e){return Object.keys(this.registeredSchemasIds).filter(function(a){var t=lF.parse(a).scheme;return t!=="schemaservice"&&(!e||e(t))})},Object.defineProperty(u.prototype,"promise",{get:function(){return this.promiseConstructor},enumerable:!0,configurable:!0}),u.prototype.dispose=function(){for(;this.callOnDispose.length>0;)this.callOnDispose.pop()()},u.prototype.onResourceChange=function(e){var a=this,t=!1;e=this.normalizeId(e);for(var r=[e],n=Object.keys(this.schemasById).map(function(l){return a.schemasById[l]});r.length;)for(var i=r.pop(),o=0;o<n.length;o++){var s=n[o];s&&(s.url===i||s.dependencies[i])&&(s.url!==i&&r.push(s.url),s.clearSchema(),n[o]=void 0,t=!0)}return t},u.prototype.normalizeId=function(e){try{return lF.parse(e).toString()}catch{return e}},u.prototype.setSchemaContributions=function(e){if(e.schemas){var a=e.schemas;for(var t in a){var r=this.normalizeId(t);this.contributionSchemas[r]=this.addSchemaHandle(r,a[t])}}if(e.schemaAssociations){var n=e.schemaAssociations;for(var i in n){var o=n[i];this.contributionAssociations[i]=o;for(var s=this.getOrAddFilePatternAssociation(i),l=0,c=o;l<c.length;l++){var d=c[l],t=this.normalizeId(d);s.addSchema(t)}}}},u.prototype.addSchemaHandle=function(e,a){var t=new Nvu(this,e,a);return this.schemasById[e]=t,t},u.prototype.getOrAddSchemaHandle=function(e,a){return this.schemasById[e]||this.addSchemaHandle(e,a)},u.prototype.getOrAddFilePatternAssociation=function(e){var a=this.filePatternAssociationById[e];return a||(a=new Rvu(e),this.filePatternAssociationById[e]=a,this.filePatternAssociations.push(a)),a},u.prototype.registerExternalSchema=function(e,a,t){a===void 0&&(a=null);var r=this.normalizeId(e);if(this.registeredSchemasIds[r]=!0,a)for(var n=0,i=a;n<i.length;n++){var o=i[n];this.getOrAddFilePatternAssociation(o).addSchema(r)}return t?this.addSchemaHandle(r,t):this.getOrAddSchemaHandle(r)},u.prototype.clearExternalSchemas=function(){this.schemasById={},this.filePatternAssociations=[],this.filePatternAssociationById={},this.registeredSchemasIds={};for(var e in this.contributionSchemas)this.schemasById[e]=this.contributionSchemas[e],this.registeredSchemasIds[e]=!0;for(var a in this.contributionAssociations)for(var t=this.getOrAddFilePatternAssociation(a),r=0,n=this.contributionAssociations[a];r<n.length;r++){var i=n[r],e=this.normalizeId(i);t.addSchema(e)}},u.prototype.getResolvedSchema=function(e){var a=this.normalizeId(e),t=this.schemasById[a];return t?t.getResolvedSchema():this.promise.resolve(null)},u.prototype.loadSchema=function(e){if(!this.requestService){var a="Unable to load schema from '"+e+"'. No schema request service available";return this.promise.resolve(new h1({},[a]))}return this.requestService(e).then(function(t){if(!t){var r="Unable to load schema from '"+e+"': No content.";return new h1({},[r])}var n={},i=[];n=tvu(t,i);var o=i.length?["Unable to parse content from '"+e+"': Parse error at offset "+i[0].offset]:[];return new h1(n,o)},function(t){var r="Unable to load schema from '"+e+"': "+t.toString();return new h1({},[r])})},u.prototype.resolveSchemaContent=function(e,a,t){var r=this,n=e.errors.slice(0),i=e.schema;if(i.$schema){var o=this.normalizeId(i.$schema);if(o==="http://json-schema.org/draft-03/schema")return this.promise.resolve(new OR({},["Draft-03 schemas are not supported."]));o==="https://json-schema.org/draft/2019-09/schema"&&e.errors.push("Draft 2019-09 schemas are not yet fully supported.")}var s=this.contextService,l=function(p,x){if(!x)return p;var m=p;return x[0]==="/"&&(x=x.substr(1)),x.split("/").some(function(g){return m=m[g],!m}),m},c=function(p,x,m,g){var h=l(x,g);if(h)for(var f in h)h.hasOwnProperty(f)&&!p.hasOwnProperty(f)&&(p[f]=h[f]);else n.push("$ref '"+g+"' in '"+m+"' can not be resolved.")},d=function(p,x,m,g,h){s&&!/^\w+:\/\/.*/.test(x)&&(x=s.resolveRelativePath(x,g)),x=r.normalizeId(x);var f=r.getOrAddSchemaHandle(x);return f.getUnresolvedSchema().then(function(k){if(h[x]=!0,k.errors.length){var y=m?x+"#"+m:x;n.push("Problems loading reference '"+y+"': "+k.errors[0]+".")}return c(p,k.schema,x,m),E(p,k.schema,x,f.dependencies)})},E=function(p,x,m,g){if(!p||typeof p!="object")return Promise.resolve(null);for(var h=[p],f=[],k=[],y=function(){for(var z=[],P=0;P<arguments.length;P++)z[P]=arguments[P];for(var L=0,I=z;L<I.length;L++){var G=I[L];typeof G=="object"&&h.push(G)}},v=function(){for(var z=[],P=0;P<arguments.length;P++)z[P]=arguments[P];for(var L=0,I=z;L<I.length;L++){var G=I[L];if(typeof G=="object")for(var X in G){var U=G[X];typeof U=="object"&&h.push(U)}}},b=function(){for(var z=[],P=0;P<arguments.length;P++)z[P]=arguments[P];for(var L=0,I=z;L<I.length;L++){var G=I[L];if(Array.isArray(G))for(var X=0,U=G;X<U.length;X++){var ae=U[X];typeof ae=="object"&&h.push(ae)}}},C=function(z){for(var P=[];z.$ref;){var L=z.$ref,I=L.split("#",2);if(delete z.$ref,I[0].length>0){k.push(d(z,I[0],I[1],m,g));return}else P.indexOf(L)===-1&&(c(z,x,m,I[1]),P.push(L))}y(z.items,z.additionalProperties,z.not,z.contains,z.propertyNames,z.if,z.then,z.else),v(z.definitions,z.properties,z.patternProperties,z.dependencies),b(z.anyOf,z.allOf,z.oneOf,z.items)};h.length;){var B=h.pop();f.indexOf(B)>=0||(f.push(B),C(B))}return r.promise.all(k)};return E(i,i,a,t).then(function(p){return new OR(i,n)})},u.prototype.getSchemaForResource=function(e,a){if(a&&a.root&&a.root.type==="object"){var t=a.root.properties.filter(function(x){return x.keyNode.value==="$schema"&&x.valueNode&&x.valueNode.type==="string"});if(t.length>0){var r=go(t[0].valueNode);if(r&&vvu(r,".")&&this.contextService&&(r=this.contextService.resolveRelativePath(r,e)),r){var n=this.normalizeId(r);return this.getOrAddSchemaHandle(n).getResolvedSchema()}}}for(var i=Object.create(null),o=[],s=0,l=this.filePatternAssociations;s<l.length;s++){var c=l[s];if(c.matchesPattern(e))for(var d=0,E=c.getSchemas();d<E.length;d++){var p=E[d];i[p]||(o.push(p),i[p]=!0)}}return o.length>0?this.createCombinedSchema(e,o).getResolvedSchema():this.promise.resolve(null)},u.prototype.createCombinedSchema=function(e,a){if(a.length===1)return this.getOrAddSchemaHandle(a[0]);var t="schemaservice://combinedSchema/"+encodeURIComponent(e),r={allOf:a.map(function(n){return{$ref:n}})};return this.addSchemaHandle(t,r)},u})();var Lvu=(function(){function u(e,a){this.jsonSchemaService=e,this.promise=a,this.validationEnabled=!0}return u.prototype.configure=function(e){e&&(this.validationEnabled=e.validate,this.commentSeverity=e.allowComments?void 0:hu.Error)},u.prototype.doValidation=function(e,a,t,r){var n=this;if(!this.validationEnabled)return this.promise.resolve([]);var i=[],o={},s=function(d){var E=d.range.start.line+" "+d.range.start.character+" "+d.message;o[E]||(o[E]=!0,i.push(d))},l=function(d){var E=t?PR(t.trailingCommas):hu.Error,p=t?PR(t.comments):n.commentSeverity;if(d){if(d.errors.length&&a.root){var x=a.root,m=x.type==="object"?x.properties[0]:null;if(m&&m.keyNode.value==="$schema"){var g=m.valueNode||m,h=_u.create(e.positionAt(g.offset),e.positionAt(g.offset+g.length));s(Ei.create(h,d.errors[0],hu.Warning,Pu.SchemaResolveError))}else{var h=_u.create(e.positionAt(x.offset),e.positionAt(x.offset+1));s(Ei.create(h,d.errors[0],hu.Warning,Pu.SchemaResolveError))}}else{var f=a.validate(e,d.schema);f&&f.forEach(s)}KY(d.schema)&&(p=void 0),VY(d.schema)&&(E=void 0)}for(var k=0,y=a.syntaxErrors;k<y.length;k++){var v=y[k];if(v.code===Pu.TrailingComma){if(typeof E!="number")continue;v.severity=E}s(v)}if(typeof p=="number"){var b="Comments are not permitted in JSON.";a.comments.forEach(function(C){s(Ei.create(C,b,p,Pu.CommentNotPermitted))})}return i};if(r){var c=r.id||"schemaservice://untitled/"+Ivu++;return this.jsonSchemaService.resolveSchemaContent(new h1(r),c,{}).then(function(d){return l(d)})}return this.jsonSchemaService.getSchemaForResource(e.uri,a).then(function(d){return l(d)})},u})(),Ivu=0;function KY(u){if(u&&typeof u=="object"){if(ln(u.allowComments))return u.allowComments;if(u.allOf)for(var e=0,a=u.allOf;e<a.length;e++){var t=a[e],r=KY(t);if(ln(r))return r}}}function VY(u){if(u&&typeof u=="object"){if(ln(u.allowTrailingCommas))return u.allowTrailingCommas;if(ln(u.allowsTrailingCommas))return u.allowsTrailingCommas;if(u.allOf)for(var e=0,a=u.allOf;e<a.length;e++){var t=a[e],r=VY(t);if(ln(r))return r}}}function PR(u){switch(u){case"error":return hu.Error;case"warning":return hu.Warning;case"ignore":return}}var jR=48,Kvu=57,Vvu=65,Rh=97,Gvu=102;function Ta(u){return u<jR?0:u<=Kvu?u-jR:(u<Rh&&(u+=Rh-Vvu),u>=Rh&&u<=Gvu?u-Rh+10:0)}function Hvu(u){if(u[0]!=="#")return null;switch(u.length){case 4:return{red:Ta(u.charCodeAt(1))*17/255,green:Ta(u.charCodeAt(2))*17/255,blue:Ta(u.charCodeAt(3))*17/255,alpha:1};case 5:return{red:Ta(u.charCodeAt(1))*17/255,green:Ta(u.charCodeAt(2))*17/255,blue:Ta(u.charCodeAt(3))*17/255,alpha:Ta(u.charCodeAt(4))*17/255};case 7:return{red:(Ta(u.charCodeAt(1))*16+Ta(u.charCodeAt(2)))/255,green:(Ta(u.charCodeAt(3))*16+Ta(u.charCodeAt(4)))/255,blue:(Ta(u.charCodeAt(5))*16+Ta(u.charCodeAt(6)))/255,alpha:1};case 9:return{red:(Ta(u.charCodeAt(1))*16+Ta(u.charCodeAt(2)))/255,green:(Ta(u.charCodeAt(3))*16+Ta(u.charCodeAt(4)))/255,blue:(Ta(u.charCodeAt(5))*16+Ta(u.charCodeAt(6)))/255,alpha:(Ta(u.charCodeAt(7))*16+Ta(u.charCodeAt(8)))/255}}return null}var qvu=(function(){function u(e){this.schemaService=e}return u.prototype.findDocumentSymbols=function(e,a,t){var r=this;t===void 0&&(t={resultLimit:Number.MAX_VALUE});var n=a.root;if(!n)return null;var i=t.resultLimit,o=e.uri;if((o==="vscode://defaultsettings/keybindings.json"||sF(o.toLowerCase(),"/user/keybindings.json"))&&n.type==="array"){for(var s=[],l=0,c=n.items;l<c.length;l++){var d=c[l];if(d.type==="object")for(var E=0,p=d.properties;E<p.length;E++){var x=p[E];if(x.keyNode.value==="key"&&x.valueNode){var m=tc.create(e.uri,Ji(e,d));if(s.push({name:go(x.valueNode),kind:Ur.Function,location:m}),i--,i<=0)return t&&t.onResultLimitExceeded&&t.onResultLimitExceeded(o),s}}}return s}var g=function(f,k,y){return i>=0&&(k.type==="array"?k.items.forEach(function(v){return g(f,v,y)}):k.type==="object"&&k.properties.forEach(function(v){if(i>=0){var b=v.valueNode;if(b){i--;var C=tc.create(e.uri,Ji(e,v)),B=y?y+"."+v.keyNode.value:v.keyNode.value;f.push({name:r.getKeyLabel(v),kind:r.getSymbolKind(b.type),location:C,containerName:y}),g(f,b,B)}}})),f},h=g([],n,void 0);return i<0&&(h.pop(),t&&t.onResultLimitExceeded&&t.onResultLimitExceeded(o)),h},u.prototype.findDocumentSymbols2=function(e,a,t){var r=this;t===void 0&&(t={resultLimit:Number.MAX_VALUE});var n=a.root;if(!n)return null;var i=t.resultLimit,o=e.uri;if((o==="vscode://defaultsettings/keybindings.json"||sF(o.toLowerCase(),"/user/keybindings.json"))&&n.type==="array"){for(var s=[],l=0,c=n.items;l<c.length;l++){var d=c[l];if(d.type==="object")for(var E=0,p=d.properties;E<p.length;E++){var x=p[E];if(x.keyNode.value==="key"&&x.valueNode){var m=Ji(e,d),g=Ji(e,x.keyNode);if(s.push({name:go(x.valueNode),kind:Ur.Function,range:m,selectionRange:g}),i--,i<=0)return t&&t.onResultLimitExceeded&&t.onResultLimitExceeded(o),s}}}return s}var h=function(k,y){return i>=0&&(y.type==="array"?y.items.forEach(function(v,b){if(v&&i>=0){i--;var C=Ji(e,v),B=C,z=String(b),P=h([],v);k.push({name:z,kind:r.getSymbolKind(v.type),range:C,selectionRange:B,children:P})}}):y.type==="object"&&y.properties.forEach(function(v){var b=v.valueNode;if(b&&i>=0){i--;var C=Ji(e,v),B=Ji(e,v.keyNode),z=h([],b);k.push({name:r.getKeyLabel(v),kind:r.getSymbolKind(b.type),range:C,selectionRange:B,children:z})}})),k},f=h([],n);return i<0&&(f.pop(),t&&t.onResultLimitExceeded&&t.onResultLimitExceeded(o)),f},u.prototype.getSymbolKind=function(e){switch(e){case"object":return Ur.Module;case"string":return Ur.String;case"number":return Ur.Number;case"array":return Ur.Array;case"boolean":return Ur.Boolean;default:return Ur.Variable}},u.prototype.getKeyLabel=function(e){var a=e.keyNode.value;return a&&(a=a.replace(/[\n]/g,"↵")),a&&a.trim()?a:'"'+a+'"'},u.prototype.findDocumentColors=function(e,a,t){return this.schemaService.getSchemaForResource(e.uri,a).then(function(r){var n=[];if(r)for(var i=t&&typeof t.resultLimit=="number"?t.resultLimit:Number.MAX_VALUE,o=a.getMatchingSchemas(r.schema),s={},l=0,c=o;l<c.length;l++){var d=c[l];if(!d.inverted&&d.schema&&(d.schema.format==="color"||d.schema.format==="color-hex")&&d.node&&d.node.type==="string"){var E=String(d.node.offset);if(!s[E]){var p=Hvu(go(d.node));if(p){var x=Ji(e,d.node);n.push({color:p,range:x})}if(s[E]=!0,i--,i<=0)return t&&t.onResultLimitExceeded&&t.onResultLimitExceeded(e.uri),n}}}return n})},u.prototype.getColorPresentations=function(e,a,t,r){var n=[],i=Math.round(t.red*255),o=Math.round(t.green*255),s=Math.round(t.blue*255);function l(d){var E=d.toString(16);return E.length!==2?"0"+E:E}var c;return t.alpha===1?c="#"+l(i)+l(o)+l(s):c="#"+l(i)+l(o)+l(s)+l(Math.round(t.alpha*255)),n.push({label:c,textEdit:Fi.replace(r,JSON.stringify(c))}),n},u})();function Ji(u,e){return _u.create(u.positionAt(e.offset),u.positionAt(e.offset+e.length))}var Wvu={schemaAssociations:{},schemas:{}};function Jvu(u,e){var a=[],t=[],r=[],n=-1,i=z1(u.getText(),!1),o=i.scan();function s(P){a.push(P),t.push(r.length)}for(;o!==17;){switch(o){case 1:case 3:{var l=u.positionAt(i.getTokenOffset()).line,c={startLine:l,endLine:l,kind:o===1?"object":"array"};r.push(c);break}case 2:case 4:{var d=o===2?"object":"array";if(r.length>0&&r[r.length-1].kind===d){var c=r.pop(),E=u.positionAt(i.getTokenOffset()).line;c&&E>c.startLine+1&&n!==c.startLine&&(c.endLine=E-1,s(c),n=c.startLine)}break}case 13:{var l=u.positionAt(i.getTokenOffset()).line,p=u.positionAt(i.getTokenOffset()+i.getTokenLength()).line;i.getTokenError()===1&&l+1<u.lineCount?i.setPosition(u.offsetAt(qt.create(l+1,0))):l<p&&(s({startLine:l,endLine:p,kind:gd.Comment}),n=l);break}case 12:{var x=u.getText().substr(i.getTokenOffset(),i.getTokenLength()),m=x.match(/^\/\/\s*#(region\b)|(endregion\b)/);if(m){var E=u.positionAt(i.getTokenOffset()).line;if(m[1]){var c={startLine:E,endLine:E,kind:gd.Region};r.push(c)}else{for(var g=r.length-1;g>=0&&r[g].kind!==gd.Region;)g--;if(g>=0){var c=r[g];r.length=g,E>c.startLine&&n!==c.startLine&&(c.endLine=E,s(c),n=c.startLine)}}}break}}o=i.scan()}var h=e&&e.rangeLimit;if(typeof h!="number"||a.length<=h)return a;e&&e.onRangeLimitExceeded&&e.onRangeLimitExceeded(u.uri);for(var f=[],k=0,y=t;k<y.length;k++){var v=y[k];v<30&&(f[v]=(f[v]||0)+1)}for(var b=0,C=0,g=0;g<f.length;g++){var B=f[g];if(B){if(B+b>h){C=g;break}b+=B}}for(var z=[],g=0;g<a.length;g++){var v=t[g];typeof v=="number"&&(v<C||v===C&&b++<h)&&z.push(a[g])}return z}function Uvu(u,e,a){function t(o){for(var s=u.offsetAt(o),l=a.getNodeFromOffset(s,!0),c=[];l;){switch(l.type){case"string":case"object":case"array":var d=l.offset+1,E=l.offset+l.length-1;d<E&&s>=d&&s<=E&&c.push(r(d,E)),c.push(r(l.offset,l.offset+l.length));break;case"number":case"boolean":case"null":case"property":c.push(r(l.offset,l.offset+l.length));break}if(l.type==="property"||l.parent&&l.parent.type==="array"){var p=i(l.offset+l.length,5);p!==-1&&c.push(r(l.offset,p))}l=l.parent}for(var x=void 0,m=c.length-1;m>=0;m--)x=zD.create(c[m],x);return x||(x=zD.create(_u.create(o,o))),x}function r(o,s){return _u.create(u.positionAt(o),u.positionAt(s))}var n=z1(u.getText(),!0);function i(o,s){n.setPosition(o);var l=n.scan();return l===s?n.getTokenOffset()+n.getTokenLength():-1}return e.map(t)}function GY(u){var e=u.promiseConstructor||Promise,a=new _vu(u.schemaRequestService,u.workspaceContext,e);a.setSchemaContributions(Wvu);var t=new Cvu(a,u.contributions,e,u.clientCapabilities),r=new Fvu(a,u.contributions,e),n=new qvu(a),i=new Lvu(a,e);return{configure:function(o){a.clearExternalSchemas(),o.schemas&&o.schemas.forEach(function(s){a.registerExternalSchema(s.uri,s.fileMatch,s.schema)}),i.configure(o)},resetSchema:function(o){return a.onResourceChange(o)},doValidation:i.doValidation.bind(i),parseJSONDocument:function(o){return gvu(o,{collectComments:!0})},newJSONDocument:function(o,s){return fvu(o,s)},doComplete:t.doComplete.bind(t),findDocumentSymbols:n.findDocumentSymbols.bind(n),findDocumentSymbols2:n.findDocumentSymbols2.bind(n),findColorSymbols:function(o,s){return n.findDocumentColors(o,s).then(function(l){return l.map(function(c){return c.range})})},findDocumentColors:n.findDocumentColors.bind(n),getColorPresentations:n.getColorPresentations.bind(n),doHover:r.doHover.bind(r),getFoldingRanges:Jvu,getSelectionRanges:Uvu,format:function(o,s,l){var c=void 0;if(s){var d=o.offsetAt(s.start),E=o.offsetAt(s.end)-d;c={offset:d,length:E}}var p={tabSize:l?l.tabSize:4,insertSpaces:l?l.insertSpaces:!0,eol:`
524
- `};return ovu(o.getText(),c,p).map(function(x){return Fi.replace(_u.create(o.positionAt(x.offset),o.positionAt(x.offset+x.length)),x.content)})}}}function rl(){const{tabsState:u}=Su(),e=H.useCallback(({type:r,collectionId:n,workflowId:i,stepId:o,historyId:s})=>u.tabs.findIndex(l=>{const c=l.data.get();return Ka(c,r)?(!n||c.collectionId===n)&&(!i||c.workflowId===i)&&(!o||c.stepId===o)&&(!s||c.historyId===s):!1}),[u]),a=H.useCallback(({type:r,collectionId:n,workflowId:i,stepId:o,historyId:s})=>{const l=e({type:r,collectionId:n,workflowId:i,stepId:o,historyId:s});return l!==-1?u.tabs[l]:void 0},[e,u]),t=H.useCallback((r,n)=>{if(!(!r.collectionId||!n.collectionId||r.collectionId!==n.collectionId)&&!(!r.workflowId||!n.workflowId)){if(r.workflowId!==n.workflowId){u.tabs.forEach(i=>{const o=i.data.get();o.collectionId===r.collectionId&&((Ka(o,We.Workflow)||Ka(o,We.WorkflowRun))&&o.workflowId===r.workflowId&&i.data.workflowId.set(n.workflowId),Ka(o,We.Step)&&i.data.workflowId.set(n.workflowId))});return}if(!(!r.stepId||!n.stepId)&&r.stepId!==n.stepId){u.tabs.forEach(i=>{const o=i.data.get();o.collectionId===r.collectionId&&Ka(o,We.Step)&&o.workflowId===r.workflowId&&o.stepId===r.stepId&&i.data.stepId.set(n.stepId)});return}}},[u]);return{tabs:u.tabs,activeTabIdx:u.activeTabIdx,getExistingTabIndex:e,getExistingTab:a,handleIdChange:t}}function Ka(u,e){return u.type===e}const Dg=GY({});let MR=null;function HY(u){MR!==u&&(MR=u,Dg.configure({validate:!0,schemas:[{uri:"stub://test",fileMatch:["*"],schema:u}]}))}function qY(u){const e=wD.create("stub.json","json",0,u),a=Dg.parseJSONDocument(e);return{textDoc:e,jsonDoc:a}}const WY=Za.define({create(){},update(u){return u}}),JY=u=>u.field(WY,!1),Zvu=({store:u,isResponse:e,apiOperation:a})=>{const r=$9(u).data.get();let n=a?.body?.mediaTypes?.[M0.JSON]?.schema;if(Ka(r,We.Step)&&e){const i=r.response?.status;i&&(n=a?.responses?.[i]?.mediaTypes?.[M0.JSON]?.schema)}return[WY.init(()=>({schema:li(n||{}),store:u}))]};function Qvu(){return async u=>{const{schema:e}=JY(u.state)||{};if(!e)return[];HY(e);const a=u.state.doc,{textDoc:t,jsonDoc:r}=qY(a.toString());return(await Dg.doValidation(t,r))?.map(i=>({from:dF(a,i.range.start),to:dF(a,i.range.end),message:i.message,severity:eku[i.severity||3]}))}}const Yvu=yn.highest(yc.of([{key:"Tab",run:u=>pQ(u)}]));function Xvu(){return async function(e){const a={from:e.pos,to:e.pos,options:[],filter:!1},{schema:t}=JY(e.state)||{};if(!t)return a;HY(t);const r=e.state.doc,n=dF.bind(null,r),{textDoc:i,jsonDoc:o}=qY(r.toString()),s=e.state.doc.lineAt(e.pos),l=s.number-1,c=e.pos-s.from,d=await Dg.doComplete(i,{line:l,character:c},o);if(!d)return a;const E=e.state.sliceDoc(s.from,e.pos);if(E.trim().endsWith(",")||uku(E))return a;a.options=d.items.map(m=>({label:m.label,info:m.documentation,apply:g=>{if(!m.textEdit||!("range"in m.textEdit))return;const h=m.textEdit.range,f=m.textEdit.newText.search(/(\$1|\${1:.*?})/);let k=m.textEdit.newText.replace(/(\$1|\${1:.*?})/,"");const y=f===-1?0:f-k.length;g.dispatch({changes:{from:n(h.start),to:n(h.end),insert:k}});const v=k.length-(h.end.character-h.start.character);g.dispatch({selection:Se.single(n(h.end)+v+y)})}}))||[];const p=e.state.wordAt(e.pos),x=p?.from?e.state.sliceDoc(p?.from,p?.to).toLowerCase():"";return x&&(a.options=a.options.filter(m=>m.label.toLowerCase().replace(/^"/,"").startsWith(x))),a}}const eku={1:"error",2:"warning",3:"info",4:"hint"};function dF(u,e){return u.line(e.line+1).from+e.character}function uku(u){try{return JSON.parse(`{${u}}`),!0}catch{return!1}}const UY=iu.define();function zc(u){const e=u.activeEnvironmentId.get();return u.environments.find(a=>a.name.get()===e)?.get()||u.environments[0].get()}const EF=u=>ya.fromClass(class{decorations;constructor(e){this.decorations=this.buildDecorations(e,u)}update(e){(e.docChanged||e.viewportChanged)&&(this.decorations=this.buildDecorations(e.view,u))}buildDecorations(e,a){const r=zc(a.store)?.inputs,n=[],i=Ve.mark({attributes:{style:"background-color: var(--bg-color-active);"}}),o=s=>Ve.mark({attributes:{style:`color: var(--replay-${s?"undefined":"defined"}-variable-color); background-color: var(--replay-${s?"undefined":"defined"}-variable-bg-color);`}});for(const{from:s,to:l}of e.visibleRanges){const c=e.state.doc.sliceString(s,l),d=Hf(c);for(const E of d){const p=s+E.start,x=s+E.end;if(!(p>=x))if(E.prefix==="inputs"){const m=X2(E.match),h=!r?.find(f=>f.name===m)?.value;n.push({from:p,to:x,value:o(h)})}else n.push({from:p,to:x,value:i})}}return Ve.set(n,!0)}},{decorations:e=>e.decorations}),aku=GY({});function tku(u){if(!u||typeof u!="object")return!1;const e=u;return typeof e.type=="string"&&typeof e.offset=="number"&&typeof e.length=="number"}function rku(u){const e=[];if(!u)return e;const a=[u];for(;a.length>0;){const t=a.pop();if(t.type==="property"){t.valueNode&&a.push(t.valueNode);continue}if(t.type==="string"){const r=t.offset,n=t.offset+t.length;n>r&&e.push({from:r,to:n})}if(t.children&&t.children.length)for(const r of t.children)a.push(r)}return e}const nku=u=>ya.fromClass(class{decorations;constructor(e){this.decorations=this.buildDecorations(e,u)}update(e){(e.docChanged||e.viewportChanged)&&(this.decorations=this.buildDecorations(e.view,u))}buildDecorations(e,a){const t=e.state.doc.toString();let r;try{const d=wD.create("inmemory://model.json","json",0,t),p=aku.parseJSONDocument(d)?.root;r=tku(p)?p:void 0}catch{r=void 0}const i=zc(a.store)?.inputs,o=Ve.mark({attributes:{style:"background-color: var(--bg-color-active);"}}),s=d=>Ve.mark({attributes:{style:`color: var(--replay-${d?"undefined":"defined"}-variable-color); background-color: var(--replay-${d?"undefined":"defined"}-variable-bg-color);`}}),l=[];if(!r)return Ve.set([],!0);const c=rku(r);for(const d of c){if(!e.visibleRanges.some(h=>Math.max(h.from,d.from)<Math.min(h.to,d.to))||!(t[d.from]==='"'&&t[d.to-1]==='"'))continue;const p=d.from+1,x=d.to-1;if(x<=p)continue;const m=e.state.doc.sliceString(p,x),g=Hf(m);for(const h of g){const f=p+h.start,k=p+h.end;if(!(f>=k))if(h.prefix==="inputs"){const y=X2(h.match),b=!i?.find(C=>C.name===y)?.value;l.push({from:f,to:k,value:s(b)})}else l.push({from:f,to:k,value:o})}}return Ve.set(l,!0)}},{decorations:e=>e.decorations}),Dn={[M0.Text]:{name:"Text",extensions:[Me.lineWrapping],stateExtensions:[EF]},[M0.JSON]:{name:"JSON",extensions:[dxu(),Ifu(Qvu(),{delay:0,needsRefresh:u=>u.transactions.some(e=>e.effects.some(a=>a.is(UY)))}),HZ.data.of({autocomplete:Xvu()}),Yvu],stateExtensions:[Zvu,nku]},[M0.XML]:{name:"XML",extensions:[zfu()],stateExtensions:[EF]}},iku={[M0.Image]:{name:"Image",extensions:[],stateExtensions:[]}},oku={[M0.HTML]:{name:"HTML",extensions:[nfu()],stateExtensions:[EF]}},lo={...Dn,...iku,...oku},ZY={[M0.FormData]:{name:"form-data",extensions:void 0},[M0["application/x-www-form-urlencoded"]]:{name:"x-www-form-urlencoded",extensions:void 0}},QY={[M0.Binary]:{name:"Binary",extensions:void 0}},Vs={...Dn,...ZY,...QY},sku=Object.keys(Dn),t9=Object.keys(ZY),YY=Object.keys(QY);function XY(u=[],e){const a={};return u.forEach(t=>{const r=String(t[e]);a[r]||(a[r]=[]),a[r].push(t)}),a}const GE={active:!0,key:"",value:""};function co(u,e){return[...u.map(t=>({id:crypto.randomUUID(),key:t.name,value:e.initializeWithInputs?`$inputs.${t.name}`:t.example?String(t.example):"",active:e.initializeWithInputs?!0:!!t.example,in:t.in})),Ba(e.in)]}function HE(u,e){const[a]=u.split("?"),t=e.slice(0,-1).filter(r=>r.active).map(r=>`${r.key}=${r.value}`).join("&");return`${a}${t?`?${t}`:""}`}function Yt(){return{id:crypto.randomUUID(),...GE}}function dt(){return{id:crypto.randomUUID(),...GE,description:""}}function Ba(u){return{...GE,id:crypto.randomUUID(),in:u}}function ws(){return{id:crypto.randomUUID(),...GE,type:"text",files:null}}function r9(){return{id:crypto.randomUUID(),...GE,sendIn:j0.URL}}function Uk(u){return u.map(e=>({id:crypto.randomUUID(),key:"",value:e,active:!0}))}function fg(u,e){return u.filter(a=>a.active&&a.value).map(({value:a})=>(e?Yu(a,e):a).trim())}function vo(u,e){const t=e.filter(r=>!!r).flatMap(r=>r).filter(r=>r.key&&r.active);return["path","header"].includes(u)?Array.from(new Map(t.map(r=>[r.key,r])).values()):t}function eX(u,e){return u.map(({value:a,...t})=>({...t,value:Yu(a,e)}))}function lku(u,e){if(!u.startsWith("$components.parameters."))return null;const a=u.replace("$components.parameters.","");return a&&e[a]||null}function Sa(u=[],e={}){const a=[];for(const t of u)if(po(t)){const r=lku(t.reference,e);r&&a.push({...r,active:t.active,value:t.value||r.value})}else a.push(t);return a}function ao(u){return Object.entries(u).map(([e,a])=>({id:crypto.randomUUID(),key:"",value:e,active:!0,description:a}))}function cku(u){return u.replace(/{/g,"{{").replace(/}/g,"}}")}const TR={documentedOAuth2Types:[],grantType:Fe.ClientCredentials,authRequestExtraParams:[Yt()],tokenRequestExtraParams:[r9()],[Fe.ClientCredentials]:{clientId:"",clientSecret:"",clientAssertion:"",tokenUrl:"",scopes:[dt()],accessToken:""},[Fe.ClientCredentialsWithJwtAssertion]:{clientId:"",clientSecret:"",clientAssertion:"",tokenUrl:"",scopes:[dt()],accessToken:""},[Fe.AuthorizationCode]:{clientId:"",clientSecret:"",tokenUrl:"",authorizationUrl:"",callbackUrl:"",availableScopes:[],scopes:[dt()],codeVerifier:"",codeChallenge:"",accessToken:""},[Fe.AuthorizationCodeWithPkce]:{clientId:"",clientSecret:"",tokenUrl:"",authorizationUrl:"",callbackUrl:"",availableScopes:[],scopes:[dt()],codeVerifier:"",codeChallenge:"",accessToken:""},[Fe.Implicit]:{clientId:"",authorizationUrl:"",callbackUrl:"",availableScopes:[],scopes:[dt()],accessToken:""},[Fe.Password]:{username:"",password:"",clientId:"",clientSecret:"",tokenUrl:"",accessToken:"",scopes:[dt()]}},dku={securityType:ye.NoAuth,securitySchemeId:null,[ye.BasicAuth]:{username:"",password:""},[ye.JWT]:{token:""},[ye.DigestAuth]:{username:"",password:"",nc:"00000001",realm:"",nonce:"",opaque:"",qop:"",algorithm:"",cnonce:""},[ye.APIKey]:{location:Pt.Header,name:"",key:""},[ye.OAuth2]:TR,[ye.OpenIDConnect]:{...TR,openIdConnectUrl:"",userInfoUrl:""}},pF="urn:ietf:params:oauth:client-assertion-type:jwt-bearer",Eku={[w0.SIMPLE]:{condition:"",type:w0.SIMPLE},[w0.REGEX]:{condition:"",type:w0.REGEX,context:""},[w0.JSONPATH]:{condition:"",type:w0.JSONPATH,context:""},[w0.XPATH]:{condition:"",type:w0.XPATH,context:""}};function OD(){return structuredClone({type:u0.Text,content:"",activeExampleName:"",formData:{"multipart/form-data":[ws()],"application/x-www-form-urlencoded":[ws()]},binary:null})}const pku={method:"GET",url:"",security:[Sn()],body:OD(),queryParameters:[Yt()],headers:[Yt()],cookies:[Yt()],pathParameters:[Yt()]};function uX(){return structuredClone(pku)}function Sn(){return li(dku)}function mku(u){return li({id:crypto.randomUUID(),...Eku[u]})}function aX(u,e,a){for(const t of a){const r=$R(u,t),n=$R(e,t);if(typeof r=="object"&&typeof n=="object"){if(!aX(r,n,a))return!1}else if(r!==n)return!1}return!0}function $R(u,e){const a=e.split("/");let t=u;for(const r of a)if(t&&typeof t=="object"&&r in t)t=t[r];else return;return t}function hku(u,e){return u.length===e.length&&u.sort().join()===e.sort().join()}function xku(u,e){return u.every(a=>e.includes(a))}function Dku(u){switch(u){case"query":return Pt.Query;case"cookie":return Pt.Cookie;case"header":return Pt.Header;default:return}}function fku(u,e,a){const{security:t}=e,r=p1u(u);if(!a)return!1;const n=n9(a),i=n.map(c=>c.securityType),o=t.map(c=>c.securityType);if(!hku(i,o))return!0;let l=[];return t.forEach(c=>{const d=c.securityType,E=c[ye.OAuth2]?.grantType,p=i.includes(d),x=n.find(f=>f.securityType===d),m=!x||aX(c,x,vku(d,E)),g=gku(c,d,c[ye.OAuth2]?.grantType,r),h=!!(p&&x&&m&&g);l.push(!a.security?.length||h)}),l.includes(!1)}function gku(u,e,a,t){if(e===ye.OAuth2&&(a===Fe.AuthorizationCode||a===Fe.AuthorizationCodeWithPkce||a===Fe.Implicit)){const r=u[ye.OAuth2][a]?.availableScopes,n=fg(u[ye.OAuth2][a]?.scopes,t);return xku(n,r)}return!0}function vku(u,e){return u===ye.APIKey?[`${ye.APIKey}/name`,`${ye.APIKey}/location`]:u===ye.OAuth2?[`${ye.OAuth2}/grantType`,...kku(e)]:u===ye.OpenIDConnect?[`${ye.OpenIDConnect}/openIdConnectUrl`]:[]}function kku(u){return u===Fe.ClientCredentials?[`${ye.OAuth2}/${Fe.ClientCredentials}/tokenUrl`]:u===Fe.Password?[`${ye.OAuth2}/${Fe.Password}/tokenUrl`]:u===Fe.Implicit?[`${ye.OAuth2}/${Fe.Implicit}/authorizationUrl`]:u===Fe.AuthorizationCode?[`${ye.OAuth2}/${Fe.AuthorizationCode}/tokenUrl`,`${ye.OAuth2}/${Fe.AuthorizationCode}/authorizationUrl`]:u===Fe.AuthorizationCodeWithPkce?[`${ye.OAuth2}/${Fe.AuthorizationCodeWithPkce}/tokenUrl`,`${ye.OAuth2}/${Fe.AuthorizationCodeWithPkce}/authorizationUrl`]:[]}function bku(u){return u.map(e=>{const a=e.map(t=>t.id).join("_");return e.map(t=>({...t,schemeId:a}))})}function yku(u){const e=u.security||[],a=e.map(t=>{let r="";const n=[];return t.forEach((i,o)=>{r=o===0?`${i.id}`:`${r}_${i.id}`,n.push(i9(i))}),{id:r,security:n}});return e.length?a:[]}function Cku(u,e){const a=u.security||[];return a?.length?nX(a).map((t,r)=>i9(t)):[]}function n9(u){const a=(u.security||[])[0];return a?a.map(t=>i9(t)):[Sn()]}function i9(u,e){const a={...Sn(),securitySchemeId:u.id},t=gg(u);a.securityType=t;const r=u.id;if(u.id&&t!==ye.NoAuth&&(a[t].schemeName=u.id),t===ye.BasicAuth&&(a[ye.BasicAuth].username||(a[ye.BasicAuth].username=va(r+W.SecurityVariablesEnvSuffix.Username)),a[ye.BasicAuth].password||(a[ye.BasicAuth].password=va(r+W.SecurityVariablesEnvSuffix.Password))),t===ye.DigestAuth&&(a[ye.DigestAuth].username||(a[ye.DigestAuth].username=va(r+W.SecurityVariablesEnvSuffix.Username)),a[ye.DigestAuth].password||(a[ye.DigestAuth].password=va(r+W.SecurityVariablesEnvSuffix.Password))),t===ye.JWT&&!a[ye.JWT].token&&(a[ye.JWT].token=va(r+W.SecurityVariablesEnvSuffix.JWTToken)),t===ye.APIKey&&!a[ye.APIKey].key){a[ye.APIKey].name=u.name||"",a[ye.APIKey].key=va(r+W.SecurityVariablesEnvSuffix.APIKey);const n=Dku(u.in);n&&(a[ye.APIKey].location=n)}if(t===ye.OAuth2){const n=s9(u),i=va(r+W.SecurityVariablesEnvSuffix.Token),o=a[ye.OAuth2];o.grantType=n[0],n.forEach(s=>{s===Fe.AuthorizationCode&&!o[Fe.AuthorizationCode].accessToken&&(o[Fe.AuthorizationCode].accessToken=i,o[Fe.AuthorizationCode].clientId=va(r+W.SecurityVariablesEnvSuffix.ClientId),o[Fe.AuthorizationCode].authorizationUrl=u.flows?.authorizationCode?.authorizationUrl||"",o[Fe.AuthorizationCode].tokenUrl=u.flows?.authorizationCode?.tokenUrl||"",o[Fe.AuthorizationCode].clientSecret=va(r+W.SecurityVariablesEnvSuffix.ClientSecret),o[Fe.AuthorizationCode].availableScopes=Object.keys(u.flows?.authorizationCode?.scopes||{})||[],o[Fe.AuthorizationCode].scopes=[...ao(u.flows?.authorizationCode?.scopes||{})||[],dt()]),s===Fe.AuthorizationCodeWithPkce&&!o[Fe.AuthorizationCodeWithPkce].accessToken&&(o[Fe.AuthorizationCodeWithPkce].accessToken=i,o[Fe.AuthorizationCodeWithPkce].clientId=va(r+W.SecurityVariablesEnvSuffix.ClientId),o[Fe.AuthorizationCodeWithPkce].authorizationUrl=u.flows?.authorizationCode?.authorizationUrl||"",o[Fe.AuthorizationCodeWithPkce].tokenUrl=u.flows?.authorizationCode?.tokenUrl||"",o[Fe.AuthorizationCodeWithPkce].clientSecret=va(r+W.SecurityVariablesEnvSuffix.ClientSecret),o[Fe.AuthorizationCodeWithPkce].availableScopes=Object.keys(u.flows?.authorizationCode?.scopes||{})||[],o[Fe.AuthorizationCodeWithPkce].scopes=[...ao(u.flows?.authorizationCode?.scopes||{}),dt()]),s===Fe.ClientCredentials&&!o[Fe.ClientCredentials].accessToken&&(o[Fe.ClientCredentials].accessToken=i,o[Fe.ClientCredentials].clientId=va(r+W.SecurityVariablesEnvSuffix.ClientId),o[Fe.ClientCredentials].clientSecret=va(r+W.SecurityVariablesEnvSuffix.ClientSecret),o[Fe.ClientCredentials].tokenUrl=u.flows?.clientCredentials?.tokenUrl||"",o[Fe.ClientCredentials].scopes=[...ao(u.flows?.clientCredentials?.scopes||{}),dt()]),s===Fe.ClientCredentialsWithJwtAssertion&&!o[Fe.ClientCredentialsWithJwtAssertion].accessToken&&(o[Fe.ClientCredentialsWithJwtAssertion].accessToken=i,o[Fe.ClientCredentialsWithJwtAssertion].clientId=va(r+W.SecurityVariablesEnvSuffix.ClientId),o[Fe.ClientCredentialsWithJwtAssertion].clientAssertion=va(r+W.SecurityVariablesEnvSuffix.ClientAssertion),o[Fe.ClientCredentialsWithJwtAssertion].scopes=[...ao(u.flows?.clientCredentials?.scopes||{}),dt()]),s===Fe.Implicit&&!o[Fe.Implicit].accessToken&&(o[Fe.Implicit].accessToken=i,o[Fe.Implicit].clientId=va(r+W.SecurityVariablesEnvSuffix.ClientId),o[Fe.Implicit].authorizationUrl=u.flows?.implicit?.authorizationUrl||"",o[Fe.Implicit].availableScopes=Object.keys(u.flows?.implicit?.scopes||{})||[],o[Fe.Implicit].scopes=[...ao(u.flows?.implicit?.scopes||{}),dt()]),s===Fe.Password&&!o[Fe.Password].accessToken&&(o[Fe.Password].accessToken=i,o[Fe.Password].clientId=va(r+W.SecurityVariablesEnvSuffix.ClientId),o[Fe.Password].clientSecret=va(r+W.SecurityVariablesEnvSuffix.ClientSecret),o[Fe.Password].tokenUrl=u.flows?.password?.tokenUrl||"",o[Fe.Password].scopes=[...ao(u.flows?.password?.scopes||{}),dt()])})}if(t===ye.OpenIDConnect){const n=va(r+W.SecurityVariablesEnvSuffix.Token),i=a[ye.OpenIDConnect];i[Fe.AuthorizationCode].accessToken||(i[Fe.AuthorizationCode].accessToken=n,i[Fe.AuthorizationCode].clientId=va(r+W.SecurityVariablesEnvSuffix.ClientId),i[Fe.AuthorizationCode].clientSecret=va(r+W.SecurityVariablesEnvSuffix.ClientSecret),i[Fe.AuthorizationCode].tokenUrl=u.flows?.authorizationCode?.tokenUrl||""),i[Fe.AuthorizationCodeWithPkce].accessToken||(i[Fe.AuthorizationCodeWithPkce].accessToken=n,i[Fe.AuthorizationCodeWithPkce].clientId=va(r+W.SecurityVariablesEnvSuffix.ClientId),i[Fe.AuthorizationCodeWithPkce].clientSecret=va(r+W.SecurityVariablesEnvSuffix.ClientSecret),i[Fe.AuthorizationCodeWithPkce].tokenUrl=u.flows?.authorizationCode?.tokenUrl||""),i[Fe.Implicit].accessToken||(i[Fe.Implicit].accessToken=n,i[Fe.Implicit].clientId=va(r+W.SecurityVariablesEnvSuffix.ClientId))}return a}function Fku(u,e="",a){const t=XY(u.parameters,"in"),r=tX(u),n=n9(u),i=co(t.query||[],{in:"query"});return{id:crypto.randomUUID(),name:u.name,operationId:u.operationId,collectionPath:a,apiPath:{path:u.path,method:u.method},apiId:e,request:{pathParameters:co(t.path||[],{in:"path"}),method:u.method.toLocaleUpperCase(),url:HE(cku(u.path),i),headers:co(t.header||[],{in:"header"}),queryParameters:i,cookies:co(t.cookie||[],{in:"cookie"}),body:r,security:n},response:null}}function o9(u){const e=XY(u.parameters,"in"),a=tX(u),t=n9(u);return{parameters:{queryParameters:co(e.query||[],{in:"query"}),headers:co(e.header||[],{in:"header"}),cookies:co(e.cookie||[],{in:"cookie"}),pathParameters:co(e.path||[],{initializeWithInputs:!0,in:"path"})},requestBody:a,security:t}}function tX(u){const e=u.body?.mediaTypes;if(!e||!Object.keys(e).length)return OD();const a=Aku(e,u),t=a?.name||"",r=!t9.includes(t)&&!YY.includes(t),n=mF(a),i=r&&n.length?JSON.stringify(n.find(({key:o})=>o===u.body?.activeExampleName)?.value,null,2)||JSON.stringify(n[0].value,null,2):"";return{...OD(),activeExampleName:u.body?.activeExampleName||n[0]?.key||"",...a&&{type:a.name},content:i,formData:{"multipart/form-data":RR(e[M0.FormData]),"application/x-www-form-urlencoded":RR(e[M0["application/x-www-form-urlencoded"]])}}}function rX(u){return u?{...(Object.keys(u?.body?.mediaTypes||{})||[]).reduce((a,t)=>(a[t]={name:t,extensions:void 0},a),{}),...Vs}:Vs}function RR(u){if(!u)return[ws()];if(!u.parameters)return[ws()];const e=u.parameters.map(a=>({id:crypto.randomUUID(),key:a.name,value:String(a.example)||"",active:!0,type:a.inputType,files:null}));return e.push(ws()),e}function mF(u){const e=u?.examples;return Object.keys(e||{}).map(a=>{const t=e?.[a];return{name:W.isString(t?.summary)?t?.summary:t?.summary?.raw||a,key:a,value:e?.[a].value}})}function Aku(u,e){const a=rX(e),t=Object.keys(u).find(r=>!!a[r]);return t?u[t]:null}function Bku(u){return!u?.security?.length||!u?[]:Cku(u)}function nX(u){const e=new Set;return u.flat().filter(a=>e.has(a.id)?!1:(e.add(a.id),!0))}function gg(u){if(u.type==="http"){if(u.scheme==="bearer")return ye.JWT;if(u.scheme==="basic")return ye.BasicAuth;if(u.scheme==="digest")return ye.DigestAuth}else{if(u.type==="apiKey")return ye.APIKey;if(u.type==="oauth2")return ye.OAuth2;if(u.type==="openIdConnect")return ye.OpenIDConnect}return ye.NoAuth}function Sku(u,e){if(u==="clientCredentials"&&e&&"x-assertionType"in e&&e["x-assertionType"]===pF)return Fe.ClientCredentialsWithJwtAssertion;if(u==="authorizationCode"&&e&&"x-usePkce"in e&&e["x-usePkce"])return Fe.AuthorizationCodeWithPkce;switch(u){case"implicit":return Fe.Implicit;case"password":return Fe.Password;case"clientCredentials":return Fe.ClientCredentials;case"authorizationCode":return Fe.AuthorizationCode;default:return Fe.AuthorizationCode}}function zku(u,e){const a=u?.security;if(!a?.length)return[];const n=bku(a).flat().filter(i=>i.schemeId===e).find(i=>gg(i)===ye.OAuth2);return s9(n)}function s9(u){return Object.entries(u?.flows||{}).map(([e,a])=>Sku(e,a)).filter(Boolean)}async function qE(u){try{const e=await _Eu(u),a=await GJ(u);return{absolutePath:u,file:new File([e],a)}}catch(e){return console.error("Failed to init replay file",e),null}}async function iX(u){return(await Promise.allSettled(u.map(a=>qE(a)))).map(a=>a.status==="fulfilled"?a.value:null).filter(a=>a!==null)}async function wku(u,e,a,t,r,n){const i=await Promise.all(u.sourceDescriptions.map(async s=>({name:s.name,url:s.url,type:s.type,apiId:await Oku({projectPath:t,apiUrl:s.url,collectionId:e})}))),o={inputs:u.components?.inputs||{},parameters:Object.fromEntries(Object.entries(u.components?.parameters||{}).map(([s,l])=>[s,{...l,key:l.name,value:l.value,id:crypto.randomUUID(),active:!0}]))};return{...u,id:e,srcType:a,state:Nu.Normal,sourceDescriptions:i,components:o,workflows:await Promise.all(u.workflows.map(async s=>({...s,state:Nu.Normal,parameters:qR(s.parameters,s["x-replay-disabled-parameters"],u.components?.parameters),outputs:GR(s.outputs),security:IR(s["x-security"]),steps:await Promise.all(s.steps.map(async l=>{const c=qR(l.parameters,l["x-replay-disabled-parameters"],u.components?.parameters),d=l["x-operation"]??null;d&&(d.url=HE(d.url,c.queryParameters.filter(RI)));const E=Pku(l,i,r);let p;if(E&&n){const m=r?.find(g=>g.id===E.apiId);p=n(E.path,E.method,m)}delete l.operationId,delete l["x-operation"];const x=await Nku(l.requestBody,t);return{...l,state:Nu.Normal,parameters:c,outputs:GR(l.outputs),successCriteria:l.successCriteria?.map(m=>({...m,type:m.type??w0.SIMPLE}))||[],requestBody:x,xOperation:d,security:IR(l["x-security"],p),operation:E}}))})))}}async function Oku({projectPath:u,apiUrl:e,collectionId:a}){if(KJ(e))return e;if(await za.isAbsolute(e))return await za.relative(u,e);const t=await za.resolve(await za.join(u,a,"..",e));return await za.relative(u,t)}function Pku(u,e,a){if(u["x-operation"])return null;const{path:t,method:r,apiId:n}=oX({operationPath:u.operationPath,parsedSourceDescriptions:e}),{operationId:i,apiId:o}=jku({operationId:u.operationId,parsedSourceDescriptions:e}),s=o||n||e[0]?.apiId||"",l=a?.find(c=>c.id===s);if(i&&l&&!t&&!r){const c=Lku(i,l);return{apiId:s,path:c?.path??"",method:c?.method??"",operationId:i}}return{apiId:s,path:t??"",method:r??"",operationId:i}}function jku({operationId:u,parsedSourceDescriptions:e}){if(!u)return{operationId:"",apiId:null};const a=u.split(".");if(a.length===1)return{operationId:u,apiId:e[0]?.apiId??""};const[,t,r=""]=a,n=e.find(({name:i})=>i===t);return{operationId:r,apiId:n?.apiId??""}}function NR(u){return"reference"in u&&typeof u.reference=="string"}function oX({operationPath:u,parsedSourceDescriptions:e}){if(!u)return{apiId:null,path:"",method:""};try{const a=u.split("#"),t=a.length>1?a[1]:a[0],r=a.length>1?a[0]:"";if(!t)return{path:"",method:"",apiId:null};let n=null,i=null;const o=/\$sourceDescriptions\.(.+)\.url/,s=r.match(o);if(s&&(n=s[1]),n){const E=e.find(({name:p})=>p===n);E&&(i=E.apiId)}const l=t.split("/"),c=l.pop()||"";return{path:_f.unescape(l.pop()||""),method:c.toLowerCase(),apiId:i}}catch{return{path:"",method:"",apiId:null}}}function Mku(u){switch(u.type){case"apiKey":return ye.APIKey;case"oauth2":return ye.OAuth2;case"openIdConnect":return ye.OpenIDConnect;case"http":return u.scheme==="basic"?ye.BasicAuth:u.scheme==="digest"?ye.DigestAuth:u.scheme==="bearer"?ye.JWT:ye.NoAuth;default:return ye.NoAuth}}function sX(u,e){const a={clientCredentials:Fe.ClientCredentials,authorizationCode:Fe.AuthorizationCode,implicit:Fe.Implicit,password:Fe.Password,clientCredentialsWithJwtAssertion:Fe.ClientCredentialsWithJwtAssertion,authorizationCodeWithPkce:Fe.AuthorizationCodeWithPkce};return u==="clientCredentials"&&e["x-assertionType"]==="urn:ietf:params:oauth:client-assertion-type:jwt-bearer"?Fe.ClientCredentialsWithJwtAssertion:u==="authorizationCode"&&e["x-usePkce"]?Fe.AuthorizationCodeWithPkce:a[u]??null}function Tku(u){return{query:Pt.Query,header:Pt.Header,cookie:Pt.Cookie}[u.toLowerCase()]||Pt.Header}function $ku(u){return{body:j0.Body,header:j0.Header,url:j0.URL}[u.toLowerCase()]||j0.URL}function _R(u,e,a){return Object.keys(u).reduce((t,r)=>{const n=sX(r,u[r]);if(!n)return t;switch(n){case Fe.ClientCredentials:t[n]={...a[n],clientId:e.clientId??"",clientSecret:e.clientSecret??"",clientAssertion:e.clientAssertion??"",tokenUrl:u[r].tokenUrl??"",scopes:ls(u[r].scopes,u[r]["x-replay-disabled-scopes"]),accessToken:e.accessToken??""};break;case Fe.AuthorizationCode:t[n]={...a[n],clientId:e.clientId??"",clientSecret:e.clientSecret??"",tokenUrl:u[r].tokenUrl??"",authorizationUrl:u[r].authorizationUrl??"",callbackUrl:e.callbackUrl??"",availableScopes:u[r].availableScopes??[],scopes:ls(u[r].scopes,u[r]["x-replay-disabled-scopes"]),accessToken:e.accessToken??""};break;case Fe.Implicit:t[n]={...a[n],clientId:e.clientId??"",authorizationUrl:u[r].authorizationUrl??"",callbackUrl:e.callbackUrl??"",availableScopes:ls(u[r].availableScopes),scopes:ls(u[r].scopes,u[r]["x-replay-disabled-scopes"]),accessToken:e.accessToken??""};break;case Fe.Password:t[n]={...a[n],tokenUrl:u[r].tokenUrl??"",username:e.username??"",password:e.password??"",clientId:e.clientId??"",clientSecret:e.clientSecret??"",accessToken:e.accessToken??""};break;case Fe.ClientCredentialsWithJwtAssertion:t[n]={...a[n],clientAssertion:e.clientAssertion??"",tokenUrl:u[r].tokenUrl??"",scopes:ls(u[r].scopes,u[r]["x-replay-disabled-scopes"]),clientId:e.clientId??"",clientSecret:e.clientSecret??"",accessToken:e.accessToken??""};break;case Fe.AuthorizationCodeWithPkce:t[n]={...a[n],tokenUrl:u[r].tokenUrl??"",authorizationUrl:u[r].authorizationUrl??"",callbackUrl:e.callbackUrl??"",availableScopes:ls(u[r].availableScopes),scopes:ls(u[r].scopes,u[r]["x-replay-disabled-scopes"]),codeVerifier:e.codeVerifier??"",codeChallenge:e.codeChallenge??"",clientId:e.clientId??"",clientSecret:e.clientSecret??"",accessToken:e.accessToken??""};break}return t},a)}function LR(u,e,a){const r={...Sn(),securityType:u},n=Object.keys(e.flows||{})[0],i=sX(n,e.flows?.[n])??Fe.ClientCredentials;switch(u){case ye.BasicAuth:return{...r,[ye.BasicAuth]:{username:a.username,password:a.password,schemeName:e.id}};case ye.JWT:return{...r,[ye.JWT]:{token:a.token,schemeName:e.id}};case ye.DigestAuth:return{...r,[ye.DigestAuth]:{...r[ye.DigestAuth],username:a.username,password:a.password,schemeName:e.id}};case ye.APIKey:return{...r,[ye.APIKey]:{location:Tku(e.in),name:e.name,key:a.apiKey,schemeName:e.id}};case ye.OAuth2:return{...r,[ye.OAuth2]:{...r[ye.OAuth2],..._R(e.flows||{},a||{},r[ye.OAuth2]),authRequestExtraParams:KR(a.authRequestExtraParams),tokenRequestExtraParams:VR(a.tokenRequestExtraParams),grantType:i,schemeName:e.id}};case ye.OpenIDConnect:return{...r,[ye.OpenIDConnect]:{...r[ye.OpenIDConnect],..._R(a.flows||{},a||{},r[ye.OpenIDConnect]),openIdConnectUrl:a.openIdConnectUrl,userInfoUrl:a.userInfoUrl,authRequestExtraParams:KR(a.authRequestExtraParams),tokenRequestExtraParams:VR(a.tokenRequestExtraParams),grantType:i,schemeName:e.id}};default:return r}}function Rku(u,e){return[...u.map(t=>{if("scheme"in t){const n=Mku(t.scheme);return LR(n,t.scheme,t.values)}const r=e.find(n=>n.id===t.schemeName);if(r){const n=gg(r),i=LR(n,r,t.values);return i.securitySchemeId=r.id,i}return Sn()})]}function IR(u=[],e){const a=nX(e?.security||[]);return u.length?Rku(u,a):[Sn()]}function ls(u,e){const a=ao(u||{}),t=ao(e||{});return[...a,...t,dt()]}function KR(u){return(u||[]).map(e=>({id:crypto.randomUUID(),key:e.key??"",value:e.value??"",active:e.active??!0})).concat(Yt())}function VR(u){return(u||[]).map(e=>({id:crypto.randomUUID(),key:e.key??"",value:e.value??"",active:e.active??!0,sendIn:$ku(e.in)})).concat(r9())}function GR(u){if(!u)return[Yt()];const e=[];for(const a in u)e.push({id:crypto.randomUUID(),key:a,value:u[a],active:!0});return e.push(Yt()),e}const Nh={query:"queryParameters",path:"pathParameters",header:"headers",cookie:"cookies"};function HR(u,e){const a="$components.parameters.";if(u.reference.startsWith(a)){const t=u.reference.replace(a,"");return e?.[t]}}function qR(u,e,a){if(!u&&!e)return{pathParameters:[Ba("path")],queryParameters:[Ba("query")],headers:[Ba("header")],cookies:[Ba("cookie")]};const t={pathParameters:[],queryParameters:[],headers:[],cookies:[]};if(u)for(const r of u)if(NR(r)){const n=HR(r,a),i=Nh[n?.in];i&&t[i].push({reference:r.reference,active:!0,value:r.value})}else t[Nh[r.in]].push({id:crypto.randomUUID(),key:r.name,value:r.value,active:!0,in:r.in});if(e)for(const r of e)if(NR(r)){const n=HR(r,a),i=Nh[n?.in];i&&t[i].push({reference:r.reference,active:!1,value:r.value})}else t[Nh[r.in]].push({id:crypto.randomUUID(),key:r.name,value:r.value,active:!1,in:r.in});return t.pathParameters.push(Ba("path")),t.queryParameters.push(Ba("query")),t.headers.push(Ba("header")),t.cookies.push(Ba("cookie")),t}async function Nku(u,e){const a=uX().body;if(!u)return a;switch(u.contentType){case"application/x-www-form-urlencoded":case"multipart/form-data":return{...a,type:u.contentType,formData:await _ku(u,e)};case"application/octet-stream":const t=u.payload?await lX(u.payload,e):[],r=t.length>0?await qE(t[0]):null;return{...a,type:u.contentType,binary:r};case"application/json":case"application/ld+json":return{...a,type:u.contentType,content:JR(u.payload)};default:{const n=typeof u.payload=="string",i=u.contentType||(n?"text/plain":"application/json");return{...a,type:i,content:n?u.payload:JR(u.payload)}}}}async function WR(u,e,a,t){const r=await lX(e,t),n=r.length>0||Array.isArray(e),i=n?await iX(r):void 0;return{id:crypto.randomUUID(),key:u,value:n?"":e,type:n?"file":"text",active:a,files:i}}async function _ku(u,e){const a=uX().body.formData,t=u.contentType,r=u.payload?await Promise.all(Object.entries(u.payload).map(([o,s])=>WR(o,s,!0,e))):[],n=u["x-replay-disabled-payload"]?await Promise.all(Object.entries(u["x-replay-disabled-payload"]||{}).map(([o,s])=>WR(o,s,!1,e))):[];return{...a,[t]:[...r,...n,ws()]}}function JR(u){return u?JSON.stringify(u,null,2):""}function Lku(u,e){for(const a of Object.keys(e.paths)){const t=e.paths[a];for(const r of Object.keys(t)){const n=r.toLowerCase();if(["get","put","post","delete","options","head","patch","trace"].includes(n)&&t[n]?.operationId===u)return{method:n,path:a}}}return null}async function lX(u,e){return Array.isArray(u)?(await Promise.all(u.map(a=>UR(a,e)))).flat():typeof u=="string"?await UR(u,e):[]}async function UR(u,e){const a=/\$file\(['"](.+?)['"]\)/g,t=Array.from(u.matchAll(a));return Promise.all(t.map(r=>Iku(r[1],e)))}async function Iku(u,e){return await za.isAbsolute(u)?u:await za.resolve(await za.join(e,u))}const Q0=u=>!u||typeof u=="boolean"?{type:"object",properties:{}}:u.type?u:{...u,type:"object"},ZR=(u,e,a)=>{if(!u.properties)return u;const t=u.properties[e],r=Q0(t);return{...u,properties:{...u.properties,[e]:{...r,...a}}}},Kku=(u,e,a)=>{if(!u.properties||e===a||!a.trim())return null;const t={...u.properties};return t[a]?null:(t[a]=t[e],delete t[e],{...u,properties:t})},Vku=(u,e)=>{if(!u.properties)return u;const a={...u.properties};return delete a[e],{...u,properties:a}},Gku=(u,e,a={type:"string"})=>{const t=u.properties||{};return{...u,type:"object",properties:{...t,[e]:a}}};function QR(u){const e=Object.assign({},...(u||[]).filter(({key:a,active:t})=>a&&t).map(a=>({[a.key]:a.value})));if(Object.keys(e).length!==0)return e}function YR(u){if(!u)return{};const e={queryParameters:"query",headers:"header",cookies:"cookie",pathParameters:"path"},a=[],t=[];return Object.keys(e).forEach(r=>{const n=r;u[n].forEach(i=>{if(po(i)){const o={reference:i.reference,value:i.value||void 0};i.active?a.push(o):t.push(o)}else{if(!i.key)return;const o={name:i.key,in:e[n],value:i.value};i.active?a.push(o):t.push(o)}})}),{parameters:a.length>0?a:void 0,"x-replay-disabled-parameters":t.length>0?t:void 0}}function Hku(u){const e=u?.map(a=>({condition:a.condition,context:a.context,type:a.type==w0.SIMPLE?void 0:a.type}));if(e?.length!==0)return e}function qku(u){if(!(!u||u.length===0))return[...u]}async function cX(u,e){return u.absolutePath?`$file('${await za.relative(e,u.absolutePath)}')`:null}async function Wku(u,e){const{type:a,value:t,files:r}=u;switch(a){case"text":return t;case"file":let n=[];return r&&(n=(await Promise.all(Object.values(r).map(i=>cX(i,e)))).filter(i=>i!==null)),n.length===0?"":n.length===1?n[0]:n}}async function Jku(u,e){const a=u.type,t=u.formData[a],r={},n={};return await Promise.all(t.map(async i=>{const{key:o,active:s}=i;if(!o)return;const l=await Wku(i,e);s?r[o]=l:n[o]=l})),{payload:Object.keys(r).length>0?r:void 0,"x-replay-disabled-payload":Object.keys(n).length>0?n:void 0}}function Uku(u){if(!u)return u;try{const e=JSON.parse(u);return typeof e=="object"?e:u}catch{return u}}async function Zku(u,e){if(u)switch(u.type){case"application/x-www-form-urlencoded":case"multipart/form-data":return{contentType:u.type,...await Jku(u,e)};case"application/octet-stream":return{contentType:u.type,payload:u.binary?await cX(u.binary,e):null};case"application/json":case"application/ld+json":return u.content?{contentType:u.type,payload:Uku(u.content)}:void 0;default:return u.content?{contentType:u.type,payload:u.content}:void 0}}function Qku(u){return{...u.schemeName?{schemeName:u.schemeName}:{scheme:{type:"http",scheme:"basic"}},values:{username:u.username,password:u.password}}}function Yku(u){return{...u.schemeName?{schemeName:u.schemeName}:{scheme:{type:"apiKey",name:u.name,in:u.location.toLowerCase()}},values:{apiKey:u.key}}}function Xku(u){return{...u.schemeName?{schemeName:u.schemeName}:{scheme:{type:"http",scheme:"bearer"}},values:{token:u.token}}}function ebu(u){return{...u.schemeName?{schemeName:u.schemeName}:{scheme:{type:"http",scheme:"digest"}},values:{username:u.username,password:u.password}}}function ubu(u){const{flows:e,values:a}=pX(u);return{...u.schemeName?{schemeName:u.schemeName}:{scheme:{type:"openIdConnect",flows:e}},values:{...a,openIdConnectUrl:u.openIdConnectUrl,userInfoUrl:u.userInfoUrl,authRequestExtraParams:dX(u.authRequestExtraParams),tokenRequestExtraParams:EX(u.tokenRequestExtraParams)}}}function abu(u){const{flows:e,values:a}=pX(u);return{...u.schemeName?{schemeName:u.schemeName}:{scheme:{type:"oauth2",flows:e}},values:{...a,authRequestExtraParams:dX(u.authRequestExtraParams),tokenRequestExtraParams:EX(u.tokenRequestExtraParams)}}}function Ll(u){const e={},a={};return u.forEach(t=>{t.value&&(t.active?e[t.value]=t.description:a[t.value]=t.description)}),{scopes:e,"x-replay-disabled-scopes":Object.keys(a).length>0?a:void 0}}function dX(u){return u.filter(e=>e.value||e.key).map(e=>({key:e.key,value:e.value,active:e.active}))}function EX(u){return u.filter(e=>e.value||e.key).map(e=>({key:e.key,value:e.value,active:e.active,in:e.sendIn.toLowerCase()}))}function pX(u){let e;switch(u.grantType){case Fe.ClientCredentials:return e=u[Fe.ClientCredentials],{flows:{clientCredentials:{tokenUrl:e.tokenUrl,...Ll(e.scopes)}},values:{clientId:e.clientId,clientSecret:e.clientSecret,accessToken:e.accessToken}};case Fe.Implicit:return e=u[Fe.Implicit],{flows:{implicit:{authorizationUrl:e.authorizationUrl,...Ll(e.scopes)}},values:{clientId:e.clientId,accessToken:e.accessToken,callbackUrl:e.callbackUrl}};case Fe.Password:return e=u[Fe.Password],{flows:{password:{tokenUrl:e.tokenUrl,...Ll(e.scopes)}},values:{clientId:e.clientId,clientSecret:e.clientSecret,username:e.username,password:e.password,accessToken:e.accessToken}};case Fe.AuthorizationCode:return e=u[Fe.AuthorizationCode],{flows:{authorizationCode:{tokenUrl:e.tokenUrl,authorizationUrl:e.authorizationUrl,...Ll(e.scopes)}},values:{accessToken:e.accessToken,clientId:e.clientId,callbackUrl:e.callbackUrl}};case Fe.ClientCredentialsWithJwtAssertion:return e=u[Fe.ClientCredentialsWithJwtAssertion],{flows:{clientCredentials:{tokenUrl:e.tokenUrl,...Ll(e.scopes),"x-assertionType":"urn:ietf:params:oauth:client-assertion-type:jwt-bearer"}},values:{clientId:e.clientId,clientAssertion:e.clientAssertion,accessToken:e.accessToken}};case Fe.AuthorizationCodeWithPkce:return e=u[Fe.AuthorizationCodeWithPkce],{flows:{authorizationCode:{tokenUrl:e.tokenUrl,authorizationUrl:e.authorizationUrl,...Ll(e.scopes),"x-usePkce":!0}},values:{clientId:e.clientId,clientSecret:e.clientSecret,accessToken:e.accessToken,codeVerifier:e.codeVerifier,codeChallenge:e.codeChallenge,callbackUrl:e.callbackUrl}}}}function XR(u){const e=u.map(a=>{switch(a.securityType){case ye.OpenIDConnect:{const r=a[ye.OpenIDConnect];return ubu(r)}case ye.OAuth2:{const r=a[ye.OAuth2];return abu(r)}case ye.APIKey:{const r=a[ye.APIKey];return Yku(r)}case ye.BasicAuth:{const r=a[ye.BasicAuth];return Qku(r)}case ye.DigestAuth:{const r=a[ye.DigestAuth];return ebu(r)}case ye.JWT:{const r=a[ye.JWT];return Xku(r)}default:return null}}).filter(a=>a!==null);return{"x-security":e.length?e:void 0}}function tbu(u){const{inputs:e,parameters:a,...t}=u;let r=t;return Object.keys(e).length&&(r.inputs=e),Object.keys(a).length&&(r.parameters=Object.fromEntries(Object.entries(a).map(([n,{id:i,active:o,key:s,...l}])=>[n,{...l,name:s}]))),Object.keys(r).length||(r=void 0),r}async function rbu(u,e){const{id:a,state:t,srcType:r,sourceDescriptions:n,workflows:i,components:o,...s}=u;return{arazzoObject:{...s,sourceDescriptions:n.map(l=>({name:l.name,url:l.url,type:l.type||"openapi"})),components:tbu(o),workflows:await Promise.all(i.map(async({parameters:l,security:c,dependsOn:d,outputs:E,state:p,steps:x,inputs:m,...g})=>({...g,dependsOn:qku(d),outputs:QR(E),inputs:m?Q0(m):void 0,...XR(c),...YR(l),steps:await Promise.all(x.map(async({parameters:h,security:f,operation:k,requestBody:y,successCriteria:v,outputs:b,state:C,xOperation:B,...z})=>{const P={operationId:void 0,operationPath:void 0,"x-operation":void 0};if(k){const L=u.sourceDescriptions.find(({apiId:I})=>I===k.apiId)||u.sourceDescriptions[0];if(k.operationId){const I=u.sourceDescriptions.length<=1;P.operationId=I?k.operationId:`$sourceDescriptions.${L.name}.${k.operationId}`}else P.operationPath=`{$sourceDescriptions.${L.name}.url}#/paths/${_f.escape(k.path)}/${k.method}`}else B&&(P["x-operation"]={...B,url:B.url.split("?")[0]});return{...z,...P,...XR(f),...YR(h),requestBody:await Zku(y,e),successCriteria:Hku(v),outputs:QR(b)}}))})))}}}class nbu extends WJ{constructor(e,a){super(e),this.convertOperationToReplayValue=a}parse(e,a){return wku(e.content,e.uri,e.type,this.storage.baseDir,a,this.convertOperationToReplayValue)}async stringify(e){const{arazzoObject:a}=await rbu(e,this.storage.baseDir);return await za.extname(e.id)===".json"?JSON.stringify(a,null,2):xi.dump(a)}}class ibu{constructor(e,a){this.storage=e,this.localStorageSecretsProvider=a}default=[];async read(){const e=await this.storage.get("replay-environments.yaml"),a=await this.localStorageSecretsProvider.get();let t=null,r=null;if(!e)return this.default;try{t=xi.load(e),r=a?JSON.parse(a):null}catch(o){return console.error("Failed to parse environments file",o),this.default}return t?Object.keys(t).filter(o=>o!=="version").map(o=>({name:o,inputs:Object.entries(t[o].inputs).map(([s,l])=>{if(typeof l=="string")return{name:s,value:l,isSecret:!1};const c=r?.[o]?.[s]??"";return{name:s,value:c,isSecret:!0}}),servers:Object.entries(t[o].servers).map(([s,l])=>({apiId:s,value:l.value,variables:Object.entries(l.variables||{}).map(([c,d])=>({name:c,value:d}))})),state:Nu.Normal})):this.default}async write(e){const a=await this.localStorageSecretsProvider.get(),t=a?JSON.parse(a):{},r=e.reduce((n,i)=>(i.name&&(n[i.name]={inputs:i.inputs.reduce((o,s)=>(s.isSecret&&t?(t[i.name]||(t[i.name]={}),t[i.name][s.name]=s.value,o[s.name]={provider:"local"}):o[s.name]=s.value,o),{}),servers:i.servers.reduce((o,s)=>(o[s.apiId]={value:s.value,variables:Object.fromEntries(s.variables.map(l=>[l.name,l.value]))},o),{})}),n),{});this.localStorageSecretsProvider.set(JSON.stringify(t)),r&&this.storage.set("replay-environments.yaml",xi.dump(r))}}class obu{constructor(e,a,t){this.storage=e,this.filePath=a,this.defaultValue=t}async parse(e){return JSON.parse(e)}stringify(e){return JSON.stringify(e)}async read(){const e=await this.storage.get(this.filePath);return e?await this.parse(e):this.defaultValue}async write(e){return this.storage.set(this.filePath,this.stringify(e))}}const sbu=(u,e)=>({data:u,version:e});class hF extends obu{constructor(e,a,t,r){super(e,a,t),this.version=r}migrationMap={};migrate(e){if(!this.migrationMap[e.version])return this.defaultValue;const a=this.migrationMap[e.version](e);return a.version===this.version?a:this.migrate(a)}async parse(e){const a=JSON.parse(e);if(a.version!==this.version){const t=this.migrate(a);return await this.write(t.data),t.data}return a.data}stringify(e){return JSON.stringify(sbu(e,this.version))}}function lbu(u){return{data:{...u.data,tabs:u.data.tabs.map(e=>e.data.type===We.Step?{...e,data:{...e.data,draftStep:{...e.data.step,security:e.data.step.security.securities},step:void 0,hasUnsavedChanges:void 0,showUnsavedChangesModal:void 0}}:e)},version:2}}const eN=2,cbu="tabs.json";class dbu extends hF{migrationMap={1:lbu};constructor(e){super(e,cbu,li(IJ),eN)}async parse(e){let a=JSON.parse(e);a.version!==eN&&(a=this.migrate(a));const t=await Promise.all(a.data.tabs.map(async r=>{if(r.data.type===We.Step&&r.data.draftStep){const n=r.data.draftStep.requestBody.formData;n["multipart/form-data"]=await uN(n["multipart/form-data"]),n["application/x-www-form-urlencoded"]=await uN(n["application/x-www-form-urlencoded"]),r.data.draftStep.requestBody.binary&&r.data.draftStep.requestBody.binary.absolutePath&&(r.data.draftStep.requestBody.binary=await qE(r.data.draftStep.requestBody.binary.absolutePath))}return r}));return{...a.data,tabs:t}}stringify(e){return super.stringify({...e,tabs:e.tabs.map(a=>a.data.type===We.Step?{...a,data:{...a.data,response:null}}:a.data.type===We.WorkflowRun?{...a,data:{...a.data,result:null}}:a)})}}async function uN(u){return Promise.all(u.map(async e=>{const a={...e};if(e.files){const t=e.files.map(r=>r.absolutePath).filter(r=>r!==null);a.files=await iX(t)}return a}))}const Ebu=1,pbu=1;class mbu{constructor(e,a){this.project=e,this.convertOperationToReplayValue=a,this.localStorageSecretsProvider=new VEu(this.project.id),this.systemFilesStorage=this.isTauriApp?new Yj(this.project.systemFilesDir):new Uj(this.project.systemFilesDir),this.userFilesStorage=this.isTauriApp?new Yj(this.project.userFilesDir):new Uj(this.project.userFilesDir);const t=new jEu;this.historyStorage=new hF(this.systemFilesStorage,"history.json",[],Ebu),this.activeEnvironmentIdStorage=new hF(this.systemFilesStorage,"active_environment_id.json",ME,pbu),this.tabsStateStorage=new dbu(this.systemFilesStorage),this.environmentsStorage=new ibu(this.userFilesStorage,this.localStorageSecretsProvider),this.collectionsStorage=new nbu(this.userFilesStorage,this.convertOperationToReplayValue),this.apisStorage=new GEu(this.isTauriApp?this.userFilesStorage:t)}historyStorage;activeEnvironmentIdStorage;tabsStateStorage;environmentsStorage;collectionsStorage;apisStorage;isTauriApp=kc();systemFilesStorage;localStorageSecretsProvider;userFilesStorage;async detectProjectFiles(){const a=(await this.userFilesStorage.ls()).filter(i=>/\.(ya?ml|json)$/.test(i)),t=[],r=[],n=new Set;return await Promise.all(a.map(async i=>{const o=await this.userFilesStorage.get(i);if(o)try{const s=xi.load(o);typeof s=="object"&&s!==null&&(typeof s.openapi=="string"?t.push({uri:i,type:pn.FS,content:s}):typeof s.arazzo=="string"&&(r.push({uri:i,type:pn.FS,content:s}),s.sourceDescriptions?.map(async l=>{const c=l.type,d=l.url,E=!c||c==="openapi",p=typeof d=="string"&&KJ(d);E&&p&&n.add(d)})))}catch(s){console.error(`Error parsing YAML/JSON file ${i}:`,s)}})),{apiFiles:t,collectionFiles:r,apiUrls:n}}async loadApis(e){const a=[];return await Promise.all(Array.from(e).map(async t=>{let r="";try{const n=await mn(Zee({proxyUrl:RJ,resolvedUrl:t,ignoreProxy:this.isTauriApp}));r=await n.text(),n.ok||console.error(`Error fetching API from ${t}:`,n.status,r)}catch(n){console.error(`Error fetching API from ${t}:`,n)}try{const n=xi.load(r);typeof n=="object"&&n!==null&&typeof n.openapi=="string"&&a.push({uri:t,type:pn.WEB,content:n})}catch(n){console.error(`Error parsing YAML from ${t}:`,n)}})),a}async read(){const[e,a,t,r]=await Promise.all([this.historyStorage.read(),this.activeEnvironmentIdStorage.read(),this.tabsStateStorage.read(),this.environmentsStorage.read()]),{apiFiles:n,collectionFiles:i,apiUrls:o}=await this.detectProjectFiles(),s=await this.loadApis(o),l=await this.apisStorage.parseMany([...n,...s]),c=await this.collectionsStorage.parseMany(i,l);return{project:this.project,history:e,activeEnvironmentId:a,tabsState:t,environments:r,apis:l,collections:c}}async update(e,a){switch(e.path[0]){case"history":this.historyStorage.write(a.history.get());break;case"activeEnvironmentId":this.activeEnvironmentIdStorage.write(a.activeEnvironmentId.get());break;case"tabsState":this.tabsStateStorage.write(a.tabsState.get());break;case"environments":this.environmentsStorage.write(a.environments.get());break;case"apis":this.isTauriApp&&await this.apisStorage.update(e,a.apis.get());break;case"collections":await this.collectionsStorage.update(e,a.collections.get());break}}}function mX(u=!1){let e,a=!1;return()=>({id:"RootStoragePlugin",onCreate:()=>({init:t=>async(r,n)=>{if(a||t.path.length>0)return{isInitialized:!1};if(a=!0,!u){e=new mbu(r,n);const i=await e.read();t.merge(i)}return a=!1,{isInitialized:!0}}}),onSet(t,r,n){a||u||e.update(r,n)}})}function hX({defaultEnvironments:u}={}){return structuredClone({project:{id:"default",userFilesDir:"default",systemFilesDir:"default"},history:[],tabsState:li(IJ),activeEnvironmentId:ME,environments:u||LJ,collections:[],apis:[],requestController:null,apps:{apps:[],appsLoadingState:Jr.Idle},predefinedApiId:null,predefinedEnvironmentNames:new Set,predefinedInputNames:new Set})}const hbu=jI(hX(),MI(SEu({key:"replay-root-store"}),mX())),l9=H.createContext(hbu),xbu=l9.Provider;function Su(){const u=H.useContext(l9);return TI(u)}function Dbu(){return{theme:"light",disableCollectionsTab:!1,oAuth2RedirectURI:null,corsProxyUrl:void 0,mockServer:void 0,certificates:[],isApiBased:!1,generatedEnvironments:[],generatedInputs:[]}}const fbu=Dbu(),gbu=H.createContext(fbu);function zi(){const u=H.useContext(gbu);return TI(u)}function vbu(u,e){const{apps:{apiId:a}}=Su(),{corsProxyUrl:t,disableCollectionsTab:r,mockServer:n,oAuth2RedirectURI:i,certificates:o,storageKey:s,isApiBased:l}=zi();t.set(u?.corsProxyUrl??RJ),n.set(u?.mockServer),a.set(u?.apiId),i.set(u?.oAuth2RedirectURI),r.set(!!u?.disableCollectionsTab),s.set(u?.storageKey),l.set(!!e),H.useEffect(()=>{o.set(u?.certificates||[])},[u?.certificates])}const vg=H.createContext({});function WE(){return H.useContext(vg)||{}}const kbu="0.18.0-next.10",bbu={version:kbu};class ybu{client;_isInitialized=!1;constructor(){this.client=new cEu}get isInitialized(){return this._isInitialized}init(e){if(this.isInitialized)return;const t={serviceName:"replay",serviceVersion:bbu.version,version:"1.0.0",tracerName:e?.tracerName||"desktop",collectorUrl:e?.collectorUrl||"",isProd:!0};this.client.init({otel:{...t,...e}}),this._isInitialized=!0}sendEvent(e,a){if(!this.isInitialized){console.warn("Telemetry client not initialized. Call init() first.");return}try{this.client.send(e,a)}catch(t){console.error("Failed to send telemetry event:",t)}}}const Zk=new ybu;function yu(){const{telemetry:u}=WE();return Zk.isInitialized||Zk.init({tracerName:u?.tracerName,collectorUrl:u?.collectorUrl}),{sendEvent:(e,a)=>{Zk.sendEvent(e,a)}}}const T0=800;function Gs(u){"@babel/helpers - typeof";return Gs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gs(u)}function Cbu(u,e){if(Gs(u)!="object"||!u)return u;var a=u[Symbol.toPrimitive];if(a!==void 0){var t=a.call(u,e);if(Gs(t)!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(u)}function xX(u){var e=Cbu(u,"string");return Gs(e)=="symbol"?e:e+""}function Z4(u,e,a){return(e=xX(e))in u?Object.defineProperty(u,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):u[e]=a,u}function aN(u,e){var a=Object.keys(u);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(u);e&&(t=t.filter(function(r){return Object.getOwnPropertyDescriptor(u,r).enumerable})),a.push.apply(a,t)}return a}function Ye(u){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?aN(Object(a),!0).forEach(function(t){Z4(u,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(a)):aN(Object(a)).forEach(function(t){Object.defineProperty(u,t,Object.getOwnPropertyDescriptor(a,t))})}return u}function Fbu(u){if(Array.isArray(u))return u}function Abu(u,e){var a=u==null?null:typeof Symbol<"u"&&u[Symbol.iterator]||u["@@iterator"];if(a!=null){var t,r,n,i,o=[],s=!0,l=!1;try{if(n=(a=a.call(u)).next,e===0){if(Object(a)!==a)return;s=!1}else for(;!(s=(t=n.call(a)).done)&&(o.push(t.value),o.length!==e);s=!0);}catch(c){l=!0,r=c}finally{try{if(!s&&a.return!=null&&(i=a.return(),Object(i)!==i))return}finally{if(l)throw r}}return o}}function xF(u,e){(e==null||e>u.length)&&(e=u.length);for(var a=0,t=Array(e);a<e;a++)t[a]=u[a];return t}function DX(u,e){if(u){if(typeof u=="string")return xF(u,e);var a={}.toString.call(u).slice(8,-1);return a==="Object"&&u.constructor&&(a=u.constructor.name),a==="Map"||a==="Set"?Array.from(u):a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?xF(u,e):void 0}}function Bbu(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
524
+ `};return ovu(o.getText(),c,p).map(function(x){return Fi.replace(_u.create(o.positionAt(x.offset),o.positionAt(x.offset+x.length)),x.content)})}}}function rl(){const{tabsState:u}=Su(),e=H.useCallback(({type:r,collectionId:n,workflowId:i,stepId:o,historyId:s})=>u.tabs.findIndex(l=>{const c=l.data.get();return Ka(c,r)?(!n||c.collectionId===n)&&(!i||c.workflowId===i)&&(!o||c.stepId===o)&&(!s||c.historyId===s):!1}),[u]),a=H.useCallback(({type:r,collectionId:n,workflowId:i,stepId:o,historyId:s})=>{const l=e({type:r,collectionId:n,workflowId:i,stepId:o,historyId:s});return l!==-1?u.tabs[l]:void 0},[e,u]),t=H.useCallback((r,n)=>{if(!(!r.collectionId||!n.collectionId||r.collectionId!==n.collectionId)&&!(!r.workflowId||!n.workflowId)){if(r.workflowId!==n.workflowId){u.tabs.forEach(i=>{const o=i.data.get();o.collectionId===r.collectionId&&((Ka(o,We.Workflow)||Ka(o,We.WorkflowRun))&&o.workflowId===r.workflowId&&i.data.workflowId.set(n.workflowId),Ka(o,We.Step)&&i.data.workflowId.set(n.workflowId))});return}if(!(!r.stepId||!n.stepId)&&r.stepId!==n.stepId){u.tabs.forEach(i=>{const o=i.data.get();o.collectionId===r.collectionId&&Ka(o,We.Step)&&o.workflowId===r.workflowId&&o.stepId===r.stepId&&i.data.stepId.set(n.stepId)});return}}},[u]);return{tabs:u.tabs,activeTabIdx:u.activeTabIdx,getExistingTabIndex:e,getExistingTab:a,handleIdChange:t}}function Ka(u,e){return u.type===e}const Dg=GY({});let MR=null;function HY(u){MR!==u&&(MR=u,Dg.configure({validate:!0,schemas:[{uri:"stub://test",fileMatch:["*"],schema:u}]}))}function qY(u){const e=wD.create("stub.json","json",0,u),a=Dg.parseJSONDocument(e);return{textDoc:e,jsonDoc:a}}const WY=Za.define({create(){},update(u){return u}}),JY=u=>u.field(WY,!1),Zvu=({store:u,isResponse:e,apiOperation:a})=>{const r=$9(u).data.get();let n=a?.body?.mediaTypes?.[M0.JSON]?.schema;if(Ka(r,We.Step)&&e){const i=r.response?.status;i&&(n=a?.responses?.[i]?.mediaTypes?.[M0.JSON]?.schema)}return[WY.init(()=>({schema:li(n||{}),store:u}))]};function Qvu(){return async u=>{const{schema:e}=JY(u.state)||{};if(!e)return[];HY(e);const a=u.state.doc,{textDoc:t,jsonDoc:r}=qY(a.toString());return(await Dg.doValidation(t,r))?.map(i=>({from:dF(a,i.range.start),to:dF(a,i.range.end),message:i.message,severity:eku[i.severity||3]}))}}const Yvu=yn.highest(yc.of([{key:"Tab",run:u=>pQ(u)}]));function Xvu(){return async function(e){const a={from:e.pos,to:e.pos,options:[],filter:!1},{schema:t}=JY(e.state)||{};if(!t)return a;HY(t);const r=e.state.doc,n=dF.bind(null,r),{textDoc:i,jsonDoc:o}=qY(r.toString()),s=e.state.doc.lineAt(e.pos),l=s.number-1,c=e.pos-s.from,d=await Dg.doComplete(i,{line:l,character:c},o);if(!d)return a;const E=e.state.sliceDoc(s.from,e.pos);if(E.trim().endsWith(",")||uku(E))return a;a.options=d.items.map(m=>({label:m.label,info:m.documentation,apply:g=>{if(!m.textEdit||!("range"in m.textEdit))return;const h=m.textEdit.range,f=m.textEdit.newText.search(/(\$1|\${1:.*?})/);let k=m.textEdit.newText.replace(/(\$1|\${1:.*?})/,"");const y=f===-1?0:f-k.length;g.dispatch({changes:{from:n(h.start),to:n(h.end),insert:k}});const v=k.length-(h.end.character-h.start.character);g.dispatch({selection:Se.single(n(h.end)+v+y)})}}))||[];const p=e.state.wordAt(e.pos),x=p?.from?e.state.sliceDoc(p?.from,p?.to).toLowerCase():"";return x&&(a.options=a.options.filter(m=>m.label.toLowerCase().replace(/^"/,"").startsWith(x))),a}}const eku={1:"error",2:"warning",3:"info",4:"hint"};function dF(u,e){return u.line(e.line+1).from+e.character}function uku(u){try{return JSON.parse(`{${u}}`),!0}catch{return!1}}const UY=iu.define();function zc(u){const e=u.activeEnvironmentId.get();return u.environments.find(a=>a.name.get()===e)?.get()||u.environments[0].get()}const EF=u=>ya.fromClass(class{decorations;constructor(e){this.decorations=this.buildDecorations(e,u)}update(e){(e.docChanged||e.viewportChanged)&&(this.decorations=this.buildDecorations(e.view,u))}buildDecorations(e,a){const r=zc(a.store)?.inputs,n=[],i=Ve.mark({attributes:{style:"background-color: var(--bg-color-active);"}}),o=s=>Ve.mark({attributes:{style:`color: var(--replay-${s?"undefined":"defined"}-variable-color); background-color: var(--replay-${s?"undefined":"defined"}-variable-bg-color);`}});for(const{from:s,to:l}of e.visibleRanges){const c=e.state.doc.sliceString(s,l),d=Hf(c);for(const E of d){const p=s+E.start,x=s+E.end;if(!(p>=x))if(E.prefix==="inputs"){const m=X2(E.match),h=!r?.find(f=>f.name===m)?.value;n.push({from:p,to:x,value:o(h)})}else n.push({from:p,to:x,value:i})}}return Ve.set(n,!0)}},{decorations:e=>e.decorations}),aku=GY({});function tku(u){if(!u||typeof u!="object")return!1;const e=u;return typeof e.type=="string"&&typeof e.offset=="number"&&typeof e.length=="number"}function rku(u){const e=[];if(!u)return e;const a=[u];for(;a.length>0;){const t=a.pop();if(t.type==="property"){t.valueNode&&a.push(t.valueNode);continue}if(t.type==="string"){const r=t.offset,n=t.offset+t.length;n>r&&e.push({from:r,to:n})}if(t.children&&t.children.length)for(const r of t.children)a.push(r)}return e}const nku=u=>ya.fromClass(class{decorations;constructor(e){this.decorations=this.buildDecorations(e,u)}update(e){(e.docChanged||e.viewportChanged)&&(this.decorations=this.buildDecorations(e.view,u))}buildDecorations(e,a){const t=e.state.doc.toString();let r;try{const d=wD.create("inmemory://model.json","json",0,t),p=aku.parseJSONDocument(d)?.root;r=tku(p)?p:void 0}catch{r=void 0}const i=zc(a.store)?.inputs,o=Ve.mark({attributes:{style:"background-color: var(--bg-color-active);"}}),s=d=>Ve.mark({attributes:{style:`color: var(--replay-${d?"undefined":"defined"}-variable-color); background-color: var(--replay-${d?"undefined":"defined"}-variable-bg-color);`}}),l=[];if(!r)return Ve.set([],!0);const c=rku(r);for(const d of c){if(!e.visibleRanges.some(h=>Math.max(h.from,d.from)<Math.min(h.to,d.to))||!(t[d.from]==='"'&&t[d.to-1]==='"'))continue;const p=d.from+1,x=d.to-1;if(x<=p)continue;const m=e.state.doc.sliceString(p,x),g=Hf(m);for(const h of g){const f=p+h.start,k=p+h.end;if(!(f>=k))if(h.prefix==="inputs"){const y=X2(h.match),b=!i?.find(C=>C.name===y)?.value;l.push({from:f,to:k,value:s(b)})}else l.push({from:f,to:k,value:o})}}return Ve.set(l,!0)}},{decorations:e=>e.decorations}),Dn={[M0.Text]:{name:"Text",extensions:[Me.lineWrapping],stateExtensions:[EF]},[M0.JSON]:{name:"JSON",extensions:[dxu(),Ifu(Qvu(),{delay:0,needsRefresh:u=>u.transactions.some(e=>e.effects.some(a=>a.is(UY)))}),HZ.data.of({autocomplete:Xvu()}),Yvu],stateExtensions:[Zvu,nku]},[M0.XML]:{name:"XML",extensions:[zfu()],stateExtensions:[EF]}},iku={[M0.Image]:{name:"Image",extensions:[],stateExtensions:[]}},oku={[M0.HTML]:{name:"HTML",extensions:[nfu()],stateExtensions:[EF]}},lo={...Dn,...iku,...oku},ZY={[M0.FormData]:{name:"form-data",extensions:void 0},[M0["application/x-www-form-urlencoded"]]:{name:"x-www-form-urlencoded",extensions:void 0}},QY={[M0.Binary]:{name:"Binary",extensions:void 0}},Vs={...Dn,...ZY,...QY},sku=Object.keys(Dn),t9=Object.keys(ZY),YY=Object.keys(QY);function XY(u=[],e){const a={};return u.forEach(t=>{const r=String(t[e]);a[r]||(a[r]=[]),a[r].push(t)}),a}const GE={active:!0,key:"",value:""};function co(u,e){return[...u.map(t=>({id:crypto.randomUUID(),key:t.name,value:e.initializeWithInputs?`$inputs.${t.name}`:t.example?String(t.example):"",active:e.initializeWithInputs?!0:!!t.example,in:t.in})),Ba(e.in)]}function HE(u,e){const[a]=u.split("?"),t=e.slice(0,-1).filter(r=>r.active).map(r=>`${r.key}=${r.value}`).join("&");return`${a}${t?`?${t}`:""}`}function Yt(){return{id:crypto.randomUUID(),...GE}}function dt(){return{id:crypto.randomUUID(),...GE,description:""}}function Ba(u){return{...GE,id:crypto.randomUUID(),in:u}}function ws(){return{id:crypto.randomUUID(),...GE,type:"text",files:null}}function r9(){return{id:crypto.randomUUID(),...GE,sendIn:j0.URL}}function Uk(u){return u.map(e=>({id:crypto.randomUUID(),key:"",value:e,active:!0}))}function fg(u,e){return u.filter(a=>a.active&&a.value).map(({value:a})=>(e?Yu(a,e):a).trim())}function vo(u,e){const t=e.filter(r=>!!r).flatMap(r=>r).filter(r=>r.key&&r.active);return["path","header"].includes(u)?Array.from(new Map(t.map(r=>[r.key,r])).values()):t}function eX(u,e){return u.map(({value:a,...t})=>({...t,value:Yu(a,e)}))}function lku(u,e){if(!u.startsWith("$components.parameters."))return null;const a=u.replace("$components.parameters.","");return a&&e[a]||null}function Sa(u=[],e={}){const a=[];for(const t of u)if(po(t)){const r=lku(t.reference,e);r&&a.push({...r,active:t.active,value:t.value||r.value})}else a.push(t);return a}function ao(u){return Object.entries(u).map(([e,a])=>({id:crypto.randomUUID(),key:"",value:e,active:!0,description:a}))}function cku(u){return u.replace(/{/g,"{{").replace(/}/g,"}}")}const TR={documentedOAuth2Types:[],grantType:Fe.ClientCredentials,authRequestExtraParams:[Yt()],tokenRequestExtraParams:[r9()],[Fe.ClientCredentials]:{clientId:"",clientSecret:"",clientAssertion:"",tokenUrl:"",scopes:[dt()],accessToken:""},[Fe.ClientCredentialsWithJwtAssertion]:{clientId:"",clientSecret:"",clientAssertion:"",tokenUrl:"",scopes:[dt()],accessToken:""},[Fe.AuthorizationCode]:{clientId:"",clientSecret:"",tokenUrl:"",authorizationUrl:"",callbackUrl:"",availableScopes:[],scopes:[dt()],codeVerifier:"",codeChallenge:"",accessToken:""},[Fe.AuthorizationCodeWithPkce]:{clientId:"",clientSecret:"",tokenUrl:"",authorizationUrl:"",callbackUrl:"",availableScopes:[],scopes:[dt()],codeVerifier:"",codeChallenge:"",accessToken:""},[Fe.Implicit]:{clientId:"",authorizationUrl:"",callbackUrl:"",availableScopes:[],scopes:[dt()],accessToken:""},[Fe.Password]:{username:"",password:"",clientId:"",clientSecret:"",tokenUrl:"",accessToken:"",scopes:[dt()]}},dku={securityType:ye.NoAuth,securitySchemeId:null,[ye.BasicAuth]:{username:"",password:""},[ye.JWT]:{token:""},[ye.DigestAuth]:{username:"",password:"",nc:"00000001",realm:"",nonce:"",opaque:"",qop:"",algorithm:"",cnonce:""},[ye.APIKey]:{location:Pt.Header,name:"",key:""},[ye.OAuth2]:TR,[ye.OpenIDConnect]:{...TR,openIdConnectUrl:"",userInfoUrl:""}},pF="urn:ietf:params:oauth:client-assertion-type:jwt-bearer",Eku={[w0.SIMPLE]:{condition:"",type:w0.SIMPLE},[w0.REGEX]:{condition:"",type:w0.REGEX,context:""},[w0.JSONPATH]:{condition:"",type:w0.JSONPATH,context:""},[w0.XPATH]:{condition:"",type:w0.XPATH,context:""}};function OD(){return structuredClone({type:u0.Text,content:"",activeExampleName:"",formData:{"multipart/form-data":[ws()],"application/x-www-form-urlencoded":[ws()]},binary:null})}const pku={method:"GET",url:"",security:[Sn()],body:OD(),queryParameters:[Yt()],headers:[Yt()],cookies:[Yt()],pathParameters:[Yt()]};function uX(){return structuredClone(pku)}function Sn(){return li(dku)}function mku(u){return li({id:crypto.randomUUID(),...Eku[u]})}function aX(u,e,a){for(const t of a){const r=$R(u,t),n=$R(e,t);if(typeof r=="object"&&typeof n=="object"){if(!aX(r,n,a))return!1}else if(r!==n)return!1}return!0}function $R(u,e){const a=e.split("/");let t=u;for(const r of a)if(t&&typeof t=="object"&&r in t)t=t[r];else return;return t}function hku(u,e){return u.length===e.length&&u.sort().join()===e.sort().join()}function xku(u,e){return u.every(a=>e.includes(a))}function Dku(u){switch(u){case"query":return Pt.Query;case"cookie":return Pt.Cookie;case"header":return Pt.Header;default:return}}function fku(u,e,a){const{security:t}=e,r=p1u(u);if(!a)return!1;const n=n9(a),i=n.map(c=>c.securityType),o=t.map(c=>c.securityType);if(!hku(i,o))return!0;let l=[];return t.forEach(c=>{const d=c.securityType,E=c[ye.OAuth2]?.grantType,p=i.includes(d),x=n.find(f=>f.securityType===d),m=!x||aX(c,x,vku(d,E)),g=gku(c,d,c[ye.OAuth2]?.grantType,r),h=!!(p&&x&&m&&g);l.push(!a.security?.length||h)}),l.includes(!1)}function gku(u,e,a,t){if(e===ye.OAuth2&&(a===Fe.AuthorizationCode||a===Fe.AuthorizationCodeWithPkce||a===Fe.Implicit)){const r=u[ye.OAuth2][a]?.availableScopes,n=fg(u[ye.OAuth2][a]?.scopes,t);return xku(n,r)}return!0}function vku(u,e){return u===ye.APIKey?[`${ye.APIKey}/name`,`${ye.APIKey}/location`]:u===ye.OAuth2?[`${ye.OAuth2}/grantType`,...kku(e)]:u===ye.OpenIDConnect?[`${ye.OpenIDConnect}/openIdConnectUrl`]:[]}function kku(u){return u===Fe.ClientCredentials?[`${ye.OAuth2}/${Fe.ClientCredentials}/tokenUrl`]:u===Fe.Password?[`${ye.OAuth2}/${Fe.Password}/tokenUrl`]:u===Fe.Implicit?[`${ye.OAuth2}/${Fe.Implicit}/authorizationUrl`]:u===Fe.AuthorizationCode?[`${ye.OAuth2}/${Fe.AuthorizationCode}/tokenUrl`,`${ye.OAuth2}/${Fe.AuthorizationCode}/authorizationUrl`]:u===Fe.AuthorizationCodeWithPkce?[`${ye.OAuth2}/${Fe.AuthorizationCodeWithPkce}/tokenUrl`,`${ye.OAuth2}/${Fe.AuthorizationCodeWithPkce}/authorizationUrl`]:[]}function bku(u){return u.map(e=>{const a=e.map(t=>t.id).join("_");return e.map(t=>({...t,schemeId:a}))})}function yku(u){const e=u.security||[],a=e.map(t=>{let r="";const n=[];return t.forEach((i,o)=>{r=o===0?`${i.id}`:`${r}_${i.id}`,n.push(i9(i))}),{id:r,security:n}});return e.length?a:[]}function Cku(u,e){const a=u.security||[];return a?.length?nX(a).map((t,r)=>i9(t)):[]}function n9(u){const a=(u.security||[])[0];return a?a.map(t=>i9(t)):[Sn()]}function i9(u,e){const a={...Sn(),securitySchemeId:u.id},t=gg(u);a.securityType=t;const r=u.id;if(u.id&&t!==ye.NoAuth&&(a[t].schemeName=u.id),t===ye.BasicAuth&&(a[ye.BasicAuth].username||(a[ye.BasicAuth].username=va(r+W.SecurityVariablesEnvSuffix.Username)),a[ye.BasicAuth].password||(a[ye.BasicAuth].password=va(r+W.SecurityVariablesEnvSuffix.Password))),t===ye.DigestAuth&&(a[ye.DigestAuth].username||(a[ye.DigestAuth].username=va(r+W.SecurityVariablesEnvSuffix.Username)),a[ye.DigestAuth].password||(a[ye.DigestAuth].password=va(r+W.SecurityVariablesEnvSuffix.Password))),t===ye.JWT&&!a[ye.JWT].token&&(a[ye.JWT].token=va(r+W.SecurityVariablesEnvSuffix.JWTToken)),t===ye.APIKey&&!a[ye.APIKey].key){a[ye.APIKey].name=u.name||"",a[ye.APIKey].key=va(r+W.SecurityVariablesEnvSuffix.APIKey);const n=Dku(u.in);n&&(a[ye.APIKey].location=n)}if(t===ye.OAuth2){const n=s9(u),i=va(r+W.SecurityVariablesEnvSuffix.Token),o=a[ye.OAuth2];o.grantType=n[0],n.forEach(s=>{s===Fe.AuthorizationCode&&!o[Fe.AuthorizationCode].accessToken&&(o[Fe.AuthorizationCode].accessToken=i,o[Fe.AuthorizationCode].clientId=va(r+W.SecurityVariablesEnvSuffix.ClientId),o[Fe.AuthorizationCode].authorizationUrl=u.flows?.authorizationCode?.authorizationUrl||"",o[Fe.AuthorizationCode].tokenUrl=u.flows?.authorizationCode?.tokenUrl||"",o[Fe.AuthorizationCode].clientSecret=va(r+W.SecurityVariablesEnvSuffix.ClientSecret),o[Fe.AuthorizationCode].availableScopes=Object.keys(u.flows?.authorizationCode?.scopes||{})||[],o[Fe.AuthorizationCode].scopes=[...ao(u.flows?.authorizationCode?.scopes||{})||[],dt()]),s===Fe.AuthorizationCodeWithPkce&&!o[Fe.AuthorizationCodeWithPkce].accessToken&&(o[Fe.AuthorizationCodeWithPkce].accessToken=i,o[Fe.AuthorizationCodeWithPkce].clientId=va(r+W.SecurityVariablesEnvSuffix.ClientId),o[Fe.AuthorizationCodeWithPkce].authorizationUrl=u.flows?.authorizationCode?.authorizationUrl||"",o[Fe.AuthorizationCodeWithPkce].tokenUrl=u.flows?.authorizationCode?.tokenUrl||"",o[Fe.AuthorizationCodeWithPkce].clientSecret=va(r+W.SecurityVariablesEnvSuffix.ClientSecret),o[Fe.AuthorizationCodeWithPkce].availableScopes=Object.keys(u.flows?.authorizationCode?.scopes||{})||[],o[Fe.AuthorizationCodeWithPkce].scopes=[...ao(u.flows?.authorizationCode?.scopes||{}),dt()]),s===Fe.ClientCredentials&&!o[Fe.ClientCredentials].accessToken&&(o[Fe.ClientCredentials].accessToken=i,o[Fe.ClientCredentials].clientId=va(r+W.SecurityVariablesEnvSuffix.ClientId),o[Fe.ClientCredentials].clientSecret=va(r+W.SecurityVariablesEnvSuffix.ClientSecret),o[Fe.ClientCredentials].tokenUrl=u.flows?.clientCredentials?.tokenUrl||"",o[Fe.ClientCredentials].scopes=[...ao(u.flows?.clientCredentials?.scopes||{}),dt()]),s===Fe.ClientCredentialsWithJwtAssertion&&!o[Fe.ClientCredentialsWithJwtAssertion].accessToken&&(o[Fe.ClientCredentialsWithJwtAssertion].accessToken=i,o[Fe.ClientCredentialsWithJwtAssertion].clientId=va(r+W.SecurityVariablesEnvSuffix.ClientId),o[Fe.ClientCredentialsWithJwtAssertion].clientAssertion=va(r+W.SecurityVariablesEnvSuffix.ClientAssertion),o[Fe.ClientCredentialsWithJwtAssertion].scopes=[...ao(u.flows?.clientCredentials?.scopes||{}),dt()]),s===Fe.Implicit&&!o[Fe.Implicit].accessToken&&(o[Fe.Implicit].accessToken=i,o[Fe.Implicit].clientId=va(r+W.SecurityVariablesEnvSuffix.ClientId),o[Fe.Implicit].authorizationUrl=u.flows?.implicit?.authorizationUrl||"",o[Fe.Implicit].availableScopes=Object.keys(u.flows?.implicit?.scopes||{})||[],o[Fe.Implicit].scopes=[...ao(u.flows?.implicit?.scopes||{}),dt()]),s===Fe.Password&&!o[Fe.Password].accessToken&&(o[Fe.Password].accessToken=i,o[Fe.Password].clientId=va(r+W.SecurityVariablesEnvSuffix.ClientId),o[Fe.Password].clientSecret=va(r+W.SecurityVariablesEnvSuffix.ClientSecret),o[Fe.Password].tokenUrl=u.flows?.password?.tokenUrl||"",o[Fe.Password].scopes=[...ao(u.flows?.password?.scopes||{}),dt()])})}if(t===ye.OpenIDConnect){const n=va(r+W.SecurityVariablesEnvSuffix.Token),i=a[ye.OpenIDConnect];i[Fe.AuthorizationCode].accessToken||(i[Fe.AuthorizationCode].accessToken=n,i[Fe.AuthorizationCode].clientId=va(r+W.SecurityVariablesEnvSuffix.ClientId),i[Fe.AuthorizationCode].clientSecret=va(r+W.SecurityVariablesEnvSuffix.ClientSecret),i[Fe.AuthorizationCode].tokenUrl=u.flows?.authorizationCode?.tokenUrl||""),i[Fe.AuthorizationCodeWithPkce].accessToken||(i[Fe.AuthorizationCodeWithPkce].accessToken=n,i[Fe.AuthorizationCodeWithPkce].clientId=va(r+W.SecurityVariablesEnvSuffix.ClientId),i[Fe.AuthorizationCodeWithPkce].clientSecret=va(r+W.SecurityVariablesEnvSuffix.ClientSecret),i[Fe.AuthorizationCodeWithPkce].tokenUrl=u.flows?.authorizationCode?.tokenUrl||""),i[Fe.Implicit].accessToken||(i[Fe.Implicit].accessToken=n,i[Fe.Implicit].clientId=va(r+W.SecurityVariablesEnvSuffix.ClientId))}return a}function Fku(u,e="",a){const t=XY(u.parameters,"in"),r=tX(u),n=n9(u),i=co(t.query||[],{in:"query"});return{id:crypto.randomUUID(),name:u.name,operationId:u.operationId,collectionPath:a,apiPath:{path:u.path,method:u.method},apiId:e,request:{pathParameters:co(t.path||[],{in:"path"}),method:u.method.toLocaleUpperCase(),url:HE(cku(u.path),i),headers:co(t.header||[],{in:"header"}),queryParameters:i,cookies:co(t.cookie||[],{in:"cookie"}),body:r,security:n},response:null}}function o9(u){const e=XY(u.parameters,"in"),a=tX(u),t=n9(u);return{parameters:{queryParameters:co(e.query||[],{in:"query"}),headers:co(e.header||[],{in:"header"}),cookies:co(e.cookie||[],{in:"cookie"}),pathParameters:co(e.path||[],{initializeWithInputs:!0,in:"path"})},requestBody:a,security:t}}function tX(u){const e=u.body?.mediaTypes;if(!e||!Object.keys(e).length)return OD();const a=Aku(e,u),t=a?.name||"",r=!t9.includes(t)&&!YY.includes(t),n=mF(a),i=r&&n.length?JSON.stringify(n.find(({key:o})=>o===u.body?.activeExampleName)?.value,null,2)||JSON.stringify(n[0].value,null,2):"";return{...OD(),activeExampleName:u.body?.activeExampleName||n[0]?.key||"",...a&&{type:a.name},content:i,formData:{"multipart/form-data":RR(e[M0.FormData]),"application/x-www-form-urlencoded":RR(e[M0["application/x-www-form-urlencoded"]])}}}function rX(u){return u?{...(Object.keys(u?.body?.mediaTypes||{})||[]).reduce((a,t)=>(a[t]={name:t,extensions:void 0},a),{}),...Vs}:Vs}function RR(u){if(!u)return[ws()];if(!u.parameters)return[ws()];const e=u.parameters.map(a=>({id:crypto.randomUUID(),key:a.name,value:String(a.example)||"",active:!0,type:a.inputType,files:null}));return e.push(ws()),e}function mF(u){const e=u?.examples;return Object.keys(e||{}).map(a=>{const t=e?.[a];return{name:W.isString(t?.summary)?t?.summary:t?.summary?.raw||a,key:a,value:e?.[a].value}})}function Aku(u,e){const a=rX(e),t=Object.keys(u).find(r=>!!a[r]);return t?u[t]:null}function Bku(u){return!u?.security?.length||!u?[]:Cku(u)}function nX(u){const e=new Set;return u.flat().filter(a=>e.has(a.id)?!1:(e.add(a.id),!0))}function gg(u){if(u.type==="http"){if(u.scheme==="bearer")return ye.JWT;if(u.scheme==="basic")return ye.BasicAuth;if(u.scheme==="digest")return ye.DigestAuth}else{if(u.type==="apiKey")return ye.APIKey;if(u.type==="oauth2")return ye.OAuth2;if(u.type==="openIdConnect")return ye.OpenIDConnect}return ye.NoAuth}function Sku(u,e){if(u==="clientCredentials"&&e&&"x-assertionType"in e&&e["x-assertionType"]===pF)return Fe.ClientCredentialsWithJwtAssertion;if(u==="authorizationCode"&&e&&"x-usePkce"in e&&e["x-usePkce"])return Fe.AuthorizationCodeWithPkce;switch(u){case"implicit":return Fe.Implicit;case"password":return Fe.Password;case"clientCredentials":return Fe.ClientCredentials;case"authorizationCode":return Fe.AuthorizationCode;default:return Fe.AuthorizationCode}}function zku(u,e){const a=u?.security;if(!a?.length)return[];const n=bku(a).flat().filter(i=>i.schemeId===e).find(i=>gg(i)===ye.OAuth2);return s9(n)}function s9(u){return Object.entries(u?.flows||{}).map(([e,a])=>Sku(e,a)).filter(Boolean)}async function qE(u){try{const e=await _Eu(u),a=await GJ(u);return{absolutePath:u,file:new File([e],a)}}catch(e){return console.error("Failed to init replay file",e),null}}async function iX(u){return(await Promise.allSettled(u.map(a=>qE(a)))).map(a=>a.status==="fulfilled"?a.value:null).filter(a=>a!==null)}async function wku(u,e,a,t,r,n){const i=await Promise.all(u.sourceDescriptions.map(async s=>({name:s.name,url:s.url,type:s.type,apiId:await Oku({projectPath:t,apiUrl:s.url,collectionId:e})}))),o={inputs:u.components?.inputs||{},parameters:Object.fromEntries(Object.entries(u.components?.parameters||{}).map(([s,l])=>[s,{...l,key:l.name,value:l.value,id:crypto.randomUUID(),active:!0}]))};return{...u,id:e,srcType:a,state:Nu.Normal,sourceDescriptions:i,components:o,workflows:await Promise.all(u.workflows.map(async s=>({...s,state:Nu.Normal,parameters:qR(s.parameters,s["x-replay-disabled-parameters"],u.components?.parameters),outputs:GR(s.outputs),security:IR(s["x-security"]),steps:await Promise.all(s.steps.map(async l=>{const c=qR(l.parameters,l["x-replay-disabled-parameters"],u.components?.parameters),d=l["x-operation"]??null;d&&(d.url=HE(d.url,c.queryParameters.filter(RI)));const E=Pku(l,i,r);let p;if(E&&n){const m=r?.find(g=>g.id===E.apiId);p=n(E.path,E.method,m)}delete l.operationId,delete l["x-operation"];const x=await Nku(l.requestBody,t);return{...l,state:Nu.Normal,parameters:c,outputs:GR(l.outputs),successCriteria:l.successCriteria?.map(m=>({...m,type:m.type??w0.SIMPLE}))||[],requestBody:x,xOperation:d,security:IR(l["x-security"],p),operation:E}}))})))}}async function Oku({projectPath:u,apiUrl:e,collectionId:a}){if(KJ(e))return e;if(await za.isAbsolute(e))return await za.relative(u,e);const t=await za.resolve(await za.join(u,a,"..",e));return await za.relative(u,t)}function Pku(u,e,a){if(u["x-operation"])return null;const{path:t,method:r,apiId:n}=oX({operationPath:u.operationPath,parsedSourceDescriptions:e}),{operationId:i,apiId:o}=jku({operationId:u.operationId,parsedSourceDescriptions:e}),s=o||n||e[0]?.apiId||"",l=a?.find(c=>c.id===s);if(i&&l&&!t&&!r){const c=Lku(i,l);return{apiId:s,path:c?.path??"",method:c?.method??"",operationId:i}}return{apiId:s,path:t??"",method:r??"",operationId:i}}function jku({operationId:u,parsedSourceDescriptions:e}){if(!u)return{operationId:"",apiId:null};const a=u.split(".");if(a.length===1)return{operationId:u,apiId:e[0]?.apiId??""};const[,t,r=""]=a,n=e.find(({name:i})=>i===t);return{operationId:r,apiId:n?.apiId??""}}function NR(u){return"reference"in u&&typeof u.reference=="string"}function oX({operationPath:u,parsedSourceDescriptions:e}){if(!u)return{apiId:null,path:"",method:""};try{const a=u.split("#"),t=a.length>1?a[1]:a[0],r=a.length>1?a[0]:"";if(!t)return{path:"",method:"",apiId:null};let n=null,i=null;const o=/\$sourceDescriptions\.(.+)\.url/,s=r.match(o);if(s&&(n=s[1]),n){const E=e.find(({name:p})=>p===n);E&&(i=E.apiId)}const l=t.split("/"),c=l.pop()||"";return{path:_f.unescape(l.pop()||""),method:c.toLowerCase(),apiId:i}}catch{return{path:"",method:"",apiId:null}}}function Mku(u){switch(u.type){case"apiKey":return ye.APIKey;case"oauth2":return ye.OAuth2;case"openIdConnect":return ye.OpenIDConnect;case"http":return u.scheme==="basic"?ye.BasicAuth:u.scheme==="digest"?ye.DigestAuth:u.scheme==="bearer"?ye.JWT:ye.NoAuth;default:return ye.NoAuth}}function sX(u,e){const a={clientCredentials:Fe.ClientCredentials,authorizationCode:Fe.AuthorizationCode,implicit:Fe.Implicit,password:Fe.Password,clientCredentialsWithJwtAssertion:Fe.ClientCredentialsWithJwtAssertion,authorizationCodeWithPkce:Fe.AuthorizationCodeWithPkce};return u==="clientCredentials"&&e["x-assertionType"]==="urn:ietf:params:oauth:client-assertion-type:jwt-bearer"?Fe.ClientCredentialsWithJwtAssertion:u==="authorizationCode"&&e["x-usePkce"]?Fe.AuthorizationCodeWithPkce:a[u]??null}function Tku(u){return{query:Pt.Query,header:Pt.Header,cookie:Pt.Cookie}[u.toLowerCase()]||Pt.Header}function $ku(u){return{body:j0.Body,header:j0.Header,url:j0.URL}[u.toLowerCase()]||j0.URL}function _R(u,e,a){return Object.keys(u).reduce((t,r)=>{const n=sX(r,u[r]);if(!n)return t;switch(n){case Fe.ClientCredentials:t[n]={...a[n],clientId:e.clientId??"",clientSecret:e.clientSecret??"",clientAssertion:e.clientAssertion??"",tokenUrl:u[r].tokenUrl??"",scopes:ls(u[r].scopes,u[r]["x-replay-disabled-scopes"]),accessToken:e.accessToken??""};break;case Fe.AuthorizationCode:t[n]={...a[n],clientId:e.clientId??"",clientSecret:e.clientSecret??"",tokenUrl:u[r].tokenUrl??"",authorizationUrl:u[r].authorizationUrl??"",callbackUrl:e.callbackUrl??"",availableScopes:u[r].availableScopes??[],scopes:ls(u[r].scopes,u[r]["x-replay-disabled-scopes"]),accessToken:e.accessToken??""};break;case Fe.Implicit:t[n]={...a[n],clientId:e.clientId??"",authorizationUrl:u[r].authorizationUrl??"",callbackUrl:e.callbackUrl??"",availableScopes:ls(u[r].availableScopes),scopes:ls(u[r].scopes,u[r]["x-replay-disabled-scopes"]),accessToken:e.accessToken??""};break;case Fe.Password:t[n]={...a[n],tokenUrl:u[r].tokenUrl??"",username:e.username??"",password:e.password??"",clientId:e.clientId??"",clientSecret:e.clientSecret??"",accessToken:e.accessToken??""};break;case Fe.ClientCredentialsWithJwtAssertion:t[n]={...a[n],clientAssertion:e.clientAssertion??"",tokenUrl:u[r].tokenUrl??"",scopes:ls(u[r].scopes,u[r]["x-replay-disabled-scopes"]),clientId:e.clientId??"",clientSecret:e.clientSecret??"",accessToken:e.accessToken??""};break;case Fe.AuthorizationCodeWithPkce:t[n]={...a[n],tokenUrl:u[r].tokenUrl??"",authorizationUrl:u[r].authorizationUrl??"",callbackUrl:e.callbackUrl??"",availableScopes:ls(u[r].availableScopes),scopes:ls(u[r].scopes,u[r]["x-replay-disabled-scopes"]),codeVerifier:e.codeVerifier??"",codeChallenge:e.codeChallenge??"",clientId:e.clientId??"",clientSecret:e.clientSecret??"",accessToken:e.accessToken??""};break}return t},a)}function LR(u,e,a){const r={...Sn(),securityType:u},n=Object.keys(e.flows||{})[0],i=sX(n,e.flows?.[n])??Fe.ClientCredentials;switch(u){case ye.BasicAuth:return{...r,[ye.BasicAuth]:{username:a.username,password:a.password,schemeName:e.id}};case ye.JWT:return{...r,[ye.JWT]:{token:a.token,schemeName:e.id}};case ye.DigestAuth:return{...r,[ye.DigestAuth]:{...r[ye.DigestAuth],username:a.username,password:a.password,schemeName:e.id}};case ye.APIKey:return{...r,[ye.APIKey]:{location:Tku(e.in),name:e.name,key:a.apiKey,schemeName:e.id}};case ye.OAuth2:return{...r,[ye.OAuth2]:{...r[ye.OAuth2],..._R(e.flows||{},a||{},r[ye.OAuth2]),authRequestExtraParams:KR(a.authRequestExtraParams),tokenRequestExtraParams:VR(a.tokenRequestExtraParams),grantType:i,schemeName:e.id}};case ye.OpenIDConnect:return{...r,[ye.OpenIDConnect]:{...r[ye.OpenIDConnect],..._R(a.flows||{},a||{},r[ye.OpenIDConnect]),openIdConnectUrl:a.openIdConnectUrl,userInfoUrl:a.userInfoUrl,authRequestExtraParams:KR(a.authRequestExtraParams),tokenRequestExtraParams:VR(a.tokenRequestExtraParams),grantType:i,schemeName:e.id}};default:return r}}function Rku(u,e){return[...u.map(t=>{if("scheme"in t){const n=Mku(t.scheme);return LR(n,t.scheme,t.values)}const r=e.find(n=>n.id===t.schemeName);if(r){const n=gg(r),i=LR(n,r,t.values);return i.securitySchemeId=r.id,i}return Sn()})]}function IR(u=[],e){const a=nX(e?.security||[]);return u.length?Rku(u,a):[Sn()]}function ls(u,e){const a=ao(u||{}),t=ao(e||{});return[...a,...t,dt()]}function KR(u){return(u||[]).map(e=>({id:crypto.randomUUID(),key:e.key??"",value:e.value??"",active:e.active??!0})).concat(Yt())}function VR(u){return(u||[]).map(e=>({id:crypto.randomUUID(),key:e.key??"",value:e.value??"",active:e.active??!0,sendIn:$ku(e.in)})).concat(r9())}function GR(u){if(!u)return[Yt()];const e=[];for(const a in u)e.push({id:crypto.randomUUID(),key:a,value:u[a],active:!0});return e.push(Yt()),e}const Nh={query:"queryParameters",path:"pathParameters",header:"headers",cookie:"cookies"};function HR(u,e){const a="$components.parameters.";if(u.reference.startsWith(a)){const t=u.reference.replace(a,"");return e?.[t]}}function qR(u,e,a){if(!u&&!e)return{pathParameters:[Ba("path")],queryParameters:[Ba("query")],headers:[Ba("header")],cookies:[Ba("cookie")]};const t={pathParameters:[],queryParameters:[],headers:[],cookies:[]};if(u)for(const r of u)if(NR(r)){const n=HR(r,a),i=Nh[n?.in];i&&t[i].push({reference:r.reference,active:!0,value:r.value})}else t[Nh[r.in]].push({id:crypto.randomUUID(),key:r.name,value:r.value,active:!0,in:r.in});if(e)for(const r of e)if(NR(r)){const n=HR(r,a),i=Nh[n?.in];i&&t[i].push({reference:r.reference,active:!1,value:r.value})}else t[Nh[r.in]].push({id:crypto.randomUUID(),key:r.name,value:r.value,active:!1,in:r.in});return t.pathParameters.push(Ba("path")),t.queryParameters.push(Ba("query")),t.headers.push(Ba("header")),t.cookies.push(Ba("cookie")),t}async function Nku(u,e){const a=uX().body;if(!u)return a;switch(u.contentType){case"application/x-www-form-urlencoded":case"multipart/form-data":return{...a,type:u.contentType,formData:await _ku(u,e)};case"application/octet-stream":const t=u.payload?await lX(u.payload,e):[],r=t.length>0?await qE(t[0]):null;return{...a,type:u.contentType,binary:r};case"application/json":case"application/ld+json":return{...a,type:u.contentType,content:JR(u.payload)};default:{const n=typeof u.payload=="string",i=u.contentType||(n?"text/plain":"application/json");return{...a,type:i,content:n?u.payload:JR(u.payload)}}}}async function WR(u,e,a,t){const r=await lX(e,t),n=r.length>0||Array.isArray(e),i=n?await iX(r):void 0;return{id:crypto.randomUUID(),key:u,value:n?"":e,type:n?"file":"text",active:a,files:i}}async function _ku(u,e){const a=uX().body.formData,t=u.contentType,r=u.payload?await Promise.all(Object.entries(u.payload).map(([o,s])=>WR(o,s,!0,e))):[],n=u["x-replay-disabled-payload"]?await Promise.all(Object.entries(u["x-replay-disabled-payload"]||{}).map(([o,s])=>WR(o,s,!1,e))):[];return{...a,[t]:[...r,...n,ws()]}}function JR(u){return u?JSON.stringify(u,null,2):""}function Lku(u,e){for(const a of Object.keys(e.paths)){const t=e.paths[a];for(const r of Object.keys(t)){const n=r.toLowerCase();if(["get","put","post","delete","options","head","patch","trace"].includes(n)&&t[n]?.operationId===u)return{method:n,path:a}}}return null}async function lX(u,e){return Array.isArray(u)?(await Promise.all(u.map(a=>UR(a,e)))).flat():typeof u=="string"?await UR(u,e):[]}async function UR(u,e){const a=/\$file\(['"](.+?)['"]\)/g,t=Array.from(u.matchAll(a));return Promise.all(t.map(r=>Iku(r[1],e)))}async function Iku(u,e){return await za.isAbsolute(u)?u:await za.resolve(await za.join(e,u))}const Q0=u=>!u||typeof u=="boolean"?{type:"object",properties:{}}:u.type?u:{...u,type:"object"},ZR=(u,e,a)=>{if(!u.properties)return u;const t=u.properties[e],r=Q0(t);return{...u,properties:{...u.properties,[e]:{...r,...a}}}},Kku=(u,e,a)=>{if(!u.properties||e===a||!a.trim())return null;const t={...u.properties};return t[a]?null:(t[a]=t[e],delete t[e],{...u,properties:t})},Vku=(u,e)=>{if(!u.properties)return u;const a={...u.properties};return delete a[e],{...u,properties:a}},Gku=(u,e,a={type:"string"})=>{const t=u.properties||{};return{...u,type:"object",properties:{...t,[e]:a}}};function QR(u){const e=Object.assign({},...(u||[]).filter(({key:a,active:t})=>a&&t).map(a=>({[a.key]:a.value})));if(Object.keys(e).length!==0)return e}function YR(u){if(!u)return{};const e={queryParameters:"query",headers:"header",cookies:"cookie",pathParameters:"path"},a=[],t=[];return Object.keys(e).forEach(r=>{const n=r;u[n].forEach(i=>{if(po(i)){const o={reference:i.reference,value:i.value||void 0};i.active?a.push(o):t.push(o)}else{if(!i.key)return;const o={name:i.key,in:e[n],value:i.value};i.active?a.push(o):t.push(o)}})}),{parameters:a.length>0?a:void 0,"x-replay-disabled-parameters":t.length>0?t:void 0}}function Hku(u){const e=u?.map(a=>({condition:a.condition,context:a.context,type:a.type==w0.SIMPLE?void 0:a.type}));if(e?.length!==0)return e}function qku(u){if(!(!u||u.length===0))return[...u]}async function cX(u,e){return u.absolutePath?`$file('${await za.relative(e,u.absolutePath)}')`:null}async function Wku(u,e){const{type:a,value:t,files:r}=u;switch(a){case"text":return t;case"file":let n=[];return r&&(n=(await Promise.all(Object.values(r).map(i=>cX(i,e)))).filter(i=>i!==null)),n.length===0?"":n.length===1?n[0]:n}}async function Jku(u,e){const a=u.type,t=u.formData[a],r={},n={};return await Promise.all(t.map(async i=>{const{key:o,active:s}=i;if(!o)return;const l=await Wku(i,e);s?r[o]=l:n[o]=l})),{payload:Object.keys(r).length>0?r:void 0,"x-replay-disabled-payload":Object.keys(n).length>0?n:void 0}}function Uku(u){if(!u)return u;try{const e=JSON.parse(u);return typeof e=="object"?e:u}catch{return u}}async function Zku(u,e){if(u)switch(u.type){case"application/x-www-form-urlencoded":case"multipart/form-data":return{contentType:u.type,...await Jku(u,e)};case"application/octet-stream":return{contentType:u.type,payload:u.binary?await cX(u.binary,e):null};case"application/json":case"application/ld+json":return u.content?{contentType:u.type,payload:Uku(u.content)}:void 0;default:return u.content?{contentType:u.type,payload:u.content}:void 0}}function Qku(u){return{...u.schemeName?{schemeName:u.schemeName}:{scheme:{type:"http",scheme:"basic"}},values:{username:u.username,password:u.password}}}function Yku(u){return{...u.schemeName?{schemeName:u.schemeName}:{scheme:{type:"apiKey",name:u.name,in:u.location.toLowerCase()}},values:{apiKey:u.key}}}function Xku(u){return{...u.schemeName?{schemeName:u.schemeName}:{scheme:{type:"http",scheme:"bearer"}},values:{token:u.token}}}function ebu(u){return{...u.schemeName?{schemeName:u.schemeName}:{scheme:{type:"http",scheme:"digest"}},values:{username:u.username,password:u.password}}}function ubu(u){const{flows:e,values:a}=pX(u);return{...u.schemeName?{schemeName:u.schemeName}:{scheme:{type:"openIdConnect",flows:e}},values:{...a,openIdConnectUrl:u.openIdConnectUrl,userInfoUrl:u.userInfoUrl,authRequestExtraParams:dX(u.authRequestExtraParams),tokenRequestExtraParams:EX(u.tokenRequestExtraParams)}}}function abu(u){const{flows:e,values:a}=pX(u);return{...u.schemeName?{schemeName:u.schemeName}:{scheme:{type:"oauth2",flows:e}},values:{...a,authRequestExtraParams:dX(u.authRequestExtraParams),tokenRequestExtraParams:EX(u.tokenRequestExtraParams)}}}function Ll(u){const e={},a={};return u.forEach(t=>{t.value&&(t.active?e[t.value]=t.description:a[t.value]=t.description)}),{scopes:e,"x-replay-disabled-scopes":Object.keys(a).length>0?a:void 0}}function dX(u){return u.filter(e=>e.value||e.key).map(e=>({key:e.key,value:e.value,active:e.active}))}function EX(u){return u.filter(e=>e.value||e.key).map(e=>({key:e.key,value:e.value,active:e.active,in:e.sendIn.toLowerCase()}))}function pX(u){let e;switch(u.grantType){case Fe.ClientCredentials:return e=u[Fe.ClientCredentials],{flows:{clientCredentials:{tokenUrl:e.tokenUrl,...Ll(e.scopes)}},values:{clientId:e.clientId,clientSecret:e.clientSecret,accessToken:e.accessToken}};case Fe.Implicit:return e=u[Fe.Implicit],{flows:{implicit:{authorizationUrl:e.authorizationUrl,...Ll(e.scopes)}},values:{clientId:e.clientId,accessToken:e.accessToken,callbackUrl:e.callbackUrl}};case Fe.Password:return e=u[Fe.Password],{flows:{password:{tokenUrl:e.tokenUrl,...Ll(e.scopes)}},values:{clientId:e.clientId,clientSecret:e.clientSecret,username:e.username,password:e.password,accessToken:e.accessToken}};case Fe.AuthorizationCode:return e=u[Fe.AuthorizationCode],{flows:{authorizationCode:{tokenUrl:e.tokenUrl,authorizationUrl:e.authorizationUrl,...Ll(e.scopes)}},values:{accessToken:e.accessToken,clientId:e.clientId,callbackUrl:e.callbackUrl}};case Fe.ClientCredentialsWithJwtAssertion:return e=u[Fe.ClientCredentialsWithJwtAssertion],{flows:{clientCredentials:{tokenUrl:e.tokenUrl,...Ll(e.scopes),"x-assertionType":"urn:ietf:params:oauth:client-assertion-type:jwt-bearer"}},values:{clientId:e.clientId,clientAssertion:e.clientAssertion,accessToken:e.accessToken}};case Fe.AuthorizationCodeWithPkce:return e=u[Fe.AuthorizationCodeWithPkce],{flows:{authorizationCode:{tokenUrl:e.tokenUrl,authorizationUrl:e.authorizationUrl,...Ll(e.scopes),"x-usePkce":!0}},values:{clientId:e.clientId,clientSecret:e.clientSecret,accessToken:e.accessToken,codeVerifier:e.codeVerifier,codeChallenge:e.codeChallenge,callbackUrl:e.callbackUrl}}}}function XR(u){const e=u.map(a=>{switch(a.securityType){case ye.OpenIDConnect:{const r=a[ye.OpenIDConnect];return ubu(r)}case ye.OAuth2:{const r=a[ye.OAuth2];return abu(r)}case ye.APIKey:{const r=a[ye.APIKey];return Yku(r)}case ye.BasicAuth:{const r=a[ye.BasicAuth];return Qku(r)}case ye.DigestAuth:{const r=a[ye.DigestAuth];return ebu(r)}case ye.JWT:{const r=a[ye.JWT];return Xku(r)}default:return null}}).filter(a=>a!==null);return{"x-security":e.length?e:void 0}}function tbu(u){const{inputs:e,parameters:a,...t}=u;let r=t;return Object.keys(e).length&&(r.inputs=e),Object.keys(a).length&&(r.parameters=Object.fromEntries(Object.entries(a).map(([n,{id:i,active:o,key:s,...l}])=>[n,{...l,name:s}]))),Object.keys(r).length||(r=void 0),r}async function rbu(u,e){const{id:a,state:t,srcType:r,sourceDescriptions:n,workflows:i,components:o,...s}=u;return{arazzoObject:{...s,sourceDescriptions:n.map(l=>({name:l.name,url:l.url,type:l.type||"openapi"})),components:tbu(o),workflows:await Promise.all(i.map(async({parameters:l,security:c,dependsOn:d,outputs:E,state:p,steps:x,inputs:m,...g})=>({...g,dependsOn:qku(d),outputs:QR(E),inputs:m?Q0(m):void 0,...XR(c),...YR(l),steps:await Promise.all(x.map(async({parameters:h,security:f,operation:k,requestBody:y,successCriteria:v,outputs:b,state:C,xOperation:B,...z})=>{const P={operationId:void 0,operationPath:void 0,"x-operation":void 0};if(k){const L=u.sourceDescriptions.find(({apiId:I})=>I===k.apiId)||u.sourceDescriptions[0];if(k.operationId){const I=u.sourceDescriptions.length<=1;P.operationId=I?k.operationId:`$sourceDescriptions.${L.name}.${k.operationId}`}else P.operationPath=`{$sourceDescriptions.${L.name}.url}#/paths/${_f.escape(k.path)}/${k.method}`}else B&&(P["x-operation"]={...B,url:B.url.split("?")[0]});return{...z,...P,...XR(f),...YR(h),requestBody:await Zku(y,e),successCriteria:Hku(v),outputs:QR(b)}}))})))}}}class nbu extends WJ{constructor(e,a){super(e),this.convertOperationToReplayValue=a}parse(e,a){return wku(e.content,e.uri,e.type,this.storage.baseDir,a,this.convertOperationToReplayValue)}async stringify(e){const{arazzoObject:a}=await rbu(e,this.storage.baseDir);return await za.extname(e.id)===".json"?JSON.stringify(a,null,2):xi.dump(a)}}class ibu{constructor(e,a){this.storage=e,this.localStorageSecretsProvider=a}default=[];async read(){const e=await this.storage.get("replay-environments.yaml"),a=await this.localStorageSecretsProvider.get();let t=null,r=null;if(!e)return this.default;try{t=xi.load(e),r=a?JSON.parse(a):null}catch(o){return console.error("Failed to parse environments file",o),this.default}return t?Object.keys(t).filter(o=>o!=="version").map(o=>({name:o,inputs:Object.entries(t[o].inputs).map(([s,l])=>{if(typeof l=="string")return{name:s,value:l,isSecret:!1};const c=r?.[o]?.[s]??"";return{name:s,value:c,isSecret:!0}}),servers:Object.entries(t[o].servers).map(([s,l])=>({apiId:s,value:l.value,variables:Object.entries(l.variables||{}).map(([c,d])=>({name:c,value:d}))})),state:Nu.Normal})):this.default}async write(e){const a=await this.localStorageSecretsProvider.get(),t=a?JSON.parse(a):{},r=e.reduce((n,i)=>(i.name&&(n[i.name]={inputs:i.inputs.reduce((o,s)=>(s.isSecret&&t?(t[i.name]||(t[i.name]={}),t[i.name][s.name]=s.value,o[s.name]={provider:"local"}):o[s.name]=s.value,o),{}),servers:i.servers.reduce((o,s)=>(o[s.apiId]={value:s.value,variables:Object.fromEntries(s.variables.map(l=>[l.name,l.value]))},o),{})}),n),{});this.localStorageSecretsProvider.set(JSON.stringify(t)),r&&this.storage.set("replay-environments.yaml",xi.dump(r))}}class obu{constructor(e,a,t){this.storage=e,this.filePath=a,this.defaultValue=t}async parse(e){return JSON.parse(e)}stringify(e){return JSON.stringify(e)}async read(){const e=await this.storage.get(this.filePath);return e?await this.parse(e):this.defaultValue}async write(e){return this.storage.set(this.filePath,this.stringify(e))}}const sbu=(u,e)=>({data:u,version:e});class hF extends obu{constructor(e,a,t,r){super(e,a,t),this.version=r}migrationMap={};migrate(e){if(!this.migrationMap[e.version])return this.defaultValue;const a=this.migrationMap[e.version](e);return a.version===this.version?a:this.migrate(a)}async parse(e){const a=JSON.parse(e);if(a.version!==this.version){const t=this.migrate(a);return await this.write(t.data),t.data}return a.data}stringify(e){return JSON.stringify(sbu(e,this.version))}}function lbu(u){return{data:{...u.data,tabs:u.data.tabs.map(e=>e.data.type===We.Step?{...e,data:{...e.data,draftStep:{...e.data.step,security:e.data.step.security.securities},step:void 0,hasUnsavedChanges:void 0,showUnsavedChangesModal:void 0}}:e)},version:2}}const eN=2,cbu="tabs.json";class dbu extends hF{migrationMap={1:lbu};constructor(e){super(e,cbu,li(IJ),eN)}async parse(e){let a=JSON.parse(e);a.version!==eN&&(a=this.migrate(a));const t=await Promise.all(a.data.tabs.map(async r=>{if(r.data.type===We.Step&&r.data.draftStep){const n=r.data.draftStep.requestBody.formData;n["multipart/form-data"]=await uN(n["multipart/form-data"]),n["application/x-www-form-urlencoded"]=await uN(n["application/x-www-form-urlencoded"]),r.data.draftStep.requestBody.binary&&r.data.draftStep.requestBody.binary.absolutePath&&(r.data.draftStep.requestBody.binary=await qE(r.data.draftStep.requestBody.binary.absolutePath))}return r}));return{...a.data,tabs:t}}stringify(e){return super.stringify({...e,tabs:e.tabs.map(a=>a.data.type===We.Step?{...a,data:{...a.data,response:null}}:a.data.type===We.WorkflowRun?{...a,data:{...a.data,result:null}}:a)})}}async function uN(u){return Promise.all(u.map(async e=>{const a={...e};if(e.files){const t=e.files.map(r=>r.absolutePath).filter(r=>r!==null);a.files=await iX(t)}return a}))}const Ebu=1,pbu=1;class mbu{constructor(e,a){this.project=e,this.convertOperationToReplayValue=a,this.localStorageSecretsProvider=new VEu(this.project.id),this.systemFilesStorage=this.isTauriApp?new Yj(this.project.systemFilesDir):new Uj(this.project.systemFilesDir),this.userFilesStorage=this.isTauriApp?new Yj(this.project.userFilesDir):new Uj(this.project.userFilesDir);const t=new jEu;this.historyStorage=new hF(this.systemFilesStorage,"history.json",[],Ebu),this.activeEnvironmentIdStorage=new hF(this.systemFilesStorage,"active_environment_id.json",ME,pbu),this.tabsStateStorage=new dbu(this.systemFilesStorage),this.environmentsStorage=new ibu(this.userFilesStorage,this.localStorageSecretsProvider),this.collectionsStorage=new nbu(this.userFilesStorage,this.convertOperationToReplayValue),this.apisStorage=new GEu(this.isTauriApp?this.userFilesStorage:t)}historyStorage;activeEnvironmentIdStorage;tabsStateStorage;environmentsStorage;collectionsStorage;apisStorage;isTauriApp=kc();systemFilesStorage;localStorageSecretsProvider;userFilesStorage;async detectProjectFiles(){const a=(await this.userFilesStorage.ls()).filter(i=>/\.(ya?ml|json)$/.test(i)),t=[],r=[],n=new Set;return await Promise.all(a.map(async i=>{const o=await this.userFilesStorage.get(i);if(o)try{const s=xi.load(o);typeof s=="object"&&s!==null&&(typeof s.openapi=="string"?t.push({uri:i,type:pn.FS,content:s}):typeof s.arazzo=="string"&&(r.push({uri:i,type:pn.FS,content:s}),s.sourceDescriptions?.map(async l=>{const c=l.type,d=l.url,E=!c||c==="openapi",p=typeof d=="string"&&KJ(d);E&&p&&n.add(d)})))}catch(s){console.error(`Error parsing YAML/JSON file ${i}:`,s)}})),{apiFiles:t,collectionFiles:r,apiUrls:n}}async loadApis(e){const a=[];return await Promise.all(Array.from(e).map(async t=>{let r="";try{const n=await mn(Zee({proxyUrl:RJ,resolvedUrl:t,ignoreProxy:this.isTauriApp}));r=await n.text(),n.ok||console.error(`Error fetching API from ${t}:`,n.status,r)}catch(n){console.error(`Error fetching API from ${t}:`,n)}try{const n=xi.load(r);typeof n=="object"&&n!==null&&typeof n.openapi=="string"&&a.push({uri:t,type:pn.WEB,content:n})}catch(n){console.error(`Error parsing YAML from ${t}:`,n)}})),a}async read(){const[e,a,t,r]=await Promise.all([this.historyStorage.read(),this.activeEnvironmentIdStorage.read(),this.tabsStateStorage.read(),this.environmentsStorage.read()]),{apiFiles:n,collectionFiles:i,apiUrls:o}=await this.detectProjectFiles(),s=await this.loadApis(o),l=await this.apisStorage.parseMany([...n,...s]),c=await this.collectionsStorage.parseMany(i,l);return{project:this.project,history:e,activeEnvironmentId:a,tabsState:t,environments:r,apis:l,collections:c}}async update(e,a){switch(e.path[0]){case"history":this.historyStorage.write(a.history.get());break;case"activeEnvironmentId":this.activeEnvironmentIdStorage.write(a.activeEnvironmentId.get());break;case"tabsState":this.tabsStateStorage.write(a.tabsState.get());break;case"environments":this.environmentsStorage.write(a.environments.get());break;case"apis":this.isTauriApp&&await this.apisStorage.update(e,a.apis.get());break;case"collections":await this.collectionsStorage.update(e,a.collections.get());break}}}function mX(u=!1){let e,a=!1;return()=>({id:"RootStoragePlugin",onCreate:()=>({init:t=>async(r,n)=>{if(a||t.path.length>0)return{isInitialized:!1};if(a=!0,!u){e=new mbu(r,n);const i=await e.read();t.merge(i)}return a=!1,{isInitialized:!0}}}),onSet(t,r,n){a||u||e.update(r,n)}})}function hX({defaultEnvironments:u}={}){return structuredClone({project:{id:"default",userFilesDir:"default",systemFilesDir:"default"},history:[],tabsState:li(IJ),activeEnvironmentId:ME,environments:u||LJ,collections:[],apis:[],requestController:null,apps:{apps:[],appsLoadingState:Jr.Idle},predefinedApiId:null,predefinedEnvironmentNames:new Set,predefinedInputNames:new Set})}const hbu=jI(hX(),MI(SEu({key:"replay-root-store"}),mX())),l9=H.createContext(hbu),xbu=l9.Provider;function Su(){const u=H.useContext(l9);return TI(u)}function Dbu(){return{theme:"light",disableCollectionsTab:!1,oAuth2RedirectURI:null,corsProxyUrl:void 0,mockServer:void 0,certificates:[],isApiBased:!1,generatedEnvironments:[],generatedInputs:[]}}const fbu=Dbu(),gbu=H.createContext(fbu);function zi(){const u=H.useContext(gbu);return TI(u)}function vbu(u,e){const{apps:{apiId:a}}=Su(),{corsProxyUrl:t,disableCollectionsTab:r,mockServer:n,oAuth2RedirectURI:i,certificates:o,storageKey:s,isApiBased:l}=zi();t.set(u?.corsProxyUrl??RJ),n.set(u?.mockServer),a.set(u?.apiId),i.set(u?.oAuth2RedirectURI),r.set(!!u?.disableCollectionsTab),s.set(u?.storageKey),l.set(!!e),H.useEffect(()=>{o.set(u?.certificates||[])},[u?.certificates])}const vg=H.createContext({});function WE(){return H.useContext(vg)||{}}const kbu="0.18.0-next.11",bbu={version:kbu};class ybu{client;_isInitialized=!1;constructor(){this.client=new cEu}get isInitialized(){return this._isInitialized}init(e){if(this.isInitialized)return;const t={serviceName:"replay",serviceVersion:bbu.version,version:"1.0.0",tracerName:e?.tracerName||"desktop",collectorUrl:e?.collectorUrl||"",isProd:!0};this.client.init({otel:{...t,...e}}),this._isInitialized=!0}sendEvent(e,a){if(!this.isInitialized){console.warn("Telemetry client not initialized. Call init() first.");return}try{this.client.send(e,a)}catch(t){console.error("Failed to send telemetry event:",t)}}}const Zk=new ybu;function yu(){const{telemetry:u}=WE();return Zk.isInitialized||Zk.init({tracerName:u?.tracerName,collectorUrl:u?.collectorUrl}),{sendEvent:(e,a)=>{Zk.sendEvent(e,a)}}}const T0=800;function Gs(u){"@babel/helpers - typeof";return Gs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gs(u)}function Cbu(u,e){if(Gs(u)!="object"||!u)return u;var a=u[Symbol.toPrimitive];if(a!==void 0){var t=a.call(u,e);if(Gs(t)!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(u)}function xX(u){var e=Cbu(u,"string");return Gs(e)=="symbol"?e:e+""}function Z4(u,e,a){return(e=xX(e))in u?Object.defineProperty(u,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):u[e]=a,u}function aN(u,e){var a=Object.keys(u);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(u);e&&(t=t.filter(function(r){return Object.getOwnPropertyDescriptor(u,r).enumerable})),a.push.apply(a,t)}return a}function Ye(u){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?aN(Object(a),!0).forEach(function(t){Z4(u,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(a)):aN(Object(a)).forEach(function(t){Object.defineProperty(u,t,Object.getOwnPropertyDescriptor(a,t))})}return u}function Fbu(u){if(Array.isArray(u))return u}function Abu(u,e){var a=u==null?null:typeof Symbol<"u"&&u[Symbol.iterator]||u["@@iterator"];if(a!=null){var t,r,n,i,o=[],s=!0,l=!1;try{if(n=(a=a.call(u)).next,e===0){if(Object(a)!==a)return;s=!1}else for(;!(s=(t=n.call(a)).done)&&(o.push(t.value),o.length!==e);s=!0);}catch(c){l=!0,r=c}finally{try{if(!s&&a.return!=null&&(i=a.return(),Object(i)!==i))return}finally{if(l)throw r}}return o}}function xF(u,e){(e==null||e>u.length)&&(e=u.length);for(var a=0,t=Array(e);a<e;a++)t[a]=u[a];return t}function DX(u,e){if(u){if(typeof u=="string")return xF(u,e);var a={}.toString.call(u).slice(8,-1);return a==="Object"&&u.constructor&&(a=u.constructor.name),a==="Map"||a==="Set"?Array.from(u):a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?xF(u,e):void 0}}function Bbu(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
525
525
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pi(u,e){return Fbu(u)||Abu(u,e)||DX(u,e)||Bbu()}function Sbu(u,e){if(u==null)return{};var a={};for(var t in u)if({}.hasOwnProperty.call(u,t)){if(e.indexOf(t)!==-1)continue;a[t]=u[t]}return a}function wi(u,e){if(u==null)return{};var a,t,r=Sbu(u,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(u);for(t=0;t<n.length;t++)a=n[t],e.indexOf(a)===-1&&{}.propertyIsEnumerable.call(u,a)&&(r[a]=u[a])}return r}var zbu=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function wbu(u){var e=u.defaultInputValue,a=e===void 0?"":e,t=u.defaultMenuIsOpen,r=t===void 0?!1:t,n=u.defaultValue,i=n===void 0?null:n,o=u.inputValue,s=u.menuIsOpen,l=u.onChange,c=u.onInputChange,d=u.onMenuClose,E=u.onMenuOpen,p=u.value,x=wi(u,zbu),m=H.useState(o!==void 0?o:a),g=pi(m,2),h=g[0],f=g[1],k=H.useState(s!==void 0?s:r),y=pi(k,2),v=y[0],b=y[1],C=H.useState(p!==void 0?p:i),B=pi(C,2),z=B[0],P=B[1],L=H.useCallback(function(re,he){typeof l=="function"&&l(re,he),P(re)},[l]),I=H.useCallback(function(re,he){var j;typeof c=="function"&&(j=c(re,he)),f(j!==void 0?j:re)},[c]),G=H.useCallback(function(){typeof E=="function"&&E(),b(!0)},[E]),X=H.useCallback(function(){typeof d=="function"&&d(),b(!1)},[d]),U=o!==void 0?o:h,ae=s!==void 0?s:v,Ee=p!==void 0?p:z;return Ye(Ye({},x),{},{inputValue:U,menuIsOpen:ae,onChange:L,onInputChange:I,onMenuClose:X,onMenuOpen:G,value:Ee})}function tu(){return tu=Object.assign?Object.assign.bind():function(u){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var t in a)({}).hasOwnProperty.call(a,t)&&(u[t]=a[t])}return u},tu.apply(null,arguments)}function Obu(u,e){if(!(u instanceof e))throw new TypeError("Cannot call a class as a function")}function tN(u,e){for(var a=0;a<e.length;a++){var t=e[a];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(u,xX(t.key),t)}}function Pbu(u,e,a){return e&&tN(u.prototype,e),a&&tN(u,a),Object.defineProperty(u,"prototype",{writable:!1}),u}function DF(u,e){return DF=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,t){return a.__proto__=t,a},DF(u,e)}function jbu(u,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");u.prototype=Object.create(e&&e.prototype,{constructor:{value:u,writable:!0,configurable:!0}}),Object.defineProperty(u,"prototype",{writable:!1}),e&&DF(u,e)}function PD(u){return PD=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},PD(u)}function fX(){try{var u=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(fX=function(){return!!u})()}function Mbu(u){if(u===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u}function Tbu(u,e){if(e&&(Gs(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Mbu(u)}function $bu(u){var e=fX();return function(){var a,t=PD(u);if(e){var r=PD(this).constructor;a=Reflect.construct(t,arguments,r)}else a=t.apply(this,arguments);return Tbu(this,a)}}function Rbu(u){if(Array.isArray(u))return xF(u)}function Nbu(u){if(typeof Symbol<"u"&&u[Symbol.iterator]!=null||u["@@iterator"]!=null)return Array.from(u)}function _bu(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
526
526
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function c9(u){return Rbu(u)||Nbu(u)||DX(u)||_bu()}function Lbu(u){if(u.sheet)return u.sheet;for(var e=0;e<document.styleSheets.length;e++)if(document.styleSheets[e].ownerNode===u)return document.styleSheets[e]}function Ibu(u){var e=document.createElement("style");return e.setAttribute("data-emotion",u.key),u.nonce!==void 0&&e.setAttribute("nonce",u.nonce),e.appendChild(document.createTextNode("")),e.setAttribute("data-s",""),e}var Kbu=(function(){function u(a){var t=this;this._insertTag=function(r){var n;t.tags.length===0?t.insertionPoint?n=t.insertionPoint.nextSibling:t.prepend?n=t.container.firstChild:n=t.before:n=t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(r,n),t.tags.push(r)},this.isSpeedy=a.speedy===void 0?process.env.NODE_ENV==="production":a.speedy,this.tags=[],this.ctr=0,this.nonce=a.nonce,this.key=a.key,this.container=a.container,this.prepend=a.prepend,this.insertionPoint=a.insertionPoint,this.before=null}var e=u.prototype;return e.hydrate=function(t){t.forEach(this._insertTag)},e.insert=function(t){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(Ibu(this));var r=this.tags[this.tags.length-1];if(process.env.NODE_ENV!=="production"){var n=t.charCodeAt(0)===64&&t.charCodeAt(1)===105;n&&this._alreadyInsertedOrderInsensitiveRule&&console.error(`You're attempting to insert the following rule:
527
527
  `+t+"\n\n`@import` rules must be before all other types of rules in a stylesheet but other rules have already been inserted. Please ensure that `@import` rules are before all other rules."),this._alreadyInsertedOrderInsensitiveRule=this._alreadyInsertedOrderInsensitiveRule||!n}if(this.isSpeedy){var i=Lbu(r);try{i.insertRule(t,i.cssRules.length)}catch(o){process.env.NODE_ENV!=="production"&&!/:(-moz-placeholder|-moz-focus-inner|-moz-focusring|-ms-input-placeholder|-moz-read-write|-moz-read-only|-ms-clear|-ms-expand|-ms-reveal){/.test(t)&&console.error('There was a problem inserting the following rule: "'+t+'"',o)}}else r.appendChild(document.createTextNode(t));this.ctr++},e.flush=function(){this.tags.forEach(function(t){return t.parentNode&&t.parentNode.removeChild(t)}),this.tags=[],this.ctr=0,process.env.NODE_ENV!=="production"&&(this._alreadyInsertedOrderInsensitiveRule=!1)},u})(),A0="-ms-",jD="-moz-",Vu="-webkit-",d9="comm",E9="rule",p9="decl",Vbu="@import",gX="@keyframes",Gbu=Math.abs,kg=String.fromCharCode,Hbu=Object.assign;function qbu(u,e){return p0(u,0)^45?(((e<<2^p0(u,0))<<2^p0(u,1))<<2^p0(u,2))<<2^p0(u,3):0}function vX(u){return u.trim()}function Wbu(u,e){return(u=e.exec(u))?u[0]:u}function Zu(u,e,a){return u.replace(e,a)}function fF(u,e){return u.indexOf(e)}function p0(u,e){return u.charCodeAt(e)|0}function cE(u,e,a){return u.slice(e,a)}function Xr(u){return u.length}function m9(u){return u.length}function _h(u,e){return e.push(u),u}function Jbu(u,e){return u.map(e).join("")}var bg=1,ic=1,kX=0,mt=0,La=0,wc="";function yg(u,e,a,t,r,n,i){return{value:u,root:e,parent:a,type:t,props:r,children:n,line:bg,column:ic,length:i,return:""}}function w4(u,e){return Hbu(yg("",null,null,"",null,null,0),u,{length:-u.length},e)}function Ubu(){return La}function Zbu(){return La=mt>0?p0(wc,--mt):0,ic--,La===10&&(ic=1,bg--),La}function Mt(){return La=mt<kX?p0(wc,mt++):0,ic++,La===10&&(ic=1,bg++),La}function fn(){return p0(wc,mt)}function Mx(){return mt}function JE(u,e){return cE(wc,u,e)}function dE(u){switch(u){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function bX(u){return bg=ic=1,kX=Xr(wc=u),mt=0,[]}function yX(u){return wc="",u}function Tx(u){return vX(JE(mt-1,gF(u===91?u+2:u===40?u+1:u)))}function Qbu(u){for(;(La=fn())&&La<33;)Mt();return dE(u)>2||dE(La)>3?"":" "}function Ybu(u,e){for(;--e&&Mt()&&!(La<48||La>102||La>57&&La<65||La>70&&La<97););return JE(u,Mx()+(e<6&&fn()==32&&Mt()==32))}function gF(u){for(;Mt();)switch(La){case u:return mt;case 34:case 39:u!==34&&u!==39&&gF(La);break;case 40:u===41&&gF(u);break;case 92:Mt();break}return mt}function Xbu(u,e){for(;Mt()&&u+La!==57;)if(u+La===84&&fn()===47)break;return"/*"+JE(e,mt-1)+"*"+kg(u===47?u:Mt())}function eyu(u){for(;!dE(fn());)Mt();return JE(u,mt)}function uyu(u){return yX($x("",null,null,null,[""],u=bX(u),0,[0],u))}function $x(u,e,a,t,r,n,i,o,s){for(var l=0,c=0,d=i,E=0,p=0,x=0,m=1,g=1,h=1,f=0,k="",y=r,v=n,b=t,C=k;g;)switch(x=f,f=Mt()){case 40:if(x!=108&&p0(C,d-1)==58){fF(C+=Zu(Tx(f),"&","&\f"),"&\f")!=-1&&(h=-1);break}case 34:case 39:case 91:C+=Tx(f);break;case 9:case 10:case 13:case 32:C+=Qbu(x);break;case 92:C+=Ybu(Mx()-1,7);continue;case 47:switch(fn()){case 42:case 47:_h(ayu(Xbu(Mt(),Mx()),e,a),s);break;default:C+="/"}break;case 123*m:o[l++]=Xr(C)*h;case 125*m:case 59:case 0:switch(f){case 0:case 125:g=0;case 59+c:p>0&&Xr(C)-d&&_h(p>32?nN(C+";",t,a,d-1):nN(Zu(C," ","")+";",t,a,d-2),s);break;case 59:C+=";";default:if(_h(b=rN(C,e,a,l,c,r,o,k,y=[],v=[],d),n),f===123)if(c===0)$x(C,e,b,b,y,n,d,o,v);else switch(E===99&&p0(C,3)===110?100:E){case 100:case 109:case 115:$x(u,b,b,t&&_h(rN(u,b,b,0,0,r,o,k,r,y=[],d),v),r,v,d,o,t?y:v);break;default:$x(C,b,b,b,[""],v,0,o,v)}}l=c=p=0,m=h=1,k=C="",d=i;break;case 58:d=1+Xr(C),p=x;default:if(m<1){if(f==123)--m;else if(f==125&&m++==0&&Zbu()==125)continue}switch(C+=kg(f),f*m){case 38:h=c>0?1:(C+="\f",-1);break;case 44:o[l++]=(Xr(C)-1)*h,h=1;break;case 64:fn()===45&&(C+=Tx(Mt())),E=fn(),c=d=Xr(k=C+=eyu(Mx())),f++;break;case 45:x===45&&Xr(C)==2&&(m=0)}}return n}function rN(u,e,a,t,r,n,i,o,s,l,c){for(var d=r-1,E=r===0?n:[""],p=m9(E),x=0,m=0,g=0;x<t;++x)for(var h=0,f=cE(u,d+1,d=Gbu(m=i[x])),k=u;h<p;++h)(k=vX(m>0?E[h]+" "+f:Zu(f,/&\f/g,E[h])))&&(s[g++]=k);return yg(u,e,a,r===0?E9:o,s,l,c)}function ayu(u,e,a){return yg(u,e,a,d9,kg(Ubu()),cE(u,2,-2),0)}function nN(u,e,a,t){return yg(u,e,a,p9,cE(u,0,t),cE(u,t+1,-1),t)}function w1(u,e){for(var a="",t=m9(u),r=0;r<t;r++)a+=e(u[r],r,u,e)||"";return a}function tyu(u,e,a,t){switch(u.type){case Vbu:case p9:return u.return=u.return||u.value;case d9:return"";case gX:return u.return=u.value+"{"+w1(u.children,t)+"}";case E9:u.value=u.props.join(",")}return Xr(a=w1(u.children,t))?u.return=u.value+"{"+a+"}":""}function ryu(u){var e=m9(u);return function(a,t,r,n){for(var i="",o=0;o<e;o++)i+=u[o](a,t,r,n)||"";return i}}function nyu(u){return function(e){e.root||(e=e.return)&&u(e)}}function iyu(u){var e=Object.create(null);return function(a){return e[a]===void 0&&(e[a]=u(a)),e[a]}}var oyu=function(e,a,t){for(var r=0,n=0;r=n,n=fn(),r===38&&n===12&&(a[t]=1),!dE(n);)Mt();return JE(e,mt)},syu=function(e,a){var t=-1,r=44;do switch(dE(r)){case 0:r===38&&fn()===12&&(a[t]=1),e[t]+=oyu(mt-1,a,t);break;case 2:e[t]+=Tx(r);break;case 4:if(r===44){e[++t]=fn()===58?"&\f":"",a[t]=e[t].length;break}default:e[t]+=kg(r)}while(r=Mt());return e},lyu=function(e,a){return yX(syu(bX(e),a))},iN=new WeakMap,cyu=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var a=e.value,t=e.parent,r=e.column===t.column&&e.line===t.line;t.type!=="rule";)if(t=t.parent,!t)return;if(!(e.props.length===1&&a.charCodeAt(0)!==58&&!iN.get(t))&&!r){iN.set(e,!0);for(var n=[],i=lyu(a,n),o=t.props,s=0,l=0;s<i.length;s++)for(var c=0;c<o.length;c++,l++)e.props[l]=n[s]?i[s].replace(/&\f/g,o[c]):o[c]+" "+i[s]}}},dyu=function(e){if(e.type==="decl"){var a=e.value;a.charCodeAt(0)===108&&a.charCodeAt(2)===98&&(e.return="",e.value="")}},Eyu="emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason",pyu=function(e){return e.type==="comm"&&e.children.indexOf(Eyu)>-1},myu=function(e){return function(a,t,r){if(!(a.type!=="rule"||e.compat)){var n=a.value.match(/(:first|:nth|:nth-last)-child/g);if(n){for(var i=a.parent===r[0],o=i?r[0].children:r,s=o.length-1;s>=0;s--){var l=o[s];if(l.line<a.line)break;if(l.column<a.column){if(pyu(l))return;break}}n.forEach(function(c){console.error('The pseudo class "'+c+'" is potentially unsafe when doing server-side rendering. Try changing it to "'+c.split("-child")[0]+'-of-type".')})}}}},CX=function(e){return e.type.charCodeAt(1)===105&&e.type.charCodeAt(0)===64},hyu=function(e,a){for(var t=e-1;t>=0;t--)if(!CX(a[t]))return!0;return!1},oN=function(e){e.type="",e.value="",e.return="",e.children="",e.props=""},xyu=function(e,a,t){CX(e)&&(e.parent?(console.error("`@import` rules can't be nested inside other rules. Please move it to the top level and put it before regular rules. Keep in mind that they can only be used within global styles."),oN(e)):hyu(a,t)&&(console.error("`@import` rules can't be after other rules. Please put your `@import` rules before your other rules."),oN(e)))};function FX(u,e){switch(qbu(u,e)){case 5103:return Vu+"print-"+u+u;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Vu+u+u;case 5349:case 4246:case 4810:case 6968:case 2756:return Vu+u+jD+u+A0+u+u;case 6828:case 4268:return Vu+u+A0+u+u;case 6165:return Vu+u+A0+"flex-"+u+u;case 5187:return Vu+u+Zu(u,/(\w+).+(:[^]+)/,Vu+"box-$1$2"+A0+"flex-$1$2")+u;case 5443:return Vu+u+A0+"flex-item-"+Zu(u,/flex-|-self/,"")+u;case 4675:return Vu+u+A0+"flex-line-pack"+Zu(u,/align-content|flex-|-self/,"")+u;case 5548:return Vu+u+A0+Zu(u,"shrink","negative")+u;case 5292:return Vu+u+A0+Zu(u,"basis","preferred-size")+u;case 6060:return Vu+"box-"+Zu(u,"-grow","")+Vu+u+A0+Zu(u,"grow","positive")+u;case 4554:return Vu+Zu(u,/([^-])(transform)/g,"$1"+Vu+"$2")+u;case 6187:return Zu(Zu(Zu(u,/(zoom-|grab)/,Vu+"$1"),/(image-set)/,Vu+"$1"),u,"")+u;case 5495:case 3959:return Zu(u,/(image-set\([^]*)/,Vu+"$1$`$1");case 4968:return Zu(Zu(u,/(.+:)(flex-)?(.*)/,Vu+"box-pack:$3"+A0+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Vu+u+u;case 4095:case 3583:case 4068:case 2532:return Zu(u,/(.+)-inline(.+)/,Vu+"$1$2")+u;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Xr(u)-1-e>6)switch(p0(u,e+1)){case 109:if(p0(u,e+4)!==45)break;case 102:return Zu(u,/(.+:)(.+)-([^]+)/,"$1"+Vu+"$2-$3$1"+jD+(p0(u,e+3)==108?"$3":"$2-$3"))+u;case 115:return~fF(u,"stretch")?FX(Zu(u,"stretch","fill-available"),e)+u:u}break;case 4949:if(p0(u,e+1)!==115)break;case 6444:switch(p0(u,Xr(u)-3-(~fF(u,"!important")&&10))){case 107:return Zu(u,":",":"+Vu)+u;case 101:return Zu(u,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Vu+(p0(u,14)===45?"inline-":"")+"box$3$1"+Vu+"$2$3$1"+A0+"$2box$3")+u}break;case 5936:switch(p0(u,e+11)){case 114:return Vu+u+A0+Zu(u,/[svh]\w+-[tblr]{2}/,"tb")+u;case 108:return Vu+u+A0+Zu(u,/[svh]\w+-[tblr]{2}/,"tb-rl")+u;case 45:return Vu+u+A0+Zu(u,/[svh]\w+-[tblr]{2}/,"lr")+u}return Vu+u+A0+u+u}return u}var Dyu=function(e,a,t,r){if(e.length>-1&&!e.return)switch(e.type){case p9:e.return=FX(e.value,e.length);break;case gX:return w1([w4(e,{value:Zu(e.value,"@","@"+Vu)})],r);case E9:if(e.length)return Jbu(e.props,function(n){switch(Wbu(n,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return w1([w4(e,{props:[Zu(n,/:(read-\w+)/,":"+jD+"$1")]})],r);case"::placeholder":return w1([w4(e,{props:[Zu(n,/:(plac\w+)/,":"+Vu+"input-$1")]}),w4(e,{props:[Zu(n,/:(plac\w+)/,":"+jD+"$1")]}),w4(e,{props:[Zu(n,/:(plac\w+)/,A0+"input-$1")]})],r)}return""})}},fyu=[Dyu],gyu=function(e){var a=e.key;if(process.env.NODE_ENV!=="production"&&!a)throw new Error(`You have to configure \`key\` for your cache. Please make sure it's unique (and not equal to 'css') as it's used for linking styles to your cache.
@@ -2039,7 +2039,7 @@ Use the data prop if you want to provide your own handlers.`);if(u.initialData){
2039
2039
  gap: var(--spacing-xs);
2040
2040
  `,Zx={[w0.SIMPLE]:{label:"Simple",tooltipContent:"Success criteria conditions in the form of basic literals, operators, and loose comparisons"},[w0.REGEX]:{label:"Regex",tooltipContent:"Regex patterns used as success criteria conditions"},[w0.JSONPATH]:{label:"JSONPath",tooltipContent:"JSONPath expressions as success criteria conditions"},[w0.XPATH]:{label:"XPath",tooltipContent:"XPath expressions as success criteria conditions"}},iTu=Object.keys(Zx);function oTu({successCriteria:u}){const{sendEvent:e}=yu(),a=n=>{e("button.click",{source:"workflow",action:"add_success_criteria",success_criteria_type:n}),u.set(i=>[...i||[],{...mku(n)}])},t=H.useMemo(()=>u.filter(n=>n.get()!==void 0),[u]),r=n=>{e("button.click",{source:"workflow",action:"remove_success_criteria",success_criteria_type:n.get().type,condition:n.get().condition}),n.set(lu)};return D.jsxs(D.Fragment,{children:[D.jsxs(Jt,{children:["Success criteria",D.jsx(br,{content:"List of conditions required to complete the step."})]}),t.map(n=>D.jsx(H.Fragment,{children:D.jsx(uTu,{successCriteria:n,label:Zx[n.get().type].label,tooltipContent:Zx[n.get().type].tooltipContent,additionalActions:D.jsx(Y0,{"data-testid":"remove-success-criteria-button",variant:"text",icon:D.jsx(W.TrashCanIcon,{}),onClick:()=>r(n)})})},n.get().id)),D.jsx(sTu,{renderInput:()=>D.jsx(W.Button,{variant:"outlined",icon:D.jsx(W.AddIcon,{}),iconPosition:"left",size:"small",children:"Add success criteria"}),dataTestId:"workflow-step-success-criteria-select",options:iTu.map(n=>({element:Zx[n].label,label:n,value:n})),onChange:n=>{a(n)},placement:"top",hideCheckmarkIcon:!0})]})}const sTu=N(W.Select)`
2041
2041
  border-radius: var(--border-radius-md);
2042
- `;function lTu({step:u,workflowId:e,collectionId:a}){const{handleIdChange:t}=rl(),r=u.stepId.get();return D.jsx(D.Fragment,{children:D.jsxs(Hae,{children:[D.jsx(Jt,{children:"Info"}),D.jsxs(Lu,{children:[D.jsxs(Lu.Row,{children:[D.jsx(Lu.Cell,{children:D.jsxs(Jt,{children:["Step ID",D.jsx(br,{content:"This step's unique identifier"})]})}),D.jsx(Lu.Cell,{$readonly:!0,children:D.jsx(OF,{attribute:u.stepId,editorTitle:"Change step ID",placeholder:"Add step ID",onSave:n=>{a&&e&&t({collectionId:a,workflowId:e,stepId:r},{collectionId:a,workflowId:e,stepId:n})}})})]}),D.jsxs(Lu.Row,{children:[D.jsx(Lu.Cell,{children:D.jsxs(Jt,{children:["Description",D.jsx(br,{content:"The step's purpose in the workflow."})]})}),D.jsx(Lu.Cell,{children:D.jsx(_9,{state:u.description,placeholder:"Add description"})})]})]}),D.jsxs(M1,{children:[D.jsx(Jt,{children:"Operation"}),D.jsx(JMu,{step:u,collectionId:a})]}),D.jsx(M1,{children:D.jsx(qae,{outputs:u.outputs,tooltipText:"Data generated in this step that can be used in the next steps."})}),D.jsx(M1,{children:D.jsx(oTu,{successCriteria:u.successCriteria})})]})})}function cTu({onParameterChange:u,files:e}){const a=H.useRef(null),t=o=>{o.target.files?.length&&u(Array.from(o.target.files).map(s=>({absolutePath:null,file:s})))},r=async()=>{if(kc())try{const{open:o}=await Promise.resolve().then(()=>require("./replay-index-BjpMtSxh.js")),s=await o({multiple:!0});if(!s)return;const c=(Array.isArray(s)?s:[s]).map(qE),E=(await Promise.all(c)).filter(p=>p!==null);u(E)}catch(o){console.error("Failed to open file dialog or read file:",o)}else a.current?.click()},n=H.useCallback(()=>{u(null)},[u]),i=H.useMemo(()=>{if(!e)return null;if(e.length===1)return D.jsx(jL,{icon:D.jsx(W.CloseIcon,{}),variant:"secondary",onClick:n,iconPosition:"right",size:"small",children:D.jsx(ML,{children:e[0].file.name})});if(e.length>1)return D.jsx(jL,{icon:D.jsx(W.CloseIcon,{}),variant:"secondary",onClick:n,iconPosition:"right",size:"small",children:D.jsxs(ML,{children:[e.length," files"]})})},[e,n]);return D.jsx(dTu,{children:D.jsxs(ETu,{children:[D.jsx(pTu,{children:i||D.jsx(hTu,{children:"Add files here"})}),D.jsxs(mTu,{children:[D.jsx(z2u,{onClick:r,variant:"text","data-testid":"add-button",icon:D.jsx(W.AddIcon,{color:"--text-color-secondary"})}),D.jsx("input",{"data-testid":"file-input",hidden:!0,ref:a,type:"file",multiple:!0,accept:"files/*",onChange:t})]})]})})}const dTu=N.div`
2042
+ `;function lTu({step:u,workflowId:e,collectionId:a}){const{handleIdChange:t}=rl(),r=u.stepId.get();return D.jsx(D.Fragment,{children:D.jsxs(Hae,{children:[D.jsx(Jt,{children:"Info"}),D.jsxs(Lu,{children:[D.jsxs(Lu.Row,{children:[D.jsx(Lu.Cell,{children:D.jsxs(Jt,{children:["Step ID",D.jsx(br,{content:"This step's unique identifier"})]})}),D.jsx(Lu.Cell,{$readonly:!0,children:D.jsx(OF,{attribute:u.stepId,editorTitle:"Change step ID",placeholder:"Add step ID",onSave:n=>{a&&e&&t({collectionId:a,workflowId:e,stepId:r},{collectionId:a,workflowId:e,stepId:n})}})})]}),D.jsxs(Lu.Row,{children:[D.jsx(Lu.Cell,{children:D.jsxs(Jt,{children:["Description",D.jsx(br,{content:"The step's purpose in the workflow."})]})}),D.jsx(Lu.Cell,{children:D.jsx(_9,{state:u.description,placeholder:"Add description"})})]})]}),D.jsxs(M1,{children:[D.jsx(Jt,{children:"Operation"}),D.jsx(JMu,{step:u,collectionId:a})]}),D.jsx(M1,{children:D.jsx(qae,{outputs:u.outputs,tooltipText:"Data generated in this step that can be used in the next steps."})}),D.jsx(M1,{children:D.jsx(oTu,{successCriteria:u.successCriteria})})]})})}function cTu({onParameterChange:u,files:e}){const a=H.useRef(null),t=o=>{o.target.files?.length&&u(Array.from(o.target.files).map(s=>({absolutePath:null,file:s})))},r=async()=>{if(kc())try{const{open:o}=await Promise.resolve().then(()=>require("./replay-index-CzFgkO6x.js")),s=await o({multiple:!0});if(!s)return;const c=(Array.isArray(s)?s:[s]).map(qE),E=(await Promise.all(c)).filter(p=>p!==null);u(E)}catch(o){console.error("Failed to open file dialog or read file:",o)}else a.current?.click()},n=H.useCallback(()=>{u(null)},[u]),i=H.useMemo(()=>{if(!e)return null;if(e.length===1)return D.jsx(jL,{icon:D.jsx(W.CloseIcon,{}),variant:"secondary",onClick:n,iconPosition:"right",size:"small",children:D.jsx(ML,{children:e[0].file.name})});if(e.length>1)return D.jsx(jL,{icon:D.jsx(W.CloseIcon,{}),variant:"secondary",onClick:n,iconPosition:"right",size:"small",children:D.jsxs(ML,{children:[e.length," files"]})})},[e,n]);return D.jsx(dTu,{children:D.jsxs(ETu,{children:[D.jsx(pTu,{children:i||D.jsx(hTu,{children:"Add files here"})}),D.jsxs(mTu,{children:[D.jsx(z2u,{onClick:r,variant:"text","data-testid":"add-button",icon:D.jsx(W.AddIcon,{color:"--text-color-secondary"})}),D.jsx("input",{"data-testid":"file-input",hidden:!0,ref:a,type:"file",multiple:!0,accept:"files/*",onChange:t})]})]})})}const dTu=N.div`
2043
2043
  position: relative;
2044
2044
  display: flex;
2045
2045
  flex-grow: 1;
@@ -2166,7 +2166,7 @@ Use the data prop if you want to provide your own handlers.`);if(u.initialData){
2166
2166
  `,zTu=N.div`
2167
2167
  display: flex;
2168
2168
  justify-content: center;
2169
- `;function wTu({data:u,type:e,editable:a}){const t=pa(),r=u[e];function n(o,s){s&&r.merge([ws()])}function i(o){r[o].set(lu)}return D.jsx(DTu,{keyName:"Param",formElements:r,onParameterChange:n,environment:t,enableInputTypeSelection:e!==M0["application/x-www-form-urlencoded"],editable:a,actions:o=>D.jsx(Y0,{onClick:()=>i(o),variant:"text",icon:D.jsx(W.TrashCanIcon,{})})})}const OTu=({data:u})=>{const e=u.get(),[a,t]=H.useState(!1),r=H.useRef(null),n=l=>{const c=l.target.files?.[0];if(c){t(!0);const d=new FileReader;d.onload=()=>{t(!1),u.set({absolutePath:null,file:c})},d.readAsDataURL(c)}},i=async l=>{if(l?.preventDefault(),kc())try{const{open:c}=await Promise.resolve().then(()=>require("./replay-index-BjpMtSxh.js")),d=await c();if(!d)return;const E=await qE(d);u.set(E)}catch(c){console.error("Failed to open file dialog or read file:",c)}else r.current?.click()},o=l=>{l.key==="Enter"&&(l.preventDefault(),i())},s=()=>{u.set(null)};return a?D.jsxs(PTu,{children:[D.jsx(W.SpinnerIcon,{}),"Loading..."]}):e&&e.file?.name?D.jsxs(jTu,{children:[D.jsxs(MTu,{children:[D.jsx(W.DocumentBlankIcon,{size:"16px"}),D.jsx(TTu,{children:e.file?.name})]}),D.jsx(Y0,{onClick:s,icon:D.jsx(W.TrashCanIcon,{})})]}):D.jsx(Wae,{children:!e&&D.jsxs($Tu,{tabIndex:0,role:"button",onKeyDown:o,onClick:i,children:[D.jsx("input",{type:"file",onChange:n,ref:r}),D.jsx(W.CloudUploadIcon,{}),"Upload file"]})})},Wae=N.div`
2169
+ `;function wTu({data:u,type:e,editable:a}){const t=pa(),r=u[e];function n(o,s){s&&r.merge([ws()])}function i(o){r[o].set(lu)}return D.jsx(DTu,{keyName:"Param",formElements:r,onParameterChange:n,environment:t,enableInputTypeSelection:e!==M0["application/x-www-form-urlencoded"],editable:a,actions:o=>D.jsx(Y0,{onClick:()=>i(o),variant:"text",icon:D.jsx(W.TrashCanIcon,{})})})}const OTu=({data:u})=>{const e=u.get(),[a,t]=H.useState(!1),r=H.useRef(null),n=l=>{const c=l.target.files?.[0];if(c){t(!0);const d=new FileReader;d.onload=()=>{t(!1),u.set({absolutePath:null,file:c})},d.readAsDataURL(c)}},i=async l=>{if(l?.preventDefault(),kc())try{const{open:c}=await Promise.resolve().then(()=>require("./replay-index-CzFgkO6x.js")),d=await c();if(!d)return;const E=await qE(d);u.set(E)}catch(c){console.error("Failed to open file dialog or read file:",c)}else r.current?.click()},o=l=>{l.key==="Enter"&&(l.preventDefault(),i())},s=()=>{u.set(null)};return a?D.jsxs(PTu,{children:[D.jsx(W.SpinnerIcon,{}),"Loading..."]}):e&&e.file?.name?D.jsxs(jTu,{children:[D.jsxs(MTu,{children:[D.jsx(W.DocumentBlankIcon,{size:"16px"}),D.jsx(TTu,{children:e.file?.name})]}),D.jsx(Y0,{onClick:s,icon:D.jsx(W.TrashCanIcon,{})})]}):D.jsx(Wae,{children:!e&&D.jsxs($Tu,{tabIndex:0,role:"button",onKeyDown:o,onClick:i,children:[D.jsx("input",{type:"file",onChange:n,ref:r}),D.jsx(W.CloudUploadIcon,{}),"Upload file"]})})},Wae=N.div`
2170
2170
  display: flex;
2171
2171
  align-items: center;
2172
2172
  justify-content: flex-start;
@@ -3099,7 +3099,7 @@ Use the data prop if you want to provide your own handlers.`);if(u.initialData){
3099
3099
  padding: var(--spacing-xs) var(--spacing-sm);
3100
3100
  }
3101
3101
  `,n_u={info:u=>{},error:u=>{},warn:u=>{},printNewLine:()=>{},printSeparator:()=>{},indent:(u,e)=>u,output:u=>u};class i_u extends Rf{constructor(){super()}resolveExternalRef(e,a){return Dx(a)?a:e&&Dx(e)?new URL(a,e).href:e?Ms.resolve(Ms.dirname(e),a):a}async loadExternalRef(e){if(Dx(e)){const{body:a,mimeType:t}=await JI(e,{...this.config.http,customFetch:mn});return new L1(e,a,t)}else{if(!await qJ(e))throw new Error(`File not found at ${e}.`);try{throw await HJ(e),new Error(`Expected a file but received a folder at ${e}.`)}catch(r){if(r instanceof Error&&r.message.includes("Expected a file but received a folder"))throw r}const t=await dA(e);return new L1(e,t.replace(/\r\n/g,`
3102
- `))}}}async function o_u({collectionId:u,workflowId:e,projectDir:a,inputsObject:t,serversObject:r,sourceDescriptions:n,severitySettings:i}){const o=`${a}/${u}`,s=new i_u,l=t.map(E=>JSON.stringify({[E.name]:E.value})),c=s_u(r,n),{run:d}=await Promise.resolve().then(()=>require("./replay-index-fpt4-YW8.js"));return await d({files:[o],workflow:e?[e]:[],fetch:mn,logger:n_u,maxSteps:500,maxFetchTimeout:4e4,requestFileLoader:{getFileBody:async E=>{if(!await qJ(E))throw new Error(`File ${E} doesn't exist or isn't readable.`);try{const x=await dA(E),m=new TextEncoder().encode(x);return new File([m],await GJ(E))}catch(x){throw new Error(`Failed to read file ${E}: ${x}`)}}},envVariables:{},config:await VH({}),externalRefResolver:s,input:l,server:c,severity:JSON.stringify(i),skipLint:!0})}function s_u(u,e){return e.map(a=>{const t=u.find(n=>n.apiId===a.apiId);if(!t)return null;let r=t.value;if(t.variables)for(const n of t.variables){const i=new RegExp(`\\{${n.name}\\}`,"g");r=r.replace(i,n.value)}return`${a.name}=${r}`}).filter(a=>a!==null)}function DB(u){return u==null?"N/A":u<1e3?`${u} ms`:u<1e4?`${(u/1e3).toFixed(1)} s`:`${Math.round(u/1e3)} s`}function b0e({checks:u}){const e=u.filter(p=>p.severity!=="off"),a=e.filter(p=>p.passed).length,t=e.filter(p=>p.severity==="warn"&&!p.passed).length,r=e.length,n=r-a-t,i=a===r,o=a===0,[s,l]=ge.default.useState(n>0||t>0),c=()=>i?"All checks passed":o?"All checks failed":`Some ${r>1?"checks were":"check was"} not successful`,d=()=>i?D.jsx(W.CheckmarkFilledIcon,{color:"var(--color-success-base)"}):n>0?D.jsx(W.ErrorFilledIcon,{color:"var(--color-error-base)"}):D.jsx(W.WarningFilledIcon,{color:"var(--color-warning-base)"}),E=p=>{p.stopPropagation(),l(!s)};return!e||e.length===0?null:D.jsxs(l_u,{children:[D.jsxs(c_u,{onClick:E,children:[D.jsxs(d_u,{children:[D.jsx(E_u,{children:D.jsx(p_u,{children:d()})}),D.jsxs(m_u,{children:[D.jsx(h_u,{children:c()}),D.jsxs(x_u,{children:[a," successful",t>0&&D.jsxs(D.Fragment,{children:[", ",t," ",t===1?"warning":"warnings"]}),n>0&&D.jsxs(D.Fragment,{children:[", ",n," failed"]})]})]})]}),D.jsx(D_u,{isExpanded:s,children:s?D.jsx(W.ChevronDownIcon,{}):D.jsx(W.ChevronRightIcon,{})})]}),D.jsx(f_u,{isExpanded:s,children:e.map((p,x)=>D.jsxs(g_u,{children:[D.jsx(v_u,{children:p.passed?D.jsx(W.CheckmarkIcon,{color:"var(--color-success-base)",size:"14px"}):!p.passed&&["warn"].includes(p.severity)?D.jsx(W.WarningFilledIcon,{color:"var(--color-warning-base)",size:"14px"}):D.jsx(W.CloseOutlineIcon,{color:"var(--color-error-base)",size:"14px"})}),D.jsxs(k_u,{children:[D.jsx(b_u,{children:p.name}),p.message&&D.jsx(y_u,{children:p.message})]})]},x))})]})}const l_u=N.div`
3102
+ `))}}}async function o_u({collectionId:u,workflowId:e,projectDir:a,inputsObject:t,serversObject:r,sourceDescriptions:n,severitySettings:i}){const o=`${a}/${u}`,s=new i_u,l=t.map(E=>JSON.stringify({[E.name]:E.value})),c=s_u(r,n),{run:d}=await Promise.resolve().then(()=>require("./replay-index-BQYP1xr8.js"));return await d({files:[o],workflow:e?[e]:[],fetch:mn,logger:n_u,maxSteps:500,maxFetchTimeout:4e4,requestFileLoader:{getFileBody:async E=>{if(!await qJ(E))throw new Error(`File ${E} doesn't exist or isn't readable.`);try{const x=await dA(E),m=new TextEncoder().encode(x);return new File([m],await GJ(E))}catch(x){throw new Error(`Failed to read file ${E}: ${x}`)}}},envVariables:{},config:await VH({}),externalRefResolver:s,input:l,server:c,severity:JSON.stringify(i),skipLint:!0})}function s_u(u,e){return e.map(a=>{const t=u.find(n=>n.apiId===a.apiId);if(!t)return null;let r=t.value;if(t.variables)for(const n of t.variables){const i=new RegExp(`\\{${n.name}\\}`,"g");r=r.replace(i,n.value)}return`${a.name}=${r}`}).filter(a=>a!==null)}function DB(u){return u==null?"N/A":u<1e3?`${u} ms`:u<1e4?`${(u/1e3).toFixed(1)} s`:`${Math.round(u/1e3)} s`}function b0e({checks:u}){const e=u.filter(p=>p.severity!=="off"),a=e.filter(p=>p.passed).length,t=e.filter(p=>p.severity==="warn"&&!p.passed).length,r=e.length,n=r-a-t,i=a===r,o=a===0,[s,l]=ge.default.useState(n>0||t>0),c=()=>i?"All checks passed":o?"All checks failed":`Some ${r>1?"checks were":"check was"} not successful`,d=()=>i?D.jsx(W.CheckmarkFilledIcon,{color:"var(--color-success-base)"}):n>0?D.jsx(W.ErrorFilledIcon,{color:"var(--color-error-base)"}):D.jsx(W.WarningFilledIcon,{color:"var(--color-warning-base)"}),E=p=>{p.stopPropagation(),l(!s)};return!e||e.length===0?null:D.jsxs(l_u,{children:[D.jsxs(c_u,{onClick:E,children:[D.jsxs(d_u,{children:[D.jsx(E_u,{children:D.jsx(p_u,{children:d()})}),D.jsxs(m_u,{children:[D.jsx(h_u,{children:c()}),D.jsxs(x_u,{children:[a," successful",t>0&&D.jsxs(D.Fragment,{children:[", ",t," ",t===1?"warning":"warnings"]}),n>0&&D.jsxs(D.Fragment,{children:[", ",n," failed"]})]})]})]}),D.jsx(D_u,{isExpanded:s,children:s?D.jsx(W.ChevronDownIcon,{}):D.jsx(W.ChevronRightIcon,{})})]}),D.jsx(f_u,{isExpanded:s,children:e.map((p,x)=>D.jsxs(g_u,{children:[D.jsx(v_u,{children:p.passed?D.jsx(W.CheckmarkIcon,{color:"var(--color-success-base)",size:"14px"}):!p.passed&&["warn"].includes(p.severity)?D.jsx(W.WarningFilledIcon,{color:"var(--color-warning-base)",size:"14px"}):D.jsx(W.CloseOutlineIcon,{color:"var(--color-error-base)",size:"14px"})}),D.jsxs(k_u,{children:[D.jsx(b_u,{children:p.name}),p.message&&D.jsx(y_u,{children:p.message})]})]},x))})]})}const l_u=N.div`
3103
3103
  margin-bottom: 0;
3104
3104
  margin-top: var(--spacing-xxs);
3105
3105
  `,c_u=N.div`