@redocly/replay 0.20.0 → 0.20.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{replay-index-SH6n92re.js → replay-index-BG7maSLC.js} +1 -1
- package/dist/{replay-index-UnDH2Zdh.js → replay-index-BwN-9Tk1.js} +1 -1
- package/dist/{replay-index-CUhN6k9v.js → replay-index-CNA8w-F_.js} +1 -1
- package/dist/{replay-index-C9mBzCPB.js → replay-index-CYbvYpkU.js} +7 -7
- package/dist/{replay-index-x-RoN-9E.js → replay-index-CgcOYHQ9.js} +1 -1
- package/dist/{replay-index-DtGNbnlz.js → replay-index-Czio0neV.js} +1 -1
- package/dist/{replay-index-484u4S9t.js → replay-index-DZKeaJ8u.js} +1 -1
- package/dist/{replay-index-D9DnzDDB.js → replay-index-UU9ttWIq.js} +8 -8
- package/dist/{replay-tauri-path-Bgr_2LWK.js → replay-tauri-path-DuSGakRX.js} +2 -2
- package/dist/{replay-tauri-path-DLRG5izi.js → replay-tauri-path-mPN7LCO-.js} +1 -1
- package/dist/replay.cjs +1 -1
- package/dist/replay.js +1 -1
- package/package.json +2 -2
|
@@ -174,7 +174,7 @@ ${o.message}`})}}}}),GW=({filePath:t})=>({Info:{leave(e,{report:r,location:n,con
|
|
|
174
174
|
${o.message}`,location:n.child("description")})}}}}),HW=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 JW(t){return Array.isArray(t)&&t.length===0}const nve="x-internal",KW=({internalFlagProperty:t=nve})=>{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(Xr(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(Xr(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&&(jh(n)||JW(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 e6(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(Xr(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,Xr(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&&(jh(t)||JW(t))&&delete n[i]}function t6(t,e,r){return t===void 0||e===void 0?!1:!Array.isArray(e)&&!Array.isArray(t)?t===e:(e=j5(e),t=j5(t),r==="any"?e.some(n=>t.includes(n)):r==="all"?e.every(n=>t.includes(n)):!1)}function j5(t){return Array.isArray(t)?t:[t]}const ive="any",r6=({property:t,value:e,matchStrategy:r})=>{const n=r||ive,i=o=>o?.[t]&&!t6(o?.[t],e,n);return{any:{enter:(o,s)=>{e6(o,s,i)}}}},ove="any",n6=({property:t,value:e,matchStrategy:r})=>{const n=r||ove,i=o=>t6(o?.[t],e,n);return{any:{enter:(o,s)=>{e6(o,s,i)}}}},sve=({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=Q5(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:R5(Vh(l,r.config?.configPath))}}),e.responses[o]=s)}if(i.request&&e.requestBody){const o=Q5(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:R5(Vh(a,r.config?.configPath))}}),e.requestBody=o}}}}});function Q5(t,e){if(!Xr(t))return t;const r=e(t);return r.error?void 0:JSON.parse(JSON.stringify(r.node))}const i6=()=>{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(f=>d.absolutePointer.startsWith(f)&&(d.absolutePointer.length===f.length||d.absolutePointer[f.length]==="/")))&&c&&n.components){i.push(s);const d=n.components[c];delete d[l],t.delete(s),jh(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("/"),f=`${c}#${d}`,h=t.get(f);h?h.usedIn.push(i):t.set(f,{usedIn:[i],name:a.toString()})}}},Root:{leave(n,i){const o=i.getVisitorData();o.removedCount=r(n,[]),jh(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())}}}},ave={"operation-description-override":ZW,"tag-description-override":YW,"info-description-override":GW,"info-override":HW,"remove-x-internal":KW,"remove-unused-components":i6,"filter-in":r6,"filter-out":n6,"media-type-examples-override":sve},o6=()=>{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(f=>d.absolutePointer.startsWith(f)&&(d.absolutePointer.length===f.length||d.absolutePointer[f.length]==="/")))&&c&&(i.push(s),delete n[c][l],t.delete(s),jh(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("/"),f=`${c}#${d}`,h=t.get(f);h?h.usedIn.push(i):t.set(f,{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())}}}},lve={"operation-description-override":ZW,"tag-description-override":YW,"info-description-override":GW,"info-override":HW,"remove-x-internal":KW,"remove-unused-components":o6,"filter-in":r6,"filter-out":n6},cve={},uve={},dve={},fve={},pve={},hve={recommended:Hme,"recommended-strict":Jme,minimal:ege,all:Kme,spec:tge},D5={id:"",rules:{oas3:hOe,oas2:bOe,async2:POe,async3:EOe,arazzo1:ZOe,overlay1:GOe,openrpc1:tve},preprocessors:{oas3:mOe,oas2:xOe,async2:COe,async3:TOe,arazzo1:YOe,overlay1:HOe,openrpc1:rve},decorators:{oas3:ave,oas2:lve,async2:cve,async3:uve,arazzo1:dve,overlay1:fve,openrpc1:pve},configs:hve};function mve(t){return!Li(t)}function gve(){return new Promise(t=>{setTimeout(t)})}function lh(t,e){return t+"::"+e}class Hd{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 y_ extends Error{constructor(e){super(e.message),this.originalError=e,Object.setPrototypeOf(this,y_.prototype)}}function yve(t,e){const r=new Hd(e,t);try{return{source:r,parsed:c_(t,{filename:e})}}catch(n){throw new If(n,r)}}class d1{constructor(e={http:{headers:[]}}){this.config=e,this.cache=new Map}getFiles(){return new Set(Array.from(this.cache.keys()))}resolveExternalRef(e,r){return on(r)?r:e&&on(e)?new URL(r,e).href:Mt.resolve(e?Mt.dirname(e):process.cwd(),r)}async loadExternalRef(e){try{if(on(e)){const{body:r,mimeType:n}=await m7(e,this.config.http);return new Hd(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 Hd(e,r.replace(/\r\n/g,`
|
|
175
175
|
`))}}catch(r){throw r.message=r.message.replace(", lstat",""),new y_(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:c_(e.body,{filename:e.absoluteRef})}}catch(i){throw new If(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 N5(t,e){return{prev:t,node:e}}function Ove(t,e){for(;t;){if(t.node===e)return!0;t=t.prev}return!1}const mp={name:"unknown",properties:{}},vve={name:"scalar",properties:{}};async function Xh(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,f){const h=u.source.absoluteRef,y=new Map;m(c,f,h+d);function m(v,O,b){if(typeof v!="object"||v===null)return;const S=`${O.name}::${b}`;if(o.has(S))return;o.add(S);const[x,w]=Object.entries(v).find(([C])=>C==="$anchor")||[];if(w&&y.set(`#${w}`,v),Array.isArray(v)){const C=O.items;if(C===void 0&&O!==mp&&O!==Xc)return;const k=typeof C=="function";for(let R=0;R<v.length;R++){let N=k?C(v[R],ld(b,R)):C;if(N===void 0&&O!==mp&&O!==Xc)continue;const D=N?.directResolveAs?{$ref:v[R]}:v[R];N=N?.directResolveAs||N,m(D,Uc(N)?N:mp,ld(b,R))}return}for(const C of Object.keys(v)){let k=v[C],R=Ll(O.properties,C);R===void 0&&(R=O.additionalProperties),typeof R=="function"&&(R=R(k,C)),R===void 0&&(R=mp),O.extensionsPrefix&&C.startsWith(O.extensionsPrefix)&&R===mp&&(R=Xc),!Uc(R)&&R?.directResolveAs&&(R=R.directResolveAs,k={$ref:k}),R&&R.name===void 0&&R.resolvable!==!1&&(R=vve),!(!Uc(R)||typeof k!="object")&&m(k,R,ld(b,sh(C)))}if(Xr(v)){const C=g(u,v,{prev:null,node:v}).then(k=>{k.resolved&&l(k.node,k.document,k.nodePointer,O)});s.push(C)}if(g7(v)){const C=g(u,{$ref:v.externalValue},{prev:null,node:v}).then(k=>{k.resolved&&l(k.node,k.document,k.nodePointer,O)});s.push(C)}}async function g(v,O,b){if(Ove(b.prev,O))throw new Error("Self-referencing circular pointer");if(Soe(O.$ref)){await gve();const U={resolved:!0,isRemote:!1,node:y.get(O.$ref),document:v,nodePointer:O.$ref},F=lh(v.source.absoluteRef,O.$ref);return i.set(F,U),U}const{uri:S,pointer:x}=boe(O.$ref),w=S!==null&&r.resolveExternalRef(v.source.absoluteRef,S)!==v.source.absoluteRef;let C;try{C=w?await r.resolveDocument(v.source.absoluteRef,S):v}catch(U){const F={resolved:!1,isRemote:w,document:void 0,error:U},G=lh(v.source.absoluteRef,O.$ref);return i.set(G,F),F}let k={resolved:!0,document:C,isRemote:w,node:v.parsed,nodePointer:"#/"},R=C.parsed;const N=x;for(const U of N)if(typeof R!="object"){R=void 0;break}else if(R[U]!==void 0)R=R[U],k.nodePointer=ld(k.nodePointer,sh(U));else if(Xr(R)){if(k=await g(C,R,N5(b,R)),C=k.document||C,typeof k.node!="object"){R=void 0;break}R=k.node[U],k.nodePointer=ld(k.nodePointer,sh(U))}else{R=void 0;break}k.node=R,k.document=C;const D=lh(v.source.absoluteRef,O.$ref);return k.document&&Xr(R)&&(k=await g(k.document,R,N5(b,R))),i.set(D,k),{...k}}}}const Ht=(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 dr(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 bve(t){if(t.indexOf("/")>-1){const[e,r]=t.split("/");return{pluginId:e,configName:r}}else return{pluginId:"",configName:t}}function Mr(t,e){if(!e)return t;const r={};for(const n of Object.keys(t))r[`${e}/${n}`]=t[n];return r}function s6(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:
|
|
176
176
|
${JSON.stringify(r,null,2)}`);Ht(e.rules,r.rules),Ht(e.oas2Rules,r.oas2Rules),dr(e.oas2Rules,r.rules),Ht(e.oas3_0Rules,r.oas3_0Rules),dr(e.oas3_0Rules,r.rules),Ht(e.oas3_1Rules,r.oas3_1Rules),dr(e.oas3_1Rules,r.rules),Ht(e.oas3_2Rules,r.oas3_2Rules),dr(e.oas3_2Rules,r.rules),Ht(e.async2Rules,r.async2Rules),dr(e.async2Rules,r.rules),Ht(e.async3Rules,r.async3Rules),dr(e.async3Rules,r.rules),Ht(e.arazzo1Rules,r.arazzo1Rules),dr(e.arazzo1Rules,r.rules),Ht(e.overlay1Rules,r.overlay1Rules),dr(e.overlay1Rules,r.rules),Ht(e.openrpc1Rules,r.openrpc1Rules),dr(e.openrpc1Rules,r.rules),Ht(e.preprocessors,r.preprocessors),Ht(e.oas2Preprocessors,r.oas2Preprocessors),dr(e.oas2Preprocessors,r.preprocessors),Ht(e.oas3_0Preprocessors,r.oas3_0Preprocessors),dr(e.oas3_0Preprocessors,r.preprocessors),Ht(e.oas3_1Preprocessors,r.oas3_1Preprocessors),dr(e.oas3_1Preprocessors,r.preprocessors),Ht(e.oas3_2Preprocessors,r.oas3_2Preprocessors),dr(e.oas3_2Preprocessors,r.preprocessors),Ht(e.async2Preprocessors,r.async2Preprocessors),dr(e.async2Preprocessors,r.preprocessors),Ht(e.async3Preprocessors,r.async3Preprocessors),dr(e.async3Preprocessors,r.preprocessors),Ht(e.arazzo1Preprocessors,r.arazzo1Preprocessors),dr(e.arazzo1Preprocessors,r.preprocessors),Ht(e.overlay1Preprocessors,r.overlay1Preprocessors),dr(e.overlay1Preprocessors,r.preprocessors),Ht(e.openrpc1Preprocessors,r.openrpc1Preprocessors),dr(e.openrpc1Preprocessors,r.preprocessors),Ht(e.decorators,r.decorators),Ht(e.oas2Decorators,r.oas2Decorators),dr(e.oas2Decorators,r.decorators),Ht(e.oas3_0Decorators,r.oas3_0Decorators),dr(e.oas3_0Decorators,r.decorators),Ht(e.oas3_1Decorators,r.oas3_1Decorators),dr(e.oas3_1Decorators,r.decorators),Ht(e.oas3_2Decorators,r.oas3_2Decorators),dr(e.oas3_2Decorators,r.decorators),Ht(e.async2Decorators,r.async2Decorators),dr(e.async2Decorators,r.decorators),Ht(e.async3Decorators,r.async3Decorators),dr(e.async3Decorators,r.decorators),Ht(e.arazzo1Decorators,r.arazzo1Decorators),dr(e.arazzo1Decorators,r.decorators),Ht(e.overlay1Decorators,r.overlay1Decorators),dr(e.overlay1Decorators,r.decorators),Ht(e.openrpc1Decorators,r.openrpc1Decorators),dr(e.openrpc1Decorators,r.decorators)}return e}function xve(t){return new Map(JSON.parse(JSON.stringify([...t])))}function M5(t){return t!==void 0&&typeof t=="object"&&"id"in t}function Sve(t){return typeof t=="function"}function q5(t,e){return{prev:t,value:e}}function z5(t){return t?.prev??null}function wve(t){const e={};for(;t.parent;)e[t.parent.type.name]=t.parent.activatedOn?.value.node,t=t.parent;return e}function Pve(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 Jd(t){const{document:e,rootType:r,normalizedVisitors:n,resolvedRefMap:i,ctx:o}=t,s={},a=new Set;l(e.parsed,r,new Cv(e.source,"#/"),void 0,"");function l(c,u,d,f,h){const y=(k,R=g.source.absoluteRef)=>{if(!Xr(k))return{location:d,node:k};const N=lh(R,k.$ref),D=i.get(N);if(!D)return{location:void 0,node:void 0};const{resolved:U,node:F,document:G,nodePointer:H,error:ne}=D;return{location:U?new Cv(G.source,H):ne instanceof If?new Cv(ne.source,""):void 0,node:F,error:ne}},m=d;let g=d;const{node:v,location:O,error:b}=y(c),S=new Set;if(Xr(c)){const k=n.ref.enter;for(const{visit:R,ruleId:N,severity:D,message:U,context:F}of k){S.add(F);const G=w.bind(void 0,N,D,U);R(c,{report:G,resolve:y,rawNode:c,rawLocation:m,location:d,type:u,parent:f,key:h,parentLocations:{},specVersion:o.specVersion,config:o.config,getVisitorData:C.bind(void 0,N)},{node:v,location:O,error:b}),O?.source.absoluteRef&&o.refTypes&&o.refTypes.set(O?.source.absoluteRef,u)}}if(v!==void 0&&O&&u.name!=="scalar"){g=O;const k=s[u.name]?.has?.(v);let R=!1;const D=n.any.enter.concat(n[u.name]?.enter||[]),U=[];for(const{context:H,visit:ne,skip:ce,ruleId:Z,severity:oe,message:M}of D){if(a.has(`${g.absolutePointer}${g.pointer}`))break;if(H.isSkippedLevel)H.parent.activatedOn&&!H.parent.activatedOn.value.nextLevelTypeActivated&&!H.seen.has(c)&&(H.seen.add(c),R=!0,U.push(H));else if(H.parent&&H.parent.activatedOn&&H.activatedOn?.value.withParentNode!==H.parent.activatedOn.value.node&&H.parent.activatedOn.value.nextLevelTypeActivated?.value!==u||!H.parent&&!k){U.push(H);const j={node:v,location:O,nextLevelTypeActivated:null,withParentNode:H.parent?.activatedOn?.value.node,skipped:(H.parent?.activatedOn?.value.skipped||ce?.(v,h,{location:d,rawLocation:m,resolve:y,rawNode:c}))??!1};H.activatedOn=q5(H.activatedOn,j);let V=H.parent;for(;V;)V.activatedOn.value.nextLevelTypeActivated=q5(V.activatedOn.value.nextLevelTypeActivated,u),V=V.parent;j.skipped||(R=!0,S.add(H),x(ne,v,c,H,Z,oe,M))}}if(R||!k){if(s[u.name]=s[u.name]||new Set,s[u.name].add(v),Array.isArray(v)){const H=u.items;if(H!==void 0){const ne=typeof H=="function";for(let ce=0;ce<v.length;ce++){let Z=ne?H(v[ce],O.child([ce]).absolutePointer):H,oe=v[ce];Z?.directResolveAs&&(Z=Z.directResolveAs,oe={$ref:oe}),Uc(Z)&&l(oe,Z,O.child([ce]),v,ce)}}}else if(typeof v=="object"&&v!==null){const H=Object.keys(u.properties);u.additionalProperties?H.push(...Object.keys(v).filter(ne=>!H.includes(ne))):u.extensionsPrefix&&H.push(...Object.keys(v).filter(ne=>ne.startsWith(u.extensionsPrefix))),Xr(c)&&H.push(...Object.keys(c).filter(ne=>ne!=="$ref"&&!H.includes(ne)));for(const ne of H){let ce=v[ne],Z=O;ce===void 0&&(ce=c[ne],Z=d);let oe=Ll(u.properties,ne);if(oe===void 0&&(oe=u.additionalProperties),typeof oe=="function"&&(oe=oe(ce,ne)),oe===void 0&&u.extensionsPrefix&&ne.startsWith(u.extensionsPrefix)&&(oe=Xc),!Uc(oe)&&oe?.directResolveAs&&(oe=oe.directResolveAs,ce={$ref:ce}),oe&&oe.name===void 0&&oe.resolvable!==!1&&(oe={name:"scalar",properties:{}}),Xr(c[ne])&&oe?.name==="scalar"){l(c[ne],oe,d.child([ne]),c,ne);continue}!Uc(oe)||oe.name==="scalar"&&!Xr(ce)||l(ce,oe,Z.child([ne]),v,ne)}}}const F=n.any.leave,G=(n[u.name]?.leave||[]).concat(F);for(const H of U.reverse())if(H.isSkippedLevel)H.seen.delete(v);else if(H.activatedOn=z5(H.activatedOn),H.parent){let ne=H.parent;for(;ne;)ne.activatedOn.value.nextLevelTypeActivated=z5(ne.activatedOn.value.nextLevelTypeActivated),ne=ne.parent}for(const{context:H,visit:ne,ruleId:ce,severity:Z,message:oe}of G)!H.isSkippedLevel&&S.has(H)&&x(ne,v,c,H,ce,Z,oe)}if(g=d,Xr(c)){const k=n.ref.leave;for(const{visit:R,ruleId:N,severity:D,context:U,message:F}of k)if(S.has(U)){const G=w.bind(void 0,N,D,F);R(c,{report:G,resolve:y,rawNode:c,rawLocation:m,location:d,type:u,parent:f,key:h,parentLocations:{},specVersion:o.specVersion,config:o.config,getVisitorData:C.bind(void 0,N)},{node:v,location:O,error:b})}}function x(k,R,N,D,U,F,G){const H=w.bind(void 0,U,F,G);k(R,{report:H,resolve:y,rawNode:N,location:g,rawLocation:m,type:u,parent:f,key:h,parentLocations:Pve(D),specVersion:o.specVersion,config:o.config,ignoreNextVisitorsOnNode:()=>{a.add(`${g.absolutePointer}${g.pointer}`)},getVisitorData:C.bind(void 0,U)},wve(D),D)}function w(k,R,N,D){const F=(D.location?Array.isArray(D.location)?D.location:[D.location]:[{...g,reportOnKey:!1}]).map(H=>({...g,reportOnKey:!1,...H})),G=D.forceSeverity||R;G!=="off"&&o.problems.push({ruleId:D.ruleId||k,severity:G,...D,message:N?N.replace("{{message}}",D.message):D.message,suggest:D.suggest||[],location:F})}function C(k){return o.visitorsData[k]=o.visitorsData[k]||{},o.visitorsData[k]}}}const Cve={Root:"DefinitionRoot",ServerVariablesMap:"ServerVariableMap",Paths:["PathMap","PathsMap"],CallbacksMap:"CallbackMap",MediaTypesMap:"MediaTypeMap",ExamplesMap:"ExampleMap",EncodingMap:"EncodingsMap",HeadersMap:"HeaderMap",LinksMap:"LinkMap",OAuth2Flows:"SecuritySchemeFlows",Responses:"ResponsesMap"};function Kd(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){f(s,u);continue}typeof h=="object"&&h!==null&&h.name&&d.add(h)}a.additionalProperties&&typeof a.additionalProperties!="function"&&(a.additionalProperties===l?f(s,u):a.additionalProperties.name!==void 0&&d.add(a.additionalProperties)),a.items&&typeof a.items!="function"&&(a.items===l?f(s,u):a.items.name!==void 0&&d.add(a.items)),a.extensionsPrefix&&d.add(Xc);for(const h of Array.from(d.values()))n(s,h,l,c,u);function f(h,y){for(const m of y.slice(1))r[m.name]=r[m.name]||{enter:[],leave:[]},r[m.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 f=a[d]||i(a,Cve[d]),h=r[d];if(!f)continue;let y,m,g;const v=xt(f);if(d==="ref"&&v&&f.skip)throw new Error("ref() visitor does not support skip");typeof f=="function"?y=f:v&&(y=f.enter,m=f.leave,g=f.skip);const O=(y?1:0)+(m?1:0)+(g?1:0),b=v&&Object.keys(f).length>O,S={activatedOn:null,type:e[d],parent:l,isSkippedLevel:!1};if(b&&o(s,f,S,c+1),l&&n(s,l.type,e[d],l),y||v){if(y&&typeof y!="function")throw new Error("DEV: should be function");h.enter.push({...s,visit:y||(()=>{}),skip:g,depth:c,context:S})}if(m){if(typeof m!="function")throw new Error("DEV: should be function");h.leave.push({...s,visit:m,depth:c,context:S})}}}}function a6({node:t,ctx:e,plugins:r}){if(!t.extends)return t;const n=(t.extends||[]).map(i=>{if(!on(i)&&!Hc.extname(i))return Qve(i,r);const o=e.resolve({$ref:i});return o.location&&o.node!==void 0?o.node:null}).filter(io);return s6([...n.map(i=>a6({node:i,ctx:e,plugins:r})),{...t,extends:void 0}])}function dO(t,e){if(xt(t)&&Array.isArray(t.plugins)){const{plugins:r,rootConfigDir:n}=e.getVisitorData();r.push(...t.plugins.map(i=>c6(i,e.location.source.absoluteRef.replace(/^file:\/\//,""),n)))}}const $ve=Kd([{severity:"error",ruleId:sW,visitor:{ref:{},ConfigGovernance:{leave(t,e){dO(t,e)}},ConfigApisProperties:{leave(t,e){dO(t,e)}},"rootRedoclyConfigSchema.scorecard.levels_items":{leave(t,e){dO(t,e)}},ConfigRoot:{leave(t,e){dO(t,e)}}}}],qm);function fO(t,e){if(xt(t)&&t.extends){const{plugins:r}=e.getVisitorData(),n=a6({node:t,ctx:e,plugins:r});Object.assign(t,n),delete t.extends}}const kve=Kd([{severity:"error",ruleId:oW,visitor:{ref:{leave(t,e,r){b$(t,r,e)}},ConfigGovernance:{leave(t,e){fO(t,e)}},ConfigApisProperties:{leave(t,e){fO(t,e)}},"rootRedoclyConfigSchema.scorecard.levels_items":{leave(t,e){fO(t,e)}},ConfigRoot:{leave(t,e){fO(t,e)}}}}],qm);function L5(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 Eve(t,e,r,n,i){let o,s;const a={ref:{leave(f,h,y){if(!y.location||y.node===void 0){ah(y,h.report,h.location);return}if(y.location.source===r.source&&y.location.source===h.location.source&&h.type.name!=="scalar"&&!e){f.$ref!==y.location.pointer&&(f.$ref=y.location.pointer);return}if(i&&on(f.$ref))return;const m=L5(h.type.name,t);m?e?(c(m,y,h),b$(f,y,h)):(f.$ref=c(m,y,h),l(f,y,h)):b$(f,y,h)}},Example:{leave(f,h){if(g7(f)&&f.value===void 0){const y=h.resolve({$ref:f.externalValue});if(!y.location||y.node===void 0){ah(y,h.report,h.location);return}if(i&&on(f.externalValue))return;f.value=h.resolve({$ref:f.externalValue}).node,delete f.externalValue}}},Root:{enter(f,h){s=h.location,t==="oas3"?o=f.components=f.components||{}:t==="oas2"?o=f:t==="async2"?o=f.components=f.components||{}:t==="async3"?o=f.components=f.components||{}:t==="arazzo1"?o=f.components=f.components||{}:t==="openrpc1"&&(o=f.components=f.components||{})}}};t==="oas3"&&(a.DiscriminatorMapping={leave(f,h){for(const y of Object.keys(f)){const m=f[y],g=h.resolve({$ref:m});if(!g.location||g.node===void 0){ah(g,h.report,h.location.child(y));return}const v=L5("Schema",t);f[y]=c(v,g,h)}}});function l(f,h,y){const m=lh(y.location.source.absoluteRef,f.$ref);n.set(m,{document:r,isRemote:!1,node:h.node,nodePointer:f.$ref,resolved:!0})}function c(f,h,y){o[f]=o[f]||{};const m=d(h,f,y);return o[f][m]=h.node,t==="oas3"||t==="async2"||t==="async3"||t==="openrpc1"?`#/components/${f}/${m}`:`#/${f}/${m}`}function u(f,h,y){return Xr(f)&&y.resolve(f,s.absolutePointer).location?.absolutePointer===h.location.absolutePointer?!0:v$(f,h.node)}function d(f,h,y){const[m,g]=[f.location.source.absoluteRef,f.location.pointer],v=o[h];let O="";const b=g.slice(2).split("/").filter(io);for(;b.length>0;)if(O=b.pop()+(O?`-${O}`:""),!v||!v[O]||u(v[O],f,y))return O;if(O=xoe(m)+(O?`_${O}`:""),!v[O]||u(v[O],f,y))return O;const S=O;let x=2;for(;v[O]&&!u(v[O],f,y);)O=`${S}-${x}`,x++;return v[O]||y.report({message:`Two schemas are referenced with the same name but different content. Renamed ${S} to ${O}.`,location:y.location,forceSeverity:"warn"}),O}return a}async function Tve(t){const{document:e,config:r,types:n,externalRefResolver:i,dereference:o=!1,removeUnusedComponents:s=!1,keepUrlRefs:a=!1}=t,l=t1(e.parsed),c=nW(l),u=r.getRulesForSpecVersion(c),d=zT(r.extendTypes(n,l),r),f=Yb(u,r,"preprocessors",l),h=Yb(u,r,"decorators",l),y={problems:[],specVersion:l,config:r,refTypes:new Map,visitorsData:{}};s&&!h.some(v=>v.ruleId==="remove-unused-components")&&h.push({severity:"error",ruleId:"remove-unused-components",visitor:c==="oas2"?o6():i6()});let m=await Xh({rootDocument:e,rootType:d.Root,externalRefResolver:i});f.length>0&&(Jd({document:e,rootType:d.Root,normalizedVisitors:Kd(f,d),resolvedRefMap:m,ctx:y}),m=await Xh({rootDocument:e,rootType:d.Root,externalRefResolver:i}));const g=Kd([{severity:"error",ruleId:"bundler",visitor:Eve(c,o,e,m,a)},...h],d);return Jd({document:e,rootType:d.Root,normalizedVisitors:g,resolvedRefMap:m,ctx:y}),{bundle:e,problems:y.problems.map(v=>r.addProblemToIgnore(v)),fileDependencies:i.getFiles(),rootType:d.Root,refTypes:y.refTypes,visitorsData:y.visitorsData}}function _ve(t,e,r){const n={plugins:[],rootConfigDir:r},i={problems:[],specVersion:"oas3_0",refTypes:new Map,visitorsData:{[sW]:n}};return Jd({document:t,rootType:qm.ConfigRoot,normalizedVisitors:$ve,resolvedRefMap:e,ctx:i}),n.plugins}function Ave(t,e,r){const n={plugins:r},i={problems:[],specVersion:"oas3_0",refTypes:new Map,visitorsData:{[oW]:n}};return Jd({document:t,rootType:qm.ConfigRoot,normalizedVisitors:kve,resolvedRefMap:e,ctx:i}),t.parsed??{}}async function l6(t){const{ref:e,doc:r,externalRefResolver:n=new d1(t.config.resolve),base:i=null}=t;if(!(e||r))throw new Error(`Document or reference is required.
|
|
177
|
-
`);const o=r===void 0?await n.resolveDocument(i,e,!0):r;if(o instanceof Error)throw o;return t.collectSpecData?.(o.parsed),Tve({document:o,...t,externalRefResolver:n,types:HT(t1(o.parsed))})}const $w=new Map;async function Ive({rawConfigDocument:t,configPath:e,externalRefResolver:r,customExtends:n}){const i=t===void 0?Bme:t.parsed;if(n!==void 0&&xt(i)&&(i.extends=n),xt(i)&&i?.extends?.some(mve))throw new Error("Configuration format not detected in extends: values must be strings.");const o=t??{source:new Hd(e??"",JSON.stringify(i)),parsed:i},s=await Xh({rootDocument:o,rootType:qm.ConfigRoot,externalRefResolver:r??new d1(iW(i?.resolve))});let a=[],l,c="";pi?l=[...(i?.plugins||[]).filter(h=>!Li(h)),D5]:(c=Mt.dirname(e??""),a=_ve(o,s,c),l=[...await jve(a.map(h=>V5(h)?h.absolutePath:h),c),D5]);const u=Ave(o,xve(s),l);u.apis&&(u.apis=Object.fromEntries(Object.entries(u.apis).map(([f,h])=>{const y=s6([u,h]);return[f,{...h,...y}]})));const d=a.length?a.map(f=>V5(f)&&f.isModule?f.rawPath:f.absolutePath&&Mt.relative(c,f.absolutePath)).filter(Zb):void 0;return{resolvedConfig:{...u,plugins:d},resolvedRefMap:s,plugins:l}}function Rve(t){for(const e of Yme)(void 0)(Mt.resolve(t,e))}function V5(t){return"isModule"in t}const c6=(t,e,r)=>{if(!Li(t))return t;const n=Mt.resolve(Mt.dirname(e),t);return(void 0)(n)?{absolutePath:n,rawPath:t,isModule:!1}:{absolutePath:u7.createRequire((typeof document>"u"?require("url").pathToFileURL(__filename).href:ta&&ta.tagName.toUpperCase()==="SCRIPT"&&ta.src||new URL("replay-index-
|
|
177
|
+
`);const o=r===void 0?await n.resolveDocument(i,e,!0):r;if(o instanceof Error)throw o;return t.collectSpecData?.(o.parsed),Tve({document:o,...t,externalRefResolver:n,types:HT(t1(o.parsed))})}const $w=new Map;async function Ive({rawConfigDocument:t,configPath:e,externalRefResolver:r,customExtends:n}){const i=t===void 0?Bme:t.parsed;if(n!==void 0&&xt(i)&&(i.extends=n),xt(i)&&i?.extends?.some(mve))throw new Error("Configuration format not detected in extends: values must be strings.");const o=t??{source:new Hd(e??"",JSON.stringify(i)),parsed:i},s=await Xh({rootDocument:o,rootType:qm.ConfigRoot,externalRefResolver:r??new d1(iW(i?.resolve))});let a=[],l,c="";pi?l=[...(i?.plugins||[]).filter(h=>!Li(h)),D5]:(c=Mt.dirname(e??""),a=_ve(o,s,c),l=[...await jve(a.map(h=>V5(h)?h.absolutePath:h),c),D5]);const u=Ave(o,xve(s),l);u.apis&&(u.apis=Object.fromEntries(Object.entries(u.apis).map(([f,h])=>{const y=s6([u,h]);return[f,{...h,...y}]})));const d=a.length?a.map(f=>V5(f)&&f.isModule?f.rawPath:f.absolutePath&&Mt.relative(c,f.absolutePath)).filter(Zb):void 0;return{resolvedConfig:{...u,plugins:d},resolvedRefMap:s,plugins:l}}function Rve(t){for(const e of Yme)(void 0)(Mt.resolve(t,e))}function V5(t){return"isModule"in t}const c6=(t,e,r)=>{if(!Li(t))return t;const n=Mt.resolve(Mt.dirname(e),t);return(void 0)(n)?{absolutePath:n,rawPath:t,isModule:!1}:{absolutePath:u7.createRequire((typeof document>"u"?require("url").pathToFileURL(__filename).href:ta&&ta.tagName.toUpperCase()==="SCRIPT"&&ta.src||new URL("replay-index-UU9ttWIq.js",document.baseURI).href)??__dirname).resolve(t,{paths:[r,(typeof document>"u"?require("url").pathToFileURL(__filename).href:ta&&ta.tagName.toUpperCase()==="SCRIPT"&&ta.src||new URL("replay-index-UU9ttWIq.js",document.baseURI).href)?Mt.dirname((void 0)(typeof document>"u"?require("url").pathToFileURL(__filename).href:ta&&ta.tagName.toUpperCase()==="SCRIPT"&&ta.src||new URL("replay-index-UU9ttWIq.js",document.baseURI).href)):__dirname]}),isModule:!0,rawPath:t}};async function jve(t,e){if(!t)return[];const r=async a=>{if(!Li(a))return a;try{const l=Mt.isAbsolute(a)?a:c6(a,Mt.join(e,Fme),e).absolutePath;if(!$w.has(l)){let c;if(typeof __webpack_require__=="function")c=__non_webpack_require__(l);else{const y=await import((void 0)(l).pathname);c=y.default||y}const u={contentDir:e},d=Array.isArray(c)?c:[c];for(const y of d)y?.id&&M5(y)&&pr.info(`Deprecated plugin format detected: ${y.id}
|
|
178
178
|
`);const f=M5(c)?c:Sve(c)?await c(u):await c?.default?.(u),h=Array.isArray(f)?f:[f];f&&$w.set(l,h.map(y=>({...y,path:a,absolutePath:l})))}return $w.get(l)}catch(l){throw new Error(`Failed to load plugin "${a}": ${l.message}
|
|
179
179
|
|
|
180
180
|
${l.stack}`)}},n=new Map,i=Rve(e);i&&t.push(i);const o=new Set;return(await Promise.all(t.map(async a=>{if(Li(a)){if(on(a))throw new Error(qt.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(qt.red(`Plugin must define \`id\` property in ${qt.blue(a.toString())}.`));const f=u.absolutePath??a.toString(),h=n.get(d);if(h){if(f!==h)throw new Error(qt.red(`Plugin "id" must be unique. Plugin ${qt.blue(f)} uses id "${qt.blue(d)}" already seen in ${qt.blue(f)}`));return}n.set(d,f);const y={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}.`);y.rules={},u.rules.oas3&&(y.rules.oas3=Mr(u.rules.oas3,d)),u.rules.oas2&&(y.rules.oas2=Mr(u.rules.oas2,d)),u.rules.async2&&(y.rules.async2=Mr(u.rules.async2,d)),u.rules.async3&&(y.rules.async3=Mr(u.rules.async3,d)),u.rules.arazzo1&&(y.rules.arazzo1=Mr(u.rules.arazzo1,d)),u.rules.overlay1&&(y.rules.overlay1=Mr(u.rules.overlay1,d)),u.rules.openrpc1&&(y.rules.openrpc1=Mr(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}.`);y.preprocessors={},u.preprocessors.oas3&&(y.preprocessors.oas3=Mr(u.preprocessors.oas3,d)),u.preprocessors.oas2&&(y.preprocessors.oas2=Mr(u.preprocessors.oas2,d)),u.preprocessors.async2&&(y.preprocessors.async2=Mr(u.preprocessors.async2,d)),u.preprocessors.async3&&(y.preprocessors.async3=Mr(u.preprocessors.async3,d)),u.preprocessors.arazzo1&&(y.preprocessors.arazzo1=Mr(u.preprocessors.arazzo1,d)),u.preprocessors.overlay1&&(y.preprocessors.overlay1=Mr(u.preprocessors.overlay1,d)),u.preprocessors.openrpc1&&(y.preprocessors.openrpc1=Mr(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}.`);y.decorators={},u.decorators.oas3&&(y.decorators.oas3=Mr(u.decorators.oas3,d)),u.decorators.oas2&&(y.decorators.oas2=Mr(u.decorators.oas2,d)),u.decorators.async2&&(y.decorators.async2=Mr(u.decorators.async2,d)),u.decorators.async3&&(y.decorators.async3=Mr(u.decorators.async3,d)),u.decorators.arazzo1&&(y.decorators.arazzo1=Mr(u.decorators.arazzo1,d)),u.decorators.overlay1&&(y.decorators.overlay1=Mr(u.decorators.overlay1,d)),u.decorators.openrpc1&&(y.decorators.openrpc1=Mr(u.decorators.openrpc1,d))}return u.assertions&&(y.assertions=u.assertions),{...u,...y}}))).filter(Zb)}))).filter(Zb).flat()}function Qve(t,e){const{pluginId:r,configName:n}=bve(t),i=e.find(s=>s.id===r);if(!i)throw new Error(`Invalid config ${qt.red(t)}: plugin ${r} is not included.`);const o=i.configs?.[n];if(!o)throw new Error(r?`Invalid config ${qt.red(t)}: plugin ${r} doesn't export config with name ${n}.`:`Invalid config ${qt.red(t)}: there is no such built-in config.`);return o}async function u6(t,{configPath:e,externalRefResolver:r}={}){const i=yve(typeof t=="string"?t:"",e??"");typeof t!="string"&&t&&(i.parsed=t);const{resolvedConfig:o,resolvedRefMap:s,plugins:a}=await Ive({rawConfigDocument:Dve(i),configPath:e,externalRefResolver:r});return new r1(o,{configPath:e,document:i,resolvedRefMap:s,plugins:a})}function Dve(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 kw={},To={},Ew={},X5;function f1(){return X5||(X5=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})(Ew)),Ew}var ca={},U5;function Rf(){if(U5)return ca;U5=1,Object.defineProperty(ca,"__esModule",{value:!0});function t(s){return typeof s>"u"||s===null}ca.isNothing=t;function e(s){return typeof s=="object"&&s!==null}ca.isObject=e;function r(s){return Array.isArray(s)?s:t(s)?[]:[s]}ca.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}ca.extend=n;function i(s,a){var l="",c;for(c=0;c<a;c+=1)l+=s;return l}ca.repeat=i;function o(s){return s===0&&Number.NEGATIVE_INFINITY===1/s}return ca.isNegativeZero=o,ca}var Tw,W5;function Xm(){if(W5)return Tw;W5=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 Tw=t,Tw}var _w,F5;function Nve(){if(F5)return _w;F5=1;var t=Rf(),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
|
|
@@ -356,7 +356,7 @@ You should wrap it with \`css\` like this:
|
|
|
356
356
|
gap: var(--spacing-xs);
|
|
357
357
|
`,xPe=I(ec)`
|
|
358
358
|
width: 100%;
|
|
359
|
-
`;function U_({input:t,onSave:e,onCancel:r,...n}){const[i,o]=E.useState(!!t.isSecret),s=({name:a,value:l})=>{e({...t,name:a,value:l,isSecret:i})};return p.jsx(VF,{variable:t,onSave:s,onCancel:r,maskValue:i,...n,children:p.jsx(Zh,{children:p.jsx(eF,{value:i,onChange:a=>o(a),title:"Make it secret"})})})}const ak=()=>({name:"",value:"",isSecret:!1}),Er=t=>c7+"$inputs."+t+MT,XF=(t,e)=>e.inputs.find(r=>r.get().name===t.match(`^${Ux}$`)?.[1]);function SPe({environments:t,activeEnvironmentId:e}){return t.get().find(n=>n.name===e.get())?.inputs||[]}function ul(t){const e=new RegExp(Ux,"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 T1(t){const e=/^\{?\$inputs\.([^\}\s]+)\}?$/,r=t.match(e);return r?r[1]:null}function Qv(t){const e=new Error(t);return e.source="ulid",e}const W_="0123456789ABCDEFGHJKMNPQRSTVWXYZ",ch=W_.length,DN=Math.pow(2,48)-1,wPe=10,PPe=16;function CPe(t){let e=Math.floor(t()*ch);return e===ch&&(e=ch-1),W_.charAt(e)}function $Pe(t,e){if(isNaN(t))throw new Error(t+" must be a number");if(t>DN)throw Qv("cannot encode time greater than "+DN);if(t<0)throw Qv("time must be positive");if(Number.isInteger(Number(t))===!1)throw Qv("time must be an integer");let r,n="";for(;e>0;e--)r=t%ch,n=W_.charAt(r)+n,t=(t-r)/ch;return n}function kPe(t,e){let r="";for(;t>0;t--)r=CPe(e)+r;return r}function EPe(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 Qv("secure crypto unusable, insecure Math.random not allowed")}function TPe(t){return t||(t=EPe()),function(r){return isNaN(r)&&(r=Date.now()),$Pe(r,wPe)+kPe(PPe,t)}}const v0=TPe();var _Pe=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{},Mc="1.9.0",NN=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function APe(t){var e=new Set([t]),r=new Set,n=t.match(NN);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(NN);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 IPe=APe(Mc),RPe=Mc.split(".")[0],em=Symbol.for("opentelemetry.js.api."+RPe),tm=_Pe;function Bm(t,e,r,n){var i;n===void 0&&(n=!1);var o=tm[em]=(i=tm[em])!==null&&i!==void 0?i:{version:Mc};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!==Mc){var s=new Error("@opentelemetry/api: Registration of version v"+o.version+" for "+t+" does not match previously registered API v"+Mc);return r.error(s.stack||s.message),!1}return o[t]=e,r.debug("@opentelemetry/api: Registered a global for "+t+" v"+Mc+"."),!0}function Jc(t){var e,r,n=(e=tm[em])===null||e===void 0?void 0:e.version;if(!(!n||!IPe(n)))return(r=tm[em])===null||r===void 0?void 0:r[t]}function Zm(t,e){e.debug("@opentelemetry/api: Unregistering a global for "+t+" v"+Mc+".");var r=tm[em];r&&delete r[t]}var jPe=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},QPe=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))},DPe=(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 xp("debug",this._namespace,e)},t.prototype.error=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return xp("error",this._namespace,e)},t.prototype.info=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return xp("info",this._namespace,e)},t.prototype.warn=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return xp("warn",this._namespace,e)},t.prototype.verbose=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return xp("verbose",this._namespace,e)},t})();function xp(t,e,r){var n=Jc("diag");if(n)return r.unshift(e),n[t].apply(n,QPe([],jPe(r),!1))}var Ni;(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"})(Ni||(Ni={}));function NPe(t,e){t<Ni.NONE?t=Ni.NONE:t>Ni.ALL&&(t=Ni.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",Ni.ERROR),warn:r("warn",Ni.WARN),info:r("info",Ni.INFO),debug:r("debug",Ni.DEBUG),verbose:r("verbose",Ni.VERBOSE)}}var MPe=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},qPe=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))},zPe="diag",Ds=(function(){function t(){function e(i){return function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];var a=Jc("diag");if(a)return a[i].apply(a,qPe([],MPe(o),!1))}}var r=this,n=function(i,o){var s,a,l;if(o===void 0&&(o={logLevel:Ni.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=Jc("diag"),d=NPe((a=o.logLevel)!==null&&a!==void 0?a:Ni.INFO,i);if(u&&!o.suppressOverrideMessage){var f=(l=new Error().stack)!==null&&l!==void 0?l:"<failed to generate stacktrace>";u.warn("Current logger will be overwritten from "+f),d.warn("Current logger will overwrite one already registered from "+f)}return Bm("diag",d,r,!0)};r.setLogger=n,r.disable=function(){Zm(zPe,r)},r.createComponentLogger=function(i){return new DPe(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})(),LPe=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},VPe=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.")},XPe=(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=LPe(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=VPe(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})(),UPe=Symbol("BaggageEntryMetadata"),WPe=Ds.instance();function FPe(t){return t===void 0&&(t={}),new XPe(new Map(Object.entries(t)))}function BPe(t){return typeof t!="string"&&(WPe.error("Cannot create baggage metadata from unknown type: "+typeof t),t=""),{__TYPE__:UPe,toString:function(){return t}}}function F_(t){return Symbol.for(t)}var ZPe=(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})(),fd=new ZPe,mu=(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)}})(),YPe=(function(){function t(){}return t.prototype.createGauge=function(e,r){return oCe},t.prototype.createHistogram=function(e,r){return sCe},t.prototype.createCounter=function(e,r){return iCe},t.prototype.createUpDownCounter=function(e,r){return aCe},t.prototype.createObservableGauge=function(e,r){return cCe},t.prototype.createObservableCounter=function(e,r){return lCe},t.prototype.createObservableUpDownCounter=function(e,r){return uCe},t.prototype.addBatchObservableCallback=function(e,r){},t.prototype.removeBatchObservableCallback=function(e){},t})(),_1=(function(){function t(){}return t})(),GPe=(function(t){mu(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.add=function(r,n){},e})(_1),HPe=(function(t){mu(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.add=function(r,n){},e})(_1),JPe=(function(t){mu(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.record=function(r,n){},e})(_1),KPe=(function(t){mu(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.record=function(r,n){},e})(_1),B_=(function(){function t(){}return t.prototype.addCallback=function(e){},t.prototype.removeCallback=function(e){},t})(),eCe=(function(t){mu(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(B_),tCe=(function(t){mu(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(B_),rCe=(function(t){mu(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(B_),nCe=new YPe,iCe=new GPe,oCe=new JPe,sCe=new KPe,aCe=new HPe,lCe=new eCe,cCe=new tCe,uCe=new rCe,dCe={get:function(t,e){if(t!=null)return t[e]},keys:function(t){return t==null?[]:Object.keys(t)}},fCe={set:function(t,e,r){t!=null&&(t[e]=r)}},pCe=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},hCe=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))},mCe=(function(){function t(){}return t.prototype.active=function(){return fd},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,hCe([n],pCe(i),!1))},t.prototype.bind=function(e,r){return r},t.prototype.enable=function(){return this},t.prototype.disable=function(){return this},t})(),gCe=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},yCe=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))},pP="context",OCe=new mCe,A1=(function(){function t(){}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalContextManager=function(e){return Bm(pP,e,Ds.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,yCe([e,r,n],gCe(o),!1))},t.prototype.bind=function(e,r){return this._getContextManager().bind(e,r)},t.prototype._getContextManager=function(){return Jc(pP)||OCe},t.prototype.disable=function(){this._getContextManager().disable(),Zm(pP,Ds.instance())},t})(),Ma;(function(t){t[t.NONE=0]="NONE",t[t.SAMPLED=1]="SAMPLED"})(Ma||(Ma={}));var UF="0000000000000000",WF="00000000000000000000000000000000",FF={traceId:WF,spanId:UF,traceFlags:Ma.NONE},uh=(function(){function t(e){e===void 0&&(e=FF),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})(),Z_=F_("OpenTelemetry Context Key SPAN");function Y_(t){return t.getValue(Z_)||void 0}function vCe(){return Y_(A1.getInstance().active())}function G_(t,e){return t.setValue(Z_,e)}function bCe(t){return t.deleteValue(Z_)}function xCe(t,e){return G_(t,new uh(e))}function BF(t){var e;return(e=Y_(t))===null||e===void 0?void 0:e.spanContext()}var SCe=/^([0-9a-f]{32})$/i,wCe=/^[0-9a-f]{16}$/i;function ZF(t){return SCe.test(t)&&t!==WF}function PCe(t){return wCe.test(t)&&t!==UF}function I1(t){return ZF(t.traceId)&&PCe(t.spanId)}function CCe(t){return new uh(t)}var hP=A1.getInstance(),YF=(function(){function t(){}return t.prototype.startSpan=function(e,r,n){n===void 0&&(n=hP.active());var i=!!r?.root;if(i)return new uh;var o=n&&BF(n);return $Ce(o)&&I1(o)?new uh(o):new uh},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??hP.active(),c=this.startSpan(e,o,l),u=G_(l,c);return hP.with(u,a,void 0,c)}},t})();function $Ce(t){return typeof t=="object"&&typeof t.spanId=="string"&&typeof t.traceId=="string"&&typeof t.traceFlags=="number"}var kCe=new YF,ECe=(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):kCe},t})(),TCe=(function(){function t(){}return t.prototype.getTracer=function(e,r,n){return new YF},t})(),_Ce=new TCe,MN=(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 ECe(this,e,r,n)},t.prototype.getDelegate=function(){var e;return(e=this._delegate)!==null&&e!==void 0?e:_Ce},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})(),b0;(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(b0||(b0={}));var lk;(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"})(lk||(lk={}));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 ka=A1.getInstance(),Xt=Ds.instance(),ACe=(function(){function t(){}return t.prototype.getMeter=function(e,r,n){return nCe},t})(),ICe=new ACe,mP="metrics",RCe=(function(){function t(){}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalMeterProvider=function(e){return Bm(mP,e,Ds.instance())},t.prototype.getMeterProvider=function(){return Jc(mP)||ICe},t.prototype.getMeter=function(e,r,n){return this.getMeterProvider().getMeter(e,r,n)},t.prototype.disable=function(){Zm(mP,Ds.instance())},t})(),GF=RCe.getInstance(),jCe=(function(){function t(){}return t.prototype.inject=function(e,r){},t.prototype.extract=function(e,r){return e},t.prototype.fields=function(){return[]},t})(),H_=F_("OpenTelemetry Baggage Key");function HF(t){return t.getValue(H_)||void 0}function QCe(){return HF(A1.getInstance().active())}function DCe(t,e){return t.setValue(H_,e)}function NCe(t){return t.deleteValue(H_)}var gP="propagation",MCe=new jCe,qCe=(function(){function t(){this.createBaggage=FPe,this.getBaggage=HF,this.getActiveBaggage=QCe,this.setBaggage=DCe,this.deleteBaggage=NCe}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalPropagator=function(e){return Bm(gP,e,Ds.instance())},t.prototype.inject=function(e,r,n){return n===void 0&&(n=fCe),this._getGlobalPropagator().inject(e,r,n)},t.prototype.extract=function(e,r,n){return n===void 0&&(n=dCe),this._getGlobalPropagator().extract(e,r,n)},t.prototype.fields=function(){return this._getGlobalPropagator().fields()},t.prototype.disable=function(){Zm(gP,Ds.instance())},t.prototype._getGlobalPropagator=function(){return Jc(gP)||MCe},t})(),dh=qCe.getInstance(),yP="trace",zCe=(function(){function t(){this._proxyTracerProvider=new MN,this.wrapSpanContext=CCe,this.isSpanContextValid=I1,this.deleteSpan=bCe,this.getSpan=Y_,this.getActiveSpan=vCe,this.getSpanContext=BF,this.setSpan=G_,this.setSpanContext=xCe}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalTracerProvider=function(e){var r=Bm(yP,this._proxyTracerProvider,Ds.instance());return r&&this._proxyTracerProvider.setDelegate(e),r},t.prototype.getTracerProvider=function(){return Jc(yP)||this._proxyTracerProvider},t.prototype.getTracer=function(e,r){return this.getTracerProvider().getTracer(e,r)},t.prototype.disable=function(){Zm(yP,Ds.instance()),this._proxyTracerProvider=new MN},t})(),mi=zCe.getInstance();const JF=F_("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function LCe(t){return t.setValue(JF,!0)}function J_(t){return t.getValue(JF)===!0}const VCe="=",ck=";",uk=",",OP="baggage",XCe=180,UCe=4096,WCe=8192;function FCe(t){return t.reduce((e,r)=>{const n=`${e}${e!==""?uk:""}${r}`;return n.length>WCe?e:n},"")}function BCe(t){return t.getAllEntries().map(([e,r])=>{let n=`${encodeURIComponent(e)}=${encodeURIComponent(r.value)}`;return r.metadata!==void 0&&(n+=ck+r.metadata.toString()),n})}function ZCe(t){const e=t.split(ck);if(e.length<=0)return;const r=e.shift();if(!r)return;const n=r.indexOf(VCe);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=BPe(e.join(ck))),{key:i,value:o,metadata:s}}class YCe{inject(e,r,n){const i=dh.getBaggage(e);if(!i||J_(e))return;const o=BCe(i).filter(a=>a.length<=UCe).slice(0,XCe),s=FCe(o);s.length>0&&n.set(r,OP,s)}extract(e,r,n){const i=n.get(r,OP),o=Array.isArray(i)?i.join(uk):i;if(!o)return e;const s={};return o.length===0||(o.split(uk).forEach(l=>{const c=ZCe(l);if(c){const u={value:c.value};c.metadata&&(u.metadata=c.metadata),s[c.key]=u}}),Object.entries(s).length===0)?e:dh.setBaggage(e,dh.createBaggage(s))}fields(){return[OP]}}function Dv(t){const e={};if(typeof t!="object"||t==null)return e;for(const[r,n]of Object.entries(t)){if(!GCe(r)){Xt.warn(`Invalid attribute key: ${r}`);continue}if(!KF(n)){Xt.warn(`Invalid attribute value set for key: ${r}`);continue}Array.isArray(n)?e[r]=n.slice():e[r]=n}return e}function GCe(t){return typeof t=="string"&&t.length>0}function KF(t){return t==null?!0:Array.isArray(t)?HCe(t):e8(t)}function HCe(t){let e;for(const r of t)if(r!=null){if(!e){if(e8(r)){e=typeof r;continue}return!1}if(typeof r!==e)return!1}return!0}function e8(t){switch(typeof t){case"number":case"boolean":case"string":return!0}return!1}function JCe(){return t=>{Xt.error(KCe(t))}}function KCe(t){return typeof t=="string"?t:JSON.stringify(e$e(t))}function e$e(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 t$e=JCe();function nf(t){try{t$e(t)}catch{}}const Rd=performance,r$e="2.0.1",vP="exception.message",n$e="exception.stacktrace",bP="exception.type",i$e="service.name",dk="telemetry.sdk.language",o$e="webjs",fk="telemetry.sdk.name",pk="telemetry.sdk.version",s$e="process.runtime.name",xP={[fk]:"opentelemetry",[s$e]:"browser",[dk]:o$e,[pk]:r$e};const a$e=9,l$e=6,c$e=Math.pow(10,l$e),x0=Math.pow(10,a$e);function Sd(t){const e=t/1e3,r=Math.trunc(e),n=Math.round(t%1e3*c$e);return[r,n]}function t8(){let t=Rd.timeOrigin;if(typeof t!="number"){const e=Rd;t=e.timing&&e.timing.fetchStart}return t}function u$e(t){const e=Sd(t8()),r=Sd(typeof t=="number"?t:Rd.now());return n8(e,r)}function d$e(t,e){let r=e[0]-t[0],n=e[1]-t[1];return n<0&&(r-=1,n+=x0),[r,n]}function f$e(t){return t[0]*x0+t[1]}function r8(t){return Array.isArray(t)&&t.length===2&&typeof t[0]=="number"&&typeof t[1]=="number"}function qN(t){return r8(t)||typeof t=="number"||t instanceof Date}function n8(t,e){const r=[t[0]+e[0],t[1]+e[1]];return r[1]>=x0&&(r[1]-=x0,r[0]+=1),r}var Os;(function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"})(Os||(Os={}));class p$e{_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){Xt.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){Xt.warn(`Failed to extract with ${o.constructor.name}. Err: ${s.message}`)}return i},e)}fields(){return this._fields.slice()}}const hk="[_0-9a-z-*/]",h$e=`[a-z]${hk}{0,255}`,m$e=`[a-z0-9]${hk}{0,240}@[a-z]${hk}{0,13}`,g$e=new RegExp(`^(?:${h$e}|${m$e})$`),y$e=/^[ -~]{0,255}[!-~]$/,O$e=/,|=/;function v$e(t){return g$e.test(t)}function b$e(t){return y$e.test(t)&&!O$e.test(t)}const zN=32,x$e=512,LN=",",VN="=";class K_{_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+VN+this.get(r)),e),[]).join(LN)}_parse(e){e.length>x$e||(this._internalState=e.split(LN).reverse().reduce((r,n)=>{const i=n.trim(),o=i.indexOf(VN);if(o!==-1){const s=i.slice(0,o),a=i.slice(o+1,n.length);v$e(s)&&b$e(a)&&r.set(s,a)}return r},new Map),this._internalState.size>zN&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,zN))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){const e=new K_;return e._internalState=new Map(this._internalState),e}}const SP="traceparent",wP="tracestate",S$e="00",w$e="(?!ff)[\\da-f]{2}",P$e="(?![0]{32})[\\da-f]{32}",C$e="(?![0]{16})[\\da-f]{16}",$$e="[\\da-f]{2}",k$e=new RegExp(`^\\s?(${w$e})-(${P$e})-(${C$e})-(${$$e})(-.*)?\\s?$`);function E$e(t){const e=k$e.exec(t);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}class T$e{inject(e,r,n){const i=mi.getSpanContext(e);if(!i||J_(e)||!I1(i))return;const o=`${S$e}-${i.traceId}-${i.spanId}-0${Number(i.traceFlags||Ma.NONE).toString(16)}`;n.set(r,SP,o),i.traceState&&n.set(r,wP,i.traceState.serialize())}extract(e,r,n){const i=n.get(r,SP);if(!i)return e;const o=Array.isArray(i)?i[0]:i;if(typeof o!="string")return e;const s=E$e(o);if(!s)return e;s.isRemote=!0;const a=n.get(r,wP);if(a){const l=Array.isArray(a)?a.join(","):a;s.traceState=new K_(typeof l=="string"?l:void 0)}return mi.setSpanContext(e,s)}fields(){return[SP,wP]}}const _$e="[object Object]",A$e="[object Null]",I$e="[object Undefined]",R$e=Function.prototype,i8=R$e.toString,j$e=i8.call(Object),Q$e=Object.getPrototypeOf,o8=Object.prototype,s8=o8.hasOwnProperty,Ac=Symbol?Symbol.toStringTag:void 0,a8=o8.toString;function XN(t){if(!D$e(t)||N$e(t)!==_$e)return!1;const e=Q$e(t);if(e===null)return!0;const r=s8.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&i8.call(r)===j$e}function D$e(t){return t!=null&&typeof t=="object"}function N$e(t){return t==null?t===void 0?I$e:A$e:Ac&&Ac in Object(t)?M$e(t):q$e(t)}function M$e(t){const e=s8.call(t,Ac),r=t[Ac];let n=!1;try{t[Ac]=void 0,n=!0}catch{}const i=a8.call(t);return n&&(e?t[Ac]=r:delete t[Ac]),i}function q$e(t){return a8.call(t)}const z$e=20;function L$e(...t){let e=t.shift();const r=new WeakMap;for(;t.length>0;)e=l8(e,t.shift(),0,r);return e}function PP(t){return S0(t)?t.slice():t}function l8(t,e,r=0,n){let i;if(!(r>z$e)){if(r++,Nv(t)||Nv(e)||c8(e))i=PP(e);else if(S0(t)){if(i=t.slice(),S0(e))for(let o=0,s=e.length;o<s;o++)i.push(PP(e[o]));else if(Sp(e)){const o=Object.keys(e);for(let s=0,a=o.length;s<a;s++){const l=o[s];i[l]=PP(e[l])}}}else if(Sp(t))if(Sp(e)){if(!V$e(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(Nv(c))typeof c>"u"?delete i[l]:i[l]=c;else{const u=i[l],d=c;if(UN(t,l,n)||UN(e,l,n))delete i[l];else{if(Sp(u)&&Sp(d)){const f=n.get(u)||[],h=n.get(d)||[];f.push({obj:t,key:l}),h.push({obj:e,key:l}),n.set(u,f),n.set(d,h)}i[l]=l8(i[l],c,r,n)}}}}else i=e;return i}}function UN(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 S0(t){return Array.isArray(t)}function c8(t){return typeof t=="function"}function Sp(t){return!Nv(t)&&!S0(t)&&!c8(t)&&typeof t=="object"}function Nv(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t>"u"||t instanceof Date||t instanceof RegExp||t===null}function V$e(t,e){return!(!XN(t)||!XN(e))}class X$e{_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 U$e{_callback;_that;_isCalled=!1;_deferred=new X$e;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 W$e(){return"unknown_service"}const Wp=t=>t!==null&&typeof t=="object"&&typeof t.then=="function";class w0{_rawAttributes;_asyncAttributesPending=!1;_memoizedAttributes;static FromAttributeList(e){const r=new w0({});return r._rawAttributes=WN(e),r._asyncAttributesPending=e.filter(([n,i])=>Wp(i)).length>0,r}constructor(e){const r=e.attributes??{};this._rawAttributes=Object.entries(r).map(([n,i])=>(Wp(i)&&(this._asyncAttributesPending=!0),[n,i])),this._rawAttributes=WN(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,Wp(n)?await n:n]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&Xt.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;const e={};for(const[r,n]of this._rawAttributes){if(Wp(n)){Xt.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:w0.FromAttributeList([...e.getRawAttributes(),...this.getRawAttributes()])}}function u8(t){return w0.FromAttributeList(Object.entries(t))}function F$e(){return u8({[i$e]:W$e(),[dk]:xP[dk],[fk]:xP[fk],[pk]:xP[pk]})}function WN(t){return t.map(([e,r])=>Wp(r)?[e,r.catch(n=>{Xt.debug("promise rejection for resource attribute: %s - %s",e,n)})]:[e,r])}const B$e="exception";class Z$e{_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=Rd.now(),this._performanceOffset=r-(this._performanceStartTime+t8()),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 Xt.warn(`Invalid attribute key: ${e}`),this;if(!KF(r))return Xt.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 Xt.warn("No events allowed."),this._droppedEventsCount++,this;i!==void 0&&this.events.length>=i&&(this._droppedEventsCount===0&&Xt.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),qN(r)&&(qN(n)||(n=r),r=void 0);const o=Dv(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"&&(Xt.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()){Xt.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=d$e(this.startTime,this.endTime),this._duration[0]<0&&(Xt.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&&Xt.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._spanProcessor.onEnd(this)}_getTime(e){if(typeof e=="number"&&e<=Rd.now())return u$e(e+this._performanceOffset);if(typeof e=="number")return Sd(e);if(e instanceof Date)return Sd(e.getTime());if(r8(e))return e;if(this._startTimeProvided)return Sd(Date.now());const r=Rd.now()-this._performanceStartTime;return n8(this.startTime,Sd(r))}isRecording(){return this._ended===!1}recordException(e,r){const n={};typeof e=="string"?n[vP]=e:e&&(e.code?n[bP]=e.code.toString():e.name&&(n[bP]=e.name),e.message&&(n[vP]=e.message),e.stack&&(n[n$e]=e.stack)),n[bP]||n[vP]?this.addEvent(B$e,n,r):Xt.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}}`);Xt.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?(Xt.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 of;(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(of||(of={}));class P0{shouldSample(){return{decision:of.NOT_RECORD}}toString(){return"AlwaysOffSampler"}}class jd{shouldSample(){return{decision:of.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}}class $O{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(e){this._root=e.root,this._root||(nf(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new jd),this._remoteParentSampled=e.remoteParentSampled??new jd,this._remoteParentNotSampled=e.remoteParentNotSampled??new P0,this._localParentSampled=e.localParentSampled??new jd,this._localParentNotSampled=e.localParentNotSampled??new P0}shouldSample(e,r,n,i,o,s){const a=mi.getSpanContext(e);return!a||!I1(a)?this._root.shouldSample(e,r,n,i,o,s):a.isRemote?a.traceFlags&Ma.SAMPLED?this._remoteParentSampled.shouldSample(e,r,n,i,o,s):this._remoteParentNotSampled.shouldSample(e,r,n,i,o,s):a.traceFlags&Ma.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 FN{_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:ZF(r)&&this._accumulate(r)<this._upperBound?of.RECORD_AND_SAMPLED:of.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 BN=1;function d8(){return{sampler:f8(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},spanLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128,linkCountLimit:128,eventCountLimit:128,attributePerEventCountLimit:128,attributePerLinkCountLimit:128}}}function f8(){const t="parentbased_always_on";switch(t){case"always_on":return new jd;case"always_off":return new P0;case"parentbased_always_on":return new $O({root:new jd});case"parentbased_always_off":return new $O({root:new P0});case"traceidratio":return new FN(ZN());case"parentbased_traceidratio":return new $O({root:new FN(ZN())});default:return Xt.error(`OTEL_TRACES_SAMPLER value "${t}" invalid, defaulting to "parentbased_always_on".`),new $O({root:new jd})}}function ZN(){return Xt.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${BN}.`),BN}const Y$e=128,G$e=1/0;function H$e(t){const e={sampler:f8()},r=d8(),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 J$e(t){const e=Object.assign({},t.spanLimits);return e.attributeCountLimit=t.spanLimits?.attributeCountLimit??t.generalLimits?.attributeCountLimit??void 0??void 0??Y$e,e.attributeValueLengthLimit=t.spanLimits?.attributeValueLengthLimit??t.generalLimits?.attributeValueLengthLimit??void 0??void 0??G$e,Object.assign({},t,{spanLimits:e})}class K$e{_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 U$e(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(Xt.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&Ma.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&&Xt.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(Xt.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);ka.with(LCe(ka.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===Os.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=>{nf(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,nf(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 eke extends K$e{_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=>{nf(r)})},this._pageHideListener=()=>{this.forceFlush().catch(r=>{nf(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 tke=8,rke=16;class nke{generateTraceId=YN(rke);generateSpanId=YN(tke)}const kO=Array(32);function YN(t){return function(){for(let r=0;r<t*2;r++)kO[r]=Math.floor(Math.random()*16)+48,kO[r]>=58&&(kO[r]+=39);return String.fromCharCode.apply(null,kO.slice(0,t*2))}}class ike{_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;constructor(e,r,n,i){const o=H$e(r);this._sampler=o.sampler,this._generalLimits=o.generalLimits,this._spanLimits=o.spanLimits,this._idGenerator=r.idGenerator||new nke,this._resource=n,this._spanProcessor=i,this.instrumentationScope=e}startSpan(e,r={},n=ka.active()){r.root&&(n=mi.deleteSpan(n));const i=mi.getSpan(n);if(J_(n))return Xt.debug("Instrumentation suppressed, returning Noop Span"),mi.wrapSpanContext(FF);const o=i?.spanContext(),s=this._idGenerator.generateSpanId();let a,l,c;!o||!mi.isSpanContextValid(o)?l=this._idGenerator.generateTraceId():(l=o.traceId,c=o.traceState,a=o);const u=r.kind??lk.INTERNAL,d=(r.links??[]).map(O=>({context:O.context,attributes:Dv(O.attributes)})),f=Dv(r.attributes),h=this._sampler.shouldSample(n,l,e,u,f,d);c=h.traceState??c;const y=h.decision===b0.RECORD_AND_SAMPLED?Ma.SAMPLED:Ma.NONE,m={traceId:l,spanId:s,traceFlags:y,traceState:c};if(h.decision===b0.NOT_RECORD)return Xt.debug("Recording is off, propagating context in a non-recording span"),mi.wrapSpanContext(m);const g=Dv(Object.assign(f,h.attributes));return new Z$e({resource:this._resource,scope:this.instrumentationScope,context:n,spanContext:m,name:e,kind:u,links:d,parentSpanContext:a,attributes:g,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??ka.active(),c=this.startSpan(e,o,l),u=mi.setSpan(l,c);return ka.with(u,a,void 0,c)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}}class oke{_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=>{nf(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 Ic;(function(t){t[t.resolved=0]="resolved",t[t.timeout=1]="timeout",t[t.error=2]="error",t[t.unresolved=3]="unresolved"})(Ic||(Ic={}));class ske{_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(e={}){const r=L$e({},d8(),J$e(e));this._resource=r.resource??F$e(),this._config=Object.assign({},r,{resource:this._resource});const n=[];e.spanProcessors?.length&&n.push(...e.spanProcessors),this._activeSpanProcessor=new oke(n)}getTracer(e,r,n){const i=`${e}@${r||""}:${n?.schemaUrl||""}`;return this._tracers.has(i)||this._tracers.set(i,new ike({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=Ic.timeout},e);n.forceFlush().then(()=>{clearTimeout(s),o!==Ic.timeout&&(o=Ic.resolved,i(o))}).catch(a=>{clearTimeout(s),o=Ic.error,i(a)})}));return new Promise((n,i)=>{Promise.all(r).then(o=>{const s=o.filter(a=>a!==Ic.resolved);s.length>0?i(s):n()}).catch(o=>i([o]))})}shutdown(){return this._activeSpanProcessor.shutdown()}}class ake{_enabled=!1;_currentContext=fd;_bindFunction(e=fd,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=fd,this._enabled=!1,this}enable(){return this._enabled?this:(this._enabled=!0,this._currentContext=fd,this)}with(e,r,n,...i){const o=this._currentContext;this._currentContext=e||fd;try{return r.call(n,...i)}finally{this._currentContext=o}}}function lke(t){if(t!==null){if(t===void 0){const e=new ake;e.enable(),ka.setGlobalContextManager(e);return}t.enable(),ka.setGlobalContextManager(t)}}function cke(t){if(t!==null){if(t===void 0){dh.setGlobalPropagator(new p$e({propagators:[new T$e,new YCe]}));return}dh.setGlobalPropagator(t)}}class uke extends ske{constructor(e={}){super(e)}register(e={}){mi.setGlobalTracerProvider(this),cke(e.propagator),lke(e.contextManager)}}class dke{_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 GN extends Error{code;name="OTLPExporterError";data;constructor(e,r,n){super(e),this.data=n,this.code=r}}function fke(t){if(Number.isFinite(t)&&t>0)return t;throw new Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${t}')`)}function pke(t){if(t!=null)return()=>t}function hke(t,e,r){return{timeoutMillis:fke(t.timeoutMillis??e.timeoutMillis??r.timeoutMillis),concurrencyLimit:t.concurrencyLimit??e.concurrencyLimit??r.concurrencyLimit,compression:t.compression??e.compression??r.compression}}function mke(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:"none"}}class gke{_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 yke(t){return new gke(t.concurrencyLimit)}function Oke(t){return Object.prototype.hasOwnProperty.call(t,"partialSuccess")}function vke(){return{handleResponse(t){t==null||!Oke(t)||t.partialSuccess==null||Object.keys(t.partialSuccess).length===0||Xt.warn("Received Partial Success response:",JSON.stringify(t.partialSuccess))}}}class bke{_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=Xt.createComponentLogger({namespace:"OTLPExportDelegate"})}export(e,r){if(this._diagLogger.debug("items to be sent",e),this._promiseQueue.hasReachedLimit()){r({code:Os.FAILED,error:new Error("Concurrent export limit reached")});return}const n=this._serializer.serializeRequest(e);if(n==null){r({code:Os.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:Os.SUCCESS});return}else if(i.status==="failure"&&i.error){r({code:Os.FAILED,error:i.error});return}else i.status==="retryable"?r({code:Os.FAILED,error:new GN("Export failed with retryable status")}):r({code:Os.FAILED,error:new GN("Export failed with unknown error")})},i=>r({code:Os.FAILED,error:i})))}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug("shutdown started"),await this.forceFlush(),this._transport.shutdown()}}function xke(t,e){return new bke(t.transport,t.serializer,vke(),t.promiseHandler,e.timeout)}function p8(t,e,r){return xke({transport:r,serializer:e,promiseHandler:yke(t)},{timeout:t.timeoutMillis})}function HN(t){return t>=48&&t<=57?t-48:t>=97&&t<=102?t-87:t-55}function h8(t){const e=new Uint8Array(t.length/2);let r=0;for(let n=0;n<t.length;n+=2){const i=HN(t.charCodeAt(n)),o=HN(t.charCodeAt(n+1));e[r++]=i<<4|o}return e}function m8(t){const e=BigInt(1e9);return BigInt(t[0])*e+BigInt(t[1])}function Ske(t){const e=Number(BigInt.asUintN(32,t)),r=Number(BigInt.asUintN(32,t>>BigInt(32)));return{low:e,high:r}}function wke(t){const e=m8(t);return Ske(e)}function Pke(t){return m8(t).toString()}const Cke=typeof BigInt<"u"?Pke:f$e;function JN(t){return t}function $ke(t){if(t!==void 0)return h8(t)}const kke={encodeHrTime:wke,encodeSpanContext:h8,encodeOptionalSpanContext:$ke};function Eke(t){return t===void 0?kke:{encodeHrTime:Cke,encodeSpanContext:JN,encodeOptionalSpanContext:JN}}function Tke(t){return{attributes:R1(t.attributes),droppedAttributesCount:0}}function _ke(t){return{name:t.name,version:t.version}}function R1(t){return Object.keys(t).map(e=>g8(e,t[e]))}function g8(t,e){return{key:t,value:y8(e)}}function y8(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(y8)}}:e==="object"&&t!=null?{kvlistValue:{values:Object.entries(t).map(([r,n])=>g8(r,n))}}:{}}function Ake(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:R1(t.attributes),droppedAttributesCount:t.droppedAttributesCount,events:t.events.map(o=>Rke(o,e)),droppedEventsCount:t.droppedEventsCount,status:{code:n.code,message:n.message},links:t.links.map(o=>Ike(o,e)),droppedLinksCount:t.droppedLinksCount}}function Ike(t,e){return{attributes:t.attributes?R1(t.attributes):[],spanId:e.encodeSpanContext(t.context.spanId),traceId:e.encodeSpanContext(t.context.traceId),traceState:t.context.traceState?.serialize(),droppedAttributesCount:t.droppedAttributesCount||0}}function Rke(t,e){return{attributes:t.attributes?R1(t.attributes):[],name:t.name,timeUnixNano:e.encodeHrTime(t.time),droppedAttributesCount:t.droppedAttributesCount||0}}function jke(t,e){const r=Eke(e);return{resourceSpans:Dke(t,r)}}function Qke(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 Dke(t,e){const r=Qke(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 f=u.value;if(f.length>0){const h=f.map(y=>Ake(y,e));l.push({scope:_ke(f[0].instrumentationScope),spans:h,schemaUrl:f[0].instrumentationScope.schemaUrl})}u=c.next()}const d={resource:Tke(s),scopeSpans:l,schemaUrl:void 0};n.push(d),o=i.next()}return n}const Nke={serializeRequest:t=>{const e=jke(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))}},Mke=5,qke=1e3,zke=5e3,Lke=1.5,KN=.2;function Vke(){return Math.random()*(2*KN)-KN}class Xke{_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=Mke,s=qke;for(;i.status==="retryable"&&o>0;){o--;const a=Math.max(Math.min(s,zke)+Vke(),0);s=s*Lke;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 O8(t){return new Xke(t.transport)}function Uke(t){return[429,502,503,504].includes(t)}function Wke(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 Fke{_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?(Xt.debug("XHR success"),n({status:"success"})):i.status&&Uke(i.status)?n({status:"retryable",retryInMillis:Wke(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 Bke(t){return new Fke(t)}class Zke{_params;constructor(e){this._params=e}send(e){return new Promise(r=>{navigator.sendBeacon(this._params.url,new Blob([e],{type:this._params.blobType}))?(Xt.debug("SendBeacon success"),r({status:"success"})):r({status:"failure",error:new Error("SendBeacon failed")})})}shutdown(){}}function Yke(t){return new Zke(t)}function Gke(t,e){return p8(t,e,O8({transport:Bke(t)}))}function Hke(t,e){return p8(t,e,O8({transport:Yke({url:t.url,blobType:t.headers()["Content-Type"]})}))}function Jke(t){return()=>{const e={};return Object.entries(t?.()??{}).forEach(([r,n])=>{typeof n<"u"?e[r]=String(n):Xt.warn(`Header "${r}" has invalid value (${n}) and will be ignored`)}),e}}function Kke(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 eEe(t){if(t!=null)try{return new URL(t),t}catch{throw new Error(`Configuration: Could not parse user-provided export URL: '${t}'`)}}function tEe(t,e,r){return{...hke(t,e,r),headers:Kke(Jke(t.headers),e.headers,r.headers),url:eEe(t.url)??e.url??r.url,agentOptions:t.agentOptions??e.agentOptions??r.agentOptions}}function rEe(t,e){return{...mke(),headers:()=>t,url:"http://localhost:4318/"+e,agentOptions:{keepAlive:!0}}}function nEe(t,e,r){return tEe({url:t.url,timeoutMillis:t.timeoutMillis,headers:pke(t.headers),concurrencyLimit:t.concurrencyLimit},{},rEe(r,e))}function iEe(t,e,r,n){const i=!!t.headers||typeof navigator.sendBeacon!="function",o=nEe(t,r,n);return i?Gke(o,e):Hke(o,e)}class oEe extends dke{constructor(e={}){super(iEe(e,Nke,"v1/traces",{"Content-Type":"application/json"}))}}const sEe="service.name",aEe="service.version";class v8{emit(e){}}const lEe=new v8;class cEe{getLogger(e,r,n){return new v8}}const b8=new cEe;class uEe{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):lEe}}class eM{getLogger(e,r,n){var i;return(i=this.getDelegateLogger(e,r,n))!==null&&i!==void 0?i:new uEe(this,e,r,n)}getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:b8}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 dEe=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{},EO=Symbol.for("io.opentelemetry.js.api.logs"),wp=dEe;function fEe(t,e,r){return n=>n===t?e:r}const tM=1;class eA{constructor(){this._proxyLoggerProvider=new eM}static getInstance(){return this._instance||(this._instance=new eA),this._instance}setGlobalLoggerProvider(e){return wp[EO]?this.getLoggerProvider():(wp[EO]=fEe(tM,e,b8),this._proxyLoggerProvider.setDelegate(e),e)}getLoggerProvider(){var e,r;return(r=(e=wp[EO])===null||e===void 0?void 0:e.call(wp,tM))!==null&&r!==void 0?r:this._proxyLoggerProvider}getLogger(e,r,n){return this.getLoggerProvider().getLogger(e,r,n)}disable(){delete wp[EO],this._proxyLoggerProvider=new eM}}const x8=eA.getInstance();function pEe(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 hEe(t){t.forEach(e=>e.disable())}function mEe(t){const e=t.tracerProvider||mi.getTracerProvider(),r=t.meterProvider||GF.getMeterProvider(),n=t.loggerProvider||x8.getLoggerProvider(),i=t.instrumentations?.flat()??[];return pEe(i,e,r,n),()=>{hEe(i)}}let Ui=console.error.bind(console);function Pp(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 S8=(t,e,r)=>{if(!t||!t[e]){Ui("no original function "+String(e)+" to wrap");return}if(!r){Ui("no wrapper function"),Ui(new Error().stack);return}const n=t[e];if(typeof n!="function"||typeof r!="function"){Ui("original object and wrapper must be functions");return}const i=r(n,e);return Pp(i,"__original",n),Pp(i,"__unwrap",()=>{t[e]===i&&Pp(t,e,n)}),Pp(i,"__wrapped",!0),Pp(t,e,i),i},gEe=(t,e,r)=>{if(t)Array.isArray(t)||(t=[t]);else{Ui("must provide one or more modules to patch"),Ui(new Error().stack);return}if(!(e&&Array.isArray(e))){Ui("must provide one or more functions to wrap on modules");return}t.forEach(n=>{e.forEach(i=>{S8(n,i,r)})})},w8=(t,e)=>{if(!t||!t[e]){Ui("no function to unwrap."),Ui(new Error().stack);return}const r=t[e];if(!r.__unwrap)Ui("no original to unwrap to -- has "+String(e)+" already been unwrapped?");else{r.__unwrap();return}},yEe=(t,e)=>{if(t)Array.isArray(t)||(t=[t]);else{Ui("must provide one or more modules to patch"),Ui(new Error().stack);return}if(!(e&&Array.isArray(e))){Ui("must provide one or more functions to unwrap on modules");return}t.forEach(r=>{e.forEach(n=>{w8(r,n)})})};class OEe{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(e,r,n){this.instrumentationName=e,this.instrumentationVersion=r,this.setConfig(n),this._diag=Xt.createComponentLogger({namespace:e}),this._tracer=mi.getTracer(e,r),this._meter=GF.getMeter(e,r),this._logger=x8.getLogger(e,r),this._updateMetricInstruments()}_wrap=S8;_unwrap=w8;_massWrap=gEe;_massUnwrap=yEe;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 vEe extends OEe{constructor(e,r,n){super(e,r,n),this._config.enabled&&this.enable()}}class bEe{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 xEe{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":v0(),"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(f=>f.object===c);if(d){s.push(d,u);const f=a.indexOf(d);a.splice(f,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[f,h]of Object.entries(c))if(h!==void 0){const y=f.replace(/([A-Z])/g,"_$1").toLowerCase();i[`cloudevents.event_data.${u}${d}${y}`]=h}}for(const l of a){const c=`${l.object}.`;for(const[u,d]of Object.entries(l))if(d!==void 0){const f=u.replace(/([A-Z])/g,"_$1").toLowerCase();i[`cloudevents.event_data.${c}${f}`]=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();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=mi.setSpan(ka.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=ka.active(),n=e.time?new Date(e.time):new Date,i=this.tracer.startSpan(`event.${e.type}`,{attributes:this.processAttributes(e,n)},r),o=mi.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 bEe(r)}async forceFlush(){return this.tracerProvider?.forceFlush()}async shutdown(){return this.tracerProvider?.shutdown()}getKeySnakeValue=e=>e.replace(/([A-Z])/g,"_$1").toLowerCase()}class SEe extends xEe{tracerProvider=null;tracer=null;initialized=!1;constructor(){super()}initTracer(e){if(!e.collectorUrl&&!e.collectorTraceUrl)return;const r=`ses_${v0()}`,n=u8({[sEe]:e.serviceName,[aEe]:e.serviceVersion,session_id:r}),i=e.collectorTraceUrl||`${e.collectorUrl}/v1/traces`;this.tracerProvider=new uke({resource:n,spanProcessors:[new eke(new oEe({url:i,headers:{}}))]}),this.tracer=this.tracerProvider.getTracer(e.tracerName),this.tracerProvider.register(),mEe({instrumentations:e.instrumentations??[]}),this.initialized=!0}}class Sa extends vEe{sendErrorEvent;originalConsoleError;constructor(e,r){super("errors","1.0",e||{}),this.sendErrorEvent=r}static toErrorEvent(e,r){return{type:"error",payload:{handler:r,errorType:Sa.getErrorType(e),message:Sa.getErrorMessage(e),stack:Sa.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=Sa.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(Sa.toErrorEvent(e,r))}}class wEe{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 SEe,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 Sa(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_${v0()}`,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_${v0()}`,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(Sa.toErrorEvent(e,r).type,Sa.toErrorEvent(e,r).payload)}sendTabChangeMessage(){this.send("tab.change")}sendButtonClickMessage(){this.send("button.click")}sendChangeMessage(){this.send("change")}sendContentCopyMessage(){this.send("content.copy")}sendRequestSendMessage(){this.send("request.send")}sendTokenGenerateMessage(){this.send("token.generate")}sendAppLifecycleMessage(){this.send("app.lifecycle")}sendEnvironmentManagementMessage(){this.send("environment.management")}sendServerManagementMessage(){this.send("server.management")}sendInputManagementMessage(){this.send("input.management")}sendNodeManagementMessage(){this.send("node.management")}sendHistoryManagementMessage(){this.send("history.management")}sendCredentialManagementMessage(){this.send("credential.management")}sendPanelToggleMessage(){this.send("panel.toggle")}sendWorkflowRunClickMessage(e){this.send("workflow.run.click",e)}sendWorkflowRunResultMessage(){this.send("workflow.run.result")}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 j1=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],PEe="https://cors.redocly.com/";function CEe(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function rM(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 nM(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?rM(Object(r),!0).forEach(function(n){CEe(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):rM(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function wn(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 iM=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),CP=function(){return Math.random().toString(36).substring(7).split("").join(".")},Dl={INIT:"@@redux/INIT"+CP(),REPLACE:"@@redux/REPLACE"+CP(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+CP()}};function P8(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 $Ee(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(TEe(t))return"date";if(EEe(t))return"error";var r=kEe(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 kEe(t){return typeof t.constructor=="function"?t.constructor.name:null}function EEe(t){return t instanceof Error||typeof t.message=="string"&&t.constructor&&typeof t.constructor.stackTraceLimit=="number"}function TEe(t){return t instanceof Date?!0:typeof t.toDateString=="function"&&typeof t.getDate=="function"&&typeof t.setDate=="function"}function yl(t){var e=typeof t;return process.env.NODE_ENV!=="production"&&(e=$Ee(t)),e}function Q1(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"?wn(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"?wn(1):"Expected the enhancer to be a function. Instead, received: '"+yl(r)+"'");return r(Q1)(t,e)}if(typeof t!="function")throw new Error(process.env.NODE_ENV==="production"?wn(2):"Expected the root reducer to be a function. Instead, received: '"+yl(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"?wn(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(m){if(typeof m!="function")throw new Error(process.env.NODE_ENV==="production"?wn(4):"Expected the listener to be a function. Instead, received: '"+yl(m)+"'");if(l)throw new Error(process.env.NODE_ENV==="production"?wn(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");var g=!0;return c(),a.push(m),function(){if(g){if(l)throw new Error(process.env.NODE_ENV==="production"?wn(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");g=!1,c();var O=a.indexOf(m);a.splice(O,1),s=null}}}function f(m){if(!P8(m))throw new Error(process.env.NODE_ENV==="production"?wn(7):"Actions must be plain objects. Instead, the actual type was: '"+yl(m)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof m.type>"u")throw new Error(process.env.NODE_ENV==="production"?wn(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"?wn(9):"Reducers may not dispatch actions.");try{l=!0,o=i(o,m)}finally{l=!1}for(var g=s=a,v=0;v<g.length;v++){var O=g[v];O()}return m}function h(m){if(typeof m!="function")throw new Error(process.env.NODE_ENV==="production"?wn(10):"Expected the nextReducer to be a function. Instead, received: '"+yl(m));i=m,f({type:Dl.REPLACE})}function y(){var m,g=d;return m={subscribe:function(O){if(typeof O!="object"||O===null)throw new Error(process.env.NODE_ENV==="production"?wn(11):"Expected the observer to be an object. Instead, received: '"+yl(O)+"'");function b(){O.next&&O.next(u())}b();var S=g(b);return{unsubscribe:S}}},m[iM]=function(){return this},m}return f({type:Dl.INIT}),n={dispatch:f,subscribe:d,getState:u,replaceReducer:h},n[iM]=y,n}var _Ee=Q1;function mk(t){typeof console<"u"&&typeof console.error=="function"&&console.error(t);try{throw new Error(t)}catch{}}function AEe(t,e,r,n){var i=Object.keys(e),o=r&&r.type===Dl.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(!P8(t))return"The "+o+' has unexpected type of "'+yl(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===Dl.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 IEe(t){Object.keys(t).forEach(function(e){var r=t[e],n=r(void 0,{type:Dl.INIT});if(typeof n>"u")throw new Error(process.env.NODE_ENV==="production"?wn(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:Dl.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?wn(13):'The slice reducer for key "'+e+'" returned undefined when probed with a random type. '+("Don't try to handle '"+Dl.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 REe(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"&&mk('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{IEe(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=AEe(c,r,u,s);d&&mk(d)}for(var f=!1,h={},y=0;y<o.length;y++){var m=o[y],g=r[m],v=c[m],O=g(v,u);if(typeof O>"u"){var b=u&&u.type;throw new Error(process.env.NODE_ENV==="production"?wn(14):"When called with an action of type "+(b?'"'+String(b)+'"':"(unknown type)")+', the slice reducer for key "'+m+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.')}h[m]=O,f=f||O!==v}return f=f||o.length!==Object.keys(c).length,f?h:c}}function oM(t,e){return function(){return e(t.apply(this,arguments))}}function jEe(t,e){if(typeof t=="function")return oM(t,e);if(typeof t!="object"||t===null)throw new Error(process.env.NODE_ENV==="production"?wn(16):"bindActionCreators expected an object or a function, but instead received: '"+yl(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]=oM(i,e))}return r}function C8(){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 QEe(){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"?wn(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=C8.apply(void 0,a)(i.dispatch),nM(nM({},i),{},{dispatch:o})}}}function sM(){}process.env.NODE_ENV!=="production"&&typeof sM.name=="string"&&sM.name!=="isCrushed"&&mk('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 DEe=Object.freeze({__proto__:null,__DO_NOT_USE__ActionTypes:Dl,applyMiddleware:QEe,bindActionCreators:jEe,combineReducers:REe,compose:C8,createStore:Q1,legacy_createStore:_Ee});function NEe(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 MEe=NEe(DEe);MEe.compose;var qEe=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(t){return t}};function zEe(t,e,r){var n=!1,i=!1,o=Q1(function(a,l){if(!i){var c=function(g){return Array.isArray(g)&&g.findIndex(function(v){return typeof v!="string"&&typeof v!="number"})===-1};if(l.type.startsWith("SET")){var u=function(g){try{n=!0,"value"in l?g.set(l.value):g.set(ft)}finally{n=!1}};if(l.path){if(c(l.path)){l.path.length===0&&u(t);for(var d=t,f=!0,h=0,y=l.path;h<y.length;h++){var m=y[h];d[m]?d=d[m]:f=!1}f&&u(d)}}else u(t)}else l.type==="BREAKPOINT"&&r()}return t.promised||t.error?ft:t.get({noproxy:!0})},qEe({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 LEe(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=zEe(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 zt=(t=>(t.Normal="Normal",t.Edit="Edit",t.Draft="Draft",t))(zt||{});const Ym="default",$8=[{name:Ym,inputs:[],servers:[],state:zt.Normal}],k8={activeTabIdx:0,tabs:[]};var gs=(t=>(t.Idle="idle",t.Loading="loading",t.Success="success",t.Error="error",t))(gs||{});function Ea(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 gk(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(!gk(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)||!gk(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function aM(t){return Object.keys(t).forEach(e=>{t[e]===void 0&&delete t[e]}),t}function Za(){return!!window?.__TAURI__}async function Ya(t,e={},r){return window.__TAURI_INTERNALS__.invoke(t,e,r)}async function lM(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 ni={FS:"fs",WEB:"web"};async function tc(t,e={},r){return window.__TAURI_INTERNALS__.invoke(t,e,r)}var yk;(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"})(yk||(yk={}));var Ok;(function(t){t[t.Start=0]="Start",t[t.Current=1]="Current",t[t.End=2]="End"})(Ok||(Ok={}));async function vk(t,e){if(t instanceof URL&&t.protocol!=="file:")throw new TypeError("Must be a file URL.");await tc("plugin:fs|mkdir",{path:t instanceof URL?t.toString():t,options:e})}async function tA(t,e){if(t instanceof URL&&t.protocol!=="file:")throw new TypeError("Must be a file URL.");return await tc("plugin:fs|read_dir",{path:t instanceof URL?t.toString():t,options:e})}async function E8(t,e){if(t instanceof URL&&t.protocol!=="file:")throw new TypeError("Must be a file URL.");const r=await tc("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 D1(t,e){if(t instanceof URL&&t.protocol!=="file:")throw new TypeError("Must be a file URL.");return await tc("plugin:fs|read_text_file",{path:t instanceof URL?t.toString():t,options:e})}async function T8(t,e){if(t instanceof URL&&t.protocol!=="file:")throw new TypeError("Must be a file URL.");await tc("plugin:fs|remove",{path:t instanceof URL?t.toString():t,options:e})}async function _8(t,e,r){if(t instanceof URL&&t.protocol!=="file:")throw new TypeError("Must be a file URL.");await tc("plugin:fs|write_text_file",{path:t instanceof URL?t.toString():t,data:e,options:r})}async function rA(t,e){if(t instanceof URL&&t.protocol!=="file:")throw new TypeError("Must be a file URL.");return await tc("plugin:fs|exists",{path:t instanceof URL?t.toString():t,options:e})}const VEe=Object.freeze(Object.defineProperty({__proto__:null,get BaseDirectory(){return yk},get SeekMode(){return Ok},exists:rA,mkdir:vk,readDir:tA,readFile:E8,readTextFile:D1,remove:T8,writeTextFile:_8},Symbol.toStringTag,{value:"Module"}));var rm;(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"})(rm||(rm={}));async function A8(){return Ya("plugin:path|resolve_directory",{directory:rm.AppData})}async function I8(){return Ya("plugin:path|resolve_directory",{directory:rm.Desktop})}function nA(){return window.__TAURI_INTERNALS__.plugins.path.sep}async function R8(...t){return Ya("plugin:path|resolve",{paths:t})}async function Qd(...t){return Ya("plugin:path|join",{paths:t})}async function j8(t){return Ya("plugin:path|dirname",{path:t})}async function Q8(t){return Ya("plugin:path|extname",{path:t})}async function iA(t,e){return Ya("plugin:path|basename",{path:t,ext:e})}async function D8(t){return Ya("plugin:path|is_absolute",{path:t})}const XEe=Object.freeze(Object.defineProperty({__proto__:null,get BaseDirectory(){return rm},appDataDir:A8,basename:iA,desktopDir:I8,dirname:j8,extname:Q8,isAbsolute:D8,join:Qd,resolve:R8,sep:nA},Symbol.toStringTag,{value:"Module"}));class cr{static utils=null;static async getUtils(){return cr.utils||(cr.utils=Za()?await Promise.resolve().then(()=>require("./replay-tauri-path-DLRG5izi.js")):await Promise.resolve().then(()=>Iie)),cr.utils}static async dirname(e){return(await cr.getUtils()).dirname(e)}static async join(...e){return(await cr.getUtils()).join(...e)}static async resolve(e){return(await cr.getUtils()).resolve(e)}static async isAbsolute(e){return(await cr.getUtils()).isAbsolute(e)}static async relative(e,r){return(await cr.getUtils()).relative(e,r)}static async extname(e){return(await cr.getUtils()).extname(e)}}const UEe=new Set(["node_modules"]);class cM{constructor(e){this.baseDir=e,this.initializeDirectory(e)}async initializeDirectory(e){await vk(e,{recursive:!0})}async ls(e){const r=await this.getFullPath(e);return this.getDirEntryFilesRecursively(r)}async getDirEntryFilesRecursively(e){try{const r=[],n=await tA(e);for(const i of n)if(i.isDirectory){if(UEe.has(i.name))continue;const o=await Qd(e,i.name),s=await this.getDirEntryFilesRecursively(o);r.push(...s)}else{const o=await Qd(e,i.name),s=await cr.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 D1(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=nA(),o=n.split(i).slice(0,-1).join(i);await vk(o,{recursive:!0}),await _8(n,r)}async remove(e){const r=await this.getFullPath(e);try{await T8(r)}catch(n){!n.includes("No such file or directory")&&!n.includes("forbidden path")&&console.error(n)}}async getFullPath(e){return await Qd(this.baseDir,e??"")}}class WEe{baseDir="";async ls(e=""){return[]}async get(e){return null}async set(e,r){}async remove(e){}}class FEe{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 N8{constructor(e){this.storage=e}itemIds=[];async getAbsolutePath(e){return await cr.resolve(await cr.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===zt.Draft||e.srcType!==ni.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 BEe extends N8{parse(e){return{...e.content,id:e.uri,srcType:e.type}}async stringify(e){const{id:r,srcType:n,...i}=e;return await cr.extname(r)===".json"?JSON.stringify(i,null,2):Da.dump(i)}}var zn=(t=>(t.SIMPLE="simple",t.REGEX="regex",t.JSONPATH="jsonpath",t.XPATH="xpath",t))(zn||{});function ZEe(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 YEe=`
|
|
359
|
+
`;function U_({input:t,onSave:e,onCancel:r,...n}){const[i,o]=E.useState(!!t.isSecret),s=({name:a,value:l})=>{e({...t,name:a,value:l,isSecret:i})};return p.jsx(VF,{variable:t,onSave:s,onCancel:r,maskValue:i,...n,children:p.jsx(Zh,{children:p.jsx(eF,{value:i,onChange:a=>o(a),title:"Make it secret"})})})}const ak=()=>({name:"",value:"",isSecret:!1}),Er=t=>c7+"$inputs."+t+MT,XF=(t,e)=>e.inputs.find(r=>r.get().name===t.match(`^${Ux}$`)?.[1]);function SPe({environments:t,activeEnvironmentId:e}){return t.get().find(n=>n.name===e.get())?.inputs||[]}function ul(t){const e=new RegExp(Ux,"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 T1(t){const e=/^\{?\$inputs\.([^\}\s]+)\}?$/,r=t.match(e);return r?r[1]:null}function Qv(t){const e=new Error(t);return e.source="ulid",e}const W_="0123456789ABCDEFGHJKMNPQRSTVWXYZ",ch=W_.length,DN=Math.pow(2,48)-1,wPe=10,PPe=16;function CPe(t){let e=Math.floor(t()*ch);return e===ch&&(e=ch-1),W_.charAt(e)}function $Pe(t,e){if(isNaN(t))throw new Error(t+" must be a number");if(t>DN)throw Qv("cannot encode time greater than "+DN);if(t<0)throw Qv("time must be positive");if(Number.isInteger(Number(t))===!1)throw Qv("time must be an integer");let r,n="";for(;e>0;e--)r=t%ch,n=W_.charAt(r)+n,t=(t-r)/ch;return n}function kPe(t,e){let r="";for(;t>0;t--)r=CPe(e)+r;return r}function EPe(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 Qv("secure crypto unusable, insecure Math.random not allowed")}function TPe(t){return t||(t=EPe()),function(r){return isNaN(r)&&(r=Date.now()),$Pe(r,wPe)+kPe(PPe,t)}}const v0=TPe();var _Pe=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{},Mc="1.9.0",NN=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function APe(t){var e=new Set([t]),r=new Set,n=t.match(NN);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(NN);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 IPe=APe(Mc),RPe=Mc.split(".")[0],em=Symbol.for("opentelemetry.js.api."+RPe),tm=_Pe;function Bm(t,e,r,n){var i;n===void 0&&(n=!1);var o=tm[em]=(i=tm[em])!==null&&i!==void 0?i:{version:Mc};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!==Mc){var s=new Error("@opentelemetry/api: Registration of version v"+o.version+" for "+t+" does not match previously registered API v"+Mc);return r.error(s.stack||s.message),!1}return o[t]=e,r.debug("@opentelemetry/api: Registered a global for "+t+" v"+Mc+"."),!0}function Jc(t){var e,r,n=(e=tm[em])===null||e===void 0?void 0:e.version;if(!(!n||!IPe(n)))return(r=tm[em])===null||r===void 0?void 0:r[t]}function Zm(t,e){e.debug("@opentelemetry/api: Unregistering a global for "+t+" v"+Mc+".");var r=tm[em];r&&delete r[t]}var jPe=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},QPe=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))},DPe=(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 xp("debug",this._namespace,e)},t.prototype.error=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return xp("error",this._namespace,e)},t.prototype.info=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return xp("info",this._namespace,e)},t.prototype.warn=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return xp("warn",this._namespace,e)},t.prototype.verbose=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return xp("verbose",this._namespace,e)},t})();function xp(t,e,r){var n=Jc("diag");if(n)return r.unshift(e),n[t].apply(n,QPe([],jPe(r),!1))}var Ni;(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"})(Ni||(Ni={}));function NPe(t,e){t<Ni.NONE?t=Ni.NONE:t>Ni.ALL&&(t=Ni.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",Ni.ERROR),warn:r("warn",Ni.WARN),info:r("info",Ni.INFO),debug:r("debug",Ni.DEBUG),verbose:r("verbose",Ni.VERBOSE)}}var MPe=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},qPe=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))},zPe="diag",Ds=(function(){function t(){function e(i){return function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];var a=Jc("diag");if(a)return a[i].apply(a,qPe([],MPe(o),!1))}}var r=this,n=function(i,o){var s,a,l;if(o===void 0&&(o={logLevel:Ni.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=Jc("diag"),d=NPe((a=o.logLevel)!==null&&a!==void 0?a:Ni.INFO,i);if(u&&!o.suppressOverrideMessage){var f=(l=new Error().stack)!==null&&l!==void 0?l:"<failed to generate stacktrace>";u.warn("Current logger will be overwritten from "+f),d.warn("Current logger will overwrite one already registered from "+f)}return Bm("diag",d,r,!0)};r.setLogger=n,r.disable=function(){Zm(zPe,r)},r.createComponentLogger=function(i){return new DPe(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})(),LPe=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},VPe=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.")},XPe=(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=LPe(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=VPe(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})(),UPe=Symbol("BaggageEntryMetadata"),WPe=Ds.instance();function FPe(t){return t===void 0&&(t={}),new XPe(new Map(Object.entries(t)))}function BPe(t){return typeof t!="string"&&(WPe.error("Cannot create baggage metadata from unknown type: "+typeof t),t=""),{__TYPE__:UPe,toString:function(){return t}}}function F_(t){return Symbol.for(t)}var ZPe=(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})(),fd=new ZPe,mu=(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)}})(),YPe=(function(){function t(){}return t.prototype.createGauge=function(e,r){return oCe},t.prototype.createHistogram=function(e,r){return sCe},t.prototype.createCounter=function(e,r){return iCe},t.prototype.createUpDownCounter=function(e,r){return aCe},t.prototype.createObservableGauge=function(e,r){return cCe},t.prototype.createObservableCounter=function(e,r){return lCe},t.prototype.createObservableUpDownCounter=function(e,r){return uCe},t.prototype.addBatchObservableCallback=function(e,r){},t.prototype.removeBatchObservableCallback=function(e){},t})(),_1=(function(){function t(){}return t})(),GPe=(function(t){mu(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.add=function(r,n){},e})(_1),HPe=(function(t){mu(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.add=function(r,n){},e})(_1),JPe=(function(t){mu(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.record=function(r,n){},e})(_1),KPe=(function(t){mu(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.record=function(r,n){},e})(_1),B_=(function(){function t(){}return t.prototype.addCallback=function(e){},t.prototype.removeCallback=function(e){},t})(),eCe=(function(t){mu(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(B_),tCe=(function(t){mu(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(B_),rCe=(function(t){mu(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(B_),nCe=new YPe,iCe=new GPe,oCe=new JPe,sCe=new KPe,aCe=new HPe,lCe=new eCe,cCe=new tCe,uCe=new rCe,dCe={get:function(t,e){if(t!=null)return t[e]},keys:function(t){return t==null?[]:Object.keys(t)}},fCe={set:function(t,e,r){t!=null&&(t[e]=r)}},pCe=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},hCe=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))},mCe=(function(){function t(){}return t.prototype.active=function(){return fd},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,hCe([n],pCe(i),!1))},t.prototype.bind=function(e,r){return r},t.prototype.enable=function(){return this},t.prototype.disable=function(){return this},t})(),gCe=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},yCe=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))},pP="context",OCe=new mCe,A1=(function(){function t(){}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalContextManager=function(e){return Bm(pP,e,Ds.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,yCe([e,r,n],gCe(o),!1))},t.prototype.bind=function(e,r){return this._getContextManager().bind(e,r)},t.prototype._getContextManager=function(){return Jc(pP)||OCe},t.prototype.disable=function(){this._getContextManager().disable(),Zm(pP,Ds.instance())},t})(),Ma;(function(t){t[t.NONE=0]="NONE",t[t.SAMPLED=1]="SAMPLED"})(Ma||(Ma={}));var UF="0000000000000000",WF="00000000000000000000000000000000",FF={traceId:WF,spanId:UF,traceFlags:Ma.NONE},uh=(function(){function t(e){e===void 0&&(e=FF),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})(),Z_=F_("OpenTelemetry Context Key SPAN");function Y_(t){return t.getValue(Z_)||void 0}function vCe(){return Y_(A1.getInstance().active())}function G_(t,e){return t.setValue(Z_,e)}function bCe(t){return t.deleteValue(Z_)}function xCe(t,e){return G_(t,new uh(e))}function BF(t){var e;return(e=Y_(t))===null||e===void 0?void 0:e.spanContext()}var SCe=/^([0-9a-f]{32})$/i,wCe=/^[0-9a-f]{16}$/i;function ZF(t){return SCe.test(t)&&t!==WF}function PCe(t){return wCe.test(t)&&t!==UF}function I1(t){return ZF(t.traceId)&&PCe(t.spanId)}function CCe(t){return new uh(t)}var hP=A1.getInstance(),YF=(function(){function t(){}return t.prototype.startSpan=function(e,r,n){n===void 0&&(n=hP.active());var i=!!r?.root;if(i)return new uh;var o=n&&BF(n);return $Ce(o)&&I1(o)?new uh(o):new uh},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??hP.active(),c=this.startSpan(e,o,l),u=G_(l,c);return hP.with(u,a,void 0,c)}},t})();function $Ce(t){return typeof t=="object"&&typeof t.spanId=="string"&&typeof t.traceId=="string"&&typeof t.traceFlags=="number"}var kCe=new YF,ECe=(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):kCe},t})(),TCe=(function(){function t(){}return t.prototype.getTracer=function(e,r,n){return new YF},t})(),_Ce=new TCe,MN=(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 ECe(this,e,r,n)},t.prototype.getDelegate=function(){var e;return(e=this._delegate)!==null&&e!==void 0?e:_Ce},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})(),b0;(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(b0||(b0={}));var lk;(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"})(lk||(lk={}));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 ka=A1.getInstance(),Xt=Ds.instance(),ACe=(function(){function t(){}return t.prototype.getMeter=function(e,r,n){return nCe},t})(),ICe=new ACe,mP="metrics",RCe=(function(){function t(){}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalMeterProvider=function(e){return Bm(mP,e,Ds.instance())},t.prototype.getMeterProvider=function(){return Jc(mP)||ICe},t.prototype.getMeter=function(e,r,n){return this.getMeterProvider().getMeter(e,r,n)},t.prototype.disable=function(){Zm(mP,Ds.instance())},t})(),GF=RCe.getInstance(),jCe=(function(){function t(){}return t.prototype.inject=function(e,r){},t.prototype.extract=function(e,r){return e},t.prototype.fields=function(){return[]},t})(),H_=F_("OpenTelemetry Baggage Key");function HF(t){return t.getValue(H_)||void 0}function QCe(){return HF(A1.getInstance().active())}function DCe(t,e){return t.setValue(H_,e)}function NCe(t){return t.deleteValue(H_)}var gP="propagation",MCe=new jCe,qCe=(function(){function t(){this.createBaggage=FPe,this.getBaggage=HF,this.getActiveBaggage=QCe,this.setBaggage=DCe,this.deleteBaggage=NCe}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalPropagator=function(e){return Bm(gP,e,Ds.instance())},t.prototype.inject=function(e,r,n){return n===void 0&&(n=fCe),this._getGlobalPropagator().inject(e,r,n)},t.prototype.extract=function(e,r,n){return n===void 0&&(n=dCe),this._getGlobalPropagator().extract(e,r,n)},t.prototype.fields=function(){return this._getGlobalPropagator().fields()},t.prototype.disable=function(){Zm(gP,Ds.instance())},t.prototype._getGlobalPropagator=function(){return Jc(gP)||MCe},t})(),dh=qCe.getInstance(),yP="trace",zCe=(function(){function t(){this._proxyTracerProvider=new MN,this.wrapSpanContext=CCe,this.isSpanContextValid=I1,this.deleteSpan=bCe,this.getSpan=Y_,this.getActiveSpan=vCe,this.getSpanContext=BF,this.setSpan=G_,this.setSpanContext=xCe}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalTracerProvider=function(e){var r=Bm(yP,this._proxyTracerProvider,Ds.instance());return r&&this._proxyTracerProvider.setDelegate(e),r},t.prototype.getTracerProvider=function(){return Jc(yP)||this._proxyTracerProvider},t.prototype.getTracer=function(e,r){return this.getTracerProvider().getTracer(e,r)},t.prototype.disable=function(){Zm(yP,Ds.instance()),this._proxyTracerProvider=new MN},t})(),mi=zCe.getInstance();const JF=F_("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function LCe(t){return t.setValue(JF,!0)}function J_(t){return t.getValue(JF)===!0}const VCe="=",ck=";",uk=",",OP="baggage",XCe=180,UCe=4096,WCe=8192;function FCe(t){return t.reduce((e,r)=>{const n=`${e}${e!==""?uk:""}${r}`;return n.length>WCe?e:n},"")}function BCe(t){return t.getAllEntries().map(([e,r])=>{let n=`${encodeURIComponent(e)}=${encodeURIComponent(r.value)}`;return r.metadata!==void 0&&(n+=ck+r.metadata.toString()),n})}function ZCe(t){const e=t.split(ck);if(e.length<=0)return;const r=e.shift();if(!r)return;const n=r.indexOf(VCe);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=BPe(e.join(ck))),{key:i,value:o,metadata:s}}class YCe{inject(e,r,n){const i=dh.getBaggage(e);if(!i||J_(e))return;const o=BCe(i).filter(a=>a.length<=UCe).slice(0,XCe),s=FCe(o);s.length>0&&n.set(r,OP,s)}extract(e,r,n){const i=n.get(r,OP),o=Array.isArray(i)?i.join(uk):i;if(!o)return e;const s={};return o.length===0||(o.split(uk).forEach(l=>{const c=ZCe(l);if(c){const u={value:c.value};c.metadata&&(u.metadata=c.metadata),s[c.key]=u}}),Object.entries(s).length===0)?e:dh.setBaggage(e,dh.createBaggage(s))}fields(){return[OP]}}function Dv(t){const e={};if(typeof t!="object"||t==null)return e;for(const[r,n]of Object.entries(t)){if(!GCe(r)){Xt.warn(`Invalid attribute key: ${r}`);continue}if(!KF(n)){Xt.warn(`Invalid attribute value set for key: ${r}`);continue}Array.isArray(n)?e[r]=n.slice():e[r]=n}return e}function GCe(t){return typeof t=="string"&&t.length>0}function KF(t){return t==null?!0:Array.isArray(t)?HCe(t):e8(t)}function HCe(t){let e;for(const r of t)if(r!=null){if(!e){if(e8(r)){e=typeof r;continue}return!1}if(typeof r!==e)return!1}return!0}function e8(t){switch(typeof t){case"number":case"boolean":case"string":return!0}return!1}function JCe(){return t=>{Xt.error(KCe(t))}}function KCe(t){return typeof t=="string"?t:JSON.stringify(e$e(t))}function e$e(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 t$e=JCe();function nf(t){try{t$e(t)}catch{}}const Rd=performance,r$e="2.0.1",vP="exception.message",n$e="exception.stacktrace",bP="exception.type",i$e="service.name",dk="telemetry.sdk.language",o$e="webjs",fk="telemetry.sdk.name",pk="telemetry.sdk.version",s$e="process.runtime.name",xP={[fk]:"opentelemetry",[s$e]:"browser",[dk]:o$e,[pk]:r$e};const a$e=9,l$e=6,c$e=Math.pow(10,l$e),x0=Math.pow(10,a$e);function Sd(t){const e=t/1e3,r=Math.trunc(e),n=Math.round(t%1e3*c$e);return[r,n]}function t8(){let t=Rd.timeOrigin;if(typeof t!="number"){const e=Rd;t=e.timing&&e.timing.fetchStart}return t}function u$e(t){const e=Sd(t8()),r=Sd(typeof t=="number"?t:Rd.now());return n8(e,r)}function d$e(t,e){let r=e[0]-t[0],n=e[1]-t[1];return n<0&&(r-=1,n+=x0),[r,n]}function f$e(t){return t[0]*x0+t[1]}function r8(t){return Array.isArray(t)&&t.length===2&&typeof t[0]=="number"&&typeof t[1]=="number"}function qN(t){return r8(t)||typeof t=="number"||t instanceof Date}function n8(t,e){const r=[t[0]+e[0],t[1]+e[1]];return r[1]>=x0&&(r[1]-=x0,r[0]+=1),r}var Os;(function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"})(Os||(Os={}));class p$e{_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){Xt.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){Xt.warn(`Failed to extract with ${o.constructor.name}. Err: ${s.message}`)}return i},e)}fields(){return this._fields.slice()}}const hk="[_0-9a-z-*/]",h$e=`[a-z]${hk}{0,255}`,m$e=`[a-z0-9]${hk}{0,240}@[a-z]${hk}{0,13}`,g$e=new RegExp(`^(?:${h$e}|${m$e})$`),y$e=/^[ -~]{0,255}[!-~]$/,O$e=/,|=/;function v$e(t){return g$e.test(t)}function b$e(t){return y$e.test(t)&&!O$e.test(t)}const zN=32,x$e=512,LN=",",VN="=";class K_{_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+VN+this.get(r)),e),[]).join(LN)}_parse(e){e.length>x$e||(this._internalState=e.split(LN).reverse().reduce((r,n)=>{const i=n.trim(),o=i.indexOf(VN);if(o!==-1){const s=i.slice(0,o),a=i.slice(o+1,n.length);v$e(s)&&b$e(a)&&r.set(s,a)}return r},new Map),this._internalState.size>zN&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,zN))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){const e=new K_;return e._internalState=new Map(this._internalState),e}}const SP="traceparent",wP="tracestate",S$e="00",w$e="(?!ff)[\\da-f]{2}",P$e="(?![0]{32})[\\da-f]{32}",C$e="(?![0]{16})[\\da-f]{16}",$$e="[\\da-f]{2}",k$e=new RegExp(`^\\s?(${w$e})-(${P$e})-(${C$e})-(${$$e})(-.*)?\\s?$`);function E$e(t){const e=k$e.exec(t);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}class T$e{inject(e,r,n){const i=mi.getSpanContext(e);if(!i||J_(e)||!I1(i))return;const o=`${S$e}-${i.traceId}-${i.spanId}-0${Number(i.traceFlags||Ma.NONE).toString(16)}`;n.set(r,SP,o),i.traceState&&n.set(r,wP,i.traceState.serialize())}extract(e,r,n){const i=n.get(r,SP);if(!i)return e;const o=Array.isArray(i)?i[0]:i;if(typeof o!="string")return e;const s=E$e(o);if(!s)return e;s.isRemote=!0;const a=n.get(r,wP);if(a){const l=Array.isArray(a)?a.join(","):a;s.traceState=new K_(typeof l=="string"?l:void 0)}return mi.setSpanContext(e,s)}fields(){return[SP,wP]}}const _$e="[object Object]",A$e="[object Null]",I$e="[object Undefined]",R$e=Function.prototype,i8=R$e.toString,j$e=i8.call(Object),Q$e=Object.getPrototypeOf,o8=Object.prototype,s8=o8.hasOwnProperty,Ac=Symbol?Symbol.toStringTag:void 0,a8=o8.toString;function XN(t){if(!D$e(t)||N$e(t)!==_$e)return!1;const e=Q$e(t);if(e===null)return!0;const r=s8.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&i8.call(r)===j$e}function D$e(t){return t!=null&&typeof t=="object"}function N$e(t){return t==null?t===void 0?I$e:A$e:Ac&&Ac in Object(t)?M$e(t):q$e(t)}function M$e(t){const e=s8.call(t,Ac),r=t[Ac];let n=!1;try{t[Ac]=void 0,n=!0}catch{}const i=a8.call(t);return n&&(e?t[Ac]=r:delete t[Ac]),i}function q$e(t){return a8.call(t)}const z$e=20;function L$e(...t){let e=t.shift();const r=new WeakMap;for(;t.length>0;)e=l8(e,t.shift(),0,r);return e}function PP(t){return S0(t)?t.slice():t}function l8(t,e,r=0,n){let i;if(!(r>z$e)){if(r++,Nv(t)||Nv(e)||c8(e))i=PP(e);else if(S0(t)){if(i=t.slice(),S0(e))for(let o=0,s=e.length;o<s;o++)i.push(PP(e[o]));else if(Sp(e)){const o=Object.keys(e);for(let s=0,a=o.length;s<a;s++){const l=o[s];i[l]=PP(e[l])}}}else if(Sp(t))if(Sp(e)){if(!V$e(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(Nv(c))typeof c>"u"?delete i[l]:i[l]=c;else{const u=i[l],d=c;if(UN(t,l,n)||UN(e,l,n))delete i[l];else{if(Sp(u)&&Sp(d)){const f=n.get(u)||[],h=n.get(d)||[];f.push({obj:t,key:l}),h.push({obj:e,key:l}),n.set(u,f),n.set(d,h)}i[l]=l8(i[l],c,r,n)}}}}else i=e;return i}}function UN(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 S0(t){return Array.isArray(t)}function c8(t){return typeof t=="function"}function Sp(t){return!Nv(t)&&!S0(t)&&!c8(t)&&typeof t=="object"}function Nv(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t>"u"||t instanceof Date||t instanceof RegExp||t===null}function V$e(t,e){return!(!XN(t)||!XN(e))}class X$e{_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 U$e{_callback;_that;_isCalled=!1;_deferred=new X$e;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 W$e(){return"unknown_service"}const Wp=t=>t!==null&&typeof t=="object"&&typeof t.then=="function";class w0{_rawAttributes;_asyncAttributesPending=!1;_memoizedAttributes;static FromAttributeList(e){const r=new w0({});return r._rawAttributes=WN(e),r._asyncAttributesPending=e.filter(([n,i])=>Wp(i)).length>0,r}constructor(e){const r=e.attributes??{};this._rawAttributes=Object.entries(r).map(([n,i])=>(Wp(i)&&(this._asyncAttributesPending=!0),[n,i])),this._rawAttributes=WN(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,Wp(n)?await n:n]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&Xt.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;const e={};for(const[r,n]of this._rawAttributes){if(Wp(n)){Xt.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:w0.FromAttributeList([...e.getRawAttributes(),...this.getRawAttributes()])}}function u8(t){return w0.FromAttributeList(Object.entries(t))}function F$e(){return u8({[i$e]:W$e(),[dk]:xP[dk],[fk]:xP[fk],[pk]:xP[pk]})}function WN(t){return t.map(([e,r])=>Wp(r)?[e,r.catch(n=>{Xt.debug("promise rejection for resource attribute: %s - %s",e,n)})]:[e,r])}const B$e="exception";class Z$e{_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=Rd.now(),this._performanceOffset=r-(this._performanceStartTime+t8()),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 Xt.warn(`Invalid attribute key: ${e}`),this;if(!KF(r))return Xt.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 Xt.warn("No events allowed."),this._droppedEventsCount++,this;i!==void 0&&this.events.length>=i&&(this._droppedEventsCount===0&&Xt.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),qN(r)&&(qN(n)||(n=r),r=void 0);const o=Dv(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"&&(Xt.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()){Xt.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=d$e(this.startTime,this.endTime),this._duration[0]<0&&(Xt.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&&Xt.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._spanProcessor.onEnd(this)}_getTime(e){if(typeof e=="number"&&e<=Rd.now())return u$e(e+this._performanceOffset);if(typeof e=="number")return Sd(e);if(e instanceof Date)return Sd(e.getTime());if(r8(e))return e;if(this._startTimeProvided)return Sd(Date.now());const r=Rd.now()-this._performanceStartTime;return n8(this.startTime,Sd(r))}isRecording(){return this._ended===!1}recordException(e,r){const n={};typeof e=="string"?n[vP]=e:e&&(e.code?n[bP]=e.code.toString():e.name&&(n[bP]=e.name),e.message&&(n[vP]=e.message),e.stack&&(n[n$e]=e.stack)),n[bP]||n[vP]?this.addEvent(B$e,n,r):Xt.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}}`);Xt.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?(Xt.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 of;(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(of||(of={}));class P0{shouldSample(){return{decision:of.NOT_RECORD}}toString(){return"AlwaysOffSampler"}}class jd{shouldSample(){return{decision:of.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}}class $O{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(e){this._root=e.root,this._root||(nf(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new jd),this._remoteParentSampled=e.remoteParentSampled??new jd,this._remoteParentNotSampled=e.remoteParentNotSampled??new P0,this._localParentSampled=e.localParentSampled??new jd,this._localParentNotSampled=e.localParentNotSampled??new P0}shouldSample(e,r,n,i,o,s){const a=mi.getSpanContext(e);return!a||!I1(a)?this._root.shouldSample(e,r,n,i,o,s):a.isRemote?a.traceFlags&Ma.SAMPLED?this._remoteParentSampled.shouldSample(e,r,n,i,o,s):this._remoteParentNotSampled.shouldSample(e,r,n,i,o,s):a.traceFlags&Ma.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 FN{_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:ZF(r)&&this._accumulate(r)<this._upperBound?of.RECORD_AND_SAMPLED:of.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 BN=1;function d8(){return{sampler:f8(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},spanLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128,linkCountLimit:128,eventCountLimit:128,attributePerEventCountLimit:128,attributePerLinkCountLimit:128}}}function f8(){const t="parentbased_always_on";switch(t){case"always_on":return new jd;case"always_off":return new P0;case"parentbased_always_on":return new $O({root:new jd});case"parentbased_always_off":return new $O({root:new P0});case"traceidratio":return new FN(ZN());case"parentbased_traceidratio":return new $O({root:new FN(ZN())});default:return Xt.error(`OTEL_TRACES_SAMPLER value "${t}" invalid, defaulting to "parentbased_always_on".`),new $O({root:new jd})}}function ZN(){return Xt.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${BN}.`),BN}const Y$e=128,G$e=1/0;function H$e(t){const e={sampler:f8()},r=d8(),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 J$e(t){const e=Object.assign({},t.spanLimits);return e.attributeCountLimit=t.spanLimits?.attributeCountLimit??t.generalLimits?.attributeCountLimit??void 0??void 0??Y$e,e.attributeValueLengthLimit=t.spanLimits?.attributeValueLengthLimit??t.generalLimits?.attributeValueLengthLimit??void 0??void 0??G$e,Object.assign({},t,{spanLimits:e})}class K$e{_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 U$e(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(Xt.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&Ma.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&&Xt.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(Xt.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);ka.with(LCe(ka.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===Os.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=>{nf(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,nf(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 eke extends K$e{_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=>{nf(r)})},this._pageHideListener=()=>{this.forceFlush().catch(r=>{nf(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 tke=8,rke=16;class nke{generateTraceId=YN(rke);generateSpanId=YN(tke)}const kO=Array(32);function YN(t){return function(){for(let r=0;r<t*2;r++)kO[r]=Math.floor(Math.random()*16)+48,kO[r]>=58&&(kO[r]+=39);return String.fromCharCode.apply(null,kO.slice(0,t*2))}}class ike{_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;constructor(e,r,n,i){const o=H$e(r);this._sampler=o.sampler,this._generalLimits=o.generalLimits,this._spanLimits=o.spanLimits,this._idGenerator=r.idGenerator||new nke,this._resource=n,this._spanProcessor=i,this.instrumentationScope=e}startSpan(e,r={},n=ka.active()){r.root&&(n=mi.deleteSpan(n));const i=mi.getSpan(n);if(J_(n))return Xt.debug("Instrumentation suppressed, returning Noop Span"),mi.wrapSpanContext(FF);const o=i?.spanContext(),s=this._idGenerator.generateSpanId();let a,l,c;!o||!mi.isSpanContextValid(o)?l=this._idGenerator.generateTraceId():(l=o.traceId,c=o.traceState,a=o);const u=r.kind??lk.INTERNAL,d=(r.links??[]).map(O=>({context:O.context,attributes:Dv(O.attributes)})),f=Dv(r.attributes),h=this._sampler.shouldSample(n,l,e,u,f,d);c=h.traceState??c;const y=h.decision===b0.RECORD_AND_SAMPLED?Ma.SAMPLED:Ma.NONE,m={traceId:l,spanId:s,traceFlags:y,traceState:c};if(h.decision===b0.NOT_RECORD)return Xt.debug("Recording is off, propagating context in a non-recording span"),mi.wrapSpanContext(m);const g=Dv(Object.assign(f,h.attributes));return new Z$e({resource:this._resource,scope:this.instrumentationScope,context:n,spanContext:m,name:e,kind:u,links:d,parentSpanContext:a,attributes:g,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??ka.active(),c=this.startSpan(e,o,l),u=mi.setSpan(l,c);return ka.with(u,a,void 0,c)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}}class oke{_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=>{nf(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 Ic;(function(t){t[t.resolved=0]="resolved",t[t.timeout=1]="timeout",t[t.error=2]="error",t[t.unresolved=3]="unresolved"})(Ic||(Ic={}));class ske{_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(e={}){const r=L$e({},d8(),J$e(e));this._resource=r.resource??F$e(),this._config=Object.assign({},r,{resource:this._resource});const n=[];e.spanProcessors?.length&&n.push(...e.spanProcessors),this._activeSpanProcessor=new oke(n)}getTracer(e,r,n){const i=`${e}@${r||""}:${n?.schemaUrl||""}`;return this._tracers.has(i)||this._tracers.set(i,new ike({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=Ic.timeout},e);n.forceFlush().then(()=>{clearTimeout(s),o!==Ic.timeout&&(o=Ic.resolved,i(o))}).catch(a=>{clearTimeout(s),o=Ic.error,i(a)})}));return new Promise((n,i)=>{Promise.all(r).then(o=>{const s=o.filter(a=>a!==Ic.resolved);s.length>0?i(s):n()}).catch(o=>i([o]))})}shutdown(){return this._activeSpanProcessor.shutdown()}}class ake{_enabled=!1;_currentContext=fd;_bindFunction(e=fd,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=fd,this._enabled=!1,this}enable(){return this._enabled?this:(this._enabled=!0,this._currentContext=fd,this)}with(e,r,n,...i){const o=this._currentContext;this._currentContext=e||fd;try{return r.call(n,...i)}finally{this._currentContext=o}}}function lke(t){if(t!==null){if(t===void 0){const e=new ake;e.enable(),ka.setGlobalContextManager(e);return}t.enable(),ka.setGlobalContextManager(t)}}function cke(t){if(t!==null){if(t===void 0){dh.setGlobalPropagator(new p$e({propagators:[new T$e,new YCe]}));return}dh.setGlobalPropagator(t)}}class uke extends ske{constructor(e={}){super(e)}register(e={}){mi.setGlobalTracerProvider(this),cke(e.propagator),lke(e.contextManager)}}class dke{_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 GN extends Error{code;name="OTLPExporterError";data;constructor(e,r,n){super(e),this.data=n,this.code=r}}function fke(t){if(Number.isFinite(t)&&t>0)return t;throw new Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${t}')`)}function pke(t){if(t!=null)return()=>t}function hke(t,e,r){return{timeoutMillis:fke(t.timeoutMillis??e.timeoutMillis??r.timeoutMillis),concurrencyLimit:t.concurrencyLimit??e.concurrencyLimit??r.concurrencyLimit,compression:t.compression??e.compression??r.compression}}function mke(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:"none"}}class gke{_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 yke(t){return new gke(t.concurrencyLimit)}function Oke(t){return Object.prototype.hasOwnProperty.call(t,"partialSuccess")}function vke(){return{handleResponse(t){t==null||!Oke(t)||t.partialSuccess==null||Object.keys(t.partialSuccess).length===0||Xt.warn("Received Partial Success response:",JSON.stringify(t.partialSuccess))}}}class bke{_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=Xt.createComponentLogger({namespace:"OTLPExportDelegate"})}export(e,r){if(this._diagLogger.debug("items to be sent",e),this._promiseQueue.hasReachedLimit()){r({code:Os.FAILED,error:new Error("Concurrent export limit reached")});return}const n=this._serializer.serializeRequest(e);if(n==null){r({code:Os.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:Os.SUCCESS});return}else if(i.status==="failure"&&i.error){r({code:Os.FAILED,error:i.error});return}else i.status==="retryable"?r({code:Os.FAILED,error:new GN("Export failed with retryable status")}):r({code:Os.FAILED,error:new GN("Export failed with unknown error")})},i=>r({code:Os.FAILED,error:i})))}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug("shutdown started"),await this.forceFlush(),this._transport.shutdown()}}function xke(t,e){return new bke(t.transport,t.serializer,vke(),t.promiseHandler,e.timeout)}function p8(t,e,r){return xke({transport:r,serializer:e,promiseHandler:yke(t)},{timeout:t.timeoutMillis})}function HN(t){return t>=48&&t<=57?t-48:t>=97&&t<=102?t-87:t-55}function h8(t){const e=new Uint8Array(t.length/2);let r=0;for(let n=0;n<t.length;n+=2){const i=HN(t.charCodeAt(n)),o=HN(t.charCodeAt(n+1));e[r++]=i<<4|o}return e}function m8(t){const e=BigInt(1e9);return BigInt(t[0])*e+BigInt(t[1])}function Ske(t){const e=Number(BigInt.asUintN(32,t)),r=Number(BigInt.asUintN(32,t>>BigInt(32)));return{low:e,high:r}}function wke(t){const e=m8(t);return Ske(e)}function Pke(t){return m8(t).toString()}const Cke=typeof BigInt<"u"?Pke:f$e;function JN(t){return t}function $ke(t){if(t!==void 0)return h8(t)}const kke={encodeHrTime:wke,encodeSpanContext:h8,encodeOptionalSpanContext:$ke};function Eke(t){return t===void 0?kke:{encodeHrTime:Cke,encodeSpanContext:JN,encodeOptionalSpanContext:JN}}function Tke(t){return{attributes:R1(t.attributes),droppedAttributesCount:0}}function _ke(t){return{name:t.name,version:t.version}}function R1(t){return Object.keys(t).map(e=>g8(e,t[e]))}function g8(t,e){return{key:t,value:y8(e)}}function y8(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(y8)}}:e==="object"&&t!=null?{kvlistValue:{values:Object.entries(t).map(([r,n])=>g8(r,n))}}:{}}function Ake(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:R1(t.attributes),droppedAttributesCount:t.droppedAttributesCount,events:t.events.map(o=>Rke(o,e)),droppedEventsCount:t.droppedEventsCount,status:{code:n.code,message:n.message},links:t.links.map(o=>Ike(o,e)),droppedLinksCount:t.droppedLinksCount}}function Ike(t,e){return{attributes:t.attributes?R1(t.attributes):[],spanId:e.encodeSpanContext(t.context.spanId),traceId:e.encodeSpanContext(t.context.traceId),traceState:t.context.traceState?.serialize(),droppedAttributesCount:t.droppedAttributesCount||0}}function Rke(t,e){return{attributes:t.attributes?R1(t.attributes):[],name:t.name,timeUnixNano:e.encodeHrTime(t.time),droppedAttributesCount:t.droppedAttributesCount||0}}function jke(t,e){const r=Eke(e);return{resourceSpans:Dke(t,r)}}function Qke(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 Dke(t,e){const r=Qke(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 f=u.value;if(f.length>0){const h=f.map(y=>Ake(y,e));l.push({scope:_ke(f[0].instrumentationScope),spans:h,schemaUrl:f[0].instrumentationScope.schemaUrl})}u=c.next()}const d={resource:Tke(s),scopeSpans:l,schemaUrl:void 0};n.push(d),o=i.next()}return n}const Nke={serializeRequest:t=>{const e=jke(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))}},Mke=5,qke=1e3,zke=5e3,Lke=1.5,KN=.2;function Vke(){return Math.random()*(2*KN)-KN}class Xke{_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=Mke,s=qke;for(;i.status==="retryable"&&o>0;){o--;const a=Math.max(Math.min(s,zke)+Vke(),0);s=s*Lke;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 O8(t){return new Xke(t.transport)}function Uke(t){return[429,502,503,504].includes(t)}function Wke(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 Fke{_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?(Xt.debug("XHR success"),n({status:"success"})):i.status&&Uke(i.status)?n({status:"retryable",retryInMillis:Wke(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 Bke(t){return new Fke(t)}class Zke{_params;constructor(e){this._params=e}send(e){return new Promise(r=>{navigator.sendBeacon(this._params.url,new Blob([e],{type:this._params.blobType}))?(Xt.debug("SendBeacon success"),r({status:"success"})):r({status:"failure",error:new Error("SendBeacon failed")})})}shutdown(){}}function Yke(t){return new Zke(t)}function Gke(t,e){return p8(t,e,O8({transport:Bke(t)}))}function Hke(t,e){return p8(t,e,O8({transport:Yke({url:t.url,blobType:t.headers()["Content-Type"]})}))}function Jke(t){return()=>{const e={};return Object.entries(t?.()??{}).forEach(([r,n])=>{typeof n<"u"?e[r]=String(n):Xt.warn(`Header "${r}" has invalid value (${n}) and will be ignored`)}),e}}function Kke(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 eEe(t){if(t!=null)try{return new URL(t),t}catch{throw new Error(`Configuration: Could not parse user-provided export URL: '${t}'`)}}function tEe(t,e,r){return{...hke(t,e,r),headers:Kke(Jke(t.headers),e.headers,r.headers),url:eEe(t.url)??e.url??r.url,agentOptions:t.agentOptions??e.agentOptions??r.agentOptions}}function rEe(t,e){return{...mke(),headers:()=>t,url:"http://localhost:4318/"+e,agentOptions:{keepAlive:!0}}}function nEe(t,e,r){return tEe({url:t.url,timeoutMillis:t.timeoutMillis,headers:pke(t.headers),concurrencyLimit:t.concurrencyLimit},{},rEe(r,e))}function iEe(t,e,r,n){const i=!!t.headers||typeof navigator.sendBeacon!="function",o=nEe(t,r,n);return i?Gke(o,e):Hke(o,e)}class oEe extends dke{constructor(e={}){super(iEe(e,Nke,"v1/traces",{"Content-Type":"application/json"}))}}const sEe="service.name",aEe="service.version";class v8{emit(e){}}const lEe=new v8;class cEe{getLogger(e,r,n){return new v8}}const b8=new cEe;class uEe{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):lEe}}class eM{getLogger(e,r,n){var i;return(i=this.getDelegateLogger(e,r,n))!==null&&i!==void 0?i:new uEe(this,e,r,n)}getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:b8}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 dEe=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{},EO=Symbol.for("io.opentelemetry.js.api.logs"),wp=dEe;function fEe(t,e,r){return n=>n===t?e:r}const tM=1;class eA{constructor(){this._proxyLoggerProvider=new eM}static getInstance(){return this._instance||(this._instance=new eA),this._instance}setGlobalLoggerProvider(e){return wp[EO]?this.getLoggerProvider():(wp[EO]=fEe(tM,e,b8),this._proxyLoggerProvider.setDelegate(e),e)}getLoggerProvider(){var e,r;return(r=(e=wp[EO])===null||e===void 0?void 0:e.call(wp,tM))!==null&&r!==void 0?r:this._proxyLoggerProvider}getLogger(e,r,n){return this.getLoggerProvider().getLogger(e,r,n)}disable(){delete wp[EO],this._proxyLoggerProvider=new eM}}const x8=eA.getInstance();function pEe(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 hEe(t){t.forEach(e=>e.disable())}function mEe(t){const e=t.tracerProvider||mi.getTracerProvider(),r=t.meterProvider||GF.getMeterProvider(),n=t.loggerProvider||x8.getLoggerProvider(),i=t.instrumentations?.flat()??[];return pEe(i,e,r,n),()=>{hEe(i)}}let Ui=console.error.bind(console);function Pp(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 S8=(t,e,r)=>{if(!t||!t[e]){Ui("no original function "+String(e)+" to wrap");return}if(!r){Ui("no wrapper function"),Ui(new Error().stack);return}const n=t[e];if(typeof n!="function"||typeof r!="function"){Ui("original object and wrapper must be functions");return}const i=r(n,e);return Pp(i,"__original",n),Pp(i,"__unwrap",()=>{t[e]===i&&Pp(t,e,n)}),Pp(i,"__wrapped",!0),Pp(t,e,i),i},gEe=(t,e,r)=>{if(t)Array.isArray(t)||(t=[t]);else{Ui("must provide one or more modules to patch"),Ui(new Error().stack);return}if(!(e&&Array.isArray(e))){Ui("must provide one or more functions to wrap on modules");return}t.forEach(n=>{e.forEach(i=>{S8(n,i,r)})})},w8=(t,e)=>{if(!t||!t[e]){Ui("no function to unwrap."),Ui(new Error().stack);return}const r=t[e];if(!r.__unwrap)Ui("no original to unwrap to -- has "+String(e)+" already been unwrapped?");else{r.__unwrap();return}},yEe=(t,e)=>{if(t)Array.isArray(t)||(t=[t]);else{Ui("must provide one or more modules to patch"),Ui(new Error().stack);return}if(!(e&&Array.isArray(e))){Ui("must provide one or more functions to unwrap on modules");return}t.forEach(r=>{e.forEach(n=>{w8(r,n)})})};class OEe{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(e,r,n){this.instrumentationName=e,this.instrumentationVersion=r,this.setConfig(n),this._diag=Xt.createComponentLogger({namespace:e}),this._tracer=mi.getTracer(e,r),this._meter=GF.getMeter(e,r),this._logger=x8.getLogger(e,r),this._updateMetricInstruments()}_wrap=S8;_unwrap=w8;_massWrap=gEe;_massUnwrap=yEe;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 vEe extends OEe{constructor(e,r,n){super(e,r,n),this._config.enabled&&this.enable()}}class bEe{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 xEe{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":v0(),"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(f=>f.object===c);if(d){s.push(d,u);const f=a.indexOf(d);a.splice(f,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[f,h]of Object.entries(c))if(h!==void 0){const y=f.replace(/([A-Z])/g,"_$1").toLowerCase();i[`cloudevents.event_data.${u}${d}${y}`]=h}}for(const l of a){const c=`${l.object}.`;for(const[u,d]of Object.entries(l))if(d!==void 0){const f=u.replace(/([A-Z])/g,"_$1").toLowerCase();i[`cloudevents.event_data.${c}${f}`]=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();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=mi.setSpan(ka.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=ka.active(),n=e.time?new Date(e.time):new Date,i=this.tracer.startSpan(`event.${e.type}`,{attributes:this.processAttributes(e,n)},r),o=mi.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 bEe(r)}async forceFlush(){return this.tracerProvider?.forceFlush()}async shutdown(){return this.tracerProvider?.shutdown()}getKeySnakeValue=e=>e.replace(/([A-Z])/g,"_$1").toLowerCase()}class SEe extends xEe{tracerProvider=null;tracer=null;initialized=!1;constructor(){super()}initTracer(e){if(!e.collectorUrl&&!e.collectorTraceUrl)return;const r=`ses_${v0()}`,n=u8({[sEe]:e.serviceName,[aEe]:e.serviceVersion,session_id:r}),i=e.collectorTraceUrl||`${e.collectorUrl}/v1/traces`;this.tracerProvider=new uke({resource:n,spanProcessors:[new eke(new oEe({url:i,headers:{}}))]}),this.tracer=this.tracerProvider.getTracer(e.tracerName),this.tracerProvider.register(),mEe({instrumentations:e.instrumentations??[]}),this.initialized=!0}}class Sa extends vEe{sendErrorEvent;originalConsoleError;constructor(e,r){super("errors","1.0",e||{}),this.sendErrorEvent=r}static toErrorEvent(e,r){return{type:"error",payload:{handler:r,errorType:Sa.getErrorType(e),message:Sa.getErrorMessage(e),stack:Sa.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=Sa.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(Sa.toErrorEvent(e,r))}}class wEe{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 SEe,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 Sa(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_${v0()}`,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_${v0()}`,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(Sa.toErrorEvent(e,r).type,Sa.toErrorEvent(e,r).payload)}sendTabChangeMessage(){this.send("tab.change")}sendButtonClickMessage(){this.send("button.click")}sendChangeMessage(){this.send("change")}sendContentCopyMessage(){this.send("content.copy")}sendRequestSendMessage(){this.send("request.send")}sendTokenGenerateMessage(){this.send("token.generate")}sendAppLifecycleMessage(){this.send("app.lifecycle")}sendEnvironmentManagementMessage(){this.send("environment.management")}sendServerManagementMessage(){this.send("server.management")}sendInputManagementMessage(){this.send("input.management")}sendNodeManagementMessage(){this.send("node.management")}sendHistoryManagementMessage(){this.send("history.management")}sendCredentialManagementMessage(){this.send("credential.management")}sendPanelToggleMessage(){this.send("panel.toggle")}sendWorkflowRunClickMessage(e){this.send("workflow.run.click",e)}sendWorkflowRunResultMessage(){this.send("workflow.run.result")}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 j1=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],PEe="https://cors.redocly.com/";function CEe(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function rM(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 nM(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?rM(Object(r),!0).forEach(function(n){CEe(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):rM(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function wn(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 iM=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),CP=function(){return Math.random().toString(36).substring(7).split("").join(".")},Dl={INIT:"@@redux/INIT"+CP(),REPLACE:"@@redux/REPLACE"+CP(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+CP()}};function P8(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 $Ee(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(TEe(t))return"date";if(EEe(t))return"error";var r=kEe(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 kEe(t){return typeof t.constructor=="function"?t.constructor.name:null}function EEe(t){return t instanceof Error||typeof t.message=="string"&&t.constructor&&typeof t.constructor.stackTraceLimit=="number"}function TEe(t){return t instanceof Date?!0:typeof t.toDateString=="function"&&typeof t.getDate=="function"&&typeof t.setDate=="function"}function yl(t){var e=typeof t;return process.env.NODE_ENV!=="production"&&(e=$Ee(t)),e}function Q1(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"?wn(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"?wn(1):"Expected the enhancer to be a function. Instead, received: '"+yl(r)+"'");return r(Q1)(t,e)}if(typeof t!="function")throw new Error(process.env.NODE_ENV==="production"?wn(2):"Expected the root reducer to be a function. Instead, received: '"+yl(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"?wn(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(m){if(typeof m!="function")throw new Error(process.env.NODE_ENV==="production"?wn(4):"Expected the listener to be a function. Instead, received: '"+yl(m)+"'");if(l)throw new Error(process.env.NODE_ENV==="production"?wn(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");var g=!0;return c(),a.push(m),function(){if(g){if(l)throw new Error(process.env.NODE_ENV==="production"?wn(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");g=!1,c();var O=a.indexOf(m);a.splice(O,1),s=null}}}function f(m){if(!P8(m))throw new Error(process.env.NODE_ENV==="production"?wn(7):"Actions must be plain objects. Instead, the actual type was: '"+yl(m)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof m.type>"u")throw new Error(process.env.NODE_ENV==="production"?wn(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"?wn(9):"Reducers may not dispatch actions.");try{l=!0,o=i(o,m)}finally{l=!1}for(var g=s=a,v=0;v<g.length;v++){var O=g[v];O()}return m}function h(m){if(typeof m!="function")throw new Error(process.env.NODE_ENV==="production"?wn(10):"Expected the nextReducer to be a function. Instead, received: '"+yl(m));i=m,f({type:Dl.REPLACE})}function y(){var m,g=d;return m={subscribe:function(O){if(typeof O!="object"||O===null)throw new Error(process.env.NODE_ENV==="production"?wn(11):"Expected the observer to be an object. Instead, received: '"+yl(O)+"'");function b(){O.next&&O.next(u())}b();var S=g(b);return{unsubscribe:S}}},m[iM]=function(){return this},m}return f({type:Dl.INIT}),n={dispatch:f,subscribe:d,getState:u,replaceReducer:h},n[iM]=y,n}var _Ee=Q1;function mk(t){typeof console<"u"&&typeof console.error=="function"&&console.error(t);try{throw new Error(t)}catch{}}function AEe(t,e,r,n){var i=Object.keys(e),o=r&&r.type===Dl.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(!P8(t))return"The "+o+' has unexpected type of "'+yl(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===Dl.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 IEe(t){Object.keys(t).forEach(function(e){var r=t[e],n=r(void 0,{type:Dl.INIT});if(typeof n>"u")throw new Error(process.env.NODE_ENV==="production"?wn(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:Dl.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?wn(13):'The slice reducer for key "'+e+'" returned undefined when probed with a random type. '+("Don't try to handle '"+Dl.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 REe(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"&&mk('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{IEe(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=AEe(c,r,u,s);d&&mk(d)}for(var f=!1,h={},y=0;y<o.length;y++){var m=o[y],g=r[m],v=c[m],O=g(v,u);if(typeof O>"u"){var b=u&&u.type;throw new Error(process.env.NODE_ENV==="production"?wn(14):"When called with an action of type "+(b?'"'+String(b)+'"':"(unknown type)")+', the slice reducer for key "'+m+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.')}h[m]=O,f=f||O!==v}return f=f||o.length!==Object.keys(c).length,f?h:c}}function oM(t,e){return function(){return e(t.apply(this,arguments))}}function jEe(t,e){if(typeof t=="function")return oM(t,e);if(typeof t!="object"||t===null)throw new Error(process.env.NODE_ENV==="production"?wn(16):"bindActionCreators expected an object or a function, but instead received: '"+yl(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]=oM(i,e))}return r}function C8(){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 QEe(){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"?wn(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=C8.apply(void 0,a)(i.dispatch),nM(nM({},i),{},{dispatch:o})}}}function sM(){}process.env.NODE_ENV!=="production"&&typeof sM.name=="string"&&sM.name!=="isCrushed"&&mk('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 DEe=Object.freeze({__proto__:null,__DO_NOT_USE__ActionTypes:Dl,applyMiddleware:QEe,bindActionCreators:jEe,combineReducers:REe,compose:C8,createStore:Q1,legacy_createStore:_Ee});function NEe(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 MEe=NEe(DEe);MEe.compose;var qEe=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(t){return t}};function zEe(t,e,r){var n=!1,i=!1,o=Q1(function(a,l){if(!i){var c=function(g){return Array.isArray(g)&&g.findIndex(function(v){return typeof v!="string"&&typeof v!="number"})===-1};if(l.type.startsWith("SET")){var u=function(g){try{n=!0,"value"in l?g.set(l.value):g.set(ft)}finally{n=!1}};if(l.path){if(c(l.path)){l.path.length===0&&u(t);for(var d=t,f=!0,h=0,y=l.path;h<y.length;h++){var m=y[h];d[m]?d=d[m]:f=!1}f&&u(d)}}else u(t)}else l.type==="BREAKPOINT"&&r()}return t.promised||t.error?ft:t.get({noproxy:!0})},qEe({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 LEe(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=zEe(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 zt=(t=>(t.Normal="Normal",t.Edit="Edit",t.Draft="Draft",t))(zt||{});const Ym="default",$8=[{name:Ym,inputs:[],servers:[],state:zt.Normal}],k8={activeTabIdx:0,tabs:[]};var gs=(t=>(t.Idle="idle",t.Loading="loading",t.Success="success",t.Error="error",t))(gs||{});function Ea(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 gk(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(!gk(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)||!gk(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function aM(t){return Object.keys(t).forEach(e=>{t[e]===void 0&&delete t[e]}),t}function Za(){return!!window?.__TAURI__}async function Ya(t,e={},r){return window.__TAURI_INTERNALS__.invoke(t,e,r)}async function lM(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 ni={FS:"fs",WEB:"web"};async function tc(t,e={},r){return window.__TAURI_INTERNALS__.invoke(t,e,r)}var yk;(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"})(yk||(yk={}));var Ok;(function(t){t[t.Start=0]="Start",t[t.Current=1]="Current",t[t.End=2]="End"})(Ok||(Ok={}));async function vk(t,e){if(t instanceof URL&&t.protocol!=="file:")throw new TypeError("Must be a file URL.");await tc("plugin:fs|mkdir",{path:t instanceof URL?t.toString():t,options:e})}async function tA(t,e){if(t instanceof URL&&t.protocol!=="file:")throw new TypeError("Must be a file URL.");return await tc("plugin:fs|read_dir",{path:t instanceof URL?t.toString():t,options:e})}async function E8(t,e){if(t instanceof URL&&t.protocol!=="file:")throw new TypeError("Must be a file URL.");const r=await tc("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 D1(t,e){if(t instanceof URL&&t.protocol!=="file:")throw new TypeError("Must be a file URL.");return await tc("plugin:fs|read_text_file",{path:t instanceof URL?t.toString():t,options:e})}async function T8(t,e){if(t instanceof URL&&t.protocol!=="file:")throw new TypeError("Must be a file URL.");await tc("plugin:fs|remove",{path:t instanceof URL?t.toString():t,options:e})}async function _8(t,e,r){if(t instanceof URL&&t.protocol!=="file:")throw new TypeError("Must be a file URL.");await tc("plugin:fs|write_text_file",{path:t instanceof URL?t.toString():t,data:e,options:r})}async function rA(t,e){if(t instanceof URL&&t.protocol!=="file:")throw new TypeError("Must be a file URL.");return await tc("plugin:fs|exists",{path:t instanceof URL?t.toString():t,options:e})}const VEe=Object.freeze(Object.defineProperty({__proto__:null,get BaseDirectory(){return yk},get SeekMode(){return Ok},exists:rA,mkdir:vk,readDir:tA,readFile:E8,readTextFile:D1,remove:T8,writeTextFile:_8},Symbol.toStringTag,{value:"Module"}));var rm;(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"})(rm||(rm={}));async function A8(){return Ya("plugin:path|resolve_directory",{directory:rm.AppData})}async function I8(){return Ya("plugin:path|resolve_directory",{directory:rm.Desktop})}function nA(){return window.__TAURI_INTERNALS__.plugins.path.sep}async function R8(...t){return Ya("plugin:path|resolve",{paths:t})}async function Qd(...t){return Ya("plugin:path|join",{paths:t})}async function j8(t){return Ya("plugin:path|dirname",{path:t})}async function Q8(t){return Ya("plugin:path|extname",{path:t})}async function iA(t,e){return Ya("plugin:path|basename",{path:t,ext:e})}async function D8(t){return Ya("plugin:path|is_absolute",{path:t})}const XEe=Object.freeze(Object.defineProperty({__proto__:null,get BaseDirectory(){return rm},appDataDir:A8,basename:iA,desktopDir:I8,dirname:j8,extname:Q8,isAbsolute:D8,join:Qd,resolve:R8,sep:nA},Symbol.toStringTag,{value:"Module"}));class cr{static utils=null;static async getUtils(){return cr.utils||(cr.utils=Za()?await Promise.resolve().then(()=>require("./replay-tauri-path-mPN7LCO-.js")):await Promise.resolve().then(()=>Iie)),cr.utils}static async dirname(e){return(await cr.getUtils()).dirname(e)}static async join(...e){return(await cr.getUtils()).join(...e)}static async resolve(e){return(await cr.getUtils()).resolve(e)}static async isAbsolute(e){return(await cr.getUtils()).isAbsolute(e)}static async relative(e,r){return(await cr.getUtils()).relative(e,r)}static async extname(e){return(await cr.getUtils()).extname(e)}}const UEe=new Set(["node_modules"]);class cM{constructor(e){this.baseDir=e,this.initializeDirectory(e)}async initializeDirectory(e){await vk(e,{recursive:!0})}async ls(e){const r=await this.getFullPath(e);return this.getDirEntryFilesRecursively(r)}async getDirEntryFilesRecursively(e){try{const r=[],n=await tA(e);for(const i of n)if(i.isDirectory){if(UEe.has(i.name))continue;const o=await Qd(e,i.name),s=await this.getDirEntryFilesRecursively(o);r.push(...s)}else{const o=await Qd(e,i.name),s=await cr.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 D1(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=nA(),o=n.split(i).slice(0,-1).join(i);await vk(o,{recursive:!0}),await _8(n,r)}async remove(e){const r=await this.getFullPath(e);try{await T8(r)}catch(n){!n.includes("No such file or directory")&&!n.includes("forbidden path")&&console.error(n)}}async getFullPath(e){return await Qd(this.baseDir,e??"")}}class WEe{baseDir="";async ls(e=""){return[]}async get(e){return null}async set(e,r){}async remove(e){}}class FEe{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 N8{constructor(e){this.storage=e}itemIds=[];async getAbsolutePath(e){return await cr.resolve(await cr.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===zt.Draft||e.srcType!==ni.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 BEe extends N8{parse(e){return{...e.content,id:e.uri,srcType:e.type}}async stringify(e){const{id:r,srcType:n,...i}=e;return await cr.extname(r)===".json"?JSON.stringify(i,null,2):Da.dump(i)}}var zn=(t=>(t.SIMPLE="simple",t.REGEX="regex",t.JSONPATH="jsonpath",t.XPATH="xpath",t))(zn||{});function ZEe(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 YEe=`
|
|
360
360
|
`;function GEe(t,e){let r="";return e.format&&e.indentBy.length>0&&(r=YEe),M8(t,e,"",r)}function M8(t,e,r,n){let i="",o=!1;for(let s=0;s<t.length;s++){const a=t[s],l=HEe(a);if(l===void 0)continue;let c="";if(r.length===0?c=l:c=`${r}.${l}`,l===e.textNodeName){let y=a[l];JEe(c,e)||(y=e.tagValueProcessor(l,y),y=q8(y,e)),o&&(i+=n),i+=y,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 y=uM(a[":@"],e),m=l==="?xml"?"":n;let g=a[l][0][e.textNodeName];g=g.length!==0?" "+g:"",i+=m+`<${l}${g}${y}?>`,o=!0;continue}let u=n;u!==""&&(u+=e.indentBy);const d=uM(a[":@"],e),f=n+`<${l}${d}`,h=M8(a[l],e,c,u);e.unpairedTags.indexOf(l)!==-1?e.suppressUnpairedNode?i+=f+">":i+=f+"/>":(!h||h.length===0)&&e.suppressEmptyNode?i+=f+"/>":h&&h.endsWith(">")?i+=f+`>${h}${n}</${l}>`:(i+=f+">",h&&n!==""&&(h.includes("/>")||h.includes("</"))?i+=n+e.indentBy+h+n:i+=h,i+=`</${l}>`),o=!0}return i}function HEe(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 uM(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=q8(i,e),i===!0&&e.suppressBooleanAttributes?r+=` ${n.substr(e.attributeNamePrefix.length)}`:r+=` ${n.substr(e.attributeNamePrefix.length)}="${i}"`}return r}function JEe(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 q8(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 KEe={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:"&"},{regex:new RegExp(">","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function rc(t){this.options=Object.assign({},KEe,t),this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=ZEe(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=rTe),this.processTextOrObjNode=eTe,this.options.format?(this.indentate=tTe,this.tagEndChar=`>
|
|
361
361
|
`,this.newLine=`
|
|
362
362
|
`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}rc.prototype.build=function(t){return this.options.preserveOrder?GEe(t,this.options):(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t={[this.options.arrayNodeName]:t}),this.j2x(t,0,[]).val)};rc.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 f=this.j2x(d,e+1,r.concat(s));l+=f.val,this.options.attributesGroupName&&d.hasOwnProperty(this.options.attributesGroupName)&&(c+=f.attrStr)}else l+=this.processTextOrObjNode(d,s,e,r);else if(this.options.oneListGroup){let f=this.options.tagValueProcessor(s,d);f=this.replaceEntitiesValue(f),l+=f}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}};rc.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 eTe(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)}rc.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}};rc.prototype.closeTag=function(t){let e="";return this.options.unpairedTags.indexOf(t)!==-1?this.options.suppressUnpairedNode||(e="/"):this.options.suppressEmptyNode?e="/":e=`></${t}`,e};rc.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}};rc.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 tTe(t){return this.options.indentBy.repeat(t)}function rTe(t){return t.startsWith(this.options.attributeNamePrefix)&&t!==this.options.textNodeName?t.substr(this.attrPrefixLen):!1}const z8=1024;let nTe=0,lo=class{constructor(e,r){this.from=e,this.to=r}};class mt{constructor(e={}){this.id=nTe++,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=Fn.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 nm{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 iTe=Object.create(null);class Fn{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):iTe,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new Fn(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}}}}Fn.none=new Fn("",Object.create(null),0,8);class N1{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 Fn(n.name,i,n.id,n.flags):n)}return new N1(r)}}const TO=new WeakMap,dM=new WeakMap;var gr;(function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays"})(gr||(gr={}));let Or=class bk{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=nm.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 C0(this.topNode,e)}cursorAt(e,r=0,n=0){let i=TO.get(this)||this.topNode,o=new C0(i);return o.moveTo(e,r),TO.set(this,o._tree),o}get topNode(){return new go(this,0,0,null)}resolve(e,r=0){let n=im(TO.get(this)||this.topNode,e,r,!1);return TO.set(this,n),n}resolveInner(e,r=0){let n=im(dM.get(this)||this.topNode,e,r,!0);return dM.set(this,n),n}resolveStack(e,r=0){return aTe(this,e,r)}iterate(e){let{enter:r,leave:n,from:i=0,to:o=this.length}=e,s=e.mode||0,a=(s&gr.IncludeAnonymous)>0;for(let l=this.cursor(s|gr.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:aA(Fn.none,this.children,this.positions,0,this.children.length,0,this.length,(r,n,i)=>new bk(this.type,r,n,i,this.propValues),e.makeTree||((r,n,i)=>new bk(Fn.none,r,n,i)))}static build(e){return lTe(e)}};Or.empty=new Or(Fn.none,[],[],0);class oA{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 oA(this.buffer,this.index)}}class Xl{constructor(e,r,n){this.buffer=e,this.length=r,this.set=n}get type(){return Fn.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&&!(L8(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 Xl(o,s,this.set)}}function L8(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 im(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 go&&t.index<0?null:t.parent;if(!s)return t;t=s}let o=n?0:gr.IgnoreOverlays;if(n)for(let s=t,a=s.parent;a;s=a,a=s.parent)s instanceof go&&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 V8{cursor(e=0){return new C0(this,e)}getChild(e,r=null,n=null){let i=fM(this,e,r,n);return i.length?i[0]:null}getChildren(e,r=null,n=null){return fM(this,e,r,n)}resolve(e,r=0){return im(this,e,r,!1)}resolveInner(e,r=0){return im(this,e,r,!0)}matchContext(e){return xk(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 go=class Mv extends V8{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(L8(i,n,d,d+u.length)){if(u instanceof Xl){if(o&gr.ExcludeBuffers)continue;let f=u.findChild(0,u.buffer.length,r,n-d,i);if(f>-1)return new Ps(new oTe(s,u,e,d),null,f)}else if(o&gr.IncludeAnonymous||!u.type.isAnonymous||sA(u)){let f;if(!(o&gr.IgnoreMounts)&&(f=nm.get(u))&&!f.overlay)return new Mv(f.tree,d,e,s);let h=new Mv(u,d,e,s);return o&gr.IncludeAnonymous||!h.type.isAnonymous?h:h.nextChild(r<0?u.children.length-1:0,r,n,i)}}}if(o&gr.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&gr.IgnoreOverlays)&&(i=nm.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 Mv(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 fM(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 xk(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 oTe{constructor(e,r,n,i){this.parent=e,this.buffer=r,this.index=n,this.start=i}}class Ps extends V8{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 Ps(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&gr.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 Ps(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 Ps(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 Ps(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 Or(this.type,e,r,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function X8(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 go&&r.index<0?null:r.parent,i=t.slice();return n?i[e]=n:i.splice(e,1),new sTe(i,r)}class sTe{constructor(e,r){this.heads=e,this.node=r}get next(){return X8(this.heads)}}function aTe(t,e,r){let n=t.resolveInner(e,r),i=null;for(let o=n instanceof go?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=nm.get(o.tree);if(s&&s.overlay&&s.overlay[0].from<=e&&s.overlay[s.overlay.length-1].to>=e){let a=new go(s.tree,s.overlay[0].from+o.from,-1,o);(i||(i=[n])).push(im(a,e,r,!1))}}return i?X8(i):n}class C0{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 go)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 go?(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&gr.ExcludeBuffers?!1:this.enterChild(1,e,r):this.yield(this._tree.enter(e,r,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&gr.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&gr.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&gr.IncludeAnonymous||a instanceof Xl||!a.type.isAnonymous||sA(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 Ps(this.buffer,r,this.stack[i]);return this.bufferNode=new Ps(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 xk(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 xk(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 sA(t){return t.children.some(e=>e instanceof Xl||!e.type.isAnonymous||sA(e))}function lTe(t){var e;let{buffer:r,nodeSet:n,maxBufferLength:i=z8,reused:o=[],minRepeatType:s=n.types.length}=t,a=Array.isArray(r)?new oA(r,r.length):r,l=n.types,c=0,u=0;function d(x,w,C,k,R,N){let{id:D,start:U,end:F,size:G}=a,H=u,ne=c;for(;G<0;)if(a.next(),G==-1){let j=o[D];C.push(j),k.push(U-x);return}else if(G==-3){c=D;return}else if(G==-4){u=D;return}else throw new RangeError(`Unrecognized record size: ${G}`);let ce=l[D],Z,oe,M=U-x;if(F-U<=i&&(oe=g(a.pos-w,R))){let j=new Uint16Array(oe.size-oe.skip),V=a.pos-oe.size,Q=j.length;for(;a.pos>V;)Q=v(oe.start,j,Q);Z=new Xl(j,F-oe.start,n),M=oe.start-x}else{let j=a.pos-G;a.next();let V=[],Q=[],$=D>=s?D:-1,_=0,q=F;for(;a.pos>j;)$>=0&&a.id==$&&a.size>=0?(a.end<=q-i&&(y(V,Q,U,_,a.end,q,$,H,ne),_=V.length,q=a.end),a.next()):N>2500?f(U,j,V,Q):d(U,j,V,Q,$,N+1);if($>=0&&_>0&&_<V.length&&y(V,Q,U,_,U,q,$,H,ne),V.reverse(),Q.reverse(),$>-1&&_>0){let Y=h(ce,ne);Z=aA(ce,V,Q,0,V.length,0,F-U,Y,Y)}else Z=m(ce,V,Q,F-U,H-F,ne)}C.push(Z),k.push(M)}function f(x,w,C,k){let R=[],N=0,D=-1;for(;a.pos>w;){let{id:U,start:F,end:G,size:H}=a;if(H>4)a.next();else{if(D>-1&&F<D)break;D<0&&(D=G-i),R.push(U,F,G),N++,a.next()}}if(N){let U=new Uint16Array(N*4),F=R[R.length-2];for(let G=R.length-3,H=0;G>=0;G-=3)U[H++]=R[G],U[H++]=R[G+1]-F,U[H++]=R[G+2]-F,U[H++]=H;C.push(new Xl(U,R[2]-F,n)),k.push(F-x)}}function h(x,w){return(C,k,R)=>{let N=0,D=C.length-1,U,F;if(D>=0&&(U=C[D])instanceof Or){if(!D&&U.type==x&&U.length==R)return U;(F=U.prop(mt.lookAhead))&&(N=k[D]+U.length+F)}return m(x,C,k,R,N,w)}}function y(x,w,C,k,R,N,D,U,F){let G=[],H=[];for(;x.length>k;)G.push(x.pop()),H.push(w.pop()+C-R);x.push(m(n.types[D],G,H,N-R,U-N,F)),w.push(R-C)}function m(x,w,C,k,R,N,D){if(N){let U=[mt.contextHash,N];D=D?[U].concat(D):[U]}if(R>25){let U=[mt.lookAhead,R];D=D?[U].concat(D):[U]}return new Or(x,w,C,k,D)}function g(x,w){let C=a.fork(),k=0,R=0,N=0,D=C.end-i,U={size:0,start:0,skip:0};e:for(let F=C.pos-x;C.pos>F;){let G=C.size;if(C.id==w&&G>=0){U.size=k,U.start=R,U.skip=N,N+=4,k+=4,C.next();continue}let H=C.pos-G;if(G<0||H<F||C.start<D)break;let ne=C.id>=s?4:0,ce=C.start;for(C.next();C.pos>H;){if(C.size<0)if(C.size==-3)ne+=4;else break e;else C.id>=s&&(ne+=4);C.next()}R=ce,k+=G,N+=ne}return(w<0||k==x)&&(U.size=k,U.start=R,U.skip=N),U.size>4?U:void 0}function v(x,w,C){let{id:k,start:R,end:N,size:D}=a;if(a.next(),D>=0&&k<s){let U=C;if(D>4){let F=a.pos-(D-4);for(;a.pos>F;)C=v(x,w,C)}w[--C]=U,w[--C]=N-x,w[--C]=R-x,w[--C]=k}else D==-3?c=k:D==-4&&(u=k);return C}let O=[],b=[];for(;a.pos>0;)d(t.start||0,t.bufferStart||0,O,b,-1,0);let S=(e=t.length)!==null&&e!==void 0?e:O.length?b[0]+O[0].length:0;return new Or(l[t.topID],O.reverse(),b.reverse(),S)}const pM=new WeakMap;function qv(t,e){if(!t.isAnonymous||e instanceof Xl||e.type!=t)return 1;let r=pM.get(e);if(r==null){r=1;for(let n of e.children){if(n.type!=t||!(n instanceof Or)){r=1;break}r+=qv(t,n)}pM.set(e,r)}return r}function aA(t,e,r,n,i,o,s,a,l){let c=0;for(let y=n;y<i;y++)c+=qv(t,e[y]);let u=Math.ceil(c*1.5/8),d=[],f=[];function h(y,m,g,v,O){for(let b=g;b<v;){let S=b,x=m[b],w=qv(t,y[b]);for(b++;b<v;b++){let C=qv(t,y[b]);if(w+C>=u)break;w+=C}if(b==S+1){if(w>u){let C=y[S];h(C.children,C.positions,0,C.children.length,m[S]+O);continue}d.push(y[S])}else{let C=m[b-1]+y[b-1].length-x;d.push(aA(t,y,m,S,b,x,C,null,l))}f.push(x+O-o)}}return h(e,r,n,i,0),(a||l)(d,f,s)}class lA{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 Ps?this.setBuffer(e.context.buffer,e.index,r):e instanceof go&&this.map.set(e.tree,r)}get(e){return e instanceof Ps?this.getBuffer(e.context.buffer,e.index):e instanceof go?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 Ta{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 Ta(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 f=s;if(l>=f.from||d<=f.to||c){let h=Math.max(f.from,l)-c,y=Math.min(f.to,d)-c;f=h>=y?null:new Ta(h,y,f.tree,f.offset+c,a>0,!!u)}if(f&&i.push(f),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 cA=class{startParse(e,r,n){return typeof e=="string"&&(e=new cTe(e)),n=n?n.length?n.map(i=>new lo(i.from,i.to)):[new lo(0,0)]:[new lo(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 cTe{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 uTe(t){return(e,r,n,i)=>new fTe(e,t,r,n,i)}class hM{constructor(e,r,n,i,o){this.parser=e,this.parse=r,this.overlay=n,this.target=i,this.from=o}}function mM(t){if(!t.length||t.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(t))}class dTe{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 Sk=new mt({perNode:!0});class fTe{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 Or(n.type,n.children,n.positions,n.length,n.propValues.concat([[Sk,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 nm(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 mTe(this.fragments),r=null,n=null,i=new C0(new go(this.baseTree,this.ranges[0].from,0,null),gr.IncludeAnonymous|gr.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,f=u.to+c.pos;d>=i.from&&f<=i.to&&!r.ranges.some(h=>h.from<f&&h.to>d)&&r.ranges.push({from:d,to:f})}}a=!1}else if(n&&(s=pTe(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||hTe(i);let c=e.findMounts(i.from,o.parser);if(typeof o.overlay=="function")r=new dTe(o.parser,o.overlay,c,this.inner.length,i.from,i.tree,r);else{let u=OM(this.ranges,o.overlay||(i.from<i.to?[new lo(i.from,i.to)]:[]));u.length&&mM(u),(u.length||!o.overlay)&&this.inner.push(new hM(o.parser,u.length?o.parser.startParse(this.input,vM(c,u),u):o.parser.startParse(""),o.overlay?o.overlay.map(d=>new lo(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 lo(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=OM(this.ranges,r.ranges);c.length&&(mM(c),this.inner.splice(r.index,0,new hM(r.parser,r.parser.startParse(this.input,vM(r.mounts,c),c),r.ranges.map(u=>new lo(u.from-r.start,u.to-r.start)),r.target,c[0].from))),r=r.prev}n&&!--n.depth&&(n=n.prev)}}}}function pTe(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 gM(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 hTe(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,f,h,y,m){let g=r[m],v=[],O=[];gM(s,u,g,v,O,h);let b=a[g+1],S=a[g+2];l.push(v.length);let x=m?c(g+4,a[g+3],s.set.types[a[g]],b,S-b,m-1):e.toTree();return v.push(x),O.push(b-h),gM(s,a[g+3],d,v,O,h),new Or(f,v,O,y)}i.children[o]=c(0,a.length,Fn.none,0,s.length,r.length-1);for(let u of l){let d=t.tree.children[u],f=t.tree.positions[u];t.yield(new go(d,f+t.from,u,t._tree))}}class yM{constructor(e,r){this.offset=r,this.done=!1,this.cursor=e.cursor(gr.IncludeAnonymous|gr.IgnoreMounts)}moveTo(e){let{cursor:r}=this,n=e-this.offset;for(;!this.done&&r.from<n;)r.to>=e&&r.enter(n,1,gr.IgnoreOverlays|gr.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 Or)r=r.children[0];else break}return!1}}let mTe=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(Sk))!==null&&r!==void 0?r:n.to,this.inner=new yM(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(Sk))!==null&&e!==void 0?e:r.to,this.inner=new yM(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 OM(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 lo(l.from,s),l.to>a&&r.splice(o+1,0,new lo(a,l.to))):l.to>a?r[o--]=new lo(a,l.to):r.splice(o--,1))}}return n}function gTe(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 f=Math.max(l,r),h=Math.min(u,d,n);f<h&&c.push(new lo(f,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 vM(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(f=>new lo(f.from+n,f.to+n)),d=gTe(e,u,l,c);for(let f=0,h=l;;f++){let y=f==d.length,m=y?c:d[f].from;if(m>h&&r.push(new Ta(h,m,i.tree,-s,o.from>=h||o.openStart,o.to<=m||o.openEnd)),y)break;h=d[f].to}}else r.push(new Ta(l,c,i.tree,-s,o.from>=s||o.openStart,o.to<=a||o.openEnd))}return r}class $0{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 $0(e,[],r,n,n,0,[],0,i?new bM(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,f=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,f+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 $0(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 yTe(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 bM(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 bM{constructor(e,r){this.tracker=e,this.context=r,this.hash=e.strict?e.hash(r):0}}class yTe{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 k0{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 k0(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 k0(this.stack,this.pos,this.index)}}function Fp(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 zv{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const xM=new zv;class OTe{constructor(e,r){this.input=e,this.ranges=r,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=xM,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=xM,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 Dd{constructor(e,r){this.data=e,this.id=r}token(e,r){let{parser:n}=r.p;U8(this.data,e,r,this.id,n.data,n.tokenPrecTable)}}Dd.prototype.contextual=Dd.prototype.fallback=Dd.prototype.extend=!1;class E0{constructor(e,r,n){this.precTable=r,this.elseToken=n,this.data=typeof e=="string"?Fp(e):e}token(e,r){let n=e.pos,i=0;for(;;){let o=e.next<0,s=e.resolveOffset(1,1);if(U8(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))}}E0.prototype.contextual=Dd.prototype.fallback=Dd.prototype.extend=!1;class Wr{constructor(e,r={}){this.token=e,this.contextual=!!r.contextual,this.fallback=!!r.fallback,this.extend=!!r.extend}}function U8(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 y=t[h];if(l.allows(y)&&(e.token.value==-1||e.token.value==y||vTe(y,e.token.value,i,o))){e.acceptToken(y);break}}let u=e.next,d=0,f=t[s+2];if(e.next<0&&f>d&&t[c+f*3-3]==65535){s=t[c+f*3-1];continue e}for(;d<f;){let h=d+f>>1,y=c+h+(h<<1),m=t[y],g=t[y+1]||65536;if(u<m)f=h;else if(u>=g)d=h+1;else{s=t[y+2],e.advance();continue e}}break}}function SM(t,e,r){for(let n=e,i;(i=t[n])!=65535;n++)if(i==r)return n-e;return-1}function vTe(t,e,r,n){let i=SM(r,n,e);return i<0||SM(r,n,t)<i}const Ai=typeof process<"u"&&process.env&&/\bparse\b/.test(process.env.LOG);let $P=null;function wM(t,e,r){let n=t.cursor(gr.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 bTe{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?wM(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?wM(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 Or){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 xTe{constructor(e,r){this.stream=r,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(n=>new zv)}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 f=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>f))break}}for(;this.actions.length>r;)this.actions.pop();return l&&e.setLookAhead(l),!n&&e.pos==this.stream.end&&(n=new zv,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 zv,{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=va(a,c+2);else{i==0&&a[c+1]==2&&(i=this.putAction(va(a,c+2),r,n,i));break}a[c]==r&&(i=this.putAction(va(a,c+1),r,n,i))}return i}}let STe=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 OTe(r,i),this.tokens=new xTe(e,this.stream),this.topTerm=e.top[1];let{from:o}=i[0];this.stacks=[$0.start(this,e.top[0],o)],this.fragments=n.length&&this.stream.end-o>e.bufferLength*4?new bTe(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&&PTe(i);if(s)return Ai&&console.log("Finish with "+this.stackID(s)),this.stackToTree(s);if(this.parser.strict)throw Ai&&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 Ai&&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=Ai?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 f=this.parser.nodeSet.types[d.type.id]==d.type?o.getGoto(e.state,d.type.id):-1;if(f>-1&&d.length&&(!c||(d.prop(mt.contextHash)||0)==u))return e.useNode(d,f),Ai&&console.log(s+this.stackID(e)+` (via reuse of ${o.getName(d.type.id)})`),!0;if(!(d instanceof Or)||d.children.length==0||d.positions[0]>0)break;let h=d.children[0];if(h instanceof Or&&d.positions[0]==0)d=h;else break}}let a=o.stateSlot(e.state,4);if(a>0)return e.reduce(a),Ai&&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++],f=l[c++],h=c==l.length||!n,y=h?e:e.split(),m=this.tokens.mainToken;if(y.apply(u,d,m?m.start:y.pos,f),Ai&&console.log(s+this.stackID(y)+` (via ${(u&65536)==0?"shift":`reduce of ${o.getName(u&65535)}`} for ${o.getName(d)} @ ${i}${y==e?"":", split"})`),h)return!0;y.pos>i?r.push(y):n.push(y)}return!1}advanceFully(e,r){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return PM(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=Ai?this.stackID(a)+" -> ":"";if(a.deadEnd&&(o||(o=!0,a.restart(),Ai&&console.log(u+this.stackID(a)+" (restarted)"),this.advanceFully(a,n))))continue;let d=a.split(),f=u;for(let h=0;d.forceReduce()&&h<10&&(Ai&&console.log(f+this.stackID(d)+" (via force-reduce)"),!this.advanceFully(d,n));h++)Ai&&(f=this.stackID(d)+" -> ");for(let h of a.recoverByInsert(l))Ai&&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),Ai&&console.log(u+this.stackID(a)+` (via recover-delete ${this.parser.getName(l)})`),PM(a,n)):(!i||i.score<a.score)&&(i=a)}return i}stackToTree(e){return e.close(),Or.build({buffer:k0.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=($P||($P=new WeakMap)).get(e);return r||$P.set(e,r=String.fromCodePoint(this.nextStackID++)),r+e}};function PM(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 wTe{constructor(e,r,n){this.source=e,this.flags=r,this.disabled=n}allows(e){return!this.disabled||this.disabled[e]==0}}const kP=t=>t;class Gm{constructor(e){this.start=e.start,this.shift=e.shift||kP,this.reduce=e.reduce||kP,this.reuse=e.reuse||kP,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class zo extends cA{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 f=-u;f>0;f--)o(a[c++],l,d);c++}}}this.nodeSet=new N1(r.map((a,l)=>Fn.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=z8;let s=Fp(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(CM),this.states=Fp(e.states,Uint32Array),this.data=Fp(e.stateData),this.goto=Fp(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(a=>typeof a=="number"?new Dd(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 STe(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=va(n,o+2)];else{if(n[o+1]==2)return va(n,o+2);break}if(s==r||s==0)return va(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=va(this.data,o+2);else break;i=r(va(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=va(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(zo.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]=CM(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 wTe(e,n,i)}static deserialize(e){return new zo(e)}}function va(t,e){return t[e]|t[e+1]<<16}function PTe(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 CM(t){if(t.external){let e=t.extend?1:0;return(r,n)=>t.external(r,n)<<1|e}return t.get}let CTe=0,ba=class wk{constructor(e,r,n,i){this.name=e,this.set=r,this.base=n,this.modified=i,this.id=CTe++}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 wk&&(r=e),r?.base)throw new Error("Can not derive from a modified tag");let i=new wk(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 T0(e);return n=>n.modified.indexOf(r)>-1?n:T0.get(n.base||n,n.modified.concat(r).sort((i,o)=>i.id-o.id))}},$Te=0;class T0{constructor(e){this.name=e,this.instances=[],this.id=$Te++}static get(e,r){if(!r.length)return e;let n=r[0].instances.find(a=>a.base==e&&kTe(r,a.modified));if(n)return n;let i=[],o=new ba(e.name,i,e,r);for(let a of r)a.instances.push(o);let s=ETe(r);for(let a of e.set)if(!a.modified.length)for(let l of s)i.push(T0.get(a,l));return o}}function kTe(t,e){return t.length==e.length&&t.every((r,n)=>r==e[n])}function ETe(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 Ga(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 f=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!f)throw new RangeError("Invalid path: "+i);if(o.push(f[0]=="*"?"":f[0][0]=='"'?JSON.parse(f[0]):f[0]),d+=f[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 _0(n,s,l>0?o.slice(0,l):null);e[c]=u.sort(e[c])}}return W8.add(e)}const W8=new mt;class _0{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}}_0.empty=new _0([],2,null);function F8(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 TTe(t,e){let r=null;for(let n of t){let i=n.style(e);i&&(r=r?r+" "+i:i)}return r}function _Te(t,e,r,n=0,i=t.length){let o=new ATe(n,Array.isArray(e)?e:[e],r);o.highlightRange(t.cursor(),n,i,"",o.highlighters),o.flush(i)}class ATe{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=ITe(e)||_0.empty,d=TTe(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 f=e.tree&&e.tree.prop(mt.mounted);if(f&&f.overlay){let h=e.node.enter(f.overlay[0].from+a,1),y=this.highlighters.filter(g=>!g.scope||g.scope(f.tree.type)),m=e.firstChild();for(let g=0,v=a;;g++){let O=g<f.overlay.length?f.overlay[g]:null,b=O?O.from+a:l,S=Math.max(r,v),x=Math.min(n,b);if(S<x&&m)for(;e.from<x&&(this.highlightRange(e,S,x,i,o),this.startSpan(Math.min(x,e.to),c),!(e.to>=b||!e.nextSibling())););if(!O||b>n)break;v=O.to+a,v>r&&(this.highlightRange(h.cursor(),Math.max(r,O.from+a),Math.min(n,v),"",y),this.startSpan(Math.min(n,v),c))}m&&e.parent()}else if(e.firstChild()){f&&(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 ITe(t){let e=t.type.prop(W8);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const Ne=ba.define,_O=Ne(),Ol=Ne(),$M=Ne(Ol),kM=Ne(Ol),vl=Ne(),AO=Ne(vl),EP=Ne(vl),hs=Ne(),Pc=Ne(hs),ss=Ne(),as=Ne(),Pk=Ne(),Cp=Ne(Pk),IO=Ne(),X={comment:_O,lineComment:Ne(_O),blockComment:Ne(_O),docComment:Ne(_O),name:Ol,variableName:Ne(Ol),typeName:$M,tagName:Ne($M),propertyName:kM,attributeName:Ne(kM),className:Ne(Ol),labelName:Ne(Ol),namespace:Ne(Ol),macroName:Ne(Ol),literal:vl,string:AO,docString:Ne(AO),character:Ne(AO),attributeValue:Ne(AO),number:EP,integer:Ne(EP),float:Ne(EP),bool:Ne(vl),regexp:Ne(vl),escape:Ne(vl),color:Ne(vl),url:Ne(vl),keyword:ss,self:Ne(ss),null:Ne(ss),atom:Ne(ss),unit:Ne(ss),modifier:Ne(ss),operatorKeyword:Ne(ss),controlKeyword:Ne(ss),definitionKeyword:Ne(ss),moduleKeyword:Ne(ss),operator:as,derefOperator:Ne(as),arithmeticOperator:Ne(as),logicOperator:Ne(as),bitwiseOperator:Ne(as),compareOperator:Ne(as),updateOperator:Ne(as),definitionOperator:Ne(as),typeOperator:Ne(as),controlOperator:Ne(as),punctuation:Pk,separator:Ne(Pk),bracket:Cp,angleBracket:Ne(Cp),squareBracket:Ne(Cp),paren:Ne(Cp),brace:Ne(Cp),content:hs,heading:Pc,heading1:Ne(Pc),heading2:Ne(Pc),heading3:Ne(Pc),heading4:Ne(Pc),heading5:Ne(Pc),heading6:Ne(Pc),contentSeparator:Ne(hs),list:Ne(hs),quote:Ne(hs),emphasis:Ne(hs),strong:Ne(hs),link:Ne(hs),monospace:Ne(hs),strikethrough:Ne(hs),inserted:Ne(),deleted:Ne(),changed:Ne(),invalid:Ne(),meta:IO,documentMeta:Ne(IO),annotation:Ne(IO),processingInstruction:Ne(IO),definition:ba.defineModifier("definition"),constant:ba.defineModifier("constant"),function:ba.defineModifier("function"),standard:ba.defineModifier("standard"),local:ba.defineModifier("local"),special:ba.defineModifier("special")};for(let t in X){let e=X[t];e instanceof ba&&(e.name=t)}F8([{tag:X.link,class:"tok-link"},{tag:X.heading,class:"tok-heading"},{tag:X.emphasis,class:"tok-emphasis"},{tag:X.strong,class:"tok-strong"},{tag:X.keyword,class:"tok-keyword"},{tag:X.atom,class:"tok-atom"},{tag:X.bool,class:"tok-bool"},{tag:X.url,class:"tok-url"},{tag:X.labelName,class:"tok-labelName"},{tag:X.inserted,class:"tok-inserted"},{tag:X.deleted,class:"tok-deleted"},{tag:X.literal,class:"tok-literal"},{tag:X.string,class:"tok-string"},{tag:X.number,class:"tok-number"},{tag:[X.regexp,X.escape,X.special(X.string)],class:"tok-string2"},{tag:X.variableName,class:"tok-variableName"},{tag:X.local(X.variableName),class:"tok-variableName tok-local"},{tag:X.definition(X.variableName),class:"tok-variableName tok-definition"},{tag:X.special(X.variableName),class:"tok-variableName2"},{tag:X.definition(X.propertyName),class:"tok-propertyName tok-definition"},{tag:X.typeName,class:"tok-typeName"},{tag:X.namespace,class:"tok-namespace"},{tag:X.className,class:"tok-className"},{tag:X.macroName,class:"tok-macroName"},{tag:X.propertyName,class:"tok-propertyName"},{tag:X.operator,class:"tok-operator"},{tag:X.comment,class:"tok-comment"},{tag:X.meta,class:"tok-meta"},{tag:X.invalid,class:"tok-invalid"},{tag:X.punctuation,class:"tok-punctuation"}]);const RTe=Ga({String:X.string,Number:X.number,"True False":X.bool,PropertyName:X.propertyName,Null:X.null,",":X.separator,"[ ]":X.squareBracket,"{ }":X.brace}),jTe=zo.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:[RTe],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 Ck=[],B8=[];(()=>{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?B8:Ck).push(r=r+t[e])})();function QTe(t){if(t<768)return!1;for(let e=0,r=Ck.length;;){let n=e+r>>1;if(t<Ck[n])r=n;else if(t>=B8[n])e=n+1;else return!0;if(e==r)return!1}}function EM(t){return t>=127462&&t<=127487}const TM=8205;function DTe(t,e,r=!0,n=!0){return(r?Z8:NTe)(t,e,n)}function Z8(t,e,r){if(e==t.length)return e;e&&Y8(t.charCodeAt(e))&&G8(t.charCodeAt(e-1))&&e--;let n=TP(t,e);for(e+=_M(n);e<t.length;){let i=TP(t,e);if(n==TM||i==TM||r&&QTe(i))e+=_M(i),n=i;else if(EM(i)){let o=0,s=e-2;for(;s>=0&&EM(TP(t,s));)o++,s-=2;if(o%2==0)break;e+=2}else break}return e}function NTe(t,e,r){for(;e>0;){let n=Z8(t,e-2,r);if(n<e)return n;e--}return 0}function TP(t,e){let r=t.charCodeAt(e);if(!G8(r)||e+1==t.length)return r;let n=t.charCodeAt(e+1);return Y8(n)?(r-55296<<10)+(n-56320)+65536:r}function Y8(t){return t>=56320&&t<57344}function G8(t){return t>=55296&&t<56320}function _M(t){return t<65536?1:2}class Dt{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]=sf(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),xs.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]=sf(this,e,r);let n=[];return this.decompose(e,r,n,0),xs.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 fh(this),o=new fh(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 fh(this,e)}iterRange(e,r=this.length){return new H8(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 J8(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]?Dt.empty:e.length<=32?new Vr(e):xs.from(Vr.split(e,[]))}}class Vr extends Dt{constructor(e,r=MTe(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 qTe(i,a,n,s);i=a+1,n++}}decompose(e,r,n,i){let o=e<=0&&r>=this.length?this:new Vr(AM(this.text,e,r),Math.min(r,this.length)-Math.max(0,e));if(i&1){let s=n.pop(),a=Lv(o.text,s.text.slice(),0,o.length);if(a.length<=32)n.push(new Vr(a,s.length+o.length));else{let l=a.length>>1;n.push(new Vr(a.slice(0,l)),new Vr(a.slice(l)))}}else n.push(o)}replace(e,r,n){if(!(n instanceof Vr))return super.replace(e,r,n);[e,r]=sf(this,e,r);let i=Lv(this.text,Lv(n.text,AM(this.text,0,e)),r),o=this.length+n.length-(r-e);return i.length<=32?new Vr(i,o):xs.from(Vr.split(i,[]),o)}sliceString(e,r=this.length,n=`
|
|
@@ -421,7 +421,7 @@ $3`);return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}}function MNe(t){return t.
|
|
|
421
421
|
`];let v=-1,O=0;for(const b of g){const S=t.indexOf(b,u);if(S!==-1&&S<l.start){v=S,O=b.length;break}}if(v!==-1)d=v+O;else{const b=[`
|
|
422
422
|
`,`\r
|
|
423
423
|
`];for(const S of b){const x=t.indexOf(S,u);if(x!==-1&&x<l.start){d=x+S.length;break}}}}const m=l.start;e.push({boundaryStart:a.start,boundaryEnd:a.end,headersStart:c,headersEnd:u,bodyStart:d,bodyEnd:m,contentType:f})}return e}const SMe=()=>vr.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=xMe(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 y of l)t.visibleRanges.some(g=>Math.max(g.from,y.start)<Math.min(g.to,y.end))&&r.push({from:y.start,to:y.end,value:n});const u=/^([a-zA-Z0-9\-]+):\s*(.+?)(?:\r?\n|$)/gm;for(const y of s){u.lastIndex=y.headersStart;let m;for(;(m=u.exec(e))!==null&&m.index<y.headersEnd;){const v=m.index+m[1].length+1+(m[2].match(/^\s*/)?.[0]?.length||0),O=m.index+m[0].length-(m[0].match(/\r?\n$/)?.[0]?.length||0);t.visibleRanges.some(S=>Math.max(S.from,v)<Math.min(S.to,O))&&O>v&&r.push({from:v,to:O,value:i})}}const d=/\[Binary\s+Data\]/gi;let f;for(;(f=d.exec(e))!==null;){const y=f.index,m=f[0].length;t.visibleRanges.some(v=>Math.max(v.from,y)<Math.min(v.to,y+m))&&r.push({from:y,to:y+m,value:o})}const h=Me.mark({attributes:{style:"color: var(--color-blue-8);"}});for(const y of s)if(y.contentType?.includes("json")){const m=e.slice(y.bodyStart,y.bodyEnd),g=m.trim();if(!g)continue;const v=m.length-m.trimStart().length,O=y.bodyStart+v;let b;try{const x=xf.create("inmemory://model.json","json",0,g),C=OMe.parseJSONDocument(x)?.root;b=vMe(C)?C:void 0}catch{b=void 0}if(!b)continue;const S=bMe(b);for(const x of S){const w=O+x.from,C=O+x.to;if(!t.visibleRanges.some(D=>Math.max(D.from,w)<Math.min(D.to,C))||!(e[w]==='"'&&e[C-1]==='"'))continue;const R=w+1,N=C-1;N<=R||r.push({from:R,to:N,value:h})}}return Me.set(r,!0)}},{decorations:t=>t.decorations}),wMe=()=>vr.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(f=>Math.max(f.from,l)<Math.min(f.to,u))||r.push({from:l,to:u,value:n})}return Me.set(r,!0)}},{decorations:t=>t.decorations}),PMe=H1({});function CMe(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 $Me(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 hC=()=>vr.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,f=l;l.startsWith("0x1E")?(d=c+4,f=l.substring(4),r.push({from:c,to:c+4,value:i})):l.charCodeAt(0)===30&&(d=c+1,f=l.substring(1),r.push({from:c,to:c+1,value:i})),l.endsWith("0x0A")?(f=f.substring(0,f.length-4),r.push({from:u-4,to:u,value:i})):l.charCodeAt(l.length-1)===10&&(f=f.substring(0,f.length-1),r.push({from:u-1,to:u,value:i}));let h;try{const m=xf.create("inmemory://model.json","json",0,f),v=PMe.parseJSONDocument(m)?.root;h=CMe(v)?v:void 0}catch{h=void 0}if(!h){s=u+(e[s+l.length]==="\r"?2:1);continue}const y=$Me(h);for(const m of y){const g=d+m.from,v=d+m.to;if(!t.visibleRanges.some(x=>Math.max(x.from,g)<Math.min(x.to,v))||!(e[g]==='"'&&e[v-1]==='"'))continue;const b=g+1,S=v-1;S<=b||r.push({from:b,to:S,value:n})}s=u+(e[s+l.length]==="\r"?2:1)}return Me.set(r,!0)}},{decorations:t=>t.decorations}),Lf={[Ur.Text]:{name:"Text",extensions:[Qe.lineWrapping],stateExtensions:[YE]},[Ur.JSON]:{name:"JSON",extensions:[XZ(),JQe(cMe(),{delay:0,needsRefresh:t=>t.transactions.some(e=>e.effects.some(r=>r.is(WG)))}),VZ.data.of({autocomplete:dMe()}),uMe],stateExtensions:[lMe,yMe]},[Ur.XML]:{name:"XML",extensions:[zQe()],stateExtensions:[YE]}},FG={[Ur.MultipartMixed]:{name:"Multipart Mixed",extensions:[Qe.lineWrapping],stateExtensions:[SMe]},[Ur.JSONL]:{name:"JSON Lines",extensions:[Qe.lineWrapping],stateExtensions:[hC]},[Ur.NDJSON]:{name:"NDJSON",extensions:[XZ(),Qe.lineWrapping],stateExtensions:[hC]},[Ur.JSONSeq]:{name:"JSON Sequence",extensions:[Qe.lineWrapping],stateExtensions:[hC]},[Ur.TextStream]:{name:"SSE",extensions:[Qe.lineWrapping],stateExtensions:[wMe]}},BG={[Ur.Image]:{name:"Image",extensions:[],stateExtensions:[]}},ZG={[Ur.HTML]:{name:"HTML",extensions:[gQe()],stateExtensions:[YE]}},Hp={...Lf,...BG,...ZG,...FG},rI={...Lf,...BG,...ZG},Lc={...Lf,...FG},YG={[Ur.FormData]:{name:"form-data",extensions:void 0},[Ur["application/x-www-form-urlencoded"]]:{name:"x-www-form-urlencoded",extensions:void 0}},GG={[Ur.Binary]:{name:"Binary",extensions:void 0}},su={...Lf,...YG,...GG},kMe=Object.keys(Lf),ix=Object.keys(YG),HG=Object.keys(GG);function JG(t=[],e){const r={};return t.forEach(n=>{const i=String(n[e]);r[i]||(r[i]=[]),r[i].push(n)}),r}const sg={active:!0,key:"",value:""};function Al(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})),Sr(e.in)]}function ag(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 po(){return{id:crypto.randomUUID(),...sg}}function bi(){return{id:crypto.randomUUID(),...sg,description:""}}function Sr(t){return{...sg,id:crypto.randomUUID(),in:t}}function Ra(){return{id:crypto.randomUUID(),...sg,type:"text",files:null}}function nI(){return{id:crypto.randomUUID(),...sg,sendIn:Xn.URL}}function mC(t){return t.map(e=>({id:crypto.randomUUID(),key:"",value:e,active:!0}))}function K1(t,e){return t.filter(r=>r.active&&r.value).map(({value:r})=>(e?sr(r,e):r).trim())}function ql(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 EMe(t,e){return t.map(({value:r,...n})=>({...n,value:sr(r,e)}))}function TMe(t,e){if(!t.startsWith("$components.parameters."))return null;const r=t.replace("$components.parameters.","");return r&&e[r]||null}function Rr(t=[],e={}){const r=[];for(const n of t)if(Rl(n)){const i=TMe(n.reference,e);i&&r.push({...i,active:n.active,value:n.value||i.value})}else r.push(n);return r}function bl(t){return Object.entries(t).map(([e,r])=>({id:crypto.randomUUID(),key:"",value:e,active:!0,description:r}))}function _Me(t){return t.replace(/{/g,"{{").replace(/}/g,"}}")}const Yq={documentedOAuth2Types:[],grantType:Se.ClientCredentials,authRequestExtraParams:[po()],tokenRequestExtraParams:[nI()],[Se.ClientCredentials]:{clientId:"",clientSecret:"",clientAssertion:"",tokenUrl:"",scopes:[bi()],accessToken:""},[Se.ClientCredentialsWithJwtAssertion]:{clientId:"",clientSecret:"",clientAssertion:"",tokenUrl:"",scopes:[bi()],accessToken:""},[Se.AuthorizationCode]:{clientId:"",clientSecret:"",tokenUrl:"",authorizationUrl:"",callbackUrl:"",availableScopes:[],scopes:[bi()],codeVerifier:"",codeChallenge:"",accessToken:""},[Se.AuthorizationCodeWithPkce]:{clientId:"",clientSecret:"",tokenUrl:"",authorizationUrl:"",callbackUrl:"",availableScopes:[],scopes:[bi()],codeVerifier:"",codeChallenge:"",accessToken:""},[Se.Implicit]:{clientId:"",authorizationUrl:"",callbackUrl:"",availableScopes:[],scopes:[bi()],accessToken:""},[Se.Password]:{username:"",password:"",clientId:"",clientSecret:"",tokenUrl:"",accessToken:"",scopes:[bi()]}},AMe={securityType:be.NoAuth,securitySchemeId:null,[be.BasicAuth]:{username:"",password:""},[be.JWT]:{token:""},[be.DigestAuth]:{username:"",password:"",nc:"00000001",realm:"",nonce:"",opaque:"",qop:"",algorithm:"",cnonce:""},[be.APIKey]:{location:Xi.Header,name:"",key:""},[be.OAuth2]:Yq,[be.OpenIDConnect]:{...Yq,openIdConnectUrl:"",userInfoUrl:""}},GE="urn:ietf:params:oauth:client-assertion-type:jwt-bearer",IMe={[zn.SIMPLE]:{condition:"",type:zn.SIMPLE},[zn.REGEX]:{condition:"",type:zn.REGEX,context:""},[zn.JSONPATH]:{condition:"",type:zn.JSONPATH,context:""},[zn.XPATH]:{condition:"",type:zn.XPATH,context:""}};function ox(){return structuredClone({type:cn.Text,content:"",activeExampleName:"",formData:{"multipart/form-data":[Ra()],"application/x-www-form-urlencoded":[Ra()]},binary:null})}const RMe={method:"GET",url:"",security:[Go()],body:ox(),queryParameters:[po()],headers:[po()],cookies:[po()],pathParameters:[po()]};function KG(){return structuredClone(RMe)}function Go(){return Ea(AMe)}function jMe(t){return Ea({id:crypto.randomUUID(),...IMe[t]})}function eH(t,e,r){for(const n of r){const i=Gq(t,n),o=Gq(e,n);if(typeof i=="object"&&typeof o=="object"){if(!eH(i,o,r))return!1}else if(i!==o)return!1}return!0}function Gq(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 QMe(t,e){return t.length===e.length&&t.sort().join()===e.sort().join()}function DMe(t,e){return t.every(r=>e.includes(r))}function NMe(t){switch(t){case"query":return Xi.Query;case"cookie":return Xi.Cookie;case"header":return Xi.Header;default:return}}function MMe(t,e,r){const{security:n}=e,i=SPe(t);if(!r)return!1;const o=iI(r),s=o.map(u=>u.securityType),a=n.map(u=>u.securityType);if(!QMe(s,a))return!0;let c=[];return n.forEach(u=>{const d=u.securityType,f=u[be.OAuth2]?.grantType,h=s.includes(d),y=o.find(O=>O.securityType===d),m=!y||eH(u,y,zMe(d,f)),g=qMe(u,d,u[be.OAuth2]?.grantType,i),v=!!(h&&y&&m&&g);c.push(!r.security?.length||v)}),c.includes(!1)}function qMe(t,e,r,n){if(e===be.OAuth2&&(r===Se.AuthorizationCode||r===Se.AuthorizationCodeWithPkce||r===Se.Implicit)){const i=t[be.OAuth2][r]?.availableScopes,o=K1(t[be.OAuth2][r]?.scopes,n);return DMe(o,i)}return!0}function zMe(t,e){return t===be.APIKey?[`${be.APIKey}/name`,`${be.APIKey}/location`]:t===be.OAuth2?[`${be.OAuth2}/grantType`,...LMe(e)]:t===be.OpenIDConnect?[`${be.OpenIDConnect}/openIdConnectUrl`]:[]}function LMe(t){return t===Se.ClientCredentials?[`${be.OAuth2}/${Se.ClientCredentials}/tokenUrl`]:t===Se.Password?[`${be.OAuth2}/${Se.Password}/tokenUrl`]:t===Se.Implicit?[`${be.OAuth2}/${Se.Implicit}/authorizationUrl`]:t===Se.AuthorizationCode?[`${be.OAuth2}/${Se.AuthorizationCode}/tokenUrl`,`${be.OAuth2}/${Se.AuthorizationCode}/authorizationUrl`]:t===Se.AuthorizationCodeWithPkce?[`${be.OAuth2}/${Se.AuthorizationCodeWithPkce}/tokenUrl`,`${be.OAuth2}/${Se.AuthorizationCodeWithPkce}/authorizationUrl`]:[]}function VMe(t){return t.map(e=>{const r=e.map(n=>n.id).join("_");return e.map(n=>({...n,schemeId:r}))})}function XMe(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(oI(s))}),{id:i,security:o}});return e.length?r:[]}function UMe(t,e){const r=t.security||[];return r?.length?iH(r).map((n,i)=>oI(n)):[]}function iI(t){const r=(t.security||[])[0];return r?r.map(n=>oI(n)):[Go()]}function oI(t,e){const r={...Go(),securitySchemeId:t.id},n=eS(t);r.securityType=n;const i=t.id;if(t.id&&n!==be.NoAuth&&(r[n].schemeName=t.id),n===be.BasicAuth&&(r[be.BasicAuth].username||(r[be.BasicAuth].username=Er(i+L.SecurityVariablesEnvSuffix.Username)),r[be.BasicAuth].password||(r[be.BasicAuth].password=Er(i+L.SecurityVariablesEnvSuffix.Password))),n===be.DigestAuth&&(r[be.DigestAuth].username||(r[be.DigestAuth].username=Er(i+L.SecurityVariablesEnvSuffix.Username)),r[be.DigestAuth].password||(r[be.DigestAuth].password=Er(i+L.SecurityVariablesEnvSuffix.Password))),n===be.JWT&&!r[be.JWT].token&&(r[be.JWT].token=Er(i+L.SecurityVariablesEnvSuffix.JWTToken)),n===be.APIKey&&!r[be.APIKey].key){r[be.APIKey].name=t.name||"",r[be.APIKey].key=Er(i+L.SecurityVariablesEnvSuffix.APIKey);const o=NMe(t.in);o&&(r[be.APIKey].location=o)}if(n===be.OAuth2){const o=aI(t),s=Er(i+L.SecurityVariablesEnvSuffix.Token),a=r[be.OAuth2];a.grantType=o[0],o.forEach(l=>{l===Se.AuthorizationCode&&!a[Se.AuthorizationCode].accessToken&&(a[Se.AuthorizationCode].accessToken=s,a[Se.AuthorizationCode].clientId=Er(i+L.SecurityVariablesEnvSuffix.ClientId),a[Se.AuthorizationCode].authorizationUrl=t.flows?.authorizationCode?.authorizationUrl||"",a[Se.AuthorizationCode].tokenUrl=t.flows?.authorizationCode?.tokenUrl||"",a[Se.AuthorizationCode].clientSecret=Er(i+L.SecurityVariablesEnvSuffix.ClientSecret),a[Se.AuthorizationCode].availableScopes=Object.keys(t.flows?.authorizationCode?.scopes||{})||[],a[Se.AuthorizationCode].scopes=[...bl(t.flows?.authorizationCode?.scopes||{})||[],bi()]),l===Se.AuthorizationCodeWithPkce&&!a[Se.AuthorizationCodeWithPkce].accessToken&&(a[Se.AuthorizationCodeWithPkce].accessToken=s,a[Se.AuthorizationCodeWithPkce].clientId=Er(i+L.SecurityVariablesEnvSuffix.ClientId),a[Se.AuthorizationCodeWithPkce].authorizationUrl=t.flows?.authorizationCode?.authorizationUrl||"",a[Se.AuthorizationCodeWithPkce].tokenUrl=t.flows?.authorizationCode?.tokenUrl||"",a[Se.AuthorizationCodeWithPkce].clientSecret=Er(i+L.SecurityVariablesEnvSuffix.ClientSecret),a[Se.AuthorizationCodeWithPkce].availableScopes=Object.keys(t.flows?.authorizationCode?.scopes||{})||[],a[Se.AuthorizationCodeWithPkce].scopes=[...bl(t.flows?.authorizationCode?.scopes||{}),bi()]),l===Se.ClientCredentials&&!a[Se.ClientCredentials].accessToken&&(a[Se.ClientCredentials].accessToken=s,a[Se.ClientCredentials].clientId=Er(i+L.SecurityVariablesEnvSuffix.ClientId),a[Se.ClientCredentials].clientSecret=Er(i+L.SecurityVariablesEnvSuffix.ClientSecret),a[Se.ClientCredentials].tokenUrl=t.flows?.clientCredentials?.tokenUrl||"",a[Se.ClientCredentials].scopes=[...bl(t.flows?.clientCredentials?.scopes||{}),bi()]),l===Se.ClientCredentialsWithJwtAssertion&&!a[Se.ClientCredentialsWithJwtAssertion].accessToken&&(a[Se.ClientCredentialsWithJwtAssertion].accessToken=s,a[Se.ClientCredentialsWithJwtAssertion].clientId=Er(i+L.SecurityVariablesEnvSuffix.ClientId),a[Se.ClientCredentialsWithJwtAssertion].clientAssertion=Er(i+L.SecurityVariablesEnvSuffix.ClientAssertion),a[Se.ClientCredentialsWithJwtAssertion].scopes=[...bl(t.flows?.clientCredentials?.scopes||{}),bi()]),l===Se.Implicit&&!a[Se.Implicit].accessToken&&(a[Se.Implicit].accessToken=s,a[Se.Implicit].clientId=Er(i+L.SecurityVariablesEnvSuffix.ClientId),a[Se.Implicit].authorizationUrl=t.flows?.implicit?.authorizationUrl||"",a[Se.Implicit].availableScopes=Object.keys(t.flows?.implicit?.scopes||{})||[],a[Se.Implicit].scopes=[...bl(t.flows?.implicit?.scopes||{}),bi()]),l===Se.Password&&!a[Se.Password].accessToken&&(a[Se.Password].accessToken=s,a[Se.Password].clientId=Er(i+L.SecurityVariablesEnvSuffix.ClientId),a[Se.Password].clientSecret=Er(i+L.SecurityVariablesEnvSuffix.ClientSecret),a[Se.Password].tokenUrl=t.flows?.password?.tokenUrl||"",a[Se.Password].scopes=[...bl(t.flows?.password?.scopes||{}),bi()])})}if(n===be.OpenIDConnect){const o=Er(i+L.SecurityVariablesEnvSuffix.Token),s=r[be.OpenIDConnect];s[Se.AuthorizationCode].accessToken||(s[Se.AuthorizationCode].accessToken=o,s[Se.AuthorizationCode].clientId=Er(i+L.SecurityVariablesEnvSuffix.ClientId),s[Se.AuthorizationCode].clientSecret=Er(i+L.SecurityVariablesEnvSuffix.ClientSecret),s[Se.AuthorizationCode].tokenUrl=t.flows?.authorizationCode?.tokenUrl||""),s[Se.AuthorizationCodeWithPkce].accessToken||(s[Se.AuthorizationCodeWithPkce].accessToken=o,s[Se.AuthorizationCodeWithPkce].clientId=Er(i+L.SecurityVariablesEnvSuffix.ClientId),s[Se.AuthorizationCodeWithPkce].clientSecret=Er(i+L.SecurityVariablesEnvSuffix.ClientSecret),s[Se.AuthorizationCodeWithPkce].tokenUrl=t.flows?.authorizationCode?.tokenUrl||""),s[Se.Implicit].accessToken||(s[Se.Implicit].accessToken=o,s[Se.Implicit].clientId=Er(i+L.SecurityVariablesEnvSuffix.ClientId))}return r}function tH(t){try{const e=JSON.parse(t);return JSON.stringify(e,null,2)}catch(e){return console.error({error:e}),t}}function WMe(t,e=!1,r="",n){const i=JG(t.parameters,"in"),o=rH(t),s=iI(t),a=Al(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:Al(i.path||[],{in:"path"}),method:t.method.toLocaleUpperCase(),url:ag(_Me(t.path),a),headers:Al(i.header||[],{in:"header"}),queryParameters:a,cookies:Al(i.cookie||[],{in:"cookie"}),body:o,security:s},response:null}}function sI(t){const e=JG(t.parameters,"in"),r=rH(t),n=iI(t);return{parameters:{queryParameters:Al(e.query||[],{in:"query"}),headers:Al(e.header||[],{in:"header"}),cookies:Al(e.cookie||[],{in:"cookie"}),pathParameters:Al(e.path||[],{initializeWithInputs:!0,in:"path"})},requestBody:r,security:n}}function FMe(t,e){const r=new rc({format:!0});if(typeof t=="string")return e?.includes("json")?tH(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 rH(t){const e=t.body?.mediaTypes;if(!e||!Object.keys(e).length)return ox();const r=BMe(e,t),n=r?.name||"",i=!ix.includes(n)&&!HG.includes(n),o=HE(r),a=o.find(({key:c})=>c===t.body?.activeExampleName)?.value??o[0]?.value,l=i&&a?FMe(a,n):"";return{...ox(),activeExampleName:t.body?.activeExampleName||o[0]?.key||"",...r&&{type:r.name},content:l,formData:{"multipart/form-data":Hq(e[Ur.FormData]),"application/x-www-form-urlencoded":Hq(e[Ur["application/x-www-form-urlencoded"]])}}}function nH(t){return t?{...(Object.keys(t?.body?.mediaTypes||{})||[]).reduce((r,n)=>(r[n]={name:n,extensions:void 0},r),{}),...su}:su}function Hq(t){if(!t)return[Ra()];if(!t.parameters)return[Ra()];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(Ra()),e}function HE(t){const e=t?.examples;return Object.keys(e||{}).map(r=>{const n=e?.[r];return{name:L.isString(n?.summary)?n?.summary:n?.summary?.raw||r,key:r,value:e?.[r].value}})}function BMe(t,e){const r=nH(e),n=Object.keys(t).find(i=>!!r[i]);return n?t[n]:null}function ZMe(t){return!t?.security?.length||!t?[]:UMe(t)}function iH(t){const e=new Set;return t.flat().filter(r=>e.has(r.id)?!1:(e.add(r.id),!0))}function eS(t){if(t.type==="http"){if(t.scheme==="bearer")return be.JWT;if(t.scheme==="basic")return be.BasicAuth;if(t.scheme==="digest")return be.DigestAuth}else{if(t.type==="apiKey")return be.APIKey;if(t.type==="oauth2")return be.OAuth2;if(t.type==="openIdConnect")return be.OpenIDConnect}return be.NoAuth}function YMe(t,e){if(t==="clientCredentials"&&e&&"x-assertionType"in e&&e["x-assertionType"]===GE)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 GMe(t,e){const r=t?.security;if(!r?.length)return[];const o=VMe(r).flat().filter(s=>s.schemeId===e).find(s=>eS(s)===be.OAuth2);return aI(o)}function aI(t){return Object.entries(t?.flows||{}).map(([e,r])=>YMe(e,r)).filter(Boolean)}async function lg(t){try{const e=await E8(t),r=await iA(t);return{absolutePath:t,file:new File([e],r)}}catch(e){return console.error("Failed to init replay file",e),null}}async function oH(t){return(await Promise.allSettled(t.map(r=>lg(r)))).map(r=>r.status==="fulfilled"?r.value:null).filter(r=>r!==null)}function eb(t){return/(?:^[a-z][a-z0-9+.-]*:|\/\/)/i.test(t)}function JE(t){return t.endsWith("/")?t.substring(0,t.length-1):t}function HMe(t){try{const e=new URL(t);return e.search="",e.hash="",e.toString()}catch{return t}}function tS(t){return/^https?:\/\//i.test(t)}function JMe(t,e){let r;if(e.startsWith("//")){const{protocol:n}=new URL(t);r=`${n||"https:"}${e}`}else if(eb(e))r=e;else if(!e.startsWith("/"))r=JE(t)+"/"+e;else{const n=new URL(t);n.pathname=e,r=n.toString()}return JE(r)}function Jq(t,e){let r=t;return e.forEach(({key:n,value:i,active:o})=>{i&&o&&(r=r.replaceAll(`{${n}}`,i))}),r}function sH(t,e){let r=t;return e.forEach(({name:n,value:i})=>{i&&(r=r.replaceAll(`{${n}}`,i))}),r}function KMe(t){return t.startsWith("http://")||t.startsWith("https://")}function tv({url:t,serverUrl:e,corsProxyUrl:r}){let n;if(KMe(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 e3e(t,e,r,n,i,o){const s=await Promise.all(t.sourceDescriptions?.map(async l=>({...l,apiId:await aH({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:zt.Normal,sourceDescriptions:s,components:a,workflows:await Promise.all(t.workflows.map(async l=>({...l,state:zt.Normal,parameters:a9(l.parameters,l["x-replay-disabled-parameters"],t.components?.parameters),outputs:o9(l.outputs),security:r9(l["x-security"]),steps:await Promise.all(l.steps.map(async c=>{const u=a9(c.parameters,c["x-replay-disabled-parameters"],t.components?.parameters),d=c["x-operation"]??null;d&&(d.url=ag(d.url,u.queryParameters.filter(i7)));const f=t3e(c,s,i);let h;if(f&&o){const m=i?.find(g=>g.id===f.apiId);try{h=o(f.path,f.method,m)}catch(g){console.error("Failed to convert operation to replay value",g),h=void 0}}delete c.operationId,delete c["x-operation"];const y=await a3e(c.requestBody,n);return{...c,state:zt.Normal,parameters:u,outputs:o9(c.outputs),successCriteria:c.successCriteria?.map(m=>({...m,type:m.type??zn.SIMPLE}))||[],requestBody:y,xOperation:d,security:r9(c["x-security"],h),operation:f}}))})))}}async function aH({projectPath:t,apiUrl:e,collectionId:r}){if(tS(e))return e;if(await cr.isAbsolute(e))return await cr.relative(t,e);const n=await cr.resolve(await cr.join(t,r,"..",e));return await cr.relative(t,n)}function t3e(t,e,r){if(t["x-operation"])return null;const{path:n,method:i,apiId:o,isAdditionalOperation:s}=lH({operationPath:t.operationPath,parsedSourceDescriptions:e}),{operationId:a,apiId:l}=r3e({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=c3e(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 r3e({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 Kq(t){return"reference"in t&&typeof t.reference=="string"}function lH({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:y})=>y===o);h&&(s=h.apiId)}const c=n.split("/"),u=c.pop()||"",d=c[c.length-1]==="additionalOperations";return d&&c.pop(),{path:i0.unescape(c.pop()||""),method:u.toLowerCase(),apiId:s,isAdditionalOperation:d}}catch{return{path:"",method:"",apiId:null,isAdditionalOperation:!1}}}function n3e(t){switch(t.type){case"apiKey":return be.APIKey;case"oauth2":return be.OAuth2;case"openIdConnect":return be.OpenIDConnect;case"http":return t.scheme==="basic"?be.BasicAuth:t.scheme==="digest"?be.DigestAuth:t.scheme==="bearer"?be.JWT:be.NoAuth;default:return be.NoAuth}}function cH(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 i3e(t){return{query:Xi.Query,header:Xi.Header,cookie:Xi.Cookie}[t.toLowerCase()]||Xi.Header}function o3e(t){return{body:Xn.Body,header:Xn.Header,url:Xn.URL}[t.toLowerCase()]||Xn.URL}function e9(t,e,r){return Object.keys(t).reduce((n,i)=>{const o=cH(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:Cc(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:Cc(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:Cc(t[i].availableScopes),scopes:Cc(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:Cc(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:Cc(t[i].availableScopes),scopes:Cc(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 t9(t,e,r){const i={...Go(),securityType:t},o=Object.keys(e.flows||{})[0],s=cH(o,e.flows?.[o])??Se.ClientCredentials;switch(t){case be.BasicAuth:return{...i,[be.BasicAuth]:{username:r.username,password:r.password,schemeName:e.id}};case be.JWT:return{...i,[be.JWT]:{token:r.token,schemeName:e.id}};case be.DigestAuth:return{...i,[be.DigestAuth]:{...i[be.DigestAuth],username:r.username,password:r.password,schemeName:e.id}};case be.APIKey:return{...i,[be.APIKey]:{location:i3e(e.in),name:e.name,key:r.apiKey,schemeName:e.id}};case be.OAuth2:return{...i,[be.OAuth2]:{...i[be.OAuth2],...e9(e.flows||{},r||{},i[be.OAuth2]),authRequestExtraParams:n9(r.authRequestExtraParams),tokenRequestExtraParams:i9(r.tokenRequestExtraParams),grantType:s,schemeName:e.id}};case be.OpenIDConnect:return{...i,[be.OpenIDConnect]:{...i[be.OpenIDConnect],...e9(r.flows||{},r||{},i[be.OpenIDConnect]),openIdConnectUrl:r.openIdConnectUrl,userInfoUrl:r.userInfoUrl,authRequestExtraParams:n9(r.authRequestExtraParams),tokenRequestExtraParams:i9(r.tokenRequestExtraParams),grantType:s,schemeName:e.id}};default:return i}}function s3e(t,e){return[...t.map(n=>{if("scheme"in n){const o=n3e(n.scheme);return t9(o,n.scheme,n.values)}const i=e.find(o=>o.id===n.schemeName);if(i){const o=eS(i),s=t9(o,i,n.values);return s.securitySchemeId=i.id,s}return Go()})]}function r9(t=[],e){const r=iH(e?.security||[]);return t.length?s3e(t,r):[Go()]}function Cc(t,e){const r=bl(t||{}),n=bl(e||{});return[...r,...n,bi()]}function n9(t){return(t||[]).map(e=>({id:crypto.randomUUID(),key:e.key??"",value:e.value??"",active:e.active??!0})).concat(po())}function i9(t){return(t||[]).map(e=>({id:crypto.randomUUID(),key:e.key??"",value:e.value??"",active:e.active??!0,sendIn:o3e(e.in)})).concat(nI())}function o9(t){if(!t)return[po()];const e=[];for(const r in t)e.push({id:crypto.randomUUID(),key:r,value:t[r],active:!0});return e.push(po()),e}const Ju={query:"queryParameters",path:"pathParameters",header:"headers",cookie:"cookies"};function s9(t,e){const r="$components.parameters.";if(t.reference.startsWith(r)){const n=t.reference.replace(r,"");return e?.[n]}}function a9(t,e,r){if(!t&&!e)return{pathParameters:[Sr("path")],queryParameters:[Sr("query")],headers:[Sr("header")],cookies:[Sr("cookie")]};const n={pathParameters:[],queryParameters:[],headers:[],cookies:[]};if(t)for(const i of t)if(Kq(i)){const o=s9(i,r),s=Ju[o?.in];s&&n[s].push({reference:i.reference,active:!0,value:i.value})}else Ju[i.in]&&n[Ju[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(Kq(i)){const o=s9(i,r),s=Ju[o?.in];s&&n[s].push({reference:i.reference,active:!1,value:i.value})}else Ju[i.in]&&n[Ju[i.in]].push({id:crypto.randomUUID(),key:i.name,value:i.value,active:!1,in:i.in});return n.pathParameters.push(Sr("path")),n.queryParameters.push(Sr("query")),n.headers.push(Sr("header")),n.cookies.push(Sr("cookie")),n}async function a3e(t,e){const r=KG().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 l3e(t,e)};case"application/octet-stream":const n=t.payload?await uH(t.payload,e):[],i=n.length>0?await lg(n[0]):null;return{...r,type:t.contentType,binary:i};case"application/json":case"application/ld+json":return{...r,type:t.contentType,content:c9(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:c9(t.payload)}}}}async function l9(t,e,r,n){const i=await uH(e,n),o=i.length>0||Array.isArray(e),s=o?await oH(i):void 0;return{id:crypto.randomUUID(),key:t,value:o?"":e,type:o?"file":"text",active:r,files:s}}async function l3e(t,e){const r=KG().body.formData,n=t.contentType,i=t.payload?await Promise.all(Object.entries(t.payload).map(([a,l])=>l9(a,l,!0,e))):[],o=t["x-replay-disabled-payload"]?await Promise.all(Object.entries(t["x-replay-disabled-payload"]||{}).map(([a,l])=>l9(a,l,!1,e))):[];return{...r,[n]:[...i,...o,Ra()]}}function c9(t){return t?JSON.stringify(t,null,2):""}function c3e(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 uH(t,e){return Array.isArray(t)?(await Promise.all(t.map(r=>u9(r,e)))).flat():typeof t=="string"?await u9(t,e):[]}async function u9(t,e){const r=/\$file\(['"](.+?)['"]\)/g,n=Array.from(t.matchAll(r));return Promise.all(n.map(i=>u3e(i[1],e)))}async function u3e(t,e){return await cr.isAbsolute(t)?t:await cr.resolve(await cr.join(e,t))}const si=t=>!t||typeof t=="boolean"?{type:"object",properties:{}}:t.type?t:{...t,type:"object"},d9=(t,e,r)=>{if(!t.properties)return t;const n=t.properties[e],i=si(n);return{...t,properties:{...t.properties,[e]:{...i,...r}}}},d3e=(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})},f3e=(t,e)=>{if(!t.properties)return t;const r={...t.properties};return delete r[e],{...t,properties:r}},p3e=(t,e,r={type:"string"})=>{const n=t.properties||{};return{...t,type:"object",properties:{...n,[e]:r}}};function f9(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 p9(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(Rl(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 h3e(t){const e=t?.map(r=>({condition:r.condition,context:r.context,type:r.type==zn.SIMPLE?void 0:r.type}));if(e?.length!==0)return e}function m3e(t){if(!(!t||t.length===0))return[...t]}async function dH(t,e){return t.absolutePath?`$file('${await cr.relative(e,t.absolutePath)}')`:null}async function g3e(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=>dH(s,e)))).filter(s=>s!==null)),o.length===0?"":o.length===1?o[0]:o}}async function y3e(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 g3e(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 O3e(t){if(!t)return t;try{const e=JSON.parse(t);return typeof e=="object"?e:t}catch{return t}}async function v3e(t,e){if(t)switch(t.type){case"application/x-www-form-urlencoded":case"multipart/form-data":return{contentType:t.type,...await y3e(t,e)};case"application/octet-stream":return{contentType:t.type,payload:t.binary?await dH(t.binary,e):null};case"application/json":case"application/ld+json":return t.content?{contentType:t.type,payload:O3e(t.content)}:void 0;default:return t.content?{contentType:t.type,payload:t.content}:void 0}}function b3e(t){return{...t.schemeName?{schemeName:t.schemeName}:{scheme:{type:"http",scheme:"basic"}},values:{username:t.username,password:t.password}}}function x3e(t){return{...t.schemeName?{schemeName:t.schemeName}:{scheme:{type:"apiKey",name:t.name,in:t.location.toLowerCase()}},values:{apiKey:t.key}}}function S3e(t){return{...t.schemeName?{schemeName:t.schemeName}:{scheme:{type:"http",scheme:"bearer"}},values:{token:t.token}}}function w3e(t){return{...t.schemeName?{schemeName:t.schemeName}:{scheme:{type:"http",scheme:"digest"}},values:{username:t.username,password:t.password}}}function P3e(t){const{flows:e,values:r}=hH(t);return{...t.schemeName?{schemeName:t.schemeName}:{scheme:{type:"openIdConnect",flows:e}},values:{...r,openIdConnectUrl:t.openIdConnectUrl,userInfoUrl:t.userInfoUrl,authRequestExtraParams:fH(t.authRequestExtraParams),tokenRequestExtraParams:pH(t.tokenRequestExtraParams)}}}function C3e(t){const{flows:e,values:r}=hH(t);return{...t.schemeName?{schemeName:t.schemeName}:{scheme:{type:"oauth2",flows:e}},values:{...r,authRequestExtraParams:fH(t.authRequestExtraParams),tokenRequestExtraParams:pH(t.tokenRequestExtraParams)}}}function Ku(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 fH(t){return t.filter(e=>e.value||e.key).map(e=>({key:e.key,value:e.value,active:e.active}))}function pH(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 hH(t){let e;switch(t.grantType){case Se.ClientCredentials:return e=t[Se.ClientCredentials],{flows:{clientCredentials:{tokenUrl:e.tokenUrl,...Ku(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,...Ku(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,...Ku(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,...Ku(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,...Ku(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,...Ku(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 h9(t){const e=t.map(r=>{switch(r.securityType){case be.OpenIDConnect:{const i=r[be.OpenIDConnect];return P3e(i)}case be.OAuth2:{const i=r[be.OAuth2];return C3e(i)}case be.APIKey:{const i=r[be.APIKey];return x3e(i)}case be.BasicAuth:{const i=r[be.BasicAuth];return b3e(i)}case be.DigestAuth:{const i=r[be.DigestAuth];return w3e(i)}case be.JWT:{const i=r[be.JWT];return S3e(i)}default:return null}}).filter(r=>r!==null);return{"x-security":e.length?e:void 0}}function $3e(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 k3e(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:$3e(a),workflows:await Promise.all(s.map(async({parameters:c,security:u,dependsOn:d,outputs:f,state:h,steps:y,inputs:m,...g})=>({...g,dependsOn:m3e(d),outputs:f9(f),inputs:m?si(m):void 0,...h9(u),...p9(c),steps:await Promise.all(y.map(async({parameters:v,security:O,operation:b,requestBody:S,successCriteria:x,outputs:w,state:C,xOperation:k,...R})=>{const N={operationId:void 0,operationPath:void 0,"x-operation":void 0};if(b){const D=t.sourceDescriptions.find(({apiId:U})=>U===b.apiId)||t.sourceDescriptions[0];if(b.operationId){const U=t.sourceDescriptions.length<=1;N.operationId=U?b.operationId:`$sourceDescriptions.${D.name}.${b.operationId}`}else N.operationPath=b.isAdditionalOperation?`{$sourceDescriptions.${D.name}.url}#/paths/${i0.escape(b.path)}/additionalOperations/${b.method}`:`{$sourceDescriptions.${D.name}.url}#/paths/${i0.escape(b.path)}/${b.method}`}else k&&(N["x-operation"]={...k,url:k.url.split("?")[0]});return{...R,...N,...h9(O),...p9(v),requestBody:await v3e(S,e),successCriteria:h3e(x),outputs:f9(w)}}))})))}}}class E3e extends N8{constructor(e,r){super(e),this.convertOperationToReplayValue=r}parse(e,r){return e3e(e.content,e.uri,e.type,this.storage.baseDir,r,this.convertOperationToReplayValue)}async stringify(e){const{arazzoObject:r}=await k3e(e,this.storage.baseDir);return await cr.extname(e.id)===".json"?JSON.stringify(r,null,2):Da.dump(r)}}class T3e{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=Da.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:zt.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",Da.dump(i))}}class _3e{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 A3e=(t,e)=>({data:t,version:e});class lI extends _3e{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(A3e(e,this.version))}}function I3e(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 m9=2,R3e="tabs.json";class j3e extends lI{migrationMap={1:I3e};constructor(e){super(e,R3e,Ea(k8),m9)}async parse(e){let r=JSON.parse(e);r.version!==m9&&(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 g9(o["multipart/form-data"]),o["application/x-www-form-urlencoded"]=await g9(o["application/x-www-form-urlencoded"]),i.data.draftStep.requestBody.binary&&i.data.draftStep.requestBody.binary.absolutePath&&(i.data.draftStep.requestBody.binary=await lg(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 g9(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 oH(n)}return r}))}function Q3e(t){return{data:t.data.map(e=>({...e,step:{...e.step,security:e.step.security.securities}})),version:2}}const D3e=2,N3e="history.json";class M3e extends lI{migrationMap={1:Q3e};constructor(e){super(e,N3e,[],D3e)}}const q3e=1;class mH{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 FEe(this.project.id);const a=new WEe;this.historyStorage=new M3e(this.systemFilesStorage),this.activeEnvironmentIdStorage=new lI(this.systemFilesStorage,"active_environment_id.json",Ym,q3e),this.tabsStateStorage=new j3e(this.systemFilesStorage),this.environmentsStorage=new T3e(this.userFilesStorage,this.localStorageSecretsProvider),this.collectionsStorage=new E3e(this.userFilesStorage,this.convertOperationToReplayValue),this.apisStorage=new BEe(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 gC={exports:{}},y9;function z3e(){return y9||(y9=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,f){if(typeof u!="function")throw new TypeError("The listener must be a function");var h=new i(u,d||l,f),y=r?r+c:c;return l._events[y]?l._events[y].fn?l._events[y]=[l._events[y],h]:l._events[y].push(h):(l._events[y]=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 f=0,h=d.length,y=new Array(h);f<h;f++)y[f]=d[f].fn;return y},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,f,h,y){var m=r?r+c:c;if(!this._events[m])return!1;var g=this._events[m],v=arguments.length,O,b;if(g.fn){switch(g.once&&this.removeListener(c,g.fn,void 0,!0),v){case 1:return g.fn.call(g.context),!0;case 2:return g.fn.call(g.context,u),!0;case 3:return g.fn.call(g.context,u,d),!0;case 4:return g.fn.call(g.context,u,d,f),!0;case 5:return g.fn.call(g.context,u,d,f,h),!0;case 6:return g.fn.call(g.context,u,d,f,h,y),!0}for(b=1,O=new Array(v-1);b<v;b++)O[b-1]=arguments[b];g.fn.apply(g.context,O)}else{var S=g.length,x;for(b=0;b<S;b++)switch(g[b].once&&this.removeListener(c,g[b].fn,void 0,!0),v){case 1:g[b].fn.call(g[b].context);break;case 2:g[b].fn.call(g[b].context,u);break;case 3:g[b].fn.call(g[b].context,u,d);break;case 4:g[b].fn.call(g[b].context,u,d,f);break;default:if(!O)for(x=1,O=new Array(v-1);x<v;x++)O[x-1]=arguments[x];g[b].fn.apply(g[b].context,O)}}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,f){var h=r?r+c:c;if(!this._events[h])return this;if(!u)return s(this,h),this;var y=this._events[h];if(y.fn)y.fn===u&&(!f||y.once)&&(!d||y.context===d)&&s(this,h);else{for(var m=0,g=[],v=y.length;m<v;m++)(y[m].fn!==u||f&&!y[m].once||d&&y[m].context!==d)&&g.push(y[m]);g.length?this._events[h]=g.length===1?g[0]:g: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})(gC)),gC.exports}var L3e=z3e();const V3e=ai(L3e);class gH extends Error{constructor(e){super(e),this.name="TimeoutError"}}let X3e=class extends Error{constructor(e){super(),this.name="AbortError",this.message=e}};const O9=t=>globalThis.DOMException===void 0?new X3e(t):new DOMException(t),v9=t=>{const e=t.reason===void 0?O9("This operation was aborted."):t.reason;return e instanceof Error?e:O9(e)};function U3e(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(v9(l)),l.addEventListener("abort",()=>{a(v9(l))})}i=n.customTimers.setTimeout.call(void 0,()=>{const l=`Promise timed out after ${e} milliseconds`,c=r instanceof Error?r:new gH(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 W3e(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 $c=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)},pa;class F3e{constructor(){pa.set(this,[])}enqueue(e,r){r={priority:0,...r};const n={priority:r.priority,run:e};if(this.size&&$c(this,pa,"f")[this.size-1].priority>=r.priority){$c(this,pa,"f").push(n);return}const i=W3e($c(this,pa,"f"),n,(o,s)=>s.priority-o.priority);$c(this,pa,"f").splice(i,0,n)}dequeue(){const e=$c(this,pa,"f").shift();return e?.run}filter(e){return $c(this,pa,"f").filter(r=>r.priority===e.priority).map(r=>r.run)}get size(){return $c(this,pa,"f").length}}pa=new WeakMap;var Ar=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},Be=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)},Lr,bh,xh,Pl,sx,Sh,tb,Ro,Jp,Di,rb,qi,wh,xl,nb,b9,x9,yH,S9,w9,ib,yC,OC,ax,OH,ob;class vH extends Error{}class B3e extends V3e{constructor(e){var r,n,i,o;if(super(),Lr.add(this),bh.set(this,void 0),xh.set(this,void 0),Pl.set(this,0),sx.set(this,void 0),Sh.set(this,void 0),tb.set(this,0),Ro.set(this,void 0),Jp.set(this,void 0),Di.set(this,void 0),rb.set(this,void 0),qi.set(this,0),wh.set(this,void 0),xl.set(this,void 0),nb.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:F3e,...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})`);Ar(this,bh,e.carryoverConcurrencyCount,"f"),Ar(this,xh,e.intervalCap===Number.POSITIVE_INFINITY||e.interval===0,"f"),Ar(this,sx,e.intervalCap,"f"),Ar(this,Sh,e.interval,"f"),Ar(this,Di,new e.queueClass,"f"),Ar(this,rb,e.queueClass,"f"),this.concurrency=e.concurrency,this.timeout=e.timeout,Ar(this,nb,e.throwOnTimeout===!0,"f"),Ar(this,xl,e.autoStart===!1,"f")}get concurrency(){return Be(this,wh,"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})`);Ar(this,wh,e,"f"),Be(this,Lr,"m",ax).call(this)}async add(e,r={}){return r={timeout:this.timeout,throwOnTimeout:Be(this,nb,"f"),...r},new Promise((n,i)=>{Be(this,Di,"f").enqueue(async()=>{var o,s,a;Ar(this,qi,(s=Be(this,qi,"f"),s++,s),"f"),Ar(this,Pl,(a=Be(this,Pl,"f"),a++,a),"f");try{if(!((o=r.signal)===null||o===void 0)&&o.aborted)throw new vH("The task was aborted.");let l=e({signal:r.signal});r.timeout&&(l=U3e(Promise.resolve(l),r.timeout)),r.signal&&(l=Promise.race([l,Be(this,Lr,"m",OH).call(this,r.signal)]));const c=await l;n(c),this.emit("completed",c)}catch(l){if(l instanceof gH&&!r.throwOnTimeout){n();return}i(l),this.emit("error",l)}finally{Be(this,Lr,"m",yH).call(this)}},r),this.emit("add"),Be(this,Lr,"m",ib).call(this)})}async addAll(e,r){return Promise.all(e.map(async n=>this.add(n,r)))}start(){return Be(this,xl,"f")?(Ar(this,xl,!1,"f"),Be(this,Lr,"m",ax).call(this),this):this}pause(){Ar(this,xl,!0,"f")}clear(){Ar(this,Di,new(Be(this,rb,"f")),"f")}async onEmpty(){Be(this,Di,"f").size!==0&&await Be(this,Lr,"m",ob).call(this,"empty")}async onSizeLessThan(e){Be(this,Di,"f").size<e||await Be(this,Lr,"m",ob).call(this,"next",()=>Be(this,Di,"f").size<e)}async onIdle(){Be(this,qi,"f")===0&&Be(this,Di,"f").size===0||await Be(this,Lr,"m",ob).call(this,"idle")}get size(){return Be(this,Di,"f").size}sizeBy(e){return Be(this,Di,"f").filter(e).length}get pending(){return Be(this,qi,"f")}get isPaused(){return Be(this,xl,"f")}}bh=new WeakMap,xh=new WeakMap,Pl=new WeakMap,sx=new WeakMap,Sh=new WeakMap,tb=new WeakMap,Ro=new WeakMap,Jp=new WeakMap,Di=new WeakMap,rb=new WeakMap,qi=new WeakMap,wh=new WeakMap,xl=new WeakMap,nb=new WeakMap,Lr=new WeakSet,b9=function(){return Be(this,xh,"f")||Be(this,Pl,"f")<Be(this,sx,"f")},x9=function(){return Be(this,qi,"f")<Be(this,wh,"f")},yH=function(){var e;Ar(this,qi,(e=Be(this,qi,"f"),e--,e),"f"),Be(this,Lr,"m",ib).call(this),this.emit("next")},S9=function(){Be(this,Lr,"m",OC).call(this),Be(this,Lr,"m",yC).call(this),Ar(this,Jp,void 0,"f")},w9=function(){const e=Date.now();if(Be(this,Ro,"f")===void 0){const r=Be(this,tb,"f")-e;if(r<0)Ar(this,Pl,Be(this,bh,"f")?Be(this,qi,"f"):0,"f");else return Be(this,Jp,"f")===void 0&&Ar(this,Jp,setTimeout(()=>{Be(this,Lr,"m",S9).call(this)},r),"f"),!0}return!1},ib=function(){if(Be(this,Di,"f").size===0)return Be(this,Ro,"f")&&clearInterval(Be(this,Ro,"f")),Ar(this,Ro,void 0,"f"),this.emit("empty"),Be(this,qi,"f")===0&&this.emit("idle"),!1;if(!Be(this,xl,"f")){const e=!Be(this,Lr,"a",w9);if(Be(this,Lr,"a",b9)&&Be(this,Lr,"a",x9)){const r=Be(this,Di,"f").dequeue();return r?(this.emit("active"),r(),e&&Be(this,Lr,"m",yC).call(this),!0):!1}}return!1},yC=function(){Be(this,xh,"f")||Be(this,Ro,"f")!==void 0||(Ar(this,Ro,setInterval(()=>{Be(this,Lr,"m",OC).call(this)},Be(this,Sh,"f")),"f"),Ar(this,tb,Date.now()+Be(this,Sh,"f"),"f"))},OC=function(){Be(this,Pl,"f")===0&&Be(this,qi,"f")===0&&Be(this,Ro,"f")&&(clearInterval(Be(this,Ro,"f")),Ar(this,Ro,void 0,"f")),Ar(this,Pl,Be(this,bh,"f")?Be(this,qi,"f"):0,"f"),Be(this,Lr,"m",ax).call(this)},ax=function(){for(;Be(this,Lr,"m",ib).call(this););},OH=async function(e){return new Promise((r,n)=>{e.addEventListener("abort",()=>{n(new vH("The task was aborted."))},{once:!0})})},ob=async function(e,r){return new Promise(n=>{const i=()=>{r&&!r()||(this.off(e,i),n())};this.on(e,i)})};const ja=window.__TAURI__?.http.fetch??globalThis.fetch;class bH extends d1{constructor(){super()}resolveExternalRef(e,r){return eb(r)?r:e&&eb(e)?new URL(r,e).href:e?Hc.resolve(Hc.dirname(e),r):r}async loadExternalRef(e){if(eb(e)){const{body:r,mimeType:n}=await m7(e,{...this.config.http,customFetch:ja});return new Hd(e,r,n)}else{if(!await rA(e))throw new Error(`File not found at ${e}.`);try{throw await tA(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 D1(e);return new Hd(e,n.replace(/\r\n/g,`
|
|
424
|
-
`))}}}async function KE(t,e){const r=new r1({});r.getRulesForSpecVersion=()=>[];const n=await cr.dirname(t),i={config:r,base:n,externalRefResolver:new bH,dereference:!0};e?i.doc={source:{absoluteRef:t},parsed:e}:i.ref=t;const{bundle:{parsed:o}}=await l6(i);return o}class Z3e{constructor(e){this.apisStorage=e}data=new Map;loading=new Set;pQueue=new B3e({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=tS(e)?ni.WEB:ni.FS,n=r===ni.WEB?e:await this.apisStorage.getAbsolutePath(e);try{const i=await KE(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 Y3e extends mH{apiLoader;constructor(e,r,n){const i=new cM(e.systemFilesDir),o=new cM(e.userFilesDir);super(i,o,e,!0,r,n),this.apiLoader=new Z3e(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 Ya("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 lM(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 lM(e,20,async o=>{try{const s=await this.userFilesStorage.get(o.relative_path);if(!s)return null;const a=Da.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,f=!u||u==="openapi",h=await aH({projectPath:this.project.userFilesDir,apiUrl:d,collectionId:o.relative_path});if(f){const y=await this.apiLoader.get(h);y&&l.push(y)}})),await this.collectionsStorage.parse({uri:o.relative_path,type:ni.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 P9{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 G3e extends mH{constructor(e,r,n){const i=new P9(e.systemFilesDir),o=new P9(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=Da.load(c);if(typeof u=="object"&&u!==null)if(typeof u.openapi=="string"){const d=await cr.resolve(await cr.join(this.userFilesStorage.baseDir,l)),f=await KE(d,u);o.push({uri:l,type:ni.FS,content:f})}else typeof u.arazzo=="string"&&(s.push({uri:l,type:ni.FS,content:u}),u.sourceDescriptions?.forEach(d=>{const f=d.type,h=d.url,y=!f||f==="openapi",m=typeof h=="string"&&tS(h);y&&m&&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 KE(o);i.push({uri:o,type:ni.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 f=await this.parseCollections(l,d,e);return this.collectionsStorage.setItemIds(f.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:f}}}function xH(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=Za()?new Y3e(i,o,s):new G3e(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 SH({defaultEnvironments:t}={}){return structuredClone({project:{id:"default",userFilesDir:"default",systemFilesDir:"default"},history:[],tabsState:Ea(k8),activeEnvironmentId:Ym,environments:t||$8,collections:[],apis:[],requestController:null,apps:{apps:[],appsLoadingState:gs.Idle},predefinedApiId:null,predefinedEnvironmentNames:new Set,predefinedInputNames:new Set})}const H3e=e7(SH(),t7(LEe({key:"replay-root-store"}),xH())),cI=E.createContext(H3e),J3e=cI.Provider;function ht(){const t=E.useContext(cI);return r7(t)}function K3e(){return{theme:"light",disableCollectionsTab:!1,oAuth2RedirectURI:null,corsProxyUrl:void 0,mockServer:void 0,certificates:[],isApiBased:!1,generatedEnvironments:[],generatedInputs:[],hideOtherSecuritySchemes:!1}}const e4e=K3e(),t4e=E.createContext(e4e);function Ho(){const t=E.useContext(t4e);return r7(t)}function r4e(t,e){const{apps:{apiId:r}}=ht(),{corsProxyUrl:n,disableCollectionsTab:i,mockServer:o,oAuth2RedirectURI:s,certificates:a,storageKey:l,isApiBased:c}=Ho();n.set(t?.corsProxyUrl??PEe),o.set(t?.mockServer),r.set(t?.apiId),s.set(t?.oAuth2RedirectURI),i.set(!!t?.disableCollectionsTab),l.set(t?.storageKey),c.set(!!e),E.useEffect(()=>{a.set(t?.certificates||[])},[t?.certificates])}const rS=E.createContext({});function xu(){return E.useContext(rS)||{}}const n4e="0.20.0",i4e={version:n4e};class wH{_client;_isInitialized=!1;_initResolve=null;_initPromise=new Promise(e=>{this._initResolve=e});_globalAttributes={platform:"",deviceId:""};constructor(){this._client=new wEe}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:i4e.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 kd=new wH;function st(){const{telemetry:t}=xu();return kd.isInitialized||kd.init(t),{sendEvent:(e,r)=>{kd.sendEvent(e,r)},startSpan:(e,r,n)=>kd.startSpan(e,r,n)}}const o4e=({awaitInit:t=!0}={})=>{const[e,r]=E.useState(void 0);return E.useEffect(()=>{(async()=>{const i=t?await kd.awaitInit():kd;r(i)})()},[t]),e},Wn=800,Ci=I(L.Button).attrs({variant:"text",size:"small",tone:"danger"})`
|
|
424
|
+
`))}}}async function KE(t,e){const r=new r1({});r.getRulesForSpecVersion=()=>[];const n=await cr.dirname(t),i={config:r,base:n,externalRefResolver:new bH,dereference:!0};e?i.doc={source:{absoluteRef:t},parsed:e}:i.ref=t;const{bundle:{parsed:o}}=await l6(i);return o}class Z3e{constructor(e){this.apisStorage=e}data=new Map;loading=new Set;pQueue=new B3e({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=tS(e)?ni.WEB:ni.FS,n=r===ni.WEB?e:await this.apisStorage.getAbsolutePath(e);try{const i=await KE(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 Y3e extends mH{apiLoader;constructor(e,r,n){const i=new cM(e.systemFilesDir),o=new cM(e.userFilesDir);super(i,o,e,!0,r,n),this.apiLoader=new Z3e(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 Ya("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 lM(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 lM(e,20,async o=>{try{const s=await this.userFilesStorage.get(o.relative_path);if(!s)return null;const a=Da.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,f=!u||u==="openapi",h=await aH({projectPath:this.project.userFilesDir,apiUrl:d,collectionId:o.relative_path});if(f){const y=await this.apiLoader.get(h);y&&l.push(y)}})),await this.collectionsStorage.parse({uri:o.relative_path,type:ni.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 P9{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 G3e extends mH{constructor(e,r,n){const i=new P9(e.systemFilesDir),o=new P9(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=Da.load(c);if(typeof u=="object"&&u!==null)if(typeof u.openapi=="string"){const d=await cr.resolve(await cr.join(this.userFilesStorage.baseDir,l)),f=await KE(d,u);o.push({uri:l,type:ni.FS,content:f})}else typeof u.arazzo=="string"&&(s.push({uri:l,type:ni.FS,content:u}),u.sourceDescriptions?.forEach(d=>{const f=d.type,h=d.url,y=!f||f==="openapi",m=typeof h=="string"&&tS(h);y&&m&&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 KE(o);i.push({uri:o,type:ni.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 f=await this.parseCollections(l,d,e);return this.collectionsStorage.setItemIds(f.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:f}}}function xH(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=Za()?new Y3e(i,o,s):new G3e(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 SH({defaultEnvironments:t}={}){return structuredClone({project:{id:"default",userFilesDir:"default",systemFilesDir:"default"},history:[],tabsState:Ea(k8),activeEnvironmentId:Ym,environments:t||$8,collections:[],apis:[],requestController:null,apps:{apps:[],appsLoadingState:gs.Idle},predefinedApiId:null,predefinedEnvironmentNames:new Set,predefinedInputNames:new Set})}const H3e=e7(SH(),t7(LEe({key:"replay-root-store"}),xH())),cI=E.createContext(H3e),J3e=cI.Provider;function ht(){const t=E.useContext(cI);return r7(t)}function K3e(){return{theme:"light",disableCollectionsTab:!1,oAuth2RedirectURI:null,corsProxyUrl:void 0,mockServer:void 0,certificates:[],isApiBased:!1,generatedEnvironments:[],generatedInputs:[],hideOtherSecuritySchemes:!1}}const e4e=K3e(),t4e=E.createContext(e4e);function Ho(){const t=E.useContext(t4e);return r7(t)}function r4e(t,e){const{apps:{apiId:r}}=ht(),{corsProxyUrl:n,disableCollectionsTab:i,mockServer:o,oAuth2RedirectURI:s,certificates:a,storageKey:l,isApiBased:c}=Ho();n.set(t?.corsProxyUrl??PEe),o.set(t?.mockServer),r.set(t?.apiId),s.set(t?.oAuth2RedirectURI),i.set(!!t?.disableCollectionsTab),l.set(t?.storageKey),c.set(!!e),E.useEffect(()=>{a.set(t?.certificates||[])},[t?.certificates])}const rS=E.createContext({});function xu(){return E.useContext(rS)||{}}const n4e="0.20.1",i4e={version:n4e};class wH{_client;_isInitialized=!1;_initResolve=null;_initPromise=new Promise(e=>{this._initResolve=e});_globalAttributes={platform:"",deviceId:""};constructor(){this._client=new wEe}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:i4e.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 kd=new wH;function st(){const{telemetry:t}=xu();return kd.isInitialized||kd.init(t),{sendEvent:(e,r)=>{kd.sendEvent(e,r)},startSpan:(e,r,n)=>kd.startSpan(e,r,n)}}const o4e=({awaitInit:t=!0}={})=>{const[e,r]=E.useState(void 0);return E.useEffect(()=>{(async()=>{const i=t?await kd.awaitInit():kd;r(i)})()},[t]),e},Wn=800,Ci=I(L.Button).attrs({variant:"text",size:"small",tone:"danger"})`
|
|
425
425
|
border: none;
|
|
426
426
|
margin: 0;
|
|
427
427
|
|
|
@@ -2572,7 +2572,7 @@ Please report this to https://github.com/markedjs/marked.`,t){const i="<p>An err
|
|
|
2572
2572
|
gap: var(--spacing-xs);
|
|
2573
2573
|
`,wb={[zn.SIMPLE]:{label:"Simple",tooltipContent:"Success criteria conditions in the form of basic literals, operators, and loose comparisons"},[zn.REGEX]:{label:"Regex",tooltipContent:"Regex patterns used as success criteria conditions"},[zn.JSONPATH]:{label:"JSONPath",tooltipContent:"JSONPath expressions as success criteria conditions"},[zn.XPATH]:{label:"XPath",tooltipContent:"XPath expressions as success criteria conditions"}},tJe=Object.keys(wb);function rJe({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||[],{...jMe(o)}])},n=E.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(ft)};return p.jsxs(p.Fragment,{children:[p.jsxs(Ua,{children:["Success criteria",p.jsx(ho,{content:"List of conditions required to complete the step."})]}),n.map(o=>p.jsx(E.Fragment,{children:p.jsx(GHe,{successCriteria:o,label:wb[o.get().type].label,tooltipContent:wb[o.get().type].tooltipContent,additionalActions:p.jsx(Ci,{"data-testid":"remove-success-criteria-button",variant:"text",icon:p.jsx(L.TrashCanIcon,{}),onClick:()=>i(o)})})},o.get().id)),p.jsx(nJe,{renderInput:()=>p.jsx(L.Button,{variant:"outlined",icon:p.jsx(L.AddIcon,{}),iconPosition:"left",size:"small",children:"Add success criteria"}),dataTestId:"workflow-step-success-criteria-select",options:tJe.map(o=>({element:wb[o].label,label:o,value:o})),onChange:o=>{r(o)},placement:"top",hideCheckmarkIcon:!0})]})}const nJe=I(L.Select)`
|
|
2574
2574
|
border-radius: var(--border-radius-md);
|
|
2575
|
-
`;function iJe({step:t,workflowId:e,collectionId:r}){const{handleIdChange:n}=bu(),i=t.stepId.get();return p.jsx(p.Fragment,{children:p.jsxs(xte,{children:[p.jsx(Ua,{children:"Info"}),p.jsxs(Vt,{children:[p.jsxs(Vt.Row,{children:[p.jsx(Vt.Cell,{children:p.jsxs(Zc,{children:["Step ID",p.jsx(ho,{content:"This step's unique identifier"})]})}),p.jsx(Vt.Cell,{$readonly:!0,children:p.jsx(ST,{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})}})})]}),p.jsxs(Vt.Row,{children:[p.jsx(Vt.Cell,{children:p.jsxs(Zc,{children:["Description",p.jsx(ho,{content:"The step's purpose in the workflow."})]})}),p.jsx(Vt.Cell,{children:p.jsx(AI,{state:t.description,placeholder:"Add description"})})]})]}),p.jsxs(Wd,{children:[p.jsx(Ua,{children:"Operation"}),p.jsx(FHe,{step:t,collectionId:r})]}),p.jsx(Wd,{children:p.jsx(bte,{outputs:t.outputs,tooltipText:"Data generated in this step that can be used in the next steps."})}),p.jsx(Wd,{children:p.jsx(rJe,{successCriteria:t.successCriteria})})]})})}function oJe({onParameterChange:t,files:e}){const r=E.useRef(null),n=a=>{a.target.files?.length&&t(Array.from(a.target.files).map(l=>({absolutePath:null,file:l})))},i=async()=>{if(Za())try{const{open:a}=await Promise.resolve().then(()=>require("./replay-index-
|
|
2575
|
+
`;function iJe({step:t,workflowId:e,collectionId:r}){const{handleIdChange:n}=bu(),i=t.stepId.get();return p.jsx(p.Fragment,{children:p.jsxs(xte,{children:[p.jsx(Ua,{children:"Info"}),p.jsxs(Vt,{children:[p.jsxs(Vt.Row,{children:[p.jsx(Vt.Cell,{children:p.jsxs(Zc,{children:["Step ID",p.jsx(ho,{content:"This step's unique identifier"})]})}),p.jsx(Vt.Cell,{$readonly:!0,children:p.jsx(ST,{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})}})})]}),p.jsxs(Vt.Row,{children:[p.jsx(Vt.Cell,{children:p.jsxs(Zc,{children:["Description",p.jsx(ho,{content:"The step's purpose in the workflow."})]})}),p.jsx(Vt.Cell,{children:p.jsx(AI,{state:t.description,placeholder:"Add description"})})]})]}),p.jsxs(Wd,{children:[p.jsx(Ua,{children:"Operation"}),p.jsx(FHe,{step:t,collectionId:r})]}),p.jsx(Wd,{children:p.jsx(bte,{outputs:t.outputs,tooltipText:"Data generated in this step that can be used in the next steps."})}),p.jsx(Wd,{children:p.jsx(rJe,{successCriteria:t.successCriteria})})]})})}function oJe({onParameterChange:t,files:e}){const r=E.useRef(null),n=a=>{a.target.files?.length&&t(Array.from(a.target.files).map(l=>({absolutePath:null,file:l})))},i=async()=>{if(Za())try{const{open:a}=await Promise.resolve().then(()=>require("./replay-index-BwN-9Tk1.js")),l=await a({multiple:!0});if(!l)return;const u=(Array.isArray(l)?l:[l]).map(lg),f=(await Promise.all(u)).filter(h=>h!==null);t(f)}catch(a){console.error("Failed to open file dialog or read file:",a)}else r.current?.click()},o=E.useCallback(()=>{t(null)},[t]),s=E.useMemo(()=>{if(!e)return null;if(e.length===1)return p.jsx(WL,{icon:p.jsx(L.CloseIcon,{}),variant:"secondary",onClick:o,iconPosition:"right",size:"small",children:p.jsx(FL,{children:e[0].file.name})});if(e.length>1)return p.jsx(WL,{icon:p.jsx(L.CloseIcon,{}),variant:"secondary",onClick:o,iconPosition:"right",size:"small",children:p.jsxs(FL,{children:[e.length," files"]})})},[e,o]);return p.jsx(sJe,{children:p.jsxs(aJe,{children:[p.jsx(lJe,{children:s||p.jsx(uJe,{children:"Add files here"})}),p.jsxs(cJe,{children:[p.jsx(s4e,{onClick:i,variant:"text","data-testid":"add-button",icon:p.jsx(L.AddIcon,{color:"--text-color-secondary"})}),p.jsx("input",{"data-testid":"file-input",hidden:!0,ref:r,type:"file",multiple:!0,accept:"files/*",onChange:n})]})]})})}const sJe=I.div`
|
|
2576
2576
|
position: relative;
|
|
2577
2577
|
display: flex;
|
|
2578
2578
|
flex-grow: 1;
|
|
@@ -2699,7 +2699,7 @@ Please report this to https://github.com/markedjs/marked.`,t){const i="<p>An err
|
|
|
2699
2699
|
`,PJe=I.div`
|
|
2700
2700
|
display: flex;
|
|
2701
2701
|
justify-content: center;
|
|
2702
|
-
`;function CJe({data:t,type:e}){const r=rr(),n=t[e];function i(s,a){a&&n.merge([Ra()])}function o(s){n[s].set(ft)}return p.jsx(fJe,{keyName:"Param",formElements:n,onParameterChange:i,environment:r,enableInputTypeSelection:e!==Ur["application/x-www-form-urlencoded"],actions:s=>p.jsx(Ci,{onClick:()=>o(s),variant:"text",icon:p.jsx(L.TrashCanIcon,{})})})}const $Je=({data:t})=>{const e=t.get(),[r,n]=E.useState(!1),i=E.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(),Za())try{const{open:u}=await Promise.resolve().then(()=>require("./replay-index-
|
|
2702
|
+
`;function CJe({data:t,type:e}){const r=rr(),n=t[e];function i(s,a){a&&n.merge([Ra()])}function o(s){n[s].set(ft)}return p.jsx(fJe,{keyName:"Param",formElements:n,onParameterChange:i,environment:r,enableInputTypeSelection:e!==Ur["application/x-www-form-urlencoded"],actions:s=>p.jsx(Ci,{onClick:()=>o(s),variant:"text",icon:p.jsx(L.TrashCanIcon,{})})})}const $Je=({data:t})=>{const e=t.get(),[r,n]=E.useState(!1),i=E.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(),Za())try{const{open:u}=await Promise.resolve().then(()=>require("./replay-index-BwN-9Tk1.js")),d=await u();if(!d)return;const f=await lg(d);t.set(f)}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?p.jsxs(kJe,{children:[p.jsx(L.SpinnerIcon,{}),"Loading..."]}):e&&e.file?.name?p.jsxs(EJe,{children:[p.jsxs(TJe,{children:[p.jsx(L.DocumentBlankIcon,{size:"16px"}),p.jsx(_Je,{children:e.file?.name})]}),p.jsx(Ci,{onClick:l,icon:p.jsx(L.TrashCanIcon,{})})]}):p.jsx(Ste,{children:!e&&p.jsxs(AJe,{tabIndex:0,role:"button",onKeyDown:a,onClick:s,children:[p.jsx("input",{type:"file",onChange:o,ref:i}),p.jsx(L.CloudUploadIcon,{}),"Upload file"]})})},Ste=I.div`
|
|
2703
2703
|
display: flex;
|
|
2704
2704
|
align-items: center;
|
|
2705
2705
|
justify-content: flex-start;
|
|
@@ -2863,7 +2863,7 @@ Please report this to https://github.com/markedjs/marked.`,t){const i="<p>An err
|
|
|
2863
2863
|
font-size: var(--font-size-base);
|
|
2864
2864
|
font-weight: var(--font-weight-medium);
|
|
2865
2865
|
padding: var(--spacing-xs);
|
|
2866
|
-
`;function lKe(t=32){let e="";for(;e.length<t;)e+=Math.random().toString(32).substring(2);return e.substring(0,t)}async function cKe(t){const e=new TextEncoder().encode(t);return crypto?.subtle.digest("SHA-256",e)}function uKe(t){if(t)return btoa(String.fromCharCode.apply(null,new Uint8Array(t))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function ZL(t,e,r){const n=typeof t=="string"?t:t.toString();if(Za()){const{openUrl:i}=await Promise.resolve().then(()=>require("./replay-index-
|
|
2866
|
+
`;function lKe(t=32){let e="";for(;e.length<t;)e+=Math.random().toString(32).substring(2);return e.substring(0,t)}async function cKe(t){const e=new TextEncoder().encode(t);return crypto?.subtle.digest("SHA-256",e)}function uKe(t){if(t)return btoa(String.fromCharCode.apply(null,new Uint8Array(t))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function ZL(t,e,r){const n=typeof t=="string"?t:t.toString();if(Za()){const{openUrl:i}=await Promise.resolve().then(()=>require("./replay-index-BG7maSLC.js"));await i(n);return}window.open(n,e,r)}const YL="/_auth/oauth2-redirect.html";let AS=class nh{static async authorizeImplicit({authorizationUrl:e,clientId:r,scopes:n,extraAuthParams:i={},routingBasePath:o="/",redirectUri:s,successCallback:a,errorCallback:l}){const c=GL({date:new Date().toString()});try{const u=new URL(e),d=o==="/"?"":o,f=`${window.location.origin}${d}${YL}`;u.searchParams.set("client_id",r),u.searchParams.set("redirect_uri",s||f),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),nh.clearRedirectData("implicit")},errorCallback:h=>{l(h),nh.clearRedirectData("implicit")}},await ZL(u.toString())}catch(u){l(Oa.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:f={},routingBasePath:h="/",redirectUri:y,withPkce:m,successCallback:g,errorCallback:v}){try{const O=tv({url:e,serverUrl:n}),b=new URL(O),S=tv({url:r,serverUrl:n}),x=new URL(S),w=h==="/"?"":h,C=`${window.location.origin}${w}${YL}`,k=GL({date:new Date().toString()});b.searchParams.set("client_id",i),b.searchParams.set("redirect_uri",y||C),b.searchParams.set("response_type","code"),b.searchParams.set("state",k),Array.isArray(l)&&b.searchParams.set("scope",l.join(" ")),m&&(!a&&!s&&(s=pKe(),a=await dKe(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 f)x.searchParams.set(R,f[R]);window.redirectOAuth2={flow:"authorizationCode",data:{authorizationUrl:e,clientId:i,scopes:l},state:k,successCallback:async({auth_code:R})=>{const N=Ea({client_id:i,client_secret:o,...s&&{code_verifier:s},code:R,grant_type:"authorization_code",redirect_uri:y||C,...d});try{const D=await ja(x,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8",Accept:"application/json",...u},body:new URLSearchParams(N).toString()});await r$(D,g,v)}catch(D){v(Oa.OAuth2Error.fromError(D))}nh.clearRedirectData("authorizationCode")},errorCallback:R=>{v(Oa.OAuth2Error.fromError(R)),nh.clearRedirectData("authorizationCode")}},await ZL(b.toString())}catch(O){v(Oa.OAuth2Error.fromError(O))}}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:f,errorCallback:h}){try{const y={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},m=tv({url:e,serverUrl:c,corsProxyUrl:l}),g=new URL(m);for(const O in o)g.searchParams.set(O,o[O]);const v=await ja(m,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8",Accept:"application/json",...s},body:new URLSearchParams(aM(y)).toString()});await r$(v,f,h)}catch(y){h(Oa.OAuth2Error.fromError(y))}}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:f,errorCallback:h}){try{const y={client_id:i,client_secret:o,grant_type:"password",username:e,password:r,scope:Array.isArray(s)&&s.length?s.join(" "):void 0,...c},m=tv({url:n,serverUrl:d,corsProxyUrl:u}),g=new URL(m);for(const O in a)g.searchParams.set(O,a[O]);const v=await ja(m,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8",Accept:"application/json",...l},body:new URLSearchParams(aM(y)).toString()});await r$(v,f,h)}catch(y){h(Oa.OAuth2Error.fromError(y))}}};function GL(t){const e={randomStr:lKe(),...t};return btoa(encodeURIComponent(JSON.stringify(e)))}async function r$(t,e,r){if(t.ok){const n=await t.json();if(n.error){r(Oa.OAuth2Error.fromJsonData(n));return}e(n)}else{if((t.headers.get("Content-Type")||"").indexOf("json")>-1){const o=await t.json();r(Oa.OAuth2Error.fromJsonData(o));return}r(Oa.OAuth2Error.fromTextData(await t.text()))}}async function dKe(t){return uKe(await cKe(t))}function fKe(t){return("0"+t.toString(16)).substring(-2)}function pKe(){const t=new Uint32Array(28);return crypto.getRandomValues(t),Array.from(t,fKe).join("")}function IS({scopes:t,environment:e}){const r=(i,o)=>{o&&t.merge([bi()])},n=i=>{t[i].set(ft)};return p.jsx(hKe,{children:p.jsx(mKe,{keyName:"Scopes",elements:t,onParameterChange:r,environment:e,actions:i=>p.jsx(Ci,{onClick:()=>n(i),variant:"text",icon:p.jsx(L.TrashCanIcon,{})}),singleValue:!0,hideOuterBorders:!0,valuePlaceholder:"New scope item"})})}const hKe=I.div`
|
|
2867
2867
|
width: 100%;
|
|
2868
2868
|
|
|
2869
2869
|
> div {
|
|
@@ -3498,7 +3498,7 @@ Please report this to https://github.com/markedjs/marked.`,t){const i="<p>An err
|
|
|
3498
3498
|
@media (max-width: ${Wn}px) {
|
|
3499
3499
|
padding: var(--spacing-xs) var(--spacing-sm);
|
|
3500
3500
|
}
|
|
3501
|
-
`,Mtt={info:t=>{},error:t=>{},warn:t=>{},printNewLine:()=>{},printSeparator:()=>{},indent:(t,e)=>t,output:t=>t},qtt=t=>t instanceof URL?t.toString():t instanceof Request?t.url:t;function ztt({collectionId:t,workflowId:e}){const{project:{userFilesDir:r}}=ht(),{certificates:n}=Ho(),i=rr(),{getCollection:o}=pg(),s=o(t),a=r.get(),{inputs:l,servers:c}=i.get(),u=s?.sourceDescriptions.get()??[];return{execute:async f=>{const h=`${a}/${t}`,y=new bH,m=l.map(O=>JSON.stringify({[O.name]:O.value})),g=Ltt(c,u),{run:v}=await Promise.resolve().then(()=>require("./replay-index-
|
|
3501
|
+
`,Mtt={info:t=>{},error:t=>{},warn:t=>{},printNewLine:()=>{},printSeparator:()=>{},indent:(t,e)=>t,output:t=>t},qtt=t=>t instanceof URL?t.toString():t instanceof Request?t.url:t;function ztt({collectionId:t,workflowId:e}){const{project:{userFilesDir:r}}=ht(),{certificates:n}=Ho(),i=rr(),{getCollection:o}=pg(),s=o(t),a=r.get(),{inputs:l,servers:c}=i.get(),u=s?.sourceDescriptions.get()??[];return{execute:async f=>{const h=`${a}/${t}`,y=new bH,m=l.map(O=>JSON.stringify({[O.name]:O.value})),g=Ltt(c,u),{run:v}=await Promise.resolve().then(()=>require("./replay-index-DZKeaJ8u.js"));return await v({files:[h],workflow:e?[e]:[],fetch:(O,b)=>{const S=qtt(O),{clientCert:x,clientKey:w}=hJ(S,n?n.get({noproxy:!0}):[]);return ja(S,{...b,clientCert:x,clientKey:w})},logger:Mtt,maxSteps:500,maxFetchTimeout:4e4,requestFileLoader:{getFileBody:async O=>{if(!await rA(O))throw new Error(`File ${O} doesn't exist or isn't readable.`);try{const S=await D1(O),x=new TextEncoder().encode(S);return new File([x],await iA(O))}catch(S){throw new Error(`Failed to read file ${O}: ${S}`)}}},envVariables:{},config:await u6({}),externalRefResolver:y,input:m,server:g,severity:JSON.stringify(f),skipLint:!0,noSecretsMasking:!0})}}}function Ltt(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 fR(t){return t==null?"N/A":t<1e3?`${t} ms`:t<1e4?`${(t/1e3).toFixed(1)} s`:`${Math.round(t/1e3)} s`}function Lte({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]=pe.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?p.jsx(L.CheckmarkFilledIcon,{color:"var(--color-success-base)"}):o>0?p.jsx(L.ErrorFilledIcon,{color:"var(--color-error-base)"}):p.jsx(L.WarningFilledIcon,{color:"var(--color-warning-base)"}),f=h=>{h.stopPropagation(),c(!l)};return!e||e.length===0?null:p.jsxs(Vtt,{children:[p.jsxs(Xtt,{onClick:f,children:[p.jsxs(Utt,{children:[p.jsx(Wtt,{children:p.jsx(Ftt,{children:d()})}),p.jsxs(Btt,{children:[p.jsx(Ztt,{children:u()}),p.jsxs(Ytt,{children:[r," successful",n>0&&p.jsxs(p.Fragment,{children:[", ",n," ",n===1?"warning":"warnings"]}),o>0&&p.jsxs(p.Fragment,{children:[", ",o," failed"]})]})]})]}),p.jsx(Gtt,{isExpanded:l,children:l?p.jsx(L.ChevronDownIcon,{}):p.jsx(L.ChevronRightIcon,{})})]}),p.jsx(Htt,{isExpanded:l,children:e.map((h,y)=>p.jsxs(Jtt,{children:[p.jsx(Ktt,{children:h.passed?p.jsx(L.CheckmarkIcon,{color:"var(--color-success-base)",size:"14px"}):!h.passed&&["warn"].includes(h.severity)?p.jsx(L.WarningFilledIcon,{color:"var(--color-warning-base)",size:"14px"}):p.jsx(L.CloseOutlineIcon,{color:"var(--color-error-base)",size:"14px"})}),p.jsxs(ert,{children:[p.jsx(trt,{children:h.name}),h.message&&p.jsx(rrt,{children:h.message})]})]},y))})]})}const Vtt=I.div`
|
|
3502
3502
|
margin-bottom: 0;
|
|
3503
3503
|
margin-top: var(--spacing-xxs);
|
|
3504
3504
|
`,Xtt=I.div`
|
|
@@ -5300,7 +5300,7 @@ Please report this to https://github.com/markedjs/marked.`,t){const i="<p>An err
|
|
|
5300
5300
|
`,uat=I.div`
|
|
5301
5301
|
display: flex;
|
|
5302
5302
|
gap: var(--spacing-xs);
|
|
5303
|
-
`;async function Rre(t,e,r){try{const{join:n,dirname:i}=await Promise.resolve().then(()=>XEe),{exists:o}=await Promise.resolve().then(()=>VEe),{revealItemInDir:s,openPath:a}=await Promise.resolve().then(()=>require("./replay-index-
|
|
5303
|
+
`;async function Rre(t,e,r){try{const{join:n,dirname:i}=await Promise.resolve().then(()=>XEe),{exists:o}=await Promise.resolve().then(()=>VEe),{revealItemInDir:s,openPath:a}=await Promise.resolve().then(()=>require("./replay-index-BG7maSLC.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 dat({node:t}){const e=t.data.type==="api"&&t.data.api.srcType.get()===ni.WEB,{project:r}=ht(),n=E.useMemo(()=>Za(),[]),{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 Rre(c,l),i("node.management",{action:"reveal_in_folder",node_type:"api"})}}catch(l){console.error("Failed to reveal API in folder:",l)}};return p.jsx(fat,{children:p.jsx(ur,{content:"More actions",placement:"topRight",children:p.jsx(L.Dropdown,{trigger:p.jsx(L.Button,{variant:"text",size:"small",icon:p.jsx(L.OverflowMenuVerticalIcon,{})}),alignment:"end",children:p.jsxs(L.DropdownMenu,{children:[n&&p.jsxs(Un,{onClick:s,children:[p.jsx(L.FolderIcon,{size:"14px"}),"Reveal in folder"]}),p.jsxs(Un,{onClick:o,children:[p.jsx(L.TrashCanIcon,{size:"14px"}),"Delete"]})]})})})})}const fat=I.div`
|
|
5304
5304
|
display: flex;
|
|
5305
5305
|
gap: var(--spacing-xxs);
|
|
5306
5306
|
`;function pat({onImport:t}){return p.jsxs(hat,{children:[p.jsx(mat,{children:"No OpenAPI files were imported yet"}),p.jsx(gat,{children:p.jsx(L.Button,{icon:p.jsx(L.DownloadIcon,{}),onClick:t,children:"Import OpenAPI file"})})]})}const hat=I.div`
|