@task-handoff/controlled-instance 0.0.30 → 0.0.32

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 (65) hide show
  1. package/dist/controlled-instance-cli.js +6 -6
  2. package/dist/opencode-story-plugin.mjs +1 -0
  3. package/package.json +1 -1
  4. package/ui/assets/{abnfDiagram-VRR7QNED-B9fX0ou2.js → abnfDiagram-VRR7QNED-CRq7JlI_.js} +1 -1
  5. package/ui/assets/{arc-nAQlKbkE.js → arc-CscwJkbf.js} +1 -1
  6. package/ui/assets/{architectureDiagram-ZJ3FMSHR-BMheItai.js → architectureDiagram-ZJ3FMSHR-CUE7MYBe.js} +1 -1
  7. package/ui/assets/{blockDiagram-677ZJIJ3-iRHLoTVU.js → blockDiagram-677ZJIJ3-xi4N9yqO.js} +1 -1
  8. package/ui/assets/{c4Diagram-LMCZKHZV-C6A1F-wD.js → c4Diagram-LMCZKHZV-DUNict-w.js} +1 -1
  9. package/ui/assets/channel-CpwT6ytx.js +1 -0
  10. package/ui/assets/{chunk-2Q5K7J3B-BE6Ihkxw.js → chunk-2Q5K7J3B-CEIvPoaH.js} +1 -1
  11. package/ui/assets/{chunk-32BRIVSS-CccS7Kov.js → chunk-32BRIVSS-Co7b-L-D.js} +1 -1
  12. package/ui/assets/{chunk-5VM5RSS4-_SLYxeRh.js → chunk-5VM5RSS4-D67_RT_Z.js} +1 -1
  13. package/ui/assets/{chunk-EX3LRPZG-DtHiqDyq.js → chunk-EX3LRPZG-PHcXyb26.js} +1 -1
  14. package/ui/assets/{chunk-JWPE2WC7-CgexD2pH.js → chunk-JWPE2WC7-DiqKYTTD.js} +1 -1
  15. package/ui/assets/{chunk-MOJQB5TN-CwWKwFyu.js → chunk-MOJQB5TN-C4Jge-mD.js} +1 -1
  16. package/ui/assets/{chunk-RYQCIY6F-Dl_cvpxd.js → chunk-RYQCIY6F-t3kJHofr.js} +1 -1
  17. package/ui/assets/{chunk-V7JOEXUC-Uoo4pamp.js → chunk-V7JOEXUC-GcUBCdBc.js} +1 -1
  18. package/ui/assets/{chunk-VR4S4FIN-CqH9EXJs.js → chunk-VR4S4FIN-VR1eZEw1.js} +1 -1
  19. package/ui/assets/{chunk-XXDRQBXY-Om6UY2Ac.js → chunk-XXDRQBXY-CF1sPaLh.js} +1 -1
  20. package/ui/assets/classDiagram-OUVF2IWQ-DsrcMBsj.js +1 -0
  21. package/ui/assets/classDiagram-v2-EOCWNBFH-DsrcMBsj.js +1 -0
  22. package/ui/assets/{cose-bilkent-JH36ORCC-OmxKraUZ.js → cose-bilkent-JH36ORCC-GjTK5LvA.js} +1 -1
  23. package/ui/assets/{cynefin-VYW2F7L2-BIactdfy.js → cynefin-VYW2F7L2-D5lv6Xll.js} +1 -1
  24. package/ui/assets/{cynefinDiagram-TSTJHNR4-BsF5xL4X.js → cynefinDiagram-TSTJHNR4-BeK1r27G.js} +1 -1
  25. package/ui/assets/{dagre-VKFMJZFB-CtyuyIsH.js → dagre-VKFMJZFB-CLxVqzAS.js} +1 -1
  26. package/ui/assets/{diagram-FQU43EPY-CZQVw5dd.js → diagram-FQU43EPY-Cjj7tMoP.js} +1 -1
  27. package/ui/assets/{diagram-G47NLZAW-DxBWW0-z.js → diagram-G47NLZAW-BQmn0_it.js} +1 -1
  28. package/ui/assets/{diagram-NH7WQ7WH-DK_o7n-W.js → diagram-NH7WQ7WH-ozicPFgv.js} +1 -1
  29. package/ui/assets/{diagram-OA4YK3LP-CPwK1etI.js → diagram-OA4YK3LP-Xx2rb4tv.js} +1 -1
  30. package/ui/assets/{diagram-WEI45ONY-DXSUR299.js → diagram-WEI45ONY-R5l-15jp.js} +1 -1
  31. package/ui/assets/{ebnfDiagram-CCIWWBDH-DxOmqdYu.js → ebnfDiagram-CCIWWBDH-CngGC5fx.js} +1 -1
  32. package/ui/assets/{erDiagram-Q63AITRT-CG-JCuEq.js → erDiagram-Q63AITRT-CMgv6ncU.js} +1 -1
  33. package/ui/assets/{flowDiagram-23GEKE2U-DjBZzD_9.js → flowDiagram-23GEKE2U-CIcXwp6e.js} +1 -1
  34. package/ui/assets/{ganttDiagram-NO4QXBWP-Ca3sz9lu.js → ganttDiagram-NO4QXBWP-wM6xIzf4.js} +1 -1
  35. package/ui/assets/{gitGraphDiagram-IHSO6WYX-BJjx1Rcu.js → gitGraphDiagram-IHSO6WYX-BhJnrs_Q.js} +1 -1
  36. package/ui/assets/{index-DJpgl-tt.js → index-DPQ0PlCs.js} +11 -11
  37. package/ui/assets/{infoDiagram-FWYZ7A6U-C2Jtlrau.js → infoDiagram-FWYZ7A6U-O09wRxJp.js} +1 -1
  38. package/ui/assets/{ishikawaDiagram-FXEZZL3T-BxMprwQB.js → ishikawaDiagram-FXEZZL3T-DfM6aYPC.js} +1 -1
  39. package/ui/assets/{journeyDiagram-5HDEW3XC-B1-QnKac.js → journeyDiagram-5HDEW3XC-Cr7NP5Y2.js} +1 -1
  40. package/ui/assets/{kanban-definition-HUTT4EX6-_IC8WIhp.js → kanban-definition-HUTT4EX6-DE5Lj_SF.js} +1 -1
  41. package/ui/assets/{linear-DGIbAqDF.js → linear-C9IfX0rf.js} +1 -1
  42. package/ui/assets/{mermaid.core-BhlvCYtR.js → mermaid.core-CRRavpkV.js} +4 -4
  43. package/ui/assets/{mindmap-definition-LN4V7U3C-WnrYkbmw.js → mindmap-definition-LN4V7U3C-Dsv7S_ki.js} +1 -1
  44. package/ui/assets/{pegDiagram-2B236MQR-BnSTjktj.js → pegDiagram-2B236MQR-B0PK__0_.js} +1 -1
  45. package/ui/assets/{pieDiagram-ENE6RG2P-BslLRjgL.js → pieDiagram-ENE6RG2P-CUpo7Rwj.js} +1 -1
  46. package/ui/assets/{quadrantDiagram-ABIIQ3AL-BmQFS93G.js → quadrantDiagram-ABIIQ3AL-DAm4iHOs.js} +1 -1
  47. package/ui/assets/{railroadDiagram-RFXS5EU6-B4MdKaAD.js → railroadDiagram-RFXS5EU6-CH_K63qb.js} +1 -1
  48. package/ui/assets/{requirementDiagram-TGXJPOKE-BIWyNtDY.js → requirementDiagram-TGXJPOKE-_5mV1ykF.js} +1 -1
  49. package/ui/assets/{sankeyDiagram-HTMAVEWB-DFk25pRn.js → sankeyDiagram-HTMAVEWB-D6CIZosX.js} +1 -1
  50. package/ui/assets/{sequenceDiagram-DBY2YBRQ-I1mD6U5T.js → sequenceDiagram-DBY2YBRQ-Ca35kpBT.js} +1 -1
  51. package/ui/assets/{sizeCapture-X5ZJPWSS-DnucJFbW.js → sizeCapture-X5ZJPWSS-wyDpZFzA.js} +1 -1
  52. package/ui/assets/{stateDiagram-2N3HPSRC-vZvzr7hH.js → stateDiagram-2N3HPSRC-8DE32pEJ.js} +1 -1
  53. package/ui/assets/stateDiagram-v2-6OUMAXLB-BtSx23hk.js +1 -0
  54. package/ui/assets/{swimlanes-5IMT3BWC-C9L0x_3V.js → swimlanes-5IMT3BWC-bxTiFjud.js} +2 -2
  55. package/ui/assets/swimlanesDiagram-G3AALYLV-C8fAukTG.js +8 -0
  56. package/ui/assets/{timeline-definition-FHXFAJF6-BMKEQBQK.js → timeline-definition-FHXFAJF6-Cf1cNPKf.js} +1 -1
  57. package/ui/assets/{vennDiagram-L72KCM5P-BEIghBBK.js → vennDiagram-L72KCM5P-0Y1MQ8pV.js} +1 -1
  58. package/ui/assets/{wardleyDiagram-EHGQE667-JvkMg8w3.js → wardleyDiagram-EHGQE667-DI1uQZuA.js} +1 -1
  59. package/ui/assets/{xychartDiagram-FW5EYKEG-t_9Vqa1F.js → xychartDiagram-FW5EYKEG-ChVKVd-v.js} +1 -1
  60. package/ui/index.html +1 -1
  61. package/ui/assets/channel-B4ZzyLH-.js +0 -1
  62. package/ui/assets/classDiagram-OUVF2IWQ-DRQuW6el.js +0 -1
  63. package/ui/assets/classDiagram-v2-EOCWNBFH-DRQuW6el.js +0 -1
  64. package/ui/assets/stateDiagram-v2-6OUMAXLB-CY00usFY.js +0 -1
  65. package/ui/assets/swimlanesDiagram-G3AALYLV-CjK2Rde9.js +0 -8
