@redocly/replay 0.21.0-next.2 → 0.21.0-next.3

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.
@@ -167,7 +167,7 @@ ${o.message}`})}}}}),SX=({filePath:t})=>({Info:{leave(e,{report:r,location:n,con
167
167
  ${o.message}`,location:n.child("description")})}}}}),wX=t=>({Info:{leave(e){if(typeof t!="object"||Array.isArray(t)||t===null)throw new Error('"info-override" decorator should be called with an object');const{severity:r,...n}=t;Object.assign(e,n)}}});function PX(t){return Array.isArray(t)&&t.length===0}const kge="x-internal",CX=({internalFlagProperty:t=kge})=>{function e(n,i,o){const{parent:s,key:a}=i;let l=!1;if(Array.isArray(n))for(let c=0;c<n.length;c++){if(qr(n[c])&&i.resolve(n[c]).node?.[t]){if(xt(s.discriminator?.mapping))for(const d in s.discriminator.mapping)o?.[d]===n[c].$ref&&delete s.discriminator.mapping[d];n.splice(c,1),l=!0,c--}n[c]?.[t]&&(n.splice(c,1),l=!0,c--)}else if(xt(n))for(const c of Object.keys(n)){if(qr(n[c])){const u=i.resolve(n[c]);xt(u.node)&&u.node?.[t]&&(delete n[c],l=!0)}xt(n[c])&&n[c]?.[t]&&(delete n[c],l=!0)}l&&(ch(n)||PX(n))&&delete s[a]}let r={};return{DiscriminatorMapping:{enter:n=>{r=JSON.parse(JSON.stringify(n))}},any:{enter:(n,i)=>{e(n,i,r)}}}};function $X(t,e,r){const{parent:n,key:i}=e;let o=!1;if(Array.isArray(t))for(let s=0;s<t.length;s++){if(qr(t[s])){const a=e.resolve(t[s]);r(a.node)&&(t.splice(s,1),o=!0,s--)}r(t[s])&&(t.splice(s,1),o=!0,s--)}else if(xt(t))for(const s of Object.keys(t)){if(t=t,qr(t[s])){const a=e.resolve(t[s]);r(a.node)&&(delete t[s],o=!0)}r(t[s])&&(delete t[s],o=!0)}o&&(ch(t)||PX(t))&&delete n[i]}function kX(t,e,r){return t===void 0||e===void 0?!1:!Array.isArray(e)&&!Array.isArray(t)?t===e:(e=ej(e),t=ej(t),r==="any"?e.some(n=>t.includes(n)):r==="all"?e.every(n=>t.includes(n)):!1)}function ej(t){return Array.isArray(t)?t:[t]}const Tge="any",TX=({property:t,value:e,matchStrategy:r})=>{const n=r||Tge,i=o=>o?.[t]&&!kX(o?.[t],e,n);return{any:{enter:(o,s)=>{$X(o,s,i)}}}},Ege="any",EX=({property:t,value:e,matchStrategy:r})=>{const n=r||Ege,i=o=>kX(o?.[t],e,n);return{any:{enter:(o,s)=>{$X(o,s,i)}}}},Age=({operationIds:t})=>({Operation:{enter(e,r){const n=e.operationId;if(!n)return;const i=t[n];if(i){if(i.responses&&e.responses)for(const o of Object.keys(i.responses)){const s=tj(e.responses[o],r.resolve);s&&(s.content=s.content?s.content:{},Object.keys(i.responses[o]).forEach(a=>{const l=i.responses[o][a];s.content[a]={...s.content[a],examples:K_(Oh(l,r.config?.configPath))}}),e.responses[o]=s)}if(i.request&&e.requestBody){const o=tj(e.requestBody,r.resolve);if(!o)return;o.content=o.content?o.content:{},Object.keys(i.request).forEach(s=>{const a=i.request[s];o.content[s]={...o.content[s],examples:K_(Oh(a,r.config?.configPath))}}),e.requestBody=o}}}}});function tj(t,e){if(!qr(t))return t;const r=e(t);return r.error?void 0:JSON.parse(JSON.stringify(r.node))}const AX=()=>{const t=new Map;function e(n,i,o){t.set(n.absolutePointer,{usedIn:t.get(n.absolutePointer)?.usedIn??[],componentType:i,name:o})}function r(n,i){const o=i.length;for(const[s,{usedIn:a,name:l,componentType:c}]of t)if(!a.some(d=>!i.some(p=>d.absolutePointer.startsWith(p)&&(d.absolutePointer.length===p.length||d.absolutePointer[p.length]==="/")))&&c&&n.components){i.push(s);const d=n.components[c];delete d[l],t.delete(s),ch(d)&&delete n.components[c]}return i.length>o?r(n,i):i.length}return{ref:{leave(n,{location:i,type:o,resolve:s,key:a}){if(["Schema","Header","Parameter","Response","Example","RequestBody"].includes(o.name)){const l=s(n);if(!l.location)return;const[c,u]=l.location.absolutePointer.split("#",2);if(!u)return;const d=u.split("/").slice(0,4).join("/"),p=`${c}#${d}`,h=t.get(p);h?h.usedIn.push(i):t.set(p,{usedIn:[i],name:a.toString()})}}},Root:{leave(n,i){const o=i.getVisitorData();o.removedCount=r(n,[]),ch(n.components)&&delete n.components}},NamedSchemas:{Schema(n,{location:i,key:o}){n.allOf||e(i,"schemas",o.toString())}},NamedParameters:{Parameter(n,{location:i,key:o}){e(i,"parameters",o.toString())}},NamedResponses:{Response(n,{location:i,key:o}){e(i,"responses",o.toString())}},NamedExamples:{Example(n,{location:i,key:o}){e(i,"examples",o.toString())}},NamedRequestBodies:{RequestBody(n,{location:i,key:o}){e(i,"requestBodies",o.toString())}},NamedHeaders:{Header(n,{location:i,key:o}){e(i,"headers",o.toString())}}}},Ige={"operation-description-override":bX,"tag-description-override":xX,"info-description-override":SX,"info-override":wX,"remove-x-internal":CX,"remove-unused-components":AX,"filter-in":TX,"filter-out":EX,"media-type-examples-override":Age},IX=()=>{const t=new Map;function e(n,i,o){t.set(n.absolutePointer,{usedIn:t.get(n.absolutePointer)?.usedIn??[],componentType:i,name:o})}function r(n,i){const o=i.length;for(const[s,{usedIn:a,name:l,componentType:c}]of t)!a.some(d=>!i.some(p=>d.absolutePointer.startsWith(p)&&(d.absolutePointer.length===p.length||d.absolutePointer[p.length]==="/")))&&c&&(i.push(s),delete n[c][l],t.delete(s),ch(n[c])&&delete n[c]);return i.length>o?r(n,i):i.length}return{ref:{leave(n,{location:i,type:o,resolve:s,key:a}){if(["Schema","Parameter","Response","SecurityScheme"].includes(o.name)){const l=s(n);if(!l.location)return;const[c,u]=l.location.absolutePointer.split("#",2);if(!u)return;const d=u.split("/").slice(0,3).join("/"),p=`${c}#${d}`,h=t.get(p);h?h.usedIn.push(i):t.set(p,{usedIn:[i],name:a.toString()})}}},Root:{leave(n,i){const o=i.getVisitorData();o.removedCount=r(n,[])}},NamedSchemas:{Schema(n,{location:i,key:o}){n.allOf||e(i,"definitions",o.toString())}},NamedParameters:{Parameter(n,{location:i,key:o}){e(i,"parameters",o.toString())}},NamedResponses:{Response(n,{location:i,key:o}){e(i,"responses",o.toString())}},NamedSecuritySchemes:{SecurityScheme(n,{location:i,key:o}){e(i,"securityDefinitions",o.toString())}}}},Rge={"operation-description-override":bX,"tag-description-override":xX,"info-description-override":SX,"info-override":wX,"remove-x-internal":CX,"remove-unused-components":IX,"filter-in":TX,"filter-out":EX},_ge={},jge={},Qge={},Dge={},Nge={},Mge={recommended:mpe,"recommended-strict":Ope,minimal:vpe,all:ype,spec:bpe},rj={id:"",rules:{oas3:Mhe,oas2:Whe,async2:Zhe,async3:Jhe,arazzo1:yge,overlay1:bge,openrpc1:Cge},preprocessors:{oas3:qhe,oas2:Uhe,async2:Yhe,async3:Khe,arazzo1:vge,overlay1:xge,openrpc1:$ge},decorators:{oas3:Ige,oas2:Rge,async2:_ge,async3:jge,arazzo1:Qge,overlay1:Dge,openrpc1:Nge},configs:Mge};function qge(t){return!ji(t)}function zge(){return new Promise(t=>{setTimeout(t)})}function Np(t,e){return t+"::"+e}class Ad{constructor(e,r,n){this.absoluteRef=e,this.body=r,this.mimeType=n}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 FT extends Error{constructor(e){super(e.message),this.originalError=e,Object.setPrototypeOf(this,FT.prototype)}}function Lge(t,e){const r=new Ad(e,t);try{return{source:r,parsed:XT(t,{filename:e})}}catch(n){throw new df(n,r)}}class K0{constructor(e={http:{headers:[]}}){this.config=e,this.cache=new Map}getFiles(){return new Set(Array.from(this.cache.keys()))}resolveExternalRef(e,r){return en(r)?r:e&&en(e)?new URL(r,e).href:Dt.resolve(e?Dt.dirname(e):process.cwd(),r)}async loadExternalRef(e){try{if(en(e)){const{body:r,mimeType:n}=await Qz(e,this.config.http);return new Ad(e,r,n)}else{if((void 0)(e).isDirectory())throw new Error(`Expected a file but received a folder at ${e}.`);const r=await(void 0).readFile(e,"utf-8");return new Ad(e,r.replace(/\r\n/g,`
168
168
  `))}}catch(r){throw r.message=r.message.replace(", lstat",""),new FT(r)}}parseDocument(e,r=!1){const n=e.absoluteRef.substr(e.absoluteRef.lastIndexOf("."));if(![".json",".json",".yml",".yaml"].includes(n)&&!e.mimeType?.match(/(json|yaml|openapi)/)&&!r)return{source:e,parsed:e.body};try{return{source:e,parsed:XT(e.body,{filename:e.absoluteRef})}}catch(i){throw new df(i,e)}}async resolveDocument(e,r,n=!1){const i=this.resolveExternalRef(e,r),o=this.cache.get(i);if(o)return o;const s=this.loadExternalRef(i).then(a=>this.parseDocument(a,n));return this.cache.set(i,s),s}}function nj(t,e){return{prev:t,node:e}}function Vge(t,e){for(;t;){if(t.node===e)return!0;t=t.prev}return!1}const Wf={name:"unknown",properties:{}},Xge={name:"scalar",properties:{}};async function yh(t){const{rootDocument:e,externalRefResolver:r,rootType:n}=t,i=new Map,o=new Set,s=[];l(e.parsed,e,"#/",n);let a;do a=await Promise.all(s);while(s.length!==a.length);return i;function l(c,u,d,p){const h=u.source.absoluteRef,m=new Map;g(c,p,h+d);function g(y,v,b){if(typeof y!="object"||y===null)return;const w=`${v.name}::${b}`;if(o.has(w))return;o.add(w);const[S,P]=Object.entries(y).find(([C])=>C==="$anchor")||[];if(P&&m.set(`#${P}`,y),Array.isArray(y)){const C=v.items;if(C===void 0&&v!==Wf&&v!==Pc)return;const E=typeof C=="function";for(let R=0;R<y.length;R++){let D=E?C(y[R],Lu(b,R)):C;if(D===void 0&&v!==Wf&&v!==Pc)continue;const _=D?.directResolveAs?{$ref:y[R]}:y[R];D=D?.directResolveAs||D,g(_,Cc(D)?D:Wf,Lu(b,R))}return}for(const C of Object.keys(y)){let E=y[C],R=Tl(v.properties,C);R===void 0&&(R=v.additionalProperties),typeof R=="function"&&(R=R(E,C)),R===void 0&&(R=Wf),v.extensionsPrefix&&C.startsWith(v.extensionsPrefix)&&R===Wf&&(R=Pc),!Cc(R)&&R?.directResolveAs&&(R=R.directResolveAs,E={$ref:E}),R&&R.name===void 0&&R.resolvable!==!1&&(R=Xge),!(!Cc(R)||typeof E!="object")&&g(E,R,Lu(b,Qp(C)))}if(qr(y)){const C=O(u,y,{prev:null,node:y}).then(E=>{E.resolved&&l(E.node,E.document,E.nodePointer,v)});s.push(C)}if(Dz(y)){const C=O(u,{$ref:y.externalValue},{prev:null,node:y}).then(E=>{E.resolved&&l(E.node,E.document,E.nodePointer,v)});s.push(C)}}async function O(y,v,b){if(Vge(b.prev,v))throw new Error("Self-referencing circular pointer");if(Zre(v.$ref)){await zge();const L={resolved:!0,isRemote:!1,node:m.get(v.$ref),document:y,nodePointer:v.$ref},W=Np(y.source.absoluteRef,v.$ref);return i.set(W,L),L}const{uri:w,pointer:S}=Bre(v.$ref),P=w!==null&&r.resolveExternalRef(y.source.absoluteRef,w)!==y.source.absoluteRef;let C;try{C=P?await r.resolveDocument(y.source.absoluteRef,w):y}catch(L){const W={resolved:!1,isRemote:P,document:void 0,error:L},Y=Np(y.source.absoluteRef,v.$ref);return i.set(Y,W),W}let E={resolved:!0,document:C,isRemote:P,node:y.parsed,nodePointer:"#/"},R=C.parsed;const D=S;for(const L of D)if(typeof R!="object"){R=void 0;break}else if(R[L]!==void 0)R=R[L],E.nodePointer=Lu(E.nodePointer,Qp(L));else if(qr(R)){if(E=await O(C,R,nj(b,R)),C=E.document||C,typeof E.node!="object"){R=void 0;break}R=E.node[L],E.nodePointer=Lu(E.nodePointer,Qp(L))}else{R=void 0;break}E.node=R,E.document=C;const _=Np(y.source.absoluteRef,v.$ref);return E.document&&qr(R)&&(E=await O(E.document,R,nj(b,R))),i.set(_,E),{...E}}}}const Zt=(t,e)=>{if(e)for(const r of Object.keys(e))xt(t[r])&&typeof e[r]=="string"?t[r]={...t[r],severity:e[r]}:t[r]=e[r]};function ar(t,e){if(e)for(const r of Object.keys(e))t.hasOwnProperty(r)&&(xt(t[r])&&typeof e[r]=="string"?t[r]={...t[r],severity:e[r]}:t[r]=e[r])}function Wge(t){if(t.indexOf("/")>-1){const[e,r]=t.split("/");return{pluginId:e,configName:r}}else return{pluginId:"",configName:t}}function jr(t,e){if(!e)return t;const r={};for(const n of Object.keys(t))r[`${e}/${n}`]=t[n];return r}function RX(t){const e={rules:{},oas2Rules:{},oas3_0Rules:{},oas3_1Rules:{},oas3_2Rules:{},async2Rules:{},async3Rules:{},arazzo1Rules:{},overlay1Rules:{},openrpc1Rules:{},preprocessors:{},oas2Preprocessors:{},oas3_0Preprocessors:{},oas3_1Preprocessors:{},oas3_2Preprocessors:{},async2Preprocessors:{},async3Preprocessors:{},arazzo1Preprocessors:{},overlay1Preprocessors:{},openrpc1Preprocessors:{},decorators:{},oas2Decorators:{},oas3_0Decorators:{},oas3_1Decorators:{},oas3_2Decorators:{},async2Decorators:{},async3Decorators:{},arazzo1Decorators:{},overlay1Decorators:{},openrpc1Decorators:{}};for(const r of t){if(xt(r)&&"extends"in r&&r.extends!==void 0)throw new Error(`'extends' is not supported in shared configs yet:
169
169
  ${JSON.stringify(r,null,2)}`);Zt(e.rules,r.rules),Zt(e.oas2Rules,r.oas2Rules),ar(e.oas2Rules,r.rules),Zt(e.oas3_0Rules,r.oas3_0Rules),ar(e.oas3_0Rules,r.rules),Zt(e.oas3_1Rules,r.oas3_1Rules),ar(e.oas3_1Rules,r.rules),Zt(e.oas3_2Rules,r.oas3_2Rules),ar(e.oas3_2Rules,r.rules),Zt(e.async2Rules,r.async2Rules),ar(e.async2Rules,r.rules),Zt(e.async3Rules,r.async3Rules),ar(e.async3Rules,r.rules),Zt(e.arazzo1Rules,r.arazzo1Rules),ar(e.arazzo1Rules,r.rules),Zt(e.overlay1Rules,r.overlay1Rules),ar(e.overlay1Rules,r.rules),Zt(e.openrpc1Rules,r.openrpc1Rules),ar(e.openrpc1Rules,r.rules),Zt(e.preprocessors,r.preprocessors),Zt(e.oas2Preprocessors,r.oas2Preprocessors),ar(e.oas2Preprocessors,r.preprocessors),Zt(e.oas3_0Preprocessors,r.oas3_0Preprocessors),ar(e.oas3_0Preprocessors,r.preprocessors),Zt(e.oas3_1Preprocessors,r.oas3_1Preprocessors),ar(e.oas3_1Preprocessors,r.preprocessors),Zt(e.oas3_2Preprocessors,r.oas3_2Preprocessors),ar(e.oas3_2Preprocessors,r.preprocessors),Zt(e.async2Preprocessors,r.async2Preprocessors),ar(e.async2Preprocessors,r.preprocessors),Zt(e.async3Preprocessors,r.async3Preprocessors),ar(e.async3Preprocessors,r.preprocessors),Zt(e.arazzo1Preprocessors,r.arazzo1Preprocessors),ar(e.arazzo1Preprocessors,r.preprocessors),Zt(e.overlay1Preprocessors,r.overlay1Preprocessors),ar(e.overlay1Preprocessors,r.preprocessors),Zt(e.openrpc1Preprocessors,r.openrpc1Preprocessors),ar(e.openrpc1Preprocessors,r.preprocessors),Zt(e.decorators,r.decorators),Zt(e.oas2Decorators,r.oas2Decorators),ar(e.oas2Decorators,r.decorators),Zt(e.oas3_0Decorators,r.oas3_0Decorators),ar(e.oas3_0Decorators,r.decorators),Zt(e.oas3_1Decorators,r.oas3_1Decorators),ar(e.oas3_1Decorators,r.decorators),Zt(e.oas3_2Decorators,r.oas3_2Decorators),ar(e.oas3_2Decorators,r.decorators),Zt(e.async2Decorators,r.async2Decorators),ar(e.async2Decorators,r.decorators),Zt(e.async3Decorators,r.async3Decorators),ar(e.async3Decorators,r.decorators),Zt(e.arazzo1Decorators,r.arazzo1Decorators),ar(e.arazzo1Decorators,r.decorators),Zt(e.overlay1Decorators,r.overlay1Decorators),ar(e.overlay1Decorators,r.decorators),Zt(e.openrpc1Decorators,r.openrpc1Decorators),ar(e.openrpc1Decorators,r.decorators)}return e}function Uge(t){return new Map(JSON.parse(JSON.stringify([...t])))}function ij(t){return t!==void 0&&typeof t=="object"&&"id"in t}function Bge(t){return typeof t=="function"}function oj(t,e){return{prev:t,value:e}}function sj(t){return t?.prev??null}function Fge(t){const e={};for(;t.parent;)e[t.parent.type.name]=t.parent.activatedOn?.value.node,t=t.parent;return e}function Zge(t){const e={};for(;t.parent;)t.parent.activatedOn?.value.location&&(e[t.parent.type.name]=t.parent.activatedOn?.value.location),t=t.parent;return e}function Id(t){const{document:e,rootType:r,normalizedVisitors:n,resolvedRefMap:i,ctx:o}=t,s={},a=new Set;l(e.parsed,r,new vy(e.source,"#/"),void 0,"");function l(c,u,d,p,h){const m=(E,R=O.source.absoluteRef)=>{if(!qr(E))return{location:d,node:E};const D=Np(R,E.$ref),_=i.get(D);if(!_)return{location:void 0,node:void 0};const{resolved:L,node:W,document:Y,nodePointer:Z,error:J}=_;return{location:L?new vy(Y.source,Z):J instanceof df?new vy(J.source,""):void 0,node:W,error:J}},g=d;let O=d;const{node:y,location:v,error:b}=m(c),w=new Set;if(qr(c)){const E=n.ref.enter;for(const{visit:R,ruleId:D,severity:_,message:L,context:W}of E){w.add(W);const Y=P.bind(void 0,D,_,L);R(c,{report:Y,resolve:m,rawNode:c,rawLocation:g,location:d,type:u,parent:p,key:h,parentLocations:{},specVersion:o.specVersion,config:o.config,getVisitorData:C.bind(void 0,D)},{node:y,location:v,error:b}),v?.source.absoluteRef&&o.refTypes&&o.refTypes.set(v?.source.absoluteRef,u)}}if(y!==void 0&&v&&u.name!=="scalar"){O=v;const E=s[u.name]?.has?.(y);let R=!1;const _=n.any.enter.concat(n[u.name]?.enter||[]),L=[];for(const{context:Z,visit:J,skip:ae,ruleId:F,severity:oe,message:q}of _){if(a.has(`${O.absolutePointer}${O.pointer}`))break;if(Z.isSkippedLevel)Z.parent.activatedOn&&!Z.parent.activatedOn.value.nextLevelTypeActivated&&!Z.seen.has(c)&&(Z.seen.add(c),R=!0,L.push(Z));else if(Z.parent&&Z.parent.activatedOn&&Z.activatedOn?.value.withParentNode!==Z.parent.activatedOn.value.node&&Z.parent.activatedOn.value.nextLevelTypeActivated?.value!==u||!Z.parent&&!E){L.push(Z);const M={node:y,location:v,nextLevelTypeActivated:null,withParentNode:Z.parent?.activatedOn?.value.node,skipped:(Z.parent?.activatedOn?.value.skipped||ae?.(y,h,{location:d,rawLocation:g,resolve:m,rawNode:c}))??!1};Z.activatedOn=oj(Z.activatedOn,M);let U=Z.parent;for(;U;)U.activatedOn.value.nextLevelTypeActivated=oj(U.activatedOn.value.nextLevelTypeActivated,u),U=U.parent;M.skipped||(R=!0,w.add(Z),S(J,y,c,Z,F,oe,q))}}if(R||!E){if(s[u.name]=s[u.name]||new Set,s[u.name].add(y),Array.isArray(y)){const Z=u.items;if(Z!==void 0){const J=typeof Z=="function";for(let ae=0;ae<y.length;ae++){let F=J?Z(y[ae],v.child([ae]).absolutePointer):Z,oe=y[ae];F?.directResolveAs&&(F=F.directResolveAs,oe={$ref:oe}),Cc(F)&&l(oe,F,v.child([ae]),y,ae)}}}else if(typeof y=="object"&&y!==null){const Z=Object.keys(u.properties);u.additionalProperties?Z.push(...Object.keys(y).filter(J=>!Z.includes(J))):u.extensionsPrefix&&Z.push(...Object.keys(y).filter(J=>J.startsWith(u.extensionsPrefix))),qr(c)&&Z.push(...Object.keys(c).filter(J=>J!=="$ref"&&!Z.includes(J)));for(const J of Z){let ae=y[J],F=v;ae===void 0&&(ae=c[J],F=d);let oe=Tl(u.properties,J);if(oe===void 0&&(oe=u.additionalProperties),typeof oe=="function"&&(oe=oe(ae,J)),oe===void 0&&u.extensionsPrefix&&J.startsWith(u.extensionsPrefix)&&(oe=Pc),!Cc(oe)&&oe?.directResolveAs&&(oe=oe.directResolveAs,ae={$ref:ae}),oe&&oe.name===void 0&&oe.resolvable!==!1&&(oe={name:"scalar",properties:{}}),qr(c[J])&&oe?.name==="scalar"){l(c[J],oe,d.child([J]),c,J);continue}!Cc(oe)||oe.name==="scalar"&&!qr(ae)||l(ae,oe,F.child([J]),y,J)}}}const W=n.any.leave,Y=(n[u.name]?.leave||[]).concat(W);for(const Z of L.reverse())if(Z.isSkippedLevel)Z.seen.delete(y);else if(Z.activatedOn=sj(Z.activatedOn),Z.parent){let J=Z.parent;for(;J;)J.activatedOn.value.nextLevelTypeActivated=sj(J.activatedOn.value.nextLevelTypeActivated),J=J.parent}for(const{context:Z,visit:J,ruleId:ae,severity:F,message:oe}of Y)!Z.isSkippedLevel&&w.has(Z)&&S(J,y,c,Z,ae,F,oe)}if(O=d,qr(c)){const E=n.ref.leave;for(const{visit:R,ruleId:D,severity:_,context:L,message:W}of E)if(w.has(L)){const Y=P.bind(void 0,D,_,W);R(c,{report:Y,resolve:m,rawNode:c,rawLocation:g,location:d,type:u,parent:p,key:h,parentLocations:{},specVersion:o.specVersion,config:o.config,getVisitorData:C.bind(void 0,D)},{node:y,location:v,error:b})}}function S(E,R,D,_,L,W,Y){const Z=P.bind(void 0,L,W,Y);E(R,{report:Z,resolve:m,rawNode:D,location:O,rawLocation:g,type:u,parent:p,key:h,parentLocations:Zge(_),specVersion:o.specVersion,config:o.config,ignoreNextVisitorsOnNode:()=>{a.add(`${O.absolutePointer}${O.pointer}`)},getVisitorData:C.bind(void 0,L)},Fge(_),_)}function P(E,R,D,_){const W=(_.location?Array.isArray(_.location)?_.location:[_.location]:[{...O,reportOnKey:!1}]).map(Z=>({...O,reportOnKey:!1,...Z})),Y=_.forceSeverity||R;Y!=="off"&&o.problems.push({ruleId:_.ruleId||E,severity:Y,..._,message:D?D.replace("{{message}}",_.message):_.message,suggest:_.suggest||[],location:W})}function C(E){return o.visitorsData[E]=o.visitorsData[E]||{},o.visitorsData[E]}}}const Yge={Root:"DefinitionRoot",ServerVariablesMap:"ServerVariableMap",Paths:["PathMap","PathsMap"],CallbacksMap:"CallbackMap",MediaTypesMap:"MediaTypeMap",ExamplesMap:"ExampleMap",EncodingMap:"EncodingsMap",HeadersMap:"HeaderMap",LinksMap:"LinkMap",OAuth2Flows:"SecuritySchemeFlows",Responses:"ResponsesMap"};function Rd(t,e){const r={};r.any={enter:[],leave:[]};for(const s of Object.keys(e))r[s]={enter:[],leave:[]};r.ref={enter:[],leave:[]};for(const{ruleId:s,severity:a,message:l,visitor:c}of t)o({ruleId:s,severity:a,message:l},c,null);for(const s of Object.keys(r))r[s].enter.sort((a,l)=>l.depth-a.depth),r[s].leave.sort((a,l)=>a.depth-l.depth);return r;function n(s,a,l,c,u=[]){if(u.includes(a))return;u=[...u,a];const d=new Set;for(const h of Object.values(a.properties)){if(h===l){p(s,u);continue}typeof h=="object"&&h!==null&&h.name&&d.add(h)}a.additionalProperties&&typeof a.additionalProperties!="function"&&(a.additionalProperties===l?p(s,u):a.additionalProperties.name!==void 0&&d.add(a.additionalProperties)),a.items&&typeof a.items!="function"&&(a.items===l?p(s,u):a.items.name!==void 0&&d.add(a.items)),a.extensionsPrefix&&d.add(Pc);for(const h of Array.from(d.values()))n(s,h,l,c,u);function p(h,m){for(const g of m.slice(1))r[g.name]=r[g.name]||{enter:[],leave:[]},r[g.name].enter.push({...h,visit:()=>{},depth:0,context:{isSkippedLevel:!0,seen:new Set,parent:c}})}}function i(s,a){if(Array.isArray(a)){const l=a.find(c=>s[c])||void 0;return l&&s[l]}return s[a]}function o(s,a,l,c=0){const u=Object.keys(e);if(c===0)u.push("any"),u.push("ref");else{if(a.any)throw new Error("any() is allowed only on top level");if(a.ref)throw new Error("ref() is allowed only on top level")}for(const d of u){const p=a[d]||i(a,Yge[d]),h=r[d];if(!p)continue;let m,g,O;const y=xt(p);if(d==="ref"&&y&&p.skip)throw new Error("ref() visitor does not support skip");typeof p=="function"?m=p:y&&(m=p.enter,g=p.leave,O=p.skip);const v=(m?1:0)+(g?1:0)+(O?1:0),b=y&&Object.keys(p).length>v,w={activatedOn:null,type:e[d],parent:l,isSkippedLevel:!1};if(b&&o(s,p,w,c+1),l&&n(s,l.type,e[d],l),m||y){if(m&&typeof m!="function")throw new Error("DEV: should be function");h.enter.push({...s,visit:m||(()=>{}),skip:O,depth:c,context:w})}if(g){if(typeof g!="function")throw new Error("DEV: should be function");h.leave.push({...s,visit:g,depth:c,context:w})}}}}function _X({node:t,ctx:e,plugins:r}){if(!t.extends)return t;const n=(t.extends||[]).map(i=>{if(!en(i)&&!Rc.extname(i))return ome(i,r);const o=e.resolve({$ref:i});return o.location&&o.node!==void 0?o.node:null}).filter(Hi);return RX([...n.map(i=>_X({node:i,ctx:e,plugins:r})),{...t,extends:void 0}])}function oO(t,e){if(xt(t)&&Array.isArray(t.plugins)){const{plugins:r,rootConfigDir:n}=e.getVisitorData();r.push(...t.plugins.map(i=>QX(i,e.location.source.absoluteRef.replace(/^file:\/\//,""),n)))}}const Gge=Rd([{severity:"error",ruleId:N7,visitor:{ref:{},ConfigGovernance:{leave(t,e){oO(t,e)}},ConfigApisProperties:{leave(t,e){oO(t,e)}},"rootRedoclyConfigSchema.scorecard.levels_items":{leave(t,e){oO(t,e)}},ConfigRoot:{leave(t,e){oO(t,e)}}}}],gg);function sO(t,e){if(xt(t)&&t.extends){const{plugins:r}=e.getVisitorData(),n=_X({node:t,ctx:e,plugins:r});Object.assign(t,n),delete t.extends}}const Hge=Rd([{severity:"error",ruleId:D7,visitor:{ref:{leave(t,e,r){rC(t,r,e)}},ConfigGovernance:{leave(t,e){sO(t,e)}},ConfigApisProperties:{leave(t,e){sO(t,e)}},"rootRedoclyConfigSchema.scorecard.levels_items":{leave(t,e){sO(t,e)}},ConfigRoot:{leave(t,e){sO(t,e)}}}}],gg);function aj(t,e){switch(e){case"oas3":switch(t){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(t){case"Schema":return"definitions";case"Parameter":return"parameters";case"Response":return"responses";default:return null}case"async2":switch(t){case"Schema":return"schemas";case"Parameter":return"parameters";default:return null}case"async3":switch(t){case"Schema":return"schemas";case"Parameter":return"parameters";default:return null}case"arazzo1":switch(t){case"Root.workflows_items.parameters_items":case"Root.workflows_items.steps_items.parameters_items":return"parameters";default:return null}case"overlay1":return null;case"openrpc1":switch(t){case"ContentDescriptor":return"contentDescriptors";case"Schema":return"schemas";case"Example":return"examples";case"Link":return"links";case"ErrorObject":return"errors";case"ExamplePairing":return"examplePairingObjects";case"Tag":return"tags";default:return null}}}function Jge(t,e,r,n,i){let o,s;const a={ref:{leave(p,h,m){if(!m.location||m.node===void 0){Dp(m,h.report,h.location);return}if(m.location.source===r.source&&m.location.source===h.location.source&&h.type.name!=="scalar"&&!e){p.$ref!==m.location.pointer&&(p.$ref=m.location.pointer);return}if(i&&en(p.$ref))return;const g=aj(h.type.name,t);g?e?(c(g,m,h),rC(p,m,h)):(p.$ref=c(g,m,h),l(p,m,h)):rC(p,m,h)}},Example:{leave(p,h){if(Dz(p)&&p.value===void 0){const m=h.resolve({$ref:p.externalValue});if(!m.location||m.node===void 0){Dp(m,h.report,h.location);return}if(i&&en(p.externalValue))return;p.value=h.resolve({$ref:p.externalValue}).node,delete p.externalValue}}},Root:{enter(p,h){s=h.location,t==="oas3"?o=p.components=p.components||{}:t==="oas2"?o=p:t==="async2"?o=p.components=p.components||{}:t==="async3"?o=p.components=p.components||{}:t==="arazzo1"?o=p.components=p.components||{}:t==="openrpc1"&&(o=p.components=p.components||{})}}};t==="oas3"&&(a.DiscriminatorMapping={leave(p,h){for(const m of Object.keys(p)){const g=p[m],O=h.resolve({$ref:g});if(!O.location||O.node===void 0){Dp(O,h.report,h.location.child(m));return}const y=aj("Schema",t);p[m]=c(y,O,h)}}});function l(p,h,m){const g=Np(m.location.source.absoluteRef,p.$ref);n.set(g,{document:r,isRemote:!1,node:h.node,nodePointer:p.$ref,resolved:!0})}function c(p,h,m){o[p]=o[p]||{};const g=d(h,p,m);return o[p][g]=h.node,t==="oas3"||t==="async2"||t==="async3"||t==="openrpc1"?`#/components/${p}/${g}`:`#/${p}/${g}`}function u(p,h,m){return qr(p)&&m.resolve(p,s.absolutePointer).location?.absolutePointer===h.location.absolutePointer?!0:tC(p,h.node)}function d(p,h,m){const[g,O]=[p.location.source.absoluteRef,p.location.pointer],y=o[h];let v="";const b=O.slice(2).split("/").filter(Hi);for(;b.length>0;)if(v=b.pop()+(v?`-${v}`:""),!y||!y[v]||u(y[v],p,m))return v;if(v=Fre(g)+(v?`_${v}`:""),!y[v]||u(y[v],p,m))return v;const w=v;let S=2;for(;y[v]&&!u(y[v],p,m);)v=`${w}-${S}`,S++;return y[v]||m.report({message:`Two schemas are referenced with the same name but different content. Renamed ${w} to ${v}.`,location:m.location,forceSeverity:"warn"}),v}return a}async function Kge(t){const{document:e,config:r,types:n,externalRefResolver:i,dereference:o=!1,removeUnusedComponents:s=!1,keepUrlRefs:a=!1}=t,l=B0(e.parsed),c=j7(l),u=r.getRulesForSpecVersion(c),d=bT(r.extendTypes(n,l),r),p=Xv(u,r,"preprocessors",l),h=Xv(u,r,"decorators",l),m={problems:[],specVersion:l,config:r,refTypes:new Map,visitorsData:{}};s&&!h.some(y=>y.ruleId==="remove-unused-components")&&h.push({severity:"error",ruleId:"remove-unused-components",visitor:c==="oas2"?IX():AX()});let g=await yh({rootDocument:e,rootType:d.Root,externalRefResolver:i});p.length>0&&(Id({document:e,rootType:d.Root,normalizedVisitors:Rd(p,d),resolvedRefMap:g,ctx:m}),g=await yh({rootDocument:e,rootType:d.Root,externalRefResolver:i}));const O=Rd([{severity:"error",ruleId:"bundler",visitor:Jge(c,o,e,g,a)},...h],d);return Id({document:e,rootType:d.Root,normalizedVisitors:O,resolvedRefMap:g,ctx:m}),{bundle:e,problems:m.problems.map(y=>r.addProblemToIgnore(y)),fileDependencies:i.getFiles(),rootType:d.Root,refTypes:m.refTypes,visitorsData:m.visitorsData}}function eme(t,e,r){const n={plugins:[],rootConfigDir:r},i={problems:[],specVersion:"oas3_0",refTypes:new Map,visitorsData:{[N7]:n}};return Id({document:t,rootType:gg.ConfigRoot,normalizedVisitors:Gge,resolvedRefMap:e,ctx:i}),n.plugins}function tme(t,e,r){const n={plugins:r},i={problems:[],specVersion:"oas3_0",refTypes:new Map,visitorsData:{[D7]:n}};return Id({document:t,rootType:gg.ConfigRoot,normalizedVisitors:Hge,resolvedRefMap:e,ctx:i}),t.parsed??{}}async function jX(t){const{ref:e,doc:r,externalRefResolver:n=new K0(t.config.resolve),base:i=null}=t;if(!(e||r))throw new Error(`Document or reference is required.
170
- `);const o=r===void 0?await n.resolveDocument(i,e,!0):r;if(o instanceof Error)throw o;return t.collectSpecData?.(o.parsed),Kge({document:o,...t,externalRefResolver:n,types:IT(B0(o.parsed))})}const lS=new Map;async function rme({rawConfigDocument:t,configPath:e,externalRefResolver:r,customExtends:n}){const i=t===void 0?fpe:t.parsed;if(n!==void 0&&xt(i)&&(i.extends=n),xt(i)&&i?.extends?.some(qge))throw new Error("Configuration format not detected in extends: values must be strings.");const o=t??{source:new Ad(e??"",JSON.stringify(i)),parsed:i},s=await yh({rootDocument:o,rootType:gg.ConfigRoot,externalRefResolver:r??new K0(Q7(i?.resolve))});let a=[],l,c="";ai?l=[...(i?.plugins||[]).filter(h=>!ji(h)),rj]:(c=Dt.dirname(e??""),a=eme(o,s,c),l=[...await ime(a.map(h=>lj(h)?h.absolutePath:h),c),rj]);const u=tme(o,Uge(s),l);u.apis&&(u.apis=Object.fromEntries(Object.entries(u.apis).map(([p,h])=>{const m=RX([u,h]);return[p,{...h,...m}]})));const d=a.length?a.map(p=>lj(p)&&p.isModule?p.rawPath:p.absolutePath&&Dt.relative(c,p.absolutePath)).filter(Vv):void 0;return{resolvedConfig:{...u,plugins:d},resolvedRefMap:s,plugins:l}}function nme(t){for(const e of hpe)(void 0)(Dt.resolve(t,e))}function lj(t){return"isModule"in t}const QX=(t,e,r)=>{if(!ji(t))return t;const n=Dt.resolve(Dt.dirname(e),t);return(void 0)(n)?{absolutePath:n,rawPath:t,isModule:!1}:{absolutePath:Az.createRequire((typeof document>"u"?require("url").pathToFileURL(__filename).href:Bs&&Bs.tagName.toUpperCase()==="SCRIPT"&&Bs.src||new URL("replay-index-nUh5aT0a.js",document.baseURI).href)??__dirname).resolve(t,{paths:[r,(typeof document>"u"?require("url").pathToFileURL(__filename).href:Bs&&Bs.tagName.toUpperCase()==="SCRIPT"&&Bs.src||new URL("replay-index-nUh5aT0a.js",document.baseURI).href)?Dt.dirname((void 0)(typeof document>"u"?require("url").pathToFileURL(__filename).href:Bs&&Bs.tagName.toUpperCase()==="SCRIPT"&&Bs.src||new URL("replay-index-nUh5aT0a.js",document.baseURI).href)):__dirname]}),isModule:!0,rawPath:t}};async function ime(t,e){if(!t)return[];const r=async a=>{if(!ji(a))return a;try{const l=Dt.isAbsolute(a)?a:QX(a,Dt.join(e,dpe),e).absolutePath;if(!lS.has(l)){let c;if(typeof __webpack_require__=="function")c=__non_webpack_require__(l);else{const m=await import((void 0)(l).pathname);c=m.default||m}const u={contentDir:e},d=Array.isArray(c)?c:[c];for(const m of d)m?.id&&ij(m)&&cr.info(`Deprecated plugin format detected: ${m.id}
170
+ `);const o=r===void 0?await n.resolveDocument(i,e,!0):r;if(o instanceof Error)throw o;return t.collectSpecData?.(o.parsed),Kge({document:o,...t,externalRefResolver:n,types:IT(B0(o.parsed))})}const lS=new Map;async function rme({rawConfigDocument:t,configPath:e,externalRefResolver:r,customExtends:n}){const i=t===void 0?fpe:t.parsed;if(n!==void 0&&xt(i)&&(i.extends=n),xt(i)&&i?.extends?.some(qge))throw new Error("Configuration format not detected in extends: values must be strings.");const o=t??{source:new Ad(e??"",JSON.stringify(i)),parsed:i},s=await yh({rootDocument:o,rootType:gg.ConfigRoot,externalRefResolver:r??new K0(Q7(i?.resolve))});let a=[],l,c="";ai?l=[...(i?.plugins||[]).filter(h=>!ji(h)),rj]:(c=Dt.dirname(e??""),a=eme(o,s,c),l=[...await ime(a.map(h=>lj(h)?h.absolutePath:h),c),rj]);const u=tme(o,Uge(s),l);u.apis&&(u.apis=Object.fromEntries(Object.entries(u.apis).map(([p,h])=>{const m=RX([u,h]);return[p,{...h,...m}]})));const d=a.length?a.map(p=>lj(p)&&p.isModule?p.rawPath:p.absolutePath&&Dt.relative(c,p.absolutePath)).filter(Vv):void 0;return{resolvedConfig:{...u,plugins:d},resolvedRefMap:s,plugins:l}}function nme(t){for(const e of hpe)(void 0)(Dt.resolve(t,e))}function lj(t){return"isModule"in t}const QX=(t,e,r)=>{if(!ji(t))return t;const n=Dt.resolve(Dt.dirname(e),t);return(void 0)(n)?{absolutePath:n,rawPath:t,isModule:!1}:{absolutePath:Az.createRequire((typeof document>"u"?require("url").pathToFileURL(__filename).href:Bs&&Bs.tagName.toUpperCase()==="SCRIPT"&&Bs.src||new URL("replay-index-D5DhKP1e.js",document.baseURI).href)??__dirname).resolve(t,{paths:[r,(typeof document>"u"?require("url").pathToFileURL(__filename).href:Bs&&Bs.tagName.toUpperCase()==="SCRIPT"&&Bs.src||new URL("replay-index-D5DhKP1e.js",document.baseURI).href)?Dt.dirname((void 0)(typeof document>"u"?require("url").pathToFileURL(__filename).href:Bs&&Bs.tagName.toUpperCase()==="SCRIPT"&&Bs.src||new URL("replay-index-D5DhKP1e.js",document.baseURI).href)):__dirname]}),isModule:!0,rawPath:t}};async function ime(t,e){if(!t)return[];const r=async a=>{if(!ji(a))return a;try{const l=Dt.isAbsolute(a)?a:QX(a,Dt.join(e,dpe),e).absolutePath;if(!lS.has(l)){let c;if(typeof __webpack_require__=="function")c=__non_webpack_require__(l);else{const m=await import((void 0)(l).pathname);c=m.default||m}const u={contentDir:e},d=Array.isArray(c)?c:[c];for(const m of d)m?.id&&ij(m)&&cr.info(`Deprecated plugin format detected: ${m.id}
171
171
  `);const p=ij(c)?c:Bge(c)?await c(u):await c?.default?.(u),h=Array.isArray(p)?p:[p];p&&lS.set(l,h.map(m=>({...m,path:a,absolutePath:l})))}return lS.get(l)}catch(l){throw new Error(`Failed to load plugin "${a}": ${l.message}
172
172
 
173
173
  ${l.stack}`)}},n=new Map,i=nme(e);i&&t.push(i);const o=new Set;return(await Promise.all(t.map(async a=>{if(ji(a)){if(en(a))throw new Error(Nt.red("We don't support remote plugins yet."));if(o.has(a))return;o.add(a)}const l=await r(a);if(!l)return;const c=Array.isArray(l)?l:[l];return(await Promise.all(c.map(async u=>{if(!u)return;const d=u.id;if(typeof d!="string")throw new Error(Nt.red(`Plugin must define \`id\` property in ${Nt.blue(a.toString())}.`));const p=u.absolutePath??a.toString(),h=n.get(d);if(h){if(p!==h)throw new Error(Nt.red(`Plugin "id" must be unique. Plugin ${Nt.blue(p)} uses id "${Nt.blue(d)}" already seen in ${Nt.blue(p)}`));return}n.set(d,p);const m={id:d,...u.configs?{configs:u.configs}:{},...u.typeExtension?{typeExtension:u.typeExtension}:{}};if(u.rules){if(!u.rules.oas3&&!u.rules.oas2&&!u.rules.async2&&!u.rules.async3&&!u.rules.arazzo1&&!u.rules.overlay1&&!u.rules.openrpc1)throw new Error(`Plugin rules must have \`oas3\`, \`oas2\`, \`async2\`, \`async3\`, \`arazzo\`, \`overlay1\`, or \`openrpc1\` rules "${a}.`);m.rules={},u.rules.oas3&&(m.rules.oas3=jr(u.rules.oas3,d)),u.rules.oas2&&(m.rules.oas2=jr(u.rules.oas2,d)),u.rules.async2&&(m.rules.async2=jr(u.rules.async2,d)),u.rules.async3&&(m.rules.async3=jr(u.rules.async3,d)),u.rules.arazzo1&&(m.rules.arazzo1=jr(u.rules.arazzo1,d)),u.rules.overlay1&&(m.rules.overlay1=jr(u.rules.overlay1,d)),u.rules.openrpc1&&(m.rules.openrpc1=jr(u.rules.openrpc1,d))}if(u.preprocessors){if(!u.preprocessors.oas3&&!u.preprocessors.oas2&&!u.preprocessors.async2&&!u.preprocessors.async3&&!u.preprocessors.arazzo1&&!u.preprocessors.overlay1&&!u.preprocessors.openrpc1)throw new Error(`Plugin \`preprocessors\` must have \`oas3\`, \`oas2\`, \`async2\`, \`async3\`, \`arazzo1\`, \`overlay1\`, or \`openrpc1\` preprocessors "${a}.`);m.preprocessors={},u.preprocessors.oas3&&(m.preprocessors.oas3=jr(u.preprocessors.oas3,d)),u.preprocessors.oas2&&(m.preprocessors.oas2=jr(u.preprocessors.oas2,d)),u.preprocessors.async2&&(m.preprocessors.async2=jr(u.preprocessors.async2,d)),u.preprocessors.async3&&(m.preprocessors.async3=jr(u.preprocessors.async3,d)),u.preprocessors.arazzo1&&(m.preprocessors.arazzo1=jr(u.preprocessors.arazzo1,d)),u.preprocessors.overlay1&&(m.preprocessors.overlay1=jr(u.preprocessors.overlay1,d)),u.preprocessors.openrpc1&&(m.preprocessors.openrpc1=jr(u.preprocessors.openrpc1,d))}if(u.decorators){if(!u.decorators.oas3&&!u.decorators.oas2&&!u.decorators.async2&&!u.decorators.async3&&!u.decorators.arazzo1&&!u.decorators.overlay1&&!u.decorators.openrpc1)throw new Error(`Plugin \`decorators\` must have \`oas3\`, \`oas2\`, \`async2\`, \`async3\`, \`arazzo1\`, \`overlay1\`, or \`openrpc1\` decorators "${a}.`);m.decorators={},u.decorators.oas3&&(m.decorators.oas3=jr(u.decorators.oas3,d)),u.decorators.oas2&&(m.decorators.oas2=jr(u.decorators.oas2,d)),u.decorators.async2&&(m.decorators.async2=jr(u.decorators.async2,d)),u.decorators.async3&&(m.decorators.async3=jr(u.decorators.async3,d)),u.decorators.arazzo1&&(m.decorators.arazzo1=jr(u.decorators.arazzo1,d)),u.decorators.overlay1&&(m.decorators.overlay1=jr(u.decorators.overlay1,d)),u.decorators.openrpc1&&(m.decorators.openrpc1=jr(u.decorators.openrpc1,d))}return u.assertions&&(m.assertions=u.assertions),{...u,...m}}))).filter(Vv)}))).filter(Vv).flat()}function ome(t,e){const{pluginId:r,configName:n}=Wge(t),i=e.find(s=>s.id===r);if(!i)throw new Error(`Invalid config ${Nt.red(t)}: plugin ${r} is not included.`);const o=i.configs?.[n];if(!o)throw new Error(r?`Invalid config ${Nt.red(t)}: plugin ${r} doesn't export config with name ${n}.`:`Invalid config ${Nt.red(t)}: there is no such built-in config.`);return o}async function DX(t,{configPath:e,externalRefResolver:r}={}){const i=Lge(typeof t=="string"?t:"",e??"");typeof t!="string"&&t&&(i.parsed=t);const{resolvedConfig:o,resolvedRefMap:s,plugins:a}=await rme({rawConfigDocument:sme(i),configPath:e,externalRefResolver:r});return new F0(o,{configPath:e,document:i,resolvedRefMap:s,plugins:a})}function sme(t){if(!t.parsed)return t;const{plugins:e,resolve:r,...n}=t.parsed,i={...structuredClone(n),plugins:e?.slice(),...r&&{resolve:{...r}}};return{...t,parsed:i}}var cS={},xo={},uS={},cj;function ex(){return cj||(cj=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e;(function(l){l[l.SCALAR=0]="SCALAR",l[l.MAPPING=1]="MAPPING",l[l.MAP=2]="MAP",l[l.SEQ=3]="SEQ",l[l.ANCHOR_REF=4]="ANCHOR_REF",l[l.INCLUDE_REF=5]="INCLUDE_REF"})(e=t.Kind||(t.Kind={}));function r(l,c){var u=c?c.endPosition:l.endPosition+1,d={key:l,value:c,startPosition:l.startPosition,endPosition:u,kind:e.MAPPING,parent:null,errors:[]};return d}t.newMapping=r;function n(l,c,u,d){return{errors:[],referencesAnchor:l,value:d,startPosition:c,endPosition:u,kind:e.ANCHOR_REF,parent:null}}t.newAnchorRef=n;function i(l){l===void 0&&(l="");var c={errors:[],startPosition:-1,endPosition:-1,value:""+l,kind:e.SCALAR,parent:null,doubleQuoted:!1,rawValue:""+l};return typeof l!="string"&&(c.valueObject=l),c}t.newScalar=i;function o(){return{errors:[],startPosition:-1,endPosition:-1,items:[],kind:e.SEQ,parent:null}}t.newItems=o;function s(){return o()}t.newSeq=s;function a(l){return{errors:[],startPosition:-1,endPosition:-1,mappings:l||[],kind:e.MAP,parent:null}}t.newMap=a})(uS)),uS}var Hs={},uj;function ff(){if(uj)return Hs;uj=1,Object.defineProperty(Hs,"__esModule",{value:!0});function t(s){return typeof s>"u"||s===null}Hs.isNothing=t;function e(s){return typeof s=="object"&&s!==null}Hs.isObject=e;function r(s){return Array.isArray(s)?s:t(s)?[]:[s]}Hs.toArray=r;function n(s,a){var l,c,u,d;if(a)for(d=Object.keys(a),l=0,c=d.length;l<c;l+=1)u=d[l],s[u]=a[u];return s}Hs.extend=n;function i(s,a){var l="",c;for(c=0;c<a;c+=1)l+=s;return l}Hs.repeat=i;function o(s){return s===0&&Number.NEGATIVE_INFINITY===1/s}return Hs.isNegativeZero=o,Hs}var dS,dj;function vg(){if(dj)return dS;dj=1;var t=(function(){function e(r,n,i){n===void 0&&(n=null),i===void 0&&(i=!1),this.name="YAMLException",this.reason=r,this.mark=n,this.message=this.toString(!1),this.isWarning=i}return e.isInstance=function(r){if(r!=null&&r.getClassIdentifier&&typeof r.getClassIdentifier=="function")for(var n=0,i=r.getClassIdentifier();n<i.length;n++){var o=i[n];if(o==e.CLASS_IDENTIFIER)return!0}return!1},e.prototype.getClassIdentifier=function(){var r=[];return r.concat(e.CLASS_IDENTIFIER)},e.prototype.toString=function(r){r===void 0&&(r=!1);var n;return n="JS-YAML: "+(this.reason||"(unknown reason)"),!r&&this.mark&&(n+=" "+this.mark.toString()),n},e.CLASS_IDENTIFIER="yaml-ast-parser.YAMLException",e})();return dS=t,dS}var fS,fj;function ame(){if(fj)return fS;fj=1;var t=ff(),e=(function(){function r(n,i,o,s,a){this.name=n,this.buffer=i,this.position=o,this.line=s,this.column=a}return r.prototype.getSnippet=function(n,i){n===void 0&&(n=0),i===void 0&&(i=75);var o,s,a,l,c;if(!this.buffer)return null;for(n=n||4,i=i||75,o="",s=this.position;s>0&&`\0\r
@@ -349,7 +349,7 @@ You should wrap it with \`css\` like this:
349
349
  gap: var(--spacing-xs);
350
350
  `,Uxe=T(zl)`
351
351
  width: 100%;
352
- `;function bE({input:t,onSave:e,onCancel:r,...n}){const[i,o]=$.useState(!!t.isSecret),s=({name:a,value:l})=>{e({...t,name:a,value:l,isSecret:i})};return f.jsx(h6,{variable:t,onSave:s,onCancel:r,maskValue:i,...n,children:f.jsx(wh,{children:f.jsx($W,{value:i,onChange:a=>o(a),title:"Make it secret"})})})}const LC=()=>({name:"",value:"",isSecret:!1}),Pr=t=>Ez+"$inputs."+t+yT,g6=(t,e)=>e.inputs.find(r=>r.get().name===t.match(`^${D0}$`)?.[1]);function Bxe({environments:t,activeEnvironmentId:e}){return t.get().find(n=>n.name===e.get())?.inputs||[]}function Ha(t){const e=new RegExp(D0,"g"),r=new Set;if(!t)return r;for(const[n,i,o]of t.matchAll(e)){const s=i||o;s&&r.add(s)}return r}function Ox(t){const e=/^\{?\$inputs\.([^\}\s]+)\}?$/,r=t.match(e);return r?r[1]:null}function Ey(t){const e=new Error(t);return e.source="ulid",e}const xE="0123456789ABCDEFGHJKMNPQRSTVWXYZ",Mp=xE.length,r5=Math.pow(2,48)-1,Fxe=10,Zxe=16;function Yxe(t){let e=Math.floor(t()*Mp);return e===Mp&&(e=Mp-1),xE.charAt(e)}function Gxe(t,e){if(isNaN(t))throw new Error(t+" must be a number");if(t>r5)throw Ey("cannot encode time greater than "+r5);if(t<0)throw Ey("time must be positive");if(Number.isInteger(Number(t))===!1)throw Ey("time must be an integer");let r,n="";for(;e>0;e--)r=t%Mp,n=xE.charAt(r)+n,t=(t-r)/Mp;return n}function Hxe(t,e){let r="";for(;t>0;t--)r=Yxe(e)+r;return r}function Jxe(t=!1,e){e||(e=typeof window<"u"?window:null);const r=e&&(e.crypto||e.msCrypto);if(r)return()=>{const n=new Uint8Array(1);return r.getRandomValues(n),n[0]/255};try{const n=require("crypto");return()=>n.randomBytes(1).readUInt8()/255}catch{}if(t){try{console.error("secure crypto unusable, falling back to insecure Math.random()!")}catch{}return()=>Math.random()}throw Ey("secure crypto unusable, insecure Math.random not allowed")}function Kxe(t){return t||(t=Jxe()),function(r){return isNaN(r)&&(r=Date.now()),Gxe(r,Fxe)+Hxe(Zxe,t)}}const db=Kxe();var e1e=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{},vc="1.9.0",n5=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function t1e(t){var e=new Set([t]),r=new Set,n=t.match(n5);if(!n)return function(){return!1};var i={major:+n[1],minor:+n[2],patch:+n[3],prerelease:n[4]};if(i.prerelease!=null)return function(l){return l===t};function o(a){return r.add(a),!1}function s(a){return e.add(a),!0}return function(l){if(e.has(l))return!0;if(r.has(l))return!1;var c=l.match(n5);if(!c)return o(l);var u={major:+c[1],minor:+c[2],patch:+c[3],prerelease:c[4]};return u.prerelease!=null||i.major!==u.major?o(l):i.major===0?i.minor===u.minor&&i.patch<=u.patch?s(l):o(l):i.minor<=u.minor?s(l):o(l)}}var r1e=t1e(vc),n1e=vc.split(".")[0],Eh=Symbol.for("opentelemetry.js.api."+n1e),Ah=e1e;function wg(t,e,r,n){var i;n===void 0&&(n=!1);var o=Ah[Eh]=(i=Ah[Eh])!==null&&i!==void 0?i:{version:vc};if(!n&&o[t]){var s=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+t);return r.error(s.stack||s.message),!1}if(o.version!==vc){var s=new Error("@opentelemetry/api: Registration of version v"+o.version+" for "+t+" does not match previously registered API v"+vc);return r.error(s.stack||s.message),!1}return o[t]=e,r.debug("@opentelemetry/api: Registered a global for "+t+" v"+vc+"."),!0}function _c(t){var e,r,n=(e=Ah[Eh])===null||e===void 0?void 0:e.version;if(!(!n||!r1e(n)))return(r=Ah[Eh])===null||r===void 0?void 0:r[t]}function Pg(t,e){e.debug("@opentelemetry/api: Unregistering a global for "+t+" v"+vc+".");var r=Ah[Eh];r&&delete r[t]}var i1e=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o},o1e=function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))},s1e=(function(){function t(e){this._namespace=e.namespace||"DiagComponentLogger"}return t.prototype.debug=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return Gf("debug",this._namespace,e)},t.prototype.error=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return Gf("error",this._namespace,e)},t.prototype.info=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return Gf("info",this._namespace,e)},t.prototype.warn=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return Gf("warn",this._namespace,e)},t.prototype.verbose=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return Gf("verbose",this._namespace,e)},t})();function Gf(t,e,r){var n=_c("diag");if(n)return r.unshift(e),n[t].apply(n,o1e([],i1e(r),!1))}var Ai;(function(t){t[t.NONE=0]="NONE",t[t.ERROR=30]="ERROR",t[t.WARN=50]="WARN",t[t.INFO=60]="INFO",t[t.DEBUG=70]="DEBUG",t[t.VERBOSE=80]="VERBOSE",t[t.ALL=9999]="ALL"})(Ai||(Ai={}));function a1e(t,e){t<Ai.NONE?t=Ai.NONE:t>Ai.ALL&&(t=Ai.ALL),e=e||{};function r(n,i){var o=e[n];return typeof o=="function"&&t>=i?o.bind(e):function(){}}return{error:r("error",Ai.ERROR),warn:r("warn",Ai.WARN),info:r("info",Ai.INFO),debug:r("debug",Ai.DEBUG),verbose:r("verbose",Ai.VERBOSE)}}var l1e=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o},c1e=function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))},u1e="diag",ks=(function(){function t(){function e(i){return function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];var a=_c("diag");if(a)return a[i].apply(a,c1e([],l1e(o),!1))}}var r=this,n=function(i,o){var s,a,l;if(o===void 0&&(o={logLevel:Ai.INFO}),i===r){var c=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return r.error((s=c.stack)!==null&&s!==void 0?s:c.message),!1}typeof o=="number"&&(o={logLevel:o});var u=_c("diag"),d=a1e((a=o.logLevel)!==null&&a!==void 0?a:Ai.INFO,i);if(u&&!o.suppressOverrideMessage){var p=(l=new Error().stack)!==null&&l!==void 0?l:"<failed to generate stacktrace>";u.warn("Current logger will be overwritten from "+p),d.warn("Current logger will overwrite one already registered from "+p)}return wg("diag",d,r,!0)};r.setLogger=n,r.disable=function(){Pg(u1e,r)},r.createComponentLogger=function(i){return new s1e(i)},r.verbose=e("verbose"),r.debug=e("debug"),r.info=e("info"),r.warn=e("warn"),r.error=e("error")}return t.instance=function(){return this._instance||(this._instance=new t),this._instance},t})(),d1e=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o},f1e=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},p1e=(function(){function t(e){this._entries=e?new Map(e):new Map}return t.prototype.getEntry=function(e){var r=this._entries.get(e);if(r)return Object.assign({},r)},t.prototype.getAllEntries=function(){return Array.from(this._entries.entries()).map(function(e){var r=d1e(e,2),n=r[0],i=r[1];return[n,i]})},t.prototype.setEntry=function(e,r){var n=new t(this._entries);return n._entries.set(e,r),n},t.prototype.removeEntry=function(e){var r=new t(this._entries);return r._entries.delete(e),r},t.prototype.removeEntries=function(){for(var e,r,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var o=new t(this._entries);try{for(var s=f1e(n),a=s.next();!a.done;a=s.next()){var l=a.value;o._entries.delete(l)}}catch(c){e={error:c}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(e)throw e.error}}return o},t.prototype.clear=function(){return new t},t})(),h1e=Symbol("BaggageEntryMetadata"),g1e=ks.instance();function m1e(t){return t===void 0&&(t={}),new p1e(new Map(Object.entries(t)))}function O1e(t){return typeof t!="string"&&(g1e.error("Cannot create baggage metadata from unknown type: "+typeof t),t=""),{__TYPE__:h1e,toString:function(){return t}}}function SE(t){return Symbol.for(t)}var y1e=(function(){function t(e){var r=this;r._currentContext=e?new Map(e):new Map,r.getValue=function(n){return r._currentContext.get(n)},r.setValue=function(n,i){var o=new t(r._currentContext);return o._currentContext.set(n,i),o},r.deleteValue=function(n){var i=new t(r._currentContext);return i._currentContext.delete(n),i}}return t})(),Uu=new y1e,Gc=(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),v1e=(function(){function t(){}return t.prototype.createGauge=function(e,r){return E1e},t.prototype.createHistogram=function(e,r){return A1e},t.prototype.createCounter=function(e,r){return T1e},t.prototype.createUpDownCounter=function(e,r){return I1e},t.prototype.createObservableGauge=function(e,r){return _1e},t.prototype.createObservableCounter=function(e,r){return R1e},t.prototype.createObservableUpDownCounter=function(e,r){return j1e},t.prototype.addBatchObservableCallback=function(e,r){},t.prototype.removeBatchObservableCallback=function(e){},t})(),yx=(function(){function t(){}return t})(),b1e=(function(t){Gc(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.add=function(r,n){},e})(yx),x1e=(function(t){Gc(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.add=function(r,n){},e})(yx),S1e=(function(t){Gc(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.record=function(r,n){},e})(yx),w1e=(function(t){Gc(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.record=function(r,n){},e})(yx),wE=(function(){function t(){}return t.prototype.addCallback=function(e){},t.prototype.removeCallback=function(e){},t})(),P1e=(function(t){Gc(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(wE),C1e=(function(t){Gc(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(wE),$1e=(function(t){Gc(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(wE),k1e=new v1e,T1e=new b1e,E1e=new S1e,A1e=new w1e,I1e=new x1e,R1e=new P1e,_1e=new C1e,j1e=new $1e,Q1e={get:function(t,e){if(t!=null)return t[e]},keys:function(t){return t==null?[]:Object.keys(t)}},D1e={set:function(t,e,r){t!=null&&(t[e]=r)}},N1e=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o},M1e=function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))},q1e=(function(){function t(){}return t.prototype.active=function(){return Uu},t.prototype.with=function(e,r,n){for(var i=[],o=3;o<arguments.length;o++)i[o-3]=arguments[o];return r.call.apply(r,M1e([n],N1e(i),!1))},t.prototype.bind=function(e,r){return r},t.prototype.enable=function(){return this},t.prototype.disable=function(){return this},t})(),z1e=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o},L1e=function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))},YS="context",V1e=new q1e,vx=(function(){function t(){}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalContextManager=function(e){return wg(YS,e,ks.instance())},t.prototype.active=function(){return this._getContextManager().active()},t.prototype.with=function(e,r,n){for(var i,o=[],s=3;s<arguments.length;s++)o[s-3]=arguments[s];return(i=this._getContextManager()).with.apply(i,L1e([e,r,n],z1e(o),!1))},t.prototype.bind=function(e,r){return this._getContextManager().bind(e,r)},t.prototype._getContextManager=function(){return _c(YS)||V1e},t.prototype.disable=function(){this._getContextManager().disable(),Pg(YS,ks.instance())},t})(),$a;(function(t){t[t.NONE=0]="NONE",t[t.SAMPLED=1]="SAMPLED"})($a||($a={}));var m6="0000000000000000",O6="00000000000000000000000000000000",y6={traceId:O6,spanId:m6,traceFlags:$a.NONE},qp=(function(){function t(e){e===void 0&&(e=y6),this._spanContext=e}return t.prototype.spanContext=function(){return this._spanContext},t.prototype.setAttribute=function(e,r){return this},t.prototype.setAttributes=function(e){return this},t.prototype.addEvent=function(e,r){return this},t.prototype.addLink=function(e){return this},t.prototype.addLinks=function(e){return this},t.prototype.setStatus=function(e){return this},t.prototype.updateName=function(e){return this},t.prototype.end=function(e){},t.prototype.isRecording=function(){return!1},t.prototype.recordException=function(e,r){},t})(),PE=SE("OpenTelemetry Context Key SPAN");function CE(t){return t.getValue(PE)||void 0}function X1e(){return CE(vx.getInstance().active())}function $E(t,e){return t.setValue(PE,e)}function W1e(t){return t.deleteValue(PE)}function U1e(t,e){return $E(t,new qp(e))}function v6(t){var e;return(e=CE(t))===null||e===void 0?void 0:e.spanContext()}var B1e=/^([0-9a-f]{32})$/i,F1e=/^[0-9a-f]{16}$/i;function b6(t){return B1e.test(t)&&t!==O6}function Z1e(t){return F1e.test(t)&&t!==m6}function bx(t){return b6(t.traceId)&&Z1e(t.spanId)}function Y1e(t){return new qp(t)}var GS=vx.getInstance(),x6=(function(){function t(){}return t.prototype.startSpan=function(e,r,n){n===void 0&&(n=GS.active());var i=!!r?.root;if(i)return new qp;var o=n&&v6(n);return G1e(o)&&bx(o)?new qp(o):new qp},t.prototype.startActiveSpan=function(e,r,n,i){var o,s,a;if(!(arguments.length<2)){arguments.length===2?a=r:arguments.length===3?(o=r,a=n):(o=r,s=n,a=i);var l=s??GS.active(),c=this.startSpan(e,o,l),u=$E(l,c);return GS.with(u,a,void 0,c)}},t})();function G1e(t){return typeof t=="object"&&typeof t.spanId=="string"&&typeof t.traceId=="string"&&typeof t.traceFlags=="number"}var H1e=new x6,J1e=(function(){function t(e,r,n,i){this._provider=e,this.name=r,this.version=n,this.options=i}return t.prototype.startSpan=function(e,r,n){return this._getTracer().startSpan(e,r,n)},t.prototype.startActiveSpan=function(e,r,n,i){var o=this._getTracer();return Reflect.apply(o.startActiveSpan,o,arguments)},t.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):H1e},t})(),K1e=(function(){function t(){}return t.prototype.getTracer=function(e,r,n){return new x6},t})(),eSe=new K1e,i5=(function(){function t(){}return t.prototype.getTracer=function(e,r,n){var i;return(i=this.getDelegateTracer(e,r,n))!==null&&i!==void 0?i:new J1e(this,e,r,n)},t.prototype.getDelegate=function(){var e;return(e=this._delegate)!==null&&e!==void 0?e:eSe},t.prototype.setDelegate=function(e){this._delegate=e},t.prototype.getDelegateTracer=function(e,r,n){var i;return(i=this._delegate)===null||i===void 0?void 0:i.getTracer(e,r,n)},t})(),fb;(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(fb||(fb={}));var VC;(function(t){t[t.INTERNAL=0]="INTERNAL",t[t.SERVER=1]="SERVER",t[t.CLIENT=2]="CLIENT",t[t.PRODUCER=3]="PRODUCER",t[t.CONSUMER=4]="CONSUMER"})(VC||(VC={}));exports.SpanStatusCode=void 0;(function(t){t[t.UNSET=0]="UNSET",t[t.OK=1]="OK",t[t.ERROR=2]="ERROR"})(exports.SpanStatusCode||(exports.SpanStatusCode={}));var ga=vx.getInstance(),Lt=ks.instance(),tSe=(function(){function t(){}return t.prototype.getMeter=function(e,r,n){return k1e},t})(),rSe=new tSe,HS="metrics",nSe=(function(){function t(){}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalMeterProvider=function(e){return wg(HS,e,ks.instance())},t.prototype.getMeterProvider=function(){return _c(HS)||rSe},t.prototype.getMeter=function(e,r,n){return this.getMeterProvider().getMeter(e,r,n)},t.prototype.disable=function(){Pg(HS,ks.instance())},t})(),S6=nSe.getInstance(),iSe=(function(){function t(){}return t.prototype.inject=function(e,r){},t.prototype.extract=function(e,r){return e},t.prototype.fields=function(){return[]},t})(),kE=SE("OpenTelemetry Baggage Key");function w6(t){return t.getValue(kE)||void 0}function oSe(){return w6(vx.getInstance().active())}function sSe(t,e){return t.setValue(kE,e)}function aSe(t){return t.deleteValue(kE)}var JS="propagation",lSe=new iSe,cSe=(function(){function t(){this.createBaggage=m1e,this.getBaggage=w6,this.getActiveBaggage=oSe,this.setBaggage=sSe,this.deleteBaggage=aSe}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalPropagator=function(e){return wg(JS,e,ks.instance())},t.prototype.inject=function(e,r,n){return n===void 0&&(n=D1e),this._getGlobalPropagator().inject(e,r,n)},t.prototype.extract=function(e,r,n){return n===void 0&&(n=Q1e),this._getGlobalPropagator().extract(e,r,n)},t.prototype.fields=function(){return this._getGlobalPropagator().fields()},t.prototype.disable=function(){Pg(JS,ks.instance())},t.prototype._getGlobalPropagator=function(){return _c(JS)||lSe},t})(),zp=cSe.getInstance(),KS="trace",uSe=(function(){function t(){this._proxyTracerProvider=new i5,this.wrapSpanContext=Y1e,this.isSpanContextValid=bx,this.deleteSpan=W1e,this.getSpan=CE,this.getActiveSpan=X1e,this.getSpanContext=v6,this.setSpan=$E,this.setSpanContext=U1e}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalTracerProvider=function(e){var r=wg(KS,this._proxyTracerProvider,ks.instance());return r&&this._proxyTracerProvider.setDelegate(e),r},t.prototype.getTracerProvider=function(){return _c(KS)||this._proxyTracerProvider},t.prototype.getTracer=function(e,r){return this.getTracerProvider().getTracer(e,r)},t.prototype.disable=function(){Pg(KS,ks.instance()),this._proxyTracerProvider=new i5},t})(),ci=uSe.getInstance();const P6=SE("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function dSe(t){return t.setValue(P6,!0)}function TE(t){return t.getValue(P6)===!0}const fSe="=",XC=";",WC=",",ew="baggage",pSe=180,hSe=4096,gSe=8192;function mSe(t){return t.reduce((e,r)=>{const n=`${e}${e!==""?WC:""}${r}`;return n.length>gSe?e:n},"")}function OSe(t){return t.getAllEntries().map(([e,r])=>{let n=`${encodeURIComponent(e)}=${encodeURIComponent(r.value)}`;return r.metadata!==void 0&&(n+=XC+r.metadata.toString()),n})}function ySe(t){const e=t.split(XC);if(e.length<=0)return;const r=e.shift();if(!r)return;const n=r.indexOf(fSe);if(n<=0)return;const i=decodeURIComponent(r.substring(0,n).trim()),o=decodeURIComponent(r.substring(n+1).trim());let s;return e.length>0&&(s=O1e(e.join(XC))),{key:i,value:o,metadata:s}}class vSe{inject(e,r,n){const i=zp.getBaggage(e);if(!i||TE(e))return;const o=OSe(i).filter(a=>a.length<=hSe).slice(0,pSe),s=mSe(o);s.length>0&&n.set(r,ew,s)}extract(e,r,n){const i=n.get(r,ew),o=Array.isArray(i)?i.join(WC):i;if(!o)return e;const s={};return o.length===0||(o.split(WC).forEach(l=>{const c=ySe(l);if(c){const u={value:c.value};c.metadata&&(u.metadata=c.metadata),s[c.key]=u}}),Object.entries(s).length===0)?e:zp.setBaggage(e,zp.createBaggage(s))}fields(){return[ew]}}function Ay(t){const e={};if(typeof t!="object"||t==null)return e;for(const[r,n]of Object.entries(t)){if(!bSe(r)){Lt.warn(`Invalid attribute key: ${r}`);continue}if(!C6(n)){Lt.warn(`Invalid attribute value set for key: ${r}`);continue}Array.isArray(n)?e[r]=n.slice():e[r]=n}return e}function bSe(t){return typeof t=="string"&&t.length>0}function C6(t){return t==null?!0:Array.isArray(t)?xSe(t):$6(t)}function xSe(t){let e;for(const r of t)if(r!=null){if(!e){if($6(r)){e=typeof r;continue}return!1}if(typeof r!==e)return!1}return!0}function $6(t){switch(typeof t){case"number":case"boolean":case"string":return!0}return!1}function SSe(){return t=>{Lt.error(wSe(t))}}function wSe(t){return typeof t=="string"?t:JSON.stringify(PSe(t))}function PSe(t){const e={};let r=t;for(;r!==null;)Object.getOwnPropertyNames(r).forEach(n=>{if(e[n])return;const i=r[n];i&&(e[n]=String(i))}),r=Object.getPrototypeOf(r);return e}let CSe=SSe();function Dd(t){try{CSe(t)}catch{}}const fd=performance,$Se="2.0.1",tw="exception.message",kSe="exception.stacktrace",rw="exception.type",TSe="service.name",UC="telemetry.sdk.language",ESe="webjs",BC="telemetry.sdk.name",FC="telemetry.sdk.version",ASe="process.runtime.name",nw={[BC]:"opentelemetry",[ASe]:"browser",[UC]:ESe,[FC]:$Se};const ISe=9,RSe=6,_Se=Math.pow(10,RSe),pb=Math.pow(10,ISe);function td(t){const e=t/1e3,r=Math.trunc(e),n=Math.round(t%1e3*_Se);return[r,n]}function k6(){let t=fd.timeOrigin;if(typeof t!="number"){const e=fd;t=e.timing&&e.timing.fetchStart}return t}function jSe(t){const e=td(k6()),r=td(typeof t=="number"?t:fd.now());return E6(e,r)}function QSe(t,e){let r=e[0]-t[0],n=e[1]-t[1];return n<0&&(r-=1,n+=pb),[r,n]}function DSe(t){return t[0]*pb+t[1]}function T6(t){return Array.isArray(t)&&t.length===2&&typeof t[0]=="number"&&typeof t[1]=="number"}function o5(t){return T6(t)||typeof t=="number"||t instanceof Date}function E6(t,e){const r=[t[0]+e[0],t[1]+e[1]];return r[1]>=pb&&(r[1]-=pb,r[0]+=1),r}var cs;(function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"})(cs||(cs={}));class NSe{_propagators;_fields;constructor(e={}){this._propagators=e.propagators??[],this._fields=Array.from(new Set(this._propagators.map(r=>typeof r.fields=="function"?r.fields():[]).reduce((r,n)=>r.concat(n),[])))}inject(e,r,n){for(const i of this._propagators)try{i.inject(e,r,n)}catch(o){Lt.warn(`Failed to inject with ${i.constructor.name}. Err: ${o.message}`)}}extract(e,r,n){return this._propagators.reduce((i,o)=>{try{return o.extract(i,r,n)}catch(s){Lt.warn(`Failed to extract with ${o.constructor.name}. Err: ${s.message}`)}return i},e)}fields(){return this._fields.slice()}}const ZC="[_0-9a-z-*/]",MSe=`[a-z]${ZC}{0,255}`,qSe=`[a-z0-9]${ZC}{0,240}@[a-z]${ZC}{0,13}`,zSe=new RegExp(`^(?:${MSe}|${qSe})$`),LSe=/^[ -~]{0,255}[!-~]$/,VSe=/,|=/;function XSe(t){return zSe.test(t)}function WSe(t){return LSe.test(t)&&!VSe.test(t)}const s5=32,USe=512,a5=",",l5="=";class EE{_internalState=new Map;constructor(e){e&&this._parse(e)}set(e,r){const n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,r),n}unset(e){const r=this._clone();return r._internalState.delete(e),r}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,r)=>(e.push(r+l5+this.get(r)),e),[]).join(a5)}_parse(e){e.length>USe||(this._internalState=e.split(a5).reverse().reduce((r,n)=>{const i=n.trim(),o=i.indexOf(l5);if(o!==-1){const s=i.slice(0,o),a=i.slice(o+1,n.length);XSe(s)&&WSe(a)&&r.set(s,a)}return r},new Map),this._internalState.size>s5&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,s5))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){const e=new EE;return e._internalState=new Map(this._internalState),e}}const iw="traceparent",ow="tracestate",BSe="00",FSe="(?!ff)[\\da-f]{2}",ZSe="(?![0]{32})[\\da-f]{32}",YSe="(?![0]{16})[\\da-f]{16}",GSe="[\\da-f]{2}",HSe=new RegExp(`^\\s?(${FSe})-(${ZSe})-(${YSe})-(${GSe})(-.*)?\\s?$`);function JSe(t){const e=HSe.exec(t);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}class KSe{inject(e,r,n){const i=ci.getSpanContext(e);if(!i||TE(e)||!bx(i))return;const o=`${BSe}-${i.traceId}-${i.spanId}-0${Number(i.traceFlags||$a.NONE).toString(16)}`;n.set(r,iw,o),i.traceState&&n.set(r,ow,i.traceState.serialize())}extract(e,r,n){const i=n.get(r,iw);if(!i)return e;const o=Array.isArray(i)?i[0]:i;if(typeof o!="string")return e;const s=JSe(o);if(!s)return e;s.isRemote=!0;const a=n.get(r,ow);if(a){const l=Array.isArray(a)?a.join(","):a;s.traceState=new EE(typeof l=="string"?l:void 0)}return ci.setSpanContext(e,s)}fields(){return[iw,ow]}}const ewe="[object Object]",twe="[object Null]",rwe="[object Undefined]",nwe=Function.prototype,A6=nwe.toString,iwe=A6.call(Object),owe=Object.getPrototypeOf,I6=Object.prototype,R6=I6.hasOwnProperty,fc=Symbol?Symbol.toStringTag:void 0,_6=I6.toString;function c5(t){if(!swe(t)||awe(t)!==ewe)return!1;const e=owe(t);if(e===null)return!0;const r=R6.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&A6.call(r)===iwe}function swe(t){return t!=null&&typeof t=="object"}function awe(t){return t==null?t===void 0?rwe:twe:fc&&fc in Object(t)?lwe(t):cwe(t)}function lwe(t){const e=R6.call(t,fc),r=t[fc];let n=!1;try{t[fc]=void 0,n=!0}catch{}const i=_6.call(t);return n&&(e?t[fc]=r:delete t[fc]),i}function cwe(t){return _6.call(t)}const uwe=20;function dwe(...t){let e=t.shift();const r=new WeakMap;for(;t.length>0;)e=j6(e,t.shift(),0,r);return e}function sw(t){return hb(t)?t.slice():t}function j6(t,e,r=0,n){let i;if(!(r>uwe)){if(r++,Iy(t)||Iy(e)||Q6(e))i=sw(e);else if(hb(t)){if(i=t.slice(),hb(e))for(let o=0,s=e.length;o<s;o++)i.push(sw(e[o]));else if(Hf(e)){const o=Object.keys(e);for(let s=0,a=o.length;s<a;s++){const l=o[s];i[l]=sw(e[l])}}}else if(Hf(t))if(Hf(e)){if(!fwe(t,e))return e;i=Object.assign({},t);const o=Object.keys(e);for(let s=0,a=o.length;s<a;s++){const l=o[s],c=e[l];if(Iy(c))typeof c>"u"?delete i[l]:i[l]=c;else{const u=i[l],d=c;if(u5(t,l,n)||u5(e,l,n))delete i[l];else{if(Hf(u)&&Hf(d)){const p=n.get(u)||[],h=n.get(d)||[];p.push({obj:t,key:l}),h.push({obj:e,key:l}),n.set(u,p),n.set(d,h)}i[l]=j6(i[l],c,r,n)}}}}else i=e;return i}}function u5(t,e,r){const n=r.get(t[e])||[];for(let i=0,o=n.length;i<o;i++){const s=n[i];if(s.key===e&&s.obj===t)return!0}return!1}function hb(t){return Array.isArray(t)}function Q6(t){return typeof t=="function"}function Hf(t){return!Iy(t)&&!hb(t)&&!Q6(t)&&typeof t=="object"}function Iy(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t>"u"||t instanceof Date||t instanceof RegExp||t===null}function fwe(t,e){return!(!c5(t)||!c5(e))}class pwe{_promise;_resolve;_reject;constructor(){this._promise=new Promise((e,r)=>{this._resolve=e,this._reject=r})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}class hwe{_callback;_that;_isCalled=!1;_deferred=new pwe;constructor(e,r){this._callback=e,this._that=r}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(r=>this._deferred.resolve(r),r=>this._deferred.reject(r))}catch(r){this._deferred.reject(r)}}return this._deferred.promise}}function gwe(){return"unknown_service"}const bp=t=>t!==null&&typeof t=="object"&&typeof t.then=="function";class gb{_rawAttributes;_asyncAttributesPending=!1;_memoizedAttributes;static FromAttributeList(e){const r=new gb({});return r._rawAttributes=d5(e),r._asyncAttributesPending=e.filter(([n,i])=>bp(i)).length>0,r}constructor(e){const r=e.attributes??{};this._rawAttributes=Object.entries(r).map(([n,i])=>(bp(i)&&(this._asyncAttributesPending=!0),[n,i])),this._rawAttributes=d5(this._rawAttributes)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let e=0;e<this._rawAttributes.length;e++){const[r,n]=this._rawAttributes[e];this._rawAttributes[e]=[r,bp(n)?await n:n]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&Lt.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;const e={};for(const[r,n]of this._rawAttributes){if(bp(n)){Lt.debug(`Unsettled resource attribute ${r} skipped`);continue}n!=null&&(e[r]??=n)}return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}merge(e){return e==null?this:gb.FromAttributeList([...e.getRawAttributes(),...this.getRawAttributes()])}}function D6(t){return gb.FromAttributeList(Object.entries(t))}function mwe(){return D6({[TSe]:gwe(),[UC]:nw[UC],[BC]:nw[BC],[FC]:nw[FC]})}function d5(t){return t.map(([e,r])=>bp(r)?[e,r.catch(n=>{Lt.debug("promise rejection for resource attribute: %s - %s",e,n)})]:[e,r])}const Owe="exception";class ywe{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;name;status={code:exports.SpanStatusCode.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(e){const r=Date.now();this._spanContext=e.spanContext,this._performanceStartTime=fd.now(),this._performanceOffset=r-(this._performanceStartTime+k6()),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??r),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,r){if(r==null||this._isSpanEnded())return this;if(e.length===0)return Lt.warn(`Invalid attribute key: ${e}`),this;if(!C6(r))return Lt.warn(`Invalid attribute value set for key: ${e}`),this;const{attributeCountLimit:n}=this._spanLimits;return n!==void 0&&Object.keys(this.attributes).length>=n&&!Object.prototype.hasOwnProperty.call(this.attributes,e)?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(r),this)}setAttributes(e){for(const[r,n]of Object.entries(e))this.setAttribute(r,n);return this}addEvent(e,r,n){if(this._isSpanEnded())return this;const{eventCountLimit:i}=this._spanLimits;if(i===0)return Lt.warn("No events allowed."),this._droppedEventsCount++,this;i!==void 0&&this.events.length>=i&&(this._droppedEventsCount===0&&Lt.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),o5(r)&&(o5(n)||(n=r),r=void 0);const o=Ay(r);return this.events.push({name:e,attributes:o,time:this._getTime(n),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"&&(Lt.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()){Lt.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=QSe(this.startTime,this.endTime),this._duration[0]<0&&(Lt.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&&Lt.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._spanProcessor.onEnd(this)}_getTime(e){if(typeof e=="number"&&e<=fd.now())return jSe(e+this._performanceOffset);if(typeof e=="number")return td(e);if(e instanceof Date)return td(e.getTime());if(T6(e))return e;if(this._startTimeProvided)return td(Date.now());const r=fd.now()-this._performanceStartTime;return E6(this.startTime,td(r))}isRecording(){return this._ended===!1}recordException(e,r){const n={};typeof e=="string"?n[tw]=e:e&&(e.code?n[rw]=e.code.toString():e.name&&(n[rw]=e.name),e.message&&(n[tw]=e.message),e.stack&&(n[kSe]=e.stack)),n[rw]||n[tw]?this.addEvent(Owe,n,r):Lt.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}}`);Lt.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,e)}return this._ended}_truncateToLimitUtil(e,r){return e.length<=r?e:e.substring(0,r)}_truncateToSize(e){const r=this._attributeValueLengthLimit;return r<=0?(Lt.warn(`Attribute value limit must be positive, got ${r}`),e):typeof e=="string"?this._truncateToLimitUtil(e,r):Array.isArray(e)?e.map(n=>typeof n=="string"?this._truncateToLimitUtil(n,r):n):e}}var Nd;(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(Nd||(Nd={}));class mb{shouldSample(){return{decision:Nd.NOT_RECORD}}toString(){return"AlwaysOffSampler"}}class pd{shouldSample(){return{decision:Nd.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}}class bO{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(e){this._root=e.root,this._root||(Dd(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new pd),this._remoteParentSampled=e.remoteParentSampled??new pd,this._remoteParentNotSampled=e.remoteParentNotSampled??new mb,this._localParentSampled=e.localParentSampled??new pd,this._localParentNotSampled=e.localParentNotSampled??new mb}shouldSample(e,r,n,i,o,s){const a=ci.getSpanContext(e);return!a||!bx(a)?this._root.shouldSample(e,r,n,i,o,s):a.isRemote?a.traceFlags&$a.SAMPLED?this._remoteParentSampled.shouldSample(e,r,n,i,o,s):this._remoteParentNotSampled.shouldSample(e,r,n,i,o,s):a.traceFlags&$a.SAMPLED?this._localParentSampled.shouldSample(e,r,n,i,o,s):this._localParentNotSampled.shouldSample(e,r,n,i,o,s)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}class f5{_ratio;_upperBound;constructor(e=0){this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,r){return{decision:b6(r)&&this._accumulate(r)<this._upperBound?Nd.RECORD_AND_SAMPLED:Nd.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 r=0;for(let n=0;n<e.length/8;n++){const i=n*8,o=parseInt(e.slice(i,i+8),16);r=(r^o)>>>0}return r}}const p5=1;function N6(){return{sampler:M6(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},spanLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128,linkCountLimit:128,eventCountLimit:128,attributePerEventCountLimit:128,attributePerLinkCountLimit:128}}}function M6(){const t="parentbased_always_on";switch(t){case"always_on":return new pd;case"always_off":return new mb;case"parentbased_always_on":return new bO({root:new pd});case"parentbased_always_off":return new bO({root:new mb});case"traceidratio":return new f5(h5());case"parentbased_traceidratio":return new bO({root:new f5(h5())});default:return Lt.error(`OTEL_TRACES_SAMPLER value "${t}" invalid, defaulting to "parentbased_always_on".`),new bO({root:new pd})}}function h5(){return Lt.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${p5}.`),p5}const vwe=128,bwe=1/0;function xwe(t){const e={sampler:M6()},r=N6(),n=Object.assign({},r,e,t);return n.generalLimits=Object.assign({},r.generalLimits,t.generalLimits||{}),n.spanLimits=Object.assign({},r.spanLimits,t.spanLimits||{}),n}function Swe(t){const e=Object.assign({},t.spanLimits);return e.attributeCountLimit=t.spanLimits?.attributeCountLimit??t.generalLimits?.attributeCountLimit??void 0??void 0??vwe,e.attributeValueLengthLimit=t.spanLimits?.attributeValueLengthLimit??t.generalLimits?.attributeValueLengthLimit??void 0??void 0??bwe,Object.assign({},t,{spanLimits:e})}class wwe{_exporter;_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_isExporting=!1;_finishedSpans=[];_timer;_shutdownOnce;_droppedSpansCount=0;constructor(e,r){this._exporter=e,this._maxExportBatchSize=typeof r?.maxExportBatchSize=="number"?r.maxExportBatchSize:512,this._maxQueueSize=typeof r?.maxQueueSize=="number"?r.maxQueueSize:2048,this._scheduledDelayMillis=typeof r?.scheduledDelayMillis=="number"?r.scheduledDelayMillis:5e3,this._exportTimeoutMillis=typeof r?.exportTimeoutMillis=="number"?r.exportTimeoutMillis:3e4,this._shutdownOnce=new hwe(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(Lt.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,r){}onEnd(e){this._shutdownOnce.isCalled||(e.spanContext().traceFlags&$a.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&&Lt.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(Lt.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,r)=>{const n=[],i=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let o=0,s=i;o<s;o++)n.push(this._flushOneBatch());Promise.all(n).then(()=>{e()}).catch(r)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((e,r)=>{const n=setTimeout(()=>{r(new Error("Timeout"))},this._exportTimeoutMillis);ga.with(dSe(ga.active()),()=>{let i;this._finishedSpans.length<=this._maxExportBatchSize?(i=this._finishedSpans,this._finishedSpans=[]):i=this._finishedSpans.splice(0,this._maxExportBatchSize);const o=()=>this._exporter.export(i,a=>{clearTimeout(n),a.code===cs.SUCCESS?e():r(a.error??new Error("BatchSpanProcessor: span export failed"))});let s=null;for(let a=0,l=i.length;a<l;a++){const c=i[a];c.resource.asyncAttributesPending&&c.resource.waitForAsyncAttributes&&(s??=[],s.push(c.resource.waitForAsyncAttributes()))}s===null?o():Promise.all(s).then(o,a=>{Dd(a),r(a)})})})}_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(r=>{this._isExporting=!1,Dd(r)})};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 Pwe extends wwe{_visibilityChangeListener;_pageHideListener;constructor(e,r){super(e,r),this.onInit(r)}onInit(e){e?.disableAutoFlushOnDocumentHide!==!0&&typeof document<"u"&&(this._visibilityChangeListener=()=>{document.visibilityState==="hidden"&&this.forceFlush().catch(r=>{Dd(r)})},this._pageHideListener=()=>{this.forceFlush().catch(r=>{Dd(r)})},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 Cwe=8,$we=16;class kwe{generateTraceId=g5($we);generateSpanId=g5(Cwe)}const xO=Array(32);function g5(t){return function(){for(let r=0;r<t*2;r++)xO[r]=Math.floor(Math.random()*16)+48,xO[r]>=58&&(xO[r]+=39);return String.fromCharCode.apply(null,xO.slice(0,t*2))}}class Twe{_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;constructor(e,r,n,i){const o=xwe(r);this._sampler=o.sampler,this._generalLimits=o.generalLimits,this._spanLimits=o.spanLimits,this._idGenerator=r.idGenerator||new kwe,this._resource=n,this._spanProcessor=i,this.instrumentationScope=e}startSpan(e,r={},n=ga.active()){r.root&&(n=ci.deleteSpan(n));const i=ci.getSpan(n);if(TE(n))return Lt.debug("Instrumentation suppressed, returning Noop Span"),ci.wrapSpanContext(y6);const o=i?.spanContext(),s=this._idGenerator.generateSpanId();let a,l,c;!o||!ci.isSpanContextValid(o)?l=this._idGenerator.generateTraceId():(l=o.traceId,c=o.traceState,a=o);const u=r.kind??VC.INTERNAL,d=(r.links??[]).map(v=>({context:v.context,attributes:Ay(v.attributes)})),p=Ay(r.attributes),h=this._sampler.shouldSample(n,l,e,u,p,d);c=h.traceState??c;const m=h.decision===fb.RECORD_AND_SAMPLED?$a.SAMPLED:$a.NONE,g={traceId:l,spanId:s,traceFlags:m,traceState:c};if(h.decision===fb.NOT_RECORD)return Lt.debug("Recording is off, propagating context in a non-recording span"),ci.wrapSpanContext(g);const O=Ay(Object.assign(p,h.attributes));return new ywe({resource:this._resource,scope:this.instrumentationScope,context:n,spanContext:g,name:e,kind:u,links:d,parentSpanContext:a,attributes:O,startTime:r.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits})}startActiveSpan(e,r,n,i){let o,s,a;if(arguments.length<2)return;arguments.length===2?a=r:arguments.length===3?(o=r,a=n):(o=r,s=n,a=i);const l=s??ga.active(),c=this.startSpan(e,o,l),u=ci.setSpan(l,c);return ga.with(u,a,void 0,c)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}}class Ewe{_spanProcessors;constructor(e){this._spanProcessors=e}forceFlush(){const e=[];for(const r of this._spanProcessors)e.push(r.forceFlush());return new Promise(r=>{Promise.all(e).then(()=>{r()}).catch(n=>{Dd(n||new Error("MultiSpanProcessor: forceFlush failed")),r()})})}onStart(e,r){for(const n of this._spanProcessors)n.onStart(e,r)}onEnd(e){for(const r of this._spanProcessors)r.onEnd(e)}shutdown(){const e=[];for(const r of this._spanProcessors)e.push(r.shutdown());return new Promise((r,n)=>{Promise.all(e).then(()=>{r()},n)})}}var pc;(function(t){t[t.resolved=0]="resolved",t[t.timeout=1]="timeout",t[t.error=2]="error",t[t.unresolved=3]="unresolved"})(pc||(pc={}));class Awe{_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(e={}){const r=dwe({},N6(),Swe(e));this._resource=r.resource??mwe(),this._config=Object.assign({},r,{resource:this._resource});const n=[];e.spanProcessors?.length&&n.push(...e.spanProcessors),this._activeSpanProcessor=new Ewe(n)}getTracer(e,r,n){const i=`${e}@${r||""}:${n?.schemaUrl||""}`;return this._tracers.has(i)||this._tracers.set(i,new Twe({name:e,version:r,schemaUrl:n?.schemaUrl},this._config,this._resource,this._activeSpanProcessor)),this._tracers.get(i)}forceFlush(){const e=this._config.forceFlushTimeoutMillis,r=this._activeSpanProcessor._spanProcessors.map(n=>new Promise(i=>{let o;const s=setTimeout(()=>{i(new Error(`Span processor did not completed within timeout period of ${e} ms`)),o=pc.timeout},e);n.forceFlush().then(()=>{clearTimeout(s),o!==pc.timeout&&(o=pc.resolved,i(o))}).catch(a=>{clearTimeout(s),o=pc.error,i(a)})}));return new Promise((n,i)=>{Promise.all(r).then(o=>{const s=o.filter(a=>a!==pc.resolved);s.length>0?i(s):n()}).catch(o=>i([o]))})}shutdown(){return this._activeSpanProcessor.shutdown()}}class Iwe{_enabled=!1;_currentContext=Uu;_bindFunction(e=Uu,r){const n=this,i=function(...o){return n.with(e,()=>r.apply(this,o))};return Object.defineProperty(i,"length",{enumerable:!1,configurable:!0,writable:!1,value:r.length}),i}active(){return this._currentContext}bind(e,r){return e===void 0&&(e=this.active()),typeof r=="function"?this._bindFunction(e,r):r}disable(){return this._currentContext=Uu,this._enabled=!1,this}enable(){return this._enabled?this:(this._enabled=!0,this._currentContext=Uu,this)}with(e,r,n,...i){const o=this._currentContext;this._currentContext=e||Uu;try{return r.call(n,...i)}finally{this._currentContext=o}}}function Rwe(t){if(t!==null){if(t===void 0){const e=new Iwe;e.enable(),ga.setGlobalContextManager(e);return}t.enable(),ga.setGlobalContextManager(t)}}function _we(t){if(t!==null){if(t===void 0){zp.setGlobalPropagator(new NSe({propagators:[new KSe,new vSe]}));return}zp.setGlobalPropagator(t)}}class jwe extends Awe{constructor(e={}){super(e)}register(e={}){ci.setGlobalTracerProvider(this),_we(e.propagator),Rwe(e.contextManager)}}class Qwe{_delegate;constructor(e){this._delegate=e}export(e,r){this._delegate.export(e,r)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}}class m5 extends Error{code;name="OTLPExporterError";data;constructor(e,r,n){super(e),this.data=n,this.code=r}}function Dwe(t){if(Number.isFinite(t)&&t>0)return t;throw new Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${t}')`)}function Nwe(t){if(t!=null)return()=>t}function Mwe(t,e,r){return{timeoutMillis:Dwe(t.timeoutMillis??e.timeoutMillis??r.timeoutMillis),concurrencyLimit:t.concurrencyLimit??e.concurrencyLimit??r.concurrencyLimit,compression:t.compression??e.compression??r.compression}}function qwe(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:"none"}}class zwe{_concurrencyLimit;_sendingPromises=[];constructor(e){this._concurrencyLimit=e}pushPromise(e){if(this.hasReachedLimit())throw new Error("Concurrency Limit reached");this._sendingPromises.push(e);const r=()=>{const n=this._sendingPromises.indexOf(e);this._sendingPromises.splice(n,1)};e.then(r,r)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}async awaitAll(){await Promise.all(this._sendingPromises)}}function Lwe(t){return new zwe(t.concurrencyLimit)}function Vwe(t){return Object.prototype.hasOwnProperty.call(t,"partialSuccess")}function Xwe(){return{handleResponse(t){t==null||!Vwe(t)||t.partialSuccess==null||Object.keys(t.partialSuccess).length===0||Lt.warn("Received Partial Success response:",JSON.stringify(t.partialSuccess))}}}class Wwe{_transport;_serializer;_responseHandler;_promiseQueue;_timeout;_diagLogger;constructor(e,r,n,i,o){this._transport=e,this._serializer=r,this._responseHandler=n,this._promiseQueue=i,this._timeout=o,this._diagLogger=Lt.createComponentLogger({namespace:"OTLPExportDelegate"})}export(e,r){if(this._diagLogger.debug("items to be sent",e),this._promiseQueue.hasReachedLimit()){r({code:cs.FAILED,error:new Error("Concurrent export limit reached")});return}const n=this._serializer.serializeRequest(e);if(n==null){r({code:cs.FAILED,error:new Error("Nothing to send")});return}this._promiseQueue.pushPromise(this._transport.send(n,this._timeout).then(i=>{if(i.status==="success"){if(i.data!=null)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(i.data))}catch(o){this._diagLogger.warn("Export succeeded but could not deserialize response - is the response specification compliant?",o,i.data)}r({code:cs.SUCCESS});return}else if(i.status==="failure"&&i.error){r({code:cs.FAILED,error:i.error});return}else i.status==="retryable"?r({code:cs.FAILED,error:new m5("Export failed with retryable status")}):r({code:cs.FAILED,error:new m5("Export failed with unknown error")})},i=>r({code:cs.FAILED,error:i})))}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug("shutdown started"),await this.forceFlush(),this._transport.shutdown()}}function Uwe(t,e){return new Wwe(t.transport,t.serializer,Xwe(),t.promiseHandler,e.timeout)}function q6(t,e,r){return Uwe({transport:r,serializer:e,promiseHandler:Lwe(t)},{timeout:t.timeoutMillis})}function O5(t){return t>=48&&t<=57?t-48:t>=97&&t<=102?t-87:t-55}function z6(t){const e=new Uint8Array(t.length/2);let r=0;for(let n=0;n<t.length;n+=2){const i=O5(t.charCodeAt(n)),o=O5(t.charCodeAt(n+1));e[r++]=i<<4|o}return e}function L6(t){const e=BigInt(1e9);return BigInt(t[0])*e+BigInt(t[1])}function Bwe(t){const e=Number(BigInt.asUintN(32,t)),r=Number(BigInt.asUintN(32,t>>BigInt(32)));return{low:e,high:r}}function Fwe(t){const e=L6(t);return Bwe(e)}function Zwe(t){return L6(t).toString()}const Ywe=typeof BigInt<"u"?Zwe:DSe;function y5(t){return t}function Gwe(t){if(t!==void 0)return z6(t)}const Hwe={encodeHrTime:Fwe,encodeSpanContext:z6,encodeOptionalSpanContext:Gwe};function Jwe(t){return t===void 0?Hwe:{encodeHrTime:Ywe,encodeSpanContext:y5,encodeOptionalSpanContext:y5}}function Kwe(t){return{attributes:xx(t.attributes),droppedAttributesCount:0}}function ePe(t){return{name:t.name,version:t.version}}function xx(t){return Object.keys(t).map(e=>V6(e,t[e]))}function V6(t,e){return{key:t,value:X6(e)}}function X6(t){const e=typeof t;return e==="string"?{stringValue:t}:e==="number"?Number.isInteger(t)?{intValue:t}:{doubleValue:t}:e==="boolean"?{boolValue:t}:t instanceof Uint8Array?{bytesValue:t}:Array.isArray(t)?{arrayValue:{values:t.map(X6)}}:e==="object"&&t!=null?{kvlistValue:{values:Object.entries(t).map(([r,n])=>V6(r,n))}}:{}}function tPe(t,e){const r=t.spanContext(),n=t.status,i=t.parentSpanContext?.spanId?e.encodeSpanContext(t.parentSpanContext?.spanId):void 0;return{traceId:e.encodeSpanContext(r.traceId),spanId:e.encodeSpanContext(r.spanId),parentSpanId:i,traceState:r.traceState?.serialize(),name:t.name,kind:t.kind==null?0:t.kind+1,startTimeUnixNano:e.encodeHrTime(t.startTime),endTimeUnixNano:e.encodeHrTime(t.endTime),attributes:xx(t.attributes),droppedAttributesCount:t.droppedAttributesCount,events:t.events.map(o=>nPe(o,e)),droppedEventsCount:t.droppedEventsCount,status:{code:n.code,message:n.message},links:t.links.map(o=>rPe(o,e)),droppedLinksCount:t.droppedLinksCount}}function rPe(t,e){return{attributes:t.attributes?xx(t.attributes):[],spanId:e.encodeSpanContext(t.context.spanId),traceId:e.encodeSpanContext(t.context.traceId),traceState:t.context.traceState?.serialize(),droppedAttributesCount:t.droppedAttributesCount||0}}function nPe(t,e){return{attributes:t.attributes?xx(t.attributes):[],name:t.name,timeUnixNano:e.encodeHrTime(t.time),droppedAttributesCount:t.droppedAttributesCount||0}}function iPe(t,e){const r=Jwe(e);return{resourceSpans:sPe(t,r)}}function oPe(t){const e=new Map;for(const r of t){let n=e.get(r.resource);n||(n=new Map,e.set(r.resource,n));const i=`${r.instrumentationScope.name}@${r.instrumentationScope.version||""}:${r.instrumentationScope.schemaUrl||""}`;let o=n.get(i);o||(o=[],n.set(i,o)),o.push(r)}return e}function sPe(t,e){const r=oPe(t),n=[],i=r.entries();let o=i.next();for(;!o.done;){const[s,a]=o.value,l=[],c=a.values();let u=c.next();for(;!u.done;){const p=u.value;if(p.length>0){const h=p.map(m=>tPe(m,e));l.push({scope:ePe(p[0].instrumentationScope),spans:h,schemaUrl:p[0].instrumentationScope.schemaUrl})}u=c.next()}const d={resource:Kwe(s),scopeSpans:l,schemaUrl:void 0};n.push(d),o=i.next()}return n}const aPe={serializeRequest:t=>{const e=iPe(t,{});return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:t=>{if(t.length===0)return{};const e=new TextDecoder;return JSON.parse(e.decode(t))}},lPe=5,cPe=1e3,uPe=5e3,dPe=1.5,v5=.2;function fPe(){return Math.random()*(2*v5)-v5}class pPe{_transport;constructor(e){this._transport=e}retry(e,r,n){return new Promise((i,o)=>{setTimeout(()=>{this._transport.send(e,r).then(i,o)},n)})}async send(e,r){const n=Date.now()+r;let i=await this._transport.send(e,r),o=lPe,s=cPe;for(;i.status==="retryable"&&o>0;){o--;const a=Math.max(Math.min(s,uPe)+fPe(),0);s=s*dPe;const l=i.retryInMillis??a,c=n-Date.now();if(l>c)return i;i=await this.retry(e,c,l)}return i}shutdown(){return this._transport.shutdown()}}function W6(t){return new pPe(t.transport)}function hPe(t){return[429,502,503,504].includes(t)}function gPe(t){if(t==null)return;const e=Number.parseInt(t,10);if(Number.isInteger(e))return e>0?e*1e3:-1;const r=new Date(t).getTime()-Date.now();return r>=0?r:0}class mPe{_parameters;constructor(e){this._parameters=e}send(e,r){return new Promise(n=>{const i=new XMLHttpRequest;i.timeout=r,i.open("POST",this._parameters.url);const o=this._parameters.headers();Object.entries(o).forEach(([s,a])=>{i.setRequestHeader(s,a)}),i.ontimeout=s=>{n({status:"failure",error:new Error("XHR request timed out")})},i.onreadystatechange=()=>{i.status>=200&&i.status<=299?(Lt.debug("XHR success"),n({status:"success"})):i.status&&hPe(i.status)?n({status:"retryable",retryInMillis:gPe(i.getResponseHeader("Retry-After"))}):i.status!==0&&n({status:"failure",error:new Error("XHR request failed with non-retryable status")})},i.onabort=()=>{n({status:"failure",error:new Error("XHR request aborted")})},i.onerror=()=>{n({status:"failure",error:new Error("XHR request errored")})},i.send(e)})}shutdown(){}}function OPe(t){return new mPe(t)}class yPe{_params;constructor(e){this._params=e}send(e){return new Promise(r=>{navigator.sendBeacon(this._params.url,new Blob([e],{type:this._params.blobType}))?(Lt.debug("SendBeacon success"),r({status:"success"})):r({status:"failure",error:new Error("SendBeacon failed")})})}shutdown(){}}function vPe(t){return new yPe(t)}function bPe(t,e){return q6(t,e,W6({transport:OPe(t)}))}function xPe(t,e){return q6(t,e,W6({transport:vPe({url:t.url,blobType:t.headers()["Content-Type"]})}))}function SPe(t){return()=>{const e={};return Object.entries(t?.()??{}).forEach(([r,n])=>{typeof n<"u"?e[r]=String(n):Lt.warn(`Header "${r}" has invalid value (${n}) and will be ignored`)}),e}}function wPe(t,e,r){const n={...r()},i={};return()=>(e!=null&&Object.assign(i,e()),t!=null&&Object.assign(i,t()),Object.assign(i,n))}function PPe(t){if(t!=null)try{return new URL(t),t}catch{throw new Error(`Configuration: Could not parse user-provided export URL: '${t}'`)}}function CPe(t,e,r){return{...Mwe(t,e,r),headers:wPe(SPe(t.headers),e.headers,r.headers),url:PPe(t.url)??e.url??r.url,agentOptions:t.agentOptions??e.agentOptions??r.agentOptions}}function $Pe(t,e){return{...qwe(),headers:()=>t,url:"http://localhost:4318/"+e,agentOptions:{keepAlive:!0}}}function kPe(t,e,r){return CPe({url:t.url,timeoutMillis:t.timeoutMillis,headers:Nwe(t.headers),concurrencyLimit:t.concurrencyLimit},{},$Pe(r,e))}function TPe(t,e,r,n){const i=!!t.headers||typeof navigator.sendBeacon!="function",o=kPe(t,r,n);return i?bPe(o,e):xPe(o,e)}class EPe extends Qwe{constructor(e={}){super(TPe(e,aPe,"v1/traces",{"Content-Type":"application/json"}))}}const APe="service.name",IPe="service.version";class U6{emit(e){}}const RPe=new U6;class _Pe{getLogger(e,r,n){return new U6}}const B6=new _Pe;class jPe{constructor(e,r,n,i){this._provider=e,this.name=r,this.version=n,this.options=i}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):RPe}}class b5{getLogger(e,r,n){var i;return(i=this.getDelegateLogger(e,r,n))!==null&&i!==void 0?i:new jPe(this,e,r,n)}getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:B6}setDelegate(e){this._delegate=e}getDelegateLogger(e,r,n){var i;return(i=this._delegate)===null||i===void 0?void 0:i.getLogger(e,r,n)}}const QPe=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{},SO=Symbol.for("io.opentelemetry.js.api.logs"),Jf=QPe;function DPe(t,e,r){return n=>n===t?e:r}const x5=1;class AE{constructor(){this._proxyLoggerProvider=new b5}static getInstance(){return this._instance||(this._instance=new AE),this._instance}setGlobalLoggerProvider(e){return Jf[SO]?this.getLoggerProvider():(Jf[SO]=DPe(x5,e,B6),this._proxyLoggerProvider.setDelegate(e),e)}getLoggerProvider(){var e,r;return(r=(e=Jf[SO])===null||e===void 0?void 0:e.call(Jf,x5))!==null&&r!==void 0?r:this._proxyLoggerProvider}getLogger(e,r,n){return this.getLoggerProvider().getLogger(e,r,n)}disable(){delete Jf[SO],this._proxyLoggerProvider=new b5}}const F6=AE.getInstance();function NPe(t,e,r,n){for(let i=0,o=t.length;i<o;i++){const s=t[i];e&&s.setTracerProvider(e),r&&s.setMeterProvider(r),n&&s.setLoggerProvider&&s.setLoggerProvider(n),s.getConfig().enabled||s.enable()}}function MPe(t){t.forEach(e=>e.disable())}function qPe(t){const e=t.tracerProvider||ci.getTracerProvider(),r=t.meterProvider||S6.getMeterProvider(),n=t.loggerProvider||F6.getLoggerProvider(),i=t.instrumentations?.flat()??[];return NPe(i,e,r,n),()=>{MPe(i)}}let Ni=console.error.bind(console);function Kf(t,e,r){const n=!!t[e]&&Object.prototype.propertyIsEnumerable.call(t,e);Object.defineProperty(t,e,{configurable:!0,enumerable:n,writable:!0,value:r})}const Z6=(t,e,r)=>{if(!t||!t[e]){Ni("no original function "+String(e)+" to wrap");return}if(!r){Ni("no wrapper function"),Ni(new Error().stack);return}const n=t[e];if(typeof n!="function"||typeof r!="function"){Ni("original object and wrapper must be functions");return}const i=r(n,e);return Kf(i,"__original",n),Kf(i,"__unwrap",()=>{t[e]===i&&Kf(t,e,n)}),Kf(i,"__wrapped",!0),Kf(t,e,i),i},zPe=(t,e,r)=>{if(t)Array.isArray(t)||(t=[t]);else{Ni("must provide one or more modules to patch"),Ni(new Error().stack);return}if(!(e&&Array.isArray(e))){Ni("must provide one or more functions to wrap on modules");return}t.forEach(n=>{e.forEach(i=>{Z6(n,i,r)})})},Y6=(t,e)=>{if(!t||!t[e]){Ni("no function to unwrap."),Ni(new Error().stack);return}const r=t[e];if(!r.__unwrap)Ni("no original to unwrap to -- has "+String(e)+" already been unwrapped?");else{r.__unwrap();return}},LPe=(t,e)=>{if(t)Array.isArray(t)||(t=[t]);else{Ni("must provide one or more modules to patch"),Ni(new Error().stack);return}if(!(e&&Array.isArray(e))){Ni("must provide one or more functions to unwrap on modules");return}t.forEach(r=>{e.forEach(n=>{Y6(r,n)})})};class VPe{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(e,r,n){this.instrumentationName=e,this.instrumentationVersion=r,this.setConfig(n),this._diag=Lt.createComponentLogger({namespace:e}),this._tracer=ci.getTracer(e,r),this._meter=S6.getMeter(e,r),this._logger=F6.getLogger(e,r),this._updateMetricInstruments()}_wrap=Z6;_unwrap=Y6;_massWrap=zPe;_massUnwrap=LPe;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,r,n,i){if(e)try{e(n,i)}catch(o){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:r},o)}}}class XPe extends VPe{constructor(e,r,n){super(e,r,n),this._config.enabled&&this.enable()}}class WPe{span=void 0;constructor(e){this.span=e}get context(){return this.span?.context}error(e){this.span&&(this.span.setStatus(exports.SpanStatusCode.ERROR,e.message),this.span.recordException(e),this.span.end())}setAttribute(e,r){this.span&&this.span.setAttribute(e,r)}end(){this.span&&(this.span.setStatus(exports.SpanStatusCode.OK),this.span.end())}}class UPe{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 r=e.time?new Date(e.time):new Date;this.tracer.startSpan(`event.${e.type}`,{attributes:this.processAttributes(e,r),startTime:r}).end(r)}catch(r){this.config?.isProd||console.error("Event reporting failed:",r)}}processAttributes(e,r){const i={"cloudevents.event_id":db(),"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":r.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"&&!Array.isArray(e.data))for(const[o,s]of Object.entries(e.data)){const a=o.replace(/([A-Z])/g,"_$1").toLowerCase();if(s!==void 0)if(typeof s=="object"&&s!==null&&!Array.isArray(s))for(const[l,c]of Object.entries(s))c!==void 0&&(i[`cloudevents.event_data.${a}.${l}`]=c);else i[`cloudevents.event_data.${a}`]=s}if(e.data&&Array.isArray(e.data)){if(e.data.some(s=>s&&typeof s=="object"&&"object"in s)){const s=[],a=[];for(const l of e.data){if(!l||typeof l!="object")continue;const c=l.object;if(!c||typeof c!="string")continue;const u=l,d=a.find(p=>p.object===c);if(d){s.push(d,u);const p=a.indexOf(d);a.splice(p,1)}else s.some(h=>h.object===c)||a.push(u)}for(let l=0;l<s.length;l++){const c=s[l],u=l===0?"after.":"before.",d=`${c.object}.`;for(const[p,h]of Object.entries(c))if(h!==void 0){const m=p.replace(/([A-Z])/g,"_$1").toLowerCase();i[`cloudevents.event_data.${u}${d}${m}`]=h}}for(const l of a){const c=`${l.object}.`;for(const[u,d]of Object.entries(l))if(d!==void 0){const p=u.replace(/([A-Z])/g,"_$1").toLowerCase();i[`cloudevents.event_data.${c}${p}`]=d}}}else for(const s of e.data)if(s&&typeof s=="object"){for(const[a,l]of Object.entries(s))if(l!==void 0){const c=a.replace(/([A-Z])/g,"_$1").toLowerCase();if(l!==null&&typeof l=="object"&&!Array.isArray(l)){for(const[u,d]of Object.entries(l))if(d!=null&&typeof d!="object"){const p=u.replace(/([A-Z])/g,"_$1").toLowerCase();i[`cloudevents.event_data.${c}.${p}`]=d}}else i[`cloudevents.event_data.${c}`]=l}}}if("subjects"in e&&Array.isArray(e.subjects)){const o=e.subjects.reduce((s,a)=>{if(!a||typeof a!="object")return s;const l=a.object;if(!l||typeof l!="string")return s;const c=s.notUpdated.find(({object:u})=>u===l);return c?(s.updated=[c,a],s.notUpdated=s.notUpdated.filter(({object:u})=>u!==l)):s.updated.some(({object:u})=>u===l)||s.notUpdated.push(a),s},{updated:[],notUpdated:[]});o.updated.forEach((s,a)=>{const l=a===0?"after.":"before.",c=`${s.object}.`;Object.entries(s).forEach(([u,d])=>{d!==void 0&&(i[`cloudevents.subjects.${l}${c}${u}`]=d)})}),o.notUpdated.forEach(s=>{const a=`${s.object}.`;Object.entries(s).forEach(([l,c])=>{c!==void 0&&(i[`cloudevents.subjects.${a}${l}`]=c)})})}return Object.entries(e).forEach(([o,s])=>{["id","source","type","specversion","time","datacontenttype","data","subject","sourceDetails","analyticsMetadata","context"].includes(o)||s!==void 0&&(s instanceof Object?Object.entries(s).forEach(([a,l])=>{l!==void 0&&(i[`cloudevents.${o}.${a}`]=l)}):i[`cloudevents.${o}`]=s)}),i}startSpan(e,r){try{if(!this.tracer)return;let n;const i=e.time?new Date(e.time):new Date,o=this.tracer.startSpan(`event.${e.type}`,{attributes:this.processAttributes(e,i),root:!r},r);return r||(n=ci.setSpan(ga.active(),o)),{end:()=>o.end(),setAttribute:(s,a)=>{o.setAttribute(`cloudevents.event_data.${this.getKeySnakeValue(s)}`,a)},setStatus:(s,a)=>o.setStatus({code:s,message:a}),parentCtx:n}}catch(n){this.config?.isProd||console.error("Event reporting failed:",n);return}}startStepSpan(e){try{if(!this.tracer)return;const r=ga.active(),n=e.time?new Date(e.time):new Date,i=this.tracer.startSpan(`event.${e.type}`,{attributes:this.processAttributes(e,n)},r),o=ci.setSpan(r,i);return{end:()=>i.end(),setAttribute:(s,a)=>{i.setAttribute(`cloudevents.event_data.${this.getKeySnakeValue(s)}`,a)},setStatus:(s,a)=>i.setStatus({code:s,message:a}),recordException:s=>i.recordException(s),context:o}}catch(r){this.config?.isProd||console.error("Event reporting failed:",r);return}}traceStep(e){const r=this.startStepSpan(e);if(r)return new WPe(r)}async forceFlush(){return this.tracerProvider?.forceFlush()}async shutdown(){return this.tracerProvider?.shutdown()}getKeySnakeValue=e=>e.replace(/([A-Z])/g,"_$1").toLowerCase()}class BPe extends UPe{tracerProvider=null;tracer=null;initialized=!1;constructor(){super()}initTracer(e){if(!e.collectorUrl&&!e.collectorTraceUrl)return;const r=`ses_${db()}`,n=D6({[APe]:e.serviceName,[IPe]:e.serviceVersion,session_id:r}),i=e.collectorTraceUrl||`${e.collectorUrl}/v1/traces`;this.tracerProvider=new jwe({resource:n,spanProcessors:[new Pwe(new EPe({url:i,headers:{}}))]}),this.tracer=this.tracerProvider.getTracer(e.tracerName),this.tracerProvider.register(),qPe({instrumentations:e.instrumentations??[]}),this.initialized=!0}}class ua extends XPe{sendErrorEvent;originalConsoleError;constructor(e,r){super("errors","1.0",e||{}),this.sendErrorEvent=r}static toErrorEvent(e,r){return{type:"error",payload:[{handler:r,errorType:ua.getErrorType(e),message:ua.getErrorMessage(e),stack:ua.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 r=String(e.stack);return r.length>4096?r.substring(0,4096):r}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 r=e.findIndex(i=>i instanceof Error),n=e.filter((i,o)=>o!==r).map(i=>String(i)).join(" ");if(r===-1)return n;{const i=e[r];return n&&(i.message=`${i.message} ${n}`),i}}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 r=ua.combineConsoleErrorArgs(e);this.sendError(r,"console.error")}catch(r){process.env.NODE_ENV!=="production"&&this.originalConsoleError?.call(console,"Error reporting failed:",r)}this.originalConsoleError?.apply(console,e)}}unwrapConsoleError(){this.originalConsoleError&&(console.error=this.originalConsoleError,this.originalConsoleError=void 0)}sendError(e,r){this.sendErrorEvent(ua.toErrorEvent(e,r))}}class FPe{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 BPe,this.tracer={traceStep:(e,r)=>{const n=this.constructCloudEvent(e,r);return this.otelClient.traceStep(n)}}}updateCloudEventData=e=>{this.config?.disabled||(this.useCloudEventData=e)};send(e,r){try{if(!this.config?.otel.isProd)return;const n=this.constructCloudEvent(e,r);this.sendToOtelService(n)}catch(n){this.config?.otel.isProd||console.error("Event reporting failed:",n)}}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 ua(void 0,r=>{this.sendErrorMessage(r.payload)})]:[],...e.otel.instrumentations||[]]}))}startSpan(e,r,n){if(this.config?.disabled)return;const i=this.constructCloudEvent(e,r);return this.otelClient.startSpan(i,n)}constructCloudEvent(e,r){const n=this.useCloudEventData();return{id:`evt_${db()}`,type:e,source:n.request.source||"",specversion:"1.0",datacontenttype:"application/json",time:new Date().toISOString(),data:r,origin:n.origin||"ui",sourceDetails:{id:n.sourceDetails.user||`usr_${db()}`,object:n.sourceDetails.object||"user",uri:n.sourceDetails.uri||""},organization:n.organization,project:n.project,productType:n.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,r){this.config?.disabled||this.send(ua.toErrorEvent(e,r).type,ua.toErrorEvent(e,r).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)}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)}sendStorageReadMessage(){this.send("storage.read")}sendStorageLoadUserStateMessage(){this.send("storage.loadUserState")}sendStorageDetectFilesMessage(){this.send("storage.detectFiles")}sendStorageLoadApisMessage(){this.send("storage.loadApis")}sendStorageParseApisMessage(){this.send("storage.parseApis")}sendStorageParseCollectionsMessage(){this.send("storage.parseCollections")}sendUpdaterCheckMessage(){this.send("updater.check")}sendUpdaterDownloadMessage(){this.send("updater.download")}sendUpdaterInstallMessage(){this.send("updater.install")}sendUpdaterProcessMessage(){this.send("updater.process")}sendErrorMessage(e){this.send("error",e)}sendCodeEditorSearchMessage(e){this.send("code_editor.search",e)}}const Sx=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],ZPe="https://cors.redocly.com/";function YPe(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function S5(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function w5(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?S5(Object(r),!0).forEach(function(n){YPe(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):S5(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function yn(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var P5=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),aw=function(){return Math.random().toString(36).substring(7).split("").join(".")},wl={INIT:"@@redux/INIT"+aw(),REPLACE:"@@redux/REPLACE"+aw(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+aw()}};function G6(t){if(typeof t!="object"||t===null)return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function GPe(t){if(t===void 0)return"undefined";if(t===null)return"null";var e=typeof t;switch(e){case"boolean":case"string":case"number":case"symbol":case"function":return e}if(Array.isArray(t))return"array";if(KPe(t))return"date";if(JPe(t))return"error";var r=HPe(t);switch(r){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return r}return e.slice(8,-1).toLowerCase().replace(/\s/g,"")}function HPe(t){return typeof t.constructor=="function"?t.constructor.name:null}function JPe(t){return t instanceof Error||typeof t.message=="string"&&t.constructor&&typeof t.constructor.stackTraceLimit=="number"}function KPe(t){return t instanceof Date?!0:typeof t.toDateString=="function"&&typeof t.getDate=="function"&&typeof t.setDate=="function"}function il(t){var e=typeof t;return process.env.NODE_ENV!=="production"&&(e=GPe(t)),e}function wx(t,e,r){var n;if(typeof e=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?yn(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 r>"u"&&(r=e,e=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?yn(1):"Expected the enhancer to be a function. Instead, received: '"+il(r)+"'");return r(wx)(t,e)}if(typeof t!="function")throw new Error(process.env.NODE_ENV==="production"?yn(2):"Expected the root reducer to be a function. Instead, received: '"+il(t)+"'");var i=t,o=e,s=[],a=s,l=!1;function c(){a===s&&(a=s.slice())}function u(){if(l)throw new Error(process.env.NODE_ENV==="production"?yn(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 o}function d(g){if(typeof g!="function")throw new Error(process.env.NODE_ENV==="production"?yn(4):"Expected the listener to be a function. Instead, received: '"+il(g)+"'");if(l)throw new Error(process.env.NODE_ENV==="production"?yn(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 O=!0;return c(),a.push(g),function(){if(O){if(l)throw new Error(process.env.NODE_ENV==="production"?yn(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.");O=!1,c();var v=a.indexOf(g);a.splice(v,1),s=null}}}function p(g){if(!G6(g))throw new Error(process.env.NODE_ENV==="production"?yn(7):"Actions must be plain objects. Instead, the actual type was: '"+il(g)+"'. 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 g.type>"u")throw new Error(process.env.NODE_ENV==="production"?yn(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(l)throw new Error(process.env.NODE_ENV==="production"?yn(9):"Reducers may not dispatch actions.");try{l=!0,o=i(o,g)}finally{l=!1}for(var O=s=a,y=0;y<O.length;y++){var v=O[y];v()}return g}function h(g){if(typeof g!="function")throw new Error(process.env.NODE_ENV==="production"?yn(10):"Expected the nextReducer to be a function. Instead, received: '"+il(g));i=g,p({type:wl.REPLACE})}function m(){var g,O=d;return g={subscribe:function(v){if(typeof v!="object"||v===null)throw new Error(process.env.NODE_ENV==="production"?yn(11):"Expected the observer to be an object. Instead, received: '"+il(v)+"'");function b(){v.next&&v.next(u())}b();var w=O(b);return{unsubscribe:w}}},g[P5]=function(){return this},g}return p({type:wl.INIT}),n={dispatch:p,subscribe:d,getState:u,replaceReducer:h},n[P5]=m,n}var eCe=wx;function YC(t){typeof console<"u"&&typeof console.error=="function"&&console.error(t);try{throw new Error(t)}catch{}}function tCe(t,e,r,n){var i=Object.keys(e),o=r&&r.type===wl.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(i.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(!G6(t))return"The "+o+' has unexpected type of "'+il(t)+'". Expected argument to be an object with the following '+('keys: "'+i.join('", "')+'"');var s=Object.keys(t).filter(function(a){return!e.hasOwnProperty(a)&&!n[a]});if(s.forEach(function(a){n[a]=!0}),!(r&&r.type===wl.REPLACE)&&s.length>0)return"Unexpected "+(s.length>1?"keys":"key")+" "+('"'+s.join('", "')+'" found in '+o+". ")+"Expected to find one of the known reducer keys instead: "+('"'+i.join('", "')+'". Unexpected keys will be ignored.')}function rCe(t){Object.keys(t).forEach(function(e){var r=t[e],n=r(void 0,{type:wl.INIT});if(typeof n>"u")throw new Error(process.env.NODE_ENV==="production"?yn(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 r(void 0,{type:wl.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?yn(13):'The slice reducer for key "'+e+'" returned undefined when probed with a random type. '+("Don't try to handle '"+wl.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 nCe(t){for(var e=Object.keys(t),r={},n=0;n<e.length;n++){var i=e[n];process.env.NODE_ENV!=="production"&&typeof t[i]>"u"&&YC('No reducer provided for key "'+i+'"'),typeof t[i]=="function"&&(r[i]=t[i])}var o=Object.keys(r),s;process.env.NODE_ENV!=="production"&&(s={});var a;try{rCe(r)}catch(l){a=l}return function(c,u){if(c===void 0&&(c={}),a)throw a;if(process.env.NODE_ENV!=="production"){var d=tCe(c,r,u,s);d&&YC(d)}for(var p=!1,h={},m=0;m<o.length;m++){var g=o[m],O=r[g],y=c[g],v=O(y,u);if(typeof v>"u"){var b=u&&u.type;throw new Error(process.env.NODE_ENV==="production"?yn(14):"When called with an action of type "+(b?'"'+String(b)+'"':"(unknown type)")+', the slice reducer for key "'+g+'" 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.')}h[g]=v,p=p||v!==y}return p=p||o.length!==Object.keys(c).length,p?h:c}}function C5(t,e){return function(){return e(t.apply(this,arguments))}}function iCe(t,e){if(typeof t=="function")return C5(t,e);if(typeof t!="object"||t===null)throw new Error(process.env.NODE_ENV==="production"?yn(16):"bindActionCreators expected an object or a function, but instead received: '"+il(t)+`'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?`);var r={};for(var n in t){var i=t[n];typeof i=="function"&&(r[n]=C5(i,e))}return r}function H6(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return e.length===0?function(n){return n}:e.length===1?e[0]:e.reduce(function(n,i){return function(){return n(i.apply(void 0,arguments))}})}function oCe(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return function(n){return function(){var i=n.apply(void 0,arguments),o=function(){throw new Error(process.env.NODE_ENV==="production"?yn(15):"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},s={getState:i.getState,dispatch:function(){return o.apply(void 0,arguments)}},a=e.map(function(l){return l(s)});return o=H6.apply(void 0,a)(i.dispatch),w5(w5({},i),{},{dispatch:o})}}}function $5(){}process.env.NODE_ENV!=="production"&&typeof $5.name=="string"&&$5.name!=="isCrushed"&&YC('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 sCe=Object.freeze({__proto__:null,__DO_NOT_USE__ActionTypes:wl,applyMiddleware:oCe,bindActionCreators:iCe,combineReducers:nCe,compose:H6,createStore:wx,legacy_createStore:eCe});function aCe(t){var e=t.default;if(typeof e=="function"){var r=function(){return e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var lCe=aCe(sCe);lCe.compose;var cCe=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(t){return t}};function uCe(t,e,r){var n=!1,i=!1,o=wx(function(a,l){if(!i){var c=function(O){return Array.isArray(O)&&O.findIndex(function(y){return typeof y!="string"&&typeof y!="number"})===-1};if(l.type.startsWith("SET")){var u=function(O){try{n=!0,"value"in l?O.set(l.value):O.set(pt)}finally{n=!1}};if(l.path){if(c(l.path)){l.path.length===0&&u(t);for(var d=t,p=!0,h=0,m=l.path;h<m.length;h++){var g=m[h];d[g]?d=d[g]:p=!1}p&&u(d)}}else u(t)}else l.type==="BREAKPOINT"&&r()}return t.promised||t.error?pt:t.get({noproxy:!0})},cCe({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}})),s=function(a,l){if(n)l&&l();else try{i=!0,o.dispatch(a)}finally{i=!1}};return s}function dCe(t){return function(){var e,r,n=!1;return{onInit:function(i,o){if(!(typeof window>"u"||!("__REDUX_DEVTOOLS_EXTENSION__"in window))){if(t?.key===void 0){if(o.identifier===void 0)throw Error("State is missing Identifiable extension or Devtools key option");e=o.identifier(i)}else e=t.key;r=uCe(i,e,function(){n=!n}),i.promise||r?.({type:"CREATE",state:i.get({noproxy:!0,stealth:!0})})}},onSet:function(i,o){if(r?.({type:"SET [".concat(i.path.join("/"),"]"),state:i.get({noproxy:!0,stealth:!0}),descriptor:o}),n)debugger},onDestroy:function(){r?.({type:"DESTROY"})}}}}var Mt=(t=>(t.Normal="Normal",t.Edit="Edit",t.Draft="Draft",t))(Mt||{});const Cg="default",J6=[{name:Cg,inputs:[],servers:[],state:Mt.Normal}],K6={activeTabIdx:0,tabs:[]};var as=(t=>(t.Idle="idle",t.Loading="loading",t.Success="success",t.Error="error",t))(as||{});function ma(t){const e=new WeakMap;function r(n){if(typeof n!="object"||n===null)return n;if(e.has(n))return e.get(n);const i=Array.isArray(n)?[]:{};e.set(n,i);for(const o in n)Object.prototype.hasOwnProperty.call(n,o)&&(i[o]=r(n[o]));return i}return r(t)}function GC(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(!GC(t[i],e[i]))return!1;return!0}const r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(let i=0;i<r.length;i++){const o=r[i];if(!Object.prototype.hasOwnProperty.call(e,o)||!GC(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function k5(t){return Object.keys(t).forEach(e=>{t[e]===void 0&&delete t[e]}),t}function Da(){return!!window?.__TAURI__}async function Na(t,e={},r){return window.__TAURI_INTERNALS__.invoke(t,e,r)}async function T5(t,e,r){const n=[],i=[];for(const o of t){const s=Promise.resolve().then(()=>r(o,t));if(n.push(s),e<=t.length){const a=s.then(()=>i.splice(i.indexOf(a),1));i.push(a),i.length>=e&&await Promise.race(i)}}return Promise.all(n)}const Hn={FS:"fs",WEB:"web"};async function Ll(t,e={},r){return window.__TAURI_INTERNALS__.invoke(t,e,r)}var HC;(function(t){t[t.Audio=1]="Audio",t[t.Cache=2]="Cache",t[t.Config=3]="Config",t[t.Data=4]="Data",t[t.LocalData=5]="LocalData",t[t.Document=6]="Document",t[t.Download=7]="Download",t[t.Picture=8]="Picture",t[t.Public=9]="Public",t[t.Video=10]="Video",t[t.Resource=11]="Resource",t[t.Temp=12]="Temp",t[t.AppConfig=13]="AppConfig",t[t.AppData=14]="AppData",t[t.AppLocalData=15]="AppLocalData",t[t.AppCache=16]="AppCache",t[t.AppLog=17]="AppLog",t[t.Desktop=18]="Desktop",t[t.Executable=19]="Executable",t[t.Font=20]="Font",t[t.Home=21]="Home",t[t.Runtime=22]="Runtime",t[t.Template=23]="Template"})(HC||(HC={}));var JC;(function(t){t[t.Start=0]="Start",t[t.Current=1]="Current",t[t.End=2]="End"})(JC||(JC={}));async function KC(t,e){if(t instanceof URL&&t.protocol!=="file:")throw new TypeError("Must be a file URL.");await Ll("plugin:fs|mkdir",{path:t instanceof URL?t.toString():t,options:e})}async function IE(t,e){if(t instanceof URL&&t.protocol!=="file:")throw new TypeError("Must be a file URL.");return await Ll("plugin:fs|read_dir",{path:t instanceof URL?t.toString():t,options:e})}async function eU(t,e){if(t instanceof URL&&t.protocol!=="file:")throw new TypeError("Must be a file URL.");const r=await Ll("plugin:fs|read_file",{path:t instanceof URL?t.toString():t,options:e});return r instanceof ArrayBuffer?new Uint8Array(r):Uint8Array.from(r)}async function Px(t,e){if(t instanceof URL&&t.protocol!=="file:")throw new TypeError("Must be a file URL.");return await Ll("plugin:fs|read_text_file",{path:t instanceof URL?t.toString():t,options:e})}async function tU(t,e){if(t instanceof URL&&t.protocol!=="file:")throw new TypeError("Must be a file URL.");await Ll("plugin:fs|remove",{path:t instanceof URL?t.toString():t,options:e})}async function rU(t,e,r){if(t instanceof URL&&t.protocol!=="file:")throw new TypeError("Must be a file URL.");await Ll("plugin:fs|write_text_file",{path:t instanceof URL?t.toString():t,data:e,options:r})}async function RE(t,e){if(t instanceof URL&&t.protocol!=="file:")throw new TypeError("Must be a file URL.");return await Ll("plugin:fs|exists",{path:t instanceof URL?t.toString():t,options:e})}const fCe=Object.freeze(Object.defineProperty({__proto__:null,get BaseDirectory(){return HC},get SeekMode(){return JC},exists:RE,mkdir:KC,readDir:IE,readFile:eU,readTextFile:Px,remove:tU,writeTextFile:rU},Symbol.toStringTag,{value:"Module"}));var Ih;(function(t){t[t.Audio=1]="Audio",t[t.Cache=2]="Cache",t[t.Config=3]="Config",t[t.Data=4]="Data",t[t.LocalData=5]="LocalData",t[t.Document=6]="Document",t[t.Download=7]="Download",t[t.Picture=8]="Picture",t[t.Public=9]="Public",t[t.Video=10]="Video",t[t.Resource=11]="Resource",t[t.Temp=12]="Temp",t[t.AppConfig=13]="AppConfig",t[t.AppData=14]="AppData",t[t.AppLocalData=15]="AppLocalData",t[t.AppCache=16]="AppCache",t[t.AppLog=17]="AppLog",t[t.Desktop=18]="Desktop",t[t.Executable=19]="Executable",t[t.Font=20]="Font",t[t.Home=21]="Home",t[t.Runtime=22]="Runtime",t[t.Template=23]="Template"})(Ih||(Ih={}));async function nU(){return Na("plugin:path|resolve_directory",{directory:Ih.AppData})}async function iU(){return Na("plugin:path|resolve_directory",{directory:Ih.Desktop})}function _E(){return window.__TAURI_INTERNALS__.plugins.path.sep}async function oU(...t){return Na("plugin:path|resolve",{paths:t})}async function hd(...t){return Na("plugin:path|join",{paths:t})}async function sU(t){return Na("plugin:path|dirname",{path:t})}async function aU(t){return Na("plugin:path|extname",{path:t})}async function jE(t,e){return Na("plugin:path|basename",{path:t,ext:e})}async function lU(t){return Na("plugin:path|is_absolute",{path:t})}const pCe=Object.freeze(Object.defineProperty({__proto__:null,get BaseDirectory(){return Ih},appDataDir:nU,basename:jE,desktopDir:iU,dirname:sU,extname:aU,isAbsolute:lU,join:hd,resolve:oU,sep:_E},Symbol.toStringTag,{value:"Module"}));class or{static utils=null;static async getUtils(){return or.utils||(or.utils=Da()?await Promise.resolve().then(()=>require("./replay-tauri-path-D8sHTXGr.js")):await Promise.resolve().then(()=>ire)),or.utils}static async dirname(e){return(await or.getUtils()).dirname(e)}static async join(...e){return(await or.getUtils()).join(...e)}static async resolve(e){return(await or.getUtils()).resolve(e)}static async isAbsolute(e){return(await or.getUtils()).isAbsolute(e)}static async relative(e,r){return(await or.getUtils()).relative(e,r)}static async extname(e){return(await or.getUtils()).extname(e)}}const hCe=new Set(["node_modules"]);class E5{constructor(e){this.baseDir=e,this.initializeDirectory(e)}async initializeDirectory(e){await KC(e,{recursive:!0})}async ls(e){const r=await this.getFullPath(e);return this.getDirEntryFilesRecursively(r)}async getDirEntryFilesRecursively(e){try{const r=[],n=await IE(e);for(const i of n)if(i.isDirectory){if(hCe.has(i.name))continue;const o=await hd(e,i.name),s=await this.getDirEntryFilesRecursively(o);r.push(...s)}else{const o=await hd(e,i.name),s=await or.relative(this.baseDir,o);r.push(s)}return r}catch(r){return r.includes("forbidden path")||console.error(r),[]}}async get(e){const r=await this.getFullPath(e);try{return await Px(r)}catch(n){return!n.includes("No such file or directory")&&!n.includes("forbidden path")&&console.error(n),null}}async set(e,r){const n=await this.getFullPath(e),i=_E(),o=n.split(i).slice(0,-1).join(i);await KC(o,{recursive:!0}),await rU(n,r)}async remove(e){const r=await this.getFullPath(e);try{await tU(r)}catch(n){!n.includes("No such file or directory")&&!n.includes("forbidden path")&&console.error(n)}}async getFullPath(e){return await hd(this.baseDir,e??"")}}class gCe{baseDir="";async ls(e=""){return[]}async get(e){return null}async set(e,r){}async remove(e){}}class mCe{constructor(e){this.projectId=e}async get(){const e=this.getKey();return localStorage.getItem(e)??null}async set(e){const r=this.getKey();localStorage.setItem(r,e)}async remove(){const e=this.getKey();localStorage.removeItem(e)}getKey(){return`replay:secrets:${this.projectId}`}}class cU{constructor(e){this.storage=e}itemIds=[];async getAbsolutePath(e){return await or.resolve(await or.join(this.storage.baseDir,"/",e))}async parseMany(e,r){return(await Promise.all(e.map(async i=>{try{return await this.parse(i,r)}catch(o){return console.error(`Error parsing from ${i.type} ${i.uri}:`,o),null}}))).filter(i=>i!==null)}setItemIds(e){this.itemIds=e}async write(e){e.state===Mt.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,r){const n=e.actions;if(n){for(const o in n){const s=parseInt(o);switch(n[o]){case"D":await this.remove(this.itemIds[s]);break;case"I":case"U":await this.write(r[s]);break}}return}const i=this.itemIds.filter(o=>!r.some(s=>s.id===o));await Promise.all([...r.map(o=>this.write(o)),...i.map(o=>this.remove(o))])}async update(e,r){const i={path:e.path.slice(1),actions:e.actions};if(i.path.length===0&&await this.updateRoot(i,r),i.path.length>0){const o=i.path[0];i.path.length===1&&i.actions&&i.actions.id==="U"&&await this.remove(this.itemIds[o]),i.path[1]&&i.path[1]==="id"&&await this.remove(this.itemIds[o]),await this.write(r[o])}this.itemIds=r.map(o=>o.id)}}class OCe extends cU{parse(e){return{...e.content,id:e.uri,srcType:e.type}}async stringify(e){const{id:r,srcType:n,...i}=e;return await or.extname(r)===".json"?JSON.stringify(i,null,2):Pa.dump(i)}}var Qn=(t=>(t.SIMPLE="simple",t.REGEX="regex",t.JSONPATH="jsonpath",t.XPATH="xpath",t))(Qn||{});function yCe(t){return typeof t=="function"?t:Array.isArray(t)?e=>{for(const r of t)if(typeof r=="string"&&e===r||r instanceof RegExp&&r.test(e))return!0}:()=>!1}const vCe=`
352
+ `;function bE({input:t,onSave:e,onCancel:r,...n}){const[i,o]=$.useState(!!t.isSecret),s=({name:a,value:l})=>{e({...t,name:a,value:l,isSecret:i})};return f.jsx(h6,{variable:t,onSave:s,onCancel:r,maskValue:i,...n,children:f.jsx(wh,{children:f.jsx($W,{value:i,onChange:a=>o(a),title:"Make it secret"})})})}const LC=()=>({name:"",value:"",isSecret:!1}),Pr=t=>Ez+"$inputs."+t+yT,g6=(t,e)=>e.inputs.find(r=>r.get().name===t.match(`^${D0}$`)?.[1]);function Bxe({environments:t,activeEnvironmentId:e}){return t.get().find(n=>n.name===e.get())?.inputs||[]}function Ha(t){const e=new RegExp(D0,"g"),r=new Set;if(!t)return r;for(const[n,i,o]of t.matchAll(e)){const s=i||o;s&&r.add(s)}return r}function Ox(t){const e=/^\{?\$inputs\.([^\}\s]+)\}?$/,r=t.match(e);return r?r[1]:null}function Ey(t){const e=new Error(t);return e.source="ulid",e}const xE="0123456789ABCDEFGHJKMNPQRSTVWXYZ",Mp=xE.length,r5=Math.pow(2,48)-1,Fxe=10,Zxe=16;function Yxe(t){let e=Math.floor(t()*Mp);return e===Mp&&(e=Mp-1),xE.charAt(e)}function Gxe(t,e){if(isNaN(t))throw new Error(t+" must be a number");if(t>r5)throw Ey("cannot encode time greater than "+r5);if(t<0)throw Ey("time must be positive");if(Number.isInteger(Number(t))===!1)throw Ey("time must be an integer");let r,n="";for(;e>0;e--)r=t%Mp,n=xE.charAt(r)+n,t=(t-r)/Mp;return n}function Hxe(t,e){let r="";for(;t>0;t--)r=Yxe(e)+r;return r}function Jxe(t=!1,e){e||(e=typeof window<"u"?window:null);const r=e&&(e.crypto||e.msCrypto);if(r)return()=>{const n=new Uint8Array(1);return r.getRandomValues(n),n[0]/255};try{const n=require("crypto");return()=>n.randomBytes(1).readUInt8()/255}catch{}if(t){try{console.error("secure crypto unusable, falling back to insecure Math.random()!")}catch{}return()=>Math.random()}throw Ey("secure crypto unusable, insecure Math.random not allowed")}function Kxe(t){return t||(t=Jxe()),function(r){return isNaN(r)&&(r=Date.now()),Gxe(r,Fxe)+Hxe(Zxe,t)}}const db=Kxe();var e1e=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{},vc="1.9.0",n5=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function t1e(t){var e=new Set([t]),r=new Set,n=t.match(n5);if(!n)return function(){return!1};var i={major:+n[1],minor:+n[2],patch:+n[3],prerelease:n[4]};if(i.prerelease!=null)return function(l){return l===t};function o(a){return r.add(a),!1}function s(a){return e.add(a),!0}return function(l){if(e.has(l))return!0;if(r.has(l))return!1;var c=l.match(n5);if(!c)return o(l);var u={major:+c[1],minor:+c[2],patch:+c[3],prerelease:c[4]};return u.prerelease!=null||i.major!==u.major?o(l):i.major===0?i.minor===u.minor&&i.patch<=u.patch?s(l):o(l):i.minor<=u.minor?s(l):o(l)}}var r1e=t1e(vc),n1e=vc.split(".")[0],Eh=Symbol.for("opentelemetry.js.api."+n1e),Ah=e1e;function wg(t,e,r,n){var i;n===void 0&&(n=!1);var o=Ah[Eh]=(i=Ah[Eh])!==null&&i!==void 0?i:{version:vc};if(!n&&o[t]){var s=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+t);return r.error(s.stack||s.message),!1}if(o.version!==vc){var s=new Error("@opentelemetry/api: Registration of version v"+o.version+" for "+t+" does not match previously registered API v"+vc);return r.error(s.stack||s.message),!1}return o[t]=e,r.debug("@opentelemetry/api: Registered a global for "+t+" v"+vc+"."),!0}function _c(t){var e,r,n=(e=Ah[Eh])===null||e===void 0?void 0:e.version;if(!(!n||!r1e(n)))return(r=Ah[Eh])===null||r===void 0?void 0:r[t]}function Pg(t,e){e.debug("@opentelemetry/api: Unregistering a global for "+t+" v"+vc+".");var r=Ah[Eh];r&&delete r[t]}var i1e=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o},o1e=function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))},s1e=(function(){function t(e){this._namespace=e.namespace||"DiagComponentLogger"}return t.prototype.debug=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return Gf("debug",this._namespace,e)},t.prototype.error=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return Gf("error",this._namespace,e)},t.prototype.info=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return Gf("info",this._namespace,e)},t.prototype.warn=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return Gf("warn",this._namespace,e)},t.prototype.verbose=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return Gf("verbose",this._namespace,e)},t})();function Gf(t,e,r){var n=_c("diag");if(n)return r.unshift(e),n[t].apply(n,o1e([],i1e(r),!1))}var Ai;(function(t){t[t.NONE=0]="NONE",t[t.ERROR=30]="ERROR",t[t.WARN=50]="WARN",t[t.INFO=60]="INFO",t[t.DEBUG=70]="DEBUG",t[t.VERBOSE=80]="VERBOSE",t[t.ALL=9999]="ALL"})(Ai||(Ai={}));function a1e(t,e){t<Ai.NONE?t=Ai.NONE:t>Ai.ALL&&(t=Ai.ALL),e=e||{};function r(n,i){var o=e[n];return typeof o=="function"&&t>=i?o.bind(e):function(){}}return{error:r("error",Ai.ERROR),warn:r("warn",Ai.WARN),info:r("info",Ai.INFO),debug:r("debug",Ai.DEBUG),verbose:r("verbose",Ai.VERBOSE)}}var l1e=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o},c1e=function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))},u1e="diag",ks=(function(){function t(){function e(i){return function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];var a=_c("diag");if(a)return a[i].apply(a,c1e([],l1e(o),!1))}}var r=this,n=function(i,o){var s,a,l;if(o===void 0&&(o={logLevel:Ai.INFO}),i===r){var c=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return r.error((s=c.stack)!==null&&s!==void 0?s:c.message),!1}typeof o=="number"&&(o={logLevel:o});var u=_c("diag"),d=a1e((a=o.logLevel)!==null&&a!==void 0?a:Ai.INFO,i);if(u&&!o.suppressOverrideMessage){var p=(l=new Error().stack)!==null&&l!==void 0?l:"<failed to generate stacktrace>";u.warn("Current logger will be overwritten from "+p),d.warn("Current logger will overwrite one already registered from "+p)}return wg("diag",d,r,!0)};r.setLogger=n,r.disable=function(){Pg(u1e,r)},r.createComponentLogger=function(i){return new s1e(i)},r.verbose=e("verbose"),r.debug=e("debug"),r.info=e("info"),r.warn=e("warn"),r.error=e("error")}return t.instance=function(){return this._instance||(this._instance=new t),this._instance},t})(),d1e=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o},f1e=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},p1e=(function(){function t(e){this._entries=e?new Map(e):new Map}return t.prototype.getEntry=function(e){var r=this._entries.get(e);if(r)return Object.assign({},r)},t.prototype.getAllEntries=function(){return Array.from(this._entries.entries()).map(function(e){var r=d1e(e,2),n=r[0],i=r[1];return[n,i]})},t.prototype.setEntry=function(e,r){var n=new t(this._entries);return n._entries.set(e,r),n},t.prototype.removeEntry=function(e){var r=new t(this._entries);return r._entries.delete(e),r},t.prototype.removeEntries=function(){for(var e,r,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var o=new t(this._entries);try{for(var s=f1e(n),a=s.next();!a.done;a=s.next()){var l=a.value;o._entries.delete(l)}}catch(c){e={error:c}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(e)throw e.error}}return o},t.prototype.clear=function(){return new t},t})(),h1e=Symbol("BaggageEntryMetadata"),g1e=ks.instance();function m1e(t){return t===void 0&&(t={}),new p1e(new Map(Object.entries(t)))}function O1e(t){return typeof t!="string"&&(g1e.error("Cannot create baggage metadata from unknown type: "+typeof t),t=""),{__TYPE__:h1e,toString:function(){return t}}}function SE(t){return Symbol.for(t)}var y1e=(function(){function t(e){var r=this;r._currentContext=e?new Map(e):new Map,r.getValue=function(n){return r._currentContext.get(n)},r.setValue=function(n,i){var o=new t(r._currentContext);return o._currentContext.set(n,i),o},r.deleteValue=function(n){var i=new t(r._currentContext);return i._currentContext.delete(n),i}}return t})(),Uu=new y1e,Gc=(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),v1e=(function(){function t(){}return t.prototype.createGauge=function(e,r){return E1e},t.prototype.createHistogram=function(e,r){return A1e},t.prototype.createCounter=function(e,r){return T1e},t.prototype.createUpDownCounter=function(e,r){return I1e},t.prototype.createObservableGauge=function(e,r){return _1e},t.prototype.createObservableCounter=function(e,r){return R1e},t.prototype.createObservableUpDownCounter=function(e,r){return j1e},t.prototype.addBatchObservableCallback=function(e,r){},t.prototype.removeBatchObservableCallback=function(e){},t})(),yx=(function(){function t(){}return t})(),b1e=(function(t){Gc(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.add=function(r,n){},e})(yx),x1e=(function(t){Gc(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.add=function(r,n){},e})(yx),S1e=(function(t){Gc(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.record=function(r,n){},e})(yx),w1e=(function(t){Gc(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.record=function(r,n){},e})(yx),wE=(function(){function t(){}return t.prototype.addCallback=function(e){},t.prototype.removeCallback=function(e){},t})(),P1e=(function(t){Gc(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(wE),C1e=(function(t){Gc(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(wE),$1e=(function(t){Gc(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(wE),k1e=new v1e,T1e=new b1e,E1e=new S1e,A1e=new w1e,I1e=new x1e,R1e=new P1e,_1e=new C1e,j1e=new $1e,Q1e={get:function(t,e){if(t!=null)return t[e]},keys:function(t){return t==null?[]:Object.keys(t)}},D1e={set:function(t,e,r){t!=null&&(t[e]=r)}},N1e=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o},M1e=function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))},q1e=(function(){function t(){}return t.prototype.active=function(){return Uu},t.prototype.with=function(e,r,n){for(var i=[],o=3;o<arguments.length;o++)i[o-3]=arguments[o];return r.call.apply(r,M1e([n],N1e(i),!1))},t.prototype.bind=function(e,r){return r},t.prototype.enable=function(){return this},t.prototype.disable=function(){return this},t})(),z1e=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o},L1e=function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))},YS="context",V1e=new q1e,vx=(function(){function t(){}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalContextManager=function(e){return wg(YS,e,ks.instance())},t.prototype.active=function(){return this._getContextManager().active()},t.prototype.with=function(e,r,n){for(var i,o=[],s=3;s<arguments.length;s++)o[s-3]=arguments[s];return(i=this._getContextManager()).with.apply(i,L1e([e,r,n],z1e(o),!1))},t.prototype.bind=function(e,r){return this._getContextManager().bind(e,r)},t.prototype._getContextManager=function(){return _c(YS)||V1e},t.prototype.disable=function(){this._getContextManager().disable(),Pg(YS,ks.instance())},t})(),$a;(function(t){t[t.NONE=0]="NONE",t[t.SAMPLED=1]="SAMPLED"})($a||($a={}));var m6="0000000000000000",O6="00000000000000000000000000000000",y6={traceId:O6,spanId:m6,traceFlags:$a.NONE},qp=(function(){function t(e){e===void 0&&(e=y6),this._spanContext=e}return t.prototype.spanContext=function(){return this._spanContext},t.prototype.setAttribute=function(e,r){return this},t.prototype.setAttributes=function(e){return this},t.prototype.addEvent=function(e,r){return this},t.prototype.addLink=function(e){return this},t.prototype.addLinks=function(e){return this},t.prototype.setStatus=function(e){return this},t.prototype.updateName=function(e){return this},t.prototype.end=function(e){},t.prototype.isRecording=function(){return!1},t.prototype.recordException=function(e,r){},t})(),PE=SE("OpenTelemetry Context Key SPAN");function CE(t){return t.getValue(PE)||void 0}function X1e(){return CE(vx.getInstance().active())}function $E(t,e){return t.setValue(PE,e)}function W1e(t){return t.deleteValue(PE)}function U1e(t,e){return $E(t,new qp(e))}function v6(t){var e;return(e=CE(t))===null||e===void 0?void 0:e.spanContext()}var B1e=/^([0-9a-f]{32})$/i,F1e=/^[0-9a-f]{16}$/i;function b6(t){return B1e.test(t)&&t!==O6}function Z1e(t){return F1e.test(t)&&t!==m6}function bx(t){return b6(t.traceId)&&Z1e(t.spanId)}function Y1e(t){return new qp(t)}var GS=vx.getInstance(),x6=(function(){function t(){}return t.prototype.startSpan=function(e,r,n){n===void 0&&(n=GS.active());var i=!!r?.root;if(i)return new qp;var o=n&&v6(n);return G1e(o)&&bx(o)?new qp(o):new qp},t.prototype.startActiveSpan=function(e,r,n,i){var o,s,a;if(!(arguments.length<2)){arguments.length===2?a=r:arguments.length===3?(o=r,a=n):(o=r,s=n,a=i);var l=s??GS.active(),c=this.startSpan(e,o,l),u=$E(l,c);return GS.with(u,a,void 0,c)}},t})();function G1e(t){return typeof t=="object"&&typeof t.spanId=="string"&&typeof t.traceId=="string"&&typeof t.traceFlags=="number"}var H1e=new x6,J1e=(function(){function t(e,r,n,i){this._provider=e,this.name=r,this.version=n,this.options=i}return t.prototype.startSpan=function(e,r,n){return this._getTracer().startSpan(e,r,n)},t.prototype.startActiveSpan=function(e,r,n,i){var o=this._getTracer();return Reflect.apply(o.startActiveSpan,o,arguments)},t.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):H1e},t})(),K1e=(function(){function t(){}return t.prototype.getTracer=function(e,r,n){return new x6},t})(),eSe=new K1e,i5=(function(){function t(){}return t.prototype.getTracer=function(e,r,n){var i;return(i=this.getDelegateTracer(e,r,n))!==null&&i!==void 0?i:new J1e(this,e,r,n)},t.prototype.getDelegate=function(){var e;return(e=this._delegate)!==null&&e!==void 0?e:eSe},t.prototype.setDelegate=function(e){this._delegate=e},t.prototype.getDelegateTracer=function(e,r,n){var i;return(i=this._delegate)===null||i===void 0?void 0:i.getTracer(e,r,n)},t})(),fb;(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(fb||(fb={}));var VC;(function(t){t[t.INTERNAL=0]="INTERNAL",t[t.SERVER=1]="SERVER",t[t.CLIENT=2]="CLIENT",t[t.PRODUCER=3]="PRODUCER",t[t.CONSUMER=4]="CONSUMER"})(VC||(VC={}));exports.SpanStatusCode=void 0;(function(t){t[t.UNSET=0]="UNSET",t[t.OK=1]="OK",t[t.ERROR=2]="ERROR"})(exports.SpanStatusCode||(exports.SpanStatusCode={}));var ga=vx.getInstance(),Lt=ks.instance(),tSe=(function(){function t(){}return t.prototype.getMeter=function(e,r,n){return k1e},t})(),rSe=new tSe,HS="metrics",nSe=(function(){function t(){}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalMeterProvider=function(e){return wg(HS,e,ks.instance())},t.prototype.getMeterProvider=function(){return _c(HS)||rSe},t.prototype.getMeter=function(e,r,n){return this.getMeterProvider().getMeter(e,r,n)},t.prototype.disable=function(){Pg(HS,ks.instance())},t})(),S6=nSe.getInstance(),iSe=(function(){function t(){}return t.prototype.inject=function(e,r){},t.prototype.extract=function(e,r){return e},t.prototype.fields=function(){return[]},t})(),kE=SE("OpenTelemetry Baggage Key");function w6(t){return t.getValue(kE)||void 0}function oSe(){return w6(vx.getInstance().active())}function sSe(t,e){return t.setValue(kE,e)}function aSe(t){return t.deleteValue(kE)}var JS="propagation",lSe=new iSe,cSe=(function(){function t(){this.createBaggage=m1e,this.getBaggage=w6,this.getActiveBaggage=oSe,this.setBaggage=sSe,this.deleteBaggage=aSe}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalPropagator=function(e){return wg(JS,e,ks.instance())},t.prototype.inject=function(e,r,n){return n===void 0&&(n=D1e),this._getGlobalPropagator().inject(e,r,n)},t.prototype.extract=function(e,r,n){return n===void 0&&(n=Q1e),this._getGlobalPropagator().extract(e,r,n)},t.prototype.fields=function(){return this._getGlobalPropagator().fields()},t.prototype.disable=function(){Pg(JS,ks.instance())},t.prototype._getGlobalPropagator=function(){return _c(JS)||lSe},t})(),zp=cSe.getInstance(),KS="trace",uSe=(function(){function t(){this._proxyTracerProvider=new i5,this.wrapSpanContext=Y1e,this.isSpanContextValid=bx,this.deleteSpan=W1e,this.getSpan=CE,this.getActiveSpan=X1e,this.getSpanContext=v6,this.setSpan=$E,this.setSpanContext=U1e}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalTracerProvider=function(e){var r=wg(KS,this._proxyTracerProvider,ks.instance());return r&&this._proxyTracerProvider.setDelegate(e),r},t.prototype.getTracerProvider=function(){return _c(KS)||this._proxyTracerProvider},t.prototype.getTracer=function(e,r){return this.getTracerProvider().getTracer(e,r)},t.prototype.disable=function(){Pg(KS,ks.instance()),this._proxyTracerProvider=new i5},t})(),ci=uSe.getInstance();const P6=SE("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function dSe(t){return t.setValue(P6,!0)}function TE(t){return t.getValue(P6)===!0}const fSe="=",XC=";",WC=",",ew="baggage",pSe=180,hSe=4096,gSe=8192;function mSe(t){return t.reduce((e,r)=>{const n=`${e}${e!==""?WC:""}${r}`;return n.length>gSe?e:n},"")}function OSe(t){return t.getAllEntries().map(([e,r])=>{let n=`${encodeURIComponent(e)}=${encodeURIComponent(r.value)}`;return r.metadata!==void 0&&(n+=XC+r.metadata.toString()),n})}function ySe(t){const e=t.split(XC);if(e.length<=0)return;const r=e.shift();if(!r)return;const n=r.indexOf(fSe);if(n<=0)return;const i=decodeURIComponent(r.substring(0,n).trim()),o=decodeURIComponent(r.substring(n+1).trim());let s;return e.length>0&&(s=O1e(e.join(XC))),{key:i,value:o,metadata:s}}class vSe{inject(e,r,n){const i=zp.getBaggage(e);if(!i||TE(e))return;const o=OSe(i).filter(a=>a.length<=hSe).slice(0,pSe),s=mSe(o);s.length>0&&n.set(r,ew,s)}extract(e,r,n){const i=n.get(r,ew),o=Array.isArray(i)?i.join(WC):i;if(!o)return e;const s={};return o.length===0||(o.split(WC).forEach(l=>{const c=ySe(l);if(c){const u={value:c.value};c.metadata&&(u.metadata=c.metadata),s[c.key]=u}}),Object.entries(s).length===0)?e:zp.setBaggage(e,zp.createBaggage(s))}fields(){return[ew]}}function Ay(t){const e={};if(typeof t!="object"||t==null)return e;for(const[r,n]of Object.entries(t)){if(!bSe(r)){Lt.warn(`Invalid attribute key: ${r}`);continue}if(!C6(n)){Lt.warn(`Invalid attribute value set for key: ${r}`);continue}Array.isArray(n)?e[r]=n.slice():e[r]=n}return e}function bSe(t){return typeof t=="string"&&t.length>0}function C6(t){return t==null?!0:Array.isArray(t)?xSe(t):$6(t)}function xSe(t){let e;for(const r of t)if(r!=null){if(!e){if($6(r)){e=typeof r;continue}return!1}if(typeof r!==e)return!1}return!0}function $6(t){switch(typeof t){case"number":case"boolean":case"string":return!0}return!1}function SSe(){return t=>{Lt.error(wSe(t))}}function wSe(t){return typeof t=="string"?t:JSON.stringify(PSe(t))}function PSe(t){const e={};let r=t;for(;r!==null;)Object.getOwnPropertyNames(r).forEach(n=>{if(e[n])return;const i=r[n];i&&(e[n]=String(i))}),r=Object.getPrototypeOf(r);return e}let CSe=SSe();function Dd(t){try{CSe(t)}catch{}}const fd=performance,$Se="2.0.1",tw="exception.message",kSe="exception.stacktrace",rw="exception.type",TSe="service.name",UC="telemetry.sdk.language",ESe="webjs",BC="telemetry.sdk.name",FC="telemetry.sdk.version",ASe="process.runtime.name",nw={[BC]:"opentelemetry",[ASe]:"browser",[UC]:ESe,[FC]:$Se};const ISe=9,RSe=6,_Se=Math.pow(10,RSe),pb=Math.pow(10,ISe);function td(t){const e=t/1e3,r=Math.trunc(e),n=Math.round(t%1e3*_Se);return[r,n]}function k6(){let t=fd.timeOrigin;if(typeof t!="number"){const e=fd;t=e.timing&&e.timing.fetchStart}return t}function jSe(t){const e=td(k6()),r=td(typeof t=="number"?t:fd.now());return E6(e,r)}function QSe(t,e){let r=e[0]-t[0],n=e[1]-t[1];return n<0&&(r-=1,n+=pb),[r,n]}function DSe(t){return t[0]*pb+t[1]}function T6(t){return Array.isArray(t)&&t.length===2&&typeof t[0]=="number"&&typeof t[1]=="number"}function o5(t){return T6(t)||typeof t=="number"||t instanceof Date}function E6(t,e){const r=[t[0]+e[0],t[1]+e[1]];return r[1]>=pb&&(r[1]-=pb,r[0]+=1),r}var cs;(function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"})(cs||(cs={}));class NSe{_propagators;_fields;constructor(e={}){this._propagators=e.propagators??[],this._fields=Array.from(new Set(this._propagators.map(r=>typeof r.fields=="function"?r.fields():[]).reduce((r,n)=>r.concat(n),[])))}inject(e,r,n){for(const i of this._propagators)try{i.inject(e,r,n)}catch(o){Lt.warn(`Failed to inject with ${i.constructor.name}. Err: ${o.message}`)}}extract(e,r,n){return this._propagators.reduce((i,o)=>{try{return o.extract(i,r,n)}catch(s){Lt.warn(`Failed to extract with ${o.constructor.name}. Err: ${s.message}`)}return i},e)}fields(){return this._fields.slice()}}const ZC="[_0-9a-z-*/]",MSe=`[a-z]${ZC}{0,255}`,qSe=`[a-z0-9]${ZC}{0,240}@[a-z]${ZC}{0,13}`,zSe=new RegExp(`^(?:${MSe}|${qSe})$`),LSe=/^[ -~]{0,255}[!-~]$/,VSe=/,|=/;function XSe(t){return zSe.test(t)}function WSe(t){return LSe.test(t)&&!VSe.test(t)}const s5=32,USe=512,a5=",",l5="=";class EE{_internalState=new Map;constructor(e){e&&this._parse(e)}set(e,r){const n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,r),n}unset(e){const r=this._clone();return r._internalState.delete(e),r}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,r)=>(e.push(r+l5+this.get(r)),e),[]).join(a5)}_parse(e){e.length>USe||(this._internalState=e.split(a5).reverse().reduce((r,n)=>{const i=n.trim(),o=i.indexOf(l5);if(o!==-1){const s=i.slice(0,o),a=i.slice(o+1,n.length);XSe(s)&&WSe(a)&&r.set(s,a)}return r},new Map),this._internalState.size>s5&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,s5))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){const e=new EE;return e._internalState=new Map(this._internalState),e}}const iw="traceparent",ow="tracestate",BSe="00",FSe="(?!ff)[\\da-f]{2}",ZSe="(?![0]{32})[\\da-f]{32}",YSe="(?![0]{16})[\\da-f]{16}",GSe="[\\da-f]{2}",HSe=new RegExp(`^\\s?(${FSe})-(${ZSe})-(${YSe})-(${GSe})(-.*)?\\s?$`);function JSe(t){const e=HSe.exec(t);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}class KSe{inject(e,r,n){const i=ci.getSpanContext(e);if(!i||TE(e)||!bx(i))return;const o=`${BSe}-${i.traceId}-${i.spanId}-0${Number(i.traceFlags||$a.NONE).toString(16)}`;n.set(r,iw,o),i.traceState&&n.set(r,ow,i.traceState.serialize())}extract(e,r,n){const i=n.get(r,iw);if(!i)return e;const o=Array.isArray(i)?i[0]:i;if(typeof o!="string")return e;const s=JSe(o);if(!s)return e;s.isRemote=!0;const a=n.get(r,ow);if(a){const l=Array.isArray(a)?a.join(","):a;s.traceState=new EE(typeof l=="string"?l:void 0)}return ci.setSpanContext(e,s)}fields(){return[iw,ow]}}const ewe="[object Object]",twe="[object Null]",rwe="[object Undefined]",nwe=Function.prototype,A6=nwe.toString,iwe=A6.call(Object),owe=Object.getPrototypeOf,I6=Object.prototype,R6=I6.hasOwnProperty,fc=Symbol?Symbol.toStringTag:void 0,_6=I6.toString;function c5(t){if(!swe(t)||awe(t)!==ewe)return!1;const e=owe(t);if(e===null)return!0;const r=R6.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&A6.call(r)===iwe}function swe(t){return t!=null&&typeof t=="object"}function awe(t){return t==null?t===void 0?rwe:twe:fc&&fc in Object(t)?lwe(t):cwe(t)}function lwe(t){const e=R6.call(t,fc),r=t[fc];let n=!1;try{t[fc]=void 0,n=!0}catch{}const i=_6.call(t);return n&&(e?t[fc]=r:delete t[fc]),i}function cwe(t){return _6.call(t)}const uwe=20;function dwe(...t){let e=t.shift();const r=new WeakMap;for(;t.length>0;)e=j6(e,t.shift(),0,r);return e}function sw(t){return hb(t)?t.slice():t}function j6(t,e,r=0,n){let i;if(!(r>uwe)){if(r++,Iy(t)||Iy(e)||Q6(e))i=sw(e);else if(hb(t)){if(i=t.slice(),hb(e))for(let o=0,s=e.length;o<s;o++)i.push(sw(e[o]));else if(Hf(e)){const o=Object.keys(e);for(let s=0,a=o.length;s<a;s++){const l=o[s];i[l]=sw(e[l])}}}else if(Hf(t))if(Hf(e)){if(!fwe(t,e))return e;i=Object.assign({},t);const o=Object.keys(e);for(let s=0,a=o.length;s<a;s++){const l=o[s],c=e[l];if(Iy(c))typeof c>"u"?delete i[l]:i[l]=c;else{const u=i[l],d=c;if(u5(t,l,n)||u5(e,l,n))delete i[l];else{if(Hf(u)&&Hf(d)){const p=n.get(u)||[],h=n.get(d)||[];p.push({obj:t,key:l}),h.push({obj:e,key:l}),n.set(u,p),n.set(d,h)}i[l]=j6(i[l],c,r,n)}}}}else i=e;return i}}function u5(t,e,r){const n=r.get(t[e])||[];for(let i=0,o=n.length;i<o;i++){const s=n[i];if(s.key===e&&s.obj===t)return!0}return!1}function hb(t){return Array.isArray(t)}function Q6(t){return typeof t=="function"}function Hf(t){return!Iy(t)&&!hb(t)&&!Q6(t)&&typeof t=="object"}function Iy(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t>"u"||t instanceof Date||t instanceof RegExp||t===null}function fwe(t,e){return!(!c5(t)||!c5(e))}class pwe{_promise;_resolve;_reject;constructor(){this._promise=new Promise((e,r)=>{this._resolve=e,this._reject=r})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}class hwe{_callback;_that;_isCalled=!1;_deferred=new pwe;constructor(e,r){this._callback=e,this._that=r}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(r=>this._deferred.resolve(r),r=>this._deferred.reject(r))}catch(r){this._deferred.reject(r)}}return this._deferred.promise}}function gwe(){return"unknown_service"}const bp=t=>t!==null&&typeof t=="object"&&typeof t.then=="function";class gb{_rawAttributes;_asyncAttributesPending=!1;_memoizedAttributes;static FromAttributeList(e){const r=new gb({});return r._rawAttributes=d5(e),r._asyncAttributesPending=e.filter(([n,i])=>bp(i)).length>0,r}constructor(e){const r=e.attributes??{};this._rawAttributes=Object.entries(r).map(([n,i])=>(bp(i)&&(this._asyncAttributesPending=!0),[n,i])),this._rawAttributes=d5(this._rawAttributes)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let e=0;e<this._rawAttributes.length;e++){const[r,n]=this._rawAttributes[e];this._rawAttributes[e]=[r,bp(n)?await n:n]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&Lt.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;const e={};for(const[r,n]of this._rawAttributes){if(bp(n)){Lt.debug(`Unsettled resource attribute ${r} skipped`);continue}n!=null&&(e[r]??=n)}return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}merge(e){return e==null?this:gb.FromAttributeList([...e.getRawAttributes(),...this.getRawAttributes()])}}function D6(t){return gb.FromAttributeList(Object.entries(t))}function mwe(){return D6({[TSe]:gwe(),[UC]:nw[UC],[BC]:nw[BC],[FC]:nw[FC]})}function d5(t){return t.map(([e,r])=>bp(r)?[e,r.catch(n=>{Lt.debug("promise rejection for resource attribute: %s - %s",e,n)})]:[e,r])}const Owe="exception";class ywe{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;name;status={code:exports.SpanStatusCode.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(e){const r=Date.now();this._spanContext=e.spanContext,this._performanceStartTime=fd.now(),this._performanceOffset=r-(this._performanceStartTime+k6()),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??r),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,r){if(r==null||this._isSpanEnded())return this;if(e.length===0)return Lt.warn(`Invalid attribute key: ${e}`),this;if(!C6(r))return Lt.warn(`Invalid attribute value set for key: ${e}`),this;const{attributeCountLimit:n}=this._spanLimits;return n!==void 0&&Object.keys(this.attributes).length>=n&&!Object.prototype.hasOwnProperty.call(this.attributes,e)?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(r),this)}setAttributes(e){for(const[r,n]of Object.entries(e))this.setAttribute(r,n);return this}addEvent(e,r,n){if(this._isSpanEnded())return this;const{eventCountLimit:i}=this._spanLimits;if(i===0)return Lt.warn("No events allowed."),this._droppedEventsCount++,this;i!==void 0&&this.events.length>=i&&(this._droppedEventsCount===0&&Lt.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),o5(r)&&(o5(n)||(n=r),r=void 0);const o=Ay(r);return this.events.push({name:e,attributes:o,time:this._getTime(n),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"&&(Lt.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()){Lt.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=QSe(this.startTime,this.endTime),this._duration[0]<0&&(Lt.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&&Lt.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._spanProcessor.onEnd(this)}_getTime(e){if(typeof e=="number"&&e<=fd.now())return jSe(e+this._performanceOffset);if(typeof e=="number")return td(e);if(e instanceof Date)return td(e.getTime());if(T6(e))return e;if(this._startTimeProvided)return td(Date.now());const r=fd.now()-this._performanceStartTime;return E6(this.startTime,td(r))}isRecording(){return this._ended===!1}recordException(e,r){const n={};typeof e=="string"?n[tw]=e:e&&(e.code?n[rw]=e.code.toString():e.name&&(n[rw]=e.name),e.message&&(n[tw]=e.message),e.stack&&(n[kSe]=e.stack)),n[rw]||n[tw]?this.addEvent(Owe,n,r):Lt.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}}`);Lt.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,e)}return this._ended}_truncateToLimitUtil(e,r){return e.length<=r?e:e.substring(0,r)}_truncateToSize(e){const r=this._attributeValueLengthLimit;return r<=0?(Lt.warn(`Attribute value limit must be positive, got ${r}`),e):typeof e=="string"?this._truncateToLimitUtil(e,r):Array.isArray(e)?e.map(n=>typeof n=="string"?this._truncateToLimitUtil(n,r):n):e}}var Nd;(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(Nd||(Nd={}));class mb{shouldSample(){return{decision:Nd.NOT_RECORD}}toString(){return"AlwaysOffSampler"}}class pd{shouldSample(){return{decision:Nd.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}}class bO{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(e){this._root=e.root,this._root||(Dd(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new pd),this._remoteParentSampled=e.remoteParentSampled??new pd,this._remoteParentNotSampled=e.remoteParentNotSampled??new mb,this._localParentSampled=e.localParentSampled??new pd,this._localParentNotSampled=e.localParentNotSampled??new mb}shouldSample(e,r,n,i,o,s){const a=ci.getSpanContext(e);return!a||!bx(a)?this._root.shouldSample(e,r,n,i,o,s):a.isRemote?a.traceFlags&$a.SAMPLED?this._remoteParentSampled.shouldSample(e,r,n,i,o,s):this._remoteParentNotSampled.shouldSample(e,r,n,i,o,s):a.traceFlags&$a.SAMPLED?this._localParentSampled.shouldSample(e,r,n,i,o,s):this._localParentNotSampled.shouldSample(e,r,n,i,o,s)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}class f5{_ratio;_upperBound;constructor(e=0){this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,r){return{decision:b6(r)&&this._accumulate(r)<this._upperBound?Nd.RECORD_AND_SAMPLED:Nd.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 r=0;for(let n=0;n<e.length/8;n++){const i=n*8,o=parseInt(e.slice(i,i+8),16);r=(r^o)>>>0}return r}}const p5=1;function N6(){return{sampler:M6(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},spanLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128,linkCountLimit:128,eventCountLimit:128,attributePerEventCountLimit:128,attributePerLinkCountLimit:128}}}function M6(){const t="parentbased_always_on";switch(t){case"always_on":return new pd;case"always_off":return new mb;case"parentbased_always_on":return new bO({root:new pd});case"parentbased_always_off":return new bO({root:new mb});case"traceidratio":return new f5(h5());case"parentbased_traceidratio":return new bO({root:new f5(h5())});default:return Lt.error(`OTEL_TRACES_SAMPLER value "${t}" invalid, defaulting to "parentbased_always_on".`),new bO({root:new pd})}}function h5(){return Lt.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${p5}.`),p5}const vwe=128,bwe=1/0;function xwe(t){const e={sampler:M6()},r=N6(),n=Object.assign({},r,e,t);return n.generalLimits=Object.assign({},r.generalLimits,t.generalLimits||{}),n.spanLimits=Object.assign({},r.spanLimits,t.spanLimits||{}),n}function Swe(t){const e=Object.assign({},t.spanLimits);return e.attributeCountLimit=t.spanLimits?.attributeCountLimit??t.generalLimits?.attributeCountLimit??void 0??void 0??vwe,e.attributeValueLengthLimit=t.spanLimits?.attributeValueLengthLimit??t.generalLimits?.attributeValueLengthLimit??void 0??void 0??bwe,Object.assign({},t,{spanLimits:e})}class wwe{_exporter;_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_isExporting=!1;_finishedSpans=[];_timer;_shutdownOnce;_droppedSpansCount=0;constructor(e,r){this._exporter=e,this._maxExportBatchSize=typeof r?.maxExportBatchSize=="number"?r.maxExportBatchSize:512,this._maxQueueSize=typeof r?.maxQueueSize=="number"?r.maxQueueSize:2048,this._scheduledDelayMillis=typeof r?.scheduledDelayMillis=="number"?r.scheduledDelayMillis:5e3,this._exportTimeoutMillis=typeof r?.exportTimeoutMillis=="number"?r.exportTimeoutMillis:3e4,this._shutdownOnce=new hwe(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(Lt.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,r){}onEnd(e){this._shutdownOnce.isCalled||(e.spanContext().traceFlags&$a.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&&Lt.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(Lt.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,r)=>{const n=[],i=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let o=0,s=i;o<s;o++)n.push(this._flushOneBatch());Promise.all(n).then(()=>{e()}).catch(r)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((e,r)=>{const n=setTimeout(()=>{r(new Error("Timeout"))},this._exportTimeoutMillis);ga.with(dSe(ga.active()),()=>{let i;this._finishedSpans.length<=this._maxExportBatchSize?(i=this._finishedSpans,this._finishedSpans=[]):i=this._finishedSpans.splice(0,this._maxExportBatchSize);const o=()=>this._exporter.export(i,a=>{clearTimeout(n),a.code===cs.SUCCESS?e():r(a.error??new Error("BatchSpanProcessor: span export failed"))});let s=null;for(let a=0,l=i.length;a<l;a++){const c=i[a];c.resource.asyncAttributesPending&&c.resource.waitForAsyncAttributes&&(s??=[],s.push(c.resource.waitForAsyncAttributes()))}s===null?o():Promise.all(s).then(o,a=>{Dd(a),r(a)})})})}_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(r=>{this._isExporting=!1,Dd(r)})};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 Pwe extends wwe{_visibilityChangeListener;_pageHideListener;constructor(e,r){super(e,r),this.onInit(r)}onInit(e){e?.disableAutoFlushOnDocumentHide!==!0&&typeof document<"u"&&(this._visibilityChangeListener=()=>{document.visibilityState==="hidden"&&this.forceFlush().catch(r=>{Dd(r)})},this._pageHideListener=()=>{this.forceFlush().catch(r=>{Dd(r)})},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 Cwe=8,$we=16;class kwe{generateTraceId=g5($we);generateSpanId=g5(Cwe)}const xO=Array(32);function g5(t){return function(){for(let r=0;r<t*2;r++)xO[r]=Math.floor(Math.random()*16)+48,xO[r]>=58&&(xO[r]+=39);return String.fromCharCode.apply(null,xO.slice(0,t*2))}}class Twe{_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;constructor(e,r,n,i){const o=xwe(r);this._sampler=o.sampler,this._generalLimits=o.generalLimits,this._spanLimits=o.spanLimits,this._idGenerator=r.idGenerator||new kwe,this._resource=n,this._spanProcessor=i,this.instrumentationScope=e}startSpan(e,r={},n=ga.active()){r.root&&(n=ci.deleteSpan(n));const i=ci.getSpan(n);if(TE(n))return Lt.debug("Instrumentation suppressed, returning Noop Span"),ci.wrapSpanContext(y6);const o=i?.spanContext(),s=this._idGenerator.generateSpanId();let a,l,c;!o||!ci.isSpanContextValid(o)?l=this._idGenerator.generateTraceId():(l=o.traceId,c=o.traceState,a=o);const u=r.kind??VC.INTERNAL,d=(r.links??[]).map(v=>({context:v.context,attributes:Ay(v.attributes)})),p=Ay(r.attributes),h=this._sampler.shouldSample(n,l,e,u,p,d);c=h.traceState??c;const m=h.decision===fb.RECORD_AND_SAMPLED?$a.SAMPLED:$a.NONE,g={traceId:l,spanId:s,traceFlags:m,traceState:c};if(h.decision===fb.NOT_RECORD)return Lt.debug("Recording is off, propagating context in a non-recording span"),ci.wrapSpanContext(g);const O=Ay(Object.assign(p,h.attributes));return new ywe({resource:this._resource,scope:this.instrumentationScope,context:n,spanContext:g,name:e,kind:u,links:d,parentSpanContext:a,attributes:O,startTime:r.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits})}startActiveSpan(e,r,n,i){let o,s,a;if(arguments.length<2)return;arguments.length===2?a=r:arguments.length===3?(o=r,a=n):(o=r,s=n,a=i);const l=s??ga.active(),c=this.startSpan(e,o,l),u=ci.setSpan(l,c);return ga.with(u,a,void 0,c)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}}class Ewe{_spanProcessors;constructor(e){this._spanProcessors=e}forceFlush(){const e=[];for(const r of this._spanProcessors)e.push(r.forceFlush());return new Promise(r=>{Promise.all(e).then(()=>{r()}).catch(n=>{Dd(n||new Error("MultiSpanProcessor: forceFlush failed")),r()})})}onStart(e,r){for(const n of this._spanProcessors)n.onStart(e,r)}onEnd(e){for(const r of this._spanProcessors)r.onEnd(e)}shutdown(){const e=[];for(const r of this._spanProcessors)e.push(r.shutdown());return new Promise((r,n)=>{Promise.all(e).then(()=>{r()},n)})}}var pc;(function(t){t[t.resolved=0]="resolved",t[t.timeout=1]="timeout",t[t.error=2]="error",t[t.unresolved=3]="unresolved"})(pc||(pc={}));class Awe{_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(e={}){const r=dwe({},N6(),Swe(e));this._resource=r.resource??mwe(),this._config=Object.assign({},r,{resource:this._resource});const n=[];e.spanProcessors?.length&&n.push(...e.spanProcessors),this._activeSpanProcessor=new Ewe(n)}getTracer(e,r,n){const i=`${e}@${r||""}:${n?.schemaUrl||""}`;return this._tracers.has(i)||this._tracers.set(i,new Twe({name:e,version:r,schemaUrl:n?.schemaUrl},this._config,this._resource,this._activeSpanProcessor)),this._tracers.get(i)}forceFlush(){const e=this._config.forceFlushTimeoutMillis,r=this._activeSpanProcessor._spanProcessors.map(n=>new Promise(i=>{let o;const s=setTimeout(()=>{i(new Error(`Span processor did not completed within timeout period of ${e} ms`)),o=pc.timeout},e);n.forceFlush().then(()=>{clearTimeout(s),o!==pc.timeout&&(o=pc.resolved,i(o))}).catch(a=>{clearTimeout(s),o=pc.error,i(a)})}));return new Promise((n,i)=>{Promise.all(r).then(o=>{const s=o.filter(a=>a!==pc.resolved);s.length>0?i(s):n()}).catch(o=>i([o]))})}shutdown(){return this._activeSpanProcessor.shutdown()}}class Iwe{_enabled=!1;_currentContext=Uu;_bindFunction(e=Uu,r){const n=this,i=function(...o){return n.with(e,()=>r.apply(this,o))};return Object.defineProperty(i,"length",{enumerable:!1,configurable:!0,writable:!1,value:r.length}),i}active(){return this._currentContext}bind(e,r){return e===void 0&&(e=this.active()),typeof r=="function"?this._bindFunction(e,r):r}disable(){return this._currentContext=Uu,this._enabled=!1,this}enable(){return this._enabled?this:(this._enabled=!0,this._currentContext=Uu,this)}with(e,r,n,...i){const o=this._currentContext;this._currentContext=e||Uu;try{return r.call(n,...i)}finally{this._currentContext=o}}}function Rwe(t){if(t!==null){if(t===void 0){const e=new Iwe;e.enable(),ga.setGlobalContextManager(e);return}t.enable(),ga.setGlobalContextManager(t)}}function _we(t){if(t!==null){if(t===void 0){zp.setGlobalPropagator(new NSe({propagators:[new KSe,new vSe]}));return}zp.setGlobalPropagator(t)}}class jwe extends Awe{constructor(e={}){super(e)}register(e={}){ci.setGlobalTracerProvider(this),_we(e.propagator),Rwe(e.contextManager)}}class Qwe{_delegate;constructor(e){this._delegate=e}export(e,r){this._delegate.export(e,r)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}}class m5 extends Error{code;name="OTLPExporterError";data;constructor(e,r,n){super(e),this.data=n,this.code=r}}function Dwe(t){if(Number.isFinite(t)&&t>0)return t;throw new Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${t}')`)}function Nwe(t){if(t!=null)return()=>t}function Mwe(t,e,r){return{timeoutMillis:Dwe(t.timeoutMillis??e.timeoutMillis??r.timeoutMillis),concurrencyLimit:t.concurrencyLimit??e.concurrencyLimit??r.concurrencyLimit,compression:t.compression??e.compression??r.compression}}function qwe(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:"none"}}class zwe{_concurrencyLimit;_sendingPromises=[];constructor(e){this._concurrencyLimit=e}pushPromise(e){if(this.hasReachedLimit())throw new Error("Concurrency Limit reached");this._sendingPromises.push(e);const r=()=>{const n=this._sendingPromises.indexOf(e);this._sendingPromises.splice(n,1)};e.then(r,r)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}async awaitAll(){await Promise.all(this._sendingPromises)}}function Lwe(t){return new zwe(t.concurrencyLimit)}function Vwe(t){return Object.prototype.hasOwnProperty.call(t,"partialSuccess")}function Xwe(){return{handleResponse(t){t==null||!Vwe(t)||t.partialSuccess==null||Object.keys(t.partialSuccess).length===0||Lt.warn("Received Partial Success response:",JSON.stringify(t.partialSuccess))}}}class Wwe{_transport;_serializer;_responseHandler;_promiseQueue;_timeout;_diagLogger;constructor(e,r,n,i,o){this._transport=e,this._serializer=r,this._responseHandler=n,this._promiseQueue=i,this._timeout=o,this._diagLogger=Lt.createComponentLogger({namespace:"OTLPExportDelegate"})}export(e,r){if(this._diagLogger.debug("items to be sent",e),this._promiseQueue.hasReachedLimit()){r({code:cs.FAILED,error:new Error("Concurrent export limit reached")});return}const n=this._serializer.serializeRequest(e);if(n==null){r({code:cs.FAILED,error:new Error("Nothing to send")});return}this._promiseQueue.pushPromise(this._transport.send(n,this._timeout).then(i=>{if(i.status==="success"){if(i.data!=null)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(i.data))}catch(o){this._diagLogger.warn("Export succeeded but could not deserialize response - is the response specification compliant?",o,i.data)}r({code:cs.SUCCESS});return}else if(i.status==="failure"&&i.error){r({code:cs.FAILED,error:i.error});return}else i.status==="retryable"?r({code:cs.FAILED,error:new m5("Export failed with retryable status")}):r({code:cs.FAILED,error:new m5("Export failed with unknown error")})},i=>r({code:cs.FAILED,error:i})))}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug("shutdown started"),await this.forceFlush(),this._transport.shutdown()}}function Uwe(t,e){return new Wwe(t.transport,t.serializer,Xwe(),t.promiseHandler,e.timeout)}function q6(t,e,r){return Uwe({transport:r,serializer:e,promiseHandler:Lwe(t)},{timeout:t.timeoutMillis})}function O5(t){return t>=48&&t<=57?t-48:t>=97&&t<=102?t-87:t-55}function z6(t){const e=new Uint8Array(t.length/2);let r=0;for(let n=0;n<t.length;n+=2){const i=O5(t.charCodeAt(n)),o=O5(t.charCodeAt(n+1));e[r++]=i<<4|o}return e}function L6(t){const e=BigInt(1e9);return BigInt(t[0])*e+BigInt(t[1])}function Bwe(t){const e=Number(BigInt.asUintN(32,t)),r=Number(BigInt.asUintN(32,t>>BigInt(32)));return{low:e,high:r}}function Fwe(t){const e=L6(t);return Bwe(e)}function Zwe(t){return L6(t).toString()}const Ywe=typeof BigInt<"u"?Zwe:DSe;function y5(t){return t}function Gwe(t){if(t!==void 0)return z6(t)}const Hwe={encodeHrTime:Fwe,encodeSpanContext:z6,encodeOptionalSpanContext:Gwe};function Jwe(t){return t===void 0?Hwe:{encodeHrTime:Ywe,encodeSpanContext:y5,encodeOptionalSpanContext:y5}}function Kwe(t){return{attributes:xx(t.attributes),droppedAttributesCount:0}}function ePe(t){return{name:t.name,version:t.version}}function xx(t){return Object.keys(t).map(e=>V6(e,t[e]))}function V6(t,e){return{key:t,value:X6(e)}}function X6(t){const e=typeof t;return e==="string"?{stringValue:t}:e==="number"?Number.isInteger(t)?{intValue:t}:{doubleValue:t}:e==="boolean"?{boolValue:t}:t instanceof Uint8Array?{bytesValue:t}:Array.isArray(t)?{arrayValue:{values:t.map(X6)}}:e==="object"&&t!=null?{kvlistValue:{values:Object.entries(t).map(([r,n])=>V6(r,n))}}:{}}function tPe(t,e){const r=t.spanContext(),n=t.status,i=t.parentSpanContext?.spanId?e.encodeSpanContext(t.parentSpanContext?.spanId):void 0;return{traceId:e.encodeSpanContext(r.traceId),spanId:e.encodeSpanContext(r.spanId),parentSpanId:i,traceState:r.traceState?.serialize(),name:t.name,kind:t.kind==null?0:t.kind+1,startTimeUnixNano:e.encodeHrTime(t.startTime),endTimeUnixNano:e.encodeHrTime(t.endTime),attributes:xx(t.attributes),droppedAttributesCount:t.droppedAttributesCount,events:t.events.map(o=>nPe(o,e)),droppedEventsCount:t.droppedEventsCount,status:{code:n.code,message:n.message},links:t.links.map(o=>rPe(o,e)),droppedLinksCount:t.droppedLinksCount}}function rPe(t,e){return{attributes:t.attributes?xx(t.attributes):[],spanId:e.encodeSpanContext(t.context.spanId),traceId:e.encodeSpanContext(t.context.traceId),traceState:t.context.traceState?.serialize(),droppedAttributesCount:t.droppedAttributesCount||0}}function nPe(t,e){return{attributes:t.attributes?xx(t.attributes):[],name:t.name,timeUnixNano:e.encodeHrTime(t.time),droppedAttributesCount:t.droppedAttributesCount||0}}function iPe(t,e){const r=Jwe(e);return{resourceSpans:sPe(t,r)}}function oPe(t){const e=new Map;for(const r of t){let n=e.get(r.resource);n||(n=new Map,e.set(r.resource,n));const i=`${r.instrumentationScope.name}@${r.instrumentationScope.version||""}:${r.instrumentationScope.schemaUrl||""}`;let o=n.get(i);o||(o=[],n.set(i,o)),o.push(r)}return e}function sPe(t,e){const r=oPe(t),n=[],i=r.entries();let o=i.next();for(;!o.done;){const[s,a]=o.value,l=[],c=a.values();let u=c.next();for(;!u.done;){const p=u.value;if(p.length>0){const h=p.map(m=>tPe(m,e));l.push({scope:ePe(p[0].instrumentationScope),spans:h,schemaUrl:p[0].instrumentationScope.schemaUrl})}u=c.next()}const d={resource:Kwe(s),scopeSpans:l,schemaUrl:void 0};n.push(d),o=i.next()}return n}const aPe={serializeRequest:t=>{const e=iPe(t,{});return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:t=>{if(t.length===0)return{};const e=new TextDecoder;return JSON.parse(e.decode(t))}},lPe=5,cPe=1e3,uPe=5e3,dPe=1.5,v5=.2;function fPe(){return Math.random()*(2*v5)-v5}class pPe{_transport;constructor(e){this._transport=e}retry(e,r,n){return new Promise((i,o)=>{setTimeout(()=>{this._transport.send(e,r).then(i,o)},n)})}async send(e,r){const n=Date.now()+r;let i=await this._transport.send(e,r),o=lPe,s=cPe;for(;i.status==="retryable"&&o>0;){o--;const a=Math.max(Math.min(s,uPe)+fPe(),0);s=s*dPe;const l=i.retryInMillis??a,c=n-Date.now();if(l>c)return i;i=await this.retry(e,c,l)}return i}shutdown(){return this._transport.shutdown()}}function W6(t){return new pPe(t.transport)}function hPe(t){return[429,502,503,504].includes(t)}function gPe(t){if(t==null)return;const e=Number.parseInt(t,10);if(Number.isInteger(e))return e>0?e*1e3:-1;const r=new Date(t).getTime()-Date.now();return r>=0?r:0}class mPe{_parameters;constructor(e){this._parameters=e}send(e,r){return new Promise(n=>{const i=new XMLHttpRequest;i.timeout=r,i.open("POST",this._parameters.url);const o=this._parameters.headers();Object.entries(o).forEach(([s,a])=>{i.setRequestHeader(s,a)}),i.ontimeout=s=>{n({status:"failure",error:new Error("XHR request timed out")})},i.onreadystatechange=()=>{i.status>=200&&i.status<=299?(Lt.debug("XHR success"),n({status:"success"})):i.status&&hPe(i.status)?n({status:"retryable",retryInMillis:gPe(i.getResponseHeader("Retry-After"))}):i.status!==0&&n({status:"failure",error:new Error("XHR request failed with non-retryable status")})},i.onabort=()=>{n({status:"failure",error:new Error("XHR request aborted")})},i.onerror=()=>{n({status:"failure",error:new Error("XHR request errored")})},i.send(e)})}shutdown(){}}function OPe(t){return new mPe(t)}class yPe{_params;constructor(e){this._params=e}send(e){return new Promise(r=>{navigator.sendBeacon(this._params.url,new Blob([e],{type:this._params.blobType}))?(Lt.debug("SendBeacon success"),r({status:"success"})):r({status:"failure",error:new Error("SendBeacon failed")})})}shutdown(){}}function vPe(t){return new yPe(t)}function bPe(t,e){return q6(t,e,W6({transport:OPe(t)}))}function xPe(t,e){return q6(t,e,W6({transport:vPe({url:t.url,blobType:t.headers()["Content-Type"]})}))}function SPe(t){return()=>{const e={};return Object.entries(t?.()??{}).forEach(([r,n])=>{typeof n<"u"?e[r]=String(n):Lt.warn(`Header "${r}" has invalid value (${n}) and will be ignored`)}),e}}function wPe(t,e,r){const n={...r()},i={};return()=>(e!=null&&Object.assign(i,e()),t!=null&&Object.assign(i,t()),Object.assign(i,n))}function PPe(t){if(t!=null)try{return new URL(t),t}catch{throw new Error(`Configuration: Could not parse user-provided export URL: '${t}'`)}}function CPe(t,e,r){return{...Mwe(t,e,r),headers:wPe(SPe(t.headers),e.headers,r.headers),url:PPe(t.url)??e.url??r.url,agentOptions:t.agentOptions??e.agentOptions??r.agentOptions}}function $Pe(t,e){return{...qwe(),headers:()=>t,url:"http://localhost:4318/"+e,agentOptions:{keepAlive:!0}}}function kPe(t,e,r){return CPe({url:t.url,timeoutMillis:t.timeoutMillis,headers:Nwe(t.headers),concurrencyLimit:t.concurrencyLimit},{},$Pe(r,e))}function TPe(t,e,r,n){const i=!!t.headers||typeof navigator.sendBeacon!="function",o=kPe(t,r,n);return i?bPe(o,e):xPe(o,e)}class EPe extends Qwe{constructor(e={}){super(TPe(e,aPe,"v1/traces",{"Content-Type":"application/json"}))}}const APe="service.name",IPe="service.version";class U6{emit(e){}}const RPe=new U6;class _Pe{getLogger(e,r,n){return new U6}}const B6=new _Pe;class jPe{constructor(e,r,n,i){this._provider=e,this.name=r,this.version=n,this.options=i}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):RPe}}class b5{getLogger(e,r,n){var i;return(i=this.getDelegateLogger(e,r,n))!==null&&i!==void 0?i:new jPe(this,e,r,n)}getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:B6}setDelegate(e){this._delegate=e}getDelegateLogger(e,r,n){var i;return(i=this._delegate)===null||i===void 0?void 0:i.getLogger(e,r,n)}}const QPe=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{},SO=Symbol.for("io.opentelemetry.js.api.logs"),Jf=QPe;function DPe(t,e,r){return n=>n===t?e:r}const x5=1;class AE{constructor(){this._proxyLoggerProvider=new b5}static getInstance(){return this._instance||(this._instance=new AE),this._instance}setGlobalLoggerProvider(e){return Jf[SO]?this.getLoggerProvider():(Jf[SO]=DPe(x5,e,B6),this._proxyLoggerProvider.setDelegate(e),e)}getLoggerProvider(){var e,r;return(r=(e=Jf[SO])===null||e===void 0?void 0:e.call(Jf,x5))!==null&&r!==void 0?r:this._proxyLoggerProvider}getLogger(e,r,n){return this.getLoggerProvider().getLogger(e,r,n)}disable(){delete Jf[SO],this._proxyLoggerProvider=new b5}}const F6=AE.getInstance();function NPe(t,e,r,n){for(let i=0,o=t.length;i<o;i++){const s=t[i];e&&s.setTracerProvider(e),r&&s.setMeterProvider(r),n&&s.setLoggerProvider&&s.setLoggerProvider(n),s.getConfig().enabled||s.enable()}}function MPe(t){t.forEach(e=>e.disable())}function qPe(t){const e=t.tracerProvider||ci.getTracerProvider(),r=t.meterProvider||S6.getMeterProvider(),n=t.loggerProvider||F6.getLoggerProvider(),i=t.instrumentations?.flat()??[];return NPe(i,e,r,n),()=>{MPe(i)}}let Ni=console.error.bind(console);function Kf(t,e,r){const n=!!t[e]&&Object.prototype.propertyIsEnumerable.call(t,e);Object.defineProperty(t,e,{configurable:!0,enumerable:n,writable:!0,value:r})}const Z6=(t,e,r)=>{if(!t||!t[e]){Ni("no original function "+String(e)+" to wrap");return}if(!r){Ni("no wrapper function"),Ni(new Error().stack);return}const n=t[e];if(typeof n!="function"||typeof r!="function"){Ni("original object and wrapper must be functions");return}const i=r(n,e);return Kf(i,"__original",n),Kf(i,"__unwrap",()=>{t[e]===i&&Kf(t,e,n)}),Kf(i,"__wrapped",!0),Kf(t,e,i),i},zPe=(t,e,r)=>{if(t)Array.isArray(t)||(t=[t]);else{Ni("must provide one or more modules to patch"),Ni(new Error().stack);return}if(!(e&&Array.isArray(e))){Ni("must provide one or more functions to wrap on modules");return}t.forEach(n=>{e.forEach(i=>{Z6(n,i,r)})})},Y6=(t,e)=>{if(!t||!t[e]){Ni("no function to unwrap."),Ni(new Error().stack);return}const r=t[e];if(!r.__unwrap)Ni("no original to unwrap to -- has "+String(e)+" already been unwrapped?");else{r.__unwrap();return}},LPe=(t,e)=>{if(t)Array.isArray(t)||(t=[t]);else{Ni("must provide one or more modules to patch"),Ni(new Error().stack);return}if(!(e&&Array.isArray(e))){Ni("must provide one or more functions to unwrap on modules");return}t.forEach(r=>{e.forEach(n=>{Y6(r,n)})})};class VPe{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(e,r,n){this.instrumentationName=e,this.instrumentationVersion=r,this.setConfig(n),this._diag=Lt.createComponentLogger({namespace:e}),this._tracer=ci.getTracer(e,r),this._meter=S6.getMeter(e,r),this._logger=F6.getLogger(e,r),this._updateMetricInstruments()}_wrap=Z6;_unwrap=Y6;_massWrap=zPe;_massUnwrap=LPe;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,r,n,i){if(e)try{e(n,i)}catch(o){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:r},o)}}}class XPe extends VPe{constructor(e,r,n){super(e,r,n),this._config.enabled&&this.enable()}}class WPe{span=void 0;constructor(e){this.span=e}get context(){return this.span?.context}error(e){this.span&&(this.span.setStatus(exports.SpanStatusCode.ERROR,e.message),this.span.recordException(e),this.span.end())}setAttribute(e,r){this.span&&this.span.setAttribute(e,r)}end(){this.span&&(this.span.setStatus(exports.SpanStatusCode.OK),this.span.end())}}class UPe{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 r=e.time?new Date(e.time):new Date;this.tracer.startSpan(`event.${e.type}`,{attributes:this.processAttributes(e,r),startTime:r}).end(r)}catch(r){this.config?.isProd||console.error("Event reporting failed:",r)}}processAttributes(e,r){const i={"cloudevents.event_id":db(),"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":r.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"&&!Array.isArray(e.data))for(const[o,s]of Object.entries(e.data)){const a=o.replace(/([A-Z])/g,"_$1").toLowerCase();if(s!==void 0)if(typeof s=="object"&&s!==null&&!Array.isArray(s))for(const[l,c]of Object.entries(s))c!==void 0&&(i[`cloudevents.event_data.${a}.${l}`]=c);else i[`cloudevents.event_data.${a}`]=s}if(e.data&&Array.isArray(e.data)){if(e.data.some(s=>s&&typeof s=="object"&&"object"in s)){const s=[],a=[];for(const l of e.data){if(!l||typeof l!="object")continue;const c=l.object;if(!c||typeof c!="string")continue;const u=l,d=a.find(p=>p.object===c);if(d){s.push(d,u);const p=a.indexOf(d);a.splice(p,1)}else s.some(h=>h.object===c)||a.push(u)}for(let l=0;l<s.length;l++){const c=s[l],u=l===0?"after.":"before.",d=`${c.object}.`;for(const[p,h]of Object.entries(c))if(h!==void 0){const m=p.replace(/([A-Z])/g,"_$1").toLowerCase();i[`cloudevents.event_data.${u}${d}${m}`]=h}}for(const l of a){const c=`${l.object}.`;for(const[u,d]of Object.entries(l))if(d!==void 0){const p=u.replace(/([A-Z])/g,"_$1").toLowerCase();i[`cloudevents.event_data.${c}${p}`]=d}}}else for(const s of e.data)if(s&&typeof s=="object"){for(const[a,l]of Object.entries(s))if(l!==void 0){const c=a.replace(/([A-Z])/g,"_$1").toLowerCase();if(l!==null&&typeof l=="object"&&!Array.isArray(l)){for(const[u,d]of Object.entries(l))if(d!=null&&typeof d!="object"){const p=u.replace(/([A-Z])/g,"_$1").toLowerCase();i[`cloudevents.event_data.${c}.${p}`]=d}}else i[`cloudevents.event_data.${c}`]=l}}}if("subjects"in e&&Array.isArray(e.subjects)){const o=e.subjects.reduce((s,a)=>{if(!a||typeof a!="object")return s;const l=a.object;if(!l||typeof l!="string")return s;const c=s.notUpdated.find(({object:u})=>u===l);return c?(s.updated=[c,a],s.notUpdated=s.notUpdated.filter(({object:u})=>u!==l)):s.updated.some(({object:u})=>u===l)||s.notUpdated.push(a),s},{updated:[],notUpdated:[]});o.updated.forEach((s,a)=>{const l=a===0?"after.":"before.",c=`${s.object}.`;Object.entries(s).forEach(([u,d])=>{d!==void 0&&(i[`cloudevents.subjects.${l}${c}${u}`]=d)})}),o.notUpdated.forEach(s=>{const a=`${s.object}.`;Object.entries(s).forEach(([l,c])=>{c!==void 0&&(i[`cloudevents.subjects.${a}${l}`]=c)})})}return Object.entries(e).forEach(([o,s])=>{["id","source","type","specversion","time","datacontenttype","data","subject","sourceDetails","analyticsMetadata","context"].includes(o)||s!==void 0&&(s instanceof Object?Object.entries(s).forEach(([a,l])=>{l!==void 0&&(i[`cloudevents.${o}.${a}`]=l)}):i[`cloudevents.${o}`]=s)}),i}startSpan(e,r){try{if(!this.tracer)return;let n;const i=e.time?new Date(e.time):new Date,o=this.tracer.startSpan(`event.${e.type}`,{attributes:this.processAttributes(e,i),root:!r},r);return r||(n=ci.setSpan(ga.active(),o)),{end:()=>o.end(),setAttribute:(s,a)=>{o.setAttribute(`cloudevents.event_data.${this.getKeySnakeValue(s)}`,a)},setStatus:(s,a)=>o.setStatus({code:s,message:a}),parentCtx:n}}catch(n){this.config?.isProd||console.error("Event reporting failed:",n);return}}startStepSpan(e){try{if(!this.tracer)return;const r=ga.active(),n=e.time?new Date(e.time):new Date,i=this.tracer.startSpan(`event.${e.type}`,{attributes:this.processAttributes(e,n)},r),o=ci.setSpan(r,i);return{end:()=>i.end(),setAttribute:(s,a)=>{i.setAttribute(`cloudevents.event_data.${this.getKeySnakeValue(s)}`,a)},setStatus:(s,a)=>i.setStatus({code:s,message:a}),recordException:s=>i.recordException(s),context:o}}catch(r){this.config?.isProd||console.error("Event reporting failed:",r);return}}traceStep(e){const r=this.startStepSpan(e);if(r)return new WPe(r)}async forceFlush(){return this.tracerProvider?.forceFlush()}async shutdown(){return this.tracerProvider?.shutdown()}getKeySnakeValue=e=>e.replace(/([A-Z])/g,"_$1").toLowerCase()}class BPe extends UPe{tracerProvider=null;tracer=null;initialized=!1;constructor(){super()}initTracer(e){if(!e.collectorUrl&&!e.collectorTraceUrl)return;const r=`ses_${db()}`,n=D6({[APe]:e.serviceName,[IPe]:e.serviceVersion,session_id:r}),i=e.collectorTraceUrl||`${e.collectorUrl}/v1/traces`;this.tracerProvider=new jwe({resource:n,spanProcessors:[new Pwe(new EPe({url:i,headers:{}}))]}),this.tracer=this.tracerProvider.getTracer(e.tracerName),this.tracerProvider.register(),qPe({instrumentations:e.instrumentations??[]}),this.initialized=!0}}class ua extends XPe{sendErrorEvent;originalConsoleError;constructor(e,r){super("errors","1.0",e||{}),this.sendErrorEvent=r}static toErrorEvent(e,r){return{type:"error",payload:[{handler:r,errorType:ua.getErrorType(e),message:ua.getErrorMessage(e),stack:ua.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 r=String(e.stack);return r.length>4096?r.substring(0,4096):r}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 r=e.findIndex(i=>i instanceof Error),n=e.filter((i,o)=>o!==r).map(i=>String(i)).join(" ");if(r===-1)return n;{const i=e[r];return n&&(i.message=`${i.message} ${n}`),i}}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 r=ua.combineConsoleErrorArgs(e);this.sendError(r,"console.error")}catch(r){process.env.NODE_ENV!=="production"&&this.originalConsoleError?.call(console,"Error reporting failed:",r)}this.originalConsoleError?.apply(console,e)}}unwrapConsoleError(){this.originalConsoleError&&(console.error=this.originalConsoleError,this.originalConsoleError=void 0)}sendError(e,r){this.sendErrorEvent(ua.toErrorEvent(e,r))}}class FPe{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 BPe,this.tracer={traceStep:(e,r)=>{const n=this.constructCloudEvent(e,r);return this.otelClient.traceStep(n)}}}updateCloudEventData=e=>{this.config?.disabled||(this.useCloudEventData=e)};send(e,r){try{if(!this.config?.otel.isProd)return;const n=this.constructCloudEvent(e,r);this.sendToOtelService(n)}catch(n){this.config?.otel.isProd||console.error("Event reporting failed:",n)}}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 ua(void 0,r=>{this.sendErrorMessage(r.payload)})]:[],...e.otel.instrumentations||[]]}))}startSpan(e,r,n){if(this.config?.disabled)return;const i=this.constructCloudEvent(e,r);return this.otelClient.startSpan(i,n)}constructCloudEvent(e,r){const n=this.useCloudEventData();return{id:`evt_${db()}`,type:e,source:n.request.source||"",specversion:"1.0",datacontenttype:"application/json",time:new Date().toISOString(),data:r,origin:n.origin||"ui",sourceDetails:{id:n.sourceDetails.user||`usr_${db()}`,object:n.sourceDetails.object||"user",uri:n.sourceDetails.uri||""},organization:n.organization,project:n.project,productType:n.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,r){this.config?.disabled||this.send(ua.toErrorEvent(e,r).type,ua.toErrorEvent(e,r).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)}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)}sendStorageReadMessage(){this.send("storage.read")}sendStorageLoadUserStateMessage(){this.send("storage.loadUserState")}sendStorageDetectFilesMessage(){this.send("storage.detectFiles")}sendStorageLoadApisMessage(){this.send("storage.loadApis")}sendStorageParseApisMessage(){this.send("storage.parseApis")}sendStorageParseCollectionsMessage(){this.send("storage.parseCollections")}sendUpdaterCheckMessage(){this.send("updater.check")}sendUpdaterDownloadMessage(){this.send("updater.download")}sendUpdaterInstallMessage(){this.send("updater.install")}sendUpdaterProcessMessage(){this.send("updater.process")}sendErrorMessage(e){this.send("error",e)}sendCodeEditorSearchMessage(e){this.send("code_editor.search",e)}}const Sx=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],ZPe="https://cors.redocly.com/";function YPe(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function S5(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function w5(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?S5(Object(r),!0).forEach(function(n){YPe(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):S5(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function yn(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var P5=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),aw=function(){return Math.random().toString(36).substring(7).split("").join(".")},wl={INIT:"@@redux/INIT"+aw(),REPLACE:"@@redux/REPLACE"+aw(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+aw()}};function G6(t){if(typeof t!="object"||t===null)return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function GPe(t){if(t===void 0)return"undefined";if(t===null)return"null";var e=typeof t;switch(e){case"boolean":case"string":case"number":case"symbol":case"function":return e}if(Array.isArray(t))return"array";if(KPe(t))return"date";if(JPe(t))return"error";var r=HPe(t);switch(r){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return r}return e.slice(8,-1).toLowerCase().replace(/\s/g,"")}function HPe(t){return typeof t.constructor=="function"?t.constructor.name:null}function JPe(t){return t instanceof Error||typeof t.message=="string"&&t.constructor&&typeof t.constructor.stackTraceLimit=="number"}function KPe(t){return t instanceof Date?!0:typeof t.toDateString=="function"&&typeof t.getDate=="function"&&typeof t.setDate=="function"}function il(t){var e=typeof t;return process.env.NODE_ENV!=="production"&&(e=GPe(t)),e}function wx(t,e,r){var n;if(typeof e=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?yn(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 r>"u"&&(r=e,e=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?yn(1):"Expected the enhancer to be a function. Instead, received: '"+il(r)+"'");return r(wx)(t,e)}if(typeof t!="function")throw new Error(process.env.NODE_ENV==="production"?yn(2):"Expected the root reducer to be a function. Instead, received: '"+il(t)+"'");var i=t,o=e,s=[],a=s,l=!1;function c(){a===s&&(a=s.slice())}function u(){if(l)throw new Error(process.env.NODE_ENV==="production"?yn(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 o}function d(g){if(typeof g!="function")throw new Error(process.env.NODE_ENV==="production"?yn(4):"Expected the listener to be a function. Instead, received: '"+il(g)+"'");if(l)throw new Error(process.env.NODE_ENV==="production"?yn(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 O=!0;return c(),a.push(g),function(){if(O){if(l)throw new Error(process.env.NODE_ENV==="production"?yn(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.");O=!1,c();var v=a.indexOf(g);a.splice(v,1),s=null}}}function p(g){if(!G6(g))throw new Error(process.env.NODE_ENV==="production"?yn(7):"Actions must be plain objects. Instead, the actual type was: '"+il(g)+"'. 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 g.type>"u")throw new Error(process.env.NODE_ENV==="production"?yn(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(l)throw new Error(process.env.NODE_ENV==="production"?yn(9):"Reducers may not dispatch actions.");try{l=!0,o=i(o,g)}finally{l=!1}for(var O=s=a,y=0;y<O.length;y++){var v=O[y];v()}return g}function h(g){if(typeof g!="function")throw new Error(process.env.NODE_ENV==="production"?yn(10):"Expected the nextReducer to be a function. Instead, received: '"+il(g));i=g,p({type:wl.REPLACE})}function m(){var g,O=d;return g={subscribe:function(v){if(typeof v!="object"||v===null)throw new Error(process.env.NODE_ENV==="production"?yn(11):"Expected the observer to be an object. Instead, received: '"+il(v)+"'");function b(){v.next&&v.next(u())}b();var w=O(b);return{unsubscribe:w}}},g[P5]=function(){return this},g}return p({type:wl.INIT}),n={dispatch:p,subscribe:d,getState:u,replaceReducer:h},n[P5]=m,n}var eCe=wx;function YC(t){typeof console<"u"&&typeof console.error=="function"&&console.error(t);try{throw new Error(t)}catch{}}function tCe(t,e,r,n){var i=Object.keys(e),o=r&&r.type===wl.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(i.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(!G6(t))return"The "+o+' has unexpected type of "'+il(t)+'". Expected argument to be an object with the following '+('keys: "'+i.join('", "')+'"');var s=Object.keys(t).filter(function(a){return!e.hasOwnProperty(a)&&!n[a]});if(s.forEach(function(a){n[a]=!0}),!(r&&r.type===wl.REPLACE)&&s.length>0)return"Unexpected "+(s.length>1?"keys":"key")+" "+('"'+s.join('", "')+'" found in '+o+". ")+"Expected to find one of the known reducer keys instead: "+('"'+i.join('", "')+'". Unexpected keys will be ignored.')}function rCe(t){Object.keys(t).forEach(function(e){var r=t[e],n=r(void 0,{type:wl.INIT});if(typeof n>"u")throw new Error(process.env.NODE_ENV==="production"?yn(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 r(void 0,{type:wl.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?yn(13):'The slice reducer for key "'+e+'" returned undefined when probed with a random type. '+("Don't try to handle '"+wl.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 nCe(t){for(var e=Object.keys(t),r={},n=0;n<e.length;n++){var i=e[n];process.env.NODE_ENV!=="production"&&typeof t[i]>"u"&&YC('No reducer provided for key "'+i+'"'),typeof t[i]=="function"&&(r[i]=t[i])}var o=Object.keys(r),s;process.env.NODE_ENV!=="production"&&(s={});var a;try{rCe(r)}catch(l){a=l}return function(c,u){if(c===void 0&&(c={}),a)throw a;if(process.env.NODE_ENV!=="production"){var d=tCe(c,r,u,s);d&&YC(d)}for(var p=!1,h={},m=0;m<o.length;m++){var g=o[m],O=r[g],y=c[g],v=O(y,u);if(typeof v>"u"){var b=u&&u.type;throw new Error(process.env.NODE_ENV==="production"?yn(14):"When called with an action of type "+(b?'"'+String(b)+'"':"(unknown type)")+', the slice reducer for key "'+g+'" 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.')}h[g]=v,p=p||v!==y}return p=p||o.length!==Object.keys(c).length,p?h:c}}function C5(t,e){return function(){return e(t.apply(this,arguments))}}function iCe(t,e){if(typeof t=="function")return C5(t,e);if(typeof t!="object"||t===null)throw new Error(process.env.NODE_ENV==="production"?yn(16):"bindActionCreators expected an object or a function, but instead received: '"+il(t)+`'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?`);var r={};for(var n in t){var i=t[n];typeof i=="function"&&(r[n]=C5(i,e))}return r}function H6(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return e.length===0?function(n){return n}:e.length===1?e[0]:e.reduce(function(n,i){return function(){return n(i.apply(void 0,arguments))}})}function oCe(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return function(n){return function(){var i=n.apply(void 0,arguments),o=function(){throw new Error(process.env.NODE_ENV==="production"?yn(15):"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},s={getState:i.getState,dispatch:function(){return o.apply(void 0,arguments)}},a=e.map(function(l){return l(s)});return o=H6.apply(void 0,a)(i.dispatch),w5(w5({},i),{},{dispatch:o})}}}function $5(){}process.env.NODE_ENV!=="production"&&typeof $5.name=="string"&&$5.name!=="isCrushed"&&YC('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 sCe=Object.freeze({__proto__:null,__DO_NOT_USE__ActionTypes:wl,applyMiddleware:oCe,bindActionCreators:iCe,combineReducers:nCe,compose:H6,createStore:wx,legacy_createStore:eCe});function aCe(t){var e=t.default;if(typeof e=="function"){var r=function(){return e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var lCe=aCe(sCe);lCe.compose;var cCe=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(t){return t}};function uCe(t,e,r){var n=!1,i=!1,o=wx(function(a,l){if(!i){var c=function(O){return Array.isArray(O)&&O.findIndex(function(y){return typeof y!="string"&&typeof y!="number"})===-1};if(l.type.startsWith("SET")){var u=function(O){try{n=!0,"value"in l?O.set(l.value):O.set(pt)}finally{n=!1}};if(l.path){if(c(l.path)){l.path.length===0&&u(t);for(var d=t,p=!0,h=0,m=l.path;h<m.length;h++){var g=m[h];d[g]?d=d[g]:p=!1}p&&u(d)}}else u(t)}else l.type==="BREAKPOINT"&&r()}return t.promised||t.error?pt:t.get({noproxy:!0})},cCe({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}})),s=function(a,l){if(n)l&&l();else try{i=!0,o.dispatch(a)}finally{i=!1}};return s}function dCe(t){return function(){var e,r,n=!1;return{onInit:function(i,o){if(!(typeof window>"u"||!("__REDUX_DEVTOOLS_EXTENSION__"in window))){if(t?.key===void 0){if(o.identifier===void 0)throw Error("State is missing Identifiable extension or Devtools key option");e=o.identifier(i)}else e=t.key;r=uCe(i,e,function(){n=!n}),i.promise||r?.({type:"CREATE",state:i.get({noproxy:!0,stealth:!0})})}},onSet:function(i,o){if(r?.({type:"SET [".concat(i.path.join("/"),"]"),state:i.get({noproxy:!0,stealth:!0}),descriptor:o}),n)debugger},onDestroy:function(){r?.({type:"DESTROY"})}}}}var Mt=(t=>(t.Normal="Normal",t.Edit="Edit",t.Draft="Draft",t))(Mt||{});const Cg="default",J6=[{name:Cg,inputs:[],servers:[],state:Mt.Normal}],K6={activeTabIdx:0,tabs:[]};var as=(t=>(t.Idle="idle",t.Loading="loading",t.Success="success",t.Error="error",t))(as||{});function ma(t){const e=new WeakMap;function r(n){if(typeof n!="object"||n===null)return n;if(e.has(n))return e.get(n);const i=Array.isArray(n)?[]:{};e.set(n,i);for(const o in n)Object.prototype.hasOwnProperty.call(n,o)&&(i[o]=r(n[o]));return i}return r(t)}function GC(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(!GC(t[i],e[i]))return!1;return!0}const r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(let i=0;i<r.length;i++){const o=r[i];if(!Object.prototype.hasOwnProperty.call(e,o)||!GC(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function k5(t){return Object.keys(t).forEach(e=>{t[e]===void 0&&delete t[e]}),t}function Da(){return!!window?.__TAURI__}async function Na(t,e={},r){return window.__TAURI_INTERNALS__.invoke(t,e,r)}async function T5(t,e,r){const n=[],i=[];for(const o of t){const s=Promise.resolve().then(()=>r(o,t));if(n.push(s),e<=t.length){const a=s.then(()=>i.splice(i.indexOf(a),1));i.push(a),i.length>=e&&await Promise.race(i)}}return Promise.all(n)}const Hn={FS:"fs",WEB:"web"};async function Ll(t,e={},r){return window.__TAURI_INTERNALS__.invoke(t,e,r)}var HC;(function(t){t[t.Audio=1]="Audio",t[t.Cache=2]="Cache",t[t.Config=3]="Config",t[t.Data=4]="Data",t[t.LocalData=5]="LocalData",t[t.Document=6]="Document",t[t.Download=7]="Download",t[t.Picture=8]="Picture",t[t.Public=9]="Public",t[t.Video=10]="Video",t[t.Resource=11]="Resource",t[t.Temp=12]="Temp",t[t.AppConfig=13]="AppConfig",t[t.AppData=14]="AppData",t[t.AppLocalData=15]="AppLocalData",t[t.AppCache=16]="AppCache",t[t.AppLog=17]="AppLog",t[t.Desktop=18]="Desktop",t[t.Executable=19]="Executable",t[t.Font=20]="Font",t[t.Home=21]="Home",t[t.Runtime=22]="Runtime",t[t.Template=23]="Template"})(HC||(HC={}));var JC;(function(t){t[t.Start=0]="Start",t[t.Current=1]="Current",t[t.End=2]="End"})(JC||(JC={}));async function KC(t,e){if(t instanceof URL&&t.protocol!=="file:")throw new TypeError("Must be a file URL.");await Ll("plugin:fs|mkdir",{path:t instanceof URL?t.toString():t,options:e})}async function IE(t,e){if(t instanceof URL&&t.protocol!=="file:")throw new TypeError("Must be a file URL.");return await Ll("plugin:fs|read_dir",{path:t instanceof URL?t.toString():t,options:e})}async function eU(t,e){if(t instanceof URL&&t.protocol!=="file:")throw new TypeError("Must be a file URL.");const r=await Ll("plugin:fs|read_file",{path:t instanceof URL?t.toString():t,options:e});return r instanceof ArrayBuffer?new Uint8Array(r):Uint8Array.from(r)}async function Px(t,e){if(t instanceof URL&&t.protocol!=="file:")throw new TypeError("Must be a file URL.");return await Ll("plugin:fs|read_text_file",{path:t instanceof URL?t.toString():t,options:e})}async function tU(t,e){if(t instanceof URL&&t.protocol!=="file:")throw new TypeError("Must be a file URL.");await Ll("plugin:fs|remove",{path:t instanceof URL?t.toString():t,options:e})}async function rU(t,e,r){if(t instanceof URL&&t.protocol!=="file:")throw new TypeError("Must be a file URL.");await Ll("plugin:fs|write_text_file",{path:t instanceof URL?t.toString():t,data:e,options:r})}async function RE(t,e){if(t instanceof URL&&t.protocol!=="file:")throw new TypeError("Must be a file URL.");return await Ll("plugin:fs|exists",{path:t instanceof URL?t.toString():t,options:e})}const fCe=Object.freeze(Object.defineProperty({__proto__:null,get BaseDirectory(){return HC},get SeekMode(){return JC},exists:RE,mkdir:KC,readDir:IE,readFile:eU,readTextFile:Px,remove:tU,writeTextFile:rU},Symbol.toStringTag,{value:"Module"}));var Ih;(function(t){t[t.Audio=1]="Audio",t[t.Cache=2]="Cache",t[t.Config=3]="Config",t[t.Data=4]="Data",t[t.LocalData=5]="LocalData",t[t.Document=6]="Document",t[t.Download=7]="Download",t[t.Picture=8]="Picture",t[t.Public=9]="Public",t[t.Video=10]="Video",t[t.Resource=11]="Resource",t[t.Temp=12]="Temp",t[t.AppConfig=13]="AppConfig",t[t.AppData=14]="AppData",t[t.AppLocalData=15]="AppLocalData",t[t.AppCache=16]="AppCache",t[t.AppLog=17]="AppLog",t[t.Desktop=18]="Desktop",t[t.Executable=19]="Executable",t[t.Font=20]="Font",t[t.Home=21]="Home",t[t.Runtime=22]="Runtime",t[t.Template=23]="Template"})(Ih||(Ih={}));async function nU(){return Na("plugin:path|resolve_directory",{directory:Ih.AppData})}async function iU(){return Na("plugin:path|resolve_directory",{directory:Ih.Desktop})}function _E(){return window.__TAURI_INTERNALS__.plugins.path.sep}async function oU(...t){return Na("plugin:path|resolve",{paths:t})}async function hd(...t){return Na("plugin:path|join",{paths:t})}async function sU(t){return Na("plugin:path|dirname",{path:t})}async function aU(t){return Na("plugin:path|extname",{path:t})}async function jE(t,e){return Na("plugin:path|basename",{path:t,ext:e})}async function lU(t){return Na("plugin:path|is_absolute",{path:t})}const pCe=Object.freeze(Object.defineProperty({__proto__:null,get BaseDirectory(){return Ih},appDataDir:nU,basename:jE,desktopDir:iU,dirname:sU,extname:aU,isAbsolute:lU,join:hd,resolve:oU,sep:_E},Symbol.toStringTag,{value:"Module"}));class or{static utils=null;static async getUtils(){return or.utils||(or.utils=Da()?await Promise.resolve().then(()=>require("./replay-tauri-path-BvTn_QQ4.js")):await Promise.resolve().then(()=>ire)),or.utils}static async dirname(e){return(await or.getUtils()).dirname(e)}static async join(...e){return(await or.getUtils()).join(...e)}static async resolve(e){return(await or.getUtils()).resolve(e)}static async isAbsolute(e){return(await or.getUtils()).isAbsolute(e)}static async relative(e,r){return(await or.getUtils()).relative(e,r)}static async extname(e){return(await or.getUtils()).extname(e)}}const hCe=new Set(["node_modules"]);class E5{constructor(e){this.baseDir=e,this.initializeDirectory(e)}async initializeDirectory(e){await KC(e,{recursive:!0})}async ls(e){const r=await this.getFullPath(e);return this.getDirEntryFilesRecursively(r)}async getDirEntryFilesRecursively(e){try{const r=[],n=await IE(e);for(const i of n)if(i.isDirectory){if(hCe.has(i.name))continue;const o=await hd(e,i.name),s=await this.getDirEntryFilesRecursively(o);r.push(...s)}else{const o=await hd(e,i.name),s=await or.relative(this.baseDir,o);r.push(s)}return r}catch(r){return r.includes("forbidden path")||console.error(r),[]}}async get(e){const r=await this.getFullPath(e);try{return await Px(r)}catch(n){return!n.includes("No such file or directory")&&!n.includes("forbidden path")&&console.error(n),null}}async set(e,r){const n=await this.getFullPath(e),i=_E(),o=n.split(i).slice(0,-1).join(i);await KC(o,{recursive:!0}),await rU(n,r)}async remove(e){const r=await this.getFullPath(e);try{await tU(r)}catch(n){!n.includes("No such file or directory")&&!n.includes("forbidden path")&&console.error(n)}}async getFullPath(e){return await hd(this.baseDir,e??"")}}class gCe{baseDir="";async ls(e=""){return[]}async get(e){return null}async set(e,r){}async remove(e){}}class mCe{constructor(e){this.projectId=e}async get(){const e=this.getKey();return localStorage.getItem(e)??null}async set(e){const r=this.getKey();localStorage.setItem(r,e)}async remove(){const e=this.getKey();localStorage.removeItem(e)}getKey(){return`replay:secrets:${this.projectId}`}}class cU{constructor(e){this.storage=e}itemIds=[];async getAbsolutePath(e){return await or.resolve(await or.join(this.storage.baseDir,"/",e))}async parseMany(e,r){return(await Promise.all(e.map(async i=>{try{return await this.parse(i,r)}catch(o){return console.error(`Error parsing from ${i.type} ${i.uri}:`,o),null}}))).filter(i=>i!==null)}setItemIds(e){this.itemIds=e}async write(e){e.state===Mt.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,r){const n=e.actions;if(n){for(const o in n){const s=parseInt(o);switch(n[o]){case"D":await this.remove(this.itemIds[s]);break;case"I":case"U":await this.write(r[s]);break}}return}const i=this.itemIds.filter(o=>!r.some(s=>s.id===o));await Promise.all([...r.map(o=>this.write(o)),...i.map(o=>this.remove(o))])}async update(e,r){const i={path:e.path.slice(1),actions:e.actions};if(i.path.length===0&&await this.updateRoot(i,r),i.path.length>0){const o=i.path[0];i.path.length===1&&i.actions&&i.actions.id==="U"&&await this.remove(this.itemIds[o]),i.path[1]&&i.path[1]==="id"&&await this.remove(this.itemIds[o]),await this.write(r[o])}this.itemIds=r.map(o=>o.id)}}class OCe extends cU{parse(e){return{...e.content,id:e.uri,srcType:e.type}}async stringify(e){const{id:r,srcType:n,...i}=e;return await or.extname(r)===".json"?JSON.stringify(i,null,2):Pa.dump(i)}}var Qn=(t=>(t.SIMPLE="simple",t.REGEX="regex",t.JSONPATH="jsonpath",t.XPATH="xpath",t))(Qn||{});function yCe(t){return typeof t=="function"?t:Array.isArray(t)?e=>{for(const r of t)if(typeof r=="string"&&e===r||r instanceof RegExp&&r.test(e))return!0}:()=>!1}const vCe=`
353
353
  `;function bCe(t,e){let r="";return e.format&&e.indentBy.length>0&&(r=vCe),uU(t,e,"",r)}function uU(t,e,r,n){let i="",o=!1;for(let s=0;s<t.length;s++){const a=t[s],l=xCe(a);if(l===void 0)continue;let c="";if(r.length===0?c=l:c=`${r}.${l}`,l===e.textNodeName){let m=a[l];SCe(c,e)||(m=e.tagValueProcessor(l,m),m=dU(m,e)),o&&(i+=n),i+=m,o=!1;continue}else if(l===e.cdataPropName){o&&(i+=n),i+=`<![CDATA[${a[l][0][e.textNodeName]}]]>`,o=!1;continue}else if(l===e.commentPropName){i+=n+`<!--${a[l][0][e.textNodeName]}-->`,o=!0;continue}else if(l[0]==="?"){const m=A5(a[":@"],e),g=l==="?xml"?"":n;let O=a[l][0][e.textNodeName];O=O.length!==0?" "+O:"",i+=g+`<${l}${O}${m}?>`,o=!0;continue}let u=n;u!==""&&(u+=e.indentBy);const d=A5(a[":@"],e),p=n+`<${l}${d}`,h=uU(a[l],e,c,u);e.unpairedTags.indexOf(l)!==-1?e.suppressUnpairedNode?i+=p+">":i+=p+"/>":(!h||h.length===0)&&e.suppressEmptyNode?i+=p+"/>":h&&h.endsWith(">")?i+=p+`>${h}${n}</${l}>`:(i+=p+">",h&&n!==""&&(h.includes("/>")||h.includes("</"))?i+=n+e.indentBy+h+n:i+=h,i+=`</${l}>`),o=!0}return i}function xCe(t){const e=Object.keys(t);for(let r=0;r<e.length;r++){const n=e[r];if(t.hasOwnProperty(n)&&n!==":@")return n}}function A5(t,e){let r="";if(t&&!e.ignoreAttributes)for(let n in t){if(!t.hasOwnProperty(n))continue;let i=e.attributeValueProcessor(n,t[n]);i=dU(i,e),i===!0&&e.suppressBooleanAttributes?r+=` ${n.substr(e.attributeNamePrefix.length)}`:r+=` ${n.substr(e.attributeNamePrefix.length)}="${i}"`}return r}function SCe(t,e){t=t.substr(0,t.length-e.textNodeName.length-1);let r=t.substr(t.lastIndexOf(".")+1);for(let n in e.stopNodes)if(e.stopNodes[n]===t||e.stopNodes[n]==="*."+r)return!0;return!1}function dU(t,e){if(t&&t.length>0&&e.processEntities)for(let r=0;r<e.entities.length;r++){const n=e.entities[r];t=t.replace(n.regex,n.val)}return t}const wCe={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function Vl(t){this.options=Object.assign({},wCe,t),this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=yCe(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=$Ce),this.processTextOrObjNode=PCe,this.options.format?(this.indentate=CCe,this.tagEndChar=`>
354
354
  `,this.newLine=`
355
355
  `):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}Vl.prototype.build=function(t){return this.options.preserveOrder?bCe(t,this.options):(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t={[this.options.arrayNodeName]:t}),this.j2x(t,0,[]).val)};Vl.prototype.j2x=function(t,e,r){let n="",i="";const o=r.join(".");for(let s in t)if(Object.prototype.hasOwnProperty.call(t,s))if(typeof t[s]>"u")this.isAttribute(s)&&(i+="");else if(t[s]===null)this.isAttribute(s)||s===this.options.cdataPropName?i+="":s[0]==="?"?i+=this.indentate(e)+"<"+s+"?"+this.tagEndChar:i+=this.indentate(e)+"<"+s+"/"+this.tagEndChar;else if(t[s]instanceof Date)i+=this.buildTextValNode(t[s],s,"",e);else if(typeof t[s]!="object"){const a=this.isAttribute(s);if(a&&!this.ignoreAttributesFn(a,o))n+=this.buildAttrPairStr(a,""+t[s]);else if(!a)if(s===this.options.textNodeName){let l=this.options.tagValueProcessor(s,""+t[s]);i+=this.replaceEntitiesValue(l)}else i+=this.buildTextValNode(t[s],s,"",e)}else if(Array.isArray(t[s])){const a=t[s].length;let l="",c="";for(let u=0;u<a;u++){const d=t[s][u];if(!(typeof d>"u"))if(d===null)s[0]==="?"?i+=this.indentate(e)+"<"+s+"?"+this.tagEndChar:i+=this.indentate(e)+"<"+s+"/"+this.tagEndChar;else if(typeof d=="object")if(this.options.oneListGroup){const p=this.j2x(d,e+1,r.concat(s));l+=p.val,this.options.attributesGroupName&&d.hasOwnProperty(this.options.attributesGroupName)&&(c+=p.attrStr)}else l+=this.processTextOrObjNode(d,s,e,r);else if(this.options.oneListGroup){let p=this.options.tagValueProcessor(s,d);p=this.replaceEntitiesValue(p),l+=p}else l+=this.buildTextValNode(d,s,"",e)}this.options.oneListGroup&&(l=this.buildObjectNode(l,s,c,e)),i+=l}else if(this.options.attributesGroupName&&s===this.options.attributesGroupName){const a=Object.keys(t[s]),l=a.length;for(let c=0;c<l;c++)n+=this.buildAttrPairStr(a[c],""+t[s][a[c]])}else i+=this.processTextOrObjNode(t[s],s,e,r);return{attrStr:n,val:i}};Vl.prototype.buildAttrPairStr=function(t,e){return e=this.options.attributeValueProcessor(t,""+e),e=this.replaceEntitiesValue(e),this.options.suppressBooleanAttributes&&e==="true"?" "+t:" "+t+'="'+e+'"'};function PCe(t,e,r,n){const i=this.j2x(t,r+1,n.concat(e));return t[this.options.textNodeName]!==void 0&&Object.keys(t).length===1?this.buildTextValNode(t[this.options.textNodeName],e,i.attrStr,r):this.buildObjectNode(i.val,e,i.attrStr,r)}Vl.prototype.buildObjectNode=function(t,e,r,n){if(t==="")return e[0]==="?"?this.indentate(n)+"<"+e+r+"?"+this.tagEndChar:this.indentate(n)+"<"+e+r+this.closeTag(e)+this.tagEndChar;{let i="</"+e+this.tagEndChar,o="";return e[0]==="?"&&(o="?",i=""),(r||r==="")&&t.indexOf("<")===-1?this.indentate(n)+"<"+e+r+o+">"+t+i:this.options.commentPropName!==!1&&e===this.options.commentPropName&&o.length===0?this.indentate(n)+`<!--${t}-->`+this.newLine:this.indentate(n)+"<"+e+r+o+this.tagEndChar+t+this.indentate(n)+i}};Vl.prototype.closeTag=function(t){let e="";return this.options.unpairedTags.indexOf(t)!==-1?this.options.suppressUnpairedNode||(e="/"):this.options.suppressEmptyNode?e="/":e=`></${t}`,e};Vl.prototype.buildTextValNode=function(t,e,r,n){if(this.options.cdataPropName!==!1&&e===this.options.cdataPropName)return this.indentate(n)+`<![CDATA[${t}]]>`+this.newLine;if(this.options.commentPropName!==!1&&e===this.options.commentPropName)return this.indentate(n)+`<!--${t}-->`+this.newLine;if(e[0]==="?")return this.indentate(n)+"<"+e+r+"?"+this.tagEndChar;{let i=this.options.tagValueProcessor(e,t);return i=this.replaceEntitiesValue(i),i===""?this.indentate(n)+"<"+e+r+this.closeTag(e)+this.tagEndChar:this.indentate(n)+"<"+e+r+">"+i+"</"+e+this.tagEndChar}};Vl.prototype.replaceEntitiesValue=function(t){if(t&&t.length>0&&this.options.processEntities)for(let e=0;e<this.options.entities.length;e++){const r=this.options.entities[e];t=t.replace(r.regex,r.val)}return t};function CCe(t){return this.options.indentBy.repeat(t)}function $Ce(t){return t.startsWith(this.options.attributeNamePrefix)&&t!==this.options.textNodeName?t.substr(this.attrPrefixLen):!1}const fU=1024;let kCe=0,to=class{constructor(e,r){this.from=e,this.to=r}};class mt{constructor(e={}){this.id=kCe++,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=Ln.match(e)),r=>{let n=e(r);return n===void 0?null:[this,n]}}}mt.closedBy=new mt({deserialize:t=>t.split(" ")});mt.openedBy=new mt({deserialize:t=>t.split(" ")});mt.group=new mt({deserialize:t=>t.split(" ")});mt.isolate=new mt({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});mt.contextHash=new mt({perNode:!0});mt.lookAhead=new mt({perNode:!0});mt.mounted=new mt({perNode:!0});class Rh{constructor(e,r,n){this.tree=e,this.overlay=r,this.parser=n}static get(e){return e&&e.props&&e.props[mt.mounted.id]}}const TCe=Object.create(null);class Ln{constructor(e,r,n,i=0){this.name=e,this.props=r,this.id=n,this.flags=i}static define(e){let r=e.props&&e.props.length?Object.create(null):TCe,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new Ln(e.name||"",r,e.id,n);if(e.props){for(let o of e.props)if(Array.isArray(o)||(o=o(i)),o){if(o[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");r[o[0].id]=o[1]}}return i}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 r=this.prop(mt.group);return r?r.indexOf(e)>-1:!1}return this.id==e}static match(e){let r=Object.create(null);for(let n in e)for(let i of n.split(" "))r[i]=e[n];return n=>{for(let i=n.prop(mt.group),o=-1;o<(i?i.length:0);o++){let s=r[o<0?n.name:i[o]];if(s)return s}}}}Ln.none=new Ln("",Object.create(null),0,8);class Cx{constructor(e){this.types=e;for(let r=0;r<e.length;r++)if(e[r].id!=r)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let r=[];for(let n of this.types){let i=null;for(let o of e){let s=o(n);s&&(i||(i=Object.assign({},n.props)),i[s[0].id]=s[1])}r.push(i?new Ln(n.name,i,n.id,n.flags):n)}return new Cx(r)}}const wO=new WeakMap,I5=new WeakMap;var fr;(function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays"})(fr||(fr={}));let hr=class e${constructor(e,r,n,i,o){if(this.type=e,this.children=r,this.positions=n,this.length=i,this.props=null,o&&o.length){this.props=Object.create(null);for(let[s,a]of o)this.props[typeof s=="number"?s:s.id]=a}}toString(){let e=Rh.get(this);if(e&&!e.overlay)return e.tree.toString();let r="";for(let n of this.children){let i=n.toString();i&&(r&&(r+=","),r+=i)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(r.length?"("+r+")":""):r}cursor(e=0){return new Ob(this.topNode,e)}cursorAt(e,r=0,n=0){let i=wO.get(this)||this.topNode,o=new Ob(i);return o.moveTo(e,r),wO.set(this,o._tree),o}get topNode(){return new lo(this,0,0,null)}resolve(e,r=0){let n=_h(wO.get(this)||this.topNode,e,r,!1);return wO.set(this,n),n}resolveInner(e,r=0){let n=_h(I5.get(this)||this.topNode,e,r,!0);return I5.set(this,n),n}resolveStack(e,r=0){return ICe(this,e,r)}iterate(e){let{enter:r,leave:n,from:i=0,to:o=this.length}=e,s=e.mode||0,a=(s&fr.IncludeAnonymous)>0;for(let l=this.cursor(s|fr.IncludeAnonymous);;){let c=!1;if(l.from<=o&&l.to>=i&&(!a&&l.type.isAnonymous||r(l)!==!1)){if(l.firstChild())continue;c=!0}for(;c&&n&&(a||!l.type.isAnonymous)&&n(l),!l.nextSibling();){if(!l.parent())return;c=!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 r in this.props)e.push([+r,this.props[r]]);return e}balance(e={}){return this.children.length<=8?this:NE(Ln.none,this.children,this.positions,0,this.children.length,0,this.length,(r,n,i)=>new e$(this.type,r,n,i,this.propValues),e.makeTree||((r,n,i)=>new e$(Ln.none,r,n,i)))}static build(e){return RCe(e)}};hr.empty=new hr(Ln.none,[],[],0);class QE{constructor(e,r){this.buffer=e,this.index=r}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 QE(this.buffer,this.index)}}class Al{constructor(e,r,n){this.buffer=e,this.length=r,this.set=n}get type(){return Ln.none}toString(){let e=[];for(let r=0;r<this.buffer.length;)e.push(this.childString(r)),r=this.buffer[r+3];return e.join(",")}childString(e){let r=this.buffer[e],n=this.buffer[e+3],i=this.set.types[r],o=i.name;if(/\W/.test(o)&&!i.isError&&(o=JSON.stringify(o)),e+=4,n==e)return o;let s=[];for(;e<n;)s.push(this.childString(e)),e=this.buffer[e+3];return o+"("+s.join(",")+")"}findChild(e,r,n,i,o){let{buffer:s}=this,a=-1;for(let l=e;l!=r&&!(pU(o,i,s[l+1],s[l+2])&&(a=l,n>0));l=s[l+3]);return a}slice(e,r,n){let i=this.buffer,o=new Uint16Array(r-e),s=0;for(let a=e,l=0;a<r;){o[l++]=i[a++],o[l++]=i[a++]-n;let c=o[l++]=i[a++]-n;o[l++]=i[a++]-e,s=Math.max(s,c)}return new Al(o,s,this.set)}}function pU(t,e,r,n){switch(t){case-2:return r<e;case-1:return n>=e&&r<e;case 0:return r<e&&n>e;case 1:return r<=e&&n>e;case 2:return n>e;case 4:return!0}}function _h(t,e,r,n){for(var i;t.from==t.to||(r<1?t.from>=e:t.from>e)||(r>-1?t.to<=e:t.to<e);){let s=!n&&t instanceof lo&&t.index<0?null:t.parent;if(!s)return t;t=s}let o=n?0:fr.IgnoreOverlays;if(n)for(let s=t,a=s.parent;a;s=a,a=s.parent)s instanceof lo&&s.index<0&&((i=a.enter(e,r,o))===null||i===void 0?void 0:i.from)!=s.from&&(t=a);for(;;){let s=t.enter(e,r,o);if(!s)return t;t=s}}class hU{cursor(e=0){return new Ob(this,e)}getChild(e,r=null,n=null){let i=R5(this,e,r,n);return i.length?i[0]:null}getChildren(e,r=null,n=null){return R5(this,e,r,n)}resolve(e,r=0){return _h(this,e,r,!1)}resolveInner(e,r=0){return _h(this,e,r,!0)}matchContext(e){return t$(this.parent,e)}enterUnfinishedNodesBefore(e){let r=this.childBefore(e),n=this;for(;r;){let i=r.lastChild;if(!i||i.to!=r.to)break;i.type.isError&&i.from==i.to?(n=r,r=i.prevSibling):r=i}return n}get node(){return this}get next(){return this.parent}}let lo=class Ry extends hU{constructor(e,r,n,i){super(),this._tree=e,this.from=r,this.index=n,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,r,n,i,o=0){for(let s=this;;){for(let{children:a,positions:l}=s._tree,c=r>0?a.length:-1;e!=c;e+=r){let u=a[e],d=l[e]+s.from;if(pU(i,n,d,d+u.length)){if(u instanceof Al){if(o&fr.ExcludeBuffers)continue;let p=u.findChild(0,u.buffer.length,r,n-d,i);if(p>-1)return new gs(new ECe(s,u,e,d),null,p)}else if(o&fr.IncludeAnonymous||!u.type.isAnonymous||DE(u)){let p;if(!(o&fr.IgnoreMounts)&&(p=Rh.get(u))&&!p.overlay)return new Ry(p.tree,d,e,s);let h=new Ry(u,d,e,s);return o&fr.IncludeAnonymous||!h.type.isAnonymous?h:h.nextChild(r<0?u.children.length-1:0,r,n,i)}}}if(o&fr.IncludeAnonymous||!s.type.isAnonymous||(s.index>=0?e=s.index+r:e=r<0?-1:s._parent._tree.children.length,s=s._parent,!s))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,r,n=0){let i;if(!(n&fr.IgnoreOverlays)&&(i=Rh.get(this._tree))&&i.overlay){let o=e-this.from;for(let{from:s,to:a}of i.overlay)if((r>0?s<=o:s<o)&&(r<0?a>=o:a>o))return new Ry(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,r,n)}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 R5(t,e,r,n){let i=t.cursor(),o=[];if(!i.firstChild())return o;if(r!=null){for(let s=!1;!s;)if(s=i.type.is(r),!i.nextSibling())return o}for(;;){if(n!=null&&i.type.is(n))return o;if(i.type.is(e)&&o.push(i.node),!i.nextSibling())return n==null?o:[]}}function t$(t,e,r=e.length-1){for(let n=t;r>=0;n=n.parent){if(!n)return!1;if(!n.type.isAnonymous){if(e[r]&&e[r]!=n.name)return!1;r--}}return!0}class ECe{constructor(e,r,n,i){this.parent=e,this.buffer=r,this.index=n,this.start=i}}class gs extends hU{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,r,n){super(),this.context=e,this._parent=r,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,r,n){let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],e,r-this.context.start,n);return o<0?null:new gs(this.context,this,o)}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,r,n=0){if(n&fr.ExcludeBuffers)return null;let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],r>0?1:-1,e-this.context.start,r);return o<0?null:new gs(this.context,this,o)}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,r=e.buffer[this.index+3];return r<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new gs(this.context,this._parent,r):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,r=this._parent?this._parent.index+4:0;return this.index==r?this.externalSibling(-1):new gs(this.context,this._parent,e.findChild(r,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],r=[],{buffer:n}=this.context,i=this.index+4,o=n.buffer[this.index+3];if(o>i){let s=n.buffer[this.index+1];e.push(n.slice(i,o,s)),r.push(0)}return new hr(this.type,e,r,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function gU(t){if(!t.length)return null;let e=0,r=t[0];for(let o=1;o<t.length;o++){let s=t[o];(s.from>r.from||s.to<r.to)&&(r=s,e=o)}let n=r instanceof lo&&r.index<0?null:r.parent,i=t.slice();return n?i[e]=n:i.splice(e,1),new ACe(i,r)}class ACe{constructor(e,r){this.heads=e,this.node=r}get next(){return gU(this.heads)}}function ICe(t,e,r){let n=t.resolveInner(e,r),i=null;for(let o=n instanceof lo?n:n.context.parent;o;o=o.parent)if(o.index<0){let s=o.parent;(i||(i=[n])).push(s.resolve(e,r)),o=s}else{let s=Rh.get(o.tree);if(s&&s.overlay&&s.overlay[0].from<=e&&s.overlay[s.overlay.length-1].to>=e){let a=new lo(s.tree,s.overlay[0].from+o.from,-1,o);(i||(i=[n])).push(_h(a,e,r,!1))}}return i?gU(i):n}class Ob{get name(){return this.type.name}constructor(e,r=0){if(this.mode=r,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof lo)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let n=e._parent;n;n=n._parent)this.stack.unshift(n.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,r){this.index=e;let{start:n,buffer:i}=this.buffer;return this.type=r||i.set.types[i.buffer[e]],this.from=n+i.buffer[e+1],this.to=n+i.buffer[e+2],!0}yield(e){return e?e instanceof lo?(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,r,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,r,n,this.mode));let{buffer:i}=this.buffer,o=i.findChild(this.index+4,i.buffer[this.index+3],e,r-this.buffer.start,n);return o<0?!1:(this.stack.push(this.index),this.yieldBuf(o))}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,r,n=this.mode){return this.buffer?n&fr.ExcludeBuffers?!1:this.enterChild(1,e,r):this.yield(this._tree.enter(e,r,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&fr.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&fr.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:r}=this.buffer,n=this.stack.length-1;if(e<0){let i=n<0?0:this.stack[n]+4;if(this.index!=i)return this.yieldBuf(r.findChild(i,this.index,-1,0,4))}else{let i=r.buffer[this.index+3];if(i<(n<0?r.buffer.length:r.buffer[this.stack[n]+3]))return this.yieldBuf(i)}return n<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 r,n,{buffer:i}=this;if(i){if(e>0){if(this.index<i.buffer.buffer.length)return!1}else for(let o=0;o<this.index;o++)if(i.buffer.buffer[o+3]<this.index)return!1;({index:r,parent:n}=i)}else({index:r,_parent:n}=this._tree);for(;n;{index:r,_parent:n}=n)if(r>-1)for(let o=r+e,s=e<0?-1:n._tree.children.length;o!=s;o+=e){let a=n._tree.children[o];if(this.mode&fr.IncludeAnonymous||a instanceof Al||!a.type.isAnonymous||DE(a))return!1}return!0}move(e,r){if(r&&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,r=0){for(;(this.from==this.to||(r<1?this.from>=e:this.from>e)||(r>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,r););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,r=null,n=0;if(e&&e.context==this.buffer)e:for(let i=this.index,o=this.stack.length;o>=0;){for(let s=e;s;s=s._parent)if(s.index==i){if(i==this.index)return s;r=s,n=o+1;break e}i=this.stack[--o]}for(let i=n;i<this.stack.length;i++)r=new gs(this.buffer,r,this.stack[i]);return this.bufferNode=new gs(this.buffer,r,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,r){for(let n=0;;){let i=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){n++;continue}this.type.isAnonymous||(i=!0)}for(;;){if(i&&r&&r(this),i=this.type.isAnonymous,!n)return;if(this.nextSibling())break;this.parent(),n--,i=!0}}}matchContext(e){if(!this.buffer)return t$(this.node.parent,e);let{buffer:r}=this.buffer,{types:n}=r.set;for(let i=e.length-1,o=this.stack.length-1;i>=0;o--){if(o<0)return t$(this._tree,e,i);let s=n[r.buffer[this.stack[o]]];if(!s.isAnonymous){if(e[i]&&e[i]!=s.name)return!1;i--}}return!0}}function DE(t){return t.children.some(e=>e instanceof Al||!e.type.isAnonymous||DE(e))}function RCe(t){var e;let{buffer:r,nodeSet:n,maxBufferLength:i=fU,reused:o=[],minRepeatType:s=n.types.length}=t,a=Array.isArray(r)?new QE(r,r.length):r,l=n.types,c=0,u=0;function d(S,P,C,E,R,D){let{id:_,start:L,end:W,size:Y}=a,Z=u,J=c;for(;Y<0;)if(a.next(),Y==-1){let M=o[_];C.push(M),E.push(L-S);return}else if(Y==-3){c=_;return}else if(Y==-4){u=_;return}else throw new RangeError(`Unrecognized record size: ${Y}`);let ae=l[_],F,oe,q=L-S;if(W-L<=i&&(oe=O(a.pos-P,R))){let M=new Uint16Array(oe.size-oe.skip),U=a.pos-oe.size,z=M.length;for(;a.pos>U;)z=y(oe.start,M,z);F=new Al(M,W-oe.start,n),q=oe.start-S}else{let M=a.pos-Y;a.next();let U=[],z=[],I=_>=s?_:-1,j=0,X=W;for(;a.pos>M;)I>=0&&a.id==I&&a.size>=0?(a.end<=X-i&&(m(U,z,L,j,a.end,X,I,Z,J),j=U.length,X=a.end),a.next()):D>2500?p(L,M,U,z):d(L,M,U,z,I,D+1);if(I>=0&&j>0&&j<U.length&&m(U,z,L,j,L,X,I,Z,J),U.reverse(),z.reverse(),I>-1&&j>0){let H=h(ae,J);F=NE(ae,U,z,0,U.length,0,W-L,H,H)}else F=g(ae,U,z,W-L,Z-W,J)}C.push(F),E.push(q)}function p(S,P,C,E){let R=[],D=0,_=-1;for(;a.pos>P;){let{id:L,start:W,end:Y,size:Z}=a;if(Z>4)a.next();else{if(_>-1&&W<_)break;_<0&&(_=Y-i),R.push(L,W,Y),D++,a.next()}}if(D){let L=new Uint16Array(D*4),W=R[R.length-2];for(let Y=R.length-3,Z=0;Y>=0;Y-=3)L[Z++]=R[Y],L[Z++]=R[Y+1]-W,L[Z++]=R[Y+2]-W,L[Z++]=Z;C.push(new Al(L,R[2]-W,n)),E.push(W-S)}}function h(S,P){return(C,E,R)=>{let D=0,_=C.length-1,L,W;if(_>=0&&(L=C[_])instanceof hr){if(!_&&L.type==S&&L.length==R)return L;(W=L.prop(mt.lookAhead))&&(D=E[_]+L.length+W)}return g(S,C,E,R,D,P)}}function m(S,P,C,E,R,D,_,L,W){let Y=[],Z=[];for(;S.length>E;)Y.push(S.pop()),Z.push(P.pop()+C-R);S.push(g(n.types[_],Y,Z,D-R,L-D,W)),P.push(R-C)}function g(S,P,C,E,R,D,_){if(D){let L=[mt.contextHash,D];_=_?[L].concat(_):[L]}if(R>25){let L=[mt.lookAhead,R];_=_?[L].concat(_):[L]}return new hr(S,P,C,E,_)}function O(S,P){let C=a.fork(),E=0,R=0,D=0,_=C.end-i,L={size:0,start:0,skip:0};e:for(let W=C.pos-S;C.pos>W;){let Y=C.size;if(C.id==P&&Y>=0){L.size=E,L.start=R,L.skip=D,D+=4,E+=4,C.next();continue}let Z=C.pos-Y;if(Y<0||Z<W||C.start<_)break;let J=C.id>=s?4:0,ae=C.start;for(C.next();C.pos>Z;){if(C.size<0)if(C.size==-3)J+=4;else break e;else C.id>=s&&(J+=4);C.next()}R=ae,E+=Y,D+=J}return(P<0||E==S)&&(L.size=E,L.start=R,L.skip=D),L.size>4?L:void 0}function y(S,P,C){let{id:E,start:R,end:D,size:_}=a;if(a.next(),_>=0&&E<s){let L=C;if(_>4){let W=a.pos-(_-4);for(;a.pos>W;)C=y(S,P,C)}P[--C]=L,P[--C]=D-S,P[--C]=R-S,P[--C]=E}else _==-3?c=E:_==-4&&(u=E);return C}let v=[],b=[];for(;a.pos>0;)d(t.start||0,t.bufferStart||0,v,b,-1,0);let w=(e=t.length)!==null&&e!==void 0?e:v.length?b[0]+v[0].length:0;return new hr(l[t.topID],v.reverse(),b.reverse(),w)}const _5=new WeakMap;function _y(t,e){if(!t.isAnonymous||e instanceof Al||e.type!=t)return 1;let r=_5.get(e);if(r==null){r=1;for(let n of e.children){if(n.type!=t||!(n instanceof hr)){r=1;break}r+=_y(t,n)}_5.set(e,r)}return r}function NE(t,e,r,n,i,o,s,a,l){let c=0;for(let m=n;m<i;m++)c+=_y(t,e[m]);let u=Math.ceil(c*1.5/8),d=[],p=[];function h(m,g,O,y,v){for(let b=O;b<y;){let w=b,S=g[b],P=_y(t,m[b]);for(b++;b<y;b++){let C=_y(t,m[b]);if(P+C>=u)break;P+=C}if(b==w+1){if(P>u){let C=m[w];h(C.children,C.positions,0,C.children.length,g[w]+v);continue}d.push(m[w])}else{let C=g[b-1]+m[b-1].length-S;d.push(NE(t,m,g,w,b,S,C,null,l))}p.push(S+v-o)}}return h(e,r,n,i,0),(a||l)(d,p,s)}class ME{constructor(){this.map=new WeakMap}setBuffer(e,r,n){let i=this.map.get(e);i||this.map.set(e,i=new Map),i.set(r,n)}getBuffer(e,r){let n=this.map.get(e);return n&&n.get(r)}set(e,r){e instanceof gs?this.setBuffer(e.context.buffer,e.index,r):e instanceof lo&&this.map.set(e.tree,r)}get(e){return e instanceof gs?this.getBuffer(e.context.buffer,e.index):e instanceof lo?this.map.get(e.tree):void 0}cursorSet(e,r){e.buffer?this.setBuffer(e.buffer.buffer,e.index,r):this.map.set(e.tree,r)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Oa{constructor(e,r,n,i,o=!1,s=!1){this.from=e,this.to=r,this.tree=n,this.offset=i,this.open=(o?1:0)|(s?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,r=[],n=!1){let i=[new Oa(0,e.length,e,0,!1,n)];for(let o of r)o.to>e.length&&i.push(o);return i}static applyChanges(e,r,n=128){if(!r.length)return e;let i=[],o=1,s=e.length?e[0]:null;for(let a=0,l=0,c=0;;a++){let u=a<r.length?r[a]:null,d=u?u.fromA:1e9;if(d-l>=n)for(;s&&s.from<d;){let p=s;if(l>=p.from||d<=p.to||c){let h=Math.max(p.from,l)-c,m=Math.min(p.to,d)-c;p=h>=m?null:new Oa(h,m,p.tree,p.offset+c,a>0,!!u)}if(p&&i.push(p),s.to>d)break;s=o<e.length?e[o++]:null}if(!u)break;l=u.toA,c=u.toA-u.toB}return i}}let qE=class{startParse(e,r,n){return typeof e=="string"&&(e=new _Ce(e)),n=n?n.length?n.map(i=>new to(i.from,i.to)):[new to(0,0)]:[new to(0,e.length)],this.createParse(e,r||[],n)}parse(e,r,n){let i=this.startParse(e,r,n);for(;;){let o=i.advance();if(o)return o}}};class _Ce{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,r){return this.string.slice(e,r)}}function jCe(t){return(e,r,n,i)=>new DCe(e,t,r,n,i)}class j5{constructor(e,r,n,i,o){this.parser=e,this.parse=r,this.overlay=n,this.target=i,this.from=o}}function Q5(t){if(!t.length||t.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(t))}class QCe{constructor(e,r,n,i,o,s,a){this.parser=e,this.predicate=r,this.mounts=n,this.index=i,this.start=o,this.target=s,this.prev=a,this.depth=0,this.ranges=[]}}const r$=new mt({perNode:!0});class DCe{constructor(e,r,n,i,o){this.nest=r,this.input=n,this.fragments=i,this.ranges=o,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let n=this.baseParse.advance();if(!n)return null;if(this.baseParse=null,this.baseTree=n,this.startInner(),this.stoppedAt!=null)for(let i of this.inner)i.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let n=this.baseTree;return this.stoppedAt!=null&&(n=new hr(n.type,n.children,n.positions,n.length,n.propValues.concat([[r$,this.stoppedAt]]))),n}let e=this.inner[this.innerDone],r=e.parse.advance();if(r){this.innerDone++;let n=Object.assign(Object.create(null),e.target.props);n[mt.mounted.id]=new Rh(r,e.overlay,e.parser),e.target.props=n}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let r=this.innerDone;r<this.inner.length;r++)this.inner[r].from<e&&(e=Math.min(e,this.inner[r].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let r=this.innerDone;r<this.inner.length;r++)this.inner[r].parse.stopAt(e)}startInner(){let e=new qCe(this.fragments),r=null,n=null,i=new Ob(new lo(this.baseTree,this.ranges[0].from,0,null),fr.IncludeAnonymous|fr.IgnoreMounts);e:for(let o,s;;){let a=!0,l;if(this.stoppedAt!=null&&i.from>=this.stoppedAt)a=!1;else if(e.hasNode(i)){if(r){let c=r.mounts.find(u=>u.frag.from<=i.from&&u.frag.to>=i.to&&u.mount.overlay);if(c)for(let u of c.mount.overlay){let d=u.from+c.pos,p=u.to+c.pos;d>=i.from&&p<=i.to&&!r.ranges.some(h=>h.from<p&&h.to>d)&&r.ranges.push({from:d,to:p})}}a=!1}else if(n&&(s=NCe(n.ranges,i.from,i.to)))a=s!=2;else if(!i.type.isAnonymous&&(o=this.nest(i,this.input))&&(i.from<i.to||!o.overlay)){i.tree||MCe(i);let c=e.findMounts(i.from,o.parser);if(typeof o.overlay=="function")r=new QCe(o.parser,o.overlay,c,this.inner.length,i.from,i.tree,r);else{let u=M5(this.ranges,o.overlay||(i.from<i.to?[new to(i.from,i.to)]:[]));u.length&&Q5(u),(u.length||!o.overlay)&&this.inner.push(new j5(o.parser,u.length?o.parser.startParse(this.input,q5(c,u),u):o.parser.startParse(""),o.overlay?o.overlay.map(d=>new to(d.from-i.from,d.to-i.from)):null,i.tree,u.length?u[0].from:i.from)),o.overlay?u.length&&(n={ranges:u,depth:0,prev:n}):a=!1}}else if(r&&(l=r.predicate(i))&&(l===!0&&(l=new to(i.from,i.to)),l.from<l.to)){let c=r.ranges.length-1;c>=0&&r.ranges[c].to==l.from?r.ranges[c]={from:r.ranges[c].from,to:l.to}:r.ranges.push(l)}if(a&&i.firstChild())r&&r.depth++,n&&n.depth++;else for(;!i.nextSibling();){if(!i.parent())break e;if(r&&!--r.depth){let c=M5(this.ranges,r.ranges);c.length&&(Q5(c),this.inner.splice(r.index,0,new j5(r.parser,r.parser.startParse(this.input,q5(r.mounts,c),c),r.ranges.map(u=>new to(u.from-r.start,u.to-r.start)),r.target,c[0].from))),r=r.prev}n&&!--n.depth&&(n=n.prev)}}}}function NCe(t,e,r){for(let n of t){if(n.from>=r)break;if(n.to>e)return n.from<=e&&n.to>=r?2:1}return 0}function D5(t,e,r,n,i,o){if(e<r){let s=t.buffer[e+1];n.push(t.slice(e,r,s)),i.push(s-o)}}function MCe(t){let{node:e}=t,r=[],n=e.context.buffer;do r.push(t.index),t.parent();while(!t.tree);let i=t.tree,o=i.children.indexOf(n),s=i.children[o],a=s.buffer,l=[o];function c(u,d,p,h,m,g){let O=r[g],y=[],v=[];D5(s,u,O,y,v,h);let b=a[O+1],w=a[O+2];l.push(y.length);let S=g?c(O+4,a[O+3],s.set.types[a[O]],b,w-b,g-1):e.toTree();return y.push(S),v.push(b-h),D5(s,a[O+3],d,y,v,h),new hr(p,y,v,m)}i.children[o]=c(0,a.length,Ln.none,0,s.length,r.length-1);for(let u of l){let d=t.tree.children[u],p=t.tree.positions[u];t.yield(new lo(d,p+t.from,u,t._tree))}}class N5{constructor(e,r){this.offset=r,this.done=!1,this.cursor=e.cursor(fr.IncludeAnonymous|fr.IgnoreMounts)}moveTo(e){let{cursor:r}=this,n=e-this.offset;for(;!this.done&&r.from<n;)r.to>=e&&r.enter(n,1,fr.IgnoreOverlays|fr.ExcludeBuffers)||r.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 r=this.cursor.tree;;){if(r==e.tree)return!0;if(r.children.length&&r.positions[0]==0&&r.children[0]instanceof hr)r=r.children[0];else break}return!1}}let qCe=class{constructor(e){var r;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let n=this.curFrag=e[0];this.curTo=(r=n.tree.prop(r$))!==null&&r!==void 0?r:n.to,this.inner=new N5(n.tree,-n.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 r=this.curFrag=this.fragments[this.fragI];this.curTo=(e=r.tree.prop(r$))!==null&&e!==void 0?e:r.to,this.inner=new N5(r.tree,-r.offset)}}findMounts(e,r){var n;let i=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let o=this.inner.cursor.node;o;o=o.parent){let s=(n=o.tree)===null||n===void 0?void 0:n.prop(mt.mounted);if(s&&s.parser==r)for(let a=this.fragI;a<this.fragments.length;a++){let l=this.fragments[a];if(l.from>=o.to)break;l.tree==this.curFrag.tree&&i.push({frag:l,pos:o.from-l.offset,mount:s})}}}return i}};function M5(t,e){let r=null,n=e;for(let i=1,o=0;i<t.length;i++){let s=t[i-1].to,a=t[i].from;for(;o<n.length;o++){let l=n[o];if(l.from>=a)break;l.to<=s||(r||(n=r=e.slice()),l.from<s?(r[o]=new to(l.from,s),l.to>a&&r.splice(o+1,0,new to(a,l.to))):l.to>a?r[o--]=new to(a,l.to):r.splice(o--,1))}}return n}function zCe(t,e,r,n){let i=0,o=0,s=!1,a=!1,l=-1e9,c=[];for(;;){let u=i==t.length?1e9:s?t[i].to:t[i].from,d=o==e.length?1e9:a?e[o].to:e[o].from;if(s!=a){let p=Math.max(l,r),h=Math.min(u,d,n);p<h&&c.push(new to(p,h))}if(l=Math.min(u,d),l==1e9)break;u==l&&(s?(s=!1,i++):s=!0),d==l&&(a?(a=!1,o++):a=!0)}return c}function q5(t,e){let r=[];for(let{pos:n,mount:i,frag:o}of t){let s=n+(i.overlay?i.overlay[0].from:0),a=s+i.tree.length,l=Math.max(o.from,s),c=Math.min(o.to,a);if(i.overlay){let u=i.overlay.map(p=>new to(p.from+n,p.to+n)),d=zCe(e,u,l,c);for(let p=0,h=l;;p++){let m=p==d.length,g=m?c:d[p].from;if(g>h&&r.push(new Oa(h,g,i.tree,-s,o.from>=h||o.openStart,o.to<=g||o.openEnd)),m)break;h=d[p].to}}else r.push(new Oa(l,c,i.tree,-s,o.from>=s||o.openStart,o.to<=a||o.openEnd))}return r}class yb{constructor(e,r,n,i,o,s,a,l,c,u=0,d){this.p=e,this.stack=r,this.state=n,this.reducePos=i,this.pos=o,this.score=s,this.buffer=a,this.bufferBase=l,this.curContext=c,this.lookAhead=u,this.parent=d}toString(){return`[${this.stack.filter((e,r)=>r%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,r,n=0){let i=e.parser.context;return new yb(e,[],r,n,n,0,[],0,i?new z5(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,r){this.stack.push(this.state,r,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var r;let n=e>>19,i=e&65535,{parser:o}=this.p,s=this.reducePos<this.pos-25;s&&this.setLookAhead(this.pos);let a=o.dynamicPrecedence(i);if(a&&(this.score+=a),n==0){this.pushState(o.getGoto(this.state,i,!0),this.reducePos),i<o.minRepeatTerm&&this.storeNode(i,this.reducePos,this.reducePos,s?8:4,!0),this.reduceContext(i,this.reducePos);return}let l=this.stack.length-(n-1)*3-(e&262144?6:0),c=l?this.stack[l-2]:this.p.ranges[0].from,u=this.reducePos-c;u>=2e3&&!(!((r=this.p.parser.nodeSet.types[i])===null||r===void 0)&&r.isAnonymous)&&(c==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSize<u&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=c,this.p.lastBigReductionSize=u));let d=l?this.stack[l-1]:0,p=this.bufferBase+this.buffer.length-d;if(i<o.minRepeatTerm||e&131072){let h=o.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(i,c,h,p+4,!0)}if(e&262144)this.state=this.stack[l];else{let h=this.stack[l-3];this.state=o.getGoto(h,i,!0)}for(;this.stack.length>l;)this.stack.pop();this.reduceContext(i,c)}storeNode(e,r,n,i=4,o=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let s=this,a=this.buffer.length;if(a==0&&s.parent&&(a=s.bufferBase-s.parent.bufferBase,s=s.parent),a>0&&s.buffer[a-4]==0&&s.buffer[a-1]>-1){if(r==n)return;if(s.buffer[a-2]>=r){s.buffer[a-2]=n;return}}}if(!o||this.pos==n)this.buffer.push(e,r,n,i);else{let s=this.buffer.length;if(s>0&&this.buffer[s-4]!=0){let a=!1;for(let l=s;l>0&&this.buffer[l-2]>n;l-=4)if(this.buffer[l-1]>=0){a=!0;break}if(a)for(;s>0&&this.buffer[s-2]>n;)this.buffer[s]=this.buffer[s-4],this.buffer[s+1]=this.buffer[s-3],this.buffer[s+2]=this.buffer[s-2],this.buffer[s+3]=this.buffer[s-1],s-=4,i>4&&(i-=4)}this.buffer[s]=e,this.buffer[s+1]=r,this.buffer[s+2]=n,this.buffer[s+3]=i}}shift(e,r,n,i){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let o=e,{parser:s}=this.p;(i>this.pos||r<=s.maxNode)&&(this.pos=i,s.stateFlag(o,1)||(this.reducePos=i)),this.pushState(o,n),this.shiftContext(r,n),r<=s.maxNode&&this.buffer.push(r,n,i,4)}else this.pos=i,this.shiftContext(r,n),r<=this.p.parser.maxNode&&this.buffer.push(r,n,i,4)}apply(e,r,n,i){e&65536?this.reduce(e):this.shift(e,r,n,i)}useNode(e,r){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let i=this.pos;this.reducePos=this.pos=i+e.length,this.pushState(r,i),this.buffer.push(n,i,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,r=e.buffer.length;for(;r>0&&e.buffer[r-2]>e.reducePos;)r-=4;let n=e.buffer.slice(r),i=e.bufferBase+r;for(;e&&i==e.bufferBase;)e=e.parent;return new yb(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,i,this.curContext,this.lookAhead,e)}recoverByDelete(e,r){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,r,4),this.storeNode(0,this.pos,r,n?8:4),this.pos=this.reducePos=r,this.score-=190}canShift(e){for(let r=new LCe(this);;){let n=this.p.parser.stateSlot(r.state,4)||this.p.parser.hasAction(r.state,e);if(n==0)return!1;if((n&65536)==0)return!0;r.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let r=this.p.parser.nextStates(this.state);if(r.length>8||this.stack.length>=120){let i=[];for(let o=0,s;o<r.length;o+=2)(s=r[o+1])!=this.state&&this.p.parser.hasAction(s,e)&&i.push(r[o],s);if(this.stack.length<120)for(let o=0;i.length<8&&o<r.length;o+=2){let s=r[o+1];i.some((a,l)=>l&1&&a==s)||i.push(r[o],s)}r=i}let n=[];for(let i=0;i<r.length&&n.length<4;i+=2){let o=r[i+1];if(o==this.state)continue;let s=this.split();s.pushState(o,this.pos),s.storeNode(0,s.pos,s.pos,4,!0),s.shiftContext(r[i],this.pos),s.reducePos=this.pos,s.score-=200,n.push(s)}return n}forceReduce(){let{parser:e}=this.p,r=e.stateSlot(this.state,5);if((r&65536)==0)return!1;if(!e.validAction(this.state,r)){let n=r>>19,i=r&65535,o=this.stack.length-n*3;if(o<0||e.getGoto(this.stack[o],i,!1)<0){let s=this.findForcedReduction();if(s==null)return!1;r=s}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(r),!0}findForcedReduction(){let{parser:e}=this.p,r=[],n=(i,o)=>{if(!r.includes(i))return r.push(i),e.allActions(i,s=>{if(!(s&393216))if(s&65536){let a=(s>>19)-o;if(a>1){let l=s&65535,c=this.stack.length-a*3;if(c>=0&&e.getGoto(this.stack[c],l,!1)>=0)return a<<19|65536|l}}else{let a=n(s,o+1);if(a!=null)return a}})};return n(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 r=0;r<this.stack.length;r+=3)if(this.stack[r]!=e.stack[r])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,r){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(r)))}reduceContext(e,r){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(r)))}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 r=new z5(this.curContext.tracker,e);r.hash!=this.curContext.hash&&this.emitContext(),this.curContext=r}}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 z5{constructor(e,r){this.tracker=e,this.context=r,this.hash=e.strict?e.hash(r):0}}class LCe{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let r=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],r,!0);this.state=i}}class vb{constructor(e,r,n){this.stack=e,this.pos=r,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,r=e.bufferBase+e.buffer.length){return new vb(e,r,r-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 vb(this.stack,this.pos,this.index)}}function xp(t,e=Uint16Array){if(typeof t!="string")return t;let r=null;for(let n=0,i=0;n<t.length;){let o=0;for(;;){let s=t.charCodeAt(n++),a=!1;if(s==126){o=65535;break}s>=92&&s--,s>=34&&s--;let l=s-32;if(l>=46&&(l-=46,a=!0),o+=l,a)break;o*=46}r?r[i++]=o:r=new e(o)}return r}class jy{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const L5=new jy;class VCe{constructor(e,r){this.input=e,this.ranges=r,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=L5,this.rangeIndex=0,this.pos=this.chunkPos=r[0].from,this.range=r[0],this.end=r[r.length-1].to,this.readNext()}resolveOffset(e,r){let n=this.range,i=this.rangeIndex,o=this.pos+e;for(;o<n.from;){if(!i)return null;let s=this.ranges[--i];o-=n.from-s.to,n=s}for(;r<0?o>n.to:o>=n.to;){if(i==this.ranges.length-1)return null;let s=this.ranges[++i];o+=s.from-n.to,n=s}return o}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let r of this.ranges)if(r.to>e)return Math.max(e,r.from);return this.end}peek(e){let r=this.chunkOff+e,n,i;if(r>=0&&r<this.chunk.length)n=this.pos+e,i=this.chunk.charCodeAt(r);else{let o=this.resolveOffset(e,1);if(o==null)return-1;if(n=o,n>=this.chunk2Pos&&n<this.chunk2Pos+this.chunk2.length)i=this.chunk2.charCodeAt(n-this.chunk2Pos);else{let s=this.rangeIndex,a=this.range;for(;a.to<=n;)a=this.ranges[++s];this.chunk2=this.input.chunk(this.chunk2Pos=n),n+this.chunk2.length>a.to&&(this.chunk2=this.chunk2.slice(0,a.to-n)),i=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),i}acceptToken(e,r=0){let n=r?this.resolveOffset(r,-1):this.pos;if(n==null||n<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=n}acceptTokenTo(e,r){this.token.value=e,this.token.end=r}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:r}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=r,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),r=this.pos+e.length;this.chunk=r>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,r){if(r?(this.token=r,r.start=e,r.lookAhead=e+1,r.value=r.extended=-1):this.token=L5,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,r){if(e>=this.chunkPos&&r<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,r-this.chunkPos);if(e>=this.chunk2Pos&&r<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,r-this.chunk2Pos);if(e>=this.range.from&&r<=this.range.to)return this.input.read(e,r);let n="";for(let i of this.ranges){if(i.from>=r)break;i.to>e&&(n+=this.input.read(Math.max(i.from,e),Math.min(i.to,r)))}return n}}class gd{constructor(e,r){this.data=e,this.id=r}token(e,r){let{parser:n}=r.p;mU(this.data,e,r,this.id,n.data,n.tokenPrecTable)}}gd.prototype.contextual=gd.prototype.fallback=gd.prototype.extend=!1;class bb{constructor(e,r,n){this.precTable=r,this.elseToken=n,this.data=typeof e=="string"?xp(e):e}token(e,r){let n=e.pos,i=0;for(;;){let o=e.next<0,s=e.resolveOffset(1,1);if(mU(this.data,e,r,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(o||i++,s==null)break;e.reset(s,e.token)}i&&(e.reset(n,e.token),e.acceptToken(this.elseToken,i))}}bb.prototype.contextual=gd.prototype.fallback=gd.prototype.extend=!1;class Lr{constructor(e,r={}){this.token=e,this.contextual=!!r.contextual,this.fallback=!!r.fallback,this.extend=!!r.extend}}function mU(t,e,r,n,i,o){let s=0,a=1<<n,{dialect:l}=r.p.parser;e:for(;(a&t[s])!=0;){let c=t[s+1];for(let h=s+3;h<c;h+=2)if((t[h+1]&a)>0){let m=t[h];if(l.allows(m)&&(e.token.value==-1||e.token.value==m||XCe(m,e.token.value,i,o))){e.acceptToken(m);break}}let u=e.next,d=0,p=t[s+2];if(e.next<0&&p>d&&t[c+p*3-3]==65535){s=t[c+p*3-1];continue e}for(;d<p;){let h=d+p>>1,m=c+h+(h<<1),g=t[m],O=t[m+1]||65536;if(u<g)p=h;else if(u>=O)d=h+1;else{s=t[m+2],e.advance();continue e}}break}}function V5(t,e,r){for(let n=e,i;(i=t[n])!=65535;n++)if(i==r)return n-e;return-1}function XCe(t,e,r,n){let i=V5(r,n,e);return i<0||V5(r,n,t)<i}const Pi=typeof process<"u"&&process.env&&/\bparse\b/.test(process.env.LOG);let lw=null;function X5(t,e,r){let n=t.cursor(fr.IncludeAnonymous);for(n.moveTo(e);;)if(!(r<0?n.childBefore(e):n.childAfter(e)))for(;;){if((r<0?n.to<e:n.from>e)&&!n.type.isError)return r<0?Math.max(0,Math.min(n.to-1,e-25)):Math.min(t.length,Math.max(n.from+1,e+25));if(r<0?n.prevSibling():n.nextSibling())break;if(!n.parent())return r<0?0:t.length}}class WCe{constructor(e,r){this.fragments=e,this.nodeSet=r,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?X5(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?X5(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 r=this.trees.length-1;if(r<0)return this.nextFragment(),null;let n=this.trees[r],i=this.index[r];if(i==n.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let o=n.children[i],s=this.start[r]+n.positions[i];if(s>e)return this.nextStart=s,null;if(o instanceof hr){if(s==e){if(s<this.safeFrom)return null;let a=s+o.length;if(a<=this.safeTo){let l=o.prop(mt.lookAhead);if(!l||a+l<this.fragment.to)return o}}this.index[r]++,s+o.length>=Math.max(this.safeFrom,e)&&(this.trees.push(o),this.start.push(s),this.index.push(0))}else this.index[r]++,this.nextStart=s+o.length}}}class UCe{constructor(e,r){this.stream=r,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(n=>new jy)}getActions(e){let r=0,n=null,{parser:i}=e.p,{tokenizers:o}=i,s=i.stateSlot(e.state,3),a=e.curContext?e.curContext.hash:0,l=0;for(let c=0;c<o.length;c++){if((1<<c&s)==0)continue;let u=o[c],d=this.tokens[c];if(!(n&&!u.fallback)&&((u.contextual||d.start!=e.pos||d.mask!=s||d.context!=a)&&(this.updateCachedToken(d,u,e),d.mask=s,d.context=a),d.lookAhead>d.end+25&&(l=Math.max(d.lookAhead,l)),d.value!=0)){let p=r;if(d.extended>-1&&(r=this.addActions(e,d.extended,d.end,r)),r=this.addActions(e,d.value,d.end,r),!u.extend&&(n=d,r>p))break}}for(;this.actions.length>r;)this.actions.pop();return l&&e.setLookAhead(l),!n&&e.pos==this.stream.end&&(n=new jy,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,r=this.addActions(e,n.value,n.end,r)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let r=new jy,{pos:n,p:i}=e;return r.start=n,r.end=Math.min(n+1,i.stream.end),r.value=n==i.stream.end?i.parser.eofTerm:0,r}updateCachedToken(e,r,n){let i=this.stream.clipPos(n.pos);if(r.token(this.stream.reset(i,e),n),e.value>-1){let{parser:o}=n.p;for(let s=0;s<o.specialized.length;s++)if(o.specialized[s]==e.value){let a=o.specializers[s](this.stream.read(e.start,e.end),n);if(a>=0&&n.p.parser.dialect.allows(a>>1)){(a&1)==0?e.value=a>>1:e.extended=a>>1;break}}}else e.value=0,e.end=this.stream.clipPos(i+1)}putAction(e,r,n,i){for(let o=0;o<i;o+=3)if(this.actions[o]==e)return i;return this.actions[i++]=e,this.actions[i++]=r,this.actions[i++]=n,i}addActions(e,r,n,i){let{state:o}=e,{parser:s}=e.p,{data:a}=s;for(let l=0;l<2;l++)for(let c=s.stateSlot(o,l?2:1);;c+=3){if(a[c]==65535)if(a[c+1]==1)c=aa(a,c+2);else{i==0&&a[c+1]==2&&(i=this.putAction(aa(a,c+2),r,n,i));break}a[c]==r&&(i=this.putAction(aa(a,c+1),r,n,i))}return i}}let BCe=class{constructor(e,r,n,i){this.parser=e,this.input=r,this.ranges=i,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 VCe(r,i),this.tokens=new UCe(e,this.stream),this.topTerm=e.top[1];let{from:o}=i[0];this.stacks=[yb.start(this,e.top[0],o)],this.fragments=n.length&&this.stream.end-o>e.bufferLength*4?new WCe(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,r=this.minStackPos,n=this.stacks=[],i,o;if(this.bigReductionCount>300&&e.length==1){let[s]=e;for(;s.forceReduce()&&s.stack.length&&s.stack[s.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let s=0;s<e.length;s++){let a=e[s];for(;;){if(this.tokens.mainToken=null,a.pos>r)n.push(a);else{if(this.advanceStack(a,n,e))continue;{i||(i=[],o=[]),i.push(a);let l=this.tokens.getMainToken(a);o.push(l.value,l.end)}}break}}if(!n.length){let s=i&&ZCe(i);if(s)return Pi&&console.log("Finish with "+this.stackID(s)),this.stackToTree(s);if(this.parser.strict)throw Pi&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+r);this.recovering||(this.recovering=5)}if(this.recovering&&i){let s=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,o,n);if(s)return Pi&&console.log("Force-finish "+this.stackID(s)),this.stackToTree(s.forceAll())}if(this.recovering){let s=this.recovering==1?1:this.recovering*3;if(n.length>s)for(n.sort((a,l)=>l.score-a.score);n.length>s;)n.pop();n.some(a=>a.reducePos>r)&&this.recovering--}else if(n.length>1){e:for(let s=0;s<n.length-1;s++){let a=n[s];for(let l=s+1;l<n.length;l++){let c=n[l];if(a.sameState(c)||a.buffer.length>500&&c.buffer.length>500)if((a.score-c.score||a.buffer.length-c.buffer.length)>0)n.splice(l--,1);else{n.splice(s--,1);continue e}}}n.length>12&&n.splice(12,n.length-12)}this.minStackPos=n[0].pos;for(let s=1;s<n.length;s++)n[s].pos<this.minStackPos&&(this.minStackPos=n[s].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,r,n){let i=e.pos,{parser:o}=this,s=Pi?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let c=e.curContext&&e.curContext.tracker.strict,u=c?e.curContext.hash:0;for(let d=this.fragments.nodeAt(i);d;){let p=this.parser.nodeSet.types[d.type.id]==d.type?o.getGoto(e.state,d.type.id):-1;if(p>-1&&d.length&&(!c||(d.prop(mt.contextHash)||0)==u))return e.useNode(d,p),Pi&&console.log(s+this.stackID(e)+` (via reuse of ${o.getName(d.type.id)})`),!0;if(!(d instanceof hr)||d.children.length==0||d.positions[0]>0)break;let h=d.children[0];if(h instanceof hr&&d.positions[0]==0)d=h;else break}}let a=o.stateSlot(e.state,4);if(a>0)return e.reduce(a),Pi&&console.log(s+this.stackID(e)+` (via always-reduce ${o.getName(a&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let c=0;c<l.length;){let u=l[c++],d=l[c++],p=l[c++],h=c==l.length||!n,m=h?e:e.split(),g=this.tokens.mainToken;if(m.apply(u,d,g?g.start:m.pos,p),Pi&&console.log(s+this.stackID(m)+` (via ${(u&65536)==0?"shift":`reduce of ${o.getName(u&65535)}`} for ${o.getName(d)} @ ${i}${m==e?"":", split"})`),h)return!0;m.pos>i?r.push(m):n.push(m)}return!1}advanceFully(e,r){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return W5(e,r),!0}}runRecovery(e,r,n){let i=null,o=!1;for(let s=0;s<e.length;s++){let a=e[s],l=r[s<<1],c=r[(s<<1)+1],u=Pi?this.stackID(a)+" -> ":"";if(a.deadEnd&&(o||(o=!0,a.restart(),Pi&&console.log(u+this.stackID(a)+" (restarted)"),this.advanceFully(a,n))))continue;let d=a.split(),p=u;for(let h=0;d.forceReduce()&&h<10&&(Pi&&console.log(p+this.stackID(d)+" (via force-reduce)"),!this.advanceFully(d,n));h++)Pi&&(p=this.stackID(d)+" -> ");for(let h of a.recoverByInsert(l))Pi&&console.log(u+this.stackID(h)+" (via recover-insert)"),this.advanceFully(h,n);this.stream.end>a.pos?(c==a.pos&&(c++,l=0),a.recoverByDelete(l,c),Pi&&console.log(u+this.stackID(a)+` (via recover-delete ${this.parser.getName(l)})`),W5(a,n)):(!i||i.score<a.score)&&(i=a)}return i}stackToTree(e){return e.close(),hr.build({buffer:vb.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 r=(lw||(lw=new WeakMap)).get(e);return r||lw.set(e,r=String.fromCodePoint(this.nextStackID++)),r+e}};function W5(t,e){for(let r=0;r<e.length;r++){let n=e[r];if(n.pos==t.pos&&n.sameState(t)){e[r].score<t.score&&(e[r]=t);return}}e.push(t)}class FCe{constructor(e,r,n){this.source=e,this.flags=r,this.disabled=n}allows(e){return!this.disabled||this.disabled[e]==0}}const cw=t=>t;class $g{constructor(e){this.start=e.start,this.shift=e.shift||cw,this.reduce=e.reduce||cw,this.reuse=e.reuse||cw,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class Ro extends qE{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let r=e.nodeNames.split(" ");this.minRepeatTerm=r.length;for(let a=0;a<e.repeatNodeCount;a++)r.push("");let n=Object.keys(e.topRules).map(a=>e.topRules[a][1]),i=[];for(let a=0;a<r.length;a++)i.push([]);function o(a,l,c){i[a].push([l,l.deserialize(String(c))])}if(e.nodeProps)for(let a of e.nodeProps){let l=a[0];typeof l=="string"&&(l=mt[l]);for(let c=1;c<a.length;){let u=a[c++];if(u>=0)o(u,l,a[c++]);else{let d=a[c+-u];for(let p=-u;p>0;p--)o(a[c++],l,d);c++}}}this.nodeSet=new Cx(r.map((a,l)=>Ln.define({name:l>=this.minRepeatTerm?void 0:a,id:l,props:i[l],top:n.indexOf(l)>-1,error:l==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(l)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=fU;let s=xp(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let a=0;a<this.specializerSpecs.length;a++)this.specialized[a]=this.specializerSpecs[a].term;this.specializers=this.specializerSpecs.map(U5),this.states=xp(e.states,Uint32Array),this.data=xp(e.stateData),this.goto=xp(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(a=>typeof a=="number"?new gd(s,a):a),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,r,n){let i=new BCe(this,e,r,n);for(let o of this.wrappers)i=o(i,e,r,n);return i}getGoto(e,r,n=!1){let i=this.goto;if(r>=i[0])return-1;for(let o=i[r+1];;){let s=i[o++],a=s&1,l=i[o++];if(a&&n)return l;for(let c=o+(s>>1);o<c;o++)if(i[o]==e)return l;if(a)return-1}}hasAction(e,r){let n=this.data;for(let i=0;i<2;i++)for(let o=this.stateSlot(e,i?2:1),s;;o+=3){if((s=n[o])==65535)if(n[o+1]==1)s=n[o=aa(n,o+2)];else{if(n[o+1]==2)return aa(n,o+2);break}if(s==r||s==0)return aa(n,o+1)}return 0}stateSlot(e,r){return this.states[e*6+r]}stateFlag(e,r){return(this.stateSlot(e,0)&r)>0}validAction(e,r){return!!this.allActions(e,n=>n==r?!0:null)}allActions(e,r){let n=this.stateSlot(e,4),i=n?r(n):void 0;for(let o=this.stateSlot(e,1);i==null;o+=3){if(this.data[o]==65535)if(this.data[o+1]==1)o=aa(this.data,o+2);else break;i=r(aa(this.data,o+1))}return i}nextStates(e){let r=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=aa(this.data,n+2);else break;if((this.data[n+2]&1)==0){let i=this.data[n+1];r.some((o,s)=>s&1&&o==i)||r.push(this.data[n],i)}}return r}configure(e){let r=Object.assign(Object.create(Ro.prototype),this);if(e.props&&(r.nodeSet=this.nodeSet.extend(...e.props)),e.top){let n=this.topRules[e.top];if(!n)throw new RangeError(`Invalid top rule name ${e.top}`);r.top=n}return e.tokenizers&&(r.tokenizers=this.tokenizers.map(n=>{let i=e.tokenizers.find(o=>o.from==n);return i?i.to:n})),e.specializers&&(r.specializers=this.specializers.slice(),r.specializerSpecs=this.specializerSpecs.map((n,i)=>{let o=e.specializers.find(a=>a.from==n.external);if(!o)return n;let s=Object.assign(Object.assign({},n),{external:o.to});return r.specializers[i]=U5(s),s})),e.contextTracker&&(r.context=e.contextTracker),e.dialect&&(r.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(r.strict=e.strict),e.wrap&&(r.wrappers=r.wrappers.concat(e.wrap)),e.bufferLength!=null&&(r.bufferLength=e.bufferLength),r}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 r=this.dynamicPrecedences;return r==null?0:r[e]||0}parseDialect(e){let r=Object.keys(this.dialects),n=r.map(()=>!1);if(e)for(let o of e.split(" ")){let s=r.indexOf(o);s>=0&&(n[s]=!0)}let i=null;for(let o=0;o<r.length;o++)if(!n[o])for(let s=this.dialects[r[o]],a;(a=this.data[s++])!=65535;)(i||(i=new Uint8Array(this.maxTerm+1)))[a]=1;return new FCe(e,n,i)}static deserialize(e){return new Ro(e)}}function aa(t,e){return t[e]|t[e+1]<<16}function ZCe(t){let e=null;for(let r of t){let n=r.p.stoppedAt;(r.pos==r.p.stream.end||n!=null&&r.pos>n)&&r.p.parser.stateFlag(r.state,2)&&(!e||e.score<r.score)&&(e=r)}return e}function U5(t){if(t.external){let e=t.extend?1:0;return(r,n)=>t.external(r,n)<<1|e}return t.get}let YCe=0,la=class n${constructor(e,r,n,i){this.name=e,this.set=r,this.base=n,this.modified=i,this.id=YCe++}toString(){let{name:e}=this;for(let r of this.modified)r.name&&(e=`${r.name}(${e})`);return e}static define(e,r){let n=typeof e=="string"?e:"?";if(e instanceof n$&&(r=e),r?.base)throw new Error("Can not derive from a modified tag");let i=new n$(n,[],null,[]);if(i.set.push(i),r)for(let o of r.set)i.set.push(o);return i}static defineModifier(e){let r=new xb(e);return n=>n.modified.indexOf(r)>-1?n:xb.get(n.base||n,n.modified.concat(r).sort((i,o)=>i.id-o.id))}},GCe=0;class xb{constructor(e){this.name=e,this.instances=[],this.id=GCe++}static get(e,r){if(!r.length)return e;let n=r[0].instances.find(a=>a.base==e&&HCe(r,a.modified));if(n)return n;let i=[],o=new la(e.name,i,e,r);for(let a of r)a.instances.push(o);let s=JCe(r);for(let a of e.set)if(!a.modified.length)for(let l of s)i.push(xb.get(a,l));return o}}function HCe(t,e){return t.length==e.length&&t.every((r,n)=>r==e[n])}function JCe(t){let e=[[]];for(let r=0;r<t.length;r++)for(let n=0,i=e.length;n<i;n++)e.push(e[n].concat(t[r]));return e.sort((r,n)=>n.length-r.length)}function Ma(t){let e=Object.create(null);for(let r in t){let n=t[r];Array.isArray(n)||(n=[n]);for(let i of r.split(" "))if(i){let o=[],s=2,a=i;for(let d=0;;){if(a=="..."&&d>0&&d+3==i.length){s=1;break}let p=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!p)throw new RangeError("Invalid path: "+i);if(o.push(p[0]=="*"?"":p[0][0]=='"'?JSON.parse(p[0]):p[0]),d+=p[0].length,d==i.length)break;let h=i[d++];if(d==i.length&&h=="!"){s=0;break}if(h!="/")throw new RangeError("Invalid path: "+i);a=i.slice(d)}let l=o.length-1,c=o[l];if(!c)throw new RangeError("Invalid path: "+i);let u=new Sb(n,s,l>0?o.slice(0,l):null);e[c]=u.sort(e[c])}}return OU.add(e)}const OU=new mt;class Sb{constructor(e,r,n,i){this.tags=e,this.mode=r,this.context=n,this.next=i}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}}Sb.empty=new Sb([],2,null);function yU(t,e){let r=Object.create(null);for(let o of t)if(!Array.isArray(o.tag))r[o.tag.id]=o.class;else for(let s of o.tag)r[s.id]=o.class;let{scope:n,all:i=null}=e||{};return{style:o=>{let s=i;for(let a of o)for(let l of a.set){let c=r[l.id];if(c){s=s?s+" "+c:c;break}}return s},scope:n}}function KCe(t,e){let r=null;for(let n of t){let i=n.style(e);i&&(r=r?r+" "+i:i)}return r}function e$e(t,e,r,n=0,i=t.length){let o=new t$e(n,Array.isArray(e)?e:[e],r);o.highlightRange(t.cursor(),n,i,"",o.highlighters),o.flush(i)}class t$e{constructor(e,r,n){this.at=e,this.highlighters=r,this.span=n,this.class=""}startSpan(e,r){r!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=r)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,r,n,i,o){let{type:s,from:a,to:l}=e;if(a>=n||l<=r)return;s.isTop&&(o=this.highlighters.filter(h=>!h.scope||h.scope(s)));let c=i,u=r$e(e)||Sb.empty,d=KCe(o,u.tags);if(d&&(c&&(c+=" "),c+=d,u.mode==1&&(i+=(i?" ":"")+d)),this.startSpan(Math.max(r,a),c),u.opaque)return;let p=e.tree&&e.tree.prop(mt.mounted);if(p&&p.overlay){let h=e.node.enter(p.overlay[0].from+a,1),m=this.highlighters.filter(O=>!O.scope||O.scope(p.tree.type)),g=e.firstChild();for(let O=0,y=a;;O++){let v=O<p.overlay.length?p.overlay[O]:null,b=v?v.from+a:l,w=Math.max(r,y),S=Math.min(n,b);if(w<S&&g)for(;e.from<S&&(this.highlightRange(e,w,S,i,o),this.startSpan(Math.min(S,e.to),c),!(e.to>=b||!e.nextSibling())););if(!v||b>n)break;y=v.to+a,y>r&&(this.highlightRange(h.cursor(),Math.max(r,v.from+a),Math.min(n,y),"",m),this.startSpan(Math.min(n,y),c))}g&&e.parent()}else if(e.firstChild()){p&&(i="");do if(!(e.to<=r)){if(e.from>=n)break;this.highlightRange(e,r,n,i,o),this.startSpan(Math.min(n,e.to),c)}while(e.nextSibling());e.parent()}}}function r$e(t){let e=t.type.prop(OU);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const Ne=la.define,PO=Ne(),ol=Ne(),B5=Ne(ol),F5=Ne(ol),sl=Ne(),CO=Ne(sl),uw=Ne(sl),os=Ne(),oc=Ne(os),Ho=Ne(),Jo=Ne(),i$=Ne(),ep=Ne(i$),$O=Ne(),N={comment:PO,lineComment:Ne(PO),blockComment:Ne(PO),docComment:Ne(PO),name:ol,variableName:Ne(ol),typeName:B5,tagName:Ne(B5),propertyName:F5,attributeName:Ne(F5),className:Ne(ol),labelName:Ne(ol),namespace:Ne(ol),macroName:Ne(ol),literal:sl,string:CO,docString:Ne(CO),character:Ne(CO),attributeValue:Ne(CO),number:uw,integer:Ne(uw),float:Ne(uw),bool:Ne(sl),regexp:Ne(sl),escape:Ne(sl),color:Ne(sl),url:Ne(sl),keyword:Ho,self:Ne(Ho),null:Ne(Ho),atom:Ne(Ho),unit:Ne(Ho),modifier:Ne(Ho),operatorKeyword:Ne(Ho),controlKeyword:Ne(Ho),definitionKeyword:Ne(Ho),moduleKeyword:Ne(Ho),operator:Jo,derefOperator:Ne(Jo),arithmeticOperator:Ne(Jo),logicOperator:Ne(Jo),bitwiseOperator:Ne(Jo),compareOperator:Ne(Jo),updateOperator:Ne(Jo),definitionOperator:Ne(Jo),typeOperator:Ne(Jo),controlOperator:Ne(Jo),punctuation:i$,separator:Ne(i$),bracket:ep,angleBracket:Ne(ep),squareBracket:Ne(ep),paren:Ne(ep),brace:Ne(ep),content:os,heading:oc,heading1:Ne(oc),heading2:Ne(oc),heading3:Ne(oc),heading4:Ne(oc),heading5:Ne(oc),heading6:Ne(oc),contentSeparator:Ne(os),list:Ne(os),quote:Ne(os),emphasis:Ne(os),strong:Ne(os),link:Ne(os),monospace:Ne(os),strikethrough:Ne(os),inserted:Ne(),deleted:Ne(),changed:Ne(),invalid:Ne(),meta:$O,documentMeta:Ne($O),annotation:Ne($O),processingInstruction:Ne($O),definition:la.defineModifier("definition"),constant:la.defineModifier("constant"),function:la.defineModifier("function"),standard:la.defineModifier("standard"),local:la.defineModifier("local"),special:la.defineModifier("special")};for(let t in N){let e=N[t];e instanceof la&&(e.name=t)}yU([{tag:N.link,class:"tok-link"},{tag:N.heading,class:"tok-heading"},{tag:N.emphasis,class:"tok-emphasis"},{tag:N.strong,class:"tok-strong"},{tag:N.keyword,class:"tok-keyword"},{tag:N.atom,class:"tok-atom"},{tag:N.bool,class:"tok-bool"},{tag:N.url,class:"tok-url"},{tag:N.labelName,class:"tok-labelName"},{tag:N.inserted,class:"tok-inserted"},{tag:N.deleted,class:"tok-deleted"},{tag:N.literal,class:"tok-literal"},{tag:N.string,class:"tok-string"},{tag:N.number,class:"tok-number"},{tag:[N.regexp,N.escape,N.special(N.string)],class:"tok-string2"},{tag:N.variableName,class:"tok-variableName"},{tag:N.local(N.variableName),class:"tok-variableName tok-local"},{tag:N.definition(N.variableName),class:"tok-variableName tok-definition"},{tag:N.special(N.variableName),class:"tok-variableName2"},{tag:N.definition(N.propertyName),class:"tok-propertyName tok-definition"},{tag:N.typeName,class:"tok-typeName"},{tag:N.namespace,class:"tok-namespace"},{tag:N.className,class:"tok-className"},{tag:N.macroName,class:"tok-macroName"},{tag:N.propertyName,class:"tok-propertyName"},{tag:N.operator,class:"tok-operator"},{tag:N.comment,class:"tok-comment"},{tag:N.meta,class:"tok-meta"},{tag:N.invalid,class:"tok-invalid"},{tag:N.punctuation,class:"tok-punctuation"}]);const n$e=Ma({String:N.string,Number:N.number,"True False":N.bool,PropertyName:N.propertyName,Null:N.null,",":N.separator,"[ ]":N.squareBracket,"{ }":N.brace}),i$e=Ro.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:[n$e],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 o$=[],vU=[];(()=>{let t="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,r=0;e<t.length;e++)(e%2?vU:o$).push(r=r+t[e])})();function o$e(t){if(t<768)return!1;for(let e=0,r=o$.length;;){let n=e+r>>1;if(t<o$[n])r=n;else if(t>=vU[n])e=n+1;else return!0;if(e==r)return!1}}function Z5(t){return t>=127462&&t<=127487}const Y5=8205;function s$e(t,e,r=!0,n=!0){return(r?bU:a$e)(t,e,n)}function bU(t,e,r){if(e==t.length)return e;e&&xU(t.charCodeAt(e))&&SU(t.charCodeAt(e-1))&&e--;let n=dw(t,e);for(e+=G5(n);e<t.length;){let i=dw(t,e);if(n==Y5||i==Y5||r&&o$e(i))e+=G5(i),n=i;else if(Z5(i)){let o=0,s=e-2;for(;s>=0&&Z5(dw(t,s));)o++,s-=2;if(o%2==0)break;e+=2}else break}return e}function a$e(t,e,r){for(;e>0;){let n=bU(t,e-2,r);if(n<e)return n;e--}return 0}function dw(t,e){let r=t.charCodeAt(e);if(!SU(r)||e+1==t.length)return r;let n=t.charCodeAt(e+1);return xU(n)?(r-55296<<10)+(n-56320)+65536:r}function xU(t){return t>=56320&&t<57344}function SU(t){return t>=55296&&t<56320}function G5(t){return t<65536?1:2}class jt{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,r,n){[e,r]=Md(this,e,r);let i=[];return this.decompose(0,e,i,2),n.length&&n.decompose(0,n.length,i,3),this.decompose(r,this.length,i,1),fs.from(i,this.length-(r-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,r=this.length){[e,r]=Md(this,e,r);let n=[];return this.decompose(e,r,n,0),fs.from(n,r-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let r=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),i=new Lp(this),o=new Lp(e);for(let s=r,a=r;;){if(i.next(s),o.next(s),s=0,i.lineBreak!=o.lineBreak||i.done!=o.done||i.value!=o.value)return!1;if(a+=i.value.length,i.done||a>=n)return!0}}iter(e=1){return new Lp(this,e)}iterRange(e,r=this.length){return new wU(this,e,r)}iterLines(e,r){let n;if(e==null)n=this.iter();else{r==null&&(r=this.lines+1);let i=this.line(e).from;n=this.iterRange(i,Math.max(i,r==this.lines+1?this.length:r<=1?0:this.line(r-1).to))}return new PU(n)}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]?jt.empty:e.length<=32?new Mr(e):fs.from(Mr.split(e,[]))}}class Mr extends jt{constructor(e,r=l$e(e)){super(),this.text=e,this.length=r}get lines(){return this.text.length}get children(){return null}lineInner(e,r,n,i){for(let o=0;;o++){let s=this.text[o],a=i+s.length;if((r?n:a)>=e)return new c$e(i,a,n,s);i=a+1,n++}}decompose(e,r,n,i){let o=e<=0&&r>=this.length?this:new Mr(H5(this.text,e,r),Math.min(r,this.length)-Math.max(0,e));if(i&1){let s=n.pop(),a=Qy(o.text,s.text.slice(),0,o.length);if(a.length<=32)n.push(new Mr(a,s.length+o.length));else{let l=a.length>>1;n.push(new Mr(a.slice(0,l)),new Mr(a.slice(l)))}}else n.push(o)}replace(e,r,n){if(!(n instanceof Mr))return super.replace(e,r,n);[e,r]=Md(this,e,r);let i=Qy(this.text,Qy(n.text,H5(this.text,0,e)),r),o=this.length+n.length-(r-e);return i.length<=32?new Mr(i,o):fs.from(Mr.split(i,[]),o)}sliceString(e,r=this.length,n=`
@@ -414,7 +414,7 @@ $3`);return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}}function lQe(t){return t.
414
414
  `];let y=-1,v=0;for(const b of O){const w=t.indexOf(b,u);if(w!==-1&&w<l.start){y=w,v=b.length;break}}if(y!==-1)d=y+v;else{const b=[`
415
415
  `,`\r
416
416
  `];for(const w of b){const S=t.indexOf(w,u);if(S!==-1&&S<l.start){d=S+w.length;break}}}}const g=l.start;e.push({boundaryStart:a.start,boundaryEnd:a.end,headersStart:c,headersEnd:u,bodyStart:d,bodyEnd:g,contentType:p})}return e}const BQe=()=>gr.fromClass(class{decorations;constructor(t){this.decorations=this.buildDecorations(t)}update(t){(t.docChanged||t.viewportChanged)&&(this.decorations=this.buildDecorations(t.view))}buildDecorations(t){const e=t.state.doc.toString(),r=[],n=Me.mark({attributes:{style:"color: var(--color-carrot-8); font-weight: var(--font-weight-semibold);"}}),i=Me.mark({attributes:{style:"color: var(--color-blue-8);"}}),o=Me.mark({attributes:{style:"color: var(--color-purple-8);"}}),s=UQe(e),a=/^--[a-zA-Z0-9_\-\.]+(?:--)?(?:\r?\n|$)/gm,l=[];let c;for(;(c=a.exec(e))!==null;)l.push({start:c.index,end:c.index+c[0].length});for(const m of l)t.visibleRanges.some(O=>Math.max(O.from,m.start)<Math.min(O.to,m.end))&&r.push({from:m.start,to:m.end,value:n});const u=/^([a-zA-Z0-9\-]+):\s*(.+?)(?:\r?\n|$)/gm;for(const m of s){u.lastIndex=m.headersStart;let g;for(;(g=u.exec(e))!==null&&g.index<m.headersEnd;){const y=g.index+g[1].length+1+(g[2].match(/^\s*/)?.[0]?.length||0),v=g.index+g[0].length-(g[0].match(/\r?\n$/)?.[0]?.length||0);t.visibleRanges.some(w=>Math.max(w.from,y)<Math.min(w.to,v))&&v>y&&r.push({from:y,to:v,value:i})}}const d=/\[Binary\s+Data\]/gi;let p;for(;(p=d.exec(e))!==null;){const m=p.index,g=p[0].length;t.visibleRanges.some(y=>Math.max(y.from,m)<Math.min(y.to,m+g))&&r.push({from:m,to:m+g,value:o})}const h=Me.mark({attributes:{style:"color: var(--color-blue-8);"}});for(const m of s)if(m.contentType?.includes("json")){const g=e.slice(m.bodyStart,m.bodyEnd),O=g.trim();if(!O)continue;const y=g.length-g.trimStart().length,v=m.bodyStart+y;let b;try{const S=Kd.create("inmemory://model.json","json",0,O),C=VQe.parseJSONDocument(S)?.root;b=XQe(C)?C:void 0}catch{b=void 0}if(!b)continue;const w=WQe(b);for(const S of w){const P=v+S.from,C=v+S.to;if(!t.visibleRanges.some(_=>Math.max(_.from,P)<Math.min(_.to,C))||!(e[P]==='"'&&e[C-1]==='"'))continue;const R=P+1,D=C-1;D<=R||r.push({from:R,to:D,value:h})}}return Me.set(r,!0)}},{decorations:t=>t.decorations}),FQe=()=>gr.fromClass(class{decorations;constructor(t){this.decorations=this.buildDecorations(t)}update(t){(t.docChanged||t.viewportChanged)&&(this.decorations=this.buildDecorations(t.view))}buildDecorations(t){const e=t.state.doc.toString(),r=[],n=Me.mark({attributes:{style:"color: var(--color-blue-8);"}}),i=/^([a-zA-Z0-9\-]+):\s*(.+?)(?:\r?\n|$)/gm;let o;for(;(o=i.exec(e))!==null;){let l=o.index+o[1].length+1;for(;l<e.length&&/\s/.test(e[l]);)l++;const u=o.index+o[0].length-(o[0].match(/\r?\n$/)?.[0]?.length||0);u<=l||!t.visibleRanges.some(p=>Math.max(p.from,l)<Math.min(p.to,u))||r.push({from:l,to:u,value:n})}return Me.set(r,!0)}},{decorations:t=>t.decorations}),ZQe=qx({});function YQe(t){if(!t||typeof t!="object")return!1;const e=t;return typeof e.type=="string"&&typeof e.offset=="number"&&typeof e.length=="number"}function GQe(t){const e=[];if(!t)return e;const r=[t];for(;r.length>0;){const n=r.pop();if(n.type==="property"){n.valueNode&&r.push(n.valueNode);continue}if(n.type==="string"){const i=n.offset,o=n.offset+n.length;o>i&&e.push({from:i,to:o})}if(n.children&&n.children.length)for(const i of n.children)r.push(i)}return e}const Gw=()=>gr.fromClass(class{decorations;constructor(t){this.decorations=this.buildDecorations(t)}update(t){(t.docChanged||t.viewportChanged)&&(this.decorations=this.buildDecorations(t.view))}buildDecorations(t){const e=t.state.doc.toString(),r=[],n=Me.mark({attributes:{style:"color: var(--color-blue-8);"}}),i=Me.mark({attributes:{style:"color: var(--code-block-tokens-keyword-color); font-weight: var(--font-weight-bold);"}}),o=e.split(/\r?\n/);let s=0;for(let a=0;a<o.length;a++){const l=o[a],c=s,u=s+l.length;if(!l.trim()){s=u+(e[s+l.length]==="\r"?2:1);continue}let d=c,p=l;l.startsWith("0x1E")?(d=c+4,p=l.substring(4),r.push({from:c,to:c+4,value:i})):l.charCodeAt(0)===30&&(d=c+1,p=l.substring(1),r.push({from:c,to:c+1,value:i})),l.endsWith("0x0A")?(p=p.substring(0,p.length-4),r.push({from:u-4,to:u,value:i})):l.charCodeAt(l.length-1)===10&&(p=p.substring(0,p.length-1),r.push({from:u-1,to:u,value:i}));let h;try{const g=Kd.create("inmemory://model.json","json",0,p),y=ZQe.parseJSONDocument(g)?.root;h=YQe(y)?y:void 0}catch{h=void 0}if(!h){s=u+(e[s+l.length]==="\r"?2:1);continue}const m=GQe(h);for(const g of m){const O=d+g.from,y=d+g.to;if(!t.visibleRanges.some(S=>Math.max(S.from,O)<Math.min(S.to,y))||!(e[O]==='"'&&e[y-1]==='"'))continue;const b=O+1,w=y-1;w<=b||r.push({from:b,to:w,value:n})}s=u+(e[s+l.length]==="\r"?2:1)}return Me.set(r,!0)}},{decorations:t=>t.decorations}),bf={[zr.Text]:{name:"Text",extensions:[Qe.lineWrapping],stateExtensions:[Ek]},[zr.JSON]:{name:"JSON",extensions:[gB(),S2e(_Qe(),{delay:0,needsRefresh:t=>t.transactions.some(e=>e.effects.some(r=>r.is(OZ)))}),hB.data.of({autocomplete:QQe()}),jQe],stateExtensions:[RQe,LQe]},[zr.XML]:{name:"XML",extensions:[u2e()],stateExtensions:[Ek]}},yZ={[zr.MultipartMixed]:{name:"Multipart Mixed",extensions:[Qe.lineWrapping],stateExtensions:[BQe]},[zr.JSONL]:{name:"JSON Lines",extensions:[Qe.lineWrapping],stateExtensions:[Gw]},[zr.NDJSON]:{name:"NDJSON",extensions:[gB(),Qe.lineWrapping],stateExtensions:[Gw]},[zr.JSONSeq]:{name:"JSON Sequence",extensions:[Qe.lineWrapping],stateExtensions:[Gw]},[zr.TextStream]:{name:"SSE",extensions:[Qe.lineWrapping],stateExtensions:[FQe]}},vZ={[zr.Image]:{name:"Image",extensions:[],stateExtensions:[]}},bZ={[zr.HTML]:{name:"HTML",extensions:[zRe()],stateExtensions:[Ek]}},$p={...bf,...vZ,...bZ,...yZ},RA={...bf,...vZ,...bZ},Sc={...bf,...yZ},xZ={[zr.FormData]:{name:"form-data",extensions:void 0},[zr["application/x-www-form-urlencoded"]]:{name:"x-www-form-urlencoded",extensions:void 0}},SZ={[zr.Binary]:{name:"Binary",extensions:void 0}},Lc={...bf,...xZ,...SZ},HQe=Object.keys(bf),Gb=Object.keys(xZ),wZ=Object.keys(SZ);function PZ(t=[],e){const r={};return t.forEach(n=>{const i=String(n[e]);r[i]||(r[i]=[]),r[i].push(n)}),r}const Dg={active:!0,key:"",value:""};function yl(t,e){return[...t.map(n=>({id:crypto.randomUUID(),key:n.name,value:e.initializeWithInputs?`$inputs.${n.name}`:n.example?String(n.example):"",active:e.initializeWithInputs?!0:!!n.example,in:n.in})),yr(e.in)]}function Ng(t,e){const[r]=t.split("?"),n=e.slice(0,-1).filter(i=>i.active).map(i=>`${i.key}=${i.value}`).join("&");return`${r}${n?`?${n}`:""}`}function oo(){return{id:crypto.randomUUID(),...Dg}}function pi(){return{id:crypto.randomUUID(),...Dg,description:""}}function yr(t){return{...Dg,id:crypto.randomUUID(),in:t}}function xa(){return{id:crypto.randomUUID(),...Dg,type:"text",files:null}}function _A(){return{id:crypto.randomUUID(),...Dg,sendIn:Mn.URL}}function Hw(t){return t.map(e=>({id:crypto.randomUUID(),key:"",value:e,active:!0}))}function Lx(t,e){return t.filter(r=>r.active&&r.value).map(({value:r})=>(e?rr(r,e):r).trim())}function $l(t,e){const n=e.filter(i=>!!i).flatMap(i=>i).filter(i=>i.key&&i.active);return["path","header"].includes(t)?Array.from(new Map(n.map(i=>[i.key,i])).values()):n}function JQe(t,e){return t.map(({value:r,...n})=>({...n,value:rr(r,e)}))}function KQe(t,e){if(!t.startsWith("$components.parameters."))return null;const r=t.replace("$components.parameters.","");return r&&e[r]||null}function Er(t=[],e={}){const r=[];for(const n of t)if(bl(n)){const i=KQe(n.reference,e);i&&r.push({...i,active:n.active,value:n.value||i.value})}else r.push(n);return r}function al(t){return Object.entries(t).map(([e,r])=>({id:crypto.randomUUID(),key:"",value:e,active:!0,description:r}))}function e5e(t){return t.replace(/{/g,"{{").replace(/}/g,"}}")}const g3={documentedOAuth2Types:[],grantType:Se.ClientCredentials,authRequestExtraParams:[oo()],tokenRequestExtraParams:[_A()],[Se.ClientCredentials]:{clientId:"",clientSecret:"",clientAssertion:"",tokenUrl:"",scopes:[pi()],accessToken:""},[Se.ClientCredentialsWithJwtAssertion]:{clientId:"",clientSecret:"",clientAssertion:"",tokenUrl:"",scopes:[pi()],accessToken:""},[Se.AuthorizationCode]:{clientId:"",clientSecret:"",tokenUrl:"",authorizationUrl:"",callbackUrl:"",availableScopes:[],scopes:[pi()],codeVerifier:"",codeChallenge:"",accessToken:""},[Se.AuthorizationCodeWithPkce]:{clientId:"",clientSecret:"",tokenUrl:"",authorizationUrl:"",callbackUrl:"",availableScopes:[],scopes:[pi()],codeVerifier:"",codeChallenge:"",accessToken:""},[Se.Implicit]:{clientId:"",authorizationUrl:"",callbackUrl:"",availableScopes:[],scopes:[pi()],accessToken:""},[Se.Password]:{username:"",password:"",clientId:"",clientSecret:"",tokenUrl:"",accessToken:"",scopes:[pi()]}},t5e={securityType:ve.NoAuth,securitySchemeId:null,[ve.BasicAuth]:{username:"",password:""},[ve.JWT]:{token:""},[ve.DigestAuth]:{username:"",password:"",nc:"00000001",realm:"",nonce:"",opaque:"",qop:"",algorithm:"",cnonce:""},[ve.APIKey]:{location:Di.Header,name:"",key:""},[ve.OAuth2]:g3,[ve.OpenIDConnect]:{...g3,openIdConnectUrl:"",userInfoUrl:""}},Ak="urn:ietf:params:oauth:client-assertion-type:jwt-bearer",r5e={[Qn.SIMPLE]:{condition:"",type:Qn.SIMPLE},[Qn.REGEX]:{condition:"",type:Qn.REGEX,context:""},[Qn.JSONPATH]:{condition:"",type:Qn.JSONPATH,context:""},[Qn.XPATH]:{condition:"",type:Qn.XPATH,context:""}};function Hb(){return structuredClone({type:on.Text,content:"",activeExampleName:"",formData:{"multipart/form-data":[xa()],"application/x-www-form-urlencoded":[xa()]},binary:null})}const n5e={method:"GET",url:"",security:[Lo()],body:Hb(),queryParameters:[oo()],headers:[oo()],cookies:[oo()],pathParameters:[oo()]};function CZ(){return structuredClone(n5e)}function Lo(){return ma(t5e)}function i5e(t){return ma({id:crypto.randomUUID(),...r5e[t]})}function $Z(t,e,r){for(const n of r){const i=m3(t,n),o=m3(e,n);if(typeof i=="object"&&typeof o=="object"){if(!$Z(i,o,r))return!1}else if(i!==o)return!1}return!0}function m3(t,e){const r=e.split("/");let n=t;for(const i of r)if(n&&typeof n=="object"&&i in n)n=n[i];else return;return n}function o5e(t,e){return t.length===e.length&&t.sort().join()===e.sort().join()}function s5e(t,e){return t.every(r=>e.includes(r))}function a5e(t){switch(t){case"query":return Di.Query;case"cookie":return Di.Cookie;case"header":return Di.Header;default:return}}function l5e(t,e,r){const{security:n}=e,i=Bxe(t);if(!r)return!1;const o=jA(r),s=o.map(u=>u.securityType),a=n.map(u=>u.securityType);if(!o5e(s,a))return!0;let c=[];return n.forEach(u=>{const d=u.securityType,p=u[ve.OAuth2]?.grantType,h=s.includes(d),m=o.find(v=>v.securityType===d),g=!m||$Z(u,m,u5e(d,p)),O=c5e(u,d,u[ve.OAuth2]?.grantType,i),y=!!(h&&m&&g&&O);c.push(!r.security?.length||y)}),c.includes(!1)}function c5e(t,e,r,n){if(e===ve.OAuth2&&(r===Se.AuthorizationCode||r===Se.AuthorizationCodeWithPkce||r===Se.Implicit)){const i=t[ve.OAuth2][r]?.availableScopes,o=Lx(t[ve.OAuth2][r]?.scopes,n);return s5e(o,i)}return!0}function u5e(t,e){return t===ve.APIKey?[`${ve.APIKey}/name`,`${ve.APIKey}/location`]:t===ve.OAuth2?[`${ve.OAuth2}/grantType`,...d5e(e)]:t===ve.OpenIDConnect?[`${ve.OpenIDConnect}/openIdConnectUrl`]:[]}function d5e(t){return t===Se.ClientCredentials?[`${ve.OAuth2}/${Se.ClientCredentials}/tokenUrl`]:t===Se.Password?[`${ve.OAuth2}/${Se.Password}/tokenUrl`]:t===Se.Implicit?[`${ve.OAuth2}/${Se.Implicit}/authorizationUrl`]:t===Se.AuthorizationCode?[`${ve.OAuth2}/${Se.AuthorizationCode}/tokenUrl`,`${ve.OAuth2}/${Se.AuthorizationCode}/authorizationUrl`]:t===Se.AuthorizationCodeWithPkce?[`${ve.OAuth2}/${Se.AuthorizationCodeWithPkce}/tokenUrl`,`${ve.OAuth2}/${Se.AuthorizationCodeWithPkce}/authorizationUrl`]:[]}function f5e(t){return t.map(e=>{const r=e.map(n=>n.id).join("_");return e.map(n=>({...n,schemeId:r}))})}function p5e(t){const e=t.security||[],r=e.map(n=>{let i="";const o=[];return n.forEach((s,a)=>{i=a===0?`${s.id}`:`${i}_${s.id}`,o.push(QA(s))}),{id:i,security:o}});return e.length?r:[]}function h5e(t,e){const r=t.security||[];return r?.length?AZ(r).map((n,i)=>QA(n)):[]}function jA(t){const r=(t.security||[])[0];return r?r.map(n=>QA(n)):[Lo()]}function QA(t,e){const r={...Lo(),securitySchemeId:t.id},n=Vx(t);r.securityType=n;const i=t.id;if(t.id&&n!==ve.NoAuth&&(r[n].schemeName=t.id),n===ve.BasicAuth&&(r[ve.BasicAuth].username||(r[ve.BasicAuth].username=Pr(i+Q.SecurityVariablesEnvSuffix.Username)),r[ve.BasicAuth].password||(r[ve.BasicAuth].password=Pr(i+Q.SecurityVariablesEnvSuffix.Password))),n===ve.DigestAuth&&(r[ve.DigestAuth].username||(r[ve.DigestAuth].username=Pr(i+Q.SecurityVariablesEnvSuffix.Username)),r[ve.DigestAuth].password||(r[ve.DigestAuth].password=Pr(i+Q.SecurityVariablesEnvSuffix.Password))),n===ve.JWT&&!r[ve.JWT].token&&(r[ve.JWT].token=Pr(i+Q.SecurityVariablesEnvSuffix.JWTToken)),n===ve.APIKey&&!r[ve.APIKey].key){r[ve.APIKey].name=t.name||"",r[ve.APIKey].key=Pr(i+Q.SecurityVariablesEnvSuffix.APIKey);const o=a5e(t.in);o&&(r[ve.APIKey].location=o)}if(n===ve.OAuth2){const o=NA(t),s=Pr(i+Q.SecurityVariablesEnvSuffix.Token),a=r[ve.OAuth2];a.grantType=o[0],o.forEach(l=>{l===Se.AuthorizationCode&&!a[Se.AuthorizationCode].accessToken&&(a[Se.AuthorizationCode].accessToken=s,a[Se.AuthorizationCode].clientId=Pr(i+Q.SecurityVariablesEnvSuffix.ClientId),a[Se.AuthorizationCode].authorizationUrl=t.flows?.authorizationCode?.authorizationUrl||"",a[Se.AuthorizationCode].tokenUrl=t.flows?.authorizationCode?.tokenUrl||"",a[Se.AuthorizationCode].clientSecret=Pr(i+Q.SecurityVariablesEnvSuffix.ClientSecret),a[Se.AuthorizationCode].availableScopes=Object.keys(t.flows?.authorizationCode?.scopes||{})||[],a[Se.AuthorizationCode].scopes=[...al(t.flows?.authorizationCode?.scopes||{})||[],pi()]),l===Se.AuthorizationCodeWithPkce&&!a[Se.AuthorizationCodeWithPkce].accessToken&&(a[Se.AuthorizationCodeWithPkce].accessToken=s,a[Se.AuthorizationCodeWithPkce].clientId=Pr(i+Q.SecurityVariablesEnvSuffix.ClientId),a[Se.AuthorizationCodeWithPkce].authorizationUrl=t.flows?.authorizationCode?.authorizationUrl||"",a[Se.AuthorizationCodeWithPkce].tokenUrl=t.flows?.authorizationCode?.tokenUrl||"",a[Se.AuthorizationCodeWithPkce].clientSecret=Pr(i+Q.SecurityVariablesEnvSuffix.ClientSecret),a[Se.AuthorizationCodeWithPkce].availableScopes=Object.keys(t.flows?.authorizationCode?.scopes||{})||[],a[Se.AuthorizationCodeWithPkce].scopes=[...al(t.flows?.authorizationCode?.scopes||{}),pi()]),l===Se.ClientCredentials&&!a[Se.ClientCredentials].accessToken&&(a[Se.ClientCredentials].accessToken=s,a[Se.ClientCredentials].clientId=Pr(i+Q.SecurityVariablesEnvSuffix.ClientId),a[Se.ClientCredentials].clientSecret=Pr(i+Q.SecurityVariablesEnvSuffix.ClientSecret),a[Se.ClientCredentials].tokenUrl=t.flows?.clientCredentials?.tokenUrl||"",a[Se.ClientCredentials].scopes=[...al(t.flows?.clientCredentials?.scopes||{}),pi()]),l===Se.ClientCredentialsWithJwtAssertion&&!a[Se.ClientCredentialsWithJwtAssertion].accessToken&&(a[Se.ClientCredentialsWithJwtAssertion].accessToken=s,a[Se.ClientCredentialsWithJwtAssertion].clientId=Pr(i+Q.SecurityVariablesEnvSuffix.ClientId),a[Se.ClientCredentialsWithJwtAssertion].clientAssertion=Pr(i+Q.SecurityVariablesEnvSuffix.ClientAssertion),a[Se.ClientCredentialsWithJwtAssertion].scopes=[...al(t.flows?.clientCredentials?.scopes||{}),pi()]),l===Se.Implicit&&!a[Se.Implicit].accessToken&&(a[Se.Implicit].accessToken=s,a[Se.Implicit].clientId=Pr(i+Q.SecurityVariablesEnvSuffix.ClientId),a[Se.Implicit].authorizationUrl=t.flows?.implicit?.authorizationUrl||"",a[Se.Implicit].availableScopes=Object.keys(t.flows?.implicit?.scopes||{})||[],a[Se.Implicit].scopes=[...al(t.flows?.implicit?.scopes||{}),pi()]),l===Se.Password&&!a[Se.Password].accessToken&&(a[Se.Password].accessToken=s,a[Se.Password].clientId=Pr(i+Q.SecurityVariablesEnvSuffix.ClientId),a[Se.Password].clientSecret=Pr(i+Q.SecurityVariablesEnvSuffix.ClientSecret),a[Se.Password].tokenUrl=t.flows?.password?.tokenUrl||"",a[Se.Password].scopes=[...al(t.flows?.password?.scopes||{}),pi()])})}if(n===ve.OpenIDConnect){const o=Pr(i+Q.SecurityVariablesEnvSuffix.Token),s=r[ve.OpenIDConnect];s[Se.AuthorizationCode].accessToken||(s[Se.AuthorizationCode].accessToken=o,s[Se.AuthorizationCode].clientId=Pr(i+Q.SecurityVariablesEnvSuffix.ClientId),s[Se.AuthorizationCode].clientSecret=Pr(i+Q.SecurityVariablesEnvSuffix.ClientSecret),s[Se.AuthorizationCode].tokenUrl=t.flows?.authorizationCode?.tokenUrl||""),s[Se.AuthorizationCodeWithPkce].accessToken||(s[Se.AuthorizationCodeWithPkce].accessToken=o,s[Se.AuthorizationCodeWithPkce].clientId=Pr(i+Q.SecurityVariablesEnvSuffix.ClientId),s[Se.AuthorizationCodeWithPkce].clientSecret=Pr(i+Q.SecurityVariablesEnvSuffix.ClientSecret),s[Se.AuthorizationCodeWithPkce].tokenUrl=t.flows?.authorizationCode?.tokenUrl||""),s[Se.Implicit].accessToken||(s[Se.Implicit].accessToken=o,s[Se.Implicit].clientId=Pr(i+Q.SecurityVariablesEnvSuffix.ClientId))}return r}function kZ(t){try{const e=JSON.parse(t);return JSON.stringify(e,null,2)}catch(e){return console.error({error:e}),t}}function g5e(t,e=!1,r="",n){const i=PZ(t.parameters,"in"),o=TZ(t),s=jA(t),a=yl(i.query||[],{in:"query"});return{id:crypto.randomUUID(),name:t.name,operationId:t.operationId,collectionPath:n,apiPath:{path:t.path,method:t.method},apiId:r,isAdditionalOperation:e,request:{pathParameters:yl(i.path||[],{in:"path"}),method:t.method.toLocaleUpperCase(),url:Ng(e5e(t.path),a),headers:yl(i.header||[],{in:"header"}),queryParameters:a,cookies:yl(i.cookie||[],{in:"cookie"}),body:o,security:s},response:null}}function DA(t){const e=PZ(t.parameters,"in"),r=TZ(t),n=jA(t);return{parameters:{queryParameters:yl(e.query||[],{in:"query"}),headers:yl(e.header||[],{in:"header"}),cookies:yl(e.cookie||[],{in:"cookie"}),pathParameters:yl(e.path||[],{initializeWithInputs:!0,in:"path"})},requestBody:r,security:n}}function m5e(t,e){const r=new Vl({format:!0});if(typeof t=="string")return e?.includes("json")?kZ(t):t;if(typeof t=="object"&&t!==null&&e?.includes("xml")){const i=Array.isArray(t)?t:{root:t};return r.build(i)}return JSON.stringify(t,null,2)}function TZ(t){const e=t.body?.mediaTypes;if(!e||!Object.keys(e).length)return Hb();const r=O5e(e,t),n=r?.name||"",i=!Gb.includes(n)&&!wZ.includes(n),o=Ik(r),a=o.find(({key:c})=>c===t.body?.activeExampleName)?.value??o[0]?.value,l=i&&a?m5e(a,n):"";return{...Hb(),activeExampleName:t.body?.activeExampleName||o[0]?.key||"",...r&&{type:r.name},content:l,formData:{"multipart/form-data":O3(e[zr.FormData]),"application/x-www-form-urlencoded":O3(e[zr["application/x-www-form-urlencoded"]])}}}function EZ(t){return t?{...(Object.keys(t?.body?.mediaTypes||{})||[]).reduce((r,n)=>(r[n]={name:n,extensions:void 0},r),{}),...Lc}:Lc}function O3(t){if(!t)return[xa()];if(!t.parameters)return[xa()];const e=t.parameters.map(r=>({id:crypto.randomUUID(),key:r.name,value:String(r.example)||"",active:!0,type:r.inputType,files:null}));return e.push(xa()),e}function Ik(t){const e=t?.examples;return Object.keys(e||{}).map(r=>{const n=e?.[r];return{name:Q.isString(n?.summary)?n?.summary:n?.summary?.raw||r,key:r,value:e?.[r].value}})}function O5e(t,e){const r=EZ(e),n=Object.keys(t).find(i=>!!r[i]);return n?t[n]:null}function y5e(t){return!t?.security?.length||!t?[]:h5e(t)}function AZ(t){const e=new Set;return t.flat().filter(r=>e.has(r.id)?!1:(e.add(r.id),!0))}function Vx(t){if(t.type==="http"){if(t.scheme==="bearer")return ve.JWT;if(t.scheme==="basic")return ve.BasicAuth;if(t.scheme==="digest")return ve.DigestAuth}else{if(t.type==="apiKey")return ve.APIKey;if(t.type==="oauth2")return ve.OAuth2;if(t.type==="openIdConnect")return ve.OpenIDConnect}return ve.NoAuth}function v5e(t,e){if(t==="clientCredentials"&&e&&"x-assertionType"in e&&e["x-assertionType"]===Ak)return Se.ClientCredentialsWithJwtAssertion;if(t==="authorizationCode"&&e&&"x-usePkce"in e&&e["x-usePkce"])return Se.AuthorizationCodeWithPkce;switch(t){case"implicit":return Se.Implicit;case"password":return Se.Password;case"clientCredentials":return Se.ClientCredentials;case"authorizationCode":return Se.AuthorizationCode;default:return Se.AuthorizationCode}}function b5e(t,e){const r=t?.security;if(!r?.length)return[];const o=f5e(r).flat().filter(s=>s.schemeId===e).find(s=>Vx(s)===ve.OAuth2);return NA(o)}function NA(t){return Object.entries(t?.flows||{}).map(([e,r])=>v5e(e,r)).filter(Boolean)}async function Mg(t){try{const e=await eU(t),r=await jE(t);return{absolutePath:t,file:new File([e],r)}}catch(e){return console.error("Failed to init replay file",e),null}}async function IZ(t){return(await Promise.allSettled(t.map(r=>Mg(r)))).map(r=>r.status==="fulfilled"?r.value:null).filter(r=>r!==null)}function Zy(t){return/(?:^[a-z][a-z0-9+.-]*:|\/\/)/i.test(t)}function Rk(t){return t.endsWith("/")?t.substring(0,t.length-1):t}function x5e(t){try{const e=new URL(t);return e.search="",e.hash="",e.toString()}catch{return t}}function Xx(t){return/^https?:\/\//i.test(t)}function S5e(t,e){let r;if(e.startsWith("//")){const{protocol:n}=new URL(t);r=`${n||"https:"}${e}`}else if(Zy(e))r=e;else if(!e.startsWith("/"))r=Rk(t)+"/"+e;else{const n=new URL(t);n.pathname=e,r=n.toString()}return Rk(r)}function y3(t,e){let r=t;return e.forEach(({key:n,value:i,active:o})=>{i&&o&&(r=r.replaceAll(`{${n}}`,i))}),r}function RZ(t,e){let r=t;return e.forEach(({name:n,value:i})=>{i&&(r=r.replaceAll(`{${n}}`,i))}),r}function w5e(t){return t.startsWith("http://")||t.startsWith("https://")}function YO({url:t,serverUrl:e,corsProxyUrl:r}){let n;if(w5e(t)||!e)n=t;else{const i=new URL(e);i.pathname=t,i.search="",i.hash="",n=i.toString()}return r?`${r}${n}`:n}async function P5e(t,e,r,n,i,o){const s=await Promise.all(t.sourceDescriptions?.map(async l=>({...l,apiId:await _Z({projectPath:n,apiUrl:l.url,collectionId:e})}))),a={inputs:t.components?.inputs||{},parameters:Object.fromEntries(Object.entries(t.components?.parameters||{}).map(([l,c])=>[l,{...c,key:c.name,value:c.value,id:crypto.randomUUID(),active:!0}]))};return{...t,id:e,srcType:r,state:Mt.Normal,sourceDescriptions:s,components:a,workflows:await Promise.all(t.workflows.map(async l=>({...l,state:Mt.Normal,parameters:k3(l.parameters,l["x-replay-disabled-parameters"],t.components?.parameters),outputs:C3(l.outputs),security:S3(l["x-security"]),steps:await Promise.all(l.steps.map(async c=>{const u=k3(c.parameters,c["x-replay-disabled-parameters"],t.components?.parameters),d=c["x-operation"]??null;d&&(d.url=Ng(d.url,u.queryParameters.filter(Pz)));const p=C5e(c,s,i);let h;if(p&&o){const g=i?.find(O=>O.id===p.apiId);try{h=o(p.path,p.method,g)}catch(O){console.error("Failed to convert operation to replay value",O),h=void 0}}delete c.operationId,delete c["x-operation"];const m=await I5e(c.requestBody,n);return{...c,state:Mt.Normal,parameters:u,outputs:C3(c.outputs),successCriteria:c.successCriteria?.map(g=>({...g,type:g.type??Qn.SIMPLE}))||[],requestBody:m,xOperation:d,security:S3(c["x-security"],h),operation:p}}))})))}}async function _Z({projectPath:t,apiUrl:e,collectionId:r}){if(Xx(e))return e;if(await or.isAbsolute(e))return await or.relative(t,e);const n=await or.resolve(await or.join(t,r,"..",e));return await or.relative(t,n)}function C5e(t,e,r){if(t["x-operation"])return null;const{path:n,method:i,apiId:o,isAdditionalOperation:s}=jZ({operationPath:t.operationPath,parsedSourceDescriptions:e}),{operationId:a,apiId:l}=$5e({operationId:t.operationId,parsedSourceDescriptions:e}),c=l||o||e[0]?.apiId||"",u=r?.find(d=>d.id===c);if(a&&u&&!n&&!i){const d=_5e(a,u);return{apiId:c,path:d?.path??"",method:d?.method??"",operationId:a,isAdditionalOperation:d?.isAdditionalOperation??!1}}return{apiId:c,path:n??"",method:i??"",operationId:a,isAdditionalOperation:s}}function $5e({operationId:t,parsedSourceDescriptions:e}){if(!t)return{operationId:"",apiId:null};const r=t.split(".");if(r.length===1)return{operationId:t,apiId:e[0]?.apiId??""};const[,n,i=""]=r,o=e.find(({name:s})=>s===n);return{operationId:i,apiId:o?.apiId??""}}function v3(t){return"reference"in t&&typeof t.reference=="string"}function jZ({operationPath:t,parsedSourceDescriptions:e}){if(!t)return{apiId:null,path:"",method:"",isAdditionalOperation:!1};try{const r=t.split("#"),n=r.length>1?r[1]:r[0],i=r.length>1?r[0]:"";if(!n)return{path:"",method:"",apiId:null,isAdditionalOperation:!1};let o=null,s=null;const a=/\$sourceDescriptions\.(.+)\.url/,l=i.match(a);if(l&&(o=l[1]),o){const h=e.find(({name:m})=>m===o);h&&(s=h.apiId)}const c=n.split("/"),u=c.pop()||"",d=c[c.length-1]==="additionalOperations";return d&&c.pop(),{path:Gv.unescape(c.pop()||""),method:u.toLowerCase(),apiId:s,isAdditionalOperation:d}}catch{return{path:"",method:"",apiId:null,isAdditionalOperation:!1}}}function k5e(t){switch(t.type){case"apiKey":return ve.APIKey;case"oauth2":return ve.OAuth2;case"openIdConnect":return ve.OpenIDConnect;case"http":return t.scheme==="basic"?ve.BasicAuth:t.scheme==="digest"?ve.DigestAuth:t.scheme==="bearer"?ve.JWT:ve.NoAuth;default:return ve.NoAuth}}function QZ(t,e){const r={clientCredentials:Se.ClientCredentials,authorizationCode:Se.AuthorizationCode,implicit:Se.Implicit,password:Se.Password,clientCredentialsWithJwtAssertion:Se.ClientCredentialsWithJwtAssertion,authorizationCodeWithPkce:Se.AuthorizationCodeWithPkce};return t==="clientCredentials"&&e["x-assertionType"]==="urn:ietf:params:oauth:client-assertion-type:jwt-bearer"?Se.ClientCredentialsWithJwtAssertion:t==="authorizationCode"&&e["x-usePkce"]?Se.AuthorizationCodeWithPkce:r[t]??null}function T5e(t){return{query:Di.Query,header:Di.Header,cookie:Di.Cookie}[t.toLowerCase()]||Di.Header}function E5e(t){return{body:Mn.Body,header:Mn.Header,url:Mn.URL}[t.toLowerCase()]||Mn.URL}function b3(t,e,r){return Object.keys(t).reduce((n,i)=>{const o=QZ(i,t[i]);if(!o)return n;switch(o){case Se.ClientCredentials:n[o]={...r[o],clientId:e.clientId??"",clientSecret:e.clientSecret??"",clientAssertion:e.clientAssertion??"",tokenUrl:t[i].tokenUrl??"",scopes:sc(t[i].scopes,t[i]["x-replay-disabled-scopes"]),accessToken:e.accessToken??""};break;case Se.AuthorizationCode:n[o]={...r[o],clientId:e.clientId??"",clientSecret:e.clientSecret??"",tokenUrl:t[i].tokenUrl??"",authorizationUrl:t[i].authorizationUrl??"",callbackUrl:e.callbackUrl??"",availableScopes:t[i].availableScopes??[],scopes:sc(t[i].scopes,t[i]["x-replay-disabled-scopes"]),accessToken:e.accessToken??""};break;case Se.Implicit:n[o]={...r[o],clientId:e.clientId??"",authorizationUrl:t[i].authorizationUrl??"",callbackUrl:e.callbackUrl??"",availableScopes:sc(t[i].availableScopes),scopes:sc(t[i].scopes,t[i]["x-replay-disabled-scopes"]),accessToken:e.accessToken??""};break;case Se.Password:n[o]={...r[o],tokenUrl:t[i].tokenUrl??"",username:e.username??"",password:e.password??"",clientId:e.clientId??"",clientSecret:e.clientSecret??"",accessToken:e.accessToken??""};break;case Se.ClientCredentialsWithJwtAssertion:n[o]={...r[o],clientAssertion:e.clientAssertion??"",tokenUrl:t[i].tokenUrl??"",scopes:sc(t[i].scopes,t[i]["x-replay-disabled-scopes"]),clientId:e.clientId??"",clientSecret:e.clientSecret??"",accessToken:e.accessToken??""};break;case Se.AuthorizationCodeWithPkce:n[o]={...r[o],tokenUrl:t[i].tokenUrl??"",authorizationUrl:t[i].authorizationUrl??"",callbackUrl:e.callbackUrl??"",availableScopes:sc(t[i].availableScopes),scopes:sc(t[i].scopes,t[i]["x-replay-disabled-scopes"]),codeVerifier:e.codeVerifier??"",codeChallenge:e.codeChallenge??"",clientId:e.clientId??"",clientSecret:e.clientSecret??"",accessToken:e.accessToken??""};break}return n},r)}function x3(t,e,r){const i={...Lo(),securityType:t},o=Object.keys(e.flows||{})[0],s=QZ(o,e.flows?.[o])??Se.ClientCredentials;switch(t){case ve.BasicAuth:return{...i,[ve.BasicAuth]:{username:r.username,password:r.password,schemeName:e.id}};case ve.JWT:return{...i,[ve.JWT]:{token:r.token,schemeName:e.id}};case ve.DigestAuth:return{...i,[ve.DigestAuth]:{...i[ve.DigestAuth],username:r.username,password:r.password,schemeName:e.id}};case ve.APIKey:return{...i,[ve.APIKey]:{location:T5e(e.in),name:e.name,key:r.apiKey,schemeName:e.id}};case ve.OAuth2:return{...i,[ve.OAuth2]:{...i[ve.OAuth2],...b3(e.flows||{},r||{},i[ve.OAuth2]),authRequestExtraParams:w3(r.authRequestExtraParams),tokenRequestExtraParams:P3(r.tokenRequestExtraParams),grantType:s,schemeName:e.id}};case ve.OpenIDConnect:return{...i,[ve.OpenIDConnect]:{...i[ve.OpenIDConnect],...b3(r.flows||{},r||{},i[ve.OpenIDConnect]),openIdConnectUrl:r.openIdConnectUrl,userInfoUrl:r.userInfoUrl,authRequestExtraParams:w3(r.authRequestExtraParams),tokenRequestExtraParams:P3(r.tokenRequestExtraParams),grantType:s,schemeName:e.id}};default:return i}}function A5e(t,e){return[...t.map(n=>{if("scheme"in n){const o=k5e(n.scheme);return x3(o,n.scheme,n.values)}const i=e.find(o=>o.id===n.schemeName);if(i){const o=Vx(i),s=x3(o,i,n.values);return s.securitySchemeId=i.id,s}return Lo()})]}function S3(t=[],e){const r=AZ(e?.security||[]);return t.length?A5e(t,r):[Lo()]}function sc(t,e){const r=al(t||{}),n=al(e||{});return[...r,...n,pi()]}function w3(t){return(t||[]).map(e=>({id:crypto.randomUUID(),key:e.key??"",value:e.value??"",active:e.active??!0})).concat(oo())}function P3(t){return(t||[]).map(e=>({id:crypto.randomUUID(),key:e.key??"",value:e.value??"",active:e.active??!0,sendIn:E5e(e.in)})).concat(_A())}function C3(t){if(!t)return[oo()];const e=[];for(const r in t)e.push({id:crypto.randomUUID(),key:r,value:t[r],active:!0});return e.push(oo()),e}const Iu={query:"queryParameters",path:"pathParameters",header:"headers",cookie:"cookies"};function $3(t,e){const r="$components.parameters.";if(t.reference.startsWith(r)){const n=t.reference.replace(r,"");return e?.[n]}}function k3(t,e,r){if(!t&&!e)return{pathParameters:[yr("path")],queryParameters:[yr("query")],headers:[yr("header")],cookies:[yr("cookie")]};const n={pathParameters:[],queryParameters:[],headers:[],cookies:[]};if(t)for(const i of t)if(v3(i)){const o=$3(i,r),s=Iu[o?.in];s&&n[s].push({reference:i.reference,active:!0,value:i.value})}else Iu[i.in]&&n[Iu[i.in]].push({id:crypto.randomUUID(),key:i.name,value:i.value,active:!0,in:i.in});if(e)for(const i of e)if(v3(i)){const o=$3(i,r),s=Iu[o?.in];s&&n[s].push({reference:i.reference,active:!1,value:i.value})}else Iu[i.in]&&n[Iu[i.in]].push({id:crypto.randomUUID(),key:i.name,value:i.value,active:!1,in:i.in});return n.pathParameters.push(yr("path")),n.queryParameters.push(yr("query")),n.headers.push(yr("header")),n.cookies.push(yr("cookie")),n}async function I5e(t,e){const r=CZ().body;if(!t)return r;switch(t.contentType){case"application/x-www-form-urlencoded":case"multipart/form-data":return{...r,type:t.contentType,formData:await R5e(t,e)};case"application/octet-stream":const n=t.payload?await DZ(t.payload,e):[],i=n.length>0?await Mg(n[0]):null;return{...r,type:t.contentType,binary:i};case"application/json":case"application/ld+json":return{...r,type:t.contentType,content:E3(t.payload)};default:{const o=typeof t.payload=="string",s=t.contentType||(o?"text/plain":"application/json");return{...r,type:s,content:o?t.payload:E3(t.payload)}}}}async function T3(t,e,r,n){const i=await DZ(e,n),o=i.length>0||Array.isArray(e),s=o?await IZ(i):void 0;return{id:crypto.randomUUID(),key:t,value:o?"":e,type:o?"file":"text",active:r,files:s}}async function R5e(t,e){const r=CZ().body.formData,n=t.contentType,i=t.payload?await Promise.all(Object.entries(t.payload).map(([a,l])=>T3(a,l,!0,e))):[],o=t["x-replay-disabled-payload"]?await Promise.all(Object.entries(t["x-replay-disabled-payload"]||{}).map(([a,l])=>T3(a,l,!1,e))):[];return{...r,[n]:[...i,...o,xa()]}}function E3(t){return t?JSON.stringify(t,null,2):""}function _5e(t,e){for(const r of Object.keys(e.paths)){const n=e.paths[r];for(const i of Object.keys(n)){const o=i.toLowerCase();if(["get","put","post","delete","options","head","patch","trace"].includes(o)&&n[o]?.operationId===t)return{method:o,path:r,isAdditionalOperation:!1}}if(n.additionalOperations){for(const[i,o]of Object.entries(n.additionalOperations))if(o?.operationId===t)return{method:i.toLowerCase(),path:r,isAdditionalOperation:!0}}}return null}async function DZ(t,e){return Array.isArray(t)?(await Promise.all(t.map(r=>A3(r,e)))).flat():typeof t=="string"?await A3(t,e):[]}async function A3(t,e){const r=/\$file\(['"](.+?)['"]\)/g,n=Array.from(t.matchAll(r));return Promise.all(n.map(i=>j5e(i[1],e)))}async function j5e(t,e){return await or.isAbsolute(t)?t:await or.resolve(await or.join(e,t))}const ei=t=>!t||typeof t=="boolean"?{type:"object",properties:{}}:t.type?t:{...t,type:"object"},I3=(t,e,r)=>{if(!t.properties)return t;const n=t.properties[e],i=ei(n);return{...t,properties:{...t.properties,[e]:{...i,...r}}}},Q5e=(t,e,r)=>{if(!t.properties||e===r||!r.trim())return null;const n={...t.properties};return n[r]?null:(n[r]=n[e],delete n[e],{...t,properties:n})},D5e=(t,e)=>{if(!t.properties)return t;const r={...t.properties};return delete r[e],{...t,properties:r}},N5e=(t,e,r={type:"string"})=>{const n=t.properties||{};return{...t,type:"object",properties:{...n,[e]:r}}};function R3(t){const e=Object.assign({},...(t||[]).filter(({key:r,active:n})=>r&&n).map(r=>({[r.key]:r.value})));if(Object.keys(e).length!==0)return e}function _3(t){if(!t)return{};const e={queryParameters:"query",headers:"header",cookies:"cookie",pathParameters:"path"},r=[],n=[];return Object.keys(e).forEach(i=>{const o=i;t[o].forEach(s=>{if(bl(s)){const a={reference:s.reference,value:s.value||void 0};s.active?r.push(a):n.push(a)}else{if(!s.key)return;const a={name:s.key,in:e[o],value:s.value};s.active?r.push(a):n.push(a)}})}),{parameters:r.length>0?r:void 0,"x-replay-disabled-parameters":n.length>0?n:void 0}}function M5e(t){const e=t?.map(r=>({condition:r.condition,context:r.context,type:r.type==Qn.SIMPLE?void 0:r.type}));if(e?.length!==0)return e}function q5e(t){if(!(!t||t.length===0))return[...t]}async function NZ(t,e){return t.absolutePath?`$file('${await or.relative(e,t.absolutePath)}')`:null}async function z5e(t,e){const{type:r,value:n,files:i}=t;switch(r){case"text":return n;case"file":let o=[];return i&&(o=(await Promise.all(Object.values(i).map(s=>NZ(s,e)))).filter(s=>s!==null)),o.length===0?"":o.length===1?o[0]:o}}async function L5e(t,e){const r=t.type,n=t.formData[r],i={},o={};return await Promise.all(n.map(async s=>{const{key:a,active:l}=s;if(!a)return;const c=await z5e(s,e);l?i[a]=c:o[a]=c})),{payload:Object.keys(i).length>0?i:void 0,"x-replay-disabled-payload":Object.keys(o).length>0?o:void 0}}function V5e(t){if(!t)return t;try{const e=JSON.parse(t);return typeof e=="object"?e:t}catch{return t}}async function X5e(t,e){if(t)switch(t.type){case"application/x-www-form-urlencoded":case"multipart/form-data":return{contentType:t.type,...await L5e(t,e)};case"application/octet-stream":return{contentType:t.type,payload:t.binary?await NZ(t.binary,e):null};case"application/json":case"application/ld+json":return t.content?{contentType:t.type,payload:V5e(t.content)}:void 0;default:return t.content?{contentType:t.type,payload:t.content}:void 0}}function W5e(t){return{...t.schemeName?{schemeName:t.schemeName}:{scheme:{type:"http",scheme:"basic"}},values:{username:t.username,password:t.password}}}function U5e(t){return{...t.schemeName?{schemeName:t.schemeName}:{scheme:{type:"apiKey",name:t.name,in:t.location.toLowerCase()}},values:{apiKey:t.key}}}function B5e(t){return{...t.schemeName?{schemeName:t.schemeName}:{scheme:{type:"http",scheme:"bearer"}},values:{token:t.token}}}function F5e(t){return{...t.schemeName?{schemeName:t.schemeName}:{scheme:{type:"http",scheme:"digest"}},values:{username:t.username,password:t.password}}}function Z5e(t){const{flows:e,values:r}=zZ(t);return{...t.schemeName?{schemeName:t.schemeName}:{scheme:{type:"openIdConnect",flows:e}},values:{...r,openIdConnectUrl:t.openIdConnectUrl,userInfoUrl:t.userInfoUrl,authRequestExtraParams:MZ(t.authRequestExtraParams),tokenRequestExtraParams:qZ(t.tokenRequestExtraParams)}}}function Y5e(t){const{flows:e,values:r}=zZ(t);return{...t.schemeName?{schemeName:t.schemeName}:{scheme:{type:"oauth2",flows:e}},values:{...r,authRequestExtraParams:MZ(t.authRequestExtraParams),tokenRequestExtraParams:qZ(t.tokenRequestExtraParams)}}}function Ru(t){const e={},r={};return t.forEach(n=>{n.value&&(n.active?e[n.value]=n.description:r[n.value]=n.description)}),{scopes:e,"x-replay-disabled-scopes":Object.keys(r).length>0?r:void 0}}function MZ(t){return t.filter(e=>e.value||e.key).map(e=>({key:e.key,value:e.value,active:e.active}))}function qZ(t){return t.filter(e=>e.value||e.key).map(e=>({key:e.key,value:e.value,active:e.active,in:e.sendIn.toLowerCase()}))}function zZ(t){let e;switch(t.grantType){case Se.ClientCredentials:return e=t[Se.ClientCredentials],{flows:{clientCredentials:{tokenUrl:e.tokenUrl,...Ru(e.scopes)}},values:{clientId:e.clientId,clientSecret:e.clientSecret,accessToken:e.accessToken}};case Se.Implicit:return e=t[Se.Implicit],{flows:{implicit:{authorizationUrl:e.authorizationUrl,...Ru(e.scopes)}},values:{clientId:e.clientId,accessToken:e.accessToken,callbackUrl:e.callbackUrl}};case Se.Password:return e=t[Se.Password],{flows:{password:{tokenUrl:e.tokenUrl,...Ru(e.scopes)}},values:{clientId:e.clientId,clientSecret:e.clientSecret,username:e.username,password:e.password,accessToken:e.accessToken}};case Se.AuthorizationCode:return e=t[Se.AuthorizationCode],{flows:{authorizationCode:{tokenUrl:e.tokenUrl,authorizationUrl:e.authorizationUrl,...Ru(e.scopes)}},values:{accessToken:e.accessToken,clientId:e.clientId,callbackUrl:e.callbackUrl}};case Se.ClientCredentialsWithJwtAssertion:return e=t[Se.ClientCredentialsWithJwtAssertion],{flows:{clientCredentials:{tokenUrl:e.tokenUrl,...Ru(e.scopes),"x-assertionType":"urn:ietf:params:oauth:client-assertion-type:jwt-bearer"}},values:{clientId:e.clientId,clientAssertion:e.clientAssertion,accessToken:e.accessToken}};case Se.AuthorizationCodeWithPkce:return e=t[Se.AuthorizationCodeWithPkce],{flows:{authorizationCode:{tokenUrl:e.tokenUrl,authorizationUrl:e.authorizationUrl,...Ru(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 j3(t){const e=t.map(r=>{switch(r.securityType){case ve.OpenIDConnect:{const i=r[ve.OpenIDConnect];return Z5e(i)}case ve.OAuth2:{const i=r[ve.OAuth2];return Y5e(i)}case ve.APIKey:{const i=r[ve.APIKey];return U5e(i)}case ve.BasicAuth:{const i=r[ve.BasicAuth];return W5e(i)}case ve.DigestAuth:{const i=r[ve.DigestAuth];return F5e(i)}case ve.JWT:{const i=r[ve.JWT];return B5e(i)}default:return null}}).filter(r=>r!==null);return{"x-security":e.length?e:void 0}}function G5e(t){const{inputs:e,parameters:r,...n}=t;let i=n;return Object.keys(e).length&&(i.inputs=e),Object.keys(r).length&&(i.parameters=Object.fromEntries(Object.entries(r).map(([o,{id:s,active:a,key:l,...c}])=>[o,{...c,name:l}]))),Object.keys(i).length||(i=void 0),i}async function H5e(t,e){const{id:r,state:n,srcType:i,sourceDescriptions:o,workflows:s,components:a,...l}=t;return{arazzoObject:{...l,sourceDescriptions:o.map(c=>({...c,name:c.name,url:c.url,type:c.type||"openapi",apiId:void 0})),components:G5e(a),workflows:await Promise.all(s.map(async({parameters:c,security:u,dependsOn:d,outputs:p,state:h,steps:m,inputs:g,...O})=>({...O,dependsOn:q5e(d),outputs:R3(p),inputs:g?ei(g):void 0,...j3(u),..._3(c),steps:await Promise.all(m.map(async({parameters:y,security:v,operation:b,requestBody:w,successCriteria:S,outputs:P,state:C,xOperation:E,...R})=>{const D={operationId:void 0,operationPath:void 0,"x-operation":void 0};if(b){const _=t.sourceDescriptions.find(({apiId:L})=>L===b.apiId)||t.sourceDescriptions[0];if(b.operationId){const L=t.sourceDescriptions.length<=1;D.operationId=L?b.operationId:`$sourceDescriptions.${_.name}.${b.operationId}`}else D.operationPath=b.isAdditionalOperation?`{$sourceDescriptions.${_.name}.url}#/paths/${Gv.escape(b.path)}/additionalOperations/${b.method}`:`{$sourceDescriptions.${_.name}.url}#/paths/${Gv.escape(b.path)}/${b.method}`}else E&&(D["x-operation"]={...E,url:E.url.split("?")[0]});return{...R,...D,...j3(v),..._3(y),requestBody:await X5e(w,e),successCriteria:M5e(S),outputs:R3(P)}}))})))}}}class J5e extends cU{constructor(e,r){super(e),this.convertOperationToReplayValue=r}parse(e,r){return P5e(e.content,e.uri,e.type,this.storage.baseDir,r,this.convertOperationToReplayValue)}async stringify(e){const{arazzoObject:r}=await H5e(e,this.storage.baseDir);return await or.extname(e.id)===".json"?JSON.stringify(r,null,2):Pa.dump(r)}}class K5e{constructor(e,r){this.storage=e,this.localStorageSecretsProvider=r}default=[];async read(){const e=await this.storage.get("replay-environments.yaml"),r=await this.localStorageSecretsProvider.get();let n=null,i=null;if(!e)return this.default;try{n=Pa.load(e),i=r?JSON.parse(r):null}catch(a){return console.error("Failed to parse environments file",a),this.default}return n?Object.keys(n).filter(a=>a!=="version").map(a=>({name:a,inputs:Object.entries(n[a].inputs).map(([l,c])=>{if(typeof c=="string")return{name:l,value:c,isSecret:!1};const u=i?.[a]?.[l]??"";return{name:l,value:u,isSecret:!0}}),servers:Object.entries(n[a].servers).map(([l,c])=>({apiId:l,value:c.value,variables:Object.entries(c.variables||{}).map(([u,d])=>({name:u,value:d}))})),state:Mt.Normal})):this.default}async write(e){const r=await this.localStorageSecretsProvider.get(),n=r?JSON.parse(r):{},i=e.reduce((o,s)=>(s.name&&(o[s.name]={inputs:s.inputs.reduce((a,l)=>(l.isSecret&&n?(n[s.name]||(n[s.name]={}),n[s.name][l.name]=l.value,a[l.name]={provider:"local"}):a[l.name]=l.value,a),{}),servers:s.servers.reduce((a,l)=>(a[l.apiId]={value:l.value,variables:Object.fromEntries(l.variables.map(c=>[c.name,c.value]))},a),{})}),o),{});this.localStorageSecretsProvider.set(JSON.stringify(n)),i&&this.storage.set("replay-environments.yaml",Pa.dump(i))}}class eDe{constructor(e,r,n){this.storage=e,this.filePath=r,this.defaultValue=n}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 tDe=(t,e)=>({data:t,version:e});class MA extends eDe{constructor(e,r,n,i){super(e,r,n),this.version=i}migrationMap={};migrate(e){if(!this.migrationMap[e.version])return this.defaultValue;const r=this.migrationMap[e.version](e);return r.version===this.version?r:this.migrate(r)}async parse(e){const r=JSON.parse(e);if(r.version!==this.version){const n=this.migrate(r);return await this.write(n.data),n.data}return r.data}stringify(e){return JSON.stringify(tDe(e,this.version))}}function rDe(t){return{data:{...t.data,tabs:t.data.tabs.map(e=>e.data.type===Ge.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 Q3=2,nDe="tabs.json";class iDe extends MA{migrationMap={1:rDe};constructor(e){super(e,nDe,ma(K6),Q3)}async parse(e){let r=JSON.parse(e);r.version!==Q3&&(r=this.migrate(r));const n=await Promise.all(r.data.tabs.map(async i=>{if(i.data.type===Ge.Step&&i.data.draftStep){const o=i.data.draftStep.requestBody.formData;o["multipart/form-data"]=await D3(o["multipart/form-data"]),o["application/x-www-form-urlencoded"]=await D3(o["application/x-www-form-urlencoded"]),i.data.draftStep.requestBody.binary&&i.data.draftStep.requestBody.binary.absolutePath&&(i.data.draftStep.requestBody.binary=await Mg(i.data.draftStep.requestBody.binary.absolutePath))}return i}));return{...r.data,tabs:n}}stringify(e){return super.stringify({...e,tabs:e.tabs.map(r=>r.data.type===Ge.Step?{...r,data:{...r.data,response:null}}:r.data.type===Ge.WorkflowRun?{...r,data:{...r.data,result:null}}:r)})}}async function D3(t){return Promise.all(t.map(async e=>{const r={...e};if(e.files){const n=e.files.map(i=>i.absolutePath).filter(i=>i!==null);r.files=await IZ(n)}return r}))}function oDe(t){return{data:t.data.map(e=>({...e,step:{...e.step,security:e.step.security.securities}})),version:2}}const sDe=2,aDe="history.json";class lDe extends MA{migrationMap={1:oDe};constructor(e){super(e,aDe,[],sDe)}}const cDe=1;class LZ{constructor(e,r,n,i,o,s){this.systemFilesStorage=e,this.userFilesStorage=r,this.project=n,this.isApiPersisted=i,this.convertOperationToReplayValue=o,this.telemetry=s,this.localStorageSecretsProvider=new mCe(this.project.id);const a=new gCe;this.historyStorage=new lDe(this.systemFilesStorage),this.activeEnvironmentIdStorage=new MA(this.systemFilesStorage,"active_environment_id.json",Cg,cDe),this.tabsStateStorage=new iDe(this.systemFilesStorage),this.environmentsStorage=new K5e(this.userFilesStorage,this.localStorageSecretsProvider),this.collectionsStorage=new J5e(this.userFilesStorage,this.convertOperationToReplayValue),this.apisStorage=new OCe(this.isApiPersisted?this.userFilesStorage:a)}historyStorage;activeEnvironmentIdStorage;tabsStateStorage;environmentsStorage;collectionsStorage;apisStorage;localStorageSecretsProvider;async update(e,r){switch(e.path[0]){case"history":this.historyStorage.write(r.history.get());break;case"activeEnvironmentId":this.activeEnvironmentIdStorage.write(r.activeEnvironmentId.get());break;case"tabsState":this.tabsStateStorage.write(r.tabsState.get());break;case"environments":this.environmentsStorage.write(r.environments.get());break;case"apis":this.isApiPersisted&&await this.apisStorage.update(e,r.apis.get());break;case"collections":await this.collectionsStorage.update(e,r.collections.get());break}}}var Jw={exports:{}},N3;function uDe(){return N3||(N3=1,(function(t){var e=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(l,c,u){this.fn=l,this.context=c,this.once=u||!1}function o(l,c,u,d,p){if(typeof u!="function")throw new TypeError("The listener must be a function");var h=new i(u,d||l,p),m=r?r+c:c;return l._events[m]?l._events[m].fn?l._events[m]=[l._events[m],h]:l._events[m].push(h):(l._events[m]=h,l._eventsCount++),l}function s(l,c){--l._eventsCount===0?l._events=new n:delete l._events[c]}function a(){this._events=new n,this._eventsCount=0}a.prototype.eventNames=function(){var c=[],u,d;if(this._eventsCount===0)return c;for(d in u=this._events)e.call(u,d)&&c.push(r?d.slice(1):d);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(u)):c},a.prototype.listeners=function(c){var u=r?r+c:c,d=this._events[u];if(!d)return[];if(d.fn)return[d.fn];for(var p=0,h=d.length,m=new Array(h);p<h;p++)m[p]=d[p].fn;return m},a.prototype.listenerCount=function(c){var u=r?r+c:c,d=this._events[u];return d?d.fn?1:d.length:0},a.prototype.emit=function(c,u,d,p,h,m){var g=r?r+c:c;if(!this._events[g])return!1;var O=this._events[g],y=arguments.length,v,b;if(O.fn){switch(O.once&&this.removeListener(c,O.fn,void 0,!0),y){case 1:return O.fn.call(O.context),!0;case 2:return O.fn.call(O.context,u),!0;case 3:return O.fn.call(O.context,u,d),!0;case 4:return O.fn.call(O.context,u,d,p),!0;case 5:return O.fn.call(O.context,u,d,p,h),!0;case 6:return O.fn.call(O.context,u,d,p,h,m),!0}for(b=1,v=new Array(y-1);b<y;b++)v[b-1]=arguments[b];O.fn.apply(O.context,v)}else{var w=O.length,S;for(b=0;b<w;b++)switch(O[b].once&&this.removeListener(c,O[b].fn,void 0,!0),y){case 1:O[b].fn.call(O[b].context);break;case 2:O[b].fn.call(O[b].context,u);break;case 3:O[b].fn.call(O[b].context,u,d);break;case 4:O[b].fn.call(O[b].context,u,d,p);break;default:if(!v)for(S=1,v=new Array(y-1);S<y;S++)v[S-1]=arguments[S];O[b].fn.apply(O[b].context,v)}}return!0},a.prototype.on=function(c,u,d){return o(this,c,u,d,!1)},a.prototype.once=function(c,u,d){return o(this,c,u,d,!0)},a.prototype.removeListener=function(c,u,d,p){var h=r?r+c:c;if(!this._events[h])return this;if(!u)return s(this,h),this;var m=this._events[h];if(m.fn)m.fn===u&&(!p||m.once)&&(!d||m.context===d)&&s(this,h);else{for(var g=0,O=[],y=m.length;g<y;g++)(m[g].fn!==u||p&&!m[g].once||d&&m[g].context!==d)&&O.push(m[g]);O.length?this._events[h]=O.length===1?O[0]:O:s(this,h)}return this},a.prototype.removeAllListeners=function(c){var u;return c?(u=r?r+c:c,this._events[u]&&s(this,u)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=r,a.EventEmitter=a,t.exports=a})(Jw)),Jw.exports}var dDe=uDe();const fDe=ti(dDe);class VZ extends Error{constructor(e){super(e),this.name="TimeoutError"}}let pDe=class extends Error{constructor(e){super(),this.name="AbortError",this.message=e}};const M3=t=>globalThis.DOMException===void 0?new pDe(t):new DOMException(t),q3=t=>{const e=t.reason===void 0?M3("This operation was aborted."):t.reason;return e instanceof Error?e:M3(e)};function hDe(t,e,r,n){let i;const o=new Promise((s,a)=>{if(typeof e!="number"||Math.sign(e)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${e}\``);if(e===Number.POSITIVE_INFINITY){s(t);return}if(n={customTimers:{setTimeout,clearTimeout},...n},n.signal){const{signal:l}=n;l.aborted&&a(q3(l)),l.addEventListener("abort",()=>{a(q3(l))})}i=n.customTimers.setTimeout.call(void 0,()=>{const l=`Promise timed out after ${e} milliseconds`,c=r instanceof Error?r:new VZ(l);typeof t.cancel=="function"&&t.cancel(),a(c)},e),(async()=>{try{s(await t)}catch(l){a(l)}finally{n.customTimers.clearTimeout.call(void 0,i)}})()});return o.clear=()=>{clearTimeout(i),i=void 0},o}function gDe(t,e,r){let n=0,i=t.length;for(;i>0;){const o=Math.trunc(i/2);let s=n+o;r(t[s],e)<=0?(n=++s,i-=o+1):i=o}return n}var ac=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ta;class mDe{constructor(){ta.set(this,[])}enqueue(e,r){r={priority:0,...r};const n={priority:r.priority,run:e};if(this.size&&ac(this,ta,"f")[this.size-1].priority>=r.priority){ac(this,ta,"f").push(n);return}const i=gDe(ac(this,ta,"f"),n,(o,s)=>s.priority-o.priority);ac(this,ta,"f").splice(i,0,n)}dequeue(){const e=ac(this,ta,"f").shift();return e?.run}filter(e){return ac(this,ta,"f").filter(r=>r.priority===e.priority).map(r=>r.run)}get size(){return ac(this,ta,"f").length}}ta=new WeakMap;var kr=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Fe=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Nr,Yp,Gp,dl,Jb,Hp,Yy,Co,kp,Ei,Gy,Ri,Jp,ll,Hy,z3,L3,XZ,V3,X3,Jy,Kw,eP,Kb,WZ,Ky;class UZ extends Error{}class ODe extends fDe{constructor(e){var r,n,i,o;if(super(),Nr.add(this),Yp.set(this,void 0),Gp.set(this,void 0),dl.set(this,0),Jb.set(this,void 0),Hp.set(this,void 0),Yy.set(this,0),Co.set(this,void 0),kp.set(this,void 0),Ei.set(this,void 0),Gy.set(this,void 0),Ri.set(this,0),Jp.set(this,void 0),ll.set(this,void 0),Hy.set(this,void 0),Object.defineProperty(this,"timeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),e={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:mDe,...e},!(typeof e.intervalCap=="number"&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(n=(r=e.intervalCap)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:""}\` (${typeof e.intervalCap})`);if(e.interval===void 0||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(o=(i=e.interval)===null||i===void 0?void 0:i.toString())!==null&&o!==void 0?o:""}\` (${typeof e.interval})`);kr(this,Yp,e.carryoverConcurrencyCount,"f"),kr(this,Gp,e.intervalCap===Number.POSITIVE_INFINITY||e.interval===0,"f"),kr(this,Jb,e.intervalCap,"f"),kr(this,Hp,e.interval,"f"),kr(this,Ei,new e.queueClass,"f"),kr(this,Gy,e.queueClass,"f"),this.concurrency=e.concurrency,this.timeout=e.timeout,kr(this,Hy,e.throwOnTimeout===!0,"f"),kr(this,ll,e.autoStart===!1,"f")}get concurrency(){return Fe(this,Jp,"f")}set concurrency(e){if(!(typeof e=="number"&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);kr(this,Jp,e,"f"),Fe(this,Nr,"m",Kb).call(this)}async add(e,r={}){return r={timeout:this.timeout,throwOnTimeout:Fe(this,Hy,"f"),...r},new Promise((n,i)=>{Fe(this,Ei,"f").enqueue(async()=>{var o,s,a;kr(this,Ri,(s=Fe(this,Ri,"f"),s++,s),"f"),kr(this,dl,(a=Fe(this,dl,"f"),a++,a),"f");try{if(!((o=r.signal)===null||o===void 0)&&o.aborted)throw new UZ("The task was aborted.");let l=e({signal:r.signal});r.timeout&&(l=hDe(Promise.resolve(l),r.timeout)),r.signal&&(l=Promise.race([l,Fe(this,Nr,"m",WZ).call(this,r.signal)]));const c=await l;n(c),this.emit("completed",c)}catch(l){if(l instanceof VZ&&!r.throwOnTimeout){n();return}i(l),this.emit("error",l)}finally{Fe(this,Nr,"m",XZ).call(this)}},r),this.emit("add"),Fe(this,Nr,"m",Jy).call(this)})}async addAll(e,r){return Promise.all(e.map(async n=>this.add(n,r)))}start(){return Fe(this,ll,"f")?(kr(this,ll,!1,"f"),Fe(this,Nr,"m",Kb).call(this),this):this}pause(){kr(this,ll,!0,"f")}clear(){kr(this,Ei,new(Fe(this,Gy,"f")),"f")}async onEmpty(){Fe(this,Ei,"f").size!==0&&await Fe(this,Nr,"m",Ky).call(this,"empty")}async onSizeLessThan(e){Fe(this,Ei,"f").size<e||await Fe(this,Nr,"m",Ky).call(this,"next",()=>Fe(this,Ei,"f").size<e)}async onIdle(){Fe(this,Ri,"f")===0&&Fe(this,Ei,"f").size===0||await Fe(this,Nr,"m",Ky).call(this,"idle")}get size(){return Fe(this,Ei,"f").size}sizeBy(e){return Fe(this,Ei,"f").filter(e).length}get pending(){return Fe(this,Ri,"f")}get isPaused(){return Fe(this,ll,"f")}}Yp=new WeakMap,Gp=new WeakMap,dl=new WeakMap,Jb=new WeakMap,Hp=new WeakMap,Yy=new WeakMap,Co=new WeakMap,kp=new WeakMap,Ei=new WeakMap,Gy=new WeakMap,Ri=new WeakMap,Jp=new WeakMap,ll=new WeakMap,Hy=new WeakMap,Nr=new WeakSet,z3=function(){return Fe(this,Gp,"f")||Fe(this,dl,"f")<Fe(this,Jb,"f")},L3=function(){return Fe(this,Ri,"f")<Fe(this,Jp,"f")},XZ=function(){var e;kr(this,Ri,(e=Fe(this,Ri,"f"),e--,e),"f"),Fe(this,Nr,"m",Jy).call(this),this.emit("next")},V3=function(){Fe(this,Nr,"m",eP).call(this),Fe(this,Nr,"m",Kw).call(this),kr(this,kp,void 0,"f")},X3=function(){const e=Date.now();if(Fe(this,Co,"f")===void 0){const r=Fe(this,Yy,"f")-e;if(r<0)kr(this,dl,Fe(this,Yp,"f")?Fe(this,Ri,"f"):0,"f");else return Fe(this,kp,"f")===void 0&&kr(this,kp,setTimeout(()=>{Fe(this,Nr,"m",V3).call(this)},r),"f"),!0}return!1},Jy=function(){if(Fe(this,Ei,"f").size===0)return Fe(this,Co,"f")&&clearInterval(Fe(this,Co,"f")),kr(this,Co,void 0,"f"),this.emit("empty"),Fe(this,Ri,"f")===0&&this.emit("idle"),!1;if(!Fe(this,ll,"f")){const e=!Fe(this,Nr,"a",X3);if(Fe(this,Nr,"a",z3)&&Fe(this,Nr,"a",L3)){const r=Fe(this,Ei,"f").dequeue();return r?(this.emit("active"),r(),e&&Fe(this,Nr,"m",Kw).call(this),!0):!1}}return!1},Kw=function(){Fe(this,Gp,"f")||Fe(this,Co,"f")!==void 0||(kr(this,Co,setInterval(()=>{Fe(this,Nr,"m",eP).call(this)},Fe(this,Hp,"f")),"f"),kr(this,Yy,Date.now()+Fe(this,Hp,"f"),"f"))},eP=function(){Fe(this,dl,"f")===0&&Fe(this,Ri,"f")===0&&Fe(this,Co,"f")&&(clearInterval(Fe(this,Co,"f")),kr(this,Co,void 0,"f")),kr(this,dl,Fe(this,Yp,"f")?Fe(this,Ri,"f"):0,"f"),Fe(this,Nr,"m",Kb).call(this)},Kb=function(){for(;Fe(this,Nr,"m",Jy).call(this););},WZ=async function(e){return new Promise((r,n)=>{e.addEventListener("abort",()=>{n(new UZ("The task was aborted."))},{once:!0})})},Ky=async function(e,r){return new Promise(n=>{const i=()=>{r&&!r()||(this.off(e,i),n())};this.on(e,i)})};const Sa=window.__TAURI__?.http.fetch??globalThis.fetch;class BZ extends K0{constructor(){super()}resolveExternalRef(e,r){return Zy(r)?r:e&&Zy(e)?new URL(r,e).href:e?Rc.resolve(Rc.dirname(e),r):r}async loadExternalRef(e){if(Zy(e)){const{body:r,mimeType:n}=await Qz(e,{...this.config.http,customFetch:Sa});return new Ad(e,r,n)}else{if(!await RE(e))throw new Error(`File not found at ${e}.`);try{throw await IE(e),new Error(`Expected a file but received a folder at ${e}.`)}catch(i){if(i instanceof Error&&i.message.includes("Expected a file but received a folder"))throw i}const n=await Px(e);return new Ad(e,n.replace(/\r\n/g,`
417
- `))}}}async function _k(t,e){const r=new F0({});r.getRulesForSpecVersion=()=>[];const n=await or.dirname(t),i={config:r,base:n,externalRefResolver:new BZ,dereference:!0};e?i.doc={source:{absoluteRef:t},parsed:e}:i.ref=t;const{bundle:{parsed:o}}=await jX(i);return o}class yDe{constructor(e){this.apisStorage=e}data=new Map;loading=new Set;pQueue=new ODe({concurrency:20});async get(e){return this.data.has(e)?this.data.get(e):(await this.loadAndParse(e),this.data.get(e))}async load(e){this.data.has(e)||await this.loadAndParse(e)}async loadAndParse(e){if(this.loading.has(e))return await this.pQueue.add(()=>this.get(e));this.loading.add(e),await this.pQueue.add(async()=>{const r=Xx(e)?Hn.WEB:Hn.FS,n=r===Hn.WEB?e:await this.apisStorage.getAbsolutePath(e);try{const i=await _k(n);if(!i){this.data.set(e,void 0);return}const o=this.apisStorage.parse({uri:e,type:r,content:i});this.data.set(e,o)}catch(i){console.error("Error loading api "+e,i),this.data.set(e,void 0);return}}),this.loading.delete(e)}get size(){return this.data.size}delete(e){this.data.delete(e)}getAll(){return Array.from(this.data.values()).filter(e=>e!==void 0)}clear(){this.data.clear(),this.loading.clear()}}class vDe extends LZ{apiLoader;constructor(e,r,n){const i=new E5(e.systemFilesDir),o=new E5(e.userFilesDir);super(i,o,e,!0,r,n),this.apiLoader=new yDe(this.apisStorage)}async read(){const e=this.telemetry?.startSpan("storage.read",void 0,void 0),r=this.telemetry?.startSpan("storage.loadUserState",{},e?.parentCtx),[n,i,o,s]=await Promise.all([this.historyStorage.read(),this.activeEnvironmentIdStorage.read(),this.tabsStateStorage.read(),this.environmentsStorage.read()]);r?.setAttribute("status","completed"),r?.setAttribute("historyCount",n.length),r?.setAttribute("environmentCount",s.length),r?.setStatus(exports.SpanStatusCode.OK),r?.end();const{apiFiles:a,collectionFiles:l}=await this.detectProjectFiles(e);await this.loadAndParseApis(a,e);const c=await this.loadAndParseCollections(l,e);this.collectionsStorage.setItemIds(c.map(d=>d.id));const u=this.apiLoader.getAll();return this.apisStorage.setItemIds(u.map(d=>d.id)),this.apiLoader.clear(),e?.setAttribute("status","completed"),e?.setStatus(exports.SpanStatusCode.OK),e?.end(),{project:this.project,history:n,activeEnvironmentId:i,tabsState:o,environments:s,apis:u,collections:c}}async detectProjectFiles(e){const r=this.telemetry?.startSpan("storage.detectFiles",{},e?.parentCtx),{api_files:n,collection_files:i}=await Na("fs_scan",{dir:this.project.userFilesDir});return r?.setAttribute("status","completed"),r?.setAttribute("filesCount",n.length+i.length),r?.setAttribute("apiFilesCount",n.length),r?.setAttribute("collectionFilesCount",i.length),r?.setStatus(exports.SpanStatusCode.OK),r?.end(),{apiFiles:n,collectionFiles:i}}async loadAndParseApis(e,r){const n=this.telemetry?.startSpan("storage.parseApis",{apisCount:e.length},r?.parentCtx);await T5(e,20,async i=>{try{await this.apiLoader.load(i.relative_path)}catch(o){return console.error(`Error parsing YAML/JSON file ${i.absolute_path}:`,o),null}}),n?.setAttribute("status","completed"),n?.setAttribute("parsedApisCount",this.apiLoader.size),n?.setStatus(exports.SpanStatusCode.OK),n?.end()}async loadAndParseCollections(e,r){const n=this.telemetry?.startSpan("storage.parseCollections",{collectionsCount:e.length},r?.parentCtx),i=await T5(e,20,async o=>{try{const s=await this.userFilesStorage.get(o.relative_path);if(!s)return null;const a=Pa.load(s??"");if(typeof a!="object"||a===null||typeof a.arazzo!="string")return null;const l=[];return await Promise.all(a.sourceDescriptions?.map(async c=>{const u=c.type,d=c.url,p=!u||u==="openapi",h=await _Z({projectPath:this.project.userFilesDir,apiUrl:d,collectionId:o.relative_path});if(p){const m=await this.apiLoader.get(h);m&&l.push(m)}})),await this.collectionsStorage.parse({uri:o.relative_path,type:Hn.FS,content:a},l)}catch(s){return console.error(`Error parsing Arazzo file ${o.relative_path}:`,s),null}});return n?.setAttribute("status","completed"),n?.setAttribute("parsedCollectionsCount",i.length),n?.setStatus(exports.SpanStatusCode.OK),n?.end(),i.filter(o=>o!==null)}}class W3{constructor(e){this.baseDir=e}async ls(e=""){const r=this.makeKey(e);return Object.keys(localStorage).filter(n=>n.startsWith(r)).map(n=>n.replace(r,""))}async get(e){const r=this.makeKey(e);return localStorage.getItem(r)??null}async set(e,r){const n=this.makeKey(e);localStorage.setItem(n,r)}async remove(e){const r=this.makeKey(e);localStorage.removeItem(r)}makeKey(e){return`replay:fs:${this.baseDir}/${e}`}}class bDe extends LZ{constructor(e,r,n){const i=new W3(e.systemFilesDir),o=new W3(e.userFilesDir);super(i,o,e,!1,r,n)}async detectProjectFiles(e){const r=this.telemetry?.startSpan("storage.detectFiles",{},e?.parentCtx),i=(await this.userFilesStorage.ls()).filter(l=>/\.(ya?ml|json)$/.test(l)),o=[],s=[],a=new Set;return await Promise.all(i.map(async l=>{const c=await this.userFilesStorage.get(l);if(c)try{const u=Pa.load(c);if(typeof u=="object"&&u!==null)if(typeof u.openapi=="string"){const d=await or.resolve(await or.join(this.userFilesStorage.baseDir,l)),p=await _k(d,u);o.push({uri:l,type:Hn.FS,content:p})}else typeof u.arazzo=="string"&&(s.push({uri:l,type:Hn.FS,content:u}),u.sourceDescriptions?.forEach(d=>{const p=d.type,h=d.url,m=!p||p==="openapi",g=typeof h=="string"&&Xx(h);m&&g&&a.add(h)}))}catch(u){console.error(`Error parsing YAML/JSON file ${l}:`,u)}})),r?.setAttribute("status","completed"),r?.setAttribute("filesCount",i.length),r?.setAttribute("apiFilesCount",o.length),r?.setAttribute("collectionFilesCount",s.length),r?.setAttribute("apiUrlsCount",a.size),r?.setStatus(exports.SpanStatusCode.OK),r?.end(),{apiFiles:o,collectionFiles:s,apiUrls:a}}async loadApis(e,r){const n=this.telemetry?.startSpan("storage.loadApis",{apiUrlsCount:e.size},r?.parentCtx),i=[];return await Promise.all(Array.from(e).map(async o=>{try{const s=await _k(o);i.push({uri:o,type:Hn.WEB,content:s})}catch(s){console.error(`Error parsing YAML from ${o}:`,s)}})),n?.setAttribute("status","completed"),n?.setStatus(exports.SpanStatusCode.OK),n?.end(),i}async parseApis(e,r){const n=this.telemetry?.startSpan("storage.parseApis",{apisCount:e.length},r?.parentCtx),i=await this.apisStorage.parseMany(e);return n?.setAttribute("status","completed"),n?.setAttribute("parsedApisCount",i.length),n?.setStatus(exports.SpanStatusCode.OK),n?.end(),i}async parseCollections(e,r,n){const i=this.telemetry?.startSpan("storage.parseCollections",{collectionsCount:e.length},n?.parentCtx),o=await this.collectionsStorage.parseMany(e,r);return i?.setAttribute("status","completed"),i?.setAttribute("parsedCollectionsCount",o.length),i?.setStatus(exports.SpanStatusCode.OK),i?.end(),o}async read(){const e=this.telemetry?.startSpan("storage.read",void 0,void 0),r=this.telemetry?.startSpan("storage.loadUserState",{},e?.parentCtx),[n,i,o,s]=await Promise.all([this.historyStorage.read(),this.activeEnvironmentIdStorage.read(),this.tabsStateStorage.read(),this.environmentsStorage.read()]);r?.setAttribute("status","completed"),r?.setAttribute("historyCount",n.length),r?.setAttribute("environmentCount",s.length),r?.setStatus(exports.SpanStatusCode.OK),r?.end();const{apiFiles:a,collectionFiles:l,apiUrls:c}=await this.detectProjectFiles(e),u=await this.loadApis(c,e),d=await this.parseApis([...a,...u],e);this.apisStorage.setItemIds(d.map(h=>h.id));const p=await this.parseCollections(l,d,e);return this.collectionsStorage.setItemIds(p.map(h=>h.id)),e?.setAttribute("status","completed"),e?.setStatus(exports.SpanStatusCode.OK),e?.end(),{project:this.project,history:n,activeEnvironmentId:i,tabsState:o,environments:s,apis:d,collections:p}}}function FZ(t=!1){let e,r=!1;return()=>({id:"RootStoragePlugin",onCreate:()=>({init:n=>async(i,o,s)=>{if(r||n.path.length>0)return{isInitialized:!1};if(r=!0,!t){e=Da()?new vDe(i,o,s):new bDe(i,o,s);const a=await e.read();n.merge(a)}return r=!1,{isInitialized:!0}}}),onSet(n,i,o){r||t||e.update(i,o)}})}function ZZ({defaultEnvironments:t}={}){return structuredClone({project:{id:"default",userFilesDir:"default",systemFilesDir:"default"},history:[],tabsState:ma(K6),activeEnvironmentId:Cg,environments:t||J6,collections:[],apis:[],requestController:null,apps:{apps:[],appsLoadingState:as.Idle},predefinedApiId:null,predefinedEnvironmentNames:new Set,predefinedInputNames:new Set})}const xDe=bz(ZZ(),xz(dCe({key:"replay-root-store"}),FZ())),qA=$.createContext(xDe),SDe=qA.Provider;function gt(){const t=$.useContext(qA);return Sz(t)}function wDe(){return{theme:"light",disableCollectionsTab:!1,oAuth2RedirectURI:null,corsProxyUrl:void 0,mockServer:void 0,certificates:[],isApiBased:!1,generatedEnvironments:[],generatedInputs:[],hideOtherSecuritySchemes:!1}}const PDe=wDe(),CDe=$.createContext(PDe);function Vo(){const t=$.useContext(CDe);return Sz(t)}function $De(t,e){const{apps:{apiId:r}}=gt(),{corsProxyUrl:n,disableCollectionsTab:i,mockServer:o,oAuth2RedirectURI:s,certificates:a,storageKey:l,isApiBased:c}=Vo();n.set(t?.corsProxyUrl??ZPe),o.set(t?.mockServer),r.set(t?.apiId),s.set(t?.oAuth2RedirectURI),i.set(!!t?.disableCollectionsTab),l.set(t?.storageKey),c.set(!!e),$.useEffect(()=>{a.set(t?.certificates||[])},[t?.certificates])}const Wx=$.createContext({});function ru(){return $.useContext(Wx)||{}}const kDe="0.21.0-next.2",TDe={version:kDe};class YZ{_client;_isInitialized=!1;_initResolve=null;_initPromise=new Promise(e=>{this._initResolve=e});_globalAttributes={platform:"",deviceId:""};constructor(){this._client=new FPe}get isInitialized(){return this._isInitialized}get client(){return this._client}awaitInit(){return this._initPromise}updateCloudEventData(e){this._client.updateCloudEventData(e)}enrichGlobalAttributes(e){this._globalAttributes={...this._globalAttributes,...e}}getGlobalAttributes(){return{...this._globalAttributes}}clearGlobalAttributes(){this._globalAttributes={platform:"",deviceId:""}}init(e){if(this.isInitialized)return;const r=!0,n=e?.tracerName||"desktop",i=e?.enableErrorInstrumentation??n==="desktop",o={serviceName:"replay",serviceVersion:TDe.version,version:"1.0.0",tracerName:n,collectorUrl:"",isProd:r,enableErrorInstrumentation:i};this._client.init({otel:{...o,...e}}),this._initResolve?.(this),this._isInitialized=!0}sendEvent(e,r){if(!this.isInitialized){console.warn("Telemetry client not initialized. Call init() first.");return}const n={...this._globalAttributes,...r};try{this.client.send(e,n)}catch(i){console.error("Failed to send telemetry event:",i)}}startSpan(e,r,n){if(!this.isInitialized){console.warn("Telemetry client not initialized. Call init() first.");return}try{return this._client.startSpan(e,{...this._globalAttributes,...r},n)}catch(i){console.error("Failed to start telemetry span:",i);return}}}const sd=new YZ;function st(){const{telemetry:t}=ru();return sd.isInitialized||sd.init(t),{sendEvent:(e,r)=>{sd.sendEvent(e,r)},startSpan:(e,r,n)=>sd.startSpan(e,r,n)}}const EDe=({awaitInit:t=!0}={})=>{const[e,r]=$.useState(void 0);return $.useEffect(()=>{(async()=>{const i=t?await sd.awaitInit():sd;r(i)})()},[t]),e},zn=800,yi=T(Q.Button).attrs({variant:"text",size:"small",tone:"danger"})`
417
+ `))}}}async function _k(t,e){const r=new F0({});r.getRulesForSpecVersion=()=>[];const n=await or.dirname(t),i={config:r,base:n,externalRefResolver:new BZ,dereference:!0};e?i.doc={source:{absoluteRef:t},parsed:e}:i.ref=t;const{bundle:{parsed:o}}=await jX(i);return o}class yDe{constructor(e){this.apisStorage=e}data=new Map;loading=new Set;pQueue=new ODe({concurrency:20});async get(e){return this.data.has(e)?this.data.get(e):(await this.loadAndParse(e),this.data.get(e))}async load(e){this.data.has(e)||await this.loadAndParse(e)}async loadAndParse(e){if(this.loading.has(e))return await this.pQueue.add(()=>this.get(e));this.loading.add(e),await this.pQueue.add(async()=>{const r=Xx(e)?Hn.WEB:Hn.FS,n=r===Hn.WEB?e:await this.apisStorage.getAbsolutePath(e);try{const i=await _k(n);if(!i){this.data.set(e,void 0);return}const o=this.apisStorage.parse({uri:e,type:r,content:i});this.data.set(e,o)}catch(i){console.error("Error loading api "+e,i),this.data.set(e,void 0);return}}),this.loading.delete(e)}get size(){return this.data.size}delete(e){this.data.delete(e)}getAll(){return Array.from(this.data.values()).filter(e=>e!==void 0)}clear(){this.data.clear(),this.loading.clear()}}class vDe extends LZ{apiLoader;constructor(e,r,n){const i=new E5(e.systemFilesDir),o=new E5(e.userFilesDir);super(i,o,e,!0,r,n),this.apiLoader=new yDe(this.apisStorage)}async read(){const e=this.telemetry?.startSpan("storage.read",void 0,void 0),r=this.telemetry?.startSpan("storage.loadUserState",{},e?.parentCtx),[n,i,o,s]=await Promise.all([this.historyStorage.read(),this.activeEnvironmentIdStorage.read(),this.tabsStateStorage.read(),this.environmentsStorage.read()]);r?.setAttribute("status","completed"),r?.setAttribute("historyCount",n.length),r?.setAttribute("environmentCount",s.length),r?.setStatus(exports.SpanStatusCode.OK),r?.end();const{apiFiles:a,collectionFiles:l}=await this.detectProjectFiles(e);await this.loadAndParseApis(a,e);const c=await this.loadAndParseCollections(l,e);this.collectionsStorage.setItemIds(c.map(d=>d.id));const u=this.apiLoader.getAll();return this.apisStorage.setItemIds(u.map(d=>d.id)),this.apiLoader.clear(),e?.setAttribute("status","completed"),e?.setStatus(exports.SpanStatusCode.OK),e?.end(),{project:this.project,history:n,activeEnvironmentId:i,tabsState:o,environments:s,apis:u,collections:c}}async detectProjectFiles(e){const r=this.telemetry?.startSpan("storage.detectFiles",{},e?.parentCtx),{api_files:n,collection_files:i}=await Na("fs_scan",{dir:this.project.userFilesDir});return r?.setAttribute("status","completed"),r?.setAttribute("filesCount",n.length+i.length),r?.setAttribute("apiFilesCount",n.length),r?.setAttribute("collectionFilesCount",i.length),r?.setStatus(exports.SpanStatusCode.OK),r?.end(),{apiFiles:n,collectionFiles:i}}async loadAndParseApis(e,r){const n=this.telemetry?.startSpan("storage.parseApis",{apisCount:e.length},r?.parentCtx);await T5(e,20,async i=>{try{await this.apiLoader.load(i.relative_path)}catch(o){return console.error(`Error parsing YAML/JSON file ${i.absolute_path}:`,o),null}}),n?.setAttribute("status","completed"),n?.setAttribute("parsedApisCount",this.apiLoader.size),n?.setStatus(exports.SpanStatusCode.OK),n?.end()}async loadAndParseCollections(e,r){const n=this.telemetry?.startSpan("storage.parseCollections",{collectionsCount:e.length},r?.parentCtx),i=await T5(e,20,async o=>{try{const s=await this.userFilesStorage.get(o.relative_path);if(!s)return null;const a=Pa.load(s??"");if(typeof a!="object"||a===null||typeof a.arazzo!="string")return null;const l=[];return await Promise.all(a.sourceDescriptions?.map(async c=>{const u=c.type,d=c.url,p=!u||u==="openapi",h=await _Z({projectPath:this.project.userFilesDir,apiUrl:d,collectionId:o.relative_path});if(p){const m=await this.apiLoader.get(h);m&&l.push(m)}})),await this.collectionsStorage.parse({uri:o.relative_path,type:Hn.FS,content:a},l)}catch(s){return console.error(`Error parsing Arazzo file ${o.relative_path}:`,s),null}});return n?.setAttribute("status","completed"),n?.setAttribute("parsedCollectionsCount",i.length),n?.setStatus(exports.SpanStatusCode.OK),n?.end(),i.filter(o=>o!==null)}}class W3{constructor(e){this.baseDir=e}async ls(e=""){const r=this.makeKey(e);return Object.keys(localStorage).filter(n=>n.startsWith(r)).map(n=>n.replace(r,""))}async get(e){const r=this.makeKey(e);return localStorage.getItem(r)??null}async set(e,r){const n=this.makeKey(e);localStorage.setItem(n,r)}async remove(e){const r=this.makeKey(e);localStorage.removeItem(r)}makeKey(e){return`replay:fs:${this.baseDir}/${e}`}}class bDe extends LZ{constructor(e,r,n){const i=new W3(e.systemFilesDir),o=new W3(e.userFilesDir);super(i,o,e,!1,r,n)}async detectProjectFiles(e){const r=this.telemetry?.startSpan("storage.detectFiles",{},e?.parentCtx),i=(await this.userFilesStorage.ls()).filter(l=>/\.(ya?ml|json)$/.test(l)),o=[],s=[],a=new Set;return await Promise.all(i.map(async l=>{const c=await this.userFilesStorage.get(l);if(c)try{const u=Pa.load(c);if(typeof u=="object"&&u!==null)if(typeof u.openapi=="string"){const d=await or.resolve(await or.join(this.userFilesStorage.baseDir,l)),p=await _k(d,u);o.push({uri:l,type:Hn.FS,content:p})}else typeof u.arazzo=="string"&&(s.push({uri:l,type:Hn.FS,content:u}),u.sourceDescriptions?.forEach(d=>{const p=d.type,h=d.url,m=!p||p==="openapi",g=typeof h=="string"&&Xx(h);m&&g&&a.add(h)}))}catch(u){console.error(`Error parsing YAML/JSON file ${l}:`,u)}})),r?.setAttribute("status","completed"),r?.setAttribute("filesCount",i.length),r?.setAttribute("apiFilesCount",o.length),r?.setAttribute("collectionFilesCount",s.length),r?.setAttribute("apiUrlsCount",a.size),r?.setStatus(exports.SpanStatusCode.OK),r?.end(),{apiFiles:o,collectionFiles:s,apiUrls:a}}async loadApis(e,r){const n=this.telemetry?.startSpan("storage.loadApis",{apiUrlsCount:e.size},r?.parentCtx),i=[];return await Promise.all(Array.from(e).map(async o=>{try{const s=await _k(o);i.push({uri:o,type:Hn.WEB,content:s})}catch(s){console.error(`Error parsing YAML from ${o}:`,s)}})),n?.setAttribute("status","completed"),n?.setStatus(exports.SpanStatusCode.OK),n?.end(),i}async parseApis(e,r){const n=this.telemetry?.startSpan("storage.parseApis",{apisCount:e.length},r?.parentCtx),i=await this.apisStorage.parseMany(e);return n?.setAttribute("status","completed"),n?.setAttribute("parsedApisCount",i.length),n?.setStatus(exports.SpanStatusCode.OK),n?.end(),i}async parseCollections(e,r,n){const i=this.telemetry?.startSpan("storage.parseCollections",{collectionsCount:e.length},n?.parentCtx),o=await this.collectionsStorage.parseMany(e,r);return i?.setAttribute("status","completed"),i?.setAttribute("parsedCollectionsCount",o.length),i?.setStatus(exports.SpanStatusCode.OK),i?.end(),o}async read(){const e=this.telemetry?.startSpan("storage.read",void 0,void 0),r=this.telemetry?.startSpan("storage.loadUserState",{},e?.parentCtx),[n,i,o,s]=await Promise.all([this.historyStorage.read(),this.activeEnvironmentIdStorage.read(),this.tabsStateStorage.read(),this.environmentsStorage.read()]);r?.setAttribute("status","completed"),r?.setAttribute("historyCount",n.length),r?.setAttribute("environmentCount",s.length),r?.setStatus(exports.SpanStatusCode.OK),r?.end();const{apiFiles:a,collectionFiles:l,apiUrls:c}=await this.detectProjectFiles(e),u=await this.loadApis(c,e),d=await this.parseApis([...a,...u],e);this.apisStorage.setItemIds(d.map(h=>h.id));const p=await this.parseCollections(l,d,e);return this.collectionsStorage.setItemIds(p.map(h=>h.id)),e?.setAttribute("status","completed"),e?.setStatus(exports.SpanStatusCode.OK),e?.end(),{project:this.project,history:n,activeEnvironmentId:i,tabsState:o,environments:s,apis:d,collections:p}}}function FZ(t=!1){let e,r=!1;return()=>({id:"RootStoragePlugin",onCreate:()=>({init:n=>async(i,o,s)=>{if(r||n.path.length>0)return{isInitialized:!1};if(r=!0,!t){e=Da()?new vDe(i,o,s):new bDe(i,o,s);const a=await e.read();n.merge(a)}return r=!1,{isInitialized:!0}}}),onSet(n,i,o){r||t||e.update(i,o)}})}function ZZ({defaultEnvironments:t}={}){return structuredClone({project:{id:"default",userFilesDir:"default",systemFilesDir:"default"},history:[],tabsState:ma(K6),activeEnvironmentId:Cg,environments:t||J6,collections:[],apis:[],requestController:null,apps:{apps:[],appsLoadingState:as.Idle},predefinedApiId:null,predefinedEnvironmentNames:new Set,predefinedInputNames:new Set})}const xDe=bz(ZZ(),xz(dCe({key:"replay-root-store"}),FZ())),qA=$.createContext(xDe),SDe=qA.Provider;function gt(){const t=$.useContext(qA);return Sz(t)}function wDe(){return{theme:"light",disableCollectionsTab:!1,oAuth2RedirectURI:null,corsProxyUrl:void 0,mockServer:void 0,certificates:[],isApiBased:!1,generatedEnvironments:[],generatedInputs:[],hideOtherSecuritySchemes:!1}}const PDe=wDe(),CDe=$.createContext(PDe);function Vo(){const t=$.useContext(CDe);return Sz(t)}function $De(t,e){const{apps:{apiId:r}}=gt(),{corsProxyUrl:n,disableCollectionsTab:i,mockServer:o,oAuth2RedirectURI:s,certificates:a,storageKey:l,isApiBased:c}=Vo();n.set(t?.corsProxyUrl??ZPe),o.set(t?.mockServer),r.set(t?.apiId),s.set(t?.oAuth2RedirectURI),i.set(!!t?.disableCollectionsTab),l.set(t?.storageKey),c.set(!!e),$.useEffect(()=>{a.set(t?.certificates||[])},[t?.certificates])}const Wx=$.createContext({});function ru(){return $.useContext(Wx)||{}}const kDe="0.21.0-next.3",TDe={version:kDe};class YZ{_client;_isInitialized=!1;_initResolve=null;_initPromise=new Promise(e=>{this._initResolve=e});_globalAttributes={platform:"",deviceId:""};constructor(){this._client=new FPe}get isInitialized(){return this._isInitialized}get client(){return this._client}awaitInit(){return this._initPromise}updateCloudEventData(e){this._client.updateCloudEventData(e)}enrichGlobalAttributes(e){this._globalAttributes={...this._globalAttributes,...e}}getGlobalAttributes(){return{...this._globalAttributes}}clearGlobalAttributes(){this._globalAttributes={platform:"",deviceId:""}}init(e){if(this.isInitialized)return;const r=!0,n=e?.tracerName||"desktop",i=e?.enableErrorInstrumentation??n==="desktop",o={serviceName:"replay",serviceVersion:TDe.version,version:"1.0.0",tracerName:n,collectorUrl:"",isProd:r,enableErrorInstrumentation:i};this._client.init({otel:{...o,...e}}),this._initResolve?.(this),this._isInitialized=!0}sendEvent(e,r){if(!this.isInitialized){console.warn("Telemetry client not initialized. Call init() first.");return}const n={...this._globalAttributes,...r};try{this.client.send(e,n)}catch(i){console.error("Failed to send telemetry event:",i)}}startSpan(e,r,n){if(!this.isInitialized){console.warn("Telemetry client not initialized. Call init() first.");return}try{return this._client.startSpan(e,{...this._globalAttributes,...r},n)}catch(i){console.error("Failed to start telemetry span:",i);return}}}const sd=new YZ;function st(){const{telemetry:t}=ru();return sd.isInitialized||sd.init(t),{sendEvent:(e,r)=>{sd.sendEvent(e,r)},startSpan:(e,r,n)=>sd.startSpan(e,r,n)}}const EDe=({awaitInit:t=!0}={})=>{const[e,r]=$.useState(void 0);return $.useEffect(()=>{(async()=>{const i=t?await sd.awaitInit():sd;r(i)})()},[t]),e},zn=800,yi=T(Q.Button).attrs({variant:"text",size:"small",tone:"danger"})`
418
418
  border: none;
419
419
  margin: 0;
420
420
 
@@ -2565,7 +2565,7 @@ Please report this to https://github.com/markedjs/marked.`,t){const i="<p>An err
2565
2565
  gap: var(--spacing-xs);
2566
2566
  `,Ov={[Qn.SIMPLE]:{label:"Simple",tooltipContent:"Success criteria conditions in the form of basic literals, operators, and loose comparisons"},[Qn.REGEX]:{label:"Regex",tooltipContent:"Regex patterns used as success criteria conditions"},[Qn.JSONPATH]:{label:"JSONPath",tooltipContent:"JSONPath expressions as success criteria conditions"},[Qn.XPATH]:{label:"XPath",tooltipContent:"XPath expressions as success criteria conditions"}},CZe=Object.keys(Ov);function $Ze({successCriteria:t}){const{sendEvent:e}=st(),r=o=>{e("button.click",[{source:"workflow",action:"add_success_criteria",success_criteria_type:o}]),t.set(s=>[...s||[],{...i5e(o)}])},n=$.useMemo(()=>t.filter(o=>o.get()!==void 0),[t]),i=o=>{e("button.click",[{source:"workflow",action:"remove_success_criteria",success_criteria_type:o.get().type,condition:o.get().condition}]),o.set(pt)};return f.jsxs(f.Fragment,{children:[f.jsxs(Ra,{children:["Success criteria",f.jsx(so,{content:"List of conditions required to complete the step."})]}),n.map(o=>f.jsx($.Fragment,{children:f.jsx(bZe,{successCriteria:o,label:Ov[o.get().type].label,tooltipContent:Ov[o.get().type].tooltipContent,additionalActions:f.jsx(yi,{"data-testid":"remove-success-criteria-button",variant:"text",icon:f.jsx(Q.TrashCanIcon,{}),onClick:()=>i(o)})})},o.get().id)),f.jsx(kZe,{renderInput:()=>f.jsx(Q.Button,{variant:"outlined",icon:f.jsx(Q.AddIcon,{}),iconPosition:"left",size:"small",children:"Add success criteria"}),dataTestId:"workflow-step-success-criteria-select",options:CZe.map(o=>({element:Ov[o].label,label:o,value:o})),onChange:o=>{r(o)},placement:"top",hideCheckmarkIcon:!0})]})}const kZe=T(Q.Select)`
2567
2567
  border-radius: var(--border-radius-md);
2568
- `;function TZe({step:t,workflowId:e,collectionId:r}){const{handleIdChange:n}=tu(),i=t.stepId.get();return f.jsx(f.Fragment,{children:f.jsxs(FJ,{children:[f.jsx(Ra,{children:"Info"}),f.jsxs(zt,{children:[f.jsxs(zt.Row,{children:[f.jsx(zt.Cell,{children:f.jsxs(Ec,{children:["Step ID",f.jsx(so,{content:"This step's unique identifier"})]})}),f.jsx(zt.Cell,{$readonly:!0,children:f.jsx(rT,{attribute:t.stepId,editorTitle:"Change step ID",placeholder:"Add step ID",onSave:o=>{r&&e&&n({collectionId:r,workflowId:e,stepId:i},{collectionId:r,workflowId:e,stepId:o})}})})]}),f.jsxs(zt.Row,{children:[f.jsx(zt.Cell,{children:f.jsxs(Ec,{children:["Description",f.jsx(so,{content:"The step's purpose in the workflow."})]})}),f.jsx(zt.Cell,{children:f.jsx(aI,{state:t.description,placeholder:"Add description"})})]})]}),f.jsxs(Pd,{children:[f.jsx(Ra,{children:"Operation"}),f.jsx(mZe,{step:t,collectionId:r})]}),f.jsx(Pd,{children:f.jsx(BJ,{outputs:t.outputs,tooltipText:"Data generated in this step that can be used in the next steps."})}),f.jsx(Pd,{children:f.jsx($Ze,{successCriteria:t.successCriteria})})]})})}function EZe({onParameterChange:t,files:e}){const r=$.useRef(null),n=a=>{a.target.files?.length&&t(Array.from(a.target.files).map(l=>({absolutePath:null,file:l})))},i=async()=>{if(Da())try{const{open:a}=await Promise.resolve().then(()=>require("./replay-index-BaSDK5wQ.js")),l=await a({multiple:!0});if(!l)return;const u=(Array.isArray(l)?l:[l]).map(Mg),p=(await Promise.all(u)).filter(h=>h!==null);t(p)}catch(a){console.error("Failed to open file dialog or read file:",a)}else r.current?.click()},o=$.useCallback(()=>{t(null)},[t]),s=$.useMemo(()=>{if(!e)return null;if(e.length===1)return f.jsx(dq,{icon:f.jsx(Q.CloseIcon,{}),variant:"secondary",onClick:o,iconPosition:"right",size:"small",children:f.jsx(fq,{children:e[0].file.name})});if(e.length>1)return f.jsx(dq,{icon:f.jsx(Q.CloseIcon,{}),variant:"secondary",onClick:o,iconPosition:"right",size:"small",children:f.jsxs(fq,{children:[e.length," files"]})})},[e,o]);return f.jsx(AZe,{children:f.jsxs(IZe,{children:[f.jsx(RZe,{children:s||f.jsx(jZe,{children:"Add files here"})}),f.jsxs(_Ze,{children:[f.jsx(ADe,{onClick:i,variant:"text","data-testid":"add-button",icon:f.jsx(Q.AddIcon,{color:"--text-color-secondary"})}),f.jsx("input",{"data-testid":"file-input",hidden:!0,ref:r,type:"file",multiple:!0,accept:"files/*",onChange:n})]})]})})}const AZe=T.div`
2568
+ `;function TZe({step:t,workflowId:e,collectionId:r}){const{handleIdChange:n}=tu(),i=t.stepId.get();return f.jsx(f.Fragment,{children:f.jsxs(FJ,{children:[f.jsx(Ra,{children:"Info"}),f.jsxs(zt,{children:[f.jsxs(zt.Row,{children:[f.jsx(zt.Cell,{children:f.jsxs(Ec,{children:["Step ID",f.jsx(so,{content:"This step's unique identifier"})]})}),f.jsx(zt.Cell,{$readonly:!0,children:f.jsx(rT,{attribute:t.stepId,editorTitle:"Change step ID",placeholder:"Add step ID",onSave:o=>{r&&e&&n({collectionId:r,workflowId:e,stepId:i},{collectionId:r,workflowId:e,stepId:o})}})})]}),f.jsxs(zt.Row,{children:[f.jsx(zt.Cell,{children:f.jsxs(Ec,{children:["Description",f.jsx(so,{content:"The step's purpose in the workflow."})]})}),f.jsx(zt.Cell,{children:f.jsx(aI,{state:t.description,placeholder:"Add description"})})]})]}),f.jsxs(Pd,{children:[f.jsx(Ra,{children:"Operation"}),f.jsx(mZe,{step:t,collectionId:r})]}),f.jsx(Pd,{children:f.jsx(BJ,{outputs:t.outputs,tooltipText:"Data generated in this step that can be used in the next steps."})}),f.jsx(Pd,{children:f.jsx($Ze,{successCriteria:t.successCriteria})})]})})}function EZe({onParameterChange:t,files:e}){const r=$.useRef(null),n=a=>{a.target.files?.length&&t(Array.from(a.target.files).map(l=>({absolutePath:null,file:l})))},i=async()=>{if(Da())try{const{open:a}=await Promise.resolve().then(()=>require("./replay-index-UQ28K4DB.js")),l=await a({multiple:!0});if(!l)return;const u=(Array.isArray(l)?l:[l]).map(Mg),p=(await Promise.all(u)).filter(h=>h!==null);t(p)}catch(a){console.error("Failed to open file dialog or read file:",a)}else r.current?.click()},o=$.useCallback(()=>{t(null)},[t]),s=$.useMemo(()=>{if(!e)return null;if(e.length===1)return f.jsx(dq,{icon:f.jsx(Q.CloseIcon,{}),variant:"secondary",onClick:o,iconPosition:"right",size:"small",children:f.jsx(fq,{children:e[0].file.name})});if(e.length>1)return f.jsx(dq,{icon:f.jsx(Q.CloseIcon,{}),variant:"secondary",onClick:o,iconPosition:"right",size:"small",children:f.jsxs(fq,{children:[e.length," files"]})})},[e,o]);return f.jsx(AZe,{children:f.jsxs(IZe,{children:[f.jsx(RZe,{children:s||f.jsx(jZe,{children:"Add files here"})}),f.jsxs(_Ze,{children:[f.jsx(ADe,{onClick:i,variant:"text","data-testid":"add-button",icon:f.jsx(Q.AddIcon,{color:"--text-color-secondary"})}),f.jsx("input",{"data-testid":"file-input",hidden:!0,ref:r,type:"file",multiple:!0,accept:"files/*",onChange:n})]})]})})}const AZe=T.div`
2569
2569
  position: relative;
2570
2570
  display: flex;
2571
2571
  flex-grow: 1;
@@ -2692,7 +2692,7 @@ Please report this to https://github.com/markedjs/marked.`,t){const i="<p>An err
2692
2692
  `,ZZe=T.div`
2693
2693
  display: flex;
2694
2694
  justify-content: center;
2695
- `;function YZe({data:t,type:e}){const r=Kt(),n=t[e];function i(s,a){a&&n.merge([xa()])}function o(s){n[s].set(pt)}return f.jsx(DZe,{keyName:"Param",formElements:n,onParameterChange:i,environment:r,enableInputTypeSelection:e!==zr["application/x-www-form-urlencoded"],actions:s=>f.jsx(yi,{onClick:()=>o(s),variant:"text",icon:f.jsx(Q.TrashCanIcon,{})})})}const GZe=({data:t})=>{const e=t.get(),[r,n]=$.useState(!1),i=$.useRef(null),o=c=>{const u=c.target.files?.[0];if(u){n(!0);const d=new FileReader;d.onload=()=>{n(!1),t.set({absolutePath:null,file:u})},d.readAsDataURL(u)}},s=async c=>{if(c?.preventDefault(),Da())try{const{open:u}=await Promise.resolve().then(()=>require("./replay-index-BaSDK5wQ.js")),d=await u();if(!d)return;const p=await Mg(d);t.set(p)}catch(u){console.error("Failed to open file dialog or read file:",u)}else i.current?.click()},a=c=>{c.key==="Enter"&&(c.preventDefault(),s())},l=()=>{t.set(null)};return r?f.jsxs(HZe,{children:[f.jsx(Q.SpinnerIcon,{}),"Loading..."]}):e&&e.file?.name?f.jsxs(JZe,{children:[f.jsxs(KZe,{children:[f.jsx(Q.DocumentBlankIcon,{size:"16px"}),f.jsx(eYe,{children:e.file?.name})]}),f.jsx(yi,{onClick:l,icon:f.jsx(Q.TrashCanIcon,{})})]}):f.jsx(ZJ,{children:!e&&f.jsxs(tYe,{tabIndex:0,role:"button",onKeyDown:a,onClick:s,children:[f.jsx("input",{type:"file",onChange:o,ref:i}),f.jsx(Q.CloudUploadIcon,{}),"Upload file"]})})},ZJ=T.div`
2695
+ `;function YZe({data:t,type:e}){const r=Kt(),n=t[e];function i(s,a){a&&n.merge([xa()])}function o(s){n[s].set(pt)}return f.jsx(DZe,{keyName:"Param",formElements:n,onParameterChange:i,environment:r,enableInputTypeSelection:e!==zr["application/x-www-form-urlencoded"],actions:s=>f.jsx(yi,{onClick:()=>o(s),variant:"text",icon:f.jsx(Q.TrashCanIcon,{})})})}const GZe=({data:t})=>{const e=t.get(),[r,n]=$.useState(!1),i=$.useRef(null),o=c=>{const u=c.target.files?.[0];if(u){n(!0);const d=new FileReader;d.onload=()=>{n(!1),t.set({absolutePath:null,file:u})},d.readAsDataURL(u)}},s=async c=>{if(c?.preventDefault(),Da())try{const{open:u}=await Promise.resolve().then(()=>require("./replay-index-UQ28K4DB.js")),d=await u();if(!d)return;const p=await Mg(d);t.set(p)}catch(u){console.error("Failed to open file dialog or read file:",u)}else i.current?.click()},a=c=>{c.key==="Enter"&&(c.preventDefault(),s())},l=()=>{t.set(null)};return r?f.jsxs(HZe,{children:[f.jsx(Q.SpinnerIcon,{}),"Loading..."]}):e&&e.file?.name?f.jsxs(JZe,{children:[f.jsxs(KZe,{children:[f.jsx(Q.DocumentBlankIcon,{size:"16px"}),f.jsx(eYe,{children:e.file?.name})]}),f.jsx(yi,{onClick:l,icon:f.jsx(Q.TrashCanIcon,{})})]}):f.jsx(ZJ,{children:!e&&f.jsxs(tYe,{tabIndex:0,role:"button",onKeyDown:a,onClick:s,children:[f.jsx("input",{type:"file",onChange:o,ref:i}),f.jsx(Q.CloudUploadIcon,{}),"Upload file"]})})},ZJ=T.div`
2696
2696
  display: flex;
2697
2697
  align-items: center;
2698
2698
  justify-content: flex-start;
@@ -2856,7 +2856,7 @@ Please report this to https://github.com/markedjs/marked.`,t){const i="<p>An err
2856
2856
  font-size: var(--font-size-base);
2857
2857
  font-weight: var(--font-weight-medium);
2858
2858
  padding: var(--spacing-xs);
2859
- `;function RYe(t=32){let e="";for(;e.length<t;)e+=Math.random().toString(32).substring(2);return e.substring(0,t)}async function _Ye(t){const e=new TextEncoder().encode(t);return crypto?.subtle.digest("SHA-256",e)}function jYe(t){if(t)return btoa(String.fromCharCode.apply(null,new Uint8Array(t))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function hq(t,e,r){const n=typeof t=="string"?t:t.toString();if(Da()){const{openUrl:i}=await Promise.resolve().then(()=>require("./replay-index-BLnEGhe2.js"));await i(n);return}window.open(n,e,r)}const gq="/_auth/oauth2-redirect.html";let v1=class Rp{static async authorizeImplicit({authorizationUrl:e,clientId:r,scopes:n,extraAuthParams:i={},routingBasePath:o="/",redirectUri:s,successCallback:a,errorCallback:l}){const c=mq({date:new Date().toString()});try{const u=new URL(e),d=o==="/"?"":o,p=`${window.location.origin}${d}${gq}`;u.searchParams.set("client_id",r),u.searchParams.set("redirect_uri",s||p),u.searchParams.set("response_type","token"),u.searchParams.set("state",c),Array.isArray(n)&&u.searchParams.set("scope",n.join(" "));for(const h in i)u.searchParams.set(h,i[h]);window.redirectOAuth2={flow:"implicit",data:{authorizationUrl:e,clientId:r,scopes:n},state:c,successCallback:h=>{a(h),Rp.clearRedirectData("implicit")},errorCallback:h=>{l(h),Rp.clearRedirectData("implicit")}},await hq(u.toString())}catch(u){l(sa.OAuth2Error.fromError(u))}}static async authorizeAuthorizationCode({authorizationUrl:e,tokenUrl:r,serverUrl:n,clientId:i,clientSecret:o,codeVerifier:s,codeChallenge:a,scopes:l,extraAuthParams:c={},extraTokenHeaders:u={},extraTokenBody:d={},extraTokenParams:p={},routingBasePath:h="/",redirectUri:m,withPkce:g,successCallback:O,errorCallback:y}){try{const v=YO({url:e,serverUrl:n}),b=new URL(v),w=YO({url:r,serverUrl:n}),S=new URL(w),P=h==="/"?"":h,C=`${window.location.origin}${P}${gq}`,E=mq({date:new Date().toString()});b.searchParams.set("client_id",i),b.searchParams.set("redirect_uri",m||C),b.searchParams.set("response_type","code"),b.searchParams.set("state",E),Array.isArray(l)&&b.searchParams.set("scope",l.join(" ")),g&&(!a&&!s&&(s=NYe(),a=await QYe(s)),a&&(b.searchParams.set("code_challenge",a),b.searchParams.set("code_challenge_method","S256")));for(const R in c)b.searchParams.set(R,c[R]);for(const R in p)S.searchParams.set(R,p[R]);window.redirectOAuth2={flow:"authorizationCode",data:{authorizationUrl:e,clientId:i,scopes:l},state:E,successCallback:async({auth_code:R})=>{const D=ma({client_id:i,client_secret:o,...s&&{code_verifier:s},code:R,grant_type:"authorization_code",redirect_uri:m||C,...d});try{const _=await Sa(S,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8",Accept:"application/json",...u},body:new URLSearchParams(D).toString()});await MP(_,O,y)}catch(_){y(sa.OAuth2Error.fromError(_))}Rp.clearRedirectData("authorizationCode")},errorCallback:R=>{y(sa.OAuth2Error.fromError(R)),Rp.clearRedirectData("authorizationCode")}},await hq(b.toString())}catch(v){y(sa.OAuth2Error.fromError(v))}}static clearRedirectData(e){window.redirectOAuth2={flow:e,data:{authorizationUrl:"",clientId:"",scopes:[]},state:"",successCallback:()=>{},errorCallback:()=>{}}}static async authorizeClientCredentials({tokenUrl:e,clientId:r,clientSecret:n,scopes:i=[],extraTokenParams:o={},extraTokenHeaders:s={},extraTokenBody:a={},corsProxyUrl:l,serverUrl:c,assertionType:u,clientAssertion:d,successCallback:p,errorCallback:h}){try{const m={client_id:r,client_secret:n,grant_type:"client_credentials",scope:Array.isArray(i)&&i.length?i.join(" "):void 0,client_assertion_type:u,client_assertion:d,...a},g=YO({url:e,serverUrl:c,corsProxyUrl:l}),O=new URL(g);for(const v in o)O.searchParams.set(v,o[v]);const y=await Sa(g,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8",Accept:"application/json",...s},body:new URLSearchParams(k5(m)).toString()});await MP(y,p,h)}catch(m){h(sa.OAuth2Error.fromError(m))}}static async authorizePasswordGrant({username:e,password:r,tokenUrl:n,clientId:i,clientSecret:o,scopes:s=[],extraTokenParams:a={},extraTokenHeaders:l={},extraTokenBody:c={},corsProxyUrl:u,serverUrl:d,successCallback:p,errorCallback:h}){try{const m={client_id:i,client_secret:o,grant_type:"password",username:e,password:r,scope:Array.isArray(s)&&s.length?s.join(" "):void 0,...c},g=YO({url:n,serverUrl:d,corsProxyUrl:u}),O=new URL(g);for(const v in a)O.searchParams.set(v,a[v]);const y=await Sa(g,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8",Accept:"application/json",...l},body:new URLSearchParams(k5(m)).toString()});await MP(y,p,h)}catch(m){h(sa.OAuth2Error.fromError(m))}}};function mq(t){const e={randomStr:RYe(),...t};return btoa(encodeURIComponent(JSON.stringify(e)))}async function MP(t,e,r){if(t.ok){const n=await t.json();if(n.error){r(sa.OAuth2Error.fromJsonData(n));return}e(n)}else{if((t.headers.get("Content-Type")||"").indexOf("json")>-1){const o=await t.json();r(sa.OAuth2Error.fromJsonData(o));return}r(sa.OAuth2Error.fromTextData(await t.text()))}}async function QYe(t){return jYe(await _Ye(t))}function DYe(t){return("0"+t.toString(16)).substring(-2)}function NYe(){const t=new Uint32Array(28);return crypto.getRandomValues(t),Array.from(t,DYe).join("")}function b1({scopes:t,environment:e}){const r=(i,o)=>{o&&t.merge([pi()])},n=i=>{t[i].set(pt)};return f.jsx(MYe,{children:f.jsx(qYe,{keyName:"Scopes",elements:t,onParameterChange:r,environment:e,actions:i=>f.jsx(yi,{onClick:()=>n(i),variant:"text",icon:f.jsx(Q.TrashCanIcon,{})}),singleValue:!0,hideOuterBorders:!0,valuePlaceholder:"New scope item"})})}const MYe=T.div`
2859
+ `;function RYe(t=32){let e="";for(;e.length<t;)e+=Math.random().toString(32).substring(2);return e.substring(0,t)}async function _Ye(t){const e=new TextEncoder().encode(t);return crypto?.subtle.digest("SHA-256",e)}function jYe(t){if(t)return btoa(String.fromCharCode.apply(null,new Uint8Array(t))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function hq(t,e,r){const n=typeof t=="string"?t:t.toString();if(Da()){const{openUrl:i}=await Promise.resolve().then(()=>require("./replay-index-Dp-vpENL.js"));await i(n);return}window.open(n,e,r)}const gq="/_auth/oauth2-redirect.html";let v1=class Rp{static async authorizeImplicit({authorizationUrl:e,clientId:r,scopes:n,extraAuthParams:i={},routingBasePath:o="/",redirectUri:s,successCallback:a,errorCallback:l}){const c=mq({date:new Date().toString()});try{const u=new URL(e),d=o==="/"?"":o,p=`${window.location.origin}${d}${gq}`;u.searchParams.set("client_id",r),u.searchParams.set("redirect_uri",s||p),u.searchParams.set("response_type","token"),u.searchParams.set("state",c),Array.isArray(n)&&u.searchParams.set("scope",n.join(" "));for(const h in i)u.searchParams.set(h,i[h]);window.redirectOAuth2={flow:"implicit",data:{authorizationUrl:e,clientId:r,scopes:n},state:c,successCallback:h=>{a(h),Rp.clearRedirectData("implicit")},errorCallback:h=>{l(h),Rp.clearRedirectData("implicit")}},await hq(u.toString())}catch(u){l(sa.OAuth2Error.fromError(u))}}static async authorizeAuthorizationCode({authorizationUrl:e,tokenUrl:r,serverUrl:n,clientId:i,clientSecret:o,codeVerifier:s,codeChallenge:a,scopes:l,extraAuthParams:c={},extraTokenHeaders:u={},extraTokenBody:d={},extraTokenParams:p={},routingBasePath:h="/",redirectUri:m,withPkce:g,successCallback:O,errorCallback:y}){try{const v=YO({url:e,serverUrl:n}),b=new URL(v),w=YO({url:r,serverUrl:n}),S=new URL(w),P=h==="/"?"":h,C=`${window.location.origin}${P}${gq}`,E=mq({date:new Date().toString()});b.searchParams.set("client_id",i),b.searchParams.set("redirect_uri",m||C),b.searchParams.set("response_type","code"),b.searchParams.set("state",E),Array.isArray(l)&&b.searchParams.set("scope",l.join(" ")),g&&(!a&&!s&&(s=NYe(),a=await QYe(s)),a&&(b.searchParams.set("code_challenge",a),b.searchParams.set("code_challenge_method","S256")));for(const R in c)b.searchParams.set(R,c[R]);for(const R in p)S.searchParams.set(R,p[R]);window.redirectOAuth2={flow:"authorizationCode",data:{authorizationUrl:e,clientId:i,scopes:l},state:E,successCallback:async({auth_code:R})=>{const D=ma({client_id:i,client_secret:o,...s&&{code_verifier:s},code:R,grant_type:"authorization_code",redirect_uri:m||C,...d});try{const _=await Sa(S,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8",Accept:"application/json",...u},body:new URLSearchParams(D).toString()});await MP(_,O,y)}catch(_){y(sa.OAuth2Error.fromError(_))}Rp.clearRedirectData("authorizationCode")},errorCallback:R=>{y(sa.OAuth2Error.fromError(R)),Rp.clearRedirectData("authorizationCode")}},await hq(b.toString())}catch(v){y(sa.OAuth2Error.fromError(v))}}static clearRedirectData(e){window.redirectOAuth2={flow:e,data:{authorizationUrl:"",clientId:"",scopes:[]},state:"",successCallback:()=>{},errorCallback:()=>{}}}static async authorizeClientCredentials({tokenUrl:e,clientId:r,clientSecret:n,scopes:i=[],extraTokenParams:o={},extraTokenHeaders:s={},extraTokenBody:a={},corsProxyUrl:l,serverUrl:c,assertionType:u,clientAssertion:d,successCallback:p,errorCallback:h}){try{const m={client_id:r,client_secret:n,grant_type:"client_credentials",scope:Array.isArray(i)&&i.length?i.join(" "):void 0,client_assertion_type:u,client_assertion:d,...a},g=YO({url:e,serverUrl:c,corsProxyUrl:l}),O=new URL(g);for(const v in o)O.searchParams.set(v,o[v]);const y=await Sa(g,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8",Accept:"application/json",...s},body:new URLSearchParams(k5(m)).toString()});await MP(y,p,h)}catch(m){h(sa.OAuth2Error.fromError(m))}}static async authorizePasswordGrant({username:e,password:r,tokenUrl:n,clientId:i,clientSecret:o,scopes:s=[],extraTokenParams:a={},extraTokenHeaders:l={},extraTokenBody:c={},corsProxyUrl:u,serverUrl:d,successCallback:p,errorCallback:h}){try{const m={client_id:i,client_secret:o,grant_type:"password",username:e,password:r,scope:Array.isArray(s)&&s.length?s.join(" "):void 0,...c},g=YO({url:n,serverUrl:d,corsProxyUrl:u}),O=new URL(g);for(const v in a)O.searchParams.set(v,a[v]);const y=await Sa(g,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8",Accept:"application/json",...l},body:new URLSearchParams(k5(m)).toString()});await MP(y,p,h)}catch(m){h(sa.OAuth2Error.fromError(m))}}};function mq(t){const e={randomStr:RYe(),...t};return btoa(encodeURIComponent(JSON.stringify(e)))}async function MP(t,e,r){if(t.ok){const n=await t.json();if(n.error){r(sa.OAuth2Error.fromJsonData(n));return}e(n)}else{if((t.headers.get("Content-Type")||"").indexOf("json")>-1){const o=await t.json();r(sa.OAuth2Error.fromJsonData(o));return}r(sa.OAuth2Error.fromTextData(await t.text()))}}async function QYe(t){return jYe(await _Ye(t))}function DYe(t){return("0"+t.toString(16)).substring(-2)}function NYe(){const t=new Uint32Array(28);return crypto.getRandomValues(t),Array.from(t,DYe).join("")}function b1({scopes:t,environment:e}){const r=(i,o)=>{o&&t.merge([pi()])},n=i=>{t[i].set(pt)};return f.jsx(MYe,{children:f.jsx(qYe,{keyName:"Scopes",elements:t,onParameterChange:r,environment:e,actions:i=>f.jsx(yi,{onClick:()=>n(i),variant:"text",icon:f.jsx(Q.TrashCanIcon,{})}),singleValue:!0,hideOuterBorders:!0,valuePlaceholder:"New scope item"})})}const MYe=T.div`
2860
2860
  width: 100%;
2861
2861
 
2862
2862
  > div {
@@ -3491,7 +3491,7 @@ Please report this to https://github.com/markedjs/marked.`,t){const i="<p>An err
3491
3491
  @media (max-width: ${zn}px) {
3492
3492
  padding: var(--spacing-xs) var(--spacing-sm);
3493
3493
  }
3494
- `,sJe={info:t=>{},error:t=>{},warn:t=>{},printNewLine:()=>{},printSeparator:()=>{},indent:(t,e)=>t,output:t=>t},aJe=t=>t instanceof URL?t.toString():t instanceof Request?t.url:t;function lJe({collectionId:t,workflowId:e}){const{project:{userFilesDir:r}}=gt(),{certificates:n}=Vo(),i=Kt(),{getCollection:o}=Xg(),s=o(t),a=r.get(),{inputs:l,servers:c}=i.get(),u=s?.sourceDescriptions.get()??[];return{execute:async p=>{const h=`${a}/${t}`,m=new BZ,g=l.map(v=>JSON.stringify({[v.name]:v.value})),O=cJe(c,u),{run:y}=await Promise.resolve().then(()=>require("./replay-index-CTDJpsxA.js"));return await y({files:[h],workflow:e?[e]:[],fetch:(v,b)=>{const w=aJe(v),{clientCert:S,clientKey:P}=zY(w,n?n.get({noproxy:!0}):[]);return Sa(w,{...b,clientCert:S,clientKey:P})},logger:sJe,maxSteps:500,maxFetchTimeout:4e4,requestFileLoader:{getFileBody:async v=>{if(!await RE(v))throw new Error(`File ${v} doesn't exist or isn't readable.`);try{const w=await Px(v),S=new TextEncoder().encode(w);return new File([S],await jE(v))}catch(w){throw new Error(`Failed to read file ${v}: ${w}`)}}},envVariables:{},config:await DX({}),externalRefResolver:m,input:g,server:O,severity:JSON.stringify(p),skipLint:!0,noSecretsMasking:!0})}}}function cJe(t,e){return e.map(r=>{const n=t.find(o=>o.apiId===r.apiId);if(!n)return null;let i=n.value;if(n.variables)for(const o of n.variables){const s=new RegExp(`\\{${o.name}\\}`,"g");i=i.replace(s,o.value)}return`${r.name}=${i}`}).filter(r=>r!==null)}function VI(t){return t==null?"N/A":t<1e3?`${t} ms`:t<1e4?`${(t/1e3).toFixed(1)} s`:`${Math.round(t/1e3)} s`}function pK({checks:t}){const e=t.filter(h=>h.severity!=="off"),r=e.filter(h=>h.passed).length,n=e.filter(h=>h.severity==="warn"&&!h.passed).length,i=e.length,o=i-r-n,s=r===i,a=r===0,[l,c]=de.default.useState(o>0||n>0),u=()=>s?"All checks passed":a?"All checks failed":`Some ${i>1?"checks were":"check was"} not successful`,d=()=>s?f.jsx(Q.CheckmarkFilledIcon,{color:"var(--color-success-base)"}):o>0?f.jsx(Q.ErrorFilledIcon,{color:"var(--color-error-base)"}):f.jsx(Q.WarningFilledIcon,{color:"var(--color-warning-base)"}),p=h=>{h.stopPropagation(),c(!l)};return!e||e.length===0?null:f.jsxs(uJe,{children:[f.jsxs(dJe,{onClick:p,children:[f.jsxs(fJe,{children:[f.jsx(pJe,{children:f.jsx(hJe,{children:d()})}),f.jsxs(gJe,{children:[f.jsx(mJe,{children:u()}),f.jsxs(OJe,{children:[r," successful",n>0&&f.jsxs(f.Fragment,{children:[", ",n," ",n===1?"warning":"warnings"]}),o>0&&f.jsxs(f.Fragment,{children:[", ",o," failed"]})]})]})]}),f.jsx(yJe,{isExpanded:l,children:l?f.jsx(Q.ChevronDownIcon,{}):f.jsx(Q.ChevronRightIcon,{})})]}),f.jsx(vJe,{isExpanded:l,children:e.map((h,m)=>f.jsxs(bJe,{children:[f.jsx(xJe,{children:h.passed?f.jsx(Q.CheckmarkIcon,{color:"var(--color-success-base)",size:"14px"}):!h.passed&&["warn"].includes(h.severity)?f.jsx(Q.WarningFilledIcon,{color:"var(--color-warning-base)",size:"14px"}):f.jsx(Q.CloseOutlineIcon,{color:"var(--color-error-base)",size:"14px"})}),f.jsxs(SJe,{children:[f.jsx(wJe,{children:h.name}),h.message&&f.jsx(PJe,{children:h.message})]})]},m))})]})}const uJe=T.div`
3494
+ `,sJe={info:t=>{},error:t=>{},warn:t=>{},printNewLine:()=>{},printSeparator:()=>{},indent:(t,e)=>t,output:t=>t},aJe=t=>t instanceof URL?t.toString():t instanceof Request?t.url:t;function lJe({collectionId:t,workflowId:e}){const{project:{userFilesDir:r}}=gt(),{certificates:n}=Vo(),i=Kt(),{getCollection:o}=Xg(),s=o(t),a=r.get(),{inputs:l,servers:c}=i.get(),u=s?.sourceDescriptions.get()??[];return{execute:async p=>{const h=`${a}/${t}`,m=new BZ,g=l.map(v=>JSON.stringify({[v.name]:v.value})),O=cJe(c,u),{run:y}=await Promise.resolve().then(()=>require("./replay-index-Bn7L6SZG.js"));return await y({files:[h],workflow:e?[e]:[],fetch:(v,b)=>{const w=aJe(v),{clientCert:S,clientKey:P}=zY(w,n?n.get({noproxy:!0}):[]);return Sa(w,{...b,clientCert:S,clientKey:P})},logger:sJe,maxSteps:500,maxFetchTimeout:4e4,requestFileLoader:{getFileBody:async v=>{if(!await RE(v))throw new Error(`File ${v} doesn't exist or isn't readable.`);try{const w=await Px(v),S=new TextEncoder().encode(w);return new File([S],await jE(v))}catch(w){throw new Error(`Failed to read file ${v}: ${w}`)}}},envVariables:{},config:await DX({}),externalRefResolver:m,input:g,server:O,severity:JSON.stringify(p),skipLint:!0,noSecretsMasking:!0})}}}function cJe(t,e){return e.map(r=>{const n=t.find(o=>o.apiId===r.apiId);if(!n)return null;let i=n.value;if(n.variables)for(const o of n.variables){const s=new RegExp(`\\{${o.name}\\}`,"g");i=i.replace(s,o.value)}return`${r.name}=${i}`}).filter(r=>r!==null)}function VI(t){return t==null?"N/A":t<1e3?`${t} ms`:t<1e4?`${(t/1e3).toFixed(1)} s`:`${Math.round(t/1e3)} s`}function pK({checks:t}){const e=t.filter(h=>h.severity!=="off"),r=e.filter(h=>h.passed).length,n=e.filter(h=>h.severity==="warn"&&!h.passed).length,i=e.length,o=i-r-n,s=r===i,a=r===0,[l,c]=de.default.useState(o>0||n>0),u=()=>s?"All checks passed":a?"All checks failed":`Some ${i>1?"checks were":"check was"} not successful`,d=()=>s?f.jsx(Q.CheckmarkFilledIcon,{color:"var(--color-success-base)"}):o>0?f.jsx(Q.ErrorFilledIcon,{color:"var(--color-error-base)"}):f.jsx(Q.WarningFilledIcon,{color:"var(--color-warning-base)"}),p=h=>{h.stopPropagation(),c(!l)};return!e||e.length===0?null:f.jsxs(uJe,{children:[f.jsxs(dJe,{onClick:p,children:[f.jsxs(fJe,{children:[f.jsx(pJe,{children:f.jsx(hJe,{children:d()})}),f.jsxs(gJe,{children:[f.jsx(mJe,{children:u()}),f.jsxs(OJe,{children:[r," successful",n>0&&f.jsxs(f.Fragment,{children:[", ",n," ",n===1?"warning":"warnings"]}),o>0&&f.jsxs(f.Fragment,{children:[", ",o," failed"]})]})]})]}),f.jsx(yJe,{isExpanded:l,children:l?f.jsx(Q.ChevronDownIcon,{}):f.jsx(Q.ChevronRightIcon,{})})]}),f.jsx(vJe,{isExpanded:l,children:e.map((h,m)=>f.jsxs(bJe,{children:[f.jsx(xJe,{children:h.passed?f.jsx(Q.CheckmarkIcon,{color:"var(--color-success-base)",size:"14px"}):!h.passed&&["warn"].includes(h.severity)?f.jsx(Q.WarningFilledIcon,{color:"var(--color-warning-base)",size:"14px"}):f.jsx(Q.CloseOutlineIcon,{color:"var(--color-error-base)",size:"14px"})}),f.jsxs(SJe,{children:[f.jsx(wJe,{children:h.name}),h.message&&f.jsx(PJe,{children:h.message})]})]},m))})]})}const uJe=T.div`
3495
3495
  margin-bottom: 0;
3496
3496
  margin-top: var(--spacing-xxs);
3497
3497
  `,dJe=T.div`
@@ -5293,7 +5293,7 @@ Please report this to https://github.com/markedjs/marked.`,t){const i="<p>An err
5293
5293
  `,jnt=T.div`
5294
5294
  display: flex;
5295
5295
  gap: var(--spacing-xs);
5296
- `;async function oee(t,e,r){try{const{join:n,dirname:i}=await Promise.resolve().then(()=>pCe),{exists:o}=await Promise.resolve().then(()=>fCe),{revealItemInDir:s,openPath:a}=await Promise.resolve().then(()=>require("./replay-index-BLnEGhe2.js")),l=await n(t,e);if(r||!await o(l)){const c=await i(l);await a(c);return}await s(l)}catch(n){throw console.error("Failed to reveal item in folder:",n),n}}function Qnt({node:t}){const e=t.data.type==="api"&&t.data.api.srcType.get()===Hn.WEB,{project:r}=gt(),n=$.useMemo(()=>Da(),[]),{sendEvent:i}=st();if(e)return null;const o=()=>{t.tree.delete(t.id)},s=async a=>{a.stopPropagation();try{if(t.data.type==="api"){const l=t.data.api.id.get({noproxy:!0}),c=r.userFilesDir.get({noproxy:!0});await oee(c,l),i("node.management",[{action:"reveal_in_folder",node_type:"api"}])}}catch(l){console.error("Failed to reveal API in folder:",l)}};return f.jsx(Dnt,{children:f.jsx(sr,{content:"More actions",placement:"topRight",children:f.jsx(Q.Dropdown,{trigger:f.jsx(Q.Button,{variant:"text",size:"small",icon:f.jsx(Q.OverflowMenuVerticalIcon,{})}),alignment:"end",children:f.jsxs(Q.DropdownMenu,{children:[n&&f.jsxs(qn,{onClick:s,children:[f.jsx(Q.FolderIcon,{size:"14px"}),"Reveal in folder"]}),f.jsxs(qn,{onClick:o,children:[f.jsx(Q.TrashCanIcon,{size:"14px"}),"Delete"]})]})})})})}const Dnt=T.div`
5296
+ `;async function oee(t,e,r){try{const{join:n,dirname:i}=await Promise.resolve().then(()=>pCe),{exists:o}=await Promise.resolve().then(()=>fCe),{revealItemInDir:s,openPath:a}=await Promise.resolve().then(()=>require("./replay-index-Dp-vpENL.js")),l=await n(t,e);if(r||!await o(l)){const c=await i(l);await a(c);return}await s(l)}catch(n){throw console.error("Failed to reveal item in folder:",n),n}}function Qnt({node:t}){const e=t.data.type==="api"&&t.data.api.srcType.get()===Hn.WEB,{project:r}=gt(),n=$.useMemo(()=>Da(),[]),{sendEvent:i}=st();if(e)return null;const o=()=>{t.tree.delete(t.id)},s=async a=>{a.stopPropagation();try{if(t.data.type==="api"){const l=t.data.api.id.get({noproxy:!0}),c=r.userFilesDir.get({noproxy:!0});await oee(c,l),i("node.management",[{action:"reveal_in_folder",node_type:"api"}])}}catch(l){console.error("Failed to reveal API in folder:",l)}};return f.jsx(Dnt,{children:f.jsx(sr,{content:"More actions",placement:"topRight",children:f.jsx(Q.Dropdown,{trigger:f.jsx(Q.Button,{variant:"text",size:"small",icon:f.jsx(Q.OverflowMenuVerticalIcon,{})}),alignment:"end",children:f.jsxs(Q.DropdownMenu,{children:[n&&f.jsxs(qn,{onClick:s,children:[f.jsx(Q.FolderIcon,{size:"14px"}),"Reveal in folder"]}),f.jsxs(qn,{onClick:o,children:[f.jsx(Q.TrashCanIcon,{size:"14px"}),"Delete"]})]})})})})}const Dnt=T.div`
5297
5297
  display: flex;
5298
5298
  gap: var(--spacing-xxs);
5299
5299
  `;function Nnt({onImport:t}){return f.jsxs(Mnt,{children:[f.jsx(qnt,{children:"No OpenAPI files were imported yet"}),f.jsx(znt,{children:f.jsx(Q.Button,{icon:f.jsx(Q.DownloadIcon,{}),onClick:t,children:"Import OpenAPI file"})})]})}const Mnt=T.div`