bsv-mcp 0.2.14 → 0.3.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 (83) hide show
  1. package/CHANGELOG.md +90 -10
  2. package/README.md +13 -13
  3. package/dist/app.html +483 -106
  4. package/dist/index.js +265787 -155292
  5. package/index.ts +505 -70
  6. package/package.json +24 -15
  7. package/prompts/bsvSdk/auth.ts +1 -1
  8. package/prompts/bsvSdk/cryptography.ts +1 -1
  9. package/prompts/bsvSdk/overview.ts +1 -1
  10. package/prompts/bsvSdk/primitives.ts +1 -1
  11. package/prompts/bsvSdk/script.ts +1 -1
  12. package/prompts/bsvSdk/transaction.ts +1 -1
  13. package/prompts/bsvSdk/wallet.ts +1 -1
  14. package/prompts/ordinals.ts +1 -1
  15. package/test-mcp-server.ts +26 -4
  16. package/tools/a2b/discover.ts +2 -2
  17. package/tools/bap/friend.ts +17 -24
  18. package/tools/bap/generate.test.ts +34 -32
  19. package/tools/bap/generate.ts +48 -43
  20. package/tools/bap/getCurrentAddress.ts +1 -3
  21. package/tools/bap/getId.test.ts +18 -10
  22. package/tools/bap/getId.ts +8 -6
  23. package/tools/bap/utils.ts +1 -1
  24. package/tools/bsocial/bmapReadPosts.ts +16 -2
  25. package/tools/bsocial/createPost.ts +21 -10
  26. package/tools/bsocial/readPosts.ts +10 -4
  27. package/tools/bsv/decodeTransaction.ts +1 -1
  28. package/tools/bsv/explore.ts +0 -4
  29. package/tools/bsv/getPrice.ts +1 -1
  30. package/tools/bsv/token.ts +14 -6
  31. package/tools/constants.ts +6 -2
  32. package/tools/index.ts +10 -10
  33. package/tools/mnee/getBalance.ts +1 -1
  34. package/tools/mnee/parseTx.ts +1 -1
  35. package/tools/mnee/sendMnee.ts +30 -8
  36. package/tools/ordinals/getInscription.ts +1 -3
  37. package/tools/ordinals/getTokenByIdOrTicker.ts +1 -3
  38. package/tools/ordinals/index.ts +4 -1
  39. package/tools/ordinals/marketListings.ts +1 -1
  40. package/tools/ordinals/marketSales.ts +1 -1
  41. package/tools/ordinals/searchInscriptions.ts +1 -1
  42. package/tools/utils/aip.ts +31 -22
  43. package/tools/utils/installAgentMaster.ts +8 -9
  44. package/tools/utils/toolRegistration.ts +21 -22
  45. package/tools/utils/transactionBuilder.ts +21 -14
  46. package/tools/wallet/a2bPublishMcp.ts +15 -5
  47. package/tools/wallet/brc100.ts +541 -310
  48. package/tools/wallet/cancelListing.ts +29 -37
  49. package/tools/wallet/createOrdinals.ts +43 -27
  50. package/tools/wallet/fetchPaymentUtxos.ts +7 -5
  51. package/tools/wallet/gatherCollectionInfo.ts +3 -5
  52. package/tools/wallet/getAddress.ts +1 -4
  53. package/tools/wallet/getBalance.ts +15 -15
  54. package/tools/wallet/{getBalanceDroplet.ts → getBalanceDroplit.ts} +6 -6
  55. package/tools/wallet/getBsv21Balances.ts +20 -14
  56. package/tools/wallet/getLockData.ts +11 -11
  57. package/tools/wallet/getOrdinals.ts +26 -20
  58. package/tools/wallet/integratedWallet.ts +55 -53
  59. package/tools/wallet/listOrdinal.ts +40 -39
  60. package/tools/wallet/listTokens.ts +18 -17
  61. package/tools/wallet/lockBsv.ts +36 -22
  62. package/tools/wallet/mintCollection.ts +15 -10
  63. package/tools/wallet/opnsDeregister.ts +29 -39
  64. package/tools/wallet/opnsRegister.ts +29 -39
  65. package/tools/wallet/purchaseListing.test.ts +27 -0
  66. package/tools/wallet/purchaseListing.ts +59 -40
  67. package/tools/wallet/refreshUtxos.ts +1 -1
  68. package/tools/wallet/schemas.ts +0 -13
  69. package/tools/wallet/sendAllBsv.ts +26 -20
  70. package/tools/wallet/sendBsv.ts +107 -0
  71. package/tools/wallet/setupDroplit.ts +157 -0
  72. package/tools/wallet/signBsm.ts +18 -18
  73. package/tools/wallet/sweepBsv.ts +48 -27
  74. package/tools/wallet/sweepBsv21.ts +42 -28
  75. package/tools/wallet/sweepOrdinals.ts +38 -26
  76. package/tools/wallet/tools.ts +11 -13
  77. package/tools/wallet/transactionHelper.ts +13 -5
  78. package/tools/wallet/transferOrdToken.ts +72 -84
  79. package/tools/wallet/unlockBsv.ts +23 -17
  80. package/tools/wallet/utxo.ts +1 -0
  81. package/tools/wallet/wallet.ts +1 -13
  82. package/tools/wallet/sendToAddress.ts +0 -74
  83. package/tools/wallet/setupDroplet.ts +0 -161
package/dist/app.html CHANGED
@@ -768,6 +768,277 @@
768
768
  color: var(--accent-cyan);
769
769
  }
770
770
 
771
+ /* ── Sweep panel ────────────────────────────────────────────── */
772
+ #sweep-panel {
773
+ gap: 0;
774
+ }
775
+
776
+ .sweep-content {
777
+ display: flex;
778
+ flex-direction: column;
779
+ flex: 1;
780
+ padding: 24px;
781
+ overflow-y: auto;
782
+ }
783
+
784
+ .sweep-state {
785
+ display: flex;
786
+ flex-direction: column;
787
+ gap: 20px;
788
+ flex: 1;
789
+ }
790
+
791
+ .sweep-header {
792
+ display: flex;
793
+ flex-direction: column;
794
+ gap: 8px;
795
+ }
796
+
797
+ .sweep-title {
798
+ font-family: var(--font-sans);
799
+ font-size: 22px;
800
+ font-weight: 600;
801
+ color: var(--text-white);
802
+ }
803
+
804
+ .sweep-subtitle {
805
+ font-family: var(--font-sans);
806
+ font-size: 13px;
807
+ color: var(--text-secondary);
808
+ line-height: 1.5;
809
+ }
810
+
811
+ .sweep-input-group {
812
+ display: flex;
813
+ flex-direction: column;
814
+ gap: 8px;
815
+ }
816
+
817
+ .sweep-input-row {
818
+ display: flex;
819
+ gap: 8px;
820
+ }
821
+
822
+ .sweep-text-input {
823
+ flex: 1;
824
+ background: var(--bg-input);
825
+ border: 1px solid var(--border-default);
826
+ border-radius: var(--radius-md);
827
+ padding: 10px 14px;
828
+ color: var(--text-primary);
829
+ font-family: var(--font-mono);
830
+ font-size: 13px;
831
+ outline: none;
832
+ transition: border-color 0.15s;
833
+ }
834
+
835
+ .sweep-text-input:focus {
836
+ border-color: var(--accent-cyan);
837
+ }
838
+
839
+ .sweep-text-input::placeholder {
840
+ color: var(--text-muted);
841
+ }
842
+
843
+ .sweep-scan-btn {
844
+ background: var(--accent-cyan);
845
+ color: var(--bg-page);
846
+ border: none;
847
+ border-radius: var(--radius-md);
848
+ padding: 10px 20px;
849
+ font-family: var(--font-sans);
850
+ font-size: 13px;
851
+ font-weight: 600;
852
+ cursor: pointer;
853
+ transition: opacity 0.15s;
854
+ white-space: nowrap;
855
+ }
856
+
857
+ .sweep-scan-btn:hover { opacity: 0.85; }
858
+ .sweep-scan-btn:disabled { opacity: 0.4; cursor: not-allowed; }
859
+
860
+ .sweep-hint {
861
+ font-family: var(--font-mono);
862
+ font-size: 11px;
863
+ color: var(--text-muted);
864
+ }
865
+
866
+ .sweep-progress {
867
+ display: flex;
868
+ flex-direction: column;
869
+ align-items: center;
870
+ justify-content: center;
871
+ gap: 16px;
872
+ flex: 1;
873
+ min-height: 200px;
874
+ }
875
+
876
+ .sweep-progress-text {
877
+ font-family: var(--font-mono);
878
+ font-size: 12px;
879
+ color: var(--text-secondary);
880
+ letter-spacing: 0.05em;
881
+ }
882
+
883
+ .sweep-address-display {
884
+ font-family: var(--font-mono);
885
+ font-size: 12px;
886
+ color: var(--accent-blue);
887
+ word-break: break-all;
888
+ }
889
+
890
+ .sweep-categories {
891
+ display: flex;
892
+ flex-direction: column;
893
+ gap: 12px;
894
+ }
895
+
896
+ .sweep-category {
897
+ display: flex;
898
+ align-items: center;
899
+ gap: 12px;
900
+ background: var(--bg-surface);
901
+ border: 1px solid var(--border-default);
902
+ border-radius: var(--radius-lg);
903
+ padding: 14px 16px;
904
+ cursor: pointer;
905
+ transition: border-color 0.15s;
906
+ }
907
+
908
+ .sweep-category:hover { border-color: var(--border-strong); }
909
+ .sweep-category.selected { border-color: var(--accent-cyan); }
910
+
911
+ .sweep-category-check {
912
+ width: 20px;
913
+ height: 20px;
914
+ border: 2px solid var(--border-strong);
915
+ border-radius: var(--radius-sm);
916
+ display: flex;
917
+ align-items: center;
918
+ justify-content: center;
919
+ flex-shrink: 0;
920
+ transition: background 0.15s, border-color 0.15s;
921
+ }
922
+
923
+ .sweep-category.selected .sweep-category-check {
924
+ background: var(--accent-cyan);
925
+ border-color: var(--accent-cyan);
926
+ }
927
+
928
+ .sweep-category-check svg {
929
+ width: 12px;
930
+ height: 12px;
931
+ stroke: var(--bg-page);
932
+ fill: none;
933
+ stroke-width: 3;
934
+ stroke-linecap: round;
935
+ stroke-linejoin: round;
936
+ opacity: 0;
937
+ }
938
+
939
+ .sweep-category.selected .sweep-category-check svg { opacity: 1; }
940
+
941
+ .sweep-category-info {
942
+ flex: 1;
943
+ display: flex;
944
+ flex-direction: column;
945
+ gap: 2px;
946
+ }
947
+
948
+ .sweep-category-name {
949
+ font-family: var(--font-sans);
950
+ font-size: 14px;
951
+ font-weight: 500;
952
+ color: var(--text-white);
953
+ }
954
+
955
+ .sweep-category-detail {
956
+ font-family: var(--font-mono);
957
+ font-size: 12px;
958
+ color: var(--text-secondary);
959
+ }
960
+
961
+ .sweep-category-value {
962
+ font-family: var(--font-mono);
963
+ font-size: 14px;
964
+ font-weight: 500;
965
+ color: var(--text-mono);
966
+ white-space: nowrap;
967
+ }
968
+
969
+ .sweep-actions {
970
+ display: flex;
971
+ gap: 12px;
972
+ justify-content: flex-end;
973
+ padding-top: 8px;
974
+ }
975
+
976
+ .sweep-back-btn {
977
+ background: var(--bg-elevated);
978
+ color: var(--text-secondary);
979
+ border: 1px solid var(--border-default);
980
+ border-radius: var(--radius-md);
981
+ padding: 10px 20px;
982
+ font-family: var(--font-sans);
983
+ font-size: 13px;
984
+ font-weight: 500;
985
+ cursor: pointer;
986
+ transition: background 0.15s, color 0.15s;
987
+ }
988
+
989
+ .sweep-back-btn:hover {
990
+ background: var(--bg-active);
991
+ color: var(--text-primary);
992
+ }
993
+
994
+ .sweep-execute-btn {
995
+ background: var(--accent-cyan);
996
+ color: var(--bg-page);
997
+ border: none;
998
+ border-radius: var(--radius-md);
999
+ padding: 10px 24px;
1000
+ font-family: var(--font-sans);
1001
+ font-size: 13px;
1002
+ font-weight: 600;
1003
+ cursor: pointer;
1004
+ transition: opacity 0.15s;
1005
+ }
1006
+
1007
+ .sweep-execute-btn:hover { opacity: 0.85; }
1008
+ .sweep-execute-btn:disabled { opacity: 0.4; cursor: not-allowed; }
1009
+
1010
+ .sweep-success { color: var(--accent-green); }
1011
+ .sweep-error-title { color: var(--accent-red); }
1012
+
1013
+ .sweep-results {
1014
+ display: flex;
1015
+ flex-direction: column;
1016
+ gap: 8px;
1017
+ }
1018
+
1019
+ .sweep-result-item {
1020
+ display: flex;
1021
+ align-items: center;
1022
+ justify-content: space-between;
1023
+ background: var(--bg-surface);
1024
+ border: 1px solid var(--border-default);
1025
+ border-radius: var(--radius-md);
1026
+ padding: 12px 16px;
1027
+ }
1028
+
1029
+ .sweep-result-label {
1030
+ font-family: var(--font-sans);
1031
+ font-size: 13px;
1032
+ font-weight: 500;
1033
+ color: var(--text-primary);
1034
+ }
1035
+
1036
+ .sweep-result-txid {
1037
+ font-family: var(--font-mono);
1038
+ font-size: 12px;
1039
+ color: var(--accent-blue);
1040
+ }
1041
+
771
1042
  /* ── Shared utilities ────────────────────────────────────────── */
772
1043
  .empty-state {
773
1044
  display: flex;
@@ -797,90 +1068,98 @@
797
1068
  ::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: 2px; }
798
1069
  ::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }
799
1070
  </style>
800
- <script type="module" crossorigin>(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))r(n);new MutationObserver(n=>{for(const o of n)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function i(n){const o={};return n.integrity&&(o.integrity=n.integrity),n.referrerPolicy&&(o.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?o.credentials="include":n.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(n){if(n.ep)return;n.ep=!0;const o=i(n);fetch(n.href,o)}})();function h(e,t,i){function r(s,u){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:u,constr:a,traits:new Set},enumerable:!1}),s._zod.traits.has(e))return;s._zod.traits.add(e),t(s,u);const l=a.prototype,c=Object.keys(l);for(let m=0;m<c.length;m++){const p=c[m];p in s||(s[p]=l[p].bind(s))}}const n=i?.Parent??Object;class o extends n{}Object.defineProperty(o,"name",{value:e});function a(s){var u;const l=i?.Parent?new o:this;r(l,s),(u=l._zod).deferred??(u.deferred=[]);for(const c of l._zod.deferred)c();return l}return Object.defineProperty(a,"init",{value:r}),Object.defineProperty(a,Symbol.hasInstance,{value:s=>i?.Parent&&s instanceof i.Parent?!0:s?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}class et extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Qa extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const es={};function Te(e){return es}function ts(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,n])=>t.indexOf(+r)===-1).map(([r,n])=>n)}function Oi(e,t){return typeof t=="bigint"?t.toString():t}function zn(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Ci(e){return e==null}function Li(e){const t=e.startsWith("^")?1:0,i=e.endsWith("$")?e.length-1:e.length;return e.slice(t,i)}function Wf(e,t){const i=(e.toString().split(".")[1]||"").length,r=t.toString();let n=(r.split(".")[1]||"").length;if(n===0&&/\d?e-\d?/.test(r)){const u=r.match(/\d?e-(\d?)/);u?.[1]&&(n=Number.parseInt(u[1]))}const o=i>n?i:n,a=Number.parseInt(e.toFixed(o).replace(".","")),s=Number.parseInt(t.toFixed(o).replace(".",""));return a%s/10**o}const ca=Symbol("evaluating");function E(e,t,i){let r;Object.defineProperty(e,t,{get(){if(r!==ca)return r===void 0&&(r=ca,r=i()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function He(e,t,i){Object.defineProperty(e,t,{value:i,writable:!0,enumerable:!0,configurable:!0})}function Ee(...e){const t={};for(const i of e){const r=Object.getOwnPropertyDescriptors(i);Object.assign(t,r)}return Object.defineProperties({},t)}function da(e){return JSON.stringify(e)}function Gf(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const ns="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function _t(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Kf=zn(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function tt(e){if(_t(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const i=t.prototype;return!(_t(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function is(e){return tt(e)?{...e}:Array.isArray(e)?[...e]:e}const Xf=new Set(["string","number","symbol"]);function nt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function De(e,t,i){const r=new e._zod.constr(t??e._zod.def);return(!t||i?.parent)&&(r._zod.parent=e),r}function k(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Yf(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const Qf={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 ep(e,t){const i=e._zod.def,r=i.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const o=Ee(e._zod.def,{get shape(){const a={};for(const s in t){if(!(s in i.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(a[s]=i.shape[s])}return He(this,"shape",a),a},checks:[]});return De(e,o)}function tp(e,t){const i=e._zod.def,r=i.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const o=Ee(e._zod.def,{get shape(){const a={...e._zod.def.shape};for(const s in t){if(!(s in i.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&delete a[s]}return He(this,"shape",a),a},checks:[]});return De(e,o)}function np(e,t){if(!tt(t))throw new Error("Invalid input to extend: expected a plain object");const i=e._zod.def.checks;if(i&&i.length>0){const o=e._zod.def.shape;for(const a in t)if(Object.getOwnPropertyDescriptor(o,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const n=Ee(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return He(this,"shape",o),o}});return De(e,n)}function ip(e,t){if(!tt(t))throw new Error("Invalid input to safeExtend: expected a plain object");const i=Ee(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return He(this,"shape",r),r}});return De(e,i)}function rp(e,t){const i=Ee(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return He(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return De(e,i)}function op(e,t,i){const n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const a=Ee(t._zod.def,{get shape(){const s=t._zod.def.shape,u={...s};if(i)for(const l in i){if(!(l in s))throw new Error(`Unrecognized key: "${l}"`);i[l]&&(u[l]=e?new e({type:"optional",innerType:s[l]}):s[l])}else for(const l in s)u[l]=e?new e({type:"optional",innerType:s[l]}):s[l];return He(this,"shape",u),u},checks:[]});return De(t,a)}function ap(e,t,i){const r=Ee(t._zod.def,{get shape(){const n=t._zod.def.shape,o={...n};if(i)for(const a in i){if(!(a in o))throw new Error(`Unrecognized key: "${a}"`);i[a]&&(o[a]=new e({type:"nonoptional",innerType:n[a]}))}else for(const a in n)o[a]=new e({type:"nonoptional",innerType:n[a]});return He(this,"shape",o),o}});return De(t,r)}function Ye(e,t=0){if(e.aborted===!0)return!0;for(let i=t;i<e.issues.length;i++)if(e.issues[i]?.continue!==!0)return!0;return!1}function Qe(e,t){return t.map(i=>{var r;return(r=i).path??(r.path=[]),i.path.unshift(e),i})}function rn(e){return typeof e=="string"?e:e?.message}function Ue(e,t,i){const r={...e,path:e.path??[]};if(!e.message){const n=rn(e.inst?._zod.def?.error?.(e))??rn(t?.error?.(e))??rn(i.customError?.(e))??rn(i.localeError?.(e))??"Invalid input";r.message=n}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Mi(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function $t(...e){const[t,i,r]=e;return typeof t=="string"?{message:t,code:"custom",input:i,inst:r}:{...t}}const rs=(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,Oi,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},os=h("$ZodError",rs),as=h("$ZodError",rs,{Parent:Error});function sp(e,t=i=>i.message){const i={},r=[];for(const n of e.issues)n.path.length>0?(i[n.path[0]]=i[n.path[0]]||[],i[n.path[0]].push(t(n))):r.push(t(n));return{formErrors:r,fieldErrors:i}}function up(e,t=i=>i.message){const i={_errors:[]},r=n=>{for(const o of n.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(a=>r({issues:a}));else if(o.code==="invalid_key")r({issues:o.issues});else if(o.code==="invalid_element")r({issues:o.issues});else if(o.path.length===0)i._errors.push(t(o));else{let a=i,s=0;for(;s<o.path.length;){const u=o.path[s];s===o.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(t(o))):a[u]=a[u]||{_errors:[]},a=a[u],s++}}};return r(e),i}const Ji=e=>(t,i,r,n)=>{const o=r?Object.assign(r,{async:!1}):{async:!1},a=t._zod.run({value:i,issues:[]},o);if(a instanceof Promise)throw new et;if(a.issues.length){const s=new(n?.Err??e)(a.issues.map(u=>Ue(u,o,Te())));throw ns(s,n?.callee),s}return a.value},Fi=e=>async(t,i,r,n)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let a=t._zod.run({value:i,issues:[]},o);if(a instanceof Promise&&(a=await a),a.issues.length){const s=new(n?.Err??e)(a.issues.map(u=>Ue(u,o,Te())));throw ns(s,n?.callee),s}return a.value},xn=e=>(t,i,r)=>{const n=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:i,issues:[]},n);if(o instanceof Promise)throw new et;return o.issues.length?{success:!1,error:new(e??os)(o.issues.map(a=>Ue(a,n,Te())))}:{success:!0,data:o.value}},ss=xn(as),On=e=>async(t,i,r)=>{const n=r?Object.assign(r,{async:!0}):{async:!0};let o=t._zod.run({value:i,issues:[]},n);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(a=>Ue(a,n,Te())))}:{success:!0,data:o.value}},lp=On(as),cp=e=>(t,i,r)=>{const n=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Ji(e)(t,i,n)},dp=e=>(t,i,r)=>Ji(e)(t,i,r),mp=e=>async(t,i,r)=>{const n=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Fi(e)(t,i,n)},fp=e=>async(t,i,r)=>Fi(e)(t,i,r),pp=e=>(t,i,r)=>{const n=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return xn(e)(t,i,n)},vp=e=>(t,i,r)=>xn(e)(t,i,r),hp=e=>async(t,i,r)=>{const n=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return On(e)(t,i,n)},gp=e=>async(t,i,r)=>On(e)(t,i,r),_p=/^[cC][^\s-]{8,}$/,$p=/^[0-9a-z]+$/,bp=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,yp=/^[0-9a-vA-V]{20}$/,kp=/^[A-Za-z0-9]{27}$/,wp=/^[a-zA-Z0-9_-]{21}$/,Sp=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ip=/^([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})$/,ma=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)$/,zp=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,xp="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Op(){return new RegExp(xp,"u")}const Zp=/^(?:(?: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])$/,Tp=/^(([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}|:))$/,Up=/^((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])$/,Np=/^(([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])$/,Pp=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,us=/^[A-Za-z0-9_-]*$/,jp=/^\+[1-9]\d{6,14}$/,ls="(?:(?:\\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])))",Ep=new RegExp(`^${ls}$`);function cs(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Dp(e){return new RegExp(`^${cs(e)}$`)}function Rp(e){const t=cs({precision:e.precision}),i=["Z"];e.local&&i.push(""),e.offset&&i.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${i.join("|")})`;return new RegExp(`^${ls}T(?:${r})$`)}const Ap=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Cp=/^-?\d+$/,ds=/^-?\d+(?:\.\d+)?$/,Lp=/^(?:true|false)$/i,Mp=/^null$/i,Jp=/^[^A-Z]*$/,Fp=/^[^a-z]*$/,le=h("$ZodCheck",(e,t)=>{var i;e._zod??(e._zod={}),e._zod.def=t,(i=e._zod).onattach??(i.onattach=[])}),ms={number:"number",bigint:"bigint",object:"date"},fs=h("$ZodCheckLessThan",(e,t)=>{le.init(e,t);const i=ms[typeof t.value];e._zod.onattach.push(r=>{const n=r._zod.bag,o=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<o&&(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:i,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ps=h("$ZodCheckGreaterThan",(e,t)=>{le.init(e,t);const i=ms[typeof t.value];e._zod.onattach.push(r=>{const n=r._zod.bag,o=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>o&&(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:i,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),qp=h("$ZodCheckMultipleOf",(e,t)=>{le.init(e,t),e._zod.onattach.push(i=>{var r;(r=i._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=i=>{if(typeof i.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof i.value=="bigint"?i.value%t.value===BigInt(0):Wf(i.value,t.value)===0)||i.issues.push({origin:typeof i.value,code:"not_multiple_of",divisor:t.value,input:i.value,inst:e,continue:!t.abort})}}),Bp=h("$ZodCheckNumberFormat",(e,t)=>{le.init(e,t),t.format=t.format||"float64";const i=t.format?.includes("int"),r=i?"int":"number",[n,o]=Qf[t.format];e._zod.onattach.push(a=>{const s=a._zod.bag;s.format=t.format,s.minimum=n,s.maximum=o,i&&(s.pattern=Cp)}),e._zod.check=a=>{const s=a.value;if(i){if(!Number.isInteger(s)){a.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,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}):a.issues.push({input:s,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});return}}s<n&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),s>o&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),Hp=h("$ZodCheckMaxLength",(e,t)=>{var i;le.init(e,t),(i=e._zod.def).when??(i.when=r=>{const n=r.value;return!Ci(n)&&n.length!==void 0}),e._zod.onattach.push(r=>{const n=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const n=r.value;if(n.length<=t.maximum)return;const a=Mi(n);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Vp=h("$ZodCheckMinLength",(e,t)=>{var i;le.init(e,t),(i=e._zod.def).when??(i.when=r=>{const n=r.value;return!Ci(n)&&n.length!==void 0}),e._zod.onattach.push(r=>{const n=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const n=r.value;if(n.length>=t.minimum)return;const a=Mi(n);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Wp=h("$ZodCheckLengthEquals",(e,t)=>{var i;le.init(e,t),(i=e._zod.def).when??(i.when=r=>{const n=r.value;return!Ci(n)&&n.length!==void 0}),e._zod.onattach.push(r=>{const n=r._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=r=>{const n=r.value,o=n.length;if(o===t.length)return;const a=Mi(n),s=o>t.length;r.issues.push({origin:a,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Zn=h("$ZodCheckStringFormat",(e,t)=>{var i,r;le.init(e,t),e._zod.onattach.push(n=>{const o=n._zod.bag;o.format=t.format,t.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(t.pattern))}),t.pattern?(i=e._zod).check??(i.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=()=>{})}),Gp=h("$ZodCheckRegex",(e,t)=>{Zn.init(e,t),e._zod.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:"regex",input:i.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Kp=h("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Jp),Zn.init(e,t)}),Xp=h("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Fp),Zn.init(e,t)}),Yp=h("$ZodCheckIncludes",(e,t)=>{le.init(e,t);const i=nt(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${i}`:i);t.pattern=r,e._zod.onattach.push(n=>{const o=n._zod.bag;o.patterns??(o.patterns=new Set),o.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})}}),Qp=h("$ZodCheckStartsWith",(e,t)=>{le.init(e,t);const i=new RegExp(`^${nt(t.prefix)}.*`);t.pattern??(t.pattern=i),e._zod.onattach.push(r=>{const n=r._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(i)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),ev=h("$ZodCheckEndsWith",(e,t)=>{le.init(e,t);const i=new RegExp(`.*${nt(t.suffix)}$`);t.pattern??(t.pattern=i),e._zod.onattach.push(r=>{const n=r._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(i)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),tv=h("$ZodCheckOverwrite",(e,t)=>{le.init(e,t),e._zod.check=i=>{i.value=t.tx(i.value)}});class nv{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
801
- `).filter(a=>a),n=Math.min(...r.map(a=>a.length-a.trimStart().length)),o=r.map(a=>a.slice(n)).map(a=>" ".repeat(this.indent*2)+a);for(const a of o)this.content.push(a)}compile(){const t=Function,i=this?.args,n=[...(this?.content??[""]).map(o=>` ${o}`)];return new t(...i,n.join(`
802
- `))}}const iv={major:4,minor:3,patch:6},q=h("$ZodType",(e,t)=>{var i;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=iv;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const n of r)for(const o of n._zod.onattach)o(e);if(r.length===0)(i=e._zod).deferred??(i.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const n=(a,s,u)=>{let l=Ye(a),c;for(const m of s){if(m._zod.def.when){if(!m._zod.def.when(a))continue}else if(l)continue;const p=a.issues.length,g=m._zod.check(a);if(g instanceof Promise&&u?.async===!1)throw new et;if(c||g instanceof Promise)c=(c??Promise.resolve()).then(async()=>{await g,a.issues.length!==p&&(l||(l=Ye(a,p)))});else{if(a.issues.length===p)continue;l||(l=Ye(a,p))}}return c?c.then(()=>a):a},o=(a,s,u)=>{if(Ye(a))return a.aborted=!0,a;const l=n(s,r,u);if(l instanceof Promise){if(u.async===!1)throw new et;return l.then(c=>e._zod.parse(c,u))}return e._zod.parse(l,u)};e._zod.run=(a,s)=>{if(s.skipChecks)return e._zod.parse(a,s);if(s.direction==="backward"){const l=e._zod.parse({value:a.value,issues:[]},{...s,skipChecks:!0});return l instanceof Promise?l.then(c=>o(c,a,s)):o(l,a,s)}const u=e._zod.parse(a,s);if(u instanceof Promise){if(s.async===!1)throw new et;return u.then(l=>n(l,r,s))}return n(u,r,s)}}E(e,"~standard",()=>({validate:n=>{try{const o=ss(e,n);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return lp(e,n).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),qi=h("$ZodString",(e,t)=>{q.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Ap(e._zod.bag),e._zod.parse=(i,r)=>{if(t.coerce)try{i.value=String(i.value)}catch{}return typeof i.value=="string"||i.issues.push({expected:"string",code:"invalid_type",input:i.value,inst:e}),i}}),B=h("$ZodStringFormat",(e,t)=>{Zn.init(e,t),qi.init(e,t)}),rv=h("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Ip),B.init(e,t)}),ov=h("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=ma(r))}else t.pattern??(t.pattern=ma());B.init(e,t)}),av=h("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=zp),B.init(e,t)}),sv=h("$ZodURL",(e,t)=>{B.init(e,t),e._zod.check=i=>{try{const r=i.value.trim(),n=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(n.hostname)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:i.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:i.value,inst:e,continue:!t.abort})),t.normalize?i.value=n.href:i.value=r;return}catch{i.issues.push({code:"invalid_format",format:"url",input:i.value,inst:e,continue:!t.abort})}}}),uv=h("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Op()),B.init(e,t)}),lv=h("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=wp),B.init(e,t)}),cv=h("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=_p),B.init(e,t)}),dv=h("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=$p),B.init(e,t)}),mv=h("$ZodULID",(e,t)=>{t.pattern??(t.pattern=bp),B.init(e,t)}),fv=h("$ZodXID",(e,t)=>{t.pattern??(t.pattern=yp),B.init(e,t)}),pv=h("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=kp),B.init(e,t)}),vv=h("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Rp(t)),B.init(e,t)}),hv=h("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Ep),B.init(e,t)}),gv=h("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Dp(t)),B.init(e,t)}),_v=h("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Sp),B.init(e,t)}),$v=h("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Zp),B.init(e,t),e._zod.bag.format="ipv4"}),bv=h("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Tp),B.init(e,t),e._zod.bag.format="ipv6",e._zod.check=i=>{try{new URL(`http://[${i.value}]`)}catch{i.issues.push({code:"invalid_format",format:"ipv6",input:i.value,inst:e,continue:!t.abort})}}}),yv=h("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Up),B.init(e,t)}),kv=h("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Np),B.init(e,t),e._zod.check=i=>{const r=i.value.split("/");try{if(r.length!==2)throw new Error;const[n,o]=r;if(!o)throw new Error;const a=Number(o);if(`${a}`!==o)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${n}]`)}catch{i.issues.push({code:"invalid_format",format:"cidrv6",input:i.value,inst:e,continue:!t.abort})}}});function vs(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const wv=h("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Pp),B.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=i=>{vs(i.value)||i.issues.push({code:"invalid_format",format:"base64",input:i.value,inst:e,continue:!t.abort})}});function Sv(e){if(!us.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),i=t.padEnd(Math.ceil(t.length/4)*4,"=");return vs(i)}const Iv=h("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=us),B.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=i=>{Sv(i.value)||i.issues.push({code:"invalid_format",format:"base64url",input:i.value,inst:e,continue:!t.abort})}}),zv=h("$ZodE164",(e,t)=>{t.pattern??(t.pattern=jp),B.init(e,t)});function xv(e,t=null){try{const i=e.split(".");if(i.length!==3)return!1;const[r]=i;if(!r)return!1;const n=JSON.parse(atob(r));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}const Ov=h("$ZodJWT",(e,t)=>{B.init(e,t),e._zod.check=i=>{xv(i.value,t.alg)||i.issues.push({code:"invalid_format",format:"jwt",input:i.value,inst:e,continue:!t.abort})}}),hs=h("$ZodNumber",(e,t)=>{q.init(e,t),e._zod.pattern=e._zod.bag.pattern??ds,e._zod.parse=(i,r)=>{if(t.coerce)try{i.value=Number(i.value)}catch{}const n=i.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return i;const o=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return i.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...o?{received:o}:{}}),i}}),Zv=h("$ZodNumberFormat",(e,t)=>{Bp.init(e,t),hs.init(e,t)}),Tv=h("$ZodBoolean",(e,t)=>{q.init(e,t),e._zod.pattern=Lp,e._zod.parse=(i,r)=>{if(t.coerce)try{i.value=!!i.value}catch{}const n=i.value;return typeof n=="boolean"||i.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),i}}),Uv=h("$ZodNull",(e,t)=>{q.init(e,t),e._zod.pattern=Mp,e._zod.values=new Set([null]),e._zod.parse=(i,r)=>{const n=i.value;return n===null||i.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),i}}),Nv=h("$ZodUnknown",(e,t)=>{q.init(e,t),e._zod.parse=i=>i}),Pv=h("$ZodNever",(e,t)=>{q.init(e,t),e._zod.parse=(i,r)=>(i.issues.push({expected:"never",code:"invalid_type",input:i.value,inst:e}),i)});function fa(e,t,i){e.issues.length&&t.issues.push(...Qe(i,e.issues)),t.value[i]=e.value}const jv=h("$ZodArray",(e,t)=>{q.init(e,t),e._zod.parse=(i,r)=>{const n=i.value;if(!Array.isArray(n))return i.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),i;i.value=Array(n.length);const o=[];for(let a=0;a<n.length;a++){const s=n[a],u=t.element._zod.run({value:s,issues:[]},r);u instanceof Promise?o.push(u.then(l=>fa(l,i,a))):fa(u,i,a)}return o.length?Promise.all(o).then(()=>i):i}});function mn(e,t,i,r,n){if(e.issues.length){if(n&&!(i in r))return;t.issues.push(...Qe(i,e.issues))}e.value===void 0?i in r&&(t.value[i]=void 0):t.value[i]=e.value}function gs(e){const t=Object.keys(e.shape);for(const r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const i=Yf(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(i)}}function _s(e,t,i,r,n,o){const a=[],s=n.keySet,u=n.catchall._zod,l=u.def.type,c=u.optout==="optional";for(const m in t){if(s.has(m))continue;if(l==="never"){a.push(m);continue}const p=u.run({value:t[m],issues:[]},r);p instanceof Promise?e.push(p.then(g=>mn(g,i,m,t,c))):mn(p,i,m,t,c)}return a.length&&i.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:o}),e.length?Promise.all(e).then(()=>i):i}const Ev=h("$ZodObject",(e,t)=>{if(q.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const s=t.shape;Object.defineProperty(t,"shape",{get:()=>{const u={...s};return Object.defineProperty(t,"shape",{value:u}),u}})}const r=zn(()=>gs(t));E(e._zod,"propValues",()=>{const s=t.shape,u={};for(const l in s){const c=s[l]._zod;if(c.values){u[l]??(u[l]=new Set);for(const m of c.values)u[l].add(m)}}return u});const n=_t,o=t.catchall;let a;e._zod.parse=(s,u)=>{a??(a=r.value);const l=s.value;if(!n(l))return s.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),s;s.value={};const c=[],m=a.shape;for(const p of a.keys){const g=m[p],w=g._zod.optout==="optional",D=g._zod.run({value:l[p],issues:[]},u);D instanceof Promise?c.push(D.then(Se=>mn(Se,s,p,l,w))):mn(D,s,p,l,w)}return o?_s(c,l,s,u,r.value,e):c.length?Promise.all(c).then(()=>s):s}}),Dv=h("$ZodObjectJIT",(e,t)=>{Ev.init(e,t);const i=e._zod.parse,r=zn(()=>gs(t)),n=p=>{const g=new nv(["shape","payload","ctx"]),w=r.value,D=T=>{const j=da(T);return`shape[${j}]._zod.run({ value: input[${j}], issues: [] }, ctx)`};g.write("const input = payload.value;");const Se=Object.create(null);let Ke=0;for(const T of w.keys)Se[T]=`key_${Ke++}`;g.write("const newResult = {};");for(const T of w.keys){const j=Se[T],ce=da(T),Vf=p[T]?._zod?.optout==="optional";g.write(`const ${j} = ${D(T)};`),Vf?g.write(`
803
- if (${j}.issues.length) {
804
- if (${ce} in input) {
805
- payload.issues = payload.issues.concat(${j}.issues.map(iss => ({
1071
+ <script type="module" crossorigin>(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const t of document.querySelectorAll('link[rel="modulepreload"]'))i(t);new MutationObserver(t=>{for(const o of t)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&i(s)}).observe(document,{childList:!0,subtree:!0});function n(t){const o={};return t.integrity&&(o.integrity=t.integrity),t.referrerPolicy&&(o.referrerPolicy=t.referrerPolicy),t.crossOrigin==="use-credentials"?o.credentials="include":t.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(t){if(t.ep)return;t.ep=!0;const o=n(t);fetch(t.href,o)}})();const Co=typeof globalThis>"u"?void 0:globalThis.Buffer,qm=Co!=null&&typeof Co.from=="function",Nn=new Int8Array(256).fill(-1);for(let r=0;r<10;r++)Nn[48+r]=r;for(let r=0;r<6;r++)Nn[65+r]=10+r,Nn[97+r]=10+r;class g{static zeros=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"];static groupSizes=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5];static groupBases=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];static wordSize=26;static WORD_SIZE_BIGINT=BigInt(g.wordSize);static WORD_MASK=(1n<<g.WORD_SIZE_BIGINT)-1n;static MAX_SAFE_INTEGER_BIGINT=BigInt(Number.MAX_SAFE_INTEGER);static MIN_SAFE_INTEGER_BIGINT=BigInt(Number.MIN_SAFE_INTEGER);static MAX_IMULN_ARG=67108863;static MAX_NUMBER_CONSTRUCTOR_MAG_BIGINT=(1n<<53n)-1n;_magnitude=0n;_sign=0;_nominalWordLength=1;red;get negative(){return this._sign}set negative(e){this.assert(e===0||e===1,"Negative property must be 0 or 1");const n=e===1?1:0;this._magnitude===0n?this._sign=0:this._sign=n}get _computedWordsArray(){if(this._magnitude===0n)return[0];const e=[];let n=this._magnitude;for(;n>0n;)e.push(Number(n&g.WORD_MASK)),n>>=g.WORD_SIZE_BIGINT;return e.length>0?e:[0]}get words(){const e=this._computedWordsArray;if(this._nominalWordLength<=e.length)return e;const n=new Array(this._nominalWordLength).fill(0);for(let i=0;i<e.length;i++)n[i]=e[i];return n}set words(e){const n=this._sign;let i=0n;const t=e.length>0?e.length:1;for(let o=t-1;o>=0;o--){const s=e[o]??0;i=i<<g.WORD_SIZE_BIGINT|BigInt(s&Number(g.WORD_MASK))}this._magnitude=i,this._sign=n,this._nominalWordLength=t,this.normSign()}get length(){return Math.max(1,this._nominalWordLength)}static isBN(e){return e instanceof g?!0:e!==null&&typeof e=="object"&&e.constructor?.wordSize===g.wordSize&&Array.isArray(e.words)}static max(e,n){return e.cmp(n)>0?e:n}static min(e,n){return e.cmp(n)<0?e:n}constructor(e=0,n=10,i="be"){if(this.red=null,e??=0,e===null){this._initializeState(0n,0);return}if(typeof e=="bigint"){this._initializeState(e<0n?-e:e,e<0n?1:0),this.normSign();return}let t=n,o=i;if((n==="le"||n==="be")&&(o=n,t=10),typeof e=="number"){this.initNumber(e,o);return}if(Array.isArray(e)){this.initArray(e,o);return}if(typeof e=="string"){this._initFromString(e,t,o);return}e!==0?this.assert(!1,"Unsupported input type for BigNumber constructor"):this._initializeState(0n,0)}_initFromString(e,n,i){n==="hex"&&(n=16),this.assert(typeof n=="number"&&n===(n|0)&&n>=2&&n<=36,"Base must be an integer between 2 and 36");const t=e.toString().replace(/\s+/g,"");let o=0,s=0;t.startsWith("-")?(o++,s=1):t.startsWith("+")&&o++;const a=t.substring(o);if(a.length===0){this._initializeState(0n,s===1&&t.startsWith("-")?1:0),this.normSign();return}n===16?this._initFromHexString(a,s,i):this._initFromNonHexString(a,n,s,i)}_initFromHexString(e,n,i){if(i==="le"){const t=[];let o=e;o.length%2!==0&&(o="0"+o);for(let s=0;s<o.length;s+=2){const a=o.substring(s,s+2),c=Number.parseInt(a,16);if(Number.isNaN(c))throw new Error("Invalid character in "+o);t.push(c)}this.initArray(t,"le"),this._sign=n,this.normSign()}else{let t;try{t=BigInt("0x"+e)}catch{throw new Error("Invalid character in "+e)}this._initializeState(t,n),this.normSign()}}_initFromNonHexString(e,n,i,t){try{if(this._parseBaseString(e,n),this._sign=i,this.normSign(),t==="le"){const o=this._sign;this.initArray(this.toArray("be"),"le"),this._sign=o,this.normSign()}}catch(o){const s=o;throw s.message.includes("Invalid character in string")||s.message.includes("Invalid digit for base")||s.message.startsWith("Invalid character:")?new Error("Invalid character"):s}}_bigIntToStringInBase(e,n){if(e===0n)return"0";if(n<2||n>36)throw new Error("Base must be between 2 and 36");const i="0123456789abcdefghijklmnopqrstuvwxyz";let t="",o=e>0n?e:-e;const s=BigInt(n);for(;o>0n;)t=i[Number(o%s)]+t,o/=s;return t}_parseBaseString(e,n){if(e.length===0){this._magnitude=0n,this._finishInitialization();return}this._magnitude=0n;const i=BigInt(n);let t=g.groupSizes[n],o=BigInt(g.groupBases[n]);(t===0||o===0n)&&(t=Math.floor(Math.log(67108863)/Math.log(n)),t===0&&(t=1),o=i**BigInt(t));let s=0;const a=e.length;let c=a%t;if(c===0&&a>0&&(c=t),c>0){const u=e.substring(s,s+c);this._magnitude=BigInt(this._parseBaseWord(u,n)),s+=c}for(;s<a;){const u=e.substring(s,s+t),l=BigInt(this._parseBaseWord(u,n));this._magnitude=this._magnitude*o+l,s+=t}this._finishInitialization()}_parseBaseWord(e,n){let i=0;for(let t=0;t<e.length;t++){const o=e.codePointAt(t);let s;if(o>=48&&o<=57)s=o-48;else if(o>=65&&o<=90)s=o-65+10;else if(o>=97&&o<=122)s=o-97+10;else throw new Error("Invalid character: "+e[t]);if(s>=n)throw new Error("Invalid character");i=i*n+s}return i}_initializeState(e,n){this._magnitude=e,this._sign=e===0n?0:n,this._finishInitialization()}_finishInitialization(){if(this._magnitude===0n)this._nominalWordLength=1,this._sign=0;else{const e=this._magnitude.toString(2).length;this._nominalWordLength=Math.max(1,Math.ceil(e/g.wordSize))}}assert(e,n="Assertion failed"){if(!e)throw new Error(n)}initNumber(e,n="be"){if(this.assert(BigInt(Math.abs(e))<=g.MAX_NUMBER_CONSTRUCTOR_MAG_BIGINT,"The number is larger than 2 ^ 53 (unsafe)"),this.assert(e%1===0,"Number must be an integer for BigNumber conversion"),this._initializeState(BigInt(Math.abs(e)),e<0?1:0),n==="le"){const i=this._sign,t=this.toArray("be");this.initArray(t,"le"),this._sign=i,this.normSign()}return this}initArray(e,n){if(e.length===0)return this._initializeState(0n,0),this;let i=0n;if(n==="be")for(const t of e)i=i<<8n|BigInt(t&255);else for(let t=e.length-1;t>=0;t--)i=i<<8n|BigInt(e[t]&255);return this._initializeState(i,0),this}copy(e){e._magnitude=this._magnitude,e._sign=this._sign,e._nominalWordLength=this._nominalWordLength,e.red=this.red}static move(e,n){e._magnitude=n._magnitude,e._sign=n._sign,e._nominalWordLength=n._nominalWordLength,e.red=n.red}clone(){const e=new g(0n);return this.copy(e),e}expand(e){return this.assert(e>=0,"Expand size must be non-negative"),this._nominalWordLength=Math.max(this._nominalWordLength,e,1),this}strip(){return this._finishInitialization(),this.normSign()}normSign(){return this._magnitude===0n&&(this._sign=0),this}inspect(){return(this.red===null?"<BN: ":"<BN-R: ")+this.toString(16)+">"}_getMinimalHex(){return this._magnitude===0n?"0":this._magnitude.toString(16)}toString(e=10,n=1){if(e===16||e==="hex"){let i=this._getMinimalHex();if(n>1)for(i!=="0"&&i.length%2!==0&&(i="0"+i);i.length%n!==0;)i="0"+i;return(this.isNeg()?"-":"")+i}if(typeof e!="number"||e<2||e>36||e%1!==0)throw new Error("Base should be an integer between 2 and 36");return this.toBaseString(e,n)}toBaseString(e,n){if(this._magnitude===0n){let a="0";if(n>1)for(;a.length<n;)a="0"+a;return a}let i=g.groupSizes[e],t=BigInt(g.groupBases[e]);(i===0||t===0n)&&(i=Math.floor(Math.log(Number.MAX_SAFE_INTEGER)/Math.log(e)),i===0&&(i=1),t=BigInt(e)**BigInt(i));let o="",s=this._magnitude;for(;s>0n;){const a=s%t;s/=t;const c=this._bigIntToStringInBase(a,e);o=(s>0n?this._zeroPaddedChunk(c,i):c)+o}if(n>0)for(;o.length<n;)o="0"+o;return(this._sign===1?"-":"")+o}_zeroPaddedChunk(e,n){const i=n-e.length;return i<=0?e:i<g.zeros.length?g.zeros[i]+e:"0".repeat(i)+e}toNumber(){const e=this._getSignedValue();if(e>g.MAX_SAFE_INTEGER_BIGINT||e<g.MIN_SAFE_INTEGER_BIGINT)throw new Error("Number can only safely store up to 53 bits");return Number(e)}toBigInt(){return this._getSignedValue()}toJSON(){const e=this._getMinimalHex();return(this.isNeg()?"-":"")+e}toArrayLikeGeneric(e,n){let i=this._magnitude,t=n?0:e.length-1;const o=n?1:-1;for(let s=0;s<e.length;++s){if(i===0n&&t>=0&&t<e.length)e[t]=0;else if(t>=0&&t<e.length)e[t]=Number(i&0xffn);else break;i>>=8n,t+=o}}toArray(e="be",n){this.strip();const i=this.byteLength(),t=n??Math.max(1,i);this.assert(i<=t,"byte array longer than desired length"),this.assert(t>0,"Requested array length <= 0");const o=new Array(t).fill(0);return this._magnitude===0n&&t>0?o:this._magnitude===0n&&t===0?[]:(this.toArrayLikeGeneric(o,e==="le"),o)}bitLength(){return this._magnitude===0n?0:this._magnitude.toString(2).length}static toBitArray(e){const n=e.bitLength();if(n===0)return[];const i=new Array(n),t=e._magnitude;for(let o=0;o<n;o++)i[o]=(t>>BigInt(o)&1n)===0n?0:1;return i}toBitArray(){return g.toBitArray(this)}zeroBits(){if(this._magnitude===0n)return 0;let e=0,n=this._magnitude;for(;(n&1n)===0n&&n!==0n;)e++,n>>=1n;return e}byteLength(){return this._magnitude===0n?0:Math.ceil(this.bitLength()/8)}_getSignedValue(){return this._sign===1?-this._magnitude:this._magnitude}_setValueFromSigned(e){e<0n?(this._magnitude=-e,this._sign=1):(this._magnitude=e,this._sign=0),this._finishInitialization(),this.normSign()}toTwos(e){this.assert(e>=0);const n=BigInt(e);let i=this._getSignedValue();this._sign===1&&this._magnitude!==0n&&(i=(1n<<n)+i);const t=(1n<<n)-1n;i&=t;const o=new g(0n);return o._initializeState(i,0),o}fromTwos(e){this.assert(e>=0);const n=BigInt(e),i=this._magnitude;if(e>0&&(i>>n-1n&1n)!==0n&&this._sign===0){const t=i-(1n<<n),o=new g(0n);return o._setValueFromSigned(t),o}return this.clone()}isNeg(){return this._sign===1&&this._magnitude!==0n}neg(){return this.clone().ineg()}ineg(){return this._magnitude!==0n&&(this._sign=this._sign===1?0:1),this}_iuop(e,n,i=!1){const t=n(this._magnitude,e._magnitude);let o=this._nominalWordLength;return i&&(o=Math.max(this.length,e.length)),this._magnitude=t,this._finishInitialization(),i&&(this._nominalWordLength=Math.max(this._nominalWordLength,o)),this.strip()}iuor(e){return this._iuop(e,(n,i)=>n|i)}iuand(e){return this._iuop(e,(n,i)=>n&i)}iuxor(e){return this._iuop(e,(n,i)=>n^i,!0)}_iop(e,n,i=!1){return this.assert(this._sign===0&&e._sign===0),this._iuop(e,n,i)}ior(e){return this._iop(e,(n,i)=>n|i)}iand(e){return this._iop(e,(n,i)=>n&i)}ixor(e){return this._iop(e,(n,i)=>n^i,!0)}_uop_new(e,n){return this.length>=e.length?this.clone()[n](e):e.clone()[n](this)}or(e){return this.assert(this._sign===0&&e._sign===0),this._uop_new(e,"iuor")}uor(e){return this._uop_new(e,"iuor")}and(e){return this.assert(this._sign===0&&e._sign===0),this._uop_new(e,"iuand")}uand(e){return this._uop_new(e,"iuand")}xor(e){return this.assert(this._sign===0&&e._sign===0),this._uop_new(e,"iuxor")}uxor(e){return this._uop_new(e,"iuxor")}inotn(e){this.assert(typeof e=="number"&&e>=0);const i=(1n<<BigInt(e))-1n;this._magnitude=~this._magnitude&i;const t=e===0?1:Math.ceil(e/g.wordSize);return this._nominalWordLength=Math.max(1,t),this.strip(),this._nominalWordLength=Math.max(this._nominalWordLength,Math.max(1,t)),this}notn(e){return this.clone().inotn(e)}setn(e,n){this.assert(typeof e=="number"&&e>=0);const i=BigInt(e);n===1||n===!0?this._magnitude|=1n<<i:this._magnitude&=~(1n<<i);const t=Math.floor(e/g.wordSize)+1;return this._nominalWordLength=Math.max(this._nominalWordLength,t),this._finishInitialization(),this.strip()}iadd(e){return this._setValueFromSigned(this._getSignedValue()+e._getSignedValue()),this}add(e){const n=new g(0n);return n._setValueFromSigned(this._getSignedValue()+e._getSignedValue()),n}isub(e){return this._setValueFromSigned(this._getSignedValue()-e._getSignedValue()),this}sub(e){const n=new g(0n);return n._setValueFromSigned(this._getSignedValue()-e._getSignedValue()),n}mul(e){const n=new g(0n);return n._magnitude=this._magnitude*e._magnitude,n._sign=n._magnitude===0n?0:this._sign^e._sign,n._nominalWordLength=this.length+e.length,n.red=null,n.normSign()}imul(e){return this._magnitude*=e._magnitude,this._sign=this._magnitude===0n?0:this._sign^e._sign,this._nominalWordLength=this.length+e.length,this.red=null,this.normSign()}imuln(e){return this.assert(typeof e=="number","Assertion failed"),this.assert(Math.abs(e)<=g.MAX_IMULN_ARG,"Assertion failed"),this._setValueFromSigned(this._getSignedValue()*BigInt(e)),this}muln(e){return this.clone().imuln(e)}sqr(){const e=new g(0n);return e._magnitude=this._magnitude*this._magnitude,e._sign=0,e._nominalWordLength=this.length*2,e.red=null,e}isqr(){return this._magnitude*=this._magnitude,this._sign=0,this._nominalWordLength=this.length*2,this.red=null,this}pow(e){if(this.assert(e._sign===0,"Exponent for pow must be non-negative"),e.isZero())return new g(1n);const n=new g(1n),i=this.clone(),t=e.clone(),o=i.isNeg(),s=t.isOdd();for(o&&i.ineg();!t.isZero();)t.isOdd()&&n.imul(i),i.isqr(),t.iushrn(1);return o&&s&&n.ineg(),n}static normalizeNonNegativeBigInt(e,n){if(typeof e=="number"){if(!Number.isFinite(e)||!Number.isInteger(e)||e<0)throw new Error(`${n} must be a non-negative integer`);return BigInt(e)}if(e<0n)throw new Error(`${n} must be a non-negative integer`);return e}iushln(e){const n=g.normalizeNonNegativeBigInt(e,"Shift bits");return n===0n?this:(this._magnitude<<=n,this._finishInitialization(),this.strip())}ishln(e){return this.assert(this._sign===0,"ishln requires positive number"),this.iushln(e)}iushrn(e,n,i){const t=g.normalizeNonNegativeBigInt(e,"Shift bits");if(t===0n)return i?._initializeState(0n,0),this;if(i!=null){const o=(1n<<t)-1n,s=this._magnitude&o;i._initializeState(s,0)}return this._magnitude>>=t,this._finishInitialization(),this.strip()}ishrn(e,n,i){return this.assert(this._sign===0,"ishrn requires positive number"),this.iushrn(e,n,i)}shln(e){return this.clone().ishln(e)}ushln(e){return this.clone().iushln(e)}shrn(e){return this.clone().ishrn(e)}ushrn(e){return this.clone().iushrn(e)}testn(e){return this.assert(typeof e=="number"&&e>=0),(this._magnitude>>BigInt(e)&1n)!==0n}imaskn(e){this.assert(typeof e=="number"&&e>=0),this.assert(this._sign===0,"imaskn works only with positive numbers");const n=BigInt(e),i=n===0n?0n:(1n<<n)-1n;this._magnitude&=i;const t=e===0?1:Math.max(1,Math.ceil(e/g.wordSize));return this._nominalWordLength=t,this._finishInitialization(),this._nominalWordLength=Math.max(this._nominalWordLength,t),this.strip()}maskn(e){return this.clone().imaskn(e)}iaddn(e){return this.assert(typeof e=="number"),this.assert(Math.abs(e)<=g.MAX_IMULN_ARG,"num is too large"),this._setValueFromSigned(this._getSignedValue()+BigInt(e)),this}_iaddn(e){return this.iaddn(e)}isubn(e){return this.assert(typeof e=="number"),this.assert(Math.abs(e)<=g.MAX_IMULN_ARG,"Assertion failed"),this._setValueFromSigned(this._getSignedValue()-BigInt(e)),this}addn(e){return this.clone().iaddn(e)}subn(e){return this.clone().isubn(e)}iabs(){return this._sign=0,this}abs(){return this.clone().iabs()}divmod(e,n,i){if(this.assert(!e.isZero(),"Division by zero"),this.isZero()){const c=new g(0n);return{div:n==="mod"?null:c,mod:n==="div"?null:c}}const t=this._getSignedValue(),o=e._getSignedValue(),s=n!=="mod"?t/o:null,a=this._computeMod(t,o,n,i);return{div:this._bigNumberFromSigned(s),mod:this._bigNumberFromSigned(a)}}_computeMod(e,n,i,t){if(i==="div")return null;let o=e%n;return t===!0&&o<0n&&(o+=n<0n?-n:n),o}_bigNumberFromSigned(e){if(e===null)return null;const n=new g(0n);return n._setValueFromSigned(e),n}div(e){return this.divmod(e,"div",!1).div}mod(e){return this.divmod(e,"mod",!1).mod}umod(e){return this.divmod(e,"mod",!0).mod}divRound(e){this.assert(!e.isZero());const n=this._getSignedValue(),i=e._getSignedValue();let t=n/i;const o=n%i;if(o===0n){const u=new g(0n);return u._setValueFromSigned(t),u}const s=o<0n?-o:o,a=i<0n?-i:i;s*2n>=a&&(n>0n&&i>0n||n<0n&&i<0n?t+=1n:t-=1n);const c=new g(0n);return c._setValueFromSigned(t),c}modrn(e){this.assert(e!==0,"Division by zero in modrn");const n=BigInt(Math.abs(e));if(n===0n)throw new Error("Division by zero in modrn");const i=this._magnitude%n;return e<0?Number(-i):Number(i)}idivn(e){return this.assert(e!==0),this.assert(Math.abs(e)<=g.MAX_IMULN_ARG,"num is too large"),this._setValueFromSigned(this._getSignedValue()/BigInt(e)),this}divn(e){return this.clone().idivn(e)}egcd(e){this.assert(e._sign===0,"p must not be negative"),this.assert(!e.isZero(),"p must not be zero");let n=this._getSignedValue(),i=e._magnitude,t=1n,o=0n,s=0n,a=1n;for(;i!==0n;){const f=n/i;let d=i;i=n%i,n=d,d=o,o=t-f*o,t=d,d=a,a=s-f*a,s=d}const c=new g(0n);c._setValueFromSigned(t);const u=new g(0n);u._setValueFromSigned(s);const l=new g(0n);return l._initializeState(n<0n?-n:n,0),{a:c,b:u,gcd:l}}gcd(e){let n=this._magnitude,i=e._magnitude;if(n===0n){const o=new g(0n);return o._setValueFromSigned(i),o.iabs()}if(i===0n){const o=new g(0n);return o._setValueFromSigned(n),o.iabs()}for(;i!==0n;){const o=n%i;n=i,i=o}const t=new g(0n);return t._initializeState(n,0),t}invm(e){this.assert(!e.isZero()&&e._sign===0,"Modulus for invm must be positive and non-zero");const n=this.egcd(e);if(!n.gcd.eqn(1))throw new Error("Inverse does not exist (numbers are not coprime).");return n.a.umod(e)}isEven(){return this._magnitude%2n===0n}isOdd(){return this._magnitude%2n===1n}andln(e){return this.assert(e>=0),Number(this._magnitude&BigInt(e))}bincn(e){this.assert(typeof e=="number"&&e>=0);const n=1n<<BigInt(e);return this._setValueFromSigned(this._getSignedValue()+n),this}isZero(){return this._magnitude===0n}cmpn(e){this.assert(Math.abs(e)<=g.MAX_IMULN_ARG,"Number is too big");const n=this._getSignedValue(),i=BigInt(e);return n<i?-1:n>i?1:0}cmp(e){const n=this._getSignedValue(),i=e._getSignedValue();return n<i?-1:n>i?1:0}ucmp(e){return this._magnitude<e._magnitude?-1:this._magnitude>e._magnitude?1:0}gtn(e){return this.cmpn(e)===1}gt(e){return this.cmp(e)===1}gten(e){return this.cmpn(e)>=0}gte(e){return this.cmp(e)>=0}ltn(e){return this.cmpn(e)===-1}lt(e){return this.cmp(e)===-1}lten(e){return this.cmpn(e)<=0}lte(e){return this.cmp(e)<=0}eqn(e){return this.cmpn(e)===0}eq(e){return this.cmp(e)===0}toRed(e){return this.assert(this.red==null,"Already a number in reduction context"),this.assert(this._sign===0,"toRed works only with positives"),e.convertTo(this).forceRed(e)}fromRed(){return this.assert(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)}forceRed(e){return this.red=e,this}redAdd(e){return this.assert(this.red,"redAdd works only with red numbers"),this.red.add(this,e)}redIAdd(e){return this.assert(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)}redSub(e){return this.assert(this.red,"redSub works only with red numbers"),this.red.sub(this,e)}redISub(e){return this.assert(this.red,"redISub works only with red numbers"),this.red.isub(this,e)}redShl(e){return this.assert(this.red,"redShl works only with red numbers"),this.red.shl(this,e)}redMul(e){return this.assert(this.red,"redMul works only with red numbers"),this.red.verify2(this,e),this.red.mul(this,e)}redIMul(e){return this.assert(this.red,"redIMul works only with red numbers"),this.red.verify2(this,e),this.red.imul(this,e)}redSqr(){return this.assert(this.red,"redSqr works only with red numbers"),this.red.verify1(this),this.red.sqr(this)}redISqr(){return this.assert(this.red,"redISqr works only with red numbers"),this.red.verify1(this),this.red.isqr(this)}redSqrt(){return this.assert(this.red,"redSqrt works only with red numbers"),this.red.verify1(this),this.red.sqrt(this)}redInvm(){return this.assert(this.red,"redInvm works only with red numbers"),this.red.verify1(this),this.red.invm(this)}redNeg(){return this.assert(this.red,"redNeg works only with red numbers"),this.red.verify1(this),this.red.neg(this)}redPow(e){return this.assert(this.red!=null&&e.red==null,"redPow(normalNum)"),this.red.verify1(this),this.red.pow(this,e)}static fromHex(e,n){let i="be";return(n==="little"||n==="le")&&(i="le"),new g(e,16,i)}toHex(e=0){if(this.isZero()&&e===0)return"";let n=this._getMinimalHex();n!=="0"&&n.length%2!==0&&(n="0"+n);const i=e*2;for(;n.length<i;)n="0"+n;return(this.isNeg()?"-":"")+n}static fromJSON(e){return new g(e,16)}static fromNumber(e){return new g(e)}static fromString(e,n){return new g(e,n)}static fromSm(e,n="big"){if(e.length===0)return new g(0n);const i=e.slice();n==="little"&&i.reverse();let t=0;i.length>0&&(i[0]&128)!==0&&(t=1,i[0]&=127);let o;if(qm)o=Co.from(i).toString("hex");else{o="";for(const c of i)o+=c<16?"0"+c.toString(16):c.toString(16)}const s=o.length===0?0n:BigInt("0x"+o),a=new g(0n);return a._initializeState(s,t),a}toSm(e="big"){if(this._magnitude===0n)return this._sign===1?[128]:[];let n=this._getMinimalHex();n.length%2!==0&&(n="0"+n);const i=n.length/2,t=new Array(i);for(let s=0,a=0;s<n.length;s+=2){const c=Nn[n.codePointAt(s)],u=Nn[n.codePointAt(s+1)];t[a++]=(c&15)<<4|u&15}let o;return this._sign===1?(t[0]&128)===0?(o=t.slice(),o[0]|=128):o=[128,...t]:(t[0]&128)===0?o=t.slice():o=[0,...t],e==="little"?o.reverse():o}static fromBits(e,n=!1){const i=e>>>24,t=e&8388607,o=(e&8388608)!==0;if(n&&o)throw new Error("negative bit set");if(i===0&&t===0){if(o&&n)throw new Error("negative bit set for zero value");return new g(0n)}const s=new g(t);return i<=3?s.iushrn((3-i)*8):s.iushln((i-3)*8),o&&s.ineg(),s}toBits(){if(this.strip(),this.isZero()&&!this.isNeg())return 0;const e=this.isNeg(),n=this.abs();let i=n.toArray("be"),t=0;for(;t<i.length-1&&i[t]===0;)t++;i=i.slice(t);let o=i.length;o===0&&!n.isZero()&&(i=[0],o=1),n.isZero()&&(o=0,i=[]);let s;if(o===0)s=0;else if(o<=3){s=0;for(let c=0;c<o;c++)s=s<<8|i[c]}else s=i[0]<<16|i[1]<<8|i[2];(s&8388608)!==0&&o<=255&&(s>>>=8,o++);let a=o<<24|s;return e&&(a|=8388608),a>>>0}static fromScriptNum(e,n=!1,i){if(i!==void 0&&e.length>i)throw new Error("script number overflow");if(e.length===0)return new g(0n);if(n&&(e.at(-1)&127)===0&&(e.length<=1||(e.at(-2)&128)===0))throw new Error("non-minimally encoded script number");return g.fromSm(e,"little")}toScriptNum(){return this.toSm("little")}_invmp(e){this.assert(e._sign===0,"p must not be negative for _invmp"),this.assert(!e.isZero(),"p must not be zero for _invmp");const n=this.umod(e),i=e.subn(2);if(n.red!==null)return n.redPow(i);let t=new g(1n),o=n.clone();const s=i.clone();for(;!s.isZero();)s.isOdd()&&(t=t.mul(o).umod(e)),o=o.sqr().umod(e),s.iushrn(1);return t}mulTo(e,n){return n._magnitude=this._magnitude*e._magnitude,n._sign=n._magnitude===0n?0:this._sign^e._sign,n._nominalWordLength=this.length+e.length,n.red=null,n.normSign(),n}}class Vm{name;p;k;n;tmp;constructor(e,n){this.name=e,this.p=new g(n,16),this.n=this.p.bitLength(),this.k=new g(BigInt(1)).iushln(this.n).isub(this.p),this.tmp=this._tmp()}_tmp(){const e=new g(BigInt(0)),n=Math.ceil(this.n/g.wordSize);return e.expand(Math.max(1,n)),e}ireduce(e){const n=e;let i;do this.split(n,this.tmp),this.imulK(n),n.iadd(this.tmp),i=n.bitLength();while(i>this.n);const t=i<this.n?-1:n.ucmp(this.p);return t===0?n.words=[0]:t>0&&n.isub(this.p),n.strip(),n}split(e,n){e.iushrn(this.n,0,n)}imulK(e){return e.imul(this.k)}}let Gm=class extends Vm{constructor(){super("k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}split(e,n){const t=e.words,o=e.length,s=Math.min(o,9),a=new Array(s+(o>9?1:0)).fill(0);for(let p=0;p<s;p++)a[p]=t[p];let c=s;if(o<=9){const p=new Array(c);for(let _=0;_<c;++_)p[_]=a[_];n.words=p,e.words=[0];return}let u=t[9];a[c++]=u&4194303;const l=new Array(c);for(let p=0;p<c;++p)l[p]=a[p];n.words=l;const f=new Array(Math.max(1,o-9)).fill(0);let d=0;for(let p=10;p<o;p++){const _=Math.trunc(t[p]);d<f.length&&(f[d++]=(_&4194303)<<4|u>>>22),u=_}u>>>=22,d<f.length?f[d++]=u:u!==0&&f.length>0;const h=new Array(d);for(let p=0;p<d;++p)h[p]=f[p];e.words=h}imulK(e){const n=e.words,i=e.length,t=i+2,o=new Array(t).fill(0);for(let a=0;a<i;a++)o[a]=n[a];let s=0;for(let a=0;a<t;a++){const c=Math.trunc(o[a]);s+=c*977,o[a]=s&67108863,s=c*64+Math.trunc(s/67108864)}return e.words=o,e}};class vl{prime;m;constructor(e){if(e==="k256"){const n=new Gm;this.m=n.p,this.prime=n}else this.assert(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}assert(e,n="Assertion failed"){if(!e)throw new Error(n)}verify1(e){this.assert(e.negative===0,"red works only with positives"),this.assert(e.red,"red works only with red numbers")}verify2(e,n){this.assert((e.negative|n.negative)===0,"red works only with positives"),this.assert(e.red!=null&&e.red===n.red,"red works only with red numbers")}imod(e){return this.prime!=null?this.prime.ireduce(e).forceRed(this):(g.move(e,e.umod(this.m).forceRed(this)),e)}neg(e){return e.isZero()?e.clone():this.m.sub(e).forceRed(this)}add(e,n){this.verify2(e,n);const i=e.clone();return i.iadd(n),i.isub(this.m),i.isNeg()&&i.iadd(this.m),i}iadd(e,n){return this.verify2(e,n),e.iadd(n),e.isub(this.m),e.isNeg()&&e.iadd(this.m),e}sub(e,n){this.verify2(e,n);const i=e.sub(n);return i.cmpn(0)<0&&i.iadd(this.m),i.forceRed(this)}isub(e,n){this.verify2(e,n);const i=e.isub(n);return i.cmpn(0)<0&&i.iadd(this.m),i}shl(e,n){return this.verify1(e),this.imod(e.ushln(n))}imul(e,n){return this.verify2(e,n),this.imod(e.imul(n))}mul(e,n){return this.verify2(e,n),this.imod(e.mul(n))}isqr(e){return this.imul(e,e.clone())}sqr(e){return this.mul(e,e)}sqrt(e){if(e.isZero())return e.clone();const n=this.m.andln(3);if(this.assert(n%2===1),n===3){const p=this.m.add(new g(1)).iushrn(2);return this.pow(e,p)}const i=this.m.subn(1);let t=0;for(;!i.isZero()&&i.andln(1)===0;)t++,i.iushrn(1);this.assert(!i.isZero());const o=new g(1).toRed(this),s=o.redNeg(),a=this.m.subn(1).iushrn(1),c=this.m.bitLength(),u=new g(2*c*c).toRed(this);for(;this.pow(u,a).cmp(s)!==0;)u.redIAdd(s);let l=this.pow(u,i),f=this.pow(e,i.addn(1).iushrn(1)),d=this.pow(e,i),h=t;for(;d.cmp(o)!==0;){let p=d,_=0;for(;p.cmp(o)!==0;_++)p=p.redSqr();this.assert(_<h);const w=this.pow(l,new g(1).iushln(h-_-1));f=f.redMul(w),l=w.redSqr(),d=d.redMul(l),h=_}return f}invm(e){const n=e._invmp(this.m);return n.negative!==0?(n.negative=0,this.imod(n).redNeg()):this.imod(n)}pow(e,n){if(this.verify1(e),n.isZero())return new g(1).toRed(this);let i=new g(1).toRed(this);const t=e.clone(),o=n.bitLength();for(let s=o-1;s>=0;s--)i=this.sqr(i),n.testn(s)&&(i=this.mul(i,t));return i}convertTo(e){const n=e.umod(this.m);return n===e?n.clone():n}convertFrom(e){const n=e.clone();return n.red=null,n}}class Km extends vl{shift;r;r2;rinv;minv;constructor(e){super(e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new g(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}convertTo(e){return this.imod(e.ushln(this.shift))}convertFrom(e){const n=this.imod(e.mul(this.rinv));return n.red=null,n}imul(e,n){if(e.isZero()||n.isZero())return e.words[0]=0,e.length=1,e;const i=e.imul(n),t=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=i.isub(t).iushrn(this.shift);let s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s.forceRed(this)}mul(e,n){if(e.isZero()||n.isZero())return new g(0).forceRed(this);const i=e.mul(n),t=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=i.isub(t).iushrn(this.shift);let s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s.forceRed(this)}invm(e){return this.imod(e._invmp(this.m).mul(this.r2)).forceRed(this)}}class yl{curve;type;precomputed;constructor(e){this.curve=new Ie,this.type=e,this.precomputed=null}}class Fe extends yl{x;y;z;zOne;constructor(e,n,i){super("jacobian"),e===null&&n===null&&i===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new g(0)):(g.isBN(e)||(e=new g(e,16)),this.x=e,g.isBN(n)||(n=new g(n,16)),this.y=n,g.isBN(i)||(i=new g(i,16)),this.z=i),this.x.red==null&&(this.x=this.x.toRed(this.curve.red)),this.y.red==null&&(this.y=this.y.toRed(this.curve.red)),this.z.red==null&&(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.isInfinity()&&(this.x=this.curve.one,this.y=this.curve.one,this.z=new g(0).toRed(this.curve.red),this.zOne=!1)}toP(){if(this.isInfinity())return new B(null,null);const e=this.z.redInvm(),n=e.redSqr(),i=this.x.redMul(n),t=this.y.redMul(n).redMul(e);return new B(i,t)}neg(){return new Fe(this.x,this.y.redNeg(),this.z)}add(e){if(this.isInfinity())return e;if(e.isInfinity())return this;const n=e.z.redSqr(),i=this.z.redSqr(),t=this.x.redMul(n),o=e.x.redMul(i),s=this.y.redMul(n.redMul(e.z)),a=e.y.redMul(i.redMul(this.z)),c=t.redSub(o),u=s.redSub(a);if(c.cmpn(0)===0)return u.cmpn(0)===0?this.dbl():new Fe(null,null,null);const l=c.redSqr(),f=l.redMul(c),d=t.redMul(l),h=u.redSqr().redIAdd(f).redISub(d).redISub(d),p=u.redMul(d.redISub(h)).redISub(s.redMul(f)),_=this.z.redMul(e.z).redMul(c);return new Fe(h,p,_)}mixedAdd(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;if(e.x===null||e.y===null)throw new Error("Point coordinates cannot be null");const n=this.z.redSqr(),i=this.x,t=e.x.redMul(n),o=this.y,s=e.y.redMul(n).redMul(this.z),a=i.redSub(t),c=o.redSub(s);if(a.cmpn(0)===0)return c.cmpn(0)===0?this.dbl():new Fe(null,null,null);const u=a.redSqr(),l=u.redMul(a),f=i.redMul(u),d=c.redSqr().redIAdd(l).redISub(f).redISub(f),h=c.redMul(f.redISub(d)).redISub(o.redMul(l)),p=this.z.redMul(a);return new Fe(d,h,p)}dblp(e){if(e===0)return this;if(this.isInfinity())return this;if(e===void 0)return this.dbl();let n=this;for(let i=0;i<e;i++)n=n.dbl();return n}dbl(){if(this.isInfinity())return this;let e,n,i;if(this.zOne){const t=this.x.redSqr(),o=this.y.redSqr(),s=o.redSqr();let a=this.x.redAdd(o).redSqr().redISub(t).redISub(s);a=a.redIAdd(a);const c=t.redAdd(t).redIAdd(t),u=c.redSqr().redISub(a).redISub(a);let l=s.redIAdd(s);l=l.redIAdd(l),l=l.redIAdd(l),e=u,n=c.redMul(a.redISub(u)).redISub(l),i=this.y.redAdd(this.y)}else{const t=this.x.redSqr(),o=this.y.redSqr(),s=o.redSqr();let a=this.x.redAdd(o).redSqr().redISub(t).redISub(s);a=a.redIAdd(a);const c=t.redAdd(t).redIAdd(t),u=c.redSqr();let l=s.redIAdd(s);l=l.redIAdd(l),l=l.redIAdd(l),e=u.redISub(a).redISub(a),n=c.redMul(a.redISub(e)).redISub(l),i=this.y.redMul(this.z),i=i.redIAdd(i)}return new Fe(e,n,i)}eq(e){if(e.type==="affine")return this.eq(e.toJ());if(this===e||(e=e,this.isInfinity()&&e.isInfinity()))return!0;if(this.isInfinity()!==e.isInfinity())return!1;const n=this.z.redSqr(),i=e.z.redSqr();if(this.x.redMul(i).redISub(e.x.redMul(n)).cmpn(0)!==0)return!1;const t=n.redMul(this.z),o=i.redMul(e.z);return this.y.redMul(o).redISub(e.y.redMul(t)).cmpn(0)===0}eqXToP(e){const n=this.z.redSqr(),i=e.toRed(this.curve?.red).redMul(n);if(this.x.cmp(i)===0)return!0;const t=e.clone();if(this.curve?.redN==null)throw new Error("Curve or redN is not initialized.");const o=this.curve.redN.redMul(n);for(;t.cmp(this.curve.p)<0;){if(t.iadd(this.curve.n),t.cmp(this.curve.p)>=0)return!1;if(i.redIAdd(o),this.x.cmp(i)===0)return!0}return!1}inspect(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"}isInfinity(){return this.z.cmpn(0)===0}}const Jm=/^[0-9a-fA-F]*$/;function rs(r){if(typeof r!="string")throw new TypeError("Invalid hex string");if(r.length!==0&&!Jm.test(r))throw new Error("Invalid hex string")}function Wm(r){if(rs(r),r.length===0)return"";let e=r.toLowerCase();return e.length%2!==0&&(e="0"+e),e}const Lo=(r,e="Hash assertion failed")=>{if(!r)throw new Error(e)};class _l{pending;pendingTotal;blockSize;outSize;endian;_delta8;_delta32;padLength;hmacStrength;constructor(e,n,i,t){this.pending=null,this.pendingTotal=0,this.blockSize=e,this.outSize=n,this.hmacStrength=i,this.padLength=t/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}_update(e,n){throw new Error("Not implemented")}_digest(){throw new Error("Not implemented")}_digestHex(){throw new Error("Not implemented")}update(e,n){if(e=xl(e,n),this.pending==null?this.pending=e:this.pending=this.pending.concat(e),this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;const i=e.length%this._delta8;this.pending=e.slice(e.length-i,e.length),this.pending.length===0&&(this.pending=null),e=ag(e,0,e.length-i,this.endian);for(let t=0;t<e.length;t+=this._delta32)this._update(e,t)}return this}digest(){return this.update(this._pad()),Lo(this.pending===null),this._digest()}digestHex(){return this.update(this._pad()),Lo(this.pending===null),this._digestHex()}_pad(){const e=this.pendingTotal;if(!Number.isSafeInteger(e)||e<0)throw new Error("Message too long for this hash function");const n=this._delta8,i=n-(e+this.padLength)%n,t=new Array(i+this.padLength);t[0]=128;let o;for(o=1;o<i;o++)t[o]=0;const s=this.padLength,a=1n<<BigInt(s*8);let c=BigInt(e)*8n;if(c>=a)throw new Error("Message too long for this hash function");if(this.endian==="big"){const u=new Array(s);for(let l=s-1;l>=0;l--)u[l]=Number(c&0xffn),c>>=8n;for(let l=0;l<s;l++)t[o++]=u[l]}else for(let u=0;u<s;u++)t[o++]=Number(c&0xffn),c>>=8n;return t}}function Xm(r,e){return(r.charCodeAt(e)&64512)!==55296||e<0||e+1>=r.length?!1:(r.charCodeAt(e+1)&64512)===56320}function Ym(r,e,n){let i=r.charCodeAt(e);return i<128?(n.push(i),e):i<2048?(n.push(i>>6|192,i&63|128),e):Xm(r,e)?(i=65536+((i&1023)<<10)+(r.charCodeAt(e+1)&1023),n.push(i>>18|240,i>>12&63|128,i>>6&63|128,i&63|128),e+1):(n.push(i>>12|224,i>>6&63|128,i&63|128),e)}function Qm(r){const e=[];let n=0;for(;n<r.length;)n=Ym(r,n,e)+1;return e}function eg(r){rs(r);const e=Wm(r),n=[];for(let i=0;i<e.length;i+=2)n.push(Number.parseInt(e[i]+e[i+1],16));return n}function tg(r){const e=[];for(let n=0;n<r.length;n++)e[n]=Math.trunc(r[n]);return e}function xl(r,e){return Array.isArray(r)?r.slice():r?typeof r=="string"?e==="hex"?eg(r):Qm(r):tg(r):[]}function ng(r){return Zg(r)}function wl(r,e){let n="";for(let i of r)e==="little"&&(i=ng(i)),n+=rg(i.toString(16));return n}function rg(r){return r.length===7?"0"+r:r.length===6?"00"+r:r.length===5?"000"+r:r.length===4?"0000"+r:r.length===3?"00000"+r:r.length===2?"000000"+r:r.length===1?"0000000"+r:r}const Mo=typeof globalThis>"u"?void 0:globalThis.Buffer,ig=Mo!=null&&typeof Mo.from=="function",nu="0123456789abcdef",jo=new Array(256);for(let r=0;r<jo.length;r++)jo[r]=nu[r>>4&15]+nu[r&15];function og(r){if(ig)return Mo.from(r).toString("hex");const e=new Array(r.length);for(let n=0;n<r.length;n++)e[n]=jo[r[n]];return e.join("")}const Sl=(()=>{const r=typeof globalThis>"u"?void 0:globalThis.process,e=r?.getBuiltinModule;if(typeof e=="function")try{const n=e.call(r,"node:crypto");if(n!=null)return n}catch{}try{if(typeof require=="function")return require("node:crypto")}catch{}})();function At(r,e){return r instanceof Uint8Array?r:Array.isArray(r)?new Uint8Array(r):Uint8Array.from(xl(r,e))}function is(r){return typeof r=="string"?At(r,"hex"):At(r)}function kl(r,e,n){r!=null?r.update(n):e?.update(n)}function Il(r,e){return r!=null?Array.from(r.digest()):e!=null?Array.from(e.digest()):[]}function $l(r,e){return r!=null?r.digest("hex"):e!=null?og(e.digest()):""}function sg(r){const e=Sl?.createHash;if(typeof e=="function")try{return e(r)}catch{return}}function os(r,e){const n=Sl?.createHmac;if(typeof n=="function")try{return n(r,e)}catch{return}}function El(r,e,n){const i=sg(r);if(i!=null)return i.update(At(e,n)),i.digest()}function Tl(r,e,n,i){const t=os(r,is(e));if(t!=null)return t.update(At(n,i)),t.digest()}function ag(r,e,n,i){const t=n-e;Lo(t%4===0);const o=new Array(t/4);for(let s=0,a=e;s<o.length;s++,a+=4){let c;i==="big"?c=r[a]<<24|r[a+1]<<16|r[a+2]<<8|r[a+3]:c=r[a+3]<<24|r[a+2]<<16|r[a+1]<<8|r[a],o[s]=c>>>0}return o}function Ol(r,e){const n=new Array(r.length*4);for(let i=0,t=0;i<r.length;i++,t+=4){const o=r[i];e==="big"?(n[t]=o>>>24,n[t+1]=o>>>16&255,n[t+2]=o>>>8&255,n[t+3]=o&255):(n[t+3]=o>>>24,n[t+2]=o>>>16&255,n[t+1]=o>>>8&255,n[t]=o&255)}return n}function Qe(r,e){return r>>>e|r<<32-e}function $t(r,e){return r<<e|r>>>32-e}function ue(r,e){return r+e>>>0}function Tn(r,e,n){return r+e+n>>>0}function ru(r,e,n,i){return r+e+n+i>>>0}function Pl(r,e,n,i,t){return r+e+n+i+t>>>0}function cg(r,e,n,i){return r===0?zl(e,n,i):r===1||r===3?ug(e,n,i):r===2?Al(e,n,i):0}function zl(r,e,n){return r&e^~r&n}function Al(r,e,n){return r&e^r&n^e&n}function ug(r,e,n){return r^e^n}function lg(r){return Qe(r,2)^Qe(r,13)^Qe(r,22)}function dg(r){return Qe(r,6)^Qe(r,11)^Qe(r,25)}function fg(r){return Qe(r,7)^Qe(r,18)^r>>>3}function hg(r){return Qe(r,17)^Qe(r,19)^r>>>10}const pg=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],mg=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],gg=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],bg=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11];function iu(r,e,n,i){return r<=15?e^n^i:r<=31?e&n|~e&i:r<=47?(e|~n)^i:r<=63?e&i|n&~i:e^(n|~i)}function vg(r){return r<=15?0:r<=31?1518500249:r<=47?1859775393:r<=63?2400959708:2840853838}function yg(r){return r<=15?1352829926:r<=31?1548603684:r<=47?1836072691:r<=63?2053994217:0}class Nl extends _l{h;constructor(){super(512,160,192,64),this.endian="little",this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}_update(e,n){let i=this.h[0],t=this.h[1],o=this.h[2],s=this.h[3],a=this.h[4],c=i,u=t,l=o,f=s,d=a,h;for(let p=0;p<80;p++)h=ue($t(ru(i,iu(p,t,o,s),e[pg[p]+n],vg(p)),gg[p]),a),i=a,a=s,s=$t(o,10),o=t,t=h,h=ue($t(ru(c,iu(79-p,u,l,f),e[mg[p]+n],yg(p)),bg[p]),d),c=d,d=f,f=$t(l,10),l=u,u=h;h=Tn(this.h[1],o,f),this.h[1]=Tn(this.h[2],s,d),this.h[2]=Tn(this.h[3],a,c),this.h[3]=Tn(this.h[4],i,u),this.h[4]=Tn(this.h[0],t,l),this.h[0]=h}_digest(){return Ol(this.h,"little")}_digestHex(){return wl(this.h,"little")}}class _g extends _l{h;W;k;constructor(){super(512,160,80,64),this.k=[1518500249,1859775393,2400959708,3395469782],this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}_update(e,n){const i=this.W;n===void 0&&(n=0);let t;for(t=0;t<16;t++)i[t]=e[n+t];for(;t<i.length;t++)i[t]=$t(i[t-3]^i[t-8]^i[t-14]^i[t-16],1);let o=this.h[0],s=this.h[1],a=this.h[2],c=this.h[3],u=this.h[4];for(t=0;t<i.length;t++){const l=Math.trunc(t/20),f=Pl($t(o,5),cg(l,s,a,c),u,i[t],this.k[l]);u=c,c=a,a=$t(s,30),s=o,o=f}this.h[0]=ue(this.h[0],o),this.h[1]=ue(this.h[1],s),this.h[2]=ue(this.h[2],a),this.h[3]=ue(this.h[3],c),this.h[4]=ue(this.h[4],u)}_digest(){return Ol(this.h,"big")}_digestHex(){return wl(this.h,"big")}}class Ul{h;native;blockSize=64;outSize=32;constructor(e){const n=is(e);this.native=os("sha256",n),this.native==null&&(this.h=new Hl(Mg,n))}update(e,n){return kl(this.native,this.h,At(e,n)),this}digest(){return Il(this.native,this.h)}digestHex(){return $l(this.native,this.h)}}class xg{h;native;blockSize=128;outSize=32;constructor(e){const n=is(e);this.native=os("sha512",n),this.native==null&&(this.h=new Hl(Hg,n))}update(e,n){return kl(this.native,this.h,At(e,n)),this}digest(){return Il(this.native,this.h)}digestHex(){return $l(this.native,this.h)}}function ei(r,e){const n=El("sha256",r,e);return n??new Bl().update(At(r,e)).digest()}function Dl(r,e){return El("ripemd160",r,e)}const wg=(r,e)=>{const n=Dl(r,e);return n!=null?Array.from(n):new Nl().update(r,e).digest()},Sg=(r,e)=>new _g().update(r,e).digest(),Nt=(r,e)=>Array.from(ei(r,e)),Ue=(r,e)=>Array.from(ei(ei(r,e))),Rl=(r,e)=>{const n=ei(r,e),i=Dl(n);return i!=null?Array.from(i):new Nl().update(n).digest()},Cl=(r,e,n)=>{const i=Tl("sha256",r,e,n);return i!=null?Array.from(i):new Ul(r).update(e,n).digest()},kg=(r,e,n)=>{const i=Tl("sha512",r,e,n);return i!=null?Array.from(i):new xg(r).update(e,n).digest()};function Ig(r){return r instanceof Uint8Array||ArrayBuffer.isView(r)&&r.constructor.name==="Uint8Array"}function ou(r){if(!Number.isSafeInteger(r)||r<0)throw new Error(`positive integer expected, got ${r}`)}function mi(r,...e){if(!Ig(r))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(r.length)){const n=e.join(",");throw new Error(`Uint8Array expected of length ${n}, got length=${r.length}`)}}function $g(r){if(typeof r!="function"||typeof r.create!="function")throw new TypeError("Hash should be wrapped by utils.createHasher");ou(r.outputLen),ou(r.blockLen)}function ti(r,e=!0){if(r.destroyed===!0)throw new Error("Hash instance has been destroyed");if(e&&r.finished===!0)throw new Error("Hash#digest() has already been called")}function Eg(r,e){mi(r);const n=e.outputLen;if(r.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}function Xt(...r){for(const e of r)e.fill(0)}function zo(r){return new DataView(r.buffer,r.byteOffset,r.byteLength)}function ss(r){return typeof r=="string"&&(r=Tg(r)),mi(r),r}function Tg(r){if(typeof r!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(r))}class Ll{}function Ml(r){const e=i=>r().update(ss(i)).digest(),n=r();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>r(),e}const Vr=BigInt(2**32-1),su=BigInt(32);function Og(r,e=!1){return e?{h:Number(r&Vr),l:Number(r>>su&Vr)}:{h:Number(r>>su&Vr)|0,l:Number(r&Vr)|0}}function Pg(r,e=!1){const n=r.length,i=new Uint32Array(n),t=new Uint32Array(n);for(let o=0;o<n;o++){const{h:s,l:a}=Og(r[o],e);i[o]=s,t[o]=a}return[i,t]}const au=(r,e,n)=>r>>>n,cu=(r,e,n)=>r<<32-n|e>>>n,qt=(r,e,n)=>r>>>n|e<<32-n,Vt=(r,e,n)=>r<<32-n|e>>>n,Gr=(r,e,n)=>r<<64-n|e>>>n-32,Kr=(r,e,n)=>r>>>n-32|e<<64-n;function it(r,e,n,i){const t=(e>>>0)+(i>>>0);return{h:r+n+(t/2**32|0)|0,l:t|0}}const zg=(r,e,n)=>(r>>>0)+(e>>>0)+(n>>>0),Ag=(r,e,n,i)=>e+n+i+(r/2**32|0)|0,Ng=(r,e,n,i)=>(r>>>0)+(e>>>0)+(n>>>0)+(i>>>0),Ug=(r,e,n,i,t)=>e+n+i+t+(r/2**32|0)|0,Dg=(r,e,n,i,t)=>(r>>>0)+(e>>>0)+(n>>>0)+(i>>>0)+(t>>>0),Rg=(r,e,n,i,t,o)=>e+n+i+t+o+(r/2**32|0)|0;class jl extends Ll{blockLen;outputLen;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(e,n,i,t){super(),this.blockLen=e,this.outputLen=n,this.padOffset=i,this.isLE=t,this.buffer=new Uint8Array(e),this.view=zo(this.buffer)}update(e){ti(this),e=ss(e),mi(e);const{view:n,buffer:i,blockLen:t}=this,o=e.length;for(let s=0;s<o;){const a=Math.min(t-this.pos,o-s);if(a===t){const c=zo(e);for(;t<=o-s;s+=t)this.process(c,s);continue}i.set(e.subarray(s,s+a),this.pos),this.pos+=a,s+=a,this.pos===t&&(this.process(n,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){ti(this),Eg(e,this),this.finished=!0;const{buffer:n,view:i,blockLen:t,isLE:o}=this;let{pos:s}=this;n[s++]=128,Xt(this.buffer.subarray(s)),this.padOffset>t-s&&(this.process(i,0),s=0);for(let f=s;f<t;f++)n[f]=0;Cg(i,t-8,BigInt(this.length*8),o),this.process(i,0);const a=zo(e),c=this.outputLen;if(c%4!==0)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=c/4,l=this.get();if(u>l.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<u;f++)a.setUint32(4*f,l[f],o)}digest(){const{buffer:e,outputLen:n}=this;this.digestInto(e);const i=e.slice(0,n);return this.destroy(),i}_cloneInto(e){e||=new this.constructor,e.set(...this.get());const{blockLen:n,buffer:i,length:t,finished:o,destroyed:s,pos:a}=this;return e.destroyed=s,e.finished=o,e.length=t,e.pos=a,t%n!==0&&e.buffer.set(i),e}clone(){return this._cloneInto()}}function Cg(r,e,n,i){if(typeof r.setBigUint64=="function")return r.setBigUint64(e,n,i);const t=BigInt(32),o=BigInt(4294967295),s=Number(n>>t&o),a=Number(n&o),c=i?4:0,u=i?0:4;r.setUint32(e+c,s,i),r.setUint32(e+u,a,i)}const lt=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Lg=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),dt=new Uint32Array(64);class Bl extends jl{A=lt[0]|0;B=lt[1]|0;C=lt[2]|0;D=lt[3]|0;E=lt[4]|0;F=lt[5]|0;G=lt[6]|0;H=lt[7]|0;constructor(e=32){super(64,e,8,!1)}get(){const{A:e,B:n,C:i,D:t,E:o,F:s,G:a,H:c}=this;return[e,n,i,t,o,s,a,c]}set(e,n,i,t,o,s,a,c){this.A=e|0,this.B=n|0,this.C=i|0,this.D=t|0,this.E=o|0,this.F=s|0,this.G=a|0,this.H=c|0}process(e,n){for(let f=0;f<16;f++,n+=4)dt[f]=e.getUint32(n);for(let f=16;f<64;f++){const d=dt[f-15],h=dt[f-2],p=fg(d),_=hg(h);dt[f]=ue(ue(p,dt[f-7]),ue(_,dt[f-16]))}let{A:i,B:t,C:o,D:s,E:a,F:c,G:u,H:l}=this;for(let f=0;f<64;f++){const d=Pl(l,dg(a),zl(a,c,u),Lg[f],dt[f]),h=ue(lg(i),Al(i,t,o));l=u,u=c,c=a,a=ue(s,d),s=o,o=t,t=i,i=ue(d,h)}this.A=ue(this.A,i),this.B=ue(this.B,t),this.C=ue(this.C,o),this.D=ue(this.D,s),this.E=ue(this.E,a),this.F=ue(this.F,c),this.G=ue(this.G,u),this.H=ue(this.H,l)}roundClean(){Xt(dt)}destroy(){Xt(this.buffer),this.set(0,0,0,0,0,0,0,0)}}const Mg=Ml(()=>new Bl),_e=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),Fl=Pg(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(BigInt)),jg=Fl[0],Bg=Fl[1],ft=new Uint32Array(80),ht=new Uint32Array(80);class Fg extends jl{Ah=_e[0]|0;Al=_e[1]|0;Bh=_e[2]|0;Bl=_e[3]|0;Ch=_e[4]|0;Cl=_e[5]|0;Dh=_e[6]|0;Dl=_e[7]|0;Eh=_e[8]|0;El=_e[9]|0;Fh=_e[10]|0;Fl=_e[11]|0;Gh=_e[12]|0;Gl=_e[13]|0;Hh=_e[14]|0;Hl=_e[15]|0;constructor(e=64){super(128,e,16,!1)}get(){const{Ah:e,Al:n,Bh:i,Bl:t,Ch:o,Cl:s,Dh:a,Dl:c,Eh:u,El:l,Fh:f,Fl:d,Gh:h,Gl:p,Hh:_,Hl:w}=this;return[e,n,i,t,o,s,a,c,u,l,f,d,h,p,_,w]}set(e,n,i,t,o,s,a,c,u,l,f,d,h,p,_,w){this.Ah=e|0,this.Al=n|0,this.Bh=i|0,this.Bl=t|0,this.Ch=o|0,this.Cl=s|0,this.Dh=a|0,this.Dl=c|0,this.Eh=u|0,this.El=l|0,this.Fh=f|0,this.Fl=d|0,this.Gh=h|0,this.Gl=p|0,this.Hh=_|0,this.Hl=w|0}process(e,n){for(let k=0;k<16;k++,n+=8)ft[k]=e.getUint32(n),ht[k]=e.getUint32(n+4);for(let k=16;k<80;k++){const z=ft[k-15]|0,A=ht[k-15]|0,J=qt(z,A,1)^qt(z,A,8)^au(z,A,7),se=Vt(z,A,1)^Vt(z,A,8)^cu(z,A,7),le=ft[k-2]|0,Y=ht[k-2]|0,Te=qt(le,Y,19)^Gr(le,Y,61)^au(le,Y,6),rt=Vt(le,Y,19)^Kr(le,Y,61)^cu(le,Y,6),Oe=Ng(se,rt,ht[k-7],ht[k-16]),Ve=Ug(Oe,J,Te,ft[k-7],ft[k-16]);ft[k]=Ve|0,ht[k]=Oe|0}let{Ah:i,Al:t,Bh:o,Bl:s,Ch:a,Cl:c,Dh:u,Dl:l,Eh:f,El:d,Fh:h,Fl:p,Gh:_,Gl:w,Hh:O,Hl:$}=this;for(let k=0;k<80;k++){const z=qt(f,d,14)^qt(f,d,18)^Gr(f,d,41),A=Vt(f,d,14)^Vt(f,d,18)^Kr(f,d,41),J=f&h^~f&_,se=d&p^~d&w,le=Dg($,A,se,Bg[k],ht[k]),Y=Rg(le,O,z,J,jg[k],ft[k]),Te=le|0,rt=qt(i,t,28)^Gr(i,t,34)^Gr(i,t,39),Oe=Vt(i,t,28)^Kr(i,t,34)^Kr(i,t,39),Ve=i&o^i&a^o&a,Zt=t&s^t&c^s&c;O=_|0,$=w|0,_=h|0,w=p|0,h=f|0,p=d|0,{h:f,l:d}=it(u|0,l|0,Y|0,Te|0),u=a|0,l=c|0,a=o|0,c=s|0,o=i|0,s=t|0;const T=zg(Oe,Zt,Te);i=Ag(T,rt,Ve,Y),t=T|0}({h:i,l:t}=it(i,t,this.Ah,this.Al)),{h:o,l:s}=it(o,s,this.Bh,this.Bl),{h:a,l:c}=it(a,c,this.Ch,this.Cl),{h:u,l}=it(u,l,this.Dh,this.Dl),{h:f,l:d}=it(f,d,this.Eh,this.El),{h,l:p}=it(h,p,this.Fh,this.Fl),{h:_,l:w}=it(_,w,this.Gh,this.Gl),{h:O,l:$}=it(O,$,this.Hh,this.Hl),this.set(i,t,o,s,a,c,u,l,f,d,h,p,_,w,O,$)}roundClean(){Xt(ft,ht)}destroy(){Xt(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const Hg=Ml(()=>new Fg);class Hl extends Ll{oHash;iHash;blockLen;outputLen;finished=!1;destroyed=!1;constructor(e,n){super(),$g(e);const i=ss(n);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new TypeError("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const t=this.blockLen,o=new Uint8Array(t);o.set(i.length>t?e.create().update(i).digest():i);for(let s=0;s<o.length;s++)o[s]^=54;this.iHash.update(o),this.oHash=e.create();for(let s=0;s<o.length;s++)o[s]^=106;this.oHash.update(o),Xt(o)}update(e){return ti(this),this.iHash.update(e),this}digestInto(e){ti(this),mi(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||=Object.create(Object.getPrototypeOf(this),{});const{oHash:n,iHash:i,finished:t,destroyed:o,blockLen:s,outputLen:a}=this;return e=e,e.finished=t,e.destroyed=o,e.blockLen=s,e.outputLen=a,e.oHash=n._cloneInto(e.oHash??void 0),e.iHash=i._cloneInto(e.iHash??void 0),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}function Zg(r){return(r>>>24|r>>>8&65280|r<<8&16711680|(r&255)<<24)>>>0}(()=>{const r=new ArrayBuffer(4),e=new Uint32Array(r),n=new Uint8Array(r);return e[0]=16909060,n[0]===4})();class Ge{buffer;pos;capacity;constructor(e,n=256){if(e!=null&&e.length>0){const i=e.reduce((t,o)=>t+o.length,0);n=Math.max(n,i)}if(this.buffer=new Uint8Array(n),this.pos=0,this.capacity=n,e!=null)for(const i of e)this.write(i)}getLength(){return this.pos}toUint8Array(){return this.buffer.slice(0,this.pos)}toArray(){return Array.from(this.toUint8Array())}toUint8ArrayZeroCopy(){return this.buffer.subarray(0,this.pos)}reserve(e){if(!Number.isSafeInteger(e)||e<0)throw new RangeError("WriterUint8Array reserve requires a non-negative safe integer");this.ensureCapacity(e)}ensureCapacity(e){if(this.pos+e>this.capacity){let n=this.capacity*2;for(;this.pos+e>n;)n*=2;const i=new Uint8Array(n);i.set(this.buffer),this.buffer=i,this.capacity=n}}write(e){const n=e instanceof Uint8Array?e:new Uint8Array(e);return this.ensureCapacity(n.length),this.buffer.set(n,this.pos),this.pos+=n.length,this}writeReverse(e){const n=e instanceof Uint8Array?e:new Uint8Array(e);this.ensureCapacity(n.length);for(let i=n.length-1;i>=0;i--)this.buffer[this.pos]=n[i],this.pos+=1;return this}writeUInt8(e){return this.ensureCapacity(1),this.buffer[this.pos]=e&255,this.pos+=1,this}writeInt8(e){return this.writeUInt8(e),this}writeUInt16LE(e){return this.ensureCapacity(2),this.buffer[this.pos]=e&255,this.buffer[this.pos+1]=e>>8&255,this.pos+=2,this}writeUInt16BE(e){return this.ensureCapacity(2),this.buffer[this.pos]=e>>8&255,this.buffer[this.pos+1]=e&255,this.pos+=2,this}writeInt16LE(e){return this.writeUInt16LE(e&65535),this}writeInt16BE(e){return this.writeUInt16BE(e&65535),this}writeUInt32LE(e){return this.ensureCapacity(4),this.buffer[this.pos]=e&255,this.buffer[this.pos+1]=e>>8&255,this.buffer[this.pos+2]=e>>16&255,this.buffer[this.pos+3]=e>>24&255,this.pos+=4,this}writeUInt32BE(e){return this.ensureCapacity(4),this.buffer[this.pos]=e>>24&255,this.buffer[this.pos+1]=e>>16&255,this.buffer[this.pos+2]=e>>8&255,this.buffer[this.pos+3]=e&255,this.pos+=4,this}writeInt32LE(e){return this.writeUInt32LE(e>>>0),this}writeInt32BE(e){return this.writeUInt32BE(e>>>0),this}writeUInt64BEBn(e){const n=e.toArray("be",8);return this.write(n),this}writeUInt64LEBn(e){const n=e.toArray("be",8);return this.writeReverse(n),this}writeUInt64LE(e){const n=new g(e).toArray("be",8);return this.writeReverse(n),this}writeVarIntNum(e){const n=Ae.varIntNum(e);return this.write(n),this}writeVarIntBn(e){const n=Ae.varIntBn(e);return this.write(n),this}reset(){this.pos=0}}class me{bin;pos;length;static makeReader(e,n=0){if(e instanceof Uint8Array)return new me(e,n);if(Array.isArray(e))return new Jg(e,n);throw new Error("ReaderUint8Array.makeReader: bin must be Uint8Array or number[]")}constructor(e=new Uint8Array(0),n=0){if(e instanceof Uint8Array)this.bin=e;else if(Array.isArray(e))this.bin=new Uint8Array(e);else throw new TypeError("ReaderUint8Array constructor: bin must be Uint8Array or number[]");this.pos=n,this.length=this.bin.length}eof(){return this.pos>=this.length}read(e=this.length){const n=this.pos,i=this.pos+e;return this.pos=i,this.bin.slice(n,i)}readView(e=this.length-this.pos){if(!Number.isSafeInteger(e)||e<0||this.pos+e>this.length)throw new RangeError("ReaderUint8Array read exceeds available data");const n=this.pos;return this.pos+=e,this.bin.subarray(n,this.pos)}skip(e){if(!Number.isSafeInteger(e)||e<0||this.pos+e>this.length)throw new RangeError("ReaderUint8Array skip exceeds available data");this.pos+=e}remaining(){return this.length-this.pos}readReverse(e=this.length){const n=new Uint8Array(e);for(let i=0;i<e;i++)n[i]=this.bin[this.pos+e-1-i];return this.pos+=e,n}readUInt8(){const e=this.bin[this.pos];return this.pos+=1,e}readInt8(){const e=this.bin[this.pos];return this.pos+=1,(e&128)===0?e:e-256}readUInt16BE(){const e=this.bin[this.pos]<<8|this.bin[this.pos+1];return this.pos+=2,e}readInt16BE(){const e=this.readUInt16BE();return(e&32768)===0?e:e-65536}readUInt16LE(){const e=this.bin[this.pos]|this.bin[this.pos+1]<<8;return this.pos+=2,e}readInt16LE(){const e=this.readUInt16LE();return(e&32768)===0?e:e-65536}readUInt32BE(){const e=this.bin[this.pos]*16777216+(this.bin[this.pos+1]<<16|this.bin[this.pos+2]<<8|this.bin[this.pos+3]);return this.pos+=4,e}readInt32BE(){const e=this.readUInt32BE();return(e&2147483648)===0?e:e-4294967296}readUInt32LE(){const e=(this.bin[this.pos]|this.bin[this.pos+1]<<8|this.bin[this.pos+2]<<16|this.bin[this.pos+3]<<24)>>>0;return this.pos+=4,e}readInt32LE(){const e=this.readUInt32LE();return(e&2147483648)===0?e:e-4294967296}readUInt64BEBn(){const e=Array.from(this.bin.slice(this.pos,this.pos+8)),n=new g(e);return this.pos=this.pos+8,n}readUInt64LEBn(){const e=Array.from(this.readReverse(8));return new g(e)}readInt64LEBn(){const e=new g(2).pow(new g(63)),n=new g(2).pow(new g(64)),i=Array.from(this.readReverse(8));let t=new g(i);return t.gte(e)&&(t=t.sub(n)),t}readVarIntNum(e=!0){const n=this.readUInt8();let i;switch(n){case 253:return this.readUInt16LE();case 254:return this.readUInt32LE();case 255:if(i=e?this.readInt64LEBn():this.readUInt64LEBn(),i.lte(new g(2).pow(new g(53))))return i.toNumber();throw new Error("number too large to retain precision - use readVarIntBn");default:return n}}readVarInt(){switch(this.bin[this.pos]){case 253:return this.read(3);case 254:return this.read(5);case 255:return this.read(9);default:return this.read(1)}}readVarIntBn(){const e=this.readUInt8();switch(e){case 253:return new g(this.readUInt16LE());case 254:return new g(this.readUInt32LE());case 255:return this.readUInt64LEBn();default:return new g(e)}}}const ni=typeof globalThis>"u"?void 0:globalThis.Buffer,Zl=ni!=null&&typeof ni.from=="function",uu="0123456789abcdef",ql=new Array(256);for(let r=0;r<256;r++)ql[r]=uu[r>>4&15]+uu[r&15];const G=r=>Zl?ni.from(r).toString("hex"):r.length===0?"":Array.from(r,e=>ql[e&255]).join(""),Bo=(r,e)=>r instanceof Uint8Array?r:new Uint8Array(ee(r,e)),ee=(r,e)=>{if(Array.isArray(r))return r.slice();if(r===void 0)return[];if(typeof r!="string")return Array.from(r,n=>Math.trunc(n));switch(e){case"hex":return qg(r);case"base64":return Vg(r);default:return Gg(r)}},Un=new Int8Array(256).fill(-1);for(let r=0;r<10;r++)Un[48+r]=r;for(let r=0;r<6;r++)Un[65+r]=10+r,Un[97+r]=10+r;const qg=r=>{rs(r);const e=r.length%2===0?r:"0"+r;if(Zl)return Array.from(ni.from(e,"hex"));const n=new Array(e.length/2);let i=0;for(let t=0;t<e.length;t+=2){const o=Un[e.codePointAt(t)],s=Un[e.codePointAt(t+1)];n[i++]=o<<4|s}return n};function Vg(r){if(typeof r!="string")throw new TypeError("msg must be a string");let e=r.trim().replaceAll(/[\r\n\t\f\v ]+/g,"");e=e.replaceAll("-","+").replaceAll("_","/");const n=e.indexOf("=");if(n!==-1){const s=e.slice(n);if(!/^={1,2}$/.test(s))throw new Error("Invalid base64 padding");if(e.slice(0,n).includes("="))throw new Error("Invalid base64 padding");e=e.slice(0,n)}const i=[];let t=0,o=0;for(let s=0;s<e.length;s++){const a=e.codePointAt(s);let c=-1;if(a>=65&&a<=90)c=a-65;else if(a>=97&&a<=122)c=a-97+26;else if(a>=48&&a<=57)c=a-48+52;else if(a===43)c=62;else if(a===47)c=63;else throw new Error(`Invalid base64 character at index ${s}`);for(t=t<<6|c,o+=6;o>=8;)o-=8,i.push(t>>o&255),t&=(1<<o)-1}return i}function Gg(r){return Array.from(new TextEncoder().encode(r))}const Kg=r=>new TextDecoder().decode(new Uint8Array(r)),lu=(r,e)=>{switch(e){case"hex":return G(r);case"utf8":return Kg(r);default:return r}};function du(r){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";let n="",i;for(i=0;i<r.length;i+=3){const t=r[i],o=i+1<r.length?r[i+1]:0,s=i+2<r.length?r[i+2]:0,a=t>>2,c=(t&3)<<4|o>>4,u=(o&15)<<2|s>>6,l=s&63;n+=e.charAt(a)+e.charAt(c),n+=i+1<r.length?e.charAt(u):"=",n+=i+2<r.length?e.charAt(l):"="}return n}const Pn="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",Fo=r=>{if(r===""||typeof r!="string")throw new Error(`Expected base58 string but got “${r}”`);const e=r.match(/[IOl0]/gmu);if(e!==null)throw new Error(`Invalid base58 character “${e.join("")}”`);const n=r.match(/^1+/gmu),i=n===null?0:n[0].length,t=(r.length-i)*(Math.log(58)/Math.log(256))+1>>>0;return[...new Uint8Array([...new Uint8Array(i),...(r.match(/./gmu)??[]).map(s=>Pn.indexOf(s)).reduce((s,a)=>(s=s.map(c=>{const u=c*58+a;return a=u>>8,u}),s),new Uint8Array(t)).reverse().filter((s=>a=>s=s||a)(!1))])]},Ho=r=>{const e=new Array(256).fill(-1);for(let i=0;i<Pn.length;++i)e[Pn.codePointAt(i)]=i;const n=[];for(const i of r){let t=i;for(let o=0;o<n.length;++o){const s=(e[n[o]]<<8)+t;n[o]=Pn.codePointAt(s%58),t=Math.trunc(s/58)}for(;t!==0;)n.push(Pn.codePointAt(t%58)),t=Math.trunc(t/58)}for(const i of r)if(i===0)n.push("1".codePointAt(0));else break;return n.reverse(),String.fromCodePoint(...n)},Vl=(r,e=[0])=>{let n=Ue([...e,...r]);return n=[...e,...r,...n.slice(0,4)],Ho(n)},Gl=(r,e,n=1)=>{const i=Fo(r);let t=i.slice(0,n),o=i.slice(n,-4),s=[...t,...o];return s=Ue(s),i.slice(-4).forEach((a,c)=>{if(a!==s[c])throw new Error("Invalid checksum")}),{prefix:t,data:o}};class Ae{bufs;length;constructor(e){this.bufs=e??[],this.length=0;for(const n of this.bufs)this.length+=n.length}getLength(){return this.length}toUint8Array(){const e=new Uint8Array(this.length);let n=0;for(const i of this.bufs)e.set(i,n),n+=i.length;return e}toArray(){const e=this.length,n=new Array(e);let i=0;for(const t of this.bufs)if(t instanceof Uint8Array)for(const o of t)n[i++]=o;else{const o=t;for(const s of o)n[i++]=s}return n}toHex(){return this.toArray().map(e=>e.toString(16).padStart(2,"0")).join("")}write(e){return this.bufs.push(e),this.length+=e.length,this}writeReverse(e){const n=new Array(e.length);for(let i=0;i<n.length;i++)n[i]=e[e.length-1-i];return this.write(n)}writeUInt8(e){const n=new Array(1);return n[0]=e&255,this.write(n),this}writeInt8(e){return this.writeUInt8(e)}writeUInt16BE(e){const n=[e>>8&255,e&255];return this.write(n)}writeInt16BE(e){return this.writeUInt16BE(e&65535)}writeUInt16LE(e){const n=[e&255,e>>8&255];return this.write(n)}writeInt16LE(e){return this.writeUInt16LE(e&65535)}writeUInt32BE(e){const n=[e>>24&255,e>>16&255,e>>8&255,e&255];return this.write(n)}writeInt32BE(e){return this.writeUInt32BE(e>>>0)}writeUInt32LE(e){const n=[e&255,e>>8&255,e>>16&255,e>>24&255];return this.write(n)}writeInt32LE(e){return this.writeUInt32LE(e>>>0)}writeUInt64BEBn(e){const n=e.toArray("be",8);return this.write(n),this}writeUInt64LEBn(e){const n=e.toArray("be",8);return this.writeReverse(n),this}writeUInt64LE(e){if(e===-1)this.write(new Array(8).fill(255));else{const n=new g(e).toArray("be",8);this.writeReverse(n)}return this}writeVarIntNum(e){const n=Ae.varIntNum(e);return this.write(n),this}writeVarIntBn(e){const n=Ae.varIntBn(e);return this.write(n),this}static varIntNum(e){let n;if(e<0)return this.varIntBn(new g(e));if(e<253)n=[e];else if(e<65536)n=[253,e&255,e>>8&255];else if(e<4294967296)n=[254,e&255,e>>8&255,e>>16&255,e>>24&255];else{const i=e&4294967295,t=Math.floor(e/4294967296)&4294967295;n=[255,i&255,i>>8&255,i>>16&255,i>>24&255,t&255,t>>8&255,t>>16&255,t>>24&255]}return n}static varIntBn(e){let n;if(e.isNeg()&&(e=e.add(Kl)),e.ltn(253))n=[e.toNumber()];else if(e.ltn(65536)){const i=e.toNumber();n=[253,i&255,i>>8&255]}else if(e.lt(new g(4294967296))){const i=e.toNumber();n=[254,i&255,i>>8&255,i>>16&255,i>>24&255]}else{const i=new Ae;i.writeUInt8(255),i.writeUInt64LEBn(e),n=i.toArray()}return n}}class Jg{bin;pos;length;constructor(e=[],n=0){this.bin=e,this.pos=n,this.length=e.length}eof(){return this.pos>=this.length}read(e=this.length){const n=this.pos,i=this.pos+e;return this.pos=i,this.bin.slice(n,i)}readReverse(e=this.length){const n=new Array(e);for(let i=0;i<e;i++)n[i]=this.bin[this.pos+e-1-i];return this.pos+=e,n}readUInt8(){const e=this.bin[this.pos];return this.pos+=1,e}readInt8(){const e=this.bin[this.pos];return this.pos+=1,(e&128)===0?e:e-256}readUInt16BE(){const e=this.bin[this.pos]<<8|this.bin[this.pos+1];return this.pos+=2,e}readInt16BE(){const e=this.readUInt16BE();return(e&32768)===0?e:e-65536}readUInt16LE(){const e=this.bin[this.pos]|this.bin[this.pos+1]<<8;return this.pos+=2,e}readInt16LE(){const e=this.readUInt16LE();return(e&32768)===0?e:e-65536}readUInt32BE(){const e=this.bin[this.pos]*16777216+(this.bin[this.pos+1]<<16|this.bin[this.pos+2]<<8|this.bin[this.pos+3]);return this.pos+=4,e}readInt32BE(){const e=this.readUInt32BE();return(e&2147483648)===0?e:e-4294967296}readUInt32LE(){const e=(this.bin[this.pos]|this.bin[this.pos+1]<<8|this.bin[this.pos+2]<<16|this.bin[this.pos+3]<<24)>>>0;return this.pos+=4,e}readInt32LE(){const e=this.readUInt32LE();return(e&2147483648)===0?e:e-4294967296}readUInt64BEBn(){const e=this.bin.slice(this.pos,this.pos+8),n=new g(e);return this.pos=this.pos+8,n}readUInt64LEBn(){const e=this.readReverse(8);return new g(e)}readInt64LEBn(){const e=this.readReverse(8);let n=new g(e);return n.gte(Wg)&&(n=n.sub(Kl)),n}readVarIntNum(e=!0){const n=this.readUInt8();let i;switch(n){case 253:return this.readUInt16LE();case 254:return this.readUInt32LE();case 255:if(i=e?this.readInt64LEBn():this.readUInt64LEBn(),i.lte(new g(2).pow(new g(53))))return i.toNumber();throw new Error("number too large to retain precision - use readVarIntBn");default:return n}}readVarInt(){switch(this.bin[this.pos]){case 253:return this.read(3);case 254:return this.read(5);case 255:return this.read(9);default:return this.read(1)}}readVarIntBn(){const e=this.readUInt8();switch(e){case 253:return new g(this.readUInt16LE());case 254:return new g(this.readUInt32LE());case 255:return this.readUInt64LEBn();default:return new g(e)}}}const fu=r=>{if(r.length===0)return r;const e=r.at(-1);if((e&127)!==0)return r;if(r.length===1)return[];if((r.at(-2)&128)!==0)return r;for(let n=r.length-1;n>0;n--)if(r[n-1]!==0)return(r[n-1]&128)===0?(r[n-1]|=e,r.slice(0,n)):(r[n]=e,r.slice(0,n+1));return[]},Wg=new g(2).pow(new g(63)),Kl=new g(2).pow(new g(64));function ri(r,e="Expected a valid value, but got undefined or null."){if(r==null)throw new Error(e);return r}function hu(r,e,n){const i=-r,t=(e.X^n.X)&i,o=(e.Y^n.Y)&i,s=(e.Z^n.Z)&i;e.X^=t,n.X^=t,e.Y^=o,n.Y^=o,e.Z^=s,n.Z^=s}const ce=0n,$e=1n,Zo=2n,Xg=3n,Yg=4n,Qg=8n,et=0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2fn,Ut=0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n,pu=(1n<<256n)-1n;function as(r){let e=r>>256n;return r=(r&pu)+(e<<32n)+e*977n,e=r>>256n,r=(r&pu)+(e<<32n)+e*977n,r>=et&&(r-=et),r}const Ot=r=>as((r%et+et)%et),Ye=(r,e)=>r>=e?r-e:et-(e-r),N=(r,e)=>as(r*e),mu=(r,e)=>as(r+e),zn=r=>{let e=$e,n=ce,i=Ot(r),t=et;for(;i>$e;){const o=t/i;[e,n]=[n-e*o,e],[i,t]=[t-i*o,i]}return Ot(e)},e0=r=>N(r,r),t0=(r,e)=>{let n=1n;for(r=Ot(r);e>0n;)(e&1n)!==0n&&(n=N(n,r)),r=N(r,r),e>>=1n;return n},n0=et+1n>>2n,r0=r=>{const e=t0(r,n0);return N(e,e)!==Ot(r)?null:e},i0=r=>g.isBN(r)?BigInt("0x"+r.toString(16)):typeof r=="string"?BigInt("0x"+r):Array.isArray(r)?BigInt("0x"+G(r)):BigInt(r),qo=BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Vo=BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"),gu=new Map,Dn=r=>{const{X:e,Y:n,Z:i}=r;if(n===ce)return{X:ce,Y:$e,Z:ce};const t=N(n,n),o=N(Yg,N(e,t)),s=N(Xg,N(e,e)),a=Ye(N(s,s),N(Zo,o)),c=Ye(N(s,Ye(o,a)),N(Qg,N(t,t))),u=N(Zo,N(n,i));return{X:a,Y:c,Z:u}},Rn=(r,e)=>{if(r.Z===ce)return e;if(e.Z===ce)return r;const n=N(r.Z,r.Z),i=N(e.Z,e.Z),t=N(r.X,i),o=N(e.X,n),s=N(r.Y,N(i,e.Z)),a=N(e.Y,N(n,r.Z)),c=Ye(o,t),u=Ye(a,s);if(c===ce)return u===ce?Dn(r):{X:ce,Y:$e,Z:ce};const l=N(c,c),f=N(c,l),d=N(t,l),h=Ye(Ye(N(u,u),f),N(Zo,d)),p=Ye(N(u,Ye(d,h)),N(s,f)),_=N(c,N(r.Z,e.Z));return{X:h,Y:p,Z:_}},o0=r=>r.Z===ce?r:{X:r.X,Y:et-r.Y,Z:r.Z},Go=(r,e,n=5)=>{const i=`${n}:${e.x.toString(16)}:${e.y.toString(16)}`;let t=gu.get(i);if(t===void 0){const l=1<<n-1;t=new Array(l);const f={X:e.x,Y:e.y,Z:$e};t[0]=f;const d=Dn(f);for(let h=1;h<l;h++)t[h]=Rn(t[h-1],d);gu.set(i,t)}const o=[],s=1n<<BigInt(n),a=s>>1n;let c=r;for(;c>0n;)if((c&$e)===ce)o.push(0),c>>=$e;else{let l=c&s-1n;l>a&&(l-=s),o.push(Number(l)),c-=l,c>>=$e}let u={X:ce,Y:$e,Z:ce};for(let l=o.length-1;l>=0;l--){u=Dn(u);const f=o[l];if(f!==0){const d=Math.abs(f)>>1,h=f>0?t[d]:o0(t[d]);u=Rn(u,h)}}return u},Yt=r=>{let e=r%Ut;return e<0n&&(e+=Ut),e},ii=(r,e)=>Yt(r*e),Jl=r=>{let e=1n,n=0n,i=Yt(r),t=Ut;for(;i>1n;){const o=t/i;[e,n]=[n-e*o,e],[i,t]=[t-i*o,i]}return Yt(e)};class B extends yl{x;y;inf;static _assertOnCurve(e){if(!e.validate())throw new Error("Invalid point");return e}static fromDER(e){if((e[0]===4||e[0]===6||e[0]===7)&&e.length-1===64){if(e[0]===6){if(e.at(-1)%2!==0)throw new Error("Point string value is wrong length")}else if(e[0]===7&&e.at(-1)%2!==1)throw new Error("Point string value is wrong length");const i=new B(e.slice(1,33),e.slice(33,65));return B._assertOnCurve(i)}else if((e[0]===2||e[0]===3)&&e.length-1===32)return B._assertOnCurve(B.fromX(e.slice(1,33),e[0]===3));throw new Error("Unknown point format")}static fromString(e){const n=ee(e,"hex");return B._assertOnCurve(B.fromDER(n))}static fromX(e,n){let i=i0(e);i=Ot(i);const t=mu(N(e0(i),i),7n),o=r0(t);if(o===null)throw new Error("Invalid point");let s=o;(s&$e)!==(n?$e:ce)&&(s=Ye(et,s));const a=new g(i.toString(16),16),c=new g(s.toString(16),16);return B._assertOnCurve(new B(a,c))}static fromJSON(e,n){typeof e=="string"&&(e=JSON.parse(e));let i=new B(e[0],e[1],n);if(i=B._assertOnCurve(i),typeof e[2]!="object"||e[2]===null)return i;const t=e[2],o=s=>{const a=new B(s[0],s[1],n);return B._assertOnCurve(a)};return i.precomputed={beta:null,doubles:typeof t.doubles=="object"&&t.doubles!==null?{step:t.doubles.step,points:[i].concat(t.doubles.points.map(o))}:void 0,naf:typeof t.naf=="object"&&t.naf!==null?{wnd:t.naf.wnd,points:[i].concat(t.naf.points.map(o))}:void 0},i}constructor(e,n,i=!0){super("affine"),this.precomputed=null,e===null&&n===null?(this.x=null,this.y=null,this.inf=!0):(g.isBN(e)||(e=new g(e,16)),this.x=e,g.isBN(n)||(n=new g(n,16)),this.y=n,i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red===null&&(this.x=this.x.toRed(this.curve.red)),this.y.red===null&&(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}validate(){if(this.inf||this.x==null||this.y==null)return!1;try{const e=BigInt("0x"+this.x.fromRed().toString(16)),n=BigInt("0x"+this.y.fromRed().toString(16)),i=N(n,n),t=mu(N(N(e,e),e),7n);return i===t}catch{return!1}}encode(e=!0,n){if(this.inf)return n==="hex"?"00":[0];const i=this.curve.p.byteLength(),t=this.getX().toArray("be",i);let o;return e?o=[this.getY().isEven()?2:3].concat(t):o=[4].concat(t,this.getY().toArray("be",i)),n==="hex"?G(o):o}toString(){return this.encode(!0,"hex")}toJSON(){return this.precomputed==null?[this.x,this.y]:[this.x,this.y,typeof this.precomputed=="object"&&this.precomputed!==null?{doubles:this.precomputed.doubles==null?void 0:{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf==null?void 0:{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}:void 0]}inspect(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+(this.x?.fromRed()?.toString(16,2)??"undefined")+" y: "+(this.y?.fromRed()?.toString(16,2)??"undefined")+">"}isInfinity(){return this.inf}add(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return new B(null,null);if(this.x?.cmp(e.x??new g(0))===0)return new B(null,null);const n={X:BigInt("0x"+this.x.fromRed().toString(16)),Y:BigInt("0x"+this.y.fromRed().toString(16)),Z:$e},i={X:BigInt("0x"+e.x.fromRed().toString(16)),Y:BigInt("0x"+e.y.fromRed().toString(16)),Z:$e},t=Rn(n,i);if(t.Z===ce)return new B(null,null);const o=zn(t.Z),s=N(o,o),a=N(t.X,s),c=N(t.Y,N(s,o));return new B(a.toString(16),c.toString(16))}dbl(){if(this.inf)return this;if(this.x===null||this.y===null)throw new Error("Point coordinates cannot be null");const e=BigInt("0x"+this.x.fromRed().toString(16)),n=BigInt("0x"+this.y.fromRed().toString(16));if(n===ce)return new B(null,null);const i=Dn({X:e,Y:n,Z:$e}),t=zn(i.Z),o=N(t,t),s=N(i.X,o),a=N(i.Y,N(o,t));return new B(s.toString(16),a.toString(16))}getX(){return(this.x??new g(0)).fromRed()}getY(){return(this.y??new g(0)).fromRed()}mul(e){if(g.isBN(e)||(e=new g(e,16)),e=e,this.inf)return this;const n=e.isNeg(),i=n?e.neg():e;let t=BigInt("0x"+i.toString(16));if(t=Ot(t),t===ce)return new B(null,null);if(t===ce)return new B(null,null);if(this.x===null||this.y===null)throw new Error("Point coordinates cannot be null");let o,s;this===this.curve.g?(o=qo,s=Vo):(o=BigInt("0x"+this.x.fromRed().toString(16)),s=BigInt("0x"+this.y.fromRed().toString(16)));const a=Go(t,{x:o,y:s});if(a.Z===ce)return new B(null,null);const c=zn(a.Z),u=N(c,c),l=N(a.X,u),f=N(a.Y,N(u,c)),d=new g(l.toString(16),16),h=new g(f.toString(16),16),p=new B(d,h);return n?p.neg():p}mulCT(e){if(g.isBN(e)||(e=new g(e,16)),e=e,this.inf)return new B(null,null);const n=e.isNeg(),i=n?e.neg():e;let t=BigInt("0x"+i.toString(16));if(t=Ot(t),t===0n)return new B(null,null);const o=this===this.curve.g?qo:BigInt("0x"+this.getX().toString(16)),s=this===this.curve.g?Vo:BigInt("0x"+this.getY().toString(16));let a={X:0n,Y:1n,Z:0n},c={X:o,Y:s,Z:1n};const u=t.toString(2);for(const _ of u){const w=_==="1"?1n:0n;hu(w,a,c),c=Rn(a,c),a=Dn(a),hu(w,a,c)}if(a.Z===0n)return new B(null,null);const l=zn(a.Z),f=N(l,l),d=N(a.X,f),h=N(a.Y,N(f,l)),p=new B(d.toString(16),h.toString(16));return n?p.neg():p}mulAdd(e,n,i){const t=[this,n],o=[e,i];return this._endoWnafMulAdd(t,o)}jmulAdd(e,n,i){const t=[this,n],o=[e,i];return this._endoWnafMulAdd(t,o,!0)}eq(e){return this===e||this.inf===e.inf&&(this.inf||(this.x??new g(0)).cmp(e.x??new g(0))===0&&(this.y??new g(0)).cmp(e.y??new g(0))===0)}neg(e){if(this.inf)return this;const n=new B(this.x,(this.y??new g(0)).redNeg());if(e===!0&&this.precomputed!=null){const i=this.precomputed,t=o=>o.neg();n.precomputed={naf:i.naf==null?void 0:{wnd:i.naf.wnd,points:i.naf.points.map(t)},doubles:i.doubles==null?void 0:{step:i.doubles.step,points:i.doubles.points.map(o=>o.neg())},beta:void 0}}return n}dblp(e){let n=this;for(let i=0;i<e;i++)n=n.dbl();return n}toJ(){return this.inf?new Fe(null,null,null):new Fe(this.x,this.y,this.curve.one)}_getBeta(){if(typeof this.curve.endo!="object")return;const e=this.precomputed;if(typeof e=="object"&&e!==null&&typeof e.beta=="object"&&e.beta!==null)return e.beta;const n=new B((this.x??new g(0)).redMul(this.curve.endo.beta),this.y);if(e!=null){const i=this.curve,t=o=>{if(o.x===null)throw new Error("p.x is null");if(i.endo===void 0||i.endo===null)throw new Error("curve.endo is undefined");return new B(o.x.redMul(i.endo.beta),o.y)};e.beta=n,n.precomputed={beta:null,naf:e.naf==null?void 0:{wnd:e.naf.wnd,points:e.naf.points.map(t)},doubles:e.doubles==null?void 0:{step:e.doubles.step,points:e.doubles.points.map(t)}}}return n}_fixedNafMul(e){if(typeof this.precomputed!="object"||this.precomputed===null)throw new Error("_fixedNafMul requires precomputed values for the point");const n=this._getDoubles(),i=this.curve.getNAF(e,1,this.curve._bitLength);let t=(1<<n.step+1)-(n.step%2===0?2:1);t/=3;const o=[];for(let c=0;c<i.length;c+=n.step){let u=0;for(let l=c+n.step-1;l>=c;l--)u=(u<<1)+i[l];o.push(u)}let s=new Fe(null,null,null),a=new Fe(null,null,null);for(let c=t;c>0;c--){for(let u=0;u<o.length;u++){const l=o[u];l===c?a=a.mixedAdd(n.points[u]):l===-c&&(a=a.mixedAdd(n.points[u].neg()))}s=s.add(a)}return s.toP()}_wnafMulAdd(e,n,i,t,o){const s=this.curve._wnafT1.map(d=>d.toNumber()),a=this.curve._wnafT2.map(()=>[]),c=this.curve._wnafT3.map(()=>[]);let u=0;for(let d=0;d<t;d++){const p=n[d]._getNAFPoints(e);s[d]=p.wnd,a[d]=p.points}for(let d=t-1;d>=1;d-=2){const h=d-1,p=d;if(s[h]!==1||s[p]!==1){c[h]=this.curve.getNAF(i[h],s[h],this.curve._bitLength),c[p]=this.curve.getNAF(i[p],s[p],this.curve._bitLength),u=Math.max(c[h].length,u),u=Math.max(c[p].length,u);continue}const _=[n[h],null,null,n[p]];(n[h].y??new g(0)).cmp(n[p].y??new g(0))===0?(_[1]=n[h].add(n[p]),_[2]=n[h].toJ().mixedAdd(n[p].neg())):(n[h].y??new g(0)).cmp((n[p].y??new g(0)).redNeg())===0?(_[1]=n[h].toJ().mixedAdd(n[p]),_[2]=n[h].add(n[p].neg())):(_[1]=n[h].toJ().mixedAdd(n[p]),_[2]=n[h].toJ().mixedAdd(n[p].neg()));const w=[-3,-1,-5,-7,0,7,5,1,3],O=this.curve.getJSF(i[h],i[p]);u=Math.max(O[0].length,u),c[h]=new Array(u),c[p]=new Array(u);for(let $=0;$<u;$++){const k=Math.trunc(O[0][$]),z=Math.trunc(O[1][$]);c[h][$]=w[(k+1)*3+(z+1)],c[p][$]=0,a[h]=_}}let l=new Fe(null,null,null);const f=this.curve._wnafT4;for(let d=u;d>=0;d--){let h=0;for(;d>=0;){let w=!0;for(let O=0;O<t;O++)f[O]=new g(typeof c[O][d]=="number"?c[O][d]:0),f[O].isZero()||(w=!1);if(!w)break;h++,d--}if(d>=0&&h++,l=l.dblp(h),d<0)break;const p=new g(1),_=new g(2);for(let w=0;w<t;w++){const O=f[w];let $;O.cmpn(0)!==0&&(O.isNeg()?$=a[w][O.neg().sub(p).div(_).toNumber()].neg():$=a[w][O.sub(p).div(_).toNumber()],$.type==="affine"?l=l.mixedAdd($):l=l.add($))}}for(let d=0;d<t;d++)a[d]=[];return o===!0?l:l.toP()}_endoWnafMulAdd(e,n,i){const t=new Array(e.length*2),o=new Array(e.length*2);let s;for(s=0;s<e.length;s++){const c=this.curve._endoSplit(n[s]);let u=e[s],l=u._getBeta()??new B(null,null);c.k1.negative!==0&&(c.k1.ineg(),u=u.neg(!0)),c.k2.negative!==0&&(c.k2.ineg(),l=l.neg(!0)),t[s*2]=u,t[s*2+1]=l,o[s*2]=c.k1,o[s*2+1]=c.k2}const a=this._wnafMulAdd(1,t,o,s*2,i);for(let c=0;c<s*2;c++)t[c]=null,o[c]=null;return a}_hasDoubles(e){if(this.precomputed==null)return!1;const n=this.precomputed.doubles;return typeof n!="object"?!1:n.points.length>=Math.ceil((e.bitLength()+1)/n.step)}_getDoubles(e,n){if(typeof this.precomputed=="object"&&this.precomputed!==null&&typeof this.precomputed.doubles=="object"&&this.precomputed.doubles!==null)return this.precomputed.doubles;const i=[this];let t=this;for(let o=0;o<(n??0);o+=e??1){for(let s=0;s<(e??1);s++)t=t.dbl();i.push(t)}return{step:e??1,points:i}}_getNAFPoints(e){if(typeof this.precomputed=="object"&&this.precomputed!==null&&typeof this.precomputed.naf=="object"&&this.precomputed.naf!==null)return this.precomputed.naf;const n=[this],i=(1<<e)-1,t=i===1?null:this.dbl();for(let o=1;o<i;o++)t!==null&&(n[o]=n[o-1].add(t));return{wnd:e,points:n}}}let Ao;class Ie{p;red;redN;zero;one;two;g;n;a;b;tinv;zeroA;threeA;endo;_endoWnafT1;_endoWnafT2;_wnafT1;_wnafT2;_wnafT3;_wnafT4;_bitLength;static assert(e,n="Elliptic curve assertion failed"){if(!e)throw new Error(n)}getNAF(e,n,i){const t=new Array(Math.max(e.bitLength(),i)+1);t.fill(0);const o=1<<n+1,s=e.clone();for(let a=0;a<t.length;a++){let c;const u=s.andln(o-1);s.isOdd()?(u>(o>>1)-1?c=(o>>1)-u:c=u,s.isubn(c)):c=0,t[a]=c,s.iushrn(1)}return t}getJSF(e,n){const i=[[],[]];e=e.clone(),n=n.clone();let t=0,o=0;for(;e.cmpn(-t)>0||n.cmpn(-o)>0;){let s=e.andln(3)+t&3,a=n.andln(3)+o&3;s===3&&(s=-1),a===3&&(a=-1);let c;if((s&1)===0)c=0;else{const l=e.andln(7)+t&7;(l===3||l===5)&&a===2?c=-s:c=s}i[0].push(c);let u;if((a&1)===0)u=0;else{const l=n.andln(7)+o&7;(l===3||l===5)&&s===2?u=-a:u=a}i[1].push(u),2*t===c+1&&(t=1-t),2*o===u+1&&(o=1-o),e.iushrn(1),n.iushrn(1)}return i}static cachedProperty(e,n,i){const t="_"+n;e.prototype[n]=function(){return this[t]===void 0&&(this[t]=i.call(this)),this[t]}}static parseBytes(e){return typeof e=="string"?ee(e,"hex"):e}static intFromLE(e){return new g(e,"hex","le")}constructor(){if(Ao===void 0)Ao=this;else return Ao;const n={prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",{doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}]};this.p=new g(n.p,16),this.red=new vl(n.prime),this.zero=new g(0).toRed(this.red),this.one=new g(1).toRed(this.red),this.two=new g(2).toRed(this.red),this.n=new g(n.n,16),this.g=B.fromJSON(n.g,n.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n.bitLength(),this.redN=this.n.toRed(this.red),this.a=new g(n.a,16).toRed(this.red),this.b=new g(n.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(n),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}_getEndomorphism(e){if(!this.zeroA||this.p.modrn(3)!==1)return;let n,i;if(e.beta===void 0){const o=this._getEndoRoots(this.p);if(o===null)throw new Error("Failed to get endomorphism roots for beta.");n=o[0].cmp(o[1])<0?o[0]:o[1],n=n.toRed(this.red)}else n=new g(e.beta,16).toRed(this.red);if(e.lambda===void 0){const o=this._getEndoRoots(this.n);if(o===null)throw new Error("Failed to get endomorphism roots for lambda.");if(this.g==null)throw new Error("Curve generator point (g) is not defined.");const s=this.g.mul(o[0])?.x,a=this.g.x==null?void 0:this.g.x.redMul(n);if(s!=null&&a!=null&&s.cmp(a)===0)i=o[0];else{if(i=o[1],this.g==null)throw new Error("Curve generator point (g) is not defined.");const c=this.g.mul(i)?.x,u=this.g.x==null?void 0:this.g.x.redMul(n);if(c==null||u==null)throw new Error("Lambda computation failed: g.mul(lambda).x or g.x.redMul(beta) is undefined.");Ie.assert(c.cmp(u)===0,"Lambda selection does not match computed beta.")}}else i=new g(e.lambda,16);let t;return typeof e.basis=="object"&&e.basis!==null?t=e.basis.map(function(o){return{a:new g(o.a,16),b:new g(o.b,16)}}):t=this._getEndoBasis(i),{beta:n,lambda:i,basis:t}}_getEndoRoots(e){const n=e===this.p?this.red:new Km(e),i=new g(2).toRed(n).redInvm(),t=i.redNeg(),o=new g(3).toRed(n).redNeg().redSqrt().redMul(i),s=t.redAdd(o).fromRed(),a=t.redSub(o).fromRed();return[s,a]}_getEndoBasis(e){const n=this.n.ushrn(Math.floor(this.n.bitLength()/2));let i=e,t=this.n.clone(),o=new g(1),s=new g(0),a=new g(0),c=new g(1),u,l,f,d,h,p,_=new g(0),w=0,O=new g(0),$=new g(0);for(;i.cmpn(0)!==0;){const A=t.div(i);O=t.sub(A.mul(i)),$=a.sub(A.mul(o));const J=c.sub(A.mul(s));if(f===void 0&&O.cmp(n)<0)u=_.neg(),l=o,f=O.neg(),d=$;else if(f!==void 0&&++w===2)break;_=O,t=i,i=O,a=o,o=$,c=s,s=J}if(u===void 0||l===void 0||f===void 0||d===void 0)throw new Error("Failed to compute Endo Basis values");h=O.neg(),p=$;const k=f.sqr().add(d.sqr());return h.sqr().add(p.sqr()).cmp(k)>=0&&(h=u,p=l),f.negative!==0&&(f=f.neg(),d=d.neg()),h.negative!==0&&(h=h.neg(),p=p.neg()),[{a:f,b:d},{a:h,b:p}]}_endoSplit(e){if(this.endo==null)throw new Error("Endomorphism is not defined.");const n=this.endo.basis,i=n[0],t=n[1],o=t.b.mul(e).divRound(this.n),s=i.b.neg().mul(e).divRound(this.n),a=o.mul(i.a),c=s.mul(t.a),u=o.mul(i.b),l=s.mul(t.b),f=e.sub(a).sub(c),d=u.add(l).neg();return{k1:f,k2:d}}validate(e){if(e.inf)return!0;const n=e.x,i=e.y;if(n===null||i===null)throw new Error("Point coordinates cannot be null");const t=this.a.redMul(n),o=n.redSqr().redMul(n).redIAdd(t).redIAdd(this.b);return i.redSqr().redISub(o).cmpn(0)===0}}class mt{r;s;static fromDER(e,n){const i=(f,d)=>{const h=f[d.place++];if((h&128)===0)return h;throw new Error("Invalid DER entity length")};class t{place;constructor(){this.place=0}}e=ee(e,n);const o=new t;if(e[o.place++]!==48)throw new Error("Signature DER must start with 0x30");if(i(e,o)+o.place!==e.length)throw new Error("Signature DER invalid");if(e[o.place++]!==2)throw new Error("Signature DER invalid");const a=i(e,o);let c=e.slice(o.place,a+o.place);if(o.place+=a,e[o.place++]!==2)throw new Error("Signature DER invalid");const u=i(e,o);if(e.length!==u+o.place)throw new Error("Invalid R-length in signature DER");let l=e.slice(o.place,u+o.place);if(c[0]===0){if((c[1]&128)===0)throw new Error("Invalid R-value in signature DER");c=c.slice(1)}if(l[0]===0){if((l[1]&128)===0)throw new Error("Invalid S-value in signature DER");l=l.slice(1)}return new mt(new g(c),new g(l))}static fromCompact(e,n){if(e=ee(e,n),e.length!==65)throw new Error("Invalid Compact Signature");const i=e[0];if(i<27||i>=35)throw new Error("Invalid Compact Byte");return new mt(new g(e.slice(1,33)),new g(e.slice(33,65)))}constructor(e,n){this.r=e,this.s=n}verify(e,n,i){const t=new g(Nt(e,i),16);return gi(t,this,n)}toString(e){return this.toDER(e)}toDER(e){const n=(u,l)=>{if(l<128)u.push(l);else throw new Error("len must be < 0x80")},i=u=>{let l=0;const f=u.length-1;for(;u[l]===0&&(u[l+1]&128)===0&&l<f;)l++;return l===0?u:u.slice(l)};let t=this.r.toArray(),o=this.s.toArray();for((t[0]&128)!==0&&(t=[0].concat(t)),(o[0]&128)!==0&&(o=[0].concat(o)),t=i(t),o=i(o);o[0]===0&&(o[1]&128)===0;)o=o.slice(1);let s=[2];n(s,t.length),s=s.concat(t),s.push(2),n(s,o.length);const a=s.concat(o);let c=[48];return n(c,a.length),c=c.concat(a),e==="hex"?G(c):e==="base64"?du(c):c}toCompact(e,n,i){if(e<0||e>3)throw new Error("Invalid recovery param");if(typeof n!="boolean")throw new TypeError("Invalid compressed param");let t=27+e;n&&(t+=4);let o=[t];return o=o.concat(this.r.toArray("be",32)),o=o.concat(this.s.toArray("be",32)),i==="hex"?G(o):i==="base64"?du(o):o}RecoverPublicKey(e,n){const i=this.r,t=this.s,o=(e&1)!==0,s=e>>1,a=new Ie,c=a.n,u=a.g,l=s===0?i:i.add(c),f=B.fromX(l,o);if(!f.mul(c).isInfinity())throw new Error("nR is not at infinity");const h=n.neg().umod(c),p=i.invm(c),_=p.mul(t).umod(c),w=p.mul(h).umod(c),O=u.mul(w).add(f.mul(_)),$=new Ke(O);return $.validate(),$}CalculateRecoveryFactor(e,n){for(let i=0;i<4;i++){let t;try{t=this.RecoverPublicKey(i,n)}catch{continue}if(e.eq(t))return i}throw new Error("Unable to find valid recovery factor")}}class s0{K;V;constructor(e,n){const i=ee(e,"hex"),t=ee(n,"hex");if(i.length!==32)throw new Error("Entropy must be exactly 32 bytes (256 bits)");if(t.length!==32)throw new Error("Nonce must be exactly 32 bytes (256 bits)");const o=i.concat(t);this.K=new Array(32),this.V=new Array(32);for(let s=0;s<32;s++)this.K[s]=0,this.V[s]=1;this.update(o)}hmac(){return new Ul(this.K)}update(e){let n=this.hmac().update(this.V).update([0]);e!==void 0&&(n=n.update(e)),this.K=n.digest(),this.V=this.hmac().update(this.V).digest(),e!==void 0&&(this.K=this.hmac().update(this.V).update([1]).update(e).digest(),this.V=this.hmac().update(this.V).digest())}generate(e){let n=[];for(;n.length<e;)this.V=this.hmac().update(this.V).digest(),n=n.concat(this.V);const i=n.slice(0,e);return this.update(),G(i)}}function bu(r,e,n=new Ie){const i=r.byteLength()*8-n.n.bitLength();return i>0&&r.iushrn(i),e!==!0&&r.cmp(n.n)>=0?r.sub(n.n):r}function St(r){const e=r.toArray("be");let n=0n;for(const i of e)n=n<<8n|BigInt(i);return n}const Cn=new Ie,No=Cn.n.byteLength(),a0=Cn.n.subn(1),c0=Ut>>1n,u0=(r,e,n=!1,i)=>{const t=Cn.n.bitLength();if(r.bitLength()>t)throw new Error(`ECDSA message is too large: expected <= ${t} bits. Callers must hash messages before signing.`);r=bu(r);const o=St(r),s=St(e),a=e.toArray("be",No),c=r.toArray("be",No),u=new s0(a,c);for(let l=0;;l++){let f;if(typeof i=="function"?f=i(l):g.isBN(i)?f=i:f=new g(u.generate(No),16),f==null)throw new Error("k is undefined");if(f=bu(f,!0),f.cmpn(1)<0||f.cmp(a0)>0){if(g.isBN(i))throw new Error("Invalid fixed custom K value (must be >1 and <N-1)");continue}const d=Cn.g.mulCT(f);if(d.isInfinity()){if(g.isBN(i))throw new Error("Invalid fixed custom K value (k·G at infinity)");continue}const h=BigInt("0x"+d.getX().toString(16)),p=Yt(h);if(p===0n){if(g.isBN(i))throw new Error("Invalid fixed custom K value (r == 0)");continue}const _=BigInt("0x"+f.toString(16)),w=Jl(_),O=ii(p,s),$=Yt(o+O);let k=ii(w,$);if(k===0n){if(g.isBN(i))throw new Error("Invalid fixed custom K value (s == 0)");continue}n&&k>c0&&(k=Ut-k);const z=new g(p.toString(16),16),A=new g(k.toString(16),16);return new mt(z,A)}},gi=(r,e,n)=>{const i=Cn.n.bitLength();if(r.bitLength()>i)return!1;const t=St(r);if(n.x==null||n.y==null)throw new Error("Invalid public key: missing coordinates.");const o={x:St(n.x),y:St(n.y)},s={r:St(e.r),s:St(e.s)},{r:a,s:c}=s,u=t;if(a<=ce||a>=Ut||c<=ce||c>=Ut)return!1;const l=Jl(c);if(l===0n)return!1;const f=ii(u,l),d=ii(a,l),h=Go(f,{x:qo,y:Vo}),p=Go(d,o),_=Rn(h,p);if(_.Z===0n)return!1;const w=zn(_.Z),O=N(w,w),$=N(_.X,O);return Yt($)===a};class Ke extends B{static fromPrivateKey(e){const i=new Ie().g.mul(e);return new Ke(i.x,i.y)}static fromString(e){const n=B.fromString(e);return new Ke(n.x,n.y)}static fromDER(e){const n=B.fromDER(e);return new Ke(n.x,n.y)}constructor(e,n=null,i=!0){if(e instanceof B)super(e.getX(),e.getY());else{if(n===null&&i&&typeof e=="string"&&(e.length===66||e.length===130))throw new Error('You are using the "new PublicKey()" constructor with a DER hex string. You need to use "PublicKey.fromString()" instead.');super(e,n,i)}}deriveSharedSecret(e){if(!this.validate())throw new Error("Public key not valid for ECDH secret derivation");return this.mulCT(e)}verify(e,n,i){const t=new g(Nt(e,i),16);return gi(t,n,this)}toDER(e){return e==="hex"?this.encode(!0,e):this.encode(!0)}toHash(e){const n=Rl(this.encode(!0));return e==="hex"?G(n):n}toAddress(e=[0]){if(typeof e=="string")if(e==="testnet"||e==="test")e=[111];else if(e==="mainnet"||e==="main")e=[0];else throw new Error(`Invalid prefix ${e}`);return Vl(this.toHash(),e)}deriveChild(e,n,i,t){let o;if(typeof t=="function"){const f=t(e,this);f===void 0?(o=this.deriveSharedSecret(e),typeof i=="function"&&i(e,this,o)):o=f}else o=this.deriveSharedSecret(e);const s=ee(n,"utf8"),a=Cl(o.encode(!0),s),u=new Ie().g.mul(new g(a)),l=this.add(u);return new Ke(l.x,l.y)}static fromMsgHashAndCompactSignature(e,n,i){const t=ee(n,i);if(t.length!==65)throw new Error("Invalid Compact Signature");const o=t[0];if(o<27||o>=35)throw new Error("Invalid Compact Byte");let s=t[0]-27;return s>3&&(s-=4),new mt(new g(t.slice(1,33)),new g(t.slice(33,65))).RecoverPublicKey(s,e)}}class l0{_rand;getRandomValues(e,n){const i=new Uint8Array(n);return e.crypto.getRandomValues(i),Array.from(i)}constructor(){const e=()=>{throw new Error("No secure random number generator is available in this environment.")};if(this._rand=e,typeof globalThis<"u"&&typeof globalThis.crypto?.getRandomValues=="function"){this._rand=n=>this.getRandomValues(globalThis,n);return}if(typeof process<"u"&&process.release?.name==="node")try{const n=require("node:crypto");if(typeof n.randomBytes=="function"){this._rand=i=>Array.from(n.randomBytes(i));return}}catch{}if(typeof globalThis.self<"u"&&typeof globalThis.self.crypto?.getRandomValues=="function"){this._rand=n=>this.getRandomValues(globalThis.self,n);return}if(typeof globalThis.window<"u"&&typeof globalThis.window.crypto?.getRandomValues=="function"){this._rand=n=>this.getRandomValues(globalThis.window,n);return}this._rand=e}generate(e){return this._rand(e)}}let vu=null;const Pt=r=>(vu??=new l0,vu.generate(r));class Qt{x;y;constructor(e,n){const i=new Ie().p;this.x=e.umod(i),this.y=n.umod(i)}toString(){return Ho(this.x.toArray())+"."+Ho(this.y.toArray())}static fromString(e){const[n,i]=e.split(".");return new Qt(new g(Fo(n)),new g(Fo(i)))}}class oi{points;threshold;constructor(e,n){this.points=e,this.threshold=n??e.length}static fromPrivateKey(e,n){const i=new Ie().p,t=[new Qt(new g(0),new g(e.toArray()))];for(let o=1;o<n;o++){const s=new g(Pt(32)).umod(i),a=new g(Pt(32)).umod(i);t.push(new Qt(s,a))}return new oi(t)}valueAt(e){const n=new Ie().p;let i=new g(0);for(let t=0;t<this.threshold;t++){let o=this.points[t].y;for(let s=0;s<this.threshold;s++)if(t!==s){const a=this.points[s].x,c=this.points[t].x,u=e.sub(a).umod(n),f=c.sub(a).umod(n).invm(n),d=u.mul(f).umod(n);o=o.mul(d).umod(n)}i=i.add(o).umod(n)}return i}}class si{points;threshold;integrity;constructor(e,n,i){this.points=e,this.threshold=n,this.integrity=i}static fromBackupFormat(e){let n=0,i="";const t=e.map((o,s)=>{const a=o.split(".");if(a.length!==4)throw new Error("Invalid share format in share "+s.toString()+'. Expected format: "x.y.t.i" - received '+o);const[c,u,l,f]=a;if(l===void 0)throw new Error("Threshold not found in share "+s.toString());if(f===void 0)throw new Error("Integrity not found in share "+s.toString());const d=Number.parseInt(l,10);if(s!==0&&n!==d)throw new Error("Threshold mismatch in share "+s.toString());if(s!==0&&i!==f)throw new Error("Integrity mismatch in share "+s.toString());return n=d,i=f,Qt.fromString([c,u].join("."))});return new si(t,n,i)}toBackupFormat(){return this.points.map(e=>e.toString()+"."+this.threshold.toString()+"."+this.integrity)}}class Xe extends g{static fromRandom(){return new Xe(Pt(32))}static fromString(e,n="hex"){return new Xe(super.fromString(e,n).toArray())}static fromHex(e){return new Xe(super.fromHex(e,"big"))}static fromWif(e,n=1){const i=Gl(e,void 0,n);if(i.data.length!==33)throw new Error("Invalid WIF length");if(i.data[32]!==1)throw new Error("Invalid WIF padding");return new Xe(i.data.slice(0,32))}constructor(e=0,n=10,i="be",t="apply"){if(e instanceof g?(super(),e.copy(this)):super(e,n,i),t!=="nocheck"){const o=this.checkInField();if(!o.inField){if(t==="error")throw new Error("Input is out of field");g.move(this,o.modN)}}}checkInField(){const e=new Ie,n=this.mod(e.n);return{inField:this.cmp(n)===0,modN:n}}isValid(){return this.checkInField().inField}sign(e,n,i=!0,t){const o=new g(Nt(e,n),16);return u0(o,this,i,t)}verify(e,n,i){const t=new g(Nt(e,i),16);return gi(t,n,this.toPublicKey())}toPublicKey(){const n=new Ie().g.mulCT(this);return new Ke(n.x,n.y)}toWif(e=[128]){if(!this.isValid())throw new Error("Value is out of field");return Vl([...this.toArray("be",32),1],e)}toAddress(e=[0]){return this.toPublicKey().toAddress(e)}toHex(){return super.toHex(32)}toString(e="hex",n=64){return super.toString(e,n)}deriveSharedSecret(e){if(!e.validate())throw new Error("Public key not valid for ECDH secret derivation");return e.mulCT(this)}deriveChild(e,n,i,t){let o;if(typeof t=="function"){const u=t(this,e);u===void 0?(o=this.deriveSharedSecret(e),typeof i=="function"&&i(this,e,o)):o=u}else o=this.deriveSharedSecret(e);const s=ee(n,"utf8"),a=Cl(o.encode(!0),s),c=new Ie;return new Xe(this.add(new g(a)).mod(c.n).toArray())}toKeyShares(e,n){if(typeof e!="number"||typeof n!="number")throw new TypeError("threshold and totalShares must be numbers");if(e<2)throw new Error("threshold must be at least 2");if(n<2)throw new Error("totalShares must be at least 2");if(e>n)throw new Error("threshold should be less than or equal to totalShares");const i=oi.fromPrivateKey(this,e),t=[],o=new Set,s=new Ie,a=Pt(64);for(let u=0;u<n;u++){let l,f=0;do{const h=[u,f,...Pt(32)],p=kg(a,h);if(l=new g(p).umod(s.p),f++,f>5)throw new Error("Failed to generate unique x coordinate after 5 attempts")}while(l.isZero()||o.has(l.toString()));o.add(l.toString());const d=i.valueAt(l);t.push(new Qt(l,d))}const c=this.toPublicKey().toHash("hex").slice(0,8);return new si(t,e,c)}toBackupShares(e,n){return this.toKeyShares(e,n).toBackupFormat()}static fromBackupShares(e){return Xe.fromKeyShares(si.fromBackupFormat(e))}static fromKeyShares(e){const{points:n,threshold:i,integrity:t}=e;if(i<2)throw new Error("threshold must be at least 2");if(n.length<i)throw new Error(`At least ${i} shares are required to reconstruct the private key`);for(let c=0;c<i;c++)for(let u=c+1;u<i;u++)if(n[c].x.eq(n[u].x))throw new Error("Duplicate share detected, each must be unique.");const o=new oi(n,i),s=new Xe(o.valueAt(new g(0)).toArray());if(s.toPublicKey().toHash("hex").slice(0,8)!==t)throw new Error("Integrity hash mismatch");return s}}const d0=new Uint8Array(256),f0=new Uint8Array(256);for(let r=0;r<256;r++){const e=(r<<1^((r&128)===0?0:27))&255;d0[r]=e,f0[r]=e^r}(()=>{const r=new Uint8Array(16);return r[0]=225,r})();const Uo=(()=>{const r=typeof globalThis>"u"?void 0:globalThis.process,e=r?.getBuiltinModule;if(typeof e=="function")try{const n=e.call(r,"node:crypto");if(n!=null)return n}catch{}try{if(typeof require=="function")return require("node:crypto")}catch{}})();Uo==null||typeof Uo.createCipheriv=="function"&&Uo.createDecipheriv;const m={OP_0:0,OP_FALSE:0,OP_PUSHDATA1:76,OP_PUSHDATA2:77,OP_PUSHDATA4:78,OP_1NEGATE:79,OP_RESERVED:80,OP_1:81,OP_TRUE:81,OP_2:82,OP_3:83,OP_4:84,OP_5:85,OP_6:86,OP_7:87,OP_8:88,OP_9:89,OP_10:90,OP_11:91,OP_12:92,OP_13:93,OP_14:94,OP_15:95,OP_16:96,OP_NOP:97,OP_VER:98,OP_IF:99,OP_NOTIF:100,OP_VERIF:101,OP_VERNOTIF:102,OP_ELSE:103,OP_ENDIF:104,OP_VERIFY:105,OP_RETURN:106,OP_TOALTSTACK:107,OP_FROMALTSTACK:108,OP_2DROP:109,OP_2DUP:110,OP_3DUP:111,OP_2OVER:112,OP_2ROT:113,OP_2SWAP:114,OP_IFDUP:115,OP_DEPTH:116,OP_DROP:117,OP_DUP:118,OP_NIP:119,OP_OVER:120,OP_PICK:121,OP_ROLL:122,OP_ROT:123,OP_SWAP:124,OP_TUCK:125,OP_CAT:126,OP_SPLIT:127,OP_NUM2BIN:128,OP_BIN2NUM:129,OP_SIZE:130,OP_INVERT:131,OP_AND:132,OP_OR:133,OP_XOR:134,OP_EQUAL:135,OP_EQUALVERIFY:136,OP_RESERVED1:137,OP_RESERVED2:138,OP_1ADD:139,OP_1SUB:140,OP_2MUL:141,OP_2DIV:142,OP_NEGATE:143,OP_ABS:144,OP_NOT:145,OP_0NOTEQUAL:146,OP_ADD:147,OP_SUB:148,OP_MUL:149,OP_DIV:150,OP_MOD:151,OP_LSHIFT:152,OP_RSHIFT:153,OP_BOOLAND:154,OP_BOOLOR:155,OP_NUMEQUAL:156,OP_NUMEQUALVERIFY:157,OP_NUMNOTEQUAL:158,OP_LESSTHAN:159,OP_GREATERTHAN:160,OP_LESSTHANOREQUAL:161,OP_GREATERTHANOREQUAL:162,OP_MIN:163,OP_MAX:164,OP_WITHIN:165,OP_RIPEMD160:166,OP_SHA1:167,OP_SHA256:168,OP_HASH160:169,OP_HASH256:170,OP_CODESEPARATOR:171,OP_CHECKSIG:172,OP_CHECKSIGVERIFY:173,OP_CHECKMULTISIG:174,OP_CHECKMULTISIGVERIFY:175,OP_NOP1:176,OP_CHECKLOCKTIMEVERIFY:177,OP_NOP2:177,OP_CHECKSEQUENCEVERIFY:178,OP_NOP3:178,OP_SUBSTR:179,OP_NOP4:179,OP_LEFT:180,OP_NOP5:180,OP_RIGHT:181,OP_NOP6:181,OP_LSHIFTNUM:182,OP_NOP7:182,OP_RSHIFTNUM:183,OP_NOP8:183,OP_NOP9:184,OP_NOP10:185,OP_NOP11:186,OP_NOP12:187,OP_NOP13:188,OP_NOP14:189,OP_NOP15:190,OP_NOP16:191,OP_NOP17:192,OP_NOP18:193,OP_NOP19:194,OP_NOP20:195,OP_NOP21:196,OP_NOP22:197,OP_NOP23:198,OP_NOP24:199,OP_NOP25:200,OP_NOP26:201,OP_NOP27:202,OP_NOP28:203,OP_NOP29:204,OP_NOP30:205,OP_NOP31:206,OP_NOP32:207,OP_NOP33:208,OP_NOP34:209,OP_NOP35:210,OP_NOP36:211,OP_NOP37:212,OP_NOP38:213,OP_NOP39:214,OP_NOP40:215,OP_NOP41:216,OP_NOP42:217,OP_NOP43:218,OP_NOP44:219,OP_NOP45:220,OP_NOP46:221,OP_NOP47:222,OP_NOP48:223,OP_NOP49:224,OP_NOP50:225,OP_NOP51:226,OP_NOP52:227,OP_NOP53:228,OP_NOP54:229,OP_NOP55:230,OP_NOP56:231,OP_NOP57:232,OP_NOP58:233,OP_NOP59:234,OP_NOP60:235,OP_NOP61:236,OP_NOP62:237,OP_NOP63:238,OP_NOP64:239,OP_NOP65:240,OP_NOP66:241,OP_NOP67:242,OP_NOP68:243,OP_NOP69:244,OP_NOP70:245,OP_NOP71:246,OP_NOP72:247,OP_NOP73:248,OP_NOP77:252,OP_SMALLDATA:249,OP_SMALLINTEGER:250,OP_PUBKEYS:251,OP_PUBKEYHASH:253,OP_PUBKEY:254,OP_INVALIDOPCODE:255};for(const r in m)m[m[r]]===void 0&&(m[m[r]]=r);const yu=typeof globalThis>"u"?void 0:globalThis.Buffer;class oe{_chunks;parsed;rawBytesCache;hexCache;static fromASM(e){const n=[],i=e.split(" ");let t=0;for(;t<i.length;){const{chunk:o,advance:s}=oe.parseASMToken(i,t);n.push(o),t+=s}return new oe(n)}static pushdataOpCodeNum(e){return e>=0&&e<m.OP_PUSHDATA1?e:e<Math.pow(2,8)?m.OP_PUSHDATA1:e<Math.pow(2,16)?m.OP_PUSHDATA2:m.OP_PUSHDATA4}static parseASMToken(e,n){const i=e[n];if(i==="0")return{chunk:{op:0},advance:1};if(i==="-1")return{chunk:{op:m.OP_1NEGATE},advance:1};const t=i.startsWith("OP_")&&m[i]!==void 0,o=t?m[i]:0;if(o===m.OP_PUSHDATA1||o===m.OP_PUSHDATA2||o===m.OP_PUSHDATA4)return{chunk:{data:ee(e[n+2],"hex"),op:o},advance:3};if(!t){let s=i;s.length%2!==0&&(s="0"+s);const a=ee(s,"hex");if(lu(a,"hex")!==s)throw new Error("invalid hex string in script");return{chunk:{data:a,op:oe.pushdataOpCodeNum(a.length)},advance:1}}return{chunk:{op:o},advance:1}}static fromHex(e){if(e.length===0)return oe.fromBinary([]);if(e.length%2!==0)throw new Error("There is an uneven number of characters in the string which suggests it is not hex encoded.");if(!/^[0-9a-fA-F]+$/.test(e))throw new Error("Some elements in this string are not hex encoded.");const n=ee(e,"hex"),i=Uint8Array.from(n);return new oe([],i,e.toLowerCase(),!1)}static fromBinary(e){const n=Uint8Array.from(e);return new oe([],n,void 0,!1)}static fromBinaryView(e){return new oe([],e,void 0,!1)}constructor(e=[],n,i,t=!0){this._chunks=e,this.parsed=t,this.rawBytesCache=n,this.hexCache=i}get chunks(){return this.ensureParsed(),this._chunks}set chunks(e){this._chunks=e,this.parsed=!0,this.invalidateSerializationCaches()}ensureParsed(){this.parsed||(this.rawBytesCache!=null?this._chunks=oe.parseChunks(this.rawBytesCache):this._chunks=[],this.parsed=!0)}toASM(){let e="";for(const n of this.chunks)e+=this._chunkToString(n);return e.slice(1)}toHex(){if(this.hexCache!=null)return this.hexCache;this.rawBytesCache??=this.serializeChunksToBytes();const e=yu==null?lu(Array.from(this.rawBytesCache),"hex"):yu.from(this.rawBytesCache).toString("hex");return this.hexCache=e,e}toBinary(){return Array.from(this.toUint8Array())}toUint8Array(){return this.rawBytesCache??=this.serializeChunksToBytes(),this.rawBytesCache}writeScript(e){return this.invalidateSerializationCaches(),this.chunks=this.chunks.concat(e.chunks),this}writeOpCode(e){return this.invalidateSerializationCaches(),this.chunks.push({op:e}),this}setChunkOpCode(e,n){return this.invalidateSerializationCaches(),this.chunks[e]={op:n},this}writeBn(e){if(this.invalidateSerializationCaches(),e.cmpn(0)===m.OP_0)this.chunks.push({op:m.OP_0});else if(e.cmpn(-1)===0)this.chunks.push({op:m.OP_1NEGATE});else if(e.cmpn(1)>=0&&e.cmpn(16)<=0)this.chunks.push({op:e.toNumber()+m.OP_1-1});else{const n=e.toSm("little");this.writeBin(n)}return this}writeBin(e){this.invalidateSerializationCaches();let n;const i=e.length>0?e:void 0;if(e.length>0&&e.length<m.OP_PUSHDATA1)n=e.length;else if(e.length===0)n=m.OP_0;else if(e.length<Math.pow(2,8))n=m.OP_PUSHDATA1;else if(e.length<Math.pow(2,16))n=m.OP_PUSHDATA2;else if(e.length<Math.pow(2,32))n=m.OP_PUSHDATA4;else throw new Error("You can't push that much data");return this.chunks.push({data:i,op:n}),this}writeNumber(e){return this.invalidateSerializationCaches(),this.writeBn(new g(e)),this}removeCodeseparators(){const e=this.toUint8Array();return this.rawBytesCache=Uint8Array.from(oe.removeOpcodeBytes(e,m.OP_CODESEPARATOR)),this.hexCache=void 0,this._chunks=[],this.parsed=!1,this}findAndDelete(e){this.invalidateSerializationCaches();const n=e.toUint8Array(),i=n.length;if(i===0)return this;const t=n[0]??0,o=s=>{if(s.op!==t)return!1;const a=s.data??[],c=a.length;if(c===0)return i===1;if(s.op===m.OP_RETURN){if(i!==1+c)return!1;for(let u=0;u<c;u++)if(n[1+u]!==a[u])return!1;return!0}if(s.op<m.OP_PUSHDATA1){if(i!==1+c)return!1;for(let u=0;u<c;u++)if(n[1+u]!==a[u])return!1;return!0}if(s.op===m.OP_PUSHDATA1){if(i!==2+c||n[1]!==(c&255))return!1;for(let u=0;u<c;u++)if(n[2+u]!==a[u])return!1;return!0}if(s.op===m.OP_PUSHDATA2){if(i!==3+c||n[1]!==(c&255)||n[2]!==(c>>8&255))return!1;for(let u=0;u<c;u++)if(n[3+u]!==a[u])return!1;return!0}if(s.op===m.OP_PUSHDATA4){if(i!==5+c)return!1;const u=c>>>0;if(n[1]!==(u&255)||n[2]!==(u>>8&255)||n[3]!==(u>>16&255)||n[4]!==(u>>24&255))return!1;for(let l=0;l<c;l++)if(n[5+l]!==a[l])return!1;return!0}return!1};for(let s=0;s<this.chunks.length;)o(this.chunks[s])?this.chunks.splice(s,1):s++;return this}isPushOnly(){for(const e of this.chunks)if(e.op>m.OP_16)return!1;return!0}isLockingScript(){throw new Error("Not implemented")}isUnlockingScript(){throw new Error("Not implemented")}static computeSerializedLength(e){let n=0;for(const i of e){if(n+=1,i.data==null)continue;const t=i.data.length;if(i.op===m.OP_RETURN){n+=t;break}i.op<m.OP_PUSHDATA1?n+=t:i.op===m.OP_PUSHDATA1?n+=1+t:i.op===m.OP_PUSHDATA2?n+=2+t:i.op===m.OP_PUSHDATA4&&(n+=4+t)}return n}serializeChunksToBytes(){const e=this.chunks,n=oe.computeSerializedLength(e),i=new Uint8Array(n);let t=0;for(const o of e)if(i[t++]=o.op,o.data!=null){if(o.op===m.OP_RETURN){i.set(o.data,t);break}t=oe.writeChunkData(i,t,o.op,o.data)}return i}invalidateSerializationCaches(){this.rawBytesCache=void 0,this.hexCache=void 0}static writeChunkData(e,n,i,t){const o=t.length;if(i<m.OP_PUSHDATA1)return e.set(t,n),n+o;if(i===m.OP_PUSHDATA1)return e[n++]=o&255,e.set(t,n),n+o;if(i===m.OP_PUSHDATA2)return e[n++]=o&255,e[n++]=o>>8&255,e.set(t,n),n+o;if(i===m.OP_PUSHDATA4){const s=o>>>0;return e[n++]=s&255,e[n++]=s>>8&255,e[n++]=s>>16&255,e[n++]=s>>24&255,e.set(t,n),n+o}return n}static readPushdataLength(e,n,i,t){if(e>0&&e<m.OP_PUSHDATA1)return{len:e,newPos:i,hasLength:!0};if(e===m.OP_PUSHDATA1){const a=i<t;return{len:a?n[i++]??0:0,newPos:i,hasLength:a}}if(e===m.OP_PUSHDATA2){const a=i+1<t;return{len:(n[i]??0)|(n[i+1]??0)<<8,newPos:Math.min(i+2,t),hasLength:a}}const o=i+3<t;return{len:((n[i]??0)|(n[i+1]??0)<<8|(n[i+2]??0)<<16|(n[i+3]??0)<<24)>>>0,newPos:Math.min(i+4,t),hasLength:o}}static parseChunks(e){const n=[],i=e.length;let t=0,o=0;for(;t<i;){const s=e[t++]??0;if(s===m.OP_RETURN&&o===0){n.push({op:s,data:oe.copyRange(e,t,i)});break}if(s===m.OP_IF||s===m.OP_NOTIF||s===m.OP_VERIF||s===m.OP_VERNOTIF?o++:s===m.OP_ENDIF&&o--,s>0&&s<=m.OP_PUSHDATA4){const{len:a,newPos:c,hasLength:u}=oe.readPushdataLength(s,e,t,i);t=c;const l=Math.min(t+a,i),f=!u||l-t!==a;n.push({data:oe.copyRange(e,t,l),op:s,invalidLength:f}),t=l}else n.push({op:s})}return n}static removeOpcodeBytes(e,n){const i=[],t=e.length;let o=0;for(;o<t;){const s=o,a=e[o++]??0;if(a>0&&a<=m.OP_PUSHDATA4){const{len:c,newPos:u}=oe.readPushdataLength(a,e,o,t);o=u;const l=Math.min(o+c,t);if(a!==n)for(let f=s;f<l;f++)i.push(e[f]??0);o=l}else a!==n&&i.push(a)}return i}static copyRange(e,n,i){const t=Math.max(i-n,0),o=new Array(t);for(let s=0;s<t;s++)o[s]=e[n+s]??0;return o}_chunkToString(e){const n=e.op;let i="";if(e.data===void 0){const t=m[n];i=`${i} ${t}`}else i=`${i} ${G(e.data)}`;return i}}const _u=new Uint8Array(0);class j extends mt{static SIGHASH_ALL=1;static SIGHASH_NONE=2;static SIGHASH_SINGLE=3;static SIGHASH_CHRONICLE=32;static SIGHASH_FORKID=64;static SIGHASH_ANYONECANPAY=128;scope;static formatOTDA(e){const n=(e.scope&j.SIGHASH_ANYONECANPAY)===j.SIGHASH_ANYONECANPAY,i=(e.scope&31)===j.SIGHASH_SINGLE,t=(e.scope&31)===j.SIGHASH_NONE,o=(e.scope&31)===j.SIGHASH_ALL||!i&&!t,s=oe.fromBinary(e.subscript.toBinary());s.removeCodeseparators();const a={sourceTXID:e.sourceTXID,sourceOutputIndex:e.sourceOutputIndex,sequence:e.inputSequence,script:s.toBinary()},c=new Ae;function u(h){c.writeVarIntNum(h.length);for(const p of h)c.writeReverse(ee(p.sourceTXID,"hex")),c.writeUInt32LE(p.sourceOutputIndex),c.writeVarIntNum(p.script.length),c.write(p.script),c.writeUInt32LE(p.sequence)}function l(h){c.writeVarIntNum(h.length);for(const p of h)c.writeUInt64LE(p.satoshis),c.writeVarIntNum(p.script.length),c.write(p.script)}c.writeInt32LE(e.transactionVersion);const f=new oe().toBinary();if(n)n&&u([a]);else{const h=e.allInputs==null?e.otherInputs.map(p=>({sourceTXID:p.sourceTXID??p.sourceTransaction?.id("hex")??"",sourceOutputIndex:p.sourceOutputIndex,sequence:i||t?0:p.sequence??4294967295,script:f})):e.allInputs.map((p,_)=>_===e.inputIndex?a:{sourceTXID:p.sourceTXID??p.sourceTransaction?.id("hex")??"",sourceOutputIndex:p.sourceOutputIndex,sequence:i||t?0:p.sequence??4294967295,script:f});e.allInputs==null&&h.splice(e.inputIndex,0,a),u(h)}if(o){const h=e.outputs.map(p=>({satoshis:p.satoshis??0,script:p.lockingScript.toBinary()}));l(h)}else if(i){const h=[];for(let _=0;_<e.inputIndex;_++)h.push({satoshis:-1,script:f});const p=e.outputs[e.inputIndex];p!==void 0&&h.push({satoshis:p.satoshis??0,script:p.lockingScript.toBinary()}),l(h)}else t&&l([]);return c.writeUInt32LE(e.lockTime),c.writeUInt32LE(e.scope>>>0),c.toUint8Array()}static formatBip143(e){const n=e.cache,i={sourceTXID:e.sourceTXID,sourceOutputIndex:e.sourceOutputIndex,sequence:e.inputSequence},t=e.allInputs??(()=>{const _=[...e.otherInputs];return _.splice(e.inputIndex,0,i),_})(),o=()=>{const _=new Ae;for(let $=0;$<t.length;$++){const k=$===e.inputIndex?i:t[$];if(k.sourceTXID===void 0){if(k.sourceTransaction==null)throw new Error("Missing sourceTransaction for input");_.write(k.sourceTransaction.hash())}else _.writeReverse(ee(k.sourceTXID,"hex"));_.writeUInt32LE(k.sourceOutputIndex)}const w=_.toUint8Array();return Ue(w)},s=()=>{const _=new Ae;for(let $=0;$<t.length;$++){const z=($===e.inputIndex?i:t[$]).sequence??4294967295;_.writeUInt32LE(z)}const w=_.toUint8Array();return Ue(w)};function a(_){const w=new Ae;if(_===void 0)for(const k of e.outputs){const z=k.satoshis??0;w.writeUInt64LE(z);const A=k.lockingScript?.toUint8Array()??_u;w.writeVarIntNum(A.length),w.write(A)}else{const k=e.outputs[_];if(k===void 0)throw new Error(`Output at index ${_} does not exist`);const z=k.satoshis??0;w.writeUInt64LE(z);const A=k.lockingScript?.toUint8Array()??_u;w.writeVarIntNum(A.length),w.write(A)}const O=w.toUint8Array();return Ue(O)}let c=new Array(32).fill(0),u=new Array(32).fill(0),l=new Array(32).fill(0);if((e.scope&j.SIGHASH_ANYONECANPAY)===0&&(n?.hashPrevouts==null?(c=o(),n!=null&&(n.hashPrevouts=c)):c=n.hashPrevouts),(e.scope&j.SIGHASH_ANYONECANPAY)===0&&(e.scope&31)!==j.SIGHASH_SINGLE&&(e.scope&31)!==j.SIGHASH_NONE&&(n?.hashSequence==null?(u=s(),n!=null&&(n.hashSequence=u)):u=n.hashSequence),(e.scope&31)!==j.SIGHASH_SINGLE&&(e.scope&31)!==j.SIGHASH_NONE)n?.hashOutputsAll==null?(l=a(),n!=null&&(n.hashOutputsAll=l)):l=n.hashOutputsAll;else if((e.scope&31)===j.SIGHASH_SINGLE&&e.inputIndex<e.outputs.length){const _=e.inputIndex,w=n?.hashOutputsSingle?.get(_);w==null?(l=a(_),n!=null&&(n.hashOutputsSingle??=new Map,n.hashOutputsSingle.set(_,l))):l=w}const f=new Ae;f.writeInt32LE(e.transactionVersion),f.write(c),f.write(u),f.writeReverse(ee(e.sourceTXID,"hex")),f.writeUInt32LE(e.sourceOutputIndex);const d=e.subscript.toUint8Array();f.writeVarIntNum(d.length),f.write(d),f.writeUInt64LE(e.sourceSatoshis);const h=i.sequence;return f.writeUInt32LE(h),f.write(l),f.writeUInt32LE(e.lockTime),f.writeUInt32LE(e.scope>>>0),f.toUint8Array()}static format(e){return Array.from(this.formatBytes(e))}static formatBytes(e){const n=(e.scope&j.SIGHASH_FORKID)!==0,i=e.ignoreChronicle!==!0&&(e.scope&j.SIGHASH_CHRONICLE)!==0;return n&&!i?j.formatBip143(e):!n||n&&i?j.formatOTDA(e):new Uint8Array(0)}static usesOtdaSingleBug(e){const n=(e.scope&j.SIGHASH_FORKID)!==0,i=e.ignoreChronicle!==!0&&(e.scope&j.SIGHASH_CHRONICLE)!==0;return(!n||n&&i)&&(e.scope&31)===j.SIGHASH_SINGLE&&e.inputIndex>=e.outputs.length}static fromChecksigFormat(e){if(e.length===0){const o=new g(1),s=new g(1),a=1;return new j(o,s,a)}const n=e.at(-1),i=e.slice(0,e.length-1),t=mt.fromDER(i);return new j(t.r,t.s,n)}constructor(e,n,i){super(e,n),this.scope=i}hasLowS(){return!(this.s.ltn(1)||this.s.gt(new g("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex")))}toChecksigFormat(){return[...this.toDER(),this.scope]}}BigInt("0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff");BigInt("0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551");BigInt("0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b");BigInt("0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296");BigInt("0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5");function xu(r,e,n){if(!(e instanceof Uint8Array))throw new TypeError(`${r} returned a non-byte result`);if(n!==void 0&&e.length!==n)throw new Error(`${r} returned ${e.length} bytes; expected ${n}`);return e}function h0(){return globalThis}function wu(r){const e=h0().__bsvSdkAsyncCryptoBackendV1;if(e!==void 0){if(!e.isReady()){e.preload().catch(()=>{});return}return e.supportsCrypto(r)?e:void 0}}class Jt extends oe{isLockingScript(){return!0}isUnlockingScript(){return!1}}class Qr extends oe{isLockingScript(){return!1}isUnlockingScript(){return!0}}class p0 extends Error{txid;outputIndex;context;programCounter;stackState;altStackState;ifStackState;stackMem;altStackMem;constructor(e){const n=e.stackState.map(u=>u?.length!==void 0?G(u):u==null?"null/undef":"INVALID_STACK_ITEM").join(", "),i=e.altStackState.map(u=>u?.length!==void 0?G(u):u==null?"null/undef":"INVALID_STACK_ITEM").join(", "),t=`Context: ${e.context}, PC: ${e.programCounter}`,o=`Stack: [${n}] (len: ${e.stackState.length}, mem: ${e.stackMem})`,s=`AltStack: [${i}] (len: ${e.altStackState.length}, mem: ${e.altStackMem})`,a=`IfStack: [${e.ifStackState.join(", ")}]`,c=`Script evaluation error: ${e.message}
1072
+ TXID: ${e.txid}, OutputIdx: ${e.outputIndex}
1073
+ ${t}
1074
+ ${o}
1075
+ ${s}
1076
+ ${a}`;super(c),this.name=this.constructor.name,this.txid=e.txid,this.outputIndex=e.outputIndex,this.context=e.context,this.programCounter=e.programCounter,this.stackState=e.stackState.map(u=>u.slice()),this.altStackState=e.altStackState.map(u=>u.slice()),this.ifStackState=e.ifStackState.slice(),this.stackMem=e.stackMem,this.altStackMem=e.altStackMem}}function m0(){return globalThis}function Wl(){return m0().__bsvSdkScriptVerificationBackendV1}const g0=1024*1024*1024,b0=520,Su=1e4,ku=500,Iu=1e3,v0=Math.pow(2,31)-1,y0=BigInt(v0),_0=20,x0=2147483648,w0=Object.freeze(new g(-1).toScriptNum()),$u=Object.freeze(Array.from({length:17},(r,e)=>Object.freeze(new g(e).toScriptNum())));function Eu(r,e){if(r.length!==e.length)return!1;for(let n=0;n<r.length;n++)if(r[n]!==e[n])return!1;return!0}function S0(r,e=Number.MAX_SAFE_INTEGER){return!(r.length>e||r.length>0&&(r.at(-1)&127)===0&&(r.length<=1||(r.at(-2)&128)===0))}function k0(r){if(r.length<9||r.length>73||r[0]!==48||r[1]!==r.length-3)return!1;const e=r[2],n=r[3];if(e!==2||n===0||5+n>=r.length)return!1;const i=4+n,t=r[i],o=r[i+1];if(t!==2||o===0||(r[4]&128)!==0||n>1&&r[4]===0&&(r[5]&128)===0)return!1;const s=i+2;return!((r[s]&128)!==0||o>1&&r[s]===0&&(r[s+1]&128)===0||n+o+7!==r.length)}function I0(r){const e=r.data,n=r.op;return Array.isArray(e)?e.length===0?n===m.OP_0:e.length===1&&e[0]>=1&&e[0]<=16?n===m.OP_1+(e[0]-1):e.length===1&&e[0]===129?n===m.OP_1NEGATE:e.length<=75?n===e.length:e.length<=255?n===m.OP_PUSHDATA1:e.length<=65535?n===m.OP_PUSHDATA2:!0:!0}class $0{sourceTXID;sourceOutputIndex;sourceSatoshis;lockingScript;transactionVersion;otherInputs;allInputs;outputs;inputIndex;unlockingScript;inputSequence;lockTime;context;programCounter;lastCodeSeparator;stack;altStack;ifStack;elseStack;memoryLimit;stackMem;altStackMem;isRelaxedOverride;verifyFlags;executedOpCount;returningFromConditional;sigHashCache;ownsSigHashCache;constructor(e){if(this.sourceTXID=e.sourceTXID,this.sourceOutputIndex=e.sourceOutputIndex,this.sourceSatoshis=e.sourceSatoshis,this.lockingScript=e.lockingScript,this.transactionVersion=e.transactionVersion,this.otherInputs=e.otherInputs,this.allInputs=e.allInputs,this.outputs=e.outputs,this.inputIndex=e.inputIndex,this.unlockingScript=e.unlockingScript,this.inputSequence=e.inputSequence,this.lockTime=e.lockTime,this.memoryLimit=e.memoryLimit??32e6,this.isRelaxedOverride=e.isRelaxed===!0,e.verifyFlags===void 0)this.verifyFlags=void 0;else{const n=Array.isArray(e.verifyFlags)?e.verifyFlags:e.verifyFlags.split(",");this.verifyFlags=new Set(n.map(i=>i.trim()).filter(i=>i.length>0))}this.stack=[],this.altStack=[],this.ifStack=[],this.elseStack=[],this.stackMem=0,this.altStackMem=0,this.executedOpCount=0,this.returningFromConditional=!1,this.ownsSigHashCache=e.sigHashCache==null,this.sigHashCache=e.sigHashCache??{hashOutputsSingle:new Map},this.reset()}isRelaxed(){return this.isRelaxedOverride||this.transactionVersion>1}hasExplicitFlags(){return this.verifyFlags!==void 0}hasFlag(e){return this.verifyFlags?.has(e)===!0}isAfterGenesis(){return this.hasExplicitFlags()?this.hasFlag("GENESIS")||this.hasFlag("UTXO_AFTER_GENESIS")||this.hasFlag("UTXO_AFTER_CHRONICLE"):this.isRelaxed()}isAfterChronicle(){return this.hasExplicitFlags()?this.hasFlag("UTXO_AFTER_CHRONICLE"):this.isRelaxed()}shouldEnforceMinimalData(){return this.hasExplicitFlags()?this.hasFlag("MINIMALDATA"):!this.isRelaxed()}shouldEnforceLowS(){return this.hasExplicitFlags()?this.hasFlag("LOW_S"):!this.isRelaxed()}shouldEnforceNullDummy(){return this.hasExplicitFlags()?this.hasFlag("NULLDUMMY"):!this.isRelaxed()}shouldEnforceSigPushOnly(){return this.hasExplicitFlags()?this.hasFlag("SIGPUSHONLY"):!this.isRelaxed()}shouldEnforceCleanStack(){return this.hasExplicitFlags()?this.hasFlag("CLEANSTACK"):!this.isRelaxed()}shouldEnforceDerSignatures(){return this.hasExplicitFlags()?this.hasFlag("DERSIG")||this.hasFlag("STRICTENC")||this.hasFlag("LOW_S")||this.hasFlag("SIGHASH_FORKID"):!0}shouldEnforceStrictEncoding(){return this.hasExplicitFlags()?this.hasFlag("STRICTENC")||this.hasFlag("SIGHASH_FORKID"):!0}scriptNumMaxSize(){if(this.hasExplicitFlags()&&!this.isAfterGenesis())return 4}maxPushSize(){return this.hasExplicitFlags()&&!this.isAfterGenesis()?b0:g0}reset(){this.ownsSigHashCache&&(delete this.sigHashCache.hashPrevouts,delete this.sigHashCache.hashSequence,delete this.sigHashCache.hashOutputsAll,this.sigHashCache.hashOutputsSingle?.clear()),this.context="UnlockingScript",this.programCounter=0,this.lastCodeSeparator=null,this.stack=[],this.altStack=[],this.ifStack=[],this.elseStack=[],this.stackMem=0,this.altStackMem=0,this.executedOpCount=0,this.returningFromConditional=!1}ensureStackMem(e){this.stackMem+e>this.memoryLimit&&this.scriptEvaluationError("Stack memory usage has exceeded "+String(this.memoryLimit)+" bytes")}ensureAltStackMem(e){this.altStackMem+e>this.memoryLimit&&this.scriptEvaluationError("Alt stack memory usage has exceeded "+String(this.memoryLimit)+" bytes")}pushStack(e){this.ensureStackMem(e.length),this.stack.push(e),this.stackMem+=e.length}pushStackCopy(e){this.ensureStackMem(e.length);const n=e.slice();this.stack.push(n),this.stackMem+=n.length}popStack(){this.stack.length===0&&this.scriptEvaluationError("Attempted to pop from an empty stack.");const e=this.stack.pop();return e===void 0?(this.scriptEvaluationError("Attempted to pop from an empty stack."),[]):(this.stackMem-=e.length,e)}stackTop(e=-1){return(this.stack.length===0||this.stack.length<Math.abs(e)||e>=0&&e>=this.stack.length)&&this.scriptEvaluationError(`Stack underflow accessing element at index ${e}. Stack length is ${this.stack.length}.`),this.stack[this.stack.length+e]}setStack(e){this.stack=e.map(n=>n.slice()),this.stackMem=this.stack.reduce((n,i)=>n+i.length,0)}clearAltStack(){this.altStack=[],this.altStackMem=0}pushAltStack(e){this.ensureAltStackMem(e.length),this.altStack.push(e),this.altStackMem+=e.length}popAltStack(){this.altStack.length===0&&this.scriptEvaluationError("Attempted to pop from an empty alt stack.");const e=this.altStack.pop();return e===void 0?(this.scriptEvaluationError("Attempted to pop from an empty alt stack."),[]):(this.altStackMem-=e.length,e)}readScriptNumber(e){try{return g.fromScriptNum(e,this.shouldEnforceMinimalData(),this.scriptNumMaxSize())}catch(n){const i=n instanceof Error?n.message:String(n);this.scriptEvaluationError(i)}return new g(0)}isDefinedHashType(e){const n=e&31;return n>=j.SIGHASH_ALL&&n<=j.SIGHASH_SINGLE}checkSignatureEncoding(e){if(e.length===0)return!0;const n=this.shouldEnforceDerSignatures();if(n&&!k0(e))return this.scriptEvaluationError("The signature format is invalid."),!1;try{const i=j.fromChecksigFormat(e);if(this.shouldEnforceStrictEncoding()&&!this.isDefinedHashType(i.scope))return this.scriptEvaluationError("The signature hash type is invalid."),!1;if(this.shouldEnforceStrictEncoding()&&(i.scope&j.SIGHASH_CHRONICLE)!==0&&!this.isAfterChronicle())return this.scriptEvaluationError("The signature hash type is invalid before Chronicle."),!1;const t=(i.scope&j.SIGHASH_FORKID)!==0;if(this.hasExplicitFlags()){if(this.hasFlag("SIGHASH_FORKID")&&!t)return this.scriptEvaluationError("The signature must use SIGHASH_FORKID."),!1;if(!this.hasFlag("SIGHASH_FORKID")&&!this.isAfterGenesis()&&t)return this.scriptEvaluationError("The signature must not use SIGHASH_FORKID."),!1}if(this.shouldEnforceLowS()&&!i.hasLowS())return this.scriptEvaluationError("The signature must have a low S value."),!1}catch{if(n)return this.scriptEvaluationError("The signature format is invalid."),!1}return!0}parseChecksigSignature(e){try{return j.fromChecksigFormat(e)}catch(n){if(this.shouldEnforceDerSignatures())throw n;return this.parseLaxChecksigSignature(e)}}readLaxDERLength(e,n){const i=e[n.value++];if(i===void 0)throw new Error("Invalid DER length");if((i&128)===0)return i;const t=i&127;if(t===0||n.value+t>e.length)throw new Error("Invalid DER length");let o=0;for(let s=0;s<t;s++)o=o<<8|(e[n.value++]??0);return o}parseLaxDERInteger(e,n,i){if(n.value>=i||e[n.value++]!==2)throw new Error("Invalid DER integer");const t=this.readLaxDERLength(e,n);if(n.value+t>i)throw new Error("Invalid DER integer length");let o=e.slice(n.value,n.value+t);for(n.value+=t;o.length>1&&o[0]===0;)o=o.slice(1);return o.length===0&&(o=[0]),new g(o)}parseLaxChecksigSignature(e){if(e.length===0)return j.fromChecksigFormat(e);const n=e.at(-1),i=e.slice(0,-1),t={value:0};if(i[t.value++]!==48)throw new Error("Signature DER must start with 0x30");const o=this.readLaxDERLength(i,t),s=Math.min(t.value+o,i.length),a=this.parseLaxDERInteger(i,t,s),c=this.parseLaxDERInteger(i,t,s);return new j(a,c,n)}checkPublicKeyEncoding(e){if(!this.shouldEnforceStrictEncoding())return!0;if(e.length===0)return this.scriptEvaluationError("Public key is empty."),!1;if(e.length<33)return this.scriptEvaluationError("The public key is too short, it must be at least 33 bytes."),!1;if(e[0]===4){if(e.length!==65)return this.scriptEvaluationError("The non-compressed public key must be 65 bytes."),!1}else if(e[0]===2||e[0]===3){if(e.length!==33)return this.scriptEvaluationError("The compressed public key must be 33 bytes."),!1}else return this.scriptEvaluationError("The public key is in an unknown format."),!1;try{Ke.fromDER(e)}catch{return this.scriptEvaluationError("The public key is in an unknown format."),!1}return!0}verifySignature(e,n,i){const t={sourceTXID:this.sourceTXID,sourceOutputIndex:this.sourceOutputIndex,sourceSatoshis:this.sourceSatoshis,transactionVersion:this.transactionVersion,otherInputs:this.otherInputs,allInputs:this.allInputs,outputs:this.outputs,inputIndex:this.inputIndex,subscript:i,inputSequence:this.inputSequence,lockTime:this.lockTime,scope:e.scope,cache:this.sigHashCache},o=j.usesOtdaSingleBug(t)?new g([1,...new Array(31).fill(0)]):new g(Ue(j.formatBytes(t)));return gi(o,e,n)}step(){if(this.stackMem>this.memoryLimit)return this.scriptEvaluationError("Stack memory usage has exceeded "+String(this.memoryLimit)+" bytes"),!1;if(this.altStackMem>this.memoryLimit)return this.scriptEvaluationError("Alt stack memory usage has exceeded "+String(this.memoryLimit)+" bytes"),!1;this.context==="UnlockingScript"&&this.programCounter>=this.unlockingScript.chunks.length&&(this.ifStack.length>0&&this.scriptEvaluationError("Every OP_IF, OP_NOTIF, or OP_ELSE must be terminated with OP_ENDIF prior to the end of the unlocking script."),this.clearAltStack(),this.ifStack=[],this.elseStack=[],this.returningFromConditional=!1,this.lastCodeSeparator=null,this.context="LockingScript",this.programCounter=0);const e=this.context==="UnlockingScript"?this.unlockingScript:this.lockingScript;if(this.programCounter>=e.chunks.length)return!1;const n=e.chunks[this.programCounter],i=n.op;i===void 0&&this.scriptEvaluationError(`Missing opcode in ${this.context} at pc=${this.programCounter}.`),n.invalidLength===!0&&this.scriptEvaluationError(`Malformed push data in ${this.context} at pc=${this.programCounter}.`),Array.isArray(n.data)&&n.data.length>this.maxPushSize()&&this.scriptEvaluationError(`Data push > ${this.maxPushSize()} bytes (pc=${this.programCounter}).`);const t=!this.returningFromConditional&&!this.ifStack.includes(!1);if(this.hasExplicitFlags()&&!this.isAfterGenesis()&&!this.isAfterChronicle()&&(i===m.OP_2MUL||i===m.OP_2DIV||i===m.OP_VERIF||i===m.OP_VERNOTIF)&&this.scriptEvaluationError(`${m[i]} is disabled until Chronicle.`),t&&i>=0&&i<=m.OP_PUSHDATA4)this.shouldEnforceMinimalData()&&!I0(n)&&this.scriptEvaluationError(`This data is not minimally-encoded. (PC: ${this.programCounter})`),this.pushStack(Array.isArray(n.data)?n.data:[]);else if(t||i>=m.OP_IF&&i<=m.OP_ENDIF){let o,s,a,c,u,l,f,d,h,p,_,w,O,$,k,z,A,J,se,le,Y,Te,rt,Oe,Ve,Zt;if(t&&i>m.OP_16&&(this.executedOpCount++,this.hasExplicitFlags()&&!this.isAfterGenesis()&&this.executedOpCount>ku&&this.scriptEvaluationError(`Script executed more than ${ku} opcodes.`)),this.hasExplicitFlags()&&!this.isAfterChronicle()){if(t&&(i===m.OP_SUBSTR||i===m.OP_LEFT||i===m.OP_RIGHT||i===m.OP_LSHIFTNUM||i===m.OP_RSHIFTNUM))return this.hasFlag("DISCOURAGE_UPGRADABLE_NOPS")&&this.scriptEvaluationError(`${m[i]} is discouraged by verification flags.`),this.programCounter++,!0;if((t||!this.isAfterGenesis())&&(i===m.OP_2MUL||i===m.OP_2DIV)&&this.scriptEvaluationError(`${m[i]} is disabled until Chronicle.`),(t||!this.isAfterGenesis())&&(i===m.OP_VER||i===m.OP_VERIF||i===m.OP_VERNOTIF)&&this.scriptEvaluationError(`${m[i]} is disabled until Chronicle.`),!t&&this.isAfterGenesis()&&(i===m.OP_VERIF||i===m.OP_VERNOTIF))return this.programCounter++,!0}switch(t&&this.hasFlag("DISCOURAGE_UPGRADABLE_NOPS")&&(i===m.OP_NOP1||i===m.OP_CHECKLOCKTIMEVERIFY||i===m.OP_CHECKSEQUENCEVERIFY||i===m.OP_NOP9||i===m.OP_NOP10)&&this.scriptEvaluationError(`${m[i]} is discouraged by verification flags.`),i){case m.OP_VER:{const T=this.transactionVersion;this.pushStack([T&255,T>>>8&255,T>>>16&255,T>>>24&255]);break}case m.OP_SUBSTR:{this.stack.length<3&&this.scriptEvaluationError("OP_SUBSTR requires at least three items to be on the stack.");const T=this.readScriptNumber(this.popStack()).toNumber(),E=this.readScriptNumber(this.popStack()).toNumber();o=this.popStack();const W=o.length;(E<0||E>=W||T<0||T>W-E)&&this.scriptEvaluationError(`OP_SUBSTR offset (${E}) must be in range [0, ${W}) and length (${T}) must be in range [0, ${W-E}]`),this.pushStack(o.slice(E,E+T));break}case m.OP_LEFT:{this.stack.length<2&&this.scriptEvaluationError("OP_LEFT requires at least two items to be on the stack.");const T=this.readScriptNumber(this.popStack()).toNumber();o=this.popStack();const E=o.length;(T<0||T>E)&&this.scriptEvaluationError(`OP_LEFT length (${T}) must be in range [0, ${E}]`),this.pushStack(o.slice(0,T));break}case m.OP_RIGHT:{this.stack.length<2&&this.scriptEvaluationError("OP_RIGHT requires at least two items to be on the stack.");const T=this.readScriptNumber(this.popStack()).toNumber();o=this.popStack();const E=o.length;(T<0||T>E)&&this.scriptEvaluationError(`OP_RIGHT length (${T}) must be in range [0, ${E}]`),this.pushStack(o.slice(E-T));break}case m.OP_LSHIFTNUM:{this.stack.length<2&&this.scriptEvaluationError("OP_LSHIFTNUM requires at least two items to be on the stack.");const T=this.readScriptNumber(this.popStack()).toBigInt();T<0&&this.scriptEvaluationError("OP_LSHIFTNUM bits to shift must not be negative.");const E=this.readScriptNumber(this.popStack()).toBigInt(),W=new g(E<<T);this.pushStack(W.toScriptNum());break}case m.OP_RSHIFTNUM:{this.stack.length<2&&this.scriptEvaluationError("OP_RSHIFTNUM requires at least two items to be on the stack.");const T=this.readScriptNumber(this.popStack()).toBigInt();T<0&&this.scriptEvaluationError("OP_RSHIFTNUM bits to shift must not be negative.");const E=this.readScriptNumber(this.popStack()).toBigInt();let W;E<0?W=new g(-(-E>>T)):W=new g(E>>T),this.pushStack(W.toScriptNum());break}case m.OP_1NEGATE:this.pushStackCopy(w0);break;case m.OP_0:this.pushStackCopy($u[0]);break;case m.OP_1:case m.OP_2:case m.OP_3:case m.OP_4:case m.OP_5:case m.OP_6:case m.OP_7:case m.OP_8:case m.OP_9:case m.OP_10:case m.OP_11:case m.OP_12:case m.OP_13:case m.OP_14:case m.OP_15:case m.OP_16:w=i-(m.OP_1-1),this.pushStackCopy($u[w]);break;case m.OP_NOP:case m.OP_NOP1:case m.OP_CHECKLOCKTIMEVERIFY:break;case m.OP_CHECKSEQUENCEVERIFY:if(this.hasFlag("CHECKSEQUENCEVERIFY")){this.stack.length<1&&this.scriptEvaluationError("OP_CHECKSEQUENCEVERIFY requires at least one item to be on the stack.");let T=0n;try{T=g.fromScriptNum(this.stackTop(),this.shouldEnforceMinimalData(),5).toBigInt()}catch{this.scriptEvaluationError("OP_CHECKSEQUENCEVERIFY requires a minimally-encoded numeric lock time.")}T<0n&&this.scriptEvaluationError("OP_CHECKSEQUENCEVERIFY requires a non-negative lock time."),Number(T&BigInt(x0))===0&&this.transactionVersion<2&&this.scriptEvaluationError("OP_CHECKSEQUENCEVERIFY lock time is unsatisfied.")}break;case m.OP_NOP9:case m.OP_NOP10:break;case m.OP_VERIF:case m.OP_VERNOTIF:if($=!1,t){if(this.stack.length<1&&this.scriptEvaluationError("OP_VERIF and OP_VERNOTIF require at least one item on the stack when they are used!"),s=this.popStack(),s.length===4){const T=this.transactionVersion;a=[T&255,T>>>8&255,T>>>16&255,T>>>24&255],$=Eu(s,a)}i===m.OP_VERNOTIF&&($=!$)}this.ifStack.push($),this.elseStack.push(!1);break;case m.OP_IF:case m.OP_NOTIF:$=!1,t&&(this.stack.length<1&&this.scriptEvaluationError("OP_IF and OP_NOTIF require at least one item on the stack when they are used!"),o=this.popStack(),this.hasFlag("MINIMALIF")&&o.length>0&&!(o.length===1&&o[0]===1)&&this.scriptEvaluationError("OP_IF and OP_NOTIF require minimal truth values."),$=this.castToBool(o),i===m.OP_NOTIF&&($=!$)),this.ifStack.push($),this.elseStack.push(!1);break;case m.OP_ELSE:this.ifStack.length===0&&this.scriptEvaluationError("OP_ELSE requires a preceeding OP_IF."),this.hasExplicitFlags()&&this.isAfterGenesis()&&this.elseStack.at(-1)===!0&&this.scriptEvaluationError("OP_ELSE may only be used once for each OP_IF or OP_NOTIF after Genesis."),this.elseStack[this.elseStack.length-1]=!0,this.ifStack[this.ifStack.length-1]=this.ifStack.at(-1)!==!0;break;case m.OP_ENDIF:this.ifStack.length===0&&this.scriptEvaluationError("OP_ENDIF requires a preceeding OP_IF."),this.ifStack.pop(),this.elseStack.pop();break;case m.OP_VERIFY:this.stack.length<1&&this.scriptEvaluationError("OP_VERIFY requires at least one item to be on the stack."),s=this.stackTop(),$=this.castToBool(s),$||this.scriptEvaluationError("OP_VERIFY requires the top stack value to be truthy."),this.popStack();break;case m.OP_RETURN:this.hasExplicitFlags()&&!this.isAfterGenesis()&&this.scriptEvaluationError("OP_RETURN is invalid before Genesis."),this.ifStack.length>0?this.returningFromConditional=!0:(this.context==="UnlockingScript"?this.programCounter=this.unlockingScript.chunks.length:this.programCounter=this.lockingScript.chunks.length,this.programCounter--);break;case m.OP_TOALTSTACK:this.stack.length<1&&this.scriptEvaluationError("OP_TOALTSTACK requires at oeast one item to be on the stack."),this.pushAltStack(this.popStack());break;case m.OP_FROMALTSTACK:this.altStack.length<1&&this.scriptEvaluationError("OP_FROMALTSTACK requires at least one item to be on the stack."),this.pushStack(this.popAltStack());break;case m.OP_2DROP:this.stack.length<2&&this.scriptEvaluationError("OP_2DROP requires at least two items to be on the stack."),this.popStack(),this.popStack();break;case m.OP_2DUP:this.stack.length<2&&this.scriptEvaluationError("OP_2DUP requires at least two items to be on the stack."),s=this.stackTop(-2),a=this.stackTop(-1),this.pushStackCopy(s),this.pushStackCopy(a);break;case m.OP_3DUP:this.stack.length<3&&this.scriptEvaluationError("OP_3DUP requires at least three items to be on the stack."),s=this.stackTop(-3),a=this.stackTop(-2),c=this.stackTop(-1),this.pushStackCopy(s),this.pushStackCopy(a),this.pushStackCopy(c);break;case m.OP_2OVER:this.stack.length<4&&this.scriptEvaluationError("OP_2OVER requires at least four items to be on the stack."),s=this.stackTop(-4),a=this.stackTop(-3),this.pushStackCopy(s),this.pushStackCopy(a);break;case m.OP_2ROT:{this.stack.length<6&&this.scriptEvaluationError("OP_2ROT requires at least six items to be on the stack.");const T=this.popStack(),E=this.popStack(),W=this.popStack(),Pe=this.popStack(),yt=this.popStack(),En=this.popStack();this.pushStack(Pe),this.pushStack(W),this.pushStack(E),this.pushStack(T),this.pushStack(En),this.pushStack(yt);break}case m.OP_2SWAP:{this.stack.length<4&&this.scriptEvaluationError("OP_2SWAP requires at least four items to be on the stack.");const T=this.popStack(),E=this.popStack(),W=this.popStack(),Pe=this.popStack();this.pushStack(E),this.pushStack(T),this.pushStack(Pe),this.pushStack(W);break}case m.OP_IFDUP:this.stack.length<1&&this.scriptEvaluationError("OP_IFDUP requires at least one item to be on the stack."),s=this.stackTop(),this.castToBool(s)&&this.pushStackCopy(s);break;case m.OP_DEPTH:this.pushStack(new g(this.stack.length).toScriptNum());break;case m.OP_DROP:this.stack.length<1&&this.scriptEvaluationError("OP_DROP requires at least one item to be on the stack."),this.popStack();break;case m.OP_DUP:this.stack.length<1&&this.scriptEvaluationError("OP_DUP requires at least one item to be on the stack."),this.pushStackCopy(this.stackTop());break;case m.OP_NIP:this.stack.length<2&&this.scriptEvaluationError("OP_NIP requires at least two items to be on the stack."),a=this.popStack(),this.popStack(),this.pushStack(a);break;case m.OP_OVER:this.stack.length<2&&this.scriptEvaluationError("OP_OVER requires at least two items to be on the stack."),this.pushStackCopy(this.stackTop(-2));break;case m.OP_PICK:case m.OP_ROLL:{this.stack.length<2&&this.scriptEvaluationError(`${m[i]} requires at least two items to be on the stack.`),d=this.readScriptNumber(this.popStack());const T=d.toBigInt();(T<0n||T>=BigInt(this.stack.length))&&this.scriptEvaluationError(`${m[i]} requires the top stack element to be 0 or a positive number less than the current size of the stack.`);const E=Number(T),W=this.stack[this.stack.length-1-E];i===m.OP_ROLL?(this.stack.splice(this.stack.length-1-E,1),this.stackMem-=W.length,this.pushStack(W)):this.pushStackCopy(W);break}case m.OP_ROT:this.stack.length<3&&this.scriptEvaluationError("OP_ROT requires at least three items to be on the stack."),f=this.popStack(),l=this.popStack(),u=this.popStack(),this.pushStack(l),this.pushStack(f),this.pushStack(u);break;case m.OP_SWAP:this.stack.length<2&&this.scriptEvaluationError("OP_SWAP requires at least two items to be on the stack."),l=this.popStack(),u=this.popStack(),this.pushStack(l),this.pushStack(u);break;case m.OP_TUCK:this.stack.length<2&&this.scriptEvaluationError("OP_TUCK requires at least two items to be on the stack."),s=this.stackTop(-1),this.ensureStackMem(s.length),this.stack.splice(-2,0,s.slice()),this.stackMem+=s.length;break;case m.OP_SIZE:this.stack.length<1&&this.scriptEvaluationError("OP_SIZE requires at least one item to be on the stack."),this.pushStack(new g(this.stackTop().length).toScriptNum());break;case m.OP_AND:case m.OP_OR:case m.OP_XOR:{this.stack.length<2&&this.scriptEvaluationError(`${m[i]} requires at least two items on the stack.`),a=this.popStack(),s=this.popStack(),s.length!==a.length&&this.scriptEvaluationError(`${m[i]} requires the top two stack items to be the same size.`);const T=new Array(s.length);for(let E=0;E<s.length;E++)i===m.OP_AND?T[E]=s[E]&a[E]:i===m.OP_OR?T[E]=s[E]|a[E]:T[E]=s[E]^a[E];this.pushStack(T);break}case m.OP_INVERT:{this.stack.length<1&&this.scriptEvaluationError("OP_INVERT requires at least one item to be on the stack."),o=this.popStack();const T=new Array(o.length);for(let E=0;E<o.length;E++)T[E]=~o[E]&255;this.pushStack(T);break}case m.OP_LSHIFT:case m.OP_RSHIFT:{this.stack.length<2&&this.scriptEvaluationError(`${m[i]} requires at least two items to be on the stack.`),p=this.readScriptNumber(this.popStack()),s=this.popStack();const T=p.toBigInt();if(T<0n&&this.scriptEvaluationError(`${m[i]} requires the top item on the stack not to be negative.`),s.length===0){this.pushStack([]);break}h=new g(s);let E;if(i===m.OP_LSHIFT){E=h.ushln(T);const Pe=new g(1).ushln(s.length*8).isubn(1);E=E.iand(Pe)}else E=h.ushrn(T);const W=E.toArray("be",s.length);this.pushStack(W);break}case m.OP_EQUAL:case m.OP_EQUALVERIFY:this.stack.length<2&&this.scriptEvaluationError(`${m[i]} requires at least two items to be on the stack.`),a=this.popStack(),s=this.popStack(),$=Eu(s,a),this.pushStack($?[1]:[]),i===m.OP_EQUALVERIFY&&($||this.scriptEvaluationError("OP_EQUALVERIFY requires the top two stack items to be equal."),this.popStack());break;case m.OP_1ADD:case m.OP_1SUB:case m.OP_2MUL:case m.OP_2DIV:case m.OP_NEGATE:case m.OP_ABS:case m.OP_NOT:case m.OP_0NOTEQUAL:switch(this.stack.length<1&&this.scriptEvaluationError(`${m[i]} requires at least one item to be on the stack.`),d=this.readScriptNumber(this.popStack()),i){case m.OP_1ADD:d=d.add(new g(1));break;case m.OP_1SUB:d=d.sub(new g(1));break;case m.OP_2MUL:d=d.mul(new g(2));break;case m.OP_2DIV:d=d.div(new g(2));break;case m.OP_NEGATE:d=d.neg();break;case m.OP_ABS:d.isNeg()&&(d=d.neg());break;case m.OP_NOT:d=new g(d.cmpn(0)===0?1:0);break;case m.OP_0NOTEQUAL:d=new g(d.cmpn(0)===0?0:1);break}this.pushStack(d.toScriptNum());break;case m.OP_ADD:case m.OP_SUB:case m.OP_MUL:case m.OP_DIV:case m.OP_MOD:case m.OP_BOOLAND:case m.OP_BOOLOR:case m.OP_NUMEQUAL:case m.OP_NUMEQUALVERIFY:case m.OP_NUMNOTEQUAL:case m.OP_LESSTHAN:case m.OP_GREATERTHAN:case m.OP_LESSTHANOREQUAL:case m.OP_GREATERTHANOREQUAL:case m.OP_MIN:case m.OP_MAX:{this.stack.length<2&&this.scriptEvaluationError(`${m[i]} requires at least two items to be on the stack.`),a=this.popStack(),s=this.popStack(),p=this.readScriptNumber(a),h=this.readScriptNumber(s);let T=0;switch(i){case m.OP_MUL:T=h.byteLength()+p.byteLength();break;case m.OP_ADD:case m.OP_SUB:T=Math.max(h.byteLength(),p.byteLength())+1;break;default:T=Math.max(h.byteLength(),p.byteLength())}this.ensureStackMem(T);let E=new g(0);switch(i){case m.OP_ADD:E=h.add(p);break;case m.OP_SUB:E=h.sub(p);break;case m.OP_MUL:E=h.mul(p);break;case m.OP_DIV:p.cmpn(0)===0&&this.scriptEvaluationError("OP_DIV cannot divide by zero!"),E=h.div(p);break;case m.OP_MOD:p.cmpn(0)===0&&this.scriptEvaluationError("OP_MOD cannot divide by zero!"),E=h.mod(p);break;case m.OP_BOOLAND:E=new g(h.cmpn(0)!==0&&p.cmpn(0)!==0?1:0);break;case m.OP_BOOLOR:E=new g(h.cmpn(0)!==0||p.cmpn(0)!==0?1:0);break;case m.OP_NUMEQUAL:E=new g(h.cmp(p)===0?1:0);break;case m.OP_NUMEQUALVERIFY:E=new g(h.cmp(p)===0?1:0);break;case m.OP_NUMNOTEQUAL:E=new g(h.cmp(p)===0?0:1);break;case m.OP_LESSTHAN:E=new g(h.cmp(p)<0?1:0);break;case m.OP_GREATERTHAN:E=new g(h.cmp(p)>0?1:0);break;case m.OP_LESSTHANOREQUAL:E=new g(h.cmp(p)<=0?1:0);break;case m.OP_GREATERTHANOREQUAL:E=new g(h.cmp(p)>=0?1:0);break;case m.OP_MIN:E=h.cmp(p)<0?h:p;break;case m.OP_MAX:E=h.cmp(p)>0?h:p;break}this.pushStack(E.toScriptNum()),i===m.OP_NUMEQUALVERIFY&&(this.castToBool(this.stackTop())||this.scriptEvaluationError("OP_NUMEQUALVERIFY requires the top stack item to be truthy."),this.popStack());break}case m.OP_WITHIN:this.stack.length<3&&this.scriptEvaluationError("OP_WITHIN requires at least three items to be on the stack."),_=this.readScriptNumber(this.popStack()),p=this.readScriptNumber(this.popStack()),h=this.readScriptNumber(this.popStack()),$=h.cmp(p)>=0&&h.cmp(_)<0,this.pushStack($?[1]:[]);break;case m.OP_RIPEMD160:case m.OP_SHA1:case m.OP_SHA256:case m.OP_HASH160:case m.OP_HASH256:{this.stack.length<1&&this.scriptEvaluationError(`${m[i]} requires at least one item to be on the stack.`),o=this.popStack();let T=[];i===m.OP_RIPEMD160?T=wg(o):i===m.OP_SHA1?T=Sg(o):i===m.OP_SHA256?T=Nt(o):i===m.OP_HASH160?T=Rl(o):i===m.OP_HASH256&&(T=Ue(o)),this.pushStack(T);break}case m.OP_CODESEPARATOR:this.lastCodeSeparator=this.programCounter;break;case m.OP_CHECKSIG:case m.OP_CHECKSIGVERIFY:{if(this.stack.length<2&&this.scriptEvaluationError(`${m[i]} requires at least two items to be on the stack.`),J=this.popStack(),A=this.popStack(),(!this.checkSignatureEncoding(A)||!this.checkPublicKeyEncoding(J))&&this.scriptEvaluationError(`${m[i]} requires correct encoding for the public key and signature.`),k=!1,A.length>0)try{se=this.parseChecksigSignature(A);let E=(this.context==="UnlockingScript"?this.unlockingScript:this.lockingScript).chunks.slice(this.lastCodeSeparator===null?0:this.lastCodeSeparator+1);this.context==="UnlockingScript"&&(E=E.concat(this.lockingScript.chunks)),z=new oe(E),z.findAndDelete(new oe().writeBin(A)),le=Ke.fromDER(J),k=this.verifySignature(se,le,z)}catch{k=!1}!k&&this.hasFlag("NULLFAIL")&&A.length>0&&this.scriptEvaluationError(`${m[i]} requires failing signatures to be empty.`),this.pushStack(k?[1]:[]),i===m.OP_CHECKSIGVERIFY&&(k||this.scriptEvaluationError("OP_CHECKSIGVERIFY requires that a valid signature is provided."),this.popStack());break}case m.OP_CHECKMULTISIG:case m.OP_CHECKMULTISIGVERIFY:{Y=1,this.stack.length<Y&&this.scriptEvaluationError(`${m[i]} requires at least 1 item for nKeys.`);const E=this.readScriptNumber(this.stackTop(-Y)).toBigInt(),W=this.hasExplicitFlags()&&!this.isAfterGenesis()?BigInt(_0):y0;(E<0n||E>W)&&this.scriptEvaluationError(`${m[i]} requires a key count between 0 and ${W.toString()}.`),Oe=Number(E);const Pe=Oe;Te=++Y,Y+=Oe,this.stack.length<Y&&this.scriptEvaluationError(`${m[i]} stack too small for nKeys and keys. Need ${Y}, have ${this.stack.length}.`);const En=this.readScriptNumber(this.stackTop(-Y)).toBigInt();(En<0n||En>BigInt(Oe))&&this.scriptEvaluationError(`${m[i]} requires the number of signatures to be no greater than the number of keys.`),Ve=Number(En);const Fm=Ve;rt=++Y,Y+=Ve,this.stack.length<Y&&this.scriptEvaluationError(`${m[i]} stack too small for N, keys, M, sigs, and dummy. Need ${Y}, have ${this.stack.length}.`);const Hm=(this.context==="UnlockingScript"?this.unlockingScript:this.lockingScript).chunks.slice(this.lastCodeSeparator===null?0:this.lastCodeSeparator+1);z=new oe(Hm);let eu=!1;for(let Po=0;Po<Ve;Po++)A=this.stackTop(-rt-Po),A.length>0&&(eu=!0),z.findAndDelete(new oe().writeBin(A));for(k=!0;k&&Ve>0;){if(Oe===0){k=!1;break}if(A=this.stackTop(-rt),J=this.stackTop(-Te),(!this.checkSignatureEncoding(A)||!this.checkPublicKeyEncoding(J))&&this.scriptEvaluationError(`${m[i]} requires correct encoding for the public key and signature.`),Zt=!1,A.length>0)try{se=this.parseChecksigSignature(A),le=Ke.fromDER(J),Zt=this.verifySignature(se,le,z)}catch{Zt=!1}Zt&&(rt++,Ve--),Te++,Oe--,Ve>Oe&&(k=!1)}!k&&this.hasFlag("NULLFAIL")&&eu&&this.scriptEvaluationError(`${m[i]} requires failing signatures to be empty.`);let tu=1+Pe+1+Fm+1-1;for(;tu>0;)this.popStack(),tu--;this.stack.length<1&&this.scriptEvaluationError(`${m[i]} requires an extra item (dummy) to be on the stack.`);const Zm=this.popStack();this.shouldEnforceNullDummy()&&Zm.length>0&&this.scriptEvaluationError(`${m[i]} requires the extra stack item (dummy) to be empty.`),this.pushStack(k?[1]:[]),i===m.OP_CHECKMULTISIGVERIFY&&(k||this.scriptEvaluationError("OP_CHECKMULTISIGVERIFY requires that a sufficient number of valid signatures are provided."),this.popStack());break}case m.OP_CAT:{this.stack.length<2&&this.scriptEvaluationError("OP_CAT requires at least two items to be on the stack."),a=this.popStack(),s=this.popStack();const T=s.concat(a);T.length>this.maxPushSize()&&this.scriptEvaluationError(`It's not currently possible to push data larger than ${this.maxPushSize()} bytes.`),this.pushStack(T);break}case m.OP_SPLIT:{this.stack.length<2&&this.scriptEvaluationError("OP_SPLIT requires at least two items to be on the stack.");const T=this.popStack(),E=this.popStack(),W=this.readScriptNumber(T).toBigInt();(W<0n||W>BigInt(E.length))&&this.scriptEvaluationError("OP_SPLIT requires the first stack item to be a non-negative number less than or equal to the size of the second-from-top stack item.");const Pe=Number(W);this.pushStack(E.slice(0,Pe)),this.pushStack(E.slice(Pe));break}case m.OP_NUM2BIN:{this.stack.length<2&&this.scriptEvaluationError("OP_NUM2BIN requires at least two items to be on the stack.");const T=this.readScriptNumber(this.popStack()).toBigInt();(T>BigInt(this.maxPushSize())||T<0n)&&this.scriptEvaluationError(`It's not currently possible to push data larger than ${this.maxPushSize()} bytes or negative size.`),O=Number(T);let E=this.popStack();if(E=fu(E),E.length>O&&this.scriptEvaluationError("OP_NUM2BIN requires that the size expressed in the top stack item is large enough to hold the value expressed in the second-from-top stack item."),E.length===O){this.pushStack(E);break}const W=new Array(O).fill(0);let Pe=0;E.length>0&&(Pe=E.at(-1)&128,E[E.length-1]&=127);for(let yt=0;yt<E.length;yt++)W[yt]=E[yt];Pe!==0&&(W[O-1]|=128),this.pushStack(W);break}case m.OP_BIN2NUM:{this.stack.length<1&&this.scriptEvaluationError("OP_BIN2NUM requires at least one item to be on the stack."),s=this.popStack();const T=fu(s);S0(T)||this.scriptEvaluationError("OP_BIN2NUM requires that the resulting number is valid."),this.pushStack(T);break}default:this.scriptEvaluationError(`Invalid opcode ${i} (pc=${this.programCounter}).`)}}return this.returningFromConditional&&this.ifStack.length===0?this.programCounter=e.chunks.length:this.programCounter++,this.hasExplicitFlags()&&!this.isAfterGenesis()&&this.stack.length+this.altStack.length>Iu&&this.scriptEvaluationError(`Stack item count has exceeded ${Iu}.`),!0}validate(){const e=Wl();return e?.verifySpendSync!==void 0&&(e.isReady?.()??!0)&&(e.shouldVerifySpend?.(this)??!0)?(e.verifySpendSync(this)||this.scriptEvaluationError("The selected script-verification backend rejected the spend."),!0):this.validateJavaScript()}validateJavaScript(){this.reset(),this.shouldEnforceSigPushOnly()&&!this.unlockingScript.isPushOnly()&&this.scriptEvaluationError("Unlocking scripts can only contain push operations, and no other opcodes.");const e=this.lockingScript,n=this.hasFlag("P2SH")&&!this.isAfterGenesis()&&this.isP2SHLockingScript(this.lockingScript);n&&!this.unlockingScript.isPushOnly()&&this.scriptEvaluationError("P2SH unlocking scripts can only contain push operations."),this.runScript("UnlockingScript");const i=this.stack.map(t=>t.slice());this.runScript("LockingScript"),this.requireTruthyTopStack();try{if(n){i.length===0&&this.scriptEvaluationError("P2SH evaluation requires a redeem script on the stack.");const t=i.pop();if(t===void 0)return this.scriptEvaluationError("P2SH evaluation requires a redeem script on the stack."),!1;this.setStack(i);const o=oe.fromBinary(t);this.lockingScript=new Jt(o.chunks),this.runScript("LockingScript")}}finally{this.lockingScript=e}return this.shouldEnforceCleanStack()&&this.stack.length!==1&&this.scriptEvaluationError(`The clean stack rule requires exactly one item to be on the stack after script execution, found ${this.stack.length}.`),this.requireTruthyTopStack(),!0}async validateWith(e){return e.shouldVerifySpend?.(this)===!1?this.validateJavaScript():await e.verifySpend(this)}toTransactionUint8Array(){const e={sourceTXID:this.sourceTXID,sourceOutputIndex:this.sourceOutputIndex,unlockingScript:this.unlockingScript,sequence:this.inputSequence},n=this.allInputs??[...this.otherInputs.slice(0,this.inputIndex),e,...this.otherInputs.slice(this.inputIndex)];if(this.inputIndex<0||this.inputIndex>=n.length)throw new RangeError("Spend input index is out of range");const i=new Ge;i.writeUInt32LE(this.transactionVersion),i.writeVarIntNum(n.length);for(let t=0;t<n.length;t++){const o=t===this.inputIndex?e:n[t],s=o.sourceTXID??o.sourceTransaction?.id("hex");if(s===void 0)throw new Error(`Input ${t} is missing its source transaction ID`);if(o.unlockingScript===void 0)throw new Error(`Input ${t} is missing its unlocking script`);i.writeReverse(ee(s,"hex")),i.writeUInt32LE(o.sourceOutputIndex);const a=o.unlockingScript.toUint8Array();i.writeVarIntNum(a.length),i.write(a),i.writeUInt32LE(o.sequence??4294967295)}i.writeVarIntNum(this.outputs.length);for(const t of this.outputs){i.writeUInt64LE(t.satoshis??0);const o=t.lockingScript.toUint8Array();i.writeVarIntNum(o.length),i.write(o)}return i.writeUInt32LE(this.lockTime),i.toUint8Array()}runScript(e){this.context=e,this.programCounter=0,this.ifStack=[],this.elseStack=[],this.returningFromConditional=!1,this.clearAltStack(),this.lastCodeSeparator=null;const n=e==="UnlockingScript"?this.unlockingScript:this.lockingScript;for(this.hasExplicitFlags()&&!this.isAfterGenesis()&&n.toUint8Array().length>Su&&this.scriptEvaluationError(`Script size exceeds ${Su} bytes.`);this.programCounter<n.chunks.length;)this.step();this.ifStack.length>0&&this.scriptEvaluationError("Every OP_IF, OP_NOTIF, or OP_ELSE must be terminated with OP_ENDIF prior to the end of the script."),this.ifStack=[],this.elseStack=[],this.clearAltStack(),this.lastCodeSeparator=null}isP2SHLockingScript(e){const n=e.chunks;return n.length===3&&n[0].op===m.OP_HASH160&&n[1].op===20&&Array.isArray(n[1].data)&&n[1].data.length===20&&n[2].op===m.OP_EQUAL}requireTruthyTopStack(){this.stack.length===0?this.scriptEvaluationError("The top stack element must be truthy after script evaluation (stack is empty)."):this.castToBool(this.stackTop())||this.scriptEvaluationError("The top stack element must be truthy after script evaluation.")}castToBool(e){if(e.length===0)return!1;for(let n=0;n<e.length;n++)if(e[n]!==0)return!(n===e.length-1&&e[n]===128);return!1}scriptEvaluationError(e){throw new p0({message:e,txid:this.sourceTXID,outputIndex:this.sourceOutputIndex,context:this.context,programCounter:this.programCounter,stackState:this.stack,altStackState:this.altStack,ifStackState:this.ifStack,stackMem:this.stackMem,altStackMem:this.altStackMem})}}function E0(r,e){let n=j.SIGHASH_FORKID;return r==="all"&&(n|=j.SIGHASH_ALL),r==="none"&&(n|=j.SIGHASH_NONE),r==="single"&&(n|=j.SIGHASH_SINGLE),e&&(n|=j.SIGHASH_ANYONECANPAY),n}function T0(r,e,n,i){const t=r.inputs[e],o=t.sourceTXID??t.sourceTransaction?.id("hex");if(o==null||o===void 0)throw new Error("The input sourceTXID or sourceTransaction is required for transaction signing.");if(o==="")throw new Error("The input sourceTXID or sourceTransaction is required for transaction signing.");const s=n??t.sourceTransaction?.outputs[t.sourceOutputIndex].satoshis;if(s==null||s===void 0)throw new Error("The sourceSatoshis or input sourceTransaction is required for transaction signing.");const a=i??t.sourceTransaction?.outputs[t.sourceOutputIndex].lockingScript;if(a==null)throw new Error("The lockingScript or input sourceTransaction is required for transaction signing.");return{sourceTXID:o,sourceSatoshis:s,lockingScript:a,allInputs:r.inputs,get otherInputs(){return r.inputs.filter((c,u)=>u!==e)}}}function O0(r){const{tx:e,inputIndex:n,signatureScope:i,sourceTXID:t,sourceSatoshis:o,lockingScript:s,otherInputs:a,allInputs:c,inputSequence:u}=r,l=e.inputs[n];return j.format({sourceTXID:t,sourceOutputIndex:ri(l.sourceOutputIndex,"input.sourceOutputIndex must have value"),sourceSatoshis:o,transactionVersion:e.version,otherInputs:a??[],allInputs:c,inputIndex:n,outputs:e.outputs,inputSequence:u??ri(l.sequence,"input.sequence must have value"),subscript:s,lockTime:e.lockTime,scope:i,cache:e.getSignatureHashCache()})}class Xl{lock(e){let n;if(typeof e=="string"){const i=Gl(e);if(i.prefix[0]!==0&&i.prefix[0]!==111)throw new Error("only P2PKH is supported");n=i.data}else n=e;if(n.length!==20)throw new Error("P2PKH hash length must be 20 bytes");return new Jt([{op:m.OP_DUP},{op:m.OP_HASH160},{op:n.length,data:n},{op:m.OP_EQUALVERIFY},{op:m.OP_CHECKSIG}])}unlock(e,n="all",i=!1,t,o){return{sign:async(s,a)=>{const c=E0(n,i),u=T0(s,a,t,o);t=u.sourceSatoshis,o=u.lockingScript;const l=O0({tx:s,inputIndex:a,signatureScope:c,sourceTXID:u.sourceTXID,sourceSatoshis:u.sourceSatoshis,lockingScript:u.lockingScript,allInputs:u.allInputs}),f=Nt(l),d=wu("signDigest"),h=d===void 0?e.sign(f):mt.fromDER(Array.from(xu("signDigest",await d.signDigest(Uint8Array.from(e.toArray("be",32)),Uint8Array.from(Nt(f)))))),_=new j(h.r,h.s,c).toChecksigFormat(),w=wu("publicKeyFromPrivate"),O=w===void 0?e.toPublicKey().encode(!0):Ke.fromDER(Array.from(xu("publicKeyFromPrivate",await w.publicKeyFromPrivate(Uint8Array.from(e.toArray("be",32))),33))).encode(!0);return new Qr([{op:_.length,data:_},{op:O.length,data:O}])},estimateLength:async()=>108}}}class P0{value;constructor(e){this.value=e}async computeFee(e){const n=o=>o>4294967296?9:o>65536?5:o>253?3:1;let i=4;i+=n(e.inputs.length);for(let o=0;o<e.inputs.length;o++){const s=e.inputs[o];i+=40;let a;if(typeof s.unlockingScript=="object")a=s.unlockingScript.toBinary().length;else if(typeof s.unlockingScriptTemplate=="object")a=await s.unlockingScriptTemplate.estimateLength(e,o);else throw new TypeError("All inputs must have an unlocking script or an unlocking script template for sat/kb fee computation.");i+=n(a),i+=a}i+=n(e.outputs.length);for(const o of e.outputs){i+=8;const s=o.lockingScript.toBinary().length;i+=n(s),i+=s}return i+=4,Math.ceil(i/1e3*this.value)}}class kt extends P0{static ARC_POLICY_URL="https://arc.gorillapool.io/v1/policy";static instance=null;cachedRate=null;cacheTimestamp=0;cacheValidityMs;constructor(e=300*1e3){super(100),this.cacheValidityMs=e}static getInstance(e=300*1e3){return kt.instance||(kt.instance=new kt(e)),kt.instance}async fetchFeeRate(){const e=Date.now();if(this.cachedRate!==null&&e-this.cacheTimestamp<this.cacheValidityMs)return this.cachedRate;try{const n=await fetch(kt.ARC_POLICY_URL);if(!n.ok)throw new Error(`HTTP ${n.status}: ${n.statusText}`);const i=await n.json();if(!i.policy?.miningFee||typeof i.policy.miningFee.satoshis!="number"||typeof i.policy.miningFee.bytes!="number")throw new Error("Invalid policy response format");const t=i.policy.miningFee.satoshis/i.policy.miningFee.bytes*1e3;return this.cachedRate=t,this.cacheTimestamp=e,t}catch(n){return this.cachedRate!==null?(console.warn("Failed to fetch live fee rate, using cached value:",n),this.cachedRate):(console.warn("Failed to fetch live fee rate, using default 100 sat/kb:",n),100)}}async computeFee(e){const n=await this.fetchFeeRate();return this.value=n,super.computeFee(e)}}function z0(r,e,n,i){return new Promise((t,o)=>{const s=r.request(e,n,a=>{let c="";a.on("data",u=>{c+=u}),a.on("end",()=>{const u=a.statusCode>=200&&a.statusCode<=299,l=a.headers["content-type"],f=c!==""&&typeof l=="string"&&l.startsWith("application/json")?JSON.parse(c):c;t({status:a.statusCode,statusText:a.statusMessage,ok:u,data:f})})});s.on("error",a=>{o(a)}),n.data!==null&&n.data!==void 0&&s.write(i(n.data)),s.end()})}class A0{https;constructor(e){this.https=e}async request(e,n){return await z0(this.https,e,n,i=>JSON.stringify(i))}}class Tu{fetch;constructor(e){this.fetch=e}async request(e,n){const i={method:n.method,headers:n.headers,body:JSON.stringify(n.data)},t=await this.fetch(e,i),s=t.headers.get("Content-Type")?.startsWith("application/json")??!1?await t.json():await t.text();return{ok:t.ok,status:t.status,statusText:t.statusText,data:s}}}function Ko(){const r={async request(...e){throw new Error("No method available to perform HTTP request")}};if(globalThis.window!==void 0&&typeof globalThis.window.fetch=="function")return new Tu(globalThis.window.fetch.bind(globalThis.window));if(typeof globalThis.fetch=="function")return new Tu(globalThis.fetch.bind(globalThis));if(typeof require>"u")return r;try{const e=require("node:https");return new A0(e)}catch{return r}}function Ou(){return`ts-sdk-${G(Pt(16))}`}class N0{URL;apiKey;deploymentId;callbackUrl;callbackToken;headers;httpClient;constructor(e,n){if(this.URL=e,typeof n=="string")this.apiKey=n,this.httpClient=Ko(),this.deploymentId=Ou(),this.callbackToken=void 0,this.callbackUrl=void 0;else{const i=n??{},{apiKey:t,deploymentId:o,httpClient:s,callbackToken:a,callbackUrl:c,headers:u}=i;this.apiKey=t,this.httpClient=s??Ko(),this.deploymentId=o??Ou(),this.callbackToken=a,this.callbackUrl=c,this.headers=u}}requestHeaders(){const e={"Content-Type":"application/json","XDeployment-ID":this.deploymentId};if(this.apiKey!=null&&this.apiKey!==""&&(e.Authorization=`Bearer ${this.apiKey}`),this.callbackUrl!=null&&this.callbackUrl!==""&&(e["X-CallbackUrl"]=this.callbackUrl),this.callbackToken!=null&&this.callbackToken!==""&&(e["X-CallbackToken"]=this.callbackToken),this.headers!=null)for(const n in this.headers)e[n]=this.headers[n];return e}async broadcast(e){let n;try{n=e.toHexEF()}catch(t){if(t.message==="All inputs must have source transactions when serializing to EF format")n=e.toHex();else throw t}const i={method:"POST",headers:this.requestHeaders(),data:{rawTx:n}};try{const t=await this.httpClient.request(`${this.URL}/v1/tx`,i);if(t.ok){const{txid:o,extraInfo:s,txStatus:a,competingTxs:c}=t.data,u=["DOUBLE_SPEND_ATTEMPTED","REJECTED","INVALID","MALFORMED","MINED_IN_STALE_BLOCK"],l=s?.toUpperCase().includes("ORPHAN")||a?.toUpperCase().includes("ORPHAN");if(u.includes(a?.toUpperCase())||l){const d={status:"error",code:a??"UNKNOWN",txid:o,description:`${a??""} ${s??""}`.trim()};return c!=null&&(d.more={competingTxs:c}),d}const f={status:"success",txid:o,message:`${a} ${s}`};return c!=null&&(f.competingTxs=c),f}else{const o=typeof t.status,s={status:"error",code:o==="number"||o==="string"?t.status.toString():"ERR_UNKNOWN",description:"Unknown error"};let a=t.data;if(typeof a=="string")try{a=JSON.parse(t.data)}catch{}return typeof a=="object"&&(a!==null&&(s.more=a),a!=null&&typeof a.txid=="string"&&(s.txid=a.txid),a!=null&&"detail"in a&&typeof a.detail=="string"&&(s.description=a.detail)),s}}catch(t){return{status:"error",code:"500",description:typeof t.message=="string"?t.message:"Internal Server Error"}}}async broadcastMany(e){const n=e.map(t=>{try{return{rawTx:t.toHexEF()}}catch(o){if(o.message==="All inputs must have source transactions when serializing to EF format")return{rawTx:t.toHex()};throw o}}),i={method:"POST",headers:this.requestHeaders(),data:n};try{return(await this.httpClient.request(`${this.URL}/v1/txs`,i)).data}catch(t){const o={status:"error",code:"500",description:typeof t.message=="string"?t.message:"Internal Server Error"};return e.map(()=>o)}}}function U0(r=!1,e={}){return new N0(r?"https://testnet.arc.gorillapool.io":"https://arc.gorillapool.io",e)}class D0{network;apiKey;URL;httpClient;constructor(e="main",n={}){const{apiKey:i,httpClient:t}=n;this.network=e,this.URL=`https://api.whatsonchain.com/v1/bsv/${e}`,this.httpClient=t??Ko(),this.apiKey=i??""}async isValidRootForHeight(e,n){const i={method:"GET",headers:this.getHttpHeaders()},t=await this.httpClient.request(`${this.URL}/block/${n}/header`,i);if(t.ok){const{merkleroot:o}=t.data;return o===e}else{if(t.status===404)return!1;throw new Error(`Failed to verify merkleroot for height ${n} because of an error: ${JSON.stringify(t.data)} `)}}async currentHeight(){try{const e={method:"GET",headers:this.getHttpHeaders()},n=await this.httpClient.request(`${this.URL}/block/headers`,e);if(n.ok)return n.data[0].height;throw new Error(`Failed to get current height because of an error: ${JSON.stringify(n.data)} `)}catch(e){throw new Error(`Failed to get current height because of an error: ${e instanceof Error?e.message:String(e)}`)}}getHttpHeaders(){const e={Accept:"application/json"};return typeof this.apiKey=="string"&&this.apiKey.trim()!==""&&(e.Authorization=this.apiKey),e}}function R0(){return new D0}class It{blockHeight;path;static fromHex(e){return It.fromBinary(ee(e,"hex"))}static fromReader(e,n=!0){const i=e.readVarIntNum(),t=e.readUInt8(),o=new Array(t).fill(null).map(()=>[]);let s,a,c;for(let u=0;u<t;u++){for(c=e.readVarIntNum();c>0;){a=e.readVarIntNum(),s=e.readUInt8();const l={offset:a};(s&1)===1?l.duplicate=!0:((s&2)!==0&&(l.txid=!0),l.hash=G(e.read(32).reverse())),(!Array.isArray(o[u])||o[u].length===0)&&(o[u]=[]),o[u].push(l),c--}o[u].sort((l,f)=>l.offset-f.offset)}return new It(i,o,n)}static fromBinary(e){const n=new me(e);return It.fromReader(n)}static fromCoinbaseTxidAndHeight(e,n){return new It(n,[[{offset:0,hash:e,txid:!0}]])}constructor(e,n,i=!0){this.blockHeight=e,this.path=n;const t=new Array(this.path.length).fill(0).map(()=>new Set);this.path.forEach((s,a)=>{if(s.length===0&&a===0)throw new Error(`Empty level at height: ${a}`);const c=new Set;s.forEach(u=>{if(c.has(u.offset))throw new Error(`Duplicate offset: ${u.offset}, at height: ${a}`);if(c.add(u.offset),a===0){if(u.duplicate!==!0)for(let l=1;l<this.path.length;l++)t[l].add(u.offset>>l^1)}else if(i&&!t[a].has(u.offset))throw new Error(`Invalid offset: ${u.offset}, at height: ${a}, with legal offsets: ${Array.from(t[a]).join(", ")}`)})});let o;this.path[0].forEach((s,a)=>{if(a===0&&(o=this.computeRoot(s.hash)),o!==this.computeRoot(s.hash))throw new Error("Mismatched roots")})}toWriter(e){e.writeVarIntNum(this.blockHeight);const n=this.path.length;e.writeUInt8(n);for(let i=0;i<n;i++){const t=Object.keys(this.path[i]).length;e.writeVarIntNum(t);for(const o of this.path[i]){e.writeVarIntNum(o.offset);let s=0;o?.duplicate===!0&&(s|=1),o?.txid!==void 0&&o.txid!==null&&(s|=2),e.writeUInt8(s),(s&1)===0&&e.write(ee(o.hash,"hex").reverse())}}}toBinary(){const e=new Ae;return this.toWriter(e),e.toArray()}toBinaryUint8Array(){const e=new Ge;return this.toWriter(e),e.toUint8Array()}toHex(){return G(this.toBinaryUint8Array())}indexOf(e){const n=this.path[0].find(i=>i.hash===e);if(n==null)throw new Error(`Transaction ID ${e} not found in the Merkle Path`);return n.offset}computeRoot(e){if(typeof e!="string"){const a=this.path[0].find(c=>!!c?.hash);if(a==null)throw new Error("No valid leaf found in the Merkle Path");e=a.hash}if(typeof e!="string")throw new TypeError("Transaction ID is undefined");const n=this.indexOf(e),i=a=>G(Ue(ee(a,"hex").reverse()).reverse());let t=e;if(this.path.length===1&&this.path[0].length===1)return t;const o=this.path[0].reduce((a,c)=>Math.max(a,c.offset),0),s=Math.max(this.path.length,32-Math.clz32(o));for(let a=0;a<s;a++){const c=n>>a^1,u=this.findOrComputeLeaf(a,c);if(typeof u!="object"){if(this.path.length===1&&n>>a===o>>a){t=i((t??"")+(t??""));continue}throw new Error(`Missing hash for index ${n} at height ${a}`)}else u.duplicate===!0?t=i((t??"")+(t??"")):c%2===1?t=i((u.hash??"")+(t??"")):t=i((t??"")+(u.hash??""))}return t}findOrComputeLeaf(e,n){const i=l=>G(Ue(ee(l,"hex").reverse()).reverse());let t=e<this.path.length?this.path[e].find(l=>l.offset===n):void 0;if(t!=null)return t;if(e===0)return;const o=e-1,s=n<<1,a=this.findOrComputeLeaf(o,s);if(a?.hash==null||a.hash==="")return;const c=this.findOrComputeLeaf(o,s+1);if(c?.hash==null){if(c?.duplicate===!0)return{offset:n,hash:i(a.hash+a.hash)};if(this.path.length===1){const l=this.path[0].reduce((f,d)=>Math.max(f,d.offset),0);if(s===l>>o)return{offset:n,hash:i(a.hash+a.hash)}}return}let u;return c.duplicate===!0?u=i(a.hash+a.hash):u=i((c.hash??"")+(a.hash??"")),t={offset:n,hash:u},t}async verify(e,n){const i=this.computeRoot(e);if(this.indexOf(e)===0){const t=await n.currentHeight();if(this.blockHeight+100>t)return!1}return await n.isValidRootForHeight(i,this.blockHeight)}combine(e){if(this.blockHeight!==e.blockHeight)throw new Error("You cannot combine paths which do not have the same block height.");const n=this.computeRoot(),i=e.computeRoot();if(n!==i)throw new Error("You cannot combine paths which do not have the same root.");const t=[];for(let o=0;o<this.path.length;o++){t.push([]);for(const s of this.path[o])t[o].push(s);for(const s of e.path[o]){const a=t[o].find(c=>c.offset===s.offset);a===void 0?t[o].push(s):s?.txid!==void 0&&s?.txid!==null&&(a.txid=!0)}}this.path=t,this.trim()}trim(){const e=(s,a)=>{(a.length===0||a.at(-1)!==s)&&a.push(s)},n=(s,a)=>{for(let c=s.length;c>=0;c--){const u=this.path[a].findIndex(l=>l.offset===s[c]);u>=0&&this.path[a].splice(u,1)}},i=s=>{const a=[];for(const c of s)e(c>>1,a);return a};let t=[],o=[];for(const s of this.path)s.sort((a,c)=>a.offset-c.offset);for(let s=0;s<this.path[0].length;s++){const a=this.path[0][s];if(a.txid===!0)e(a.offset>>1,t);else{const c=a.offset%2===1,u=this.path[0][s+(c?-1:1)];(u.txid===void 0||u.txid===null||!u.txid)&&e(u.offset,o)}}n(o,0);for(let s=1;s<this.path.length;s++)o=t,t=i(t),n(o,s)}cachedFindLeaf(e,n,i,t,o){const s=`${e}:${n}`;if(t.has(s))return t.get(s);const a=p=>G(Ue(ee(p,"hex").reverse()).reverse());let c=e<i.length?i[e].get(n):void 0;if(c!=null)return t.set(s,c),c;if(e===0){t.set(s,void 0);return}const u=e-1,l=n<<1,f=this.cachedFindLeaf(u,l,i,t,o);if(f?.hash==null||f.hash===""){t.set(s,void 0);return}const d=this.cachedFindLeaf(u,l+1,i,t,o);if(d?.hash==null){if(d?.duplicate===!0||this.path.length===1&&l===o>>u)return c={offset:n,hash:a(f.hash+f.hash)},t.set(s,c),c;t.set(s,void 0);return}const h=d.duplicate===!0?a(f.hash+f.hash):a((d.hash??"")+(f.hash??""));return c={offset:n,hash:h},t.set(s,c),c}extract(e){if(e.length===0)throw new Error("At least one txid must be provided to extract");const n=this.computeRoot(),i=this.path[0].reduce((d,h)=>Math.max(d,h.offset),0),t=Math.max(this.path.length,32-Math.clz32(i)),o=new Array(this.path.length);for(let d=0;d<this.path.length;d++){const h=new Map;for(const p of this.path[d])h.set(p.offset,p);o[d]=h}const s=new Map,a=new Map;for(const d of this.path[0])d.hash!=null&&a.set(d.hash,d.offset);const c=new Array(t);for(let d=0;d<t;d++)c[d]=new Map;for(const d of e){const h=a.get(d);if(h===void 0)throw new Error(`Transaction ID ${d} not found in the Merkle Path`);c[0].set(h,{offset:h,txid:!0,hash:d});const p=h^1;if(!c[0].has(p)){const _=this.cachedFindLeaf(0,p,o,s,i);_!=null&&c[0].set(p,_)}for(let _=1;_<t;_++){const w=h>>_^1;if(c[_].has(w))continue;const O=this.cachedFindLeaf(_,w,o,s,i);O!=null?c[_].set(w,O):h>>_===i>>_&&c[_].set(w,{offset:w,duplicate:!0})}}const u=new Array(t);for(let d=0;d<t;d++)u[d]=Array.from(c[d].values()).sort((h,p)=>h.offset-p.offset);const l=new It(this.blockHeight,u);l.trim();const f=l.computeRoot();if(f!==n)throw new Error(`Extracted path root ${f} does not match original root ${n}`);return l}}const Jo=4022206465,Wt=4022206466,Pu=16843009;var ot;(function(r){r[r.RAWTX=0]="RAWTX",r[r.RAWTX_AND_BUMP_INDEX=1]="RAWTX_AND_BUMP_INDEX",r[r.TXID_ONLY=2]="TXID_ONLY"})(ot||(ot={}));function Gt(r,e){if(!Number.isSafeInteger(e)||e<0||r.pos+e>r.bin.length)throw new RangeError("Serialized transaction exceeds available BEEF data");r instanceof me?r.skip(e):r.pos+=e}function Wo(r){const e=r.pos;Gt(r,4);const n=r.readVarIntNum(!1),i=new Set;for(let s=0;s<n;s++){i.add(G(r.readReverse(32))),Gt(r,4);const a=r.readVarIntNum(!1);Gt(r,a+4)}const t=r.readVarIntNum(!1);for(let s=0;s<t;s++){Gt(r,8);const a=r.readVarIntNum(!1);Gt(r,a)}return Gt(r,4),{rawTx:r instanceof me?r.bin.subarray(e,r.pos):Uint8Array.from(r.bin.slice(e,r.pos)),inputTxids:Array.from(i)}}function C0(r){return Wo(new me(r)).inputTxids}function L0(r,e){if(r.length!==e.length)return!1;for(let n=0;n<r.length;n++)if(r[n]!==e[n])return!1;return!0}class Se{_bumpIndex;_tx;_rawTx;_txid;inputTxids=[];isValid=void 0;get bumpIndex(){return this._bumpIndex}set bumpIndex(e){this._bumpIndex=e,this.updateInputTxids()}get hasProof(){return this._bumpIndex!==void 0}get isTxidOnly(){return this._txid!==void 0&&this._txid!==null&&this._rawTx==null&&this._tx==null}get txid(){if(this._txid!==void 0&&this._txid!==null&&this._txid!=="")return this._txid;if(this._tx!=null)return this._txid=this._tx.id("hex"),this._txid;if(this._rawTx!=null)return this._txid=G(Ue(this._rawTx).reverse()),this._txid;throw new Error("Internal")}get tx(){if(this._tx!=null)return this._tx;if(this._rawTx!=null)return this._tx=de.fromBinaryView(this._rawTx),this._tx}get rawTx(){const e=this.rawTxUint8Array;return e==null?void 0:Array.from(e)}get rawTxUint8Array(){return this._tx!=null?(this._rawTx==null?this._rawTx=this._tx.toUint8Array():this.syncRawTxFromTransaction(),this._rawTx):this._rawTx}syncRawTxFromTransaction(){if(this._tx==null)return!1;const e=this._tx.toUint8Array();if(this._rawTx!=null)return e===this._rawTx?!1:(this._rawTx=e,this._txid=this._tx.id("hex"),this.updateInputTxids(),!0);const n=this._tx.id("hex"),i=this._txid!=null&&this._txid!==n,t=this.inputTxids;return this._txid=n,this.updateInputTxids(),i||!L0(t,this.inputTxids)}constructor(e,n,i){if(typeof e=="string")this._txid=e;else if(e instanceof Uint8Array)this._rawTx=e;else if(Array.isArray(e))this._rawTx=new Uint8Array(e);else if(e instanceof de)this._tx=e;else throw new TypeError("Invalid transaction data type");this._bumpIndex=n,this.hasProof?this.inputTxids=[]:i!=null?this.inputTxids=i:this.updateInputTxids()}static fromTx(e,n){return new Se(e,n)}static fromRawTx(e,n){return new Se(e,n)}static fromTxid(e,n){return new Se(e,n)}updateInputTxids(){if(this.hasProof)this.inputTxids=[];else if(this._tx!=null){const e=new Set;for(const n of this.tx.inputs)n.sourceTXID!==void 0&&n.sourceTXID!==null&&n.sourceTXID!==""&&e.add(n.sourceTXID);this.inputTxids=Array.from(e)}else this._rawTx!=null?this.inputTxids=C0(this._rawTx):this.inputTxids=[]}toWriter(e,n){const i=a=>{e.writeUInt8(a)},t=()=>{if(this._txid==null)throw new Error("Transaction ID (_txid) is undefined");e.writeReverse(ee(this._txid,"hex"))},o=()=>{const a=this.rawTxUint8Array;if(a==null)throw new Error("a valid serialized Transaction is expected");e.write(a)},s=()=>{this.bumpIndex===void 0?i(ot.RAWTX):(i(ot.RAWTX_AND_BUMP_INDEX),e.writeVarIntNum(this.bumpIndex))};n===Wt?this.isTxidOnly?(i(ot.TXID_ONLY),t()):this.bumpIndex!==void 0?(i(ot.RAWTX_AND_BUMP_INDEX),e.writeVarIntNum(this.bumpIndex),o()):(i(ot.RAWTX),o()):(o(),s())}static fromReader(e,n){let i,t;if(n===Wt){const o=e.readUInt8();if(o===ot.TXID_ONLY)t=Se.fromTxid(G(e.readReverse(32)));else{o===ot.RAWTX_AND_BUMP_INDEX&&(i=e.readVarIntNum());const{rawTx:s,inputTxids:a}=Wo(e);t=new Se(s,i,a)}}else{const{rawTx:o,inputTxids:s}=Wo(e);i=e.readUInt8()===0?void 0:e.readVarIntNum(),t=new Se(o,i,s)}return t}}class je{bumps=[];txs=[];version=Wt;atomicTxid=void 0;txidIndex=void 0;txPositionIndex=void 0;bumpIndexByKey=void 0;bumpIndexByTxid=void 0;rawBytesCache;hexCache;rawCacheVersion;rawCacheTxs;rawCacheBumps;bumpState;needsSort=!0;constructor(e=Wt){this.version=e}invalidateSerializationCaches(){this.rawBytesCache=void 0,this.hexCache=void 0,this.rawCacheVersion=void 0,this.rawCacheTxs=void 0,this.rawCacheBumps=void 0}captureSerializationState(){this.rawCacheVersion=this.version,this.rawCacheTxs=this.txs.map(e=>({ref:e,bumpIndex:e._bumpIndex,rawTx:e._rawTx,tx:e._rawTx==null?e._tx:void 0,txid:e._rawTx==null&&e._tx==null?e._txid:void 0})),this.rawCacheBumps=Array.from(this.bumps),this.captureBumpState()}captureBumpState(){this.bumpState=this.bumps.map(e=>({ref:e,blockHeight:e.blockHeight,levels:e.path.map(n=>({ref:n,leaves:n.map(i=>({ref:i,offset:i.offset,hash:i.hash,txid:i.txid,duplicate:i.duplicate}))}))}))}bumpStateMatches(){if(this.bumpState==null||this.bumpState.length!==this.bumps.length)return!1;for(let e=0;e<this.bumps.length;e++){const n=this.bumps[e],i=this.bumpState[e];if(i.ref!==n||i.blockHeight!==n.blockHeight||i.levels.length!==n.path.length)return!1;for(let t=0;t<n.path.length;t++){const o=n.path[t],s=i.levels[t];if(s.ref!==o||s.leaves.length!==o.length)return!1;for(let a=0;a<o.length;a++){const c=o[a],u=s.leaves[a];if(u.ref!==c||u.offset!==c.offset||u.hash!==c.hash||u.txid!==c.txid||u.duplicate!==c.duplicate)return!1}}}return!0}synchronizeNestedBumpMutations(){if(this.bumpState==null){this.captureBumpState();return}this.bumpStateMatches()||(this.invalidateSerializationCaches(),this.invalidateBumpIndexes(),this.captureBumpState())}serializationCacheMatchesState(){if(this.rawBytesCache==null||this.rawCacheVersion!==this.version||this.rawCacheTxs?.length!==this.txs.length||this.rawCacheBumps?.length!==this.bumps.length)return!1;for(let e=0;e<this.txs.length;e++){const n=this.txs[e],i=this.rawCacheTxs[e];if(i.ref!==n||i.bumpIndex!==n._bumpIndex||i.rawTx!==n._rawTx||i.tx!==(n._rawTx==null?n._tx:void 0)||i.txid!==(n._rawTx==null&&n._tx==null?n._txid:void 0))return!1}for(let e=0;e<this.bumps.length;e++)if(this.rawCacheBumps[e]!==this.bumps[e])return!1;return!0}markMutated(e=!0){this.invalidateSerializationCaches(),e&&(this.needsSort=!0)}ensureSerializableState(){for(const e of this.txs)e.txid}synchronizeNestedTransactionMutations(){let e=!1;for(const n of this.txs)e=n.syncRawTxFromTransaction()||e;e&&(this.invalidateSerializationCaches(),this.needsSort=!0,this.rebuildTxIndexes())}ensureSortedForSerialization(){this.needsSort&&this.sortTxs()}getSerializedBytes(){if(this.synchronizeNestedTransactionMutations(),this.synchronizeNestedBumpMutations(),this.serializationCacheMatchesState()&&this.rawBytesCache!=null)return this.rawBytesCache;this.invalidateSerializationCaches(),this.ensureSerializableState(),this.ensureSortedForSerialization();const e=new Ge;return this.toWriter(e),this.rawBytesCache=e.toUint8Array(),this.captureSerializationState(),this.rawBytesCache}getBeefForAtomic(e){this.synchronizeNestedTransactionMutations(),this.synchronizeNestedBumpMutations();const n=new Map(this.txs.map(a=>[a.txid,a])),i=n.get(e);if(i==null)throw new Error(`${e} does not exist in this Beef`);const t=this.collectAtomicTransactions(i,n),o=this.copySelectedTransactions(t);o.sortTxs();const s=new Ge;return s.writeUInt32LE(Pu),s.writeReverse(ee(e,"hex")),{beef:o,writer:s}}collectAtomicTransactions(e,n){const i=new Set,t=[e];for(;t.length>0;){const o=t.pop();if(!(o==null||i.has(o))&&(i.add(o),!(this.hasMatchingBump(o)||o.isTxidOnly)))for(const s of o.inputTxids){const a=n.get(s);a!=null&&t.push(a)}}return i}hasMatchingBump(e){const n=e.bumpIndex;return n==null||!Number.isSafeInteger(n)||n<0||n>=this.bumps.length?!1:this.bumps[n]?.path[0]?.some(i=>i.hash===e.txid)??!1}copySelectedTransactions(e){const n=new je(this.version),i=new Map;for(const t of this.txs)!e.has(t)||!this.hasMatchingBump(t)||t.bumpIndex==null||i.has(t.bumpIndex)||(i.set(t.bumpIndex,n.bumps.length),n.bumps.push(this.bumps[t.bumpIndex]));for(const t of this.txs){if(!e.has(t))continue;const o=t.bumpIndex==null?void 0:i.get(t.bumpIndex);let s;t._rawTx!=null?s=new Se(t._rawTx,o,Array.from(t.inputTxids)):t._tx!=null?s=Se.fromTx(t._tx,o):s=Se.fromTxid(t.txid,o),n.txs.push(s)}return n}isAtomic(e=this.atomicTxid??""){if(this.synchronizeNestedTransactionMutations(),this.synchronizeNestedBumpMutations(),e.length===0)return!1;const n=new Map;for(const t of this.txs){if(n.has(t.txid))return!1;n.set(t.txid,t)}const i=n.get(e);return i==null?!1:this.collectAtomicTransactions(i,n).size===this.txs.length}findTxid(e){return this.synchronizeNestedTransactionMutations(),this.findTxidIndexed(e)}findTxidIndexed(e){return this.ensureTxidIndex().get(e)}ensureTxidIndex(){return(this.txidIndex==null||this.txPositionIndex==null)&&this.rebuildTxIndexes(),this.txidIndex}ensureTxPositionIndex(){return(this.txPositionIndex==null||this.txidIndex==null)&&this.rebuildTxIndexes(),this.txPositionIndex}rebuildTxIndexes(){this.txidIndex=new Map,this.txPositionIndex=new Map;for(let e=0;e<this.txs.length;e++){const n=this.txs[e];this.txidIndex.set(n.txid,n),this.txPositionIndex.set(n.txid,e)}}deleteFromIndex(e){this.txidIndex?.delete(e),this.txPositionIndex?.delete(e)}addToIndex(e,n=this.txs.length-1){this.txidIndex?.set(e.txid,e),this.txPositionIndex?.set(e.txid,n)}replaceOrAppendTx(e){const n=this.ensureTxPositionIndex().get(e.txid);n===void 0?(this.txs.push(e),this.addToIndex(e)):(this.txs[n]=e,this.addToIndex(e,n))}makeTxidOnly(e){const n=this.ensureTxPositionIndex().get(e);if(n===void 0)return;let i=this.txs[n];return i.isTxidOnly||(i=Se.fromTxid(e),this.txs[n]=i,this.addToIndex(i,n),this.tryToValidateBumpIndex(i),this.markMutated(!0)),i}findBump(e){this.synchronizeNestedBumpMutations();const n=this.ensureBumpTxidIndex().get(e);return n===void 0?void 0:this.bumps[n]}ensureBumpTxidIndex(){if(this.bumpIndexByTxid==null){this.bumpIndexByTxid=new Map;for(let e=0;e<this.bumps.length;e++)for(const n of this.bumps[e].path[0])typeof n.hash=="string"&&this.bumpIndexByTxid.set(n.hash,e)}return this.bumpIndexByTxid}ensureBumpKeyIndex(){if(this.bumpIndexByKey==null){this.bumpIndexByKey=new Map;for(let e=0;e<this.bumps.length;e++){const n=this.bumps[e];this.bumpIndexByKey.set(`${n.blockHeight}:${n.computeRoot()}`,e)}}return this.bumpIndexByKey}invalidateBumpIndexes(){this.bumpIndexByKey=void 0,this.bumpIndexByTxid=void 0}findTransactionForSigning(e){const n=this.findTxid(e);if(!(n==null||n.tx==null)){for(const i of n.tx.inputs)if(i.sourceTransaction==null){const t=this.findTxidIndexed(ri(i.sourceTXID,"sourceTXID must be valid"));t!=null&&(i.sourceTransaction=t.tx)}return n.tx}}findAtomicTransaction(e){const n=this.findTxid(e);if(!(n==null||n.tx==null))return this.addInputProof(n.tx),n.tx}addInputProof(e){const n=new Set,i=[e];for(;i.length>0;){const t=i.pop();if(t==null)continue;const o=t.id("hex");if(n.has(o))continue;n.add(o);const s=this.findBump(o);if(s!=null){t.merklePath=s;continue}for(const a of t.inputs)this.resolveInputSource(a),a.sourceTransaction!=null&&i.push(a.sourceTransaction)}}resolveInputSource(e){if(e.sourceTransaction==null){const n=this.findTxidIndexed(ri(e.sourceTXID,"sourceTXID must be valid"));n!=null&&(e.sourceTransaction=n.tx)}}mergeBump(e){this.synchronizeNestedTransactionMutations(),this.synchronizeNestedBumpMutations(),this.markMutated(!1);const n=this.findOrInsertBump(e),i=this.bumps[n],t=this.ensureTxidIndex();for(const o of i.path[0]){if(typeof o.hash!="string")continue;const s=t.get(o.hash);s!=null&&s.bumpIndex==null&&this.tryMarkTxProvenByBump(s,i,n)}return n}findOrInsertBump(e){const n=this.ensureBumpKeyIndex(),i=this.ensureBumpTxidIndex(),t=`${e.blockHeight}:${e.computeRoot()}`,o=n.get(t);if(o!==void 0){this.bumps[o].combine(e);for(const a of this.bumps[o].path[0])typeof a.hash=="string"&&i.set(a.hash,o);return o}this.bumps.push(e);const s=this.bumps.length-1;n.set(t,s);for(const a of e.path[0])typeof a.hash=="string"&&i.set(a.hash,s);return s}tryMarkTxProvenByBump(e,n,i){const t=e.txid;for(const o of n.path[0])if(o.hash===t){e.bumpIndex=i,o.txid=!0;break}}mergeRawTx(e,n){this.synchronizeNestedTransactionMutations(),this.markMutated(!0);const i=new Se(e,n);return this.replaceOrAppendTx(i),this.tryToValidateBumpIndex(i),i}mergeTransaction(e){this.synchronizeNestedTransactionMutations(),this.markMutated(!0),e.materializeSourceTXIDs();const n=e.id("hex"),i=new Set,t=[e];let o;for(;t.length>0;){const s=t.pop();if(s==null)continue;const a=s.id("hex");if(i.has(a))continue;i.add(a);const c=s.merklePath==null?void 0:this.mergeBump(s.merklePath),u=new Se(s,c);if(this.replaceOrAppendTx(u),this.tryToValidateBumpIndex(u),a===n&&(o=u),u.bumpIndex===void 0)for(let l=s.inputs.length-1;l>=0;l--){const f=s.inputs[l].sourceTransaction;f!=null&&t.push(f)}}if(o==null)throw new Error("Failed to merge root transaction");return o}removeExistingTxid(e){const n=this.ensureTxPositionIndex().get(e);n!==void 0&&(this.txs.splice(n,1),this.rebuildTxIndexes(),this.markMutated(!0))}mergeTxidOnly(e){let n=this.findTxid(e);return n==null&&(n=new Se(e),this.txs.push(n),this.addToIndex(n),this.tryToValidateBumpIndex(n),this.markMutated(!0)),n}mergeBeefTx(e){let n=this.findTxid(e.txid);if(e.isTxidOnly&&n==null?n=this.mergeTxidOnly(e.txid):e._tx!=null&&(n==null||n.isTxidOnly)?n=this.mergeTransaction(e._tx):e._rawTx!=null&&(n==null||n.isTxidOnly)&&(n=this.mergeRawTx(e._rawTx)),n==null)throw new Error(`Failed to merge BeefTx for txid: ${e.txid}`);return n}mergeBeef(e){const n=e instanceof je?e:je.fromBinary(e);for(const i of n.bumps)this.mergeBump(i);for(const i of n.txs)this.mergeBeefTx(i)}isValid(e){return this.verifyValid(e).valid}async verify(e,n){const i=this.verifyValid(n);if(!i.valid)return!1;for(const t of Object.keys(i.roots))if(!await e.isValidRootForHeight(i.roots[t],Number(t)))return!1;return!0}verifyValid(e){this.synchronizeNestedBumpMutations();const n={valid:!1,roots:{}};if(this.atomicTxid!=null&&!this.isAtomic(this.atomicTxid))return n;const i=this.sortTxs();if(this.hasDuplicateTxids()||i.missingInputs.length>0||i.notValid.length>0||i.txidOnly.length>0&&e!==!0||i.withMissingInputs.length>0)return n;const t={};return!this.collectTxidOnlyTxids(t,e)||!this.collectBumpTxids(t,n)||!this.verifyBumpIndexLeaves()||!this.verifyInputDependencies(t)||(n.valid=!0),n}hasDuplicateTxids(){const e=new Set;for(const n of this.txs){if(e.has(n.txid))return!0;e.add(n.txid)}return!1}collectTxidOnlyTxids(e,n){for(const i of this.txs)if(i.isTxidOnly){if(n!==!0)return!1;e[i.txid]=!0}return!0}collectBumpTxids(e,n){for(const i of this.bumps)for(const t of i.path[0])if(!(t.txid!==!0||typeof t.hash!="string"||t.hash.length===0)&&(e[t.hash]=!0,!this.confirmComputedRoot(i,t.hash,n)))return!1;return!0}verifyBumpIndexLeaves(){for(const e of this.txs){if(e.bumpIndex===void 0)continue;if(!Number.isSafeInteger(e.bumpIndex)||e.bumpIndex<0||e.bumpIndex>=this.bumps.length||this.bumps[e.bumpIndex]?.path[0]?.find(i=>i.hash===e.txid)==null)return!1}return!0}verifyInputDependencies(e){for(const n of this.txs){for(const i of n.inputTxids)if(!e[i])return!1;e[n.txid]=!0}return!0}confirmComputedRoot(e,n,i){const t=e.computeRoot(n);return(i.roots[e.blockHeight]===void 0||i.roots[e.blockHeight]==="")&&(i.roots[e.blockHeight]=t),i.roots[e.blockHeight]===t}toWriter(e){e.writeUInt32LE(this.version),e.writeVarIntNum(this.bumps.length);for(const n of this.bumps)e.write(e instanceof Ge?n.toBinaryUint8Array():n.toBinary());e.writeVarIntNum(this.txs.length);for(const n of this.txs)n.toWriter(e,this.version)}toBinary(){return Array.from(this.getSerializedBytes())}toUint8Array(){return this.getSerializedBytes()}toBinaryAtomic(e){const{beef:n,writer:i}=this.getBeefForAtomic(e);return i.write(n.getSerializedBytes()),i.toArray()}toUint8ArrayAtomic(e){const{beef:n,writer:i}=this.getBeefForAtomic(e),t=n.getSerializedBytes(),o=i.toUint8Array(),s=new Uint8Array(o.length+t.length);return s.set(o,0),s.set(t,o.length),s}toHex(){const e=this.getSerializedBytes();if(this.hexCache!=null)return this.hexCache;const n=G(e);return this.hexCache=n,n}static fromReader(e){const n=e.pos;let i=e.readUInt32LE(),t,o=n;if(i===Pu&&(t=G(e.readReverse(32)),o=e.pos,i=e.readUInt32LE()),i!==Jo&&i!==Wt)throw new Error(`Serialized BEEF must start with ${Jo} or ${Wt} but starts with ${i}`);const s=new je(i),a=e.readVarIntNum();for(let u=0;u<a;u++){const l=It.fromReader(e,!1);s.bumps.push(l)}const c=e.readVarIntNum();for(let u=0;u<c;u++){const l=Se.fromReader(e,i);s.txs.push(l)}return s.atomicTxid=t,e instanceof me&&(s.rawBytesCache=e.bin.subarray(o,e.pos),s.captureSerializationState()),s}static fromBinary(e){return je.fromReader(new me(Uint8Array.from(e)))}static fromBinaryView(e){const n=new me(e),i=je.fromReader(n);if(!n.eof())throw new Error("Serialized BEEF contains trailing data");return i}static fromString(e,n="hex"){const i=Bo(e,n),t=new me(i);return je.fromReader(t)}tryToValidateBumpIndex(e){if(e.bumpIndex!==void 0)return!0;const n=e.txid,i=this.ensureBumpTxidIndex().get(n);if(i===void 0)return!1;e.bumpIndex=i;const t=this.bumps[i].path[0].find(o=>o.hash===n);return t!=null&&(t.txid=!0),!0}sortTxs(){this.synchronizeNestedTransactionMutations();const e={},n={},i=[],t=[];let o=this.partitionTxs(n,e,i,t);const{txsMissingInputs:s,missingInputs:a,remaining:c}=this.separateMissingInputs(o,n);o=c;const u=this.topoSort(o,e,i);return this.txs=s.concat(u).concat(t).concat(i),this.needsSort=!1,this.invalidateSerializationCaches(),this.rebuildTxIndexes(),{missingInputs:Object.keys(a),notValid:u.map(l=>l.txid),valid:Object.keys(e),withMissingInputs:s.map(l=>l.txid),txidOnly:t.map(l=>l.txid)}}partitionTxs(e,n,i,t){const o=[];for(const s of this.txs)e[s.txid]=s,s.isValid=s.hasProof,s.isValid?(n[s.txid]=!0,i.push(s)):s.isTxidOnly&&s.inputTxids.length===0?(n[s.txid]=!0,t.push(s)):o.push(s);return o}separateMissingInputs(e,n){const i={},t=[],o=[];for(const s of e){let a=!1;for(const c of s.inputTxids)n[c]===void 0&&(i[c]=!0,a=!0);a?t.push(s):o.push(s)}return{txsMissingInputs:t,missingInputs:i,remaining:o}}topoSort(e,n,i){const t=new Set(e.map(d=>d.txid)),o=new Map,s=new Map,a=new Map(e.map((d,h)=>[d.txid,h])),c=new Map;for(const d of e){let h=0;for(const p of d.inputTxids)if(!n[p]&&(h++,t.has(p))){const _=s.get(p)??[];_.push(d),s.set(p,_)}o.set(d.txid,h),c.set(d.txid,0)}const u=e.filter(d=>o.get(d.txid)===0),l=new Set;for(let d=0;d<u.length;d++){const h=u[d];if(!l.has(h.txid)){l.add(h.txid);for(const p of s.get(h.txid)??[]){const _=(c.get(h.txid)??0)+((a.get(h.txid)??0)>(a.get(p.txid)??0)?1:0);c.set(p.txid,Math.max(c.get(p.txid)??0,_));const w=(o.get(p.txid)??0)-1;o.set(p.txid,w),w===0&&u.push(p)}}}const f=[];for(const d of e){if(!l.has(d.txid))continue;const h=c.get(d.txid)??0,p=f[h]??[];p.push(d),f[h]=p}for(const d of f)for(const h of d??[])n[h.txid]=!0,i.push(h);return e.filter(d=>!l.has(d.txid))}clone(){const e=new je;return e.version=this.version,e.bumps=Array.from(this.bumps),e.txs=Array.from(this.txs),e.txidIndex=void 0,e.txPositionIndex=void 0,e.bumpIndexByKey=void 0,e.bumpIndexByTxid=void 0,e.needsSort=this.needsSort,e.hexCache=this.hexCache,e.rawBytesCache=this.rawBytesCache,e.rawBytesCache!=null&&e.captureSerializationState(),e}trimKnownTxids(e){let n=this.removeKnownTxidOnlyTxs(new Set(e));n=this.reindexBumps()||n,n&&this.markMutated(!0)}removeKnownTxidOnlyTxs(e){const n=this.txs.length;this.txs=this.txs.filter(t=>!(t.isTxidOnly&&e.has(t.txid)));const i=this.txs.length!==n;return i&&this.rebuildTxIndexes(),i}reindexBumps(){const e=new Set;for(const t of this.txs)t.bumpIndex!==void 0&&e.add(t.bumpIndex);if(e.size>=this.bumps.length)return!1;const n=new Map;let i=0;for(let t=0;t<this.bumps.length;t++)e.has(t)&&(n.set(t,i),i++);this.bumps=this.bumps.filter((t,o)=>e.has(o));for(const t of this.txs){if(t.bumpIndex===void 0)continue;const o=n.get(t.bumpIndex);if(o===void 0)throw new Error(`Internal error: bumpIndex ${t.bumpIndex} not found in indexMap`);t.bumpIndex=o}return this.invalidateBumpIndexes(),!0}getValidTxids(){return this.sortTxs().valid}toLogString(){let e="";e+=`BEEF with ${this.bumps.length} BUMPS and ${this.txs.length} Transactions, isValid ${this.isValid().toString()}
1077
+ `;let n=-1;for(const i of this.bumps)n++,e+=` BUMP ${n}
1078
+ block: ${i.blockHeight}
1079
+ txids: [
1080
+ ${i.path[0].filter(t=>t.txid===!0).map(t=>` '${t.hash??""}'`).join(`,
1081
+ `)}
1082
+ ]
1083
+ `;n=-1;for(const i of this.txs)n++,e+=` TX ${n}
1084
+ txid: ${i.txid}
1085
+ `,i.bumpIndex!==void 0&&(e+=` bumpIndex: ${i.bumpIndex}
1086
+ `),i.isTxidOnly?e+=` txidOnly
1087
+ `:e+=` rawTx length=${i.rawTx?.length??0}
1088
+ `,i.inputTxids.length>0&&(e+=` inputs: [
1089
+ ${i.inputTxids.map(t=>` '${t}'`).join(`,
1090
+ `)}
1091
+ ]
1092
+ `);return e}addComputedLeaves(){for(const e of this.bumps)for(let n=1;n<e.path.length;n++)this.addComputedLeavesForRow(e,n)}addComputedLeavesForRow(e,n){const i=t=>G(Ue(ee(t,"hex").reverse()).reverse());for(const t of e.path[n-1]){if(typeof t.hash!="string"||(t.offset&1)!==0)continue;const o=e.path[n-1].find(a=>a.offset===t.offset+1);if(o===void 0||typeof o.hash!="string")continue;const s=t.offset>>1;e.path[n].every(a=>a.offset!==s)&&e.path[n].push({offset:s,hash:i(o.hash+t.hash)})}}}const M0=943816;class de{version;inputs;outputs;lockTime;metadata;merklePath;cachedHash;cachedIdHex;rawBytesCache;efBytesCache;hexCache;activeSignatureHashCache;rawCacheState;getSignatureHashCache(){return this.activeSignatureHashCache??{hashOutputsSingle:new Map}}materializeSourceTXIDs(){const e=new Set,n=new Set,i=[{tx:this,expanded:!1}];for(;i.length>0;){const t=i.pop();if(t!=null&&!e.has(t.tx)){if(t.expanded){for(const o of t.tx.inputs)o.sourceTXID==null&&o.sourceTransaction!=null&&(o.sourceTXID=o.sourceTransaction.id("hex"));n.delete(t.tx),e.add(t.tx);continue}if(n.has(t.tx))throw new Error("Cyclic source transaction graph");n.add(t.tx),i.push({tx:t.tx,expanded:!0});for(let o=t.tx.inputs.length-1;o>=0;o--){const s=t.tx.inputs[o];s.sourceTXID==null&&s.sourceTransaction!=null&&!e.has(s.sourceTransaction)&&i.push({tx:s.sourceTransaction,expanded:!1})}}}}static fromBEEF(e,n){const{tx:i}=de.fromAnyBeef(e,n);return i}static fromBEEFView(e,n){const{tx:i}=de.fromAnyBeef(e,n,!0);return i}static fromAtomicBEEF(e){const{tx:n,txid:i,beef:t}=de.fromAnyBeef(e);if(i!==t.atomicTxid)throw t.atomicTxid==null?new Error("beef must conform to BRC-95 and must contain the subject txid."):new Error(`Transaction with TXID ${t.atomicTxid} not found in BEEF data.`);if(!t.isAtomic(i))throw new Error("Atomic BEEF contains unrelated transaction data.");return n}static fromAtomicBEEFView(e){const{tx:n,txid:i,beef:t}=de.fromAnyBeef(e,void 0,!0);if(i!==t.atomicTxid)throw t.atomicTxid==null?new Error("beef must conform to BRC-95 and must contain the subject txid."):new Error(`Transaction with TXID ${t.atomicTxid} not found in BEEF data.`);if(!t.isAtomic(i))throw new Error("Atomic BEEF contains unrelated transaction data.");return n}static fromAnyBeef(e,n,i=!1){const t=i&&e instanceof Uint8Array?je.fromBinaryView(e):je.fromBinary(e);if(t.txs.length<1)throw new Error("beef must include at least one transaction.");const o=t.txs.at(-1);if(o==null)throw new Error("beef must include at least one transaction.");const s=n??t.atomicTxid??o.txid,a=t.findAtomicTransaction(s);if(a==null)throw n==null?new Error("beef does not contain transaction for atomic txid."):new Error(`Transaction with TXID ${String(s)} not found in BEEF data.`);return{tx:a,beef:t,txid:s}}static fromEF(e){const n=me.makeReader(e),i=n.readUInt32LE();if(G(n.read(6))!=="0000000000ef")throw new Error("Invalid EF marker");const t=n.readVarIntNum(),o=[];for(let u=0;u<t;u++){const l=G(n.readReverse(32)),f=n.readUInt32LE(),d=n.readVarIntNum(),h=n.read(d),p=Qr.fromBinary(h),_=n.readUInt32LE(),w=n.readUInt64LEBn().toNumber(),O=n.readVarIntNum(),$=n.read(O),k=Jt.fromBinary($),z=new de(void 0,[],[],void 0);z.outputs=new Array(f+1).fill(null),z.outputs[f]={satoshis:w,lockingScript:k},o.push({sourceTransaction:z,sourceTXID:l,sourceOutputIndex:f,unlockingScript:p,sequence:_})}const s=n.readVarIntNum(),a=[];for(let u=0;u<s;u++){const l=n.readUInt64LEBn().toNumber(),f=n.readVarIntNum(),d=n.read(f),h=Jt.fromBinary(d);a.push({satoshis:l,lockingScript:h})}const c=n.readUInt32LE();return new de(i,o,a,c)}static parseScriptOffsets(e){const n=me.makeReader(e),i=[],t=[];n.pos+=4;const o=n.readVarIntNum();for(let a=0;a<o;a++){n.pos+=36;const c=n.readVarIntNum();i.push({vin:a,offset:n.pos,length:c}),n.pos+=c+4}const s=n.readVarIntNum();for(let a=0;a<s;a++){n.pos+=8;const c=n.readVarIntNum();t.push({vout:a,offset:n.pos,length:c}),n.pos+=c}return{inputs:i,outputs:t}}static fromReader(e){return de.fromReaderInternal(e,!1)}static fromReaderInternal(e,n){const i=e.readUInt32LE(),t=e.readVarIntNum(),o=[];for(let u=0;u<t;u++){const l=G(e.readReverse(32)),f=e.readUInt32LE(),d=e.readVarIntNum(),h=n&&e instanceof me?e.readView(d):e.read(d),p=n&&h instanceof Uint8Array?Qr.fromBinaryView(h):Qr.fromBinary(h),_=e.readUInt32LE();o.push({sourceTXID:l,sourceOutputIndex:f,unlockingScript:p,sequence:_})}const s=e.readVarIntNum(),a=[];for(let u=0;u<s;u++){const l=e.readUInt64LEBn().toNumber(),f=e.readVarIntNum(),d=n&&e instanceof me?e.readView(f):e.read(f),h=n&&d instanceof Uint8Array?Jt.fromBinaryView(d):Jt.fromBinary(d);a.push({satoshis:l,lockingScript:h})}const c=e.readUInt32LE();return new de(i,o,a,c)}static fromBinary(e){const n=Uint8Array.from(e),i=new me(n),t=de.fromReaderInternal(i,!0);return t.rawBytesCache=n,t.captureSerializationState(),t}static fromBinaryView(e){const n=new me(e),i=de.fromReaderInternal(n,!0);if(!n.eof())throw new Error("Serialized transaction contains trailing data");return i.rawBytesCache=e,i.captureSerializationState(),i}static fromHex(e){const n=Bo(e,"hex"),i=new me(n),t=de.fromReaderInternal(i,!0);return t.rawBytesCache=n,t.hexCache=G(n),t.captureSerializationState(),t}static fromHexEF(e){return de.fromEF(Bo(e,"hex"))}static fromHexBEEF(e,n){return de.fromBEEF(ee(e,"hex"),n)}constructor(e=1,n=[],i=[],t=0,o=new Map,s){this.version=e,this.inputs=n,this.outputs=i,this.lockTime=t,this.metadata=o,this.merklePath=s}invalidateSerializationCaches(){this.cachedHash=void 0,this.cachedIdHex=void 0,this.rawBytesCache=void 0,this.efBytesCache=void 0,this.hexCache=void 0,this.rawCacheState=void 0}sourceTransactionId(e){return e.sourceTXID==null?e.sourceTransaction?.id("hex"):void 0}captureSerializationState(){this.rawCacheState={version:this.version,lockTime:this.lockTime,inputs:this.inputs.map(e=>{const n=e.sourceTransaction?.outputs[e.sourceOutputIndex];return{ref:e,sourceTXID:e.sourceTXID,sourceTransactionId:this.sourceTransactionId(e),sourceOutputIndex:e.sourceOutputIndex,sequence:e.sequence,unlockingScript:e.unlockingScript,unlockingScriptBytes:e.unlockingScript?.toUint8Array(),sourceOutput:n,sourceSatoshis:n?.satoshis,sourceLockingScript:n?.lockingScript,sourceLockingScriptBytes:n?.lockingScript.toUint8Array()}}),outputs:this.outputs.map(e=>({ref:e,satoshis:e.satoshis,lockingScript:e.lockingScript,lockingScriptBytes:e.lockingScript.toUint8Array()}))}}serializationCacheMatchesState(){const e=this.rawCacheState;if(e==null||e.version!==this.version||e.lockTime!==this.lockTime||e.inputs.length!==this.inputs.length||e.outputs.length!==this.outputs.length)return!1;for(let n=0;n<this.inputs.length;n++){const i=this.inputs[n],t=e.inputs[n],o=i.sourceTransaction?.outputs[i.sourceOutputIndex];if(t.ref!==i||t.sourceTXID!==i.sourceTXID||t.sourceTransactionId!==this.sourceTransactionId(i)||t.sourceOutputIndex!==i.sourceOutputIndex||t.sequence!==i.sequence||t.unlockingScript!==i.unlockingScript||t.unlockingScriptBytes!==i.unlockingScript?.toUint8Array()||t.sourceOutput!==o||t.sourceSatoshis!==o?.satoshis||t.sourceLockingScript!==o?.lockingScript||t.sourceLockingScriptBytes!==o?.lockingScript.toUint8Array())return!1}for(let n=0;n<this.outputs.length;n++){const i=this.outputs[n],t=e.outputs[n];if(t.ref!==i||t.satoshis!==i.satoshis||t.lockingScript!==i.lockingScript||t.lockingScriptBytes!==i.lockingScript.toUint8Array())return!1}return!0}addInput(e){if(e.sourceTXID===void 0&&e.sourceTransaction===void 0)throw new TypeError("A reference to an an input transaction is required. If the input transaction itself cannot be referenced, its TXID must still be provided.");e.sequence??=4294967295,this.invalidateSerializationCaches(),this.inputs.push(e)}addOutput(e){if(this.invalidateSerializationCaches(),e.change!==!0){if(e.satoshis===void 0)throw new TypeError("either satoshis must be defined or change must be set to true");if(e.satoshis<0)throw new Error("satoshis must be a positive integer or zero")}if(e.lockingScript==null)throw new Error("lockingScript must be defined");this.outputs.push(e)}addP2PKHOutput(e,n){const i=new Xl().lock(e);if(n===void 0)return this.addOutput({lockingScript:i,change:!0});this.addOutput({lockingScript:i,satoshis:n})}updateMetadata(e){this.metadata={...this.metadata,...e}}async fee(e=kt.getInstance(),n="equal"){if(this.invalidateSerializationCaches(),typeof e=="number"){const o=e;e={computeFee:async()=>o}}const i=await e.computeFee(this),t=this.calculateChange(i);if(t<=0){this.outputs=this.outputs.filter(o=>o.change!==!0);return}this.distributeChange(t,n)}calculateChange(e){let n=0;for(const i of this.inputs){if(typeof i.sourceTransaction!="object")throw new TypeError("Source transactions are required for all inputs during fee computation");n+=i.sourceTransaction.outputs[i.sourceOutputIndex].satoshis??0}n-=e;for(const i of this.outputs)i.change!==!0&&i.satoshis!==void 0&&(n-=i.satoshis);return n}distributeChange(e,n){let i=0;const t=this.outputs.filter(o=>o.change);if(n==="random"?i=this.distributeRandomChange(e,t):n==="equal"&&(i=this.distributeEqualChange(e,t)),i<e){const o=this.outputs.at(-1);o.satoshis===void 0?o.satoshis=e-i:o.satoshis+=e-i}}distributeRandomChange(e,n){let i=0,t=e;const o=new Array(n.length).fill(1);t-=n.length,i+=n.length;for(let s=0;s<n.length-1;s++){const a=this.benfordNumber(0,t);o[s]=o[s]+a,i+=a,t-=a}for(const s of this.outputs)s.change===!0&&(s.satoshis=o.shift());return i}distributeEqualChange(e,n){let i=0;const t=Math.floor(e/n.length);for(const o of n)i+=t,o.satoshis=t;return i}benfordNumber(e,n){const i=Pt(1)[0]%9+1;return Math.floor(e+(n-e)*Math.log10(1+1/i)/Math.log10(10))}getFee(){let e=0;for(const i of this.inputs){if(typeof i.sourceTransaction!="object")throw new TypeError("Source transactions or sourceSatoshis are required for all inputs to calculate fee");e+=i.sourceTransaction.outputs[i.sourceOutputIndex].satoshis??0}let n=0;for(const i of this.outputs)n+=i.satoshis??0;return e-n}async sign(e={}){this.invalidateSerializationCaches();for(const t of this.outputs)if(t.satoshis===void 0)throw t.change===!0?new Error("There are still change outputs with uncomputed amounts. Use the fee() method to compute the change amounts and transaction fees prior to signing."):new Error("One or more transaction outputs is missing an amount. Ensure all output amounts are provided before signing.");this.materializeSourceTXIDs();const n=this.activeSignatureHashCache;this.activeSignatureHashCache={hashOutputsSingle:new Map};let i;try{i=await Promise.all(this.inputs.map(async(t,o)=>e.skipExistingSignatures===!0&&this.inputs[o].unlockingScript!=null?this.inputs[o].unlockingScript:typeof this.inputs[o].unlockingScriptTemplate=="object"?await this.inputs[o]?.unlockingScriptTemplate?.sign(this,o):await Promise.resolve(void 0)))}finally{this.activeSignatureHashCache=n}for(let t=0,o=this.inputs.length;t<o;t++)typeof this.inputs[t].unlockingScriptTemplate=="object"&&(this.inputs[t].unlockingScript=i[t]);this.invalidateSerializationCaches()}async broadcast(e=U0()){return await e.broadcast(this)}writeTransactionBody(e){e.writeUInt32LE(this.version),e.writeVarIntNum(this.inputs.length);for(const n of this.inputs){if(n.sourceTXID===void 0){if(n.sourceTransaction==null)throw new Error("sourceTransaction is undefined");e.write(n.sourceTransaction.hash())}else e.writeReverse(ee(n.sourceTXID,"hex"));if(e.writeUInt32LE(n.sourceOutputIndex),n.unlockingScript==null)throw new Error("unlockingScript is undefined");const i=n.unlockingScript.toUint8Array();e.writeVarIntNum(i.length),e.write(i),e.writeUInt32LE(n.sequence??4294967295)}e.writeVarIntNum(this.outputs.length);for(const n of this.outputs){e.writeUInt64LE(n.satoshis??0);const i=n.lockingScript.toUint8Array();e.writeVarIntNum(i.length),e.write(i)}e.writeUInt32LE(this.lockTime)}buildSerializedBytes(){const e=new Ge;return this.writeTransactionBody(e),e.toUint8Array()}getSerializedBytes(){return(this.rawBytesCache==null||!this.serializationCacheMatchesState())&&(this.invalidateSerializationCaches(),this.rawBytesCache=this.buildSerializedBytes(),this.captureSerializationState()),this.rawBytesCache}toBinary(){return Array.from(this.getSerializedBytes())}toUint8Array(){return this.getSerializedBytes()}writeEF(e){e.writeUInt32LE(this.version),e.write([0,0,0,0,0,239]),e.writeVarIntNum(this.inputs.length);for(const n of this.inputs){if(n.sourceTransaction===void 0)throw new TypeError("All inputs must have source transactions when serializing to EF format");if(n.sourceTXID===void 0?e.write(n.sourceTransaction.hash()):e.write(ee(n.sourceTXID,"hex").reverse()),e.writeUInt32LE(n.sourceOutputIndex),n.unlockingScript==null)throw new Error("unlockingScript is undefined");const i=n.unlockingScript.toUint8Array();e.writeVarIntNum(i.length),e.write(i),e.writeUInt32LE(n.sequence??4294967295),e.writeUInt64LE(n.sourceTransaction.outputs[n.sourceOutputIndex].satoshis??0);const t=n.sourceTransaction.outputs[n.sourceOutputIndex].lockingScript.toUint8Array();e.writeVarIntNum(t.length),e.write(t)}e.writeVarIntNum(this.outputs.length);for(const n of this.outputs){e.writeUInt64LE(n.satoshis??0);const i=n.lockingScript.toUint8Array();e.writeVarIntNum(i.length),e.write(i)}e.writeUInt32LE(this.lockTime)}toEF(){return Array.from(this.getEFBytes())}toEFUint8Array(){return this.toEFBinary()}getEFBytes(){if(this.efBytesCache==null||!this.serializationCacheMatchesState()){this.invalidateSerializationCaches();const e=new Ge;this.writeEF(e),this.efBytesCache=e.toUint8Array(),this.captureSerializationState()}return this.efBytesCache}toEFBinary(){return this.getEFBytes()}toHexEF(){return G(this.toEFBinary())}toHex(){const e=this.getSerializedBytes();if(this.hexCache!=null)return this.hexCache;const n=G(e);return this.hexCache=n,n}toHexBEEF(){return G(this.toBEEF())}toHexAtomicBEEF(){return G(this.toAtomicBEEF())}hash(e){const n=this.getSerializedBytes();return this.cachedHash??=Ue(n),e==="hex"?G(this.cachedHash):Array.from(this.cachedHash)}id(e){if(this.getSerializedBytes(),e==="hex"&&this.cachedIdHex!=null)return this.cachedIdHex;const n=[...this.hash()];return n.reverse(),e==="hex"?(this.cachedIdHex=G(n),this.cachedIdHex):n}async verify(e=R0(),n,i,t){const o=e==="scripts only",s=t??Wl();o||this.materializeSourceTXIDs();const a=new Set,c=new Set,u=[this],l=new Set;o||l.add(this.id("hex"));const f=new Set(u),d=[];let h=0;for(;h<u.length;){const p=u[h++];let _;const w=()=>(_??=p.id("hex"),_);if(o?c.has(p):a.has(w()))continue;if(typeof p.merklePath=="object")if(o){c.add(p);continue}else if(await p.merklePath.verify(w(),e)){a.add(w());continue}else throw new Error(`Invalid merkle path for transaction ${w()}`);if(n!==void 0){if(p===void 0)throw new Error("Transaction is undefined");const J=de.fromEF(p.toEF());if(delete J.outputs[0].satoshis,J.outputs[0].change=!0,await J.fee(n),p.getFee()<J.getFee())throw new Error(`Verification failed because the transaction ${w()} has an insufficient fee and has not been mined.`)}const O={tx:p,blockHeight:M0,consensus:p.version>1,...i===void 0?{}:{memoryLimit:i}},$=s!==void 0&&(i===void 0||s.supportsMemoryLimit===!0)&&(s.shouldVerifyScripts?.(O)??!0);let k=0;const z={hashOutputsSingle:new Map};for(let J=0;J<p.inputs.length;J++){const se=p.inputs[J];if(typeof se.sourceTransaction!="object")throw new TypeError(`Verification failed because the input at index ${J} of transaction ${w()} is missing an associated source transaction. This source transaction is required for transaction verification because there is no merkle proof for the transaction spending a UTXO it contains.`);if(typeof se.unlockingScript!="object")throw new TypeError(`Verification failed because the input at index ${J} of transaction ${w()} is missing an associated unlocking script. This script is required for transaction verification because there is no merkle proof for the transaction spending the UTXO.`);const le=se.sourceTransaction.outputs[se.sourceOutputIndex];k+=le.satoshis??0;const Y=se.sourceTransaction,Te=o&&se.sourceTXID!==void 0?se.sourceTXID:Y.id("hex");if(o?!c.has(Y)&&!f.has(Y)&&(u.push(Y),f.add(Y)):!a.has(Te)&&!l.has(Te)&&(u.push(Y),l.add(Te)),se.sourceTXID??=Te,!$&&!new $0({sourceTXID:se.sourceTXID,sourceOutputIndex:se.sourceOutputIndex,lockingScript:le.lockingScript,sourceSatoshis:le.satoshis??0,transactionVersion:p.version,otherInputs:[],allInputs:p.inputs,unlockingScript:se.unlockingScript,inputSequence:se.sequence??4294967295,inputIndex:J,outputs:p.outputs,lockTime:p.lockTime,memoryLimit:i,sigHashCache:z}).validateJavaScript())return!1}$&&d.push(O);let A=0;for(const J of p.outputs){if(typeof J.satoshis!="number")throw new TypeError("Every output must have a defined amount during transaction verification.");A+=J.satoshis}if(A>k)return!1;o?c.add(p):a.add(w())}if(d.length>0&&s!==void 0){const p=s.verifyScriptsBatch===void 0?await Promise.all(d.map(async w=>await s.verifyScripts(w))):await s.verifyScriptsBatch(d);if(p.length!==d.length)throw new Error("Script verifier returned an invalid batch result count");const _=p.findIndex(w=>!w);if(_>=0)throw new Error(`Script verification failed for transaction ${d[_].tx.id("hex")}`)}return!0}writeSerializedBEEF(e,n){this.materializeSourceTXIDs(),e.writeUInt32LE(Jo);const i=[],t=new Map,o=new Map,s=[],a=new Set,c=d=>{const h=t.get(d);if(h!==void 0)return h;const p=`${d.blockHeight}:${d.computeRoot()}`,_=o.get(p);if(_!==void 0)return i[_].combine(d),t.set(d,_),_;const w=i.length;return i.push(d),t.set(d,w),o.set(p,w),w},u=new Set,l=[{tx:this,expanded:!1}];for(;l.length>0;){const d=l.pop();if(d==null)continue;const h=d.tx.id("hex");if(d.expanded){if(a.has(h))continue;const p={tx:d.tx};d.tx.merklePath!=null&&(p.pathIndex=c(d.tx.merklePath)),a.add(h),s.push(p);continue}if(!u.has(h)&&(u.add(h),l.push({tx:d.tx,expanded:!0}),d.tx.merklePath==null))for(let p=0;p<d.tx.inputs.length;p++){const _=d.tx.inputs[p].sourceTransaction;if(_!=null)l.push({tx:_,expanded:!1});else if(n===!1)throw new Error("A required source transaction is missing!")}}e.writeVarIntNum(i.length);let f;if(e instanceof Ge){f=i.map(h=>h.toBinaryUint8Array());let d=16;for(const h of f)d+=h.length;for(const h of s)d+=h.tx.toUint8Array().length+10;e.reserve(d)}for(let d=0;d<i.length;d++)e.write(f?.[d]??i[d].toBinary());e.writeVarIntNum(s.length);for(const d of s)e.write(d.tx.toUint8Array()),typeof d.pathIndex=="number"?(e.writeUInt8(1),e.writeVarIntNum(d.pathIndex)):e.writeUInt8(0)}toBEEF(e){const n=new Ae;return this.writeSerializedBEEF(n,e),n.toArray()}toBEEFUint8Array(e){const n=new Ge;return this.writeSerializedBEEF(n,e),n.toArray()}toBEEFBytes(e){const n=new Ge;return this.writeSerializedBEEF(n,e),n.toUint8Array()}toAtomicBEEF(e){this.materializeSourceTXIDs();const n=[1,1,1,1],i=this.hash(),t=this.toBEEF(e);return n.concat(i,t)}toAtomicBEEFUint8Array(e){this.materializeSourceTXIDs();const n=new Ge,i=[1,1,1,1];n.write(i);const t=this.hash();return n.write(t),this.writeSerializedBEEF(n,e),n.toUint8Array()}async completeWithWallet(e,n,i,t){const o=this.inputs.length,s=this.outputs.length,c={description:n??`Transaction with ${o} input(s) and ${s} output(s)`,inputs:[],outputs:[],lockTime:this.lockTime,version:this.version},u=this.inputs.some(h=>h.unlockingScriptTemplate!=null);this.materializeSourceTXIDs();const l=new je;for(let h=0;h<this.inputs.length;h++){const p=this.inputs[h];if(p.sourceTransaction==null)throw new Error("All inputs must have a sourceTransaction when using completeWithWallet");l.mergeTransaction(p.sourceTransaction);const w={outpoint:`${p.sourceTransaction.id("hex")}.${p.sourceOutputIndex}`,inputDescription:"Input from source transaction",sequenceNumber:p.sequence};if(u)if(p.unlockingScriptTemplate!=null){const O=await p.unlockingScriptTemplate.estimateLength(this,h);w.unlockingScriptLength=O}else if(p.unlockingScript!=null)w.unlockingScript=p.unlockingScript.toHex();else throw new Error(`Input ${h} must have either an unlockingScript or unlockingScriptTemplate`);else{if(p.unlockingScript==null)throw new Error("All inputs must have an unlockingScript when using completeWithWallet");w.unlockingScript=p.unlockingScript.toHex()}c.inputs.push(w)}this.inputs.length>0&&(c.inputBEEF=l.toUint8Array());for(const h of this.outputs)c.outputs.push({satoshis:h.satoshis,lockingScript:h.lockingScript.toHex(),outputDescription:"Output from source transaction"});this.metadata?.labels!=null&&Array.isArray(this.metadata.labels)&&(c.labels=this.metadata.labels);let f;if(u){c.options={...t,signAndProcess:!1};const{signableTransaction:h}=await e.createAction(c,i);if(h==null)throw new Error("Wallet createAction did not return signableTransaction");const p=de.fromBEEF(h.tx),_={};for(let $=0;$<this.inputs.length;$++){const k=this.inputs[$];if(k.unlockingScriptTemplate!=null){const z=await k.unlockingScriptTemplate.sign(p,$);_[$]={unlockingScript:z.toHex()}}else k.unlockingScript!=null&&(_[$]={unlockingScript:k.unlockingScript.toHex()})}const w=t==null?void 0:{acceptDelayedBroadcast:t.acceptDelayedBroadcast,returnTXIDOnly:t.returnTXIDOnly,noSend:t.noSend,sendWith:t.sendWith},O=await e.signAction({reference:h.reference,spends:_,options:w},i);if(O.tx==null)throw new Error("Wallet signAction did not return transaction data");f=O.tx}else{t!=null&&(c.options=t);const{tx:h}=await e.createAction(c,i);if(h==null)throw new Error("Wallet createAction did not return transaction data");f=h}const d=de.fromAtomicBEEF(f);this.version=d.version,this.inputs=d.inputs,this.outputs=d.outputs,this.lockTime=d.lockTime,this.merklePath=d.merklePath,this.invalidateSerializationCaches(),this.metadata={...this.metadata,...d.metadata}}preimage(e,n,i){if(e??=0,n??=j.SIGHASH_FORKID|j.SIGHASH_ALL,e<0||e>=this.inputs.length)throw new Error("Invalid input index");const t=n&240;if(t!==224&&t!==192&&t!==64)throw new Error("FORKID must be set");const o=n&15;if(o<1||o>3)throw new Error("Invalid signature coverage, must be all, none or single");const s=this.inputs[e];if(s.sourceTransaction==null)throw new Error("Source transaction is required");const a=s.sourceTransaction.outputs[s.sourceOutputIndex];if(a==null)throw new Error(`Source transaction's output at index ${s.sourceOutputIndex} is required`);return j.format({sourceTXID:s.sourceTXID??s.sourceTransaction.id("hex"),sourceOutputIndex:s.sourceOutputIndex,sourceSatoshis:a.satoshis,transactionVersion:this.version,otherInputs:[],allInputs:this.inputs,inputIndex:e,outputs:this.outputs,inputSequence:s.sequence??4294967295,subscript:i??a.lockingScript,lockTime:this.lockTime,scope:n})}}var zu;(function(r){r[r.Silent=0]="Silent",r[r.App=1]="App",r[r.Counterparty=2]="Counterparty"})(zu||(zu={}));var Au;(function(r){r[r.unknownError=1]="unknownError",r[r.unsupportedAction=2]="unsupportedAction",r[r.invalidHmac=3]="invalidHmac",r[r.invalidSignature=4]="invalidSignature",r[r.reviewActions=5]="reviewActions",r[r.invalidParameter=6]="invalidParameter",r[r.insufficientFunds=7]="insufficientFunds"})(Au||(Au={}));var Nu;(function(r){r[r.createAction=1]="createAction",r[r.signAction=2]="signAction",r[r.abortAction=3]="abortAction",r[r.listActions=4]="listActions",r[r.internalizeAction=5]="internalizeAction",r[r.listOutputs=6]="listOutputs",r[r.relinquishOutput=7]="relinquishOutput",r[r.getPublicKey=8]="getPublicKey",r[r.revealCounterpartyKeyLinkage=9]="revealCounterpartyKeyLinkage",r[r.revealSpecificKeyLinkage=10]="revealSpecificKeyLinkage",r[r.encrypt=11]="encrypt",r[r.decrypt=12]="decrypt",r[r.createHmac=13]="createHmac",r[r.verifyHmac=14]="verifyHmac",r[r.createSignature=15]="createSignature",r[r.verifySignature=16]="verifySignature",r[r.acquireCertificate=17]="acquireCertificate",r[r.listCertificates=18]="listCertificates",r[r.proveCertificate=19]="proveCertificate",r[r.relinquishCertificate=20]="relinquishCertificate",r[r.discoverByIdentityKey=21]="discoverByIdentityKey",r[r.discoverByAttributes=22]="discoverByAttributes",r[r.isAuthenticated=23]="isAuthenticated",r[r.waitForAuthentication=24]="waitForAuthentication",r[r.getHeight=25]="getHeight",r[r.getHeaderForHeight=26]="getHeaderForHeight",r[r.getNetwork=27]="getNetwork",r[r.getVersion=28]="getVersion"})(Nu||(Nu={}));typeof globalThis<"u"&&typeof globalThis.fetch=="function"&&globalThis.fetch.bind(globalThis);const Uu=1500,Du=.25,j0=1e3,B0=6e4,F0=400,H0=30,Do=2,Ru="bsvsdk_overlay_host_reputation_v3",Z0="bsvsdk_overlay_host_reputation_v2",q0="bsvsdk_overlay_host_reputation_v1",V0=50,Cu=256,G0=720*60*60*1e3;class K0{stats;store;saveTimer=null;constructor(e){this.stats=new Map,this.store=e??this.getLocalStorageAdapter(),this.loadFromStorage()}reset(){this.stats.clear(),this.scheduleSave()}recordSuccess(e,n){const i=this.getOrCreate(e),t=Date.now(),o=Number.isFinite(n)&&n>=0?n:Uu;i.avgLatencyMs===null?i.avgLatencyMs=o:i.avgLatencyMs=(1-Du)*i.avgLatencyMs+Du*o,i.lastLatencyMs=o,i.totalSuccesses+=1,i.consecutiveFailures=0,i.backoffUntil=0,i.lastUpdatedAt=t,i.lastError=void 0,this.scheduleSave()}recordFailure(e,n){const i=this.getOrCreate(e),t=Date.now();i.totalFailures+=1,i.consecutiveFailures+=1;let o;typeof n=="string"?o=n:n instanceof Error?o=n.message:o=void 0,typeof o=="string"&&(o.includes("ERR_NAME_NOT_RESOLVED")||o.includes("ENOTFOUND")||o.includes("getaddrinfo")||o.includes("Failed to fetch"))&&i.consecutiveFailures<Do+1&&(i.consecutiveFailures=Do+1);const a=Math.max(i.consecutiveFailures-Do,0);if(a===0)i.backoffUntil=0;else{const c=Math.min(B0,j0*Math.pow(2,a-1));i.backoffUntil=t+c}i.lastUpdatedAt=t,typeof n=="string"?i.lastError=n:n instanceof Error?i.lastError=n.message:i.lastError=void 0,this.scheduleSave()}rankHosts(e,n=Date.now()){const i=new Map;e.forEach((s,a)=>{typeof s!="string"||s.length===0||i.has(s)||i.set(s,a)});const o=Array.from(i.keys()).map(s=>{const a=this.getOrCreate(s);return{...a,score:this.computeScore(a,n),originalOrder:i.get(s)??0}});return o.sort((s,a)=>{const c=s.backoffUntil>n,u=a.backoffUntil>n;return c!==u?c?1:-1:s.score!==a.score?s.score-a.score:s.totalSuccesses!==a.totalSuccesses?a.totalSuccesses-s.totalSuccesses:s.originalOrder-a.originalOrder}),o.map(({originalOrder:s,...a})=>a)}snapshot(e){const n=this.stats.get(e);return n==null?void 0:{...n}}flush(){this.saveTimer!==null&&(clearTimeout(this.saveTimer),this.saveTimer=null),this.saveToStorage()}getStorage(){try{const e=typeof globalThis=="object"?globalThis:void 0;return e?.localStorage==null?void 0:e.localStorage}catch{return}}getLocalStorageAdapter(){const e=this.getStorage();if(e!=null)return{get:n=>{try{return e.getItem(n)}catch{return null}},set:(n,i)=>{try{e.setItem(n,i)}catch{}}}}loadFromStorage(){const e=this.store;if(e!=null)try{let n=e.get(Ru);if(typeof n!="string"||n.length===0){const t=e.get(Z0);typeof t=="string"&&t.length>0&&(n=t)}if(typeof n!="string"||n.length===0){const t=e.get(q0);typeof t=="string"&&t.length>0&&(n=t)}if(typeof n!="string"||n.length===0)return;const i=JSON.parse(n);if(typeof i!="object"||i===null)return;this.stats.clear();for(const t of Object.keys(i)){const o=i[t];if(o!=null&&typeof o=="object"){const s={host:String(o.host??t),totalSuccesses:Number(o.totalSuccesses??0),totalFailures:Number(o.totalFailures??0),consecutiveFailures:Number(o.consecutiveFailures??0),avgLatencyMs:o.avgLatencyMs==null?null:Number(o.avgLatencyMs),lastLatencyMs:o.lastLatencyMs==null?null:Number(o.lastLatencyMs),backoffUntil:Number(o.backoffUntil??0),lastUpdatedAt:Number(o.lastUpdatedAt??0),lastError:typeof o.lastError=="string"?o.lastError:void 0};this.stats.set(s.host,s)}}this.prune(Date.now())}catch{}}scheduleSave(){if(this.store==null||this.saveTimer!==null)return;this.saveTimer=setTimeout(()=>{this.saveTimer=null,this.saveToStorage()},V0),this.saveTimer.unref?.()}saveToStorage(){const e=this.store;if(e!=null)try{this.prune(Date.now());const n={};for(const[i,t]of this.stats.entries())n[i]=t;e.set(Ru,JSON.stringify(n))}catch{}}computeScore(e,n){const i=e.avgLatencyMs??Uu,t=e.consecutiveFailures*F0,o=Math.min(e.totalSuccesses*H0,i/2),s=e.backoffUntil>n?e.backoffUntil-n:0;return i+t+s-o}getOrCreate(e){let n=this.stats.get(e);return n==null&&(this.prune(Date.now()),this.stats.size>=Cu&&this.evictOldestEntry(),n={host:e,totalSuccesses:0,totalFailures:0,consecutiveFailures:0,avgLatencyMs:null,lastLatencyMs:null,backoffUntil:0,lastUpdatedAt:0},this.stats.set(e,n)),n}prune(e){for(const[n,i]of this.stats)i.lastUpdatedAt>0&&e-i.lastUpdatedAt>G0&&this.stats.delete(n);for(;this.stats.size>Cu;)this.evictOldestEntry()}evictOldestEntry(){let e,n=Number.POSITIVE_INFINITY;for(const[i,t]of this.stats)t.lastUpdatedAt<n&&(e=i,n=t.lastUpdatedAt);e!==void 0&&this.stats.delete(e)}}new K0;typeof globalThis<"u"&&typeof globalThis.fetch=="function"&&globalThis.fetch.bind(globalThis);const J0="modulepreload",W0=function(r,e){return new URL(r,e).href},Lu={},X0=function(e,n,i){let t=Promise.resolve();if(n&&n.length>0){let u=function(l){return Promise.all(l.map(f=>Promise.resolve(f).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};const s=document.getElementsByTagName("link"),a=document.querySelector("meta[property=csp-nonce]"),c=a?.nonce||a?.getAttribute("nonce");t=u(n.map(l=>{if(l=W0(l,i),l in Lu)return;Lu[l]=!0;const f=l.endsWith(".css"),d=f?'[rel="stylesheet"]':"";if(i)for(let p=s.length-1;p>=0;p--){const _=s[p];if(_.href===l&&(!f||_.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${l}"]${d}`))return;const h=document.createElement("link");if(h.rel=f?"stylesheet":J0,f||(h.as="script"),h.crossOrigin="",h.href=l,c&&h.setAttribute("nonce",c),document.head.appendChild(h),f)return new Promise((p,_)=>{h.addEventListener("load",p),h.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${l}`)))})}))}function o(s){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=s,window.dispatchEvent(a),!a.defaultPrevented)throw s}return t.then(s=>{for(const a of s||[])a.status==="rejected"&&o(a.reason);return e().catch(o)})};var Mu;const cs=Object.freeze({status:"aborted"});function b(r,e,n){function i(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:s,traits:new Set},enumerable:!1}),a._zod.traits.has(r))return;a._zod.traits.add(r),e(a,c);const u=s.prototype,l=Object.keys(u);for(let f=0;f<l.length;f++){const d=l[f];d in a||(a[d]=u[d].bind(a))}}const t=n?.Parent??Object;class o extends t{}Object.defineProperty(o,"name",{value:r});function s(a){var c;const u=n?.Parent?new o:this;i(u,a),(c=u._zod).deferred??(c.deferred=[]);for(const l of u._zod.deferred)l();return u}return Object.defineProperty(s,"init",{value:i}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>n?.Parent&&a instanceof n.Parent?!0:a?._zod?.traits?.has(r)}),Object.defineProperty(s,"name",{value:r}),s}const us=Symbol("zod_brand");class zt extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class bi extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(Mu=globalThis).__zod_globalConfig??(Mu.__zod_globalConfig={});const Ln=globalThis.__zod_globalConfig;function pe(r){return r&&Object.assign(Ln,r),Ln}function Y0(r){return r}function Q0(r){return r}function eb(r){}function tb(r){throw new Error("Unexpected value in exhaustive check")}function nb(r){}function ls(r){const e=Object.values(r).filter(i=>typeof i=="number");return Object.entries(r).filter(([i,t])=>e.indexOf(+i)===-1).map(([i,t])=>t)}function I(r,e="|"){return r.map(n=>U(n)).join(e)}function ai(r,e){return typeof e=="bigint"?e.toString():e}function Hn(r){return{get value(){{const e=r();return Object.defineProperty(this,"value",{value:e}),e}}}}function jt(r){return r==null}function vi(r){const e=r.startsWith("^")?1:0,n=r.endsWith("$")?r.length-1:r.length;return r.slice(e,n)}function Yl(r,e){const n=r/e,i=Math.round(n),t=Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-i)<t?0:n-i}const ju=Symbol("evaluating");function H(r,e,n){let i;Object.defineProperty(r,e,{get(){if(i!==ju)return i===void 0&&(i=ju,i=n()),i},set(t){Object.defineProperty(r,e,{value:t})},configurable:!0})}function rb(r){return Object.create(Object.getPrototypeOf(r),Object.getOwnPropertyDescriptors(r))}function bt(r,e,n){Object.defineProperty(r,e,{value:n,writable:!0,enumerable:!0,configurable:!0})}function tt(...r){const e={};for(const n of r){const i=Object.getOwnPropertyDescriptors(n);Object.assign(e,i)}return Object.defineProperties({},e)}function ib(r){return tt(r._zod.def)}function ob(r,e){return e?e.reduce((n,i)=>n?.[i],r):r}function sb(r){const e=Object.keys(r),n=e.map(i=>r[i]);return Promise.all(n).then(i=>{const t={};for(let o=0;o<e.length;o++)t[e[o]]=i[o];return t})}function ab(r=10){const e="abcdefghijklmnopqrstuvwxyz";let n="";for(let i=0;i<r;i++)n+=e[Math.floor(Math.random()*e.length)];return n}function Xo(r){return JSON.stringify(r)}function Ql(r){return r.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const ds="captureStackTrace"in Error?Error.captureStackTrace:(...r)=>{};function en(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}const ed=Hn(()=>{if(Ln.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const r=Function;return new r(""),!0}catch{return!1}});function Dt(r){if(en(r)===!1)return!1;const e=r.constructor;if(e===void 0||typeof e!="function")return!0;const n=e.prototype;return!(en(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function yi(r){return Dt(r)?{...r}:Array.isArray(r)?[...r]:r instanceof Map?new Map(r):r instanceof Set?new Set(r):r}function cb(r){let e=0;for(const n in r)Object.prototype.hasOwnProperty.call(r,n)&&e++;return e}const ub=r=>{const e=typeof r;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(r)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(r)?"array":r===null?"null":r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?"promise":typeof Map<"u"&&r instanceof Map?"map":typeof Set<"u"&&r instanceof Set?"set":typeof Date<"u"&&r instanceof Date?"date":typeof File<"u"&&r instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},ci=new Set(["string","number","symbol"]),td=new Set(["string","number","bigint","boolean","symbol","undefined"]);function st(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ce(r,e,n){const i=new r._zod.constr(e??r._zod.def);return(!e||n?.parent)&&(i._zod.parent=r),i}function S(r){const e=r;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 lb(r){let e;return new Proxy({},{get(n,i,t){return e??(e=r()),Reflect.get(e,i,t)},set(n,i,t,o){return e??(e=r()),Reflect.set(e,i,t,o)},has(n,i){return e??(e=r()),Reflect.has(e,i)},deleteProperty(n,i){return e??(e=r()),Reflect.deleteProperty(e,i)},ownKeys(n){return e??(e=r()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(n,i){return e??(e=r()),Reflect.getOwnPropertyDescriptor(e,i)},defineProperty(n,i,t){return e??(e=r()),Reflect.defineProperty(e,i,t)}})}function U(r){return typeof r=="bigint"?r.toString()+"n":typeof r=="string"?`"${r}"`:`${r}`}function nd(r){return Object.keys(r).filter(e=>r[e]._zod.optin==="optional"&&r[e]._zod.optout==="optional")}const rd={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]},id={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function od(r,e){const n=r._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const o=tt(r._zod.def,{get shape(){const s={};for(const a in e){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&(s[a]=n.shape[a])}return bt(this,"shape",s),s},checks:[]});return Ce(r,o)}function sd(r,e){const n=r._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const o=tt(r._zod.def,{get shape(){const s={...r._zod.def.shape};for(const a in e){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&delete s[a]}return bt(this,"shape",s),s},checks:[]});return Ce(r,o)}function ad(r,e){if(!Dt(e))throw new Error("Invalid input to extend: expected a plain object");const n=r._zod.def.checks;if(n&&n.length>0){const o=r._zod.def.shape;for(const s in e)if(Object.getOwnPropertyDescriptor(o,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const t=tt(r._zod.def,{get shape(){const o={...r._zod.def.shape,...e};return bt(this,"shape",o),o}});return Ce(r,t)}function cd(r,e){if(!Dt(e))throw new Error("Invalid input to safeExtend: expected a plain object");const n=tt(r._zod.def,{get shape(){const i={...r._zod.def.shape,...e};return bt(this,"shape",i),i}});return Ce(r,n)}function ud(r,e){if(r._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const n=tt(r._zod.def,{get shape(){const i={...r._zod.def.shape,...e._zod.def.shape};return bt(this,"shape",i),i},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return Ce(r,n)}function ld(r,e,n){const t=e._zod.def.checks;if(t&&t.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const s=tt(e._zod.def,{get shape(){const a=e._zod.def.shape,c={...a};if(n)for(const u in n){if(!(u in a))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(c[u]=r?new r({type:"optional",innerType:a[u]}):a[u])}else for(const u in a)c[u]=r?new r({type:"optional",innerType:a[u]}):a[u];return bt(this,"shape",c),c},checks:[]});return Ce(e,s)}function dd(r,e,n){const i=tt(e._zod.def,{get shape(){const t=e._zod.def.shape,o={...t};if(n)for(const s in n){if(!(s in o))throw new Error(`Unrecognized key: "${s}"`);n[s]&&(o[s]=new r({type:"nonoptional",innerType:t[s]}))}else for(const s in t)o[s]=new r({type:"nonoptional",innerType:t[s]});return bt(this,"shape",o),o}});return Ce(e,i)}function Et(r,e=0){if(r.aborted===!0)return!0;for(let n=e;n<r.issues.length;n++)if(r.issues[n]?.continue!==!0)return!0;return!1}function fd(r,e=0){if(r.aborted===!0)return!0;for(let n=e;n<r.issues.length;n++)if(r.issues[n]?.continue===!1)return!0;return!1}function He(r,e){return e.map(n=>{var i;return(i=n).path??(i.path=[]),n.path.unshift(r),n})}function An(r){return typeof r=="string"?r:r?.message}function Re(r,e,n){const i=r.message?r.message:An(r.inst?._zod.def?.error?.(r))??An(e?.error?.(r))??An(n.customError?.(r))??An(n.localeError?.(r))??"Invalid input",{inst:t,continue:o,input:s,...a}=r;return a.path??(a.path=[]),a.message=i,e?.reportInput&&(a.input=s),a}function _i(r){return r instanceof Set?"set":r instanceof Map?"map":r instanceof File?"file":"unknown"}function xi(r){return Array.isArray(r)?"array":typeof r=="string"?"string":"unknown"}function D(r){const e=typeof r;switch(e){case"number":return Number.isNaN(r)?"nan":"number";case"object":{if(r===null)return"null";if(Array.isArray(r))return"array";const n=r;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return e}function tn(...r){const[e,n,i]=r;return typeof e=="string"?{message:e,code:"custom",input:n,inst:i}:{...e}}function db(r){return Object.entries(r).filter(([e,n])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function hd(r){const e=atob(r),n=new Uint8Array(e.length);for(let i=0;i<e.length;i++)n[i]=e.charCodeAt(i);return n}function pd(r){let e="";for(let n=0;n<r.length;n++)e+=String.fromCharCode(r[n]);return btoa(e)}function fb(r){const e=r.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-e.length%4)%4);return hd(e+n)}function hb(r){return pd(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function pb(r){const e=r.replace(/^0x/,"");if(e.length%2!==0)throw new Error("Invalid hex string length");const n=new Uint8Array(e.length/2);for(let i=0;i<e.length;i+=2)n[i/2]=Number.parseInt(e.slice(i,i+2),16);return n}function mb(r){return Array.from(r).map(e=>e.toString(16).padStart(2,"0")).join("")}class gb{constructor(...e){}}const fs=Object.freeze(Object.defineProperty({__proto__:null,BIGINT_FORMAT_RANGES:id,Class:gb,NUMBER_FORMAT_RANGES:rd,aborted:Et,allowsEval:ed,assert:nb,assertEqual:Y0,assertIs:eb,assertNever:tb,assertNotEqual:Q0,assignProp:bt,base64ToUint8Array:hd,base64urlToUint8Array:fb,cached:Hn,captureStackTrace:ds,cleanEnum:db,cleanRegex:vi,clone:Ce,cloneDef:ib,createTransparentProxy:lb,defineLazy:H,esc:Xo,escapeRegex:st,explicitlyAborted:fd,extend:ad,finalizeIssue:Re,floatSafeRemainder:Yl,getElementAtPath:ob,getEnumValues:ls,getLengthableOrigin:xi,getParsedType:ub,getSizableOrigin:_i,hexToUint8Array:pb,isObject:en,isPlainObject:Dt,issue:tn,joinValues:I,jsonStringifyReplacer:ai,merge:ud,mergeDefs:tt,normalizeParams:S,nullish:jt,numKeys:cb,objectClone:rb,omit:sd,optionalKeys:nd,parsedType:D,partial:ld,pick:od,prefixIssues:He,primitiveTypes:td,promiseAllObject:sb,propertyKeyTypes:ci,randomString:ab,required:dd,safeExtend:cd,shallowClone:yi,slugify:Ql,stringifyPrimitive:U,uint8ArrayToBase64:pd,uint8ArrayToBase64url:hb,uint8ArrayToHex:mb,unwrapMessage:An},Symbol.toStringTag,{value:"Module"})),md=(r,e)=>{r.name="$ZodError",Object.defineProperty(r,"_zod",{value:r._zod,enumerable:!1}),Object.defineProperty(r,"issues",{value:e,enumerable:!1}),r.message=JSON.stringify(e,ai,2),Object.defineProperty(r,"toString",{value:()=>r.message,enumerable:!1})},hs=b("$ZodError",md),Le=b("$ZodError",md,{Parent:Error});function wi(r,e=n=>n.message){const n={},i=[];for(const t of r.issues)t.path.length>0?(n[t.path[0]]=n[t.path[0]]||[],n[t.path[0]].push(e(t))):i.push(e(t));return{formErrors:i,fieldErrors:n}}function Si(r,e=n=>n.message){const n={_errors:[]},i=(t,o=[])=>{for(const s of t.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>i({issues:a},[...o,...s.path]));else if(s.code==="invalid_key")i({issues:s.issues},[...o,...s.path]);else if(s.code==="invalid_element")i({issues:s.issues},[...o,...s.path]);else{const a=[...o,...s.path];if(a.length===0)n._errors.push(e(s));else{let c=n,u=0;for(;u<a.length;){const l=a[u];u===a.length-1?(c[l]=c[l]||{_errors:[]},c[l]._errors.push(e(s))):c[l]=c[l]||{_errors:[]},c=c[l],u++}}}};return i(r),n}function ps(r,e=n=>n.message){const n={errors:[]},i=(t,o=[])=>{var s,a;for(const c of t.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(u=>i({issues:u},[...o,...c.path]));else if(c.code==="invalid_key")i({issues:c.issues},[...o,...c.path]);else if(c.code==="invalid_element")i({issues:c.issues},[...o,...c.path]);else{const u=[...o,...c.path];if(u.length===0){n.errors.push(e(c));continue}let l=n,f=0;for(;f<u.length;){const d=u[f],h=f===u.length-1;typeof d=="string"?(l.properties??(l.properties={}),(s=l.properties)[d]??(s[d]={errors:[]}),l=l.properties[d]):(l.items??(l.items=[]),(a=l.items)[d]??(a[d]={errors:[]}),l=l.items[d]),h&&l.errors.push(e(c)),f++}}};return i(r),n}function gd(r){const e=[],n=r.map(i=>typeof i=="object"?i.key:i);for(const i of n)typeof i=="number"?e.push(`[${i}]`):typeof i=="symbol"?e.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?e.push(`[${JSON.stringify(i)}]`):(e.length&&e.push("."),e.push(i));return e.join("")}function ms(r){const e=[],n=[...r.issues].sort((i,t)=>(i.path??[]).length-(t.path??[]).length);for(const i of n)e.push(`✖ ${i.message}`),i.path?.length&&e.push(` → at ${gd(i.path)}`);return e.join(`
1093
+ `)}const Zn=r=>(e,n,i,t)=>{const o=i?{...i,async:!1}:{async:!1},s=e._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new zt;if(s.issues.length){const a=new(t?.Err??r)(s.issues.map(c=>Re(c,o,pe())));throw ds(a,t?.callee),a}return s.value},Yo=Zn(Le),qn=r=>async(e,n,i,t)=>{const o=i?{...i,async:!0}:{async:!0};let s=e._zod.run({value:n,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){const a=new(t?.Err??r)(s.issues.map(c=>Re(c,o,pe())));throw ds(a,t?.callee),a}return s.value},Qo=qn(Le),Vn=r=>(e,n,i)=>{const t=i?{...i,async:!1}:{async:!1},o=e._zod.run({value:n,issues:[]},t);if(o instanceof Promise)throw new zt;return o.issues.length?{success:!1,error:new(r??hs)(o.issues.map(s=>Re(s,t,pe())))}:{success:!0,data:o.value}},gs=Vn(Le),Gn=r=>async(e,n,i)=>{const t=i?{...i,async:!0}:{async:!0};let o=e._zod.run({value:n,issues:[]},t);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new r(o.issues.map(s=>Re(s,t,pe())))}:{success:!0,data:o.value}},bd=Gn(Le),bs=r=>(e,n,i)=>{const t=i?{...i,direction:"backward"}:{direction:"backward"};return Zn(r)(e,n,t)},bb=bs(Le),vs=r=>(e,n,i)=>Zn(r)(e,n,i),vb=vs(Le),ys=r=>async(e,n,i)=>{const t=i?{...i,direction:"backward"}:{direction:"backward"};return qn(r)(e,n,t)},yb=ys(Le),_s=r=>async(e,n,i)=>qn(r)(e,n,i),_b=_s(Le),xs=r=>(e,n,i)=>{const t=i?{...i,direction:"backward"}:{direction:"backward"};return Vn(r)(e,n,t)},xb=xs(Le),ws=r=>(e,n,i)=>Vn(r)(e,n,i),wb=ws(Le),Ss=r=>async(e,n,i)=>{const t=i?{...i,direction:"backward"}:{direction:"backward"};return Gn(r)(e,n,t)},Sb=Ss(Le),ks=r=>async(e,n,i)=>Gn(r)(e,n,i),kb=ks(Le),vd=/^[cC][0-9a-z]{6,}$/,yd=/^[0-9a-z]+$/,_d=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,xd=/^[0-9a-vA-V]{20}$/,wd=/^[A-Za-z0-9]{27}$/,Sd=/^[a-zA-Z0-9_-]{21}$/,kd=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ib=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Id=/^([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})$/,nn=r=>r?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${r}[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)$/,$b=nn(4),Eb=nn(6),Tb=nn(7),$d=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Ob=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Pb=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Ed=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,zb=Ed,Ab=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Nb="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Td(){return new RegExp(Nb,"u")}const Od=/^(?:(?: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])$/,Pd=/^(([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}|:))$/,zd=r=>{const e=st(r??":");return new RegExp(`^(?:[0-9A-F]{2}${e}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${e}){5}[0-9a-f]{2}$`)},Ad=/^((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])$/,Nd=/^(([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])$/,Ud=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Is=/^[A-Za-z0-9_-]*$/,Dd=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Rd=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,$s=/^https?$/,Cd=/^\+[1-9]\d{6,14}$/,Ld="(?:(?:\\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])))",Md=new RegExp(`^${Ld}$`);function jd(r){const e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof r.precision=="number"?r.precision===-1?`${e}`:r.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${r.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Bd(r){return new RegExp(`^${jd(r)}$`)}function Fd(r){const e=jd({precision:r.precision}),n=["Z"];r.local&&n.push(""),r.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const i=`${e}(?:${n.join("|")})`;return new RegExp(`^${Ld}T(?:${i})$`)}const Hd=r=>{const e=r?`[\\s\\S]{${r?.minimum??0},${r?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},Zd=/^-?\d+n?$/,qd=/^-?\d+$/,Es=/^-?\d+(?:\.\d+)?$/,Vd=/^(?:true|false)$/i,Gd=/^null$/i,Kd=/^undefined$/i,Jd=/^[^A-Z]*$/,Wd=/^[^a-z]*$/,Xd=/^[0-9a-fA-F]*$/;function Kn(r,e){return new RegExp(`^[A-Za-z0-9+/]{${r}}${e}$`)}function Jn(r){return new RegExp(`^[A-Za-z0-9_-]{${r}}$`)}const Ub=/^[0-9a-fA-F]{32}$/,Db=Kn(22,"=="),Rb=Jn(22),Cb=/^[0-9a-fA-F]{40}$/,Lb=Kn(27,"="),Mb=Jn(27),jb=/^[0-9a-fA-F]{64}$/,Bb=Kn(43,"="),Fb=Jn(43),Hb=/^[0-9a-fA-F]{96}$/,Zb=Kn(64,""),qb=Jn(64),Vb=/^[0-9a-fA-F]{128}$/,Gb=Kn(86,"=="),Kb=Jn(86),ki=Object.freeze(Object.defineProperty({__proto__:null,base64:Ud,base64url:Is,bigint:Zd,boolean:Vd,browserEmail:Ab,cidrv4:Ad,cidrv6:Nd,cuid:vd,cuid2:yd,date:Md,datetime:Fd,domain:Rd,duration:kd,e164:Cd,email:$d,emoji:Td,extendedDuration:Ib,guid:Id,hex:Xd,hostname:Dd,html5Email:Ob,httpProtocol:$s,idnEmail:zb,integer:qd,ipv4:Od,ipv6:Pd,ksuid:wd,lowercase:Jd,mac:zd,md5_base64:Db,md5_base64url:Rb,md5_hex:Ub,nanoid:Sd,null:Gd,number:Es,rfc5322Email:Pb,sha1_base64:Lb,sha1_base64url:Mb,sha1_hex:Cb,sha256_base64:Bb,sha256_base64url:Fb,sha256_hex:jb,sha384_base64:Zb,sha384_base64url:qb,sha384_hex:Hb,sha512_base64:Gb,sha512_base64url:Kb,sha512_hex:Vb,string:Hd,time:Bd,ulid:_d,undefined:Kd,unicodeEmail:Ed,uppercase:Wd,uuid:nn,uuid4:$b,uuid6:Eb,uuid7:Tb,xid:xd},Symbol.toStringTag,{value:"Module"})),ae=b("$ZodCheck",(r,e)=>{var n;r._zod??(r._zod={}),r._zod.def=e,(n=r._zod).onattach??(n.onattach=[])}),Yd={number:"number",bigint:"bigint",object:"date"},Ts=b("$ZodCheckLessThan",(r,e)=>{ae.init(r,e);const n=Yd[typeof e.value];r._zod.onattach.push(i=>{const t=i._zod.bag,o=(e.inclusive?t.maximum:t.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<o&&(e.inclusive?t.maximum=e.value:t.exclusiveMaximum=e.value)}),r._zod.check=i=>{(e.inclusive?i.value<=e.value:i.value<e.value)||i.issues.push({origin:n,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:i.value,inclusive:e.inclusive,inst:r,continue:!e.abort})}}),Os=b("$ZodCheckGreaterThan",(r,e)=>{ae.init(r,e);const n=Yd[typeof e.value];r._zod.onattach.push(i=>{const t=i._zod.bag,o=(e.inclusive?t.minimum:t.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>o&&(e.inclusive?t.minimum=e.value:t.exclusiveMinimum=e.value)}),r._zod.check=i=>{(e.inclusive?i.value>=e.value:i.value>e.value)||i.issues.push({origin:n,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:i.value,inclusive:e.inclusive,inst:r,continue:!e.abort})}}),Qd=b("$ZodCheckMultipleOf",(r,e)=>{ae.init(r,e),r._zod.onattach.push(n=>{var i;(i=n._zod.bag).multipleOf??(i.multipleOf=e.value)}),r._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):Yl(n.value,e.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:e.value,input:n.value,inst:r,continue:!e.abort})}}),ef=b("$ZodCheckNumberFormat",(r,e)=>{ae.init(r,e),e.format=e.format||"float64";const n=e.format?.includes("int"),i=n?"int":"number",[t,o]=rd[e.format];r._zod.onattach.push(s=>{const a=s._zod.bag;a.format=e.format,a.minimum=t,a.maximum=o,n&&(a.pattern=qd)}),r._zod.check=s=>{const a=s.value;if(n){if(!Number.isInteger(a)){s.issues.push({expected:i,format:e.format,code:"invalid_type",continue:!1,input:a,inst:r});return}if(!Number.isSafeInteger(a)){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:r,origin:i,inclusive:!0,continue:!e.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:r,origin:i,inclusive:!0,continue:!e.abort});return}}a<t&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:t,inclusive:!0,inst:r,continue:!e.abort}),a>o&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:o,inclusive:!0,inst:r,continue:!e.abort})}}),tf=b("$ZodCheckBigIntFormat",(r,e)=>{ae.init(r,e);const[n,i]=id[e.format];r._zod.onattach.push(t=>{const o=t._zod.bag;o.format=e.format,o.minimum=n,o.maximum=i}),r._zod.check=t=>{const o=t.value;o<n&&t.issues.push({origin:"bigint",input:o,code:"too_small",minimum:n,inclusive:!0,inst:r,continue:!e.abort}),o>i&&t.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inclusive:!0,inst:r,continue:!e.abort})}}),nf=b("$ZodCheckMaxSize",(r,e)=>{var n;ae.init(r,e),(n=r._zod.def).when??(n.when=i=>{const t=i.value;return!jt(t)&&t.size!==void 0}),r._zod.onattach.push(i=>{const t=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<t&&(i._zod.bag.maximum=e.maximum)}),r._zod.check=i=>{const t=i.value;t.size<=e.maximum||i.issues.push({origin:_i(t),code:"too_big",maximum:e.maximum,inclusive:!0,input:t,inst:r,continue:!e.abort})}}),rf=b("$ZodCheckMinSize",(r,e)=>{var n;ae.init(r,e),(n=r._zod.def).when??(n.when=i=>{const t=i.value;return!jt(t)&&t.size!==void 0}),r._zod.onattach.push(i=>{const t=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>t&&(i._zod.bag.minimum=e.minimum)}),r._zod.check=i=>{const t=i.value;t.size>=e.minimum||i.issues.push({origin:_i(t),code:"too_small",minimum:e.minimum,inclusive:!0,input:t,inst:r,continue:!e.abort})}}),of=b("$ZodCheckSizeEquals",(r,e)=>{var n;ae.init(r,e),(n=r._zod.def).when??(n.when=i=>{const t=i.value;return!jt(t)&&t.size!==void 0}),r._zod.onattach.push(i=>{const t=i._zod.bag;t.minimum=e.size,t.maximum=e.size,t.size=e.size}),r._zod.check=i=>{const t=i.value,o=t.size;if(o===e.size)return;const s=o>e.size;i.issues.push({origin:_i(t),...s?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:i.value,inst:r,continue:!e.abort})}}),sf=b("$ZodCheckMaxLength",(r,e)=>{var n;ae.init(r,e),(n=r._zod.def).when??(n.when=i=>{const t=i.value;return!jt(t)&&t.length!==void 0}),r._zod.onattach.push(i=>{const t=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<t&&(i._zod.bag.maximum=e.maximum)}),r._zod.check=i=>{const t=i.value;if(t.length<=e.maximum)return;const s=xi(t);i.issues.push({origin:s,code:"too_big",maximum:e.maximum,inclusive:!0,input:t,inst:r,continue:!e.abort})}}),af=b("$ZodCheckMinLength",(r,e)=>{var n;ae.init(r,e),(n=r._zod.def).when??(n.when=i=>{const t=i.value;return!jt(t)&&t.length!==void 0}),r._zod.onattach.push(i=>{const t=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>t&&(i._zod.bag.minimum=e.minimum)}),r._zod.check=i=>{const t=i.value;if(t.length>=e.minimum)return;const s=xi(t);i.issues.push({origin:s,code:"too_small",minimum:e.minimum,inclusive:!0,input:t,inst:r,continue:!e.abort})}}),cf=b("$ZodCheckLengthEquals",(r,e)=>{var n;ae.init(r,e),(n=r._zod.def).when??(n.when=i=>{const t=i.value;return!jt(t)&&t.length!==void 0}),r._zod.onattach.push(i=>{const t=i._zod.bag;t.minimum=e.length,t.maximum=e.length,t.length=e.length}),r._zod.check=i=>{const t=i.value,o=t.length;if(o===e.length)return;const s=xi(t),a=o>e.length;i.issues.push({origin:s,...a?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:i.value,inst:r,continue:!e.abort})}}),Wn=b("$ZodCheckStringFormat",(r,e)=>{var n,i;ae.init(r,e),r._zod.onattach.push(t=>{const o=t._zod.bag;o.format=e.format,e.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(e.pattern))}),e.pattern?(n=r._zod).check??(n.check=t=>{e.pattern.lastIndex=0,!e.pattern.test(t.value)&&t.issues.push({origin:"string",code:"invalid_format",format:e.format,input:t.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:r,continue:!e.abort})}):(i=r._zod).check??(i.check=()=>{})}),uf=b("$ZodCheckRegex",(r,e)=>{Wn.init(r,e),r._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:r,continue:!e.abort})}}),lf=b("$ZodCheckLowerCase",(r,e)=>{e.pattern??(e.pattern=Jd),Wn.init(r,e)}),df=b("$ZodCheckUpperCase",(r,e)=>{e.pattern??(e.pattern=Wd),Wn.init(r,e)}),ff=b("$ZodCheckIncludes",(r,e)=>{ae.init(r,e);const n=st(e.includes),i=new RegExp(typeof e.position=="number"?`^.{${e.position}}${n}`:n);e.pattern=i,r._zod.onattach.push(t=>{const o=t._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(i)}),r._zod.check=t=>{t.value.includes(e.includes,e.position)||t.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:t.value,inst:r,continue:!e.abort})}}),hf=b("$ZodCheckStartsWith",(r,e)=>{ae.init(r,e);const n=new RegExp(`^${st(e.prefix)}.*`);e.pattern??(e.pattern=n),r._zod.onattach.push(i=>{const t=i._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),r._zod.check=i=>{i.value.startsWith(e.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:i.value,inst:r,continue:!e.abort})}}),pf=b("$ZodCheckEndsWith",(r,e)=>{ae.init(r,e);const n=new RegExp(`.*${st(e.suffix)}$`);e.pattern??(e.pattern=n),r._zod.onattach.push(i=>{const t=i._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),r._zod.check=i=>{i.value.endsWith(e.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:i.value,inst:r,continue:!e.abort})}});function Bu(r,e,n){r.issues.length&&e.issues.push(...He(n,r.issues))}const mf=b("$ZodCheckProperty",(r,e)=>{ae.init(r,e),r._zod.check=n=>{const i=e.schema._zod.run({value:n.value[e.property],issues:[]},{});if(i instanceof Promise)return i.then(t=>Bu(t,n,e.property));Bu(i,n,e.property)}}),gf=b("$ZodCheckMimeType",(r,e)=>{ae.init(r,e);const n=new Set(e.mime);r._zod.onattach.push(i=>{i._zod.bag.mime=e.mime}),r._zod.check=i=>{n.has(i.value.type)||i.issues.push({code:"invalid_value",values:e.mime,input:i.value.type,inst:r,continue:!e.abort})}}),bf=b("$ZodCheckOverwrite",(r,e)=>{ae.init(r,e),r._zod.check=n=>{n.value=e.tx(n.value)}});class vf{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 i=e.split(`
1094
+ `).filter(s=>s),t=Math.min(...i.map(s=>s.length-s.trimStart().length)),o=i.map(s=>s.slice(t)).map(s=>" ".repeat(this.indent*2)+s);for(const s of o)this.content.push(s)}compile(){const e=Function,n=this?.args,t=[...(this?.content??[""]).map(o=>` ${o}`)];return new e(...n,t.join(`
1095
+ `))}}const yf={major:4,minor:4,patch:3},C=b("$ZodType",(r,e)=>{var n;r??(r={}),r._zod.def=e,r._zod.bag=r._zod.bag||{},r._zod.version=yf;const i=[...r._zod.def.checks??[]];r._zod.traits.has("$ZodCheck")&&i.unshift(r);for(const t of i)for(const o of t._zod.onattach)o(r);if(i.length===0)(n=r._zod).deferred??(n.deferred=[]),r._zod.deferred?.push(()=>{r._zod.run=r._zod.parse});else{const t=(s,a,c)=>{let u=Et(s),l;for(const f of a){if(f._zod.def.when){if(fd(s)||!f._zod.def.when(s))continue}else if(u)continue;const d=s.issues.length,h=f._zod.check(s);if(h instanceof Promise&&c?.async===!1)throw new zt;if(l||h instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await h,s.issues.length!==d&&(u||(u=Et(s,d)))});else{if(s.issues.length===d)continue;u||(u=Et(s,d))}}return l?l.then(()=>s):s},o=(s,a,c)=>{if(Et(s))return s.aborted=!0,s;const u=t(a,i,c);if(u instanceof Promise){if(c.async===!1)throw new zt;return u.then(l=>r._zod.parse(l,c))}return r._zod.parse(u,c)};r._zod.run=(s,a)=>{if(a.skipChecks)return r._zod.parse(s,a);if(a.direction==="backward"){const u=r._zod.parse({value:s.value,issues:[]},{...a,skipChecks:!0});return u instanceof Promise?u.then(l=>o(l,s,a)):o(u,s,a)}const c=r._zod.parse(s,a);if(c instanceof Promise){if(a.async===!1)throw new zt;return c.then(u=>t(u,i,a))}return t(c,i,a)}}H(r,"~standard",()=>({validate:t=>{try{const o=gs(r,t);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return bd(r,t).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}))}),Xn=b("$ZodString",(r,e)=>{C.init(r,e),r._zod.pattern=[...r?._zod.bag?.patterns??[]].pop()??Hd(r._zod.bag),r._zod.parse=(n,i)=>{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:r}),n}}),ie=b("$ZodStringFormat",(r,e)=>{Wn.init(r,e),Xn.init(r,e)}),_f=b("$ZodGUID",(r,e)=>{e.pattern??(e.pattern=Id),ie.init(r,e)}),xf=b("$ZodUUID",(r,e)=>{if(e.version){const i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(i===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=nn(i))}else e.pattern??(e.pattern=nn());ie.init(r,e)}),wf=b("$ZodEmail",(r,e)=>{e.pattern??(e.pattern=$d),ie.init(r,e)}),Sf=b("$ZodURL",(r,e)=>{ie.init(r,e),r._zod.check=n=>{try{const i=n.value.trim();if(!e.normalize&&e.protocol?.source===$s.source&&!/^https?:\/\//i.test(i)){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:r,continue:!e.abort});return}const t=new URL(i);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(t.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:n.value,inst:r,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(t.protocol.endsWith(":")?t.protocol.slice(0,-1):t.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:n.value,inst:r,continue:!e.abort})),e.normalize?n.value=t.href:n.value=i;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:r,continue:!e.abort})}}}),kf=b("$ZodEmoji",(r,e)=>{e.pattern??(e.pattern=Td()),ie.init(r,e)}),If=b("$ZodNanoID",(r,e)=>{e.pattern??(e.pattern=Sd),ie.init(r,e)}),$f=b("$ZodCUID",(r,e)=>{e.pattern??(e.pattern=vd),ie.init(r,e)}),Ef=b("$ZodCUID2",(r,e)=>{e.pattern??(e.pattern=yd),ie.init(r,e)}),Tf=b("$ZodULID",(r,e)=>{e.pattern??(e.pattern=_d),ie.init(r,e)}),Of=b("$ZodXID",(r,e)=>{e.pattern??(e.pattern=xd),ie.init(r,e)}),Pf=b("$ZodKSUID",(r,e)=>{e.pattern??(e.pattern=wd),ie.init(r,e)}),zf=b("$ZodISODateTime",(r,e)=>{e.pattern??(e.pattern=Fd(e)),ie.init(r,e)}),Af=b("$ZodISODate",(r,e)=>{e.pattern??(e.pattern=Md),ie.init(r,e)}),Nf=b("$ZodISOTime",(r,e)=>{e.pattern??(e.pattern=Bd(e)),ie.init(r,e)}),Uf=b("$ZodISODuration",(r,e)=>{e.pattern??(e.pattern=kd),ie.init(r,e)}),Df=b("$ZodIPv4",(r,e)=>{e.pattern??(e.pattern=Od),ie.init(r,e),r._zod.bag.format="ipv4"}),Rf=b("$ZodIPv6",(r,e)=>{e.pattern??(e.pattern=Pd),ie.init(r,e),r._zod.bag.format="ipv6",r._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:r,continue:!e.abort})}}}),Cf=b("$ZodMAC",(r,e)=>{e.pattern??(e.pattern=zd(e.delimiter)),ie.init(r,e),r._zod.bag.format="mac"}),Lf=b("$ZodCIDRv4",(r,e)=>{e.pattern??(e.pattern=Ad),ie.init(r,e)}),Mf=b("$ZodCIDRv6",(r,e)=>{e.pattern??(e.pattern=Nd),ie.init(r,e),r._zod.check=n=>{const i=n.value.split("/");try{if(i.length!==2)throw new Error;const[t,o]=i;if(!o)throw new Error;const s=Number(o);if(`${s}`!==o)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${t}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:r,continue:!e.abort})}}});function Ps(r){if(r==="")return!0;if(/\s/.test(r)||r.length%4!==0)return!1;try{return atob(r),!0}catch{return!1}}const jf=b("$ZodBase64",(r,e)=>{e.pattern??(e.pattern=Ud),ie.init(r,e),r._zod.bag.contentEncoding="base64",r._zod.check=n=>{Ps(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:r,continue:!e.abort})}});function Bf(r){if(!Is.test(r))return!1;const e=r.replace(/[-_]/g,i=>i==="-"?"+":"/"),n=e.padEnd(Math.ceil(e.length/4)*4,"=");return Ps(n)}const Ff=b("$ZodBase64URL",(r,e)=>{e.pattern??(e.pattern=Is),ie.init(r,e),r._zod.bag.contentEncoding="base64url",r._zod.check=n=>{Bf(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:r,continue:!e.abort})}}),Hf=b("$ZodE164",(r,e)=>{e.pattern??(e.pattern=Cd),ie.init(r,e)});function Zf(r,e=null){try{const n=r.split(".");if(n.length!==3)return!1;const[i]=n;if(!i)return!1;const t=JSON.parse(atob(i));return!("typ"in t&&t?.typ!=="JWT"||!t.alg||e&&(!("alg"in t)||t.alg!==e))}catch{return!1}}const qf=b("$ZodJWT",(r,e)=>{ie.init(r,e),r._zod.check=n=>{Zf(n.value,e.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:r,continue:!e.abort})}}),Vf=b("$ZodCustomStringFormat",(r,e)=>{ie.init(r,e),r._zod.check=n=>{e.fn(n.value)||n.issues.push({code:"invalid_format",format:e.format,input:n.value,inst:r,continue:!e.abort})}}),zs=b("$ZodNumber",(r,e)=>{C.init(r,e),r._zod.pattern=r._zod.bag.pattern??Es,r._zod.parse=(n,i)=>{if(e.coerce)try{n.value=Number(n.value)}catch{}const t=n.value;if(typeof t=="number"&&!Number.isNaN(t)&&Number.isFinite(t))return n;const o=typeof t=="number"?Number.isNaN(t)?"NaN":Number.isFinite(t)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:t,inst:r,...o?{received:o}:{}}),n}}),Gf=b("$ZodNumberFormat",(r,e)=>{ef.init(r,e),zs.init(r,e)}),As=b("$ZodBoolean",(r,e)=>{C.init(r,e),r._zod.pattern=Vd,r._zod.parse=(n,i)=>{if(e.coerce)try{n.value=!!n.value}catch{}const t=n.value;return typeof t=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:t,inst:r}),n}}),Ns=b("$ZodBigInt",(r,e)=>{C.init(r,e),r._zod.pattern=Zd,r._zod.parse=(n,i)=>{if(e.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value=="bigint"||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:r}),n}}),Kf=b("$ZodBigIntFormat",(r,e)=>{tf.init(r,e),Ns.init(r,e)}),Jf=b("$ZodSymbol",(r,e)=>{C.init(r,e),r._zod.parse=(n,i)=>{const t=n.value;return typeof t=="symbol"||n.issues.push({expected:"symbol",code:"invalid_type",input:t,inst:r}),n}}),Wf=b("$ZodUndefined",(r,e)=>{C.init(r,e),r._zod.pattern=Kd,r._zod.values=new Set([void 0]),r._zod.parse=(n,i)=>{const t=n.value;return typeof t>"u"||n.issues.push({expected:"undefined",code:"invalid_type",input:t,inst:r}),n}}),Xf=b("$ZodNull",(r,e)=>{C.init(r,e),r._zod.pattern=Gd,r._zod.values=new Set([null]),r._zod.parse=(n,i)=>{const t=n.value;return t===null||n.issues.push({expected:"null",code:"invalid_type",input:t,inst:r}),n}}),Yf=b("$ZodAny",(r,e)=>{C.init(r,e),r._zod.parse=n=>n}),Qf=b("$ZodUnknown",(r,e)=>{C.init(r,e),r._zod.parse=n=>n}),eh=b("$ZodNever",(r,e)=>{C.init(r,e),r._zod.parse=(n,i)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:r}),n)}),th=b("$ZodVoid",(r,e)=>{C.init(r,e),r._zod.parse=(n,i)=>{const t=n.value;return typeof t>"u"||n.issues.push({expected:"void",code:"invalid_type",input:t,inst:r}),n}}),nh=b("$ZodDate",(r,e)=>{C.init(r,e),r._zod.parse=(n,i)=>{if(e.coerce)try{n.value=new Date(n.value)}catch{}const t=n.value,o=t instanceof Date;return o&&!Number.isNaN(t.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:t,...o?{received:"Invalid Date"}:{},inst:r}),n}});function Fu(r,e,n){r.issues.length&&e.issues.push(...He(n,r.issues)),e.value[n]=r.value}const rh=b("$ZodArray",(r,e)=>{C.init(r,e),r._zod.parse=(n,i)=>{const t=n.value;if(!Array.isArray(t))return n.issues.push({expected:"array",code:"invalid_type",input:t,inst:r}),n;n.value=Array(t.length);const o=[];for(let s=0;s<t.length;s++){const a=t[s],c=e.element._zod.run({value:a,issues:[]},i);c instanceof Promise?o.push(c.then(u=>Fu(u,n,s))):Fu(c,n,s)}return o.length?Promise.all(o).then(()=>n):n}});function ui(r,e,n,i,t,o){const s=n in i;if(r.issues.length){if(t&&o&&!s)return;e.issues.push(...He(n,r.issues))}if(!s&&!t){r.issues.length||e.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}r.value===void 0?s&&(e.value[n]=void 0):e.value[n]=r.value}function ih(r){const e=Object.keys(r.shape);for(const i of e)if(!r.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);const n=nd(r.shape);return{...r,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(n)}}function oh(r,e,n,i,t,o){const s=[],a=t.keySet,c=t.catchall._zod,u=c.def.type,l=c.optin==="optional",f=c.optout==="optional";for(const d in e){if(d==="__proto__"||a.has(d))continue;if(u==="never"){s.push(d);continue}const h=c.run({value:e[d],issues:[]},i);h instanceof Promise?r.push(h.then(p=>ui(p,n,d,e,l,f))):ui(h,n,d,e,l,f)}return s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:e,inst:o}),r.length?Promise.all(r).then(()=>n):n}const sh=b("$ZodObject",(r,e)=>{if(C.init(r,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 i=Hn(()=>ih(e));H(r._zod,"propValues",()=>{const a=e.shape,c={};for(const u in a){const l=a[u]._zod;if(l.values){c[u]??(c[u]=new Set);for(const f of l.values)c[u].add(f)}}return c});const t=en,o=e.catchall;let s;r._zod.parse=(a,c)=>{s??(s=i.value);const u=a.value;if(!t(u))return a.issues.push({expected:"object",code:"invalid_type",input:u,inst:r}),a;a.value={};const l=[],f=s.shape;for(const d of s.keys){const h=f[d],p=h._zod.optin==="optional",_=h._zod.optout==="optional",w=h._zod.run({value:u[d],issues:[]},c);w instanceof Promise?l.push(w.then(O=>ui(O,a,d,u,p,_))):ui(w,a,d,u,p,_)}return o?oh(l,u,a,c,i.value,r):l.length?Promise.all(l).then(()=>a):a}}),ah=b("$ZodObjectJIT",(r,e)=>{sh.init(r,e);const n=r._zod.parse,i=Hn(()=>ih(e)),t=d=>{const h=new vf(["shape","payload","ctx"]),p=i.value,_=k=>{const z=Xo(k);return`shape[${z}]._zod.run({ value: input[${z}], issues: [] }, ctx)`};h.write("const input = payload.value;");const w=Object.create(null);let O=0;for(const k of p.keys)w[k]=`key_${O++}`;h.write("const newResult = {};");for(const k of p.keys){const z=w[k],A=Xo(k),J=d[k],se=J?._zod?.optin==="optional",le=J?._zod?.optout==="optional";h.write(`const ${z} = ${_(k)};`),se&&le?h.write(`
1096
+ if (${z}.issues.length) {
1097
+ if (${A} in input) {
1098
+ payload.issues = payload.issues.concat(${z}.issues.map(iss => ({
806
1099
  ...iss,
807
- path: iss.path ? [${ce}, ...iss.path] : [${ce}]
1100
+ path: iss.path ? [${A}, ...iss.path] : [${A}]
808
1101
  })));
809
1102
  }
810
1103
  }
811
1104
 
812
- if (${j}.value === undefined) {
813
- if (${ce} in input) {
814
- newResult[${ce}] = undefined;
1105
+ if (${z}.value === undefined) {
1106
+ if (${A} in input) {
1107
+ newResult[${A}] = undefined;
815
1108
  }
816
1109
  } else {
817
- newResult[${ce}] = ${j}.value;
1110
+ newResult[${A}] = ${z}.value;
818
1111
  }
819
1112
 
820
- `):g.write(`
821
- if (${j}.issues.length) {
822
- payload.issues = payload.issues.concat(${j}.issues.map(iss => ({
1113
+ `):se?h.write(`
1114
+ if (${z}.issues.length) {
1115
+ payload.issues = payload.issues.concat(${z}.issues.map(iss => ({
823
1116
  ...iss,
824
- path: iss.path ? [${ce}, ...iss.path] : [${ce}]
1117
+ path: iss.path ? [${A}, ...iss.path] : [${A}]
825
1118
  })));
826
1119
  }
827
1120
 
828
- if (${j}.value === undefined) {
829
- if (${ce} in input) {
830
- newResult[${ce}] = undefined;
831
- }
832
- } else {
833
- newResult[${ce}] = ${j}.value;
834
- }
835
-
836
- `)}g.write("payload.value = newResult;"),g.write("return payload;");const R=g.compile();return(T,j)=>R(p,T,j)};let o;const a=_t,s=!es.jitless,l=s&&Kf.value,c=t.catchall;let m;e._zod.parse=(p,g)=>{m??(m=r.value);const w=p.value;return a(w)?s&&l&&g?.async===!1&&g.jitless!==!0?(o||(o=n(t.shape)),p=o(p,g),c?_s([],w,p,g,m,e):p):i(p,g):(p.issues.push({expected:"object",code:"invalid_type",input:w,inst:e}),p)}});function pa(e,t,i,r){for(const o of e)if(o.issues.length===0)return t.value=o.value,t;const n=e.filter(o=>!Ye(o));return n.length===1?(t.value=n[0].value,n[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:i,errors:e.map(o=>o.issues.map(a=>Ue(a,r,Te())))}),t)}const $s=h("$ZodUnion",(e,t)=>{q.init(e,t),E(e._zod,"optin",()=>t.options.some(n=>n._zod.optin==="optional")?"optional":void 0),E(e._zod,"optout",()=>t.options.some(n=>n._zod.optout==="optional")?"optional":void 0),E(e._zod,"values",()=>{if(t.options.every(n=>n._zod.values))return new Set(t.options.flatMap(n=>Array.from(n._zod.values)))}),E(e._zod,"pattern",()=>{if(t.options.every(n=>n._zod.pattern)){const n=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${n.map(o=>Li(o.source)).join("|")})$`)}});const i=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(n,o)=>{if(i)return r(n,o);let a=!1;const s=[];for(const u of t.options){const l=u._zod.run({value:n.value,issues:[]},o);if(l instanceof Promise)s.push(l),a=!0;else{if(l.issues.length===0)return l;s.push(l)}}return a?Promise.all(s).then(u=>pa(u,n,e,o)):pa(s,n,e,o)}}),Rv=h("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,$s.init(e,t);const i=e._zod.parse;E(e._zod,"propValues",()=>{const n={};for(const o of t.options){const a=o._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(const[s,u]of Object.entries(a)){n[s]||(n[s]=new Set);for(const l of u)n[s].add(l)}}return n});const r=zn(()=>{const n=t.options,o=new Map;for(const a of n){const s=a._zod.propValues?.[t.discriminator];if(!s||s.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(const u of s){if(o.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);o.set(u,a)}}return o});e._zod.parse=(n,o)=>{const a=n.value;if(!_t(a))return n.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),n;const s=r.value.get(a?.[t.discriminator]);return s?s._zod.run(n,o):t.unionFallback?i(n,o):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:a,path:[t.discriminator],inst:e}),n)}}),Av=h("$ZodIntersection",(e,t)=>{q.init(e,t),e._zod.parse=(i,r)=>{const n=i.value,o=t.left._zod.run({value:n,issues:[]},r),a=t.right._zod.run({value:n,issues:[]},r);return o instanceof Promise||a instanceof Promise?Promise.all([o,a]).then(([u,l])=>va(i,u,l)):va(i,o,a)}});function Zi(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(tt(e)&&tt(t)){const i=Object.keys(t),r=Object.keys(e).filter(o=>i.indexOf(o)!==-1),n={...e,...t};for(const o of r){const a=Zi(e[o],t[o]);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};n[o]=a.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const i=[];for(let r=0;r<e.length;r++){const n=e[r],o=t[r],a=Zi(n,o);if(!a.valid)return{valid:!1,mergeErrorPath:[r,...a.mergeErrorPath]};i.push(a.data)}return{valid:!0,data:i}}return{valid:!1,mergeErrorPath:[]}}function va(e,t,i){const r=new Map;let n;for(const s of t.issues)if(s.code==="unrecognized_keys"){n??(n=s);for(const u of s.keys)r.has(u)||r.set(u,{}),r.get(u).l=!0}else e.issues.push(s);for(const s of i.issues)if(s.code==="unrecognized_keys")for(const u of s.keys)r.has(u)||r.set(u,{}),r.get(u).r=!0;else e.issues.push(s);const o=[...r].filter(([,s])=>s.l&&s.r).map(([s])=>s);if(o.length&&n&&e.issues.push({...n,keys:o}),Ye(e))return e;const a=Zi(t.value,i.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}const Cv=h("$ZodRecord",(e,t)=>{q.init(e,t),e._zod.parse=(i,r)=>{const n=i.value;if(!tt(n))return i.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),i;const o=[],a=t.keyType._zod.values;if(a){i.value={};const s=new Set;for(const l of a)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){s.add(typeof l=="number"?l.toString():l);const c=t.valueType._zod.run({value:n[l],issues:[]},r);c instanceof Promise?o.push(c.then(m=>{m.issues.length&&i.issues.push(...Qe(l,m.issues)),i.value[l]=m.value})):(c.issues.length&&i.issues.push(...Qe(l,c.issues)),i.value[l]=c.value)}let u;for(const l in n)s.has(l)||(u=u??[],u.push(l));u&&u.length>0&&i.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:u})}else{i.value={};for(const s of Reflect.ownKeys(n)){if(s==="__proto__")continue;let u=t.keyType._zod.run({value:s,issues:[]},r);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof s=="string"&&ds.test(s)&&u.issues.length){const m=t.keyType._zod.run({value:Number(s),issues:[]},r);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");m.issues.length===0&&(u=m)}if(u.issues.length){t.mode==="loose"?i.value[s]=n[s]:i.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(m=>Ue(m,r,Te())),input:s,path:[s],inst:e});continue}const c=t.valueType._zod.run({value:n[s],issues:[]},r);c instanceof Promise?o.push(c.then(m=>{m.issues.length&&i.issues.push(...Qe(s,m.issues)),i.value[u.value]=m.value})):(c.issues.length&&i.issues.push(...Qe(s,c.issues)),i.value[u.value]=c.value)}}return o.length?Promise.all(o).then(()=>i):i}}),Lv=h("$ZodEnum",(e,t)=>{q.init(e,t);const i=ts(t.entries),r=new Set(i);e._zod.values=r,e._zod.pattern=new RegExp(`^(${i.filter(n=>Xf.has(typeof n)).map(n=>typeof n=="string"?nt(n):n.toString()).join("|")})$`),e._zod.parse=(n,o)=>{const a=n.value;return r.has(a)||n.issues.push({code:"invalid_value",values:i,input:a,inst:e}),n}}),Mv=h("$ZodLiteral",(e,t)=>{if(q.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const i=new Set(t.values);e._zod.values=i,e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?nt(r):r?nt(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,n)=>{const o=r.value;return i.has(o)||r.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),r}}),Jv=h("$ZodTransform",(e,t)=>{q.init(e,t),e._zod.parse=(i,r)=>{if(r.direction==="backward")throw new Qa(e.constructor.name);const n=t.transform(i.value,i);if(r.async)return(n instanceof Promise?n:Promise.resolve(n)).then(a=>(i.value=a,i));if(n instanceof Promise)throw new et;return i.value=n,i}});function ha(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const bs=h("$ZodOptional",(e,t)=>{q.init(e,t),e._zod.optin="optional",e._zod.optout="optional",E(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),E(e._zod,"pattern",()=>{const i=t.innerType._zod.pattern;return i?new RegExp(`^(${Li(i.source)})?$`):void 0}),e._zod.parse=(i,r)=>{if(t.innerType._zod.optin==="optional"){const n=t.innerType._zod.run(i,r);return n instanceof Promise?n.then(o=>ha(o,i.value)):ha(n,i.value)}return i.value===void 0?i:t.innerType._zod.run(i,r)}}),Fv=h("$ZodExactOptional",(e,t)=>{bs.init(e,t),E(e._zod,"values",()=>t.innerType._zod.values),E(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(i,r)=>t.innerType._zod.run(i,r)}),qv=h("$ZodNullable",(e,t)=>{q.init(e,t),E(e._zod,"optin",()=>t.innerType._zod.optin),E(e._zod,"optout",()=>t.innerType._zod.optout),E(e._zod,"pattern",()=>{const i=t.innerType._zod.pattern;return i?new RegExp(`^(${Li(i.source)}|null)$`):void 0}),E(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(i,r)=>i.value===null?i:t.innerType._zod.run(i,r)}),Bv=h("$ZodDefault",(e,t)=>{q.init(e,t),e._zod.optin="optional",E(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(i,r)=>{if(r.direction==="backward")return t.innerType._zod.run(i,r);if(i.value===void 0)return i.value=t.defaultValue,i;const n=t.innerType._zod.run(i,r);return n instanceof Promise?n.then(o=>ga(o,t)):ga(n,t)}});function ga(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Hv=h("$ZodPrefault",(e,t)=>{q.init(e,t),e._zod.optin="optional",E(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(i,r)=>(r.direction==="backward"||i.value===void 0&&(i.value=t.defaultValue),t.innerType._zod.run(i,r))}),Vv=h("$ZodNonOptional",(e,t)=>{q.init(e,t),E(e._zod,"values",()=>{const i=t.innerType._zod.values;return i?new Set([...i].filter(r=>r!==void 0)):void 0}),e._zod.parse=(i,r)=>{const n=t.innerType._zod.run(i,r);return n instanceof Promise?n.then(o=>_a(o,e)):_a(n,e)}});function _a(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Wv=h("$ZodCatch",(e,t)=>{q.init(e,t),E(e._zod,"optin",()=>t.innerType._zod.optin),E(e._zod,"optout",()=>t.innerType._zod.optout),E(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(i,r)=>{if(r.direction==="backward")return t.innerType._zod.run(i,r);const n=t.innerType._zod.run(i,r);return n instanceof Promise?n.then(o=>(i.value=o.value,o.issues.length&&(i.value=t.catchValue({...i,error:{issues:o.issues.map(a=>Ue(a,r,Te()))},input:i.value}),i.issues=[]),i)):(i.value=n.value,n.issues.length&&(i.value=t.catchValue({...i,error:{issues:n.issues.map(o=>Ue(o,r,Te()))},input:i.value}),i.issues=[]),i)}}),Gv=h("$ZodPipe",(e,t)=>{q.init(e,t),E(e._zod,"values",()=>t.in._zod.values),E(e._zod,"optin",()=>t.in._zod.optin),E(e._zod,"optout",()=>t.out._zod.optout),E(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(i,r)=>{if(r.direction==="backward"){const o=t.out._zod.run(i,r);return o instanceof Promise?o.then(a=>on(a,t.in,r)):on(o,t.in,r)}const n=t.in._zod.run(i,r);return n instanceof Promise?n.then(o=>on(o,t.out,r)):on(n,t.out,r)}});function on(e,t,i){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},i)}const Kv=h("$ZodReadonly",(e,t)=>{q.init(e,t),E(e._zod,"propValues",()=>t.innerType._zod.propValues),E(e._zod,"values",()=>t.innerType._zod.values),E(e._zod,"optin",()=>t.innerType?._zod?.optin),E(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(i,r)=>{if(r.direction==="backward")return t.innerType._zod.run(i,r);const n=t.innerType._zod.run(i,r);return n instanceof Promise?n.then($a):$a(n)}});function $a(e){return e.value=Object.freeze(e.value),e}const Xv=h("$ZodCustom",(e,t)=>{le.init(e,t),q.init(e,t),e._zod.parse=(i,r)=>i,e._zod.check=i=>{const r=i.value,n=t.fn(r);if(n instanceof Promise)return n.then(o=>ba(o,i,r,e));ba(n,i,r,e)}});function ba(e,t,i,r){if(!e){const n={code:"custom",input:i,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(n.params=r._zod.def.params),t.issues.push($t(n))}}var ya;class Yv{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...i){const r=i[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const i=this._map.get(t);return i&&typeof i=="object"&&"id"in i&&this._idmap.delete(i.id),this._map.delete(t),this}get(t){const i=t._zod.parent;if(i){const r={...this.get(i)??{}};delete r.id;const n={...r,...this._map.get(t)};return Object.keys(n).length?n:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function Qv(){return new Yv}(ya=globalThis).__zod_globalRegistry??(ya.__zod_globalRegistry=Qv());const ht=globalThis.__zod_globalRegistry;function eh(e,t){return new e({type:"string",...k(t)})}function th(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...k(t)})}function ka(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...k(t)})}function nh(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...k(t)})}function ih(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...k(t)})}function rh(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...k(t)})}function oh(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...k(t)})}function ah(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...k(t)})}function sh(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...k(t)})}function uh(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...k(t)})}function lh(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...k(t)})}function ch(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...k(t)})}function dh(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...k(t)})}function mh(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...k(t)})}function fh(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...k(t)})}function ph(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...k(t)})}function vh(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...k(t)})}function hh(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...k(t)})}function gh(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...k(t)})}function _h(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...k(t)})}function $h(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...k(t)})}function bh(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...k(t)})}function yh(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...k(t)})}function kh(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...k(t)})}function wh(e,t){return new e({type:"string",format:"date",check:"string_format",...k(t)})}function Sh(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...k(t)})}function Ih(e,t){return new e({type:"string",format:"duration",check:"string_format",...k(t)})}function zh(e,t){return new e({type:"number",checks:[],...k(t)})}function xh(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...k(t)})}function Oh(e,t){return new e({type:"boolean",...k(t)})}function Zh(e,t){return new e({type:"null",...k(t)})}function Th(e){return new e({type:"unknown"})}function Uh(e,t){return new e({type:"never",...k(t)})}function wa(e,t){return new fs({check:"less_than",...k(t),value:e,inclusive:!1})}function zi(e,t){return new fs({check:"less_than",...k(t),value:e,inclusive:!0})}function Sa(e,t){return new ps({check:"greater_than",...k(t),value:e,inclusive:!1})}function xi(e,t){return new ps({check:"greater_than",...k(t),value:e,inclusive:!0})}function Ia(e,t){return new qp({check:"multiple_of",...k(t),value:e})}function ys(e,t){return new Hp({check:"max_length",...k(t),maximum:e})}function fn(e,t){return new Vp({check:"min_length",...k(t),minimum:e})}function ks(e,t){return new Wp({check:"length_equals",...k(t),length:e})}function Nh(e,t){return new Gp({check:"string_format",format:"regex",...k(t),pattern:e})}function Ph(e){return new Kp({check:"string_format",format:"lowercase",...k(e)})}function jh(e){return new Xp({check:"string_format",format:"uppercase",...k(e)})}function Eh(e,t){return new Yp({check:"string_format",format:"includes",...k(t),includes:e})}function Dh(e,t){return new Qp({check:"string_format",format:"starts_with",...k(t),prefix:e})}function Rh(e,t){return new ev({check:"string_format",format:"ends_with",...k(t),suffix:e})}function dt(e){return new tv({check:"overwrite",tx:e})}function Ah(e){return dt(t=>t.normalize(e))}function Ch(){return dt(e=>e.trim())}function Lh(){return dt(e=>e.toLowerCase())}function Mh(){return dt(e=>e.toUpperCase())}function Jh(){return dt(e=>Gf(e))}function Fh(e,t,i){return new e({type:"array",element:t,...k(i)})}function qh(e,t,i){const r=k(i);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}function Bh(e,t,i){return new e({type:"custom",check:"custom",fn:t,...k(i)})}function Hh(e){const t=Vh(i=>(i.addIssue=r=>{if(typeof r=="string")i.issues.push($t(r,i.value,t._zod.def));else{const n=r;n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=i.value),n.inst??(n.inst=t),n.continue??(n.continue=!t._zod.def.abort),i.issues.push($t(n))}},e(i.value,i)));return t}function Vh(e,t){const i=new le({check:"custom",...k(t)});return i._zod.check=e,i}function ws(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??ht,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 Y(e,t,i={path:[],schemaPath:[]}){var r;const n=e._zod.def,o=t.seen.get(e);if(o)return o.count++,i.schemaPath.includes(e)&&(o.cycle=i.path),o.schema;const a={schema:{},count:1,cycle:void 0,path:i.path};t.seen.set(e,a);const s=e._zod.toJSONSchema?.();if(s)a.schema=s;else{const c={...i,schemaPath:[...i.schemaPath,e],path:i.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,c);else{const p=a.schema,g=t.processors[n.type];if(!g)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);g(e,t,p,c)}const m=e._zod.parent;m&&(a.ref||(a.ref=m),Y(m,t,c),t.seen.get(m).isParent=!0)}const u=t.metadataRegistry.get(e);return u&&Object.assign(a.schema,u),t.io==="input"&&oe(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&a.schema._prefault&&((r=a.schema).default??(r.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function Ss(e,t){const i=e.seen.get(t);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const a of e.seen.entries()){const s=e.metadataRegistry.get(a[0])?.id;if(s){const u=r.get(s);if(u&&u!==a[0])throw new Error(`Duplicate schema id "${s}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(s,a[0])}}const n=a=>{const s=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const m=e.external.registry.get(a[0])?.id,p=e.external.uri??(w=>w);if(m)return{ref:p(m)};const g=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=g,{defId:g,ref:`${p("__shared")}#/${s}/${g}`}}if(a[1]===i)return{ref:"#"};const l=`#/${s}/`,c=a[1].schema.id??`__schema${e.counter++}`;return{defId:c,ref:l+c}},o=a=>{if(a[1].schema.$ref)return;const s=a[1],{ref:u,defId:l}=n(a);s.def={...s.schema},l&&(s.defId=l);const c=s.schema;for(const m in c)delete c[m];c.$ref=u};if(e.cycles==="throw")for(const a of e.seen.entries()){const s=a[1];if(s.cycle)throw new Error(`Cycle detected: #/${s.cycle?.join("/")}/<root>
837
-
838
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const a of e.seen.entries()){const s=a[1];if(t===a[0]){o(a);continue}if(e.external){const l=e.external.registry.get(a[0])?.id;if(t!==a[0]&&l){o(a);continue}}if(e.metadataRegistry.get(a[0])?.id){o(a);continue}if(s.cycle){o(a);continue}if(s.count>1&&e.reused==="ref"){o(a);continue}}}function Is(e,t){const i=e.seen.get(t);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=a=>{const s=e.seen.get(a);if(s.ref===null)return;const u=s.def??s.schema,l={...u},c=s.ref;if(s.ref=null,c){r(c);const p=e.seen.get(c),g=p.schema;if(g.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(g)):Object.assign(u,g),Object.assign(u,l),a._zod.parent===c)for(const D in u)D==="$ref"||D==="allOf"||D in l||delete u[D];if(g.$ref&&p.def)for(const D in u)D==="$ref"||D==="allOf"||D in p.def&&JSON.stringify(u[D])===JSON.stringify(p.def[D])&&delete u[D]}const m=a._zod.parent;if(m&&m!==c){r(m);const p=e.seen.get(m);if(p?.schema.$ref&&(u.$ref=p.schema.$ref,p.def))for(const g in u)g==="$ref"||g==="allOf"||g in p.def&&JSON.stringify(u[g])===JSON.stringify(p.def[g])&&delete u[g]}e.override({zodSchema:a,jsonSchema:u,path:s.path??[]})};for(const a of[...e.seen.entries()].reverse())r(a[0]);const n={};if(e.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");n.$id=e.external.uri(a)}Object.assign(n,i.def??i.schema);const o=e.external?.defs??{};for(const a of e.seen.entries()){const s=a[1];s.def&&s.defId&&(o[s.defId]=s.def)}e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?n.$defs=o:n.definitions=o);try{const a=JSON.parse(JSON.stringify(n));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:pn(t,"input",e.processors),output:pn(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function oe(e,t){const i=t??{seen:new Set};if(i.seen.has(e))return!1;i.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return oe(r.element,i);if(r.type==="set")return oe(r.valueType,i);if(r.type==="lazy")return oe(r.getter(),i);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return oe(r.innerType,i);if(r.type==="intersection")return oe(r.left,i)||oe(r.right,i);if(r.type==="record"||r.type==="map")return oe(r.keyType,i)||oe(r.valueType,i);if(r.type==="pipe")return oe(r.in,i)||oe(r.out,i);if(r.type==="object"){for(const n in r.shape)if(oe(r.shape[n],i))return!0;return!1}if(r.type==="union"){for(const n of r.options)if(oe(n,i))return!0;return!1}if(r.type==="tuple"){for(const n of r.items)if(oe(n,i))return!0;return!!(r.rest&&oe(r.rest,i))}return!1}const Wh=(e,t={})=>i=>{const r=ws({...i,processors:t});return Y(e,r),Ss(r,e),Is(r,e)},pn=(e,t,i={})=>r=>{const{libraryOptions:n,target:o}=r??{},a=ws({...n??{},target:o,io:t,processors:i});return Y(e,a),Ss(a,e),Is(a,e)},Gh={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Kh=(e,t,i,r)=>{const n=i;n.type="string";const{minimum:o,maximum:a,format:s,patterns:u,contentEncoding:l}=e._zod.bag;if(typeof o=="number"&&(n.minLength=o),typeof a=="number"&&(n.maxLength=a),s&&(n.format=Gh[s]??s,n.format===""&&delete n.format,s==="time"&&delete n.format),l&&(n.contentEncoding=l),u&&u.size>0){const c=[...u];c.length===1?n.pattern=c[0].source:c.length>1&&(n.allOf=[...c.map(m=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},Xh=(e,t,i,r)=>{const n=i,{minimum:o,maximum:a,format:s,multipleOf:u,exclusiveMaximum:l,exclusiveMinimum:c}=e._zod.bag;typeof s=="string"&&s.includes("int")?n.type="integer":n.type="number",typeof c=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(n.minimum=c,n.exclusiveMinimum=!0):n.exclusiveMinimum=c),typeof o=="number"&&(n.minimum=o,typeof c=="number"&&t.target!=="draft-04"&&(c>=o?delete n.minimum:delete n.exclusiveMinimum)),typeof l=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(n.maximum=l,n.exclusiveMaximum=!0):n.exclusiveMaximum=l),typeof a=="number"&&(n.maximum=a,typeof l=="number"&&t.target!=="draft-04"&&(l<=a?delete n.maximum:delete n.exclusiveMaximum)),typeof u=="number"&&(n.multipleOf=u)},Yh=(e,t,i,r)=>{i.type="boolean"},Qh=(e,t,i,r)=>{t.target==="openapi-3.0"?(i.type="string",i.nullable=!0,i.enum=[null]):i.type="null"},eg=(e,t,i,r)=>{i.not={}},tg=(e,t,i,r)=>{},ng=(e,t,i,r)=>{const n=e._zod.def,o=ts(n.entries);o.every(a=>typeof a=="number")&&(i.type="number"),o.every(a=>typeof a=="string")&&(i.type="string"),i.enum=o},ig=(e,t,i,r)=>{const n=e._zod.def,o=[];for(const a of n.values)if(a===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(a))}else o.push(a);if(o.length!==0)if(o.length===1){const a=o[0];i.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?i.enum=[a]:i.const=a}else o.every(a=>typeof a=="number")&&(i.type="number"),o.every(a=>typeof a=="string")&&(i.type="string"),o.every(a=>typeof a=="boolean")&&(i.type="boolean"),o.every(a=>a===null)&&(i.type="null"),i.enum=o},rg=(e,t,i,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},og=(e,t,i,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},ag=(e,t,i,r)=>{const n=i,o=e._zod.def,{minimum:a,maximum:s}=e._zod.bag;typeof a=="number"&&(n.minItems=a),typeof s=="number"&&(n.maxItems=s),n.type="array",n.items=Y(o.element,t,{...r,path:[...r.path,"items"]})},sg=(e,t,i,r)=>{const n=i,o=e._zod.def;n.type="object",n.properties={};const a=o.shape;for(const l in a)n.properties[l]=Y(a[l],t,{...r,path:[...r.path,"properties",l]});const s=new Set(Object.keys(a)),u=new Set([...s].filter(l=>{const c=o.shape[l]._zod;return t.io==="input"?c.optin===void 0:c.optout===void 0}));u.size>0&&(n.required=Array.from(u)),o.catchall?._zod.def.type==="never"?n.additionalProperties=!1:o.catchall?o.catchall&&(n.additionalProperties=Y(o.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(n.additionalProperties=!1)},ug=(e,t,i,r)=>{const n=e._zod.def,o=n.inclusive===!1,a=n.options.map((s,u)=>Y(s,t,{...r,path:[...r.path,o?"oneOf":"anyOf",u]}));o?i.oneOf=a:i.anyOf=a},lg=(e,t,i,r)=>{const n=e._zod.def,o=Y(n.left,t,{...r,path:[...r.path,"allOf",0]}),a=Y(n.right,t,{...r,path:[...r.path,"allOf",1]}),s=l=>"allOf"in l&&Object.keys(l).length===1,u=[...s(o)?o.allOf:[o],...s(a)?a.allOf:[a]];i.allOf=u},cg=(e,t,i,r)=>{const n=i,o=e._zod.def;n.type="object";const a=o.keyType,u=a._zod.bag?.patterns;if(o.mode==="loose"&&u&&u.size>0){const c=Y(o.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});n.patternProperties={};for(const m of u)n.patternProperties[m.source]=c}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(n.propertyNames=Y(o.keyType,t,{...r,path:[...r.path,"propertyNames"]})),n.additionalProperties=Y(o.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const l=a._zod.values;if(l){const c=[...l].filter(m=>typeof m=="string"||typeof m=="number");c.length>0&&(n.required=c)}},dg=(e,t,i,r)=>{const n=e._zod.def,o=Y(n.innerType,t,r),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=n.innerType,i.nullable=!0):i.anyOf=[o,{type:"null"}]},mg=(e,t,i,r)=>{const n=e._zod.def;Y(n.innerType,t,r);const o=t.seen.get(e);o.ref=n.innerType},fg=(e,t,i,r)=>{const n=e._zod.def;Y(n.innerType,t,r);const o=t.seen.get(e);o.ref=n.innerType,i.default=JSON.parse(JSON.stringify(n.defaultValue))},pg=(e,t,i,r)=>{const n=e._zod.def;Y(n.innerType,t,r);const o=t.seen.get(e);o.ref=n.innerType,t.io==="input"&&(i._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},vg=(e,t,i,r)=>{const n=e._zod.def;Y(n.innerType,t,r);const o=t.seen.get(e);o.ref=n.innerType;let a;try{a=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}i.default=a},hg=(e,t,i,r)=>{const n=e._zod.def,o=t.io==="input"?n.in._zod.def.type==="transform"?n.out:n.in:n.out;Y(o,t,r);const a=t.seen.get(e);a.ref=o},gg=(e,t,i,r)=>{const n=e._zod.def;Y(n.innerType,t,r);const o=t.seen.get(e);o.ref=n.innerType,i.readOnly=!0},zs=(e,t,i,r)=>{const n=e._zod.def;Y(n.innerType,t,r);const o=t.seen.get(e);o.ref=n.innerType};function Bi(e){return!!e._zod}function xs(e,t){return Bi(e)?ss(e,t):e.safeParse(t)}function _g(e){if(!e)return;let t;if(Bi(e)?t=e._zod?.def?.shape:t=e.shape,!!t){if(typeof t=="function")try{return t()}catch{return}return t}}function $g(e){if(Bi(e)){const o=e._zod?.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.values[0]}}const i=e._def;if(i){if(i.value!==void 0)return i.value;if(Array.isArray(i.values)&&i.values.length>0)return i.values[0]}const r=e.value;if(r!==void 0)return r}const bg=h("ZodISODateTime",(e,t)=>{vv.init(e,t),K.init(e,t)});function Os(e){return kh(bg,e)}const yg=h("ZodISODate",(e,t)=>{hv.init(e,t),K.init(e,t)});function kg(e){return wh(yg,e)}const wg=h("ZodISOTime",(e,t)=>{gv.init(e,t),K.init(e,t)});function Sg(e){return Sh(wg,e)}const Ig=h("ZodISODuration",(e,t)=>{_v.init(e,t),K.init(e,t)});function zg(e){return Ih(Ig,e)}const xg=(e,t)=>{os.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:i=>up(e,i)},flatten:{value:i=>sp(e,i)},addIssue:{value:i=>{e.issues.push(i),e.message=JSON.stringify(e.issues,Oi,2)}},addIssues:{value:i=>{e.issues.push(...i),e.message=JSON.stringify(e.issues,Oi,2)}},isEmpty:{get(){return e.issues.length===0}}})},$e=h("ZodError",xg,{Parent:Error}),Og=Ji($e),Zg=Fi($e),Tg=xn($e),Ug=On($e),Ng=cp($e),Pg=dp($e),jg=mp($e),Eg=fp($e),Dg=pp($e),Rg=vp($e),Ag=hp($e),Cg=gp($e),H=h("ZodType",(e,t)=>(q.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:pn(e,"input"),output:pn(e,"output")}}),e.toJSONSchema=Wh(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...i)=>e.clone(Ee(t,{checks:[...t.checks??[],...i.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),e.with=e.check,e.clone=(i,r)=>De(e,i,r),e.brand=()=>e,e.register=((i,r)=>(i.add(e,r),e)),e.parse=(i,r)=>Og(e,i,r,{callee:e.parse}),e.safeParse=(i,r)=>Tg(e,i,r),e.parseAsync=async(i,r)=>Zg(e,i,r,{callee:e.parseAsync}),e.safeParseAsync=async(i,r)=>Ug(e,i,r),e.spa=e.safeParseAsync,e.encode=(i,r)=>Ng(e,i,r),e.decode=(i,r)=>Pg(e,i,r),e.encodeAsync=async(i,r)=>jg(e,i,r),e.decodeAsync=async(i,r)=>Eg(e,i,r),e.safeEncode=(i,r)=>Dg(e,i,r),e.safeDecode=(i,r)=>Rg(e,i,r),e.safeEncodeAsync=async(i,r)=>Ag(e,i,r),e.safeDecodeAsync=async(i,r)=>Cg(e,i,r),e.refine=(i,r)=>e.check(T_(i,r)),e.superRefine=i=>e.check(U_(i)),e.overwrite=i=>e.check(dt(i)),e.optional=()=>X(e),e.exactOptional=()=>g_(e),e.nullable=()=>Oa(e),e.nullish=()=>X(Oa(e)),e.nonoptional=i=>w_(e,i),e.array=()=>N(e),e.or=i=>F([e,i]),e.and=i=>Hi(e,i),e.transform=i=>Ui(e,Es(i)),e.default=i=>b_(e,i),e.prefault=i=>k_(e,i),e.catch=i=>I_(e,i),e.pipe=i=>Ui(e,i),e.readonly=()=>O_(e),e.describe=i=>{const r=e.clone();return ht.add(r,{description:i}),r},Object.defineProperty(e,"description",{get(){return ht.get(e)?.description},configurable:!0}),e.meta=(...i)=>{if(i.length===0)return ht.get(e);const r=e.clone();return ht.add(r,i[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=i=>i(e),e)),Zs=h("_ZodString",(e,t)=>{qi.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Kh(e,r,n);const i=e._zod.bag;e.format=i.format??null,e.minLength=i.minimum??null,e.maxLength=i.maximum??null,e.regex=(...r)=>e.check(Nh(...r)),e.includes=(...r)=>e.check(Eh(...r)),e.startsWith=(...r)=>e.check(Dh(...r)),e.endsWith=(...r)=>e.check(Rh(...r)),e.min=(...r)=>e.check(fn(...r)),e.max=(...r)=>e.check(ys(...r)),e.length=(...r)=>e.check(ks(...r)),e.nonempty=(...r)=>e.check(fn(1,...r)),e.lowercase=r=>e.check(Ph(r)),e.uppercase=r=>e.check(jh(r)),e.trim=()=>e.check(Ch()),e.normalize=(...r)=>e.check(Ah(...r)),e.toLowerCase=()=>e.check(Lh()),e.toUpperCase=()=>e.check(Mh()),e.slugify=()=>e.check(Jh())}),Lg=h("ZodString",(e,t)=>{qi.init(e,t),Zs.init(e,t),e.email=i=>e.check(th(Mg,i)),e.url=i=>e.check(ah(Jg,i)),e.jwt=i=>e.check(yh(i_,i)),e.emoji=i=>e.check(sh(Fg,i)),e.guid=i=>e.check(ka(za,i)),e.uuid=i=>e.check(nh(an,i)),e.uuidv4=i=>e.check(ih(an,i)),e.uuidv6=i=>e.check(rh(an,i)),e.uuidv7=i=>e.check(oh(an,i)),e.nanoid=i=>e.check(uh(qg,i)),e.guid=i=>e.check(ka(za,i)),e.cuid=i=>e.check(lh(Bg,i)),e.cuid2=i=>e.check(ch(Hg,i)),e.ulid=i=>e.check(dh(Vg,i)),e.base64=i=>e.check(_h(e_,i)),e.base64url=i=>e.check($h(t_,i)),e.xid=i=>e.check(mh(Wg,i)),e.ksuid=i=>e.check(fh(Gg,i)),e.ipv4=i=>e.check(ph(Kg,i)),e.ipv6=i=>e.check(vh(Xg,i)),e.cidrv4=i=>e.check(hh(Yg,i)),e.cidrv6=i=>e.check(gh(Qg,i)),e.e164=i=>e.check(bh(n_,i)),e.datetime=i=>e.check(Os(i)),e.date=i=>e.check(kg(i)),e.time=i=>e.check(Sg(i)),e.duration=i=>e.check(zg(i))});function v(e){return eh(Lg,e)}const K=h("ZodStringFormat",(e,t)=>{B.init(e,t),Zs.init(e,t)}),Mg=h("ZodEmail",(e,t)=>{av.init(e,t),K.init(e,t)}),za=h("ZodGUID",(e,t)=>{rv.init(e,t),K.init(e,t)}),an=h("ZodUUID",(e,t)=>{ov.init(e,t),K.init(e,t)}),Jg=h("ZodURL",(e,t)=>{sv.init(e,t),K.init(e,t)}),Fg=h("ZodEmoji",(e,t)=>{uv.init(e,t),K.init(e,t)}),qg=h("ZodNanoID",(e,t)=>{lv.init(e,t),K.init(e,t)}),Bg=h("ZodCUID",(e,t)=>{cv.init(e,t),K.init(e,t)}),Hg=h("ZodCUID2",(e,t)=>{dv.init(e,t),K.init(e,t)}),Vg=h("ZodULID",(e,t)=>{mv.init(e,t),K.init(e,t)}),Wg=h("ZodXID",(e,t)=>{fv.init(e,t),K.init(e,t)}),Gg=h("ZodKSUID",(e,t)=>{pv.init(e,t),K.init(e,t)}),Kg=h("ZodIPv4",(e,t)=>{$v.init(e,t),K.init(e,t)}),Xg=h("ZodIPv6",(e,t)=>{bv.init(e,t),K.init(e,t)}),Yg=h("ZodCIDRv4",(e,t)=>{yv.init(e,t),K.init(e,t)}),Qg=h("ZodCIDRv6",(e,t)=>{kv.init(e,t),K.init(e,t)}),e_=h("ZodBase64",(e,t)=>{wv.init(e,t),K.init(e,t)}),t_=h("ZodBase64URL",(e,t)=>{Iv.init(e,t),K.init(e,t)}),n_=h("ZodE164",(e,t)=>{zv.init(e,t),K.init(e,t)}),i_=h("ZodJWT",(e,t)=>{Ov.init(e,t),K.init(e,t)}),Ts=h("ZodNumber",(e,t)=>{hs.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Xh(e,r,n),e.gt=(r,n)=>e.check(Sa(r,n)),e.gte=(r,n)=>e.check(xi(r,n)),e.min=(r,n)=>e.check(xi(r,n)),e.lt=(r,n)=>e.check(wa(r,n)),e.lte=(r,n)=>e.check(zi(r,n)),e.max=(r,n)=>e.check(zi(r,n)),e.int=r=>e.check(xa(r)),e.safe=r=>e.check(xa(r)),e.positive=r=>e.check(Sa(0,r)),e.nonnegative=r=>e.check(xi(0,r)),e.negative=r=>e.check(wa(0,r)),e.nonpositive=r=>e.check(zi(0,r)),e.multipleOf=(r,n)=>e.check(Ia(r,n)),e.step=(r,n)=>e.check(Ia(r,n)),e.finite=()=>e;const i=e._zod.bag;e.minValue=Math.max(i.minimum??Number.NEGATIVE_INFINITY,i.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(i.maximum??Number.POSITIVE_INFINITY,i.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(i.format??"").includes("int")||Number.isSafeInteger(i.multipleOf??.5),e.isFinite=!0,e.format=i.format??null});function C(e){return zh(Ts,e)}const r_=h("ZodNumberFormat",(e,t)=>{Zv.init(e,t),Ts.init(e,t)});function xa(e){return xh(r_,e)}const o_=h("ZodBoolean",(e,t)=>{Tv.init(e,t),H.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Yh(e,i,r)});function Q(e){return Oh(o_,e)}const a_=h("ZodNull",(e,t)=>{Uv.init(e,t),H.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Qh(e,i,r)});function Us(e){return Zh(a_,e)}const s_=h("ZodUnknown",(e,t)=>{Nv.init(e,t),H.init(e,t),e._zod.processJSONSchema=(i,r,n)=>tg()});function W(){return Th(s_)}const u_=h("ZodNever",(e,t)=>{Pv.init(e,t),H.init(e,t),e._zod.processJSONSchema=(i,r,n)=>eg(e,i,r)});function l_(e){return Uh(u_,e)}const c_=h("ZodArray",(e,t)=>{jv.init(e,t),H.init(e,t),e._zod.processJSONSchema=(i,r,n)=>ag(e,i,r,n),e.element=t.element,e.min=(i,r)=>e.check(fn(i,r)),e.nonempty=i=>e.check(fn(1,i)),e.max=(i,r)=>e.check(ys(i,r)),e.length=(i,r)=>e.check(ks(i,r)),e.unwrap=()=>e.element});function N(e,t){return Fh(c_,e,t)}const Ns=h("ZodObject",(e,t)=>{Dv.init(e,t),H.init(e,t),e._zod.processJSONSchema=(i,r,n)=>sg(e,i,r,n),E(e,"shape",()=>t.shape),e.keyof=()=>me(Object.keys(e._zod.def.shape)),e.catchall=i=>e.clone({...e._zod.def,catchall:i}),e.passthrough=()=>e.clone({...e._zod.def,catchall:W()}),e.loose=()=>e.clone({...e._zod.def,catchall:W()}),e.strict=()=>e.clone({...e._zod.def,catchall:l_()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=i=>np(e,i),e.safeExtend=i=>ip(e,i),e.merge=i=>rp(e,i),e.pick=i=>ep(e,i),e.omit=i=>tp(e,i),e.partial=(...i)=>op(Ds,e,i[0]),e.required=(...i)=>ap(Rs,e,i[0])});function y(e,t){const i={type:"object",shape:e??{},...k(t)};return new Ns(i)}function ue(e,t){return new Ns({type:"object",shape:e,catchall:W(),...k(t)})}const Ps=h("ZodUnion",(e,t)=>{$s.init(e,t),H.init(e,t),e._zod.processJSONSchema=(i,r,n)=>ug(e,i,r,n),e.options=t.options});function F(e,t){return new Ps({type:"union",options:e,...k(t)})}const d_=h("ZodDiscriminatedUnion",(e,t)=>{Ps.init(e,t),Rv.init(e,t)});function js(e,t,i){return new d_({type:"union",options:t,discriminator:e,...k(i)})}const m_=h("ZodIntersection",(e,t)=>{Av.init(e,t),H.init(e,t),e._zod.processJSONSchema=(i,r,n)=>lg(e,i,r,n)});function Hi(e,t){return new m_({type:"intersection",left:e,right:t})}const f_=h("ZodRecord",(e,t)=>{Cv.init(e,t),H.init(e,t),e._zod.processJSONSchema=(i,r,n)=>cg(e,i,r,n),e.keyType=t.keyType,e.valueType=t.valueType});function G(e,t,i){return new f_({type:"record",keyType:e,valueType:t,...k(i)})}const Ti=h("ZodEnum",(e,t)=>{Lv.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ng(e,r,n),e.enum=t.entries,e.options=Object.values(t.entries);const i=new Set(Object.keys(t.entries));e.extract=(r,n)=>{const o={};for(const a of r)if(i.has(a))o[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new Ti({...t,checks:[],...k(n),entries:o})},e.exclude=(r,n)=>{const o={...t.entries};for(const a of r)if(i.has(a))delete o[a];else throw new Error(`Key ${a} not found in enum`);return new Ti({...t,checks:[],...k(n),entries:o})}});function me(e,t){const i=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Ti({type:"enum",entries:i,...k(t)})}const p_=h("ZodLiteral",(e,t)=>{Mv.init(e,t),H.init(e,t),e._zod.processJSONSchema=(i,r,n)=>ig(e,i,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function S(e,t){return new p_({type:"literal",values:Array.isArray(e)?e:[e],...k(t)})}const v_=h("ZodTransform",(e,t)=>{Jv.init(e,t),H.init(e,t),e._zod.processJSONSchema=(i,r,n)=>og(e,i),e._zod.parse=(i,r)=>{if(r.direction==="backward")throw new Qa(e.constructor.name);i.addIssue=o=>{if(typeof o=="string")i.issues.push($t(o,i.value,t));else{const a=o;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=i.value),a.inst??(a.inst=e),i.issues.push($t(a))}};const n=t.transform(i.value,i);return n instanceof Promise?n.then(o=>(i.value=o,i)):(i.value=n,i)}});function Es(e){return new v_({type:"transform",transform:e})}const Ds=h("ZodOptional",(e,t)=>{bs.init(e,t),H.init(e,t),e._zod.processJSONSchema=(i,r,n)=>zs(e,i,r,n),e.unwrap=()=>e._zod.def.innerType});function X(e){return new Ds({type:"optional",innerType:e})}const h_=h("ZodExactOptional",(e,t)=>{Fv.init(e,t),H.init(e,t),e._zod.processJSONSchema=(i,r,n)=>zs(e,i,r,n),e.unwrap=()=>e._zod.def.innerType});function g_(e){return new h_({type:"optional",innerType:e})}const __=h("ZodNullable",(e,t)=>{qv.init(e,t),H.init(e,t),e._zod.processJSONSchema=(i,r,n)=>dg(e,i,r,n),e.unwrap=()=>e._zod.def.innerType});function Oa(e){return new __({type:"nullable",innerType:e})}const $_=h("ZodDefault",(e,t)=>{Bv.init(e,t),H.init(e,t),e._zod.processJSONSchema=(i,r,n)=>fg(e,i,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function b_(e,t){return new $_({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():is(t)}})}const y_=h("ZodPrefault",(e,t)=>{Hv.init(e,t),H.init(e,t),e._zod.processJSONSchema=(i,r,n)=>pg(e,i,r,n),e.unwrap=()=>e._zod.def.innerType});function k_(e,t){return new y_({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():is(t)}})}const Rs=h("ZodNonOptional",(e,t)=>{Vv.init(e,t),H.init(e,t),e._zod.processJSONSchema=(i,r,n)=>mg(e,i,r,n),e.unwrap=()=>e._zod.def.innerType});function w_(e,t){return new Rs({type:"nonoptional",innerType:e,...k(t)})}const S_=h("ZodCatch",(e,t)=>{Wv.init(e,t),H.init(e,t),e._zod.processJSONSchema=(i,r,n)=>vg(e,i,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function I_(e,t){return new S_({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const z_=h("ZodPipe",(e,t)=>{Gv.init(e,t),H.init(e,t),e._zod.processJSONSchema=(i,r,n)=>hg(e,i,r,n),e.in=t.in,e.out=t.out});function Ui(e,t){return new z_({type:"pipe",in:e,out:t})}const x_=h("ZodReadonly",(e,t)=>{Kv.init(e,t),H.init(e,t),e._zod.processJSONSchema=(i,r,n)=>gg(e,i,r,n),e.unwrap=()=>e._zod.def.innerType});function O_(e){return new x_({type:"readonly",innerType:e})}const As=h("ZodCustom",(e,t)=>{Xv.init(e,t),H.init(e,t),e._zod.processJSONSchema=(i,r,n)=>rg(e,i)});function Z_(e,t){return qh(As,e??(()=>!0),t)}function T_(e,t={}){return Bh(As,e,t)}function U_(e){return Hh(e)}function Cs(e,t){return Ui(Es(e),t)}const Le="io.modelcontextprotocol/related-task",Tn="2.0",ee=Z_(e=>e!==null&&(typeof e=="object"||typeof e=="function")),Ls=F([v(),C().int()]),Ms=v();ue({ttl:F([C(),Us()]).optional(),pollInterval:C().optional()});const N_=y({ttl:C().optional()}),P_=y({taskId:v()}),Vi=ue({progressToken:Ls.optional(),[Le]:P_.optional()}),fe=y({_meta:Vi.optional()}),zt=fe.extend({task:N_.optional()}),j_=e=>zt.safeParse(e).success,te=y({method:v(),params:fe.loose().optional()}),be=y({_meta:Vi.optional()}),ye=y({method:v(),params:be.loose().optional()}),ne=ue({_meta:Vi.optional()}),xt=F([v(),C().int()]),Js=y({jsonrpc:S(Tn),id:xt,...te.shape}).strict(),Za=e=>Js.safeParse(e).success,Fs=y({jsonrpc:S(Tn),...ye.shape}).strict(),E_=e=>Fs.safeParse(e).success,Wi=y({jsonrpc:S(Tn),id:xt,result:ne}).strict(),sn=e=>Wi.safeParse(e).success;var A;(function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(A||(A={}));const Gi=y({jsonrpc:S(Tn),id:xt.optional(),error:y({code:C().int(),message:v(),data:W().optional()})}).strict(),D_=e=>Gi.safeParse(e).success,R_=F([Js,Fs,Wi,Gi]);F([Wi,Gi]);const Ki=ne.strict(),A_=be.extend({requestId:xt.optional(),reason:v().optional()}),Xi=ye.extend({method:S("notifications/cancelled"),params:A_}),C_=y({src:v(),mimeType:v().optional(),sizes:N(v()).optional(),theme:me(["light","dark"]).optional()}),Ot=y({icons:N(C_).optional()}),it=y({name:v(),title:v().optional()}),Un=it.extend({...it.shape,...Ot.shape,version:v(),websiteUrl:v().optional(),description:v().optional()}),L_=Hi(y({applyDefaults:Q().optional()}),G(v(),W())),M_=Cs(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Hi(y({form:L_.optional(),url:ee.optional()}),G(v(),W()).optional())),J_=ue({list:ee.optional(),cancel:ee.optional(),requests:ue({sampling:ue({createMessage:ee.optional()}).optional(),elicitation:ue({create:ee.optional()}).optional()}).optional()}),F_=ue({list:ee.optional(),cancel:ee.optional(),requests:ue({tools:ue({call:ee.optional()}).optional()}).optional()}),q_=y({experimental:G(v(),ee).optional(),sampling:y({context:ee.optional(),tools:ee.optional()}).optional(),elicitation:M_.optional(),roots:y({listChanged:Q().optional()}).optional(),tasks:J_.optional()}),B_=fe.extend({protocolVersion:v(),capabilities:q_,clientInfo:Un}),H_=te.extend({method:S("initialize"),params:B_}),V_=y({experimental:G(v(),ee).optional(),logging:ee.optional(),completions:ee.optional(),prompts:y({listChanged:Q().optional()}).optional(),resources:y({subscribe:Q().optional(),listChanged:Q().optional()}).optional(),tools:y({listChanged:Q().optional()}).optional(),tasks:F_.optional()}),W_=ne.extend({protocolVersion:v(),capabilities:V_,serverInfo:Un,instructions:v().optional()}),G_=ye.extend({method:S("notifications/initialized"),params:be.optional()}),Nn=te.extend({method:S("ping"),params:fe.optional()}),K_=y({progress:C(),total:X(C()),message:X(v())}),X_=y({...be.shape,...K_.shape,progressToken:Ls}),Yi=ye.extend({method:S("notifications/progress"),params:X_}),Y_=fe.extend({cursor:Ms.optional()}),Zt=te.extend({params:Y_.optional()}),Tt=ne.extend({nextCursor:Ms.optional()}),Q_=me(["working","input_required","completed","failed","cancelled"]),Ut=y({taskId:v(),status:Q_,ttl:F([C(),Us()]),createdAt:v(),lastUpdatedAt:v(),pollInterval:X(C()),statusMessage:X(v())}),Qi=ne.extend({task:Ut}),e$=be.merge(Ut),vn=ye.extend({method:S("notifications/tasks/status"),params:e$}),er=te.extend({method:S("tasks/get"),params:fe.extend({taskId:v()})}),tr=ne.merge(Ut),nr=te.extend({method:S("tasks/result"),params:fe.extend({taskId:v()})});ne.loose();const ir=Zt.extend({method:S("tasks/list")}),rr=Tt.extend({tasks:N(Ut)}),or=te.extend({method:S("tasks/cancel"),params:fe.extend({taskId:v()})}),t$=ne.merge(Ut),qs=y({uri:v(),mimeType:X(v()),_meta:G(v(),W()).optional()}),Bs=qs.extend({text:v()}),ar=v().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),Hs=qs.extend({blob:ar}),Nt=me(["user","assistant"]),mt=y({audience:N(Nt).optional(),priority:C().min(0).max(1).optional(),lastModified:Os({offset:!0}).optional()}),Vs=y({...it.shape,...Ot.shape,uri:v(),description:X(v()),mimeType:X(v()),annotations:mt.optional(),_meta:X(ue({}))}),n$=y({...it.shape,...Ot.shape,uriTemplate:v(),description:X(v()),mimeType:X(v()),annotations:mt.optional(),_meta:X(ue({}))}),i$=Zt.extend({method:S("resources/list")}),Ws=Tt.extend({resources:N(Vs)}),r$=Zt.extend({method:S("resources/templates/list")}),o$=Tt.extend({resourceTemplates:N(n$)}),sr=fe.extend({uri:v()}),a$=sr,s$=te.extend({method:S("resources/read"),params:a$}),Gs=ne.extend({contents:N(F([Bs,Hs]))}),u$=ye.extend({method:S("notifications/resources/list_changed"),params:be.optional()}),l$=sr,c$=te.extend({method:S("resources/subscribe"),params:l$}),d$=sr,m$=te.extend({method:S("resources/unsubscribe"),params:d$}),f$=be.extend({uri:v()}),p$=ye.extend({method:S("notifications/resources/updated"),params:f$}),v$=y({name:v(),description:X(v()),required:X(Q())}),h$=y({...it.shape,...Ot.shape,description:X(v()),arguments:X(N(v$)),_meta:X(ue({}))}),g$=Zt.extend({method:S("prompts/list")}),_$=Tt.extend({prompts:N(h$)}),$$=fe.extend({name:v(),arguments:G(v(),v()).optional()}),b$=te.extend({method:S("prompts/get"),params:$$}),ur=y({type:S("text"),text:v(),annotations:mt.optional(),_meta:G(v(),W()).optional()}),lr=y({type:S("image"),data:ar,mimeType:v(),annotations:mt.optional(),_meta:G(v(),W()).optional()}),cr=y({type:S("audio"),data:ar,mimeType:v(),annotations:mt.optional(),_meta:G(v(),W()).optional()}),y$=y({type:S("tool_use"),name:v(),id:v(),input:G(v(),W()),_meta:G(v(),W()).optional()}),Ks=y({type:S("resource"),resource:F([Bs,Hs]),annotations:mt.optional(),_meta:G(v(),W()).optional()}),Xs=Vs.extend({type:S("resource_link")}),Pt=F([ur,lr,cr,Xs,Ks]),k$=y({role:Nt,content:Pt}),w$=ne.extend({description:v().optional(),messages:N(k$)}),S$=ye.extend({method:S("notifications/prompts/list_changed"),params:be.optional()}),I$=y({title:v().optional(),readOnlyHint:Q().optional(),destructiveHint:Q().optional(),idempotentHint:Q().optional(),openWorldHint:Q().optional()}),z$=y({taskSupport:me(["required","optional","forbidden"]).optional()}),dr=y({...it.shape,...Ot.shape,description:v().optional(),inputSchema:y({type:S("object"),properties:G(v(),ee).optional(),required:N(v()).optional()}).catchall(W()),outputSchema:y({type:S("object"),properties:G(v(),ee).optional(),required:N(v()).optional()}).catchall(W()).optional(),annotations:I$.optional(),execution:z$.optional(),_meta:G(v(),W()).optional()}),Ys=Zt.extend({method:S("tools/list")}),x$=Tt.extend({tools:N(dr)}),Pn=ne.extend({content:N(Pt).default([]),structuredContent:G(v(),W()).optional(),isError:Q().optional()});Pn.or(ne.extend({toolResult:W()}));const O$=zt.extend({name:v(),arguments:G(v(),W()).optional()}),Qs=te.extend({method:S("tools/call"),params:O$}),Z$=ye.extend({method:S("notifications/tools/list_changed"),params:be.optional()});y({autoRefresh:Q().default(!0),debounceMs:C().int().nonnegative().default(300)});const eu=me(["debug","info","notice","warning","error","critical","alert","emergency"]),T$=fe.extend({level:eu}),U$=te.extend({method:S("logging/setLevel"),params:T$}),N$=be.extend({level:eu,logger:v().optional(),data:W()}),P$=ye.extend({method:S("notifications/message"),params:N$}),j$=y({name:v().optional()}),E$=y({hints:N(j$).optional(),costPriority:C().min(0).max(1).optional(),speedPriority:C().min(0).max(1).optional(),intelligencePriority:C().min(0).max(1).optional()}),D$=y({mode:me(["auto","required","none"]).optional()}),R$=y({type:S("tool_result"),toolUseId:v().describe("The unique identifier for the corresponding tool call."),content:N(Pt).default([]),structuredContent:y({}).loose().optional(),isError:Q().optional(),_meta:G(v(),W()).optional()}),A$=js("type",[ur,lr,cr]),hn=js("type",[ur,lr,cr,y$,R$]),C$=y({role:Nt,content:F([hn,N(hn)]),_meta:G(v(),W()).optional()}),L$=zt.extend({messages:N(C$),modelPreferences:E$.optional(),systemPrompt:v().optional(),includeContext:me(["none","thisServer","allServers"]).optional(),temperature:C().optional(),maxTokens:C().int(),stopSequences:N(v()).optional(),metadata:ee.optional(),tools:N(dr).optional(),toolChoice:D$.optional()}),M$=te.extend({method:S("sampling/createMessage"),params:L$}),J$=ne.extend({model:v(),stopReason:X(me(["endTurn","stopSequence","maxTokens"]).or(v())),role:Nt,content:A$}),F$=ne.extend({model:v(),stopReason:X(me(["endTurn","stopSequence","maxTokens","toolUse"]).or(v())),role:Nt,content:F([hn,N(hn)])}),q$=y({type:S("boolean"),title:v().optional(),description:v().optional(),default:Q().optional()}),B$=y({type:S("string"),title:v().optional(),description:v().optional(),minLength:C().optional(),maxLength:C().optional(),format:me(["email","uri","date","date-time"]).optional(),default:v().optional()}),H$=y({type:me(["number","integer"]),title:v().optional(),description:v().optional(),minimum:C().optional(),maximum:C().optional(),default:C().optional()}),V$=y({type:S("string"),title:v().optional(),description:v().optional(),enum:N(v()),default:v().optional()}),W$=y({type:S("string"),title:v().optional(),description:v().optional(),oneOf:N(y({const:v(),title:v()})),default:v().optional()}),G$=y({type:S("string"),title:v().optional(),description:v().optional(),enum:N(v()),enumNames:N(v()).optional(),default:v().optional()}),K$=F([V$,W$]),X$=y({type:S("array"),title:v().optional(),description:v().optional(),minItems:C().optional(),maxItems:C().optional(),items:y({type:S("string"),enum:N(v())}),default:N(v()).optional()}),Y$=y({type:S("array"),title:v().optional(),description:v().optional(),minItems:C().optional(),maxItems:C().optional(),items:y({anyOf:N(y({const:v(),title:v()}))}),default:N(v()).optional()}),Q$=F([X$,Y$]),eb=F([G$,K$,Q$]),tb=F([eb,q$,B$,H$]),nb=zt.extend({mode:S("form").optional(),message:v(),requestedSchema:y({type:S("object"),properties:G(v(),tb),required:N(v()).optional()})}),ib=zt.extend({mode:S("url"),message:v(),elicitationId:v(),url:v().url()}),rb=F([nb,ib]),ob=te.extend({method:S("elicitation/create"),params:rb}),ab=be.extend({elicitationId:v()}),sb=ye.extend({method:S("notifications/elicitation/complete"),params:ab}),ub=ne.extend({action:me(["accept","decline","cancel"]),content:Cs(e=>e===null?void 0:e,G(v(),F([v(),C(),Q(),N(v())])).optional())}),lb=y({type:S("ref/resource"),uri:v()}),cb=y({type:S("ref/prompt"),name:v()}),db=fe.extend({ref:F([cb,lb]),argument:y({name:v(),value:v()}),context:y({arguments:G(v(),v()).optional()}).optional()}),mb=te.extend({method:S("completion/complete"),params:db}),fb=ne.extend({completion:ue({values:N(v()).max(100),total:X(C().int()),hasMore:X(Q())})}),pb=y({uri:v().startsWith("file://"),name:v().optional(),_meta:G(v(),W()).optional()}),vb=te.extend({method:S("roots/list"),params:fe.optional()}),hb=ne.extend({roots:N(pb)}),gb=ye.extend({method:S("notifications/roots/list_changed"),params:be.optional()});F([Nn,H_,mb,U$,b$,g$,i$,r$,s$,c$,m$,Qs,Ys,er,nr,ir,or]);F([Xi,Yi,G_,gb,vn]);F([Ki,J$,F$,ub,hb,tr,rr,Qi]);F([Nn,M$,ob,vb,er,nr,ir,or]);F([Xi,Yi,P$,p$,u$,Z$,S$,vn,sb]);F([Ki,W_,fb,w$,_$,Ws,o$,Gs,Pn,x$,tr,rr,Qi]);class P extends Error{constructor(t,i,r){super(`MCP error ${t}: ${i}`),this.code=t,this.data=r,this.name="McpError"}static fromError(t,i,r){if(t===A.UrlElicitationRequired&&r){const n=r;if(n.elicitations)return new _b(n.elicitations,i)}return new P(t,i,r)}}class _b extends P{constructor(t,i=`URL elicitation${t.length>1?"s":""} required`){super(A.UrlElicitationRequired,i,{elicitations:t})}get elicitations(){return this.data?.elicitations??[]}}function Ce(e){return e==="completed"||e==="failed"||e==="cancelled"}new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function Ta(e){const i=_g(e)?.method;if(!i)throw new Error("Schema is missing a method literal");const r=$g(i);if(typeof r!="string")throw new Error("Schema method literal must be a string");return r}function Ua(e,t){const i=xs(e,t);if(!i.success)throw i.error;return i.data}const $b=6e4;class bb{constructor(t){this._options=t,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(Xi,i=>{this._oncancel(i)}),this.setNotificationHandler(Yi,i=>{this._onprogress(i)}),this.setRequestHandler(Nn,i=>({})),this._taskStore=t?.taskStore,this._taskMessageQueue=t?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(er,async(i,r)=>{const n=await this._taskStore.getTask(i.params.taskId,r.sessionId);if(!n)throw new P(A.InvalidParams,"Failed to retrieve task: Task not found");return{...n}}),this.setRequestHandler(nr,async(i,r)=>{const n=async()=>{const o=i.params.taskId;if(this._taskMessageQueue){let s;for(;s=await this._taskMessageQueue.dequeue(o,r.sessionId);){if(s.type==="response"||s.type==="error"){const u=s.message,l=u.id,c=this._requestResolvers.get(l);if(c)if(this._requestResolvers.delete(l),s.type==="response")c(u);else{const m=u,p=new P(m.error.code,m.error.message,m.error.data);c(p)}else{const m=s.type==="response"?"Response":"Error";this._onerror(new Error(`${m} handler missing for request ${l}`))}continue}await this._transport?.send(s.message,{relatedRequestId:r.requestId})}}const a=await this._taskStore.getTask(o,r.sessionId);if(!a)throw new P(A.InvalidParams,`Task not found: ${o}`);if(!Ce(a.status))return await this._waitForTaskUpdate(o,r.signal),await n();if(Ce(a.status)){const s=await this._taskStore.getTaskResult(o,r.sessionId);return this._clearTaskQueue(o),{...s,_meta:{...s._meta,[Le]:{taskId:o}}}}return await n()};return await n()}),this.setRequestHandler(ir,async(i,r)=>{try{const{tasks:n,nextCursor:o}=await this._taskStore.listTasks(i.params?.cursor,r.sessionId);return{tasks:n,nextCursor:o,_meta:{}}}catch(n){throw new P(A.InvalidParams,`Failed to list tasks: ${n instanceof Error?n.message:String(n)}`)}}),this.setRequestHandler(or,async(i,r)=>{try{const n=await this._taskStore.getTask(i.params.taskId,r.sessionId);if(!n)throw new P(A.InvalidParams,`Task not found: ${i.params.taskId}`);if(Ce(n.status))throw new P(A.InvalidParams,`Cannot cancel task in terminal status: ${n.status}`);await this._taskStore.updateTaskStatus(i.params.taskId,"cancelled","Client cancelled task execution.",r.sessionId),this._clearTaskQueue(i.params.taskId);const o=await this._taskStore.getTask(i.params.taskId,r.sessionId);if(!o)throw new P(A.InvalidParams,`Task not found after cancellation: ${i.params.taskId}`);return{_meta:{},...o}}catch(n){throw n instanceof P?n:new P(A.InvalidRequest,`Failed to cancel task: ${n instanceof Error?n.message:String(n)}`)}}))}async _oncancel(t){if(!t.params.requestId)return;this._requestHandlerAbortControllers.get(t.params.requestId)?.abort(t.params.reason)}_setupTimeout(t,i,r,n,o=!1){this._timeoutInfo.set(t,{timeoutId:setTimeout(n,i),startTime:Date.now(),timeout:i,maxTotalTimeout:r,resetTimeoutOnProgress:o,onTimeout:n})}_resetTimeout(t){const i=this._timeoutInfo.get(t);if(!i)return!1;const r=Date.now()-i.startTime;if(i.maxTotalTimeout&&r>=i.maxTotalTimeout)throw this._timeoutInfo.delete(t),P.fromError(A.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:i.maxTotalTimeout,totalElapsed:r});return clearTimeout(i.timeoutId),i.timeoutId=setTimeout(i.onTimeout,i.timeout),!0}_cleanupTimeout(t){const i=this._timeoutInfo.get(t);i&&(clearTimeout(i.timeoutId),this._timeoutInfo.delete(t))}async connect(t){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=t;const i=this.transport?.onclose;this._transport.onclose=()=>{i?.(),this._onclose()};const r=this.transport?.onerror;this._transport.onerror=o=>{r?.(o),this._onerror(o)};const n=this._transport?.onmessage;this._transport.onmessage=(o,a)=>{n?.(o,a),sn(o)||D_(o)?this._onresponse(o):Za(o)?this._onrequest(o,a):E_(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){const t=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const r of this._requestHandlerAbortControllers.values())r.abort();this._requestHandlerAbortControllers.clear();const i=P.fromError(A.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(const r of t.values())r(i)}_onerror(t){this.onerror?.(t)}_onnotification(t){const i=this._notificationHandlers.get(t.method)??this.fallbackNotificationHandler;i!==void 0&&Promise.resolve().then(()=>i(t)).catch(r=>this._onerror(new Error(`Uncaught error in notification handler: ${r}`)))}_onrequest(t,i){const r=this._requestHandlers.get(t.method)??this.fallbackRequestHandler,n=this._transport,o=t.params?._meta?.[Le]?.taskId;if(r===void 0){const c={jsonrpc:"2.0",id:t.id,error:{code:A.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:c,timestamp:Date.now()},n?.sessionId).catch(m=>this._onerror(new Error(`Failed to enqueue error response: ${m}`))):n?.send(c).catch(m=>this._onerror(new Error(`Failed to send an error response: ${m}`)));return}const a=new AbortController;this._requestHandlerAbortControllers.set(t.id,a);const s=j_(t.params)?t.params.task:void 0,u=this._taskStore?this.requestTaskStore(t,n?.sessionId):void 0,l={signal:a.signal,sessionId:n?.sessionId,_meta:t.params?._meta,sendNotification:async c=>{if(a.signal.aborted)return;const m={relatedRequestId:t.id};o&&(m.relatedTask={taskId:o}),await this.notification(c,m)},sendRequest:async(c,m,p)=>{if(a.signal.aborted)throw new P(A.ConnectionClosed,"Request was cancelled");const g={...p,relatedRequestId:t.id};o&&!g.relatedTask&&(g.relatedTask={taskId:o});const w=g.relatedTask?.taskId??o;return w&&u&&await u.updateTaskStatus(w,"input_required"),await this.request(c,m,g)},authInfo:i?.authInfo,requestId:t.id,requestInfo:i?.requestInfo,taskId:o,taskStore:u,taskRequestedTtl:s?.ttl,closeSSEStream:i?.closeSSEStream,closeStandaloneSSEStream:i?.closeStandaloneSSEStream};Promise.resolve().then(()=>{s&&this.assertTaskHandlerCapability(t.method)}).then(()=>r(t,l)).then(async c=>{if(a.signal.aborted)return;const m={result:c,jsonrpc:"2.0",id:t.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:m,timestamp:Date.now()},n?.sessionId):await n?.send(m)},async c=>{if(a.signal.aborted)return;const m={jsonrpc:"2.0",id:t.id,error:{code:Number.isSafeInteger(c.code)?c.code:A.InternalError,message:c.message??"Internal error",...c.data!==void 0&&{data:c.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:m,timestamp:Date.now()},n?.sessionId):await n?.send(m)}).catch(c=>this._onerror(new Error(`Failed to send response: ${c}`))).finally(()=>{this._requestHandlerAbortControllers.delete(t.id)})}_onprogress(t){const{progressToken:i,...r}=t.params,n=Number(i),o=this._progressHandlers.get(n);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(t)}`));return}const a=this._responseHandlers.get(n),s=this._timeoutInfo.get(n);if(s&&a&&s.resetTimeoutOnProgress)try{this._resetTimeout(n)}catch(u){this._responseHandlers.delete(n),this._progressHandlers.delete(n),this._cleanupTimeout(n),a(u);return}o(r)}_onresponse(t){const i=Number(t.id),r=this._requestResolvers.get(i);if(r){if(this._requestResolvers.delete(i),sn(t))r(t);else{const a=new P(t.error.code,t.error.message,t.error.data);r(a)}return}const n=this._responseHandlers.get(i);if(n===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(t)}`));return}this._responseHandlers.delete(i),this._cleanupTimeout(i);let o=!1;if(sn(t)&&t.result&&typeof t.result=="object"){const a=t.result;if(a.task&&typeof a.task=="object"){const s=a.task;typeof s.taskId=="string"&&(o=!0,this._taskProgressTokens.set(s.taskId,i))}}if(o||this._progressHandlers.delete(i),sn(t))n(t);else{const a=P.fromError(t.error.code,t.error.message,t.error.data);n(a)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(t,i,r){const{task:n}=r??{};if(!n){try{yield{type:"result",result:await this.request(t,i,r)}}catch(a){yield{type:"error",error:a instanceof P?a:new P(A.InternalError,String(a))}}return}let o;try{const a=await this.request(t,Qi,r);if(a.task)o=a.task.taskId,yield{type:"taskCreated",task:a.task};else throw new P(A.InternalError,"Task creation did not return a task");for(;;){const s=await this.getTask({taskId:o},r);if(yield{type:"taskStatus",task:s},Ce(s.status)){s.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},i,r)}:s.status==="failed"?yield{type:"error",error:new P(A.InternalError,`Task ${o} failed`)}:s.status==="cancelled"&&(yield{type:"error",error:new P(A.InternalError,`Task ${o} was cancelled`)});return}if(s.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},i,r)};return}const u=s.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(l=>setTimeout(l,u)),r?.signal?.throwIfAborted()}}catch(a){yield{type:"error",error:a instanceof P?a:new P(A.InternalError,String(a))}}}request(t,i,r){const{relatedRequestId:n,resumptionToken:o,onresumptiontoken:a,task:s,relatedTask:u}=r??{};return new Promise((l,c)=>{const m=R=>{c(R)};if(!this._transport){m(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method),s&&this.assertTaskCapability(t.method)}catch(R){m(R);return}r?.signal?.throwIfAborted();const p=this._requestMessageId++,g={...t,jsonrpc:"2.0",id:p};r?.onprogress&&(this._progressHandlers.set(p,r.onprogress),g.params={...t.params,_meta:{...t.params?._meta||{},progressToken:p}}),s&&(g.params={...g.params,task:s}),u&&(g.params={...g.params,_meta:{...g.params?._meta||{},[Le]:u}});const w=R=>{this._responseHandlers.delete(p),this._progressHandlers.delete(p),this._cleanupTimeout(p),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:p,reason:String(R)}},{relatedRequestId:n,resumptionToken:o,onresumptiontoken:a}).catch(j=>this._onerror(new Error(`Failed to send cancellation: ${j}`)));const T=R instanceof P?R:new P(A.RequestTimeout,String(R));c(T)};this._responseHandlers.set(p,R=>{if(!r?.signal?.aborted){if(R instanceof Error)return c(R);try{const T=xs(i,R.result);T.success?l(T.data):c(T.error)}catch(T){c(T)}}}),r?.signal?.addEventListener("abort",()=>{w(r?.signal?.reason)});const D=r?.timeout??$b,Se=()=>w(P.fromError(A.RequestTimeout,"Request timed out",{timeout:D}));this._setupTimeout(p,D,r?.maxTotalTimeout,Se,r?.resetTimeoutOnProgress??!1);const Ke=u?.taskId;if(Ke){const R=T=>{const j=this._responseHandlers.get(p);j?j(T):this._onerror(new Error(`Response handler missing for side-channeled request ${p}`))};this._requestResolvers.set(p,R),this._enqueueTaskMessage(Ke,{type:"request",message:g,timestamp:Date.now()}).catch(T=>{this._cleanupTimeout(p),c(T)})}else this._transport.send(g,{relatedRequestId:n,resumptionToken:o,onresumptiontoken:a}).catch(R=>{this._cleanupTimeout(p),c(R)})})}async getTask(t,i){return this.request({method:"tasks/get",params:t},tr,i)}async getTaskResult(t,i,r){return this.request({method:"tasks/result",params:t},i,r)}async listTasks(t,i){return this.request({method:"tasks/list",params:t},rr,i)}async cancelTask(t,i){return this.request({method:"tasks/cancel",params:t},t$,i)}async notification(t,i){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(t.method);const r=i?.relatedTask?.taskId;if(r){const s={...t,jsonrpc:"2.0",params:{...t.params,_meta:{...t.params?._meta||{},[Le]:i.relatedTask}}};await this._enqueueTaskMessage(r,{type:"notification",message:s,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&!i?.relatedRequestId&&!i?.relatedTask){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(t.method),!this._transport)return;let s={...t,jsonrpc:"2.0"};i?.relatedTask&&(s={...s,params:{...s.params,_meta:{...s.params?._meta||{},[Le]:i.relatedTask}}}),this._transport?.send(s,i).catch(u=>this._onerror(u))});return}let a={...t,jsonrpc:"2.0"};i?.relatedTask&&(a={...a,params:{...a.params,_meta:{...a.params?._meta||{},[Le]:i.relatedTask}}}),await this._transport.send(a,i)}setRequestHandler(t,i){const r=Ta(t);this.assertRequestHandlerCapability(r),this._requestHandlers.set(r,(n,o)=>{const a=Ua(t,n);return Promise.resolve(i(a,o))})}removeRequestHandler(t){this._requestHandlers.delete(t)}assertCanSetRequestHandler(t){if(this._requestHandlers.has(t))throw new Error(`A request handler for ${t} already exists, which would be overridden`)}setNotificationHandler(t,i){const r=Ta(t);this._notificationHandlers.set(r,n=>{const o=Ua(t,n);return Promise.resolve(i(o))})}removeNotificationHandler(t){this._notificationHandlers.delete(t)}_cleanupTaskProgressHandler(t){const i=this._taskProgressTokens.get(t);i!==void 0&&(this._progressHandlers.delete(i),this._taskProgressTokens.delete(t))}async _enqueueTaskMessage(t,i,r){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const n=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(t,i,r,n)}async _clearTaskQueue(t,i){if(this._taskMessageQueue){const r=await this._taskMessageQueue.dequeueAll(t,i);for(const n of r)if(n.type==="request"&&Za(n.message)){const o=n.message.id,a=this._requestResolvers.get(o);a?(a(new P(A.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${t} cleanup`))}}}async _waitForTaskUpdate(t,i){let r=this._options?.defaultTaskPollInterval??1e3;try{const n=await this._taskStore?.getTask(t);n?.pollInterval&&(r=n.pollInterval)}catch{}return new Promise((n,o)=>{if(i.aborted){o(new P(A.InvalidRequest,"Request cancelled"));return}const a=setTimeout(n,r);i.addEventListener("abort",()=>{clearTimeout(a),o(new P(A.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(t,i){const r=this._taskStore;if(!r)throw new Error("No task store configured");return{createTask:async n=>{if(!t)throw new Error("No request provided");return await r.createTask(n,t.id,{method:t.method,params:t.params},i)},getTask:async n=>{const o=await r.getTask(n,i);if(!o)throw new P(A.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(n,o,a)=>{await r.storeTaskResult(n,o,a,i);const s=await r.getTask(n,i);if(s){const u=vn.parse({method:"notifications/tasks/status",params:s});await this.notification(u),Ce(s.status)&&this._cleanupTaskProgressHandler(n)}},getTaskResult:n=>r.getTaskResult(n,i),updateTaskStatus:async(n,o,a)=>{const s=await r.getTask(n,i);if(!s)throw new P(A.InvalidParams,`Task "${n}" not found - it may have been cleaned up`);if(Ce(s.status))throw new P(A.InvalidParams,`Cannot update task "${n}" from terminal status "${s.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await r.updateTaskStatus(n,o,a,i);const u=await r.getTask(n,i);if(u){const l=vn.parse({method:"notifications/tasks/status",params:u});await this.notification(l),Ce(u.status)&&this._cleanupTaskProgressHandler(n)}},listTasks:n=>r.listTasks(n,i)}}}var yb=Object.defineProperty,kb=e=>e;function wb(e,t){this[e]=kb.bind(null,t)}var xe=(e,t)=>{for(var i in t)yb(e,i,{get:t[i],enumerable:!0,configurable:!0,set:wb.bind(t,i)})};class Sb{eventTarget;eventSource;messageListener;constructor(t=window.parent,i){this.eventTarget=t,this.eventSource=i,this.messageListener=r=>{if(i&&r.source!==this.eventSource){console.debug("Ignoring message from unknown source",r);return}let n=R_.safeParse(r.data);n.success?(console.debug("Parsed message",n.data),this.onmessage?.(n.data)):r.data?.jsonrpc!=="2.0"?console.debug("Ignoring non-JSON-RPC message",n.error.message,r):(console.error("Failed to parse message",n.error.message,r),this.onerror?.(Error("Invalid JSON-RPC message received: "+n.error.message)))}}async start(){window.addEventListener("message",this.messageListener)}async send(t,i){console.debug("Sending message",t),this.eventTarget.postMessage(t,"*")}async close(){window.removeEventListener("message",this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion}var Ib="2026-01-26",d={};xe(d,{xor:()=>_f,xid:()=>Lm,void:()=>mf,uuidv7:()=>Nm,uuidv6:()=>Um,uuidv4:()=>Tm,uuid:()=>Zm,util:()=>U,url:()=>Pm,uppercase:()=>Jn,unknown:()=>Be,union:()=>_i,undefined:()=>cf,ulid:()=>Cm,uint64:()=>uf,uint32:()=>of,tuple:()=>jo,trim:()=>Wn,treeifyError:()=>vu,transform:()=>bi,toUpperCase:()=>Kn,toLowerCase:()=>Gn,toJSONSchema:()=>sm,templateLiteral:()=>Uf,symbol:()=>lf,superRefine:()=>sa,success:()=>Of,stringbool:()=>Af,stringFormat:()=>Xm,string:()=>wn,strictObject:()=>hf,startsWith:()=>qn,slugify:()=>Xn,size:()=>Ft,setErrorMap:()=>Hw,set:()=>wf,safeParseAsync:()=>_m,safeParse:()=>gm,safeEncodeAsync:()=>Im,safeEncode:()=>wm,safeDecodeAsync:()=>zm,safeDecode:()=>Sm,registry:()=>Rr,regexes:()=>We,regex:()=>Ln,refine:()=>aa,record:()=>Eo,readonly:()=>ea,property:()=>uo,promise:()=>Nf,prettifyError:()=>gu,preprocess:()=>Lf,prefault:()=>Vo,positive:()=>ro,pipe:()=>St,partialRecord:()=>bf,parseAsync:()=>hm,parse:()=>vm,overwrite:()=>Ze,optional:()=>kt,object:()=>vf,number:()=>_o,nullish:()=>xf,nullable:()=>wt,null:()=>wo,normalize:()=>Vn,nonpositive:()=>ao,nonoptional:()=>Wo,nonnegative:()=>so,never:()=>hi,negative:()=>oo,nativeEnum:()=>Sf,nanoid:()=>Dm,nan:()=>Zf,multipleOf:()=>at,minSize:()=>je,minLength:()=>qe,mime:()=>Hn,meta:()=>Df,maxSize:()=>ft,maxLength:()=>qt,map:()=>kf,mac:()=>Fm,lte:()=>ge,lt:()=>Ne,lowercase:()=>Mn,looseRecord:()=>yf,looseObject:()=>gf,locales:()=>Dr,literal:()=>If,length:()=>Bt,lazy:()=>ia,ksuid:()=>Mm,keyof:()=>pf,jwt:()=>Km,json:()=>Cf,iso:()=>mo,ipv6:()=>qm,ipv4:()=>Jm,intersection:()=>No,int64:()=>sf,int32:()=>rf,int:()=>Sn,instanceof:()=>Rf,includes:()=>Fn,httpUrl:()=>jm,hostname:()=>Ym,hex:()=>Qm,hash:()=>ef,guid:()=>Om,gte:()=>se,gt:()=>Pe,globalRegistry:()=>he,getErrorMap:()=>Vw,function:()=>In,fromJSONSchema:()=>Xw,formatError:()=>hr,float64:()=>nf,float32:()=>tf,flattenError:()=>vr,file:()=>zf,exactOptional:()=>Jo,enum:()=>$i,endsWith:()=>Bn,encodeAsync:()=>ym,encode:()=>$m,emoji:()=>Em,email:()=>xm,e164:()=>Gm,discriminatedUnion:()=>$f,describe:()=>Ef,decodeAsync:()=>km,decode:()=>bm,date:()=>ff,custom:()=>jf,cuid2:()=>Am,cuid:()=>Rm,core:()=>tu,config:()=>re,coerce:()=>Jf,codec:()=>Tf,clone:()=>ke,cidrv6:()=>Hm,cidrv4:()=>Bm,check:()=>Pf,catch:()=>Xo,boolean:()=>$o,bigint:()=>af,base64url:()=>Wm,base64:()=>Vm,array:()=>Yt,any:()=>df,_function:()=>In,_default:()=>Bo,_ZodString:()=>Yn,ZodXor:()=>Zo,ZodXID:()=>oi,ZodVoid:()=>xo,ZodUnknown:()=>Io,ZodUnion:()=>en,ZodUndefined:()=>yo,ZodUUID:()=>Ie,ZodURL:()=>Wt,ZodULID:()=>ri,ZodType:()=>O,ZodTuple:()=>Po,ZodTransform:()=>Lo,ZodTemplateLiteral:()=>ta,ZodSymbol:()=>bo,ZodSuccess:()=>Go,ZodStringFormat:()=>J,ZodString:()=>Vt,ZodSet:()=>Ro,ZodRecord:()=>tn,ZodRealError:()=>ve,ZodReadonly:()=>Qo,ZodPromise:()=>ra,ZodPrefault:()=>Ho,ZodPipe:()=>wi,ZodOptional:()=>yi,ZodObject:()=>Qt,ZodNumberFormat:()=>Ge,ZodNumber:()=>Gt,ZodNullable:()=>Fo,ZodNull:()=>ko,ZodNonOptional:()=>ki,ZodNever:()=>zo,ZodNanoID:()=>ti,ZodNaN:()=>Yo,ZodMap:()=>Do,ZodMAC:()=>go,ZodLiteral:()=>Ao,ZodLazy:()=>na,ZodKSUID:()=>ai,ZodJWT:()=>pi,ZodIssueCode:()=>Bw,ZodIntersection:()=>Uo,ZodISOTime:()=>vo,ZodISODuration:()=>ho,ZodISODateTime:()=>fo,ZodISODate:()=>po,ZodIPv6:()=>ui,ZodIPv4:()=>si,ZodGUID:()=>yt,ZodFunction:()=>oa,ZodFirstPartyTypeKind:()=>Ri,ZodFile:()=>Co,ZodExactOptional:()=>Mo,ZodError:()=>qw,ZodEnum:()=>ct,ZodEmoji:()=>ei,ZodEmail:()=>Qn,ZodE164:()=>fi,ZodDiscriminatedUnion:()=>To,ZodDefault:()=>qo,ZodDate:()=>gi,ZodCustomStringFormat:()=>pt,ZodCustom:()=>nn,ZodCodec:()=>Si,ZodCatch:()=>Ko,ZodCUID2:()=>ii,ZodCUID:()=>ni,ZodCIDRv6:()=>ci,ZodCIDRv4:()=>li,ZodBoolean:()=>Kt,ZodBigIntFormat:()=>vi,ZodBigInt:()=>Xt,ZodBase64URL:()=>mi,ZodBase64:()=>di,ZodArray:()=>Oo,ZodAny:()=>So,TimePrecision:()=>Lc,NEVER:()=>nu,$output:()=>jc,$input:()=>Ec,$brand:()=>iu});var tu={};xe(tu,{version:()=>gl,util:()=>U,treeifyError:()=>vu,toJSONSchema:()=>sm,toDotPath:()=>hu,safeParseAsync:()=>$u,safeParse:()=>_u,safeEncodeAsync:()=>ry,safeEncode:()=>ny,safeDecodeAsync:()=>oy,safeDecode:()=>iy,registry:()=>Rr,regexes:()=>We,process:()=>L,prettifyError:()=>gu,parseAsync:()=>ji,parse:()=>Pi,meta:()=>yd,locales:()=>Dr,isValidJWT:()=>Jl,isValidBase64URL:()=>Cl,isValidBase64:()=>Zr,initializeContext:()=>st,globalRegistry:()=>he,globalConfig:()=>gn,formatError:()=>hr,flattenError:()=>vr,finalize:()=>lt,extractDefs:()=>ut,encodeAsync:()=>ey,encode:()=>Yb,describe:()=>bd,decodeAsync:()=>ty,decode:()=>Qb,createToJSONSchemaMethod:()=>wd,createStandardJSONSchemaMethod:()=>bt,config:()=>re,clone:()=>ke,_xor:()=>$w,_xid:()=>Wr,_void:()=>cd,_uuidv7:()=>Jr,_uuidv6:()=>Mr,_uuidv4:()=>Lr,_uuid:()=>Cr,_url:()=>Cn,_uppercase:()=>Jn,_unknown:()=>ud,_union:()=>_w,_undefined:()=>od,_ulid:()=>Vr,_uint64:()=>id,_uint32:()=>Xc,_tuple:()=>kw,_trim:()=>Wn,_transform:()=>Zw,_toUpperCase:()=>Kn,_toLowerCase:()=>Gn,_templateLiteral:()=>Aw,_symbol:()=>rd,_superRefine:()=>_d,_success:()=>jw,_stringbool:()=>kd,_stringFormat:()=>Ht,_string:()=>Rc,_startsWith:()=>qn,_slugify:()=>Xn,_size:()=>Ft,_set:()=>Iw,_safeParseAsync:()=>At,_safeParse:()=>Rt,_safeEncodeAsync:()=>wr,_safeEncode:()=>yr,_safeDecodeAsync:()=>Sr,_safeDecode:()=>kr,_regex:()=>Ln,_refine:()=>gd,_record:()=>ww,_readonly:()=>Rw,_property:()=>uo,_promise:()=>Lw,_positive:()=>ro,_pipe:()=>Dw,_parseAsync:()=>Dt,_parse:()=>Et,_overwrite:()=>Ze,_optional:()=>Tw,_number:()=>Bc,_nullable:()=>Uw,_null:()=>ad,_normalize:()=>Vn,_nonpositive:()=>ao,_nonoptional:()=>Pw,_nonnegative:()=>so,_never:()=>ld,_negative:()=>oo,_nativeEnum:()=>xw,_nanoid:()=>qr,_nan:()=>fd,_multipleOf:()=>at,_minSize:()=>je,_minLength:()=>qe,_min:()=>se,_mime:()=>Hn,_maxSize:()=>ft,_maxLength:()=>qt,_max:()=>ge,_map:()=>Sw,_mac:()=>Cc,_lte:()=>ge,_lt:()=>Ne,_lowercase:()=>Mn,_literal:()=>Ow,_length:()=>Bt,_lazy:()=>Cw,_ksuid:()=>Gr,_jwt:()=>io,_isoTime:()=>Fc,_isoDuration:()=>qc,_isoDateTime:()=>Mc,_isoDate:()=>Jc,_ipv6:()=>Xr,_ipv4:()=>Kr,_intersection:()=>yw,_int64:()=>nd,_int32:()=>Kc,_int:()=>Vc,_includes:()=>Fn,_guid:()=>kn,_gte:()=>se,_gt:()=>Pe,_float64:()=>Gc,_float32:()=>Wc,_file:()=>vd,_enum:()=>zw,_endsWith:()=>Bn,_encodeAsync:()=>$r,_encode:()=>gr,_emoji:()=>Fr,_email:()=>Ar,_e164:()=>no,_discriminatedUnion:()=>bw,_default:()=>Nw,_decodeAsync:()=>br,_decode:()=>_r,_date:()=>dd,_custom:()=>hd,_cuid2:()=>Hr,_cuid:()=>Br,_coercedString:()=>Ac,_coercedNumber:()=>Hc,_coercedDate:()=>md,_coercedBoolean:()=>Qc,_coercedBigint:()=>td,_cidrv6:()=>Qr,_cidrv4:()=>Yr,_check:()=>$d,_catch:()=>Ew,_boolean:()=>Yc,_bigint:()=>ed,_base64url:()=>to,_base64:()=>eo,_array:()=>pd,_any:()=>sd,TimePrecision:()=>Lc,NEVER:()=>nu,JSONSchemaGenerator:()=>Jw,JSONSchema:()=>Fw,Doc:()=>hl,$output:()=>jc,$input:()=>Ec,$constructor:()=>f,$brand:()=>iu,$ZodXor:()=>ac,$ZodXID:()=>xl,$ZodVoid:()=>Ql,$ZodUnknown:()=>Xl,$ZodUnion:()=>An,$ZodUndefined:()=>Wl,$ZodUUID:()=>$l,$ZodURL:()=>yl,$ZodULID:()=>zl,$ZodType:()=>x,$ZodTuple:()=>Pr,$ZodTransform:()=>vc,$ZodTemplateLiteral:()=>zc,$ZodSymbol:()=>Vl,$ZodSuccess:()=>yc,$ZodStringFormat:()=>M,$ZodString:()=>Jt,$ZodSet:()=>dc,$ZodRegistry:()=>Dc,$ZodRecord:()=>lc,$ZodRealError:()=>pe,$ZodReadonly:()=>Ic,$ZodPromise:()=>Oc,$ZodPrefault:()=>$c,$ZodPipe:()=>Sc,$ZodOptional:()=>jr,$ZodObjectJIT:()=>oc,$ZodObject:()=>rc,$ZodNumberFormat:()=>Bl,$ZodNumber:()=>Tr,$ZodNullable:()=>gc,$ZodNull:()=>Gl,$ZodNonOptional:()=>bc,$ZodNever:()=>Yl,$ZodNanoID:()=>wl,$ZodNaN:()=>wc,$ZodMap:()=>cc,$ZodMAC:()=>El,$ZodLiteral:()=>fc,$ZodLazy:()=>Zc,$ZodKSUID:()=>Ol,$ZodJWT:()=>Fl,$ZodIntersection:()=>uc,$ZodISOTime:()=>Ul,$ZodISODuration:()=>Nl,$ZodISODateTime:()=>Zl,$ZodISODate:()=>Tl,$ZodIPv6:()=>jl,$ZodIPv4:()=>Pl,$ZodGUID:()=>_l,$ZodFunction:()=>xc,$ZodFile:()=>pc,$ZodExactOptional:()=>hc,$ZodError:()=>pr,$ZodEnum:()=>mc,$ZodEncodeError:()=>jn,$ZodEmoji:()=>kl,$ZodEmail:()=>bl,$ZodE164:()=>Ml,$ZodDiscriminatedUnion:()=>sc,$ZodDefault:()=>_c,$ZodDate:()=>ec,$ZodCustomStringFormat:()=>ql,$ZodCustom:()=>Tc,$ZodCodec:()=>Er,$ZodCheckUpperCase:()=>ll,$ZodCheckStringFormat:()=>Mt,$ZodCheckStartsWith:()=>dl,$ZodCheckSizeEquals:()=>il,$ZodCheckRegex:()=>sl,$ZodCheckProperty:()=>fl,$ZodCheckOverwrite:()=>vl,$ZodCheckNumberFormat:()=>Qu,$ZodCheckMultipleOf:()=>Yu,$ZodCheckMinSize:()=>nl,$ZodCheckMinLength:()=>ol,$ZodCheckMimeType:()=>pl,$ZodCheckMaxSize:()=>tl,$ZodCheckMaxLength:()=>rl,$ZodCheckLowerCase:()=>ul,$ZodCheckLessThan:()=>xr,$ZodCheckLengthEquals:()=>al,$ZodCheckIncludes:()=>cl,$ZodCheckGreaterThan:()=>Or,$ZodCheckEndsWith:()=>ml,$ZodCheckBigIntFormat:()=>el,$ZodCheck:()=>V,$ZodCatch:()=>kc,$ZodCUID2:()=>Il,$ZodCUID:()=>Sl,$ZodCIDRv6:()=>Rl,$ZodCIDRv4:()=>Dl,$ZodBoolean:()=>Ur,$ZodBigIntFormat:()=>Hl,$ZodBigInt:()=>Nr,$ZodBase64URL:()=>Ll,$ZodBase64:()=>Al,$ZodAsyncError:()=>Je,$ZodArray:()=>tc,$ZodAny:()=>Kl});var nu=Object.freeze({status:"aborted"});function f(e,t,i){function r(s,u){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:u,constr:a,traits:new Set},enumerable:!1}),s._zod.traits.has(e))return;s._zod.traits.add(e),t(s,u);let l=a.prototype,c=Object.keys(l);for(let m=0;m<c.length;m++){let p=c[m];p in s||(s[p]=l[p].bind(s))}}let n=i?.Parent??Object;class o extends n{}Object.defineProperty(o,"name",{value:e});function a(s){var u;let l=i?.Parent?new o:this;r(l,s),(u=l._zod).deferred??(u.deferred=[]);for(let c of l._zod.deferred)c();return l}return Object.defineProperty(a,"init",{value:r}),Object.defineProperty(a,Symbol.hasInstance,{value:s=>i?.Parent&&s instanceof i.Parent?!0:s?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}var iu=Symbol("zod_brand");class Je extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class jn extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}var gn={};function re(e){return e&&Object.assign(gn,e),gn}var U={};xe(U,{unwrapMessage:()=>gt,uint8ArrayToHex:()=>Kb,uint8ArrayToBase64url:()=>Wb,uint8ArrayToBase64:()=>fu,stringifyPrimitive:()=>I,slugify:()=>ou,shallowClone:()=>su,safeExtend:()=>Jb,required:()=>Bb,randomString:()=>Eb,propertyKeyTypes:()=>$n,promiseAllObject:()=>jb,primitiveTypes:()=>uu,prefixIssues:()=>we,pick:()=>Cb,partial:()=>qb,parsedType:()=>z,optionalKeys:()=>lu,omit:()=>Lb,objectClone:()=>Ub,numKeys:()=>Db,nullish:()=>Ve,normalizeParams:()=>$,mergeDefs:()=>Oe,merge:()=>Fb,jsonStringifyReplacer:()=>_n,joinValues:()=>_,issue:()=>bn,isPlainObject:()=>Fe,isObject:()=>rt,hexToUint8Array:()=>Gb,getSizableOrigin:()=>Dn,getParsedType:()=>Rb,getLengthableOrigin:()=>Rn,getEnumValues:()=>mr,getElementAtPath:()=>Pb,floatSafeRemainder:()=>ru,finalizeIssue:()=>_e,extend:()=>Mb,escapeRegex:()=>ze,esc:()=>Ni,defineLazy:()=>Z,createTransparentProxy:()=>Ab,cloneDef:()=>Nb,clone:()=>ke,cleanRegex:()=>En,cleanEnum:()=>Hb,captureStackTrace:()=>fr,cached:()=>jt,base64urlToUint8Array:()=>Vb,base64ToUint8Array:()=>mu,assignProp:()=>Re,assertNotEqual:()=>xb,assertNever:()=>Zb,assertIs:()=>Ob,assertEqual:()=>zb,assert:()=>Tb,allowsEval:()=>au,aborted:()=>Me,NUMBER_FORMAT_RANGES:()=>cu,Class:()=>Xb,BIGINT_FORMAT_RANGES:()=>du});function zb(e){return e}function xb(e){return e}function Ob(e){}function Zb(e){throw Error("Unexpected value in exhaustive check")}function Tb(e){}function mr(e){let t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,r])=>t.indexOf(+i)===-1).map(([i,r])=>r)}function _(e,t="|"){return e.map(i=>I(i)).join(t)}function _n(e,t){return typeof t=="bigint"?t.toString():t}function jt(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Ve(e){return e==null}function En(e){let t=e.startsWith("^")?1:0,i=e.endsWith("$")?e.length-1:e.length;return e.slice(t,i)}function ru(e,t){let i=(e.toString().split(".")[1]||"").length,r=t.toString(),n=(r.split(".")[1]||"").length;if(n===0&&/\d?e-\d?/.test(r)){let u=r.match(/\d?e-(\d?)/);u?.[1]&&(n=Number.parseInt(u[1]))}let o=i>n?i:n,a=Number.parseInt(e.toFixed(o).replace(".","")),s=Number.parseInt(t.toFixed(o).replace(".",""));return a%s/10**o}var Na=Symbol("evaluating");function Z(e,t,i){let r;Object.defineProperty(e,t,{get(){if(r!==Na)return r===void 0&&(r=Na,r=i()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Ub(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Re(e,t,i){Object.defineProperty(e,t,{value:i,writable:!0,enumerable:!0,configurable:!0})}function Oe(...e){let t={};for(let i of e){let r=Object.getOwnPropertyDescriptors(i);Object.assign(t,r)}return Object.defineProperties({},t)}function Nb(e){return Oe(e._zod.def)}function Pb(e,t){return t?t.reduce((i,r)=>i?.[r],e):e}function jb(e){let t=Object.keys(e),i=t.map(r=>e[r]);return Promise.all(i).then(r=>{let n={};for(let o=0;o<t.length;o++)n[t[o]]=r[o];return n})}function Eb(e=10){let t="";for(let i=0;i<e;i++)t+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return t}function Ni(e){return JSON.stringify(e)}function ou(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var fr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function rt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var au=jt(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch{return!1}});function Fe(e){if(rt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let i=t.prototype;return!(rt(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function su(e){return Fe(e)?{...e}:Array.isArray(e)?[...e]:e}function Db(e){let t=0;for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&t++;return t}var Rb=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw Error(`Unknown data type: ${t}`)}},$n=new Set(["string","number","symbol"]),uu=new Set(["string","number","bigint","boolean","symbol","undefined"]);function ze(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ke(e,t,i){let r=new e._zod.constr(t??e._zod.def);return(!t||i?.parent)&&(r._zod.parent=e),r}function $(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Ab(e){let t;return new Proxy({},{get(i,r,n){return t??(t=e()),Reflect.get(t,r,n)},set(i,r,n,o){return t??(t=e()),Reflect.set(t,r,n,o)},has(i,r){return t??(t=e()),Reflect.has(t,r)},deleteProperty(i,r){return t??(t=e()),Reflect.deleteProperty(t,r)},ownKeys(i){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(i,r){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(i,r,n){return t??(t=e()),Reflect.defineProperty(t,r,n)}})}function I(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function lu(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var cu={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]},du={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Cb(e,t){let i=e._zod.def,r=i.checks;if(r&&r.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let n=Oe(e._zod.def,{get shape(){let o={};for(let a in t){if(!(a in i.shape))throw Error(`Unrecognized key: "${a}"`);t[a]&&(o[a]=i.shape[a])}return Re(this,"shape",o),o},checks:[]});return ke(e,n)}function Lb(e,t){let i=e._zod.def,r=i.checks;if(r&&r.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let n=Oe(e._zod.def,{get shape(){let o={...e._zod.def.shape};for(let a in t){if(!(a in i.shape))throw Error(`Unrecognized key: "${a}"`);t[a]&&delete o[a]}return Re(this,"shape",o),o},checks:[]});return ke(e,n)}function Mb(e,t){if(!Fe(t))throw Error("Invalid input to extend: expected a plain object");let i=e._zod.def.checks;if(i&&i.length>0){let n=e._zod.def.shape;for(let o in t)if(Object.getOwnPropertyDescriptor(n,o)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let r=Oe(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Re(this,"shape",n),n}});return ke(e,r)}function Jb(e,t){if(!Fe(t))throw Error("Invalid input to safeExtend: expected a plain object");let i=Oe(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t};return Re(this,"shape",r),r}});return ke(e,i)}function Fb(e,t){let i=Oe(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return Re(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return ke(e,i)}function qb(e,t,i){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let n=Oe(t._zod.def,{get shape(){let o=t._zod.def.shape,a={...o};if(i)for(let s in i){if(!(s in o))throw Error(`Unrecognized key: "${s}"`);i[s]&&(a[s]=e?new e({type:"optional",innerType:o[s]}):o[s])}else for(let s in o)a[s]=e?new e({type:"optional",innerType:o[s]}):o[s];return Re(this,"shape",a),a},checks:[]});return ke(t,n)}function Bb(e,t,i){let r=Oe(t._zod.def,{get shape(){let n=t._zod.def.shape,o={...n};if(i)for(let a in i){if(!(a in o))throw Error(`Unrecognized key: "${a}"`);i[a]&&(o[a]=new e({type:"nonoptional",innerType:n[a]}))}else for(let a in n)o[a]=new e({type:"nonoptional",innerType:n[a]});return Re(this,"shape",o),o}});return ke(t,r)}function Me(e,t=0){if(e.aborted===!0)return!0;for(let i=t;i<e.issues.length;i++)if(e.issues[i]?.continue!==!0)return!0;return!1}function we(e,t){return t.map(i=>{var r;return(r=i).path??(r.path=[]),i.path.unshift(e),i})}function gt(e){return typeof e=="string"?e:e?.message}function _e(e,t,i){let r={...e,path:e.path??[]};if(!e.message){let n=gt(e.inst?._zod.def?.error?.(e))??gt(t?.error?.(e))??gt(i.customError?.(e))??gt(i.localeError?.(e))??"Invalid input";r.message=n}return delete r.inst,delete r.continue,!t?.reportInput&&delete r.input,r}function Dn(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Rn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function z(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let i=e;if(i&&Object.getPrototypeOf(i)!==Object.prototype&&"constructor"in i&&i.constructor)return i.constructor.name}}return t}function bn(...e){let[t,i,r]=e;return typeof t=="string"?{message:t,code:"custom",input:i,inst:r}:{...t}}function Hb(e){return Object.entries(e).filter(([t,i])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function mu(e){let t=atob(e),i=new Uint8Array(t.length);for(let r=0;r<t.length;r++)i[r]=t.charCodeAt(r);return i}function fu(e){let t="";for(let i=0;i<e.length;i++)t+=String.fromCharCode(e[i]);return btoa(t)}function Vb(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),i="=".repeat((4-t.length%4)%4);return mu(t+i)}function Wb(e){return fu(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Gb(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw Error("Invalid hex string length");let i=new Uint8Array(t.length/2);for(let r=0;r<t.length;r+=2)i[r/2]=Number.parseInt(t.slice(r,r+2),16);return i}function Kb(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}class Xb{constructor(...t){}}var pu=(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,_n,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},pr=f("$ZodError",pu),pe=f("$ZodError",pu,{Parent:Error});function vr(e,t=i=>i.message){let i={},r=[];for(let n of e.issues)n.path.length>0?(i[n.path[0]]=i[n.path[0]]||[],i[n.path[0]].push(t(n))):r.push(t(n));return{formErrors:r,fieldErrors:i}}function hr(e,t=i=>i.message){let i={_errors:[]},r=n=>{for(let o of n.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(a=>r({issues:a}));else if(o.code==="invalid_key")r({issues:o.issues});else if(o.code==="invalid_element")r({issues:o.issues});else if(o.path.length===0)i._errors.push(t(o));else{let a=i,s=0;for(;s<o.path.length;){let u=o.path[s];s!==o.path.length-1?a[u]=a[u]||{_errors:[]}:(a[u]=a[u]||{_errors:[]},a[u]._errors.push(t(o))),a=a[u],s++}}};return r(e),i}function vu(e,t=i=>i.message){let i={errors:[]},r=(n,o=[])=>{var a,s;for(let u of n.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(l=>r({issues:l},u.path));else if(u.code==="invalid_key")r({issues:u.issues},u.path);else if(u.code==="invalid_element")r({issues:u.issues},u.path);else{let l=[...o,...u.path];if(l.length===0){i.errors.push(t(u));continue}let c=i,m=0;for(;m<l.length;){let p=l[m],g=m===l.length-1;typeof p=="string"?(c.properties??(c.properties={}),(a=c.properties)[p]??(a[p]={errors:[]}),c=c.properties[p]):(c.items??(c.items=[]),(s=c.items)[p]??(s[p]={errors:[]}),c=c.items[p]),g&&c.errors.push(t(u)),m++}}};return r(e),i}function hu(e){let t=[],i=e.map(r=>typeof r=="object"?r.key:r);for(let r of i)typeof r=="number"?t.push(`[${r}]`):typeof r=="symbol"?t.push(`[${JSON.stringify(String(r))}]`):/[^\w$]/.test(r)?t.push(`[${JSON.stringify(r)}]`):(t.length&&t.push("."),t.push(r));return t.join("")}function gu(e){let t=[],i=[...e.issues].sort((r,n)=>(r.path??[]).length-(n.path??[]).length);for(let r of i)t.push(`✖ ${r.message}`),r.path?.length&&t.push(` → at ${hu(r.path)}`);return t.join(`
839
- `)}var Et=e=>(t,i,r,n)=>{let o=r?Object.assign(r,{async:!1}):{async:!1},a=t._zod.run({value:i,issues:[]},o);if(a instanceof Promise)throw new Je;if(a.issues.length){let s=new(n?.Err??e)(a.issues.map(u=>_e(u,o,re())));throw fr(s,n?.callee),s}return a.value},Pi=Et(pe),Dt=e=>async(t,i,r,n)=>{let o=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:i,issues:[]},o);if(a instanceof Promise&&(a=await a),a.issues.length){let s=new(n?.Err??e)(a.issues.map(u=>_e(u,o,re())));throw fr(s,n?.callee),s}return a.value},ji=Dt(pe),Rt=e=>(t,i,r)=>{let n=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:i,issues:[]},n);if(o instanceof Promise)throw new Je;return o.issues.length?{success:!1,error:new(e??pr)(o.issues.map(a=>_e(a,n,re())))}:{success:!0,data:o.value}},_u=Rt(pe),At=e=>async(t,i,r)=>{let n=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:i,issues:[]},n);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(a=>_e(a,n,re())))}:{success:!0,data:o.value}},$u=At(pe),gr=e=>(t,i,r)=>{let n=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Et(e)(t,i,n)},Yb=gr(pe),_r=e=>(t,i,r)=>Et(e)(t,i,r),Qb=_r(pe),$r=e=>async(t,i,r)=>{let n=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Dt(e)(t,i,n)},ey=$r(pe),br=e=>async(t,i,r)=>Dt(e)(t,i,r),ty=br(pe),yr=e=>(t,i,r)=>{let n=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Rt(e)(t,i,n)},ny=yr(pe),kr=e=>(t,i,r)=>Rt(e)(t,i,r),iy=kr(pe),wr=e=>async(t,i,r)=>{let n=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return At(e)(t,i,n)},ry=wr(pe),Sr=e=>async(t,i,r)=>At(e)(t,i,r),oy=Sr(pe),We={};xe(We,{xid:()=>wu,uuid7:()=>ly,uuid6:()=>uy,uuid4:()=>sy,uuid:()=>ot,uppercase:()=>Ku,unicodeEmail:()=>Zu,undefined:()=>Wu,ulid:()=>ku,time:()=>Mu,string:()=>Fu,sha512_hex:()=>Ty,sha512_base64url:()=>Ny,sha512_base64:()=>Uy,sha384_hex:()=>xy,sha384_base64url:()=>Zy,sha384_base64:()=>Oy,sha256_hex:()=>Sy,sha256_base64url:()=>zy,sha256_base64:()=>Iy,sha1_hex:()=>yy,sha1_base64url:()=>wy,sha1_base64:()=>ky,rfc5322Email:()=>dy,number:()=>zr,null:()=>Vu,nanoid:()=>Iu,md5_hex:()=>_y,md5_base64url:()=>by,md5_base64:()=>$y,mac:()=>Pu,lowercase:()=>Gu,ksuid:()=>Su,ipv6:()=>Nu,ipv4:()=>Uu,integer:()=>Bu,idnEmail:()=>my,html5Email:()=>cy,hostname:()=>vy,hex:()=>gy,guid:()=>xu,extendedDuration:()=>ay,emoji:()=>Tu,email:()=>Ou,e164:()=>Ru,duration:()=>zu,domain:()=>hy,datetime:()=>Ju,date:()=>Cu,cuid2:()=>yu,cuid:()=>bu,cidrv6:()=>Eu,cidrv4:()=>ju,browserEmail:()=>fy,boolean:()=>Hu,bigint:()=>qu,base64url:()=>Ir,base64:()=>Du});var bu=/^[cC][^\s-]{8,}$/,yu=/^[0-9a-z]+$/,ku=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,wu=/^[0-9a-vA-V]{20}$/,Su=/^[A-Za-z0-9]{27}$/,Iu=/^[a-zA-Z0-9_-]{21}$/,zu=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ay=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,xu=/^([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})$/,ot=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)$/,sy=ot(4),uy=ot(6),ly=ot(7),Ou=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,cy=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,dy=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Zu=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,my=Zu,fy=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,py="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Tu(){return new RegExp(py,"u")}var Uu=/^(?:(?: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])$/,Nu=/^(([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}|:))$/,Pu=e=>{let t=ze(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},ju=/^((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])$/,Eu=/^(([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])$/,Du=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ir=/^[A-Za-z0-9_-]*$/,vy=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,hy=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Ru=/^\+[1-9]\d{6,14}$/,Au="(?:(?:\\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])))",Cu=new RegExp(`^${Au}$`);function Lu(e){return typeof e.precision=="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${e.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function Mu(e){return new RegExp(`^${Lu(e)}$`)}function Ju(e){let t=Lu({precision:e.precision}),i=["Z"];e.local&&i.push(""),e.offset&&i.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${t}(?:${i.join("|")})`;return new RegExp(`^${Au}T(?:${r})$`)}var Fu=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},qu=/^-?\d+n?$/,Bu=/^-?\d+$/,zr=/^-?\d+(?:\.\d+)?$/,Hu=/^(?:true|false)$/i,Vu=/^null$/i,Wu=/^undefined$/i,Gu=/^[^A-Z]*$/,Ku=/^[^a-z]*$/,gy=/^[0-9a-fA-F]*$/;function Ct(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Lt(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var _y=/^[0-9a-fA-F]{32}$/,$y=Ct(22,"=="),by=Lt(22),yy=/^[0-9a-fA-F]{40}$/,ky=Ct(27,"="),wy=Lt(27),Sy=/^[0-9a-fA-F]{64}$/,Iy=Ct(43,"="),zy=Lt(43),xy=/^[0-9a-fA-F]{96}$/,Oy=Ct(64,""),Zy=Lt(64),Ty=/^[0-9a-fA-F]{128}$/,Uy=Ct(86,"=="),Ny=Lt(86),V=f("$ZodCheck",(e,t)=>{var i;e._zod??(e._zod={}),e._zod.def=t,(i=e._zod).onattach??(i.onattach=[])}),Xu={number:"number",bigint:"bigint",object:"date"},xr=f("$ZodCheckLessThan",(e,t)=>{V.init(e,t);let i=Xu[typeof t.value];e._zod.onattach.push(r=>{let n=r._zod.bag,o=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<o&&(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:i,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Or=f("$ZodCheckGreaterThan",(e,t)=>{V.init(e,t);let i=Xu[typeof t.value];e._zod.onattach.push(r=>{let n=r._zod.bag,o=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>o&&(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:i,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Yu=f("$ZodCheckMultipleOf",(e,t)=>{V.init(e,t),e._zod.onattach.push(i=>{var r;(r=i._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=i=>{if(typeof i.value!=typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");(typeof i.value=="bigint"?i.value%t.value===BigInt(0):ru(i.value,t.value)===0)||i.issues.push({origin:typeof i.value,code:"not_multiple_of",divisor:t.value,input:i.value,inst:e,continue:!t.abort})}}),Qu=f("$ZodCheckNumberFormat",(e,t)=>{V.init(e,t),t.format=t.format||"float64";let i=t.format?.includes("int"),r=i?"int":"number",[n,o]=cu[t.format];e._zod.onattach.push(a=>{let s=a._zod.bag;s.format=t.format,s.minimum=n,s.maximum=o,i&&(s.pattern=Bu)}),e._zod.check=a=>{let s=a.value;if(i){if(!Number.isInteger(s)){a.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,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}):a.issues.push({input:s,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});return}}s<n&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),s>o&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),el=f("$ZodCheckBigIntFormat",(e,t)=>{V.init(e,t);let[i,r]=du[t.format];e._zod.onattach.push(n=>{let o=n._zod.bag;o.format=t.format,o.minimum=i,o.maximum=r}),e._zod.check=n=>{let o=n.value;o<i&&n.issues.push({origin:"bigint",input:o,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),o>r&&n.issues.push({origin:"bigint",input:o,code:"too_big",maximum:r,inclusive:!0,inst:e,continue:!t.abort})}}),tl=f("$ZodCheckMaxSize",(e,t)=>{var i;V.init(e,t),(i=e._zod.def).when??(i.when=r=>{let n=r.value;return!Ve(n)&&n.size!==void 0}),e._zod.onattach.push(r=>{let n=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let n=r.value;n.size<=t.maximum||r.issues.push({origin:Dn(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),nl=f("$ZodCheckMinSize",(e,t)=>{var i;V.init(e,t),(i=e._zod.def).when??(i.when=r=>{let n=r.value;return!Ve(n)&&n.size!==void 0}),e._zod.onattach.push(r=>{let n=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let n=r.value;n.size>=t.minimum||r.issues.push({origin:Dn(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),il=f("$ZodCheckSizeEquals",(e,t)=>{var i;V.init(e,t),(i=e._zod.def).when??(i.when=r=>{let n=r.value;return!Ve(n)&&n.size!==void 0}),e._zod.onattach.push(r=>{let n=r._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=r=>{let n=r.value,o=n.size;if(o===t.size)return;let a=o>t.size;r.issues.push({origin:Dn(n),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),rl=f("$ZodCheckMaxLength",(e,t)=>{var i;V.init(e,t),(i=e._zod.def).when??(i.when=r=>{let n=r.value;return!Ve(n)&&n.length!==void 0}),e._zod.onattach.push(r=>{let n=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let n=r.value;if(n.length<=t.maximum)return;let o=Rn(n);r.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),ol=f("$ZodCheckMinLength",(e,t)=>{var i;V.init(e,t),(i=e._zod.def).when??(i.when=r=>{let n=r.value;return!Ve(n)&&n.length!==void 0}),e._zod.onattach.push(r=>{let n=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let n=r.value;if(n.length>=t.minimum)return;let o=Rn(n);r.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),al=f("$ZodCheckLengthEquals",(e,t)=>{var i;V.init(e,t),(i=e._zod.def).when??(i.when=r=>{let n=r.value;return!Ve(n)&&n.length!==void 0}),e._zod.onattach.push(r=>{let n=r._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=r=>{let n=r.value,o=n.length;if(o===t.length)return;let a=Rn(n),s=o>t.length;r.issues.push({origin:a,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Mt=f("$ZodCheckStringFormat",(e,t)=>{var i,r;V.init(e,t),e._zod.onattach.push(n=>{let o=n._zod.bag;o.format=t.format,t.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(t.pattern))}),t.pattern?(i=e._zod).check??(i.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=()=>{})}),sl=f("$ZodCheckRegex",(e,t)=>{Mt.init(e,t),e._zod.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:"regex",input:i.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),ul=f("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Gu),Mt.init(e,t)}),ll=f("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Ku),Mt.init(e,t)}),cl=f("$ZodCheckIncludes",(e,t)=>{V.init(e,t);let i=ze(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${i}`:i);t.pattern=r,e._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.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})}}),dl=f("$ZodCheckStartsWith",(e,t)=>{V.init(e,t);let i=new RegExp(`^${ze(t.prefix)}.*`);t.pattern??(t.pattern=i),e._zod.onattach.push(r=>{let n=r._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(i)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),ml=f("$ZodCheckEndsWith",(e,t)=>{V.init(e,t);let i=new RegExp(`.*${ze(t.suffix)}$`);t.pattern??(t.pattern=i),e._zod.onattach.push(r=>{let n=r._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(i)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}});function Pa(e,t,i){e.issues.length&&t.issues.push(...we(i,e.issues))}var fl=f("$ZodCheckProperty",(e,t)=>{V.init(e,t),e._zod.check=i=>{let r=t.schema._zod.run({value:i.value[t.property],issues:[]},{});if(r instanceof Promise)return r.then(n=>Pa(n,i,t.property));Pa(r,i,t.property)}}),pl=f("$ZodCheckMimeType",(e,t)=>{V.init(e,t);let i=new Set(t.mime);e._zod.onattach.push(r=>{r._zod.bag.mime=t.mime}),e._zod.check=r=>{i.has(r.value.type)||r.issues.push({code:"invalid_value",values:t.mime,input:r.value.type,inst:e,continue:!t.abort})}}),vl=f("$ZodCheckOverwrite",(e,t)=>{V.init(e,t),e._zod.check=i=>{i.value=t.tx(i.value)}});class hl{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let i=t.split(`
840
- `).filter(o=>o),r=Math.min(...i.map(o=>o.length-o.trimStart().length)),n=i.map(o=>o.slice(r)).map(o=>" ".repeat(this.indent*2)+o);for(let o of n)this.content.push(o)}compile(){let t=Function,i=this?.args,r=[...(this?.content??[""]).map(n=>` ${n}`)];return new t(...i,r.join(`
841
- `))}}var gl={major:4,minor:3,patch:5},x=f("$ZodType",(e,t)=>{var i;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=gl;let r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(let n of r)for(let o of n._zod.onattach)o(e);if(r.length===0)(i=e._zod).deferred??(i.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let n=(a,s,u)=>{let l=Me(a),c;for(let m of s){if(m._zod.def.when){if(!m._zod.def.when(a))continue}else if(l)continue;let p=a.issues.length,g=m._zod.check(a);if(g instanceof Promise&&u?.async===!1)throw new Je;if(c||g instanceof Promise)c=(c??Promise.resolve()).then(async()=>{await g,a.issues.length!==p&&(l||(l=Me(a,p)))});else{if(a.issues.length===p)continue;l||(l=Me(a,p))}}return c?c.then(()=>a):a},o=(a,s,u)=>{if(Me(a))return a.aborted=!0,a;let l=n(s,r,u);if(l instanceof Promise){if(u.async===!1)throw new Je;return l.then(c=>e._zod.parse(c,u))}return e._zod.parse(l,u)};e._zod.run=(a,s)=>{if(s.skipChecks)return e._zod.parse(a,s);if(s.direction==="backward"){let l=e._zod.parse({value:a.value,issues:[]},{...s,skipChecks:!0});return l instanceof Promise?l.then(c=>o(c,a,s)):o(l,a,s)}let u=e._zod.parse(a,s);if(u instanceof Promise){if(s.async===!1)throw new Je;return u.then(l=>n(l,r,s))}return n(u,r,s)}}Z(e,"~standard",()=>({validate:n=>{try{let o=_u(e,n);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return $u(e,n).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),Jt=f("$ZodString",(e,t)=>{x.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Fu(e._zod.bag),e._zod.parse=(i,r)=>{if(t.coerce)try{i.value=String(i.value)}catch{}return typeof i.value=="string"||i.issues.push({expected:"string",code:"invalid_type",input:i.value,inst:e}),i}}),M=f("$ZodStringFormat",(e,t)=>{Mt.init(e,t),Jt.init(e,t)}),_l=f("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=xu),M.init(e,t)}),$l=f("$ZodUUID",(e,t)=>{if(t.version){let i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(i===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=ot(i))}else t.pattern??(t.pattern=ot());M.init(e,t)}),bl=f("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Ou),M.init(e,t)}),yl=f("$ZodURL",(e,t)=>{M.init(e,t),e._zod.check=i=>{try{let r=i.value.trim(),n=new URL(r);t.hostname&&(t.hostname.lastIndex=0,!t.hostname.test(n.hostname)&&i.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:i.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,!t.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)&&i.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:i.value,inst:e,continue:!t.abort})),t.normalize?i.value=n.href:i.value=r;return}catch{i.issues.push({code:"invalid_format",format:"url",input:i.value,inst:e,continue:!t.abort})}}}),kl=f("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Tu()),M.init(e,t)}),wl=f("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Iu),M.init(e,t)}),Sl=f("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=bu),M.init(e,t)}),Il=f("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=yu),M.init(e,t)}),zl=f("$ZodULID",(e,t)=>{t.pattern??(t.pattern=ku),M.init(e,t)}),xl=f("$ZodXID",(e,t)=>{t.pattern??(t.pattern=wu),M.init(e,t)}),Ol=f("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Su),M.init(e,t)}),Zl=f("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Ju(t)),M.init(e,t)}),Tl=f("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Cu),M.init(e,t)}),Ul=f("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Mu(t)),M.init(e,t)}),Nl=f("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=zu),M.init(e,t)}),Pl=f("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Uu),M.init(e,t),e._zod.bag.format="ipv4"}),jl=f("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Nu),M.init(e,t),e._zod.bag.format="ipv6",e._zod.check=i=>{try{new URL(`http://[${i.value}]`)}catch{i.issues.push({code:"invalid_format",format:"ipv6",input:i.value,inst:e,continue:!t.abort})}}}),El=f("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=Pu(t.delimiter)),M.init(e,t),e._zod.bag.format="mac"}),Dl=f("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=ju),M.init(e,t)}),Rl=f("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Eu),M.init(e,t),e._zod.check=i=>{let r=i.value.split("/");try{if(r.length!==2)throw Error();let[n,o]=r;if(!o)throw Error();let a=Number(o);if(`${a}`!==o||a<0||a>128)throw Error();new URL(`http://[${n}]`)}catch{i.issues.push({code:"invalid_format",format:"cidrv6",input:i.value,inst:e,continue:!t.abort})}}});function Zr(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var Al=f("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Du),M.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=i=>{Zr(i.value)||i.issues.push({code:"invalid_format",format:"base64",input:i.value,inst:e,continue:!t.abort})}});function Cl(e){if(!Ir.test(e))return!1;let t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),i=t.padEnd(Math.ceil(t.length/4)*4,"=");return Zr(i)}var Ll=f("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Ir),M.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=i=>{Cl(i.value)||i.issues.push({code:"invalid_format",format:"base64url",input:i.value,inst:e,continue:!t.abort})}}),Ml=f("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Ru),M.init(e,t)});function Jl(e,t=null){try{let i=e.split(".");if(i.length!==3)return!1;let[r]=i;if(!r)return!1;let n=JSON.parse(atob(r));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}var Fl=f("$ZodJWT",(e,t)=>{M.init(e,t),e._zod.check=i=>{Jl(i.value,t.alg)||i.issues.push({code:"invalid_format",format:"jwt",input:i.value,inst:e,continue:!t.abort})}}),ql=f("$ZodCustomStringFormat",(e,t)=>{M.init(e,t),e._zod.check=i=>{t.fn(i.value)||i.issues.push({code:"invalid_format",format:t.format,input:i.value,inst:e,continue:!t.abort})}}),Tr=f("$ZodNumber",(e,t)=>{x.init(e,t),e._zod.pattern=e._zod.bag.pattern??zr,e._zod.parse=(i,r)=>{if(t.coerce)try{i.value=Number(i.value)}catch{}let n=i.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return i;let o=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return i.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...o?{received:o}:{}}),i}}),Bl=f("$ZodNumberFormat",(e,t)=>{Qu.init(e,t),Tr.init(e,t)}),Ur=f("$ZodBoolean",(e,t)=>{x.init(e,t),e._zod.pattern=Hu,e._zod.parse=(i,r)=>{if(t.coerce)try{i.value=!!i.value}catch{}let n=i.value;return typeof n=="boolean"||i.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),i}}),Nr=f("$ZodBigInt",(e,t)=>{x.init(e,t),e._zod.pattern=qu,e._zod.parse=(i,r)=>{if(t.coerce)try{i.value=BigInt(i.value)}catch{}return typeof i.value=="bigint"||i.issues.push({expected:"bigint",code:"invalid_type",input:i.value,inst:e}),i}}),Hl=f("$ZodBigIntFormat",(e,t)=>{el.init(e,t),Nr.init(e,t)}),Vl=f("$ZodSymbol",(e,t)=>{x.init(e,t),e._zod.parse=(i,r)=>{let n=i.value;return typeof n=="symbol"||i.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:e}),i}}),Wl=f("$ZodUndefined",(e,t)=>{x.init(e,t),e._zod.pattern=Wu,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(i,r)=>{let n=i.value;return typeof n>"u"||i.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:e}),i}}),Gl=f("$ZodNull",(e,t)=>{x.init(e,t),e._zod.pattern=Vu,e._zod.values=new Set([null]),e._zod.parse=(i,r)=>{let n=i.value;return n===null||i.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),i}}),Kl=f("$ZodAny",(e,t)=>{x.init(e,t),e._zod.parse=i=>i}),Xl=f("$ZodUnknown",(e,t)=>{x.init(e,t),e._zod.parse=i=>i}),Yl=f("$ZodNever",(e,t)=>{x.init(e,t),e._zod.parse=(i,r)=>(i.issues.push({expected:"never",code:"invalid_type",input:i.value,inst:e}),i)}),Ql=f("$ZodVoid",(e,t)=>{x.init(e,t),e._zod.parse=(i,r)=>{let n=i.value;return typeof n>"u"||i.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),i}}),ec=f("$ZodDate",(e,t)=>{x.init(e,t),e._zod.parse=(i,r)=>{if(t.coerce)try{i.value=new Date(i.value)}catch{}let n=i.value,o=n instanceof Date;return o&&!Number.isNaN(n.getTime())||i.issues.push({expected:"date",code:"invalid_type",input:n,...o?{received:"Invalid Date"}:{},inst:e}),i}});function ja(e,t,i){e.issues.length&&t.issues.push(...we(i,e.issues)),t.value[i]=e.value}var tc=f("$ZodArray",(e,t)=>{x.init(e,t),e._zod.parse=(i,r)=>{let n=i.value;if(!Array.isArray(n))return i.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),i;i.value=Array(n.length);let o=[];for(let a=0;a<n.length;a++){let s=n[a],u=t.element._zod.run({value:s,issues:[]},r);u instanceof Promise?o.push(u.then(l=>ja(l,i,a))):ja(u,i,a)}return o.length?Promise.all(o).then(()=>i):i}});function yn(e,t,i,r,n){if(e.issues.length){if(n&&!(i in r))return;t.issues.push(...we(i,e.issues))}e.value===void 0?i in r&&(t.value[i]=void 0):t.value[i]=e.value}function nc(e){let t=Object.keys(e.shape);for(let r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${r}": expected a Zod schema`);let i=lu(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(i)}}function ic(e,t,i,r,n,o){let a=[],s=n.keySet,u=n.catchall._zod,l=u.def.type,c=u.optout==="optional";for(let m in t){if(s.has(m))continue;if(l==="never"){a.push(m);continue}let p=u.run({value:t[m],issues:[]},r);p instanceof Promise?e.push(p.then(g=>yn(g,i,m,t,c))):yn(p,i,m,t,c)}return a.length&&i.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:o}),e.length?Promise.all(e).then(()=>i):i}var rc=f("$ZodObject",(e,t)=>{if(x.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let a=t.shape;Object.defineProperty(t,"shape",{get:()=>{let s={...a};return Object.defineProperty(t,"shape",{value:s}),s}})}let i=jt(()=>nc(t));Z(e._zod,"propValues",()=>{let a=t.shape,s={};for(let u in a){let l=a[u]._zod;if(l.values){s[u]??(s[u]=new Set);for(let c of l.values)s[u].add(c)}}return s});let r=rt,n=t.catchall,o;e._zod.parse=(a,s)=>{o??(o=i.value);let u=a.value;if(!r(u))return a.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),a;a.value={};let l=[],c=o.shape;for(let m of o.keys){let p=c[m],g=p._zod.optout==="optional",w=p._zod.run({value:u[m],issues:[]},s);w instanceof Promise?l.push(w.then(D=>yn(D,a,m,u,g))):yn(w,a,m,u,g)}return n?ic(l,u,a,s,i.value,e):l.length?Promise.all(l).then(()=>a):a}}),oc=f("$ZodObjectJIT",(e,t)=>{rc.init(e,t);let i=e._zod.parse,r=jt(()=>nc(t)),n=m=>{let p=new hl(["shape","payload","ctx"]),g=r.value,w=R=>{let T=Ni(R);return`shape[${T}]._zod.run({ value: input[${T}], issues: [] }, ctx)`};p.write("const input = payload.value;");let D=Object.create(null),Se=0;for(let R of g.keys)D[R]=`key_${Se++}`;p.write("const newResult = {};");for(let R of g.keys){let T=D[R],j=Ni(R),ce=m[R]?._zod?.optout==="optional";p.write(`const ${T} = ${w(R)};`),ce?p.write(`
842
- if (${T}.issues.length) {
843
- if (${j} in input) {
844
- payload.issues = payload.issues.concat(${T}.issues.map(iss => ({
845
- ...iss,
846
- path: iss.path ? [${j}, ...iss.path] : [${j}]
847
- })));
848
- }
849
- }
850
-
851
- if (${T}.value === undefined) {
852
- if (${j} in input) {
853
- newResult[${j}] = undefined;
1121
+ if (${z}.value === undefined) {
1122
+ if (${A} in input) {
1123
+ newResult[${A}] = undefined;
854
1124
  }
855
1125
  } else {
856
- newResult[${j}] = ${T}.value;
1126
+ newResult[${A}] = ${z}.value;
857
1127
  }
858
1128
 
859
- `):p.write(`
860
- if (${T}.issues.length) {
861
- payload.issues = payload.issues.concat(${T}.issues.map(iss => ({
1129
+ `):h.write(`
1130
+ const ${z}_present = ${A} in input;
1131
+ if (${z}.issues.length) {
1132
+ payload.issues = payload.issues.concat(${z}.issues.map(iss => ({
862
1133
  ...iss,
863
- path: iss.path ? [${j}, ...iss.path] : [${j}]
1134
+ path: iss.path ? [${A}, ...iss.path] : [${A}]
864
1135
  })));
865
1136
  }
866
-
867
- if (${T}.value === undefined) {
868
- if (${j} in input) {
869
- newResult[${j}] = undefined;
1137
+ if (!${z}_present && !${z}.issues.length) {
1138
+ payload.issues.push({
1139
+ code: "invalid_type",
1140
+ expected: "nonoptional",
1141
+ input: undefined,
1142
+ path: [${A}]
1143
+ });
1144
+ }
1145
+
1146
+ if (${z}_present) {
1147
+ if (${z}.value === undefined) {
1148
+ newResult[${A}] = undefined;
1149
+ } else {
1150
+ newResult[${A}] = ${z}.value;
870
1151
  }
871
- } else {
872
- newResult[${j}] = ${T}.value;
873
1152
  }
874
-
875
- `)}p.write("payload.value = newResult;"),p.write("return payload;");let Ke=p.compile();return(R,T)=>Ke(m,R,T)},o,a=rt,s=!gn.jitless,u=s&&au.value,l=t.catchall,c;e._zod.parse=(m,p)=>{c??(c=r.value);let g=m.value;return a(g)?s&&u&&p?.async===!1&&p.jitless!==!0?(o||(o=n(t.shape)),m=o(m,p),l?ic([],g,m,p,c,e):m):i(m,p):(m.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),m)}});function Ea(e,t,i,r){for(let o of e)if(o.issues.length===0)return t.value=o.value,t;let n=e.filter(o=>!Me(o));return n.length===1?(t.value=n[0].value,n[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:i,errors:e.map(o=>o.issues.map(a=>_e(a,r,re())))}),t)}var An=f("$ZodUnion",(e,t)=>{x.init(e,t),Z(e._zod,"optin",()=>t.options.some(n=>n._zod.optin==="optional")?"optional":void 0),Z(e._zod,"optout",()=>t.options.some(n=>n._zod.optout==="optional")?"optional":void 0),Z(e._zod,"values",()=>{if(t.options.every(n=>n._zod.values))return new Set(t.options.flatMap(n=>Array.from(n._zod.values)))}),Z(e._zod,"pattern",()=>{if(t.options.every(n=>n._zod.pattern)){let n=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${n.map(o=>En(o.source)).join("|")})$`)}});let i=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(n,o)=>{if(i)return r(n,o);let a=!1,s=[];for(let u of t.options){let l=u._zod.run({value:n.value,issues:[]},o);if(l instanceof Promise)s.push(l),a=!0;else{if(l.issues.length===0)return l;s.push(l)}}return a?Promise.all(s).then(u=>Ea(u,n,e,o)):Ea(s,n,e,o)}});function Da(e,t,i,r){let n=e.filter(o=>o.issues.length===0);return n.length===1?(t.value=n[0].value,t):(n.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:i,errors:e.map(o=>o.issues.map(a=>_e(a,r,re())))}):t.issues.push({code:"invalid_union",input:t.value,inst:i,errors:[],inclusive:!1}),t)}var ac=f("$ZodXor",(e,t)=>{An.init(e,t),t.inclusive=!1;let i=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(n,o)=>{if(i)return r(n,o);let a=!1,s=[];for(let u of t.options){let l=u._zod.run({value:n.value,issues:[]},o);l instanceof Promise?(s.push(l),a=!0):s.push(l)}return a?Promise.all(s).then(u=>Da(u,n,e,o)):Da(s,n,e,o)}}),sc=f("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,An.init(e,t);let i=e._zod.parse;Z(e._zod,"propValues",()=>{let n={};for(let o of t.options){let a=o._zod.propValues;if(!a||Object.keys(a).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(let[s,u]of Object.entries(a)){n[s]||(n[s]=new Set);for(let l of u)n[s].add(l)}}return n});let r=jt(()=>{let n=t.options,o=new Map;for(let a of n){let s=a._zod.propValues?.[t.discriminator];if(!s||s.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(let u of s){if(o.has(u))throw Error(`Duplicate discriminator value "${String(u)}"`);o.set(u,a)}}return o});e._zod.parse=(n,o)=>{let a=n.value;if(!rt(a))return n.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),n;let s=r.value.get(a?.[t.discriminator]);return s?s._zod.run(n,o):t.unionFallback?i(n,o):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:a,path:[t.discriminator],inst:e}),n)}}),uc=f("$ZodIntersection",(e,t)=>{x.init(e,t),e._zod.parse=(i,r)=>{let n=i.value,o=t.left._zod.run({value:n,issues:[]},r),a=t.right._zod.run({value:n,issues:[]},r);return o instanceof Promise||a instanceof Promise?Promise.all([o,a]).then(([s,u])=>Ra(i,s,u)):Ra(i,o,a)}});function Ei(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(Fe(e)&&Fe(t)){let i=Object.keys(t),r=Object.keys(e).filter(o=>i.indexOf(o)!==-1),n={...e,...t};for(let o of r){let a=Ei(e[o],t[o]);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};n[o]=a.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let i=[];for(let r=0;r<e.length;r++){let n=e[r],o=t[r],a=Ei(n,o);if(!a.valid)return{valid:!1,mergeErrorPath:[r,...a.mergeErrorPath]};i.push(a.data)}return{valid:!0,data:i}}return{valid:!1,mergeErrorPath:[]}}function Ra(e,t,i){let r=new Map,n;for(let s of t.issues)if(s.code==="unrecognized_keys"){n??(n=s);for(let u of s.keys)r.has(u)||r.set(u,{}),r.get(u).l=!0}else e.issues.push(s);for(let s of i.issues)if(s.code==="unrecognized_keys")for(let u of s.keys)r.has(u)||r.set(u,{}),r.get(u).r=!0;else e.issues.push(s);let o=[...r].filter(([,s])=>s.l&&s.r).map(([s])=>s);if(o.length&&n&&e.issues.push({...n,keys:o}),Me(e))return e;let a=Ei(t.value,i.value);if(!a.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}var Pr=f("$ZodTuple",(e,t)=>{x.init(e,t);let i=t.items;e._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({input:o,inst:e,expected:"tuple",code:"invalid_type"}),r;r.value=[];let a=[],s=[...i].reverse().findIndex(c=>c._zod.optin!=="optional"),u=s===-1?0:i.length-s;if(!t.rest){let c=o.length>i.length,m=o.length<u-1;if(c||m)return r.issues.push({...c?{code:"too_big",maximum:i.length,inclusive:!0}:{code:"too_small",minimum:i.length},input:o,inst:e,origin:"array"}),r}let l=-1;for(let c of i){if(l++,l>=o.length&&l>=u)continue;let m=c._zod.run({value:o[l],issues:[]},n);m instanceof Promise?a.push(m.then(p=>un(p,r,l))):un(m,r,l)}if(t.rest){let c=o.slice(i.length);for(let m of c){l++;let p=t.rest._zod.run({value:m,issues:[]},n);p instanceof Promise?a.push(p.then(g=>un(g,r,l))):un(p,r,l)}}return a.length?Promise.all(a).then(()=>r):r}});function un(e,t,i){e.issues.length&&t.issues.push(...we(i,e.issues)),t.value[i]=e.value}var lc=f("$ZodRecord",(e,t)=>{x.init(e,t),e._zod.parse=(i,r)=>{let n=i.value;if(!Fe(n))return i.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),i;let o=[],a=t.keyType._zod.values;if(a){i.value={};let s=new Set;for(let l of a)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){s.add(typeof l=="number"?l.toString():l);let c=t.valueType._zod.run({value:n[l],issues:[]},r);c instanceof Promise?o.push(c.then(m=>{m.issues.length&&i.issues.push(...we(l,m.issues)),i.value[l]=m.value})):(c.issues.length&&i.issues.push(...we(l,c.issues)),i.value[l]=c.value)}let u;for(let l in n)s.has(l)||(u=u??[],u.push(l));u&&u.length>0&&i.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:u})}else{i.value={};for(let s of Reflect.ownKeys(n)){if(s==="__proto__")continue;let u=t.keyType._zod.run({value:s,issues:[]},r);if(u instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof s=="string"&&zr.test(s)&&u.issues.length&&u.issues.some(c=>c.code==="invalid_type"&&c.expected==="number")){let c=t.keyType._zod.run({value:Number(s),issues:[]},r);if(c instanceof Promise)throw Error("Async schemas not supported in object keys currently");c.issues.length===0&&(u=c)}if(u.issues.length){t.mode==="loose"?i.value[s]=n[s]:i.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(c=>_e(c,r,re())),input:s,path:[s],inst:e});continue}let l=t.valueType._zod.run({value:n[s],issues:[]},r);l instanceof Promise?o.push(l.then(c=>{c.issues.length&&i.issues.push(...we(s,c.issues)),i.value[u.value]=c.value})):(l.issues.length&&i.issues.push(...we(s,l.issues)),i.value[u.value]=l.value)}}return o.length?Promise.all(o).then(()=>i):i}}),cc=f("$ZodMap",(e,t)=>{x.init(e,t),e._zod.parse=(i,r)=>{let n=i.value;if(!(n instanceof Map))return i.issues.push({expected:"map",code:"invalid_type",input:n,inst:e}),i;let o=[];i.value=new Map;for(let[a,s]of n){let u=t.keyType._zod.run({value:a,issues:[]},r),l=t.valueType._zod.run({value:s,issues:[]},r);u instanceof Promise||l instanceof Promise?o.push(Promise.all([u,l]).then(([c,m])=>{Aa(c,m,i,a,n,e,r)})):Aa(u,l,i,a,n,e,r)}return o.length?Promise.all(o).then(()=>i):i}});function Aa(e,t,i,r,n,o,a){e.issues.length&&($n.has(typeof r)?i.issues.push(...we(r,e.issues)):i.issues.push({code:"invalid_key",origin:"map",input:n,inst:o,issues:e.issues.map(s=>_e(s,a,re()))})),t.issues.length&&($n.has(typeof r)?i.issues.push(...we(r,t.issues)):i.issues.push({origin:"map",code:"invalid_element",input:n,inst:o,key:r,issues:t.issues.map(s=>_e(s,a,re()))})),i.value.set(e.value,t.value)}var dc=f("$ZodSet",(e,t)=>{x.init(e,t),e._zod.parse=(i,r)=>{let n=i.value;if(!(n instanceof Set))return i.issues.push({input:n,inst:e,expected:"set",code:"invalid_type"}),i;let o=[];i.value=new Set;for(let a of n){let s=t.valueType._zod.run({value:a,issues:[]},r);s instanceof Promise?o.push(s.then(u=>Ca(u,i))):Ca(s,i)}return o.length?Promise.all(o).then(()=>i):i}});function Ca(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}var mc=f("$ZodEnum",(e,t)=>{x.init(e,t);let i=mr(t.entries),r=new Set(i);e._zod.values=r,e._zod.pattern=new RegExp(`^(${i.filter(n=>$n.has(typeof n)).map(n=>typeof n=="string"?ze(n):n.toString()).join("|")})$`),e._zod.parse=(n,o)=>{let a=n.value;return r.has(a)||n.issues.push({code:"invalid_value",values:i,input:a,inst:e}),n}}),fc=f("$ZodLiteral",(e,t)=>{if(x.init(e,t),t.values.length===0)throw Error("Cannot create literal schema with no valid values");let i=new Set(t.values);e._zod.values=i,e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?ze(r):r?ze(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,n)=>{let o=r.value;return i.has(o)||r.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),r}}),pc=f("$ZodFile",(e,t)=>{x.init(e,t),e._zod.parse=(i,r)=>{let n=i.value;return n instanceof File||i.issues.push({expected:"file",code:"invalid_type",input:n,inst:e}),i}}),vc=f("$ZodTransform",(e,t)=>{x.init(e,t),e._zod.parse=(i,r)=>{if(r.direction==="backward")throw new jn(e.constructor.name);let n=t.transform(i.value,i);if(r.async)return(n instanceof Promise?n:Promise.resolve(n)).then(o=>(i.value=o,i));if(n instanceof Promise)throw new Je;return i.value=n,i}});function La(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}var jr=f("$ZodOptional",(e,t)=>{x.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Z(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Z(e._zod,"pattern",()=>{let i=t.innerType._zod.pattern;return i?new RegExp(`^(${En(i.source)})?$`):void 0}),e._zod.parse=(i,r)=>{if(t.innerType._zod.optin==="optional"){let n=t.innerType._zod.run(i,r);return n instanceof Promise?n.then(o=>La(o,i.value)):La(n,i.value)}return i.value===void 0?i:t.innerType._zod.run(i,r)}}),hc=f("$ZodExactOptional",(e,t)=>{jr.init(e,t),Z(e._zod,"values",()=>t.innerType._zod.values),Z(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(i,r)=>t.innerType._zod.run(i,r)}),gc=f("$ZodNullable",(e,t)=>{x.init(e,t),Z(e._zod,"optin",()=>t.innerType._zod.optin),Z(e._zod,"optout",()=>t.innerType._zod.optout),Z(e._zod,"pattern",()=>{let i=t.innerType._zod.pattern;return i?new RegExp(`^(${En(i.source)}|null)$`):void 0}),Z(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(i,r)=>i.value===null?i:t.innerType._zod.run(i,r)}),_c=f("$ZodDefault",(e,t)=>{x.init(e,t),e._zod.optin="optional",Z(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(i,r)=>{if(r.direction==="backward")return t.innerType._zod.run(i,r);if(i.value===void 0)return i.value=t.defaultValue,i;let n=t.innerType._zod.run(i,r);return n instanceof Promise?n.then(o=>Ma(o,t)):Ma(n,t)}});function Ma(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var $c=f("$ZodPrefault",(e,t)=>{x.init(e,t),e._zod.optin="optional",Z(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(i,r)=>(r.direction==="backward"||i.value===void 0&&(i.value=t.defaultValue),t.innerType._zod.run(i,r))}),bc=f("$ZodNonOptional",(e,t)=>{x.init(e,t),Z(e._zod,"values",()=>{let i=t.innerType._zod.values;return i?new Set([...i].filter(r=>r!==void 0)):void 0}),e._zod.parse=(i,r)=>{let n=t.innerType._zod.run(i,r);return n instanceof Promise?n.then(o=>Ja(o,e)):Ja(n,e)}});function Ja(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}var yc=f("$ZodSuccess",(e,t)=>{x.init(e,t),e._zod.parse=(i,r)=>{if(r.direction==="backward")throw new jn("ZodSuccess");let n=t.innerType._zod.run(i,r);return n instanceof Promise?n.then(o=>(i.value=o.issues.length===0,i)):(i.value=n.issues.length===0,i)}}),kc=f("$ZodCatch",(e,t)=>{x.init(e,t),Z(e._zod,"optin",()=>t.innerType._zod.optin),Z(e._zod,"optout",()=>t.innerType._zod.optout),Z(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(i,r)=>{if(r.direction==="backward")return t.innerType._zod.run(i,r);let n=t.innerType._zod.run(i,r);return n instanceof Promise?n.then(o=>(i.value=o.value,o.issues.length&&(i.value=t.catchValue({...i,error:{issues:o.issues.map(a=>_e(a,r,re()))},input:i.value}),i.issues=[]),i)):(i.value=n.value,n.issues.length&&(i.value=t.catchValue({...i,error:{issues:n.issues.map(o=>_e(o,r,re()))},input:i.value}),i.issues=[]),i)}}),wc=f("$ZodNaN",(e,t)=>{x.init(e,t),e._zod.parse=(i,r)=>((typeof i.value!="number"||!Number.isNaN(i.value))&&i.issues.push({input:i.value,inst:e,expected:"nan",code:"invalid_type"}),i)}),Sc=f("$ZodPipe",(e,t)=>{x.init(e,t),Z(e._zod,"values",()=>t.in._zod.values),Z(e._zod,"optin",()=>t.in._zod.optin),Z(e._zod,"optout",()=>t.out._zod.optout),Z(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(i,r)=>{if(r.direction==="backward"){let o=t.out._zod.run(i,r);return o instanceof Promise?o.then(a=>ln(a,t.in,r)):ln(o,t.in,r)}let n=t.in._zod.run(i,r);return n instanceof Promise?n.then(o=>ln(o,t.out,r)):ln(n,t.out,r)}});function ln(e,t,i){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},i)}var Er=f("$ZodCodec",(e,t)=>{x.init(e,t),Z(e._zod,"values",()=>t.in._zod.values),Z(e._zod,"optin",()=>t.in._zod.optin),Z(e._zod,"optout",()=>t.out._zod.optout),Z(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(i,r)=>{if((r.direction||"forward")==="forward"){let n=t.in._zod.run(i,r);return n instanceof Promise?n.then(o=>cn(o,t,r)):cn(n,t,r)}else{let n=t.out._zod.run(i,r);return n instanceof Promise?n.then(o=>cn(o,t,r)):cn(n,t,r)}}});function cn(e,t,i){if(e.issues.length)return e.aborted=!0,e;if((i.direction||"forward")==="forward"){let r=t.transform(e.value,e);return r instanceof Promise?r.then(n=>dn(e,n,t.out,i)):dn(e,r,t.out,i)}else{let r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(n=>dn(e,n,t.in,i)):dn(e,r,t.in,i)}}function dn(e,t,i,r){return e.issues.length?(e.aborted=!0,e):i._zod.run({value:t,issues:e.issues},r)}var Ic=f("$ZodReadonly",(e,t)=>{x.init(e,t),Z(e._zod,"propValues",()=>t.innerType._zod.propValues),Z(e._zod,"values",()=>t.innerType._zod.values),Z(e._zod,"optin",()=>t.innerType?._zod?.optin),Z(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(i,r)=>{if(r.direction==="backward")return t.innerType._zod.run(i,r);let n=t.innerType._zod.run(i,r);return n instanceof Promise?n.then(Fa):Fa(n)}});function Fa(e){return e.value=Object.freeze(e.value),e}var zc=f("$ZodTemplateLiteral",(e,t)=>{x.init(e,t);let i=[];for(let r of t.parts)if(typeof r=="object"&&r!==null){if(!r._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...r._zod.traits].shift()}`);let n=r._zod.pattern instanceof RegExp?r._zod.pattern.source:r._zod.pattern;if(!n)throw Error(`Invalid template literal part: ${r._zod.traits}`);let o=n.startsWith("^")?1:0,a=n.endsWith("$")?n.length-1:n.length;i.push(n.slice(o,a))}else if(r===null||uu.has(typeof r))i.push(ze(`${r}`));else throw Error(`Invalid template literal part: ${r}`);e._zod.pattern=new RegExp(`^${i.join("")}$`),e._zod.parse=(r,n)=>typeof r.value!="string"?(r.issues.push({input:r.value,inst:e,expected:"string",code:"invalid_type"}),r):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(r.value)||r.issues.push({input:r.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),r)}),xc=f("$ZodFunction",(e,t)=>(x.init(e,t),e._def=t,e._zod.def=t,e.implement=i=>{if(typeof i!="function")throw Error("implement() must be called with a function");return function(...r){let n=e._def.input?Pi(e._def.input,r):r,o=Reflect.apply(i,this,n);return e._def.output?Pi(e._def.output,o):o}},e.implementAsync=i=>{if(typeof i!="function")throw Error("implementAsync() must be called with a function");return async function(...r){let n=e._def.input?await ji(e._def.input,r):r,o=await Reflect.apply(i,this,n);return e._def.output?await ji(e._def.output,o):o}},e._zod.parse=(i,r)=>typeof i.value!="function"?(i.issues.push({code:"invalid_type",expected:"function",input:i.value,inst:e}),i):(e._def.output&&e._def.output._zod.def.type==="promise"?i.value=e.implementAsync(i.value):i.value=e.implement(i.value),i),e.input=(...i)=>{let r=e.constructor;return Array.isArray(i[0])?new r({type:"function",input:new Pr({type:"tuple",items:i[0],rest:i[1]}),output:e._def.output}):new r({type:"function",input:i[0],output:e._def.output})},e.output=i=>new e.constructor({type:"function",input:e._def.input,output:i}),e)),Oc=f("$ZodPromise",(e,t)=>{x.init(e,t),e._zod.parse=(i,r)=>Promise.resolve(i.value).then(n=>t.innerType._zod.run({value:n,issues:[]},r))}),Zc=f("$ZodLazy",(e,t)=>{x.init(e,t),Z(e._zod,"innerType",()=>t.getter()),Z(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),Z(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),Z(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),Z(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(i,r)=>e._zod.innerType._zod.run(i,r)}),Tc=f("$ZodCustom",(e,t)=>{V.init(e,t),x.init(e,t),e._zod.parse=(i,r)=>i,e._zod.check=i=>{let r=i.value,n=t.fn(r);if(n instanceof Promise)return n.then(o=>qa(o,i,r,e));qa(n,i,r,e)}});function qa(e,t,i,r){if(!e){let n={code:"custom",input:i,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(n.params=r._zod.def.params),t.issues.push(bn(n))}}var Dr={};xe(Dr,{zhTW:()=>vw,zhCN:()=>fw,yo:()=>gw,vi:()=>dw,uz:()=>lw,ur:()=>sw,uk:()=>Pc,ua:()=>ow,tr:()=>iw,th:()=>tw,ta:()=>Qk,sv:()=>Xk,sl:()=>Gk,ru:()=>Vk,pt:()=>Bk,ps:()=>Mk,pl:()=>Fk,ota:()=>Ck,no:()=>Rk,nl:()=>Ek,ms:()=>Pk,mk:()=>Uk,lt:()=>Zk,ko:()=>xk,km:()=>Nc,kh:()=>Ik,ka:()=>wk,ja:()=>yk,it:()=>$k,is:()=>gk,id:()=>vk,hy:()=>fk,hu:()=>dk,he:()=>lk,frCA:()=>sk,fr:()=>ok,fi:()=>ik,fa:()=>tk,es:()=>Qy,eo:()=>Xy,en:()=>Uc,de:()=>Wy,da:()=>Hy,cs:()=>qy,ca:()=>Jy,bg:()=>Ly,be:()=>Ay,az:()=>Dy,ar:()=>jy});var Py=()=>{let e={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function t(n){return e[n]??null}let i={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,a=z(n.input),s=r[a]??a;return/^[A-Z]/.test(n.expected)?`مدخلات غير مقبولة: يفترض إدخال instanceof ${n.expected}، ولكن تم إدخال ${s}`:`مدخلات غير مقبولة: يفترض إدخال ${o}، ولكن تم إدخال ${s}`}case"invalid_value":return n.values.length===1?`مدخلات غير مقبولة: يفترض إدخال ${I(n.values[0])}`:`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?` أكبر من اللازم: يفترض أن تكون ${n.origin??"القيمة"} ${o} ${n.maximum.toString()} ${a.unit??"عنصر"}`:`أكبر من اللازم: يفترض أن تكون ${n.origin??"القيمة"} ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`أصغر من اللازم: يفترض لـ ${n.origin} أن يكون ${o} ${n.minimum.toString()} ${a.unit}`:`أصغر من اللازم: يفترض لـ ${n.origin} أن يكون ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`نَص غير مقبول: يجب أن يبدأ بـ "${n.prefix}"`:o.format==="ends_with"?`نَص غير مقبول: يجب أن ينتهي بـ "${o.suffix}"`:o.format==="includes"?`نَص غير مقبول: يجب أن يتضمَّن "${o.includes}"`:o.format==="regex"?`نَص غير مقبول: يجب أن يطابق النمط ${o.pattern}`:`${i[o.format]??n.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${n.divisor}`;case"unrecognized_keys":return`معرف${n.keys.length>1?"ات":""} غريب${n.keys.length>1?"ة":""}: ${_(n.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${n.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${n.origin}`;default:return"مدخل غير مقبول"}}};function jy(){return{localeError:Py()}}var Ey=()=>{let e={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function t(n){return e[n]??null}let i={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,a=z(n.input),s=r[a]??a;return/^[A-Z]/.test(n.expected)?`Yanlış dəyər: gözlənilən instanceof ${n.expected}, daxil olan ${s}`:`Yanlış dəyər: gözlənilən ${o}, daxil olan ${s}`}case"invalid_value":return n.values.length===1?`Yanlış dəyər: gözlənilən ${I(n.values[0])}`:`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Çox böyük: gözlənilən ${n.origin??"dəyər"} ${o}${n.maximum.toString()} ${a.unit??"element"}`:`Çox böyük: gözlənilən ${n.origin??"dəyər"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Çox kiçik: gözlənilən ${n.origin} ${o}${n.minimum.toString()} ${a.unit}`:`Çox kiçik: gözlənilən ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Yanlış mətn: "${o.prefix}" ilə başlamalıdır`:o.format==="ends_with"?`Yanlış mətn: "${o.suffix}" ilə bitməlidir`:o.format==="includes"?`Yanlış mətn: "${o.includes}" daxil olmalıdır`:o.format==="regex"?`Yanlış mətn: ${o.pattern} şablonuna uyğun olmalıdır`:`Yanlış ${i[o.format]??n.format}`}case"not_multiple_of":return`Yanlış ədəd: ${n.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${n.keys.length>1?"lar":""}: ${_(n.keys,", ")}`;case"invalid_key":return`${n.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${n.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function Dy(){return{localeError:Ey()}}function Ba(e,t,i,r){let n=Math.abs(e),o=n%10,a=n%100;return a>=11&&a<=19?r:o===1?t:o>=2&&o<=4?i:r}var Ry=()=>{let e={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function t(n){return e[n]??null}let i={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"},r={nan:"NaN",number:"лік",array:"масіў"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,a=z(n.input),s=r[a]??a;return/^[A-Z]/.test(n.expected)?`Няправільны ўвод: чакаўся instanceof ${n.expected}, атрымана ${s}`:`Няправільны ўвод: чакаўся ${o}, атрымана ${s}`}case"invalid_value":return n.values.length===1?`Няправільны ўвод: чакалася ${I(n.values[0])}`:`Няправільны варыянт: чакаўся адзін з ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),u=Ba(s,a.unit.one,a.unit.few,a.unit.many);return`Занадта вялікі: чакалася, што ${n.origin??"значэнне"} павінна ${a.verb} ${o}${n.maximum.toString()} ${u}`}return`Занадта вялікі: чакалася, што ${n.origin??"значэнне"} павінна быць ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);if(a){let s=Number(n.minimum),u=Ba(s,a.unit.one,a.unit.few,a.unit.many);return`Занадта малы: чакалася, што ${n.origin} павінна ${a.verb} ${o}${n.minimum.toString()} ${u}`}return`Занадта малы: чакалася, што ${n.origin} павінна быць ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Няправільны радок: павінен пачынацца з "${o.prefix}"`:o.format==="ends_with"?`Няправільны радок: павінен заканчвацца на "${o.suffix}"`:o.format==="includes"?`Няправільны радок: павінен змяшчаць "${o.includes}"`:o.format==="regex"?`Няправільны радок: павінен адпавядаць шаблону ${o.pattern}`:`Няправільны ${i[o.format]??n.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${n.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${n.keys.length>1?"ключы":"ключ"}: ${_(n.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${n.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${n.origin}`;default:return"Няправільны ўвод"}}};function Ay(){return{localeError:Ry()}}var Cy=()=>{let e={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"}};function t(n){return e[n]??null}let i={regex:"вход",email:"имейл адрес",url:"URL",emoji:"емоджи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO време",date:"ISO дата",time:"ISO време",duration:"ISO продължителност",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"base64-кодиран низ",base64url:"base64url-кодиран низ",json_string:"JSON низ",e164:"E.164 номер",jwt:"JWT",template_literal:"вход"},r={nan:"NaN",number:"число",array:"масив"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,a=z(n.input),s=r[a]??a;return/^[A-Z]/.test(n.expected)?`Невалиден вход: очакван instanceof ${n.expected}, получен ${s}`:`Невалиден вход: очакван ${o}, получен ${s}`}case"invalid_value":return n.values.length===1?`Невалиден вход: очакван ${I(n.values[0])}`:`Невалидна опция: очаквано едно от ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Твърде голямо: очаква се ${n.origin??"стойност"} да съдържа ${o}${n.maximum.toString()} ${a.unit??"елемента"}`:`Твърде голямо: очаква се ${n.origin??"стойност"} да бъде ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Твърде малко: очаква се ${n.origin} да съдържа ${o}${n.minimum.toString()} ${a.unit}`:`Твърде малко: очаква се ${n.origin} да бъде ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Невалиден низ: трябва да започва с "${o.prefix}"`;if(o.format==="ends_with")return`Невалиден низ: трябва да завършва с "${o.suffix}"`;if(o.format==="includes")return`Невалиден низ: трябва да включва "${o.includes}"`;if(o.format==="regex")return`Невалиден низ: трябва да съвпада с ${o.pattern}`;let a="Невалиден";return o.format==="emoji"&&(a="Невалидно"),o.format==="datetime"&&(a="Невалидно"),o.format==="date"&&(a="Невалидна"),o.format==="time"&&(a="Невалидно"),o.format==="duration"&&(a="Невалидна"),`${a} ${i[o.format]??n.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${n.divisor}`;case"unrecognized_keys":return`Неразпознат${n.keys.length>1?"и":""} ключ${n.keys.length>1?"ове":""}: ${_(n.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${n.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${n.origin}`;default:return"Невалиден вход"}}};function Ly(){return{localeError:Cy()}}var My=()=>{let e={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(n){return e[n]??null}let i={regex:"entrada",email:"adreça electrònica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adreça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,a=z(n.input),s=r[a]??a;return/^[A-Z]/.test(n.expected)?`Tipus invàlid: s'esperava instanceof ${n.expected}, s'ha rebut ${s}`:`Tipus invàlid: s'esperava ${o}, s'ha rebut ${s}`}case"invalid_value":return n.values.length===1?`Valor invàlid: s'esperava ${I(n.values[0])}`:`Opció invàlida: s'esperava una de ${_(n.values," o ")}`;case"too_big":{let o=n.inclusive?"com a màxim":"menys de",a=t(n.origin);return a?`Massa gran: s'esperava que ${n.origin??"el valor"} contingués ${o} ${n.maximum.toString()} ${a.unit??"elements"}`:`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"com a mínim":"més de",a=t(n.origin);return a?`Massa petit: s'esperava que ${n.origin} contingués ${o} ${n.minimum.toString()} ${a.unit}`:`Massa petit: s'esperava que ${n.origin} fos ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Format invàlid: ha de començar amb "${o.prefix}"`:o.format==="ends_with"?`Format invàlid: ha d'acabar amb "${o.suffix}"`:o.format==="includes"?`Format invàlid: ha d'incloure "${o.includes}"`:o.format==="regex"?`Format invàlid: ha de coincidir amb el patró ${o.pattern}`:`Format invàlid per a ${i[o.format]??n.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${n.divisor}`;case"unrecognized_keys":return`Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${_(n.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${n.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${n.origin}`;default:return"Entrada invàlida"}}};function Jy(){return{localeError:My()}}var Fy=()=>{let e={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}};function t(n){return e[n]??null}let i={regex:"regulární výraz",email:"e-mailová adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"},r={nan:"NaN",number:"číslo",string:"řetězec",function:"funkce",array:"pole"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,a=z(n.input),s=r[a]??a;return/^[A-Z]/.test(n.expected)?`Neplatný vstup: očekáváno instanceof ${n.expected}, obdrženo ${s}`:`Neplatný vstup: očekáváno ${o}, obdrženo ${s}`}case"invalid_value":return n.values.length===1?`Neplatný vstup: očekáváno ${I(n.values[0])}`:`Neplatná možnost: očekávána jedna z hodnot ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Hodnota je příliš velká: ${n.origin??"hodnota"} musí mít ${o}${n.maximum.toString()} ${a.unit??"prvků"}`:`Hodnota je příliš velká: ${n.origin??"hodnota"} musí být ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Hodnota je příliš malá: ${n.origin??"hodnota"} musí mít ${o}${n.minimum.toString()} ${a.unit??"prvků"}`:`Hodnota je příliš malá: ${n.origin??"hodnota"} musí být ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Neplatný řetězec: musí začínat na "${o.prefix}"`:o.format==="ends_with"?`Neplatný řetězec: musí končit na "${o.suffix}"`:o.format==="includes"?`Neplatný řetězec: musí obsahovat "${o.includes}"`:o.format==="regex"?`Neplatný řetězec: musí odpovídat vzoru ${o.pattern}`:`Neplatný formát ${i[o.format]??n.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${n.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${_(n.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${n.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${n.origin}`;default:return"Neplatný vstup"}}};function qy(){return{localeError:Fy()}}var By=()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function t(n){return e[n]??null}let i={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslæt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},r={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,a=z(n.input),s=r[a]??a;return/^[A-Z]/.test(n.expected)?`Ugyldigt input: forventede instanceof ${n.expected}, fik ${s}`:`Ugyldigt input: forventede ${o}, fik ${s}`}case"invalid_value":return n.values.length===1?`Ugyldig værdi: forventede ${I(n.values[0])}`:`Ugyldigt valg: forventede en af følgende ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin),s=r[n.origin]??n.origin;return a?`For stor: forventede ${s??"value"} ${a.verb} ${o} ${n.maximum.toString()} ${a.unit??"elementer"}`:`For stor: forventede ${s??"value"} havde ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin),s=r[n.origin]??n.origin;return a?`For lille: forventede ${s} ${a.verb} ${o} ${n.minimum.toString()} ${a.unit}`:`For lille: forventede ${s} havde ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ugyldig streng: skal starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: skal ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: skal indeholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: skal matche mønsteret ${o.pattern}`:`Ugyldig ${i[o.format]??n.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${_(n.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${n.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${n.origin}`;default:return"Ugyldigt input"}}};function Hy(){return{localeError:By()}}var Vy=()=>{let e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function t(n){return e[n]??null}let i={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},r={nan:"NaN",number:"Zahl",array:"Array"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,a=z(n.input),s=r[a]??a;return/^[A-Z]/.test(n.expected)?`Ungültige Eingabe: erwartet instanceof ${n.expected}, erhalten ${s}`:`Ungültige Eingabe: erwartet ${o}, erhalten ${s}`}case"invalid_value":return n.values.length===1?`Ungültige Eingabe: erwartet ${I(n.values[0])}`:`Ungültige Option: erwartet eine von ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Zu groß: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ${a.unit??"Elemente"} hat`:`Zu groß: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ist`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ${a.unit} hat`:`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ist`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ungültiger String: muss mit "${o.prefix}" beginnen`:o.format==="ends_with"?`Ungültiger String: muss mit "${o.suffix}" enden`:o.format==="includes"?`Ungültiger String: muss "${o.includes}" enthalten`:o.format==="regex"?`Ungültiger String: muss dem Muster ${o.pattern} entsprechen`:`Ungültig: ${i[o.format]??n.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case"unrecognized_keys":return`${n.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${_(n.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${n.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${n.origin}`;default:return"Ungültige Eingabe"}}};function Wy(){return{localeError:Vy()}}var Gy=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(n){return e[n]??null}let i={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,a=z(n.input),s=r[a]??a;return`Invalid input: expected ${o}, received ${s}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${I(n.values[0])}`:`Invalid option: expected one of ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Too big: expected ${n.origin??"value"} to have ${o}${n.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Too small: expected ${n.origin} to have ${o}${n.minimum.toString()} ${a.unit}`:`Too small: expected ${n.origin} to be ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${i[o.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${_(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}};function Uc(){return{localeError:Gy()}}var Ky=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(n){return e[n]??null}let i={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-daŭro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},r={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,a=z(n.input),s=r[a]??a;return/^[A-Z]/.test(n.expected)?`Nevalida enigo: atendiĝis instanceof ${n.expected}, riceviĝis ${s}`:`Nevalida enigo: atendiĝis ${o}, riceviĝis ${s}`}case"invalid_value":return n.values.length===1?`Nevalida enigo: atendiĝis ${I(n.values[0])}`:`Nevalida opcio: atendiĝis unu el ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Tro granda: atendiĝis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()} ${a.unit??"elementojn"}`:`Tro granda: atendiĝis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Tro malgranda: atendiĝis ke ${n.origin} havu ${o}${n.minimum.toString()} ${a.unit}`:`Tro malgranda: atendiĝis ke ${n.origin} estu ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Nevalida karaktraro: devas komenciĝi per "${o.prefix}"`:o.format==="ends_with"?`Nevalida karaktraro: devas finiĝi per "${o.suffix}"`:o.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${o.includes}"`:o.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${o.pattern}`:`Nevalida ${i[o.format]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} ŝlosilo${n.keys.length>1?"j":""}: ${_(n.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${n.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${n.origin}`;default:return"Nevalida enigo"}}};function Xy(){return{localeError:Ky()}}var Yy=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(n){return e[n]??null}let i={regex:"entrada",email:"dirección de correo electrónico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duración ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},r={nan:"NaN",string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol:"símbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacío",never:"nunca",unknown:"desconocido",any:"cualquiera"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,a=z(n.input),s=r[a]??a;return/^[A-Z]/.test(n.expected)?`Entrada inválida: se esperaba instanceof ${n.expected}, recibido ${s}`:`Entrada inválida: se esperaba ${o}, recibido ${s}`}case"invalid_value":return n.values.length===1?`Entrada inválida: se esperaba ${I(n.values[0])}`:`Opción inválida: se esperaba una de ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin),s=r[n.origin]??n.origin;return a?`Demasiado grande: se esperaba que ${s??"valor"} tuviera ${o}${n.maximum.toString()} ${a.unit??"elementos"}`:`Demasiado grande: se esperaba que ${s??"valor"} fuera ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin),s=r[n.origin]??n.origin;return a?`Demasiado pequeño: se esperaba que ${s} tuviera ${o}${n.minimum.toString()} ${a.unit}`:`Demasiado pequeño: se esperaba que ${s} fuera ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Cadena inválida: debe comenzar con "${o.prefix}"`:o.format==="ends_with"?`Cadena inválida: debe terminar en "${o.suffix}"`:o.format==="includes"?`Cadena inválida: debe incluir "${o.includes}"`:o.format==="regex"?`Cadena inválida: debe coincidir con el patrón ${o.pattern}`:`Inválido ${i[o.format]??n.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${n.divisor}`;case"unrecognized_keys":return`Llave${n.keys.length>1?"s":""} desconocida${n.keys.length>1?"s":""}: ${_(n.keys,", ")}`;case"invalid_key":return`Llave inválida en ${r[n.origin]??n.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${r[n.origin]??n.origin}`;default:return"Entrada inválida"}}};function Qy(){return{localeError:Yy()}}var ek=()=>{let e={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function t(n){return e[n]??null}let i={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"},r={nan:"NaN",number:"عدد",array:"آرایه"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,a=z(n.input),s=r[a]??a;return/^[A-Z]/.test(n.expected)?`ورودی نامعتبر: می‌بایست instanceof ${n.expected} می‌بود، ${s} دریافت شد`:`ورودی نامعتبر: می‌بایست ${o} می‌بود، ${s} دریافت شد`}case"invalid_value":return n.values.length===1?`ورودی نامعتبر: می‌بایست ${I(n.values[0])} می‌بود`:`گزینه نامعتبر: می‌بایست یکی از ${_(n.values,"|")} می‌بود`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`خیلی بزرگ: ${n.origin??"مقدار"} باید ${o}${n.maximum.toString()} ${a.unit??"عنصر"} باشد`:`خیلی بزرگ: ${n.origin??"مقدار"} باید ${o}${n.maximum.toString()} باشد`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`خیلی کوچک: ${n.origin} باید ${o}${n.minimum.toString()} ${a.unit} باشد`:`خیلی کوچک: ${n.origin} باید ${o}${n.minimum.toString()} باشد`}case"invalid_format":{let o=n;return o.format==="starts_with"?`رشته نامعتبر: باید با "${o.prefix}" شروع شود`:o.format==="ends_with"?`رشته نامعتبر: باید با "${o.suffix}" تمام شود`:o.format==="includes"?`رشته نامعتبر: باید شامل "${o.includes}" باشد`:o.format==="regex"?`رشته نامعتبر: باید با الگوی ${o.pattern} مطابقت داشته باشد`:`${i[o.format]??n.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${n.divisor} باشد`;case"unrecognized_keys":return`کلید${n.keys.length>1?"های":""} ناشناس: ${_(n.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${n.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${n.origin}`;default:return"ورودی نامعتبر"}}};function tk(){return{localeError:ek()}}var nk=()=>{let e={string:{unit:"merkkiä",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"päivämäärän"}};function t(n){return e[n]??null}let i={regex:"säännöllinen lauseke",email:"sähköpostiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-päivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,a=z(n.input),s=r[a]??a;return/^[A-Z]/.test(n.expected)?`Virheellinen tyyppi: odotettiin instanceof ${n.expected}, oli ${s}`:`Virheellinen tyyppi: odotettiin ${o}, oli ${s}`}case"invalid_value":return n.values.length===1?`Virheellinen syöte: täytyy olla ${I(n.values[0])}`:`Virheellinen valinta: täytyy olla yksi seuraavista: ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Liian suuri: ${a.subject} täytyy olla ${o}${n.maximum.toString()} ${a.unit}`.trim():`Liian suuri: arvon täytyy olla ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Liian pieni: ${a.subject} täytyy olla ${o}${n.minimum.toString()} ${a.unit}`.trim():`Liian pieni: arvon täytyy olla ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Virheellinen syöte: täytyy alkaa "${o.prefix}"`:o.format==="ends_with"?`Virheellinen syöte: täytyy loppua "${o.suffix}"`:o.format==="includes"?`Virheellinen syöte: täytyy sisältää "${o.includes}"`:o.format==="regex"?`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${o.pattern}`:`Virheellinen ${i[o.format]??n.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${n.divisor} monikerta`;case"unrecognized_keys":return`${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${_(n.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen syöte"}}};function ik(){return{localeError:nk()}}var rk=()=>{let e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function t(n){return e[n]??null}let i={regex:"entrée",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},r={nan:"NaN",number:"nombre",array:"tableau"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,a=z(n.input),s=r[a]??a;return/^[A-Z]/.test(n.expected)?`Entrée invalide : instanceof ${n.expected} attendu, ${s} reçu`:`Entrée invalide : ${o} attendu, ${s} reçu`}case"invalid_value":return n.values.length===1?`Entrée invalide : ${I(n.values[0])} attendu`:`Option invalide : une valeur parmi ${_(n.values,"|")} attendue`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Trop grand : ${n.origin??"valeur"} doit ${a.verb} ${o}${n.maximum.toString()} ${a.unit??"élément(s)"}`:`Trop grand : ${n.origin??"valeur"} doit être ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Trop petit : ${n.origin} doit ${a.verb} ${o}${n.minimum.toString()} ${a.unit}`:`Trop petit : ${n.origin} doit être ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Chaîne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Chaîne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Chaîne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Chaîne invalide : doit correspondre au modèle ${o.pattern}`:`${i[o.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${n.divisor}`;case"unrecognized_keys":return`Clé${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${_(n.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${n.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entrée invalide"}}};function ok(){return{localeError:rk()}}var ak=()=>{let e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function t(n){return e[n]??null}let i={regex:"entrée",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,a=z(n.input),s=r[a]??a;return/^[A-Z]/.test(n.expected)?`Entrée invalide : attendu instanceof ${n.expected}, reçu ${s}`:`Entrée invalide : attendu ${o}, reçu ${s}`}case"invalid_value":return n.values.length===1?`Entrée invalide : attendu ${I(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"≤":"<",a=t(n.origin);return a?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${o}${n.maximum.toString()} ${a.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"≥":">",a=t(n.origin);return a?`Trop petit : attendu que ${n.origin} ait ${o}${n.minimum.toString()} ${a.unit}`:`Trop petit : attendu que ${n.origin} soit ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Chaîne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Chaîne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Chaîne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Chaîne invalide : doit correspondre au motif ${o.pattern}`:`${i[o.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${n.divisor}`;case"unrecognized_keys":return`Clé${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${_(n.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${n.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entrée invalide"}}};function sk(){return{localeError:ak()}}var uk=()=>{let e={string:{label:"מחרוזת",gender:"f"},number:{label:"מספר",gender:"m"},boolean:{label:"ערך בוליאני",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"תאריך",gender:"m"},array:{label:"מערך",gender:"m"},object:{label:"אובייקט",gender:"m"},null:{label:"ערך ריק (null)",gender:"m"},undefined:{label:"ערך לא מוגדר (undefined)",gender:"m"},symbol:{label:"סימבול (Symbol)",gender:"m"},function:{label:"פונקציה",gender:"f"},map:{label:"מפה (Map)",gender:"f"},set:{label:"קבוצה (Set)",gender:"f"},file:{label:"קובץ",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"ערך לא ידוע",gender:"m"},value:{label:"ערך",gender:"m"}},t={string:{unit:"תווים",shortLabel:"קצר",longLabel:"ארוך"},file:{unit:"בייטים",shortLabel:"קטן",longLabel:"גדול"},array:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},set:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},number:{unit:"",shortLabel:"קטן",longLabel:"גדול"}},i=l=>l?e[l]:void 0,r=l=>{let c=i(l);return c?c.label:l??e.unknown.label},n=l=>`ה${r(l)}`,o=l=>(i(l)?.gender??"m")==="f"?"צריכה להיות":"צריך להיות",a=l=>l?t[l]??null:null,s={regex:{label:"קלט",gender:"m"},email:{label:"כתובת אימייל",gender:"f"},url:{label:"כתובת רשת",gender:"f"},emoji:{label:"אימוג'י",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"תאריך וזמן ISO",gender:"m"},date:{label:"תאריך ISO",gender:"m"},time:{label:"זמן ISO",gender:"m"},duration:{label:"משך זמן ISO",gender:"m"},ipv4:{label:"כתובת IPv4",gender:"f"},ipv6:{label:"כתובת IPv6",gender:"f"},cidrv4:{label:"טווח IPv4",gender:"m"},cidrv6:{label:"טווח IPv6",gender:"m"},base64:{label:"מחרוזת בבסיס 64",gender:"f"},base64url:{label:"מחרוזת בבסיס 64 לכתובות רשת",gender:"f"},json_string:{label:"מחרוזת JSON",gender:"f"},e164:{label:"מספר E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"קלט",gender:"m"},includes:{label:"קלט",gender:"m"},lowercase:{label:"קלט",gender:"m"},starts_with:{label:"קלט",gender:"m"},uppercase:{label:"קלט",gender:"m"}},u={nan:"NaN"};return l=>{switch(l.code){case"invalid_type":{let c=l.expected,m=u[c??""]??r(c),p=z(l.input),g=u[p]??e[p]?.label??p;return/^[A-Z]/.test(l.expected)?`קלט לא תקין: צריך להיות instanceof ${l.expected}, התקבל ${g}`:`קלט לא תקין: צריך להיות ${m}, התקבל ${g}`}case"invalid_value":{if(l.values.length===1)return`ערך לא תקין: הערך חייב להיות ${I(l.values[0])}`;let c=l.values.map(p=>I(p));if(l.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${c[0]} או ${c[1]}`;let m=c[c.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${c.slice(0,-1).join(", ")} או ${m}`}case"too_big":{let c=a(l.origin),m=n(l.origin??"value");if(l.origin==="string")return`${c?.longLabel??"ארוך"} מדי: ${m} צריכה להכיל ${l.maximum.toString()} ${c?.unit??""} ${l.inclusive?"או פחות":"לכל היותר"}`.trim();if(l.origin==="number"){let w=l.inclusive?`קטן או שווה ל-${l.maximum}`:`קטן מ-${l.maximum}`;return`גדול מדי: ${m} צריך להיות ${w}`}if(l.origin==="array"||l.origin==="set"){let w=l.origin==="set"?"צריכה":"צריך",D=l.inclusive?`${l.maximum} ${c?.unit??""} או פחות`:`פחות מ-${l.maximum} ${c?.unit??""}`;return`גדול מדי: ${m} ${w} להכיל ${D}`.trim()}let p=l.inclusive?"<=":"<",g=o(l.origin??"value");return c?.unit?`${c.longLabel} מדי: ${m} ${g} ${p}${l.maximum.toString()} ${c.unit}`:`${c?.longLabel??"גדול"} מדי: ${m} ${g} ${p}${l.maximum.toString()}`}case"too_small":{let c=a(l.origin),m=n(l.origin??"value");if(l.origin==="string")return`${c?.shortLabel??"קצר"} מדי: ${m} צריכה להכיל ${l.minimum.toString()} ${c?.unit??""} ${l.inclusive?"או יותר":"לפחות"}`.trim();if(l.origin==="number"){let w=l.inclusive?`גדול או שווה ל-${l.minimum}`:`גדול מ-${l.minimum}`;return`קטן מדי: ${m} צריך להיות ${w}`}if(l.origin==="array"||l.origin==="set"){let w=l.origin==="set"?"צריכה":"צריך";if(l.minimum===1&&l.inclusive){let Se=(l.origin==="set","לפחות פריט אחד");return`קטן מדי: ${m} ${w} להכיל ${Se}`}let D=l.inclusive?`${l.minimum} ${c?.unit??""} או יותר`:`יותר מ-${l.minimum} ${c?.unit??""}`;return`קטן מדי: ${m} ${w} להכיל ${D}`.trim()}let p=l.inclusive?">=":">",g=o(l.origin??"value");return c?.unit?`${c.shortLabel} מדי: ${m} ${g} ${p}${l.minimum.toString()} ${c.unit}`:`${c?.shortLabel??"קטן"} מדי: ${m} ${g} ${p}${l.minimum.toString()}`}case"invalid_format":{let c=l;if(c.format==="starts_with")return`המחרוזת חייבת להתחיל ב "${c.prefix}"`;if(c.format==="ends_with")return`המחרוזת חייבת להסתיים ב "${c.suffix}"`;if(c.format==="includes")return`המחרוזת חייבת לכלול "${c.includes}"`;if(c.format==="regex")return`המחרוזת חייבת להתאים לתבנית ${c.pattern}`;let m=s[c.format],p=m?.label??c.format,g=(m?.gender??"m")==="f"?"תקינה":"תקין";return`${p} לא ${g}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${l.divisor}`;case"unrecognized_keys":return`מפתח${l.keys.length>1?"ות":""} לא מזוה${l.keys.length>1?"ים":"ה"}: ${_(l.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${n(l.origin??"array")}`;default:return"קלט לא תקין"}}};function lk(){return{localeError:uk()}}var ck=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(n){return e[n]??null}let i={regex:"bemenet",email:"email cím",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO időbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"},r={nan:"NaN",number:"szám",array:"tömb"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,a=z(n.input),s=r[a]??a;return/^[A-Z]/.test(n.expected)?`Érvénytelen bemenet: a várt érték instanceof ${n.expected}, a kapott érték ${s}`:`Érvénytelen bemenet: a várt érték ${o}, a kapott érték ${s}`}case"invalid_value":return n.values.length===1?`Érvénytelen bemenet: a várt érték ${I(n.values[0])}`:`Érvénytelen opció: valamelyik érték várt ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Túl nagy: ${n.origin??"érték"} mérete túl nagy ${o}${n.maximum.toString()} ${a.unit??"elem"}`:`Túl nagy: a bemeneti érték ${n.origin??"érték"} túl nagy: ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Túl kicsi: a bemeneti érték ${n.origin} mérete túl kicsi ${o}${n.minimum.toString()} ${a.unit}`:`Túl kicsi: a bemeneti érték ${n.origin} túl kicsi ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Érvénytelen string: "${o.prefix}" értékkel kell kezdődnie`:o.format==="ends_with"?`Érvénytelen string: "${o.suffix}" értékkel kell végződnie`:o.format==="includes"?`Érvénytelen string: "${o.includes}" értéket kell tartalmaznia`:o.format==="regex"?`Érvénytelen string: ${o.pattern} mintának kell megfelelnie`:`Érvénytelen ${i[o.format]??n.format}`}case"not_multiple_of":return`Érvénytelen szám: ${n.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${n.keys.length>1?"s":""}: ${_(n.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${n.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${n.origin}`;default:return"Érvénytelen bemenet"}}};function dk(){return{localeError:ck()}}function Ha(e,t,i){return Math.abs(e)===1?t:i}function Xe(e){if(!e)return"";let t=["ա","ե","ը","ի","ո","ու","օ"],i=e[e.length-1];return e+(t.includes(i)?"ն":"ը")}var mk=()=>{let e={string:{unit:{one:"նշան",many:"նշաններ"},verb:"ունենալ"},file:{unit:{one:"բայթ",many:"բայթեր"},verb:"ունենալ"},array:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"},set:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"}};function t(n){return e[n]??null}let i={regex:"մուտք",email:"էլ. հասցե",url:"URL",emoji:"էմոջի",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO ամսաթիվ և ժամ",date:"ISO ամսաթիվ",time:"ISO ժամ",duration:"ISO տևողություն",ipv4:"IPv4 հասցե",ipv6:"IPv6 հասցե",cidrv4:"IPv4 միջակայք",cidrv6:"IPv6 միջակայք",base64:"base64 ձևաչափով տող",base64url:"base64url ձևաչափով տող",json_string:"JSON տող",e164:"E.164 համար",jwt:"JWT",template_literal:"մուտք"},r={nan:"NaN",number:"թիվ",array:"զանգված"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,a=z(n.input),s=r[a]??a;return/^[A-Z]/.test(n.expected)?`Սխալ մուտքագրում․ սպասվում էր instanceof ${n.expected}, ստացվել է ${s}`:`Սխալ մուտքագրում․ սպասվում էր ${o}, ստացվել է ${s}`}case"invalid_value":return n.values.length===1?`Սխալ մուտքագրում․ սպասվում էր ${I(n.values[1])}`:`Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),u=Ha(s,a.unit.one,a.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${Xe(n.origin??"արժեք")} կունենա ${o}${n.maximum.toString()} ${u}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${Xe(n.origin??"արժեք")} լինի ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);if(a){let s=Number(n.minimum),u=Ha(s,a.unit.one,a.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${Xe(n.origin)} կունենա ${o}${n.minimum.toString()} ${u}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${Xe(n.origin)} լինի ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Սխալ տող․ պետք է սկսվի "${o.prefix}"-ով`:o.format==="ends_with"?`Սխալ տող․ պետք է ավարտվի "${o.suffix}"-ով`:o.format==="includes"?`Սխալ տող․ պետք է պարունակի "${o.includes}"`:o.format==="regex"?`Սխալ տող․ պետք է համապատասխանի ${o.pattern} ձևաչափին`:`Սխալ ${i[o.format]??n.format}`}case"not_multiple_of":return`Սխալ թիվ․ պետք է բազմապատիկ լինի ${n.divisor}-ի`;case"unrecognized_keys":return`Չճանաչված բանալի${n.keys.length>1?"ներ":""}. ${_(n.keys,", ")}`;case"invalid_key":return`Սխալ բանալի ${Xe(n.origin)}-ում`;case"invalid_union":return"Սխալ մուտքագրում";case"invalid_element":return`Սխալ արժեք ${Xe(n.origin)}-ում`;default:return"Սխալ մուտքագրում"}}};function fk(){return{localeError:mk()}}var pk=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(n){return e[n]??null}let i={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,a=z(n.input),s=r[a]??a;return/^[A-Z]/.test(n.expected)?`Input tidak valid: diharapkan instanceof ${n.expected}, diterima ${s}`:`Input tidak valid: diharapkan ${o}, diterima ${s}`}case"invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${I(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${o}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Terlalu kecil: diharapkan ${n.origin} memiliki ${o}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: diharapkan ${n.origin} menjadi ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`String tidak valid: harus dimulai dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak valid: harus berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak valid: harus menyertakan "${o.includes}"`:o.format==="regex"?`String tidak valid: harus sesuai pola ${o.pattern}`:`${i[o.format]??n.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${_(n.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${n.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${n.origin}`;default:return"Input tidak valid"}}};function vk(){return{localeError:pk()}}var hk=()=>{let e={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"}};function t(n){return e[n]??null}let i={regex:"gildi",email:"netfang",url:"vefslóð",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og tími",date:"ISO dagsetning",time:"ISO tími",duration:"ISO tímalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 tölugildi",jwt:"JWT",template_literal:"gildi"},r={nan:"NaN",number:"númer",array:"fylki"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,a=z(n.input),s=r[a]??a;return/^[A-Z]/.test(n.expected)?`Rangt gildi: Þú slóst inn ${s} þar sem á að vera instanceof ${n.expected}`:`Rangt gildi: Þú slóst inn ${s} þar sem á að vera ${o}`}case"invalid_value":return n.values.length===1?`Rangt gildi: gert ráð fyrir ${I(n.values[0])}`:`Ógilt val: má vera eitt af eftirfarandi ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Of stórt: gert er ráð fyrir að ${n.origin??"gildi"} hafi ${o}${n.maximum.toString()} ${a.unit??"hluti"}`:`Of stórt: gert er ráð fyrir að ${n.origin??"gildi"} sé ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Of lítið: gert er ráð fyrir að ${n.origin} hafi ${o}${n.minimum.toString()} ${a.unit}`:`Of lítið: gert er ráð fyrir að ${n.origin} sé ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ógildur strengur: verður að byrja á "${o.prefix}"`:o.format==="ends_with"?`Ógildur strengur: verður að enda á "${o.suffix}"`:o.format==="includes"?`Ógildur strengur: verður að innihalda "${o.includes}"`:o.format==="regex"?`Ógildur strengur: verður að fylgja mynstri ${o.pattern}`:`Rangt ${i[o.format]??n.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${n.divisor}`;case"unrecognized_keys":return`Óþekkt ${n.keys.length>1?"ir lyklar":"ur lykill"}: ${_(n.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${n.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${n.origin}`;default:return"Rangt gildi"}}};function gk(){return{localeError:hk()}}var _k=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(n){return e[n]??null}let i={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},r={nan:"NaN",number:"numero",array:"vettore"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,a=z(n.input),s=r[a]??a;return/^[A-Z]/.test(n.expected)?`Input non valido: atteso instanceof ${n.expected}, ricevuto ${s}`:`Input non valido: atteso ${o}, ricevuto ${s}`}case"invalid_value":return n.values.length===1?`Input non valido: atteso ${I(n.values[0])}`:`Opzione non valida: atteso uno tra ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Troppo grande: ${n.origin??"valore"} deve avere ${o}${n.maximum.toString()} ${a.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Troppo piccolo: ${n.origin} deve avere ${o}${n.minimum.toString()} ${a.unit}`:`Troppo piccolo: ${n.origin} deve essere ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Stringa non valida: deve iniziare con "${o.prefix}"`:o.format==="ends_with"?`Stringa non valida: deve terminare con "${o.suffix}"`:o.format==="includes"?`Stringa non valida: deve includere "${o.includes}"`:o.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${o.pattern}`:`Invalid ${i[o.format]??n.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${n.divisor}`;case"unrecognized_keys":return`Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${_(n.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${n.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${n.origin}`;default:return"Input non valido"}}};function $k(){return{localeError:_k()}}var bk=()=>{let e={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function t(n){return e[n]??null}let i={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"},r={nan:"NaN",number:"数値",array:"配列"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,a=z(n.input),s=r[a]??a;return/^[A-Z]/.test(n.expected)?`無効な入力: instanceof ${n.expected}が期待されましたが、${s}が入力されました`:`無効な入力: ${o}が期待されましたが、${s}が入力されました`}case"invalid_value":return n.values.length===1?`無効な入力: ${I(n.values[0])}が期待されました`:`無効な選択: ${_(n.values,"、")}のいずれかである必要があります`;case"too_big":{let o=n.inclusive?"以下である":"より小さい",a=t(n.origin);return a?`大きすぎる値: ${n.origin??"値"}は${n.maximum.toString()}${a.unit??"要素"}${o}必要があります`:`大きすぎる値: ${n.origin??"値"}は${n.maximum.toString()}${o}必要があります`}case"too_small":{let o=n.inclusive?"以上である":"より大きい",a=t(n.origin);return a?`小さすぎる値: ${n.origin}は${n.minimum.toString()}${a.unit}${o}必要があります`:`小さすぎる値: ${n.origin}は${n.minimum.toString()}${o}必要があります`}case"invalid_format":{let o=n;return o.format==="starts_with"?`無効な文字列: "${o.prefix}"で始まる必要があります`:o.format==="ends_with"?`無効な文字列: "${o.suffix}"で終わる必要があります`:o.format==="includes"?`無効な文字列: "${o.includes}"を含む必要があります`:o.format==="regex"?`無効な文字列: パターン${o.pattern}に一致する必要があります`:`無効な${i[o.format]??n.format}`}case"not_multiple_of":return`無効な数値: ${n.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${n.keys.length>1?"群":""}: ${_(n.keys,"、")}`;case"invalid_key":return`${n.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${n.origin}内の無効な値`;default:return"無効な入力"}}};function yk(){return{localeError:bk()}}var kk=()=>{let e={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function t(n){return e[n]??null}let i={regex:"შეყვანა",email:"ელ-ფოსტის მისამართი",url:"URL",emoji:"ემოჯი",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"თარიღი-დრო",date:"თარიღი",time:"დრო",duration:"ხანგრძლივობა",ipv4:"IPv4 მისამართი",ipv6:"IPv6 მისამართი",cidrv4:"IPv4 დიაპაზონი",cidrv6:"IPv6 დიაპაზონი",base64:"base64-კოდირებული სტრინგი",base64url:"base64url-კოდირებული სტრინგი",json_string:"JSON სტრინგი",e164:"E.164 ნომერი",jwt:"JWT",template_literal:"შეყვანა"},r={nan:"NaN",number:"რიცხვი",string:"სტრინგი",boolean:"ბულეანი",function:"ფუნქცია",array:"მასივი"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,a=z(n.input),s=r[a]??a;return/^[A-Z]/.test(n.expected)?`არასწორი შეყვანა: მოსალოდნელი instanceof ${n.expected}, მიღებული ${s}`:`არასწორი შეყვანა: მოსალოდნელი ${o}, მიღებული ${s}`}case"invalid_value":return n.values.length===1?`არასწორი შეყვანა: მოსალოდნელი ${I(n.values[0])}`:`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${_(n.values,"|")}-დან`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`ზედმეტად დიდი: მოსალოდნელი ${n.origin??"მნიშვნელობა"} ${a.verb} ${o}${n.maximum.toString()} ${a.unit}`:`ზედმეტად დიდი: მოსალოდნელი ${n.origin??"მნიშვნელობა"} იყოს ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`ზედმეტად პატარა: მოსალოდნელი ${n.origin} ${a.verb} ${o}${n.minimum.toString()} ${a.unit}`:`ზედმეტად პატარა: მოსალოდნელი ${n.origin} იყოს ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`არასწორი სტრინგი: უნდა იწყებოდეს "${o.prefix}"-ით`:o.format==="ends_with"?`არასწორი სტრინგი: უნდა მთავრდებოდეს "${o.suffix}"-ით`:o.format==="includes"?`არასწორი სტრინგი: უნდა შეიცავდეს "${o.includes}"-ს`:o.format==="regex"?`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${o.pattern}`:`არასწორი ${i[o.format]??n.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${n.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${n.keys.length>1?"ები":"ი"}: ${_(n.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${n.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${n.origin}-ში`;default:return"არასწორი შეყვანა"}}};function wk(){return{localeError:kk()}}var Sk=()=>{let e={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function t(n){return e[n]??null}let i={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"},r={nan:"NaN",number:"លេខ",array:"អារេ (Array)",null:"គ្មានតម្លៃ (null)"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,a=z(n.input),s=r[a]??a;return/^[A-Z]/.test(n.expected)?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${n.expected} ប៉ុន្តែទទួលបាន ${s}`:`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${o} ប៉ុន្តែទទួលបាន ${s}`}case"invalid_value":return n.values.length===1?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${I(n.values[0])}`:`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`ធំពេក៖ ត្រូវការ ${n.origin??"តម្លៃ"} ${o} ${n.maximum.toString()} ${a.unit??"ធាតុ"}`:`ធំពេក៖ ត្រូវការ ${n.origin??"តម្លៃ"} ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`តូចពេក៖ ត្រូវការ ${n.origin} ${o} ${n.minimum.toString()} ${a.unit}`:`តូចពេក៖ ត្រូវការ ${n.origin} ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${o.prefix}"`:o.format==="ends_with"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${o.suffix}"`:o.format==="includes"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${o.includes}"`:o.format==="regex"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${o.pattern}`:`មិនត្រឹមត្រូវ៖ ${i[o.format]??n.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${n.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${_(n.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${n.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${n.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function Nc(){return{localeError:Sk()}}function Ik(){return Nc()}var zk=()=>{let e={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function t(n){return e[n]??null}let i={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,a=z(n.input),s=r[a]??a;return/^[A-Z]/.test(n.expected)?`잘못된 입력: 예상 타입은 instanceof ${n.expected}, 받은 타입은 ${s}입니다`:`잘못된 입력: 예상 타입은 ${o}, 받은 타입은 ${s}입니다`}case"invalid_value":return n.values.length===1?`잘못된 입력: 값은 ${I(n.values[0])} 이어야 합니다`:`잘못된 옵션: ${_(n.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let o=n.inclusive?"이하":"미만",a=o==="미만"?"이어야 합니다":"여야 합니다",s=t(n.origin),u=s?.unit??"요소";return s?`${n.origin??"값"}이 너무 큽니다: ${n.maximum.toString()}${u} ${o}${a}`:`${n.origin??"값"}이 너무 큽니다: ${n.maximum.toString()} ${o}${a}`}case"too_small":{let o=n.inclusive?"이상":"초과",a=o==="이상"?"이어야 합니다":"여야 합니다",s=t(n.origin),u=s?.unit??"요소";return s?`${n.origin??"값"}이 너무 작습니다: ${n.minimum.toString()}${u} ${o}${a}`:`${n.origin??"값"}이 너무 작습니다: ${n.minimum.toString()} ${o}${a}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`잘못된 문자열: "${o.prefix}"(으)로 시작해야 합니다`:o.format==="ends_with"?`잘못된 문자열: "${o.suffix}"(으)로 끝나야 합니다`:o.format==="includes"?`잘못된 문자열: "${o.includes}"을(를) 포함해야 합니다`:o.format==="regex"?`잘못된 문자열: 정규식 ${o.pattern} 패턴과 일치해야 합니다`:`잘못된 ${i[o.format]??n.format}`}case"not_multiple_of":return`잘못된 숫자: ${n.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${_(n.keys,", ")}`;case"invalid_key":return`잘못된 키: ${n.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${n.origin}`;default:return"잘못된 입력"}}};function xk(){return{localeError:zk()}}var vt=e=>e.charAt(0).toUpperCase()+e.slice(1);function Va(e){let t=Math.abs(e),i=t%10,r=t%100;return r>=11&&r<=19||i===0?"many":i===1?"one":"few"}var Ok=()=>{let e={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};function t(n,o,a,s){let u=e[n]??null;return u===null?u:{unit:u.unit[o],verb:u.verb[s][a?"inclusive":"notInclusive"]}}let i={regex:"įvestis",email:"el. pašto adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukmė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",jwt:"JWT",template_literal:"įvestis"},r={nan:"NaN",number:"skaičius",bigint:"sveikasis skaičius",string:"eilutė",boolean:"loginė reikšmė",undefined:"neapibrėžta reikšmė",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulinė reikšmė"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,a=z(n.input),s=r[a]??a;return/^[A-Z]/.test(n.expected)?`Gautas tipas ${s}, o tikėtasi - instanceof ${n.expected}`:`Gautas tipas ${s}, o tikėtasi - ${o}`}case"invalid_value":return n.values.length===1?`Privalo būti ${I(n.values[0])}`:`Privalo būti vienas iš ${_(n.values,"|")} pasirinkimų`;case"too_big":{let o=r[n.origin]??n.origin,a=t(n.origin,Va(Number(n.maximum)),n.inclusive??!1,"smaller");if(a?.verb)return`${vt(o??n.origin??"reikšmė")} ${a.verb} ${n.maximum.toString()} ${a.unit??"elementų"}`;let s=n.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${vt(o??n.origin??"reikšmė")} turi būti ${s} ${n.maximum.toString()} ${a?.unit}`}case"too_small":{let o=r[n.origin]??n.origin,a=t(n.origin,Va(Number(n.minimum)),n.inclusive??!1,"bigger");if(a?.verb)return`${vt(o??n.origin??"reikšmė")} ${a.verb} ${n.minimum.toString()} ${a.unit??"elementų"}`;let s=n.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${vt(o??n.origin??"reikšmė")} turi būti ${s} ${n.minimum.toString()} ${a?.unit}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Eilutė privalo prasidėti "${o.prefix}"`:o.format==="ends_with"?`Eilutė privalo pasibaigti "${o.suffix}"`:o.format==="includes"?`Eilutė privalo įtraukti "${o.includes}"`:o.format==="regex"?`Eilutė privalo atitikti ${o.pattern}`:`Neteisingas ${i[o.format]??n.format}`}case"not_multiple_of":return`Skaičius privalo būti ${n.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${n.keys.length>1?"i":"as"} rakt${n.keys.length>1?"ai":"as"}: ${_(n.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{let o=r[n.origin]??n.origin;return`${vt(o??n.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function Zk(){return{localeError:Ok()}}var Tk=()=>{let e={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function t(n){return e[n]??null}let i={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"},r={nan:"NaN",number:"број",array:"низа"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,a=z(n.input),s=r[a]??a;return/^[A-Z]/.test(n.expected)?`Грешен внес: се очекува instanceof ${n.expected}, примено ${s}`:`Грешен внес: се очекува ${o}, примено ${s}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${I(n.values[0])}`:`Грешана опција: се очекува една ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Премногу голем: се очекува ${n.origin??"вредноста"} да има ${o}${n.maximum.toString()} ${a.unit??"елементи"}`:`Премногу голем: се очекува ${n.origin??"вредноста"} да биде ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Премногу мал: се очекува ${n.origin} да има ${o}${n.minimum.toString()} ${a.unit}`:`Премногу мал: се очекува ${n.origin} да биде ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Неважечка низа: мора да започнува со "${o.prefix}"`:o.format==="ends_with"?`Неважечка низа: мора да завршува со "${o.suffix}"`:o.format==="includes"?`Неважечка низа: мора да вклучува "${o.includes}"`:o.format==="regex"?`Неважечка низа: мора да одгоара на патернот ${o.pattern}`:`Invalid ${i[o.format]??n.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${_(n.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${n.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${n.origin}`;default:return"Грешен внес"}}};function Uk(){return{localeError:Tk()}}var Nk=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(n){return e[n]??null}let i={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},r={nan:"NaN",number:"nombor"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,a=z(n.input),s=r[a]??a;return/^[A-Z]/.test(n.expected)?`Input tidak sah: dijangka instanceof ${n.expected}, diterima ${s}`:`Input tidak sah: dijangka ${o}, diterima ${s}`}case"invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${I(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Terlalu besar: dijangka ${n.origin??"nilai"} ${a.verb} ${o}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Terlalu kecil: dijangka ${n.origin} ${a.verb} ${o}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: dijangka ${n.origin} adalah ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`String tidak sah: mesti bermula dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak sah: mesti mengandungi "${o.includes}"`:o.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${o.pattern}`:`${i[o.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${_(n.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${n.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${n.origin}`;default:return"Input tidak sah"}}};function Pk(){return{localeError:Nk()}}var jk=()=>{let e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function t(n){return e[n]??null}let i={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},r={nan:"NaN",number:"getal"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,a=z(n.input),s=r[a]??a;return/^[A-Z]/.test(n.expected)?`Ongeldige invoer: verwacht instanceof ${n.expected}, ontving ${s}`:`Ongeldige invoer: verwacht ${o}, ontving ${s}`}case"invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${I(n.values[0])}`:`Ongeldige optie: verwacht één van ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin),s=n.origin==="date"?"laat":n.origin==="string"?"lang":"groot";return a?`Te ${s}: verwacht dat ${n.origin??"waarde"} ${o}${n.maximum.toString()} ${a.unit??"elementen"} ${a.verb}`:`Te ${s}: verwacht dat ${n.origin??"waarde"} ${o}${n.maximum.toString()} is`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin),s=n.origin==="date"?"vroeg":n.origin==="string"?"kort":"klein";return a?`Te ${s}: verwacht dat ${n.origin} ${o}${n.minimum.toString()} ${a.unit} ${a.verb}`:`Te ${s}: verwacht dat ${n.origin} ${o}${n.minimum.toString()} is`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ongeldige tekst: moet met "${o.prefix}" beginnen`:o.format==="ends_with"?`Ongeldige tekst: moet op "${o.suffix}" eindigen`:o.format==="includes"?`Ongeldige tekst: moet "${o.includes}" bevatten`:o.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${o.pattern}`:`Ongeldig: ${i[o.format]??n.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${n.keys.length>1?"s":""}: ${_(n.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${n.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${n.origin}`;default:return"Ongeldige invoer"}}};function Ek(){return{localeError:jk()}}var Dk=()=>{let e={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function t(n){return e[n]??null}let i={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},r={nan:"NaN",number:"tall",array:"liste"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,a=z(n.input),s=r[a]??a;return/^[A-Z]/.test(n.expected)?`Ugyldig input: forventet instanceof ${n.expected}, fikk ${s}`:`Ugyldig input: forventet ${o}, fikk ${s}`}case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${I(n.values[0])}`:`Ugyldig valg: forventet en av ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`For stor(t): forventet ${n.origin??"value"} til å ha ${o}${n.maximum.toString()} ${a.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til å ha ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`For lite(n): forventet ${n.origin} til å ha ${o}${n.minimum.toString()} ${a.unit}`:`For lite(n): forventet ${n.origin} til å ha ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ugyldig streng: må starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: må ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: må inneholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: må matche mønsteret ${o.pattern}`:`Ugyldig ${i[o.format]??n.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${_(n.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${n.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${n.origin}`;default:return"Ugyldig input"}}};function Rk(){return{localeError:Dk()}}var Ak=()=>{let e={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}};function t(n){return e[n]??null}let i={regex:"giren",email:"epostagâh",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO hengâmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"},r={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,a=z(n.input),s=r[a]??a;return/^[A-Z]/.test(n.expected)?`Fâsit giren: umulan instanceof ${n.expected}, alınan ${s}`:`Fâsit giren: umulan ${o}, alınan ${s}`}case"invalid_value":return n.values.length===1?`Fâsit giren: umulan ${I(n.values[0])}`:`Fâsit tercih: mûteberler ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Fazla büyük: ${n.origin??"value"}, ${o}${n.maximum.toString()} ${a.unit??"elements"} sahip olmalıydı.`:`Fazla büyük: ${n.origin??"value"}, ${o}${n.maximum.toString()} olmalıydı.`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Fazla küçük: ${n.origin}, ${o}${n.minimum.toString()} ${a.unit} sahip olmalıydı.`:`Fazla küçük: ${n.origin}, ${o}${n.minimum.toString()} olmalıydı.`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Fâsit metin: "${o.prefix}" ile başlamalı.`:o.format==="ends_with"?`Fâsit metin: "${o.suffix}" ile bitmeli.`:o.format==="includes"?`Fâsit metin: "${o.includes}" ihtivâ etmeli.`:o.format==="regex"?`Fâsit metin: ${o.pattern} nakşına uymalı.`:`Fâsit ${i[o.format]??n.format}`}case"not_multiple_of":return`Fâsit sayı: ${n.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${n.keys.length>1?"s":""}: ${_(n.keys,", ")}`;case"invalid_key":return`${n.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${n.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function Ck(){return{localeError:Ak()}}var Lk=()=>{let e={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function t(n){return e[n]??null}let i={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"},r={nan:"NaN",number:"عدد",array:"ارې"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,a=z(n.input),s=r[a]??a;return/^[A-Z]/.test(n.expected)?`ناسم ورودي: باید instanceof ${n.expected} وای, مګر ${s} ترلاسه شو`:`ناسم ورودي: باید ${o} وای, مګر ${s} ترلاسه شو`}case"invalid_value":return n.values.length===1?`ناسم ورودي: باید ${I(n.values[0])} وای`:`ناسم انتخاب: باید یو له ${_(n.values,"|")} څخه وای`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`ډیر لوی: ${n.origin??"ارزښت"} باید ${o}${n.maximum.toString()} ${a.unit??"عنصرونه"} ولري`:`ډیر لوی: ${n.origin??"ارزښت"} باید ${o}${n.maximum.toString()} وي`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`ډیر کوچنی: ${n.origin} باید ${o}${n.minimum.toString()} ${a.unit} ولري`:`ډیر کوچنی: ${n.origin} باید ${o}${n.minimum.toString()} وي`}case"invalid_format":{let o=n;return o.format==="starts_with"?`ناسم متن: باید د "${o.prefix}" سره پیل شي`:o.format==="ends_with"?`ناسم متن: باید د "${o.suffix}" سره پای ته ورسيږي`:o.format==="includes"?`ناسم متن: باید "${o.includes}" ولري`:o.format==="regex"?`ناسم متن: باید د ${o.pattern} سره مطابقت ولري`:`${i[o.format]??n.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${n.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${n.keys.length>1?"کلیډونه":"کلیډ"}: ${_(n.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${n.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${n.origin} کې`;default:return"ناسمه ورودي"}}};function Mk(){return{localeError:Lk()}}var Jk=()=>{let e={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}};function t(n){return e[n]??null}let i={regex:"wyrażenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ciąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"},r={nan:"NaN",number:"liczba",array:"tablica"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,a=z(n.input),s=r[a]??a;return/^[A-Z]/.test(n.expected)?`Nieprawidłowe dane wejściowe: oczekiwano instanceof ${n.expected}, otrzymano ${s}`:`Nieprawidłowe dane wejściowe: oczekiwano ${o}, otrzymano ${s}`}case"invalid_value":return n.values.length===1?`Nieprawidłowe dane wejściowe: oczekiwano ${I(n.values[0])}`:`Nieprawidłowa opcja: oczekiwano jednej z wartości ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Za duża wartość: oczekiwano, że ${n.origin??"wartość"} będzie mieć ${o}${n.maximum.toString()} ${a.unit??"elementów"}`:`Zbyt duż(y/a/e): oczekiwano, że ${n.origin??"wartość"} będzie wynosić ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Za mała wartość: oczekiwano, że ${n.origin??"wartość"} będzie mieć ${o}${n.minimum.toString()} ${a.unit??"elementów"}`:`Zbyt mał(y/a/e): oczekiwano, że ${n.origin??"wartość"} będzie wynosić ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Nieprawidłowy ciąg znaków: musi zaczynać się od "${o.prefix}"`:o.format==="ends_with"?`Nieprawidłowy ciąg znaków: musi kończyć się na "${o.suffix}"`:o.format==="includes"?`Nieprawidłowy ciąg znaków: musi zawierać "${o.includes}"`:o.format==="regex"?`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${o.pattern}`:`Nieprawidłow(y/a/e) ${i[o.format]??n.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${n.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${n.keys.length>1?"s":""}: ${_(n.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${n.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${n.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function Fk(){return{localeError:Jk()}}var qk=()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(n){return e[n]??null}let i={regex:"padrão",email:"endereço de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"duração ISO",ipv4:"endereço IPv4",ipv6:"endereço IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},r={nan:"NaN",number:"número",null:"nulo"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,a=z(n.input),s=r[a]??a;return/^[A-Z]/.test(n.expected)?`Tipo inválido: esperado instanceof ${n.expected}, recebido ${s}`:`Tipo inválido: esperado ${o}, recebido ${s}`}case"invalid_value":return n.values.length===1?`Entrada inválida: esperado ${I(n.values[0])}`:`Opção inválida: esperada uma das ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Muito grande: esperado que ${n.origin??"valor"} tivesse ${o}${n.maximum.toString()} ${a.unit??"elementos"}`:`Muito grande: esperado que ${n.origin??"valor"} fosse ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Muito pequeno: esperado que ${n.origin} tivesse ${o}${n.minimum.toString()} ${a.unit}`:`Muito pequeno: esperado que ${n.origin} fosse ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Texto inválido: deve começar com "${o.prefix}"`:o.format==="ends_with"?`Texto inválido: deve terminar com "${o.suffix}"`:o.format==="includes"?`Texto inválido: deve incluir "${o.includes}"`:o.format==="regex"?`Texto inválido: deve corresponder ao padrão ${o.pattern}`:`${i[o.format]??n.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${n.divisor}`;case"unrecognized_keys":return`Chave${n.keys.length>1?"s":""} desconhecida${n.keys.length>1?"s":""}: ${_(n.keys,", ")}`;case"invalid_key":return`Chave inválida em ${n.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${n.origin}`;default:return"Campo inválido"}}};function Bk(){return{localeError:qk()}}function Wa(e,t,i,r){let n=Math.abs(e),o=n%10,a=n%100;return a>=11&&a<=19?r:o===1?t:o>=2&&o<=4?i:r}var Hk=()=>{let e={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function t(n){return e[n]??null}let i={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"},r={nan:"NaN",number:"число",array:"массив"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,a=z(n.input),s=r[a]??a;return/^[A-Z]/.test(n.expected)?`Неверный ввод: ожидалось instanceof ${n.expected}, получено ${s}`:`Неверный ввод: ожидалось ${o}, получено ${s}`}case"invalid_value":return n.values.length===1?`Неверный ввод: ожидалось ${I(n.values[0])}`:`Неверный вариант: ожидалось одно из ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),u=Wa(s,a.unit.one,a.unit.few,a.unit.many);return`Слишком большое значение: ожидалось, что ${n.origin??"значение"} будет иметь ${o}${n.maximum.toString()} ${u}`}return`Слишком большое значение: ожидалось, что ${n.origin??"значение"} будет ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);if(a){let s=Number(n.minimum),u=Wa(s,a.unit.one,a.unit.few,a.unit.many);return`Слишком маленькое значение: ожидалось, что ${n.origin} будет иметь ${o}${n.minimum.toString()} ${u}`}return`Слишком маленькое значение: ожидалось, что ${n.origin} будет ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Неверная строка: должна начинаться с "${o.prefix}"`:o.format==="ends_with"?`Неверная строка: должна заканчиваться на "${o.suffix}"`:o.format==="includes"?`Неверная строка: должна содержать "${o.includes}"`:o.format==="regex"?`Неверная строка: должна соответствовать шаблону ${o.pattern}`:`Неверный ${i[o.format]??n.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${n.divisor}`;case"unrecognized_keys":return`Нераспознанн${n.keys.length>1?"ые":"ый"} ключ${n.keys.length>1?"и":""}: ${_(n.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${n.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${n.origin}`;default:return"Неверные входные данные"}}};function Vk(){return{localeError:Hk()}}var Wk=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(n){return e[n]??null}let i={regex:"vnos",email:"e-poštni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in čas",date:"ISO datum",time:"ISO čas",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 številka",jwt:"JWT",template_literal:"vnos"},r={nan:"NaN",number:"število",array:"tabela"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,a=z(n.input),s=r[a]??a;return/^[A-Z]/.test(n.expected)?`Neveljaven vnos: pričakovano instanceof ${n.expected}, prejeto ${s}`:`Neveljaven vnos: pričakovano ${o}, prejeto ${s}`}case"invalid_value":return n.values.length===1?`Neveljaven vnos: pričakovano ${I(n.values[0])}`:`Neveljavna možnost: pričakovano eno izmed ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Preveliko: pričakovano, da bo ${n.origin??"vrednost"} imelo ${o}${n.maximum.toString()} ${a.unit??"elementov"}`:`Preveliko: pričakovano, da bo ${n.origin??"vrednost"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Premajhno: pričakovano, da bo ${n.origin} imelo ${o}${n.minimum.toString()} ${a.unit}`:`Premajhno: pričakovano, da bo ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Neveljaven niz: mora se začeti z "${o.prefix}"`:o.format==="ends_with"?`Neveljaven niz: mora se končati z "${o.suffix}"`:o.format==="includes"?`Neveljaven niz: mora vsebovati "${o.includes}"`:o.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${o.pattern}`:`Neveljaven ${i[o.format]??n.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${n.divisor}`;case"unrecognized_keys":return`Neprepoznan${n.keys.length>1?"i ključi":" ključ"}: ${_(n.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${n.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${n.origin}`;default:return"Neveljaven vnos"}}};function Gk(){return{localeError:Wk()}}var Kk=()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}};function t(n){return e[n]??null}let i={regex:"reguljärt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad sträng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},r={nan:"NaN",number:"antal",array:"lista"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,a=z(n.input),s=r[a]??a;return/^[A-Z]/.test(n.expected)?`Ogiltig inmatning: förväntat instanceof ${n.expected}, fick ${s}`:`Ogiltig inmatning: förväntat ${o}, fick ${s}`}case"invalid_value":return n.values.length===1?`Ogiltig inmatning: förväntat ${I(n.values[0])}`:`Ogiltigt val: förväntade en av ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`För stor(t): förväntade ${n.origin??"värdet"} att ha ${o}${n.maximum.toString()} ${a.unit??"element"}`:`För stor(t): förväntat ${n.origin??"värdet"} att ha ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`För lite(t): förväntade ${n.origin??"värdet"} att ha ${o}${n.minimum.toString()} ${a.unit}`:`För lite(t): förväntade ${n.origin??"värdet"} att ha ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ogiltig sträng: måste börja med "${o.prefix}"`:o.format==="ends_with"?`Ogiltig sträng: måste sluta med "${o.suffix}"`:o.format==="includes"?`Ogiltig sträng: måste innehålla "${o.includes}"`:o.format==="regex"?`Ogiltig sträng: måste matcha mönstret "${o.pattern}"`:`Ogiltig(t) ${i[o.format]??n.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${_(n.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${n.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${n.origin??"värdet"}`;default:return"Ogiltig input"}}};function Xk(){return{localeError:Kk()}}var Yk=()=>{let e={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function t(n){return e[n]??null}let i={regex:"உள்ளீடு",email:"மின்னஞ்சல் முகவரி",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"},r={nan:"NaN",number:"எண்",array:"அணி",null:"வெறுமை"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,a=z(n.input),s=r[a]??a;return/^[A-Z]/.test(n.expected)?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${n.expected}, பெறப்பட்டது ${s}`:`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${o}, பெறப்பட்டது ${s}`}case"invalid_value":return n.values.length===1?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${I(n.values[0])}`:`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${_(n.values,"|")} இல் ஒன்று`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${n.origin??"மதிப்பு"} ${o}${n.maximum.toString()} ${a.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`:`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${n.origin??"மதிப்பு"} ${o}${n.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${n.origin} ${o}${n.minimum.toString()} ${a.unit} ஆக இருக்க வேண்டும்`:`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${n.origin} ${o}${n.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let o=n;return o.format==="starts_with"?`தவறான சரம்: "${o.prefix}" இல் தொடங்க வேண்டும்`:o.format==="ends_with"?`தவறான சரம்: "${o.suffix}" இல் முடிவடைய வேண்டும்`:o.format==="includes"?`தவறான சரம்: "${o.includes}" ஐ உள்ளடக்க வேண்டும்`:o.format==="regex"?`தவறான சரம்: ${o.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`:`தவறான ${i[o.format]??n.format}`}case"not_multiple_of":return`தவறான எண்: ${n.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${n.keys.length>1?"கள்":""}: ${_(n.keys,", ")}`;case"invalid_key":return`${n.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${n.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function Qk(){return{localeError:Yk()}}var ew=()=>{let e={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function t(n){return e[n]??null}let i={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"},r={nan:"NaN",number:"ตัวเลข",array:"อาร์เรย์ (Array)",null:"ไม่มีค่า (null)"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,a=z(n.input),s=r[a]??a;return/^[A-Z]/.test(n.expected)?`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${n.expected} แต่ได้รับ ${s}`:`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${o} แต่ได้รับ ${s}`}case"invalid_value":return n.values.length===1?`ค่าไม่ถูกต้อง: ควรเป็น ${I(n.values[0])}`:`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"ไม่เกิน":"น้อยกว่า",a=t(n.origin);return a?`เกินกำหนด: ${n.origin??"ค่า"} ควรมี${o} ${n.maximum.toString()} ${a.unit??"รายการ"}`:`เกินกำหนด: ${n.origin??"ค่า"} ควรมี${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"อย่างน้อย":"มากกว่า",a=t(n.origin);return a?`น้อยกว่ากำหนด: ${n.origin} ควรมี${o} ${n.minimum.toString()} ${a.unit}`:`น้อยกว่ากำหนด: ${n.origin} ควรมี${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${o.prefix}"`:o.format==="ends_with"?`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${o.suffix}"`:o.format==="includes"?`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${o.includes}" อยู่ในข้อความ`:o.format==="regex"?`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${o.pattern}`:`รูปแบบไม่ถูกต้อง: ${i[o.format]??n.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${n.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${_(n.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${n.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${n.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function tw(){return{localeError:ew()}}var nw=()=>{let e={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function t(n){return e[n]??null}let i={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO süre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,a=z(n.input),s=r[a]??a;return/^[A-Z]/.test(n.expected)?`Geçersiz değer: beklenen instanceof ${n.expected}, alınan ${s}`:`Geçersiz değer: beklenen ${o}, alınan ${s}`}case"invalid_value":return n.values.length===1?`Geçersiz değer: beklenen ${I(n.values[0])}`:`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Çok büyük: beklenen ${n.origin??"değer"} ${o}${n.maximum.toString()} ${a.unit??"öğe"}`:`Çok büyük: beklenen ${n.origin??"değer"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Çok küçük: beklenen ${n.origin} ${o}${n.minimum.toString()} ${a.unit}`:`Çok küçük: beklenen ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Geçersiz metin: "${o.prefix}" ile başlamalı`:o.format==="ends_with"?`Geçersiz metin: "${o.suffix}" ile bitmeli`:o.format==="includes"?`Geçersiz metin: "${o.includes}" içermeli`:o.format==="regex"?`Geçersiz metin: ${o.pattern} desenine uymalı`:`Geçersiz ${i[o.format]??n.format}`}case"not_multiple_of":return`Geçersiz sayı: ${n.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${n.keys.length>1?"lar":""}: ${_(n.keys,", ")}`;case"invalid_key":return`${n.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${n.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function iw(){return{localeError:nw()}}var rw=()=>{let e={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function t(n){return e[n]??null}let i={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"},r={nan:"NaN",number:"число",array:"масив"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,a=z(n.input),s=r[a]??a;return/^[A-Z]/.test(n.expected)?`Неправильні вхідні дані: очікується instanceof ${n.expected}, отримано ${s}`:`Неправильні вхідні дані: очікується ${o}, отримано ${s}`}case"invalid_value":return n.values.length===1?`Неправильні вхідні дані: очікується ${I(n.values[0])}`:`Неправильна опція: очікується одне з ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Занадто велике: очікується, що ${n.origin??"значення"} ${a.verb} ${o}${n.maximum.toString()} ${a.unit??"елементів"}`:`Занадто велике: очікується, що ${n.origin??"значення"} буде ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Занадто мале: очікується, що ${n.origin} ${a.verb} ${o}${n.minimum.toString()} ${a.unit}`:`Занадто мале: очікується, що ${n.origin} буде ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Неправильний рядок: повинен починатися з "${o.prefix}"`:o.format==="ends_with"?`Неправильний рядок: повинен закінчуватися на "${o.suffix}"`:o.format==="includes"?`Неправильний рядок: повинен містити "${o.includes}"`:o.format==="regex"?`Неправильний рядок: повинен відповідати шаблону ${o.pattern}`:`Неправильний ${i[o.format]??n.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${n.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${n.keys.length>1?"і":""}: ${_(n.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${n.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${n.origin}`;default:return"Неправильні вхідні дані"}}};function Pc(){return{localeError:rw()}}function ow(){return Pc()}var aw=()=>{let e={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function t(n){return e[n]??null}let i={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"},r={nan:"NaN",number:"نمبر",array:"آرے",null:"نل"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,a=z(n.input),s=r[a]??a;return/^[A-Z]/.test(n.expected)?`غلط ان پٹ: instanceof ${n.expected} متوقع تھا، ${s} موصول ہوا`:`غلط ان پٹ: ${o} متوقع تھا، ${s} موصول ہوا`}case"invalid_value":return n.values.length===1?`غلط ان پٹ: ${I(n.values[0])} متوقع تھا`:`غلط آپشن: ${_(n.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`بہت بڑا: ${n.origin??"ویلیو"} کے ${o}${n.maximum.toString()} ${a.unit??"عناصر"} ہونے متوقع تھے`:`بہت بڑا: ${n.origin??"ویلیو"} کا ${o}${n.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`بہت چھوٹا: ${n.origin} کے ${o}${n.minimum.toString()} ${a.unit} ہونے متوقع تھے`:`بہت چھوٹا: ${n.origin} کا ${o}${n.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let o=n;return o.format==="starts_with"?`غلط سٹرنگ: "${o.prefix}" سے شروع ہونا چاہیے`:o.format==="ends_with"?`غلط سٹرنگ: "${o.suffix}" پر ختم ہونا چاہیے`:o.format==="includes"?`غلط سٹرنگ: "${o.includes}" شامل ہونا چاہیے`:o.format==="regex"?`غلط سٹرنگ: پیٹرن ${o.pattern} سے میچ ہونا چاہیے`:`غلط ${i[o.format]??n.format}`}case"not_multiple_of":return`غلط نمبر: ${n.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${n.keys.length>1?"ز":""}: ${_(n.keys,"، ")}`;case"invalid_key":return`${n.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${n.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function sw(){return{localeError:aw()}}var uw=()=>{let e={string:{unit:"belgi",verb:"bo‘lishi kerak"},file:{unit:"bayt",verb:"bo‘lishi kerak"},array:{unit:"element",verb:"bo‘lishi kerak"},set:{unit:"element",verb:"bo‘lishi kerak"}};function t(n){return e[n]??null}let i={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},r={nan:"NaN",number:"raqam",array:"massiv"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,a=z(n.input),s=r[a]??a;return/^[A-Z]/.test(n.expected)?`Noto‘g‘ri kirish: kutilgan instanceof ${n.expected}, qabul qilingan ${s}`:`Noto‘g‘ri kirish: kutilgan ${o}, qabul qilingan ${s}`}case"invalid_value":return n.values.length===1?`Noto‘g‘ri kirish: kutilgan ${I(n.values[0])}`:`Noto‘g‘ri variant: quyidagilardan biri kutilgan ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Juda katta: kutilgan ${n.origin??"qiymat"} ${o}${n.maximum.toString()} ${a.unit} ${a.verb}`:`Juda katta: kutilgan ${n.origin??"qiymat"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Juda kichik: kutilgan ${n.origin} ${o}${n.minimum.toString()} ${a.unit} ${a.verb}`:`Juda kichik: kutilgan ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Noto‘g‘ri satr: "${o.prefix}" bilan boshlanishi kerak`:o.format==="ends_with"?`Noto‘g‘ri satr: "${o.suffix}" bilan tugashi kerak`:o.format==="includes"?`Noto‘g‘ri satr: "${o.includes}" ni o‘z ichiga olishi kerak`:o.format==="regex"?`Noto‘g‘ri satr: ${o.pattern} shabloniga mos kelishi kerak`:`Noto‘g‘ri ${i[o.format]??n.format}`}case"not_multiple_of":return`Noto‘g‘ri raqam: ${n.divisor} ning karralisi bo‘lishi kerak`;case"unrecognized_keys":return`Noma’lum kalit${n.keys.length>1?"lar":""}: ${_(n.keys,", ")}`;case"invalid_key":return`${n.origin} dagi kalit noto‘g‘ri`;case"invalid_union":return"Noto‘g‘ri kirish";case"invalid_element":return`${n.origin} da noto‘g‘ri qiymat`;default:return"Noto‘g‘ri kirish"}}};function lw(){return{localeError:uw()}}var cw=()=>{let e={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}};function t(n){return e[n]??null}let i={regex:"đầu vào",email:"địa chỉ email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ngày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"},r={nan:"NaN",number:"số",array:"mảng"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,a=z(n.input),s=r[a]??a;return/^[A-Z]/.test(n.expected)?`Đầu vào không hợp lệ: mong đợi instanceof ${n.expected}, nhận được ${s}`:`Đầu vào không hợp lệ: mong đợi ${o}, nhận được ${s}`}case"invalid_value":return n.values.length===1?`Đầu vào không hợp lệ: mong đợi ${I(n.values[0])}`:`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Quá lớn: mong đợi ${n.origin??"giá trị"} ${a.verb} ${o}${n.maximum.toString()} ${a.unit??"phần tử"}`:`Quá lớn: mong đợi ${n.origin??"giá trị"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Quá nhỏ: mong đợi ${n.origin} ${a.verb} ${o}${n.minimum.toString()} ${a.unit}`:`Quá nhỏ: mong đợi ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Chuỗi không hợp lệ: phải bắt đầu bằng "${o.prefix}"`:o.format==="ends_with"?`Chuỗi không hợp lệ: phải kết thúc bằng "${o.suffix}"`:o.format==="includes"?`Chuỗi không hợp lệ: phải bao gồm "${o.includes}"`:o.format==="regex"?`Chuỗi không hợp lệ: phải khớp với mẫu ${o.pattern}`:`${i[o.format]??n.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${n.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${_(n.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${n.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${n.origin}`;default:return"Đầu vào không hợp lệ"}}};function dw(){return{localeError:cw()}}var mw=()=>{let e={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function t(n){return e[n]??null}let i={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"},r={nan:"NaN",number:"数字",array:"数组",null:"空值(null)"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,a=z(n.input),s=r[a]??a;return/^[A-Z]/.test(n.expected)?`无效输入:期望 instanceof ${n.expected},实际接收 ${s}`:`无效输入:期望 ${o},实际接收 ${s}`}case"invalid_value":return n.values.length===1?`无效输入:期望 ${I(n.values[0])}`:`无效选项:期望以下之一 ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`数值过大:期望 ${n.origin??"值"} ${o}${n.maximum.toString()} ${a.unit??"个元素"}`:`数值过大:期望 ${n.origin??"值"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`数值过小:期望 ${n.origin} ${o}${n.minimum.toString()} ${a.unit}`:`数值过小:期望 ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`无效字符串:必须以 "${o.prefix}" 开头`:o.format==="ends_with"?`无效字符串:必须以 "${o.suffix}" 结尾`:o.format==="includes"?`无效字符串:必须包含 "${o.includes}"`:o.format==="regex"?`无效字符串:必须满足正则表达式 ${o.pattern}`:`无效${i[o.format]??n.format}`}case"not_multiple_of":return`无效数字:必须是 ${n.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${_(n.keys,", ")}`;case"invalid_key":return`${n.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${n.origin} 中包含无效值(value)`;default:return"无效输入"}}};function fw(){return{localeError:mw()}}var pw=()=>{let e={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function t(n){return e[n]??null}let i={regex:"輸入",email:"郵件地址",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,a=z(n.input),s=r[a]??a;return/^[A-Z]/.test(n.expected)?`無效的輸入值:預期為 instanceof ${n.expected},但收到 ${s}`:`無效的輸入值:預期為 ${o},但收到 ${s}`}case"invalid_value":return n.values.length===1?`無效的輸入值:預期為 ${I(n.values[0])}`:`無效的選項:預期為以下其中之一 ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`數值過大:預期 ${n.origin??"值"} 應為 ${o}${n.maximum.toString()} ${a.unit??"個元素"}`:`數值過大:預期 ${n.origin??"值"} 應為 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`數值過小:預期 ${n.origin} 應為 ${o}${n.minimum.toString()} ${a.unit}`:`數值過小:預期 ${n.origin} 應為 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`無效的字串:必須以 "${o.prefix}" 開頭`:o.format==="ends_with"?`無效的字串:必須以 "${o.suffix}" 結尾`:o.format==="includes"?`無效的字串:必須包含 "${o.includes}"`:o.format==="regex"?`無效的字串:必須符合格式 ${o.pattern}`:`無效的 ${i[o.format]??n.format}`}case"not_multiple_of":return`無效的數字:必須為 ${n.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${n.keys.length>1?"們":""}:${_(n.keys,"、")}`;case"invalid_key":return`${n.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${n.origin} 中有無效的值`;default:return"無效的輸入值"}}};function vw(){return{localeError:pw()}}var hw=()=>{let e={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function t(n){return e[n]??null}let i={regex:"ẹ̀rọ ìbáwọlé",email:"àdírẹ́sì ìmẹ́lì",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"àkókò ISO",date:"ọjọ́ ISO",time:"àkókò ISO",duration:"àkókò tó pé ISO",ipv4:"àdírẹ́sì IPv4",ipv6:"àdírẹ́sì IPv6",cidrv4:"àgbègbè IPv4",cidrv6:"àgbègbè IPv6",base64:"ọ̀rọ̀ tí a kọ́ ní base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mbà E.164",jwt:"JWT",template_literal:"ẹ̀rọ ìbáwọlé"},r={nan:"NaN",number:"nọ́mbà",array:"akopọ"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,a=z(n.input),s=r[a]??a;return/^[A-Z]/.test(n.expected)?`Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${n.expected}, àmọ̀ a rí ${s}`:`Ìbáwọlé aṣìṣe: a ní láti fi ${o}, àmọ̀ a rí ${s}`}case"invalid_value":return n.values.length===1?`Ìbáwọlé aṣìṣe: a ní láti fi ${I(n.values[0])}`:`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Tó pọ̀ jù: a ní láti jẹ́ pé ${n.origin??"iye"} ${a.verb} ${o}${n.maximum} ${a.unit}`:`Tó pọ̀ jù: a ní láti jẹ́ ${o}${n.maximum}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Kéré ju: a ní láti jẹ́ pé ${n.origin} ${a.verb} ${o}${n.minimum} ${a.unit}`:`Kéré ju: a ní láti jẹ́ ${o}${n.minimum}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${o.prefix}"`:o.format==="ends_with"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${o.suffix}"`:o.format==="includes"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${o.includes}"`:o.format==="regex"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${o.pattern}`:`Aṣìṣe: ${i[o.format]??n.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${n.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${_(n.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${n.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${n.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};function gw(){return{localeError:hw()}}var Ga,jc=Symbol("ZodOutput"),Ec=Symbol("ZodInput");class Dc{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...i){let r=i[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let i=this._map.get(t);return i&&typeof i=="object"&&"id"in i&&this._idmap.delete(i.id),this._map.delete(t),this}get(t){let i=t._zod.parent;if(i){let r={...this.get(i)??{}};delete r.id;let n={...r,...this._map.get(t)};return Object.keys(n).length?n:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function Rr(){return new Dc}(Ga=globalThis).__zod_globalRegistry??(Ga.__zod_globalRegistry=Rr());var he=globalThis.__zod_globalRegistry;function Rc(e,t){return new e({type:"string",...$(t)})}function Ac(e,t){return new e({type:"string",coerce:!0,...$(t)})}function Ar(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...$(t)})}function kn(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...$(t)})}function Cr(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...$(t)})}function Lr(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...$(t)})}function Mr(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...$(t)})}function Jr(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...$(t)})}function Cn(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...$(t)})}function Fr(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...$(t)})}function qr(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...$(t)})}function Br(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...$(t)})}function Hr(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...$(t)})}function Vr(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...$(t)})}function Wr(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...$(t)})}function Gr(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...$(t)})}function Kr(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...$(t)})}function Xr(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...$(t)})}function Cc(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...$(t)})}function Yr(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...$(t)})}function Qr(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...$(t)})}function eo(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...$(t)})}function to(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...$(t)})}function no(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...$(t)})}function io(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...$(t)})}var Lc={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Mc(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...$(t)})}function Jc(e,t){return new e({type:"string",format:"date",check:"string_format",...$(t)})}function Fc(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...$(t)})}function qc(e,t){return new e({type:"string",format:"duration",check:"string_format",...$(t)})}function Bc(e,t){return new e({type:"number",checks:[],...$(t)})}function Hc(e,t){return new e({type:"number",coerce:!0,checks:[],...$(t)})}function Vc(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...$(t)})}function Wc(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...$(t)})}function Gc(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...$(t)})}function Kc(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...$(t)})}function Xc(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...$(t)})}function Yc(e,t){return new e({type:"boolean",...$(t)})}function Qc(e,t){return new e({type:"boolean",coerce:!0,...$(t)})}function ed(e,t){return new e({type:"bigint",...$(t)})}function td(e,t){return new e({type:"bigint",coerce:!0,...$(t)})}function nd(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...$(t)})}function id(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...$(t)})}function rd(e,t){return new e({type:"symbol",...$(t)})}function od(e,t){return new e({type:"undefined",...$(t)})}function ad(e,t){return new e({type:"null",...$(t)})}function sd(e){return new e({type:"any"})}function ud(e){return new e({type:"unknown"})}function ld(e,t){return new e({type:"never",...$(t)})}function cd(e,t){return new e({type:"void",...$(t)})}function dd(e,t){return new e({type:"date",...$(t)})}function md(e,t){return new e({type:"date",coerce:!0,...$(t)})}function fd(e,t){return new e({type:"nan",...$(t)})}function Ne(e,t){return new xr({check:"less_than",...$(t),value:e,inclusive:!1})}function ge(e,t){return new xr({check:"less_than",...$(t),value:e,inclusive:!0})}function Pe(e,t){return new Or({check:"greater_than",...$(t),value:e,inclusive:!1})}function se(e,t){return new Or({check:"greater_than",...$(t),value:e,inclusive:!0})}function ro(e){return Pe(0,e)}function oo(e){return Ne(0,e)}function ao(e){return ge(0,e)}function so(e){return se(0,e)}function at(e,t){return new Yu({check:"multiple_of",...$(t),value:e})}function ft(e,t){return new tl({check:"max_size",...$(t),maximum:e})}function je(e,t){return new nl({check:"min_size",...$(t),minimum:e})}function Ft(e,t){return new il({check:"size_equals",...$(t),size:e})}function qt(e,t){return new rl({check:"max_length",...$(t),maximum:e})}function qe(e,t){return new ol({check:"min_length",...$(t),minimum:e})}function Bt(e,t){return new al({check:"length_equals",...$(t),length:e})}function Ln(e,t){return new sl({check:"string_format",format:"regex",...$(t),pattern:e})}function Mn(e){return new ul({check:"string_format",format:"lowercase",...$(e)})}function Jn(e){return new ll({check:"string_format",format:"uppercase",...$(e)})}function Fn(e,t){return new cl({check:"string_format",format:"includes",...$(t),includes:e})}function qn(e,t){return new dl({check:"string_format",format:"starts_with",...$(t),prefix:e})}function Bn(e,t){return new ml({check:"string_format",format:"ends_with",...$(t),suffix:e})}function uo(e,t,i){return new fl({check:"property",property:e,schema:t,...$(i)})}function Hn(e,t){return new pl({check:"mime_type",mime:e,...$(t)})}function Ze(e){return new vl({check:"overwrite",tx:e})}function Vn(e){return Ze(t=>t.normalize(e))}function Wn(){return Ze(e=>e.trim())}function Gn(){return Ze(e=>e.toLowerCase())}function Kn(){return Ze(e=>e.toUpperCase())}function Xn(){return Ze(e=>ou(e))}function pd(e,t,i){return new e({type:"array",element:t,...$(i)})}function _w(e,t,i){return new e({type:"union",options:t,...$(i)})}function $w(e,t,i){return new e({type:"union",options:t,inclusive:!1,...$(i)})}function bw(e,t,i,r){return new e({type:"union",options:i,discriminator:t,...$(r)})}function yw(e,t,i){return new e({type:"intersection",left:t,right:i})}function kw(e,t,i,r){let n=i instanceof x;return new e({type:"tuple",items:t,rest:n?i:null,...$(n?r:i)})}function ww(e,t,i,r){return new e({type:"record",keyType:t,valueType:i,...$(r)})}function Sw(e,t,i,r){return new e({type:"map",keyType:t,valueType:i,...$(r)})}function Iw(e,t,i){return new e({type:"set",valueType:t,...$(i)})}function zw(e,t,i){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new e({type:"enum",entries:r,...$(i)})}function xw(e,t,i){return new e({type:"enum",entries:t,...$(i)})}function Ow(e,t,i){return new e({type:"literal",values:Array.isArray(t)?t:[t],...$(i)})}function vd(e,t){return new e({type:"file",...$(t)})}function Zw(e,t){return new e({type:"transform",transform:t})}function Tw(e,t){return new e({type:"optional",innerType:t})}function Uw(e,t){return new e({type:"nullable",innerType:t})}function Nw(e,t,i){return new e({type:"default",innerType:t,get defaultValue(){return typeof i=="function"?i():su(i)}})}function Pw(e,t,i){return new e({type:"nonoptional",innerType:t,...$(i)})}function jw(e,t){return new e({type:"success",innerType:t})}function Ew(e,t,i){return new e({type:"catch",innerType:t,catchValue:typeof i=="function"?i:()=>i})}function Dw(e,t,i){return new e({type:"pipe",in:t,out:i})}function Rw(e,t){return new e({type:"readonly",innerType:t})}function Aw(e,t,i){return new e({type:"template_literal",parts:t,...$(i)})}function Cw(e,t){return new e({type:"lazy",getter:t})}function Lw(e,t){return new e({type:"promise",innerType:t})}function hd(e,t,i){let r=$(i);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}function gd(e,t,i){return new e({type:"custom",check:"custom",fn:t,...$(i)})}function _d(e){let t=$d(i=>(i.addIssue=r=>{if(typeof r=="string")i.issues.push(bn(r,i.value,t._zod.def));else{let n=r;n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=i.value),n.inst??(n.inst=t),n.continue??(n.continue=!t._zod.def.abort),i.issues.push(bn(n))}},e(i.value,i)));return t}function $d(e,t){let i=new V({check:"custom",...$(t)});return i._zod.check=e,i}function bd(e){let t=new V({check:"describe"});return t._zod.onattach=[i=>{let r=he.get(i)??{};he.add(i,{...r,description:e})}],t._zod.check=()=>{},t}function yd(e){let t=new V({check:"meta"});return t._zod.onattach=[i=>{let r=he.get(i)??{};he.add(i,{...r,...e})}],t._zod.check=()=>{},t}function kd(e,t){let i=$(t),r=i.truthy??["true","1","yes","on","y","enabled"],n=i.falsy??["false","0","no","off","n","disabled"];i.case!=="sensitive"&&(r=r.map(p=>typeof p=="string"?p.toLowerCase():p),n=n.map(p=>typeof p=="string"?p.toLowerCase():p));let o=new Set(r),a=new Set(n),s=e.Codec??Er,u=e.Boolean??Ur,l=new(e.String??Jt)({type:"string",error:i.error}),c=new u({type:"boolean",error:i.error}),m=new s({type:"pipe",in:l,out:c,transform:(p,g)=>{let w=p;return i.case!=="sensitive"&&(w=w.toLowerCase()),o.has(w)?!0:a.has(w)?!1:(g.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...a],input:g.value,inst:m,continue:!1}),{})},reverseTransform:(p,g)=>p===!0?r[0]||"true":n[0]||"false",error:i.error});return m}function Ht(e,t,i,r={}){let n=$(r),o={...$(r),check:"string_format",type:"string",format:t,fn:typeof i=="function"?i:a=>i.test(a),...n};return i instanceof RegExp&&(o.pattern=i),new e(o)}function st(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??he,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 L(e,t,i={path:[],schemaPath:[]}){var r;let n=e._zod.def,o=t.seen.get(e);if(o)return o.count++,i.schemaPath.includes(e)&&(o.cycle=i.path),o.schema;let a={schema:{},count:1,cycle:void 0,path:i.path};t.seen.set(e,a);let s=e._zod.toJSONSchema?.();if(s)a.schema=s;else{let l={...i,schemaPath:[...i.schemaPath,e],path:i.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,l);else{let m=a.schema,p=t.processors[n.type];if(!p)throw Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);p(e,t,m,l)}let c=e._zod.parent;c&&(a.ref||(a.ref=c),L(c,t,l),t.seen.get(c).isParent=!0)}let u=t.metadataRegistry.get(e);return u&&Object.assign(a.schema,u),t.io==="input"&&ae(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&a.schema._prefault&&((r=a.schema).default??(r.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function ut(e,t){let i=e.seen.get(t);if(!i)throw Error("Unprocessed schema. This is a bug in Zod.");let r=new Map;for(let a of e.seen.entries()){let s=e.metadataRegistry.get(a[0])?.id;if(s){let u=r.get(s);if(u&&u!==a[0])throw Error(`Duplicate schema id "${s}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(s,a[0])}}let n=a=>{let s=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let c=e.external.registry.get(a[0])?.id,m=e.external.uri??(g=>g);if(c)return{ref:m(c)};let p=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=p,{defId:p,ref:`${m("__shared")}#/${s}/${p}`}}if(a[1]===i)return{ref:"#"};let u=`#/${s}/`,l=a[1].schema.id??`__schema${e.counter++}`;return{defId:l,ref:u+l}},o=a=>{if(a[1].schema.$ref)return;let s=a[1],{ref:u,defId:l}=n(a);s.def={...s.schema},l&&(s.defId=l);let c=s.schema;for(let m in c)delete c[m];c.$ref=u};if(e.cycles==="throw")for(let a of e.seen.entries()){let s=a[1];if(s.cycle)throw Error(`Cycle detected: #/${s.cycle?.join("/")}/<root>
876
1153
 
877
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of e.seen.entries()){let s=a[1];if(t===a[0]){o(a);continue}if(e.external){let u=e.external.registry.get(a[0])?.id;if(t!==a[0]&&u){o(a);continue}}if(e.metadataRegistry.get(a[0])?.id){o(a);continue}if(s.cycle){o(a);continue}if(s.count>1&&e.reused==="ref"){o(a);continue}}}function lt(e,t){let i=e.seen.get(t);if(!i)throw Error("Unprocessed schema. This is a bug in Zod.");let r=a=>{let s=e.seen.get(a);if(s.ref===null)return;let u=s.def??s.schema,l={...u},c=s.ref;if(s.ref=null,c){r(c);let p=e.seen.get(c),g=p.schema;if(g.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(g)):Object.assign(u,g),Object.assign(u,l),a._zod.parent===c)for(let w in u)w==="$ref"||w==="allOf"||w in l||delete u[w];if(g.$ref)for(let w in u)w==="$ref"||w==="allOf"||w in p.def&&JSON.stringify(u[w])===JSON.stringify(p.def[w])&&delete u[w]}let m=a._zod.parent;if(m&&m!==c){r(m);let p=e.seen.get(m);if(p?.schema.$ref&&(u.$ref=p.schema.$ref,p.def))for(let g in u)g==="$ref"||g==="allOf"||g in p.def&&JSON.stringify(u[g])===JSON.stringify(p.def[g])&&delete u[g]}e.override({zodSchema:a,jsonSchema:u,path:s.path??[]})};for(let a of[...e.seen.entries()].reverse())r(a[0]);let n={};if(e.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let a=e.external.registry.get(t)?.id;if(!a)throw Error("Schema is missing an `id` property");n.$id=e.external.uri(a)}Object.assign(n,i.def??i.schema);let o=e.external?.defs??{};for(let a of e.seen.entries()){let s=a[1];s.def&&s.defId&&(o[s.defId]=s.def)}e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?n.$defs=o:n.definitions=o);try{let a=JSON.parse(JSON.stringify(n));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:bt(t,"input",e.processors),output:bt(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw Error("Error converting schema to JSON.")}}function ae(e,t){let i=t??{seen:new Set};if(i.seen.has(e))return!1;i.seen.add(e);let r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return ae(r.element,i);if(r.type==="set")return ae(r.valueType,i);if(r.type==="lazy")return ae(r.getter(),i);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return ae(r.innerType,i);if(r.type==="intersection")return ae(r.left,i)||ae(r.right,i);if(r.type==="record"||r.type==="map")return ae(r.keyType,i)||ae(r.valueType,i);if(r.type==="pipe")return ae(r.in,i)||ae(r.out,i);if(r.type==="object"){for(let n in r.shape)if(ae(r.shape[n],i))return!0;return!1}if(r.type==="union"){for(let n of r.options)if(ae(n,i))return!0;return!1}if(r.type==="tuple"){for(let n of r.items)if(ae(n,i))return!0;return!!(r.rest&&ae(r.rest,i))}return!1}var wd=(e,t={})=>i=>{let r=st({...i,processors:t});return L(e,r),ut(r,e),lt(r,e)},bt=(e,t,i={})=>r=>{let{libraryOptions:n,target:o}=r??{},a=st({...n??{},target:o,io:t,processors:i});return L(e,a),ut(a,e),lt(a,e)},Mw={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Sd=(e,t,i,r)=>{let n=i;n.type="string";let{minimum:o,maximum:a,format:s,patterns:u,contentEncoding:l}=e._zod.bag;if(typeof o=="number"&&(n.minLength=o),typeof a=="number"&&(n.maxLength=a),s&&(n.format=Mw[s]??s,n.format===""&&delete n.format,s==="time"&&delete n.format),l&&(n.contentEncoding=l),u&&u.size>0){let c=[...u];c.length===1?n.pattern=c[0].source:c.length>1&&(n.allOf=[...c.map(m=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},Id=(e,t,i,r)=>{let n=i,{minimum:o,maximum:a,format:s,multipleOf:u,exclusiveMaximum:l,exclusiveMinimum:c}=e._zod.bag;typeof s=="string"&&s.includes("int")?n.type="integer":n.type="number",typeof c=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(n.minimum=c,n.exclusiveMinimum=!0):n.exclusiveMinimum=c),typeof o=="number"&&(n.minimum=o,typeof c=="number"&&t.target!=="draft-04"&&(c>=o?delete n.minimum:delete n.exclusiveMinimum)),typeof l=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(n.maximum=l,n.exclusiveMaximum=!0):n.exclusiveMaximum=l),typeof a=="number"&&(n.maximum=a,typeof l=="number"&&t.target!=="draft-04"&&(l<=a?delete n.maximum:delete n.exclusiveMaximum)),typeof u=="number"&&(n.multipleOf=u)},zd=(e,t,i,r)=>{i.type="boolean"},xd=(e,t,i,r)=>{if(t.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},Od=(e,t,i,r)=>{if(t.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},Zd=(e,t,i,r)=>{t.target==="openapi-3.0"?(i.type="string",i.nullable=!0,i.enum=[null]):i.type="null"},Td=(e,t,i,r)=>{if(t.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},Ud=(e,t,i,r)=>{if(t.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},Nd=(e,t,i,r)=>{i.not={}},Pd=(e,t,i,r)=>{},jd=(e,t,i,r)=>{},Ed=(e,t,i,r)=>{if(t.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},Dd=(e,t,i,r)=>{let n=e._zod.def,o=mr(n.entries);o.every(a=>typeof a=="number")&&(i.type="number"),o.every(a=>typeof a=="string")&&(i.type="string"),i.enum=o},Rd=(e,t,i,r)=>{let n=e._zod.def,o=[];for(let a of n.values)if(a===void 0){if(t.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(t.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(a))}else o.push(a);if(o.length!==0)if(o.length===1){let a=o[0];i.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?i.enum=[a]:i.const=a}else o.every(a=>typeof a=="number")&&(i.type="number"),o.every(a=>typeof a=="string")&&(i.type="string"),o.every(a=>typeof a=="boolean")&&(i.type="boolean"),o.every(a=>a===null)&&(i.type="null"),i.enum=o},Ad=(e,t,i,r)=>{if(t.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},Cd=(e,t,i,r)=>{let n=i,o=e._zod.pattern;if(!o)throw Error("Pattern not found in template literal");n.type="string",n.pattern=o.source},Ld=(e,t,i,r)=>{let n=i,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:s,mime:u}=e._zod.bag;a!==void 0&&(o.minLength=a),s!==void 0&&(o.maxLength=s),u?u.length===1?(o.contentMediaType=u[0],Object.assign(n,o)):(Object.assign(n,o),n.anyOf=u.map(l=>({contentMediaType:l}))):Object.assign(n,o)},Md=(e,t,i,r)=>{i.type="boolean"},Jd=(e,t,i,r)=>{if(t.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},Fd=(e,t,i,r)=>{if(t.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},qd=(e,t,i,r)=>{if(t.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},Bd=(e,t,i,r)=>{if(t.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},Hd=(e,t,i,r)=>{if(t.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},Vd=(e,t,i,r)=>{let n=i,o=e._zod.def,{minimum:a,maximum:s}=e._zod.bag;typeof a=="number"&&(n.minItems=a),typeof s=="number"&&(n.maxItems=s),n.type="array",n.items=L(o.element,t,{...r,path:[...r.path,"items"]})},Wd=(e,t,i,r)=>{let n=i,o=e._zod.def;n.type="object",n.properties={};let a=o.shape;for(let l in a)n.properties[l]=L(a[l],t,{...r,path:[...r.path,"properties",l]});let s=new Set(Object.keys(a)),u=new Set([...s].filter(l=>{let c=o.shape[l]._zod;return t.io==="input"?c.optin===void 0:c.optout===void 0}));u.size>0&&(n.required=Array.from(u)),o.catchall?._zod.def.type==="never"?n.additionalProperties=!1:o.catchall?o.catchall&&(n.additionalProperties=L(o.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(n.additionalProperties=!1)},lo=(e,t,i,r)=>{let n=e._zod.def,o=n.inclusive===!1,a=n.options.map((s,u)=>L(s,t,{...r,path:[...r.path,o?"oneOf":"anyOf",u]}));o?i.oneOf=a:i.anyOf=a},Gd=(e,t,i,r)=>{let n=e._zod.def,o=L(n.left,t,{...r,path:[...r.path,"allOf",0]}),a=L(n.right,t,{...r,path:[...r.path,"allOf",1]}),s=l=>"allOf"in l&&Object.keys(l).length===1,u=[...s(o)?o.allOf:[o],...s(a)?a.allOf:[a]];i.allOf=u},Kd=(e,t,i,r)=>{let n=i,o=e._zod.def;n.type="array";let a=t.target==="draft-2020-12"?"prefixItems":"items",s=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",u=o.items.map((p,g)=>L(p,t,{...r,path:[...r.path,a,g]})),l=o.rest?L(o.rest,t,{...r,path:[...r.path,s,...t.target==="openapi-3.0"?[o.items.length]:[]]}):null;t.target==="draft-2020-12"?(n.prefixItems=u,l&&(n.items=l)):t.target==="openapi-3.0"?(n.items={anyOf:u},l&&n.items.anyOf.push(l),n.minItems=u.length,!l&&(n.maxItems=u.length)):(n.items=u,l&&(n.additionalItems=l));let{minimum:c,maximum:m}=e._zod.bag;typeof c=="number"&&(n.minItems=c),typeof m=="number"&&(n.maxItems=m)},Xd=(e,t,i,r)=>{let n=i,o=e._zod.def;n.type="object";let a=o.keyType,s=a._zod.bag?.patterns;if(o.mode==="loose"&&s&&s.size>0){let l=L(o.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});n.patternProperties={};for(let c of s)n.patternProperties[c.source]=l}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(n.propertyNames=L(o.keyType,t,{...r,path:[...r.path,"propertyNames"]})),n.additionalProperties=L(o.valueType,t,{...r,path:[...r.path,"additionalProperties"]});let u=a._zod.values;if(u){let l=[...u].filter(c=>typeof c=="string"||typeof c=="number");l.length>0&&(n.required=l)}},Yd=(e,t,i,r)=>{let n=e._zod.def,o=L(n.innerType,t,r),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=n.innerType,i.nullable=!0):i.anyOf=[o,{type:"null"}]},Qd=(e,t,i,r)=>{let n=e._zod.def;L(n.innerType,t,r);let o=t.seen.get(e);o.ref=n.innerType},em=(e,t,i,r)=>{let n=e._zod.def;L(n.innerType,t,r);let o=t.seen.get(e);o.ref=n.innerType,i.default=JSON.parse(JSON.stringify(n.defaultValue))},tm=(e,t,i,r)=>{let n=e._zod.def;L(n.innerType,t,r);let o=t.seen.get(e);o.ref=n.innerType,t.io==="input"&&(i._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},nm=(e,t,i,r)=>{let n=e._zod.def;L(n.innerType,t,r);let o=t.seen.get(e);o.ref=n.innerType;let a;try{a=n.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}i.default=a},im=(e,t,i,r)=>{let n=e._zod.def,o=t.io==="input"?n.in._zod.def.type==="transform"?n.out:n.in:n.out;L(o,t,r);let a=t.seen.get(e);a.ref=o},rm=(e,t,i,r)=>{let n=e._zod.def;L(n.innerType,t,r);let o=t.seen.get(e);o.ref=n.innerType,i.readOnly=!0},om=(e,t,i,r)=>{let n=e._zod.def;L(n.innerType,t,r);let o=t.seen.get(e);o.ref=n.innerType},co=(e,t,i,r)=>{let n=e._zod.def;L(n.innerType,t,r);let o=t.seen.get(e);o.ref=n.innerType},am=(e,t,i,r)=>{let n=e._zod.innerType;L(n,t,r);let o=t.seen.get(e);o.ref=n},Di={string:Sd,number:Id,boolean:zd,bigint:xd,symbol:Od,null:Zd,undefined:Td,void:Ud,never:Nd,any:Pd,unknown:jd,date:Ed,enum:Dd,literal:Rd,nan:Ad,template_literal:Cd,file:Ld,success:Md,custom:Jd,function:Fd,transform:qd,map:Bd,set:Hd,array:Vd,object:Wd,union:lo,intersection:Gd,tuple:Kd,record:Xd,nullable:Yd,nonoptional:Qd,default:em,prefault:tm,catch:nm,pipe:im,readonly:rm,promise:om,optional:co,lazy:am};function sm(e,t){if("_idmap"in e){let r=e,n=st({...t,processors:Di}),o={};for(let u of r._idmap.entries()){let[l,c]=u;L(c,n)}let a={},s={registry:r,uri:t?.uri,defs:o};n.external=s;for(let u of r._idmap.entries()){let[l,c]=u;ut(n,c),a[l]=lt(n,c)}if(Object.keys(o).length>0){let u=n.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[u]:o}}return{schemas:a}}let i=st({...t,processors:Di});return L(e,i),ut(i,e),lt(i,e)}class Jw{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let i=t?.target??"draft-2020-12";i==="draft-4"&&(i="draft-04"),i==="draft-7"&&(i="draft-07"),this.ctx=st({processors:Di,target:i,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,i={path:[],schemaPath:[]}){return L(t,this.ctx,i)}emit(t,i){i&&(i.cycles&&(this.ctx.cycles=i.cycles),i.reused&&(this.ctx.reused=i.reused),i.external&&(this.ctx.external=i.external)),ut(this.ctx,t);let r=lt(this.ctx,t),{"~standard":n,...o}=r;return o}}var Fw={},um={};xe(um,{xor:()=>_f,xid:()=>Lm,void:()=>mf,uuidv7:()=>Nm,uuidv6:()=>Um,uuidv4:()=>Tm,uuid:()=>Zm,url:()=>Pm,unknown:()=>Be,union:()=>_i,undefined:()=>cf,ulid:()=>Cm,uint64:()=>uf,uint32:()=>of,tuple:()=>jo,transform:()=>bi,templateLiteral:()=>Uf,symbol:()=>lf,superRefine:()=>sa,success:()=>Of,stringbool:()=>Af,stringFormat:()=>Xm,string:()=>wn,strictObject:()=>hf,set:()=>wf,refine:()=>aa,record:()=>Eo,readonly:()=>ea,promise:()=>Nf,preprocess:()=>Lf,prefault:()=>Vo,pipe:()=>St,partialRecord:()=>bf,optional:()=>kt,object:()=>vf,number:()=>_o,nullish:()=>xf,nullable:()=>wt,null:()=>wo,nonoptional:()=>Wo,never:()=>hi,nativeEnum:()=>Sf,nanoid:()=>Dm,nan:()=>Zf,meta:()=>Df,map:()=>kf,mac:()=>Fm,looseRecord:()=>yf,looseObject:()=>gf,literal:()=>If,lazy:()=>ia,ksuid:()=>Mm,keyof:()=>pf,jwt:()=>Km,json:()=>Cf,ipv6:()=>qm,ipv4:()=>Jm,intersection:()=>No,int64:()=>sf,int32:()=>rf,int:()=>Sn,instanceof:()=>Rf,httpUrl:()=>jm,hostname:()=>Ym,hex:()=>Qm,hash:()=>ef,guid:()=>Om,function:()=>In,float64:()=>nf,float32:()=>tf,file:()=>zf,exactOptional:()=>Jo,enum:()=>$i,emoji:()=>Em,email:()=>xm,e164:()=>Gm,discriminatedUnion:()=>$f,describe:()=>Ef,date:()=>ff,custom:()=>jf,cuid2:()=>Am,cuid:()=>Rm,codec:()=>Tf,cidrv6:()=>Hm,cidrv4:()=>Bm,check:()=>Pf,catch:()=>Xo,boolean:()=>$o,bigint:()=>af,base64url:()=>Wm,base64:()=>Vm,array:()=>Yt,any:()=>df,_function:()=>In,_default:()=>Bo,_ZodString:()=>Yn,ZodXor:()=>Zo,ZodXID:()=>oi,ZodVoid:()=>xo,ZodUnknown:()=>Io,ZodUnion:()=>en,ZodUndefined:()=>yo,ZodUUID:()=>Ie,ZodURL:()=>Wt,ZodULID:()=>ri,ZodType:()=>O,ZodTuple:()=>Po,ZodTransform:()=>Lo,ZodTemplateLiteral:()=>ta,ZodSymbol:()=>bo,ZodSuccess:()=>Go,ZodStringFormat:()=>J,ZodString:()=>Vt,ZodSet:()=>Ro,ZodRecord:()=>tn,ZodReadonly:()=>Qo,ZodPromise:()=>ra,ZodPrefault:()=>Ho,ZodPipe:()=>wi,ZodOptional:()=>yi,ZodObject:()=>Qt,ZodNumberFormat:()=>Ge,ZodNumber:()=>Gt,ZodNullable:()=>Fo,ZodNull:()=>ko,ZodNonOptional:()=>ki,ZodNever:()=>zo,ZodNanoID:()=>ti,ZodNaN:()=>Yo,ZodMap:()=>Do,ZodMAC:()=>go,ZodLiteral:()=>Ao,ZodLazy:()=>na,ZodKSUID:()=>ai,ZodJWT:()=>pi,ZodIntersection:()=>Uo,ZodIPv6:()=>ui,ZodIPv4:()=>si,ZodGUID:()=>yt,ZodFunction:()=>oa,ZodFile:()=>Co,ZodExactOptional:()=>Mo,ZodEnum:()=>ct,ZodEmoji:()=>ei,ZodEmail:()=>Qn,ZodE164:()=>fi,ZodDiscriminatedUnion:()=>To,ZodDefault:()=>qo,ZodDate:()=>gi,ZodCustomStringFormat:()=>pt,ZodCustom:()=>nn,ZodCodec:()=>Si,ZodCatch:()=>Ko,ZodCUID2:()=>ii,ZodCUID:()=>ni,ZodCIDRv6:()=>ci,ZodCIDRv4:()=>li,ZodBoolean:()=>Kt,ZodBigIntFormat:()=>vi,ZodBigInt:()=>Xt,ZodBase64URL:()=>mi,ZodBase64:()=>di,ZodArray:()=>Oo,ZodAny:()=>So});var lm={};xe(lm,{uppercase:()=>Jn,trim:()=>Wn,toUpperCase:()=>Kn,toLowerCase:()=>Gn,startsWith:()=>qn,slugify:()=>Xn,size:()=>Ft,regex:()=>Ln,property:()=>uo,positive:()=>ro,overwrite:()=>Ze,normalize:()=>Vn,nonpositive:()=>ao,nonnegative:()=>so,negative:()=>oo,multipleOf:()=>at,minSize:()=>je,minLength:()=>qe,mime:()=>Hn,maxSize:()=>ft,maxLength:()=>qt,lte:()=>ge,lt:()=>Ne,lowercase:()=>Mn,length:()=>Bt,includes:()=>Fn,gte:()=>se,gt:()=>Pe,endsWith:()=>Bn});var mo={};xe(mo,{time:()=>mm,duration:()=>fm,datetime:()=>cm,date:()=>dm,ZodISOTime:()=>vo,ZodISODuration:()=>ho,ZodISODateTime:()=>fo,ZodISODate:()=>po});var fo=f("ZodISODateTime",(e,t)=>{Zl.init(e,t),J.init(e,t)});function cm(e){return Mc(fo,e)}var po=f("ZodISODate",(e,t)=>{Tl.init(e,t),J.init(e,t)});function dm(e){return Jc(po,e)}var vo=f("ZodISOTime",(e,t)=>{Ul.init(e,t),J.init(e,t)});function mm(e){return Fc(vo,e)}var ho=f("ZodISODuration",(e,t)=>{Nl.init(e,t),J.init(e,t)});function fm(e){return qc(ho,e)}var pm=(e,t)=>{pr.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:i=>hr(e,i)},flatten:{value:i=>vr(e,i)},addIssue:{value:i=>{e.issues.push(i),e.message=JSON.stringify(e.issues,_n,2)}},addIssues:{value:i=>{e.issues.push(...i),e.message=JSON.stringify(e.issues,_n,2)}},isEmpty:{get(){return e.issues.length===0}}})},qw=f("ZodError",pm),ve=f("ZodError",pm,{Parent:Error}),vm=Et(ve),hm=Dt(ve),gm=Rt(ve),_m=At(ve),$m=gr(ve),bm=_r(ve),ym=$r(ve),km=br(ve),wm=yr(ve),Sm=kr(ve),Im=wr(ve),zm=Sr(ve),O=f("ZodType",(e,t)=>(x.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:bt(e,"input"),output:bt(e,"output")}}),e.toJSONSchema=wd(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...i)=>e.clone(U.mergeDefs(t,{checks:[...t.checks??[],...i.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),e.with=e.check,e.clone=(i,r)=>ke(e,i,r),e.brand=()=>e,e.register=(i,r)=>(i.add(e,r),e),e.parse=(i,r)=>vm(e,i,r,{callee:e.parse}),e.safeParse=(i,r)=>gm(e,i,r),e.parseAsync=async(i,r)=>hm(e,i,r,{callee:e.parseAsync}),e.safeParseAsync=async(i,r)=>_m(e,i,r),e.spa=e.safeParseAsync,e.encode=(i,r)=>$m(e,i,r),e.decode=(i,r)=>bm(e,i,r),e.encodeAsync=async(i,r)=>ym(e,i,r),e.decodeAsync=async(i,r)=>km(e,i,r),e.safeEncode=(i,r)=>wm(e,i,r),e.safeDecode=(i,r)=>Sm(e,i,r),e.safeEncodeAsync=async(i,r)=>Im(e,i,r),e.safeDecodeAsync=async(i,r)=>zm(e,i,r),e.refine=(i,r)=>e.check(aa(i,r)),e.superRefine=i=>e.check(sa(i)),e.overwrite=i=>e.check(Ze(i)),e.optional=()=>kt(e),e.exactOptional=()=>Jo(e),e.nullable=()=>wt(e),e.nullish=()=>kt(wt(e)),e.nonoptional=i=>Wo(e,i),e.array=()=>Yt(e),e.or=i=>_i([e,i]),e.and=i=>No(e,i),e.transform=i=>St(e,bi(i)),e.default=i=>Bo(e,i),e.prefault=i=>Vo(e,i),e.catch=i=>Xo(e,i),e.pipe=i=>St(e,i),e.readonly=()=>ea(e),e.describe=i=>{let r=e.clone();return he.add(r,{description:i}),r},Object.defineProperty(e,"description",{get(){return he.get(e)?.description},configurable:!0}),e.meta=(...i)=>{if(i.length===0)return he.get(e);let r=e.clone();return he.add(r,i[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=i=>i(e),e)),Yn=f("_ZodString",(e,t)=>{Jt.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Sd(e,r,n);let i=e._zod.bag;e.format=i.format??null,e.minLength=i.minimum??null,e.maxLength=i.maximum??null,e.regex=(...r)=>e.check(Ln(...r)),e.includes=(...r)=>e.check(Fn(...r)),e.startsWith=(...r)=>e.check(qn(...r)),e.endsWith=(...r)=>e.check(Bn(...r)),e.min=(...r)=>e.check(qe(...r)),e.max=(...r)=>e.check(qt(...r)),e.length=(...r)=>e.check(Bt(...r)),e.nonempty=(...r)=>e.check(qe(1,...r)),e.lowercase=r=>e.check(Mn(r)),e.uppercase=r=>e.check(Jn(r)),e.trim=()=>e.check(Wn()),e.normalize=(...r)=>e.check(Vn(...r)),e.toLowerCase=()=>e.check(Gn()),e.toUpperCase=()=>e.check(Kn()),e.slugify=()=>e.check(Xn())}),Vt=f("ZodString",(e,t)=>{Jt.init(e,t),Yn.init(e,t),e.email=i=>e.check(Ar(Qn,i)),e.url=i=>e.check(Cn(Wt,i)),e.jwt=i=>e.check(io(pi,i)),e.emoji=i=>e.check(Fr(ei,i)),e.guid=i=>e.check(kn(yt,i)),e.uuid=i=>e.check(Cr(Ie,i)),e.uuidv4=i=>e.check(Lr(Ie,i)),e.uuidv6=i=>e.check(Mr(Ie,i)),e.uuidv7=i=>e.check(Jr(Ie,i)),e.nanoid=i=>e.check(qr(ti,i)),e.guid=i=>e.check(kn(yt,i)),e.cuid=i=>e.check(Br(ni,i)),e.cuid2=i=>e.check(Hr(ii,i)),e.ulid=i=>e.check(Vr(ri,i)),e.base64=i=>e.check(eo(di,i)),e.base64url=i=>e.check(to(mi,i)),e.xid=i=>e.check(Wr(oi,i)),e.ksuid=i=>e.check(Gr(ai,i)),e.ipv4=i=>e.check(Kr(si,i)),e.ipv6=i=>e.check(Xr(ui,i)),e.cidrv4=i=>e.check(Yr(li,i)),e.cidrv6=i=>e.check(Qr(ci,i)),e.e164=i=>e.check(no(fi,i)),e.datetime=i=>e.check(cm(i)),e.date=i=>e.check(dm(i)),e.time=i=>e.check(mm(i)),e.duration=i=>e.check(fm(i))});function wn(e){return Rc(Vt,e)}var J=f("ZodStringFormat",(e,t)=>{M.init(e,t),Yn.init(e,t)}),Qn=f("ZodEmail",(e,t)=>{bl.init(e,t),J.init(e,t)});function xm(e){return Ar(Qn,e)}var yt=f("ZodGUID",(e,t)=>{_l.init(e,t),J.init(e,t)});function Om(e){return kn(yt,e)}var Ie=f("ZodUUID",(e,t)=>{$l.init(e,t),J.init(e,t)});function Zm(e){return Cr(Ie,e)}function Tm(e){return Lr(Ie,e)}function Um(e){return Mr(Ie,e)}function Nm(e){return Jr(Ie,e)}var Wt=f("ZodURL",(e,t)=>{yl.init(e,t),J.init(e,t)});function Pm(e){return Cn(Wt,e)}function jm(e){return Cn(Wt,{protocol:/^https?$/,hostname:We.domain,...U.normalizeParams(e)})}var ei=f("ZodEmoji",(e,t)=>{kl.init(e,t),J.init(e,t)});function Em(e){return Fr(ei,e)}var ti=f("ZodNanoID",(e,t)=>{wl.init(e,t),J.init(e,t)});function Dm(e){return qr(ti,e)}var ni=f("ZodCUID",(e,t)=>{Sl.init(e,t),J.init(e,t)});function Rm(e){return Br(ni,e)}var ii=f("ZodCUID2",(e,t)=>{Il.init(e,t),J.init(e,t)});function Am(e){return Hr(ii,e)}var ri=f("ZodULID",(e,t)=>{zl.init(e,t),J.init(e,t)});function Cm(e){return Vr(ri,e)}var oi=f("ZodXID",(e,t)=>{xl.init(e,t),J.init(e,t)});function Lm(e){return Wr(oi,e)}var ai=f("ZodKSUID",(e,t)=>{Ol.init(e,t),J.init(e,t)});function Mm(e){return Gr(ai,e)}var si=f("ZodIPv4",(e,t)=>{Pl.init(e,t),J.init(e,t)});function Jm(e){return Kr(si,e)}var go=f("ZodMAC",(e,t)=>{El.init(e,t),J.init(e,t)});function Fm(e){return Cc(go,e)}var ui=f("ZodIPv6",(e,t)=>{jl.init(e,t),J.init(e,t)});function qm(e){return Xr(ui,e)}var li=f("ZodCIDRv4",(e,t)=>{Dl.init(e,t),J.init(e,t)});function Bm(e){return Yr(li,e)}var ci=f("ZodCIDRv6",(e,t)=>{Rl.init(e,t),J.init(e,t)});function Hm(e){return Qr(ci,e)}var di=f("ZodBase64",(e,t)=>{Al.init(e,t),J.init(e,t)});function Vm(e){return eo(di,e)}var mi=f("ZodBase64URL",(e,t)=>{Ll.init(e,t),J.init(e,t)});function Wm(e){return to(mi,e)}var fi=f("ZodE164",(e,t)=>{Ml.init(e,t),J.init(e,t)});function Gm(e){return no(fi,e)}var pi=f("ZodJWT",(e,t)=>{Fl.init(e,t),J.init(e,t)});function Km(e){return io(pi,e)}var pt=f("ZodCustomStringFormat",(e,t)=>{ql.init(e,t),J.init(e,t)});function Xm(e,t,i={}){return Ht(pt,e,t,i)}function Ym(e){return Ht(pt,"hostname",We.hostname,e)}function Qm(e){return Ht(pt,"hex",We.hex,e)}function ef(e,t){let i=t?.enc??"hex",r=`${e}_${i}`,n=We[r];if(!n)throw Error(`Unrecognized hash format: ${r}`);return Ht(pt,r,n,t)}var Gt=f("ZodNumber",(e,t)=>{Tr.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Id(e,r,n),e.gt=(r,n)=>e.check(Pe(r,n)),e.gte=(r,n)=>e.check(se(r,n)),e.min=(r,n)=>e.check(se(r,n)),e.lt=(r,n)=>e.check(Ne(r,n)),e.lte=(r,n)=>e.check(ge(r,n)),e.max=(r,n)=>e.check(ge(r,n)),e.int=r=>e.check(Sn(r)),e.safe=r=>e.check(Sn(r)),e.positive=r=>e.check(Pe(0,r)),e.nonnegative=r=>e.check(se(0,r)),e.negative=r=>e.check(Ne(0,r)),e.nonpositive=r=>e.check(ge(0,r)),e.multipleOf=(r,n)=>e.check(at(r,n)),e.step=(r,n)=>e.check(at(r,n)),e.finite=()=>e;let i=e._zod.bag;e.minValue=Math.max(i.minimum??Number.NEGATIVE_INFINITY,i.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(i.maximum??Number.POSITIVE_INFINITY,i.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(i.format??"").includes("int")||Number.isSafeInteger(i.multipleOf??.5),e.isFinite=!0,e.format=i.format??null});function _o(e){return Bc(Gt,e)}var Ge=f("ZodNumberFormat",(e,t)=>{Bl.init(e,t),Gt.init(e,t)});function Sn(e){return Vc(Ge,e)}function tf(e){return Wc(Ge,e)}function nf(e){return Gc(Ge,e)}function rf(e){return Kc(Ge,e)}function of(e){return Xc(Ge,e)}var Kt=f("ZodBoolean",(e,t)=>{Ur.init(e,t),O.init(e,t),e._zod.processJSONSchema=(i,r,n)=>zd(e,i,r)});function $o(e){return Yc(Kt,e)}var Xt=f("ZodBigInt",(e,t)=>{Nr.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>xd(e,r),e.gte=(r,n)=>e.check(se(r,n)),e.min=(r,n)=>e.check(se(r,n)),e.gt=(r,n)=>e.check(Pe(r,n)),e.gte=(r,n)=>e.check(se(r,n)),e.min=(r,n)=>e.check(se(r,n)),e.lt=(r,n)=>e.check(Ne(r,n)),e.lte=(r,n)=>e.check(ge(r,n)),e.max=(r,n)=>e.check(ge(r,n)),e.positive=r=>e.check(Pe(BigInt(0),r)),e.negative=r=>e.check(Ne(BigInt(0),r)),e.nonpositive=r=>e.check(ge(BigInt(0),r)),e.nonnegative=r=>e.check(se(BigInt(0),r)),e.multipleOf=(r,n)=>e.check(at(r,n));let i=e._zod.bag;e.minValue=i.minimum??null,e.maxValue=i.maximum??null,e.format=i.format??null});function af(e){return ed(Xt,e)}var vi=f("ZodBigIntFormat",(e,t)=>{Hl.init(e,t),Xt.init(e,t)});function sf(e){return nd(vi,e)}function uf(e){return id(vi,e)}var bo=f("ZodSymbol",(e,t)=>{Vl.init(e,t),O.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Od(e,i)});function lf(e){return rd(bo,e)}var yo=f("ZodUndefined",(e,t)=>{Wl.init(e,t),O.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Td(e,i)});function cf(e){return od(yo,e)}var ko=f("ZodNull",(e,t)=>{Gl.init(e,t),O.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Zd(e,i,r)});function wo(e){return ad(ko,e)}var So=f("ZodAny",(e,t)=>{Kl.init(e,t),O.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Pd()});function df(){return sd(So)}var Io=f("ZodUnknown",(e,t)=>{Xl.init(e,t),O.init(e,t),e._zod.processJSONSchema=(i,r,n)=>jd()});function Be(){return ud(Io)}var zo=f("ZodNever",(e,t)=>{Yl.init(e,t),O.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Nd(e,i,r)});function hi(e){return ld(zo,e)}var xo=f("ZodVoid",(e,t)=>{Ql.init(e,t),O.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Ud(e,i)});function mf(e){return cd(xo,e)}var gi=f("ZodDate",(e,t)=>{ec.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ed(e,r),e.min=(r,n)=>e.check(se(r,n)),e.max=(r,n)=>e.check(ge(r,n));let i=e._zod.bag;e.minDate=i.minimum?new Date(i.minimum):null,e.maxDate=i.maximum?new Date(i.maximum):null});function ff(e){return dd(gi,e)}var Oo=f("ZodArray",(e,t)=>{tc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Vd(e,i,r,n),e.element=t.element,e.min=(i,r)=>e.check(qe(i,r)),e.nonempty=i=>e.check(qe(1,i)),e.max=(i,r)=>e.check(qt(i,r)),e.length=(i,r)=>e.check(Bt(i,r)),e.unwrap=()=>e.element});function Yt(e,t){return pd(Oo,e,t)}function pf(e){let t=e._zod.def.shape;return $i(Object.keys(t))}var Qt=f("ZodObject",(e,t)=>{oc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Wd(e,i,r,n),U.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>$i(Object.keys(e._zod.def.shape)),e.catchall=i=>e.clone({...e._zod.def,catchall:i}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Be()}),e.loose=()=>e.clone({...e._zod.def,catchall:Be()}),e.strict=()=>e.clone({...e._zod.def,catchall:hi()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=i=>U.extend(e,i),e.safeExtend=i=>U.safeExtend(e,i),e.merge=i=>U.merge(e,i),e.pick=i=>U.pick(e,i),e.omit=i=>U.omit(e,i),e.partial=(...i)=>U.partial(yi,e,i[0]),e.required=(...i)=>U.required(ki,e,i[0])});function vf(e,t){let i={type:"object",shape:e??{},...U.normalizeParams(t)};return new Qt(i)}function hf(e,t){return new Qt({type:"object",shape:e,catchall:hi(),...U.normalizeParams(t)})}function gf(e,t){return new Qt({type:"object",shape:e,catchall:Be(),...U.normalizeParams(t)})}var en=f("ZodUnion",(e,t)=>{An.init(e,t),O.init(e,t),e._zod.processJSONSchema=(i,r,n)=>lo(e,i,r,n),e.options=t.options});function _i(e,t){return new en({type:"union",options:e,...U.normalizeParams(t)})}var Zo=f("ZodXor",(e,t)=>{en.init(e,t),ac.init(e,t),e._zod.processJSONSchema=(i,r,n)=>lo(e,i,r,n),e.options=t.options});function _f(e,t){return new Zo({type:"union",options:e,inclusive:!1,...U.normalizeParams(t)})}var To=f("ZodDiscriminatedUnion",(e,t)=>{en.init(e,t),sc.init(e,t)});function $f(e,t,i){return new To({type:"union",options:t,discriminator:e,...U.normalizeParams(i)})}var Uo=f("ZodIntersection",(e,t)=>{uc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Gd(e,i,r,n)});function No(e,t){return new Uo({type:"intersection",left:e,right:t})}var Po=f("ZodTuple",(e,t)=>{Pr.init(e,t),O.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Kd(e,i,r,n),e.rest=i=>e.clone({...e._zod.def,rest:i})});function jo(e,t,i){let r=t instanceof x,n=r?i:t;return new Po({type:"tuple",items:e,rest:r?t:null,...U.normalizeParams(n)})}var tn=f("ZodRecord",(e,t)=>{lc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Xd(e,i,r,n),e.keyType=t.keyType,e.valueType=t.valueType});function Eo(e,t,i){return new tn({type:"record",keyType:e,valueType:t,...U.normalizeParams(i)})}function bf(e,t,i){let r=ke(e);return r._zod.values=void 0,new tn({type:"record",keyType:r,valueType:t,...U.normalizeParams(i)})}function yf(e,t,i){return new tn({type:"record",keyType:e,valueType:t,mode:"loose",...U.normalizeParams(i)})}var Do=f("ZodMap",(e,t)=>{cc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Bd(e,i),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...i)=>e.check(je(...i)),e.nonempty=i=>e.check(je(1,i)),e.max=(...i)=>e.check(ft(...i)),e.size=(...i)=>e.check(Ft(...i))});function kf(e,t,i){return new Do({type:"map",keyType:e,valueType:t,...U.normalizeParams(i)})}var Ro=f("ZodSet",(e,t)=>{dc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Hd(e,i),e.min=(...i)=>e.check(je(...i)),e.nonempty=i=>e.check(je(1,i)),e.max=(...i)=>e.check(ft(...i)),e.size=(...i)=>e.check(Ft(...i))});function wf(e,t){return new Ro({type:"set",valueType:e,...U.normalizeParams(t)})}var ct=f("ZodEnum",(e,t)=>{mc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Dd(e,r,n),e.enum=t.entries,e.options=Object.values(t.entries);let i=new Set(Object.keys(t.entries));e.extract=(r,n)=>{let o={};for(let a of r)if(i.has(a))o[a]=t.entries[a];else throw Error(`Key ${a} not found in enum`);return new ct({...t,checks:[],...U.normalizeParams(n),entries:o})},e.exclude=(r,n)=>{let o={...t.entries};for(let a of r)if(i.has(a))delete o[a];else throw Error(`Key ${a} not found in enum`);return new ct({...t,checks:[],...U.normalizeParams(n),entries:o})}});function $i(e,t){let i=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new ct({type:"enum",entries:i,...U.normalizeParams(t)})}function Sf(e,t){return new ct({type:"enum",entries:e,...U.normalizeParams(t)})}var Ao=f("ZodLiteral",(e,t)=>{fc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Rd(e,i,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function If(e,t){return new Ao({type:"literal",values:Array.isArray(e)?e:[e],...U.normalizeParams(t)})}var Co=f("ZodFile",(e,t)=>{pc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Ld(e,i,r),e.min=(i,r)=>e.check(je(i,r)),e.max=(i,r)=>e.check(ft(i,r)),e.mime=(i,r)=>e.check(Hn(Array.isArray(i)?i:[i],r))});function zf(e){return vd(Co,e)}var Lo=f("ZodTransform",(e,t)=>{vc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(i,r,n)=>qd(e,i),e._zod.parse=(i,r)=>{if(r.direction==="backward")throw new jn(e.constructor.name);i.addIssue=o=>{if(typeof o=="string")i.issues.push(U.issue(o,i.value,t));else{let a=o;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=i.value),a.inst??(a.inst=e),i.issues.push(U.issue(a))}};let n=t.transform(i.value,i);return n instanceof Promise?n.then(o=>(i.value=o,i)):(i.value=n,i)}});function bi(e){return new Lo({type:"transform",transform:e})}var yi=f("ZodOptional",(e,t)=>{jr.init(e,t),O.init(e,t),e._zod.processJSONSchema=(i,r,n)=>co(e,i,r,n),e.unwrap=()=>e._zod.def.innerType});function kt(e){return new yi({type:"optional",innerType:e})}var Mo=f("ZodExactOptional",(e,t)=>{hc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(i,r,n)=>co(e,i,r,n),e.unwrap=()=>e._zod.def.innerType});function Jo(e){return new Mo({type:"optional",innerType:e})}var Fo=f("ZodNullable",(e,t)=>{gc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Yd(e,i,r,n),e.unwrap=()=>e._zod.def.innerType});function wt(e){return new Fo({type:"nullable",innerType:e})}function xf(e){return kt(wt(e))}var qo=f("ZodDefault",(e,t)=>{_c.init(e,t),O.init(e,t),e._zod.processJSONSchema=(i,r,n)=>em(e,i,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Bo(e,t){return new qo({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():U.shallowClone(t)}})}var Ho=f("ZodPrefault",(e,t)=>{$c.init(e,t),O.init(e,t),e._zod.processJSONSchema=(i,r,n)=>tm(e,i,r,n),e.unwrap=()=>e._zod.def.innerType});function Vo(e,t){return new Ho({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():U.shallowClone(t)}})}var ki=f("ZodNonOptional",(e,t)=>{bc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Qd(e,i,r,n),e.unwrap=()=>e._zod.def.innerType});function Wo(e,t){return new ki({type:"nonoptional",innerType:e,...U.normalizeParams(t)})}var Go=f("ZodSuccess",(e,t)=>{yc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Md(e,i,r),e.unwrap=()=>e._zod.def.innerType});function Of(e){return new Go({type:"success",innerType:e})}var Ko=f("ZodCatch",(e,t)=>{kc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(i,r,n)=>nm(e,i,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Xo(e,t){return new Ko({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}var Yo=f("ZodNaN",(e,t)=>{wc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Ad(e,i)});function Zf(e){return fd(Yo,e)}var wi=f("ZodPipe",(e,t)=>{Sc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(i,r,n)=>im(e,i,r,n),e.in=t.in,e.out=t.out});function St(e,t){return new wi({type:"pipe",in:e,out:t})}var Si=f("ZodCodec",(e,t)=>{wi.init(e,t),Er.init(e,t)});function Tf(e,t,i){return new Si({type:"pipe",in:e,out:t,transform:i.decode,reverseTransform:i.encode})}var Qo=f("ZodReadonly",(e,t)=>{Ic.init(e,t),O.init(e,t),e._zod.processJSONSchema=(i,r,n)=>rm(e,i,r,n),e.unwrap=()=>e._zod.def.innerType});function ea(e){return new Qo({type:"readonly",innerType:e})}var ta=f("ZodTemplateLiteral",(e,t)=>{zc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Cd(e,i,r)});function Uf(e,t){return new ta({type:"template_literal",parts:e,...U.normalizeParams(t)})}var na=f("ZodLazy",(e,t)=>{Zc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(i,r,n)=>am(e,i,r,n),e.unwrap=()=>e._zod.def.getter()});function ia(e){return new na({type:"lazy",getter:e})}var ra=f("ZodPromise",(e,t)=>{Oc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(i,r,n)=>om(e,i,r,n),e.unwrap=()=>e._zod.def.innerType});function Nf(e){return new ra({type:"promise",innerType:e})}var oa=f("ZodFunction",(e,t)=>{xc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Fd(e,i)});function In(e){return new oa({type:"function",input:Array.isArray(e?.input)?jo(e?.input):e?.input??Yt(Be()),output:e?.output??Be()})}var nn=f("ZodCustom",(e,t)=>{Tc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Jd(e,i)});function Pf(e){let t=new V({check:"custom"});return t._zod.check=e,t}function jf(e,t){return hd(nn,e??(()=>!0),t)}function aa(e,t={}){return gd(nn,e,t)}function sa(e){return _d(e)}var Ef=bd,Df=yd;function Rf(e,t={}){let i=new nn({type:"custom",check:"custom",fn:r=>r instanceof e,abort:!0,...U.normalizeParams(t)});return i._zod.bag.Class=e,i._zod.check=r=>{r.value instanceof e||r.issues.push({code:"invalid_type",expected:e.name,input:r.value,inst:i,path:[...i._zod.def.path??[]]})},i}var Af=(...e)=>kd({Codec:Si,Boolean:Kt,String:Vt},...e);function Cf(e){let t=ia(()=>_i([wn(e),_o(),$o(),wo(),Yt(t),Eo(wn(),t)]));return t}function Lf(e,t){return St(bi(e),t)}var Bw={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function Hw(e){re({customError:e})}function Vw(){return re().customError}var Ri;Ri||(Ri={});var b={...um,...lm,iso:mo},Ww=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function Gw(e,t){let i=e.$schema;return i==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":i==="http://json-schema.org/draft-07/schema#"?"draft-7":i==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function Kw(e,t){if(!e.startsWith("#"))throw Error("External $ref is not supported, only local refs (#/...) are allowed");let i=e.slice(1).split("/").filter(Boolean);if(i.length===0)return t.rootSchema;let r=t.version==="draft-2020-12"?"$defs":"definitions";if(i[0]===r){let n=i[1];if(!n||!t.defs[n])throw Error(`Reference not found: ${e}`);return t.defs[n]}throw Error(`Reference not found: ${e}`)}function Mf(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return b.never();throw Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let n=e.$ref;if(t.refs.has(n))return t.refs.get(n);if(t.processing.has(n))return b.lazy(()=>{if(!t.refs.has(n))throw Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);let o=Kw(n,t),a=ie(o,t);return t.refs.set(n,a),t.processing.delete(n),a}if(e.enum!==void 0){let n=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&n.length===1&&n[0]===null)return b.null();if(n.length===0)return b.never();if(n.length===1)return b.literal(n[0]);if(n.every(a=>typeof a=="string"))return b.enum(n);let o=n.map(a=>b.literal(a));return o.length<2?o[0]:b.union([o[0],o[1],...o.slice(2)])}if(e.const!==void 0)return b.literal(e.const);let i=e.type;if(Array.isArray(i)){let n=i.map(o=>{let a={...e,type:o};return Mf(a,t)});return n.length===0?b.never():n.length===1?n[0]:b.union(n)}if(!i)return b.any();let r;switch(i){case"string":{let n=b.string();if(e.format){let o=e.format;o==="email"?n=n.check(b.email()):o==="uri"||o==="uri-reference"?n=n.check(b.url()):o==="uuid"||o==="guid"?n=n.check(b.uuid()):o==="date-time"?n=n.check(b.iso.datetime()):o==="date"?n=n.check(b.iso.date()):o==="time"?n=n.check(b.iso.time()):o==="duration"?n=n.check(b.iso.duration()):o==="ipv4"?n=n.check(b.ipv4()):o==="ipv6"?n=n.check(b.ipv6()):o==="mac"?n=n.check(b.mac()):o==="cidr"?n=n.check(b.cidrv4()):o==="cidr-v6"?n=n.check(b.cidrv6()):o==="base64"?n=n.check(b.base64()):o==="base64url"?n=n.check(b.base64url()):o==="e164"?n=n.check(b.e164()):o==="jwt"?n=n.check(b.jwt()):o==="emoji"?n=n.check(b.emoji()):o==="nanoid"?n=n.check(b.nanoid()):o==="cuid"?n=n.check(b.cuid()):o==="cuid2"?n=n.check(b.cuid2()):o==="ulid"?n=n.check(b.ulid()):o==="xid"?n=n.check(b.xid()):o==="ksuid"&&(n=n.check(b.ksuid()))}typeof e.minLength=="number"&&(n=n.min(e.minLength)),typeof e.maxLength=="number"&&(n=n.max(e.maxLength)),e.pattern&&(n=n.regex(new RegExp(e.pattern))),r=n;break}case"number":case"integer":{let n=i==="integer"?b.number().int():b.number();typeof e.minimum=="number"&&(n=n.min(e.minimum)),typeof e.maximum=="number"&&(n=n.max(e.maximum)),typeof e.exclusiveMinimum=="number"?n=n.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(n=n.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?n=n.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(n=n.lt(e.maximum)),typeof e.multipleOf=="number"&&(n=n.multipleOf(e.multipleOf)),r=n;break}case"boolean":{r=b.boolean();break}case"null":{r=b.null();break}case"object":{let n={},o=e.properties||{},a=new Set(e.required||[]);for(let[u,l]of Object.entries(o)){let c=ie(l,t);n[u]=a.has(u)?c:c.optional()}if(e.propertyNames){let u=ie(e.propertyNames,t),l=e.additionalProperties&&typeof e.additionalProperties=="object"?ie(e.additionalProperties,t):b.any();if(Object.keys(n).length===0){r=b.record(u,l);break}let c=b.object(n).passthrough(),m=b.looseRecord(u,l);r=b.intersection(c,m);break}if(e.patternProperties){let u=e.patternProperties,l=Object.keys(u),c=[];for(let p of l){let g=ie(u[p],t),w=b.string().regex(new RegExp(p));c.push(b.looseRecord(w,g))}let m=[];if(Object.keys(n).length>0&&m.push(b.object(n).passthrough()),m.push(...c),m.length===0)r=b.object({}).passthrough();else if(m.length===1)r=m[0];else{let p=b.intersection(m[0],m[1]);for(let g=2;g<m.length;g++)p=b.intersection(p,m[g]);r=p}break}let s=b.object(n);e.additionalProperties===!1?r=s.strict():typeof e.additionalProperties=="object"?r=s.catchall(ie(e.additionalProperties,t)):r=s.passthrough();break}case"array":{let{prefixItems:n,items:o}=e;if(n&&Array.isArray(n)){let a=n.map(u=>ie(u,t)),s=o&&typeof o=="object"&&!Array.isArray(o)?ie(o,t):void 0;s?r=b.tuple(a).rest(s):r=b.tuple(a),typeof e.minItems=="number"&&(r=r.check(b.minLength(e.minItems))),typeof e.maxItems=="number"&&(r=r.check(b.maxLength(e.maxItems)))}else if(Array.isArray(o)){let a=o.map(u=>ie(u,t)),s=e.additionalItems&&typeof e.additionalItems=="object"?ie(e.additionalItems,t):void 0;s?r=b.tuple(a).rest(s):r=b.tuple(a),typeof e.minItems=="number"&&(r=r.check(b.minLength(e.minItems))),typeof e.maxItems=="number"&&(r=r.check(b.maxLength(e.maxItems)))}else if(o!==void 0){let a=ie(o,t),s=b.array(a);typeof e.minItems=="number"&&(s=s.min(e.minItems)),typeof e.maxItems=="number"&&(s=s.max(e.maxItems)),r=s}else r=b.array(b.any());break}default:throw Error(`Unsupported type: ${i}`)}return e.description&&(r=r.describe(e.description)),e.default!==void 0&&(r=r.default(e.default)),r}function ie(e,t){if(typeof e=="boolean")return e?b.any():b.never();let i=Mf(e,t),r=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let s=e.anyOf.map(l=>ie(l,t)),u=b.union(s);i=r?b.intersection(i,u):u}if(e.oneOf&&Array.isArray(e.oneOf)){let s=e.oneOf.map(l=>ie(l,t)),u=b.xor(s);i=r?b.intersection(i,u):u}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)i=r?i:b.any();else{let s=r?i:ie(e.allOf[0],t),u=r?0:1;for(let l=u;l<e.allOf.length;l++)s=b.intersection(s,ie(e.allOf[l],t));i=s}e.nullable===!0&&t.version==="openapi-3.0"&&(i=b.nullable(i)),e.readOnly===!0&&(i=b.readonly(i));let n={},o=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let s of o)s in e&&(n[s]=e[s]);let a=["contentEncoding","contentMediaType","contentSchema"];for(let s of a)s in e&&(n[s]=e[s]);for(let s of Object.keys(e))Ww.has(s)||(n[s]=e[s]);return Object.keys(n).length>0&&t.registry.add(i,n),i}function Xw(e,t){if(typeof e=="boolean")return e?b.any():b.never();let i=Gw(e,t?.defaultTarget),r=e.$defs||e.definitions||{},n={version:i,defs:r,refs:new Map,processing:new Set,rootSchema:e,registry:t?.registry??he};return ie(e,n)}var Jf={};xe(Jf,{string:()=>Yw,number:()=>Qw,date:()=>nS,boolean:()=>eS,bigint:()=>tS});function Yw(e){return Ac(Vt,e)}function Qw(e){return Hc(Gt,e)}function eS(e){return Qc(Kt,e)}function tS(e){return td(Xt,e)}function nS(e){return md(gi,e)}re(Uc());var iS=d.union([d.literal("light"),d.literal("dark")]).describe("Color theme preference for the host environment."),It=d.union([d.literal("inline"),d.literal("fullscreen"),d.literal("pip")]).describe("Display mode for UI presentation."),rS=d.union([d.literal("--color-background-primary"),d.literal("--color-background-secondary"),d.literal("--color-background-tertiary"),d.literal("--color-background-inverse"),d.literal("--color-background-ghost"),d.literal("--color-background-info"),d.literal("--color-background-danger"),d.literal("--color-background-success"),d.literal("--color-background-warning"),d.literal("--color-background-disabled"),d.literal("--color-text-primary"),d.literal("--color-text-secondary"),d.literal("--color-text-tertiary"),d.literal("--color-text-inverse"),d.literal("--color-text-ghost"),d.literal("--color-text-info"),d.literal("--color-text-danger"),d.literal("--color-text-success"),d.literal("--color-text-warning"),d.literal("--color-text-disabled"),d.literal("--color-border-primary"),d.literal("--color-border-secondary"),d.literal("--color-border-tertiary"),d.literal("--color-border-inverse"),d.literal("--color-border-ghost"),d.literal("--color-border-info"),d.literal("--color-border-danger"),d.literal("--color-border-success"),d.literal("--color-border-warning"),d.literal("--color-border-disabled"),d.literal("--color-ring-primary"),d.literal("--color-ring-secondary"),d.literal("--color-ring-inverse"),d.literal("--color-ring-info"),d.literal("--color-ring-danger"),d.literal("--color-ring-success"),d.literal("--color-ring-warning"),d.literal("--font-sans"),d.literal("--font-mono"),d.literal("--font-weight-normal"),d.literal("--font-weight-medium"),d.literal("--font-weight-semibold"),d.literal("--font-weight-bold"),d.literal("--font-text-xs-size"),d.literal("--font-text-sm-size"),d.literal("--font-text-md-size"),d.literal("--font-text-lg-size"),d.literal("--font-heading-xs-size"),d.literal("--font-heading-sm-size"),d.literal("--font-heading-md-size"),d.literal("--font-heading-lg-size"),d.literal("--font-heading-xl-size"),d.literal("--font-heading-2xl-size"),d.literal("--font-heading-3xl-size"),d.literal("--font-text-xs-line-height"),d.literal("--font-text-sm-line-height"),d.literal("--font-text-md-line-height"),d.literal("--font-text-lg-line-height"),d.literal("--font-heading-xs-line-height"),d.literal("--font-heading-sm-line-height"),d.literal("--font-heading-md-line-height"),d.literal("--font-heading-lg-line-height"),d.literal("--font-heading-xl-line-height"),d.literal("--font-heading-2xl-line-height"),d.literal("--font-heading-3xl-line-height"),d.literal("--border-radius-xs"),d.literal("--border-radius-sm"),d.literal("--border-radius-md"),d.literal("--border-radius-lg"),d.literal("--border-radius-xl"),d.literal("--border-radius-full"),d.literal("--border-width-regular"),d.literal("--shadow-hairline"),d.literal("--shadow-sm"),d.literal("--shadow-md"),d.literal("--shadow-lg")]).describe("CSS variable keys available to MCP apps for theming."),oS=d.record(rS.describe(`Style variables for theming MCP apps.
1154
+ `)}h.write("payload.value = newResult;"),h.write("return payload;");const $=h.compile();return(k,z)=>$(d,k,z)};let o;const s=en,a=!Ln.jitless,u=a&&ed.value,l=e.catchall;let f;r._zod.parse=(d,h)=>{f??(f=i.value);const p=d.value;return s(p)?a&&u&&h?.async===!1&&h.jitless!==!0?(o||(o=t(e.shape)),d=o(d,h),l?oh([],p,d,h,f,r):d):n(d,h):(d.issues.push({expected:"object",code:"invalid_type",input:p,inst:r}),d)}});function Hu(r,e,n,i){for(const o of r)if(o.issues.length===0)return e.value=o.value,e;const t=r.filter(o=>!Et(o));return t.length===1?(e.value=t[0].value,t[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:n,errors:r.map(o=>o.issues.map(s=>Re(s,i,pe())))}),e)}const Ii=b("$ZodUnion",(r,e)=>{C.init(r,e),H(r._zod,"optin",()=>e.options.some(i=>i._zod.optin==="optional")?"optional":void 0),H(r._zod,"optout",()=>e.options.some(i=>i._zod.optout==="optional")?"optional":void 0),H(r._zod,"values",()=>{if(e.options.every(i=>i._zod.values))return new Set(e.options.flatMap(i=>Array.from(i._zod.values)))}),H(r._zod,"pattern",()=>{if(e.options.every(i=>i._zod.pattern)){const i=e.options.map(t=>t._zod.pattern);return new RegExp(`^(${i.map(t=>vi(t.source)).join("|")})$`)}});const n=e.options.length===1?e.options[0]._zod.run:null;r._zod.parse=(i,t)=>{if(n)return n(i,t);let o=!1;const s=[];for(const a of e.options){const c=a._zod.run({value:i.value,issues:[]},t);if(c instanceof Promise)s.push(c),o=!0;else{if(c.issues.length===0)return c;s.push(c)}}return o?Promise.all(s).then(a=>Hu(a,i,r,t)):Hu(s,i,r,t)}});function Zu(r,e,n,i){const t=r.filter(o=>o.issues.length===0);return t.length===1?(e.value=t[0].value,e):(t.length===0?e.issues.push({code:"invalid_union",input:e.value,inst:n,errors:r.map(o=>o.issues.map(s=>Re(s,i,pe())))}):e.issues.push({code:"invalid_union",input:e.value,inst:n,errors:[],inclusive:!1}),e)}const ch=b("$ZodXor",(r,e)=>{Ii.init(r,e),e.inclusive=!1;const n=e.options.length===1?e.options[0]._zod.run:null;r._zod.parse=(i,t)=>{if(n)return n(i,t);let o=!1;const s=[];for(const a of e.options){const c=a._zod.run({value:i.value,issues:[]},t);c instanceof Promise?(s.push(c),o=!0):s.push(c)}return o?Promise.all(s).then(a=>Zu(a,i,r,t)):Zu(s,i,r,t)}}),uh=b("$ZodDiscriminatedUnion",(r,e)=>{e.inclusive=!1,Ii.init(r,e);const n=r._zod.parse;H(r._zod,"propValues",()=>{const t={};for(const o of e.options){const s=o._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);for(const[a,c]of Object.entries(s)){t[a]||(t[a]=new Set);for(const u of c)t[a].add(u)}}return t});const i=Hn(()=>{const t=e.options,o=new Map;for(const s of t){const a=s._zod.propValues?.[e.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(const c of a){if(o.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);o.set(c,s)}}return o});r._zod.parse=(t,o)=>{const s=t.value;if(!en(s))return t.issues.push({code:"invalid_type",expected:"object",input:s,inst:r}),t;const a=i.value.get(s?.[e.discriminator]);return a?a._zod.run(t,o):e.unionFallback||o.direction==="backward"?n(t,o):(t.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,options:Array.from(i.value.keys()),input:s,path:[e.discriminator],inst:r}),t)}}),lh=b("$ZodIntersection",(r,e)=>{C.init(r,e),r._zod.parse=(n,i)=>{const t=n.value,o=e.left._zod.run({value:t,issues:[]},i),s=e.right._zod.run({value:t,issues:[]},i);return o instanceof Promise||s instanceof Promise?Promise.all([o,s]).then(([c,u])=>qu(n,c,u)):qu(n,o,s)}});function es(r,e){if(r===e)return{valid:!0,data:r};if(r instanceof Date&&e instanceof Date&&+r==+e)return{valid:!0,data:r};if(Dt(r)&&Dt(e)){const n=Object.keys(e),i=Object.keys(r).filter(o=>n.indexOf(o)!==-1),t={...r,...e};for(const o of i){const s=es(r[o],e[o]);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};t[o]=s.data}return{valid:!0,data:t}}if(Array.isArray(r)&&Array.isArray(e)){if(r.length!==e.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let i=0;i<r.length;i++){const t=r[i],o=e[i],s=es(t,o);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};n.push(s.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function qu(r,e,n){const i=new Map;let t;for(const a of e.issues)if(a.code==="unrecognized_keys"){t??(t=a);for(const c of a.keys)i.has(c)||i.set(c,{}),i.get(c).l=!0}else r.issues.push(a);for(const a of n.issues)if(a.code==="unrecognized_keys")for(const c of a.keys)i.has(c)||i.set(c,{}),i.get(c).r=!0;else r.issues.push(a);const o=[...i].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(o.length&&t&&r.issues.push({...t,keys:o}),Et(r))return r;const s=es(e.value,n.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return r.value=s.data,r}const Us=b("$ZodTuple",(r,e)=>{C.init(r,e);const n=e.items;r._zod.parse=(i,t)=>{const o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:r,expected:"tuple",code:"invalid_type"}),i;i.value=[];const s=[],a=Vu(n,"optin"),c=Vu(n,"optout");if(!e.rest){if(o.length<a)return i.issues.push({code:"too_small",minimum:a,inclusive:!0,input:o,inst:r,origin:"array"}),i;o.length>n.length&&i.issues.push({code:"too_big",maximum:n.length,inclusive:!0,input:o,inst:r,origin:"array"})}const u=new Array(n.length);for(let l=0;l<n.length;l++){const f=n[l]._zod.run({value:o[l],issues:[]},t);f instanceof Promise?s.push(f.then(d=>{u[l]=d})):u[l]=f}if(e.rest){let l=n.length-1;const f=o.slice(n.length);for(const d of f){l++;const h=e.rest._zod.run({value:d,issues:[]},t);h instanceof Promise?s.push(h.then(p=>Gu(p,i,l))):Gu(h,i,l)}}return s.length?Promise.all(s).then(()=>Ku(u,i,n,o,c)):Ku(u,i,n,o,c)}});function Vu(r,e){for(let n=r.length-1;n>=0;n--)if(r[n]._zod[e]!=="optional")return n+1;return 0}function Gu(r,e,n){r.issues.length&&e.issues.push(...He(n,r.issues)),e.value[n]=r.value}function Ku(r,e,n,i,t){for(let o=0;o<n.length;o++){const s=r[o],a=o<i.length;if(s.issues.length){if(!a&&o>=t){e.value.length=o;break}e.issues.push(...He(o,s.issues))}e.value[o]=s.value}for(let o=e.value.length-1;o>=i.length&&(n[o]._zod.optout==="optional"&&e.value[o]===void 0);o--)e.value.length=o;return e}const dh=b("$ZodRecord",(r,e)=>{C.init(r,e),r._zod.parse=(n,i)=>{const t=n.value;if(!Dt(t))return n.issues.push({expected:"record",code:"invalid_type",input:t,inst:r}),n;const o=[],s=e.keyType._zod.values;if(s){n.value={};const a=new Set;for(const u of s)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){a.add(typeof u=="number"?u.toString():u);const l=e.keyType._zod.run({value:u,issues:[]},i);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(l.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(h=>Re(h,i,pe())),input:u,path:[u],inst:r});continue}const f=l.value,d=e.valueType._zod.run({value:t[u],issues:[]},i);d instanceof Promise?o.push(d.then(h=>{h.issues.length&&n.issues.push(...He(u,h.issues)),n.value[f]=h.value})):(d.issues.length&&n.issues.push(...He(u,d.issues)),n.value[f]=d.value)}let c;for(const u in t)a.has(u)||(c=c??[],c.push(u));c&&c.length>0&&n.issues.push({code:"unrecognized_keys",input:t,inst:r,keys:c})}else{n.value={};for(const a of Reflect.ownKeys(t)){if(a==="__proto__"||!Object.prototype.propertyIsEnumerable.call(t,a))continue;let c=e.keyType._zod.run({value:a,issues:[]},i);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&Es.test(a)&&c.issues.length){const f=e.keyType._zod.run({value:Number(a),issues:[]},i);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");f.issues.length===0&&(c=f)}if(c.issues.length){e.mode==="loose"?n.value[a]=t[a]:n.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(f=>Re(f,i,pe())),input:a,path:[a],inst:r});continue}const l=e.valueType._zod.run({value:t[a],issues:[]},i);l instanceof Promise?o.push(l.then(f=>{f.issues.length&&n.issues.push(...He(a,f.issues)),n.value[c.value]=f.value})):(l.issues.length&&n.issues.push(...He(a,l.issues)),n.value[c.value]=l.value)}}return o.length?Promise.all(o).then(()=>n):n}}),fh=b("$ZodMap",(r,e)=>{C.init(r,e),r._zod.parse=(n,i)=>{const t=n.value;if(!(t instanceof Map))return n.issues.push({expected:"map",code:"invalid_type",input:t,inst:r}),n;const o=[];n.value=new Map;for(const[s,a]of t){const c=e.keyType._zod.run({value:s,issues:[]},i),u=e.valueType._zod.run({value:a,issues:[]},i);c instanceof Promise||u instanceof Promise?o.push(Promise.all([c,u]).then(([l,f])=>{Ju(l,f,n,s,t,r,i)})):Ju(c,u,n,s,t,r,i)}return o.length?Promise.all(o).then(()=>n):n}});function Ju(r,e,n,i,t,o,s){r.issues.length&&(ci.has(typeof i)?n.issues.push(...He(i,r.issues)):n.issues.push({code:"invalid_key",origin:"map",input:t,inst:o,issues:r.issues.map(a=>Re(a,s,pe()))})),e.issues.length&&(ci.has(typeof i)?n.issues.push(...He(i,e.issues)):n.issues.push({origin:"map",code:"invalid_element",input:t,inst:o,key:i,issues:e.issues.map(a=>Re(a,s,pe()))})),n.value.set(r.value,e.value)}const hh=b("$ZodSet",(r,e)=>{C.init(r,e),r._zod.parse=(n,i)=>{const t=n.value;if(!(t instanceof Set))return n.issues.push({input:t,inst:r,expected:"set",code:"invalid_type"}),n;const o=[];n.value=new Set;for(const s of t){const a=e.valueType._zod.run({value:s,issues:[]},i);a instanceof Promise?o.push(a.then(c=>Wu(c,n))):Wu(a,n)}return o.length?Promise.all(o).then(()=>n):n}});function Wu(r,e){r.issues.length&&e.issues.push(...r.issues),e.value.add(r.value)}const ph=b("$ZodEnum",(r,e)=>{C.init(r,e);const n=ls(e.entries),i=new Set(n);r._zod.values=i,r._zod.pattern=new RegExp(`^(${n.filter(t=>ci.has(typeof t)).map(t=>typeof t=="string"?st(t):t.toString()).join("|")})$`),r._zod.parse=(t,o)=>{const s=t.value;return i.has(s)||t.issues.push({code:"invalid_value",values:n,input:s,inst:r}),t}}),mh=b("$ZodLiteral",(r,e)=>{if(C.init(r,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(e.values);r._zod.values=n,r._zod.pattern=new RegExp(`^(${e.values.map(i=>typeof i=="string"?st(i):i?st(i.toString()):String(i)).join("|")})$`),r._zod.parse=(i,t)=>{const o=i.value;return n.has(o)||i.issues.push({code:"invalid_value",values:e.values,input:o,inst:r}),i}}),gh=b("$ZodFile",(r,e)=>{C.init(r,e),r._zod.parse=(n,i)=>{const t=n.value;return t instanceof File||n.issues.push({expected:"file",code:"invalid_type",input:t,inst:r}),n}}),bh=b("$ZodTransform",(r,e)=>{C.init(r,e),r._zod.optin="optional",r._zod.parse=(n,i)=>{if(i.direction==="backward")throw new bi(r.constructor.name);const t=e.transform(n.value,n);if(i.async)return(t instanceof Promise?t:Promise.resolve(t)).then(s=>(n.value=s,n.fallback=!0,n));if(t instanceof Promise)throw new zt;return n.value=t,n.fallback=!0,n}});function Xu(r,e){return e===void 0&&(r.issues.length||r.fallback)?{issues:[],value:void 0}:r}const Ds=b("$ZodOptional",(r,e)=>{C.init(r,e),r._zod.optin="optional",r._zod.optout="optional",H(r._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),H(r._zod,"pattern",()=>{const n=e.innerType._zod.pattern;return n?new RegExp(`^(${vi(n.source)})?$`):void 0}),r._zod.parse=(n,i)=>{if(e.innerType._zod.optin==="optional"){const t=n.value,o=e.innerType._zod.run(n,i);return o instanceof Promise?o.then(s=>Xu(s,t)):Xu(o,t)}return n.value===void 0?n:e.innerType._zod.run(n,i)}}),vh=b("$ZodExactOptional",(r,e)=>{Ds.init(r,e),H(r._zod,"values",()=>e.innerType._zod.values),H(r._zod,"pattern",()=>e.innerType._zod.pattern),r._zod.parse=(n,i)=>e.innerType._zod.run(n,i)}),yh=b("$ZodNullable",(r,e)=>{C.init(r,e),H(r._zod,"optin",()=>e.innerType._zod.optin),H(r._zod,"optout",()=>e.innerType._zod.optout),H(r._zod,"pattern",()=>{const n=e.innerType._zod.pattern;return n?new RegExp(`^(${vi(n.source)}|null)$`):void 0}),H(r._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),r._zod.parse=(n,i)=>n.value===null?n:e.innerType._zod.run(n,i)}),_h=b("$ZodDefault",(r,e)=>{C.init(r,e),r._zod.optin="optional",H(r._zod,"values",()=>e.innerType._zod.values),r._zod.parse=(n,i)=>{if(i.direction==="backward")return e.innerType._zod.run(n,i);if(n.value===void 0)return n.value=e.defaultValue,n;const t=e.innerType._zod.run(n,i);return t instanceof Promise?t.then(o=>Yu(o,e)):Yu(t,e)}});function Yu(r,e){return r.value===void 0&&(r.value=e.defaultValue),r}const xh=b("$ZodPrefault",(r,e)=>{C.init(r,e),r._zod.optin="optional",H(r._zod,"values",()=>e.innerType._zod.values),r._zod.parse=(n,i)=>(i.direction==="backward"||n.value===void 0&&(n.value=e.defaultValue),e.innerType._zod.run(n,i))}),wh=b("$ZodNonOptional",(r,e)=>{C.init(r,e),H(r._zod,"values",()=>{const n=e.innerType._zod.values;return n?new Set([...n].filter(i=>i!==void 0)):void 0}),r._zod.parse=(n,i)=>{const t=e.innerType._zod.run(n,i);return t instanceof Promise?t.then(o=>Qu(o,r)):Qu(t,r)}});function Qu(r,e){return!r.issues.length&&r.value===void 0&&r.issues.push({code:"invalid_type",expected:"nonoptional",input:r.value,inst:e}),r}const Sh=b("$ZodSuccess",(r,e)=>{C.init(r,e),r._zod.parse=(n,i)=>{if(i.direction==="backward")throw new bi("ZodSuccess");const t=e.innerType._zod.run(n,i);return t instanceof Promise?t.then(o=>(n.value=o.issues.length===0,n)):(n.value=t.issues.length===0,n)}}),kh=b("$ZodCatch",(r,e)=>{C.init(r,e),r._zod.optin="optional",H(r._zod,"optout",()=>e.innerType._zod.optout),H(r._zod,"values",()=>e.innerType._zod.values),r._zod.parse=(n,i)=>{if(i.direction==="backward")return e.innerType._zod.run(n,i);const t=e.innerType._zod.run(n,i);return t instanceof Promise?t.then(o=>(n.value=o.value,o.issues.length&&(n.value=e.catchValue({...n,error:{issues:o.issues.map(s=>Re(s,i,pe()))},input:n.value}),n.issues=[],n.fallback=!0),n)):(n.value=t.value,t.issues.length&&(n.value=e.catchValue({...n,error:{issues:t.issues.map(o=>Re(o,i,pe()))},input:n.value}),n.issues=[],n.fallback=!0),n)}}),Ih=b("$ZodNaN",(r,e)=>{C.init(r,e),r._zod.parse=(n,i)=>((typeof n.value!="number"||!Number.isNaN(n.value))&&n.issues.push({input:n.value,inst:r,expected:"nan",code:"invalid_type"}),n)}),Rs=b("$ZodPipe",(r,e)=>{C.init(r,e),H(r._zod,"values",()=>e.in._zod.values),H(r._zod,"optin",()=>e.in._zod.optin),H(r._zod,"optout",()=>e.out._zod.optout),H(r._zod,"propValues",()=>e.in._zod.propValues),r._zod.parse=(n,i)=>{if(i.direction==="backward"){const o=e.out._zod.run(n,i);return o instanceof Promise?o.then(s=>Jr(s,e.in,i)):Jr(o,e.in,i)}const t=e.in._zod.run(n,i);return t instanceof Promise?t.then(o=>Jr(o,e.out,i)):Jr(t,e.out,i)}});function Jr(r,e,n){return r.issues.length?(r.aborted=!0,r):e._zod.run({value:r.value,issues:r.issues,fallback:r.fallback},n)}const Cs=b("$ZodCodec",(r,e)=>{C.init(r,e),H(r._zod,"values",()=>e.in._zod.values),H(r._zod,"optin",()=>e.in._zod.optin),H(r._zod,"optout",()=>e.out._zod.optout),H(r._zod,"propValues",()=>e.in._zod.propValues),r._zod.parse=(n,i)=>{if((i.direction||"forward")==="forward"){const o=e.in._zod.run(n,i);return o instanceof Promise?o.then(s=>Wr(s,e,i)):Wr(o,e,i)}else{const o=e.out._zod.run(n,i);return o instanceof Promise?o.then(s=>Wr(s,e,i)):Wr(o,e,i)}}});function Wr(r,e,n){if(r.issues.length)return r.aborted=!0,r;if((n.direction||"forward")==="forward"){const t=e.transform(r.value,r);return t instanceof Promise?t.then(o=>Xr(r,o,e.out,n)):Xr(r,t,e.out,n)}else{const t=e.reverseTransform(r.value,r);return t instanceof Promise?t.then(o=>Xr(r,o,e.in,n)):Xr(r,t,e.in,n)}}function Xr(r,e,n,i){return r.issues.length?(r.aborted=!0,r):n._zod.run({value:e,issues:r.issues},i)}const $h=b("$ZodPreprocess",(r,e)=>{Rs.init(r,e)}),Eh=b("$ZodReadonly",(r,e)=>{C.init(r,e),H(r._zod,"propValues",()=>e.innerType._zod.propValues),H(r._zod,"values",()=>e.innerType._zod.values),H(r._zod,"optin",()=>e.innerType?._zod?.optin),H(r._zod,"optout",()=>e.innerType?._zod?.optout),r._zod.parse=(n,i)=>{if(i.direction==="backward")return e.innerType._zod.run(n,i);const t=e.innerType._zod.run(n,i);return t instanceof Promise?t.then(el):el(t)}});function el(r){return r.value=Object.freeze(r.value),r}const Th=b("$ZodTemplateLiteral",(r,e)=>{C.init(r,e);const n=[];for(const i of e.parts)if(typeof i=="object"&&i!==null){if(!i._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...i._zod.traits].shift()}`);const t=i._zod.pattern instanceof RegExp?i._zod.pattern.source:i._zod.pattern;if(!t)throw new Error(`Invalid template literal part: ${i._zod.traits}`);const o=t.startsWith("^")?1:0,s=t.endsWith("$")?t.length-1:t.length;n.push(t.slice(o,s))}else if(i===null||td.has(typeof i))n.push(st(`${i}`));else throw new Error(`Invalid template literal part: ${i}`);r._zod.pattern=new RegExp(`^${n.join("")}$`),r._zod.parse=(i,t)=>typeof i.value!="string"?(i.issues.push({input:i.value,inst:r,expected:"string",code:"invalid_type"}),i):(r._zod.pattern.lastIndex=0,r._zod.pattern.test(i.value)||i.issues.push({input:i.value,inst:r,code:"invalid_format",format:e.format??"template_literal",pattern:r._zod.pattern.source}),i)}),Oh=b("$ZodFunction",(r,e)=>(C.init(r,e),r._def=e,r._zod.def=e,r.implement=n=>{if(typeof n!="function")throw new Error("implement() must be called with a function");return function(...i){const t=r._def.input?Yo(r._def.input,i):i,o=Reflect.apply(n,this,t);return r._def.output?Yo(r._def.output,o):o}},r.implementAsync=n=>{if(typeof n!="function")throw new Error("implementAsync() must be called with a function");return async function(...i){const t=r._def.input?await Qo(r._def.input,i):i,o=await Reflect.apply(n,this,t);return r._def.output?await Qo(r._def.output,o):o}},r._zod.parse=(n,i)=>typeof n.value!="function"?(n.issues.push({code:"invalid_type",expected:"function",input:n.value,inst:r}),n):(r._def.output&&r._def.output._zod.def.type==="promise"?n.value=r.implementAsync(n.value):n.value=r.implement(n.value),n),r.input=(...n)=>{const i=r.constructor;return Array.isArray(n[0])?new i({type:"function",input:new Us({type:"tuple",items:n[0],rest:n[1]}),output:r._def.output}):new i({type:"function",input:n[0],output:r._def.output})},r.output=n=>{const i=r.constructor;return new i({type:"function",input:r._def.input,output:n})},r)),Ph=b("$ZodPromise",(r,e)=>{C.init(r,e),r._zod.parse=(n,i)=>Promise.resolve(n.value).then(t=>e.innerType._zod.run({value:t,issues:[]},i))}),zh=b("$ZodLazy",(r,e)=>{C.init(r,e),H(r._zod,"innerType",()=>{const n=e;return n._cachedInner||(n._cachedInner=e.getter()),n._cachedInner}),H(r._zod,"pattern",()=>r._zod.innerType?._zod?.pattern),H(r._zod,"propValues",()=>r._zod.innerType?._zod?.propValues),H(r._zod,"optin",()=>r._zod.innerType?._zod?.optin??void 0),H(r._zod,"optout",()=>r._zod.innerType?._zod?.optout??void 0),r._zod.parse=(n,i)=>r._zod.innerType._zod.run(n,i)}),Ah=b("$ZodCustom",(r,e)=>{ae.init(r,e),C.init(r,e),r._zod.parse=(n,i)=>n,r._zod.check=n=>{const i=n.value,t=e.fn(i);if(t instanceof Promise)return t.then(o=>tl(o,n,i,r));tl(t,n,i,r)}});function tl(r,e,n,i){if(!r){const t={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(t.params=i._zod.def.params),e.issues.push(tn(t))}}const Jb=()=>{const r={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function e(t){return r[t]??null}const n={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"},i={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{const o=i[t.expected]??t.expected,s=D(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`مدخلات غير مقبولة: يفترض إدخال instanceof ${t.expected}، ولكن تم إدخال ${a}`:`مدخلات غير مقبولة: يفترض إدخال ${o}، ولكن تم إدخال ${a}`}case"invalid_value":return t.values.length===1?`مدخلات غير مقبولة: يفترض إدخال ${U(t.values[0])}`:`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${I(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",s=e(t.origin);return s?` أكبر من اللازم: يفترض أن تكون ${t.origin??"القيمة"} ${o} ${t.maximum.toString()} ${s.unit??"عنصر"}`:`أكبر من اللازم: يفترض أن تكون ${t.origin??"القيمة"} ${o} ${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",s=e(t.origin);return s?`أصغر من اللازم: يفترض لـ ${t.origin} أن يكون ${o} ${t.minimum.toString()} ${s.unit}`:`أصغر من اللازم: يفترض لـ ${t.origin} أن يكون ${o} ${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`نَص غير مقبول: يجب أن يبدأ بـ "${t.prefix}"`:o.format==="ends_with"?`نَص غير مقبول: يجب أن ينتهي بـ "${o.suffix}"`:o.format==="includes"?`نَص غير مقبول: يجب أن يتضمَّن "${o.includes}"`:o.format==="regex"?`نَص غير مقبول: يجب أن يطابق النمط ${o.pattern}`:`${n[o.format]??t.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${t.divisor}`;case"unrecognized_keys":return`معرف${t.keys.length>1?"ات":""} غريب${t.keys.length>1?"ة":""}: ${I(t.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${t.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${t.origin}`;default:return"مدخل غير مقبول"}}};function Wb(){return{localeError:Jb()}}const Xb=()=>{const r={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function e(t){return r[t]??null}const n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{const o=i[t.expected]??t.expected,s=D(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Yanlış dəyər: gözlənilən instanceof ${t.expected}, daxil olan ${a}`:`Yanlış dəyər: gözlənilən ${o}, daxil olan ${a}`}case"invalid_value":return t.values.length===1?`Yanlış dəyər: gözlənilən ${U(t.values[0])}`:`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${I(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Çox böyük: gözlənilən ${t.origin??"dəyər"} ${o}${t.maximum.toString()} ${s.unit??"element"}`:`Çox böyük: gözlənilən ${t.origin??"dəyər"} ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",s=e(t.origin);return s?`Çox kiçik: gözlənilən ${t.origin} ${o}${t.minimum.toString()} ${s.unit}`:`Çox kiçik: gözlənilən ${t.origin} ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Yanlış mətn: "${o.prefix}" ilə başlamalıdır`:o.format==="ends_with"?`Yanlış mətn: "${o.suffix}" ilə bitməlidir`:o.format==="includes"?`Yanlış mətn: "${o.includes}" daxil olmalıdır`:o.format==="regex"?`Yanlış mətn: ${o.pattern} şablonuna uyğun olmalıdır`:`Yanlış ${n[o.format]??t.format}`}case"not_multiple_of":return`Yanlış ədəd: ${t.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${t.keys.length>1?"lar":""}: ${I(t.keys,", ")}`;case"invalid_key":return`${t.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${t.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function Yb(){return{localeError:Xb()}}function nl(r,e,n,i){const t=Math.abs(r),o=t%10,s=t%100;return s>=11&&s<=19?i:o===1?e:o>=2&&o<=4?n:i}const Qb=()=>{const r={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function e(t){return r[t]??null}const n={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"},i={nan:"NaN",number:"лік",array:"масіў"};return t=>{switch(t.code){case"invalid_type":{const o=i[t.expected]??t.expected,s=D(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Няправільны ўвод: чакаўся instanceof ${t.expected}, атрымана ${a}`:`Няправільны ўвод: чакаўся ${o}, атрымана ${a}`}case"invalid_value":return t.values.length===1?`Няправільны ўвод: чакалася ${U(t.values[0])}`:`Няправільны варыянт: чакаўся адзін з ${I(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",s=e(t.origin);if(s){const a=Number(t.maximum),c=nl(a,s.unit.one,s.unit.few,s.unit.many);return`Занадта вялікі: чакалася, што ${t.origin??"значэнне"} павінна ${s.verb} ${o}${t.maximum.toString()} ${c}`}return`Занадта вялікі: чакалася, што ${t.origin??"значэнне"} павінна быць ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",s=e(t.origin);if(s){const a=Number(t.minimum),c=nl(a,s.unit.one,s.unit.few,s.unit.many);return`Занадта малы: чакалася, што ${t.origin} павінна ${s.verb} ${o}${t.minimum.toString()} ${c}`}return`Занадта малы: чакалася, што ${t.origin} павінна быць ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Няправільны радок: павінен пачынацца з "${o.prefix}"`:o.format==="ends_with"?`Няправільны радок: павінен заканчвацца на "${o.suffix}"`:o.format==="includes"?`Няправільны радок: павінен змяшчаць "${o.includes}"`:o.format==="regex"?`Няправільны радок: павінен адпавядаць шаблону ${o.pattern}`:`Няправільны ${n[o.format]??t.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${t.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${t.keys.length>1?"ключы":"ключ"}: ${I(t.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${t.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${t.origin}`;default:return"Няправільны ўвод"}}};function ev(){return{localeError:Qb()}}const tv=()=>{const r={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"}};function e(t){return r[t]??null}const n={regex:"вход",email:"имейл адрес",url:"URL",emoji:"емоджи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO време",date:"ISO дата",time:"ISO време",duration:"ISO продължителност",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"base64-кодиран низ",base64url:"base64url-кодиран низ",json_string:"JSON низ",e164:"E.164 номер",jwt:"JWT",template_literal:"вход"},i={nan:"NaN",number:"число",array:"масив"};return t=>{switch(t.code){case"invalid_type":{const o=i[t.expected]??t.expected,s=D(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Невалиден вход: очакван instanceof ${t.expected}, получен ${a}`:`Невалиден вход: очакван ${o}, получен ${a}`}case"invalid_value":return t.values.length===1?`Невалиден вход: очакван ${U(t.values[0])}`:`Невалидна опция: очаквано едно от ${I(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Твърде голямо: очаква се ${t.origin??"стойност"} да съдържа ${o}${t.maximum.toString()} ${s.unit??"елемента"}`:`Твърде голямо: очаква се ${t.origin??"стойност"} да бъде ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",s=e(t.origin);return s?`Твърде малко: очаква се ${t.origin} да съдържа ${o}${t.minimum.toString()} ${s.unit}`:`Твърде малко: очаква се ${t.origin} да бъде ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;if(o.format==="starts_with")return`Невалиден низ: трябва да започва с "${o.prefix}"`;if(o.format==="ends_with")return`Невалиден низ: трябва да завършва с "${o.suffix}"`;if(o.format==="includes")return`Невалиден низ: трябва да включва "${o.includes}"`;if(o.format==="regex")return`Невалиден низ: трябва да съвпада с ${o.pattern}`;let s="Невалиден";return o.format==="emoji"&&(s="Невалидно"),o.format==="datetime"&&(s="Невалидно"),o.format==="date"&&(s="Невалидна"),o.format==="time"&&(s="Невалидно"),o.format==="duration"&&(s="Невалидна"),`${s} ${n[o.format]??t.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${t.divisor}`;case"unrecognized_keys":return`Неразпознат${t.keys.length>1?"и":""} ключ${t.keys.length>1?"ове":""}: ${I(t.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${t.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${t.origin}`;default:return"Невалиден вход"}}};function nv(){return{localeError:tv()}}const rv=()=>{const r={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function e(t){return r[t]??null}const n={regex:"entrada",email:"adreça electrònica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adreça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{const o=i[t.expected]??t.expected,s=D(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Tipus invàlid: s'esperava instanceof ${t.expected}, s'ha rebut ${a}`:`Tipus invàlid: s'esperava ${o}, s'ha rebut ${a}`}case"invalid_value":return t.values.length===1?`Valor invàlid: s'esperava ${U(t.values[0])}`:`Opció invàlida: s'esperava una de ${I(t.values," o ")}`;case"too_big":{const o=t.inclusive?"com a màxim":"menys de",s=e(t.origin);return s?`Massa gran: s'esperava que ${t.origin??"el valor"} contingués ${o} ${t.maximum.toString()} ${s.unit??"elements"}`:`Massa gran: s'esperava que ${t.origin??"el valor"} fos ${o} ${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?"com a mínim":"més de",s=e(t.origin);return s?`Massa petit: s'esperava que ${t.origin} contingués ${o} ${t.minimum.toString()} ${s.unit}`:`Massa petit: s'esperava que ${t.origin} fos ${o} ${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Format invàlid: ha de començar amb "${o.prefix}"`:o.format==="ends_with"?`Format invàlid: ha d'acabar amb "${o.suffix}"`:o.format==="includes"?`Format invàlid: ha d'incloure "${o.includes}"`:o.format==="regex"?`Format invàlid: ha de coincidir amb el patró ${o.pattern}`:`Format invàlid per a ${n[o.format]??t.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${t.divisor}`;case"unrecognized_keys":return`Clau${t.keys.length>1?"s":""} no reconeguda${t.keys.length>1?"s":""}: ${I(t.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${t.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${t.origin}`;default:return"Entrada invàlida"}}};function iv(){return{localeError:rv()}}const ov=()=>{const r={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}};function e(t){return r[t]??null}const n={regex:"regulární výraz",email:"e-mailová adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"},i={nan:"NaN",number:"číslo",string:"řetězec",function:"funkce",array:"pole"};return t=>{switch(t.code){case"invalid_type":{const o=i[t.expected]??t.expected,s=D(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Neplatný vstup: očekáváno instanceof ${t.expected}, obdrženo ${a}`:`Neplatný vstup: očekáváno ${o}, obdrženo ${a}`}case"invalid_value":return t.values.length===1?`Neplatný vstup: očekáváno ${U(t.values[0])}`:`Neplatná možnost: očekávána jedna z hodnot ${I(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Hodnota je příliš velká: ${t.origin??"hodnota"} musí mít ${o}${t.maximum.toString()} ${s.unit??"prvků"}`:`Hodnota je příliš velká: ${t.origin??"hodnota"} musí být ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",s=e(t.origin);return s?`Hodnota je příliš malá: ${t.origin??"hodnota"} musí mít ${o}${t.minimum.toString()} ${s.unit??"prvků"}`:`Hodnota je příliš malá: ${t.origin??"hodnota"} musí být ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Neplatný řetězec: musí začínat na "${o.prefix}"`:o.format==="ends_with"?`Neplatný řetězec: musí končit na "${o.suffix}"`:o.format==="includes"?`Neplatný řetězec: musí obsahovat "${o.includes}"`:o.format==="regex"?`Neplatný řetězec: musí odpovídat vzoru ${o.pattern}`:`Neplatný formát ${n[o.format]??t.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${t.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${I(t.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${t.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${t.origin}`;default:return"Neplatný vstup"}}};function sv(){return{localeError:ov()}}const av=()=>{const r={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function e(t){return r[t]??null}const n={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslæt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},i={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};return t=>{switch(t.code){case"invalid_type":{const o=i[t.expected]??t.expected,s=D(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Ugyldigt input: forventede instanceof ${t.expected}, fik ${a}`:`Ugyldigt input: forventede ${o}, fik ${a}`}case"invalid_value":return t.values.length===1?`Ugyldig værdi: forventede ${U(t.values[0])}`:`Ugyldigt valg: forventede en af følgende ${I(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",s=e(t.origin),a=i[t.origin]??t.origin;return s?`For stor: forventede ${a??"value"} ${s.verb} ${o} ${t.maximum.toString()} ${s.unit??"elementer"}`:`For stor: forventede ${a??"value"} havde ${o} ${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",s=e(t.origin),a=i[t.origin]??t.origin;return s?`For lille: forventede ${a} ${s.verb} ${o} ${t.minimum.toString()} ${s.unit}`:`For lille: forventede ${a} havde ${o} ${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Ugyldig streng: skal starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: skal ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: skal indeholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: skal matche mønsteret ${o.pattern}`:`Ugyldig ${n[o.format]??t.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${t.divisor}`;case"unrecognized_keys":return`${t.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${I(t.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${t.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${t.origin}`;default:return"Ugyldigt input"}}};function cv(){return{localeError:av()}}const uv=()=>{const r={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function e(t){return r[t]??null}const n={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},i={nan:"NaN",number:"Zahl",array:"Array"};return t=>{switch(t.code){case"invalid_type":{const o=i[t.expected]??t.expected,s=D(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Ungültige Eingabe: erwartet instanceof ${t.expected}, erhalten ${a}`:`Ungültige Eingabe: erwartet ${o}, erhalten ${a}`}case"invalid_value":return t.values.length===1?`Ungültige Eingabe: erwartet ${U(t.values[0])}`:`Ungültige Option: erwartet eine von ${I(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Zu groß: erwartet, dass ${t.origin??"Wert"} ${o}${t.maximum.toString()} ${s.unit??"Elemente"} hat`:`Zu groß: erwartet, dass ${t.origin??"Wert"} ${o}${t.maximum.toString()} ist`}case"too_small":{const o=t.inclusive?">=":">",s=e(t.origin);return s?`Zu klein: erwartet, dass ${t.origin} ${o}${t.minimum.toString()} ${s.unit} hat`:`Zu klein: erwartet, dass ${t.origin} ${o}${t.minimum.toString()} ist`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Ungültiger String: muss mit "${o.prefix}" beginnen`:o.format==="ends_with"?`Ungültiger String: muss mit "${o.suffix}" enden`:o.format==="includes"?`Ungültiger String: muss "${o.includes}" enthalten`:o.format==="regex"?`Ungültiger String: muss dem Muster ${o.pattern} entsprechen`:`Ungültig: ${n[o.format]??t.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${t.divisor} sein`;case"unrecognized_keys":return`${t.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${I(t.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${t.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${t.origin}`;default:return"Ungültige Eingabe"}}};function lv(){return{localeError:uv()}}const dv=()=>{const r={string:{unit:"χαρακτήρες",verb:"να έχει"},file:{unit:"bytes",verb:"να έχει"},array:{unit:"στοιχεία",verb:"να έχει"},set:{unit:"στοιχεία",verb:"να έχει"},map:{unit:"καταχωρήσεις",verb:"να έχει"}};function e(t){return r[t]??null}const n={regex:"είσοδος",email:"διεύθυνση email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO ημερομηνία και ώρα",date:"ISO ημερομηνία",time:"ISO ώρα",duration:"ISO διάρκεια",ipv4:"διεύθυνση IPv4",ipv6:"διεύθυνση IPv6",mac:"διεύθυνση MAC",cidrv4:"εύρος IPv4",cidrv6:"εύρος IPv6",base64:"συμβολοσειρά κωδικοποιημένη σε base64",base64url:"συμβολοσειρά κωδικοποιημένη σε base64url",json_string:"συμβολοσειρά JSON",e164:"αριθμός E.164",jwt:"JWT",template_literal:"είσοδος"},i={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{const o=i[t.expected]??t.expected,s=D(t.input),a=i[s]??s;return typeof t.expected=="string"&&/^[A-Z]/.test(t.expected)?`Μη έγκυρη είσοδος: αναμενόταν instanceof ${t.expected}, λήφθηκε ${a}`:`Μη έγκυρη είσοδος: αναμενόταν ${o}, λήφθηκε ${a}`}case"invalid_value":return t.values.length===1?`Μη έγκυρη είσοδος: αναμενόταν ${U(t.values[0])}`:`Μη έγκυρη επιλογή: αναμενόταν ένα από ${I(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Πολύ μεγάλο: αναμενόταν ${t.origin??"τιμή"} να έχει ${o}${t.maximum.toString()} ${s.unit??"στοιχεία"}`:`Πολύ μεγάλο: αναμενόταν ${t.origin??"τιμή"} να είναι ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",s=e(t.origin);return s?`Πολύ μικρό: αναμενόταν ${t.origin} να έχει ${o}${t.minimum.toString()} ${s.unit}`:`Πολύ μικρό: αναμενόταν ${t.origin} να είναι ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Μη έγκυρη συμβολοσειρά: πρέπει να ξεκινά με "${o.prefix}"`:o.format==="ends_with"?`Μη έγκυρη συμβολοσειρά: πρέπει να τελειώνει με "${o.suffix}"`:o.format==="includes"?`Μη έγκυρη συμβολοσειρά: πρέπει να περιέχει "${o.includes}"`:o.format==="regex"?`Μη έγκυρη συμβολοσειρά: πρέπει να ταιριάζει με το μοτίβο ${o.pattern}`:`Μη έγκυρο: ${n[o.format]??t.format}`}case"not_multiple_of":return`Μη έγκυρος αριθμός: πρέπει να είναι πολλαπλάσιο του ${t.divisor}`;case"unrecognized_keys":return`Άγνωστ${t.keys.length>1?"α":"ο"} κλειδ${t.keys.length>1?"ιά":"ί"}: ${I(t.keys,", ")}`;case"invalid_key":return`Μη έγκυρο κλειδί στο ${t.origin}`;case"invalid_union":return"Μη έγκυρη είσοδος";case"invalid_element":return`Μη έγκυρη τιμή στο ${t.origin}`;default:return"Μη έγκυρη είσοδος"}}};function fv(){return{localeError:dv()}}const hv=()=>{const r={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function e(t){return r[t]??null}const n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{const o=i[t.expected]??t.expected,s=D(t.input),a=i[s]??s;return`Invalid input: expected ${o}, received ${a}`}case"invalid_value":return t.values.length===1?`Invalid input: expected ${U(t.values[0])}`:`Invalid option: expected one of ${I(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Too big: expected ${t.origin??"value"} to have ${o}${t.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${t.origin??"value"} to be ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",s=e(t.origin);return s?`Too small: expected ${t.origin} to have ${o}${t.minimum.toString()} ${s.unit}`:`Too small: expected ${t.origin} to be ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${n[o.format]??t.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${t.divisor}`;case"unrecognized_keys":return`Unrecognized key${t.keys.length>1?"s":""}: ${I(t.keys,", ")}`;case"invalid_key":return`Invalid key in ${t.origin}`;case"invalid_union":return t.options&&Array.isArray(t.options)&&t.options.length>0?`Invalid discriminator value. Expected ${t.options.map(s=>`'${s}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${t.origin}`;default:return"Invalid input"}}};function Nh(){return{localeError:hv()}}const pv=()=>{const r={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(t){return r[t]??null}const n={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-daŭro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},i={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return t=>{switch(t.code){case"invalid_type":{const o=i[t.expected]??t.expected,s=D(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Nevalida enigo: atendiĝis instanceof ${t.expected}, riceviĝis ${a}`:`Nevalida enigo: atendiĝis ${o}, riceviĝis ${a}`}case"invalid_value":return t.values.length===1?`Nevalida enigo: atendiĝis ${U(t.values[0])}`:`Nevalida opcio: atendiĝis unu el ${I(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Tro granda: atendiĝis ke ${t.origin??"valoro"} havu ${o}${t.maximum.toString()} ${s.unit??"elementojn"}`:`Tro granda: atendiĝis ke ${t.origin??"valoro"} havu ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",s=e(t.origin);return s?`Tro malgranda: atendiĝis ke ${t.origin} havu ${o}${t.minimum.toString()} ${s.unit}`:`Tro malgranda: atendiĝis ke ${t.origin} estu ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Nevalida karaktraro: devas komenciĝi per "${o.prefix}"`:o.format==="ends_with"?`Nevalida karaktraro: devas finiĝi per "${o.suffix}"`:o.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${o.includes}"`:o.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${o.pattern}`:`Nevalida ${n[o.format]??t.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${t.divisor}`;case"unrecognized_keys":return`Nekonata${t.keys.length>1?"j":""} ŝlosilo${t.keys.length>1?"j":""}: ${I(t.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${t.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${t.origin}`;default:return"Nevalida enigo"}}};function mv(){return{localeError:pv()}}const gv=()=>{const r={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function e(t){return r[t]??null}const n={regex:"entrada",email:"dirección de correo electrónico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duración ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN",string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol:"símbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacío",never:"nunca",unknown:"desconocido",any:"cualquiera"};return t=>{switch(t.code){case"invalid_type":{const o=i[t.expected]??t.expected,s=D(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Entrada inválida: se esperaba instanceof ${t.expected}, recibido ${a}`:`Entrada inválida: se esperaba ${o}, recibido ${a}`}case"invalid_value":return t.values.length===1?`Entrada inválida: se esperaba ${U(t.values[0])}`:`Opción inválida: se esperaba una de ${I(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",s=e(t.origin),a=i[t.origin]??t.origin;return s?`Demasiado grande: se esperaba que ${a??"valor"} tuviera ${o}${t.maximum.toString()} ${s.unit??"elementos"}`:`Demasiado grande: se esperaba que ${a??"valor"} fuera ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",s=e(t.origin),a=i[t.origin]??t.origin;return s?`Demasiado pequeño: se esperaba que ${a} tuviera ${o}${t.minimum.toString()} ${s.unit}`:`Demasiado pequeño: se esperaba que ${a} fuera ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Cadena inválida: debe comenzar con "${o.prefix}"`:o.format==="ends_with"?`Cadena inválida: debe terminar en "${o.suffix}"`:o.format==="includes"?`Cadena inválida: debe incluir "${o.includes}"`:o.format==="regex"?`Cadena inválida: debe coincidir con el patrón ${o.pattern}`:`Inválido ${n[o.format]??t.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${t.divisor}`;case"unrecognized_keys":return`Llave${t.keys.length>1?"s":""} desconocida${t.keys.length>1?"s":""}: ${I(t.keys,", ")}`;case"invalid_key":return`Llave inválida en ${i[t.origin]??t.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${i[t.origin]??t.origin}`;default:return"Entrada inválida"}}};function bv(){return{localeError:gv()}}const vv=()=>{const r={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function e(t){return r[t]??null}const n={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"},i={nan:"NaN",number:"عدد",array:"آرایه"};return t=>{switch(t.code){case"invalid_type":{const o=i[t.expected]??t.expected,s=D(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`ورودی نامعتبر: می‌بایست instanceof ${t.expected} می‌بود، ${a} دریافت شد`:`ورودی نامعتبر: می‌بایست ${o} می‌بود، ${a} دریافت شد`}case"invalid_value":return t.values.length===1?`ورودی نامعتبر: می‌بایست ${U(t.values[0])} می‌بود`:`گزینه نامعتبر: می‌بایست یکی از ${I(t.values,"|")} می‌بود`;case"too_big":{const o=t.inclusive?"<=":"<",s=e(t.origin);return s?`خیلی بزرگ: ${t.origin??"مقدار"} باید ${o}${t.maximum.toString()} ${s.unit??"عنصر"} باشد`:`خیلی بزرگ: ${t.origin??"مقدار"} باید ${o}${t.maximum.toString()} باشد`}case"too_small":{const o=t.inclusive?">=":">",s=e(t.origin);return s?`خیلی کوچک: ${t.origin} باید ${o}${t.minimum.toString()} ${s.unit} باشد`:`خیلی کوچک: ${t.origin} باید ${o}${t.minimum.toString()} باشد`}case"invalid_format":{const o=t;return o.format==="starts_with"?`رشته نامعتبر: باید با "${o.prefix}" شروع شود`:o.format==="ends_with"?`رشته نامعتبر: باید با "${o.suffix}" تمام شود`:o.format==="includes"?`رشته نامعتبر: باید شامل "${o.includes}" باشد`:o.format==="regex"?`رشته نامعتبر: باید با الگوی ${o.pattern} مطابقت داشته باشد`:`${n[o.format]??t.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${t.divisor} باشد`;case"unrecognized_keys":return`کلید${t.keys.length>1?"های":""} ناشناس: ${I(t.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${t.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${t.origin}`;default:return"ورودی نامعتبر"}}};function yv(){return{localeError:vv()}}const _v=()=>{const r={string:{unit:"merkkiä",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"päivämäärän"}};function e(t){return r[t]??null}const n={regex:"säännöllinen lauseke",email:"sähköpostiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-päivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},i={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{const o=i[t.expected]??t.expected,s=D(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Virheellinen tyyppi: odotettiin instanceof ${t.expected}, oli ${a}`:`Virheellinen tyyppi: odotettiin ${o}, oli ${a}`}case"invalid_value":return t.values.length===1?`Virheellinen syöte: täytyy olla ${U(t.values[0])}`:`Virheellinen valinta: täytyy olla yksi seuraavista: ${I(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Liian suuri: ${s.subject} täytyy olla ${o}${t.maximum.toString()} ${s.unit}`.trim():`Liian suuri: arvon täytyy olla ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",s=e(t.origin);return s?`Liian pieni: ${s.subject} täytyy olla ${o}${t.minimum.toString()} ${s.unit}`.trim():`Liian pieni: arvon täytyy olla ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Virheellinen syöte: täytyy alkaa "${o.prefix}"`:o.format==="ends_with"?`Virheellinen syöte: täytyy loppua "${o.suffix}"`:o.format==="includes"?`Virheellinen syöte: täytyy sisältää "${o.includes}"`:o.format==="regex"?`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${o.pattern}`:`Virheellinen ${n[o.format]??t.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${t.divisor} monikerta`;case"unrecognized_keys":return`${t.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${I(t.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen syöte"}}};function xv(){return{localeError:_v()}}const wv=()=>{const r={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function e(t){return r[t]??null}const n={regex:"entrée",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},i={string:"chaîne",number:"nombre",int:"entier",boolean:"booléen",bigint:"grand entier",symbol:"symbole",undefined:"indéfini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"};return t=>{switch(t.code){case"invalid_type":{const o=i[t.expected]??t.expected,s=D(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Entrée invalide : instanceof ${t.expected} attendu, ${a} reçu`:`Entrée invalide : ${o} attendu, ${a} reçu`}case"invalid_value":return t.values.length===1?`Entrée invalide : ${U(t.values[0])} attendu`:`Option invalide : une valeur parmi ${I(t.values,"|")} attendue`;case"too_big":{const o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Trop grand : ${i[t.origin]??"valeur"} doit ${s.verb} ${o}${t.maximum.toString()} ${s.unit??"élément(s)"}`:`Trop grand : ${i[t.origin]??"valeur"} doit être ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",s=e(t.origin);return s?`Trop petit : ${i[t.origin]??"valeur"} doit ${s.verb} ${o}${t.minimum.toString()} ${s.unit}`:`Trop petit : ${i[t.origin]??"valeur"} doit être ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Chaîne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Chaîne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Chaîne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Chaîne invalide : doit correspondre au modèle ${o.pattern}`:`${n[o.format]??t.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${t.divisor}`;case"unrecognized_keys":return`Clé${t.keys.length>1?"s":""} non reconnue${t.keys.length>1?"s":""} : ${I(t.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${t.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${t.origin}`;default:return"Entrée invalide"}}};function Sv(){return{localeError:wv()}}const kv=()=>{const r={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function e(t){return r[t]??null}const n={regex:"entrée",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},i={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{const o=i[t.expected]??t.expected,s=D(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Entrée invalide : attendu instanceof ${t.expected}, reçu ${a}`:`Entrée invalide : attendu ${o}, reçu ${a}`}case"invalid_value":return t.values.length===1?`Entrée invalide : attendu ${U(t.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${I(t.values,"|")}`;case"too_big":{const o=t.inclusive?"≤":"<",s=e(t.origin);return s?`Trop grand : attendu que ${t.origin??"la valeur"} ait ${o}${t.maximum.toString()} ${s.unit}`:`Trop grand : attendu que ${t.origin??"la valeur"} soit ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?"≥":">",s=e(t.origin);return s?`Trop petit : attendu que ${t.origin} ait ${o}${t.minimum.toString()} ${s.unit}`:`Trop petit : attendu que ${t.origin} soit ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Chaîne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Chaîne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Chaîne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Chaîne invalide : doit correspondre au motif ${o.pattern}`:`${n[o.format]??t.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${t.divisor}`;case"unrecognized_keys":return`Clé${t.keys.length>1?"s":""} non reconnue${t.keys.length>1?"s":""} : ${I(t.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${t.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${t.origin}`;default:return"Entrée invalide"}}};function Iv(){return{localeError:kv()}}const $v=()=>{const r={string:{label:"מחרוזת",gender:"f"},number:{label:"מספר",gender:"m"},boolean:{label:"ערך בוליאני",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"תאריך",gender:"m"},array:{label:"מערך",gender:"m"},object:{label:"אובייקט",gender:"m"},null:{label:"ערך ריק (null)",gender:"m"},undefined:{label:"ערך לא מוגדר (undefined)",gender:"m"},symbol:{label:"סימבול (Symbol)",gender:"m"},function:{label:"פונקציה",gender:"f"},map:{label:"מפה (Map)",gender:"f"},set:{label:"קבוצה (Set)",gender:"f"},file:{label:"קובץ",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"ערך לא ידוע",gender:"m"},value:{label:"ערך",gender:"m"}},e={string:{unit:"תווים",shortLabel:"קצר",longLabel:"ארוך"},file:{unit:"בייטים",shortLabel:"קטן",longLabel:"גדול"},array:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},set:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},number:{unit:"",shortLabel:"קטן",longLabel:"גדול"}},n=u=>u?r[u]:void 0,i=u=>{const l=n(u);return l?l.label:u??r.unknown.label},t=u=>`ה${i(u)}`,o=u=>(n(u)?.gender??"m")==="f"?"צריכה להיות":"צריך להיות",s=u=>u?e[u]??null:null,a={regex:{label:"קלט",gender:"m"},email:{label:"כתובת אימייל",gender:"f"},url:{label:"כתובת רשת",gender:"f"},emoji:{label:"אימוג'י",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"תאריך וזמן ISO",gender:"m"},date:{label:"תאריך ISO",gender:"m"},time:{label:"זמן ISO",gender:"m"},duration:{label:"משך זמן ISO",gender:"m"},ipv4:{label:"כתובת IPv4",gender:"f"},ipv6:{label:"כתובת IPv6",gender:"f"},cidrv4:{label:"טווח IPv4",gender:"m"},cidrv6:{label:"טווח IPv6",gender:"m"},base64:{label:"מחרוזת בבסיס 64",gender:"f"},base64url:{label:"מחרוזת בבסיס 64 לכתובות רשת",gender:"f"},json_string:{label:"מחרוזת JSON",gender:"f"},e164:{label:"מספר E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"קלט",gender:"m"},includes:{label:"קלט",gender:"m"},lowercase:{label:"קלט",gender:"m"},starts_with:{label:"קלט",gender:"m"},uppercase:{label:"קלט",gender:"m"}},c={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{const l=u.expected,f=c[l??""]??i(l),d=D(u.input),h=c[d]??r[d]?.label??d;return/^[A-Z]/.test(u.expected)?`קלט לא תקין: צריך להיות instanceof ${u.expected}, התקבל ${h}`:`קלט לא תקין: צריך להיות ${f}, התקבל ${h}`}case"invalid_value":{if(u.values.length===1)return`ערך לא תקין: הערך חייב להיות ${U(u.values[0])}`;const l=u.values.map(h=>U(h));if(u.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${l[0]} או ${l[1]}`;const f=l[l.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${l.slice(0,-1).join(", ")} או ${f}`}case"too_big":{const l=s(u.origin),f=t(u.origin??"value");if(u.origin==="string")return`${l?.longLabel??"ארוך"} מדי: ${f} צריכה להכיל ${u.maximum.toString()} ${l?.unit??""} ${u.inclusive?"או פחות":"לכל היותר"}`.trim();if(u.origin==="number"){const p=u.inclusive?`קטן או שווה ל-${u.maximum}`:`קטן מ-${u.maximum}`;return`גדול מדי: ${f} צריך להיות ${p}`}if(u.origin==="array"||u.origin==="set"){const p=u.origin==="set"?"צריכה":"צריך",_=u.inclusive?`${u.maximum} ${l?.unit??""} או פחות`:`פחות מ-${u.maximum} ${l?.unit??""}`;return`גדול מדי: ${f} ${p} להכיל ${_}`.trim()}const d=u.inclusive?"<=":"<",h=o(u.origin??"value");return l?.unit?`${l.longLabel} מדי: ${f} ${h} ${d}${u.maximum.toString()} ${l.unit}`:`${l?.longLabel??"גדול"} מדי: ${f} ${h} ${d}${u.maximum.toString()}`}case"too_small":{const l=s(u.origin),f=t(u.origin??"value");if(u.origin==="string")return`${l?.shortLabel??"קצר"} מדי: ${f} צריכה להכיל ${u.minimum.toString()} ${l?.unit??""} ${u.inclusive?"או יותר":"לפחות"}`.trim();if(u.origin==="number"){const p=u.inclusive?`גדול או שווה ל-${u.minimum}`:`גדול מ-${u.minimum}`;return`קטן מדי: ${f} צריך להיות ${p}`}if(u.origin==="array"||u.origin==="set"){const p=u.origin==="set"?"צריכה":"צריך";if(u.minimum===1&&u.inclusive){const w=(u.origin==="set","לפחות פריט אחד");return`קטן מדי: ${f} ${p} להכיל ${w}`}const _=u.inclusive?`${u.minimum} ${l?.unit??""} או יותר`:`יותר מ-${u.minimum} ${l?.unit??""}`;return`קטן מדי: ${f} ${p} להכיל ${_}`.trim()}const d=u.inclusive?">=":">",h=o(u.origin??"value");return l?.unit?`${l.shortLabel} מדי: ${f} ${h} ${d}${u.minimum.toString()} ${l.unit}`:`${l?.shortLabel??"קטן"} מדי: ${f} ${h} ${d}${u.minimum.toString()}`}case"invalid_format":{const l=u;if(l.format==="starts_with")return`המחרוזת חייבת להתחיל ב "${l.prefix}"`;if(l.format==="ends_with")return`המחרוזת חייבת להסתיים ב "${l.suffix}"`;if(l.format==="includes")return`המחרוזת חייבת לכלול "${l.includes}"`;if(l.format==="regex")return`המחרוזת חייבת להתאים לתבנית ${l.pattern}`;const f=a[l.format],d=f?.label??l.format,p=(f?.gender??"m")==="f"?"תקינה":"תקין";return`${d} לא ${p}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${u.divisor}`;case"unrecognized_keys":return`מפתח${u.keys.length>1?"ות":""} לא מזוה${u.keys.length>1?"ים":"ה"}: ${I(u.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${t(u.origin??"array")}`;default:return"קלט לא תקין"}}};function Ev(){return{localeError:$v()}}const Tv=()=>{const r={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function e(t){return r[t]??null}const n={regex:"unos",email:"email adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},i={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return t=>{switch(t.code){case"invalid_type":{const o=i[t.expected]??t.expected,s=D(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Neispravan unos: očekuje se instanceof ${t.expected}, a primljeno je ${a}`:`Neispravan unos: očekuje se ${o}, a primljeno je ${a}`}case"invalid_value":return t.values.length===1?`Neispravna vrijednost: očekivano ${U(t.values[0])}`:`Neispravna opcija: očekivano jedno od ${I(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",s=e(t.origin),a=i[t.origin]??t.origin;return s?`Preveliko: očekivano da ${a??"vrijednost"} ima ${o}${t.maximum.toString()} ${s.unit??"elemenata"}`:`Preveliko: očekivano da ${a??"vrijednost"} bude ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",s=e(t.origin),a=i[t.origin]??t.origin;return s?`Premalo: očekivano da ${a} ima ${o}${t.minimum.toString()} ${s.unit}`:`Premalo: očekivano da ${a} bude ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Neispravan tekst: mora započinjati s "${o.prefix}"`:o.format==="ends_with"?`Neispravan tekst: mora završavati s "${o.suffix}"`:o.format==="includes"?`Neispravan tekst: mora sadržavati "${o.includes}"`:o.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${o.pattern}`:`Neispravna ${n[o.format]??t.format}`}case"not_multiple_of":return`Neispravan broj: mora biti višekratnik od ${t.divisor}`;case"unrecognized_keys":return`Neprepoznat${t.keys.length>1?"i ključevi":" ključ"}: ${I(t.keys,", ")}`;case"invalid_key":return`Neispravan ključ u ${i[t.origin]??t.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${i[t.origin]??t.origin}`;default:return"Neispravan unos"}}};function Ov(){return{localeError:Tv()}}const Pv=()=>{const r={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(t){return r[t]??null}const n={regex:"bemenet",email:"email cím",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO időbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"},i={nan:"NaN",number:"szám",array:"tömb"};return t=>{switch(t.code){case"invalid_type":{const o=i[t.expected]??t.expected,s=D(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Érvénytelen bemenet: a várt érték instanceof ${t.expected}, a kapott érték ${a}`:`Érvénytelen bemenet: a várt érték ${o}, a kapott érték ${a}`}case"invalid_value":return t.values.length===1?`Érvénytelen bemenet: a várt érték ${U(t.values[0])}`:`Érvénytelen opció: valamelyik érték várt ${I(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Túl nagy: ${t.origin??"érték"} mérete túl nagy ${o}${t.maximum.toString()} ${s.unit??"elem"}`:`Túl nagy: a bemeneti érték ${t.origin??"érték"} túl nagy: ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",s=e(t.origin);return s?`Túl kicsi: a bemeneti érték ${t.origin} mérete túl kicsi ${o}${t.minimum.toString()} ${s.unit}`:`Túl kicsi: a bemeneti érték ${t.origin} túl kicsi ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Érvénytelen string: "${o.prefix}" értékkel kell kezdődnie`:o.format==="ends_with"?`Érvénytelen string: "${o.suffix}" értékkel kell végződnie`:o.format==="includes"?`Érvénytelen string: "${o.includes}" értéket kell tartalmaznia`:o.format==="regex"?`Érvénytelen string: ${o.pattern} mintának kell megfelelnie`:`Érvénytelen ${n[o.format]??t.format}`}case"not_multiple_of":return`Érvénytelen szám: ${t.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${t.keys.length>1?"s":""}: ${I(t.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${t.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${t.origin}`;default:return"Érvénytelen bemenet"}}};function zv(){return{localeError:Pv()}}function rl(r,e,n){return Math.abs(r)===1?e:n}function Kt(r){if(!r)return"";const e=["ա","ե","ը","ի","ո","ու","օ"],n=r[r.length-1];return r+(e.includes(n)?"ն":"ը")}const Av=()=>{const r={string:{unit:{one:"նշան",many:"նշաններ"},verb:"ունենալ"},file:{unit:{one:"բայթ",many:"բայթեր"},verb:"ունենալ"},array:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"},set:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"}};function e(t){return r[t]??null}const n={regex:"մուտք",email:"էլ. հասցե",url:"URL",emoji:"էմոջի",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO ամսաթիվ և ժամ",date:"ISO ամսաթիվ",time:"ISO ժամ",duration:"ISO տևողություն",ipv4:"IPv4 հասցե",ipv6:"IPv6 հասցե",cidrv4:"IPv4 միջակայք",cidrv6:"IPv6 միջակայք",base64:"base64 ձևաչափով տող",base64url:"base64url ձևաչափով տող",json_string:"JSON տող",e164:"E.164 համար",jwt:"JWT",template_literal:"մուտք"},i={nan:"NaN",number:"թիվ",array:"զանգված"};return t=>{switch(t.code){case"invalid_type":{const o=i[t.expected]??t.expected,s=D(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Սխալ մուտքագրում․ սպասվում էր instanceof ${t.expected}, ստացվել է ${a}`:`Սխալ մուտքագրում․ սպասվում էր ${o}, ստացվել է ${a}`}case"invalid_value":return t.values.length===1?`Սխալ մուտքագրում․ սպասվում էր ${U(t.values[1])}`:`Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${I(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",s=e(t.origin);if(s){const a=Number(t.maximum),c=rl(a,s.unit.one,s.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${Kt(t.origin??"արժեք")} կունենա ${o}${t.maximum.toString()} ${c}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${Kt(t.origin??"արժեք")} լինի ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",s=e(t.origin);if(s){const a=Number(t.minimum),c=rl(a,s.unit.one,s.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${Kt(t.origin)} կունենա ${o}${t.minimum.toString()} ${c}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${Kt(t.origin)} լինի ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Սխալ տող․ պետք է սկսվի "${o.prefix}"-ով`:o.format==="ends_with"?`Սխալ տող․ պետք է ավարտվի "${o.suffix}"-ով`:o.format==="includes"?`Սխալ տող․ պետք է պարունակի "${o.includes}"`:o.format==="regex"?`Սխալ տող․ պետք է համապատասխանի ${o.pattern} ձևաչափին`:`Սխալ ${n[o.format]??t.format}`}case"not_multiple_of":return`Սխալ թիվ․ պետք է բազմապատիկ լինի ${t.divisor}-ի`;case"unrecognized_keys":return`Չճանաչված բանալի${t.keys.length>1?"ներ":""}. ${I(t.keys,", ")}`;case"invalid_key":return`Սխալ բանալի ${Kt(t.origin)}-ում`;case"invalid_union":return"Սխալ մուտքագրում";case"invalid_element":return`Սխալ արժեք ${Kt(t.origin)}-ում`;default:return"Սխալ մուտքագրում"}}};function Nv(){return{localeError:Av()}}const Uv=()=>{const r={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(t){return r[t]??null}const n={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{const o=i[t.expected]??t.expected,s=D(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Input tidak valid: diharapkan instanceof ${t.expected}, diterima ${a}`:`Input tidak valid: diharapkan ${o}, diterima ${a}`}case"invalid_value":return t.values.length===1?`Input tidak valid: diharapkan ${U(t.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${I(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Terlalu besar: diharapkan ${t.origin??"value"} memiliki ${o}${t.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: diharapkan ${t.origin??"value"} menjadi ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",s=e(t.origin);return s?`Terlalu kecil: diharapkan ${t.origin} memiliki ${o}${t.minimum.toString()} ${s.unit}`:`Terlalu kecil: diharapkan ${t.origin} menjadi ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`String tidak valid: harus dimulai dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak valid: harus berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak valid: harus menyertakan "${o.includes}"`:o.format==="regex"?`String tidak valid: harus sesuai pola ${o.pattern}`:`${n[o.format]??t.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${t.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${t.keys.length>1?"s":""}: ${I(t.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${t.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${t.origin}`;default:return"Input tidak valid"}}};function Dv(){return{localeError:Uv()}}const Rv=()=>{const r={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"}};function e(t){return r[t]??null}const n={regex:"gildi",email:"netfang",url:"vefslóð",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og tími",date:"ISO dagsetning",time:"ISO tími",duration:"ISO tímalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 tölugildi",jwt:"JWT",template_literal:"gildi"},i={nan:"NaN",number:"númer",array:"fylki"};return t=>{switch(t.code){case"invalid_type":{const o=i[t.expected]??t.expected,s=D(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Rangt gildi: Þú slóst inn ${a} þar sem á að vera instanceof ${t.expected}`:`Rangt gildi: Þú slóst inn ${a} þar sem á að vera ${o}`}case"invalid_value":return t.values.length===1?`Rangt gildi: gert ráð fyrir ${U(t.values[0])}`:`Ógilt val: má vera eitt af eftirfarandi ${I(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Of stórt: gert er ráð fyrir að ${t.origin??"gildi"} hafi ${o}${t.maximum.toString()} ${s.unit??"hluti"}`:`Of stórt: gert er ráð fyrir að ${t.origin??"gildi"} sé ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",s=e(t.origin);return s?`Of lítið: gert er ráð fyrir að ${t.origin} hafi ${o}${t.minimum.toString()} ${s.unit}`:`Of lítið: gert er ráð fyrir að ${t.origin} sé ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Ógildur strengur: verður að byrja á "${o.prefix}"`:o.format==="ends_with"?`Ógildur strengur: verður að enda á "${o.suffix}"`:o.format==="includes"?`Ógildur strengur: verður að innihalda "${o.includes}"`:o.format==="regex"?`Ógildur strengur: verður að fylgja mynstri ${o.pattern}`:`Rangt ${n[o.format]??t.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${t.divisor}`;case"unrecognized_keys":return`Óþekkt ${t.keys.length>1?"ir lyklar":"ur lykill"}: ${I(t.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${t.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${t.origin}`;default:return"Rangt gildi"}}};function Cv(){return{localeError:Rv()}}const Lv=()=>{const r={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(t){return r[t]??null}const n={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"numero",array:"vettore"};return t=>{switch(t.code){case"invalid_type":{const o=i[t.expected]??t.expected,s=D(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Input non valido: atteso instanceof ${t.expected}, ricevuto ${a}`:`Input non valido: atteso ${o}, ricevuto ${a}`}case"invalid_value":return t.values.length===1?`Input non valido: atteso ${U(t.values[0])}`:`Opzione non valida: atteso uno tra ${I(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Troppo grande: ${t.origin??"valore"} deve avere ${o}${t.maximum.toString()} ${s.unit??"elementi"}`:`Troppo grande: ${t.origin??"valore"} deve essere ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",s=e(t.origin);return s?`Troppo piccolo: ${t.origin} deve avere ${o}${t.minimum.toString()} ${s.unit}`:`Troppo piccolo: ${t.origin} deve essere ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Stringa non valida: deve iniziare con "${o.prefix}"`:o.format==="ends_with"?`Stringa non valida: deve terminare con "${o.suffix}"`:o.format==="includes"?`Stringa non valida: deve includere "${o.includes}"`:o.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${o.pattern}`:`Input non valido: ${n[o.format]??t.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${t.divisor}`;case"unrecognized_keys":return`Chiav${t.keys.length>1?"i":"e"} non riconosciut${t.keys.length>1?"e":"a"}: ${I(t.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${t.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${t.origin}`;default:return"Input non valido"}}};function Mv(){return{localeError:Lv()}}const jv=()=>{const r={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function e(t){return r[t]??null}const n={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"},i={nan:"NaN",number:"数値",array:"配列"};return t=>{switch(t.code){case"invalid_type":{const o=i[t.expected]??t.expected,s=D(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`無効な入力: instanceof ${t.expected}が期待されましたが、${a}が入力されました`:`無効な入力: ${o}が期待されましたが、${a}が入力されました`}case"invalid_value":return t.values.length===1?`無効な入力: ${U(t.values[0])}が期待されました`:`無効な選択: ${I(t.values,"、")}のいずれかである必要があります`;case"too_big":{const o=t.inclusive?"以下である":"より小さい",s=e(t.origin);return s?`大きすぎる値: ${t.origin??"値"}は${t.maximum.toString()}${s.unit??"要素"}${o}必要があります`:`大きすぎる値: ${t.origin??"値"}は${t.maximum.toString()}${o}必要があります`}case"too_small":{const o=t.inclusive?"以上である":"より大きい",s=e(t.origin);return s?`小さすぎる値: ${t.origin}は${t.minimum.toString()}${s.unit}${o}必要があります`:`小さすぎる値: ${t.origin}は${t.minimum.toString()}${o}必要があります`}case"invalid_format":{const o=t;return o.format==="starts_with"?`無効な文字列: "${o.prefix}"で始まる必要があります`:o.format==="ends_with"?`無効な文字列: "${o.suffix}"で終わる必要があります`:o.format==="includes"?`無効な文字列: "${o.includes}"を含む必要があります`:o.format==="regex"?`無効な文字列: パターン${o.pattern}に一致する必要があります`:`無効な${n[o.format]??t.format}`}case"not_multiple_of":return`無効な数値: ${t.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${t.keys.length>1?"群":""}: ${I(t.keys,"、")}`;case"invalid_key":return`${t.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${t.origin}内の無効な値`;default:return"無効な入力"}}};function Bv(){return{localeError:jv()}}const Fv=()=>{const r={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function e(t){return r[t]??null}const n={regex:"შეყვანა",email:"ელ-ფოსტის მისამართი",url:"URL",emoji:"ემოჯი",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"თარიღი-დრო",date:"თარიღი",time:"დრო",duration:"ხანგრძლივობა",ipv4:"IPv4 მისამართი",ipv6:"IPv6 მისამართი",cidrv4:"IPv4 დიაპაზონი",cidrv6:"IPv6 დიაპაზონი",base64:"base64-კოდირებული ველი",base64url:"base64url-კოდირებული ველი",json_string:"JSON ველი",e164:"E.164 ნომერი",jwt:"JWT",template_literal:"შეყვანა"},i={nan:"NaN",number:"რიცხვი",string:"ველი",boolean:"ბულეანი",function:"ფუნქცია",array:"მასივი"};return t=>{switch(t.code){case"invalid_type":{const o=i[t.expected]??t.expected,s=D(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`არასწორი შეყვანა: მოსალოდნელი instanceof ${t.expected}, მიღებული ${a}`:`არასწორი შეყვანა: მოსალოდნელი ${o}, მიღებული ${a}`}case"invalid_value":return t.values.length===1?`არასწორი შეყვანა: მოსალოდნელი ${U(t.values[0])}`:`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${I(t.values,"|")}-დან`;case"too_big":{const o=t.inclusive?"<=":"<",s=e(t.origin);return s?`ზედმეტად დიდი: მოსალოდნელი ${t.origin??"მნიშვნელობა"} ${s.verb} ${o}${t.maximum.toString()} ${s.unit}`:`ზედმეტად დიდი: მოსალოდნელი ${t.origin??"მნიშვნელობა"} იყოს ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",s=e(t.origin);return s?`ზედმეტად პატარა: მოსალოდნელი ${t.origin} ${s.verb} ${o}${t.minimum.toString()} ${s.unit}`:`ზედმეტად პატარა: მოსალოდნელი ${t.origin} იყოს ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`არასწორი ველი: უნდა იწყებოდეს "${o.prefix}"-ით`:o.format==="ends_with"?`არასწორი ველი: უნდა მთავრდებოდეს "${o.suffix}"-ით`:o.format==="includes"?`არასწორი ველი: უნდა შეიცავდეს "${o.includes}"-ს`:o.format==="regex"?`არასწორი ველი: უნდა შეესაბამებოდეს შაბლონს ${o.pattern}`:`არასწორი ${n[o.format]??t.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${t.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${t.keys.length>1?"ები":"ი"}: ${I(t.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${t.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${t.origin}-ში`;default:return"არასწორი შეყვანა"}}};function Hv(){return{localeError:Fv()}}const Zv=()=>{const r={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function e(t){return r[t]??null}const n={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"},i={nan:"NaN",number:"លេខ",array:"អារេ (Array)",null:"គ្មានតម្លៃ (null)"};return t=>{switch(t.code){case"invalid_type":{const o=i[t.expected]??t.expected,s=D(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${t.expected} ប៉ុន្តែទទួលបាន ${a}`:`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${o} ប៉ុន្តែទទួលបាន ${a}`}case"invalid_value":return t.values.length===1?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${U(t.values[0])}`:`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${I(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",s=e(t.origin);return s?`ធំពេក៖ ត្រូវការ ${t.origin??"តម្លៃ"} ${o} ${t.maximum.toString()} ${s.unit??"ធាតុ"}`:`ធំពេក៖ ត្រូវការ ${t.origin??"តម្លៃ"} ${o} ${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",s=e(t.origin);return s?`តូចពេក៖ ត្រូវការ ${t.origin} ${o} ${t.minimum.toString()} ${s.unit}`:`តូចពេក៖ ត្រូវការ ${t.origin} ${o} ${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${o.prefix}"`:o.format==="ends_with"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${o.suffix}"`:o.format==="includes"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${o.includes}"`:o.format==="regex"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${o.pattern}`:`មិនត្រឹមត្រូវ៖ ${n[o.format]??t.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${t.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${I(t.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${t.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${t.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function Uh(){return{localeError:Zv()}}function qv(){return Uh()}const Vv=()=>{const r={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function e(t){return r[t]??null}const n={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"},i={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{const o=i[t.expected]??t.expected,s=D(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`잘못된 입력: 예상 타입은 instanceof ${t.expected}, 받은 타입은 ${a}입니다`:`잘못된 입력: 예상 타입은 ${o}, 받은 타입은 ${a}입니다`}case"invalid_value":return t.values.length===1?`잘못된 입력: 값은 ${U(t.values[0])} 이어야 합니다`:`잘못된 옵션: ${I(t.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{const o=t.inclusive?"이하":"미만",s=o==="미만"?"이어야 합니다":"여야 합니다",a=e(t.origin),c=a?.unit??"요소";return a?`${t.origin??"값"}이 너무 큽니다: ${t.maximum.toString()}${c} ${o}${s}`:`${t.origin??"값"}이 너무 큽니다: ${t.maximum.toString()} ${o}${s}`}case"too_small":{const o=t.inclusive?"이상":"초과",s=o==="이상"?"이어야 합니다":"여야 합니다",a=e(t.origin),c=a?.unit??"요소";return a?`${t.origin??"값"}이 너무 작습니다: ${t.minimum.toString()}${c} ${o}${s}`:`${t.origin??"값"}이 너무 작습니다: ${t.minimum.toString()} ${o}${s}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`잘못된 문자열: "${o.prefix}"(으)로 시작해야 합니다`:o.format==="ends_with"?`잘못된 문자열: "${o.suffix}"(으)로 끝나야 합니다`:o.format==="includes"?`잘못된 문자열: "${o.includes}"을(를) 포함해야 합니다`:o.format==="regex"?`잘못된 문자열: 정규식 ${o.pattern} 패턴과 일치해야 합니다`:`잘못된 ${n[o.format]??t.format}`}case"not_multiple_of":return`잘못된 숫자: ${t.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${I(t.keys,", ")}`;case"invalid_key":return`잘못된 키: ${t.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${t.origin}`;default:return"잘못된 입력"}}};function Gv(){return{localeError:Vv()}}const On=r=>r.charAt(0).toUpperCase()+r.slice(1);function il(r){const e=Math.abs(r),n=e%10,i=e%100;return i>=11&&i<=19||n===0?"many":n===1?"one":"few"}const Kv=()=>{const r={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};function e(t,o,s,a){const c=r[t]??null;return c===null?c:{unit:c.unit[o],verb:c.verb[a][s?"inclusive":"notInclusive"]}}const n={regex:"įvestis",email:"el. pašto adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukmė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",jwt:"JWT",template_literal:"įvestis"},i={nan:"NaN",number:"skaičius",bigint:"sveikasis skaičius",string:"eilutė",boolean:"loginė reikšmė",undefined:"neapibrėžta reikšmė",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulinė reikšmė"};return t=>{switch(t.code){case"invalid_type":{const o=i[t.expected]??t.expected,s=D(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Gautas tipas ${a}, o tikėtasi - instanceof ${t.expected}`:`Gautas tipas ${a}, o tikėtasi - ${o}`}case"invalid_value":return t.values.length===1?`Privalo būti ${U(t.values[0])}`:`Privalo būti vienas iš ${I(t.values,"|")} pasirinkimų`;case"too_big":{const o=i[t.origin]??t.origin,s=e(t.origin,il(Number(t.maximum)),t.inclusive??!1,"smaller");if(s?.verb)return`${On(o??t.origin??"reikšmė")} ${s.verb} ${t.maximum.toString()} ${s.unit??"elementų"}`;const a=t.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${On(o??t.origin??"reikšmė")} turi būti ${a} ${t.maximum.toString()} ${s?.unit}`}case"too_small":{const o=i[t.origin]??t.origin,s=e(t.origin,il(Number(t.minimum)),t.inclusive??!1,"bigger");if(s?.verb)return`${On(o??t.origin??"reikšmė")} ${s.verb} ${t.minimum.toString()} ${s.unit??"elementų"}`;const a=t.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${On(o??t.origin??"reikšmė")} turi būti ${a} ${t.minimum.toString()} ${s?.unit}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Eilutė privalo prasidėti "${o.prefix}"`:o.format==="ends_with"?`Eilutė privalo pasibaigti "${o.suffix}"`:o.format==="includes"?`Eilutė privalo įtraukti "${o.includes}"`:o.format==="regex"?`Eilutė privalo atitikti ${o.pattern}`:`Neteisingas ${n[o.format]??t.format}`}case"not_multiple_of":return`Skaičius privalo būti ${t.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${t.keys.length>1?"i":"as"} rakt${t.keys.length>1?"ai":"as"}: ${I(t.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{const o=i[t.origin]??t.origin;return`${On(o??t.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function Jv(){return{localeError:Kv()}}const Wv=()=>{const r={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function e(t){return r[t]??null}const n={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"},i={nan:"NaN",number:"број",array:"низа"};return t=>{switch(t.code){case"invalid_type":{const o=i[t.expected]??t.expected,s=D(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Грешен внес: се очекува instanceof ${t.expected}, примено ${a}`:`Грешен внес: се очекува ${o}, примено ${a}`}case"invalid_value":return t.values.length===1?`Invalid input: expected ${U(t.values[0])}`:`Грешана опција: се очекува една ${I(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Премногу голем: се очекува ${t.origin??"вредноста"} да има ${o}${t.maximum.toString()} ${s.unit??"елементи"}`:`Премногу голем: се очекува ${t.origin??"вредноста"} да биде ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",s=e(t.origin);return s?`Премногу мал: се очекува ${t.origin} да има ${o}${t.minimum.toString()} ${s.unit}`:`Премногу мал: се очекува ${t.origin} да биде ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Неважечка низа: мора да започнува со "${o.prefix}"`:o.format==="ends_with"?`Неважечка низа: мора да завршува со "${o.suffix}"`:o.format==="includes"?`Неважечка низа: мора да вклучува "${o.includes}"`:o.format==="regex"?`Неважечка низа: мора да одгоара на патернот ${o.pattern}`:`Invalid ${n[o.format]??t.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${t.divisor}`;case"unrecognized_keys":return`${t.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${I(t.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${t.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${t.origin}`;default:return"Грешен внес"}}};function Xv(){return{localeError:Wv()}}const Yv=()=>{const r={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(t){return r[t]??null}const n={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"nombor"};return t=>{switch(t.code){case"invalid_type":{const o=i[t.expected]??t.expected,s=D(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Input tidak sah: dijangka instanceof ${t.expected}, diterima ${a}`:`Input tidak sah: dijangka ${o}, diterima ${a}`}case"invalid_value":return t.values.length===1?`Input tidak sah: dijangka ${U(t.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${I(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Terlalu besar: dijangka ${t.origin??"nilai"} ${s.verb} ${o}${t.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: dijangka ${t.origin??"nilai"} adalah ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",s=e(t.origin);return s?`Terlalu kecil: dijangka ${t.origin} ${s.verb} ${o}${t.minimum.toString()} ${s.unit}`:`Terlalu kecil: dijangka ${t.origin} adalah ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`String tidak sah: mesti bermula dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak sah: mesti mengandungi "${o.includes}"`:o.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${o.pattern}`:`${n[o.format]??t.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${t.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${I(t.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${t.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${t.origin}`;default:return"Input tidak sah"}}};function Qv(){return{localeError:Yv()}}const e1=()=>{const r={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function e(t){return r[t]??null}const n={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},i={nan:"NaN",number:"getal"};return t=>{switch(t.code){case"invalid_type":{const o=i[t.expected]??t.expected,s=D(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Ongeldige invoer: verwacht instanceof ${t.expected}, ontving ${a}`:`Ongeldige invoer: verwacht ${o}, ontving ${a}`}case"invalid_value":return t.values.length===1?`Ongeldige invoer: verwacht ${U(t.values[0])}`:`Ongeldige optie: verwacht één van ${I(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",s=e(t.origin),a=t.origin==="date"?"laat":t.origin==="string"?"lang":"groot";return s?`Te ${a}: verwacht dat ${t.origin??"waarde"} ${o}${t.maximum.toString()} ${s.unit??"elementen"} ${s.verb}`:`Te ${a}: verwacht dat ${t.origin??"waarde"} ${o}${t.maximum.toString()} is`}case"too_small":{const o=t.inclusive?">=":">",s=e(t.origin),a=t.origin==="date"?"vroeg":t.origin==="string"?"kort":"klein";return s?`Te ${a}: verwacht dat ${t.origin} ${o}${t.minimum.toString()} ${s.unit} ${s.verb}`:`Te ${a}: verwacht dat ${t.origin} ${o}${t.minimum.toString()} is`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Ongeldige tekst: moet met "${o.prefix}" beginnen`:o.format==="ends_with"?`Ongeldige tekst: moet op "${o.suffix}" eindigen`:o.format==="includes"?`Ongeldige tekst: moet "${o.includes}" bevatten`:o.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${o.pattern}`:`Ongeldig: ${n[o.format]??t.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${t.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${t.keys.length>1?"s":""}: ${I(t.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${t.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${t.origin}`;default:return"Ongeldige invoer"}}};function t1(){return{localeError:e1()}}const n1=()=>{const r={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function e(t){return r[t]??null}const n={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"tall",array:"liste"};return t=>{switch(t.code){case"invalid_type":{const o=i[t.expected]??t.expected,s=D(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Ugyldig input: forventet instanceof ${t.expected}, fikk ${a}`:`Ugyldig input: forventet ${o}, fikk ${a}`}case"invalid_value":return t.values.length===1?`Ugyldig verdi: forventet ${U(t.values[0])}`:`Ugyldig valg: forventet en av ${I(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",s=e(t.origin);return s?`For stor(t): forventet ${t.origin??"value"} til å ha ${o}${t.maximum.toString()} ${s.unit??"elementer"}`:`For stor(t): forventet ${t.origin??"value"} til å ha ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",s=e(t.origin);return s?`For lite(n): forventet ${t.origin} til å ha ${o}${t.minimum.toString()} ${s.unit}`:`For lite(n): forventet ${t.origin} til å ha ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Ugyldig streng: må starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: må ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: må inneholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: må matche mønsteret ${o.pattern}`:`Ugyldig ${n[o.format]??t.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${t.divisor}`;case"unrecognized_keys":return`${t.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${I(t.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${t.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${t.origin}`;default:return"Ugyldig input"}}};function r1(){return{localeError:n1()}}const i1=()=>{const r={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}};function e(t){return r[t]??null}const n={regex:"giren",email:"epostagâh",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO hengâmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"},i={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return t=>{switch(t.code){case"invalid_type":{const o=i[t.expected]??t.expected,s=D(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Fâsit giren: umulan instanceof ${t.expected}, alınan ${a}`:`Fâsit giren: umulan ${o}, alınan ${a}`}case"invalid_value":return t.values.length===1?`Fâsit giren: umulan ${U(t.values[0])}`:`Fâsit tercih: mûteberler ${I(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Fazla büyük: ${t.origin??"value"}, ${o}${t.maximum.toString()} ${s.unit??"elements"} sahip olmalıydı.`:`Fazla büyük: ${t.origin??"value"}, ${o}${t.maximum.toString()} olmalıydı.`}case"too_small":{const o=t.inclusive?">=":">",s=e(t.origin);return s?`Fazla küçük: ${t.origin}, ${o}${t.minimum.toString()} ${s.unit} sahip olmalıydı.`:`Fazla küçük: ${t.origin}, ${o}${t.minimum.toString()} olmalıydı.`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Fâsit metin: "${o.prefix}" ile başlamalı.`:o.format==="ends_with"?`Fâsit metin: "${o.suffix}" ile bitmeli.`:o.format==="includes"?`Fâsit metin: "${o.includes}" ihtivâ etmeli.`:o.format==="regex"?`Fâsit metin: ${o.pattern} nakşına uymalı.`:`Fâsit ${n[o.format]??t.format}`}case"not_multiple_of":return`Fâsit sayı: ${t.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${t.keys.length>1?"s":""}: ${I(t.keys,", ")}`;case"invalid_key":return`${t.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${t.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function o1(){return{localeError:i1()}}const s1=()=>{const r={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function e(t){return r[t]??null}const n={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"},i={nan:"NaN",number:"عدد",array:"ارې"};return t=>{switch(t.code){case"invalid_type":{const o=i[t.expected]??t.expected,s=D(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`ناسم ورودي: باید instanceof ${t.expected} وای, مګر ${a} ترلاسه شو`:`ناسم ورودي: باید ${o} وای, مګر ${a} ترلاسه شو`}case"invalid_value":return t.values.length===1?`ناسم ورودي: باید ${U(t.values[0])} وای`:`ناسم انتخاب: باید یو له ${I(t.values,"|")} څخه وای`;case"too_big":{const o=t.inclusive?"<=":"<",s=e(t.origin);return s?`ډیر لوی: ${t.origin??"ارزښت"} باید ${o}${t.maximum.toString()} ${s.unit??"عنصرونه"} ولري`:`ډیر لوی: ${t.origin??"ارزښت"} باید ${o}${t.maximum.toString()} وي`}case"too_small":{const o=t.inclusive?">=":">",s=e(t.origin);return s?`ډیر کوچنی: ${t.origin} باید ${o}${t.minimum.toString()} ${s.unit} ولري`:`ډیر کوچنی: ${t.origin} باید ${o}${t.minimum.toString()} وي`}case"invalid_format":{const o=t;return o.format==="starts_with"?`ناسم متن: باید د "${o.prefix}" سره پیل شي`:o.format==="ends_with"?`ناسم متن: باید د "${o.suffix}" سره پای ته ورسيږي`:o.format==="includes"?`ناسم متن: باید "${o.includes}" ولري`:o.format==="regex"?`ناسم متن: باید د ${o.pattern} سره مطابقت ولري`:`${n[o.format]??t.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${t.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${t.keys.length>1?"کلیډونه":"کلیډ"}: ${I(t.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${t.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${t.origin} کې`;default:return"ناسمه ورودي"}}};function a1(){return{localeError:s1()}}const c1=()=>{const r={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}};function e(t){return r[t]??null}const n={regex:"wyrażenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ciąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"},i={nan:"NaN",number:"liczba",array:"tablica"};return t=>{switch(t.code){case"invalid_type":{const o=i[t.expected]??t.expected,s=D(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Nieprawidłowe dane wejściowe: oczekiwano instanceof ${t.expected}, otrzymano ${a}`:`Nieprawidłowe dane wejściowe: oczekiwano ${o}, otrzymano ${a}`}case"invalid_value":return t.values.length===1?`Nieprawidłowe dane wejściowe: oczekiwano ${U(t.values[0])}`:`Nieprawidłowa opcja: oczekiwano jednej z wartości ${I(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Za duża wartość: oczekiwano, że ${t.origin??"wartość"} będzie mieć ${o}${t.maximum.toString()} ${s.unit??"elementów"}`:`Zbyt duż(y/a/e): oczekiwano, że ${t.origin??"wartość"} będzie wynosić ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",s=e(t.origin);return s?`Za mała wartość: oczekiwano, że ${t.origin??"wartość"} będzie mieć ${o}${t.minimum.toString()} ${s.unit??"elementów"}`:`Zbyt mał(y/a/e): oczekiwano, że ${t.origin??"wartość"} będzie wynosić ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Nieprawidłowy ciąg znaków: musi zaczynać się od "${o.prefix}"`:o.format==="ends_with"?`Nieprawidłowy ciąg znaków: musi kończyć się na "${o.suffix}"`:o.format==="includes"?`Nieprawidłowy ciąg znaków: musi zawierać "${o.includes}"`:o.format==="regex"?`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${o.pattern}`:`Nieprawidłow(y/a/e) ${n[o.format]??t.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${t.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${t.keys.length>1?"s":""}: ${I(t.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${t.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${t.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function u1(){return{localeError:c1()}}const l1=()=>{const r={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(t){return r[t]??null}const n={regex:"padrão",email:"endereço de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"duração ISO",ipv4:"endereço IPv4",ipv6:"endereço IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN",number:"número",null:"nulo"};return t=>{switch(t.code){case"invalid_type":{const o=i[t.expected]??t.expected,s=D(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Tipo inválido: esperado instanceof ${t.expected}, recebido ${a}`:`Tipo inválido: esperado ${o}, recebido ${a}`}case"invalid_value":return t.values.length===1?`Entrada inválida: esperado ${U(t.values[0])}`:`Opção inválida: esperada uma das ${I(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Muito grande: esperado que ${t.origin??"valor"} tivesse ${o}${t.maximum.toString()} ${s.unit??"elementos"}`:`Muito grande: esperado que ${t.origin??"valor"} fosse ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",s=e(t.origin);return s?`Muito pequeno: esperado que ${t.origin} tivesse ${o}${t.minimum.toString()} ${s.unit}`:`Muito pequeno: esperado que ${t.origin} fosse ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Texto inválido: deve começar com "${o.prefix}"`:o.format==="ends_with"?`Texto inválido: deve terminar com "${o.suffix}"`:o.format==="includes"?`Texto inválido: deve incluir "${o.includes}"`:o.format==="regex"?`Texto inválido: deve corresponder ao padrão ${o.pattern}`:`${n[o.format]??t.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${t.divisor}`;case"unrecognized_keys":return`Chave${t.keys.length>1?"s":""} desconhecida${t.keys.length>1?"s":""}: ${I(t.keys,", ")}`;case"invalid_key":return`Chave inválida em ${t.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${t.origin}`;default:return"Campo inválido"}}};function d1(){return{localeError:l1()}}const f1=()=>{const r={string:{unit:"caractere",verb:"să aibă"},file:{unit:"octeți",verb:"să aibă"},array:{unit:"elemente",verb:"să aibă"},set:{unit:"elemente",verb:"să aibă"},map:{unit:"intrări",verb:"să aibă"}};function e(t){return r[t]??null}const n={regex:"intrare",email:"adresă de email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"dată și oră ISO",date:"dată ISO",time:"oră ISO",duration:"durată ISO",ipv4:"adresă IPv4",ipv6:"adresă IPv6",mac:"adresă MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"șir codat base64",base64url:"șir codat base64url",json_string:"șir JSON",e164:"număr E.164",jwt:"JWT",template_literal:"intrare"},i={nan:"NaN",string:"șir",number:"număr",boolean:"boolean",function:"funcție",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"număr mare",void:"void",never:"never",map:"hartă",set:"set"};return t=>{switch(t.code){case"invalid_type":{const o=i[t.expected]??t.expected,s=D(t.input),a=i[s]??s;return`Intrare invalidă: așteptat ${o}, primit ${a}`}case"invalid_value":return t.values.length===1?`Intrare invalidă: așteptat ${U(t.values[0])}`:`Opțiune invalidă: așteptat una dintre ${I(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Prea mare: așteptat ca ${t.origin??"valoarea"} ${s.verb} ${o}${t.maximum.toString()} ${s.unit??"elemente"}`:`Prea mare: așteptat ca ${t.origin??"valoarea"} să fie ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",s=e(t.origin);return s?`Prea mic: așteptat ca ${t.origin} ${s.verb} ${o}${t.minimum.toString()} ${s.unit}`:`Prea mic: așteptat ca ${t.origin} să fie ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Șir invalid: trebuie să înceapă cu "${o.prefix}"`:o.format==="ends_with"?`Șir invalid: trebuie să se termine cu "${o.suffix}"`:o.format==="includes"?`Șir invalid: trebuie să includă "${o.includes}"`:o.format==="regex"?`Șir invalid: trebuie să se potrivească cu modelul ${o.pattern}`:`Format invalid: ${n[o.format]??t.format}`}case"not_multiple_of":return`Număr invalid: trebuie să fie multiplu de ${t.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${I(t.keys,", ")}`;case"invalid_key":return`Cheie invalidă în ${t.origin}`;case"invalid_union":return"Intrare invalidă";case"invalid_element":return`Valoare invalidă în ${t.origin}`;default:return"Intrare invalidă"}}};function h1(){return{localeError:f1()}}function ol(r,e,n,i){const t=Math.abs(r),o=t%10,s=t%100;return s>=11&&s<=19?i:o===1?e:o>=2&&o<=4?n:i}const p1=()=>{const r={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function e(t){return r[t]??null}const n={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"},i={nan:"NaN",number:"число",array:"массив"};return t=>{switch(t.code){case"invalid_type":{const o=i[t.expected]??t.expected,s=D(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Неверный ввод: ожидалось instanceof ${t.expected}, получено ${a}`:`Неверный ввод: ожидалось ${o}, получено ${a}`}case"invalid_value":return t.values.length===1?`Неверный ввод: ожидалось ${U(t.values[0])}`:`Неверный вариант: ожидалось одно из ${I(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",s=e(t.origin);if(s){const a=Number(t.maximum),c=ol(a,s.unit.one,s.unit.few,s.unit.many);return`Слишком большое значение: ожидалось, что ${t.origin??"значение"} будет иметь ${o}${t.maximum.toString()} ${c}`}return`Слишком большое значение: ожидалось, что ${t.origin??"значение"} будет ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",s=e(t.origin);if(s){const a=Number(t.minimum),c=ol(a,s.unit.one,s.unit.few,s.unit.many);return`Слишком маленькое значение: ожидалось, что ${t.origin} будет иметь ${o}${t.minimum.toString()} ${c}`}return`Слишком маленькое значение: ожидалось, что ${t.origin} будет ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Неверная строка: должна начинаться с "${o.prefix}"`:o.format==="ends_with"?`Неверная строка: должна заканчиваться на "${o.suffix}"`:o.format==="includes"?`Неверная строка: должна содержать "${o.includes}"`:o.format==="regex"?`Неверная строка: должна соответствовать шаблону ${o.pattern}`:`Неверный ${n[o.format]??t.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${t.divisor}`;case"unrecognized_keys":return`Нераспознанн${t.keys.length>1?"ые":"ый"} ключ${t.keys.length>1?"и":""}: ${I(t.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${t.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${t.origin}`;default:return"Неверные входные данные"}}};function m1(){return{localeError:p1()}}const g1=()=>{const r={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(t){return r[t]??null}const n={regex:"vnos",email:"e-poštni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in čas",date:"ISO datum",time:"ISO čas",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 številka",jwt:"JWT",template_literal:"vnos"},i={nan:"NaN",number:"število",array:"tabela"};return t=>{switch(t.code){case"invalid_type":{const o=i[t.expected]??t.expected,s=D(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Neveljaven vnos: pričakovano instanceof ${t.expected}, prejeto ${a}`:`Neveljaven vnos: pričakovano ${o}, prejeto ${a}`}case"invalid_value":return t.values.length===1?`Neveljaven vnos: pričakovano ${U(t.values[0])}`:`Neveljavna možnost: pričakovano eno izmed ${I(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Preveliko: pričakovano, da bo ${t.origin??"vrednost"} imelo ${o}${t.maximum.toString()} ${s.unit??"elementov"}`:`Preveliko: pričakovano, da bo ${t.origin??"vrednost"} ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",s=e(t.origin);return s?`Premajhno: pričakovano, da bo ${t.origin} imelo ${o}${t.minimum.toString()} ${s.unit}`:`Premajhno: pričakovano, da bo ${t.origin} ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Neveljaven niz: mora se začeti z "${o.prefix}"`:o.format==="ends_with"?`Neveljaven niz: mora se končati z "${o.suffix}"`:o.format==="includes"?`Neveljaven niz: mora vsebovati "${o.includes}"`:o.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${o.pattern}`:`Neveljaven ${n[o.format]??t.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${t.divisor}`;case"unrecognized_keys":return`Neprepoznan${t.keys.length>1?"i ključi":" ključ"}: ${I(t.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${t.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${t.origin}`;default:return"Neveljaven vnos"}}};function b1(){return{localeError:g1()}}const v1=()=>{const r={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}};function e(t){return r[t]??null}const n={regex:"reguljärt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad sträng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},i={nan:"NaN",number:"antal",array:"lista"};return t=>{switch(t.code){case"invalid_type":{const o=i[t.expected]??t.expected,s=D(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Ogiltig inmatning: förväntat instanceof ${t.expected}, fick ${a}`:`Ogiltig inmatning: förväntat ${o}, fick ${a}`}case"invalid_value":return t.values.length===1?`Ogiltig inmatning: förväntat ${U(t.values[0])}`:`Ogiltigt val: förväntade en av ${I(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",s=e(t.origin);return s?`För stor(t): förväntade ${t.origin??"värdet"} att ha ${o}${t.maximum.toString()} ${s.unit??"element"}`:`För stor(t): förväntat ${t.origin??"värdet"} att ha ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",s=e(t.origin);return s?`För lite(t): förväntade ${t.origin??"värdet"} att ha ${o}${t.minimum.toString()} ${s.unit}`:`För lite(t): förväntade ${t.origin??"värdet"} att ha ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Ogiltig sträng: måste börja med "${o.prefix}"`:o.format==="ends_with"?`Ogiltig sträng: måste sluta med "${o.suffix}"`:o.format==="includes"?`Ogiltig sträng: måste innehålla "${o.includes}"`:o.format==="regex"?`Ogiltig sträng: måste matcha mönstret "${o.pattern}"`:`Ogiltig(t) ${n[o.format]??t.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${t.divisor}`;case"unrecognized_keys":return`${t.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${I(t.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${t.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${t.origin??"värdet"}`;default:return"Ogiltig input"}}};function y1(){return{localeError:v1()}}const _1=()=>{const r={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function e(t){return r[t]??null}const n={regex:"உள்ளீடு",email:"மின்னஞ்சல் முகவரி",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"எண்",array:"அணி",null:"வெறுமை"};return t=>{switch(t.code){case"invalid_type":{const o=i[t.expected]??t.expected,s=D(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${t.expected}, பெறப்பட்டது ${a}`:`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${o}, பெறப்பட்டது ${a}`}case"invalid_value":return t.values.length===1?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${U(t.values[0])}`:`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${I(t.values,"|")} இல் ஒன்று`;case"too_big":{const o=t.inclusive?"<=":"<",s=e(t.origin);return s?`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${t.origin??"மதிப்பு"} ${o}${t.maximum.toString()} ${s.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`:`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${t.origin??"மதிப்பு"} ${o}${t.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{const o=t.inclusive?">=":">",s=e(t.origin);return s?`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${t.origin} ${o}${t.minimum.toString()} ${s.unit} ஆக இருக்க வேண்டும்`:`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${t.origin} ${o}${t.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{const o=t;return o.format==="starts_with"?`தவறான சரம்: "${o.prefix}" இல் தொடங்க வேண்டும்`:o.format==="ends_with"?`தவறான சரம்: "${o.suffix}" இல் முடிவடைய வேண்டும்`:o.format==="includes"?`தவறான சரம்: "${o.includes}" ஐ உள்ளடக்க வேண்டும்`:o.format==="regex"?`தவறான சரம்: ${o.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`:`தவறான ${n[o.format]??t.format}`}case"not_multiple_of":return`தவறான எண்: ${t.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${t.keys.length>1?"கள்":""}: ${I(t.keys,", ")}`;case"invalid_key":return`${t.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${t.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function x1(){return{localeError:_1()}}const w1=()=>{const r={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function e(t){return r[t]??null}const n={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"},i={nan:"NaN",number:"ตัวเลข",array:"อาร์เรย์ (Array)",null:"ไม่มีค่า (null)"};return t=>{switch(t.code){case"invalid_type":{const o=i[t.expected]??t.expected,s=D(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${t.expected} แต่ได้รับ ${a}`:`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${o} แต่ได้รับ ${a}`}case"invalid_value":return t.values.length===1?`ค่าไม่ถูกต้อง: ควรเป็น ${U(t.values[0])}`:`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${I(t.values,"|")}`;case"too_big":{const o=t.inclusive?"ไม่เกิน":"น้อยกว่า",s=e(t.origin);return s?`เกินกำหนด: ${t.origin??"ค่า"} ควรมี${o} ${t.maximum.toString()} ${s.unit??"รายการ"}`:`เกินกำหนด: ${t.origin??"ค่า"} ควรมี${o} ${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?"อย่างน้อย":"มากกว่า",s=e(t.origin);return s?`น้อยกว่ากำหนด: ${t.origin} ควรมี${o} ${t.minimum.toString()} ${s.unit}`:`น้อยกว่ากำหนด: ${t.origin} ควรมี${o} ${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${o.prefix}"`:o.format==="ends_with"?`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${o.suffix}"`:o.format==="includes"?`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${o.includes}" อยู่ในข้อความ`:o.format==="regex"?`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${o.pattern}`:`รูปแบบไม่ถูกต้อง: ${n[o.format]??t.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${t.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${I(t.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${t.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${t.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function S1(){return{localeError:w1()}}const k1=()=>{const r={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function e(t){return r[t]??null}const n={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO süre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"},i={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{const o=i[t.expected]??t.expected,s=D(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Geçersiz değer: beklenen instanceof ${t.expected}, alınan ${a}`:`Geçersiz değer: beklenen ${o}, alınan ${a}`}case"invalid_value":return t.values.length===1?`Geçersiz değer: beklenen ${U(t.values[0])}`:`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${I(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Çok büyük: beklenen ${t.origin??"değer"} ${o}${t.maximum.toString()} ${s.unit??"öğe"}`:`Çok büyük: beklenen ${t.origin??"değer"} ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",s=e(t.origin);return s?`Çok küçük: beklenen ${t.origin} ${o}${t.minimum.toString()} ${s.unit}`:`Çok küçük: beklenen ${t.origin} ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Geçersiz metin: "${o.prefix}" ile başlamalı`:o.format==="ends_with"?`Geçersiz metin: "${o.suffix}" ile bitmeli`:o.format==="includes"?`Geçersiz metin: "${o.includes}" içermeli`:o.format==="regex"?`Geçersiz metin: ${o.pattern} desenine uymalı`:`Geçersiz ${n[o.format]??t.format}`}case"not_multiple_of":return`Geçersiz sayı: ${t.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${t.keys.length>1?"lar":""}: ${I(t.keys,", ")}`;case"invalid_key":return`${t.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${t.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function I1(){return{localeError:k1()}}const $1=()=>{const r={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function e(t){return r[t]??null}const n={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"},i={nan:"NaN",number:"число",array:"масив"};return t=>{switch(t.code){case"invalid_type":{const o=i[t.expected]??t.expected,s=D(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Неправильні вхідні дані: очікується instanceof ${t.expected}, отримано ${a}`:`Неправильні вхідні дані: очікується ${o}, отримано ${a}`}case"invalid_value":return t.values.length===1?`Неправильні вхідні дані: очікується ${U(t.values[0])}`:`Неправильна опція: очікується одне з ${I(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Занадто велике: очікується, що ${t.origin??"значення"} ${s.verb} ${o}${t.maximum.toString()} ${s.unit??"елементів"}`:`Занадто велике: очікується, що ${t.origin??"значення"} буде ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",s=e(t.origin);return s?`Занадто мале: очікується, що ${t.origin} ${s.verb} ${o}${t.minimum.toString()} ${s.unit}`:`Занадто мале: очікується, що ${t.origin} буде ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Неправильний рядок: повинен починатися з "${o.prefix}"`:o.format==="ends_with"?`Неправильний рядок: повинен закінчуватися на "${o.suffix}"`:o.format==="includes"?`Неправильний рядок: повинен містити "${o.includes}"`:o.format==="regex"?`Неправильний рядок: повинен відповідати шаблону ${o.pattern}`:`Неправильний ${n[o.format]??t.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${t.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${t.keys.length>1?"і":""}: ${I(t.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${t.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${t.origin}`;default:return"Неправильні вхідні дані"}}};function Dh(){return{localeError:$1()}}function E1(){return Dh()}const T1=()=>{const r={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function e(t){return r[t]??null}const n={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"},i={nan:"NaN",number:"نمبر",array:"آرے",null:"نل"};return t=>{switch(t.code){case"invalid_type":{const o=i[t.expected]??t.expected,s=D(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`غلط ان پٹ: instanceof ${t.expected} متوقع تھا، ${a} موصول ہوا`:`غلط ان پٹ: ${o} متوقع تھا، ${a} موصول ہوا`}case"invalid_value":return t.values.length===1?`غلط ان پٹ: ${U(t.values[0])} متوقع تھا`:`غلط آپشن: ${I(t.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{const o=t.inclusive?"<=":"<",s=e(t.origin);return s?`بہت بڑا: ${t.origin??"ویلیو"} کے ${o}${t.maximum.toString()} ${s.unit??"عناصر"} ہونے متوقع تھے`:`بہت بڑا: ${t.origin??"ویلیو"} کا ${o}${t.maximum.toString()} ہونا متوقع تھا`}case"too_small":{const o=t.inclusive?">=":">",s=e(t.origin);return s?`بہت چھوٹا: ${t.origin} کے ${o}${t.minimum.toString()} ${s.unit} ہونے متوقع تھے`:`بہت چھوٹا: ${t.origin} کا ${o}${t.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{const o=t;return o.format==="starts_with"?`غلط سٹرنگ: "${o.prefix}" سے شروع ہونا چاہیے`:o.format==="ends_with"?`غلط سٹرنگ: "${o.suffix}" پر ختم ہونا چاہیے`:o.format==="includes"?`غلط سٹرنگ: "${o.includes}" شامل ہونا چاہیے`:o.format==="regex"?`غلط سٹرنگ: پیٹرن ${o.pattern} سے میچ ہونا چاہیے`:`غلط ${n[o.format]??t.format}`}case"not_multiple_of":return`غلط نمبر: ${t.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${t.keys.length>1?"ز":""}: ${I(t.keys,"، ")}`;case"invalid_key":return`${t.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${t.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function O1(){return{localeError:T1()}}const P1=()=>{const r={string:{unit:"belgi",verb:"bo‘lishi kerak"},file:{unit:"bayt",verb:"bo‘lishi kerak"},array:{unit:"element",verb:"bo‘lishi kerak"},set:{unit:"element",verb:"bo‘lishi kerak"},map:{unit:"yozuv",verb:"bo‘lishi kerak"}};function e(t){return r[t]??null}const n={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},i={nan:"NaN",number:"raqam",array:"massiv"};return t=>{switch(t.code){case"invalid_type":{const o=i[t.expected]??t.expected,s=D(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Noto‘g‘ri kirish: kutilgan instanceof ${t.expected}, qabul qilingan ${a}`:`Noto‘g‘ri kirish: kutilgan ${o}, qabul qilingan ${a}`}case"invalid_value":return t.values.length===1?`Noto‘g‘ri kirish: kutilgan ${U(t.values[0])}`:`Noto‘g‘ri variant: quyidagilardan biri kutilgan ${I(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Juda katta: kutilgan ${t.origin??"qiymat"} ${o}${t.maximum.toString()} ${s.unit} ${s.verb}`:`Juda katta: kutilgan ${t.origin??"qiymat"} ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",s=e(t.origin);return s?`Juda kichik: kutilgan ${t.origin} ${o}${t.minimum.toString()} ${s.unit} ${s.verb}`:`Juda kichik: kutilgan ${t.origin} ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Noto‘g‘ri satr: "${o.prefix}" bilan boshlanishi kerak`:o.format==="ends_with"?`Noto‘g‘ri satr: "${o.suffix}" bilan tugashi kerak`:o.format==="includes"?`Noto‘g‘ri satr: "${o.includes}" ni o‘z ichiga olishi kerak`:o.format==="regex"?`Noto‘g‘ri satr: ${o.pattern} shabloniga mos kelishi kerak`:`Noto‘g‘ri ${n[o.format]??t.format}`}case"not_multiple_of":return`Noto‘g‘ri raqam: ${t.divisor} ning karralisi bo‘lishi kerak`;case"unrecognized_keys":return`Noma’lum kalit${t.keys.length>1?"lar":""}: ${I(t.keys,", ")}`;case"invalid_key":return`${t.origin} dagi kalit noto‘g‘ri`;case"invalid_union":return"Noto‘g‘ri kirish";case"invalid_element":return`${t.origin} da noto‘g‘ri qiymat`;default:return"Noto‘g‘ri kirish"}}};function z1(){return{localeError:P1()}}const A1=()=>{const r={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}};function e(t){return r[t]??null}const n={regex:"đầu vào",email:"địa chỉ email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ngày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"},i={nan:"NaN",number:"số",array:"mảng"};return t=>{switch(t.code){case"invalid_type":{const o=i[t.expected]??t.expected,s=D(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Đầu vào không hợp lệ: mong đợi instanceof ${t.expected}, nhận được ${a}`:`Đầu vào không hợp lệ: mong đợi ${o}, nhận được ${a}`}case"invalid_value":return t.values.length===1?`Đầu vào không hợp lệ: mong đợi ${U(t.values[0])}`:`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${I(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Quá lớn: mong đợi ${t.origin??"giá trị"} ${s.verb} ${o}${t.maximum.toString()} ${s.unit??"phần tử"}`:`Quá lớn: mong đợi ${t.origin??"giá trị"} ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",s=e(t.origin);return s?`Quá nhỏ: mong đợi ${t.origin} ${s.verb} ${o}${t.minimum.toString()} ${s.unit}`:`Quá nhỏ: mong đợi ${t.origin} ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Chuỗi không hợp lệ: phải bắt đầu bằng "${o.prefix}"`:o.format==="ends_with"?`Chuỗi không hợp lệ: phải kết thúc bằng "${o.suffix}"`:o.format==="includes"?`Chuỗi không hợp lệ: phải bao gồm "${o.includes}"`:o.format==="regex"?`Chuỗi không hợp lệ: phải khớp với mẫu ${o.pattern}`:`${n[o.format]??t.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${t.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${I(t.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${t.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${t.origin}`;default:return"Đầu vào không hợp lệ"}}};function N1(){return{localeError:A1()}}const U1=()=>{const r={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function e(t){return r[t]??null}const n={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"},i={nan:"NaN",number:"数字",array:"数组",null:"空值(null)"};return t=>{switch(t.code){case"invalid_type":{const o=i[t.expected]??t.expected,s=D(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`无效输入:期望 instanceof ${t.expected},实际接收 ${a}`:`无效输入:期望 ${o},实际接收 ${a}`}case"invalid_value":return t.values.length===1?`无效输入:期望 ${U(t.values[0])}`:`无效选项:期望以下之一 ${I(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",s=e(t.origin);return s?`数值过大:期望 ${t.origin??"值"} ${o}${t.maximum.toString()} ${s.unit??"个元素"}`:`数值过大:期望 ${t.origin??"值"} ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",s=e(t.origin);return s?`数值过小:期望 ${t.origin} ${o}${t.minimum.toString()} ${s.unit}`:`数值过小:期望 ${t.origin} ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`无效字符串:必须以 "${o.prefix}" 开头`:o.format==="ends_with"?`无效字符串:必须以 "${o.suffix}" 结尾`:o.format==="includes"?`无效字符串:必须包含 "${o.includes}"`:o.format==="regex"?`无效字符串:必须满足正则表达式 ${o.pattern}`:`无效${n[o.format]??t.format}`}case"not_multiple_of":return`无效数字:必须是 ${t.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${I(t.keys,", ")}`;case"invalid_key":return`${t.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${t.origin} 中包含无效值(value)`;default:return"无效输入"}}};function D1(){return{localeError:U1()}}const R1=()=>{const r={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function e(t){return r[t]??null}const n={regex:"輸入",email:"郵件地址",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"},i={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{const o=i[t.expected]??t.expected,s=D(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`無效的輸入值:預期為 instanceof ${t.expected},但收到 ${a}`:`無效的輸入值:預期為 ${o},但收到 ${a}`}case"invalid_value":return t.values.length===1?`無效的輸入值:預期為 ${U(t.values[0])}`:`無效的選項:預期為以下其中之一 ${I(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",s=e(t.origin);return s?`數值過大:預期 ${t.origin??"值"} 應為 ${o}${t.maximum.toString()} ${s.unit??"個元素"}`:`數值過大:預期 ${t.origin??"值"} 應為 ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",s=e(t.origin);return s?`數值過小:預期 ${t.origin} 應為 ${o}${t.minimum.toString()} ${s.unit}`:`數值過小:預期 ${t.origin} 應為 ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`無效的字串:必須以 "${o.prefix}" 開頭`:o.format==="ends_with"?`無效的字串:必須以 "${o.suffix}" 結尾`:o.format==="includes"?`無效的字串:必須包含 "${o.includes}"`:o.format==="regex"?`無效的字串:必須符合格式 ${o.pattern}`:`無效的 ${n[o.format]??t.format}`}case"not_multiple_of":return`無效的數字:必須為 ${t.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${t.keys.length>1?"們":""}:${I(t.keys,"、")}`;case"invalid_key":return`${t.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${t.origin} 中有無效的值`;default:return"無效的輸入值"}}};function C1(){return{localeError:R1()}}const L1=()=>{const r={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function e(t){return r[t]??null}const n={regex:"ẹ̀rọ ìbáwọlé",email:"àdírẹ́sì ìmẹ́lì",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"àkókò ISO",date:"ọjọ́ ISO",time:"àkókò ISO",duration:"àkókò tó pé ISO",ipv4:"àdírẹ́sì IPv4",ipv6:"àdírẹ́sì IPv6",cidrv4:"àgbègbè IPv4",cidrv6:"àgbègbè IPv6",base64:"ọ̀rọ̀ tí a kọ́ ní base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mbà E.164",jwt:"JWT",template_literal:"ẹ̀rọ ìbáwọlé"},i={nan:"NaN",number:"nọ́mbà",array:"akopọ"};return t=>{switch(t.code){case"invalid_type":{const o=i[t.expected]??t.expected,s=D(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${t.expected}, àmọ̀ a rí ${a}`:`Ìbáwọlé aṣìṣe: a ní láti fi ${o}, àmọ̀ a rí ${a}`}case"invalid_value":return t.values.length===1?`Ìbáwọlé aṣìṣe: a ní láti fi ${U(t.values[0])}`:`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${I(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Tó pọ̀ jù: a ní láti jẹ́ pé ${t.origin??"iye"} ${s.verb} ${o}${t.maximum} ${s.unit}`:`Tó pọ̀ jù: a ní láti jẹ́ ${o}${t.maximum}`}case"too_small":{const o=t.inclusive?">=":">",s=e(t.origin);return s?`Kéré ju: a ní láti jẹ́ pé ${t.origin} ${s.verb} ${o}${t.minimum} ${s.unit}`:`Kéré ju: a ní láti jẹ́ ${o}${t.minimum}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${o.prefix}"`:o.format==="ends_with"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${o.suffix}"`:o.format==="includes"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${o.includes}"`:o.format==="regex"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${o.pattern}`:`Aṣìṣe: ${n[o.format]??t.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${t.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${I(t.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${t.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${t.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};function M1(){return{localeError:L1()}}const Ls=Object.freeze(Object.defineProperty({__proto__:null,ar:Wb,az:Yb,be:ev,bg:nv,ca:iv,cs:sv,da:cv,de:lv,el:fv,en:Nh,eo:mv,es:bv,fa:yv,fi:xv,fr:Sv,frCA:Iv,he:Ev,hr:Ov,hu:zv,hy:Nv,id:Dv,is:Cv,it:Mv,ja:Bv,ka:Hv,kh:qv,km:Uh,ko:Gv,lt:Jv,mk:Xv,ms:Qv,nl:t1,no:r1,ota:o1,pl:u1,ps:a1,pt:d1,ro:h1,ru:m1,sl:b1,sv:y1,ta:x1,th:S1,tr:I1,ua:E1,uk:Dh,ur:O1,uz:z1,vi:N1,yo:M1,zhCN:D1,zhTW:C1},Symbol.toStringTag,{value:"Module"}));var sl;const Ms=Symbol("ZodOutput"),js=Symbol("ZodInput");class Rh{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...n){const i=n[0];return this._map.set(e,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.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 i={...this.get(n)??{}};delete i.id;const t={...i,...this._map.get(e)};return Object.keys(t).length?t:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function $i(){return new Rh}(sl=globalThis).__zod_globalRegistry??(sl.__zod_globalRegistry=$i());const Ne=globalThis.__zod_globalRegistry;function Ch(r,e){return new r({type:"string",...S(e)})}function Lh(r,e){return new r({type:"string",coerce:!0,...S(e)})}function Bs(r,e){return new r({type:"string",format:"email",check:"string_format",abort:!1,...S(e)})}function li(r,e){return new r({type:"string",format:"guid",check:"string_format",abort:!1,...S(e)})}function Fs(r,e){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,...S(e)})}function Hs(r,e){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...S(e)})}function Zs(r,e){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...S(e)})}function qs(r,e){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...S(e)})}function Ei(r,e){return new r({type:"string",format:"url",check:"string_format",abort:!1,...S(e)})}function Vs(r,e){return new r({type:"string",format:"emoji",check:"string_format",abort:!1,...S(e)})}function Gs(r,e){return new r({type:"string",format:"nanoid",check:"string_format",abort:!1,...S(e)})}function Ks(r,e){return new r({type:"string",format:"cuid",check:"string_format",abort:!1,...S(e)})}function Js(r,e){return new r({type:"string",format:"cuid2",check:"string_format",abort:!1,...S(e)})}function Ws(r,e){return new r({type:"string",format:"ulid",check:"string_format",abort:!1,...S(e)})}function Xs(r,e){return new r({type:"string",format:"xid",check:"string_format",abort:!1,...S(e)})}function Ys(r,e){return new r({type:"string",format:"ksuid",check:"string_format",abort:!1,...S(e)})}function Qs(r,e){return new r({type:"string",format:"ipv4",check:"string_format",abort:!1,...S(e)})}function ea(r,e){return new r({type:"string",format:"ipv6",check:"string_format",abort:!1,...S(e)})}function Mh(r,e){return new r({type:"string",format:"mac",check:"string_format",abort:!1,...S(e)})}function ta(r,e){return new r({type:"string",format:"cidrv4",check:"string_format",abort:!1,...S(e)})}function na(r,e){return new r({type:"string",format:"cidrv6",check:"string_format",abort:!1,...S(e)})}function ra(r,e){return new r({type:"string",format:"base64",check:"string_format",abort:!1,...S(e)})}function ia(r,e){return new r({type:"string",format:"base64url",check:"string_format",abort:!1,...S(e)})}function oa(r,e){return new r({type:"string",format:"e164",check:"string_format",abort:!1,...S(e)})}function sa(r,e){return new r({type:"string",format:"jwt",check:"string_format",abort:!1,...S(e)})}const aa={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function jh(r,e){return new r({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...S(e)})}function Bh(r,e){return new r({type:"string",format:"date",check:"string_format",...S(e)})}function Fh(r,e){return new r({type:"string",format:"time",check:"string_format",precision:null,...S(e)})}function Hh(r,e){return new r({type:"string",format:"duration",check:"string_format",...S(e)})}function Zh(r,e){return new r({type:"number",checks:[],...S(e)})}function qh(r,e){return new r({type:"number",coerce:!0,checks:[],...S(e)})}function Vh(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"safeint",...S(e)})}function Gh(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"float32",...S(e)})}function Kh(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"float64",...S(e)})}function Jh(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"int32",...S(e)})}function Wh(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"uint32",...S(e)})}function Xh(r,e){return new r({type:"boolean",...S(e)})}function Yh(r,e){return new r({type:"boolean",coerce:!0,...S(e)})}function Qh(r,e){return new r({type:"bigint",...S(e)})}function ep(r,e){return new r({type:"bigint",coerce:!0,...S(e)})}function tp(r,e){return new r({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...S(e)})}function np(r,e){return new r({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...S(e)})}function rp(r,e){return new r({type:"symbol",...S(e)})}function ip(r,e){return new r({type:"undefined",...S(e)})}function op(r,e){return new r({type:"null",...S(e)})}function sp(r){return new r({type:"any"})}function ap(r){return new r({type:"unknown"})}function cp(r,e){return new r({type:"never",...S(e)})}function up(r,e){return new r({type:"void",...S(e)})}function lp(r,e){return new r({type:"date",...S(e)})}function dp(r,e){return new r({type:"date",coerce:!0,...S(e)})}function fp(r,e){return new r({type:"nan",...S(e)})}function at(r,e){return new Ts({check:"less_than",...S(e),value:r,inclusive:!1})}function De(r,e){return new Ts({check:"less_than",...S(e),value:r,inclusive:!0})}function ct(r,e){return new Os({check:"greater_than",...S(e),value:r,inclusive:!1})}function ke(r,e){return new Os({check:"greater_than",...S(e),value:r,inclusive:!0})}function Ti(r){return ct(0,r)}function Oi(r){return at(0,r)}function Pi(r){return De(0,r)}function zi(r){return ke(0,r)}function Rt(r,e){return new Qd({check:"multiple_of",...S(e),value:r})}function Bt(r,e){return new nf({check:"max_size",...S(e),maximum:r})}function ut(r,e){return new rf({check:"min_size",...S(e),minimum:r})}function fn(r,e){return new of({check:"size_equals",...S(e),size:r})}function hn(r,e){return new sf({check:"max_length",...S(e),maximum:r})}function gt(r,e){return new af({check:"min_length",...S(e),minimum:r})}function pn(r,e){return new cf({check:"length_equals",...S(e),length:r})}function Yn(r,e){return new uf({check:"string_format",format:"regex",...S(e),pattern:r})}function Qn(r){return new lf({check:"string_format",format:"lowercase",...S(r)})}function er(r){return new df({check:"string_format",format:"uppercase",...S(r)})}function tr(r,e){return new ff({check:"string_format",format:"includes",...S(e),includes:r})}function nr(r,e){return new hf({check:"string_format",format:"starts_with",...S(e),prefix:r})}function rr(r,e){return new pf({check:"string_format",format:"ends_with",...S(e),suffix:r})}function Ai(r,e,n){return new mf({check:"property",property:r,schema:e,...S(n)})}function ir(r,e){return new gf({check:"mime_type",mime:r,...S(e)})}function nt(r){return new bf({check:"overwrite",tx:r})}function or(r){return nt(e=>e.normalize(r))}function sr(){return nt(r=>r.trim())}function ar(){return nt(r=>r.toLowerCase())}function cr(){return nt(r=>r.toUpperCase())}function ur(){return nt(r=>Ql(r))}function hp(r,e,n){return new r({type:"array",element:e,...S(n)})}function j1(r,e,n){return new r({type:"union",options:e,...S(n)})}function B1(r,e,n){return new r({type:"union",options:e,inclusive:!1,...S(n)})}function F1(r,e,n,i){return new r({type:"union",options:n,discriminator:e,...S(i)})}function H1(r,e,n){return new r({type:"intersection",left:e,right:n})}function Z1(r,e,n,i){const t=n instanceof C,o=t?i:n,s=t?n:null;return new r({type:"tuple",items:e,rest:s,...S(o)})}function q1(r,e,n,i){return new r({type:"record",keyType:e,valueType:n,...S(i)})}function V1(r,e,n,i){return new r({type:"map",keyType:e,valueType:n,...S(i)})}function G1(r,e,n){return new r({type:"set",valueType:e,...S(n)})}function K1(r,e,n){const i=Array.isArray(e)?Object.fromEntries(e.map(t=>[t,t])):e;return new r({type:"enum",entries:i,...S(n)})}function J1(r,e,n){return new r({type:"enum",entries:e,...S(n)})}function W1(r,e,n){return new r({type:"literal",values:Array.isArray(e)?e:[e],...S(n)})}function pp(r,e){return new r({type:"file",...S(e)})}function X1(r,e){return new r({type:"transform",transform:e})}function Y1(r,e){return new r({type:"optional",innerType:e})}function Q1(r,e){return new r({type:"nullable",innerType:e})}function ey(r,e,n){return new r({type:"default",innerType:e,get defaultValue(){return typeof n=="function"?n():yi(n)}})}function ty(r,e,n){return new r({type:"nonoptional",innerType:e,...S(n)})}function ny(r,e){return new r({type:"success",innerType:e})}function ry(r,e,n){return new r({type:"catch",innerType:e,catchValue:typeof n=="function"?n:()=>n})}function iy(r,e,n){return new r({type:"pipe",in:e,out:n})}function oy(r,e){return new r({type:"readonly",innerType:e})}function sy(r,e,n){return new r({type:"template_literal",parts:e,...S(n)})}function ay(r,e){return new r({type:"lazy",getter:e})}function cy(r,e){return new r({type:"promise",innerType:e})}function mp(r,e,n){const i=S(n);return i.abort??(i.abort=!0),new r({type:"custom",check:"custom",fn:e,...i})}function gp(r,e,n){return new r({type:"custom",check:"custom",fn:e,...S(n)})}function bp(r,e){const n=vp(i=>(i.addIssue=t=>{if(typeof t=="string")i.issues.push(tn(t,i.value,n._zod.def));else{const o=t;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=i.value),o.inst??(o.inst=n),o.continue??(o.continue=!n._zod.def.abort),i.issues.push(tn(o))}},r(i.value,i)),e);return n}function vp(r,e){const n=new ae({check:"custom",...S(e)});return n._zod.check=r,n}function yp(r){const e=new ae({check:"describe"});return e._zod.onattach=[n=>{const i=Ne.get(n)??{};Ne.add(n,{...i,description:r})}],e._zod.check=()=>{},e}function _p(r){const e=new ae({check:"meta"});return e._zod.onattach=[n=>{const i=Ne.get(n)??{};Ne.add(n,{...i,...r})}],e._zod.check=()=>{},e}function xp(r,e){const n=S(e);let i=n.truthy??["true","1","yes","on","y","enabled"],t=n.falsy??["false","0","no","off","n","disabled"];n.case!=="sensitive"&&(i=i.map(h=>typeof h=="string"?h.toLowerCase():h),t=t.map(h=>typeof h=="string"?h.toLowerCase():h));const o=new Set(i),s=new Set(t),a=r.Codec??Cs,c=r.Boolean??As,u=r.String??Xn,l=new u({type:"string",error:n.error}),f=new c({type:"boolean",error:n.error}),d=new a({type:"pipe",in:l,out:f,transform:((h,p)=>{let _=h;return n.case!=="sensitive"&&(_=_.toLowerCase()),o.has(_)?!0:s.has(_)?!1:(p.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...s],input:p.value,inst:d,continue:!1}),{})}),reverseTransform:((h,p)=>h===!0?i[0]||"true":t[0]||"false"),error:n.error});return d}function lr(r,e,n,i={}){const t=S(i),o={...S(i),check:"string_format",type:"string",format:e,fn:typeof n=="function"?n:a=>n.test(a),...t};return n instanceof RegExp&&(o.pattern=n),new r(o)}function rn(r){let e=r?.target??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:r.processors??{},metadataRegistry:r?.metadata??Ne,target:e,unrepresentable:r?.unrepresentable??"throw",override:r?.override??(()=>{}),io:r?.io??"output",counter:0,seen:new Map,cycles:r?.cycles??"ref",reused:r?.reused??"inline",external:r?.external??void 0}}function te(r,e,n={path:[],schemaPath:[]}){var i;const t=r._zod.def,o=e.seen.get(r);if(o)return o.count++,n.schemaPath.includes(r)&&(o.cycle=n.path),o.schema;const s={schema:{},count:1,cycle:void 0,path:n.path};e.seen.set(r,s);const a=r._zod.toJSONSchema?.();if(a)s.schema=a;else{const l={...n,schemaPath:[...n.schemaPath,r],path:n.path};if(r._zod.processJSONSchema)r._zod.processJSONSchema(e,s.schema,l);else{const d=s.schema,h=e.processors[t.type];if(!h)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${t.type}`);h(r,e,d,l)}const f=r._zod.parent;f&&(s.ref||(s.ref=f),te(f,e,l),e.seen.get(f).isParent=!0)}const c=e.metadataRegistry.get(r);return c&&Object.assign(s.schema,c),e.io==="input"&&we(r)&&(delete s.schema.examples,delete s.schema.default),e.io==="input"&&"_prefault"in s.schema&&((i=s.schema).default??(i.default=s.schema._prefault)),delete s.schema._prefault,e.seen.get(r).schema}function on(r,e){const n=r.seen.get(e);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=new Map;for(const s of r.seen.entries()){const a=r.metadataRegistry.get(s[0])?.id;if(a){const c=i.get(a);if(c&&c!==s[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(a,s[0])}}const t=s=>{const a=r.target==="draft-2020-12"?"$defs":"definitions";if(r.external){const f=r.external.registry.get(s[0])?.id,d=r.external.uri??(p=>p);if(f)return{ref:d(f)};const h=s[1].defId??s[1].schema.id??`schema${r.counter++}`;return s[1].defId=h,{defId:h,ref:`${d("__shared")}#/${a}/${h}`}}if(s[1]===n)return{ref:"#"};const u=`#/${a}/`,l=s[1].schema.id??`__schema${r.counter++}`;return{defId:l,ref:u+l}},o=s=>{if(s[1].schema.$ref)return;const a=s[1],{ref:c,defId:u}=t(s);a.def={...a.schema},u&&(a.defId=u);const l=a.schema;for(const f in l)delete l[f];l.$ref=c};if(r.cycles==="throw")for(const s of r.seen.entries()){const a=s[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
1155
+
1156
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const s of r.seen.entries()){const a=s[1];if(e===s[0]){o(s);continue}if(r.external){const u=r.external.registry.get(s[0])?.id;if(e!==s[0]&&u){o(s);continue}}if(r.metadataRegistry.get(s[0])?.id){o(s);continue}if(a.cycle){o(s);continue}if(a.count>1&&r.reused==="ref"){o(s);continue}}}function sn(r,e){const n=r.seen.get(e);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=a=>{const c=r.seen.get(a);if(c.ref===null)return;const u=c.def??c.schema,l={...u},f=c.ref;if(c.ref=null,f){i(f);const h=r.seen.get(f),p=h.schema;if(p.$ref&&(r.target==="draft-07"||r.target==="draft-04"||r.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(p)):Object.assign(u,p),Object.assign(u,l),a._zod.parent===f)for(const w in u)w==="$ref"||w==="allOf"||w in l||delete u[w];if(p.$ref&&h.def)for(const w in u)w==="$ref"||w==="allOf"||w in h.def&&JSON.stringify(u[w])===JSON.stringify(h.def[w])&&delete u[w]}const d=a._zod.parent;if(d&&d!==f){i(d);const h=r.seen.get(d);if(h?.schema.$ref&&(u.$ref=h.schema.$ref,h.def))for(const p in u)p==="$ref"||p==="allOf"||p in h.def&&JSON.stringify(u[p])===JSON.stringify(h.def[p])&&delete u[p]}r.override({zodSchema:a,jsonSchema:u,path:c.path??[]})};for(const a of[...r.seen.entries()].reverse())i(a[0]);const t={};if(r.target==="draft-2020-12"?t.$schema="https://json-schema.org/draft/2020-12/schema":r.target==="draft-07"?t.$schema="http://json-schema.org/draft-07/schema#":r.target==="draft-04"?t.$schema="http://json-schema.org/draft-04/schema#":r.target,r.external?.uri){const a=r.external.registry.get(e)?.id;if(!a)throw new Error("Schema is missing an `id` property");t.$id=r.external.uri(a)}Object.assign(t,n.def??n.schema);const o=r.metadataRegistry.get(e)?.id;o!==void 0&&t.id===o&&delete t.id;const s=r.external?.defs??{};for(const a of r.seen.entries()){const c=a[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,s[c.defId]=c.def)}r.external||Object.keys(s).length>0&&(r.target==="draft-2020-12"?t.$defs=s:t.definitions=s);try{const a=JSON.parse(JSON.stringify(t));return Object.defineProperty(a,"~standard",{value:{...e["~standard"],jsonSchema:{input:Mn(e,"input",r.processors),output:Mn(e,"output",r.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function we(r,e){const n=e??{seen:new Set};if(n.seen.has(r))return!1;n.seen.add(r);const i=r._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return we(i.element,n);if(i.type==="set")return we(i.valueType,n);if(i.type==="lazy")return we(i.getter(),n);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return we(i.innerType,n);if(i.type==="intersection")return we(i.left,n)||we(i.right,n);if(i.type==="record"||i.type==="map")return we(i.keyType,n)||we(i.valueType,n);if(i.type==="pipe")return r._zod.traits.has("$ZodCodec")?!0:we(i.in,n)||we(i.out,n);if(i.type==="object"){for(const t in i.shape)if(we(i.shape[t],n))return!0;return!1}if(i.type==="union"){for(const t of i.options)if(we(t,n))return!0;return!1}if(i.type==="tuple"){for(const t of i.items)if(we(t,n))return!0;return!!(i.rest&&we(i.rest,n))}return!1}const wp=(r,e={})=>n=>{const i=rn({...n,processors:e});return te(r,i),on(i,r),sn(i,r)},Mn=(r,e,n={})=>i=>{const{libraryOptions:t,target:o}=i??{},s=rn({...t??{},target:o,io:e,processors:n});return te(r,s),on(s,r),sn(s,r)},uy={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Sp=(r,e,n,i)=>{const t=n;t.type="string";const{minimum:o,maximum:s,format:a,patterns:c,contentEncoding:u}=r._zod.bag;if(typeof o=="number"&&(t.minLength=o),typeof s=="number"&&(t.maxLength=s),a&&(t.format=uy[a]??a,t.format===""&&delete t.format,a==="time"&&delete t.format),u&&(t.contentEncoding=u),c&&c.size>0){const l=[...c];l.length===1?t.pattern=l[0].source:l.length>1&&(t.allOf=[...l.map(f=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))])}},kp=(r,e,n,i)=>{const t=n,{minimum:o,maximum:s,format:a,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:l}=r._zod.bag;typeof a=="string"&&a.includes("int")?t.type="integer":t.type="number";const f=typeof l=="number"&&l>=(o??Number.NEGATIVE_INFINITY),d=typeof u=="number"&&u<=(s??Number.POSITIVE_INFINITY),h=e.target==="draft-04"||e.target==="openapi-3.0";f?h?(t.minimum=l,t.exclusiveMinimum=!0):t.exclusiveMinimum=l:typeof o=="number"&&(t.minimum=o),d?h?(t.maximum=u,t.exclusiveMaximum=!0):t.exclusiveMaximum=u:typeof s=="number"&&(t.maximum=s),typeof c=="number"&&(t.multipleOf=c)},Ip=(r,e,n,i)=>{n.type="boolean"},$p=(r,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},Ep=(r,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},Tp=(r,e,n,i)=>{e.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},Op=(r,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},Pp=(r,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},zp=(r,e,n,i)=>{n.not={}},Ap=(r,e,n,i)=>{},Np=(r,e,n,i)=>{},Up=(r,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},Dp=(r,e,n,i)=>{const t=r._zod.def,o=ls(t.entries);o.every(s=>typeof s=="number")&&(n.type="number"),o.every(s=>typeof s=="string")&&(n.type="string"),n.enum=o},Rp=(r,e,n,i)=>{const t=r._zod.def,o=[];for(const s of t.values)if(s===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(s))}else o.push(s);if(o.length!==0)if(o.length===1){const s=o[0];n.type=s===null?"null":typeof s,e.target==="draft-04"||e.target==="openapi-3.0"?n.enum=[s]:n.const=s}else o.every(s=>typeof s=="number")&&(n.type="number"),o.every(s=>typeof s=="string")&&(n.type="string"),o.every(s=>typeof s=="boolean")&&(n.type="boolean"),o.every(s=>s===null)&&(n.type="null"),n.enum=o},Cp=(r,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},Lp=(r,e,n,i)=>{const t=n,o=r._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");t.type="string",t.pattern=o.source},Mp=(r,e,n,i)=>{const t=n,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:a,mime:c}=r._zod.bag;s!==void 0&&(o.minLength=s),a!==void 0&&(o.maxLength=a),c?c.length===1?(o.contentMediaType=c[0],Object.assign(t,o)):(Object.assign(t,o),t.anyOf=c.map(u=>({contentMediaType:u}))):Object.assign(t,o)},jp=(r,e,n,i)=>{n.type="boolean"},Bp=(r,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Fp=(r,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},Hp=(r,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Zp=(r,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},qp=(r,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Vp=(r,e,n,i)=>{const t=n,o=r._zod.def,{minimum:s,maximum:a}=r._zod.bag;typeof s=="number"&&(t.minItems=s),typeof a=="number"&&(t.maxItems=a),t.type="array",t.items=te(o.element,e,{...i,path:[...i.path,"items"]})},Gp=(r,e,n,i)=>{const t=n,o=r._zod.def;t.type="object",t.properties={};const s=o.shape;for(const u in s)t.properties[u]=te(s[u],e,{...i,path:[...i.path,"properties",u]});const a=new Set(Object.keys(s)),c=new Set([...a].filter(u=>{const l=o.shape[u]._zod;return e.io==="input"?l.optin===void 0:l.optout===void 0}));c.size>0&&(t.required=Array.from(c)),o.catchall?._zod.def.type==="never"?t.additionalProperties=!1:o.catchall?o.catchall&&(t.additionalProperties=te(o.catchall,e,{...i,path:[...i.path,"additionalProperties"]})):e.io==="output"&&(t.additionalProperties=!1)},ca=(r,e,n,i)=>{const t=r._zod.def,o=t.inclusive===!1,s=t.options.map((a,c)=>te(a,e,{...i,path:[...i.path,o?"oneOf":"anyOf",c]}));o?n.oneOf=s:n.anyOf=s},Kp=(r,e,n,i)=>{const t=r._zod.def,o=te(t.left,e,{...i,path:[...i.path,"allOf",0]}),s=te(t.right,e,{...i,path:[...i.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,c=[...a(o)?o.allOf:[o],...a(s)?s.allOf:[s]];n.allOf=c},Jp=(r,e,n,i)=>{const t=n,o=r._zod.def;t.type="array";const s=e.target==="draft-2020-12"?"prefixItems":"items",a=e.target==="draft-2020-12"||e.target==="openapi-3.0"?"items":"additionalItems",c=o.items.map((d,h)=>te(d,e,{...i,path:[...i.path,s,h]})),u=o.rest?te(o.rest,e,{...i,path:[...i.path,a,...e.target==="openapi-3.0"?[o.items.length]:[]]}):null;e.target==="draft-2020-12"?(t.prefixItems=c,u&&(t.items=u)):e.target==="openapi-3.0"?(t.items={anyOf:c},u&&t.items.anyOf.push(u),t.minItems=c.length,u||(t.maxItems=c.length)):(t.items=c,u&&(t.additionalItems=u));const{minimum:l,maximum:f}=r._zod.bag;typeof l=="number"&&(t.minItems=l),typeof f=="number"&&(t.maxItems=f)},Wp=(r,e,n,i)=>{const t=n,o=r._zod.def;t.type="object";const s=o.keyType,c=s._zod.bag?.patterns;if(o.mode==="loose"&&c&&c.size>0){const l=te(o.valueType,e,{...i,path:[...i.path,"patternProperties","*"]});t.patternProperties={};for(const f of c)t.patternProperties[f.source]=l}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(t.propertyNames=te(o.keyType,e,{...i,path:[...i.path,"propertyNames"]})),t.additionalProperties=te(o.valueType,e,{...i,path:[...i.path,"additionalProperties"]});const u=s._zod.values;if(u){const l=[...u].filter(f=>typeof f=="string"||typeof f=="number");l.length>0&&(t.required=l)}},Xp=(r,e,n,i)=>{const t=r._zod.def,o=te(t.innerType,e,i),s=e.seen.get(r);e.target==="openapi-3.0"?(s.ref=t.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}]},Yp=(r,e,n,i)=>{const t=r._zod.def;te(t.innerType,e,i);const o=e.seen.get(r);o.ref=t.innerType},Qp=(r,e,n,i)=>{const t=r._zod.def;te(t.innerType,e,i);const o=e.seen.get(r);o.ref=t.innerType,n.default=JSON.parse(JSON.stringify(t.defaultValue))},em=(r,e,n,i)=>{const t=r._zod.def;te(t.innerType,e,i);const o=e.seen.get(r);o.ref=t.innerType,e.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(t.defaultValue)))},tm=(r,e,n,i)=>{const t=r._zod.def;te(t.innerType,e,i);const o=e.seen.get(r);o.ref=t.innerType;let s;try{s=t.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=s},nm=(r,e,n,i)=>{const t=r._zod.def,o=t.in._zod.traits.has("$ZodTransform"),s=e.io==="input"?o?t.out:t.in:t.out;te(s,e,i);const a=e.seen.get(r);a.ref=s},rm=(r,e,n,i)=>{const t=r._zod.def;te(t.innerType,e,i);const o=e.seen.get(r);o.ref=t.innerType,n.readOnly=!0},im=(r,e,n,i)=>{const t=r._zod.def;te(t.innerType,e,i);const o=e.seen.get(r);o.ref=t.innerType},ua=(r,e,n,i)=>{const t=r._zod.def;te(t.innerType,e,i);const o=e.seen.get(r);o.ref=t.innerType},om=(r,e,n,i)=>{const t=r._zod.innerType;te(t,e,i);const o=e.seen.get(r);o.ref=t},ts={string:Sp,number:kp,boolean:Ip,bigint:$p,symbol:Ep,null:Tp,undefined:Op,void:Pp,never:zp,any:Ap,unknown:Np,date:Up,enum:Dp,literal:Rp,nan:Cp,template_literal:Lp,file:Mp,success:jp,custom:Bp,function:Fp,transform:Hp,map:Zp,set:qp,array:Vp,object:Gp,union:ca,intersection:Kp,tuple:Jp,record:Wp,nullable:Xp,nonoptional:Yp,default:Qp,prefault:em,catch:tm,pipe:nm,readonly:rm,promise:im,optional:ua,lazy:om};function la(r,e){if("_idmap"in r){const i=r,t=rn({...e,processors:ts}),o={};for(const c of i._idmap.entries()){const[u,l]=c;te(l,t)}const s={},a={registry:i,uri:e?.uri,defs:o};t.external=a;for(const c of i._idmap.entries()){const[u,l]=c;on(t,l),s[u]=sn(t,l)}if(Object.keys(o).length>0){const c=t.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[c]:o}}return{schemas:s}}const n=rn({...e,processors:ts});return te(r,n),on(n,r),sn(n,r)}class ly{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let n=e?.target??"draft-2020-12";n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),this.ctx=rn({processors:ts,target:n,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,n={path:[],schemaPath:[]}){return te(e,this.ctx,n)}emit(e,n){n&&(n.cycles&&(this.ctx.cycles=n.cycles),n.reused&&(this.ctx.reused=n.reused),n.external&&(this.ctx.external=n.external)),on(this.ctx,e);const i=sn(this.ctx,e),{"~standard":t,...o}=i;return o}}const dy=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),sm=Object.freeze(Object.defineProperty({__proto__:null,$ZodAny:Yf,$ZodArray:rh,$ZodAsyncError:zt,$ZodBase64:jf,$ZodBase64URL:Ff,$ZodBigInt:Ns,$ZodBigIntFormat:Kf,$ZodBoolean:As,$ZodCIDRv4:Lf,$ZodCIDRv6:Mf,$ZodCUID:$f,$ZodCUID2:Ef,$ZodCatch:kh,$ZodCheck:ae,$ZodCheckBigIntFormat:tf,$ZodCheckEndsWith:pf,$ZodCheckGreaterThan:Os,$ZodCheckIncludes:ff,$ZodCheckLengthEquals:cf,$ZodCheckLessThan:Ts,$ZodCheckLowerCase:lf,$ZodCheckMaxLength:sf,$ZodCheckMaxSize:nf,$ZodCheckMimeType:gf,$ZodCheckMinLength:af,$ZodCheckMinSize:rf,$ZodCheckMultipleOf:Qd,$ZodCheckNumberFormat:ef,$ZodCheckOverwrite:bf,$ZodCheckProperty:mf,$ZodCheckRegex:uf,$ZodCheckSizeEquals:of,$ZodCheckStartsWith:hf,$ZodCheckStringFormat:Wn,$ZodCheckUpperCase:df,$ZodCodec:Cs,$ZodCustom:Ah,$ZodCustomStringFormat:Vf,$ZodDate:nh,$ZodDefault:_h,$ZodDiscriminatedUnion:uh,$ZodE164:Hf,$ZodEmail:wf,$ZodEmoji:kf,$ZodEncodeError:bi,$ZodEnum:ph,$ZodError:hs,$ZodExactOptional:vh,$ZodFile:gh,$ZodFunction:Oh,$ZodGUID:_f,$ZodIPv4:Df,$ZodIPv6:Rf,$ZodISODate:Af,$ZodISODateTime:zf,$ZodISODuration:Uf,$ZodISOTime:Nf,$ZodIntersection:lh,$ZodJWT:qf,$ZodKSUID:Pf,$ZodLazy:zh,$ZodLiteral:mh,$ZodMAC:Cf,$ZodMap:fh,$ZodNaN:Ih,$ZodNanoID:If,$ZodNever:eh,$ZodNonOptional:wh,$ZodNull:Xf,$ZodNullable:yh,$ZodNumber:zs,$ZodNumberFormat:Gf,$ZodObject:sh,$ZodObjectJIT:ah,$ZodOptional:Ds,$ZodPipe:Rs,$ZodPrefault:xh,$ZodPreprocess:$h,$ZodPromise:Ph,$ZodReadonly:Eh,$ZodRealError:Le,$ZodRecord:dh,$ZodRegistry:Rh,$ZodSet:hh,$ZodString:Xn,$ZodStringFormat:ie,$ZodSuccess:Sh,$ZodSymbol:Jf,$ZodTemplateLiteral:Th,$ZodTransform:bh,$ZodTuple:Us,$ZodType:C,$ZodULID:Tf,$ZodURL:Sf,$ZodUUID:xf,$ZodUndefined:Wf,$ZodUnion:Ii,$ZodUnknown:Qf,$ZodVoid:th,$ZodXID:Of,$ZodXor:ch,$brand:us,$constructor:b,$input:js,$output:Ms,Doc:vf,JSONSchema:dy,JSONSchemaGenerator:ly,NEVER:cs,TimePrecision:aa,_any:sp,_array:hp,_base64:ra,_base64url:ia,_bigint:Qh,_boolean:Xh,_catch:ry,_check:vp,_cidrv4:ta,_cidrv6:na,_coercedBigint:ep,_coercedBoolean:Yh,_coercedDate:dp,_coercedNumber:qh,_coercedString:Lh,_cuid:Ks,_cuid2:Js,_custom:mp,_date:lp,_decode:vs,_decodeAsync:_s,_default:ey,_discriminatedUnion:F1,_e164:oa,_email:Bs,_emoji:Vs,_encode:bs,_encodeAsync:ys,_endsWith:rr,_enum:K1,_file:pp,_float32:Gh,_float64:Kh,_gt:ct,_gte:ke,_guid:li,_includes:tr,_int:Vh,_int32:Jh,_int64:tp,_intersection:H1,_ipv4:Qs,_ipv6:ea,_isoDate:Bh,_isoDateTime:jh,_isoDuration:Hh,_isoTime:Fh,_jwt:sa,_ksuid:Ys,_lazy:ay,_length:pn,_literal:W1,_lowercase:Qn,_lt:at,_lte:De,_mac:Mh,_map:V1,_max:De,_maxLength:hn,_maxSize:Bt,_mime:ir,_min:ke,_minLength:gt,_minSize:ut,_multipleOf:Rt,_nan:fp,_nanoid:Gs,_nativeEnum:J1,_negative:Oi,_never:cp,_nonnegative:zi,_nonoptional:ty,_nonpositive:Pi,_normalize:or,_null:op,_nullable:Q1,_number:Zh,_optional:Y1,_overwrite:nt,_parse:Zn,_parseAsync:qn,_pipe:iy,_positive:Ti,_promise:cy,_property:Ai,_readonly:oy,_record:q1,_refine:gp,_regex:Yn,_safeDecode:ws,_safeDecodeAsync:ks,_safeEncode:xs,_safeEncodeAsync:Ss,_safeParse:Vn,_safeParseAsync:Gn,_set:G1,_size:fn,_slugify:ur,_startsWith:nr,_string:Ch,_stringFormat:lr,_stringbool:xp,_success:ny,_superRefine:bp,_symbol:rp,_templateLiteral:sy,_toLowerCase:ar,_toUpperCase:cr,_transform:X1,_trim:sr,_tuple:Z1,_uint32:Wh,_uint64:np,_ulid:Ws,_undefined:ip,_union:j1,_unknown:ap,_uppercase:er,_url:Ei,_uuid:Fs,_uuidv4:Hs,_uuidv6:Zs,_uuidv7:qs,_void:up,_xid:Xs,_xor:B1,clone:Ce,config:pe,createStandardJSONSchemaMethod:Mn,createToJSONSchemaMethod:wp,decode:vb,decodeAsync:_b,describe:yp,encode:bb,encodeAsync:yb,extractDefs:on,finalize:sn,flattenError:wi,formatError:Si,globalConfig:Ln,globalRegistry:Ne,initializeContext:rn,isValidBase64:Ps,isValidBase64URL:Bf,isValidJWT:Zf,locales:Ls,meta:_p,parse:Yo,parseAsync:Qo,prettifyError:ms,process:te,regexes:ki,registry:$i,safeDecode:wb,safeDecodeAsync:kb,safeEncode:xb,safeEncodeAsync:Sb,safeParse:gs,safeParseAsync:bd,toDotPath:gd,toJSONSchema:la,treeifyError:ps,util:fs,version:yf},Symbol.toStringTag,{value:"Module"}));function da(r){return!!r._zod}function am(r,e){return da(r)?gs(r,e):r.safeParse(e)}function fy(r){if(!r)return;let e;if(da(r)?e=r._zod?.def?.shape:e=r.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function hy(r){if(da(r)){const o=r._zod?.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.values[0]}}const n=r._def;if(n){if(n.value!==void 0)return n.value;if(Array.isArray(n.values)&&n.values.length>0)return n.values[0]}const i=r.value;if(i!==void 0)return i}const py=Object.freeze(Object.defineProperty({__proto__:null,endsWith:rr,gt:ct,gte:ke,includes:tr,length:pn,lowercase:Qn,lt:at,lte:De,maxLength:hn,maxSize:Bt,mime:ir,minLength:gt,minSize:ut,multipleOf:Rt,negative:Oi,nonnegative:zi,nonpositive:Pi,normalize:or,overwrite:nt,positive:Ti,property:Ai,regex:Yn,size:fn,slugify:ur,startsWith:nr,toLowerCase:ar,toUpperCase:cr,trim:sr,uppercase:er},Symbol.toStringTag,{value:"Module"})),Ni=b("ZodISODateTime",(r,e)=>{zf.init(r,e),ne.init(r,e)});function fa(r){return jh(Ni,r)}const Ui=b("ZodISODate",(r,e)=>{Af.init(r,e),ne.init(r,e)});function cm(r){return Bh(Ui,r)}const Di=b("ZodISOTime",(r,e)=>{Nf.init(r,e),ne.init(r,e)});function um(r){return Fh(Di,r)}const Ri=b("ZodISODuration",(r,e)=>{Uf.init(r,e),ne.init(r,e)});function lm(r){return Hh(Ri,r)}const ha=Object.freeze(Object.defineProperty({__proto__:null,ZodISODate:Ui,ZodISODateTime:Ni,ZodISODuration:Ri,ZodISOTime:Di,date:cm,datetime:fa,duration:lm,time:um},Symbol.toStringTag,{value:"Module"})),dm=(r,e)=>{hs.init(r,e),r.name="ZodError",Object.defineProperties(r,{format:{value:n=>Si(r,n)},flatten:{value:n=>wi(r,n)},addIssue:{value:n=>{r.issues.push(n),r.message=JSON.stringify(r.issues,ai,2)}},addIssues:{value:n=>{r.issues.push(...n),r.message=JSON.stringify(r.issues,ai,2)}},isEmpty:{get(){return r.issues.length===0}}})},fm=b("ZodError",dm),Ee=b("ZodError",dm,{Parent:Error}),pa=Zn(Ee),ma=qn(Ee),ga=Vn(Ee),ba=Gn(Ee),va=bs(Ee),ya=vs(Ee),_a=ys(Ee),xa=_s(Ee),wa=xs(Ee),Sa=ws(Ee),ka=Ss(Ee),Ia=ks(Ee),al=new WeakMap;function dr(r,e,n){const i=Object.getPrototypeOf(r);let t=al.get(i);if(t||(t=new Set,al.set(i,t)),!t.has(e)){t.add(e);for(const o in n){const s=n[o];Object.defineProperty(i,o,{configurable:!0,enumerable:!1,get(){const a=s.bind(this);return Object.defineProperty(this,o,{configurable:!0,writable:!0,enumerable:!0,value:a}),a},set(a){Object.defineProperty(this,o,{configurable:!0,writable:!0,enumerable:!0,value:a})}})}}}const M=b("ZodType",(r,e)=>(C.init(r,e),Object.assign(r["~standard"],{jsonSchema:{input:Mn(r,"input"),output:Mn(r,"output")}}),r.toJSONSchema=wp(r,{}),r.def=e,r.type=e.type,Object.defineProperty(r,"_def",{value:e}),r.parse=(n,i)=>pa(r,n,i,{callee:r.parse}),r.safeParse=(n,i)=>ga(r,n,i),r.parseAsync=async(n,i)=>ma(r,n,i,{callee:r.parseAsync}),r.safeParseAsync=async(n,i)=>ba(r,n,i),r.spa=r.safeParseAsync,r.encode=(n,i)=>va(r,n,i),r.decode=(n,i)=>ya(r,n,i),r.encodeAsync=async(n,i)=>_a(r,n,i),r.decodeAsync=async(n,i)=>xa(r,n,i),r.safeEncode=(n,i)=>wa(r,n,i),r.safeDecode=(n,i)=>Sa(r,n,i),r.safeEncodeAsync=async(n,i)=>ka(r,n,i),r.safeDecodeAsync=async(n,i)=>Ia(r,n,i),dr(r,"ZodType",{check(...n){const i=this.def;return this.clone(tt(i,{checks:[...i.checks??[],...n.map(t=>typeof t=="function"?{_zod:{check:t,def:{check:"custom"},onattach:[]}}:t)]}),{parent:!0})},with(...n){return this.check(...n)},clone(n,i){return Ce(this,n,i)},brand(){return this},register(n,i){return n.add(this,i),this},refine(n,i){return this.check(ko(n,i))},superRefine(n,i){return this.check(Io(n,i))},overwrite(n){return this.check(nt(n))},optional(){return re(this)},exactOptional(){return ro(this)},nullable(){return un(this)},nullish(){return re(un(this))},nonoptional(n){return uo(this,n)},array(){return R(this)},or(n){return Z([this,n])},and(n){return wn(this,n)},transform(n){return Bn(this,Ur(n))},default(n){return so(this,n)},prefault(n){return co(this,n)},catch(n){return ho(this,n)},pipe(n){return Bn(this,n)},readonly(){return bo(this)},describe(n){const i=this.clone();return Ne.add(i,{description:n}),i},meta(...n){if(n.length===0)return Ne.get(this);const i=this.clone();return Ne.add(i,n[0]),i},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(n){return n(this)}}),Object.defineProperty(r,"description",{get(){return Ne.get(r)?.description},configurable:!0}),r)),fr=b("_ZodString",(r,e)=>{Xn.init(r,e),M.init(r,e),r._zod.processJSONSchema=(i,t,o)=>Sp(r,i,t);const n=r._zod.bag;r.format=n.format??null,r.minLength=n.minimum??null,r.maxLength=n.maximum??null,dr(r,"_ZodString",{regex(...i){return this.check(Yn(...i))},includes(...i){return this.check(tr(...i))},startsWith(...i){return this.check(nr(...i))},endsWith(...i){return this.check(rr(...i))},min(...i){return this.check(gt(...i))},max(...i){return this.check(hn(...i))},length(...i){return this.check(pn(...i))},nonempty(...i){return this.check(gt(1,...i))},lowercase(i){return this.check(Qn(i))},uppercase(i){return this.check(er(i))},trim(){return this.check(sr())},normalize(...i){return this.check(or(...i))},toLowerCase(){return this.check(ar())},toUpperCase(){return this.check(cr())},slugify(){return this.check(ur())}})}),mn=b("ZodString",(r,e)=>{Xn.init(r,e),fr.init(r,e),r.email=n=>r.check(Bs(hr,n)),r.url=n=>r.check(Ei(gn,n)),r.jwt=n=>r.check(sa(Tr,n)),r.emoji=n=>r.check(Vs(pr,n)),r.guid=n=>r.check(li(an,n)),r.uuid=n=>r.check(Fs(Je,n)),r.uuidv4=n=>r.check(Hs(Je,n)),r.uuidv6=n=>r.check(Zs(Je,n)),r.uuidv7=n=>r.check(qs(Je,n)),r.nanoid=n=>r.check(Gs(mr,n)),r.guid=n=>r.check(li(an,n)),r.cuid=n=>r.check(Ks(gr,n)),r.cuid2=n=>r.check(Js(br,n)),r.ulid=n=>r.check(Ws(vr,n)),r.base64=n=>r.check(ra(Ir,n)),r.base64url=n=>r.check(ia($r,n)),r.xid=n=>r.check(Xs(yr,n)),r.ksuid=n=>r.check(Ys(_r,n)),r.ipv4=n=>r.check(Qs(xr,n)),r.ipv6=n=>r.check(ea(wr,n)),r.cidrv4=n=>r.check(ta(Sr,n)),r.cidrv6=n=>r.check(na(kr,n)),r.e164=n=>r.check(oa(Er,n)),r.datetime=n=>r.check(fa(n)),r.date=n=>r.check(cm(n)),r.time=n=>r.check(um(n)),r.duration=n=>r.check(lm(n))});function v(r){return Ch(mn,r)}const ne=b("ZodStringFormat",(r,e)=>{ie.init(r,e),fr.init(r,e)}),hr=b("ZodEmail",(r,e)=>{wf.init(r,e),ne.init(r,e)});function $a(r){return Bs(hr,r)}const an=b("ZodGUID",(r,e)=>{_f.init(r,e),ne.init(r,e)});function Ea(r){return li(an,r)}const Je=b("ZodUUID",(r,e)=>{xf.init(r,e),ne.init(r,e)});function Ta(r){return Fs(Je,r)}function Oa(r){return Hs(Je,r)}function Pa(r){return Zs(Je,r)}function za(r){return qs(Je,r)}const gn=b("ZodURL",(r,e)=>{Sf.init(r,e),ne.init(r,e)});function Aa(r){return Ei(gn,r)}function Na(r){return Ei(gn,{protocol:$s,hostname:Rd,...S(r)})}const pr=b("ZodEmoji",(r,e)=>{kf.init(r,e),ne.init(r,e)});function Ua(r){return Vs(pr,r)}const mr=b("ZodNanoID",(r,e)=>{If.init(r,e),ne.init(r,e)});function Da(r){return Gs(mr,r)}const gr=b("ZodCUID",(r,e)=>{$f.init(r,e),ne.init(r,e)});function Ra(r){return Ks(gr,r)}const br=b("ZodCUID2",(r,e)=>{Ef.init(r,e),ne.init(r,e)});function Ca(r){return Js(br,r)}const vr=b("ZodULID",(r,e)=>{Tf.init(r,e),ne.init(r,e)});function La(r){return Ws(vr,r)}const yr=b("ZodXID",(r,e)=>{Of.init(r,e),ne.init(r,e)});function Ma(r){return Xs(yr,r)}const _r=b("ZodKSUID",(r,e)=>{Pf.init(r,e),ne.init(r,e)});function ja(r){return Ys(_r,r)}const xr=b("ZodIPv4",(r,e)=>{Df.init(r,e),ne.init(r,e)});function Ba(r){return Qs(xr,r)}const Ci=b("ZodMAC",(r,e)=>{Cf.init(r,e),ne.init(r,e)});function Fa(r){return Mh(Ci,r)}const wr=b("ZodIPv6",(r,e)=>{Rf.init(r,e),ne.init(r,e)});function Ha(r){return ea(wr,r)}const Sr=b("ZodCIDRv4",(r,e)=>{Lf.init(r,e),ne.init(r,e)});function Za(r){return ta(Sr,r)}const kr=b("ZodCIDRv6",(r,e)=>{Mf.init(r,e),ne.init(r,e)});function qa(r){return na(kr,r)}const Ir=b("ZodBase64",(r,e)=>{jf.init(r,e),ne.init(r,e)});function Va(r){return ra(Ir,r)}const $r=b("ZodBase64URL",(r,e)=>{Ff.init(r,e),ne.init(r,e)});function Ga(r){return ia($r,r)}const Er=b("ZodE164",(r,e)=>{Hf.init(r,e),ne.init(r,e)});function Ka(r){return oa(Er,r)}const Tr=b("ZodJWT",(r,e)=>{qf.init(r,e),ne.init(r,e)});function Ja(r){return sa(Tr,r)}const Ft=b("ZodCustomStringFormat",(r,e)=>{Vf.init(r,e),ne.init(r,e)});function Wa(r,e,n={}){return lr(Ft,r,e,n)}function Xa(r){return lr(Ft,"hostname",Dd,r)}function Ya(r){return lr(Ft,"hex",Xd,r)}function Qa(r,e){const n=e?.enc??"hex",i=`${r}_${n}`,t=ki[i];if(!t)throw new Error(`Unrecognized hash format: ${i}`);return lr(Ft,i,t,e)}const bn=b("ZodNumber",(r,e)=>{zs.init(r,e),M.init(r,e),r._zod.processJSONSchema=(i,t,o)=>kp(r,i,t),dr(r,"ZodNumber",{gt(i,t){return this.check(ct(i,t))},gte(i,t){return this.check(ke(i,t))},min(i,t){return this.check(ke(i,t))},lt(i,t){return this.check(at(i,t))},lte(i,t){return this.check(De(i,t))},max(i,t){return this.check(De(i,t))},int(i){return this.check(jn(i))},safe(i){return this.check(jn(i))},positive(i){return this.check(ct(0,i))},nonnegative(i){return this.check(ke(0,i))},negative(i){return this.check(at(0,i))},nonpositive(i){return this.check(De(0,i))},multipleOf(i,t){return this.check(Rt(i,t))},step(i,t){return this.check(Rt(i,t))},finite(){return this}});const n=r._zod.bag;r.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,r.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,r.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),r.isFinite=!0,r.format=n.format??null});function L(r){return Zh(bn,r)}const vt=b("ZodNumberFormat",(r,e)=>{Gf.init(r,e),bn.init(r,e)});function jn(r){return Vh(vt,r)}function ec(r){return Gh(vt,r)}function tc(r){return Kh(vt,r)}function nc(r){return Jh(vt,r)}function rc(r){return Wh(vt,r)}const vn=b("ZodBoolean",(r,e)=>{As.init(r,e),M.init(r,e),r._zod.processJSONSchema=(n,i,t)=>Ip(r,n,i)});function X(r){return Xh(vn,r)}const yn=b("ZodBigInt",(r,e)=>{Ns.init(r,e),M.init(r,e),r._zod.processJSONSchema=(i,t,o)=>$p(r,i),r.gte=(i,t)=>r.check(ke(i,t)),r.min=(i,t)=>r.check(ke(i,t)),r.gt=(i,t)=>r.check(ct(i,t)),r.gte=(i,t)=>r.check(ke(i,t)),r.min=(i,t)=>r.check(ke(i,t)),r.lt=(i,t)=>r.check(at(i,t)),r.lte=(i,t)=>r.check(De(i,t)),r.max=(i,t)=>r.check(De(i,t)),r.positive=i=>r.check(ct(BigInt(0),i)),r.negative=i=>r.check(at(BigInt(0),i)),r.nonpositive=i=>r.check(De(BigInt(0),i)),r.nonnegative=i=>r.check(ke(BigInt(0),i)),r.multipleOf=(i,t)=>r.check(Rt(i,t));const n=r._zod.bag;r.minValue=n.minimum??null,r.maxValue=n.maximum??null,r.format=n.format??null});function ic(r){return Qh(yn,r)}const Or=b("ZodBigIntFormat",(r,e)=>{Kf.init(r,e),yn.init(r,e)});function oc(r){return tp(Or,r)}function sc(r){return np(Or,r)}const Li=b("ZodSymbol",(r,e)=>{Jf.init(r,e),M.init(r,e),r._zod.processJSONSchema=(n,i,t)=>Ep(r,n)});function ac(r){return rp(Li,r)}const Mi=b("ZodUndefined",(r,e)=>{Wf.init(r,e),M.init(r,e),r._zod.processJSONSchema=(n,i,t)=>Op(r,n)});function cn(r){return ip(Mi,r)}const ji=b("ZodNull",(r,e)=>{Xf.init(r,e),M.init(r,e),r._zod.processJSONSchema=(n,i,t)=>Tp(r,n,i)});function Pr(r){return op(ji,r)}const Bi=b("ZodAny",(r,e)=>{Yf.init(r,e),M.init(r,e),r._zod.processJSONSchema=(n,i,t)=>Ap()});function zr(){return sp(Bi)}const Fi=b("ZodUnknown",(r,e)=>{Qf.init(r,e),M.init(r,e),r._zod.processJSONSchema=(n,i,t)=>Np()});function K(){return ap(Fi)}const Hi=b("ZodNever",(r,e)=>{eh.init(r,e),M.init(r,e),r._zod.processJSONSchema=(n,i,t)=>zp(r,n,i)});function Ct(r){return cp(Hi,r)}const Zi=b("ZodVoid",(r,e)=>{th.init(r,e),M.init(r,e),r._zod.processJSONSchema=(n,i,t)=>Pp(r,n)});function cc(r){return up(Zi,r)}const Ar=b("ZodDate",(r,e)=>{nh.init(r,e),M.init(r,e),r._zod.processJSONSchema=(i,t,o)=>Up(r,i),r.min=(i,t)=>r.check(ke(i,t)),r.max=(i,t)=>r.check(De(i,t));const n=r._zod.bag;r.minDate=n.minimum?new Date(n.minimum):null,r.maxDate=n.maximum?new Date(n.maximum):null});function uc(r){return lp(Ar,r)}const qi=b("ZodArray",(r,e)=>{rh.init(r,e),M.init(r,e),r._zod.processJSONSchema=(n,i,t)=>Vp(r,n,i,t),r.element=e.element,dr(r,"ZodArray",{min(n,i){return this.check(gt(n,i))},nonempty(n){return this.check(gt(1,n))},max(n,i){return this.check(hn(n,i))},length(n,i){return this.check(pn(n,i))},unwrap(){return this.element}})});function R(r,e){return hp(qi,r,e)}function lc(r){const e=r._zod.def.shape;return be(Object.keys(e))}const _n=b("ZodObject",(r,e)=>{ah.init(r,e),M.init(r,e),r._zod.processJSONSchema=(n,i,t)=>Gp(r,n,i,t),H(r,"shape",()=>e.shape),dr(r,"ZodObject",{keyof(){return be(Object.keys(this._zod.def.shape))},catchall(n){return this.clone({...this._zod.def,catchall:n})},passthrough(){return this.clone({...this._zod.def,catchall:K()})},loose(){return this.clone({...this._zod.def,catchall:K()})},strict(){return this.clone({...this._zod.def,catchall:Ct()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(n){return ad(this,n)},safeExtend(n){return cd(this,n)},merge(n){return ud(this,n)},pick(n){return od(this,n)},omit(n){return sd(this,n)},partial(...n){return ld(Dr,this,n[0])},required(...n){return dd(Rr,this,n[0])}})});function x(r,e){const n={type:"object",shape:r??{},...S(e)};return new _n(n)}function dc(r,e){return new _n({type:"object",shape:r,catchall:Ct(),...S(e)})}function ge(r,e){return new _n({type:"object",shape:r,catchall:K(),...S(e)})}const xn=b("ZodUnion",(r,e)=>{Ii.init(r,e),M.init(r,e),r._zod.processJSONSchema=(n,i,t)=>ca(r,n,i,t),r.options=e.options});function Z(r,e){return new xn({type:"union",options:r,...S(e)})}const Vi=b("ZodXor",(r,e)=>{xn.init(r,e),ch.init(r,e),r._zod.processJSONSchema=(n,i,t)=>ca(r,n,i,t),r.options=e.options});function fc(r,e){return new Vi({type:"union",options:r,inclusive:!1,...S(e)})}const Gi=b("ZodDiscriminatedUnion",(r,e)=>{xn.init(r,e),uh.init(r,e)});function Nr(r,e,n){return new Gi({type:"union",options:e,discriminator:r,...S(n)})}const Ki=b("ZodIntersection",(r,e)=>{lh.init(r,e),M.init(r,e),r._zod.processJSONSchema=(n,i,t)=>Kp(r,n,i,t)});function wn(r,e){return new Ki({type:"intersection",left:r,right:e})}const Ji=b("ZodTuple",(r,e)=>{Us.init(r,e),M.init(r,e),r._zod.processJSONSchema=(n,i,t)=>Jp(r,n,i,t),r.rest=n=>r.clone({...r._zod.def,rest:n})});function Wi(r,e,n){const i=e instanceof C,t=i?n:e,o=i?e:null;return new Ji({type:"tuple",items:r,rest:o,...S(t)})}const Lt=b("ZodRecord",(r,e)=>{dh.init(r,e),M.init(r,e),r._zod.processJSONSchema=(n,i,t)=>Wp(r,n,i,t),r.keyType=e.keyType,r.valueType=e.valueType});function q(r,e,n){return!e||!e._zod?new Lt({type:"record",keyType:v(),valueType:r,...S(e)}):new Lt({type:"record",keyType:r,valueType:e,...S(n)})}function hc(r,e,n){const i=Ce(r);return i._zod.values=void 0,new Lt({type:"record",keyType:i,valueType:e,...S(n)})}function pc(r,e,n){return new Lt({type:"record",keyType:r,valueType:e,mode:"loose",...S(n)})}const Xi=b("ZodMap",(r,e)=>{fh.init(r,e),M.init(r,e),r._zod.processJSONSchema=(n,i,t)=>Zp(r,n),r.keyType=e.keyType,r.valueType=e.valueType,r.min=(...n)=>r.check(ut(...n)),r.nonempty=n=>r.check(ut(1,n)),r.max=(...n)=>r.check(Bt(...n)),r.size=(...n)=>r.check(fn(...n))});function mc(r,e,n){return new Xi({type:"map",keyType:r,valueType:e,...S(n)})}const Yi=b("ZodSet",(r,e)=>{hh.init(r,e),M.init(r,e),r._zod.processJSONSchema=(n,i,t)=>qp(r,n),r.min=(...n)=>r.check(ut(...n)),r.nonempty=n=>r.check(ut(1,n)),r.max=(...n)=>r.check(Bt(...n)),r.size=(...n)=>r.check(fn(...n))});function gc(r,e){return new Yi({type:"set",valueType:r,...S(e)})}const Mt=b("ZodEnum",(r,e)=>{ph.init(r,e),M.init(r,e),r._zod.processJSONSchema=(i,t,o)=>Dp(r,i,t),r.enum=e.entries,r.options=Object.values(e.entries);const n=new Set(Object.keys(e.entries));r.extract=(i,t)=>{const o={};for(const s of i)if(n.has(s))o[s]=e.entries[s];else throw new Error(`Key ${s} not found in enum`);return new Mt({...e,checks:[],...S(t),entries:o})},r.exclude=(i,t)=>{const o={...e.entries};for(const s of i)if(n.has(s))delete o[s];else throw new Error(`Key ${s} not found in enum`);return new Mt({...e,checks:[],...S(t),entries:o})}});function be(r,e){const n=Array.isArray(r)?Object.fromEntries(r.map(i=>[i,i])):r;return new Mt({type:"enum",entries:n,...S(e)})}function bc(r,e){return new Mt({type:"enum",entries:r,...S(e)})}const Qi=b("ZodLiteral",(r,e)=>{mh.init(r,e),M.init(r,e),r._zod.processJSONSchema=(n,i,t)=>Rp(r,n,i),r.values=new Set(e.values),Object.defineProperty(r,"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 y(r,e){return new Qi({type:"literal",values:Array.isArray(r)?r:[r],...S(e)})}const eo=b("ZodFile",(r,e)=>{gh.init(r,e),M.init(r,e),r._zod.processJSONSchema=(n,i,t)=>Mp(r,n,i),r.min=(n,i)=>r.check(ut(n,i)),r.max=(n,i)=>r.check(Bt(n,i)),r.mime=(n,i)=>r.check(ir(Array.isArray(n)?n:[n],i))});function vc(r){return pp(eo,r)}const to=b("ZodTransform",(r,e)=>{bh.init(r,e),M.init(r,e),r._zod.processJSONSchema=(n,i,t)=>Hp(r,n),r._zod.parse=(n,i)=>{if(i.direction==="backward")throw new bi(r.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(tn(o,n.value,e));else{const s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=r),n.issues.push(tn(s))}};const t=e.transform(n.value,n);return t instanceof Promise?t.then(o=>(n.value=o,n.fallback=!0,n)):(n.value=t,n.fallback=!0,n)}});function Ur(r){return new to({type:"transform",transform:r})}const Dr=b("ZodOptional",(r,e)=>{Ds.init(r,e),M.init(r,e),r._zod.processJSONSchema=(n,i,t)=>ua(r,n,i,t),r.unwrap=()=>r._zod.def.innerType});function re(r){return new Dr({type:"optional",innerType:r})}const no=b("ZodExactOptional",(r,e)=>{vh.init(r,e),M.init(r,e),r._zod.processJSONSchema=(n,i,t)=>ua(r,n,i,t),r.unwrap=()=>r._zod.def.innerType});function ro(r){return new no({type:"optional",innerType:r})}const io=b("ZodNullable",(r,e)=>{yh.init(r,e),M.init(r,e),r._zod.processJSONSchema=(n,i,t)=>Xp(r,n,i,t),r.unwrap=()=>r._zod.def.innerType});function un(r){return new io({type:"nullable",innerType:r})}function yc(r){return re(un(r))}const oo=b("ZodDefault",(r,e)=>{_h.init(r,e),M.init(r,e),r._zod.processJSONSchema=(n,i,t)=>Qp(r,n,i,t),r.unwrap=()=>r._zod.def.innerType,r.removeDefault=r.unwrap});function so(r,e){return new oo({type:"default",innerType:r,get defaultValue(){return typeof e=="function"?e():yi(e)}})}const ao=b("ZodPrefault",(r,e)=>{xh.init(r,e),M.init(r,e),r._zod.processJSONSchema=(n,i,t)=>em(r,n,i,t),r.unwrap=()=>r._zod.def.innerType});function co(r,e){return new ao({type:"prefault",innerType:r,get defaultValue(){return typeof e=="function"?e():yi(e)}})}const Rr=b("ZodNonOptional",(r,e)=>{wh.init(r,e),M.init(r,e),r._zod.processJSONSchema=(n,i,t)=>Yp(r,n,i,t),r.unwrap=()=>r._zod.def.innerType});function uo(r,e){return new Rr({type:"nonoptional",innerType:r,...S(e)})}const lo=b("ZodSuccess",(r,e)=>{Sh.init(r,e),M.init(r,e),r._zod.processJSONSchema=(n,i,t)=>jp(r,n,i),r.unwrap=()=>r._zod.def.innerType});function _c(r){return new lo({type:"success",innerType:r})}const fo=b("ZodCatch",(r,e)=>{kh.init(r,e),M.init(r,e),r._zod.processJSONSchema=(n,i,t)=>tm(r,n,i,t),r.unwrap=()=>r._zod.def.innerType,r.removeCatch=r.unwrap});function ho(r,e){return new fo({type:"catch",innerType:r,catchValue:typeof e=="function"?e:()=>e})}const po=b("ZodNaN",(r,e)=>{Ih.init(r,e),M.init(r,e),r._zod.processJSONSchema=(n,i,t)=>Cp(r,n)});function xc(r){return fp(po,r)}const Sn=b("ZodPipe",(r,e)=>{Rs.init(r,e),M.init(r,e),r._zod.processJSONSchema=(n,i,t)=>nm(r,n,i,t),r.in=e.in,r.out=e.out});function Bn(r,e){return new Sn({type:"pipe",in:r,out:e})}const kn=b("ZodCodec",(r,e)=>{Sn.init(r,e),Cs.init(r,e)});function wc(r,e,n){return new kn({type:"pipe",in:r,out:e,transform:n.decode,reverseTransform:n.encode})}function Sc(r){const e=r._zod.def;return new kn({type:"pipe",in:e.out,out:e.in,transform:e.reverseTransform,reverseTransform:e.transform})}const mo=b("ZodPreprocess",(r,e)=>{Sn.init(r,e),$h.init(r,e)}),go=b("ZodReadonly",(r,e)=>{Eh.init(r,e),M.init(r,e),r._zod.processJSONSchema=(n,i,t)=>rm(r,n,i,t),r.unwrap=()=>r._zod.def.innerType});function bo(r){return new go({type:"readonly",innerType:r})}const vo=b("ZodTemplateLiteral",(r,e)=>{Th.init(r,e),M.init(r,e),r._zod.processJSONSchema=(n,i,t)=>Lp(r,n,i)});function kc(r,e){return new vo({type:"template_literal",parts:r,...S(e)})}const yo=b("ZodLazy",(r,e)=>{zh.init(r,e),M.init(r,e),r._zod.processJSONSchema=(n,i,t)=>om(r,n,i,t),r.unwrap=()=>r._zod.def.getter()});function _o(r){return new yo({type:"lazy",getter:r})}const xo=b("ZodPromise",(r,e)=>{Ph.init(r,e),M.init(r,e),r._zod.processJSONSchema=(n,i,t)=>im(r,n,i,t),r.unwrap=()=>r._zod.def.innerType});function Ic(r){return new xo({type:"promise",innerType:r})}const wo=b("ZodFunction",(r,e)=>{Oh.init(r,e),M.init(r,e),r._zod.processJSONSchema=(n,i,t)=>Fp(r,n)});function ln(r){return new wo({type:"function",input:Array.isArray(r?.input)?Wi(r?.input):r?.input??R(K()),output:r?.output??K()})}const In=b("ZodCustom",(r,e)=>{Ah.init(r,e),M.init(r,e),r._zod.processJSONSchema=(n,i,t)=>Bp(r,n)});function $c(r){const e=new ae({check:"custom"});return e._zod.check=r,e}function So(r,e){return mp(In,r??(()=>!0),e)}function ko(r,e={}){return gp(In,r,e)}function Io(r,e){return bp(r,e)}const Ec=yp,Tc=_p;function Oc(r,e={}){const n=new In({type:"custom",check:"custom",fn:i=>i instanceof r,abort:!0,...S(e)});return n._zod.bag.Class=r,n._zod.check=i=>{i.value instanceof r||i.issues.push({code:"invalid_type",expected:r.name,input:i.value,inst:n,path:[...n._zod.def.path??[]]})},n}const Pc=(...r)=>xp({Codec:kn,Boolean:vn,String:mn},...r);function zc(r){const e=_o(()=>Z([v(r),L(),X(),Pr(),R(e),q(v(),e)]));return e}function Cr(r,e){return new mo({type:"pipe",in:Ur(r),out:e})}const my=Object.freeze(Object.defineProperty({__proto__:null,ZodAny:Bi,ZodArray:qi,ZodBase64:Ir,ZodBase64URL:$r,ZodBigInt:yn,ZodBigIntFormat:Or,ZodBoolean:vn,ZodCIDRv4:Sr,ZodCIDRv6:kr,ZodCUID:gr,ZodCUID2:br,ZodCatch:fo,ZodCodec:kn,ZodCustom:In,ZodCustomStringFormat:Ft,ZodDate:Ar,ZodDefault:oo,ZodDiscriminatedUnion:Gi,ZodE164:Er,ZodEmail:hr,ZodEmoji:pr,ZodEnum:Mt,ZodExactOptional:no,ZodFile:eo,ZodFunction:wo,ZodGUID:an,ZodIPv4:xr,ZodIPv6:wr,ZodIntersection:Ki,ZodJWT:Tr,ZodKSUID:_r,ZodLazy:yo,ZodLiteral:Qi,ZodMAC:Ci,ZodMap:Xi,ZodNaN:po,ZodNanoID:mr,ZodNever:Hi,ZodNonOptional:Rr,ZodNull:ji,ZodNullable:io,ZodNumber:bn,ZodNumberFormat:vt,ZodObject:_n,ZodOptional:Dr,ZodPipe:Sn,ZodPrefault:ao,ZodPreprocess:mo,ZodPromise:xo,ZodReadonly:go,ZodRecord:Lt,ZodSet:Yi,ZodString:mn,ZodStringFormat:ne,ZodSuccess:lo,ZodSymbol:Li,ZodTemplateLiteral:vo,ZodTransform:to,ZodTuple:Ji,ZodType:M,ZodULID:vr,ZodURL:gn,ZodUUID:Je,ZodUndefined:Mi,ZodUnion:xn,ZodUnknown:Fi,ZodVoid:Zi,ZodXID:yr,ZodXor:Vi,_ZodString:fr,_default:so,_function:ln,any:zr,array:R,base64:Va,base64url:Ga,bigint:ic,boolean:X,catch:ho,check:$c,cidrv4:Za,cidrv6:qa,codec:wc,cuid:Ra,cuid2:Ca,custom:So,date:uc,describe:Ec,discriminatedUnion:Nr,e164:Ka,email:$a,emoji:Ua,enum:be,exactOptional:ro,file:vc,float32:ec,float64:tc,function:ln,guid:Ea,hash:Qa,hex:Ya,hostname:Xa,httpUrl:Na,instanceof:Oc,int:jn,int32:nc,int64:oc,intersection:wn,invertCodec:Sc,ipv4:Ba,ipv6:Ha,json:zc,jwt:Ja,keyof:lc,ksuid:ja,lazy:_o,literal:y,looseObject:ge,looseRecord:pc,mac:Fa,map:mc,meta:Tc,nan:xc,nanoid:Da,nativeEnum:bc,never:Ct,nonoptional:uo,null:Pr,nullable:un,nullish:yc,number:L,object:x,optional:re,partialRecord:hc,pipe:Bn,prefault:co,preprocess:Cr,promise:Ic,readonly:bo,record:q,refine:ko,set:gc,strictObject:dc,string:v,stringFormat:Wa,stringbool:Pc,success:_c,superRefine:Io,symbol:ac,templateLiteral:kc,transform:Ur,tuple:Wi,uint32:rc,uint64:sc,ulid:La,undefined:cn,union:Z,unknown:K,url:Aa,uuid:Ta,uuidv4:Oa,uuidv6:Pa,uuidv7:za,void:cc,xid:Ma,xor:fc},Symbol.toStringTag,{value:"Module"})),hm={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function pm(r){pe({customError:r})}function mm(){return pe().customError}var di;di||(di={});const P={...my,...py,iso:ha},gy=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function by(r,e){const n=r.$schema;return n==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":n==="http://json-schema.org/draft-07/schema#"?"draft-7":n==="http://json-schema.org/draft-04/schema#"?"draft-4":e??"draft-2020-12"}function vy(r,e){if(!r.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");const n=r.slice(1).split("/").filter(Boolean);if(n.length===0)return e.rootSchema;const i=e.version==="draft-2020-12"?"$defs":"definitions";if(n[0]===i){const t=n[1];if(!t||!e.defs[t])throw new Error(`Reference not found: ${r}`);return e.defs[t]}throw new Error(`Reference not found: ${r}`)}function gm(r,e){if(r.not!==void 0){if(typeof r.not=="object"&&Object.keys(r.not).length===0)return P.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(r.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(r.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(r.if!==void 0||r.then!==void 0||r.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(r.dependentSchemas!==void 0||r.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(r.$ref){const t=r.$ref;if(e.refs.has(t))return e.refs.get(t);if(e.processing.has(t))return P.lazy(()=>{if(!e.refs.has(t))throw new Error(`Circular reference not resolved: ${t}`);return e.refs.get(t)});e.processing.add(t);const o=vy(t,e),s=xe(o,e);return e.refs.set(t,s),e.processing.delete(t),s}if(r.enum!==void 0){const t=r.enum;if(e.version==="openapi-3.0"&&r.nullable===!0&&t.length===1&&t[0]===null)return P.null();if(t.length===0)return P.never();if(t.length===1)return P.literal(t[0]);if(t.every(s=>typeof s=="string"))return P.enum(t);const o=t.map(s=>P.literal(s));return o.length<2?o[0]:P.union([o[0],o[1],...o.slice(2)])}if(r.const!==void 0)return P.literal(r.const);const n=r.type;if(Array.isArray(n)){const t=n.map(o=>{const s={...r,type:o};return gm(s,e)});return t.length===0?P.never():t.length===1?t[0]:P.union(t)}if(!n)return P.any();let i;switch(n){case"string":{let t=P.string();if(r.format){const o=r.format;o==="email"?t=t.check(P.email()):o==="uri"||o==="uri-reference"?t=t.check(P.url()):o==="uuid"||o==="guid"?t=t.check(P.uuid()):o==="date-time"?t=t.check(P.iso.datetime()):o==="date"?t=t.check(P.iso.date()):o==="time"?t=t.check(P.iso.time()):o==="duration"?t=t.check(P.iso.duration()):o==="ipv4"?t=t.check(P.ipv4()):o==="ipv6"?t=t.check(P.ipv6()):o==="mac"?t=t.check(P.mac()):o==="cidr"?t=t.check(P.cidrv4()):o==="cidr-v6"?t=t.check(P.cidrv6()):o==="base64"?t=t.check(P.base64()):o==="base64url"?t=t.check(P.base64url()):o==="e164"?t=t.check(P.e164()):o==="jwt"?t=t.check(P.jwt()):o==="emoji"?t=t.check(P.emoji()):o==="nanoid"?t=t.check(P.nanoid()):o==="cuid"?t=t.check(P.cuid()):o==="cuid2"?t=t.check(P.cuid2()):o==="ulid"?t=t.check(P.ulid()):o==="xid"?t=t.check(P.xid()):o==="ksuid"&&(t=t.check(P.ksuid()))}typeof r.minLength=="number"&&(t=t.min(r.minLength)),typeof r.maxLength=="number"&&(t=t.max(r.maxLength)),r.pattern&&(t=t.regex(new RegExp(r.pattern))),i=t;break}case"number":case"integer":{let t=n==="integer"?P.number().int():P.number();typeof r.minimum=="number"&&(t=t.min(r.minimum)),typeof r.maximum=="number"&&(t=t.max(r.maximum)),typeof r.exclusiveMinimum=="number"?t=t.gt(r.exclusiveMinimum):r.exclusiveMinimum===!0&&typeof r.minimum=="number"&&(t=t.gt(r.minimum)),typeof r.exclusiveMaximum=="number"?t=t.lt(r.exclusiveMaximum):r.exclusiveMaximum===!0&&typeof r.maximum=="number"&&(t=t.lt(r.maximum)),typeof r.multipleOf=="number"&&(t=t.multipleOf(r.multipleOf)),i=t;break}case"boolean":{i=P.boolean();break}case"null":{i=P.null();break}case"object":{const t={},o=r.properties||{},s=new Set(r.required||[]);for(const[c,u]of Object.entries(o)){const l=xe(u,e);t[c]=s.has(c)?l:l.optional()}if(r.propertyNames){const c=xe(r.propertyNames,e),u=r.additionalProperties&&typeof r.additionalProperties=="object"?xe(r.additionalProperties,e):P.any();if(Object.keys(t).length===0){i=P.record(c,u);break}const l=P.object(t).passthrough(),f=P.looseRecord(c,u);i=P.intersection(l,f);break}if(r.patternProperties){const c=r.patternProperties,u=Object.keys(c),l=[];for(const d of u){const h=xe(c[d],e),p=P.string().regex(new RegExp(d));l.push(P.looseRecord(p,h))}const f=[];if(Object.keys(t).length>0&&f.push(P.object(t).passthrough()),f.push(...l),f.length===0)i=P.object({}).passthrough();else if(f.length===1)i=f[0];else{let d=P.intersection(f[0],f[1]);for(let h=2;h<f.length;h++)d=P.intersection(d,f[h]);i=d}break}const a=P.object(t);r.additionalProperties===!1?i=a.strict():typeof r.additionalProperties=="object"?i=a.catchall(xe(r.additionalProperties,e)):i=a.passthrough();break}case"array":{const t=r.prefixItems,o=r.items;if(t&&Array.isArray(t)){const s=t.map(c=>xe(c,e)),a=o&&typeof o=="object"&&!Array.isArray(o)?xe(o,e):void 0;a?i=P.tuple(s).rest(a):i=P.tuple(s),typeof r.minItems=="number"&&(i=i.check(P.minLength(r.minItems))),typeof r.maxItems=="number"&&(i=i.check(P.maxLength(r.maxItems)))}else if(Array.isArray(o)){const s=o.map(c=>xe(c,e)),a=r.additionalItems&&typeof r.additionalItems=="object"?xe(r.additionalItems,e):void 0;a?i=P.tuple(s).rest(a):i=P.tuple(s),typeof r.minItems=="number"&&(i=i.check(P.minLength(r.minItems))),typeof r.maxItems=="number"&&(i=i.check(P.maxLength(r.maxItems)))}else if(o!==void 0){const s=xe(o,e);let a=P.array(s);typeof r.minItems=="number"&&(a=a.min(r.minItems)),typeof r.maxItems=="number"&&(a=a.max(r.maxItems)),i=a}else i=P.array(P.any());break}default:throw new Error(`Unsupported type: ${n}`)}return i}function xe(r,e){if(typeof r=="boolean")return r?P.any():P.never();let n=gm(r,e);const i=r.type||r.enum!==void 0||r.const!==void 0;if(r.anyOf&&Array.isArray(r.anyOf)){const a=r.anyOf.map(u=>xe(u,e)),c=P.union(a);n=i?P.intersection(n,c):c}if(r.oneOf&&Array.isArray(r.oneOf)){const a=r.oneOf.map(u=>xe(u,e)),c=P.xor(a);n=i?P.intersection(n,c):c}if(r.allOf&&Array.isArray(r.allOf))if(r.allOf.length===0)n=i?n:P.any();else{let a=i?n:xe(r.allOf[0],e);const c=i?0:1;for(let u=c;u<r.allOf.length;u++)a=P.intersection(a,xe(r.allOf[u],e));n=a}r.nullable===!0&&e.version==="openapi-3.0"&&(n=P.nullable(n)),r.readOnly===!0&&(n=P.readonly(n)),r.default!==void 0&&(n=n.default(r.default));const t={},o=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(const a of o)a in r&&(t[a]=r[a]);const s=["contentEncoding","contentMediaType","contentSchema"];for(const a of s)a in r&&(t[a]=r[a]);for(const a of Object.keys(r))gy.has(a)||(t[a]=r[a]);return Object.keys(t).length>0&&e.registry.add(n,t),r.description&&(n=n.describe(r.description)),n}function bm(r,e){if(typeof r=="boolean")return r?P.any():P.never();let n;try{n=JSON.parse(JSON.stringify(r))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}const i=by(n,e?.defaultTarget),t=n.$defs||n.definitions||{},o={version:i,defs:t,refs:new Map,processing:new Set,rootSchema:n,registry:e?.registry??Ne};return xe(n,o)}function yy(r){return Lh(mn,r)}function _y(r){return qh(bn,r)}function xy(r){return Yh(vn,r)}function wy(r){return ep(yn,r)}function Sy(r){return dp(Ar,r)}const vm=Object.freeze(Object.defineProperty({__proto__:null,bigint:wy,boolean:xy,date:Sy,number:_y,string:yy},Symbol.toStringTag,{value:"Module"}));pe(Nh());const cl=Object.freeze(Object.defineProperty({__proto__:null,$brand:us,$input:js,$output:Ms,NEVER:cs,TimePrecision:aa,ZodAny:Bi,ZodArray:qi,ZodBase64:Ir,ZodBase64URL:$r,ZodBigInt:yn,ZodBigIntFormat:Or,ZodBoolean:vn,ZodCIDRv4:Sr,ZodCIDRv6:kr,ZodCUID:gr,ZodCUID2:br,ZodCatch:fo,ZodCodec:kn,ZodCustom:In,ZodCustomStringFormat:Ft,ZodDate:Ar,ZodDefault:oo,ZodDiscriminatedUnion:Gi,ZodE164:Er,ZodEmail:hr,ZodEmoji:pr,ZodEnum:Mt,ZodError:fm,ZodExactOptional:no,ZodFile:eo,get ZodFirstPartyTypeKind(){return di},ZodFunction:wo,ZodGUID:an,ZodIPv4:xr,ZodIPv6:wr,ZodISODate:Ui,ZodISODateTime:Ni,ZodISODuration:Ri,ZodISOTime:Di,ZodIntersection:Ki,ZodIssueCode:hm,ZodJWT:Tr,ZodKSUID:_r,ZodLazy:yo,ZodLiteral:Qi,ZodMAC:Ci,ZodMap:Xi,ZodNaN:po,ZodNanoID:mr,ZodNever:Hi,ZodNonOptional:Rr,ZodNull:ji,ZodNullable:io,ZodNumber:bn,ZodNumberFormat:vt,ZodObject:_n,ZodOptional:Dr,ZodPipe:Sn,ZodPrefault:ao,ZodPreprocess:mo,ZodPromise:xo,ZodReadonly:go,ZodRealError:Ee,ZodRecord:Lt,ZodSet:Yi,ZodString:mn,ZodStringFormat:ne,ZodSuccess:lo,ZodSymbol:Li,ZodTemplateLiteral:vo,ZodTransform:to,ZodTuple:Ji,ZodType:M,ZodULID:vr,ZodURL:gn,ZodUUID:Je,ZodUndefined:Mi,ZodUnion:xn,ZodUnknown:Fi,ZodVoid:Zi,ZodXID:yr,ZodXor:Vi,_ZodString:fr,_default:so,_function:ln,any:zr,array:R,base64:Va,base64url:Ga,bigint:ic,boolean:X,catch:ho,check:$c,cidrv4:Za,cidrv6:qa,clone:Ce,codec:wc,coerce:vm,config:pe,core:sm,cuid:Ra,cuid2:Ca,custom:So,date:uc,decode:ya,decodeAsync:xa,describe:Ec,discriminatedUnion:Nr,e164:Ka,email:$a,emoji:Ua,encode:va,encodeAsync:_a,endsWith:rr,enum:be,exactOptional:ro,file:vc,flattenError:wi,float32:ec,float64:tc,formatError:Si,fromJSONSchema:bm,function:ln,getErrorMap:mm,globalRegistry:Ne,gt:ct,gte:ke,guid:Ea,hash:Qa,hex:Ya,hostname:Xa,httpUrl:Na,includes:tr,instanceof:Oc,int:jn,int32:nc,int64:oc,intersection:wn,invertCodec:Sc,ipv4:Ba,ipv6:Ha,iso:ha,json:zc,jwt:Ja,keyof:lc,ksuid:ja,lazy:_o,length:pn,literal:y,locales:Ls,looseObject:ge,looseRecord:pc,lowercase:Qn,lt:at,lte:De,mac:Fa,map:mc,maxLength:hn,maxSize:Bt,meta:Tc,mime:ir,minLength:gt,minSize:ut,multipleOf:Rt,nan:xc,nanoid:Da,nativeEnum:bc,negative:Oi,never:Ct,nonnegative:zi,nonoptional:uo,nonpositive:Pi,normalize:or,null:Pr,nullable:un,nullish:yc,number:L,object:x,optional:re,overwrite:nt,parse:pa,parseAsync:ma,partialRecord:hc,pipe:Bn,positive:Ti,prefault:co,preprocess:Cr,prettifyError:ms,promise:Ic,property:Ai,readonly:bo,record:q,refine:ko,regex:Yn,regexes:ki,registry:$i,safeDecode:Sa,safeDecodeAsync:Ia,safeEncode:wa,safeEncodeAsync:ka,safeParse:ga,safeParseAsync:ba,set:gc,setErrorMap:pm,size:fn,slugify:ur,startsWith:nr,strictObject:dc,string:v,stringFormat:Wa,stringbool:Pc,success:_c,superRefine:Io,symbol:ac,templateLiteral:kc,toJSONSchema:la,toLowerCase:ar,toUpperCase:cr,transform:Ur,treeifyError:ps,trim:sr,tuple:Wi,uint32:rc,uint64:sc,ulid:La,undefined:cn,union:Z,unknown:K,uppercase:er,url:Aa,util:fs,uuid:Ta,uuidv4:Oa,uuidv6:Pa,uuidv7:za,void:cc,xid:Ma,xor:fc},Symbol.toStringTag,{value:"Module"})),ky=Object.freeze(Object.defineProperty({__proto__:null,$brand:us,$input:js,$output:Ms,NEVER:cs,TimePrecision:aa,ZodAny:Bi,ZodArray:qi,ZodBase64:Ir,ZodBase64URL:$r,ZodBigInt:yn,ZodBigIntFormat:Or,ZodBoolean:vn,ZodCIDRv4:Sr,ZodCIDRv6:kr,ZodCUID:gr,ZodCUID2:br,ZodCatch:fo,ZodCodec:kn,ZodCustom:In,ZodCustomStringFormat:Ft,ZodDate:Ar,ZodDefault:oo,ZodDiscriminatedUnion:Gi,ZodE164:Er,ZodEmail:hr,ZodEmoji:pr,ZodEnum:Mt,ZodError:fm,ZodExactOptional:no,ZodFile:eo,get ZodFirstPartyTypeKind(){return di},ZodFunction:wo,ZodGUID:an,ZodIPv4:xr,ZodIPv6:wr,ZodISODate:Ui,ZodISODateTime:Ni,ZodISODuration:Ri,ZodISOTime:Di,ZodIntersection:Ki,ZodIssueCode:hm,ZodJWT:Tr,ZodKSUID:_r,ZodLazy:yo,ZodLiteral:Qi,ZodMAC:Ci,ZodMap:Xi,ZodNaN:po,ZodNanoID:mr,ZodNever:Hi,ZodNonOptional:Rr,ZodNull:ji,ZodNullable:io,ZodNumber:bn,ZodNumberFormat:vt,ZodObject:_n,ZodOptional:Dr,ZodPipe:Sn,ZodPrefault:ao,ZodPreprocess:mo,ZodPromise:xo,ZodReadonly:go,ZodRealError:Ee,ZodRecord:Lt,ZodSet:Yi,ZodString:mn,ZodStringFormat:ne,ZodSuccess:lo,ZodSymbol:Li,ZodTemplateLiteral:vo,ZodTransform:to,ZodTuple:Ji,ZodType:M,ZodULID:vr,ZodURL:gn,ZodUUID:Je,ZodUndefined:Mi,ZodUnion:xn,ZodUnknown:Fi,ZodVoid:Zi,ZodXID:yr,ZodXor:Vi,_ZodString:fr,_default:so,_function:ln,any:zr,array:R,base64:Va,base64url:Ga,bigint:ic,boolean:X,catch:ho,check:$c,cidrv4:Za,cidrv6:qa,clone:Ce,codec:wc,coerce:vm,config:pe,core:sm,cuid:Ra,cuid2:Ca,custom:So,date:uc,decode:ya,decodeAsync:xa,default:cl,describe:Ec,discriminatedUnion:Nr,e164:Ka,email:$a,emoji:Ua,encode:va,encodeAsync:_a,endsWith:rr,enum:be,exactOptional:ro,file:vc,flattenError:wi,float32:ec,float64:tc,formatError:Si,fromJSONSchema:bm,function:ln,getErrorMap:mm,globalRegistry:Ne,gt:ct,gte:ke,guid:Ea,hash:Qa,hex:Ya,hostname:Xa,httpUrl:Na,includes:tr,instanceof:Oc,int:jn,int32:nc,int64:oc,intersection:wn,invertCodec:Sc,ipv4:Ba,ipv6:Ha,iso:ha,json:zc,jwt:Ja,keyof:lc,ksuid:ja,lazy:_o,length:pn,literal:y,locales:Ls,looseObject:ge,looseRecord:pc,lowercase:Qn,lt:at,lte:De,mac:Fa,map:mc,maxLength:hn,maxSize:Bt,meta:Tc,mime:ir,minLength:gt,minSize:ut,multipleOf:Rt,nan:xc,nanoid:Da,nativeEnum:bc,negative:Oi,never:Ct,nonnegative:zi,nonoptional:uo,nonpositive:Pi,normalize:or,null:Pr,nullable:un,nullish:yc,number:L,object:x,optional:re,overwrite:nt,parse:pa,parseAsync:ma,partialRecord:hc,pipe:Bn,positive:Ti,prefault:co,preprocess:Cr,prettifyError:ms,promise:Ic,property:Ai,readonly:bo,record:q,refine:ko,regex:Yn,regexes:ki,registry:$i,safeDecode:Sa,safeDecodeAsync:Ia,safeEncode:wa,safeEncodeAsync:ka,safeParse:ga,safeParseAsync:ba,set:gc,setErrorMap:pm,size:fn,slugify:ur,startsWith:nr,strictObject:dc,string:v,stringFormat:Wa,stringbool:Pc,success:_c,superRefine:Io,symbol:ac,templateLiteral:kc,toJSONSchema:la,toLowerCase:ar,toUpperCase:cr,transform:Ur,treeifyError:ps,trim:sr,tuple:Wi,uint32:rc,uint64:sc,ulid:La,undefined:cn,union:Z,unknown:K,uppercase:er,url:Aa,util:fs,uuid:Ta,uuidv4:Oa,uuidv6:Pa,uuidv7:za,void:cc,xid:Ma,xor:fc,z:cl},Symbol.toStringTag,{value:"Module"})),xt="io.modelcontextprotocol/related-task",$o="2.0",he=So(r=>r!==null&&(typeof r=="object"||typeof r=="function")),ym=Z([v(),L().int()]),_m=v();ge({ttl:L().optional(),pollInterval:L().optional()});const Iy=x({ttl:L().optional()}),$y=x({taskId:v()}),Ac=ge({progressToken:ym.optional(),[xt]:$y.optional()}),Me=x({_meta:Ac.optional()}),Lr=Me.extend({task:Iy.optional()}),Ey=r=>Lr.safeParse(r).success,ve=x({method:v(),params:Me.loose().optional()}),Ze=x({_meta:Ac.optional()}),qe=x({method:v(),params:Ze.loose().optional()}),ye=ge({_meta:Ac.optional()}),Mr=Z([v(),L().int()]),xm=x({jsonrpc:y($o),id:Mr,...ve.shape}).strict(),ul=r=>xm.safeParse(r).success,wm=x({jsonrpc:y($o),...qe.shape}).strict(),Ty=r=>wm.safeParse(r).success,Nc=x({jsonrpc:y($o),id:Mr,result:ye}).strict(),Yr=r=>Nc.safeParse(r).success;var Q;(function(r){r[r.ConnectionClosed=-32e3]="ConnectionClosed",r[r.RequestTimeout=-32001]="RequestTimeout",r[r.ParseError=-32700]="ParseError",r[r.InvalidRequest=-32600]="InvalidRequest",r[r.MethodNotFound=-32601]="MethodNotFound",r[r.InvalidParams=-32602]="InvalidParams",r[r.InternalError=-32603]="InternalError",r[r.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(Q||(Q={}));const Uc=x({jsonrpc:y($o),id:Mr.optional(),error:x({code:L().int(),message:v(),data:K().optional()})}).strict(),Oy=r=>Uc.safeParse(r).success,Py=Z([xm,wm,Nc,Uc]);Z([Nc,Uc]);const Dc=ye.strict(),zy=Ze.extend({requestId:Mr.optional(),reason:v().optional()}),Rc=qe.extend({method:y("notifications/cancelled"),params:zy}),Ay=x({src:v(),mimeType:v().optional(),sizes:R(v()).optional(),theme:be(["light","dark"]).optional()}),jr=x({icons:R(Ay).optional()}),dn=x({name:v(),title:v().optional()}),Eo=dn.extend({...dn.shape,...jr.shape,version:v(),websiteUrl:v().optional(),description:v().optional()}),Ny=wn(x({applyDefaults:X().optional()}),q(v(),K())),Uy=Cr(r=>r&&typeof r=="object"&&!Array.isArray(r)&&Object.keys(r).length===0?{form:{}}:r,wn(x({form:Ny.optional(),url:he.optional()}),q(v(),K()).optional())),Dy=ge({list:he.optional(),cancel:he.optional(),requests:ge({sampling:ge({createMessage:he.optional()}).optional(),elicitation:ge({create:he.optional()}).optional()}).optional()}),Ry=ge({list:he.optional(),cancel:he.optional(),requests:ge({tools:ge({call:he.optional()}).optional()}).optional()}),Cy=x({experimental:q(v(),he).optional(),sampling:x({context:he.optional(),tools:he.optional()}).optional(),elicitation:Uy.optional(),roots:x({listChanged:X().optional()}).optional(),tasks:Dy.optional(),extensions:q(v(),he).optional()}),Ly=Me.extend({protocolVersion:v(),capabilities:Cy,clientInfo:Eo}),My=ve.extend({method:y("initialize"),params:Ly}),jy=x({experimental:q(v(),he).optional(),logging:he.optional(),completions:he.optional(),prompts:x({listChanged:X().optional()}).optional(),resources:x({subscribe:X().optional(),listChanged:X().optional()}).optional(),tools:x({listChanged:X().optional()}).optional(),tasks:Ry.optional(),extensions:q(v(),he).optional()}),By=ye.extend({protocolVersion:v(),capabilities:jy,serverInfo:Eo,instructions:v().optional()}),Fy=qe.extend({method:y("notifications/initialized"),params:Ze.optional()}),To=ve.extend({method:y("ping"),params:Me.optional()}),Hy=x({progress:L(),total:re(L()),message:re(v())}),Zy=x({...Ze.shape,...Hy.shape,progressToken:ym}),Cc=qe.extend({method:y("notifications/progress"),params:Zy}),qy=Me.extend({cursor:_m.optional()}),Br=ve.extend({params:qy.optional()}),Fr=ye.extend({nextCursor:_m.optional()}),Vy=be(["working","input_required","completed","failed","cancelled"]),Hr=x({taskId:v(),status:Vy,ttl:Z([L(),Pr()]),createdAt:v(),lastUpdatedAt:v(),pollInterval:re(L()),statusMessage:re(v())}),Lc=ye.extend({task:Hr}),Gy=Ze.merge(Hr),fi=qe.extend({method:y("notifications/tasks/status"),params:Gy}),Mc=ve.extend({method:y("tasks/get"),params:Me.extend({taskId:v()})}),jc=ye.merge(Hr),Bc=ve.extend({method:y("tasks/result"),params:Me.extend({taskId:v()})});ye.loose();const Fc=Br.extend({method:y("tasks/list")}),Hc=Fr.extend({tasks:R(Hr)}),Zc=ve.extend({method:y("tasks/cancel"),params:Me.extend({taskId:v()})}),Ky=ye.merge(Hr),Sm=x({uri:v(),mimeType:re(v()),_meta:q(v(),K()).optional()}),km=Sm.extend({text:v()}),qc=v().refine(r=>{try{return atob(r),!0}catch{return!1}},{message:"Invalid Base64 string"}),Im=Sm.extend({blob:qc}),Zr=be(["user","assistant"]),$n=x({audience:R(Zr).optional(),priority:L().min(0).max(1).optional(),lastModified:fa({offset:!0}).optional()}),$m=x({...dn.shape,...jr.shape,uri:v(),description:re(v()),mimeType:re(v()),size:re(L()),annotations:$n.optional(),_meta:re(ge({}))}),Jy=x({...dn.shape,...jr.shape,uriTemplate:v(),description:re(v()),mimeType:re(v()),annotations:$n.optional(),_meta:re(ge({}))}),Wy=Br.extend({method:y("resources/list")}),Em=Fr.extend({resources:R($m)}),Xy=Br.extend({method:y("resources/templates/list")}),Yy=Fr.extend({resourceTemplates:R(Jy)}),Vc=Me.extend({uri:v()}),Qy=Vc,e_=ve.extend({method:y("resources/read"),params:Qy}),Tm=ye.extend({contents:R(Z([km,Im]))}),t_=qe.extend({method:y("notifications/resources/list_changed"),params:Ze.optional()}),n_=Vc,r_=ve.extend({method:y("resources/subscribe"),params:n_}),i_=Vc,o_=ve.extend({method:y("resources/unsubscribe"),params:i_}),s_=Ze.extend({uri:v()}),a_=qe.extend({method:y("notifications/resources/updated"),params:s_}),c_=x({name:v(),description:re(v()),required:re(X())}),u_=x({...dn.shape,...jr.shape,description:re(v()),arguments:re(R(c_)),_meta:re(ge({}))}),l_=Br.extend({method:y("prompts/list")}),d_=Fr.extend({prompts:R(u_)}),f_=Me.extend({name:v(),arguments:q(v(),v()).optional()}),h_=ve.extend({method:y("prompts/get"),params:f_}),Gc=x({type:y("text"),text:v(),annotations:$n.optional(),_meta:q(v(),K()).optional()}),Kc=x({type:y("image"),data:qc,mimeType:v(),annotations:$n.optional(),_meta:q(v(),K()).optional()}),Jc=x({type:y("audio"),data:qc,mimeType:v(),annotations:$n.optional(),_meta:q(v(),K()).optional()}),p_=x({type:y("tool_use"),name:v(),id:v(),input:q(v(),K()),_meta:q(v(),K()).optional()}),Om=x({type:y("resource"),resource:Z([km,Im]),annotations:$n.optional(),_meta:q(v(),K()).optional()}),Pm=$m.extend({type:y("resource_link")}),qr=Z([Gc,Kc,Jc,Pm,Om]),m_=x({role:Zr,content:qr}),g_=ye.extend({description:v().optional(),messages:R(m_)}),b_=qe.extend({method:y("notifications/prompts/list_changed"),params:Ze.optional()}),v_=x({title:v().optional(),readOnlyHint:X().optional(),destructiveHint:X().optional(),idempotentHint:X().optional(),openWorldHint:X().optional()}),y_=x({taskSupport:be(["required","optional","forbidden"]).optional()}),Wc=x({...dn.shape,...jr.shape,description:v().optional(),inputSchema:x({type:y("object"),properties:q(v(),he).optional(),required:R(v()).optional()}).catchall(K()),outputSchema:x({type:y("object"),properties:q(v(),he).optional(),required:R(v()).optional()}).catchall(K()).optional(),annotations:v_.optional(),execution:y_.optional(),_meta:q(v(),K()).optional()}),zm=Br.extend({method:y("tools/list")}),__=Fr.extend({tools:R(Wc)}),Oo=ye.extend({content:R(qr).default([]),structuredContent:q(v(),K()).optional(),isError:X().optional()});Oo.or(ye.extend({toolResult:K()}));const x_=Lr.extend({name:v(),arguments:q(v(),K()).optional()}),Am=ve.extend({method:y("tools/call"),params:x_}),w_=qe.extend({method:y("notifications/tools/list_changed"),params:Ze.optional()});x({autoRefresh:X().default(!0),debounceMs:L().int().nonnegative().default(300)});const Nm=be(["debug","info","notice","warning","error","critical","alert","emergency"]),S_=Me.extend({level:Nm}),k_=ve.extend({method:y("logging/setLevel"),params:S_}),I_=Ze.extend({level:Nm,logger:v().optional(),data:K()}),$_=qe.extend({method:y("notifications/message"),params:I_}),E_=x({name:v().optional()}),T_=x({hints:R(E_).optional(),costPriority:L().min(0).max(1).optional(),speedPriority:L().min(0).max(1).optional(),intelligencePriority:L().min(0).max(1).optional()}),O_=x({mode:be(["auto","required","none"]).optional()}),P_=x({type:y("tool_result"),toolUseId:v().describe("The unique identifier for the corresponding tool call."),content:R(qr).default([]),structuredContent:x({}).loose().optional(),isError:X().optional(),_meta:q(v(),K()).optional()}),z_=Nr("type",[Gc,Kc,Jc]),hi=Nr("type",[Gc,Kc,Jc,p_,P_]),A_=x({role:Zr,content:Z([hi,R(hi)]),_meta:q(v(),K()).optional()}),N_=Lr.extend({messages:R(A_),modelPreferences:T_.optional(),systemPrompt:v().optional(),includeContext:be(["none","thisServer","allServers"]).optional(),temperature:L().optional(),maxTokens:L().int(),stopSequences:R(v()).optional(),metadata:he.optional(),tools:R(Wc).optional(),toolChoice:O_.optional()}),U_=ve.extend({method:y("sampling/createMessage"),params:N_}),Um=ye.extend({model:v(),stopReason:re(be(["endTurn","stopSequence","maxTokens"]).or(v())),role:Zr,content:z_}),Dm=ye.extend({model:v(),stopReason:re(be(["endTurn","stopSequence","maxTokens","toolUse"]).or(v())),role:Zr,content:Z([hi,R(hi)])}),D_=x({type:y("boolean"),title:v().optional(),description:v().optional(),default:X().optional()}),R_=x({type:y("string"),title:v().optional(),description:v().optional(),minLength:L().optional(),maxLength:L().optional(),format:be(["email","uri","date","date-time"]).optional(),default:v().optional()}),C_=x({type:be(["number","integer"]),title:v().optional(),description:v().optional(),minimum:L().optional(),maximum:L().optional(),default:L().optional()}),L_=x({type:y("string"),title:v().optional(),description:v().optional(),enum:R(v()),default:v().optional()}),M_=x({type:y("string"),title:v().optional(),description:v().optional(),oneOf:R(x({const:v(),title:v()})),default:v().optional()}),j_=x({type:y("string"),title:v().optional(),description:v().optional(),enum:R(v()),enumNames:R(v()).optional(),default:v().optional()}),B_=Z([L_,M_]),F_=x({type:y("array"),title:v().optional(),description:v().optional(),minItems:L().optional(),maxItems:L().optional(),items:x({type:y("string"),enum:R(v())}),default:R(v()).optional()}),H_=x({type:y("array"),title:v().optional(),description:v().optional(),minItems:L().optional(),maxItems:L().optional(),items:x({anyOf:R(x({const:v(),title:v()}))}),default:R(v()).optional()}),Z_=Z([F_,H_]),q_=Z([j_,B_,Z_]),V_=Z([q_,D_,R_,C_]),G_=Lr.extend({mode:y("form").optional(),message:v(),requestedSchema:x({type:y("object"),properties:q(v(),V_),required:R(v()).optional()})}),K_=Lr.extend({mode:y("url"),message:v(),elicitationId:v(),url:v().url()}),J_=Z([G_,K_]),W_=ve.extend({method:y("elicitation/create"),params:J_}),X_=Ze.extend({elicitationId:v()}),Y_=qe.extend({method:y("notifications/elicitation/complete"),params:X_}),Q_=ye.extend({action:be(["accept","decline","cancel"]),content:Cr(r=>r===null?void 0:r,q(v(),Z([v(),L(),X(),R(v())])).optional())}),ex=x({type:y("ref/resource"),uri:v()}),tx=x({type:y("ref/prompt"),name:v()}),nx=Me.extend({ref:Z([tx,ex]),argument:x({name:v(),value:v()}),context:x({arguments:q(v(),v()).optional()}).optional()}),rx=ve.extend({method:y("completion/complete"),params:nx}),ix=ye.extend({completion:ge({values:R(v()).max(100),total:re(L().int()),hasMore:re(X())})}),ox=x({uri:v().startsWith("file://"),name:v().optional(),_meta:q(v(),K()).optional()}),sx=ve.extend({method:y("roots/list"),params:Me.optional()}),ax=ye.extend({roots:R(ox)}),cx=qe.extend({method:y("notifications/roots/list_changed"),params:Ze.optional()});Z([To,My,rx,k_,h_,l_,Wy,Xy,e_,r_,o_,Am,zm,Mc,Bc,Fc,Zc]);Z([Rc,Cc,Fy,cx,fi]);Z([Dc,Um,Dm,Q_,ax,jc,Hc,Lc]);Z([To,U_,W_,sx,Mc,Bc,Fc,Zc]);Z([Rc,Cc,$_,a_,t_,w_,b_,fi,Y_]);Z([Dc,By,ix,g_,d_,Em,Yy,Tm,Oo,__,jc,Hc,Lc]);class V extends Error{constructor(e,n,i){super(`MCP error ${e}: ${n}`),this.code=e,this.data=i,this.name="McpError"}static fromError(e,n,i){if(e===Q.UrlElicitationRequired&&i){const t=i;if(t.elicitations)return new ux(t.elicitations,n)}return new V(e,n,i)}}class ux extends V{constructor(e,n=`URL elicitation${e.length>1?"s":""} required`){super(Q.UrlElicitationRequired,n,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}}function _t(r){return r==="completed"||r==="failed"||r==="cancelled"}new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function ll(r){const n=fy(r)?.method;if(!n)throw new Error("Schema is missing a method literal");const i=hy(n);if(typeof i!="string")throw new Error("Schema method literal must be a string");return i}function dl(r,e){const n=am(r,e);if(!n.success)throw n.error;return n.data}const lx=6e4;class dx{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(Rc,n=>{this._oncancel(n)}),this.setNotificationHandler(Cc,n=>{this._onprogress(n)}),this.setRequestHandler(To,n=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(Mc,async(n,i)=>{const t=await this._taskStore.getTask(n.params.taskId,i.sessionId);if(!t)throw new V(Q.InvalidParams,"Failed to retrieve task: Task not found");return{...t}}),this.setRequestHandler(Bc,async(n,i)=>{const t=async()=>{const o=n.params.taskId;if(this._taskMessageQueue){let a;for(;a=await this._taskMessageQueue.dequeue(o,i.sessionId);){if(a.type==="response"||a.type==="error"){const c=a.message,u=c.id,l=this._requestResolvers.get(u);if(l)if(this._requestResolvers.delete(u),a.type==="response")l(c);else{const f=c,d=new V(f.error.code,f.error.message,f.error.data);l(d)}else{const f=a.type==="response"?"Response":"Error";this._onerror(new Error(`${f} handler missing for request ${u}`))}continue}await this._transport?.send(a.message,{relatedRequestId:i.requestId})}}const s=await this._taskStore.getTask(o,i.sessionId);if(!s)throw new V(Q.InvalidParams,`Task not found: ${o}`);if(!_t(s.status))return await this._waitForTaskUpdate(o,i.signal),await t();if(_t(s.status)){const a=await this._taskStore.getTaskResult(o,i.sessionId);return this._clearTaskQueue(o),{...a,_meta:{...a._meta,[xt]:{taskId:o}}}}return await t()};return await t()}),this.setRequestHandler(Fc,async(n,i)=>{try{const{tasks:t,nextCursor:o}=await this._taskStore.listTasks(n.params?.cursor,i.sessionId);return{tasks:t,nextCursor:o,_meta:{}}}catch(t){throw new V(Q.InvalidParams,`Failed to list tasks: ${t instanceof Error?t.message:String(t)}`)}}),this.setRequestHandler(Zc,async(n,i)=>{try{const t=await this._taskStore.getTask(n.params.taskId,i.sessionId);if(!t)throw new V(Q.InvalidParams,`Task not found: ${n.params.taskId}`);if(_t(t.status))throw new V(Q.InvalidParams,`Cannot cancel task in terminal status: ${t.status}`);await this._taskStore.updateTaskStatus(n.params.taskId,"cancelled","Client cancelled task execution.",i.sessionId),this._clearTaskQueue(n.params.taskId);const o=await this._taskStore.getTask(n.params.taskId,i.sessionId);if(!o)throw new V(Q.InvalidParams,`Task not found after cancellation: ${n.params.taskId}`);return{_meta:{},...o}}catch(t){throw t instanceof V?t:new V(Q.InvalidRequest,`Failed to cancel task: ${t instanceof Error?t.message:String(t)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,n,i,t,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(t,n),startTime:Date.now(),timeout:n,maxTotalTimeout:i,resetTimeoutOnProgress:o,onTimeout:t})}_resetTimeout(e){const n=this._timeoutInfo.get(e);if(!n)return!1;const i=Date.now()-n.startTime;if(n.maxTotalTimeout&&i>=n.maxTotalTimeout)throw this._timeoutInfo.delete(e),V.fromError(Q.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:n.maxTotalTimeout,totalElapsed:i});return clearTimeout(n.timeoutId),n.timeoutId=setTimeout(n.onTimeout,n.timeout),!0}_cleanupTimeout(e){const n=this._timeoutInfo.get(e);n&&(clearTimeout(n.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;const n=this.transport?.onclose;this._transport.onclose=()=>{n?.(),this._onclose()};const i=this.transport?.onerror;this._transport.onerror=o=>{i?.(o),this._onerror(o)};const t=this._transport?.onmessage;this._transport.onmessage=(o,s)=>{t?.(o,s),Yr(o)||Oy(o)?this._onresponse(o):ul(o)?this._onrequest(o,s):Ty(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){const e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const i of this._timeoutInfo.values())clearTimeout(i.timeoutId);this._timeoutInfo.clear();for(const i of this._requestHandlerAbortControllers.values())i.abort();this._requestHandlerAbortControllers.clear();const n=V.fromError(Q.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(const i of e.values())i(n)}_onerror(e){this.onerror?.(e)}_onnotification(e){const n=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;n!==void 0&&Promise.resolve().then(()=>n(e)).catch(i=>this._onerror(new Error(`Uncaught error in notification handler: ${i}`)))}_onrequest(e,n){const i=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,t=this._transport,o=e.params?._meta?.[xt]?.taskId;if(i===void 0){const l={jsonrpc:"2.0",id:e.id,error:{code:Q.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:l,timestamp:Date.now()},t?.sessionId).catch(f=>this._onerror(new Error(`Failed to enqueue error response: ${f}`))):t?.send(l).catch(f=>this._onerror(new Error(`Failed to send an error response: ${f}`)));return}const s=new AbortController;this._requestHandlerAbortControllers.set(e.id,s);const a=Ey(e.params)?e.params.task:void 0,c=this._taskStore?this.requestTaskStore(e,t?.sessionId):void 0,u={signal:s.signal,sessionId:t?.sessionId,_meta:e.params?._meta,sendNotification:async l=>{if(s.signal.aborted)return;const f={relatedRequestId:e.id};o&&(f.relatedTask={taskId:o}),await this.notification(l,f)},sendRequest:async(l,f,d)=>{if(s.signal.aborted)throw new V(Q.ConnectionClosed,"Request was cancelled");const h={...d,relatedRequestId:e.id};o&&!h.relatedTask&&(h.relatedTask={taskId:o});const p=h.relatedTask?.taskId??o;return p&&c&&await c.updateTaskStatus(p,"input_required"),await this.request(l,f,h)},authInfo:n?.authInfo,requestId:e.id,requestInfo:n?.requestInfo,taskId:o,taskStore:c,taskRequestedTtl:a?.ttl,closeSSEStream:n?.closeSSEStream,closeStandaloneSSEStream:n?.closeStandaloneSSEStream};Promise.resolve().then(()=>{a&&this.assertTaskHandlerCapability(e.method)}).then(()=>i(e,u)).then(async l=>{if(s.signal.aborted)return;const f={result:l,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:f,timestamp:Date.now()},t?.sessionId):await t?.send(f)},async l=>{if(s.signal.aborted)return;const f={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:Q.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:f,timestamp:Date.now()},t?.sessionId):await t?.send(f)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===s&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:n,...i}=e.params,t=Number(n),o=this._progressHandlers.get(t);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const s=this._responseHandlers.get(t),a=this._timeoutInfo.get(t);if(a&&s&&a.resetTimeoutOnProgress)try{this._resetTimeout(t)}catch(c){this._responseHandlers.delete(t),this._progressHandlers.delete(t),this._cleanupTimeout(t),s(c);return}o(i)}_onresponse(e){const n=Number(e.id),i=this._requestResolvers.get(n);if(i){if(this._requestResolvers.delete(n),Yr(e))i(e);else{const s=new V(e.error.code,e.error.message,e.error.data);i(s)}return}const t=this._responseHandlers.get(n);if(t===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(n),this._cleanupTimeout(n);let o=!1;if(Yr(e)&&e.result&&typeof e.result=="object"){const s=e.result;if(s.task&&typeof s.task=="object"){const a=s.task;typeof a.taskId=="string"&&(o=!0,this._taskProgressTokens.set(a.taskId,n))}}if(o||this._progressHandlers.delete(n),Yr(e))t(e);else{const s=V.fromError(e.error.code,e.error.message,e.error.data);t(s)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,n,i){const{task:t}=i??{};if(!t){try{yield{type:"result",result:await this.request(e,n,i)}}catch(s){yield{type:"error",error:s instanceof V?s:new V(Q.InternalError,String(s))}}return}let o;try{const s=await this.request(e,Lc,i);if(s.task)o=s.task.taskId,yield{type:"taskCreated",task:s.task};else throw new V(Q.InternalError,"Task creation did not return a task");for(;;){const a=await this.getTask({taskId:o},i);if(yield{type:"taskStatus",task:a},_t(a.status)){a.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},n,i)}:a.status==="failed"?yield{type:"error",error:new V(Q.InternalError,`Task ${o} failed`)}:a.status==="cancelled"&&(yield{type:"error",error:new V(Q.InternalError,`Task ${o} was cancelled`)});return}if(a.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},n,i)};return}const c=a.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(u=>setTimeout(u,c)),i?.signal?.throwIfAborted()}}catch(s){yield{type:"error",error:s instanceof V?s:new V(Q.InternalError,String(s))}}}request(e,n,i){const{relatedRequestId:t,resumptionToken:o,onresumptiontoken:s,task:a,relatedTask:c}=i??{};return new Promise((u,l)=>{const f=$=>{l($)};if(!this._transport){f(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),a&&this.assertTaskCapability(e.method)}catch($){f($);return}i?.signal?.throwIfAborted();const d=this._requestMessageId++,h={...e,jsonrpc:"2.0",id:d};i?.onprogress&&(this._progressHandlers.set(d,i.onprogress),h.params={...e.params,_meta:{...e.params?._meta||{},progressToken:d}}),a&&(h.params={...h.params,task:a}),c&&(h.params={...h.params,_meta:{...h.params?._meta||{},[xt]:c}});const p=$=>{this._responseHandlers.delete(d),this._progressHandlers.delete(d),this._cleanupTimeout(d),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:d,reason:String($)}},{relatedRequestId:t,resumptionToken:o,onresumptiontoken:s}).catch(z=>this._onerror(new Error(`Failed to send cancellation: ${z}`)));const k=$ instanceof V?$:new V(Q.RequestTimeout,String($));l(k)};this._responseHandlers.set(d,$=>{if(!i?.signal?.aborted){if($ instanceof Error)return l($);try{const k=am(n,$.result);k.success?u(k.data):l(k.error)}catch(k){l(k)}}}),i?.signal?.addEventListener("abort",()=>{p(i?.signal?.reason)});const _=i?.timeout??lx,w=()=>p(V.fromError(Q.RequestTimeout,"Request timed out",{timeout:_}));this._setupTimeout(d,_,i?.maxTotalTimeout,w,i?.resetTimeoutOnProgress??!1);const O=c?.taskId;if(O){const $=k=>{const z=this._responseHandlers.get(d);z?z(k):this._onerror(new Error(`Response handler missing for side-channeled request ${d}`))};this._requestResolvers.set(d,$),this._enqueueTaskMessage(O,{type:"request",message:h,timestamp:Date.now()}).catch(k=>{this._cleanupTimeout(d),l(k)})}else this._transport.send(h,{relatedRequestId:t,resumptionToken:o,onresumptiontoken:s}).catch($=>{this._cleanupTimeout(d),l($)})})}async getTask(e,n){return this.request({method:"tasks/get",params:e},jc,n)}async getTaskResult(e,n,i){return this.request({method:"tasks/result",params:e},n,i)}async listTasks(e,n){return this.request({method:"tasks/list",params:e},Hc,n)}async cancelTask(e,n){return this.request({method:"tasks/cancel",params:e},Ky,n)}async notification(e,n){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);const i=n?.relatedTask?.taskId;if(i){const a={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[xt]:n.relatedTask}}};await this._enqueueTaskMessage(i,{type:"notification",message:a,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!n?.relatedRequestId&&!n?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let a={...e,jsonrpc:"2.0"};n?.relatedTask&&(a={...a,params:{...a.params,_meta:{...a.params?._meta||{},[xt]:n.relatedTask}}}),this._transport?.send(a,n).catch(c=>this._onerror(c))});return}let s={...e,jsonrpc:"2.0"};n?.relatedTask&&(s={...s,params:{...s.params,_meta:{...s.params?._meta||{},[xt]:n.relatedTask}}}),await this._transport.send(s,n)}setRequestHandler(e,n){const i=ll(e);this.assertRequestHandlerCapability(i),this._requestHandlers.set(i,(t,o)=>{const s=dl(e,t);return Promise.resolve(n(s,o))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,n){const i=ll(e);this._notificationHandlers.set(i,t=>{const o=dl(e,t);return Promise.resolve(n(o))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){const n=this._taskProgressTokens.get(e);n!==void 0&&(this._progressHandlers.delete(n),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,n,i){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const t=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,n,i,t)}async _clearTaskQueue(e,n){if(this._taskMessageQueue){const i=await this._taskMessageQueue.dequeueAll(e,n);for(const t of i)if(t.type==="request"&&ul(t.message)){const o=t.message.id,s=this._requestResolvers.get(o);s?(s(new V(Q.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,n){let i=this._options?.defaultTaskPollInterval??1e3;try{const t=await this._taskStore?.getTask(e);t?.pollInterval&&(i=t.pollInterval)}catch{}return new Promise((t,o)=>{if(n.aborted){o(new V(Q.InvalidRequest,"Request cancelled"));return}const s=setTimeout(t,i);n.addEventListener("abort",()=>{clearTimeout(s),o(new V(Q.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,n){const i=this._taskStore;if(!i)throw new Error("No task store configured");return{createTask:async t=>{if(!e)throw new Error("No request provided");return await i.createTask(t,e.id,{method:e.method,params:e.params},n)},getTask:async t=>{const o=await i.getTask(t,n);if(!o)throw new V(Q.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(t,o,s)=>{await i.storeTaskResult(t,o,s,n);const a=await i.getTask(t,n);if(a){const c=fi.parse({method:"notifications/tasks/status",params:a});await this.notification(c),_t(a.status)&&this._cleanupTaskProgressHandler(t)}},getTaskResult:t=>i.getTaskResult(t,n),updateTaskStatus:async(t,o,s)=>{const a=await i.getTask(t,n);if(!a)throw new V(Q.InvalidParams,`Task "${t}" not found - it may have been cleaned up`);if(_t(a.status))throw new V(Q.InvalidParams,`Cannot update task "${t}" from terminal status "${a.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await i.updateTaskStatus(t,o,s,n);const c=await i.getTask(t,n);if(c){const u=fi.parse({method:"notifications/tasks/status",params:c});await this.notification(u),_t(c.status)&&this._cleanupTaskProgressHandler(t)}},listTasks:t=>i.listTasks(t,n)}}}function fl(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)}function fx(r,e){const n={...r};for(const i in e){const t=i,o=e[t];if(o===void 0)continue;const s=n[t];fl(s)&&fl(o)?n[t]={...s,...o}:n[t]=o}return n}(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(e,n)=>(typeof require<"u"?require:e)[n]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')});class hx extends dx{_registeredMethods=new Set;_eventSlots=new Map;onEventDispatch(e,n){}_ensureEventSlot(e){let n=this._eventSlots.get(e);if(!n){let i=this.eventSchemas[e];if(!i)throw Error(`Unknown event: ${String(e)}`);n={listeners:[]},this._eventSlots.set(e,n);let t=i.shape.method.value;this._registeredMethods.add(t);let o=n;super.setNotificationHandler(i,s=>{let a=s.params;this.onEventDispatch(e,a),o.onHandler?.(a);for(let c of[...o.listeners])c(a)})}return n}setEventHandler(e,n){let i=this._ensureEventSlot(e);i.onHandler&&n&&console.warn(`[MCP Apps] on${String(e)} handler replaced. Use addEventListener("${String(e)}", …) to add multiple listeners without replacing.`),i.onHandler=n}getEventHandler(e){return this._eventSlots.get(e)?.onHandler}addEventListener(e,n){this._ensureEventSlot(e).listeners.push(n)}removeEventListener(e,n){let i=this._eventSlots.get(e);if(!i)return;let t=i.listeners.indexOf(n);t!==-1&&i.listeners.splice(t,1)}setRequestHandler=(e,n)=>{this._assertMethodNotRegistered(e,"setRequestHandler"),super.setRequestHandler(e,n)};setNotificationHandler=(e,n)=>{this._assertMethodNotRegistered(e,"setNotificationHandler"),super.setNotificationHandler(e,n)};warnIfRequestHandlerReplaced(e,n,i){n&&i&&console.warn(`[MCP Apps] ${e} handler replaced. Previous handler will no longer be called.`)}replaceRequestHandler=(e,n)=>{let i=e.shape.method.value;this._registeredMethods.add(i),super.setRequestHandler(e,n)};_assertMethodNotRegistered(e,n){let i=e.shape.method.value;if(this._registeredMethods.has(i))throw Error(`Handler for "${i}" already registered (via ${n}). Use addEventListener() to attach multiple listeners, or the on* setter for replace semantics.`);this._registeredMethods.add(i)}}var px="2026-01-26",mx="ui/notifications/tool-input-partial";class gx{eventTarget;eventSource;messageListener;constructor(e=window.parent,n){this.eventTarget=e,this.eventSource=n,this.messageListener=i=>{if(n&&i.source!==this.eventSource){console.debug("Ignoring message from unknown source",i);return}let t=Py.safeParse(i.data);t.success?(console.debug("Parsed message",t.data),this.onmessage?.(t.data)):i.data?.jsonrpc!=="2.0"?console.debug("Ignoring non-JSON-RPC message",t.error.message,i):(console.error("Failed to parse message",t.error.message,i),this.onerror?.(Error("Invalid JSON-RPC message received: "+t.error.message)))}}async start(){window.addEventListener("message",this.messageListener)}async send(e,n){e.method!==mx&&console.debug("Sending message",e),this.eventTarget.postMessage(e,"*")}async close(){window.removeEventListener("message",this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion}var bx=Z([y("light"),y("dark")]).describe("Color theme preference for the host environment."),Fn=Z([y("inline"),y("fullscreen"),y("pip")]).describe("Display mode for UI presentation."),vx=Z([y("--color-background-primary"),y("--color-background-secondary"),y("--color-background-tertiary"),y("--color-background-inverse"),y("--color-background-ghost"),y("--color-background-info"),y("--color-background-danger"),y("--color-background-success"),y("--color-background-warning"),y("--color-background-disabled"),y("--color-text-primary"),y("--color-text-secondary"),y("--color-text-tertiary"),y("--color-text-inverse"),y("--color-text-ghost"),y("--color-text-info"),y("--color-text-danger"),y("--color-text-success"),y("--color-text-warning"),y("--color-text-disabled"),y("--color-border-primary"),y("--color-border-secondary"),y("--color-border-tertiary"),y("--color-border-inverse"),y("--color-border-ghost"),y("--color-border-info"),y("--color-border-danger"),y("--color-border-success"),y("--color-border-warning"),y("--color-border-disabled"),y("--color-ring-primary"),y("--color-ring-secondary"),y("--color-ring-inverse"),y("--color-ring-info"),y("--color-ring-danger"),y("--color-ring-success"),y("--color-ring-warning"),y("--font-sans"),y("--font-mono"),y("--font-weight-normal"),y("--font-weight-medium"),y("--font-weight-semibold"),y("--font-weight-bold"),y("--font-text-xs-size"),y("--font-text-sm-size"),y("--font-text-md-size"),y("--font-text-lg-size"),y("--font-heading-xs-size"),y("--font-heading-sm-size"),y("--font-heading-md-size"),y("--font-heading-lg-size"),y("--font-heading-xl-size"),y("--font-heading-2xl-size"),y("--font-heading-3xl-size"),y("--font-text-xs-line-height"),y("--font-text-sm-line-height"),y("--font-text-md-line-height"),y("--font-text-lg-line-height"),y("--font-heading-xs-line-height"),y("--font-heading-sm-line-height"),y("--font-heading-md-line-height"),y("--font-heading-lg-line-height"),y("--font-heading-xl-line-height"),y("--font-heading-2xl-line-height"),y("--font-heading-3xl-line-height"),y("--border-radius-xs"),y("--border-radius-sm"),y("--border-radius-md"),y("--border-radius-lg"),y("--border-radius-xl"),y("--border-radius-full"),y("--border-width-regular"),y("--shadow-hairline"),y("--shadow-sm"),y("--shadow-md"),y("--shadow-lg")]).describe("CSS variable keys available to MCP apps for theming."),yx=q(vx.describe(`Style variables for theming MCP apps.
878
1157
 
879
1158
  Individual style keys are optional - hosts may provide any subset of these values.
880
1159
  Values are strings containing CSS values (colors, sizes, font stacks, etc.).
881
1160
 
882
1161
  Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
883
- for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),d.union([d.string(),d.undefined()]).describe(`Style variables for theming MCP apps.
1162
+ for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),Z([v(),cn()]).describe(`Style variables for theming MCP apps.
884
1163
 
885
1164
  Individual style keys are optional - hosts may provide any subset of these values.
886
1165
  Values are strings containing CSS values (colors, sizes, font stacks, etc.).
@@ -892,10 +1171,10 @@ Individual style keys are optional - hosts may provide any subset of these value
892
1171
  Values are strings containing CSS values (colors, sizes, font stacks, etc.).
893
1172
 
894
1173
  Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
895
- for compatibility with Zod schema generation. Both are functionally equivalent for validation.`);d.object({method:d.literal("ui/open-link"),params:d.object({url:d.string().describe("URL to open in the host's browser")})});var aS=d.object({isError:d.boolean().optional().describe("True if the host failed to open the URL (e.g., due to security policy).")}).passthrough(),sS=d.object({isError:d.boolean().optional().describe("True if the download failed (e.g., user cancelled or host denied).")}).passthrough(),uS=d.object({isError:d.boolean().optional().describe("True if the host rejected or failed to deliver the message.")}).passthrough();d.object({method:d.literal("ui/notifications/sandbox-proxy-ready"),params:d.object({})});var ua=d.object({connectDomains:d.array(d.string()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket).
1174
+ for compatibility with Zod schema generation. Both are functionally equivalent for validation.`);x({method:y("ui/open-link"),params:x({url:v().describe("URL to open in the host's browser")})});var _x=x({isError:X().optional().describe("True if the host failed to open the URL (e.g., due to security policy).")}).passthrough(),xx=x({isError:X().optional().describe("True if the download failed (e.g., user cancelled or host denied).")}).passthrough(),wx=x({isError:X().optional().describe("True if the host rejected or failed to deliver the message.")}).passthrough();x({method:y("ui/notifications/sandbox-proxy-ready"),params:x({})});var Xc=x({connectDomains:R(v()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket).
896
1175
 
897
1176
  - Maps to CSP \`connect-src\` directive
898
- - Empty or omitted → no network connections (secure default)`),resourceDomains:d.array(d.string()).optional().describe("Origins for static resources (images, scripts, stylesheets, fonts, media).\n\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\n- Wildcard subdomains supported: `https://*.example.com`\n- Empty or omitted → no network resources (secure default)"),frameDomains:d.array(d.string()).optional().describe("Origins for nested iframes.\n\n- Maps to CSP `frame-src` directive\n- Empty or omitted → no nested iframes allowed (`frame-src 'none'`)"),baseUriDomains:d.array(d.string()).optional().describe("Allowed base URIs for the document.\n\n- Maps to CSP `base-uri` directive\n- Empty or omitted → only same origin allowed (`base-uri 'self'`)")}),la=d.object({camera:d.object({}).optional().describe("Request camera access.\n\nMaps to Permission Policy `camera` feature."),microphone:d.object({}).optional().describe("Request microphone access.\n\nMaps to Permission Policy `microphone` feature."),geolocation:d.object({}).optional().describe("Request geolocation access.\n\nMaps to Permission Policy `geolocation` feature."),clipboardWrite:d.object({}).optional().describe("Request clipboard write access.\n\nMaps to Permission Policy `clipboard-write` feature.")});d.object({method:d.literal("ui/notifications/size-changed"),params:d.object({width:d.number().optional().describe("New width in pixels."),height:d.number().optional().describe("New height in pixels.")})});var lS=d.object({method:d.literal("ui/notifications/tool-input"),params:d.object({arguments:d.record(d.string(),d.unknown().describe("Complete tool call arguments as key-value pairs.")).optional().describe("Complete tool call arguments as key-value pairs.")})}),cS=d.object({method:d.literal("ui/notifications/tool-input-partial"),params:d.object({arguments:d.record(d.string(),d.unknown().describe("Partial tool call arguments (incomplete, may change).")).optional().describe("Partial tool call arguments (incomplete, may change).")})}),dS=d.object({method:d.literal("ui/notifications/tool-cancelled"),params:d.object({reason:d.string().optional().describe('Optional reason for the cancellation (e.g., "user action", "timeout").')})}),mS=d.object({fonts:d.string().optional()}),fS=d.object({variables:oS.optional().describe("CSS variables for theming the app."),css:mS.optional().describe("CSS blocks that apps can inject.")}),pS=d.object({method:d.literal("ui/resource-teardown"),params:d.object({})});d.record(d.string(),d.unknown());var Ka=d.object({text:d.object({}).optional().describe("Host supports text content blocks."),image:d.object({}).optional().describe("Host supports image content blocks."),audio:d.object({}).optional().describe("Host supports audio content blocks."),resource:d.object({}).optional().describe("Host supports resource content blocks."),resourceLink:d.object({}).optional().describe("Host supports resource link content blocks."),structuredContent:d.object({}).optional().describe("Host supports structured content.")}),vS=d.object({experimental:d.object({}).optional().describe("Experimental features (structure TBD)."),openLinks:d.object({}).optional().describe("Host supports opening external URLs."),downloadFile:d.object({}).optional().describe("Host supports file downloads via ui/download-file."),serverTools:d.object({listChanged:d.boolean().optional().describe("Host supports tools/list_changed notifications.")}).optional().describe("Host can proxy tool calls to the MCP server."),serverResources:d.object({listChanged:d.boolean().optional().describe("Host supports resources/list_changed notifications.")}).optional().describe("Host can proxy resource reads to the MCP server."),logging:d.object({}).optional().describe("Host accepts log messages."),sandbox:d.object({permissions:la.optional().describe("Permissions granted by the host (camera, microphone, geolocation)."),csp:ua.optional().describe("CSP domains approved by the host.")}).optional().describe("Sandbox configuration applied by the host."),updateModelContext:Ka.optional().describe("Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns."),message:Ka.optional().describe("Host supports receiving content messages (ui/message) from the view.")}),hS=d.object({experimental:d.object({}).optional().describe("Experimental features (structure TBD)."),tools:d.object({listChanged:d.boolean().optional().describe("App supports tools/list_changed notifications.")}).optional().describe("App exposes MCP-style tools that the host can call."),availableDisplayModes:d.array(It).optional().describe("Display modes the app supports.")});d.object({method:d.literal("ui/notifications/initialized"),params:d.object({}).optional()});d.object({csp:ua.optional().describe("Content Security Policy configuration for UI resources."),permissions:la.optional().describe("Sandbox permissions requested by the UI resource."),domain:d.string().optional().describe(`Dedicated origin for view sandbox.
1177
+ - Empty or omitted → no network connections (secure default)`),resourceDomains:R(v()).optional().describe("Origins for static resources (images, scripts, stylesheets, fonts, media).\n\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\n- Wildcard subdomains supported: `https://*.example.com`\n- Empty or omitted → no network resources (secure default)"),frameDomains:R(v()).optional().describe("Origins for nested iframes.\n\n- Maps to CSP `frame-src` directive\n- Empty or omitted → no nested iframes allowed (`frame-src 'none'`)"),baseUriDomains:R(v()).optional().describe("Allowed base URIs for the document.\n\n- Maps to CSP `base-uri` directive\n- Empty or omitted → only same origin allowed (`base-uri 'self'`)")}),Yc=x({camera:x({}).optional().describe("Request camera access.\n\nMaps to Permission Policy `camera` feature."),microphone:x({}).optional().describe("Request microphone access.\n\nMaps to Permission Policy `microphone` feature."),geolocation:x({}).optional().describe("Request geolocation access.\n\nMaps to Permission Policy `geolocation` feature."),clipboardWrite:x({}).optional().describe("Request clipboard write access.\n\nMaps to Permission Policy `clipboard-write` feature.")});x({method:y("ui/notifications/size-changed"),params:x({width:L().optional().describe("New width in pixels."),height:L().optional().describe("New height in pixels.")})});var Sx=x({method:y("ui/notifications/tool-input"),params:x({arguments:q(v(),K().describe("Complete tool call arguments as key-value pairs.")).optional().describe("Complete tool call arguments as key-value pairs.")})}),kx=x({method:y("ui/notifications/tool-input-partial"),params:x({arguments:q(v(),K().describe("Partial tool call arguments (incomplete, may change).")).optional().describe("Partial tool call arguments (incomplete, may change).")})}),Ix=x({method:y("ui/notifications/tool-cancelled"),params:x({reason:v().optional().describe('Optional reason for the cancellation (e.g., "user action", "timeout").')})}),$x=x({fonts:v().optional()}),Ex=x({variables:yx.optional().describe("CSS variables for theming the app."),css:$x.optional().describe("CSS blocks that apps can inject.")}),Tx=x({method:y("ui/resource-teardown"),params:x({})});q(v(),K());var hl=x({text:x({}).optional().describe("Host supports text content blocks."),image:x({}).optional().describe("Host supports image content blocks."),audio:x({}).optional().describe("Host supports audio content blocks."),resource:x({}).optional().describe("Host supports resource content blocks."),resourceLink:x({}).optional().describe("Host supports resource link content blocks."),structuredContent:x({}).optional().describe("Host supports structured content.")});x({method:y("ui/notifications/request-teardown"),params:x({}).optional()});var Ox=x({experimental:q(v(),q(v(),zr()).describe("Experimental features keyed by identifier.")).optional().describe("Experimental features keyed by identifier."),openLinks:x({}).optional().describe("Host supports opening external URLs."),downloadFile:x({}).optional().describe("Host supports file downloads via ui/download-file."),serverTools:x({listChanged:X().optional().describe("Host supports tools/list_changed notifications.")}).optional().describe("Host can proxy tool calls to the MCP server."),serverResources:x({listChanged:X().optional().describe("Host supports resources/list_changed notifications.")}).optional().describe("Host can proxy resource reads to the MCP server."),logging:x({}).optional().describe("Host accepts log messages."),sandbox:x({permissions:Yc.optional().describe("Permissions granted by the host (camera, microphone, geolocation)."),csp:Xc.optional().describe("CSP domains approved by the host.")}).optional().describe("Sandbox configuration applied by the host."),updateModelContext:hl.optional().describe("Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns."),message:hl.optional().describe("Host supports receiving content messages (ui/message) from the view."),sampling:x({tools:x({}).optional().describe("Host supports tool use via `tools` and `toolChoice` parameters.")}).optional().describe("Host supports LLM sampling (sampling/createMessage) from the view.\nMirrors the MCP `ClientCapabilities.sampling` shape so hosts can pass it through.")}),Px=x({experimental:q(v(),q(v(),zr()).describe("Experimental features keyed by identifier.")).optional().describe("Experimental features keyed by identifier."),tools:x({listChanged:X().optional().describe("App supports tools/list_changed notifications.")}).optional().describe("App exposes MCP-style tools that the host can call."),availableDisplayModes:R(Fn).optional().describe("Display modes the app supports.")});x({method:y("ui/notifications/initialized"),params:x({}).optional()});x({csp:Xc.optional().describe("Content Security Policy configuration for UI resources."),permissions:Yc.optional().describe("Sandbox permissions requested by the UI resource."),domain:v().optional().describe(`Dedicated origin for view sandbox.
899
1178
 
900
1179
  Useful when views need stable, dedicated origins for OAuth callbacks, CORS policies, or API key allowlists.
901
1180
 
@@ -903,39 +1182,39 @@ Useful when views need stable, dedicated origins for OAuth callbacks, CORS polic
903
1182
  - Hash-based subdomains (e.g., \`{hash}.claudemcpcontent.com\`)
904
1183
  - URL-derived subdomains (e.g., \`www-example-com.oaiusercontent.com\`)
905
1184
 
906
- If omitted, host uses default sandbox origin (typically per-conversation).`),prefersBorder:d.boolean().optional().describe(`Visual boundary preference - true if view prefers a visible border.
1185
+ If omitted, host uses default sandbox origin (typically per-conversation).`),prefersBorder:X().optional().describe(`Visual boundary preference - true if view prefers a visible border.
907
1186
 
908
1187
  Boolean requesting whether a visible border and background is provided by the host. Specifying an explicit value for this is recommended because hosts' defaults may vary.
909
1188
 
910
1189
  - \`true\`: request visible border + background
911
1190
  - \`false\`: request no visible border + background
912
- - omitted: host decides border`)});d.object({method:d.literal("ui/request-display-mode"),params:d.object({mode:It.describe("The display mode being requested.")})});var gS=d.object({mode:It.describe("The display mode that was actually set. May differ from requested if not supported.")}).passthrough(),_S=d.union([d.literal("model"),d.literal("app")]).describe("Tool visibility scope - who can access the tool.");d.object({resourceUri:d.string().optional(),visibility:d.array(_S).optional().describe(`Who can access this tool. Default: ["model", "app"]
1191
+ - omitted: host decides border`)});x({method:y("ui/request-display-mode"),params:x({mode:Fn.describe("The display mode being requested.")})});var zx=x({mode:Fn.describe("The display mode that was actually set. May differ from requested if not supported.")}).passthrough(),Ax=Z([y("model"),y("app")]).describe("Tool visibility scope - who can access the tool.");x({resourceUri:v().optional(),visibility:R(Ax).optional().describe(`Who can access this tool. Default: ["model", "app"]
913
1192
  - "model": Tool visible to and callable by the agent
914
- - "app": Tool callable by the app from this server only`)});d.object({mimeTypes:d.array(d.string()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')});d.object({method:d.literal("ui/download-file"),params:d.object({contents:d.array(d.union([Ks,Xs])).describe("Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.")})});d.object({method:d.literal("ui/message"),params:d.object({role:d.literal("user").describe('Message role, currently only "user" is supported.'),content:d.array(Pt).describe("Message content blocks (text, image, etc.).")})});d.object({method:d.literal("ui/notifications/sandbox-resource-ready"),params:d.object({html:d.string().describe("HTML content to load into the inner iframe."),sandbox:d.string().optional().describe("Optional override for the inner iframe's sandbox attribute."),csp:ua.optional().describe("CSP configuration from resource metadata."),permissions:la.optional().describe("Sandbox permissions from resource metadata.")})});var $S=d.object({method:d.literal("ui/notifications/tool-result"),params:Pn.describe("Standard MCP tool execution result.")}),Ff=d.object({toolInfo:d.object({id:xt.optional().describe("JSON-RPC id of the tools/call request."),tool:dr.describe("Tool definition including name, inputSchema, etc.")}).optional().describe("Metadata of the tool call that instantiated this App."),theme:iS.optional().describe("Current color theme preference."),styles:fS.optional().describe("Style configuration for theming the app."),displayMode:It.optional().describe("How the UI is currently displayed."),availableDisplayModes:d.array(It).optional().describe("Display modes the host supports."),containerDimensions:d.union([d.object({height:d.number().describe("Fixed container height in pixels.")}),d.object({maxHeight:d.union([d.number(),d.undefined()]).optional().describe("Maximum container height in pixels.")})]).and(d.union([d.object({width:d.number().describe("Fixed container width in pixels.")}),d.object({maxWidth:d.union([d.number(),d.undefined()]).optional().describe("Maximum container width in pixels.")})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
915
- container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:d.string().optional().describe("User's language and region preference in BCP 47 format."),timeZone:d.string().optional().describe("User's timezone in IANA format."),userAgent:d.string().optional().describe("Host application identifier."),platform:d.union([d.literal("web"),d.literal("desktop"),d.literal("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:d.object({touch:d.boolean().optional().describe("Whether the device supports touch input."),hover:d.boolean().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:d.object({top:d.number().describe("Top safe area inset in pixels."),right:d.number().describe("Right safe area inset in pixels."),bottom:d.number().describe("Bottom safe area inset in pixels."),left:d.number().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough(),bS=d.object({method:d.literal("ui/notifications/host-context-changed"),params:Ff.describe("Partial context update containing only changed fields.")});d.object({method:d.literal("ui/update-model-context"),params:d.object({content:d.array(Pt).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:d.record(d.string(),d.unknown().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})});d.object({method:d.literal("ui/initialize"),params:d.object({appInfo:Un.describe("App identification (name and version)."),appCapabilities:hS.describe("Features and capabilities this app provides."),protocolVersion:d.string().describe("Protocol version this app supports.")})});var yS=d.object({protocolVersion:d.string().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:Un.describe("Host application identification and version."),hostCapabilities:vS.describe("Features and capabilities provided by the host."),hostContext:Ff.describe("Rich context about the host environment.")}).passthrough();class kS extends bb{_appInfo;_capabilities;options;_hostCapabilities;_hostInfo;_hostContext;constructor(t,i={},r={autoResize:!0}){super(r),this._appInfo=t,this._capabilities=i,this.options=r,this.setRequestHandler(Nn,n=>(console.log("Received ping:",n.params),{})),this.onhostcontextchanged=()=>{}}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}set ontoolinput(t){this.setNotificationHandler(lS,i=>t(i.params))}set ontoolinputpartial(t){this.setNotificationHandler(cS,i=>t(i.params))}set ontoolresult(t){this.setNotificationHandler($S,i=>t(i.params))}set ontoolcancelled(t){this.setNotificationHandler(dS,i=>t(i.params))}set onhostcontextchanged(t){this.setNotificationHandler(bS,i=>{this._hostContext={...this._hostContext,...i.params},t(i.params)})}set onteardown(t){this.setRequestHandler(pS,(i,r)=>t(i.params,r))}set oncalltool(t){this.setRequestHandler(Qs,(i,r)=>t(i.params,r))}set onlisttools(t){this.setRequestHandler(Ys,(i,r)=>t(i.params,r))}assertCapabilityForMethod(t){}assertRequestHandlerCapability(t){switch(t){case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Client does not support tool capability (required for ${t})`);return;case"ping":case"ui/resource-teardown":return;default:throw Error(`No handler for method ${t} registered`)}}assertNotificationCapability(t){}assertTaskCapability(t){throw Error("Tasks are not supported in MCP Apps")}assertTaskHandlerCapability(t){throw Error("Task handlers are not supported in MCP Apps")}async callServerTool(t,i){if(typeof t=="string")throw Error(`callServerTool() expects an object as its first argument, but received a string ("${t}"). Did you mean: callServerTool({ name: "${t}", arguments: { ... } })?`);return await this.request({method:"tools/call",params:t},Pn,i)}async readServerResource(t,i){return await this.request({method:"resources/read",params:t},Gs,i)}async listServerResources(t,i){return await this.request({method:"resources/list",params:t},Ws,i)}sendMessage(t,i){return this.request({method:"ui/message",params:t},uS,i)}sendLog(t){return this.notification({method:"notifications/message",params:t})}updateModelContext(t,i){return this.request({method:"ui/update-model-context",params:t},Ki,i)}openLink(t,i){return this.request({method:"ui/open-link",params:t},aS,i)}sendOpenLink=this.openLink;downloadFile(t,i){return this.request({method:"ui/download-file",params:t},sS,i)}requestDisplayMode(t,i){return this.request({method:"ui/request-display-mode",params:t},gS,i)}sendSizeChanged(t){return this.notification({method:"ui/notifications/size-changed",params:t})}setupSizeChangedNotifications(){let t=!1,i=0,r=0,n=()=>{t||(t=!0,requestAnimationFrame(()=>{t=!1;let a=document.documentElement,s=a.style.width,u=a.style.height;a.style.width="fit-content",a.style.height="max-content";let l=a.getBoundingClientRect();a.style.width=s,a.style.height=u;let c=window.innerWidth-a.clientWidth,m=Math.ceil(l.width+c),p=Math.ceil(l.height);(m!==i||p!==r)&&(i=m,r=p,this.sendSizeChanged({width:m,height:p}))}))};n();let o=new ResizeObserver(n);return o.observe(document.documentElement),o.observe(document.body),()=>o.disconnect()}async connect(t=new Sb(window.parent,window.parent),i){if(this.transport)throw Error("App is already connected. Call close() before connecting again.");await super.connect(t);try{let r=await this.request({method:"ui/initialize",params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:Ib}},yS,i);if(r===void 0)throw Error(`Server sent invalid initialize result: ${r}`);this._hostCapabilities=r.hostCapabilities,this._hostInfo=r.hostInfo,this._hostContext=r.hostContext,await this.notification({method:"ui/notifications/initialized"}),this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(r){throw this.close(),r}}}function de(e){const t=document.createElement("div");return t.textContent=e,t.innerHTML}async function wS(e,t){try{await navigator.clipboard.writeText(e);const i=t.innerHTML;t.innerHTML='<svg viewBox="0 0 24 24" style="width:14px;height:14px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round"><polyline points="20 6 9 17 4 12"/></svg>',setTimeout(()=>{t.innerHTML=i},1500)}catch{}}function Ii(e,t=8){return e.length<=t*2+3?e:`${e.slice(0,t)}...${e.slice(-t)}`}function Xa(e){return e.toLocaleString()+" sats"}function SS(e){return e?e>=1e15?`${(e/1e15).toFixed(1)} PH`:e>=1e12?`${(e/1e12).toFixed(1)} TH`:e>=1e9?`${(e/1e9).toFixed(1)} GH`:e>=1e6?`${(e/1e6).toFixed(1)} MH`:e.toLocaleString():"—"}function IS(e){if(!e)return"—";const t=Math.floor(Date.now()/1e3)-e;return t<60?`${t}s ago`:t<3600?`${Math.floor(t/60)}m ago`:`${Math.floor(t/3600)}h ago`}const qf=document.querySelectorAll(".view-tab"),zS={explorer:document.getElementById("explorer-panel"),wallet:document.getElementById("wallet-panel"),ordinals:document.getElementById("ordinals-panel")};let Bf=!1,Hf=!1;function xS(e){for(const t of qf){const i=t.dataset.view===e;t.classList.toggle("active",i),t.setAttribute("aria-selected",String(i))}for(const[t,i]of Object.entries(zS))i.classList.toggle("active",t===e);e==="wallet"&&!Bf&&jS(),e==="ordinals"&&!Hf&&DS()}for(const e of qf)e.addEventListener("click",()=>xS(e.dataset.view));const Ae=new kS({name:"BSV MCP",version:"1.0.0"});Ae.ontoolresult=e=>{e.structuredContent&&OS(e.structuredContent)};Ae.onhostcontextchanged=e=>{};await Ae.connect();function OS(e){document.getElementById("loading").style.display="none",document.getElementById("app").classList.add("ready"),ZS()}const Ai=document.getElementById("explorer-content");async function ZS(){Ai.innerHTML='<div class="empty-state">loading...</div>';try{const e=await Ae.callServerTool({name:"app_explorer_data",arguments:{}});e?.structuredContent&&TS(e.structuredContent)}catch(e){Ai.innerHTML=`<div class="error-box">Failed to load explorer data: ${de(String(e))}</div>`}}function TS(e){const t=e.price,i=e.chainInfo,r=e.recentBlocks,n=i?.blocks,o=i?.difficulty,a=i?.bestblockhash;Ai.innerHTML=`
1193
+ - "app": Tool callable by the app from this server only`),csp:Ct().optional(),permissions:Ct().optional()});x({mimeTypes:R(v()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')});x({method:y("ui/download-file"),params:x({contents:R(Z([Om,Pm])).describe("Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.")})});x({method:y("ui/message"),params:x({role:y("user").describe('Message role, currently only "user" is supported.'),content:R(qr).describe("Message content blocks (text, image, etc.).")})});x({method:y("ui/notifications/sandbox-resource-ready"),params:x({html:v().describe("HTML content to load into the inner iframe."),sandbox:v().optional().describe("Optional override for the inner iframe's sandbox attribute."),csp:Xc.optional().describe("CSP configuration from resource metadata."),permissions:Yc.optional().describe("Sandbox permissions from resource metadata.")})});var Nx=x({method:y("ui/notifications/tool-result"),params:Oo.describe("Standard MCP tool execution result.")}),Rm=x({toolInfo:x({id:Mr.optional().describe("JSON-RPC id of the tools/call request."),tool:Wc.describe("Tool definition including name, inputSchema, etc.")}).optional().describe("Metadata of the tool call that instantiated this App."),theme:bx.optional().describe("Current color theme preference."),styles:Ex.optional().describe("Style configuration for theming the app."),displayMode:Fn.optional().describe("How the UI is currently displayed."),availableDisplayModes:R(Fn).optional().describe("Display modes the host supports."),containerDimensions:Z([x({height:L().describe("Fixed container height in pixels.")}),x({maxHeight:Z([L(),cn()]).optional().describe("Maximum container height in pixels.")})]).and(Z([x({width:L().describe("Fixed container width in pixels.")}),x({maxWidth:Z([L(),cn()]).optional().describe("Maximum container width in pixels.")})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
1194
+ container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:v().optional().describe("User's language and region preference in BCP 47 format."),timeZone:v().optional().describe("User's timezone in IANA format."),userAgent:v().optional().describe("Host application identifier."),platform:Z([y("web"),y("desktop"),y("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:x({touch:X().optional().describe("Whether the device supports touch input."),hover:X().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:x({top:L().describe("Top safe area inset in pixels."),right:L().describe("Right safe area inset in pixels."),bottom:L().describe("Bottom safe area inset in pixels."),left:L().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough(),Ux=x({method:y("ui/notifications/host-context-changed"),params:Rm.describe("Partial context update containing only changed fields.")});x({method:y("ui/update-model-context"),params:x({content:R(qr).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:q(v(),K().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})});x({method:y("ui/initialize"),params:x({appInfo:Eo.describe("App identification (name and version)."),appCapabilities:Px.describe("Features and capabilities this app provides."),protocolVersion:v().describe("Protocol version this app supports.")})});var Dx=x({protocolVersion:v().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:Eo.describe("Host application identification and version."),hostCapabilities:Ox.describe("Features and capabilities provided by the host."),hostContext:Rm.describe("Rich context about the host environment.")}).passthrough(),Rx={target:"draft-2020-12"};async function pl(r,e){let n=r["~standard"];if(n.jsonSchema)return n.jsonSchema[e](Rx);if(n.vendor==="zod"){let{z:i}=await X0(()=>Promise.resolve().then(()=>ky),void 0,import.meta.url);return i.toJSONSchema(r,{io:e})}throw Error(`Schema (vendor: ${n.vendor}) does not implement Standard JSON Schema (~standard.jsonSchema). Use a library that does (zod v4, ArkType, Valibot) or wrap your schema accordingly.`)}async function ml(r,e,n=""){let i=await r["~standard"].validate(e);if(i.issues){let t=i.issues.map(o=>{let s=o.path?.map(a=>typeof a=="object"?a.key:a).join(".");return s?`${s}: ${o.message}`:o.message}).join("; ");throw Error(n+t)}return i.value}class Qc extends hx{_appInfo;_capabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_assertInitialized(e){if(this._initializedSent)return;let n=`[ext-apps] App.${e}() called before connect() completed the ui/initialize handshake. Await app.connect() before calling this method, or move data loading to an ontoolresult handler.`;if(this.options?.strict)throw Error(n);console.warn(`${n}. This will throw in a future release.`)}eventSchemas={toolinput:Sx,toolinputpartial:kx,toolresult:Nx,toolcancelled:Ix,hostcontextchanged:Ux};static ONE_SHOT_EVENTS=new Set(["toolinput","toolinputpartial","toolresult","toolcancelled"]);_everHadListener=new Set;_assertHandlerTiming(e){if(!Qc.ONE_SHOT_EVENTS.has(e)||this._everHadListener.has(e)||(this._everHadListener.add(e),!this._initializedSent))return;let n=`[ext-apps] "${String(e)}" handler registered after connect() completed the ui/initialize handshake. The host may have already sent this notification. Register handlers before calling app.connect().`;if(this.options?.strict)throw Error(n);console.warn(n)}setEventHandler(e,n){n&&this._assertHandlerTiming(e),super.setEventHandler(e,n)}addEventListener(e,n){this._assertHandlerTiming(e),super.addEventListener(e,n)}onEventDispatch(e,n){e==="hostcontextchanged"&&(this._hostContext={...this._hostContext,...n})}constructor(e,n={},i={autoResize:!0}){super(i),this._appInfo=e,this._capabilities=n,this.options=i,i.allowUnsafeEval||pe({jitless:!0}),this.setRequestHandler(To,t=>(console.log("Received ping:",t.params),{})),this.setEventHandler("hostcontextchanged",void 0)}registerCapabilities(e){if(this.transport)throw Error("Cannot register capabilities after transport is established");this._capabilities=fx(this._capabilities,e)}registerTool(e,n,i){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let t=this,o=()=>{t._initializedSent&&t._capabilities.tools?.listChanged&&t.sendToolListChanged()},s=n.inputSchema!==void 0,a={title:n.title,description:n.description,inputSchema:n.inputSchema,outputSchema:n.outputSchema,annotations:n.annotations,_meta:n._meta,enabled:!0,enable(){this.enabled=!0,o()},disable(){this.enabled=!1,o()},update(c){Object.assign(this,c),o()},remove(){t._registeredTools[e]===a&&(delete t._registeredTools[e],o())},handler:async(c,u)=>{if(!a.enabled)throw Error(`Tool ${e} is disabled`);let l;if(s){let f=a.inputSchema,d=f?await ml(f,c??{},`Invalid input for tool ${e}: `):c??{};l=await i(d,u)}else l=await i(u);return a.outputSchema&&!l.isError&&(l.structuredContent=await ml(a.outputSchema,l.structuredContent,`Invalid output for tool ${e}: `)),l}};return this._registeredTools[e]=a,!this._capabilities.tools&&!this.transport&&this.registerCapabilities({tools:{listChanged:!0}}),this.ensureToolHandlersInitialized(),o(),a}_toolHandlersInitialized=!1;ensureToolHandlersInitialized(){this._toolHandlersInitialized||(this._toolHandlersInitialized=!0,this.oncalltool=async(e,n)=>{let i=this._registeredTools[e.name];if(!i)throw Error(`Tool ${e.name} not found`);return i.handler(e.arguments,n)},this.onlisttools=async(e,n)=>({tools:await Promise.all(Object.entries(this._registeredTools).filter(([i,t])=>t.enabled).map(async([i,t])=>{let o={name:i,title:t.title,description:t.description,inputSchema:t.inputSchema?await pl(t.inputSchema,"input"):{type:"object",properties:{}}};return t.outputSchema&&(o.outputSchema=await pl(t.outputSchema,"output")),t.annotations&&(o.annotations=t.annotations),t._meta&&(o._meta=t._meta),o}))}))}async sendToolListChanged(e={}){this._assertInitialized("sendToolListChanged"),await this.notification({method:"notifications/tools/list_changed",params:e})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler("toolinput")}set ontoolinput(e){this.setEventHandler("toolinput",e)}get ontoolinputpartial(){return this.getEventHandler("toolinputpartial")}set ontoolinputpartial(e){this.setEventHandler("toolinputpartial",e)}get ontoolresult(){return this.getEventHandler("toolresult")}set ontoolresult(e){this.setEventHandler("toolresult",e)}get ontoolcancelled(){return this.getEventHandler("toolcancelled")}set ontoolcancelled(e){this.setEventHandler("toolcancelled",e)}get onhostcontextchanged(){return this.getEventHandler("hostcontextchanged")}set onhostcontextchanged(e){this.setEventHandler("hostcontextchanged",e)}_onteardown;get onteardown(){return this._onteardown}set onteardown(e){this.warnIfRequestHandlerReplaced("onteardown",this._onteardown,e),this._onteardown=e,this.replaceRequestHandler(Tx,(n,i)=>{if(!this._onteardown)throw Error("No onteardown handler set");return this._onteardown(n.params,i)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(e){this.warnIfRequestHandlerReplaced("oncalltool",this._oncalltool,e),this._oncalltool=e,this.replaceRequestHandler(Am,(n,i)=>{if(!this._oncalltool)throw Error("No oncalltool handler set");return this._oncalltool(n.params,i)})}_onlisttools;get onlisttools(){return this._onlisttools}set onlisttools(e){this.warnIfRequestHandlerReplaced("onlisttools",this._onlisttools,e),this._onlisttools=e,this.replaceRequestHandler(zm,(n,i)=>{if(!this._onlisttools)throw Error("No onlisttools handler set");return this._onlisttools(n.params,i)})}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._hostCapabilities?.sampling)throw Error(`Host does not support sampling (required for ${e})`);break}}assertRequestHandlerCapability(e){switch(e){case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Client does not support tool capability (required for ${e})`);return;case"ping":case"ui/resource-teardown":return;default:throw Error(`No handler for method ${e} registered`)}}assertNotificationCapability(e){}assertTaskCapability(e){throw Error("Tasks are not supported in MCP Apps")}assertTaskHandlerCapability(e){throw Error("Task handlers are not supported in MCP Apps")}async callServerTool(e,n){if(this._assertInitialized("callServerTool"),typeof e=="string")throw Error(`callServerTool() expects an object as its first argument, but received a string ("${e}"). Did you mean: callServerTool({ name: "${e}", arguments: { ... } })?`);return await this.request({method:"tools/call",params:e},Oo,{onprogress:()=>{},resetTimeoutOnProgress:!0,...n})}async readServerResource(e,n){return this._assertInitialized("readServerResource"),await this.request({method:"resources/read",params:e},Tm,n)}async listServerResources(e,n){return this._assertInitialized("listServerResources"),await this.request({method:"resources/list",params:e},Em,n)}async createSamplingMessage(e,n){this._assertInitialized("createSamplingMessage");let i=e.tools?Dm:Um;return await this.request({method:"sampling/createMessage",params:e},i,n)}sendMessage(e,n){return this._assertInitialized("sendMessage"),this.request({method:"ui/message",params:e},wx,n)}sendLog(e){return this.notification({method:"notifications/message",params:e})}updateModelContext(e,n){return this._assertInitialized("updateModelContext"),this.request({method:"ui/update-model-context",params:e},Dc,n)}openLink(e,n){return this._assertInitialized("openLink"),this.request({method:"ui/open-link",params:e},_x,n)}sendOpenLink=this.openLink;downloadFile(e,n){return this._assertInitialized("downloadFile"),this.request({method:"ui/download-file",params:e},xx,n)}requestTeardown(e={}){return this.notification({method:"ui/notifications/request-teardown",params:e})}requestDisplayMode(e,n){return this._assertInitialized("requestDisplayMode"),this.request({method:"ui/request-display-mode",params:e},zx,n)}sendSizeChanged(e){return this.notification({method:"ui/notifications/size-changed",params:e})}setupSizeChangedNotifications(){let e=!1,n=0,i=0,t=()=>{e||(e=!0,requestAnimationFrame(()=>{e=!1;let s=document.documentElement,a=s.style.height;s.style.height="max-content";let c=Math.ceil(s.getBoundingClientRect().height);s.style.height=a;let u=Math.ceil(window.innerWidth);(u!==n||c!==i)&&(n=u,i=c,this.sendSizeChanged({width:u,height:c}))}))};t();let o=new ResizeObserver(t);return o.observe(document.documentElement),o.observe(document.body),()=>o.disconnect()}async connect(e=new gx(window.parent,window.parent),n){if(this.transport)throw Error("App is already connected. Call close() before connecting again.");this._initializedSent=!1,await super.connect(e);try{let i=await this.request({method:"ui/initialize",params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:px}},Dx,n);if(i===void 0)throw Error(`Server sent invalid initialize result: ${i}`);this._hostCapabilities=i.hostCapabilities,this._hostInfo=i.hostInfo,this._hostContext=i.hostContext,await this.notification({method:"ui/notifications/initialized"}),this._initializedSent=!0,this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(i){throw this.close(),i}}}function F(r){const e=document.getElementById(r);if(!e)throw new Error(`View markup is missing #${r}`);return e}function fe(r){const e=document.createElement("div");return e.textContent=r,e.innerHTML}async function Cx(r,e){try{await navigator.clipboard.writeText(r);const n=e.innerHTML;e.innerHTML='<svg viewBox="0 0 24 24" style="width:14px;height:14px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round"><polyline points="20 6 9 17 4 12"/></svg>',setTimeout(()=>{e.innerHTML=n},1500)}catch{}}function Ht(r,e=8){return r.length<=e*2+3?r:`${r.slice(0,e)}...${r.slice(-e)}`}function gl(r){return`${r.toLocaleString()} sats`}function Lx(r){return r?r>=1e15?`${(r/1e15).toFixed(1)} PH`:r>=1e12?`${(r/1e12).toFixed(1)} TH`:r>=1e9?`${(r/1e9).toFixed(1)} GH`:r>=1e6?`${(r/1e6).toFixed(1)} MH`:r.toLocaleString():"—"}function Mx(r){if(!r)return"—";const e=Math.floor(Date.now()/1e3)-r;return e<60?`${e}s ago`:e<3600?`${Math.floor(e/60)}m ago`:`${Math.floor(e/3600)}h ago`}const Cm=document.querySelectorAll(".view-tab"),jx={explorer:F("explorer-panel"),wallet:F("wallet-panel"),ordinals:F("ordinals-panel"),sweep:F("sweep-panel")};let Lm=!1,Mm=!1,jm=!1;function Bx(r){for(const e of Cm){const n=e.dataset.view===r;e.classList.toggle("active",n),e.setAttribute("aria-selected",String(n))}for(const[e,n]of Object.entries(jx))n.classList.toggle("active",e===r);r==="wallet"&&!Lm&&Kx(),r==="ordinals"&&!Mm&&Wx(),r==="sweep"&&!jm&&Yx()}for(const r of Cm)r.addEventListener("click",()=>{const e=r.dataset.view;e&&Bx(e)});const We=new Qc({name:"BSV MCP",version:"1.0.0"});We.ontoolresult=r=>{r.structuredContent&&Fx(r.structuredContent)};We.onhostcontextchanged=r=>{};await We.connect();function Fx(r){F("loading").style.display="none",F("app").classList.add("ready"),Hx()}const ns=F("explorer-content");async function Hx(){ns.innerHTML='<div class="empty-state">loading...</div>';try{const r=await We.callServerTool({name:"app_explorer_data",arguments:{}});r?.structuredContent&&Zx(r.structuredContent)}catch(r){ns.innerHTML=`<div class="error-box">Failed to load explorer data: ${fe(String(r))}</div>`}}function Zx(r){const e=r.price,n=r.chainInfo,i=r.recentBlocks,t=n?.blocks,o=n?.difficulty,s=n?.bestblockhash;ns.innerHTML=`
916
1195
  <div class="stats-row">
917
1196
  <div class="stat-card">
918
1197
  <div class="stat-label">Block Height</div>
919
- <div class="stat-value">${n?n.toLocaleString():"—"}</div>
1198
+ <div class="stat-value">${t?t.toLocaleString():"—"}</div>
920
1199
  </div>
921
1200
  <div class="stat-card">
922
1201
  <div class="stat-label">BSV Price</div>
923
- <div class="stat-value">${t?`$${t.toFixed(2)}`:"—"}</div>
1202
+ <div class="stat-value">${e?`$${e.toFixed(2)}`:"—"}</div>
924
1203
  </div>
925
1204
  <div class="stat-card">
926
1205
  <div class="stat-label">Network Difficulty</div>
927
- <div class="stat-value">${SS(o)}</div>
1206
+ <div class="stat-value">${Lx(o)}</div>
928
1207
  </div>
929
1208
  <div class="stat-card">
930
1209
  <div class="stat-label">Best Block</div>
931
- <div class="stat-value" style="font-size:12px;margin-top:4px">${a?Ii(a,6):"—"}</div>
1210
+ <div class="stat-value" style="font-size:12px;margin-top:4px">${s?Ht(s,6):"—"}</div>
932
1211
  </div>
933
1212
  </div>
934
1213
 
935
- ${r&&r.length>0?US(r):""}
1214
+ ${i&&i.length>0?qx(i):""}
936
1215
 
937
1216
  <div id="search-results"></div>
938
- `,NS()}function US(e){return`
1217
+ `,Vx()}function qx(r){return`
939
1218
  <div class="blocks-section">
940
1219
  <div class="section-header">Recent Blocks</div>
941
1220
  <div class="blocks-table">
@@ -946,62 +1225,78 @@ container holding the app. Specify either width or maxWidth, and either height o
946
1225
  <div class="col-header col-right">Size</div>
947
1226
  <div class="col-header col-right">Time</div>
948
1227
  </div>
949
- ${e.map(i=>{const r=i.height,n=i.hash,o=i.tx,a=i.size,s=i.time;return`
1228
+ ${r.map(n=>{const i=n.height,t=n.hash,o=n.tx,s=n.size,a=n.time;return`
950
1229
  <div class="blocks-table-row">
951
- <div class="cell-mono">${r?.toLocaleString()??"—"}</div>
952
- <div class="cell-hash">${n?Ii(n,10):"—"}</div>
1230
+ <div class="cell-mono">${i?.toLocaleString()??"—"}</div>
1231
+ <div class="cell-hash">${t?Ht(t,10):"—"}</div>
953
1232
  <div class="cell-dim" style="text-align:right">${o?o.length.toLocaleString():"—"}</div>
954
- <div class="cell-dim" style="text-align:right">${a?`${(a/1024).toFixed(1)} KB`:"—"}</div>
955
- <div class="cell-dim" style="text-align:right">${IS(s)}</div>
1233
+ <div class="cell-dim" style="text-align:right">${s?`${(s/1024).toFixed(1)} KB`:"—"}</div>
1234
+ <div class="cell-dim" style="text-align:right">${Mx(a)}</div>
956
1235
  </div>
957
1236
  `}).join("")}
958
1237
  </div>
959
1238
  </div>
960
- `}function NS(){const e=document.getElementById("search-input"),t=document.getElementById("search-btn"),i=document.getElementById("search-results");if(!e||!t||!i)return;async function r(){const n=e.value.trim();if(n){i.innerHTML='<div class="empty-state">searching...</div>';try{const o=/^[0-9a-f]{64}$/i.test(n),a=n.startsWith("1")&&n.length>=25&&n.length<=34,s={};o?s.txid=n:a?s.address=n:s.query=n;const u=await Ae.callServerTool({name:"app_explorer_data",arguments:s});u?.structuredContent&&PS(i,u.structuredContent,n)}catch(o){i.innerHTML=`<div class="error-box">${de(String(o))}</div>`}}}t.addEventListener("click",r),e.addEventListener("keydown",n=>{n.key==="Enter"&&r()})}function PS(e,t,i){const r=t.transaction,n=t.addressInfo;if(r){const o=r.outputs;e.innerHTML=`
1239
+ `}function Vx(){const r=document.getElementById("search-input"),e=document.getElementById("search-btn"),n=F("search-results");if(!r||!e||!n)return;async function i(){const t=r?.value.trim();if(t){n.innerHTML='<div class="empty-state">searching...</div>';try{const o=/^[0-9a-f]{64}$/i.test(t),s=t.startsWith("1")&&t.length>=25&&t.length<=34,a={};o?a.txid=t:s?a.address=t:a.query=t;const c=await We.callServerTool({name:"app_explorer_data",arguments:a});c?.structuredContent&&Gx(n,c.structuredContent,t)}catch(o){n.innerHTML=`<div class="error-box">${fe(String(o))}</div>`}}}e.addEventListener("click",i),r.addEventListener("keydown",t=>{t.key==="Enter"&&i()})}function Gx(r,e,n){const i=e.transaction,t=e.addressInfo;if(i){const o=i.outputs;r.innerHTML=`
961
1240
  <div class="blocks-section">
962
1241
  <div class="section-header">Transaction</div>
963
1242
  <div class="search-result">
964
- <div class="result-row"><span class="result-key">TXID</span><span class="result-val">${de(String(r.txid??i))}</span></div>
965
- <div class="result-row"><span class="result-key">Size</span><span class="result-val">${r.size} bytes</span></div>
966
- ${r.fee!=null?`<div class="result-row"><span class="result-key">Fee</span><span class="result-val">${r.fee} sats</span></div>`:""}
967
- ${r.confirmations!=null?`<div class="result-row"><span class="result-key">Confirmations</span><span class="result-val">${r.confirmations}</span></div>`:""}
1243
+ <div class="result-row"><span class="result-key">TXID</span><span class="result-val">${fe(String(i.txid??n))}</span></div>
1244
+ <div class="result-row"><span class="result-key">Size</span><span class="result-val">${i.size} bytes</span></div>
1245
+ ${i.fee!=null?`<div class="result-row"><span class="result-key">Fee</span><span class="result-val">${i.fee} sats</span></div>`:""}
1246
+ ${i.confirmations!=null?`<div class="result-row"><span class="result-key">Confirmations</span><span class="result-val">${i.confirmations}</span></div>`:""}
968
1247
  <div class="result-row"><span class="result-key">Outputs</span><span class="result-val">${o.length}</span></div>
969
1248
  </div>
970
1249
  </div>
971
- `}else if(n){const o=n.balance,a=n.history;e.innerHTML=`
1250
+ `}else if(t){const o=t.balance,s=t.history;r.innerHTML=`
972
1251
  <div class="blocks-section">
973
1252
  <div class="section-header">Address</div>
974
1253
  <div class="search-result">
975
- <div class="result-row"><span class="result-key">Address</span><span class="result-val">${de(i)}</span></div>
976
- <div class="result-row"><span class="result-key">Confirmed</span><span class="result-val">${o?Xa(Number(o.confirmed??0)):"—"}</span></div>
977
- ${o?.unconfirmed?`<div class="result-row"><span class="result-key">Unconfirmed</span><span class="result-val">${Xa(Number(o.unconfirmed))}</span></div>`:""}
978
- ${a?`<div class="result-row"><span class="result-key">Transactions</span><span class="result-val">${a.length}</span></div>`:""}
1254
+ <div class="result-row"><span class="result-key">Address</span><span class="result-val">${fe(n)}</span></div>
1255
+ <div class="result-row"><span class="result-key">Confirmed</span><span class="result-val">${o?gl(Number(o.confirmed??0)):"—"}</span></div>
1256
+ ${o?.unconfirmed?`<div class="result-row"><span class="result-key">Unconfirmed</span><span class="result-val">${gl(Number(o.unconfirmed))}</span></div>`:""}
1257
+ ${s?`<div class="result-row"><span class="result-key">Transactions</span><span class="result-val">${s.length}</span></div>`:""}
979
1258
  </div>
980
1259
  </div>
981
- `}else e.innerHTML='<div class="empty-state">No results found</div>'}async function jS(){document.getElementById("balance-value").textContent="loading...",document.getElementById("utxo-list").innerHTML='<div class="empty-state">loading...</div>';try{const e=await Ae.callServerTool({name:"app_wallet_data",arguments:{}});e?.structuredContent&&(Bf=!0,ES(e.structuredContent))}catch(e){document.getElementById("balance-value").textContent="error",document.getElementById("utxo-list").innerHTML=`<div class="error-box">${de(String(e))}</div>`}}function ES(e){const t=e.balance,i=e.address,r=e.utxos,n=e.price,o=Number(t?.satoshis??0),a=t?.bsv?String(t.bsv):(o/1e8).toFixed(8),s=n?o/1e8*n:null,u=Number(t?.utxoCount??r?.length??0);if(document.getElementById("balance-value").textContent=`${a} BSV`,document.getElementById("sats-value").textContent=`${o.toLocaleString()} sats`,document.getElementById("usd-value").textContent=s!=null?`~$${s.toFixed(2)} USD`:"— USD",document.getElementById("utxo-count").textContent=`${u} UTXOs`,i){const m=document.getElementById("address-section");m.style.display="flex",document.getElementById("address-display").textContent=i,document.getElementById("copy-address-btn").addEventListener("click",p=>{wS(i,p.currentTarget)})}const l=document.getElementById("utxo-list");if(!r||r.length===0){l.innerHTML='<div class="empty-state">No UTXOs found</div>';return}const c=r.slice(0,25).map(m=>{const p=String(m.txid??""),g=m.vout??m.outputIndex??"—",w=Number(m.satoshis??0);return`
1260
+ `}else r.innerHTML='<div class="empty-state">No results found</div>'}async function Kx(){F("balance-value").textContent="loading...",F("utxo-list").innerHTML='<div class="empty-state">loading...</div>';try{const r=await We.callServerTool({name:"app_wallet_data",arguments:{}});if(r?.structuredContent){const e=r.structuredContent;if(e.error){F("balance-value").textContent="—",F("utxo-list").innerHTML=`<div class="error-box">${fe(String(e.error))}</div>`;return}Lm=!0,Jx(e)}}catch(r){F("balance-value").textContent="error",F("utxo-list").innerHTML=`<div class="error-box">${fe(String(r))}</div>`}}function Jx(r){const e=r.balance,n=r.address,i=r.utxos,t=r.price,o=Number(e?.satoshis??0),s=e?.bsv?String(e.bsv):(o/1e8).toFixed(8),a=t?o/1e8*t:null,c=Number(e?.utxoCount??i?.length??0);if(F("balance-value").textContent=`${s} BSV`,F("sats-value").textContent=`${o.toLocaleString()} sats`,F("usd-value").textContent=a!=null?`~$${a.toFixed(2)} USD`:"— USD",F("utxo-count").textContent=`${c} UTXOs`,n){const f=F("address-section");f.style.display="flex",F("address-display").textContent=n,document.getElementById("copy-address-btn")?.addEventListener("click",d=>{Cx(n,d.currentTarget)})}const u=F("utxo-list");if(!i||i.length===0){u.innerHTML='<div class="empty-state">No UTXOs found</div>';return}const l=i.slice(0,25).map(f=>{const d=String(f.txid??""),h=f.vout??f.outputIndex??"—",p=Number(f.satoshis??0);return`
982
1261
  <div class="utxo-row">
983
- <div class="utxo-txid">${de(Ii(p,10))}</div>
984
- <div class="utxo-index">${g}</div>
985
- <div class="utxo-value">${w.toLocaleString()}</div>
1262
+ <div class="utxo-txid">${fe(Ht(d,10))}</div>
1263
+ <div class="utxo-index">${h}</div>
1264
+ <div class="utxo-value">${p.toLocaleString()}</div>
986
1265
  </div>
987
- `}).join("");l.innerHTML=`
1266
+ `}).join("");u.innerHTML=`
988
1267
  <div class="utxo-header">
989
1268
  <div class="utxo-col col-txid">TXID</div>
990
1269
  <div class="utxo-col col-index">Index</div>
991
1270
  <div class="utxo-col col-value">Value (sats)</div>
992
1271
  </div>
993
- ${c}
994
- `}async function DS(){document.getElementById("ordinals-grid").innerHTML='<div class="empty-state" style="grid-column:1/-1">loading...</div>';try{const e=await Ae.callServerTool({name:"app_ordinals_data",arguments:{}});e?.structuredContent&&(Hf=!0,RS(e.structuredContent))}catch(e){document.getElementById("ordinals-grid").innerHTML=`<div class="error-box" style="grid-column:1/-1">${de(String(e))}</div>`}}function RS(e){const t=e.listings,i=e.total;document.getElementById("ordinals-count").textContent=i!=null?String(i):t?.length?String(t.length):"0";const r=document.getElementById("ordinals-grid");if(!t||t.length===0){r.innerHTML='<div class="empty-state" style="grid-column:1/-1">No inscriptions found</div>';return}r.innerHTML=t.slice(0,12).map(Ya).join("");const n=document.getElementById("ordinals-search-input");n&&n.addEventListener("keydown",async o=>{if(o.key!=="Enter")return;const a=n.value.trim();if(a){r.innerHTML='<div class="empty-state" style="grid-column:1/-1">searching...</div>';try{const s=await Ae.callServerTool({name:"app_ordinals_data",arguments:{query:a}});if(s?.structuredContent){const u=s.structuredContent,l=u.results??u.listings,c=u.total;document.getElementById("ordinals-count").textContent=c!=null?String(c):String(l?.length??0),l&&l.length>0?r.innerHTML=l.slice(0,12).map(Ya).join(""):r.innerHTML='<div class="empty-state" style="grid-column:1/-1">No results found</div>'}}catch(s){r.innerHTML=`<div class="error-box" style="grid-column:1/-1">${de(String(s))}</div>`}}})}function Ya(e){const t=e.origin,r=e.data?.list,n=t?.data,a=n?.insc?.file,s=String(e.outpoint??t?.outpoint??""),u=s.split("_")[0]??s,l=String(a?.type??""),c=l.startsWith("image/"),m=r?.price,p=String(n?.name??Ii(s,8)),g=m!=null;return`
995
- <div class="ordinal-card" title="${de(s)}">
1272
+ ${l}
1273
+ `}async function Wx(){F("ordinals-grid").innerHTML='<div class="empty-state" style="grid-column:1/-1">loading...</div>';try{const r=await We.callServerTool({name:"app_ordinals_data",arguments:{}});r?.structuredContent&&(Mm=!0,Xx(r.structuredContent))}catch(r){F("ordinals-grid").innerHTML=`<div class="error-box" style="grid-column:1/-1">${fe(String(r))}</div>`}}function Xx(r){const e=r.listings,n=r.total;F("ordinals-count").textContent=n!=null?String(n):e?.length?String(e.length):"0";const i=F("ordinals-grid");if(!e||e.length===0){i.innerHTML='<div class="empty-state" style="grid-column:1/-1">No inscriptions found</div>';return}i.innerHTML=e.slice(0,12).map(bl).join("");const t=document.getElementById("ordinals-search-input");t&&t.addEventListener("keydown",async o=>{if(o.key!=="Enter")return;const s=t.value.trim();if(s){i.innerHTML='<div class="empty-state" style="grid-column:1/-1">searching...</div>';try{const a=await We.callServerTool({name:"app_ordinals_data",arguments:{query:s}});if(a?.structuredContent){const c=a.structuredContent,u=c.results??c.listings,l=c.total;F("ordinals-count").textContent=l!=null?String(l):String(u?.length??0),u&&u.length>0?i.innerHTML=u.slice(0,12).map(bl).join(""):i.innerHTML='<div class="empty-state" style="grid-column:1/-1">No results found</div>'}}catch(a){i.innerHTML=`<div class="error-box" style="grid-column:1/-1">${fe(String(a))}</div>`}}})}function Bm(r){return/^[0-9a-f]{64}$/i.test(r)?new Xe(r,16):Xe.fromWif(r)}let Tt="",wt="",pt=null;const ze=new Set;let pi=[];function Be(r){const e=["input","scanning","review","preparing","signing","broadcasting","complete","error"];for(const n of e){const i=document.getElementById(`sweep-${n}-state`);i&&(i.style.display=n===r?"flex":"none")}}function Yx(){jm=!0;const r=document.getElementById("wif-input"),e=F("sweep-scan-btn"),n=F("sweep-back-btn"),i=F("sweep-execute-btn"),t=F("sweep-again-btn"),o=F("sweep-retry-btn");e.addEventListener("click",async()=>{const s=r.value.trim();if(s){try{const a=Bm(s);Tt=s,wt=a.toPublicKey().toAddress()}catch{Be("error"),F("sweep-error-msg").textContent="Invalid private key. Accepts WIF (5.../K.../L...) or 64-char hex.";return}Be("scanning"),F("sweep-scanning-text").textContent=`Scanning ${Ht(wt,8)}...`;try{const a=await We.callServerTool({name:"app_sweep_scan",arguments:{address:wt}});if(a?.structuredContent){const c=a.structuredContent;if(c.error)throw new Error(String(c.error));pt=c,Qx(c),Be("review")}}catch(a){Be("error"),F("sweep-error-msg").textContent=`Scan failed: ${a instanceof Error?a.message:String(a)}`}}}),r.addEventListener("keydown",s=>{s.key==="Enter"&&e.click()}),n.addEventListener("click",()=>{Tt="",wt="",pt=null,ze.clear(),document.getElementById("wif-input").value="",Be("input")}),i.addEventListener("click",()=>e6()),t.addEventListener("click",()=>{Tt="",wt="",pt=null,ze.clear(),pi=[],document.getElementById("wif-input").value="",Be("input")}),o.addEventListener("click",()=>{Tt="",wt="",pt=null,ze.clear(),document.getElementById("wif-input").value="",Be("input")})}function Qx(r){F("sweep-address-display").textContent=wt;const e=r.funding,n=r.ordinals,i=r.bsv21Tokens,t=r.totalFundingSats,o=F("sweep-categories"),s=[];if(ze.clear(),e&&e.length>0){ze.add("bsv");const a=((t??0)/1e8).toFixed(8);s.push(Ro("bsv","BSV Funding",`${e.length} UTXOs`,`${a} BSV`))}if(n&&n.length>0&&(ze.add("ordinals"),s.push(Ro("ordinals","Ordinals",`${n.length} inscription${n.length!==1?"s":""}`,`${n.length} NFTs`))),i&&i.length>0)for(const a of i){const c=a.tokenId,u=a.symbol||Ht(c,6),l=a.totalAmount,f=a.decimals||0,d=a.inputs,h=`bsv21:${c}`;ze.add(h);const p=f>0?(Number(BigInt(l))/10**f).toFixed(f):l;s.push(Ro(h,`${u} Token`,`${d.length} UTXO${d.length!==1?"s":""}`,`${p} ${u}`))}if(s.length===0){o.innerHTML='<div class="empty-state">No assets found at this address.</div>',document.getElementById("sweep-execute-btn")?.setAttribute("disabled","");return}o.innerHTML=s.join(""),document.getElementById("sweep-execute-btn")?.removeAttribute("disabled");for(const a of o.querySelectorAll(".sweep-category"))a.addEventListener("click",()=>{const c=a.dataset.sweepType;if(!c)return;ze.has(c)?(ze.delete(c),a.classList.remove("selected")):(ze.add(c),a.classList.add("selected")),ze.size>0?document.getElementById("sweep-execute-btn")?.removeAttribute("disabled"):document.getElementById("sweep-execute-btn")?.setAttribute("disabled","")})}function Ro(r,e,n,i){return`
1274
+ <div class="sweep-category selected" data-sweep-type="${fe(r)}">
1275
+ <div class="sweep-category-check">
1276
+ <svg viewBox="0 0 24 24"><polyline points="20 6 9 17 4 12"/></svg>
1277
+ </div>
1278
+ <div class="sweep-category-info">
1279
+ <div class="sweep-category-name">${fe(e)}</div>
1280
+ <div class="sweep-category-detail">${fe(n)}</div>
1281
+ </div>
1282
+ <div class="sweep-category-value">${fe(i)}</div>
1283
+ </div>
1284
+ `}async function e6(){if(!pt||ze.size===0)return;pi=[];const r=[...ze];Be("preparing");try{for(const e of r){let n,i;if(e==="bsv")n="bsv",i=pt.funding;else if(e==="ordinals")n="ordinals",i=pt.ordinals;else if(e.startsWith("bsv21:")){n="bsv21";const w=e.slice(6),$=pt.bsv21Tokens.find(k=>k.tokenId===w);if(!$)throw new Error(`Token ${w} not found in scan data`);i=$.inputs}else continue;F("sweep-preparing-text").textContent=`Building ${n} transaction...`;const t=await We.callServerTool({name:"app_sweep_prepare",arguments:{sweepType:n,inputs:i.map(w=>({outpoint:w.outpoint,satoshis:w.satoshis,lockingScript:w.lockingScript}))}});if(!t?.structuredContent)throw new Error("No response from prepare");const o=t.structuredContent;if(o.error)throw new Error(String(o.error));const s=o.txHex,a=o.reference,c=o.inputsToSign;Be("signing");const u=Bm(Tt),l=ee(s,"hex"),f=de.fromBEEF(l),d=new Set(c.map(w=>{const[O,$]=w.outpoint.split("_");return`${O}.${Number($)}`}));for(let w=0;w<f.inputs.length;w++){const O=f.inputs[w],$=`${O.sourceTXID}.${O.sourceOutputIndex}`;if(d.has($)){const k=new Xl;O.unlockingScriptTemplate=k.unlock(u,"all",!0)}}await f.sign();const h={};for(let w=0;w<f.inputs.length;w++){const O=f.inputs[w],$=`${O.sourceTXID}.${O.sourceOutputIndex}`;d.has($)&&(h[String(w)]={unlockingScript:O.unlockingScript?.toHex()??""})}Be("broadcasting");const p=await We.callServerTool({name:"app_sweep_complete",arguments:{reference:a,spends:h}});if(!p?.structuredContent)throw new Error("No response from complete");const _=p.structuredContent;if(_.error)throw new Error(String(_.error));pi.push({type:n==="bsv21"?"BSV-21 Token":n==="ordinals"?"Ordinals":"BSV",txid:String(_.txid)})}Tt="",t6(),Be("complete")}catch(e){Tt="",Be("error"),F("sweep-error-msg").textContent=e instanceof Error?e.message:String(e)}}function t6(){const r=F("sweep-results");r.innerHTML=pi.map(e=>`
1285
+ <div class="sweep-result-item">
1286
+ <span class="sweep-result-label">${fe(e.type)}</span>
1287
+ <span class="sweep-result-txid">${fe(Ht(e.txid,10))}</span>
1288
+ </div>
1289
+ `).join("")}function bl(r){const e=r.origin,i=r.data?.list,t=e?.data,s=t?.insc?.file,a=String(r.outpoint??e?.outpoint??""),c=a.split("_")[0]??a,u=String(s?.type??""),l=u.startsWith("image/"),f=i?.price,d=String(t?.name??Ht(a,8)),h=f!=null;return`
1290
+ <div class="ordinal-card" title="${fe(a)}">
996
1291
  <div class="ordinal-preview">
997
- ${c?`<img src="https://ordfs.network/${de(u)}" alt="inscription" loading="lazy" />`:`<span class="ordinal-placeholder">${l?de(l.split("/")[1]??l):"?"}</span>`}
998
- ${g?'<div class="listed-badge">Listed</div>':""}
1292
+ ${l?`<img src="https://ordfs.network/${fe(c)}" alt="inscription" loading="lazy" />`:`<span class="ordinal-placeholder">${u?fe(u.split("/")[1]??u):"?"}</span>`}
1293
+ ${h?'<div class="listed-badge">Listed</div>':""}
999
1294
  </div>
1000
1295
  <div class="ordinal-info">
1001
- <div class="ordinal-name">${de(p)}</div>
1296
+ <div class="ordinal-name">${fe(d)}</div>
1002
1297
  <div class="ordinal-meta-row">
1003
- <span class="ordinal-type">${l?de(l.split("/")[0]??""):"unknown"}</span>
1004
- ${m!=null?`<span class="ordinal-price">${m.toLocaleString()} sats</span>`:""}
1298
+ <span class="ordinal-type">${u?fe(u.split("/")[0]??""):"unknown"}</span>
1299
+ ${f!=null?`<span class="ordinal-price">${f.toLocaleString()} sats</span>`:""}
1005
1300
  </div>
1006
1301
  </div>
1007
1302
  </div>
@@ -1021,9 +1316,10 @@ container holding the app. Specify either width or maxWidth, and either height o
1021
1316
  <!-- Tab bar -->
1022
1317
  <div id="tab-bar">
1023
1318
  <div class="segmented-control" role="tablist">
1024
- <button class="view-tab active" data-view="explorer" role="tab" aria-selected="true">Explorer</button>
1025
- <button class="view-tab" data-view="wallet" role="tab" aria-selected="false">Wallet</button>
1026
- <button class="view-tab" data-view="ordinals" role="tab" aria-selected="false">Ordinals</button>
1319
+ <button type="button" class="view-tab active" data-view="explorer" role="tab" aria-selected="true">Explorer</button>
1320
+ <button type="button" class="view-tab" data-view="wallet" role="tab" aria-selected="false">Wallet</button>
1321
+ <button type="button" class="view-tab" data-view="ordinals" role="tab" aria-selected="false">Ordinals</button>
1322
+ <button type="button" class="view-tab" data-view="sweep" role="tab" aria-selected="false">Sweep</button>
1027
1323
  </div>
1028
1324
  </div>
1029
1325
 
@@ -1031,9 +1327,9 @@ container holding the app. Specify either width or maxWidth, and either height o
1031
1327
  <div id="explorer-panel" class="panel active">
1032
1328
  <!-- Search bar -->
1033
1329
  <div class="explorer-search">
1034
- <svg viewBox="0 0 24 24"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
1330
+ <svg viewBox="0 0 24 24"><title>Search</title><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
1035
1331
  <input type="text" id="search-input" placeholder="Search transactions, blocks, addresses..." />
1036
- <button class="search-btn" id="search-btn">SEARCH</button>
1332
+ <button type="button" class="search-btn" id="search-btn">SEARCH</button>
1037
1333
  </div>
1038
1334
  <!-- Dynamic content fills here -->
1039
1335
  <div class="explorer-content" id="explorer-content">
@@ -1061,8 +1357,8 @@ container holding the app. Specify either width or maxWidth, and either height o
1061
1357
  <div class="section-label">Receive Address</div>
1062
1358
  <div class="address-row">
1063
1359
  <span class="address-text" id="address-display"></span>
1064
- <button class="copy-btn" id="copy-address-btn" title="Copy address">
1065
- <svg viewBox="0 0 24 24"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>
1360
+ <button type="button" class="copy-btn" id="copy-address-btn" title="Copy address">
1361
+ <svg viewBox="0 0 24 24"><title>Copy</title><rect x="9" y="9" width="13" height="13" rx="2" ry="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>
1066
1362
  </button>
1067
1363
  </div>
1068
1364
  </div>
@@ -1083,13 +1379,13 @@ container holding the app. Specify either width or maxWidth, and either height o
1083
1379
  <span class="ordinals-title">My Collection</span>
1084
1380
  <span class="count-badge" id="ordinals-count">—</span>
1085
1381
  </div>
1086
- <button class="mint-btn" id="mint-btn">
1087
- <svg viewBox="0 0 24 24"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>
1382
+ <button type="button" class="mint-btn" id="mint-btn">
1383
+ <svg viewBox="0 0 24 24"><title>Mint</title><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>
1088
1384
  Mint New
1089
1385
  </button>
1090
1386
  </div>
1091
1387
  <div class="ordinals-search">
1092
- <svg viewBox="0 0 24 24"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
1388
+ <svg viewBox="0 0 24 24"><title>Search</title><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
1093
1389
  <input type="text" id="ordinals-search-input" placeholder="Search inscriptions..." />
1094
1390
  </div>
1095
1391
  <div class="ordinals-grid" id="ordinals-grid">
@@ -1097,6 +1393,87 @@ container holding the app. Specify either width or maxWidth, and either height o
1097
1393
  </div>
1098
1394
  </div>
1099
1395
 
1396
+ <!-- Sweep panel -->
1397
+ <div id="sweep-panel" class="panel">
1398
+ <div class="sweep-content" id="sweep-content">
1399
+ <!-- input state -->
1400
+ <div class="sweep-state" id="sweep-input-state">
1401
+ <div class="sweep-header">
1402
+ <div class="sweep-title">Import Funds</div>
1403
+ <div class="sweep-subtitle">Paste a WIF private key to scan for assets and sweep them into your wallet.</div>
1404
+ </div>
1405
+ <div class="sweep-input-group">
1406
+ <label class="section-label" for="wif-input">Private Key</label>
1407
+ <div class="sweep-input-row">
1408
+ <input type="password" id="wif-input" class="sweep-text-input" placeholder="WIF (5.../K.../L...) or 64-char hex" autocomplete="off" spellcheck="false" />
1409
+ <button type="button" class="sweep-scan-btn" id="sweep-scan-btn">Scan</button>
1410
+ </div>
1411
+ <div class="sweep-hint">Your key never leaves this browser tab.</div>
1412
+ </div>
1413
+ </div>
1414
+ <!-- scanning state -->
1415
+ <div class="sweep-state" id="sweep-scanning-state" style="display:none">
1416
+ <div class="sweep-progress">
1417
+ <div class="spinner"></div>
1418
+ <div class="sweep-progress-text" id="sweep-scanning-text">Scanning address...</div>
1419
+ </div>
1420
+ </div>
1421
+ <!-- review state -->
1422
+ <div class="sweep-state" id="sweep-review-state" style="display:none">
1423
+ <div class="sweep-header">
1424
+ <div class="sweep-title">Assets Found</div>
1425
+ <div class="sweep-address-display" id="sweep-address-display"></div>
1426
+ </div>
1427
+ <div class="sweep-categories" id="sweep-categories"></div>
1428
+ <div class="sweep-actions">
1429
+ <button type="button" class="sweep-back-btn" id="sweep-back-btn">Back</button>
1430
+ <button type="button" class="sweep-execute-btn" id="sweep-execute-btn">Sweep Selected</button>
1431
+ </div>
1432
+ </div>
1433
+ <!-- preparing state -->
1434
+ <div class="sweep-state" id="sweep-preparing-state" style="display:none">
1435
+ <div class="sweep-progress">
1436
+ <div class="spinner"></div>
1437
+ <div class="sweep-progress-text" id="sweep-preparing-text">Building transactions...</div>
1438
+ </div>
1439
+ </div>
1440
+ <!-- signing state -->
1441
+ <div class="sweep-state" id="sweep-signing-state" style="display:none">
1442
+ <div class="sweep-progress">
1443
+ <div class="spinner"></div>
1444
+ <div class="sweep-progress-text">Signing transactions...</div>
1445
+ </div>
1446
+ </div>
1447
+ <!-- broadcasting state -->
1448
+ <div class="sweep-state" id="sweep-broadcasting-state" style="display:none">
1449
+ <div class="sweep-progress">
1450
+ <div class="spinner"></div>
1451
+ <div class="sweep-progress-text">Broadcasting...</div>
1452
+ </div>
1453
+ </div>
1454
+ <!-- complete state -->
1455
+ <div class="sweep-state" id="sweep-complete-state" style="display:none">
1456
+ <div class="sweep-header">
1457
+ <div class="sweep-title sweep-success">Sweep Complete</div>
1458
+ </div>
1459
+ <div class="sweep-results" id="sweep-results"></div>
1460
+ <div class="sweep-actions">
1461
+ <button type="button" class="sweep-scan-btn" id="sweep-again-btn">Sweep Again</button>
1462
+ </div>
1463
+ </div>
1464
+ <!-- error state -->
1465
+ <div class="sweep-state" id="sweep-error-state" style="display:none">
1466
+ <div class="sweep-header">
1467
+ <div class="sweep-title sweep-error-title">Error</div>
1468
+ </div>
1469
+ <div class="error-box" id="sweep-error-msg"></div>
1470
+ <div class="sweep-actions">
1471
+ <button type="button" class="sweep-back-btn" id="sweep-retry-btn">Try Again</button>
1472
+ </div>
1473
+ </div>
1474
+ </div>
1475
+ </div>
1476
+
1100
1477
  </div>
1101
1478
 
1102
1479
  </body>