@redocly/replay 0.22.0-next.8 → 0.22.0
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-B0v6JiVD.js → replay-index-BoEkHIm-.js} +1 -1
- package/dist/{replay-index-BOSi2_8y.js → replay-index-DBu78VZA.js} +7 -7
- package/dist/{replay-index-BIAgJWpm.js → replay-index-Dpg9SsyD.js} +1 -1
- package/dist/{replay-index-Bw56v_oA.js → replay-index-GMR-4pxg.js} +6 -6
- package/dist/{replay-respect-run-CVKj9P6m.js → replay-respect-run-Bw2hqa4a.js} +1 -1
- package/dist/{replay-respect-run-rO80Zpka.js → replay-respect-run-CWl0J5uZ.js} +1 -1
- package/dist/{replay-tauri-path-Du9AnoXs.js → replay-tauri-path-BSv_KJxs.js} +2 -2
- package/dist/{replay-tauri-path-D6_uYcMz.js → replay-tauri-path-CaUuUwbr.js} +1 -1
- package/dist/replay.cjs +1 -1
- package/dist/replay.js +1 -1
- package/package.json +2 -2
|
@@ -108,7 +108,7 @@ Repeats of \`in:${r.in}\` + \`name:${r.name}\`.`,location:o.PathItem.child(["par
|
|
|
108
108
|
${y}`,location:m};g&&(O.forceSeverity=g),l.report(O)}}})}}};return t.schemas!="off"&&(n.NamedSchemas={Schema(a,{location:l}){s(x$,l)}}),t.responses!="off"&&(n.NamedResponses={Response(a,{location:l}){s(w$,l)}}),t.parameters!="off"&&(n.NamedParameters={Parameter(a,{location:l}){s(S$,l)}}),t.requestBodies!="off"&&(n.NamedRequestBodies={RequestBody(a,{location:l}){s(P$,l)}}),n;function i(a){const l=a.split("/").slice(-1)[0];return l.endsWith(".yml")||l.endsWith(".yaml")||l.endsWith(".json")?l.slice(0,l.lastIndexOf(".")):l}function o(a,l,c){const u=Fge(a,l),d=e.get(u)??{absolutePointers:new Set,locations:[]},p=c.absolutePointer.toString();d.absolutePointers.has(p)||(d.absolutePointers.add(p),d.locations.push(c)),e.set(u,d)}function s(a,l){const c=i(l.absolutePointer.toString());o(a,c,l)}};function Xge(t){return Bge[t]??null}function Fge(t,e){return`${t}/${e}`}function Zge(t){const[e,r]=t.split("/");return{typeName:e,componentName:r}}const Yge=()=>({Root(t,{report:e,location:r}){if(!t.hasOwnProperty("servers")){e({message:"Servers must be present.",location:r.child(["openapi"]).key()});return}(!Array.isArray(t.servers)||t.servers.length===0)&&e({message:"Servers must be a non-empty array.",location:r.child(["servers"]).key()})}}),Gge=()=>({Example(t,{report:e,location:r}){t.value&&t.externalValue&&e({message:"Example object can have either `value` or `externalValue` fields.",location:r.child(["value"]).key()})}}),Hge=t=>{const e=n=>n.schema===void 0,r=n=>(i,o)=>{const{location:s,resolve:a}=o;if(cu(i.example))l(i.example,s.child("example"));else if(lt(i.examples))for(const c of Object.keys(i.examples))l(i.examples[c],s.child(["examples",c,"value"]),!0);function l(c,u,d){if(Xr(c)){const p=a(c);if(!p.location)return;u=d?p.location.child("value"):p.location,c=p.node}d&&typeof c?.value>"u"||sm(d?c.value:c,i.schema,{location:u,ctx:o,allowAdditionalProperties:!!t.allowAdditionalProperties,ajvContext:n})}};return{Parameter:{MediaType:{skip:e,leave:r({apiContext:"request"})}},RequestBody:{MediaType:{skip:e,leave:r({apiContext:"request"})}},Response:{MediaType:{skip:e,leave:r({apiContext:"response"})}}}},Jge=()=>({Server(t,{report:e,location:r}){const n=/^(.*[\/.])?(example\.com|localhost)([\/:?].*|$)/;t.url&&n.test(t.url)&&e({message:"Server `url` should not point to example.com or localhost.",location:r.child(["url"])})}}),Kge=()=>({Server(t,{report:e,location:r}){t.url&&t.url.endsWith("/")&&t.url!=="/"&&e({message:"Server `url` should not have a trailing slash.",location:r.child(["url"])})}}),eye=()=>({Root(t,{report:e,location:r}){if(!t.servers||t.servers.length===0)return;const n=[];if(Array.isArray(t.servers))for(const i of t.servers){const o=SQ(i);o&&n.push(...o)}else{const i=SQ(t.servers);if(!i)return;n.push(...i)}for(const i of n)i==="empty"&&e({message:"Server variable with `enum` must be a non-empty array.",location:r.child(["servers"]).key()}),i==="invalidDefaultValue"&&e({message:"Server variable define `enum` and `default`. `enum` must include default value",location:r.child(["servers"]).key()})}});function SQ(t){if(t.variables&&Object.keys(t.variables).length===0)return;const e=[];for(const r in t.variables){const n=t.variables[r];if(!n.enum||(Array.isArray(n.enum)&&n.enum?.length===0&&e.push("empty"),!n.default))continue;const i=t.variables[r].default;n.enum&&!n.enum.includes(i)&&e.push("invalidDefaultValue")}if(e.length)return e}const tye=()=>({Server(t,{report:e,location:r}){if(!t?.url)return;const n=t.url.match(/{[^}]+}/g)?.map(o=>o.slice(1,o.length-1))||[],i=t?.variables&&Object.keys(t.variables)||[];for(const o of n)i.includes(o)||e({message:`The \`${o}\` variable is not defined in the \`variables\` objects.`,location:r.child(["url"])});for(const o of i)n.includes(o)||e({message:`The \`${o}\` variable is not used in the server's \`url\` field.`,location:r.child(["variables",o]).key(),from:r.child("url")})}}),rye=()=>{const t=new Map;function e(r,n){t.set(r.absolutePointer,{used:t.get(r.absolutePointer)?.used||!1,location:r,name:n})}return{ref(r,{type:n,resolve:i,key:o,location:s}){if(["Schema","Header","Parameter","Response","Example","RequestBody","MediaTypesMap"].includes(n.name)){const a=i(r);if(!a.location)return;t.set(a.location.absolutePointer,{used:!0,name:o.toString(),location:s})}},Root:{leave(r,{report:n}){t.forEach(i=>{i.used||n({message:`Component: "${i.name}" is never used.`,location:i.location.key()})})}},NamedSchemas:{Schema(r,{location:n,key:i}){r.allOf||e(n,i.toString())}},NamedParameters:{Parameter(r,{location:n,key:i}){e(n,i.toString())}},NamedResponses:{Response(r,{location:n,key:i}){e(n,i.toString())}},NamedExamples:{Example(r,{location:n,key:i}){e(n,i.toString())}},NamedRequestBodies:{RequestBody(r,{location:n,key:i}){e(n,i.toString())}},NamedHeaders:{Header(r,{location:n,key:i}){e(n,i.toString())}},NamedMediaTypes:{MediaTypesMap(r,{location:n,key:i}){e(n,i.toString())}}}},nye=()=>({Schema:{leave(t,e){"nullable"in t&&!("type"in t)&&e.report({message:"The `type` field must be defined when the `nullable` field is used.",location:e.location.child(["nullable"])})}}}),iye=()=>({Response:{skip(t,e){return!/4[Xx0-9]{2}/.test(`${e}`)},enter(t,{report:e,location:r}){(!t.content||!t.content["application/problem+json"])&&e({message:"Response `4xx` must have content-type `application/problem+json`.",location:r.key()})},MediaType:{skip(t,e){return e!=="application/problem+json"},enter(t,e){Kl("schema",t,e)},SchemaProperties(t,e){Kl("type",t,e),Kl("title",t,e)}}}}),oye=({allowedValues:t})=>({Paths:{RequestBody:{leave(e,r){Fd({type:"consumes",value:e},r,t)}},Callback:{RequestBody(){},Response:{leave(e,r){Fd({type:"consumes",value:e},r,t)}}}},WebhooksMap:{Response:{leave(e,r){Fd({type:"consumes",value:e},r,t)}}}}),sye=t=>{const e=t.names||{};let r;return{Operation:{Response:{skip:(n,i)=>`${i}`=="204",enter:(n,i)=>{r=i.key},MediaType:{Schema(n,{report:i,location:o}){if(n.type!=="object")return;const s=e[r]||e[pf(r)]||e[pf(r).toLowerCase()]||[];for(const a of s)n.properties?.[a]||i({message:`Response object must contain a top-level "${a}" property.`,location:o.child("properties").key()})}}}}}},aye=({allowedValues:t})=>({Paths:{Response:{leave(e,r){Fd({type:"produces",value:e},r,t)}},Callback:{Response(){},RequestBody:{leave(e,r){Fd({type:"produces",value:e},r,t)}}}},WebhooksMap:{RequestBody:{leave(e,r){Fd({type:"produces",value:e},r,t)}}}}),lye=()=>{const t="^[a-zA-Z0-9\\.\\-_]+$";function e(r,n,i,o){new RegExp(t).test(r)||n({message:`The map key in ${o} "${r}" does not match the regular expression "${t}"`,location:i.key()})}return{NamedSchemas:{Schema(r,{key:n,report:i,location:o}){e(n,i,o,"schemas")}},NamedParameters:{Parameter(r,{key:n,report:i,location:o}){e(n,i,o,"parameters")}},NamedResponses:{Response(r,{key:n,report:i,location:o}){e(n,i,o,"responses")}},NamedExamples:{Example(r,{key:n,report:i,location:o}){e(n,i,o,"examples")}},NamedRequestBodies:{RequestBody(r,{key:n,report:i,location:o}){e(n,i,o,"requestBodies")}},NamedHeaders:{Header(r,{key:n,report:i,location:o}){e(n,i,o,"headers")}},NamedSecuritySchemes:{SecurityScheme(r,{key:n,report:i,location:o}){e(n,i,o,"securitySchemes")}},NamedLinks:{Link(r,{key:n,report:i,location:o}){e(n,i,o,"links")}},NamedCallbacks:{Callback(r,{key:n,report:i,location:o}){e(n,i,o,"callbacks")}}}},cye=()=>{let t;return{NamedSchemas:{enter(e){t=Object.keys(e)}},Schema:{leave(e,r){if(!e.discriminator?.propertyName)return;const n=e.discriminator.defaultMapping;if(!e.required?.includes(e.discriminator.propertyName)&&n===void 0){r.report({message:`Discriminator with optional property '${e.discriminator.propertyName}' must include a defaultMapping field.`,location:r.location.child("discriminator")});return}n!==void 0&&!t.includes(n)&&r.report({message:`defaultMapping value '${n}' does not point to an existing schema component.`,location:r.location.child(["discriminator","defaultMapping"])})}}}},uye=()=>({Example({value:t,externalValue:e,dataValue:r,serializedValue:n},{report:i,location:o}){t!==void 0&&e!==void 0&&i({message:"The 'value' and 'externalValue' fields of an example object are mutually exclusive.",location:o}),n!==void 0&&e!==void 0&&i({message:"The 'serializedValue' and 'externalValue' fields of an example object are mutually exclusive.",location:o}),t!==void 0&&r!==void 0&&i({message:"The 'value' filed must be absent if 'dataValue' is present in an example object.",location:o.child("value").key()}),t!==void 0&&n!==void 0&&i({message:"The 'value' filed must be absent if 'serializedValue' is present in an example object.",location:o.child("value").key()})}}),dye=()=>({MediaType:{leave(t,e){("prefixEncoding"in t&&"encoding"in t||"itemEncoding"in t&&"encoding"in t)&&e.report({message:"The 'encoding' field cannot be used together with 'prefixEncoding' or 'itemEncoding'.",location:e.location.child("encoding").key()})}}}),fye=()=>{let t;return{Root:{enter(e){t=e.tags??[]}},Tag:{leave(e,{report:r,location:n}){if(e?.parent===void 0)return;if(!t.find(s=>s.name===e.parent)){r({message:`Tag parent '${e.parent}' is not defined in the API description.`,location:n.child("parent")});return}const i=new Set(e.name);let o=e.parent;for(;o!==void 0;){if(i.has(o)){r({message:`Circular reference detected in tag parent hierarchy for tag '${e.name}'.`,location:n.child("parent")});return}i.add(o),o=t.find(s=>s.name===o)?.parent}}}}};function wQ(t){return t.filter(e=>!("$ref"in e)&&e.in==="querystring").length}function PQ(t,e){const r=e.location.child("parameters");t>1&&e.report({message:"Parameters with `in: querystring` should be defined only once per path/operation parameter set.",location:r})}function CQ(t,e,r,n){if(t.in==="query"){r.querystringLocation&&n.report({message:"Parameters with `in: query` cannot be used together with `in: querystring` in the same operation/path parameter set.",location:e}),r.queryLocation??=e;return}t.in==="querystring"&&(r.queryLocation&&n.report({message:"Parameters with `in: querystring` cannot be used together with `in: query` in the same operation/path parameter set.",location:e}),r.querystringLocation??=e)}const pye=()=>{let t={},e={},r=0;return{PathItem:{enter(n,i){t={},e={},r=0,PQ(wQ(n.parameters||[]),i)},Parameter(n,i){CQ(n,i.location,t,i),n.in==="querystring"&&(r+=1)},Operation:{enter(n,i){e={...t};const o=r+wQ(n.parameters||[]);PQ(o,i)},Parameter(n,i){CQ(n,i.location,e,i)}}}}},hye={struct:Au,"info-contact":Hf,"info-license":yA,"info-license-strict":Wx,"operation-2xx-response":XB,"operation-4xx-response":FB,"operation-4xx-problem-details-rfc7807":iye,assertions:Tu,"operation-operationId-unique":YB,"operation-parameters-unique":HB,"operation-tag-defined":eW,"no-example-value-and-externalValue":Gge,"no-enum-type-mismatch":og,"no-path-trailing-slash":WB,"no-empty-servers":Yge,"path-declaration-must-exist":rW,"operation-operationId-url-safe":GB,"operation-operationId":Fx,"operation-summary":KB,"tags-alphabetical":Yx,"no-server-example.com":Jge,"no-server-trailing-slash":Kge,"tag-description":Zx,"operation-description":ZB,"no-unused-components":rye,"path-not-include-query":iW,"path-parameters-defined":Rb,"path-params-defined":Rb,"parameter-description":tW,"operation-singular-tag":JB,"security-defined":hW,"no-unresolved-refs":Eu,"paths-kebab-case":uW,"boolean-parameter-prefixes":Uge,"path-http-verbs-order":nW,"no-invalid-media-type-examples":Hge,"no-identical-paths":VB,"no-ambiguous-paths":LB,"no-undefined-server-variable":tye,"no-server-variables-empty-enum":eye,"no-http-verbs-in-paths":zB,"request-mime-type":oye,"response-mime-type":aye,"path-segment-plural":cW,"no-invalid-schema-examples":BB,"no-invalid-parameter-examples":UB,"response-contains-header":fW,"response-contains-property":sye,"scalar-property-missing-example":pW,"spec-components-invalid-map-name":lye,"required-string-property-missing-min-length":dW,"spec-strict-refs":mW,"component-name-unique":Wge,"array-parameter-serialization":zge,"no-required-schema-properties-undefined":sg,"no-schema-type-mismatch":ag,"no-duplicated-tag-names":Xx,"nullable-type-sibling":nye,"spec-no-invalid-tag-parents":fye,"spec-no-invalid-encoding-combinations":dye,"spec-discriminator-defaultMapping":cye,"spec-example-values":uye,"spec-querystring-parameters":pye},mye={},gye=()=>{const t=new Map;function e(r,n){t.set(r.absolutePointer,{used:t.get(r.absolutePointer)?.used||!1,location:r,name:n})}return{ref(r,{type:n,resolve:i,key:o,location:s}){if(["Schema","ContentDescriptor","Example","Link","ErrorObject","ExamplePairing","Tag"].includes(n.name)){const a=i(r);if(!a.location)return;t.set(a.location.absolutePointer,{used:!0,name:o.toString(),location:s})}},Root:{leave(r,{report:n}){t.forEach(i=>{i.used||n({message:`Component: "${i.name}" is never used.`,location:i.location.key()})})}},NamedSchemas:{Schema(r,{location:n,key:i}){r.allOf||e(n,i.toString())}},NamedContentDescriptors:{ContentDescriptor(r,{location:n,key:i}){e(n,i.toString())}},NamedExamples:{Example(r,{location:n,key:i}){e(n,i.toString())}},NamedLinks:{Link(r,{location:n,key:i}){e(n,i.toString())}},NamedErrors:{ErrorObject(r,{location:n,key:i}){e(n,i.toString())}},NamedExamplePairingObjects:{ExamplePairing(r,{location:n,key:i}){e(n,i.toString())}},NamedTags:{Tag(r,{location:n,key:i}){e(n,i.toString())}}}},yye=()=>({Method:{leave(t,{report:e,resolve:r,location:n}){if(!t.params||!Array.isArray(t.params))return;const i=new Set;t.params.forEach((o,s)=>{const a=r(o);if(!a.node)return;const l=a.node,c=l.name;c&&(i.has(c)&&e({message:`Parameter names must be unique. Duplicate parameter name '${l.name}' found.`,location:n.child([s,"name"])}),i.add(c))})}}}),Oye=()=>({Method:{leave(t,{report:e,resolve:r,location:n}){if(!t.params||!Array.isArray(t.params))return;let i=!1;t.params.forEach((o,s)=>{const a=r(o);if(!a.node)return;const l=a.node;if(!l.name)return;l.required===!0?i&&e({message:`Required parameter '${l.name}' must be positioned before optional parameters.`,location:n.child([s,"name"])}):i=!0})}}}),vye={struct:Au,"no-unresolved-refs":Eu,assertions:Tu,"info-license":yA,"no-unused-components":gye,"info-contact":Hf,"spec-no-duplicated-method-params":yye,"spec-no-required-params-after-optional":Oye},bye={},xye={"info-contact":Hf,struct:Au,"no-unresolved-refs":Eu,assertions:Tu},Sye={},wye={rules:{struct:"error","no-unresolved-refs":"error"},oas2Rules:{"boolean-parameter-prefixes":"error","info-contact":"error","info-license":"error","info-license-strict":"error","no-path-trailing-slash":"error","no-identical-paths":"error","no-ambiguous-paths":"error","no-invalid-schema-examples":"error","no-invalid-parameter-examples":"error","no-http-verbs-in-paths":"error","no-enum-type-mismatch":"error","no-required-schema-properties-undefined":"error","no-schema-type-mismatch":"error","operation-summary":"error","operation-operationId":"error","operation-operationId-unique":"error","operation-operationId-url-safe":"error","operation-description":"error","operation-2xx-response":"error","operation-4xx-response":"error","operation-parameters-unique":"error","operation-tag-defined":"error","operation-singular-tag":"error","parameter-description":"error","path-declaration-must-exist":"error","path-not-include-query":"error","path-parameters-defined":"error","paths-kebab-case":"error","path-http-verbs-order":"error","path-params-defined":"error","path-segment-plural":"error","required-string-property-missing-min-length":"error","response-contains-header":"error","request-mime-type":{severity:"error",allowedValues:["application/json"]},"response-mime-type":{severity:"error",allowedValues:["application/json"]},"response-contains-property":"error","security-defined":"error","spec-strict-refs":"error","scalar-property-missing-example":"error","tag-description":"error","tags-alphabetical":"error","no-duplicated-tag-names":"error"},oas3_0Rules:{"array-parameter-serialization":"error","boolean-parameter-prefixes":"error","component-name-unique":"error","info-contact":"error","info-license":"error","info-license-strict":"error","no-path-trailing-slash":"error","no-identical-paths":"error","no-ambiguous-paths":"error","no-invalid-schema-examples":"error","no-invalid-parameter-examples":"error","no-http-verbs-in-paths":"error","no-enum-type-mismatch":"error","no-required-schema-properties-undefined":"error","no-schema-type-mismatch":"error","no-invalid-media-type-examples":"error","no-server-example.com":"error","no-server-trailing-slash":"error","no-empty-servers":"error","no-example-value-and-externalValue":"error","no-unused-components":"error","no-undefined-server-variable":"error","no-server-variables-empty-enum":"error","nullable-type-sibling":"error","operation-summary":"error","operation-operationId":"error","operation-operationId-unique":"error","operation-operationId-url-safe":"error","operation-description":"error","operation-2xx-response":"error","operation-4xx-response":"error","operation-4xx-problem-details-rfc7807":"error","operation-parameters-unique":"error","operation-tag-defined":"error","operation-singular-tag":"error","parameter-description":"error","path-declaration-must-exist":"error","path-not-include-query":"error","path-parameters-defined":"error","paths-kebab-case":"error","path-http-verbs-order":"error","path-params-defined":"error","path-segment-plural":"error","required-string-property-missing-min-length":"error","response-contains-header":"error","request-mime-type":{severity:"error",allowedValues:["application/json"]},"response-mime-type":{severity:"error",allowedValues:["application/json"]},"response-contains-property":"error","security-defined":"error","spec-strict-refs":"error","scalar-property-missing-example":"error","spec-components-invalid-map-name":"error","tag-description":"error","tags-alphabetical":"error","no-duplicated-tag-names":"error","spec-example-values":"error"},oas3_1Rules:{"array-parameter-serialization":"error","boolean-parameter-prefixes":"error","component-name-unique":"error","info-contact":"error","info-license":"error","info-license-strict":"error","no-path-trailing-slash":"error","no-identical-paths":"error","no-ambiguous-paths":"error","no-invalid-schema-examples":"error","no-invalid-parameter-examples":"error","no-http-verbs-in-paths":"error","no-enum-type-mismatch":"error","no-required-schema-properties-undefined":"error","no-schema-type-mismatch":"error","no-invalid-media-type-examples":"error","no-server-example.com":"error","no-server-trailing-slash":"error","no-empty-servers":"error","no-example-value-and-externalValue":"error","no-unused-components":"error","no-undefined-server-variable":"error","no-server-variables-empty-enum":"error","parameter-description":"error","path-declaration-must-exist":"error","path-not-include-query":"error","path-parameters-defined":"error","paths-kebab-case":"error","path-http-verbs-order":"error","path-params-defined":"error","path-segment-plural":"error","operation-summary":"error","operation-operationId":"error","operation-operationId-unique":"error","operation-operationId-url-safe":"error","operation-description":"error","operation-2xx-response":"error","operation-4xx-response":"error","operation-4xx-problem-details-rfc7807":"error","operation-parameters-unique":"error","operation-tag-defined":"error","operation-singular-tag":"error","required-string-property-missing-min-length":"error","response-contains-header":"error","request-mime-type":{severity:"error",allowedValues:["application/json"]},"response-mime-type":{severity:"error",allowedValues:["application/json"]},"response-contains-property":"error","security-defined":"error","spec-strict-refs":"error","scalar-property-missing-example":"error","spec-components-invalid-map-name":"error","tag-description":"error","tags-alphabetical":"error","no-duplicated-tag-names":"error","spec-example-values":"error"},oas3_2Rules:{"array-parameter-serialization":"error","boolean-parameter-prefixes":"error","component-name-unique":"error","info-contact":"error","info-license":"error","info-license-strict":"error","no-path-trailing-slash":"error","no-identical-paths":"error","no-ambiguous-paths":"error","no-invalid-schema-examples":"error","no-invalid-parameter-examples":"error","no-http-verbs-in-paths":"error","no-enum-type-mismatch":"error","no-required-schema-properties-undefined":"error","no-schema-type-mismatch":"error","no-invalid-media-type-examples":"error","no-server-example.com":"error","no-server-trailing-slash":"error","no-empty-servers":"error","no-unused-components":"error","no-undefined-server-variable":"error","no-server-variables-empty-enum":"error","parameter-description":"error","path-declaration-must-exist":"error","path-not-include-query":"error","path-parameters-defined":"error","paths-kebab-case":"error","path-http-verbs-order":"error","path-params-defined":"error","path-segment-plural":"error","operation-summary":"error","operation-operationId":"error","operation-operationId-unique":"error","operation-operationId-url-safe":"error","operation-description":"error","operation-2xx-response":"error","operation-4xx-response":"error","operation-4xx-problem-details-rfc7807":"error","operation-parameters-unique":"error","operation-tag-defined":"error","operation-singular-tag":"error","required-string-property-missing-min-length":"error","response-contains-header":"error","request-mime-type":{severity:"error",allowedValues:["application/json"]},"response-mime-type":{severity:"error",allowedValues:["application/json"]},"response-contains-property":"error","security-defined":"error","spec-strict-refs":"error","scalar-property-missing-example":"error","spec-components-invalid-map-name":"error","tag-description":"error","tags-alphabetical":"error","no-duplicated-tag-names":"error","spec-no-invalid-tag-parents":"error","spec-no-invalid-encoding-combinations":"error","spec-discriminator-defaultMapping":"error","spec-example-values":"error","spec-querystring-parameters":"error"},async2Rules:{"channels-kebab-case":"error","info-contact":"error","info-license-strict":"error","no-channel-trailing-slash":"error","operation-operationId":"error","tag-description":"error","tags-alphabetical":"error","no-duplicated-tag-names":"error","no-required-schema-properties-undefined":"error","no-enum-type-mismatch":"error","no-schema-type-mismatch":"error"},async3Rules:{"channels-kebab-case":"error","info-contact":"error","info-license-strict":"error","no-channel-trailing-slash":"error","operation-operationId":"error","tag-description":"error","tags-alphabetical":"error","no-duplicated-tag-names":"error","no-required-schema-properties-undefined":"error","no-enum-type-mismatch":"error","no-schema-type-mismatch":"error"},arazzo1Rules:{"criteria-unique":"error","no-criteria-xpath":"off","no-enum-type-mismatch":"error","no-required-schema-properties-undefined":"error","no-schema-type-mismatch":"error","no-x-security-both-scheme-and-scheme-name":"off","no-x-security-scheme-name-without-openapi":"off","outputs-defined":"error","parameters-unique":"error","requestBody-replacements-unique":"error","respect-supported-versions":"off","sourceDescription-name-unique":"error","sourceDescription-type":"error","sourceDescriptions-not-empty":"error","step-onFailure-unique":"error","step-onSuccess-unique":"error","stepId-unique":"error","workflow-dependsOn":"error","workflowId-unique":"error","x-security-scheme-name-reference":"off","x-security-scheme-required-values":"off"},overlay1Rules:{"info-contact":"error"},openrpc1Rules:{"info-contact":"error","info-license":"error","no-unused-components":"error","spec-no-duplicated-method-params":"error","spec-no-required-params-after-optional":"error"}},Pye={rules:{struct:"error","no-unresolved-refs":"error"},oas2Rules:{"boolean-parameter-prefixes":"off","info-contact":"off","info-license":"off","info-license-strict":"off","no-ambiguous-paths":"warn","no-duplicated-tag-names":"off","no-enum-type-mismatch":"warn","no-http-verbs-in-paths":"off","no-identical-paths":"warn","no-invalid-parameter-examples":"off","no-invalid-schema-examples":"off","no-path-trailing-slash":"warn","no-required-schema-properties-undefined":"warn","no-schema-type-mismatch":"warn","operation-2xx-response":"warn","operation-4xx-response":"off","operation-description":"off","operation-operationId":"warn","operation-operationId-unique":"warn","operation-operationId-url-safe":"warn","operation-parameters-unique":"warn","operation-singular-tag":"off","operation-summary":"warn","operation-tag-defined":"off","parameter-description":"off","path-declaration-must-exist":"warn","path-http-verbs-order":"off","path-not-include-query":"warn","path-params-defined":"off","path-parameters-defined":"warn","path-segment-plural":"off","paths-kebab-case":"off","request-mime-type":"off","required-string-property-missing-min-length":"off","response-contains-header":"off","response-contains-property":"off","response-mime-type":"off","scalar-property-missing-example":"off","security-defined":"warn","spec-strict-refs":"off","tag-description":"warn","tags-alphabetical":"off"},oas3_0Rules:{"array-parameter-serialization":"off","boolean-parameter-prefixes":"off","component-name-unique":"off","info-contact":"off","info-license":"off","info-license-strict":"off","no-ambiguous-paths":"warn","no-duplicated-tag-names":"off","no-empty-servers":"warn","no-enum-type-mismatch":"warn","no-example-value-and-externalValue":"warn","no-http-verbs-in-paths":"off","no-identical-paths":"warn","no-invalid-media-type-examples":{severity:"warn",allowAdditionalProperties:!1},"no-invalid-parameter-examples":"off","no-invalid-schema-examples":"off","no-path-trailing-slash":"warn","no-required-schema-properties-undefined":"warn","no-schema-type-mismatch":"warn","no-server-example.com":"warn","no-server-trailing-slash":"error","no-server-variables-empty-enum":"error","no-undefined-server-variable":"warn","no-unused-components":"warn","nullable-type-sibling":"warn","operation-2xx-response":"warn","operation-4xx-problem-details-rfc7807":"off","operation-4xx-response":"off","operation-description":"off","operation-operationId":"warn","operation-operationId-unique":"warn","operation-operationId-url-safe":"warn","operation-parameters-unique":"warn","operation-singular-tag":"off","operation-summary":"warn","operation-tag-defined":"off","parameter-description":"off","path-declaration-must-exist":"warn","path-http-verbs-order":"off","path-not-include-query":"warn","path-params-defined":"off","path-parameters-defined":"warn","path-segment-plural":"off","paths-kebab-case":"off","request-mime-type":"off","required-string-property-missing-min-length":"off","response-contains-header":"off","response-contains-property":"off","response-mime-type":"off","scalar-property-missing-example":"off","security-defined":"warn","spec-components-invalid-map-name":"warn","spec-example-values":"off","spec-strict-refs":"off","tag-description":"warn","tags-alphabetical":"off"},oas3_1Rules:{"array-parameter-serialization":"off","boolean-parameter-prefixes":"off","component-name-unique":"off","info-contact":"off","info-license":"off","info-license-strict":"off","no-ambiguous-paths":"warn","no-duplicated-tag-names":"off","no-empty-servers":"warn","no-enum-type-mismatch":"warn","no-example-value-and-externalValue":"warn","no-http-verbs-in-paths":"off","no-identical-paths":"warn","no-invalid-media-type-examples":"warn","no-invalid-parameter-examples":"off","no-invalid-schema-examples":"off","no-path-trailing-slash":"warn","no-required-schema-properties-undefined":"warn","no-schema-type-mismatch":"warn","no-server-example.com":"warn","no-server-trailing-slash":"error","no-server-variables-empty-enum":"error","no-undefined-server-variable":"warn","no-unused-components":"warn","operation-2xx-response":"warn","operation-4xx-problem-details-rfc7807":"off","operation-4xx-response":"off","operation-description":"off","operation-operationId":"warn","operation-operationId-unique":"warn","operation-operationId-url-safe":"warn","operation-parameters-unique":"warn","operation-singular-tag":"off","operation-summary":"warn","operation-tag-defined":"off","parameter-description":"off","path-declaration-must-exist":"warn","path-http-verbs-order":"off","path-not-include-query":"warn","path-params-defined":"off","path-parameters-defined":"warn","path-segment-plural":"off","paths-kebab-case":"off","request-mime-type":"off","required-string-property-missing-min-length":"off","response-contains-header":"off","response-contains-property":"off","response-mime-type":"off","scalar-property-missing-example":"off","security-defined":"warn","spec-components-invalid-map-name":"warn","spec-example-values":"off","spec-strict-refs":"off","tag-description":"warn","tags-alphabetical":"off"},oas3_2Rules:{"array-parameter-serialization":"off","boolean-parameter-prefixes":"off","component-name-unique":"off","info-contact":"off","info-license":"off","info-license-strict":"off","no-ambiguous-paths":"warn","no-duplicated-tag-names":"off","no-empty-servers":"warn","no-enum-type-mismatch":"warn","no-http-verbs-in-paths":"off","no-identical-paths":"warn","no-invalid-media-type-examples":"warn","no-invalid-parameter-examples":"off","no-invalid-schema-examples":"off","no-path-trailing-slash":"warn","no-required-schema-properties-undefined":"warn","no-schema-type-mismatch":"warn","no-server-example.com":"warn","no-server-trailing-slash":"error","no-server-variables-empty-enum":"error","no-undefined-server-variable":"warn","no-unused-components":"warn","operation-2xx-response":"warn","operation-4xx-problem-details-rfc7807":"off","operation-4xx-response":"off","operation-description":"off","operation-operationId":"warn","operation-operationId-unique":"warn","operation-operationId-url-safe":"warn","operation-parameters-unique":"warn","operation-singular-tag":"off","operation-summary":"warn","operation-tag-defined":"off","parameter-description":"off","path-declaration-must-exist":"warn","path-http-verbs-order":"off","path-not-include-query":"warn","path-params-defined":"off","path-parameters-defined":"warn","path-segment-plural":"off","paths-kebab-case":"off","request-mime-type":"off","required-string-property-missing-min-length":"off","response-contains-header":"off","response-contains-property":"off","response-mime-type":"off","scalar-property-missing-example":"off","security-defined":"warn","spec-components-invalid-map-name":"warn","spec-discriminator-defaultMapping":"off","spec-example-values":"off","spec-no-invalid-encoding-combinations":"warn","spec-no-invalid-tag-parents":"warn","spec-querystring-parameters":"error","spec-strict-refs":"off","tag-description":"warn","tags-alphabetical":"off"},async2Rules:{"channels-kebab-case":"off","info-contact":"off","info-license-strict":"off","no-channel-trailing-slash":"off","no-duplicated-tag-names":"off","no-enum-type-mismatch":"warn","no-required-schema-properties-undefined":"warn","no-schema-type-mismatch":"warn","operation-operationId":"warn","tag-description":"warn","tags-alphabetical":"off"},async3Rules:{"channels-kebab-case":"off","info-contact":"off","info-license-strict":"off","no-channel-trailing-slash":"off","no-duplicated-tag-names":"off","no-enum-type-mismatch":"warn","no-required-schema-properties-undefined":"warn","no-schema-type-mismatch":"warn","operation-operationId":"warn","tag-description":"warn","tags-alphabetical":"off"},arazzo1Rules:{"criteria-unique":"off","no-criteria-xpath":"off","no-enum-type-mismatch":"warn","no-required-schema-properties-undefined":"warn","no-schema-type-mismatch":"warn","no-x-security-both-scheme-and-scheme-name":"off","no-x-security-scheme-name-without-openapi":"off","outputs-defined":"off","parameters-unique":"off","requestBody-replacements-unique":"off","respect-supported-versions":"off","sourceDescription-name-unique":"off","sourceDescription-type":"off","sourceDescriptions-not-empty":"off","step-onFailure-unique":"off","step-onSuccess-unique":"off","stepId-unique":"error","workflow-dependsOn":"off","workflowId-unique":"error","x-security-scheme-name-reference":"off","x-security-scheme-required-values":"off"},overlay1Rules:{"info-contact":"off"},openrpc1Rules:{"info-contact":"off","info-license":"off","no-unused-components":"off","spec-no-duplicated-method-params":"error","spec-no-required-params-after-optional":"error"}},Cye={rules:{struct:"error","no-unresolved-refs":"error"},oas2Rules:{"boolean-parameter-prefixes":"off","info-contact":"off","info-license":"error","info-license-strict":"error","no-ambiguous-paths":"error","no-duplicated-tag-names":"error","no-enum-type-mismatch":"error","no-http-verbs-in-paths":"off","no-identical-paths":"error","no-invalid-parameter-examples":"error","no-invalid-schema-examples":"error","no-path-trailing-slash":"error","no-required-schema-properties-undefined":"error","no-schema-type-mismatch":"error","operation-2xx-response":"error","operation-4xx-response":"error","operation-description":"off","operation-operationId":"error","operation-operationId-unique":"error","operation-operationId-url-safe":"error","operation-parameters-unique":"error","operation-singular-tag":"off","operation-summary":"error","operation-tag-defined":"off","parameter-description":"off","path-declaration-must-exist":"error","path-http-verbs-order":"off","path-not-include-query":"error","path-params-defined":"off","path-parameters-defined":"error","path-segment-plural":"off","paths-kebab-case":"off","request-mime-type":"off","required-string-property-missing-min-length":"off","response-contains-header":"off","response-contains-property":"off","response-mime-type":"off","scalar-property-missing-example":"off","security-defined":"error","spec-strict-refs":"off","tag-description":"error","tags-alphabetical":"off"},oas3_0Rules:{"array-parameter-serialization":"off","boolean-parameter-prefixes":"off","component-name-unique":"off","info-contact":"off","info-license":"error","info-license-strict":"error","no-ambiguous-paths":"error","no-duplicated-tag-names":"error","no-empty-servers":"error","no-enum-type-mismatch":"error","no-example-value-and-externalValue":"error","no-http-verbs-in-paths":"off","no-identical-paths":"error","no-invalid-media-type-examples":{severity:"error",allowAdditionalProperties:!1},"no-invalid-parameter-examples":"error","no-invalid-schema-examples":"error","no-path-trailing-slash":"error","no-required-schema-properties-undefined":"error","no-schema-type-mismatch":"error","no-server-example.com":"error","no-server-trailing-slash":"error","no-server-variables-empty-enum":"error","no-undefined-server-variable":"error","no-unused-components":"error","nullable-type-sibling":"error","operation-2xx-response":"error","operation-4xx-problem-details-rfc7807":"off","operation-4xx-response":"error","operation-description":"off","operation-operationId":"error","operation-operationId-unique":"error","operation-operationId-url-safe":"error","operation-parameters-unique":"error","operation-singular-tag":"off","operation-summary":"error","operation-tag-defined":"off","parameter-description":"off","path-declaration-must-exist":"error","path-http-verbs-order":"off","path-not-include-query":"error","path-params-defined":"off","path-parameters-defined":"error","path-segment-plural":"off","paths-kebab-case":"off","request-mime-type":"off","required-string-property-missing-min-length":"off","response-contains-header":"off","response-contains-property":"off","response-mime-type":"off","scalar-property-missing-example":"off","security-defined":"error","spec-components-invalid-map-name":"error","spec-example-values":"off","spec-strict-refs":"off","tag-description":"error","tags-alphabetical":"off"},oas3_1Rules:{"array-parameter-serialization":"off","boolean-parameter-prefixes":"off","component-name-unique":"off","info-contact":"off","info-license":"error","info-license-strict":"error","no-ambiguous-paths":"error","no-duplicated-tag-names":"error","no-empty-servers":"error","no-enum-type-mismatch":"error","no-example-value-and-externalValue":"error","no-http-verbs-in-paths":"off","no-identical-paths":"error","no-invalid-media-type-examples":"error","no-invalid-parameter-examples":"error","no-invalid-schema-examples":"error","no-path-trailing-slash":"error","no-required-schema-properties-undefined":"error","no-schema-type-mismatch":"error","no-server-example.com":"error","no-server-trailing-slash":"error","no-server-variables-empty-enum":"error","no-undefined-server-variable":"error","no-unused-components":"error","operation-2xx-response":"error","operation-4xx-problem-details-rfc7807":"off","operation-4xx-response":"error","operation-description":"off","operation-operationId":"error","operation-operationId-unique":"error","operation-operationId-url-safe":"error","operation-parameters-unique":"error","operation-singular-tag":"off","operation-summary":"error","operation-tag-defined":"off","parameter-description":"off","path-declaration-must-exist":"error","path-http-verbs-order":"off","path-not-include-query":"error","path-params-defined":"off","path-parameters-defined":"error","path-segment-plural":"off","paths-kebab-case":"off","request-mime-type":"off","required-string-property-missing-min-length":"off","response-contains-header":"off","response-contains-property":"off","response-mime-type":"off","scalar-property-missing-example":"off","security-defined":"error","spec-components-invalid-map-name":"error","spec-example-values":"off","spec-strict-refs":"off","tag-description":"error","tags-alphabetical":"off"},oas3_2Rules:{"array-parameter-serialization":"off","boolean-parameter-prefixes":"off","component-name-unique":"off","info-contact":"off","info-license":"error","info-license-strict":"error","no-ambiguous-paths":"error","no-duplicated-tag-names":"error","no-empty-servers":"error","no-enum-type-mismatch":"error","no-http-verbs-in-paths":"off","no-identical-paths":"error","no-invalid-media-type-examples":"error","no-invalid-parameter-examples":"error","no-invalid-schema-examples":"error","no-path-trailing-slash":"error","no-required-schema-properties-undefined":"error","no-schema-type-mismatch":"error","no-server-example.com":"error","no-server-trailing-slash":"error","no-server-variables-empty-enum":"error","no-undefined-server-variable":"error","no-unused-components":"error","operation-2xx-response":"error","operation-4xx-problem-details-rfc7807":"off","operation-4xx-response":"error","operation-description":"off","operation-operationId":"error","operation-operationId-unique":"error","operation-operationId-url-safe":"error","operation-parameters-unique":"error","operation-singular-tag":"off","operation-summary":"error","operation-tag-defined":"off","parameter-description":"off","path-declaration-must-exist":"error","path-http-verbs-order":"off","path-not-include-query":"error","path-params-defined":"off","path-parameters-defined":"error","path-segment-plural":"off","paths-kebab-case":"off","request-mime-type":"off","required-string-property-missing-min-length":"off","response-contains-header":"off","response-contains-property":"off","response-mime-type":"off","scalar-property-missing-example":"off","security-defined":"error","spec-components-invalid-map-name":"error","spec-discriminator-defaultMapping":"error","spec-example-values":"error","spec-no-invalid-encoding-combinations":"error","spec-no-invalid-tag-parents":"error","spec-querystring-parameters":"error","spec-strict-refs":"off","tag-description":"error","tags-alphabetical":"off"},async2Rules:{"channels-kebab-case":"off","info-contact":"off","info-license-strict":"error","no-channel-trailing-slash":"off","no-duplicated-tag-names":"error","no-enum-type-mismatch":"error","no-required-schema-properties-undefined":"error","no-schema-type-mismatch":"error","operation-operationId":"error","tag-description":"error","tags-alphabetical":"off"},async3Rules:{"channels-kebab-case":"off","info-contact":"off","info-license-strict":"error","no-channel-trailing-slash":"off","no-duplicated-tag-names":"error","no-enum-type-mismatch":"error","no-required-schema-properties-undefined":"error","no-schema-type-mismatch":"error","operation-operationId":"error","tag-description":"error","tags-alphabetical":"off"},arazzo1Rules:{"criteria-unique":"error","no-criteria-xpath":"off","no-enum-type-mismatch":"error","no-required-schema-properties-undefined":"error","no-schema-type-mismatch":"error","no-x-security-both-scheme-and-scheme-name":"off","no-x-security-scheme-name-without-openapi":"off","outputs-defined":"error","parameters-unique":"error","requestBody-replacements-unique":"error","respect-supported-versions":"off","sourceDescription-name-unique":"error","sourceDescription-type":"error","sourceDescriptions-not-empty":"error","step-onFailure-unique":"error","step-onSuccess-unique":"error","stepId-unique":"error","workflow-dependsOn":"error","workflowId-unique":"error","x-security-scheme-name-reference":"off","x-security-scheme-required-values":"off"},overlay1Rules:{"info-contact":"off"},openrpc1Rules:{"info-contact":"off","info-license":"error","no-unused-components":"error","spec-no-duplicated-method-params":"error","spec-no-required-params-after-optional":"error"}},$ye={rules:{struct:"error","no-unresolved-refs":"error"},oas2Rules:{"boolean-parameter-prefixes":"off","info-contact":"off","info-license":"warn","info-license-strict":"warn","no-ambiguous-paths":"warn","no-duplicated-tag-names":"warn","no-enum-type-mismatch":"error","no-http-verbs-in-paths":"off","no-identical-paths":"error","no-invalid-parameter-examples":"warn","no-invalid-schema-examples":"warn","no-path-trailing-slash":"error","no-required-schema-properties-undefined":"warn","no-schema-type-mismatch":"error","operation-2xx-response":"warn","operation-4xx-response":"warn","operation-description":"off","operation-operationId":"warn","operation-operationId-unique":"error","operation-operationId-url-safe":"error","operation-parameters-unique":"error","operation-singular-tag":"off","operation-summary":"error","operation-tag-defined":"off","parameter-description":"off","path-declaration-must-exist":"error","path-http-verbs-order":"off","path-not-include-query":"error","path-params-defined":"off","path-parameters-defined":"error","path-segment-plural":"off","paths-kebab-case":"off","request-mime-type":"off","required-string-property-missing-min-length":"off","response-contains-header":"off","response-contains-property":"off","response-mime-type":"off","scalar-property-missing-example":"off","security-defined":"error","spec-strict-refs":"off","tag-description":"warn","tags-alphabetical":"off"},oas3_0Rules:{"array-parameter-serialization":"off","boolean-parameter-prefixes":"off","component-name-unique":"off","info-contact":"off","info-license":"warn","info-license-strict":"warn","no-ambiguous-paths":"warn","no-duplicated-tag-names":"warn","no-empty-servers":"error","no-enum-type-mismatch":"error","no-example-value-and-externalValue":"error","no-http-verbs-in-paths":"off","no-identical-paths":"error","no-invalid-media-type-examples":{severity:"warn",allowAdditionalProperties:!1},"no-invalid-parameter-examples":"warn","no-invalid-schema-examples":"warn","no-path-trailing-slash":"error","no-required-schema-properties-undefined":"warn","no-schema-type-mismatch":"error","no-server-example.com":"warn","no-server-trailing-slash":"error","no-server-variables-empty-enum":"error","no-undefined-server-variable":"error","no-unused-components":"warn","nullable-type-sibling":"error","operation-2xx-response":"warn","operation-4xx-problem-details-rfc7807":"off","operation-4xx-response":"warn","operation-description":"off","operation-operationId":"warn","operation-operationId-unique":"error","operation-operationId-url-safe":"error","operation-parameters-unique":"error","operation-singular-tag":"off","operation-summary":"error","operation-tag-defined":"off","parameter-description":"off","path-declaration-must-exist":"error","path-http-verbs-order":"off","path-not-include-query":"error","path-params-defined":"off","path-parameters-defined":"error","path-segment-plural":"off","paths-kebab-case":"off","request-mime-type":"off","required-string-property-missing-min-length":"off","response-contains-header":"off","response-contains-property":"off","response-mime-type":"off","scalar-property-missing-example":"off","security-defined":"error","spec-components-invalid-map-name":"error","spec-example-values":"off","spec-strict-refs":"off","tag-description":"warn","tags-alphabetical":"off"},oas3_1Rules:{"array-parameter-serialization":"off","boolean-parameter-prefixes":"off","component-name-unique":"off","info-contact":"off","info-license":"warn","info-license-strict":"warn","no-ambiguous-paths":"warn","no-duplicated-tag-names":"warn","no-empty-servers":"error","no-enum-type-mismatch":"error","no-example-value-and-externalValue":"error","no-http-verbs-in-paths":"off","no-identical-paths":"error","no-invalid-media-type-examples":"warn","no-invalid-parameter-examples":"warn","no-invalid-schema-examples":"warn","no-path-trailing-slash":"error","no-required-schema-properties-undefined":"warn","no-schema-type-mismatch":"error","no-server-example.com":"warn","no-server-trailing-slash":"error","no-server-variables-empty-enum":"error","no-undefined-server-variable":"error","no-unused-components":"warn","operation-2xx-response":"warn","operation-4xx-problem-details-rfc7807":"off","operation-4xx-response":"warn","operation-description":"off","operation-operationId":"warn","operation-operationId-unique":"error","operation-operationId-url-safe":"error","operation-parameters-unique":"error","operation-singular-tag":"off","operation-summary":"error","operation-tag-defined":"off","parameter-description":"off","path-declaration-must-exist":"error","path-http-verbs-order":"off","path-not-include-query":"error","path-params-defined":"off","path-parameters-defined":"error","path-segment-plural":"off","paths-kebab-case":"off","request-mime-type":"off","required-string-property-missing-min-length":"off","response-contains-header":"off","response-contains-property":"off","response-mime-type":"off","scalar-property-missing-example":"off","security-defined":"error","spec-components-invalid-map-name":"error","spec-example-values":"off","spec-strict-refs":"off","tag-description":"warn","tags-alphabetical":"off"},oas3_2Rules:{"array-parameter-serialization":"off","boolean-parameter-prefixes":"off","component-name-unique":"off","info-contact":"off","info-license":"warn","info-license-strict":"warn","no-ambiguous-paths":"warn","no-duplicated-tag-names":"warn","no-empty-servers":"error","no-enum-type-mismatch":"error","no-http-verbs-in-paths":"off","no-identical-paths":"error","no-invalid-media-type-examples":"warn","no-invalid-parameter-examples":"warn","no-invalid-schema-examples":"warn","no-path-trailing-slash":"error","no-required-schema-properties-undefined":"warn","no-schema-type-mismatch":"error","no-server-example.com":"warn","no-server-trailing-slash":"error","no-server-variables-empty-enum":"error","no-undefined-server-variable":"error","no-unused-components":"warn","operation-2xx-response":"warn","operation-4xx-problem-details-rfc7807":"off","operation-4xx-response":"warn","operation-description":"off","operation-operationId":"warn","operation-operationId-unique":"error","operation-operationId-url-safe":"error","operation-parameters-unique":"error","operation-singular-tag":"off","operation-summary":"error","operation-tag-defined":"off","parameter-description":"off","path-declaration-must-exist":"error","path-http-verbs-order":"off","path-not-include-query":"error","path-params-defined":"off","path-parameters-defined":"error","path-segment-plural":"off","paths-kebab-case":"off","request-mime-type":"off","required-string-property-missing-min-length":"off","response-contains-header":"off","response-contains-property":"off","response-mime-type":"off","scalar-property-missing-example":"off","security-defined":"error","spec-components-invalid-map-name":"error","spec-discriminator-defaultMapping":"warn","spec-example-values":"error","spec-no-invalid-encoding-combinations":"error","spec-no-invalid-tag-parents":"error","spec-querystring-parameters":"error","spec-strict-refs":"off","tag-description":"warn","tags-alphabetical":"off"},async2Rules:{"channels-kebab-case":"off","info-contact":"off","info-license-strict":"warn","no-channel-trailing-slash":"off","no-duplicated-tag-names":"warn","no-enum-type-mismatch":"error","no-required-schema-properties-undefined":"warn","no-schema-type-mismatch":"error","operation-operationId":"warn","tag-description":"warn","tags-alphabetical":"off"},async3Rules:{"channels-kebab-case":"off","info-contact":"off","info-license-strict":"warn","no-channel-trailing-slash":"off","no-duplicated-tag-names":"warn","no-enum-type-mismatch":"error","no-required-schema-properties-undefined":"warn","no-schema-type-mismatch":"error","operation-operationId":"warn","tag-description":"warn","tags-alphabetical":"off"},arazzo1Rules:{"criteria-unique":"warn","no-criteria-xpath":"off","no-enum-type-mismatch":"error","no-required-schema-properties-undefined":"warn","no-schema-type-mismatch":"error","no-x-security-both-scheme-and-scheme-name":"off","no-x-security-scheme-name-without-openapi":"off","outputs-defined":"warn","parameters-unique":"error","requestBody-replacements-unique":"warn","respect-supported-versions":"off","sourceDescription-name-unique":"error","sourceDescription-type":"error","sourceDescriptions-not-empty":"error","step-onFailure-unique":"warn","step-onSuccess-unique":"warn","stepId-unique":"error","workflow-dependsOn":"error","workflowId-unique":"error","x-security-scheme-name-reference":"off","x-security-scheme-required-values":"off"},overlay1Rules:{"info-contact":"off"},openrpc1Rules:{"info-license":"warn","no-unused-components":"warn","info-contact":"off","spec-no-duplicated-method-params":"error","spec-no-required-params-after-optional":"error"}},kye={rules:{struct:"error","no-unresolved-refs":"error"},oas2Rules:{"boolean-parameter-prefixes":"off","info-contact":"off","info-license":"off","info-license-strict":"off","no-ambiguous-paths":"off","no-duplicated-tag-names":"error","no-enum-type-mismatch":"off","no-http-verbs-in-paths":"off","no-identical-paths":"error","no-invalid-parameter-examples":"off","no-invalid-schema-examples":"off","no-path-trailing-slash":"off","no-required-schema-properties-undefined":"off","no-schema-type-mismatch":"off","operation-2xx-response":"off","operation-4xx-response":"off","operation-description":"off","operation-operationId":"off","operation-operationId-unique":"error","operation-operationId-url-safe":"off","operation-parameters-unique":"error","operation-singular-tag":"off","operation-summary":"off","operation-tag-defined":"off","parameter-description":"off","path-declaration-must-exist":"error","path-http-verbs-order":"off","path-not-include-query":"error","path-params-defined":"off","path-parameters-defined":"error","path-segment-plural":"off","paths-kebab-case":"off","request-mime-type":"off","required-string-property-missing-min-length":"off","response-contains-header":"off","response-contains-property":"off","response-mime-type":"off","scalar-property-missing-example":"off","security-defined":"off","spec-strict-refs":"error","tag-description":"off","tags-alphabetical":"off"},oas3_0Rules:{"array-parameter-serialization":"off","boolean-parameter-prefixes":"off","component-name-unique":"off","info-contact":"off","info-license":"off","info-license-strict":"off","no-ambiguous-paths":"off","no-duplicated-tag-names":"error","no-empty-servers":"off","no-enum-type-mismatch":"off","no-example-value-and-externalValue":"error","no-http-verbs-in-paths":"off","no-identical-paths":"error","no-invalid-media-type-examples":{severity:"off",allowAdditionalProperties:!1},"no-invalid-parameter-examples":"off","no-invalid-schema-examples":"off","no-path-trailing-slash":"off","no-required-schema-properties-undefined":"off","no-schema-type-mismatch":"off","no-server-example.com":"off","no-server-trailing-slash":"off","no-server-variables-empty-enum":"off","no-undefined-server-variable":"error","no-unused-components":"off","nullable-type-sibling":"error","operation-2xx-response":"off","operation-4xx-problem-details-rfc7807":"off","operation-4xx-response":"off","operation-description":"off","operation-operationId":"off","operation-operationId-unique":"error","operation-operationId-url-safe":"off","operation-parameters-unique":"error","operation-singular-tag":"off","operation-summary":"off","operation-tag-defined":"off","parameter-description":"off","path-declaration-must-exist":"error","path-http-verbs-order":"off","path-not-include-query":"error","path-params-defined":"off","path-parameters-defined":"error","path-segment-plural":"off","paths-kebab-case":"off","request-mime-type":"off","required-string-property-missing-min-length":"off","response-contains-header":"off","response-contains-property":"off","response-mime-type":"off","scalar-property-missing-example":"off","security-defined":"off","spec-components-invalid-map-name":"error","spec-example-values":"off","spec-strict-refs":"error","tag-description":"off","tags-alphabetical":"off"},oas3_1Rules:{"array-parameter-serialization":"off","boolean-parameter-prefixes":"off","component-name-unique":"off","info-contact":"off","info-license":"off","info-license-strict":"off","no-ambiguous-paths":"off","no-duplicated-tag-names":"error","no-empty-servers":"off","no-enum-type-mismatch":"off","no-example-value-and-externalValue":"error","no-http-verbs-in-paths":"off","no-identical-paths":"error","no-invalid-media-type-examples":"off","no-invalid-parameter-examples":"off","no-invalid-schema-examples":"off","no-path-trailing-slash":"off","no-required-schema-properties-undefined":"off","no-schema-type-mismatch":"off","no-server-example.com":"off","no-server-trailing-slash":"off","no-server-variables-empty-enum":"off","no-undefined-server-variable":"error","no-unused-components":"off","operation-2xx-response":"off","operation-4xx-problem-details-rfc7807":"off","operation-4xx-response":"off","operation-description":"off","operation-operationId":"off","operation-operationId-unique":"error","operation-operationId-url-safe":"off","operation-parameters-unique":"error","operation-singular-tag":"off","operation-summary":"off","operation-tag-defined":"off","parameter-description":"off","path-declaration-must-exist":"error","path-http-verbs-order":"off","path-not-include-query":"error","path-params-defined":"off","path-parameters-defined":"error","path-segment-plural":"off","paths-kebab-case":"off","request-mime-type":"off","required-string-property-missing-min-length":"off","response-contains-header":"off","response-contains-property":"off","response-mime-type":"off","scalar-property-missing-example":"off","security-defined":"off","spec-components-invalid-map-name":"error","spec-example-values":"off","spec-strict-refs":"error","tag-description":"off","tags-alphabetical":"off"},oas3_2Rules:{"array-parameter-serialization":"off","boolean-parameter-prefixes":"off","component-name-unique":"off","info-contact":"off","info-license":"off","info-license-strict":"off","no-ambiguous-paths":"off","no-duplicated-tag-names":"error","no-empty-servers":"off","no-enum-type-mismatch":"off","no-http-verbs-in-paths":"off","no-identical-paths":"error","no-invalid-media-type-examples":"off","no-invalid-parameter-examples":"off","no-invalid-schema-examples":"off","no-path-trailing-slash":"off","no-required-schema-properties-undefined":"off","no-schema-type-mismatch":"off","no-server-example.com":"off","no-server-trailing-slash":"off","no-server-variables-empty-enum":"off","no-undefined-server-variable":"error","no-unused-components":"off","operation-2xx-response":"off","operation-4xx-problem-details-rfc7807":"off","operation-4xx-response":"off","operation-description":"off","operation-operationId":"off","operation-operationId-unique":"error","operation-operationId-url-safe":"off","operation-parameters-unique":"error","operation-singular-tag":"off","operation-summary":"off","operation-tag-defined":"off","parameter-description":"off","path-declaration-must-exist":"error","path-http-verbs-order":"off","path-not-include-query":"error","path-params-defined":"off","path-parameters-defined":"error","path-segment-plural":"off","paths-kebab-case":"off","request-mime-type":"off","required-string-property-missing-min-length":"off","response-contains-header":"off","response-contains-property":"off","response-mime-type":"off","scalar-property-missing-example":"off","security-defined":"off","spec-components-invalid-map-name":"error","spec-discriminator-defaultMapping":"error","spec-example-values":"error","spec-no-invalid-encoding-combinations":"error","spec-no-invalid-tag-parents":"error","spec-querystring-parameters":"error","spec-strict-refs":"error","tag-description":"off","tags-alphabetical":"off"},async2Rules:{"channels-kebab-case":"off","info-contact":"off","info-license-strict":"off","no-channel-trailing-slash":"off","no-duplicated-tag-names":"off","no-enum-type-mismatch":"off","no-required-schema-properties-undefined":"off","no-schema-type-mismatch":"off","operation-operationId":"off","tag-description":"off","tags-alphabetical":"off"},async3Rules:{"channels-kebab-case":"off","info-contact":"off","info-license-strict":"off","no-channel-trailing-slash":"off","no-duplicated-tag-names":"off","no-enum-type-mismatch":"off","no-required-schema-properties-undefined":"off","no-schema-type-mismatch":"off","operation-operationId":"off","tag-description":"off","tags-alphabetical":"off"},arazzo1Rules:{"criteria-unique":"error","no-criteria-xpath":"off","no-enum-type-mismatch":"off","no-required-schema-properties-undefined":"off","no-schema-type-mismatch":"off","no-x-security-both-scheme-and-scheme-name":"off","no-x-security-scheme-name-without-openapi":"off","outputs-defined":"error","parameters-unique":"error","requestBody-replacements-unique":"error","respect-supported-versions":"off","sourceDescription-name-unique":"error","sourceDescription-type":"error","sourceDescriptions-not-empty":"error","step-onFailure-unique":"error","step-onSuccess-unique":"error","stepId-unique":"error","workflow-dependsOn":"error","workflowId-unique":"error","x-security-scheme-name-reference":"off","x-security-scheme-required-values":"off"},overlay1Rules:{"info-contact":"off"},openrpc1Rules:{"info-contact":"off","info-license":"off","no-unused-components":"off","spec-no-duplicated-method-params":"error","spec-no-required-params-after-optional":"error"}},Tye={recommended:$ye,"recommended-strict":Cye,minimal:Pye,all:wye,spec:kye},$Q={id:"",rules:{oas3:hye,oas2:Lge,async2:yge,async3:xge,arazzo1:pge,overlay1:xye,openrpc1:vye},preprocessors:{oas3:mye,oas2:qge,async2:Oge,async3:Sge,arazzo1:hge,overlay1:Sye,openrpc1:bye},decorators:{oas3:Hhe,oas2:Zhe,async2:Uhe,async3:Bhe,arazzo1:Vhe,overlay1:Khe,openrpc1:Jhe},configs:Tye};function Th(t,e){return t+"::"+e}function Eye(){return new Promise(t=>{setTimeout(t)})}class hf{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 OA extends Error{constructor(e){super(e.message),this.originalError=e,Object.setPrototypeOf(this,OA.prototype)}}function Aye(t,e){const r=new hf(e,t);try{return{source:r,parsed:hA(t,{filename:e})}}catch(n){throw new Gf(n,r)}}class Gx{constructor(e={http:{headers:[]}}){this.config=e,this.cache=new Map}getFiles(){return new Set(Array.from(this.cache.keys()))}resolveExternalRef(e,r){return cn(r)?r:e&&cn(e)?new URL(r,e).href:yr.resolve(e?yr.dirname(e):process.cwd(),r)}async loadExternalRef(e){try{if(cn(e)){const{body:r,mimeType:n}=await bV(e,this.config.http);return new hf(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 hf(e,r.replace(/\r\n/g,`
|
|
109
109
|
`))}}catch(r){throw r.message=r.message.replace(", lstat",""),new OA(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:hA(e.body,{filename:e.absoluteRef})}}catch(i){throw new Gf(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 kQ(t,e){return{prev:t,node:e}}function Iye(t,e){for(;t;){if(t.node===e)return!0;t=t.prev}return!1}const Rp={name:"unknown",properties:{}},Rye={name:"scalar",properties:{}};async function am(t){const{rootDocument:e,externalRefResolver:r,rootType:n}=t,i=new Map,o=new Set,s=[];l(e.parsed,e,"#/",n);let a;do a=await Promise.all(s);while(s.length!==a.length);return i;function l(c,u,d,p){const h=u.source.absoluteRef,g=new Map;m(c,p,h+d);function m(O,v,b){if(typeof O!="object"||O===null)return;const S=`${v.name}::${b}`;if(o.has(S))return;o.add(S);const[x,$]=Object.entries(O).find(([C])=>C==="$anchor")||[];if($&&g.set(`#${$}`,O),Array.isArray(O)){const C=v.items;if(C===void 0&&v!==Rp&&v!==Jc)return;const T=typeof C=="function";for(let I=0;I<O.length;I++){let Q=T?C(O[I],Sd(b,I)):C;if(Q===void 0&&v!==Rp&&v!==Jc)continue;const _=Q?.directResolveAs?{$ref:O[I]}:O[I];Q=Q?.directResolveAs||Q,m(_,Kc(Q)?Q:Rp,Sd(b,I))}return}for(const C of Object.keys(O)){let T=O[C],I=ac(v.properties,C);I===void 0&&(I=v.additionalProperties),typeof I=="function"&&(I=I(T,C)),I===void 0&&(I=Rp),v.extensionsPrefix&&C.startsWith(v.extensionsPrefix)&&I===Rp&&(I=Jc),!Kc(I)&&I?.directResolveAs&&(I=I.directResolveAs,T={$ref:T}),I&&I.name===void 0&&I.resolvable!==!1&&(I=Rye),!(!Kc(I)||typeof T!="object")&&m(T,I,Sd(b,$h(C)))}if(Xr(O)){const C=y(u,O,{prev:null,node:O}).then(T=>{T.resolved&&l(T.node,T.document,T.nodePointer,v)});s.push(C)}if(xV(O)){const C=y(u,{$ref:O.externalValue},{prev:null,node:O}).then(T=>{T.resolved&&l(T.node,T.document,T.nodePointer,v)});s.push(C)}}async function y(O,v,b){if(Iye(b.prev,v))throw new Error("Self-referencing circular pointer");if(sie(v.$ref)){await Eye();const M={resolved:!0,isRemote:!1,node:g.get(v.$ref),document:O,nodePointer:v.$ref},L=Th(O.source.absoluteRef,v.$ref);return i.set(L,M),M}const{uri:S,pointer:x}=iie(v.$ref),$=S!==null&&r.resolveExternalRef(O.source.absoluteRef,S)!==O.source.absoluteRef;let C;try{C=$?await r.resolveDocument(O.source.absoluteRef,S):O}catch(M){const L={resolved:!1,isRemote:$,document:void 0,error:M},V=Th(O.source.absoluteRef,v.$ref);return i.set(V,L),L}let T={resolved:!0,document:C,isRemote:$,node:O.parsed,nodePointer:"#/"},I=C.parsed;const Q=x;for(const M of Q)if(typeof I!="object"){I=void 0;break}else if(I[M]!==void 0)I=I[M],T.nodePointer=Sd(T.nodePointer,$h(M));else if(Xr(I)){if(T=await y(C,I,kQ(b,I)),C=T.document||C,typeof T.node!="object"){I=void 0;break}I=T.node[M],T.nodePointer=Sd(T.nodePointer,$h(M))}else{I=void 0;break}T.node=I,T.document=C;const _=Th(O.source.absoluteRef,v.$ref);return T.document&&Xr(I)&&(T=await y(T.document,I,kQ(b,I))),i.set(_,T),{...T}}}}const jye={Root:"DefinitionRoot",ServerVariablesMap:"ServerVariableMap",Paths:["PathMap","PathsMap"],CallbacksMap:"CallbackMap",MediaTypesMap:"MediaTypeMap",ExamplesMap:"ExampleMap",EncodingMap:"EncodingsMap",HeadersMap:"HeaderMap",LinksMap:"LinkMap",OAuth2Flows:"SecuritySchemeFlows",Responses:"ResponsesMap"};function mf(t,e){const r={};r.any={enter:[],leave:[]};for(const s of Object.keys(e))r[s]={enter:[],leave:[]};r.ref={enter:[],leave:[]};for(const{ruleId:s,severity:a,message:l,visitor:c}of t)o({ruleId:s,severity:a,message:l},c,null);for(const s of Object.keys(r))r[s].enter.sort((a,l)=>l.depth-a.depth),r[s].leave.sort((a,l)=>a.depth-l.depth);return r;function n(s,a,l,c,u=[]){if(u.includes(a))return;u=[...u,a];const d=new Set;for(const h of Object.values(a.properties)){if(h===l){p(s,u);continue}lt(h)&&h.name!==void 0&&d.add(h)}a.additionalProperties&&typeof a.additionalProperties!="function"&&(a.additionalProperties===l?p(s,u):a.additionalProperties.name!==void 0&&d.add(a.additionalProperties)),a.items&&typeof a.items!="function"&&(a.items===l?p(s,u):a.items.name!==void 0&&d.add(a.items)),a.extensionsPrefix&&d.add(Jc);for(const h of Array.from(d.values()))n(s,h,l,c,u);function p(h,g){for(const m of g.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 p=a[d]||i(a,jye[d]),h=r[d];if(!p)continue;let g,m,y;const O=lt(p);if(d==="ref"&&O&&p.skip)throw new Error("ref() visitor does not support skip");typeof p=="function"?g=p:O&&(g=p.enter,m=p.leave,y=p.skip);const v=(g?1:0)+(m?1:0)+(y?1:0),b=O&&Object.keys(p).length>v,S={activatedOn:null,type:e[d],parent:l,isSkippedLevel:!1};if(b&&o(s,p,S,c+1),l&&n(s,l.type,e[d],l),g||O){if(g&&typeof g!="function")throw new Error("DEV: should be function");h.enter.push({...s,visit:g||(()=>{}),skip:y,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})}}}}const Jt=(t,e)=>{if(e)for(const r of Object.keys(e))lt(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)&&(lt(t[r])&&typeof e[r]=="string"?t[r]={...t[r],severity:e[r]}:t[r]=e[r])}function _ye(t){if(t.indexOf("/")>-1){const[e,r]=t.split("/");return{pluginId:e,configName:r}}else return{pluginId:"",configName:t}}function zr(t,e){if(!e)return t;const r={};for(const n of Object.keys(t))r[`${e}/${n}`]=t[n];return r}function gW(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(lt(r)&&"extends"in r&&r.extends!==void 0)throw new Error(`'extends' is not supported in shared configs yet:
|
|
110
110
|
${JSON.stringify(r,null,2)}`);Jt(e.rules,r.rules),Jt(e.oas2Rules,r.oas2Rules),dr(e.oas2Rules,r.rules),Jt(e.oas3_0Rules,r.oas3_0Rules),dr(e.oas3_0Rules,r.rules),Jt(e.oas3_1Rules,r.oas3_1Rules),dr(e.oas3_1Rules,r.rules),Jt(e.oas3_2Rules,r.oas3_2Rules),dr(e.oas3_2Rules,r.rules),Jt(e.async2Rules,r.async2Rules),dr(e.async2Rules,r.rules),Jt(e.async3Rules,r.async3Rules),dr(e.async3Rules,r.rules),Jt(e.arazzo1Rules,r.arazzo1Rules),dr(e.arazzo1Rules,r.rules),Jt(e.overlay1Rules,r.overlay1Rules),dr(e.overlay1Rules,r.rules),Jt(e.openrpc1Rules,r.openrpc1Rules),dr(e.openrpc1Rules,r.rules),Jt(e.preprocessors,r.preprocessors),Jt(e.oas2Preprocessors,r.oas2Preprocessors),dr(e.oas2Preprocessors,r.preprocessors),Jt(e.oas3_0Preprocessors,r.oas3_0Preprocessors),dr(e.oas3_0Preprocessors,r.preprocessors),Jt(e.oas3_1Preprocessors,r.oas3_1Preprocessors),dr(e.oas3_1Preprocessors,r.preprocessors),Jt(e.oas3_2Preprocessors,r.oas3_2Preprocessors),dr(e.oas3_2Preprocessors,r.preprocessors),Jt(e.async2Preprocessors,r.async2Preprocessors),dr(e.async2Preprocessors,r.preprocessors),Jt(e.async3Preprocessors,r.async3Preprocessors),dr(e.async3Preprocessors,r.preprocessors),Jt(e.arazzo1Preprocessors,r.arazzo1Preprocessors),dr(e.arazzo1Preprocessors,r.preprocessors),Jt(e.overlay1Preprocessors,r.overlay1Preprocessors),dr(e.overlay1Preprocessors,r.preprocessors),Jt(e.openrpc1Preprocessors,r.openrpc1Preprocessors),dr(e.openrpc1Preprocessors,r.preprocessors),Jt(e.decorators,r.decorators),Jt(e.oas2Decorators,r.oas2Decorators),dr(e.oas2Decorators,r.decorators),Jt(e.oas3_0Decorators,r.oas3_0Decorators),dr(e.oas3_0Decorators,r.decorators),Jt(e.oas3_1Decorators,r.oas3_1Decorators),dr(e.oas3_1Decorators,r.decorators),Jt(e.oas3_2Decorators,r.oas3_2Decorators),dr(e.oas3_2Decorators,r.decorators),Jt(e.async2Decorators,r.async2Decorators),dr(e.async2Decorators,r.decorators),Jt(e.async3Decorators,r.async3Decorators),dr(e.async3Decorators,r.decorators),Jt(e.arazzo1Decorators,r.arazzo1Decorators),dr(e.arazzo1Decorators,r.decorators),Jt(e.overlay1Decorators,r.overlay1Decorators),dr(e.overlay1Decorators,r.decorators),Jt(e.openrpc1Decorators,r.openrpc1Decorators),dr(e.openrpc1Decorators,r.decorators)}return e}function Qye(t){return new Map(JSON.parse(JSON.stringify([...t])))}function TQ(t){return lt(t)&&"id"in t}function Dye(t){return typeof t=="function"}function yW({node:t,ctx:e,plugins:r}){if(!t.extends)return t;const n=(t.extends||[]).map(i=>{if(!cn(i)&&!lu.extname(i))return Yye(i,r);const o=e.resolve({$ref:i});return o.location&&o.node!==void 0?o.node:null}).filter(xo);return gW([...n.map(i=>yW({node:i,ctx:e,plugins:r})),{...t,extends:void 0}])}function jp(t,e){if(lt(t)&&Array.isArray(t.plugins)){const{plugins:r,rootConfigDir:n}=e.getVisitorData();r.push(...t.plugins.map(i=>vW(i,e.location.source.absoluteRef.replace(/^file:\/\//,""),n)))}}const Nye=mf([{severity:"error",ruleId:vB,visitor:{ref:{},ConfigGovernance:{leave(t,e){jp(t,e)}},ConfigApisProperties:{leave(t,e){jp(t,e)}},[ci.ScorecardClassicLevel]:{leave(t,e){jp(t,e)}},"rootRedoclyConfigSchema.scorecardClassic.levels_items":{leave(t,e){jp(t,e)}},ConfigRoot:{leave(t,e){jp(t,e)}}}}],ig);function _p(t,e){if(lt(t)&&t.extends){const{plugins:r}=e.getVisitorData(),n=yW({node:t,ctx:e,plugins:r});Object.assign(t,n),delete t.extends}}const Mye=mf([{severity:"error",ruleId:OB,visitor:{ref:{leave(t,e,r){c$(t,r,e)}},ConfigGovernance:{leave(t,e){_p(t,e)}},ConfigApisProperties:{leave(t,e){_p(t,e)}},[ci.ScorecardClassicLevel]:{leave(t,e){_p(t,e)}},"rootRedoclyConfigSchema.scorecardClassic.levels_items":{leave(t,e){_p(t,e)}},ConfigRoot:{leave(t,e){_p(t,e)}}}}],ig);function EQ(t,e){return{prev:t,value:e}}function AQ(t){return t?.prev??null}function Lye(t){const e={};for(;t.parent;)e[t.parent.type.name]=t.parent.activatedOn?.value.node,t=t.parent;return e}function qye(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 gf(t){const{document:e,rootType:r,normalizedVisitors:n,resolvedRefMap:i,ctx:o}=t,s={},a=new Set;l(e.parsed,r,new av(e.source,"#/"),void 0,"");function l(c,u,d,p,h){const g=(T,I=y.source.absoluteRef)=>{if(!Xr(T))return{location:d,node:T};const Q=Th(I,T.$ref),_=i.get(Q);if(!_)return{location:void 0,node:void 0};const{resolved:M,node:L,document:V,nodePointer:B,error:Z}=_;return{location:M?new av(V.source,B):Z instanceof Gf?new av(Z.source,""):void 0,node:L,error:Z}},m=d;let y=d;const{node:O,location:v,error:b}=g(c),S=new Set;if(Xr(c)){const T=n.ref.enter;for(const{visit:I,ruleId:Q,severity:_,message:M,context:L}of T){S.add(L);const V=$.bind(void 0,Q,_,M);I(c,{report:V,resolve:g,rawNode:c,rawLocation:m,location:d,type:u,parent:p,key:h,parentLocations:{},specVersion:o.specVersion,config:o.config,getVisitorData:C.bind(void 0,Q)},{node:O,location:v,error:b}),v?.source.absoluteRef&&o.refTypes&&o.refTypes.set(v?.source.absoluteRef,u)}}if(O!==void 0&&v&&u.name!=="scalar"){y=v;const T=s[u.name]?.has?.(O);let I=!1;const _=n.any.enter.concat(n[u.name]?.enter||[]),M=[];for(const{context:B,visit:Z,skip:te,ruleId:X,severity:ie,message:q}of _){if(a.has(`${y.absolutePointer}${y.pointer}`))break;if(B.isSkippedLevel)B.parent.activatedOn&&!B.parent.activatedOn.value.nextLevelTypeActivated&&!B.seen.has(c)&&(B.seen.add(c),I=!0,M.push(B));else if(B.parent&&B.parent.activatedOn&&B.activatedOn?.value.withParentNode!==B.parent.activatedOn.value.node&&B.parent.activatedOn.value.nextLevelTypeActivated?.value!==u||!B.parent&&!T){M.push(B);const U={node:O,location:v,nextLevelTypeActivated:null,withParentNode:B.parent?.activatedOn?.value.node,skipped:(B.parent?.activatedOn?.value.skipped||te?.(O,h,{location:d,rawLocation:m,resolve:g,rawNode:c}))??!1};B.activatedOn=EQ(B.activatedOn,U);let H=B.parent;for(;H;)H.activatedOn.value.nextLevelTypeActivated=EQ(H.activatedOn.value.nextLevelTypeActivated,u),H=H.parent;U.skipped||(I=!0,S.add(B),x(Z,O,c,B,X,ie,q))}}if(I||!T){if(s[u.name]=s[u.name]||new Set,s[u.name].add(O),Array.isArray(O)){const B=u.items;if(B!==void 0){const Z=typeof B=="function";for(let te=0;te<O.length;te++){let X=Z?B(O[te],v.child([te]).absolutePointer):B,ie=O[te];X?.directResolveAs&&(X=X.directResolveAs,ie={$ref:ie}),Kc(X)&&l(ie,X,v.child([te]),O,te)}}}else if(lt(O)){const B=Object.keys(u.properties);u.additionalProperties?B.push(...Object.keys(O).filter(Z=>!B.includes(Z))):u.extensionsPrefix&&B.push(...Object.keys(O).filter(Z=>Z.startsWith(u.extensionsPrefix))),Xr(c)&&B.push(...Object.keys(c).filter(Z=>Z!=="$ref"&&!B.includes(Z)));for(const Z of B){let te=O[Z],X=v;te===void 0&&(te=c[Z],X=d);let ie=ac(u.properties,Z);if(ie===void 0&&(ie=u.additionalProperties),typeof ie=="function"&&(ie=ie(te,Z)),ie===void 0&&u.extensionsPrefix&&Z.startsWith(u.extensionsPrefix)&&(ie=Jc),!Kc(ie)&&ie?.directResolveAs&&(ie=ie.directResolveAs,te={$ref:te}),ie&&ie.name===void 0&&ie.resolvable!==!1&&(ie={name:"scalar",properties:{}}),Xr(c[Z])&&ie?.name==="scalar"){l(c[Z],ie,d.child([Z]),c,Z);continue}!Kc(ie)||ie.name==="scalar"&&!Xr(te)||l(te,ie,X.child([Z]),O,Z)}}}const L=n.any.leave,V=(n[u.name]?.leave||[]).concat(L);for(const B of M.reverse())if(B.isSkippedLevel)B.seen.delete(O);else if(B.activatedOn=AQ(B.activatedOn),B.parent){let Z=B.parent;for(;Z;)Z.activatedOn.value.nextLevelTypeActivated=AQ(Z.activatedOn.value.nextLevelTypeActivated),Z=Z.parent}for(const{context:B,visit:Z,ruleId:te,severity:X,message:ie}of V)!B.isSkippedLevel&&S.has(B)&&x(Z,O,c,B,te,X,ie)}if(y=d,Xr(c)){const T=n.ref.leave;for(const{visit:I,ruleId:Q,severity:_,context:M,message:L}of T)if(S.has(M)){const V=$.bind(void 0,Q,_,L);I(c,{report:V,resolve:g,rawNode:c,rawLocation:m,location:d,type:u,parent:p,key:h,parentLocations:{},specVersion:o.specVersion,config:o.config,getVisitorData:C.bind(void 0,Q)},{node:O,location:v,error:b})}}function x(T,I,Q,_,M,L,V){const B=$.bind(void 0,M,L,V);T(I,{report:B,resolve:g,rawNode:Q,location:y,rawLocation:m,type:u,parent:p,key:h,parentLocations:qye(_),specVersion:o.specVersion,config:o.config,ignoreNextVisitorsOnNode:()=>{a.add(`${y.absolutePointer}${y.pointer}`)},getVisitorData:C.bind(void 0,M)},Lye(_),_)}function $(T,I,Q,_){const L=(_.location?Array.isArray(_.location)?_.location:[_.location]:[{...y,reportOnKey:!1}]).map(B=>({...y,reportOnKey:!1,...B})),V=_.forceSeverity||I;V!=="off"&&o.problems.push({ruleId:_.ruleId||T,severity:V,..._,message:Q?Q.replace("{{message}}",_.message):_.message,suggest:_.suggest||[],location:L})}function C(T){return o.visitorsData[T]=o.visitorsData[T]||{},o.visitorsData[T]}}}function IQ(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";case"MediaTypesMap":return"mediaTypes";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 zye({version:t,dereference:e,rootDocument:r,resolvedRefMap:n,keepUrlRefs:i,componentRenamingConflicts:o="warn"}){let s,a;const l={ref:{leave(h,g,m){if(!m.location||m.node===void 0){kh(m,g.report,g.location);return}if(m.location.source===r.source&&m.location.source===g.location.source&&g.type.name!=="scalar"&&!e){h.$ref!==m.location.pointer&&(h.$ref=m.location.pointer);return}if(i&&cn(h.$ref))return;const y=IQ(g.type.name,t);y?e?(u(y,m,g),c$(h,m,g)):(h.$ref=u(y,m,g),c(h,m,g)):c$(h,m,g)}},Example:{leave(h,g){if(xV(h)&&h.value===void 0){const m=g.resolve({$ref:h.externalValue});if(!m.location||m.node===void 0){kh(m,g.report,g.location);return}if(i&&cn(h.externalValue))return;h.value=g.resolve({$ref:h.externalValue}).node,delete h.externalValue}}},Root:{enter(h,g){a=g.location,t==="oas3"?s=h.components=h.components||{}:t==="oas2"?s=h:t==="async2"?s=h.components=h.components||{}:t==="async3"?s=h.components=h.components||{}:t==="arazzo1"?s=h.components=h.components||{}:t==="openrpc1"&&(s=h.components=h.components||{})}}};t==="oas3"&&(l.DiscriminatorMapping={leave(h,g){for(const m of Object.keys(h)){const y=h[m],O=g.resolve({$ref:y});if(!O.location||O.node===void 0){kh(O,g.report,g.location.child(m));return}const v=IQ("Schema",t);h[m]=u(v,O,g)}}});function c(h,g,m){const y=Th(m.location.source.absoluteRef,h.$ref);n.set(y,{document:r,isRemote:!1,node:g.node,nodePointer:h.$ref,resolved:!0})}function u(h,g,m){s[h]=s[h]||{};const y=p(g,h,m);return s[h][y]=g.node,t==="oas3"||t==="async2"||t==="async3"||t==="openrpc1"?`#/components/${h}/${y}`:`#/${h}/${y}`}function d(h,g,m){return Xr(h)&&m.resolve(h,a.absolutePointer).location?.absolutePointer===g.location.absolutePointer?!0:l$(h,g.node)}function p(h,g,m){const[y,O]=[h.location.source.absoluteRef,h.location.pointer],v=s[g];let b="";const S=O.slice(2).split("/").filter(xo);for(;S.length>0;)if(b=S.pop()+(b?`-${b}`:""),!v||!v[b]||d(v[b],h,m))return b;if(b=oie(y)+(b?`_${b}`:""),!v[b]||d(v[b],h,m))return b;const x=b;let $=2;for(;v[b]&&!d(v[b],h,m);)b=`${x}-${$}`,$++;return v[b]||m.report({message:`Two schemas are referenced with the same name but different content. Renamed ${x} to ${b}.`,location:m.location,forceSeverity:o}),b}return l}async function Vye(t){const{document:e,config:r,types:n,externalRefResolver:i,dereference:o=!1,removeUnusedComponents:s=!1,keepUrlRefs:a=!1,componentRenamingConflicts:l}=t,c=Vx(e.parsed),u=$7(c),d=r.getRulesForSpecVersion(u),p=UE(r.extendTypes(n,c),r),h=Eb(d,r,"preprocessors",c),g=Eb(d,r,"decorators",c),m={problems:[],specVersion:c,config:r,refTypes:new Map,visitorsData:{}};s&&!g.some(v=>v.ruleId==="remove-unused-components")&&g.push({severity:"error",ruleId:"remove-unused-components",visitor:u==="oas2"?IB():RB()});let y=await am({rootDocument:e,rootType:p.Root,externalRefResolver:i});h.length>0&&(gf({document:e,rootType:p.Root,normalizedVisitors:mf(h,p),resolvedRefMap:y,ctx:m}),y=await am({rootDocument:e,rootType:p.Root,externalRefResolver:i}));const O=mf([{severity:"error",ruleId:"bundler",visitor:zye({version:u,dereference:o,rootDocument:e,resolvedRefMap:y,keepUrlRefs:a,componentRenamingConflicts:l})},...g],p);return gf({document:e,rootType:p.Root,normalizedVisitors:O,resolvedRefMap:y,ctx:m}),{bundle:e,problems:m.problems.map(v=>r.addProblemToIgnore(v)),fileDependencies:i.getFiles(),rootType:p.Root,refTypes:m.refTypes,visitorsData:m.visitorsData}}function Uye(t,e,r){const n={plugins:[],rootConfigDir:r},i={problems:[],specVersion:"oas3_0",refTypes:new Map,visitorsData:{[vB]:n}};return gf({document:t,rootType:ig.ConfigRoot,normalizedVisitors:Nye,resolvedRefMap:e,ctx:i}),n.plugins}function Bye(t,e,r){const n={plugins:r},i={problems:[],specVersion:"oas3_0",refTypes:new Map,visitorsData:{[OB]:n}};return gf({document:t,rootType:ig.ConfigRoot,normalizedVisitors:Mye,resolvedRefMap:e,ctx:i}),t.parsed??{}}async function OW(t){const{ref:e,doc:r,externalRefResolver:n=new Gx(t.config.resolve),base:i=null}=t;if(!(e||r))throw new Error(`Document or reference is required.
|
|
111
|
-
`);const o=r===void 0?await n.resolveDocument(i,e,!0):r;if(o instanceof Error)throw o;return t.collectSpecData?.(o.parsed),Vye({document:o,...t,externalRefResolver:n,types:JE(Vx(o.parsed))})}function Wye(t){return!no(t)}const aw=new Map;async function Xye({rawConfigDocument:t,configPath:e,externalRefResolver:r,customExtends:n}){const i=t===void 0?jhe:t.parsed;if(n!==void 0&<(i)&&(i.extends=n),lt(i)&&i?.extends?.some(Wye))throw new Error("Configuration format not detected in extends: values must be strings.");const o=t??{source:new hf(e??"",JSON.stringify(i)),parsed:i},s=await am({rootDocument:o,rootType:ig.ConfigRoot,externalRefResolver:r??new Gx(bB(i?.resolve))});let a=[],l,c="";Ki?l=[...(i?.plugins||[]).filter(h=>!no(h)),$Q]:(c=yr.dirname(e??""),a=Uye(o,s,c),l=[...await Zye(a.map(h=>RQ(h)?h.absolutePath:h),c),$Q]);const u=Bye(o,Qye(s),l);u.apis&&(u.apis=Object.fromEntries(Object.entries(u.apis).map(([p,h])=>{const g=gW([u,h]);return[p,{...h,...g}]})));const d=a.length?a.map(p=>RQ(p)&&p.isModule?p.rawPath:p.absolutePath&&yr.relative(c,p.absolutePath)).filter(cu):void 0;return{resolvedConfig:{...u,plugins:d},resolvedRefMap:s,plugins:l}}function Fye(t){for(const e of Dhe)(void 0)(yr.resolve(t,e))}function RQ(t){return"isModule"in t}const vW=(t,e,r)=>{if(!no(t))return t;const n=yr.resolve(yr.dirname(e),t);return(void 0)(n)?{absolutePath:n,rawPath:t,isModule:!1}:{absolutePath:gV.createRequire((typeof document>"u"?require("url").pathToFileURL(__filename).href:Ca&&Ca.tagName.toUpperCase()==="SCRIPT"&&Ca.src||new URL("replay-index-
|
|
111
|
+
`);const o=r===void 0?await n.resolveDocument(i,e,!0):r;if(o instanceof Error)throw o;return t.collectSpecData?.(o.parsed),Vye({document:o,...t,externalRefResolver:n,types:JE(Vx(o.parsed))})}function Wye(t){return!no(t)}const aw=new Map;async function Xye({rawConfigDocument:t,configPath:e,externalRefResolver:r,customExtends:n}){const i=t===void 0?jhe:t.parsed;if(n!==void 0&<(i)&&(i.extends=n),lt(i)&&i?.extends?.some(Wye))throw new Error("Configuration format not detected in extends: values must be strings.");const o=t??{source:new hf(e??"",JSON.stringify(i)),parsed:i},s=await am({rootDocument:o,rootType:ig.ConfigRoot,externalRefResolver:r??new Gx(bB(i?.resolve))});let a=[],l,c="";Ki?l=[...(i?.plugins||[]).filter(h=>!no(h)),$Q]:(c=yr.dirname(e??""),a=Uye(o,s,c),l=[...await Zye(a.map(h=>RQ(h)?h.absolutePath:h),c),$Q]);const u=Bye(o,Qye(s),l);u.apis&&(u.apis=Object.fromEntries(Object.entries(u.apis).map(([p,h])=>{const g=gW([u,h]);return[p,{...h,...g}]})));const d=a.length?a.map(p=>RQ(p)&&p.isModule?p.rawPath:p.absolutePath&&yr.relative(c,p.absolutePath)).filter(cu):void 0;return{resolvedConfig:{...u,plugins:d},resolvedRefMap:s,plugins:l}}function Fye(t){for(const e of Dhe)(void 0)(yr.resolve(t,e))}function RQ(t){return"isModule"in t}const vW=(t,e,r)=>{if(!no(t))return t;const n=yr.resolve(yr.dirname(e),t);return(void 0)(n)?{absolutePath:n,rawPath:t,isModule:!1}:{absolutePath:gV.createRequire((typeof document>"u"?require("url").pathToFileURL(__filename).href:Ca&&Ca.tagName.toUpperCase()==="SCRIPT"&&Ca.src||new URL("replay-index-DBu78VZA.js",document.baseURI).href)??__dirname).resolve(t,{paths:[r,(typeof document>"u"?require("url").pathToFileURL(__filename).href:Ca&&Ca.tagName.toUpperCase()==="SCRIPT"&&Ca.src||new URL("replay-index-DBu78VZA.js",document.baseURI).href)?yr.dirname((void 0)(typeof document>"u"?require("url").pathToFileURL(__filename).href:Ca&&Ca.tagName.toUpperCase()==="SCRIPT"&&Ca.src||new URL("replay-index-DBu78VZA.js",document.baseURI).href)):__dirname]}),isModule:!0,rawPath:t}};async function Zye(t,e){if(!t)return[];const r=async a=>{if(!no(a))return a;try{const l=yr.isAbsolute(a)?a:vW(a,yr.join(e,Rhe),e).absolutePath;if(!aw.has(l)){let c;if(typeof __webpack_require__=="function")c=__non_webpack_require__(l);else{const g=await import((void 0)(l).pathname);c=g.default||g}const u={contentDir:e},d=Array.isArray(c)?c:[c];for(const g of d)g?.id&&TQ(g)&&pr.info(`Deprecated plugin format detected: ${g.id}
|
|
112
112
|
`);const p=TQ(c)?c:Dye(c)?await c(u):await c?.default?.(u),h=Array.isArray(p)?p:[p];p&&aw.set(l,h.map(g=>({...g,path:a,absolutePath:l})))}return aw.get(l)}catch(l){throw new Error(`Failed to load plugin "${a}": ${l.message}
|
|
113
113
|
|
|
114
114
|
${l.stack}`)}},n=new Map,i=Fye(e);i&&t.push(i);const o=new Set;return(await Promise.all(t.map(async a=>{if(no(a)){if(cn(a))throw new Error(Lt.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(Lt.red(`Plugin must define \`id\` property in ${Lt.blue(a.toString())}.`));const p=u.absolutePath??a.toString(),h=n.get(d);if(h){if(p!==h)throw new Error(Lt.red(`Plugin "id" must be unique. Plugin ${Lt.blue(p)} uses id "${Lt.blue(d)}" already seen in ${Lt.blue(p)}`));return}n.set(d,p);const g={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}.`);g.rules={},u.rules.oas3&&(g.rules.oas3=zr(u.rules.oas3,d)),u.rules.oas2&&(g.rules.oas2=zr(u.rules.oas2,d)),u.rules.async2&&(g.rules.async2=zr(u.rules.async2,d)),u.rules.async3&&(g.rules.async3=zr(u.rules.async3,d)),u.rules.arazzo1&&(g.rules.arazzo1=zr(u.rules.arazzo1,d)),u.rules.overlay1&&(g.rules.overlay1=zr(u.rules.overlay1,d)),u.rules.openrpc1&&(g.rules.openrpc1=zr(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}.`);g.preprocessors={},u.preprocessors.oas3&&(g.preprocessors.oas3=zr(u.preprocessors.oas3,d)),u.preprocessors.oas2&&(g.preprocessors.oas2=zr(u.preprocessors.oas2,d)),u.preprocessors.async2&&(g.preprocessors.async2=zr(u.preprocessors.async2,d)),u.preprocessors.async3&&(g.preprocessors.async3=zr(u.preprocessors.async3,d)),u.preprocessors.arazzo1&&(g.preprocessors.arazzo1=zr(u.preprocessors.arazzo1,d)),u.preprocessors.overlay1&&(g.preprocessors.overlay1=zr(u.preprocessors.overlay1,d)),u.preprocessors.openrpc1&&(g.preprocessors.openrpc1=zr(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}.`);g.decorators={},u.decorators.oas3&&(g.decorators.oas3=zr(u.decorators.oas3,d)),u.decorators.oas2&&(g.decorators.oas2=zr(u.decorators.oas2,d)),u.decorators.async2&&(g.decorators.async2=zr(u.decorators.async2,d)),u.decorators.async3&&(g.decorators.async3=zr(u.decorators.async3,d)),u.decorators.arazzo1&&(g.decorators.arazzo1=zr(u.decorators.arazzo1,d)),u.decorators.overlay1&&(g.decorators.overlay1=zr(u.decorators.overlay1,d)),u.decorators.openrpc1&&(g.decorators.openrpc1=zr(u.decorators.openrpc1,d))}return u.assertions&&(g.assertions=u.assertions),{...u,...g}}))).filter(cu)}))).filter(cu).flat()}function Yye(t,e){const{pluginId:r,configName:n}=_ye(t),i=e.find(s=>s.id===r);if(!i)throw new Error(`Invalid config ${Lt.red(t)}: plugin ${r} is not included.`);const o=i.configs?.[n];if(!o)throw new Error(r?`Invalid config ${Lt.red(t)}: plugin ${r} doesn't export config with name ${n}.`:`Invalid config ${Lt.red(t)}: there is no such built-in config.`);return o}async function bW(t,{configPath:e,externalRefResolver:r,ignore:n}={}){const o=Aye(typeof t=="string"?t:"",e??"");typeof t!="string"&&t&&(o.parsed=t);const{resolvedConfig:s,resolvedRefMap:a,plugins:l}=await Xye({rawConfigDocument:Gye(o),configPath:e,externalRefResolver:r});return new Bx(s,{configPath:e,document:o,resolvedRefMap:a,plugins:l,ignore:n})}function Gye(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 lw={},Yo={},cw={},jQ;function Hx(){return jQ||(jQ=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})(cw)),cw}var Aa={},_Q;function Jf(){if(_Q)return Aa;_Q=1,Object.defineProperty(Aa,"__esModule",{value:!0});function t(s){return typeof s>"u"||s===null}Aa.isNothing=t;function e(s){return typeof s=="object"&&s!==null}Aa.isObject=e;function r(s){return Array.isArray(s)?s:t(s)?[]:[s]}Aa.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}Aa.extend=n;function i(s,a){var l="",c;for(c=0;c<a;c+=1)l+=s;return l}Aa.repeat=i;function o(s){return s===0&&Number.NEGATIVE_INFINITY===1/s}return Aa.isNegativeZero=o,Aa}var uw,QQ;function lg(){if(QQ)return uw;QQ=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 uw=t,uw}var dw,DQ;function Hye(){if(DQ)return dw;DQ=1;var t=Jf(),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
|
|
@@ -282,7 +282,7 @@ If multiple caches share the same key they might "fight" for each other's style
|
|
|
282
282
|
gap: var(--spacing-xs);
|
|
283
283
|
`,R1e=k.default(Oc)`
|
|
284
284
|
width: 100%;
|
|
285
|
-
`;function pS({input:t,onSave:e,onCancel:r,...n}){const[i,o]=P.useState(!!t.isSecret),s=({name:a,value:l})=>{e({...t,name:a,value:l,isSecret:i})};return f.jsx(GX,{variable:t,onSave:s,onCancel:r,maskValue:i,...n,children:f.jsx(dm,{children:f.jsx(uX,{value:i,onChange:a=>o(a),title:"Make it secret"})})})}const Hb=()=>({name:"",value:"",isSecret:!1}),Rr=t=>mV+"$inputs."+t+zE,HX=(t,e)=>e.inputs.find(r=>r.get().name===t.match(`^${tg}$`)?.[1]);function j1e({environments:t,activeEnvironmentId:e}){return t.get().find(n=>n.name===e.get())?.inputs||[]}function kl(t){const e=new RegExp(tg,"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 Iu(t){const e=/^\{?\$inputs\.([^\}\s]+)\}?$/,r=t.match(e);return r?r[1]:null}function gv(t){const e=new Error(t);return e.source="ulid",e}const BA="0123456789ABCDEFGHJKMNPQRSTVWXYZ",Eh=BA.length,E5=Math.pow(2,48)-1,_1e=10,Q1e=16;function D1e(t){let e=Math.floor(t()*Eh);return e===Eh&&(e=Eh-1),BA.charAt(e)}function N1e(t,e){if(isNaN(t))throw new Error(t+" must be a number");if(t>E5)throw gv("cannot encode time greater than "+E5);if(t<0)throw gv("time must be positive");if(Number.isInteger(Number(t))===!1)throw gv("time must be an integer");let r,n="";for(;e>0;e--)r=t%Eh,n=BA.charAt(r)+n,t=(t-r)/Eh;return n}function M1e(t,e){let r="";for(;t>0;t--)r=D1e(e)+r;return r}function L1e(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 gv("secure crypto unusable, insecure Math.random not allowed")}function q1e(t){return t||(t=L1e()),function(r){return isNaN(r)&&(r=Date.now()),N1e(r,_1e)+M1e(Q1e,t)}}const F$=q1e(),z1e=["id","specversion","object","datacontenttype","type","time","origin","category","signal","source","subject","subjects","data","actor","requestId","analyticsMetadata","organization","project","organizationId","organizationSlug","projectId","projectSlug","osPlatform","userAgent","context"];function V1e(t){const{type:e,data:r,actor:n,requestId:i,analyticsMetadata:o,origin:s,source:a,subjects:l,organizationId:c,organizationSlug:u,projectId:d,projectSlug:p,category:h="product",signal:g="log",osPlatform:m,userAgent:y}=t,O=!!(r&&Array.isArray(r)),v=n?{id:n.id??`ann_${F$()}`,object:n.object??"user",uri:n.uri??""}:null,b=`evt_${F$()}`.toLowerCase(),S=new Date,x=a??v?.uri??null,$={...c!==void 0&&{organizationId:c},...u!==void 0&&{organizationSlug:u},...d!==void 0&&{projectId:d},...p!==void 0&&{projectSlug:p}},C={specversion:"1.0",object:"event",datacontenttype:"application/json; charset=utf-8",origin:s,category:h,signal:g,osPlatform:m,userAgent:y};if(O){const T=r,I=l||T.map(_=>({id:_.id??"",object:_.object??"unknown",uri:_.uri??""})),Q=T[0]?.id??null;Object.assign(C,{...$,id:b,type:e,time:S,source:x,actor:v,subject:Q,subjects:I,context:{ip:o?.userIpAddress},data:T,requestId:i??"",analyticsMetadata:o})}else{const T=(Array.isArray(r)?r[0]:r)?.id??null;Object.assign(C,{...$,id:b,type:e,time:S,source:x,actor:v,subject:T,requestId:i??"",data:r,...a!=null&&{request:{source:a}}})}return C}var U1e=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{},Fc="1.9.0",A5=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function B1e(t){var e=new Set([t]),r=new Set,n=t.match(A5);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(A5);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 W1e=B1e(Fc),X1e=Fc.split(".")[0],ym=Symbol.for("opentelemetry.js.api."+X1e),Om=U1e;function pg(t,e,r,n){var i;n===void 0&&(n=!1);var o=Om[ym]=(i=Om[ym])!==null&&i!==void 0?i:{version:Fc};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!==Fc){var s=new Error("@opentelemetry/api: Registration of version v"+o.version+" for "+t+" does not match previously registered API v"+Fc);return r.error(s.stack||s.message),!1}return o[t]=e,r.debug("@opentelemetry/api: Registered a global for "+t+" v"+Fc+"."),!0}function uu(t){var e,r,n=(e=Om[ym])===null||e===void 0?void 0:e.version;if(!(!n||!W1e(n)))return(r=Om[ym])===null||r===void 0?void 0:r[t]}function hg(t,e){e.debug("@opentelemetry/api: Unregistering a global for "+t+" v"+Fc+".");var r=Om[ym];r&&delete r[t]}var F1e=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},Z1e=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))},Y1e=(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 qp("debug",this._namespace,e)},t.prototype.error=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return qp("error",this._namespace,e)},t.prototype.info=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return qp("info",this._namespace,e)},t.prototype.warn=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return qp("warn",this._namespace,e)},t.prototype.verbose=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return qp("verbose",this._namespace,e)},t})();function qp(t,e,r){var n=uu("diag");if(n)return r.unshift(e),n[t].apply(n,Z1e([],F1e(r),!1))}var Ji;(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"})(Ji||(Ji={}));function G1e(t,e){t<Ji.NONE?t=Ji.NONE:t>Ji.ALL&&(t=Ji.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",Ji.ERROR),warn:r("warn",Ji.WARN),info:r("info",Ji.INFO),debug:r("debug",Ji.DEBUG),verbose:r("verbose",Ji.VERBOSE)}}var H1e=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},J1e=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))},K1e="diag",ca=(function(){function t(){function e(i){return function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];var a=uu("diag");if(a)return a[i].apply(a,J1e([],H1e(o),!1))}}var r=this,n=function(i,o){var s,a,l;if(o===void 0&&(o={logLevel:Ji.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=uu("diag"),d=G1e((a=o.logLevel)!==null&&a!==void 0?a:Ji.INFO,i);if(u&&!o.suppressOverrideMessage){var p=(l=new Error().stack)!==null&&l!==void 0?l:"<failed to generate stacktrace>";u.warn("Current logger will be overwritten from "+p),d.warn("Current logger will overwrite one already registered from "+p)}return pg("diag",d,r,!0)};r.setLogger=n,r.disable=function(){hg(K1e,r)},r.createComponentLogger=function(i){return new Y1e(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})(),ewe=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},twe=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.")},rwe=(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=ewe(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=twe(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})(),nwe=Symbol("BaggageEntryMetadata"),iwe=ca.instance();function owe(t){return t===void 0&&(t={}),new rwe(new Map(Object.entries(t)))}function swe(t){return typeof t!="string"&&(iwe.error("Cannot create baggage metadata from unknown type: "+typeof t),t=""),{__TYPE__:nwe,toString:function(){return t}}}function WA(t){return Symbol.for(t)}var awe=(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})(),$d=new awe,Ru=(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)}})(),lwe=(function(){function t(){}return t.prototype.createGauge=function(e,r){return Owe},t.prototype.createHistogram=function(e,r){return vwe},t.prototype.createCounter=function(e,r){return ywe},t.prototype.createUpDownCounter=function(e,r){return bwe},t.prototype.createObservableGauge=function(e,r){return Swe},t.prototype.createObservableCounter=function(e,r){return xwe},t.prototype.createObservableUpDownCounter=function(e,r){return wwe},t.prototype.addBatchObservableCallback=function(e,r){},t.prototype.removeBatchObservableCallback=function(e){},t})(),hS=(function(){function t(){}return t})(),cwe=(function(t){Ru(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.add=function(r,n){},e})(hS),uwe=(function(t){Ru(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.add=function(r,n){},e})(hS),dwe=(function(t){Ru(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.record=function(r,n){},e})(hS),fwe=(function(t){Ru(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.record=function(r,n){},e})(hS),XA=(function(){function t(){}return t.prototype.addCallback=function(e){},t.prototype.removeCallback=function(e){},t})(),pwe=(function(t){Ru(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(XA),hwe=(function(t){Ru(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(XA),mwe=(function(t){Ru(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(XA),gwe=new lwe,ywe=new cwe,Owe=new dwe,vwe=new fwe,bwe=new uwe,xwe=new pwe,Swe=new hwe,wwe=new mwe,Pwe={get:function(t,e){if(t!=null)return t[e]},keys:function(t){return t==null?[]:Object.keys(t)}},Cwe={set:function(t,e,r){t!=null&&(t[e]=r)}},$we=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},kwe=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))},Twe=(function(){function t(){}return t.prototype.active=function(){return $d},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,kwe([n],$we(i),!1))},t.prototype.bind=function(e,r){return r},t.prototype.enable=function(){return this},t.prototype.disable=function(){return this},t})(),Ewe=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},Awe=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))},Yw="context",Iwe=new Twe,mS=(function(){function t(){}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalContextManager=function(e){return pg(Yw,e,ca.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,Awe([e,r,n],Ewe(o),!1))},t.prototype.bind=function(e,r){return this._getContextManager().bind(e,r)},t.prototype._getContextManager=function(){return uu(Yw)||Iwe},t.prototype.disable=function(){this._getContextManager().disable(),hg(Yw,ca.instance())},t})(),nl;(function(t){t[t.NONE=0]="NONE",t[t.SAMPLED=1]="SAMPLED"})(nl||(nl={}));var JX="0000000000000000",KX="00000000000000000000000000000000",eF={traceId:KX,spanId:JX,traceFlags:nl.NONE},Ah=(function(){function t(e){e===void 0&&(e=eF),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})(),FA=WA("OpenTelemetry Context Key SPAN");function ZA(t){return t.getValue(FA)||void 0}function Rwe(){return ZA(mS.getInstance().active())}function YA(t,e){return t.setValue(FA,e)}function jwe(t){return t.deleteValue(FA)}function _we(t,e){return YA(t,new Ah(e))}function tF(t){var e;return(e=ZA(t))===null||e===void 0?void 0:e.spanContext()}var Qwe=/^([0-9a-f]{32})$/i,Dwe=/^[0-9a-f]{16}$/i;function rF(t){return Qwe.test(t)&&t!==KX}function Nwe(t){return Dwe.test(t)&&t!==JX}function gS(t){return rF(t.traceId)&&Nwe(t.spanId)}function Mwe(t){return new Ah(t)}var Gw=mS.getInstance(),nF=(function(){function t(){}return t.prototype.startSpan=function(e,r,n){n===void 0&&(n=Gw.active());var i=!!r?.root;if(i)return new Ah;var o=n&&tF(n);return Lwe(o)&&gS(o)?new Ah(o):new Ah},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??Gw.active(),c=this.startSpan(e,o,l),u=YA(l,c);return Gw.with(u,a,void 0,c)}},t})();function Lwe(t){return typeof t=="object"&&typeof t.spanId=="string"&&typeof t.traceId=="string"&&typeof t.traceFlags=="number"}var qwe=new nF,zwe=(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):qwe},t})(),Vwe=(function(){function t(){}return t.prototype.getTracer=function(e,r,n){return new nF},t})(),Uwe=new Vwe,I5=(function(){function t(){}return t.prototype.getTracer=function(e,r,n){var i;return(i=this.getDelegateTracer(e,r,n))!==null&&i!==void 0?i:new zwe(this,e,r,n)},t.prototype.getDelegate=function(){var e;return(e=this._delegate)!==null&&e!==void 0?e:Uwe},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})(),Jb;(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(Jb||(Jb={}));var Z$;(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"})(Z$||(Z$={}));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 Za=mS.getInstance(),Bt=ca.instance(),Bwe=(function(){function t(){}return t.prototype.getMeter=function(e,r,n){return gwe},t})(),Wwe=new Bwe,Hw="metrics",Xwe=(function(){function t(){}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalMeterProvider=function(e){return pg(Hw,e,ca.instance())},t.prototype.getMeterProvider=function(){return uu(Hw)||Wwe},t.prototype.getMeter=function(e,r,n){return this.getMeterProvider().getMeter(e,r,n)},t.prototype.disable=function(){hg(Hw,ca.instance())},t})(),iF=Xwe.getInstance(),Fwe=(function(){function t(){}return t.prototype.inject=function(e,r){},t.prototype.extract=function(e,r){return e},t.prototype.fields=function(){return[]},t})(),GA=WA("OpenTelemetry Baggage Key");function oF(t){return t.getValue(GA)||void 0}function Zwe(){return oF(mS.getInstance().active())}function Ywe(t,e){return t.setValue(GA,e)}function Gwe(t){return t.deleteValue(GA)}var Jw="propagation",Hwe=new Fwe,Jwe=(function(){function t(){this.createBaggage=owe,this.getBaggage=oF,this.getActiveBaggage=Zwe,this.setBaggage=Ywe,this.deleteBaggage=Gwe}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalPropagator=function(e){return pg(Jw,e,ca.instance())},t.prototype.inject=function(e,r,n){return n===void 0&&(n=Cwe),this._getGlobalPropagator().inject(e,r,n)},t.prototype.extract=function(e,r,n){return n===void 0&&(n=Pwe),this._getGlobalPropagator().extract(e,r,n)},t.prototype.fields=function(){return this._getGlobalPropagator().fields()},t.prototype.disable=function(){hg(Jw,ca.instance())},t.prototype._getGlobalPropagator=function(){return uu(Jw)||Hwe},t})(),Ih=Jwe.getInstance(),Kw="trace",Kwe=(function(){function t(){this._proxyTracerProvider=new I5,this.wrapSpanContext=Mwe,this.isSpanContextValid=gS,this.deleteSpan=jwe,this.getSpan=ZA,this.getActiveSpan=Rwe,this.getSpanContext=tF,this.setSpan=YA,this.setSpanContext=_we}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalTracerProvider=function(e){var r=pg(Kw,this._proxyTracerProvider,ca.instance());return r&&this._proxyTracerProvider.setDelegate(e),r},t.prototype.getTracerProvider=function(){return uu(Kw)||this._proxyTracerProvider},t.prototype.getTracer=function(e,r){return this.getTracerProvider().getTracer(e,r)},t.prototype.disable=function(){hg(Kw,ca.instance()),this._proxyTracerProvider=new I5},t})(),Ti=Kwe.getInstance();const sF=WA("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function ePe(t){return t.setValue(sF,!0)}function HA(t){return t.getValue(sF)===!0}const tPe="=",Y$=";",G$=",",eP="baggage",rPe=180,nPe=4096,iPe=8192;function oPe(t){return t.reduce((e,r)=>{const n=`${e}${e!==""?G$:""}${r}`;return n.length>iPe?e:n},"")}function sPe(t){return t.getAllEntries().map(([e,r])=>{let n=`${encodeURIComponent(e)}=${encodeURIComponent(r.value)}`;return r.metadata!==void 0&&(n+=Y$+r.metadata.toString()),n})}function aPe(t){const e=t.split(Y$);if(e.length<=0)return;const r=e.shift();if(!r)return;const n=r.indexOf(tPe);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=swe(e.join(Y$))),{key:i,value:o,metadata:s}}class lPe{inject(e,r,n){const i=Ih.getBaggage(e);if(!i||HA(e))return;const o=sPe(i).filter(a=>a.length<=nPe).slice(0,rPe),s=oPe(o);s.length>0&&n.set(r,eP,s)}extract(e,r,n){const i=n.get(r,eP),o=Array.isArray(i)?i.join(G$):i;if(!o)return e;const s={};return o.length===0||(o.split(G$).forEach(l=>{const c=aPe(l);if(c){const u={value:c.value};c.metadata&&(u.metadata=c.metadata),s[c.key]=u}}),Object.entries(s).length===0)?e:Ih.setBaggage(e,Ih.createBaggage(s))}fields(){return[eP]}}function yv(t){const e={};if(typeof t!="object"||t==null)return e;for(const[r,n]of Object.entries(t)){if(!cPe(r)){Bt.warn(`Invalid attribute key: ${r}`);continue}if(!aF(n)){Bt.warn(`Invalid attribute value set for key: ${r}`);continue}Array.isArray(n)?e[r]=n.slice():e[r]=n}return e}function cPe(t){return typeof t=="string"&&t.length>0}function aF(t){return t==null?!0:Array.isArray(t)?uPe(t):lF(t)}function uPe(t){let e;for(const r of t)if(r!=null){if(!e){if(lF(r)){e=typeof r;continue}return!1}if(typeof r!==e)return!1}return!0}function lF(t){switch(typeof t){case"number":case"boolean":case"string":return!0}return!1}function dPe(){return t=>{Bt.error(fPe(t))}}function fPe(t){return typeof t=="string"?t:JSON.stringify(pPe(t))}function pPe(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 hPe=dPe();function bf(t){try{hPe(t)}catch{}}const Gd=performance,mPe="2.0.1",tP="exception.message",gPe="exception.stacktrace",rP="exception.type",yPe="service.name",H$="telemetry.sdk.language",OPe="webjs",J$="telemetry.sdk.name",K$="telemetry.sdk.version",vPe="process.runtime.name",nP={[J$]:"opentelemetry",[vPe]:"browser",[H$]:OPe,[K$]:mPe};const bPe=9,xPe=6,SPe=Math.pow(10,xPe),Kb=Math.pow(10,bPe);function Md(t){const e=t/1e3,r=Math.trunc(e),n=Math.round(t%1e3*SPe);return[r,n]}function cF(){let t=Gd.timeOrigin;if(typeof t!="number"){const e=Gd;t=e.timing&&e.timing.fetchStart}return t}function wPe(t){const e=Md(cF()),r=Md(typeof t=="number"?t:Gd.now());return dF(e,r)}function PPe(t,e){let r=e[0]-t[0],n=e[1]-t[1];return n<0&&(r-=1,n+=Kb),[r,n]}function CPe(t){return t[0]*Kb+t[1]}function uF(t){return Array.isArray(t)&&t.length===2&&typeof t[0]=="number"&&typeof t[1]=="number"}function R5(t){return uF(t)||typeof t=="number"||t instanceof Date}function dF(t,e){const r=[t[0]+e[0],t[1]+e[1]];return r[1]>=Kb&&(r[1]-=Kb,r[0]+=1),r}var qs;(function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"})(qs||(qs={}));class $Pe{_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){Bt.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){Bt.warn(`Failed to extract with ${o.constructor.name}. Err: ${s.message}`)}return i},e)}fields(){return this._fields.slice()}}const ek="[_0-9a-z-*/]",kPe=`[a-z]${ek}{0,255}`,TPe=`[a-z0-9]${ek}{0,240}@[a-z]${ek}{0,13}`,EPe=new RegExp(`^(?:${kPe}|${TPe})$`),APe=/^[ -~]{0,255}[!-~]$/,IPe=/,|=/;function RPe(t){return EPe.test(t)}function jPe(t){return APe.test(t)&&!IPe.test(t)}const j5=32,_Pe=512,_5=",",Q5="=";class JA{_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+Q5+this.get(r)),e),[]).join(_5)}_parse(e){e.length>_Pe||(this._internalState=e.split(_5).reverse().reduce((r,n)=>{const i=n.trim(),o=i.indexOf(Q5);if(o!==-1){const s=i.slice(0,o),a=i.slice(o+1,n.length);RPe(s)&&jPe(a)&&r.set(s,a)}return r},new Map),this._internalState.size>j5&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,j5))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){const e=new JA;return e._internalState=new Map(this._internalState),e}}const iP="traceparent",oP="tracestate",QPe="00",DPe="(?!ff)[\\da-f]{2}",NPe="(?![0]{32})[\\da-f]{32}",MPe="(?![0]{16})[\\da-f]{16}",LPe="[\\da-f]{2}",qPe=new RegExp(`^\\s?(${DPe})-(${NPe})-(${MPe})-(${LPe})(-.*)?\\s?$`);function zPe(t){const e=qPe.exec(t);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}class VPe{inject(e,r,n){const i=Ti.getSpanContext(e);if(!i||HA(e)||!gS(i))return;const o=`${QPe}-${i.traceId}-${i.spanId}-0${Number(i.traceFlags||nl.NONE).toString(16)}`;n.set(r,iP,o),i.traceState&&n.set(r,oP,i.traceState.serialize())}extract(e,r,n){const i=n.get(r,iP);if(!i)return e;const o=Array.isArray(i)?i[0]:i;if(typeof o!="string")return e;const s=zPe(o);if(!s)return e;s.isRemote=!0;const a=n.get(r,oP);if(a){const l=Array.isArray(a)?a.join(","):a;s.traceState=new JA(typeof l=="string"?l:void 0)}return Ti.setSpanContext(e,s)}fields(){return[iP,oP]}}const UPe="[object Object]",BPe="[object Null]",WPe="[object Undefined]",XPe=Function.prototype,fF=XPe.toString,FPe=fF.call(Object),ZPe=Object.getPrototypeOf,pF=Object.prototype,hF=pF.hasOwnProperty,qc=Symbol?Symbol.toStringTag:void 0,mF=pF.toString;function D5(t){if(!YPe(t)||GPe(t)!==UPe)return!1;const e=ZPe(t);if(e===null)return!0;const r=hF.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&fF.call(r)===FPe}function YPe(t){return t!=null&&typeof t=="object"}function GPe(t){return t==null?t===void 0?WPe:BPe:qc&&qc in Object(t)?HPe(t):JPe(t)}function HPe(t){const e=hF.call(t,qc),r=t[qc];let n=!1;try{t[qc]=void 0,n=!0}catch{}const i=mF.call(t);return n&&(e?t[qc]=r:delete t[qc]),i}function JPe(t){return mF.call(t)}const KPe=20;function eCe(...t){let e=t.shift();const r=new WeakMap;for(;t.length>0;)e=gF(e,t.shift(),0,r);return e}function sP(t){return e0(t)?t.slice():t}function gF(t,e,r=0,n){let i;if(!(r>KPe)){if(r++,Ov(t)||Ov(e)||yF(e))i=sP(e);else if(e0(t)){if(i=t.slice(),e0(e))for(let o=0,s=e.length;o<s;o++)i.push(sP(e[o]));else if(zp(e)){const o=Object.keys(e);for(let s=0,a=o.length;s<a;s++){const l=o[s];i[l]=sP(e[l])}}}else if(zp(t))if(zp(e)){if(!tCe(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(Ov(c))typeof c>"u"?delete i[l]:i[l]=c;else{const u=i[l],d=c;if(N5(t,l,n)||N5(e,l,n))delete i[l];else{if(zp(u)&&zp(d)){const p=n.get(u)||[],h=n.get(d)||[];p.push({obj:t,key:l}),h.push({obj:e,key:l}),n.set(u,p),n.set(d,h)}i[l]=gF(i[l],c,r,n)}}}}else i=e;return i}}function N5(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 e0(t){return Array.isArray(t)}function yF(t){return typeof t=="function"}function zp(t){return!Ov(t)&&!e0(t)&&!yF(t)&&typeof t=="object"}function Ov(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t>"u"||t instanceof Date||t instanceof RegExp||t===null}function tCe(t,e){return!(!D5(t)||!D5(e))}class rCe{_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 nCe{_callback;_that;_isCalled=!1;_deferred=new rCe;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 iCe(){return"unknown_service"}const ch=t=>t!==null&&typeof t=="object"&&typeof t.then=="function";class t0{_rawAttributes;_asyncAttributesPending=!1;_memoizedAttributes;static FromAttributeList(e){const r=new t0({});return r._rawAttributes=M5(e),r._asyncAttributesPending=e.filter(([n,i])=>ch(i)).length>0,r}constructor(e){const r=e.attributes??{};this._rawAttributes=Object.entries(r).map(([n,i])=>(ch(i)&&(this._asyncAttributesPending=!0),[n,i])),this._rawAttributes=M5(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,ch(n)?await n:n]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&Bt.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;const e={};for(const[r,n]of this._rawAttributes){if(ch(n)){Bt.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:t0.FromAttributeList([...e.getRawAttributes(),...this.getRawAttributes()])}}function OF(t){return t0.FromAttributeList(Object.entries(t))}function oCe(){return OF({[yPe]:iCe(),[H$]:nP[H$],[J$]:nP[J$],[K$]:nP[K$]})}function M5(t){return t.map(([e,r])=>ch(r)?[e,r.catch(n=>{Bt.debug("promise rejection for resource attribute: %s - %s",e,n)})]:[e,r])}const sCe="exception";class aCe{_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=Gd.now(),this._performanceOffset=r-(this._performanceStartTime+cF()),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 Bt.warn(`Invalid attribute key: ${e}`),this;if(!aF(r))return Bt.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 Bt.warn("No events allowed."),this._droppedEventsCount++,this;i!==void 0&&this.events.length>=i&&(this._droppedEventsCount===0&&Bt.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),R5(r)&&(R5(n)||(n=r),r=void 0);const o=yv(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"&&(Bt.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()){Bt.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=PPe(this.startTime,this.endTime),this._duration[0]<0&&(Bt.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&&Bt.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._spanProcessor.onEnd(this)}_getTime(e){if(typeof e=="number"&&e<=Gd.now())return wPe(e+this._performanceOffset);if(typeof e=="number")return Md(e);if(e instanceof Date)return Md(e.getTime());if(uF(e))return e;if(this._startTimeProvided)return Md(Date.now());const r=Gd.now()-this._performanceStartTime;return dF(this.startTime,Md(r))}isRecording(){return this._ended===!1}recordException(e,r){const n={};typeof e=="string"?n[tP]=e:e&&(e.code?n[rP]=e.code.toString():e.name&&(n[rP]=e.name),e.message&&(n[tP]=e.message),e.stack&&(n[gPe]=e.stack)),n[rP]||n[tP]?this.addEvent(sCe,n,r):Bt.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}}`);Bt.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?(Bt.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 xf;(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(xf||(xf={}));class r0{shouldSample(){return{decision:xf.NOT_RECORD}}toString(){return"AlwaysOffSampler"}}class Hd{shouldSample(){return{decision:xf.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}}class aO{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(e){this._root=e.root,this._root||(bf(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new Hd),this._remoteParentSampled=e.remoteParentSampled??new Hd,this._remoteParentNotSampled=e.remoteParentNotSampled??new r0,this._localParentSampled=e.localParentSampled??new Hd,this._localParentNotSampled=e.localParentNotSampled??new r0}shouldSample(e,r,n,i,o,s){const a=Ti.getSpanContext(e);return!a||!gS(a)?this._root.shouldSample(e,r,n,i,o,s):a.isRemote?a.traceFlags&nl.SAMPLED?this._remoteParentSampled.shouldSample(e,r,n,i,o,s):this._remoteParentNotSampled.shouldSample(e,r,n,i,o,s):a.traceFlags&nl.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 L5{_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:rF(r)&&this._accumulate(r)<this._upperBound?xf.RECORD_AND_SAMPLED:xf.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 q5=1;function vF(){return{sampler:bF(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},spanLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128,linkCountLimit:128,eventCountLimit:128,attributePerEventCountLimit:128,attributePerLinkCountLimit:128}}}function bF(){const t="parentbased_always_on";switch(t){case"always_on":return new Hd;case"always_off":return new r0;case"parentbased_always_on":return new aO({root:new Hd});case"parentbased_always_off":return new aO({root:new r0});case"traceidratio":return new L5(z5());case"parentbased_traceidratio":return new aO({root:new L5(z5())});default:return Bt.error(`OTEL_TRACES_SAMPLER value "${t}" invalid, defaulting to "parentbased_always_on".`),new aO({root:new Hd})}}function z5(){return Bt.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${q5}.`),q5}const lCe=128,cCe=1/0;function uCe(t){const e={sampler:bF()},r=vF(),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 dCe(t){const e=Object.assign({},t.spanLimits);return e.attributeCountLimit=t.spanLimits?.attributeCountLimit??t.generalLimits?.attributeCountLimit??void 0??void 0??lCe,e.attributeValueLengthLimit=t.spanLimits?.attributeValueLengthLimit??t.generalLimits?.attributeValueLengthLimit??void 0??void 0??cCe,Object.assign({},t,{spanLimits:e})}class fCe{_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 nCe(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(Bt.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&nl.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&&Bt.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(Bt.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);Za.with(ePe(Za.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===qs.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=>{bf(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,bf(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 pCe extends fCe{_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=>{bf(r)})},this._pageHideListener=()=>{this.forceFlush().catch(r=>{bf(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 hCe=8,mCe=16;class gCe{generateTraceId=V5(mCe);generateSpanId=V5(hCe)}const lO=Array(32);function V5(t){return function(){for(let r=0;r<t*2;r++)lO[r]=Math.floor(Math.random()*16)+48,lO[r]>=58&&(lO[r]+=39);return String.fromCharCode.apply(null,lO.slice(0,t*2))}}class yCe{_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;constructor(e,r,n,i){const o=uCe(r);this._sampler=o.sampler,this._generalLimits=o.generalLimits,this._spanLimits=o.spanLimits,this._idGenerator=r.idGenerator||new gCe,this._resource=n,this._spanProcessor=i,this.instrumentationScope=e}startSpan(e,r={},n=Za.active()){r.root&&(n=Ti.deleteSpan(n));const i=Ti.getSpan(n);if(HA(n))return Bt.debug("Instrumentation suppressed, returning Noop Span"),Ti.wrapSpanContext(eF);const o=i?.spanContext(),s=this._idGenerator.generateSpanId();let a,l,c;!o||!Ti.isSpanContextValid(o)?l=this._idGenerator.generateTraceId():(l=o.traceId,c=o.traceState,a=o);const u=r.kind??Z$.INTERNAL,d=(r.links??[]).map(v=>({context:v.context,attributes:yv(v.attributes)})),p=yv(r.attributes),h=this._sampler.shouldSample(n,l,e,u,p,d);c=h.traceState??c;const g=h.decision===Jb.RECORD_AND_SAMPLED?nl.SAMPLED:nl.NONE,m={traceId:l,spanId:s,traceFlags:g,traceState:c};if(h.decision===Jb.NOT_RECORD)return Bt.debug("Recording is off, propagating context in a non-recording span"),Ti.wrapSpanContext(m);const y=yv(Object.assign(p,h.attributes));return new aCe({resource:this._resource,scope:this.instrumentationScope,context:n,spanContext:m,name:e,kind:u,links:d,parentSpanContext:a,attributes:y,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??Za.active(),c=this.startSpan(e,o,l),u=Ti.setSpan(l,c);return Za.with(u,a,void 0,c)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}}class OCe{_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=>{bf(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 zc;(function(t){t[t.resolved=0]="resolved",t[t.timeout=1]="timeout",t[t.error=2]="error",t[t.unresolved=3]="unresolved"})(zc||(zc={}));class vCe{_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(e={}){const r=eCe({},vF(),dCe(e));this._resource=r.resource??oCe(),this._config=Object.assign({},r,{resource:this._resource});const n=[];e.spanProcessors?.length&&n.push(...e.spanProcessors),this._activeSpanProcessor=new OCe(n)}getTracer(e,r,n){const i=`${e}@${r||""}:${n?.schemaUrl||""}`;return this._tracers.has(i)||this._tracers.set(i,new yCe({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=zc.timeout},e);n.forceFlush().then(()=>{clearTimeout(s),o!==zc.timeout&&(o=zc.resolved,i(o))}).catch(a=>{clearTimeout(s),o=zc.error,i(a)})}));return new Promise((n,i)=>{Promise.all(r).then(o=>{const s=o.filter(a=>a!==zc.resolved);s.length>0?i(s):n()}).catch(o=>i([o]))})}shutdown(){return this._activeSpanProcessor.shutdown()}}class bCe{_enabled=!1;_currentContext=$d;_bindFunction(e=$d,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=$d,this._enabled=!1,this}enable(){return this._enabled?this:(this._enabled=!0,this._currentContext=$d,this)}with(e,r,n,...i){const o=this._currentContext;this._currentContext=e||$d;try{return r.call(n,...i)}finally{this._currentContext=o}}}function xCe(t){if(t!==null){if(t===void 0){const e=new bCe;e.enable(),Za.setGlobalContextManager(e);return}t.enable(),Za.setGlobalContextManager(t)}}function SCe(t){if(t!==null){if(t===void 0){Ih.setGlobalPropagator(new $Pe({propagators:[new VPe,new lPe]}));return}Ih.setGlobalPropagator(t)}}class wCe extends vCe{constructor(e={}){super(e)}register(e={}){Ti.setGlobalTracerProvider(this),SCe(e.propagator),xCe(e.contextManager)}}class PCe{_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 U5 extends Error{code;name="OTLPExporterError";data;constructor(e,r,n){super(e),this.data=n,this.code=r}}function CCe(t){if(Number.isFinite(t)&&t>0)return t;throw new Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${t}')`)}function $Ce(t){if(t!=null)return()=>t}function kCe(t,e,r){return{timeoutMillis:CCe(t.timeoutMillis??e.timeoutMillis??r.timeoutMillis),concurrencyLimit:t.concurrencyLimit??e.concurrencyLimit??r.concurrencyLimit,compression:t.compression??e.compression??r.compression}}function TCe(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:"none"}}class ECe{_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 ACe(t){return new ECe(t.concurrencyLimit)}function ICe(t){return Object.prototype.hasOwnProperty.call(t,"partialSuccess")}function RCe(){return{handleResponse(t){t==null||!ICe(t)||t.partialSuccess==null||Object.keys(t.partialSuccess).length===0||Bt.warn("Received Partial Success response:",JSON.stringify(t.partialSuccess))}}}class jCe{_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=Bt.createComponentLogger({namespace:"OTLPExportDelegate"})}export(e,r){if(this._diagLogger.debug("items to be sent",e),this._promiseQueue.hasReachedLimit()){r({code:qs.FAILED,error:new Error("Concurrent export limit reached")});return}const n=this._serializer.serializeRequest(e);if(n==null){r({code:qs.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:qs.SUCCESS});return}else if(i.status==="failure"&&i.error){r({code:qs.FAILED,error:i.error});return}else i.status==="retryable"?r({code:qs.FAILED,error:new U5("Export failed with retryable status")}):r({code:qs.FAILED,error:new U5("Export failed with unknown error")})},i=>r({code:qs.FAILED,error:i})))}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug("shutdown started"),await this.forceFlush(),this._transport.shutdown()}}function _Ce(t,e){return new jCe(t.transport,t.serializer,RCe(),t.promiseHandler,e.timeout)}function xF(t,e,r){return _Ce({transport:r,serializer:e,promiseHandler:ACe(t)},{timeout:t.timeoutMillis})}function B5(t){return t>=48&&t<=57?t-48:t>=97&&t<=102?t-87:t-55}function SF(t){const e=new Uint8Array(t.length/2);let r=0;for(let n=0;n<t.length;n+=2){const i=B5(t.charCodeAt(n)),o=B5(t.charCodeAt(n+1));e[r++]=i<<4|o}return e}function wF(t){const e=BigInt(1e9);return BigInt(t[0])*e+BigInt(t[1])}function QCe(t){const e=Number(BigInt.asUintN(32,t)),r=Number(BigInt.asUintN(32,t>>BigInt(32)));return{low:e,high:r}}function DCe(t){const e=wF(t);return QCe(e)}function NCe(t){return wF(t).toString()}const MCe=typeof BigInt<"u"?NCe:CPe;function W5(t){return t}function LCe(t){if(t!==void 0)return SF(t)}const qCe={encodeHrTime:DCe,encodeSpanContext:SF,encodeOptionalSpanContext:LCe};function zCe(t){return t===void 0?qCe:{encodeHrTime:MCe,encodeSpanContext:W5,encodeOptionalSpanContext:W5}}function VCe(t){return{attributes:yS(t.attributes),droppedAttributesCount:0}}function UCe(t){return{name:t.name,version:t.version}}function yS(t){return Object.keys(t).map(e=>PF(e,t[e]))}function PF(t,e){return{key:t,value:CF(e)}}function CF(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(CF)}}:e==="object"&&t!=null?{kvlistValue:{values:Object.entries(t).map(([r,n])=>PF(r,n))}}:{}}function BCe(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:yS(t.attributes),droppedAttributesCount:t.droppedAttributesCount,events:t.events.map(o=>XCe(o,e)),droppedEventsCount:t.droppedEventsCount,status:{code:n.code,message:n.message},links:t.links.map(o=>WCe(o,e)),droppedLinksCount:t.droppedLinksCount}}function WCe(t,e){return{attributes:t.attributes?yS(t.attributes):[],spanId:e.encodeSpanContext(t.context.spanId),traceId:e.encodeSpanContext(t.context.traceId),traceState:t.context.traceState?.serialize(),droppedAttributesCount:t.droppedAttributesCount||0}}function XCe(t,e){return{attributes:t.attributes?yS(t.attributes):[],name:t.name,timeUnixNano:e.encodeHrTime(t.time),droppedAttributesCount:t.droppedAttributesCount||0}}function FCe(t,e){const r=zCe(e);return{resourceSpans:YCe(t,r)}}function ZCe(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 YCe(t,e){const r=ZCe(t),n=[],i=r.entries();let o=i.next();for(;!o.done;){const[s,a]=o.value,l=[],c=a.values();let u=c.next();for(;!u.done;){const p=u.value;if(p.length>0){const h=p.map(g=>BCe(g,e));l.push({scope:UCe(p[0].instrumentationScope),spans:h,schemaUrl:p[0].instrumentationScope.schemaUrl})}u=c.next()}const d={resource:VCe(s),scopeSpans:l,schemaUrl:void 0};n.push(d),o=i.next()}return n}const GCe={serializeRequest:t=>{const e=FCe(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))}},HCe=5,JCe=1e3,KCe=5e3,e$e=1.5,X5=.2;function t$e(){return Math.random()*(2*X5)-X5}class r$e{_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=HCe,s=JCe;for(;i.status==="retryable"&&o>0;){o--;const a=Math.max(Math.min(s,KCe)+t$e(),0);s=s*e$e;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 $F(t){return new r$e(t.transport)}function n$e(t){return[429,502,503,504].includes(t)}function i$e(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 o$e{_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?(Bt.debug("XHR success"),n({status:"success"})):i.status&&n$e(i.status)?n({status:"retryable",retryInMillis:i$e(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 s$e(t){return new o$e(t)}class a$e{_params;constructor(e){this._params=e}send(e){return new Promise(r=>{navigator.sendBeacon(this._params.url,new Blob([e],{type:this._params.blobType}))?(Bt.debug("SendBeacon success"),r({status:"success"})):r({status:"failure",error:new Error("SendBeacon failed")})})}shutdown(){}}function l$e(t){return new a$e(t)}function c$e(t,e){return xF(t,e,$F({transport:s$e(t)}))}function u$e(t,e){return xF(t,e,$F({transport:l$e({url:t.url,blobType:t.headers()["Content-Type"]})}))}function d$e(t){return()=>{const e={};return Object.entries(t?.()??{}).forEach(([r,n])=>{typeof n<"u"?e[r]=String(n):Bt.warn(`Header "${r}" has invalid value (${n}) and will be ignored`)}),e}}function f$e(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 p$e(t){if(t!=null)try{return new URL(t),t}catch{throw new Error(`Configuration: Could not parse user-provided export URL: '${t}'`)}}function h$e(t,e,r){return{...kCe(t,e,r),headers:f$e(d$e(t.headers),e.headers,r.headers),url:p$e(t.url)??e.url??r.url,agentOptions:t.agentOptions??e.agentOptions??r.agentOptions}}function m$e(t,e){return{...TCe(),headers:()=>t,url:"http://localhost:4318/"+e,agentOptions:{keepAlive:!0}}}function g$e(t,e,r){return h$e({url:t.url,timeoutMillis:t.timeoutMillis,headers:$Ce(t.headers),concurrencyLimit:t.concurrencyLimit},{},m$e(r,e))}function y$e(t,e,r,n){const i=!!t.headers||typeof navigator.sendBeacon!="function",o=g$e(t,r,n);return i?c$e(o,e):u$e(o,e)}class O$e extends PCe{constructor(e={}){super(y$e(e,GCe,"v1/traces",{"Content-Type":"application/json"}))}}const v$e="service.name",b$e="service.version";let kF=class{emit(e){}};const x$e=new kF;class S$e{getLogger(e,r,n){return new kF}}const TF=new S$e;class w$e{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):x$e}}class F5{getLogger(e,r,n){var i;return(i=this.getDelegateLogger(e,r,n))!==null&&i!==void 0?i:new w$e(this,e,r,n)}getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:TF}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 P$e=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{},cO=Symbol.for("io.opentelemetry.js.api.logs"),Vp=P$e;function C$e(t,e,r){return n=>n===t?e:r}const Z5=1;class KA{constructor(){this._proxyLoggerProvider=new F5}static getInstance(){return this._instance||(this._instance=new KA),this._instance}setGlobalLoggerProvider(e){return Vp[cO]?this.getLoggerProvider():(Vp[cO]=C$e(Z5,e,TF),this._proxyLoggerProvider.setDelegate(e),e)}getLoggerProvider(){var e,r;return(r=(e=Vp[cO])===null||e===void 0?void 0:e.call(Vp,Z5))!==null&&r!==void 0?r:this._proxyLoggerProvider}getLogger(e,r,n){return this.getLoggerProvider().getLogger(e,r,n)}disable(){delete Vp[cO],this._proxyLoggerProvider=new F5}}const EF=KA.getInstance();function $$e(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 k$e(t){t.forEach(e=>e.disable())}function T$e(t){const e=t.tracerProvider||Ti.getTracerProvider(),r=t.meterProvider||iF.getMeterProvider(),n=t.loggerProvider||EF.getLoggerProvider(),i=t.instrumentations?.flat()??[];return $$e(i,e,r,n),()=>{k$e(i)}}let so=console.error.bind(console);function Up(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 AF=(t,e,r)=>{if(!t||!t[e]){so("no original function "+String(e)+" to wrap");return}if(!r){so("no wrapper function"),so(new Error().stack);return}const n=t[e];if(typeof n!="function"||typeof r!="function"){so("original object and wrapper must be functions");return}const i=r(n,e);return Up(i,"__original",n),Up(i,"__unwrap",()=>{t[e]===i&&Up(t,e,n)}),Up(i,"__wrapped",!0),Up(t,e,i),i},E$e=(t,e,r)=>{if(t)Array.isArray(t)||(t=[t]);else{so("must provide one or more modules to patch"),so(new Error().stack);return}if(!(e&&Array.isArray(e))){so("must provide one or more functions to wrap on modules");return}t.forEach(n=>{e.forEach(i=>{AF(n,i,r)})})},IF=(t,e)=>{if(!t||!t[e]){so("no function to unwrap."),so(new Error().stack);return}const r=t[e];if(!r.__unwrap)so("no original to unwrap to -- has "+String(e)+" already been unwrapped?");else{r.__unwrap();return}},A$e=(t,e)=>{if(t)Array.isArray(t)||(t=[t]);else{so("must provide one or more modules to patch"),so(new Error().stack);return}if(!(e&&Array.isArray(e))){so("must provide one or more functions to unwrap on modules");return}t.forEach(r=>{e.forEach(n=>{IF(r,n)})})};class I$e{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(e,r,n){this.instrumentationName=e,this.instrumentationVersion=r,this.setConfig(n),this._diag=Bt.createComponentLogger({namespace:e}),this._tracer=Ti.getTracer(e,r),this._meter=iF.getMeter(e,r),this._logger=EF.getLogger(e,r),this._updateMetricInstruments()}_wrap=AF;_unwrap=IF;_massWrap=E$e;_massUnwrap=A$e;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 R$e extends I$e{constructor(e,r,n){super(e,r,n),this._config.enabled&&this.enable()}}class j$e{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)}setStatus(e,r){this.span&&this.span.setStatus(e,r)}end(){this.span&&(this.span.setStatus(exports.SpanStatusCode.OK),this.span.end())}}function Sf(t){return t.replace(/([A-Z])/g,"_$1").toLowerCase()}function RF(t){const e={updated:[],notUpdated:[]};for(const r of t){if(!r||typeof r!="object")continue;const n=r.object;if(!n||typeof n!="string")continue;const i=r,o=e.notUpdated.find(s=>s.object===n);o?(e.updated=[o,i],e.notUpdated=e.notUpdated.filter(s=>s.object!==n)):e.updated.some(s=>s.object===n)||e.notUpdated.push(i)}return e}function n0(t,e,r,n=!0){for(const[i,o]of Object.entries(t))if(o!==void 0){const s=n?Sf(i):i;r[`${e}${s}`]=o}}function _$e(t,e,r){for(const[n,i]of Object.entries(t))i==null||typeof i=="object"||(r[`${e}.${Sf(n)}`]=i)}function Q$e(t,e,r){const n=e instanceof Date?e.toISOString():new Date(e).toISOString();return{"cloudevents.event_id":t.id,"cloudevents.event_type":t.type,"cloudevents.event_source":t.source??void 0,"cloudevents.event_spec_version":t.specversion,"cloudevents.event_data_content_type":t.datacontenttype??"application/json; charset=utf-8","cloudevents.event_time":n,"cloudevents.event_subject":t.subject??"","cloudevents.page.uri":typeof location<"u"?location.href:void 0,"cloudevents.event_version":r?.version,"cloudevents.event_origin":t.origin??r?.serviceName,"cloudevents.event_source_details.id":t.actor?.id??"anonymous","cloudevents.event_source_details.object":t.actor?.object??"anonymous","cloudevents.event_source_details.uri":t.actor?.uri??void 0,"cloudevents.metadata.user_id":t.analyticsMetadata?.userId,"cloudevents.metadata.user_ip_address":t.analyticsMetadata?.userIpAddress,"cloudevents.event_object":t.object||"event","cloudevents.object":t.object||"event","cloudevents.event_category":t.category,"cloudevents.event_signal":t.signal,"cloudevents.origin":t.origin,"cloudevents.event_actor.id":t.actor?.id??void 0,"cloudevents.event_actor.object":t.actor?.object??void 0,"cloudevents.event_actor.uri":t.actor?.uri??void 0,"cloudevents.event_organization_id":t.organizationId,"cloudevents.event_organization_slug":t.organizationSlug,"cloudevents.event_project_id":t.projectId,"cloudevents.event_project_slug":t.projectSlug,"cloudevents.event_request_id":t.requestId,"cloudevents.requestId":t.requestId,"cloudevents.organizationId":t.organizationId,"cloudevents.organizationSlug":t.organizationSlug,"cloudevents.projectId":t.projectId,"cloudevents.projectSlug":t.projectSlug,"cloudevents.event_os_platform":t.osPlatform,"cloudevents.event_user_agent":t.userAgent}}function D$e(t,e,r){const n=t.data,i={...Q$e(t,e,r),...Y5("project",t),...Y5("organization",t)};return N$e(n,i),V$e(t,i),U$e(t,i),i}function N$e(t,e){!t||typeof t!="object"||(Array.isArray(t)?M$e(t,e):z$e(t,e))}function M$e(t,e){t.some(n=>n&&typeof n=="object"&&typeof n.object=="string")?L$e(t,e):q$e(t,e)}function L$e(t,e){const r=RF(t);r.updated.forEach((n,i)=>{const o=`cloudevents.event_data.${i===0?"after.":"before."}${n.object}.`;n0(n,o,e)}),r.notUpdated.forEach(n=>{const i=`cloudevents.event_data.${n.object}.`;n0(n,i,e)})}function q$e(t,e){for(const r of t)if(!(!r||typeof r!="object"))for(const[n,i]of Object.entries(r)){if(i===void 0)continue;const o=Sf(n);i!==null&&typeof i=="object"&&!Array.isArray(i)?_$e(i,`cloudevents.event_data.${o}`,e):e[`cloudevents.event_data.${o}`]=i}}function z$e(t,e){for(const[r,n]of Object.entries(t)){if(n==null)continue;const i=Sf(r);if(typeof n=="object"&&!Array.isArray(n))for(const[o,s]of Object.entries(n))s!=null&&(typeof s=="string"||typeof s=="number"||typeof s=="boolean")&&(e[`cloudevents.event_data.${i}.${o}`]=s);else(typeof n=="string"||typeof n=="number"||typeof n=="boolean")&&(e[`cloudevents.event_data.${i}`]=n)}}function V$e(t,e){if(!t.subjects||!Array.isArray(t.subjects))return;const r=RF(t.subjects);r.updated.forEach((n,i)=>{const o=`cloudevents.subjects.${i===0?"after.":"before."}${n.object}.`;n0(n,o,e,!1)}),r.notUpdated.forEach(n=>{const i=`cloudevents.subjects.${n.object}.`;n0(n,i,e,!1)})}function U$e(t,e){for(const[r,n]of Object.entries(t))if(!(z1e.includes(r)||n===void 0))if(n instanceof Object)for(const[i,o]of Object.entries(n))o!==void 0&&(e[`cloudevents.${r}.${i}`]=o);else e[`cloudevents.${r}`]=n}function Y5(t,e){const r=`${t}Id`,n=`${t}Slug`,i=e[r],o=e[n];if(i!==void 0&&o!==void 0)return{[`cloudevents.${t}.id`]:i,[`cloudevents.${t}.slug`]:o};const s=e.data;if(Array.isArray(s)&&s.length){const a=s.find(l=>l?.object===t);return a?{[`cloudevents.${t}.id`]:a.id,[`cloudevents.${t}.slug`]:a.slug}:{}}return{}}function B$e(t,e,r){return D$e(t,e,r)}class W$e{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,n="time"in r&&r.time?new Date(r.time):new Date;this.tracer.startSpan(`event.${r.type}`,{attributes:this.processAttributes(r,n),startTime:n}).end(n)}catch(r){this.config?.isProd||console.error("Event reporting failed:",r)}}processAttributes(e,r){return B$e(e,r,this.config)}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=Ti.setSpan(Za.active(),o)),{end:()=>o.end(),setAttribute:(s,a)=>{o.setAttribute(`cloudevents.event_data.${Sf(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,r){try{if(!this.tracer)return;const n=r||Za.active(),i=e,o=i.time?new Date(i.time):new Date,s=this.tracer.startSpan(`event.${i.type}`,{attributes:this.processAttributes(i,o)},n),a=Ti.setSpan(n,s);return{end:()=>s.end(),setAttribute:(l,c)=>{s.setAttribute(`cloudevents.event_data.${Sf(l)}`,c)},setStatus:(l,c)=>s.setStatus({code:l,message:c}),recordException:l=>s.recordException(l),context:a}}catch(n){this.config?.isProd||console.error("Event reporting failed:",n);return}}traceStep(e){const r=this.startStepSpan(e);if(r)return new j$e(r)}async forceFlush(){return this.tracerProvider?.forceFlush()}async shutdown(){return this.tracerProvider?.shutdown()}}class X$e extends W$e{tracer=null;initialized=!1;constructor(){super()}initTracer(e){if(!e.collectorUrl&&!e.collectorTraceUrl)return;const r=`ses_${F$()}`,n=OF({[v$e]:e.serviceName,[b$e]:e.serviceVersion,session_id:r}),i=e.collectorTraceUrl||`${e.collectorUrl}/v1/traces`;this.tracerProvider=new wCe({resource:n,spanProcessors:[new pCe(new O$e({url:i,headers:{}}))]}),this.tracer=this.tracerProvider.getTracer(e.tracerName),this.tracerProvider.register(),T$e({instrumentations:e.instrumentations??[]}),this.initialized=!0}}class zl extends R$e{sendErrorEvent;originalConsoleError;constructor(e,r){super("errors","1.0",e||{}),this.sendErrorEvent=r}static toErrorEvent(e,r){return{type:"error",payload:[{handler:r,errorType:zl.getErrorType(e),message:zl.getErrorMessage(e),stack:zl.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=zl.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(zl.toErrorEvent(e,r))}}class F$e{config=null;initialized=!1;useCloudEventData;otelClient;tracer;constructor(){this.useCloudEventData=()=>({origin:"replayUi"}),this.otelClient=new X$e,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 i=e&&typeof e=="object"&&"type"in e&&"data"in e?e:this.constructCloudEvent(e,r);this.sendToOtelService(i)}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 zl(void 0,r=>{this.sendToOtelService({type:r.type,data: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){return V1e({type:e,data:r,...this.useCloudEventData()})}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){if(this.config?.disabled)return;const n=zl.toErrorEvent(e,r);this.sendToOtelService({type:n.type,data:n.payload})}sendTabChangeMessage(e){this.send("tab.change",e)}sendButtonClickMessage(e){this.send("button.click",e)}sendTabOpenFailedMessage(e){this.send("tab.open_failed",e)}sendChangeMessage(e){this.send("change",e)}sendContentCopyMessage(e){this.send("content.copy",e)}sendRequestSendMessage(e){this.send("request.send",e)}sendTokenGenerateMessage(e){this.send("token.generate",e)}sendAppLifecycleMessage(e){this.send("app.lifecycle",e)}sendEnvironmentManagementMessage(e){this.send("environment.management",e)}sendServerManagementMessage(e){this.send("server.management",e)}sendSourceManagementMessage(e){this.send("source.management",e)}sendInputManagementMessage(e){this.send("input.management",e)}sendNodeManagementMessage(e){this.send("node.management",e)}sendHistoryManagementMessage(e){this.send("history.management",e)}sendHistoryMigrationMessage(e){this.send("history.migration",e)}sendCredentialManagementMessage(e){this.send("credential.management",e)}sendPanelToggleMessage(e){this.send("panel.toggle",e)}sendWorkflowRunClickMessage(e){this.send("workflow.run.click",e)}sendWorkflowRunResultMessage(e){this.send("workflow.run.result",e)}sendStorageReadMessage(){this.send("storage.read")}sendStorageLoadUserStateMessage(){this.send("storage.loadUserState")}sendStorageDetectFilesMessage(){this.send("storage.detectFiles")}sendStorageLoadApisMessage(){this.send("storage.loadApis")}sendStorageParseApisMessage(){this.send("storage.parseApis")}sendStorageParseCollectionsMessage(){this.send("storage.parseCollections")}sendUpdaterCheckMessage(){this.send("updater.check")}sendUpdaterDownloadMessage(){this.send("updater.download")}sendUpdaterInstallMessage(){this.send("updater.install")}sendUpdaterProcessMessage(){this.send("updater.process")}sendErrorMessage(e){this.send("error",e)}sendCodeEditorSearchMessage(e){this.send("code_editor.search",e)}}const OS=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],Z$e="https://cors.redocly.com/";function Y$e(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function G5(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 H5(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?G5(Object(r),!0).forEach(function(n){Y$e(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):G5(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Tn(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 J5=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),aP=function(){return Math.random().toString(36).substring(7).split("").join(".")},ec={INIT:"@@redux/INIT"+aP(),REPLACE:"@@redux/REPLACE"+aP(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+aP()}};function jF(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 G$e(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(K$e(t))return"date";if(J$e(t))return"error";var r=H$e(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 H$e(t){return typeof t.constructor=="function"?t.constructor.name:null}function J$e(t){return t instanceof Error||typeof t.message=="string"&&t.constructor&&typeof t.constructor.stackTraceLimit=="number"}function K$e(t){return t instanceof Date?!0:typeof t.toDateString=="function"&&typeof t.getDate=="function"&&typeof t.setDate=="function"}function _l(t){var e=typeof t;return process.env.NODE_ENV!=="production"&&(e=G$e(t)),e}function vS(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"?Tn(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"?Tn(1):"Expected the enhancer to be a function. Instead, received: '"+_l(r)+"'");return r(vS)(t,e)}if(typeof t!="function")throw new Error(process.env.NODE_ENV==="production"?Tn(2):"Expected the root reducer to be a function. Instead, received: '"+_l(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"?Tn(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"?Tn(4):"Expected the listener to be a function. Instead, received: '"+_l(m)+"'");if(l)throw new Error(process.env.NODE_ENV==="production"?Tn(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 y=!0;return c(),a.push(m),function(){if(y){if(l)throw new Error(process.env.NODE_ENV==="production"?Tn(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.");y=!1,c();var v=a.indexOf(m);a.splice(v,1),s=null}}}function p(m){if(!jF(m))throw new Error(process.env.NODE_ENV==="production"?Tn(7):"Actions must be plain objects. Instead, the actual type was: '"+_l(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"?Tn(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"?Tn(9):"Reducers may not dispatch actions.");try{l=!0,o=i(o,m)}finally{l=!1}for(var y=s=a,O=0;O<y.length;O++){var v=y[O];v()}return m}function h(m){if(typeof m!="function")throw new Error(process.env.NODE_ENV==="production"?Tn(10):"Expected the nextReducer to be a function. Instead, received: '"+_l(m));i=m,p({type:ec.REPLACE})}function g(){var m,y=d;return m={subscribe:function(v){if(typeof v!="object"||v===null)throw new Error(process.env.NODE_ENV==="production"?Tn(11):"Expected the observer to be an object. Instead, received: '"+_l(v)+"'");function b(){v.next&&v.next(u())}b();var S=y(b);return{unsubscribe:S}}},m[J5]=function(){return this},m}return p({type:ec.INIT}),n={dispatch:p,subscribe:d,getState:u,replaceReducer:h},n[J5]=g,n}var eke=vS;function tk(t){typeof console<"u"&&typeof console.error=="function"&&console.error(t);try{throw new Error(t)}catch{}}function tke(t,e,r,n){var i=Object.keys(e),o=r&&r.type===ec.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(!jF(t))return"The "+o+' has unexpected type of "'+_l(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===ec.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 rke(t){Object.keys(t).forEach(function(e){var r=t[e],n=r(void 0,{type:ec.INIT});if(typeof n>"u")throw new Error(process.env.NODE_ENV==="production"?Tn(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:ec.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?Tn(13):'The slice reducer for key "'+e+'" returned undefined when probed with a random type. '+("Don't try to handle '"+ec.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 nke(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"&&tk('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{rke(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=tke(c,r,u,s);d&&tk(d)}for(var p=!1,h={},g=0;g<o.length;g++){var m=o[g],y=r[m],O=c[m],v=y(O,u);if(typeof v>"u"){var b=u&&u.type;throw new Error(process.env.NODE_ENV==="production"?Tn(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]=v,p=p||v!==O}return p=p||o.length!==Object.keys(c).length,p?h:c}}function K5(t,e){return function(){return e(t.apply(this,arguments))}}function ike(t,e){if(typeof t=="function")return K5(t,e);if(typeof t!="object"||t===null)throw new Error(process.env.NODE_ENV==="production"?Tn(16):"bindActionCreators expected an object or a function, but instead received: '"+_l(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]=K5(i,e))}return r}function _F(){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 oke(){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"?Tn(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=_F.apply(void 0,a)(i.dispatch),H5(H5({},i),{},{dispatch:o})}}}function eN(){}process.env.NODE_ENV!=="production"&&typeof eN.name=="string"&&eN.name!=="isCrushed"&&tk('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 ske=Object.freeze({__proto__:null,__DO_NOT_USE__ActionTypes:ec,applyMiddleware:oke,bindActionCreators:ike,combineReducers:nke,compose:_F,createStore:vS,legacy_createStore:eke});function ake(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 lke=ake(ske);lke.compose;var cke=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(t){return t}};function uke(t,e,r){var n=!1,i=!1,o=vS(function(a,l){if(!i){var c=function(y){return Array.isArray(y)&&y.findIndex(function(O){return typeof O!="string"&&typeof O!="number"})===-1};if(l.type.startsWith("SET")){var u=function(y){try{n=!0,"value"in l?y.set(l.value):y.set(Ot)}finally{n=!1}};if(l.path){if(c(l.path)){l.path.length===0&&u(t);for(var d=t,p=!0,h=0,g=l.path;h<g.length;h++){var m=g[h];d[m]?d=d[m]:p=!1}p&&u(d)}}else u(t)}else l.type==="BREAKPOINT"&&r()}return t.promised||t.error?Ot:t.get({noproxy:!0})},cke({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 dke(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=uke(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 qt=(t=>(t.Normal="Normal",t.Edit="Edit",t.Draft="Draft",t))(qt||{});const mg="default",QF=[{name:mg,inputs:[],servers:[],state:qt.Normal}],rk={activeTabIdx:0,tabs:[]};var Ns=(t=>(t.Idle="idle",t.Loading="loading",t.Success="success",t.Error="error",t))(Ns||{});function ra(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 nk(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(!nk(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)||!nk(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function tN(t){return Object.keys(t).forEach(e=>{t[e]===void 0&&delete t[e]}),t}function fke(t,e=!1){return window.__TAURI_INTERNALS__.transformCallback(t,e)}async function Cr(t,e={},r){return window.__TAURI_INTERNALS__.invoke(t,e,r)}function hn(){return!!window?.__TAURI__}async function rN(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 Ln={FS:"fs",WEB:"web"};var wf;(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"})(wf||(wf={}));async function DF(){return Cr("plugin:path|resolve_directory",{directory:wf.AppData})}async function NF(){return Cr("plugin:path|resolve_directory",{directory:wf.Desktop})}function eI(){return window.__TAURI_INTERNALS__.plugins.path.sep}async function MF(...t){return Cr("plugin:path|resolve",{paths:t})}async function Jd(...t){return Cr("plugin:path|join",{paths:t})}async function LF(t){return Cr("plugin:path|dirname",{path:t})}async function qF(t){return Cr("plugin:path|extname",{path:t})}async function tI(t,e){return Cr("plugin:path|basename",{path:t,ext:e})}async function zF(t){return Cr("plugin:path|is_absolute",{path:t})}const VF=Object.freeze(Object.defineProperty({__proto__:null,get BaseDirectory(){return wf},appDataDir:DF,basename:tI,desktopDir:NF,dirname:LF,extname:qF,isAbsolute:zF,join:Jd,resolve:MF,sep:eI},Symbol.toStringTag,{value:"Module"}));var ik;(function(t){t[t.Start=0]="Start",t[t.Current=1]="Current",t[t.End=2]="End"})(ik||(ik={}));async function ok(t,e){if(t instanceof URL&&t.protocol!=="file:")throw new TypeError("Must be a file URL.");await Cr("plugin:fs|mkdir",{path:t instanceof URL?t.toString():t,options:e})}async function rI(t,e){if(t instanceof URL&&t.protocol!=="file:")throw new TypeError("Must be a file URL.");return await Cr("plugin:fs|read_dir",{path:t instanceof URL?t.toString():t,options:e})}async function UF(t,e){if(t instanceof URL&&t.protocol!=="file:")throw new TypeError("Must be a file URL.");const r=await Cr("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 bS(t,e){if(t instanceof URL&&t.protocol!=="file:")throw new TypeError("Must be a file URL.");return await Cr("plugin:fs|read_text_file",{path:t instanceof URL?t.toString():t,options:e})}async function BF(t,e){if(t instanceof URL&&t.protocol!=="file:")throw new TypeError("Must be a file URL.");await Cr("plugin:fs|remove",{path:t instanceof URL?t.toString():t,options:e})}async function WF(t,e,r){if(t instanceof URL&&t.protocol!=="file:"||e instanceof URL&&e.protocol!=="file:")throw new TypeError("Must be a file URL.");await Cr("plugin:fs|rename",{oldPath:t instanceof URL?t.toString():t,newPath:e instanceof URL?e.toString():e,options:r})}async function pke(t,e,r){if(t instanceof URL&&t.protocol!=="file:")throw new TypeError("Must be a file URL.");await Cr("plugin:fs|write_file",e,{headers:{path:t instanceof URL?t.toString():t,options:JSON.stringify(r)}})}async function XF(t,e,r){if(t instanceof URL&&t.protocol!=="file:")throw new TypeError("Must be a file URL.");await Cr("plugin:fs|write_text_file",{path:t instanceof URL?t.toString():t,data:e,options:r})}async function xS(t,e){if(t instanceof URL&&t.protocol!=="file:")throw new TypeError("Must be a file URL.");return await Cr("plugin:fs|exists",{path:t instanceof URL?t.toString():t,options:e})}const SS=Object.freeze(Object.defineProperty({__proto__:null,get BaseDirectory(){return wf},get SeekMode(){return ik},exists:xS,mkdir:ok,readDir:rI,readFile:UF,readTextFile:bS,remove:BF,rename:WF,writeFile:pke,writeTextFile:XF},Symbol.toStringTag,{value:"Module"}));class Wt{static utils=null;static async getUtils(){return Wt.utils||(Wt.utils=hn()?await Promise.resolve().then(()=>require("./replay-tauri-path-D6_uYcMz.js")):await Promise.resolve().then(()=>mne)),Wt.utils}static async dirname(e){return(await Wt.getUtils()).dirname(e)}static async join(...e){return(await Wt.getUtils()).join(...e)}static async resolve(e){return(await Wt.getUtils()).resolve(e)}static async isAbsolute(e){return(await Wt.getUtils()).isAbsolute(e)}static async relative(e,r){return(await Wt.getUtils()).relative(e,r)}static async extname(e){return(await Wt.getUtils()).extname(e)}}const hke=new Set(["node_modules"]);class sk{constructor(e){this.baseDir=e,this.initializeDirectory(e)}writeExcludedKeys=new Set;listeners=new Map;writeEndTimers=new Map;on(e,r){this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e)?.add(r)}off(e,r){this.listeners.get(e)?.delete(r)}emit(e,r){this.listeners.get(e)?.forEach(n=>n(r))}async initializeDirectory(e){await ok(e,{recursive:!0})}setWriteExcludedKeys(e){this.writeExcludedKeys=e}async ls(e){const r=await this.getFullPath(e);return this.getDirEntryFilesRecursively(r)}async getDirEntryFilesRecursively(e){try{const r=[],n=await rI(e);for(const i of n)if(i.isDirectory){if(hke.has(i.name))continue;const o=await Jd(e,i.name),s=await this.getDirEntryFilesRecursively(o);r.push(...s)}else{const o=await Jd(e,i.name),s=await Wt.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 bS(r)}catch(n){return!n.includes("No such file or directory")&&!n.includes("forbidden path")&&console.error(n),null}}async has(e){const r=await this.getFullPath(e);return await xS(r)}async set(e,r){if(!this.writeExcludedKeys.has(e)){this.emit("write-start",e);try{const n=await this.getFullPath(e),i=eI(),o=n.split(i).slice(0,-1).join(i);await ok(o,{recursive:!0}),await XF(n,r)}finally{const n=this.writeEndTimers.get(e);n&&clearTimeout(n);const i=setTimeout(()=>{this.emit("write-end",e),this.writeEndTimers.delete(e)},1e3);this.writeEndTimers.set(e,i)}}}async remove(e){if(!this.writeExcludedKeys.has(e)){this.emit("write-start",e);try{const r=await this.getFullPath(e);await BF(r)}catch(r){!r.includes("No such file or directory")&&!r.includes("forbidden path")&&console.error(r)}finally{const r=this.writeEndTimers.get(e);r&&clearTimeout(r);const n=setTimeout(()=>{this.emit("write-end",e),this.writeEndTimers.delete(e)},1e3);this.writeEndTimers.set(e,n)}}}async rename(e,r){const n=await this.getFullPath(e),i=await this.getFullPath(r);await WF(n,i)}async getFullPath(e){return await Jd(this.baseDir,e??"")}}class mke{baseDir="";async ls(e=""){return[]}async get(e){return null}async has(e){return!1}async set(e,r){}async remove(e){}async rename(e,r){}setWriteExcludedKeys(e){}on(e,r){}off(e,r){}}class gke{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 FF{constructor(e){this.storage=e}itemIds=[];async getAbsolutePath(e){return await Wt.resolve(await Wt.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===qt.Draft||e.srcType!==Ln.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 yke extends FF{parse(e){return{...e.content,id:e.uri,srcType:e.type,fileDependencies:e.fileDependencies}}async stringify(e){const{id:r,srcType:n,fileDependencies:i,...o}=e;return await Wt.extname(r)===".json"?JSON.stringify(o,null,2):tl.dump(o)}async write(e){await this.storage.has(e.id)||await super.write(e)}}var Yn=(t=>(t.SIMPLE="simple",t.REGEX="regex",t.JSONPATH="jsonpath",t.XPATH="xpath",t))(Yn||{});const Oke=`
|
|
285
|
+
`;function pS({input:t,onSave:e,onCancel:r,...n}){const[i,o]=P.useState(!!t.isSecret),s=({name:a,value:l})=>{e({...t,name:a,value:l,isSecret:i})};return f.jsx(GX,{variable:t,onSave:s,onCancel:r,maskValue:i,...n,children:f.jsx(dm,{children:f.jsx(uX,{value:i,onChange:a=>o(a),title:"Make it secret"})})})}const Hb=()=>({name:"",value:"",isSecret:!1}),Rr=t=>mV+"$inputs."+t+zE,HX=(t,e)=>e.inputs.find(r=>r.get().name===t.match(`^${tg}$`)?.[1]);function j1e({environments:t,activeEnvironmentId:e}){return t.get().find(n=>n.name===e.get())?.inputs||[]}function kl(t){const e=new RegExp(tg,"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 Iu(t){const e=/^\{?\$inputs\.([^\}\s]+)\}?$/,r=t.match(e);return r?r[1]:null}function gv(t){const e=new Error(t);return e.source="ulid",e}const BA="0123456789ABCDEFGHJKMNPQRSTVWXYZ",Eh=BA.length,E5=Math.pow(2,48)-1,_1e=10,Q1e=16;function D1e(t){let e=Math.floor(t()*Eh);return e===Eh&&(e=Eh-1),BA.charAt(e)}function N1e(t,e){if(isNaN(t))throw new Error(t+" must be a number");if(t>E5)throw gv("cannot encode time greater than "+E5);if(t<0)throw gv("time must be positive");if(Number.isInteger(Number(t))===!1)throw gv("time must be an integer");let r,n="";for(;e>0;e--)r=t%Eh,n=BA.charAt(r)+n,t=(t-r)/Eh;return n}function M1e(t,e){let r="";for(;t>0;t--)r=D1e(e)+r;return r}function L1e(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 gv("secure crypto unusable, insecure Math.random not allowed")}function q1e(t){return t||(t=L1e()),function(r){return isNaN(r)&&(r=Date.now()),N1e(r,_1e)+M1e(Q1e,t)}}const F$=q1e(),z1e=["id","specversion","object","datacontenttype","type","time","origin","category","signal","source","subject","subjects","data","actor","requestId","analyticsMetadata","organization","project","organizationId","organizationSlug","projectId","projectSlug","osPlatform","userAgent","context"];function V1e(t){const{type:e,data:r,actor:n,requestId:i,analyticsMetadata:o,origin:s,source:a,subjects:l,organizationId:c,organizationSlug:u,projectId:d,projectSlug:p,category:h="product",signal:g="log",osPlatform:m,userAgent:y}=t,O=!!(r&&Array.isArray(r)),v=n?{id:n.id??`ann_${F$()}`,object:n.object??"user",uri:n.uri??""}:null,b=`evt_${F$()}`.toLowerCase(),S=new Date,x=a??v?.uri??null,$={...c!==void 0&&{organizationId:c},...u!==void 0&&{organizationSlug:u},...d!==void 0&&{projectId:d},...p!==void 0&&{projectSlug:p}},C={specversion:"1.0",object:"event",datacontenttype:"application/json; charset=utf-8",origin:s,category:h,signal:g,osPlatform:m,userAgent:y};if(O){const T=r,I=l||T.map(_=>({id:_.id??"",object:_.object??"unknown",uri:_.uri??""})),Q=T[0]?.id??null;Object.assign(C,{...$,id:b,type:e,time:S,source:x,actor:v,subject:Q,subjects:I,context:{ip:o?.userIpAddress},data:T,requestId:i??"",analyticsMetadata:o})}else{const T=(Array.isArray(r)?r[0]:r)?.id??null;Object.assign(C,{...$,id:b,type:e,time:S,source:x,actor:v,subject:T,requestId:i??"",data:r,...a!=null&&{request:{source:a}}})}return C}var U1e=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{},Fc="1.9.0",A5=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function B1e(t){var e=new Set([t]),r=new Set,n=t.match(A5);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(A5);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 W1e=B1e(Fc),X1e=Fc.split(".")[0],ym=Symbol.for("opentelemetry.js.api."+X1e),Om=U1e;function pg(t,e,r,n){var i;n===void 0&&(n=!1);var o=Om[ym]=(i=Om[ym])!==null&&i!==void 0?i:{version:Fc};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!==Fc){var s=new Error("@opentelemetry/api: Registration of version v"+o.version+" for "+t+" does not match previously registered API v"+Fc);return r.error(s.stack||s.message),!1}return o[t]=e,r.debug("@opentelemetry/api: Registered a global for "+t+" v"+Fc+"."),!0}function uu(t){var e,r,n=(e=Om[ym])===null||e===void 0?void 0:e.version;if(!(!n||!W1e(n)))return(r=Om[ym])===null||r===void 0?void 0:r[t]}function hg(t,e){e.debug("@opentelemetry/api: Unregistering a global for "+t+" v"+Fc+".");var r=Om[ym];r&&delete r[t]}var F1e=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},Z1e=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))},Y1e=(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 qp("debug",this._namespace,e)},t.prototype.error=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return qp("error",this._namespace,e)},t.prototype.info=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return qp("info",this._namespace,e)},t.prototype.warn=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return qp("warn",this._namespace,e)},t.prototype.verbose=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return qp("verbose",this._namespace,e)},t})();function qp(t,e,r){var n=uu("diag");if(n)return r.unshift(e),n[t].apply(n,Z1e([],F1e(r),!1))}var Ji;(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"})(Ji||(Ji={}));function G1e(t,e){t<Ji.NONE?t=Ji.NONE:t>Ji.ALL&&(t=Ji.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",Ji.ERROR),warn:r("warn",Ji.WARN),info:r("info",Ji.INFO),debug:r("debug",Ji.DEBUG),verbose:r("verbose",Ji.VERBOSE)}}var H1e=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},J1e=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))},K1e="diag",ca=(function(){function t(){function e(i){return function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];var a=uu("diag");if(a)return a[i].apply(a,J1e([],H1e(o),!1))}}var r=this,n=function(i,o){var s,a,l;if(o===void 0&&(o={logLevel:Ji.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=uu("diag"),d=G1e((a=o.logLevel)!==null&&a!==void 0?a:Ji.INFO,i);if(u&&!o.suppressOverrideMessage){var p=(l=new Error().stack)!==null&&l!==void 0?l:"<failed to generate stacktrace>";u.warn("Current logger will be overwritten from "+p),d.warn("Current logger will overwrite one already registered from "+p)}return pg("diag",d,r,!0)};r.setLogger=n,r.disable=function(){hg(K1e,r)},r.createComponentLogger=function(i){return new Y1e(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})(),ewe=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},twe=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.")},rwe=(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=ewe(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=twe(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})(),nwe=Symbol("BaggageEntryMetadata"),iwe=ca.instance();function owe(t){return t===void 0&&(t={}),new rwe(new Map(Object.entries(t)))}function swe(t){return typeof t!="string"&&(iwe.error("Cannot create baggage metadata from unknown type: "+typeof t),t=""),{__TYPE__:nwe,toString:function(){return t}}}function WA(t){return Symbol.for(t)}var awe=(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})(),$d=new awe,Ru=(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)}})(),lwe=(function(){function t(){}return t.prototype.createGauge=function(e,r){return Owe},t.prototype.createHistogram=function(e,r){return vwe},t.prototype.createCounter=function(e,r){return ywe},t.prototype.createUpDownCounter=function(e,r){return bwe},t.prototype.createObservableGauge=function(e,r){return Swe},t.prototype.createObservableCounter=function(e,r){return xwe},t.prototype.createObservableUpDownCounter=function(e,r){return wwe},t.prototype.addBatchObservableCallback=function(e,r){},t.prototype.removeBatchObservableCallback=function(e){},t})(),hS=(function(){function t(){}return t})(),cwe=(function(t){Ru(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.add=function(r,n){},e})(hS),uwe=(function(t){Ru(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.add=function(r,n){},e})(hS),dwe=(function(t){Ru(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.record=function(r,n){},e})(hS),fwe=(function(t){Ru(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.record=function(r,n){},e})(hS),XA=(function(){function t(){}return t.prototype.addCallback=function(e){},t.prototype.removeCallback=function(e){},t})(),pwe=(function(t){Ru(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(XA),hwe=(function(t){Ru(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(XA),mwe=(function(t){Ru(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(XA),gwe=new lwe,ywe=new cwe,Owe=new dwe,vwe=new fwe,bwe=new uwe,xwe=new pwe,Swe=new hwe,wwe=new mwe,Pwe={get:function(t,e){if(t!=null)return t[e]},keys:function(t){return t==null?[]:Object.keys(t)}},Cwe={set:function(t,e,r){t!=null&&(t[e]=r)}},$we=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},kwe=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))},Twe=(function(){function t(){}return t.prototype.active=function(){return $d},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,kwe([n],$we(i),!1))},t.prototype.bind=function(e,r){return r},t.prototype.enable=function(){return this},t.prototype.disable=function(){return this},t})(),Ewe=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},Awe=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))},Yw="context",Iwe=new Twe,mS=(function(){function t(){}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalContextManager=function(e){return pg(Yw,e,ca.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,Awe([e,r,n],Ewe(o),!1))},t.prototype.bind=function(e,r){return this._getContextManager().bind(e,r)},t.prototype._getContextManager=function(){return uu(Yw)||Iwe},t.prototype.disable=function(){this._getContextManager().disable(),hg(Yw,ca.instance())},t})(),nl;(function(t){t[t.NONE=0]="NONE",t[t.SAMPLED=1]="SAMPLED"})(nl||(nl={}));var JX="0000000000000000",KX="00000000000000000000000000000000",eF={traceId:KX,spanId:JX,traceFlags:nl.NONE},Ah=(function(){function t(e){e===void 0&&(e=eF),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})(),FA=WA("OpenTelemetry Context Key SPAN");function ZA(t){return t.getValue(FA)||void 0}function Rwe(){return ZA(mS.getInstance().active())}function YA(t,e){return t.setValue(FA,e)}function jwe(t){return t.deleteValue(FA)}function _we(t,e){return YA(t,new Ah(e))}function tF(t){var e;return(e=ZA(t))===null||e===void 0?void 0:e.spanContext()}var Qwe=/^([0-9a-f]{32})$/i,Dwe=/^[0-9a-f]{16}$/i;function rF(t){return Qwe.test(t)&&t!==KX}function Nwe(t){return Dwe.test(t)&&t!==JX}function gS(t){return rF(t.traceId)&&Nwe(t.spanId)}function Mwe(t){return new Ah(t)}var Gw=mS.getInstance(),nF=(function(){function t(){}return t.prototype.startSpan=function(e,r,n){n===void 0&&(n=Gw.active());var i=!!r?.root;if(i)return new Ah;var o=n&&tF(n);return Lwe(o)&&gS(o)?new Ah(o):new Ah},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??Gw.active(),c=this.startSpan(e,o,l),u=YA(l,c);return Gw.with(u,a,void 0,c)}},t})();function Lwe(t){return typeof t=="object"&&typeof t.spanId=="string"&&typeof t.traceId=="string"&&typeof t.traceFlags=="number"}var qwe=new nF,zwe=(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):qwe},t})(),Vwe=(function(){function t(){}return t.prototype.getTracer=function(e,r,n){return new nF},t})(),Uwe=new Vwe,I5=(function(){function t(){}return t.prototype.getTracer=function(e,r,n){var i;return(i=this.getDelegateTracer(e,r,n))!==null&&i!==void 0?i:new zwe(this,e,r,n)},t.prototype.getDelegate=function(){var e;return(e=this._delegate)!==null&&e!==void 0?e:Uwe},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})(),Jb;(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(Jb||(Jb={}));var Z$;(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"})(Z$||(Z$={}));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 Za=mS.getInstance(),Bt=ca.instance(),Bwe=(function(){function t(){}return t.prototype.getMeter=function(e,r,n){return gwe},t})(),Wwe=new Bwe,Hw="metrics",Xwe=(function(){function t(){}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalMeterProvider=function(e){return pg(Hw,e,ca.instance())},t.prototype.getMeterProvider=function(){return uu(Hw)||Wwe},t.prototype.getMeter=function(e,r,n){return this.getMeterProvider().getMeter(e,r,n)},t.prototype.disable=function(){hg(Hw,ca.instance())},t})(),iF=Xwe.getInstance(),Fwe=(function(){function t(){}return t.prototype.inject=function(e,r){},t.prototype.extract=function(e,r){return e},t.prototype.fields=function(){return[]},t})(),GA=WA("OpenTelemetry Baggage Key");function oF(t){return t.getValue(GA)||void 0}function Zwe(){return oF(mS.getInstance().active())}function Ywe(t,e){return t.setValue(GA,e)}function Gwe(t){return t.deleteValue(GA)}var Jw="propagation",Hwe=new Fwe,Jwe=(function(){function t(){this.createBaggage=owe,this.getBaggage=oF,this.getActiveBaggage=Zwe,this.setBaggage=Ywe,this.deleteBaggage=Gwe}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalPropagator=function(e){return pg(Jw,e,ca.instance())},t.prototype.inject=function(e,r,n){return n===void 0&&(n=Cwe),this._getGlobalPropagator().inject(e,r,n)},t.prototype.extract=function(e,r,n){return n===void 0&&(n=Pwe),this._getGlobalPropagator().extract(e,r,n)},t.prototype.fields=function(){return this._getGlobalPropagator().fields()},t.prototype.disable=function(){hg(Jw,ca.instance())},t.prototype._getGlobalPropagator=function(){return uu(Jw)||Hwe},t})(),Ih=Jwe.getInstance(),Kw="trace",Kwe=(function(){function t(){this._proxyTracerProvider=new I5,this.wrapSpanContext=Mwe,this.isSpanContextValid=gS,this.deleteSpan=jwe,this.getSpan=ZA,this.getActiveSpan=Rwe,this.getSpanContext=tF,this.setSpan=YA,this.setSpanContext=_we}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalTracerProvider=function(e){var r=pg(Kw,this._proxyTracerProvider,ca.instance());return r&&this._proxyTracerProvider.setDelegate(e),r},t.prototype.getTracerProvider=function(){return uu(Kw)||this._proxyTracerProvider},t.prototype.getTracer=function(e,r){return this.getTracerProvider().getTracer(e,r)},t.prototype.disable=function(){hg(Kw,ca.instance()),this._proxyTracerProvider=new I5},t})(),Ti=Kwe.getInstance();const sF=WA("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function ePe(t){return t.setValue(sF,!0)}function HA(t){return t.getValue(sF)===!0}const tPe="=",Y$=";",G$=",",eP="baggage",rPe=180,nPe=4096,iPe=8192;function oPe(t){return t.reduce((e,r)=>{const n=`${e}${e!==""?G$:""}${r}`;return n.length>iPe?e:n},"")}function sPe(t){return t.getAllEntries().map(([e,r])=>{let n=`${encodeURIComponent(e)}=${encodeURIComponent(r.value)}`;return r.metadata!==void 0&&(n+=Y$+r.metadata.toString()),n})}function aPe(t){const e=t.split(Y$);if(e.length<=0)return;const r=e.shift();if(!r)return;const n=r.indexOf(tPe);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=swe(e.join(Y$))),{key:i,value:o,metadata:s}}class lPe{inject(e,r,n){const i=Ih.getBaggage(e);if(!i||HA(e))return;const o=sPe(i).filter(a=>a.length<=nPe).slice(0,rPe),s=oPe(o);s.length>0&&n.set(r,eP,s)}extract(e,r,n){const i=n.get(r,eP),o=Array.isArray(i)?i.join(G$):i;if(!o)return e;const s={};return o.length===0||(o.split(G$).forEach(l=>{const c=aPe(l);if(c){const u={value:c.value};c.metadata&&(u.metadata=c.metadata),s[c.key]=u}}),Object.entries(s).length===0)?e:Ih.setBaggage(e,Ih.createBaggage(s))}fields(){return[eP]}}function yv(t){const e={};if(typeof t!="object"||t==null)return e;for(const[r,n]of Object.entries(t)){if(!cPe(r)){Bt.warn(`Invalid attribute key: ${r}`);continue}if(!aF(n)){Bt.warn(`Invalid attribute value set for key: ${r}`);continue}Array.isArray(n)?e[r]=n.slice():e[r]=n}return e}function cPe(t){return typeof t=="string"&&t.length>0}function aF(t){return t==null?!0:Array.isArray(t)?uPe(t):lF(t)}function uPe(t){let e;for(const r of t)if(r!=null){if(!e){if(lF(r)){e=typeof r;continue}return!1}if(typeof r!==e)return!1}return!0}function lF(t){switch(typeof t){case"number":case"boolean":case"string":return!0}return!1}function dPe(){return t=>{Bt.error(fPe(t))}}function fPe(t){return typeof t=="string"?t:JSON.stringify(pPe(t))}function pPe(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 hPe=dPe();function bf(t){try{hPe(t)}catch{}}const Gd=performance,mPe="2.0.1",tP="exception.message",gPe="exception.stacktrace",rP="exception.type",yPe="service.name",H$="telemetry.sdk.language",OPe="webjs",J$="telemetry.sdk.name",K$="telemetry.sdk.version",vPe="process.runtime.name",nP={[J$]:"opentelemetry",[vPe]:"browser",[H$]:OPe,[K$]:mPe};const bPe=9,xPe=6,SPe=Math.pow(10,xPe),Kb=Math.pow(10,bPe);function Md(t){const e=t/1e3,r=Math.trunc(e),n=Math.round(t%1e3*SPe);return[r,n]}function cF(){let t=Gd.timeOrigin;if(typeof t!="number"){const e=Gd;t=e.timing&&e.timing.fetchStart}return t}function wPe(t){const e=Md(cF()),r=Md(typeof t=="number"?t:Gd.now());return dF(e,r)}function PPe(t,e){let r=e[0]-t[0],n=e[1]-t[1];return n<0&&(r-=1,n+=Kb),[r,n]}function CPe(t){return t[0]*Kb+t[1]}function uF(t){return Array.isArray(t)&&t.length===2&&typeof t[0]=="number"&&typeof t[1]=="number"}function R5(t){return uF(t)||typeof t=="number"||t instanceof Date}function dF(t,e){const r=[t[0]+e[0],t[1]+e[1]];return r[1]>=Kb&&(r[1]-=Kb,r[0]+=1),r}var qs;(function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"})(qs||(qs={}));class $Pe{_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){Bt.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){Bt.warn(`Failed to extract with ${o.constructor.name}. Err: ${s.message}`)}return i},e)}fields(){return this._fields.slice()}}const ek="[_0-9a-z-*/]",kPe=`[a-z]${ek}{0,255}`,TPe=`[a-z0-9]${ek}{0,240}@[a-z]${ek}{0,13}`,EPe=new RegExp(`^(?:${kPe}|${TPe})$`),APe=/^[ -~]{0,255}[!-~]$/,IPe=/,|=/;function RPe(t){return EPe.test(t)}function jPe(t){return APe.test(t)&&!IPe.test(t)}const j5=32,_Pe=512,_5=",",Q5="=";class JA{_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+Q5+this.get(r)),e),[]).join(_5)}_parse(e){e.length>_Pe||(this._internalState=e.split(_5).reverse().reduce((r,n)=>{const i=n.trim(),o=i.indexOf(Q5);if(o!==-1){const s=i.slice(0,o),a=i.slice(o+1,n.length);RPe(s)&&jPe(a)&&r.set(s,a)}return r},new Map),this._internalState.size>j5&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,j5))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){const e=new JA;return e._internalState=new Map(this._internalState),e}}const iP="traceparent",oP="tracestate",QPe="00",DPe="(?!ff)[\\da-f]{2}",NPe="(?![0]{32})[\\da-f]{32}",MPe="(?![0]{16})[\\da-f]{16}",LPe="[\\da-f]{2}",qPe=new RegExp(`^\\s?(${DPe})-(${NPe})-(${MPe})-(${LPe})(-.*)?\\s?$`);function zPe(t){const e=qPe.exec(t);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}class VPe{inject(e,r,n){const i=Ti.getSpanContext(e);if(!i||HA(e)||!gS(i))return;const o=`${QPe}-${i.traceId}-${i.spanId}-0${Number(i.traceFlags||nl.NONE).toString(16)}`;n.set(r,iP,o),i.traceState&&n.set(r,oP,i.traceState.serialize())}extract(e,r,n){const i=n.get(r,iP);if(!i)return e;const o=Array.isArray(i)?i[0]:i;if(typeof o!="string")return e;const s=zPe(o);if(!s)return e;s.isRemote=!0;const a=n.get(r,oP);if(a){const l=Array.isArray(a)?a.join(","):a;s.traceState=new JA(typeof l=="string"?l:void 0)}return Ti.setSpanContext(e,s)}fields(){return[iP,oP]}}const UPe="[object Object]",BPe="[object Null]",WPe="[object Undefined]",XPe=Function.prototype,fF=XPe.toString,FPe=fF.call(Object),ZPe=Object.getPrototypeOf,pF=Object.prototype,hF=pF.hasOwnProperty,qc=Symbol?Symbol.toStringTag:void 0,mF=pF.toString;function D5(t){if(!YPe(t)||GPe(t)!==UPe)return!1;const e=ZPe(t);if(e===null)return!0;const r=hF.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&fF.call(r)===FPe}function YPe(t){return t!=null&&typeof t=="object"}function GPe(t){return t==null?t===void 0?WPe:BPe:qc&&qc in Object(t)?HPe(t):JPe(t)}function HPe(t){const e=hF.call(t,qc),r=t[qc];let n=!1;try{t[qc]=void 0,n=!0}catch{}const i=mF.call(t);return n&&(e?t[qc]=r:delete t[qc]),i}function JPe(t){return mF.call(t)}const KPe=20;function eCe(...t){let e=t.shift();const r=new WeakMap;for(;t.length>0;)e=gF(e,t.shift(),0,r);return e}function sP(t){return e0(t)?t.slice():t}function gF(t,e,r=0,n){let i;if(!(r>KPe)){if(r++,Ov(t)||Ov(e)||yF(e))i=sP(e);else if(e0(t)){if(i=t.slice(),e0(e))for(let o=0,s=e.length;o<s;o++)i.push(sP(e[o]));else if(zp(e)){const o=Object.keys(e);for(let s=0,a=o.length;s<a;s++){const l=o[s];i[l]=sP(e[l])}}}else if(zp(t))if(zp(e)){if(!tCe(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(Ov(c))typeof c>"u"?delete i[l]:i[l]=c;else{const u=i[l],d=c;if(N5(t,l,n)||N5(e,l,n))delete i[l];else{if(zp(u)&&zp(d)){const p=n.get(u)||[],h=n.get(d)||[];p.push({obj:t,key:l}),h.push({obj:e,key:l}),n.set(u,p),n.set(d,h)}i[l]=gF(i[l],c,r,n)}}}}else i=e;return i}}function N5(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 e0(t){return Array.isArray(t)}function yF(t){return typeof t=="function"}function zp(t){return!Ov(t)&&!e0(t)&&!yF(t)&&typeof t=="object"}function Ov(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t>"u"||t instanceof Date||t instanceof RegExp||t===null}function tCe(t,e){return!(!D5(t)||!D5(e))}class rCe{_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 nCe{_callback;_that;_isCalled=!1;_deferred=new rCe;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 iCe(){return"unknown_service"}const ch=t=>t!==null&&typeof t=="object"&&typeof t.then=="function";class t0{_rawAttributes;_asyncAttributesPending=!1;_memoizedAttributes;static FromAttributeList(e){const r=new t0({});return r._rawAttributes=M5(e),r._asyncAttributesPending=e.filter(([n,i])=>ch(i)).length>0,r}constructor(e){const r=e.attributes??{};this._rawAttributes=Object.entries(r).map(([n,i])=>(ch(i)&&(this._asyncAttributesPending=!0),[n,i])),this._rawAttributes=M5(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,ch(n)?await n:n]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&Bt.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;const e={};for(const[r,n]of this._rawAttributes){if(ch(n)){Bt.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:t0.FromAttributeList([...e.getRawAttributes(),...this.getRawAttributes()])}}function OF(t){return t0.FromAttributeList(Object.entries(t))}function oCe(){return OF({[yPe]:iCe(),[H$]:nP[H$],[J$]:nP[J$],[K$]:nP[K$]})}function M5(t){return t.map(([e,r])=>ch(r)?[e,r.catch(n=>{Bt.debug("promise rejection for resource attribute: %s - %s",e,n)})]:[e,r])}const sCe="exception";class aCe{_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=Gd.now(),this._performanceOffset=r-(this._performanceStartTime+cF()),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 Bt.warn(`Invalid attribute key: ${e}`),this;if(!aF(r))return Bt.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 Bt.warn("No events allowed."),this._droppedEventsCount++,this;i!==void 0&&this.events.length>=i&&(this._droppedEventsCount===0&&Bt.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),R5(r)&&(R5(n)||(n=r),r=void 0);const o=yv(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"&&(Bt.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()){Bt.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=PPe(this.startTime,this.endTime),this._duration[0]<0&&(Bt.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&&Bt.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._spanProcessor.onEnd(this)}_getTime(e){if(typeof e=="number"&&e<=Gd.now())return wPe(e+this._performanceOffset);if(typeof e=="number")return Md(e);if(e instanceof Date)return Md(e.getTime());if(uF(e))return e;if(this._startTimeProvided)return Md(Date.now());const r=Gd.now()-this._performanceStartTime;return dF(this.startTime,Md(r))}isRecording(){return this._ended===!1}recordException(e,r){const n={};typeof e=="string"?n[tP]=e:e&&(e.code?n[rP]=e.code.toString():e.name&&(n[rP]=e.name),e.message&&(n[tP]=e.message),e.stack&&(n[gPe]=e.stack)),n[rP]||n[tP]?this.addEvent(sCe,n,r):Bt.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}}`);Bt.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?(Bt.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 xf;(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(xf||(xf={}));class r0{shouldSample(){return{decision:xf.NOT_RECORD}}toString(){return"AlwaysOffSampler"}}class Hd{shouldSample(){return{decision:xf.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}}class aO{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(e){this._root=e.root,this._root||(bf(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new Hd),this._remoteParentSampled=e.remoteParentSampled??new Hd,this._remoteParentNotSampled=e.remoteParentNotSampled??new r0,this._localParentSampled=e.localParentSampled??new Hd,this._localParentNotSampled=e.localParentNotSampled??new r0}shouldSample(e,r,n,i,o,s){const a=Ti.getSpanContext(e);return!a||!gS(a)?this._root.shouldSample(e,r,n,i,o,s):a.isRemote?a.traceFlags&nl.SAMPLED?this._remoteParentSampled.shouldSample(e,r,n,i,o,s):this._remoteParentNotSampled.shouldSample(e,r,n,i,o,s):a.traceFlags&nl.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 L5{_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:rF(r)&&this._accumulate(r)<this._upperBound?xf.RECORD_AND_SAMPLED:xf.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 q5=1;function vF(){return{sampler:bF(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},spanLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128,linkCountLimit:128,eventCountLimit:128,attributePerEventCountLimit:128,attributePerLinkCountLimit:128}}}function bF(){const t="parentbased_always_on";switch(t){case"always_on":return new Hd;case"always_off":return new r0;case"parentbased_always_on":return new aO({root:new Hd});case"parentbased_always_off":return new aO({root:new r0});case"traceidratio":return new L5(z5());case"parentbased_traceidratio":return new aO({root:new L5(z5())});default:return Bt.error(`OTEL_TRACES_SAMPLER value "${t}" invalid, defaulting to "parentbased_always_on".`),new aO({root:new Hd})}}function z5(){return Bt.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${q5}.`),q5}const lCe=128,cCe=1/0;function uCe(t){const e={sampler:bF()},r=vF(),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 dCe(t){const e=Object.assign({},t.spanLimits);return e.attributeCountLimit=t.spanLimits?.attributeCountLimit??t.generalLimits?.attributeCountLimit??void 0??void 0??lCe,e.attributeValueLengthLimit=t.spanLimits?.attributeValueLengthLimit??t.generalLimits?.attributeValueLengthLimit??void 0??void 0??cCe,Object.assign({},t,{spanLimits:e})}class fCe{_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 nCe(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(Bt.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&nl.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&&Bt.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(Bt.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);Za.with(ePe(Za.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===qs.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=>{bf(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,bf(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 pCe extends fCe{_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=>{bf(r)})},this._pageHideListener=()=>{this.forceFlush().catch(r=>{bf(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 hCe=8,mCe=16;class gCe{generateTraceId=V5(mCe);generateSpanId=V5(hCe)}const lO=Array(32);function V5(t){return function(){for(let r=0;r<t*2;r++)lO[r]=Math.floor(Math.random()*16)+48,lO[r]>=58&&(lO[r]+=39);return String.fromCharCode.apply(null,lO.slice(0,t*2))}}class yCe{_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;constructor(e,r,n,i){const o=uCe(r);this._sampler=o.sampler,this._generalLimits=o.generalLimits,this._spanLimits=o.spanLimits,this._idGenerator=r.idGenerator||new gCe,this._resource=n,this._spanProcessor=i,this.instrumentationScope=e}startSpan(e,r={},n=Za.active()){r.root&&(n=Ti.deleteSpan(n));const i=Ti.getSpan(n);if(HA(n))return Bt.debug("Instrumentation suppressed, returning Noop Span"),Ti.wrapSpanContext(eF);const o=i?.spanContext(),s=this._idGenerator.generateSpanId();let a,l,c;!o||!Ti.isSpanContextValid(o)?l=this._idGenerator.generateTraceId():(l=o.traceId,c=o.traceState,a=o);const u=r.kind??Z$.INTERNAL,d=(r.links??[]).map(v=>({context:v.context,attributes:yv(v.attributes)})),p=yv(r.attributes),h=this._sampler.shouldSample(n,l,e,u,p,d);c=h.traceState??c;const g=h.decision===Jb.RECORD_AND_SAMPLED?nl.SAMPLED:nl.NONE,m={traceId:l,spanId:s,traceFlags:g,traceState:c};if(h.decision===Jb.NOT_RECORD)return Bt.debug("Recording is off, propagating context in a non-recording span"),Ti.wrapSpanContext(m);const y=yv(Object.assign(p,h.attributes));return new aCe({resource:this._resource,scope:this.instrumentationScope,context:n,spanContext:m,name:e,kind:u,links:d,parentSpanContext:a,attributes:y,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??Za.active(),c=this.startSpan(e,o,l),u=Ti.setSpan(l,c);return Za.with(u,a,void 0,c)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}}class OCe{_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=>{bf(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 zc;(function(t){t[t.resolved=0]="resolved",t[t.timeout=1]="timeout",t[t.error=2]="error",t[t.unresolved=3]="unresolved"})(zc||(zc={}));class vCe{_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(e={}){const r=eCe({},vF(),dCe(e));this._resource=r.resource??oCe(),this._config=Object.assign({},r,{resource:this._resource});const n=[];e.spanProcessors?.length&&n.push(...e.spanProcessors),this._activeSpanProcessor=new OCe(n)}getTracer(e,r,n){const i=`${e}@${r||""}:${n?.schemaUrl||""}`;return this._tracers.has(i)||this._tracers.set(i,new yCe({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=zc.timeout},e);n.forceFlush().then(()=>{clearTimeout(s),o!==zc.timeout&&(o=zc.resolved,i(o))}).catch(a=>{clearTimeout(s),o=zc.error,i(a)})}));return new Promise((n,i)=>{Promise.all(r).then(o=>{const s=o.filter(a=>a!==zc.resolved);s.length>0?i(s):n()}).catch(o=>i([o]))})}shutdown(){return this._activeSpanProcessor.shutdown()}}class bCe{_enabled=!1;_currentContext=$d;_bindFunction(e=$d,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=$d,this._enabled=!1,this}enable(){return this._enabled?this:(this._enabled=!0,this._currentContext=$d,this)}with(e,r,n,...i){const o=this._currentContext;this._currentContext=e||$d;try{return r.call(n,...i)}finally{this._currentContext=o}}}function xCe(t){if(t!==null){if(t===void 0){const e=new bCe;e.enable(),Za.setGlobalContextManager(e);return}t.enable(),Za.setGlobalContextManager(t)}}function SCe(t){if(t!==null){if(t===void 0){Ih.setGlobalPropagator(new $Pe({propagators:[new VPe,new lPe]}));return}Ih.setGlobalPropagator(t)}}class wCe extends vCe{constructor(e={}){super(e)}register(e={}){Ti.setGlobalTracerProvider(this),SCe(e.propagator),xCe(e.contextManager)}}class PCe{_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 U5 extends Error{code;name="OTLPExporterError";data;constructor(e,r,n){super(e),this.data=n,this.code=r}}function CCe(t){if(Number.isFinite(t)&&t>0)return t;throw new Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${t}')`)}function $Ce(t){if(t!=null)return()=>t}function kCe(t,e,r){return{timeoutMillis:CCe(t.timeoutMillis??e.timeoutMillis??r.timeoutMillis),concurrencyLimit:t.concurrencyLimit??e.concurrencyLimit??r.concurrencyLimit,compression:t.compression??e.compression??r.compression}}function TCe(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:"none"}}class ECe{_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 ACe(t){return new ECe(t.concurrencyLimit)}function ICe(t){return Object.prototype.hasOwnProperty.call(t,"partialSuccess")}function RCe(){return{handleResponse(t){t==null||!ICe(t)||t.partialSuccess==null||Object.keys(t.partialSuccess).length===0||Bt.warn("Received Partial Success response:",JSON.stringify(t.partialSuccess))}}}class jCe{_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=Bt.createComponentLogger({namespace:"OTLPExportDelegate"})}export(e,r){if(this._diagLogger.debug("items to be sent",e),this._promiseQueue.hasReachedLimit()){r({code:qs.FAILED,error:new Error("Concurrent export limit reached")});return}const n=this._serializer.serializeRequest(e);if(n==null){r({code:qs.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:qs.SUCCESS});return}else if(i.status==="failure"&&i.error){r({code:qs.FAILED,error:i.error});return}else i.status==="retryable"?r({code:qs.FAILED,error:new U5("Export failed with retryable status")}):r({code:qs.FAILED,error:new U5("Export failed with unknown error")})},i=>r({code:qs.FAILED,error:i})))}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug("shutdown started"),await this.forceFlush(),this._transport.shutdown()}}function _Ce(t,e){return new jCe(t.transport,t.serializer,RCe(),t.promiseHandler,e.timeout)}function xF(t,e,r){return _Ce({transport:r,serializer:e,promiseHandler:ACe(t)},{timeout:t.timeoutMillis})}function B5(t){return t>=48&&t<=57?t-48:t>=97&&t<=102?t-87:t-55}function SF(t){const e=new Uint8Array(t.length/2);let r=0;for(let n=0;n<t.length;n+=2){const i=B5(t.charCodeAt(n)),o=B5(t.charCodeAt(n+1));e[r++]=i<<4|o}return e}function wF(t){const e=BigInt(1e9);return BigInt(t[0])*e+BigInt(t[1])}function QCe(t){const e=Number(BigInt.asUintN(32,t)),r=Number(BigInt.asUintN(32,t>>BigInt(32)));return{low:e,high:r}}function DCe(t){const e=wF(t);return QCe(e)}function NCe(t){return wF(t).toString()}const MCe=typeof BigInt<"u"?NCe:CPe;function W5(t){return t}function LCe(t){if(t!==void 0)return SF(t)}const qCe={encodeHrTime:DCe,encodeSpanContext:SF,encodeOptionalSpanContext:LCe};function zCe(t){return t===void 0?qCe:{encodeHrTime:MCe,encodeSpanContext:W5,encodeOptionalSpanContext:W5}}function VCe(t){return{attributes:yS(t.attributes),droppedAttributesCount:0}}function UCe(t){return{name:t.name,version:t.version}}function yS(t){return Object.keys(t).map(e=>PF(e,t[e]))}function PF(t,e){return{key:t,value:CF(e)}}function CF(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(CF)}}:e==="object"&&t!=null?{kvlistValue:{values:Object.entries(t).map(([r,n])=>PF(r,n))}}:{}}function BCe(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:yS(t.attributes),droppedAttributesCount:t.droppedAttributesCount,events:t.events.map(o=>XCe(o,e)),droppedEventsCount:t.droppedEventsCount,status:{code:n.code,message:n.message},links:t.links.map(o=>WCe(o,e)),droppedLinksCount:t.droppedLinksCount}}function WCe(t,e){return{attributes:t.attributes?yS(t.attributes):[],spanId:e.encodeSpanContext(t.context.spanId),traceId:e.encodeSpanContext(t.context.traceId),traceState:t.context.traceState?.serialize(),droppedAttributesCount:t.droppedAttributesCount||0}}function XCe(t,e){return{attributes:t.attributes?yS(t.attributes):[],name:t.name,timeUnixNano:e.encodeHrTime(t.time),droppedAttributesCount:t.droppedAttributesCount||0}}function FCe(t,e){const r=zCe(e);return{resourceSpans:YCe(t,r)}}function ZCe(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 YCe(t,e){const r=ZCe(t),n=[],i=r.entries();let o=i.next();for(;!o.done;){const[s,a]=o.value,l=[],c=a.values();let u=c.next();for(;!u.done;){const p=u.value;if(p.length>0){const h=p.map(g=>BCe(g,e));l.push({scope:UCe(p[0].instrumentationScope),spans:h,schemaUrl:p[0].instrumentationScope.schemaUrl})}u=c.next()}const d={resource:VCe(s),scopeSpans:l,schemaUrl:void 0};n.push(d),o=i.next()}return n}const GCe={serializeRequest:t=>{const e=FCe(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))}},HCe=5,JCe=1e3,KCe=5e3,e$e=1.5,X5=.2;function t$e(){return Math.random()*(2*X5)-X5}class r$e{_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=HCe,s=JCe;for(;i.status==="retryable"&&o>0;){o--;const a=Math.max(Math.min(s,KCe)+t$e(),0);s=s*e$e;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 $F(t){return new r$e(t.transport)}function n$e(t){return[429,502,503,504].includes(t)}function i$e(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 o$e{_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?(Bt.debug("XHR success"),n({status:"success"})):i.status&&n$e(i.status)?n({status:"retryable",retryInMillis:i$e(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 s$e(t){return new o$e(t)}class a$e{_params;constructor(e){this._params=e}send(e){return new Promise(r=>{navigator.sendBeacon(this._params.url,new Blob([e],{type:this._params.blobType}))?(Bt.debug("SendBeacon success"),r({status:"success"})):r({status:"failure",error:new Error("SendBeacon failed")})})}shutdown(){}}function l$e(t){return new a$e(t)}function c$e(t,e){return xF(t,e,$F({transport:s$e(t)}))}function u$e(t,e){return xF(t,e,$F({transport:l$e({url:t.url,blobType:t.headers()["Content-Type"]})}))}function d$e(t){return()=>{const e={};return Object.entries(t?.()??{}).forEach(([r,n])=>{typeof n<"u"?e[r]=String(n):Bt.warn(`Header "${r}" has invalid value (${n}) and will be ignored`)}),e}}function f$e(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 p$e(t){if(t!=null)try{return new URL(t),t}catch{throw new Error(`Configuration: Could not parse user-provided export URL: '${t}'`)}}function h$e(t,e,r){return{...kCe(t,e,r),headers:f$e(d$e(t.headers),e.headers,r.headers),url:p$e(t.url)??e.url??r.url,agentOptions:t.agentOptions??e.agentOptions??r.agentOptions}}function m$e(t,e){return{...TCe(),headers:()=>t,url:"http://localhost:4318/"+e,agentOptions:{keepAlive:!0}}}function g$e(t,e,r){return h$e({url:t.url,timeoutMillis:t.timeoutMillis,headers:$Ce(t.headers),concurrencyLimit:t.concurrencyLimit},{},m$e(r,e))}function y$e(t,e,r,n){const i=!!t.headers||typeof navigator.sendBeacon!="function",o=g$e(t,r,n);return i?c$e(o,e):u$e(o,e)}class O$e extends PCe{constructor(e={}){super(y$e(e,GCe,"v1/traces",{"Content-Type":"application/json"}))}}const v$e="service.name",b$e="service.version";let kF=class{emit(e){}};const x$e=new kF;class S$e{getLogger(e,r,n){return new kF}}const TF=new S$e;class w$e{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):x$e}}class F5{getLogger(e,r,n){var i;return(i=this.getDelegateLogger(e,r,n))!==null&&i!==void 0?i:new w$e(this,e,r,n)}getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:TF}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 P$e=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{},cO=Symbol.for("io.opentelemetry.js.api.logs"),Vp=P$e;function C$e(t,e,r){return n=>n===t?e:r}const Z5=1;class KA{constructor(){this._proxyLoggerProvider=new F5}static getInstance(){return this._instance||(this._instance=new KA),this._instance}setGlobalLoggerProvider(e){return Vp[cO]?this.getLoggerProvider():(Vp[cO]=C$e(Z5,e,TF),this._proxyLoggerProvider.setDelegate(e),e)}getLoggerProvider(){var e,r;return(r=(e=Vp[cO])===null||e===void 0?void 0:e.call(Vp,Z5))!==null&&r!==void 0?r:this._proxyLoggerProvider}getLogger(e,r,n){return this.getLoggerProvider().getLogger(e,r,n)}disable(){delete Vp[cO],this._proxyLoggerProvider=new F5}}const EF=KA.getInstance();function $$e(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 k$e(t){t.forEach(e=>e.disable())}function T$e(t){const e=t.tracerProvider||Ti.getTracerProvider(),r=t.meterProvider||iF.getMeterProvider(),n=t.loggerProvider||EF.getLoggerProvider(),i=t.instrumentations?.flat()??[];return $$e(i,e,r,n),()=>{k$e(i)}}let so=console.error.bind(console);function Up(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 AF=(t,e,r)=>{if(!t||!t[e]){so("no original function "+String(e)+" to wrap");return}if(!r){so("no wrapper function"),so(new Error().stack);return}const n=t[e];if(typeof n!="function"||typeof r!="function"){so("original object and wrapper must be functions");return}const i=r(n,e);return Up(i,"__original",n),Up(i,"__unwrap",()=>{t[e]===i&&Up(t,e,n)}),Up(i,"__wrapped",!0),Up(t,e,i),i},E$e=(t,e,r)=>{if(t)Array.isArray(t)||(t=[t]);else{so("must provide one or more modules to patch"),so(new Error().stack);return}if(!(e&&Array.isArray(e))){so("must provide one or more functions to wrap on modules");return}t.forEach(n=>{e.forEach(i=>{AF(n,i,r)})})},IF=(t,e)=>{if(!t||!t[e]){so("no function to unwrap."),so(new Error().stack);return}const r=t[e];if(!r.__unwrap)so("no original to unwrap to -- has "+String(e)+" already been unwrapped?");else{r.__unwrap();return}},A$e=(t,e)=>{if(t)Array.isArray(t)||(t=[t]);else{so("must provide one or more modules to patch"),so(new Error().stack);return}if(!(e&&Array.isArray(e))){so("must provide one or more functions to unwrap on modules");return}t.forEach(r=>{e.forEach(n=>{IF(r,n)})})};class I$e{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(e,r,n){this.instrumentationName=e,this.instrumentationVersion=r,this.setConfig(n),this._diag=Bt.createComponentLogger({namespace:e}),this._tracer=Ti.getTracer(e,r),this._meter=iF.getMeter(e,r),this._logger=EF.getLogger(e,r),this._updateMetricInstruments()}_wrap=AF;_unwrap=IF;_massWrap=E$e;_massUnwrap=A$e;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 R$e extends I$e{constructor(e,r,n){super(e,r,n),this._config.enabled&&this.enable()}}class j$e{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)}setStatus(e,r){this.span&&this.span.setStatus(e,r)}end(){this.span&&(this.span.setStatus(exports.SpanStatusCode.OK),this.span.end())}}function Sf(t){return t.replace(/([A-Z])/g,"_$1").toLowerCase()}function RF(t){const e={updated:[],notUpdated:[]};for(const r of t){if(!r||typeof r!="object")continue;const n=r.object;if(!n||typeof n!="string")continue;const i=r,o=e.notUpdated.find(s=>s.object===n);o?(e.updated=[o,i],e.notUpdated=e.notUpdated.filter(s=>s.object!==n)):e.updated.some(s=>s.object===n)||e.notUpdated.push(i)}return e}function n0(t,e,r,n=!0){for(const[i,o]of Object.entries(t))if(o!==void 0){const s=n?Sf(i):i;r[`${e}${s}`]=o}}function _$e(t,e,r){for(const[n,i]of Object.entries(t))i==null||typeof i=="object"||(r[`${e}.${Sf(n)}`]=i)}function Q$e(t,e,r){const n=e instanceof Date?e.toISOString():new Date(e).toISOString();return{"cloudevents.event_id":t.id,"cloudevents.event_type":t.type,"cloudevents.event_source":t.source??void 0,"cloudevents.event_spec_version":t.specversion,"cloudevents.event_data_content_type":t.datacontenttype??"application/json; charset=utf-8","cloudevents.event_time":n,"cloudevents.event_subject":t.subject??"","cloudevents.page.uri":typeof location<"u"?location.href:void 0,"cloudevents.event_version":r?.version,"cloudevents.event_origin":t.origin??r?.serviceName,"cloudevents.event_source_details.id":t.actor?.id??"anonymous","cloudevents.event_source_details.object":t.actor?.object??"anonymous","cloudevents.event_source_details.uri":t.actor?.uri??void 0,"cloudevents.metadata.user_id":t.analyticsMetadata?.userId,"cloudevents.metadata.user_ip_address":t.analyticsMetadata?.userIpAddress,"cloudevents.event_object":t.object||"event","cloudevents.object":t.object||"event","cloudevents.event_category":t.category,"cloudevents.event_signal":t.signal,"cloudevents.origin":t.origin,"cloudevents.event_actor.id":t.actor?.id??void 0,"cloudevents.event_actor.object":t.actor?.object??void 0,"cloudevents.event_actor.uri":t.actor?.uri??void 0,"cloudevents.event_organization_id":t.organizationId,"cloudevents.event_organization_slug":t.organizationSlug,"cloudevents.event_project_id":t.projectId,"cloudevents.event_project_slug":t.projectSlug,"cloudevents.event_request_id":t.requestId,"cloudevents.requestId":t.requestId,"cloudevents.organizationId":t.organizationId,"cloudevents.organizationSlug":t.organizationSlug,"cloudevents.projectId":t.projectId,"cloudevents.projectSlug":t.projectSlug,"cloudevents.event_os_platform":t.osPlatform,"cloudevents.event_user_agent":t.userAgent}}function D$e(t,e,r){const n=t.data,i={...Q$e(t,e,r),...Y5("project",t),...Y5("organization",t)};return N$e(n,i),V$e(t,i),U$e(t,i),i}function N$e(t,e){!t||typeof t!="object"||(Array.isArray(t)?M$e(t,e):z$e(t,e))}function M$e(t,e){t.some(n=>n&&typeof n=="object"&&typeof n.object=="string")?L$e(t,e):q$e(t,e)}function L$e(t,e){const r=RF(t);r.updated.forEach((n,i)=>{const o=`cloudevents.event_data.${i===0?"after.":"before."}${n.object}.`;n0(n,o,e)}),r.notUpdated.forEach(n=>{const i=`cloudevents.event_data.${n.object}.`;n0(n,i,e)})}function q$e(t,e){for(const r of t)if(!(!r||typeof r!="object"))for(const[n,i]of Object.entries(r)){if(i===void 0)continue;const o=Sf(n);i!==null&&typeof i=="object"&&!Array.isArray(i)?_$e(i,`cloudevents.event_data.${o}`,e):e[`cloudevents.event_data.${o}`]=i}}function z$e(t,e){for(const[r,n]of Object.entries(t)){if(n==null)continue;const i=Sf(r);if(typeof n=="object"&&!Array.isArray(n))for(const[o,s]of Object.entries(n))s!=null&&(typeof s=="string"||typeof s=="number"||typeof s=="boolean")&&(e[`cloudevents.event_data.${i}.${o}`]=s);else(typeof n=="string"||typeof n=="number"||typeof n=="boolean")&&(e[`cloudevents.event_data.${i}`]=n)}}function V$e(t,e){if(!t.subjects||!Array.isArray(t.subjects))return;const r=RF(t.subjects);r.updated.forEach((n,i)=>{const o=`cloudevents.subjects.${i===0?"after.":"before."}${n.object}.`;n0(n,o,e,!1)}),r.notUpdated.forEach(n=>{const i=`cloudevents.subjects.${n.object}.`;n0(n,i,e,!1)})}function U$e(t,e){for(const[r,n]of Object.entries(t))if(!(z1e.includes(r)||n===void 0))if(n instanceof Object)for(const[i,o]of Object.entries(n))o!==void 0&&(e[`cloudevents.${r}.${i}`]=o);else e[`cloudevents.${r}`]=n}function Y5(t,e){const r=`${t}Id`,n=`${t}Slug`,i=e[r],o=e[n];if(i!==void 0&&o!==void 0)return{[`cloudevents.${t}.id`]:i,[`cloudevents.${t}.slug`]:o};const s=e.data;if(Array.isArray(s)&&s.length){const a=s.find(l=>l?.object===t);return a?{[`cloudevents.${t}.id`]:a.id,[`cloudevents.${t}.slug`]:a.slug}:{}}return{}}function B$e(t,e,r){return D$e(t,e,r)}class W$e{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,n="time"in r&&r.time?new Date(r.time):new Date;this.tracer.startSpan(`event.${r.type}`,{attributes:this.processAttributes(r,n),startTime:n}).end(n)}catch(r){this.config?.isProd||console.error("Event reporting failed:",r)}}processAttributes(e,r){return B$e(e,r,this.config)}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=Ti.setSpan(Za.active(),o)),{end:()=>o.end(),setAttribute:(s,a)=>{o.setAttribute(`cloudevents.event_data.${Sf(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,r){try{if(!this.tracer)return;const n=r||Za.active(),i=e,o=i.time?new Date(i.time):new Date,s=this.tracer.startSpan(`event.${i.type}`,{attributes:this.processAttributes(i,o)},n),a=Ti.setSpan(n,s);return{end:()=>s.end(),setAttribute:(l,c)=>{s.setAttribute(`cloudevents.event_data.${Sf(l)}`,c)},setStatus:(l,c)=>s.setStatus({code:l,message:c}),recordException:l=>s.recordException(l),context:a}}catch(n){this.config?.isProd||console.error("Event reporting failed:",n);return}}traceStep(e){const r=this.startStepSpan(e);if(r)return new j$e(r)}async forceFlush(){return this.tracerProvider?.forceFlush()}async shutdown(){return this.tracerProvider?.shutdown()}}class X$e extends W$e{tracer=null;initialized=!1;constructor(){super()}initTracer(e){if(!e.collectorUrl&&!e.collectorTraceUrl)return;const r=`ses_${F$()}`,n=OF({[v$e]:e.serviceName,[b$e]:e.serviceVersion,session_id:r}),i=e.collectorTraceUrl||`${e.collectorUrl}/v1/traces`;this.tracerProvider=new wCe({resource:n,spanProcessors:[new pCe(new O$e({url:i,headers:{}}))]}),this.tracer=this.tracerProvider.getTracer(e.tracerName),this.tracerProvider.register(),T$e({instrumentations:e.instrumentations??[]}),this.initialized=!0}}class zl extends R$e{sendErrorEvent;originalConsoleError;constructor(e,r){super("errors","1.0",e||{}),this.sendErrorEvent=r}static toErrorEvent(e,r){return{type:"error",payload:[{handler:r,errorType:zl.getErrorType(e),message:zl.getErrorMessage(e),stack:zl.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=zl.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(zl.toErrorEvent(e,r))}}class F$e{config=null;initialized=!1;useCloudEventData;otelClient;tracer;constructor(){this.useCloudEventData=()=>({origin:"replayUi"}),this.otelClient=new X$e,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 i=e&&typeof e=="object"&&"type"in e&&"data"in e?e:this.constructCloudEvent(e,r);this.sendToOtelService(i)}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 zl(void 0,r=>{this.sendToOtelService({type:r.type,data: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){return V1e({type:e,data:r,...this.useCloudEventData()})}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){if(this.config?.disabled)return;const n=zl.toErrorEvent(e,r);this.sendToOtelService({type:n.type,data:n.payload})}sendTabChangeMessage(e){this.send("tab.change",e)}sendButtonClickMessage(e){this.send("button.click",e)}sendTabOpenFailedMessage(e){this.send("tab.open_failed",e)}sendChangeMessage(e){this.send("change",e)}sendContentCopyMessage(e){this.send("content.copy",e)}sendRequestSendMessage(e){this.send("request.send",e)}sendTokenGenerateMessage(e){this.send("token.generate",e)}sendAppLifecycleMessage(e){this.send("app.lifecycle",e)}sendEnvironmentManagementMessage(e){this.send("environment.management",e)}sendServerManagementMessage(e){this.send("server.management",e)}sendSourceManagementMessage(e){this.send("source.management",e)}sendInputManagementMessage(e){this.send("input.management",e)}sendNodeManagementMessage(e){this.send("node.management",e)}sendHistoryManagementMessage(e){this.send("history.management",e)}sendHistoryMigrationMessage(e){this.send("history.migration",e)}sendCredentialManagementMessage(e){this.send("credential.management",e)}sendPanelToggleMessage(e){this.send("panel.toggle",e)}sendWorkflowRunClickMessage(e){this.send("workflow.run.click",e)}sendWorkflowRunResultMessage(e){this.send("workflow.run.result",e)}sendStorageReadMessage(){this.send("storage.read")}sendStorageLoadUserStateMessage(){this.send("storage.loadUserState")}sendStorageDetectFilesMessage(){this.send("storage.detectFiles")}sendStorageLoadApisMessage(){this.send("storage.loadApis")}sendStorageParseApisMessage(){this.send("storage.parseApis")}sendStorageParseCollectionsMessage(){this.send("storage.parseCollections")}sendUpdaterCheckMessage(){this.send("updater.check")}sendUpdaterDownloadMessage(){this.send("updater.download")}sendUpdaterInstallMessage(){this.send("updater.install")}sendUpdaterProcessMessage(){this.send("updater.process")}sendErrorMessage(e){this.send("error",e)}sendCodeEditorSearchMessage(e){this.send("code_editor.search",e)}}const OS=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],Z$e="https://cors.redocly.com/";function Y$e(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function G5(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 H5(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?G5(Object(r),!0).forEach(function(n){Y$e(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):G5(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Tn(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 J5=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),aP=function(){return Math.random().toString(36).substring(7).split("").join(".")},ec={INIT:"@@redux/INIT"+aP(),REPLACE:"@@redux/REPLACE"+aP(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+aP()}};function jF(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 G$e(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(K$e(t))return"date";if(J$e(t))return"error";var r=H$e(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 H$e(t){return typeof t.constructor=="function"?t.constructor.name:null}function J$e(t){return t instanceof Error||typeof t.message=="string"&&t.constructor&&typeof t.constructor.stackTraceLimit=="number"}function K$e(t){return t instanceof Date?!0:typeof t.toDateString=="function"&&typeof t.getDate=="function"&&typeof t.setDate=="function"}function _l(t){var e=typeof t;return process.env.NODE_ENV!=="production"&&(e=G$e(t)),e}function vS(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"?Tn(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"?Tn(1):"Expected the enhancer to be a function. Instead, received: '"+_l(r)+"'");return r(vS)(t,e)}if(typeof t!="function")throw new Error(process.env.NODE_ENV==="production"?Tn(2):"Expected the root reducer to be a function. Instead, received: '"+_l(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"?Tn(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"?Tn(4):"Expected the listener to be a function. Instead, received: '"+_l(m)+"'");if(l)throw new Error(process.env.NODE_ENV==="production"?Tn(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 y=!0;return c(),a.push(m),function(){if(y){if(l)throw new Error(process.env.NODE_ENV==="production"?Tn(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.");y=!1,c();var v=a.indexOf(m);a.splice(v,1),s=null}}}function p(m){if(!jF(m))throw new Error(process.env.NODE_ENV==="production"?Tn(7):"Actions must be plain objects. Instead, the actual type was: '"+_l(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"?Tn(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"?Tn(9):"Reducers may not dispatch actions.");try{l=!0,o=i(o,m)}finally{l=!1}for(var y=s=a,O=0;O<y.length;O++){var v=y[O];v()}return m}function h(m){if(typeof m!="function")throw new Error(process.env.NODE_ENV==="production"?Tn(10):"Expected the nextReducer to be a function. Instead, received: '"+_l(m));i=m,p({type:ec.REPLACE})}function g(){var m,y=d;return m={subscribe:function(v){if(typeof v!="object"||v===null)throw new Error(process.env.NODE_ENV==="production"?Tn(11):"Expected the observer to be an object. Instead, received: '"+_l(v)+"'");function b(){v.next&&v.next(u())}b();var S=y(b);return{unsubscribe:S}}},m[J5]=function(){return this},m}return p({type:ec.INIT}),n={dispatch:p,subscribe:d,getState:u,replaceReducer:h},n[J5]=g,n}var eke=vS;function tk(t){typeof console<"u"&&typeof console.error=="function"&&console.error(t);try{throw new Error(t)}catch{}}function tke(t,e,r,n){var i=Object.keys(e),o=r&&r.type===ec.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(!jF(t))return"The "+o+' has unexpected type of "'+_l(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===ec.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 rke(t){Object.keys(t).forEach(function(e){var r=t[e],n=r(void 0,{type:ec.INIT});if(typeof n>"u")throw new Error(process.env.NODE_ENV==="production"?Tn(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:ec.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?Tn(13):'The slice reducer for key "'+e+'" returned undefined when probed with a random type. '+("Don't try to handle '"+ec.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 nke(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"&&tk('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{rke(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=tke(c,r,u,s);d&&tk(d)}for(var p=!1,h={},g=0;g<o.length;g++){var m=o[g],y=r[m],O=c[m],v=y(O,u);if(typeof v>"u"){var b=u&&u.type;throw new Error(process.env.NODE_ENV==="production"?Tn(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]=v,p=p||v!==O}return p=p||o.length!==Object.keys(c).length,p?h:c}}function K5(t,e){return function(){return e(t.apply(this,arguments))}}function ike(t,e){if(typeof t=="function")return K5(t,e);if(typeof t!="object"||t===null)throw new Error(process.env.NODE_ENV==="production"?Tn(16):"bindActionCreators expected an object or a function, but instead received: '"+_l(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]=K5(i,e))}return r}function _F(){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 oke(){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"?Tn(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=_F.apply(void 0,a)(i.dispatch),H5(H5({},i),{},{dispatch:o})}}}function eN(){}process.env.NODE_ENV!=="production"&&typeof eN.name=="string"&&eN.name!=="isCrushed"&&tk('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 ske=Object.freeze({__proto__:null,__DO_NOT_USE__ActionTypes:ec,applyMiddleware:oke,bindActionCreators:ike,combineReducers:nke,compose:_F,createStore:vS,legacy_createStore:eke});function ake(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 lke=ake(ske);lke.compose;var cke=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(t){return t}};function uke(t,e,r){var n=!1,i=!1,o=vS(function(a,l){if(!i){var c=function(y){return Array.isArray(y)&&y.findIndex(function(O){return typeof O!="string"&&typeof O!="number"})===-1};if(l.type.startsWith("SET")){var u=function(y){try{n=!0,"value"in l?y.set(l.value):y.set(Ot)}finally{n=!1}};if(l.path){if(c(l.path)){l.path.length===0&&u(t);for(var d=t,p=!0,h=0,g=l.path;h<g.length;h++){var m=g[h];d[m]?d=d[m]:p=!1}p&&u(d)}}else u(t)}else l.type==="BREAKPOINT"&&r()}return t.promised||t.error?Ot:t.get({noproxy:!0})},cke({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 dke(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=uke(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 qt=(t=>(t.Normal="Normal",t.Edit="Edit",t.Draft="Draft",t))(qt||{});const mg="default",QF=[{name:mg,inputs:[],servers:[],state:qt.Normal}],rk={activeTabIdx:0,tabs:[]};var Ns=(t=>(t.Idle="idle",t.Loading="loading",t.Success="success",t.Error="error",t))(Ns||{});function ra(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 nk(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(!nk(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)||!nk(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function tN(t){return Object.keys(t).forEach(e=>{t[e]===void 0&&delete t[e]}),t}function fke(t,e=!1){return window.__TAURI_INTERNALS__.transformCallback(t,e)}async function Cr(t,e={},r){return window.__TAURI_INTERNALS__.invoke(t,e,r)}function hn(){return!!window?.__TAURI__}async function rN(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 Ln={FS:"fs",WEB:"web"};var wf;(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"})(wf||(wf={}));async function DF(){return Cr("plugin:path|resolve_directory",{directory:wf.AppData})}async function NF(){return Cr("plugin:path|resolve_directory",{directory:wf.Desktop})}function eI(){return window.__TAURI_INTERNALS__.plugins.path.sep}async function MF(...t){return Cr("plugin:path|resolve",{paths:t})}async function Jd(...t){return Cr("plugin:path|join",{paths:t})}async function LF(t){return Cr("plugin:path|dirname",{path:t})}async function qF(t){return Cr("plugin:path|extname",{path:t})}async function tI(t,e){return Cr("plugin:path|basename",{path:t,ext:e})}async function zF(t){return Cr("plugin:path|is_absolute",{path:t})}const VF=Object.freeze(Object.defineProperty({__proto__:null,get BaseDirectory(){return wf},appDataDir:DF,basename:tI,desktopDir:NF,dirname:LF,extname:qF,isAbsolute:zF,join:Jd,resolve:MF,sep:eI},Symbol.toStringTag,{value:"Module"}));var ik;(function(t){t[t.Start=0]="Start",t[t.Current=1]="Current",t[t.End=2]="End"})(ik||(ik={}));async function ok(t,e){if(t instanceof URL&&t.protocol!=="file:")throw new TypeError("Must be a file URL.");await Cr("plugin:fs|mkdir",{path:t instanceof URL?t.toString():t,options:e})}async function rI(t,e){if(t instanceof URL&&t.protocol!=="file:")throw new TypeError("Must be a file URL.");return await Cr("plugin:fs|read_dir",{path:t instanceof URL?t.toString():t,options:e})}async function UF(t,e){if(t instanceof URL&&t.protocol!=="file:")throw new TypeError("Must be a file URL.");const r=await Cr("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 bS(t,e){if(t instanceof URL&&t.protocol!=="file:")throw new TypeError("Must be a file URL.");return await Cr("plugin:fs|read_text_file",{path:t instanceof URL?t.toString():t,options:e})}async function BF(t,e){if(t instanceof URL&&t.protocol!=="file:")throw new TypeError("Must be a file URL.");await Cr("plugin:fs|remove",{path:t instanceof URL?t.toString():t,options:e})}async function WF(t,e,r){if(t instanceof URL&&t.protocol!=="file:"||e instanceof URL&&e.protocol!=="file:")throw new TypeError("Must be a file URL.");await Cr("plugin:fs|rename",{oldPath:t instanceof URL?t.toString():t,newPath:e instanceof URL?e.toString():e,options:r})}async function pke(t,e,r){if(t instanceof URL&&t.protocol!=="file:")throw new TypeError("Must be a file URL.");await Cr("plugin:fs|write_file",e,{headers:{path:t instanceof URL?t.toString():t,options:JSON.stringify(r)}})}async function XF(t,e,r){if(t instanceof URL&&t.protocol!=="file:")throw new TypeError("Must be a file URL.");await Cr("plugin:fs|write_text_file",{path:t instanceof URL?t.toString():t,data:e,options:r})}async function xS(t,e){if(t instanceof URL&&t.protocol!=="file:")throw new TypeError("Must be a file URL.");return await Cr("plugin:fs|exists",{path:t instanceof URL?t.toString():t,options:e})}const SS=Object.freeze(Object.defineProperty({__proto__:null,get BaseDirectory(){return wf},get SeekMode(){return ik},exists:xS,mkdir:ok,readDir:rI,readFile:UF,readTextFile:bS,remove:BF,rename:WF,writeFile:pke,writeTextFile:XF},Symbol.toStringTag,{value:"Module"}));class Wt{static utils=null;static async getUtils(){return Wt.utils||(Wt.utils=hn()?await Promise.resolve().then(()=>require("./replay-tauri-path-CaUuUwbr.js")):await Promise.resolve().then(()=>mne)),Wt.utils}static async dirname(e){return(await Wt.getUtils()).dirname(e)}static async join(...e){return(await Wt.getUtils()).join(...e)}static async resolve(e){return(await Wt.getUtils()).resolve(e)}static async isAbsolute(e){return(await Wt.getUtils()).isAbsolute(e)}static async relative(e,r){return(await Wt.getUtils()).relative(e,r)}static async extname(e){return(await Wt.getUtils()).extname(e)}}const hke=new Set(["node_modules"]);class sk{constructor(e){this.baseDir=e,this.initializeDirectory(e)}writeExcludedKeys=new Set;listeners=new Map;writeEndTimers=new Map;on(e,r){this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e)?.add(r)}off(e,r){this.listeners.get(e)?.delete(r)}emit(e,r){this.listeners.get(e)?.forEach(n=>n(r))}async initializeDirectory(e){await ok(e,{recursive:!0})}setWriteExcludedKeys(e){this.writeExcludedKeys=e}async ls(e){const r=await this.getFullPath(e);return this.getDirEntryFilesRecursively(r)}async getDirEntryFilesRecursively(e){try{const r=[],n=await rI(e);for(const i of n)if(i.isDirectory){if(hke.has(i.name))continue;const o=await Jd(e,i.name),s=await this.getDirEntryFilesRecursively(o);r.push(...s)}else{const o=await Jd(e,i.name),s=await Wt.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 bS(r)}catch(n){return!n.includes("No such file or directory")&&!n.includes("forbidden path")&&console.error(n),null}}async has(e){const r=await this.getFullPath(e);return await xS(r)}async set(e,r){if(!this.writeExcludedKeys.has(e)){this.emit("write-start",e);try{const n=await this.getFullPath(e),i=eI(),o=n.split(i).slice(0,-1).join(i);await ok(o,{recursive:!0}),await XF(n,r)}finally{const n=this.writeEndTimers.get(e);n&&clearTimeout(n);const i=setTimeout(()=>{this.emit("write-end",e),this.writeEndTimers.delete(e)},1e3);this.writeEndTimers.set(e,i)}}}async remove(e){if(!this.writeExcludedKeys.has(e)){this.emit("write-start",e);try{const r=await this.getFullPath(e);await BF(r)}catch(r){!r.includes("No such file or directory")&&!r.includes("forbidden path")&&console.error(r)}finally{const r=this.writeEndTimers.get(e);r&&clearTimeout(r);const n=setTimeout(()=>{this.emit("write-end",e),this.writeEndTimers.delete(e)},1e3);this.writeEndTimers.set(e,n)}}}async rename(e,r){const n=await this.getFullPath(e),i=await this.getFullPath(r);await WF(n,i)}async getFullPath(e){return await Jd(this.baseDir,e??"")}}class mke{baseDir="";async ls(e=""){return[]}async get(e){return null}async has(e){return!1}async set(e,r){}async remove(e){}async rename(e,r){}setWriteExcludedKeys(e){}on(e,r){}off(e,r){}}class gke{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 FF{constructor(e){this.storage=e}itemIds=[];async getAbsolutePath(e){return await Wt.resolve(await Wt.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===qt.Draft||e.srcType!==Ln.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 yke extends FF{parse(e){return{...e.content,id:e.uri,srcType:e.type,fileDependencies:e.fileDependencies}}async stringify(e){const{id:r,srcType:n,fileDependencies:i,...o}=e;return await Wt.extname(r)===".json"?JSON.stringify(o,null,2):tl.dump(o)}async write(e){await this.storage.has(e.id)||await super.write(e)}}var Yn=(t=>(t.SIMPLE="simple",t.REGEX="regex",t.JSONPATH="jsonpath",t.XPATH="xpath",t))(Yn||{});const Oke=`
|
|
286
286
|
`;function vke(t,e){let r="";return e.format&&e.indentBy.length>0&&(r=Oke),ZF(t,e,"",r)}function ZF(t,e,r,n){let i="",o=!1;if(!Array.isArray(t)){if(t!=null){let s=t.toString();return s=ak(s,e),s}return""}for(let s=0;s<t.length;s++){const a=t[s],l=bke(a);if(l===void 0)continue;let c="";if(r.length===0?c=l:c=`${r}.${l}`,l===e.textNodeName){let g=a[l];xke(c,e)||(g=e.tagValueProcessor(l,g),g=ak(g,e)),o&&(i+=n),i+=g,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 g=nN(a[":@"],e),m=l==="?xml"?"":n;let y=a[l][0][e.textNodeName];y=y.length!==0?" "+y:"",i+=m+`<${l}${y}${g}?>`,o=!0;continue}let u=n;u!==""&&(u+=e.indentBy);const d=nN(a[":@"],e),p=n+`<${l}${d}`,h=ZF(a[l],e,c,u);e.unpairedTags.indexOf(l)!==-1?e.suppressUnpairedNode?i+=p+">":i+=p+"/>":(!h||h.length===0)&&e.suppressEmptyNode?i+=p+"/>":h&&h.endsWith(">")?i+=p+`>${h}${n}</${l}>`:(i+=p+">",h&&n!==""&&(h.includes("/>")||h.includes("</"))?i+=n+e.indentBy+h+n:i+=h,i+=`</${l}>`),o=!0}return i}function bke(t){const e=Object.keys(t);for(let r=0;r<e.length;r++){const n=e[r];if(Object.prototype.hasOwnProperty.call(t,n)&&n!==":@")return n}}function nN(t,e){let r="";if(t&&!e.ignoreAttributes)for(let n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;let i=e.attributeValueProcessor(n,t[n]);i=ak(i,e),i===!0&&e.suppressBooleanAttributes?r+=` ${n.substr(e.attributeNamePrefix.length)}`:r+=` ${n.substr(e.attributeNamePrefix.length)}="${i}"`}return r}function xke(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 ak(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}function Ske(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 wke={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 vc(t){this.options=Object.assign({},wke,t),this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=Ske(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=$ke),this.processTextOrObjNode=Pke,this.options.format?(this.indentate=Cke,this.tagEndChar=`>
|
|
287
287
|
`,this.newLine=`
|
|
288
288
|
`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}vc.prototype.build=function(t){return this.options.preserveOrder?vke(t,this.options):(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t={[this.options.arrayNodeName]:t}),this.j2x(t,0,[]).val)};vc.prototype.j2x=function(t,e,r){let n="",i="";const o=r.join(".");for(let s in t)if(Object.prototype.hasOwnProperty.call(t,s))if(typeof t[s]>"u")this.isAttribute(s)&&(i+="");else if(t[s]===null)this.isAttribute(s)||s===this.options.cdataPropName?i+="":s[0]==="?"?i+=this.indentate(e)+"<"+s+"?"+this.tagEndChar:i+=this.indentate(e)+"<"+s+"/"+this.tagEndChar;else if(t[s]instanceof Date)i+=this.buildTextValNode(t[s],s,"",e);else if(typeof t[s]!="object"){const a=this.isAttribute(s);if(a&&!this.ignoreAttributesFn(a,o))n+=this.buildAttrPairStr(a,""+t[s]);else if(!a)if(s===this.options.textNodeName){let l=this.options.tagValueProcessor(s,""+t[s]);i+=this.replaceEntitiesValue(l)}else i+=this.buildTextValNode(t[s],s,"",e)}else if(Array.isArray(t[s])){const a=t[s].length;let l="",c="";for(let u=0;u<a;u++){const d=t[s][u];if(!(typeof d>"u"))if(d===null)s[0]==="?"?i+=this.indentate(e)+"<"+s+"?"+this.tagEndChar:i+=this.indentate(e)+"<"+s+"/"+this.tagEndChar;else if(typeof d=="object")if(this.options.oneListGroup){const p=this.j2x(d,e+1,r.concat(s));l+=p.val,this.options.attributesGroupName&&d.hasOwnProperty(this.options.attributesGroupName)&&(c+=p.attrStr)}else l+=this.processTextOrObjNode(d,s,e,r);else if(this.options.oneListGroup){let p=this.options.tagValueProcessor(s,d);p=this.replaceEntitiesValue(p),l+=p}else l+=this.buildTextValNode(d,s,"",e)}this.options.oneListGroup&&(l=this.buildObjectNode(l,s,c,e)),i+=l}else if(this.options.attributesGroupName&&s===this.options.attributesGroupName){const a=Object.keys(t[s]),l=a.length;for(let c=0;c<l;c++)n+=this.buildAttrPairStr(a[c],""+t[s][a[c]])}else i+=this.processTextOrObjNode(t[s],s,e,r);return{attrStr:n,val:i}};vc.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 Pke(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)}vc.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}};vc.prototype.closeTag=function(t){let e="";return this.options.unpairedTags.indexOf(t)!==-1?this.options.suppressUnpairedNode||(e="/"):this.options.suppressEmptyNode?e="/":e=`></${t}`,e};vc.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}};vc.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 Cke(t){return this.options.indentBy.repeat(t)}function $ke(t){return t.startsWith(this.options.attributeNamePrefix)&&t!==this.options.textNodeName?t.substr(this.attrPrefixLen):!1}const YF=1024;let kke=0,$o=class{constructor(e,r){this.from=e,this.to=r}};class St{constructor(e={}){this.id=kke++,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=ei.match(e)),r=>{let n=e(r);return n===void 0?null:[this,n]}}}St.closedBy=new St({deserialize:t=>t.split(" ")});St.openedBy=new St({deserialize:t=>t.split(" ")});St.group=new St({deserialize:t=>t.split(" ")});St.isolate=new St({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});St.contextHash=new St({perNode:!0});St.lookAhead=new St({perNode:!0});St.mounted=new St({perNode:!0});class vm{constructor(e,r,n){this.tree=e,this.overlay=r,this.parser=n}static get(e){return e&&e.props&&e.props[St.mounted.id]}}const Tke=Object.create(null);class ei{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):Tke,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new ei(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(St.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(St.group),o=-1;o<(i?i.length:0);o++){let s=r[o<0?n.name:i[o]];if(s)return s}}}}ei.none=new ei("",Object.create(null),0,8);class wS{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 ei(n.name,i,n.id,n.flags):n)}return new wS(r)}}const uO=new WeakMap,iN=new WeakMap;var Or;(function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays"})(Or||(Or={}));let br=class lk{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=vm.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 i0(this.topNode,e)}cursorAt(e,r=0,n=0){let i=uO.get(this)||this.topNode,o=new i0(i);return o.moveTo(e,r),uO.set(this,o._tree),o}get topNode(){return new jo(this,0,0,null)}resolve(e,r=0){let n=bm(uO.get(this)||this.topNode,e,r,!1);return uO.set(this,n),n}resolveInner(e,r=0){let n=bm(iN.get(this)||this.topNode,e,r,!0);return iN.set(this,n),n}resolveStack(e,r=0){return Ike(this,e,r)}iterate(e){let{enter:r,leave:n,from:i=0,to:o=this.length}=e,s=e.mode||0,a=(s&Or.IncludeAnonymous)>0;for(let l=this.cursor(s|Or.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:oI(ei.none,this.children,this.positions,0,this.children.length,0,this.length,(r,n,i)=>new lk(this.type,r,n,i,this.propValues),e.makeTree||((r,n,i)=>new lk(ei.none,r,n,i)))}static build(e){return Rke(e)}};br.empty=new br(ei.none,[],[],0);class nI{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 nI(this.buffer,this.index)}}class lc{constructor(e,r,n){this.buffer=e,this.length=r,this.set=n}get type(){return ei.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&&!(GF(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 lc(o,s,this.set)}}function GF(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 bm(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 jo&&t.index<0?null:t.parent;if(!s)return t;t=s}let o=n?0:Or.IgnoreOverlays;if(n)for(let s=t,a=s.parent;a;s=a,a=s.parent)s instanceof jo&&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 HF{cursor(e=0){return new i0(this,e)}getChild(e,r=null,n=null){let i=oN(this,e,r,n);return i.length?i[0]:null}getChildren(e,r=null,n=null){return oN(this,e,r,n)}resolve(e,r=0){return bm(this,e,r,!1)}resolveInner(e,r=0){return bm(this,e,r,!0)}matchContext(e){return ck(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 jo=class vv extends HF{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(GF(i,n,d,d+u.length)){if(u instanceof lc){if(o&Or.ExcludeBuffers)continue;let p=u.findChild(0,u.buffer.length,r,n-d,i);if(p>-1)return new Fs(new Eke(s,u,e,d),null,p)}else if(o&Or.IncludeAnonymous||!u.type.isAnonymous||iI(u)){let p;if(!(o&Or.IgnoreMounts)&&(p=vm.get(u))&&!p.overlay)return new vv(p.tree,d,e,s);let h=new vv(u,d,e,s);return o&Or.IncludeAnonymous||!h.type.isAnonymous?h:h.nextChild(r<0?u.children.length-1:0,r,n,i)}}}if(o&Or.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&Or.IgnoreOverlays)&&(i=vm.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 vv(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 oN(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 ck(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 Eke{constructor(e,r,n,i){this.parent=e,this.buffer=r,this.index=n,this.start=i}}class Fs extends HF{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 Fs(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&Or.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 Fs(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 Fs(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 Fs(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 br(this.type,e,r,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function JF(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 jo&&r.index<0?null:r.parent,i=t.slice();return n?i[e]=n:i.splice(e,1),new Ake(i,r)}class Ake{constructor(e,r){this.heads=e,this.node=r}get next(){return JF(this.heads)}}function Ike(t,e,r){let n=t.resolveInner(e,r),i=null;for(let o=n instanceof jo?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=vm.get(o.tree);if(s&&s.overlay&&s.overlay[0].from<=e&&s.overlay[s.overlay.length-1].to>=e){let a=new jo(s.tree,s.overlay[0].from+o.from,-1,o);(i||(i=[n])).push(bm(a,e,r,!1))}}return i?JF(i):n}class i0{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 jo)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 jo?(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&Or.ExcludeBuffers?!1:this.enterChild(1,e,r):this.yield(this._tree.enter(e,r,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Or.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Or.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&Or.IncludeAnonymous||a instanceof lc||!a.type.isAnonymous||iI(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 Fs(this.buffer,r,this.stack[i]);return this.bufferNode=new Fs(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 ck(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 ck(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 iI(t){return t.children.some(e=>e instanceof lc||!e.type.isAnonymous||iI(e))}function Rke(t){var e;let{buffer:r,nodeSet:n,maxBufferLength:i=YF,reused:o=[],minRepeatType:s=n.types.length}=t,a=Array.isArray(r)?new nI(r,r.length):r,l=n.types,c=0,u=0;function d(x,$,C,T,I,Q){let{id:_,start:M,end:L,size:V}=a,B=u,Z=c;for(;V<0;)if(a.next(),V==-1){let U=o[_];C.push(U),T.push(M-x);return}else if(V==-3){c=_;return}else if(V==-4){u=_;return}else throw new RangeError(`Unrecognized record size: ${V}`);let te=l[_],X,ie,q=M-x;if(L-M<=i&&(ie=y(a.pos-$,I))){let U=new Uint16Array(ie.size-ie.skip),H=a.pos-ie.size,F=U.length;for(;a.pos>H;)F=O(ie.start,U,F);X=new lc(U,L-ie.start,n),q=ie.start-x}else{let U=a.pos-V;a.next();let H=[],F=[],R=_>=s?_:-1,N=0,oe=L;for(;a.pos>U;)R>=0&&a.id==R&&a.size>=0?(a.end<=oe-i&&(g(H,F,M,N,a.end,oe,R,B,Z),N=H.length,oe=a.end),a.next()):Q>2500?p(M,U,H,F):d(M,U,H,F,R,Q+1);if(R>=0&&N>0&&N<H.length&&g(H,F,M,N,M,oe,R,B,Z),H.reverse(),F.reverse(),R>-1&&N>0){let ne=h(te,Z);X=oI(te,H,F,0,H.length,0,L-M,ne,ne)}else X=m(te,H,F,L-M,B-L,Z)}C.push(X),T.push(q)}function p(x,$,C,T){let I=[],Q=0,_=-1;for(;a.pos>$;){let{id:M,start:L,end:V,size:B}=a;if(B>4)a.next();else{if(_>-1&&L<_)break;_<0&&(_=V-i),I.push(M,L,V),Q++,a.next()}}if(Q){let M=new Uint16Array(Q*4),L=I[I.length-2];for(let V=I.length-3,B=0;V>=0;V-=3)M[B++]=I[V],M[B++]=I[V+1]-L,M[B++]=I[V+2]-L,M[B++]=B;C.push(new lc(M,I[2]-L,n)),T.push(L-x)}}function h(x,$){return(C,T,I)=>{let Q=0,_=C.length-1,M,L;if(_>=0&&(M=C[_])instanceof br){if(!_&&M.type==x&&M.length==I)return M;(L=M.prop(St.lookAhead))&&(Q=T[_]+M.length+L)}return m(x,C,T,I,Q,$)}}function g(x,$,C,T,I,Q,_,M,L){let V=[],B=[];for(;x.length>T;)V.push(x.pop()),B.push($.pop()+C-I);x.push(m(n.types[_],V,B,Q-I,M-Q,L)),$.push(I-C)}function m(x,$,C,T,I,Q,_){if(Q){let M=[St.contextHash,Q];_=_?[M].concat(_):[M]}if(I>25){let M=[St.lookAhead,I];_=_?[M].concat(_):[M]}return new br(x,$,C,T,_)}function y(x,$){let C=a.fork(),T=0,I=0,Q=0,_=C.end-i,M={size:0,start:0,skip:0};e:for(let L=C.pos-x;C.pos>L;){let V=C.size;if(C.id==$&&V>=0){M.size=T,M.start=I,M.skip=Q,Q+=4,T+=4,C.next();continue}let B=C.pos-V;if(V<0||B<L||C.start<_)break;let Z=C.id>=s?4:0,te=C.start;for(C.next();C.pos>B;){if(C.size<0)if(C.size==-3)Z+=4;else break e;else C.id>=s&&(Z+=4);C.next()}I=te,T+=V,Q+=Z}return($<0||T==x)&&(M.size=T,M.start=I,M.skip=Q),M.size>4?M:void 0}function O(x,$,C){let{id:T,start:I,end:Q,size:_}=a;if(a.next(),_>=0&&T<s){let M=C;if(_>4){let L=a.pos-(_-4);for(;a.pos>L;)C=O(x,$,C)}$[--C]=M,$[--C]=Q-x,$[--C]=I-x,$[--C]=T}else _==-3?c=T:_==-4&&(u=T);return C}let v=[],b=[];for(;a.pos>0;)d(t.start||0,t.bufferStart||0,v,b,-1,0);let S=(e=t.length)!==null&&e!==void 0?e:v.length?b[0]+v[0].length:0;return new br(l[t.topID],v.reverse(),b.reverse(),S)}const sN=new WeakMap;function bv(t,e){if(!t.isAnonymous||e instanceof lc||e.type!=t)return 1;let r=sN.get(e);if(r==null){r=1;for(let n of e.children){if(n.type!=t||!(n instanceof br)){r=1;break}r+=bv(t,n)}sN.set(e,r)}return r}function oI(t,e,r,n,i,o,s,a,l){let c=0;for(let g=n;g<i;g++)c+=bv(t,e[g]);let u=Math.ceil(c*1.5/8),d=[],p=[];function h(g,m,y,O,v){for(let b=y;b<O;){let S=b,x=m[b],$=bv(t,g[b]);for(b++;b<O;b++){let C=bv(t,g[b]);if($+C>=u)break;$+=C}if(b==S+1){if($>u){let C=g[S];h(C.children,C.positions,0,C.children.length,m[S]+v);continue}d.push(g[S])}else{let C=m[b-1]+g[b-1].length-x;d.push(oI(t,g,m,S,b,x,C,null,l))}p.push(x+v-o)}}return h(e,r,n,i,0),(a||l)(d,p,s)}class sI{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 Fs?this.setBuffer(e.context.buffer,e.index,r):e instanceof jo&&this.map.set(e.tree,r)}get(e){return e instanceof Fs?this.getBuffer(e.context.buffer,e.index):e instanceof jo?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 Ya{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 Ya(0,e.length,e,0,!1,n)];for(let o of r)o.to>e.length&&i.push(o);return i}static applyChanges(e,r,n=128){if(!r.length)return e;let i=[],o=1,s=e.length?e[0]:null;for(let a=0,l=0,c=0;;a++){let u=a<r.length?r[a]:null,d=u?u.fromA:1e9;if(d-l>=n)for(;s&&s.from<d;){let p=s;if(l>=p.from||d<=p.to||c){let h=Math.max(p.from,l)-c,g=Math.min(p.to,d)-c;p=h>=g?null:new Ya(h,g,p.tree,p.offset+c,a>0,!!u)}if(p&&i.push(p),s.to>d)break;s=o<e.length?e[o++]:null}if(!u)break;l=u.toA,c=u.toA-u.toB}return i}}let aI=class{startParse(e,r,n){return typeof e=="string"&&(e=new jke(e)),n=n?n.length?n.map(i=>new $o(i.from,i.to)):[new $o(0,0)]:[new $o(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 jke{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 _ke(t){return(e,r,n,i)=>new Dke(e,t,r,n,i)}class aN{constructor(e,r,n,i,o){this.parser=e,this.parse=r,this.overlay=n,this.target=i,this.from=o}}function lN(t){if(!t.length||t.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(t))}class Qke{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 uk=new St({perNode:!0});class Dke{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 br(n.type,n.children,n.positions,n.length,n.propValues.concat([[uk,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[St.mounted.id]=new vm(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 Lke(this.fragments),r=null,n=null,i=new i0(new jo(this.baseTree,this.ranges[0].from,0,null),Or.IncludeAnonymous|Or.IgnoreMounts);e:for(let o,s;;){let a=!0,l;if(this.stoppedAt!=null&&i.from>=this.stoppedAt)a=!1;else if(e.hasNode(i)){if(r){let c=r.mounts.find(u=>u.frag.from<=i.from&&u.frag.to>=i.to&&u.mount.overlay);if(c)for(let u of c.mount.overlay){let d=u.from+c.pos,p=u.to+c.pos;d>=i.from&&p<=i.to&&!r.ranges.some(h=>h.from<p&&h.to>d)&&r.ranges.push({from:d,to:p})}}a=!1}else if(n&&(s=Nke(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||Mke(i);let c=e.findMounts(i.from,o.parser);if(typeof o.overlay=="function")r=new Qke(o.parser,o.overlay,c,this.inner.length,i.from,i.tree,r);else{let u=dN(this.ranges,o.overlay||(i.from<i.to?[new $o(i.from,i.to)]:[]));u.length&&lN(u),(u.length||!o.overlay)&&this.inner.push(new aN(o.parser,u.length?o.parser.startParse(this.input,fN(c,u),u):o.parser.startParse(""),o.overlay?o.overlay.map(d=>new $o(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 $o(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=dN(this.ranges,r.ranges);c.length&&(lN(c),this.inner.splice(r.index,0,new aN(r.parser,r.parser.startParse(this.input,fN(r.mounts,c),c),r.ranges.map(u=>new $o(u.from-r.start,u.to-r.start)),r.target,c[0].from))),r=r.prev}n&&!--n.depth&&(n=n.prev)}}}}function Nke(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 cN(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 Mke(t){let{node:e}=t,r=[],n=e.context.buffer;do r.push(t.index),t.parent();while(!t.tree);let i=t.tree,o=i.children.indexOf(n),s=i.children[o],a=s.buffer,l=[o];function c(u,d,p,h,g,m){let y=r[m],O=[],v=[];cN(s,u,y,O,v,h);let b=a[y+1],S=a[y+2];l.push(O.length);let x=m?c(y+4,a[y+3],s.set.types[a[y]],b,S-b,m-1):e.toTree();return O.push(x),v.push(b-h),cN(s,a[y+3],d,O,v,h),new br(p,O,v,g)}i.children[o]=c(0,a.length,ei.none,0,s.length,r.length-1);for(let u of l){let d=t.tree.children[u],p=t.tree.positions[u];t.yield(new jo(d,p+t.from,u,t._tree))}}class uN{constructor(e,r){this.offset=r,this.done=!1,this.cursor=e.cursor(Or.IncludeAnonymous|Or.IgnoreMounts)}moveTo(e){let{cursor:r}=this,n=e-this.offset;for(;!this.done&&r.from<n;)r.to>=e&&r.enter(n,1,Or.IgnoreOverlays|Or.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 br)r=r.children[0];else break}return!1}}let Lke=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(uk))!==null&&r!==void 0?r:n.to,this.inner=new uN(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(uk))!==null&&e!==void 0?e:r.to,this.inner=new uN(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(St.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 dN(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 $o(l.from,s),l.to>a&&r.splice(o+1,0,new $o(a,l.to))):l.to>a?r[o--]=new $o(a,l.to):r.splice(o--,1))}}return n}function qke(t,e,r,n){let i=0,o=0,s=!1,a=!1,l=-1e9,c=[];for(;;){let u=i==t.length?1e9:s?t[i].to:t[i].from,d=o==e.length?1e9:a?e[o].to:e[o].from;if(s!=a){let p=Math.max(l,r),h=Math.min(u,d,n);p<h&&c.push(new $o(p,h))}if(l=Math.min(u,d),l==1e9)break;u==l&&(s?(s=!1,i++):s=!0),d==l&&(a?(a=!1,o++):a=!0)}return c}function fN(t,e){let r=[];for(let{pos:n,mount:i,frag:o}of t){let s=n+(i.overlay?i.overlay[0].from:0),a=s+i.tree.length,l=Math.max(o.from,s),c=Math.min(o.to,a);if(i.overlay){let u=i.overlay.map(p=>new $o(p.from+n,p.to+n)),d=qke(e,u,l,c);for(let p=0,h=l;;p++){let g=p==d.length,m=g?c:d[p].from;if(m>h&&r.push(new Ya(h,m,i.tree,-s,o.from>=h||o.openStart,o.to<=m||o.openEnd)),g)break;h=d[p].to}}else r.push(new Ya(l,c,i.tree,-s,o.from>=s||o.openStart,o.to<=a||o.openEnd))}return r}class o0{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 o0(e,[],r,n,n,0,[],0,i?new pN(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,r){this.stack.push(this.state,r,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var r;let n=e>>19,i=e&65535,{parser:o}=this.p,s=this.reducePos<this.pos-25;s&&this.setLookAhead(this.pos);let a=o.dynamicPrecedence(i);if(a&&(this.score+=a),n==0){this.pushState(o.getGoto(this.state,i,!0),this.reducePos),i<o.minRepeatTerm&&this.storeNode(i,this.reducePos,this.reducePos,s?8:4,!0),this.reduceContext(i,this.reducePos);return}let l=this.stack.length-(n-1)*3-(e&262144?6:0),c=l?this.stack[l-2]:this.p.ranges[0].from,u=this.reducePos-c;u>=2e3&&!(!((r=this.p.parser.nodeSet.types[i])===null||r===void 0)&&r.isAnonymous)&&(c==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSize<u&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=c,this.p.lastBigReductionSize=u));let d=l?this.stack[l-1]:0,p=this.bufferBase+this.buffer.length-d;if(i<o.minRepeatTerm||e&131072){let h=o.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(i,c,h,p+4,!0)}if(e&262144)this.state=this.stack[l];else{let h=this.stack[l-3];this.state=o.getGoto(h,i,!0)}for(;this.stack.length>l;)this.stack.pop();this.reduceContext(i,c)}storeNode(e,r,n,i=4,o=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let s=this,a=this.buffer.length;if(a==0&&s.parent&&(a=s.bufferBase-s.parent.bufferBase,s=s.parent),a>0&&s.buffer[a-4]==0&&s.buffer[a-1]>-1){if(r==n)return;if(s.buffer[a-2]>=r){s.buffer[a-2]=n;return}}}if(!o||this.pos==n)this.buffer.push(e,r,n,i);else{let s=this.buffer.length;if(s>0&&this.buffer[s-4]!=0){let a=!1;for(let l=s;l>0&&this.buffer[l-2]>n;l-=4)if(this.buffer[l-1]>=0){a=!0;break}if(a)for(;s>0&&this.buffer[s-2]>n;)this.buffer[s]=this.buffer[s-4],this.buffer[s+1]=this.buffer[s-3],this.buffer[s+2]=this.buffer[s-2],this.buffer[s+3]=this.buffer[s-1],s-=4,i>4&&(i-=4)}this.buffer[s]=e,this.buffer[s+1]=r,this.buffer[s+2]=n,this.buffer[s+3]=i}}shift(e,r,n,i){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let o=e,{parser:s}=this.p;(i>this.pos||r<=s.maxNode)&&(this.pos=i,s.stateFlag(o,1)||(this.reducePos=i)),this.pushState(o,n),this.shiftContext(r,n),r<=s.maxNode&&this.buffer.push(r,n,i,4)}else this.pos=i,this.shiftContext(r,n),r<=this.p.parser.maxNode&&this.buffer.push(r,n,i,4)}apply(e,r,n,i){e&65536?this.reduce(e):this.shift(e,r,n,i)}useNode(e,r){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let i=this.pos;this.reducePos=this.pos=i+e.length,this.pushState(r,i),this.buffer.push(n,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,r=e.buffer.length;for(;r>0&&e.buffer[r-2]>e.reducePos;)r-=4;let n=e.buffer.slice(r),i=e.bufferBase+r;for(;e&&i==e.bufferBase;)e=e.parent;return new o0(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 zke(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 pN(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 pN{constructor(e,r){this.tracker=e,this.context=r,this.hash=e.strict?e.hash(r):0}}class zke{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 s0{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 s0(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 s0(this.stack,this.pos,this.index)}}function uh(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 xv{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const hN=new xv;class Vke{constructor(e,r){this.input=e,this.ranges=r,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=hN,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=hN,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 Kd{constructor(e,r){this.data=e,this.id=r}token(e,r){let{parser:n}=r.p;KF(this.data,e,r,this.id,n.data,n.tokenPrecTable)}}Kd.prototype.contextual=Kd.prototype.fallback=Kd.prototype.extend=!1;class a0{constructor(e,r,n){this.precTable=r,this.elseToken=n,this.data=typeof e=="string"?uh(e):e}token(e,r){let n=e.pos,i=0;for(;;){let o=e.next<0,s=e.resolveOffset(1,1);if(KF(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))}}a0.prototype.contextual=Kd.prototype.fallback=Kd.prototype.extend=!1;class Zr{constructor(e,r={}){this.token=e,this.contextual=!!r.contextual,this.fallback=!!r.fallback,this.extend=!!r.extend}}function KF(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 g=t[h];if(l.allows(g)&&(e.token.value==-1||e.token.value==g||Uke(g,e.token.value,i,o))){e.acceptToken(g);break}}let u=e.next,d=0,p=t[s+2];if(e.next<0&&p>d&&t[c+p*3-3]==65535){s=t[c+p*3-1];continue e}for(;d<p;){let h=d+p>>1,g=c+h+(h<<1),m=t[g],y=t[g+1]||65536;if(u<m)p=h;else if(u>=y)d=h+1;else{s=t[g+2],e.advance();continue e}}break}}function mN(t,e,r){for(let n=e,i;(i=t[n])!=65535;n++)if(i==r)return n-e;return-1}function Uke(t,e,r,n){let i=mN(r,n,e);return i<0||mN(r,n,t)<i}const Xi=typeof process<"u"&&process.env&&/\bparse\b/.test(process.env.LOG);let lP=null;function gN(t,e,r){let n=t.cursor(Or.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 Bke{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?gN(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?gN(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 br){if(s==e){if(s<this.safeFrom)return null;let a=s+o.length;if(a<=this.safeTo){let l=o.prop(St.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 Wke{constructor(e,r){this.stream=r,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(n=>new xv)}getActions(e){let r=0,n=null,{parser:i}=e.p,{tokenizers:o}=i,s=i.stateSlot(e.state,3),a=e.curContext?e.curContext.hash:0,l=0;for(let c=0;c<o.length;c++){if((1<<c&s)==0)continue;let u=o[c],d=this.tokens[c];if(!(n&&!u.fallback)&&((u.contextual||d.start!=e.pos||d.mask!=s||d.context!=a)&&(this.updateCachedToken(d,u,e),d.mask=s,d.context=a),d.lookAhead>d.end+25&&(l=Math.max(d.lookAhead,l)),d.value!=0)){let p=r;if(d.extended>-1&&(r=this.addActions(e,d.extended,d.end,r)),r=this.addActions(e,d.value,d.end,r),!u.extend&&(n=d,r>p))break}}for(;this.actions.length>r;)this.actions.pop();return l&&e.setLookAhead(l),!n&&e.pos==this.stream.end&&(n=new xv,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 xv,{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 Xke=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 Vke(r,i),this.tokens=new Wke(e,this.stream),this.topTerm=e.top[1];let{from:o}=i[0];this.stacks=[o0.start(this,e.top[0],o)],this.fragments=n.length&&this.stream.end-o>e.bufferLength*4?new Bke(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&&Zke(i);if(s)return Xi&&console.log("Finish with "+this.stackID(s)),this.stackToTree(s);if(this.parser.strict)throw Xi&&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 Xi&&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=Xi?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let c=e.curContext&&e.curContext.tracker.strict,u=c?e.curContext.hash:0;for(let d=this.fragments.nodeAt(i);d;){let p=this.parser.nodeSet.types[d.type.id]==d.type?o.getGoto(e.state,d.type.id):-1;if(p>-1&&d.length&&(!c||(d.prop(St.contextHash)||0)==u))return e.useNode(d,p),Xi&&console.log(s+this.stackID(e)+` (via reuse of ${o.getName(d.type.id)})`),!0;if(!(d instanceof br)||d.children.length==0||d.positions[0]>0)break;let h=d.children[0];if(h instanceof br&&d.positions[0]==0)d=h;else break}}let a=o.stateSlot(e.state,4);if(a>0)return e.reduce(a),Xi&&console.log(s+this.stackID(e)+` (via always-reduce ${o.getName(a&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let c=0;c<l.length;){let u=l[c++],d=l[c++],p=l[c++],h=c==l.length||!n,g=h?e:e.split(),m=this.tokens.mainToken;if(g.apply(u,d,m?m.start:g.pos,p),Xi&&console.log(s+this.stackID(g)+` (via ${(u&65536)==0?"shift":`reduce of ${o.getName(u&65535)}`} for ${o.getName(d)} @ ${i}${g==e?"":", split"})`),h)return!0;g.pos>i?r.push(g):n.push(g)}return!1}advanceFully(e,r){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return yN(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=Xi?this.stackID(a)+" -> ":"";if(a.deadEnd&&(o||(o=!0,a.restart(),Xi&&console.log(u+this.stackID(a)+" (restarted)"),this.advanceFully(a,n))))continue;let d=a.split(),p=u;for(let h=0;d.forceReduce()&&h<10&&(Xi&&console.log(p+this.stackID(d)+" (via force-reduce)"),!this.advanceFully(d,n));h++)Xi&&(p=this.stackID(d)+" -> ");for(let h of a.recoverByInsert(l))Xi&&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),Xi&&console.log(u+this.stackID(a)+` (via recover-delete ${this.parser.getName(l)})`),yN(a,n)):(!i||i.score<a.score)&&(i=a)}return i}stackToTree(e){return e.close(),br.build({buffer:s0.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=(lP||(lP=new WeakMap)).get(e);return r||lP.set(e,r=String.fromCodePoint(this.nextStackID++)),r+e}};function yN(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 Fke{constructor(e,r,n){this.source=e,this.flags=r,this.disabled=n}allows(e){return!this.disabled||this.disabled[e]==0}}const cP=t=>t;class gg{constructor(e){this.start=e.start,this.shift=e.shift||cP,this.reduce=e.reduce||cP,this.reuse=e.reuse||cP,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class os extends aI{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=St[l]);for(let c=1;c<a.length;){let u=a[c++];if(u>=0)o(u,l,a[c++]);else{let d=a[c+-u];for(let p=-u;p>0;p--)o(a[c++],l,d);c++}}}this.nodeSet=new wS(r.map((a,l)=>ei.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=YF;let s=uh(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(ON),this.states=uh(e.states,Uint32Array),this.data=uh(e.stateData),this.goto=uh(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(a=>typeof a=="number"?new Kd(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 Xke(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(os.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]=ON(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 Fke(e,n,i)}static deserialize(e){return new os(e)}}function Va(t,e){return t[e]|t[e+1]<<16}function Zke(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 ON(t){if(t.external){let e=t.extend?1:0;return(r,n)=>t.external(r,n)<<1|e}return t.get}let Yke=0,Ua=class dk{constructor(e,r,n,i){this.name=e,this.set=r,this.base=n,this.modified=i,this.id=Yke++}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 dk&&(r=e),r?.base)throw new Error("Can not derive from a modified tag");let i=new dk(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 l0(e);return n=>n.modified.indexOf(r)>-1?n:l0.get(n.base||n,n.modified.concat(r).sort((i,o)=>i.id-o.id))}},Gke=0;class l0{constructor(e){this.name=e,this.instances=[],this.id=Gke++}static get(e,r){if(!r.length)return e;let n=r[0].instances.find(a=>a.base==e&&Hke(r,a.modified));if(n)return n;let i=[],o=new Ua(e.name,i,e,r);for(let a of r)a.instances.push(o);let s=Jke(r);for(let a of e.set)if(!a.modified.length)for(let l of s)i.push(l0.get(a,l));return o}}function Hke(t,e){return t.length==e.length&&t.every((r,n)=>r==e[n])}function Jke(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 ul(t){let e=Object.create(null);for(let r in t){let n=t[r];Array.isArray(n)||(n=[n]);for(let i of r.split(" "))if(i){let o=[],s=2,a=i;for(let d=0;;){if(a=="..."&&d>0&&d+3==i.length){s=1;break}let p=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!p)throw new RangeError("Invalid path: "+i);if(o.push(p[0]=="*"?"":p[0][0]=='"'?JSON.parse(p[0]):p[0]),d+=p[0].length,d==i.length)break;let h=i[d++];if(d==i.length&&h=="!"){s=0;break}if(h!="/")throw new RangeError("Invalid path: "+i);a=i.slice(d)}let l=o.length-1,c=o[l];if(!c)throw new RangeError("Invalid path: "+i);let u=new c0(n,s,l>0?o.slice(0,l):null);e[c]=u.sort(e[c])}}return e6.add(e)}const e6=new St;class c0{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}}c0.empty=new c0([],2,null);function t6(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 Kke(t,e){let r=null;for(let n of t){let i=n.style(e);i&&(r=r?r+" "+i:i)}return r}function eTe(t,e,r,n=0,i=t.length){let o=new tTe(n,Array.isArray(e)?e:[e],r);o.highlightRange(t.cursor(),n,i,"",o.highlighters),o.flush(i)}class tTe{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=rTe(e)||c0.empty,d=Kke(o,u.tags);if(d&&(c&&(c+=" "),c+=d,u.mode==1&&(i+=(i?" ":"")+d)),this.startSpan(Math.max(r,a),c),u.opaque)return;let p=e.tree&&e.tree.prop(St.mounted);if(p&&p.overlay){let h=e.node.enter(p.overlay[0].from+a,1),g=this.highlighters.filter(y=>!y.scope||y.scope(p.tree.type)),m=e.firstChild();for(let y=0,O=a;;y++){let v=y<p.overlay.length?p.overlay[y]:null,b=v?v.from+a:l,S=Math.max(r,O),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(!v||b>n)break;O=v.to+a,O>r&&(this.highlightRange(h.cursor(),Math.max(r,v.from+a),Math.min(n,O),"",g),this.startSpan(Math.min(n,O),c))}m&&e.parent()}else if(e.firstChild()){p&&(i="");do if(!(e.to<=r)){if(e.from>=n)break;this.highlightRange(e,r,n,i,o),this.startSpan(Math.min(n,e.to),c)}while(e.nextSibling());e.parent()}}}function rTe(t){let e=t.type.prop(e6);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const ze=Ua.define,dO=ze(),Ql=ze(),vN=ze(Ql),bN=ze(Ql),Dl=ze(),fO=ze(Dl),uP=ze(Dl),Qs=ze(),Qc=ze(Qs),ks=ze(),Ts=ze(),fk=ze(),Bp=ze(fk),pO=ze(),D={comment:dO,lineComment:ze(dO),blockComment:ze(dO),docComment:ze(dO),name:Ql,variableName:ze(Ql),typeName:vN,tagName:ze(vN),propertyName:bN,attributeName:ze(bN),className:ze(Ql),labelName:ze(Ql),namespace:ze(Ql),macroName:ze(Ql),literal:Dl,string:fO,docString:ze(fO),character:ze(fO),attributeValue:ze(fO),number:uP,integer:ze(uP),float:ze(uP),bool:ze(Dl),regexp:ze(Dl),escape:ze(Dl),color:ze(Dl),url:ze(Dl),keyword:ks,self:ze(ks),null:ze(ks),atom:ze(ks),unit:ze(ks),modifier:ze(ks),operatorKeyword:ze(ks),controlKeyword:ze(ks),definitionKeyword:ze(ks),moduleKeyword:ze(ks),operator:Ts,derefOperator:ze(Ts),arithmeticOperator:ze(Ts),logicOperator:ze(Ts),bitwiseOperator:ze(Ts),compareOperator:ze(Ts),updateOperator:ze(Ts),definitionOperator:ze(Ts),typeOperator:ze(Ts),controlOperator:ze(Ts),punctuation:fk,separator:ze(fk),bracket:Bp,angleBracket:ze(Bp),squareBracket:ze(Bp),paren:ze(Bp),brace:ze(Bp),content:Qs,heading:Qc,heading1:ze(Qc),heading2:ze(Qc),heading3:ze(Qc),heading4:ze(Qc),heading5:ze(Qc),heading6:ze(Qc),contentSeparator:ze(Qs),list:ze(Qs),quote:ze(Qs),emphasis:ze(Qs),strong:ze(Qs),link:ze(Qs),monospace:ze(Qs),strikethrough:ze(Qs),inserted:ze(),deleted:ze(),changed:ze(),invalid:ze(),meta:pO,documentMeta:ze(pO),annotation:ze(pO),processingInstruction:ze(pO),definition:Ua.defineModifier("definition"),constant:Ua.defineModifier("constant"),function:Ua.defineModifier("function"),standard:Ua.defineModifier("standard"),local:Ua.defineModifier("local"),special:Ua.defineModifier("special")};for(let t in D){let e=D[t];e instanceof Ua&&(e.name=t)}t6([{tag:D.link,class:"tok-link"},{tag:D.heading,class:"tok-heading"},{tag:D.emphasis,class:"tok-emphasis"},{tag:D.strong,class:"tok-strong"},{tag:D.keyword,class:"tok-keyword"},{tag:D.atom,class:"tok-atom"},{tag:D.bool,class:"tok-bool"},{tag:D.url,class:"tok-url"},{tag:D.labelName,class:"tok-labelName"},{tag:D.inserted,class:"tok-inserted"},{tag:D.deleted,class:"tok-deleted"},{tag:D.literal,class:"tok-literal"},{tag:D.string,class:"tok-string"},{tag:D.number,class:"tok-number"},{tag:[D.regexp,D.escape,D.special(D.string)],class:"tok-string2"},{tag:D.variableName,class:"tok-variableName"},{tag:D.local(D.variableName),class:"tok-variableName tok-local"},{tag:D.definition(D.variableName),class:"tok-variableName tok-definition"},{tag:D.special(D.variableName),class:"tok-variableName2"},{tag:D.definition(D.propertyName),class:"tok-propertyName tok-definition"},{tag:D.typeName,class:"tok-typeName"},{tag:D.namespace,class:"tok-namespace"},{tag:D.className,class:"tok-className"},{tag:D.macroName,class:"tok-macroName"},{tag:D.propertyName,class:"tok-propertyName"},{tag:D.operator,class:"tok-operator"},{tag:D.comment,class:"tok-comment"},{tag:D.meta,class:"tok-meta"},{tag:D.invalid,class:"tok-invalid"},{tag:D.punctuation,class:"tok-punctuation"}]);const nTe=ul({String:D.string,Number:D.number,"True False":D.bool,PropertyName:D.propertyName,Null:D.null,",":D.separator,"[ ]":D.squareBracket,"{ }":D.brace}),iTe=os.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:[nTe],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 pk=[],r6=[];(()=>{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?r6:pk).push(r=r+t[e])})();function oTe(t){if(t<768)return!1;for(let e=0,r=pk.length;;){let n=e+r>>1;if(t<pk[n])r=n;else if(t>=r6[n])e=n+1;else return!0;if(e==r)return!1}}function xN(t){return t>=127462&&t<=127487}const SN=8205;function sTe(t,e,r=!0,n=!0){return(r?n6:aTe)(t,e,n)}function n6(t,e,r){if(e==t.length)return e;e&&i6(t.charCodeAt(e))&&o6(t.charCodeAt(e-1))&&e--;let n=dP(t,e);for(e+=wN(n);e<t.length;){let i=dP(t,e);if(n==SN||i==SN||r&&oTe(i))e+=wN(i),n=i;else if(xN(i)){let o=0,s=e-2;for(;s>=0&&xN(dP(t,s));)o++,s-=2;if(o%2==0)break;e+=2}else break}return e}function aTe(t,e,r){for(;e>0;){let n=n6(t,e-2,r);if(n<e)return n;e--}return 0}function dP(t,e){let r=t.charCodeAt(e);if(!o6(r)||e+1==t.length)return r;let n=t.charCodeAt(e+1);return i6(n)?(r-55296<<10)+(n-56320)+65536:r}function i6(t){return t>=56320&&t<57344}function o6(t){return t>=55296&&t<56320}function wN(t){return t<65536?1:2}class Nt{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]=Pf(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),Bs.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]=Pf(this,e,r);let n=[];return this.decompose(e,r,n,0),Bs.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 Rh(this),o=new Rh(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 Rh(this,e)}iterRange(e,r=this.length){return new s6(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 a6(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]?Nt.empty:e.length<=32?new Wr(e):Bs.from(Wr.split(e,[]))}}class Wr extends Nt{constructor(e,r=lTe(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 cTe(i,a,n,s);i=a+1,n++}}decompose(e,r,n,i){let o=e<=0&&r>=this.length?this:new Wr(PN(this.text,e,r),Math.min(r,this.length)-Math.max(0,e));if(i&1){let s=n.pop(),a=Sv(o.text,s.text.slice(),0,o.length);if(a.length<=32)n.push(new Wr(a,s.length+o.length));else{let l=a.length>>1;n.push(new Wr(a.slice(0,l)),new Wr(a.slice(l)))}}else n.push(o)}replace(e,r,n){if(!(n instanceof Wr))return super.replace(e,r,n);[e,r]=Pf(this,e,r);let i=Sv(this.text,Sv(n.text,PN(this.text,0,e)),r),o=this.length+n.length-(r-e);return i.length<=32?new Wr(i,o):Bs.from(Wr.split(i,[]),o)}sliceString(e,r=this.length,n=`
|
|
@@ -347,7 +347,7 @@ $3`);return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}}function l5e(t){return t.
|
|
|
347
347
|
`];let O=-1,v=0;for(const b of y){const S=t.indexOf(b,u);if(S!==-1&&S<l.start){O=S,v=b.length;break}}if(O!==-1)d=O+v;else{const b=[`
|
|
348
348
|
`,`\r
|
|
349
349
|
`];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:p})}return e}const X5e=()=>Vt.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=W5e(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 g of l)t.visibleRanges.some(y=>Math.max(y.from,g.start)<Math.min(y.to,g.end))&&r.push({from:g.start,to:g.end,value:n});const u=/^([a-zA-Z0-9\-]+):\s*(.+?)(?:\r?\n|$)/gm;for(const g of s){u.lastIndex=g.headersStart;let m;for(;(m=u.exec(e))!==null&&m.index<g.headersEnd;){const O=m.index+m[1].length+1+(m[2].match(/^\s*/)?.[0]?.length||0),v=m.index+m[0].length-(m[0].match(/\r?\n$/)?.[0]?.length||0);t.visibleRanges.some(S=>Math.max(S.from,O)<Math.min(S.to,v))&&v>O&&r.push({from:O,to:v,value:i})}}const d=/\[Binary\s+Data\]/gi;let p;for(;(p=d.exec(e))!==null;){const g=p.index,m=p[0].length;t.visibleRanges.some(O=>Math.max(O.from,g)<Math.min(O.to,g+m))&&r.push({from:g,to:g+m,value:o})}const h=Me.mark({attributes:{style:"color: var(--color-blue-8);"}});for(const g of s)if(g.contentType?.includes("json")){const m=e.slice(g.bodyStart,g.bodyEnd),y=m.trim();if(!y)continue;const O=m.length-m.trimStart().length,v=g.bodyStart+O;let b;try{const x=Lf.create("inmemory://model.json","json",0,y),C=V5e.parseJSONDocument(x)?.root;b=U5e(C)?C:void 0}catch{b=void 0}if(!b)continue;const S=B5e(b);for(const x of S){const $=v+x.from,C=v+x.to;if(!t.visibleRanges.some(_=>Math.max(_.from,$)<Math.min(_.to,C))||!(e[$]==='"'&&e[C-1]==='"'))continue;const I=$+1,Q=C-1;Q<=I||r.push({from:I,to:Q,value:h})}}return Me.set(r,!0)}},{decorations:t=>t.decorations}),F5e=()=>Vt.fromClass(class{decorations;constructor(t){this.decorations=this.buildDecorations(t)}update(t){(t.docChanged||t.viewportChanged)&&(this.decorations=this.buildDecorations(t.view))}buildDecorations(t){const e=t.state.doc.toString(),r=[],n=Me.mark({attributes:{style:"color: var(--color-blue-8);"}}),i=/^([a-zA-Z0-9\-]+):\s*(.+?)(?:\r?\n|$)/gm;let o;for(;(o=i.exec(e))!==null;){let l=o.index+o[1].length+1;for(;l<e.length&&/\s/.test(e[l]);)l++;const u=o.index+o[0].length-(o[0].match(/\r?\n$/)?.[0]?.length||0);u<=l||!t.visibleRanges.some(p=>Math.max(p.from,l)<Math.min(p.to,u))||r.push({from:l,to:u,value:n})}return Me.set(r,!0)}},{decorations:t=>t.decorations}),Z5e=MS({});function Y5e(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 G5e(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 YP=()=>Vt.fromClass(class{decorations;constructor(t){this.decorations=this.buildDecorations(t)}update(t){(t.docChanged||t.viewportChanged)&&(this.decorations=this.buildDecorations(t.view))}buildDecorations(t){const e=t.state.doc.toString(),r=[],n=Me.mark({attributes:{style:"color: var(--color-blue-8);"}}),i=Me.mark({attributes:{style:"color: var(--code-block-tokens-keyword-color); font-weight: var(--font-weight-bold);"}}),o=e.split(/\r?\n/);let s=0;for(let a=0;a<o.length;a++){const l=o[a],c=s,u=s+l.length;if(!l.trim()){s=u+(e[s+l.length]==="\r"?2:1);continue}let d=c,p=l;l.startsWith("0x1E")?(d=c+4,p=l.substring(4),r.push({from:c,to:c+4,value:i})):l.charCodeAt(0)===30&&(d=c+1,p=l.substring(1),r.push({from:c,to:c+1,value:i})),l.endsWith("0x0A")?(p=p.substring(0,p.length-4),r.push({from:u-4,to:u,value:i})):l.charCodeAt(l.length-1)===10&&(p=p.substring(0,p.length-1),r.push({from:u-1,to:u,value:i}));let h;try{const m=Lf.create("inmemory://model.json","json",0,p),O=Z5e.parseJSONDocument(m)?.root;h=Y5e(O)?O:void 0}catch{h=void 0}if(!h){s=u+(e[s+l.length]==="\r"?2:1);continue}const g=G5e(h);for(const m of g){const y=d+m.from,O=d+m.to;if(!t.visibleRanges.some(x=>Math.max(x.from,y)<Math.min(x.to,O))||!(e[y]==='"'&&e[O-1]==='"'))continue;const b=y+1,S=O-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}),sp={[Fr.Text]:{name:"Text",extensions:[De.lineWrapping],stateExtensions:[NT]},[Fr.JSON]:{name:"JSON",extensions:[J8(),S_e(j5e(),{delay:0,needsRefresh:t=>t.transactions.some(e=>e.effects.some(r=>r.is(KY)))}),H8.data.of({autocomplete:Q5e()}),_5e],stateExtensions:[R5e,z5e]},[Fr.XML]:{name:"XML",extensions:[u_e()],stateExtensions:[NT]}},eG={[Fr.MultipartMixed]:{name:"Multipart Mixed",extensions:[De.lineWrapping],stateExtensions:[X5e]},[Fr.JSONL]:{name:"JSON Lines",extensions:[De.lineWrapping],stateExtensions:[YP]},[Fr.NDJSON]:{name:"NDJSON",extensions:[J8(),De.lineWrapping],stateExtensions:[YP]},[Fr.JSONSeq]:{name:"JSON Sequence",extensions:[De.lineWrapping],stateExtensions:[YP]},[Fr.TextStream]:{name:"SSE",extensions:[De.lineWrapping],stateExtensions:[F5e]}},tG={[Fr.Image]:{name:"Image",extensions:[],stateExtensions:[]}},rG={[Fr.HTML]:{name:"HTML",extensions:[q2e()],stateExtensions:[NT]}},mh={...sp,...tG,...rG,...eG},tR={...sp,...tG,...rG},Gc={...sp,...eG},nG={[Fr.FormData]:{name:"form-data",extensions:void 0},[Fr["application/x-www-form-urlencoded"]]:{name:"x-www-form-urlencoded",extensions:void 0}},iG={[Fr.Binary]:{name:"Binary",extensions:void 0}},Ou={...sp,...nG,...iG},H5e=Object.keys(sp),N0=Object.keys(nG),oG=Object.keys(iG);function sG(t=[],e){const r={};return t.forEach(n=>{const i=String(n[e]);r[i]||(r[i]=[]),r[i].push(n)}),r}const $g={active:!0,key:"",value:""};function nu(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,...n.allowReserved&&{allowReserved:n.allowReserved}})),gr(e.in)]}function kg(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 Ao(){return{id:crypto.randomUUID(),...$g}}function Ii(){return{id:crypto.randomUUID(),...$g,description:""}}function gr(t){return{...$g,id:crypto.randomUUID(),in:t}}function Ka(){return{id:crypto.randomUUID(),...$g,type:"text",files:null}}function rR(){return{id:crypto.randomUUID(),...$g,sendIn:Jn.URL}}function GP(t){return t.map(e=>({id:crypto.randomUUID(),key:"",value:e,active:!0}))}function qS(t,e){return t.filter(r=>r.active&&r.value).map(({value:r})=>(e?or(r,e):r).trim())}function nc(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 J5e(t,e){return t.map(({value:r,...n})=>({...n,value:or(r,e)}))}function K5e(t,e){if(!t.startsWith("$components.parameters."))return null;const r=t.replace("$components.parameters.","");return r&&e[r]||null}function Dr(t=[],e={}){const r=[];for(const n of t)if(Hl(n)){const i=K5e(n.reference,e);i&&r.push({...i,active:n.active,value:n.value||i.value})}else r.push(n);return r}function Nl(t){return Object.entries(t).map(([e,r])=>({id:crypto.randomUUID(),key:"",value:e,active:!0,description:r}))}function eNe(t,e){return[...t.flatMap(n=>{const i=n.schema,o=i?.fields||[];return o.length>0?o.flatMap(s=>V3(s.name,s.example,n.allowReserved)):V3(n.name,i?.example??n.example,n.allowReserved)}),gr("query")]}function V3(t,e,r){if(e===void 0)return[HP(t,"",!1,r)];const n=MT(e,t);return n.length===0?[HP(t,"",!1,r)]:n.map(i=>HP(i.key,i.value,!0,r))}function MT(t,e){return t===void 0?[]:t===null?[{key:e,value:""}]:Array.isArray(t)?t.flatMap((r,n)=>r!==null&&typeof r=="object"?MT(r,`${e}[${n}]`):[{key:e,value:String(r)}]):tNe(t)?Object.entries(t).flatMap(([r,n])=>MT(n,`${e}[${r}]`)):[{key:e,value:String(t)}]}function tNe(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function HP(t,e,r,n){return{id:crypto.randomUUID(),key:t,value:e,active:r,in:"query",...n&&{allowReserved:n}}}function rNe(t){return t.replace(/{/g,"{{").replace(/}/g,"}}")}const U3={documentedOAuth2Types:[],grantType:Oe.ClientCredentials,authRequestExtraParams:[Ao()],tokenRequestExtraParams:[rR()],[Oe.ClientCredentials]:{clientId:"",clientSecret:"",clientAssertion:"",tokenUrl:"",scopes:[Ii()],accessToken:""},[Oe.ClientCredentialsWithJwtAssertion]:{clientId:"",clientSecret:"",clientAssertion:"",tokenUrl:"",scopes:[Ii()],accessToken:""},[Oe.AuthorizationCode]:{clientId:"",clientSecret:"",tokenUrl:"",authorizationUrl:"",callbackUrl:"",availableScopes:[],scopes:[Ii()],codeVerifier:"",codeChallenge:"",accessToken:""},[Oe.AuthorizationCodeWithPkce]:{clientId:"",clientSecret:"",tokenUrl:"",authorizationUrl:"",callbackUrl:"",availableScopes:[],scopes:[Ii()],codeVerifier:"",codeChallenge:"",accessToken:""},[Oe.Implicit]:{clientId:"",authorizationUrl:"",callbackUrl:"",availableScopes:[],scopes:[Ii()],accessToken:""},[Oe.Password]:{username:"",password:"",clientId:"",clientSecret:"",tokenUrl:"",accessToken:"",scopes:[Ii()]}},nNe={securityType:me.NoAuth,securitySchemeId:null,[me.BasicAuth]:{username:"",password:""},[me.JWT]:{token:""},[me.DigestAuth]:{username:"",password:"",nc:"00000001",realm:"",nonce:"",opaque:"",qop:"",algorithm:"",cnonce:""},[me.APIKey]:{location:oo.Header,name:"",key:""},[me.OAuth2]:U3,[me.OpenIDConnect]:{...U3,openIdConnectUrl:"",userInfoUrl:""}},LT="urn:ietf:params:oauth:client-assertion-type:jwt-bearer",iNe={[Yn.SIMPLE]:{condition:"",type:Yn.SIMPLE},[Yn.REGEX]:{condition:"",type:Yn.REGEX,context:""},[Yn.JSONPATH]:{condition:"",type:Yn.JSONPATH,context:""},[Yn.XPATH]:{condition:"",type:Yn.XPATH,context:""}};function M0(){return structuredClone({type:mn.Text,content:"",activeExampleName:"",formData:{"multipart/form-data":[Ka()],"application/x-www-form-urlencoded":[Ka()]},binary:null})}const oNe={method:"GET",url:"",security:[ms()],body:M0(),queryParameters:[Ao()],headers:[Ao()],cookies:[Ao()],pathParameters:[Ao()]};function aG(){return structuredClone(oNe)}function ms(){return ra(nNe)}function sNe(t){return ra({id:crypto.randomUUID(),...iNe[t]})}function lG(t,e,r){for(const n of r){const i=B3(t,n),o=B3(e,n);if(typeof i=="object"&&typeof o=="object"){if(!lG(i,o,r))return!1}else if(i!==o)return!1}return!0}function B3(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 aNe(t,e){return t.length===e.length&&t.sort().join()===e.sort().join()}function lNe(t,e){return t.every(r=>e.includes(r))}function cNe(t){switch(t){case"query":return oo.Query;case"cookie":return oo.Cookie;case"header":return oo.Header;default:return}}function uNe(t,e,r){const{security:n}=e,i=j1e(t);if(!r)return!1;const o=nR(r),s=o.map(u=>u.securityType),a=n.map(u=>u.securityType);if(!aNe(s,a))return!0;let c=[];return n.forEach(u=>{const d=u.securityType,p=u[me.OAuth2]?.grantType,h=s.includes(d),g=o.find(v=>v.securityType===d),m=!g||lG(u,g,fNe(d,p)),y=dNe(u,d,u[me.OAuth2]?.grantType,i),O=!!(h&&g&&m&&y);c.push(!r.security?.length||O)}),c.includes(!1)}function dNe(t,e,r,n){if(e===me.OAuth2&&(r===Oe.AuthorizationCode||r===Oe.AuthorizationCodeWithPkce||r===Oe.Implicit)){const i=t[me.OAuth2][r]?.availableScopes,o=qS(t[me.OAuth2][r]?.scopes,n);return lNe(o,i)}return!0}function fNe(t,e){return t===me.APIKey?[`${me.APIKey}/name`,`${me.APIKey}/location`]:t===me.OAuth2?[`${me.OAuth2}/grantType`,...pNe(e)]:t===me.OpenIDConnect?[`${me.OpenIDConnect}/openIdConnectUrl`]:[]}function pNe(t){return t===Oe.ClientCredentials?[`${me.OAuth2}/${Oe.ClientCredentials}/tokenUrl`]:t===Oe.Password?[`${me.OAuth2}/${Oe.Password}/tokenUrl`]:t===Oe.Implicit?[`${me.OAuth2}/${Oe.Implicit}/authorizationUrl`]:t===Oe.AuthorizationCode?[`${me.OAuth2}/${Oe.AuthorizationCode}/tokenUrl`,`${me.OAuth2}/${Oe.AuthorizationCode}/authorizationUrl`]:t===Oe.AuthorizationCodeWithPkce?[`${me.OAuth2}/${Oe.AuthorizationCodeWithPkce}/tokenUrl`,`${me.OAuth2}/${Oe.AuthorizationCodeWithPkce}/authorizationUrl`]:[]}function hNe(t){return t.map(e=>{const r=e.map(n=>n.id).join("_");return e.map(n=>({...n,schemeId:r}))})}function mNe(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(iR(s))}),{id:i,security:o}});return e.length?r:[]}function gNe(t,e){const r=t.security||[];return r?.length?pG(r).map((n,i)=>iR(n)):[]}function nR(t){const r=(t.security||[])[0];return r?r.map(n=>iR(n)):[ms()]}function iR(t,e){const r={...ms(),securitySchemeId:t.id},n=zS(t);r.securityType=n;const i=t.id;if(t.id&&n!==me.NoAuth&&(r[n].schemeName=t.id),n===me.BasicAuth&&(r[me.BasicAuth].username||(r[me.BasicAuth].username=Rr(i+j.SecurityVariablesEnvSuffix.Username)),r[me.BasicAuth].password||(r[me.BasicAuth].password=Rr(i+j.SecurityVariablesEnvSuffix.Password))),n===me.DigestAuth&&(r[me.DigestAuth].username||(r[me.DigestAuth].username=Rr(i+j.SecurityVariablesEnvSuffix.Username)),r[me.DigestAuth].password||(r[me.DigestAuth].password=Rr(i+j.SecurityVariablesEnvSuffix.Password))),n===me.JWT&&!r[me.JWT].token&&(r[me.JWT].token=Rr(i+j.SecurityVariablesEnvSuffix.JWTToken)),n===me.APIKey&&!r[me.APIKey].key){r[me.APIKey].name=t.name||"",r[me.APIKey].key=Rr(i+j.SecurityVariablesEnvSuffix.APIKey);const o=cNe(t.in);o&&(r[me.APIKey].location=o)}if(n===me.OAuth2){const o=sR(t),s=Rr(i+j.SecurityVariablesEnvSuffix.Token),a=r[me.OAuth2];a.grantType=o[0],o.forEach(l=>{l===Oe.AuthorizationCode&&!a[Oe.AuthorizationCode].accessToken&&(a[Oe.AuthorizationCode].accessToken=s,a[Oe.AuthorizationCode].clientId=Rr(i+j.SecurityVariablesEnvSuffix.ClientId),a[Oe.AuthorizationCode].authorizationUrl=t.flows?.authorizationCode?.authorizationUrl||"",a[Oe.AuthorizationCode].tokenUrl=t.flows?.authorizationCode?.tokenUrl||"",a[Oe.AuthorizationCode].clientSecret=Rr(i+j.SecurityVariablesEnvSuffix.ClientSecret),a[Oe.AuthorizationCode].availableScopes=Object.keys(t.flows?.authorizationCode?.scopes||{})||[],a[Oe.AuthorizationCode].scopes=[...Nl(t.flows?.authorizationCode?.scopes||{})||[],Ii()]),l===Oe.AuthorizationCodeWithPkce&&!a[Oe.AuthorizationCodeWithPkce].accessToken&&(a[Oe.AuthorizationCodeWithPkce].accessToken=s,a[Oe.AuthorizationCodeWithPkce].clientId=Rr(i+j.SecurityVariablesEnvSuffix.ClientId),a[Oe.AuthorizationCodeWithPkce].authorizationUrl=t.flows?.authorizationCode?.authorizationUrl||"",a[Oe.AuthorizationCodeWithPkce].tokenUrl=t.flows?.authorizationCode?.tokenUrl||"",a[Oe.AuthorizationCodeWithPkce].clientSecret=Rr(i+j.SecurityVariablesEnvSuffix.ClientSecret),a[Oe.AuthorizationCodeWithPkce].availableScopes=Object.keys(t.flows?.authorizationCode?.scopes||{})||[],a[Oe.AuthorizationCodeWithPkce].scopes=[...Nl(t.flows?.authorizationCode?.scopes||{}),Ii()]),l===Oe.ClientCredentials&&!a[Oe.ClientCredentials].accessToken&&(a[Oe.ClientCredentials].accessToken=s,a[Oe.ClientCredentials].clientId=Rr(i+j.SecurityVariablesEnvSuffix.ClientId),a[Oe.ClientCredentials].clientSecret=Rr(i+j.SecurityVariablesEnvSuffix.ClientSecret),a[Oe.ClientCredentials].tokenUrl=t.flows?.clientCredentials?.tokenUrl||"",a[Oe.ClientCredentials].scopes=[...Nl(t.flows?.clientCredentials?.scopes||{}),Ii()]),l===Oe.ClientCredentialsWithJwtAssertion&&!a[Oe.ClientCredentialsWithJwtAssertion].accessToken&&(a[Oe.ClientCredentialsWithJwtAssertion].accessToken=s,a[Oe.ClientCredentialsWithJwtAssertion].clientId=Rr(i+j.SecurityVariablesEnvSuffix.ClientId),a[Oe.ClientCredentialsWithJwtAssertion].clientAssertion=Rr(i+j.SecurityVariablesEnvSuffix.ClientAssertion),a[Oe.ClientCredentialsWithJwtAssertion].scopes=[...Nl(t.flows?.clientCredentials?.scopes||{}),Ii()]),l===Oe.Implicit&&!a[Oe.Implicit].accessToken&&(a[Oe.Implicit].accessToken=s,a[Oe.Implicit].clientId=Rr(i+j.SecurityVariablesEnvSuffix.ClientId),a[Oe.Implicit].authorizationUrl=t.flows?.implicit?.authorizationUrl||"",a[Oe.Implicit].availableScopes=Object.keys(t.flows?.implicit?.scopes||{})||[],a[Oe.Implicit].scopes=[...Nl(t.flows?.implicit?.scopes||{}),Ii()]),l===Oe.Password&&!a[Oe.Password].accessToken&&(a[Oe.Password].accessToken=s,a[Oe.Password].clientId=Rr(i+j.SecurityVariablesEnvSuffix.ClientId),a[Oe.Password].clientSecret=Rr(i+j.SecurityVariablesEnvSuffix.ClientSecret),a[Oe.Password].tokenUrl=t.flows?.password?.tokenUrl||"",a[Oe.Password].scopes=[...Nl(t.flows?.password?.scopes||{}),Ii()])})}if(n===me.OpenIDConnect){const o=Rr(i+j.SecurityVariablesEnvSuffix.Token),s=r[me.OpenIDConnect];s[Oe.AuthorizationCode].accessToken||(s[Oe.AuthorizationCode].accessToken=o,s[Oe.AuthorizationCode].clientId=Rr(i+j.SecurityVariablesEnvSuffix.ClientId),s[Oe.AuthorizationCode].clientSecret=Rr(i+j.SecurityVariablesEnvSuffix.ClientSecret),s[Oe.AuthorizationCode].tokenUrl=t.flows?.authorizationCode?.tokenUrl||""),s[Oe.AuthorizationCodeWithPkce].accessToken||(s[Oe.AuthorizationCodeWithPkce].accessToken=o,s[Oe.AuthorizationCodeWithPkce].clientId=Rr(i+j.SecurityVariablesEnvSuffix.ClientId),s[Oe.AuthorizationCodeWithPkce].clientSecret=Rr(i+j.SecurityVariablesEnvSuffix.ClientSecret),s[Oe.AuthorizationCodeWithPkce].tokenUrl=t.flows?.authorizationCode?.tokenUrl||""),s[Oe.Implicit].accessToken||(s[Oe.Implicit].accessToken=o,s[Oe.Implicit].clientId=Rr(i+j.SecurityVariablesEnvSuffix.ClientId))}return r}function cG(t){try{const e=JSON.parse(t);return JSON.stringify(e,null,2)}catch(e){return console.error({error:e}),t}}function uG(t,e){return e&&e.length>0?eNe(e):nu(t||[],{in:"query"})}function yNe(t,e=!1,r="",n){const i=sG(t.parameters,"in"),o=dG(t),s=nR(t),a=uG(i.query,i.querystring);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:nu(i.path||[],{in:"path"}),method:t.method.toLowerCase()==="x-query"?"QUERY":t.method.toLocaleUpperCase(),url:kg(rNe(t.path),a),headers:nu(i.header||[],{in:"header"}),queryParameters:a,cookies:nu(i.cookie||[],{in:"cookie"}),body:o,security:s},response:null}}function oR(t){const e=sG(t.parameters,"in"),r=dG(t),n=nR(t);return{parameters:{queryParameters:uG(e.query,e.querystring),headers:nu(e.header||[],{in:"header"}),cookies:nu(e.cookie||[],{in:"cookie"}),pathParameters:nu(e.path||[],{initializeWithInputs:!0,in:"path"})},requestBody:r,security:n}}function ONe(t,e){const r=new vc({format:!0});if(typeof t=="string")return e?.includes("json")?cG(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 dG(t){const e=t.body?.mediaTypes;if(!e||!Object.keys(e).length)return M0();const r=vNe(e,t),n=r?.name||"",i=!N0.includes(n)&&!oG.includes(n),o=qT(r),a=o.find(({key:c})=>c===t.body?.activeExampleName)?.value??o[0]?.value,l=i&&a?ONe(a,n):"";return{...M0(),activeExampleName:t.body?.activeExampleName||o[0]?.key||"",...r&&{type:r.name},content:l,formData:{"multipart/form-data":W3(e[Fr.FormData]),"application/x-www-form-urlencoded":W3(e[Fr["application/x-www-form-urlencoded"]])}}}function fG(t){return t?{...(Object.keys(t?.body?.mediaTypes||{})||[]).reduce((r,n)=>(r[n]={name:n,extensions:void 0},r),{}),...Ou}:Ou}function W3(t){if(!t)return[Ka()];if(!t.parameters)return[Ka()];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(Ka()),e}function qT(t){const e=t?.examples;return Object.keys(e||{}).map(r=>{const n=e?.[r];return{name:j.isString(n?.summary)?n?.summary:n?.summary?.raw||r,key:r,value:e?.[r].value}})}function vNe(t,e){const r=fG(e),n=Object.keys(t).find(i=>!!r[i]);return n?t[n]:null}function bNe(t){return!t?.security?.length||!t?[]:gNe(t)}function pG(t){const e=new Set;return t.flat().filter(r=>e.has(r.id)?!1:(e.add(r.id),!0))}function zS(t){if(t.type==="http"){if(t.scheme==="bearer")return me.JWT;if(t.scheme==="basic")return me.BasicAuth;if(t.scheme==="digest")return me.DigestAuth}else{if(t.type==="apiKey")return me.APIKey;if(t.type==="oauth2")return me.OAuth2;if(t.type==="openIdConnect")return me.OpenIDConnect}return me.NoAuth}function xNe(t,e){if(t==="clientCredentials"&&e&&"x-assertionType"in e&&e["x-assertionType"]===LT)return Oe.ClientCredentialsWithJwtAssertion;if(t==="authorizationCode"&&e&&"x-usePkce"in e&&e["x-usePkce"])return Oe.AuthorizationCodeWithPkce;switch(t){case"implicit":return Oe.Implicit;case"password":return Oe.Password;case"clientCredentials":return Oe.ClientCredentials;case"authorizationCode":return Oe.AuthorizationCode;default:return Oe.AuthorizationCode}}function SNe(t,e){const r=t?.security;if(!r?.length)return[];const o=hNe(r).flat().filter(s=>s.schemeId===e).find(s=>zS(s)===me.OAuth2);return sR(o)}function sR(t){return Object.entries(t?.flows||{}).map(([e,r])=>xNe(e,r)).filter(Boolean)}async function Tg(t){try{const e=await UF(t),r=await tI(t);return{absolutePath:t,file:new File([e],r)}}catch(e){return console.error("Failed to init replay file",e),null}}async function hG(t){return(await Promise.allSettled(t.map(r=>Tg(r)))).map(r=>r.status==="fulfilled"?r.value:null).filter(r=>r!==null)}function Qv(t){return/(?:^[a-z][a-z0-9+.-]*:|\/\/)/i.test(t)}function zT(t){return t.endsWith("/")?t.substring(0,t.length-1):t}function wNe(t){try{const e=new URL(t);return e.search="",e.hash="",e.toString()}catch{return t}}function Po(t){try{return new URL(t),!0}catch{return!1}}function PNe(t,e){let r;if(e.startsWith("//")){const{protocol:n}=new URL(t);r=`${n||"https:"}${e}`}else if(Qv(e))r=e;else if(!e.startsWith("/"))r=zT(t)+"/"+e;else{const n=new URL(t);n.pathname=e,r=n.toString()}return zT(r)}function X3(t,e){let r=t;return e.forEach(({key:n,value:i,active:o})=>{i&&o&&(r=r.replaceAll(`{${n}}`,i))}),r}function mG(t,e){let r=t;return e.forEach(({name:n,value:i})=>{i&&(r=r.replaceAll(`{${n}}`,i))}),r}function CNe(t){return t.startsWith("http://")||t.startsWith("https://")}function DO({url:t,serverUrl:e,corsProxyUrl:r}){let n;if(CNe(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 $Ne(t,e,r,n,i,o){const s=await Promise.all(t.sourceDescriptions?.map(async l=>({...l,apiId:await gG({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:qt.Normal,sourceDescriptions:s,components:a,workflows:await Promise.all(t.workflows.map(async l=>({...l,state:qt.Normal,parameters:tq(l.parameters,l["x-replay-disabled-parameters"],t.components?.parameters),outputs:K3(l.outputs),security:G3(l["x-security"]),steps:await Promise.all(l.steps.map(async c=>{const u=tq(c.parameters,c["x-replay-disabled-parameters"],t.components?.parameters),d=c["x-operation"]??null;d&&(d.url=kg(d.url,u.queryParameters.filter(uV)));const p=kNe(c,s,i);let h;if(p&&o){const m=i?.find(y=>y.id===p.apiId);try{h=o(p.path,p.method,m)}catch(y){console.error("Failed to convert operation to replay value",y),h=void 0}}delete c.operationId,delete c["x-operation"];const g=await jNe(c.requestBody,n);return{...c,state:qt.Normal,parameters:u,outputs:K3(c.outputs),successCriteria:c.successCriteria?.map(m=>({...m,type:m.type??Yn.SIMPLE}))||[],requestBody:g,xOperation:d,security:G3(c["x-security"],h),operation:p}}))})))}}async function gG({projectPath:t,apiUrl:e,collectionId:r}){if(Po(e))return e;if(await Wt.isAbsolute(e))return await Wt.relative(t,e);const n=await Wt.resolve(await Wt.join(t,r,"..",e));return await Wt.relative(t,n)}function kNe(t,e,r){if(t["x-operation"])return null;const{path:n,method:i,apiId:o,isAdditionalOperation:s,sourceDescriptionName:a}=yG({operationPath:t.operationPath,parsedSourceDescriptions:e}),{operationId:l,apiId:c,sourceDescriptionName:u}=TNe({operationId:t.operationId,parsedSourceDescriptions:e}),d=c||o||e[0]?.apiId||"",p=r?.find(g=>g.id===d),h=u??a??void 0;if(l&&p&&!n&&!i){const g=QNe(l,p);return{apiId:d,path:g?.path??"",method:g?.method??"",operationId:l,isAdditionalOperation:g?.isAdditionalOperation??!1,sourceDescriptionName:h}}return{apiId:d,path:n??"",method:i??"",operationId:l,isAdditionalOperation:s,sourceDescriptionName:h}}function TNe({operationId:t,parsedSourceDescriptions:e}){if(!t)return{operationId:"",apiId:null,sourceDescriptionName:null};const r=t.split(".");if(r.length===1)return{operationId:t,apiId:e[0]?.apiId??"",sourceDescriptionName:null};const n=r[1],i=r.slice(2).join("."),o=e.find(({name:s})=>s===n);return{operationId:i,apiId:o?.apiId??"",sourceDescriptionName:n}}function F3(t){return"reference"in t&&typeof t.reference=="string"}function yG({operationPath:t,parsedSourceDescriptions:e}){if(!t)return{apiId:null,path:"",method:"",isAdditionalOperation:!1,sourceDescriptionName:null};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,sourceDescriptionName:null};let o=null,s=null;const a=/\$sourceDescriptions\.(.+)\.url/,l=i.match(a);if(l&&(o=l[1]),o){const h=e.find(({name:g})=>g===o);h&&(s=h.apiId)}const c=n.split("/"),u=c.pop()||"",d=c[c.length-1]==="additionalOperations";return d&&c.pop(),{path:Db.unescape(c.pop()||""),method:u.toLowerCase(),apiId:s,isAdditionalOperation:d,sourceDescriptionName:o}}catch{return{path:"",method:"",apiId:null,isAdditionalOperation:!1,sourceDescriptionName:null}}}function ENe(t){switch(t.type){case"apiKey":return me.APIKey;case"oauth2":return me.OAuth2;case"openIdConnect":return me.OpenIDConnect;case"http":return t.scheme==="basic"?me.BasicAuth:t.scheme==="digest"?me.DigestAuth:t.scheme==="bearer"?me.JWT:me.NoAuth;default:return me.NoAuth}}function OG(t,e){const r={clientCredentials:Oe.ClientCredentials,authorizationCode:Oe.AuthorizationCode,implicit:Oe.Implicit,password:Oe.Password,clientCredentialsWithJwtAssertion:Oe.ClientCredentialsWithJwtAssertion,authorizationCodeWithPkce:Oe.AuthorizationCodeWithPkce};return t==="clientCredentials"&&e["x-assertionType"]==="urn:ietf:params:oauth:client-assertion-type:jwt-bearer"?Oe.ClientCredentialsWithJwtAssertion:t==="authorizationCode"&&e["x-usePkce"]?Oe.AuthorizationCodeWithPkce:r[t]??null}function ANe(t){return{query:oo.Query,header:oo.Header,cookie:oo.Cookie}[t.toLowerCase()]||oo.Header}function INe(t){return{body:Jn.Body,header:Jn.Header,url:Jn.URL}[t.toLowerCase()]||Jn.URL}function Z3(t,e,r){return Object.keys(t).reduce((n,i)=>{const o=OG(i,t[i]);if(!o)return n;switch(o){case Oe.ClientCredentials:n[o]={...r[o],clientId:e.clientId??"",clientSecret:e.clientSecret??"",clientAssertion:e.clientAssertion??"",tokenUrl:t[i].tokenUrl??"",scopes:Dc(t[i].scopes,t[i]["x-replay-disabled-scopes"]),accessToken:e.accessToken??""};break;case Oe.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:Dc(t[i].scopes,t[i]["x-replay-disabled-scopes"]),accessToken:e.accessToken??""};break;case Oe.Implicit:n[o]={...r[o],clientId:e.clientId??"",authorizationUrl:t[i].authorizationUrl??"",callbackUrl:e.callbackUrl??"",availableScopes:Dc(t[i].availableScopes),scopes:Dc(t[i].scopes,t[i]["x-replay-disabled-scopes"]),accessToken:e.accessToken??""};break;case Oe.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 Oe.ClientCredentialsWithJwtAssertion:n[o]={...r[o],clientAssertion:e.clientAssertion??"",tokenUrl:t[i].tokenUrl??"",scopes:Dc(t[i].scopes,t[i]["x-replay-disabled-scopes"]),clientId:e.clientId??"",clientSecret:e.clientSecret??"",accessToken:e.accessToken??""};break;case Oe.AuthorizationCodeWithPkce:n[o]={...r[o],tokenUrl:t[i].tokenUrl??"",authorizationUrl:t[i].authorizationUrl??"",callbackUrl:e.callbackUrl??"",availableScopes:Dc(t[i].availableScopes),scopes:Dc(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 Y3(t,e,r){const i={...ms(),securityType:t},o=Object.keys(e.flows||{})[0],s=OG(o,e.flows?.[o])??Oe.ClientCredentials;switch(t){case me.BasicAuth:return{...i,[me.BasicAuth]:{username:r.username,password:r.password,schemeName:e.id}};case me.JWT:return{...i,[me.JWT]:{token:r.token,schemeName:e.id}};case me.DigestAuth:return{...i,[me.DigestAuth]:{...i[me.DigestAuth],username:r.username,password:r.password,schemeName:e.id}};case me.APIKey:return{...i,[me.APIKey]:{location:ANe(e.in),name:e.name,key:r.apiKey,schemeName:e.id}};case me.OAuth2:return{...i,[me.OAuth2]:{...i[me.OAuth2],...Z3(e.flows||{},r||{},i[me.OAuth2]),authRequestExtraParams:H3(r.authRequestExtraParams),tokenRequestExtraParams:J3(r.tokenRequestExtraParams),grantType:s,schemeName:e.id}};case me.OpenIDConnect:return{...i,[me.OpenIDConnect]:{...i[me.OpenIDConnect],...Z3(r.flows||{},r||{},i[me.OpenIDConnect]),openIdConnectUrl:r.openIdConnectUrl,userInfoUrl:r.userInfoUrl,authRequestExtraParams:H3(r.authRequestExtraParams),tokenRequestExtraParams:J3(r.tokenRequestExtraParams),grantType:s,schemeName:e.id}};default:return i}}function RNe(t,e){return[...t.map(n=>{if("scheme"in n){const o=ENe(n.scheme);return Y3(o,n.scheme,n.values)}const i=e.find(o=>o.id===n.schemeName);if(i){const o=zS(i),s=Y3(o,i,n.values);return s.securitySchemeId=i.id,s}return ms()})]}function G3(t=[],e){const r=pG(e?.security||[]);return t.length?RNe(t,r):[ms()]}function Dc(t,e){const r=Nl(t||{}),n=Nl(e||{});return[...r,...n,Ii()]}function H3(t){return(t||[]).map(e=>({id:crypto.randomUUID(),key:e.key??"",value:e.value??"",active:e.active??!0})).concat(Ao())}function J3(t){return(t||[]).map(e=>({id:crypto.randomUUID(),key:e.key??"",value:e.value??"",active:e.active??!0,sendIn:INe(e.in)})).concat(rR())}function K3(t){if(!t)return[Ao()];const e=[];for(const r in t)e.push({id:crypto.randomUUID(),key:r,value:t[r],active:!0});return e.push(Ao()),e}const dd={query:"queryParameters",path:"pathParameters",header:"headers",cookie:"cookies"};function eq(t,e){const r="$components.parameters.";if(t.reference.startsWith(r)){const n=t.reference.replace(r,"");return e?.[n]}}function tq(t,e,r){if(!t&&!e)return{pathParameters:[gr("path")],queryParameters:[gr("query")],headers:[gr("header")],cookies:[gr("cookie")]};const n={pathParameters:[],queryParameters:[],headers:[],cookies:[]};if(t)for(const i of t)if(F3(i)){const o=eq(i,r),s=dd[o?.in];s&&n[s].push({reference:i.reference,active:!0,value:i.value})}else dd[i.in]&&n[dd[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(F3(i)){const o=eq(i,r),s=dd[o?.in];s&&n[s].push({reference:i.reference,active:!1,value:i.value})}else dd[i.in]&&n[dd[i.in]].push({id:crypto.randomUUID(),key:i.name,value:i.value,active:!1,in:i.in});return n.pathParameters.push(gr("path")),n.queryParameters.push(gr("query")),n.headers.push(gr("header")),n.cookies.push(gr("cookie")),n}async function jNe(t,e){const r=aG().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 _Ne(t,e)};case"application/octet-stream":const n=t.payload?await vG(t.payload,e):[],i=n.length>0?await Tg(n[0]):null;return{...r,type:t.contentType,binary:i};case"application/json":case"application/ld+json":return{...r,type:t.contentType,content:nq(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:nq(t.payload)}}}}async function rq(t,e,r,n){const i=await vG(e,n),o=i.length>0||Array.isArray(e),s=o?await hG(i):void 0;return{id:crypto.randomUUID(),key:t,value:o?"":e,type:o?"file":"text",active:r,files:s}}async function _Ne(t,e){const r=aG().body.formData,n=t.contentType,i=t.payload?await Promise.all(Object.entries(t.payload).map(([a,l])=>rq(a,l,!0,e))):[],o=t["x-replay-disabled-payload"]?await Promise.all(Object.entries(t["x-replay-disabled-payload"]||{}).map(([a,l])=>rq(a,l,!1,e))):[];return{...r,[n]:[...i,...o,Ka()]}}function nq(t){return t?JSON.stringify(t,null,2):""}function QNe(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 vG(t,e){return Array.isArray(t)?(await Promise.all(t.map(r=>iq(r,e)))).flat():typeof t=="string"?await iq(t,e):[]}async function iq(t,e){const r=/\$file\(['"](.+?)['"]\)/g,n=Array.from(t.matchAll(r));return Promise.all(n.map(i=>DNe(i[1],e)))}async function DNe(t,e){return await Wt.isAbsolute(t)?t:await Wt.resolve(await Wt.join(e,t))}const yi=t=>!t||typeof t=="boolean"?{type:"object",properties:{}}:t.type?t:{...t,type:"object"},oq=(t,e,r)=>{if(!t.properties)return t;const n=t.properties[e],i=yi(n);return{...t,properties:{...t.properties,[e]:{...i,...r}}}},NNe=(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})},MNe=(t,e)=>{if(!t.properties)return t;const r={...t.properties};return delete r[e],{...t,properties:r}},LNe=(t,e,r={type:"string"})=>{const n=t.properties||{};return{...t,type:"object",properties:{...n,[e]:r}}};function sq(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 aq(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(Hl(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 qNe(t){const e=t?.map(r=>({condition:r.condition,context:r.context,type:r.type==Yn.SIMPLE?void 0:r.type}));if(e?.length!==0)return e}function zNe(t){if(!(!t||t.length===0))return[...t]}async function bG(t,e){return t.absolutePath?`$file('${await Wt.relative(e,t.absolutePath)}')`:null}async function VNe(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=>bG(s,e)))).filter(s=>s!==null)),o.length===0?"":o.length===1?o[0]:o}}async function UNe(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 VNe(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 BNe(t){if(!t)return t;try{const e=JSON.parse(t);return typeof e=="object"?e:t}catch{return t}}async function WNe(t,e){if(t)switch(t.type){case"application/x-www-form-urlencoded":case"multipart/form-data":return{contentType:t.type,...await UNe(t,e)};case"application/octet-stream":return{contentType:t.type,payload:t.binary?await bG(t.binary,e):null};case"application/json":case"application/ld+json":return t.content?{contentType:t.type,payload:BNe(t.content)}:void 0;default:return t.content?{contentType:t.type,payload:t.content}:void 0}}function XNe(t){return{...t.schemeName?{schemeName:t.schemeName}:{scheme:{type:"http",scheme:"basic"}},values:{username:t.username,password:t.password}}}function FNe(t){return{...t.schemeName?{schemeName:t.schemeName}:{scheme:{type:"apiKey",name:t.name,in:t.location.toLowerCase()}},values:{apiKey:t.key}}}function ZNe(t){return{...t.schemeName?{schemeName:t.schemeName}:{scheme:{type:"http",scheme:"bearer"}},values:{token:t.token}}}function YNe(t){return{...t.schemeName?{schemeName:t.schemeName}:{scheme:{type:"http",scheme:"digest"}},values:{username:t.username,password:t.password}}}function GNe(t){const{flows:e,values:r}=wG(t);return{...t.schemeName?{schemeName:t.schemeName}:{scheme:{type:"openIdConnect",flows:e}},values:{...r,openIdConnectUrl:t.openIdConnectUrl,userInfoUrl:t.userInfoUrl,authRequestExtraParams:xG(t.authRequestExtraParams),tokenRequestExtraParams:SG(t.tokenRequestExtraParams)}}}function HNe(t){const{flows:e,values:r}=wG(t);return{...t.schemeName?{schemeName:t.schemeName}:{scheme:{type:"oauth2",flows:e}},values:{...r,authRequestExtraParams:xG(t.authRequestExtraParams),tokenRequestExtraParams:SG(t.tokenRequestExtraParams)}}}function fd(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 xG(t){return t.filter(e=>e.value||e.key).map(e=>({key:e.key,value:e.value,active:e.active}))}function SG(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 wG(t){let e;switch(t.grantType){case Oe.ClientCredentials:return e=t[Oe.ClientCredentials],{flows:{clientCredentials:{tokenUrl:e.tokenUrl,...fd(e.scopes)}},values:{clientId:e.clientId,clientSecret:e.clientSecret,accessToken:e.accessToken}};case Oe.Implicit:return e=t[Oe.Implicit],{flows:{implicit:{authorizationUrl:e.authorizationUrl,...fd(e.scopes)}},values:{clientId:e.clientId,accessToken:e.accessToken,callbackUrl:e.callbackUrl}};case Oe.Password:return e=t[Oe.Password],{flows:{password:{tokenUrl:e.tokenUrl,...fd(e.scopes)}},values:{clientId:e.clientId,clientSecret:e.clientSecret,username:e.username,password:e.password,accessToken:e.accessToken}};case Oe.AuthorizationCode:return e=t[Oe.AuthorizationCode],{flows:{authorizationCode:{tokenUrl:e.tokenUrl,authorizationUrl:e.authorizationUrl,...fd(e.scopes)}},values:{accessToken:e.accessToken,clientId:e.clientId,callbackUrl:e.callbackUrl}};case Oe.ClientCredentialsWithJwtAssertion:return e=t[Oe.ClientCredentialsWithJwtAssertion],{flows:{clientCredentials:{tokenUrl:e.tokenUrl,...fd(e.scopes),"x-assertionType":"urn:ietf:params:oauth:client-assertion-type:jwt-bearer"}},values:{clientId:e.clientId,clientAssertion:e.clientAssertion,accessToken:e.accessToken}};case Oe.AuthorizationCodeWithPkce:return e=t[Oe.AuthorizationCodeWithPkce],{flows:{authorizationCode:{tokenUrl:e.tokenUrl,authorizationUrl:e.authorizationUrl,...fd(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 lq(t){const e=t.map(r=>{switch(r.securityType){case me.OpenIDConnect:{const i=r[me.OpenIDConnect];return GNe(i)}case me.OAuth2:{const i=r[me.OAuth2];return HNe(i)}case me.APIKey:{const i=r[me.APIKey];return FNe(i)}case me.BasicAuth:{const i=r[me.BasicAuth];return XNe(i)}case me.DigestAuth:{const i=r[me.DigestAuth];return YNe(i)}case me.JWT:{const i=r[me.JWT];return ZNe(i)}default:return null}}).filter(r=>r!==null);return{"x-security":e.length?e:void 0}}function JNe(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 KNe(t,e){const{id:r,state:n,srcType:i,fileDependencies:o,sourceDescriptions:s,workflows:a,components:l,...c}=t;return{arazzoObject:{...c,sourceDescriptions:s.map(u=>({...u,name:u.name,url:u.url,type:u.type||"openapi",apiId:void 0})),components:JNe(l),workflows:await Promise.all(a.map(async({parameters:u,security:d,dependsOn:p,outputs:h,state:g,steps:m,inputs:y,...O})=>({...O,dependsOn:zNe(p),outputs:sq(h),inputs:y?yi(y):void 0,...lq(d),...aq(u),steps:await Promise.all(m.map(async({parameters:v,security:b,operation:S,requestBody:x,successCriteria:$,outputs:C,state:T,xOperation:I,...Q})=>{const _={operationId:void 0,operationPath:void 0,"x-operation":void 0};if(S){const L=(S.sourceDescriptionName?t.sourceDescriptions.find(({name:V})=>V===S.sourceDescriptionName):null)||t.sourceDescriptions.find(({apiId:V})=>V===S.apiId)||t.sourceDescriptions[0];if(S.operationId){const V=t.sourceDescriptions.length<=1;_.operationId=V?S.operationId:`$sourceDescriptions.${L.name}.${S.operationId}`}else _.operationPath=S.isAdditionalOperation?`{$sourceDescriptions.${L.name}.url}#/paths/${Db.escape(S.path)}/additionalOperations/${S.method}`:`{$sourceDescriptions.${L.name}.url}#/paths/${Db.escape(S.path)}/${S.method}`}else I&&(_["x-operation"]={...I,url:I.url.split("?")[0]});return{...Q,..._,...lq(b),...aq(v),requestBody:await WNe(x,e),successCriteria:qNe($),outputs:sq(C)}}))})))}}}class eMe extends FF{constructor(e,r){super(e),this.convertOperationToReplayValue=r}async parse(e,r){return{...await $Ne(e.content,e.uri,e.type,this.storage.baseDir,r,this.convertOperationToReplayValue),fileDependencies:e.fileDependencies}}async stringify(e){const{arazzoObject:r}=await KNe(e,this.storage.baseDir);return await Wt.extname(e.id)===".json"?JSON.stringify(r,null,2):tl.dump(r)}}class tMe{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=tl.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:qt.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",tl.dump(i))}}class rMe{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 PG=(t,e)=>({data:t,version:e});class CG extends rMe{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(PG(e,this.version))}}function nMe(t){return{data:{...t.data,tabs:t.data.tabs.map(e=>e.data.type===Ke.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 JP=2,iMe="tabs.json";class oMe extends CG{migrationMap={1:nMe};constructor(e){super(e,iMe,ra(rk),JP)}async parse(e){let r=null;try{r=JSON.parse(e)}catch(i){console.error("Failed to parse tabs state",i)}r||(r=PG(ra(rk),JP)),r.version!==JP&&(r=this.migrate(r));const n=await Promise.all(r.data.tabs.map(async i=>{if(i.data.type===Ke.Step&&i.data.draftStep){const o=i.data.draftStep.requestBody.formData;o["multipart/form-data"]=await cq(o["multipart/form-data"]),o["application/x-www-form-urlencoded"]=await cq(o["application/x-www-form-urlencoded"]),i.data.draftStep.requestBody.binary&&i.data.draftStep.requestBody.binary.absolutePath&&(i.data.draftStep.requestBody.binary=await Tg(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===Ke.Step?{...r,data:{...r.data,response:null}}:r.data.type===Ke.WorkflowRun?{...r,data:{...r.data,result:null}}:r)})}}async function cq(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 hG(n)}return r}))}const sMe=1;class $G{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 gke(this.project.id);const a=new mke;this.activeEnvironmentIdStorage=new CG(this.systemFilesStorage,"active_environment_id.json",mg,sMe),this.tabsStateStorage=new oMe(this.systemFilesStorage),this.environmentsStorage=new tMe(this.userFilesStorage,this.localStorageSecretsProvider),this.collectionsStorage=new eMe(this.userFilesStorage,this.convertOperationToReplayValue),this.apisStorage=new yke(this.isApiPersisted?this.userFilesStorage:a)}activeEnvironmentIdStorage;tabsStateStorage;environmentsStorage;collectionsStorage;apisStorage;localStorageSecretsProvider;persistExcludedIds=new Set;watchExcludedIds=new Set;addPersistExcludedId(e){this.persistExcludedIds.add(e),this.userFilesStorage.setWriteExcludedKeys(new Set([...this.persistExcludedIds]))}removePersistExcludedId(e){this.persistExcludedIds.delete(e),this.userFilesStorage.setWriteExcludedKeys(new Set([...this.persistExcludedIds]))}addWatchExcludedId(e){this.watchExcludedIds.add(e)}removeWatchExcludedId(e){this.watchExcludedIds.delete(e)}isWatchExcluded(e){return this.watchExcludedIds.has(e)}async update(e,r){switch(e.path[0]){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 KP={exports:{}},uq;function aMe(){return uq||(uq=1,(function(t){var e=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(l,c,u){this.fn=l,this.context=c,this.once=u||!1}function o(l,c,u,d,p){if(typeof u!="function")throw new TypeError("The listener must be a function");var h=new i(u,d||l,p),g=r?r+c:c;return l._events[g]?l._events[g].fn?l._events[g]=[l._events[g],h]:l._events[g].push(h):(l._events[g]=h,l._eventsCount++),l}function s(l,c){--l._eventsCount===0?l._events=new n:delete l._events[c]}function a(){this._events=new n,this._eventsCount=0}a.prototype.eventNames=function(){var c=[],u,d;if(this._eventsCount===0)return c;for(d in u=this._events)e.call(u,d)&&c.push(r?d.slice(1):d);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(u)):c},a.prototype.listeners=function(c){var u=r?r+c:c,d=this._events[u];if(!d)return[];if(d.fn)return[d.fn];for(var p=0,h=d.length,g=new Array(h);p<h;p++)g[p]=d[p].fn;return g},a.prototype.listenerCount=function(c){var u=r?r+c:c,d=this._events[u];return d?d.fn?1:d.length:0},a.prototype.emit=function(c,u,d,p,h,g){var m=r?r+c:c;if(!this._events[m])return!1;var y=this._events[m],O=arguments.length,v,b;if(y.fn){switch(y.once&&this.removeListener(c,y.fn,void 0,!0),O){case 1:return y.fn.call(y.context),!0;case 2:return y.fn.call(y.context,u),!0;case 3:return y.fn.call(y.context,u,d),!0;case 4:return y.fn.call(y.context,u,d,p),!0;case 5:return y.fn.call(y.context,u,d,p,h),!0;case 6:return y.fn.call(y.context,u,d,p,h,g),!0}for(b=1,v=new Array(O-1);b<O;b++)v[b-1]=arguments[b];y.fn.apply(y.context,v)}else{var S=y.length,x;for(b=0;b<S;b++)switch(y[b].once&&this.removeListener(c,y[b].fn,void 0,!0),O){case 1:y[b].fn.call(y[b].context);break;case 2:y[b].fn.call(y[b].context,u);break;case 3:y[b].fn.call(y[b].context,u,d);break;case 4:y[b].fn.call(y[b].context,u,d,p);break;default:if(!v)for(x=1,v=new Array(O-1);x<O;x++)v[x-1]=arguments[x];y[b].fn.apply(y[b].context,v)}}return!0},a.prototype.on=function(c,u,d){return o(this,c,u,d,!1)},a.prototype.once=function(c,u,d){return o(this,c,u,d,!0)},a.prototype.removeListener=function(c,u,d,p){var h=r?r+c:c;if(!this._events[h])return this;if(!u)return s(this,h),this;var g=this._events[h];if(g.fn)g.fn===u&&(!p||g.once)&&(!d||g.context===d)&&s(this,h);else{for(var m=0,y=[],O=g.length;m<O;m++)(g[m].fn!==u||p&&!g[m].once||d&&g[m].context!==d)&&y.push(g[m]);y.length?this._events[h]=y.length===1?y[0]:y: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})(KP)),KP.exports}var lMe=aMe();const cMe=ti(lMe);class kG extends Error{constructor(e){super(e),this.name="TimeoutError"}}let uMe=class extends Error{constructor(e){super(),this.name="AbortError",this.message=e}};const dq=t=>globalThis.DOMException===void 0?new uMe(t):new DOMException(t),fq=t=>{const e=t.reason===void 0?dq("This operation was aborted."):t.reason;return e instanceof Error?e:dq(e)};function dMe(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(fq(l)),l.addEventListener("abort",()=>{a(fq(l))})}i=n.customTimers.setTimeout.call(void 0,()=>{const l=`Promise timed out after ${e} milliseconds`,c=r instanceof Error?r:new kG(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 fMe(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 Nc=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)},_a;class pMe{constructor(){_a.set(this,[])}enqueue(e,r){r={priority:0,...r};const n={priority:r.priority,run:e};if(this.size&&Nc(this,_a,"f")[this.size-1].priority>=r.priority){Nc(this,_a,"f").push(n);return}const i=fMe(Nc(this,_a,"f"),n,(o,s)=>s.priority-o.priority);Nc(this,_a,"f").splice(i,0,n)}dequeue(){const e=Nc(this,_a,"f").shift();return e?.run}filter(e){return Nc(this,_a,"f").filter(r=>r.priority===e.priority).map(r=>r.run)}get size(){return Nc(this,_a,"f").length}}_a=new WeakMap;var _r=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},Ge=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)},Br,qh,zh,Ul,L0,Vh,Dv,Ko,gh,Hi,Nv,to,Uh,Ml,Mv,pq,hq,TG,mq,gq,Lv,eC,tC,q0,EG,qv;class AG extends Error{}class hMe extends cMe{constructor(e){var r,n,i,o;if(super(),Br.add(this),qh.set(this,void 0),zh.set(this,void 0),Ul.set(this,0),L0.set(this,void 0),Vh.set(this,void 0),Dv.set(this,0),Ko.set(this,void 0),gh.set(this,void 0),Hi.set(this,void 0),Nv.set(this,void 0),to.set(this,0),Uh.set(this,void 0),Ml.set(this,void 0),Mv.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:pMe,...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})`);_r(this,qh,e.carryoverConcurrencyCount,"f"),_r(this,zh,e.intervalCap===Number.POSITIVE_INFINITY||e.interval===0,"f"),_r(this,L0,e.intervalCap,"f"),_r(this,Vh,e.interval,"f"),_r(this,Hi,new e.queueClass,"f"),_r(this,Nv,e.queueClass,"f"),this.concurrency=e.concurrency,this.timeout=e.timeout,_r(this,Mv,e.throwOnTimeout===!0,"f"),_r(this,Ml,e.autoStart===!1,"f")}get concurrency(){return Ge(this,Uh,"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})`);_r(this,Uh,e,"f"),Ge(this,Br,"m",q0).call(this)}async add(e,r={}){return r={timeout:this.timeout,throwOnTimeout:Ge(this,Mv,"f"),...r},new Promise((n,i)=>{Ge(this,Hi,"f").enqueue(async()=>{var o,s,a;_r(this,to,(s=Ge(this,to,"f"),s++,s),"f"),_r(this,Ul,(a=Ge(this,Ul,"f"),a++,a),"f");try{if(!((o=r.signal)===null||o===void 0)&&o.aborted)throw new AG("The task was aborted.");let l=e({signal:r.signal});r.timeout&&(l=dMe(Promise.resolve(l),r.timeout)),r.signal&&(l=Promise.race([l,Ge(this,Br,"m",EG).call(this,r.signal)]));const c=await l;n(c),this.emit("completed",c)}catch(l){if(l instanceof kG&&!r.throwOnTimeout){n();return}i(l),this.emit("error",l)}finally{Ge(this,Br,"m",TG).call(this)}},r),this.emit("add"),Ge(this,Br,"m",Lv).call(this)})}async addAll(e,r){return Promise.all(e.map(async n=>this.add(n,r)))}start(){return Ge(this,Ml,"f")?(_r(this,Ml,!1,"f"),Ge(this,Br,"m",q0).call(this),this):this}pause(){_r(this,Ml,!0,"f")}clear(){_r(this,Hi,new(Ge(this,Nv,"f")),"f")}async onEmpty(){Ge(this,Hi,"f").size!==0&&await Ge(this,Br,"m",qv).call(this,"empty")}async onSizeLessThan(e){Ge(this,Hi,"f").size<e||await Ge(this,Br,"m",qv).call(this,"next",()=>Ge(this,Hi,"f").size<e)}async onIdle(){Ge(this,to,"f")===0&&Ge(this,Hi,"f").size===0||await Ge(this,Br,"m",qv).call(this,"idle")}get size(){return Ge(this,Hi,"f").size}sizeBy(e){return Ge(this,Hi,"f").filter(e).length}get pending(){return Ge(this,to,"f")}get isPaused(){return Ge(this,Ml,"f")}}qh=new WeakMap,zh=new WeakMap,Ul=new WeakMap,L0=new WeakMap,Vh=new WeakMap,Dv=new WeakMap,Ko=new WeakMap,gh=new WeakMap,Hi=new WeakMap,Nv=new WeakMap,to=new WeakMap,Uh=new WeakMap,Ml=new WeakMap,Mv=new WeakMap,Br=new WeakSet,pq=function(){return Ge(this,zh,"f")||Ge(this,Ul,"f")<Ge(this,L0,"f")},hq=function(){return Ge(this,to,"f")<Ge(this,Uh,"f")},TG=function(){var e;_r(this,to,(e=Ge(this,to,"f"),e--,e),"f"),Ge(this,Br,"m",Lv).call(this),this.emit("next")},mq=function(){Ge(this,Br,"m",tC).call(this),Ge(this,Br,"m",eC).call(this),_r(this,gh,void 0,"f")},gq=function(){const e=Date.now();if(Ge(this,Ko,"f")===void 0){const r=Ge(this,Dv,"f")-e;if(r<0)_r(this,Ul,Ge(this,qh,"f")?Ge(this,to,"f"):0,"f");else return Ge(this,gh,"f")===void 0&&_r(this,gh,setTimeout(()=>{Ge(this,Br,"m",mq).call(this)},r),"f"),!0}return!1},Lv=function(){if(Ge(this,Hi,"f").size===0)return Ge(this,Ko,"f")&&clearInterval(Ge(this,Ko,"f")),_r(this,Ko,void 0,"f"),this.emit("empty"),Ge(this,to,"f")===0&&this.emit("idle"),!1;if(!Ge(this,Ml,"f")){const e=!Ge(this,Br,"a",gq);if(Ge(this,Br,"a",pq)&&Ge(this,Br,"a",hq)){const r=Ge(this,Hi,"f").dequeue();return r?(this.emit("active"),r(),e&&Ge(this,Br,"m",eC).call(this),!0):!1}}return!1},eC=function(){Ge(this,zh,"f")||Ge(this,Ko,"f")!==void 0||(_r(this,Ko,setInterval(()=>{Ge(this,Br,"m",tC).call(this)},Ge(this,Vh,"f")),"f"),_r(this,Dv,Date.now()+Ge(this,Vh,"f"),"f"))},tC=function(){Ge(this,Ul,"f")===0&&Ge(this,to,"f")===0&&Ge(this,Ko,"f")&&(clearInterval(Ge(this,Ko,"f")),_r(this,Ko,void 0,"f")),_r(this,Ul,Ge(this,qh,"f")?Ge(this,to,"f"):0,"f"),Ge(this,Br,"m",q0).call(this)},q0=function(){for(;Ge(this,Br,"m",Lv).call(this););},EG=async function(e){return new Promise((r,n)=>{e.addEventListener("abort",()=>{n(new AG("The task was aborted."))},{once:!0})})},qv=async function(e,r){return new Promise(n=>{const i=()=>{r&&!r()||(this.off(e,i),n())};this.on(e,i)})};const oa=window.__TAURI__?.http.fetch??globalThis.fetch;class IG extends Gx{constructor(){super()}resolveExternalRef(e,r){return Qv(r)?r:e&&Qv(e)?new URL(r,e).href:e?lu.resolve(lu.dirname(e),r):r}async loadExternalRef(e){if(Qv(e)){const{body:r,mimeType:n}=await bV(e,{...this.config.http,customFetch:oa});return new hf(e,r,n)}else{if(!await xS(e))throw new Error(`File not found at ${e}.`);try{throw await rI(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 bS(e);return new hf(e,n.replace(/\r\n/g,`
|
|
350
|
-
`))}}}async function z0(t,e){const r=new Bx({});r.getRulesForSpecVersion=()=>[];const n=await Wt.dirname(t),i={config:r,base:n,externalRefResolver:new IG,dereference:!0};e?i.doc={source:{absoluteRef:t},parsed:e}:i.ref=t;const{bundle:{parsed:o},fileDependencies:s}=await OW(i);return{definition:o,fileDependencies:s}}class mMe{constructor(e){this.apisStorage=e}data=new Map;loading=new Set;pQueue=new hMe({concurrency:20});async get(e){return this.data.has(e)?this.data.get(e)??null:(await this.loadAndParse(e),this.data.get(e)??null)}async load(e,r=!1){this.data.has(e)&&!r||await this.loadAndParse(e,r)}async loadAndParse(e,r=!1){if(this.loading.has(e)){await this.pQueue.add(()=>this.get(e));return}r&&this.data.delete(e),this.loading.add(e),await this.pQueue.add(async()=>{const n=Po(e)?Ln.WEB:Ln.FS,i=n===Ln.WEB?e:await this.apisStorage.getAbsolutePath(e);try{const{definition:o,fileDependencies:s}=await z0(i);if(!o){this.data.set(e,null);return}const a=this.apisStorage.parse({uri:e,type:n,content:o});this.data.set(e,{...a,fileDependencies:s})}catch(o){if(this.data.set(e,null),o instanceof Error&&(o.message.includes("Unsupported specification")||o.message.includes("File not found")))return;console.error("Error loading api "+e,o);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!==null)}clear(){this.data.clear(),this.loading.clear()}}class gMe extends $G{apiLoader;constructor(e,r,n){const i=new sk(e.systemFilesDir),o=new sk(e.userFilesDir);super(i,o,e,!0,r,n),this.apiLoader=new mMe(this.apisStorage),this.setupWriteListeners(o)}setupWriteListeners(e){e.on("write-start",r=>{this.addWatchExcludedId(r)}),e.on("write-end",r=>{this.removeWatchExcludedId(r)})}async read(){const e=this.telemetry?.startSpan("storage.read",void 0,void 0),r=this.telemetry?.startSpan("storage.loadUserState",{},e?.parentCtx),[n,i,o]=await Promise.all([this.activeEnvironmentIdStorage.read(),this.tabsStateStorage.read(),this.environmentsStorage.read()]);r?.setAttribute("status","completed"),r?.setAttribute("environmentCount",o.length),r?.setStatus(exports.SpanStatusCode.OK),r?.end();const{apiFiles:s,collectionFiles:a}=await this.detectProjectFiles(e);await this.loadAndParseApis(s,e);const c=(await this.loadAndParseCollections(a,e)).filter(d=>d!==null);this.collectionsStorage.setItemIds(c.map(d=>d.id));const u=this.apiLoader.getAll();return this.apisStorage.setItemIds(u.map(d=>d.id)),e?.setAttribute("status","completed"),e?.setStatus(exports.SpanStatusCode.OK),e?.end(),{project:this.project,activeEnvironmentId:n,tabsState:i,environments:o,apis:u,collections:c}}async detectProjectFiles(e){const r=this.telemetry?.startSpan("storage.detectFiles",{},e?.parentCtx),{api_files:n,collection_files:i}=await Cr("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}}readEnviroments(){return this.environmentsStorage.read()}deleteApiFromCache(e){this.apiLoader.delete(e)}async loadAndParseApis(e,r,n=!1){const i=this.telemetry?.startSpan("storage.parseApis",{apisCount:e.length},r?.parentCtx),o=await rN(e,20,async s=>{try{return await this.apiLoader.load(s.relative_path,n),this.apiLoader.get(s.relative_path)}catch(a){return console.error(`Error parsing YAML/JSON file ${s.absolute_path}:`,a),null}});return i?.setAttribute("status","completed"),i?.setAttribute("parsedApisCount",this.apiLoader.size),i?.setStatus(exports.SpanStatusCode.OK),i?.end(),o}async loadAndParseCollections(e,r){const n=this.telemetry?.startSpan("storage.parseCollections",{collectionsCount:e.length},r?.parentCtx),i=await rN(e,20,async o=>{try{const s=await this.userFilesStorage.get(o.relative_path);if(!s)return null;const a=tl.load(s);if(typeof a!="object"||a===null||typeof a.arazzo!="string")return null;const l=[];await Promise.all(a.sourceDescriptions?.map(async u=>{const d=u.type,p=u.url,h=!d||d==="openapi",g=await gG({projectPath:this.project.userFilesDir,apiUrl:p,collectionId:o.relative_path});if(h){const m=await this.apiLoader.get(g);m&&l.push(m)}}));const c=await Wt.join(this.project.userFilesDir,o.relative_path);return await this.collectionsStorage.parse({uri:o.relative_path,type:Ln.FS,content:a,fileDependencies:new Set([c])},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}}class VT{constructor(e){this.baseDir=e}writeExcludedKeys=new Set;setWriteExcludedKeys(e){this.writeExcludedKeys=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 has(e){const r=this.makeKey(e);return localStorage.getItem(r)!==null}async set(e,r){if(this.writeExcludedKeys.has(e))return;const n=this.makeKey(e);localStorage.setItem(n,r)}async remove(e){if(this.writeExcludedKeys.has(e))return;const r=this.makeKey(e);localStorage.removeItem(r)}async rename(e,r){const n=this.makeKey(e),i=this.makeKey(r),o=localStorage.getItem(n);o!==null&&(localStorage.setItem(i,o),localStorage.removeItem(n))}makeKey(e){return`replay:fs:${this.baseDir}/${e}`}on(e,r){}off(e,r){}}class yMe extends $G{constructor(e,r,n){const i=new VT(e.systemFilesDir),o=new VT(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=tl.load(c);if(typeof u=="object"&&u!==null)if(typeof u.openapi=="string"){const d=await Wt.resolve(await Wt.join(this.userFilesStorage.baseDir,l)),{definition:p}=await z0(d,u);o.push({uri:l,type:Ln.FS,content:p})}else typeof u.arazzo=="string"&&(s.push({uri:l,type:Ln.FS,content:u}),u.sourceDescriptions?.forEach(d=>{const p=d.type,h=d.url,g=!p||p==="openapi",m=typeof h=="string"&&Po(h);g&&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{definition:s}=await z0(o);i.push({uri:o,type:Ln.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]=await Promise.all([this.activeEnvironmentIdStorage.read(),this.tabsStateStorage.read(),this.environmentsStorage.read()]);r?.setAttribute("status","completed"),r?.setAttribute("environmentCount",o.length),r?.setStatus(exports.SpanStatusCode.OK),r?.end();const{apiFiles:s,collectionFiles:a,apiUrls:l}=await this.detectProjectFiles(e),c=await this.loadApis(l,e),u=await this.parseApis([...s,...c],e);this.apisStorage.setItemIds(u.map(p=>p.id));const d=await this.parseCollections(a,u,e);return this.collectionsStorage.setItemIds(d.map(p=>p.id)),e?.setAttribute("status","completed"),e?.setStatus(exports.SpanStatusCode.OK),e?.end(),{project:this.project,activeEnvironmentId:n,tabsState:i,environments:o,apis:u,collections:d}}}var yq;(function(t){t.WINDOW_RESIZED="tauri://resize",t.WINDOW_MOVED="tauri://move",t.WINDOW_CLOSE_REQUESTED="tauri://close-requested",t.WINDOW_DESTROYED="tauri://destroyed",t.WINDOW_FOCUS="tauri://focus",t.WINDOW_BLUR="tauri://blur",t.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",t.WINDOW_THEME_CHANGED="tauri://theme-changed",t.WINDOW_CREATED="tauri://window-created",t.WEBVIEW_CREATED="tauri://webview-created",t.DRAG_ENTER="tauri://drag-enter",t.DRAG_OVER="tauri://drag-over",t.DRAG_DROP="tauri://drag-drop",t.DRAG_LEAVE="tauri://drag-leave"})(yq||(yq={}));async function OMe(t,e){await Cr("plugin:event|unlisten",{event:t,eventId:e})}async function vMe(t,e,r){var n;const i=(n=void 0)!==null&&n!==void 0?n:{kind:"Any"};return Cr("plugin:event|listen",{event:t,target:i,handler:fke(e)}).then(o=>async()=>OMe(t,o))}class bMe{constructor(e,r,n){this.storage=e,this.state=r,this.projectDir=n}watchPath=null;unlistenEvent=null;get tauriStorage(){return this.storage}async start(){if(this.watchPath){console.warn("Watcher already started for:",this.watchPath);return}try{this.unlistenEvent=await vMe("fs-watch-event",async e=>{const r=e.payload;try{await this.handleEvent(r)}catch(n){console.error("Error handling file change:",n)}}),await Cr("fs_watch",{path:this.projectDir,options:{recursive:!0,delayMs:500}}),this.watchPath=this.projectDir}catch(e){throw console.error("Failed to start file watcher:",e),this.unlistenEvent&&(this.unlistenEvent(),this.unlistenEvent=null),e}}async stop(){if(this.watchPath)try{await Cr("fs_unwatch",{path:this.watchPath})}catch(e){console.error("Error stopping file watcher:",e)}finally{this.unlistenEvent&&(this.unlistenEvent(),this.unlistenEvent=null),this.watchPath=null}}async handleEvent(e){const{changeType:r,paths:n,pathTypes:i,type:o}=e;if(await this.isProjectFolderRemoved(n,r)){await this.handleProjectFolderRemoval();return}const s=this.filterSpecFiles(n,i);if(s.paths.length===0)return;const a=await this.toFileEntries(s.paths,s.pathTypes);switch(r){case"changed":(o.includes("Data")||o.includes("Name"))&&await this.handleModify(a);break;case"added":await this.handleCreate(a);break;case"deleted":await this.handleDelete(a);break;case"renamed":await this.handleRename(a);break;default:console.log("Unhandled change type:",r)}}filterSpecFiles(e,r){const n=[],i=[];for(let o=0;o<e.length;o++){const s=e[o],a=s.split(".").pop()?.toLowerCase();a&&["yaml","yml","json"].includes(a)&&(n.push(s),i.push(r[o]||"unknown"))}return{paths:n,pathTypes:i}}async toFileEntries(e,r){return Promise.all(e.map(async(n,i)=>({relative_path:await Wt.relative(this.projectDir,n),absolute_path:n,type:r[i]||"unknown"})))}consolidateFileEntries(e){const r=[],n=new Set;for(const i of e)n.has(i.relative_path)||(n.add(i.relative_path),this.storage.isWatchExcluded(i.relative_path)||r.push(i));return r}async handleModify(e){const r=!this.storage.isWatchExcluded("replay-environments.yaml")&&e.some(h=>h.relative_path==="replay-environments.yaml"),n=e.filter(h=>h.relative_path!=="replay-environments.yaml"),{newApiFiles:i,existingApiFiles:o}=this.categorizeApisFromFiles(n),{newCollectionFiles:s,existingCollectionFiles:a}=this.categorizeCollectionsFromFiles(n),l=this.findApisToReload(e),c=this.findCollectionsToReload(e),u=[...i,...s];u.length>0&&await this.handleCreate(u),r&&await this.reloadEnvironments();const d=this.consolidateFileEntries([...o,...l]),p=this.consolidateFileEntries([...a,...c]);await this.reloadApis(d),await this.reloadCollections(p)}async handleCreate(e){const r=e.filter(l=>l.type==="api"),n=e.filter(l=>l.type==="collection"),{newApiFiles:i,existingApiFiles:o}=this.categorizeApisFromFiles(r),{newCollectionFiles:s,existingCollectionFiles:a}=this.categorizeCollectionsFromFiles(n);if(i.length>0||s.length>0){i.forEach(u=>this.storage.addPersistExcludedId(u.relative_path)),s.forEach(u=>this.storage.addPersistExcludedId(u.relative_path));const l=i.length>0?await this.tauriStorage.loadAndParseApis(i,void 0,!0):[],c=s.length>0?await this.tauriStorage.loadAndParseCollections(s,void 0):[];this.state.apis.merge(l.filter(u=>u!==null)),this.state.collections.merge(c.filter(u=>u!==null)),setTimeout(()=>{i.forEach(u=>this.storage.removePersistExcludedId(u.relative_path)),s.forEach(u=>this.storage.removePersistExcludedId(u.relative_path))},500)}o.length>0&&await this.reloadApis(o),a.length>0&&await this.reloadCollections(a)}categorizeApisFromFiles(e){const r=new Set,n=[],i=[];for(const o of e){if(r.has(o.relative_path))continue;r.add(o.relative_path),this.state.apis.get({noproxy:!0}).some(a=>a.id===o.relative_path)?i.push(o):o.type==="api"&&n.push(o)}return{newApiFiles:n,existingApiFiles:i}}categorizeCollectionsFromFiles(e){const r=new Set,n=[],i=[];for(const o of e){if(r.has(o.relative_path))continue;r.add(o.relative_path),this.state.collections.get({noproxy:!0}).some(a=>a.id===o.relative_path)?i.push(o):o.type==="collection"&&n.push(o)}return{newCollectionFiles:n,existingCollectionFiles:i}}async handleDelete(e){for(const r of e){this.storage.addPersistExcludedId(r.relative_path);const n=this.state.apis.get({noproxy:!0}).findIndex(o=>o.id===r.relative_path);n>=0&&(this.state.apis[n].set(Ot),this.tauriStorage.deleteApiFromCache(r.relative_path));const i=this.state.collections.get({noproxy:!0}).findIndex(o=>o.id===r.relative_path);i>=0&&this.state.collections[i].set(Ot),setTimeout(()=>{this.storage.removePersistExcludedId(r.relative_path)},500)}}async handleRename(e){if(e.length>=2){const[r,n]=e;await this.handleDelete([r]),await this.handleCreate([n])}else await this.handleCreate(e)}async isProjectFolderRemoved(e,r){if(e.length===0)return!1;if(r==="deleted"||r==="renamed"){for(const i of e)if(i===this.projectDir)return!0}return e.filter(i=>!i.startsWith(this.projectDir+"/")&&i!==this.projectDir).length>0&&r==="renamed"}async handleProjectFolderRemoval(){const e=this.state.apis.get({noproxy:!0});e.forEach(n=>{this.storage.addPersistExcludedId(n.id),this.tauriStorage.deleteApiFromCache(n.id)}),this.state.apis.set([]);const r=this.state.collections.get({noproxy:!0});r.forEach(n=>{this.storage.addPersistExcludedId(n.id)}),this.state.collections.set([]),setTimeout(()=>{e.forEach(n=>this.storage.removePersistExcludedId(n.id)),r.forEach(n=>this.storage.removePersistExcludedId(n.id))},500),await this.stop()}findApisToReload(e){const r=[];return this.state.apis.forEach(n=>{const i=n.fileDependencies?.get({noproxy:!0})??new Set,o=n.get({noproxy:!0}).id,s=e.find(a=>i.has(a.absolute_path));!this.storage.isWatchExcluded(o)&&s&&r.push(s)}),r}findCollectionsToReload(e){const r=[];return this.state.collections.forEach(n=>{const i=n.fileDependencies?.get({noproxy:!0})??new Set,o=n.get({noproxy:!0}).id,s=e.find(a=>i.has(a.absolute_path));!this.storage.isWatchExcluded(o)&&s&&r.push(s)}),r}async reloadEnvironments(){const e=await this.tauriStorage.readEnviroments();this.storage.addPersistExcludedId("replay-environments.yaml"),this.state.environments.set(e),setTimeout(()=>{this.storage.removePersistExcludedId("replay-environments.yaml")},500)}async reloadApis(e){if(e.length===0)return;const r=await this.tauriStorage.loadAndParseApis(e,void 0,!0);await Promise.all(r.map(async(n,i)=>{if(!n){await this.handleDelete([e[i]]);return}const o=this.state.apis.get({noproxy:!0}).findIndex(s=>s.id===n.id);o>=0?(this.storage.addPersistExcludedId(n.id),this.state.apis[o].set(n),setTimeout(()=>this.storage.removePersistExcludedId(n.id),500)):console.warn("API not found in state after reload:",n.id)}))}async reloadCollections(e){if(e.length===0)return;const r=await this.tauriStorage.loadAndParseCollections(e,void 0);await Promise.all(r.map(async(n,i)=>{if(!n){await this.handleDelete([e[i]]);return}const o=this.state.collections.get({noproxy:!0}).findIndex(s=>s.id===n.id);o>=0?(this.storage.addPersistExcludedId(n.id),this.state.collections[o].set(n),setTimeout(()=>this.storage.removePersistExcludedId(n.id),500)):console.warn("Collection not found in state after reload:",n.id)}))}}function RG(t=!1){let e,r=!1,n=null,i=null;async function o(){if(!(!hn()||!e||!i)){await s();try{const l=i.project.userFilesDir.get();n=new bMe(e,i,l),await n.start()}catch(l){console.error("Failed to start file watcher:",l),n=null}}}async function s(){n&&(await n.stop(),n=null)}async function a(){hn()&&(await s(),await Cr("cleanup_all_managed_watchers"))}return()=>({id:"RootStoragePlugin",onCreate:()=>({cleanup:()=>async()=>{await a()},init:l=>async(c,u,d)=>{if(r||l.path.length>0)return{isInitialized:!1};if(r=!0,i=l,!t){e=hn()?new gMe(c,u,d):new yMe(c,u,d);const p=await e.read();l.merge(p)}return r=!1,hn()&&!t&&await o(),{isInitialized:!0}}}),onSet(l,c,u){r||t||e.update(c,u)},onDestroy:async()=>{await a()}})}function jG({defaultEnvironments:t}={}){return structuredClone({project:{id:"default",userFilesDir:"default",systemFilesDir:"default"},tabsState:ra(rk),activeEnvironmentId:mg,environments:t||QF,collections:[],apis:[],requestController:null,apps:{apps:[],appsLoadingState:Ns.Idle},predefinedApiId:null,predefinedEnvironmentNames:new Set,predefinedInputNames:new Set})}const xMe=sV(jG(),aV(dke({key:"replay-root-store"}),RG())),aR=P.createContext(xMe),SMe=aR.Provider;function vt(){const t=P.useContext(aR);return lV(t)}function wMe(){return{theme:"light",disableCollectionsTab:!1,oAuth2RedirectURI:null,corsProxyUrl:void 0,certificates:[],isApiBased:!1,generatedEnvironments:[],generatedInputs:[],hideOtherSecuritySchemes:!1,aiEnabled:!1}}const PMe=wMe(),CMe=P.createContext(PMe);function Lo(){const t=P.useContext(CMe);return lV(t)}function $Me(t,e){const{apps:{apiId:r}}=vt(),{corsProxyUrl:n,disableCollectionsTab:i,oAuth2RedirectURI:o,certificates:s,storageKey:a,isApiBased:l,aiEnabled:c}=Lo();n.set(t?.corsProxyUrl??Z$e),r.set(t?.apiId),o.set(t?.oAuth2RedirectURI),i.set(!!t?.disableCollectionsTab),a.set(t?.storageKey),l.set(!!e),c.set(!!t?.aiEnabled),P.useEffect(()=>{s.set(t?.certificates||[])},[t?.certificates])}const VS=P.createContext({});function Nu(){return P.useContext(VS)||{}}const _G=process.env.NODE_ENV==="development",kMe=process.env.NODE_ENV==="production",TMe="0.22.0-next.8",EMe={version:TMe};class QG{_client;_isInitialized=!1;_initResolve=null;_initPromise=new Promise(e=>{this._initResolve=e});_globalAttributes={platform:"",deviceId:""};constructor(){this._client=new F$e}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=e?.tracerName||"desktop",n=e?.enableErrorInstrumentation??r==="desktop",i={serviceName:"replay",serviceVersion:EMe.version,version:"1.0.0",tracerName:r,collectorUrl:"",isProd:kMe,enableErrorInstrumentation:n};this._client.init({otel:{...i,...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=Array.isArray(r)?r.map(i=>({...this._globalAttributes,...i})):{...this._globalAttributes,...r};_G&&console.log(`[Telemetry] ${e}:`,JSON.stringify(n,null,2));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 Ud=new QG;function st(){const{telemetry:t}=Nu();return Ud.isInitialized||Ud.init(t),{sendEvent:(e,r)=>{Ud.sendEvent(e,r)},startSpan:(e,r,n)=>Ud.startSpan(e,r,n)}}const AMe=({awaitInit:t=!0}={})=>{const[e,r]=P.useState(void 0);return P.useEffect(()=>{(async()=>{const i=t?await Ud.awaitInit():Ud;r(i)})()},[t]),e},Kn=800,Oi=k.default(j.Button).attrs({variant:"text",size:"small",tone:"danger"})`
|
|
350
|
+
`))}}}async function z0(t,e){const r=new Bx({});r.getRulesForSpecVersion=()=>[];const n=await Wt.dirname(t),i={config:r,base:n,externalRefResolver:new IG,dereference:!0};e?i.doc={source:{absoluteRef:t},parsed:e}:i.ref=t;const{bundle:{parsed:o},fileDependencies:s}=await OW(i);return{definition:o,fileDependencies:s}}class mMe{constructor(e){this.apisStorage=e}data=new Map;loading=new Set;pQueue=new hMe({concurrency:20});async get(e){return this.data.has(e)?this.data.get(e)??null:(await this.loadAndParse(e),this.data.get(e)??null)}async load(e,r=!1){this.data.has(e)&&!r||await this.loadAndParse(e,r)}async loadAndParse(e,r=!1){if(this.loading.has(e)){await this.pQueue.add(()=>this.get(e));return}r&&this.data.delete(e),this.loading.add(e),await this.pQueue.add(async()=>{const n=Po(e)?Ln.WEB:Ln.FS,i=n===Ln.WEB?e:await this.apisStorage.getAbsolutePath(e);try{const{definition:o,fileDependencies:s}=await z0(i);if(!o){this.data.set(e,null);return}const a=this.apisStorage.parse({uri:e,type:n,content:o});this.data.set(e,{...a,fileDependencies:s})}catch(o){if(this.data.set(e,null),o instanceof Error&&(o.message.includes("Unsupported specification")||o.message.includes("File not found")))return;console.error("Error loading api "+e,o);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!==null)}clear(){this.data.clear(),this.loading.clear()}}class gMe extends $G{apiLoader;constructor(e,r,n){const i=new sk(e.systemFilesDir),o=new sk(e.userFilesDir);super(i,o,e,!0,r,n),this.apiLoader=new mMe(this.apisStorage),this.setupWriteListeners(o)}setupWriteListeners(e){e.on("write-start",r=>{this.addWatchExcludedId(r)}),e.on("write-end",r=>{this.removeWatchExcludedId(r)})}async read(){const e=this.telemetry?.startSpan("storage.read",void 0,void 0),r=this.telemetry?.startSpan("storage.loadUserState",{},e?.parentCtx),[n,i,o]=await Promise.all([this.activeEnvironmentIdStorage.read(),this.tabsStateStorage.read(),this.environmentsStorage.read()]);r?.setAttribute("status","completed"),r?.setAttribute("environmentCount",o.length),r?.setStatus(exports.SpanStatusCode.OK),r?.end();const{apiFiles:s,collectionFiles:a}=await this.detectProjectFiles(e);await this.loadAndParseApis(s,e);const c=(await this.loadAndParseCollections(a,e)).filter(d=>d!==null);this.collectionsStorage.setItemIds(c.map(d=>d.id));const u=this.apiLoader.getAll();return this.apisStorage.setItemIds(u.map(d=>d.id)),e?.setAttribute("status","completed"),e?.setStatus(exports.SpanStatusCode.OK),e?.end(),{project:this.project,activeEnvironmentId:n,tabsState:i,environments:o,apis:u,collections:c}}async detectProjectFiles(e){const r=this.telemetry?.startSpan("storage.detectFiles",{},e?.parentCtx),{api_files:n,collection_files:i}=await Cr("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}}readEnviroments(){return this.environmentsStorage.read()}deleteApiFromCache(e){this.apiLoader.delete(e)}async loadAndParseApis(e,r,n=!1){const i=this.telemetry?.startSpan("storage.parseApis",{apisCount:e.length},r?.parentCtx),o=await rN(e,20,async s=>{try{return await this.apiLoader.load(s.relative_path,n),this.apiLoader.get(s.relative_path)}catch(a){return console.error(`Error parsing YAML/JSON file ${s.absolute_path}:`,a),null}});return i?.setAttribute("status","completed"),i?.setAttribute("parsedApisCount",this.apiLoader.size),i?.setStatus(exports.SpanStatusCode.OK),i?.end(),o}async loadAndParseCollections(e,r){const n=this.telemetry?.startSpan("storage.parseCollections",{collectionsCount:e.length},r?.parentCtx),i=await rN(e,20,async o=>{try{const s=await this.userFilesStorage.get(o.relative_path);if(!s)return null;const a=tl.load(s);if(typeof a!="object"||a===null||typeof a.arazzo!="string")return null;const l=[];await Promise.all(a.sourceDescriptions?.map(async u=>{const d=u.type,p=u.url,h=!d||d==="openapi",g=await gG({projectPath:this.project.userFilesDir,apiUrl:p,collectionId:o.relative_path});if(h){const m=await this.apiLoader.get(g);m&&l.push(m)}}));const c=await Wt.join(this.project.userFilesDir,o.relative_path);return await this.collectionsStorage.parse({uri:o.relative_path,type:Ln.FS,content:a,fileDependencies:new Set([c])},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}}class VT{constructor(e){this.baseDir=e}writeExcludedKeys=new Set;setWriteExcludedKeys(e){this.writeExcludedKeys=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 has(e){const r=this.makeKey(e);return localStorage.getItem(r)!==null}async set(e,r){if(this.writeExcludedKeys.has(e))return;const n=this.makeKey(e);localStorage.setItem(n,r)}async remove(e){if(this.writeExcludedKeys.has(e))return;const r=this.makeKey(e);localStorage.removeItem(r)}async rename(e,r){const n=this.makeKey(e),i=this.makeKey(r),o=localStorage.getItem(n);o!==null&&(localStorage.setItem(i,o),localStorage.removeItem(n))}makeKey(e){return`replay:fs:${this.baseDir}/${e}`}on(e,r){}off(e,r){}}class yMe extends $G{constructor(e,r,n){const i=new VT(e.systemFilesDir),o=new VT(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=tl.load(c);if(typeof u=="object"&&u!==null)if(typeof u.openapi=="string"){const d=await Wt.resolve(await Wt.join(this.userFilesStorage.baseDir,l)),{definition:p}=await z0(d,u);o.push({uri:l,type:Ln.FS,content:p})}else typeof u.arazzo=="string"&&(s.push({uri:l,type:Ln.FS,content:u}),u.sourceDescriptions?.forEach(d=>{const p=d.type,h=d.url,g=!p||p==="openapi",m=typeof h=="string"&&Po(h);g&&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{definition:s}=await z0(o);i.push({uri:o,type:Ln.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]=await Promise.all([this.activeEnvironmentIdStorage.read(),this.tabsStateStorage.read(),this.environmentsStorage.read()]);r?.setAttribute("status","completed"),r?.setAttribute("environmentCount",o.length),r?.setStatus(exports.SpanStatusCode.OK),r?.end();const{apiFiles:s,collectionFiles:a,apiUrls:l}=await this.detectProjectFiles(e),c=await this.loadApis(l,e),u=await this.parseApis([...s,...c],e);this.apisStorage.setItemIds(u.map(p=>p.id));const d=await this.parseCollections(a,u,e);return this.collectionsStorage.setItemIds(d.map(p=>p.id)),e?.setAttribute("status","completed"),e?.setStatus(exports.SpanStatusCode.OK),e?.end(),{project:this.project,activeEnvironmentId:n,tabsState:i,environments:o,apis:u,collections:d}}}var yq;(function(t){t.WINDOW_RESIZED="tauri://resize",t.WINDOW_MOVED="tauri://move",t.WINDOW_CLOSE_REQUESTED="tauri://close-requested",t.WINDOW_DESTROYED="tauri://destroyed",t.WINDOW_FOCUS="tauri://focus",t.WINDOW_BLUR="tauri://blur",t.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",t.WINDOW_THEME_CHANGED="tauri://theme-changed",t.WINDOW_CREATED="tauri://window-created",t.WEBVIEW_CREATED="tauri://webview-created",t.DRAG_ENTER="tauri://drag-enter",t.DRAG_OVER="tauri://drag-over",t.DRAG_DROP="tauri://drag-drop",t.DRAG_LEAVE="tauri://drag-leave"})(yq||(yq={}));async function OMe(t,e){await Cr("plugin:event|unlisten",{event:t,eventId:e})}async function vMe(t,e,r){var n;const i=(n=void 0)!==null&&n!==void 0?n:{kind:"Any"};return Cr("plugin:event|listen",{event:t,target:i,handler:fke(e)}).then(o=>async()=>OMe(t,o))}class bMe{constructor(e,r,n){this.storage=e,this.state=r,this.projectDir=n}watchPath=null;unlistenEvent=null;get tauriStorage(){return this.storage}async start(){if(this.watchPath){console.warn("Watcher already started for:",this.watchPath);return}try{this.unlistenEvent=await vMe("fs-watch-event",async e=>{const r=e.payload;try{await this.handleEvent(r)}catch(n){console.error("Error handling file change:",n)}}),await Cr("fs_watch",{path:this.projectDir,options:{recursive:!0,delayMs:500}}),this.watchPath=this.projectDir}catch(e){throw console.error("Failed to start file watcher:",e),this.unlistenEvent&&(this.unlistenEvent(),this.unlistenEvent=null),e}}async stop(){if(this.watchPath)try{await Cr("fs_unwatch",{path:this.watchPath})}catch(e){console.error("Error stopping file watcher:",e)}finally{this.unlistenEvent&&(this.unlistenEvent(),this.unlistenEvent=null),this.watchPath=null}}async handleEvent(e){const{changeType:r,paths:n,pathTypes:i,type:o}=e;if(await this.isProjectFolderRemoved(n,r)){await this.handleProjectFolderRemoval();return}const s=this.filterSpecFiles(n,i);if(s.paths.length===0)return;const a=await this.toFileEntries(s.paths,s.pathTypes);switch(r){case"changed":(o.includes("Data")||o.includes("Name"))&&await this.handleModify(a);break;case"added":await this.handleCreate(a);break;case"deleted":await this.handleDelete(a);break;case"renamed":await this.handleRename(a);break;default:console.log("Unhandled change type:",r)}}filterSpecFiles(e,r){const n=[],i=[];for(let o=0;o<e.length;o++){const s=e[o],a=s.split(".").pop()?.toLowerCase();a&&["yaml","yml","json"].includes(a)&&(n.push(s),i.push(r[o]||"unknown"))}return{paths:n,pathTypes:i}}async toFileEntries(e,r){return Promise.all(e.map(async(n,i)=>({relative_path:await Wt.relative(this.projectDir,n),absolute_path:n,type:r[i]||"unknown"})))}consolidateFileEntries(e){const r=[],n=new Set;for(const i of e)n.has(i.relative_path)||(n.add(i.relative_path),this.storage.isWatchExcluded(i.relative_path)||r.push(i));return r}async handleModify(e){const r=!this.storage.isWatchExcluded("replay-environments.yaml")&&e.some(h=>h.relative_path==="replay-environments.yaml"),n=e.filter(h=>h.relative_path!=="replay-environments.yaml"),{newApiFiles:i,existingApiFiles:o}=this.categorizeApisFromFiles(n),{newCollectionFiles:s,existingCollectionFiles:a}=this.categorizeCollectionsFromFiles(n),l=this.findApisToReload(e),c=this.findCollectionsToReload(e),u=[...i,...s];u.length>0&&await this.handleCreate(u),r&&await this.reloadEnvironments();const d=this.consolidateFileEntries([...o,...l]),p=this.consolidateFileEntries([...a,...c]);await this.reloadApis(d),await this.reloadCollections(p)}async handleCreate(e){const r=e.filter(l=>l.type==="api"),n=e.filter(l=>l.type==="collection"),{newApiFiles:i,existingApiFiles:o}=this.categorizeApisFromFiles(r),{newCollectionFiles:s,existingCollectionFiles:a}=this.categorizeCollectionsFromFiles(n);if(i.length>0||s.length>0){i.forEach(u=>this.storage.addPersistExcludedId(u.relative_path)),s.forEach(u=>this.storage.addPersistExcludedId(u.relative_path));const l=i.length>0?await this.tauriStorage.loadAndParseApis(i,void 0,!0):[],c=s.length>0?await this.tauriStorage.loadAndParseCollections(s,void 0):[];this.state.apis.merge(l.filter(u=>u!==null)),this.state.collections.merge(c.filter(u=>u!==null)),setTimeout(()=>{i.forEach(u=>this.storage.removePersistExcludedId(u.relative_path)),s.forEach(u=>this.storage.removePersistExcludedId(u.relative_path))},500)}o.length>0&&await this.reloadApis(o),a.length>0&&await this.reloadCollections(a)}categorizeApisFromFiles(e){const r=new Set,n=[],i=[];for(const o of e){if(r.has(o.relative_path))continue;r.add(o.relative_path),this.state.apis.get({noproxy:!0}).some(a=>a.id===o.relative_path)?i.push(o):o.type==="api"&&n.push(o)}return{newApiFiles:n,existingApiFiles:i}}categorizeCollectionsFromFiles(e){const r=new Set,n=[],i=[];for(const o of e){if(r.has(o.relative_path))continue;r.add(o.relative_path),this.state.collections.get({noproxy:!0}).some(a=>a.id===o.relative_path)?i.push(o):o.type==="collection"&&n.push(o)}return{newCollectionFiles:n,existingCollectionFiles:i}}async handleDelete(e){for(const r of e){this.storage.addPersistExcludedId(r.relative_path);const n=this.state.apis.get({noproxy:!0}).findIndex(o=>o.id===r.relative_path);n>=0&&(this.state.apis[n].set(Ot),this.tauriStorage.deleteApiFromCache(r.relative_path));const i=this.state.collections.get({noproxy:!0}).findIndex(o=>o.id===r.relative_path);i>=0&&this.state.collections[i].set(Ot),setTimeout(()=>{this.storage.removePersistExcludedId(r.relative_path)},500)}}async handleRename(e){if(e.length>=2){const[r,n]=e;await this.handleDelete([r]),await this.handleCreate([n])}else await this.handleCreate(e)}async isProjectFolderRemoved(e,r){if(e.length===0)return!1;if(r==="deleted"||r==="renamed"){for(const i of e)if(i===this.projectDir)return!0}return e.filter(i=>!i.startsWith(this.projectDir+"/")&&i!==this.projectDir).length>0&&r==="renamed"}async handleProjectFolderRemoval(){const e=this.state.apis.get({noproxy:!0});e.forEach(n=>{this.storage.addPersistExcludedId(n.id),this.tauriStorage.deleteApiFromCache(n.id)}),this.state.apis.set([]);const r=this.state.collections.get({noproxy:!0});r.forEach(n=>{this.storage.addPersistExcludedId(n.id)}),this.state.collections.set([]),setTimeout(()=>{e.forEach(n=>this.storage.removePersistExcludedId(n.id)),r.forEach(n=>this.storage.removePersistExcludedId(n.id))},500),await this.stop()}findApisToReload(e){const r=[];return this.state.apis.forEach(n=>{const i=n.fileDependencies?.get({noproxy:!0})??new Set,o=n.get({noproxy:!0}).id,s=e.find(a=>i.has(a.absolute_path));!this.storage.isWatchExcluded(o)&&s&&r.push(s)}),r}findCollectionsToReload(e){const r=[];return this.state.collections.forEach(n=>{const i=n.fileDependencies?.get({noproxy:!0})??new Set,o=n.get({noproxy:!0}).id,s=e.find(a=>i.has(a.absolute_path));!this.storage.isWatchExcluded(o)&&s&&r.push(s)}),r}async reloadEnvironments(){const e=await this.tauriStorage.readEnviroments();this.storage.addPersistExcludedId("replay-environments.yaml"),this.state.environments.set(e),setTimeout(()=>{this.storage.removePersistExcludedId("replay-environments.yaml")},500)}async reloadApis(e){if(e.length===0)return;const r=await this.tauriStorage.loadAndParseApis(e,void 0,!0);await Promise.all(r.map(async(n,i)=>{if(!n){await this.handleDelete([e[i]]);return}const o=this.state.apis.get({noproxy:!0}).findIndex(s=>s.id===n.id);o>=0?(this.storage.addPersistExcludedId(n.id),this.state.apis[o].set(n),setTimeout(()=>this.storage.removePersistExcludedId(n.id),500)):console.warn("API not found in state after reload:",n.id)}))}async reloadCollections(e){if(e.length===0)return;const r=await this.tauriStorage.loadAndParseCollections(e,void 0);await Promise.all(r.map(async(n,i)=>{if(!n){await this.handleDelete([e[i]]);return}const o=this.state.collections.get({noproxy:!0}).findIndex(s=>s.id===n.id);o>=0?(this.storage.addPersistExcludedId(n.id),this.state.collections[o].set(n),setTimeout(()=>this.storage.removePersistExcludedId(n.id),500)):console.warn("Collection not found in state after reload:",n.id)}))}}function RG(t=!1){let e,r=!1,n=null,i=null;async function o(){if(!(!hn()||!e||!i)){await s();try{const l=i.project.userFilesDir.get();n=new bMe(e,i,l),await n.start()}catch(l){console.error("Failed to start file watcher:",l),n=null}}}async function s(){n&&(await n.stop(),n=null)}async function a(){hn()&&(await s(),await Cr("cleanup_all_managed_watchers"))}return()=>({id:"RootStoragePlugin",onCreate:()=>({cleanup:()=>async()=>{await a()},init:l=>async(c,u,d)=>{if(r||l.path.length>0)return{isInitialized:!1};if(r=!0,i=l,!t){e=hn()?new gMe(c,u,d):new yMe(c,u,d);const p=await e.read();l.merge(p)}return r=!1,hn()&&!t&&await o(),{isInitialized:!0}}}),onSet(l,c,u){r||t||e.update(c,u)},onDestroy:async()=>{await a()}})}function jG({defaultEnvironments:t}={}){return structuredClone({project:{id:"default",userFilesDir:"default",systemFilesDir:"default"},tabsState:ra(rk),activeEnvironmentId:mg,environments:t||QF,collections:[],apis:[],requestController:null,apps:{apps:[],appsLoadingState:Ns.Idle},predefinedApiId:null,predefinedEnvironmentNames:new Set,predefinedInputNames:new Set})}const xMe=sV(jG(),aV(dke({key:"replay-root-store"}),RG())),aR=P.createContext(xMe),SMe=aR.Provider;function vt(){const t=P.useContext(aR);return lV(t)}function wMe(){return{theme:"light",disableCollectionsTab:!1,oAuth2RedirectURI:null,corsProxyUrl:void 0,certificates:[],isApiBased:!1,generatedEnvironments:[],generatedInputs:[],hideOtherSecuritySchemes:!1,aiEnabled:!1}}const PMe=wMe(),CMe=P.createContext(PMe);function Lo(){const t=P.useContext(CMe);return lV(t)}function $Me(t,e){const{apps:{apiId:r}}=vt(),{corsProxyUrl:n,disableCollectionsTab:i,oAuth2RedirectURI:o,certificates:s,storageKey:a,isApiBased:l,aiEnabled:c}=Lo();n.set(t?.corsProxyUrl??Z$e),r.set(t?.apiId),o.set(t?.oAuth2RedirectURI),i.set(!!t?.disableCollectionsTab),a.set(t?.storageKey),l.set(!!e),c.set(!!t?.aiEnabled),P.useEffect(()=>{s.set(t?.certificates||[])},[t?.certificates])}const VS=P.createContext({});function Nu(){return P.useContext(VS)||{}}const _G=process.env.NODE_ENV==="development",kMe=process.env.NODE_ENV==="production",TMe="0.22.0",EMe={version:TMe};class QG{_client;_isInitialized=!1;_initResolve=null;_initPromise=new Promise(e=>{this._initResolve=e});_globalAttributes={platform:"",deviceId:""};constructor(){this._client=new F$e}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=e?.tracerName||"desktop",n=e?.enableErrorInstrumentation??r==="desktop",i={serviceName:"replay",serviceVersion:EMe.version,version:"1.0.0",tracerName:r,collectorUrl:"",isProd:kMe,enableErrorInstrumentation:n};this._client.init({otel:{...i,...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=Array.isArray(r)?r.map(i=>({...this._globalAttributes,...i})):{...this._globalAttributes,...r};_G&&console.log(`[Telemetry] ${e}:`,JSON.stringify(n,null,2));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 Ud=new QG;function st(){const{telemetry:t}=Nu();return Ud.isInitialized||Ud.init(t),{sendEvent:(e,r)=>{Ud.sendEvent(e,r)},startSpan:(e,r,n)=>Ud.startSpan(e,r,n)}}const AMe=({awaitInit:t=!0}={})=>{const[e,r]=P.useState(void 0);return P.useEffect(()=>{(async()=>{const i=t?await Ud.awaitInit():Ud;r(i)})()},[t]),e},Kn=800,Oi=k.default(j.Button).attrs({variant:"text",size:"small",tone:"danger"})`
|
|
351
351
|
border: none;
|
|
352
352
|
margin: 0;
|
|
353
353
|
|
|
@@ -619,7 +619,7 @@ $3`);return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}}function l5e(t){return t.
|
|
|
619
619
|
border-radius: var(--border-radius);
|
|
620
620
|
border: 1px solid var(--border-color-primary);
|
|
621
621
|
padding: 0 calc(var(--spacing-xxs) / 2);
|
|
622
|
-
`,or=(t,e,r=new Set)=>{const n=vH(t);if(!n.length)return t;let i=0;const o=n.flatMap(({start:s,end:a,name:l})=>{if(r.has(l))return null;const c=e.findLast(d=>d.name===l),u=t.slice(i,c?s:a);if(i=a,c){r.add(l);const d=or(c.value,e,r);return r.delete(l),[u.length?u:null,d||t.slice(s,a)]}return[u.length?u:null]});return t.slice(i).length&&o.push(t.slice(i)),o.join("")};function bqe(t,e){return e.find(r=>r.name===t.slice(1,-1))?.value||t}function xqe(t,e){const r=bH(t);if(!r.length)return f.jsx(Qq,{children:t});let n=0;const i=r.flatMap(({start:o,end:s})=>{const a=t.slice(n,o),l=bqe(t.slice(o,s),e);return n=s,[a.length?a:null,l]});return t.slice(n).length&&i.push(t.slice(n)),f.jsx(Qq,{children:i.join("")})}const xH="New Step";function XT({name:t=xH,workflow:e}={}){let r=t.replaceAll(" ","-").toLowerCase();if(!e)return r;const n=Sqe(e);if(n.includes(r)){let i=1;for(;n.includes(`${r}-${i}`);)i++;r=`${r}-${i}`}return r}function Sqe(t){return t.steps.filter(e=>e.state.get()!==qt.Draft).map(e=>e.stepId.get())}function vu({name:t=xH,isDraft:e=!1,fromStep:r,workflow:n,operation:i,apiOperation:o}={}){if(!r){const a=o?oR(o):null,l=[ms()];return{stepId:XT({name:t,workflow:n}),description:t,outputs:[Ao()],successCriteria:[],state:e?qt.Draft:qt.Normal,parameters:{pathParameters:[gr("path")],queryParameters:[gr("query")],headers:[gr("header")],cookies:[gr("cookie")]},requestBody:M0(),xOperation:i?null:{method:"GET",url:""},security:l,operation:i??null,...a}}const s=r.get({noproxy:!0});return{stepId:XT({name:t,workflow:n}),description:s.description,outputs:s.outputs,successCriteria:s.successCriteria,state:e?qt.Draft:qt.Normal,parameters:s.parameters,requestBody:s.requestBody,xOperation:s.xOperation,security:s.security,operation:s.operation}}function bu(t){return{method:(t.xOperation?t.xOperation.method:t.operation?.method)??"",url:(t.xOperation?t.xOperation.url:t.operation?.path)??""}}function gR(t,e,r,n){const{inputs:i,servers:o}=n,s=J5e(nc("path",[Dr(e?.parameters.pathParameters,r?.components.parameters),Dr(t.parameters.pathParameters,r?.components.parameters)]),n.inputs),a=t.xOperation??null,l=t.operation??null;let c="",u="";if(a)u=a.method,c=X3(a.url,s);else if(l){const h=o.find(m=>m.apiId===l.apiId);u=l.method==="x-query"?"query":l.method,c=(h?.value?mG(h.value,h.variables):"")+X3(l.path,s)}const d=c.split("?")[0];return{url:or(d,i),method:u.toUpperCase()}}function wqe(t){const e=t.substring(7).split(", "),r={};for(const n of e){const[i,o]=n.split("=");r[i]=o.replace(/"/g,"")}return r}function Pqe(t,e,r,n){const{inputs:i}=n,{requestBody:{content:o}}=t,{url:s,method:a}=gR(t,e,r,n),l=[...e?.security||[],...t.security].findLast(C=>C.securityType===me.DigestAuth);if(!l)return"";const{username:c,password:u,realm:d,nonce:p,cnonce:h,algorithm:g,qop:m,nc:y,opaque:O}=l[me.DigestAuth],v=or(c,i),{pathname:b,search:S}=new URL(s),x=S?`${b}${S}`:b,$=Cqe({username:v,password:or(u,i),uri:x,realm:d,nonce:p,cnonce:h,algorithm:g,qop:m,nc:y,method:a,bodyContent:o});return`Digest username="${v}", realm="${d}", nonce="${p}", uri="${x}", qop=${m}, nc=${y}, cnonce="${h}", response="${$}", algorithm=${g}${O?`, opaque="${O}"`:""}`}function Cqe(t){const{username:e,password:r,realm:n,nonce:i,cnonce:o,algorithm:s,qop:a,nc:l,uri:c,method:u,bodyContent:d}=t,p=$qe(s),h=s?.endsWith("-sess")?p(`${p(`${e}:${n}:${r}`)}:${i}:${o}`):p(`${e}:${n}:${r}`),g=a?.includes("auth-int")?p(`${u}:${c}:${p(d)}`):p(`${u}:${c}`);return p(`${h}:${i}:${l}:${o}:${a}:${g}`).toString()}function $qe(t){switch(t?.replace("-sess","")){case"SHA-256":return e=>Hh(hV(e));default:return e=>Hh(Rx(e))}}function kqe(t){try{const r=new URL(t).hostname;return r==="localhost"||r==="127.0.0.1"}catch{return!1}}function FT(t,e=window.location.origin){try{const r=new URL(t);return e===r.origin}catch{return!1}}function Tqe(t){return t?t.split(";").map(n=>n.trim()).map(n=>{const i=n.indexOf("="),o=n.slice(0,i).trim(),s=n.slice(i+1).trim();return[o,s]}):[]}const Eqe=["json","xml","html","text"],Aqe=["application/octet-stream","application/x-msdownload","application/pdf","application/zip","application/gzip","application/x-7z-compressed","application/x-tar","application/x-bzip2"];function nC(t,e){return t.get(e)??t.get(e.toLowerCase())}function Iqe(t){if(!t)return;const e=Number.parseInt(t,10);return Number.isFinite(e)?e:void 0}function Rqe(t){if(!t)return;const e=t.match(/filename\*=(?:UTF-8'')?([^;\n]+)/i);if(e?.[1])try{return decodeURIComponent(e[1].replace(/(^")|("$)/g,"").trim())}catch{return e[1].replace(/(^")|("$)/g,"").trim()}const r=t.match(/filename=([^;\n]+)/i);if(r?.[1])return r[1].replace(/(^")|("$)/g,"").trim()}function jqe(t){try{return new URL(t).pathname.split("/").filter(Boolean).pop()||void 0}catch{return}}function _qe(t,e){if(e&&/attachment|filename=/i.test(e))return!0;if(!t)return!1;const r=t.toLowerCase();return Aqe.some(n=>r.includes(n))?!0:r.startsWith("application/")?!Eqe.some(n=>r.includes(n)):!1}async function Qqe(t,e){const r=nC(t.headers,"content-type")?.split(";")[0].trim(),n=nC(t.headers,"content-disposition"),i=Iqe(nC(t.headers,"content-length")),o=_qe(r,n),s=Tqe(document.cookie);if(o){const p={fileName:Rqe(n)||jqe(t.url)||"response",contentType:r,contentLength:i,status:"pending"};return{bodyUsed:t.bodyUsed,status:t.status,headers:Array.from(t.headers.entries()),arrayBuffer:new ArrayBuffer(0),body:"",duration:e,cookies:s,size:i??0,download:p,bodyNotStored:!0,url:t.url}}const l=await t.clone().arrayBuffer(),c=new TextDecoder().decode(l),u=new Uint8Array(l).length;return{bodyUsed:t.bodyUsed,status:t.status,headers:Array.from(t.headers.entries()),arrayBuffer:l,body:c,duration:e,cookies:s,size:u,url:t.url}}const Dqe=":/?#[]@!$&'()*+,;=",Nqe=new Set(["!","'","(",")","*"]);function Mqe(t){return Nqe.has(t)?`%${t.charCodeAt(0).toString(16).toUpperCase()}`:encodeURIComponent(t)}function Dq(t,e=!1){let r=encodeURIComponent(t).replace(/[!'()*]/g,i=>`%${i.charCodeAt(0).toString(16).toUpperCase()}`);if(!e)return r;const n=[...Dqe].map(i=>({char:i,encoded:Mqe(i)}));for(const{char:i,encoded:o}of n)r=r.split(o).join(i);return r}function Nq(t){try{const e=new URL(t);return(e.protocol==="http:"&&e.port==="80"||e.protocol==="https:"&&e.port==="443")&&(e.port=""),e.hostname=e.hostname.toLowerCase(),e.protocol+"//"+e.hostname+(e.port?":"+e.port:"")}catch(e){return console.error("Invalid URL",e),null}}function SH(t,e){let r=Nq(t);const n=e.find(({host:i,port:o})=>Nq(`https://${i}:${o}`)===r);return{clientCert:n?.crtFilePath,clientKey:n?.keyFilePath}}function Lqe(t){const e=t.lastIndexOf(".");return e<=0?{baseName:t,extension:""}:{baseName:t.slice(0,e),extension:t.slice(e)}}async function qqe(t,e){const{exists:r}=await Promise.resolve().then(()=>SS),{join:n}=await Promise.resolve().then(()=>VF),{baseName:i,extension:o}=Lqe(e);let s=0;for(;;){const a=s===0?"":` (${s})`,l=`${i}${a}${o}`,c=await n(t,l);if(!await r(c))return c;s+=1}}function zqe(t){return t.split(/(\{[^}]+\}|\/)/g).filter(e=>e!=="")}function Vqe(t){if(t!=null)return t}async function wH({store:t,step:e,settings:r,workflow:n,collection:i,signal:o}){const{corsProxyUrl:s,certificates:a}=r.get(),l=op(t),{url:c,method:u}=gR(e.get(),n?.get(),i?.get(),l),d=s||"",p=$H(e,n,i,t),h=kqe(c)||FT(c),g=i4e({proxyUrl:d,resolvedUrl:c,ignoreProxy:h,queryParameters:p});await Wqe(e,n??void 0,g,o);const m=OR(e,n??void 0,i??void 0,t),y=Vqe(yR(e.get({noproxy:!0}),t)),{clientCert:O,clientKey:v}=SH(c,a||[]),S=!!g.match(/^https?:\/\//)?g:`https://${g}`,x=u.toUpperCase(),$=!OS.includes(x),C=$?"POST":x,T=$?{...m,"X-HTTP-Method-Override":x}:m;return{urlWithProxyAndProtocol:S,fetchMethod:C,fetchHeaders:T,body:y,mode:FT(S)?"same-origin":"cors",clientCert:O,clientKey:v,resolvedUrl:c}}async function Uqe(t,e,r,n){const{requestController:i}=t,s=vR(t).data;if(s.type.get()!==Ke.Step){console.warn("not an operation tab");return}const{collectionId:a,workflowId:l,response:c,requestError:u,isProcessingRequest:d}=s,p=t.collections.find(y=>y.id.get()===a.get()),h=p?.workflows.find(y=>y.workflowId.get()===l.get()),g=ra(e.get({noproxy:!0}));d.set(!0),i.get()?.abort?.(),i.set(new AbortController);const m=i.get()?.signal;try{const y=await wH({store:t,step:e,settings:r,workflow:h,collection:p,signal:m}),O=Date.now(),v={signal:m,method:y.fetchMethod,headers:y.fetchHeaders,body:y.body,mode:y.mode,clientCert:y.clientCert,clientKey:y.clientKey},b=await oa(y.urlWithProxyAndProtocol,v),S=Date.now()-O;u.set(null),c.set(await Qqe(b,S));const x=ra(c.value);n?.(g,x)}catch(y){if(c.set(null),y.name==="AbortError")return;u.set(y.message||String(y));const O=ra(c.value);n?.(g,O)}finally{d.set(!1)}}async function Bqe({store:t,step:e,settings:r,workflow:n,collection:i,fileName:o,onProgress:s}){const a=await wH({store:t,step:e,settings:r,workflow:n,collection:i}),l={method:a.fetchMethod,headers:a.fetchHeaders,body:a.body,mode:a.mode,clientCert:a.clientCert,clientKey:a.clientKey},{clientCert:c,clientKey:u}=l,d=hn(),p=o||"response";let h=null;if(d){const{open:$}=await Promise.resolve().then(()=>require("./replay-index-BIAgJWpm.js")),C=await $({directory:!0,multiple:!1});if(!C)return;const T=Array.isArray(C)?C[0]:C;h=await qqe(T,p)}const g=await oa(a.urlWithProxyAndProtocol,l),m=g.headers.get("content-length"),y=m?Number.parseInt(m,10):void 0,O=Number.isFinite(y)?y:void 0,v=g.headers.get("content-type")??void 0;let b;if(g.body?.getReader){const $=g.body.getReader(),C=[];let T=0;for(;;){const{done:I,value:Q}=await $.read();if(I)break;if(Q){const _=new Uint8Array(Q.byteLength);_.set(Q),C.push(_.buffer),T+=Q.byteLength,s?.({receivedBytes:T,totalBytes:O,done:!1})}}b=new Blob(C,{type:v}),s?.({receivedBytes:T,totalBytes:O,done:!0})}else b=await g.blob(),s?.({receivedBytes:b.size,totalBytes:O,done:!0});if(d){const{writeFile:$}=await Promise.resolve().then(()=>SS),C=new Uint8Array(await b.arrayBuffer());if(!h)return;await $(h,C);return}const S=window.URL.createObjectURL(b),x=document.createElement("a");x.href=S,x.download=p,x.rel="noopener",x.click(),window.URL.revokeObjectURL(S)}async function Wqe(t,e,r,n){const{method:i}=bu(t.get()),s=[...Array.from(e?.security||[]),...Array.from(t.security)].findLast(a=>a.securityType.get()===me.DigestAuth);if(s){const a=await oa(r,{signal:n,method:i.toUpperCase(),mode:FT(r)?"same-origin":"cors"}),l=wqe(a.headers.get("WWW-Authenticate")||"");s[me.DigestAuth].merge({nonce:l.nonce,realm:l.realm,qop:l.qop,algorithm:l.algorithm,opaque:l.opaque,cnonce:crypto.randomUUID(),nc:"00000001"})}}function Xqe(t,e,r,n){return[...e?.security.get()||[],...t.security.get()].map(i=>{switch(i.securityType){case me.BasicAuth:{const o=i[me.BasicAuth];return{id:"",key:"Authorization",value:"Basic "+btoa(`${qn(o.username,n)}:${qn(o.password,n)}`),active:!0,in:"header"}}case me.DigestAuth:{const o=op(n);return{id:"",key:"Authorization",value:Pqe(t.get(),e?.get(),r?.get(),o),active:!0,in:"header"}}case me.JWT:return{id:"",key:"Authorization",value:"Bearer "+i[me.JWT].token,active:!0,in:"header"};case me.OAuth2:{const{grantType:o}=i[me.OAuth2],{accessToken:s}=i[me.OAuth2][o];return{id:"",key:"Authorization",value:"Bearer "+s,active:!0,in:"header"}}case me.OpenIDConnect:{const{grantType:o}=i[me.OpenIDConnect],{accessToken:s}=i[me.OpenIDConnect][o];return{id:"",key:"Authorization",value:"Bearer "+s,active:!0,in:"header"}}case me.APIKey:{const o=i[me.APIKey];return o.location===oo.Header?{id:"",key:o.name,value:o.key,active:!0,in:"header"}:null}default:return null}}).filter(i=>!!i)}function Fqe(t,e,r){const{operation:n,requestBody:i,parameters:o}=e,{headers:s,cookies:a,queryParameters:l}=o;if(!r)return!0;const c=r.parameters?.filter(b=>b.in==="query"),u=r.parameters?.filter(b=>b.in==="header"),d=r.parameters?.filter(b=>b.in==="cookie"),p=n?.path!==r.path,h=r.method.toLowerCase()!==n?.method.toLowerCase(),g=r.body?.mediaTypes&&r.body?.mediaTypes?.[i.type]===void 0,m=u&&!u.every(b=>s.some(S=>!Hl(S)&&S.key===b.name)),y=d&&!d.every(b=>a.some(S=>!Hl(S)&&S.key===b.name)),O=c&&!c.every(b=>l.some(S=>!Hl(S)&&S.key===b.name)),v=uNe(t,e,r);return!p&&!h&&!g&&!m&&!y&&!O&&!v}function PH(t,e){const{requestBody:r}=t,{method:n}=bu(t),i=n.toUpperCase();if(i==="GET"||i==="HEAD"||i==="OPTIONS")return null;try{switch(r.type){case"JSON":return structuredClone(qn(r.content,e));case"multipart/form-data":return Gqe(t,e);case"application/x-www-form-urlencoded":return Yqe(t,e);case"application/octet-stream":return r.binary;default:return qn(r.content,e)}}catch(o){console.error(o)}}function yR(t,e){const{requestBody:r}=t,n=PH(t,e);if(n===null)return null;switch(r.type){default:return n;case"multipart/form-data":return Hqe(n);case"application/x-www-form-urlencoded":return Zqe(n);case"application/octet-stream":return r.binary?.file??null}}function Zqe(t){const e=new URLSearchParams;return t.forEach(({key:r,value:n})=>{e.append(r,n)}),e}function Yqe(t,e){const{requestBody:r}=t,n=[];return TH(r.formData["application/x-www-form-urlencoded"]).forEach(i=>{const o=qn(i.value,e);n.push({key:qn(i.key,e),value:o,type:"text"})}),n}function Gqe(t,e){const{requestBody:r}=t,n=[];return TH(r.formData["multipart/form-data"]).forEach(({type:i,files:o,value:s,key:a})=>{const l=qn(a,e);if(i==="file"&&o)for(const c of o)n.push({key:l,value:c,type:i});else if(s){const c=qn(s,e);n.push({key:l,value:c,type:i})}}),n}function Hqe(t){const e=new FormData;return t.forEach(({key:r,value:n,type:i})=>{i==="file"?e.append(r,n.file):n&&e.append(r,n)}),e}function Mq(t=[]){return t.filter(e=>{const{securityType:r,[me.APIKey]:n}=e;return r===me.APIKey&&n.location===oo.Query&&!!n.name}).map(e=>{const{[me.APIKey]:r}=e;return{id:"",key:r.name,value:r.key,active:!0,in:"query"}})}function CH(t,e,r){const n=r?.components.parameters.get();return nc("query",[Mq(e?.security.get()),Mq(t.security.get()),Dr(e?.parameters.queryParameters.get(),n),Dr(t.parameters.queryParameters.get(),n)])}function $H(t,e,r,n){return CH(t,e,r).map(o=>{const s=qn(o.value,n),a=Dq(s,o.allowReserved);return`${Dq(o.key)}=${a}`}).join("&")}function Jqe(t,e,r,n){return CH(t,e,r).reduce((o,s)=>{const a=qn(s.value,n),l=qn(s.key,n);return o[l]=a,o},{})}function Kqe(t){const e=t.indexOf("?");if(e===-1)return[];const r=new URLSearchParams(t.slice(e+1)),n=[];for(const[i,o]of r.entries())n.push({id:crypto.randomUUID(),active:!0,key:i,value:o,in:"query"});return n}function e4e(t){const e=t.split("?")[0],r=zqe(e),n=/^\{[^\s]+\}$/,i=r.filter(o=>n.test(o)).map(o=>o.slice(1,-1));return new Set(i)}function OR(t,e,r,n){const i=n4e(t.get(),n),o=Xqe(t,e,r,n),s=t4e(t,e,r,n),a=r?.components.parameters.get();return nc("header",[i,o,s,Dr(e?.parameters.headers.get(),a),Dr(t.parameters.headers.get(),a)]).reduce((u,{key:d,value:p})=>(u[d]=qn(p,n),u),{})}function t4e(t,e,r,n){const o=kH(t,e,r).map(s=>`${s.key}=${qn(s.value,n)}`).join("; ");return o?[{id:"",key:"Cookie",value:o,active:!0,in:"header"},{id:"",key:"X-Redocly-Cookie",value:o,active:!0,in:"header"}]:[]}function r4e(t,e,r,n){return kH(t,e,r).reduce((o,s)=>{const a=qn(s.value,n);return{...o,[qn(s.key,n)]:a}},{})}function Lq(t=[]){return t.filter(e=>{const{securityType:r,[me.APIKey]:n}=e;return r===me.APIKey&&n.location===oo.Cookie&&!!n.name}).map(e=>{const{[me.APIKey]:r}=e;return{id:"",key:r.name,value:r.key,active:!0,in:"cookie"}})}function kH(t,e,r){const n=r?.components.parameters.get();return nc("cookie",[Lq(e?.security.get()),Lq(t.security.get()),Dr(e?.parameters.cookies.get(),n),Dr(t.parameters.cookies.get(),n)])}function TH(t){return t.filter(e=>e.active&&e.key&&(e.value||e?.files))}function n4e(t,e){const{requestBody:r}=t;return!yR(t,e)||["binary","multipart/form-data"].includes(r.type)?[]:[{id:"",key:"Content-Type",value:r.type,active:!0,in:"header"}]}function qn(t,e){return e?or(t,op(e)?.inputs):t}function i4e({proxyUrl:t,resolvedUrl:e,ignoreProxy:r,queryParameters:n=""}){const i=t!=="/"?zT(t):t;let o;return r||!i?o=e:o=`${i}/${e}`,n&&(o+=`?${n}`),o}function EH(t){return t.flatMap(e=>{const r=e.id.get();return(e.paths?.keys??[]).flatMap(i=>{const o=e.paths.nested(i),a=(o.keys??[]).filter(u=>["get","put","post","delete","options","head","patch","trace","x-query","query"].includes(u.toLowerCase())).map(u=>{const d=o.nested(u),p=d.operationId.get()||"",h=d.summary.get();return{apiId:r,path:i,method:u,operationId:p,summary:h,isAdditionalOperation:!1}}),l=o.additionalOperations?.get(),c=l?Object.entries(l).map(([u,d])=>({apiId:r,path:i,method:u,operationId:d.operationId||"",summary:d.summary,isAdditionalOperation:!0})):[];return[...a,...c]})})}function vR({tabsState:{activeTabIdx:t,tabs:e}}){return e[t?.get()??0]}function o4e(t){const{environments:e,apis:r,tabsState:{tabs:n}}=t,i=n.filter(l=>l.data.type.get()===Ke.Step),o=EH(r),s=i.map(l=>{const{collectionId:c,workflowId:u,satisfiesScheme:d}=l.data.get(),p=l.data.draftStep.ornull;if(p===null)return null;const{operationId:h,apiId:g}=p.get().operation??{};if(!d||!h)return null;const m=t.collections.find(C=>C.id.get()===c),y=m?.workflows.find(C=>C.workflowId.get()===u),O=o.find(C=>C.operationId===h&&C.apiId===g);if(!O)return null;const v=OR(p,y,m,t),b=yR(p.get(),t),S=r4e(p,y,m,t),x=Jqe(p,y,m,t),$=p.requestBody.activeExampleName;return{apiPath:{path:O.path,method:O.method},requestValues:{cookie:S,header:v,query:x,body:b},activeExampleName:$.get()}}).filter(l=>l!==null),a=op(t);return{operations:s,environment:a?.name,environments:Object.fromEntries(e.get().map(l=>[l.name,{...Object.fromEntries(l.inputs.map(({name:c,value:u})=>[c,u])),...Object.fromEntries(l.servers.map(({apiId:c,value:u})=>[c,u]))}]))}}function s4e(t){const e=t.data.get();switch(e.type){case Ke.Workflow:return`${e.collectionId}/${e.workflowId}`;case Ke.Collection:return e.collectionId;case Ke.Step:return`${e.collectionId}/${e.workflowId}/${e.stepId}`;case Ke.WorkflowRun:return`${e.collectionId}/${e.workflowId}`}}function cp(t){const e=vt(),r=vR(e);return!r.get()||t&&!tn(r.data.get(),t)?{tab:null,tabDataId:void 0}:{tab:r,tabDataId:s4e(r)}}function a4e(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return P.useMemo(()=>n=>{e.forEach(i=>i(n))},e)}const WS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function up(t){const e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function bR(t){return"nodeType"in t}function Si(t){var e,r;return t?up(t)?t:bR(t)&&(e=(r=t.ownerDocument)==null?void 0:r.defaultView)!=null?e:window:window}function xR(t){const{Document:e}=Si(t);return t instanceof e}function Ag(t){return up(t)?!1:t instanceof Si(t).HTMLElement}function AH(t){return t instanceof Si(t).SVGElement}function dp(t){return t?up(t)?t.document:bR(t)?xR(t)?t:Ag(t)||AH(t)?t.ownerDocument:document:document:document}const Qo=WS?P.useLayoutEffect:P.useEffect;function XS(t){const e=P.useRef(t);return Qo(()=>{e.current=t}),P.useCallback(function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return e.current==null?void 0:e.current(...n)},[])}function l4e(){const t=P.useRef(null),e=P.useCallback((n,i)=>{t.current=setInterval(n,i)},[]),r=P.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[e,r]}function zm(t,e){e===void 0&&(e=[t]);const r=P.useRef(t);return Qo(()=>{r.current!==t&&(r.current=t)},e),r}function Ig(t,e){const r=P.useRef();return P.useMemo(()=>{const n=t(r.current);return r.current=n,n},[...e])}function J0(t){const e=XS(t),r=P.useRef(null),n=P.useCallback(i=>{i!==r.current&&e?.(i,r.current),r.current=i},[]);return[r,n]}function K0(t){const e=P.useRef();return P.useEffect(()=>{e.current=t},[t]),e.current}let iC={};function Rg(t,e){return P.useMemo(()=>{if(e)return e;const r=iC[t]==null?0:iC[t]+1;return iC[t]=r,t+"-"+r},[t,e])}function IH(t){return function(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return n.reduce((o,s)=>{const a=Object.entries(s);for(const[l,c]of a){const u=o[l];u!=null&&(o[l]=u+t*c)}return o},{...e})}}const lf=IH(1),ex=IH(-1);function c4e(t){return"clientX"in t&&"clientY"in t}function FS(t){if(!t)return!1;const{KeyboardEvent:e}=Si(t.target);return e&&t instanceof e}function u4e(t){if(!t)return!1;const{TouchEvent:e}=Si(t.target);return e&&t instanceof e}function tx(t){if(u4e(t)){if(t.touches&&t.touches.length){const{clientX:e,clientY:r}=t.touches[0];return{x:e,y:r}}else if(t.changedTouches&&t.changedTouches.length){const{clientX:e,clientY:r}=t.changedTouches[0];return{x:e,y:r}}}return c4e(t)?{x:t.clientX,y:t.clientY}:null}const pc=Object.freeze({Translate:{toString(t){if(!t)return;const{x:e,y:r}=t;return"translate3d("+(e?Math.round(e):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;const{scaleX:e,scaleY:r}=t;return"scaleX("+e+") scaleY("+r+")"}},Transform:{toString(t){if(t)return[pc.Translate.toString(t),pc.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:e,duration:r,easing:n}=t;return e+" "+r+"ms "+n}}}),qq="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function d4e(t){return t.matches(qq)?t:t.querySelector(qq)}const f4e={display:"none"};function p4e(t){let{id:e,value:r}=t;return le.default.createElement("div",{id:e,style:f4e},r)}function h4e(t){let{id:e,announcement:r,ariaLiveType:n="assertive"}=t;const i={position:"fixed",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return le.default.createElement("div",{id:e,style:i,role:"status","aria-live":n,"aria-atomic":!0},r)}function m4e(){const[t,e]=P.useState("");return{announce:P.useCallback(n=>{n!=null&&e(n)},[]),announcement:t}}const RH=P.createContext(null);function g4e(t){const e=P.useContext(RH);P.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of <DndContext>");return e(t)},[t,e])}function y4e(){const[t]=P.useState(()=>new Set),e=P.useCallback(n=>(t.add(n),()=>t.delete(n)),[t]);return[P.useCallback(n=>{let{type:i,event:o}=n;t.forEach(s=>{var a;return(a=s[i])==null?void 0:a.call(s,o)})},[t]),e]}const O4e={draggable:`
|
|
622
|
+
`,or=(t,e,r=new Set)=>{const n=vH(t);if(!n.length)return t;let i=0;const o=n.flatMap(({start:s,end:a,name:l})=>{if(r.has(l))return null;const c=e.findLast(d=>d.name===l),u=t.slice(i,c?s:a);if(i=a,c){r.add(l);const d=or(c.value,e,r);return r.delete(l),[u.length?u:null,d||t.slice(s,a)]}return[u.length?u:null]});return t.slice(i).length&&o.push(t.slice(i)),o.join("")};function bqe(t,e){return e.find(r=>r.name===t.slice(1,-1))?.value||t}function xqe(t,e){const r=bH(t);if(!r.length)return f.jsx(Qq,{children:t});let n=0;const i=r.flatMap(({start:o,end:s})=>{const a=t.slice(n,o),l=bqe(t.slice(o,s),e);return n=s,[a.length?a:null,l]});return t.slice(n).length&&i.push(t.slice(n)),f.jsx(Qq,{children:i.join("")})}const xH="New Step";function XT({name:t=xH,workflow:e}={}){let r=t.replaceAll(" ","-").toLowerCase();if(!e)return r;const n=Sqe(e);if(n.includes(r)){let i=1;for(;n.includes(`${r}-${i}`);)i++;r=`${r}-${i}`}return r}function Sqe(t){return t.steps.filter(e=>e.state.get()!==qt.Draft).map(e=>e.stepId.get())}function vu({name:t=xH,isDraft:e=!1,fromStep:r,workflow:n,operation:i,apiOperation:o}={}){if(!r){const a=o?oR(o):null,l=[ms()];return{stepId:XT({name:t,workflow:n}),description:t,outputs:[Ao()],successCriteria:[],state:e?qt.Draft:qt.Normal,parameters:{pathParameters:[gr("path")],queryParameters:[gr("query")],headers:[gr("header")],cookies:[gr("cookie")]},requestBody:M0(),xOperation:i?null:{method:"GET",url:""},security:l,operation:i??null,...a}}const s=r.get({noproxy:!0});return{stepId:XT({name:t,workflow:n}),description:s.description,outputs:s.outputs,successCriteria:s.successCriteria,state:e?qt.Draft:qt.Normal,parameters:s.parameters,requestBody:s.requestBody,xOperation:s.xOperation,security:s.security,operation:s.operation}}function bu(t){return{method:(t.xOperation?t.xOperation.method:t.operation?.method)??"",url:(t.xOperation?t.xOperation.url:t.operation?.path)??""}}function gR(t,e,r,n){const{inputs:i,servers:o}=n,s=J5e(nc("path",[Dr(e?.parameters.pathParameters,r?.components.parameters),Dr(t.parameters.pathParameters,r?.components.parameters)]),n.inputs),a=t.xOperation??null,l=t.operation??null;let c="",u="";if(a)u=a.method,c=X3(a.url,s);else if(l){const h=o.find(m=>m.apiId===l.apiId);u=l.method==="x-query"?"query":l.method,c=(h?.value?mG(h.value,h.variables):"")+X3(l.path,s)}const d=c.split("?")[0];return{url:or(d,i),method:u.toUpperCase()}}function wqe(t){const e=t.substring(7).split(", "),r={};for(const n of e){const[i,o]=n.split("=");r[i]=o.replace(/"/g,"")}return r}function Pqe(t,e,r,n){const{inputs:i}=n,{requestBody:{content:o}}=t,{url:s,method:a}=gR(t,e,r,n),l=[...e?.security||[],...t.security].findLast(C=>C.securityType===me.DigestAuth);if(!l)return"";const{username:c,password:u,realm:d,nonce:p,cnonce:h,algorithm:g,qop:m,nc:y,opaque:O}=l[me.DigestAuth],v=or(c,i),{pathname:b,search:S}=new URL(s),x=S?`${b}${S}`:b,$=Cqe({username:v,password:or(u,i),uri:x,realm:d,nonce:p,cnonce:h,algorithm:g,qop:m,nc:y,method:a,bodyContent:o});return`Digest username="${v}", realm="${d}", nonce="${p}", uri="${x}", qop=${m}, nc=${y}, cnonce="${h}", response="${$}", algorithm=${g}${O?`, opaque="${O}"`:""}`}function Cqe(t){const{username:e,password:r,realm:n,nonce:i,cnonce:o,algorithm:s,qop:a,nc:l,uri:c,method:u,bodyContent:d}=t,p=$qe(s),h=s?.endsWith("-sess")?p(`${p(`${e}:${n}:${r}`)}:${i}:${o}`):p(`${e}:${n}:${r}`),g=a?.includes("auth-int")?p(`${u}:${c}:${p(d)}`):p(`${u}:${c}`);return p(`${h}:${i}:${l}:${o}:${a}:${g}`).toString()}function $qe(t){switch(t?.replace("-sess","")){case"SHA-256":return e=>Hh(hV(e));default:return e=>Hh(Rx(e))}}function kqe(t){try{const r=new URL(t).hostname;return r==="localhost"||r==="127.0.0.1"}catch{return!1}}function FT(t,e=window.location.origin){try{const r=new URL(t);return e===r.origin}catch{return!1}}function Tqe(t){return t?t.split(";").map(n=>n.trim()).map(n=>{const i=n.indexOf("="),o=n.slice(0,i).trim(),s=n.slice(i+1).trim();return[o,s]}):[]}const Eqe=["json","xml","html","text"],Aqe=["application/octet-stream","application/x-msdownload","application/pdf","application/zip","application/gzip","application/x-7z-compressed","application/x-tar","application/x-bzip2"];function nC(t,e){return t.get(e)??t.get(e.toLowerCase())}function Iqe(t){if(!t)return;const e=Number.parseInt(t,10);return Number.isFinite(e)?e:void 0}function Rqe(t){if(!t)return;const e=t.match(/filename\*=(?:UTF-8'')?([^;\n]+)/i);if(e?.[1])try{return decodeURIComponent(e[1].replace(/(^")|("$)/g,"").trim())}catch{return e[1].replace(/(^")|("$)/g,"").trim()}const r=t.match(/filename=([^;\n]+)/i);if(r?.[1])return r[1].replace(/(^")|("$)/g,"").trim()}function jqe(t){try{return new URL(t).pathname.split("/").filter(Boolean).pop()||void 0}catch{return}}function _qe(t,e){if(e&&/attachment|filename=/i.test(e))return!0;if(!t)return!1;const r=t.toLowerCase();return Aqe.some(n=>r.includes(n))?!0:r.startsWith("application/")?!Eqe.some(n=>r.includes(n)):!1}async function Qqe(t,e){const r=nC(t.headers,"content-type")?.split(";")[0].trim(),n=nC(t.headers,"content-disposition"),i=Iqe(nC(t.headers,"content-length")),o=_qe(r,n),s=Tqe(document.cookie);if(o){const p={fileName:Rqe(n)||jqe(t.url)||"response",contentType:r,contentLength:i,status:"pending"};return{bodyUsed:t.bodyUsed,status:t.status,headers:Array.from(t.headers.entries()),arrayBuffer:new ArrayBuffer(0),body:"",duration:e,cookies:s,size:i??0,download:p,bodyNotStored:!0,url:t.url}}const l=await t.clone().arrayBuffer(),c=new TextDecoder().decode(l),u=new Uint8Array(l).length;return{bodyUsed:t.bodyUsed,status:t.status,headers:Array.from(t.headers.entries()),arrayBuffer:l,body:c,duration:e,cookies:s,size:u,url:t.url}}const Dqe=":/?#[]@!$&'()*+,;=",Nqe=new Set(["!","'","(",")","*"]);function Mqe(t){return Nqe.has(t)?`%${t.charCodeAt(0).toString(16).toUpperCase()}`:encodeURIComponent(t)}function Dq(t,e=!1){let r=encodeURIComponent(t).replace(/[!'()*]/g,i=>`%${i.charCodeAt(0).toString(16).toUpperCase()}`);if(!e)return r;const n=[...Dqe].map(i=>({char:i,encoded:Mqe(i)}));for(const{char:i,encoded:o}of n)r=r.split(o).join(i);return r}function Nq(t){try{const e=new URL(t);return(e.protocol==="http:"&&e.port==="80"||e.protocol==="https:"&&e.port==="443")&&(e.port=""),e.hostname=e.hostname.toLowerCase(),e.protocol+"//"+e.hostname+(e.port?":"+e.port:"")}catch(e){return console.error("Invalid URL",e),null}}function SH(t,e){let r=Nq(t);const n=e.find(({host:i,port:o})=>Nq(`https://${i}:${o}`)===r);return{clientCert:n?.crtFilePath,clientKey:n?.keyFilePath}}function Lqe(t){const e=t.lastIndexOf(".");return e<=0?{baseName:t,extension:""}:{baseName:t.slice(0,e),extension:t.slice(e)}}async function qqe(t,e){const{exists:r}=await Promise.resolve().then(()=>SS),{join:n}=await Promise.resolve().then(()=>VF),{baseName:i,extension:o}=Lqe(e);let s=0;for(;;){const a=s===0?"":` (${s})`,l=`${i}${a}${o}`,c=await n(t,l);if(!await r(c))return c;s+=1}}function zqe(t){return t.split(/(\{[^}]+\}|\/)/g).filter(e=>e!=="")}function Vqe(t){if(t!=null)return t}async function wH({store:t,step:e,settings:r,workflow:n,collection:i,signal:o}){const{corsProxyUrl:s,certificates:a}=r.get(),l=op(t),{url:c,method:u}=gR(e.get(),n?.get(),i?.get(),l),d=s||"",p=$H(e,n,i,t),h=kqe(c)||FT(c),g=i4e({proxyUrl:d,resolvedUrl:c,ignoreProxy:h,queryParameters:p});await Wqe(e,n??void 0,g,o);const m=OR(e,n??void 0,i??void 0,t),y=Vqe(yR(e.get({noproxy:!0}),t)),{clientCert:O,clientKey:v}=SH(c,a||[]),S=!!g.match(/^https?:\/\//)?g:`https://${g}`,x=u.toUpperCase(),$=!OS.includes(x),C=$?"POST":x,T=$?{...m,"X-HTTP-Method-Override":x}:m;return{urlWithProxyAndProtocol:S,fetchMethod:C,fetchHeaders:T,body:y,mode:FT(S)?"same-origin":"cors",clientCert:O,clientKey:v,resolvedUrl:c}}async function Uqe(t,e,r,n){const{requestController:i}=t,s=vR(t).data;if(s.type.get()!==Ke.Step){console.warn("not an operation tab");return}const{collectionId:a,workflowId:l,response:c,requestError:u,isProcessingRequest:d}=s,p=t.collections.find(y=>y.id.get()===a.get()),h=p?.workflows.find(y=>y.workflowId.get()===l.get()),g=ra(e.get({noproxy:!0}));d.set(!0),i.get()?.abort?.(),i.set(new AbortController);const m=i.get()?.signal;try{const y=await wH({store:t,step:e,settings:r,workflow:h,collection:p,signal:m}),O=Date.now(),v={signal:m,method:y.fetchMethod,headers:y.fetchHeaders,body:y.body,mode:y.mode,clientCert:y.clientCert,clientKey:y.clientKey},b=await oa(y.urlWithProxyAndProtocol,v),S=Date.now()-O;u.set(null),c.set(await Qqe(b,S));const x=ra(c.value);n?.(g,x)}catch(y){if(c.set(null),y.name==="AbortError")return;u.set(y.message||String(y));const O=ra(c.value);n?.(g,O)}finally{d.set(!1)}}async function Bqe({store:t,step:e,settings:r,workflow:n,collection:i,fileName:o,onProgress:s}){const a=await wH({store:t,step:e,settings:r,workflow:n,collection:i}),l={method:a.fetchMethod,headers:a.fetchHeaders,body:a.body,mode:a.mode,clientCert:a.clientCert,clientKey:a.clientKey},{clientCert:c,clientKey:u}=l,d=hn(),p=o||"response";let h=null;if(d){const{open:$}=await Promise.resolve().then(()=>require("./replay-index-Dpg9SsyD.js")),C=await $({directory:!0,multiple:!1});if(!C)return;const T=Array.isArray(C)?C[0]:C;h=await qqe(T,p)}const g=await oa(a.urlWithProxyAndProtocol,l),m=g.headers.get("content-length"),y=m?Number.parseInt(m,10):void 0,O=Number.isFinite(y)?y:void 0,v=g.headers.get("content-type")??void 0;let b;if(g.body?.getReader){const $=g.body.getReader(),C=[];let T=0;for(;;){const{done:I,value:Q}=await $.read();if(I)break;if(Q){const _=new Uint8Array(Q.byteLength);_.set(Q),C.push(_.buffer),T+=Q.byteLength,s?.({receivedBytes:T,totalBytes:O,done:!1})}}b=new Blob(C,{type:v}),s?.({receivedBytes:T,totalBytes:O,done:!0})}else b=await g.blob(),s?.({receivedBytes:b.size,totalBytes:O,done:!0});if(d){const{writeFile:$}=await Promise.resolve().then(()=>SS),C=new Uint8Array(await b.arrayBuffer());if(!h)return;await $(h,C);return}const S=window.URL.createObjectURL(b),x=document.createElement("a");x.href=S,x.download=p,x.rel="noopener",x.click(),window.URL.revokeObjectURL(S)}async function Wqe(t,e,r,n){const{method:i}=bu(t.get()),s=[...Array.from(e?.security||[]),...Array.from(t.security)].findLast(a=>a.securityType.get()===me.DigestAuth);if(s){const a=await oa(r,{signal:n,method:i.toUpperCase(),mode:FT(r)?"same-origin":"cors"}),l=wqe(a.headers.get("WWW-Authenticate")||"");s[me.DigestAuth].merge({nonce:l.nonce,realm:l.realm,qop:l.qop,algorithm:l.algorithm,opaque:l.opaque,cnonce:crypto.randomUUID(),nc:"00000001"})}}function Xqe(t,e,r,n){return[...e?.security.get()||[],...t.security.get()].map(i=>{switch(i.securityType){case me.BasicAuth:{const o=i[me.BasicAuth];return{id:"",key:"Authorization",value:"Basic "+btoa(`${qn(o.username,n)}:${qn(o.password,n)}`),active:!0,in:"header"}}case me.DigestAuth:{const o=op(n);return{id:"",key:"Authorization",value:Pqe(t.get(),e?.get(),r?.get(),o),active:!0,in:"header"}}case me.JWT:return{id:"",key:"Authorization",value:"Bearer "+i[me.JWT].token,active:!0,in:"header"};case me.OAuth2:{const{grantType:o}=i[me.OAuth2],{accessToken:s}=i[me.OAuth2][o];return{id:"",key:"Authorization",value:"Bearer "+s,active:!0,in:"header"}}case me.OpenIDConnect:{const{grantType:o}=i[me.OpenIDConnect],{accessToken:s}=i[me.OpenIDConnect][o];return{id:"",key:"Authorization",value:"Bearer "+s,active:!0,in:"header"}}case me.APIKey:{const o=i[me.APIKey];return o.location===oo.Header?{id:"",key:o.name,value:o.key,active:!0,in:"header"}:null}default:return null}}).filter(i=>!!i)}function Fqe(t,e,r){const{operation:n,requestBody:i,parameters:o}=e,{headers:s,cookies:a,queryParameters:l}=o;if(!r)return!0;const c=r.parameters?.filter(b=>b.in==="query"),u=r.parameters?.filter(b=>b.in==="header"),d=r.parameters?.filter(b=>b.in==="cookie"),p=n?.path!==r.path,h=r.method.toLowerCase()!==n?.method.toLowerCase(),g=r.body?.mediaTypes&&r.body?.mediaTypes?.[i.type]===void 0,m=u&&!u.every(b=>s.some(S=>!Hl(S)&&S.key===b.name)),y=d&&!d.every(b=>a.some(S=>!Hl(S)&&S.key===b.name)),O=c&&!c.every(b=>l.some(S=>!Hl(S)&&S.key===b.name)),v=uNe(t,e,r);return!p&&!h&&!g&&!m&&!y&&!O&&!v}function PH(t,e){const{requestBody:r}=t,{method:n}=bu(t),i=n.toUpperCase();if(i==="GET"||i==="HEAD"||i==="OPTIONS")return null;try{switch(r.type){case"JSON":return structuredClone(qn(r.content,e));case"multipart/form-data":return Gqe(t,e);case"application/x-www-form-urlencoded":return Yqe(t,e);case"application/octet-stream":return r.binary;default:return qn(r.content,e)}}catch(o){console.error(o)}}function yR(t,e){const{requestBody:r}=t,n=PH(t,e);if(n===null)return null;switch(r.type){default:return n;case"multipart/form-data":return Hqe(n);case"application/x-www-form-urlencoded":return Zqe(n);case"application/octet-stream":return r.binary?.file??null}}function Zqe(t){const e=new URLSearchParams;return t.forEach(({key:r,value:n})=>{e.append(r,n)}),e}function Yqe(t,e){const{requestBody:r}=t,n=[];return TH(r.formData["application/x-www-form-urlencoded"]).forEach(i=>{const o=qn(i.value,e);n.push({key:qn(i.key,e),value:o,type:"text"})}),n}function Gqe(t,e){const{requestBody:r}=t,n=[];return TH(r.formData["multipart/form-data"]).forEach(({type:i,files:o,value:s,key:a})=>{const l=qn(a,e);if(i==="file"&&o)for(const c of o)n.push({key:l,value:c,type:i});else if(s){const c=qn(s,e);n.push({key:l,value:c,type:i})}}),n}function Hqe(t){const e=new FormData;return t.forEach(({key:r,value:n,type:i})=>{i==="file"?e.append(r,n.file):n&&e.append(r,n)}),e}function Mq(t=[]){return t.filter(e=>{const{securityType:r,[me.APIKey]:n}=e;return r===me.APIKey&&n.location===oo.Query&&!!n.name}).map(e=>{const{[me.APIKey]:r}=e;return{id:"",key:r.name,value:r.key,active:!0,in:"query"}})}function CH(t,e,r){const n=r?.components.parameters.get();return nc("query",[Mq(e?.security.get()),Mq(t.security.get()),Dr(e?.parameters.queryParameters.get(),n),Dr(t.parameters.queryParameters.get(),n)])}function $H(t,e,r,n){return CH(t,e,r).map(o=>{const s=qn(o.value,n),a=Dq(s,o.allowReserved);return`${Dq(o.key)}=${a}`}).join("&")}function Jqe(t,e,r,n){return CH(t,e,r).reduce((o,s)=>{const a=qn(s.value,n),l=qn(s.key,n);return o[l]=a,o},{})}function Kqe(t){const e=t.indexOf("?");if(e===-1)return[];const r=new URLSearchParams(t.slice(e+1)),n=[];for(const[i,o]of r.entries())n.push({id:crypto.randomUUID(),active:!0,key:i,value:o,in:"query"});return n}function e4e(t){const e=t.split("?")[0],r=zqe(e),n=/^\{[^\s]+\}$/,i=r.filter(o=>n.test(o)).map(o=>o.slice(1,-1));return new Set(i)}function OR(t,e,r,n){const i=n4e(t.get(),n),o=Xqe(t,e,r,n),s=t4e(t,e,r,n),a=r?.components.parameters.get();return nc("header",[i,o,s,Dr(e?.parameters.headers.get(),a),Dr(t.parameters.headers.get(),a)]).reduce((u,{key:d,value:p})=>(u[d]=qn(p,n),u),{})}function t4e(t,e,r,n){const o=kH(t,e,r).map(s=>`${s.key}=${qn(s.value,n)}`).join("; ");return o?[{id:"",key:"Cookie",value:o,active:!0,in:"header"},{id:"",key:"X-Redocly-Cookie",value:o,active:!0,in:"header"}]:[]}function r4e(t,e,r,n){return kH(t,e,r).reduce((o,s)=>{const a=qn(s.value,n);return{...o,[qn(s.key,n)]:a}},{})}function Lq(t=[]){return t.filter(e=>{const{securityType:r,[me.APIKey]:n}=e;return r===me.APIKey&&n.location===oo.Cookie&&!!n.name}).map(e=>{const{[me.APIKey]:r}=e;return{id:"",key:r.name,value:r.key,active:!0,in:"cookie"}})}function kH(t,e,r){const n=r?.components.parameters.get();return nc("cookie",[Lq(e?.security.get()),Lq(t.security.get()),Dr(e?.parameters.cookies.get(),n),Dr(t.parameters.cookies.get(),n)])}function TH(t){return t.filter(e=>e.active&&e.key&&(e.value||e?.files))}function n4e(t,e){const{requestBody:r}=t;return!yR(t,e)||["binary","multipart/form-data"].includes(r.type)?[]:[{id:"",key:"Content-Type",value:r.type,active:!0,in:"header"}]}function qn(t,e){return e?or(t,op(e)?.inputs):t}function i4e({proxyUrl:t,resolvedUrl:e,ignoreProxy:r,queryParameters:n=""}){const i=t!=="/"?zT(t):t;let o;return r||!i?o=e:o=`${i}/${e}`,n&&(o+=`?${n}`),o}function EH(t){return t.flatMap(e=>{const r=e.id.get();return(e.paths?.keys??[]).flatMap(i=>{const o=e.paths.nested(i),a=(o.keys??[]).filter(u=>["get","put","post","delete","options","head","patch","trace","x-query","query"].includes(u.toLowerCase())).map(u=>{const d=o.nested(u),p=d.operationId.get()||"",h=d.summary.get();return{apiId:r,path:i,method:u,operationId:p,summary:h,isAdditionalOperation:!1}}),l=o.additionalOperations?.get(),c=l?Object.entries(l).map(([u,d])=>({apiId:r,path:i,method:u,operationId:d.operationId||"",summary:d.summary,isAdditionalOperation:!0})):[];return[...a,...c]})})}function vR({tabsState:{activeTabIdx:t,tabs:e}}){return e[t?.get()??0]}function o4e(t){const{environments:e,apis:r,tabsState:{tabs:n}}=t,i=n.filter(l=>l.data.type.get()===Ke.Step),o=EH(r),s=i.map(l=>{const{collectionId:c,workflowId:u,satisfiesScheme:d}=l.data.get(),p=l.data.draftStep.ornull;if(p===null)return null;const{operationId:h,apiId:g}=p.get().operation??{};if(!d||!h)return null;const m=t.collections.find(C=>C.id.get()===c),y=m?.workflows.find(C=>C.workflowId.get()===u),O=o.find(C=>C.operationId===h&&C.apiId===g);if(!O)return null;const v=OR(p,y,m,t),b=yR(p.get(),t),S=r4e(p,y,m,t),x=Jqe(p,y,m,t),$=p.requestBody.activeExampleName;return{apiPath:{path:O.path,method:O.method},requestValues:{cookie:S,header:v,query:x,body:b},activeExampleName:$.get()}}).filter(l=>l!==null),a=op(t);return{operations:s,environment:a?.name,environments:Object.fromEntries(e.get().map(l=>[l.name,{...Object.fromEntries(l.inputs.map(({name:c,value:u})=>[c,u])),...Object.fromEntries(l.servers.map(({apiId:c,value:u})=>[c,u]))}]))}}function s4e(t){const e=t.data.get();switch(e.type){case Ke.Workflow:return`${e.collectionId}/${e.workflowId}`;case Ke.Collection:return e.collectionId;case Ke.Step:return`${e.collectionId}/${e.workflowId}/${e.stepId}`;case Ke.WorkflowRun:return`${e.collectionId}/${e.workflowId}`}}function cp(t){const e=vt(),r=vR(e);return!r.get()||t&&!tn(r.data.get(),t)?{tab:null,tabDataId:void 0}:{tab:r,tabDataId:s4e(r)}}function a4e(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return P.useMemo(()=>n=>{e.forEach(i=>i(n))},e)}const WS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function up(t){const e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function bR(t){return"nodeType"in t}function Si(t){var e,r;return t?up(t)?t:bR(t)&&(e=(r=t.ownerDocument)==null?void 0:r.defaultView)!=null?e:window:window}function xR(t){const{Document:e}=Si(t);return t instanceof e}function Ag(t){return up(t)?!1:t instanceof Si(t).HTMLElement}function AH(t){return t instanceof Si(t).SVGElement}function dp(t){return t?up(t)?t.document:bR(t)?xR(t)?t:Ag(t)||AH(t)?t.ownerDocument:document:document:document}const Qo=WS?P.useLayoutEffect:P.useEffect;function XS(t){const e=P.useRef(t);return Qo(()=>{e.current=t}),P.useCallback(function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return e.current==null?void 0:e.current(...n)},[])}function l4e(){const t=P.useRef(null),e=P.useCallback((n,i)=>{t.current=setInterval(n,i)},[]),r=P.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[e,r]}function zm(t,e){e===void 0&&(e=[t]);const r=P.useRef(t);return Qo(()=>{r.current!==t&&(r.current=t)},e),r}function Ig(t,e){const r=P.useRef();return P.useMemo(()=>{const n=t(r.current);return r.current=n,n},[...e])}function J0(t){const e=XS(t),r=P.useRef(null),n=P.useCallback(i=>{i!==r.current&&e?.(i,r.current),r.current=i},[]);return[r,n]}function K0(t){const e=P.useRef();return P.useEffect(()=>{e.current=t},[t]),e.current}let iC={};function Rg(t,e){return P.useMemo(()=>{if(e)return e;const r=iC[t]==null?0:iC[t]+1;return iC[t]=r,t+"-"+r},[t,e])}function IH(t){return function(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return n.reduce((o,s)=>{const a=Object.entries(s);for(const[l,c]of a){const u=o[l];u!=null&&(o[l]=u+t*c)}return o},{...e})}}const lf=IH(1),ex=IH(-1);function c4e(t){return"clientX"in t&&"clientY"in t}function FS(t){if(!t)return!1;const{KeyboardEvent:e}=Si(t.target);return e&&t instanceof e}function u4e(t){if(!t)return!1;const{TouchEvent:e}=Si(t.target);return e&&t instanceof e}function tx(t){if(u4e(t)){if(t.touches&&t.touches.length){const{clientX:e,clientY:r}=t.touches[0];return{x:e,y:r}}else if(t.changedTouches&&t.changedTouches.length){const{clientX:e,clientY:r}=t.changedTouches[0];return{x:e,y:r}}}return c4e(t)?{x:t.clientX,y:t.clientY}:null}const pc=Object.freeze({Translate:{toString(t){if(!t)return;const{x:e,y:r}=t;return"translate3d("+(e?Math.round(e):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;const{scaleX:e,scaleY:r}=t;return"scaleX("+e+") scaleY("+r+")"}},Transform:{toString(t){if(t)return[pc.Translate.toString(t),pc.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:e,duration:r,easing:n}=t;return e+" "+r+"ms "+n}}}),qq="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function d4e(t){return t.matches(qq)?t:t.querySelector(qq)}const f4e={display:"none"};function p4e(t){let{id:e,value:r}=t;return le.default.createElement("div",{id:e,style:f4e},r)}function h4e(t){let{id:e,announcement:r,ariaLiveType:n="assertive"}=t;const i={position:"fixed",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return le.default.createElement("div",{id:e,style:i,role:"status","aria-live":n,"aria-atomic":!0},r)}function m4e(){const[t,e]=P.useState("");return{announce:P.useCallback(n=>{n!=null&&e(n)},[]),announcement:t}}const RH=P.createContext(null);function g4e(t){const e=P.useContext(RH);P.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of <DndContext>");return e(t)},[t,e])}function y4e(){const[t]=P.useState(()=>new Set),e=P.useCallback(n=>(t.add(n),()=>t.delete(n)),[t]);return[P.useCallback(n=>{let{type:i,event:o}=n;t.forEach(s=>{var a;return(a=s[i])==null?void 0:a.call(s,o)})},[t]),e]}const O4e={draggable:`
|
|
623
623
|
To pick up a draggable item, press the space bar.
|
|
624
624
|
While dragging, use the arrow keys to move the item.
|
|
625
625
|
Press space again to drop the item in its new position, or press escape to cancel.
|
|
@@ -3234,7 +3234,7 @@ Please report this to https://github.com/markedjs/marked.`,t){const i="<p>An err
|
|
|
3234
3234
|
gap: var(--spacing-xs);
|
|
3235
3235
|
`,sb={[Yn.SIMPLE]:{label:"Simple",tooltipContent:"Success criteria conditions in the form of basic literals, operators, and loose comparisons"},[Yn.REGEX]:{label:"Regex",tooltipContent:"Regex patterns used as success criteria conditions"},[Yn.JSONPATH]:{label:"JSONPath",tooltipContent:"JSONPath expressions as success criteria conditions"},[Yn.XPATH]:{label:"XPath",tooltipContent:"XPath expressions as success criteria conditions"}},Ett=Object.keys(sb);function Att({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||[],{...sNe(o)}])},n=P.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(Ot)};return f.jsxs(f.Fragment,{children:[f.jsxs(fa,{children:["Success criteria",f.jsx(Qi,{content:"List of conditions required to complete the step."})]}),n.map(o=>f.jsx(P.Fragment,{children:f.jsx(Ptt,{successCriteria:o,label:sb[o.get().type].label,tooltipContent:sb[o.get().type].tooltipContent,additionalActions:f.jsx(Oi,{"data-testid":"remove-success-criteria-button",variant:"text",icon:f.jsx(j.TrashCanIcon,{}),onClick:()=>i(o)})})},o.get().id)),f.jsx(Itt,{renderInput:()=>f.jsx(j.Button,{variant:"outlined",icon:f.jsx(j.AddIcon,{}),iconPosition:"left",size:"small",children:"Add success criteria"}),dataTestId:"workflow-step-success-criteria-select",options:Ett.map(o=>({element:sb[o].label,label:o,value:o})),onChange:o=>{r(o)},placement:"top",hideCheckmarkIcon:!0})]})}const Itt=k.default(j.Select)`
|
|
3236
3236
|
border-radius: var(--border-radius-md);
|
|
3237
|
-
`;function Rtt({step:t,workflowId:e,collectionId:r}){const{handleIdChange:n}=Du(),i=t.stepId.get();return f.jsx(f.Fragment,{children:f.jsxs(rte,{children:[f.jsx(fa,{children:"Info"}),f.jsxs(Ut,{children:[f.jsxs(Ut.Row,{children:[f.jsx(Ut.Cell,{children:f.jsxs(ou,{children:["Step ID",f.jsx(Qi,{content:"This step's unique identifier"})]})}),f.jsx(Ut.Cell,{$readonly:!0,children:f.jsx(TE,{attribute:t.stepId,editorTitle:"Change step ID",placeholder:"Add step ID",onSave:o=>{r&&e&&n({collectionId:r,workflowId:e,stepId:i},{collectionId:r,workflowId:e,stepId:o})}})})]}),f.jsxs(Ut.Row,{children:[f.jsx(Ut.Cell,{children:f.jsxs(ou,{children:["Description",f.jsx(Qi,{content:"The step's purpose in the workflow."})]})}),f.jsx(Ut.Cell,{children:f.jsx(NR,{state:t.description,placeholder:"Add description"})})]})]}),f.jsxs(uf,{children:[f.jsx(fa,{children:"Operation"}),f.jsx(btt,{step:t,collectionId:r})]}),f.jsx(uf,{children:f.jsx(tte,{outputs:t.outputs,tooltipText:"Data generated in this step that can be used in the next steps."})}),f.jsx(uf,{children:f.jsx(Att,{successCriteria:t.successCriteria})})]})})}function jtt({onParameterChange:t,files:e}){const r=P.useRef(null),n=a=>{a.target.files?.length&&t(Array.from(a.target.files).map(l=>({absolutePath:null,file:l})))},i=async()=>{if(hn())try{const{open:a}=await Promise.resolve().then(()=>require("./replay-index-
|
|
3237
|
+
`;function Rtt({step:t,workflowId:e,collectionId:r}){const{handleIdChange:n}=Du(),i=t.stepId.get();return f.jsx(f.Fragment,{children:f.jsxs(rte,{children:[f.jsx(fa,{children:"Info"}),f.jsxs(Ut,{children:[f.jsxs(Ut.Row,{children:[f.jsx(Ut.Cell,{children:f.jsxs(ou,{children:["Step ID",f.jsx(Qi,{content:"This step's unique identifier"})]})}),f.jsx(Ut.Cell,{$readonly:!0,children:f.jsx(TE,{attribute:t.stepId,editorTitle:"Change step ID",placeholder:"Add step ID",onSave:o=>{r&&e&&n({collectionId:r,workflowId:e,stepId:i},{collectionId:r,workflowId:e,stepId:o})}})})]}),f.jsxs(Ut.Row,{children:[f.jsx(Ut.Cell,{children:f.jsxs(ou,{children:["Description",f.jsx(Qi,{content:"The step's purpose in the workflow."})]})}),f.jsx(Ut.Cell,{children:f.jsx(NR,{state:t.description,placeholder:"Add description"})})]})]}),f.jsxs(uf,{children:[f.jsx(fa,{children:"Operation"}),f.jsx(btt,{step:t,collectionId:r})]}),f.jsx(uf,{children:f.jsx(tte,{outputs:t.outputs,tooltipText:"Data generated in this step that can be used in the next steps."})}),f.jsx(uf,{children:f.jsx(Att,{successCriteria:t.successCriteria})})]})})}function jtt({onParameterChange:t,files:e}){const r=P.useRef(null),n=a=>{a.target.files?.length&&t(Array.from(a.target.files).map(l=>({absolutePath:null,file:l})))},i=async()=>{if(hn())try{const{open:a}=await Promise.resolve().then(()=>require("./replay-index-Dpg9SsyD.js")),l=await a({multiple:!0});if(!l)return;const u=(Array.isArray(l)?l:[l]).map(Tg),p=(await Promise.all(u)).filter(h=>h!==null);t(p)}catch(a){console.error("Failed to open file dialog or read file:",a)}else r.current?.click()},o=P.useCallback(()=>{t(null)},[t]),s=P.useMemo(()=>{if(!e)return null;if(e.length===1)return f.jsx(i9,{icon:f.jsx(j.CloseIcon,{}),variant:"secondary",onClick:o,iconPosition:"right",size:"small",children:f.jsx(o9,{children:e[0].file.name})});if(e.length>1)return f.jsx(i9,{icon:f.jsx(j.CloseIcon,{}),variant:"secondary",onClick:o,iconPosition:"right",size:"small",children:f.jsxs(o9,{children:[e.length," files"]})})},[e,o]);return f.jsx(_tt,{children:f.jsxs(Qtt,{children:[f.jsx(Dtt,{children:s||f.jsx(Mtt,{children:"Add files here"})}),f.jsxs(Ntt,{children:[f.jsx(IMe,{onClick:i,variant:"text","data-testid":"add-button",icon:f.jsx(j.AddIcon,{color:"--text-color-secondary"})}),f.jsx("input",{"data-testid":"file-input",hidden:!0,ref:r,type:"file",multiple:!0,accept:"files/*",onChange:n})]})]})})}const _tt=k.default.div`
|
|
3238
3238
|
position: relative;
|
|
3239
3239
|
display: flex;
|
|
3240
3240
|
flex-grow: 1;
|
|
@@ -3361,7 +3361,7 @@ Please report this to https://github.com/markedjs/marked.`,t){const i="<p>An err
|
|
|
3361
3361
|
`,Jtt=k.default.div`
|
|
3362
3362
|
display: flex;
|
|
3363
3363
|
justify-content: center;
|
|
3364
|
-
`;function Ktt({data:t,type:e}){const r=Xt(),n=t[e];function i(s,a){a&&n.merge([Ka()])}function o(s){n[s].set(Ot)}return f.jsx(qtt,{keyName:"Param",formElements:n,onParameterChange:i,environment:r,enableInputTypeSelection:e!==Fr["application/x-www-form-urlencoded"],actions:s=>f.jsx(Oi,{onClick:()=>o(s),variant:"text",icon:f.jsx(j.TrashCanIcon,{})})})}const ert=({data:t})=>{const e=t.get(),[r,n]=P.useState(!1),i=P.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(),hn())try{const{open:u}=await Promise.resolve().then(()=>require("./replay-index-
|
|
3364
|
+
`;function Ktt({data:t,type:e}){const r=Xt(),n=t[e];function i(s,a){a&&n.merge([Ka()])}function o(s){n[s].set(Ot)}return f.jsx(qtt,{keyName:"Param",formElements:n,onParameterChange:i,environment:r,enableInputTypeSelection:e!==Fr["application/x-www-form-urlencoded"],actions:s=>f.jsx(Oi,{onClick:()=>o(s),variant:"text",icon:f.jsx(j.TrashCanIcon,{})})})}const ert=({data:t})=>{const e=t.get(),[r,n]=P.useState(!1),i=P.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(),hn())try{const{open:u}=await Promise.resolve().then(()=>require("./replay-index-Dpg9SsyD.js")),d=await u();if(!d)return;const p=await Tg(d);t.set(p)}catch(u){console.error("Failed to open file dialog or read file:",u)}else i.current?.click()},a=c=>{c.key==="Enter"&&(c.preventDefault(),s())},l=()=>{t.set(null)};return r?f.jsxs(trt,{children:[f.jsx(j.SpinnerIcon,{}),"Loading..."]}):e&&e.file?.name?f.jsxs(rrt,{children:[f.jsxs(nrt,{children:[f.jsx(j.DocumentBlankIcon,{size:"16px"}),f.jsx(irt,{children:e.file?.name})]}),f.jsx(Oi,{onClick:l,icon:f.jsx(j.TrashCanIcon,{})})]}):f.jsx(nte,{children:!e&&f.jsxs(ort,{tabIndex:0,role:"button",onKeyDown:a,onClick:s,children:[f.jsx("input",{type:"file",onChange:o,ref:i}),f.jsx(j.CloudUploadIcon,{}),"Upload file"]})})},nte=k.default.div`
|
|
3365
3365
|
display: flex;
|
|
3366
3366
|
align-items: center;
|
|
3367
3367
|
justify-content: flex-start;
|
|
@@ -4169,7 +4169,7 @@ Please report this to https://github.com/markedjs/marked.`,t){const i="<p>An err
|
|
|
4169
4169
|
@media (max-width: ${Kn}px) {
|
|
4170
4170
|
padding: var(--spacing-xs) var(--spacing-sm);
|
|
4171
4171
|
}
|
|
4172
|
-
`,dot={info:t=>{},error:t=>{},warn:t=>{},printNewLine:()=>{},printSeparator:()=>{},indent:(t,e)=>t,output:t=>t},fot=t=>t instanceof URL?t.toString():t instanceof Request?t.url:t;function pot({collectionId:t,workflowId:e}){const{project:{userFilesDir:r}}=vt(),{certificates:n}=Lo(),i=Xt(),{getCollection:o}=Mu(),s=o(t),a=r.get(),{inputs:l,servers:c}=i.get(),u=s?.sourceDescriptions.get()??[];return{execute:async p=>{const h=`${a}/${t}`,g=new IG,m=l.map(v=>JSON.stringify({[v.name]:v.value})),y=hot(c,u),{run:O}=await Promise.resolve().then(()=>require("./replay-respect-run-
|
|
4172
|
+
`,dot={info:t=>{},error:t=>{},warn:t=>{},printNewLine:()=>{},printSeparator:()=>{},indent:(t,e)=>t,output:t=>t},fot=t=>t instanceof URL?t.toString():t instanceof Request?t.url:t;function pot({collectionId:t,workflowId:e}){const{project:{userFilesDir:r}}=vt(),{certificates:n}=Lo(),i=Xt(),{getCollection:o}=Mu(),s=o(t),a=r.get(),{inputs:l,servers:c}=i.get(),u=s?.sourceDescriptions.get()??[];return{execute:async p=>{const h=`${a}/${t}`,g=new IG,m=l.map(v=>JSON.stringify({[v.name]:v.value})),y=hot(c,u),{run:O}=await Promise.resolve().then(()=>require("./replay-respect-run-Bw2hqa4a.js"));return await O({files:[h],workflow:e?[e]:[],fetch:(v,b)=>{const S=fot(v),{clientCert:x,clientKey:$}=SH(S,n?n.get({noproxy:!0}):[]);return oa(S,{...b,clientCert:x,clientKey:$})},logger:dot,maxSteps:500,maxFetchTimeout:4e4,requestFileLoader:{getFileBody:async v=>{if(!await xS(v))throw new Error(`File ${v} doesn't exist or isn't readable.`);try{const S=await bS(v),x=new TextEncoder().encode(S);return new File([x],await tI(v))}catch(S){throw new Error(`Failed to read file ${v}: ${S}`)}}},envVariables:{},config:await bW({}),externalRefResolver:g,input:m,server:y,severity:JSON.stringify(p),skipLint:!0,noSecretsMasking:!0})}}}function hot(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 P1(t){return t==null?"N/A":t<1e3?`${t} ms`:t<1e4?`${(t/1e3).toFixed(1)} s`:`${Math.round(t/1e3)} s`}function Ste({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]=le.default.useState(o>0||n>0),u=()=>s?"All checks passed":a?"All checks failed":`Some ${i>1?"checks were":"check was"} not successful`,d=()=>s?f.jsx(j.CheckmarkFilledIcon,{color:"var(--color-success-base)"}):o>0?f.jsx(j.ErrorFilledIcon,{color:"var(--color-error-base)"}):f.jsx(j.WarningFilledIcon,{color:"var(--color-warning-base)"}),p=h=>{h.stopPropagation(),c(!l)};return!e||e.length===0?null:f.jsxs(mot,{children:[f.jsxs(got,{onClick:p,children:[f.jsxs(yot,{children:[f.jsx(Oot,{children:f.jsx(vot,{children:d()})}),f.jsxs(bot,{children:[f.jsx(xot,{children:u()}),f.jsxs(Sot,{children:[r," successful",n>0&&f.jsxs(f.Fragment,{children:[", ",n," ",n===1?"warning":"warnings"]}),o>0&&f.jsxs(f.Fragment,{children:[", ",o," failed"]})]})]})]}),f.jsx(wot,{isExpanded:l,children:l?f.jsx(j.ChevronDownIcon,{}):f.jsx(j.ChevronRightIcon,{})})]}),f.jsx(Pot,{isExpanded:l,children:e.map((h,g)=>f.jsxs(Cot,{children:[f.jsx($ot,{children:h.passed?f.jsx(j.CheckmarkIcon,{color:"var(--color-success-base)",size:"14px"}):!h.passed&&["warn"].includes(h.severity)?f.jsx(j.WarningFilledIcon,{color:"var(--color-warning-base)",size:"14px"}):f.jsx(j.CloseOutlineIcon,{color:"var(--color-error-base)",size:"14px"})}),f.jsxs(kot,{children:[f.jsx(Tot,{children:h.name}),h.message&&f.jsx(Eot,{children:h.message})]})]},g))})]})}const mot=k.default.div`
|
|
4173
4173
|
margin-bottom: 0;
|
|
4174
4174
|
margin-top: var(--spacing-xxs);
|
|
4175
4175
|
`,got=k.default.div`
|