@redocly/replay 0.19.0-next.0 → 0.19.0-next.1

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}`})}}}}),_H=({filePath:u})=>({Info:{leave(e,{report:a,location:t,con
219
219
  ${n.message}`,location:t.child("description")})}}}}),LH=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 IH(u){return Array.isArray(u)&&u.length===0}const Whe="x-internal",KH=({internalFlagProperty:u=Whe})=>{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&&(Pd(t)||IH(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 VH(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&&(Pd(u)||IH(u))&&delete t[r]}function GH(u,e,a){return u===void 0||e===void 0?!1:!Array.isArray(e)&&!Array.isArray(u)?u===e:(e=Nz(e),u=Nz(u),a==="any"?e.some(t=>u.includes(t)):a==="all"?e.every(t=>u.includes(t)):!1)}function Nz(u){return Array.isArray(u)?u:[u]}const Jhe="any",HH=({property:u,value:e,matchStrategy:a})=>{const t=a||Jhe,r=n=>n?.[u]&&!GH(n?.[u],e,t);return{any:{enter:(n,i)=>{VH(n,i,r)}}}},Uhe="any",qH=({property:u,value:e,matchStrategy:a})=>{const t=a||Uhe,r=n=>GH(n?.[u],e,t);return{any:{enter:(n,i)=>{VH(n,i,r)}}}},Zhe=({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=_z(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:Rz(_d(s,a.config?.configPath))}}),e.responses[n]=i)}if(r.request&&e.requestBody){const n=_z(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:Rz(_d(o,a.config?.configPath))}}),e.requestBody=n}}}}});function _z(u,e){if(!Ra(u))return u;const a=e(u);return a.error?void 0:JSON.parse(JSON.stringify(a.node))}const WH=()=>{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),Pd(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,[]),Pd(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())}}}},Qhe={"operation-description-override":RH,"tag-description-override":NH,"info-description-override":_H,"info-override":LH,"remove-x-internal":KH,"remove-unused-components":WH,"filter-in":HH,"filter-out":qH,"media-type-examples-override":Zhe},JH=()=>{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),Pd(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())}}}},Yhe={"operation-description-override":RH,"tag-description-override":NH,"info-description-override":_H,"info-override":LH,"remove-x-internal":KH,"remove-unused-components":JH,"filter-in":HH,"filter-out":qH},Xhe={},exe={},uxe={},axe={},txe={recommended:X3e,"recommended-strict":epe,minimal:ape,all:upe,spec:tpe},Lz={id:"",rules:{oas3:lhe,oas2:hhe,async2:ghe,async3:yhe,arazzo1:Vhe,overlay1:Hhe},preprocessors:{oas3:che,oas2:xhe,async2:vhe,async3:Che,arazzo1:Ghe,overlay1:qhe},decorators:{oas3:Qhe,oas2:Yhe,async2:Xhe,async3:exe,arazzo1:uxe,overlay1:axe},configs:txe};function rxe(u){return!w0(u)}function nxe(){return new Promise(u=>{setTimeout(u)})}function Ed(u,e){return u+"::"+e}class H1{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 _2 extends Error{constructor(e){super(e.message),this.originalError=e,Object.setPrototypeOf(this,_2.prototype)}}function ixe(u,e){const a=new H1(e,u);try{return{source:a,parsed:P2(u,{filename:e})}}catch(t){throw new bc(t,a)}}class Hf{constructor(e={http:{headers:[]}}){this.config=e,this.cache=new Map}getFiles(){return new Set(Array.from(this.cache.keys()))}resolveExternalRef(e,a){return Ja(a)?a:e&&Ja(e)?new URL(a,e).href:$u.resolve(e?$u.dirname(e):process.cwd(),a)}async loadExternalRef(e){try{if(Ja(e)){const{body:a,mimeType:t}=await aK(e,this.config.http);return new H1(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 H1(e,a.replace(/\r\n/g,`
220
220
  `))}}catch(a){throw a.message=a.message.replace(", lstat",""),new _2(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:P2(e.body,{filename:e.absoluteRef})}}catch(r){throw new bc(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 Iz(u,e){return{prev:u,node:e}}function oxe(u,e){for(;u;){if(u.node===e)return!0;u=u.prev}return!1}const l4={name:"unknown",properties:{}},sxe={name:"scalar",properties:{}};async function Ld(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!==l4&&f!==Ps)return;const B=typeof C=="function";for(let z=0;z<h.length;z++){let P=B?C(h[z],t1(k,z)):C;if(P===void 0&&f!==l4&&f!==Ps)continue;const L=P?.directResolveAs?{$ref:h[z]}:h[z];P=P?.directResolveAs||P,m(L,js(P)?P:l4,t1(k,z))}return}for(const C of Object.keys(h)){let B=h[C],z=Bo(f.properties,C);z===void 0&&(z=f.additionalProperties),typeof z=="function"&&(z=z(B,C)),z===void 0&&(z=l4),f.extensionsPrefix&&C.startsWith(f.extensionsPrefix)&&z===l4&&(z=Ps),!js(z)&&z?.directResolveAs&&(z=z.directResolveAs,B={$ref:B}),z&&z.name===void 0&&z.resolvable!==!1&&(z=sxe),!(!js(z)||typeof B!="object")&&m(B,z,t1(k,cd(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(tK(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(oxe(k.prev,f))throw new Error("Self-referencing circular pointer");if(nie(f.$ref)){await nxe();const I={resolved:!0,isRemote:!1,node:x.get(f.$ref),document:h,nodePointer:f.$ref},G=Ed(h.source.absoluteRef,f.$ref);return r.set(G,I),I}const{uri:y,pointer:v}=aie(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=Ed(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=t1(B.nodePointer,cd(I));else if(Ra(z)){if(B=await g(C,z,Iz(k,z)),C=B.document||C,typeof B.node!="object"){z=void 0;break}z=B.node[I],B.nodePointer=t1(B.nodePointer,cd(I))}else{z=void 0;break}B.node=z,B.document=C;const L=Ed(h.source.absoluteRef,f.$ref);return B.document&&Ra(z)&&(B=await g(B.document,z,Iz(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 va(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 lxe(u){if(u.indexOf("/")>-1){const[e,a]=u.split("/");return{pluginId:e,configName:a}}else return{pluginId:"",configName:u}}function Ya(u,e){if(!e)return u;const a={};for(const t of Object.keys(u))a[`${e}/${t}`]=u[t];return a}function UH(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),va(e.oas2Rules,a.rules),ta(e.oas3_0Rules,a.oas3_0Rules),va(e.oas3_0Rules,a.rules),ta(e.oas3_1Rules,a.oas3_1Rules),va(e.oas3_1Rules,a.rules),ta(e.oas3_2Rules,a.oas3_2Rules),va(e.oas3_2Rules,a.rules),ta(e.async2Rules,a.async2Rules),va(e.async2Rules,a.rules),ta(e.async3Rules,a.async3Rules),va(e.async3Rules,a.rules),ta(e.arazzo1Rules,a.arazzo1Rules),va(e.arazzo1Rules,a.rules),ta(e.overlay1Rules,a.overlay1Rules),va(e.overlay1Rules,a.rules),ta(e.preprocessors,a.preprocessors),ta(e.oas2Preprocessors,a.oas2Preprocessors),va(e.oas2Preprocessors,a.preprocessors),ta(e.oas3_0Preprocessors,a.oas3_0Preprocessors),va(e.oas3_0Preprocessors,a.preprocessors),ta(e.oas3_1Preprocessors,a.oas3_1Preprocessors),va(e.oas3_1Preprocessors,a.preprocessors),ta(e.oas3_2Preprocessors,a.oas3_2Preprocessors),va(e.oas3_2Preprocessors,a.preprocessors),ta(e.async2Preprocessors,a.async2Preprocessors),va(e.async2Preprocessors,a.preprocessors),ta(e.async3Preprocessors,a.async3Preprocessors),va(e.async3Preprocessors,a.preprocessors),ta(e.arazzo1Preprocessors,a.arazzo1Preprocessors),va(e.arazzo1Preprocessors,a.preprocessors),ta(e.overlay1Preprocessors,a.overlay1Preprocessors),va(e.overlay1Preprocessors,a.preprocessors),ta(e.decorators,a.decorators),ta(e.oas2Decorators,a.oas2Decorators),va(e.oas2Decorators,a.decorators),ta(e.oas3_0Decorators,a.oas3_0Decorators),va(e.oas3_0Decorators,a.decorators),ta(e.oas3_1Decorators,a.oas3_1Decorators),va(e.oas3_1Decorators,a.decorators),ta(e.oas3_2Decorators,a.oas3_2Decorators),va(e.oas3_2Decorators,a.decorators),ta(e.async2Decorators,a.async2Decorators),va(e.async2Decorators,a.decorators),ta(e.async3Decorators,a.async3Decorators),va(e.async3Decorators,a.decorators),ta(e.arazzo1Decorators,a.arazzo1Decorators),va(e.arazzo1Decorators,a.decorators),ta(e.overlay1Decorators,a.overlay1Decorators),va(e.overlay1Decorators,a.decorators)}return e}function cxe(u){return new Map(JSON.parse(JSON.stringify([...u])))}function Kz(u){return u!==void 0&&typeof u=="object"&&"id"in u}function dxe(u){return typeof u=="function"}function Vz(u,e){return{prev:u,value:e}}function Gz(u){return u?.prev??null}function Exe(u){const e={};for(;u.parent;)e[u.parent.type.name]=u.parent.activatedOn?.value.node,u=u.parent;return e}function pxe(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 q1(u){const{document:e,rootType:a,normalizedVisitors:t,resolvedRefMap:r,ctx:n}=u,i={},o=new Set;s(e.parsed,a,new px(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=Ed(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 px(X.source,U):ae instanceof bc?new px(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=Vz(U.activatedOn,T);let V=U.parent;for(;V;)V.activatedOn.value.nextLevelTypeActivated=Vz(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}),js(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=Bo(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=Ps),!js(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}!js(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=Gz(U.activatedOn),U.parent){let ae=U.parent;for(;ae;)ae.activatedOn.value.nextLevelTypeActivated=Gz(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:pxe(L),specVersion:n.specVersion,config:n.config,ignoreNextVisitorsOnNode:()=>{o.add(`${g.absolutePointer}${g.pointer}`)},getVisitorData:C.bind(void 0,I)},Exe(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 mxe={Root:"DefinitionRoot",ServerVariablesMap:"ServerVariableMap",Paths:["PathMap","PathsMap"],CallbacksMap:"CallbackMap",MediaTypesMap:"MediaTypeMap",ExamplesMap:"ExampleMap",EncodingMap:"EncodingsMap",HeadersMap:"HeaderMap",LinksMap:"LinkMap",OAuth2Flows:"SecuritySchemeFlows",Responses:"ResponsesMap"};function W1(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(Ps);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,mxe[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 ZH({node:u,ctx:e,plugins:a}){if(!u.extends)return u;const t=(u.extends||[]).map(r=>{if(!Ja(r)&&!Ls.extname(r))return Cxe(r,a);const n=e.resolve({$ref:r});return n.location&&n.node!==void 0?n.node:null}).filter(q0);return UH([...t.map(r=>ZH({node:r,ctx:e,plugins:a})),{...u,extends:void 0}])}function em(u,e){if(Du(u)&&Array.isArray(u.plugins)){const{plugins:a,rootConfigDir:t}=e.getVisitorData();a.push(...u.plugins.map(r=>YH(r,e.location.source.absoluteRef.replace(/^file:\/\//,""),t)))}}const hxe=W1([{severity:"error",ruleId:YG,visitor:{ref:{},ConfigGovernance:{leave(u,e){em(u,e)}},ConfigApisProperties:{leave(u,e){em(u,e)}},"rootRedoclyConfigSchema.scorecard.levels_items":{leave(u,e){em(u,e)}},ConfigRoot:{leave(u,e){em(u,e)}}}}],SE);function um(u,e){if(Du(u)&&u.extends){const{plugins:a}=e.getVisitorData(),t=ZH({node:u,ctx:e,plugins:a});Object.assign(u,t),delete u.extends}}const xxe=W1([{severity:"error",ruleId:QG,visitor:{ref:{leave(u,e,a){ey(u,a,e)}},ConfigGovernance:{leave(u,e){um(u,e)}},ConfigApisProperties:{leave(u,e){um(u,e)}},"rootRedoclyConfigSchema.scorecard.levels_items":{leave(u,e){um(u,e)}},ConfigRoot:{leave(u,e){um(u,e)}}}}],SE);function Hz(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 Dxe(u,e,a,t,r){let n,i;const o={ref:{leave(E,p,x){if(!x.location||x.node===void 0){dd(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&&Ja(E.$ref))return;const m=Hz(p.type.name,u);m?e?(l(m,x,p),ey(E,x,p)):(E.$ref=l(m,x,p),s(E,x,p)):ey(E,x,p)}},Example:{leave(E,p){if(tK(E)&&E.value===void 0){const x=p.resolve({$ref:E.externalValue});if(!x.location||x.node===void 0){dd(x,p.report,p.location);return}if(r&&Ja(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){dd(g,p.report,p.location.child(x));return}const h=Hz("Schema",u);E[x]=l(h,g,p)}}});function s(E,p,x){const m=Ed(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:Yb(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(q0);for(;k.length>0;)if(f=k.pop()+(f?`-${f}`:""),!h||!h[f]||c(h[f],E,x))return f;if(f=rie(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 fxe(u){const{document:e,config:a,types:t,externalRefResolver:r,dereference:n=!1,removeUnusedComponents:i=!1,keepUrlRefs:o=!1}=u,s=Tf(e.parsed),l=UG(s),c=a.getRulesForSpecVersion(l),d=m2(a.extendTypes(t,s),a),E=B5(c,a,"preprocessors",s),p=B5(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"?JH():WH()});let m=await Ld({rootDocument:e,rootType:d.Root,externalRefResolver:r});E.length>0&&(q1({document:e,rootType:d.Root,normalizedVisitors:W1(E,d),resolvedRefMap:m,ctx:x}),m=await Ld({rootDocument:e,rootType:d.Root,externalRefResolver:r}));const g=W1([{severity:"error",ruleId:"bundler",visitor:Dxe(l,n,e,m,o)},...p],d);return q1({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 gxe(u,e,a){const t={plugins:[],rootConfigDir:a},r={problems:[],specVersion:"oas3_0",refTypes:new Map,visitorsData:{[YG]:t}};return q1({document:u,rootType:SE.ConfigRoot,normalizedVisitors:hxe,resolvedRefMap:e,ctx:r}),t.plugins}function vxe(u,e,a){const t={plugins:a},r={problems:[],specVersion:"oas3_0",refTypes:new Map,visitorsData:{[QG]:t}};return q1({document:u,rootType:SE.ConfigRoot,normalizedVisitors:xxe,resolvedRefMap:e,ctx:r}),u.parsed??{}}async function QH(u){const{ref:e,doc:a,externalRefResolver:t=new Hf(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),fxe({document:n,...u,externalRefResolver:t,types:v2(Tf(n.parsed))})}const H6=new Map;async function kxe({rawConfigDocument:u,configPath:e,externalRefResolver:a,customExtends:t}){const r=u===void 0?U3e:u.parsed;if(t!==void 0&&Du(r)&&(r.extends=t),Du(r)&&r?.extends?.some(rxe))throw new Error("Configuration format not detected in extends: values must be strings.");const n=u??{source:new H1(e??"",JSON.stringify(r)),parsed:r},i=await Ld({rootDocument:n,rootType:SE.ConfigRoot,externalRefResolver:a??new Hf(ZG(r?.resolve))});let o=[],s,l="";Xa?s=[...(r?.plugins||[]).filter(p=>!w0(p)),Lz]:(l=$u.dirname(e??""),o=gxe(n,i,l),s=[...await yxe(o.map(p=>qz(p)?p.absolutePath:p),l),Lz]);const c=vxe(n,cxe(i),s);c.apis&&(c.apis=Object.fromEntries(Object.entries(c.apis).map(([E,p])=>{const x=UH([c,p]);return[E,{...p,...x}]})));const d=o.length?o.map(E=>qz(E)&&E.isModule?E.rawPath:E.absolutePath&&$u.relative(l,E.absolutePath)).filter(A5):void 0;return{resolvedConfig:{...c,plugins:d},resolvedRefMap:i,plugins:s}}function bxe(u){for(const e of Q3e)(void 0)($u.resolve(u,e))}function qz(u){return"isModule"in u}const YH=(u,e,a)=>{if(!w0(u))return u;const t=$u.resolve($u.dirname(e),u);return(void 0)(t)?{absolutePath:t,rawPath:u,isModule:!1}:{absolutePath:QI.createRequire((typeof document>"u"?require("url").pathToFileURL(__filename).href:_n&&_n.tagName.toUpperCase()==="SCRIPT"&&_n.src||new URL("replay-index-Bh96AjPW.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-Bh96AjPW.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-Bh96AjPW.js",document.baseURI).href)):__dirname]}),isModule:!0,rawPath:u}};async function yxe(u,e){if(!u)return[];const a=async o=>{if(!w0(o))return o;try{const s=$u.isAbsolute(o)?o:YH(o,$u.join(e,J3e),e).absolutePath;if(!H6.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&&Kz(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),fxe({document:n,...u,externalRefResolver:t,types:v2(Tf(n.parsed))})}const H6=new Map;async function kxe({rawConfigDocument:u,configPath:e,externalRefResolver:a,customExtends:t}){const r=u===void 0?U3e:u.parsed;if(t!==void 0&&Du(r)&&(r.extends=t),Du(r)&&r?.extends?.some(rxe))throw new Error("Configuration format not detected in extends: values must be strings.");const n=u??{source:new H1(e??"",JSON.stringify(r)),parsed:r},i=await Ld({rootDocument:n,rootType:SE.ConfigRoot,externalRefResolver:a??new Hf(ZG(r?.resolve))});let o=[],s,l="";Xa?s=[...(r?.plugins||[]).filter(p=>!w0(p)),Lz]:(l=$u.dirname(e??""),o=gxe(n,i,l),s=[...await yxe(o.map(p=>qz(p)?p.absolutePath:p),l),Lz]);const c=vxe(n,cxe(i),s);c.apis&&(c.apis=Object.fromEntries(Object.entries(c.apis).map(([E,p])=>{const x=UH([c,p]);return[E,{...p,...x}]})));const d=o.length?o.map(E=>qz(E)&&E.isModule?E.rawPath:E.absolutePath&&$u.relative(l,E.absolutePath)).filter(A5):void 0;return{resolvedConfig:{...c,plugins:d},resolvedRefMap:i,plugins:s}}function bxe(u){for(const e of Q3e)(void 0)($u.resolve(u,e))}function qz(u){return"isModule"in u}const YH=(u,e,a)=>{if(!w0(u))return u;const t=$u.resolve($u.dirname(e),u);return(void 0)(t)?{absolutePath:t,rawPath:u,isModule:!1}:{absolutePath:QI.createRequire((typeof document>"u"?require("url").pathToFileURL(__filename).href:_n&&_n.tagName.toUpperCase()==="SCRIPT"&&_n.src||new URL("replay-index-B8c5mEG6.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-B8c5mEG6.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-B8c5mEG6.js",document.baseURI).href)):__dirname]}),isModule:!0,rawPath:u}};async function yxe(u,e){if(!u)return[];const a=async o=>{if(!w0(o))return o;try{const s=$u.isAbsolute(o)?o:YH(o,$u.join(e,J3e),e).absolutePath;if(!H6.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&&Kz(x)&&na.info(`Deprecated plugin format detected: ${x.id}
223
223
  `);const E=Kz(l)?l:dxe(l)?await l(c):await l?.default?.(c),p=Array.isArray(E)?E:[E];E&&H6.set(s,p.map(x=>({...x,path:o,absolutePath:s})))}return H6.get(s)}catch(s){throw new Error(`Failed to load plugin "${o}": ${s.message}
224
224
 
225
225
  ${s.stack}`)}},t=new Map,r=bxe(e);r&&u.push(r);const n=new Set;return(await Promise.all(u.map(async o=>{if(w0(o)){if(Ja(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=Ya(c.rules.oas3,d)),c.rules.oas2&&(x.rules.oas2=Ya(c.rules.oas2,d)),c.rules.async2&&(x.rules.async2=Ya(c.rules.async2,d)),c.rules.async3&&(x.rules.async3=Ya(c.rules.async3,d)),c.rules.arazzo1&&(x.rules.arazzo1=Ya(c.rules.arazzo1,d)),c.rules.overlay1&&(x.rules.overlay1=Ya(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=Ya(c.preprocessors.oas3,d)),c.preprocessors.oas2&&(x.preprocessors.oas2=Ya(c.preprocessors.oas2,d)),c.preprocessors.async2&&(x.preprocessors.async2=Ya(c.preprocessors.async2,d)),c.preprocessors.async3&&(x.preprocessors.async3=Ya(c.preprocessors.async3,d)),c.preprocessors.arazzo1&&(x.preprocessors.arazzo1=Ya(c.preprocessors.arazzo1,d)),c.preprocessors.overlay1&&(x.preprocessors.overlay1=Ya(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=Ya(c.decorators.oas3,d)),c.decorators.oas2&&(x.decorators.oas2=Ya(c.decorators.oas2,d)),c.decorators.async2&&(x.decorators.async2=Ya(c.decorators.async2,d)),c.decorators.async3&&(x.decorators.async3=Ya(c.decorators.async3,d)),c.decorators.arazzo1&&(x.decorators.arazzo1=Ya(c.decorators.arazzo1,d)),c.decorators.overlay1&&(x.decorators.overlay1=Ya(c.decorators.overlay1,d))}return c.assertions&&(x.assertions=c.assertions),{...c,...x}}))).filter(A5)}))).filter(A5).flat()}function Cxe(u,e){const{pluginId:a,configName:t}=lxe(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 XH(u,{configPath:e,externalRefResolver:a}={}){const r=ixe(typeof u=="string"?u:"",e??"");typeof u!="string"&&u&&(r.parsed=u);const{resolvedConfig:n,resolvedRefMap:i,plugins:o}=await kxe({rawConfigDocument:Fxe(r),configPath:e,externalRefResolver:a});return new $f(n,{configPath:e,document:r,resolvedRefMap:i,plugins:o})}function Fxe(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 q6={},Er={},W6={},Wz;function qf(){return Wz||(Wz=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})(W6)),W6}var Un={},Jz;function Cc(){if(Jz)return Un;Jz=1,Object.defineProperty(Un,"__esModule",{value:!0});function u(i){return typeof i>"u"||i===null}Un.isNothing=u;function e(i){return typeof i=="object"&&i!==null}Un.isObject=e;function a(i){return Array.isArray(i)?i:u(i)?[]:[i]}Un.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}Un.extend=t;function r(i,o){var s="",l;for(l=0;l<o;l+=1)s+=i;return s}Un.repeat=r;function n(i){return i===0&&Number.NEGATIVE_INFINITY===1/i}return Un.isNegativeZero=n,Un}var J6,Uz;function jE(){if(Uz)return J6;Uz=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 J6=u,J6}var U6,Zz;function Axe(){if(Zz)return U6;Zz=1;var u=Cc(),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 iA({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(hJ,{variable:u,onSave:i,onCancel:a,...t,children:D.jsx(qd,{children:D.jsx(mJ,{value:r,onChange:o=>n(o),title:"Make it secret"})})})}const Ry=()=>({name:"",value:"",isSecret:!1}),ka=u=>ZI+"$inputs."+u+p2,V1u=(u,e)=>e.inputs.find(a=>a.get().name===u.match(`^${Ff}$`)?.[1]);function G1u({environments:u,activeEnvironmentId:e}){return u.get().find(t=>t.name===e.get())?.inputs||[]}function Ui(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 oA(u){const e=/^\{?\$inputs\.([^\}\s]+)\}?$/,a=u.match(e);return a?a[1]:null}function vx(u){var e=new Error(u);return e.source="ulid",e}var sA="0123456789ABCDEFGHJKMNPQRSTVWXYZ",md=sA.length,wj=Math.pow(2,48)-1,H1u=10,q1u=16;function W1u(u){var e=Math.floor(u()*md);return e===md&&(e=md-1),sA.charAt(e)}function J1u(u,e){if(isNaN(u))throw new Error(u+" must be a number");if(u>wj)throw vx("cannot encode time greater than "+wj);if(u<0)throw vx("time must be positive");if(Number.isInteger(u)===!1)throw vx("time must be an integer");for(var a=void 0,t="";e>0;e--)a=u%md,t=sA.charAt(a)+t,u=(u-a)/md;return t}function U1u(u,e){for(var a="";u>0;u--)a=W1u(e)+a;return a}function Z1u(){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 vx("secure crypto unusable, insecure Math.random not allowed")}function Q1u(u){return u||(u=Z1u()),function(a){return isNaN(a)&&(a=Date.now()),J1u(a,H1u)+U1u(q1u,u)}}var W5=Q1u(),Y1u=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{},Ss="1.9.0",Oj=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function X1u(u){var e=new Set([u]),a=new Set,t=u.match(Oj);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(Oj);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 ecu=X1u(Ss),ucu=Ss.split(".")[0],Wd=Symbol.for("opentelemetry.js.api."+ucu),Jd=Y1u;function NE(u,e,a,t){var r;t===void 0&&(t=!1);var n=Jd[Wd]=(r=Jd[Wd])!==null&&r!==void 0?r:{version:Ss};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!==Ss){var i=new Error("@opentelemetry/api: Registration of version v"+n.version+" for "+u+" does not match previously registered API v"+Ss);return a.error(i.stack||i.message),!1}return n[u]=e,a.debug("@opentelemetry/api: Registered a global for "+u+" v"+Ss+"."),!0}function Ks(u){var e,a,t=(e=Jd[Wd])===null||e===void 0?void 0:e.version;if(!(!t||!ecu(t)))return(a=Jd[Wd])===null||a===void 0?void 0:a[u]}function _E(u,e){e.debug("@opentelemetry/api: Unregistering a global for "+u+" v"+Ss+".");var a=Jd[Wd];a&&delete a[u]}var acu=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},tcu=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))},rcu=(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 y4("debug",this._namespace,e)},u.prototype.error=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];return y4("error",this._namespace,e)},u.prototype.info=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];return y4("info",this._namespace,e)},u.prototype.warn=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];return y4("warn",this._namespace,e)},u.prototype.verbose=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];return y4("verbose",this._namespace,e)},u})();function y4(u,e,a){var t=Ks("diag");if(t)return a.unshift(e),t[u].apply(t,tcu([],acu(a),!1))}var B0;(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"})(B0||(B0={}));function ncu(u,e){u<B0.NONE?u=B0.NONE:u>B0.ALL&&(u=B0.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",B0.ERROR),warn:a("warn",B0.WARN),info:a("info",B0.INFO),debug:a("debug",B0.DEBUG),verbose:a("verbose",B0.VERBOSE)}}var icu=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},ocu=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))},scu="diag",kn=(function(){function u(){function e(r){return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var o=Ks("diag");if(o)return o[r].apply(o,ocu([],icu(n),!1))}}var a=this,t=function(r,n){var i,o,s;if(n===void 0&&(n={logLevel:B0.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=Ks("diag"),d=ncu((o=n.logLevel)!==null&&o!==void 0?o:B0.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 NE("diag",d,a,!0)};a.setLogger=t,a.disable=function(){_E(scu,a)},a.createComponentLogger=function(r){return new rcu(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})(),lcu=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},ccu=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.")},dcu=(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=lcu(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=ccu(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})(),Ecu=Symbol("BaggageEntryMetadata"),pcu=kn.instance();function mcu(u){return u===void 0&&(u={}),new dcu(new Map(Object.entries(u)))}function hcu(u){return typeof u!="string"&&(pcu.error("Cannot create baggage metadata from unknown type: "+typeof u),u=""),{__TYPE__:Ecu,toString:function(){return u}}}function lA(u){return Symbol.for(u)}var xcu=(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})(),o1=new xcu,rl=(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)}})(),Dcu=(function(){function u(){}return u.prototype.createGauge=function(e,a){return Bcu},u.prototype.createHistogram=function(e,a){return Scu},u.prototype.createCounter=function(e,a){return Acu},u.prototype.createUpDownCounter=function(e,a){return zcu},u.prototype.createObservableGauge=function(e,a){return Ocu},u.prototype.createObservableCounter=function(e,a){return wcu},u.prototype.createObservableUpDownCounter=function(e,a){return Pcu},u.prototype.addBatchObservableCallback=function(e,a){},u.prototype.removeBatchObservableCallback=function(e){},u})(),ig=(function(){function u(){}return u})(),fcu=(function(u){rl(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e.prototype.add=function(a,t){},e})(ig),gcu=(function(u){rl(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e.prototype.add=function(a,t){},e})(ig),vcu=(function(u){rl(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e.prototype.record=function(a,t){},e})(ig),kcu=(function(u){rl(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e.prototype.record=function(a,t){},e})(ig),cA=(function(){function u(){}return u.prototype.addCallback=function(e){},u.prototype.removeCallback=function(e){},u})(),bcu=(function(u){rl(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e})(cA),ycu=(function(u){rl(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e})(cA),Ccu=(function(u){rl(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e})(cA),Fcu=new Dcu,Acu=new fcu,Bcu=new vcu,Scu=new kcu,zcu=new gcu,wcu=new bcu,Ocu=new ycu,Pcu=new Ccu,jcu={get:function(u,e){if(u!=null)return u[e]},keys:function(u){return u==null?[]:Object.keys(u)}},Mcu={set:function(u,e,a){u!=null&&(u[e]=a)}},Tcu=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},$cu=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))},Rcu=(function(){function u(){}return u.prototype.active=function(){return o1},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,$cu([t],Tcu(r),!1))},u.prototype.bind=function(e,a){return a},u.prototype.enable=function(){return this},u.prototype.disable=function(){return this},u})(),Ncu=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},_cu=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))},ak="context",Lcu=new Rcu,og=(function(){function u(){}return u.getInstance=function(){return this._instance||(this._instance=new u),this._instance},u.prototype.setGlobalContextManager=function(e){return NE(ak,e,kn.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,_cu([e,a,t],Ncu(n),!1))},u.prototype.bind=function(e,a){return this._getContextManager().bind(e,a)},u.prototype._getContextManager=function(){return Ks(ak)||Lcu},u.prototype.disable=function(){this._getContextManager().disable(),_E(ak,kn.instance())},u})(),yi;(function(u){u[u.NONE=0]="NONE",u[u.SAMPLED=1]="SAMPLED"})(yi||(yi={}));var xJ="0000000000000000",DJ="00000000000000000000000000000000",fJ={traceId:DJ,spanId:xJ,traceFlags:yi.NONE},hd=(function(){function u(e){e===void 0&&(e=fJ),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})(),dA=lA("OpenTelemetry Context Key SPAN");function EA(u){return u.getValue(dA)||void 0}function Icu(){return EA(og.getInstance().active())}function pA(u,e){return u.setValue(dA,e)}function Kcu(u){return u.deleteValue(dA)}function Vcu(u,e){return pA(u,new hd(e))}function gJ(u){var e;return(e=EA(u))===null||e===void 0?void 0:e.spanContext()}var Gcu=/^([0-9a-f]{32})$/i,Hcu=/^[0-9a-f]{16}$/i;function vJ(u){return Gcu.test(u)&&u!==DJ}function qcu(u){return Hcu.test(u)&&u!==xJ}function sg(u){return vJ(u.traceId)&&qcu(u.spanId)}function Wcu(u){return new hd(u)}var tk=og.getInstance(),kJ=(function(){function u(){}return u.prototype.startSpan=function(e,a,t){t===void 0&&(t=tk.active());var r=!!a?.root;if(r)return new hd;var n=t&&gJ(t);return Jcu(n)&&sg(n)?new hd(n):new hd},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??tk.active(),l=this.startSpan(e,n,s),c=pA(s,l);return tk.with(c,o,void 0,l)}},u})();function Jcu(u){return typeof u=="object"&&typeof u.spanId=="string"&&typeof u.traceId=="string"&&typeof u.traceFlags=="number"}var Ucu=new kJ,Zcu=(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):Ucu},u})(),Qcu=(function(){function u(){}return u.prototype.getTracer=function(e,a,t){return new kJ},u})(),Ycu=new Qcu,Pj=(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 Zcu(this,e,a,t)},u.prototype.getDelegate=function(){var e;return(e=this._delegate)!==null&&e!==void 0?e:Ycu},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})(),J5;(function(u){u[u.NOT_RECORD=0]="NOT_RECORD",u[u.RECORD=1]="RECORD",u[u.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(J5||(J5={}));var Ny;(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"})(Ny||(Ny={}));var Ud;(function(u){u[u.UNSET=0]="UNSET",u[u.OK=1]="OK",u[u.ERROR=2]="ERROR"})(Ud||(Ud={}));var Ei=og.getInstance(),Iu=kn.instance(),Xcu=(function(){function u(){}return u.prototype.getMeter=function(e,a,t){return Fcu},u})(),e4u=new Xcu,rk="metrics",u4u=(function(){function u(){}return u.getInstance=function(){return this._instance||(this._instance=new u),this._instance},u.prototype.setGlobalMeterProvider=function(e){return NE(rk,e,kn.instance())},u.prototype.getMeterProvider=function(){return Ks(rk)||e4u},u.prototype.getMeter=function(e,a,t){return this.getMeterProvider().getMeter(e,a,t)},u.prototype.disable=function(){_E(rk,kn.instance())},u})(),bJ=u4u.getInstance(),a4u=(function(){function u(){}return u.prototype.inject=function(e,a){},u.prototype.extract=function(e,a){return e},u.prototype.fields=function(){return[]},u})(),mA=lA("OpenTelemetry Baggage Key");function yJ(u){return u.getValue(mA)||void 0}function t4u(){return yJ(og.getInstance().active())}function r4u(u,e){return u.setValue(mA,e)}function n4u(u){return u.deleteValue(mA)}var nk="propagation",i4u=new a4u,o4u=(function(){function u(){this.createBaggage=mcu,this.getBaggage=yJ,this.getActiveBaggage=t4u,this.setBaggage=r4u,this.deleteBaggage=n4u}return u.getInstance=function(){return this._instance||(this._instance=new u),this._instance},u.prototype.setGlobalPropagator=function(e){return NE(nk,e,kn.instance())},u.prototype.inject=function(e,a,t){return t===void 0&&(t=Mcu),this._getGlobalPropagator().inject(e,a,t)},u.prototype.extract=function(e,a,t){return t===void 0&&(t=jcu),this._getGlobalPropagator().extract(e,a,t)},u.prototype.fields=function(){return this._getGlobalPropagator().fields()},u.prototype.disable=function(){_E(nk,kn.instance())},u.prototype._getGlobalPropagator=function(){return Ks(nk)||i4u},u})(),xd=o4u.getInstance(),ik="trace",s4u=(function(){function u(){this._proxyTracerProvider=new Pj,this.wrapSpanContext=Wcu,this.isSpanContextValid=sg,this.deleteSpan=Kcu,this.getSpan=EA,this.getActiveSpan=Icu,this.getSpanContext=gJ,this.setSpan=pA,this.setSpanContext=Vcu}return u.getInstance=function(){return this._instance||(this._instance=new u),this._instance},u.prototype.setGlobalTracerProvider=function(e){var a=NE(ik,this._proxyTracerProvider,kn.instance());return a&&this._proxyTracerProvider.setDelegate(e),a},u.prototype.getTracerProvider=function(){return Ks(ik)||this._proxyTracerProvider},u.prototype.getTracer=function(e,a){return this.getTracerProvider().getTracer(e,a)},u.prototype.disable=function(){_E(ik,kn.instance()),this._proxyTracerProvider=new Pj},u})(),s0=s4u.getInstance();const CJ=lA("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function l4u(u){return u.setValue(CJ,!0)}function hA(u){return u.getValue(CJ)===!0}const c4u="=",_y=";",Ly=",",ok="baggage",d4u=180,E4u=4096,p4u=8192;function m4u(u){return u.reduce((e,a)=>{const t=`${e}${e!==""?Ly:""}${a}`;return t.length>p4u?e:t},"")}function h4u(u){return u.getAllEntries().map(([e,a])=>{let t=`${encodeURIComponent(e)}=${encodeURIComponent(a.value)}`;return a.metadata!==void 0&&(t+=_y+a.metadata.toString()),t})}function x4u(u){const e=u.split(_y);if(e.length<=0)return;const a=e.shift();if(!a)return;const t=a.indexOf(c4u);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=hcu(e.join(_y))),{key:r,value:n,metadata:i}}class D4u{inject(e,a,t){const r=xd.getBaggage(e);if(!r||hA(e))return;const n=h4u(r).filter(o=>o.length<=E4u).slice(0,d4u),i=m4u(n);i.length>0&&t.set(a,ok,i)}extract(e,a,t){const r=t.get(a,ok),n=Array.isArray(r)?r.join(Ly):r;if(!n)return e;const i={};return n.length===0||(n.split(Ly).forEach(s=>{const l=x4u(s);if(l){const c={value:l.value};l.metadata&&(c.metadata=l.metadata),i[l.key]=c}}),Object.entries(i).length===0)?e:xd.setBaggage(e,xd.createBaggage(i))}fields(){return[ok]}}function kx(u){const e={};if(typeof u!="object"||u==null)return e;for(const[a,t]of Object.entries(u)){if(!f4u(a)){Iu.warn(`Invalid attribute key: ${a}`);continue}if(!FJ(t)){Iu.warn(`Invalid attribute value set for key: ${a}`);continue}Array.isArray(t)?e[a]=t.slice():e[a]=t}return e}function f4u(u){return typeof u=="string"&&u.length>0}function FJ(u){return u==null?!0:Array.isArray(u)?g4u(u):AJ(u)}function g4u(u){let e;for(const a of u)if(a!=null){if(!e){if(AJ(a)){e=typeof a;continue}return!1}if(typeof a!==e)return!1}return!0}function AJ(u){switch(typeof u){case"number":case"boolean":case"string":return!0}return!1}function v4u(){return u=>{Iu.error(k4u(u))}}function k4u(u){return typeof u=="string"?u:JSON.stringify(b4u(u))}function b4u(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 y4u=v4u();function Z1(u){try{y4u(u)}catch{}}const A1=performance,C4u="2.0.1",sk="exception.message",F4u="exception.stacktrace",lk="exception.type",BJ="service.name",A4u="service.version",Iy="telemetry.sdk.language",B4u="webjs",Ky="telemetry.sdk.name",Vy="telemetry.sdk.version",S4u="process.runtime.name",ck={[Ky]:"opentelemetry",[S4u]:"browser",[Iy]:B4u,[Vy]:C4u};const z4u=9,w4u=6,O4u=Math.pow(10,w4u),U5=Math.pow(10,z4u);function x1(u){const e=u/1e3,a=Math.trunc(e),t=Math.round(u%1e3*O4u);return[a,t]}function SJ(){let u=A1.timeOrigin;if(typeof u!="number"){const e=A1;u=e.timing&&e.timing.fetchStart}return u}function P4u(u){const e=x1(SJ()),a=x1(typeof u=="number"?u:A1.now());return wJ(e,a)}function j4u(u,e){let a=e[0]-u[0],t=e[1]-u[1];return t<0&&(a-=1,t+=U5),[a,t]}function M4u(u){return u[0]*U5+u[1]}function zJ(u){return Array.isArray(u)&&u.length===2&&typeof u[0]=="number"&&typeof u[1]=="number"}function jj(u){return zJ(u)||typeof u=="number"||u instanceof Date}function wJ(u,e){const a=[u[0]+e[0],u[1]+e[1]];return a[1]>=U5&&(a[1]-=U5,a[0]+=1),a}var Yr;(function(u){u[u.SUCCESS=0]="SUCCESS",u[u.FAILED=1]="FAILED"})(Yr||(Yr={}));class T4u{_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){Iu.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){Iu.warn(`Failed to extract with ${n.constructor.name}. Err: ${i.message}`)}return r},e)}fields(){return this._fields.slice()}}const Gy="[_0-9a-z-*/]",$4u=`[a-z]${Gy}{0,255}`,R4u=`[a-z0-9]${Gy}{0,240}@[a-z]${Gy}{0,13}`,N4u=new RegExp(`^(?:${$4u}|${R4u})$`),_4u=/^[ -~]{0,255}[!-~]$/,L4u=/,|=/;function I4u(u){return N4u.test(u)}function K4u(u){return _4u.test(u)&&!L4u.test(u)}const Mj=32,V4u=512,Tj=",",$j="=";class xA{_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+$j+this.get(a)),e),[]).join(Tj)}_parse(e){e.length>V4u||(this._internalState=e.split(Tj).reverse().reduce((a,t)=>{const r=t.trim(),n=r.indexOf($j);if(n!==-1){const i=r.slice(0,n),o=r.slice(n+1,t.length);I4u(i)&&K4u(o)&&a.set(i,o)}return a},new Map),this._internalState.size>Mj&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,Mj))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){const e=new xA;return e._internalState=new Map(this._internalState),e}}const dk="traceparent",Ek="tracestate",G4u="00",H4u="(?!ff)[\\da-f]{2}",q4u="(?![0]{32})[\\da-f]{32}",W4u="(?![0]{16})[\\da-f]{16}",J4u="[\\da-f]{2}",U4u=new RegExp(`^\\s?(${H4u})-(${q4u})-(${W4u})-(${J4u})(-.*)?\\s?$`);function Z4u(u){const e=U4u.exec(u);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}class Q4u{inject(e,a,t){const r=s0.getSpanContext(e);if(!r||hA(e)||!sg(r))return;const n=`${G4u}-${r.traceId}-${r.spanId}-0${Number(r.traceFlags||yi.NONE).toString(16)}`;t.set(a,dk,n),r.traceState&&t.set(a,Ek,r.traceState.serialize())}extract(e,a,t){const r=t.get(a,dk);if(!r)return e;const n=Array.isArray(r)?r[0]:r;if(typeof n!="string")return e;const i=Z4u(n);if(!i)return e;i.isRemote=!0;const o=t.get(a,Ek);if(o){const s=Array.isArray(o)?o.join(","):o;i.traceState=new xA(typeof s=="string"?s:void 0)}return s0.setSpanContext(e,i)}fields(){return[dk,Ek]}}const Y4u="[object Object]",X4u="[object Null]",edu="[object Undefined]",udu=Function.prototype,OJ=udu.toString,adu=OJ.call(Object),tdu=Object.getPrototypeOf,PJ=Object.prototype,jJ=PJ.hasOwnProperty,vs=Symbol?Symbol.toStringTag:void 0,MJ=PJ.toString;function Rj(u){if(!rdu(u)||ndu(u)!==Y4u)return!1;const e=tdu(u);if(e===null)return!0;const a=jJ.call(e,"constructor")&&e.constructor;return typeof a=="function"&&a instanceof a&&OJ.call(a)===adu}function rdu(u){return u!=null&&typeof u=="object"}function ndu(u){return u==null?u===void 0?edu:X4u:vs&&vs in Object(u)?idu(u):odu(u)}function idu(u){const e=jJ.call(u,vs),a=u[vs];let t=!1;try{u[vs]=void 0,t=!0}catch{}const r=MJ.call(u);return t&&(e?u[vs]=a:delete u[vs]),r}function odu(u){return MJ.call(u)}const sdu=20;function ldu(...u){let e=u.shift();const a=new WeakMap;for(;u.length>0;)e=TJ(e,u.shift(),0,a);return e}function pk(u){return Z5(u)?u.slice():u}function TJ(u,e,a=0,t){let r;if(!(a>sdu)){if(a++,bx(u)||bx(e)||$J(e))r=pk(e);else if(Z5(u)){if(r=u.slice(),Z5(e))for(let n=0,i=e.length;n<i;n++)r.push(pk(e[n]));else if(C4(e)){const n=Object.keys(e);for(let i=0,o=n.length;i<o;i++){const s=n[i];r[s]=pk(e[s])}}}else if(C4(u))if(C4(e)){if(!cdu(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(bx(l))typeof l>"u"?delete r[s]:r[s]=l;else{const c=r[s],d=l;if(Nj(u,s,t)||Nj(e,s,t))delete r[s];else{if(C4(c)&&C4(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]=TJ(r[s],l,a,t)}}}}else r=e;return r}}function Nj(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 Z5(u){return Array.isArray(u)}function $J(u){return typeof u=="function"}function C4(u){return!bx(u)&&!Z5(u)&&!$J(u)&&typeof u=="object"}function bx(u){return typeof u=="string"||typeof u=="number"||typeof u=="boolean"||typeof u>"u"||u instanceof Date||u instanceof RegExp||u===null}function cdu(u,e){return!(!Rj(u)||!Rj(e))}class ddu{_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 Edu{_callback;_that;_isCalled=!1;_deferred=new ddu;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 pdu(){return"unknown_service"}const Z4=u=>u!==null&&typeof u=="object"&&typeof u.then=="function";class Q5{_rawAttributes;_asyncAttributesPending=!1;_memoizedAttributes;static FromAttributeList(e){const a=new Q5({});return a._rawAttributes=_j(e),a._asyncAttributesPending=e.filter(([t,r])=>Z4(r)).length>0,a}constructor(e){const a=e.attributes??{};this._rawAttributes=Object.entries(a).map(([t,r])=>(Z4(r)&&(this._asyncAttributesPending=!0),[t,r])),this._rawAttributes=_j(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,Z4(t)?await t:t]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&Iu.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;const e={};for(const[a,t]of this._rawAttributes){if(Z4(t)){Iu.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:Q5.FromAttributeList([...e.getRawAttributes(),...this.getRawAttributes()])}}function RJ(u){return Q5.FromAttributeList(Object.entries(u))}function mdu(){return RJ({[BJ]:pdu(),[Iy]:ck[Iy],[Ky]:ck[Ky],[Vy]:ck[Vy]})}function _j(u){return u.map(([e,a])=>Z4(a)?[e,a.catch(t=>{Iu.debug("promise rejection for resource attribute: %s - %s",e,t)})]:[e,a])}const hdu="exception";class xdu{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;name;status={code:Ud.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=A1.now(),this._performanceOffset=a-(this._performanceStartTime+SJ()),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 Iu.warn(`Invalid attribute key: ${e}`),this;if(!FJ(a))return Iu.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 Iu.warn("No events allowed."),this._droppedEventsCount++,this;r!==void 0&&this.events.length>=r&&(this._droppedEventsCount===0&&Iu.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),jj(a)&&(jj(t)||(t=a),a=void 0);const n=kx(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"&&(Iu.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()){Iu.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=j4u(this.startTime,this.endTime),this._duration[0]<0&&(Iu.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&&Iu.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._spanProcessor.onEnd(this)}_getTime(e){if(typeof e=="number"&&e<=A1.now())return P4u(e+this._performanceOffset);if(typeof e=="number")return x1(e);if(e instanceof Date)return x1(e.getTime());if(zJ(e))return e;if(this._startTimeProvided)return x1(Date.now());const a=A1.now()-this._performanceStartTime;return wJ(this.startTime,x1(a))}isRecording(){return this._ended===!1}recordException(e,a){const t={};typeof e=="string"?t[sk]=e:e&&(e.code?t[lk]=e.code.toString():e.name&&(t[lk]=e.name),e.message&&(t[sk]=e.message),e.stack&&(t[F4u]=e.stack)),t[lk]||t[sk]?this.addEvent(hdu,t,a):Iu.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}}`);Iu.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?(Iu.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 Y5{shouldSample(){return{decision:Q1.NOT_RECORD}}toString(){return"AlwaysOffSampler"}}class B1{shouldSample(){return{decision:Q1.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}}class mh{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(e){this._root=e.root,this._root||(Z1(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new B1),this._remoteParentSampled=e.remoteParentSampled??new B1,this._remoteParentNotSampled=e.remoteParentNotSampled??new Y5,this._localParentSampled=e.localParentSampled??new B1,this._localParentNotSampled=e.localParentNotSampled??new Y5}shouldSample(e,a,t,r,n,i){const o=s0.getSpanContext(e);return!o||!sg(o)?this._root.shouldSample(e,a,t,r,n,i):o.isRemote?o.traceFlags&yi.SAMPLED?this._remoteParentSampled.shouldSample(e,a,t,r,n,i):this._remoteParentNotSampled.shouldSample(e,a,t,r,n,i):o.traceFlags&yi.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 Lj{_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:vJ(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 Ij=1;function NJ(){return{sampler:_J(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},spanLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128,linkCountLimit:128,eventCountLimit:128,attributePerEventCountLimit:128,attributePerLinkCountLimit:128}}}function _J(){const u="parentbased_always_on";switch(u){case"always_on":return new B1;case"always_off":return new Y5;case"parentbased_always_on":return new mh({root:new B1});case"parentbased_always_off":return new mh({root:new Y5});case"traceidratio":return new Lj(Kj());case"parentbased_traceidratio":return new mh({root:new Lj(Kj())});default:return Iu.error(`OTEL_TRACES_SAMPLER value "${u}" invalid, defaulting to "parentbased_always_on".`),new mh({root:new B1})}}function Kj(){return Iu.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${Ij}.`),Ij}const Ddu=128,fdu=1/0;function gdu(u){const e={sampler:_J()},a=NJ(),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 vdu(u){const e=Object.assign({},u.spanLimits);return e.attributeCountLimit=u.spanLimits?.attributeCountLimit??u.generalLimits?.attributeCountLimit??void 0??void 0??Ddu,e.attributeValueLengthLimit=u.spanLimits?.attributeValueLengthLimit??u.generalLimits?.attributeValueLengthLimit??void 0??void 0??fdu,Object.assign({},u,{spanLimits:e})}class kdu{_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 Edu(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(Iu.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&yi.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&&Iu.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(Iu.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);Ei.with(l4u(Ei.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===Yr.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=>{Z1(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,Z1(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 bdu extends kdu{_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=>{Z1(a)})},this._pageHideListener=()=>{this.forceFlush().catch(a=>{Z1(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 ydu=8,Cdu=16;class Fdu{generateTraceId=Vj(Cdu);generateSpanId=Vj(ydu)}const hh=Array(32);function Vj(u){return function(){for(let a=0;a<u*2;a++)hh[a]=Math.floor(Math.random()*16)+48,hh[a]>=58&&(hh[a]+=39);return String.fromCharCode.apply(null,hh.slice(0,u*2))}}class Adu{_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;constructor(e,a,t,r){const n=gdu(a);this._sampler=n.sampler,this._generalLimits=n.generalLimits,this._spanLimits=n.spanLimits,this._idGenerator=a.idGenerator||new Fdu,this._resource=t,this._spanProcessor=r,this.instrumentationScope=e}startSpan(e,a={},t=Ei.active()){a.root&&(t=s0.deleteSpan(t));const r=s0.getSpan(t);if(hA(t))return Iu.debug("Instrumentation suppressed, returning Noop Span"),s0.wrapSpanContext(fJ);const n=r?.spanContext(),i=this._idGenerator.generateSpanId();let o,s,l;!n||!s0.isSpanContextValid(n)?s=this._idGenerator.generateTraceId():(s=n.traceId,l=n.traceState,o=n);const c=a.kind??Ny.INTERNAL,d=(a.links??[]).map(f=>({context:f.context,attributes:kx(f.attributes)})),E=kx(a.attributes),p=this._sampler.shouldSample(t,s,e,c,E,d);l=p.traceState??l;const x=p.decision===J5.RECORD_AND_SAMPLED?yi.SAMPLED:yi.NONE,m={traceId:s,spanId:i,traceFlags:x,traceState:l};if(p.decision===J5.NOT_RECORD)return Iu.debug("Recording is off, propagating context in a non-recording span"),s0.wrapSpanContext(m);const g=kx(Object.assign(E,p.attributes));return new xdu({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??Ei.active(),l=this.startSpan(e,n,s),c=s0.setSpan(s,l);return Ei.with(c,o,void 0,l)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}}class Bdu{_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=>{Z1(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 ks;(function(u){u[u.resolved=0]="resolved",u[u.timeout=1]="timeout",u[u.error=2]="error",u[u.unresolved=3]="unresolved"})(ks||(ks={}));class Sdu{_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(e={}){const a=ldu({},NJ(),vdu(e));this._resource=a.resource??mdu(),this._config=Object.assign({},a,{resource:this._resource});const t=[];e.spanProcessors?.length&&t.push(...e.spanProcessors),this._activeSpanProcessor=new Bdu(t)}getTracer(e,a,t){const r=`${e}@${a||""}:${t?.schemaUrl||""}`;return this._tracers.has(r)||this._tracers.set(r,new Adu({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=ks.timeout},e);t.forceFlush().then(()=>{clearTimeout(i),n!==ks.timeout&&(n=ks.resolved,r(n))}).catch(o=>{clearTimeout(i),n=ks.error,r(o)})}));return new Promise((t,r)=>{Promise.all(a).then(n=>{const i=n.filter(o=>o!==ks.resolved);i.length>0?r(i):t()}).catch(n=>r([n]))})}shutdown(){return this._activeSpanProcessor.shutdown()}}class zdu{_enabled=!1;_currentContext=o1;_bindFunction(e=o1,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=o1,this._enabled=!1,this}enable(){return this._enabled?this:(this._enabled=!0,this._currentContext=o1,this)}with(e,a,t,...r){const n=this._currentContext;this._currentContext=e||o1;try{return a.call(t,...r)}finally{this._currentContext=n}}}function wdu(u){if(u!==null){if(u===void 0){const e=new zdu;e.enable(),Ei.setGlobalContextManager(e);return}u.enable(),Ei.setGlobalContextManager(u)}}function Odu(u){if(u!==null){if(u===void 0){xd.setGlobalPropagator(new T4u({propagators:[new Q4u,new D4u]}));return}xd.setGlobalPropagator(u)}}class Pdu extends Sdu{constructor(e={}){super(e)}register(e={}){s0.setGlobalTracerProvider(this),Odu(e.propagator),wdu(e.contextManager)}}class jdu{_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 Gj extends Error{code;name="OTLPExporterError";data;constructor(e,a,t){super(e),this.data=t,this.code=a}}function Mdu(u){if(Number.isFinite(u)&&u>0)return u;throw new Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${u}')`)}function Tdu(u){if(u!=null)return()=>u}function $du(u,e,a){return{timeoutMillis:Mdu(u.timeoutMillis??e.timeoutMillis??a.timeoutMillis),concurrencyLimit:u.concurrencyLimit??e.concurrencyLimit??a.concurrencyLimit,compression:u.compression??e.compression??a.compression}}function Rdu(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:"none"}}class Ndu{_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 _du(u){return new Ndu(u.concurrencyLimit)}function Ldu(u){return Object.prototype.hasOwnProperty.call(u,"partialSuccess")}function Idu(){return{handleResponse(u){u==null||!Ldu(u)||u.partialSuccess==null||Object.keys(u.partialSuccess).length===0||Iu.warn("Received Partial Success response:",JSON.stringify(u.partialSuccess))}}}class Kdu{_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=Iu.createComponentLogger({namespace:"OTLPExportDelegate"})}export(e,a){if(this._diagLogger.debug("items to be sent",e),this._promiseQueue.hasReachedLimit()){a({code:Yr.FAILED,error:new Error("Concurrent export limit reached")});return}const t=this._serializer.serializeRequest(e);if(t==null){a({code:Yr.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:Yr.SUCCESS});return}else if(r.status==="failure"&&r.error){a({code:Yr.FAILED,error:r.error});return}else r.status==="retryable"?a({code:Yr.FAILED,error:new Gj("Export failed with retryable status")}):a({code:Yr.FAILED,error:new Gj("Export failed with unknown error")})},r=>a({code:Yr.FAILED,error:r})))}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug("shutdown started"),await this.forceFlush(),this._transport.shutdown()}}function Vdu(u,e){return new Kdu(u.transport,u.serializer,Idu(),u.promiseHandler,e.timeout)}function LJ(u,e,a){return Vdu({transport:a,serializer:e,promiseHandler:_du(u)},{timeout:u.timeoutMillis})}function Hj(u){return u>=48&&u<=57?u-48:u>=97&&u<=102?u-87:u-55}function IJ(u){const e=new Uint8Array(u.length/2);let a=0;for(let t=0;t<u.length;t+=2){const r=Hj(u.charCodeAt(t)),n=Hj(u.charCodeAt(t+1));e[a++]=r<<4|n}return e}function KJ(u){const e=BigInt(1e9);return BigInt(u[0])*e+BigInt(u[1])}function Gdu(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=KJ(u);return Gdu(e)}function qdu(u){return KJ(u).toString()}const Wdu=typeof BigInt<"u"?qdu:M4u;function qj(u){return u}function Jdu(u){if(u!==void 0)return IJ(u)}const Udu={encodeHrTime:Hdu,encodeSpanContext:IJ,encodeOptionalSpanContext:Jdu};function Zdu(u){return u===void 0?Udu:{encodeHrTime:Wdu,encodeSpanContext:qj,encodeOptionalSpanContext:qj}}function Qdu(u){return{attributes:lg(u.attributes),droppedAttributesCount:0}}function Ydu(u){return{name:u.name,version:u.version}}function lg(u){return Object.keys(u).map(e=>VJ(e,u[e]))}function VJ(u,e){return{key:u,value:GJ(e)}}function GJ(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(GJ)}}:e==="object"&&u!=null?{kvlistValue:{values:Object.entries(u).map(([a,t])=>VJ(a,t))}}:{}}function Xdu(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:lg(u.attributes),droppedAttributesCount:u.droppedAttributesCount,events:u.events.map(n=>uEu(n,e)),droppedEventsCount:u.droppedEventsCount,status:{code:t.code,message:t.message},links:u.links.map(n=>eEu(n,e)),droppedLinksCount:u.droppedLinksCount}}function eEu(u,e){return{attributes:u.attributes?lg(u.attributes):[],spanId:e.encodeSpanContext(u.context.spanId),traceId:e.encodeSpanContext(u.context.traceId),traceState:u.context.traceState?.serialize(),droppedAttributesCount:u.droppedAttributesCount||0}}function uEu(u,e){return{attributes:u.attributes?lg(u.attributes):[],name:u.name,timeUnixNano:e.encodeHrTime(u.time),droppedAttributesCount:u.droppedAttributesCount||0}}function aEu(u,e){const a=Zdu(e);return{resourceSpans:rEu(u,a)}}function tEu(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 rEu(u,e){const a=tEu(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=>Xdu(x,e));s.push({scope:Ydu(E[0].instrumentationScope),spans:p,schemaUrl:E[0].instrumentationScope.schemaUrl})}c=l.next()}const d={resource:Qdu(i),scopeSpans:s,schemaUrl:void 0};t.push(d),n=r.next()}return t}const nEu={serializeRequest:u=>{const e=aEu(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))}},iEu=5,oEu=1e3,sEu=5e3,lEu=1.5,Wj=.2;function cEu(){return Math.random()*(2*Wj)-Wj}class dEu{_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=iEu,i=oEu;for(;r.status==="retryable"&&n>0;){n--;const o=Math.max(Math.min(i,sEu)+cEu(),0);i=i*lEu;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 HJ(u){return new dEu(u.transport)}function EEu(u){return[429,502,503,504].includes(u)}function pEu(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 mEu{_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?(Iu.debug("XHR success"),t({status:"success"})):r.status&&EEu(r.status)?t({status:"retryable",retryInMillis:pEu(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 hEu(u){return new mEu(u)}class xEu{_params;constructor(e){this._params=e}send(e){return new Promise(a=>{navigator.sendBeacon(this._params.url,new Blob([e],{type:this._params.blobType}))?(Iu.debug("SendBeacon success"),a({status:"success"})):a({status:"failure",error:new Error("SendBeacon failed")})})}shutdown(){}}function DEu(u){return new xEu(u)}function fEu(u,e){return LJ(u,e,HJ({transport:hEu(u)}))}function gEu(u,e){return LJ(u,e,HJ({transport:DEu({url:u.url,blobType:u.headers()["Content-Type"]})}))}function vEu(u){return()=>{const e={};return Object.entries(u?.()??{}).forEach(([a,t])=>{typeof t<"u"?e[a]=String(t):Iu.warn(`Header "${a}" has invalid value (${t}) and will be ignored`)}),e}}function kEu(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 bEu(u){if(u!=null)try{return new URL(u),u}catch{throw new Error(`Configuration: Could not parse user-provided export URL: '${u}'`)}}function yEu(u,e,a){return{...$du(u,e,a),headers:kEu(vEu(u.headers),e.headers,a.headers),url:bEu(u.url)??e.url??a.url,agentOptions:u.agentOptions??e.agentOptions??a.agentOptions}}function CEu(u,e){return{...Rdu(),headers:()=>u,url:"http://localhost:4318/"+e,agentOptions:{keepAlive:!0}}}function FEu(u,e,a){return yEu({url:u.url,timeoutMillis:u.timeoutMillis,headers:Tdu(u.headers),concurrencyLimit:u.concurrencyLimit},{},CEu(a,e))}function AEu(u,e,a,t){const r=!!u.headers||typeof navigator.sendBeacon!="function",n=FEu(u,a,t);return r?fEu(n,e):gEu(n,e)}class BEu extends jdu{constructor(e={}){super(AEu(e,nEu,"v1/traces",{"Content-Type":"application/json"}))}}class qJ{emit(e){}}const SEu=new qJ;class zEu{getLogger(e,a,t){return new qJ}}const WJ=new zEu;class wEu{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):SEu}}class Jj{getLogger(e,a,t){var r;return(r=this.getDelegateLogger(e,a,t))!==null&&r!==void 0?r:new wEu(this,e,a,t)}getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:WJ}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 OEu=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{},xh=Symbol.for("io.opentelemetry.js.api.logs"),F4=OEu;function PEu(u,e,a){return t=>t===u?e:a}const Uj=1;class DA{constructor(){this._proxyLoggerProvider=new Jj}static getInstance(){return this._instance||(this._instance=new DA),this._instance}setGlobalLoggerProvider(e){return F4[xh]?this.getLoggerProvider():(F4[xh]=PEu(Uj,e,WJ),this._proxyLoggerProvider.setDelegate(e),e)}getLoggerProvider(){var e,a;return(a=(e=F4[xh])===null||e===void 0?void 0:e.call(F4,Uj))!==null&&a!==void 0?a:this._proxyLoggerProvider}getLogger(e,a,t){return this.getLoggerProvider().getLogger(e,a,t)}disable(){delete F4[xh],this._proxyLoggerProvider=new Jj}}const JJ=DA.getInstance();function jEu(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 MEu(u){u.forEach(e=>e.disable())}function TEu(u){const e=u.tracerProvider||s0.getTracerProvider(),a=u.meterProvider||bJ.getMeterProvider(),t=u.loggerProvider||JJ.getLoggerProvider(),r=u.instrumentations?.flat()??[];return jEu(r,e,a,t),()=>{MEu(r)}}let j0=console.error.bind(console);function A4(u,e,a){const t=!!u[e]&&Object.prototype.propertyIsEnumerable.call(u,e);Object.defineProperty(u,e,{configurable:!0,enumerable:t,writable:!0,value:a})}const UJ=(u,e,a)=>{if(!u||!u[e]){j0("no original function "+String(e)+" to wrap");return}if(!a){j0("no wrapper function"),j0(new Error().stack);return}const t=u[e];if(typeof t!="function"||typeof a!="function"){j0("original object and wrapper must be functions");return}const r=a(t,e);return A4(r,"__original",t),A4(r,"__unwrap",()=>{u[e]===r&&A4(u,e,t)}),A4(r,"__wrapped",!0),A4(u,e,r),r},$Eu=(u,e,a)=>{if(u)Array.isArray(u)||(u=[u]);else{j0("must provide one or more modules to patch"),j0(new Error().stack);return}if(!(e&&Array.isArray(e))){j0("must provide one or more functions to wrap on modules");return}u.forEach(t=>{e.forEach(r=>{UJ(t,r,a)})})},ZJ=(u,e)=>{if(!u||!u[e]){j0("no function to unwrap."),j0(new Error().stack);return}const a=u[e];if(!a.__unwrap)j0("no original to unwrap to -- has "+String(e)+" already been unwrapped?");else{a.__unwrap();return}},REu=(u,e)=>{if(u)Array.isArray(u)||(u=[u]);else{j0("must provide one or more modules to patch"),j0(new Error().stack);return}if(!(e&&Array.isArray(e))){j0("must provide one or more functions to unwrap on modules");return}u.forEach(a=>{e.forEach(t=>{ZJ(a,t)})})};class NEu{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(e,a,t){this.instrumentationName=e,this.instrumentationVersion=a,this.setConfig(t),this._diag=Iu.createComponentLogger({namespace:e}),this._tracer=s0.getTracer(e,a),this._meter=bJ.getMeter(e,a),this._logger=JJ.getLogger(e,a),this._updateMetricInstruments()}_wrap=UJ;_unwrap=ZJ;_massWrap=$Eu;_massUnwrap=REu;get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){const e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,a,t,r){if(e)try{e(t,r)}catch(n){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:a},n)}}}class _Eu extends NEu{constructor(e,a,t){super(e,a,t),this._config.enabled&&this.enable()}}class LEu{span=void 0;constructor(e){this.span=e}get context(){return this.span?.context}error(e){this.span&&(this.span.setStatus(Ud.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(Ud.OK),this.span.end())}}class IEu{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":W5(),"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=s0.setSpan(Ei.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=Ei.active(),t=e.time?new Date(e.time):new Date,r=this.tracer.startSpan(`event.${e.type}`,{attributes:this.processAttributes(e,t)},a),n=s0.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 LEu(a)}async forceFlush(){return this.tracerProvider?.forceFlush()}async shutdown(){return this.tracerProvider?.shutdown()}getKeySnakeValue=e=>e.replace(/([A-Z])/g,"_$1").toLowerCase()}class KEu extends IEu{tracerProvider=null;tracer=null;initialized=!1;constructor(){super()}initTracer(e){if(!e.collectorUrl&&!e.collectorTraceUrl)return;const a=`ses_${W5()}`,t=RJ({[BJ]:e.serviceName,[A4u]:e.serviceVersion,session_id:a}),r=e.collectorTraceUrl||`${e.collectorUrl}/v1/traces`;this.tracerProvider=new Pdu({resource:t,spanProcessors:[new bdu(new BEu({url:r,headers:{}}))]}),this.tracer=this.tracerProvider.getTracer(e.tracerName),this.tracerProvider.register(),TEu({instrumentations:e.instrumentations??[]}),this.initialized=!0}}class oi extends _Eu{sendErrorEvent;originalConsoleError;constructor(e,a){super("errors","1.0",e||{}),this.sendErrorEvent=a}static toErrorEvent(e,a){return{type:"error",payload:{handler:a,errorType:oi.getErrorType(e),message:oi.getErrorMessage(e),stack:oi.getErrorStack(e)}}}enable(){window.addEventListener("error",this.onError),window.addEventListener("unhandledrejection",this.onUnhandledRejection),this.wrapConsoleError()}disable(){window.removeEventListener("error",this.onError),window.removeEventListener("unhandledrejection",this.onUnhandledRejection),this.unwrapConsoleError()}init(){}static getErrorMessage(e){return e?(typeof e=="object"&&"message"in e?String(e.message):String(e)).trim():void 0}static getErrorStack(e){if(!e||typeof e!="object"||!("stack"in e)||!e.stack)return;const a=String(e.stack);return a.length>4096?a.substring(0,4096):a}static getErrorType(e){return!e||typeof e!="object"?typeof e:"name"in e?String(e.name):"constructor"in e&&"name"in e.constructor?String(e.constructor.name):"Error"}static combineConsoleErrorArgs(e){const a=e.findIndex(r=>r instanceof Error),t=e.filter((r,n)=>n!==a).map(r=>String(r)).join(" ");if(a===-1)return t;{const r=e[a];return t&&(r.message=`${r.message} ${t}`),r}}onError=e=>{this.sendError(e.error,"window.onerror")};onUnhandledRejection=e=>{this.sendError(e.reason,"window.onunhandledrejection")};wrapConsoleError(){this.originalConsoleError=console.error,console.error=(...e)=>{try{const a=oi.combineConsoleErrorArgs(e);this.sendError(a,"console.error")}catch(a){process.env.NODE_ENV!=="production"&&this.originalConsoleError?.call(console,"Error reporting failed:",a)}this.originalConsoleError?.apply(console,e)}}unwrapConsoleError(){this.originalConsoleError&&(console.error=this.originalConsoleError,this.originalConsoleError=void 0)}sendError(e,a){this.sendErrorEvent(oi.toErrorEvent(e,a))}}class VEu{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 KEu,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.enableErrorInstrumentation===!0?[new oi(void 0,a=>{this.sendErrorMessage(a.payload)})]:[],...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_${W5()}`,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_${W5()}`,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()}shutdown(){return this.config?.disabled?Promise.resolve():this.otelClient.shutdown()}sendError(e,a){this.config?.disabled||this.send(oi.toErrorEvent(e,a).type,oi.toErrorEvent(e,a).payload)}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)}sendErrorMessage(e){this.send("error",e)}}const GEu=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],HEu="https://cors.redocly.com/";function qEu(u,e,a){return e in u?Object.defineProperty(u,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):u[e]=a,u}function Zj(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 Qj(u){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Zj(Object(a),!0).forEach(function(t){qEu(u,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(a)):Zj(Object(a)).forEach(function(t){Object.defineProperty(u,t,Object.getOwnPropertyDescriptor(a,t))})}return u}function dt(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 Yj=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),mk=function(){return Math.random().toString(36).substring(7).split("").join(".")},ko={INIT:"@@redux/INIT"+mk(),REPLACE:"@@redux/REPLACE"+mk(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+mk()}};function QJ(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 WEu(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(ZEu(u))return"date";if(UEu(u))return"error";var a=JEu(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 JEu(u){return typeof u.constructor=="function"?u.constructor.name:null}function UEu(u){return u instanceof Error||typeof u.message=="string"&&u.constructor&&typeof u.constructor.stackTraceLimit=="number"}function ZEu(u){return u instanceof Date?!0:typeof u.toDateString=="function"&&typeof u.getDate=="function"&&typeof u.setDate=="function"}function to(u){var e=typeof u;return process.env.NODE_ENV!=="production"&&(e=WEu(u)),e}function cg(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"?dt(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"?dt(1):"Expected the enhancer to be a function. Instead, received: '"+to(a)+"'");return a(cg)(u,e)}if(typeof u!="function")throw new Error(process.env.NODE_ENV==="production"?dt(2):"Expected the root reducer to be a function. Instead, received: '"+to(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"?dt(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"?dt(4):"Expected the listener to be a function. Instead, received: '"+to(m)+"'");if(s)throw new Error(process.env.NODE_ENV==="production"?dt(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"?dt(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(!QJ(m))throw new Error(process.env.NODE_ENV==="production"?dt(7):"Actions must be plain objects. Instead, the actual type was: '"+to(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"?dt(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"?dt(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"?dt(10):"Expected the nextReducer to be a function. Instead, received: '"+to(m));r=m,E({type:ko.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"?dt(11):"Expected the observer to be an object. Instead, received: '"+to(f)+"'");function k(){f.next&&f.next(c())}k();var y=g(k);return{unsubscribe:y}}},m[Yj]=function(){return this},m}return E({type:ko.INIT}),t={dispatch:E,subscribe:d,getState:c,replaceReducer:p},t[Yj]=x,t}var QEu=cg;function Hy(u){typeof console<"u"&&typeof console.error=="function"&&console.error(u);try{throw new Error(u)}catch{}}function YEu(u,e,a,t){var r=Object.keys(e),n=a&&a.type===ko.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(!QJ(u))return"The "+n+' has unexpected type of "'+to(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===ko.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 XEu(u){Object.keys(u).forEach(function(e){var a=u[e],t=a(void 0,{type:ko.INIT});if(typeof t>"u")throw new Error(process.env.NODE_ENV==="production"?dt(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:ko.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?dt(13):'The slice reducer for key "'+e+'" returned undefined when probed with a random type. '+("Don't try to handle '"+ko.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 e3u(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"&&Hy('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{XEu(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=YEu(l,a,c,i);d&&Hy(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"?dt(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 Xj(u,e){return function(){return e(u.apply(this,arguments))}}function u3u(u,e){if(typeof u=="function")return Xj(u,e);if(typeof u!="object"||u===null)throw new Error(process.env.NODE_ENV==="production"?dt(16):"bindActionCreators expected an object or a function, but instead received: '"+to(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]=Xj(r,e))}return a}function YJ(){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 a3u(){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"?dt(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=YJ.apply(void 0,o)(r.dispatch),Qj(Qj({},r),{},{dispatch:n})}}}function eM(){}process.env.NODE_ENV!=="production"&&typeof eM.name=="string"&&eM.name!=="isCrushed"&&Hy('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 t3u=Object.freeze({__proto__:null,__DO_NOT_USE__ActionTypes:ko,applyMiddleware:a3u,bindActionCreators:u3u,combineReducers:e3u,compose:YJ,createStore:cg,legacy_createStore:QEu});function r3u(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 n3u=r3u(t3u);n3u.compose;var i3u=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(u){return u}};function o3u(u,e,a){var t=!1,r=!1,n=cg(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})},i3u({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 s3u(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=o3u(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 LE="default",XJ=[{name:LE,inputs:[],servers:[],state:Nu.Normal}],eU={activeTabIdx:0,tabs:[]};var Zr=(u=>(u.Idle="idle",u.Loading="loading",u.Success="success",u.Error="error",u))(Zr||{});function pi(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 qy(u,e){if(u===e)return!0;if(u&&e&&typeof u=="object"&&typeof e=="object"){if(Array.isArray(u)&&Array.isArray(e)){if(u.length!==e.length)return!1;for(let r=0;r<u.length;r++)if(!qy(u[r],e[r]))return!1;return!0}const a=Object.keys(u),t=Object.keys(e);if(a.length!==t.length)return!1;for(let r=0;r<a.length;r++){const n=a[r];if(!Object.prototype.hasOwnProperty.call(e,n)||!qy(u[n],e[n]))return!1}return!0}return u!==u&&e!==e}function uM(u){return Object.keys(u).forEach(e=>{u[e]===void 0&&delete u[e]}),u}const hn={FS:"fs",WEB:"web"};function Ac(){return!!window?.__TAURI__}class Ea{static utils=null;static async getUtils(){return Ea.utils||(Ea.utils=Ac()?await Promise.resolve().then(()=>require("./replay-tauri-path-B-qO7pnf.js")):await Promise.resolve().then(()=>hne)),Ea.utils}static async dirname(e){return(await Ea.getUtils()).dirname(e)}static async join(...e){return(await Ea.getUtils()).join(...e)}static async resolve(e){return(await Ea.getUtils()).resolve(e)}static async isAbsolute(e){return(await Ea.getUtils()).isAbsolute(e)}static async relative(e,a){return(await Ea.getUtils()).relative(e,a)}static async extname(e){return(await Ea.getUtils()).extname(e)}}async function Lt(u,e={},a){return window.__TAURI_INTERNALS__.invoke(u,e,a)}var X5;(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"})(X5||(X5={}));async function l3u(){return Lt("plugin:path|resolve_directory",{directory:X5.AppData})}async function c3u(){return Lt("plugin:path|resolve_directory",{directory:X5.Desktop})}function uU(){return window.__TAURI_INTERNALS__.plugins.path.sep}async function d3u(...u){return Lt("plugin:path|resolve",{paths:u})}async function Dd(...u){return Lt("plugin:path|join",{paths:u})}async function E3u(u){return Lt("plugin:path|dirname",{path:u})}async function p3u(u){return Lt("plugin:path|extname",{path:u})}async function aU(u,e){return Lt("plugin:path|basename",{path:u,ext:e})}async function m3u(u){return Lt("plugin:path|is_absolute",{path:u})}var aM;(function(u){u[u.Start=0]="Start",u[u.Current=1]="Current",u[u.End=2]="End"})(aM||(aM={}));async function tM(u,e){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");await Lt("plugin:fs|mkdir",{path:u instanceof URL?u.toString():u,options:e})}async function tU(u,e){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");return await Lt("plugin:fs|read_dir",{path:u instanceof URL?u.toString():u,options:e})}async function h3u(u,e){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");const a=await Lt("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 fA(u,e){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");return await Lt("plugin:fs|read_text_file",{path:u instanceof URL?u.toString():u,options:e})}async function x3u(u,e){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");await Lt("plugin:fs|remove",{path:u instanceof URL?u.toString():u,options:e})}async function D3u(u,e,a){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");await Lt("plugin:fs|write_text_file",{path:u instanceof URL?u.toString():u,data:e,options:a})}async function rU(u,e){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");return await Lt("plugin:fs|exists",{path:u instanceof URL?u.toString():u,options:e})}const mi=window.__TAURI__?.http.fetch??globalThis.fetch;function yx(u){return/(?:^[a-z][a-z0-9+.-]*:|\/\/)/i.test(u)}function eD(u){return u.endsWith("/")?u.substring(0,u.length-1):u}function f3u(u){return u.startsWith("/")?u.substring(1):u}function g3u(u){try{const e=new URL(u);return e.search="",e.hash="",e.toString()}catch{return u}}class nU extends Hf{constructor(){super()}resolveExternalRef(e,a){return yx(a)?a:e&&yx(e)?new URL(a,e).href:e?Ls.resolve(Ls.dirname(e),a):a}async loadExternalRef(e){if(yx(e)){const{body:a,mimeType:t}=await aK(e,{...this.config.http,customFetch:mi});return new H1(e,a,t)}else{if(!await rU(e))throw new Error(`File not found at ${e}.`);try{throw await tU(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 fA(e);return new H1(e,t.replace(/\r\n/g,`
475
+ `;function iA({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(hJ,{variable:u,onSave:i,onCancel:a,...t,children:D.jsx(qd,{children:D.jsx(mJ,{value:r,onChange:o=>n(o),title:"Make it secret"})})})}const Ry=()=>({name:"",value:"",isSecret:!1}),ka=u=>ZI+"$inputs."+u+p2,V1u=(u,e)=>e.inputs.find(a=>a.get().name===u.match(`^${Ff}$`)?.[1]);function G1u({environments:u,activeEnvironmentId:e}){return u.get().find(t=>t.name===e.get())?.inputs||[]}function Ui(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 oA(u){const e=/^\{?\$inputs\.([^\}\s]+)\}?$/,a=u.match(e);return a?a[1]:null}function vx(u){var e=new Error(u);return e.source="ulid",e}var sA="0123456789ABCDEFGHJKMNPQRSTVWXYZ",md=sA.length,wj=Math.pow(2,48)-1,H1u=10,q1u=16;function W1u(u){var e=Math.floor(u()*md);return e===md&&(e=md-1),sA.charAt(e)}function J1u(u,e){if(isNaN(u))throw new Error(u+" must be a number");if(u>wj)throw vx("cannot encode time greater than "+wj);if(u<0)throw vx("time must be positive");if(Number.isInteger(u)===!1)throw vx("time must be an integer");for(var a=void 0,t="";e>0;e--)a=u%md,t=sA.charAt(a)+t,u=(u-a)/md;return t}function U1u(u,e){for(var a="";u>0;u--)a=W1u(e)+a;return a}function Z1u(){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 vx("secure crypto unusable, insecure Math.random not allowed")}function Q1u(u){return u||(u=Z1u()),function(a){return isNaN(a)&&(a=Date.now()),J1u(a,H1u)+U1u(q1u,u)}}var W5=Q1u(),Y1u=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{},Ss="1.9.0",Oj=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function X1u(u){var e=new Set([u]),a=new Set,t=u.match(Oj);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(Oj);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 ecu=X1u(Ss),ucu=Ss.split(".")[0],Wd=Symbol.for("opentelemetry.js.api."+ucu),Jd=Y1u;function NE(u,e,a,t){var r;t===void 0&&(t=!1);var n=Jd[Wd]=(r=Jd[Wd])!==null&&r!==void 0?r:{version:Ss};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!==Ss){var i=new Error("@opentelemetry/api: Registration of version v"+n.version+" for "+u+" does not match previously registered API v"+Ss);return a.error(i.stack||i.message),!1}return n[u]=e,a.debug("@opentelemetry/api: Registered a global for "+u+" v"+Ss+"."),!0}function Ks(u){var e,a,t=(e=Jd[Wd])===null||e===void 0?void 0:e.version;if(!(!t||!ecu(t)))return(a=Jd[Wd])===null||a===void 0?void 0:a[u]}function _E(u,e){e.debug("@opentelemetry/api: Unregistering a global for "+u+" v"+Ss+".");var a=Jd[Wd];a&&delete a[u]}var acu=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},tcu=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))},rcu=(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 y4("debug",this._namespace,e)},u.prototype.error=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];return y4("error",this._namespace,e)},u.prototype.info=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];return y4("info",this._namespace,e)},u.prototype.warn=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];return y4("warn",this._namespace,e)},u.prototype.verbose=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];return y4("verbose",this._namespace,e)},u})();function y4(u,e,a){var t=Ks("diag");if(t)return a.unshift(e),t[u].apply(t,tcu([],acu(a),!1))}var B0;(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"})(B0||(B0={}));function ncu(u,e){u<B0.NONE?u=B0.NONE:u>B0.ALL&&(u=B0.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",B0.ERROR),warn:a("warn",B0.WARN),info:a("info",B0.INFO),debug:a("debug",B0.DEBUG),verbose:a("verbose",B0.VERBOSE)}}var icu=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},ocu=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))},scu="diag",kn=(function(){function u(){function e(r){return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var o=Ks("diag");if(o)return o[r].apply(o,ocu([],icu(n),!1))}}var a=this,t=function(r,n){var i,o,s;if(n===void 0&&(n={logLevel:B0.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=Ks("diag"),d=ncu((o=n.logLevel)!==null&&o!==void 0?o:B0.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 NE("diag",d,a,!0)};a.setLogger=t,a.disable=function(){_E(scu,a)},a.createComponentLogger=function(r){return new rcu(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})(),lcu=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},ccu=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.")},dcu=(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=lcu(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=ccu(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})(),Ecu=Symbol("BaggageEntryMetadata"),pcu=kn.instance();function mcu(u){return u===void 0&&(u={}),new dcu(new Map(Object.entries(u)))}function hcu(u){return typeof u!="string"&&(pcu.error("Cannot create baggage metadata from unknown type: "+typeof u),u=""),{__TYPE__:Ecu,toString:function(){return u}}}function lA(u){return Symbol.for(u)}var xcu=(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})(),o1=new xcu,rl=(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)}})(),Dcu=(function(){function u(){}return u.prototype.createGauge=function(e,a){return Bcu},u.prototype.createHistogram=function(e,a){return Scu},u.prototype.createCounter=function(e,a){return Acu},u.prototype.createUpDownCounter=function(e,a){return zcu},u.prototype.createObservableGauge=function(e,a){return Ocu},u.prototype.createObservableCounter=function(e,a){return wcu},u.prototype.createObservableUpDownCounter=function(e,a){return Pcu},u.prototype.addBatchObservableCallback=function(e,a){},u.prototype.removeBatchObservableCallback=function(e){},u})(),ig=(function(){function u(){}return u})(),fcu=(function(u){rl(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e.prototype.add=function(a,t){},e})(ig),gcu=(function(u){rl(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e.prototype.add=function(a,t){},e})(ig),vcu=(function(u){rl(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e.prototype.record=function(a,t){},e})(ig),kcu=(function(u){rl(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e.prototype.record=function(a,t){},e})(ig),cA=(function(){function u(){}return u.prototype.addCallback=function(e){},u.prototype.removeCallback=function(e){},u})(),bcu=(function(u){rl(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e})(cA),ycu=(function(u){rl(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e})(cA),Ccu=(function(u){rl(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e})(cA),Fcu=new Dcu,Acu=new fcu,Bcu=new vcu,Scu=new kcu,zcu=new gcu,wcu=new bcu,Ocu=new ycu,Pcu=new Ccu,jcu={get:function(u,e){if(u!=null)return u[e]},keys:function(u){return u==null?[]:Object.keys(u)}},Mcu={set:function(u,e,a){u!=null&&(u[e]=a)}},Tcu=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},$cu=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))},Rcu=(function(){function u(){}return u.prototype.active=function(){return o1},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,$cu([t],Tcu(r),!1))},u.prototype.bind=function(e,a){return a},u.prototype.enable=function(){return this},u.prototype.disable=function(){return this},u})(),Ncu=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},_cu=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))},ak="context",Lcu=new Rcu,og=(function(){function u(){}return u.getInstance=function(){return this._instance||(this._instance=new u),this._instance},u.prototype.setGlobalContextManager=function(e){return NE(ak,e,kn.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,_cu([e,a,t],Ncu(n),!1))},u.prototype.bind=function(e,a){return this._getContextManager().bind(e,a)},u.prototype._getContextManager=function(){return Ks(ak)||Lcu},u.prototype.disable=function(){this._getContextManager().disable(),_E(ak,kn.instance())},u})(),yi;(function(u){u[u.NONE=0]="NONE",u[u.SAMPLED=1]="SAMPLED"})(yi||(yi={}));var xJ="0000000000000000",DJ="00000000000000000000000000000000",fJ={traceId:DJ,spanId:xJ,traceFlags:yi.NONE},hd=(function(){function u(e){e===void 0&&(e=fJ),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})(),dA=lA("OpenTelemetry Context Key SPAN");function EA(u){return u.getValue(dA)||void 0}function Icu(){return EA(og.getInstance().active())}function pA(u,e){return u.setValue(dA,e)}function Kcu(u){return u.deleteValue(dA)}function Vcu(u,e){return pA(u,new hd(e))}function gJ(u){var e;return(e=EA(u))===null||e===void 0?void 0:e.spanContext()}var Gcu=/^([0-9a-f]{32})$/i,Hcu=/^[0-9a-f]{16}$/i;function vJ(u){return Gcu.test(u)&&u!==DJ}function qcu(u){return Hcu.test(u)&&u!==xJ}function sg(u){return vJ(u.traceId)&&qcu(u.spanId)}function Wcu(u){return new hd(u)}var tk=og.getInstance(),kJ=(function(){function u(){}return u.prototype.startSpan=function(e,a,t){t===void 0&&(t=tk.active());var r=!!a?.root;if(r)return new hd;var n=t&&gJ(t);return Jcu(n)&&sg(n)?new hd(n):new hd},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??tk.active(),l=this.startSpan(e,n,s),c=pA(s,l);return tk.with(c,o,void 0,l)}},u})();function Jcu(u){return typeof u=="object"&&typeof u.spanId=="string"&&typeof u.traceId=="string"&&typeof u.traceFlags=="number"}var Ucu=new kJ,Zcu=(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):Ucu},u})(),Qcu=(function(){function u(){}return u.prototype.getTracer=function(e,a,t){return new kJ},u})(),Ycu=new Qcu,Pj=(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 Zcu(this,e,a,t)},u.prototype.getDelegate=function(){var e;return(e=this._delegate)!==null&&e!==void 0?e:Ycu},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})(),J5;(function(u){u[u.NOT_RECORD=0]="NOT_RECORD",u[u.RECORD=1]="RECORD",u[u.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(J5||(J5={}));var Ny;(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"})(Ny||(Ny={}));var Ud;(function(u){u[u.UNSET=0]="UNSET",u[u.OK=1]="OK",u[u.ERROR=2]="ERROR"})(Ud||(Ud={}));var Ei=og.getInstance(),Iu=kn.instance(),Xcu=(function(){function u(){}return u.prototype.getMeter=function(e,a,t){return Fcu},u})(),e4u=new Xcu,rk="metrics",u4u=(function(){function u(){}return u.getInstance=function(){return this._instance||(this._instance=new u),this._instance},u.prototype.setGlobalMeterProvider=function(e){return NE(rk,e,kn.instance())},u.prototype.getMeterProvider=function(){return Ks(rk)||e4u},u.prototype.getMeter=function(e,a,t){return this.getMeterProvider().getMeter(e,a,t)},u.prototype.disable=function(){_E(rk,kn.instance())},u})(),bJ=u4u.getInstance(),a4u=(function(){function u(){}return u.prototype.inject=function(e,a){},u.prototype.extract=function(e,a){return e},u.prototype.fields=function(){return[]},u})(),mA=lA("OpenTelemetry Baggage Key");function yJ(u){return u.getValue(mA)||void 0}function t4u(){return yJ(og.getInstance().active())}function r4u(u,e){return u.setValue(mA,e)}function n4u(u){return u.deleteValue(mA)}var nk="propagation",i4u=new a4u,o4u=(function(){function u(){this.createBaggage=mcu,this.getBaggage=yJ,this.getActiveBaggage=t4u,this.setBaggage=r4u,this.deleteBaggage=n4u}return u.getInstance=function(){return this._instance||(this._instance=new u),this._instance},u.prototype.setGlobalPropagator=function(e){return NE(nk,e,kn.instance())},u.prototype.inject=function(e,a,t){return t===void 0&&(t=Mcu),this._getGlobalPropagator().inject(e,a,t)},u.prototype.extract=function(e,a,t){return t===void 0&&(t=jcu),this._getGlobalPropagator().extract(e,a,t)},u.prototype.fields=function(){return this._getGlobalPropagator().fields()},u.prototype.disable=function(){_E(nk,kn.instance())},u.prototype._getGlobalPropagator=function(){return Ks(nk)||i4u},u})(),xd=o4u.getInstance(),ik="trace",s4u=(function(){function u(){this._proxyTracerProvider=new Pj,this.wrapSpanContext=Wcu,this.isSpanContextValid=sg,this.deleteSpan=Kcu,this.getSpan=EA,this.getActiveSpan=Icu,this.getSpanContext=gJ,this.setSpan=pA,this.setSpanContext=Vcu}return u.getInstance=function(){return this._instance||(this._instance=new u),this._instance},u.prototype.setGlobalTracerProvider=function(e){var a=NE(ik,this._proxyTracerProvider,kn.instance());return a&&this._proxyTracerProvider.setDelegate(e),a},u.prototype.getTracerProvider=function(){return Ks(ik)||this._proxyTracerProvider},u.prototype.getTracer=function(e,a){return this.getTracerProvider().getTracer(e,a)},u.prototype.disable=function(){_E(ik,kn.instance()),this._proxyTracerProvider=new Pj},u})(),s0=s4u.getInstance();const CJ=lA("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function l4u(u){return u.setValue(CJ,!0)}function hA(u){return u.getValue(CJ)===!0}const c4u="=",_y=";",Ly=",",ok="baggage",d4u=180,E4u=4096,p4u=8192;function m4u(u){return u.reduce((e,a)=>{const t=`${e}${e!==""?Ly:""}${a}`;return t.length>p4u?e:t},"")}function h4u(u){return u.getAllEntries().map(([e,a])=>{let t=`${encodeURIComponent(e)}=${encodeURIComponent(a.value)}`;return a.metadata!==void 0&&(t+=_y+a.metadata.toString()),t})}function x4u(u){const e=u.split(_y);if(e.length<=0)return;const a=e.shift();if(!a)return;const t=a.indexOf(c4u);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=hcu(e.join(_y))),{key:r,value:n,metadata:i}}class D4u{inject(e,a,t){const r=xd.getBaggage(e);if(!r||hA(e))return;const n=h4u(r).filter(o=>o.length<=E4u).slice(0,d4u),i=m4u(n);i.length>0&&t.set(a,ok,i)}extract(e,a,t){const r=t.get(a,ok),n=Array.isArray(r)?r.join(Ly):r;if(!n)return e;const i={};return n.length===0||(n.split(Ly).forEach(s=>{const l=x4u(s);if(l){const c={value:l.value};l.metadata&&(c.metadata=l.metadata),i[l.key]=c}}),Object.entries(i).length===0)?e:xd.setBaggage(e,xd.createBaggage(i))}fields(){return[ok]}}function kx(u){const e={};if(typeof u!="object"||u==null)return e;for(const[a,t]of Object.entries(u)){if(!f4u(a)){Iu.warn(`Invalid attribute key: ${a}`);continue}if(!FJ(t)){Iu.warn(`Invalid attribute value set for key: ${a}`);continue}Array.isArray(t)?e[a]=t.slice():e[a]=t}return e}function f4u(u){return typeof u=="string"&&u.length>0}function FJ(u){return u==null?!0:Array.isArray(u)?g4u(u):AJ(u)}function g4u(u){let e;for(const a of u)if(a!=null){if(!e){if(AJ(a)){e=typeof a;continue}return!1}if(typeof a!==e)return!1}return!0}function AJ(u){switch(typeof u){case"number":case"boolean":case"string":return!0}return!1}function v4u(){return u=>{Iu.error(k4u(u))}}function k4u(u){return typeof u=="string"?u:JSON.stringify(b4u(u))}function b4u(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 y4u=v4u();function Z1(u){try{y4u(u)}catch{}}const A1=performance,C4u="2.0.1",sk="exception.message",F4u="exception.stacktrace",lk="exception.type",BJ="service.name",A4u="service.version",Iy="telemetry.sdk.language",B4u="webjs",Ky="telemetry.sdk.name",Vy="telemetry.sdk.version",S4u="process.runtime.name",ck={[Ky]:"opentelemetry",[S4u]:"browser",[Iy]:B4u,[Vy]:C4u};const z4u=9,w4u=6,O4u=Math.pow(10,w4u),U5=Math.pow(10,z4u);function x1(u){const e=u/1e3,a=Math.trunc(e),t=Math.round(u%1e3*O4u);return[a,t]}function SJ(){let u=A1.timeOrigin;if(typeof u!="number"){const e=A1;u=e.timing&&e.timing.fetchStart}return u}function P4u(u){const e=x1(SJ()),a=x1(typeof u=="number"?u:A1.now());return wJ(e,a)}function j4u(u,e){let a=e[0]-u[0],t=e[1]-u[1];return t<0&&(a-=1,t+=U5),[a,t]}function M4u(u){return u[0]*U5+u[1]}function zJ(u){return Array.isArray(u)&&u.length===2&&typeof u[0]=="number"&&typeof u[1]=="number"}function jj(u){return zJ(u)||typeof u=="number"||u instanceof Date}function wJ(u,e){const a=[u[0]+e[0],u[1]+e[1]];return a[1]>=U5&&(a[1]-=U5,a[0]+=1),a}var Yr;(function(u){u[u.SUCCESS=0]="SUCCESS",u[u.FAILED=1]="FAILED"})(Yr||(Yr={}));class T4u{_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){Iu.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){Iu.warn(`Failed to extract with ${n.constructor.name}. Err: ${i.message}`)}return r},e)}fields(){return this._fields.slice()}}const Gy="[_0-9a-z-*/]",$4u=`[a-z]${Gy}{0,255}`,R4u=`[a-z0-9]${Gy}{0,240}@[a-z]${Gy}{0,13}`,N4u=new RegExp(`^(?:${$4u}|${R4u})$`),_4u=/^[ -~]{0,255}[!-~]$/,L4u=/,|=/;function I4u(u){return N4u.test(u)}function K4u(u){return _4u.test(u)&&!L4u.test(u)}const Mj=32,V4u=512,Tj=",",$j="=";class xA{_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+$j+this.get(a)),e),[]).join(Tj)}_parse(e){e.length>V4u||(this._internalState=e.split(Tj).reverse().reduce((a,t)=>{const r=t.trim(),n=r.indexOf($j);if(n!==-1){const i=r.slice(0,n),o=r.slice(n+1,t.length);I4u(i)&&K4u(o)&&a.set(i,o)}return a},new Map),this._internalState.size>Mj&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,Mj))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){const e=new xA;return e._internalState=new Map(this._internalState),e}}const dk="traceparent",Ek="tracestate",G4u="00",H4u="(?!ff)[\\da-f]{2}",q4u="(?![0]{32})[\\da-f]{32}",W4u="(?![0]{16})[\\da-f]{16}",J4u="[\\da-f]{2}",U4u=new RegExp(`^\\s?(${H4u})-(${q4u})-(${W4u})-(${J4u})(-.*)?\\s?$`);function Z4u(u){const e=U4u.exec(u);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}class Q4u{inject(e,a,t){const r=s0.getSpanContext(e);if(!r||hA(e)||!sg(r))return;const n=`${G4u}-${r.traceId}-${r.spanId}-0${Number(r.traceFlags||yi.NONE).toString(16)}`;t.set(a,dk,n),r.traceState&&t.set(a,Ek,r.traceState.serialize())}extract(e,a,t){const r=t.get(a,dk);if(!r)return e;const n=Array.isArray(r)?r[0]:r;if(typeof n!="string")return e;const i=Z4u(n);if(!i)return e;i.isRemote=!0;const o=t.get(a,Ek);if(o){const s=Array.isArray(o)?o.join(","):o;i.traceState=new xA(typeof s=="string"?s:void 0)}return s0.setSpanContext(e,i)}fields(){return[dk,Ek]}}const Y4u="[object Object]",X4u="[object Null]",edu="[object Undefined]",udu=Function.prototype,OJ=udu.toString,adu=OJ.call(Object),tdu=Object.getPrototypeOf,PJ=Object.prototype,jJ=PJ.hasOwnProperty,vs=Symbol?Symbol.toStringTag:void 0,MJ=PJ.toString;function Rj(u){if(!rdu(u)||ndu(u)!==Y4u)return!1;const e=tdu(u);if(e===null)return!0;const a=jJ.call(e,"constructor")&&e.constructor;return typeof a=="function"&&a instanceof a&&OJ.call(a)===adu}function rdu(u){return u!=null&&typeof u=="object"}function ndu(u){return u==null?u===void 0?edu:X4u:vs&&vs in Object(u)?idu(u):odu(u)}function idu(u){const e=jJ.call(u,vs),a=u[vs];let t=!1;try{u[vs]=void 0,t=!0}catch{}const r=MJ.call(u);return t&&(e?u[vs]=a:delete u[vs]),r}function odu(u){return MJ.call(u)}const sdu=20;function ldu(...u){let e=u.shift();const a=new WeakMap;for(;u.length>0;)e=TJ(e,u.shift(),0,a);return e}function pk(u){return Z5(u)?u.slice():u}function TJ(u,e,a=0,t){let r;if(!(a>sdu)){if(a++,bx(u)||bx(e)||$J(e))r=pk(e);else if(Z5(u)){if(r=u.slice(),Z5(e))for(let n=0,i=e.length;n<i;n++)r.push(pk(e[n]));else if(C4(e)){const n=Object.keys(e);for(let i=0,o=n.length;i<o;i++){const s=n[i];r[s]=pk(e[s])}}}else if(C4(u))if(C4(e)){if(!cdu(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(bx(l))typeof l>"u"?delete r[s]:r[s]=l;else{const c=r[s],d=l;if(Nj(u,s,t)||Nj(e,s,t))delete r[s];else{if(C4(c)&&C4(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]=TJ(r[s],l,a,t)}}}}else r=e;return r}}function Nj(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 Z5(u){return Array.isArray(u)}function $J(u){return typeof u=="function"}function C4(u){return!bx(u)&&!Z5(u)&&!$J(u)&&typeof u=="object"}function bx(u){return typeof u=="string"||typeof u=="number"||typeof u=="boolean"||typeof u>"u"||u instanceof Date||u instanceof RegExp||u===null}function cdu(u,e){return!(!Rj(u)||!Rj(e))}class ddu{_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 Edu{_callback;_that;_isCalled=!1;_deferred=new ddu;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 pdu(){return"unknown_service"}const Z4=u=>u!==null&&typeof u=="object"&&typeof u.then=="function";class Q5{_rawAttributes;_asyncAttributesPending=!1;_memoizedAttributes;static FromAttributeList(e){const a=new Q5({});return a._rawAttributes=_j(e),a._asyncAttributesPending=e.filter(([t,r])=>Z4(r)).length>0,a}constructor(e){const a=e.attributes??{};this._rawAttributes=Object.entries(a).map(([t,r])=>(Z4(r)&&(this._asyncAttributesPending=!0),[t,r])),this._rawAttributes=_j(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,Z4(t)?await t:t]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&Iu.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;const e={};for(const[a,t]of this._rawAttributes){if(Z4(t)){Iu.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:Q5.FromAttributeList([...e.getRawAttributes(),...this.getRawAttributes()])}}function RJ(u){return Q5.FromAttributeList(Object.entries(u))}function mdu(){return RJ({[BJ]:pdu(),[Iy]:ck[Iy],[Ky]:ck[Ky],[Vy]:ck[Vy]})}function _j(u){return u.map(([e,a])=>Z4(a)?[e,a.catch(t=>{Iu.debug("promise rejection for resource attribute: %s - %s",e,t)})]:[e,a])}const hdu="exception";class xdu{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;name;status={code:Ud.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=A1.now(),this._performanceOffset=a-(this._performanceStartTime+SJ()),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 Iu.warn(`Invalid attribute key: ${e}`),this;if(!FJ(a))return Iu.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 Iu.warn("No events allowed."),this._droppedEventsCount++,this;r!==void 0&&this.events.length>=r&&(this._droppedEventsCount===0&&Iu.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),jj(a)&&(jj(t)||(t=a),a=void 0);const n=kx(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"&&(Iu.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()){Iu.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=j4u(this.startTime,this.endTime),this._duration[0]<0&&(Iu.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&&Iu.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._spanProcessor.onEnd(this)}_getTime(e){if(typeof e=="number"&&e<=A1.now())return P4u(e+this._performanceOffset);if(typeof e=="number")return x1(e);if(e instanceof Date)return x1(e.getTime());if(zJ(e))return e;if(this._startTimeProvided)return x1(Date.now());const a=A1.now()-this._performanceStartTime;return wJ(this.startTime,x1(a))}isRecording(){return this._ended===!1}recordException(e,a){const t={};typeof e=="string"?t[sk]=e:e&&(e.code?t[lk]=e.code.toString():e.name&&(t[lk]=e.name),e.message&&(t[sk]=e.message),e.stack&&(t[F4u]=e.stack)),t[lk]||t[sk]?this.addEvent(hdu,t,a):Iu.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}}`);Iu.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?(Iu.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 Y5{shouldSample(){return{decision:Q1.NOT_RECORD}}toString(){return"AlwaysOffSampler"}}class B1{shouldSample(){return{decision:Q1.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}}class mh{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(e){this._root=e.root,this._root||(Z1(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new B1),this._remoteParentSampled=e.remoteParentSampled??new B1,this._remoteParentNotSampled=e.remoteParentNotSampled??new Y5,this._localParentSampled=e.localParentSampled??new B1,this._localParentNotSampled=e.localParentNotSampled??new Y5}shouldSample(e,a,t,r,n,i){const o=s0.getSpanContext(e);return!o||!sg(o)?this._root.shouldSample(e,a,t,r,n,i):o.isRemote?o.traceFlags&yi.SAMPLED?this._remoteParentSampled.shouldSample(e,a,t,r,n,i):this._remoteParentNotSampled.shouldSample(e,a,t,r,n,i):o.traceFlags&yi.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 Lj{_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:vJ(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 Ij=1;function NJ(){return{sampler:_J(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},spanLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128,linkCountLimit:128,eventCountLimit:128,attributePerEventCountLimit:128,attributePerLinkCountLimit:128}}}function _J(){const u="parentbased_always_on";switch(u){case"always_on":return new B1;case"always_off":return new Y5;case"parentbased_always_on":return new mh({root:new B1});case"parentbased_always_off":return new mh({root:new Y5});case"traceidratio":return new Lj(Kj());case"parentbased_traceidratio":return new mh({root:new Lj(Kj())});default:return Iu.error(`OTEL_TRACES_SAMPLER value "${u}" invalid, defaulting to "parentbased_always_on".`),new mh({root:new B1})}}function Kj(){return Iu.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${Ij}.`),Ij}const Ddu=128,fdu=1/0;function gdu(u){const e={sampler:_J()},a=NJ(),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 vdu(u){const e=Object.assign({},u.spanLimits);return e.attributeCountLimit=u.spanLimits?.attributeCountLimit??u.generalLimits?.attributeCountLimit??void 0??void 0??Ddu,e.attributeValueLengthLimit=u.spanLimits?.attributeValueLengthLimit??u.generalLimits?.attributeValueLengthLimit??void 0??void 0??fdu,Object.assign({},u,{spanLimits:e})}class kdu{_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 Edu(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(Iu.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&yi.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&&Iu.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(Iu.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);Ei.with(l4u(Ei.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===Yr.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=>{Z1(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,Z1(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 bdu extends kdu{_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=>{Z1(a)})},this._pageHideListener=()=>{this.forceFlush().catch(a=>{Z1(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 ydu=8,Cdu=16;class Fdu{generateTraceId=Vj(Cdu);generateSpanId=Vj(ydu)}const hh=Array(32);function Vj(u){return function(){for(let a=0;a<u*2;a++)hh[a]=Math.floor(Math.random()*16)+48,hh[a]>=58&&(hh[a]+=39);return String.fromCharCode.apply(null,hh.slice(0,u*2))}}class Adu{_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;constructor(e,a,t,r){const n=gdu(a);this._sampler=n.sampler,this._generalLimits=n.generalLimits,this._spanLimits=n.spanLimits,this._idGenerator=a.idGenerator||new Fdu,this._resource=t,this._spanProcessor=r,this.instrumentationScope=e}startSpan(e,a={},t=Ei.active()){a.root&&(t=s0.deleteSpan(t));const r=s0.getSpan(t);if(hA(t))return Iu.debug("Instrumentation suppressed, returning Noop Span"),s0.wrapSpanContext(fJ);const n=r?.spanContext(),i=this._idGenerator.generateSpanId();let o,s,l;!n||!s0.isSpanContextValid(n)?s=this._idGenerator.generateTraceId():(s=n.traceId,l=n.traceState,o=n);const c=a.kind??Ny.INTERNAL,d=(a.links??[]).map(f=>({context:f.context,attributes:kx(f.attributes)})),E=kx(a.attributes),p=this._sampler.shouldSample(t,s,e,c,E,d);l=p.traceState??l;const x=p.decision===J5.RECORD_AND_SAMPLED?yi.SAMPLED:yi.NONE,m={traceId:s,spanId:i,traceFlags:x,traceState:l};if(p.decision===J5.NOT_RECORD)return Iu.debug("Recording is off, propagating context in a non-recording span"),s0.wrapSpanContext(m);const g=kx(Object.assign(E,p.attributes));return new xdu({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??Ei.active(),l=this.startSpan(e,n,s),c=s0.setSpan(s,l);return Ei.with(c,o,void 0,l)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}}class Bdu{_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=>{Z1(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 ks;(function(u){u[u.resolved=0]="resolved",u[u.timeout=1]="timeout",u[u.error=2]="error",u[u.unresolved=3]="unresolved"})(ks||(ks={}));class Sdu{_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(e={}){const a=ldu({},NJ(),vdu(e));this._resource=a.resource??mdu(),this._config=Object.assign({},a,{resource:this._resource});const t=[];e.spanProcessors?.length&&t.push(...e.spanProcessors),this._activeSpanProcessor=new Bdu(t)}getTracer(e,a,t){const r=`${e}@${a||""}:${t?.schemaUrl||""}`;return this._tracers.has(r)||this._tracers.set(r,new Adu({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=ks.timeout},e);t.forceFlush().then(()=>{clearTimeout(i),n!==ks.timeout&&(n=ks.resolved,r(n))}).catch(o=>{clearTimeout(i),n=ks.error,r(o)})}));return new Promise((t,r)=>{Promise.all(a).then(n=>{const i=n.filter(o=>o!==ks.resolved);i.length>0?r(i):t()}).catch(n=>r([n]))})}shutdown(){return this._activeSpanProcessor.shutdown()}}class zdu{_enabled=!1;_currentContext=o1;_bindFunction(e=o1,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=o1,this._enabled=!1,this}enable(){return this._enabled?this:(this._enabled=!0,this._currentContext=o1,this)}with(e,a,t,...r){const n=this._currentContext;this._currentContext=e||o1;try{return a.call(t,...r)}finally{this._currentContext=n}}}function wdu(u){if(u!==null){if(u===void 0){const e=new zdu;e.enable(),Ei.setGlobalContextManager(e);return}u.enable(),Ei.setGlobalContextManager(u)}}function Odu(u){if(u!==null){if(u===void 0){xd.setGlobalPropagator(new T4u({propagators:[new Q4u,new D4u]}));return}xd.setGlobalPropagator(u)}}class Pdu extends Sdu{constructor(e={}){super(e)}register(e={}){s0.setGlobalTracerProvider(this),Odu(e.propagator),wdu(e.contextManager)}}class jdu{_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 Gj extends Error{code;name="OTLPExporterError";data;constructor(e,a,t){super(e),this.data=t,this.code=a}}function Mdu(u){if(Number.isFinite(u)&&u>0)return u;throw new Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${u}')`)}function Tdu(u){if(u!=null)return()=>u}function $du(u,e,a){return{timeoutMillis:Mdu(u.timeoutMillis??e.timeoutMillis??a.timeoutMillis),concurrencyLimit:u.concurrencyLimit??e.concurrencyLimit??a.concurrencyLimit,compression:u.compression??e.compression??a.compression}}function Rdu(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:"none"}}class Ndu{_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 _du(u){return new Ndu(u.concurrencyLimit)}function Ldu(u){return Object.prototype.hasOwnProperty.call(u,"partialSuccess")}function Idu(){return{handleResponse(u){u==null||!Ldu(u)||u.partialSuccess==null||Object.keys(u.partialSuccess).length===0||Iu.warn("Received Partial Success response:",JSON.stringify(u.partialSuccess))}}}class Kdu{_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=Iu.createComponentLogger({namespace:"OTLPExportDelegate"})}export(e,a){if(this._diagLogger.debug("items to be sent",e),this._promiseQueue.hasReachedLimit()){a({code:Yr.FAILED,error:new Error("Concurrent export limit reached")});return}const t=this._serializer.serializeRequest(e);if(t==null){a({code:Yr.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:Yr.SUCCESS});return}else if(r.status==="failure"&&r.error){a({code:Yr.FAILED,error:r.error});return}else r.status==="retryable"?a({code:Yr.FAILED,error:new Gj("Export failed with retryable status")}):a({code:Yr.FAILED,error:new Gj("Export failed with unknown error")})},r=>a({code:Yr.FAILED,error:r})))}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug("shutdown started"),await this.forceFlush(),this._transport.shutdown()}}function Vdu(u,e){return new Kdu(u.transport,u.serializer,Idu(),u.promiseHandler,e.timeout)}function LJ(u,e,a){return Vdu({transport:a,serializer:e,promiseHandler:_du(u)},{timeout:u.timeoutMillis})}function Hj(u){return u>=48&&u<=57?u-48:u>=97&&u<=102?u-87:u-55}function IJ(u){const e=new Uint8Array(u.length/2);let a=0;for(let t=0;t<u.length;t+=2){const r=Hj(u.charCodeAt(t)),n=Hj(u.charCodeAt(t+1));e[a++]=r<<4|n}return e}function KJ(u){const e=BigInt(1e9);return BigInt(u[0])*e+BigInt(u[1])}function Gdu(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=KJ(u);return Gdu(e)}function qdu(u){return KJ(u).toString()}const Wdu=typeof BigInt<"u"?qdu:M4u;function qj(u){return u}function Jdu(u){if(u!==void 0)return IJ(u)}const Udu={encodeHrTime:Hdu,encodeSpanContext:IJ,encodeOptionalSpanContext:Jdu};function Zdu(u){return u===void 0?Udu:{encodeHrTime:Wdu,encodeSpanContext:qj,encodeOptionalSpanContext:qj}}function Qdu(u){return{attributes:lg(u.attributes),droppedAttributesCount:0}}function Ydu(u){return{name:u.name,version:u.version}}function lg(u){return Object.keys(u).map(e=>VJ(e,u[e]))}function VJ(u,e){return{key:u,value:GJ(e)}}function GJ(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(GJ)}}:e==="object"&&u!=null?{kvlistValue:{values:Object.entries(u).map(([a,t])=>VJ(a,t))}}:{}}function Xdu(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:lg(u.attributes),droppedAttributesCount:u.droppedAttributesCount,events:u.events.map(n=>uEu(n,e)),droppedEventsCount:u.droppedEventsCount,status:{code:t.code,message:t.message},links:u.links.map(n=>eEu(n,e)),droppedLinksCount:u.droppedLinksCount}}function eEu(u,e){return{attributes:u.attributes?lg(u.attributes):[],spanId:e.encodeSpanContext(u.context.spanId),traceId:e.encodeSpanContext(u.context.traceId),traceState:u.context.traceState?.serialize(),droppedAttributesCount:u.droppedAttributesCount||0}}function uEu(u,e){return{attributes:u.attributes?lg(u.attributes):[],name:u.name,timeUnixNano:e.encodeHrTime(u.time),droppedAttributesCount:u.droppedAttributesCount||0}}function aEu(u,e){const a=Zdu(e);return{resourceSpans:rEu(u,a)}}function tEu(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 rEu(u,e){const a=tEu(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=>Xdu(x,e));s.push({scope:Ydu(E[0].instrumentationScope),spans:p,schemaUrl:E[0].instrumentationScope.schemaUrl})}c=l.next()}const d={resource:Qdu(i),scopeSpans:s,schemaUrl:void 0};t.push(d),n=r.next()}return t}const nEu={serializeRequest:u=>{const e=aEu(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))}},iEu=5,oEu=1e3,sEu=5e3,lEu=1.5,Wj=.2;function cEu(){return Math.random()*(2*Wj)-Wj}class dEu{_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=iEu,i=oEu;for(;r.status==="retryable"&&n>0;){n--;const o=Math.max(Math.min(i,sEu)+cEu(),0);i=i*lEu;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 HJ(u){return new dEu(u.transport)}function EEu(u){return[429,502,503,504].includes(u)}function pEu(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 mEu{_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?(Iu.debug("XHR success"),t({status:"success"})):r.status&&EEu(r.status)?t({status:"retryable",retryInMillis:pEu(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 hEu(u){return new mEu(u)}class xEu{_params;constructor(e){this._params=e}send(e){return new Promise(a=>{navigator.sendBeacon(this._params.url,new Blob([e],{type:this._params.blobType}))?(Iu.debug("SendBeacon success"),a({status:"success"})):a({status:"failure",error:new Error("SendBeacon failed")})})}shutdown(){}}function DEu(u){return new xEu(u)}function fEu(u,e){return LJ(u,e,HJ({transport:hEu(u)}))}function gEu(u,e){return LJ(u,e,HJ({transport:DEu({url:u.url,blobType:u.headers()["Content-Type"]})}))}function vEu(u){return()=>{const e={};return Object.entries(u?.()??{}).forEach(([a,t])=>{typeof t<"u"?e[a]=String(t):Iu.warn(`Header "${a}" has invalid value (${t}) and will be ignored`)}),e}}function kEu(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 bEu(u){if(u!=null)try{return new URL(u),u}catch{throw new Error(`Configuration: Could not parse user-provided export URL: '${u}'`)}}function yEu(u,e,a){return{...$du(u,e,a),headers:kEu(vEu(u.headers),e.headers,a.headers),url:bEu(u.url)??e.url??a.url,agentOptions:u.agentOptions??e.agentOptions??a.agentOptions}}function CEu(u,e){return{...Rdu(),headers:()=>u,url:"http://localhost:4318/"+e,agentOptions:{keepAlive:!0}}}function FEu(u,e,a){return yEu({url:u.url,timeoutMillis:u.timeoutMillis,headers:Tdu(u.headers),concurrencyLimit:u.concurrencyLimit},{},CEu(a,e))}function AEu(u,e,a,t){const r=!!u.headers||typeof navigator.sendBeacon!="function",n=FEu(u,a,t);return r?fEu(n,e):gEu(n,e)}class BEu extends jdu{constructor(e={}){super(AEu(e,nEu,"v1/traces",{"Content-Type":"application/json"}))}}class qJ{emit(e){}}const SEu=new qJ;class zEu{getLogger(e,a,t){return new qJ}}const WJ=new zEu;class wEu{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):SEu}}class Jj{getLogger(e,a,t){var r;return(r=this.getDelegateLogger(e,a,t))!==null&&r!==void 0?r:new wEu(this,e,a,t)}getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:WJ}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 OEu=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{},xh=Symbol.for("io.opentelemetry.js.api.logs"),F4=OEu;function PEu(u,e,a){return t=>t===u?e:a}const Uj=1;class DA{constructor(){this._proxyLoggerProvider=new Jj}static getInstance(){return this._instance||(this._instance=new DA),this._instance}setGlobalLoggerProvider(e){return F4[xh]?this.getLoggerProvider():(F4[xh]=PEu(Uj,e,WJ),this._proxyLoggerProvider.setDelegate(e),e)}getLoggerProvider(){var e,a;return(a=(e=F4[xh])===null||e===void 0?void 0:e.call(F4,Uj))!==null&&a!==void 0?a:this._proxyLoggerProvider}getLogger(e,a,t){return this.getLoggerProvider().getLogger(e,a,t)}disable(){delete F4[xh],this._proxyLoggerProvider=new Jj}}const JJ=DA.getInstance();function jEu(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 MEu(u){u.forEach(e=>e.disable())}function TEu(u){const e=u.tracerProvider||s0.getTracerProvider(),a=u.meterProvider||bJ.getMeterProvider(),t=u.loggerProvider||JJ.getLoggerProvider(),r=u.instrumentations?.flat()??[];return jEu(r,e,a,t),()=>{MEu(r)}}let j0=console.error.bind(console);function A4(u,e,a){const t=!!u[e]&&Object.prototype.propertyIsEnumerable.call(u,e);Object.defineProperty(u,e,{configurable:!0,enumerable:t,writable:!0,value:a})}const UJ=(u,e,a)=>{if(!u||!u[e]){j0("no original function "+String(e)+" to wrap");return}if(!a){j0("no wrapper function"),j0(new Error().stack);return}const t=u[e];if(typeof t!="function"||typeof a!="function"){j0("original object and wrapper must be functions");return}const r=a(t,e);return A4(r,"__original",t),A4(r,"__unwrap",()=>{u[e]===r&&A4(u,e,t)}),A4(r,"__wrapped",!0),A4(u,e,r),r},$Eu=(u,e,a)=>{if(u)Array.isArray(u)||(u=[u]);else{j0("must provide one or more modules to patch"),j0(new Error().stack);return}if(!(e&&Array.isArray(e))){j0("must provide one or more functions to wrap on modules");return}u.forEach(t=>{e.forEach(r=>{UJ(t,r,a)})})},ZJ=(u,e)=>{if(!u||!u[e]){j0("no function to unwrap."),j0(new Error().stack);return}const a=u[e];if(!a.__unwrap)j0("no original to unwrap to -- has "+String(e)+" already been unwrapped?");else{a.__unwrap();return}},REu=(u,e)=>{if(u)Array.isArray(u)||(u=[u]);else{j0("must provide one or more modules to patch"),j0(new Error().stack);return}if(!(e&&Array.isArray(e))){j0("must provide one or more functions to unwrap on modules");return}u.forEach(a=>{e.forEach(t=>{ZJ(a,t)})})};class NEu{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(e,a,t){this.instrumentationName=e,this.instrumentationVersion=a,this.setConfig(t),this._diag=Iu.createComponentLogger({namespace:e}),this._tracer=s0.getTracer(e,a),this._meter=bJ.getMeter(e,a),this._logger=JJ.getLogger(e,a),this._updateMetricInstruments()}_wrap=UJ;_unwrap=ZJ;_massWrap=$Eu;_massUnwrap=REu;get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){const e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,a,t,r){if(e)try{e(t,r)}catch(n){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:a},n)}}}class _Eu extends NEu{constructor(e,a,t){super(e,a,t),this._config.enabled&&this.enable()}}class LEu{span=void 0;constructor(e){this.span=e}get context(){return this.span?.context}error(e){this.span&&(this.span.setStatus(Ud.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(Ud.OK),this.span.end())}}class IEu{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":W5(),"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=s0.setSpan(Ei.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=Ei.active(),t=e.time?new Date(e.time):new Date,r=this.tracer.startSpan(`event.${e.type}`,{attributes:this.processAttributes(e,t)},a),n=s0.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 LEu(a)}async forceFlush(){return this.tracerProvider?.forceFlush()}async shutdown(){return this.tracerProvider?.shutdown()}getKeySnakeValue=e=>e.replace(/([A-Z])/g,"_$1").toLowerCase()}class KEu extends IEu{tracerProvider=null;tracer=null;initialized=!1;constructor(){super()}initTracer(e){if(!e.collectorUrl&&!e.collectorTraceUrl)return;const a=`ses_${W5()}`,t=RJ({[BJ]:e.serviceName,[A4u]:e.serviceVersion,session_id:a}),r=e.collectorTraceUrl||`${e.collectorUrl}/v1/traces`;this.tracerProvider=new Pdu({resource:t,spanProcessors:[new bdu(new BEu({url:r,headers:{}}))]}),this.tracer=this.tracerProvider.getTracer(e.tracerName),this.tracerProvider.register(),TEu({instrumentations:e.instrumentations??[]}),this.initialized=!0}}class oi extends _Eu{sendErrorEvent;originalConsoleError;constructor(e,a){super("errors","1.0",e||{}),this.sendErrorEvent=a}static toErrorEvent(e,a){return{type:"error",payload:{handler:a,errorType:oi.getErrorType(e),message:oi.getErrorMessage(e),stack:oi.getErrorStack(e)}}}enable(){window.addEventListener("error",this.onError),window.addEventListener("unhandledrejection",this.onUnhandledRejection),this.wrapConsoleError()}disable(){window.removeEventListener("error",this.onError),window.removeEventListener("unhandledrejection",this.onUnhandledRejection),this.unwrapConsoleError()}init(){}static getErrorMessage(e){return e?(typeof e=="object"&&"message"in e?String(e.message):String(e)).trim():void 0}static getErrorStack(e){if(!e||typeof e!="object"||!("stack"in e)||!e.stack)return;const a=String(e.stack);return a.length>4096?a.substring(0,4096):a}static getErrorType(e){return!e||typeof e!="object"?typeof e:"name"in e?String(e.name):"constructor"in e&&"name"in e.constructor?String(e.constructor.name):"Error"}static combineConsoleErrorArgs(e){const a=e.findIndex(r=>r instanceof Error),t=e.filter((r,n)=>n!==a).map(r=>String(r)).join(" ");if(a===-1)return t;{const r=e[a];return t&&(r.message=`${r.message} ${t}`),r}}onError=e=>{this.sendError(e.error,"window.onerror")};onUnhandledRejection=e=>{this.sendError(e.reason,"window.onunhandledrejection")};wrapConsoleError(){this.originalConsoleError=console.error,console.error=(...e)=>{try{const a=oi.combineConsoleErrorArgs(e);this.sendError(a,"console.error")}catch(a){process.env.NODE_ENV!=="production"&&this.originalConsoleError?.call(console,"Error reporting failed:",a)}this.originalConsoleError?.apply(console,e)}}unwrapConsoleError(){this.originalConsoleError&&(console.error=this.originalConsoleError,this.originalConsoleError=void 0)}sendError(e,a){this.sendErrorEvent(oi.toErrorEvent(e,a))}}class VEu{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 KEu,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.enableErrorInstrumentation===!0?[new oi(void 0,a=>{this.sendErrorMessage(a.payload)})]:[],...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_${W5()}`,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_${W5()}`,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()}shutdown(){return this.config?.disabled?Promise.resolve():this.otelClient.shutdown()}sendError(e,a){this.config?.disabled||this.send(oi.toErrorEvent(e,a).type,oi.toErrorEvent(e,a).payload)}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)}sendErrorMessage(e){this.send("error",e)}}const GEu=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],HEu="https://cors.redocly.com/";function qEu(u,e,a){return e in u?Object.defineProperty(u,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):u[e]=a,u}function Zj(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 Qj(u){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Zj(Object(a),!0).forEach(function(t){qEu(u,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(a)):Zj(Object(a)).forEach(function(t){Object.defineProperty(u,t,Object.getOwnPropertyDescriptor(a,t))})}return u}function dt(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 Yj=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),mk=function(){return Math.random().toString(36).substring(7).split("").join(".")},ko={INIT:"@@redux/INIT"+mk(),REPLACE:"@@redux/REPLACE"+mk(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+mk()}};function QJ(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 WEu(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(ZEu(u))return"date";if(UEu(u))return"error";var a=JEu(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 JEu(u){return typeof u.constructor=="function"?u.constructor.name:null}function UEu(u){return u instanceof Error||typeof u.message=="string"&&u.constructor&&typeof u.constructor.stackTraceLimit=="number"}function ZEu(u){return u instanceof Date?!0:typeof u.toDateString=="function"&&typeof u.getDate=="function"&&typeof u.setDate=="function"}function to(u){var e=typeof u;return process.env.NODE_ENV!=="production"&&(e=WEu(u)),e}function cg(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"?dt(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"?dt(1):"Expected the enhancer to be a function. Instead, received: '"+to(a)+"'");return a(cg)(u,e)}if(typeof u!="function")throw new Error(process.env.NODE_ENV==="production"?dt(2):"Expected the root reducer to be a function. Instead, received: '"+to(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"?dt(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"?dt(4):"Expected the listener to be a function. Instead, received: '"+to(m)+"'");if(s)throw new Error(process.env.NODE_ENV==="production"?dt(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"?dt(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(!QJ(m))throw new Error(process.env.NODE_ENV==="production"?dt(7):"Actions must be plain objects. Instead, the actual type was: '"+to(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"?dt(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"?dt(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"?dt(10):"Expected the nextReducer to be a function. Instead, received: '"+to(m));r=m,E({type:ko.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"?dt(11):"Expected the observer to be an object. Instead, received: '"+to(f)+"'");function k(){f.next&&f.next(c())}k();var y=g(k);return{unsubscribe:y}}},m[Yj]=function(){return this},m}return E({type:ko.INIT}),t={dispatch:E,subscribe:d,getState:c,replaceReducer:p},t[Yj]=x,t}var QEu=cg;function Hy(u){typeof console<"u"&&typeof console.error=="function"&&console.error(u);try{throw new Error(u)}catch{}}function YEu(u,e,a,t){var r=Object.keys(e),n=a&&a.type===ko.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(!QJ(u))return"The "+n+' has unexpected type of "'+to(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===ko.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 XEu(u){Object.keys(u).forEach(function(e){var a=u[e],t=a(void 0,{type:ko.INIT});if(typeof t>"u")throw new Error(process.env.NODE_ENV==="production"?dt(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:ko.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?dt(13):'The slice reducer for key "'+e+'" returned undefined when probed with a random type. '+("Don't try to handle '"+ko.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 e3u(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"&&Hy('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{XEu(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=YEu(l,a,c,i);d&&Hy(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"?dt(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 Xj(u,e){return function(){return e(u.apply(this,arguments))}}function u3u(u,e){if(typeof u=="function")return Xj(u,e);if(typeof u!="object"||u===null)throw new Error(process.env.NODE_ENV==="production"?dt(16):"bindActionCreators expected an object or a function, but instead received: '"+to(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]=Xj(r,e))}return a}function YJ(){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 a3u(){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"?dt(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=YJ.apply(void 0,o)(r.dispatch),Qj(Qj({},r),{},{dispatch:n})}}}function eM(){}process.env.NODE_ENV!=="production"&&typeof eM.name=="string"&&eM.name!=="isCrushed"&&Hy('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 t3u=Object.freeze({__proto__:null,__DO_NOT_USE__ActionTypes:ko,applyMiddleware:a3u,bindActionCreators:u3u,combineReducers:e3u,compose:YJ,createStore:cg,legacy_createStore:QEu});function r3u(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 n3u=r3u(t3u);n3u.compose;var i3u=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(u){return u}};function o3u(u,e,a){var t=!1,r=!1,n=cg(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})},i3u({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 s3u(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=o3u(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 LE="default",XJ=[{name:LE,inputs:[],servers:[],state:Nu.Normal}],eU={activeTabIdx:0,tabs:[]};var Zr=(u=>(u.Idle="idle",u.Loading="loading",u.Success="success",u.Error="error",u))(Zr||{});function pi(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 qy(u,e){if(u===e)return!0;if(u&&e&&typeof u=="object"&&typeof e=="object"){if(Array.isArray(u)&&Array.isArray(e)){if(u.length!==e.length)return!1;for(let r=0;r<u.length;r++)if(!qy(u[r],e[r]))return!1;return!0}const a=Object.keys(u),t=Object.keys(e);if(a.length!==t.length)return!1;for(let r=0;r<a.length;r++){const n=a[r];if(!Object.prototype.hasOwnProperty.call(e,n)||!qy(u[n],e[n]))return!1}return!0}return u!==u&&e!==e}function uM(u){return Object.keys(u).forEach(e=>{u[e]===void 0&&delete u[e]}),u}const hn={FS:"fs",WEB:"web"};function Ac(){return!!window?.__TAURI__}class Ea{static utils=null;static async getUtils(){return Ea.utils||(Ea.utils=Ac()?await Promise.resolve().then(()=>require("./replay-tauri-path-BSH3mlBY.js")):await Promise.resolve().then(()=>hne)),Ea.utils}static async dirname(e){return(await Ea.getUtils()).dirname(e)}static async join(...e){return(await Ea.getUtils()).join(...e)}static async resolve(e){return(await Ea.getUtils()).resolve(e)}static async isAbsolute(e){return(await Ea.getUtils()).isAbsolute(e)}static async relative(e,a){return(await Ea.getUtils()).relative(e,a)}static async extname(e){return(await Ea.getUtils()).extname(e)}}async function Lt(u,e={},a){return window.__TAURI_INTERNALS__.invoke(u,e,a)}var X5;(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"})(X5||(X5={}));async function l3u(){return Lt("plugin:path|resolve_directory",{directory:X5.AppData})}async function c3u(){return Lt("plugin:path|resolve_directory",{directory:X5.Desktop})}function uU(){return window.__TAURI_INTERNALS__.plugins.path.sep}async function d3u(...u){return Lt("plugin:path|resolve",{paths:u})}async function Dd(...u){return Lt("plugin:path|join",{paths:u})}async function E3u(u){return Lt("plugin:path|dirname",{path:u})}async function p3u(u){return Lt("plugin:path|extname",{path:u})}async function aU(u,e){return Lt("plugin:path|basename",{path:u,ext:e})}async function m3u(u){return Lt("plugin:path|is_absolute",{path:u})}var aM;(function(u){u[u.Start=0]="Start",u[u.Current=1]="Current",u[u.End=2]="End"})(aM||(aM={}));async function tM(u,e){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");await Lt("plugin:fs|mkdir",{path:u instanceof URL?u.toString():u,options:e})}async function tU(u,e){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");return await Lt("plugin:fs|read_dir",{path:u instanceof URL?u.toString():u,options:e})}async function h3u(u,e){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");const a=await Lt("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 fA(u,e){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");return await Lt("plugin:fs|read_text_file",{path:u instanceof URL?u.toString():u,options:e})}async function x3u(u,e){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");await Lt("plugin:fs|remove",{path:u instanceof URL?u.toString():u,options:e})}async function D3u(u,e,a){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");await Lt("plugin:fs|write_text_file",{path:u instanceof URL?u.toString():u,data:e,options:a})}async function rU(u,e){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");return await Lt("plugin:fs|exists",{path:u instanceof URL?u.toString():u,options:e})}const mi=window.__TAURI__?.http.fetch??globalThis.fetch;function yx(u){return/(?:^[a-z][a-z0-9+.-]*:|\/\/)/i.test(u)}function eD(u){return u.endsWith("/")?u.substring(0,u.length-1):u}function f3u(u){return u.startsWith("/")?u.substring(1):u}function g3u(u){try{const e=new URL(u);return e.search="",e.hash="",e.toString()}catch{return u}}class nU extends Hf{constructor(){super()}resolveExternalRef(e,a){return yx(a)?a:e&&yx(e)?new URL(a,e).href:e?Ls.resolve(Ls.dirname(e),a):a}async loadExternalRef(e){if(yx(e)){const{body:a,mimeType:t}=await aK(e,{...this.config.http,customFetch:mi});return new H1(e,a,t)}else{if(!await rU(e))throw new Error(`File not found at ${e}.`);try{throw await tU(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 fA(e);return new H1(e,t.replace(/\r\n/g,`
476
476
  `))}}}async function rM(u,e){const a=new $f({});a.getRulesForSpecVersion=()=>[];const t=await Ea.dirname(u),r={config:a,base:t,externalRefResolver:new nU,dereference:!0};e?r.doc={source:{absoluteRef:u},parsed:e}:r.ref=u;const{bundle:{parsed:n}}=await QH(r);return n}function iU(u){return/^https?:\/\//i.test(u)}function v3u(u,e){let a;if(e.startsWith("//")){const{protocol:t}=new URL(u);a=`${t||"https:"}${e}`}else if(yx(e))a=e;else if(!e.startsWith("/"))a=eD(u)+"/"+e;else{const t=new URL(u);t.pathname=e,a=t.toString()}return eD(a)}function uD(u,e){let a=u;return e.forEach(({key:t,value:r,active:n})=>{r&&n&&(a=a.replaceAll(`{${t}}`,r))}),a}function gA(u,e){let a=u;return e.forEach(({name:t,value:r})=>{r&&(a=a.replaceAll(`{${t}}`,r))}),a}function k3u(u){return u.startsWith("http://")||u.startsWith("https://")}function Dh({url:u,serverUrl:e,corsProxyUrl:a}){const t=k3u(u)||!e?u:`${eD(e)}/${f3u(u)}`;return a?`${a}${t}`:t}class nM{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 b3u{baseDir="";async ls(e=""){return[]}async get(e){return null}async set(e,a){}async remove(e){}}const y3u=new Set(["node_modules"]);class iM{constructor(e){this.baseDir=e,this.initializeDirectory(e)}async initializeDirectory(e){await tM(e,{recursive:!0})}async ls(e){const a=await this.getFullPath(e);return this.getDirEntryFilesRecursively(a)}async getDirEntryFilesRecursively(e){try{const a=[],t=await tU(e);for(const r of t)if(r.isDirectory){if(y3u.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 Ea.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 fA(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=uU(),n=t.split(r).slice(0,-1).join(r);await tM(n,{recursive:!0}),await D3u(t,a)}async remove(e){const a=await this.getFullPath(e);try{await x3u(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 C3u{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 oU{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!==hn.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 F3u extends oU{parse(e){return{...e.content,id:e.uri,srcType:e.type}}async stringify(e){const{id:a,srcType:t,...r}=e;return await Ea.extname(a)===".json"?JSON.stringify(r,null,2):Ao.dump(r)}}var wt=(u=>(u.SIMPLE="simple",u.REGEX="regex",u.JSONPATH="jsonpath",u.XPATH="xpath",u))(wt||{});const sU=1024;let A3u=0,Z0=class{constructor(e,a){this.from=e,this.to=a}};class vu{constructor(e={}){this.id=A3u++,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=Qt.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 Zd{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 B3u=Object.create(null);class Qt{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):B3u,t=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new Qt(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}}}}Qt.none=new Qt("",Object.create(null),0,8);class vA{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 Qt(t.name,r,t.id,t.flags):t)}return new vA(a)}}const fh=new WeakMap,oM=new WeakMap;var pa;(function(u){u[u.ExcludeBuffers=1]="ExcludeBuffers",u[u.IncludeAnonymous=2]="IncludeAnonymous",u[u.IgnoreMounts=4]="IgnoreMounts",u[u.IgnoreOverlays=8]="IgnoreOverlays"})(pa||(pa={}));let Va=class Wy{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=Zd.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 aD(this.topNode,e)}cursorAt(e,a=0,t=0){let r=fh.get(this)||this.topNode,n=new aD(r);return n.moveTo(e,a),fh.set(this,n._tree),n}get topNode(){return new ar(this,0,0,null)}resolve(e,a=0){let t=Qd(fh.get(this)||this.topNode,e,a,!1);return fh.set(this,t),t}resolveInner(e,a=0){let t=Qd(oM.get(this)||this.topNode,e,a,!0);return oM.set(this,t),t}resolveStack(e,a=0){return w3u(this,e,a)}iterate(e){let{enter:a,leave:t,from:r=0,to:n=this.length}=e,i=e.mode||0,o=(i&pa.IncludeAnonymous)>0;for(let s=this.cursor(i|pa.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:yA(Qt.none,this.children,this.positions,0,this.children.length,0,this.length,(a,t,r)=>new Wy(this.type,a,t,r,this.propValues),e.makeTree||((a,t,r)=>new Wy(Qt.none,a,t,r)))}static build(e){return O3u(e)}};Va.empty=new Va(Qt.none,[],[],0);class kA{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 kA(this.buffer,this.index)}}class zo{constructor(e,a,t){this.buffer=e,this.length=a,this.set=t}get type(){return Qt.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&&!(lU(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 zo(n,i,this.set)}}function lU(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 Qd(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 ar&&u.index<0?null:u.parent;if(!i)return u;u=i}let n=t?0:pa.IgnoreOverlays;if(t)for(let i=u,o=i.parent;o;i=o,o=i.parent)i instanceof ar&&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 cU{cursor(e=0){return new aD(this,e)}getChild(e,a=null,t=null){let r=sM(this,e,a,t);return r.length?r[0]:null}getChildren(e,a=null,t=null){return sM(this,e,a,t)}resolve(e,a=0){return Qd(this,e,a,!1)}resolveInner(e,a=0){return Qd(this,e,a,!0)}matchContext(e){return Jy(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 ar=class Cx extends cU{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(lU(r,t,d,d+c.length)){if(c instanceof zo){if(n&pa.ExcludeBuffers)continue;let E=c.findChild(0,c.buffer.length,a,t-d,r);if(E>-1)return new on(new S3u(i,c,e,d),null,E)}else if(n&pa.IncludeAnonymous||!c.type.isAnonymous||bA(c)){let E;if(!(n&pa.IgnoreMounts)&&(E=Zd.get(c))&&!E.overlay)return new Cx(E.tree,d,e,i);let p=new Cx(c,d,e,i);return n&pa.IncludeAnonymous||!p.type.isAnonymous?p:p.nextChild(a<0?c.children.length-1:0,a,t,r)}}}if(n&pa.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&pa.IgnoreOverlays)&&(r=Zd.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 Cx(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 sM(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 Jy(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 S3u{constructor(e,a,t,r){this.parent=e,this.buffer=a,this.index=t,this.start=r}}class on extends cU{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 on(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&pa.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 on(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 on(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 on(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 dU(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 ar&&a.index<0?null:a.parent,r=u.slice();return t?r[e]=t:r.splice(e,1),new z3u(r,a)}class z3u{constructor(e,a){this.heads=e,this.node=a}get next(){return dU(this.heads)}}function w3u(u,e,a){let t=u.resolveInner(e,a),r=null;for(let n=t instanceof ar?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=Zd.get(n.tree);if(i&&i.overlay&&i.overlay[0].from<=e&&i.overlay[i.overlay.length-1].to>=e){let o=new ar(i.tree,i.overlay[0].from+n.from,-1,n);(r||(r=[t])).push(Qd(o,e,a,!1))}}return r?dU(r):t}class aD{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 ar)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 ar?(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&pa.ExcludeBuffers?!1:this.enterChild(1,e,a):this.yield(this._tree.enter(e,a,t))}parent(){if(!this.buffer)return this.yieldNode(this.mode&pa.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&pa.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&pa.IncludeAnonymous||o instanceof zo||!o.type.isAnonymous||bA(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 on(this.buffer,a,this.stack[r]);return this.bufferNode=new on(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 Jy(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 Jy(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 bA(u){return u.children.some(e=>e instanceof zo||!e.type.isAnonymous||bA(e))}function O3u(u){var e;let{buffer:a,nodeSet:t,maxBufferLength:r=sU,reused:n=[],minRepeatType:i=t.types.length}=u,o=Array.isArray(a)?new kA(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 zo(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=yA(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 zo(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 lM=new WeakMap;function Fx(u,e){if(!u.isAnonymous||e instanceof zo||e.type!=u)return 1;let a=lM.get(e);if(a==null){a=1;for(let t of e.children){if(t.type!=u||!(t instanceof Va)){a=1;break}a+=Fx(u,t)}lM.set(e,a)}return a}function yA(u,e,a,t,r,n,i,o,s){let l=0;for(let x=t;x<r;x++)l+=Fx(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=Fx(u,x[k]);for(k++;k<h;k++){let C=Fx(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(yA(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 EU{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 on?this.setBuffer(e.context.buffer,e.index,a):e instanceof ar&&this.map.set(e.tree,a)}get(e){return e instanceof on?this.getBuffer(e.context.buffer,e.index):e instanceof ar?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 hi{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 hi(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 hi(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 pU=class{startParse(e,a,t){return typeof e=="string"&&(e=new P3u(e)),t=t?t.length?t.map(r=>new Z0(r.from,r.to)):[new Z0(0,0)]:[new Z0(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 P3u{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 j3u(u){return(e,a,t,r)=>new T3u(e,u,a,t,r)}class cM{constructor(e,a,t,r,n){this.parser=e,this.parse=a,this.overlay=t,this.target=r,this.from=n}}function dM(u){if(!u.length||u.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(u))}class M3u{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 Uy=new vu({perNode:!0});class T3u{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([[Uy,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 Zd(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 N3u(this.fragments),a=null,t=null,r=new aD(new ar(this.baseTree,this.ranges[0].from,0,null),pa.IncludeAnonymous|pa.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=$3u(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||R3u(r);let l=e.findMounts(r.from,n.parser);if(typeof n.overlay=="function")a=new M3u(n.parser,n.overlay,l,this.inner.length,r.from,r.tree,a);else{let c=mM(this.ranges,n.overlay||(r.from<r.to?[new Z0(r.from,r.to)]:[]));c.length&&dM(c),(c.length||!n.overlay)&&this.inner.push(new cM(n.parser,c.length?n.parser.startParse(this.input,hM(l,c),c):n.parser.startParse(""),n.overlay?n.overlay.map(d=>new Z0(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 Z0(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=mM(this.ranges,a.ranges);l.length&&(dM(l),this.inner.splice(a.index,0,new cM(a.parser,a.parser.startParse(this.input,hM(a.mounts,l),l),a.ranges.map(c=>new Z0(c.from-a.start,c.to-a.start)),a.target,l[0].from))),a=a.prev}t&&!--t.depth&&(t=t.prev)}}}}function $3u(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 EM(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 R3u(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=[];EM(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),EM(i,o[g+3],d,h,f,p),new Va(E,h,f,x)}r.children[n]=l(0,o.length,Qt.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 ar(d,E+u.from,c,u._tree))}}class pM{constructor(e,a){this.offset=a,this.done=!1,this.cursor=e.cursor(pa.IncludeAnonymous|pa.IgnoreMounts)}moveTo(e){let{cursor:a}=this,t=e-this.offset;for(;!this.done&&a.from<t;)a.to>=e&&a.enter(t,1,pa.IgnoreOverlays|pa.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 N3u=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(Uy))!==null&&a!==void 0?a:t.to,this.inner=new pM(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(Uy))!==null&&e!==void 0?e:a.to,this.inner=new pM(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 mM(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 Z0(s.from,i),s.to>o&&a.splice(n+1,0,new Z0(o,s.to))):s.to>o?a[n--]=new Z0(o,s.to):a.splice(n--,1))}}return t}function _3u(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 Z0(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 hM(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 Z0(E.from+t,E.to+t)),d=_3u(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 hi(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 hi(s,l,r.tree,-i,n.from>=i||n.openStart,n.to<=o||n.openEnd))}return a}class tD{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 tD(e,[],a,t,t,0,[],0,r?new xM(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 tD(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 L3u(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 xM(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 xM{constructor(e,a){this.tracker=e,this.context=a,this.hash=e.strict?e.hash(a):0}}class L3u{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 rD{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 rD(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 rD(this.stack,this.pos,this.index)}}function Q4(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 Ax{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const DM=new Ax;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=DM,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=DM,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 S1{constructor(e,a){this.data=e,this.id=a}token(e,a){let{parser:t}=a.p;mU(this.data,e,a,this.id,t.data,t.tokenPrecTable)}}S1.prototype.contextual=S1.prototype.fallback=S1.prototype.extend=!1;class nD{constructor(e,a,t){this.precTable=a,this.elseToken=t,this.data=typeof e=="string"?Q4(e):e}token(e,a){let t=e.pos,r=0;for(;;){let n=e.next<0,i=e.resolveOffset(1,1);if(mU(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))}}nD.prototype.contextual=S1.prototype.fallback=S1.prototype.extend=!1;class vt{constructor(e,a={}){this.token=e,this.contextual=!!a.contextual,this.fallback=!!a.fallback,this.extend=!!a.extend}}function mU(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||K3u(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 fM(u,e,a){for(let t=e,r;(r=u[t])!=65535;t++)if(r==a)return t-e;return-1}function K3u(u,e,a,t){let r=fM(a,t,e);return r<0||fM(a,t,u)<r}const v0=typeof process<"u"&&process.env&&/\bparse\b/.test(process.env.LOG);let hk=null;function gM(u,e,a){let t=u.cursor(pa.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 V3u{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?gM(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?gM(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 G3u{constructor(e,a){this.stream=a,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(t=>new Ax)}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 Ax,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 Ax,{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=ni(o,l+2);else{r==0&&o[l+1]==2&&(r=this.putAction(ni(o,l+2),a,t,r));break}o[l]==a&&(r=this.putAction(ni(o,l+1),a,t,r))}return r}}class H3u{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 G3u(e,this.stream),this.topTerm=e.top[1];let{from:n}=r[0];this.stacks=[tD.start(this,e.top[0],n)],this.fragments=t.length&&this.stream.end-n>e.bufferLength*4?new V3u(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&&W3u(r);if(i)return v0&&console.log("Finish with "+this.stackID(i)),this.stackToTree(i);if(this.parser.strict)throw v0&&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 v0&&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=v0?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),v0&&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),v0&&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),v0&&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 vM(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=v0?this.stackID(o)+" -> ":"";if(o.deadEnd&&(n||(n=!0,o.restart(),v0&&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&&(v0&&console.log(E+this.stackID(d)+" (via force-reduce)"),!this.advanceFully(d,t));p++)v0&&(E=this.stackID(d)+" -> ");for(let p of o.recoverByInsert(s))v0&&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),v0&&console.log(c+this.stackID(o)+` (via recover-delete ${this.parser.getName(s)})`),vM(o,t)):(!r||r.score<o.score)&&(r=o)}return r}stackToTree(e){return e.close(),Va.build({buffer:rD.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=(hk||(hk=new WeakMap)).get(e);return a||hk.set(e,a=String.fromCodePoint(this.nextStackID++)),a+e}}function vM(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 q3u{constructor(e,a,t){this.source=e,this.flags=a,this.disabled=t}allows(e){return!this.disabled||this.disabled[e]==0}}const xk=u=>u;class dg{constructor(e){this.start=e.start,this.shift=e.shift||xk,this.reduce=e.reduce||xk,this.reuse=e.reuse||xk,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class Ci extends pU{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 vA(a.map((o,s)=>Qt.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=sU;let i=Q4(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(kM),this.states=Q4(e.states,Uint32Array),this.data=Q4(e.stateData),this.goto=Q4(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(o=>typeof o=="number"?new S1(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 H3u(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=ni(t,n+2)];else{if(t[n+1]==2)return ni(t,n+2);break}if(i==a||i==0)return ni(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=ni(this.data,n+2);else break;r=a(ni(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=ni(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(Ci.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]=kM(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 q3u(e,t,r)}static deserialize(e){return new Ci(e)}}function ni(u,e){return u[e]|u[e+1]<<16}function W3u(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 kM(u){if(u.external){let e=u.extend?1:0;return(a,t)=>u.external(a,t)<<1|e}return u.get}let J3u=0,ii=class Zy{constructor(e,a,t,r){this.name=e,this.set=a,this.base=t,this.modified=r,this.id=J3u++}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 Zy&&(a=e),a?.base)throw new Error("Can not derive from a modified tag");let r=new Zy(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 iD(e);return t=>t.modified.indexOf(a)>-1?t:iD.get(t.base||t,t.modified.concat(a).sort((r,n)=>r.id-n.id))}},U3u=0;class iD{constructor(e){this.name=e,this.instances=[],this.id=U3u++}static get(e,a){if(!a.length)return e;let t=a[0].instances.find(o=>o.base==e&&Z3u(a,o.modified));if(t)return t;let r=[],n=new ii(e.name,r,e,a);for(let o of a)o.instances.push(n);let i=Q3u(a);for(let o of e.set)if(!o.modified.length)for(let s of i)r.push(iD.get(o,s));return n}}function Z3u(u,e){return u.length==e.length&&u.every((a,t)=>a==e[t])}function Q3u(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 nl(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 oD(t,i,s>0?n.slice(0,s):null);e[l]=c.sort(e[l])}}return hU.add(e)}const hU=new vu;class oD{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}}oD.empty=new oD([],2,null);function xU(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 Y3u(u,e){let a=null;for(let t of u){let r=t.style(e);r&&(a=a?a+" "+r:r)}return a}function X3u(u,e,a,t=0,r=u.length){let n=new epu(t,Array.isArray(e)?e:[e],a);n.highlightRange(u.cursor(),t,r,"",n.highlighters),n.flush(r)}class epu{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=upu(e)||oD.empty,d=Y3u(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 upu(u){let e=u.type.prop(hU);for(;e&&e.context&&!u.matchContext(e.context);)e=e.next;return e||null}const $e=ii.define,gh=$e(),ro=$e(),bM=$e(ro),yM=$e(ro),no=$e(),vh=$e(no),Dk=$e(no),Jr=$e(),ms=$e(Jr),Vr=$e(),Gr=$e(),Qy=$e(),B4=$e(Qy),kh=$e(),Z={comment:gh,lineComment:$e(gh),blockComment:$e(gh),docComment:$e(gh),name:ro,variableName:$e(ro),typeName:bM,tagName:$e(bM),propertyName:yM,attributeName:$e(yM),className:$e(ro),labelName:$e(ro),namespace:$e(ro),macroName:$e(ro),literal:no,string:vh,docString:$e(vh),character:$e(vh),attributeValue:$e(vh),number:Dk,integer:$e(Dk),float:$e(Dk),bool:$e(no),regexp:$e(no),escape:$e(no),color:$e(no),url:$e(no),keyword:Vr,self:$e(Vr),null:$e(Vr),atom:$e(Vr),unit:$e(Vr),modifier:$e(Vr),operatorKeyword:$e(Vr),controlKeyword:$e(Vr),definitionKeyword:$e(Vr),moduleKeyword:$e(Vr),operator:Gr,derefOperator:$e(Gr),arithmeticOperator:$e(Gr),logicOperator:$e(Gr),bitwiseOperator:$e(Gr),compareOperator:$e(Gr),updateOperator:$e(Gr),definitionOperator:$e(Gr),typeOperator:$e(Gr),controlOperator:$e(Gr),punctuation:Qy,separator:$e(Qy),bracket:B4,angleBracket:$e(B4),squareBracket:$e(B4),paren:$e(B4),brace:$e(B4),content:Jr,heading:ms,heading1:$e(ms),heading2:$e(ms),heading3:$e(ms),heading4:$e(ms),heading5:$e(ms),heading6:$e(ms),contentSeparator:$e(Jr),list:$e(Jr),quote:$e(Jr),emphasis:$e(Jr),strong:$e(Jr),link:$e(Jr),monospace:$e(Jr),strikethrough:$e(Jr),inserted:$e(),deleted:$e(),changed:$e(),invalid:$e(),meta:kh,documentMeta:$e(kh),annotation:$e(kh),processingInstruction:$e(kh),definition:ii.defineModifier("definition"),constant:ii.defineModifier("constant"),function:ii.defineModifier("function"),standard:ii.defineModifier("standard"),local:ii.defineModifier("local"),special:ii.defineModifier("special")};for(let u in Z){let e=Z[u];e instanceof ii&&(e.name=u)}xU([{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 apu=nl({String:Z.string,Number:Z.number,"True False":Z.bool,PropertyName:Z.propertyName,Null:Z.null,",":Z.separator,"[ ]":Z.squareBracket,"{ }":Z.brace}),tpu=Ci.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:[apu],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 Yy=[],DU=[];(()=>{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?DU:Yy).push(a=a+u[e])})();function rpu(u){if(u<768)return!1;for(let e=0,a=Yy.length;;){let t=e+a>>1;if(u<Yy[t])a=t;else if(u>=DU[t])e=t+1;else return!0;if(e==a)return!1}}function CM(u){return u>=127462&&u<=127487}const FM=8205;function npu(u,e,a=!0,t=!0){return(a?fU:ipu)(u,e,t)}function fU(u,e,a){if(e==u.length)return e;e&&gU(u.charCodeAt(e))&&vU(u.charCodeAt(e-1))&&e--;let t=fk(u,e);for(e+=AM(t);e<u.length;){let r=fk(u,e);if(t==FM||r==FM||a&&rpu(r))e+=AM(r),t=r;else if(CM(r)){let n=0,i=e-2;for(;i>=0&&CM(fk(u,i));)n++,i-=2;if(n%2==0)break;e+=2}else break}return e}function ipu(u,e,a){for(;e>0;){let t=fU(u,e-2,a);if(t<e)return t;e--}return 0}function fk(u,e){let a=u.charCodeAt(e);if(!vU(a)||e+1==u.length)return a;let t=u.charCodeAt(e+1);return gU(t)?(a-55296<<10)+(t-56320)+65536:a}function gU(u){return u>=56320&&u<57344}function vU(u){return u>=55296&&u<56320}function AM(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]=Y1(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),an.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]=Y1(this,e,a);let t=[];return this.decompose(e,a,t,0),an.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 fd(this),n=new fd(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 fd(this,e)}iterRange(e,a=this.length){return new kU(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 bU(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):an.from($a.split(e,[]))}}class $a extends Mu{constructor(e,a=opu(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 spu(r,o,t,i);r=o+1,t++}}decompose(e,a,t,r){let n=e<=0&&a>=this.length?this:new $a(BM(this.text,e,a),Math.min(a,this.length)-Math.max(0,e));if(r&1){let i=t.pop(),o=Bx(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]=Y1(this,e,a);let r=Bx(this.text,Bx(t.text,BM(this.text,0,e)),a),n=this.length+t.length-(a-e);return r.length<=32?new $a(r,n):an.from($a.split(r,[]),n)}sliceString(e,a=this.length,t=`
477
477
  `){[e,a]=Y1(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 an 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]=Y1(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 an(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=`
478
478
  `){[e,a]=Y1(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 an))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 an)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]:an.from(c,l)),l=-1,s=c.length=0)}for(let p of e)d(p);return E(),o.length==1?o[0]:new an(o,a)}}Mu.empty=new $a([""],0);function opu(u){let e=-1;for(let a of u)e+=a.length+1;return e}function Bx(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 BM(u,e,a){return Bx(u,[""],e,a)}class fd{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=`
@@ -522,7 +522,7 @@ html body {
522
522
  `),y+="`"+lku(k)+"`: "+f),l([y])}return null})},u})();function ab(u){if(u){var e=u.replace(/([^\n\r])(\r?\n)([^\n\r])/gm,`$1
523
523
 
524
524
  $3`);return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}}function lku(u){return u.indexOf("`")!==-1?"`` "+u+" ``":u}var cku=(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,hE;if(typeof process=="object")hE=process.platform==="win32";else if(typeof navigator=="object"){var dku=navigator.userAgent;hE=dku.indexOf("Windows")>=0}var Eku=/^\w[\w\d+.-]*$/,pku=/^\//,mku=/^\/\//;function hku(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&&!Eku.test(u.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(u.path){if(u.authority){if(!pku.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(mku.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 xku(u,e){return!u&&!e?"file":u}function Dku(u,e){switch(u){case"https":case"http":case"file":e?e[0]!==gr&&(e=gr+e):e=gr;break}return e}var ra="",gr="/",fku=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,fF=(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=xku(e,i),this.authority=a||ra,this.path=Dku(this.scheme,t||ra),this.query=r||ra,this.fragment=n||ra,hku(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 uX(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 Hl(a,t,r,n,i)},u.parse=function(e,a){a===void 0&&(a=!1);var t=fku.exec(e);return t?new Hl(t[2]||ra,Kh(t[4]||ra),Kh(t[5]||ra),Kh(t[7]||ra),Kh(t[9]||ra),a):new Hl(ra,ra,ra,ra,ra)},u.file=function(e){var a=ra;if(hE&&(e=e.replace(/\\/g,gr)),e[0]===gr&&e[1]===gr){var t=e.indexOf(gr,2);t===-1?(a=e.substring(2),e=gr):(a=e.substring(2,t),e=e.substring(t)||gr)}return new Hl("file",a,e,ra,ra)},u.from=function(e){return new Hl(e.scheme,e.authority,e.path,e.query,e.fragment)},u.prototype.toString=function(e){return e===void 0&&(e=!1),gF(this,e)},u.prototype.toJSON=function(){return this},u.revive=function(e){if(e){if(e instanceof u)return e;var a=new Hl(e);return a._formatted=e.external,a._fsPath=e._sep===XY?e.fsPath:null,a}else return e},u})(),XY=hE?1:void 0,Hl=(function(u){cku(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=uX(this)),this._fsPath},enumerable:!0,configurable:!0}),e.prototype.toString=function(a){return a===void 0&&(a=!1),a?gF(this,!0):(this._formatted||(this._formatted=gF(this,!1)),this._formatted)},e.prototype.toJSON=function(){var a={$mid:1};return this._fsPath&&(a.fsPath=this._fsPath,a._sep=XY),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})(fF),eX=(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 RR(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=eX[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 gku(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+=eX[t]):e!==void 0&&(e+=u[a])}return e!==void 0?e:u}function uX(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,hE&&(a=a.replace(/\//g,"\\")),a}function gF(u,e){var a=e?gku:RR,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+=gr,t+=gr),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:RR(s,!1)),t}function aX(u){try{return decodeURIComponent(u)}catch{return u.length>3?u.substr(0,3)+aX(u.substr(3)):u}}var NR=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function Kh(u){return u.match(NR)?u.replace(NR,function(e){return aX(e)}):u}var vku=(function(){function u(e){try{this.patternRegExp=new RegExp(rku(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})(),kku=(function(){function u(e,a,t){this.service=e,this.url=a,this.dependencies={},t&&(this.unresolvedSchema=this.service.promise.resolve(new k1(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})(),k1=(function(){function u(e,a){a===void 0&&(a=[]),this.schema=e,this.errors=a}return u})(),_R=(function(){function u(e,a){a===void 0&&(a=[]),this.schema=e,this.errors=a}return u.prototype.getSection=function(e){return t0(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})(),bku=(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=fF.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 fF.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 kku(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 vku(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 k1({},[a]))}return this.requestService(e).then(function(t){if(!t){var r="Unable to load schema from '"+e+"': No content.";return new k1({},[r])}var n={},i=[];n=Lvu(t,i);var o=i.length?["Unable to parse content from '"+e+"': Parse error at offset "+i[0].offset]:[];return new k1(n,o)},function(t){var r="Unable to load schema from '"+e+"': "+t.toString();return new k1({},[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 _R({},["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 _R(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=yo(t[0].valueNode);if(r&&tku(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 yku=(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?LR(t.trailingCommas):hu.Error,p=t?LR(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(Di.create(h,d.errors[0],hu.Warning,Pu.SchemaResolveError))}else{var h=_u.create(e.positionAt(x.offset),e.positionAt(x.offset+1));s(Di.create(h,d.errors[0],hu.Warning,Pu.SchemaResolveError))}}else{var f=a.validate(e,d.schema);f&&f.forEach(s)}tX(d.schema)&&(p=void 0),rX(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(Di.create(C,b,p,Pu.CommentNotPermitted))})}return i};if(r){var c=r.id||"schemaservice://untitled/"+Cku++;return this.jsonSchemaService.resolveSchemaContent(new k1(r),c,{}).then(function(d){return l(d)})}return this.jsonSchemaService.getSchemaForResource(e.uri,a).then(function(d){return l(d)})},u})(),Cku=0;function tX(u){if(u&&typeof u=="object"){if(dn(u.allowComments))return u.allowComments;if(u.allOf)for(var e=0,a=u.allOf;e<a.length;e++){var t=a[e],r=tX(t);if(dn(r))return r}}}function rX(u){if(u&&typeof u=="object"){if(dn(u.allowTrailingCommas))return u.allowTrailingCommas;if(dn(u.allowsTrailingCommas))return u.allowsTrailingCommas;if(u.allOf)for(var e=0,a=u.allOf;e<a.length;e++){var t=a[e],r=rX(t);if(dn(r))return r}}}function LR(u){switch(u){case"error":return hu.Error;case"warning":return hu.Warning;case"ignore":return}}var IR=48,Fku=57,Aku=65,Vh=97,Bku=102;function Ta(u){return u<IR?0:u<=Fku?u-IR:(u<Vh&&(u+=Vh-Aku),u>=Vh&&u<=Bku?u-Vh+10:0)}function Sku(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 zku=(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"||DF(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=sc.create(e.uri,Qi(e,d));if(s.push({name:yo(x.valueNode),kind:Qr.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=sc.create(e.uri,Qi(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"||DF(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=Qi(e,d),g=Qi(e,x.keyNode);if(s.push({name:yo(x.valueNode),kind:Qr.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=Qi(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=Qi(e,v),B=Qi(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 Qr.Module;case"string":return Qr.String;case"number":return Qr.Number;case"array":return Qr.Array;case"boolean":return Qr.Boolean;default:return Qr.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=Sku(yo(d.node));if(p){var x=Qi(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:zi.replace(r,JSON.stringify(c))}),n},u})();function Qi(u,e){return _u.create(u.positionAt(e.offset),u.positionAt(e.offset+e.length))}var wku={schemaAssociations:{},schemas:{}};function Oku(u,e){var a=[],t=[],r=[],n=-1,i=T1(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(W0.create(l+1,0))):l<p&&(s({startLine:l,endLine:p,kind:Fd.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:Fd.Region};r.push(c)}else{for(var g=r.length-1;g>=0&&r[g].kind!==Fd.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 Pku(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=$D.create(c[m],x);return x||(x=$D.create(_u.create(o,o))),x}function r(o,s){return _u.create(u.positionAt(o),u.positionAt(s))}var n=T1(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 nX(u){var e=u.promiseConstructor||Promise,a=new bku(u.schemaRequestService,u.workspaceContext,e);a.setSchemaContributions(wku);var t=new oku(a,u.contributions,e,u.clientCapabilities),r=new sku(a,u.contributions,e),n=new zku(a),i=new yku(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 aku(o,{collectComments:!0})},newJSONDocument:function(o,s){return uku(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:Oku,getSelectionRanges:Pku,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:`
525
- `};return Gvu(o.getText(),c,p).map(function(x){return zi.replace(_u.create(o.positionAt(x.offset),o.positionAt(x.offset+x.length)),x.content)})}}}function cl(){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)&&o.workflowId===r.workflowId&&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 Fg=nX({});let KR=null;function iX(u){KR!==u&&(KR=u,Fg.configure({validate:!0,schemas:[{uri:"stub://test",fileMatch:["*"],schema:u}]}))}function oX(u){const e=RD.create("stub.json","json",0,u),a=Fg.parseJSONDocument(e);return{textDoc:e,jsonDoc:a}}const sX=Qa.define({create(){},update(u){return u}}),lX=u=>u.field(sX,!1),jku=({store:u,isResponse:e,apiOperation:a})=>{const r=G9(u).data.get();let n=a?.body?.mediaTypes?.[Mt.JSON]?.schema;if(Ka(r,We.Step)&&e){const i=r.response?.status;i&&(n=a?.responses?.[i]?.mediaTypes?.[Mt.JSON]?.schema)}return[sX.init(()=>({schema:pi(n||{}),store:u}))]};function Mku(){return async u=>{const{schema:e}=lX(u.state)||{};if(!e)return[];iX(e);const a=u.state.doc,{textDoc:t,jsonDoc:r}=oX(a.toString());return(await Fg.doValidation(t,r))?.map(i=>({from:vF(a,i.range.start),to:vF(a,i.range.end),message:i.message,severity:Rku[i.severity||3]}))}}const Tku=Cn.highest(Sc.of([{key:"Tab",run:u=>BQ(u)}]));function $ku(){return async function(e){const a={from:e.pos,to:e.pos,options:[],filter:!1},{schema:t}=lX(e.state)||{};if(!t)return a;iX(t);const r=e.state.doc,n=vF.bind(null,r),{textDoc:i,jsonDoc:o}=oX(r.toString()),s=e.state.doc.lineAt(e.pos),l=s.number-1,c=e.pos-s.from,d=await Fg.doComplete(i,{line:l,character:c},o);if(!d)return a;const E=e.state.sliceDoc(s.from,e.pos);if(E.trim().endsWith(",")||Nku(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 Rku={1:"error",2:"warning",3:"info",4:"hint"};function vF(u,e){return u.line(e.line+1).from+e.character}function Nku(u){try{return JSON.parse(`{${u}}`),!0}catch{return!1}}const cX=iu.define();function Mc(u){const e=u.activeEnvironmentId.get();return u.environments.find(a=>a.name.get()===e)?.get()||u.environments[0].get()}const kF=u=>Ca.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=Mc(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=Xf(c);for(const E of d){const p=s+E.start,x=s+E.end;if(!(p>=x))if(E.prefix==="inputs"){const m=oA(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}),_ku=nX({});function Lku(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 Iku(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 Kku=u=>Ca.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=RD.create("inmemory://model.json","json",0,t),p=_ku.parseJSONDocument(d)?.root;r=Lku(p)?p:void 0}catch{r=void 0}const i=Mc(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=Iku(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=Xf(m);for(const h of g){const f=p+h.start,k=p+h.end;if(!(f>=k))if(h.prefix==="inputs"){const y=oA(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}),fn={[Mt.Text]:{name:"Text",extensions:[Me.lineWrapping],stateExtensions:[kF]},[Mt.JSON]:{name:"JSON",extensions:[qxu(),bgu(Mku(),{delay:0,needsRefresh:u=>u.transactions.some(e=>e.effects.some(a=>a.is(cX)))}),nQ.data.of({autocomplete:$ku()}),Tku],stateExtensions:[jku,Kku]},[Mt.XML]:{name:"XML",extensions:[cgu()],stateExtensions:[kF]}},Vku={[Mt.Image]:{name:"Image",extensions:[],stateExtensions:[]}},Gku={[Mt.HTML]:{name:"HTML",extensions:[Lfu()],stateExtensions:[kF]}},mo={...fn,...Vku,...Gku},dX={[Mt.FormData]:{name:"form-data",extensions:void 0},[Mt["application/x-www-form-urlencoded"]]:{name:"x-www-form-urlencoded",extensions:void 0}},EX={[Mt.Binary]:{name:"Binary",extensions:void 0}},Us={...fn,...dX,...EX},Hku=Object.keys(fn),d9=Object.keys(dX),pX=Object.keys(EX);function mX(u=[],e){const a={};return u.forEach(t=>{const r=String(t[e]);a[r]||(a[r]=[]),a[r].push(t)}),a}const ZE={active:!0,key:"",value:""};function ho(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})),Sa(e.in)]}function QE(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 X0(){return{id:crypto.randomUUID(),...ZE}}function E0(){return{id:crypto.randomUUID(),...ZE,description:""}}function Sa(u){return{...ZE,id:crypto.randomUUID(),in:u}}function $s(){return{id:crypto.randomUUID(),...ZE,type:"text",files:null}}function E9(){return{id:crypto.randomUUID(),...ZE,sendIn:jt.URL}}function tb(u){return u.map(e=>({id:crypto.randomUUID(),key:"",value:e,active:!0}))}function Ag(u,e){return u.filter(a=>a.active&&a.value).map(({value:a})=>(e?Yu(a,e):a).trim())}function Co(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 hX(u,e){return u.map(({value:a,...t})=>({...t,value:Yu(a,e)}))}function qku(u,e){if(!u.startsWith("$components.parameters."))return null;const a=u.replace("$components.parameters.","");return a&&e[a]||null}function za(u=[],e={}){const a=[];for(const t of u)if(Do(t)){const r=qku(t.reference,e);r&&a.push({...r,active:t.active,value:t.value||r.value})}else a.push(t);return a}function io(u){return Object.entries(u).map(([e,a])=>({id:crypto.randomUUID(),key:"",value:e,active:!0,description:a}))}function Wku(u){return u.replace(/{/g,"{{").replace(/}/g,"}}")}const VR={documentedOAuth2Types:[],grantType:Fe.ClientCredentials,authRequestExtraParams:[X0()],tokenRequestExtraParams:[E9()],[Fe.ClientCredentials]:{clientId:"",clientSecret:"",clientAssertion:"",tokenUrl:"",scopes:[E0()],accessToken:""},[Fe.ClientCredentialsWithJwtAssertion]:{clientId:"",clientSecret:"",clientAssertion:"",tokenUrl:"",scopes:[E0()],accessToken:""},[Fe.AuthorizationCode]:{clientId:"",clientSecret:"",tokenUrl:"",authorizationUrl:"",callbackUrl:"",availableScopes:[],scopes:[E0()],codeVerifier:"",codeChallenge:"",accessToken:""},[Fe.AuthorizationCodeWithPkce]:{clientId:"",clientSecret:"",tokenUrl:"",authorizationUrl:"",callbackUrl:"",availableScopes:[],scopes:[E0()],codeVerifier:"",codeChallenge:"",accessToken:""},[Fe.Implicit]:{clientId:"",authorizationUrl:"",callbackUrl:"",availableScopes:[],scopes:[E0()],accessToken:""},[Fe.Password]:{username:"",password:"",clientId:"",clientSecret:"",tokenUrl:"",accessToken:"",scopes:[E0()]}},Jku={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:P0.Header,name:"",key:""},[ye.OAuth2]:VR,[ye.OpenIDConnect]:{...VR,openIdConnectUrl:"",userInfoUrl:""}},bF="urn:ietf:params:oauth:client-assertion-type:jwt-bearer",Uku={[wt.SIMPLE]:{condition:"",type:wt.SIMPLE},[wt.REGEX]:{condition:"",type:wt.REGEX,context:""},[wt.JSONPATH]:{condition:"",type:wt.JSONPATH,context:""},[wt.XPATH]:{condition:"",type:wt.XPATH,context:""}};function ND(){return structuredClone({type:ut.Text,content:"",activeExampleName:"",formData:{"multipart/form-data":[$s()],"application/x-www-form-urlencoded":[$s()]},binary:null})}const Zku={method:"GET",url:"",security:[Sn()],body:ND(),queryParameters:[X0()],headers:[X0()],cookies:[X0()],pathParameters:[X0()]};function xX(){return structuredClone(Zku)}function Sn(){return pi(Jku)}function Qku(u){return pi({id:crypto.randomUUID(),...Uku[u]})}function DX(u,e,a){for(const t of a){const r=GR(u,t),n=GR(e,t);if(typeof r=="object"&&typeof n=="object"){if(!DX(r,n,a))return!1}else if(r!==n)return!1}return!0}function GR(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 Yku(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 ebu(u){switch(u){case"query":return P0.Query;case"cookie":return P0.Cookie;case"header":return P0.Header;default:return}}function ubu(u,e,a){const{security:t}=e,r=G1u(u);if(!a)return!1;const n=p9(a),i=n.map(c=>c.securityType),o=t.map(c=>c.securityType);if(!Yku(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||DX(c,x,tbu(d,E)),g=abu(c,d,c[ye.OAuth2]?.grantType,r),h=!!(p&&x&&m&&g);l.push(!a.security?.length||h)}),l.includes(!1)}function abu(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=Ag(u[ye.OAuth2][a]?.scopes,t);return Xku(n,r)}return!0}function tbu(u,e){return u===ye.APIKey?[`${ye.APIKey}/name`,`${ye.APIKey}/location`]:u===ye.OAuth2?[`${ye.OAuth2}/grantType`,...rbu(e)]:u===ye.OpenIDConnect?[`${ye.OpenIDConnect}/openIdConnectUrl`]:[]}function rbu(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 nbu(u){return u.map(e=>{const a=e.map(t=>t.id).join("_");return e.map(t=>({...t,schemeId:a}))})}function ibu(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(m9(i))}),{id:r,security:n}});return e.length?a:[]}function obu(u,e){const a=u.security||[];return a?.length?vX(a).map((t,r)=>m9(t)):[]}function p9(u){const a=(u.security||[])[0];return a?a.map(t=>m9(t)):[Sn()]}function m9(u,e){const a={...Sn(),securitySchemeId:u.id},t=Bg(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=ka(r+W.SecurityVariablesEnvSuffix.Username)),a[ye.BasicAuth].password||(a[ye.BasicAuth].password=ka(r+W.SecurityVariablesEnvSuffix.Password))),t===ye.DigestAuth&&(a[ye.DigestAuth].username||(a[ye.DigestAuth].username=ka(r+W.SecurityVariablesEnvSuffix.Username)),a[ye.DigestAuth].password||(a[ye.DigestAuth].password=ka(r+W.SecurityVariablesEnvSuffix.Password))),t===ye.JWT&&!a[ye.JWT].token&&(a[ye.JWT].token=ka(r+W.SecurityVariablesEnvSuffix.JWTToken)),t===ye.APIKey&&!a[ye.APIKey].key){a[ye.APIKey].name=u.name||"",a[ye.APIKey].key=ka(r+W.SecurityVariablesEnvSuffix.APIKey);const n=ebu(u.in);n&&(a[ye.APIKey].location=n)}if(t===ye.OAuth2){const n=x9(u),i=ka(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=ka(r+W.SecurityVariablesEnvSuffix.ClientId),o[Fe.AuthorizationCode].authorizationUrl=u.flows?.authorizationCode?.authorizationUrl||"",o[Fe.AuthorizationCode].tokenUrl=u.flows?.authorizationCode?.tokenUrl||"",o[Fe.AuthorizationCode].clientSecret=ka(r+W.SecurityVariablesEnvSuffix.ClientSecret),o[Fe.AuthorizationCode].availableScopes=Object.keys(u.flows?.authorizationCode?.scopes||{})||[],o[Fe.AuthorizationCode].scopes=[...io(u.flows?.authorizationCode?.scopes||{})||[],E0()]),s===Fe.AuthorizationCodeWithPkce&&!o[Fe.AuthorizationCodeWithPkce].accessToken&&(o[Fe.AuthorizationCodeWithPkce].accessToken=i,o[Fe.AuthorizationCodeWithPkce].clientId=ka(r+W.SecurityVariablesEnvSuffix.ClientId),o[Fe.AuthorizationCodeWithPkce].authorizationUrl=u.flows?.authorizationCode?.authorizationUrl||"",o[Fe.AuthorizationCodeWithPkce].tokenUrl=u.flows?.authorizationCode?.tokenUrl||"",o[Fe.AuthorizationCodeWithPkce].clientSecret=ka(r+W.SecurityVariablesEnvSuffix.ClientSecret),o[Fe.AuthorizationCodeWithPkce].availableScopes=Object.keys(u.flows?.authorizationCode?.scopes||{})||[],o[Fe.AuthorizationCodeWithPkce].scopes=[...io(u.flows?.authorizationCode?.scopes||{}),E0()]),s===Fe.ClientCredentials&&!o[Fe.ClientCredentials].accessToken&&(o[Fe.ClientCredentials].accessToken=i,o[Fe.ClientCredentials].clientId=ka(r+W.SecurityVariablesEnvSuffix.ClientId),o[Fe.ClientCredentials].clientSecret=ka(r+W.SecurityVariablesEnvSuffix.ClientSecret),o[Fe.ClientCredentials].tokenUrl=u.flows?.clientCredentials?.tokenUrl||"",o[Fe.ClientCredentials].scopes=[...io(u.flows?.clientCredentials?.scopes||{}),E0()]),s===Fe.ClientCredentialsWithJwtAssertion&&!o[Fe.ClientCredentialsWithJwtAssertion].accessToken&&(o[Fe.ClientCredentialsWithJwtAssertion].accessToken=i,o[Fe.ClientCredentialsWithJwtAssertion].clientId=ka(r+W.SecurityVariablesEnvSuffix.ClientId),o[Fe.ClientCredentialsWithJwtAssertion].clientAssertion=ka(r+W.SecurityVariablesEnvSuffix.ClientAssertion),o[Fe.ClientCredentialsWithJwtAssertion].scopes=[...io(u.flows?.clientCredentials?.scopes||{}),E0()]),s===Fe.Implicit&&!o[Fe.Implicit].accessToken&&(o[Fe.Implicit].accessToken=i,o[Fe.Implicit].clientId=ka(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=[...io(u.flows?.implicit?.scopes||{}),E0()]),s===Fe.Password&&!o[Fe.Password].accessToken&&(o[Fe.Password].accessToken=i,o[Fe.Password].clientId=ka(r+W.SecurityVariablesEnvSuffix.ClientId),o[Fe.Password].clientSecret=ka(r+W.SecurityVariablesEnvSuffix.ClientSecret),o[Fe.Password].tokenUrl=u.flows?.password?.tokenUrl||"",o[Fe.Password].scopes=[...io(u.flows?.password?.scopes||{}),E0()])})}if(t===ye.OpenIDConnect){const n=ka(r+W.SecurityVariablesEnvSuffix.Token),i=a[ye.OpenIDConnect];i[Fe.AuthorizationCode].accessToken||(i[Fe.AuthorizationCode].accessToken=n,i[Fe.AuthorizationCode].clientId=ka(r+W.SecurityVariablesEnvSuffix.ClientId),i[Fe.AuthorizationCode].clientSecret=ka(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=ka(r+W.SecurityVariablesEnvSuffix.ClientId),i[Fe.AuthorizationCodeWithPkce].clientSecret=ka(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=ka(r+W.SecurityVariablesEnvSuffix.ClientId))}return a}function sbu(u,e="",a){const t=mX(u.parameters,"in"),r=fX(u),n=p9(u),i=ho(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:ho(t.path||[],{in:"path"}),method:u.method.toLocaleUpperCase(),url:QE(Wku(u.path),i),headers:ho(t.header||[],{in:"header"}),queryParameters:i,cookies:ho(t.cookie||[],{in:"cookie"}),body:r,security:n},response:null}}function h9(u){const e=mX(u.parameters,"in"),a=fX(u),t=p9(u);return{parameters:{queryParameters:ho(e.query||[],{in:"query"}),headers:ho(e.header||[],{in:"header"}),cookies:ho(e.cookie||[],{in:"cookie"}),pathParameters:ho(e.path||[],{initializeWithInputs:!0,in:"path"})},requestBody:a,security:t}}function fX(u){const e=u.body?.mediaTypes;if(!e||!Object.keys(e).length)return ND();const a=lbu(e,u),t=a?.name||"",r=!d9.includes(t)&&!pX.includes(t),n=yF(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{...ND(),activeExampleName:u.body?.activeExampleName||n[0]?.key||"",...a&&{type:a.name},content:i,formData:{"multipart/form-data":HR(e[Mt.FormData]),"application/x-www-form-urlencoded":HR(e[Mt["application/x-www-form-urlencoded"]])}}}function gX(u){return u?{...(Object.keys(u?.body?.mediaTypes||{})||[]).reduce((a,t)=>(a[t]={name:t,extensions:void 0},a),{}),...Us}:Us}function HR(u){if(!u)return[$s()];if(!u.parameters)return[$s()];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($s()),e}function yF(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 lbu(u,e){const a=gX(e),t=Object.keys(u).find(r=>!!a[r]);return t?u[t]:null}function cbu(u){return!u?.security?.length||!u?[]:obu(u)}function vX(u){const e=new Set;return u.flat().filter(a=>e.has(a.id)?!1:(e.add(a.id),!0))}function Bg(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 dbu(u,e){if(u==="clientCredentials"&&e&&"x-assertionType"in e&&e["x-assertionType"]===bF)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 Ebu(u,e){const a=u?.security;if(!a?.length)return[];const n=nbu(a).flat().filter(i=>i.schemeId===e).find(i=>Bg(i)===ye.OAuth2);return x9(n)}function x9(u){return Object.entries(u?.flows||{}).map(([e,a])=>dbu(e,a)).filter(Boolean)}async function YE(u){try{const e=await h3u(u),a=await aU(u);return{absolutePath:u,file:new File([e],a)}}catch(e){return console.error("Failed to init replay file",e),null}}async function kX(u){return(await Promise.allSettled(u.map(a=>YE(a)))).map(a=>a.status==="fulfilled"?a.value:null).filter(a=>a!==null)}async function pbu(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 mbu({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:eN(s.parameters,s["x-replay-disabled-parameters"],u.components?.parameters),outputs:YR(s.outputs),security:UR(s["x-security"]),steps:await Promise.all(s.steps.map(async l=>{const c=eN(l.parameters,l["x-replay-disabled-parameters"],u.components?.parameters),d=l["x-operation"]??null;d&&(d.url=QE(d.url,c.queryParameters.filter(HI)));const E=hbu(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 kbu(l.requestBody,t);return{...l,state:Nu.Normal,parameters:c,outputs:YR(l.outputs),successCriteria:l.successCriteria?.map(m=>({...m,type:m.type??wt.SIMPLE}))||[],requestBody:x,xOperation:d,security:UR(l["x-security"],p),operation:E}}))})))}}async function mbu({projectPath:u,apiUrl:e,collectionId:a}){if(iU(e))return e;if(await Ea.isAbsolute(e))return await Ea.relative(u,e);const t=await Ea.resolve(await Ea.join(u,a,"..",e));return await Ea.relative(u,t)}function hbu(u,e,a){if(u["x-operation"])return null;const{path:t,method:r,apiId:n}=bX({operationPath:u.operationPath,parsedSourceDescriptions:e}),{operationId:i,apiId:o}=xbu({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=ybu(i,l);return{apiId:s,path:c?.path??"",method:c?.method??"",operationId:i}}return{apiId:s,path:t??"",method:r??"",operationId:i}}function xbu({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 qR(u){return"reference"in u&&typeof u.reference=="string"}function bX({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:Wf.unescape(l.pop()||""),method:c.toLowerCase(),apiId:i}}catch{return{path:"",method:"",apiId:null}}}function Dbu(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 yX(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 fbu(u){return{query:P0.Query,header:P0.Header,cookie:P0.Cookie}[u.toLowerCase()]||P0.Header}function gbu(u){return{body:jt.Body,header:jt.Header,url:jt.URL}[u.toLowerCase()]||jt.URL}function WR(u,e,a){return Object.keys(u).reduce((t,r)=>{const n=yX(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:hs(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:hs(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:hs(u[r].availableScopes),scopes:hs(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:hs(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:hs(u[r].availableScopes),scopes:hs(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 JR(u,e,a){const r={...Sn(),securityType:u},n=Object.keys(e.flows||{})[0],i=yX(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:fbu(e.in),name:e.name,key:a.apiKey,schemeName:e.id}};case ye.OAuth2:return{...r,[ye.OAuth2]:{...r[ye.OAuth2],...WR(e.flows||{},a||{},r[ye.OAuth2]),authRequestExtraParams:ZR(a.authRequestExtraParams),tokenRequestExtraParams:QR(a.tokenRequestExtraParams),grantType:i,schemeName:e.id}};case ye.OpenIDConnect:return{...r,[ye.OpenIDConnect]:{...r[ye.OpenIDConnect],...WR(a.flows||{},a||{},r[ye.OpenIDConnect]),openIdConnectUrl:a.openIdConnectUrl,userInfoUrl:a.userInfoUrl,authRequestExtraParams:ZR(a.authRequestExtraParams),tokenRequestExtraParams:QR(a.tokenRequestExtraParams),grantType:i,schemeName:e.id}};default:return r}}function vbu(u,e){return[...u.map(t=>{if("scheme"in t){const n=Dbu(t.scheme);return JR(n,t.scheme,t.values)}const r=e.find(n=>n.id===t.schemeName);if(r){const n=Bg(r),i=JR(n,r,t.values);return i.securitySchemeId=r.id,i}return Sn()})]}function UR(u=[],e){const a=vX(e?.security||[]);return u.length?vbu(u,a):[Sn()]}function hs(u,e){const a=io(u||{}),t=io(e||{});return[...a,...t,E0()]}function ZR(u){return(u||[]).map(e=>({id:crypto.randomUUID(),key:e.key??"",value:e.value??"",active:e.active??!0})).concat(X0())}function QR(u){return(u||[]).map(e=>({id:crypto.randomUUID(),key:e.key??"",value:e.value??"",active:e.active??!0,sendIn:gbu(e.in)})).concat(E9())}function YR(u){if(!u)return[X0()];const e=[];for(const a in u)e.push({id:crypto.randomUUID(),key:a,value:u[a],active:!0});return e.push(X0()),e}const Gh={query:"queryParameters",path:"pathParameters",header:"headers",cookie:"cookies"};function XR(u,e){const a="$components.parameters.";if(u.reference.startsWith(a)){const t=u.reference.replace(a,"");return e?.[t]}}function eN(u,e,a){if(!u&&!e)return{pathParameters:[Sa("path")],queryParameters:[Sa("query")],headers:[Sa("header")],cookies:[Sa("cookie")]};const t={pathParameters:[],queryParameters:[],headers:[],cookies:[]};if(u)for(const r of u)if(qR(r)){const n=XR(r,a),i=Gh[n?.in];i&&t[i].push({reference:r.reference,active:!0,value:r.value})}else t[Gh[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(qR(r)){const n=XR(r,a),i=Gh[n?.in];i&&t[i].push({reference:r.reference,active:!1,value:r.value})}else t[Gh[r.in]].push({id:crypto.randomUUID(),key:r.name,value:r.value,active:!1,in:r.in});return t.pathParameters.push(Sa("path")),t.queryParameters.push(Sa("query")),t.headers.push(Sa("header")),t.cookies.push(Sa("cookie")),t}async function kbu(u,e){const a=xX().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 bbu(u,e)};case"application/octet-stream":const t=u.payload?await CX(u.payload,e):[],r=t.length>0?await YE(t[0]):null;return{...a,type:u.contentType,binary:r};case"application/json":case"application/ld+json":return{...a,type:u.contentType,content:aN(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:aN(u.payload)}}}}async function uN(u,e,a,t){const r=await CX(e,t),n=r.length>0||Array.isArray(e),i=n?await kX(r):void 0;return{id:crypto.randomUUID(),key:u,value:n?"":e,type:n?"file":"text",active:a,files:i}}async function bbu(u,e){const a=xX().body.formData,t=u.contentType,r=u.payload?await Promise.all(Object.entries(u.payload).map(([o,s])=>uN(o,s,!0,e))):[],n=u["x-replay-disabled-payload"]?await Promise.all(Object.entries(u["x-replay-disabled-payload"]||{}).map(([o,s])=>uN(o,s,!1,e))):[];return{...a,[t]:[...r,...n,$s()]}}function aN(u){return u?JSON.stringify(u,null,2):""}function ybu(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 CX(u,e){return Array.isArray(u)?(await Promise.all(u.map(a=>tN(a,e)))).flat():typeof u=="string"?await tN(u,e):[]}async function tN(u,e){const a=/\$file\(['"](.+?)['"]\)/g,t=Array.from(u.matchAll(a));return Promise.all(t.map(r=>Cbu(r[1],e)))}async function Cbu(u,e){return await Ea.isAbsolute(u)?u:await Ea.resolve(await Ea.join(e,u))}const Yt=u=>!u||typeof u=="boolean"?{type:"object",properties:{}}:u.type?u:{...u,type:"object"},rN=(u,e,a)=>{if(!u.properties)return u;const t=u.properties[e],r=Yt(t);return{...u,properties:{...u.properties,[e]:{...r,...a}}}},Fbu=(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})},Abu=(u,e)=>{if(!u.properties)return u;const a={...u.properties};return delete a[e],{...u,properties:a}},Bbu=(u,e,a={type:"string"})=>{const t=u.properties||{};return{...u,type:"object",properties:{...t,[e]:a}}};function nN(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 iN(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(Do(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 Sbu(u){const e=u?.map(a=>({condition:a.condition,context:a.context,type:a.type==wt.SIMPLE?void 0:a.type}));if(e?.length!==0)return e}function zbu(u){if(!(!u||u.length===0))return[...u]}async function FX(u,e){return u.absolutePath?`$file('${await Ea.relative(e,u.absolutePath)}')`:null}async function wbu(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=>FX(i,e)))).filter(i=>i!==null)),n.length===0?"":n.length===1?n[0]:n}}async function Obu(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 wbu(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 Pbu(u){if(!u)return u;try{const e=JSON.parse(u);return typeof e=="object"?e:u}catch{return u}}async function jbu(u,e){if(u)switch(u.type){case"application/x-www-form-urlencoded":case"multipart/form-data":return{contentType:u.type,...await Obu(u,e)};case"application/octet-stream":return{contentType:u.type,payload:u.binary?await FX(u.binary,e):null};case"application/json":case"application/ld+json":return u.content?{contentType:u.type,payload:Pbu(u.content)}:void 0;default:return u.content?{contentType:u.type,payload:u.content}:void 0}}function Mbu(u){return{...u.schemeName?{schemeName:u.schemeName}:{scheme:{type:"http",scheme:"basic"}},values:{username:u.username,password:u.password}}}function Tbu(u){return{...u.schemeName?{schemeName:u.schemeName}:{scheme:{type:"apiKey",name:u.name,in:u.location.toLowerCase()}},values:{apiKey:u.key}}}function $bu(u){return{...u.schemeName?{schemeName:u.schemeName}:{scheme:{type:"http",scheme:"bearer"}},values:{token:u.token}}}function Rbu(u){return{...u.schemeName?{schemeName:u.schemeName}:{scheme:{type:"http",scheme:"digest"}},values:{username:u.username,password:u.password}}}function Nbu(u){const{flows:e,values:a}=SX(u);return{...u.schemeName?{schemeName:u.schemeName}:{scheme:{type:"openIdConnect",flows:e}},values:{...a,openIdConnectUrl:u.openIdConnectUrl,userInfoUrl:u.userInfoUrl,authRequestExtraParams:AX(u.authRequestExtraParams),tokenRequestExtraParams:BX(u.tokenRequestExtraParams)}}}function _bu(u){const{flows:e,values:a}=SX(u);return{...u.schemeName?{schemeName:u.schemeName}:{scheme:{type:"oauth2",flows:e}},values:{...a,authRequestExtraParams:AX(u.authRequestExtraParams),tokenRequestExtraParams:BX(u.tokenRequestExtraParams)}}}function ql(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 AX(u){return u.filter(e=>e.value||e.key).map(e=>({key:e.key,value:e.value,active:e.active}))}function BX(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 SX(u){let e;switch(u.grantType){case Fe.ClientCredentials:return e=u[Fe.ClientCredentials],{flows:{clientCredentials:{tokenUrl:e.tokenUrl,...ql(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,...ql(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,...ql(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,...ql(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,...ql(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,...ql(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 oN(u){const e=u.map(a=>{switch(a.securityType){case ye.OpenIDConnect:{const r=a[ye.OpenIDConnect];return Nbu(r)}case ye.OAuth2:{const r=a[ye.OAuth2];return _bu(r)}case ye.APIKey:{const r=a[ye.APIKey];return Tbu(r)}case ye.BasicAuth:{const r=a[ye.BasicAuth];return Mbu(r)}case ye.DigestAuth:{const r=a[ye.DigestAuth];return Rbu(r)}case ye.JWT:{const r=a[ye.JWT];return $bu(r)}default:return null}}).filter(a=>a!==null);return{"x-security":e.length?e:void 0}}function Lbu(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 Ibu(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:Lbu(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:zbu(d),outputs:nN(E),inputs:m?Yt(m):void 0,...oN(c),...iN(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/${Wf.escape(k.path)}/${k.method}`}else B&&(P["x-operation"]={...B,url:B.url.split("?")[0]});return{...z,...P,...oN(f),...iN(h),requestBody:await jbu(y,e),successCriteria:Sbu(v),outputs:nN(b)}}))})))}}}class Kbu extends oU{constructor(e,a){super(e),this.convertOperationToReplayValue=a}parse(e,a){return pbu(e.content,e.uri,e.type,this.storage.baseDir,a,this.convertOperationToReplayValue)}async stringify(e){const{arazzoObject:a}=await Ibu(e,this.storage.baseDir);return await Ea.extname(e.id)===".json"?JSON.stringify(a,null,2):Ao.dump(a)}}class Vbu{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=Ao.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",Ao.dump(r))}}class Gbu{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 Hbu=(u,e)=>({data:u,version:e});class CF extends Gbu{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(Hbu(e,this.version))}}function qbu(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 sN=2,Wbu="tabs.json";class Jbu extends CF{migrationMap={1:qbu};constructor(e){super(e,Wbu,pi(eU),sN)}async parse(e){let a=JSON.parse(e);a.version!==sN&&(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 lN(n["multipart/form-data"]),n["application/x-www-form-urlencoded"]=await lN(n["application/x-www-form-urlencoded"]),r.data.draftStep.requestBody.binary&&r.data.draftStep.requestBody.binary.absolutePath&&(r.data.draftStep.requestBody.binary=await YE(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 lN(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 kX(t)}return a}))}const Ubu=1,Zbu=1;class Qbu{constructor(e,a){this.project=e,this.convertOperationToReplayValue=a,this.localStorageSecretsProvider=new C3u(this.project.id),this.systemFilesStorage=this.isTauriApp?new iM(this.project.systemFilesDir):new nM(this.project.systemFilesDir),this.userFilesStorage=this.isTauriApp?new iM(this.project.userFilesDir):new nM(this.project.userFilesDir);const t=new b3u;this.historyStorage=new CF(this.systemFilesStorage,"history.json",[],Ubu),this.activeEnvironmentIdStorage=new CF(this.systemFilesStorage,"active_environment_id.json",LE,Zbu),this.tabsStateStorage=new Jbu(this.systemFilesStorage),this.environmentsStorage=new Vbu(this.userFilesStorage,this.localStorageSecretsProvider),this.collectionsStorage=new Kbu(this.userFilesStorage,this.convertOperationToReplayValue),this.apisStorage=new F3u(this.isTauriApp?this.userFilesStorage:t)}historyStorage;activeEnvironmentIdStorage;tabsStateStorage;environmentsStorage;collectionsStorage;apisStorage;isTauriApp=Ac();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=Ao.load(o);if(typeof s=="object"&&s!==null)if(typeof s.openapi=="string"){const l=await Ea.resolve(await Ea.join(this.userFilesStorage.baseDir,i)),c=await rM(l,s);t.push({uri:i,type:hn.FS,content:c})}else typeof s.arazzo=="string"&&(r.push({uri:i,type:hn.FS,content:s}),s.sourceDescriptions?.map(async l=>{const c=l.type,d=l.url,E=!c||c==="openapi",p=typeof d=="string"&&iU(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=>{try{const r=await rM(t);a.push({uri:t,type:hn.WEB,content:r})}catch(r){console.error(`Error parsing YAML from ${t}:`,r)}})),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 zX(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 Qbu(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 wX({defaultEnvironments:u}={}){return structuredClone({project:{id:"default",userFilesDir:"default",systemFilesDir:"default"},history:[],tabsState:pi(eU),activeEnvironmentId:LE,environments:u||XJ,collections:[],apis:[],requestController:null,apps:{apps:[],appsLoadingState:Zr.Idle},predefinedApiId:null,predefinedEnvironmentNames:new Set,predefinedInputNames:new Set})}const Ybu=II(wX(),KI(s3u({key:"replay-root-store"}),zX())),D9=H.createContext(Ybu),Xbu=D9.Provider;function Su(){const u=H.useContext(D9);return VI(u)}function eyu(){return{theme:"light",disableCollectionsTab:!1,oAuth2RedirectURI:null,corsProxyUrl:void 0,mockServer:void 0,certificates:[],isApiBased:!1,generatedEnvironments:[],generatedInputs:[]}}const uyu=eyu(),ayu=H.createContext(uyu);function ji(){const u=H.useContext(ayu);return VI(u)}function tyu(u,e){const{apps:{apiId:a}}=Su(),{corsProxyUrl:t,disableCollectionsTab:r,mockServer:n,oAuth2RedirectURI:i,certificates:o,storageKey:s,isApiBased:l}=ji();t.set(u?.corsProxyUrl??HEu),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 Sg=H.createContext({});function XE(){return H.useContext(Sg)||{}}const ryu="0.19.0-next.0",nyu={version:ryu};class iyu{client;_isInitialized=!1;constructor(){this.client=new VEu}get isInitialized(){return this._isInitialized}init(e){if(this.isInitialized)return;const a=!0,t=e?.tracerName||"desktop",r=e?.enableErrorInstrumentation??t==="desktop",n={serviceName:"replay",serviceVersion:nyu.version,version:"1.0.0",tracerName:t,collectorUrl:e?.collectorUrl||"",isProd:a,enableErrorInstrumentation:r};this.client.init({otel:{...e,...n}}),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 rb=new iyu;function yu(){const{telemetry:u}=XE();return rb.isInitialized||rb.init({tracerName:u?.tracerName,collectorUrl:u?.collectorUrl,enableErrorInstrumentation:u?.enableErrorInstrumentation}),{sendEvent:(e,a)=>{rb.sendEvent(e,a)}}}const Tt=800;function Zs(u){"@babel/helpers - typeof";return Zs=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},Zs(u)}function oyu(u,e){if(Zs(u)!="object"||!u)return u;var a=u[Symbol.toPrimitive];if(a!==void 0){var t=a.call(u,e);if(Zs(t)!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(u)}function OX(u){var e=oyu(u,"string");return Zs(e)=="symbol"?e:e+""}function ad(u,e,a){return(e=OX(e))in u?Object.defineProperty(u,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):u[e]=a,u}function cN(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?cN(Object(a),!0).forEach(function(t){ad(u,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(a)):cN(Object(a)).forEach(function(t){Object.defineProperty(u,t,Object.getOwnPropertyDescriptor(a,t))})}return u}function syu(u){if(Array.isArray(u))return u}function lyu(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 FF(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 PX(u,e){if(u){if(typeof u=="string")return FF(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)?FF(u,e):void 0}}function cyu(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
525
+ `};return Gvu(o.getText(),c,p).map(function(x){return zi.replace(_u.create(o.positionAt(x.offset),o.positionAt(x.offset+x.length)),x.content)})}}}function cl(){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)&&o.workflowId===r.workflowId&&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 Fg=nX({});let KR=null;function iX(u){KR!==u&&(KR=u,Fg.configure({validate:!0,schemas:[{uri:"stub://test",fileMatch:["*"],schema:u}]}))}function oX(u){const e=RD.create("stub.json","json",0,u),a=Fg.parseJSONDocument(e);return{textDoc:e,jsonDoc:a}}const sX=Qa.define({create(){},update(u){return u}}),lX=u=>u.field(sX,!1),jku=({store:u,isResponse:e,apiOperation:a})=>{const r=G9(u).data.get();let n=a?.body?.mediaTypes?.[Mt.JSON]?.schema;if(Ka(r,We.Step)&&e){const i=r.response?.status;i&&(n=a?.responses?.[i]?.mediaTypes?.[Mt.JSON]?.schema)}return[sX.init(()=>({schema:pi(n||{}),store:u}))]};function Mku(){return async u=>{const{schema:e}=lX(u.state)||{};if(!e)return[];iX(e);const a=u.state.doc,{textDoc:t,jsonDoc:r}=oX(a.toString());return(await Fg.doValidation(t,r))?.map(i=>({from:vF(a,i.range.start),to:vF(a,i.range.end),message:i.message,severity:Rku[i.severity||3]}))}}const Tku=Cn.highest(Sc.of([{key:"Tab",run:u=>BQ(u)}]));function $ku(){return async function(e){const a={from:e.pos,to:e.pos,options:[],filter:!1},{schema:t}=lX(e.state)||{};if(!t)return a;iX(t);const r=e.state.doc,n=vF.bind(null,r),{textDoc:i,jsonDoc:o}=oX(r.toString()),s=e.state.doc.lineAt(e.pos),l=s.number-1,c=e.pos-s.from,d=await Fg.doComplete(i,{line:l,character:c},o);if(!d)return a;const E=e.state.sliceDoc(s.from,e.pos);if(E.trim().endsWith(",")||Nku(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 Rku={1:"error",2:"warning",3:"info",4:"hint"};function vF(u,e){return u.line(e.line+1).from+e.character}function Nku(u){try{return JSON.parse(`{${u}}`),!0}catch{return!1}}const cX=iu.define();function Mc(u){const e=u.activeEnvironmentId.get();return u.environments.find(a=>a.name.get()===e)?.get()||u.environments[0].get()}const kF=u=>Ca.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=Mc(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=Xf(c);for(const E of d){const p=s+E.start,x=s+E.end;if(!(p>=x))if(E.prefix==="inputs"){const m=oA(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}),_ku=nX({});function Lku(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 Iku(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 Kku=u=>Ca.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=RD.create("inmemory://model.json","json",0,t),p=_ku.parseJSONDocument(d)?.root;r=Lku(p)?p:void 0}catch{r=void 0}const i=Mc(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=Iku(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=Xf(m);for(const h of g){const f=p+h.start,k=p+h.end;if(!(f>=k))if(h.prefix==="inputs"){const y=oA(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}),fn={[Mt.Text]:{name:"Text",extensions:[Me.lineWrapping],stateExtensions:[kF]},[Mt.JSON]:{name:"JSON",extensions:[qxu(),bgu(Mku(),{delay:0,needsRefresh:u=>u.transactions.some(e=>e.effects.some(a=>a.is(cX)))}),nQ.data.of({autocomplete:$ku()}),Tku],stateExtensions:[jku,Kku]},[Mt.XML]:{name:"XML",extensions:[cgu()],stateExtensions:[kF]}},Vku={[Mt.Image]:{name:"Image",extensions:[],stateExtensions:[]}},Gku={[Mt.HTML]:{name:"HTML",extensions:[Lfu()],stateExtensions:[kF]}},mo={...fn,...Vku,...Gku},dX={[Mt.FormData]:{name:"form-data",extensions:void 0},[Mt["application/x-www-form-urlencoded"]]:{name:"x-www-form-urlencoded",extensions:void 0}},EX={[Mt.Binary]:{name:"Binary",extensions:void 0}},Us={...fn,...dX,...EX},Hku=Object.keys(fn),d9=Object.keys(dX),pX=Object.keys(EX);function mX(u=[],e){const a={};return u.forEach(t=>{const r=String(t[e]);a[r]||(a[r]=[]),a[r].push(t)}),a}const ZE={active:!0,key:"",value:""};function ho(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})),Sa(e.in)]}function QE(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 X0(){return{id:crypto.randomUUID(),...ZE}}function E0(){return{id:crypto.randomUUID(),...ZE,description:""}}function Sa(u){return{...ZE,id:crypto.randomUUID(),in:u}}function $s(){return{id:crypto.randomUUID(),...ZE,type:"text",files:null}}function E9(){return{id:crypto.randomUUID(),...ZE,sendIn:jt.URL}}function tb(u){return u.map(e=>({id:crypto.randomUUID(),key:"",value:e,active:!0}))}function Ag(u,e){return u.filter(a=>a.active&&a.value).map(({value:a})=>(e?Yu(a,e):a).trim())}function Co(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 hX(u,e){return u.map(({value:a,...t})=>({...t,value:Yu(a,e)}))}function qku(u,e){if(!u.startsWith("$components.parameters."))return null;const a=u.replace("$components.parameters.","");return a&&e[a]||null}function za(u=[],e={}){const a=[];for(const t of u)if(Do(t)){const r=qku(t.reference,e);r&&a.push({...r,active:t.active,value:t.value||r.value})}else a.push(t);return a}function io(u){return Object.entries(u).map(([e,a])=>({id:crypto.randomUUID(),key:"",value:e,active:!0,description:a}))}function Wku(u){return u.replace(/{/g,"{{").replace(/}/g,"}}")}const VR={documentedOAuth2Types:[],grantType:Fe.ClientCredentials,authRequestExtraParams:[X0()],tokenRequestExtraParams:[E9()],[Fe.ClientCredentials]:{clientId:"",clientSecret:"",clientAssertion:"",tokenUrl:"",scopes:[E0()],accessToken:""},[Fe.ClientCredentialsWithJwtAssertion]:{clientId:"",clientSecret:"",clientAssertion:"",tokenUrl:"",scopes:[E0()],accessToken:""},[Fe.AuthorizationCode]:{clientId:"",clientSecret:"",tokenUrl:"",authorizationUrl:"",callbackUrl:"",availableScopes:[],scopes:[E0()],codeVerifier:"",codeChallenge:"",accessToken:""},[Fe.AuthorizationCodeWithPkce]:{clientId:"",clientSecret:"",tokenUrl:"",authorizationUrl:"",callbackUrl:"",availableScopes:[],scopes:[E0()],codeVerifier:"",codeChallenge:"",accessToken:""},[Fe.Implicit]:{clientId:"",authorizationUrl:"",callbackUrl:"",availableScopes:[],scopes:[E0()],accessToken:""},[Fe.Password]:{username:"",password:"",clientId:"",clientSecret:"",tokenUrl:"",accessToken:"",scopes:[E0()]}},Jku={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:P0.Header,name:"",key:""},[ye.OAuth2]:VR,[ye.OpenIDConnect]:{...VR,openIdConnectUrl:"",userInfoUrl:""}},bF="urn:ietf:params:oauth:client-assertion-type:jwt-bearer",Uku={[wt.SIMPLE]:{condition:"",type:wt.SIMPLE},[wt.REGEX]:{condition:"",type:wt.REGEX,context:""},[wt.JSONPATH]:{condition:"",type:wt.JSONPATH,context:""},[wt.XPATH]:{condition:"",type:wt.XPATH,context:""}};function ND(){return structuredClone({type:ut.Text,content:"",activeExampleName:"",formData:{"multipart/form-data":[$s()],"application/x-www-form-urlencoded":[$s()]},binary:null})}const Zku={method:"GET",url:"",security:[Sn()],body:ND(),queryParameters:[X0()],headers:[X0()],cookies:[X0()],pathParameters:[X0()]};function xX(){return structuredClone(Zku)}function Sn(){return pi(Jku)}function Qku(u){return pi({id:crypto.randomUUID(),...Uku[u]})}function DX(u,e,a){for(const t of a){const r=GR(u,t),n=GR(e,t);if(typeof r=="object"&&typeof n=="object"){if(!DX(r,n,a))return!1}else if(r!==n)return!1}return!0}function GR(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 Yku(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 ebu(u){switch(u){case"query":return P0.Query;case"cookie":return P0.Cookie;case"header":return P0.Header;default:return}}function ubu(u,e,a){const{security:t}=e,r=G1u(u);if(!a)return!1;const n=p9(a),i=n.map(c=>c.securityType),o=t.map(c=>c.securityType);if(!Yku(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||DX(c,x,tbu(d,E)),g=abu(c,d,c[ye.OAuth2]?.grantType,r),h=!!(p&&x&&m&&g);l.push(!a.security?.length||h)}),l.includes(!1)}function abu(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=Ag(u[ye.OAuth2][a]?.scopes,t);return Xku(n,r)}return!0}function tbu(u,e){return u===ye.APIKey?[`${ye.APIKey}/name`,`${ye.APIKey}/location`]:u===ye.OAuth2?[`${ye.OAuth2}/grantType`,...rbu(e)]:u===ye.OpenIDConnect?[`${ye.OpenIDConnect}/openIdConnectUrl`]:[]}function rbu(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 nbu(u){return u.map(e=>{const a=e.map(t=>t.id).join("_");return e.map(t=>({...t,schemeId:a}))})}function ibu(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(m9(i))}),{id:r,security:n}});return e.length?a:[]}function obu(u,e){const a=u.security||[];return a?.length?vX(a).map((t,r)=>m9(t)):[]}function p9(u){const a=(u.security||[])[0];return a?a.map(t=>m9(t)):[Sn()]}function m9(u,e){const a={...Sn(),securitySchemeId:u.id},t=Bg(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=ka(r+W.SecurityVariablesEnvSuffix.Username)),a[ye.BasicAuth].password||(a[ye.BasicAuth].password=ka(r+W.SecurityVariablesEnvSuffix.Password))),t===ye.DigestAuth&&(a[ye.DigestAuth].username||(a[ye.DigestAuth].username=ka(r+W.SecurityVariablesEnvSuffix.Username)),a[ye.DigestAuth].password||(a[ye.DigestAuth].password=ka(r+W.SecurityVariablesEnvSuffix.Password))),t===ye.JWT&&!a[ye.JWT].token&&(a[ye.JWT].token=ka(r+W.SecurityVariablesEnvSuffix.JWTToken)),t===ye.APIKey&&!a[ye.APIKey].key){a[ye.APIKey].name=u.name||"",a[ye.APIKey].key=ka(r+W.SecurityVariablesEnvSuffix.APIKey);const n=ebu(u.in);n&&(a[ye.APIKey].location=n)}if(t===ye.OAuth2){const n=x9(u),i=ka(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=ka(r+W.SecurityVariablesEnvSuffix.ClientId),o[Fe.AuthorizationCode].authorizationUrl=u.flows?.authorizationCode?.authorizationUrl||"",o[Fe.AuthorizationCode].tokenUrl=u.flows?.authorizationCode?.tokenUrl||"",o[Fe.AuthorizationCode].clientSecret=ka(r+W.SecurityVariablesEnvSuffix.ClientSecret),o[Fe.AuthorizationCode].availableScopes=Object.keys(u.flows?.authorizationCode?.scopes||{})||[],o[Fe.AuthorizationCode].scopes=[...io(u.flows?.authorizationCode?.scopes||{})||[],E0()]),s===Fe.AuthorizationCodeWithPkce&&!o[Fe.AuthorizationCodeWithPkce].accessToken&&(o[Fe.AuthorizationCodeWithPkce].accessToken=i,o[Fe.AuthorizationCodeWithPkce].clientId=ka(r+W.SecurityVariablesEnvSuffix.ClientId),o[Fe.AuthorizationCodeWithPkce].authorizationUrl=u.flows?.authorizationCode?.authorizationUrl||"",o[Fe.AuthorizationCodeWithPkce].tokenUrl=u.flows?.authorizationCode?.tokenUrl||"",o[Fe.AuthorizationCodeWithPkce].clientSecret=ka(r+W.SecurityVariablesEnvSuffix.ClientSecret),o[Fe.AuthorizationCodeWithPkce].availableScopes=Object.keys(u.flows?.authorizationCode?.scopes||{})||[],o[Fe.AuthorizationCodeWithPkce].scopes=[...io(u.flows?.authorizationCode?.scopes||{}),E0()]),s===Fe.ClientCredentials&&!o[Fe.ClientCredentials].accessToken&&(o[Fe.ClientCredentials].accessToken=i,o[Fe.ClientCredentials].clientId=ka(r+W.SecurityVariablesEnvSuffix.ClientId),o[Fe.ClientCredentials].clientSecret=ka(r+W.SecurityVariablesEnvSuffix.ClientSecret),o[Fe.ClientCredentials].tokenUrl=u.flows?.clientCredentials?.tokenUrl||"",o[Fe.ClientCredentials].scopes=[...io(u.flows?.clientCredentials?.scopes||{}),E0()]),s===Fe.ClientCredentialsWithJwtAssertion&&!o[Fe.ClientCredentialsWithJwtAssertion].accessToken&&(o[Fe.ClientCredentialsWithJwtAssertion].accessToken=i,o[Fe.ClientCredentialsWithJwtAssertion].clientId=ka(r+W.SecurityVariablesEnvSuffix.ClientId),o[Fe.ClientCredentialsWithJwtAssertion].clientAssertion=ka(r+W.SecurityVariablesEnvSuffix.ClientAssertion),o[Fe.ClientCredentialsWithJwtAssertion].scopes=[...io(u.flows?.clientCredentials?.scopes||{}),E0()]),s===Fe.Implicit&&!o[Fe.Implicit].accessToken&&(o[Fe.Implicit].accessToken=i,o[Fe.Implicit].clientId=ka(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=[...io(u.flows?.implicit?.scopes||{}),E0()]),s===Fe.Password&&!o[Fe.Password].accessToken&&(o[Fe.Password].accessToken=i,o[Fe.Password].clientId=ka(r+W.SecurityVariablesEnvSuffix.ClientId),o[Fe.Password].clientSecret=ka(r+W.SecurityVariablesEnvSuffix.ClientSecret),o[Fe.Password].tokenUrl=u.flows?.password?.tokenUrl||"",o[Fe.Password].scopes=[...io(u.flows?.password?.scopes||{}),E0()])})}if(t===ye.OpenIDConnect){const n=ka(r+W.SecurityVariablesEnvSuffix.Token),i=a[ye.OpenIDConnect];i[Fe.AuthorizationCode].accessToken||(i[Fe.AuthorizationCode].accessToken=n,i[Fe.AuthorizationCode].clientId=ka(r+W.SecurityVariablesEnvSuffix.ClientId),i[Fe.AuthorizationCode].clientSecret=ka(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=ka(r+W.SecurityVariablesEnvSuffix.ClientId),i[Fe.AuthorizationCodeWithPkce].clientSecret=ka(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=ka(r+W.SecurityVariablesEnvSuffix.ClientId))}return a}function sbu(u,e="",a){const t=mX(u.parameters,"in"),r=fX(u),n=p9(u),i=ho(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:ho(t.path||[],{in:"path"}),method:u.method.toLocaleUpperCase(),url:QE(Wku(u.path),i),headers:ho(t.header||[],{in:"header"}),queryParameters:i,cookies:ho(t.cookie||[],{in:"cookie"}),body:r,security:n},response:null}}function h9(u){const e=mX(u.parameters,"in"),a=fX(u),t=p9(u);return{parameters:{queryParameters:ho(e.query||[],{in:"query"}),headers:ho(e.header||[],{in:"header"}),cookies:ho(e.cookie||[],{in:"cookie"}),pathParameters:ho(e.path||[],{initializeWithInputs:!0,in:"path"})},requestBody:a,security:t}}function fX(u){const e=u.body?.mediaTypes;if(!e||!Object.keys(e).length)return ND();const a=lbu(e,u),t=a?.name||"",r=!d9.includes(t)&&!pX.includes(t),n=yF(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{...ND(),activeExampleName:u.body?.activeExampleName||n[0]?.key||"",...a&&{type:a.name},content:i,formData:{"multipart/form-data":HR(e[Mt.FormData]),"application/x-www-form-urlencoded":HR(e[Mt["application/x-www-form-urlencoded"]])}}}function gX(u){return u?{...(Object.keys(u?.body?.mediaTypes||{})||[]).reduce((a,t)=>(a[t]={name:t,extensions:void 0},a),{}),...Us}:Us}function HR(u){if(!u)return[$s()];if(!u.parameters)return[$s()];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($s()),e}function yF(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 lbu(u,e){const a=gX(e),t=Object.keys(u).find(r=>!!a[r]);return t?u[t]:null}function cbu(u){return!u?.security?.length||!u?[]:obu(u)}function vX(u){const e=new Set;return u.flat().filter(a=>e.has(a.id)?!1:(e.add(a.id),!0))}function Bg(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 dbu(u,e){if(u==="clientCredentials"&&e&&"x-assertionType"in e&&e["x-assertionType"]===bF)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 Ebu(u,e){const a=u?.security;if(!a?.length)return[];const n=nbu(a).flat().filter(i=>i.schemeId===e).find(i=>Bg(i)===ye.OAuth2);return x9(n)}function x9(u){return Object.entries(u?.flows||{}).map(([e,a])=>dbu(e,a)).filter(Boolean)}async function YE(u){try{const e=await h3u(u),a=await aU(u);return{absolutePath:u,file:new File([e],a)}}catch(e){return console.error("Failed to init replay file",e),null}}async function kX(u){return(await Promise.allSettled(u.map(a=>YE(a)))).map(a=>a.status==="fulfilled"?a.value:null).filter(a=>a!==null)}async function pbu(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 mbu({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:eN(s.parameters,s["x-replay-disabled-parameters"],u.components?.parameters),outputs:YR(s.outputs),security:UR(s["x-security"]),steps:await Promise.all(s.steps.map(async l=>{const c=eN(l.parameters,l["x-replay-disabled-parameters"],u.components?.parameters),d=l["x-operation"]??null;d&&(d.url=QE(d.url,c.queryParameters.filter(HI)));const E=hbu(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 kbu(l.requestBody,t);return{...l,state:Nu.Normal,parameters:c,outputs:YR(l.outputs),successCriteria:l.successCriteria?.map(m=>({...m,type:m.type??wt.SIMPLE}))||[],requestBody:x,xOperation:d,security:UR(l["x-security"],p),operation:E}}))})))}}async function mbu({projectPath:u,apiUrl:e,collectionId:a}){if(iU(e))return e;if(await Ea.isAbsolute(e))return await Ea.relative(u,e);const t=await Ea.resolve(await Ea.join(u,a,"..",e));return await Ea.relative(u,t)}function hbu(u,e,a){if(u["x-operation"])return null;const{path:t,method:r,apiId:n}=bX({operationPath:u.operationPath,parsedSourceDescriptions:e}),{operationId:i,apiId:o}=xbu({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=ybu(i,l);return{apiId:s,path:c?.path??"",method:c?.method??"",operationId:i}}return{apiId:s,path:t??"",method:r??"",operationId:i}}function xbu({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 qR(u){return"reference"in u&&typeof u.reference=="string"}function bX({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:Wf.unescape(l.pop()||""),method:c.toLowerCase(),apiId:i}}catch{return{path:"",method:"",apiId:null}}}function Dbu(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 yX(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 fbu(u){return{query:P0.Query,header:P0.Header,cookie:P0.Cookie}[u.toLowerCase()]||P0.Header}function gbu(u){return{body:jt.Body,header:jt.Header,url:jt.URL}[u.toLowerCase()]||jt.URL}function WR(u,e,a){return Object.keys(u).reduce((t,r)=>{const n=yX(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:hs(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:hs(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:hs(u[r].availableScopes),scopes:hs(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:hs(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:hs(u[r].availableScopes),scopes:hs(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 JR(u,e,a){const r={...Sn(),securityType:u},n=Object.keys(e.flows||{})[0],i=yX(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:fbu(e.in),name:e.name,key:a.apiKey,schemeName:e.id}};case ye.OAuth2:return{...r,[ye.OAuth2]:{...r[ye.OAuth2],...WR(e.flows||{},a||{},r[ye.OAuth2]),authRequestExtraParams:ZR(a.authRequestExtraParams),tokenRequestExtraParams:QR(a.tokenRequestExtraParams),grantType:i,schemeName:e.id}};case ye.OpenIDConnect:return{...r,[ye.OpenIDConnect]:{...r[ye.OpenIDConnect],...WR(a.flows||{},a||{},r[ye.OpenIDConnect]),openIdConnectUrl:a.openIdConnectUrl,userInfoUrl:a.userInfoUrl,authRequestExtraParams:ZR(a.authRequestExtraParams),tokenRequestExtraParams:QR(a.tokenRequestExtraParams),grantType:i,schemeName:e.id}};default:return r}}function vbu(u,e){return[...u.map(t=>{if("scheme"in t){const n=Dbu(t.scheme);return JR(n,t.scheme,t.values)}const r=e.find(n=>n.id===t.schemeName);if(r){const n=Bg(r),i=JR(n,r,t.values);return i.securitySchemeId=r.id,i}return Sn()})]}function UR(u=[],e){const a=vX(e?.security||[]);return u.length?vbu(u,a):[Sn()]}function hs(u,e){const a=io(u||{}),t=io(e||{});return[...a,...t,E0()]}function ZR(u){return(u||[]).map(e=>({id:crypto.randomUUID(),key:e.key??"",value:e.value??"",active:e.active??!0})).concat(X0())}function QR(u){return(u||[]).map(e=>({id:crypto.randomUUID(),key:e.key??"",value:e.value??"",active:e.active??!0,sendIn:gbu(e.in)})).concat(E9())}function YR(u){if(!u)return[X0()];const e=[];for(const a in u)e.push({id:crypto.randomUUID(),key:a,value:u[a],active:!0});return e.push(X0()),e}const Gh={query:"queryParameters",path:"pathParameters",header:"headers",cookie:"cookies"};function XR(u,e){const a="$components.parameters.";if(u.reference.startsWith(a)){const t=u.reference.replace(a,"");return e?.[t]}}function eN(u,e,a){if(!u&&!e)return{pathParameters:[Sa("path")],queryParameters:[Sa("query")],headers:[Sa("header")],cookies:[Sa("cookie")]};const t={pathParameters:[],queryParameters:[],headers:[],cookies:[]};if(u)for(const r of u)if(qR(r)){const n=XR(r,a),i=Gh[n?.in];i&&t[i].push({reference:r.reference,active:!0,value:r.value})}else t[Gh[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(qR(r)){const n=XR(r,a),i=Gh[n?.in];i&&t[i].push({reference:r.reference,active:!1,value:r.value})}else t[Gh[r.in]].push({id:crypto.randomUUID(),key:r.name,value:r.value,active:!1,in:r.in});return t.pathParameters.push(Sa("path")),t.queryParameters.push(Sa("query")),t.headers.push(Sa("header")),t.cookies.push(Sa("cookie")),t}async function kbu(u,e){const a=xX().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 bbu(u,e)};case"application/octet-stream":const t=u.payload?await CX(u.payload,e):[],r=t.length>0?await YE(t[0]):null;return{...a,type:u.contentType,binary:r};case"application/json":case"application/ld+json":return{...a,type:u.contentType,content:aN(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:aN(u.payload)}}}}async function uN(u,e,a,t){const r=await CX(e,t),n=r.length>0||Array.isArray(e),i=n?await kX(r):void 0;return{id:crypto.randomUUID(),key:u,value:n?"":e,type:n?"file":"text",active:a,files:i}}async function bbu(u,e){const a=xX().body.formData,t=u.contentType,r=u.payload?await Promise.all(Object.entries(u.payload).map(([o,s])=>uN(o,s,!0,e))):[],n=u["x-replay-disabled-payload"]?await Promise.all(Object.entries(u["x-replay-disabled-payload"]||{}).map(([o,s])=>uN(o,s,!1,e))):[];return{...a,[t]:[...r,...n,$s()]}}function aN(u){return u?JSON.stringify(u,null,2):""}function ybu(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 CX(u,e){return Array.isArray(u)?(await Promise.all(u.map(a=>tN(a,e)))).flat():typeof u=="string"?await tN(u,e):[]}async function tN(u,e){const a=/\$file\(['"](.+?)['"]\)/g,t=Array.from(u.matchAll(a));return Promise.all(t.map(r=>Cbu(r[1],e)))}async function Cbu(u,e){return await Ea.isAbsolute(u)?u:await Ea.resolve(await Ea.join(e,u))}const Yt=u=>!u||typeof u=="boolean"?{type:"object",properties:{}}:u.type?u:{...u,type:"object"},rN=(u,e,a)=>{if(!u.properties)return u;const t=u.properties[e],r=Yt(t);return{...u,properties:{...u.properties,[e]:{...r,...a}}}},Fbu=(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})},Abu=(u,e)=>{if(!u.properties)return u;const a={...u.properties};return delete a[e],{...u,properties:a}},Bbu=(u,e,a={type:"string"})=>{const t=u.properties||{};return{...u,type:"object",properties:{...t,[e]:a}}};function nN(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 iN(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(Do(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 Sbu(u){const e=u?.map(a=>({condition:a.condition,context:a.context,type:a.type==wt.SIMPLE?void 0:a.type}));if(e?.length!==0)return e}function zbu(u){if(!(!u||u.length===0))return[...u]}async function FX(u,e){return u.absolutePath?`$file('${await Ea.relative(e,u.absolutePath)}')`:null}async function wbu(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=>FX(i,e)))).filter(i=>i!==null)),n.length===0?"":n.length===1?n[0]:n}}async function Obu(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 wbu(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 Pbu(u){if(!u)return u;try{const e=JSON.parse(u);return typeof e=="object"?e:u}catch{return u}}async function jbu(u,e){if(u)switch(u.type){case"application/x-www-form-urlencoded":case"multipart/form-data":return{contentType:u.type,...await Obu(u,e)};case"application/octet-stream":return{contentType:u.type,payload:u.binary?await FX(u.binary,e):null};case"application/json":case"application/ld+json":return u.content?{contentType:u.type,payload:Pbu(u.content)}:void 0;default:return u.content?{contentType:u.type,payload:u.content}:void 0}}function Mbu(u){return{...u.schemeName?{schemeName:u.schemeName}:{scheme:{type:"http",scheme:"basic"}},values:{username:u.username,password:u.password}}}function Tbu(u){return{...u.schemeName?{schemeName:u.schemeName}:{scheme:{type:"apiKey",name:u.name,in:u.location.toLowerCase()}},values:{apiKey:u.key}}}function $bu(u){return{...u.schemeName?{schemeName:u.schemeName}:{scheme:{type:"http",scheme:"bearer"}},values:{token:u.token}}}function Rbu(u){return{...u.schemeName?{schemeName:u.schemeName}:{scheme:{type:"http",scheme:"digest"}},values:{username:u.username,password:u.password}}}function Nbu(u){const{flows:e,values:a}=SX(u);return{...u.schemeName?{schemeName:u.schemeName}:{scheme:{type:"openIdConnect",flows:e}},values:{...a,openIdConnectUrl:u.openIdConnectUrl,userInfoUrl:u.userInfoUrl,authRequestExtraParams:AX(u.authRequestExtraParams),tokenRequestExtraParams:BX(u.tokenRequestExtraParams)}}}function _bu(u){const{flows:e,values:a}=SX(u);return{...u.schemeName?{schemeName:u.schemeName}:{scheme:{type:"oauth2",flows:e}},values:{...a,authRequestExtraParams:AX(u.authRequestExtraParams),tokenRequestExtraParams:BX(u.tokenRequestExtraParams)}}}function ql(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 AX(u){return u.filter(e=>e.value||e.key).map(e=>({key:e.key,value:e.value,active:e.active}))}function BX(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 SX(u){let e;switch(u.grantType){case Fe.ClientCredentials:return e=u[Fe.ClientCredentials],{flows:{clientCredentials:{tokenUrl:e.tokenUrl,...ql(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,...ql(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,...ql(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,...ql(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,...ql(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,...ql(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 oN(u){const e=u.map(a=>{switch(a.securityType){case ye.OpenIDConnect:{const r=a[ye.OpenIDConnect];return Nbu(r)}case ye.OAuth2:{const r=a[ye.OAuth2];return _bu(r)}case ye.APIKey:{const r=a[ye.APIKey];return Tbu(r)}case ye.BasicAuth:{const r=a[ye.BasicAuth];return Mbu(r)}case ye.DigestAuth:{const r=a[ye.DigestAuth];return Rbu(r)}case ye.JWT:{const r=a[ye.JWT];return $bu(r)}default:return null}}).filter(a=>a!==null);return{"x-security":e.length?e:void 0}}function Lbu(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 Ibu(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:Lbu(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:zbu(d),outputs:nN(E),inputs:m?Yt(m):void 0,...oN(c),...iN(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/${Wf.escape(k.path)}/${k.method}`}else B&&(P["x-operation"]={...B,url:B.url.split("?")[0]});return{...z,...P,...oN(f),...iN(h),requestBody:await jbu(y,e),successCriteria:Sbu(v),outputs:nN(b)}}))})))}}}class Kbu extends oU{constructor(e,a){super(e),this.convertOperationToReplayValue=a}parse(e,a){return pbu(e.content,e.uri,e.type,this.storage.baseDir,a,this.convertOperationToReplayValue)}async stringify(e){const{arazzoObject:a}=await Ibu(e,this.storage.baseDir);return await Ea.extname(e.id)===".json"?JSON.stringify(a,null,2):Ao.dump(a)}}class Vbu{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=Ao.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",Ao.dump(r))}}class Gbu{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 Hbu=(u,e)=>({data:u,version:e});class CF extends Gbu{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(Hbu(e,this.version))}}function qbu(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 sN=2,Wbu="tabs.json";class Jbu extends CF{migrationMap={1:qbu};constructor(e){super(e,Wbu,pi(eU),sN)}async parse(e){let a=JSON.parse(e);a.version!==sN&&(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 lN(n["multipart/form-data"]),n["application/x-www-form-urlencoded"]=await lN(n["application/x-www-form-urlencoded"]),r.data.draftStep.requestBody.binary&&r.data.draftStep.requestBody.binary.absolutePath&&(r.data.draftStep.requestBody.binary=await YE(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 lN(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 kX(t)}return a}))}const Ubu=1,Zbu=1;class Qbu{constructor(e,a){this.project=e,this.convertOperationToReplayValue=a,this.localStorageSecretsProvider=new C3u(this.project.id),this.systemFilesStorage=this.isTauriApp?new iM(this.project.systemFilesDir):new nM(this.project.systemFilesDir),this.userFilesStorage=this.isTauriApp?new iM(this.project.userFilesDir):new nM(this.project.userFilesDir);const t=new b3u;this.historyStorage=new CF(this.systemFilesStorage,"history.json",[],Ubu),this.activeEnvironmentIdStorage=new CF(this.systemFilesStorage,"active_environment_id.json",LE,Zbu),this.tabsStateStorage=new Jbu(this.systemFilesStorage),this.environmentsStorage=new Vbu(this.userFilesStorage,this.localStorageSecretsProvider),this.collectionsStorage=new Kbu(this.userFilesStorage,this.convertOperationToReplayValue),this.apisStorage=new F3u(this.isTauriApp?this.userFilesStorage:t)}historyStorage;activeEnvironmentIdStorage;tabsStateStorage;environmentsStorage;collectionsStorage;apisStorage;isTauriApp=Ac();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=Ao.load(o);if(typeof s=="object"&&s!==null)if(typeof s.openapi=="string"){const l=await Ea.resolve(await Ea.join(this.userFilesStorage.baseDir,i)),c=await rM(l,s);t.push({uri:i,type:hn.FS,content:c})}else typeof s.arazzo=="string"&&(r.push({uri:i,type:hn.FS,content:s}),s.sourceDescriptions?.map(async l=>{const c=l.type,d=l.url,E=!c||c==="openapi",p=typeof d=="string"&&iU(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=>{try{const r=await rM(t);a.push({uri:t,type:hn.WEB,content:r})}catch(r){console.error(`Error parsing YAML from ${t}:`,r)}})),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 zX(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 Qbu(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 wX({defaultEnvironments:u}={}){return structuredClone({project:{id:"default",userFilesDir:"default",systemFilesDir:"default"},history:[],tabsState:pi(eU),activeEnvironmentId:LE,environments:u||XJ,collections:[],apis:[],requestController:null,apps:{apps:[],appsLoadingState:Zr.Idle},predefinedApiId:null,predefinedEnvironmentNames:new Set,predefinedInputNames:new Set})}const Ybu=II(wX(),KI(s3u({key:"replay-root-store"}),zX())),D9=H.createContext(Ybu),Xbu=D9.Provider;function Su(){const u=H.useContext(D9);return VI(u)}function eyu(){return{theme:"light",disableCollectionsTab:!1,oAuth2RedirectURI:null,corsProxyUrl:void 0,mockServer:void 0,certificates:[],isApiBased:!1,generatedEnvironments:[],generatedInputs:[]}}const uyu=eyu(),ayu=H.createContext(uyu);function ji(){const u=H.useContext(ayu);return VI(u)}function tyu(u,e){const{apps:{apiId:a}}=Su(),{corsProxyUrl:t,disableCollectionsTab:r,mockServer:n,oAuth2RedirectURI:i,certificates:o,storageKey:s,isApiBased:l}=ji();t.set(u?.corsProxyUrl??HEu),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 Sg=H.createContext({});function XE(){return H.useContext(Sg)||{}}const ryu="0.19.0-next.1",nyu={version:ryu};class iyu{client;_isInitialized=!1;constructor(){this.client=new VEu}get isInitialized(){return this._isInitialized}init(e){if(this.isInitialized)return;const a=!0,t=e?.tracerName||"desktop",r=e?.enableErrorInstrumentation??t==="desktop",n={serviceName:"replay",serviceVersion:nyu.version,version:"1.0.0",tracerName:t,collectorUrl:e?.collectorUrl||"",isProd:a,enableErrorInstrumentation:r};this.client.init({otel:{...e,...n}}),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 rb=new iyu;function yu(){const{telemetry:u}=XE();return rb.isInitialized||rb.init({tracerName:u?.tracerName,collectorUrl:u?.collectorUrl,enableErrorInstrumentation:u?.enableErrorInstrumentation}),{sendEvent:(e,a)=>{rb.sendEvent(e,a)}}}const Tt=800;function Zs(u){"@babel/helpers - typeof";return Zs=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},Zs(u)}function oyu(u,e){if(Zs(u)!="object"||!u)return u;var a=u[Symbol.toPrimitive];if(a!==void 0){var t=a.call(u,e);if(Zs(t)!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(u)}function OX(u){var e=oyu(u,"string");return Zs(e)=="symbol"?e:e+""}function ad(u,e,a){return(e=OX(e))in u?Object.defineProperty(u,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):u[e]=a,u}function cN(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?cN(Object(a),!0).forEach(function(t){ad(u,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(a)):cN(Object(a)).forEach(function(t){Object.defineProperty(u,t,Object.getOwnPropertyDescriptor(a,t))})}return u}function syu(u){if(Array.isArray(u))return u}function lyu(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 FF(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 PX(u,e){if(u){if(typeof u=="string")return FF(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)?FF(u,e):void 0}}function cyu(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
526
526
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fi(u,e){return syu(u)||lyu(u,e)||PX(u,e)||cyu()}function dyu(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 Mi(u,e){if(u==null)return{};var a,t,r=dyu(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 Eyu=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function pyu(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=Mi(u,Eyu),m=H.useState(o!==void 0?o:a),g=fi(m,2),h=g[0],f=g[1],k=H.useState(s!==void 0?s:r),y=fi(k,2),v=y[0],b=y[1],C=H.useState(p!==void 0?p:i),B=fi(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 myu(u,e){if(!(u instanceof e))throw new TypeError("Cannot call a class as a function")}function dN(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,OX(t.key),t)}}function hyu(u,e,a){return e&&dN(u.prototype,e),a&&dN(u,a),Object.defineProperty(u,"prototype",{writable:!1}),u}function AF(u,e){return AF=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,t){return a.__proto__=t,a},AF(u,e)}function xyu(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&&AF(u,e)}function _D(u){return _D=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_D(u)}function jX(){try{var u=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(jX=function(){return!!u})()}function Dyu(u){if(u===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u}function fyu(u,e){if(e&&(Zs(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Dyu(u)}function gyu(u){var e=jX();return function(){var a,t=_D(u);if(e){var r=_D(this).constructor;a=Reflect.construct(t,arguments,r)}else a=t.apply(this,arguments);return fyu(this,a)}}function vyu(u){if(Array.isArray(u))return FF(u)}function kyu(u){if(typeof Symbol<"u"&&u[Symbol.iterator]!=null||u["@@iterator"]!=null)return Array.from(u)}function byu(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
527
527
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function f9(u){return vyu(u)||kyu(u)||PX(u)||byu()}function yyu(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 Cyu(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 Fyu=(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(Cyu(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:
528
528
  `+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=yyu(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})(),At="-ms-",LD="-moz-",Gu="-webkit-",g9="comm",v9="rule",k9="decl",Ayu="@import",MX="@keyframes",Byu=Math.abs,zg=String.fromCharCode,Syu=Object.assign;function zyu(u,e){return pt(u,0)^45?(((e<<2^pt(u,0))<<2^pt(u,1))<<2^pt(u,2))<<2^pt(u,3):0}function TX(u){return u.trim()}function wyu(u,e){return(u=e.exec(u))?u[0]:u}function Zu(u,e,a){return u.replace(e,a)}function BF(u,e){return u.indexOf(e)}function pt(u,e){return u.charCodeAt(e)|0}function xE(u,e,a){return u.slice(e,a)}function un(u){return u.length}function b9(u){return u.length}function Hh(u,e){return e.push(u),u}function Oyu(u,e){return u.map(e).join("")}var wg=1,dc=1,$X=0,h0=0,La=0,Tc="";function Og(u,e,a,t,r,n,i){return{value:u,root:e,parent:a,type:t,props:r,children:n,line:wg,column:dc,length:i,return:""}}function $4(u,e){return Syu(Og("",null,null,"",null,null,0),u,{length:-u.length},e)}function Pyu(){return La}function jyu(){return La=h0>0?pt(Tc,--h0):0,dc--,La===10&&(dc=1,wg--),La}function T0(){return La=h0<$X?pt(Tc,h0++):0,dc++,La===10&&(dc=1,wg++),La}function gn(){return pt(Tc,h0)}function Lx(){return h0}function e3(u,e){return xE(Tc,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 RX(u){return wg=dc=1,$X=un(Tc=u),h0=0,[]}function NX(u){return Tc="",u}function Ix(u){return TX(e3(h0-1,SF(u===91?u+2:u===40?u+1:u)))}function Myu(u){for(;(La=gn())&&La<33;)T0();return DE(u)>2||DE(La)>3?"":" "}function Tyu(u,e){for(;--e&&T0()&&!(La<48||La>102||La>57&&La<65||La>70&&La<97););return e3(u,Lx()+(e<6&&gn()==32&&T0()==32))}function SF(u){for(;T0();)switch(La){case u:return h0;case 34:case 39:u!==34&&u!==39&&SF(La);break;case 40:u===41&&SF(u);break;case 92:T0();break}return h0}function $yu(u,e){for(;T0()&&u+La!==57;)if(u+La===84&&gn()===47)break;return"/*"+e3(e,h0-1)+"*"+zg(u===47?u:T0())}function Ryu(u){for(;!DE(gn());)T0();return e3(u,h0)}function Nyu(u){return NX(Kx("",null,null,null,[""],u=RX(u),0,[0],u))}function Kx(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=T0()){case 40:if(x!=108&&pt(C,d-1)==58){BF(C+=Zu(Ix(f),"&","&\f"),"&\f")!=-1&&(h=-1);break}case 34:case 39:case 91:C+=Ix(f);break;case 9:case 10:case 13:case 32:C+=Myu(x);break;case 92:C+=Tyu(Lx()-1,7);continue;case 47:switch(gn()){case 42:case 47:Hh(_yu($yu(T0(),Lx()),e,a),s);break;default:C+="/"}break;case 123*m:o[l++]=un(C)*h;case 125*m:case 59:case 0:switch(f){case 0:case 125:g=0;case 59+c:p>0&&un(C)-d&&Hh(p>32?pN(C+";",t,a,d-1):pN(Zu(C," ","")+";",t,a,d-2),s);break;case 59:C+=";";default:if(Hh(b=EN(C,e,a,l,c,r,o,k,y=[],v=[],d),n),f===123)if(c===0)Kx(C,e,b,b,y,n,d,o,v);else switch(E===99&&pt(C,3)===110?100:E){case 100:case 109:case 115:Kx(u,b,b,t&&Hh(EN(u,b,b,0,0,r,o,k,r,y=[],d),v),r,v,d,o,t?y:v);break;default:Kx(C,b,b,b,[""],v,0,o,v)}}l=c=p=0,m=h=1,k=C="",d=i;break;case 58:d=1+un(C),p=x;default:if(m<1){if(f==123)--m;else if(f==125&&m++==0&&jyu()==125)continue}switch(C+=zg(f),f*m){case 38:h=c>0?1:(C+="\f",-1);break;case 44:o[l++]=(un(C)-1)*h,h=1;break;case 64:gn()===45&&(C+=Ix(T0())),E=gn(),c=d=un(k=C+=Ryu(Lx())),f++;break;case 45:x===45&&un(C)==2&&(m=0)}}return n}function EN(u,e,a,t,r,n,i,o,s,l,c){for(var d=r-1,E=r===0?n:[""],p=b9(E),x=0,m=0,g=0;x<t;++x)for(var h=0,f=xE(u,d+1,d=Byu(m=i[x])),k=u;h<p;++h)(k=TX(m>0?E[h]+" "+f:Zu(f,/&\f/g,E[h])))&&(s[g++]=k);return Og(u,e,a,r===0?v9:o,s,l,c)}function _yu(u,e,a){return Og(u,e,a,g9,zg(Pyu()),xE(u,2,-2),0)}function pN(u,e,a,t){return Og(u,e,a,k9,xE(u,0,t),xE(u,t+1,-1),t)}function $1(u,e){for(var a="",t=b9(u),r=0;r<t;r++)a+=e(u[r],r,u,e)||"";return a}function Lyu(u,e,a,t){switch(u.type){case Ayu:case k9:return u.return=u.return||u.value;case g9:return"";case MX:return u.return=u.value+"{"+$1(u.children,t)+"}";case v9:u.value=u.props.join(",")}return un(a=$1(u.children,t))?u.return=u.value+"{"+a+"}":""}function Iyu(u){var e=b9(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 Kyu(u){return function(e){e.root||(e=e.return)&&u(e)}}function Vyu(u){var e=Object.create(null);return function(a){return e[a]===void 0&&(e[a]=u(a)),e[a]}}var Gyu=function(e,a,t){for(var r=0,n=0;r=n,n=gn(),r===38&&n===12&&(a[t]=1),!DE(n);)T0();return e3(e,h0)},Hyu=function(e,a){var t=-1,r=44;do switch(DE(r)){case 0:r===38&&gn()===12&&(a[t]=1),e[t]+=Gyu(h0-1,a,t);break;case 2:e[t]+=Ix(r);break;case 4:if(r===44){e[++t]=gn()===58?"&\f":"",a[t]=e[t].length;break}default:e[t]+=zg(r)}while(r=T0());return e},qyu=function(e,a){return NX(Hyu(RX(e),a))},mN=new WeakMap,Wyu=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&&!mN.get(t))&&!r){mN.set(e,!0);for(var n=[],i=qyu(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]}}},Jyu=function(e){if(e.type==="decl"){var a=e.value;a.charCodeAt(0)===108&&a.charCodeAt(2)===98&&(e.return="",e.value="")}},Uyu="emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason",Zyu=function(e){return e.type==="comm"&&e.children.indexOf(Uyu)>-1},Qyu=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(Zyu(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".')})}}}},_X=function(e){return e.type.charCodeAt(1)===105&&e.type.charCodeAt(0)===64},Yyu=function(e,a){for(var t=e-1;t>=0;t--)if(!_X(a[t]))return!0;return!1},hN=function(e){e.type="",e.value="",e.return="",e.children="",e.props=""},Xyu=function(e,a,t){_X(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."),hN(e)):Yyu(a,t)&&(console.error("`@import` rules can't be after other rules. Please put your `@import` rules before your other rules."),hN(e)))};function LX(u,e){switch(zyu(u,e)){case 5103:return Gu+"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 Gu+u+u;case 5349:case 4246:case 4810:case 6968:case 2756:return Gu+u+LD+u+At+u+u;case 6828:case 4268:return Gu+u+At+u+u;case 6165:return Gu+u+At+"flex-"+u+u;case 5187:return Gu+u+Zu(u,/(\w+).+(:[^]+)/,Gu+"box-$1$2"+At+"flex-$1$2")+u;case 5443:return Gu+u+At+"flex-item-"+Zu(u,/flex-|-self/,"")+u;case 4675:return Gu+u+At+"flex-line-pack"+Zu(u,/align-content|flex-|-self/,"")+u;case 5548:return Gu+u+At+Zu(u,"shrink","negative")+u;case 5292:return Gu+u+At+Zu(u,"basis","preferred-size")+u;case 6060:return Gu+"box-"+Zu(u,"-grow","")+Gu+u+At+Zu(u,"grow","positive")+u;case 4554:return Gu+Zu(u,/([^-])(transform)/g,"$1"+Gu+"$2")+u;case 6187:return Zu(Zu(Zu(u,/(zoom-|grab)/,Gu+"$1"),/(image-set)/,Gu+"$1"),u,"")+u;case 5495:case 3959:return Zu(u,/(image-set\([^]*)/,Gu+"$1$`$1");case 4968:return Zu(Zu(u,/(.+:)(flex-)?(.*)/,Gu+"box-pack:$3"+At+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Gu+u+u;case 4095:case 3583:case 4068:case 2532:return Zu(u,/(.+)-inline(.+)/,Gu+"$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(un(u)-1-e>6)switch(pt(u,e+1)){case 109:if(pt(u,e+4)!==45)break;case 102:return Zu(u,/(.+:)(.+)-([^]+)/,"$1"+Gu+"$2-$3$1"+LD+(pt(u,e+3)==108?"$3":"$2-$3"))+u;case 115:return~BF(u,"stretch")?LX(Zu(u,"stretch","fill-available"),e)+u:u}break;case 4949:if(pt(u,e+1)!==115)break;case 6444:switch(pt(u,un(u)-3-(~BF(u,"!important")&&10))){case 107:return Zu(u,":",":"+Gu)+u;case 101:return Zu(u,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Gu+(pt(u,14)===45?"inline-":"")+"box$3$1"+Gu+"$2$3$1"+At+"$2box$3")+u}break;case 5936:switch(pt(u,e+11)){case 114:return Gu+u+At+Zu(u,/[svh]\w+-[tblr]{2}/,"tb")+u;case 108:return Gu+u+At+Zu(u,/[svh]\w+-[tblr]{2}/,"tb-rl")+u;case 45:return Gu+u+At+Zu(u,/[svh]\w+-[tblr]{2}/,"lr")+u}return Gu+u+At+u+u}return u}var eCu=function(e,a,t,r){if(e.length>-1&&!e.return)switch(e.type){case k9:e.return=LX(e.value,e.length);break;case MX:return $1([$4(e,{value:Zu(e.value,"@","@"+Gu)})],r);case v9:if(e.length)return Oyu(e.props,function(n){switch(wyu(n,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return $1([$4(e,{props:[Zu(n,/:(read-\w+)/,":"+LD+"$1")]})],r);case"::placeholder":return $1([$4(e,{props:[Zu(n,/:(plac\w+)/,":"+Gu+"input-$1")]}),$4(e,{props:[Zu(n,/:(plac\w+)/,":"+LD+"$1")]}),$4(e,{props:[Zu(n,/:(plac\w+)/,At+"input-$1")]})],r)}return""})}},uCu=[eCu],aCu=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.
@@ -2042,7 +2042,7 @@ Use the data prop if you want to provide your own handlers.`);if(u.initialData){
2042
2042
  gap: var(--spacing-xs);
2043
2043
  `,a5={[wt.SIMPLE]:{label:"Simple",tooltipContent:"Success criteria conditions in the form of basic literals, operators, and loose comparisons"},[wt.REGEX]:{label:"Regex",tooltipContent:"Regex patterns used as success criteria conditions"},[wt.JSONPATH]:{label:"JSONPath",tooltipContent:"JSONPath expressions as success criteria conditions"},[wt.XPATH]:{label:"XPath",tooltipContent:"XPath expressions as success criteria conditions"}},HTu=Object.keys(a5);function qTu({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||[],{...Qku(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(U0,{children:["Success criteria",D.jsx(yr,{content:"List of conditions required to complete the step."})]}),t.map(n=>D.jsx(H.Fragment,{children:D.jsx(LTu,{successCriteria:n,label:a5[n.get().type].label,tooltipContent:a5[n.get().type].tooltipContent,additionalActions:D.jsx(Xt,{"data-testid":"remove-success-criteria-button",variant:"text",icon:D.jsx(W.TrashCanIcon,{}),onClick:()=>r(n)})})},n.get().id)),D.jsx(WTu,{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:HTu.map(n=>({element:a5[n].label,label:n,value:n})),onChange:n=>{a(n)},placement:"top",hideCheckmarkIcon:!0})]})}const WTu=N(W.Select)`
2044
2044
  border-radius: var(--border-radius-md);
2045
- `;function JTu({step:u,workflowId:e,collectionId:a}){const{handleIdChange:t}=cl(),r=u.stepId.get();return D.jsx(D.Fragment,{children:D.jsxs(ite,{children:[D.jsx(U0,{children:"Info"}),D.jsxs(Lu,{children:[D.jsxs(Lu.Row,{children:[D.jsx(Lu.Cell,{children:D.jsxs(U0,{children:["Step ID",D.jsx(yr,{content:"This step's unique identifier"})]})}),D.jsx(Lu.Cell,{$readonly:!0,children:D.jsx(LF,{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(U0,{children:["Description",D.jsx(yr,{content:"The step's purpose in the workflow."})]})}),D.jsx(Lu.Cell,{children:D.jsx(W9,{state:u.description,placeholder:"Add description"})})]})]}),D.jsxs(L1,{children:[D.jsx(U0,{children:"Operation"}),D.jsx(PTu,{step:u,collectionId:a})]}),D.jsx(L1,{children:D.jsx(ote,{outputs:u.outputs,tooltipText:"Data generated in this step that can be used in the next steps."})}),D.jsx(L1,{children:D.jsx(qTu,{successCriteria:u.successCriteria})})]})})}function UTu({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(Ac())try{const{open:o}=await Promise.resolve().then(()=>require("./replay-index-Ct56bhOi.js")),s=await o({multiple:!0});if(!s)return;const c=(Array.isArray(s)?s:[s]).map(YE),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(IL,{icon:D.jsx(W.CloseIcon,{}),variant:"secondary",onClick:n,iconPosition:"right",size:"small",children:D.jsx(KL,{children:e[0].file.name})});if(e.length>1)return D.jsx(IL,{icon:D.jsx(W.CloseIcon,{}),variant:"secondary",onClick:n,iconPosition:"right",size:"small",children:D.jsxs(KL,{children:[e.length," files"]})})},[e,n]);return D.jsx(ZTu,{children:D.jsxs(QTu,{children:[D.jsx(YTu,{children:i||D.jsx(e$u,{children:"Add files here"})}),D.jsxs(XTu,{children:[D.jsx(EAu,{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 ZTu=N.div`
2045
+ `;function JTu({step:u,workflowId:e,collectionId:a}){const{handleIdChange:t}=cl(),r=u.stepId.get();return D.jsx(D.Fragment,{children:D.jsxs(ite,{children:[D.jsx(U0,{children:"Info"}),D.jsxs(Lu,{children:[D.jsxs(Lu.Row,{children:[D.jsx(Lu.Cell,{children:D.jsxs(U0,{children:["Step ID",D.jsx(yr,{content:"This step's unique identifier"})]})}),D.jsx(Lu.Cell,{$readonly:!0,children:D.jsx(LF,{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(U0,{children:["Description",D.jsx(yr,{content:"The step's purpose in the workflow."})]})}),D.jsx(Lu.Cell,{children:D.jsx(W9,{state:u.description,placeholder:"Add description"})})]})]}),D.jsxs(L1,{children:[D.jsx(U0,{children:"Operation"}),D.jsx(PTu,{step:u,collectionId:a})]}),D.jsx(L1,{children:D.jsx(ote,{outputs:u.outputs,tooltipText:"Data generated in this step that can be used in the next steps."})}),D.jsx(L1,{children:D.jsx(qTu,{successCriteria:u.successCriteria})})]})})}function UTu({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(Ac())try{const{open:o}=await Promise.resolve().then(()=>require("./replay-index-H7ATB3kz.js")),s=await o({multiple:!0});if(!s)return;const c=(Array.isArray(s)?s:[s]).map(YE),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(IL,{icon:D.jsx(W.CloseIcon,{}),variant:"secondary",onClick:n,iconPosition:"right",size:"small",children:D.jsx(KL,{children:e[0].file.name})});if(e.length>1)return D.jsx(IL,{icon:D.jsx(W.CloseIcon,{}),variant:"secondary",onClick:n,iconPosition:"right",size:"small",children:D.jsxs(KL,{children:[e.length," files"]})})},[e,n]);return D.jsx(ZTu,{children:D.jsxs(QTu,{children:[D.jsx(YTu,{children:i||D.jsx(e$u,{children:"Add files here"})}),D.jsxs(XTu,{children:[D.jsx(EAu,{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 ZTu=N.div`
2046
2046
  position: relative;
2047
2047
  display: flex;
2048
2048
  flex-grow: 1;
@@ -2169,7 +2169,7 @@ Use the data prop if you want to provide your own handlers.`);if(u.initialData){
2169
2169
  `,m$u=N.div`
2170
2170
  display: flex;
2171
2171
  justify-content: center;
2172
- `;function h$u({data:u,type:e,editable:a}){const t=ma(),r=u[e];function n(o,s){s&&r.merge([$s()])}function i(o){r[o].set(lu)}return D.jsx(a$u,{keyName:"Param",formElements:r,onParameterChange:n,environment:t,enableInputTypeSelection:e!==Mt["application/x-www-form-urlencoded"],editable:a,actions:o=>D.jsx(Xt,{onClick:()=>i(o),variant:"text",icon:D.jsx(W.TrashCanIcon,{})})})}const x$u=({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(),Ac())try{const{open:c}=await Promise.resolve().then(()=>require("./replay-index-Ct56bhOi.js")),d=await c();if(!d)return;const E=await YE(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(D$u,{children:[D.jsx(W.SpinnerIcon,{}),"Loading..."]}):e&&e.file?.name?D.jsxs(f$u,{children:[D.jsxs(g$u,{children:[D.jsx(W.DocumentBlankIcon,{size:"16px"}),D.jsx(v$u,{children:e.file?.name})]}),D.jsx(Xt,{onClick:s,icon:D.jsx(W.TrashCanIcon,{})})]}):D.jsx(ste,{children:!e&&D.jsxs(k$u,{tabIndex:0,role:"button",onKeyDown:o,onClick:i,children:[D.jsx("input",{type:"file",onChange:n,ref:r}),D.jsx(W.CloudUploadIcon,{}),"Upload file"]})})},ste=N.div`
2172
+ `;function h$u({data:u,type:e,editable:a}){const t=ma(),r=u[e];function n(o,s){s&&r.merge([$s()])}function i(o){r[o].set(lu)}return D.jsx(a$u,{keyName:"Param",formElements:r,onParameterChange:n,environment:t,enableInputTypeSelection:e!==Mt["application/x-www-form-urlencoded"],editable:a,actions:o=>D.jsx(Xt,{onClick:()=>i(o),variant:"text",icon:D.jsx(W.TrashCanIcon,{})})})}const x$u=({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(),Ac())try{const{open:c}=await Promise.resolve().then(()=>require("./replay-index-H7ATB3kz.js")),d=await c();if(!d)return;const E=await YE(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(D$u,{children:[D.jsx(W.SpinnerIcon,{}),"Loading..."]}):e&&e.file?.name?D.jsxs(f$u,{children:[D.jsxs(g$u,{children:[D.jsx(W.DocumentBlankIcon,{size:"16px"}),D.jsx(v$u,{children:e.file?.name})]}),D.jsx(Xt,{onClick:s,icon:D.jsx(W.TrashCanIcon,{})})]}):D.jsx(ste,{children:!e&&D.jsxs(k$u,{tabIndex:0,role:"button",onKeyDown:o,onClick:i,children:[D.jsx("input",{type:"file",onChange:n,ref:r}),D.jsx(W.CloudUploadIcon,{}),"Upload file"]})})},ste=N.div`
2173
2173
  display: flex;
2174
2174
  align-items: center;
2175
2175
  justify-content: flex-start;
@@ -3101,7 +3101,7 @@ Use the data prop if you want to provide your own handlers.`);if(u.initialData){
3101
3101
  @media (max-width: ${Tt}px) {
3102
3102
  padding: var(--spacing-xs) var(--spacing-sm);
3103
3103
  }
3104
- `,G_u={info:u=>{},error:u=>{},warn:u=>{},printNewLine:()=>{},printSeparator:()=>{},indent:(u,e)=>u,output:u=>u};async function H_u({collectionId:u,workflowId:e,projectDir:a,inputsObject:t,serversObject:r,sourceDescriptions:n,severitySettings:i}){const o=`${a}/${u}`,s=new nU,l=t.map(E=>JSON.stringify({[E.name]:E.value})),c=q_u(r,n),{run:d}=await Promise.resolve().then(()=>require("./replay-index-cTMKyPIi.js"));return await d({files:[o],workflow:e?[e]:[],fetch:mi,logger:G_u,maxSteps:500,maxFetchTimeout:4e4,requestFileLoader:{getFileBody:async E=>{if(!await rU(E))throw new Error(`File ${E} doesn't exist or isn't readable.`);try{const x=await fA(E),m=new TextEncoder().encode(x);return new File([m],await aU(E))}catch(x){throw new Error(`Failed to read file ${E}: ${x}`)}}},envVariables:{},config:await XH({}),externalRefResolver:s,input:l,server:c,severity:JSON.stringify(i),skipLint:!0})}function q_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 FB(u){return u==null?"N/A":u<1e3?`${u} ms`:u<1e4?`${(u/1e3).toFixed(1)} s`:`${Math.round(u/1e3)} s`}function Rte({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(W_u,{children:[D.jsxs(J_u,{onClick:E,children:[D.jsxs(U_u,{children:[D.jsx(Z_u,{children:D.jsx(Q_u,{children:d()})}),D.jsxs(Y_u,{children:[D.jsx(X_u,{children:c()}),D.jsxs(eLu,{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(uLu,{isExpanded:s,children:s?D.jsx(W.ChevronDownIcon,{}):D.jsx(W.ChevronRightIcon,{})})]}),D.jsx(aLu,{isExpanded:s,children:e.map((p,x)=>D.jsxs(tLu,{children:[D.jsx(rLu,{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(nLu,{children:[D.jsx(iLu,{children:p.name}),p.message&&D.jsx(oLu,{children:p.message})]})]},x))})]})}const W_u=N.div`
3104
+ `,G_u={info:u=>{},error:u=>{},warn:u=>{},printNewLine:()=>{},printSeparator:()=>{},indent:(u,e)=>u,output:u=>u};async function H_u({collectionId:u,workflowId:e,projectDir:a,inputsObject:t,serversObject:r,sourceDescriptions:n,severitySettings:i}){const o=`${a}/${u}`,s=new nU,l=t.map(E=>JSON.stringify({[E.name]:E.value})),c=q_u(r,n),{run:d}=await Promise.resolve().then(()=>require("./replay-index-B7D2AWYn.js"));return await d({files:[o],workflow:e?[e]:[],fetch:mi,logger:G_u,maxSteps:500,maxFetchTimeout:4e4,requestFileLoader:{getFileBody:async E=>{if(!await rU(E))throw new Error(`File ${E} doesn't exist or isn't readable.`);try{const x=await fA(E),m=new TextEncoder().encode(x);return new File([m],await aU(E))}catch(x){throw new Error(`Failed to read file ${E}: ${x}`)}}},envVariables:{},config:await XH({}),externalRefResolver:s,input:l,server:c,severity:JSON.stringify(i),skipLint:!0})}function q_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 FB(u){return u==null?"N/A":u<1e3?`${u} ms`:u<1e4?`${(u/1e3).toFixed(1)} s`:`${Math.round(u/1e3)} s`}function Rte({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(W_u,{children:[D.jsxs(J_u,{onClick:E,children:[D.jsxs(U_u,{children:[D.jsx(Z_u,{children:D.jsx(Q_u,{children:d()})}),D.jsxs(Y_u,{children:[D.jsx(X_u,{children:c()}),D.jsxs(eLu,{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(uLu,{isExpanded:s,children:s?D.jsx(W.ChevronDownIcon,{}):D.jsx(W.ChevronRightIcon,{})})]}),D.jsx(aLu,{isExpanded:s,children:e.map((p,x)=>D.jsxs(tLu,{children:[D.jsx(rLu,{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(nLu,{children:[D.jsx(iLu,{children:p.name}),p.message&&D.jsx(oLu,{children:p.message})]})]},x))})]})}const W_u=N.div`
3105
3105
  margin-bottom: 0;
3106
3106
  margin-top: var(--spacing-xxs);
3107
3107
  `,J_u=N.div`
@@ -4476,7 +4476,7 @@ Use the data prop if you want to provide your own handlers.`);if(u.initialData){
4476
4476
  display: inline-block;
4477
4477
  color: var(--text-color-secondary);
4478
4478
  margin-left: var(--spacing-xs);
4479
- `,NVu=process.env.NODE_ENV==="development";function _Vu(u){const e=u||"default";return{id:Od(Cf(e)),systemFilesDir:Ls.join("/replay",e),userFilesDir:Ls.join("/projects",e)}}async function LVu(u){if(!u)throw new Error("Tauri project: userFilesDir is required");const e=Od(Cf(u)),a=NVu?await c3u():await l3u(),t=await Dd(a,"replay",e);return{id:e,systemFilesDir:t,userFilesDir:u}}function o2(u,e){const a=`apis/${u.info.title}`.replace(/\s+/g,"-").toLowerCase(),t=o=>`${o}.yaml`,r=o=>e.some(s=>s.id===t(o));if(!r(a))return t(a);let n=1,i=`${a}-${n}`;for(;r(i);)n++,i=`${a}-${n}`;return t(i)}function IVu(u,e){return u.find(a=>a.name===e)}function KVu(u,e,a,t,r){const{servers:n,parameters:i}=e,o=i.filter(x=>x.in==="path"),s=VVu(e),l=r;let c=[...n];r?.position==="first"?c.unshift(l):r?.position==="last"?c.push(l):r?.position==="replace"&&(c=[l]);const d=new Set,E=o.map(x=>{const m=x.example?String(x.example):"";return d.add(x.name),{name:x.name,value:m,isSecret:!1}}),p=x=>s.map(m=>{const g=e.security?.flat().find(f=>{const k=f.id;return m.name.startsWith(k)});let h="";if(g){const f=g.serverValues?.[x];f&&(f["x-defaultUsername"]&&m.name.endsWith(W.SecurityVariablesEnvSuffix.Username)?h=f["x-defaultUsername"]:f["x-defaultPassword"]&&m.name.endsWith(W.SecurityVariablesEnvSuffix.Password)?h=f["x-defaultPassword"]:f["x-defaultClientId"]&&m.name.endsWith(W.SecurityVariablesEnvSuffix.ClientId)?h=f["x-defaultClientId"]:f["x-defaultClientSecret"]&&m.name.endsWith(W.SecurityVariablesEnvSuffix.ClientSecret)?h=f["x-defaultClientSecret"]:f["x-defaultAccessToken"]&&(h=f["x-defaultAccessToken"])),h||(g["x-defaultUsername"]&&m.name.endsWith(W.SecurityVariablesEnvSuffix.Username)?h=g["x-defaultUsername"]:g["x-defaultPassword"]&&m.name.endsWith(W.SecurityVariablesEnvSuffix.Password)?h=g["x-defaultPassword"]:g["x-defaultClientId"]&&m.name.endsWith(W.SecurityVariablesEnvSuffix.ClientId)?h=g["x-defaultClientId"]:g["x-defaultClientSecret"]&&m.name.endsWith(W.SecurityVariablesEnvSuffix.ClientSecret)?h=g["x-defaultClientSecret"]:g["x-defaultAccessToken"]&&(h=g["x-defaultAccessToken"]))}return d.add(m.name),{name:m.name,value:m.value||h||"",isSecret:m.isSecret}});return{generatedInputs:d,environments:qVu(c).map(x=>{const m=x.name||x.description||x.url,g=Object.entries(x.variables||{}).map(([v,b])=>({name:v,value:b.default||""})),f=IVu(a,m)?.inputs.filter(v=>v.value)||[],k=p(x.url),y=HVu(GVu(f,E,k),t?.[m]);return{name:m,inputs:y,servers:[{apiId:u,value:x.url,variables:g}],state:Nu.Normal}})}}function VVu(u){const e=[],a=u.security?.flat()||[],t=new Set;return a.forEach(r=>{const n=Bg(r);if(t.has(n))return;const i=r.id;t.add(n),(n===ye.BasicAuth||n===ye.DigestAuth)&&(e.push(xr(i+W.SecurityVariablesEnvSuffix.Username,!1)),e.push(xr(i+W.SecurityVariablesEnvSuffix.Password))),n===ye.JWT&&e.push(xr(i+W.SecurityVariablesEnvSuffix.JWTToken)),n===ye.APIKey&&e.push(xr(i+W.SecurityVariablesEnvSuffix.APIKey)),n===ye.OAuth2&&(e.push(xr(i+W.SecurityVariablesEnvSuffix.Token)),x9(r).forEach(s=>{e.push(xr(i+W.SecurityVariablesEnvSuffix.ClientId)),[Fe.Implicit,Fe.ClientCredentialsWithJwtAssertion].includes(s)||e.push(xr(i+W.SecurityVariablesEnvSuffix.ClientSecret)),s===Fe.ClientCredentialsWithJwtAssertion&&e.push(xr(i+W.SecurityVariablesEnvSuffix.ClientAssertion))})),n===ye.OpenIDConnect&&(e.push(xr(i+W.SecurityVariablesEnvSuffix.Token)),e.push(xr(i+W.SecurityVariablesEnvSuffix.ClientId)),e.push(xr(i+W.SecurityVariablesEnvSuffix.ClientSecret)))}),e}function xr(u,e=!0){return{name:u,value:"",isSecret:e}}function GVu(...u){const e=new Map;for(const a of u)for(const t of a){const r=e.get(t.name);e.set(t.name,{name:t.name,value:t.value||r?.value||"",isSecret:t.isSecret||r?.isSecret||!1})}return Array.from(e.values())}function HVu(u,e){return e?u.map(a=>{const t=e[a.name];return t!==void 0?{...a,value:t}:a}):u}function qVu(u){const a=g3u(W.IS_BROWSER?window.location.href:globalThis.SSR_HOSTNAME||"");u.length===0&&(u=[{url:"/"}]);function t(r){return v3u(a,r)}return u.map(r=>({...r,url:t(r.url),description:r.description||""}))}function mI(u,e,a){if(!u||!u.paths||Object.keys(u.paths).length===0)return{operations:null,error:0};const{operations:t}=WVu(u,e,a);return{operations:t}}function WVu(u,e,a){const t=[];for(const[r,n]of Object.entries(u.paths))for(const[i,o]of Object.entries(n))i!=="parameters"&&i!=="servers"&&i!=="description"&&i!=="summary"&&(o.tags&&o.tags.length>0?o.tags:["Untagged"]).forEach(l=>{const{operation:c}=JVu(r,i,u,l,e,a);c&&t.push(c)});return{operations:t}}function JVu(u,e,a,t,r,n){if(!n)return{operation:null};const i=n(u,e,a);if(!i)return{operation:null};const o=`${a.info.title}/${t}/${i.name}`;return{operation:sbu(i,r,o)}}const hI=(u,e,a)=>u.find(t=>{if(e&&t.operationId===e)return!0;if(a&&t.apiPath){const{path:r,method:n}=bX({operationPath:a,parsedSourceDescriptions:[]});return t.apiPath.path===r&&t.apiPath.method===n}return!1}),RB=({children:u,settings:e,api:a,activeOperationId:t,activeOperationPointer:r})=>{const n=H.useContext(D9),i=H.useMemo(async()=>{const o=Ac()?await LVu(e.storageKey):_Vu(e.storageKey),{isInitialized:s}=await n.init(o,e.convertOperationToReplayValue);if(!s)return;if(!a){n.environments.length===0&&n.environments.set(XJ);return}const l=o2(a,[]),{operations:c}=mI(a,l,e.convertOperationToReplayValue);if(!c?.length||!c[0].collectionPath?.split("/")?.[0]||(n.apis.set([{id:l,srcType:hn.FS,...a}]),n.predefinedApiId.set(l),!t&&!r))return;const E=hI(c,t,r),{path:p,method:x}=E?.apiPath||{};if(!E||!p||!x)return;const m=e.convertOperationToReplayValue?.(p,x,a);m&&xI(n,l,m,e),ZVu(n,{apiId:l,path:p,method:x,operationId:E.operationId},m)},[e.storageKey]);return H.useEffect(()=>{if(!a||!e.convertOperationToReplayValue)return;const o=o2(a,[]),{operations:s}=mI(a,o,e.convertOperationToReplayValue);if(!s?.length)return;const l=hI(s,t,r),{path:c,method:d}=l?.apiPath||{};if(!l||!c||!d)return;const E=e.convertOperationToReplayValue(c,d,a);E&&xI(n,o,E,e)},[e.convertOperationToReplayValue,e.predefinedEnvValues,e.mockServer,e.allowedEnvironments,e.selectedEnvironment,a,t,r]),D.jsx(H.Suspense,{fallback:D.jsx(TVu,{projectPath:e.storageKey}),children:D.jsx(UVu,{initStore:i,settings:e,api:a,children:u})})};function UVu({initStore:u,children:e,settings:a,api:t}){return H.use(u),tyu(a,t),D.jsx(ge.default.Fragment,{children:e},a.storageKey)}const xI=(u,e,a,t)=>{const r=u.environments.get({noproxy:!0}),{environments:n,generatedInputs:i}=KVu(e,a,r,t.predefinedEnvValues,t.mockServer);u.predefinedInputNames.set(i);let o,s,l;if(t.allowedEnvironments?.length){const c=n.filter(d=>t.allowedEnvironments?.includes(d.name));o=new Set(c.map(d=>d.name)),s=c,l=s.find(d=>d.name===t.selectedEnvironment)?.name||s[0]?.name||""}else{o=new Set(n.map(d=>d.name)),s=[...n,...r.filter(d=>!o.has(d.name))];const c=u.activeEnvironmentId.get();l=s.find(d=>d.name===c)?.name||s.find(d=>d.name===t.selectedEnvironment)?.name||s[0]?.name||""}u.predefinedEnvironmentNames.set(o),qy(s,u.environments.get({noproxy:!0}))||u.environments.set(s),u.activeEnvironmentId.set(l)},ZVu=(u,e,a)=>{const t=u.tabsState.tabs.get().findIndex(({data:r})=>Ka(r,We.Step)&&r.draftStep?.operation?.apiId===e.apiId&&r.draftStep?.operation?.path===e.path&&r.draftStep?.operation?.method===e.method);if(t!==-1)u.tabsState.activeTabIdx.set(t);else{const r=Due(e,a);u.tabsState.tabs.merge([r]),u.tabsState.activeTabIdx.set(u.tabsState.tabs.length-1)}};function QVu(u){const e=H.useMemo(()=>II(wX({defaultEnvironments:[]}),KI(zX(!0))),[]);return D.jsx(D.Fragment,{children:D.jsx(Xbu,{value:e,children:D.jsx(Sg.Provider,{value:u.settings,children:D.jsx(RB,{...u,children:D.jsx(h0e,{onError:a=>console.error(a),children:D.jsx(YVu,{...u})})})})})})}function YVu(u){return u.settings.disableDraft=!0,D.jsx(H.StrictMode,{children:D.jsxs(XVu,{children:[D.jsx(eGu,{children:D.jsx($B,{})}),D.jsx(bf,{})]})})}const XVu=N.div`
4479
+ `,NVu=process.env.NODE_ENV==="development";function _Vu(u){const e=u||"default";return{id:Od(Cf(e)),systemFilesDir:Ls.join("/replay",e),userFilesDir:Ls.join("/projects",e)}}async function LVu(u){if(!u)throw new Error("Tauri project: userFilesDir is required");const e=Od(Cf(u)),a=NVu?await c3u():await l3u(),t=await Dd(a,"replay",e);return{id:e,systemFilesDir:t,userFilesDir:u}}function o2(u,e){const a=`apis/${u.info.title}`.replace(/\s+/g,"-").toLowerCase(),t=o=>`${o}.yaml`,r=o=>e.some(s=>s.id===t(o));if(!r(a))return t(a);let n=1,i=`${a}-${n}`;for(;r(i);)n++,i=`${a}-${n}`;return t(i)}function IVu(u,e){return u.find(a=>a.name===e)}function KVu(u,e,a,t,r){const{servers:n,parameters:i}=e,o=i.filter(x=>x.in==="path"),s=VVu(e),l=r;let c=[...n];r?.position==="first"?c.unshift(l):r?.position==="last"?c.push(l):r?.position==="replace"&&(c=[l]);const d=new Set,E=o.map(x=>{const m=x.example?String(x.example):"";return d.add(x.name),{name:x.name,value:m,isSecret:!1}}),p=x=>s.map(m=>{const g=e.security?.flat().find(f=>{const k=f.id;return m.name.startsWith(k)});let h="";if(g){const f=g.serverValues?.[x];f&&(f["x-defaultUsername"]&&m.name.endsWith(W.SecurityVariablesEnvSuffix.Username)?h=f["x-defaultUsername"]:f["x-defaultPassword"]&&m.name.endsWith(W.SecurityVariablesEnvSuffix.Password)?h=f["x-defaultPassword"]:f["x-defaultClientId"]&&m.name.endsWith(W.SecurityVariablesEnvSuffix.ClientId)?h=f["x-defaultClientId"]:f["x-defaultClientSecret"]&&m.name.endsWith(W.SecurityVariablesEnvSuffix.ClientSecret)?h=f["x-defaultClientSecret"]:f["x-defaultAccessToken"]&&(h=f["x-defaultAccessToken"])),h||(g["x-defaultUsername"]&&m.name.endsWith(W.SecurityVariablesEnvSuffix.Username)?h=g["x-defaultUsername"]:g["x-defaultPassword"]&&m.name.endsWith(W.SecurityVariablesEnvSuffix.Password)?h=g["x-defaultPassword"]:g["x-defaultClientId"]&&m.name.endsWith(W.SecurityVariablesEnvSuffix.ClientId)?h=g["x-defaultClientId"]:g["x-defaultClientSecret"]&&m.name.endsWith(W.SecurityVariablesEnvSuffix.ClientSecret)?h=g["x-defaultClientSecret"]:g["x-defaultAccessToken"]&&(h=g["x-defaultAccessToken"]))}return d.add(m.name),{name:m.name,value:m.value||h||"",isSecret:m.isSecret}});return{generatedInputs:d,environments:qVu(c).map(x=>{const m=x.name||x.description||x.url,g=Object.entries(x.variables||{}).map(([v,b])=>({name:v,value:b.default||""})),f=IVu(a,m)?.inputs.filter(v=>v.value)||[],k=p(x.url),y=HVu(GVu(f,E,k),t?.[m]);return{name:m,inputs:y,servers:[{apiId:u,value:x.url,variables:g}],state:Nu.Normal}})}}function VVu(u){const e=[];return(u.security?.flat()||[]).forEach(t=>{const r=Bg(t),n=t.id;(r===ye.BasicAuth||r===ye.DigestAuth)&&(e.push(xr(n+W.SecurityVariablesEnvSuffix.Username,!1)),e.push(xr(n+W.SecurityVariablesEnvSuffix.Password))),r===ye.JWT&&e.push(xr(n+W.SecurityVariablesEnvSuffix.JWTToken)),r===ye.APIKey&&e.push(xr(n+W.SecurityVariablesEnvSuffix.APIKey)),r===ye.OAuth2&&(e.push(xr(n+W.SecurityVariablesEnvSuffix.Token)),x9(t).forEach(o=>{e.push(xr(n+W.SecurityVariablesEnvSuffix.ClientId)),[Fe.Implicit,Fe.ClientCredentialsWithJwtAssertion].includes(o)||e.push(xr(n+W.SecurityVariablesEnvSuffix.ClientSecret)),o===Fe.ClientCredentialsWithJwtAssertion&&e.push(xr(n+W.SecurityVariablesEnvSuffix.ClientAssertion))})),r===ye.OpenIDConnect&&(e.push(xr(n+W.SecurityVariablesEnvSuffix.Token)),e.push(xr(n+W.SecurityVariablesEnvSuffix.ClientId)),e.push(xr(n+W.SecurityVariablesEnvSuffix.ClientSecret)))}),e}function xr(u,e=!0){return{name:u,value:"",isSecret:e}}function GVu(...u){const e=new Map;for(const a of u)for(const t of a){const r=e.get(t.name);e.set(t.name,{name:t.name,value:t.value||r?.value||"",isSecret:t.isSecret||r?.isSecret||!1})}return Array.from(e.values())}function HVu(u,e){return e?u.map(a=>{const t=e[a.name];return t!==void 0?{...a,value:t}:a}):u}function qVu(u){const a=g3u(W.IS_BROWSER?window.location.href:globalThis.SSR_HOSTNAME||"");u.length===0&&(u=[{url:"/"}]);function t(r){return v3u(a,r)}return u.map(r=>({...r,url:t(r.url),description:r.description||""}))}function mI(u,e,a){if(!u||!u.paths||Object.keys(u.paths).length===0)return{operations:null,error:0};const{operations:t}=WVu(u,e,a);return{operations:t}}function WVu(u,e,a){const t=[];for(const[r,n]of Object.entries(u.paths))for(const[i,o]of Object.entries(n))i!=="parameters"&&i!=="servers"&&i!=="description"&&i!=="summary"&&(o.tags&&o.tags.length>0?o.tags:["Untagged"]).forEach(l=>{const{operation:c}=JVu(r,i,u,l,e,a);c&&t.push(c)});return{operations:t}}function JVu(u,e,a,t,r,n){if(!n)return{operation:null};const i=n(u,e,a);if(!i)return{operation:null};const o=`${a.info.title}/${t}/${i.name}`;return{operation:sbu(i,r,o)}}const hI=(u,e,a)=>u.find(t=>{if(e&&t.operationId===e)return!0;if(a&&t.apiPath){const{path:r,method:n}=bX({operationPath:a,parsedSourceDescriptions:[]});return t.apiPath.path===r&&t.apiPath.method===n}return!1}),RB=({children:u,settings:e,api:a,activeOperationId:t,activeOperationPointer:r})=>{const n=H.useContext(D9),i=H.useMemo(async()=>{const o=Ac()?await LVu(e.storageKey):_Vu(e.storageKey),{isInitialized:s}=await n.init(o,e.convertOperationToReplayValue);if(!s)return;if(!a){n.environments.length===0&&n.environments.set(XJ);return}const l=o2(a,[]),{operations:c}=mI(a,l,e.convertOperationToReplayValue);if(!c?.length||!c[0].collectionPath?.split("/")?.[0]||(n.apis.set([{id:l,srcType:hn.FS,...a}]),n.predefinedApiId.set(l),!t&&!r))return;const E=hI(c,t,r),{path:p,method:x}=E?.apiPath||{};if(!E||!p||!x)return;const m=e.convertOperationToReplayValue?.(p,x,a);m&&xI(n,l,m,e),ZVu(n,{apiId:l,path:p,method:x,operationId:E.operationId},m)},[e.storageKey]);return H.useEffect(()=>{if(!a||!e.convertOperationToReplayValue)return;const o=o2(a,[]),{operations:s}=mI(a,o,e.convertOperationToReplayValue);if(!s?.length)return;const l=hI(s,t,r),{path:c,method:d}=l?.apiPath||{};if(!l||!c||!d)return;const E=e.convertOperationToReplayValue(c,d,a);E&&xI(n,o,E,e)},[e.convertOperationToReplayValue,e.predefinedEnvValues,e.mockServer,e.allowedEnvironments,e.selectedEnvironment,a,t,r]),D.jsx(H.Suspense,{fallback:D.jsx(TVu,{projectPath:e.storageKey}),children:D.jsx(UVu,{initStore:i,settings:e,api:a,children:u})})};function UVu({initStore:u,children:e,settings:a,api:t}){return H.use(u),tyu(a,t),D.jsx(ge.default.Fragment,{children:e},a.storageKey)}const xI=(u,e,a,t)=>{const r=u.environments.get({noproxy:!0}),{environments:n,generatedInputs:i}=KVu(e,a,r,t.predefinedEnvValues,t.mockServer);u.predefinedInputNames.set(i);let o,s,l;if(t.allowedEnvironments?.length){const c=n.filter(d=>t.allowedEnvironments?.includes(d.name));o=new Set(c.map(d=>d.name)),s=c,l=s.find(d=>d.name===t.selectedEnvironment)?.name||s[0]?.name||""}else{o=new Set(n.map(d=>d.name)),s=[...n,...r.filter(d=>!o.has(d.name))];const c=u.activeEnvironmentId.get();l=s.find(d=>d.name===c)?.name||s.find(d=>d.name===t.selectedEnvironment)?.name||s[0]?.name||""}u.predefinedEnvironmentNames.set(o),qy(s,u.environments.get({noproxy:!0}))||u.environments.set(s),u.activeEnvironmentId.set(l)},ZVu=(u,e,a)=>{const t=u.tabsState.tabs.get().findIndex(({data:r})=>Ka(r,We.Step)&&r.draftStep?.operation?.apiId===e.apiId&&r.draftStep?.operation?.path===e.path&&r.draftStep?.operation?.method===e.method);if(t!==-1)u.tabsState.activeTabIdx.set(t);else{const r=Due(e,a);u.tabsState.tabs.merge([r]),u.tabsState.activeTabIdx.set(u.tabsState.tabs.length-1)}};function QVu(u){const e=H.useMemo(()=>II(wX({defaultEnvironments:[]}),KI(zX(!0))),[]);return D.jsx(D.Fragment,{children:D.jsx(Xbu,{value:e,children:D.jsx(Sg.Provider,{value:u.settings,children:D.jsx(RB,{...u,children:D.jsx(h0e,{onError:a=>console.error(a),children:D.jsx(YVu,{...u})})})})})})}function YVu(u){return u.settings.disableDraft=!0,D.jsx(H.StrictMode,{children:D.jsxs(XVu,{children:[D.jsx(eGu,{children:D.jsx($B,{})}),D.jsx(bf,{})]})})}const XVu=N.div`
4480
4480
  display: flex;
4481
4481
  flex-direction: column;
4482
4482
  max-height: 80vh;