sliccy 5.88.2 → 5.89.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.
Files changed (104) hide show
  1. package/dist/node-server/_shared/agent-wire-types.d.ts +19 -0
  2. package/dist/node-server/_shared/agent-wire-types.d.ts.map +1 -1
  3. package/dist/ui/assets/account-store-CY3L_cQF.js +44 -0
  4. package/dist/ui/assets/{account-store-B_KMKrdO.js → account-store-DtZuHDmf.js} +1 -1
  5. package/dist/ui/assets/{adobe-DV4zpXLD.js → adobe-BT4LLrpZ.js} +1 -1
  6. package/dist/ui/assets/adobe-Bc-6NIQr.js +1 -0
  7. package/dist/ui/assets/{agent-message-to-chat-QyCEPmi8.js → agent-message-to-chat-DH5qVsNo.js} +1 -1
  8. package/dist/ui/assets/{anthropic-messages-C8dDJE2X.js → anthropic-messages-Cx3KdHDK.js} +3 -3
  9. package/dist/ui/assets/{apps-DEnR24ZP.js → apps-CDgCvWHN.js} +1 -1
  10. package/dist/ui/assets/{azure-openai-Ba60DqEK.js → azure-openai-BZYBbAzv.js} +1 -1
  11. package/dist/ui/assets/azure-openai-DXz4hF-c.js +1 -0
  12. package/dist/ui/assets/azure-openai-responses-D2e4727V.js +1 -0
  13. package/dist/ui/assets/bedrock-camp-CvcU-31w.js +1 -0
  14. package/dist/ui/assets/cerebras-CDYxWxu2.js +1 -0
  15. package/dist/ui/assets/{cerebras-C9ZJzdK4.js → cerebras-CvIDBeTv.js} +1 -1
  16. package/dist/ui/assets/compat-BHfpuQ4D.js +1 -0
  17. package/dist/ui/assets/{connect-surface-6KyNiRAj.js → connect-surface-Dg0fG3yA.js} +1 -1
  18. package/dist/ui/assets/context-compaction-DDE4L-Sj.js +58 -0
  19. package/dist/ui/assets/{cost-command-Cpg2Em0Q.js → cost-command-_BMgmnMI.js} +112 -111
  20. package/dist/ui/assets/{fs-D1Ke9zaI.js → fs-CyLJ0TYi.js} +2 -2
  21. package/dist/ui/assets/{fs-CD1g3yf4.js → fs-DpuVKRCQ.js} +1 -1
  22. package/dist/ui/assets/{github-VBKhh8b7.js → github-15WpvjGl.js} +2 -2
  23. package/dist/ui/assets/{github-DlKA7UIM.js → github-CXAoEzN7.js} +1 -1
  24. package/dist/ui/assets/{github-copilot-DiKZ0F7R.js → github-copilot-Ctq2koX1.js} +1 -1
  25. package/dist/ui/assets/github-copilot-Wogh9O3b.js +1 -0
  26. package/dist/ui/assets/google-generative-ai-BPByyH06.js +1 -0
  27. package/dist/ui/assets/{google-shared-BAKd3aSn.js → google-shared-DLE9jWCI.js} +1 -1
  28. package/dist/ui/assets/google-vertex-0jNZ5aI-.js +1 -0
  29. package/dist/ui/assets/{kernel-worker-CrxiLsof.js → kernel-worker-CnX2JxSd.js} +598 -606
  30. package/dist/ui/assets/legacy-api-aliases-BLiHiLlu.js +1 -0
  31. package/dist/ui/assets/{local-llm-B1n_Tc22.js → local-llm-D6vzlH1q.js} +1 -1
  32. package/dist/ui/assets/{local-llm-CrqtFJMO.js → local-llm-DUEO4jme.js} +1 -1
  33. package/dist/ui/assets/{main-CisgbjAR.js → main-YTQMsdfm.js} +3 -3
  34. package/dist/ui/assets/{mistral-conversations-CKK59QJS.js → mistral-conversations-BBexKxUC.js} +2 -2
  35. package/dist/ui/assets/{transform-messages-Bp94o3FD.js → models-CvUrqKSj.js} +1 -1
  36. package/dist/ui/assets/{mount-DVj7VP5s.js → mount-De_BQGq4.js} +2 -2
  37. package/dist/ui/assets/{mount-recovery-CRLQnEKr.js → mount-recovery-BZjiBIEQ.js} +1 -1
  38. package/dist/ui/assets/{mount-CXzjVij6.js → mount-sGWapNTk.js} +1 -1
  39. package/dist/ui/assets/{new-session-CQ3SN3W9.js → new-session-zluPrFE4.js} +2 -2
  40. package/dist/ui/assets/{oauth-bootstrap-Bznbe4g_.js → oauth-bootstrap-BgFk_VJ2.js} +2 -2
  41. package/dist/ui/assets/{openai-codex-Dpe--Pbv.js → openai-codex-C8iCsBD9.js} +1 -1
  42. package/dist/ui/assets/openai-codex-bEaU3e8X.js +1 -0
  43. package/dist/ui/assets/openai-codex-responses-CBhbcvRK.js +7 -0
  44. package/dist/ui/assets/openai-completions-CBeXb_ux.js +5 -0
  45. package/dist/ui/assets/openai-responses-B5d1rOIe.js +1 -0
  46. package/dist/ui/assets/{openai-responses-shared-CiIL52L-.js → openai-responses-shared-BU1VYwTh.js} +5 -5
  47. package/dist/ui/assets/openrouter-BM-UDhNC.js +1 -0
  48. package/dist/ui/assets/{openrouter-CUwBTJXk.js → openrouter-CF8xV5wq.js} +1 -1
  49. package/dist/ui/assets/{openrouter-oauth-KQ2pyAjI.js → openrouter-oauth-DjtLJhP8.js} +1 -1
  50. package/dist/ui/assets/{openrouter-oauth-ChE4CDlG.js → openrouter-oauth-a-7KEbrQ.js} +1 -1
  51. package/dist/ui/assets/{panel-rpc-handlers-DtQvj03x.js → panel-rpc-handlers-MyjiRPfQ.js} +2 -2
  52. package/dist/ui/assets/{provider-Bujo3MeB.js → provider-7LNCXB6L.js} +1 -1
  53. package/dist/ui/assets/{provider-CTeo0pRQ.js → provider-BH5wrYZm.js} +2 -2
  54. package/dist/ui/assets/{provider-settings-Cp-_HR6M.js → provider-settings-DAQd7M-Z.js} +1 -1
  55. package/dist/ui/assets/{provider-settings-C_Gh-qaH.js → provider-settings-D_k-XVth.js} +1 -1
  56. package/dist/ui/assets/provider-store-access-B-KfYV1X.js +1 -0
  57. package/dist/ui/assets/{provider-store-access-msqEFHWL.js → provider-store-access-BIYwZNH0.js} +2 -2
  58. package/dist/ui/assets/{providers-aXrg7Hqf.js → providers-DMaEp7Pj.js} +2 -2
  59. package/dist/ui/assets/{providers-Wkrd-BXf.js → providers-K6q9kDLS.js} +1 -1
  60. package/dist/ui/assets/{quick-llm-BrmE-oQX.js → quick-llm-Dg57FmQe.js} +1 -1
  61. package/dist/ui/assets/session-freezer-C7XAYYYW.js +23 -0
  62. package/dist/ui/assets/session-freezer-DbAlvJ0R.js +15 -0
  63. package/dist/ui/assets/{setup-standalone-prelude-XVptKYpy.js → setup-standalone-prelude-C6YqJt2r.js} +1 -1
  64. package/dist/ui/assets/{setup-sudo-C0qs04rq.js → setup-sudo-0ZNlYZ_b.js} +2 -2
  65. package/dist/ui/assets/{skills--aPRiI_g.js → skills-B9c2PjwK.js} +1 -1
  66. package/dist/ui/assets/{src-DZ2yfAIc.js → src-mCXOSBtK.js} +44 -32
  67. package/dist/ui/assets/{store-CdMZmubX.js → store-D0OiI-Xj.js} +1 -1
  68. package/dist/ui/assets/{sudo-BIG8zrxW.js → sudo-D0UbkO_d.js} +1 -1
  69. package/dist/ui/assets/{upgrade-detection-B86z7wX_.js → upgrade-detection-DMqexaA6.js} +1 -1
  70. package/dist/ui/assets/{wc-attach-BtJ9bT2T.js → wc-attach-BJk2fkdb.js} +2 -2
  71. package/dist/ui/assets/{wc-extension-Dq7AlAAz.js → wc-extension-BwLFa8q2.js} +2 -2
  72. package/dist/ui/assets/{wc-follower-DnN0mb_7.js → wc-follower-Dh_Vhf9K.js} +3 -3
  73. package/dist/ui/assets/wc-live-D2GKoip3.js +8 -0
  74. package/dist/ui/assets/{wc-nav-DQkhozMz.js → wc-nav-sQfzGmHv.js} +2 -2
  75. package/dist/ui/assets/{wc-onboarding--dnxvJ3j.js → wc-onboarding-BOSexBA4.js} +2 -2
  76. package/dist/ui/assets/{wc-placeholder-BPju8pL7.js → wc-placeholder-BvaYuwiv.js} +2 -2
  77. package/dist/ui/assets/{wc-settings-BUKBfv3D.js → wc-settings-ZEBxc5EW.js} +2 -2
  78. package/dist/ui/assets/{wc-shell-p5XmLgeO.js → wc-shell-D3tTSQTN.js} +3 -3
  79. package/dist/ui/assets/{wc-sprinkles-Ddh4AEAG.js → wc-sprinkles-4EUT4NHo.js} +2 -2
  80. package/dist/ui/assets/{wc-tray-DPsUz1BR.js → wc-tray-DvhYzmJ9.js} +2 -2
  81. package/dist/ui/assets/{xai-grok-CLWOrmTv.js → xai-grok-BwI31S4-.js} +1 -1
  82. package/dist/ui/assets/xai-grok-CpSEkomD.js +1 -0
  83. package/dist/ui/index.html +6 -6
  84. package/dist/ui/packages/webapp/index.html +6 -6
  85. package/package.json +1 -1
  86. package/dist/ui/assets/account-store-BA1YRXaY.js +0 -101
  87. package/dist/ui/assets/adobe-D2SaljwO.js +0 -1
  88. package/dist/ui/assets/azure-openai-Da4RYl4k.js +0 -1
  89. package/dist/ui/assets/azure-openai-responses-CzG7X9qb.js +0 -1
  90. package/dist/ui/assets/bedrock-camp-DS0ilb3O.js +0 -1
  91. package/dist/ui/assets/cerebras-CtFfWjlX.js +0 -1
  92. package/dist/ui/assets/github-copilot-B6eM-Ljj.js +0 -1
  93. package/dist/ui/assets/google-generative-ai-DzD1vsXe.js +0 -1
  94. package/dist/ui/assets/google-vertex-oQOD3HKr.js +0 -1
  95. package/dist/ui/assets/legacy-api-aliases-YuuBU-he.js +0 -1
  96. package/dist/ui/assets/openai-codex-D6UlmJBX.js +0 -1
  97. package/dist/ui/assets/openai-codex-responses-DU5CHdDQ.js +0 -7
  98. package/dist/ui/assets/openai-completions-DhKgaAgM.js +0 -5
  99. package/dist/ui/assets/openai-responses-C4_jiYtu.js +0 -1
  100. package/dist/ui/assets/openrouter-B6Vy2W03.js +0 -1
  101. package/dist/ui/assets/provider-store-access-DRkGfm_o.js +0 -1
  102. package/dist/ui/assets/session-freezer-D1TdE11t.js +0 -21
  103. package/dist/ui/assets/wc-live-BLmDAdPx.js +0 -8
  104. package/dist/ui/assets/xai-grok-DH1A214O.js +0 -1