@@ -0,0 +1 @@
1
+ var e;function t(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:s,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);const i=s.prototype,o=Object.keys(i);for(let e=0;e<o.length;e++){const t=o[e];t in n||(n[t]=i[t].bind(n))}}const i=n?.Parent??Object;class o extends i{}function s(e){var t;const i=n?.Parent?new o:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(const e of i._zod.deferred)e();return i}return Object.defineProperty(o,"name",{value:e}),Object.defineProperty(s,"init",{value:r}),Object.defineProperty(s,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}class n extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class r extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(e=globalThis).__zod_globalConfig??(e.__zod_globalConfig={});const i=globalThis.__zod_globalConfig;function o(e){return i}function s(e,t){return"bigint"==typeof t?t.toString():t}function a(e){return null==e}function u(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const c=Symbol("evaluating");function d(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==c)return void 0===r&&(r=c,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}const f="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function p(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function l(e){if(!1===p(e))return!1;const t=e.constructor;if(void 0===t)return!0;if("function"!=typeof t)return!0;const n=t.prototype;return!1!==p(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function h(e){return l(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function m(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function g(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}const _={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 v(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(!0!==e.issues[n]?.continue)return!0;return!1}function y(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(!1===e.issues[n]?.continue)return!0;return!1}function b(e){return"string"==typeof e?e:e?.message}function z(e,t,n){const r=e.message?e.message:b(e.inst?._zod.def?.error?.(e))??b(t?.error?.(e))??b(n.customError?.(e))??b(n.localeError?.(e))??"Invalid input",{inst:i,continue:o,input:s,...a}=e;return a.path??(a.path=[]),a.message=r,t?.reportInput&&(a.input=s),a}function w(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function k(...e){const[t,n,r]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}const $=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,s,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},O=t("$ZodError",$),S=t("$ZodError",$,{Parent:Error}),T=e=>(t,r,i,s)=>{const a=i?{...i,async:!1}:{async:!1},u=t._zod.run({value:r,issues:[]},a);if(u instanceof Promise)throw new n;if(u.issues.length){const t=new(s?.Err??e)(u.issues.map(e=>z(e,a,o())));throw f(t,s?.callee),t}return u.value},x=e=>async(t,n,r,i)=>{const s=r?{...r,async:!0}:{async:!0};let a=t._zod.run({value:n,issues:[]},s);if(a instanceof Promise&&(a=await a),a.issues.length){const t=new(i?.Err??e)(a.issues.map(e=>z(e,s,o())));throw f(t,i?.callee),t}return a.value},Z=e=>(t,r,i)=>{const s=i?{...i,async:!1}:{async:!1},a=t._zod.run({value:r,issues:[]},s);if(a instanceof Promise)throw new n;return a.issues.length?{success:!1,error:new(e??O)(a.issues.map(e=>z(e,s,o())))}:{success:!0,data:a.value}},N=Z(S),I=e=>async(t,n,r)=>{const i=r?{...r,async:!0}:{async:!0};let s=t._zod.run({value:n,issues:[]},i);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(e=>z(e,i,o())))}:{success:!0,data:s.value}},E=I(S),P=e=>(t,n,r)=>{const i=r?{...r,direction:"backward"}:{direction:"backward"};return T(e)(t,n,i)},A=e=>(t,n,r)=>T(e)(t,n,r),j=e=>async(t,n,r)=>{const i=r?{...r,direction:"backward"}:{direction:"backward"};return x(e)(t,n,i)},F=e=>async(t,n,r)=>x(e)(t,n,r),C=e=>(t,n,r)=>{const i=r?{...r,direction:"backward"}:{direction:"backward"};return Z(e)(t,n,i)},J=e=>(t,n,r)=>Z(e)(t,n,r),M=e=>async(t,n,r)=>{const i=r?{...r,direction:"backward"}:{direction:"backward"};return I(e)(t,n,i)},D=e=>async(t,n,r)=>I(e)(t,n,r),R=/^[cC][0-9a-z]{6,}$/,U=/^[0-9a-z]+$/,V=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,L=/^[0-9a-vA-V]{20}$/,W=/^[A-Za-z0-9]{27}$/,G=/^[a-zA-Z0-9_-]{21}$/,Y=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,B=/^([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})$/,H=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[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)$/,K=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,X=/^(?:(?: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])$/,q=/^(([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}|:))$/,Q=/^((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])$/,ee=/^(([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])$/,te=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ne=/^[A-Za-z0-9_-]*$/,re=/^https?$/,ie=/^\+[1-9]\d{6,14}$/,oe="(?:(?:\\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])))",se=new RegExp(`^${oe}$`);function ae(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}const ue=/^-?\d+$/,ce=/^-?\d+(?:\.\d+)?$/,de=/^[^A-Z]*$/,fe=/^[^a-z]*$/,pe=t("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),le={number:"number",bigint:"bigint",object:"date"},he=t("$ZodCheckLessThan",(e,t)=>{pe.init(e,t);const n=le[typeof t.value];e._zod.onattach.push(e=>{const n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),me=t("$ZodCheckGreaterThan",(e,t)=>{pe.init(e,t);const n=le[typeof t.value];e._zod.onattach.push(e=>{const n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ge=t("$ZodCheckMultipleOf",(e,t)=>{pe.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?n.value%t.value===BigInt(0):0===function(e,t){const n=e/t,r=Math.round(n),i=Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}(n.value,t.value))||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),_e=t("$ZodCheckNumberFormat",(e,t)=>{pe.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[i,o]=_[t.format];e._zod.onattach.push(e=>{const r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=o,n&&(r.pattern=ue)}),e._zod.check=s=>{const a=s.value;if(n){if(!Number.isInteger(a))return void s.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});if(!Number.isSafeInteger(a))return void(a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}))}a<i&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),a>o&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),ve=t("$ZodCheckMaxLength",(e,t)=>{var n;pe.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!a(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const r=n.value;if(r.length<=t.maximum)return;const i=w(r);n.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ye=t("$ZodCheckMinLength",(e,t)=>{var n;pe.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!a(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const r=n.value;if(r.length>=t.minimum)return;const i=w(r);n.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),be=t("$ZodCheckLengthEquals",(e,t)=>{var n;pe.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!a(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{const r=n.value,i=r.length;if(i===t.length)return;const o=w(r),s=i>t.length;n.issues.push({origin:o,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),ze=t("$ZodCheckStringFormat",(e,t)=>{var n,r;pe.init(e,t),e._zod.onattach.push(e=>{const n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),we=t("$ZodCheckRegex",(e,t)=>{ze.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),ke=t("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=de),ze.init(e,t)}),$e=t("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=fe),ze.init(e,t)}),Oe=t("$ZodCheckIncludes",(e,t)=>{pe.init(e,t);const n=m(t.includes),r=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Se=t("$ZodCheckStartsWith",(e,t)=>{pe.init(e,t);const n=new RegExp(`^${m(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Te=t("$ZodCheckEndsWith",(e,t)=>{pe.init(e,t);const n=new RegExp(`.*${m(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),xe=t("$ZodCheckOverwrite",(e,t)=>{pe.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),Ze={major:4,minor:4,patch:3},Ne=t("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ze;const i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(const t of i)for(const n of t._zod.onattach)n(e);if(0===i.length)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const t=(e,t,r)=>{let i,o=v(e);for(const s of t){if(s._zod.def.when){if(y(e))continue;if(!s._zod.def.when(e))continue}else if(o)continue;const t=e.issues.length,a=s._zod.check(e);if(a instanceof Promise&&!1===r?.async)throw new n;if(i||a instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await a,e.issues.length!==t&&(o||(o=v(e,t)))});else{if(e.issues.length===t)continue;o||(o=v(e,t))}}return i?i.then(()=>e):e},r=(r,o,s)=>{if(v(r))return r.aborted=!0,r;const a=t(o,i,s);if(a instanceof Promise){if(!1===s.async)throw new n;return a.then(t=>e._zod.parse(t,s))}return e._zod.parse(a,s)};e._zod.run=(o,s)=>{if(s.skipChecks)return e._zod.parse(o,s);if("backward"===s.direction){const t=e._zod.parse({value:o.value,issues:[]},{...s,skipChecks:!0});return t instanceof Promise?t.then(e=>r(e,o,s)):r(t,o,s)}const a=e._zod.parse(o,s);if(a instanceof Promise){if(!1===s.async)throw new n;return a.then(e=>t(e,i,s))}return t(a,i,s)}}d(e,"~standard",()=>({validate:t=>{try{const n=N(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return E(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),Ie=t("$ZodString",(e,t)=>{var n;Ne.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(n=e._zod.bag,new RegExp(`^${n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*"}$`)),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch(r){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Ee=t("$ZodStringFormat",(e,t)=>{ze.init(e,t),Ie.init(e,t)}),Pe=t("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=B),Ee.init(e,t)}),Ae=t("$ZodUUID",(e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=H(e))}else t.pattern??(t.pattern=H());Ee.init(e,t)}),je=t("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=K),Ee.init(e,t)}),Fe=t("$ZodURL",(e,t)=>{Ee.init(e,t),e._zod.check=n=>{try{const r=n.value.trim();if(!t.normalize&&t.protocol?.source===re.source&&!/^https?:\/\//i.test(r))return void n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});const i=new URL(r);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),void(t.normalize?n.value=i.href:n.value=r)}catch(r){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),Ce=t("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Ee.init(e,t)}),Je=t("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=G),Ee.init(e,t)}),Me=t("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=R),Ee.init(e,t)}),De=t("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=U),Ee.init(e,t)}),Re=t("$ZodULID",(e,t)=>{t.pattern??(t.pattern=V),Ee.init(e,t)}),Ue=t("$ZodXID",(e,t)=>{t.pattern??(t.pattern=L),Ee.init(e,t)}),Ve=t("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=W),Ee.init(e,t)}),Le=t("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){const t=ae({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${oe}T(?:${r})$`)}(t)),Ee.init(e,t)}),We=t("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=se),Ee.init(e,t)}),Ge=t("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=new RegExp(`^${ae(t)}$`)),Ee.init(e,t)}),Ye=t("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Y),Ee.init(e,t)}),Be=t("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=X),Ee.init(e,t),e._zod.bag.format="ipv4"}),He=t("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=q),Ee.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),Ke=t("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Q),Ee.init(e,t)}),Xe=t("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=ee),Ee.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(2!==r.length)throw new Error;const[e,t]=r;if(!t)throw new Error;const n=Number(t);if(`${n}`!==t)throw new Error;if(n<0||n>128)throw new Error;new URL(`http://[${e}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function qe(e){if(""===e)return!0;if(/\s/.test(e))return!1;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const Qe=t("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=te),Ee.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{qe(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}),et=t("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=ne),Ee.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{(function(e){if(!ne.test(e))return!1;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return qe(t.padEnd(4*Math.ceil(t.length/4),"="))})(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),tt=t("$ZodE164",(e,t)=>{t.pattern??(t.pattern=ie),Ee.init(e,t)}),nt=t("$ZodJWT",(e,t)=>{Ee.init(e,t),e._zod.check=n=>{(function(e,t=null){try{const n=e.split(".");if(3!==n.length)return!1;const[r]=n;if(!r)return!1;const i=JSON.parse(atob(r));return!("typ"in i&&"JWT"!==i?.typ||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),rt=t("$ZodNumber",(e,t)=>{Ne.init(e,t),e._zod.pattern=e._zod.bag.pattern??ce,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch(e){}const i=n.value;if("number"==typeof i&&!Number.isNaN(i)&&Number.isFinite(i))return n;const o="number"==typeof i?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...o?{received:o}:{}}),n}}),it=t("$ZodNumberFormat",(e,t)=>{_e.init(e,t),rt.init(e,t)});function ot(e,t,n){var r,i;e.issues.length&&t.issues.push(...(r=n,i=e.issues,i.map(e=>{var t;return(t=e).path??(t.path=[]),e.path.unshift(r),e}))),t.value[n]=e.value}const st=t("$ZodArray",(e,t)=>{Ne.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=Array(i.length);const o=[];for(let e=0;e<i.length;e++){const s=i[e],a=t.element._zod.run({value:s,issues:[]},r);a instanceof Promise?o.push(a.then(t=>ot(t,n,e))):ot(a,n,e)}return o.length?Promise.all(o).then(()=>n):n}});function at(e,t,n,r){for(const n of e)if(0===n.issues.length)return t.value=n.value,t;const i=e.filter(e=>!v(e));return 1===i.length?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>z(e,r,o())))}),t)}const ut=t("$ZodUnion",(e,t)=>{Ne.init(e,t),d(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),d(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),d(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),d(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){const e=t.options.map(e=>e._zod.pattern);return new RegExp(`^(${e.map(e=>u(e.source)).join("|")})$`)}});const n=1===t.options.length?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let o=!1;const s=[];for(const e of t.options){const t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)s.push(t),o=!0;else{if(0===t.issues.length)return t;s.push(t)}}return o?Promise.all(s).then(t=>at(t,r,e,i)):at(s,r,e,i)}}),ct=t("$ZodIntersection",(e,t)=>{Ne.init(e,t),e._zod.parse=(e,n)=>{const r=e.value,i=t.left._zod.run({value:r,issues:[]},n),o=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||o instanceof Promise?Promise.all([i,o]).then(([t,n])=>ft(e,t,n)):ft(e,i,o)}});function dt(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(l(e)&&l(t)){const n=Object.keys(t),r=Object.keys(e).filter(e=>-1!==n.indexOf(e)),i={...e,...t};for(const n of r){const r=dt(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const i=dt(e[r],t[r]);if(!i.valid)return{valid:!1,mergeErrorPath:[r,...i.mergeErrorPath]};n.push(i.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function ft(e,t,n){const r=new Map;let i;for(const n of t.issues)if("unrecognized_keys"===n.code){i??(i=n);for(const e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(const t of n.issues)if("unrecognized_keys"===t.code)for(const e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);const o=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(o.length&&i&&e.issues.push({...i,keys:o}),v(e))return e;const s=dt(t.value,n.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}const pt=t("$ZodTransform",(e,t)=>{Ne.init(e,t),e._zod.optin="optional",e._zod.parse=(i,o)=>{if("backward"===o.direction)throw new r(e.constructor.name);const s=t.transform(i.value,i);if(o.async)return(s instanceof Promise?s:Promise.resolve(s)).then(e=>(i.value=e,i.fallback=!0,i));if(s instanceof Promise)throw new n;return i.value=s,i.fallback=!0,i}});function lt(e,t){return void 0===t&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const ht=t("$ZodOptional",(e,t)=>{Ne.init(e,t),e._zod.optin="optional",e._zod.optout="optional",d(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),d(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${u(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){const r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>lt(e,r)):lt(i,r)}return void 0===e.value?e:t.innerType._zod.run(e,n)}}),mt=t("$ZodExactOptional",(e,t)=>{ht.init(e,t),d(e._zod,"values",()=>t.innerType._zod.values),d(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),gt=t("$ZodNullable",(e,t)=>{Ne.init(e,t),d(e._zod,"optin",()=>t.innerType._zod.optin),d(e._zod,"optout",()=>t.innerType._zod.optout),d(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${u(e.source)}|null)$`):void 0}),d(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)}),_t=t("$ZodDefault",(e,t)=>{Ne.init(e,t),e._zod.optin="optional",d(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>vt(e,t)):vt(r,t)}});function vt(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const yt=t("$ZodPrefault",(e,t)=>{Ne.init(e,t),e._zod.optin="optional",d(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>("backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),bt=t("$ZodNonOptional",(e,t)=>{Ne.init(e,t),d(e._zod,"values",()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(n,r)=>{const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>zt(t,e)):zt(i,e)}});function zt(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const wt=t("$ZodCatch",(e,t)=>{Ne.init(e,t),e._zod.optin="optional",d(e._zod,"optout",()=>t.innerType._zod.optout),d(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>z(e,n,o()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>z(e,n,o()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),kt=t("$ZodPipe",(e,t)=>{Ne.init(e,t),d(e._zod,"values",()=>t.in._zod.values),d(e._zod,"optin",()=>t.in._zod.optin),d(e._zod,"optout",()=>t.out._zod.optout),d(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if("backward"===n.direction){const r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>$t(e,t.in,n)):$t(r,t.in,n)}const r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>$t(e,t.out,n)):$t(r,t.out,n)}});function $t(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}const Ot=t("$ZodReadonly",(e,t)=>{Ne.init(e,t),d(e._zod,"propValues",()=>t.innerType._zod.propValues),d(e._zod,"values",()=>t.innerType._zod.values),d(e._zod,"optin",()=>t.innerType?._zod?.optin),d(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(St):St(r)}});function St(e){return e.value=Object.freeze(e.value),e}const Tt=t("$ZodCustom",(e,t)=>{pe.init(e,t),Ne.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>xt(t,n,r,e));xt(i,n,r,e)}});function xt(e,t,n,r){if(!e){const e={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(k(e))}}var Zt;(Zt=globalThis).__zod_globalRegistry??(Zt.__zod_globalRegistry=new class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){const n=t[0];return this._map.set(e,n),n&&"object"==typeof n&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const n={...this.get(t)??{}};delete n.id;const r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}});const Nt=globalThis.__zod_globalRegistry;function It(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...g(t)})}function Et(e,t){return new he({check:"less_than",...g(t),value:e,inclusive:!1})}function Pt(e,t){return new he({check:"less_than",...g(t),value:e,inclusive:!0})}function At(e,t){return new me({check:"greater_than",...g(t),value:e,inclusive:!1})}function jt(e,t){return new me({check:"greater_than",...g(t),value:e,inclusive:!0})}function Ft(e,t){return new ge({check:"multiple_of",...g(t),value:e})}function Ct(e,t){return new ve({check:"max_length",...g(t),maximum:e})}function Jt(e,t){return new ye({check:"min_length",...g(t),minimum:e})}function Mt(e,t){return new be({check:"length_equals",...g(t),length:e})}function Dt(e){return new xe({check:"overwrite",tx:e})}function Rt(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Nt,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Ut(e,t,n={path:[],schemaPath:[]}){var r;const i=e._zod.def,o=t.seen.get(e);if(o)return o.count++,n.schemaPath.includes(e)&&(o.cycle=n.path),o.schema;const s={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,s);const a=e._zod.toJSONSchema?.();if(a)s.schema=a;else{const r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,r);else{const n=s.schema,o=t.processors[i.type];if(!o)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);o(e,t,n,r)}const o=e._zod.parent;o&&(s.ref||(s.ref=o),Ut(o,t,r),t.seen.get(o).isParent=!0)}const u=t.metadataRegistry.get(e);return u&&Object.assign(s.schema,u),"input"===t.io&&Wt(e)&&(delete s.schema.examples,delete s.schema.default),"input"===t.io&&"_prefault"in s.schema&&((r=s.schema).default??(r.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function Vt(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const t of e.seen.entries()){const n=e.metadataRegistry.get(t[0])?.id;if(n){const e=r.get(n);if(e&&e!==t[0])throw new Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}const i=t=>{if(t[1].schema.$ref)return;const r=t[1],{ref:i,defId:o}=(t=>{const r="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){const n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};const o=t[1].defId??t[1].schema.id??"schema"+e.counter++;return t[1].defId=o,{defId:o,ref:`${i("__shared")}#/${r}/${o}`}}if(t[1]===n)return{ref:"#"};const i=`#/${r}/`,o=t[1].schema.id??"__schema"+e.counter++;return{defId:o,ref:i+o}})(t);r.def={...r.schema},o&&(r.defId=o);const s=r.schema;for(const e in s)delete s[e];s.$ref=i};if("throw"===e.cycles)for(const t of e.seen.entries()){const e=t[1];if(e.cycle)throw new Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>\n\nSet the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const n of e.seen.entries()){const r=n[1];if(t===n[0]){i(n);continue}if(e.external){const r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){i(n);continue}}const o=e.metadataRegistry.get(n[0])?.id;(o||r.cycle||r.count>1&&"ref"===e.reused)&&i(n)}}function Lt(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=t=>{const n=e.seen.get(t);if(null===n.ref)return;const i=n.def??n.schema,o={...i},s=n.ref;if(n.ref=null,s){r(s);const n=e.seen.get(s),a=n.schema;if(!a.$ref||"draft-07"!==e.target&&"draft-04"!==e.target&&"openapi-3.0"!==e.target?Object.assign(i,a):(i.allOf=i.allOf??[],i.allOf.push(a)),Object.assign(i,o),t._zod.parent===s)for(const e in i)"$ref"!==e&&"allOf"!==e&&(e in o||delete i[e]);if(a.$ref&&n.def)for(const e in i)"$ref"!==e&&"allOf"!==e&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}const a=t._zod.parent;if(a&&a!==s){r(a);const t=e.seen.get(a);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(const e in i)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(const t of[...e.seen.entries()].reverse())r(t[0]);const i={};if("draft-2020-12"===e.target?i.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?i.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const n=e.external.registry.get(t)?.id;if(!n)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);const o=e.metadataRegistry.get(t)?.id;void 0!==o&&i.id===o&&delete i.id;const s=e.external?.defs??{};for(const t of e.seen.entries()){const e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,s[e.defId]=e.def)}e.external||Object.keys(s).length>0&&("draft-2020-12"===e.target?i.$defs=s:i.definitions=s);try{const n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t["~standard"],jsonSchema:{input:Gt(t,"input",e.processors),output:Gt(t,"output",e.processors)}},enumerable:!1,writable:!1}),n}catch(e){throw new Error("Error converting schema to JSON.")}}function Wt(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if("transform"===r.type)return!0;if("array"===r.type)return Wt(r.element,n);if("set"===r.type)return Wt(r.valueType,n);if("lazy"===r.type)return Wt(r.getter(),n);if("promise"===r.type||"optional"===r.type||"nonoptional"===r.type||"nullable"===r.type||"readonly"===r.type||"default"===r.type||"prefault"===r.type)return Wt(r.innerType,n);if("intersection"===r.type)return Wt(r.left,n)||Wt(r.right,n);if("record"===r.type||"map"===r.type)return Wt(r.keyType,n)||Wt(r.valueType,n);if("pipe"===r.type)return!!e._zod.traits.has("$ZodCodec")||Wt(r.in,n)||Wt(r.out,n);if("object"===r.type){for(const e in r.shape)if(Wt(r.shape[e],n))return!0;return!1}if("union"===r.type){for(const e of r.options)if(Wt(e,n))return!0;return!1}if("tuple"===r.type){for(const e of r.items)if(Wt(e,n))return!0;return!(!r.rest||!Wt(r.rest,n))}return!1}const Gt=(e,t,n={})=>r=>{const{libraryOptions:i,target:o}=r??{},s=Rt({...i??{},target:o,io:t,processors:n});return Ut(e,s),Vt(s,e),Lt(s,e)},Yt={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Bt=(e,t,n,r)=>{const i=e._zod.def;Ut(i.innerType,t,r),t.seen.get(e).ref=i.innerType},Ht=t("ZodISODateTime",(e,t)=>{Le.init(e,t),bn.init(e,t)});const Kt=t("ZodISODate",(e,t)=>{We.init(e,t),bn.init(e,t)});const Xt=t("ZodISOTime",(e,t)=>{Ge.init(e,t),bn.init(e,t)});const qt=t("ZodISODuration",(e,t)=>{Ye.init(e,t),bn.init(e,t)});const Qt=(e,t)=>{O.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t=e=>e.message){const n={_errors:[]},r=(e,i=[])=>{for(const o of e.issues)if("invalid_union"===o.code&&o.errors.length)o.errors.map(e=>r({issues:e},[...i,...o.path]));else if("invalid_key"===o.code)r({issues:o.issues},[...i,...o.path]);else if("invalid_element"===o.code)r({issues:o.issues},[...i,...o.path]);else{const e=[...i,...o.path];if(0===e.length)n._errors.push(t(o));else{let r=n,i=0;for(;i<e.length;){const n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(o))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}(e,t)},flatten:{value:t=>function(e,t=e=>e.message){const n={},r=[];for(const i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,s,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,s,2)}},isEmpty:{get:()=>0===e.issues.length}})},en=t("ZodError",Qt,{Parent:Error}),tn=T(en),nn=x(en),rn=Z(en),on=I(en),sn=P(en),an=A(en),un=j(en),cn=F(en),dn=C(en),fn=J(en),pn=M(en),ln=D(en),hn=new WeakMap;function mn(e,t,n){const r=Object.getPrototypeOf(e);let i=hn.get(r);if(i||(i=new Set,hn.set(r,i)),!i.has(t)){i.add(t);for(const e in n){const t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){const n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}const gn=t("ZodType",(e,t)=>(Ne.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Gt(e,"input"),output:Gt(e,"output")}}),e.toJSONSchema=((e,t={})=>n=>{const r=Rt({...n,processors:t});return Ut(e,r),Vt(r,e),Lt(r,e)})(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>tn(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>rn(e,t,n),e.parseAsync=async(t,n)=>nn(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>on(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>sn(e,t,n),e.decode=(t,n)=>an(e,t,n),e.encodeAsync=async(t,n)=>un(e,t,n),e.decodeAsync=async(t,n)=>cn(e,t,n),e.safeEncode=(t,n)=>dn(e,t,n),e.safeDecode=(t,n)=>fn(e,t,n),e.safeEncodeAsync=async(t,n)=>pn(e,t,n),e.safeDecodeAsync=async(t,n)=>ln(e,t,n),mn(e,"ZodType",{check(...e){const t=this.def;return this.clone(function(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}(t,{checks:[...t.checks??[],...e.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return function(e,t,n){const r=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(r._zod.parent=e),r}(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(function(e,t={}){return function(e,t,n){return new ar({type:"custom",check:"custom",fn:t,...g(n)})}(0,e,t)}(e,t))},superRefine(e,t){return this.check(function(e,t){return function(e,t){const n=function(e,t){const n=new pe({check:"custom",...g(t)});return n._zod.check=e,n}(t=>(t.addIssue=e=>{if("string"==typeof e)t.issues.push(k(e,t.value,n._zod.def));else{const r=e;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=t.value),r.inst??(r.inst=n),r.continue??(r.continue=!n._zod.def.abort),t.issues.push(k(r))}},e(t.value,t)),t);return n}(e,t)}(e,t))},overwrite(e){return this.check(Dt(e))},optional(){return Kn(this)},exactOptional(){return new Xn({type:"optional",innerType:this})},nullable(){return Qn(this)},nullish(){return Kn(Qn(this))},nonoptional(e){return function(e,t){return new nr({type:"nonoptional",innerType:e,...g(t)})}(this,e)},array(){return Wn(this)},or(e){return new Gn({type:"union",options:[this,e],...g(void 0)})},and(e){return new Yn({type:"intersection",left:this,right:e})},transform(e){return or(this,new Bn({type:"transform",transform:e}))},default(e){return t=e,new er({type:"default",innerType:this,get defaultValue(){return"function"==typeof t?t():h(t)}});var t},prefault(e){return t=e,new tr({type:"prefault",innerType:this,get defaultValue(){return"function"==typeof t?t():h(t)}});var t},catch(e){return new rr({type:"catch",innerType:this,catchValue:"function"==typeof(t=e)?t:()=>t});var t},pipe(e){return or(this,e)},readonly(){return new sr({type:"readonly",innerType:this})},describe(e){const t=this.clone();return Nt.add(t,{description:e}),t},meta(...e){if(0===e.length)return Nt.get(this);const t=this.clone();return Nt.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get:()=>Nt.get(e)?.description,configurable:!0}),e)),_n=t("_ZodString",(e,t)=>{Ie.init(e,t),gn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=n;r.type="string";const{minimum:i,maximum:o,format:s,patterns:a,contentEncoding:u}=e._zod.bag;if("number"==typeof i&&(r.minLength=i),"number"==typeof o&&(r.maxLength=o),s&&(r.format=Yt[s]??s,""===r.format&&delete r.format,"time"===s&&delete r.format),u&&(r.contentEncoding=u),a&&a.size>0){const e=[...a];1===e.length?r.pattern=e[0].source:e.length>1&&(r.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}})(e,t,n);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,mn(e,"_ZodString",{regex(...e){return this.check(function(e,t){return new we({check:"string_format",format:"regex",...g(t),pattern:e})}(...e))},includes(...e){return this.check(function(e,t){return new Oe({check:"string_format",format:"includes",...g(t),includes:e})}(...e))},startsWith(...e){return this.check(function(e,t){return new Se({check:"string_format",format:"starts_with",...g(t),prefix:e})}(...e))},endsWith(...e){return this.check(function(e,t){return new Te({check:"string_format",format:"ends_with",...g(t),suffix:e})}(...e))},min(...e){return this.check(Jt(...e))},max(...e){return this.check(Ct(...e))},length(...e){return this.check(Mt(...e))},nonempty(...e){return this.check(Jt(1,...e))},lowercase(e){return this.check(function(e){return new ke({check:"string_format",format:"lowercase",...g(e)})}(e))},uppercase(e){return this.check(function(e){return new $e({check:"string_format",format:"uppercase",...g(e)})}(e))},trim(){return this.check(Dt(e=>e.trim()))},normalize(...e){return this.check(function(e){return Dt(t=>t.normalize(e))}(...e))},toLowerCase(){return this.check(Dt(e=>e.toLowerCase()))},toUpperCase(){return this.check(Dt(e=>e.toUpperCase()))},slugify(){return this.check(Dt(e=>function(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}(e)))}})}),vn=t("ZodString",(e,t)=>{Ie.init(e,t),_n.init(e,t),e.email=t=>e.check(function(e,t){return new zn({type:"string",format:"email",check:"string_format",abort:!1,...g(t)})}(0,t)),e.url=t=>e.check(function(e,t){return new $n({type:"string",format:"url",check:"string_format",abort:!1,...g(t)})}(0,t)),e.jwt=t=>e.check(function(e,t){return new Mn({type:"string",format:"jwt",check:"string_format",abort:!1,...g(t)})}(0,t)),e.emoji=t=>e.check(function(e,t){return new On({type:"string",format:"emoji",check:"string_format",abort:!1,...g(t)})}(0,t)),e.guid=t=>e.check(It(wn,t)),e.uuid=t=>e.check(function(e,t){return new kn({type:"string",format:"uuid",check:"string_format",abort:!1,...g(t)})}(0,t)),e.uuidv4=t=>e.check(function(e,t){return new kn({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...g(t)})}(0,t)),e.uuidv6=t=>e.check(function(e,t){return new kn({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...g(t)})}(0,t)),e.uuidv7=t=>e.check(function(e,t){return new kn({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...g(t)})}(0,t)),e.nanoid=t=>e.check(function(e,t){return new Sn({type:"string",format:"nanoid",check:"string_format",abort:!1,...g(t)})}(0,t)),e.guid=t=>e.check(It(wn,t)),e.cuid=t=>e.check(function(e,t){return new Tn({type:"string",format:"cuid",check:"string_format",abort:!1,...g(t)})}(0,t)),e.cuid2=t=>e.check(function(e,t){return new xn({type:"string",format:"cuid2",check:"string_format",abort:!1,...g(t)})}(0,t)),e.ulid=t=>e.check(function(e,t){return new Zn({type:"string",format:"ulid",check:"string_format",abort:!1,...g(t)})}(0,t)),e.base64=t=>e.check(function(e,t){return new Fn({type:"string",format:"base64",check:"string_format",abort:!1,...g(t)})}(0,t)),e.base64url=t=>e.check(function(e,t){return new Cn({type:"string",format:"base64url",check:"string_format",abort:!1,...g(t)})}(0,t)),e.xid=t=>e.check(function(e,t){return new Nn({type:"string",format:"xid",check:"string_format",abort:!1,...g(t)})}(0,t)),e.ksuid=t=>e.check(function(e,t){return new In({type:"string",format:"ksuid",check:"string_format",abort:!1,...g(t)})}(0,t)),e.ipv4=t=>e.check(function(e,t){return new En({type:"string",format:"ipv4",check:"string_format",abort:!1,...g(t)})}(0,t)),e.ipv6=t=>e.check(function(e,t){return new Pn({type:"string",format:"ipv6",check:"string_format",abort:!1,...g(t)})}(0,t)),e.cidrv4=t=>e.check(function(e,t){return new An({type:"string",format:"cidrv4",check:"string_format",abort:!1,...g(t)})}(0,t)),e.cidrv6=t=>e.check(function(e,t){return new jn({type:"string",format:"cidrv6",check:"string_format",abort:!1,...g(t)})}(0,t)),e.e164=t=>e.check(function(e,t){return new Jn({type:"string",format:"e164",check:"string_format",abort:!1,...g(t)})}(0,t)),e.datetime=t=>e.check(function(e){return function(e,t){return new Ht({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...g(t)})}(0,e)}(t)),e.date=t=>e.check(function(e){return function(e,t){return new Kt({type:"string",format:"date",check:"string_format",...g(t)})}(0,e)}(t)),e.time=t=>e.check(function(e){return function(e,t){return new Xt({type:"string",format:"time",check:"string_format",precision:null,...g(t)})}(0,e)}(t)),e.duration=t=>e.check(function(e){return function(e,t){return new qt({type:"string",format:"duration",check:"string_format",...g(t)})}(0,e)}(t))});function yn(e){return function(e,t){return new vn({type:"string",...g(t)})}(0,e)}const bn=t("ZodStringFormat",(e,t)=>{Ee.init(e,t),_n.init(e,t)}),zn=t("ZodEmail",(e,t)=>{je.init(e,t),bn.init(e,t)}),wn=t("ZodGUID",(e,t)=>{Pe.init(e,t),bn.init(e,t)}),kn=t("ZodUUID",(e,t)=>{Ae.init(e,t),bn.init(e,t)}),$n=t("ZodURL",(e,t)=>{Fe.init(e,t),bn.init(e,t)}),On=t("ZodEmoji",(e,t)=>{Ce.init(e,t),bn.init(e,t)}),Sn=t("ZodNanoID",(e,t)=>{Je.init(e,t),bn.init(e,t)}),Tn=t("ZodCUID",(e,t)=>{Me.init(e,t),bn.init(e,t)}),xn=t("ZodCUID2",(e,t)=>{De.init(e,t),bn.init(e,t)}),Zn=t("ZodULID",(e,t)=>{Re.init(e,t),bn.init(e,t)}),Nn=t("ZodXID",(e,t)=>{Ue.init(e,t),bn.init(e,t)}),In=t("ZodKSUID",(e,t)=>{Ve.init(e,t),bn.init(e,t)}),En=t("ZodIPv4",(e,t)=>{Be.init(e,t),bn.init(e,t)}),Pn=t("ZodIPv6",(e,t)=>{He.init(e,t),bn.init(e,t)}),An=t("ZodCIDRv4",(e,t)=>{Ke.init(e,t),bn.init(e,t)}),jn=t("ZodCIDRv6",(e,t)=>{Xe.init(e,t),bn.init(e,t)}),Fn=t("ZodBase64",(e,t)=>{Qe.init(e,t),bn.init(e,t)}),Cn=t("ZodBase64URL",(e,t)=>{et.init(e,t),bn.init(e,t)}),Jn=t("ZodE164",(e,t)=>{tt.init(e,t),bn.init(e,t)}),Mn=t("ZodJWT",(e,t)=>{nt.init(e,t),bn.init(e,t)}),Dn=t("ZodNumber",(e,t)=>{rt.init(e,t),gn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=n,{minimum:i,maximum:o,format:s,multipleOf:a,exclusiveMaximum:u,exclusiveMinimum:c}=e._zod.bag;"string"==typeof s&&s.includes("int")?r.type="integer":r.type="number";const d="number"==typeof c&&c>=(i??Number.NEGATIVE_INFINITY),f="number"==typeof u&&u<=(o??Number.POSITIVE_INFINITY),p="draft-04"===t.target||"openapi-3.0"===t.target;d?p?(r.minimum=c,r.exclusiveMinimum=!0):r.exclusiveMinimum=c:"number"==typeof i&&(r.minimum=i),f?p?(r.maximum=u,r.exclusiveMaximum=!0):r.exclusiveMaximum=u:"number"==typeof o&&(r.maximum=o),"number"==typeof a&&(r.multipleOf=a)})(e,t,n),mn(e,"ZodNumber",{gt(e,t){return this.check(At(e,t))},gte(e,t){return this.check(jt(e,t))},min(e,t){return this.check(jt(e,t))},lt(e,t){return this.check(Et(e,t))},lte(e,t){return this.check(Pt(e,t))},max(e,t){return this.check(Pt(e,t))},int(e){return this.check(Vn(e))},safe(e){return this.check(Vn(e))},positive(e){return this.check(At(0,e))},nonnegative(e){return this.check(jt(0,e))},negative(e){return this.check(Et(0,e))},nonpositive(e){return this.check(Pt(0,e))},multipleOf(e,t){return this.check(Ft(e,t))},step(e,t){return this.check(Ft(e,t))},finite(){return this}});const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Rn(e){return function(e,t){return new Dn({type:"number",checks:[],...g(t)})}(0,e)}const Un=t("ZodNumberFormat",(e,t)=>{it.init(e,t),Dn.init(e,t)});function Vn(e){return function(e,t){return new Un({type:"number",check:"number_format",abort:!1,format:"safeint",...g(t)})}(0,e)}const Ln=t("ZodArray",(e,t)=>{st.init(e,t),gn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const i=n,o=e._zod.def,{minimum:s,maximum:a}=e._zod.bag;"number"==typeof s&&(i.minItems=s),"number"==typeof a&&(i.maxItems=a),i.type="array",i.items=Ut(o.element,t,{...r,path:[...r.path,"items"]})})(e,t,n,r),e.element=t.element,mn(e,"ZodArray",{min(e,t){return this.check(Jt(e,t))},nonempty(e){return this.check(Jt(1,e))},max(e,t){return this.check(Ct(e,t))},length(e,t){return this.check(Mt(e,t))},unwrap(){return this.element}})});function Wn(e,t){return function(e,t,n){return new Ln({type:"array",element:t,...g(n)})}(0,e,t)}const Gn=t("ZodUnion",(e,t)=>{ut.init(e,t),gn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const i=e._zod.def,o=!1===i.inclusive,s=i.options.map((e,n)=>Ut(e,t,{...r,path:[...r.path,o?"oneOf":"anyOf",n]}));o?n.oneOf=s:n.anyOf=s})(e,t,n,r),e.options=t.options}),Yn=t("ZodIntersection",(e,t)=>{ct.init(e,t),gn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const i=e._zod.def,o=Ut(i.left,t,{...r,path:[...r.path,"allOf",0]}),s=Ut(i.right,t,{...r,path:[...r.path,"allOf",1]}),a=e=>"allOf"in e&&1===Object.keys(e).length,u=[...a(o)?o.allOf:[o],...a(s)?s.allOf:[s]];n.allOf=u})(e,t,n,r)}),Bn=t("ZodTransform",(e,t)=>{pt.init(e,t),gn.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Transforms cannot be represented in JSON Schema")})(0,e),e._zod.parse=(n,i)=>{if("backward"===i.direction)throw new r(e.constructor.name);n.addIssue=r=>{if("string"==typeof r)n.issues.push(k(r,n.value,t));else{const t=r;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),n.issues.push(k(t))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=o,n.fallback=!0,n)}}),Hn=t("ZodOptional",(e,t)=>{ht.init(e,t),gn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bt(e,t,0,r),e.unwrap=()=>e._zod.def.innerType});function Kn(e){return new Hn({type:"optional",innerType:e})}const Xn=t("ZodExactOptional",(e,t)=>{mt.init(e,t),gn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bt(e,t,0,r),e.unwrap=()=>e._zod.def.innerType}),qn=t("ZodNullable",(e,t)=>{gt.init(e,t),gn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const i=e._zod.def,o=Ut(i.innerType,t,r),s=t.seen.get(e);"openapi-3.0"===t.target?(s.ref=i.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}]})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Qn(e){return new qn({type:"nullable",innerType:e})}const er=t("ZodDefault",(e,t)=>{_t.init(e,t),gn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const i=e._zod.def;Ut(i.innerType,t,r),t.seen.get(e).ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}),tr=t("ZodPrefault",(e,t)=>{yt.init(e,t),gn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const i=e._zod.def;Ut(i.innerType,t,r),t.seen.get(e).ref=i.innerType,"input"===t.io&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),nr=t("ZodNonOptional",(e,t)=>{bt.init(e,t),gn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const i=e._zod.def;Ut(i.innerType,t,r),t.seen.get(e).ref=i.innerType})(e,t,0,r),e.unwrap=()=>e._zod.def.innerType}),rr=t("ZodCatch",(e,t)=>{wt.init(e,t),gn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const i=e._zod.def;let o;Ut(i.innerType,t,r),t.seen.get(e).ref=i.innerType;try{o=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=o})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}),ir=t("ZodPipe",(e,t)=>{kt.init(e,t),gn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const i=e._zod.def,o=i.in._zod.traits.has("$ZodTransform"),s="input"===t.io?o?i.out:i.in:i.out;Ut(s,t,r),t.seen.get(e).ref=s})(e,t,0,r),e.in=t.in,e.out=t.out});function or(e,t){return new ir({type:"pipe",in:e,out:t})}const sr=t("ZodReadonly",(e,t)=>{Ot.init(e,t),gn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const i=e._zod.def;Ut(i.innerType,t,r),t.seen.get(e).ref=i.innerType,n.readOnly=!0})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),ar=t("ZodCustom",(e,t)=>{Tt.init(e,t),gn.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Custom types cannot be represented in JSON Schema")})(0,e)});async function ur(e,t,n,r){const i=e.endpoint?.trim(),o=e.token?.trim();if(!i||!o)throw new Error("TaskHandoff Story tools are not configured.");const s=await(e.fetch||globalThis.fetch)(`${i}/invoke`,{method:"POST",headers:{authorization:`Bearer ${o}`,"content-type":"application/json"},body:JSON.stringify({provider:"opencode",providerSessionId:r.sessionID,tool:t,arguments:n}),signal:r.abort}),a=await s.json();if(!s.ok){const e=a.error?.message||`TaskHandoff Story tool failed with HTTP ${s.status}.`;throw Object.assign(new Error(e),{code:a.error?.code})}return JSON.stringify(a.data)}function cr(e={endpoint:process.env.TASK_HANDOFF_AGENT_TOOLS_ENDPOINT,token:process.env.TASK_HANDOFF_AGENT_TOOLS_TOKEN}){return async()=>({tool:{story_list_content:{description:"List a page of indexed documents in the Story assigned to the current AI Session, ordered newest to oldest. Start with page 1, increment page while pagination.hasMore is true, then pass selected storyPath values to story_get_content.",args:{page:Rn().int().min(1).max(500).default(1).describe("One-based page number."),pageSize:Rn().int().min(1).max(100).default(20).describe("Maximum documents to return per page.")},execute:(t,n)=>ur(e,"story_list_content",t,n)},story_get_content:{description:"Copy one or more Story documents selected by exact storyPath from story_list_content into a directory in the current workspace. Files retain their Story-relative paths; read the returned local paths with workspace tools.",args:{storyPaths:Wn(yn()).min(1).max(20),destinationPath:yn()},execute:(t,n)=>ur(e,"story_get_content",t,n)},story_set_content:{description:"Create or replace one indexed Story document from a regular file in the current workspace. A new document requires title; replacing one requires the expectedRevision returned by story_list_content or story_get_content.",args:{storyPath:yn(),title:yn().optional(),sourcePath:yn(),expectedRevision:yn().regex(/^[a-f0-9]{64}$/).optional()},execute:(t,n)=>ur(e,"story_set_content",t,n)}}})}var dr=cr();export{cr as createOpenCodeStoryPlugin,dr as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@task-handoff/controlled-instance",
3
- "version": "0.0.30",
3
+ "version": "0.0.32",
4
4
  "description": "Prebuilt TaskHandoff controlled instance runtime.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "commonjs",
@@ -1 +1 @@
1
- import{g as p,r as u,d as n}from"./chunk-MOJQB5TN-CwWKwFyu.js";import{p as f}from"./chunk-JWPE2WC7-CgexD2pH.js";import{b as a,aE as o}from"./mermaid.core-BhlvCYtR.js";import{M as c,c as d}from"./cynefin-VYW2F7L2-BIactdfy.js";import"./index-DJpgl-tt.js";import"./ui-vendor-CYGfnfwU.js";import"./xterm-C0x2rdqx.js";var v=d().RailroadAbnf.parser.LangiumParser,i=a(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=a(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=a(e=>{if(e.includes("*")){const[t,s]=e.split("*"),m=t?parseInt(t,10):0,l=s?parseInt(s,10):1/0;return{min:m,max:l}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=a(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=a(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=a(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=a(e=>{f(e,n),e.title&&n.setTitle(e.title),e.rules.map(r=>n.addRule(P(r)))},"populateDb"),R={parse:a(e=>{n.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:n}},I={parser:R,db:n,renderer:u,styles:p};export{I as diagram};
1
+ import{g as p,r as u,d as n}from"./chunk-MOJQB5TN-C4Jge-mD.js";import{p as f}from"./chunk-JWPE2WC7-DiqKYTTD.js";import{b as a,aE as o}from"./mermaid.core-CRRavpkV.js";import{M as c,c as d}from"./cynefin-VYW2F7L2-D5lv6Xll.js";import"./index-DPQ0PlCs.js";import"./ui-vendor-CYGfnfwU.js";import"./xterm-C0x2rdqx.js";var v=d().RailroadAbnf.parser.LangiumParser,i=a(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=a(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=a(e=>{if(e.includes("*")){const[t,s]=e.split("*"),m=t?parseInt(t,10):0,l=s?parseInt(s,10):1/0;return{min:m,max:l}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=a(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=a(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=a(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=a(e=>{f(e,n),e.title&&n.setTitle(e.title),e.rules.map(r=>n.addRule(P(r)))},"populateDb"),R={parse:a(e=>{n.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:n}},I={parser:R,db:n,renderer:u,styles:p};export{I as diagram};
@@ -1 +1 @@
1
- import{bo as ln,aQ as an,H as X,ba as w,F as K,ai as un,X as y,bf as on,bb as C,aK as _,c as rn,m as t,aI as tn,j as sn,d as fn}from"./mermaid.core-BhlvCYtR.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,q,I,v,A,O,a){var D=q-l,i=I-h,n=O-v,d=a-A,u=d*D-n*i;if(!(u*u<y))return u=(n*(h-A)-d*(l-v))/u,[l+u*D,h+u*i]}function U(l,h,q,I,v,A,O){var a=l-q,D=h-I,i=(O?A:-A)/C(a*a+D*D),n=i*D,d=-i*a,u=l+n,s=h+d,f=q+n,c=I+d,Q=(u+f)/2,o=(s+c)/2,m=f-u,g=c-s,R=m*m+g*g,T=v-A,P=u*c-f*s,E=(g<0?-1:1)*C(tn(0,T*T*R-P*P)),F=(P*g-m*E)/R,H=(-P*m-g*E)/R,b=(P*g+m*E)/R,p=(-P*m+g*E)/R,x=F-Q,e=H-o,r=b-Q,S=p-o;return x*x+e*e>r*r+S*S&&(F=b,H=p),{cx:F,cy:H,x01:-n,y01:-d,x11:F*(v/T-1),y11:H*(v/T-1)}}function hn(){var l=cn,h=yn,q=K(0),I=null,v=gn,A=dn,O=mn,a=null,D=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=A.apply(this,arguments)-un,Q=rn(c-f),o=c>f;if(a||(a=n=D()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if(Q>on-y)a.moveTo(s*X(f),s*w(f)),a.arc(0,0,s,f,c,!o),u>y&&(a.moveTo(u*X(c),u*w(c)),a.arc(0,0,u,c,f,o));else{var m=f,g=c,R=f,T=c,P=Q,E=Q,F=O.apply(this,arguments)/2,H=F>y&&(I?+I.apply(this,arguments):C(u*u+s*s)),b=_(rn(s-u)/2,+q.apply(this,arguments)),p=b,x=b,e,r;if(H>y){var S=sn(H/u*w(F)),G=sn(H/s*w(F));(P-=S*2)>y?(S*=o?1:-1,R+=S,T-=S):(P=0,R=T=(f+c)/2),(E-=G*2)>y?(G*=o?1:-1,m+=G,g-=G):(E=0,m=g=(f+c)/2)}var z=s*X(m),B=s*w(m),J=u*X(T),L=u*w(T);if(b>y){var M=s*X(g),N=s*w(g),V=u*X(R),W=u*w(R),j;if(Q<an)if(j=pn(z,B,V,W,M,N,J,L)){var Y=z-j[0],Z=B-j[1],$=M-j[0],k=N-j[1],nn=1/w(fn((Y*$+Z*k)/(C(Y*Y+Z*Z)*C($*$+k*k)))/2),en=C(j[0]*j[0]+j[1]*j[1]);p=_(b,(u-en)/(nn-1)),x=_(b,(s-en)/(nn+1))}else p=x=0}E>y?x>y?(e=U(V,W,z,B,s,x,o),r=U(M,N,J,L,s,x,o),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<b?a.arc(e.cx,e.cy,x,t(e.y01,e.x01),t(r.y01,r.x01),!o):(a.arc(e.cx,e.cy,x,t(e.y01,e.x01),t(e.y11,e.x11),!o),a.arc(0,0,s,t(e.cy+e.y11,e.cx+e.x11),t(r.cy+r.y11,r.cx+r.x11),!o),a.arc(r.cx,r.cy,x,t(r.y11,r.x11),t(r.y01,r.x01),!o))):(a.moveTo(z,B),a.arc(0,0,s,m,g,!o)):a.moveTo(z,B),!(u>y)||!(P>y)?a.lineTo(J,L):p>y?(e=U(J,L,M,N,u,-p,o),r=U(z,B,V,W,u,-p,o),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<b?a.arc(e.cx,e.cy,p,t(e.y01,e.x01),t(r.y01,r.x01),!o):(a.arc(e.cx,e.cy,p,t(e.y01,e.x01),t(e.y11,e.x11),!o),a.arc(0,0,u,t(e.cy+e.y11,e.cx+e.x11),t(r.cy+r.y11,r.cx+r.x11),o),a.arc(r.cx,r.cy,p,t(r.y11,r.x11),t(r.y01,r.x01),!o))):a.arc(0,0,u,T,R,o)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-an/2;return[X(d)*n,w(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:K(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:K(+n),i):h},i.cornerRadius=function(n){return arguments.length?(q=typeof n=="function"?n:K(+n),i):q},i.padRadius=function(n){return arguments.length?(I=n==null?null:typeof n=="function"?n:K(+n),i):I},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:K(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:K(+n),i):A},i.padAngle=function(n){return arguments.length?(O=typeof n=="function"?n:K(+n),i):O},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};
1
+ import{bo as ln,aQ as an,H as X,ba as w,F as K,ai as un,X as y,bf as on,bb as C,aK as _,c as rn,m as t,aI as tn,j as sn,d as fn}from"./mermaid.core-CRRavpkV.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,q,I,v,A,O,a){var D=q-l,i=I-h,n=O-v,d=a-A,u=d*D-n*i;if(!(u*u<y))return u=(n*(h-A)-d*(l-v))/u,[l+u*D,h+u*i]}function U(l,h,q,I,v,A,O){var a=l-q,D=h-I,i=(O?A:-A)/C(a*a+D*D),n=i*D,d=-i*a,u=l+n,s=h+d,f=q+n,c=I+d,Q=(u+f)/2,o=(s+c)/2,m=f-u,g=c-s,R=m*m+g*g,T=v-A,P=u*c-f*s,E=(g<0?-1:1)*C(tn(0,T*T*R-P*P)),F=(P*g-m*E)/R,H=(-P*m-g*E)/R,b=(P*g+m*E)/R,p=(-P*m+g*E)/R,x=F-Q,e=H-o,r=b-Q,S=p-o;return x*x+e*e>r*r+S*S&&(F=b,H=p),{cx:F,cy:H,x01:-n,y01:-d,x11:F*(v/T-1),y11:H*(v/T-1)}}function hn(){var l=cn,h=yn,q=K(0),I=null,v=gn,A=dn,O=mn,a=null,D=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=A.apply(this,arguments)-un,Q=rn(c-f),o=c>f;if(a||(a=n=D()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if(Q>on-y)a.moveTo(s*X(f),s*w(f)),a.arc(0,0,s,f,c,!o),u>y&&(a.moveTo(u*X(c),u*w(c)),a.arc(0,0,u,c,f,o));else{var m=f,g=c,R=f,T=c,P=Q,E=Q,F=O.apply(this,arguments)/2,H=F>y&&(I?+I.apply(this,arguments):C(u*u+s*s)),b=_(rn(s-u)/2,+q.apply(this,arguments)),p=b,x=b,e,r;if(H>y){var S=sn(H/u*w(F)),G=sn(H/s*w(F));(P-=S*2)>y?(S*=o?1:-1,R+=S,T-=S):(P=0,R=T=(f+c)/2),(E-=G*2)>y?(G*=o?1:-1,m+=G,g-=G):(E=0,m=g=(f+c)/2)}var z=s*X(m),B=s*w(m),J=u*X(T),L=u*w(T);if(b>y){var M=s*X(g),N=s*w(g),V=u*X(R),W=u*w(R),j;if(Q<an)if(j=pn(z,B,V,W,M,N,J,L)){var Y=z-j[0],Z=B-j[1],$=M-j[0],k=N-j[1],nn=1/w(fn((Y*$+Z*k)/(C(Y*Y+Z*Z)*C($*$+k*k)))/2),en=C(j[0]*j[0]+j[1]*j[1]);p=_(b,(u-en)/(nn-1)),x=_(b,(s-en)/(nn+1))}else p=x=0}E>y?x>y?(e=U(V,W,z,B,s,x,o),r=U(M,N,J,L,s,x,o),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<b?a.arc(e.cx,e.cy,x,t(e.y01,e.x01),t(r.y01,r.x01),!o):(a.arc(e.cx,e.cy,x,t(e.y01,e.x01),t(e.y11,e.x11),!o),a.arc(0,0,s,t(e.cy+e.y11,e.cx+e.x11),t(r.cy+r.y11,r.cx+r.x11),!o),a.arc(r.cx,r.cy,x,t(r.y11,r.x11),t(r.y01,r.x01),!o))):(a.moveTo(z,B),a.arc(0,0,s,m,g,!o)):a.moveTo(z,B),!(u>y)||!(P>y)?a.lineTo(J,L):p>y?(e=U(J,L,M,N,u,-p,o),r=U(z,B,V,W,u,-p,o),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<b?a.arc(e.cx,e.cy,p,t(e.y01,e.x01),t(r.y01,r.x01),!o):(a.arc(e.cx,e.cy,p,t(e.y01,e.x01),t(e.y11,e.x11),!o),a.arc(0,0,u,t(e.cy+e.y11,e.cx+e.x11),t(r.cy+r.y11,r.cx+r.x11),o),a.arc(r.cx,r.cy,p,t(r.y11,r.x11),t(r.y01,r.x01),!o))):a.arc(0,0,u,T,R,o)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-an/2;return[X(d)*n,w(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:K(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:K(+n),i):h},i.cornerRadius=function(n){return arguments.length?(q=typeof n=="function"?n:K(+n),i):q},i.padRadius=function(n){return arguments.length?(I=n==null?null:typeof n=="function"?n:K(+n),i):I},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:K(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:K(+n),i):A},i.padAngle=function(n){return arguments.length?(O=typeof n=="function"?n:K(+n),i):O},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};