@highstate/designer 0.21.1 → 0.26.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 (138) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/_nuxt/{BdRuKvw2.js → -aI73seg.js} +1 -1
  3. package/.output/public/_nuxt/39D0VL7r.js +1 -0
  4. package/.output/public/_nuxt/{rscZxuQ2.js → 3T5CmBSF.js} +1 -1
  5. package/.output/public/_nuxt/4R6BJ3GI.js +1 -0
  6. package/.output/public/_nuxt/{sB5TSp0H.js → 77UvFSdd.js} +7 -7
  7. package/.output/public/_nuxt/{B4FDp1sn.js → B0E2rEnI.js} +1 -1
  8. package/.output/public/_nuxt/B1x03f8R.js +1 -0
  9. package/.output/public/_nuxt/B2CVdECd.js +1 -0
  10. package/.output/public/_nuxt/{CTRkBkra.js → B2_u9ZKl.js} +1 -1
  11. package/.output/public/_nuxt/{5gjbd9sK.js → B8uKU-iG.js} +1 -1
  12. package/.output/public/_nuxt/{CemiMtCX.js → B9BJCsIg.js} +1 -1
  13. package/.output/public/_nuxt/{xnReCuE4.js → BBmoak6l.js} +1 -1
  14. package/.output/public/_nuxt/BEOSfHJT.js +1 -0
  15. package/.output/public/_nuxt/{DsG1SoRB.js → BJV0IIsR.js} +1 -1
  16. package/.output/public/_nuxt/{CPsHsqGU.js → BKaSp7fy.js} +1 -1
  17. package/.output/public/_nuxt/{DKWXhhCy.js → BOujskTX.js} +1 -1
  18. package/.output/public/_nuxt/{Fcs-0n6A.js → BPboW4rx.js} +1 -1
  19. package/.output/public/_nuxt/{Djg8J2AC.js → BR4jrf3-.js} +1 -1
  20. package/.output/public/_nuxt/{CpGRan2R.js → BSRetNRl.js} +1 -1
  21. package/.output/public/_nuxt/{CqQg8Ldy.js → Ba9NwIJp.js} +1 -1
  22. package/.output/public/_nuxt/{CJN4g-3R.js → BbWhHw7B.js} +1 -1
  23. package/.output/public/_nuxt/Bcyj9glE.js +6 -0
  24. package/.output/public/_nuxt/{CvSiusML.js → Be4ezMZK.js} +1 -1
  25. package/.output/public/_nuxt/{DkkrdwgN.js → BgvYz3Nr.js} +1 -1
  26. package/.output/public/_nuxt/BlGDdimO.js +1 -0
  27. package/.output/public/_nuxt/{D_wY_uke.js → Bn5R9WlL.js} +1 -1
  28. package/.output/public/_nuxt/{Bs8TB6Bu.js → BqJDg8iS.js} +1 -1
  29. package/.output/public/_nuxt/BxD6MFcJ.js +1 -0
  30. package/.output/public/_nuxt/{CaehGOgh.js → BxvmPvww.js} +1 -1
  31. package/.output/public/_nuxt/{DEtIJe2u.js → By1Fxx6d.js} +1 -1
  32. package/.output/public/_nuxt/{CnhVSb6R.js → ByBXn3Vz.js} +1 -1
  33. package/.output/public/_nuxt/C1bzPMRu.js +14 -0
  34. package/.output/public/_nuxt/{BIPWeF69.js → C29gnYT3.js} +1 -1
  35. package/.output/public/_nuxt/{BCJKqJxW.js → C5DRPdxC.js} +1 -1
  36. package/.output/public/_nuxt/{Cs-GjQ8R.js → C794qwo0.js} +1 -1
  37. package/.output/public/_nuxt/{DSDbyhpJ.js → C9OJ0gQB.js} +1 -1
  38. package/.output/public/_nuxt/{EnN6XTXK.js → C9n5vGW7.js} +1 -1
  39. package/.output/public/_nuxt/{B2SoM2pd.js → CCBTuGSI.js} +2 -2
  40. package/.output/public/_nuxt/{DTPYfUid.js → CGLWlIpJ.js} +1 -1
  41. package/.output/public/_nuxt/CI40hKzv.js +2 -0
  42. package/.output/public/_nuxt/{BTd2ZN65.js → CLsyMJ1X.js} +1 -1
  43. package/.output/public/_nuxt/{ByE1aAlg.js → CNWyx-82.js} +1 -1
  44. package/.output/public/_nuxt/CRZrAKrA.js +2 -0
  45. package/.output/public/_nuxt/{B7RpoNQl.js → CRb2z3Pg.js} +1 -1
  46. package/.output/public/_nuxt/{BzhaMbyl.js → CWA5Cfde.js} +1 -1
  47. package/.output/public/_nuxt/{CmJE87KM.js → C_yayEmb.js} +1 -1
  48. package/.output/public/_nuxt/{BwKAHWnp.js → CaZj7sno.js} +1 -1
  49. package/.output/public/_nuxt/CiaugisX.js +1 -0
  50. package/.output/public/_nuxt/Cjs5trkS.js +1 -0
  51. package/.output/public/_nuxt/CoqwalnO.js +2 -0
  52. package/.output/public/_nuxt/{OuCcJFrZ.js → CscXh7Vy.js} +1 -1
  53. package/.output/public/_nuxt/{9OHRRPkh.js → CwWsKBf5.js} +1 -1
  54. package/.output/public/_nuxt/Cwefpg1x.js +1 -0
  55. package/.output/public/_nuxt/{DtBrxin9.js → CyFj-Mv9.js} +1 -1
  56. package/.output/public/_nuxt/{C973_vs5.js → D1BdWMiq.js} +1 -1
  57. package/.output/public/_nuxt/D1yXAE_w.js +1 -0
  58. package/.output/public/_nuxt/{Bl_Sz9PU.js → D2lHwbtX.js} +1 -1
  59. package/.output/public/_nuxt/{Dahes9VH.js → D46u9gXN.js} +1 -1
  60. package/.output/public/_nuxt/{D-7HtdRe.js → D4H6aUyZ.js} +7 -7
  61. package/.output/public/_nuxt/D9ITfHnZ.js +269 -0
  62. package/.output/public/_nuxt/{C2zyO9uX.js → DFwfZeyL.js} +1 -1
  63. package/.output/public/_nuxt/{UD_auLNX.js → DMM9kDc1.js} +1 -1
  64. package/.output/public/_nuxt/{wCosSBIO.js → DNVXBFXP.js} +1 -1
  65. package/.output/public/_nuxt/{DXyfavJr.js → DPQHj1GW.js} +1 -1
  66. package/.output/public/_nuxt/{CBIEPWAA.js → DRTFVhVr.js} +1 -1
  67. package/.output/public/_nuxt/{GXzlut8R.js → DTYY2tCY.js} +1 -1
  68. package/.output/public/_nuxt/{hAFXcJ2_.js → DVKmRHSk.js} +1 -1
  69. package/.output/public/_nuxt/{DdvHdmGh.js → DYYyOkJe.js} +1 -1
  70. package/.output/public/_nuxt/{DUHba1vY.js → DcV32yum.js} +1 -1
  71. package/.output/public/_nuxt/DdhYQ3Tv.js +1 -0
  72. package/.output/public/_nuxt/DmMgvbsF.js +1 -0
  73. package/.output/public/_nuxt/{DnpKvmH_.js → DrQCNsTo.js} +1 -1
  74. package/.output/public/_nuxt/{DSpiceQe.js → DvCXikgN.js} +1 -1
  75. package/.output/public/_nuxt/DzQULtcW.js +1 -0
  76. package/.output/public/_nuxt/{BArXRmKu.js → DzowYWbi.js} +1 -1
  77. package/.output/public/_nuxt/{CtbC3i8L.js → I4u-TRO-.js} +1 -1
  78. package/.output/public/_nuxt/{y0GN4iGv.js → O3nsZ-Uz.js} +1 -1
  79. package/.output/public/_nuxt/Qj4UhtaN.js +1 -0
  80. package/.output/public/_nuxt/{Bdd5S2WL.js → VF7GAmoY.js} +1 -1
  81. package/.output/public/_nuxt/{Lks7C8cK.js → YpnHruhZ.js} +1 -1
  82. package/.output/public/_nuxt/_pageId_.C5KTkEfy.css +1 -0
  83. package/.output/public/_nuxt/_panelId_.CKSHyLNC.css +1 -0
  84. package/.output/public/_nuxt/builds/latest.json +1 -1
  85. package/.output/public/_nuxt/builds/meta/53add2c3-4d7c-4a4f-a116-e73c3787cf98.json +1 -0
  86. package/.output/public/_nuxt/components.a-P9dVi2.css +1 -0
  87. package/.output/public/_nuxt/{entry.Bc0aTA0K.css → entry.DsBbjDm-.css} +1 -1
  88. package/.output/public/_nuxt/error-404.DnBTUElh.css +1 -0
  89. package/.output/public/_nuxt/error-500.BNyYF0qG.css +1 -0
  90. package/.output/public/_nuxt/{CBVcjGJL.js → fbfpKHgl.js} +1 -1
  91. package/.output/public/_nuxt/{BD_Kvn-W.js → fxmP1KZw.js} +1 -1
  92. package/.output/public/_nuxt/graph-resolver-DhjyrFRu.js +180 -0
  93. package/.output/public/_nuxt/{DCK6hB22.js → hunqYsQf.js} +1 -1
  94. package/.output/public/_nuxt/iJghVVcV.js +1 -0
  95. package/.output/public/_nuxt/{Bu1xs0Fv.js → m4Sxwg8n.js} +1 -1
  96. package/.output/public/_nuxt/{C4XpvUuq.js → rpHuDh4d.js} +1 -1
  97. package/.output/public/_nuxt/{vuetify.BzdWZaIq.css → vuetify.DtnS3-VQ.css} +1 -1
  98. package/.output/server/index.mjs +2040 -1079
  99. package/.output/server/index.mjs.map +1 -1
  100. package/.output/server/node_modules/ws/lib/buffer-util.js +131 -0
  101. package/.output/server/node_modules/ws/lib/constants.js +19 -0
  102. package/.output/server/node_modules/ws/lib/event-target.js +292 -0
  103. package/.output/server/node_modules/ws/lib/extension.js +203 -0
  104. package/.output/server/node_modules/ws/lib/limiter.js +55 -0
  105. package/.output/server/node_modules/ws/lib/permessage-deflate.js +528 -0
  106. package/.output/server/node_modules/ws/lib/receiver.js +706 -0
  107. package/.output/server/node_modules/ws/lib/sender.js +602 -0
  108. package/.output/server/node_modules/ws/lib/stream.js +161 -0
  109. package/.output/server/node_modules/ws/lib/subprotocol.js +62 -0
  110. package/.output/server/node_modules/ws/lib/validation.js +152 -0
  111. package/.output/server/node_modules/ws/lib/websocket-server.js +554 -0
  112. package/.output/server/node_modules/ws/lib/websocket.js +1393 -0
  113. package/.output/server/node_modules/ws/package.json +70 -0
  114. package/.output/server/node_modules/ws/wrapper.mjs +21 -0
  115. package/.output/server/package.json +2 -1
  116. package/package.json +4 -4
  117. package/.output/public/_nuxt/-OnKOwAh.js +0 -1
  118. package/.output/public/_nuxt/B-dJABhs.js +0 -1
  119. package/.output/public/_nuxt/BKIVPvZX.js +0 -1
  120. package/.output/public/_nuxt/BXphdu9w.js +0 -2
  121. package/.output/public/_nuxt/BYmSxWA_.js +0 -1
  122. package/.output/public/_nuxt/BhozkjGO.js +0 -1
  123. package/.output/public/_nuxt/BtrNScOx.js +0 -1
  124. package/.output/public/_nuxt/BupMEc6X.js +0 -6
  125. package/.output/public/_nuxt/Bv_vOb-Y.js +0 -14
  126. package/.output/public/_nuxt/CYL3VlR9.js +0 -1
  127. package/.output/public/_nuxt/Cz-197mS.js +0 -1
  128. package/.output/public/_nuxt/DHJ62FKo.js +0 -2
  129. package/.output/public/_nuxt/DrWe3t51.js +0 -2
  130. package/.output/public/_nuxt/M0WOzN-S.js +0 -269
  131. package/.output/public/_nuxt/ZpmLW6rw.js +0 -1
  132. package/.output/public/_nuxt/builds/meta/d356de5d-6230-4e66-aba2-c48f455ae207.json +0 -1
  133. package/.output/public/_nuxt/builds/meta/ed797280-2bf0-44e6-a601-2ff2462bfbbc.json +0 -1
  134. package/.output/public/_nuxt/c6k-jVO-.js +0 -1
  135. package/.output/public/_nuxt/components.CIe9upZ4.css +0 -1
  136. package/.output/public/_nuxt/error-404.iOXvqd5J.css +0 -1
  137. package/.output/public/_nuxt/error-500.D0BgXBui.css +0 -1
  138. package/.output/public/_nuxt/graph-resolver-E9RSC1Ga.js +0 -180
@@ -0,0 +1,180 @@
1
+ const Su="system.export.v1";function U(t,e,n){function r(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:o,traits:new Set},enumerable:!1}),a._zod.traits.has(t))return;a._zod.traits.add(t),e(a,c);const l=o.prototype,d=Object.keys(l);for(let p=0;p<d.length;p++){const h=d[p];h in a||(a[h]=l[h].bind(a))}}const s=n?.Parent??Object;class i extends s{}Object.defineProperty(i,"name",{value:t});function o(a){var c;const l=n?.Parent?new i:this;r(l,a),(c=l._zod).deferred??(c.deferred=[]);for(const d of l._zod.deferred)d();return l}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:a=>n?.Parent&&a instanceof n.Parent?!0:a?._zod?.traits?.has(t)}),Object.defineProperty(o,"name",{value:t}),o}class Xt extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Oa extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const Na={};function It(t){return Na}function Ta(t){const e=Object.values(t).filter(r=>typeof r=="number");return Object.entries(t).filter(([r,s])=>e.indexOf(+r)===-1).map(([r,s])=>s)}function zs(t,e){return typeof e=="bigint"?e.toString():e}function Yr(t){return{get value(){{const e=t();return Object.defineProperty(this,"value",{value:e}),e}}}}function Ks(t){return t==null}function Js(t){const e=t.startsWith("^")?1:0,n=t.endsWith("$")?t.length-1:t.length;return t.slice(e,n)}function Eu(t,e){const n=(t.toString().split(".")[1]||"").length,r=e.toString();let s=(r.split(".")[1]||"").length;if(s===0&&/\d?e-\d?/.test(r)){const c=r.match(/\d?e-(\d?)/);c?.[1]&&(s=Number.parseInt(c[1]))}const i=n>s?n:s,o=Number.parseInt(t.toFixed(i).replace(".","")),a=Number.parseInt(e.toFixed(i).replace(".",""));return o%a/10**i}const $i=Symbol("evaluating");function ge(t,e,n){let r;Object.defineProperty(t,e,{get(){if(r!==$i)return r===void 0&&(r=$i,r=n()),r},set(s){Object.defineProperty(t,e,{value:s})},configurable:!0})}function Mt(t,e,n){Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ot(...t){const e={};for(const n of t){const r=Object.getOwnPropertyDescriptors(n);Object.assign(e,r)}return Object.defineProperties({},e)}function Si(t){return JSON.stringify(t)}function ku(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Pa="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function Tn(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}const Iu=Yr(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function rn(t){if(Tn(t)===!1)return!1;const e=t.constructor;if(e===void 0||typeof e!="function")return!0;const n=e.prototype;return!(Tn(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Ca(t){return rn(t)?{...t}:Array.isArray(t)?[...t]:t}const Au=new Set(["string","number","symbol"]),Ou=new Set(["string","number","bigint","boolean","symbol","undefined"]);function jt(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Nt(t,e,n){const r=new t._zod.constr(e??t._zod.def);return(!e||n?.parent)&&(r._zod.parent=t),r}function te(t){const e=t;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function Nu(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}const Tu={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Pu(t,e){const n=t._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const i=Ot(t._zod.def,{get shape(){const o={};for(const a in e){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&(o[a]=n.shape[a])}return Mt(this,"shape",o),o},checks:[]});return Nt(t,i)}function Cu(t,e){const n=t._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const i=Ot(t._zod.def,{get shape(){const o={...t._zod.def.shape};for(const a in e){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&delete o[a]}return Mt(this,"shape",o),o},checks:[]});return Nt(t,i)}function xu(t,e){if(!rn(e))throw new Error("Invalid input to extend: expected a plain object");const n=t._zod.def.checks;if(n&&n.length>0){const i=t._zod.def.shape;for(const o in e)if(Object.getOwnPropertyDescriptor(i,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=Ot(t._zod.def,{get shape(){const i={...t._zod.def.shape,...e};return Mt(this,"shape",i),i}});return Nt(t,s)}function Bu(t,e){if(!rn(e))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Ot(t._zod.def,{get shape(){const r={...t._zod.def.shape,...e};return Mt(this,"shape",r),r}});return Nt(t,n)}function Du(t,e){const n=Ot(t._zod.def,{get shape(){const r={...t._zod.def.shape,...e._zod.def.shape};return Mt(this,"shape",r),r},get catchall(){return e._zod.def.catchall},checks:[]});return Nt(t,n)}function zu(t,e,n){const s=e._zod.def.checks;if(s&&s.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const o=Ot(e._zod.def,{get shape(){const a=e._zod.def.shape,c={...a};if(n)for(const l in n){if(!(l in a))throw new Error(`Unrecognized key: "${l}"`);n[l]&&(c[l]=t?new t({type:"optional",innerType:a[l]}):a[l])}else for(const l in a)c[l]=t?new t({type:"optional",innerType:a[l]}):a[l];return Mt(this,"shape",c),c},checks:[]});return Nt(e,o)}function Ru(t,e,n){const r=Ot(e._zod.def,{get shape(){const s=e._zod.def.shape,i={...s};if(n)for(const o in n){if(!(o in i))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(i[o]=new t({type:"nonoptional",innerType:s[o]}))}else for(const o in s)i[o]=new t({type:"nonoptional",innerType:s[o]});return Mt(this,"shape",i),i}});return Nt(e,r)}function Jt(t,e=0){if(t.aborted===!0)return!0;for(let n=e;n<t.issues.length;n++)if(t.issues[n]?.continue!==!0)return!0;return!1}function Ht(t,e){return e.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(t),n})}function jn(t){return typeof t=="string"?t:t?.message}function At(t,e,n){const r={...t,path:t.path??[]};if(!t.message){const s=jn(t.inst?._zod.def?.error?.(t))??jn(e?.error?.(t))??jn(n.customError?.(t))??jn(n.localeError?.(t))??"Invalid input";r.message=s}return delete r.inst,delete r.continue,e?.reportInput||delete r.input,r}function Hs(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function Pn(...t){const[e,n,r]=t;return typeof e=="string"?{message:e,code:"custom",input:n,inst:r}:{...e}}const xa=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,zs,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},Ba=U("$ZodError",xa),Da=U("$ZodError",xa,{Parent:Error});function ju(t,e=n=>n.message){const n={},r=[];for(const s of t.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(e(s))):r.push(e(s));return{formErrors:r,fieldErrors:n}}function Fu(t,e=n=>n.message){const n={_errors:[]},r=s=>{for(const i of s.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(o=>r({issues:o}));else if(i.code==="invalid_key")r({issues:i.issues});else if(i.code==="invalid_element")r({issues:i.issues});else if(i.path.length===0)n._errors.push(e(i));else{let o=n,a=0;for(;a<i.path.length;){const c=i.path[a];a===i.path.length-1?(o[c]=o[c]||{_errors:[]},o[c]._errors.push(e(i))):o[c]=o[c]||{_errors:[]},o=o[c],a++}}};return r(t),n}const Gs=t=>(e,n,r,s)=>{const i=r?Object.assign(r,{async:!1}):{async:!1},o=e._zod.run({value:n,issues:[]},i);if(o instanceof Promise)throw new Xt;if(o.issues.length){const a=new(s?.Err??t)(o.issues.map(c=>At(c,i,It())));throw Pa(a,s?.callee),a}return o.value},Ws=t=>async(e,n,r,s)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let o=e._zod.run({value:n,issues:[]},i);if(o instanceof Promise&&(o=await o),o.issues.length){const a=new(s?.Err??t)(o.issues.map(c=>At(c,i,It())));throw Pa(a,s?.callee),a}return o.value},Xr=t=>(e,n,r)=>{const s=r?{...r,async:!1}:{async:!1},i=e._zod.run({value:n,issues:[]},s);if(i instanceof Promise)throw new Xt;return i.issues.length?{success:!1,error:new(t??Ba)(i.issues.map(o=>At(o,s,It())))}:{success:!0,data:i.value}},Mu=Xr(Da),Qr=t=>async(e,n,r)=>{const s=r?Object.assign(r,{async:!0}):{async:!0};let i=e._zod.run({value:n,issues:[]},s);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new t(i.issues.map(o=>At(o,s,It())))}:{success:!0,data:i.value}},Uu=Qr(Da),Lu=t=>(e,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Gs(t)(e,n,s)},qu=t=>(e,n,r)=>Gs(t)(e,n,r),Zu=t=>async(e,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Ws(t)(e,n,s)},Vu=t=>async(e,n,r)=>Ws(t)(e,n,r),Ku=t=>(e,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Xr(t)(e,n,s)},Ju=t=>(e,n,r)=>Xr(t)(e,n,r),Hu=t=>async(e,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Qr(t)(e,n,s)},Gu=t=>async(e,n,r)=>Qr(t)(e,n,r),Wu=/^[cC][^\s-]{8,}$/,Yu=/^[0-9a-z]+$/,Xu=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Qu=/^[0-9a-vA-V]{20}$/,el=/^[A-Za-z0-9]{27}$/,tl=/^[a-zA-Z0-9_-]{21}$/,nl=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,rl=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Ei=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,sl=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,il="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function ol(){return new RegExp(il,"u")}const al=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,cl=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,ul=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,ll=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,fl=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,za=/^[A-Za-z0-9_-]*$/,dl=/^\+[1-9]\d{6,14}$/,Ra="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",hl=new RegExp(`^${Ra}$`);function ja(t){const e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function pl(t){return new RegExp(`^${ja(t)}$`)}function ml(t){const e=ja({precision:t.precision}),n=["Z"];t.local&&n.push(""),t.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${e}(?:${n.join("|")})`;return new RegExp(`^${Ra}T(?:${r})$`)}const gl=t=>{const e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},yl=/^-?\d+$/,Fa=/^-?\d+(?:\.\d+)?$/,wl=/^(?:true|false)$/i,vl=/^[^A-Z]*$/,bl=/^[^a-z]*$/,Qe=U("$ZodCheck",(t,e)=>{var n;t._zod??(t._zod={}),t._zod.def=e,(n=t._zod).onattach??(n.onattach=[])}),Ma={number:"number",bigint:"bigint",object:"date"},Ua=U("$ZodCheckLessThan",(t,e)=>{Qe.init(t,e);const n=Ma[typeof e.value];t._zod.onattach.push(r=>{const s=r._zod.bag,i=(e.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<i&&(e.inclusive?s.maximum=e.value:s.exclusiveMaximum=e.value)}),t._zod.check=r=>{(e.inclusive?r.value<=e.value:r.value<e.value)||r.issues.push({origin:n,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:r.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),La=U("$ZodCheckGreaterThan",(t,e)=>{Qe.init(t,e);const n=Ma[typeof e.value];t._zod.onattach.push(r=>{const s=r._zod.bag,i=(e.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>i&&(e.inclusive?s.minimum=e.value:s.exclusiveMinimum=e.value)}),t._zod.check=r=>{(e.inclusive?r.value>=e.value:r.value>e.value)||r.issues.push({origin:n,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:r.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),_l=U("$ZodCheckMultipleOf",(t,e)=>{Qe.init(t,e),t._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=e.value)}),t._zod.check=n=>{if(typeof n.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%e.value===BigInt(0):Eu(n.value,e.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:e.value,input:n.value,inst:t,continue:!e.abort})}}),$l=U("$ZodCheckNumberFormat",(t,e)=>{Qe.init(t,e),e.format=e.format||"float64";const n=e.format?.includes("int"),r=n?"int":"number",[s,i]=Tu[e.format];t._zod.onattach.push(o=>{const a=o._zod.bag;a.format=e.format,a.minimum=s,a.maximum=i,n&&(a.pattern=yl)}),t._zod.check=o=>{const a=o.value;if(n){if(!Number.isInteger(a)){o.issues.push({expected:r,format:e.format,code:"invalid_type",continue:!1,input:a,inst:t});return}if(!Number.isSafeInteger(a)){a>0?o.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:r,inclusive:!0,continue:!e.abort}):o.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:r,inclusive:!0,continue:!e.abort});return}}a<s&&o.issues.push({origin:"number",input:a,code:"too_small",minimum:s,inclusive:!0,inst:t,continue:!e.abort}),a>i&&o.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inclusive:!0,inst:t,continue:!e.abort})}}),Sl=U("$ZodCheckMaxLength",(t,e)=>{var n;Qe.init(t,e),(n=t._zod.def).when??(n.when=r=>{const s=r.value;return!Ks(s)&&s.length!==void 0}),t._zod.onattach.push(r=>{const s=r._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<s&&(r._zod.bag.maximum=e.maximum)}),t._zod.check=r=>{const s=r.value;if(s.length<=e.maximum)return;const o=Hs(s);r.issues.push({origin:o,code:"too_big",maximum:e.maximum,inclusive:!0,input:s,inst:t,continue:!e.abort})}}),El=U("$ZodCheckMinLength",(t,e)=>{var n;Qe.init(t,e),(n=t._zod.def).when??(n.when=r=>{const s=r.value;return!Ks(s)&&s.length!==void 0}),t._zod.onattach.push(r=>{const s=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>s&&(r._zod.bag.minimum=e.minimum)}),t._zod.check=r=>{const s=r.value;if(s.length>=e.minimum)return;const o=Hs(s);r.issues.push({origin:o,code:"too_small",minimum:e.minimum,inclusive:!0,input:s,inst:t,continue:!e.abort})}}),kl=U("$ZodCheckLengthEquals",(t,e)=>{var n;Qe.init(t,e),(n=t._zod.def).when??(n.when=r=>{const s=r.value;return!Ks(s)&&s.length!==void 0}),t._zod.onattach.push(r=>{const s=r._zod.bag;s.minimum=e.length,s.maximum=e.length,s.length=e.length}),t._zod.check=r=>{const s=r.value,i=s.length;if(i===e.length)return;const o=Hs(s),a=i>e.length;r.issues.push({origin:o,...a?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:r.value,inst:t,continue:!e.abort})}}),es=U("$ZodCheckStringFormat",(t,e)=>{var n,r;Qe.init(t,e),t._zod.onattach.push(s=>{const i=s._zod.bag;i.format=e.format,e.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(e.pattern))}),e.pattern?(n=t._zod).check??(n.check=s=>{e.pattern.lastIndex=0,!e.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:e.format,input:s.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(r=t._zod).check??(r.check=()=>{})}),Il=U("$ZodCheckRegex",(t,e)=>{es.init(t,e),t._zod.check=n=>{e.pattern.lastIndex=0,!e.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),Al=U("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=vl),es.init(t,e)}),Ol=U("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=bl),es.init(t,e)}),Nl=U("$ZodCheckIncludes",(t,e)=>{Qe.init(t,e);const n=jt(e.includes),r=new RegExp(typeof e.position=="number"?`^.{${e.position}}${n}`:n);e.pattern=r,t._zod.onattach.push(s=>{const i=s._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),t._zod.check=s=>{s.value.includes(e.includes,e.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:s.value,inst:t,continue:!e.abort})}}),Tl=U("$ZodCheckStartsWith",(t,e)=>{Qe.init(t,e);const n=new RegExp(`^${jt(e.prefix)}.*`);e.pattern??(e.pattern=n),t._zod.onattach.push(r=>{const s=r._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),t._zod.check=r=>{r.value.startsWith(e.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:r.value,inst:t,continue:!e.abort})}}),Pl=U("$ZodCheckEndsWith",(t,e)=>{Qe.init(t,e);const n=new RegExp(`.*${jt(e.suffix)}$`);e.pattern??(e.pattern=n),t._zod.onattach.push(r=>{const s=r._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),t._zod.check=r=>{r.value.endsWith(e.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:r.value,inst:t,continue:!e.abort})}}),Cl=U("$ZodCheckOverwrite",(t,e)=>{Qe.init(t,e),t._zod.check=n=>{n.value=e.tx(n.value)}});class xl{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}const r=e.split(`
2
+ `).filter(o=>o),s=Math.min(...r.map(o=>o.length-o.trimStart().length)),i=r.map(o=>o.slice(s)).map(o=>" ".repeat(this.indent*2)+o);for(const o of i)this.content.push(o)}compile(){const e=Function,n=this?.args,s=[...(this?.content??[""]).map(i=>` ${i}`)];return new e(...n,s.join(`
3
+ `))}}const Bl={major:4,minor:3,patch:6},Ee=U("$ZodType",(t,e)=>{var n;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=Bl;const r=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&r.unshift(t);for(const s of r)for(const i of s._zod.onattach)i(t);if(r.length===0)(n=t._zod).deferred??(n.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{const s=(o,a,c)=>{let l=Jt(o),d;for(const p of a){if(p._zod.def.when){if(!p._zod.def.when(o))continue}else if(l)continue;const h=o.issues.length,m=p._zod.check(o);if(m instanceof Promise&&c?.async===!1)throw new Xt;if(d||m instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await m,o.issues.length!==h&&(l||(l=Jt(o,h)))});else{if(o.issues.length===h)continue;l||(l=Jt(o,h))}}return d?d.then(()=>o):o},i=(o,a,c)=>{if(Jt(o))return o.aborted=!0,o;const l=s(a,r,c);if(l instanceof Promise){if(c.async===!1)throw new Xt;return l.then(d=>t._zod.parse(d,c))}return t._zod.parse(l,c)};t._zod.run=(o,a)=>{if(a.skipChecks)return t._zod.parse(o,a);if(a.direction==="backward"){const l=t._zod.parse({value:o.value,issues:[]},{...a,skipChecks:!0});return l instanceof Promise?l.then(d=>i(d,o,a)):i(l,o,a)}const c=t._zod.parse(o,a);if(c instanceof Promise){if(a.async===!1)throw new Xt;return c.then(l=>s(l,r,a))}return s(c,r,a)}}ge(t,"~standard",()=>({validate:s=>{try{const i=Mu(t,s);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return Uu(t,s).then(o=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}))}),Ys=U("$ZodString",(t,e)=>{Ee.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??gl(t._zod.bag),t._zod.parse=(n,r)=>{if(e.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:t}),n}}),Oe=U("$ZodStringFormat",(t,e)=>{es.init(t,e),Ys.init(t,e)}),Dl=U("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=rl),Oe.init(t,e)}),zl=U("$ZodUUID",(t,e)=>{if(e.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(r===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=Ei(r))}else e.pattern??(e.pattern=Ei());Oe.init(t,e)}),Rl=U("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=sl),Oe.init(t,e)}),jl=U("$ZodURL",(t,e)=>{Oe.init(t,e),t._zod.check=n=>{try{const r=n.value.trim(),s=new URL(r);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(s.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:n.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:n.value,inst:t,continue:!e.abort})),e.normalize?n.value=s.href:n.value=r;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:t,continue:!e.abort})}}}),Fl=U("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=ol()),Oe.init(t,e)}),Ml=U("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=tl),Oe.init(t,e)}),Ul=U("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=Wu),Oe.init(t,e)}),Ll=U("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=Yu),Oe.init(t,e)}),ql=U("$ZodULID",(t,e)=>{e.pattern??(e.pattern=Xu),Oe.init(t,e)}),Zl=U("$ZodXID",(t,e)=>{e.pattern??(e.pattern=Qu),Oe.init(t,e)}),Vl=U("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=el),Oe.init(t,e)}),Kl=U("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=ml(e)),Oe.init(t,e)}),Jl=U("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=hl),Oe.init(t,e)}),Hl=U("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=pl(e)),Oe.init(t,e)}),Gl=U("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=nl),Oe.init(t,e)}),Wl=U("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=al),Oe.init(t,e),t._zod.bag.format="ipv4"}),Yl=U("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=cl),Oe.init(t,e),t._zod.bag.format="ipv6",t._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:t,continue:!e.abort})}}}),Xl=U("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=ul),Oe.init(t,e)}),Ql=U("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=ll),Oe.init(t,e),t._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[s,i]=r;if(!i)throw new Error;const o=Number(i);if(`${o}`!==i)throw new Error;if(o<0||o>128)throw new Error;new URL(`http://[${s}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:t,continue:!e.abort})}}});function qa(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}const ef=U("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=fl),Oe.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=n=>{qa(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:t,continue:!e.abort})}});function tf(t){if(!za.test(t))return!1;const e=t.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=e.padEnd(Math.ceil(e.length/4)*4,"=");return qa(n)}const nf=U("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=za),Oe.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=n=>{tf(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:t,continue:!e.abort})}}),rf=U("$ZodE164",(t,e)=>{e.pattern??(e.pattern=dl),Oe.init(t,e)});function sf(t,e=null){try{const n=t.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const s=JSON.parse(atob(r));return!("typ"in s&&s?.typ!=="JWT"||!s.alg||e&&(!("alg"in s)||s.alg!==e))}catch{return!1}}const of=U("$ZodJWT",(t,e)=>{Oe.init(t,e),t._zod.check=n=>{sf(n.value,e.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:t,continue:!e.abort})}}),Za=U("$ZodNumber",(t,e)=>{Ee.init(t,e),t._zod.pattern=t._zod.bag.pattern??Fa,t._zod.parse=(n,r)=>{if(e.coerce)try{n.value=Number(n.value)}catch{}const s=n.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return n;const i=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:s,inst:t,...i?{received:i}:{}}),n}}),af=U("$ZodNumberFormat",(t,e)=>{$l.init(t,e),Za.init(t,e)}),cf=U("$ZodBoolean",(t,e)=>{Ee.init(t,e),t._zod.pattern=wl,t._zod.parse=(n,r)=>{if(e.coerce)try{n.value=!!n.value}catch{}const s=n.value;return typeof s=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:t}),n}}),uf=U("$ZodUnknown",(t,e)=>{Ee.init(t,e),t._zod.parse=n=>n}),lf=U("$ZodNever",(t,e)=>{Ee.init(t,e),t._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:t}),n)}),ff=U("$ZodDate",(t,e)=>{Ee.init(t,e),t._zod.parse=(n,r)=>{if(e.coerce)try{n.value=new Date(n.value)}catch{}const s=n.value,i=s instanceof Date;return i&&!Number.isNaN(s.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:s,...i?{received:"Invalid Date"}:{},inst:t}),n}});function ki(t,e,n){t.issues.length&&e.issues.push(...Ht(n,t.issues)),e.value[n]=t.value}const df=U("$ZodArray",(t,e)=>{Ee.init(t,e),t._zod.parse=(n,r)=>{const s=n.value;if(!Array.isArray(s))return n.issues.push({expected:"array",code:"invalid_type",input:s,inst:t}),n;n.value=Array(s.length);const i=[];for(let o=0;o<s.length;o++){const a=s[o],c=e.element._zod.run({value:a,issues:[]},r);c instanceof Promise?i.push(c.then(l=>ki(l,n,o))):ki(c,n,o)}return i.length?Promise.all(i).then(()=>n):n}});function Lr(t,e,n,r,s){if(t.issues.length){if(s&&!(n in r))return;e.issues.push(...Ht(n,t.issues))}t.value===void 0?n in r&&(e.value[n]=void 0):e.value[n]=t.value}function Va(t){const e=Object.keys(t.shape);for(const r of e)if(!t.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const n=Nu(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(n)}}function Ka(t,e,n,r,s,i){const o=[],a=s.keySet,c=s.catchall._zod,l=c.def.type,d=c.optout==="optional";for(const p in e){if(a.has(p))continue;if(l==="never"){o.push(p);continue}const h=c.run({value:e[p],issues:[]},r);h instanceof Promise?t.push(h.then(m=>Lr(m,n,p,e,d))):Lr(h,n,p,e,d)}return o.length&&n.issues.push({code:"unrecognized_keys",keys:o,input:e,inst:i}),t.length?Promise.all(t).then(()=>n):n}const hf=U("$ZodObject",(t,e)=>{if(Ee.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){const a=e.shape;Object.defineProperty(e,"shape",{get:()=>{const c={...a};return Object.defineProperty(e,"shape",{value:c}),c}})}const r=Yr(()=>Va(e));ge(t._zod,"propValues",()=>{const a=e.shape,c={};for(const l in a){const d=a[l]._zod;if(d.values){c[l]??(c[l]=new Set);for(const p of d.values)c[l].add(p)}}return c});const s=Tn,i=e.catchall;let o;t._zod.parse=(a,c)=>{o??(o=r.value);const l=a.value;if(!s(l))return a.issues.push({expected:"object",code:"invalid_type",input:l,inst:t}),a;a.value={};const d=[],p=o.shape;for(const h of o.keys){const m=p[h],b=m._zod.optout==="optional",w=m._zod.run({value:l[h],issues:[]},c);w instanceof Promise?d.push(w.then(g=>Lr(g,a,h,l,b))):Lr(w,a,h,l,b)}return i?Ka(d,l,a,c,r.value,t):d.length?Promise.all(d).then(()=>a):a}}),pf=U("$ZodObjectJIT",(t,e)=>{hf.init(t,e);const n=t._zod.parse,r=Yr(()=>Va(e)),s=h=>{const m=new xl(["shape","payload","ctx"]),b=r.value,w=_=>{const I=Si(_);return`shape[${I}]._zod.run({ value: input[${I}], issues: [] }, ctx)`};m.write("const input = payload.value;");const g=Object.create(null);let $=0;for(const _ of b.keys)g[_]=`key_${$++}`;m.write("const newResult = {};");for(const _ of b.keys){const I=g[_],v=Si(_),O=h[_]?._zod?.optout==="optional";m.write(`const ${I} = ${w(_)};`),O?m.write(`
4
+ if (${I}.issues.length) {
5
+ if (${v} in input) {
6
+ payload.issues = payload.issues.concat(${I}.issues.map(iss => ({
7
+ ...iss,
8
+ path: iss.path ? [${v}, ...iss.path] : [${v}]
9
+ })));
10
+ }
11
+ }
12
+
13
+ if (${I}.value === undefined) {
14
+ if (${v} in input) {
15
+ newResult[${v}] = undefined;
16
+ }
17
+ } else {
18
+ newResult[${v}] = ${I}.value;
19
+ }
20
+
21
+ `):m.write(`
22
+ if (${I}.issues.length) {
23
+ payload.issues = payload.issues.concat(${I}.issues.map(iss => ({
24
+ ...iss,
25
+ path: iss.path ? [${v}, ...iss.path] : [${v}]
26
+ })));
27
+ }
28
+
29
+ if (${I}.value === undefined) {
30
+ if (${v} in input) {
31
+ newResult[${v}] = undefined;
32
+ }
33
+ } else {
34
+ newResult[${v}] = ${I}.value;
35
+ }
36
+
37
+ `)}m.write("payload.value = newResult;"),m.write("return payload;");const y=m.compile();return(_,I)=>y(h,_,I)};let i;const o=Tn,a=!Na.jitless,l=a&&Iu.value,d=e.catchall;let p;t._zod.parse=(h,m)=>{p??(p=r.value);const b=h.value;return o(b)?a&&l&&m?.async===!1&&m.jitless!==!0?(i||(i=s(e.shape)),h=i(h,m),d?Ka([],b,h,m,p,t):h):n(h,m):(h.issues.push({expected:"object",code:"invalid_type",input:b,inst:t}),h)}});function Ii(t,e,n,r){for(const i of t)if(i.issues.length===0)return e.value=i.value,e;const s=t.filter(i=>!Jt(i));return s.length===1?(e.value=s[0].value,s[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:n,errors:t.map(i=>i.issues.map(o=>At(o,r,It())))}),e)}const Ja=U("$ZodUnion",(t,e)=>{Ee.init(t,e),ge(t._zod,"optin",()=>e.options.some(s=>s._zod.optin==="optional")?"optional":void 0),ge(t._zod,"optout",()=>e.options.some(s=>s._zod.optout==="optional")?"optional":void 0),ge(t._zod,"values",()=>{if(e.options.every(s=>s._zod.values))return new Set(e.options.flatMap(s=>Array.from(s._zod.values)))}),ge(t._zod,"pattern",()=>{if(e.options.every(s=>s._zod.pattern)){const s=e.options.map(i=>i._zod.pattern);return new RegExp(`^(${s.map(i=>Js(i.source)).join("|")})$`)}});const n=e.options.length===1,r=e.options[0]._zod.run;t._zod.parse=(s,i)=>{if(n)return r(s,i);let o=!1;const a=[];for(const c of e.options){const l=c._zod.run({value:s.value,issues:[]},i);if(l instanceof Promise)a.push(l),o=!0;else{if(l.issues.length===0)return l;a.push(l)}}return o?Promise.all(a).then(c=>Ii(c,s,t,i)):Ii(a,s,t,i)}}),mf=U("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,Ja.init(t,e);const n=t._zod.parse;ge(t._zod,"propValues",()=>{const s={};for(const i of e.options){const o=i._zod.propValues;if(!o||Object.keys(o).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(i)}"`);for(const[a,c]of Object.entries(o)){s[a]||(s[a]=new Set);for(const l of c)s[a].add(l)}}return s});const r=Yr(()=>{const s=e.options,i=new Map;for(const o of s){const a=o._zod.propValues?.[e.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);for(const c of a){if(i.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);i.set(c,o)}}return i});t._zod.parse=(s,i)=>{const o=s.value;if(!Tn(o))return s.issues.push({code:"invalid_type",expected:"object",input:o,inst:t}),s;const a=r.value.get(o?.[e.discriminator]);return a?a._zod.run(s,i):e.unionFallback?n(s,i):(s.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:o,path:[e.discriminator],inst:t}),s)}}),gf=U("$ZodIntersection",(t,e)=>{Ee.init(t,e),t._zod.parse=(n,r)=>{const s=n.value,i=e.left._zod.run({value:s,issues:[]},r),o=e.right._zod.run({value:s,issues:[]},r);return i instanceof Promise||o instanceof Promise?Promise.all([i,o]).then(([c,l])=>Ai(n,c,l)):Ai(n,i,o)}});function Rs(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(rn(t)&&rn(e)){const n=Object.keys(e),r=Object.keys(t).filter(i=>n.indexOf(i)!==-1),s={...t,...e};for(const i of r){const o=Rs(t[i],e[i]);if(!o.valid)return{valid:!1,mergeErrorPath:[i,...o.mergeErrorPath]};s[i]=o.data}return{valid:!0,data:s}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<t.length;r++){const s=t[r],i=e[r],o=Rs(s,i);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Ai(t,e,n){const r=new Map;let s;for(const a of e.issues)if(a.code==="unrecognized_keys"){s??(s=a);for(const c of a.keys)r.has(c)||r.set(c,{}),r.get(c).l=!0}else t.issues.push(a);for(const a of n.issues)if(a.code==="unrecognized_keys")for(const c of a.keys)r.has(c)||r.set(c,{}),r.get(c).r=!0;else t.issues.push(a);const i=[...r].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(i.length&&s&&t.issues.push({...s,keys:i}),Jt(t))return t;const o=Rs(e.value,n.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return t.value=o.data,t}const yf=U("$ZodRecord",(t,e)=>{Ee.init(t,e),t._zod.parse=(n,r)=>{const s=n.value;if(!rn(s))return n.issues.push({expected:"record",code:"invalid_type",input:s,inst:t}),n;const i=[],o=e.keyType._zod.values;if(o){n.value={};const a=new Set;for(const l of o)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){a.add(typeof l=="number"?l.toString():l);const d=e.valueType._zod.run({value:s[l],issues:[]},r);d instanceof Promise?i.push(d.then(p=>{p.issues.length&&n.issues.push(...Ht(l,p.issues)),n.value[l]=p.value})):(d.issues.length&&n.issues.push(...Ht(l,d.issues)),n.value[l]=d.value)}let c;for(const l in s)a.has(l)||(c=c??[],c.push(l));c&&c.length>0&&n.issues.push({code:"unrecognized_keys",input:s,inst:t,keys:c})}else{n.value={};for(const a of Reflect.ownKeys(s)){if(a==="__proto__")continue;let c=e.keyType._zod.run({value:a,issues:[]},r);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&Fa.test(a)&&c.issues.length){const p=e.keyType._zod.run({value:Number(a),issues:[]},r);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");p.issues.length===0&&(c=p)}if(c.issues.length){e.mode==="loose"?n.value[a]=s[a]:n.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(p=>At(p,r,It())),input:a,path:[a],inst:t});continue}const d=e.valueType._zod.run({value:s[a],issues:[]},r);d instanceof Promise?i.push(d.then(p=>{p.issues.length&&n.issues.push(...Ht(a,p.issues)),n.value[c.value]=p.value})):(d.issues.length&&n.issues.push(...Ht(a,d.issues)),n.value[c.value]=d.value)}}return i.length?Promise.all(i).then(()=>n):n}}),wf=U("$ZodEnum",(t,e)=>{Ee.init(t,e);const n=Ta(e.entries),r=new Set(n);t._zod.values=r,t._zod.pattern=new RegExp(`^(${n.filter(s=>Au.has(typeof s)).map(s=>typeof s=="string"?jt(s):s.toString()).join("|")})$`),t._zod.parse=(s,i)=>{const o=s.value;return r.has(o)||s.issues.push({code:"invalid_value",values:n,input:o,inst:t}),s}}),vf=U("$ZodLiteral",(t,e)=>{if(Ee.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(e.values);t._zod.values=n,t._zod.pattern=new RegExp(`^(${e.values.map(r=>typeof r=="string"?jt(r):r?jt(r.toString()):String(r)).join("|")})$`),t._zod.parse=(r,s)=>{const i=r.value;return n.has(i)||r.issues.push({code:"invalid_value",values:e.values,input:i,inst:t}),r}}),bf=U("$ZodTransform",(t,e)=>{Ee.init(t,e),t._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Oa(t.constructor.name);const s=e.transform(n.value,n);if(r.async)return(s instanceof Promise?s:Promise.resolve(s)).then(o=>(n.value=o,n));if(s instanceof Promise)throw new Xt;return n.value=s,n}});function Oi(t,e){return t.issues.length&&e===void 0?{issues:[],value:void 0}:t}const Ha=U("$ZodOptional",(t,e)=>{Ee.init(t,e),t._zod.optin="optional",t._zod.optout="optional",ge(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),ge(t._zod,"pattern",()=>{const n=e.innerType._zod.pattern;return n?new RegExp(`^(${Js(n.source)})?$`):void 0}),t._zod.parse=(n,r)=>{if(e.innerType._zod.optin==="optional"){const s=e.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>Oi(i,n.value)):Oi(s,n.value)}return n.value===void 0?n:e.innerType._zod.run(n,r)}}),_f=U("$ZodExactOptional",(t,e)=>{Ha.init(t,e),ge(t._zod,"values",()=>e.innerType._zod.values),ge(t._zod,"pattern",()=>e.innerType._zod.pattern),t._zod.parse=(n,r)=>e.innerType._zod.run(n,r)}),$f=U("$ZodNullable",(t,e)=>{Ee.init(t,e),ge(t._zod,"optin",()=>e.innerType._zod.optin),ge(t._zod,"optout",()=>e.innerType._zod.optout),ge(t._zod,"pattern",()=>{const n=e.innerType._zod.pattern;return n?new RegExp(`^(${Js(n.source)}|null)$`):void 0}),ge(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(n,r)=>n.value===null?n:e.innerType._zod.run(n,r)}),Sf=U("$ZodDefault",(t,e)=>{Ee.init(t,e),t._zod.optin="optional",ge(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,r)=>{if(r.direction==="backward")return e.innerType._zod.run(n,r);if(n.value===void 0)return n.value=e.defaultValue,n;const s=e.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>Ni(i,e)):Ni(s,e)}});function Ni(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}const Ef=U("$ZodPrefault",(t,e)=>{Ee.init(t,e),t._zod.optin="optional",ge(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=e.defaultValue),e.innerType._zod.run(n,r))}),kf=U("$ZodNonOptional",(t,e)=>{Ee.init(t,e),ge(t._zod,"values",()=>{const n=e.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),t._zod.parse=(n,r)=>{const s=e.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>Ti(i,t)):Ti(s,t)}});function Ti(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}const If=U("$ZodCatch",(t,e)=>{Ee.init(t,e),ge(t._zod,"optin",()=>e.innerType._zod.optin),ge(t._zod,"optout",()=>e.innerType._zod.optout),ge(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,r)=>{if(r.direction==="backward")return e.innerType._zod.run(n,r);const s=e.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>(n.value=i.value,i.issues.length&&(n.value=e.catchValue({...n,error:{issues:i.issues.map(o=>At(o,r,It()))},input:n.value}),n.issues=[]),n)):(n.value=s.value,s.issues.length&&(n.value=e.catchValue({...n,error:{issues:s.issues.map(i=>At(i,r,It()))},input:n.value}),n.issues=[]),n)}}),Af=U("$ZodPipe",(t,e)=>{Ee.init(t,e),ge(t._zod,"values",()=>e.in._zod.values),ge(t._zod,"optin",()=>e.in._zod.optin),ge(t._zod,"optout",()=>e.out._zod.optout),ge(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(n,r)=>{if(r.direction==="backward"){const i=e.out._zod.run(n,r);return i instanceof Promise?i.then(o=>Fn(o,e.in,r)):Fn(i,e.in,r)}const s=e.in._zod.run(n,r);return s instanceof Promise?s.then(i=>Fn(i,e.out,r)):Fn(s,e.out,r)}});function Fn(t,e,n){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues},n)}const Of=U("$ZodCodec",(t,e)=>{Ee.init(t,e),ge(t._zod,"values",()=>e.in._zod.values),ge(t._zod,"optin",()=>e.in._zod.optin),ge(t._zod,"optout",()=>e.out._zod.optout),ge(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(n,r)=>{if((r.direction||"forward")==="forward"){const i=e.in._zod.run(n,r);return i instanceof Promise?i.then(o=>Mn(o,e,r)):Mn(i,e,r)}else{const i=e.out._zod.run(n,r);return i instanceof Promise?i.then(o=>Mn(o,e,r)):Mn(i,e,r)}}});function Mn(t,e,n){if(t.issues.length)return t.aborted=!0,t;if((n.direction||"forward")==="forward"){const s=e.transform(t.value,t);return s instanceof Promise?s.then(i=>Un(t,i,e.out,n)):Un(t,s,e.out,n)}else{const s=e.reverseTransform(t.value,t);return s instanceof Promise?s.then(i=>Un(t,i,e.in,n)):Un(t,s,e.in,n)}}function Un(t,e,n,r){return t.issues.length?(t.aborted=!0,t):n._zod.run({value:e,issues:t.issues},r)}const Nf=U("$ZodReadonly",(t,e)=>{Ee.init(t,e),ge(t._zod,"propValues",()=>e.innerType._zod.propValues),ge(t._zod,"values",()=>e.innerType._zod.values),ge(t._zod,"optin",()=>e.innerType?._zod?.optin),ge(t._zod,"optout",()=>e.innerType?._zod?.optout),t._zod.parse=(n,r)=>{if(r.direction==="backward")return e.innerType._zod.run(n,r);const s=e.innerType._zod.run(n,r);return s instanceof Promise?s.then(Pi):Pi(s)}});function Pi(t){return t.value=Object.freeze(t.value),t}const Tf=U("$ZodTemplateLiteral",(t,e)=>{Ee.init(t,e);const n=[];for(const r of e.parts)if(typeof r=="object"&&r!==null){if(!r._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...r._zod.traits].shift()}`);const s=r._zod.pattern instanceof RegExp?r._zod.pattern.source:r._zod.pattern;if(!s)throw new Error(`Invalid template literal part: ${r._zod.traits}`);const i=s.startsWith("^")?1:0,o=s.endsWith("$")?s.length-1:s.length;n.push(s.slice(i,o))}else if(r===null||Ou.has(typeof r))n.push(jt(`${r}`));else throw new Error(`Invalid template literal part: ${r}`);t._zod.pattern=new RegExp(`^${n.join("")}$`),t._zod.parse=(r,s)=>typeof r.value!="string"?(r.issues.push({input:r.value,inst:t,expected:"string",code:"invalid_type"}),r):(t._zod.pattern.lastIndex=0,t._zod.pattern.test(r.value)||r.issues.push({input:r.value,inst:t,code:"invalid_format",format:e.format??"template_literal",pattern:t._zod.pattern.source}),r)}),Pf=U("$ZodCustom",(t,e)=>{Qe.init(t,e),Ee.init(t,e),t._zod.parse=(n,r)=>n,t._zod.check=n=>{const r=n.value,s=e.fn(r);if(s instanceof Promise)return s.then(i=>Ci(i,n,r,t));Ci(s,n,r,t)}});function Ci(t,e,n,r){if(!t){const s={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(s.params=r._zod.def.params),e.issues.push(Pn(s))}}var xi;class Cf{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...n){const r=n[0];return this._map.set(e,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const n=this._map.get(e);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(e),this}get(e){const n=e._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const s={...r,...this._map.get(e)};return Object.keys(s).length?s:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function xf(){return new Cf}(xi=globalThis).__zod_globalRegistry??(xi.__zod_globalRegistry=xf());const kn=globalThis.__zod_globalRegistry;function Bf(t,e){return new t({type:"string",...te(e)})}function Df(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...te(e)})}function Bi(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...te(e)})}function zf(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...te(e)})}function Rf(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...te(e)})}function jf(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...te(e)})}function Ff(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...te(e)})}function Ga(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...te(e)})}function Mf(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...te(e)})}function Uf(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...te(e)})}function Lf(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...te(e)})}function Wa(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...te(e)})}function qf(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...te(e)})}function Zf(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...te(e)})}function Vf(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...te(e)})}function Kf(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...te(e)})}function Jf(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...te(e)})}function Hf(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...te(e)})}function Gf(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...te(e)})}function Wf(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...te(e)})}function Yf(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...te(e)})}function Xf(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...te(e)})}function Qf(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...te(e)})}function ed(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...te(e)})}function td(t,e){return new t({type:"string",format:"date",check:"string_format",...te(e)})}function nd(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...te(e)})}function rd(t,e){return new t({type:"string",format:"duration",check:"string_format",...te(e)})}function sd(t,e){return new t({type:"number",checks:[],...te(e)})}function id(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...te(e)})}function od(t,e){return new t({type:"boolean",...te(e)})}function ad(t,e){return new t({type:"boolean",coerce:!0,...te(e)})}function cd(t){return new t({type:"unknown"})}function ud(t,e){return new t({type:"never",...te(e)})}function ld(t,e){return new t({type:"date",...te(e)})}function Di(t,e){return new Ua({check:"less_than",...te(e),value:t,inclusive:!1})}function Br(t,e){return new Ua({check:"less_than",...te(e),value:t,inclusive:!0})}function zi(t,e){return new La({check:"greater_than",...te(e),value:t,inclusive:!1})}function Dr(t,e){return new La({check:"greater_than",...te(e),value:t,inclusive:!0})}function Ri(t,e){return new _l({check:"multiple_of",...te(e),value:t})}function Ya(t,e){return new Sl({check:"max_length",...te(e),maximum:t})}function qr(t,e){return new El({check:"min_length",...te(e),minimum:t})}function Xa(t,e){return new kl({check:"length_equals",...te(e),length:t})}function fd(t,e){return new Il({check:"string_format",format:"regex",...te(e),pattern:t})}function dd(t){return new Al({check:"string_format",format:"lowercase",...te(t)})}function hd(t){return new Ol({check:"string_format",format:"uppercase",...te(t)})}function pd(t,e){return new Nl({check:"string_format",format:"includes",...te(e),includes:t})}function md(t,e){return new Tl({check:"string_format",format:"starts_with",...te(e),prefix:t})}function gd(t,e){return new Pl({check:"string_format",format:"ends_with",...te(e),suffix:t})}function cn(t){return new Cl({check:"overwrite",tx:t})}function yd(t){return cn(e=>e.normalize(t))}function wd(){return cn(t=>t.trim())}function vd(){return cn(t=>t.toLowerCase())}function bd(){return cn(t=>t.toUpperCase())}function _d(){return cn(t=>ku(t))}function $d(t,e,n){return new t({type:"array",element:e,...te(n)})}function Sd(t,e,n){const r=te(n);return r.abort??(r.abort=!0),new t({type:"custom",check:"custom",fn:e,...r})}function Ed(t,e,n){return new t({type:"custom",check:"custom",fn:e,...te(n)})}function kd(t){const e=Id(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(Pn(r,n.value,e._zod.def));else{const s=r;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=e),s.continue??(s.continue=!e._zod.def.abort),n.issues.push(Pn(s))}},t(n.value,n)));return e}function Id(t,e){const n=new Qe({check:"custom",...te(e)});return n._zod.check=t,n}function Qa(t){let e=t?.target??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:t.processors??{},metadataRegistry:t?.metadata??kn,target:e,unrepresentable:t?.unrepresentable??"throw",override:t?.override??(()=>{}),io:t?.io??"output",counter:0,seen:new Map,cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0}}function Fe(t,e,n={path:[],schemaPath:[]}){var r;const s=t._zod.def,i=e.seen.get(t);if(i)return i.count++,n.schemaPath.includes(t)&&(i.cycle=n.path),i.schema;const o={schema:{},count:1,cycle:void 0,path:n.path};e.seen.set(t,o);const a=t._zod.toJSONSchema?.();if(a)o.schema=a;else{const d={...n,schemaPath:[...n.schemaPath,t],path:n.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,o.schema,d);else{const h=o.schema,m=e.processors[s.type];if(!m)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);m(t,e,h,d)}const p=t._zod.parent;p&&(o.ref||(o.ref=p),Fe(p,e,d),e.seen.get(p).isParent=!0)}const c=e.metadataRegistry.get(t);return c&&Object.assign(o.schema,c),e.io==="input"&&Ge(t)&&(delete o.schema.examples,delete o.schema.default),e.io==="input"&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,e.seen.get(t).schema}function ec(t,e){const n=t.seen.get(e);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const o of t.seen.entries()){const a=t.metadataRegistry.get(o[0])?.id;if(a){const c=r.get(a);if(c&&c!==o[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(a,o[0])}}const s=o=>{const a=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){const p=t.external.registry.get(o[0])?.id,h=t.external.uri??(b=>b);if(p)return{ref:h(p)};const m=o[1].defId??o[1].schema.id??`schema${t.counter++}`;return o[1].defId=m,{defId:m,ref:`${h("__shared")}#/${a}/${m}`}}if(o[1]===n)return{ref:"#"};const l=`#/${a}/`,d=o[1].schema.id??`__schema${t.counter++}`;return{defId:d,ref:l+d}},i=o=>{if(o[1].schema.$ref)return;const a=o[1],{ref:c,defId:l}=s(o);a.def={...a.schema},l&&(a.defId=l);const d=a.schema;for(const p in d)delete d[p];d.$ref=c};if(t.cycles==="throw")for(const o of t.seen.entries()){const a=o[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
38
+
39
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const o of t.seen.entries()){const a=o[1];if(e===o[0]){i(o);continue}if(t.external){const l=t.external.registry.get(o[0])?.id;if(e!==o[0]&&l){i(o);continue}}if(t.metadataRegistry.get(o[0])?.id){i(o);continue}if(a.cycle){i(o);continue}if(a.count>1&&t.reused==="ref"){i(o);continue}}}function tc(t,e){const n=t.seen.get(e);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=o=>{const a=t.seen.get(o);if(a.ref===null)return;const c=a.def??a.schema,l={...c},d=a.ref;if(a.ref=null,d){r(d);const h=t.seen.get(d),m=h.schema;if(m.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(m)):Object.assign(c,m),Object.assign(c,l),o._zod.parent===d)for(const w in c)w==="$ref"||w==="allOf"||w in l||delete c[w];if(m.$ref&&h.def)for(const w in c)w==="$ref"||w==="allOf"||w in h.def&&JSON.stringify(c[w])===JSON.stringify(h.def[w])&&delete c[w]}const p=o._zod.parent;if(p&&p!==d){r(p);const h=t.seen.get(p);if(h?.schema.$ref&&(c.$ref=h.schema.$ref,h.def))for(const m in c)m==="$ref"||m==="allOf"||m in h.def&&JSON.stringify(c[m])===JSON.stringify(h.def[m])&&delete c[m]}t.override({zodSchema:o,jsonSchema:c,path:a.path??[]})};for(const o of[...t.seen.entries()].reverse())r(o[0]);const s={};if(t.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){const o=t.external.registry.get(e)?.id;if(!o)throw new Error("Schema is missing an `id` property");s.$id=t.external.uri(o)}Object.assign(s,n.def??n.schema);const i=t.external?.defs??{};for(const o of t.seen.entries()){const a=o[1];a.def&&a.defId&&(i[a.defId]=a.def)}t.external||Object.keys(i).length>0&&(t.target==="draft-2020-12"?s.$defs=i:s.definitions=i);try{const o=JSON.parse(JSON.stringify(s));return Object.defineProperty(o,"~standard",{value:{...e["~standard"],jsonSchema:{input:Zr(e,"input",t.processors),output:Zr(e,"output",t.processors)}},enumerable:!1,writable:!1}),o}catch{throw new Error("Error converting schema to JSON.")}}function Ge(t,e){const n=e??{seen:new Set};if(n.seen.has(t))return!1;n.seen.add(t);const r=t._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return Ge(r.element,n);if(r.type==="set")return Ge(r.valueType,n);if(r.type==="lazy")return Ge(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return Ge(r.innerType,n);if(r.type==="intersection")return Ge(r.left,n)||Ge(r.right,n);if(r.type==="record"||r.type==="map")return Ge(r.keyType,n)||Ge(r.valueType,n);if(r.type==="pipe")return Ge(r.in,n)||Ge(r.out,n);if(r.type==="object"){for(const s in r.shape)if(Ge(r.shape[s],n))return!0;return!1}if(r.type==="union"){for(const s of r.options)if(Ge(s,n))return!0;return!1}if(r.type==="tuple"){for(const s of r.items)if(Ge(s,n))return!0;return!!(r.rest&&Ge(r.rest,n))}return!1}const Ad=(t,e={})=>n=>{const r=Qa({...n,processors:e});return Fe(t,r),ec(r,t),tc(r,t)},Zr=(t,e,n={})=>r=>{const{libraryOptions:s,target:i}=r??{},o=Qa({...s??{},target:i,io:e,processors:n});return Fe(t,o),ec(o,t),tc(o,t)},Od={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Nd=(t,e,n,r)=>{const s=n;s.type="string";const{minimum:i,maximum:o,format:a,patterns:c,contentEncoding:l}=t._zod.bag;if(typeof i=="number"&&(s.minLength=i),typeof o=="number"&&(s.maxLength=o),a&&(s.format=Od[a]??a,s.format===""&&delete s.format,a==="time"&&delete s.format),l&&(s.contentEncoding=l),c&&c.size>0){const d=[...c];d.length===1?s.pattern=d[0].source:d.length>1&&(s.allOf=[...d.map(p=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},Td=(t,e,n,r)=>{const s=n,{minimum:i,maximum:o,format:a,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:d}=t._zod.bag;typeof a=="string"&&a.includes("int")?s.type="integer":s.type="number",typeof d=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(s.minimum=d,s.exclusiveMinimum=!0):s.exclusiveMinimum=d),typeof i=="number"&&(s.minimum=i,typeof d=="number"&&e.target!=="draft-04"&&(d>=i?delete s.minimum:delete s.exclusiveMinimum)),typeof l=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(s.maximum=l,s.exclusiveMaximum=!0):s.exclusiveMaximum=l),typeof o=="number"&&(s.maximum=o,typeof l=="number"&&e.target!=="draft-04"&&(l<=o?delete s.maximum:delete s.exclusiveMaximum)),typeof c=="number"&&(s.multipleOf=c)},Pd=(t,e,n,r)=>{n.type="boolean"},Cd=(t,e,n,r)=>{n.not={}},xd=(t,e,n,r)=>{},Bd=(t,e,n,r)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},Dd=(t,e,n,r)=>{const s=t._zod.def,i=Ta(s.entries);i.every(o=>typeof o=="number")&&(n.type="number"),i.every(o=>typeof o=="string")&&(n.type="string"),n.enum=i},zd=(t,e,n,r)=>{const s=t._zod.def,i=[];for(const o of s.values)if(o===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof o=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(o))}else i.push(o);if(i.length!==0)if(i.length===1){const o=i[0];n.type=o===null?"null":typeof o,e.target==="draft-04"||e.target==="openapi-3.0"?n.enum=[o]:n.const=o}else i.every(o=>typeof o=="number")&&(n.type="number"),i.every(o=>typeof o=="string")&&(n.type="string"),i.every(o=>typeof o=="boolean")&&(n.type="boolean"),i.every(o=>o===null)&&(n.type="null"),n.enum=i},Rd=(t,e,n,r)=>{const s=n,i=t._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");s.type="string",s.pattern=i.source},jd=(t,e,n,r)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Fd=(t,e,n,r)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Md=(t,e,n,r)=>{const s=n,i=t._zod.def,{minimum:o,maximum:a}=t._zod.bag;typeof o=="number"&&(s.minItems=o),typeof a=="number"&&(s.maxItems=a),s.type="array",s.items=Fe(i.element,e,{...r,path:[...r.path,"items"]})},Ud=(t,e,n,r)=>{const s=n,i=t._zod.def;s.type="object",s.properties={};const o=i.shape;for(const l in o)s.properties[l]=Fe(o[l],e,{...r,path:[...r.path,"properties",l]});const a=new Set(Object.keys(o)),c=new Set([...a].filter(l=>{const d=i.shape[l]._zod;return e.io==="input"?d.optin===void 0:d.optout===void 0}));c.size>0&&(s.required=Array.from(c)),i.catchall?._zod.def.type==="never"?s.additionalProperties=!1:i.catchall?i.catchall&&(s.additionalProperties=Fe(i.catchall,e,{...r,path:[...r.path,"additionalProperties"]})):e.io==="output"&&(s.additionalProperties=!1)},Ld=(t,e,n,r)=>{const s=t._zod.def,i=s.inclusive===!1,o=s.options.map((a,c)=>Fe(a,e,{...r,path:[...r.path,i?"oneOf":"anyOf",c]}));i?n.oneOf=o:n.anyOf=o},qd=(t,e,n,r)=>{const s=t._zod.def,i=Fe(s.left,e,{...r,path:[...r.path,"allOf",0]}),o=Fe(s.right,e,{...r,path:[...r.path,"allOf",1]}),a=l=>"allOf"in l&&Object.keys(l).length===1,c=[...a(i)?i.allOf:[i],...a(o)?o.allOf:[o]];n.allOf=c},Zd=(t,e,n,r)=>{const s=n,i=t._zod.def;s.type="object";const o=i.keyType,c=o._zod.bag?.patterns;if(i.mode==="loose"&&c&&c.size>0){const d=Fe(i.valueType,e,{...r,path:[...r.path,"patternProperties","*"]});s.patternProperties={};for(const p of c)s.patternProperties[p.source]=d}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(s.propertyNames=Fe(i.keyType,e,{...r,path:[...r.path,"propertyNames"]})),s.additionalProperties=Fe(i.valueType,e,{...r,path:[...r.path,"additionalProperties"]});const l=o._zod.values;if(l){const d=[...l].filter(p=>typeof p=="string"||typeof p=="number");d.length>0&&(s.required=d)}},Vd=(t,e,n,r)=>{const s=t._zod.def,i=Fe(s.innerType,e,r),o=e.seen.get(t);e.target==="openapi-3.0"?(o.ref=s.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]},Kd=(t,e,n,r)=>{const s=t._zod.def;Fe(s.innerType,e,r);const i=e.seen.get(t);i.ref=s.innerType},Jd=(t,e,n,r)=>{const s=t._zod.def;Fe(s.innerType,e,r);const i=e.seen.get(t);i.ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))},Hd=(t,e,n,r)=>{const s=t._zod.def;Fe(s.innerType,e,r);const i=e.seen.get(t);i.ref=s.innerType,e.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},Gd=(t,e,n,r)=>{const s=t._zod.def;Fe(s.innerType,e,r);const i=e.seen.get(t);i.ref=s.innerType;let o;try{o=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=o},Wd=(t,e,n,r)=>{const s=t._zod.def,i=e.io==="input"?s.in._zod.def.type==="transform"?s.out:s.in:s.out;Fe(i,e,r);const o=e.seen.get(t);o.ref=i},Yd=(t,e,n,r)=>{const s=t._zod.def;Fe(s.innerType,e,r);const i=e.seen.get(t);i.ref=s.innerType,n.readOnly=!0},nc=(t,e,n,r)=>{const s=t._zod.def;Fe(s.innerType,e,r);const i=e.seen.get(t);i.ref=s.innerType},Xd=U("ZodISODateTime",(t,e)=>{Kl.init(t,e),Ne.init(t,e)});function Qd(t){return ed(Xd,t)}const eh=U("ZodISODate",(t,e)=>{Jl.init(t,e),Ne.init(t,e)});function th(t){return td(eh,t)}const nh=U("ZodISOTime",(t,e)=>{Hl.init(t,e),Ne.init(t,e)});function rh(t){return nd(nh,t)}const sh=U("ZodISODuration",(t,e)=>{Gl.init(t,e),Ne.init(t,e)});function ih(t){return rd(sh,t)}const oh=(t,e)=>{Ba.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:n=>Fu(t,n)},flatten:{value:n=>ju(t,n)},addIssue:{value:n=>{t.issues.push(n),t.message=JSON.stringify(t.issues,zs,2)}},addIssues:{value:n=>{t.issues.push(...n),t.message=JSON.stringify(t.issues,zs,2)}},isEmpty:{get(){return t.issues.length===0}}})},it=U("ZodError",oh,{Parent:Error}),ah=Gs(it),ch=Ws(it),uh=Xr(it),lh=Qr(it),fh=Lu(it),dh=qu(it),hh=Zu(it),ph=Vu(it),mh=Ku(it),gh=Ju(it),yh=Hu(it),wh=Gu(it),ke=U("ZodType",(t,e)=>(Ee.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:Zr(t,"input"),output:Zr(t,"output")}}),t.toJSONSchema=Ad(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.check=(...n)=>t.clone(Ot(e,{checks:[...e.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),t.with=t.check,t.clone=(n,r)=>Nt(t,n,r),t.brand=()=>t,t.register=((n,r)=>(n.add(t,r),t)),t.parse=(n,r)=>ah(t,n,r,{callee:t.parse}),t.safeParse=(n,r)=>uh(t,n,r),t.parseAsync=async(n,r)=>ch(t,n,r,{callee:t.parseAsync}),t.safeParseAsync=async(n,r)=>lh(t,n,r),t.spa=t.safeParseAsync,t.encode=(n,r)=>fh(t,n,r),t.decode=(n,r)=>dh(t,n,r),t.encodeAsync=async(n,r)=>hh(t,n,r),t.decodeAsync=async(n,r)=>ph(t,n,r),t.safeEncode=(n,r)=>mh(t,n,r),t.safeDecode=(n,r)=>gh(t,n,r),t.safeEncodeAsync=async(n,r)=>yh(t,n,r),t.safeDecodeAsync=async(n,r)=>wh(t,n,r),t.refine=(n,r)=>t.check(fp(n,r)),t.superRefine=n=>t.check(dp(n)),t.overwrite=n=>t.check(cn(n)),t.optional=()=>Mi(t),t.exactOptional=()=>Yh(t),t.nullable=()=>Ui(t),t.nullish=()=>Mi(Ui(t)),t.nonoptional=n=>rp(t,n),t.array=()=>Ke(t),t.or=n=>Ut([t,n]),t.and=n=>Vh(t,n),t.transform=n=>Li(t,Gh(n)),t.default=n=>ep(t,n),t.prefault=n=>np(t,n),t.catch=n=>ip(t,n),t.pipe=n=>Li(t,n),t.readonly=()=>up(t),t.describe=n=>{const r=t.clone();return kn.add(r,{description:n}),r},Object.defineProperty(t,"description",{get(){return kn.get(t)?.description},configurable:!0}),t.meta=(...n)=>{if(n.length===0)return kn.get(t);const r=t.clone();return kn.add(r,n[0]),r},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t.apply=n=>n(t),t)),rc=U("_ZodString",(t,e)=>{Ys.init(t,e),ke.init(t,e),t._zod.processJSONSchema=(r,s,i)=>Nd(t,r,s);const n=t._zod.bag;t.format=n.format??null,t.minLength=n.minimum??null,t.maxLength=n.maximum??null,t.regex=(...r)=>t.check(fd(...r)),t.includes=(...r)=>t.check(pd(...r)),t.startsWith=(...r)=>t.check(md(...r)),t.endsWith=(...r)=>t.check(gd(...r)),t.min=(...r)=>t.check(qr(...r)),t.max=(...r)=>t.check(Ya(...r)),t.length=(...r)=>t.check(Xa(...r)),t.nonempty=(...r)=>t.check(qr(1,...r)),t.lowercase=r=>t.check(dd(r)),t.uppercase=r=>t.check(hd(r)),t.trim=()=>t.check(wd()),t.normalize=(...r)=>t.check(yd(...r)),t.toLowerCase=()=>t.check(vd()),t.toUpperCase=()=>t.check(bd()),t.slugify=()=>t.check(_d())}),vh=U("ZodString",(t,e)=>{Ys.init(t,e),rc.init(t,e),t.email=n=>t.check(Df(bh,n)),t.url=n=>t.check(Ga(sc,n)),t.jwt=n=>t.check(Qf(Dh,n)),t.emoji=n=>t.check(Mf($h,n)),t.guid=n=>t.check(Bi(ji,n)),t.uuid=n=>t.check(zf(Ln,n)),t.uuidv4=n=>t.check(Rf(Ln,n)),t.uuidv6=n=>t.check(jf(Ln,n)),t.uuidv7=n=>t.check(Ff(Ln,n)),t.nanoid=n=>t.check(Uf(Sh,n)),t.guid=n=>t.check(Bi(ji,n)),t.cuid=n=>t.check(Lf(Eh,n)),t.cuid2=n=>t.check(Wa(ic,n)),t.ulid=n=>t.check(qf(kh,n)),t.base64=n=>t.check(Wf(Ch,n)),t.base64url=n=>t.check(Yf(xh,n)),t.xid=n=>t.check(Zf(Ih,n)),t.ksuid=n=>t.check(Vf(Ah,n)),t.ipv4=n=>t.check(Kf(Oh,n)),t.ipv6=n=>t.check(Jf(Nh,n)),t.cidrv4=n=>t.check(Hf(Th,n)),t.cidrv6=n=>t.check(Gf(Ph,n)),t.e164=n=>t.check(Xf(Bh,n)),t.datetime=n=>t.check(Qd(n)),t.date=n=>t.check(th(n)),t.time=n=>t.check(rh(n)),t.duration=n=>t.check(ih(n))});function B(t){return Bf(vh,t)}const Ne=U("ZodStringFormat",(t,e)=>{Oe.init(t,e),rc.init(t,e)}),bh=U("ZodEmail",(t,e)=>{Rl.init(t,e),Ne.init(t,e)}),ji=U("ZodGUID",(t,e)=>{Dl.init(t,e),Ne.init(t,e)}),Ln=U("ZodUUID",(t,e)=>{zl.init(t,e),Ne.init(t,e)}),sc=U("ZodURL",(t,e)=>{jl.init(t,e),Ne.init(t,e)});function _h(t){return Ga(sc,t)}const $h=U("ZodEmoji",(t,e)=>{Fl.init(t,e),Ne.init(t,e)}),Sh=U("ZodNanoID",(t,e)=>{Ml.init(t,e),Ne.init(t,e)}),Eh=U("ZodCUID",(t,e)=>{Ul.init(t,e),Ne.init(t,e)}),ic=U("ZodCUID2",(t,e)=>{Ll.init(t,e),Ne.init(t,e)});function ue(t){return Wa(ic,t)}const kh=U("ZodULID",(t,e)=>{ql.init(t,e),Ne.init(t,e)}),Ih=U("ZodXID",(t,e)=>{Zl.init(t,e),Ne.init(t,e)}),Ah=U("ZodKSUID",(t,e)=>{Vl.init(t,e),Ne.init(t,e)}),Oh=U("ZodIPv4",(t,e)=>{Wl.init(t,e),Ne.init(t,e)}),Nh=U("ZodIPv6",(t,e)=>{Yl.init(t,e),Ne.init(t,e)}),Th=U("ZodCIDRv4",(t,e)=>{Xl.init(t,e),Ne.init(t,e)}),Ph=U("ZodCIDRv6",(t,e)=>{Ql.init(t,e),Ne.init(t,e)}),Ch=U("ZodBase64",(t,e)=>{ef.init(t,e),Ne.init(t,e)}),xh=U("ZodBase64URL",(t,e)=>{nf.init(t,e),Ne.init(t,e)}),Bh=U("ZodE164",(t,e)=>{rf.init(t,e),Ne.init(t,e)}),Dh=U("ZodJWT",(t,e)=>{of.init(t,e),Ne.init(t,e)}),oc=U("ZodNumber",(t,e)=>{Za.init(t,e),ke.init(t,e),t._zod.processJSONSchema=(r,s,i)=>Td(t,r,s),t.gt=(r,s)=>t.check(zi(r,s)),t.gte=(r,s)=>t.check(Dr(r,s)),t.min=(r,s)=>t.check(Dr(r,s)),t.lt=(r,s)=>t.check(Di(r,s)),t.lte=(r,s)=>t.check(Br(r,s)),t.max=(r,s)=>t.check(Br(r,s)),t.int=r=>t.check(Fi(r)),t.safe=r=>t.check(Fi(r)),t.positive=r=>t.check(zi(0,r)),t.nonnegative=r=>t.check(Dr(0,r)),t.negative=r=>t.check(Di(0,r)),t.nonpositive=r=>t.check(Br(0,r)),t.multipleOf=(r,s)=>t.check(Ri(r,s)),t.step=(r,s)=>t.check(Ri(r,s)),t.finite=()=>t;const n=t._zod.bag;t.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),t.isFinite=!0,t.format=n.format??null});function De(t){return sd(oc,t)}const zh=U("ZodNumberFormat",(t,e)=>{af.init(t,e),oc.init(t,e)});function Fi(t){return id(zh,t)}const ac=U("ZodBoolean",(t,e)=>{cf.init(t,e),ke.init(t,e),t._zod.processJSONSchema=(n,r,s)=>Pd(t,n,r)});function ve(t){return od(ac,t)}const Rh=U("ZodUnknown",(t,e)=>{uf.init(t,e),ke.init(t,e),t._zod.processJSONSchema=(n,r,s)=>xd()});function dt(){return cd(Rh)}const jh=U("ZodNever",(t,e)=>{lf.init(t,e),ke.init(t,e),t._zod.processJSONSchema=(n,r,s)=>Cd(t,n,r)});function Fh(t){return ud(jh,t)}const Mh=U("ZodDate",(t,e)=>{ff.init(t,e),ke.init(t,e),t._zod.processJSONSchema=(r,s,i)=>Bd(t,r),t.min=(r,s)=>t.check(Dr(r,s)),t.max=(r,s)=>t.check(Br(r,s));const n=t._zod.bag;t.minDate=n.minimum?new Date(n.minimum):null,t.maxDate=n.maximum?new Date(n.maximum):null});function we(t){return ld(Mh,t)}const Uh=U("ZodArray",(t,e)=>{df.init(t,e),ke.init(t,e),t._zod.processJSONSchema=(n,r,s)=>Md(t,n,r,s),t.element=e.element,t.min=(n,r)=>t.check(qr(n,r)),t.nonempty=n=>t.check(qr(1,n)),t.max=(n,r)=>t.check(Ya(n,r)),t.length=(n,r)=>t.check(Xa(n,r)),t.unwrap=()=>t.element});function Ke(t,e){return $d(Uh,t,e)}const Lh=U("ZodObject",(t,e)=>{pf.init(t,e),ke.init(t,e),t._zod.processJSONSchema=(n,r,s)=>Ud(t,n,r,s),ge(t,"shape",()=>e.shape),t.keyof=()=>_t(Object.keys(t._zod.def.shape)),t.catchall=n=>t.clone({...t._zod.def,catchall:n}),t.passthrough=()=>t.clone({...t._zod.def,catchall:dt()}),t.loose=()=>t.clone({...t._zod.def,catchall:dt()}),t.strict=()=>t.clone({...t._zod.def,catchall:Fh()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=n=>xu(t,n),t.safeExtend=n=>Bu(t,n),t.merge=n=>Du(t,n),t.pick=n=>Pu(t,n),t.omit=n=>Cu(t,n),t.partial=(...n)=>zu(uc,t,n[0]),t.required=(...n)=>Ru(lc,t,n[0])});function V(t,e){const n={type:"object",shape:t??{},...te(e)};return new Lh(n)}const cc=U("ZodUnion",(t,e)=>{Ja.init(t,e),ke.init(t,e),t._zod.processJSONSchema=(n,r,s)=>Ld(t,n,r,s),t.options=e.options});function Ut(t,e){return new cc({type:"union",options:t,...te(e)})}const qh=U("ZodDiscriminatedUnion",(t,e)=>{cc.init(t,e),mf.init(t,e)});function bt(t,e,n){return new qh({type:"union",options:e,discriminator:t,...te(n)})}const Zh=U("ZodIntersection",(t,e)=>{gf.init(t,e),ke.init(t,e),t._zod.processJSONSchema=(n,r,s)=>qd(t,n,r,s)});function Vh(t,e){return new Zh({type:"intersection",left:t,right:e})}const Kh=U("ZodRecord",(t,e)=>{yf.init(t,e),ke.init(t,e),t._zod.processJSONSchema=(n,r,s)=>Zd(t,n,r,s),t.keyType=e.keyType,t.valueType=e.valueType});function ze(t,e,n){return new Kh({type:"record",keyType:t,valueType:e,...te(n)})}const js=U("ZodEnum",(t,e)=>{wf.init(t,e),ke.init(t,e),t._zod.processJSONSchema=(r,s,i)=>Dd(t,r,s),t.enum=e.entries,t.options=Object.values(e.entries);const n=new Set(Object.keys(e.entries));t.extract=(r,s)=>{const i={};for(const o of r)if(n.has(o))i[o]=e.entries[o];else throw new Error(`Key ${o} not found in enum`);return new js({...e,checks:[],...te(s),entries:i})},t.exclude=(r,s)=>{const i={...e.entries};for(const o of r)if(n.has(o))delete i[o];else throw new Error(`Key ${o} not found in enum`);return new js({...e,checks:[],...te(s),entries:i})}});function _t(t,e){const n=Array.isArray(t)?Object.fromEntries(t.map(r=>[r,r])):t;return new js({type:"enum",entries:n,...te(e)})}const Jh=U("ZodLiteral",(t,e)=>{vf.init(t,e),ke.init(t,e),t._zod.processJSONSchema=(n,r,s)=>zd(t,n,r),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function fe(t,e){return new Jh({type:"literal",values:Array.isArray(t)?t:[t],...te(e)})}const Hh=U("ZodTransform",(t,e)=>{bf.init(t,e),ke.init(t,e),t._zod.processJSONSchema=(n,r,s)=>Fd(t,n),t._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Oa(t.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(Pn(i,n.value,e));else{const o=i;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=t),n.issues.push(Pn(o))}};const s=e.transform(n.value,n);return s instanceof Promise?s.then(i=>(n.value=i,n)):(n.value=s,n)}});function Gh(t){return new Hh({type:"transform",transform:t})}const uc=U("ZodOptional",(t,e)=>{Ha.init(t,e),ke.init(t,e),t._zod.processJSONSchema=(n,r,s)=>nc(t,n,r,s),t.unwrap=()=>t._zod.def.innerType});function Mi(t){return new uc({type:"optional",innerType:t})}const Wh=U("ZodExactOptional",(t,e)=>{_f.init(t,e),ke.init(t,e),t._zod.processJSONSchema=(n,r,s)=>nc(t,n,r,s),t.unwrap=()=>t._zod.def.innerType});function Yh(t){return new Wh({type:"optional",innerType:t})}const Xh=U("ZodNullable",(t,e)=>{$f.init(t,e),ke.init(t,e),t._zod.processJSONSchema=(n,r,s)=>Vd(t,n,r,s),t.unwrap=()=>t._zod.def.innerType});function Ui(t){return new Xh({type:"nullable",innerType:t})}const Qh=U("ZodDefault",(t,e)=>{Sf.init(t,e),ke.init(t,e),t._zod.processJSONSchema=(n,r,s)=>Jd(t,n,r,s),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function ep(t,e){return new Qh({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():Ca(e)}})}const tp=U("ZodPrefault",(t,e)=>{Ef.init(t,e),ke.init(t,e),t._zod.processJSONSchema=(n,r,s)=>Hd(t,n,r,s),t.unwrap=()=>t._zod.def.innerType});function np(t,e){return new tp({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():Ca(e)}})}const lc=U("ZodNonOptional",(t,e)=>{kf.init(t,e),ke.init(t,e),t._zod.processJSONSchema=(n,r,s)=>Kd(t,n,r,s),t.unwrap=()=>t._zod.def.innerType});function rp(t,e){return new lc({type:"nonoptional",innerType:t,...te(e)})}const sp=U("ZodCatch",(t,e)=>{If.init(t,e),ke.init(t,e),t._zod.processJSONSchema=(n,r,s)=>Gd(t,n,r,s),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function ip(t,e){return new sp({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}const fc=U("ZodPipe",(t,e)=>{Af.init(t,e),ke.init(t,e),t._zod.processJSONSchema=(n,r,s)=>Wd(t,n,r,s),t.in=e.in,t.out=e.out});function Li(t,e){return new fc({type:"pipe",in:t,out:e})}const op=U("ZodCodec",(t,e)=>{fc.init(t,e),Of.init(t,e)});function ap(t,e,n){return new op({type:"pipe",in:t,out:e,transform:n.decode,reverseTransform:n.encode})}const cp=U("ZodReadonly",(t,e)=>{Nf.init(t,e),ke.init(t,e),t._zod.processJSONSchema=(n,r,s)=>Yd(t,n,r,s),t.unwrap=()=>t._zod.def.innerType});function up(t){return new cp({type:"readonly",innerType:t})}const lp=U("ZodTemplateLiteral",(t,e)=>{Tf.init(t,e),ke.init(t,e),t._zod.processJSONSchema=(n,r,s)=>Rd(t,n,r)});function zr(t,e){return new lp({type:"template_literal",parts:t,...te(e)})}const Xs=U("ZodCustom",(t,e)=>{Pf.init(t,e),ke.init(t,e),t._zod.processJSONSchema=(n,r,s)=>jd(t,n)});function Qt(t,e){return Sd(Xs,(()=>!0),e)}function fp(t,e={}){return Ed(Xs,t,e)}function dp(t){return kd(t)}function hp(t,e={}){const n=new Xs({type:"custom",check:"custom",fn:r=>r instanceof t,abort:!0,...te(e)});return n._zod.bag.Class=t,n._zod.check=r=>{r.value instanceof t||r.issues.push({code:"invalid_type",expected:t.name,input:r.value,inst:n,path:[...n._zod.def.path??[]]})},n}function pp(t){return ad(ac,t)}function mp(t,e,n){let r=s=>t(s,...e);return n===void 0?r:Object.assign(r,{lazy:n,lazyArgs:e})}function dc(t,e,n){let r=t.length-e.length;if(r===0)return t(...e);if(r===1)return mp(t,e,n);throw Error("Wrong number of arguments")}const hc={done:!1,hasNext:!1};function qi(t,...e){let n=t,r=e.map(i=>"lazy"in i?gp(i):void 0),s=0;for(;s<e.length;){if(r[s]===void 0||!yp(n)){let c=e[s];n=c(n),s+=1;continue}let i=[];for(let c=s;c<e.length;c++){let l=r[c];if(l===void 0||(i.push(l),l.isSingle))break}let o=[];for(let c of n)if(pc(c,o,i))break;let{isSingle:a}=i.at(-1);n=a?o[0]:o,s+=i.length}return n}function pc(t,e,n){if(n.length===0)return e.push(t),!1;let r=t,s=hc,i=!1;for(let[o,a]of n.entries()){let{index:c,items:l}=a;if(l.push(r),s=a(r,c,l),a.index+=1,s.hasNext){if(s.hasMany??!1){for(let d of s.next)if(pc(d,e,n.slice(o+1)))return!0;return i}r=s.next}if(!s.hasNext)break;s.done&&(i=!0)}return s.hasNext&&e.push(r),i}function gp(t){let{lazy:e,lazyArgs:n}=t,r=e(...n);return Object.assign(r,{isSingle:e.single??!1,index:0,items:[]})}function yp(t){return typeof t=="string"||typeof t=="object"&&!!t&&Symbol.iterator in t}function wp(t,e){let n=e.length-t.length;if(n===1){let[r,...s]=e;return qi(r,{lazy:t,lazyArgs:s})}if(n===0){let r={lazy:t,lazyArgs:e};return Object.assign(s=>qi(s,r),r)}throw Error("Wrong number of arguments")}function vp(...t){return dc(Object.fromEntries,t)}function bp(...t){return dc(_p,t)}function _p(t,e){let n={};for(let[r,s]of Object.entries(t))n[r]=e(s,r,t);return n}function $p(...t){return wp(Sp,t)}function Sp(){let t=new Set;return e=>t.has(e)?hc:(t.add(e),{done:!1,hasNext:!0,next:e})}const Qs=Symbol.for("yaml.alias"),Fs=Symbol.for("yaml.document"),Et=Symbol.for("yaml.map"),mc=Symbol.for("yaml.pair"),ht=Symbol.for("yaml.scalar"),un=Symbol.for("yaml.seq"),st=Symbol.for("yaml.node.type"),ln=t=>!!t&&typeof t=="object"&&t[st]===Qs,ts=t=>!!t&&typeof t=="object"&&t[st]===Fs,Bn=t=>!!t&&typeof t=="object"&&t[st]===Et,je=t=>!!t&&typeof t=="object"&&t[st]===mc,Se=t=>!!t&&typeof t=="object"&&t[st]===ht,Dn=t=>!!t&&typeof t=="object"&&t[st]===un;function Be(t){if(t&&typeof t=="object")switch(t[st]){case Et:case un:return!0}return!1}function Re(t){if(t&&typeof t=="object")switch(t[st]){case Qs:case Et:case ht:case un:return!0}return!1}const gc=t=>(Se(t)||Be(t))&&!!t.anchor,Dt=Symbol("break visit"),Ep=Symbol("skip children"),On=Symbol("remove node");function fn(t,e){const n=kp(e);ts(t)?Gt(null,t.contents,n,Object.freeze([t]))===On&&(t.contents=null):Gt(null,t,n,Object.freeze([]))}fn.BREAK=Dt;fn.SKIP=Ep;fn.REMOVE=On;function Gt(t,e,n,r){const s=Ip(t,e,n,r);if(Re(s)||je(s))return Ap(t,r,s),Gt(t,s,n,r);if(typeof s!="symbol"){if(Be(e)){r=Object.freeze(r.concat(e));for(let i=0;i<e.items.length;++i){const o=Gt(i,e.items[i],n,r);if(typeof o=="number")i=o-1;else{if(o===Dt)return Dt;o===On&&(e.items.splice(i,1),i-=1)}}}else if(je(e)){r=Object.freeze(r.concat(e));const i=Gt("key",e.key,n,r);if(i===Dt)return Dt;i===On&&(e.key=null);const o=Gt("value",e.value,n,r);if(o===Dt)return Dt;o===On&&(e.value=null)}}return s}function kp(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function Ip(t,e,n,r){if(typeof n=="function")return n(t,e,r);if(Bn(e))return n.Map?.(t,e,r);if(Dn(e))return n.Seq?.(t,e,r);if(je(e))return n.Pair?.(t,e,r);if(Se(e))return n.Scalar?.(t,e,r);if(ln(e))return n.Alias?.(t,e,r)}function Ap(t,e,n){const r=e[e.length-1];if(Be(r))r.items[t]=n;else if(je(r))t==="key"?r.key=n:r.value=n;else if(ts(r))r.contents=n;else{const s=ln(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${s} parent`)}}const Op={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Np=t=>t.replace(/[!,[\]{}]/g,e=>Op[e]);class We{constructor(e,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},We.defaultYaml,e),this.tags=Object.assign({},We.defaultTags,n)}clone(){const e=new We(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new We(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:We.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},We.defaultTags);break}return e}add(e,n){this.atNextDocument&&(this.yaml={explicit:We.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},We.defaultTags),this.atNextDocument=!1);const r=e.trim().split(/[ \t]+/),s=r.shift();switch(s){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;const[i,o]=r;return this.tags[i]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[i]=r;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;{const o=/^\d+\.\d+$/.test(i);return n(6,`Unsupported YAML version ${i}`,o),!1}}default:return n(0,`Unknown directive ${s}`,!0),!1}}tagName(e,n){if(e==="!")return"!";if(e[0]!=="!")return n(`Not a valid tag: ${e}`),null;if(e[1]==="<"){const o=e.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}const[,r,s]=e.match(/^(.*!)([^!]*)$/s);s||n(`The ${e} tag has no suffix`);const i=this.tags[r];if(i)try{return i+decodeURIComponent(s)}catch(o){return n(String(o)),null}return r==="!"?e:(n(`Could not resolve tag: ${e}`),null)}tagString(e){for(const[n,r]of Object.entries(this.tags))if(e.startsWith(r))return n+Np(e.substring(r.length));return e[0]==="!"?e:`!<${e}>`}toString(e){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags);let s;if(e&&r.length>0&&Re(e.contents)){const i={};fn(e.contents,(o,a)=>{Re(a)&&a.tag&&(i[a.tag]=!0)}),s=Object.keys(i)}else s=[];for(const[i,o]of r)i==="!!"&&o==="tag:yaml.org,2002:"||(!e||s.some(a=>a.startsWith(o)))&&n.push(`%TAG ${i} ${o}`);return n.join(`
40
+ `)}}We.defaultYaml={explicit:!1,version:"1.2"};We.defaultTags={"!!":"tag:yaml.org,2002:"};function yc(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(n)}return!0}function wc(t){const e=new Set;return fn(t,{Value(n,r){r.anchor&&e.add(r.anchor)}}),e}function vc(t,e){for(let n=1;;++n){const r=`${t}${n}`;if(!e.has(r))return r}}function Tp(t,e){const n=[],r=new Map;let s=null;return{onAnchor:i=>{n.push(i),s??(s=wc(t));const o=vc(e,s);return s.add(o),o},setAnchors:()=>{for(const i of n){const o=r.get(i);if(typeof o=="object"&&o.anchor&&(Se(o.node)||Be(o.node)))o.node.anchor=o.anchor;else{const a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=i,a}}},sourceObjects:r}}function Wt(t,e,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let s=0,i=r.length;s<i;++s){const o=r[s],a=Wt(t,r,String(s),o);a===void 0?delete r[s]:a!==o&&(r[s]=a)}else if(r instanceof Map)for(const s of Array.from(r.keys())){const i=r.get(s),o=Wt(t,r,s,i);o===void 0?r.delete(s):o!==i&&r.set(s,o)}else if(r instanceof Set)for(const s of Array.from(r)){const i=Wt(t,r,s,s);i===void 0?r.delete(s):i!==s&&(r.delete(s),r.add(i))}else for(const[s,i]of Object.entries(r)){const o=Wt(t,r,s,i);o===void 0?delete r[s]:o!==i&&(r[s]=o)}return t.call(e,n,r)}function rt(t,e,n){if(Array.isArray(t))return t.map((r,s)=>rt(r,String(s),n));if(t&&typeof t.toJSON=="function"){if(!n||!gc(t))return t.toJSON(e,n);const r={aliasCount:0,count:1,res:void 0};n.anchors.set(t,r),n.onCreate=i=>{r.res=i,delete n.onCreate};const s=t.toJSON(e,n);return n.onCreate&&n.onCreate(s),s}return typeof t=="bigint"&&!n?.keep?Number(t):t}class ei{constructor(e){Object.defineProperty(this,st,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:n,maxAliasCount:r,onAnchor:s,reviver:i}={}){if(!ts(e))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:e,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},a=rt(this,"",o);if(typeof s=="function")for(const{count:c,res:l}of o.anchors.values())s(l,c);return typeof i=="function"?Wt(i,{"":a},"",a):a}}class ti extends ei{constructor(e){super(Qs),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,n){if(n?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let r;n?.aliasResolveCache?r=n.aliasResolveCache:(r=[],fn(e,{Node:(i,o)=>{(ln(o)||gc(o))&&r.push(o)}}),n&&(n.aliasResolveCache=r));let s;for(const i of r){if(i===this)break;i.anchor===this.source&&(s=i)}return s}toJSON(e,n){if(!n)return{source:this.source};const{anchors:r,doc:s,maxAliasCount:i}=n,o=this.resolve(s,n);if(!o){const c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let a=r.get(o);if(a||(rt(o,null,n),a=r.get(o)),a?.res===void 0){const c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=Rr(s,o,r)),a.count*a.aliasCount>i)){const c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return a.res}toString(e,n,r){const s=`*${this.source}`;if(e){if(yc(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(i)}if(e.implicitKey)return`${s} `}return s}}function Rr(t,e,n){if(ln(e)){const r=e.resolve(t),s=n&&r&&n.get(r);return s?s.count*s.aliasCount:0}else if(Be(e)){let r=0;for(const s of e.items){const i=Rr(t,s,n);i>r&&(r=i)}return r}else if(je(e)){const r=Rr(t,e.key,n),s=Rr(t,e.value,n);return Math.max(r,s)}return 1}const bc=t=>!t||typeof t!="function"&&typeof t!="object";class ce extends ei{constructor(e){super(ht),this.value=e}toJSON(e,n){return n?.keep?this.value:rt(this.value,e,n)}toString(){return String(this.value)}}ce.BLOCK_FOLDED="BLOCK_FOLDED";ce.BLOCK_LITERAL="BLOCK_LITERAL";ce.PLAIN="PLAIN";ce.QUOTE_DOUBLE="QUOTE_DOUBLE";ce.QUOTE_SINGLE="QUOTE_SINGLE";const Pp="tag:yaml.org,2002:";function Cp(t,e,n){if(e){const r=n.filter(i=>i.tag===e),s=r.find(i=>!i.format)??r[0];if(!s)throw new Error(`Tag ${e} not found`);return s}return n.find(r=>r.identify?.(t)&&!r.format)}function Cn(t,e,n){if(ts(t)&&(t=t.contents),Re(t))return t;if(je(t)){const p=n.schema[Et].createNode?.(n.schema,null,n);return p.items.push(t),p}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());const{aliasDuplicateObjects:r,onAnchor:s,onTagObj:i,schema:o,sourceObjects:a}=n;let c;if(r&&t&&typeof t=="object"){if(c=a.get(t),c)return c.anchor??(c.anchor=s(t)),new ti(c.anchor);c={anchor:null,node:null},a.set(t,c)}e?.startsWith("!!")&&(e=Pp+e.slice(2));let l=Cp(t,e,o.tags);if(!l){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){const p=new ce(t);return c&&(c.node=p),p}l=t instanceof Map?o[Et]:Symbol.iterator in Object(t)?o[un]:o[Et]}i&&(i(l),delete n.onTagObj);const d=l?.createNode?l.createNode(n.schema,t,n):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(n.schema,t,n):new ce(t);return e?d.tag=e:l.default||(d.tag=l.tag),c&&(c.node=d),d}function Vr(t,e,n){let r=n;for(let s=e.length-1;s>=0;--s){const i=e[s];if(typeof i=="number"&&Number.isInteger(i)&&i>=0){const o=[];o[i]=r,r=o}else r=new Map([[i,r]])}return Cn(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}const In=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done;class _c extends ei{constructor(e,n){super(e),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(e){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(n.schema=e),n.items=n.items.map(r=>Re(r)||je(r)?r.clone(e):r),this.range&&(n.range=this.range.slice()),n}addIn(e,n){if(In(e))this.add(n);else{const[r,...s]=e,i=this.get(r,!0);if(Be(i))i.addIn(s,n);else if(i===void 0&&this.schema)this.set(r,Vr(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}deleteIn(e){const[n,...r]=e;if(r.length===0)return this.delete(n);const s=this.get(n,!0);if(Be(s))return s.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(e,n){const[r,...s]=e,i=this.get(r,!0);return s.length===0?!n&&Se(i)?i.value:i:Be(i)?i.getIn(s,n):void 0}hasAllNullValues(e){return this.items.every(n=>{if(!je(n))return!1;const r=n.value;return r==null||e&&Se(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){const[n,...r]=e;if(r.length===0)return this.has(n);const s=this.get(n,!0);return Be(s)?s.hasIn(r):!1}setIn(e,n){const[r,...s]=e;if(s.length===0)this.set(r,n);else{const i=this.get(r,!0);if(Be(i))i.setIn(s,n);else if(i===void 0&&this.schema)this.set(r,Vr(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}}const xp=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function wt(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}const zt=(t,e,n)=>t.endsWith(`
41
+ `)?wt(n,e):n.includes(`
42
+ `)?`
43
+ `+wt(n,e):(t.endsWith(" ")?"":" ")+n,$c="flow",Ms="block",jr="quoted";function ns(t,e,n="flow",{indentAtStart:r,lineWidth:s=80,minContentWidth:i=20,onFold:o,onOverflow:a}={}){if(!s||s<0)return t;s<i&&(i=0);const c=Math.max(1+i,1+s-e.length);if(t.length<=c)return t;const l=[],d={};let p=s-e.length;typeof r=="number"&&(r>s-Math.max(2,i)?l.push(0):p=s-r);let h,m,b=!1,w=-1,g=-1,$=-1;n===Ms&&(w=Zi(t,w,e.length),w!==-1&&(p=w+c));for(let _;_=t[w+=1];){if(n===jr&&_==="\\"){switch(g=w,t[w+1]){case"x":w+=3;break;case"u":w+=5;break;case"U":w+=9;break;default:w+=1}$=w}if(_===`
44
+ `)n===Ms&&(w=Zi(t,w,e.length)),p=w+e.length+c,h=void 0;else{if(_===" "&&m&&m!==" "&&m!==`
45
+ `&&m!==" "){const I=t[w+1];I&&I!==" "&&I!==`
46
+ `&&I!==" "&&(h=w)}if(w>=p)if(h)l.push(h),p=h+c,h=void 0;else if(n===jr){for(;m===" "||m===" ";)m=_,_=t[w+=1],b=!0;const I=w>$+1?w-2:g-1;if(d[I])return t;l.push(I),d[I]=!0,p=I+c,h=void 0}else b=!0}m=_}if(b&&a&&a(),l.length===0)return t;o&&o();let y=t.slice(0,l[0]);for(let _=0;_<l.length;++_){const I=l[_],v=l[_+1]||t.length;I===0?y=`
47
+ ${e}${t.slice(0,v)}`:(n===jr&&d[I]&&(y+=`${t[I]}\\`),y+=`
48
+ ${e}${t.slice(I+1,v)}`)}return y}function Zi(t,e,n){let r=e,s=e+1,i=t[s];for(;i===" "||i===" ";)if(e<s+n)i=t[++e];else{do i=t[++e];while(i&&i!==`
49
+ `);r=e,s=e+1,i=t[s]}return r}const rs=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),ss=t=>/^(%|---|\.\.\.)/m.test(t);function Bp(t,e,n){if(!e||e<0)return!1;const r=e-n,s=t.length;if(s<=r)return!1;for(let i=0,o=0;i<s;++i)if(t[i]===`
50
+ `){if(i-o>r)return!0;if(o=i+1,s-o<=r)return!1}return!0}function Nn(t,e){const n=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=e,s=e.options.doubleQuotedMinMultiLineLength,i=e.indent||(ss(t)?" ":"");let o="",a=0;for(let c=0,l=n[c];l;l=n[++c])if(l===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(o+=n.slice(a,c)+"\\ ",c+=1,a=c,l="\\"),l==="\\")switch(n[c+1]){case"u":{o+=n.slice(a,c);const d=n.substr(c+2,4);switch(d){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:d.substr(0,2)==="00"?o+="\\x"+d.substr(2):o+=n.substr(c,6)}c+=5,a=c+1}break;case"n":if(r||n[c+2]==='"'||n.length<s)c+=1;else{for(o+=n.slice(a,c)+`
51
+
52
+ `;n[c+2]==="\\"&&n[c+3]==="n"&&n[c+4]!=='"';)o+=`
53
+ `,c+=2;o+=i,n[c+2]===" "&&(o+="\\"),c+=1,a=c+1}break;default:c+=1}return o=a?o+n.slice(a):n,r?o:ns(o,i,jr,rs(e,!1))}function Us(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
54
+ `)||/[ \t]\n|\n[ \t]/.test(t))return Nn(t,e);const n=e.indent||(ss(t)?" ":""),r="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
55
+ ${n}`)+"'";return e.implicitKey?r:ns(r,n,$c,rs(e,!1))}function Yt(t,e){const{singleQuote:n}=e.options;let r;if(n===!1)r=Nn;else{const s=t.includes('"'),i=t.includes("'");s&&!i?r=Us:i&&!s?r=Nn:r=n?Us:Nn}return r(t,e)}let Ls;try{Ls=new RegExp(`(^|(?<!
56
+ ))
57
+ +(?!
58
+ |$)`,"g")}catch{Ls=/\n+(?!\n|$)/g}function Fr({comment:t,type:e,value:n},r,s,i){const{blockQuote:o,commentString:a,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n))return Yt(n,r);const l=r.indent||(r.forceBlockIndent||ss(n)?" ":""),d=o==="literal"?!0:o==="folded"||e===ce.BLOCK_FOLDED?!1:e===ce.BLOCK_LITERAL?!0:!Bp(n,c,l.length);if(!n)return d?`|
59
+ `:`>
60
+ `;let p,h;for(h=n.length;h>0;--h){const v=n[h-1];if(v!==`
61
+ `&&v!==" "&&v!==" ")break}let m=n.substring(h);const b=m.indexOf(`
62
+ `);b===-1?p="-":n===m||b!==m.length-1?(p="+",i&&i()):p="",m&&(n=n.slice(0,-m.length),m[m.length-1]===`
63
+ `&&(m=m.slice(0,-1)),m=m.replace(Ls,`$&${l}`));let w=!1,g,$=-1;for(g=0;g<n.length;++g){const v=n[g];if(v===" ")w=!0;else if(v===`
64
+ `)$=g;else break}let y=n.substring(0,$<g?$+1:g);y&&(n=n.substring(y.length),y=y.replace(/\n+/g,`$&${l}`));let I=(w?l?"2":"1":"")+p;if(t&&(I+=" "+a(t.replace(/ ?[\r\n]+/g," ")),s&&s()),!d){const v=n.replace(/\n+/g,`
65
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`);let k=!1;const O=rs(r,!0);o!=="folded"&&e!==ce.BLOCK_FOLDED&&(O.onOverflow=()=>{k=!0});const T=ns(`${y}${v}${m}`,l,Ms,O);if(!k)return`>${I}
66
+ ${l}${T}`}return n=n.replace(/\n+/g,`$&${l}`),`|${I}
67
+ ${l}${y}${n}${m}`}function Dp(t,e,n,r){const{type:s,value:i}=t,{actualString:o,implicitKey:a,indent:c,indentStep:l,inFlow:d}=e;if(a&&i.includes(`
68
+ `)||d&&/[[\]{},]/.test(i))return Yt(i,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return a||d||!i.includes(`
69
+ `)?Yt(i,e):Fr(t,e,n,r);if(!a&&!d&&s!==ce.PLAIN&&i.includes(`
70
+ `))return Fr(t,e,n,r);if(ss(i)){if(c==="")return e.forceBlockIndent=!0,Fr(t,e,n,r);if(a&&c===l)return Yt(i,e)}const p=i.replace(/\n+/g,`$&
71
+ ${c}`);if(o){const h=w=>w.default&&w.tag!=="tag:yaml.org,2002:str"&&w.test?.test(p),{compat:m,tags:b}=e.doc.schema;if(b.some(h)||m?.some(h))return Yt(i,e)}return a?p:ns(p,c,$c,rs(e,!1))}function ni(t,e,n,r){const{implicitKey:s,inFlow:i}=e,o=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)});let{type:a}=t;a!==ce.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=ce.QUOTE_DOUBLE);const c=d=>{switch(d){case ce.BLOCK_FOLDED:case ce.BLOCK_LITERAL:return s||i?Yt(o.value,e):Fr(o,e,n,r);case ce.QUOTE_DOUBLE:return Nn(o.value,e);case ce.QUOTE_SINGLE:return Us(o.value,e);case ce.PLAIN:return Dp(o,e,n,r);default:return null}};let l=c(a);if(l===null){const{defaultKeyType:d,defaultStringType:p}=e.options,h=s&&d||p;if(l=c(h),l===null)throw new Error(`Unsupported default string type ${h}`)}return l}function Sc(t,e){const n=Object.assign({blockQuote:!0,commentString:xp,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},t.schema.toStringOptions,e);let r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:t,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:r,options:n}}function zp(t,e){if(e.tag){const s=t.filter(i=>i.tag===e.tag);if(s.length>0)return s.find(i=>i.format===e.format)??s[0]}let n,r;if(Se(e)){r=e.value;let s=t.filter(i=>i.identify?.(r));if(s.length>1){const i=s.filter(o=>o.test);i.length>0&&(s=i)}n=s.find(i=>i.format===e.format)??s.find(i=>!i.format)}else r=e,n=t.find(s=>s.nodeClass&&r instanceof s.nodeClass);if(!n){const s=r?.constructor?.name??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${s} value`)}return n}function Rp(t,e,{anchors:n,doc:r}){if(!r.directives)return"";const s=[],i=(Se(t)||Be(t))&&t.anchor;i&&yc(i)&&(n.add(i),s.push(`&${i}`));const o=t.tag??(e.default?null:e.tag);return o&&s.push(r.directives.tagString(o)),s.join(" ")}function sn(t,e,n,r){if(je(t))return t.toString(e,n,r);if(ln(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let s;const i=Re(t)?t:e.doc.createNode(t,{onTagObj:c=>s=c});s??(s=zp(e.doc.schema.tags,i));const o=Rp(i,s,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);const a=typeof s.stringify=="function"?s.stringify(i,e,n,r):Se(i)?ni(i,e,n,r):i.toString(e,n,r);return o?Se(i)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
72
+ ${e.indent}${a}`:a}function jp({key:t,value:e},n,r,s){const{allNullValues:i,doc:o,indent:a,indentStep:c,options:{commentString:l,indentSeq:d,simpleKeys:p}}=n;let h=Re(t)&&t.comment||null;if(p){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(Be(t)||!Re(t)&&typeof t=="object"){const O="With simple keys, collection cannot be used as a key value";throw new Error(O)}}let m=!p&&(!t||h&&e==null&&!n.inFlow||Be(t)||(Se(t)?t.type===ce.BLOCK_FOLDED||t.type===ce.BLOCK_LITERAL:typeof t=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!m&&(p||!i),indent:a+c});let b=!1,w=!1,g=sn(t,n,()=>b=!0,()=>w=!0);if(!m&&!n.inFlow&&g.length>1024){if(p)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(n.inFlow){if(i||e==null)return b&&r&&r(),g===""?"?":m?`? ${g}`:g}else if(i&&!p||e==null&&m)return g=`? ${g}`,h&&!b?g+=zt(g,n.indent,l(h)):w&&s&&s(),g;b&&(h=null),m?(h&&(g+=zt(g,n.indent,l(h))),g=`? ${g}
73
+ ${a}:`):(g=`${g}:`,h&&(g+=zt(g,n.indent,l(h))));let $,y,_;Re(e)?($=!!e.spaceBefore,y=e.commentBefore,_=e.comment):($=!1,y=null,_=null,e&&typeof e=="object"&&(e=o.createNode(e))),n.implicitKey=!1,!m&&!h&&Se(e)&&(n.indentAtStart=g.length+1),w=!1,!d&&c.length>=2&&!n.inFlow&&!m&&Dn(e)&&!e.flow&&!e.tag&&!e.anchor&&(n.indent=n.indent.substring(2));let I=!1;const v=sn(e,n,()=>I=!0,()=>w=!0);let k=" ";if(h||$||y){if(k=$?`
74
+ `:"",y){const O=l(y);k+=`
75
+ ${wt(O,n.indent)}`}v===""&&!n.inFlow?k===`
76
+ `&&_&&(k=`
77
+
78
+ `):k+=`
79
+ ${n.indent}`}else if(!m&&Be(e)){const O=v[0],T=v.indexOf(`
80
+ `),L=T!==-1,H=n.inFlow??e.flow??e.items.length===0;if(L||!H){let G=!1;if(L&&(O==="&"||O==="!")){let Y=v.indexOf(" ");O==="&"&&Y!==-1&&Y<T&&v[Y+1]==="!"&&(Y=v.indexOf(" ",Y+1)),(Y===-1||T<Y)&&(G=!0)}G||(k=`
81
+ ${n.indent}`)}}else(v===""||v[0]===`
82
+ `)&&(k="");return g+=k+v,n.inFlow?I&&r&&r():_&&!I?g+=zt(g,n.indent,l(_)):w&&s&&s(),g}function Ec(t,e){(t==="debug"||t==="warn")&&console.warn(e)}const qn="<<",vt={identify:t=>t===qn||typeof t=="symbol"&&t.description===qn,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new ce(Symbol(qn)),{addToJSMap:kc}),stringify:()=>qn},Fp=(t,e)=>(vt.identify(e)||Se(e)&&(!e.type||e.type===ce.PLAIN)&&vt.identify(e.value))&&t?.doc.schema.tags.some(n=>n.tag===vt.tag&&n.default);function kc(t,e,n){const r=Ic(t,n);if(Dn(r))for(const s of r.items)ms(t,e,s);else if(Array.isArray(r))for(const s of r)ms(t,e,s);else ms(t,e,r)}function ms(t,e,n){const r=Ic(t,n);if(!Bn(r))throw new Error("Merge sources must be maps or map aliases");const s=r.toJSON(null,t,Map);for(const[i,o]of s)e instanceof Map?e.has(i)||e.set(i,o):e instanceof Set?e.add(i):Object.prototype.hasOwnProperty.call(e,i)||Object.defineProperty(e,i,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function Ic(t,e){return t&&ln(e)?e.resolve(t.doc,t):e}function Ac(t,e,{key:n,value:r}){if(Re(n)&&n.addToJSMap)n.addToJSMap(t,e,r);else if(Fp(t,n))kc(t,e,r);else{const s=rt(n,"",t);if(e instanceof Map)e.set(s,rt(r,s,t));else if(e instanceof Set)e.add(s);else{const i=Mp(n,s,t),o=rt(r,i,t);i in e?Object.defineProperty(e,i,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[i]=o}}return e}function Mp(t,e,n){if(e===null)return"";if(typeof e!="object")return String(e);if(Re(t)&&n?.doc){const r=Sc(n.doc,{});r.anchors=new Set;for(const i of n.anchors.keys())r.anchors.add(i.anchor);r.inFlow=!0,r.inStringifyKey=!0;const s=t.toString(r);if(!n.mapKeyWarned){let i=JSON.stringify(s);i.length>40&&(i=i.substring(0,36)+'..."'),Ec(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${i}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return s}return JSON.stringify(e)}function ri(t,e,n){const r=Cn(t,void 0,n),s=Cn(e,void 0,n);return new Ye(r,s)}class Ye{constructor(e,n=null){Object.defineProperty(this,st,{value:mc}),this.key=e,this.value=n}clone(e){let{key:n,value:r}=this;return Re(n)&&(n=n.clone(e)),Re(r)&&(r=r.clone(e)),new Ye(n,r)}toJSON(e,n){const r=n?.mapAsMap?new Map:{};return Ac(n,r,this)}toString(e,n,r){return e?.doc?jp(this,e,n,r):JSON.stringify(this)}}function Oc(t,e,n){return(e.inFlow??t.flow?Lp:Up)(t,e,n)}function Up({comment:t,items:e},n,{blockItemPrefix:r,flowChars:s,itemIndent:i,onChompKeep:o,onComment:a}){const{indent:c,options:{commentString:l}}=n,d=Object.assign({},n,{indent:i,type:null});let p=!1;const h=[];for(let b=0;b<e.length;++b){const w=e[b];let g=null;if(Re(w))!p&&w.spaceBefore&&h.push(""),Kr(n,h,w.commentBefore,p),w.comment&&(g=w.comment);else if(je(w)){const y=Re(w.key)?w.key:null;y&&(!p&&y.spaceBefore&&h.push(""),Kr(n,h,y.commentBefore,p))}p=!1;let $=sn(w,d,()=>g=null,()=>p=!0);g&&($+=zt($,i,l(g))),p&&g&&(p=!1),h.push(r+$)}let m;if(h.length===0)m=s.start+s.end;else{m=h[0];for(let b=1;b<h.length;++b){const w=h[b];m+=w?`
83
+ ${c}${w}`:`
84
+ `}}return t?(m+=`
85
+ `+wt(l(t),c),a&&a()):p&&o&&o(),m}function Lp({items:t},e,{flowChars:n,itemIndent:r}){const{indent:s,indentStep:i,flowCollectionPadding:o,options:{commentString:a}}=e;r+=i;const c=Object.assign({},e,{indent:r,inFlow:!0,type:null});let l=!1,d=0;const p=[];for(let b=0;b<t.length;++b){const w=t[b];let g=null;if(Re(w))w.spaceBefore&&p.push(""),Kr(e,p,w.commentBefore,!1),w.comment&&(g=w.comment);else if(je(w)){const y=Re(w.key)?w.key:null;y&&(y.spaceBefore&&p.push(""),Kr(e,p,y.commentBefore,!1),y.comment&&(l=!0));const _=Re(w.value)?w.value:null;_?(_.comment&&(g=_.comment),_.commentBefore&&(l=!0)):w.value==null&&y?.comment&&(g=y.comment)}g&&(l=!0);let $=sn(w,c,()=>g=null);l||(l=p.length>d||$.includes(`
86
+ `)),b<t.length-1?$+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(l||(l=p.reduce((y,_)=>y+_.length+2,2)+($.length+2)>e.options.lineWidth)),l&&($+=",")),g&&($+=zt($,r,a(g))),p.push($),d=p.length}const{start:h,end:m}=n;if(p.length===0)return h+m;if(!l){const b=p.reduce((w,g)=>w+g.length+2,2);l=e.options.lineWidth>0&&b>e.options.lineWidth}if(l){let b=h;for(const w of p)b+=w?`
87
+ ${i}${s}${w}`:`
88
+ `;return`${b}
89
+ ${s}${m}`}else return`${h}${o}${p.join(" ")}${o}${m}`}function Kr({indent:t,options:{commentString:e}},n,r,s){if(r&&s&&(r=r.replace(/^\n+/,"")),r){const i=wt(e(r),t);n.push(i.trimStart())}}function Rt(t,e){const n=Se(e)?e.value:e;for(const r of t)if(je(r)&&(r.key===e||r.key===n||Se(r.key)&&r.key.value===n))return r}class nt extends _c{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Et,e),this.items=[]}static from(e,n,r){const{keepUndefined:s,replacer:i}=r,o=new this(e),a=(c,l)=>{if(typeof i=="function")l=i.call(n,c,l);else if(Array.isArray(i)&&!i.includes(c))return;(l!==void 0||s)&&o.items.push(ri(c,l,r))};if(n instanceof Map)for(const[c,l]of n)a(c,l);else if(n&&typeof n=="object")for(const c of Object.keys(n))a(c,n[c]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,n){let r;je(e)?r=e:!e||typeof e!="object"||!("key"in e)?r=new Ye(e,e?.value):r=new Ye(e.key,e.value);const s=Rt(this.items,r.key),i=this.schema?.sortMapEntries;if(s){if(!n)throw new Error(`Key ${r.key} already set`);Se(s.value)&&bc(r.value)?s.value.value=r.value:s.value=r.value}else if(i){const o=this.items.findIndex(a=>i(r,a)<0);o===-1?this.items.push(r):this.items.splice(o,0,r)}else this.items.push(r)}delete(e){const n=Rt(this.items,e);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(e,n){const s=Rt(this.items,e)?.value;return(!n&&Se(s)?s.value:s)??void 0}has(e){return!!Rt(this.items,e)}set(e,n){this.add(new Ye(e,n),!0)}toJSON(e,n,r){const s=r?new r:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(s);for(const i of this.items)Ac(n,s,i);return s}toString(e,n,r){if(!e)return JSON.stringify(this);for(const s of this.items)if(!je(s))throw new Error(`Map items must all be pairs; found ${JSON.stringify(s)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Oc(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:r,onComment:n})}}const dn={collection:"map",default:!0,nodeClass:nt,tag:"tag:yaml.org,2002:map",resolve(t,e){return Bn(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,n)=>nt.from(t,e,n)};class Ft extends _c{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(un,e),this.items=[]}add(e){this.items.push(e)}delete(e){const n=Zn(e);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(e,n){const r=Zn(e);if(typeof r!="number")return;const s=this.items[r];return!n&&Se(s)?s.value:s}has(e){const n=Zn(e);return typeof n=="number"&&n<this.items.length}set(e,n){const r=Zn(e);if(typeof r!="number")throw new Error(`Expected a valid index, not ${e}.`);const s=this.items[r];Se(s)&&bc(n)?s.value=n:this.items[r]=n}toJSON(e,n){const r=[];n?.onCreate&&n.onCreate(r);let s=0;for(const i of this.items)r.push(rt(i,String(s++),n));return r}toString(e,n,r){return e?Oc(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:r,onComment:n}):JSON.stringify(this)}static from(e,n,r){const{replacer:s}=r,i=new this(e);if(n&&Symbol.iterator in Object(n)){let o=0;for(let a of n){if(typeof s=="function"){const c=n instanceof Set?a:String(o++);a=s.call(n,c,a)}i.items.push(Cn(a,void 0,r))}}return i}}function Zn(t){let e=Se(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}const hn={collection:"seq",default:!0,nodeClass:Ft,tag:"tag:yaml.org,2002:seq",resolve(t,e){return Dn(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,n)=>Ft.from(t,e,n)},is={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,n,r){return e=Object.assign({actualString:!0},e),ni(t,e,n,r)}},os={identify:t=>t==null,createNode:()=>new ce(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new ce(null),stringify:({source:t},e)=>typeof t=="string"&&os.test.test(t)?t:e.options.nullStr},si={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new ce(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},n){if(t&&si.test.test(t)){const r=t[0]==="t"||t[0]==="T";if(e===r)return t}return e?n.options.trueStr:n.options.falseStr}};function ut({format:t,minFractionDigits:e,tag:n,value:r}){if(typeof r=="bigint")return String(r);const s=typeof r=="number"?r:Number(r);if(!isFinite(s))return isNaN(s)?".nan":s<0?"-.inf":".inf";let i=Object.is(r,-0)?"-0":JSON.stringify(r);if(!t&&e&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(i)&&!i.includes("e")){let o=i.indexOf(".");o<0&&(o=i.length,i+=".");let a=e-(i.length-o-1);for(;a-- >0;)i+="0"}return i}const Nc={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ut},Tc={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){const e=Number(t.value);return isFinite(e)?e.toExponential():ut(t)}},Pc={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){const e=new ce(parseFloat(t)),n=t.indexOf(".");return n!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-n-1),e},stringify:ut},as=t=>typeof t=="bigint"||Number.isInteger(t),ii=(t,e,n,{intAsBigInt:r})=>r?BigInt(t):parseInt(t.substring(e),n);function Cc(t,e,n){const{value:r}=t;return as(r)&&r>=0?n+r.toString(e):ut(t)}const xc={identify:t=>as(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,n)=>ii(t,2,8,n),stringify:t=>Cc(t,8,"0o")},Bc={identify:as,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,n)=>ii(t,0,10,n),stringify:ut},Dc={identify:t=>as(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,n)=>ii(t,2,16,n),stringify:t=>Cc(t,16,"0x")},qp=[dn,hn,is,os,si,xc,Bc,Dc,Nc,Tc,Pc];function Vi(t){return typeof t=="bigint"||Number.isInteger(t)}const Vn=({value:t})=>JSON.stringify(t),Zp=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:Vn},{identify:t=>t==null,createNode:()=>new ce(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Vn},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:Vn},{identify:Vi,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:n})=>n?BigInt(t):parseInt(t,10),stringify:({value:t})=>Vi(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:Vn}],Vp={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},Kp=[dn,hn].concat(Zp,Vp),oi={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof atob=="function"){const n=atob(t.replace(/[\n\r]/g,"")),r=new Uint8Array(n.length);for(let s=0;s<n.length;++s)r[s]=n.charCodeAt(s);return r}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:n},r,s,i){if(!n)return"";const o=n;let a;if(typeof btoa=="function"){let c="";for(let l=0;l<o.length;++l)c+=String.fromCharCode(o[l]);a=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=ce.BLOCK_LITERAL),e!==ce.QUOTE_DOUBLE){const c=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),l=Math.ceil(a.length/c),d=new Array(l);for(let p=0,h=0;p<l;++p,h+=c)d[p]=a.substr(h,c);a=d.join(e===ce.BLOCK_LITERAL?`
90
+ `:" ")}return ni({comment:t,type:e,value:a},r,s,i)}};function zc(t,e){if(Dn(t))for(let n=0;n<t.items.length;++n){let r=t.items[n];if(!je(r)){if(Bn(r)){r.items.length>1&&e("Each pair must have its own sequence indicator");const s=r.items[0]||new Ye(new ce(null));if(r.commentBefore&&(s.key.commentBefore=s.key.commentBefore?`${r.commentBefore}
91
+ ${s.key.commentBefore}`:r.commentBefore),r.comment){const i=s.value??s.key;i.comment=i.comment?`${r.comment}
92
+ ${i.comment}`:r.comment}r=s}t.items[n]=je(r)?r:new Ye(r)}}else e("Expected a sequence for this tag");return t}function Rc(t,e,n){const{replacer:r}=n,s=new Ft(t);s.tag="tag:yaml.org,2002:pairs";let i=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof r=="function"&&(o=r.call(e,String(i++),o));let a,c;if(Array.isArray(o))if(o.length===2)a=o[0],c=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const l=Object.keys(o);if(l.length===1)a=l[0],c=o[a];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=o;s.items.push(ri(a,c,n))}return s}const ai={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:zc,createNode:Rc};class en extends Ft{constructor(){super(),this.add=nt.prototype.add.bind(this),this.delete=nt.prototype.delete.bind(this),this.get=nt.prototype.get.bind(this),this.has=nt.prototype.has.bind(this),this.set=nt.prototype.set.bind(this),this.tag=en.tag}toJSON(e,n){if(!n)return super.toJSON(e);const r=new Map;n?.onCreate&&n.onCreate(r);for(const s of this.items){let i,o;if(je(s)?(i=rt(s.key,"",n),o=rt(s.value,i,n)):i=rt(s,"",n),r.has(i))throw new Error("Ordered maps must not include duplicate keys");r.set(i,o)}return r}static from(e,n,r){const s=Rc(e,n,r),i=new this;return i.items=s.items,i}}en.tag="tag:yaml.org,2002:omap";const ci={collection:"seq",identify:t=>t instanceof Map,nodeClass:en,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){const n=zc(t,e),r=[];for(const{key:s}of n.items)Se(s)&&(r.includes(s.value)?e(`Ordered maps must not include duplicate keys: ${s.value}`):r.push(s.value));return Object.assign(new en,n)},createNode:(t,e,n)=>en.from(t,e,n)};function jc({value:t,source:e},n){return e&&(t?Fc:Mc).test.test(e)?e:t?n.options.trueStr:n.options.falseStr}const Fc={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new ce(!0),stringify:jc},Mc={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new ce(!1),stringify:jc},Jp={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ut},Hp={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){const e=Number(t.value);return isFinite(e)?e.toExponential():ut(t)}},Gp={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){const e=new ce(parseFloat(t.replace(/_/g,""))),n=t.indexOf(".");if(n!==-1){const r=t.substring(n+1).replace(/_/g,"");r[r.length-1]==="0"&&(e.minFractionDigits=r.length)}return e},stringify:ut},zn=t=>typeof t=="bigint"||Number.isInteger(t);function cs(t,e,n,{intAsBigInt:r}){const s=t[0];if((s==="-"||s==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),r){switch(n){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}const o=BigInt(t);return s==="-"?BigInt(-1)*o:o}const i=parseInt(t,n);return s==="-"?-1*i:i}function ui(t,e,n){const{value:r}=t;if(zn(r)){const s=r.toString(e);return r<0?"-"+n+s.substr(1):n+s}return ut(t)}const Wp={identify:zn,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,n)=>cs(t,2,2,n),stringify:t=>ui(t,2,"0b")},Yp={identify:zn,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,n)=>cs(t,1,8,n),stringify:t=>ui(t,8,"0")},Xp={identify:zn,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,n)=>cs(t,0,10,n),stringify:ut},Qp={identify:zn,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,n)=>cs(t,2,16,n),stringify:t=>ui(t,16,"0x")};class tn extends nt{constructor(e){super(e),this.tag=tn.tag}add(e){let n;je(e)?n=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?n=new Ye(e.key,null):n=new Ye(e,null),Rt(this.items,n.key)||this.items.push(n)}get(e,n){const r=Rt(this.items,e);return!n&&je(r)?Se(r.key)?r.key.value:r.key:r}set(e,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const r=Rt(this.items,e);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new Ye(e))}toJSON(e,n){return super.toJSON(e,n,Set)}toString(e,n,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(e,n,r){const{replacer:s}=r,i=new this(e);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof s=="function"&&(o=s.call(n,o,o)),i.items.push(ri(o,null,r));return i}}tn.tag="tag:yaml.org,2002:set";const li={collection:"map",identify:t=>t instanceof Set,nodeClass:tn,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,n)=>tn.from(t,e,n),resolve(t,e){if(Bn(t)){if(t.hasAllNullValues(!0))return Object.assign(new tn,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};function fi(t,e){const n=t[0],r=n==="-"||n==="+"?t.substring(1):t,s=o=>e?BigInt(o):Number(o),i=r.replace(/_/g,"").split(":").reduce((o,a)=>o*s(60)+s(a),s(0));return n==="-"?s(-1)*i:i}function Uc(t){let{value:e}=t,n=o=>o;if(typeof e=="bigint")n=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return ut(t);let r="";e<0&&(r="-",e*=n(-1));const s=n(60),i=[e%s];return e<60?i.unshift(0):(e=(e-i[0])/s,i.unshift(e%s),e>=60&&(e=(e-i[0])/s,i.unshift(e))),r+i.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const Lc={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:n})=>fi(t,n),stringify:Uc},qc={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>fi(t,!1),stringify:Uc},us={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){const e=t.match(us.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,s,i,o,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0;let l=Date.UTC(n,r-1,s,i||0,o||0,a||0,c);const d=e[8];if(d&&d!=="Z"){let p=fi(d,!1);Math.abs(p)<30&&(p*=60),l-=6e4*p}return new Date(l)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},Ki=[dn,hn,is,os,Fc,Mc,Wp,Yp,Xp,Qp,Jp,Hp,Gp,oi,vt,ci,ai,li,Lc,qc,us],Ji=new Map([["core",qp],["failsafe",[dn,hn,is]],["json",Kp],["yaml11",Ki],["yaml-1.1",Ki]]),Hi={binary:oi,bool:si,float:Pc,floatExp:Tc,floatNaN:Nc,floatTime:qc,int:Bc,intHex:Dc,intOct:xc,intTime:Lc,map:dn,merge:vt,null:os,omap:ci,pairs:ai,seq:hn,set:li,timestamp:us},em={"tag:yaml.org,2002:binary":oi,"tag:yaml.org,2002:merge":vt,"tag:yaml.org,2002:omap":ci,"tag:yaml.org,2002:pairs":ai,"tag:yaml.org,2002:set":li,"tag:yaml.org,2002:timestamp":us};function gs(t,e,n){const r=Ji.get(e);if(r&&!t)return n&&!r.includes(vt)?r.concat(vt):r.slice();let s=r;if(!s)if(Array.isArray(t))s=[];else{const i=Array.from(Ji.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${i} or define customTags array`)}if(Array.isArray(t))for(const i of t)s=s.concat(i);else typeof t=="function"&&(s=t(s.slice()));return n&&(s=s.concat(vt)),s.reduce((i,o)=>{const a=typeof o=="string"?Hi[o]:o;if(!a){const c=JSON.stringify(o),l=Object.keys(Hi).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return i.includes(a)||i.push(a),i},[])}const tm=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0;class di{constructor({compat:e,customTags:n,merge:r,resolveKnownTags:s,schema:i,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?gs(e,"compat"):e?gs(null,e):null,this.name=typeof i=="string"&&i||"core",this.knownTags=s?em:{},this.tags=gs(n,this.name,r),this.toStringOptions=a??null,Object.defineProperty(this,Et,{value:dn}),Object.defineProperty(this,ht,{value:is}),Object.defineProperty(this,un,{value:hn}),this.sortMapEntries=typeof o=="function"?o:o===!0?tm:null}clone(){const e=Object.create(di.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}function nm(t,e){const n=[];let r=e.directives===!0;if(e.directives!==!1&&t.directives){const c=t.directives.toString(t);c?(n.push(c),r=!0):t.directives.docStart&&(r=!0)}r&&n.push("---");const s=Sc(t,e),{commentString:i}=s.options;if(t.commentBefore){n.length!==1&&n.unshift("");const c=i(t.commentBefore);n.unshift(wt(c,""))}let o=!1,a=null;if(t.contents){if(Re(t.contents)){if(t.contents.spaceBefore&&r&&n.push(""),t.contents.commentBefore){const d=i(t.contents.commentBefore);n.push(wt(d,""))}s.forceBlockIndent=!!t.comment,a=t.contents.comment}const c=a?void 0:()=>o=!0;let l=sn(t.contents,s,()=>a=null,c);a&&(l+=zt(l,"",i(a))),(l[0]==="|"||l[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${l}`:n.push(l)}else n.push(sn(t.contents,s));if(t.directives?.docEnd)if(t.comment){const c=i(t.comment);c.includes(`
93
+ `)?(n.push("..."),n.push(wt(c,""))):n.push(`... ${c}`)}else n.push("...");else{let c=t.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||a)&&n[n.length-1]!==""&&n.push(""),n.push(wt(i(c),"")))}return n.join(`
94
+ `)+`
95
+ `}class ls{constructor(e,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,st,{value:Fs});let s=null;typeof n=="function"||Array.isArray(n)?s=n:r===void 0&&n&&(r=n,n=void 0);const i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=i;let{version:o}=i;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new We({version:o}),this.setSchema(o,r),this.contents=e===void 0?null:this.createNode(e,s,r)}clone(){const e=Object.create(ls.prototype,{[st]:{value:Fs}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=Re(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Lt(this.contents)&&this.contents.add(e)}addIn(e,n){Lt(this.contents)&&this.contents.addIn(e,n)}createAlias(e,n){if(!e.anchor){const r=wc(this);e.anchor=!n||r.has(n)?vc(n||"a",r):n}return new ti(e.anchor)}createNode(e,n,r){let s;if(typeof n=="function")e=n.call({"":e},"",e),s=n;else if(Array.isArray(n)){const g=y=>typeof y=="number"||y instanceof String||y instanceof Number,$=n.filter(g).map(String);$.length>0&&(n=n.concat($)),s=n}else r===void 0&&n&&(r=n,n=void 0);const{aliasDuplicateObjects:i,anchorPrefix:o,flow:a,keepUndefined:c,onTagObj:l,tag:d}=r??{},{onAnchor:p,setAnchors:h,sourceObjects:m}=Tp(this,o||"a"),b={aliasDuplicateObjects:i??!0,keepUndefined:c??!1,onAnchor:p,onTagObj:l,replacer:s,schema:this.schema,sourceObjects:m},w=Cn(e,d,b);return a&&Be(w)&&(w.flow=!0),h(),w}createPair(e,n,r={}){const s=this.createNode(e,null,r),i=this.createNode(n,null,r);return new Ye(s,i)}delete(e){return Lt(this.contents)?this.contents.delete(e):!1}deleteIn(e){return In(e)?this.contents==null?!1:(this.contents=null,!0):Lt(this.contents)?this.contents.deleteIn(e):!1}get(e,n){return Be(this.contents)?this.contents.get(e,n):void 0}getIn(e,n){return In(e)?!n&&Se(this.contents)?this.contents.value:this.contents:Be(this.contents)?this.contents.getIn(e,n):void 0}has(e){return Be(this.contents)?this.contents.has(e):!1}hasIn(e){return In(e)?this.contents!==void 0:Be(this.contents)?this.contents.hasIn(e):!1}set(e,n){this.contents==null?this.contents=Vr(this.schema,[e],n):Lt(this.contents)&&this.contents.set(e,n)}setIn(e,n){In(e)?this.contents=n:this.contents==null?this.contents=Vr(this.schema,Array.from(e),n):Lt(this.contents)&&this.contents.setIn(e,n)}setSchema(e,n={}){typeof e=="number"&&(e=String(e));let r;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new We({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new We({version:e}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{const s=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${s}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(r)this.schema=new di(Object.assign(r,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:n,mapAsMap:r,maxAliasCount:s,onAnchor:i,reviver:o}={}){const a={anchors:new Map,doc:this,keep:!e,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},c=rt(this.contents,n??"",a);if(typeof i=="function")for(const{count:l,res:d}of a.anchors.values())i(d,l);return typeof o=="function"?Wt(o,{"":c},"",c):c}toJSON(e,n){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:n})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){const n=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return nm(this,e)}}function Lt(t){if(Be(t))return!0;throw new Error("Expected a YAML collection as document contents")}class Zc extends Error{constructor(e,n,r,s){super(),this.name=e,this.code=r,this.message=s,this.pos=n}}class An extends Zc{constructor(e,n,r){super("YAMLParseError",e,n,r)}}class rm extends Zc{constructor(e,n,r){super("YAMLWarning",e,n,r)}}const Gi=(t,e)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(a=>e.linePos(a));const{line:r,col:s}=n.linePos[0];n.message+=` at line ${r}, column ${s}`;let i=s-1,o=t.substring(e.lineStarts[r-1],e.lineStarts[r]).replace(/[\n\r]+$/,"");if(i>=60&&o.length>80){const a=Math.min(i-39,o.length-79);o="…"+o.substring(a),i-=a-1}if(o.length>80&&(o=o.substring(0,79)+"…"),r>1&&/^ *$/.test(o.substring(0,i))){let a=t.substring(e.lineStarts[r-2],e.lineStarts[r-1]);a.length>80&&(a=a.substring(0,79)+`…
96
+ `),o=a+o}if(/[^ ]/.test(o)){let a=1;const c=n.linePos[1];c?.line===r&&c.col>s&&(a=Math.max(1,Math.min(c.col-s,80-i)));const l=" ".repeat(i)+"^".repeat(a);n.message+=`:
97
+
98
+ ${o}
99
+ ${l}
100
+ `}};function on(t,{flow:e,indicator:n,next:r,offset:s,onError:i,parentIndent:o,startOnNewline:a}){let c=!1,l=a,d=a,p="",h="",m=!1,b=!1,w=null,g=null,$=null,y=null,_=null,I=null,v=null;for(const T of t)switch(b&&(T.type!=="space"&&T.type!=="newline"&&T.type!=="comma"&&i(T.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),b=!1),w&&(l&&T.type!=="comment"&&T.type!=="newline"&&i(w,"TAB_AS_INDENT","Tabs are not allowed as indentation"),w=null),T.type){case"space":!e&&(n!=="doc-start"||r?.type!=="flow-collection")&&T.source.includes(" ")&&(w=T),d=!0;break;case"comment":{d||i(T,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const L=T.source.substring(1)||" ";p?p+=h+L:p=L,h="",l=!1;break}case"newline":l?p?p+=T.source:(!I||n!=="seq-item-ind")&&(c=!0):h+=T.source,l=!0,m=!0,(g||$)&&(y=T),d=!0;break;case"anchor":g&&i(T,"MULTIPLE_ANCHORS","A node can have at most one anchor"),T.source.endsWith(":")&&i(T.offset+T.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=T,v??(v=T.offset),l=!1,d=!1,b=!0;break;case"tag":{$&&i(T,"MULTIPLE_TAGS","A node can have at most one tag"),$=T,v??(v=T.offset),l=!1,d=!1,b=!0;break}case n:(g||$)&&i(T,"BAD_PROP_ORDER",`Anchors and tags must be after the ${T.source} indicator`),I&&i(T,"UNEXPECTED_TOKEN",`Unexpected ${T.source} in ${e??"collection"}`),I=T,l=n==="seq-item-ind"||n==="explicit-key-ind",d=!1;break;case"comma":if(e){_&&i(T,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),_=T,l=!1,d=!1;break}default:i(T,"UNEXPECTED_TOKEN",`Unexpected ${T.type} token`),l=!1,d=!1}const k=t[t.length-1],O=k?k.offset+k.source.length:s;return b&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&i(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),w&&(l&&w.indent<=o||r?.type==="block-map"||r?.type==="block-seq")&&i(w,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:_,found:I,spaceBefore:c,comment:p,hasNewline:m,anchor:g,tag:$,newlineAfterProp:y,end:O,start:v??O}}function xn(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(`
101
+ `))return!0;if(t.end){for(const e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(const e of t.items){for(const n of e.start)if(n.type==="newline")return!0;if(e.sep){for(const n of e.sep)if(n.type==="newline")return!0}if(xn(e.key)||xn(e.value))return!0}return!1;default:return!0}}function qs(t,e,n){if(e?.type==="flow-collection"){const r=e.end[0];r.indent===t&&(r.source==="]"||r.source==="}")&&xn(e)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function Vc(t,e,n){const{uniqueKeys:r}=t.options;if(r===!1)return!1;const s=typeof r=="function"?r:(i,o)=>i===o||Se(i)&&Se(o)&&i.value===o.value;return e.some(i=>s(i.key,n))}const Wi="All mapping items must start at the same column";function sm({composeNode:t,composeEmptyNode:e},n,r,s,i){const o=i?.nodeClass??nt,a=new o(n.schema);n.atRoot&&(n.atRoot=!1);let c=r.offset,l=null;for(const d of r.items){const{start:p,key:h,sep:m,value:b}=d,w=on(p,{indicator:"explicit-key-ind",next:h??m?.[0],offset:c,onError:s,parentIndent:r.indent,startOnNewline:!0}),g=!w.found;if(g){if(h&&(h.type==="block-seq"?s(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in h&&h.indent!==r.indent&&s(c,"BAD_INDENT",Wi)),!w.anchor&&!w.tag&&!m){l=w.end,w.comment&&(a.comment?a.comment+=`
102
+ `+w.comment:a.comment=w.comment);continue}(w.newlineAfterProp||xn(h))&&s(h??p[p.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else w.found?.indent!==r.indent&&s(c,"BAD_INDENT",Wi);n.atKey=!0;const $=w.end,y=h?t(n,h,w,s):e(n,$,p,null,w,s);n.schema.compat&&qs(r.indent,h,s),n.atKey=!1,Vc(n,a.items,y)&&s($,"DUPLICATE_KEY","Map keys must be unique");const _=on(m??[],{indicator:"map-value-ind",next:b,offset:y.range[2],onError:s,parentIndent:r.indent,startOnNewline:!h||h.type==="block-scalar"});if(c=_.end,_.found){g&&(b?.type==="block-map"&&!_.hasNewline&&s(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&w.start<_.found.offset-1024&&s(y.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const I=b?t(n,b,_,s):e(n,c,m,null,_,s);n.schema.compat&&qs(r.indent,b,s),c=I.range[2];const v=new Ye(y,I);n.options.keepSourceTokens&&(v.srcToken=d),a.items.push(v)}else{g&&s(y.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),_.comment&&(y.comment?y.comment+=`
103
+ `+_.comment:y.comment=_.comment);const I=new Ye(y);n.options.keepSourceTokens&&(I.srcToken=d),a.items.push(I)}}return l&&l<c&&s(l,"IMPOSSIBLE","Map comment with trailing content"),a.range=[r.offset,c,l??c],a}function im({composeNode:t,composeEmptyNode:e},n,r,s,i){const o=i?.nodeClass??Ft,a=new o(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let c=r.offset,l=null;for(const{start:d,value:p}of r.items){const h=on(d,{indicator:"seq-item-ind",next:p,offset:c,onError:s,parentIndent:r.indent,startOnNewline:!0});if(!h.found)if(h.anchor||h.tag||p)p?.type==="block-seq"?s(h.end,"BAD_INDENT","All sequence items must start at the same column"):s(c,"MISSING_CHAR","Sequence item without - indicator");else{l=h.end,h.comment&&(a.comment=h.comment);continue}const m=p?t(n,p,h,s):e(n,h.end,d,null,h,s);n.schema.compat&&qs(r.indent,p,s),c=m.range[2],a.items.push(m)}return a.range=[r.offset,c,l??c],a}function Rn(t,e,n,r){let s="";if(t){let i=!1,o="";for(const a of t){const{source:c,type:l}=a;switch(l){case"space":i=!0;break;case"comment":{n&&!i&&r(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const d=c.substring(1)||" ";s?s+=o+d:s=d,o="";break}case"newline":s&&(o+=c),i=!0;break;default:r(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:s,offset:e}}const ys="Block collections are not allowed within flow collections",ws=t=>t&&(t.type==="block-map"||t.type==="block-seq");function om({composeNode:t,composeEmptyNode:e},n,r,s,i){const o=r.start.source==="{",a=o?"flow map":"flow sequence",c=i?.nodeClass??(o?nt:Ft),l=new c(n.schema);l.flow=!0;const d=n.atRoot;d&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let p=r.offset+r.start.source.length;for(let g=0;g<r.items.length;++g){const $=r.items[g],{start:y,key:_,sep:I,value:v}=$,k=on(y,{flow:a,indicator:"explicit-key-ind",next:_??I?.[0],offset:p,onError:s,parentIndent:r.indent,startOnNewline:!1});if(!k.found){if(!k.anchor&&!k.tag&&!I&&!v){g===0&&k.comma?s(k.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):g<r.items.length-1&&s(k.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),k.comment&&(l.comment?l.comment+=`
104
+ `+k.comment:l.comment=k.comment),p=k.end;continue}!o&&n.options.strict&&xn(_)&&s(_,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(g===0)k.comma&&s(k.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(k.comma||s(k.start,"MISSING_CHAR",`Missing , between ${a} items`),k.comment){let O="";e:for(const T of y)switch(T.type){case"comma":case"space":break;case"comment":O=T.source.substring(1);break e;default:break e}if(O){let T=l.items[l.items.length-1];je(T)&&(T=T.value??T.key),T.comment?T.comment+=`
105
+ `+O:T.comment=O,k.comment=k.comment.substring(O.length+1)}}if(!o&&!I&&!k.found){const O=v?t(n,v,k,s):e(n,k.end,I,null,k,s);l.items.push(O),p=O.range[2],ws(v)&&s(O.range,"BLOCK_IN_FLOW",ys)}else{n.atKey=!0;const O=k.end,T=_?t(n,_,k,s):e(n,O,y,null,k,s);ws(_)&&s(T.range,"BLOCK_IN_FLOW",ys),n.atKey=!1;const L=on(I??[],{flow:a,indicator:"map-value-ind",next:v,offset:T.range[2],onError:s,parentIndent:r.indent,startOnNewline:!1});if(L.found){if(!o&&!k.found&&n.options.strict){if(I)for(const Y of I){if(Y===L.found)break;if(Y.type==="newline"){s(Y,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}k.start<L.found.offset-1024&&s(L.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else v&&("source"in v&&v.source?.[0]===":"?s(v,"MISSING_CHAR",`Missing space after : in ${a}`):s(L.start,"MISSING_CHAR",`Missing , or : between ${a} items`));const H=v?t(n,v,L,s):L.found?e(n,L.end,I,null,L,s):null;H?ws(v)&&s(H.range,"BLOCK_IN_FLOW",ys):L.comment&&(T.comment?T.comment+=`
106
+ `+L.comment:T.comment=L.comment);const G=new Ye(T,H);if(n.options.keepSourceTokens&&(G.srcToken=$),o){const Y=l;Vc(n,Y.items,T)&&s(O,"DUPLICATE_KEY","Map keys must be unique"),Y.items.push(G)}else{const Y=new nt(n.schema);Y.flow=!0,Y.items.push(G);const se=(H??T).range;Y.range=[T.range[0],se[1],se[2]],l.items.push(Y)}p=H?H.range[2]:L.end}}const h=o?"}":"]",[m,...b]=r.end;let w=p;if(m?.source===h)w=m.offset+m.source.length;else{const g=a[0].toUpperCase()+a.substring(1),$=d?`${g} must end with a ${h}`:`${g} in block collection must be sufficiently indented and end with a ${h}`;s(p,d?"MISSING_CHAR":"BAD_INDENT",$),m&&m.source.length!==1&&b.unshift(m)}if(b.length>0){const g=Rn(b,w,n.options.strict,s);g.comment&&(l.comment?l.comment+=`
107
+ `+g.comment:l.comment=g.comment),l.range=[r.offset,w,g.offset]}else l.range=[r.offset,w,w];return l}function vs(t,e,n,r,s,i){const o=n.type==="block-map"?sm(t,e,n,r,i):n.type==="block-seq"?im(t,e,n,r,i):om(t,e,n,r,i),a=o.constructor;return s==="!"||s===a.tagName?(o.tag=a.tagName,o):(s&&(o.tag=s),o)}function am(t,e,n,r,s){const i=r.tag,o=i?e.directives.tagName(i.source,h=>s(i,"TAG_RESOLVE_FAILED",h)):null;if(n.type==="block-seq"){const{anchor:h,newlineAfterProp:m}=r,b=h&&i?h.offset>i.offset?h:i:h??i;b&&(!m||m.offset<b.offset)&&s(b,"MISSING_CHAR","Missing newline after block sequence props")}const a=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!i||!o||o==="!"||o===nt.tagName&&a==="map"||o===Ft.tagName&&a==="seq")return vs(t,e,n,s,o);let c=e.schema.tags.find(h=>h.tag===o&&h.collection===a);if(!c){const h=e.schema.knownTags[o];if(h?.collection===a)e.schema.tags.push(Object.assign({},h,{default:!1})),c=h;else return h?s(i,"BAD_COLLECTION_TYPE",`${h.tag} used for ${a} collection, but expects ${h.collection??"scalar"}`,!0):s(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),vs(t,e,n,s,o)}const l=vs(t,e,n,s,o,c),d=c.resolve?.(l,h=>s(i,"TAG_RESOLVE_FAILED",h),e.options)??l,p=Re(d)?d:new ce(d);return p.range=l.range,p.tag=o,c?.format&&(p.format=c.format),p}function cm(t,e,n){const r=e.offset,s=um(e,t.options.strict,n);if(!s)return{value:"",type:null,comment:"",range:[r,r,r]};const i=s.mode===">"?ce.BLOCK_FOLDED:ce.BLOCK_LITERAL,o=e.source?lm(e.source):[];let a=o.length;for(let w=o.length-1;w>=0;--w){const g=o[w][1];if(g===""||g==="\r")a=w;else break}if(a===0){const w=s.chomp==="+"&&o.length>0?`
108
+ `.repeat(Math.max(1,o.length-1)):"";let g=r+s.length;return e.source&&(g+=e.source.length),{value:w,type:i,comment:s.comment,range:[r,g,g]}}let c=e.indent+s.indent,l=e.offset+s.length,d=0;for(let w=0;w<a;++w){const[g,$]=o[w];if($===""||$==="\r")s.indent===0&&g.length>c&&(c=g.length);else{g.length<c&&n(l+g.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),s.indent===0&&(c=g.length),d=w,c===0&&!t.atRoot&&n(l,"BAD_INDENT","Block scalar values in collections must be indented");break}l+=g.length+$.length+1}for(let w=o.length-1;w>=a;--w)o[w][0].length>c&&(a=w+1);let p="",h="",m=!1;for(let w=0;w<d;++w)p+=o[w][0].slice(c)+`
109
+ `;for(let w=d;w<a;++w){let[g,$]=o[w];l+=g.length+$.length+1;const y=$[$.length-1]==="\r";if(y&&($=$.slice(0,-1)),$&&g.length<c){const I=`Block scalar lines must not be less indented than their ${s.indent?"explicit indentation indicator":"first line"}`;n(l-$.length-(y?2:1),"BAD_INDENT",I),g=""}i===ce.BLOCK_LITERAL?(p+=h+g.slice(c)+$,h=`
110
+ `):g.length>c||$[0]===" "?(h===" "?h=`
111
+ `:!m&&h===`
112
+ `&&(h=`
113
+
114
+ `),p+=h+g.slice(c)+$,h=`
115
+ `,m=!0):$===""?h===`
116
+ `?p+=`
117
+ `:h=`
118
+ `:(p+=h+$,h=" ",m=!1)}switch(s.chomp){case"-":break;case"+":for(let w=a;w<o.length;++w)p+=`
119
+ `+o[w][0].slice(c);p[p.length-1]!==`
120
+ `&&(p+=`
121
+ `);break;default:p+=`
122
+ `}const b=r+s.length+e.source.length;return{value:p,type:i,comment:s.comment,range:[r,b,b]}}function um({offset:t,props:e},n,r){if(e[0].type!=="block-scalar-header")return r(e[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:s}=e[0],i=s[0];let o=0,a="",c=-1;for(let h=1;h<s.length;++h){const m=s[h];if(!a&&(m==="-"||m==="+"))a=m;else{const b=Number(m);!o&&b?o=b:c===-1&&(c=t+h)}}c!==-1&&r(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${s}`);let l=!1,d="",p=s.length;for(let h=1;h<e.length;++h){const m=e[h];switch(m.type){case"space":l=!0;case"newline":p+=m.source.length;break;case"comment":n&&!l&&r(m,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),p+=m.source.length,d=m.source.substring(1);break;case"error":r(m,"UNEXPECTED_TOKEN",m.message),p+=m.source.length;break;default:{const b=`Unexpected token in block scalar header: ${m.type}`;r(m,"UNEXPECTED_TOKEN",b);const w=m.source;w&&typeof w=="string"&&(p+=w.length)}}}return{mode:i,indent:o,chomp:a,comment:d,length:p}}function lm(t){const e=t.split(/\n( *)/),n=e[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let o=1;o<e.length;o+=2)i.push([e[o],e[o+1]]);return i}function fm(t,e,n){const{offset:r,type:s,source:i,end:o}=t;let a,c;const l=(h,m,b)=>n(r+h,m,b);switch(s){case"scalar":a=ce.PLAIN,c=dm(i,l);break;case"single-quoted-scalar":a=ce.QUOTE_SINGLE,c=hm(i,l);break;case"double-quoted-scalar":a=ce.QUOTE_DOUBLE,c=pm(i,l);break;default:return n(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${s}`),{value:"",type:null,comment:"",range:[r,r+i.length,r+i.length]}}const d=r+i.length,p=Rn(o,d,e,n);return{value:c,type:a,comment:p.comment,range:[r,d,p.offset]}}function dm(t,e){let n="";switch(t[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${t[0]}`;break}case"@":case"`":{n=`reserved character ${t[0]}`;break}}return n&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),Kc(t)}function hm(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),Kc(t.slice(1,-1)).replace(/''/g,"'")}function Kc(t){let e,n;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
123
+ `,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
124
+ `,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=e.exec(t);if(!r)return t;let s=r[1],i=" ",o=e.lastIndex;for(n.lastIndex=o;r=n.exec(t);)r[1]===""?i===`
125
+ `?s+=i:i=`
126
+ `:(s+=i+r[1],i=" "),o=n.lastIndex;const a=/[ \t]*(.*)/sy;return a.lastIndex=o,r=a.exec(t),s+i+(r?.[1]??"")}function pm(t,e){let n="";for(let r=1;r<t.length-1;++r){const s=t[r];if(!(s==="\r"&&t[r+1]===`
127
+ `))if(s===`
128
+ `){const{fold:i,offset:o}=mm(t,r);n+=i,r=o}else if(s==="\\"){let i=t[++r];const o=gm[i];if(o)n+=o;else if(i===`
129
+ `)for(i=t[r+1];i===" "||i===" ";)i=t[++r+1];else if(i==="\r"&&t[r+1]===`
130
+ `)for(i=t[++r+1];i===" "||i===" ";)i=t[++r+1];else if(i==="x"||i==="u"||i==="U"){const a=i==="x"?2:i==="u"?4:8;n+=ym(t,r+1,a,e),r+=a}else{const a=t.substr(r-1,2);e(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),n+=a}}else if(s===" "||s===" "){const i=r;let o=t[r+1];for(;o===" "||o===" ";)o=t[++r+1];o!==`
131
+ `&&!(o==="\r"&&t[r+2]===`
132
+ `)&&(n+=r>i?t.slice(i,r+1):s)}else n+=s}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),n}function mm(t,e){let n="",r=t[e+1];for(;(r===" "||r===" "||r===`
133
+ `||r==="\r")&&!(r==="\r"&&t[e+2]!==`
134
+ `);)r===`
135
+ `&&(n+=`
136
+ `),e+=1,r=t[e+1];return n||(n=" "),{fold:n,offset:e}}const gm={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
137
+ `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function ym(t,e,n,r){const s=t.substr(e,n),o=s.length===n&&/^[0-9a-fA-F]+$/.test(s)?parseInt(s,16):NaN;try{return String.fromCodePoint(o)}catch{const a=t.substr(e-2,n+2);return r(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}function Jc(t,e,n,r){const{value:s,type:i,comment:o,range:a}=e.type==="block-scalar"?cm(t,e,r):fm(e,t.options.strict,r),c=n?t.directives.tagName(n.source,p=>r(n,"TAG_RESOLVE_FAILED",p)):null;let l;t.options.stringKeys&&t.atKey?l=t.schema[ht]:c?l=wm(t.schema,s,c,n,r):e.type==="scalar"?l=vm(t,s,e,r):l=t.schema[ht];let d;try{const p=l.resolve(s,h=>r(n??e,"TAG_RESOLVE_FAILED",h),t.options);d=Se(p)?p:new ce(p)}catch(p){const h=p instanceof Error?p.message:String(p);r(n??e,"TAG_RESOLVE_FAILED",h),d=new ce(s)}return d.range=a,d.source=s,i&&(d.type=i),c&&(d.tag=c),l.format&&(d.format=l.format),o&&(d.comment=o),d}function wm(t,e,n,r,s){if(n==="!")return t[ht];const i=[];for(const a of t.tags)if(!a.collection&&a.tag===n)if(a.default&&a.test)i.push(a);else return a;for(const a of i)if(a.test?.test(e))return a;const o=t.knownTags[n];return o&&!o.collection?(t.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(s(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),t[ht])}function vm({atKey:t,directives:e,schema:n},r,s,i){const o=n.tags.find(a=>(a.default===!0||t&&a.default==="key")&&a.test?.test(r))||n[ht];if(n.compat){const a=n.compat.find(c=>c.default&&c.test?.test(r))??n[ht];if(o.tag!==a.tag){const c=e.tagString(o.tag),l=e.tagString(a.tag),d=`Value may be parsed as either ${c} or ${l}`;i(s,"TAG_RESOLVE_FAILED",d,!0)}}return o}function bm(t,e,n){if(e){n??(n=e.length);for(let r=n-1;r>=0;--r){let s=e[r];switch(s.type){case"space":case"comment":case"newline":t-=s.source.length;continue}for(s=e[++r];s?.type==="space";)t+=s.source.length,s=e[++r];break}}return t}const _m={composeNode:Hc,composeEmptyNode:hi};function Hc(t,e,n,r){const s=t.atKey,{spaceBefore:i,comment:o,anchor:a,tag:c}=n;let l,d=!0;switch(e.type){case"alias":l=$m(t,e,r),(a||c)&&r(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=Jc(t,e,c,r),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=am(_m,t,e,n,r),a&&(l.anchor=a.source.substring(1))}catch(p){const h=p instanceof Error?p.message:String(p);r(e,"RESOURCE_EXHAUSTION",h)}break;default:{const p=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;r(e,"UNEXPECTED_TOKEN",p),d=!1}}return l??(l=hi(t,e.offset,void 0,null,n,r)),a&&l.anchor===""&&r(a,"BAD_ALIAS","Anchor cannot be an empty string"),s&&t.options.stringKeys&&(!Se(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&r(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),i&&(l.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?l.comment=o:l.commentBefore=o),t.options.keepSourceTokens&&d&&(l.srcToken=e),l}function hi(t,e,n,r,{spaceBefore:s,comment:i,anchor:o,tag:a,end:c},l){const d={type:"scalar",offset:bm(e,n,r),indent:-1,source:""},p=Jc(t,d,a,l);return o&&(p.anchor=o.source.substring(1),p.anchor===""&&l(o,"BAD_ALIAS","Anchor cannot be an empty string")),s&&(p.spaceBefore=!0),i&&(p.comment=i,p.range[2]=c),p}function $m({options:t},{offset:e,source:n,end:r},s){const i=new ti(n.substring(1));i.source===""&&s(e,"BAD_ALIAS","Alias cannot be an empty string"),i.source.endsWith(":")&&s(e+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const o=e+n.length,a=Rn(r,o,t.strict,s);return i.range=[e,o,a.offset],a.comment&&(i.comment=a.comment),i}function Sm(t,e,{offset:n,start:r,value:s,end:i},o){const a=Object.assign({_directives:e},t),c=new ls(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},d=on(r,{indicator:"doc-start",next:s??i?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});d.found&&(c.directives.docStart=!0,s&&(s.type==="block-map"||s.type==="block-seq")&&!d.hasNewline&&o(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=s?Hc(l,s,d,o):hi(l,d.end,r,null,d,o);const p=c.contents.range[2],h=Rn(i,p,!1,o);return h.comment&&(c.comment=h.comment),c.range=[n,p,h.offset],c}function yn(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];const{offset:e,source:n}=t;return[e,e+(typeof n=="string"?n.length:1)]}function Yi(t){let e="",n=!1,r=!1;for(let s=0;s<t.length;++s){const i=t[s];switch(i[0]){case"#":e+=(e===""?"":r?`
138
+
139
+ `:`
140
+ `)+(i.substring(1)||" "),n=!0,r=!1;break;case"%":t[s+1]?.[0]!=="#"&&(s+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:e,afterEmptyLine:r}}class Em{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,s,i)=>{const o=yn(n);i?this.warnings.push(new rm(o,r,s)):this.errors.push(new An(o,r,s))},this.directives=new We({version:e.version||"1.2"}),this.options=e}decorate(e,n){const{comment:r,afterEmptyLine:s}=Yi(this.prelude);if(r){const i=e.contents;if(n)e.comment=e.comment?`${e.comment}
141
+ ${r}`:r;else if(s||e.directives.docStart||!i)e.commentBefore=r;else if(Be(i)&&!i.flow&&i.items.length>0){let o=i.items[0];je(o)&&(o=o.key);const a=o.commentBefore;o.commentBefore=a?`${r}
142
+ ${a}`:r}else{const o=i.commentBefore;i.commentBefore=o?`${r}
143
+ ${o}`:r}}if(n){for(let i=0;i<this.errors.length;++i)e.errors.push(this.errors[i]);for(let i=0;i<this.warnings.length;++i)e.warnings.push(this.warnings[i])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Yi(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,n=!1,r=-1){for(const s of e)yield*this.next(s);yield*this.end(n,r)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(n,r,s)=>{const i=yn(e);i[0]+=n,this.onError(i,"BAD_DIRECTIVE",r,s)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{const n=Sm(this.options,this.directives,e,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{const n=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,r=new An(yn(e),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){const r="Unexpected doc-end without preceding document";this.errors.push(new An(yn(e),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=Rn(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const r=this.doc.comment;this.doc.comment=r?`${r}
144
+ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new An(yn(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){const r=Object.assign({_directives:this.directives},this.options),s=new ls(void 0,r);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),s.range=[0,n,n],this.decorate(s,!1),yield s}}}const Gc="\uFEFF",Wc="",Yc="",Zs="";function km(t){switch(t){case Gc:return"byte-order-mark";case Wc:return"doc-mode";case Yc:return"flow-error-end";case Zs:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
145
+ `:case`\r
146
+ `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function ot(t){switch(t){case void 0:case" ":case`
147
+ `:case"\r":case" ":return!0;default:return!1}}const Xi=new Set("0123456789ABCDEFabcdef"),Im=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Kn=new Set(",[]{}"),Am=new Set(` ,[]{}
148
+ \r `),bs=t=>!t||Am.has(t);class Om{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,n=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!n;let r=this.next??"stream";for(;r&&(n||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let e=this.pos,n=this.buffer[e];for(;n===" "||n===" ";)n=this.buffer[++e];return!n||n==="#"||n===`
149
+ `?!0:n==="\r"?this.buffer[e+1]===`
150
+ `:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let n=this.buffer[e];if(this.indentNext>0){let r=0;for(;n===" ";)n=this.buffer[++r+e];if(n==="\r"){const s=this.buffer[r+e+1];if(s===`
151
+ `||!s&&!this.atEnd)return e+r+1}return n===`
152
+ `||r>=this.indentNext||!n&&!this.atEnd?e+r:-1}if(n==="-"||n==="."){const r=this.buffer.substr(e,3);if((r==="---"||r==="...")&&ot(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
153
+ `,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===Gc&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let n=e.length,r=e.indexOf("#");for(;r!==-1;){const i=e[r-1];if(i===" "||i===" "){n=r-1;break}else r=e.indexOf("#",r+1)}for(;;){const i=e[n-1];if(i===" "||i===" ")n-=1;else break}const s=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-s),this.pushNewline(),"stream"}if(this.atLineEnd()){const n=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-n),yield*this.pushNewline(),"stream"}return yield Wc,yield*this.parseLineStart()}*parseLineStart(){const e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const n=this.peek(3);if((n==="---"||n==="...")&&ot(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,n==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!ot(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[e,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&ot(n)){const r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const e=this.getLine();if(e===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(e[n]){case"#":yield*this.pushCount(e.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(bs),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,n,r=-1;do e=yield*this.pushNewline(),e>0?(n=yield*this.pushSpaces(!1),this.indentValue=r=n):n=0,n+=yield*this.pushSpaces(!0);while(e+n>0);const s=this.getLine();if(s===null)return this.setNext("flow");if((r!==-1&&r<this.indentNext&&s[0]!=="#"||r===0&&(s.startsWith("---")||s.startsWith("..."))&&ot(s[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(s[0]==="]"||s[0]==="}")))return this.flowLevel=0,yield Yc,yield*this.parseLineStart();let i=0;for(;s[i]===",";)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),s[i]){case void 0:return"flow";case"#":return yield*this.pushCount(s.length-i),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(bs),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const o=this.charAt(1);if(this.flowKey||ot(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const e=this.charAt(0);let n=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let i=0;for(;this.buffer[n-1-i]==="\\";)i+=1;if(i%2===0)break;n=this.buffer.indexOf('"',n+1)}const r=this.buffer.substring(0,n);let s=r.indexOf(`
154
+ `,this.pos);if(s!==-1){for(;s!==-1;){const i=this.continueScalar(s+1);if(i===-1)break;s=r.indexOf(`
155
+ `,i)}s!==-1&&(n=s-(r[s-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){const n=this.buffer[++e];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>ot(n)||n==="#")}*parseBlockScalar(){let e=this.pos-1,n=0,r;e:for(let i=this.pos;r=this.buffer[i];++i)switch(r){case" ":n+=1;break;case`
156
+ `:e=i,n=0;break;case"\r":{const o=this.buffer[i+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
157
+ `)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const i=this.continueScalar(e+1);if(i===-1)break;e=this.buffer.indexOf(`
158
+ `,i)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let s=e+1;for(r=this.buffer[s];r===" ";)r=this.buffer[++s];if(r===" "){for(;r===" "||r===" "||r==="\r"||r===`
159
+ `;)r=this.buffer[++s];e=s-1}else if(!this.blockScalarKeep)do{let i=e-1,o=this.buffer[i];o==="\r"&&(o=this.buffer[--i]);const a=i;for(;o===" ";)o=this.buffer[--i];if(o===`
160
+ `&&i>=this.pos&&i+1+n>a)e=i;else break}while(!0);return yield Zs,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const e=this.flowLevel>0;let n=this.pos-1,r=this.pos-1,s;for(;s=this.buffer[++r];)if(s===":"){const i=this.buffer[r+1];if(ot(i)||e&&Kn.has(i))break;n=r}else if(ot(s)){let i=this.buffer[r+1];if(s==="\r"&&(i===`
161
+ `?(r+=1,s=`
162
+ `,i=this.buffer[r+1]):n=r),i==="#"||e&&Kn.has(i))break;if(s===`
163
+ `){const o=this.continueScalar(r+1);if(o===-1)break;r=Math.max(r,o-2)}}else{if(e&&Kn.has(s))break;n=r}return!s&&!this.atEnd?this.setNext("plain-scalar"):(yield Zs,yield*this.pushToIndex(n+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,n){const r=this.buffer.slice(this.pos,e);return r?(yield r,this.pos+=r.length,r.length):(n&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(bs),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const n=this.flowLevel>0,r=this.charAt(1);if(ot(r)||n&&Kn.has(r)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,n=this.buffer[e];for(;!ot(n)&&n!==">";)n=this.buffer[++e];return yield*this.pushToIndex(n===">"?e+1:e,!1)}else{let e=this.pos+1,n=this.buffer[e];for(;n;)if(Im.has(n))n=this.buffer[++e];else if(n==="%"&&Xi.has(this.buffer[e+1])&&Xi.has(this.buffer[e+2]))n=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){const e=this.buffer[this.pos];return e===`
164
+ `?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
165
+ `?yield*this.pushCount(2):0}*pushSpaces(e){let n=this.pos-1,r;do r=this.buffer[++n];while(r===" "||e&&r===" ");const s=n-this.pos;return s>0&&(yield this.buffer.substr(this.pos,s),this.pos=n),s}*pushUntil(e){let n=this.pos,r=this.buffer[n];for(;!e(r);)r=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class Nm{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let n=0,r=this.lineStarts.length;for(;n<r;){const i=n+r>>1;this.lineStarts[i]<e?n=i+1:r=i}if(this.lineStarts[n]===e)return{line:n+1,col:1};if(n===0)return{line:0,col:e};const s=this.lineStarts[n-1];return{line:n,col:e-s+1}}}}function St(t,e){for(let n=0;n<t.length;++n)if(t[n].type===e)return!0;return!1}function Qi(t){for(let e=0;e<t.length;++e)switch(t[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function Xc(t){switch(t?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Jn(t){switch(t.type){case"document":return t.start;case"block-map":{const e=t.items[t.items.length-1];return e.sep??e.start}case"block-seq":return t.items[t.items.length-1].start;default:return[]}}function qt(t){if(t.length===0)return[];let e=t.length;e:for(;--e>=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function Jr(t,e){if(e.length<1e5)Array.prototype.push.apply(t,e);else for(let n=0;n<e.length;++n)t.push(e[n])}function eo(t){if(t.start.type==="flow-seq-start")for(const e of t.items)e.sep&&!e.value&&!St(e.start,"explicit-key-ind")&&!St(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,Xc(e.value)?e.value.end?Jr(e.value.end,e.sep):e.value.end=e.sep:Jr(e.start,e.sep),delete e.sep)}class Tm{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new Om,this.onNewLine=e}*parse(e,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const r of this.lexer.lex(e,n))yield*this.next(r);n||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}const n=km(e);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{const r=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:r,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){const n=e??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{const r=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in r?r.indent:0:n.type==="flow-collection"&&r.type==="document"&&(n.indent=0),n.type==="flow-collection"&&eo(n),r.type){case"document":r.value=n;break;case"block-scalar":r.props.push(n);break;case"block-map":{const s=r.items[r.items.length-1];if(s.value){r.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(s.sep)s.value=n;else{Object.assign(s,{key:n,sep:[]}),this.onKeyLine=!s.explicitKey;return}break}case"block-seq":{const s=r.items[r.items.length-1];s.value?r.items.push({start:[],value:n}):s.value=n;break}case"flow-collection":{const s=r.items[r.items.length-1];!s||s.value?r.items.push({start:[],key:n,sep:[]}):s.sep?s.value=n:Object.assign(s,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){const s=n.items[n.items.length-1];s&&!s.sep&&!s.value&&s.start.length>0&&Qi(s.start)===-1&&(n.indent===0||s.start.every(i=>i.type!=="comment"||i.indent<n.indent))&&(r.type==="document"?r.end=s.start:r.items.push({start:s.start}),n.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{Qi(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}const n=this.startBlockValue(e);n?this.stack.push(n):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){const n=Jn(this.peek(2)),r=qt(n);let s;e.end?(s=e.end,s.push(this.sourceToken),delete e.end):s=[this.sourceToken];const i={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
166
+ `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
167
+ `,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){const n=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,e.indent)){const s=e.items[e.items.length-2]?.value?.end;if(Array.isArray(s)){Jr(s,n.start),s.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=e.indent){const r=!this.onKeyLine&&this.indent===e.indent,s=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let i=[];if(s&&n.sep&&!n.value){const o=[];for(let a=0;a<n.sep.length;++a){const c=n.sep[a];switch(c.type){case"newline":o.push(a);break;case"space":break;case"comment":c.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(i=n.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":s||n.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):s||n.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(St(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(Xc(n.key)&&!St(n.sep,"newline")){const o=qt(n.start),a=n.key,c=n.sep;c.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:c}]})}else i.length>0?n.sep=n.sep.concat(i,this.sourceToken):n.sep.push(this.sourceToken);else if(St(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const o=qt(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||s?e.items.push({start:i,key:null,sep:[this.sourceToken]}):St(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const o=this.flowScalar(this.type);s||n.value?(e.items.push({start:i,key:o,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(o):(Object.assign(n,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{const o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!n.explicitKey&&n.sep&&!St(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else r&&e.items.push({start:i});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){const n=e.items[e.items.length-1];switch(this.type){case"newline":if(n.value){const r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,e.indent)){const s=e.items[e.items.length-2]?.value?.end;if(Array.isArray(s)){Jr(s,n.start),s.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=e.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;n.value||St(n.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>e.indent){const r=this.startBlockValue(e);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){const n=e.items[e.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?e.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const s=this.flowScalar(this.type);!n||n.value?e.items.push({start:[],key:s,sep:[]}):n.sep?this.stack.push(s):Object.assign(n,{key:s,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}const r=this.startBlockValue(e);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{const r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===e.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){const s=Jn(r),i=qt(s);eo(e);const o=e.end.splice(1,e.end.length);o.push(this.sourceToken);const a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:i,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let n=this.source.indexOf(`
168
+ `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
169
+ `,n)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=Jn(e),r=qt(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=Jn(e),r=qt(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,n){return this.type!=="comment"||this.indent<=n?!1:e.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function Pm(t){const e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new Nm||null,prettyErrors:e}}function Cm(t,e={}){const{lineCounter:n,prettyErrors:r}=Pm(e),s=new Tm(n?.addNewLine),i=new Em(e);let o=null;for(const a of i.compose(s.parse(t),!0,t.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new An(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(o.errors.forEach(Gi(t,n)),o.warnings.forEach(Gi(t,n))),o}function xm(t,e,n){let r;const s=Cm(t,n);if(!s)return null;if(s.warnings.forEach(i=>Ec(s.options.logLevel,i)),s.errors.length>0){if(s.options.logLevel!=="silent")throw s.errors[0];s.errors=[]}return s.toJS(Object.assign({reviver:r},n))}var Je=V({title:B().optional(),globalTitle:B().optional(),description:B().optional(),color:B().optional(),icon:B().optional(),iconColor:B().optional(),avatarUrl:B().optional(),secondaryIcon:B().optional(),secondaryIconColor:B().optional()}),xe=Je.pick({title:!0,description:!0,icon:!0,iconColor:!0}).required({title:!0}),Qc=Je.pick({title:!0,globalTitle:!0,description:!0,icon:!0,iconColor:!0}).required({title:!0}),pn=Je.pick({title:!0,description:!0,avatarUrl:!0,icon:!0,iconColor:!0}).required({title:!0}),Bm=V({createdAt:we(),updatedAt:we()}),ct=B().regex(/^[a-z][a-z0-9-.]+$/,"Name must start with a letter and can only contain lowercase letters, numbers, dashes (-) and dots (.)").min(2).max(64),mn=Ut([zr([ct,fe("."),fe("v"),De().int().min(1)]),zr([ct,fe("."),ct,fe("."),fe("v"),De().int().min(1)]),zr([ct,fe("."),ct,fe("."),ct,fe("."),fe("v"),De().int().min(1)])]),Mr=B().regex(/^[a-z][a-zA-Z0-9]+$/,"Field name must start with a letter and be in camelCase format").min(2).max(64),to=V({type:mn,required:ve(),multiple:ve(),field:B()});V({type:mn,extensions:B().array().optional(),directExtensions:B().array().optional(),inclusions:to.array().optional(),directInclusions:to.array().optional(),schema:Qt(),meta:Je.required({title:!0}).pick({title:!0,description:!0,color:!0,icon:!0,iconColor:!0}),definitionHash:De()});V().loose(),V().loose().toJSONSchema();var Dm=V({type:mn,identity:B(),references:ze(B(),B().array()).optional(),...Je.pick({title:!0,description:!0,icon:!0,iconColor:!0}).shape});V({$meta:Dm});var eu=_t(["composite","unit"]),zm=Symbol("runtimeSchema");function wn(t){return t.path?`${t.instanceId}:${t.output}:${t.path}`:`${t.instanceId}:${t.output}`}var tu=V({x:De(),y:De()}),kt=zr([mn,":",ct]),nn=V({instanceId:kt,output:B(),path:B().optional()}),Vs=V({hubId:B()}),Rm=V({args:ze(B(),dt()).optional(),inputs:ze(B(),Ke(nn)).optional(),hubInputs:ze(B(),Ke(Vs)).optional(),injectionInputs:Ke(Vs).optional(),position:tu.optional()}),Ur=V({id:kt,kind:eu,type:mn,name:ct,...Rm.shape,resolvedInputs:ze(B(),Ke(nn)).optional(),parentId:kt.optional(),outputs:ze(B(),Ke(nn)).optional(),resolvedOutputs:ze(B(),Ke(nn)).optional()}),jm=V({position:tu.optional(),inputs:Ke(nn).optional(),injectionInputs:Ke(Vs).optional()}),Fm=V({id:ue(),...jm.shape}),Mm;(t=>{t.Artifact="d55c63ac-3174-4756-808f-f778e99af0d1",t.Yaml="c857cac5-caa6-4421-b82c-e561fbce6367",t.Secret="240e5789-6ae4-4b22-b9d8-87169e8b4bab"})(Mm||={});var Um=V({"c857cac5-caa6-4421-b82c-e561fbce6367":fe(!0),value:B()}),Lm=V({name:B(),contentType:B().optional(),size:De().optional(),mode:De().optional()}),qm;(t=>{t.Healthy="healthy",t.Degraded="degraded",t.Down="down",t.Warning="warning",t.Progressing="progressing",t.Error="error"})(qm||={});var Zm=Ut([B(),De(),ve(),B().array()]);V({name:B(),meta:Je.pick({title:!0,icon:!0,iconColor:!0}).required({title:!0}),complementaryTo:B().optional(),value:Zm.optional()});function Vm(t){const e=V({"240e5789-6ae4-4b22-b9d8-87169e8b4bab":fe(!0),value:t});return ap(Ut([e,t]),e,{decode:n=>typeof n=="object"&&n!==null&&"240e5789-6ae4-4b22-b9d8-87169e8b4bab"in n?n:{"240e5789-6ae4-4b22-b9d8-87169e8b4bab":!0,value:n},encode:n=>n})}var nu=V({schema:Qt(),[zm]:hp(ke).optional(),required:ve(),meta:Je.required({title:!0}).pick({title:!0,globalTitle:!0,description:!0,color:!0,icon:!0,iconColor:!0})}),no=V({type:mn,fromInput:Mr.optional(),required:ve(),multiple:ve(),meta:Je.required({title:!0}).pick({title:!0,description:!0})}),Km=V({type:ct,kind:eu,args:ze(Mr,nu),inputs:ze(Mr,no),outputs:ze(Mr,no),meta:Je.required({title:!0}).pick({title:!0,description:!0,color:!0,icon:!0,iconColor:!0,secondaryIcon:!0,secondaryIconColor:!0}).extend({category:B().optional(),defaultNamePrefix:B()}),definitionHash:De()}),Jm=nu.extend({readonly:ve(),computed:ve()}),Hm=V({package:B(),path:B().optional()});V({...Km.shape,source:Hm,secrets:ze(B(),Jm)});function pi(t){return"source"in t}var Gm=Ut([V({type:fe("before-destroy")})]);V({name:B(),meta:Je.pick({title:!0,globalTitle:!0,description:!0,icon:!0,iconColor:!0}).required({title:!0}),spec:Gm});var Wm=V({name:B()}),Ym=V({...nn.shape}),Xm=V({value:dt(),source:Ym.optional()});V({instanceId:B(),stateId:B(),args:ze(B(),dt()),inputs:ze(B(),Xm.array()),invokedTriggers:Wm.array(),secretValues:ze(B(),dt()),importBasePath:B()});var ro=new WeakMap;function Qm(t){const e=Um.safeParse(t);if(!e.success)return t;const n=ro.get(t);if(n!==void 0)return n;const r=xm(e.data.value);return ro.set(t,r),r}var eg;(t=>{t.Config="highstate"})(eg||={});var tg=Symbol("unitArtifactId"),ng=V({"d55c63ac-3174-4756-808f-f778e99af0d1":fe(!0),[tg]:B().optional(),hash:B(),meta:xe.optional()}),rg=Ut([V({type:fe("embedded"),isBinary:ve().optional(),value:B()}),V({type:fe("embedded-secret"),isBinary:ve().optional(),value:Vm(B())}),V({type:fe("artifact"),...ng.shape})]),ru=V({meta:Lm,content:rg}),su=V({image:B(),command:B().array(),cwd:B().optional(),env:ze(B(),B()).optional(),files:ze(B(),ru).optional()});V({name:B(),meta:Je.pick({title:!0,globalTitle:!0,description:!0,icon:!0,iconColor:!0}).required({title:!0}),spec:su});var iu=Ut([V({type:fe("markdown"),content:B()}),V({type:fe("qr"),content:B(),showContent:pp(),language:B().optional()}),V({type:fe("file"),file:ru})]);V({name:B(),meta:Je.pick({title:!0,globalTitle:!0,description:!0,icon:!0,iconColor:!0}).required({title:!0}),content:iu.array()});V({name:B(),image:B(),params:ze(B(),dt())});V({projectId:ue(),workerVersionId:ue(),workerInstanceId:ue(),apiUrl:_h(),dataEndpoint:B().min(1),apiKey:B()});ze(B(),dt());V({});var sg=V({path:B(),content:B(),secret:ve().default(!1),mode:De().int().optional()}),ig=V({name:B(),containerPort:De().int().positive().max(65535),protocol:fe("tcp").default("tcp")}),og=bt("type",[V({type:fe("tcp"),port:B(),timeoutSeconds:De().int().positive().default(30)}),V({type:fe("http"),port:B(),path:B(),statuses:De().int().positive().array().default([200]),timeoutSeconds:De().int().positive().default(30)}),V({type:fe("log"),pattern:B(),timeoutSeconds:De().int().positive().default(30)})]);V({identity:B().regex(/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/),image:B(),command:B().array().optional(),args:B().array().default([]),env:ze(B(),B()).default({}),files:sg.array().default([]),ports:ig.array().default([]),readiness:og.optional()});V({id:B(),host:B(),ports:ze(B(),V({host:B(),port:De().int().positive().max(65535)}))});bt("type",[V({type:fe("host")})]);const ag={id:"q8xbilhwpsn65zjlv5kz44qh"},cg={id:"n0rfvpl9o77iqf29ff4kk5gf"},ug={id:"pmn9y901jeiz2ydh93045l39"},lg={id:"qppfcerovu3h22o0x8rlpc3g"};bt("type",[V({type:fe("codebase")}),V({type:fe("database")})]);V({name:ct,spaceId:ue().default(ag.id),modelStorageId:ue().default(lg.id),libraryId:ue().default(cg.id),pulumiBackendId:ue().default(ug.id),meta:xe});V({id:B(),name:ct,meta:xe,spaceId:ue(),modelStorageId:ue(),libraryId:ue(),pulumiBackendId:ue(),...Bm.shape});const fg=V({encryptedIdentities:Ke(B()),hasPasskey:ve()});bt("type",[V({type:fe("locked"),unlockSuite:fg.optional()}),V({type:fe("unlocked")})]);bt("type",[V({type:fe("host")})]);const dg=Je.pick({title:!0,description:!0}).required({title:!0});V({meta:dg,recipient:B()});const hg=V({key:B(),order:_t(["asc","desc"])}),pt=V({search:B().optional(),sortBy:Ke(hg).optional(),skip:De().int().nonnegative().default(0).optional(),count:De().int().positive().max(100).default(20).optional()}),pg=Je.pick({title:!0,description:!0}).required({title:!0});V({id:ue(),meta:xe,serviceAccountId:ue(),serviceAccountMeta:pn.nullable(),createdAt:we()});pt.extend({serviceAccountId:B().optional()});V({id:ue(),hash:B(),size:De(),meta:xe,createdAt:we(),updatedAt:we()});pt.extend({stateId:B().optional(),serviceAccountId:B().optional(),terminalId:B().optional(),pageId:B().optional()});V({name:B(),meta:xe,value:B(),message:B().optional(),order:De().min(0).max(100).optional()});V({identity:B().optional(),title:B().optional(),description:B().optional(),icon:B().optional(),iconColor:B().optional()}).passthrough();const mg=V({id:B(),type:B(),identity:B(),meta:xe,snapshotId:B().optional(),createdAt:we().optional()});pt.extend({type:B().optional()});const ou=V({id:B(),meta:xe,content:dt(),operationId:B(),stateId:B(),referencedInOutputs:B().array(),exportedInOutputs:B().array(),createdAt:we()});V({id:B(),entityType:B(),meta:xe,operationId:B(),stateId:B(),createdAt:we()});V({entity:V({id:B(),type:B(),identity:B()}),snapshot:ou});V({...mg.shape,lastSnapshot:ou.nullable()});V({id:B(),meta:xe,group:B(),fromSnapshotId:B(),fromEntityId:B(),fromEntityType:B(),fromEntityIdentity:B(),fromEntityMeta:xe,toSnapshotId:B(),toEntityId:B(),toEntityType:B(),toEntityIdentity:B(),toEntityMeta:xe});const gg=V({stateId:ue(),meta:xe,acquiredAt:we()});bt("type",[V({type:fe("locked"),locks:gg.array()}),V({type:fe("unlocked"),stateIds:Ke(B())})]);Ur.pick({id:!0,kind:!0,type:!0,name:!0,args:!0,inputs:!0,hubInputs:!0,injectionInputs:!0,position:!0});V({updatedInstances:Ur.array().optional(),updatedHubs:Fm.array().optional(),updatedVirtualInstances:Ur.array().optional(),updatedGhostInstances:Ur.array().optional(),deletedInstanceIds:kt.array().optional(),deletedHubIds:B().array().optional(),deletedVirtualInstanceIds:kt.array().optional(),deletedGhostInstanceIds:kt.array().optional()});const yg=_t(["destroy","preview","update","refresh"]),wg=V({id:kt,parentId:B().optional(),message:B()}),vg=V({type:yg,instances:Ke(wg)}),bg=V({forceUpdateDependencies:ve().default(!1),ignoreChangedDependencies:ve().default(!1),ignoreDependencies:ve().default(!1),forceUpdateChildren:ve().default(!1),onlyDestroyGhosts:ve().default(!1),firstDestroyGhosts:ve().default(!1),ignoreGhosts:ve().default(!1),destroyDependentInstances:ve().default(!0),invokeDestroyTriggers:ve().default(!0),deleteUnreachableResources:ve().default(!1),forceDeleteState:ve().default(!1),allowPartialCompositeInstanceUpdate:ve().default(!1),allowPartialCompositeInstanceDestruction:ve().default(!1),refresh:ve().default(!1),debug:ve().default(!1)}).partial(),au=_t(["update","preview","destroy","recreate","refresh"]),_g=_t(["pending","running","failing","completed","failed","cancelled","cancelling"]),cu=Je.pick({title:!0,description:!0}).required({title:!0}),$g=V({projectId:B(),type:au,instanceIds:Ke(kt).min(1),options:bg.partial().optional()});$g.extend({meta:cu,plan:vg.array().optional()});bt("type",[V({type:fe("updated"),operation:Qt()}),V({type:fe("deleted"),operationId:B()})]);V({id:ue(),type:au,status:_g,meta:cu,startedAt:we(),updatedAt:we(),finishedAt:we().nullable()});const Sg=V({id:ue(),meta:xe,name:B().nullable(),stateId:ue().nullable(),serviceAccountId:ue().nullable(),serviceAccountMeta:pn.nullable(),createdAt:we(),updatedAt:we()});pt.extend({serviceAccountId:B().optional(),stateId:B().optional(),artifactId:B().optional()});V({...Sg.shape,content:Ke(iu)});V({name:B().min(1),meta:xe});V({id:ue(),name:B(),meta:xe,stateId:ue(),serviceAccountId:ue(),serviceAccountMeta:xe,workerVersionId:ue(),workerVersionMeta:xe,workerId:ue(),online:ve(),createdAt:we(),updatedAt:we()});V({online:ve()});pt.extend({stateId:ue().optional(),serviceAccountId:ue().optional(),workerVersionId:ue().optional()});V({id:ue(),meta:Qc,name:B().nullable(),systemName:B().nullable(),stateId:ue().nullable(),serviceAccountId:ue().nullable(),serviceAccountMeta:pn.nullable(),createdAt:we(),updatedAt:we()});pt.extend({serviceAccountId:B().optional(),stateId:B().optional()});V({id:ue(),meta:pn,createdAt:we(),updatedAt:we()});pt.extend({artifactId:B().optional()});V({stateId:B(),output:B(),path:B().optional()});bt("type",[V({type:fe("updated"),state:Qt()}),V({type:fe("patched"),stateId:B(),patch:Qt()}),V({type:fe("patched-batch"),patches:Ke(V({stateId:B(),patch:Qt()}))}),V({type:fe("deleted"),stateId:B()})]);bt("type",[V({type:fe("registered"),stateId:B(),params:ze(B(),dt())}),V({type:fe("deregistered"),stateId:B()})]);const Eg=_t(["active","unavailable"]);V({id:ue(),terminalId:ue(),meta:Qc,startedAt:we(),finishedAt:we().nullable()});const kg=V({id:ue(),name:B().nullable(),meta:xe,status:Eg,stateId:B().nullable(),serviceAccountId:B().nullable(),serviceAccountMeta:pn.nullable(),createdAt:we(),updatedAt:we()});pt.extend({serviceAccountId:B().optional(),stateId:B().optional(),artifactId:B().optional()});V({...kg.shape,spec:su});V({id:ue(),meta:xe,name:B(),stateId:ue(),createdAt:we(),updatedAt:we()});pt.extend({stateId:B().optional()});const uu=_t(["password","passkey"]),lu=Je.pick({title:!0,description:!0}).required({title:!0});V({meta:lu,type:uu,encryptedIdentity:B(),recipient:B()});V({id:ue(),type:uu,meta:lu,recipient:B(),createdAt:we(),updatedAt:we()});const fu=_t(["unknown","starting","running","stopping","stopped","error"]);V({workerVersionId:ue(),status:fu});V({id:ue(),digest:B(),meta:xe,status:fu,enabled:ve(),apiKeyId:B(),apiKeyMeta:pg,createdAt:we(),updatedAt:we()});V({id:ue(),identity:B(),meta:xe,serviceAccountId:B(),serviceAccountMeta:pn,createdAt:we()});pt.extend({serviceAccountId:B().optional()});function du(t){const e=t.visited??new Set,n=t.getInstanceContext(t.input.instanceId);if(!n)return _s({rootType:t.fallbackType,path:t.input.path,entities:void 0,fallbackType:t.fallbackType});const r=n.component.outputs[t.input.output];if(!r)return _s({rootType:t.fallbackType,path:t.input.path,entities:n.entities,fallbackType:t.fallbackType});let s=r.type;if(r.fromInput){const i=`${n.instance.id}:${t.input.output}`;if(!e.has(i)){e.add(i);const o=r.fromInput,a=n.component.inputs[o]?.type??s,c=(n.instance.hubInputs?.[o]?.length??0)>0,l=(n.instance.injectionInputs?.length??0)>0,d=n.instance.inputs?.[o]??[];if(!c&&!l&&d.length===1){const p=d[0];p?s=du({input:p,fallbackType:a,getInstanceContext:t.getInstanceContext,visited:e}):s=a}else s=a}}return _s({rootType:s,path:t.input.path,entities:n.entities,fallbackType:t.fallbackType})}function _s(t){const{rootType:e,path:n,entities:r,fallbackType:s}=t;if(!n||!r)return Ig(e,s,r);let i=e;const o=n.split(".");for(const a of o){const c=r[i];if(!c)return e;const l=c.inclusions?.find(d=>d.field===a);if(!l)return e;i=l.type}return i}function Ig(t,e,n){if(!n||t===e)return t;const r=n[t];return!r||r.extensions?.includes(e)?t:r.inclusions?.find(i=>i.type===e)?e:t}class mi{constructor(e,n,r,s){this.nodes=e,this.logger=n,this.outputHandler=r,this.dependentSetHandler=s}nodes;logger;outputHandler;dependentSetHandler;workset=new Set;dependencyMap=new Map;dependentMap=new Map;outputMap=new Map;addToWorkset(e){this.workset.add(e)}addAllNodesToWorkset(){for(const e of this.nodes.keys())this.workset.add(e)}get outputs(){return this.outputMap}get dependents(){return this.dependentMap}requireOutput(e){const n=this.outputMap.get(e);if(!n)throw new Error(`Output for node ${e} is not available`);return n}getDependents(e){const n=this.dependentMap.get(e);return n?Array.from(n):[]}invalidate(e){const n=[e];for(;n.length>0;){const r=n.pop();if(!this.nodes.has(r))continue;this.outputMap.delete(r),this.workset.add(r);const s=this.dependentMap.get(r);if(s)for(const i of s)this.outputMap.has(i)&&n.push(i)}}canAddDependency(e,n){if(e===n)return!1;const r=[e],s=new Set;for(;r.length>0;){const i=r.pop();if(i===n)return!1;if(s.has(i))continue;s.add(i);const o=this.dependentMap.get(i);if(o)for(const a of o)this.nodes.has(a)&&r.push(a)}return!0}invalidateSingle(e){this.nodes.has(e)&&(this.outputMap.delete(e),this.workset.add(e))}async process(e){for(;this.workset.size>0;){const n=this.workset.values().next().value,r=[{nodeId:n,resolved:!1,dependencies:[]}];for(;r.length>0;){const s=r[r.length-1],{nodeId:i,resolved:o}=s,a=this.nodes.get(i);if(!a){this.logger.warn({nodeId:i},"node not found in the graph, skipping"),r.pop();continue}if(this.outputMap.has(i)){r.pop();continue}if(!o){s.dependencies=$p(this.getNodeDependencies(a));let p=!1;for(const h of s.dependencies){if(!this.nodes.has(h)){this.logger.warn({depId:h,nodeId:i},"dependency not found in the graph, skipping");continue}this.outputMap.has(h)||(r.push({nodeId:h,resolved:!1,dependencies:[]}),p=!0)}if(p){s.resolved=!0;continue}}const c=await this.processNode(a,this.logger);if(e?.aborted){this.logger.warn({nodeId:i},"processing aborted, skipping output");return}const l=new Set,d=this.dependencyMap.get(i)??[];for(const p of d){const h=this.dependentMap.get(p);h&&(h.delete(i),l.add(p),h.size===0&&this.dependentMap.delete(p))}for(const p of s.dependencies){let h=this.dependentMap.get(p);h||(h=new Set,this.dependentMap.set(p,h)),h.add(i),l.add(p)}if(this.dependentSetHandler)for(const p of l){const h=this.dependentMap.get(p);this.dependentSetHandler(p,h)}this.outputMap.set(i,c),this.outputHandler?.(i,c),this.dependencyMap.set(i,s.dependencies),r.pop()}this.workset.delete(n)}}}class Ag extends mi{getNodeDependencies(e){const n=[];if(e.kind==="hub"){for(const r of e.hub.inputs??[])n.push(`instance:${r.instanceId}`);for(const r of e.hub.injectionInputs??[])n.push(`hub:${r.hubId}`);return n}for(const r of Object.values(e.instance.inputs??{}))for(const s of r)n.push(`instance:${s.instanceId}`);for(const r of Object.values(e.instance.hubInputs??{}))for(const s of r)n.push(`hub:${s.hubId}`);for(const r of e.instance.injectionInputs??[])n.push(`hub:${r.hubId}`);return n}resolveOutputTypeForInput(e,n){return du({input:e,fallbackType:n,getInstanceContext:r=>{const s=this.outputs.get(`instance:${r}`);if(!(!s||s.kind!=="instance"))return{instance:s.instance,component:s.component,entities:s.entities}}})}processNode(e){const n=d=>{const p=this.outputs.get(`hub:${d.hubId}`);if(!p)return{resolvedInputs:[]};if(p.kind!=="hub")throw new Error("Expected hub node");return p},r=d=>{const p=this.outputs.get(`instance:${d.instanceId}`);if(!p)return{component:null,resolvedInputs:[],resolvedOutputs:[]};if(p.kind!=="instance")throw new Error("Expected instance node");return{component:p.component,resolvedInputs:p.resolvedInputs[d.output]??[],resolvedOutputs:p.resolvedOutputs?.[d.output]}};if(e.kind==="hub"){const d=new Map,p=h=>{d.set(wn(h.input),h)};for(const h of e.hub.inputs??[]){const{component:m}=r(h),b=m?.outputs[h.output];if(!b){this.logger.warn({msg:"output not found in the component",input:h,component:m});continue}p({input:h,type:this.resolveOutputTypeForInput(h,b.type)})}for(const h of e.hub.injectionInputs??[]){const{resolvedInputs:m}=n(h);for(const b of m)p(b)}return{kind:"hub",hub:e.hub,resolvedInputs:Array.from(d.values())}}if(e.instance.resolvedInputs)return{kind:"instance",instance:e.instance,component:e.component,entities:e.entities,resolvedInputs:bp(e.instance.resolvedInputs,(d,p)=>{const h=e.component.inputs[p];return h?d.map(m=>({input:m,type:h.type})):(this.logger.warn({msg:"input not found in the component",inputName:p,component:e.component}),[])}),resolvedOutputs:e.instance.resolvedOutputs??{},resolvedInjectionInputs:[],matchedInjectionInputs:[]};const s=new Map,i=(d,p)=>{let h=s.get(d);h||(h=new Map,s.set(d,h)),h.set(wn(p.input),p)},o=(d,p)=>{const h=e.component.inputs[d],m=e.instance.type===Su;if(!h&&!m){this.logger.warn({msg:"input not found in the component",input:p,component:e.component});return}const{component:b,resolvedOutputs:w}=r(p);if(!b){this.logger.warn({instanceId:e.instance.id,input:p},"no output found for the input");return}const g=h?.type??b.outputs[p.output]?.type;if(!g){this.logger.warn({instanceId:e.instance.id,input:p,component:b},"cannot resolve input type for dynamic export input");return}if(pi(b)){i(d,{input:p,type:this.resolveOutputTypeForInput(p,g)});return}if(w)for(const $ of w)i(d,{input:{...$,path:p.path??$.path},type:this.resolveOutputTypeForInput({instanceId:p.instanceId,output:p.output,path:p.path??$.path},g)});else i(d,{input:p,type:this.resolveOutputTypeForInput(p,g)})};for(const[d,p]of Object.entries(e.instance.inputs??{}))for(const h of p)o(d,h);const a=new Map,c=new Map;for(const d of e.instance.injectionInputs??[]){const{resolvedInputs:p}=n(d);for(const h of p)a.set(wn(h.input),h)}for(const[d,p]of Object.entries(e.component.inputs??{})){const h=new Map(a),m=e.instance.hubInputs?.[d]??[];for(const b of m){const{resolvedInputs:w}=n(b);for(const g of w)h.set(wn(g.input),g)}for(const b of h.values())if(b.type===p.type){o(d,b.input);const w=wn(b.input);a.has(w)&&c.set(w,b)}}const l=vp(Array.from(s.entries()).map(([d,p])=>[d,Array.from(p.values())]));return{kind:"instance",instance:e.instance,component:e.component,entities:e.entities,resolvedInputs:l,resolvedOutputs:e.instance.resolvedOutputs,resolvedInjectionInputs:Array.from(a.values()),matchedInjectionInputs:Array.from(c.values())}}}function Og(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}const Ng=t=>new TextEncoder().encode(t);typeof Buffer<"u"&&Buffer.from;function Tg(t){if(!Uint32Array.from){for(var e=new Uint32Array(t.length),n=0;n<t.length;)e[n]=t[n],n+=1;return e}return Uint32Array.from(t)}function $s(t){return new Pg().update(t).digest()}var Pg=(function(){function t(){this.checksum=4294967295}return t.prototype.update=function(e){var n,r;try{for(var s=Og(e),i=s.next();!i.done;i=s.next()){var o=i.value;this.checksum=this.checksum>>>8^xg[(this.checksum^o)&255]}}catch(a){n={error:a}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return this},t.prototype.digest=function(){return(this.checksum^4294967295)>>>0},t})(),Cg=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],xg=Tg(Cg);function Bg(t){const e=t.length;let n=0,r=0;for(;r<e;){let s=t.charCodeAt(r++);if((s&4294967168)===0){n++;continue}else if((s&4294965248)===0)n+=2;else{if(s>=55296&&s<=56319&&r<e){const i=t.charCodeAt(r);(i&64512)===56320&&(++r,s=((s&1023)<<10)+(i&1023)+65536)}(s&4294901760)===0?n+=3:n+=4}}return n}function Dg(t,e,n){const r=t.length;let s=n,i=0;for(;i<r;){let o=t.charCodeAt(i++);if((o&4294967168)===0){e[s++]=o;continue}else if((o&4294965248)===0)e[s++]=o>>6&31|192;else{if(o>=55296&&o<=56319&&i<r){const a=t.charCodeAt(i);(a&64512)===56320&&(++i,o=((o&1023)<<10)+(a&1023)+65536)}(o&4294901760)===0?(e[s++]=o>>12&15|224,e[s++]=o>>6&63|128):(e[s++]=o>>18&7|240,e[s++]=o>>12&63|128,e[s++]=o>>6&63|128)}e[s++]=o&63|128}}const zg=new TextEncoder,Rg=50;function jg(t,e,n){zg.encodeInto(t,e.subarray(n))}function Fg(t,e,n){t.length>Rg?jg(t,e,n):Dg(t,e,n)}new TextDecoder;class Hn{type;data;constructor(e,n){this.type=e,this.data=n}}class Hr extends Error{constructor(e){super(e);const n=Object.create(Hr.prototype);Object.setPrototypeOf(this,n),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:Hr.name})}}function Mg(t,e,n){const r=n/4294967296,s=n;t.setUint32(e,r),t.setUint32(e+4,s)}function hu(t,e,n){const r=Math.floor(n/4294967296),s=n;t.setUint32(e,r),t.setUint32(e+4,s)}function Ug(t,e){const n=t.getInt32(e),r=t.getUint32(e+4);return n*4294967296+r}const Lg=-1,qg=4294967296-1,Zg=17179869184-1;function Vg({sec:t,nsec:e}){if(t>=0&&e>=0&&t<=Zg)if(e===0&&t<=qg){const n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,t),n}else{const n=t/4294967296,r=t&4294967295,s=new Uint8Array(8),i=new DataView(s.buffer);return i.setUint32(0,e<<2|n&3),i.setUint32(4,r),s}else{const n=new Uint8Array(12),r=new DataView(n.buffer);return r.setUint32(0,e),hu(r,4,t),n}}function Kg(t){const e=t.getTime(),n=Math.floor(e/1e3),r=(e-n*1e3)*1e6,s=Math.floor(r/1e9);return{sec:n+s,nsec:r-s*1e9}}function Jg(t){if(t instanceof Date){const e=Kg(t);return Vg(e)}else return null}function Hg(t){const e=new DataView(t.buffer,t.byteOffset,t.byteLength);switch(t.byteLength){case 4:return{sec:e.getUint32(0),nsec:0};case 8:{const n=e.getUint32(0),r=e.getUint32(4),s=(n&3)*4294967296+r,i=n>>>2;return{sec:s,nsec:i}}case 12:{const n=Ug(e,4),r=e.getUint32(0);return{sec:n,nsec:r}}default:throw new Hr(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${t.length}`)}}function Gg(t){const e=Hg(t);return new Date(e.sec*1e3+e.nsec/1e6)}const Wg={type:Lg,encode:Jg,decode:Gg};class gi{static defaultCodec=new gi;__brand;builtInEncoders=[];builtInDecoders=[];encoders=[];decoders=[];constructor(){this.register(Wg)}register({type:e,encode:n,decode:r}){if(e>=0)this.encoders[e]=n,this.decoders[e]=r;else{const s=-1-e;this.builtInEncoders[s]=n,this.builtInDecoders[s]=r}}tryToEncode(e,n){for(let r=0;r<this.builtInEncoders.length;r++){const s=this.builtInEncoders[r];if(s!=null){const i=s(e,n);if(i!=null){const o=-1-r;return new Hn(o,i)}}}for(let r=0;r<this.encoders.length;r++){const s=this.encoders[r];if(s!=null){const i=s(e,n);if(i!=null){const o=r;return new Hn(o,i)}}}return e instanceof Hn?e:null}decode(e,n,r){const s=n<0?this.builtInDecoders[-1-n]:this.decoders[n];return s?s(e,n,r):new Hn(n,e)}}function Yg(t){return t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer}function Xg(t){return t instanceof Uint8Array?t:ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Yg(t)?new Uint8Array(t):Uint8Array.from(t)}const Qg=100,ey=2048;class yi{extensionCodec;context;useBigInt64;maxDepth;initialBufferSize;sortKeys;forceFloat32;ignoreUndefined;forceIntegerToFloat;pos;view;bytes;entered=!1;constructor(e){this.extensionCodec=e?.extensionCodec??gi.defaultCodec,this.context=e?.context,this.useBigInt64=e?.useBigInt64??!1,this.maxDepth=e?.maxDepth??Qg,this.initialBufferSize=e?.initialBufferSize??ey,this.sortKeys=e?.sortKeys??!1,this.forceFloat32=e?.forceFloat32??!1,this.ignoreUndefined=e?.ignoreUndefined??!1,this.forceIntegerToFloat=e?.forceIntegerToFloat??!1,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}clone(){return new yi({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,maxDepth:this.maxDepth,initialBufferSize:this.initialBufferSize,sortKeys:this.sortKeys,forceFloat32:this.forceFloat32,ignoreUndefined:this.ignoreUndefined,forceIntegerToFloat:this.forceIntegerToFloat})}reinitializeState(){this.pos=0}encodeSharedRef(e){if(this.entered)return this.clone().encodeSharedRef(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.subarray(0,this.pos)}finally{this.entered=!1}}encode(e){if(this.entered)return this.clone().encode(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.slice(0,this.pos)}finally{this.entered=!1}}doEncode(e,n){if(n>this.maxDepth)throw new Error(`Too deep objects in depth ${n}`);e==null?this.encodeNil():typeof e=="boolean"?this.encodeBoolean(e):typeof e=="number"?this.forceIntegerToFloat?this.encodeNumberAsFloat(e):this.encodeNumber(e):typeof e=="string"?this.encodeString(e):this.useBigInt64&&typeof e=="bigint"?this.encodeBigInt64(e):this.encodeObject(e,n)}ensureBufferSizeToWrite(e){const n=this.pos+e;this.view.byteLength<n&&this.resizeBuffer(n*2)}resizeBuffer(e){const n=new ArrayBuffer(e),r=new Uint8Array(n),s=new DataView(n);r.set(this.bytes),this.view=s,this.bytes=r}encodeNil(){this.writeU8(192)}encodeBoolean(e){e===!1?this.writeU8(194):this.writeU8(195)}encodeNumber(e){!this.forceIntegerToFloat&&Number.isSafeInteger(e)?e>=0?e<128?this.writeU8(e):e<256?(this.writeU8(204),this.writeU8(e)):e<65536?(this.writeU8(205),this.writeU16(e)):e<4294967296?(this.writeU8(206),this.writeU32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(207),this.writeU64(e)):e>=-32?this.writeU8(224|e+32):e>=-128?(this.writeU8(208),this.writeI8(e)):e>=-32768?(this.writeU8(209),this.writeI16(e)):e>=-2147483648?(this.writeU8(210),this.writeI32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(211),this.writeI64(e)):this.encodeNumberAsFloat(e)}encodeNumberAsFloat(e){this.forceFloat32?(this.writeU8(202),this.writeF32(e)):(this.writeU8(203),this.writeF64(e))}encodeBigInt64(e){e>=BigInt(0)?(this.writeU8(207),this.writeBigUint64(e)):(this.writeU8(211),this.writeBigInt64(e))}writeStringHeader(e){if(e<32)this.writeU8(160+e);else if(e<256)this.writeU8(217),this.writeU8(e);else if(e<65536)this.writeU8(218),this.writeU16(e);else if(e<4294967296)this.writeU8(219),this.writeU32(e);else throw new Error(`Too long string: ${e} bytes in UTF-8`)}encodeString(e){const r=Bg(e);this.ensureBufferSizeToWrite(5+r),this.writeStringHeader(r),Fg(e,this.bytes,this.pos),this.pos+=r}encodeObject(e,n){const r=this.extensionCodec.tryToEncode(e,this.context);if(r!=null)this.encodeExtension(r);else if(Array.isArray(e))this.encodeArray(e,n);else if(ArrayBuffer.isView(e))this.encodeBinary(e);else if(typeof e=="object")this.encodeMap(e,n);else throw new Error(`Unrecognized object: ${Object.prototype.toString.apply(e)}`)}encodeBinary(e){const n=e.byteLength;if(n<256)this.writeU8(196),this.writeU8(n);else if(n<65536)this.writeU8(197),this.writeU16(n);else if(n<4294967296)this.writeU8(198),this.writeU32(n);else throw new Error(`Too large binary: ${n}`);const r=Xg(e);this.writeU8a(r)}encodeArray(e,n){const r=e.length;if(r<16)this.writeU8(144+r);else if(r<65536)this.writeU8(220),this.writeU16(r);else if(r<4294967296)this.writeU8(221),this.writeU32(r);else throw new Error(`Too large array: ${r}`);for(const s of e)this.doEncode(s,n+1)}countWithoutUndefined(e,n){let r=0;for(const s of n)e[s]!==void 0&&r++;return r}encodeMap(e,n){const r=Object.keys(e);this.sortKeys&&r.sort();const s=this.ignoreUndefined?this.countWithoutUndefined(e,r):r.length;if(s<16)this.writeU8(128+s);else if(s<65536)this.writeU8(222),this.writeU16(s);else if(s<4294967296)this.writeU8(223),this.writeU32(s);else throw new Error(`Too large map object: ${s}`);for(const i of r){const o=e[i];this.ignoreUndefined&&o===void 0||(this.encodeString(i),this.doEncode(o,n+1))}}encodeExtension(e){if(typeof e.data=="function"){const r=e.data(this.pos+6),s=r.length;if(s>=4294967296)throw new Error(`Too large extension object: ${s}`);this.writeU8(201),this.writeU32(s),this.writeI8(e.type),this.writeU8a(r);return}const n=e.data.length;if(n===1)this.writeU8(212);else if(n===2)this.writeU8(213);else if(n===4)this.writeU8(214);else if(n===8)this.writeU8(215);else if(n===16)this.writeU8(216);else if(n<256)this.writeU8(199),this.writeU8(n);else if(n<65536)this.writeU8(200),this.writeU16(n);else if(n<4294967296)this.writeU8(201),this.writeU32(n);else throw new Error(`Too large extension object: ${n}`);this.writeI8(e.type),this.writeU8a(e.data)}writeU8(e){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,e),this.pos++}writeU8a(e){const n=e.length;this.ensureBufferSizeToWrite(n),this.bytes.set(e,this.pos),this.pos+=n}writeI8(e){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,e),this.pos++}writeU16(e){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,e),this.pos+=2}writeI16(e){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,e),this.pos+=2}writeU32(e){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,e),this.pos+=4}writeI32(e){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,e),this.pos+=4}writeF32(e){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,e),this.pos+=4}writeF64(e){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,e),this.pos+=8}writeU64(e){this.ensureBufferSizeToWrite(8),Mg(this.view,this.pos,e),this.pos+=8}writeI64(e){this.ensureBufferSizeToWrite(8),hu(this.view,this.pos,e),this.pos+=8}writeBigUint64(e){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,e),this.pos+=8}writeBigInt64(e){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,e),this.pos+=8}}function ty(t,e){return new yi(e).encodeSharedRef(t)}var Ss={},vn={},so;function ny(){if(so)return vn;so=1,vn.byteLength=a,vn.toByteArray=l,vn.fromByteArray=h;for(var t=[],e=[],n=typeof Uint8Array<"u"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,i=r.length;s<i;++s)t[s]=r[s],e[r.charCodeAt(s)]=s;e[45]=62,e[95]=63;function o(m){var b=m.length;if(b%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var w=m.indexOf("=");w===-1&&(w=b);var g=w===b?0:4-w%4;return[w,g]}function a(m){var b=o(m),w=b[0],g=b[1];return(w+g)*3/4-g}function c(m,b,w){return(b+w)*3/4-w}function l(m){var b,w=o(m),g=w[0],$=w[1],y=new n(c(m,g,$)),_=0,I=$>0?g-4:g,v;for(v=0;v<I;v+=4)b=e[m.charCodeAt(v)]<<18|e[m.charCodeAt(v+1)]<<12|e[m.charCodeAt(v+2)]<<6|e[m.charCodeAt(v+3)],y[_++]=b>>16&255,y[_++]=b>>8&255,y[_++]=b&255;return $===2&&(b=e[m.charCodeAt(v)]<<2|e[m.charCodeAt(v+1)]>>4,y[_++]=b&255),$===1&&(b=e[m.charCodeAt(v)]<<10|e[m.charCodeAt(v+1)]<<4|e[m.charCodeAt(v+2)]>>2,y[_++]=b>>8&255,y[_++]=b&255),y}function d(m){return t[m>>18&63]+t[m>>12&63]+t[m>>6&63]+t[m&63]}function p(m,b,w){for(var g,$=[],y=b;y<w;y+=3)g=(m[y]<<16&16711680)+(m[y+1]<<8&65280)+(m[y+2]&255),$.push(d(g));return $.join("")}function h(m){for(var b,w=m.length,g=w%3,$=[],y=16383,_=0,I=w-g;_<I;_+=y)$.push(p(m,_,_+y>I?I:_+y));return g===1?(b=m[w-1],$.push(t[b>>2]+t[b<<4&63]+"==")):g===2&&(b=(m[w-2]<<8)+m[w-1],$.push(t[b>>10]+t[b>>4&63]+t[b<<2&63]+"=")),$.join("")}return vn}var Gn={};var io;function ry(){return io||(io=1,Gn.read=function(t,e,n,r,s){var i,o,a=s*8-r-1,c=(1<<a)-1,l=c>>1,d=-7,p=n?s-1:0,h=n?-1:1,m=t[e+p];for(p+=h,i=m&(1<<-d)-1,m>>=-d,d+=a;d>0;i=i*256+t[e+p],p+=h,d-=8);for(o=i&(1<<-d)-1,i>>=-d,d+=r;d>0;o=o*256+t[e+p],p+=h,d-=8);if(i===0)i=1-l;else{if(i===c)return o?NaN:(m?-1:1)*(1/0);o=o+Math.pow(2,r),i=i-l}return(m?-1:1)*o*Math.pow(2,i-r)},Gn.write=function(t,e,n,r,s,i){var o,a,c,l=i*8-s-1,d=(1<<l)-1,p=d>>1,h=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=r?0:i-1,b=r?1:-1,w=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=d):(o=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+p>=1?e+=h/c:e+=h*Math.pow(2,1-p),e*c>=2&&(o++,c/=2),o+p>=d?(a=0,o=d):o+p>=1?(a=(e*c-1)*Math.pow(2,s),o=o+p):(a=e*Math.pow(2,p-1)*Math.pow(2,s),o=0));s>=8;t[n+m]=a&255,m+=b,a/=256,s-=8);for(o=o<<s|a,l+=s;l>0;t[n+m]=o&255,m+=b,o/=256,l-=8);t[n+m-b]|=w*128}),Gn}var oo;function sy(){return oo||(oo=1,(function(t){const e=ny(),n=ry(),r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=a,t.SlowBuffer=y,t.INSPECT_MAX_BYTES=50;const s=2147483647;t.kMaxLength=s,a.TYPED_ARRAY_SUPPORT=i(),!a.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function i(){try{const S=new Uint8Array(1),u={foo:function(){return 42}};return Object.setPrototypeOf(u,Uint8Array.prototype),Object.setPrototypeOf(S,u),S.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function o(S){if(S>s)throw new RangeError('The value "'+S+'" is invalid for option "size"');const u=new Uint8Array(S);return Object.setPrototypeOf(u,a.prototype),u}function a(S,u,f){if(typeof S=="number"){if(typeof u=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return p(S)}return c(S,u,f)}a.poolSize=8192;function c(S,u,f){if(typeof S=="string")return h(S,u);if(ArrayBuffer.isView(S))return b(S);if(S==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof S);if(Le(S,ArrayBuffer)||S&&Le(S.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Le(S,SharedArrayBuffer)||S&&Le(S.buffer,SharedArrayBuffer)))return w(S,u,f);if(typeof S=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const A=S.valueOf&&S.valueOf();if(A!=null&&A!==S)return a.from(A,u,f);const C=g(S);if(C)return C;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof S[Symbol.toPrimitive]=="function")return a.from(S[Symbol.toPrimitive]("string"),u,f);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof S)}a.from=function(S,u,f){return c(S,u,f)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function l(S){if(typeof S!="number")throw new TypeError('"size" argument must be of type number');if(S<0)throw new RangeError('The value "'+S+'" is invalid for option "size"')}function d(S,u,f){return l(S),S<=0?o(S):u!==void 0?typeof f=="string"?o(S).fill(u,f):o(S).fill(u):o(S)}a.alloc=function(S,u,f){return d(S,u,f)};function p(S){return l(S),o(S<0?0:$(S)|0)}a.allocUnsafe=function(S){return p(S)},a.allocUnsafeSlow=function(S){return p(S)};function h(S,u){if((typeof u!="string"||u==="")&&(u="utf8"),!a.isEncoding(u))throw new TypeError("Unknown encoding: "+u);const f=_(S,u)|0;let A=o(f);const C=A.write(S,u);return C!==f&&(A=A.slice(0,C)),A}function m(S){const u=S.length<0?0:$(S.length)|0,f=o(u);for(let A=0;A<u;A+=1)f[A]=S[A]&255;return f}function b(S){if(Le(S,Uint8Array)){const u=new Uint8Array(S);return w(u.buffer,u.byteOffset,u.byteLength)}return m(S)}function w(S,u,f){if(u<0||S.byteLength<u)throw new RangeError('"offset" is outside of buffer bounds');if(S.byteLength<u+(f||0))throw new RangeError('"length" is outside of buffer bounds');let A;return u===void 0&&f===void 0?A=new Uint8Array(S):f===void 0?A=new Uint8Array(S,u):A=new Uint8Array(S,u,f),Object.setPrototypeOf(A,a.prototype),A}function g(S){if(a.isBuffer(S)){const u=$(S.length)|0,f=o(u);return f.length===0||S.copy(f,0,0,u),f}if(S.length!==void 0)return typeof S.length!="number"||Ve(S.length)?o(0):m(S);if(S.type==="Buffer"&&Array.isArray(S.data))return m(S.data)}function $(S){if(S>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return S|0}function y(S){return+S!=S&&(S=0),a.alloc(+S)}a.isBuffer=function(u){return u!=null&&u._isBuffer===!0&&u!==a.prototype},a.compare=function(u,f){if(Le(u,Uint8Array)&&(u=a.from(u,u.offset,u.byteLength)),Le(f,Uint8Array)&&(f=a.from(f,f.offset,f.byteLength)),!a.isBuffer(u)||!a.isBuffer(f))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(u===f)return 0;let A=u.length,C=f.length;for(let R=0,Z=Math.min(A,C);R<Z;++R)if(u[R]!==f[R]){A=u[R],C=f[R];break}return A<C?-1:C<A?1:0},a.isEncoding=function(u){switch(String(u).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(u,f){if(!Array.isArray(u))throw new TypeError('"list" argument must be an Array of Buffers');if(u.length===0)return a.alloc(0);let A;if(f===void 0)for(f=0,A=0;A<u.length;++A)f+=u[A].length;const C=a.allocUnsafe(f);let R=0;for(A=0;A<u.length;++A){let Z=u[A];if(Le(Z,Uint8Array))R+Z.length>C.length?(a.isBuffer(Z)||(Z=a.from(Z)),Z.copy(C,R)):Uint8Array.prototype.set.call(C,Z,R);else if(a.isBuffer(Z))Z.copy(C,R);else throw new TypeError('"list" argument must be an Array of Buffers');R+=Z.length}return C};function _(S,u){if(a.isBuffer(S))return S.length;if(ArrayBuffer.isView(S)||Le(S,ArrayBuffer))return S.byteLength;if(typeof S!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof S);const f=S.length,A=arguments.length>2&&arguments[2]===!0;if(!A&&f===0)return 0;let C=!1;for(;;)switch(u){case"ascii":case"latin1":case"binary":return f;case"utf8":case"utf-8":return _e(S).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return f*2;case"hex":return f>>>1;case"base64":return Ue(S).length;default:if(C)return A?-1:_e(S).length;u=(""+u).toLowerCase(),C=!0}}a.byteLength=_;function I(S,u,f){let A=!1;if((u===void 0||u<0)&&(u=0),u>this.length||((f===void 0||f>this.length)&&(f=this.length),f<=0)||(f>>>=0,u>>>=0,f<=u))return"";for(S||(S="utf8");;)switch(S){case"hex":return oe(this,u,f);case"utf8":case"utf-8":return de(this,u,f);case"ascii":return re(this,u,f);case"latin1":case"binary":return ne(this,u,f);case"base64":return se(this,u,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return K(this,u,f);default:if(A)throw new TypeError("Unknown encoding: "+S);S=(S+"").toLowerCase(),A=!0}}a.prototype._isBuffer=!0;function v(S,u,f){const A=S[u];S[u]=S[f],S[f]=A}a.prototype.swap16=function(){const u=this.length;if(u%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let f=0;f<u;f+=2)v(this,f,f+1);return this},a.prototype.swap32=function(){const u=this.length;if(u%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let f=0;f<u;f+=4)v(this,f,f+3),v(this,f+1,f+2);return this},a.prototype.swap64=function(){const u=this.length;if(u%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let f=0;f<u;f+=8)v(this,f,f+7),v(this,f+1,f+6),v(this,f+2,f+5),v(this,f+3,f+4);return this},a.prototype.toString=function(){const u=this.length;return u===0?"":arguments.length===0?de(this,0,u):I.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(u){if(!a.isBuffer(u))throw new TypeError("Argument must be a Buffer");return this===u?!0:a.compare(this,u)===0},a.prototype.inspect=function(){let u="";const f=t.INSPECT_MAX_BYTES;return u=this.toString("hex",0,f).replace(/(.{2})/g,"$1 ").trim(),this.length>f&&(u+=" ... "),"<Buffer "+u+">"},r&&(a.prototype[r]=a.prototype.inspect),a.prototype.compare=function(u,f,A,C,R){if(Le(u,Uint8Array)&&(u=a.from(u,u.offset,u.byteLength)),!a.isBuffer(u))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof u);if(f===void 0&&(f=0),A===void 0&&(A=u?u.length:0),C===void 0&&(C=0),R===void 0&&(R=this.length),f<0||A>u.length||C<0||R>this.length)throw new RangeError("out of range index");if(C>=R&&f>=A)return 0;if(C>=R)return-1;if(f>=A)return 1;if(f>>>=0,A>>>=0,C>>>=0,R>>>=0,this===u)return 0;let Z=R-C,pe=A-f;const Pe=Math.min(Z,pe),Ie=this.slice(C,R),Ce=u.slice(f,A);for(let $e=0;$e<Pe;++$e)if(Ie[$e]!==Ce[$e]){Z=Ie[$e],pe=Ce[$e];break}return Z<pe?-1:pe<Z?1:0};function k(S,u,f,A,C){if(S.length===0)return-1;if(typeof f=="string"?(A=f,f=0):f>2147483647?f=2147483647:f<-2147483648&&(f=-2147483648),f=+f,Ve(f)&&(f=C?0:S.length-1),f<0&&(f=S.length+f),f>=S.length){if(C)return-1;f=S.length-1}else if(f<0)if(C)f=0;else return-1;if(typeof u=="string"&&(u=a.from(u,A)),a.isBuffer(u))return u.length===0?-1:O(S,u,f,A,C);if(typeof u=="number")return u=u&255,typeof Uint8Array.prototype.indexOf=="function"?C?Uint8Array.prototype.indexOf.call(S,u,f):Uint8Array.prototype.lastIndexOf.call(S,u,f):O(S,[u],f,A,C);throw new TypeError("val must be string, number or Buffer")}function O(S,u,f,A,C){let R=1,Z=S.length,pe=u.length;if(A!==void 0&&(A=String(A).toLowerCase(),A==="ucs2"||A==="ucs-2"||A==="utf16le"||A==="utf-16le")){if(S.length<2||u.length<2)return-1;R=2,Z/=2,pe/=2,f/=2}function Pe(Ce,$e){return R===1?Ce[$e]:Ce.readUInt16BE($e*R)}let Ie;if(C){let Ce=-1;for(Ie=f;Ie<Z;Ie++)if(Pe(S,Ie)===Pe(u,Ce===-1?0:Ie-Ce)){if(Ce===-1&&(Ce=Ie),Ie-Ce+1===pe)return Ce*R}else Ce!==-1&&(Ie-=Ie-Ce),Ce=-1}else for(f+pe>Z&&(f=Z-pe),Ie=f;Ie>=0;Ie--){let Ce=!0;for(let $e=0;$e<pe;$e++)if(Pe(S,Ie+$e)!==Pe(u,$e)){Ce=!1;break}if(Ce)return Ie}return-1}a.prototype.includes=function(u,f,A){return this.indexOf(u,f,A)!==-1},a.prototype.indexOf=function(u,f,A){return k(this,u,f,A,!0)},a.prototype.lastIndexOf=function(u,f,A){return k(this,u,f,A,!1)};function T(S,u,f,A){f=Number(f)||0;const C=S.length-f;A?(A=Number(A),A>C&&(A=C)):A=C;const R=u.length;A>R/2&&(A=R/2);let Z;for(Z=0;Z<A;++Z){const pe=parseInt(u.substr(Z*2,2),16);if(Ve(pe))return Z;S[f+Z]=pe}return Z}function L(S,u,f,A){return Te(_e(u,S.length-f),S,f,A)}function H(S,u,f,A){return Te(Me(u),S,f,A)}function G(S,u,f,A){return Te(Ue(u),S,f,A)}function Y(S,u,f,A){return Te(Ze(u,S.length-f),S,f,A)}a.prototype.write=function(u,f,A,C){if(f===void 0)C="utf8",A=this.length,f=0;else if(A===void 0&&typeof f=="string")C=f,A=this.length,f=0;else if(isFinite(f))f=f>>>0,isFinite(A)?(A=A>>>0,C===void 0&&(C="utf8")):(C=A,A=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const R=this.length-f;if((A===void 0||A>R)&&(A=R),u.length>0&&(A<0||f<0)||f>this.length)throw new RangeError("Attempt to write outside buffer bounds");C||(C="utf8");let Z=!1;for(;;)switch(C){case"hex":return T(this,u,f,A);case"utf8":case"utf-8":return L(this,u,f,A);case"ascii":case"latin1":case"binary":return H(this,u,f,A);case"base64":return G(this,u,f,A);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Y(this,u,f,A);default:if(Z)throw new TypeError("Unknown encoding: "+C);C=(""+C).toLowerCase(),Z=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function se(S,u,f){return u===0&&f===S.length?e.fromByteArray(S):e.fromByteArray(S.slice(u,f))}function de(S,u,f){f=Math.min(S.length,f);const A=[];let C=u;for(;C<f;){const R=S[C];let Z=null,pe=R>239?4:R>223?3:R>191?2:1;if(C+pe<=f){let Pe,Ie,Ce,$e;switch(pe){case 1:R<128&&(Z=R);break;case 2:Pe=S[C+1],(Pe&192)===128&&($e=(R&31)<<6|Pe&63,$e>127&&(Z=$e));break;case 3:Pe=S[C+1],Ie=S[C+2],(Pe&192)===128&&(Ie&192)===128&&($e=(R&15)<<12|(Pe&63)<<6|Ie&63,$e>2047&&($e<55296||$e>57343)&&(Z=$e));break;case 4:Pe=S[C+1],Ie=S[C+2],Ce=S[C+3],(Pe&192)===128&&(Ie&192)===128&&(Ce&192)===128&&($e=(R&15)<<18|(Pe&63)<<12|(Ie&63)<<6|Ce&63,$e>65535&&$e<1114112&&(Z=$e))}}Z===null?(Z=65533,pe=1):Z>65535&&(Z-=65536,A.push(Z>>>10&1023|55296),Z=56320|Z&1023),A.push(Z),C+=pe}return W(A)}const M=4096;function W(S){const u=S.length;if(u<=M)return String.fromCharCode.apply(String,S);let f="",A=0;for(;A<u;)f+=String.fromCharCode.apply(String,S.slice(A,A+=M));return f}function re(S,u,f){let A="";f=Math.min(S.length,f);for(let C=u;C<f;++C)A+=String.fromCharCode(S[C]&127);return A}function ne(S,u,f){let A="";f=Math.min(S.length,f);for(let C=u;C<f;++C)A+=String.fromCharCode(S[C]);return A}function oe(S,u,f){const A=S.length;(!u||u<0)&&(u=0),(!f||f<0||f>A)&&(f=A);let C="";for(let R=u;R<f;++R)C+=gn[S[R]];return C}function K(S,u,f){const A=S.slice(u,f);let C="";for(let R=0;R<A.length-1;R+=2)C+=String.fromCharCode(A[R]+A[R+1]*256);return C}a.prototype.slice=function(u,f){const A=this.length;u=~~u,f=f===void 0?A:~~f,u<0?(u+=A,u<0&&(u=0)):u>A&&(u=A),f<0?(f+=A,f<0&&(f=0)):f>A&&(f=A),f<u&&(f=u);const C=this.subarray(u,f);return Object.setPrototypeOf(C,a.prototype),C};function P(S,u,f){if(S%1!==0||S<0)throw new RangeError("offset is not uint");if(S+u>f)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(u,f,A){u=u>>>0,f=f>>>0,A||P(u,f,this.length);let C=this[u],R=1,Z=0;for(;++Z<f&&(R*=256);)C+=this[u+Z]*R;return C},a.prototype.readUintBE=a.prototype.readUIntBE=function(u,f,A){u=u>>>0,f=f>>>0,A||P(u,f,this.length);let C=this[u+--f],R=1;for(;f>0&&(R*=256);)C+=this[u+--f]*R;return C},a.prototype.readUint8=a.prototype.readUInt8=function(u,f){return u=u>>>0,f||P(u,1,this.length),this[u]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(u,f){return u=u>>>0,f||P(u,2,this.length),this[u]|this[u+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(u,f){return u=u>>>0,f||P(u,2,this.length),this[u]<<8|this[u+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(u,f){return u=u>>>0,f||P(u,4,this.length),(this[u]|this[u+1]<<8|this[u+2]<<16)+this[u+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(u,f){return u=u>>>0,f||P(u,4,this.length),this[u]*16777216+(this[u+1]<<16|this[u+2]<<8|this[u+3])},a.prototype.readBigUInt64LE=tt(function(u){u=u>>>0,q(u,"offset");const f=this[u],A=this[u+7];(f===void 0||A===void 0)&&J(u,this.length-8);const C=f+this[++u]*2**8+this[++u]*2**16+this[++u]*2**24,R=this[++u]+this[++u]*2**8+this[++u]*2**16+A*2**24;return BigInt(C)+(BigInt(R)<<BigInt(32))}),a.prototype.readBigUInt64BE=tt(function(u){u=u>>>0,q(u,"offset");const f=this[u],A=this[u+7];(f===void 0||A===void 0)&&J(u,this.length-8);const C=f*2**24+this[++u]*2**16+this[++u]*2**8+this[++u],R=this[++u]*2**24+this[++u]*2**16+this[++u]*2**8+A;return(BigInt(C)<<BigInt(32))+BigInt(R)}),a.prototype.readIntLE=function(u,f,A){u=u>>>0,f=f>>>0,A||P(u,f,this.length);let C=this[u],R=1,Z=0;for(;++Z<f&&(R*=256);)C+=this[u+Z]*R;return R*=128,C>=R&&(C-=Math.pow(2,8*f)),C},a.prototype.readIntBE=function(u,f,A){u=u>>>0,f=f>>>0,A||P(u,f,this.length);let C=f,R=1,Z=this[u+--C];for(;C>0&&(R*=256);)Z+=this[u+--C]*R;return R*=128,Z>=R&&(Z-=Math.pow(2,8*f)),Z},a.prototype.readInt8=function(u,f){return u=u>>>0,f||P(u,1,this.length),this[u]&128?(255-this[u]+1)*-1:this[u]},a.prototype.readInt16LE=function(u,f){u=u>>>0,f||P(u,2,this.length);const A=this[u]|this[u+1]<<8;return A&32768?A|4294901760:A},a.prototype.readInt16BE=function(u,f){u=u>>>0,f||P(u,2,this.length);const A=this[u+1]|this[u]<<8;return A&32768?A|4294901760:A},a.prototype.readInt32LE=function(u,f){return u=u>>>0,f||P(u,4,this.length),this[u]|this[u+1]<<8|this[u+2]<<16|this[u+3]<<24},a.prototype.readInt32BE=function(u,f){return u=u>>>0,f||P(u,4,this.length),this[u]<<24|this[u+1]<<16|this[u+2]<<8|this[u+3]},a.prototype.readBigInt64LE=tt(function(u){u=u>>>0,q(u,"offset");const f=this[u],A=this[u+7];(f===void 0||A===void 0)&&J(u,this.length-8);const C=this[u+4]+this[u+5]*2**8+this[u+6]*2**16+(A<<24);return(BigInt(C)<<BigInt(32))+BigInt(f+this[++u]*2**8+this[++u]*2**16+this[++u]*2**24)}),a.prototype.readBigInt64BE=tt(function(u){u=u>>>0,q(u,"offset");const f=this[u],A=this[u+7];(f===void 0||A===void 0)&&J(u,this.length-8);const C=(f<<24)+this[++u]*2**16+this[++u]*2**8+this[++u];return(BigInt(C)<<BigInt(32))+BigInt(this[++u]*2**24+this[++u]*2**16+this[++u]*2**8+A)}),a.prototype.readFloatLE=function(u,f){return u=u>>>0,f||P(u,4,this.length),n.read(this,u,!0,23,4)},a.prototype.readFloatBE=function(u,f){return u=u>>>0,f||P(u,4,this.length),n.read(this,u,!1,23,4)},a.prototype.readDoubleLE=function(u,f){return u=u>>>0,f||P(u,8,this.length),n.read(this,u,!0,52,8)},a.prototype.readDoubleBE=function(u,f){return u=u>>>0,f||P(u,8,this.length),n.read(this,u,!1,52,8)};function j(S,u,f,A,C,R){if(!a.isBuffer(S))throw new TypeError('"buffer" argument must be a Buffer instance');if(u>C||u<R)throw new RangeError('"value" argument is out of bounds');if(f+A>S.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(u,f,A,C){if(u=+u,f=f>>>0,A=A>>>0,!C){const pe=Math.pow(2,8*A)-1;j(this,u,f,A,pe,0)}let R=1,Z=0;for(this[f]=u&255;++Z<A&&(R*=256);)this[f+Z]=u/R&255;return f+A},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(u,f,A,C){if(u=+u,f=f>>>0,A=A>>>0,!C){const pe=Math.pow(2,8*A)-1;j(this,u,f,A,pe,0)}let R=A-1,Z=1;for(this[f+R]=u&255;--R>=0&&(Z*=256);)this[f+R]=u/Z&255;return f+A},a.prototype.writeUint8=a.prototype.writeUInt8=function(u,f,A){return u=+u,f=f>>>0,A||j(this,u,f,1,255,0),this[f]=u&255,f+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(u,f,A){return u=+u,f=f>>>0,A||j(this,u,f,2,65535,0),this[f]=u&255,this[f+1]=u>>>8,f+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(u,f,A){return u=+u,f=f>>>0,A||j(this,u,f,2,65535,0),this[f]=u>>>8,this[f+1]=u&255,f+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(u,f,A){return u=+u,f=f>>>0,A||j(this,u,f,4,4294967295,0),this[f+3]=u>>>24,this[f+2]=u>>>16,this[f+1]=u>>>8,this[f]=u&255,f+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(u,f,A){return u=+u,f=f>>>0,A||j(this,u,f,4,4294967295,0),this[f]=u>>>24,this[f+1]=u>>>16,this[f+2]=u>>>8,this[f+3]=u&255,f+4};function D(S,u,f,A,C){z(u,A,C,S,f,7);let R=Number(u&BigInt(4294967295));S[f++]=R,R=R>>8,S[f++]=R,R=R>>8,S[f++]=R,R=R>>8,S[f++]=R;let Z=Number(u>>BigInt(32)&BigInt(4294967295));return S[f++]=Z,Z=Z>>8,S[f++]=Z,Z=Z>>8,S[f++]=Z,Z=Z>>8,S[f++]=Z,f}function E(S,u,f,A,C){z(u,A,C,S,f,7);let R=Number(u&BigInt(4294967295));S[f+7]=R,R=R>>8,S[f+6]=R,R=R>>8,S[f+5]=R,R=R>>8,S[f+4]=R;let Z=Number(u>>BigInt(32)&BigInt(4294967295));return S[f+3]=Z,Z=Z>>8,S[f+2]=Z,Z=Z>>8,S[f+1]=Z,Z=Z>>8,S[f]=Z,f+8}a.prototype.writeBigUInt64LE=tt(function(u,f=0){return D(this,u,f,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=tt(function(u,f=0){return E(this,u,f,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(u,f,A,C){if(u=+u,f=f>>>0,!C){const Pe=Math.pow(2,8*A-1);j(this,u,f,A,Pe-1,-Pe)}let R=0,Z=1,pe=0;for(this[f]=u&255;++R<A&&(Z*=256);)u<0&&pe===0&&this[f+R-1]!==0&&(pe=1),this[f+R]=(u/Z>>0)-pe&255;return f+A},a.prototype.writeIntBE=function(u,f,A,C){if(u=+u,f=f>>>0,!C){const Pe=Math.pow(2,8*A-1);j(this,u,f,A,Pe-1,-Pe)}let R=A-1,Z=1,pe=0;for(this[f+R]=u&255;--R>=0&&(Z*=256);)u<0&&pe===0&&this[f+R+1]!==0&&(pe=1),this[f+R]=(u/Z>>0)-pe&255;return f+A},a.prototype.writeInt8=function(u,f,A){return u=+u,f=f>>>0,A||j(this,u,f,1,127,-128),u<0&&(u=255+u+1),this[f]=u&255,f+1},a.prototype.writeInt16LE=function(u,f,A){return u=+u,f=f>>>0,A||j(this,u,f,2,32767,-32768),this[f]=u&255,this[f+1]=u>>>8,f+2},a.prototype.writeInt16BE=function(u,f,A){return u=+u,f=f>>>0,A||j(this,u,f,2,32767,-32768),this[f]=u>>>8,this[f+1]=u&255,f+2},a.prototype.writeInt32LE=function(u,f,A){return u=+u,f=f>>>0,A||j(this,u,f,4,2147483647,-2147483648),this[f]=u&255,this[f+1]=u>>>8,this[f+2]=u>>>16,this[f+3]=u>>>24,f+4},a.prototype.writeInt32BE=function(u,f,A){return u=+u,f=f>>>0,A||j(this,u,f,4,2147483647,-2147483648),u<0&&(u=4294967295+u+1),this[f]=u>>>24,this[f+1]=u>>>16,this[f+2]=u>>>8,this[f+3]=u&255,f+4},a.prototype.writeBigInt64LE=tt(function(u,f=0){return D(this,u,f,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=tt(function(u,f=0){return E(this,u,f,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function N(S,u,f,A,C,R){if(f+A>S.length)throw new RangeError("Index out of range");if(f<0)throw new RangeError("Index out of range")}function F(S,u,f,A,C){return u=+u,f=f>>>0,C||N(S,u,f,4),n.write(S,u,f,A,23,4),f+4}a.prototype.writeFloatLE=function(u,f,A){return F(this,u,f,!0,A)},a.prototype.writeFloatBE=function(u,f,A){return F(this,u,f,!1,A)};function Q(S,u,f,A,C){return u=+u,f=f>>>0,C||N(S,u,f,8),n.write(S,u,f,A,52,8),f+8}a.prototype.writeDoubleLE=function(u,f,A){return Q(this,u,f,!0,A)},a.prototype.writeDoubleBE=function(u,f,A){return Q(this,u,f,!1,A)},a.prototype.copy=function(u,f,A,C){if(!a.isBuffer(u))throw new TypeError("argument should be a Buffer");if(A||(A=0),!C&&C!==0&&(C=this.length),f>=u.length&&(f=u.length),f||(f=0),C>0&&C<A&&(C=A),C===A||u.length===0||this.length===0)return 0;if(f<0)throw new RangeError("targetStart out of bounds");if(A<0||A>=this.length)throw new RangeError("Index out of range");if(C<0)throw new RangeError("sourceEnd out of bounds");C>this.length&&(C=this.length),u.length-f<C-A&&(C=u.length-f+A);const R=C-A;return this===u&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(f,A,C):Uint8Array.prototype.set.call(u,this.subarray(A,C),f),R},a.prototype.fill=function(u,f,A,C){if(typeof u=="string"){if(typeof f=="string"?(C=f,f=0,A=this.length):typeof A=="string"&&(C=A,A=this.length),C!==void 0&&typeof C!="string")throw new TypeError("encoding must be a string");if(typeof C=="string"&&!a.isEncoding(C))throw new TypeError("Unknown encoding: "+C);if(u.length===1){const Z=u.charCodeAt(0);(C==="utf8"&&Z<128||C==="latin1")&&(u=Z)}}else typeof u=="number"?u=u&255:typeof u=="boolean"&&(u=Number(u));if(f<0||this.length<f||this.length<A)throw new RangeError("Out of range index");if(A<=f)return this;f=f>>>0,A=A===void 0?this.length:A>>>0,u||(u=0);let R;if(typeof u=="number")for(R=f;R<A;++R)this[R]=u;else{const Z=a.isBuffer(u)?u:a.from(u,C),pe=Z.length;if(pe===0)throw new TypeError('The value "'+u+'" is invalid for argument "value"');for(R=0;R<A-f;++R)this[R+f]=Z[R%pe]}return this};const X={};function he(S,u,f){X[S]=class extends f{constructor(){super(),Object.defineProperty(this,"message",{value:u.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${S}]`,this.stack,delete this.name}get code(){return S}set code(C){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:C,writable:!0})}toString(){return`${this.name} [${S}]: ${this.message}`}}}he("ERR_BUFFER_OUT_OF_BOUNDS",function(S){return S?`${S} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),he("ERR_INVALID_ARG_TYPE",function(S,u){return`The "${S}" argument must be of type number. Received type ${typeof u}`},TypeError),he("ERR_OUT_OF_RANGE",function(S,u,f){let A=`The value of "${S}" is out of range.`,C=f;return Number.isInteger(f)&&Math.abs(f)>2**32?C=ie(String(f)):typeof f=="bigint"&&(C=String(f),(f>BigInt(2)**BigInt(32)||f<-(BigInt(2)**BigInt(32)))&&(C=ie(C)),C+="n"),A+=` It must be ${u}. Received ${C}`,A},RangeError);function ie(S){let u="",f=S.length;const A=S[0]==="-"?1:0;for(;f>=A+4;f-=3)u=`_${S.slice(f-3,f)}${u}`;return`${S.slice(0,f)}${u}`}function x(S,u,f){q(u,"offset"),(S[u]===void 0||S[u+f]===void 0)&&J(u,S.length-(f+1))}function z(S,u,f,A,C,R){if(S>f||S<u){const Z=typeof u=="bigint"?"n":"";let pe;throw u===0||u===BigInt(0)?pe=`>= 0${Z} and < 2${Z} ** ${(R+1)*8}${Z}`:pe=`>= -(2${Z} ** ${(R+1)*8-1}${Z}) and < 2 ** ${(R+1)*8-1}${Z}`,new X.ERR_OUT_OF_RANGE("value",pe,S)}x(A,C,R)}function q(S,u){if(typeof S!="number")throw new X.ERR_INVALID_ARG_TYPE(u,"number",S)}function J(S,u,f){throw Math.floor(S)!==S?(q(S,f),new X.ERR_OUT_OF_RANGE("offset","an integer",S)):u<0?new X.ERR_BUFFER_OUT_OF_BOUNDS:new X.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${u}`,S)}const ee=/[^+/0-9A-Za-z-_]/g;function ae(S){if(S=S.split("=")[0],S=S.trim().replace(ee,""),S.length<2)return"";for(;S.length%4!==0;)S=S+"=";return S}function _e(S,u){u=u||1/0;let f;const A=S.length;let C=null;const R=[];for(let Z=0;Z<A;++Z){if(f=S.charCodeAt(Z),f>55295&&f<57344){if(!C){if(f>56319){(u-=3)>-1&&R.push(239,191,189);continue}else if(Z+1===A){(u-=3)>-1&&R.push(239,191,189);continue}C=f;continue}if(f<56320){(u-=3)>-1&&R.push(239,191,189),C=f;continue}f=(C-55296<<10|f-56320)+65536}else C&&(u-=3)>-1&&R.push(239,191,189);if(C=null,f<128){if((u-=1)<0)break;R.push(f)}else if(f<2048){if((u-=2)<0)break;R.push(f>>6|192,f&63|128)}else if(f<65536){if((u-=3)<0)break;R.push(f>>12|224,f>>6&63|128,f&63|128)}else if(f<1114112){if((u-=4)<0)break;R.push(f>>18|240,f>>12&63|128,f>>6&63|128,f&63|128)}else throw new Error("Invalid code point")}return R}function Me(S){const u=[];for(let f=0;f<S.length;++f)u.push(S.charCodeAt(f)&255);return u}function Ze(S,u){let f,A,C;const R=[];for(let Z=0;Z<S.length&&!((u-=2)<0);++Z)f=S.charCodeAt(Z),A=f>>8,C=f%256,R.push(C),R.push(A);return R}function Ue(S){return e.toByteArray(ae(S))}function Te(S,u,f,A){let C;for(C=0;C<A&&!(C+f>=u.length||C>=S.length);++C)u[C+f]=S[C];return C}function Le(S,u){return S instanceof u||S!=null&&S.constructor!=null&&S.constructor.name!=null&&S.constructor.name===u.name}function Ve(S){return S!==S}const gn=(function(){const S="0123456789abcdef",u=new Array(256);for(let f=0;f<16;++f){const A=f*16;for(let C=0;C<16;++C)u[A+C]=S[f]+S[C]}return u})();function tt(S){return typeof BigInt>"u"?Pt:S}function Pt(){throw new Error("BigInt not supported")}})(Ss)),Ss}var bn=sy();function Zt(t){const e=new ArrayBuffer(4);return new DataView(e).setInt32(0,t,!0),new Uint8Array(e)}class iy extends mi{getNodeDependencies({resolvedInputs:e}){const n=[];for(const r of Object.values(e??{}))for(const s of r)n.push(s.input.instanceId);return n}processNode({instance:e,component:n,resolvedInputs:r,sourceHash:s,state:i}){const o=[];o.push(bn.Buffer.from(e.id)),o.push(Zt(n.definitionHash)),i?.inputHashNonce&&o.push(Zt(i.inputHashNonce)),e.args&&o.push(ty(e.args)),s?o.push(Zt(s)):pi(n)&&this.logger.warn({instanceId:e.id},"missing source hash for unit model, this may lead to incorrect input hash");const a=[...o],c=Object.entries(r).sort(([h],[m])=>h.localeCompare(m)),l=new Set;for(const[h,m]of c){if(Object.keys(m).length===0)continue;a.push(bn.Buffer.from(h));const b=m.map(w=>w.input.instanceId).sort();for(const w of b){const g=this.outputs.get(w);if(!g){this.logger.warn({instanceId:w,dependentInstanceId:e.id},"missing dependency when calculating input hash, this may lead to incorrect input hash");continue}a.push(Zt(g.inputHash)),a.push(Zt(g.outputHash)),l.add(w)}}const d=[],p=Array.from(l).sort();for(const h of p){const m=this.outputs.get(h);if(!m){this.logger.warn({instanceId:h,dependentInstanceId:e.id},"missing dependency when calculating dependency output hash, this may lead to incorrect input hash");continue}d.push(Zt(m.outputHash))}return{selfHash:$s(bn.Buffer.concat(o)),inputHash:$s(bn.Buffer.concat(a)),dependencyOutputHash:$s(bn.Buffer.concat(d)),outputHash:i?.outputHash??0}}}var Wn={exports:{}},Es={},mt={},Ct={},ks={},Is={},As={},ao;function Gr(){return ao||(ao=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class e{}t._CodeOrName=e,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class n extends e{constructor(y){if(super(),!t.IDENTIFIER.test(y))throw new Error("CodeGen: name must be a valid identifier");this.str=y}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=n;class r extends e{constructor(y){super(),this._items=typeof y=="string"?[y]:y}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const y=this._items[0];return y===""||y==='""'}get str(){var y;return(y=this._str)!==null&&y!==void 0?y:this._str=this._items.reduce((_,I)=>`${_}${I}`,"")}get names(){var y;return(y=this._names)!==null&&y!==void 0?y:this._names=this._items.reduce((_,I)=>(I instanceof n&&(_[I.str]=(_[I.str]||0)+1),_),{})}}t._Code=r,t.nil=new r("");function s($,...y){const _=[$[0]];let I=0;for(;I<y.length;)a(_,y[I]),_.push($[++I]);return new r(_)}t._=s;const i=new r("+");function o($,...y){const _=[m($[0])];let I=0;for(;I<y.length;)_.push(i),a(_,y[I]),_.push(i,m($[++I]));return c(_),new r(_)}t.str=o;function a($,y){y instanceof r?$.push(...y._items):y instanceof n?$.push(y):$.push(p(y))}t.addCodeArg=a;function c($){let y=1;for(;y<$.length-1;){if($[y]===i){const _=l($[y-1],$[y+1]);if(_!==void 0){$.splice(y-1,3,_);continue}$[y++]="+"}y++}}function l($,y){if(y==='""')return $;if($==='""')return y;if(typeof $=="string")return y instanceof n||$[$.length-1]!=='"'?void 0:typeof y!="string"?`${$.slice(0,-1)}${y}"`:y[0]==='"'?$.slice(0,-1)+y.slice(1):void 0;if(typeof y=="string"&&y[0]==='"'&&!($ instanceof n))return`"${$}${y.slice(1)}`}function d($,y){return y.emptyStr()?$:$.emptyStr()?y:o`${$}${y}`}t.strConcat=d;function p($){return typeof $=="number"||typeof $=="boolean"||$===null?$:m(Array.isArray($)?$.join(","):$)}function h($){return new r(m($))}t.stringify=h;function m($){return JSON.stringify($).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.safeStringify=m;function b($){return typeof $=="string"&&t.IDENTIFIER.test($)?new r(`.${$}`):s`[${$}]`}t.getProperty=b;function w($){if(typeof $=="string"&&t.IDENTIFIER.test($))return new r(`${$}`);throw new Error(`CodeGen: invalid export name: ${$}, use explicit $id name mapping`)}t.getEsmExportName=w;function g($){return new r($.toString())}t.regexpCode=g})(As)),As}var Os={},co;function uo(){return co||(co=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const e=Gr();class n extends Error{constructor(l){super(`CodeGen: "code" for ${l} not defined`),this.value=l.value}}var r;(function(c){c[c.Started=0]="Started",c[c.Completed=1]="Completed"})(r||(t.UsedValueState=r={})),t.varKinds={const:new e.Name("const"),let:new e.Name("let"),var:new e.Name("var")};class s{constructor({prefixes:l,parent:d}={}){this._names={},this._prefixes=l,this._parent=d}toName(l){return l instanceof e.Name?l:this.name(l)}name(l){return new e.Name(this._newName(l))}_newName(l){const d=this._names[l]||this._nameGroup(l);return`${l}${d.index++}`}_nameGroup(l){var d,p;if(!((p=(d=this._parent)===null||d===void 0?void 0:d._prefixes)===null||p===void 0)&&p.has(l)||this._prefixes&&!this._prefixes.has(l))throw new Error(`CodeGen: prefix "${l}" is not allowed in this scope`);return this._names[l]={prefix:l,index:0}}}t.Scope=s;class i extends e.Name{constructor(l,d){super(d),this.prefix=l}setValue(l,{property:d,itemIndex:p}){this.value=l,this.scopePath=(0,e._)`.${new e.Name(d)}[${p}]`}}t.ValueScopeName=i;const o=(0,e._)`\n`;class a extends s{constructor(l){super(l),this._values={},this._scope=l.scope,this.opts={...l,_n:l.lines?o:e.nil}}get(){return this._scope}name(l){return new i(l,this._newName(l))}value(l,d){var p;if(d.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const h=this.toName(l),{prefix:m}=h,b=(p=d.key)!==null&&p!==void 0?p:d.ref;let w=this._values[m];if(w){const y=w.get(b);if(y)return y}else w=this._values[m]=new Map;w.set(b,h);const g=this._scope[m]||(this._scope[m]=[]),$=g.length;return g[$]=d.ref,h.setValue(d,{property:m,itemIndex:$}),h}getValue(l,d){const p=this._values[l];if(p)return p.get(d)}scopeRefs(l,d=this._values){return this._reduceValues(d,p=>{if(p.scopePath===void 0)throw new Error(`CodeGen: name "${p}" has no value`);return(0,e._)`${l}${p.scopePath}`})}scopeCode(l=this._values,d,p){return this._reduceValues(l,h=>{if(h.value===void 0)throw new Error(`CodeGen: name "${h}" has no value`);return h.value.code},d,p)}_reduceValues(l,d,p={},h){let m=e.nil;for(const b in l){const w=l[b];if(!w)continue;const g=p[b]=p[b]||new Map;w.forEach($=>{if(g.has($))return;g.set($,r.Started);let y=d($);if(y){const _=this.opts.es5?t.varKinds.var:t.varKinds.const;m=(0,e._)`${m}${_} ${$} = ${y};${this.opts._n}`}else if(y=h?.($))m=(0,e._)`${m}${y}${this.opts._n}`;else throw new n($);g.set($,r.Completed)})}return m}}t.ValueScope=a})(Os)),Os}var lo;function me(){return lo||(lo=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;const e=Gr(),n=uo();var r=Gr();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return r.Name}});var s=uo();Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return s.varKinds}}),t.operators={GT:new e._Code(">"),GTE:new e._Code(">="),LT:new e._Code("<"),LTE:new e._Code("<="),EQ:new e._Code("==="),NEQ:new e._Code("!=="),NOT:new e._Code("!"),OR:new e._Code("||"),AND:new e._Code("&&"),ADD:new e._Code("+")};class i{optimizeNodes(){return this}optimizeNames(E,N){return this}}class o extends i{constructor(E,N,F){super(),this.varKind=E,this.name=N,this.rhs=F}render({es5:E,_n:N}){const F=E?n.varKinds.var:this.varKind,Q=this.rhs===void 0?"":` = ${this.rhs}`;return`${F} ${this.name}${Q};`+N}optimizeNames(E,N){if(E[this.name.str])return this.rhs&&(this.rhs=de(this.rhs,E,N)),this}get names(){return this.rhs instanceof e._CodeOrName?this.rhs.names:{}}}class a extends i{constructor(E,N,F){super(),this.lhs=E,this.rhs=N,this.sideEffects=F}render({_n:E}){return`${this.lhs} = ${this.rhs};`+E}optimizeNames(E,N){if(!(this.lhs instanceof e.Name&&!E[this.lhs.str]&&!this.sideEffects))return this.rhs=de(this.rhs,E,N),this}get names(){const E=this.lhs instanceof e.Name?{}:{...this.lhs.names};return se(E,this.rhs)}}class c extends a{constructor(E,N,F,Q){super(E,F,Q),this.op=N}render({_n:E}){return`${this.lhs} ${this.op}= ${this.rhs};`+E}}class l extends i{constructor(E){super(),this.label=E,this.names={}}render({_n:E}){return`${this.label}:`+E}}class d extends i{constructor(E){super(),this.label=E,this.names={}}render({_n:E}){return`break${this.label?` ${this.label}`:""};`+E}}class p extends i{constructor(E){super(),this.error=E}render({_n:E}){return`throw ${this.error};`+E}get names(){return this.error.names}}class h extends i{constructor(E){super(),this.code=E}render({_n:E}){return`${this.code};`+E}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(E,N){return this.code=de(this.code,E,N),this}get names(){return this.code instanceof e._CodeOrName?this.code.names:{}}}class m extends i{constructor(E=[]){super(),this.nodes=E}render(E){return this.nodes.reduce((N,F)=>N+F.render(E),"")}optimizeNodes(){const{nodes:E}=this;let N=E.length;for(;N--;){const F=E[N].optimizeNodes();Array.isArray(F)?E.splice(N,1,...F):F?E[N]=F:E.splice(N,1)}return E.length>0?this:void 0}optimizeNames(E,N){const{nodes:F}=this;let Q=F.length;for(;Q--;){const X=F[Q];X.optimizeNames(E,N)||(M(E,X.names),F.splice(Q,1))}return F.length>0?this:void 0}get names(){return this.nodes.reduce((E,N)=>Y(E,N.names),{})}}class b extends m{render(E){return"{"+E._n+super.render(E)+"}"+E._n}}class w extends m{}class g extends b{}g.kind="else";class $ extends b{constructor(E,N){super(N),this.condition=E}render(E){let N=`if(${this.condition})`+super.render(E);return this.else&&(N+="else "+this.else.render(E)),N}optimizeNodes(){super.optimizeNodes();const E=this.condition;if(E===!0)return this.nodes;let N=this.else;if(N){const F=N.optimizeNodes();N=this.else=Array.isArray(F)?new g(F):F}if(N)return E===!1?N instanceof $?N:N.nodes:this.nodes.length?this:new $(W(E),N instanceof $?[N]:N.nodes);if(!(E===!1||!this.nodes.length))return this}optimizeNames(E,N){var F;if(this.else=(F=this.else)===null||F===void 0?void 0:F.optimizeNames(E,N),!!(super.optimizeNames(E,N)||this.else))return this.condition=de(this.condition,E,N),this}get names(){const E=super.names;return se(E,this.condition),this.else&&Y(E,this.else.names),E}}$.kind="if";class y extends b{}y.kind="for";class _ extends y{constructor(E){super(),this.iteration=E}render(E){return`for(${this.iteration})`+super.render(E)}optimizeNames(E,N){if(super.optimizeNames(E,N))return this.iteration=de(this.iteration,E,N),this}get names(){return Y(super.names,this.iteration.names)}}class I extends y{constructor(E,N,F,Q){super(),this.varKind=E,this.name=N,this.from=F,this.to=Q}render(E){const N=E.es5?n.varKinds.var:this.varKind,{name:F,from:Q,to:X}=this;return`for(${N} ${F}=${Q}; ${F}<${X}; ${F}++)`+super.render(E)}get names(){const E=se(super.names,this.from);return se(E,this.to)}}class v extends y{constructor(E,N,F,Q){super(),this.loop=E,this.varKind=N,this.name=F,this.iterable=Q}render(E){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(E)}optimizeNames(E,N){if(super.optimizeNames(E,N))return this.iterable=de(this.iterable,E,N),this}get names(){return Y(super.names,this.iterable.names)}}class k extends b{constructor(E,N,F){super(),this.name=E,this.args=N,this.async=F}render(E){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(E)}}k.kind="func";class O extends m{render(E){return"return "+super.render(E)}}O.kind="return";class T extends b{render(E){let N="try"+super.render(E);return this.catch&&(N+=this.catch.render(E)),this.finally&&(N+=this.finally.render(E)),N}optimizeNodes(){var E,N;return super.optimizeNodes(),(E=this.catch)===null||E===void 0||E.optimizeNodes(),(N=this.finally)===null||N===void 0||N.optimizeNodes(),this}optimizeNames(E,N){var F,Q;return super.optimizeNames(E,N),(F=this.catch)===null||F===void 0||F.optimizeNames(E,N),(Q=this.finally)===null||Q===void 0||Q.optimizeNames(E,N),this}get names(){const E=super.names;return this.catch&&Y(E,this.catch.names),this.finally&&Y(E,this.finally.names),E}}class L extends b{constructor(E){super(),this.error=E}render(E){return`catch(${this.error})`+super.render(E)}}L.kind="catch";class H extends b{render(E){return"finally"+super.render(E)}}H.kind="finally";class G{constructor(E,N={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...N,_n:N.lines?`
170
+ `:""},this._extScope=E,this._scope=new n.Scope({parent:E}),this._nodes=[new w]}toString(){return this._root.render(this.opts)}name(E){return this._scope.name(E)}scopeName(E){return this._extScope.name(E)}scopeValue(E,N){const F=this._extScope.value(E,N);return(this._values[F.prefix]||(this._values[F.prefix]=new Set)).add(F),F}getScopeValue(E,N){return this._extScope.getValue(E,N)}scopeRefs(E){return this._extScope.scopeRefs(E,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(E,N,F,Q){const X=this._scope.toName(N);return F!==void 0&&Q&&(this._constants[X.str]=F),this._leafNode(new o(E,X,F)),X}const(E,N,F){return this._def(n.varKinds.const,E,N,F)}let(E,N,F){return this._def(n.varKinds.let,E,N,F)}var(E,N,F){return this._def(n.varKinds.var,E,N,F)}assign(E,N,F){return this._leafNode(new a(E,N,F))}add(E,N){return this._leafNode(new c(E,t.operators.ADD,N))}code(E){return typeof E=="function"?E():E!==e.nil&&this._leafNode(new h(E)),this}object(...E){const N=["{"];for(const[F,Q]of E)N.length>1&&N.push(","),N.push(F),(F!==Q||this.opts.es5)&&(N.push(":"),(0,e.addCodeArg)(N,Q));return N.push("}"),new e._Code(N)}if(E,N,F){if(this._blockNode(new $(E)),N&&F)this.code(N).else().code(F).endIf();else if(N)this.code(N).endIf();else if(F)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(E){return this._elseNode(new $(E))}else(){return this._elseNode(new g)}endIf(){return this._endBlockNode($,g)}_for(E,N){return this._blockNode(E),N&&this.code(N).endFor(),this}for(E,N){return this._for(new _(E),N)}forRange(E,N,F,Q,X=this.opts.es5?n.varKinds.var:n.varKinds.let){const he=this._scope.toName(E);return this._for(new I(X,he,N,F),()=>Q(he))}forOf(E,N,F,Q=n.varKinds.const){const X=this._scope.toName(E);if(this.opts.es5){const he=N instanceof e.Name?N:this.var("_arr",N);return this.forRange("_i",0,(0,e._)`${he}.length`,ie=>{this.var(X,(0,e._)`${he}[${ie}]`),F(X)})}return this._for(new v("of",Q,X,N),()=>F(X))}forIn(E,N,F,Q=this.opts.es5?n.varKinds.var:n.varKinds.const){if(this.opts.ownProperties)return this.forOf(E,(0,e._)`Object.keys(${N})`,F);const X=this._scope.toName(E);return this._for(new v("in",Q,X,N),()=>F(X))}endFor(){return this._endBlockNode(y)}label(E){return this._leafNode(new l(E))}break(E){return this._leafNode(new d(E))}return(E){const N=new O;if(this._blockNode(N),this.code(E),N.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(O)}try(E,N,F){if(!N&&!F)throw new Error('CodeGen: "try" without "catch" and "finally"');const Q=new T;if(this._blockNode(Q),this.code(E),N){const X=this.name("e");this._currNode=Q.catch=new L(X),N(X)}return F&&(this._currNode=Q.finally=new H,this.code(F)),this._endBlockNode(L,H)}throw(E){return this._leafNode(new p(E))}block(E,N){return this._blockStarts.push(this._nodes.length),E&&this.code(E).endBlock(N),this}endBlock(E){const N=this._blockStarts.pop();if(N===void 0)throw new Error("CodeGen: not in self-balancing block");const F=this._nodes.length-N;if(F<0||E!==void 0&&F!==E)throw new Error(`CodeGen: wrong number of nodes: ${F} vs ${E} expected`);return this._nodes.length=N,this}func(E,N=e.nil,F,Q){return this._blockNode(new k(E,N,F)),Q&&this.code(Q).endFunc(),this}endFunc(){return this._endBlockNode(k)}optimize(E=1){for(;E-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(E){return this._currNode.nodes.push(E),this}_blockNode(E){this._currNode.nodes.push(E),this._nodes.push(E)}_endBlockNode(E,N){const F=this._currNode;if(F instanceof E||N&&F instanceof N)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${N?`${E.kind}/${N.kind}`:E.kind}"`)}_elseNode(E){const N=this._currNode;if(!(N instanceof $))throw new Error('CodeGen: "else" without "if"');return this._currNode=N.else=E,this}get _root(){return this._nodes[0]}get _currNode(){const E=this._nodes;return E[E.length-1]}set _currNode(E){const N=this._nodes;N[N.length-1]=E}}t.CodeGen=G;function Y(D,E){for(const N in E)D[N]=(D[N]||0)+(E[N]||0);return D}function se(D,E){return E instanceof e._CodeOrName?Y(D,E.names):D}function de(D,E,N){if(D instanceof e.Name)return F(D);if(!Q(D))return D;return new e._Code(D._items.reduce((X,he)=>(he instanceof e.Name&&(he=F(he)),he instanceof e._Code?X.push(...he._items):X.push(he),X),[]));function F(X){const he=N[X.str];return he===void 0||E[X.str]!==1?X:(delete E[X.str],he)}function Q(X){return X instanceof e._Code&&X._items.some(he=>he instanceof e.Name&&E[he.str]===1&&N[he.str]!==void 0)}}function M(D,E){for(const N in E)D[N]=(D[N]||0)-(E[N]||0)}function W(D){return typeof D=="boolean"||typeof D=="number"||D===null?!D:(0,e._)`!${j(D)}`}t.not=W;const re=P(t.operators.AND);function ne(...D){return D.reduce(re)}t.and=ne;const oe=P(t.operators.OR);function K(...D){return D.reduce(oe)}t.or=K;function P(D){return(E,N)=>E===e.nil?N:N===e.nil?E:(0,e._)`${j(E)} ${D} ${j(N)}`}function j(D){return D instanceof e.Name?D:(0,e._)`(${D})`}})(Is)),Is}var le={},fo;function ye(){if(fo)return le;fo=1,Object.defineProperty(le,"__esModule",{value:!0}),le.checkStrictMode=le.getErrorPath=le.Type=le.useFunc=le.setEvaluated=le.evaluatedPropsToName=le.mergeEvaluated=le.eachItem=le.unescapeJsonPointer=le.escapeJsonPointer=le.escapeFragment=le.unescapeFragment=le.schemaRefOrVal=le.schemaHasRulesButRef=le.schemaHasRules=le.checkUnknownRules=le.alwaysValidSchema=le.toHash=void 0;const t=me(),e=Gr();function n(v){const k={};for(const O of v)k[O]=!0;return k}le.toHash=n;function r(v,k){return typeof k=="boolean"?k:Object.keys(k).length===0?!0:(s(v,k),!i(k,v.self.RULES.all))}le.alwaysValidSchema=r;function s(v,k=v.schema){const{opts:O,self:T}=v;if(!O.strictSchema||typeof k=="boolean")return;const L=T.RULES.keywords;for(const H in k)L[H]||I(v,`unknown keyword: "${H}"`)}le.checkUnknownRules=s;function i(v,k){if(typeof v=="boolean")return!v;for(const O in v)if(k[O])return!0;return!1}le.schemaHasRules=i;function o(v,k){if(typeof v=="boolean")return!v;for(const O in v)if(O!=="$ref"&&k.all[O])return!0;return!1}le.schemaHasRulesButRef=o;function a({topSchemaRef:v,schemaPath:k},O,T,L){if(!L){if(typeof O=="number"||typeof O=="boolean")return O;if(typeof O=="string")return(0,t._)`${O}`}return(0,t._)`${v}${k}${(0,t.getProperty)(T)}`}le.schemaRefOrVal=a;function c(v){return p(decodeURIComponent(v))}le.unescapeFragment=c;function l(v){return encodeURIComponent(d(v))}le.escapeFragment=l;function d(v){return typeof v=="number"?`${v}`:v.replace(/~/g,"~0").replace(/\//g,"~1")}le.escapeJsonPointer=d;function p(v){return v.replace(/~1/g,"/").replace(/~0/g,"~")}le.unescapeJsonPointer=p;function h(v,k){if(Array.isArray(v))for(const O of v)k(O);else k(v)}le.eachItem=h;function m({mergeNames:v,mergeToName:k,mergeValues:O,resultToName:T}){return(L,H,G,Y)=>{const se=G===void 0?H:G instanceof t.Name?(H instanceof t.Name?v(L,H,G):k(L,H,G),G):H instanceof t.Name?(k(L,G,H),H):O(H,G);return Y===t.Name&&!(se instanceof t.Name)?T(L,se):se}}le.mergeEvaluated={props:m({mergeNames:(v,k,O)=>v.if((0,t._)`${O} !== true && ${k} !== undefined`,()=>{v.if((0,t._)`${k} === true`,()=>v.assign(O,!0),()=>v.assign(O,(0,t._)`${O} || {}`).code((0,t._)`Object.assign(${O}, ${k})`))}),mergeToName:(v,k,O)=>v.if((0,t._)`${O} !== true`,()=>{k===!0?v.assign(O,!0):(v.assign(O,(0,t._)`${O} || {}`),w(v,O,k))}),mergeValues:(v,k)=>v===!0?!0:{...v,...k},resultToName:b}),items:m({mergeNames:(v,k,O)=>v.if((0,t._)`${O} !== true && ${k} !== undefined`,()=>v.assign(O,(0,t._)`${k} === true ? true : ${O} > ${k} ? ${O} : ${k}`)),mergeToName:(v,k,O)=>v.if((0,t._)`${O} !== true`,()=>v.assign(O,k===!0?!0:(0,t._)`${O} > ${k} ? ${O} : ${k}`)),mergeValues:(v,k)=>v===!0?!0:Math.max(v,k),resultToName:(v,k)=>v.var("items",k)})};function b(v,k){if(k===!0)return v.var("props",!0);const O=v.var("props",(0,t._)`{}`);return k!==void 0&&w(v,O,k),O}le.evaluatedPropsToName=b;function w(v,k,O){Object.keys(O).forEach(T=>v.assign((0,t._)`${k}${(0,t.getProperty)(T)}`,!0))}le.setEvaluated=w;const g={};function $(v,k){return v.scopeValue("func",{ref:k,code:g[k.code]||(g[k.code]=new e._Code(k.code))})}le.useFunc=$;var y;(function(v){v[v.Num=0]="Num",v[v.Str=1]="Str"})(y||(le.Type=y={}));function _(v,k,O){if(v instanceof t.Name){const T=k===y.Num;return O?T?(0,t._)`"[" + ${v} + "]"`:(0,t._)`"['" + ${v} + "']"`:T?(0,t._)`"/" + ${v}`:(0,t._)`"/" + ${v}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return O?(0,t.getProperty)(v).toString():"/"+d(v)}le.getErrorPath=_;function I(v,k,O=v.opts.strictSchema){if(O){if(k=`strict mode: ${k}`,O===!0)throw new Error(k);v.self.logger.warn(k)}}return le.checkStrictMode=I,le}var Yn={},ho;function Tt(){if(ho)return Yn;ho=1,Object.defineProperty(Yn,"__esModule",{value:!0});const t=me(),e={data:new t.Name("data"),valCxt:new t.Name("valCxt"),instancePath:new t.Name("instancePath"),parentData:new t.Name("parentData"),parentDataProperty:new t.Name("parentDataProperty"),rootData:new t.Name("rootData"),dynamicAnchors:new t.Name("dynamicAnchors"),vErrors:new t.Name("vErrors"),errors:new t.Name("errors"),this:new t.Name("this"),self:new t.Name("self"),scope:new t.Name("scope"),json:new t.Name("json"),jsonPos:new t.Name("jsonPos"),jsonLen:new t.Name("jsonLen"),jsonPart:new t.Name("jsonPart")};return Yn.default=e,Yn}var po;function fs(){return po||(po=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;const e=me(),n=ye(),r=Tt();t.keywordError={message:({keyword:g})=>(0,e.str)`must pass "${g}" keyword validation`},t.keyword$DataError={message:({keyword:g,schemaType:$})=>$?(0,e.str)`"${g}" keyword must be ${$} ($data)`:(0,e.str)`"${g}" keyword is invalid ($data)`};function s(g,$=t.keywordError,y,_){const{it:I}=g,{gen:v,compositeRule:k,allErrors:O}=I,T=p(g,$,y);_??(k||O)?c(v,T):l(I,(0,e._)`[${T}]`)}t.reportError=s;function i(g,$=t.keywordError,y){const{it:_}=g,{gen:I,compositeRule:v,allErrors:k}=_,O=p(g,$,y);c(I,O),v||k||l(_,r.default.vErrors)}t.reportExtraError=i;function o(g,$){g.assign(r.default.errors,$),g.if((0,e._)`${r.default.vErrors} !== null`,()=>g.if($,()=>g.assign((0,e._)`${r.default.vErrors}.length`,$),()=>g.assign(r.default.vErrors,null)))}t.resetErrorsCount=o;function a({gen:g,keyword:$,schemaValue:y,data:_,errsCount:I,it:v}){if(I===void 0)throw new Error("ajv implementation error");const k=g.name("err");g.forRange("i",I,r.default.errors,O=>{g.const(k,(0,e._)`${r.default.vErrors}[${O}]`),g.if((0,e._)`${k}.instancePath === undefined`,()=>g.assign((0,e._)`${k}.instancePath`,(0,e.strConcat)(r.default.instancePath,v.errorPath))),g.assign((0,e._)`${k}.schemaPath`,(0,e.str)`${v.errSchemaPath}/${$}`),v.opts.verbose&&(g.assign((0,e._)`${k}.schema`,y),g.assign((0,e._)`${k}.data`,_))})}t.extendErrors=a;function c(g,$){const y=g.const("err",$);g.if((0,e._)`${r.default.vErrors} === null`,()=>g.assign(r.default.vErrors,(0,e._)`[${y}]`),(0,e._)`${r.default.vErrors}.push(${y})`),g.code((0,e._)`${r.default.errors}++`)}function l(g,$){const{gen:y,validateName:_,schemaEnv:I}=g;I.$async?y.throw((0,e._)`new ${g.ValidationError}(${$})`):(y.assign((0,e._)`${_}.errors`,$),y.return(!1))}const d={keyword:new e.Name("keyword"),schemaPath:new e.Name("schemaPath"),params:new e.Name("params"),propertyName:new e.Name("propertyName"),message:new e.Name("message"),schema:new e.Name("schema"),parentSchema:new e.Name("parentSchema")};function p(g,$,y){const{createErrors:_}=g.it;return _===!1?(0,e._)`{}`:h(g,$,y)}function h(g,$,y={}){const{gen:_,it:I}=g,v=[m(I,y),b(g,y)];return w(g,$,v),_.object(...v)}function m({errorPath:g},{instancePath:$}){const y=$?(0,e.str)`${g}${(0,n.getErrorPath)($,n.Type.Str)}`:g;return[r.default.instancePath,(0,e.strConcat)(r.default.instancePath,y)]}function b({keyword:g,it:{errSchemaPath:$}},{schemaPath:y,parentSchema:_}){let I=_?$:(0,e.str)`${$}/${g}`;return y&&(I=(0,e.str)`${I}${(0,n.getErrorPath)(y,n.Type.Str)}`),[d.schemaPath,I]}function w(g,{params:$,message:y},_){const{keyword:I,data:v,schemaValue:k,it:O}=g,{opts:T,propertyName:L,topSchemaRef:H,schemaPath:G}=O;_.push([d.keyword,I],[d.params,typeof $=="function"?$(g):$||(0,e._)`{}`]),T.messages&&_.push([d.message,typeof y=="function"?y(g):y]),T.verbose&&_.push([d.schema,k],[d.parentSchema,(0,e._)`${H}${G}`],[r.default.data,v]),L&&_.push([d.propertyName,L])}})(ks)),ks}var mo;function oy(){if(mo)return Ct;mo=1,Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.boolOrEmptySchema=Ct.topBoolOrEmptySchema=void 0;const t=fs(),e=me(),n=Tt(),r={message:"boolean schema is false"};function s(a){const{gen:c,schema:l,validateName:d}=a;l===!1?o(a,!1):typeof l=="object"&&l.$async===!0?c.return(n.default.data):(c.assign((0,e._)`${d}.errors`,null),c.return(!0))}Ct.topBoolOrEmptySchema=s;function i(a,c){const{gen:l,schema:d}=a;d===!1?(l.var(c,!1),o(a)):l.var(c,!0)}Ct.boolOrEmptySchema=i;function o(a,c){const{gen:l,data:d}=a,p={gen:l,keyword:"false schema",data:d,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:a};(0,t.reportError)(p,r,void 0,c)}return Ct}var qe={},xt={},go;function pu(){if(go)return xt;go=1,Object.defineProperty(xt,"__esModule",{value:!0}),xt.getRules=xt.isJSONType=void 0;const t=["string","number","integer","boolean","null","object","array"],e=new Set(t);function n(s){return typeof s=="string"&&e.has(s)}xt.isJSONType=n;function r(){const s={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...s,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},s.number,s.string,s.array,s.object],post:{rules:[]},all:{},keywords:{}}}return xt.getRules=r,xt}var gt={},yo;function mu(){if(yo)return gt;yo=1,Object.defineProperty(gt,"__esModule",{value:!0}),gt.shouldUseRule=gt.shouldUseGroup=gt.schemaHasRulesForType=void 0;function t({schema:r,self:s},i){const o=s.RULES.types[i];return o&&o!==!0&&e(r,o)}gt.schemaHasRulesForType=t;function e(r,s){return s.rules.some(i=>n(r,i))}gt.shouldUseGroup=e;function n(r,s){var i;return r[s.keyword]!==void 0||((i=s.definition.implements)===null||i===void 0?void 0:i.some(o=>r[o]!==void 0))}return gt.shouldUseRule=n,gt}var wo;function Wr(){if(wo)return qe;wo=1,Object.defineProperty(qe,"__esModule",{value:!0}),qe.reportTypeError=qe.checkDataTypes=qe.checkDataType=qe.coerceAndCheckDataType=qe.getJSONTypes=qe.getSchemaTypes=qe.DataType=void 0;const t=pu(),e=mu(),n=fs(),r=me(),s=ye();var i;(function(y){y[y.Correct=0]="Correct",y[y.Wrong=1]="Wrong"})(i||(qe.DataType=i={}));function o(y){const _=a(y.type);if(_.includes("null")){if(y.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!_.length&&y.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');y.nullable===!0&&_.push("null")}return _}qe.getSchemaTypes=o;function a(y){const _=Array.isArray(y)?y:y?[y]:[];if(_.every(t.isJSONType))return _;throw new Error("type must be JSONType or JSONType[]: "+_.join(","))}qe.getJSONTypes=a;function c(y,_){const{gen:I,data:v,opts:k}=y,O=d(_,k.coerceTypes),T=_.length>0&&!(O.length===0&&_.length===1&&(0,e.schemaHasRulesForType)(y,_[0]));if(T){const L=b(_,v,k.strictNumbers,i.Wrong);I.if(L,()=>{O.length?p(y,_,O):g(y)})}return T}qe.coerceAndCheckDataType=c;const l=new Set(["string","number","integer","boolean","null"]);function d(y,_){return _?y.filter(I=>l.has(I)||_==="array"&&I==="array"):[]}function p(y,_,I){const{gen:v,data:k,opts:O}=y,T=v.let("dataType",(0,r._)`typeof ${k}`),L=v.let("coerced",(0,r._)`undefined`);O.coerceTypes==="array"&&v.if((0,r._)`${T} == 'object' && Array.isArray(${k}) && ${k}.length == 1`,()=>v.assign(k,(0,r._)`${k}[0]`).assign(T,(0,r._)`typeof ${k}`).if(b(_,k,O.strictNumbers),()=>v.assign(L,k))),v.if((0,r._)`${L} !== undefined`);for(const G of I)(l.has(G)||G==="array"&&O.coerceTypes==="array")&&H(G);v.else(),g(y),v.endIf(),v.if((0,r._)`${L} !== undefined`,()=>{v.assign(k,L),h(y,L)});function H(G){switch(G){case"string":v.elseIf((0,r._)`${T} == "number" || ${T} == "boolean"`).assign(L,(0,r._)`"" + ${k}`).elseIf((0,r._)`${k} === null`).assign(L,(0,r._)`""`);return;case"number":v.elseIf((0,r._)`${T} == "boolean" || ${k} === null
171
+ || (${T} == "string" && ${k} && ${k} == +${k})`).assign(L,(0,r._)`+${k}`);return;case"integer":v.elseIf((0,r._)`${T} === "boolean" || ${k} === null
172
+ || (${T} === "string" && ${k} && ${k} == +${k} && !(${k} % 1))`).assign(L,(0,r._)`+${k}`);return;case"boolean":v.elseIf((0,r._)`${k} === "false" || ${k} === 0 || ${k} === null`).assign(L,!1).elseIf((0,r._)`${k} === "true" || ${k} === 1`).assign(L,!0);return;case"null":v.elseIf((0,r._)`${k} === "" || ${k} === 0 || ${k} === false`),v.assign(L,null);return;case"array":v.elseIf((0,r._)`${T} === "string" || ${T} === "number"
173
+ || ${T} === "boolean" || ${k} === null`).assign(L,(0,r._)`[${k}]`)}}}function h({gen:y,parentData:_,parentDataProperty:I},v){y.if((0,r._)`${_} !== undefined`,()=>y.assign((0,r._)`${_}[${I}]`,v))}function m(y,_,I,v=i.Correct){const k=v===i.Correct?r.operators.EQ:r.operators.NEQ;let O;switch(y){case"null":return(0,r._)`${_} ${k} null`;case"array":O=(0,r._)`Array.isArray(${_})`;break;case"object":O=(0,r._)`${_} && typeof ${_} == "object" && !Array.isArray(${_})`;break;case"integer":O=T((0,r._)`!(${_} % 1) && !isNaN(${_})`);break;case"number":O=T();break;default:return(0,r._)`typeof ${_} ${k} ${y}`}return v===i.Correct?O:(0,r.not)(O);function T(L=r.nil){return(0,r.and)((0,r._)`typeof ${_} == "number"`,L,I?(0,r._)`isFinite(${_})`:r.nil)}}qe.checkDataType=m;function b(y,_,I,v){if(y.length===1)return m(y[0],_,I,v);let k;const O=(0,s.toHash)(y);if(O.array&&O.object){const T=(0,r._)`typeof ${_} != "object"`;k=O.null?T:(0,r._)`!${_} || ${T}`,delete O.null,delete O.array,delete O.object}else k=r.nil;O.number&&delete O.integer;for(const T in O)k=(0,r.and)(k,m(T,_,I,v));return k}qe.checkDataTypes=b;const w={message:({schema:y})=>`must be ${y}`,params:({schema:y,schemaValue:_})=>typeof y=="string"?(0,r._)`{type: ${y}}`:(0,r._)`{type: ${_}}`};function g(y){const _=$(y);(0,n.reportError)(_,w)}qe.reportTypeError=g;function $(y){const{gen:_,data:I,schema:v}=y,k=(0,s.schemaRefOrVal)(y,v,"type");return{gen:_,keyword:"type",data:I,schema:v.type,schemaCode:k,schemaValue:k,parentSchema:v,params:{},it:y}}return qe}var _n={},vo;function ay(){if(vo)return _n;vo=1,Object.defineProperty(_n,"__esModule",{value:!0}),_n.assignDefaults=void 0;const t=me(),e=ye();function n(s,i){const{properties:o,items:a}=s.schema;if(i==="object"&&o)for(const c in o)r(s,c,o[c].default);else i==="array"&&Array.isArray(a)&&a.forEach((c,l)=>r(s,l,c.default))}_n.assignDefaults=n;function r(s,i,o){const{gen:a,compositeRule:c,data:l,opts:d}=s;if(o===void 0)return;const p=(0,t._)`${l}${(0,t.getProperty)(i)}`;if(c){(0,e.checkStrictMode)(s,`default is ignored for: ${p}`);return}let h=(0,t._)`${p} === undefined`;d.useDefaults==="empty"&&(h=(0,t._)`${h} || ${p} === null || ${p} === ""`),a.if(h,(0,t._)`${p} = ${(0,t.stringify)(o)}`)}return _n}var at={},be={},bo;function lt(){if(bo)return be;bo=1,Object.defineProperty(be,"__esModule",{value:!0}),be.validateUnion=be.validateArray=be.usePattern=be.callValidateCode=be.schemaProperties=be.allSchemaProperties=be.noPropertyInData=be.propertyInData=be.isOwnProperty=be.hasPropFunc=be.reportMissingProp=be.checkMissingProp=be.checkReportMissingProp=void 0;const t=me(),e=ye(),n=Tt(),r=ye();function s(y,_){const{gen:I,data:v,it:k}=y;I.if(d(I,v,_,k.opts.ownProperties),()=>{y.setParams({missingProperty:(0,t._)`${_}`},!0),y.error()})}be.checkReportMissingProp=s;function i({gen:y,data:_,it:{opts:I}},v,k){return(0,t.or)(...v.map(O=>(0,t.and)(d(y,_,O,I.ownProperties),(0,t._)`${k} = ${O}`)))}be.checkMissingProp=i;function o(y,_){y.setParams({missingProperty:_},!0),y.error()}be.reportMissingProp=o;function a(y){return y.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,t._)`Object.prototype.hasOwnProperty`})}be.hasPropFunc=a;function c(y,_,I){return(0,t._)`${a(y)}.call(${_}, ${I})`}be.isOwnProperty=c;function l(y,_,I,v){const k=(0,t._)`${_}${(0,t.getProperty)(I)} !== undefined`;return v?(0,t._)`${k} && ${c(y,_,I)}`:k}be.propertyInData=l;function d(y,_,I,v){const k=(0,t._)`${_}${(0,t.getProperty)(I)} === undefined`;return v?(0,t.or)(k,(0,t.not)(c(y,_,I))):k}be.noPropertyInData=d;function p(y){return y?Object.keys(y).filter(_=>_!=="__proto__"):[]}be.allSchemaProperties=p;function h(y,_){return p(_).filter(I=>!(0,e.alwaysValidSchema)(y,_[I]))}be.schemaProperties=h;function m({schemaCode:y,data:_,it:{gen:I,topSchemaRef:v,schemaPath:k,errorPath:O},it:T},L,H,G){const Y=G?(0,t._)`${y}, ${_}, ${v}${k}`:_,se=[[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,O)],[n.default.parentData,T.parentData],[n.default.parentDataProperty,T.parentDataProperty],[n.default.rootData,n.default.rootData]];T.opts.dynamicRef&&se.push([n.default.dynamicAnchors,n.default.dynamicAnchors]);const de=(0,t._)`${Y}, ${I.object(...se)}`;return H!==t.nil?(0,t._)`${L}.call(${H}, ${de})`:(0,t._)`${L}(${de})`}be.callValidateCode=m;const b=(0,t._)`new RegExp`;function w({gen:y,it:{opts:_}},I){const v=_.unicodeRegExp?"u":"",{regExp:k}=_.code,O=k(I,v);return y.scopeValue("pattern",{key:O.toString(),ref:O,code:(0,t._)`${k.code==="new RegExp"?b:(0,r.useFunc)(y,k)}(${I}, ${v})`})}be.usePattern=w;function g(y){const{gen:_,data:I,keyword:v,it:k}=y,O=_.name("valid");if(k.allErrors){const L=_.let("valid",!0);return T(()=>_.assign(L,!1)),L}return _.var(O,!0),T(()=>_.break()),O;function T(L){const H=_.const("len",(0,t._)`${I}.length`);_.forRange("i",0,H,G=>{y.subschema({keyword:v,dataProp:G,dataPropType:e.Type.Num},O),_.if((0,t.not)(O),L)})}}be.validateArray=g;function $(y){const{gen:_,schema:I,keyword:v,it:k}=y;if(!Array.isArray(I))throw new Error("ajv implementation error");if(I.some(H=>(0,e.alwaysValidSchema)(k,H))&&!k.opts.unevaluated)return;const T=_.let("valid",!1),L=_.name("_valid");_.block(()=>I.forEach((H,G)=>{const Y=y.subschema({keyword:v,schemaProp:G,compositeRule:!0},L);_.assign(T,(0,t._)`${T} || ${L}`),y.mergeValidEvaluated(Y,L)||_.if((0,t.not)(T))})),y.result(T,()=>y.reset(),()=>y.error(!0))}return be.validateUnion=$,be}var _o;function cy(){if(_o)return at;_o=1,Object.defineProperty(at,"__esModule",{value:!0}),at.validateKeywordUsage=at.validSchemaType=at.funcKeywordCode=at.macroKeywordCode=void 0;const t=me(),e=Tt(),n=lt(),r=fs();function s(h,m){const{gen:b,keyword:w,schema:g,parentSchema:$,it:y}=h,_=m.macro.call(y.self,g,$,y),I=l(b,w,_);y.opts.validateSchema!==!1&&y.self.validateSchema(_,!0);const v=b.name("valid");h.subschema({schema:_,schemaPath:t.nil,errSchemaPath:`${y.errSchemaPath}/${w}`,topSchemaRef:I,compositeRule:!0},v),h.pass(v,()=>h.error(!0))}at.macroKeywordCode=s;function i(h,m){var b;const{gen:w,keyword:g,schema:$,parentSchema:y,$data:_,it:I}=h;c(I,m);const v=!_&&m.compile?m.compile.call(I.self,$,y,I):m.validate,k=l(w,g,v),O=w.let("valid");h.block$data(O,T),h.ok((b=m.valid)!==null&&b!==void 0?b:O);function T(){if(m.errors===!1)G(),m.modifying&&o(h),Y(()=>h.error());else{const se=m.async?L():H();m.modifying&&o(h),Y(()=>a(h,se))}}function L(){const se=w.let("ruleErrs",null);return w.try(()=>G((0,t._)`await `),de=>w.assign(O,!1).if((0,t._)`${de} instanceof ${I.ValidationError}`,()=>w.assign(se,(0,t._)`${de}.errors`),()=>w.throw(de))),se}function H(){const se=(0,t._)`${k}.errors`;return w.assign(se,null),G(t.nil),se}function G(se=m.async?(0,t._)`await `:t.nil){const de=I.opts.passContext?e.default.this:e.default.self,M=!("compile"in m&&!_||m.schema===!1);w.assign(O,(0,t._)`${se}${(0,n.callValidateCode)(h,k,de,M)}`,m.modifying)}function Y(se){var de;w.if((0,t.not)((de=m.valid)!==null&&de!==void 0?de:O),se)}}at.funcKeywordCode=i;function o(h){const{gen:m,data:b,it:w}=h;m.if(w.parentData,()=>m.assign(b,(0,t._)`${w.parentData}[${w.parentDataProperty}]`))}function a(h,m){const{gen:b}=h;b.if((0,t._)`Array.isArray(${m})`,()=>{b.assign(e.default.vErrors,(0,t._)`${e.default.vErrors} === null ? ${m} : ${e.default.vErrors}.concat(${m})`).assign(e.default.errors,(0,t._)`${e.default.vErrors}.length`),(0,r.extendErrors)(h)},()=>h.error())}function c({schemaEnv:h},m){if(m.async&&!h.$async)throw new Error("async keyword in sync schema")}function l(h,m,b){if(b===void 0)throw new Error(`keyword "${m}" failed to compile`);return h.scopeValue("keyword",typeof b=="function"?{ref:b}:{ref:b,code:(0,t.stringify)(b)})}function d(h,m,b=!1){return!m.length||m.some(w=>w==="array"?Array.isArray(h):w==="object"?h&&typeof h=="object"&&!Array.isArray(h):typeof h==w||b&&typeof h>"u")}at.validSchemaType=d;function p({schema:h,opts:m,self:b,errSchemaPath:w},g,$){if(Array.isArray(g.keyword)?!g.keyword.includes($):g.keyword!==$)throw new Error("ajv implementation error");const y=g.dependencies;if(y?.some(_=>!Object.prototype.hasOwnProperty.call(h,_)))throw new Error(`parent schema must have dependencies of ${$}: ${y.join(",")}`);if(g.validateSchema&&!g.validateSchema(h[$])){const I=`keyword "${$}" value is invalid at path "${w}": `+b.errorsText(g.validateSchema.errors);if(m.validateSchema==="log")b.logger.error(I);else throw new Error(I)}}return at.validateKeywordUsage=p,at}var yt={},$o;function uy(){if($o)return yt;$o=1,Object.defineProperty(yt,"__esModule",{value:!0}),yt.extendSubschemaMode=yt.extendSubschemaData=yt.getSubschema=void 0;const t=me(),e=ye();function n(i,{keyword:o,schemaProp:a,schema:c,schemaPath:l,errSchemaPath:d,topSchemaRef:p}){if(o!==void 0&&c!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(o!==void 0){const h=i.schema[o];return a===void 0?{schema:h,schemaPath:(0,t._)`${i.schemaPath}${(0,t.getProperty)(o)}`,errSchemaPath:`${i.errSchemaPath}/${o}`}:{schema:h[a],schemaPath:(0,t._)`${i.schemaPath}${(0,t.getProperty)(o)}${(0,t.getProperty)(a)}`,errSchemaPath:`${i.errSchemaPath}/${o}/${(0,e.escapeFragment)(a)}`}}if(c!==void 0){if(l===void 0||d===void 0||p===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:c,schemaPath:l,topSchemaRef:p,errSchemaPath:d}}throw new Error('either "keyword" or "schema" must be passed')}yt.getSubschema=n;function r(i,o,{dataProp:a,dataPropType:c,data:l,dataTypes:d,propertyName:p}){if(l!==void 0&&a!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:h}=o;if(a!==void 0){const{errorPath:b,dataPathArr:w,opts:g}=o,$=h.let("data",(0,t._)`${o.data}${(0,t.getProperty)(a)}`,!0);m($),i.errorPath=(0,t.str)`${b}${(0,e.getErrorPath)(a,c,g.jsPropertySyntax)}`,i.parentDataProperty=(0,t._)`${a}`,i.dataPathArr=[...w,i.parentDataProperty]}if(l!==void 0){const b=l instanceof t.Name?l:h.let("data",l,!0);m(b),p!==void 0&&(i.propertyName=p)}d&&(i.dataTypes=d);function m(b){i.data=b,i.dataLevel=o.dataLevel+1,i.dataTypes=[],o.definedProperties=new Set,i.parentData=o.data,i.dataNames=[...o.dataNames,b]}}yt.extendSubschemaData=r;function s(i,{jtdDiscriminator:o,jtdMetadata:a,compositeRule:c,createErrors:l,allErrors:d}){c!==void 0&&(i.compositeRule=c),l!==void 0&&(i.createErrors=l),d!==void 0&&(i.allErrors=d),i.jtdDiscriminator=o,i.jtdMetadata=a}return yt.extendSubschemaMode=s,yt}var He={},Ns,So;function gu(){return So||(So=1,Ns=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,s,i;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(s=r;s--!==0;)if(!t(e[s],n[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(i=Object.keys(e),r=i.length,r!==Object.keys(n).length)return!1;for(s=r;s--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[s]))return!1;for(s=r;s--!==0;){var o=i[s];if(!t(e[o],n[o]))return!1}return!0}return e!==e&&n!==n}),Ns}var Ts={exports:{}},Eo;function ly(){if(Eo)return Ts.exports;Eo=1;var t=Ts.exports=function(r,s,i){typeof s=="function"&&(i=s,s={}),i=s.cb||i;var o=typeof i=="function"?i:i.pre||function(){},a=i.post||function(){};e(s,o,a,r,"",r)};t.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},t.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},t.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},t.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function e(r,s,i,o,a,c,l,d,p,h){if(o&&typeof o=="object"&&!Array.isArray(o)){s(o,a,c,l,d,p,h);for(var m in o){var b=o[m];if(Array.isArray(b)){if(m in t.arrayKeywords)for(var w=0;w<b.length;w++)e(r,s,i,b[w],a+"/"+m+"/"+w,c,a,m,o,w)}else if(m in t.propsKeywords){if(b&&typeof b=="object")for(var g in b)e(r,s,i,b[g],a+"/"+m+"/"+n(g),c,a,m,o,g)}else(m in t.keywords||r.allKeys&&!(m in t.skipKeywords))&&e(r,s,i,b,a+"/"+m,c,a,m,o)}i(o,a,c,l,d,p,h)}}function n(r){return r.replace(/~/g,"~0").replace(/\//g,"~1")}return Ts.exports}var ko;function ds(){if(ko)return He;ko=1,Object.defineProperty(He,"__esModule",{value:!0}),He.getSchemaRefs=He.resolveUrl=He.normalizeId=He._getFullPath=He.getFullPath=He.inlineRef=void 0;const t=ye(),e=gu(),n=ly(),r=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function s(w,g=!0){return typeof w=="boolean"?!0:g===!0?!o(w):g?a(w)<=g:!1}He.inlineRef=s;const i=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function o(w){for(const g in w){if(i.has(g))return!0;const $=w[g];if(Array.isArray($)&&$.some(o)||typeof $=="object"&&o($))return!0}return!1}function a(w){let g=0;for(const $ in w){if($==="$ref")return 1/0;if(g++,!r.has($)&&(typeof w[$]=="object"&&(0,t.eachItem)(w[$],y=>g+=a(y)),g===1/0))return 1/0}return g}function c(w,g="",$){$!==!1&&(g=p(g));const y=w.parse(g);return l(w,y)}He.getFullPath=c;function l(w,g){return w.serialize(g).split("#")[0]+"#"}He._getFullPath=l;const d=/#\/?$/;function p(w){return w?w.replace(d,""):""}He.normalizeId=p;function h(w,g,$){return $=p($),w.resolve(g,$)}He.resolveUrl=h;const m=/^[a-z_][-a-z0-9._]*$/i;function b(w,g){if(typeof w=="boolean")return{};const{schemaId:$,uriResolver:y}=this.opts,_=p(w[$]||g),I={"":_},v=c(y,_,!1),k={},O=new Set;return n(w,{allKeys:!0},(H,G,Y,se)=>{if(se===void 0)return;const de=v+G;let M=I[se];typeof H[$]=="string"&&(M=W.call(this,H[$])),re.call(this,H.$anchor),re.call(this,H.$dynamicAnchor),I[G]=M;function W(ne){const oe=this.opts.uriResolver.resolve;if(ne=p(M?oe(M,ne):ne),O.has(ne))throw L(ne);O.add(ne);let K=this.refs[ne];return typeof K=="string"&&(K=this.refs[K]),typeof K=="object"?T(H,K.schema,ne):ne!==p(de)&&(ne[0]==="#"?(T(H,k[ne],ne),k[ne]=H):this.refs[ne]=de),ne}function re(ne){if(typeof ne=="string"){if(!m.test(ne))throw new Error(`invalid anchor "${ne}"`);W.call(this,`#${ne}`)}}}),k;function T(H,G,Y){if(G!==void 0&&!e(H,G))throw L(Y)}function L(H){return new Error(`reference "${H}" resolves to more than one schema`)}}return He.getSchemaRefs=b,He}var Io;function hs(){if(Io)return mt;Io=1,Object.defineProperty(mt,"__esModule",{value:!0}),mt.getData=mt.KeywordCxt=mt.validateFunctionCode=void 0;const t=oy(),e=Wr(),n=mu(),r=Wr(),s=ay(),i=cy(),o=uy(),a=me(),c=Tt(),l=ds(),d=ye(),p=fs();function h(x){if(v(x)&&(O(x),I(x))){g(x);return}m(x,()=>(0,t.topBoolOrEmptySchema)(x))}mt.validateFunctionCode=h;function m({gen:x,validateName:z,schema:q,schemaEnv:J,opts:ee},ae){ee.code.es5?x.func(z,(0,a._)`${c.default.data}, ${c.default.valCxt}`,J.$async,()=>{x.code((0,a._)`"use strict"; ${y(q,ee)}`),w(x,ee),x.code(ae)}):x.func(z,(0,a._)`${c.default.data}, ${b(ee)}`,J.$async,()=>x.code(y(q,ee)).code(ae))}function b(x){return(0,a._)`{${c.default.instancePath}="", ${c.default.parentData}, ${c.default.parentDataProperty}, ${c.default.rootData}=${c.default.data}${x.dynamicRef?(0,a._)`, ${c.default.dynamicAnchors}={}`:a.nil}}={}`}function w(x,z){x.if(c.default.valCxt,()=>{x.var(c.default.instancePath,(0,a._)`${c.default.valCxt}.${c.default.instancePath}`),x.var(c.default.parentData,(0,a._)`${c.default.valCxt}.${c.default.parentData}`),x.var(c.default.parentDataProperty,(0,a._)`${c.default.valCxt}.${c.default.parentDataProperty}`),x.var(c.default.rootData,(0,a._)`${c.default.valCxt}.${c.default.rootData}`),z.dynamicRef&&x.var(c.default.dynamicAnchors,(0,a._)`${c.default.valCxt}.${c.default.dynamicAnchors}`)},()=>{x.var(c.default.instancePath,(0,a._)`""`),x.var(c.default.parentData,(0,a._)`undefined`),x.var(c.default.parentDataProperty,(0,a._)`undefined`),x.var(c.default.rootData,c.default.data),z.dynamicRef&&x.var(c.default.dynamicAnchors,(0,a._)`{}`)})}function g(x){const{schema:z,opts:q,gen:J}=x;m(x,()=>{q.$comment&&z.$comment&&se(x),H(x),J.let(c.default.vErrors,null),J.let(c.default.errors,0),q.unevaluated&&$(x),T(x),de(x)})}function $(x){const{gen:z,validateName:q}=x;x.evaluated=z.const("evaluated",(0,a._)`${q}.evaluated`),z.if((0,a._)`${x.evaluated}.dynamicProps`,()=>z.assign((0,a._)`${x.evaluated}.props`,(0,a._)`undefined`)),z.if((0,a._)`${x.evaluated}.dynamicItems`,()=>z.assign((0,a._)`${x.evaluated}.items`,(0,a._)`undefined`))}function y(x,z){const q=typeof x=="object"&&x[z.schemaId];return q&&(z.code.source||z.code.process)?(0,a._)`/*# sourceURL=${q} */`:a.nil}function _(x,z){if(v(x)&&(O(x),I(x))){k(x,z);return}(0,t.boolOrEmptySchema)(x,z)}function I({schema:x,self:z}){if(typeof x=="boolean")return!x;for(const q in x)if(z.RULES.all[q])return!0;return!1}function v(x){return typeof x.schema!="boolean"}function k(x,z){const{schema:q,gen:J,opts:ee}=x;ee.$comment&&q.$comment&&se(x),G(x),Y(x);const ae=J.const("_errs",c.default.errors);T(x,ae),J.var(z,(0,a._)`${ae} === ${c.default.errors}`)}function O(x){(0,d.checkUnknownRules)(x),L(x)}function T(x,z){if(x.opts.jtd)return W(x,[],!1,z);const q=(0,e.getSchemaTypes)(x.schema),J=(0,e.coerceAndCheckDataType)(x,q);W(x,q,!J,z)}function L(x){const{schema:z,errSchemaPath:q,opts:J,self:ee}=x;z.$ref&&J.ignoreKeywordsWithRef&&(0,d.schemaHasRulesButRef)(z,ee.RULES)&&ee.logger.warn(`$ref: keywords ignored in schema at path "${q}"`)}function H(x){const{schema:z,opts:q}=x;z.default!==void 0&&q.useDefaults&&q.strictSchema&&(0,d.checkStrictMode)(x,"default is ignored in the schema root")}function G(x){const z=x.schema[x.opts.schemaId];z&&(x.baseId=(0,l.resolveUrl)(x.opts.uriResolver,x.baseId,z))}function Y(x){if(x.schema.$async&&!x.schemaEnv.$async)throw new Error("async schema in sync schema")}function se({gen:x,schemaEnv:z,schema:q,errSchemaPath:J,opts:ee}){const ae=q.$comment;if(ee.$comment===!0)x.code((0,a._)`${c.default.self}.logger.log(${ae})`);else if(typeof ee.$comment=="function"){const _e=(0,a.str)`${J}/$comment`,Me=x.scopeValue("root",{ref:z.root});x.code((0,a._)`${c.default.self}.opts.$comment(${ae}, ${_e}, ${Me}.schema)`)}}function de(x){const{gen:z,schemaEnv:q,validateName:J,ValidationError:ee,opts:ae}=x;q.$async?z.if((0,a._)`${c.default.errors} === 0`,()=>z.return(c.default.data),()=>z.throw((0,a._)`new ${ee}(${c.default.vErrors})`)):(z.assign((0,a._)`${J}.errors`,c.default.vErrors),ae.unevaluated&&M(x),z.return((0,a._)`${c.default.errors} === 0`))}function M({gen:x,evaluated:z,props:q,items:J}){q instanceof a.Name&&x.assign((0,a._)`${z}.props`,q),J instanceof a.Name&&x.assign((0,a._)`${z}.items`,J)}function W(x,z,q,J){const{gen:ee,schema:ae,data:_e,allErrors:Me,opts:Ze,self:Ue}=x,{RULES:Te}=Ue;if(ae.$ref&&(Ze.ignoreKeywordsWithRef||!(0,d.schemaHasRulesButRef)(ae,Te))){ee.block(()=>Q(x,"$ref",Te.all.$ref.definition));return}Ze.jtd||ne(x,z),ee.block(()=>{for(const Ve of Te.rules)Le(Ve);Le(Te.post)});function Le(Ve){(0,n.shouldUseGroup)(ae,Ve)&&(Ve.type?(ee.if((0,r.checkDataType)(Ve.type,_e,Ze.strictNumbers)),re(x,Ve),z.length===1&&z[0]===Ve.type&&q&&(ee.else(),(0,r.reportTypeError)(x)),ee.endIf()):re(x,Ve),Me||ee.if((0,a._)`${c.default.errors} === ${J||0}`))}}function re(x,z){const{gen:q,schema:J,opts:{useDefaults:ee}}=x;ee&&(0,s.assignDefaults)(x,z.type),q.block(()=>{for(const ae of z.rules)(0,n.shouldUseRule)(J,ae)&&Q(x,ae.keyword,ae.definition,z.type)})}function ne(x,z){x.schemaEnv.meta||!x.opts.strictTypes||(oe(x,z),x.opts.allowUnionTypes||K(x,z),P(x,x.dataTypes))}function oe(x,z){if(z.length){if(!x.dataTypes.length){x.dataTypes=z;return}z.forEach(q=>{D(x.dataTypes,q)||N(x,`type "${q}" not allowed by context "${x.dataTypes.join(",")}"`)}),E(x,z)}}function K(x,z){z.length>1&&!(z.length===2&&z.includes("null"))&&N(x,"use allowUnionTypes to allow union type keyword")}function P(x,z){const q=x.self.RULES.all;for(const J in q){const ee=q[J];if(typeof ee=="object"&&(0,n.shouldUseRule)(x.schema,ee)){const{type:ae}=ee.definition;ae.length&&!ae.some(_e=>j(z,_e))&&N(x,`missing type "${ae.join(",")}" for keyword "${J}"`)}}}function j(x,z){return x.includes(z)||z==="number"&&x.includes("integer")}function D(x,z){return x.includes(z)||z==="integer"&&x.includes("number")}function E(x,z){const q=[];for(const J of x.dataTypes)D(z,J)?q.push(J):z.includes("integer")&&J==="number"&&q.push("integer");x.dataTypes=q}function N(x,z){const q=x.schemaEnv.baseId+x.errSchemaPath;z+=` at "${q}" (strictTypes)`,(0,d.checkStrictMode)(x,z,x.opts.strictTypes)}class F{constructor(z,q,J){if((0,i.validateKeywordUsage)(z,q,J),this.gen=z.gen,this.allErrors=z.allErrors,this.keyword=J,this.data=z.data,this.schema=z.schema[J],this.$data=q.$data&&z.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,d.schemaRefOrVal)(z,this.schema,J,this.$data),this.schemaType=q.schemaType,this.parentSchema=z.schema,this.params={},this.it=z,this.def=q,this.$data)this.schemaCode=z.gen.const("vSchema",ie(this.$data,z));else if(this.schemaCode=this.schemaValue,!(0,i.validSchemaType)(this.schema,q.schemaType,q.allowUndefined))throw new Error(`${J} value must be ${JSON.stringify(q.schemaType)}`);("code"in q?q.trackErrors:q.errors!==!1)&&(this.errsCount=z.gen.const("_errs",c.default.errors))}result(z,q,J){this.failResult((0,a.not)(z),q,J)}failResult(z,q,J){this.gen.if(z),J?J():this.error(),q?(this.gen.else(),q(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(z,q){this.failResult((0,a.not)(z),void 0,q)}fail(z){if(z===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(z),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(z){if(!this.$data)return this.fail(z);const{schemaCode:q}=this;this.fail((0,a._)`${q} !== undefined && (${(0,a.or)(this.invalid$data(),z)})`)}error(z,q,J){if(q){this.setParams(q),this._error(z,J),this.setParams({});return}this._error(z,J)}_error(z,q){(z?p.reportExtraError:p.reportError)(this,this.def.error,q)}$dataError(){(0,p.reportError)(this,this.def.$dataError||p.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,p.resetErrorsCount)(this.gen,this.errsCount)}ok(z){this.allErrors||this.gen.if(z)}setParams(z,q){q?Object.assign(this.params,z):this.params=z}block$data(z,q,J=a.nil){this.gen.block(()=>{this.check$data(z,J),q()})}check$data(z=a.nil,q=a.nil){if(!this.$data)return;const{gen:J,schemaCode:ee,schemaType:ae,def:_e}=this;J.if((0,a.or)((0,a._)`${ee} === undefined`,q)),z!==a.nil&&J.assign(z,!0),(ae.length||_e.validateSchema)&&(J.elseIf(this.invalid$data()),this.$dataError(),z!==a.nil&&J.assign(z,!1)),J.else()}invalid$data(){const{gen:z,schemaCode:q,schemaType:J,def:ee,it:ae}=this;return(0,a.or)(_e(),Me());function _e(){if(J.length){if(!(q instanceof a.Name))throw new Error("ajv implementation error");const Ze=Array.isArray(J)?J:[J];return(0,a._)`${(0,r.checkDataTypes)(Ze,q,ae.opts.strictNumbers,r.DataType.Wrong)}`}return a.nil}function Me(){if(ee.validateSchema){const Ze=z.scopeValue("validate$data",{ref:ee.validateSchema});return(0,a._)`!${Ze}(${q})`}return a.nil}}subschema(z,q){const J=(0,o.getSubschema)(this.it,z);(0,o.extendSubschemaData)(J,this.it,z),(0,o.extendSubschemaMode)(J,z);const ee={...this.it,...J,items:void 0,props:void 0};return _(ee,q),ee}mergeEvaluated(z,q){const{it:J,gen:ee}=this;J.opts.unevaluated&&(J.props!==!0&&z.props!==void 0&&(J.props=d.mergeEvaluated.props(ee,z.props,J.props,q)),J.items!==!0&&z.items!==void 0&&(J.items=d.mergeEvaluated.items(ee,z.items,J.items,q)))}mergeValidEvaluated(z,q){const{it:J,gen:ee}=this;if(J.opts.unevaluated&&(J.props!==!0||J.items!==!0))return ee.if(q,()=>this.mergeEvaluated(z,a.Name)),!0}}mt.KeywordCxt=F;function Q(x,z,q,J){const ee=new F(x,q,z);"code"in q?q.code(ee,J):ee.$data&&q.validate?(0,i.funcKeywordCode)(ee,q):"macro"in q?(0,i.macroKeywordCode)(ee,q):(q.compile||q.validate)&&(0,i.funcKeywordCode)(ee,q)}const X=/^\/(?:[^~]|~0|~1)*$/,he=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function ie(x,{dataLevel:z,dataNames:q,dataPathArr:J}){let ee,ae;if(x==="")return c.default.rootData;if(x[0]==="/"){if(!X.test(x))throw new Error(`Invalid JSON-pointer: ${x}`);ee=x,ae=c.default.rootData}else{const Ue=he.exec(x);if(!Ue)throw new Error(`Invalid JSON-pointer: ${x}`);const Te=+Ue[1];if(ee=Ue[2],ee==="#"){if(Te>=z)throw new Error(Ze("property/index",Te));return J[z-Te]}if(Te>z)throw new Error(Ze("data",Te));if(ae=q[z-Te],!ee)return ae}let _e=ae;const Me=ee.split("/");for(const Ue of Me)Ue&&(ae=(0,a._)`${ae}${(0,a.getProperty)((0,d.unescapeJsonPointer)(Ue))}`,_e=(0,a._)`${_e} && ${ae}`);return _e;function Ze(Ue,Te){return`Cannot access ${Ue} ${Te} levels up, current level is ${z}`}}return mt.getData=ie,mt}var Xn={},Ao;function wi(){if(Ao)return Xn;Ao=1,Object.defineProperty(Xn,"__esModule",{value:!0});class t extends Error{constructor(n){super("validation failed"),this.errors=n,this.ajv=this.validation=!0}}return Xn.default=t,Xn}var Qn={},Oo;function ps(){if(Oo)return Qn;Oo=1,Object.defineProperty(Qn,"__esModule",{value:!0});const t=ds();class e extends Error{constructor(r,s,i,o){super(o||`can't resolve reference ${i} from id ${s}`),this.missingRef=(0,t.resolveUrl)(r,s,i),this.missingSchema=(0,t.normalizeId)((0,t.getFullPath)(r,this.missingRef))}}return Qn.default=e,Qn}var et={},No;function vi(){if(No)return et;No=1,Object.defineProperty(et,"__esModule",{value:!0}),et.resolveSchema=et.getCompilingSchema=et.resolveRef=et.compileSchema=et.SchemaEnv=void 0;const t=me(),e=wi(),n=Tt(),r=ds(),s=ye(),i=hs();class o{constructor($){var y;this.refs={},this.dynamicAnchors={};let _;typeof $.schema=="object"&&(_=$.schema),this.schema=$.schema,this.schemaId=$.schemaId,this.root=$.root||this,this.baseId=(y=$.baseId)!==null&&y!==void 0?y:(0,r.normalizeId)(_?.[$.schemaId||"$id"]),this.schemaPath=$.schemaPath,this.localRefs=$.localRefs,this.meta=$.meta,this.$async=_?.$async,this.refs={}}}et.SchemaEnv=o;function a(g){const $=d.call(this,g);if($)return $;const y=(0,r.getFullPath)(this.opts.uriResolver,g.root.baseId),{es5:_,lines:I}=this.opts.code,{ownProperties:v}=this.opts,k=new t.CodeGen(this.scope,{es5:_,lines:I,ownProperties:v});let O;g.$async&&(O=k.scopeValue("Error",{ref:e.default,code:(0,t._)`require("ajv/dist/runtime/validation_error").default`}));const T=k.scopeName("validate");g.validateName=T;const L={gen:k,allErrors:this.opts.allErrors,data:n.default.data,parentData:n.default.parentData,parentDataProperty:n.default.parentDataProperty,dataNames:[n.default.data],dataPathArr:[t.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:k.scopeValue("schema",this.opts.code.source===!0?{ref:g.schema,code:(0,t.stringify)(g.schema)}:{ref:g.schema}),validateName:T,ValidationError:O,schema:g.schema,schemaEnv:g,rootId:y,baseId:g.baseId||y,schemaPath:t.nil,errSchemaPath:g.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,t._)`""`,opts:this.opts,self:this};let H;try{this._compilations.add(g),(0,i.validateFunctionCode)(L),k.optimize(this.opts.code.optimize);const G=k.toString();H=`${k.scopeRefs(n.default.scope)}return ${G}`,this.opts.code.process&&(H=this.opts.code.process(H,g));const se=new Function(`${n.default.self}`,`${n.default.scope}`,H)(this,this.scope.get());if(this.scope.value(T,{ref:se}),se.errors=null,se.schema=g.schema,se.schemaEnv=g,g.$async&&(se.$async=!0),this.opts.code.source===!0&&(se.source={validateName:T,validateCode:G,scopeValues:k._values}),this.opts.unevaluated){const{props:de,items:M}=L;se.evaluated={props:de instanceof t.Name?void 0:de,items:M instanceof t.Name?void 0:M,dynamicProps:de instanceof t.Name,dynamicItems:M instanceof t.Name},se.source&&(se.source.evaluated=(0,t.stringify)(se.evaluated))}return g.validate=se,g}catch(G){throw delete g.validate,delete g.validateName,H&&this.logger.error("Error compiling schema, function code:",H),G}finally{this._compilations.delete(g)}}et.compileSchema=a;function c(g,$,y){var _;y=(0,r.resolveUrl)(this.opts.uriResolver,$,y);const I=g.refs[y];if(I)return I;let v=h.call(this,g,y);if(v===void 0){const k=(_=g.localRefs)===null||_===void 0?void 0:_[y],{schemaId:O}=this.opts;k&&(v=new o({schema:k,schemaId:O,root:g,baseId:$}))}if(v!==void 0)return g.refs[y]=l.call(this,v)}et.resolveRef=c;function l(g){return(0,r.inlineRef)(g.schema,this.opts.inlineRefs)?g.schema:g.validate?g:a.call(this,g)}function d(g){for(const $ of this._compilations)if(p($,g))return $}et.getCompilingSchema=d;function p(g,$){return g.schema===$.schema&&g.root===$.root&&g.baseId===$.baseId}function h(g,$){let y;for(;typeof(y=this.refs[$])=="string";)$=y;return y||this.schemas[$]||m.call(this,g,$)}function m(g,$){const y=this.opts.uriResolver.parse($),_=(0,r._getFullPath)(this.opts.uriResolver,y);let I=(0,r.getFullPath)(this.opts.uriResolver,g.baseId,void 0);if(Object.keys(g.schema).length>0&&_===I)return w.call(this,y,g);const v=(0,r.normalizeId)(_),k=this.refs[v]||this.schemas[v];if(typeof k=="string"){const O=m.call(this,g,k);return typeof O?.schema!="object"?void 0:w.call(this,y,O)}if(typeof k?.schema=="object"){if(k.validate||a.call(this,k),v===(0,r.normalizeId)($)){const{schema:O}=k,{schemaId:T}=this.opts,L=O[T];return L&&(I=(0,r.resolveUrl)(this.opts.uriResolver,I,L)),new o({schema:O,schemaId:T,root:g,baseId:I})}return w.call(this,y,k)}}et.resolveSchema=m;const b=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function w(g,{baseId:$,schema:y,root:_}){var I;if(((I=g.fragment)===null||I===void 0?void 0:I[0])!=="/")return;for(const O of g.fragment.slice(1).split("/")){if(typeof y=="boolean")return;const T=y[(0,s.unescapeFragment)(O)];if(T===void 0)return;y=T;const L=typeof y=="object"&&y[this.opts.schemaId];!b.has(O)&&L&&($=(0,r.resolveUrl)(this.opts.uriResolver,$,L))}let v;if(typeof y!="boolean"&&y.$ref&&!(0,s.schemaHasRulesButRef)(y,this.RULES)){const O=(0,r.resolveUrl)(this.opts.uriResolver,$,y.$ref);v=m.call(this,_,O)}const{schemaId:k}=this.opts;if(v=v||new o({schema:y,schemaId:k,root:_,baseId:$}),v.schema!==v.root.schema)return v}return et}const fy="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",dy="Meta-schema for $data reference (JSON AnySchema extension proposal)",hy="object",py=["$data"],my={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},gy=!1;var yy={$id:fy,description:dy,type:hy,required:py,properties:my,additionalProperties:gy},er={},$n={exports:{}},Ps,To;function yu(){if(To)return Ps;To=1;const t=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),e=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function n(h){let m="",b=0,w=0;for(w=0;w<h.length;w++)if(b=h[w].charCodeAt(0),b!==48){if(!(b>=48&&b<=57||b>=65&&b<=70||b>=97&&b<=102))return"";m+=h[w];break}for(w+=1;w<h.length;w++){if(b=h[w].charCodeAt(0),!(b>=48&&b<=57||b>=65&&b<=70||b>=97&&b<=102))return"";m+=h[w]}return m}const r=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function s(h){return h.length=0,!0}function i(h,m,b){if(h.length){const w=n(h);if(w!=="")m.push(w);else return b.error=!0,!1;h.length=0}return!0}function o(h){let m=0;const b={error:!1,address:"",zone:""},w=[],g=[];let $=!1,y=!1,_=i;for(let I=0;I<h.length;I++){const v=h[I];if(!(v==="["||v==="]"))if(v===":"){if($===!0&&(y=!0),!_(g,w,b))break;if(++m>7){b.error=!0;break}I>0&&h[I-1]===":"&&($=!0),w.push(":");continue}else if(v==="%"){if(!_(g,w,b))break;_=s}else{g.push(v);continue}}return g.length&&(_===s?b.zone=g.join(""):y?w.push(g.join("")):w.push(n(g))),b.address=w.join(""),b}function a(h){if(c(h,":")<2)return{host:h,isIPV6:!1};const m=o(h);if(m.error)return{host:h,isIPV6:!1};{let b=m.address,w=m.address;return m.zone&&(b+="%"+m.zone,w+="%25"+m.zone),{host:b,isIPV6:!0,escapedHost:w}}}function c(h,m){let b=0;for(let w=0;w<h.length;w++)h[w]===m&&b++;return b}function l(h){let m=h;const b=[];let w=-1,g=0;for(;g=m.length;){if(g===1){if(m===".")break;if(m==="/"){b.push("/");break}else{b.push(m);break}}else if(g===2){if(m[0]==="."){if(m[1]===".")break;if(m[1]==="/"){m=m.slice(2);continue}}else if(m[0]==="/"&&(m[1]==="."||m[1]==="/")){b.push("/");break}}else if(g===3&&m==="/.."){b.length!==0&&b.pop(),b.push("/");break}if(m[0]==="."){if(m[1]==="."){if(m[2]==="/"){m=m.slice(3);continue}}else if(m[1]==="/"){m=m.slice(2);continue}}else if(m[0]==="/"&&m[1]==="."){if(m[2]==="/"){m=m.slice(2);continue}else if(m[2]==="."&&m[3]==="/"){m=m.slice(3),b.length!==0&&b.pop();continue}}if((w=m.indexOf("/",1))===-1){b.push(m);break}else b.push(m.slice(0,w)),m=m.slice(w)}return b.join("")}function d(h,m){const b=m!==!0?escape:unescape;return h.scheme!==void 0&&(h.scheme=b(h.scheme)),h.userinfo!==void 0&&(h.userinfo=b(h.userinfo)),h.host!==void 0&&(h.host=b(h.host)),h.path!==void 0&&(h.path=b(h.path)),h.query!==void 0&&(h.query=b(h.query)),h.fragment!==void 0&&(h.fragment=b(h.fragment)),h}function p(h){const m=[];if(h.userinfo!==void 0&&(m.push(h.userinfo),m.push("@")),h.host!==void 0){let b=unescape(h.host);if(!e(b)){const w=a(b);w.isIPV6===!0?b=`[${w.escapedHost}]`:b=h.host}m.push(b)}return(typeof h.port=="number"||typeof h.port=="string")&&(m.push(":"),m.push(String(h.port))),m.length?m.join(""):void 0}return Ps={nonSimpleDomain:r,recomposeAuthority:p,normalizeComponentEncoding:d,removeDotSegments:l,isIPv4:e,isUUID:t,normalizeIPv6:a,stringArrayToHexStripped:n},Ps}var Cs,Po;function wy(){if(Po)return Cs;Po=1;const{isUUID:t}=yu(),e=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,n=["http","https","ws","wss","urn","urn:uuid"];function r(v){return n.indexOf(v)!==-1}function s(v){return v.secure===!0?!0:v.secure===!1?!1:v.scheme?v.scheme.length===3&&(v.scheme[0]==="w"||v.scheme[0]==="W")&&(v.scheme[1]==="s"||v.scheme[1]==="S")&&(v.scheme[2]==="s"||v.scheme[2]==="S"):!1}function i(v){return v.host||(v.error=v.error||"HTTP URIs must have a host."),v}function o(v){const k=String(v.scheme).toLowerCase()==="https";return(v.port===(k?443:80)||v.port==="")&&(v.port=void 0),v.path||(v.path="/"),v}function a(v){return v.secure=s(v),v.resourceName=(v.path||"/")+(v.query?"?"+v.query:""),v.path=void 0,v.query=void 0,v}function c(v){if((v.port===(s(v)?443:80)||v.port==="")&&(v.port=void 0),typeof v.secure=="boolean"&&(v.scheme=v.secure?"wss":"ws",v.secure=void 0),v.resourceName){const[k,O]=v.resourceName.split("?");v.path=k&&k!=="/"?k:void 0,v.query=O,v.resourceName=void 0}return v.fragment=void 0,v}function l(v,k){if(!v.path)return v.error="URN can not be parsed",v;const O=v.path.match(e);if(O){const T=k.scheme||v.scheme||"urn";v.nid=O[1].toLowerCase(),v.nss=O[2];const L=`${T}:${k.nid||v.nid}`,H=I(L);v.path=void 0,H&&(v=H.parse(v,k))}else v.error=v.error||"URN can not be parsed.";return v}function d(v,k){if(v.nid===void 0)throw new Error("URN without nid cannot be serialized");const O=k.scheme||v.scheme||"urn",T=v.nid.toLowerCase(),L=`${O}:${k.nid||T}`,H=I(L);H&&(v=H.serialize(v,k));const G=v,Y=v.nss;return G.path=`${T||k.nid}:${Y}`,k.skipEscape=!0,G}function p(v,k){const O=v;return O.uuid=O.nss,O.nss=void 0,!k.tolerant&&(!O.uuid||!t(O.uuid))&&(O.error=O.error||"UUID is not valid."),O}function h(v){const k=v;return k.nss=(v.uuid||"").toLowerCase(),k}const m={scheme:"http",domainHost:!0,parse:i,serialize:o},b={scheme:"https",domainHost:m.domainHost,parse:i,serialize:o},w={scheme:"ws",domainHost:!0,parse:a,serialize:c},g={scheme:"wss",domainHost:w.domainHost,parse:w.parse,serialize:w.serialize},_={http:m,https:b,ws:w,wss:g,urn:{scheme:"urn",parse:l,serialize:d,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:p,serialize:h,skipNormalize:!0}};Object.setPrototypeOf(_,null);function I(v){return v&&(_[v]||_[v.toLowerCase()])||void 0}return Cs={wsIsSecure:s,SCHEMES:_,isValidSchemeName:r,getSchemeHandler:I},Cs}var Co;function vy(){if(Co)return $n.exports;Co=1;const{normalizeIPv6:t,removeDotSegments:e,recomposeAuthority:n,normalizeComponentEncoding:r,isIPv4:s,nonSimpleDomain:i}=yu(),{SCHEMES:o,getSchemeHandler:a}=wy();function c(g,$){return typeof g=="string"?g=h(b(g,$),$):typeof g=="object"&&(g=b(h(g,$),$)),g}function l(g,$,y){const _=y?Object.assign({scheme:"null"},y):{scheme:"null"},I=d(b(g,_),b($,_),_,!0);return _.skipEscape=!0,h(I,_)}function d(g,$,y,_){const I={};return _||(g=b(h(g,y),y),$=b(h($,y),y)),y=y||{},!y.tolerant&&$.scheme?(I.scheme=$.scheme,I.userinfo=$.userinfo,I.host=$.host,I.port=$.port,I.path=e($.path||""),I.query=$.query):($.userinfo!==void 0||$.host!==void 0||$.port!==void 0?(I.userinfo=$.userinfo,I.host=$.host,I.port=$.port,I.path=e($.path||""),I.query=$.query):($.path?($.path[0]==="/"?I.path=e($.path):((g.userinfo!==void 0||g.host!==void 0||g.port!==void 0)&&!g.path?I.path="/"+$.path:g.path?I.path=g.path.slice(0,g.path.lastIndexOf("/")+1)+$.path:I.path=$.path,I.path=e(I.path)),I.query=$.query):(I.path=g.path,$.query!==void 0?I.query=$.query:I.query=g.query),I.userinfo=g.userinfo,I.host=g.host,I.port=g.port),I.scheme=g.scheme),I.fragment=$.fragment,I}function p(g,$,y){return typeof g=="string"?(g=unescape(g),g=h(r(b(g,y),!0),{...y,skipEscape:!0})):typeof g=="object"&&(g=h(r(g,!0),{...y,skipEscape:!0})),typeof $=="string"?($=unescape($),$=h(r(b($,y),!0),{...y,skipEscape:!0})):typeof $=="object"&&($=h(r($,!0),{...y,skipEscape:!0})),g.toLowerCase()===$.toLowerCase()}function h(g,$){const y={host:g.host,scheme:g.scheme,userinfo:g.userinfo,port:g.port,path:g.path,query:g.query,nid:g.nid,nss:g.nss,uuid:g.uuid,fragment:g.fragment,reference:g.reference,resourceName:g.resourceName,secure:g.secure,error:""},_=Object.assign({},$),I=[],v=a(_.scheme||y.scheme);v&&v.serialize&&v.serialize(y,_),y.path!==void 0&&(_.skipEscape?y.path=unescape(y.path):(y.path=escape(y.path),y.scheme!==void 0&&(y.path=y.path.split("%3A").join(":")))),_.reference!=="suffix"&&y.scheme&&I.push(y.scheme,":");const k=n(y);if(k!==void 0&&(_.reference!=="suffix"&&I.push("//"),I.push(k),y.path&&y.path[0]!=="/"&&I.push("/")),y.path!==void 0){let O=y.path;!_.absolutePath&&(!v||!v.absolutePath)&&(O=e(O)),k===void 0&&O[0]==="/"&&O[1]==="/"&&(O="/%2F"+O.slice(2)),I.push(O)}return y.query!==void 0&&I.push("?",y.query),y.fragment!==void 0&&I.push("#",y.fragment),I.join("")}const m=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function b(g,$){const y=Object.assign({},$),_={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let I=!1;y.reference==="suffix"&&(y.scheme?g=y.scheme+":"+g:g="//"+g);const v=g.match(m);if(v){if(_.scheme=v[1],_.userinfo=v[3],_.host=v[4],_.port=parseInt(v[5],10),_.path=v[6]||"",_.query=v[7],_.fragment=v[8],isNaN(_.port)&&(_.port=v[5]),_.host)if(s(_.host)===!1){const T=t(_.host);_.host=T.host.toLowerCase(),I=T.isIPV6}else I=!0;_.scheme===void 0&&_.userinfo===void 0&&_.host===void 0&&_.port===void 0&&_.query===void 0&&!_.path?_.reference="same-document":_.scheme===void 0?_.reference="relative":_.fragment===void 0?_.reference="absolute":_.reference="uri",y.reference&&y.reference!=="suffix"&&y.reference!==_.reference&&(_.error=_.error||"URI is not a "+y.reference+" reference.");const k=a(y.scheme||_.scheme);if(!y.unicodeSupport&&(!k||!k.unicodeSupport)&&_.host&&(y.domainHost||k&&k.domainHost)&&I===!1&&i(_.host))try{_.host=URL.domainToASCII(_.host.toLowerCase())}catch(O){_.error=_.error||"Host's domain name can not be converted to ASCII: "+O}(!k||k&&!k.skipNormalize)&&(g.indexOf("%")!==-1&&(_.scheme!==void 0&&(_.scheme=unescape(_.scheme)),_.host!==void 0&&(_.host=unescape(_.host))),_.path&&(_.path=escape(unescape(_.path))),_.fragment&&(_.fragment=encodeURI(decodeURIComponent(_.fragment)))),k&&k.parse&&k.parse(_,y)}else _.error=_.error||"URI can not be parsed.";return _}const w={SCHEMES:o,normalize:c,resolve:l,resolveComponent:d,equal:p,serialize:h,parse:b};return $n.exports=w,$n.exports.default=w,$n.exports.fastUri=w,$n.exports}var xo;function by(){if(xo)return er;xo=1,Object.defineProperty(er,"__esModule",{value:!0});const t=vy();return t.code='require("ajv/dist/runtime/uri").default',er.default=t,er}var Bo;function _y(){return Bo||(Bo=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var e=hs();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return e.KeywordCxt}});var n=me();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return n.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return n.CodeGen}});const r=wi(),s=ps(),i=pu(),o=vi(),a=me(),c=ds(),l=Wr(),d=ye(),p=yy,h=by(),m=(K,P)=>new RegExp(K,P);m.code="new RegExp";const b=["removeAdditional","useDefaults","coerceTypes"],w=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),g={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},$={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},y=200;function _(K){var P,j,D,E,N,F,Q,X,he,ie,x,z,q,J,ee,ae,_e,Me,Ze,Ue,Te,Le,Ve,gn,tt;const Pt=K.strict,S=(P=K.code)===null||P===void 0?void 0:P.optimize,u=S===!0||S===void 0?1:S||0,f=(D=(j=K.code)===null||j===void 0?void 0:j.regExp)!==null&&D!==void 0?D:m,A=(E=K.uriResolver)!==null&&E!==void 0?E:h.default;return{strictSchema:(F=(N=K.strictSchema)!==null&&N!==void 0?N:Pt)!==null&&F!==void 0?F:!0,strictNumbers:(X=(Q=K.strictNumbers)!==null&&Q!==void 0?Q:Pt)!==null&&X!==void 0?X:!0,strictTypes:(ie=(he=K.strictTypes)!==null&&he!==void 0?he:Pt)!==null&&ie!==void 0?ie:"log",strictTuples:(z=(x=K.strictTuples)!==null&&x!==void 0?x:Pt)!==null&&z!==void 0?z:"log",strictRequired:(J=(q=K.strictRequired)!==null&&q!==void 0?q:Pt)!==null&&J!==void 0?J:!1,code:K.code?{...K.code,optimize:u,regExp:f}:{optimize:u,regExp:f},loopRequired:(ee=K.loopRequired)!==null&&ee!==void 0?ee:y,loopEnum:(ae=K.loopEnum)!==null&&ae!==void 0?ae:y,meta:(_e=K.meta)!==null&&_e!==void 0?_e:!0,messages:(Me=K.messages)!==null&&Me!==void 0?Me:!0,inlineRefs:(Ze=K.inlineRefs)!==null&&Ze!==void 0?Ze:!0,schemaId:(Ue=K.schemaId)!==null&&Ue!==void 0?Ue:"$id",addUsedSchema:(Te=K.addUsedSchema)!==null&&Te!==void 0?Te:!0,validateSchema:(Le=K.validateSchema)!==null&&Le!==void 0?Le:!0,validateFormats:(Ve=K.validateFormats)!==null&&Ve!==void 0?Ve:!0,unicodeRegExp:(gn=K.unicodeRegExp)!==null&&gn!==void 0?gn:!0,int32range:(tt=K.int32range)!==null&&tt!==void 0?tt:!0,uriResolver:A}}class I{constructor(P={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,P=this.opts={...P,..._(P)};const{es5:j,lines:D}=this.opts.code;this.scope=new a.ValueScope({scope:{},prefixes:w,es5:j,lines:D}),this.logger=Y(P.logger);const E=P.validateFormats;P.validateFormats=!1,this.RULES=(0,i.getRules)(),v.call(this,g,P,"NOT SUPPORTED"),v.call(this,$,P,"DEPRECATED","warn"),this._metaOpts=H.call(this),P.formats&&T.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),P.keywords&&L.call(this,P.keywords),typeof P.meta=="object"&&this.addMetaSchema(P.meta),O.call(this),P.validateFormats=E}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:P,meta:j,schemaId:D}=this.opts;let E=p;D==="id"&&(E={...p},E.id=E.$id,delete E.$id),j&&P&&this.addMetaSchema(E,E[D],!1)}defaultMeta(){const{meta:P,schemaId:j}=this.opts;return this.opts.defaultMeta=typeof P=="object"?P[j]||P:void 0}validate(P,j){let D;if(typeof P=="string"){if(D=this.getSchema(P),!D)throw new Error(`no schema with key or ref "${P}"`)}else D=this.compile(P);const E=D(j);return"$async"in D||(this.errors=D.errors),E}compile(P,j){const D=this._addSchema(P,j);return D.validate||this._compileSchemaEnv(D)}compileAsync(P,j){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:D}=this.opts;return E.call(this,P,j);async function E(ie,x){await N.call(this,ie.$schema);const z=this._addSchema(ie,x);return z.validate||F.call(this,z)}async function N(ie){ie&&!this.getSchema(ie)&&await E.call(this,{$ref:ie},!0)}async function F(ie){try{return this._compileSchemaEnv(ie)}catch(x){if(!(x instanceof s.default))throw x;return Q.call(this,x),await X.call(this,x.missingSchema),F.call(this,ie)}}function Q({missingSchema:ie,missingRef:x}){if(this.refs[ie])throw new Error(`AnySchema ${ie} is loaded but ${x} cannot be resolved`)}async function X(ie){const x=await he.call(this,ie);this.refs[ie]||await N.call(this,x.$schema),this.refs[ie]||this.addSchema(x,ie,j)}async function he(ie){const x=this._loading[ie];if(x)return x;try{return await(this._loading[ie]=D(ie))}finally{delete this._loading[ie]}}}addSchema(P,j,D,E=this.opts.validateSchema){if(Array.isArray(P)){for(const F of P)this.addSchema(F,void 0,D,E);return this}let N;if(typeof P=="object"){const{schemaId:F}=this.opts;if(N=P[F],N!==void 0&&typeof N!="string")throw new Error(`schema ${F} must be string`)}return j=(0,c.normalizeId)(j||N),this._checkUnique(j),this.schemas[j]=this._addSchema(P,D,j,E,!0),this}addMetaSchema(P,j,D=this.opts.validateSchema){return this.addSchema(P,j,!0,D),this}validateSchema(P,j){if(typeof P=="boolean")return!0;let D;if(D=P.$schema,D!==void 0&&typeof D!="string")throw new Error("$schema must be a string");if(D=D||this.opts.defaultMeta||this.defaultMeta(),!D)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const E=this.validate(D,P);if(!E&&j){const N="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(N);else throw new Error(N)}return E}getSchema(P){let j;for(;typeof(j=k.call(this,P))=="string";)P=j;if(j===void 0){const{schemaId:D}=this.opts,E=new o.SchemaEnv({schema:{},schemaId:D});if(j=o.resolveSchema.call(this,E,P),!j)return;this.refs[P]=j}return j.validate||this._compileSchemaEnv(j)}removeSchema(P){if(P instanceof RegExp)return this._removeAllSchemas(this.schemas,P),this._removeAllSchemas(this.refs,P),this;switch(typeof P){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const j=k.call(this,P);return typeof j=="object"&&this._cache.delete(j.schema),delete this.schemas[P],delete this.refs[P],this}case"object":{const j=P;this._cache.delete(j);let D=P[this.opts.schemaId];return D&&(D=(0,c.normalizeId)(D),delete this.schemas[D],delete this.refs[D]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(P){for(const j of P)this.addKeyword(j);return this}addKeyword(P,j){let D;if(typeof P=="string")D=P,typeof j=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),j.keyword=D);else if(typeof P=="object"&&j===void 0){if(j=P,D=j.keyword,Array.isArray(D)&&!D.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(de.call(this,D,j),!j)return(0,d.eachItem)(D,N=>M.call(this,N)),this;re.call(this,j);const E={...j,type:(0,l.getJSONTypes)(j.type),schemaType:(0,l.getJSONTypes)(j.schemaType)};return(0,d.eachItem)(D,E.type.length===0?N=>M.call(this,N,E):N=>E.type.forEach(F=>M.call(this,N,E,F))),this}getKeyword(P){const j=this.RULES.all[P];return typeof j=="object"?j.definition:!!j}removeKeyword(P){const{RULES:j}=this;delete j.keywords[P],delete j.all[P];for(const D of j.rules){const E=D.rules.findIndex(N=>N.keyword===P);E>=0&&D.rules.splice(E,1)}return this}addFormat(P,j){return typeof j=="string"&&(j=new RegExp(j)),this.formats[P]=j,this}errorsText(P=this.errors,{separator:j=", ",dataVar:D="data"}={}){return!P||P.length===0?"No errors":P.map(E=>`${D}${E.instancePath} ${E.message}`).reduce((E,N)=>E+j+N)}$dataMetaSchema(P,j){const D=this.RULES.all;P=JSON.parse(JSON.stringify(P));for(const E of j){const N=E.split("/").slice(1);let F=P;for(const Q of N)F=F[Q];for(const Q in D){const X=D[Q];if(typeof X!="object")continue;const{$data:he}=X.definition,ie=F[Q];he&&ie&&(F[Q]=oe(ie))}}return P}_removeAllSchemas(P,j){for(const D in P){const E=P[D];(!j||j.test(D))&&(typeof E=="string"?delete P[D]:E&&!E.meta&&(this._cache.delete(E.schema),delete P[D]))}}_addSchema(P,j,D,E=this.opts.validateSchema,N=this.opts.addUsedSchema){let F;const{schemaId:Q}=this.opts;if(typeof P=="object")F=P[Q];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof P!="boolean")throw new Error("schema must be object or boolean")}let X=this._cache.get(P);if(X!==void 0)return X;D=(0,c.normalizeId)(F||D);const he=c.getSchemaRefs.call(this,P,D);return X=new o.SchemaEnv({schema:P,schemaId:Q,meta:j,baseId:D,localRefs:he}),this._cache.set(X.schema,X),N&&!D.startsWith("#")&&(D&&this._checkUnique(D),this.refs[D]=X),E&&this.validateSchema(P,!0),X}_checkUnique(P){if(this.schemas[P]||this.refs[P])throw new Error(`schema with key or id "${P}" already exists`)}_compileSchemaEnv(P){if(P.meta?this._compileMetaSchema(P):o.compileSchema.call(this,P),!P.validate)throw new Error("ajv implementation error");return P.validate}_compileMetaSchema(P){const j=this.opts;this.opts=this._metaOpts;try{o.compileSchema.call(this,P)}finally{this.opts=j}}}I.ValidationError=r.default,I.MissingRefError=s.default,t.default=I;function v(K,P,j,D="error"){for(const E in K){const N=E;N in P&&this.logger[D](`${j}: option ${E}. ${K[N]}`)}}function k(K){return K=(0,c.normalizeId)(K),this.schemas[K]||this.refs[K]}function O(){const K=this.opts.schemas;if(K)if(Array.isArray(K))this.addSchema(K);else for(const P in K)this.addSchema(K[P],P)}function T(){for(const K in this.opts.formats){const P=this.opts.formats[K];P&&this.addFormat(K,P)}}function L(K){if(Array.isArray(K)){this.addVocabulary(K);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const P in K){const j=K[P];j.keyword||(j.keyword=P),this.addKeyword(j)}}function H(){const K={...this.opts};for(const P of b)delete K[P];return K}const G={log(){},warn(){},error(){}};function Y(K){if(K===!1)return G;if(K===void 0)return console;if(K.log&&K.warn&&K.error)return K;throw new Error("logger must implement log, warn and error methods")}const se=/^[a-z_$][a-z0-9_$:-]*$/i;function de(K,P){const{RULES:j}=this;if((0,d.eachItem)(K,D=>{if(j.keywords[D])throw new Error(`Keyword ${D} is already defined`);if(!se.test(D))throw new Error(`Keyword ${D} has invalid name`)}),!!P&&P.$data&&!("code"in P||"validate"in P))throw new Error('$data keyword must have "code" or "validate" function')}function M(K,P,j){var D;const E=P?.post;if(j&&E)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:N}=this;let F=E?N.post:N.rules.find(({type:X})=>X===j);if(F||(F={type:j,rules:[]},N.rules.push(F)),N.keywords[K]=!0,!P)return;const Q={keyword:K,definition:{...P,type:(0,l.getJSONTypes)(P.type),schemaType:(0,l.getJSONTypes)(P.schemaType)}};P.before?W.call(this,F,Q,P.before):F.rules.push(Q),N.all[K]=Q,(D=P.implements)===null||D===void 0||D.forEach(X=>this.addKeyword(X))}function W(K,P,j){const D=K.rules.findIndex(E=>E.keyword===j);D>=0?K.rules.splice(D,0,P):(K.rules.push(P),this.logger.warn(`rule ${j} is not defined`))}function re(K){let{metaSchema:P}=K;P!==void 0&&(K.$data&&this.opts.$data&&(P=oe(P)),K.validateSchema=this.compile(P,!0))}const ne={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function oe(K){return{anyOf:[K,ne]}}})(Es)),Es}var tr={},nr={},rr={},Do;function $y(){if(Do)return rr;Do=1,Object.defineProperty(rr,"__esModule",{value:!0});const t={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return rr.default=t,rr}var $t={},zo;function Sy(){if(zo)return $t;zo=1,Object.defineProperty($t,"__esModule",{value:!0}),$t.callRef=$t.getValidate=void 0;const t=ps(),e=lt(),n=me(),r=Tt(),s=vi(),i=ye(),o={keyword:"$ref",schemaType:"string",code(l){const{gen:d,schema:p,it:h}=l,{baseId:m,schemaEnv:b,validateName:w,opts:g,self:$}=h,{root:y}=b;if((p==="#"||p==="#/")&&m===y.baseId)return I();const _=s.resolveRef.call($,y,m,p);if(_===void 0)throw new t.default(h.opts.uriResolver,m,p);if(_ instanceof s.SchemaEnv)return v(_);return k(_);function I(){if(b===y)return c(l,w,b,b.$async);const O=d.scopeValue("root",{ref:y});return c(l,(0,n._)`${O}.validate`,y,y.$async)}function v(O){const T=a(l,O);c(l,T,O,O.$async)}function k(O){const T=d.scopeValue("schema",g.code.source===!0?{ref:O,code:(0,n.stringify)(O)}:{ref:O}),L=d.name("valid"),H=l.subschema({schema:O,dataTypes:[],schemaPath:n.nil,topSchemaRef:T,errSchemaPath:p},L);l.mergeEvaluated(H),l.ok(L)}}};function a(l,d){const{gen:p}=l;return d.validate?p.scopeValue("validate",{ref:d.validate}):(0,n._)`${p.scopeValue("wrapper",{ref:d})}.validate`}$t.getValidate=a;function c(l,d,p,h){const{gen:m,it:b}=l,{allErrors:w,schemaEnv:g,opts:$}=b,y=$.passContext?r.default.this:n.nil;h?_():I();function _(){if(!g.$async)throw new Error("async schema referenced by sync schema");const O=m.let("valid");m.try(()=>{m.code((0,n._)`await ${(0,e.callValidateCode)(l,d,y)}`),k(d),w||m.assign(O,!0)},T=>{m.if((0,n._)`!(${T} instanceof ${b.ValidationError})`,()=>m.throw(T)),v(T),w||m.assign(O,!1)}),l.ok(O)}function I(){l.result((0,e.callValidateCode)(l,d,y),()=>k(d),()=>v(d))}function v(O){const T=(0,n._)`${O}.errors`;m.assign(r.default.vErrors,(0,n._)`${r.default.vErrors} === null ? ${T} : ${r.default.vErrors}.concat(${T})`),m.assign(r.default.errors,(0,n._)`${r.default.vErrors}.length`)}function k(O){var T;if(!b.opts.unevaluated)return;const L=(T=p?.validate)===null||T===void 0?void 0:T.evaluated;if(b.props!==!0)if(L&&!L.dynamicProps)L.props!==void 0&&(b.props=i.mergeEvaluated.props(m,L.props,b.props));else{const H=m.var("props",(0,n._)`${O}.evaluated.props`);b.props=i.mergeEvaluated.props(m,H,b.props,n.Name)}if(b.items!==!0)if(L&&!L.dynamicItems)L.items!==void 0&&(b.items=i.mergeEvaluated.items(m,L.items,b.items));else{const H=m.var("items",(0,n._)`${O}.evaluated.items`);b.items=i.mergeEvaluated.items(m,H,b.items,n.Name)}}}return $t.callRef=c,$t.default=o,$t}var Ro;function Ey(){if(Ro)return nr;Ro=1,Object.defineProperty(nr,"__esModule",{value:!0});const t=$y(),e=Sy(),n=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",t.default,e.default];return nr.default=n,nr}var sr={},ir={},jo;function ky(){if(jo)return ir;jo=1,Object.defineProperty(ir,"__esModule",{value:!0});const t=me(),e=t.operators,n={maximum:{okStr:"<=",ok:e.LTE,fail:e.GT},minimum:{okStr:">=",ok:e.GTE,fail:e.LT},exclusiveMaximum:{okStr:"<",ok:e.LT,fail:e.GTE},exclusiveMinimum:{okStr:">",ok:e.GT,fail:e.LTE}},r={message:({keyword:i,schemaCode:o})=>(0,t.str)`must be ${n[i].okStr} ${o}`,params:({keyword:i,schemaCode:o})=>(0,t._)`{comparison: ${n[i].okStr}, limit: ${o}}`},s={keyword:Object.keys(n),type:"number",schemaType:"number",$data:!0,error:r,code(i){const{keyword:o,data:a,schemaCode:c}=i;i.fail$data((0,t._)`${a} ${n[o].fail} ${c} || isNaN(${a})`)}};return ir.default=s,ir}var or={},Fo;function Iy(){if(Fo)return or;Fo=1,Object.defineProperty(or,"__esModule",{value:!0});const t=me(),n={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:r})=>(0,t.str)`must be multiple of ${r}`,params:({schemaCode:r})=>(0,t._)`{multipleOf: ${r}}`},code(r){const{gen:s,data:i,schemaCode:o,it:a}=r,c=a.opts.multipleOfPrecision,l=s.let("res"),d=c?(0,t._)`Math.abs(Math.round(${l}) - ${l}) > 1e-${c}`:(0,t._)`${l} !== parseInt(${l})`;r.fail$data((0,t._)`(${o} === 0 || (${l} = ${i}/${o}, ${d}))`)}};return or.default=n,or}var ar={},cr={},Mo;function Ay(){if(Mo)return cr;Mo=1,Object.defineProperty(cr,"__esModule",{value:!0});function t(e){const n=e.length;let r=0,s=0,i;for(;s<n;)r++,i=e.charCodeAt(s++),i>=55296&&i<=56319&&s<n&&(i=e.charCodeAt(s),(i&64512)===56320&&s++);return r}return cr.default=t,t.code='require("ajv/dist/runtime/ucs2length").default',cr}var Uo;function Oy(){if(Uo)return ar;Uo=1,Object.defineProperty(ar,"__esModule",{value:!0});const t=me(),e=ye(),n=Ay(),s={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:i,schemaCode:o}){const a=i==="maxLength"?"more":"fewer";return(0,t.str)`must NOT have ${a} than ${o} characters`},params:({schemaCode:i})=>(0,t._)`{limit: ${i}}`},code(i){const{keyword:o,data:a,schemaCode:c,it:l}=i,d=o==="maxLength"?t.operators.GT:t.operators.LT,p=l.opts.unicode===!1?(0,t._)`${a}.length`:(0,t._)`${(0,e.useFunc)(i.gen,n.default)}(${a})`;i.fail$data((0,t._)`${p} ${d} ${c}`)}};return ar.default=s,ar}var ur={},Lo;function Ny(){if(Lo)return ur;Lo=1,Object.defineProperty(ur,"__esModule",{value:!0});const t=lt(),e=ye(),n=me(),s={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:i})=>(0,n.str)`must match pattern "${i}"`,params:({schemaCode:i})=>(0,n._)`{pattern: ${i}}`},code(i){const{gen:o,data:a,$data:c,schema:l,schemaCode:d,it:p}=i,h=p.opts.unicodeRegExp?"u":"";if(c){const{regExp:m}=p.opts.code,b=m.code==="new RegExp"?(0,n._)`new RegExp`:(0,e.useFunc)(o,m),w=o.let("valid");o.try(()=>o.assign(w,(0,n._)`${b}(${d}, ${h}).test(${a})`),()=>o.assign(w,!1)),i.fail$data((0,n._)`!${w}`)}else{const m=(0,t.usePattern)(i,l);i.fail$data((0,n._)`!${m}.test(${a})`)}}};return ur.default=s,ur}var lr={},qo;function Ty(){if(qo)return lr;qo=1,Object.defineProperty(lr,"__esModule",{value:!0});const t=me(),n={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:r,schemaCode:s}){const i=r==="maxProperties"?"more":"fewer";return(0,t.str)`must NOT have ${i} than ${s} properties`},params:({schemaCode:r})=>(0,t._)`{limit: ${r}}`},code(r){const{keyword:s,data:i,schemaCode:o}=r,a=s==="maxProperties"?t.operators.GT:t.operators.LT;r.fail$data((0,t._)`Object.keys(${i}).length ${a} ${o}`)}};return lr.default=n,lr}var fr={},Zo;function Py(){if(Zo)return fr;Zo=1,Object.defineProperty(fr,"__esModule",{value:!0});const t=lt(),e=me(),n=ye(),s={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:i}})=>(0,e.str)`must have required property '${i}'`,params:({params:{missingProperty:i}})=>(0,e._)`{missingProperty: ${i}}`},code(i){const{gen:o,schema:a,schemaCode:c,data:l,$data:d,it:p}=i,{opts:h}=p;if(!d&&a.length===0)return;const m=a.length>=h.loopRequired;if(p.allErrors?b():w(),h.strictRequired){const y=i.parentSchema.properties,{definedProperties:_}=i.it;for(const I of a)if(y?.[I]===void 0&&!_.has(I)){const v=p.schemaEnv.baseId+p.errSchemaPath,k=`required property "${I}" is not defined at "${v}" (strictRequired)`;(0,n.checkStrictMode)(p,k,p.opts.strictRequired)}}function b(){if(m||d)i.block$data(e.nil,g);else for(const y of a)(0,t.checkReportMissingProp)(i,y)}function w(){const y=o.let("missing");if(m||d){const _=o.let("valid",!0);i.block$data(_,()=>$(y,_)),i.ok(_)}else o.if((0,t.checkMissingProp)(i,a,y)),(0,t.reportMissingProp)(i,y),o.else()}function g(){o.forOf("prop",c,y=>{i.setParams({missingProperty:y}),o.if((0,t.noPropertyInData)(o,l,y,h.ownProperties),()=>i.error())})}function $(y,_){i.setParams({missingProperty:y}),o.forOf(y,c,()=>{o.assign(_,(0,t.propertyInData)(o,l,y,h.ownProperties)),o.if((0,e.not)(_),()=>{i.error(),o.break()})},e.nil)}}};return fr.default=s,fr}var dr={},Vo;function Cy(){if(Vo)return dr;Vo=1,Object.defineProperty(dr,"__esModule",{value:!0});const t=me(),n={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:r,schemaCode:s}){const i=r==="maxItems"?"more":"fewer";return(0,t.str)`must NOT have ${i} than ${s} items`},params:({schemaCode:r})=>(0,t._)`{limit: ${r}}`},code(r){const{keyword:s,data:i,schemaCode:o}=r,a=s==="maxItems"?t.operators.GT:t.operators.LT;r.fail$data((0,t._)`${i}.length ${a} ${o}`)}};return dr.default=n,dr}var hr={},pr={},Ko;function bi(){if(Ko)return pr;Ko=1,Object.defineProperty(pr,"__esModule",{value:!0});const t=gu();return t.code='require("ajv/dist/runtime/equal").default',pr.default=t,pr}var Jo;function xy(){if(Jo)return hr;Jo=1,Object.defineProperty(hr,"__esModule",{value:!0});const t=Wr(),e=me(),n=ye(),r=bi(),i={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:o,j:a}})=>(0,e.str)`must NOT have duplicate items (items ## ${a} and ${o} are identical)`,params:({params:{i:o,j:a}})=>(0,e._)`{i: ${o}, j: ${a}}`},code(o){const{gen:a,data:c,$data:l,schema:d,parentSchema:p,schemaCode:h,it:m}=o;if(!l&&!d)return;const b=a.let("valid"),w=p.items?(0,t.getSchemaTypes)(p.items):[];o.block$data(b,g,(0,e._)`${h} === false`),o.ok(b);function g(){const I=a.let("i",(0,e._)`${c}.length`),v=a.let("j");o.setParams({i:I,j:v}),a.assign(b,!0),a.if((0,e._)`${I} > 1`,()=>($()?y:_)(I,v))}function $(){return w.length>0&&!w.some(I=>I==="object"||I==="array")}function y(I,v){const k=a.name("item"),O=(0,t.checkDataTypes)(w,k,m.opts.strictNumbers,t.DataType.Wrong),T=a.const("indices",(0,e._)`{}`);a.for((0,e._)`;${I}--;`,()=>{a.let(k,(0,e._)`${c}[${I}]`),a.if(O,(0,e._)`continue`),w.length>1&&a.if((0,e._)`typeof ${k} == "string"`,(0,e._)`${k} += "_"`),a.if((0,e._)`typeof ${T}[${k}] == "number"`,()=>{a.assign(v,(0,e._)`${T}[${k}]`),o.error(),a.assign(b,!1).break()}).code((0,e._)`${T}[${k}] = ${I}`)})}function _(I,v){const k=(0,n.useFunc)(a,r.default),O=a.name("outer");a.label(O).for((0,e._)`;${I}--;`,()=>a.for((0,e._)`${v} = ${I}; ${v}--;`,()=>a.if((0,e._)`${k}(${c}[${I}], ${c}[${v}])`,()=>{o.error(),a.assign(b,!1).break(O)})))}}};return hr.default=i,hr}var mr={},Ho;function By(){if(Ho)return mr;Ho=1,Object.defineProperty(mr,"__esModule",{value:!0});const t=me(),e=ye(),n=bi(),s={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:i})=>(0,t._)`{allowedValue: ${i}}`},code(i){const{gen:o,data:a,$data:c,schemaCode:l,schema:d}=i;c||d&&typeof d=="object"?i.fail$data((0,t._)`!${(0,e.useFunc)(o,n.default)}(${a}, ${l})`):i.fail((0,t._)`${d} !== ${a}`)}};return mr.default=s,mr}var gr={},Go;function Dy(){if(Go)return gr;Go=1,Object.defineProperty(gr,"__esModule",{value:!0});const t=me(),e=ye(),n=bi(),s={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:i})=>(0,t._)`{allowedValues: ${i}}`},code(i){const{gen:o,data:a,$data:c,schema:l,schemaCode:d,it:p}=i;if(!c&&l.length===0)throw new Error("enum must have non-empty array");const h=l.length>=p.opts.loopEnum;let m;const b=()=>m??(m=(0,e.useFunc)(o,n.default));let w;if(h||c)w=o.let("valid"),i.block$data(w,g);else{if(!Array.isArray(l))throw new Error("ajv implementation error");const y=o.const("vSchema",d);w=(0,t.or)(...l.map((_,I)=>$(y,I)))}i.pass(w);function g(){o.assign(w,!1),o.forOf("v",d,y=>o.if((0,t._)`${b()}(${a}, ${y})`,()=>o.assign(w,!0).break()))}function $(y,_){const I=l[_];return typeof I=="object"&&I!==null?(0,t._)`${b()}(${a}, ${y}[${_}])`:(0,t._)`${a} === ${I}`}}};return gr.default=s,gr}var Wo;function zy(){if(Wo)return sr;Wo=1,Object.defineProperty(sr,"__esModule",{value:!0});const t=ky(),e=Iy(),n=Oy(),r=Ny(),s=Ty(),i=Py(),o=Cy(),a=xy(),c=By(),l=Dy(),d=[t.default,e.default,n.default,r.default,s.default,i.default,o.default,a.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},c.default,l.default];return sr.default=d,sr}var yr={},Vt={},Yo;function wu(){if(Yo)return Vt;Yo=1,Object.defineProperty(Vt,"__esModule",{value:!0}),Vt.validateAdditionalItems=void 0;const t=me(),e=ye(),r={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:i}})=>(0,t.str)`must NOT have more than ${i} items`,params:({params:{len:i}})=>(0,t._)`{limit: ${i}}`},code(i){const{parentSchema:o,it:a}=i,{items:c}=o;if(!Array.isArray(c)){(0,e.checkStrictMode)(a,'"additionalItems" is ignored when "items" is not an array of schemas');return}s(i,c)}};function s(i,o){const{gen:a,schema:c,data:l,keyword:d,it:p}=i;p.items=!0;const h=a.const("len",(0,t._)`${l}.length`);if(c===!1)i.setParams({len:o.length}),i.pass((0,t._)`${h} <= ${o.length}`);else if(typeof c=="object"&&!(0,e.alwaysValidSchema)(p,c)){const b=a.var("valid",(0,t._)`${h} <= ${o.length}`);a.if((0,t.not)(b),()=>m(b)),i.ok(b)}function m(b){a.forRange("i",o.length,h,w=>{i.subschema({keyword:d,dataProp:w,dataPropType:e.Type.Num},b),p.allErrors||a.if((0,t.not)(b),()=>a.break())})}}return Vt.validateAdditionalItems=s,Vt.default=r,Vt}var wr={},Kt={},Xo;function vu(){if(Xo)return Kt;Xo=1,Object.defineProperty(Kt,"__esModule",{value:!0}),Kt.validateTuple=void 0;const t=me(),e=ye(),n=lt(),r={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(i){const{schema:o,it:a}=i;if(Array.isArray(o))return s(i,"additionalItems",o);a.items=!0,!(0,e.alwaysValidSchema)(a,o)&&i.ok((0,n.validateArray)(i))}};function s(i,o,a=i.schema){const{gen:c,parentSchema:l,data:d,keyword:p,it:h}=i;w(l),h.opts.unevaluated&&a.length&&h.items!==!0&&(h.items=e.mergeEvaluated.items(c,a.length,h.items));const m=c.name("valid"),b=c.const("len",(0,t._)`${d}.length`);a.forEach((g,$)=>{(0,e.alwaysValidSchema)(h,g)||(c.if((0,t._)`${b} > ${$}`,()=>i.subschema({keyword:p,schemaProp:$,dataProp:$},m)),i.ok(m))});function w(g){const{opts:$,errSchemaPath:y}=h,_=a.length,I=_===g.minItems&&(_===g.maxItems||g[o]===!1);if($.strictTuples&&!I){const v=`"${p}" is ${_}-tuple, but minItems or maxItems/${o} are not specified or different at path "${y}"`;(0,e.checkStrictMode)(h,v,$.strictTuples)}}}return Kt.validateTuple=s,Kt.default=r,Kt}var Qo;function Ry(){if(Qo)return wr;Qo=1,Object.defineProperty(wr,"__esModule",{value:!0});const t=vu(),e={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:n=>(0,t.validateTuple)(n,"items")};return wr.default=e,wr}var vr={},ea;function jy(){if(ea)return vr;ea=1,Object.defineProperty(vr,"__esModule",{value:!0});const t=me(),e=ye(),n=lt(),r=wu(),i={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:o}})=>(0,t.str)`must NOT have more than ${o} items`,params:({params:{len:o}})=>(0,t._)`{limit: ${o}}`},code(o){const{schema:a,parentSchema:c,it:l}=o,{prefixItems:d}=c;l.items=!0,!(0,e.alwaysValidSchema)(l,a)&&(d?(0,r.validateAdditionalItems)(o,d):o.ok((0,n.validateArray)(o)))}};return vr.default=i,vr}var br={},ta;function Fy(){if(ta)return br;ta=1,Object.defineProperty(br,"__esModule",{value:!0});const t=me(),e=ye(),r={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:s,max:i}})=>i===void 0?(0,t.str)`must contain at least ${s} valid item(s)`:(0,t.str)`must contain at least ${s} and no more than ${i} valid item(s)`,params:({params:{min:s,max:i}})=>i===void 0?(0,t._)`{minContains: ${s}}`:(0,t._)`{minContains: ${s}, maxContains: ${i}}`},code(s){const{gen:i,schema:o,parentSchema:a,data:c,it:l}=s;let d,p;const{minContains:h,maxContains:m}=a;l.opts.next?(d=h===void 0?1:h,p=m):d=1;const b=i.const("len",(0,t._)`${c}.length`);if(s.setParams({min:d,max:p}),p===void 0&&d===0){(0,e.checkStrictMode)(l,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(p!==void 0&&d>p){(0,e.checkStrictMode)(l,'"minContains" > "maxContains" is always invalid'),s.fail();return}if((0,e.alwaysValidSchema)(l,o)){let _=(0,t._)`${b} >= ${d}`;p!==void 0&&(_=(0,t._)`${_} && ${b} <= ${p}`),s.pass(_);return}l.items=!0;const w=i.name("valid");p===void 0&&d===1?$(w,()=>i.if(w,()=>i.break())):d===0?(i.let(w,!0),p!==void 0&&i.if((0,t._)`${c}.length > 0`,g)):(i.let(w,!1),g()),s.result(w,()=>s.reset());function g(){const _=i.name("_valid"),I=i.let("count",0);$(_,()=>i.if(_,()=>y(I)))}function $(_,I){i.forRange("i",0,b,v=>{s.subschema({keyword:"contains",dataProp:v,dataPropType:e.Type.Num,compositeRule:!0},_),I()})}function y(_){i.code((0,t._)`${_}++`),p===void 0?i.if((0,t._)`${_} >= ${d}`,()=>i.assign(w,!0).break()):(i.if((0,t._)`${_} > ${p}`,()=>i.assign(w,!1).break()),d===1?i.assign(w,!0):i.if((0,t._)`${_} >= ${d}`,()=>i.assign(w,!0)))}}};return br.default=r,br}var xs={},na;function My(){return na||(na=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;const e=me(),n=ye(),r=lt();t.error={message:({params:{property:c,depsCount:l,deps:d}})=>{const p=l===1?"property":"properties";return(0,e.str)`must have ${p} ${d} when property ${c} is present`},params:({params:{property:c,depsCount:l,deps:d,missingProperty:p}})=>(0,e._)`{property: ${c},
174
+ missingProperty: ${p},
175
+ depsCount: ${l},
176
+ deps: ${d}}`};const s={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(c){const[l,d]=i(c);o(c,l),a(c,d)}};function i({schema:c}){const l={},d={};for(const p in c){if(p==="__proto__")continue;const h=Array.isArray(c[p])?l:d;h[p]=c[p]}return[l,d]}function o(c,l=c.schema){const{gen:d,data:p,it:h}=c;if(Object.keys(l).length===0)return;const m=d.let("missing");for(const b in l){const w=l[b];if(w.length===0)continue;const g=(0,r.propertyInData)(d,p,b,h.opts.ownProperties);c.setParams({property:b,depsCount:w.length,deps:w.join(", ")}),h.allErrors?d.if(g,()=>{for(const $ of w)(0,r.checkReportMissingProp)(c,$)}):(d.if((0,e._)`${g} && (${(0,r.checkMissingProp)(c,w,m)})`),(0,r.reportMissingProp)(c,m),d.else())}}t.validatePropertyDeps=o;function a(c,l=c.schema){const{gen:d,data:p,keyword:h,it:m}=c,b=d.name("valid");for(const w in l)(0,n.alwaysValidSchema)(m,l[w])||(d.if((0,r.propertyInData)(d,p,w,m.opts.ownProperties),()=>{const g=c.subschema({keyword:h,schemaProp:w},b);c.mergeValidEvaluated(g,b)},()=>d.var(b,!0)),c.ok(b))}t.validateSchemaDeps=a,t.default=s})(xs)),xs}var _r={},ra;function Uy(){if(ra)return _r;ra=1,Object.defineProperty(_r,"__esModule",{value:!0});const t=me(),e=ye(),r={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:s})=>(0,t._)`{propertyName: ${s.propertyName}}`},code(s){const{gen:i,schema:o,data:a,it:c}=s;if((0,e.alwaysValidSchema)(c,o))return;const l=i.name("valid");i.forIn("key",a,d=>{s.setParams({propertyName:d}),s.subschema({keyword:"propertyNames",data:d,dataTypes:["string"],propertyName:d,compositeRule:!0},l),i.if((0,t.not)(l),()=>{s.error(!0),c.allErrors||i.break()})}),s.ok(l)}};return _r.default=r,_r}var $r={},sa;function bu(){if(sa)return $r;sa=1,Object.defineProperty($r,"__esModule",{value:!0});const t=lt(),e=me(),n=Tt(),r=ye(),i={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:o})=>(0,e._)`{additionalProperty: ${o.additionalProperty}}`},code(o){const{gen:a,schema:c,parentSchema:l,data:d,errsCount:p,it:h}=o;if(!p)throw new Error("ajv implementation error");const{allErrors:m,opts:b}=h;if(h.props=!0,b.removeAdditional!=="all"&&(0,r.alwaysValidSchema)(h,c))return;const w=(0,t.allSchemaProperties)(l.properties),g=(0,t.allSchemaProperties)(l.patternProperties);$(),o.ok((0,e._)`${p} === ${n.default.errors}`);function $(){a.forIn("key",d,k=>{!w.length&&!g.length?I(k):a.if(y(k),()=>I(k))})}function y(k){let O;if(w.length>8){const T=(0,r.schemaRefOrVal)(h,l.properties,"properties");O=(0,t.isOwnProperty)(a,T,k)}else w.length?O=(0,e.or)(...w.map(T=>(0,e._)`${k} === ${T}`)):O=e.nil;return g.length&&(O=(0,e.or)(O,...g.map(T=>(0,e._)`${(0,t.usePattern)(o,T)}.test(${k})`))),(0,e.not)(O)}function _(k){a.code((0,e._)`delete ${d}[${k}]`)}function I(k){if(b.removeAdditional==="all"||b.removeAdditional&&c===!1){_(k);return}if(c===!1){o.setParams({additionalProperty:k}),o.error(),m||a.break();return}if(typeof c=="object"&&!(0,r.alwaysValidSchema)(h,c)){const O=a.name("valid");b.removeAdditional==="failing"?(v(k,O,!1),a.if((0,e.not)(O),()=>{o.reset(),_(k)})):(v(k,O),m||a.if((0,e.not)(O),()=>a.break()))}}function v(k,O,T){const L={keyword:"additionalProperties",dataProp:k,dataPropType:r.Type.Str};T===!1&&Object.assign(L,{compositeRule:!0,createErrors:!1,allErrors:!1}),o.subschema(L,O)}}};return $r.default=i,$r}var Sr={},ia;function Ly(){if(ia)return Sr;ia=1,Object.defineProperty(Sr,"__esModule",{value:!0});const t=hs(),e=lt(),n=ye(),r=bu(),s={keyword:"properties",type:"object",schemaType:"object",code(i){const{gen:o,schema:a,parentSchema:c,data:l,it:d}=i;d.opts.removeAdditional==="all"&&c.additionalProperties===void 0&&r.default.code(new t.KeywordCxt(d,r.default,"additionalProperties"));const p=(0,e.allSchemaProperties)(a);for(const g of p)d.definedProperties.add(g);d.opts.unevaluated&&p.length&&d.props!==!0&&(d.props=n.mergeEvaluated.props(o,(0,n.toHash)(p),d.props));const h=p.filter(g=>!(0,n.alwaysValidSchema)(d,a[g]));if(h.length===0)return;const m=o.name("valid");for(const g of h)b(g)?w(g):(o.if((0,e.propertyInData)(o,l,g,d.opts.ownProperties)),w(g),d.allErrors||o.else().var(m,!0),o.endIf()),i.it.definedProperties.add(g),i.ok(m);function b(g){return d.opts.useDefaults&&!d.compositeRule&&a[g].default!==void 0}function w(g){i.subschema({keyword:"properties",schemaProp:g,dataProp:g},m)}}};return Sr.default=s,Sr}var Er={},oa;function qy(){if(oa)return Er;oa=1,Object.defineProperty(Er,"__esModule",{value:!0});const t=lt(),e=me(),n=ye(),r=ye(),s={keyword:"patternProperties",type:"object",schemaType:"object",code(i){const{gen:o,schema:a,data:c,parentSchema:l,it:d}=i,{opts:p}=d,h=(0,t.allSchemaProperties)(a),m=h.filter(I=>(0,n.alwaysValidSchema)(d,a[I]));if(h.length===0||m.length===h.length&&(!d.opts.unevaluated||d.props===!0))return;const b=p.strictSchema&&!p.allowMatchingProperties&&l.properties,w=o.name("valid");d.props!==!0&&!(d.props instanceof e.Name)&&(d.props=(0,r.evaluatedPropsToName)(o,d.props));const{props:g}=d;$();function $(){for(const I of h)b&&y(I),d.allErrors?_(I):(o.var(w,!0),_(I),o.if(w))}function y(I){for(const v in b)new RegExp(I).test(v)&&(0,n.checkStrictMode)(d,`property ${v} matches pattern ${I} (use allowMatchingProperties)`)}function _(I){o.forIn("key",c,v=>{o.if((0,e._)`${(0,t.usePattern)(i,I)}.test(${v})`,()=>{const k=m.includes(I);k||i.subschema({keyword:"patternProperties",schemaProp:I,dataProp:v,dataPropType:r.Type.Str},w),d.opts.unevaluated&&g!==!0?o.assign((0,e._)`${g}[${v}]`,!0):!k&&!d.allErrors&&o.if((0,e.not)(w),()=>o.break())})})}}};return Er.default=s,Er}var kr={},aa;function Zy(){if(aa)return kr;aa=1,Object.defineProperty(kr,"__esModule",{value:!0});const t=ye(),e={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(n){const{gen:r,schema:s,it:i}=n;if((0,t.alwaysValidSchema)(i,s)){n.fail();return}const o=r.name("valid");n.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),n.failResult(o,()=>n.reset(),()=>n.error())},error:{message:"must NOT be valid"}};return kr.default=e,kr}var Ir={},ca;function Vy(){if(ca)return Ir;ca=1,Object.defineProperty(Ir,"__esModule",{value:!0});const e={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:lt().validateUnion,error:{message:"must match a schema in anyOf"}};return Ir.default=e,Ir}var Ar={},ua;function Ky(){if(ua)return Ar;ua=1,Object.defineProperty(Ar,"__esModule",{value:!0});const t=me(),e=ye(),r={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:s})=>(0,t._)`{passingSchemas: ${s.passing}}`},code(s){const{gen:i,schema:o,parentSchema:a,it:c}=s;if(!Array.isArray(o))throw new Error("ajv implementation error");if(c.opts.discriminator&&a.discriminator)return;const l=o,d=i.let("valid",!1),p=i.let("passing",null),h=i.name("_valid");s.setParams({passing:p}),i.block(m),s.result(d,()=>s.reset(),()=>s.error(!0));function m(){l.forEach((b,w)=>{let g;(0,e.alwaysValidSchema)(c,b)?i.var(h,!0):g=s.subschema({keyword:"oneOf",schemaProp:w,compositeRule:!0},h),w>0&&i.if((0,t._)`${h} && ${d}`).assign(d,!1).assign(p,(0,t._)`[${p}, ${w}]`).else(),i.if(h,()=>{i.assign(d,!0),i.assign(p,w),g&&s.mergeEvaluated(g,t.Name)})})}}};return Ar.default=r,Ar}var Or={},la;function Jy(){if(la)return Or;la=1,Object.defineProperty(Or,"__esModule",{value:!0});const t=ye(),e={keyword:"allOf",schemaType:"array",code(n){const{gen:r,schema:s,it:i}=n;if(!Array.isArray(s))throw new Error("ajv implementation error");const o=r.name("valid");s.forEach((a,c)=>{if((0,t.alwaysValidSchema)(i,a))return;const l=n.subschema({keyword:"allOf",schemaProp:c},o);n.ok(o),n.mergeEvaluated(l)})}};return Or.default=e,Or}var Nr={},fa;function Hy(){if(fa)return Nr;fa=1,Object.defineProperty(Nr,"__esModule",{value:!0});const t=me(),e=ye(),r={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:i})=>(0,t.str)`must match "${i.ifClause}" schema`,params:({params:i})=>(0,t._)`{failingKeyword: ${i.ifClause}}`},code(i){const{gen:o,parentSchema:a,it:c}=i;a.then===void 0&&a.else===void 0&&(0,e.checkStrictMode)(c,'"if" without "then" and "else" is ignored');const l=s(c,"then"),d=s(c,"else");if(!l&&!d)return;const p=o.let("valid",!0),h=o.name("_valid");if(m(),i.reset(),l&&d){const w=o.let("ifClause");i.setParams({ifClause:w}),o.if(h,b("then",w),b("else",w))}else l?o.if(h,b("then")):o.if((0,t.not)(h),b("else"));i.pass(p,()=>i.error(!0));function m(){const w=i.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},h);i.mergeEvaluated(w)}function b(w,g){return()=>{const $=i.subschema({keyword:w},h);o.assign(p,h),i.mergeValidEvaluated($,p),g?o.assign(g,(0,t._)`${w}`):i.setParams({ifClause:w})}}}};function s(i,o){const a=i.schema[o];return a!==void 0&&!(0,e.alwaysValidSchema)(i,a)}return Nr.default=r,Nr}var Tr={},da;function Gy(){if(da)return Tr;da=1,Object.defineProperty(Tr,"__esModule",{value:!0});const t=ye(),e={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:n,parentSchema:r,it:s}){r.if===void 0&&(0,t.checkStrictMode)(s,`"${n}" without "if" is ignored`)}};return Tr.default=e,Tr}var ha;function Wy(){if(ha)return yr;ha=1,Object.defineProperty(yr,"__esModule",{value:!0});const t=wu(),e=Ry(),n=vu(),r=jy(),s=Fy(),i=My(),o=Uy(),a=bu(),c=Ly(),l=qy(),d=Zy(),p=Vy(),h=Ky(),m=Jy(),b=Hy(),w=Gy();function g($=!1){const y=[d.default,p.default,h.default,m.default,b.default,w.default,o.default,a.default,i.default,c.default,l.default];return $?y.push(e.default,r.default):y.push(t.default,n.default),y.push(s.default),y}return yr.default=g,yr}var Pr={},Cr={},pa;function Yy(){if(pa)return Cr;pa=1,Object.defineProperty(Cr,"__esModule",{value:!0});const t=me(),n={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:r})=>(0,t.str)`must match format "${r}"`,params:({schemaCode:r})=>(0,t._)`{format: ${r}}`},code(r,s){const{gen:i,data:o,$data:a,schema:c,schemaCode:l,it:d}=r,{opts:p,errSchemaPath:h,schemaEnv:m,self:b}=d;if(!p.validateFormats)return;a?w():g();function w(){const $=i.scopeValue("formats",{ref:b.formats,code:p.code.formats}),y=i.const("fDef",(0,t._)`${$}[${l}]`),_=i.let("fType"),I=i.let("format");i.if((0,t._)`typeof ${y} == "object" && !(${y} instanceof RegExp)`,()=>i.assign(_,(0,t._)`${y}.type || "string"`).assign(I,(0,t._)`${y}.validate`),()=>i.assign(_,(0,t._)`"string"`).assign(I,y)),r.fail$data((0,t.or)(v(),k()));function v(){return p.strictSchema===!1?t.nil:(0,t._)`${l} && !${I}`}function k(){const O=m.$async?(0,t._)`(${y}.async ? await ${I}(${o}) : ${I}(${o}))`:(0,t._)`${I}(${o})`,T=(0,t._)`(typeof ${I} == "function" ? ${O} : ${I}.test(${o}))`;return(0,t._)`${I} && ${I} !== true && ${_} === ${s} && !${T}`}}function g(){const $=b.formats[c];if(!$){v();return}if($===!0)return;const[y,_,I]=k($);y===s&&r.pass(O());function v(){if(p.strictSchema===!1){b.logger.warn(T());return}throw new Error(T());function T(){return`unknown format "${c}" ignored in schema at path "${h}"`}}function k(T){const L=T instanceof RegExp?(0,t.regexpCode)(T):p.code.formats?(0,t._)`${p.code.formats}${(0,t.getProperty)(c)}`:void 0,H=i.scopeValue("formats",{key:c,ref:T,code:L});return typeof T=="object"&&!(T instanceof RegExp)?[T.type||"string",T.validate,(0,t._)`${H}.validate`]:["string",T,H]}function O(){if(typeof $=="object"&&!($ instanceof RegExp)&&$.async){if(!m.$async)throw new Error("async format in sync schema");return(0,t._)`await ${I}(${o})`}return typeof _=="function"?(0,t._)`${I}(${o})`:(0,t._)`${I}.test(${o})`}}}};return Cr.default=n,Cr}var ma;function Xy(){if(ma)return Pr;ma=1,Object.defineProperty(Pr,"__esModule",{value:!0});const e=[Yy().default];return Pr.default=e,Pr}var Bt={},ga;function Qy(){return ga||(ga=1,Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.contentVocabulary=Bt.metadataVocabulary=void 0,Bt.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],Bt.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),Bt}var ya;function e0(){if(ya)return tr;ya=1,Object.defineProperty(tr,"__esModule",{value:!0});const t=Ey(),e=zy(),n=Wy(),r=Xy(),s=Qy(),i=[t.default,e.default,(0,n.default)(),r.default,s.metadataVocabulary,s.contentVocabulary];return tr.default=i,tr}var xr={},Sn={},wa;function t0(){if(wa)return Sn;wa=1,Object.defineProperty(Sn,"__esModule",{value:!0}),Sn.DiscrError=void 0;var t;return(function(e){e.Tag="tag",e.Mapping="mapping"})(t||(Sn.DiscrError=t={})),Sn}var va;function n0(){if(va)return xr;va=1,Object.defineProperty(xr,"__esModule",{value:!0});const t=me(),e=t0(),n=vi(),r=ps(),s=ye(),o={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:a,tagName:c}})=>a===e.DiscrError.Tag?`tag "${c}" must be string`:`value of tag "${c}" must be in oneOf`,params:({params:{discrError:a,tag:c,tagName:l}})=>(0,t._)`{error: ${a}, tag: ${l}, tagValue: ${c}}`},code(a){const{gen:c,data:l,schema:d,parentSchema:p,it:h}=a,{oneOf:m}=p;if(!h.opts.discriminator)throw new Error("discriminator: requires discriminator option");const b=d.propertyName;if(typeof b!="string")throw new Error("discriminator: requires propertyName");if(d.mapping)throw new Error("discriminator: mapping is not supported");if(!m)throw new Error("discriminator: requires oneOf keyword");const w=c.let("valid",!1),g=c.const("tag",(0,t._)`${l}${(0,t.getProperty)(b)}`);c.if((0,t._)`typeof ${g} == "string"`,()=>$(),()=>a.error(!1,{discrError:e.DiscrError.Tag,tag:g,tagName:b})),a.ok(w);function $(){const I=_();c.if(!1);for(const v in I)c.elseIf((0,t._)`${g} === ${v}`),c.assign(w,y(I[v]));c.else(),a.error(!1,{discrError:e.DiscrError.Mapping,tag:g,tagName:b}),c.endIf()}function y(I){const v=c.name("valid"),k=a.subschema({keyword:"oneOf",schemaProp:I},v);return a.mergeEvaluated(k,t.Name),v}function _(){var I;const v={},k=T(p);let O=!0;for(let G=0;G<m.length;G++){let Y=m[G];if(Y?.$ref&&!(0,s.schemaHasRulesButRef)(Y,h.self.RULES)){const de=Y.$ref;if(Y=n.resolveRef.call(h.self,h.schemaEnv.root,h.baseId,de),Y instanceof n.SchemaEnv&&(Y=Y.schema),Y===void 0)throw new r.default(h.opts.uriResolver,h.baseId,de)}const se=(I=Y?.properties)===null||I===void 0?void 0:I[b];if(typeof se!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${b}"`);O=O&&(k||T(Y)),L(se,G)}if(!O)throw new Error(`discriminator: "${b}" must be required`);return v;function T({required:G}){return Array.isArray(G)&&G.includes(b)}function L(G,Y){if(G.const)H(G.const,Y);else if(G.enum)for(const se of G.enum)H(se,Y);else throw new Error(`discriminator: "properties/${b}" must have "const" or "enum"`)}function H(G,Y){if(typeof G!="string"||G in v)throw new Error(`discriminator: "${b}" values must be unique strings`);v[G]=Y}}}};return xr.default=o,xr}const r0="http://json-schema.org/draft-07/schema#",s0="http://json-schema.org/draft-07/schema#",i0="Core schema meta-schema",o0={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},a0=["object","boolean"],c0={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}};var u0={$schema:r0,$id:s0,title:i0,definitions:o0,type:a0,properties:c0,default:!0},ba;function l0(){return ba||(ba=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv=void 0;const n=_y(),r=e0(),s=n0(),i=u0,o=["/properties"],a="http://json-schema.org/draft-07/schema";class c extends n.default{_addVocabularies(){super._addVocabularies(),r.default.forEach(b=>this.addVocabulary(b)),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const b=this.opts.$data?this.$dataMetaSchema(i,o):i;this.addMetaSchema(b,a,!1),this.refs["http://json-schema.org/schema"]=a}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(a)?a:void 0)}}e.Ajv=c,t.exports=e=c,t.exports.Ajv=c,Object.defineProperty(e,"__esModule",{value:!0}),e.default=c;var l=hs();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return l.KeywordCxt}});var d=me();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}});var p=wi();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return p.default}});var h=ps();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return h.default}})})(Wn,Wn.exports)),Wn.exports}var f0=l0();const Bs=10,_a=(t=0)=>e=>`\x1B[${e+t}m`,$a=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,Sa=(t=0)=>(e,n,r)=>`\x1B[${38+t};2;${e};${n};${r}m`,Ae={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(Ae.modifier);const d0=Object.keys(Ae.color),h0=Object.keys(Ae.bgColor);[...d0,...h0];function p0(){const t=new Map;for(const[e,n]of Object.entries(Ae)){for(const[r,s]of Object.entries(n))Ae[r]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},n[r]=Ae[r],t.set(s[0],s[1]);Object.defineProperty(Ae,e,{value:n,enumerable:!1})}return Object.defineProperty(Ae,"codes",{value:t,enumerable:!1}),Ae.color.close="\x1B[39m",Ae.bgColor.close="\x1B[49m",Ae.color.ansi=_a(),Ae.color.ansi256=$a(),Ae.color.ansi16m=Sa(),Ae.bgColor.ansi=_a(Bs),Ae.bgColor.ansi256=$a(Bs),Ae.bgColor.ansi16m=Sa(Bs),Object.defineProperties(Ae,{rgbToAnsi256:{value(e,n,r){return e===n&&n===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},enumerable:!1},hexToRgb:{value(e){const n=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!n)return[0,0,0];let[r]=n;r.length===3&&(r=[...r].map(i=>i+i).join(""));const s=Number.parseInt(r,16);return[s>>16&255,s>>8&255,s&255]},enumerable:!1},hexToAnsi256:{value:e=>Ae.rgbToAnsi256(...Ae.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let n,r,s;if(e>=232)n=((e-232)*10+8)/255,r=n,s=n;else{e-=16;const a=e%36;n=Math.floor(e/36)/5,r=Math.floor(a/6)/5,s=a%6/5}const i=Math.max(n,r,s)*2;if(i===0)return 30;let o=30+(Math.round(s)<<2|Math.round(r)<<1|Math.round(n));return i===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(e,n,r)=>Ae.ansi256ToAnsi(Ae.rgbToAnsi256(e,n,r)),enumerable:!1},hexToAnsi:{value:e=>Ae.ansi256ToAnsi(Ae.hexToAnsi256(e)),enumerable:!1}}),Ae}const Xe=p0();class m0 extends mi{getNodeDependencies({resolvedInputs:e}){const n=[];for(const r of Object.values(e))for(const s of r)n.push(s.input.instanceId);return n}processNode({instance:e,component:n,state:r,resolvedInputs:s}){const i=new f0.Ajv({strict:!1});this.logger.debug({instanceId:e.id},"validating instance");const o=[];for(const[l,d]of Object.entries(n.args))try{const p=Qm(e.args?.[l]);if(!d.required&&p===void 0)continue;i.validate(d.schema,p)||(this.logger.debug({instanceId:e.id,argumentName:l},"invalid argument"),o.push(`Invalid argument "${Xe.blueBright.open}${l}${Xe.reset.close}": `+i.errorsText()))}catch(p){this.logger.debug({instanceId:e.id,argumentName:l,error:p},"failed to validate argument"),o.push(`Failed to validate argument "${Xe.blueBright.open}${l}${Xe.reset.close}": `+(p instanceof Error?p.message:String(p)))}if(pi(n))for(const[l,d]of Object.entries(n.secrets))d.required&&!r?.secretNames?.includes(l)&&o.push(`Missing required secret "${Xe.blueBright.open}${l}${Xe.reset.close}"`);for(const[l,d]of Object.entries(s))for(const p of d)this.outputs.get(p.input.instanceId)?.status!=="ok"&&o.push(`Invalid input "${Xe.blueBright.open}${l}${Xe.reset.close}":
177
+ "${Xe.blueBright.open}${p.input.instanceId}${Xe.reset.close}" has validation errors`);for(const[l,d]of Object.entries(n.inputs))d.required&&(!s[l]||!s[l].length)&&o.push(`Missing required input "${Xe.blueBright.open}${l}${Xe.reset.close}" of type "${Xe.greenBright.open}${d.type}${Xe.reset.close}"`);if(o.length===0)return{status:"ok"};const a=(o.length+1).toString().length+2;return{status:"error",errorText:o.map((l,d)=>{const p=l.split(`
178
+ `),h=`${d+1}. `;return p.map((m,b)=>`${b===0?h:" ".repeat(a)}${m}`).join(`\r
179
+ `)}).join(`\r
180
+ `)}}}const g0={InputResolver:Ag,InputHashResolver:iy,ValidationResolver:m0};var En={exports:{}},Ds,Ea;function y0(){if(Ea)return Ds;Ea=1;function t(n){try{return JSON.stringify(n)}catch{return'"[Circular]"'}}Ds=e;function e(n,r,s){var i=s&&s.stringify||t,o=1;if(typeof n=="object"&&n!==null){var a=r.length+o;if(a===1)return n;var c=new Array(a);c[0]=i(n);for(var l=1;l<a;l++)c[l]=i(r[l]);return c.join(" ")}if(typeof n!="string")return n;var d=r.length;if(d===0)return n;for(var p="",h=1-o,m=-1,b=n&&n.length||0,w=0;w<b;){if(n.charCodeAt(w)===37&&w+1<b){switch(m=m>-1?m:0,n.charCodeAt(w+1)){case 100:case 102:if(h>=d||r[h]==null)break;m<w&&(p+=n.slice(m,w)),p+=Number(r[h]),m=w+2,w++;break;case 105:if(h>=d||r[h]==null)break;m<w&&(p+=n.slice(m,w)),p+=Math.floor(Number(r[h])),m=w+2,w++;break;case 79:case 111:case 106:if(h>=d||r[h]===void 0)break;m<w&&(p+=n.slice(m,w));var g=typeof r[h];if(g==="string"){p+="'"+r[h]+"'",m=w+2,w++;break}if(g==="function"){p+=r[h].name||"<anonymous>",m=w+2,w++;break}p+=i(r[h]),m=w+2,w++;break;case 115:if(h>=d)break;m<w&&(p+=n.slice(m,w)),p+=String(r[h]),m=w+2,w++;break;case 37:m<w&&(p+=n.slice(m,w)),p+="%",m=w+2,w++,h--;break}++h}++w}return m===-1?n:(m<b&&(p+=n.slice(m)),p)}return Ds}var ka;function w0(){if(ka)return En.exports;ka=1;const t=y0();En.exports=d;const e=de().console||{},n={mapHttpRequest:O,mapHttpResponse:O,wrapRequestSerializer:T,wrapResponseSerializer:T,wrapErrorSerializer:T,req:O,res:O,err:v,errWithCause:v};function r(M,W){return M==="silent"?1/0:W.levels.values[M]}const s=Symbol("pino.logFuncs"),i=Symbol("pino.hierarchy"),o={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function a(M,W){const re={logger:W,parent:M[i]};W[i]=re}function c(M,W,re){const ne={};W.forEach(oe=>{ne[oe]=re[oe]?re[oe]:e[oe]||e[o[oe]||"log"]||L}),M[s]=ne}function l(M,W){return Array.isArray(M)?M.filter(function(ne){return ne!=="!stdSerializers.err"}):M===!0?Object.keys(W):!1}function d(M){M=M||{},M.browser=M.browser||{};const W=M.browser.transmit;if(W&&typeof W.send!="function")throw Error("pino: transmit option must have a send function");const re=M.browser.write||e;M.browser.write&&(M.browser.asObject=!0);const ne=M.serializers||{},oe=l(M.browser.serialize,ne);let K=M.browser.serialize;Array.isArray(M.browser.serialize)&&M.browser.serialize.indexOf("!stdSerializers.err")>-1&&(K=!1);const P=Object.keys(M.customLevels||{}),j=["error","fatal","warn","info","debug","trace"].concat(P);typeof re=="function"&&j.forEach(function(ie){re[ie]=re}),(M.enabled===!1||M.browser.disabled)&&(M.level="silent");const D=M.level||"info",E=Object.create(re);E.log||(E.log=L),c(E,j,re),a({},E),Object.defineProperty(E,"levelVal",{get:F}),Object.defineProperty(E,"level",{get:Q,set:X});const N={transmit:W,serialize:oe,asObject:M.browser.asObject,asObjectBindingsOnly:M.browser.asObjectBindingsOnly,formatters:M.browser.formatters,levels:j,timestamp:k(M),messageKey:M.messageKey||"msg",onChild:M.onChild||L};E.levels=p(M),E.level=D,E.isLevelEnabled=function(ie){return this.levels.values[ie]?this.levels.values[ie]>=this.levels.values[this.level]:!1},E.setMaxListeners=E.getMaxListeners=E.emit=E.addListener=E.on=E.prependListener=E.once=E.prependOnceListener=E.removeListener=E.removeAllListeners=E.listeners=E.listenerCount=E.eventNames=E.write=E.flush=L,E.serializers=ne,E._serialize=oe,E._stdErrSerialize=K,E.child=function(...ie){return he.call(this,N,...ie)},W&&(E._logEvent=I());function F(){return r(this.level,this)}function Q(){return this._level}function X(ie){if(ie!=="silent"&&!this.levels.values[ie])throw Error("unknown level "+ie);this._level=ie,b(this,N,E,"error"),b(this,N,E,"fatal"),b(this,N,E,"warn"),b(this,N,E,"info"),b(this,N,E,"debug"),b(this,N,E,"trace"),P.forEach(x=>{b(this,N,E,x)})}function he(ie,x,z){if(!x)throw new Error("missing bindings for child Pino");z=z||{},oe&&x.serializers&&(z.serializers=x.serializers);const q=z.serializers;if(oe&&q){var J=Object.assign({},ne,q),ee=M.browser.serialize===!0?Object.keys(J):oe;delete x.serializers,y([x],ee,J,this._stdErrSerialize)}function ae(Me){this._childLevel=(Me._childLevel|0)+1,this.bindings=x,J&&(this.serializers=J,this._serialize=ee),W&&(this._logEvent=I([].concat(Me._logEvent.bindings,x)))}ae.prototype=this;const _e=new ae(this);return a(this,_e),_e.child=function(...Me){return he.call(this,ie,...Me)},_e.level=z.level||this.level,ie.onChild(_e),_e}return E}function p(M){const W=M.customLevels||{},re=Object.assign({},d.levels.values,W),ne=Object.assign({},d.levels.labels,h(W));return{values:re,labels:ne}}function h(M){const W={};return Object.keys(M).forEach(function(re){W[M[re]]=re}),W}d.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},d.stdSerializers=n,d.stdTimeFunctions=Object.assign({},{nullTime:H,epochTime:G,unixTime:Y,isoTime:se});function m(M){const W=[];M.bindings&&W.push(M.bindings);let re=M[i];for(;re.parent;)re=re.parent,re.logger.bindings&&W.push(re.logger.bindings);return W.reverse()}function b(M,W,re,ne){if(Object.defineProperty(M,ne,{value:r(M.level,re)>r(ne,re)?L:re[s][ne],writable:!0,enumerable:!0,configurable:!0}),M[ne]===L){if(!W.transmit)return;const K=W.transmit.level||M.level,P=r(K,re);if(r(ne,re)<P)return}M[ne]=g(M,W,re,ne);const oe=m(M);oe.length!==0&&(M[ne]=w(oe,M[ne]))}function w(M,W){return function(){return W.apply(this,[...M,...arguments])}}function g(M,W,re,ne){return(function(oe){return function(){const P=W.timestamp(),j=new Array(arguments.length),D=Object.getPrototypeOf&&Object.getPrototypeOf(this)===e?e:this;for(var E=0;E<j.length;E++)j[E]=arguments[E];var N=!1;if(W.serialize&&(y(j,this._serialize,this.serializers,this._stdErrSerialize),N=!0),W.asObject||W.formatters?oe.call(D,...$(this,ne,j,P,W)):oe.apply(D,j),W.transmit){const F=W.transmit.level||M._level,Q=r(F,re),X=r(ne,re);if(X<Q)return;_(this,{ts:P,methodLevel:ne,methodValue:X,transmitValue:re.levels.values[W.transmit.level||M._level],send:W.transmit.send,val:r(M._level,re)},j,N)}}})(M[s][ne])}function $(M,W,re,ne,oe){const{level:K,log:P=F=>F}=oe.formatters||{},j=re.slice();let D=j[0];const E={};let N=(M._childLevel|0)+1;if(N<1&&(N=1),ne&&(E.time=ne),K){const F=K(W,M.levels.values[W]);Object.assign(E,F)}else E.level=M.levels.values[W];if(oe.asObjectBindingsOnly){if(D!==null&&typeof D=="object")for(;N--&&typeof j[0]=="object";)Object.assign(E,j.shift());return[P(E),...j]}else{if(D!==null&&typeof D=="object"){for(;N--&&typeof j[0]=="object";)Object.assign(E,j.shift());D=j.length?t(j.shift(),j):void 0}else typeof D=="string"&&(D=t(j.shift(),j));return D!==void 0&&(E[oe.messageKey]=D),[P(E)]}}function y(M,W,re,ne){for(const oe in M)if(ne&&M[oe]instanceof Error)M[oe]=d.stdSerializers.err(M[oe]);else if(typeof M[oe]=="object"&&!Array.isArray(M[oe])&&W)for(const K in M[oe])W.indexOf(K)>-1&&K in re&&(M[oe][K]=re[K](M[oe][K]))}function _(M,W,re,ne=!1){const oe=W.send,K=W.ts,P=W.methodLevel,j=W.methodValue,D=W.val,E=M._logEvent.bindings;ne||y(re,M._serialize||Object.keys(M.serializers),M.serializers,M._stdErrSerialize===void 0?!0:M._stdErrSerialize),M._logEvent.ts=K,M._logEvent.messages=re.filter(function(N){return E.indexOf(N)===-1}),M._logEvent.level.label=P,M._logEvent.level.value=j,oe(P,M._logEvent,D),M._logEvent=I(E)}function I(M){return{ts:0,messages:[],bindings:M||[],level:{label:"",value:0}}}function v(M){const W={type:M.constructor.name,msg:M.message,stack:M.stack};for(const re in M)W[re]===void 0&&(W[re]=M[re]);return W}function k(M){return typeof M.timestamp=="function"?M.timestamp:M.timestamp===!1?H:G}function O(){return{}}function T(M){return M}function L(){}function H(){return!1}function G(){return Date.now()}function Y(){return Math.round(Date.now()/1e3)}function se(){return new Date(Date.now()).toISOString()}function de(){function M(W){return typeof W<"u"&&W}try{return typeof globalThis<"u"||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return M(self)||M(window)||M(this)||{}}}return En.exports.default=d,En.exports.pino=d,En.exports}var v0=w0();const an=(t,e)=>{t.postMessage(e)},ft=new Map,Ia=128,_u=(t,e,n)=>{if(n.pendingOutputs.size===0)return;const r=Array.from(n.pendingOutputs.values());n.pendingOutputs.clear();for(let s=0;s<r.length;s+=Ia)an(t,{type:"outputs",resolverId:e,items:r.slice(s,s+Ia)})},Aa=(t,e,n)=>{n.flushTimer||(n.flushTimer=setTimeout(()=>{if(n.flushTimer=null,_u(t,e,n),n.pendingDependentSets.size>0){const r=Array.from(n.pendingDependentSets.entries()).map(([s,i])=>({nodeId:s,dependents:i}));an(t,{type:"dependent-set-batch",resolverId:e,items:r}),n.pendingDependentSets.clear()}},0))},_i=(t,e)=>{if(e.isProcessing){e.processRequested=!0;return}e.isProcessing=!0;const n=e.abortController.signal;e.resolver.process(n).catch(r=>{e.logger.error({error:r},"failed to process resolver updates")}).finally(()=>{e.isProcessing=!1,e.processRequested&&(e.processRequested=!1,_i(t,e))})},b0=async(t,e,n,r,s=!1)=>{if(ft.has(n)){console.warn(`state with id "${n}" already exists`);return}const i=v0.pino({level:"info"}).child({resolverId:n,resolverType:r}),o=(d,p)=>{const h=ft.get(n);h&&(h.pendingOutputs.set(d,{nodeId:d,output:p}),Aa(t,n,h))};let a;s&&(a=(d,p)=>{const h=ft.get(n);h&&(h.pendingDependentSets.set(d,p&&Array.from(p)),Aa(t,n,h))});const c=new g0[r](e,i,o,a);ft.set(n,{nodes:e,resolver:c,logger:i,abortController:new AbortController,isProcessing:!1,processRequested:!1,pendingOutputs:new Map,pendingDependentSets:new Map,flushTimer:null}),c.addAllNodesToWorkset(),await c.process();const l=ft.get(n);if(l&&(l.flushTimer&&(clearTimeout(l.flushTimer),l.flushTimer=null),_u(t,n,l),l.pendingDependentSets.size>0)){const d=Array.from(l.pendingDependentSets.entries()).map(([p,h])=>({nodeId:p,dependents:h}));an(t,{type:"dependent-set-batch",resolverId:n,items:d}),l.pendingDependentSets.clear()}an(t,{type:"resolver-ready",resolverId:n})},$u=(t,e,n)=>{t.abortController.abort(),t.abortController=new AbortController,t.nodes.set(e,n),t.resolver.invalidate(e)},_0=(t,e,n,r)=>{const s=ft.get(e);if(!s)throw new Error(`Unknown state: ${e}`);$u(s,n,r),_i(t,s)},$0=(t,e,n)=>{const r=ft.get(e);if(!r)throw new Error(`Unknown state: ${e}`);$u(r,n,void 0),_i(t,r)},S0=t=>{const e=ft.get(t);e?.flushTimer&&clearTimeout(e.flushTimer),ft.delete(t)},E0=(t,e,n,r,s)=>{const i=ft.get(e);if(!i)throw new Error(`Unknown state: ${e}`);an(t,{type:"can-add-dependency-result",resolverId:e,requestId:n,result:i.resolver.canAddDependency(r,s)})};self.onconnect=t=>{const e=t.ports[0];e.onmessage=n=>{const r=n.data;switch(r.type){case"create-resolver":{const s=new Map(Object.entries(r.nodes));b0(e,s,r.resolverId,r.resolverType,r.syncDependentMap);break}case"update-input":{_0(e,r.resolverId,r.nodeId,r.node);break}case"delete-input":{$0(e,r.resolverId,r.nodeId);break}case"dispose-resolver":{S0(r.resolverId);break}case"can-add-dependency":{E0(e,r.resolverId,r.requestId,r.nodeId,r.dependencyId);break}}},an(e,{type:"ready"})};