@@ -1,101 +0,0 @@
1
- import{n as e,t}from"./rolldown-runtime-aKtaBQYM.js";import{t as n}from"./logger-LESFN7Hj.js";import{n as r,r as i}from"./panel-rpc-CjFVE0nK.js";import{n as a,o,t as s}from"./providers-Wkrd-BXf.js";import{h as c,m as l,r as u,s as d,t as f}from"./proxied-fetch-D8ebvbVd.js";import"./src-BcePBv4G.js";import{t as p}from"./runtime-env-byAg9ij-.js";import{i as m,r as h}from"./tool-ui-t6ocn6AG.js";import{t as g}from"./port-bridge-client-f_6YKEkm.js";import{c as ee,d as _,f as v,l as te,r as ne,t as re,u as ie}from"./bedrock-camp-DS0ilb3O.js";const ae=`slicc_oauth_extra_domains`;function oe(e){try{let t=e.getItem(ae);if(!t)return{};let n=JSON.parse(t);if(typeof n!=`object`||!n||Array.isArray(n))return{};let r={};for(let[e,t]of Object.entries(n)){if(typeof e!=`string`||!Array.isArray(t))continue;let n=t.filter(e=>typeof e==`string`&&e.length>0);n.length>0&&(r[e]=n)}return r}catch{return{}}}function se(e,t){try{e.setItem(ae,JSON.stringify(t))}catch(e){throw Error(`Failed to persist OAuth extras (localStorage quota exceeded?): ${e instanceof Error?e.message:String(e)}`)}}function ce(){return p()?`extension-direct`:u()?`extension-delegate`:globalThis.__slicc_connect_mode?`connect`:`node-rest`}function le(){return ce()===`node-rest`}const ue={assign:0,create:0,clone:0,discard:0,update:0};function y(e,t){return ue.assign+=1,{...e,...t}}function de(e,t,n){return e>=t&&e<=n}function fe(e){return de(e,127462,127487)}function pe(e){return de(e,65024,65039)}function me(e){return de(e,768,879)||de(e,6832,6911)||de(e,7616,7679)||de(e,65056,65071)}function he(e){return e>65535?2:1}function ge(e,t){for(;t<e.length;){let n=e.codePointAt(t);if(me(n)||pe(n))t+=he(n);else break}return t}function _e(e,t){let n=e.codePointAt(t),r=t+he(n);for(r=ge(e,r);r<e.length-1&&e[r]===`‍`;){let t=e.codePointAt(r+1);r+=1+he(t),r=ge(e,r)}return fe(n)&&r<e.length&&fe(e.codePointAt(r))&&(r+=he(e.codePointAt(r))),r}function ve(e){return de(e,55296,56319)||de(e,768,879)||e===8205}function ye(e){let t=0,n=0;for(;n<e.length;)n=_e(e,n),t++;return t}function be(e,t){if(t===0)return!0;let n=0,r=0;for(;r<e.length;)if(r=_e(e,r),n++,n>=t)return!0;return!1}function xe(e,t){let n=0,r=0;for(;r<e.length;)if(r=_e(e,r),n++,n>t)return!1;return!0}function Se(e,t){if(t===0)return!0;let n=0;for(;n<e.length;){if(ve(e.charCodeAt(n)))return be(e,t);if(n++,n>=t)return!0}return!1}function Ce(e,t){let n=0;for(;n<e.length;){if(ve(e.charCodeAt(n)))return xe(e,t);if(n++,n>t)return!1}return!0}var we=e({Entries:()=>Qe,EntriesRegExp:()=>Ze,Every:()=>Je,EveryAll:()=>Ye,GraphemeCount:()=>Ge,HasPropertyKey:()=>w,IsArray:()=>Te,IsAsyncIterator:()=>Ee,IsBigInt:()=>De,IsBoolean:()=>Oe,IsClassInstance:()=>Ue,IsConstructor:()=>ke,IsDeepEqual:()=>rt,IsEqual:()=>S,IsFunction:()=>Ae,IsGreaterEqualThan:()=>Ve,IsGreaterThan:()=>Re,IsInteger:()=>je,IsIterator:()=>Me,IsLessEqualThan:()=>Be,IsLessThan:()=>ze,IsMaxLength:()=>Ke,IsMinLength:()=>qe,IsMultipleOf:()=>He,IsNull:()=>Ne,IsNumber:()=>Pe,IsObject:()=>b,IsObjectNotArray:()=>Fe,IsString:()=>x,IsSymbol:()=>Ie,IsUndefined:()=>Le,IsUnsafePropertyKey:()=>Xe,IsValueLike:()=>We,Keys:()=>T,Symbols:()=>$e,TakeLeft:()=>C,Values:()=>et});function Te(e){return Array.isArray(e)}function Ee(e){return b(e)&&Symbol.asyncIterator in e}function De(e){return S(typeof e,`bigint`)}function Oe(e){return S(typeof e,`boolean`)}function ke(e){if(Le(e)||!Ae(e))return!1;let t=Function.prototype.toString.call(e);return!!(/^class\s/.test(t)||/\[native code\]/.test(t))}function Ae(e){return S(typeof e,`function`)}function je(e){return Number.isInteger(e)}function Me(e){return b(e)&&Symbol.iterator in e}function Ne(e){return S(e,null)}function Pe(e){return Number.isFinite(e)}function Fe(e){return b(e)&&!Te(e)}function b(e){return S(typeof e,`object`)&&!Ne(e)}function x(e){return S(typeof e,`string`)}function Ie(e){return S(typeof e,`symbol`)}function Le(e){return S(e,void 0)}function S(e,t){return e===t}function Re(e,t){return e>t}function ze(e,t){return e<t}function Be(e,t){return e<=t}function Ve(e,t){return e>=t}function He(e,t){if(De(e)||De(t))return BigInt(e)%BigInt(t)===0n;if(!Pe(e)||je(e)&&1/t%1==0)return!0;let n=e%t;return Math.min(Math.abs(n),Math.abs(n-t))<1e-10}function Ue(e){if(!b(e))return!1;let t=globalThis.Object.getPrototypeOf(e);return!Ne(t)&&S(typeof t.constructor,`function`)&&!(S(t.constructor,globalThis.Object)||S(t.constructor.name,`Object`))}function We(e){return De(e)||Oe(e)||Ne(e)||Pe(e)||x(e)||Le(e)}function Ge(e){return ye(e)}function Ke(e,t){return Ce(e,t)}function qe(e,t){return Se(e,t)}function Je(e,t,n){for(let r=t;r<e.length;r++)if(!n(e[r],r))return!1;return!0}function Ye(e,t,n){let r=!0;for(let i=t;i<e.length;i++)n(e[i],i)||(r=!1);return r}function C(e,t,n){return S(e.length,0)?n():t(e[0],e.slice(1))}function Xe(e){return S(e,`__proto__`)||S(e,`constructor`)||S(e,`prototype`)}function w(e,t){return Xe(t)?Object.prototype.hasOwnProperty.call(e,t):t in e}function Ze(e){return T(e).map(t=>[RegExp(`^${t}$`),e[t]])}function Qe(e){return Object.entries(e)}function T(e){return Object.getOwnPropertyNames(e)}function $e(e){return Object.getOwnPropertySymbols(e)}function et(e){return Object.values(e)}function tt(e,t){if(!b(t))return!1;let n=T(e);return S(n.length,T(t).length)&&n.every(n=>rt(e[n],t[n]))}function nt(e,t){return Te(t)&&S(e.length,t.length)&&e.every((n,r)=>rt(e[r],t[r]))}function rt(e,t){return Te(e)?nt(e,t):b(e)?tt(e,t):S(e,t)}function it(e){return e instanceof Boolean}function at(e){return e instanceof Number}function ot(e){return e instanceof String}function st(e){return globalThis.ArrayBuffer.isView(e)}function ct(e){return e instanceof globalThis.RegExp}function lt(e){return e instanceof globalThis.Date}function ut(e){return e instanceof globalThis.Set}function dt(e){return e instanceof globalThis.Map}function ft(e){return b(e)&&w(e,`~guard`)}function pt(e){return e}function mt(e){return e.map(e=>vt(e))}function ht(e){let t={},n=Object.getOwnPropertyDescriptors(e);for(let e of Object.keys(n)){let r=n[e];w(r,`value`)&&Object.defineProperty(t,e,{...r,value:vt(r.value)})}return t}function gt(e){return new RegExp(e.source,e.flags)}function _t(e){return e}function vt(e){return e instanceof RegExp?gt(e):ft(e)?pt(e):Te(e)?mt(e):b(e)?ht(e):_t(e)}function yt(e){return ue.clone+=1,vt(e)}const bt={immutableTypes:!1,maxErrors:8,useAcceleration:!0,exactOptionalPropertyTypes:!1,enumerableKind:!1,correctiveParse:!1};function xt(){return bt}function St(e,t){for(let n of Object.keys(t))Object.defineProperty(e,n,{configurable:!0,writable:!0,enumerable:!1,value:t[n]});return e}function Ct(e,t){return{...e,...t}}function E(e,t,n={}){ue.create+=1;let r=xt(),i=Ct(t,n),a=r.enumerableKind?Ct(i,e):St(i,e);return r.immutableTypes?Object.freeze(a):a}function wt(e,t){ue.discard+=1;let n={},r=Object.getOwnPropertyDescriptors(yt(e)),i=new Set(t);for(let e of Object.keys(r))i.has(e)||Object.defineProperty(n,e,r[e]);return n}function D(e,t,n){ue.update+=1;let r=xt(),i=yt(e);for(let e of Object.keys(t))Object.defineProperty(i,e,{configurable:!0,writable:!0,enumerable:r.enumerableKind,value:t[e]});for(let e of Object.keys(n))Object.defineProperty(i,e,{configurable:!0,enumerable:!0,writable:!0,value:n[e]});return i}function O(e,t){return b(e)&&w(e,`~kind`)&&S(e[`~kind`],t)}function Tt(e){return b(e)}function Et(e){return b(e)&&w(e,`~kind`)&&w(e,`type`)&&S(e[`~kind`],`OptionalAddAction`)&&Tt(e.type)}function Dt(e){return b(e)&&w(e,`~kind`)&&w(e,`type`)&&S(e[`~kind`],`OptionalRemoveAction`)&&Tt(e.type)}function Ot(e){return b(e)&&w(e,`~kind`)&&w(e,`type`)&&S(e[`~kind`],`ReadonlyAddAction`)&&Tt(e.type)}function kt(e){return b(e)&&w(e,`~kind`)&&w(e,`type`)&&S(e[`~kind`],`ReadonlyRemoveAction`)&&Tt(e.type)}function k(e,t,n){return E({"~kind":`Deferred`},{action:e,parameters:t,options:n},{})}function At(e){return O(e,`Deferred`)}function jt(e,t){return E({"~kind":`Promise`},{type:`promise`,item:e},t)}function Mt(e){return O(e,`Promise`)}function Nt(e){return wt(e,[`~kind`,`type`,`item`])}function Pt(e){return D(e,{"~immutable":!0},{})}function Ft(e){return Pt(e)}function It(e){return Tt(e)&&w(e,`~immutable`)}function Lt(e){return wt(e,[`~optional`])}function Rt(e){return D(e,{"~optional":!0},{})}function zt(e){return Rt(e)}function Bt(e){return Tt(e)&&w(e,`~optional`)}function Vt(e){return wt(e,[`~readonly`])}function Ht(e){return D(e,{"~readonly":!0},{})}function Ut(e){return Ht(e)}function Wt(e){return Tt(e)&&w(e,`~readonly`)}function Gt(e){return{enumerable:xt().enumerableKind,writable:!1,configurable:!1,value:e}}var Kt=class{constructor(){globalThis.Object.defineProperty(this,`~kind`,Gt(`Base`)),globalThis.Object.defineProperty(this,`~guard`,Gt({check:e=>this.Check(e),errors:e=>this.Errors(e)}))}Check(e){return!0}Errors(e){return[]}Convert(e){return e}Clean(e){return e}Default(e){return e}Create(){throw Error(`Create not implemented`)}Clone(){throw Error(`Clone not implemented`)}};function qt(e){return O(e,`Base`)}function Jt(e,t){return E({"~kind":`Array`},{type:`array`,items:e},t)}function Yt(e){return O(e,`Array`)}function Xt(e){return wt(e,[`~kind`,`type`,`items`])}function Zt(e,t){return E({"~kind":`AsyncIterator`},{type:`asyncIterator`,iteratorItems:e},t)}function Qt(e){return O(e,`AsyncIterator`)}function $t(e){return wt(e,[`~kind`,`type`,`iteratorItems`])}function en(e,t,n={}){return E({"~kind":`Constructor`},{type:`constructor`,parameters:e,instanceType:t},n)}function tn(e){return O(e,`Constructor`)}function nn(e){return wt(e,[`~kind`,`type`,`parameters`,`instanceType`])}function rn(e,t,n={}){return E({"~kind":`Function`},{type:`function`,parameters:e,returnType:t},n)}function an(e){return O(e,`Function`)}function on(e){return wt(e,[`~kind`,`type`,`parameters`,`returnType`])}function sn(e,t){return E({"~kind":`Ref`},{$ref:e},t)}function cn(e){return O(e,`Ref`)}function ln(e,t){return E({"~kind":`Generic`},{type:`generic`,parameters:e,expression:t})}function un(e){return O(e,`Generic`)}function dn(e){return E({"~kind":`Any`},{},e)}function fn(e){return O(e,`Any`)}function A(e){return E({"~kind":`Never`},{not:{}},e)}function pn(e){return O(e,`Never`)}function mn(e){return T(e).filter(t=>!Bt(e[t]))}function hn(e){return T(e)}function gn(e){return et(e)}function j(e,t={}){let n=mn(e);return E({"~kind":`Object`},{type:`object`,...n.length>0?{required:n}:{},properties:e},t)}function M(e){return O(e,`Object`)}function _n(e){return wt(e,[`~kind`,`type`,`properties`,`required`])}function N(e,t={}){return E({"~kind":`Union`},{anyOf:e},t)}function P(e){return O(e,`Union`)}function vn(e){return wt(e,[`~kind`,`anyOf`])}function yn(e){return E({"~kind":`Unknown`},{},e)}function bn(e){return O(e,`Unknown`)}function xn(e,t,n){return E({"~kind":`Cyclic`},{$defs:T(e).reduce((t,n)=>({...t,[n]:D(e[n],{},{$id:n})}),{}),$ref:t},n)}function Sn(e){return O(e,`Cyclic`)}function Cn(e){return Fe(e)&&w(e,`~unsafe`)&&Ne(e[`~unsafe`])}function wn(e){return O(e,`Infer`)}function Tn(e){return O(e,`Enum`)}function En(e,t={}){return E({"~kind":`Intersect`},{allOf:e},t)}function F(e){return O(e,`Intersect`)}function Dn(e){return wt(e,[`~kind`,`allOf`])}function On(){throw Error(`Unreachable`)}var kn=e({Hash:()=>nr,HashCode:()=>tr});function An(e){let t=new Set,n=e;for(;n&&n!==Object.prototype;){for(let e of Reflect.ownKeys(n))e!==`constructor`&&typeof e!=`symbol`&&t.add(e);n=Object.getPrototypeOf(n)}return[...t]}function jn(e){return typeof e==`number`}var I;(function(e){e[e.Array=0]=`Array`,e[e.BigInt=1]=`BigInt`,e[e.Boolean=2]=`Boolean`,e[e.Date=3]=`Date`,e[e.Constructor=4]=`Constructor`,e[e.Function=5]=`Function`,e[e.Null=6]=`Null`,e[e.Number=7]=`Number`,e[e.Object=8]=`Object`,e[e.RegExp=9]=`RegExp`,e[e.String=10]=`String`,e[e.Symbol=11]=`Symbol`,e[e.TypeArray=12]=`TypeArray`,e[e.Undefined=13]=`Undefined`})(I||={});let Mn=BigInt(`14695981039346656037`);const[Nn,Pn]=[BigInt(`1099511628211`),BigInt(`18446744073709551616`)],Fn=Array.from({length:256}).map((e,t)=>BigInt(t)),In=new Float64Array(1),Ln=new DataView(In.buffer),Rn=new Uint8Array(In.buffer);function L(e){Mn^=Fn[e],Mn=Mn*Nn%Pn}function zn(e){L(I.Array);for(let t of e)er(t)}function Bn(e){L(I.BigInt),Ln.setBigInt64(0,e);for(let e of Rn)L(e)}function Vn(e){L(I.Boolean),L(+!!e)}function Hn(e){L(I.Constructor),er(e.toString())}function Un(e){L(I.Date),er(e.getTime())}function Wn(e){L(I.Function),er(e.toString())}function Gn(e){L(I.Null)}function Kn(e){L(I.Number),Ln.setFloat64(0,e,!0);for(let e of Rn)L(e)}function qn(e){L(I.Object);for(let t of An(e).sort())er(t),er(e[t])}function Jn(e){L(I.RegExp),Xn(e.toString())}const Yn=new TextEncoder;function Xn(e){L(I.String);for(let t of Yn.encode(e))L(t)}function Zn(e){L(I.Symbol),er(e.toString())}function Qn(e){L(I.TypeArray);let t=new Uint8Array(e.buffer);for(let e=0;e<t.length;e++)L(t[e])}function $n(e){return L(I.Undefined)}function er(e){return st(e)?Qn(e):lt(e)?Un(e):ct(e)?Jn(e):it(e)?Vn(e.valueOf()):ot(e)?Xn(e.valueOf()):at(e)?Kn(e.valueOf()):jn(e)?Kn(e):Te(e)?zn(e):Oe(e)?Vn(e):De(e)?Bn(e):ke(e)?Hn(e):Ne(e)?Gn(e):b(e)?qn(e):x(e)?Xn(e):Ie(e)?Zn(e):Le(e)?$n(e):Ae(e)?Wn(e):On()}function tr(e){return Mn=BigInt(`14695981039346656037`),er(e),Mn}function nr(e){return tr(e).toString(16).padStart(16,`0`)}function rr(e){return Tt(e)&&w(e,`~codec`)&&b(e[`~codec`])&&w(e[`~codec`],`encode`)&&w(e[`~codec`],`decode`)}function ir(e){return E({"~kind":`BigInt`},{type:`bigint`},e)}function ar(e){return O(e,`BigInt`)}function or(e){return O(e,`Boolean`)}const sr=`-?(?:0|[1-9][0-9]*)`;function cr(e){return E({"~kind":`Integer`},{type:`integer`},e)}function lr(e){return O(e,`Integer`)}function ur(e,t){return E({"~kind":`Iterator`},{type:`iterator`,iteratorItems:e},t)}function dr(e){return O(e,`Iterator`)}function fr(e){return wt(e,[`~kind`,`type`,`iteratorItems`])}var pr=class extends Error{constructor(e){super(`Invalid Literal value`),Object.defineProperty(this,"cause",{value:{value:e},writable:!1,configurable:!1,enumerable:!1})}};function mr(e){return De(e)?`bigint`:Oe(e)?`boolean`:Pe(e)?`number`:x(e)?`string`:(()=>{throw new pr(e)})()}function R(e,t){return E({"~kind":`Literal`},{type:mr(e),const:e},t)}function hr(e){return De(e)||Oe(e)||Pe(e)||x(e)}function gr(e){return z(e)&&De(e.const)}function _r(e){return z(e)&&Oe(e.const)}function vr(e){return z(e)&&Pe(e.const)}function yr(e){return z(e)&&x(e.const)}function z(e){return O(e,`Literal`)}function br(e){return E({"~kind":`Null`},{type:`null`},e)}function xr(e){return O(e,`Null`)}const Sr=`-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?`;function Cr(e){return E({"~kind":`Number`},{type:`number`},e)}function wr(e){return O(e,`Number`)}function Tr(e){return E({"~kind":`Symbol`},{type:`symbol`},e)}function Er(e){return O(e,`Symbol`)}function Dr(e){return E({"~kind":`String`},{type:`string`},e)}function Or(e){return O(e,`String`)}function kr(e){let t=Va(e);return S(t.length,2)?t[0]:[]}function Ar(e){return!0}function jr(e){return C(e,(e,t)=>Nr(e)?jr(t):!1,()=>!0)}function Mr(e){return!S(e.length,0)&&jr(e)}function Nr(e){return P(e)?Mr(e.anyOf):z(e)?Ar(e.const):!1}function Pr(e){return Mr(e)}function Fr(e){return E({"~kind":`TemplateLiteral`},{type:`string`,pattern:e},{})}function Ir(e,t,n=[]){return C(e,(e,r)=>Ir(r,t,[...n,`${e}${t}`]),()=>n)}function Lr(e,t){return S(e.length,0)?[`${t}`]:Ir(e,t)}function Rr(e,t,n=[]){return C(t,(t,r)=>Rr(e,r,[...n,...zr(e,t)]),()=>n)}function zr(e,t){return P(t)?Rr(e,t.anyOf):z(t)?Lr(e,t.const):On()}function Br(e,t){return C(t,(t,n)=>Br(zr(e,t),n),()=>e)}function Vr(e){return e.map(e=>R(e))}function Hr(e){return N(Vr(Br([],e)))}function Ur(e){return S(e.length,0)?On():S(e.length,1)&&z(e[0])?e[0]:Hr(e)}function Wr(e){let t=kr(e);return S(t.length,0)?Dr():Pr(t)?Ur(t):Fr(e)}function Gr(e){let t=Wr(e);return co(t)?Dr():t}function Kr(e,t){return E({"~kind":`Record`},{type:`object`,patternProperties:{[e]:t}})}function qr(e){return Kr(Bi,e)}function Jr(e){return j({true:e,false:e})}function Yr(e){return x(e)||Pe(e)?R(e):Ne(e)?br():A()}function Xr(e){return e.map(e=>Yr(e))}function Zr(e){return N(Xr(e))}function Qr(e){return Zr(e.enum)}function $r(e,t){return Fi(Zr(e),t)}function ei(e,t){return Kr(Ri,t)}function ti(e,t={}){let[n,r,i]=[e,e.length,!1];return E({"~kind":`Tuple`},{type:`array`,additionalItems:i,items:n,minItems:r},t)}function B(e){return O(e,`Tuple`)}function ni(e){return wt(e,[`~kind`,`type`,`items`,`minItems`,`additionalItems`])}function ri(e){return e.reduceRight((e,t,n)=>({[n]:t,...e}),{})}function ii(e){return j(ri(e.items))}function ai(e,t){return Wt(e)?!!Wt(t):!1}function oi(e,t){return Bt(e)?!!Bt(t):!1}function si(e,t){let n=ai(e,t),r=oi(e,t),i=Vt(Lt(yi([e,t])));return n&&r?Ht(Rt(i)):n&&!r?Ht(i):!n&&r?Rt(i):i}function ci(e,t,n){return n in e?n in t?si(e[n],t[n]):e[n]:n in t?t[n]:A()}function li(e,t){return[...new Set([...T(t),...T(e)])].reduce((n,r)=>({...n,[r]:ci(e,t,r)}),{})}function ui(e){return M(e)?e.properties:B(e)?ri(e.items):On()}function di(e,t){return j(li(ui(e),ui(t)))}function fi(e,t){let n=ic(e,t);return S(n,`left-inside`)?e:S(n,`right-inside`)||S(n,`equal`)?t:A()}function pi(e){return M(e)||B(e)}function mi(e,t){let n=P(e),r=P(t);return n||r}function hi(e,t){let n=xi(e),r=xi(t),i=mi(n,r),a=pi(n),o=pi(r);return i?yi([n,r]):a&&o?di(n,r):a&&!o?n:!a&&o?r:fi(n,r)}function gi(e,t,n=[]){return C(t,(t,r)=>gi(e,r,[...n,hi(e,t)]),()=>S(n.length,0)?[e]:n)}function _i(e,t,n=[]){return C(e,(e,r)=>_i(r,t,[...n,...vi([e],t)]),()=>n)}function vi(e,t=[]){return C(e,(e,n)=>P(e)?vi(n,_i(e.anyOf,t)):vi(n,gi(e,t)),()=>t)}function yi(e){return lc(vi(e))}function bi(e){return lc(e)}function xi(e){return F(e)?yi(e.allOf):P(e)?bi(e.anyOf):e}function Si(e){return S(e.length,1)?e[0]:S(e.length,0)?A():N(e)}function Ci(e,t){return Fi(yi(e),t)}function wi(e,t){return x(e)||Pe(e)?j({[e]:t}):S(e,!1)?j({false:t}):S(e,!0)?j({true:t}):j({})}function Ti(e,t){return Kr(zi,t)}function Ei(e,t){return w(e,`pattern`)&&(x(e.pattern)||e.pattern instanceof RegExp)?Kr(e.pattern.toString(),t):Kr(Bi,t)}function Di(e,t){return Pr(kr(e))?Fi(Gr(e),t):Kr(e,t)}function Oi(e){return P(e)?ki(e.anyOf):[e]}function ki(e){return e.reduce((e,t)=>[...e,...Oi(t)],[])}function Ai(e){return e.some(e=>Or(e)||wr(e)||lr(e))}function ji(e,t){return S(Ai(e),!0)?Kr(Bi,t):void 0}function Mi(e,t){return e.reduce((e,n)=>z(n)&&(x(n.const)||Pe(n.const))?{...e,[n.const]:t}:e,{})}function Ni(e,t){return j(Mi(e,t))}function Pi(e,t){let n=ki(e),r=ji(n,t);return Tt(r)?r:Ni(n,t)}function Fi(e,t){return fn(e)?qr(t):or(e)?Jr(t):Tn(e)?$r(e.enum,t):lr(e)?ei(e,t):F(e)?Ci(e.allOf,t):z(e)?wi(e.const,t):wr(e)?Ti(e,t):P(e)?Pi(e.anyOf,t):Or(e)?Ei(e,t):co(e)?Di(e.pattern,t):j({})}function Ii(e,t,n){return K([e])?D(Fi(e,t),{},n):Vi(e,t,n)}function Li(e,t,n,r,i){return Ii(q(e,t,n),q(e,t,r),i)}const Ri=`^${sr}$`,zi=`^${Sr}$`,Bi=`^.*$`;function Vi(e,t,n={}){return k(`Record`,[e,t],n)}function Hi(e,t,n={}){return Ii(e,t,n)}function Ui(e,t){return Kr(e,t)}function Wi(e){return T(e.patternProperties)[0]}function Gi(e){let t=Wi(e);return S(t,Bi)?Dr():S(t,Ri)?cr():S(t,zi)?Cr():Wr(t)}function Ki(e){return e.patternProperties[Wi(e)]}function qi(e){return O(e,`Record`)}function Ji(e){return E({"~kind":`Rest`},{type:`rest`,items:e},{})}function Yi(e){return O(e,`Rest`)}function Xi(e){return O(e,`This`)}function Zi(e){return E({"~kind":`Undefined`},{type:`undefined`},e)}function Qi(e){return O(e,`Undefined`)}function $i(e){return O(e,`Void`)}function ea(e){return ir()}function ta(e){return Dr()}function na(e){return Cr()}function ra(e){return cr()}function ia(e){return A()}function aa(e){return R(e)}function oa(e){return e}function sa(e){return N(e[1])}function ca(e){return e.length===3?[...e[0],...e[2]]:e.length===1?[...e[0]]:[]}function la(e){return[e[0],...e[1]]}function ua(e){return e}function da(e){return e[1]}function fa(e){return S(e.length,2)}function pa(e,t,n){return fa(e)?t(e[0],e[1]):n()}function ma(e,t){return S(t.indexOf(e),0)?[e,t.slice(e.length)]:[]}function ha(e,t){for(let n=0;n<e.length;n++){let r=ma(e[n],t);if(fa(r))return r}return[]}function ga(e,t){return Array.from({length:t-e+1},(t,n)=>String.fromCharCode(e+n))}const _a=[...ga(97,122),...ga(65,90)],va=[`0`,...ga(49,57)];function ya(e){let t=e.indexOf(`*/`);return S(t,-1)?``:e.slice(t+2)}function ba(e){let t=e.indexOf(`
2
- `);return S(t,-1)?``:e.slice(t)}function xa(e){return e.replace(/^[ \t\r\f\v]+/,``)}function Sa(e){let t=xa(e);return t.startsWith(`/*`)?Sa(ya(t.slice(2))):t.startsWith(`//`)?Sa(ba(t.slice(2))):t}function Ca(e){let t=e.trimStart();return t.startsWith(`/*`)?Ca(ya(t.slice(2))):t.startsWith(`//`)?Ca(ba(t.slice(2))):t}[...va];function wa(e,t){return ha([e],t)}function Ta(e,t){return S(e,``)?[``,t]:e.startsWith(`
3
- `)?wa(e,Sa(t)):e.startsWith(` `)?wa(e,t):wa(e,Ca(t))}[..._a,...va],[...va];function Ea(e){return S(e,``)?[]:[e.slice(0,1),e.slice(1)]}function Da(e,t){return C(e,(e,n)=>t.startsWith(e)?!0:Da(n,t),()=>!1)}function Oa(e,t,n=``){return pa(Ea(t),(r,i)=>Da(e,t)?[n,t]:Oa(e,i,`${n}${r}`),()=>[])}function ka(e,t){return pa(Oa(e,t),(e,t)=>S(e,``)?[]:[e,t],()=>[])}const V=(e,t,n=()=>[])=>e.length===2?t(e):n(),Aa=e=>V(Ta(`-?(?:0|[1-9][0-9]*)n`,e),([e,t])=>[ea(e),t]),ja=e=>V(Ta(`.*`,e),([e,t])=>[ta(e),t]),Ma=e=>V(Ta(`-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?`,e),([e,t])=>[na(e),t]),Na=e=>V(Ta(`-?(?:0|[1-9][0-9]*)`,e),([e,t])=>[ra(e),t]),Pa=e=>V(Ta(`(?!)`,e),([e,t])=>[ia(e),t]),Fa=e=>V(ka([`-?(?:0|[1-9][0-9]*)n`,`.*`,`-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?`,`-?(?:0|[1-9][0-9]*)`,`(?!)`,`(`,`)`,`$`,`|`],e),([e,t])=>[aa(e),t]),Ia=e=>V(V(Aa(e),([e,t])=>[e,t],()=>V(ja(e),([e,t])=>[e,t],()=>V(Ma(e),([e,t])=>[e,t],()=>V(Na(e),([e,t])=>[e,t],()=>V(Pa(e),([e,t])=>[e,t],()=>V(La(e),([e,t])=>[e,t],()=>V(Fa(e),([e,t])=>[e,t],()=>[]))))))),([e,t])=>[oa(e),t]),La=e=>V(V(Ta(`(`,e),([e,t])=>V(Ba(t),([t,n])=>V(Ta(`)`,n),([n,r])=>[[e,t,n],r]))),([e,t])=>[sa(e),t]),Ra=e=>V(V(V(za(e),([e,t])=>V(Ta(`|`,t),([t,n])=>V(Ra(n),([n,r])=>[[e,t,n],r]))),([e,t])=>[e,t],()=>V(V(za(e),([e,t])=>[[e],t]),([e,t])=>[e,t],()=>V([[],e],([e,t])=>[e,t],()=>[]))),([e,t])=>[ca(e),t]),za=e=>V(V(Ia(e),([e,t])=>V(Ba(t),([t,n])=>[[e,t],n])),([e,t])=>[la(e),t]),Ba=e=>V(V(Ra(e),([e,t])=>[e,t],()=>V(za(e),([e,t])=>[e,t],()=>[])),([e,t])=>[ua(e),t]),Va=e=>V(V(Ta(`^`,e),([e,t])=>V(Ba(t),([t,n])=>V(Ta(`$`,n),([n,r])=>[[e,t,n],r]))),([e,t])=>[da(e),t]);function Ha(e){return e.join(`|`)}function Ua(e){return e.slice(1,e.length-1)}function Wa(e,t,n){return to(t,`${n}${e}`)}function Ga(e,t){return to(e,`${t}-?(?:0|[1-9][0-9]*)n`)}function Ka(e,t){return to(e,`${t}${sr}`)}function qa(e,t){return to(e,`${t}${Sr}`)}function Ja(e,t){return eo(N([R(`false`),R(`true`)]),e,t)}function Ya(e,t){return to(e,`${t}.*`)}function Xa(e,t,n){return to(t,`${n}${Ua(e)}`)}function Za(e,t,n){return eo(io(e,{}),t,n)}function Qa(e,t,n){return $a(Xr(e),t,n)}function $a(e,t,n,r=[]){return C(e,(e,i)=>$a(i,t,n,[...r,eo(e,[],``)]),()=>to(t,`${n}(${Ha(r)})`))}function eo(e,t,n){return Tn(e)?Qa(e.enum,t,n):lr(e)?Ka(t,n):z(e)?Wa(e.const,t,n):ar(e)?Ga(t,n):or(e)?Ja(t,n):wr(e)?qa(t,n):Or(e)?Ya(t,n):co(e)?Xa(e.pattern,t,n):so(e)?Za(e.parameters[0],t,n):P(e)?$a(e.anyOf,t,n):`(?!)`}function to(e,t){return C(e,(e,n)=>eo(e,n,t),()=>t)}function no(e){return`^${to(e,``)}$`}function ro(e){return Fr(no(e))}function io(e,t){return K(e)?D(ro(e),{},t):oo(e,t)}function ao(e,t,n,r){return io(rf(e,t,n),r)}function oo(e,t={}){return k(`TemplateLiteral`,[e],t)}function so(e){return Tt(e)&&w(e,`action`)&&S(e.action,`TemplateLiteral`)}function co(e){return O(e,`TemplateLiteral`)}function lo(e){return E({"~kind":`ExtendsUnion`},{inferred:e})}function uo(e){return b(e)&&w(e,`~kind`)&&w(e,`inferred`)&&S(e[`~kind`],`ExtendsUnion`)&&b(e.inferred)}function H(e){return E({"~kind":`ExtendsTrue`},{inferred:e})}function fo(e){return b(e)&&w(e,`~kind`)&&w(e,`inferred`)&&S(e[`~kind`],`ExtendsTrue`)&&b(e.inferred)}function U(){return E({"~kind":`ExtendsFalse`},{})}function po(e){return b(e)&&w(e,`~kind`)&&S(e[`~kind`],`ExtendsFalse`)}function mo(e){return uo(e)||fo(e)}function ho(e,t,n){return mo(e)?t(e.inferred):n()}function go(e,t,n,r){return ho(G(e,n,r),r=>H(y(y(e,r),{[t]:n})),()=>U())}function _o(e,t){return H(e)}function vo(e,t,n){return G(e,t,Zr(n))}function yo(e,t,n){return C(n,(n,r)=>ho(G(e,t,n),e=>yo(e,t,r),()=>U()),()=>H(e))}function bo(e,t,n){return G(e,t,Gr(n))}function xo(e,t,n){return C(n,(n,r)=>ho(G(e,t,n),e=>H(e),()=>xo(e,t,r)),()=>U())}function W(e,t,n){return fn(n)?_o(e,t):Tn(n)?vo(e,t,n.enum):wn(n)?go(e,n.name,t,n.extends):F(n)?yo(e,t,n.allOf):co(n)?bo(e,t,n.pattern):P(n)?xo(e,t,n.anyOf):bn(n)?H(e):U()}function So(e,t,n){return wn(n)?W(e,t,n):fn(n)||bn(n)?H(e):lo(e)}function Co(e,t){let n=It(e),r=It(t);return n&&r||!n&&r?!0:!(n&&!r)}function wo(e,t,n,r){return Yt(r)?Co(t,r)?G(e,n,r.items):U():W(e,t,r)}function To(e,t,n){return Qt(n)?G(e,t,n.iteratorItems):W(e,Zt(t),n)}function Eo(e,t,n){return ar(n)?H(e):W(e,t,n)}function Do(e,t,n){return or(n)?H(e):W(e,t,n)}function Oo(e,t,n,r,i){let a=wn(r)?t:r,o=wn(r)?r:t,s=Bt(t),c=Bt(r);return!s&&c?U():ho(G(e,a,o),e=>jo(e,n,i),()=>U())}function ko(e,t,n,r){return C(r,(r,i)=>Oo(e,t,n,r,i),()=>Bt(t)?H(e):U())}function Ao(e,t,n){return C(t,(t,r)=>ko(e,t,r,n),()=>H(e))}function jo(e,t,n){return Ao(e,t,n)}function Mo(e,t,n){return $i(n)?H(e):G(e,t,n)}function No(e,t,n,r){return fn(r)||bn(r)?H(e):tn(r)?ho(jo(e,t,r.parameters),e=>Mo(e,n,r.instanceType),()=>U()):U()}function Po(e,t,n){return G(e,Qr(t),n)}function Fo(e,t,n,r){return fn(r)||bn(r)?H(e):an(r)?ho(jo(e,t,r.parameters),e=>Mo(e,n,r.returnType),()=>U()):U()}function Io(e,t,n){return lr(n)||wr(n)?H(e):W(e,t,n)}function Lo(e,t,n){return G(e,yi(t),n)}function Ro(e,t,n){return dr(n)?G(e,t,n.iteratorItems):W(e,ur(t),n)}function zo(e,t,n){return t===n?H(e):U()}function Bo(e,t,n){return z(n)?zo(e,t,n.const):ar(n)?H(e):W(e,R(t),n)}function Vo(e,t,n){return z(n)?zo(e,t,n.const):or(n)?H(e):W(e,R(t),n)}function Ho(e,t,n){return z(n)?zo(e,t,n.const):wr(n)?H(e):W(e,R(t),n)}function Uo(e,t,n){return z(n)?zo(e,t,n.const):Or(n)?H(e):W(e,R(t),n)}function Wo(e,t,n){return De(t.const)?Bo(e,t.const,n):Oe(t.const)?Vo(e,t.const,n):Pe(t.const)?Ho(e,t.const,n):x(t.const)?Uo(e,t.const,n):On()}function Go(e,t,n){return wn(n)?W(e,t,n):H(e)}function Ko(e,t,n){return xr(n)?H(e):W(e,t,n)}function qo(e,t,n){return wr(n)?H(e):W(e,t,n)}function Jo(e,t,n){return Bt(t)?Bt(n)?H(e):U():H(e)}function Yo(e,t,n){return wn(n)&&pn(n.extends)?U():ho(G(e,t,n),e=>Jo(e,t,n),()=>U())}function Xo(e,t){return e.reduce((e,n)=>n in t&&mo(t[n])?{...e,...t[n].inferred}:On(),{})}function Zo(e,t,n){let r={};for(let i of T(n))r[i]=i in t?Yo({},t[i],n[i]):Bt(n[i])?wn(n[i])?H(y(e,{[n[i].name]:n[i].extends})):H(e):U();let i=et(r).every(e=>mo(e)),a=i?Xo(T(r),r):{};return i?H(a):U()}function Qo(e,t,n){let r=Zo(e,t,n);return mo(r)?H(y(e,r.inferred)):U()}function $o(e,t,n){return Qo(e,t,n)}function es(e,t,n){return M(n)?$o(e,t,n.properties):W(e,j(t),n)}function ts(e,t,n){return Mt(n)?G(e,t,n.item):W(e,jt(t),n)}function ns(e,t,n){return Or(n)?H(e):W(e,t,n)}function rs(e,t,n){return Er(n)?H(e):W(e,t,n)}function is(e,t,n){return G(e,Gr(t),n)}function as(e,t){return E({"~kind":`Inferrable`},{name:e,type:t},{})}function os(e){return b(e)&&w(e,`~kind`)&&w(e,`name`)&&w(e,`type`)&&S(e[`~kind`],`Inferrable`)&&x(e.name)&&b(e.type)}function ss(e){return Yi(e)?wn(e.items)?Yt(e.items.extends)?as(e.items.name,e.items.extends.items):bn(e.items.extends)?as(e.items.name,e.items.extends):void 0:On():void 0}function cs(e){return wn(e)?as(e.name,e.extends):void 0}function ls(e,t,n=[]){return C(e,(e,r)=>ho(G({},e,t),()=>ls(r,t,[...n,e]),()=>void 0),()=>n)}function us(e,t,n,r){let i=ls(n,r);return Te(i)?H(y(e,{[t]:ti(i)})):U()}function ds(e,t,n,r){let i=ls(n,r);return Te(i)?H(y(e,{[t]:N(i)})):U()}function fs(e){return[...e].reverse()}function ps(e,t){return t?fs(e):e}function ms(e){let t=e.length>0?e[0]:void 0;return Tt(Tt(t)?ss(t):void 0)}function hs(e,t,n,r,i,a){return ho(G(e,n,i),e=>vs(e,t,r,a),()=>U())}function gs(e,t,n,r,i){let a=ss(r);return os(a)?us(e,a.name,ps(n,t),a.type):C(n,(n,a)=>hs(e,t,n,a,r,i),()=>U())}function _s(e,t,n,r){return C(r,(r,i)=>gs(e,t,n,r,i),()=>S(n.length,0)?H(e):U())}function vs(e,t,n,r){return _s(e,t,n,r)}function ys(e,t,n){let r=nf(e,{callstack:[]},n),i=ms(r);return vs(e,i,ps(t,i),ps(r,i))}function bs(e,t,n){let r=cs(n);return os(r)?ds(e,r.name,t,r.type):C(t,(t,r)=>ho(G(e,t,n),e=>bs(e,r,n),()=>U()),()=>H(e))}function xs(e,t,n){let r=nf(e,{callstack:[]},t);return B(n)?ys(e,r,n.items):Yt(n)?bs(e,r,n.items):W(e,ti(r),n)}function Ss(e,t,n){return $i(n)||Qi(n)?H(e):W(e,t,n)}function Cs(e,t,n){return C(n,(n,r)=>ho(G(e,t,n),e=>H(e),()=>Cs(e,t,r)),()=>U())}function ws(e,t,n){return C(t,(t,r)=>ho(Cs(e,t,n),e=>ws(e,r,n),()=>U()),()=>H(e))}function Ts(e,t,n){let r=cs(n);return os(r)?ds(e,r.name,t,r.type):P(n)?ws(e,t,n.anyOf):ws(e,t,[n])}function Es(e,t,n){return wn(n)?W(e,t,n):fn(n)||bn(n)?H(e):U()}function Ds(e,t,n){return $i(n)?H(e):W(e,t,n)}function G(e,t,n){return fn(t)?So(e,t,n):Yt(t)?wo(e,t,t.items,n):Qt(t)?To(e,t.iteratorItems,n):ar(t)?Eo(e,t,n):or(t)?Do(e,t,n):tn(t)?No(e,t.parameters,t.instanceType,n):Tn(t)?Po(e,t,n):an(t)?Fo(e,t.parameters,t.returnType,n):lr(t)?Io(e,t,n):F(t)?Lo(e,t.allOf,n):dr(t)?Ro(e,t.iteratorItems,n):z(t)?Wo(e,t,n):pn(t)?Go(e,t,n):xr(t)?Ko(e,t,n):wr(t)?qo(e,t,n):M(t)?es(e,t.properties,n):Mt(t)?ts(e,t.item,n):Or(t)?ns(e,t,n):Er(t)?rs(e,t,n):co(t)?is(e,t.pattern,n):B(t)?xs(e,t.items,n):Qi(t)?Ss(e,t,n):P(t)?Ts(e,t.anyOf,n):bn(t)?Es(e,t,n):$i(t)?Ds(e,t,n):U()}function Os(e,t){return yi([...e,j(t)])}function ks(e,t,n){return K(e)?D(Os(e,t),{},n):js(e,t,n)}function As(e,t,n,r,i){return ks(rf(e,t,n),tf(e,t,r),i)}function js(e,t,n={}){return k(`Interface`,[e,t],n)}function Ms(e){return Tt(e)&&w(e,`action`)&&S(e.action,`Interface`)}function Ns(e,t,n){return e.includes(n)?!0:Is([...e,n],t,t[n])}function Ps(e,t,n){return Fs(e,t,gn(n))}function Fs(e,t,n){return C(n,(n,r)=>Is(e,t,n)?!0:Fs(e,t,r),()=>!1)}function Is(e,t,n){return cn(n)?Ns(e,t,n.$ref):Yt(n)?Is(e,t,n.items):Qt(n)?Is(e,t,n.iteratorItems):tn(n)?Fs(e,t,[...n.parameters,n.instanceType]):an(n)?Fs(e,t,[...n.parameters,n.returnType]):Ms(n)?Ps(e,t,n.parameters[1]):F(n)?Fs(e,t,n.allOf):dr(n)?Is(e,t,n.iteratorItems):M(n)?Ps(e,t,n.properties):Mt(n)?Is(e,t,n.item):P(n)?Fs(e,t,n.anyOf):B(n)?Fs(e,t,n.items):qi(n)?Is(e,t,Ki(n)):!1}function Ls(e,t,n){return Is(e,t,n)}function Rs(e,t){return t.reduce((t,n)=>n in e?Ls([n],e,e[n])?[...t,n]:t:On(),[])}function zs(e){return Rs(e,hn(e))}function Bs(e,t,n){return n.includes(t)?n:t in e?Us(e,e[t],[...n,t]):On()}function Vs(e,t,n){return Hs(e,gn(t),n)}function Hs(e,t,n){return t.reduce((t,n)=>Us(e,n,t),n)}function Us(e,t,n){return cn(t)?Bs(e,t.$ref,n):Yt(t)?Us(e,t.items,n):Qt(t)?Us(e,t.iteratorItems,n):tn(t)?Hs(e,[...t.parameters,t.instanceType],n):an(t)?Hs(e,[...t.parameters,t.returnType],n):Ms(t)?Vs(e,t.parameters[1],n):F(t)?Hs(e,t.allOf,n):dr(t)?Us(e,t.iteratorItems,n):M(t)?Vs(e,t.properties,n):Mt(t)?Us(e,t.item,n):P(t)?Hs(e,t.anyOf,n):B(t)?Hs(e,t.items,n):qi(t)?Us(e,Ki(t),n):n}function Ws(e,t,n){return Us(e,n,[t])}function Gs(e){return dn()}function Ks(e){return T(e).reduce((t,n)=>({...t,[n]:Js(e[n])}),{})}function qs(e){return e.reduce((e,t)=>[...e,Js(t)],[])}function Js(e){return cn(e)?Gs(e.$ref):Yt(e)?Jt(Js(e.items),Xt(e)):Qt(e)?Zt(Js(e.iteratorItems)):tn(e)?en(qs(e.parameters),Js(e.instanceType)):an(e)?rn(qs(e.parameters),Js(e.returnType)):F(e)?En(qs(e.allOf)):dr(e)?ur(Js(e.iteratorItems)):M(e)?j(Ks(e.properties)):Mt(e)?jt(Js(e.item)):qi(e)?Hi(Gi(e),Js(Ki(e))):P(e)?N(qs(e.anyOf)):B(e)?ti(qs(e.items)):e}function Ys(e,t){return t in e?Js(e[t]):yn()}function Xs(e){return Ys(e.$defs,e.$ref)}function Zs(e,t,n){let r=rf(e,{callstack:[]},t),i=tf({},{callstack:[]},n);return yi([...r,j(i)])}function Qs(e,t){return T(e).filter(e=>t.includes(e)).reduce((t,n)=>{let r=e[n],i=Ms(r)?Zs(e,r.parameters[0],r.parameters[1]):r;return{...t,[n]:i}},{})}function $s(e,t,n){return xn(Qs(e,Ws(e,t,n)),t)}function ec(e,t){return t in e?cn(e[t])?ec(e,e[t].$ref):e[t]:A()}function tc(e,t){return ec(e,t)}function nc(e){return Sn(e)?Xs(e):Cn(e)?yn():e}function rc(e,t,n){return G(e,nc(t),nc(n))}function ic(e,t){let n=[bn(e)?U():rc({},e,t),bn(e)?H({}):rc({},t,e)];return mo(n[0])&&mo(n[1])?`equal`:mo(n[0])&&po(n[1])?`left-inside`:po(n[0])&&mo(n[1])?`right-inside`:`disjoint`}function ac(e,t){return t.filter(t=>ic(e,t)!==`right-inside`)}function oc(e,t){return S(t.some(t=>{let n=ic(e,t);return S(n,`left-inside`)||S(n,`equal`)}),!1)}function sc(e,t){let n=xi(e);return fn(n)?[n]:oc(n,t)?[...ac(n,t),n]:t}function cc(e){return e.reduce((e,t)=>M(t)?[...e,t]:pn(t)?e:sc(t,e),[])}function lc(e){let t=ki(cc(e));return t.length===0?A():t.length===1?t[0]:N(t)}function uc(e,t){return D(xi(e),{},t)}function dc(e,t,n,r){return uc(q(e,t,n),r)}function fc(e,t=[]){return At(e)&&S(e.action,`Conditional`)?cn(e.parameters[0])?fc(e.parameters[2],fc(e.parameters[3],[...t,e.parameters[0].$ref])):fc(e.parameters[2],fc(e.parameters[3],t)):At(e)&&S(e.action,`Mapped`)&&At(e.parameters[1])&&S(e.parameters[1].action,`KeyOf`)&&cn(e.parameters[1].parameters[0])?[...t,e.parameters[1].parameters[0].$ref]:t}function pc(e,t){return e.reduce((e,n)=>[...e,t.includes(n.name)],[])}function mc(e,t,n=[]){return C(e,(e,r)=>C(t,(t,i)=>mc(r,i,[...n,[t,e]]),()=>n),()=>n)}function hc(e){return P(e)?[...e.anyOf]:[e]}function gc(e,t){return e.reduce((e,n)=>[...e,[...n,t]],[])}function _c(e,t){return t.reduce((t,n)=>[...t,...gc(e,n)],[])}function vc(e){return e.reduce((e,t)=>S(t[0],!0)?_c(e,hc(t[1])):_c(e,[t[1]]),[[]])}function yc(e,t,n){let r=mc(t,pc(e,fc(n)));return At(n)&&S(n.action,`Conditional`)||At(n)&&S(n.action,`Mapped`)?vc(r):[t]}function bc(){return[`(not-resolvable)`,A()]}function xc(){return[`(not-generic)`,A()]}function Sc(e,t,n){return[e,ln(t,n)]}function Cc(e,t,n){return t in e?wc(e,t,e[t],n):bc()}function wc(e,t,n,r){return un(n)?Sc(t,n.parameters,n.expression):cn(n)?Cc(e,n.$ref,r):xc()}function Tc(e,t,n){return wc(e,`(anonymous)`,t,n)}function Ec(e,t,n){if(wn(t)||Rc(t)||mo(rc({},t,n)))return;let r={parameter:e,expect:n,actual:t};throw Error(`Argument for parameter ${e} does not satisfy constraint`,{cause:r})}function Dc(e,t,n,r,i){let a=q(e,t,i);return Ec(n,a,r),y(e,{[n]:a})}function Oc(e,t,n,r,i){let a=q(e,t,n.extends),o=q(e,t,n.equals);return C(i,(i,o)=>kc(Dc(e,t,n.name,a,i),t,r,o),()=>kc(Dc(e,t,n.name,a,o),t,r,[]))}function kc(e,t,n,r){return C(n,(n,i)=>Oc(e,t,n,i,r),()=>e)}function Ac(e,t,n,r){return kc(e,t,n,r)}function jc(e){return Re(e.callstack.length,0)?e.callstack[e.callstack.length-1]:``}function Mc(e,t){return S(jc(e),t)}function Nc(e,t,n,r,i,a){return q(e,t,q(Ac(e,t,r,a),{callstack:[...t.callstack,n.$ref]},i))}function Pc(e,t,n,r,i,a){return a.reduce((a,o)=>[...a,Nc(e,t,n,r,i,o)],[])}function Fc(e,t,n,r,i,a){let o=Pc(e,t,n,r,i,yc(r,a,i));return S(o.length,1)?o[0]:bi(o)}function Ic(e,t,n,r){let i=rf(e,t,r),a=Tc(e,n,r),o=a[0],s=a[1];return un(s)?Mc(t,o)?Lc(sn(o),i):Fc(e,t,sn(o),s.parameters,s.expression,i):Lc(n,i)}function Lc(e,t){return E({"~kind":`Call`},{target:e,arguments:t},{})}function Rc(e){return O(e,`Call`)}function zc(e,t){return e(t)}function Bc(e,t){return x(t)?R(zc(e,t)):R(t)}function Vc(e,t){return Uc(e,Gr(t))}function Hc(e,t){return N(t.map(t=>Uc(e,t)))}function Uc(e,t){return z(t)?Bc(e,t.const):co(t)?Vc(e,t.pattern):P(t)?Hc(e,t.anyOf):t}function Wc(e,t={}){return k(`Capitalize`,[e],t)}function Gc(e,t={}){return k(`Lowercase`,[e],t)}function Kc(e,t={}){return k(`Uncapitalize`,[e],t)}function qc(e,t={}){return k(`Uppercase`,[e],t)}const Jc=e=>e[0].toUpperCase()+e.slice(1),Yc=e=>e.toLowerCase(),Xc=e=>e[0].toLowerCase()+e.slice(1),Zc=e=>e.toUpperCase();function Qc(e,t){return K([e])?D(Uc(Jc,e),{},t):Wc(e,t)}function $c(e,t){return K([e])?D(Uc(Yc,e),{},t):Gc(e,t)}function el(e,t){return K([e])?D(Uc(Xc,e),{},t):Kc(e,t)}function tl(e,t){return K([e])?D(Uc(Zc,e),{},t):qc(e,t)}function nl(e,t,n,r){return Qc(q(e,t,n),r)}function rl(e,t,n,r){return $c(q(e,t,n),r)}function il(e,t,n,r){return el(q(e,t,n),r)}function al(e,t,n,r){return tl(q(e,t,n),r)}function ol(e,t,n,r,i={}){return k(`Conditional`,[e,t,n,r],i)}function sl(e,t,n,r,i,a){let o=rc(e,n,r);return uo(o)?N([q(o.inferred,t,i),q(e,t,a)]):fo(o)?q(o.inferred,t,i):q(e,t,a)}function cl(e,t,n,r,i,a,o){return K([n,r])?D(sl(e,t,n,r,i,a),{},o):ol(n,r,i,a,o)}function ll(e,t,n,r,i,a,o){return cl(e,t,q(e,t,n),q(e,t,r),i,a,o)}function ul(e,t={}){return k(`ConstructorParameters`,[e],t)}function dl(e){return ti(nf({},{callstack:[]},tn(e)?e.parameters:[]))}function fl(e,t){return K([e])?D(dl(e),{},t):ul(e,t)}function pl(e,t,n,r){return fl(q(e,t,n),r)}function ml(e,t,n={}){return k(`Exclude`,[e,t],n)}function hl(e,t){return e.reduce((e,n)=>[...e,...gl(n,t)],[])}function gl(e,t){return mo(rc({},e,t))?[]:[e]}function _l(e,t){return bi(Tn(e)?hl(Xr(e.enum),t):P(e)?hl(ki(e.anyOf),t):gl(e,t))}function vl(e,t,n){return K([e,t])?D(_l(e,t),{},n):ml(e,t,n)}function yl(e,t,n,r,i){return vl(q(e,t,n),q(e,t,r),i)}function bl(e,t,n={}){return k(`Extract`,[e,t],n)}function xl(e,t){return e.reduce((e,n)=>[...e,...Sl(n,t)],[])}function Sl(e,t){return mo(rc({},e,t))?[e]:[]}function Cl(e,t){return bi(Tn(e)?xl(Xr(e.enum),t):P(e)?xl(ki(e.anyOf),t):Sl(e,t))}function wl(e,t,n){return K([e,t])?D(Cl(e,t),{},n):bl(e,t,n)}function Tl(e,t,n,r,i){return wl(q(e,t,n),q(e,t,r),i)}function El(e,t,n={}){return k(`Index`,[e,t],n)}function Dl(e,t){return Fl(tc(e,t))}function Ol(e,t){let n=T(e).filter(e=>!w(t,e)),r=T(t).filter(t=>!w(e,t)),i=T(e).filter(e=>w(t,e)),a=n.reduce((t,n)=>({...t,[n]:e[n]}),{}),o=r.reduce((e,n)=>({...e,[n]:t[n]}),{}),s=i.reduce((n,r)=>({...n,[r]:yi([e[r],t[r]])}),{});return y(y(a,o),s)}function kl(e){return e.reduce((e,t)=>Ol(e,Fl(t)),{})}function Al(e){return e}function jl(e){return Fl(ii(ti(e)))}function Ml(e,t){return T(e).filter(e=>e in t).reduce((n,r)=>({...n,[r]:bi([e[r],t[r]])}),{})}function Nl(e,t){return C(e,(e,n)=>Nl(n,Ml(t,Fl(e))),()=>t)}function Pl(e){return C(e,(e,t)=>Nl(t,Fl(e)),()=>On())}function Fl(e){return Sn(e)?Dl(e.$defs,e.$ref):F(e)?kl(e.allOf):P(e)?Pl(e.anyOf):B(e)?jl(e.items):M(e)?Al(e.properties):{}}function Il(e){return j(Fl(e))}const Ll=RegExp(`^(?:0|[1-9][0-9]*)$`);function Rl(e){let t=`${e}`;return Ll.test(t)?parseInt(t):e}function zl(e){return R(Rl(e))}function Bl(e){return e.map(e=>Vl(e))}function Vl(e){return F(e)?En(Bl(e.allOf)):P(e)?N(Bl(e.anyOf)):z(e)?zl(e.const):e}function Hl(e,t){return mo(rc({},Vl(t),Cr()))?e:z(t)&&S(t.const,`length`)?Cr():A()}function Ul(e,t){return Yl(tc(e,t))}function Wl(e){return e.reduce((e,t)=>[...e,...Yl(t)],[])}function Gl(e){return Wl(Xr(e))}function Kl(e){return Yl(yi(e))}function ql(e){return[`${e}`]}function Jl(e){return Yl(Gr(e))}function Yl(e){return Sn(e)?Ul(e.$defs,e.$ref):Tn(e)?Gl(e.enum):F(e)?Kl(e.allOf):z(e)?ql(e.const):co(e)?Jl(e.pattern):P(e)?Wl(e.anyOf):[]}function Xl(e){return Yl(e)}function Zl(e,t){return t.map(t=>Ql(e,t))}function Ql(e,t){return Yt(t)?Jt(Ql(e,t.items)):Qt(t)?Zt(Ql(e,t.iteratorItems)):tn(t)?en(Zl(e,t.parameters),Ql(e,t.instanceType)):an(t)?rn(Zl(e,t.parameters),Ql(e,t.returnType)):dr(t)?ur(Ql(e,t.iteratorItems)):Mt(t)?jt(Ql(e,t.item)):B(t)?ti(Zl(e,t.items)):P(t)?N(Zl(e,t.anyOf)):F(t)?En(Zl(e,t.allOf)):Xi(t)?j(e):t}function $l(e,t){return Ql(e,t)}function eu(e,t){return $l(e,t in e?e[t]:A())}function tu(e,t){return t.reduce((t,n)=>[...t,eu(e,n)],[])}function nu(e,t){return bi(tu(e,Xl(t)))}const ru=new RegExp(Ri);function iu(e){return e.filter(e=>ru.test(e))}function au(e){return bi(tu(e,iu(hn(e))))}function ou(e,t){return wr(t)?au(e):nu(e,t)}function su(e){return R(Rl(e))}function cu(e){return e.map(e=>lu(e))}function lu(e){return F(e)?En(cu(e.allOf)):P(e)?N(cu(e.anyOf)):z(e)?su(e.const):e}function uu(e,t){return e.reduceRight((e,n,r)=>mo(rc({},R(r),t))?[n,...e]:e,[])}function du(e,t){return Si(uu(e,lu(t)))}function fu(e){return Si(e)}function pu(e,t){return z(t)&&S(t.const,`length`)?R(e.length):wr(t)||lr(t)?fu(e):du(e,t)}function mu(e,t){return Yt(e)?Hl(e.items,t):M(e)?ou(e.properties,t):B(e)?pu(e.items,t):A()}function hu(e){return Sn(e)||F(e)||P(e)?Il(e):e}function gu(e,t,n){return K([e,t])?D(mu(hu(e),t),{},n):El(e,t,n)}function _u(e,t,n,r,i){return gu(q(e,t,n),q(e,t,r),i)}function vu(e,t={}){return k(`InstanceType`,[e],t)}function yu(e){return tn(e)?e.instanceType:A()}function bu(e,t){return K([e])?D(yu(e),{},t):vu(e,t)}function xu(e,t,n,r={}){return bu(q(e,t,n),r)}function Su(e,t={}){return k(`KeyOf`,[e],t)}function Cu(){return N([Cr(),Dr(),Tr()])}function wu(e){return Cr()}function Tu(e){return e.reduce((e,t)=>hr(t)?[...e,R(Rl(t))]:On(),[])}function Eu(e){return Si(Tu(T(e)))}function Du(e){return Gi(e)}function Ou(e){return Si(e.map((e,t)=>R(t)))}function ku(e){return fn(e)?Cu():Yt(e)?wu(e.items):M(e)?Eu(e.properties):qi(e)?Du(e):B(e)?Ou(e.items):A()}function Au(e){return Sn(e)||F(e)||P(e)?Il(e):e}function ju(e,t){return K([e])?D(ku(Au(e)),{},t):Su(e,t)}function Mu(e,t,n,r){return ju(q(e,t,n),r)}function Nu(e,t,n,r,i={}){return k(`Mapped`,[e,t,n,r],i)}function Pu(e){return Lu(Gr(e))}function Fu(e){return e.reduce((e,t)=>[...e,...Lu(t)],[])}function Iu(e){return Pe(e)?[R(`${e}`)]:[R(e)]}function Lu(e){return Tn(e)?Fu(Xr(e.enum)):z(e)?Iu(e.const):co(e)?Pu(e.pattern):P(e)?Fu(e.anyOf):[e]}function Ru(e){return Lu(e)}function zu(e){return co(e)?Gr(e.pattern):e}function Bu(e,t,n,r,i,a){let o=y(e,{[n.name]:r}),s=zu(q(o,t,i)),c=q(o,t,a);return vr(s)||yr(s)?{[s.const]:c}:{}}function Vu(e,t,n,r,i,a){return r.reduce((r,o)=>[...r,Bu(e,t,n,o,i,a)],[])}function Hu(e){return e.reduce((e,t)=>[...e,j(t)],[])}function Uu(e,t,n,r,i,a){return yi(Hu(Vu(e,t,n,Ru(r),i,a)))}function Wu(e,t,n,r,i,a,o){return K([r])?D(Uu(e,t,n,r,i,a),{},o):Nu(n,r,i,a,o)}function Gu(e,t,n,r,i,a,o){return Wu(e,t,n,q(e,t,r),i,a,o)}function Ku(e,t){return T(e).filter(e=>t.includes(e)).reduce((t,n)=>({...t,[n]:$s(e,n,e[n])}),{})}function qu(e,t){return T(e).filter(e=>!t.includes(e)).reduce((t,n)=>({...t,[n]:q(e,{callstack:[]},e[n])}),{})}function Ju(e,t){let n=zs(e),r=Ku(e,n),i=qu(e,n);return D({...r,...i},{},t)}function Yu(e,t,n,r){return Ju(y(e,n),r)}function Xu(e,t={}){return k(`NonNullable`,[e],t)}function Zu(e){return vl(e,N([br(),Zi()]),{})}function Qu(e,t){return K([e])?D(Zu(e),{},t):Xu(e,t)}function $u(e,t,n,r){return Qu(q(e,t,n),r)}function ed(e,t,n={}){return k(`Omit`,[e,t],n)}function td(e){let t=Il(e);return M(t)?t.properties:On()}function nd(e,t){return T(e).reduce((n,r)=>t.includes(r)?n:{...n,[r]:e[r]},{})}function rd(e,t){return j(nd(td(e),Xl(t)))}function id(e,t,n){return K([e,t])?D(rd(e,t),{},n):ed(e,t,n)}function ad(e,t,n,r,i){return id(q(e,t,n),q(e,t,r),i)}function od(e,t){return k(`Options`,[e,t],{})}function sd(e,t){return cd(e,t)}function cd(e,t){return K([e])?D(e,{},t):od(e,t)}function ld(e,t,n,r){return cd(q(e,t,n),r)}function ud(e,t={}){return k(`Parameters`,[e],t)}function dd(e){return ti(nf({},{callstack:[]},an(e)?e.parameters:[]))}function fd(e,t){return K([e])?D(dd(e),{},t):ud(e,t)}function pd(e,t,n,r){return fd(q(e,t,n),r)}function md(e,t={}){return k(`Partial`,[e],t)}function hd(e,t){let n=yd(tc(e,t));return xn(y(e,{[t]:n}),t)}function gd(e){return yi(e.map(e=>yd(e)))}function _d(e){return N(e.map(e=>yd(e)))}function vd(e){return j(T(e).reduce((t,n)=>({...t,[n]:zt(e[n])}),{}))}function yd(e){return Sn(e)?hd(e.$defs,e.$ref):F(e)?gd(e.allOf):P(e)?_d(e.anyOf):M(e)?vd(e.properties):j({})}function bd(e,t){return K([e])?D(yd(e),{},t):md(e,t)}function xd(e,t,n,r){return bd(q(e,t,n),r)}function Sd(e,t,n={}){return k(`Pick`,[e,t],n)}function Cd(e,t){return T(e).reduce((n,r)=>t.includes(r)?y(n,{[r]:e[r]}):n,{})}function wd(e,t){return j(Cd(td(e),Xl(t)))}function Td(e,t,n){return K([e,t])?D(wd(e,t),{},n):Sd(e,t,n)}function Ed(e,t,n,r,i){return Td(q(e,t,n),q(e,t,r),i)}function Dd(e,t={}){return k(`ReadonlyObject`,[e],t)}function Od(e){return Ft(Jt(e))}function kd(e,t){let n=Pd(tc(e,t));return xn(y(e,{[t]:n}),t)}function Ad(e){return yi(e.map(e=>Pd(e)))}function jd(e){return j(T(e).reduce((t,n)=>({...t,[n]:Ut(e[n])}),{}))}function Md(e){return Ft(ti(e))}function Nd(e){return N(e.map(e=>Pd(e)))}function Pd(e){return Yt(e)?Od(e.items):Sn(e)?kd(e.$defs,e.$ref):F(e)?Ad(e.allOf):M(e)?jd(e.properties):B(e)?Md(e.items):P(e)?Nd(e.anyOf):e}function Fd(e,t){return K([e])?D(Pd(e),{},t):Dd(e)}function Id(e,t,n,r){return Fd(q(e,t,n),r)}function Ld(e,t,n,r){return r in e?Ls([r],e,e[r])?n:q(e,t,e[r]):n}function Rd(e,t){let n=Hd(tc(e,t));return xn(y(e,{[t]:n}),t)}function zd(e){return yi(e.map(e=>Hd(e)))}function Bd(e){return N(e.map(e=>Hd(e)))}function Vd(e){return j(T(e).reduce((t,n)=>({...t,[n]:Lt(e[n])}),{}))}function Hd(e){return Sn(e)?Rd(e.$defs,e.$ref):F(e)?zd(e.allOf):P(e)?Bd(e.anyOf):M(e)?Vd(e.properties):j({})}function Ud(e,t={}){return k(`Required`,[e],t)}function Wd(e,t){return K([e])?D(Hd(e),{},t):Ud(e,t)}function Gd(e,t,n,r){return Wd(q(e,t,n),r)}function Kd(e,t={}){return k(`ReturnType`,[e],t)}function qd(e){return an(e)?e.returnType:A()}function Jd(e,t){return K([e])?D(qd(e),{},t):Kd(e,t)}function Yd(e,t,n,r={}){return Jd(q(e,t,n),r)}function Xd(e){return Yi(e)?B(e.items)?Zd(e.items.items):wn(e.items)||cn(e.items)?[e]:[A()]:[e]}function Zd(e){return e.reduce((e,t)=>[...e,...Xd(t)],[])}function K(e){return C(e,(e,t)=>!cn(e)&&K(t),()=>!0)}function Qd(e,t,n){return kt(e)?Qd(e.type,`remove`,n):Dt(e)?Qd(e.type,t,`remove`):Ot(e)?Qd(e.type,`add`,n):Et(e)?Qd(e.type,t,`add`):[e,t,n]}function $d(e,t){return S(e,`remove`)?Vt(t):S(e,`add`)?Ht(t):t}function ef(e,t){return S(e,`remove`)?Lt(t):S(e,`add`)?Rt(t):t}function tf(e,t,n){return T(n).reduce((r,i)=>({...r,[i]:q(e,t,n[i])}),{})}function nf(e,t,n){return Zd(rf(e,t,n))}function rf(e,t,n){return n.map(n=>q(e,t,n))}function af(e,t,n,r,i){return S(n,`Awaited`)?lf(e,t,r[0],i):S(n,`Capitalize`)?nl(e,t,r[0],i):S(n,`Conditional`)?ll(e,t,r[0],r[1],r[2],r[3],i):S(n,`ConstructorParameters`)?pl(e,t,r[0],i):S(n,`Evaluate`)?dc(e,t,r[0],i):S(n,`Exclude`)?yl(e,t,r[0],r[1],i):S(n,`Extract`)?Tl(e,t,r[0],r[1],i):S(n,`Index`)?_u(e,t,r[0],r[1],i):S(n,`InstanceType`)?xu(e,t,r[0],i):S(n,`Interface`)?As(e,t,r[0],r[1],i):S(n,`KeyOf`)?Mu(e,t,r[0],i):S(n,`Lowercase`)?rl(e,t,r[0],i):S(n,`Mapped`)?Gu(e,t,r[0],r[1],r[2],r[3],i):S(n,`Module`)?Yu(e,t,r[0],i):S(n,`NonNullable`)?$u(e,t,r[0],i):S(n,`Pick`)?Ed(e,t,r[0],r[1],i):S(n,`Options`)?ld(e,t,r[0],r[1]):S(n,`Parameters`)?pd(e,t,r[0],i):S(n,`Partial`)?xd(e,t,r[0],i):S(n,`Omit`)?ad(e,t,r[0],r[1],i):S(n,`ReadonlyObject`)?Id(e,t,r[0],i):S(n,`Record`)?Li(e,t,r[0],r[1],i):S(n,`Required`)?Gd(e,t,r[0],i):S(n,`ReturnType`)?Yd(e,t,r[0],i):S(n,`TemplateLiteral`)?ao(e,t,r[0],i):S(n,`Uncapitalize`)?il(e,t,r[0],i):S(n,`Uppercase`)?al(e,t,r[0],i):k(n,r,i)}function q(e,t,n){let r=It(n),i=Qd(n,Wt(n)?`add`:`none`,Bt(n)?`add`:`none`),a=qt(i[0])?i[0].Clone():i[0],o=cn(a)?Ld(e,t,a,a.$ref):Yt(a)?Jt(q(e,t,a.items),Xt(a)):Qt(a)?Zt(q(e,t,a.iteratorItems),$t(a)):Rc(a)?Ic(e,t,a.target,a.arguments):tn(a)?en(rf(e,t,a.parameters),q(e,t,a.instanceType),nn(a)):At(a)?af(e,t,a.action,a.parameters,a.options):an(a)?rn(rf(e,t,a.parameters),q(e,t,a.returnType),on(a)):F(a)?En(rf(e,t,a.allOf),Dn(a)):dr(a)?ur(q(e,t,a.iteratorItems),fr(a)):M(a)?j(tf(e,t,a.properties),_n(a)):Mt(a)?jt(q(e,t,a.item),Nt(a)):qi(a)?Ui(Wi(a),q(e,t,Ki(a))):Yi(a)?Ji(q(e,t,a.items)):B(a)?ti(nf(e,t,a.items),ni(a)):P(a)?N(rf(e,t,a.anyOf),vn(a)):a,s=r?Ft(o):o;return $d(i[1],ef(i[2],s))}function of(e,t){return q(e,{callstack:[]},t)}function sf(e){return Mt(e)?sf(e.item):e}function cf(e,t){return K([e])?D(sf(e),{},t):uf(e,t)}function lf(e,t,n,r){return cf(q(e,t,n),r)}function uf(e,t={}){return k(`Awaited`,[e],t)}function df(e,t={}){return uc(e,t)}const ff=Symbol.for(`yaml.alias`),pf=Symbol.for(`yaml.document`),mf=Symbol.for(`yaml.map`),hf=Symbol.for(`yaml.pair`),gf=Symbol.for(`yaml.scalar`),_f=Symbol.for(`yaml.seq`),vf=Symbol.for(`yaml.node.type`),yf=e=>!!e&&typeof e==`object`&&e[vf]===ff,bf=e=>!!e&&typeof e==`object`&&e[vf]===pf,xf=e=>!!e&&typeof e==`object`&&e[vf]===mf,J=e=>!!e&&typeof e==`object`&&e[vf]===hf,Y=e=>!!e&&typeof e==`object`&&e[vf]===gf,Sf=e=>!!e&&typeof e==`object`&&e[vf]===_f;function Cf(e){if(e&&typeof e==`object`)switch(e[vf]){case mf:case _f:return!0}return!1}function X(e){if(e&&typeof e==`object`)switch(e[vf]){case ff:case mf:case gf:case _f:return!0}return!1}const wf=e=>(Y(e)||Cf(e))&&!!e.anchor,Tf=Symbol(`break visit`),Ef=Symbol(`skip children`),Df=Symbol(`remove node`);function Of(e,t){let n=Mf(t);bf(e)?kf(null,e.contents,n,Object.freeze([e]))===Df&&(e.contents=null):kf(null,e,n,Object.freeze([]))}Of.BREAK=Tf,Of.SKIP=Ef,Of.REMOVE=Df;function kf(e,t,n,r){let i=Nf(e,t,n,r);if(X(i)||J(i))return Pf(e,r,i),kf(e,i,n,r);if(typeof i!=`symbol`){if(Cf(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=kf(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===Tf)return Tf;else i===Df&&(t.items.splice(e,1),--e)}}else if(J(t)){r=Object.freeze(r.concat(t));let e=kf(`key`,t.key,n,r);if(e===Tf)return Tf;e===Df&&(t.key=null);let i=kf(`value`,t.value,n,r);if(i===Tf)return Tf;i===Df&&(t.value=null)}}return i}async function Af(e,t){let n=Mf(t);bf(e)?await jf(null,e.contents,n,Object.freeze([e]))===Df&&(e.contents=null):await jf(null,e,n,Object.freeze([]))}Af.BREAK=Tf,Af.SKIP=Ef,Af.REMOVE=Df;async function jf(e,t,n,r){let i=await Nf(e,t,n,r);if(X(i)||J(i))return Pf(e,r,i),jf(e,i,n,r);if(typeof i!=`symbol`){if(Cf(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=await jf(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===Tf)return Tf;else i===Df&&(t.items.splice(e,1),--e)}}else if(J(t)){r=Object.freeze(r.concat(t));let e=await jf(`key`,t.key,n,r);if(e===Tf)return Tf;e===Df&&(t.key=null);let i=await jf(`value`,t.value,n,r);if(i===Tf)return Tf;i===Df&&(t.value=null)}}return i}function Mf(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function Nf(e,t,n,r){if(typeof n==`function`)return n(e,t,r);if(xf(t))return n.Map?.(e,t,r);if(Sf(t))return n.Seq?.(e,t,r);if(J(t))return n.Pair?.(e,t,r);if(Y(t))return n.Scalar?.(e,t,r);if(yf(t))return n.Alias?.(e,t,r)}function Pf(e,t,n){let r=t[t.length-1];if(Cf(r))r.items[e]=n;else if(J(r))e===`key`?r.key=n:r.value=n;else if(bf(r))r.contents=n;else{let e=yf(r)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}const Ff={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},If=e=>e.replace(/[!,[\]{}]/g,e=>Ff[e]);var Lf=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},e.defaultTags);break}return t}add(t,n){this.atNextDocument&&=(this.yaml={explicit:e.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},e.defaultTags),!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case`%TAG`:{if(r.length!==2&&(n(0,`%TAG directive should contain exactly two parts`),r.length<2))return!1;let[e,t]=r;return this.tags[e]=t,!0}case`%YAML`:{if(this.yaml.explicit=!0,r.length!==1)return n(0,`%YAML directive should contain exactly one part`),!1;let[e]=r;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let t=/^\d+\.\d+$/.test(e);return n(6,`Unsupported YAML version ${e}`,t),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e===`!`)return`!`;if(e[0]!==`!`)return t(`Not a valid tag: ${e}`),null;if(e[1]===`<`){let n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return n===`!`?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+If(e.substring(n.length));return e[0]===`!`?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||`1.2`}`]:[],n=Object.entries(this.tags),r;if(e&&n.length>0&&X(e.contents)){let t={};Of(e.contents,(e,n)=>{X(n)&&n.tag&&(t[n.tag]=!0)}),r=Object.keys(t)}else r=[];for(let[i,a]of n)i===`!!`&&a===`tag:yaml.org,2002:`||(!e||r.some(e=>e.startsWith(a)))&&t.push(`%TAG ${i} ${a}`);return t.join(`
4
- `)}};Lf.defaultYaml={explicit:!1,version:`1.2`},Lf.defaultTags={"!!":`tag:yaml.org,2002:`};function Rf(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function zf(e,t,n,r){if(r&&typeof r==`object`)if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=zf(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=zf(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=zf(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=zf(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}return e.call(t,n,r)}function Bf(e,t,n){if(Array.isArray(e))return e.map((e,t)=>Bf(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!wf(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var Vf=class{constructor(e){Object.defineProperty(this,vf,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!bf(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=Bf(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?zf(i,{"":o},``,o):o}},Hf=class extends Vf{constructor(e){super(ff),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],Of(e,{Node:(e,t)=>{(yf(t)||wf(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}return r}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:r,maxAliasCount:i}=t,a=this.resolve(r,t);if(!a){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}let o=n.get(a);if(o||=(Bf(a,null,t),n.get(a)),o?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=Uf(r,a,n)),o.count*o.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`);return o.res}toString(e,t,n){let r=`*${this.source}`;if(e){if(Rf(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function Uf(e,t,n){if(yf(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(Cf(t)){let r=0;for(let i of t.items){let t=Uf(e,i,n);t>r&&(r=t)}return r}else if(J(t)){let r=Uf(e,t.key,n),i=Uf(e,t.value,n);return Math.max(r,i)}return 1}const Wf=e=>!e||typeof e!=`function`&&typeof e!=`object`;var Z=class extends Vf{constructor(e){super(gf),this.value=e}toJSON(e,t){return t?.keep?this.value:Bf(this.value,e,t)}toString(){return String(this.value)}};Z.BLOCK_FOLDED=`BLOCK_FOLDED`,Z.BLOCK_LITERAL=`BLOCK_LITERAL`,Z.PLAIN=`PLAIN`,Z.QUOTE_DOUBLE=`QUOTE_DOUBLE`,Z.QUOTE_SINGLE=`QUOTE_SINGLE`;function Gf(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function Kf(e,t,n){if(bf(e)&&(e=e.contents),X(e))return e;if(J(e)){let t=n.schema[mf].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??=i(e),new Hf(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=`tag:yaml.org,2002:`+t.slice(2));let l=Gf(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new Z(e);return c&&(c.node=t),t}l=e instanceof Map?o[mf]:Symbol.iterator in Object(e)?o[_f]:o[mf]}a&&(a(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from==`function`?l.nodeClass.from(n.schema,e,n):new Z(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}function qf(e,t,n){let r=n;for(let e=t.length-1;e>=0;--e){let n=t[e];if(typeof n==`number`&&Number.isInteger(n)&&n>=0){let e=[];e[n]=r,r=e}else r=new Map([[n,r]])}return Kf(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}const Jf=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done;var Yf=class extends Vf{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>X(t)||J(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Jf(e))this.add(t);else{let[n,...r]=e,i=this.get(n,!0);if(Cf(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(n,qf(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let r=this.get(t,!0);if(Cf(r))return r.deleteIn(n);throw Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...r]=e,i=this.get(n,!0);return r.length===0?!t&&Y(i)?i.value:i:Cf(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!J(t))return!1;let n=t.value;return n==null||e&&Y(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let r=this.get(t,!0);return Cf(r)?r.hasIn(n):!1}setIn(e,t){let[n,...r]=e;if(r.length===0)this.set(n,t);else{let e=this.get(n,!0);if(Cf(e))e.setIn(r,t);else if(e===void 0&&this.schema)this.set(n,qf(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}};const Xf=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function Zf(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Qf=(e,t,n)=>e.endsWith(`
5
- `)?Zf(n,t):n.includes(`
6
- `)?`
7
- `+Zf(n,t):(e.endsWith(` `)?``:` `)+n,$f=`flow`;function ep(e,t,n=`flow`,{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!i||i<0)return e;i<a&&(a=0);let c=Math.max(1+a,1+i-t.length);if(e.length<=c)return e;let l=[],u={},d=i-t.length;typeof r==`number`&&(r>i-Math.max(2,a)?l.push(0):d=i-r);let f,p,m=!1,h=-1,g=-1,ee=-1;n===`block`&&(h=tp(e,h,t.length),h!==-1&&(d=h+c));for(let r;r=e[h+=1];){if(n===`quoted`&&r===`\\`){switch(g=h,e[h+1]){case`x`:h+=3;break;case`u`:h+=5;break;case`U`:h+=9;break;default:h+=1}ee=h}if(r===`
8
- `)n===`block`&&(h=tp(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==`
9
- `&&p!==` `){let t=e[h+1];t&&t!==` `&&t!==`
10
- `&&t!==` `&&(f=h)}if(h>=d)if(f)l.push(f),d=f+c,f=void 0;else if(n===`quoted`){for(;p===` `||p===` `;)p=r,r=e[h+=1],m=!0;let t=h>ee+1?h-2:g-1;if(u[t])return e;l.push(t),u[t]=!0,d=t+c,f=void 0}else m=!0}p=r}if(m&&s&&s(),l.length===0)return e;o&&o();let _=e.slice(0,l[0]);for(let r=0;r<l.length;++r){let i=l[r],a=l[r+1]||e.length;i===0?_=`\n${t}${e.slice(0,a)}`:(n===`quoted`&&u[i]&&(_+=`${e[i]}\\`),_+=`\n${t}${e.slice(i+1,a)}`)}return _}function tp(e,t,n){let r=t,i=t+1,a=e[i];for(;a===` `||a===` `;)if(t<i+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
11
- `);r=t,i=t+1,a=e[i]}return r}const np=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),rp=e=>/^(%|---|\.\.\.)/m.test(e);function ip(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let t=0,n=0;t<i;++t)if(e[t]===`
12
- `){if(t-n>r)return!0;if(n=t+1,i-n<=r)return!1}return!0}function ap(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(rp(e)?` `:``),o=``,s=0;for(let e=0,t=n[e];t;t=n[++e])if(t===` `&&n[e+1]===`\\`&&n[e+2]===`n`&&(o+=n.slice(s,e)+`\\ `,e+=1,s=e,t=`\\`),t===`\\`)switch(n[e+1]){case`u`:{o+=n.slice(s,e);let t=n.substr(e+2,4);switch(t){case`0000`:o+=`\\0`;break;case`0007`:o+=`\\a`;break;case`000b`:o+=`\\v`;break;case`001b`:o+=`\\e`;break;case`0085`:o+=`\\N`;break;case`00a0`:o+=`\\_`;break;case`2028`:o+=`\\L`;break;case`2029`:o+=`\\P`;break;default:t.substr(0,2)===`00`?o+=`\\x`+t.substr(2):o+=n.substr(e,6)}e+=5,s=e+1}break;case`n`:if(r||n[e+2]===`"`||n.length<i)e+=1;else{for(o+=n.slice(s,e)+`
13
-
14
- `;n[e+2]===`\\`&&n[e+3]===`n`&&n[e+4]!==`"`;)o+=`
15
- `,e+=2;o+=a,n[e+2]===` `&&(o+=`\\`),e+=1,s=e+1}break;default:e+=1}return o=s?o+n.slice(s):n,r?o:ep(o,a,`quoted`,np(t,!1))}function op(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
16
- `)||/[ \t]\n|\n[ \t]/.test(e))return ap(e,t);let n=t.indent||(rp(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:ep(r,n,$f,np(t,!1))}function sp(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=ap;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?op:i&&!t?ap:n?op:ap}return r(e,t)}let cp;try{cp=RegExp(`(^|(?<!
17
- ))
18
- +(?!
19
- |$)`,`g`)}catch{cp=/\n+(?!\n|$)/g}function lp({comment:e,type:t,value:n},r,i,a){let{blockQuote:o,commentString:s,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n))return sp(n,r);let l=r.indent||(r.forceBlockIndent||rp(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===Z.BLOCK_FOLDED?!1:t===Z.BLOCK_LITERAL||!ip(n,c,l.length);if(!n)return u?`|
20
- `:`>
21
- `;let d,f;for(f=n.length;f>0;--f){let e=n[f-1];if(e!==`
22
- `&&e!==` `&&e!==` `)break}let p=n.substring(f),m=p.indexOf(`
23
- `);m===-1?d=`-`:n===p||m!==p.length-1?(d=`+`,a&&a()):d=``,p&&=(n=n.slice(0,-p.length),p[p.length-1]===`
24
- `&&(p=p.slice(0,-1)),p.replace(cp,`$&${l}`));let h=!1,g,ee=-1;for(g=0;g<n.length;++g){let e=n[g];if(e===` `)h=!0;else if(e===`
25
- `)ee=g;else break}let _=n.substring(0,ee<g?ee+1:g);_&&=(n=n.substring(_.length),_.replace(/\n+/g,`$&${l}`));let v=(h?l?`2`:`1`:``)+d;if(e&&(v+=` `+s(e.replace(/ ?[\r\n]+/g,` `)),i&&i()),!u){let e=n.replace(/\n+/g,`
26
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\n+/g,`$&${l}`),i=!1,a=np(r,!0);o!==`folded`&&t!==Z.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=ep(`${_}${e}${p}`,l,`block`,a);if(!i)return`>${v}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${v}\n${l}${_}${n}${p}`}function up(e,t,n,r){let{type:i,value:a}=e,{actualString:o,implicitKey:s,indent:c,indentStep:l,inFlow:u}=t;if(s&&a.includes(`
27
- `)||u&&/[[\]{},]/.test(a))return sp(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
28
- `)?sp(a,t):lp(e,t,n,r);if(!s&&!u&&i!==Z.PLAIN&&a.includes(`
29
- `))return lp(e,t,n,r);if(rp(a)){if(c===``)return t.forceBlockIndent=!0,lp(e,t,n,r);if(s&&c===l)return sp(a,t)}let d=a.replace(/\n+/g,`$&\n${c}`);if(o){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(d),{compat:n,tags:r}=t.doc.schema;if(r.some(e)||n?.some(e))return sp(a,t)}return s?d:ep(d,c,$f,np(t,!1))}function dp(e,t,n,r){let{implicitKey:i,inFlow:a}=t,o=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:s}=e;s!==Z.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=Z.QUOTE_DOUBLE);let c=e=>{switch(e){case Z.BLOCK_FOLDED:case Z.BLOCK_LITERAL:return i||a?sp(o.value,t):lp(o,t,n,r);case Z.QUOTE_DOUBLE:return ap(o.value,t);case Z.QUOTE_SINGLE:return op(o.value,t);case Z.PLAIN:return up(o,t,n,r);default:return null}},l=c(s);if(l===null){let{defaultKeyType:e,defaultStringType:n}=t.options,r=i&&e||n;if(l=c(r),l===null)throw Error(`Unsupported default string type ${r}`)}return l}function fp(e,t){let n=Object.assign({blockQuote:!0,commentString:Xf,defaultKeyType:null,defaultStringType:`PLAIN`,directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:`false`,flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:`null`,simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:`true`,verifyAliasOrder:!0},e.schema.toStringOptions,t),r;switch(n.collectionStyle){case`block`:r=!1;break;case`flow`:r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:r,options:n}}function pp(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let n,r;if(Y(t)){r=t.value;let i=e.filter(e=>e.identify?.(r));if(i.length>1){let e=i.filter(e=>e.test);e.length>0&&(i=e)}n=i.find(e=>e.format===t.format)??i.find(e=>!e.format)}else r=t,n=e.find(e=>e.nodeClass&&r instanceof e.nodeClass);if(!n){let e=r?.constructor?.name??(r===null?`null`:typeof r);throw Error(`Tag not resolved for ${e} value`)}return n}function mp(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(Y(e)||Cf(e))&&e.anchor;a&&Rf(a)&&(n.add(a),i.push(`&${a}`));let o=e.tag??(t.default?null:t.tag);return o&&i.push(r.directives.tagString(o)),i.join(` `)}function hp(e,t,n,r){if(J(e))return e.toString(t,n,r);if(yf(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,a=X(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=pp(t.doc.schema.tags,a);let o=mp(a,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);let s=typeof i.stringify==`function`?i.stringify(a,t,n,r):Y(a)?dp(a,t,n,r):a.toString(t,n,r);return o?Y(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function gp({key:e,value:t},n,r,i){let{allNullValues:a,doc:o,indent:s,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,f=X(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(Cf(e)||!X(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let p=!d&&(!e||f&&t==null&&!n.inFlow||Cf(e)||(Y(e)?e.type===Z.BLOCK_FOLDED||e.type===Z.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=hp(e,n,()=>m=!0,()=>h=!0);if(!p&&!n.inFlow&&g.length>1024){if(d)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);p=!0}if(n.inFlow){if(a||t==null)return m&&r&&r(),g===``?`?`:p?`? ${g}`:g}else if(a&&!d||t==null&&p)return g=`? ${g}`,f&&!m?g+=Qf(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=Qf(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=Qf(g,n.indent,l(f))));let ee,_,v;X(t)?(ee=!!t.spaceBefore,_=t.commentBefore,v=t.comment):(ee=!1,_=null,v=null,t&&typeof t==`object`&&(t=o.createNode(t))),n.implicitKey=!1,!p&&!f&&Y(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&Sf(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let te=!1,ne=hp(t,n,()=>te=!0,()=>h=!0),re=` `;if(f||ee||_){if(re=ee?`
30
- `:``,_){let e=l(_);re+=`\n${Zf(e,n.indent)}`}ne===``&&!n.inFlow?re===`
31
- `&&v&&(re=`
32
-
33
- `):re+=`\n${n.indent}`}else if(!p&&Cf(t)){let e=ne[0],r=ne.indexOf(`
34
- `),i=r!==-1,a=n.inFlow??t.flow??t.items.length===0;if(i||!a){let t=!1;if(i&&(e===`&`||e===`!`)){let n=ne.indexOf(` `);e===`&`&&n!==-1&&n<r&&ne[n+1]===`!`&&(n=ne.indexOf(` `,n+1)),(n===-1||r<n)&&(t=!0)}t||(re=`\n${n.indent}`)}}else(ne===``||ne[0]===`
35
- `)&&(re=``);return g+=re+ne,n.inFlow?te&&r&&r():v&&!te?g+=Qf(g,n.indent,l(v)):h&&i&&i(),g}function _p(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}const vp={identify:e=>e===`<<`||typeof e==`symbol`&&e.description===`<<`,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new Z(Symbol(`<<`)),{addToJSMap:bp}),stringify:()=>`<<`},yp=(e,t)=>(vp.identify(t)||Y(t)&&(!t.type||t.type===Z.PLAIN)&&vp.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===vp.tag&&e.default);function bp(e,t,n){let r=Sp(e,n);if(Sf(r))for(let n of r.items)xp(e,t,n);else if(Array.isArray(r))for(let n of r)xp(e,t,n);else xp(e,t,r)}function xp(e,t,n){let r=Sp(e,n);if(!xf(r))throw Error(`Merge sources must be maps or map aliases`);let i=r.toJSON(null,e,Map);for(let[e,n]of i)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0});return t}function Sp(e,t){return e&&yf(t)?t.resolve(e.doc,e):t}function Cp(e,t,{key:n,value:r}){if(X(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(yp(e,n))bp(e,t,r);else{let i=Bf(n,``,e);if(t instanceof Map)t.set(i,Bf(r,i,e));else if(t instanceof Set)t.add(i);else{let a=wp(n,i,e),o=Bf(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function wp(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(X(e)&&n?.doc){let t=fp(n.doc,{});t.anchors=new Set;for(let e of n.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;let r=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(r);e.length>40&&(e=e.substring(0,36)+`..."`),_p(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function Tp(e,t,n){return new Ep(Kf(e,void 0,n),Kf(t,void 0,n))}var Ep=class e{constructor(e,t=null){Object.defineProperty(this,vf,{value:hf}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return X(n)&&(n=n.clone(t)),X(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return Cp(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?gp(this,e,t,n):JSON.stringify(this)}};function Dp(e,t,n){return(t.inFlow??e.flow?kp:Op)(e,t,n)}function Op({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:a,type:null}),d=!1,f=[];for(let e=0;e<t.length;++e){let i=t[e],o=null;if(X(i))!d&&i.spaceBefore&&f.push(``),Ap(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(J(i)){let e=X(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),Ap(n,f,e.commentBefore,d))}d=!1;let s=hp(i,u,()=>o=null,()=>d=!0);o&&(s+=Qf(s,a,l(o))),d&&o&&(d=!1),f.push(r+s)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let e=1;e<f.length;++e){let t=f[e];p+=t?`\n${c}${t}`:`
36
- `}}return e?(p+=`
37
- `+Zf(l(e),c),s&&s()):d&&o&&o(),p}function kp({items:e},t,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:a,flowCollectionPadding:o,options:{commentString:s}}=t;r+=a;let c=Object.assign({},t,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let n=0;n<e.length;++n){let i=e[n],a=null;if(X(i))i.spaceBefore&&d.push(``),Ap(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(J(i)){let e=X(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),Ap(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=X(i.value)?i.value:null;n?(n.comment&&(a=n.comment),n.commentBefore&&(l=!0)):i.value==null&&e?.comment&&(a=e.comment)}a&&(l=!0);let o=hp(i,c,()=>a=null);l||=d.length>u||o.includes(`
38
- `),n<e.length-1?o+=`,`:t.options.trailingComma&&(t.options.lineWidth>0&&(l||=d.reduce((e,t)=>e+t.length+2,2)+(o.length+2)>t.options.lineWidth),l&&(o+=`,`)),a&&(o+=Qf(o,r,s(a))),d.push(o),u=d.length}let{start:f,end:p}=n;if(d.length===0)return f+p;if(!l){let e=d.reduce((e,t)=>e+t.length+2,2);l=t.options.lineWidth>0&&e>t.options.lineWidth}if(l){let e=f;for(let t of d)e+=t?`\n${a}${i}${t}`:`
39
- `;return`${e}\n${i}${p}`}else return`${f}${o}${d.join(` `)}${o}${p}`}function Ap({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=Zf(t(r),e);n.push(i.trimStart())}}function jp(e,t){let n=Y(t)?t.value:t;for(let r of e)if(J(r)&&(r.key===t||r.key===n||Y(r.key)&&r.key.value===n))return r}var Mp=class extends Yf{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(mf,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,a=new this(e),o=(e,o)=>{if(typeof i==`function`)o=i.call(t,e,o);else if(Array.isArray(i)&&!i.includes(e))return;(o!==void 0||r)&&a.items.push(Tp(e,o,n))};if(t instanceof Map)for(let[e,n]of t)o(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))o(e,t[e]);return typeof e.sortMapEntries==`function`&&a.items.sort(e.sortMapEntries),a}add(e,t){let n;n=J(e)?e:!e||typeof e!=`object`||!(`key`in e)?new Ep(e,e?.value):new Ep(e.key,e.value);let r=jp(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);Y(r.value)&&Wf(n.value)?r.value.value=n.value:r.value=n.value}else if(i){let e=this.items.findIndex(e=>i(n,e)<0);e===-1?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=jp(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=jp(this.items,e)?.value;return(!t&&Y(n)?n.value:n)??void 0}has(e){return!!jp(this.items,e)}set(e,t){this.add(new Ep(e,t),!0)}toJSON(e,t,n){let r=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(let e of this.items)Cp(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!J(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Dp(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}};const Np={collection:`map`,default:!0,nodeClass:Mp,tag:`tag:yaml.org,2002:map`,resolve(e,t){return xf(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>Mp.from(e,t,n)};var Pp=class extends Yf{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(_f,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=Fp(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=Fp(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&Y(r)?r.value:r}has(e){let t=Fp(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=Fp(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];Y(r)&&Wf(t)?r.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let r=0;for(let e of this.items)n.push(Bf(e,String(r++),t));return n}toString(e,t,n){return e?Dp(this,e,{blockItemPrefix:`- `,flowChars:{start:`[`,end:`]`},itemIndent:(e.indent||``)+` `,onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let a of t){if(typeof r==`function`){let n=t instanceof Set?a:String(e++);a=r.call(t,n,a)}i.items.push(Kf(a,void 0,n))}}return i}};function Fp(e){let t=Y(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}const Ip={collection:`seq`,default:!0,nodeClass:Pp,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return Sf(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>Pp.from(e,t,n)};function Lp(e){return typeof e==`bigint`||Number.isInteger(e)}const Rp=({value:e})=>JSON.stringify(e),zp=[{identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify:Rp},{identify:e=>e==null,createNode:()=>new Z(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^null$/,resolve:()=>null,stringify:Rp},{identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^true$|^false$/,resolve:e=>e===`true`,stringify:Rp},{identify:Lp,default:!0,tag:`tag:yaml.org,2002:int`,test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>Lp(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:Rp}];[Np,Ip].concat(zp,{default:!0,tag:``,test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}});function Bp(e,t,n){let{replacer:r}=n,i=new Pp(e);i.tag=`tag:yaml.org,2002:pairs`;let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof r==`function`&&(e=r.call(t,String(a++),e));let o,s;if(Array.isArray(e))if(e.length===2)o=e[0],s=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`);else if(e&&e instanceof Object){let t=Object.keys(e);if(t.length===1)o=t[0],s=e[o];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else o=e;i.items.push(Tp(o,s,n))}return i}var Vp=class e extends Pp{constructor(){super(),this.add=Mp.prototype.add.bind(this),this.delete=Mp.prototype.delete.bind(this),this.get=Mp.prototype.get.bind(this),this.has=Mp.prototype.has.bind(this),this.set=Mp.prototype.set.bind(this),this.tag=e.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let e of this.items){let r,i;if(J(e)?(r=Bf(e.key,``,t),i=Bf(e.value,r,t)):r=Bf(e,``,t),n.has(r))throw Error(`Ordered maps must not include duplicate keys`);n.set(r,i)}return n}static from(e,t,n){let r=Bp(e,t,n),i=new this;return i.items=r.items,i}};Vp.tag=`tag:yaml.org,2002:omap`;var Hp=class e extends Mp{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=J(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new Ep(e.key,null):new Ep(e,null),jp(this.items,t.key)||this.items.push(t)}get(e,t){let n=jp(this.items,e);return!t&&J(n)?Y(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=jp(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new Ep(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw Error(`Set items must all have null values`)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)typeof r==`function`&&(e=r.call(t,e,e)),i.items.push(Tp(e,null,n));return i}};Hp.tag=`tag:yaml.org,2002:set`;const Up=Symbol(`break visit`),Wp=Symbol(`skip children`),Gp=Symbol(`remove item`);function Kp(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),qp(Object.freeze([]),e,t)}Kp.BREAK=Up,Kp.SKIP=Wp,Kp.REMOVE=Gp,Kp.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(t&&`items`in t)n=t.items[r];else return}return n},Kp.parentCollection=(e,t)=>{let n=Kp.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&`items`in i)return i;throw Error(`Parent collection not found`)};function qp(e,t,n){let r=n(t,e);if(typeof r==`symbol`)return r;for(let i of[`key`,`value`]){let a=t[i];if(a&&`items`in a){for(let t=0;t<a.items.length;++t){let r=qp(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===Up)return Up;else r===Gp&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}t(((e,t)=>{function n(e){return Array.isArray(e)?e:[e]}let r=/^\s+$/,i=/(?:[^\\]|^)\\$/,a=/^\\!/,o=/^\\#/,s=/\r?\n/g,c=/^\.{0,2}\/|^\.{1,2}$/,l=/\/$/,u=`node-ignore`;typeof Symbol<`u`&&(u=Symbol.for(`node-ignore`));let d=u,f=(e,t,n)=>(Object.defineProperty(e,t,{value:n}),n),p=/([0-z])-([0-z])/g,m=()=>!1,h=e=>e.replace(p,(e,t,n)=>t.charCodeAt(0)<=n.charCodeAt(0)?e:``),g=e=>{let{length:t}=e;return e.slice(0,t-t%2)},ee=[[/^\uFEFF/,()=>``],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,n)=>t+(n.indexOf(`\\`)===0?` `:``)],[/(\\+?)\s/g,(e,t)=>{let{length:n}=t;return t.slice(0,n-n%2)+` `}],[/[\\$.|*+(){^]/g,e=>`\\${e}`],[/(?!\\)\?/g,()=>`[^/]`],[/^\//,()=>`^`],[/\//g,()=>`\\/`],[/^\^*\\\*\\\*\\\//,()=>`^(?:.*\\/)?`],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?`^`:`(?:^|\\/)`}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,n)=>t+6<n.length?`(?:\\/[^\\/]+)*`:`\\/.+`],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(e,t,n)=>t+n.replace(/\\\*/g,`[^\\/]*`)],[/\\\\\\(?=[$.|*+(){^])/g,()=>`\\`],[/\\\\/g,()=>`\\`],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,n,r,i)=>t===`\\`?`\\[${n}${g(r)}${i}`:i===`]`&&r.length%2==0?`[${h(n)}${r}]`:`[]`],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`]],_=/(^|\\\/)?\\\*$/,v=`regex`,te=`checkRegex`,ne={[v](e,t){return`${t?`${t}[^/]+`:`[^/]*`}(?=$|\\/$)`},[te](e,t){return`${t?`${t}[^/]*`:`[^/]*`}(?=$|\\/$)`}},re=e=>ee.reduce((t,[n,r])=>t.replace(n,r.bind(e)),e),ie=e=>typeof e==`string`,ae=e=>e&&ie(e)&&!r.test(e)&&!i.test(e)&&e.indexOf(`#`)!==0,oe=e=>e.split(s).filter(Boolean);var se=class{constructor(e,t,n,r,i,a){this.pattern=e,this.mark=t,this.negative=i,f(this,`body`,n),f(this,`ignoreCase`,r),f(this,`regexPrefix`,a)}get regex(){let e=`_regex`;return this[e]?this[e]:this._make(v,e)}get checkRegex(){let e=`_checkRegex`;return this[e]?this[e]:this._make(te,e)}_make(e,t){let n=this.regexPrefix.replace(_,ne[e]),r=this.ignoreCase?new RegExp(n,`i`):new RegExp(n);return f(this,t,r)}};let ce=({pattern:e,mark:t},n)=>{let r=!1,i=e;i.indexOf(`!`)===0&&(r=!0,i=i.substr(1)),i=i.replace(a,`!`).replace(o,`#`);let s=re(i);return new se(e,t,i,n,r,s)};var le=class{constructor(e){this._ignoreCase=e,this._rules=[]}_add(e){if(e&&e[d]){this._rules=this._rules.concat(e._rules._rules),this._added=!0;return}if(ie(e)&&(e={pattern:e}),ae(e.pattern)){let t=ce(e,this._ignoreCase);this._added=!0,this._rules.push(t)}}add(e){return this._added=!1,n(ie(e)?oe(e):e).forEach(this._add,this),this._added}test(e,t,n){let r=!1,i=!1,a;this._rules.forEach(o=>{let{negative:s}=o;i===s&&r!==i||s&&!r&&!i&&!t||o[n].test(e)&&(r=!s,i=s,a=s?void 0:o)});let o={ignored:r,unignored:i};return a&&(o.rule=a),o}};let ue=(e,t)=>{throw new t(e)},y=(e,t,n)=>ie(e)?e?!y.isNotRelative(e)||n(`path should be a \`path.relative()\`d string, but got "${t}"`,RangeError):n(`path must not be empty`,TypeError):n(`path must be a string, but got \`${t}\``,TypeError),de=e=>c.test(e);y.isNotRelative=de,y.convert=e=>e;var fe=class{constructor({ignorecase:e=!0,ignoreCase:t=e,allowRelativePaths:n=!1}={}){f(this,d,!0),this._rules=new le(t),this._strictPathCheck=!n,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add(e){return this._rules.add(e)&&this._initCache(),this}addPattern(e){return this.add(e)}_test(e,t,n,r){let i=e&&y.convert(e);return y(i,e,this._strictPathCheck?ue:m),this._t(i,t,n,r)}checkIgnore(e){if(!l.test(e))return this.test(e);let t=e.split(`/`).filter(Boolean);if(t.pop(),t.length){let e=this._t(t.join(`/`)+`/`,this._testCache,!0,t);if(e.ignored)return e}return this._rules.test(e,!1,te)}_t(e,t,n,r){if(e in t)return t[e];if(r||=e.split(`/`).filter(Boolean),r.pop(),!r.length)return t[e]=this._rules.test(e,n,v);let i=this._t(r.join(`/`)+`/`,t,n,r);return t[e]=i.ignored?i:this._rules.test(e,n,v)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return n(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}};let pe=e=>new fe(e),me=e=>y(e&&y.convert(e),e,m),he=()=>{y.convert=e=>/^\\\\\?\\/.test(e)||/["<>|\u0000-\u001F]+/u.test(e)?e:e.replace(/\\/g,`/`);let e=/^[a-z]:\//i;y.isNotRelative=t=>e.test(t)||de(t)};typeof process<`u`&&process.platform===`win32`&&he(),t.exports=pe,pe.default=pe,t.exports.isPathValid=me,f(t.exports,Symbol.for(`setupWindows`),he)}))(),globalThis.Buffer,j({command:Dr({description:`Bash command to execute`}),timeout:zt(Cr({description:`Timeout in seconds (optional, no default timeout)`}))});var Jp=class{diff(e,t,n={}){let r;typeof n==`function`?(r=n,n={}):`callback`in n&&(r=n.callback);let i=this.castInput(e,n),a=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),s=this.removeEmpty(this.tokenize(a,n));return this.diffWithOptionsObj(o,s,n,r)}diffWithOptionsObj(e,t,n,r){let i=e=>{if(e=this.postProcess(e,n),r){setTimeout(function(){r(e)},0);return}else return e},a=t.length,o=e.length,s=1,c=a+o;n.maxEditLength!=null&&(c=Math.min(c,n.maxEditLength));let l=n.timeout??1/0,u=Date.now()+l,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=o&&f+1>=a)return i(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,m=1/0,h=()=>{for(let r=Math.max(p,-s);r<=Math.min(m,s);r+=2){let s,c=d[r-1],l=d[r+1];c&&(d[r-1]=void 0);let u=!1;if(l){let e=l.oldPos-r;u=l&&0<=e&&e<a}let h=c&&c.oldPos+1<o;if(!u&&!h){d[r]=void 0;continue}if(s=!h||u&&c.oldPos<l.oldPos?this.addToPath(l,!0,!1,0,n):this.addToPath(c,!1,!0,1,n),f=this.extractCommon(s,t,e,r,n),s.oldPos+1>=o&&f+1>=a)return i(this.buildValues(s.lastComponent,t,e))||!0;d[r]=s,s.oldPos+1>=o&&(m=Math.min(m,r-1)),f+1>=a&&(p=Math.max(p,r+1))}s++};if(r)(function e(){setTimeout(function(){if(s>c||Date.now()>u)return r(void 0);h()||e()},0)})();else for(;s<=c&&Date.now()<=u;){let e=h();if(e)return e}}addToPath(e,t,n,r,i){let a=e.lastComponent;return a&&!i.oneChangePerToken&&a.added===t&&a.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:a.count+1,added:t,removed:n,previousComponent:a.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:a}}}extractCommon(e,t,n,r,i){let a=t.length,o=n.length,s=e.oldPos,c=s-r,l=0;for(;c+1<a&&s+1<o&&this.equals(n[s+1],t[c+1],i);)c++,s++,l++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return l&&!i.oneChangePerToken&&(e.lastComponent={count:l,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=s,c}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join(``)}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){let r=[],i;for(;e;)r.push(e),i=e.previousComponent,delete e.previousComponent,e=i;r.reverse();let a=r.length,o=0,s=0,c=0;for(;o<a;o++){let e=r[o];if(e.removed)e.value=this.join(n.slice(c,c+e.count)),c+=e.count;else{if(!e.added&&this.useLongestToken){let r=t.slice(s,s+e.count);r=r.map(function(e,t){let r=n[c+t];return r.length>e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(s,s+e.count));s+=e.count,e.added||(c+=e.count)}}return r}};new class extends Jp{};function Yp(e,t){let n;for(n=0;n<e.length&&n<t.length;n++)if(e[n]!=t[n])return e.slice(0,n);return e.slice(0,n)}function Xp(e,t){let n;if(!e||!t||e[e.length-1]!=t[t.length-1])return``;for(n=0;n<e.length&&n<t.length;n++)if(e[e.length-(n+1)]!=t[t.length-(n+1)])return e.slice(-n);return e.slice(-n)}function Zp(e,t,n){if(e.slice(0,t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(t)}; this is a bug`);return n+e.slice(t.length)}function Qp(e,t,n){if(!t)return e+n;if(e.slice(-t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(t)}; this is a bug`);return e.slice(0,-t.length)+n}function $p(e,t){return Zp(e,t,``)}function em(e,t){return Qp(e,t,``)}function tm(e,t){return t.slice(0,nm(e,t))}function nm(e,t){let n=0;e.length>t.length&&(n=e.length-t.length);let r=t.length;e.length<t.length&&(r=e.length);let i=Array(r),a=0;i[0]=0;for(let e=1;e<r;e++){for(t[e]==t[a]?i[e]=i[a]:i[e]=a;a>0&&t[e]!=t[a];)a=i[a];t[e]==t[a]&&a++}a=0;for(let r=n;r<e.length;r++){for(;a>0&&e[r]!=t[a];)a=i[a];e[r]==t[a]&&a++}return a}function rm(e,t){let n=[];for(let r of Array.from(t.segment(e))){let e=r.segment;n.length&&/\s/.test(n[n.length-1])&&/\s/.test(e)?n[n.length-1]+=e:n.push(e)}return n}function im(e,t){if(t)return om(e,t)[1];let n;for(n=e.length-1;n>=0&&e[n].match(/\s/);n--);return e.substring(n+1)}function am(e,t){if(t)return om(e,t)[0];let n=e.match(/^\s*/);return n?n[0]:``}function om(e,t){if(!t)return[am(e),im(e)];if(t.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);let n=rm(e,t),r=n[0],i=n[n.length-1];return[/\s/.test(r)?r:``,/\s/.test(i)?i:``]}const sm=`a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}`,cm=RegExp(`[${sm}]+|\\s+|[^${sm}]`,`ug`);new class extends Jp{equals(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()}tokenize(e,t={}){let n;if(t.intlSegmenter){let r=t.intlSegmenter;if(r.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);n=rm(e,r)}else n=e.match(cm)||[];let r=[],i=null;return n.forEach(e=>{/\s/.test(e)?i==null?r.push(e):r.push(r.pop()+e):i!=null&&/\s/.test(i)?r[r.length-1]==i?r.push(r.pop()+e):r.push(i+e):r.push(e),i=e}),r}join(e){return e.map((e,t)=>t==0?e:e.replace(/^\s+/,``)).join(``)}postProcess(e,t){if(!e||t.oneChangePerToken)return e;let n=null,r=null,i=null;return e.forEach(e=>{e.added?r=e:e.removed?i=e:((r||i)&&lm(n,i,r,e,t.intlSegmenter),n=e,r=null,i=null)}),(r||i)&&lm(n,i,r,null,t.intlSegmenter),e}};function lm(e,t,n,r,i){if(t&&n){let[a,o]=om(t.value,i),[s,c]=om(n.value,i);if(e){let r=Yp(a,s);e.value=Qp(e.value,s,r),t.value=$p(t.value,r),n.value=$p(n.value,r)}if(r){let e=Xp(o,c);r.value=Zp(r.value,c,e),t.value=em(t.value,e),n.value=em(n.value,e)}}else if(n){if(e){let e=am(n.value,i);n.value=n.value.substring(e.length)}if(r){let e=am(r.value,i);r.value=r.value.substring(e.length)}}else if(e&&r){let n=am(r.value,i),[a,o]=om(t.value,i),s=Yp(n,a);t.value=$p(t.value,s);let c=Xp($p(n,s),o);t.value=em(t.value,c),r.value=Zp(r.value,n,c),e.value=Qp(e.value,n,n.slice(0,n.length-c.length))}else if(r){let e=am(r.value,i),n=tm(im(t.value,i),e);t.value=em(t.value,n)}else if(e){let n=tm(im(e.value,i),am(t.value,i));t.value=$p(t.value,n)}}new class extends Jp{tokenize(e){let t=RegExp(`(\\r?\\n)|[${sm}]+|[^\\S\\n\\r]+|[^${sm}]`,`ug`);return e.match(t)||[]}},new class extends Jp{constructor(){super(...arguments),this.tokenize=um}equals(e,t,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
40
- `))&&(e=e.trim()),(!n.newlineIsToken||!t.includes(`
41
- `))&&(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith(`
42
- `)&&(e=e.slice(0,-1)),t.endsWith(`
43
- `)&&(t=t.slice(0,-1))),super.equals(e,t,n)}};function um(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
44
- `));let n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let e=0;e<r.length;e++){let i=r[e];e%2&&!t.newlineIsToken?n[n.length-1]+=i:n.push(i)}return n}function dm(e){return e==`.`||e==`!`||e==`?`}new class extends Jp{tokenize(e){let t=[],n=0;for(let r=0;r<e.length;r++){if(r==e.length-1){t.push(e.slice(n));break}if(dm(e[r])&&e[r+1].match(/\s/)){for(t.push(e.slice(n,r+1)),r=n=r+1;e[r+1]?.match(/\s/);)r++;t.push(e.slice(n,r+1)),n=r+1}}return t}},new class extends Jp{tokenize(e){return e.split(/([{}:;,]|\s+)/)}},new class extends Jp{constructor(){super(...arguments),this.tokenize=um}get useLongestToken(){return!0}castInput(e,t){let{undefinedReplacement:n,stringifyReplacer:r=(e,t)=>t===void 0?n:t}=t;return typeof e==`string`?e:JSON.stringify(fm(e,null,null,r),null,` `)}equals(e,t,n){return super.equals(e.replace(/,([\r\n])/g,`$1`),t.replace(/,([\r\n])/g,`$1`),n)}};function fm(e,t,n,r,i){t||=[],n||=[],r&&(e=r(i===void 0?``:i,e));let a;for(a=0;a<t.length;a+=1)if(t[a]===e)return n[a];let o;if(Object.prototype.toString.call(e)===`[object Array]`){for(t.push(e),o=Array(e.length),n.push(o),a=0;a<e.length;a+=1)o[a]=fm(e[a],t,n,r,String(a));return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),typeof e==`object`&&e){t.push(e),o={},n.push(o);let i=[],s;for(s in e)Object.prototype.hasOwnProperty.call(e,s)&&i.push(s);for(i.sort(),a=0;a<i.length;a+=1)s=i[a],o[s]=fm(e[s],t,n,r,s);t.pop(),n.pop()}else o=e;return o}new class extends Jp{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};const pm=j({oldText:Dr({description:`Exact text for one targeted replacement. It must be unique in the original file and must not overlap with any other edits[].oldText in the same call.`}),newText:Dr({description:`Replacement text for this targeted edit.`})},{});j({path:Dr({description:`Path to the file to edit (relative or absolute)`}),edits:Jt(pm,{description:`One or more targeted replacements. Each edit is matched against the original file, not incrementally. Do not include overlapping or nested edits. If two changes touch the same block or nearby lines, merge them into one edit instead.`})},{}),j({path:Dr({description:`Path to the file to read (relative or absolute)`}),offset:zt(Cr({description:`Line number to start reading from (1-indexed)`})),limit:zt(Cr({description:`Maximum number of lines to read`}))}),j({path:Dr({description:`Path to the file to write (relative or absolute)`}),content:Dr({description:`Content to write to the file`})});const mm={enabled:!0,reserveTokens:16384,keepRecentTokens:2e4};function hm(e,t,n){return n.enabled?e>t-n.reserveTokens:!1}function gm(e){if(typeof e==`string`)return e.length;let t=0;for(let n of e)n.type===`text`&&n.text?t+=n.text.length:n.type===`image`&&(t+=4800);return t}function _m(e){let t=0;switch(e.role){case`user`:return t=gm(e.content),Math.ceil(t/4);case`assistant`:{let n=e;for(let e of n.content)e.type===`text`?t+=e.text.length:e.type===`thinking`?t+=e.thinking.length:e.type===`toolCall`&&(t+=e.name.length+JSON.stringify(e.arguments).length);return Math.ceil(t/4)}case`custom`:case`toolResult`:return t=gm(e.content),Math.ceil(t/4);case`bashExecution`:return t=e.command.length+e.output.length,Math.ceil(t/4);case`branchSummary`:case`compactionSummary`:return t=e.summary.length,Math.ceil(t/4)}return 0}const vm=n(`context-compaction`);function ym(e,t){return e.role===t}function bm(e){let t=0;for(;t<e.length&&ym(e[t],`toolResult`);){let n=e[t];vm.warn(`Dropping orphaned toolResult (no preceding assistant message)`,{toolCallId:n.toolCallId}),t++}return t>0?e.slice(t):e}function xm(e){let t=[];for(let n of e){let e=n;switch(e.role){case`user`:t.push(`<user>\n${Sm(e.content)}\n</user>`);break;case`assistant`:t.push(`<assistant>\n${Sm(e.content)}\n</assistant>`);break;case`toolResult`:{let n=e.toolName??`tool`;t.push(`<tool-result name="${n}">\n${Sm(e.content)}\n</tool-result>`);break}case`bashExecution`:t.push(`<bash>\n$ ${e.command??``}\n${e.output??``}\n</bash>`);break;case`branchSummary`:case`compactionSummary`:t.push(`<prior-summary>\n${e.summary??``}\n</prior-summary>`);break;default:t.push(`<${e.role}>\n${Sm(e.content)}\n</${e.role}>`)}}return t.join(`
45
-
46
- `)}function Sm(e){if(typeof e==`string`)return e;if(!Array.isArray(e))return``;let t=[];for(let n of e){let e=n;e.type===`text`&&e.text?t.push(e.text):e.type===`thinking`&&e.thinking?t.push(`[thinking] ${e.thinking}`):e.type===`toolCall`?t.push(`[tool-call ${e.name??`?`}] ${JSON.stringify(e.arguments??{})}`):e.type===`image`&&t.push(`[image]`)}return t.join(`
47
- `)}function Cm(e){return`You are a context compaction assistant. You are shown the prefix of a conversation between a user and an AI coding assistant, and asked to produce either a structured summary, durable memory bullets, or a short title — depending on the user's instruction.
48
-
49
- Do NOT continue the conversation. Do NOT answer questions inside the conversation. Output ONLY what the user asks for in the format specified.
50
-
51
- <conversation>
52
- ${e}
53
- </conversation>`}async function wm(e,t,n,r,i,a,o){let s=await te(e,{systemPrompt:n,messages:[{role:`user`,content:[{type:`text`,text:r}],timestamp:Date.now()}]},{maxTokens:i,apiKey:t,headers:a,signal:o});if(s.stopReason===`error`)throw Error(`Compaction call failed: ${s.errorMessage||`Unknown error`}`);return s.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
54
- `).trim()}function Tm(e){if(typeof e==`string`)return e.length;if(!Array.isArray(e))return 0;let t=0;for(let n of e){let e=n;if(e.type===`text`&&e.text)t+=e.text.length;else if(e.type===`thinking`&&e.thinking)t+=e.thinking.length;else if(e.type===`toolCall`&&e.arguments!==void 0)try{t+=JSON.stringify(e.arguments).length}catch{}else e.type===`image`&&e.source?.data&&(t+=e.source.data.length)}return t}function Em(e,t){let n=Math.max(1,Math.round(e/1024));return`[${t===`assistant`?`Assistant message elided`:`Tool result elided`}: ${n} KB, exceeds half the context window. Re-run with smaller arguments — e.g. open --view --size low.]`}function Dm(e,t,n){let r=(t-n)/2,i=0,a=0;return{messages:e.map(e=>{if(_m(e)<=r)return e;let t=e.role;if(t!==`toolResult`&&t!==`assistant`)return e;let n=e,o=Tm(n.content);if(t===`toolResult`)return i++,a+=o,{...e,content:[{type:`text`,text:Em(o,`toolResult`)}]};let s=(Array.isArray(n.content)?n.content:[]).filter(e=>e.type===`toolCall`);if(s.length===0)return e;let c=s.map(e=>{let t=0;if(e.arguments!==void 0)try{t=JSON.stringify(e.arguments).length}catch{}return{type:e.type,id:e.id,name:e.name,arguments:{elided:!0,originalBytes:t}}});return i++,a+=o,{...e,content:[{type:`text`,text:Em(o,`assistant`)},...c]}}),elidedCount:i,elidedBytes:a}}function Om(e){let t=0;for(let n of e)t+=_m(n);return t}function km(e,t){try{e.onCompactionStateChange?.(t)}catch(e){vm.warn(`onCompactionStateChange listener threw`,{error:e instanceof Error?e.message:String(e)})}}function Am(e,t,n,r,i,a){if(t<=n*i)return{messages:e,isHopeless:!1,earlyReturn:null};let o=Dm(e,n,r),s=o.messages;return vm.warn(`Compaction hopeless branch`,{totalTokens:t,contextWindow:n,multiplier:i,elidedCount:o.elidedCount,elidedBytes:o.elidedBytes}),{messages:s,isHopeless:!0,earlyReturn:hm(Om(s),n,a)?null:s}}function jm(e,t){let n=0,r=e.length;for(let i=e.length-1;i>=0;i--){let a=_m(e[i]);if(n+a>t&&r<e.length)break;n+=a,r=i}for(;r>0&&ym(e[r],`toolResult`);)r--;return r<=0||r>=e.length?(vm.warn(`Cannot find valid cut point for compaction`),null):{messagesToSummarize:e.slice(0,r),messagesToKeep:bm(e.slice(r))}}async function Mm(e,t,n,r){if(e.onMemoryUpdates)try{km(e,`extracting-memory`);let i=await wm(e.model,t,n,`From the conversation above, extract durable memories worth persisting to a global memory file shared across future sessions.
55
-
56
- Focus on:
57
- - User preferences, working style, opinions stated explicitly.
58
- - Stable project facts (architecture decisions, conventions, constraints).
59
- - Validated approaches the user accepted ("yes, exactly", "perfect"), not just corrections.
60
- - External resources/links the user named.
61
-
62
- DO NOT include:
63
- - Ephemeral state (current task, in-progress work).
64
- - Information already obvious from the codebase (file paths, function names, framework conventions).
65
- - Generic restatements of what the conversation was about.
66
-
67
- If nothing in the conversation is worth persisting, return exactly the single line:
68
- NONE
69
-
70
- Otherwise, output ONLY a markdown bullet list (one bullet per memory), no headers, no preamble, no follow-up. Each bullet is one line. Be specific. Prefer one fact per bullet over multi-clause sentences.`,2048,e.headers,r);if(i?.trim()&&i.trim()!==`NONE`)try{await e.onMemoryUpdates(i.trim()),vm.info(`Memory extraction applied`,{bulletsLength:i.length})}catch(e){vm.warn(`onMemoryUpdates callback threw`,{error:e instanceof Error?e.message:String(e)})}else vm.info(`Memory extraction returned no durable memories`)}catch(e){vm.warn(`Memory extraction call failed (compaction still applied)`,{error:e instanceof Error?e.message:String(e)})}}async function Nm(e,t,n,r,i,a,o){try{let s=Cm(xm(n)),c=Math.floor(.8*i);km(e,`summarizing`);let l=await wm(e.model,t,s,`Produce a structured context checkpoint summary of the conversation above that another LLM can use to continue the work.
71
-
72
- Use this EXACT format:
73
-
74
- ## Goal
75
- [What is the user trying to accomplish? Can be multiple items if the session covers different tasks.]
76
-
77
- ## Constraints & Preferences
78
- - [Any constraints, preferences, or requirements mentioned by user]
79
- - [Or "(none)" if none were mentioned]
80
-
81
- ## Progress
82
- ### Done
83
- - [x] [Completed tasks/changes]
84
-
85
- ### In Progress
86
- - [ ] [Current work]
87
-
88
- ### Blocked
89
- - [Issues preventing progress, if any]
90
-
91
- ## Key Decisions
92
- - **[Decision]**: [Brief rationale]
93
-
94
- ## Next Steps
95
- 1. [Ordered list of what should happen next]
96
-
97
- ## Critical Context
98
- - [Any data, examples, or references needed to continue]
99
- - [Or "(none)" if not applicable]
100
-
101
- Keep each section concise. Preserve exact file paths, function names, and error messages. Output ONLY the summary, with no preamble or follow-up.`,c,e.headers,o),u={role:`user`,content:[{type:`text`,text:`<context-summary>\n${l}\n</context-summary>`}],timestamp:Date.now()};return vm.info(`LLM summarization successful`,{originalMessages:a,compactedMessages:1+r.length,summaryLength:l.length}),await Mm(e,t,s,o),km(e,`idle`),[u,...r]}catch(e){return vm.warn(`LLM summarization failed, falling back to naive drop`,{error:e instanceof Error?e.message:String(e)}),null}}function Pm(e){let t=e.contextWindow??2e5,n=e.reserveTokens??mm.reserveTokens,r=e.keepRecentTokens??mm.keepRecentTokens,i=e.hopelessMultiplier??4,a={enabled:!0,reserveTokens:n,keepRecentTokens:r};return async(o,s)=>{if(o.length===0)return o;let c=Om(o);if(!hm(c,t,a))return o;let l=Am(o,c,t,n,i,a);if(l.earlyReturn)return l.earlyReturn;let u=l.messages,d=l.isHopeless;vm.info(`Context compaction triggered`,{totalTokens:c,contextWindow:t,threshold:t-n,messageCount:u.length});let f=jm(u,r);if(!f)return u;let{messagesToSummarize:p,messagesToKeep:m}=f;vm.info(`Compaction cut point`,{summarizing:p.length,keeping:m.length});let h=d?void 0:e.getApiKey();if(h){let t=await Nm(e,h,p,m,n,o.length,s);if(t)return t}else d||vm.warn(`No API key available for LLM summarization, falling back to naive drop`);km(e,`idle`);let g={role:`user`,content:[{type:`text`,text:`[Earlier conversation messages were compacted to save context space]`}],timestamp:Date.now()};return vm.info(`Naive compaction applied`,{originalMessages:o.length,compactedMessages:1+m.length}),[g,...m]}}const Fm=g({portName:`secrets.crud`,panelRpcOp:`secrets-bridge`,timeoutMs:1e4,onUnavailable:`resolve-undefined`,makeError:e=>Error(e),logNamespace:`secrets-bridge`,toPortMessage:({type:e,payload:t})=>({type:e,...t}),toPanelRpcPayload:({type:e,payload:t})=>({type:e,payload:t})});function Im(e,t){return Fm({type:e,payload:t})}const Lm=n(`secret-scrub`),Rm=async e=>e;function zm(){let e=ce();return e===`extension-direct`?async e=>{if(!e)return e;try{let t=await new Promise(t=>{chrome.runtime.sendMessage({type:`secrets.scrub-tool-result`,text:e},e=>t(e??{}))});return t.error?(Lm.debug(`SW scrub-tool-result returned error`,{error:t.error}),e):typeof t.text==`string`?t.text:e}catch(t){return Lm.debug(`SW scrub-tool-result failed`,{error:t instanceof Error?t.message:String(t)}),e}}:e===`extension-delegate`?async e=>{if(!e)return e;try{let t=await Im(`secrets.scrub-tool-result`,{text:e});return t?.error?(Lm.debug(`Bridge scrub-tool-result returned error`,{error:t.error}),e):typeof t?.text==`string`?t.text:e}catch(t){return Lm.debug(`Bridge scrub-tool-result failed`,{error:t instanceof Error?t.message:String(t)}),e}}:e===`connect`?Rm:async e=>{if(!e)return e;try{let t=await fetch(d(`/api/secrets/scrub`),{method:`POST`,headers:f({"content-type":`application/json`}),body:JSON.stringify({text:e})});if(!t.ok)return Lm.debug(`Server scrub-tool-result returned non-ok`,{status:t.status}),e;let n=await t.json();return typeof n.text==`string`?n.text:e}catch(t){return Lm.debug(`Server scrub-tool-result failed`,{error:t instanceof Error?t.message:String(t)}),e}}}const Bm=n(`image-processor`),Vm=3932160,Hm=new Set([`image/jpeg`,`image/png`,`image/gif`,`image/webp`]);function Um(e){return Hm.has(e)}function Wm(e){let t=e.replace(/[\t\n\f\r ]/g,``),n=t.length%4;return n===2?`${t}==`:n===3?`${t}=`:t}function Gm(e,t){let n=l(Wm(e.slice(0,t)));return new DataView(n.buffer,n.byteOffset,n.byteLength)}function Km(e,t){return e>0&&t>0?{width:e,height:t}:null}function qm(e){if(e.length<32)return null;let t=Gm(e,32);return Km(t.getUint32(16,!1),t.getUint32(20,!1))}function Jm(e){if(e.length<16)return null;let t=Gm(e,16);return Km(t.getUint16(6,!0),t.getUint16(8,!0))}function Ym(e){let t=Gm(e,Math.min(21846*4,e.length));for(let e=0;e<t.byteLength-8;e++){if(t.getUint8(e)!==255)continue;let n=t.getUint8(e+1);if(n===192||n===194)return Km(t.getUint16(e+7,!1),t.getUint16(e+5,!1))}return null}function Xm(e,t){try{let n=Wm(e);if(t===`image/png`)return qm(n);if(t===`image/gif`)return Jm(n);if(t===`image/jpeg`)return Ym(n)}catch{}return null}async function Zm(e){if(!Um(e.mimeType))return Bm.warn(`Unsupported image format`,{mimeType:e.mimeType}),{type:`text`,text:`[Image removed: unsupported format "${e.mimeType}". Supported: JPEG, PNG, GIF, WebP]`};let t=e.data.length,n=Xm(e.data,e.mimeType);if(!(t>5242880||n!==null&&(n.width>8e3||n.height>8e3)||n!==null&&Math.max(n.width,n.height)>1568))return e;Bm.info(`Image needs processing`,{base64Size:t,dimensions:n?`${n.width}x${n.height}`:`unknown`,reason:t>5242880?`size`:`dimensions`});let r,i;try{let e=await import(`./magick-wasm-CTgpng4k.js`).then(e=>e.r);r=e.getMagick,i=e.MIME_TO_MAGICK_FORMAT}catch(e){return Bm.error(`ImageMagick WASM module unavailable`,{error:e instanceof Error?e.message:String(e)}),{type:`text`,text:`[Image removed: resize service unavailable (ImageMagick WASM could not be loaded)]`}}let a;try{a=await r()}catch(e){return Bm.error(`ImageMagick WASM initialization failed`,{error:e instanceof Error?e.message:String(e)}),{type:`text`,text:`[Image removed: resize service unavailable (WASM init failed)]`}}try{let n=l(Wm(e.data)),r={data:null,mime:e.mimeType};if(await a.ImageMagick.read(n,async t=>{let n=t.width,a=t.height,o=Math.max(n,a);if(o>1568){let e=1568/o,r=Math.round(n*e),i=Math.round(a*e);t.resize(r,i),Bm.info(`Resized image`,{from:`${n}x${a}`,to:`${r}x${i}`})}let s=i[e.mimeType]||`JPEG`;t.write(s,e=>{r.data=new Uint8Array(e)}),r.data&&r.data.length>Vm&&s!==`JPEG`?(Bm.info(`Still over 5MB, compressing to JPEG q80`),t.quality=80,t.write(`JPEG`,e=>{r.data=new Uint8Array(e)}),r.mime=`image/jpeg`):r.data&&r.data.length>Vm&&(Bm.info(`Still over 5MB as JPEG, reducing quality to 60`),t.quality=60,t.write(`JPEG`,e=>{r.data=new Uint8Array(e)}))}),!r.data)return Bm.warn(`ImageMagick produced no output`),{type:`text`,text:`[Image removed: could not be processed (empty output from resize)]`};if(r.data.length>Vm)return Bm.warn(`Image still over 5MB after resize+compress`,{size:r.data.length}),{type:`text`,text:`[Image removed: still ${Math.round(r.data.length/1024/1024*10)/10}MB after resize and compression, exceeds 5MB API limit]`};let o=c(r.data);return Bm.info(`Image processed successfully`,{originalBase64:t,newBase64:o.length,mimeType:r.mime}),{type:`image`,data:o,mimeType:r.mime}}catch(n){return Bm.error(`Image data processing failed (corrupt or unreadable)`,{mimeType:e.mimeType,estimatedBytes:t,error:n instanceof Error?n.message:String(n)}),{type:`text`,text:`[Image removed: image data could not be processed (${n instanceof Error?n.message:`corrupt or unreadable`})]`}}}const Qm=n(`tool-adapter`),$m=/<img:(data:(image\/[^;]+);base64,([^>]+))>/g;function eh(e){let t=[],n=0;for(let r of e.matchAll($m)){let i=e.slice(n,r.index);i.trim()&&t.push({type:`text`,text:i.trimEnd()}),t.push({type:`image`,mimeType:r[2],data:r[3]}),n=r.index+r[0].length}let r=e.slice(n);return(r.trim()||t.length===0)&&t.push({type:`text`,text:r||e}),t}async function th(e){let t=eh(e),n=[];for(let e of t)e.type===`image`?n.push(await Zm(e)):n.push(e);return n}function nh(e,t,n){return{name:e.name,label:e.name,description:e.description,parameters:e.inputSchema,async execute(r,i,a,o){let s;o&&(s=m({onUpdate:o,toolName:e.name,toolCallId:r}));let c=t?t.processManager.spawn({kind:`tool`,argv:[e.name,...ih(i)],owner:t.owner,ppid:t.getParentPid?.()}):null,l=null;c&&t&&a&&(a.aborted?t.processManager.signal(c.pid,`SIGINT`):a.addEventListener(`abort`,()=>t.processManager.signal(c.pid,`SIGINT`),{once:!0})),c&&t&&(l=t.processManager.onSignal((e,n)=>{e.pid!==c.pid||n!==`SIGKILL`||t.processManager.exit(c.pid,null)}));let u=c?c.abort.signal:a;try{let r=await e.execute(i??{},u),a=r.content;if(n&&typeof a==`string`&&a.length>0)try{a=await n.scrubToolResult(a)}catch(t){Qm.warn(`Tool-result scrub failed, falling back to unscrubbed content`,{tool:e.name,error:t instanceof Error?t.message:String(t)}),a=r.content}let o;try{o=await th(a)}catch(t){Qm.warn(`Image processing failed, falling back to raw content`,{tool:e.name,error:t instanceof Error?t.message:String(t)}),o=eh(a)}return c&&t&&t.processManager.exit(c.pid,+!!r.isError),{content:o,details:{isError:r.isError}}}catch(e){throw c&&t&&t.processManager.exit(c.pid,c.abort.signal.aborted?null:1),e}finally{s&&h(s),l?.()}}}}function rh(e,t,n){return e.map(e=>nh(e,t,n))}function ih(e){if(typeof e!=`object`||!e)return[];let t=e;for(let e of[`command`,`file_path`,`path`,`pattern`,`url`,`key`,`name`,`query`,`message`]){let n=t[e];if(typeof n==`string`&&n.length>0)return[n]}for(let e of Object.values(t))if(typeof e==`string`&&e.length>0)return[e];return[]}function ah(e,t){let n={input:0,output:0,cacheRead:0,cacheWrite:0},r=ee(e);if(!r)return n;let i;for(let e of t.values()){let t=ee(e.id);!t||t.family!==r.family||(!i||t.major>i.major||t.major===i.major&&t.minor>i.minor)&&(i={major:t.major,minor:t.minor,cost:e.cost})}return i?.cost??n}var oh=e({ACCOUNTS_KEY:()=>lh,__test__:()=>vh,addAccount:()=>Rh,applyProviderDefaults:()=>Dh,clearAllSettings:()=>lg,clearApiKey:()=>ig,clearBaseUrl:()=>sg,clearSelectedProvider:()=>tg,exportProviders:()=>cg,getAccounts:()=>$,getAllAvailableModels:()=>jh,getAllExtraOAuthDomains:()=>Fh,getApiKey:()=>ng,getApiKeyForProvider:()=>Kh,getApiVersionForProvider:()=>Yh,getAvailableProviders:()=>yh,getBaseUrl:()=>ag,getBaseUrlForProvider:()=>qh,getDeploymentForProvider:()=>Jh,getExtraOAuthDomains:()=>Mh,getOAuthAccountInfo:()=>Th,getProviderConfig:()=>Sh,getProviderModels:()=>wh,getRawApiKeyForProvider:()=>Gh,getSelectedModelId:()=>Xh,getSelectedProvider:()=>$h,isModelHiddenFromPicker:()=>kh,logoutOAuthAccount:()=>Vh,maskOAuthTokenWithRetry:()=>Hh,migrateLegacyAuthOnlySelection:()=>gh,persistOAuthMaskViaServiceWorker:()=>Uh,providerOffersLlmModels:()=>bh,removeAccount:()=>Bh,resolveCurrentModel:()=>mg,resolveModelById:()=>pg,resolveModelByShorthand:()=>hg,resolveModelIdForScoop:()=>_g,saveOAuthAccount:()=>Wh,setApiKey:()=>rg,setBaseUrl:()=>og,setExtraOAuthDomains:()=>Nh,setExtraOAuthDomainsAsync:()=>Ph,setSelectedModelId:()=>Zh,setSelectedProvider:()=>eg});const sh=ie,ch=_,lh=`slicc_accounts`,uh=`selected-model`,dh=[`slicc_provider`,`slicc_api_key`,`slicc_base_url`,`anthropic_api_key`,`api_provider`,`azure_resource`,`bedrock_region`],fh=new Set([`github`]);function ph(e){let t;try{t=v()}catch{return!1}return t.includes(e)&&!o(e)}let mh=!1;function hh(){if(!mh){mh=!0;for(let e of dh)try{localStorage.removeItem(e)}catch{}gh()}}function gh(){try{let e=localStorage.getItem(uh);if(e){let t=e.indexOf(`:`);if(t>0){let n=e.slice(0,t);(fh.has(n)||ph(n))&&localStorage.removeItem(uh)}}}catch{}try{let e=localStorage.getItem(lh);if(!e)return;let t=JSON.parse(e);if(!Array.isArray(t))return;let n=t.filter(e=>!(typeof e==`object`&&e&&typeof e.providerId==`string`&&ph(e.providerId)));n.length!==t.length&&localStorage.setItem(lh,JSON.stringify(n))}catch{}}function _h(){mh=!1}const vh={_resetLegacyCleanup:_h};function yh(){let e=v().filter(o),t=a();return[...new Set([...e,...t])].filter(e=>!s(e)?.hidden)}function bh(e){try{if(wh(e).length>0)return!0}catch{}try{if(_(e).length>0)return!0}catch{}let t=s(e);return!!(t?.modelOverrides&&Object.keys(t.modelOverrides).length>0)}function xh(e,t){try{if(wh(e).some(e=>e.id===t))return!0}catch{}try{if(_(e).some(e=>e.id===t))return!0}catch{}let n=s(e);return!!(n?.modelOverrides&&Object.hasOwn(n.modelOverrides,t))}function Sh(e){return s(e)||{id:e,name:e.split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `),description:`${e} provider`,requiresApiKey:!0,requiresBaseUrl:!1}}function Ch(e,t){t.context_window!==void 0&&(e.contextWindow=t.context_window),t.max_tokens!==void 0&&(e.maxTokens=t.max_tokens),t.reasoning!==void 0&&(e.reasoning=t.reasoning),t.input!==void 0&&(e.input=t.input),t.cost!==void 0&&(e.cost=t.cost,e.inputCost=t.cost.input,e.outputCost=t.cost.output,e.cacheReadCost=t.cost.cacheRead,e.cacheWriteCost=t.cost.cacheWrite),t.compat!==void 0&&(e.compat={...e.compat??{},...t.compat}),t.thinkingLevelMap!==void 0&&(e.thinkingLevelMap={...e.thinkingLevelMap??{},...t.thinkingLevelMap})}function wh(e){try{if(e===`bedrock-camp`){let e=re(qh(`bedrock-camp`));return ch(`amazon-bedrock`).filter(t=>ne(t,e)).map(e=>({...e,api:`bedrock-camp-converse`,provider:`bedrock-camp`}))}let t=Sh(e);if(t.getModelIds){let n;try{n=t.getModelIds()}catch(t){return Q.error(`Provider getModelIds callback failed`,{providerId:e,error:t instanceof Error?t.message:String(t)}),[]}let r=new Map;for(let e of v())try{for(let t of ch(e))r.set(t.id,t)}catch{}return n.map(n=>{let i=n.api===`openai`?`openai`:`anthropic`,a=`${e}-${i}`,o=r.get(n.id),s;if(o)s={...o,api:a,provider:e};else if(s=dg(e,n.id,``,a),n.name&&(s.name=n.name),i===`anthropic`){let e=ah(n.id,r);s.cost=e,s.inputCost=e.input,s.outputCost=e.output,s.cacheReadCost=e.cacheRead,s.cacheWriteCost=e.cacheWrite}let c=t.modelOverrides?.[n.id];return c&&Ch(s,c),Ch(s,n),s})}if(t.isOAuth){let n=ch(`anthropic`),r=`${e}-anthropic`;return n.map(n=>{let i={...n,api:r,provider:e},a=t.modelOverrides?.[n.id];return a&&Ch(i,a),i})}return ch(e===`azure-ai-foundry`?`anthropic`:e)}catch(t){return Q.error(`Failed to load models`,{providerId:e,error:t instanceof Error?t.message:String(t)}),[]}}function Th(e){let t=$().find(t=>t.providerId===e);if(!t?.accessToken)return null;let n=!!t.tokenExpiresAt&&Date.now()>t.tokenExpiresAt-6e4;return{token:t.accessToken,maskedValue:t.maskedValue,expiresAt:t.tokenExpiresAt,userName:t.userName,userAvatar:t.userAvatar,expired:n}}const Eh=Object.assign({})[`/packages/webapp/providers.json`]??[],Q=n(`provider-settings`);function Dh(e=Eh){if(e.length===0||$().length>0)return;let t=new Set(yh());for(let n of e)if(!(!n.providerId||!n.apiKey)){if(!t.has(n.providerId)){Q.warn(`Unknown provider "${n.providerId}" in providers.json — skipping`);continue}Rh(n.providerId,n.apiKey,n.baseUrl)}let n=e.find(e=>e.providerId&&e.apiKey&&t.has(e.providerId));n?.model&&!localStorage.getItem(uh)&&localStorage.setItem(uh,`${n.providerId}:${n.model}`)}const Oh=[/haiku/i];function kh(e){return Oh.some(t=>t.test(e))}function Ah(e){return e.filter(e=>!kh(e.id))}function jh(){let e=$();if(e.length===0)return[];let t=new Map;for(let n of e){if(t.has(n.providerId))continue;let e=Sh(n.providerId);if(e.hidden||ph(n.providerId))continue;let r=Ah(wh(n.providerId));if(r.length===0)continue;let i={providerId:n.providerId,providerName:e.name,models:r};t.set(n.providerId,i)}return[...t.values()]}function $(){hh();let e=localStorage.getItem(lh);if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>typeof e==`object`&&!!e&&typeof e.providerId==`string`&&typeof e.apiKey==`string`):[]}catch{return[]}}function Mh(e){return oe(localStorage)[e]??[]}function Nh(e,t){let n=oe(localStorage),r=t.map(e=>e.trim()).filter(e=>e.length>0);r.length===0?delete n[e]:n[e]=r,se(localStorage,n)}async function Ph(e,t){if(i()){Nh(e,t);return}let n=r();if(!n)throw Error(`setExtraOAuthDomainsAsync: no DOM and no panel-rpc client — cannot persist to page localStorage`);let{storeAfter:a}=await n.call(`oauth-extras-set`,{providerId:e,domains:t});try{se(localStorage,a)}catch(t){Q.warn(`worker-shim mirror failed after successful page write — reload to refresh`,{providerId:e,error:t instanceof Error?t.message:String(t)})}}function Fh(){return oe(localStorage)}function Ih(e){localStorage.setItem(lh,JSON.stringify(e))}async function Lh(e){if(i()){Ih(e);return}let t=r();if(!t)throw Error(`saveAccountsAsync: no DOM and no panel-rpc client — cannot persist to page localStorage`);let n=JSON.stringify(e),{storedJson:a}=await t.call(`save-oauth-accounts`,{accountsJson:n});try{localStorage.setItem(lh,a)}catch(e){Q.warn(`worker-shim mirror failed after successful page write — reload to refresh`,{error:e instanceof Error?e.message:String(e)})}}function Rh(e,t,n,r,i){let a=$().filter(t=>t.providerId!==e),o={providerId:e,apiKey:t};n&&(o.baseUrl=n),r&&(o.deployment=r),i&&(o.apiVersion=i),a.push(o),Ih(a)}async function zh(e){let t=ce();try{if(t===`extension-direct`){let t=await new Promise(t=>{chrome.runtime.sendMessage({type:`secrets.delete`,name:`oauth.${e}.token`},n=>{chrome.runtime.lastError&&Q.error(`SW secrets.delete transport failed`,{providerId:e,error:chrome.runtime.lastError.message}),t(n??{})})});t.error&&Q.error(`SW secrets.delete returned error`,{providerId:e,error:t.error})}else if(t===`extension-delegate`){let t=await Im(`secrets.delete`,{name:`oauth.${e}.token`});t?.error&&Q.error(`Bridge secrets.delete returned error`,{providerId:e,error:t.error})}else if(t!==`connect`){let t=await fetch(d(`/api/secrets/oauth/${e}`),{method:`DELETE`,headers:f()});!t.ok&&t.status!==404&&Q.warn(`OAuth replica DELETE non-ok`,{providerId:e,status:t.status})}}catch(n){Q.error(`OAuth replica removal failed`,{providerId:e,topology:t,error:n instanceof Error?n.message:String(n)})}}async function Bh(e){let t=$().find(t=>t.providerId===e),n=Sh(e);t&&n?.isOAuth&&await Vh(e),await zh(e),await Lh($().filter(t=>t.providerId!==e));let r=localStorage.getItem(uh)??``,i=r.indexOf(`:`);i>0&&r.slice(0,i)===e&&localStorage.removeItem(uh)}async function Vh(e){let t=$().find(t=>t.providerId===e);if(!t)return;let n=Sh(e);if(n?.isOAuth){if(n.onOAuthLogout)try{await n.onOAuthLogout()}catch(t){Q.warn(`onOAuthLogout failed`,{providerId:e,error:t instanceof Error?t.message:String(t)})}if(n.getOAuthLogoutUrl){let r=n.getOAuthLogoutUrl(t);if(r){let{openIdpLogoutUrl:t}=await import(`./oauth-service-BuEH8BXq.js`);await t(r).catch(t=>{Q.warn(`IdP logout popup failed`,{providerId:e,error:t instanceof Error?t.message:String(t)})})}}await Lh($().map(t=>t.providerId===e?{providerId:t.providerId,apiKey:``,baseUrl:t.baseUrl,userName:t.userName,userAvatar:t.userAvatar,loggedOut:!0}:t)),await zh(e)}}async function Hh(e,t={}){let n=Math.max(1,t.attempts??3),r=t.delayMs??150,i=t.sleep??(e=>new Promise(t=>setTimeout(t,e))),a;for(let t=0;t<n;t++){let o=await e();if(o.maskedValue)return{maskedValue:o.maskedValue};o.error&&(a=o.error),t<n-1&&await i(r)}return{lastError:a}}async function Uh(e,t,n){let r={providerId:e.providerId,accessToken:e.accessToken,domains:e.domains.join(`,`)},{maskedValue:i,lastError:a}=await Hh(()=>t.sendMaskRequest(r),n);if(!i){Q.error(`OAuth mask give-up: no masked value after retries`,{providerId:e.providerId,reason:a??`no error reported (cold SW or empty reply)`});return}let o=t.getAccounts(),s=o.find(t=>t.providerId===e.providerId);s&&(s.maskedValue=i,await t.saveAccounts(o))}async function Wh(e){let t=$().find(t=>t.providerId===e.providerId),n=$().filter(t=>t.providerId!==e.providerId);n.push({providerId:e.providerId,apiKey:``,accessToken:e.accessToken,refreshToken:e.refreshToken,tokenExpiresAt:e.tokenExpiresAt,userName:e.userName,userAvatar:e.userAvatar,baseUrl:e.baseUrl??t?.baseUrl}),await Lh(n);let r=Sh(e.providerId)?.oauthTokenDomains??[],i=Mh(e.providerId),a=new Set,o=[];for(let e of[...r,...i]){let t=e.toLowerCase();a.has(t)||(a.add(t),o.push(e))}if(o.length===0)return;let s=ce();try{if(s===`extension-direct`)await Uh({providerId:e.providerId,accessToken:e.accessToken,domains:o},{sendMaskRequest:t=>new Promise(n=>{chrome.runtime.sendMessage({type:`secrets.mask-oauth-token`,...t},t=>{chrome.runtime.lastError&&Q.error(`SW mask-oauth-token transport failed`,{providerId:e.providerId,error:chrome.runtime.lastError.message});let r=typeof t==`object`&&t?t:void 0;r?.error&&Q.warn(`SW mask-oauth-token returned error`,{providerId:e.providerId,error:r.error}),n(r??{})})}),getAccounts:$,saveAccounts:Lh});else if(s===`extension-delegate`)await Uh({providerId:e.providerId,accessToken:e.accessToken,domains:o},{sendMaskRequest:t=>Im(`secrets.mask-oauth-token`,t).then(t=>(t?.error&&Q.warn(`Bridge mask-oauth-token returned error`,{providerId:e.providerId,error:t.error}),t??{})).catch(t=>(Q.error(`Bridge mask-oauth-token transport failed`,{providerId:e.providerId,error:t instanceof Error?t.message:String(t)}),{})),getAccounts:$,saveAccounts:Lh});else if(s!==`connect`){let t=await fetch(d(`/api/secrets/oauth-update`),{method:`POST`,headers:f({"Content-Type":`application/json`}),body:JSON.stringify({providerId:e.providerId,accessToken:e.accessToken,domains:o})});if(t.ok){let n=await t.json();if(typeof n.maskedValue==`string`){let t=$(),r=t.find(t=>t.providerId===e.providerId);r&&(r.maskedValue=n.maskedValue,await Lh(t))}else Q.warn(`OAuth replica POST ok but missing maskedValue`,{providerId:e.providerId})}else Q.warn(`OAuth replica POST non-ok`,{providerId:e.providerId,status:t.status})}}catch(t){Q.error(`OAuth replica sync failed`,{providerId:e.providerId,topology:s,error:t instanceof Error?t.message:String(t)})}}function Gh(e){let t=$().find(t=>t.providerId===e);return t&&(t.accessToken||t.apiKey)||null}function Kh(e){let t=$().find(t=>t.providerId===e);return t?t.accessToken||t.apiKey||(Sh(e).optionalApiKey?`local`:null):null}function qh(e){return $().find(t=>t.providerId===e)?.baseUrl??null}function Jh(e){return $().find(t=>t.providerId===e)?.deployment??null}function Yh(e){return $().find(t=>t.providerId===e)?.apiVersion??null}function Xh(){let e=localStorage.getItem(uh)||``,t=e.indexOf(`:`);return t>=0?e.slice(t+1):e}function Zh(e){let t=e.indexOf(`:`);if(t>0){let n=e.slice(0,t),r=new Set([...a(),...yh()]),i=n.includes(`.`);if(r.has(n)||!i){localStorage.setItem(uh,e);return}}let n=$h();localStorage.setItem(uh,`${n}:${e}`)}function Qh(){return localStorage.getItem(uh)||``}function $h(){let e=Qh(),t=e.indexOf(`:`);if(t>0)return e.slice(0,t);let n=$(),r=Xh();if(r){let e=n.find(e=>bh(e.providerId)&&xh(e.providerId,r));if(e)return e.providerId}let i=n.find(e=>bh(e.providerId));return i?i.providerId:n.length>0?n[0].providerId:`anthropic`}function eg(e){let t=Xh();localStorage.setItem(uh,`${e}:${t}`)}function tg(){let e=Xh();localStorage.setItem(uh,e)}function ng(){return Kh($h())}function rg(e){let t=$h();Rh(t,e,qh(t)??void 0)}async function ig(){await Bh($h())}function ag(){return qh($h())}function og(e){let t=$h(),n=Gh(t);n&&Rh(t,n,e||void 0)}function sg(){let e=$h(),t=Gh(e);t&&Rh(e,t)}function cg(){let e=$(),t=$h(),n=Xh();return e.map(e=>{let r={providerId:e.providerId,apiKey:e.apiKey};return e.baseUrl&&(r.baseUrl=e.baseUrl),e.providerId===t&&n&&(r.model=n),r})}async function lg(){let e=$();await Promise.allSettled(e.map(e=>Bh(e.providerId))),localStorage.removeItem(lh),localStorage.removeItem(uh);for(let e of dh)localStorage.removeItem(e)}function ug(e){return/^(?:gpt[-.]?|o[0-9]|chatgpt)/i.test(e)?`openai`:`anthropic`}function dg(e,t,n,r){return{id:t,name:t,provider:e,api:r??`${e}-${ug(t)}`,baseUrl:n??``,contextWindow:2e5,maxTokens:16384,input:[`text`,`image`],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},reasoning:!0}}function fg(e,t){return t.isOAuth||e===`azure-ai-foundry`?`anthropic`:e===`bedrock-camp`?`amazon-bedrock`:e}function pg(e){if(!e)return mg();let t=$h(),n=qh(t),r=Sh(t);try{let i=fg(t,r),a=sh(i,e);if(!a?.id)throw Error(`Model ${e} not found`);let o=a;return r.isOAuth?o=wh(t).find(t=>t.id===e)||{...o,api:`${t}-anthropic`,provider:t}:t===`bedrock-camp`&&(o={...o,api:`bedrock-camp-converse`,provider:`bedrock-camp`}),n&&(o={...o,baseUrl:n}),o}catch(i){if(Q.debug(`resolveModelById: pi-ai lookup miss, using provider fallback`,{providerId:t,modelId:e,error:i instanceof Error?i.message:String(i)}),r.isOAuth){let r=wh(t).find(t=>t.id===e);return r?n?{...r,baseUrl:n}:r:dg(t,e,n)}return mg()}}function mg(){let e=$h(),t=Xh(),n=qh(e),r=wh(e),i=Sh(e),a=i.defaultModelId?r.find(e=>e.id.toLowerCase().includes(i.defaultModelId.toLowerCase()))?.id:void 0,o=t||a||r[0]?.id||`claude-sonnet-4-6`;try{let t=fg(e,i),a=sh(t,o);if(!a?.id)throw Error(`Model ${o} not found in ${t} registry`);let s=a;return i.isOAuth?s=r.find(e=>e.id===o)||{...s,api:`${e}-anthropic`,provider:e}:e===`bedrock-camp`&&(s={...s,api:`bedrock-camp-converse`,provider:`bedrock-camp`}),n&&(s={...s,baseUrl:n}),s}catch(t){Q.debug(`resolveCurrentModel: pi-ai lookup miss, using provider fallback`,{providerId:e,effectiveModelId:o,error:t instanceof Error?t.message:String(t)});let a=r.find(e=>e.id===o);return a?n?{...a,baseUrl:n}:a:i.isOAuth?dg(e,o,n):sh(`anthropic`,`claude-sonnet-4-0`)}}function hg(e){let t=e.toLowerCase();if(!t)return null;let n=null;try{n=$h()}catch{}if(n!==null){let e=gg(t,[n]);if(e!==null)return e}return gg(t,$().map(e=>e.providerId))}function gg(e,t){let n=null,r=-1;for(let i of t)for(let t of wh(i)){let i=t.id.toLowerCase(),a=(t.name??``).toLowerCase();if(!i.includes(e)&&!a.includes(e))continue;let o=t.contextWindow??0;(o>r||o===r&&vg(t.id,n??``)>0)&&(r=o,n=t.id)}return n}function _g(e){if(!e)return null;let t=[e],n=hg(e);n!==null&&n!==e&&t.push(n);let r=[];try{r=wh($h())}catch{}for(let n of t)if(!(r.length>0&&!r.some(e=>e.id===n)))try{if(pg(n).id===n)return n}catch(t){Q.debug(`resolveModelIdForScoop: candidate did not resolve`,{input:e,candidate:n,error:t instanceof Error?t.message:String(t)})}return null}function vg(e,t){let n=e.match(/\d+/g)?.map(Number)??[],r=t.match(/\d+/g)?.map(Number)??[],i=Math.max(n.length,r.length);for(let e=0;e<i;e++){let t=(n[e]??0)-(r[e]??0);if(t!==0)return t}return 0}export{of as $,st as $t,Hh as A,Xe as An,F as At,rg as B,sn as Bt,Sh as C,Ne as Cn,lr as Ct,$h as D,x as Dn,nr as Dt,Xh as E,Fe as En,rr as Et,mg as F,le as Fn,N as Ft,eg as G,Kt as Gt,Nh as H,tn as Ht,pg as I,ce as In,M as It,zm as J,Mt as Jt,ah as K,qt as Kt,hg as L,j as Lt,Uh as M,T as Mn,Sn as Mt,bh as N,$e as Nn,yn as Nt,kh as O,Ie as On,kn as Ot,Bh as P,we as Pn,P as Pt,df as Q,ut as Qt,_g as R,pn as Rt,Th as S,He as Sn,dr as St,Gh as T,b as Tn,ar as Tt,Ph as U,Qt as Ut,og as V,an as Vt,Zh as W,Yt as Wt,Pm as X,xt as Xt,Im as Y,Tt as Yt,bm as Z,dt as Zt,yh as _,Me as _n,gr as _t,Dh as a,Te as an,qi as at,Jh as b,Ke as bn,yr as bt,sg as c,Oe as cn,B as ct,$ as d,rt as dn,Or as dt,Qe as en,sd as et,jh as f,S as fn,Dr as ft,Yh as g,je as gn,z as gt,Kh as h,Re as hn,xr as ht,Rh as i,w as in,Qi as it,gh as j,We as jn,Tn as jt,Vh as k,Le as kn,On as kt,tg as l,Ue as ln,Qr as lt,ng as m,Ve as mn,wr as mt,vh as n,Je as nn,co as nt,lg as o,Ee as on,Wi as ot,Fh as p,Ae as pn,Er as pt,rh as q,Bt as qt,oh as r,Ye as rn,$i as rt,ig as s,De as sn,Ki as st,lh as t,Ze as tn,ic as tt,cg as u,ke as un,Gr as ut,ag as v,Be as vn,_r as vt,wh as w,Pe as wn,or as wt,Mh as x,qe as xn,R as xt,qh as y,ze as yn,vr as yt,Wh as z,cn as zt};
@@ -1 +0,0 @@
1
- import{n as e}from"./panel-rpc-CjFVE0nK.js";import{K as t,d as n,y as r,z as i}from"./account-store-BA1YRXaY.js";import{n as a}from"./event-stream-qbAZIAKV.js";import{a as o,d as s,f as c,i as l,o as u,p as d,s as f}from"./bedrock-camp-DS0ilb3O.js";import{a as p,r as m,s as h,t as g}from"./legacy-api-aliases-YuuBU-he.js";import{n as _}from"./llm-session-id-ZObKEXzb.js";import{n as v,t as ee}from"./silent-renew-backoff-Chq7fPuc.js";import{getOAuthPageOrigin as te}from"./oauth-service-BuEH8BXq.js";import"./provider-settings-Cp-_HR6M.js";var ne={proxyEndpoint:`https://adobe-llm-proxy.paolo-moz.workers.dev`,redirectUri:`https://www.sliccy.ai/auth/callback`,extensionRedirectUri:`https://akjjllgokmbgpbdbmafpiefnhidlmbgf.chromiumapp.org/adobe`};function re(e,t){return o(e,t)}function y(e,t,n){return e!==`xhigh`||!t?e:f(t,n)?`xhigh`:u(t,n)?`max`:`high`}function ie(e,t){let n=e?t?.thinkingLevelMap?.[e]:void 0;return y((()=>{if(typeof n==`string`)return n;switch(e){case`minimal`:case`low`:return`low`;case`medium`:return`medium`;case`xhigh`:return`xhigh`;default:return`high`}})(),t?.id,t?.name)}function ae(e,t){return async(n,r)=>{let i=t?await t(n,r)??n:n,a=i.thinking;return a&&a.type===`enabled`&&(i.thinking={type:`adaptive`,...a.display===void 0?{}:{display:a.display}},i.output_config={...i.output_config??{},effort:e}),i}}function b(e,t){if(!re(e.id,e.name))return t;let n=t,r=y(n.effort??ie(n.reasoning,e),e.id,e.name);return{...t,onPayload:ae(r,n.onPayload)}}function oe(e,t){let n={id:e.id,name:e.name??e.id},r=t?.api??e.api,i=t?.context_window??e.context_window,a=t?.max_tokens??e.max_tokens,o=t?.reasoning??e.reasoning,s=t?.input??e.input;r&&(n.api=r),i!==void 0&&(n.context_window=i),a!==void 0&&(n.max_tokens=a),o!==void 0&&(n.reasoning=o),s&&(n.input=s);let c=t?.cost??e.cost;return c&&(n.cost=c),/haiku/i.test(e.id)&&(n.compat={supportsEagerToolInputStreaming:!1}),/sonnet-5\b/i.test(e.id)&&!n.thinkingLevelMap&&(n.thinkingLevelMap={xhigh:`xhigh`}),n}const x=Object.assign({"/packages/webapp/providers/adobe-config.json":ne})[`/packages/webapp/providers/adobe-config.json`]??{clientId:``,proxyEndpoint:``,scopes:`openid,profile,email`};function S(){let e=r(`adobe`);if(e)return e.replace(/\/$/,``);if(x.proxyEndpoint)return x.proxyEndpoint.replace(/\/$/,``);throw Error(`Adobe proxy endpoint not configured — set it in Settings or adobe-config.json`)}const C=new Map,w=new Map,T=`slicc-adobe-models`;function E(e){try{localStorage.setItem(T,JSON.stringify(e))}catch{}}async function D(e){let t=C.get(e);if(t)return t;try{let t=await fetch(`${e}/v1/config`,{headers:{[W]:`5.88.2`}});if(t.ok){let n=await t.json();return C.set(e,n),n}console.warn(`[adobe] Proxy /v1/config returned ${t.status}, falling back to build-time config`)}catch(e){console.warn(`[adobe] Failed to fetch proxy config:`,e instanceof Error?e.message:String(e))}return{}}function O(e){let t=e.clientId||x.clientId;if(!t)throw Error(`Could not determine IMS client ID — proxy /v1/config did not return one and adobe-config.json is empty`);return t}function k(e){return e.scopes||x.scopes}function A(e){return e.imsEnvironment||x.imsEnvironment||`prod`}const j={prod:`https://ims-na1.adobelogin.com`,stg1:`https://ims-na1-stg1.adobelogin.com`};function M(e){return j[e??x.imsEnvironment??`prod`]??j.prod}const N=typeof chrome<`u`&&!!chrome?.runtime?.id;function P(){return n().find(e=>e.providerId===`adobe`)}async function se(e,t){try{let n=await fetch(`${M(t)}/ims/userinfo/v2`,{headers:{Authorization:`Bearer ${e}`}});if(n.ok){let e=await n.json();return{name:e.displayName||e.name||e.email,avatar:e.picture||e.avatar_url}}console.warn(`[adobe] User profile fetch returned ${n.status}, account will have no display name`)}catch(e){console.warn(`[adobe] Failed to fetch user profile:`,e instanceof Error?e.message:String(e))}return{}}function F(e){let t=e.indexOf(`#`);if(t<0)return null;let n=new URLSearchParams(e.slice(t+1)),r=n.get(`access_token`);return r?{accessToken:r,expiresIn:parseInt(n.get(`expires_in`)??`86400`,10)}:null}const I={id:`adobe`,name:`Adobe`,description:`Claude via Adobe — login with your Adobe ID`,requiresApiKey:!1,requiresBaseUrl:!x.proxyEndpoint,baseUrlPlaceholder:`https://your-proxy.example.com`,baseUrlDescription:`Anthropic-compatible proxy endpoint`,isOAuth:!0,defaultModelId:`sonnet`,oauthTokenDomains:[`ims-na1.adobelogin.com`,`ims-na1-stg1.adobelogin.com`,`*.adobelogin.com`,`*.adobe.io`,`firefall.adobe.io`,`admin.hlx.page`,`admin.hlx.live`,`admin.aem.page`,`admin.aem.live`],getModelIds:()=>{let e=e=>oe(e,w.get(e.id));for(let t of Q.values())if(t.length){let n=t.map(t=>e({id:t.id,name:t.name??t.id,reasoning:t.reasoning,input:t.input,cost:t.cost}));return E(n),n}for(let t of C.values())if(t.models?.length)return t.models.map(t=>e(t));try{let e=localStorage.getItem(T);if(e){let t=JSON.parse(e);if(t.length)return t}}catch{}return[{id:`claude-sonnet-4-6`,name:`Claude Sonnet 4.6`}]},onOAuthLogin:async(e,t,n)=>{let r=S(),a=await D(r),o=O(a),s=k(a),c=A(a),l=N?null:await te(),u=N?null:v({pageHref:l.href,pageOrigin:l.origin,configuredRedirectUri:x.redirectUri},()=>crypto.randomUUID()),d=N?x.extensionRedirectUri??`https://${chrome.runtime.id}.chromiumapp.org/`:u.redirectUri,f=u?.oauthState,p=u?.expectedNonce??null,m=new URLSearchParams({client_id:o,scope:s,response_type:`token`,redirect_uri:d});f&&m.set(`state`,f),n?.forceReauth&&m.set(`prompt`,`login`);let h=await e(`${M(c)}/ims/authorize/v2?${m}`);if(!h)return;if(p&&h)try{if(new URL(h).searchParams.get(`nonce`)!==p){console.error(`[adobe] OAuth nonce mismatch — possible CSRF`);return}}catch(e){console.warn(`[adobe] Nonce check skipped (URL parse failed):`,e instanceof Error?e.message:String(e))}let g=F(h);if(!g){console.error(`[adobe] Could not extract token from redirect URL`);return}let _=await se(g.accessToken,c);await i({providerId:`adobe`,accessToken:g.accessToken,tokenExpiresAt:Date.now()+g.expiresIn*1e3,userName:_.name,userAvatar:_.avatar,baseUrl:x.proxyEndpoint?void 0:r}),await $().catch(e=>console.warn(`[adobe] Failed to fetch models after login:`,e instanceof Error?e.message:String(e))),t()},onOAuthLogout:async()=>{let e=P();if(e?.accessToken)try{let t=C.values().next().value??{},n=t.clientId||x.clientId,r=A(t);if(n){let t=await fetch(`${M(r)}/ims/revoke`,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:new URLSearchParams({token:e.accessToken,token_type_hint:`access_token`,client_id:n})});t.ok||console.warn(`[adobe] Token revocation returned ${t.status}, token may still be valid server-side`)}}catch(e){console.warn(`[adobe] Failed to revoke token:`,e instanceof Error?e.message:String(e))}await i({providerId:`adobe`,accessToken:``})},onSilentRenew:async()=>P()?.accessToken?z():null,refreshModels:async e=>{await $(e);let t=I.getModelIds?.();t?.length&&E(t)}};let L=null;const ce=ee();async function R(){let e=P();if(!e?.accessToken)throw Error(`Not logged in to Adobe — please log in first`);if((e.tokenExpiresAt??0)-Date.now()>6e4)return e.accessToken;console.log(`[adobe] Token expired or expiring soon, attempting silent renewal...`);let t=await ce.run(()=>z());if(t)return t;let n=P();if((n?.tokenExpiresAt??0)-Date.now()>0&&n?.accessToken)return n.accessToken;throw Error(`Adobe session expired — please log in again`)}function le(){let e=P();return!e?.tokenExpiresAt||Date.now()>e.tokenExpiresAt-6e4}async function z(){if(typeof window>`u`){let t=e();if(!t)return null;try{let{accessToken:e}=await t.call(`silent-renew`,{providerId:`adobe`},{timeoutMs:13e4});return e}catch(e){return console.warn(`[adobe] worker→page silent-renew bridge failed:`,e instanceof Error?e.message:String(e)),null}}return L||(L=U().finally(()=>{L=null}),L)}function B(e,t){let n=O(t),r=k(t),i=A(t),a=N?null:v({pageHref:window.location.href,pageOrigin:window.location.origin,configuredRedirectUri:x.redirectUri},()=>crypto.randomUUID()),o=N?x.extensionRedirectUri??`https://${chrome.runtime.id}.chromiumapp.org/`:a.redirectUri,s=a?.oauthState,c=a?.expectedNonce??null,l=new URLSearchParams({client_id:n,scope:r,response_type:`token`,redirect_uri:o,prompt:`none`});return s&&l.set(`state`,s),{authorizeUrl:`${M(i)}/ims/authorize/v2?${l}`,expectedNonce:c,proxyEndpoint:e}}function V(e,t){if(!t)return!0;try{if(new URL(e).searchParams.get(`nonce`)!==t)return console.error(`[adobe] OAuth nonce mismatch — possible CSRF`),!1}catch(e){console.warn(`[adobe] Nonce check skipped (URL parse failed):`,e instanceof Error?e.message:String(e))}return!0}async function H(e,t){let n=P();await i({providerId:`adobe`,accessToken:e.accessToken,tokenExpiresAt:Date.now()+e.expiresIn*1e3,userName:n?.userName,userAvatar:n?.userAvatar,baseUrl:x.proxyEndpoint?void 0:t})}async function U(){try{let e=S(),{authorizeUrl:t,expectedNonce:n}=B(e,await D(e)),{createOAuthLauncher:r}=await import(`./oauth-service-BuEH8BXq.js`),i=await r()(t,{interactive:!1});if(!i||!V(i,n))return null;let a=F(i);return a?(await H(a,e),console.log(`[adobe] Token renewed silently`),await $().catch(e=>console.warn(`[adobe] Failed to refresh models after silent renewal:`,e instanceof Error?e.message:String(e))),a.accessToken):null}catch(e){return console.warn(`[adobe] Silent renewal error:`,e instanceof Error?e.message:String(e)),null}}const W=`X-Slicc-Version`;function G(e){let t={};if(e.headers)for(let[n,r]of Object.entries(e.headers))n.toLowerCase()!==`x-slicc-version`&&(t[n]=r);return t[W]=`5.88.2`,{...e,headers:t}}const K=new Set;function q(e,t){if(e.headers){for(let[t,n]of Object.entries(e.headers))if(t.toLowerCase()===`x-session-id`&&n!=null)return e}return K.has(t)||(K.add(t),console.warn(`[adobe] Missing X-Session-Id from ${t} — using daily fallback. Attach an X-Session-Id header at the call site (see scoop-context.ts streamWithSessionId or docs/pitfalls.md).`)),{...e,headers:{...e.headers??{},"X-Session-Id":_(`adobe-provider-fallback`)}}}function ue(){K.clear()}function J(e,t){return{type:`error`,reason:`error`,error:{role:`assistant`,content:[],api:`adobe-anthropic`,provider:`adobe`,model:e.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:`error`,errorMessage:t instanceof Error?t.message:String(t),timestamp:Date.now()}}}const Y=(e,t,n={})=>{let r=a();return(async()=>{try{let i=await R();if(String(e.api).includes(`openai`)){let a=m({...e,baseUrl:`${S()}/v1`,api:`openai-completions`,compat:{...e.compat,supportsStore:!1,supportsDeveloperRole:!1}},t,G(q({...n,apiKey:i},`streamAdobe[openai]`)));for await(let e of a)r.push(e)}else{let a=g({...e,baseUrl:S(),api:`anthropic-messages`},t,G(q(b(e,l(e.id,e.name,{...n,apiKey:i})),`streamAdobe[anthropic]`)));for await(let e of a)r.push(e)}r.end()}catch(t){console.error(`[adobe] Stream error:`,t instanceof Error?t.message:String(t)),r.push(J(e,t)),r.end()}})(),r},X=(e,t,n)=>{let r=a();return(async()=>{try{let i=await R();if(String(e.api).includes(`openai`)){let a=h({...e,baseUrl:`${S()}/v1`,api:`openai-completions`,compat:{...e.compat,supportsStore:!1,supportsDeveloperRole:!1}},t,G(q({...n,apiKey:i},`streamSimpleAdobe[openai]`)));for await(let e of a)r.push(e)}else{let a=p({...e,baseUrl:S(),api:`anthropic-messages`},t,G(q(b(e,l(e.id,e.name,{...n,apiKey:i})),`streamSimpleAdobe[anthropic]`)));for await(let e of a)r.push(e)}r.end()}catch(t){console.error(`[adobe] Stream error:`,t instanceof Error?t.message:String(t)),r.push(J(e,t)),r.end()}})(),r};function Z(e){let t={id:e.id,name:e.name};return e.api!==void 0&&(t.api=e.api),e.context_window!==void 0&&(t.context_window=e.context_window),e.max_tokens!==void 0&&(t.max_tokens=e.max_tokens),e.reasoning!==void 0&&(t.reasoning=e.reasoning),e.input!==void 0&&(t.input=e.input),t}function de(){let e=new Map;for(let t of c())try{for(let n of s(t))e.set(n.id,n)}catch{}return e}function fe(e,n,r){let i=`adobe-${e.api===`openai`?`openai`:`anthropic`}`,a=r.get(e.id);if(a)return{...a,provider:`adobe`,api:i};let o=t(e.id,r);return{id:e.id,name:e.name??e.id,provider:`adobe`,api:i,baseUrl:n,contextWindow:2e5,maxTokens:16384,input:[`text`,`image`],cost:o,inputCost:o.input,outputCost:o.output,cacheReadCost:o.cacheRead,cacheWriteCost:o.cacheWrite,reasoning:!0}}function pe(e,t){for(let t of e)w.set(t.id,Z(t));let n=de();return e.map(e=>fe(e,t,n))}async function me(e){try{let t=e??await R(),n=S(),r=await fetch(`${n}/v1/models`,{headers:{Authorization:`Bearer ${t}`,[W]:`5.88.2`}});if(!r.ok)console.warn(`[adobe] Proxy /v1/models returned ${r.status}, falling back to Anthropic models`);else{let e=await r.json();if(e.data?.length)return pe(e.data,n)}}catch(e){console.warn(`[adobe] Failed to fetch proxy models:`,e instanceof Error?e.message:String(e))}return null}const Q=new Map;function he(){return s(`anthropic`).map(e=>({...e,provider:`adobe`,api:`adobe-anthropic`}))}async function $(e){let t=S(),n=Q.get(t);if(n)return n;let r=await me(e);return r?(Q.set(t,r),r):he()}function ge(){d({api:`adobe-anthropic`,stream:Y,streamSimple:X}),d({api:`adobe-openai`,stream:Y,streamSimple:X})}export{ue as __resetAdobeSessionIdWarningCacheForTests,I as config,$ as getAdobeModels,R as getValidAccessToken,le as isTokenExpired,ge as register};
@@ -1 +0,0 @@
1
- import{b as e,g as t}from"./account-store-BA1YRXaY.js";import{n}from"./event-stream-qbAZIAKV.js";import{o as r,r as i,t as a}from"./transform-messages-Bp94o3FD.js";import{p as o}from"./bedrock-camp-DS0ilb3O.js";import{t as s}from"./openai-CmTnPr9N.js";const c=`azure-openai`,l=`2024-12-01-preview`,u={id:c,name:`Azure OpenAI`,description:`GPT models via Azure AI Foundry`,requiresApiKey:!0,apiKeyPlaceholder:`Azure API key`,apiKeyEnvVar:`AZURE_OPENAI_API_KEY`,requiresBaseUrl:!0,baseUrlPlaceholder:`https://your-resource.cognitiveservices.azure.com/`,baseUrlDescription:`Azure resource endpoint`,requiresDeployment:!0,deploymentPlaceholder:`gpt-4.1-mini, gpt-4o, o4-mini`,deploymentDescription:`Comma-separated deployment names (from Azure Portal → Deployments)`,requiresApiVersion:!0,apiVersionDefault:l,apiVersionDescription:`Azure OpenAI API version`,getModelIds:()=>{let t=e(c);if(!t)return[{id:`azure-unconfigured`,name:`Azure OpenAI (set deployments in Settings)`}];let n=t.split(`,`).map(e=>e.trim()).filter(Boolean);return n.length===0?[{id:`azure-unconfigured`,name:`Azure OpenAI (set deployments in Settings)`}]:n.map(e=>{let t=e.startsWith(`o1`)||e.startsWith(`o3`)||e.startsWith(`o4`);return{id:e,name:`${e} (Azure)`,reasoning:t,input:[`text`,`image`]}})}};function d(e){return e.replace(/[^a-zA-Z0-9_-]/g,`_`).slice(0,64)}function f(e,t){let n=a(e.messages,t,d),r=[];for(let e of n)if(e.role===`user`)if(typeof e.content==`string`)r.push({role:`user`,content:e.content});else{let t=e.content.map(e=>e.type===`text`?{type:`text`,text:e.text??``}:e.type===`image`?{type:`image_url`,image_url:{url:`data:${e.mimeType};base64,${e.data}`}}:{type:`text`,text:JSON.stringify(e)});r.push({role:`user`,content:t})}else if(e.role===`assistant`){let t=e.content,n=t.filter(e=>e.type===`text`).map(e=>e.text??``).join(``),i=t.filter(e=>e.type===`toolCall`).map(e=>({id:e.id??``,type:`function`,function:{name:e.name??``,arguments:JSON.stringify(e.arguments??{})}}));i.length?r.push({role:`assistant`,content:n||null,tool_calls:i}):r.push({role:`assistant`,content:n})}else if(e.role===`toolResult`){let t=e.content;r.push({role:`tool`,tool_call_id:e.toolCallId??``,content:t?.map(e=>e.type===`text`?e.text??``:JSON.stringify(e)).join(``)||``})}return r}function p(e){if(e?.length)return e.map(e=>({type:`function`,function:{name:e.name,description:e.description,parameters:e.parameters}}))}function m(e){let t=e.content.find(e=>e.type===`text`);if(t)return{block:t,index:e.content.indexOf(t)};let n={type:`text`,text:``};return e.content.push(n),{block:n,index:e.content.length-1}}function h(e,t){return e.content.find(e=>e.type===`toolCall`&&e.id===t)}function g(e){return{role:`assistant`,content:[],api:`azure-openai-anthropic`,provider:c,model:e.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:`stop`,timestamp:Date.now()}}function _(e,n){let r=n.apiKey;if(!r)throw Error(`Azure API key is required`);let i=e.baseUrl;if(!i)throw Error(`Azure endpoint is required`);let a={};e.headers&&Object.assign(a,e.headers),n.headers&&Object.assign(a,n.headers);let o=t(c)||l,u=e.id;return{client:new s({endpoint:i.replace(/\/+$/,``),apiKey:r,deployment:u,apiVersion:o,dangerouslyAllowBrowser:!0,defaultHeaders:a}),deployment:u}}function v(e,t){return[...e.systemPrompt?[{role:`system`,content:e.systemPrompt}]:[],...f(e,t)]}function y(e,t,n){n&&(e.usage.input=n.prompt_tokens??0,e.usage.output=n.completion_tokens??0,e.usage.totalTokens=n.total_tokens??0,r(t,e.usage))}function b(e){return e===`tool_calls`?`toolUse`:e===`length`?`length`:`stop`}function x(e,t,n){let{block:r,index:i}=m(t);r.text===``&&e.push({type:`text_start`,contentIndex:i,partial:t}),r.text+=n,e.push({type:`text_delta`,contentIndex:i,delta:n,partial:t})}function S(e,t,n){let r=n.id?h(t,n.id):void 0;if(r||!n.id)return r;let i={type:`toolCall`,id:n.id,name:n.function?.name??``,arguments:{},_partialJson:``};return t.content.push(i),e.push({type:`toolcall_start`,contentIndex:t.content.length-1,partial:t}),i}function C(e,t,n,r){n._partialJson+=r;try{n.arguments=JSON.parse(n._partialJson)}catch{}e.push({type:`toolcall_delta`,contentIndex:t.content.indexOf(n),delta:r,partial:t})}function w(e,t,n){for(let r of n){let n=S(e,t,r);n&&r.function?.arguments&&C(e,t,n,r.function.arguments)}}function T(e,t,n){let r=n.delta;r&&(r.content&&x(e,t,r.content),r.tool_calls&&w(e,t,r.tool_calls),n.finish_reason&&(t.stopReason=b(n.finish_reason)))}function E(e,t,n,r){try{n.arguments=JSON.parse(n._partialJson||`{}`)}catch{}delete n._partialJson,e.push({type:`toolcall_end`,contentIndex:r,toolCall:n,partial:t})}function D(e,t){for(let n=0;n<t.content.length;n+=1){let r=t.content[n];r.type===`toolCall`?E(e,t,r,n):r.type===`text`&&e.push({type:`text_end`,contentIndex:n,content:r.text,partial:t})}}async function O(e,t,n,r,i){let{client:a,deployment:o}=_(n,i),s=p(r.tools),c=await a.chat.completions.create({model:o,messages:v(r,n),stream:!0,stream_options:{include_usage:!0},...i.maxTokens?{max_completion_tokens:i.maxTokens}:{},...i.temperature===void 0?{}:{temperature:i.temperature},...s?{tools:s}:{}});e.push({type:`start`,partial:t});for await(let r of c){y(t,n,r.usage);for(let n of r.choices??[])T(e,t,n)}D(e,t),e.push({type:`done`,reason:t.stopReason,message:t}),e.end()}function k(e,t,n,r){t.stopReason=r?`aborted`:`error`,t.errorMessage=n instanceof Error?n.message:JSON.stringify(n),e.push({type:`error`,reason:t.stopReason,error:t}),e.end()}const A=(e,t,r={})=>{let i=n(),a=g(e);return O(i,a,e,t,r).catch(e=>{k(i,a,e,!!r.signal?.aborted)}),i},j=(e,t,n)=>{let r=n?.apiKey;if(!r)throw Error(`Azure API key is required`);let a=i(e,n,r);return A(e,t,{...a})};function M(){o({api:`azure-openai-anthropic`,stream:A,streamSimple:j})}export{u as config,M as register};
@@ -1 +0,0 @@
1
- import{t as e}from"./event-stream-qbAZIAKV.js";import{r as t,s as n}from"./transform-messages-Bp94o3FD.js";import{t as r}from"./provider-env-DwY8YuMk.js";import{t as i}from"./headers-CbDaTl3c.js";import{t as a}from"./provider-retry-C8PJzY_l.js";import{n as o}from"./constrained-sampling-DafcjXU6.js";import{t as s}from"./openai-CmTnPr9N.js";import{n as c,t as l}from"./error-body-C0EnfbdK.js";import{t as u}from"./openai-prompt-cache-DXo9f3w5.js";import{n as d,r as f,t as p}from"./openai-responses-shared-CiIL52L-.js";const m=new Set([`openai`,`openai-codex`,`opencode`,`azure-openai-responses`]);function h(e){let t=new Map;if(!e)return t;for(let n of e.split(`,`)){let e=n.trim();if(!e)continue;let[r,i]=e.split(`=`,2);!r||!i||t.set(r.trim(),i.trim())}return t}function g(e,t){return t?.azureDeploymentName?t.azureDeploymentName:h(r(`AZURE_OPENAI_DEPLOYMENT_NAME_MAP`,t?.env)).get(e.id)||e.id}function _(e){return l(c(e),`Azure OpenAI API error`)}const v=(t,n,r)=>{let s=new e;return(async()=>{let e=g(t,r),c={role:`assistant`,content:[],api:`azure-openai-responses`,provider:t.provider,model:t.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:`stop`,timestamp:Date.now()};try{let l=r?.apiKey;if(!l)throw Error(`No API key for provider: ${t.provider}`);let u=C(t,l,r),d=o(n.tools,t.compat?.supportsOpenAIGrammarTools??!1),p=w(t,n,r,e,d),m=await r?.onPayload?.(p,t);m!==void 0&&(p=m);let h={...r?.signal?{signal:r.signal}:{},...r?.timeoutMs===void 0?{}:{timeout:r.timeoutMs},maxRetries:0},{data:g,response:_}=await a(()=>u.responses.create(p,h).withResponse(),{maxRetries:r?.maxRetries,maxRetryDelayMs:r?.maxRetryDelayMs,signal:r?.signal});if(await r?.onResponse?.({status:_.status,headers:i(_.headers)},t),s.push({type:`start`,partial:c}),await f(g,c,s,t,{grammarToolInputProperties:d}),r?.signal?.aborted)throw Error(`Request was aborted`);if(c.stopReason===`aborted`||c.stopReason===`error`)throw Error(`An unknown error occurred`);s.push({type:`done`,reason:c.stopReason,message:c}),s.end()}catch(e){for(let e of c.content)delete e.index,delete e.partialJson,delete e.customInput;c.stopReason=r?.signal?.aborted?`aborted`:`error`,c.errorMessage=_(e),s.push({type:`error`,reason:c.stopReason,error:c}),s.end()}})(),s},y=(e,r,i)=>{let a=i?.apiKey;if(!a)throw Error(`No API key for provider: ${e.provider}`);let o=t(e,r,i,a),s=i?.reasoning?n(e,i.reasoning):void 0,c=s===`off`?void 0:s;return v(e,r,{...o,reasoningEffort:c})};function b(e){let t=e.trim().replace(/\/+$/,``),n;try{n=new URL(t)}catch{throw Error(`Invalid Azure OpenAI base URL: ${e}`)}let r=n.hostname.endsWith(`.openai.azure.com`)||n.hostname.endsWith(`.cognitiveservices.azure.com`)||n.hostname.endsWith(`.ai.azure.com`),i=n.pathname.replace(/\/+$/,``);return r&&(i===``||i===`/`||i===`/openai`||i===`/openai/v1/responses`)&&(n.pathname=`/openai/v1`,n.search=``),n.toString().replace(/\/+$/,``)}function x(e){return`https://${e}.openai.azure.com/openai/v1`}function S(e,t){let n=t?.azureApiVersion||r(`AZURE_OPENAI_API_VERSION`,t?.env)||`v1`,i=t?.azureBaseUrl?.trim()||r(`AZURE_OPENAI_BASE_URL`,t?.env)?.trim()||void 0,a=t?.azureResourceName||r(`AZURE_OPENAI_RESOURCE_NAME`,t?.env),o=i;if(!o&&a&&(o=x(a)),!o&&e.baseUrl&&(o=e.baseUrl),!o)throw Error(`Azure OpenAI base URL is required. Set AZURE_OPENAI_BASE_URL or AZURE_OPENAI_RESOURCE_NAME, or pass azureBaseUrl, azureResourceName, or model.baseUrl.`);return{baseUrl:b(o),apiVersion:n}}function C(e,t,n){let r={...e.headers};n?.headers&&Object.assign(r,n.headers);let{baseUrl:i,apiVersion:a}=S(e,n);return new s({apiKey:t,apiVersion:a,dangerouslyAllowBrowser:!0,defaultHeaders:r,baseURL:i})}function w(e,t,n,r,i=o(t.tools,e.compat?.supportsOpenAIGrammarTools??!1)){let a={model:r,input:p(e,t,m,{grammarToolInputProperties:i}),stream:!0,prompt_cache_key:u(n?.sessionId),store:!1};return n?.maxTokens&&(a.max_output_tokens=Math.max(n.maxTokens,16)),n?.temperature!==void 0&&(a.temperature=n?.temperature),t.tools&&t.tools.length>0&&(a.tools=d(t.tools,{supportsStrictMode:e.compat?.supportsStrictMode??!0,supportsOpenAIGrammarTools:e.compat?.supportsOpenAIGrammarTools??!1})),e.reasoning&&(n?.reasoningEffort||n?.reasoningSummary?(a.reasoning={effort:n?.reasoningEffort?e.thinkingLevelMap?.[n.reasoningEffort]??n.reasoningEffort:`medium`,summary:n?.reasoningSummary||`auto`},a.include=[`reasoning.encrypted_content`]):e.thinkingLevelMap?.off!==null&&(a.reasoning={effort:e.thinkingLevelMap?.off??`none`})),a}export{v as stream,y as streamSimple};