@zktx.io/sui-mcp 0.5.0 → 0.6.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 (87) hide show
  1. package/README.md +6 -6
  2. package/dist/adapters/deepbook/deepbookTransactionMaterialProducer.js +3 -3
  3. package/dist/core/activity/localDataService.js +71 -52
  4. package/dist/core/activity/localDataValidation.js +1 -3
  5. package/dist/core/activity/sqliteActivityStore.js +24 -16
  6. package/dist/core/activity/sqliteActivityStoreSchema.js +83 -12
  7. package/dist/core/preferences/sqlitePreferencesRepository.js +5 -3
  8. package/dist/core/session/cardSession.js +1 -1
  9. package/dist/core/session/cardSessionStore.js +53 -3
  10. package/dist/core/session/sessionStore.js +0 -17
  11. package/dist/core/session/settingsFileIdentity.js +11 -0
  12. package/dist/core/session/settingsFileProtocol.js +25 -0
  13. package/dist/core/session/settingsFileStore.js +346 -0
  14. package/dist/core/session/settingsInputError.js +34 -0
  15. package/dist/core/session/settingsOperation.js +224 -0
  16. package/dist/core/session/settingsPreparationSql.js +15 -0
  17. package/dist/core/session/settingsWorkflow.js +1219 -0
  18. package/dist/core/session/sqliteSessionStore.js +0 -40
  19. package/dist/core/session/sqliteSettingsWorkflowStore.js +463 -0
  20. package/dist/core/session/sqliteWalletWorkflowStore.js +164 -41
  21. package/dist/core/session/status.js +2 -2
  22. package/dist/core/session/walletConnection.js +27 -8
  23. package/dist/core/session/walletWorkflow.js +73 -15
  24. package/dist/core/session/workflowState.js +16 -8
  25. package/dist/core/session/workflowView.js +18 -2
  26. package/dist/mcp/responseGuidance.js +10 -5
  27. package/dist/mcp/serverInfo.js +3 -4
  28. package/dist/mcp/toolNames.js +2 -2
  29. package/dist/mcp/tools/account/index.js +1 -19
  30. package/dist/mcp/tools/read/readToolHelpers.js +5 -4
  31. package/dist/mcp/tools/session/executionResultTools.js +2 -2
  32. package/dist/mcp/tools/session/shared.js +1 -0
  33. package/dist/mcp/tools/session/statusTools.js +4 -3
  34. package/dist/mcp/tools/settings/index.js +8 -28
  35. package/dist/mcp-app/account.html +14 -14
  36. package/dist/mcp-app/account.notices.txt +1 -1
  37. package/dist/mcp-app/chart.html +9 -9
  38. package/dist/mcp-app/chart.notices.txt +1 -1
  39. package/dist/mcp-app/connect.html +14 -14
  40. package/dist/mcp-app/connect.notices.txt +1 -1
  41. package/dist/mcp-app/receipt.html +1298 -1463
  42. package/dist/mcp-app/receipt.notices.txt +226 -1204
  43. package/dist/mcp-app/review.html +1298 -1463
  44. package/dist/mcp-app/review.notices.txt +226 -1204
  45. package/dist/mcp-app/settings.html +3133 -0
  46. package/dist/mcp-app/settings.notices.txt +973 -0
  47. package/dist/mcp-ui/contracts.js +8 -2
  48. package/dist/mcp-ui/readCards.js +1 -1
  49. package/dist/mcp-ui/tools.js +33 -2
  50. package/dist/review-server/server.js +5 -51
  51. package/dist/runtime/application.js +41 -14
  52. package/dist/runtime/localSettingsService.js +26 -2
  53. package/dist/runtime/shared/authenticatedFetch.js +6 -2
  54. package/dist/runtime/shared/control.js +5 -6
  55. package/dist/runtime/shared/http.js +14 -0
  56. package/dist/runtime/shared/mcpHttp.js +9 -4
  57. package/dist/runtime/shared/server.js +1 -1
  58. package/dist/runtime/smokeMainnetRead.js +0 -1
  59. package/dist/runtime/walletConnectStorage.js +2 -4
  60. package/dist/runtime/walletSdkChildRuntime.js +2 -1
  61. package/dist/runtime/walletSdkIpc.js +2 -1
  62. package/dist/runtime/walletSdkProcess.js +3 -2
  63. package/docs/AGENT_BEHAVIOR.md +44 -10
  64. package/docs/AGENT_DEVELOPMENT_POLICY.md +16 -12
  65. package/docs/FRONTEND_POLICY.md +105 -28
  66. package/docs/LOCAL_DB_ARCHITECTURE.md +143 -20
  67. package/docs/MCP_SETUP.md +99 -39
  68. package/docs/MCP_TOOLS.md +273 -24
  69. package/docs/SDK_API.md +51 -10
  70. package/docs/UTILITY_INDEX.md +9 -6
  71. package/docs/WALLET_CONNECTION.md +30 -9
  72. package/package.json +13 -7
  73. package/dist/core/activity/schemaVersion.js +0 -2
  74. package/dist/core/session/keyedRecordStore.js +0 -18
  75. package/dist/core/session/settingsSession.js +0 -1
  76. package/dist/core/session/settingsSessions.js +0 -45
  77. package/dist/review-app/brand-dark.svg +0 -1
  78. package/dist/review-app/brand-light.svg +0 -1
  79. package/dist/review-app/favicon.svg +0 -1
  80. package/dist/review-app/settings.css +0 -1
  81. package/dist/review-app/settings.js +0 -1
  82. package/dist/review-app/ui.css +0 -809
  83. package/dist/review-server/assets.js +0 -48
  84. package/dist/review-server/html.js +0 -45
  85. package/dist/review-server/http.js +0 -47
  86. package/dist/review-server/middleware/reviewToken.js +0 -7
  87. package/dist/review-server/settingsApi.js +0 -158
@@ -1,4 +1,4 @@
1
- <!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Sui MCP</title><style>:root[data-theme=light]{--ui-bg:#f6f8fa;--ui-surface:#fff;--ui-surface-2:#eef1f5;--ui-border:#e3e8ef;--ui-border-strong:#cdd5e0;--ui-text:#18202b;--ui-text-muted:#5b6675;--ui-accent:#1565c0;--ui-accent-hover:#0d47a1;--ui-on-accent:#fff;--ui-focus:#1565c040;--ui-ok-bg:#e2f3e9;--ui-ok-text:#1b6b43;--ui-warn-bg:#fbeeda;--ui-warn-text:#8a5a08;--ui-danger:#b3261e;--ui-danger-bg:#fbe9e7;--ui-up:#1b7f43;--ui-down:#b3261e}:root[data-theme=dark]{--ui-bg:#0e141b;--ui-surface:#161d26;--ui-surface-2:#1e2733;--ui-border:#28323f;--ui-border-strong:#3a4859;--ui-text:#e7edf4;--ui-text-muted:#9aa7b6;--ui-accent:#4da2ff;--ui-accent-hover:#6fb8ff;--ui-on-accent:#06243f;--ui-focus:#4da2ff52;--ui-ok-bg:#10362a;--ui-ok-text:#7fe0b0;--ui-warn-bg:#3a2e16;--ui-warn-text:#f0c97a;--ui-danger:#ff8a80;--ui-danger-bg:#3a1f1d;--ui-up:#46c79e;--ui-down:#ff8a80}:root{--ui-r:10px;--ui-font-sans:ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;--ui-font-mono:ui-monospace, SFMono-Regular, Menlo, monospace}*,:before,:after{box-sizing:border-box}body{background:var(--ui-bg);color:var(--ui-text);font-family:var(--ui-font-sans);-webkit-font-smoothing:antialiased;margin:0;font-weight:400}.ui-mono{font-family:var(--ui-font-mono);overflow-wrap:anywhere;font-size:12.5px}.ui-shell{min-height:100vh;position:relative}.ui-header{background:var(--ui-surface);border-bottom:.5px solid var(--ui-border);align-items:center;gap:12px;padding:12px 20px;display:flex}.ui-brand{color:var(--ui-text);white-space:nowrap;align-items:center;gap:8px;font-size:15px;font-weight:500;text-decoration:none;display:inline-flex}.ui-brand img{width:24px;height:24px;display:block}:root[data-theme=light] .ui-brand-dark,:root[data-theme=dark] .ui-brand-light{display:none}.ui-header-spacer{margin-left:auto}.ui-main{max-width:920px;margin:0 auto;padding:22px 20px 48px}.ui-btn{border:.5px solid var(--ui-border-strong);border-radius:var(--ui-r);background:var(--ui-surface);min-height:38px;color:var(--ui-text);font:inherit;cursor:pointer;justify-content:center;align-items:center;gap:7px;padding:0 16px;font-size:14px;font-weight:500;transition:background .12s,border-color .12s,transform 60ms;display:inline-flex}.ui-btn:hover{background:var(--ui-surface-2);border-color:var(--ui-accent)}.ui-btn:active{transform:scale(.975)}.ui-btn:focus-visible{box-shadow:0 0 0 3px var(--ui-focus);outline:none}.ui-btn--primary{background:var(--ui-accent);border-color:var(--ui-accent);color:var(--ui-on-accent)}.ui-btn--primary:hover{background:var(--ui-accent-hover);border-color:var(--ui-accent-hover)}.ui-btn--danger{border-color:var(--ui-danger);color:var(--ui-danger)}.ui-btn--danger:hover{background:var(--ui-danger-bg)}.ui-btn:disabled{cursor:not-allowed;color:var(--ui-text-muted);background:var(--ui-surface-2);border-color:var(--ui-border)}.ui-btn-row{flex-wrap:wrap;gap:10px;margin-top:12px;display:flex}.ui-btn-row>.ui-btn{flex:1 1 0;min-width:12rem}.ui-btn-row--end{justify-content:flex-end}.ui-btn-row--end>.ui-btn{flex:none;min-width:0}.ui-icon-btn{border:.5px solid var(--ui-border-strong);background:var(--ui-surface);width:34px;height:34px;color:var(--ui-text);cursor:pointer;border-radius:9px;flex:none;justify-content:center;align-items:center;padding:0;transition:background .12s,border-color .12s,transform 60ms;display:inline-flex}.ui-icon-btn:hover{background:var(--ui-surface-2);border-color:var(--ui-accent)}.ui-icon-btn:active{transform:scale(.94)}.ui-icon-btn:focus-visible{box-shadow:0 0 0 3px var(--ui-focus);outline:none}.ui-icon-btn svg{width:18px;height:18px}.ui-link{color:var(--ui-accent);cursor:pointer;text-decoration:none}.ui-link:hover{color:var(--ui-accent-hover);text-decoration:underline}.ui-field{color:var(--ui-text-muted);flex-direction:column;gap:5px;font-size:12px;display:flex}.ui-input,input.ui-input{border:.5px solid var(--ui-border-strong);border-radius:var(--ui-r);background:var(--ui-surface);height:38px;color:var(--ui-text);font:inherit;outline:none;padding:0 12px;font-size:14px;transition:border-color .12s,box-shadow .12s}.ui-input{width:100%}.ui-input::placeholder{color:var(--ui-text-muted)}.ui-select{border:.5px solid var(--ui-border-strong);border-radius:var(--ui-r);background:var(--ui-surface);width:100%;height:38px;color:var(--ui-text);font:inherit;cursor:pointer;outline:none;padding:0 12px;font-size:14px;transition:border-color .12s,box-shadow .12s}.ui-select:focus,.ui-input:focus{border-color:var(--ui-accent);box-shadow:0 0 0 3px var(--ui-focus)}.ui-card{background:var(--ui-surface);border:.5px solid var(--ui-border);padding:var(--ui-card-padding-block,16px) var(--ui-card-padding-inline,18px);border-radius:12px;margin:0 0 14px}.ui-section{min-width:0;margin-block:0 16px}.ui-section-title{justify-content:space-between;align-items:center;gap:10px;margin:0 0 10px;font-size:14px;font-weight:500;display:flex}.ui-card-title{margin:0 0 10px;font-size:14px;font-weight:500}.ui-card-head{margin:calc(-1 * var(--ui-card-padding-block,16px)) calc(-1 * var(--ui-card-padding-inline,18px)) 14px;padding:9px var(--ui-card-padding-inline,18px);background:var(--ui-surface-2);border-bottom:.5px solid var(--ui-border);border-radius:12px 12px 0 0;justify-content:space-between;align-items:center;gap:10px;font-size:14px;font-weight:500;display:flex}.ui-card-head+.ui-detail-item,.ui-card-head+.ui-row{border-top:0}.ui-row{border-top:.5px solid var(--ui-border);grid-template-columns:minmax(140px,.34fr) minmax(0,1fr);gap:12px;padding:9px 0;font-size:14px;display:grid}.ui-row:first-child{border-top:0}.ui-row-label{color:var(--ui-text-muted)}.ui-row-value{color:var(--ui-text);overflow-wrap:anywhere;font-variant-numeric:tabular-nums;text-align:right}.ui-status-banner{border-radius:var(--ui-r);border:.5px solid var(--ui-border-strong);background:var(--ui-surface-2);color:var(--ui-text);align-items:center;gap:9px;padding:11px 0;font-size:14px;font-weight:500;display:flex}.ui-status-icon{flex:none;display:inline-flex}.ui-status-icon svg{width:18px;height:18px}.ui-status-banner--success{background:var(--ui-ok-bg);color:var(--ui-ok-text);border-color:#0000}.ui-status-banner--failure{background:var(--ui-danger-bg);color:var(--ui-danger);border-color:#0000}.ui-status-banner--pending{color:var(--ui-text-muted)}.ui-detail-item{border-top:.5px solid var(--ui-border);padding:9px 0}.ui-detail-head{flex-wrap:wrap;justify-content:space-between;align-items:baseline;gap:12px;display:flex}.ui-detail-title{color:var(--ui-text);overflow-wrap:anywhere;font-weight:500}.ui-detail-trailing{color:var(--ui-text);overflow-wrap:anywhere}.ui-detail-trailing--up{color:var(--ui-up)}.ui-detail-trailing--down{color:var(--ui-down)}.ui-detail-meta{color:var(--ui-text-muted);overflow-wrap:anywhere;gap:8px;margin-top:3px;font-size:12.5px;display:flex}.ui-detail-metalabel{color:var(--ui-text-muted);flex:none}.ui-feedback{border:.5px solid var(--ui-border);background:var(--ui-surface);color:var(--ui-text);border-left-width:3px;border-radius:8px;margin:0 0 14px;padding:11px 13px;font-size:13.5px}.ui-feedback--ok{border-left-color:var(--ui-ok-text)}.ui-feedback--error{border-left-color:var(--ui-danger)}.ui-card>.ui-feedback{margin:14px 0}.ui-card>.ui-feedback:last-child{margin-bottom:0}.ui-feedback-detail{color:var(--ui-text-muted);overflow-wrap:anywhere;margin-top:4px;font-size:12.5px;display:block}.ui-placeholder{border:.5px dashed var(--ui-border-strong);color:var(--ui-text-muted);text-align:center;border-radius:12px;margin:0 0 14px;padding:18px;font-size:13.5px}.ui-overlay{background:color-mix(in srgb, var(--ui-bg) 70%, transparent);z-index:50;justify-content:center;align-items:center;display:none;position:fixed;inset:0}.ui-shell[aria-busy=true] .ui-overlay{display:flex}.ui-shell[aria-busy=true] .ui-header,.ui-shell[aria-busy=true] .ui-main{filter:opacity(.55);pointer-events:none}.ui-overlay-box{background:var(--ui-surface);border:.5px solid var(--ui-border-strong);border-radius:14px;flex-direction:column;align-items:center;gap:11px;padding:20px 26px;display:flex}.ui-spinner{border:3px solid var(--ui-border-strong);border-top-color:var(--ui-accent);border-radius:50%;width:30px;height:30px;animation:.8s linear infinite ui-spin}.ui-overlay-label{font-size:14px;font-weight:500}@keyframes ui-spin{to{transform:rotate(360deg)}}.ui-note{color:var(--ui-text-muted);margin:12px 0 0;font-size:12.5px;line-height:1.6}.ui-info{border:.5px solid var(--ui-border-strong);width:1.3em;height:1.3em;color:var(--ui-text-muted);cursor:help;vertical-align:middle;border-radius:50%;justify-content:center;align-items:center;margin-left:.3em;font-size:.72em;font-style:normal;font-weight:500;line-height:1;display:inline-flex}.ui-info:hover,.ui-info:focus-visible{border-color:var(--ui-accent);color:var(--ui-accent);outline:none}.ui-ptb-graph{min-height:60px;color:var(--ui-text-muted);font-size:13px;overflow-x:auto}.ui-ptb-graph svg{max-width:100%;height:auto}.ui-ptb-graph--error{color:var(--ui-danger)}.ui-chain-receipt-gas{margin-bottom:6px}.ui-chain-receipt-ptb{background:var(--ui-surface);min-width:0;overflow:hidden}.ui-ptb-actions{align-items:center;gap:4px;display:flex}.ui-ptb-graph-controls .ui-icon-btn{background:var(--ui-surface-2);box-shadow:0 1px 3px #0003}.ui-ptb-graph--interactive{cursor:grab;-webkit-user-select:none;user-select:none;touch-action:none;height:420px;position:relative;overflow:hidden}.ui-ptb-graph--grabbing{cursor:grabbing}.ui-ptb-graph-content{transform-origin:0 0;width:100%}.ui-ptb-graph-controls{z-index:2;flex-direction:column;gap:5px;display:flex;position:absolute;top:8px;right:8px}.ui-ptb-graph-controls .ui-icon-btn{width:28px;height:28px}.ui-ptb-graph-controls .ui-icon-btn svg{width:15px;height:15px}.ui-accordion{border-block-start:1px solid var(--ui-border);margin-block:12px}.ui-accordion-summary{cursor:pointer;color:var(--ui-text);justify-content:space-between;align-items:center;gap:10px;padding:11px 0;font-size:13px;font-weight:500;list-style:none;display:flex}.ui-accordion-summary::-webkit-details-marker{display:none}.ui-accordion-summary:hover{color:var(--ui-accent)}.ui-accordion-summary:focus-visible{box-shadow:0 0 0 3px var(--ui-focus);border-radius:var(--ui-r);outline:none}.ui-accordion-summary:after{content:"";border-right:1.5px solid var(--ui-text-muted);border-bottom:1.5px solid var(--ui-text-muted);flex:none;width:7px;height:7px;transition:transform .15s;transform:rotate(45deg)}.ui-accordion[open] .ui-accordion-summary:after{transform:rotate(-135deg)}.ui-accordion[open] .ui-accordion-summary{color:var(--ui-accent)}.ui-accordion-body{padding:4px 0 12px}.ui-accordion[open]>.ui-accordion-body{animation:.18s ease-out ui-reveal}@keyframes ui-reveal{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion:reduce){.ui-accordion[open]>.ui-accordion-body{animation:none}}@container mcp-card (width<=28rem){.ui-card{--ui-card-padding-block:12px;--ui-card-padding-inline:12px}.ui-row{grid-template-columns:minmax(0,1fr);gap:4px}.ui-row-value{text-align:left}.ui-detail-meta{flex-wrap:wrap}}@container mcp-card (width>=0){.ui-card,.ui-card-head>:first-child,.ui-detail-head>*,.ui-detail-meta>*{min-width:0}.ui-ptb-actions{flex:none}.ui-ptb-graph--interactive{height:clamp(280px,75cqi,420px)}}.ui-error:not(:empty){color:var(--ui-danger)}.ui-note:empty,.ui-error:empty{display:none}.ui-form{flex-wrap:wrap;align-items:end;gap:12px;display:flex}.ui-form>*{min-width:0;max-width:100%}.ui-form>input,.ui-form>select,.ui-form>label{flex:14rem}.ui-form label{flex-direction:column;gap:6px;display:flex}.ui-form label>input,.ui-form label>select{width:100%}.ui-form>details,.ui-form>p,.ui-form>.card-actions{flex-basis:100%}@container mcp-card (width<=28rem){.ui-form>button{width:100%}}html,body{min-height:0;margin:0}body{color:var(--ui-text);background:var(--ui-bg)}#app{padding:var(--ui-space-4,16px);overflow-wrap:anywhere;min-width:0;max-width:100%;container:mcp-card/inline-size}#app h1{margin:0 0 12px;font-size:20px;font-weight:500}.card-actions{margin-top:12px}.card-actions,.card-actions>div{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.card-chart{width:100%;min-width:0;height:clamp(280px,75cqi,400px)}.card-progress-hint{color:var(--ui-text-muted);align-items:center;gap:10px;margin-block:12px;font-size:12px;display:flex}.card-progress-hint[hidden]{display:none}
1
+ <!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Sui MCP</title><style>:root[data-theme=light]{--ui-bg:#f6f8fa;--ui-surface:#fff;--ui-surface-2:#eef1f5;--ui-border:#e3e8ef;--ui-border-strong:#cdd5e0;--ui-text:#18202b;--ui-text-muted:#5b6675;--ui-accent:#1565c0;--ui-accent-hover:#0d47a1;--ui-on-accent:#fff;--ui-focus:#1565c040;--ui-ok-bg:#e2f3e9;--ui-ok-text:#1b6b43;--ui-warn-bg:#fbeeda;--ui-warn-text:#8a5a08;--ui-danger:#b3261e;--ui-danger-bg:#fbe9e7;--ui-up:#1b7f43;--ui-down:#b3261e}:root[data-theme=dark]{--ui-bg:#0e141b;--ui-surface:#161d26;--ui-surface-2:#1e2733;--ui-border:#28323f;--ui-border-strong:#3a4859;--ui-text:#e7edf4;--ui-text-muted:#9aa7b6;--ui-accent:#4da2ff;--ui-accent-hover:#6fb8ff;--ui-on-accent:#06243f;--ui-focus:#4da2ff52;--ui-ok-bg:#10362a;--ui-ok-text:#7fe0b0;--ui-warn-bg:#3a2e16;--ui-warn-text:#f0c97a;--ui-danger:#ff8a80;--ui-danger-bg:#3a1f1d;--ui-up:#46c79e;--ui-down:#ff8a80}:root{--ui-r:10px;--ui-font-sans:ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;--ui-font-mono:ui-monospace, SFMono-Regular, Menlo, monospace}*,:before,:after{box-sizing:border-box}body{background:var(--ui-bg);color:var(--ui-text);font-family:var(--ui-font-sans);-webkit-font-smoothing:antialiased;margin:0;font-weight:400}.ui-mono{font-family:var(--ui-font-mono);overflow-wrap:anywhere;font-size:12.5px}.ui-btn{border:.5px solid var(--ui-border-strong);border-radius:var(--ui-r);background:var(--ui-surface);min-height:38px;color:var(--ui-text);font:inherit;cursor:pointer;justify-content:center;align-items:center;gap:7px;padding:0 16px;font-size:14px;font-weight:500;transition:background .12s,border-color .12s,transform 60ms;display:inline-flex}.ui-btn:hover{background:var(--ui-surface-2);border-color:var(--ui-accent)}.ui-btn:active{transform:scale(.975)}.ui-btn:focus-visible{box-shadow:0 0 0 3px var(--ui-focus);outline:none}.ui-btn--primary{background:var(--ui-accent);border-color:var(--ui-accent);color:var(--ui-on-accent)}.ui-btn--primary:hover{background:var(--ui-accent-hover);border-color:var(--ui-accent-hover)}.ui-btn--danger{border-color:var(--ui-danger);color:var(--ui-danger)}.ui-btn--danger:hover{background:var(--ui-danger-bg)}.ui-btn:disabled{cursor:not-allowed;color:var(--ui-text-muted);background:var(--ui-surface-2);border-color:var(--ui-border)}.ui-btn-row{flex-wrap:wrap;gap:10px;margin-top:12px;display:flex}.ui-btn-row>.ui-btn{flex:1 1 0;min-width:12rem}.ui-btn-row--end{justify-content:flex-end}.ui-btn-row--end>.ui-btn{flex:none;min-width:0}.ui-icon-btn{border:.5px solid var(--ui-border-strong);background:var(--ui-surface);width:34px;height:34px;color:var(--ui-text);cursor:pointer;border-radius:9px;flex:none;justify-content:center;align-items:center;padding:0;transition:background .12s,border-color .12s,transform 60ms;display:inline-flex}.ui-icon-btn:hover{background:var(--ui-surface-2);border-color:var(--ui-accent)}.ui-icon-btn:active{transform:scale(.94)}.ui-icon-btn:focus-visible{box-shadow:0 0 0 3px var(--ui-focus);outline:none}.ui-icon-btn svg{width:18px;height:18px}.ui-link{color:var(--ui-accent);cursor:pointer;text-decoration:none}.ui-link:hover{color:var(--ui-accent-hover);text-decoration:underline}.ui-field{color:var(--ui-text-muted);flex-direction:column;gap:5px;font-size:12px;display:flex}.ui-input,input.ui-input{border:.5px solid var(--ui-border-strong);border-radius:var(--ui-r);background:var(--ui-surface);height:38px;color:var(--ui-text);font:inherit;outline:none;padding:0 12px;font-size:14px;transition:border-color .12s,box-shadow .12s}.ui-input{width:100%}.ui-input::placeholder{color:var(--ui-text-muted)}.ui-select{border:.5px solid var(--ui-border-strong);border-radius:var(--ui-r);background:var(--ui-surface);width:100%;height:38px;color:var(--ui-text);font:inherit;cursor:pointer;outline:none;padding:0 12px;font-size:14px;transition:border-color .12s,box-shadow .12s}.ui-select:focus,.ui-input:focus{border-color:var(--ui-accent);box-shadow:0 0 0 3px var(--ui-focus)}.ui-card{background:var(--ui-surface);border:.5px solid var(--ui-border);padding:var(--ui-card-padding-block,16px) var(--ui-card-padding-inline,18px);border-radius:12px;margin:0 0 14px}.ui-section{min-width:0;margin-block:0 16px}.ui-section-title{justify-content:space-between;align-items:center;gap:10px;margin:0 0 10px;font-size:14px;font-weight:500;display:flex}.ui-card-title{margin:0 0 10px;font-size:14px;font-weight:500}.ui-card-head{margin:calc(-1 * var(--ui-card-padding-block,16px)) calc(-1 * var(--ui-card-padding-inline,18px)) 14px;padding:9px var(--ui-card-padding-inline,18px);background:var(--ui-surface-2);border-bottom:.5px solid var(--ui-border);border-radius:12px 12px 0 0;justify-content:space-between;align-items:center;gap:10px;font-size:14px;font-weight:500;display:flex}.ui-card-head+.ui-detail-item,.ui-card-head+.ui-row{border-top:0}.ui-row{border-top:.5px solid var(--ui-border);grid-template-columns:minmax(140px,.34fr) minmax(0,1fr);gap:12px;padding:9px 0;font-size:14px;display:grid}.ui-row:first-child{border-top:0}.ui-row-label{color:var(--ui-text-muted)}.ui-row-value{color:var(--ui-text);overflow-wrap:anywhere;font-variant-numeric:tabular-nums;text-align:right}.ui-status-banner{border-radius:var(--ui-r);border:.5px solid var(--ui-border-strong);background:var(--ui-surface-2);color:var(--ui-text);align-items:center;gap:9px;padding:11px 0;font-size:14px;font-weight:500;display:flex}.ui-status-icon{flex:none;display:inline-flex}.ui-status-icon svg{width:18px;height:18px}.ui-status-banner--success{background:var(--ui-ok-bg);color:var(--ui-ok-text);border-color:#0000}.ui-status-banner--failure{background:var(--ui-danger-bg);color:var(--ui-danger);border-color:#0000}.ui-status-banner--pending{color:var(--ui-text-muted)}.ui-detail-item{border-top:.5px solid var(--ui-border);padding:9px 0}.ui-detail-head{flex-wrap:wrap;justify-content:space-between;align-items:baseline;gap:12px;display:flex}.ui-detail-title{color:var(--ui-text);overflow-wrap:anywhere;font-weight:500}.ui-detail-trailing{color:var(--ui-text);overflow-wrap:anywhere}.ui-detail-trailing--up{color:var(--ui-up)}.ui-detail-trailing--down{color:var(--ui-down)}.ui-detail-meta{color:var(--ui-text-muted);overflow-wrap:anywhere;gap:8px;margin-top:3px;font-size:12.5px;display:flex}.ui-detail-metalabel{color:var(--ui-text-muted);flex:none}.ui-feedback{border:.5px solid var(--ui-border);background:var(--ui-surface);color:var(--ui-text);border-left-width:3px;border-radius:8px;margin:0 0 14px;padding:11px 13px;font-size:13.5px}.ui-feedback--ok{border-left-color:var(--ui-ok-text)}.ui-feedback--error{border-left-color:var(--ui-danger)}.ui-card>.ui-feedback{margin:14px 0}.ui-card>.ui-feedback:last-child{margin-bottom:0}.ui-feedback-detail{color:var(--ui-text-muted);overflow-wrap:anywhere;margin-top:4px;font-size:12.5px;display:block}.ui-placeholder{border:.5px dashed var(--ui-border-strong);color:var(--ui-text-muted);text-align:center;border-radius:12px;margin:0 0 14px;padding:18px;font-size:13.5px}.ui-note{color:var(--ui-text-muted);margin:12px 0 0;font-size:12.5px;line-height:1.6}.ui-info{border:.5px solid var(--ui-border-strong);width:1.3em;height:1.3em;color:var(--ui-text-muted);cursor:help;vertical-align:middle;border-radius:50%;justify-content:center;align-items:center;margin-left:.3em;font-size:.72em;font-style:normal;font-weight:500;line-height:1;display:inline-flex}.ui-info:hover,.ui-info:focus-visible{border-color:var(--ui-accent);color:var(--ui-accent);outline:none}.ui-ptb-graph{min-height:60px;color:var(--ui-text-muted);font-size:13px;overflow-x:auto}.ui-ptb-graph svg{max-width:100%;height:auto}.ui-ptb-graph--error{color:var(--ui-danger)}.ui-chain-receipt-gas{margin-bottom:6px}.ui-chain-receipt-ptb{background:var(--ui-surface);min-width:0;overflow:hidden}.ui-ptb-actions{align-items:center;gap:4px;display:flex}.ui-ptb-graph-controls .ui-icon-btn{background:var(--ui-surface-2);box-shadow:0 1px 3px #0003}.ui-ptb-graph--interactive{cursor:grab;-webkit-user-select:none;user-select:none;touch-action:none;height:420px;position:relative;overflow:hidden}.ui-ptb-graph--grabbing{cursor:grabbing}.ui-ptb-graph-content{transform-origin:0 0;width:100%}.ui-ptb-graph-controls{z-index:2;flex-direction:column;gap:5px;display:flex;position:absolute;top:8px;right:8px}.ui-ptb-graph-controls .ui-icon-btn{width:28px;height:28px}.ui-ptb-graph-controls .ui-icon-btn svg{width:15px;height:15px}.ui-accordion{border-block-start:1px solid var(--ui-border);margin-block:12px}.ui-accordion-summary{cursor:pointer;color:var(--ui-text);justify-content:space-between;align-items:center;gap:10px;padding:11px 0;font-size:13px;font-weight:500;list-style:none;display:flex}.ui-accordion-summary::-webkit-details-marker{display:none}.ui-accordion-summary:hover{color:var(--ui-accent)}.ui-accordion-summary:focus-visible{box-shadow:0 0 0 3px var(--ui-focus);border-radius:var(--ui-r);outline:none}.ui-accordion-summary:after{content:"";border-right:1.5px solid var(--ui-text-muted);border-bottom:1.5px solid var(--ui-text-muted);flex:none;width:7px;height:7px;transition:transform .15s;transform:rotate(45deg)}.ui-accordion[open] .ui-accordion-summary:after{transform:rotate(-135deg)}.ui-accordion[open] .ui-accordion-summary{color:var(--ui-accent)}.ui-accordion-body{padding:4px 0 12px}.ui-accordion[open]>.ui-accordion-body{animation:.18s ease-out ui-reveal}@keyframes ui-reveal{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion:reduce){.ui-accordion[open]>.ui-accordion-body{animation:none}}@container mcp-card (width<=28rem){.ui-card{--ui-card-padding-block:12px;--ui-card-padding-inline:12px}.ui-row{grid-template-columns:minmax(0,1fr);gap:4px}.ui-row-value{text-align:left}.ui-detail-meta{flex-wrap:wrap}}@container mcp-card (width>=0){.ui-card,.ui-card-head>:first-child,.ui-detail-head>*,.ui-detail-meta>*{min-width:0}.ui-ptb-actions{flex:none}.ui-ptb-graph--interactive{height:clamp(280px,75cqi,420px)}}.ui-error:not(:empty){color:var(--ui-danger)}.ui-note:empty,.ui-error:empty{display:none}.ui-form{flex-wrap:wrap;align-items:end;gap:12px;display:flex}.ui-form>*{min-width:0;max-width:100%}.ui-form>input,.ui-form>select,.ui-form>label{flex:14rem}.ui-form label{flex-direction:column;gap:6px;display:flex}.ui-form label>input,.ui-form label>select{width:100%}.ui-form>details,.ui-form>p,.ui-form>.card-actions{flex-basis:100%}@container mcp-card (width<=28rem){.ui-form>button{width:100%}}.settings-card{overflow-x:clip}.settings-card .settings-page--forward{animation:.18s ease-out settings-forward}.settings-card .settings-page--back{animation:.18s ease-out settings-back}@keyframes settings-forward{0%{opacity:0;transform:translate(16px)}to{opacity:1;transform:translate(0)}}@keyframes settings-back{0%{opacity:0;transform:translate(-16px)}to{opacity:1;transform:translate(0)}}@media (prefers-reduced-motion:reduce){.settings-card .settings-page--forward,.settings-card .settings-page--back{animation:none}}.settings-card .settings-toolbar{border-bottom:1px solid var(--ui-border);flex-wrap:wrap;align-items:center;gap:12px;margin-block-end:20px;padding-block:0 14px;display:flex}.settings-card .settings-location{color:var(--ui-text-muted);font-size:13px}.settings-card .settings-back{background:0 0;border-color:#0000;padding-inline:0 10px}.settings-card .settings-back:before{content:"←";margin-inline-end:8px}.settings-card .settings-menu{margin-block:16px;display:grid}.settings-card .settings-menu-item{text-align:start;white-space:normal;border:0;border-bottom:1px solid var(--ui-border);width:100%;color:var(--ui-text);background:0 0;border-radius:0;grid-template-columns:minmax(0,1fr);justify-content:stretch;justify-items:start;gap:5px;padding:18px 32px 18px 12px;display:grid;position:relative}.settings-card .settings-menu-item:hover{background:var(--ui-surface-2)}.settings-card .settings-menu-item:after{content:"";inset-inline-end:14px;border-top:1.5px solid var(--ui-text-muted);border-right:1.5px solid var(--ui-text-muted);width:7px;height:7px;position:absolute;top:50%;transform:translateY(-50%)rotate(45deg)}.settings-card .settings-menu-title{font-weight:600}.settings-card .settings-menu-description{color:var(--ui-text-muted);font-size:13px;font-weight:400}.settings-card .settings-pending{margin-block:20px}.settings-card .settings-action-row{align-items:stretch;gap:var(--ui-space-2,8px);grid-template-columns:minmax(0,1fr);margin-block-start:12px;display:grid}.settings-card .settings-action-row>.ui-btn{white-space:normal;overflow-wrap:anywhere;width:100%;min-width:0}.settings-card .settings-path{white-space:normal;overflow-wrap:anywhere}.settings-card .settings-backup-location .ui-row{grid-template-columns:minmax(0,1fr);gap:6px}.settings-card .settings-backup-location .ui-row-value{text-align:start}.settings-card .settings-choice{border-bottom:1px solid var(--ui-border);flex-wrap:wrap;align-items:center;gap:12px 20px;padding-block:18px;display:flex}.settings-card .settings-choice-copy{flex:16rem;min-width:0}.settings-card .settings-choice h3{margin-block:0 6px}.settings-card .settings-choice p{margin:0}.settings-card .settings-endpoint{border-bottom:1px solid var(--ui-border);padding-block:16px}.settings-card .settings-endpoint label{flex-direction:column;gap:8px;display:flex}html,body{min-height:0;margin:0}body{color:var(--ui-text);background:var(--ui-bg)}#app{padding:var(--ui-space-4,16px);overflow-wrap:anywhere;min-width:0;max-width:100%;container:mcp-card/inline-size}#app h1{margin:0 0 12px;font-size:20px;font-weight:500}.card-actions{margin-top:12px}.card-actions,.card-actions>div{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.card-chart{width:100%;min-width:0;height:clamp(280px,75cqi,400px)}.card-progress-hint{color:var(--ui-text-muted);align-items:center;gap:10px;margin-block:12px;font-size:12px;display:flex}.card-progress-hint[hidden]{display:none}
2
2
  /*$vite$:1*/</style></head><body><main id="app" aria-live="polite"></main><template id="dependency-notices">@modelcontextprotocol/ext-apps 1.7.5
3
3
  The MCP project is undergoing a licensing transition from the MIT License to the Apache License, Version 2.0 ("Apache-2.0"). All new code and specification contributions to the project are licensed under Apache-2.0. Documentation contributions (excluding specifications) are licensed under CC-BY-4.0.
4
4
 
@@ -220,7 +220,7 @@ the full license text.
220
220
 
221
221
  ---
222
222
 
223
- @modelcontextprotocol/sdk 1.29.0
223
+ @modelcontextprotocol/sdk 1.31.0
224
224
  MIT License
225
225
 
226
226
  Copyright (c) 2024 Anthropic, PBC
@@ -1193,10 +1193,10 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1193
1193
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1194
1194
  SOFTWARE.
1195
1195
 
1196
- </template><script type="module">var e=Object.defineProperty,t=(e,t)=>()=>(e&&(t=e(e=0)),t),n=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r},r=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});function i(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,`_zod`,{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,`name`,{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,`init`,{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,`name`,{value:e}),o}function a(e){return e&&Object.assign(d,e),d}var o,s,c,l,u,d,f=t((()=>{s=Object.freeze({status:`aborted`}),c=Symbol(`zod_brand`),l=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},u=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}},(o=globalThis).__zod_globalConfig??(o.__zod_globalConfig={}),d=globalThis.__zod_globalConfig})),p=n({BIGINT_FORMAT_RANGES:()=>Ye,Class:()=>Xe,NUMBER_FORMAT_RANGES:()=>Je,aborted:()=>De,allowsEval:()=>We,assert:()=>ee,assertEqual:()=>m,assertIs:()=>g,assertNever:()=>_,assertNotEqual:()=>h,assignProp:()=>x,base64ToUint8Array:()=>Ie,base64urlToUint8Array:()=>Re,cached:()=>re,captureStackTrace:()=>Ue,cleanEnum:()=>Fe,cleanRegex:()=>y,clone:()=>_e,cloneDef:()=>se,createTransparentProxy:()=>ve,defineLazy:()=>b,esc:()=>de,escapeRegex:()=>ge,explicitlyAborted:()=>Oe,extend:()=>Se,finalizeIssue:()=>je,floatSafeRemainder:()=>ae,getElementAtPath:()=>ce,getEnumValues:()=>te,getLengthableOrigin:()=>Ne,getParsedType:()=>Ge,getSizableOrigin:()=>Me,hexToUint8Array:()=>Be,isObject:()=>pe,isPlainObject:()=>me,issue:()=>Pe,joinValues:()=>v,jsonStringifyReplacer:()=>ne,merge:()=>we,mergeDefs:()=>S,normalizeParams:()=>w,nullish:()=>ie,numKeys:()=>C,objectClone:()=>oe,omit:()=>xe,optionalKeys:()=>ye,parsedType:()=>E,partial:()=>Te,pick:()=>be,prefixIssues:()=>ke,primitiveTypes:()=>qe,promiseAllObject:()=>le,propertyKeyTypes:()=>Ke,randomString:()=>ue,required:()=>Ee,safeExtend:()=>Ce,shallowClone:()=>he,slugify:()=>fe,stringifyPrimitive:()=>T,uint8ArrayToBase64:()=>Le,uint8ArrayToBase64url:()=>ze,uint8ArrayToHex:()=>Ve,unwrapMessage:()=>Ae});function m(e){return e}function h(e){return e}function g(e){}function _(e){throw Error(`Unexpected value in exhaustive check`)}function ee(e){}function te(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function v(e,t=`|`){return e.map(e=>T(e)).join(t)}function ne(e,t){return typeof t==`bigint`?t.toString():t}function re(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function ie(e){return e==null}function y(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function ae(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}function b(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==He)return r===void 0&&(r=He,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function oe(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function x(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function S(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function se(e){return S(e._zod.def)}function ce(e,t){return t?t.reduce((e,t)=>e?.[t],e):e}function le(e){let t=Object.keys(e),n=t.map(t=>e[t]);return Promise.all(n).then(e=>{let n={};for(let r=0;r<t.length;r++)n[t[r]]=e[r];return n})}function ue(e=10){let t=``;for(let n=0;n<e;n++)t+=`abcdefghijklmnopqrstuvwxyz`[Math.floor(Math.random()*26)];return t}function de(e){return JSON.stringify(e)}function fe(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}function pe(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function me(e){if(pe(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(pe(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function he(e){return me(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function C(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}function ge(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function _e(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function w(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 ve(e){let t;return new Proxy({},{get(n,r,i){return t??=e(),Reflect.get(t,r,i)},set(n,r,i,a){return t??=e(),Reflect.set(t,r,i,a)},has(n,r){return t??=e(),Reflect.has(t,r)},deleteProperty(n,r){return t??=e(),Reflect.deleteProperty(t,r)},ownKeys(n){return t??=e(),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,r){return t??=e(),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(n,r,i){return t??=e(),Reflect.defineProperty(t,r,i)}})}function T(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function ye(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}function be(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return _e(e,S(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return x(this,`shape`,e),e},checks:[]}))}function xe(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return _e(e,S(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return x(this,`shape`,r),r},checks:[]}))}function Se(e,t){if(!me(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return _e(e,S(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return x(this,`shape`,n),n}}))}function Ce(e,t){if(!me(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return _e(e,S(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return x(this,`shape`,n),n}}))}function we(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return _e(e,S(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return x(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function Te(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return _e(t,S(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return x(this,`shape`,i),i},checks:[]}))}function Ee(e,t,n){return _e(t,S(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return x(this,`shape`,i),i}}))}function De(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Oe(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function ke(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Ae(e){return typeof e==`string`?e:e?.message}function je(e,t,n){let r=e.message?e.message:Ae(e.inst?._zod.def?.error?.(e))??Ae(t?.error?.(e))??Ae(n.customError?.(e))??Ae(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function Me(e){return e instanceof Set?`set`:e instanceof Map?`map`:e instanceof File?`file`:`unknown`}function Ne(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function E(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 t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function Pe(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function Fe(e){return Object.entries(e).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function Ie(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}function Le(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function Re(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`);return Ie(t+`=`.repeat((4-t.length%4)%4))}function ze(e){return Le(e).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=/g,``)}function Be(e){let t=e.replace(/^0x/,``);if(t.length%2!=0)throw Error(`Invalid hex string length`);let n=new Uint8Array(t.length/2);for(let e=0;e<t.length;e+=2)n[e/2]=Number.parseInt(t.slice(e,e+2),16);return n}function Ve(e){return Array.from(e).map(e=>e.toString(16).padStart(2,`0`)).join(``)}var He,Ue,We,Ge,Ke,qe,Je,Ye,Xe,D=t((()=>{f(),He=Symbol(`evaluating`),Ue=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{},We=re(()=>{if(d.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}}),Ge=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}`)}},Ke=new Set([`string`,`number`,`symbol`]),qe=new Set([`string`,`number`,`bigint`,`boolean`,`symbol`,`undefined`]),Je={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Ye={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]},Xe=class{constructor(...e){}}}));function Ze(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Qe(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}function $e(e,t=e=>e.message){let n={errors:[]},r=(e,i=[])=>{var a,o;for(let s of e.issues)if(s.code===`invalid_union`&&s.errors.length)s.errors.map(e=>r({issues:e},[...i,...s.path]));else if(s.code===`invalid_key`)r({issues:s.issues},[...i,...s.path]);else if(s.code===`invalid_element`)r({issues:s.issues},[...i,...s.path]);else{let e=[...i,...s.path];if(e.length===0){n.errors.push(t(s));continue}let r=n,c=0;for(;c<e.length;){let n=e[c],i=c===e.length-1;typeof n==`string`?(r.properties??={},(a=r.properties)[n]??(a[n]={errors:[]}),r=r.properties[n]):(r.items??=[],(o=r.items)[n]??(o[n]={errors:[]}),r=r.items[n]),i&&r.errors.push(t(s)),c++}}};return r(e),n}function et(e){let t=[],n=e.map(e=>typeof e==`object`?e.key:e);for(let e of n)typeof e==`number`?t.push(`[${e}]`):typeof e==`symbol`?t.push(`[${JSON.stringify(String(e))}]`):/[^\w$]/.test(e)?t.push(`[${JSON.stringify(e)}]`):(t.length&&t.push(`.`),t.push(e));return t.join(``)}function tt(e){let t=[],n=[...e.issues].sort((e,t)=>(e.path??[]).length-(t.path??[]).length);for(let e of n)t.push(`✖ ${e.message}`),e.path?.length&&t.push(` → at ${et(e.path)}`);return t.join(`
1197
- `)}var nt,rt,it,at=t((()=>{f(),D(),nt=(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,ne,2),Object.defineProperty(e,`toString`,{value:()=>e.message,enumerable:!1})},rt=i(`$ZodError`,nt),it=i(`$ZodError`,nt,{Parent:Error})})),ot,st,ct,lt,ut,dt,ft,pt,mt,ht,gt,_t,vt,yt,bt,xt,St,Ct,wt,Tt,Et,Dt,Ot,kt,At=t((()=>{f(),at(),D(),ot=e=>(t,n,r,i)=>{let o=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new l;if(s.issues.length){let t=new(i?.Err??e)(s.issues.map(e=>je(e,o,a())));throw Ue(t,i?.callee),t}return s.value},st=ot(it),ct=e=>async(t,n,r,i)=>{let o=r?{...r,async:!0}:{async:!0},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let t=new(i?.Err??e)(s.issues.map(e=>je(e,o,a())));throw Ue(t,i?.callee),t}return s.value},lt=ct(it),ut=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise)throw new l;return o.issues.length?{success:!1,error:new(e??rt)(o.issues.map(e=>je(e,i,a())))}:{success:!0,data:o.value}},dt=ut(it),ft=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},i);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(e=>je(e,i,a())))}:{success:!0,data:o.value}},pt=ft(it),mt=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return ot(e)(t,n,i)},ht=mt(it),gt=e=>(t,n,r)=>ot(e)(t,n,r),_t=gt(it),vt=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return ct(e)(t,n,i)},yt=vt(it),bt=e=>async(t,n,r)=>ct(e)(t,n,r),xt=bt(it),St=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return ut(e)(t,n,i)},Ct=St(it),wt=e=>(t,n,r)=>ut(e)(t,n,r),Tt=wt(it),Et=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return ft(e)(t,n,i)},Dt=Et(it),Ot=e=>async(t,n,r)=>ft(e)(t,n,r),kt=Ot(it)})),jt=n({base64:()=>un,base64url:()=>dn,bigint:()=>yn,boolean:()=>Sn,browserEmail:()=>nn,cidrv4:()=>cn,cidrv6:()=>ln,cuid:()=>Rt,cuid2:()=>zt,date:()=>_n,datetime:()=>Ft,domain:()=>pn,duration:()=>Wt,e164:()=>hn,email:()=>Zt,emoji:()=>Mt,extendedDuration:()=>Gt,guid:()=>Kt,hex:()=>Dn,hostname:()=>fn,html5Email:()=>Qt,httpProtocol:()=>mn,idnEmail:()=>tn,integer:()=>bn,ipv4:()=>an,ipv6:()=>on,ksuid:()=>Ht,lowercase:()=>Tn,mac:()=>sn,md5_base64:()=>kn,md5_base64url:()=>An,md5_hex:()=>On,nanoid:()=>Ut,null:()=>Cn,number:()=>xn,rfc5322Email:()=>$t,sha1_base64:()=>Mn,sha1_base64url:()=>Nn,sha1_hex:()=>jn,sha256_base64:()=>Fn,sha256_base64url:()=>In,sha256_hex:()=>Pn,sha384_base64:()=>Rn,sha384_base64url:()=>zn,sha384_hex:()=>Ln,sha512_base64:()=>Vn,sha512_base64url:()=>Hn,sha512_hex:()=>Bn,string:()=>vn,time:()=>Pt,ulid:()=>Bt,undefined:()=>wn,unicodeEmail:()=>en,uppercase:()=>En,uuid:()=>qt,uuid4:()=>Jt,uuid6:()=>Yt,uuid7:()=>Xt,xid:()=>Vt});function Mt(){return new RegExp(rn,`u`)}function Nt(e){let 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 Pt(e){return RegExp(`^${Nt(e)}$`)}function Ft(e){let t=Nt({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${gn}T(?:${r})$`)}function It(e,t){return RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Lt(e){return RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var Rt,zt,Bt,Vt,Ht,Ut,Wt,Gt,Kt,qt,Jt,Yt,Xt,Zt,Qt,$t,en,tn,nn,rn,an,on,sn,cn,ln,un,dn,fn,pn,mn,hn,gn,_n,vn,yn,bn,xn,Sn,Cn,wn,Tn,En,Dn,On,kn,An,jn,Mn,Nn,Pn,Fn,In,Ln,Rn,zn,Bn,Vn,Hn,Un=t((()=>{D(),Rt=/^[cC][0-9a-z]{6,}$/,zt=/^[0-9a-z]+$/,Bt=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Vt=/^[0-9a-vA-V]{20}$/,Ht=/^[A-Za-z0-9]{27}$/,Ut=/^[a-zA-Z0-9_-]{21}$/,Wt=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Gt=/^[-+]?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)?)??$/,Kt=/^([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})$/,qt=e=>e?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)$/,Jt=qt(4),Yt=qt(6),Xt=qt(7),Zt=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Qt=/^[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])?)*$/,$t=/^(([^<>()\[\]\\.,;:\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,}))$/,en=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,tn=en,nn=/^[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])?)*$/,rn=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,an=/^(?:(?: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])$/,on=/^(([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}|:))$/,sn=e=>{let t=ge(e??`:`);return RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},cn=/^((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])$/,ln=/^(([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])$/,un=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,dn=/^[A-Za-z0-9_-]*$/,fn=/^(?=.{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])?)*\.?$/,pn=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,mn=/^https?$/,hn=/^\+[1-9]\d{6,14}$/,gn=`(?:(?:\\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])))`,_n=RegExp(`^${gn}$`),vn=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},yn=/^-?\d+n?$/,bn=/^-?\d+$/,xn=/^-?\d+(?:\.\d+)?$/,Sn=/^(?:true|false)$/i,Cn=/^null$/i,wn=/^undefined$/i,Tn=/^[^A-Z]*$/,En=/^[^a-z]*$/,Dn=/^[0-9a-fA-F]*$/,On=/^[0-9a-fA-F]{32}$/,kn=It(22,`==`),An=Lt(22),jn=/^[0-9a-fA-F]{40}$/,Mn=It(27,`=`),Nn=Lt(27),Pn=/^[0-9a-fA-F]{64}$/,Fn=It(43,`=`),In=Lt(43),Ln=/^[0-9a-fA-F]{96}$/,Rn=It(64,``),zn=Lt(64),Bn=/^[0-9a-fA-F]{128}$/,Vn=It(86,`==`),Hn=Lt(86)}));function Wn(e,t,n){e.issues.length&&t.issues.push(...ke(n,e.issues))}var O,Gn,Kn,qn,Jn,Yn,Xn,Zn,Qn,$n,er,tr,nr,rr,ir,ar,or,sr,cr,lr,ur,dr,fr,pr=t((()=>{f(),Un(),D(),O=i(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Gn={number:`number`,bigint:`bigint`,object:`date`},Kn=i(`$ZodCheckLessThan`,(e,t)=>{O.init(e,t);let n=Gn[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),qn=i(`$ZodCheckGreaterThan`,(e,t)=>{O.init(e,t);let n=Gn[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Jn=i(`$ZodCheckMultipleOf`,(e,t)=>{O.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):ae(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Yn=i(`$ZodCheckNumberFormat`,(e,t)=>{O.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Je[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=bn)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Xn=i(`$ZodCheckBigIntFormat`,(e,t)=>{O.init(e,t);let[n,r]=Ye[t.format];e._zod.onattach.push(e=>{let i=e._zod.bag;i.format=t.format,i.minimum=n,i.maximum=r}),e._zod.check=i=>{let a=i.value;a<n&&i.issues.push({origin:`bigint`,input:a,code:`too_small`,minimum:n,inclusive:!0,inst:e,continue:!t.abort}),a>r&&i.issues.push({origin:`bigint`,input:a,code:`too_big`,maximum:r,inclusive:!0,inst:e,continue:!t.abort})}}),Zn=i(`$ZodCheckMaxSize`,(e,t)=>{var n;O.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!ie(t)&&t.size!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;r.size<=t.maximum||n.issues.push({origin:Me(r),code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Qn=i(`$ZodCheckMinSize`,(e,t)=>{var n;O.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!ie(t)&&t.size!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;r.size>=t.minimum||n.issues.push({origin:Me(r),code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),$n=i(`$ZodCheckSizeEquals`,(e,t)=>{var n;O.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!ie(t)&&t.size!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=n=>{let r=n.value,i=r.size;if(i===t.size)return;let a=i>t.size;n.issues.push({origin:Me(r),...a?{code:`too_big`,maximum:t.size}:{code:`too_small`,minimum:t.size},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),er=i(`$ZodCheckMaxLength`,(e,t)=>{var n;O.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!ie(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=Ne(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),tr=i(`$ZodCheckMinLength`,(e,t)=>{var n;O.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!ie(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=Ne(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),nr=i(`$ZodCheckLengthEquals`,(e,t)=>{var n;O.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!ie(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=Ne(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),rr=i(`$ZodCheckStringFormat`,(e,t)=>{var n,r;O.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),ir=i(`$ZodCheckRegex`,(e,t)=>{rr.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),ar=i(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Tn,rr.init(e,t)}),or=i(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=En,rr.init(e,t)}),sr=i(`$ZodCheckIncludes`,(e,t)=>{O.init(e,t);let n=ge(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),cr=i(`$ZodCheckStartsWith`,(e,t)=>{O.init(e,t);let n=RegExp(`^${ge(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),lr=i(`$ZodCheckEndsWith`,(e,t)=>{O.init(e,t);let n=RegExp(`.*${ge(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),ur=i(`$ZodCheckProperty`,(e,t)=>{O.init(e,t),e._zod.check=e=>{let n=t.schema._zod.run({value:e.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then(n=>Wn(n,e,t.property));Wn(n,e,t.property)}}),dr=i(`$ZodCheckMimeType`,(e,t)=>{O.init(e,t);let n=new Set(t.mime);e._zod.onattach.push(e=>{e._zod.bag.mime=t.mime}),e._zod.check=r=>{n.has(r.value.type)||r.issues.push({code:`invalid_value`,values:t.mime,input:r.value.type,inst:e,continue:!t.abort})}}),fr=i(`$ZodCheckOverwrite`,(e,t)=>{O.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}})})),mr,hr=t((()=>{mr=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
1196
+ </template><script type="module">var e=Object.defineProperty,t=(e,t)=>()=>(e&&(t=e(e=0)),t),n=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r},r=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});function i(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}function a(e){return e&&Object.assign(d,e),d}var o,s,c,l,u,d,f=t((()=>{s=Object.freeze({status:`aborted`}),c=Symbol(`zod_brand`),l=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},u=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}},(o=globalThis).__zod_globalConfig??(o.__zod_globalConfig={}),d=globalThis.__zod_globalConfig})),p=n({BIGINT_FORMAT_RANGES:()=>Ye,Class:()=>Xe,NUMBER_FORMAT_RANGES:()=>Je,aborted:()=>De,allowsEval:()=>We,assert:()=>ne,assertEqual:()=>m,assertIs:()=>h,assertNever:()=>te,assertNotEqual:()=>ee,assignProp:()=>se,base64ToUint8Array:()=>Ie,base64urlToUint8Array:()=>Re,cached:()=>v,captureStackTrace:()=>Ue,cleanEnum:()=>Fe,cleanRegex:()=>ae,clone:()=>_e,cloneDef:()=>ce,createTransparentProxy:()=>ve,defineLazy:()=>y,esc:()=>ue,escapeRegex:()=>ge,explicitlyAborted:()=>Oe,extend:()=>Se,finalizeIssue:()=>je,floatSafeRemainder:()=>oe,getElementAtPath:()=>S,getEnumValues:()=>g,getLengthableOrigin:()=>Ne,getParsedType:()=>Ge,getSizableOrigin:()=>Me,hexToUint8Array:()=>Be,isObject:()=>fe,isPlainObject:()=>pe,issue:()=>Pe,joinValues:()=>_,jsonStringifyReplacer:()=>re,merge:()=>we,mergeDefs:()=>x,normalizeParams:()=>w,nullish:()=>ie,numKeys:()=>he,objectClone:()=>b,omit:()=>xe,optionalKeys:()=>ye,parsedType:()=>E,partial:()=>Te,pick:()=>be,prefixIssues:()=>ke,primitiveTypes:()=>qe,promiseAllObject:()=>C,propertyKeyTypes:()=>Ke,randomString:()=>le,required:()=>Ee,safeExtend:()=>Ce,shallowClone:()=>me,slugify:()=>de,stringifyPrimitive:()=>T,uint8ArrayToBase64:()=>Le,uint8ArrayToBase64url:()=>ze,uint8ArrayToHex:()=>Ve,unwrapMessage:()=>Ae});function m(e){return e}function ee(e){return e}function h(e){}function te(e){throw Error(`Unexpected value in exhaustive check`)}function ne(e){}function g(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function _(e,t=`|`){return e.map(e=>T(e)).join(t)}function re(e,t){return typeof t==`bigint`?t.toString():t}function v(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw Error(`cached value already set`)}}}function ie(e){return e==null}function ae(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function oe(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}function y(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==He)return r===void 0&&(r=He,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function b(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function se(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function x(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function ce(e){return x(e._zod.def)}function S(e,t){return t?t.reduce((e,t)=>e?.[t],e):e}function C(e){let t=Object.keys(e),n=t.map(t=>e[t]);return Promise.all(n).then(e=>{let n={};for(let r=0;r<t.length;r++)n[t[r]]=e[r];return n})}function le(e=10){let t=``;for(let n=0;n<e;n++)t+=`abcdefghijklmnopqrstuvwxyz`[Math.floor(Math.random()*26)];return t}function ue(e){return JSON.stringify(e)}function de(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}function fe(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function pe(e){if(fe(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(fe(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function me(e){return pe(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function he(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}function ge(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function _e(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function w(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 ve(e){let t;return new Proxy({},{get(n,r,i){return t??=e(),Reflect.get(t,r,i)},set(n,r,i,a){return t??=e(),Reflect.set(t,r,i,a)},has(n,r){return t??=e(),Reflect.has(t,r)},deleteProperty(n,r){return t??=e(),Reflect.deleteProperty(t,r)},ownKeys(n){return t??=e(),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,r){return t??=e(),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(n,r,i){return t??=e(),Reflect.defineProperty(t,r,i)}})}function T(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function ye(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}function be(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return _e(e,x(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return se(this,`shape`,e),e},checks:[]}))}function xe(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return _e(e,x(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return se(this,`shape`,r),r},checks:[]}))}function Se(e,t){if(!pe(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return _e(e,x(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return se(this,`shape`,n),n}}))}function Ce(e,t){if(!pe(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return _e(e,x(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return se(this,`shape`,n),n}}))}function we(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return _e(e,x(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return se(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function Te(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return _e(t,x(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return se(this,`shape`,i),i},checks:[]}))}function Ee(e,t,n){return _e(t,x(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return se(this,`shape`,i),i}}))}function De(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Oe(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function ke(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Ae(e){return typeof e==`string`?e:e?.message}function je(e,t,n){let r=e.message?e.message:Ae(e.inst?._zod.def?.error?.(e))??Ae(t?.error?.(e))??Ae(n.customError?.(e))??Ae(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function Me(e){return e instanceof Set?`set`:e instanceof Map?`map`:e instanceof File?`file`:`unknown`}function Ne(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function E(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 t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function Pe(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function Fe(e){return Object.entries(e).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function Ie(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}function Le(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function Re(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`);return Ie(t+`=`.repeat((4-t.length%4)%4))}function ze(e){return Le(e).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=/g,``)}function Be(e){let t=e.replace(/^0x/,``);if(t.length%2!=0)throw Error(`Invalid hex string length`);let n=new Uint8Array(t.length/2);for(let e=0;e<t.length;e+=2)n[e/2]=Number.parseInt(t.slice(e,e+2),16);return n}function Ve(e){return Array.from(e).map(e=>e.toString(16).padStart(2,`0`)).join(``)}var He,Ue,We,Ge,Ke,qe,Je,Ye,Xe,D=t((()=>{f(),He=Symbol(`evaluating`),Ue=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{},We=v(()=>{if(d.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}}),Ge=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}`)}},Ke=new Set([`string`,`number`,`symbol`]),qe=new Set([`string`,`number`,`bigint`,`boolean`,`symbol`,`undefined`]),Je={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Ye={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]},Xe=class{constructor(...e){}}}));function Ze(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Qe(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}function $e(e,t=e=>e.message){let n={errors:[]},r=(e,i=[])=>{var a,o;for(let s of e.issues)if(s.code===`invalid_union`&&s.errors.length)s.errors.map(e=>r({issues:e},[...i,...s.path]));else if(s.code===`invalid_key`)r({issues:s.issues},[...i,...s.path]);else if(s.code===`invalid_element`)r({issues:s.issues},[...i,...s.path]);else{let e=[...i,...s.path];if(e.length===0){n.errors.push(t(s));continue}let r=n,c=0;for(;c<e.length;){let n=e[c],i=c===e.length-1;typeof n==`string`?(r.properties??={},(a=r.properties)[n]??(a[n]={errors:[]}),r=r.properties[n]):(r.items??=[],(o=r.items)[n]??(o[n]={errors:[]}),r=r.items[n]),i&&r.errors.push(t(s)),c++}}};return r(e),n}function et(e){let t=[],n=e.map(e=>typeof e==`object`?e.key:e);for(let e of n)typeof e==`number`?t.push(`[${e}]`):typeof e==`symbol`?t.push(`[${JSON.stringify(String(e))}]`):/[^\w$]/.test(e)?t.push(`[${JSON.stringify(e)}]`):(t.length&&t.push(`.`),t.push(e));return t.join(``)}function tt(e){let t=[],n=[...e.issues].sort((e,t)=>(e.path??[]).length-(t.path??[]).length);for(let e of n)t.push(`✖ ${e.message}`),e.path?.length&&t.push(` → at ${et(e.path)}`);return t.join(`
1197
+ `)}var nt,rt,it,at=t((()=>{f(),D(),nt=(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,re,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},rt=i(`$ZodError`,nt),it=i(`$ZodError`,nt,{Parent:Error})})),ot,st,ct,lt,ut,dt,ft,pt,mt,ht,gt,_t,vt,yt,bt,xt,St,Ct,wt,Tt,Et,Dt,Ot,kt,At=t((()=>{f(),at(),D(),ot=e=>(t,n,r,i)=>{let o=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new l;if(s.issues.length){let t=new(i?.Err??e)(s.issues.map(e=>je(e,o,a())));throw Ue(t,i?.callee),t}return s.value},st=ot(it),ct=e=>async(t,n,r,i)=>{let o=r?{...r,async:!0}:{async:!0},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let t=new(i?.Err??e)(s.issues.map(e=>je(e,o,a())));throw Ue(t,i?.callee),t}return s.value},lt=ct(it),ut=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise)throw new l;return o.issues.length?{success:!1,error:new(e??rt)(o.issues.map(e=>je(e,i,a())))}:{success:!0,data:o.value}},dt=ut(it),ft=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},i);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(e=>je(e,i,a())))}:{success:!0,data:o.value}},pt=ft(it),mt=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return ot(e)(t,n,i)},ht=mt(it),gt=e=>(t,n,r)=>ot(e)(t,n,r),_t=gt(it),vt=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return ct(e)(t,n,i)},yt=vt(it),bt=e=>async(t,n,r)=>ct(e)(t,n,r),xt=bt(it),St=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return ut(e)(t,n,i)},Ct=St(it),wt=e=>(t,n,r)=>ut(e)(t,n,r),Tt=wt(it),Et=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return ft(e)(t,n,i)},Dt=Et(it),Ot=e=>async(t,n,r)=>ft(e)(t,n,r),kt=Ot(it)})),jt=n({base64:()=>un,base64url:()=>dn,bigint:()=>yn,boolean:()=>Sn,browserEmail:()=>nn,cidrv4:()=>cn,cidrv6:()=>ln,cuid:()=>Rt,cuid2:()=>zt,date:()=>_n,datetime:()=>Ft,domain:()=>pn,duration:()=>Wt,e164:()=>hn,email:()=>Zt,emoji:()=>Mt,extendedDuration:()=>Gt,guid:()=>Kt,hex:()=>Dn,hostname:()=>fn,html5Email:()=>Qt,httpProtocol:()=>mn,idnEmail:()=>tn,integer:()=>bn,ipv4:()=>an,ipv6:()=>on,ksuid:()=>Ht,lowercase:()=>Tn,mac:()=>sn,md5_base64:()=>kn,md5_base64url:()=>An,md5_hex:()=>On,nanoid:()=>Ut,null:()=>Cn,number:()=>xn,rfc5322Email:()=>$t,sha1_base64:()=>Mn,sha1_base64url:()=>Nn,sha1_hex:()=>jn,sha256_base64:()=>Fn,sha256_base64url:()=>In,sha256_hex:()=>Pn,sha384_base64:()=>Rn,sha384_base64url:()=>zn,sha384_hex:()=>Ln,sha512_base64:()=>Vn,sha512_base64url:()=>Hn,sha512_hex:()=>Bn,string:()=>vn,time:()=>Pt,ulid:()=>Bt,undefined:()=>wn,unicodeEmail:()=>en,uppercase:()=>En,uuid:()=>qt,uuid4:()=>Jt,uuid6:()=>Yt,uuid7:()=>Xt,xid:()=>Vt});function Mt(){return new RegExp(rn,`u`)}function Nt(e){let 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 Pt(e){return RegExp(`^${Nt(e)}$`)}function Ft(e){let t=Nt({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${gn}T(?:${r})$`)}function It(e,t){return RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Lt(e){return RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var Rt,zt,Bt,Vt,Ht,Ut,Wt,Gt,Kt,qt,Jt,Yt,Xt,Zt,Qt,$t,en,tn,nn,rn,an,on,sn,cn,ln,un,dn,fn,pn,mn,hn,gn,_n,vn,yn,bn,xn,Sn,Cn,wn,Tn,En,Dn,On,kn,An,jn,Mn,Nn,Pn,Fn,In,Ln,Rn,zn,Bn,Vn,Hn,Un=t((()=>{D(),Rt=/^[cC][0-9a-z]{6,}$/,zt=/^[0-9a-z]+$/,Bt=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Vt=/^[0-9a-vA-V]{20}$/,Ht=/^[A-Za-z0-9]{27}$/,Ut=/^[a-zA-Z0-9_-]{21}$/,Wt=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Gt=/^[-+]?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)?)??$/,Kt=/^([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})$/,qt=e=>e?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)$/,Jt=qt(4),Yt=qt(6),Xt=qt(7),Zt=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Qt=/^[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])?)*$/,$t=/^(([^<>()\[\]\\.,;:\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,}))$/,en=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,tn=en,nn=/^[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])?)*$/,rn=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,an=/^(?:(?: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])$/,on=/^(([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}|:))$/,sn=e=>{let t=ge(e??`:`);return RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},cn=/^((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])$/,ln=/^(([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])$/,un=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,dn=/^[A-Za-z0-9_-]*$/,fn=/^(?=.{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])?)*\.?$/,pn=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,mn=/^https?$/,hn=/^\+[1-9]\d{6,14}$/,gn=`(?:(?:\\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])))`,_n=RegExp(`^${gn}$`),vn=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},yn=/^-?\d+n?$/,bn=/^-?\d+$/,xn=/^-?\d+(?:\.\d+)?$/,Sn=/^(?:true|false)$/i,Cn=/^null$/i,wn=/^undefined$/i,Tn=/^[^A-Z]*$/,En=/^[^a-z]*$/,Dn=/^[0-9a-fA-F]*$/,On=/^[0-9a-fA-F]{32}$/,kn=It(22,`==`),An=Lt(22),jn=/^[0-9a-fA-F]{40}$/,Mn=It(27,`=`),Nn=Lt(27),Pn=/^[0-9a-fA-F]{64}$/,Fn=It(43,`=`),In=Lt(43),Ln=/^[0-9a-fA-F]{96}$/,Rn=It(64,``),zn=Lt(64),Bn=/^[0-9a-fA-F]{128}$/,Vn=It(86,`==`),Hn=Lt(86)}));function Wn(e,t,n){e.issues.length&&t.issues.push(...ke(n,e.issues))}var O,Gn,Kn,qn,Jn,Yn,Xn,Zn,Qn,$n,er,tr,nr,rr,ir,ar,or,sr,cr,lr,ur,dr,fr,pr=t((()=>{f(),Un(),D(),O=i(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Gn={number:`number`,bigint:`bigint`,object:`date`},Kn=i(`$ZodCheckLessThan`,(e,t)=>{O.init(e,t);let n=Gn[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),qn=i(`$ZodCheckGreaterThan`,(e,t)=>{O.init(e,t);let n=Gn[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Jn=i(`$ZodCheckMultipleOf`,(e,t)=>{O.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):oe(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Yn=i(`$ZodCheckNumberFormat`,(e,t)=>{O.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Je[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=bn)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Xn=i(`$ZodCheckBigIntFormat`,(e,t)=>{O.init(e,t);let[n,r]=Ye[t.format];e._zod.onattach.push(e=>{let i=e._zod.bag;i.format=t.format,i.minimum=n,i.maximum=r}),e._zod.check=i=>{let a=i.value;a<n&&i.issues.push({origin:`bigint`,input:a,code:`too_small`,minimum:n,inclusive:!0,inst:e,continue:!t.abort}),a>r&&i.issues.push({origin:`bigint`,input:a,code:`too_big`,maximum:r,inclusive:!0,inst:e,continue:!t.abort})}}),Zn=i(`$ZodCheckMaxSize`,(e,t)=>{var n;O.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!ie(t)&&t.size!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;r.size<=t.maximum||n.issues.push({origin:Me(r),code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Qn=i(`$ZodCheckMinSize`,(e,t)=>{var n;O.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!ie(t)&&t.size!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;r.size>=t.minimum||n.issues.push({origin:Me(r),code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),$n=i(`$ZodCheckSizeEquals`,(e,t)=>{var n;O.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!ie(t)&&t.size!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=n=>{let r=n.value,i=r.size;if(i===t.size)return;let a=i>t.size;n.issues.push({origin:Me(r),...a?{code:`too_big`,maximum:t.size}:{code:`too_small`,minimum:t.size},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),er=i(`$ZodCheckMaxLength`,(e,t)=>{var n;O.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!ie(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=Ne(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),tr=i(`$ZodCheckMinLength`,(e,t)=>{var n;O.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!ie(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=Ne(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),nr=i(`$ZodCheckLengthEquals`,(e,t)=>{var n;O.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!ie(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=Ne(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),rr=i(`$ZodCheckStringFormat`,(e,t)=>{var n,r;O.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),ir=i(`$ZodCheckRegex`,(e,t)=>{rr.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),ar=i(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Tn,rr.init(e,t)}),or=i(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=En,rr.init(e,t)}),sr=i(`$ZodCheckIncludes`,(e,t)=>{O.init(e,t);let n=ge(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),cr=i(`$ZodCheckStartsWith`,(e,t)=>{O.init(e,t);let n=RegExp(`^${ge(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),lr=i(`$ZodCheckEndsWith`,(e,t)=>{O.init(e,t);let n=RegExp(`.*${ge(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),ur=i(`$ZodCheckProperty`,(e,t)=>{O.init(e,t),e._zod.check=e=>{let n=t.schema._zod.run({value:e.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then(n=>Wn(n,e,t.property));Wn(n,e,t.property)}}),dr=i(`$ZodCheckMimeType`,(e,t)=>{O.init(e,t);let n=new Set(t.mime);e._zod.onattach.push(e=>{e._zod.bag.mime=t.mime}),e._zod.check=r=>{n.has(r.value.type)||r.issues.push({code:`invalid_value`,values:t.mime,input:r.value.type,inst:e,continue:!t.abort})}}),fr=i(`$ZodCheckOverwrite`,(e,t)=>{O.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}})})),mr,hr=t((()=>{mr=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
1198
1198
  `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
1199
- `))}}})),gr,_r=t((()=>{gr={major:4,minor:4,patch:3}}));function vr(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}function yr(e){if(!dn.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return vr(t.padEnd(Math.ceil(t.length/4)*4,`=`))}function br(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}function xr(e,t,n){e.issues.length&&t.issues.push(...ke(n,e.issues)),t.value[n]=e.value}function Sr(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...ke(n,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function Cr(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=ye(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function wr(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin===`optional`,d=c.optout===`optional`;for(let i in t){if(i===`__proto__`||s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Sr(e,n,i,t,u,d))):Sr(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}function Tr(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!De(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>je(e,r,a())))}),t)}function Er(e,t,n,r){let i=e.filter(e=>e.issues.length===0);return i.length===1?(t.value=i[0].value,t):(i.length===0?t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>je(e,r,a())))}):t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:[],inclusive:!1}),t)}function Dr(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(me(e)&&me(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=Dr(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Dr(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Or(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),De(e))return e;let o=Dr(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}function kr(e,t){for(let n=e.length-1;n>=0;n--)if(e[n]._zod[t]!==`optional`)return n+1;return 0}function Ar(e,t,n){e.issues.length&&t.issues.push(...ke(n,e.issues)),t.value[n]=e.value}function jr(e,t,n,r,i){for(let a=0;a<n.length;a++){let n=e[a],o=a<r.length;if(n.issues.length){if(!o&&a>=i){t.value.length=a;break}t.issues.push(...ke(a,n.issues))}t.value[a]=n.value}for(let e=t.value.length-1;e>=r.length&&n[e]._zod.optout===`optional`&&t.value[e]===void 0;e--)t.value.length=e;return t}function Mr(e,t,n,r,i,o,s){e.issues.length&&(Ke.has(typeof r)?n.issues.push(...ke(r,e.issues)):n.issues.push({code:`invalid_key`,origin:`map`,input:i,inst:o,issues:e.issues.map(e=>je(e,s,a()))})),t.issues.length&&(Ke.has(typeof r)?n.issues.push(...ke(r,t.issues)):n.issues.push({origin:`map`,code:`invalid_element`,input:i,inst:o,key:r,issues:t.issues.map(e=>je(e,s,a()))})),n.value.set(e.value,t.value)}function Nr(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}function Pr(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}function Fr(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}function Ir(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function Lr(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}function Rr(e,t,n){if(e.issues.length)return e.aborted=!0,e;if((n.direction||`forward`)===`forward`){let r=t.transform(e.value,e);return r instanceof Promise?r.then(r=>zr(e,r,t.out,n)):zr(e,r,t.out,n)}else{let r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(r=>zr(e,r,t.in,n)):zr(e,r,t.in,n)}}function zr(e,t,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},r)}function Br(e){return e.value=Object.freeze(e.value),e}function Vr(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Pe(e))}}var k,Hr,A,Ur,Wr,Gr,Kr,qr,Jr,Yr,Xr,Zr,Qr,$r,ei,ti,ni,ri,ii,ai,oi,si,ci,li,ui,di,fi,pi,mi,hi,gi,_i,vi,yi,bi,xi,Si,Ci,wi,Ti,Ei,Di,Oi,ki,Ai,ji,Mi,Ni,Pi,Fi,Ii,Li,Ri,zi,Bi,Vi,Hi,Ui,Wi,Gi,Ki,qi,Ji,Yi,Xi,Zi,Qi,$i,ea,ta,na,ra,ia,aa,oa=t((()=>{pr(),f(),hr(),At(),Un(),D(),_r(),k=i(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=gr;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=De(e),i;for(let a of t){if(a._zod.def.when){if(Oe(e)||!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new l;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=De(e,t))});else{if(e.issues.length===t)continue;r||=De(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(De(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new l;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new l;return o.then(e=>t(e,r,a))}return t(o,r,a)}}b(e,`~standard`,()=>({validate:t=>{try{let n=dt(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return pt(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),Hr=i(`$ZodString`,(e,t)=>{k.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??vn(e._zod.bag),e._zod.parse=(n,r)=>{if(t.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:e}),n}}),A=i(`$ZodStringFormat`,(e,t)=>{rr.init(e,t),Hr.init(e,t)}),Ur=i(`$ZodGUID`,(e,t)=>{t.pattern??=Kt,A.init(e,t)}),Wr=i(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=qt(e)}else t.pattern??=qt();A.init(e,t)}),Gr=i(`$ZodEmail`,(e,t)=>{t.pattern??=Zt,A.init(e,t)}),Kr=i(`$ZodURL`,(e,t)=>{A.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===mn.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}let i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),qr=i(`$ZodEmoji`,(e,t)=>{t.pattern??=Mt(),A.init(e,t)}),Jr=i(`$ZodNanoID`,(e,t)=>{t.pattern??=Ut,A.init(e,t)}),Yr=i(`$ZodCUID`,(e,t)=>{t.pattern??=Rt,A.init(e,t)}),Xr=i(`$ZodCUID2`,(e,t)=>{t.pattern??=zt,A.init(e,t)}),Zr=i(`$ZodULID`,(e,t)=>{t.pattern??=Bt,A.init(e,t)}),Qr=i(`$ZodXID`,(e,t)=>{t.pattern??=Vt,A.init(e,t)}),$r=i(`$ZodKSUID`,(e,t)=>{t.pattern??=Ht,A.init(e,t)}),ei=i(`$ZodISODateTime`,(e,t)=>{t.pattern??=Ft(t),A.init(e,t)}),ti=i(`$ZodISODate`,(e,t)=>{t.pattern??=_n,A.init(e,t)}),ni=i(`$ZodISOTime`,(e,t)=>{t.pattern??=Pt(t),A.init(e,t)}),ri=i(`$ZodISODuration`,(e,t)=>{t.pattern??=Wt,A.init(e,t)}),ii=i(`$ZodIPv4`,(e,t)=>{t.pattern??=an,A.init(e,t),e._zod.bag.format=`ipv4`}),ai=i(`$ZodIPv6`,(e,t)=>{t.pattern??=on,A.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),oi=i(`$ZodMAC`,(e,t)=>{t.pattern??=sn(t.delimiter),A.init(e,t),e._zod.bag.format=`mac`}),si=i(`$ZodCIDRv4`,(e,t)=>{t.pattern??=cn,A.init(e,t)}),ci=i(`$ZodCIDRv6`,(e,t)=>{t.pattern??=ln,A.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}}),li=i(`$ZodBase64`,(e,t)=>{t.pattern??=un,A.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{vr(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),ui=i(`$ZodBase64URL`,(e,t)=>{t.pattern??=dn,A.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{yr(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),di=i(`$ZodE164`,(e,t)=>{t.pattern??=hn,A.init(e,t)}),fi=i(`$ZodJWT`,(e,t)=>{A.init(e,t),e._zod.check=n=>{br(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),pi=i(`$ZodCustomStringFormat`,(e,t)=>{A.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:`invalid_format`,format:t.format,input:n.value,inst:e,continue:!t.abort})}}),mi=i(`$ZodNumber`,(e,t)=>{k.init(e,t),e._zod.pattern=e._zod.bag.pattern??xn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),hi=i(`$ZodNumberFormat`,(e,t)=>{Yn.init(e,t),mi.init(e,t)}),gi=i(`$ZodBoolean`,(e,t)=>{k.init(e,t),e._zod.pattern=Sn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),_i=i(`$ZodBigInt`,(e,t)=>{k.init(e,t),e._zod.pattern=yn,e._zod.parse=(n,r)=>{if(t.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:e}),n}}),vi=i(`$ZodBigIntFormat`,(e,t)=>{Xn.init(e,t),_i.init(e,t)}),yi=i(`$ZodSymbol`,(e,t)=>{k.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return typeof r==`symbol`||t.issues.push({expected:`symbol`,code:`invalid_type`,input:r,inst:e}),t}}),bi=i(`$ZodUndefined`,(e,t)=>{k.init(e,t),e._zod.pattern=wn,e._zod.values=new Set([void 0]),e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`undefined`,code:`invalid_type`,input:r,inst:e}),t}}),xi=i(`$ZodNull`,(e,t)=>{k.init(e,t),e._zod.pattern=Cn,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),Si=i(`$ZodAny`,(e,t)=>{k.init(e,t),e._zod.parse=e=>e}),Ci=i(`$ZodUnknown`,(e,t)=>{k.init(e,t),e._zod.parse=e=>e}),wi=i(`$ZodNever`,(e,t)=>{k.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)}),Ti=i(`$ZodVoid`,(e,t)=>{k.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`void`,code:`invalid_type`,input:r,inst:e}),t}}),Ei=i(`$ZodDate`,(e,t)=>{k.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}let i=n.value,a=i instanceof Date;return a&&!Number.isNaN(i.getTime())||n.issues.push({expected:`date`,code:`invalid_type`,input:i,...a?{received:`Invalid Date`}:{},inst:e}),n}}),Di=i(`$ZodArray`,(e,t)=>{k.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>xr(t,n,e))):xr(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}}),Oi=i(`$ZodObject`,(e,t)=>{if(k.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,`shape`,{get:()=>{let n={...e};return Object.defineProperty(t,`shape`,{value:n}),n}})}let n=re(()=>Cr(t));b(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=pe,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optin===`optional`,i=n._zod.optout===`optional`,a=n._zod.run({value:s[e],issues:[]},o);a instanceof Promise?c.push(a.then(n=>Sr(n,t,e,s,r,i))):Sr(a,t,e,s,r,i)}return i?wr(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),ki=i(`$ZodObjectJIT`,(e,t)=>{Oi.init(e,t);let n=e._zod.parse,r=re(()=>Cr(t)),i=e=>{let t=new mr([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=de(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=de(r),s=e[r],c=s?._zod?.optin===`optional`,l=s?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),c&&l?t.write(`
1199
+ `))}}})),gr,_r=t((()=>{gr={major:4,minor:4,patch:3}}));function vr(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}function yr(e){if(!dn.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return vr(t.padEnd(Math.ceil(t.length/4)*4,`=`))}function br(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}function xr(e,t,n){e.issues.length&&t.issues.push(...ke(n,e.issues)),t.value[n]=e.value}function Sr(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...ke(n,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function Cr(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=ye(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function wr(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin===`optional`,d=c.optout===`optional`;for(let i in t){if(i===`__proto__`||s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Sr(e,n,i,t,u,d))):Sr(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}function Tr(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!De(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>je(e,r,a())))}),t)}function Er(e,t,n,r){let i=e.filter(e=>e.issues.length===0);return i.length===1?(t.value=i[0].value,t):(i.length===0?t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>je(e,r,a())))}):t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:[],inclusive:!1}),t)}function Dr(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(pe(e)&&pe(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=Dr(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Dr(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Or(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),De(e))return e;let o=Dr(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}function kr(e,t){for(let n=e.length-1;n>=0;n--)if(e[n]._zod[t]!==`optional`)return n+1;return 0}function Ar(e,t,n){e.issues.length&&t.issues.push(...ke(n,e.issues)),t.value[n]=e.value}function jr(e,t,n,r,i){for(let a=0;a<n.length;a++){let n=e[a],o=a<r.length;if(n.issues.length){if(!o&&a>=i){t.value.length=a;break}t.issues.push(...ke(a,n.issues))}t.value[a]=n.value}for(let e=t.value.length-1;e>=r.length&&n[e]._zod.optout===`optional`&&t.value[e]===void 0;e--)t.value.length=e;return t}function Mr(e,t,n,r,i,o,s){e.issues.length&&(Ke.has(typeof r)?n.issues.push(...ke(r,e.issues)):n.issues.push({code:`invalid_key`,origin:`map`,input:i,inst:o,issues:e.issues.map(e=>je(e,s,a()))})),t.issues.length&&(Ke.has(typeof r)?n.issues.push(...ke(r,t.issues)):n.issues.push({origin:`map`,code:`invalid_element`,input:i,inst:o,key:r,issues:t.issues.map(e=>je(e,s,a()))})),n.value.set(e.value,t.value)}function Nr(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}function Pr(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}function Fr(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}function Ir(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function Lr(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}function Rr(e,t,n){if(e.issues.length)return e.aborted=!0,e;if((n.direction||`forward`)===`forward`){let r=t.transform(e.value,e);return r instanceof Promise?r.then(r=>zr(e,r,t.out,n)):zr(e,r,t.out,n)}else{let r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(r=>zr(e,r,t.in,n)):zr(e,r,t.in,n)}}function zr(e,t,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},r)}function Br(e){return e.value=Object.freeze(e.value),e}function Vr(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Pe(e))}}var k,Hr,A,Ur,Wr,Gr,Kr,qr,Jr,Yr,Xr,Zr,Qr,$r,ei,ti,ni,ri,ii,ai,oi,si,ci,li,ui,di,fi,pi,mi,hi,gi,_i,vi,yi,bi,xi,Si,Ci,wi,Ti,Ei,Di,Oi,ki,Ai,ji,Mi,Ni,Pi,Fi,Ii,Li,Ri,zi,Bi,Vi,Hi,Ui,Wi,Gi,Ki,qi,Ji,Yi,Xi,Zi,Qi,$i,ea,ta,na,ra,ia,aa,oa=t((()=>{pr(),f(),hr(),At(),Un(),D(),_r(),k=i(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=gr;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=De(e),i;for(let a of t){if(a._zod.def.when){if(Oe(e)||!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new l;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=De(e,t))});else{if(e.issues.length===t)continue;r||=De(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(De(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new l;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new l;return o.then(e=>t(e,r,a))}return t(o,r,a)}}y(e,`~standard`,()=>({validate:t=>{try{let n=dt(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return pt(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),Hr=i(`$ZodString`,(e,t)=>{k.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??vn(e._zod.bag),e._zod.parse=(n,r)=>{if(t.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:e}),n}}),A=i(`$ZodStringFormat`,(e,t)=>{rr.init(e,t),Hr.init(e,t)}),Ur=i(`$ZodGUID`,(e,t)=>{t.pattern??=Kt,A.init(e,t)}),Wr=i(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=qt(e)}else t.pattern??=qt();A.init(e,t)}),Gr=i(`$ZodEmail`,(e,t)=>{t.pattern??=Zt,A.init(e,t)}),Kr=i(`$ZodURL`,(e,t)=>{A.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===mn.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}let i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),qr=i(`$ZodEmoji`,(e,t)=>{t.pattern??=Mt(),A.init(e,t)}),Jr=i(`$ZodNanoID`,(e,t)=>{t.pattern??=Ut,A.init(e,t)}),Yr=i(`$ZodCUID`,(e,t)=>{t.pattern??=Rt,A.init(e,t)}),Xr=i(`$ZodCUID2`,(e,t)=>{t.pattern??=zt,A.init(e,t)}),Zr=i(`$ZodULID`,(e,t)=>{t.pattern??=Bt,A.init(e,t)}),Qr=i(`$ZodXID`,(e,t)=>{t.pattern??=Vt,A.init(e,t)}),$r=i(`$ZodKSUID`,(e,t)=>{t.pattern??=Ht,A.init(e,t)}),ei=i(`$ZodISODateTime`,(e,t)=>{t.pattern??=Ft(t),A.init(e,t)}),ti=i(`$ZodISODate`,(e,t)=>{t.pattern??=_n,A.init(e,t)}),ni=i(`$ZodISOTime`,(e,t)=>{t.pattern??=Pt(t),A.init(e,t)}),ri=i(`$ZodISODuration`,(e,t)=>{t.pattern??=Wt,A.init(e,t)}),ii=i(`$ZodIPv4`,(e,t)=>{t.pattern??=an,A.init(e,t),e._zod.bag.format=`ipv4`}),ai=i(`$ZodIPv6`,(e,t)=>{t.pattern??=on,A.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),oi=i(`$ZodMAC`,(e,t)=>{t.pattern??=sn(t.delimiter),A.init(e,t),e._zod.bag.format=`mac`}),si=i(`$ZodCIDRv4`,(e,t)=>{t.pattern??=cn,A.init(e,t)}),ci=i(`$ZodCIDRv6`,(e,t)=>{t.pattern??=ln,A.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}}),li=i(`$ZodBase64`,(e,t)=>{t.pattern??=un,A.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{vr(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),ui=i(`$ZodBase64URL`,(e,t)=>{t.pattern??=dn,A.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{yr(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),di=i(`$ZodE164`,(e,t)=>{t.pattern??=hn,A.init(e,t)}),fi=i(`$ZodJWT`,(e,t)=>{A.init(e,t),e._zod.check=n=>{br(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),pi=i(`$ZodCustomStringFormat`,(e,t)=>{A.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:`invalid_format`,format:t.format,input:n.value,inst:e,continue:!t.abort})}}),mi=i(`$ZodNumber`,(e,t)=>{k.init(e,t),e._zod.pattern=e._zod.bag.pattern??xn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),hi=i(`$ZodNumberFormat`,(e,t)=>{Yn.init(e,t),mi.init(e,t)}),gi=i(`$ZodBoolean`,(e,t)=>{k.init(e,t),e._zod.pattern=Sn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),_i=i(`$ZodBigInt`,(e,t)=>{k.init(e,t),e._zod.pattern=yn,e._zod.parse=(n,r)=>{if(t.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:e}),n}}),vi=i(`$ZodBigIntFormat`,(e,t)=>{Xn.init(e,t),_i.init(e,t)}),yi=i(`$ZodSymbol`,(e,t)=>{k.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return typeof r==`symbol`||t.issues.push({expected:`symbol`,code:`invalid_type`,input:r,inst:e}),t}}),bi=i(`$ZodUndefined`,(e,t)=>{k.init(e,t),e._zod.pattern=wn,e._zod.values=new Set([void 0]),e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`undefined`,code:`invalid_type`,input:r,inst:e}),t}}),xi=i(`$ZodNull`,(e,t)=>{k.init(e,t),e._zod.pattern=Cn,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),Si=i(`$ZodAny`,(e,t)=>{k.init(e,t),e._zod.parse=e=>e}),Ci=i(`$ZodUnknown`,(e,t)=>{k.init(e,t),e._zod.parse=e=>e}),wi=i(`$ZodNever`,(e,t)=>{k.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)}),Ti=i(`$ZodVoid`,(e,t)=>{k.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`void`,code:`invalid_type`,input:r,inst:e}),t}}),Ei=i(`$ZodDate`,(e,t)=>{k.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}let i=n.value,a=i instanceof Date;return a&&!Number.isNaN(i.getTime())||n.issues.push({expected:`date`,code:`invalid_type`,input:i,...a?{received:`Invalid Date`}:{},inst:e}),n}}),Di=i(`$ZodArray`,(e,t)=>{k.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>xr(t,n,e))):xr(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}}),Oi=i(`$ZodObject`,(e,t)=>{if(k.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let n=v(()=>Cr(t));y(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=fe,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optin===`optional`,i=n._zod.optout===`optional`,a=n._zod.run({value:s[e],issues:[]},o);a instanceof Promise?c.push(a.then(n=>Sr(n,t,e,s,r,i))):Sr(a,t,e,s,r,i)}return i?wr(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),ki=i(`$ZodObjectJIT`,(e,t)=>{Oi.init(e,t);let n=e._zod.parse,r=v(()=>Cr(t)),i=e=>{let t=new mr([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=ue(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=ue(r),s=e[r],c=s?._zod?.optin===`optional`,l=s?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),c&&l?t.write(`
1200
1200
  if (${n}.issues.length) {
1201
1201
  if (${o} in input) {
1202
1202
  payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
@@ -1255,9 +1255,9 @@ SOFTWARE.
1255
1255
  }
1256
1256
  }
1257
1257
 
1258
- `)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=pe,s=!d.jitless,c=s&&We.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?wr([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}}),Ai=i(`$ZodUnion`,(e,t)=>{k.init(e,t),b(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),b(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),b(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),b(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>y(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>Tr(t,r,e,i)):Tr(o,r,e,i)}}),ji=i(`$ZodXor`,(e,t)=>{Ai.init(e,t),t.inclusive=!1;let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);t instanceof Promise?(o.push(t),a=!0):o.push(t)}return a?Promise.all(o).then(t=>Er(t,r,e,i)):Er(o,r,e,i)}}),Mi=i(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,Ai.init(e,t);let n=e._zod.parse;b(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=re(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!pe(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()),input:o,path:[t.discriminator],inst:e}),i)}}),Ni=i(`$ZodIntersection`,(e,t)=>{k.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Or(e,t,n)):Or(e,i,a)}}),Pi=i(`$ZodTuple`,(e,t)=>{k.init(e,t);let n=t.items;e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({input:a,inst:e,expected:`tuple`,code:`invalid_type`}),r;r.value=[];let o=[],s=kr(n,`optin`),c=kr(n,`optout`);if(!t.rest){if(a.length<s)return r.issues.push({code:`too_small`,minimum:s,inclusive:!0,input:a,inst:e,origin:`array`}),r;a.length>n.length&&r.issues.push({code:`too_big`,maximum:n.length,inclusive:!0,input:a,inst:e,origin:`array`})}let l=Array(n.length);for(let e=0;e<n.length;e++){let t=n[e]._zod.run({value:a[e],issues:[]},i);t instanceof Promise?o.push(t.then(t=>{l[e]=t})):l[e]=t}if(t.rest){let e=n.length-1,s=a.slice(n.length);for(let n of s){e++;let a=t.rest._zod.run({value:n,issues:[]},i);a instanceof Promise?o.push(a.then(t=>Ar(t,r,e))):Ar(a,r,e)}}return o.length?Promise.all(o).then(()=>jr(l,r,n,a,c)):jr(l,r,n,a,c)}}),Fi=i(`$ZodRecord`,(e,t)=>{k.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!me(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let o=[],s=t.keyType._zod.values;if(s){n.value={};let c=new Set;for(let l of s)if(typeof l==`string`||typeof l==`number`||typeof l==`symbol`){c.add(typeof l==`number`?l.toString():l);let s=t.keyType._zod.run({value:l,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>je(e,r,a())),input:l,path:[l],inst:e});continue}let u=s.value,d=t.valueType._zod.run({value:i[l],issues:[]},r);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&n.issues.push(...ke(l,e.issues)),n.value[u]=e.value})):(d.issues.length&&n.issues.push(...ke(l,d.issues)),n.value[u]=d.value)}let l;for(let e in i)c.has(e)||(l??=[],l.push(e));l&&l.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:l})}else{n.value={};for(let s of Reflect.ownKeys(i)){if(s===`__proto__`||!Object.prototype.propertyIsEnumerable.call(i,s))continue;let c=t.keyType._zod.run({value:s,issues:[]},r);if(c instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof s==`string`&&xn.test(s)&&c.issues.length){let e=t.keyType._zod.run({value:Number(s),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(c=e)}if(c.issues.length){t.mode===`loose`?n.value[s]=i[s]:n.issues.push({code:`invalid_key`,origin:`record`,issues:c.issues.map(e=>je(e,r,a())),input:s,path:[s],inst:e});continue}let l=t.valueType._zod.run({value:i[s],issues:[]},r);l instanceof Promise?o.push(l.then(e=>{e.issues.length&&n.issues.push(...ke(s,e.issues)),n.value[c.value]=e.value})):(l.issues.length&&n.issues.push(...ke(s,l.issues)),n.value[c.value]=l.value)}}return o.length?Promise.all(o).then(()=>n):n}}),Ii=i(`$ZodMap`,(e,t)=>{k.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!(i instanceof Map))return n.issues.push({expected:`map`,code:`invalid_type`,input:i,inst:e}),n;let a=[];n.value=new Map;for(let[o,s]of i){let c=t.keyType._zod.run({value:o,issues:[]},r),l=t.valueType._zod.run({value:s,issues:[]},r);c instanceof Promise||l instanceof Promise?a.push(Promise.all([c,l]).then(([t,a])=>{Mr(t,a,n,o,i,e,r)})):Mr(c,l,n,o,i,e,r)}return a.length?Promise.all(a).then(()=>n):n}}),Li=i(`$ZodSet`,(e,t)=>{k.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!(i instanceof Set))return n.issues.push({input:i,inst:e,expected:`set`,code:`invalid_type`}),n;let a=[];n.value=new Set;for(let e of i){let i=t.valueType._zod.run({value:e,issues:[]},r);i instanceof Promise?a.push(i.then(e=>Nr(e,n))):Nr(i,n)}return a.length?Promise.all(a).then(()=>n):n}}),Ri=i(`$ZodEnum`,(e,t)=>{k.init(e,t);let n=te(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>Ke.has(typeof e)).map(e=>typeof e==`string`?ge(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),zi=i(`$ZodLiteral`,(e,t)=>{if(k.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?ge(e):e?ge(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),Bi=i(`$ZodFile`,(e,t)=>{k.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return r instanceof File||t.issues.push({expected:`file`,code:`invalid_type`,input:r,inst:e}),t}}),Vi=i(`$ZodTransform`,(e,t)=>{k.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new u(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n.fallback=!0,n));if(i instanceof Promise)throw new l;return n.value=i,n.fallback=!0,n}}),Hi=i(`$ZodOptional`,(e,t)=>{k.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,b(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),b(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${y(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>Pr(e,r)):Pr(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Ui=i(`$ZodExactOptional`,(e,t)=>{Hi.init(e,t),b(e._zod,`values`,()=>t.innerType._zod.values),b(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Wi=i(`$ZodNullable`,(e,t)=>{k.init(e,t),b(e._zod,`optin`,()=>t.innerType._zod.optin),b(e._zod,`optout`,()=>t.innerType._zod.optout),b(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${y(e.source)}|null)$`):void 0}),b(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Gi=i(`$ZodDefault`,(e,t)=>{k.init(e,t),e._zod.optin=`optional`,b(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Fr(e,t)):Fr(r,t)}}),Ki=i(`$ZodPrefault`,(e,t)=>{k.init(e,t),e._zod.optin=`optional`,b(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),qi=i(`$ZodNonOptional`,(e,t)=>{k.init(e,t),b(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Ir(t,e)):Ir(i,e)}}),Ji=i(`$ZodSuccess`,(e,t)=>{k.init(e,t),e._zod.parse=(e,n)=>{if(n.direction===`backward`)throw new u(`ZodSuccess`);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>(e.value=t.issues.length===0,e)):(e.value=r.issues.length===0,e)}}),Yi=i(`$ZodCatch`,(e,t)=>{k.init(e,t),e._zod.optin=`optional`,b(e._zod,`optout`,()=>t.innerType._zod.optout),b(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>je(e,n,a()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>je(e,n,a()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),Xi=i(`$ZodNaN`,(e,t)=>{k.init(e,t),e._zod.parse=(t,n)=>((typeof t.value!=`number`||!Number.isNaN(t.value))&&t.issues.push({input:t.value,inst:e,expected:`nan`,code:`invalid_type`}),t)}),Zi=i(`$ZodPipe`,(e,t)=>{k.init(e,t),b(e._zod,`values`,()=>t.in._zod.values),b(e._zod,`optin`,()=>t.in._zod.optin),b(e._zod,`optout`,()=>t.out._zod.optout),b(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Lr(e,t.in,n)):Lr(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Lr(e,t.out,n)):Lr(r,t.out,n)}}),Qi=i(`$ZodCodec`,(e,t)=>{k.init(e,t),b(e._zod,`values`,()=>t.in._zod.values),b(e._zod,`optin`,()=>t.in._zod.optin),b(e._zod,`optout`,()=>t.out._zod.optout),b(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if((n.direction||`forward`)===`forward`){let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Rr(e,t,n)):Rr(r,t,n)}else{let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Rr(e,t,n)):Rr(r,t,n)}}}),$i=i(`$ZodPreprocess`,(e,t)=>{Zi.init(e,t)}),ea=i(`$ZodReadonly`,(e,t)=>{k.init(e,t),b(e._zod,`propValues`,()=>t.innerType._zod.propValues),b(e._zod,`values`,()=>t.innerType._zod.values),b(e._zod,`optin`,()=>t.innerType?._zod?.optin),b(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Br):Br(r)}}),ta=i(`$ZodTemplateLiteral`,(e,t)=>{k.init(e,t);let n=[];for(let e of t.parts)if(typeof e==`object`&&e){if(!e._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...e._zod.traits].shift()}`);let t=e._zod.pattern instanceof RegExp?e._zod.pattern.source:e._zod.pattern;if(!t)throw Error(`Invalid template literal part: ${e._zod.traits}`);let r=+!!t.startsWith(`^`),i=t.endsWith(`$`)?t.length-1:t.length;n.push(t.slice(r,i))}else if(e===null||qe.has(typeof e))n.push(ge(`${e}`));else throw Error(`Invalid template literal part: ${e}`);e._zod.pattern=RegExp(`^${n.join(``)}$`),e._zod.parse=(n,r)=>typeof n.value==`string`?(e._zod.pattern.lastIndex=0,e._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:e,code:`invalid_format`,format:t.format??`template_literal`,pattern:e._zod.pattern.source}),n):(n.issues.push({input:n.value,inst:e,expected:`string`,code:`invalid_type`}),n)}),na=i(`$ZodFunction`,(e,t)=>(k.init(e,t),e._def=t,e._zod.def=t,e.implement=t=>{if(typeof t!=`function`)throw Error(`implement() must be called with a function`);return function(...n){let r=e._def.input?st(e._def.input,n):n,i=Reflect.apply(t,this,r);return e._def.output?st(e._def.output,i):i}},e.implementAsync=t=>{if(typeof t!=`function`)throw Error(`implementAsync() must be called with a function`);return async function(...n){let r=e._def.input?await lt(e._def.input,n):n,i=await Reflect.apply(t,this,r);return e._def.output?await lt(e._def.output,i):i}},e._zod.parse=(t,n)=>typeof t.value==`function`?(e._def.output&&e._def.output._zod.def.type===`promise`?t.value=e.implementAsync(t.value):t.value=e.implement(t.value),t):(t.issues.push({code:`invalid_type`,expected:`function`,input:t.value,inst:e}),t),e.input=(...t)=>{let n=e.constructor;return Array.isArray(t[0])?new n({type:`function`,input:new Pi({type:`tuple`,items:t[0],rest:t[1]}),output:e._def.output}):new n({type:`function`,input:t[0],output:e._def.output})},e.output=t=>{let n=e.constructor;return new n({type:`function`,input:e._def.input,output:t})},e)),ra=i(`$ZodPromise`,(e,t)=>{k.init(e,t),e._zod.parse=(e,n)=>Promise.resolve(e.value).then(e=>t.innerType._zod.run({value:e,issues:[]},n))}),ia=i(`$ZodLazy`,(e,t)=>{k.init(e,t),b(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),b(e._zod,`pattern`,()=>e._zod.innerType?._zod?.pattern),b(e._zod,`propValues`,()=>e._zod.innerType?._zod?.propValues),b(e._zod,`optin`,()=>e._zod.innerType?._zod?.optin??void 0),b(e._zod,`optout`,()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),aa=i(`$ZodCustom`,(e,t)=>{O.init(e,t),k.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Vr(t,n,r,e));Vr(i,n,r,e)}})}));function sa(){return{localeError:ca()}}var ca,la=t((()=>{D(),ca=()=>{let e={string:{unit:`حرف`,verb:`أن يحوي`},file:{unit:`بايت`,verb:`أن يحوي`},array:{unit:`عنصر`,verb:`أن يحوي`},set:{unit:`عنصر`,verb:`أن يحوي`}};function t(t){return e[t]??null}let 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:`مدخل`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`مدخلات غير مقبولة: يفترض إدخال instanceof ${e.expected}، ولكن تم إدخال ${i}`:`مدخلات غير مقبولة: يفترض إدخال ${t}، ولكن تم إدخال ${i}`}case`invalid_value`:return e.values.length===1?`مدخلات غير مقبولة: يفترض إدخال ${T(e.values[0])}`:`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${v(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?` أكبر من اللازم: يفترض أن تكون ${e.origin??`القيمة`} ${n} ${e.maximum.toString()} ${r.unit??`عنصر`}`:`أكبر من اللازم: يفترض أن تكون ${e.origin??`القيمة`} ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`أصغر من اللازم: يفترض لـ ${e.origin} أن يكون ${n} ${e.minimum.toString()} ${r.unit}`:`أصغر من اللازم: يفترض لـ ${e.origin} أن يكون ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`نَص غير مقبول: يجب أن يبدأ بـ "${e.prefix}"`:t.format===`ends_with`?`نَص غير مقبول: يجب أن ينتهي بـ "${t.suffix}"`:t.format===`includes`?`نَص غير مقبول: يجب أن يتضمَّن "${t.includes}"`:t.format===`regex`?`نَص غير مقبول: يجب أن يطابق النمط ${t.pattern}`:`${n[t.format]??e.format} غير مقبول`}case`not_multiple_of`:return`رقم غير مقبول: يجب أن يكون من مضاعفات ${e.divisor}`;case`unrecognized_keys`:return`معرف${e.keys.length>1?`ات`:``} غريب${e.keys.length>1?`ة`:``}: ${v(e.keys,`، `)}`;case`invalid_key`:return`معرف غير مقبول في ${e.origin}`;case`invalid_union`:return`مدخل غير مقبول`;case`invalid_element`:return`مدخل غير مقبول في ${e.origin}`;default:return`مدخل غير مقبول`}}}}));function ua(){return{localeError:da()}}var da,fa=t((()=>{D(),da=()=>{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(t){return e[t]??null}let 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`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Yanlış dəyər: gözlənilən instanceof ${e.expected}, daxil olan ${i}`:`Yanlış dəyər: gözlənilən ${t}, daxil olan ${i}`}case`invalid_value`:return e.values.length===1?`Yanlış dəyər: gözlənilən ${T(e.values[0])}`:`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${v(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Çox böyük: gözlənilən ${e.origin??`dəyər`} ${n}${e.maximum.toString()} ${r.unit??`element`}`:`Çox böyük: gözlənilən ${e.origin??`dəyər`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Çox kiçik: gözlənilən ${e.origin} ${n}${e.minimum.toString()} ${r.unit}`:`Çox kiçik: gözlənilən ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Yanlış mətn: "${t.prefix}" ilə başlamalıdır`:t.format===`ends_with`?`Yanlış mətn: "${t.suffix}" ilə bitməlidir`:t.format===`includes`?`Yanlış mətn: "${t.includes}" daxil olmalıdır`:t.format===`regex`?`Yanlış mətn: ${t.pattern} şablonuna uyğun olmalıdır`:`Yanlış ${n[t.format]??e.format}`}case`not_multiple_of`:return`Yanlış ədəd: ${e.divisor} ilə bölünə bilən olmalıdır`;case`unrecognized_keys`:return`Tanınmayan açar${e.keys.length>1?`lar`:``}: ${v(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} daxilində yanlış açar`;case`invalid_union`:return`Yanlış dəyər`;case`invalid_element`:return`${e.origin} daxilində yanlış dəyər`;default:return`Yanlış dəyər`}}}}));function pa(e,t,n,r){let i=Math.abs(e),a=i%10,o=i%100;return o>=11&&o<=19?r:a===1?t:a>=2&&a<=4?n:r}function ma(){return{localeError:ha()}}var ha,ga=t((()=>{D(),ha=()=>{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(t){return e[t]??null}let 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:`увод`},r={nan:`NaN`,number:`лік`,array:`масіў`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Няправільны ўвод: чакаўся instanceof ${e.expected}, атрымана ${i}`:`Няправільны ўвод: чакаўся ${t}, атрымана ${i}`}case`invalid_value`:return e.values.length===1?`Няправільны ўвод: чакалася ${T(e.values[0])}`:`Няправільны варыянт: чакаўся адзін з ${v(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);if(r){let t=pa(Number(e.maximum),r.unit.one,r.unit.few,r.unit.many);return`Занадта вялікі: чакалася, што ${e.origin??`значэнне`} павінна ${r.verb} ${n}${e.maximum.toString()} ${t}`}return`Занадта вялікі: чакалася, што ${e.origin??`значэнне`} павінна быць ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);if(r){let t=pa(Number(e.minimum),r.unit.one,r.unit.few,r.unit.many);return`Занадта малы: чакалася, што ${e.origin} павінна ${r.verb} ${n}${e.minimum.toString()} ${t}`}return`Занадта малы: чакалася, што ${e.origin} павінна быць ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Няправільны радок: павінен пачынацца з "${t.prefix}"`:t.format===`ends_with`?`Няправільны радок: павінен заканчвацца на "${t.suffix}"`:t.format===`includes`?`Няправільны радок: павінен змяшчаць "${t.includes}"`:t.format===`regex`?`Няправільны радок: павінен адпавядаць шаблону ${t.pattern}`:`Няправільны ${n[t.format]??e.format}`}case`not_multiple_of`:return`Няправільны лік: павінен быць кратным ${e.divisor}`;case`unrecognized_keys`:return`Нераспазнаны ${e.keys.length>1?`ключы`:`ключ`}: ${v(e.keys,`, `)}`;case`invalid_key`:return`Няправільны ключ у ${e.origin}`;case`invalid_union`:return`Няправільны ўвод`;case`invalid_element`:return`Няправільнае значэнне ў ${e.origin}`;default:return`Няправільны ўвод`}}}}));function _a(){return{localeError:va()}}var va,ya=t((()=>{D(),va=()=>{let e={string:{unit:`символа`,verb:`да съдържа`},file:{unit:`байта`,verb:`да съдържа`},array:{unit:`елемента`,verb:`да съдържа`},set:{unit:`елемента`,verb:`да съдържа`}};function t(t){return e[t]??null}let 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:`вход`},r={nan:`NaN`,number:`число`,array:`масив`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Невалиден вход: очакван instanceof ${e.expected}, получен ${i}`:`Невалиден вход: очакван ${t}, получен ${i}`}case`invalid_value`:return e.values.length===1?`Невалиден вход: очакван ${T(e.values[0])}`:`Невалидна опция: очаквано едно от ${v(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Твърде голямо: очаква се ${e.origin??`стойност`} да съдържа ${n}${e.maximum.toString()} ${r.unit??`елемента`}`:`Твърде голямо: очаква се ${e.origin??`стойност`} да бъде ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Твърде малко: очаква се ${e.origin} да съдържа ${n}${e.minimum.toString()} ${r.unit}`:`Твърде малко: очаква се ${e.origin} да бъде ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;if(t.format===`starts_with`)return`Невалиден низ: трябва да започва с "${t.prefix}"`;if(t.format===`ends_with`)return`Невалиден низ: трябва да завършва с "${t.suffix}"`;if(t.format===`includes`)return`Невалиден низ: трябва да включва "${t.includes}"`;if(t.format===`regex`)return`Невалиден низ: трябва да съвпада с ${t.pattern}`;let r=`Невалиден`;return t.format===`emoji`&&(r=`Невалидно`),t.format===`datetime`&&(r=`Невалидно`),t.format===`date`&&(r=`Невалидна`),t.format===`time`&&(r=`Невалидно`),t.format===`duration`&&(r=`Невалидна`),`${r} ${n[t.format]??e.format}`}case`not_multiple_of`:return`Невалидно число: трябва да бъде кратно на ${e.divisor}`;case`unrecognized_keys`:return`Неразпознат${e.keys.length>1?`и`:``} ключ${e.keys.length>1?`ове`:``}: ${v(e.keys,`, `)}`;case`invalid_key`:return`Невалиден ключ в ${e.origin}`;case`invalid_union`:return`Невалиден вход`;case`invalid_element`:return`Невалидна стойност в ${e.origin}`;default:return`Невалиден вход`}}}}));function ba(){return{localeError:xa()}}var xa,Sa=t((()=>{D(),xa=()=>{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(t){return e[t]??null}let 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`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Tipus invàlid: s'esperava instanceof ${e.expected}, s'ha rebut ${i}`:`Tipus invàlid: s'esperava ${t}, s'ha rebut ${i}`}case`invalid_value`:return e.values.length===1?`Valor invàlid: s'esperava ${T(e.values[0])}`:`Opció invàlida: s'esperava una de ${v(e.values,` o `)}`;case`too_big`:{let n=e.inclusive?`com a màxim`:`menys de`,r=t(e.origin);return r?`Massa gran: s'esperava que ${e.origin??`el valor`} contingués ${n} ${e.maximum.toString()} ${r.unit??`elements`}`:`Massa gran: s'esperava que ${e.origin??`el valor`} fos ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`com a mínim`:`més de`,r=t(e.origin);return r?`Massa petit: s'esperava que ${e.origin} contingués ${n} ${e.minimum.toString()} ${r.unit}`:`Massa petit: s'esperava que ${e.origin} fos ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Format invàlid: ha de començar amb "${t.prefix}"`:t.format===`ends_with`?`Format invàlid: ha d'acabar amb "${t.suffix}"`:t.format===`includes`?`Format invàlid: ha d'incloure "${t.includes}"`:t.format===`regex`?`Format invàlid: ha de coincidir amb el patró ${t.pattern}`:`Format invàlid per a ${n[t.format]??e.format}`}case`not_multiple_of`:return`Número invàlid: ha de ser múltiple de ${e.divisor}`;case`unrecognized_keys`:return`Clau${e.keys.length>1?`s`:``} no reconeguda${e.keys.length>1?`s`:``}: ${v(e.keys,`, `)}`;case`invalid_key`:return`Clau invàlida a ${e.origin}`;case`invalid_union`:return`Entrada invàlida`;case`invalid_element`:return`Element invàlid a ${e.origin}`;default:return`Entrada invàlida`}}}}));function Ca(){return{localeError:wa()}}var wa,Ta=t((()=>{D(),wa=()=>{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(t){return e[t]??null}let 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`},r={nan:`NaN`,number:`číslo`,string:`řetězec`,function:`funkce`,array:`pole`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Neplatný vstup: očekáváno instanceof ${e.expected}, obdrženo ${i}`:`Neplatný vstup: očekáváno ${t}, obdrženo ${i}`}case`invalid_value`:return e.values.length===1?`Neplatný vstup: očekáváno ${T(e.values[0])}`:`Neplatná možnost: očekávána jedna z hodnot ${v(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Hodnota je příliš velká: ${e.origin??`hodnota`} musí mít ${n}${e.maximum.toString()} ${r.unit??`prvků`}`:`Hodnota je příliš velká: ${e.origin??`hodnota`} musí být ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Hodnota je příliš malá: ${e.origin??`hodnota`} musí mít ${n}${e.minimum.toString()} ${r.unit??`prvků`}`:`Hodnota je příliš malá: ${e.origin??`hodnota`} musí být ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Neplatný řetězec: musí začínat na "${t.prefix}"`:t.format===`ends_with`?`Neplatný řetězec: musí končit na "${t.suffix}"`:t.format===`includes`?`Neplatný řetězec: musí obsahovat "${t.includes}"`:t.format===`regex`?`Neplatný řetězec: musí odpovídat vzoru ${t.pattern}`:`Neplatný formát ${n[t.format]??e.format}`}case`not_multiple_of`:return`Neplatné číslo: musí být násobkem ${e.divisor}`;case`unrecognized_keys`:return`Neznámé klíče: ${v(e.keys,`, `)}`;case`invalid_key`:return`Neplatný klíč v ${e.origin}`;case`invalid_union`:return`Neplatný vstup`;case`invalid_element`:return`Neplatná hodnota v ${e.origin}`;default:return`Neplatný vstup`}}}}));function Ea(){return{localeError:Da()}}var Da,Oa=t((()=>{D(),Da=()=>{let e={string:{unit:`tegn`,verb:`havde`},file:{unit:`bytes`,verb:`havde`},array:{unit:`elementer`,verb:`indeholdt`},set:{unit:`elementer`,verb:`indeholdt`}};function t(t){return e[t]??null}let 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`},r={nan:`NaN`,string:`streng`,number:`tal`,boolean:`boolean`,array:`liste`,object:`objekt`,set:`sæt`,file:`fil`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ugyldigt input: forventede instanceof ${e.expected}, fik ${i}`:`Ugyldigt input: forventede ${t}, fik ${i}`}case`invalid_value`:return e.values.length===1?`Ugyldig værdi: forventede ${T(e.values[0])}`:`Ugyldigt valg: forventede en af følgende ${v(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,i=t(e.origin),a=r[e.origin]??e.origin;return i?`For stor: forventede ${a??`value`} ${i.verb} ${n} ${e.maximum.toString()} ${i.unit??`elementer`}`:`For stor: forventede ${a??`value`} havde ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,i=t(e.origin),a=r[e.origin]??e.origin;return i?`For lille: forventede ${a} ${i.verb} ${n} ${e.minimum.toString()} ${i.unit}`:`For lille: forventede ${a} havde ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ugyldig streng: skal starte med "${t.prefix}"`:t.format===`ends_with`?`Ugyldig streng: skal ende med "${t.suffix}"`:t.format===`includes`?`Ugyldig streng: skal indeholde "${t.includes}"`:t.format===`regex`?`Ugyldig streng: skal matche mønsteret ${t.pattern}`:`Ugyldig ${n[t.format]??e.format}`}case`not_multiple_of`:return`Ugyldigt tal: skal være deleligt med ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Ukendte nøgler`:`Ukendt nøgle`}: ${v(e.keys,`, `)}`;case`invalid_key`:return`Ugyldig nøgle i ${e.origin}`;case`invalid_union`:return`Ugyldigt input: matcher ingen af de tilladte typer`;case`invalid_element`:return`Ugyldig værdi i ${e.origin}`;default:return`Ugyldigt input`}}}}));function ka(){return{localeError:Aa()}}var Aa,ja=t((()=>{D(),Aa=()=>{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(t){return e[t]??null}let 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`},r={nan:`NaN`,number:`Zahl`,array:`Array`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ungültige Eingabe: erwartet instanceof ${e.expected}, erhalten ${i}`:`Ungültige Eingabe: erwartet ${t}, erhalten ${i}`}case`invalid_value`:return e.values.length===1?`Ungültige Eingabe: erwartet ${T(e.values[0])}`:`Ungültige Option: erwartet eine von ${v(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Zu groß: erwartet, dass ${e.origin??`Wert`} ${n}${e.maximum.toString()} ${r.unit??`Elemente`} hat`:`Zu groß: erwartet, dass ${e.origin??`Wert`} ${n}${e.maximum.toString()} ist`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Zu klein: erwartet, dass ${e.origin} ${n}${e.minimum.toString()} ${r.unit} hat`:`Zu klein: erwartet, dass ${e.origin} ${n}${e.minimum.toString()} ist`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ungültiger String: muss mit "${t.prefix}" beginnen`:t.format===`ends_with`?`Ungültiger String: muss mit "${t.suffix}" enden`:t.format===`includes`?`Ungültiger String: muss "${t.includes}" enthalten`:t.format===`regex`?`Ungültiger String: muss dem Muster ${t.pattern} entsprechen`:`Ungültig: ${n[t.format]??e.format}`}case`not_multiple_of`:return`Ungültige Zahl: muss ein Vielfaches von ${e.divisor} sein`;case`unrecognized_keys`:return`${e.keys.length>1?`Unbekannte Schlüssel`:`Unbekannter Schlüssel`}: ${v(e.keys,`, `)}`;case`invalid_key`:return`Ungültiger Schlüssel in ${e.origin}`;case`invalid_union`:return`Ungültige Eingabe`;case`invalid_element`:return`Ungültiger Wert in ${e.origin}`;default:return`Ungültige Eingabe`}}}}));function Ma(){return{localeError:Na()}}var Na,Pa=t((()=>{D(),Na=()=>{let e={string:{unit:`χαρακτήρες`,verb:`να έχει`},file:{unit:`bytes`,verb:`να έχει`},array:{unit:`στοιχεία`,verb:`να έχει`},set:{unit:`στοιχεία`,verb:`να έχει`},map:{unit:`καταχωρήσεις`,verb:`να έχει`}};function t(t){return e[t]??null}let 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:`είσοδος`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return typeof e.expected==`string`&&/^[A-Z]/.test(e.expected)?`Μη έγκυρη είσοδος: αναμενόταν instanceof ${e.expected}, λήφθηκε ${i}`:`Μη έγκυρη είσοδος: αναμενόταν ${t}, λήφθηκε ${i}`}case`invalid_value`:return e.values.length===1?`Μη έγκυρη είσοδος: αναμενόταν ${T(e.values[0])}`:`Μη έγκυρη επιλογή: αναμενόταν ένα από ${v(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Πολύ μεγάλο: αναμενόταν ${e.origin??`τιμή`} να έχει ${n}${e.maximum.toString()} ${r.unit??`στοιχεία`}`:`Πολύ μεγάλο: αναμενόταν ${e.origin??`τιμή`} να είναι ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Πολύ μικρό: αναμενόταν ${e.origin} να έχει ${n}${e.minimum.toString()} ${r.unit}`:`Πολύ μικρό: αναμενόταν ${e.origin} να είναι ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Μη έγκυρη συμβολοσειρά: πρέπει να ξεκινά με "${t.prefix}"`:t.format===`ends_with`?`Μη έγκυρη συμβολοσειρά: πρέπει να τελειώνει με "${t.suffix}"`:t.format===`includes`?`Μη έγκυρη συμβολοσειρά: πρέπει να περιέχει "${t.includes}"`:t.format===`regex`?`Μη έγκυρη συμβολοσειρά: πρέπει να ταιριάζει με το μοτίβο ${t.pattern}`:`Μη έγκυρο: ${n[t.format]??e.format}`}case`not_multiple_of`:return`Μη έγκυρος αριθμός: πρέπει να είναι πολλαπλάσιο του ${e.divisor}`;case`unrecognized_keys`:return`Άγνωστ${e.keys.length>1?`α`:`ο`} κλειδ${e.keys.length>1?`ιά`:`ί`}: ${v(e.keys,`, `)}`;case`invalid_key`:return`Μη έγκυρο κλειδί στο ${e.origin}`;case`invalid_union`:return`Μη έγκυρη είσοδος`;case`invalid_element`:return`Μη έγκυρη τιμή στο ${e.origin}`;default:return`Μη έγκυρη είσοδος`}}}}));function Fa(){return{localeError:Ia()}}var Ia,La=t((()=>{D(),Ia=()=>{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(t){return e[t]??null}let 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`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input);return`Invalid input: expected ${t}, received ${r[n]??n}`}case`invalid_value`:return e.values.length===1?`Invalid input: expected ${T(e.values[0])}`:`Invalid option: expected one of ${v(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${v(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}}}));function Ra(){return{localeError:za()}}var za,Ba=t((()=>{D(),za=()=>{let e={string:{unit:`karaktrojn`,verb:`havi`},file:{unit:`bajtojn`,verb:`havi`},array:{unit:`elementojn`,verb:`havi`},set:{unit:`elementojn`,verb:`havi`}};function t(t){return e[t]??null}let 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`},r={nan:`NaN`,number:`nombro`,array:`tabelo`,null:`senvalora`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Nevalida enigo: atendiĝis instanceof ${e.expected}, riceviĝis ${i}`:`Nevalida enigo: atendiĝis ${t}, riceviĝis ${i}`}case`invalid_value`:return e.values.length===1?`Nevalida enigo: atendiĝis ${T(e.values[0])}`:`Nevalida opcio: atendiĝis unu el ${v(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Tro granda: atendiĝis ke ${e.origin??`valoro`} havu ${n}${e.maximum.toString()} ${r.unit??`elementojn`}`:`Tro granda: atendiĝis ke ${e.origin??`valoro`} havu ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Tro malgranda: atendiĝis ke ${e.origin} havu ${n}${e.minimum.toString()} ${r.unit}`:`Tro malgranda: atendiĝis ke ${e.origin} estu ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Nevalida karaktraro: devas komenciĝi per "${t.prefix}"`:t.format===`ends_with`?`Nevalida karaktraro: devas finiĝi per "${t.suffix}"`:t.format===`includes`?`Nevalida karaktraro: devas inkluzivi "${t.includes}"`:t.format===`regex`?`Nevalida karaktraro: devas kongrui kun la modelo ${t.pattern}`:`Nevalida ${n[t.format]??e.format}`}case`not_multiple_of`:return`Nevalida nombro: devas esti oblo de ${e.divisor}`;case`unrecognized_keys`:return`Nekonata${e.keys.length>1?`j`:``} ŝlosilo${e.keys.length>1?`j`:``}: ${v(e.keys,`, `)}`;case`invalid_key`:return`Nevalida ŝlosilo en ${e.origin}`;case`invalid_union`:return`Nevalida enigo`;case`invalid_element`:return`Nevalida valoro en ${e.origin}`;default:return`Nevalida enigo`}}}}));function Va(){return{localeError:Ha()}}var Ha,Ua=t((()=>{D(),Ha=()=>{let e={string:{unit:`caracteres`,verb:`tener`},file:{unit:`bytes`,verb:`tener`},array:{unit:`elementos`,verb:`tener`},set:{unit:`elementos`,verb:`tener`}};function t(t){return e[t]??null}let 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`},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 e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Entrada inválida: se esperaba instanceof ${e.expected}, recibido ${i}`:`Entrada inválida: se esperaba ${t}, recibido ${i}`}case`invalid_value`:return e.values.length===1?`Entrada inválida: se esperaba ${T(e.values[0])}`:`Opción inválida: se esperaba una de ${v(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,i=t(e.origin),a=r[e.origin]??e.origin;return i?`Demasiado grande: se esperaba que ${a??`valor`} tuviera ${n}${e.maximum.toString()} ${i.unit??`elementos`}`:`Demasiado grande: se esperaba que ${a??`valor`} fuera ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,i=t(e.origin),a=r[e.origin]??e.origin;return i?`Demasiado pequeño: se esperaba que ${a} tuviera ${n}${e.minimum.toString()} ${i.unit}`:`Demasiado pequeño: se esperaba que ${a} fuera ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Cadena inválida: debe comenzar con "${t.prefix}"`:t.format===`ends_with`?`Cadena inválida: debe terminar en "${t.suffix}"`:t.format===`includes`?`Cadena inválida: debe incluir "${t.includes}"`:t.format===`regex`?`Cadena inválida: debe coincidir con el patrón ${t.pattern}`:`Inválido ${n[t.format]??e.format}`}case`not_multiple_of`:return`Número inválido: debe ser múltiplo de ${e.divisor}`;case`unrecognized_keys`:return`Llave${e.keys.length>1?`s`:``} desconocida${e.keys.length>1?`s`:``}: ${v(e.keys,`, `)}`;case`invalid_key`:return`Llave inválida en ${r[e.origin]??e.origin}`;case`invalid_union`:return`Entrada inválida`;case`invalid_element`:return`Valor inválido en ${r[e.origin]??e.origin}`;default:return`Entrada inválida`}}}}));function Wa(){return{localeError:Ga()}}var Ga,Ka=t((()=>{D(),Ga=()=>{let e={string:{unit:`کاراکتر`,verb:`داشته باشد`},file:{unit:`بایت`,verb:`داشته باشد`},array:{unit:`آیتم`,verb:`داشته باشد`},set:{unit:`آیتم`,verb:`داشته باشد`}};function t(t){return e[t]??null}let 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:`ورودی`},r={nan:`NaN`,number:`عدد`,array:`آرایه`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`ورودی نامعتبر: می‌بایست instanceof ${e.expected} می‌بود، ${i} دریافت شد`:`ورودی نامعتبر: می‌بایست ${t} می‌بود، ${i} دریافت شد`}case`invalid_value`:return e.values.length===1?`ورودی نامعتبر: می‌بایست ${T(e.values[0])} می‌بود`:`گزینه نامعتبر: می‌بایست یکی از ${v(e.values,`|`)} می‌بود`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`خیلی بزرگ: ${e.origin??`مقدار`} باید ${n}${e.maximum.toString()} ${r.unit??`عنصر`} باشد`:`خیلی بزرگ: ${e.origin??`مقدار`} باید ${n}${e.maximum.toString()} باشد`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`خیلی کوچک: ${e.origin} باید ${n}${e.minimum.toString()} ${r.unit} باشد`:`خیلی کوچک: ${e.origin} باید ${n}${e.minimum.toString()} باشد`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`رشته نامعتبر: باید با "${t.prefix}" شروع شود`:t.format===`ends_with`?`رشته نامعتبر: باید با "${t.suffix}" تمام شود`:t.format===`includes`?`رشته نامعتبر: باید شامل "${t.includes}" باشد`:t.format===`regex`?`رشته نامعتبر: باید با الگوی ${t.pattern} مطابقت داشته باشد`:`${n[t.format]??e.format} نامعتبر`}case`not_multiple_of`:return`عدد نامعتبر: باید مضرب ${e.divisor} باشد`;case`unrecognized_keys`:return`کلید${e.keys.length>1?`های`:``} ناشناس: ${v(e.keys,`, `)}`;case`invalid_key`:return`کلید ناشناس در ${e.origin}`;case`invalid_union`:return`ورودی نامعتبر`;case`invalid_element`:return`مقدار نامعتبر در ${e.origin}`;default:return`ورودی نامعتبر`}}}}));function qa(){return{localeError:Ja()}}var Ja,Ya=t((()=>{D(),Ja=()=>{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(t){return e[t]??null}let 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`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Virheellinen tyyppi: odotettiin instanceof ${e.expected}, oli ${i}`:`Virheellinen tyyppi: odotettiin ${t}, oli ${i}`}case`invalid_value`:return e.values.length===1?`Virheellinen syöte: täytyy olla ${T(e.values[0])}`:`Virheellinen valinta: täytyy olla yksi seuraavista: ${v(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Liian suuri: ${r.subject} täytyy olla ${n}${e.maximum.toString()} ${r.unit}`.trim():`Liian suuri: arvon täytyy olla ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Liian pieni: ${r.subject} täytyy olla ${n}${e.minimum.toString()} ${r.unit}`.trim():`Liian pieni: arvon täytyy olla ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Virheellinen syöte: täytyy alkaa "${t.prefix}"`:t.format===`ends_with`?`Virheellinen syöte: täytyy loppua "${t.suffix}"`:t.format===`includes`?`Virheellinen syöte: täytyy sisältää "${t.includes}"`:t.format===`regex`?`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${t.pattern}`:`Virheellinen ${n[t.format]??e.format}`}case`not_multiple_of`:return`Virheellinen luku: täytyy olla luvun ${e.divisor} monikerta`;case`unrecognized_keys`:return`${e.keys.length>1?`Tuntemattomat avaimet`:`Tuntematon avain`}: ${v(e.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 Xa(){return{localeError:Za()}}var Za,Qa=t((()=>{D(),Za=()=>{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(t){return e[t]??null}let 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`},r={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 e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Entrée invalide : instanceof ${e.expected} attendu, ${i} reçu`:`Entrée invalide : ${t} attendu, ${i} reçu`}case`invalid_value`:return e.values.length===1?`Entrée invalide : ${T(e.values[0])} attendu`:`Option invalide : une valeur parmi ${v(e.values,`|`)} attendue`;case`too_big`:{let n=e.inclusive?`<=`:`<`,i=t(e.origin);return i?`Trop grand : ${r[e.origin]??`valeur`} doit ${i.verb} ${n}${e.maximum.toString()} ${i.unit??`élément(s)`}`:`Trop grand : ${r[e.origin]??`valeur`} doit être ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,i=t(e.origin);return i?`Trop petit : ${r[e.origin]??`valeur`} doit ${i.verb} ${n}${e.minimum.toString()} ${i.unit}`:`Trop petit : ${r[e.origin]??`valeur`} doit être ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Chaîne invalide : doit commencer par "${t.prefix}"`:t.format===`ends_with`?`Chaîne invalide : doit se terminer par "${t.suffix}"`:t.format===`includes`?`Chaîne invalide : doit inclure "${t.includes}"`:t.format===`regex`?`Chaîne invalide : doit correspondre au modèle ${t.pattern}`:`${n[t.format]??e.format} invalide`}case`not_multiple_of`:return`Nombre invalide : doit être un multiple de ${e.divisor}`;case`unrecognized_keys`:return`Clé${e.keys.length>1?`s`:``} non reconnue${e.keys.length>1?`s`:``} : ${v(e.keys,`, `)}`;case`invalid_key`:return`Clé invalide dans ${e.origin}`;case`invalid_union`:return`Entrée invalide`;case`invalid_element`:return`Valeur invalide dans ${e.origin}`;default:return`Entrée invalide`}}}}));function $a(){return{localeError:eo()}}var eo,to=t((()=>{D(),eo=()=>{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(t){return e[t]??null}let 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`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Entrée invalide : attendu instanceof ${e.expected}, reçu ${i}`:`Entrée invalide : attendu ${t}, reçu ${i}`}case`invalid_value`:return e.values.length===1?`Entrée invalide : attendu ${T(e.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${v(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`≤`:`<`,r=t(e.origin);return r?`Trop grand : attendu que ${e.origin??`la valeur`} ait ${n}${e.maximum.toString()} ${r.unit}`:`Trop grand : attendu que ${e.origin??`la valeur`} soit ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`≥`:`>`,r=t(e.origin);return r?`Trop petit : attendu que ${e.origin} ait ${n}${e.minimum.toString()} ${r.unit}`:`Trop petit : attendu que ${e.origin} soit ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Chaîne invalide : doit commencer par "${t.prefix}"`:t.format===`ends_with`?`Chaîne invalide : doit se terminer par "${t.suffix}"`:t.format===`includes`?`Chaîne invalide : doit inclure "${t.includes}"`:t.format===`regex`?`Chaîne invalide : doit correspondre au motif ${t.pattern}`:`${n[t.format]??e.format} invalide`}case`not_multiple_of`:return`Nombre invalide : doit être un multiple de ${e.divisor}`;case`unrecognized_keys`:return`Clé${e.keys.length>1?`s`:``} non reconnue${e.keys.length>1?`s`:``} : ${v(e.keys,`, `)}`;case`invalid_key`:return`Clé invalide dans ${e.origin}`;case`invalid_union`:return`Entrée invalide`;case`invalid_element`:return`Valeur invalide dans ${e.origin}`;default:return`Entrée invalide`}}}}));function no(){return{localeError:ro()}}var ro,io=t((()=>{D(),ro=()=>{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:`גדול`}},n=t=>t?e[t]:void 0,r=t=>{let r=n(t);return r?r.label:t??e.unknown.label},i=e=>`ה${r(e)}`,a=e=>(n(e)?.gender??`m`)===`f`?`צריכה להיות`:`צריך להיות`,o=e=>e?t[e]??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`}},c={nan:`NaN`};return t=>{switch(t.code){case`invalid_type`:{let n=t.expected,i=c[n??``]??r(n),a=E(t.input),o=c[a]??e[a]?.label??a;return/^[A-Z]/.test(t.expected)?`קלט לא תקין: צריך להיות instanceof ${t.expected}, התקבל ${o}`:`קלט לא תקין: צריך להיות ${i}, התקבל ${o}`}case`invalid_value`:{if(t.values.length===1)return`ערך לא תקין: הערך חייב להיות ${T(t.values[0])}`;let e=t.values.map(e=>T(e));if(t.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${e[0]} או ${e[1]}`;let n=e[e.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${e.slice(0,-1).join(`, `)} או ${n}`}case`too_big`:{let e=o(t.origin),n=i(t.origin??`value`);if(t.origin===`string`)return`${e?.longLabel??`ארוך`} מדי: ${n} צריכה להכיל ${t.maximum.toString()} ${e?.unit??``} ${t.inclusive?`או פחות`:`לכל היותר`}`.trim();if(t.origin===`number`)return`גדול מדי: ${n} צריך להיות ${t.inclusive?`קטן או שווה ל-${t.maximum}`:`קטן מ-${t.maximum}`}`;if(t.origin===`array`||t.origin===`set`)return`גדול מדי: ${n} ${t.origin===`set`?`צריכה`:`צריך`} להכיל ${t.inclusive?`${t.maximum} ${e?.unit??``} או פחות`:`פחות מ-${t.maximum} ${e?.unit??``}`}`.trim();let r=t.inclusive?`<=`:`<`,s=a(t.origin??`value`);return e?.unit?`${e.longLabel} מדי: ${n} ${s} ${r}${t.maximum.toString()} ${e.unit}`:`${e?.longLabel??`גדול`} מדי: ${n} ${s} ${r}${t.maximum.toString()}`}case`too_small`:{let e=o(t.origin),n=i(t.origin??`value`);if(t.origin===`string`)return`${e?.shortLabel??`קצר`} מדי: ${n} צריכה להכיל ${t.minimum.toString()} ${e?.unit??``} ${t.inclusive?`או יותר`:`לפחות`}`.trim();if(t.origin===`number`)return`קטן מדי: ${n} צריך להיות ${t.inclusive?`גדול או שווה ל-${t.minimum}`:`גדול מ-${t.minimum}`}`;if(t.origin===`array`||t.origin===`set`){let r=t.origin===`set`?`צריכה`:`צריך`;return t.minimum===1&&t.inclusive?`קטן מדי: ${n} ${r} להכיל ${t.origin,`לפחות פריט אחד`}`:`קטן מדי: ${n} ${r} להכיל ${t.inclusive?`${t.minimum} ${e?.unit??``} או יותר`:`יותר מ-${t.minimum} ${e?.unit??``}`}`.trim()}let r=t.inclusive?`>=`:`>`,s=a(t.origin??`value`);return e?.unit?`${e.shortLabel} מדי: ${n} ${s} ${r}${t.minimum.toString()} ${e.unit}`:`${e?.shortLabel??`קטן`} מדי: ${n} ${s} ${r}${t.minimum.toString()}`}case`invalid_format`:{let e=t;if(e.format===`starts_with`)return`המחרוזת חייבת להתחיל ב "${e.prefix}"`;if(e.format===`ends_with`)return`המחרוזת חייבת להסתיים ב "${e.suffix}"`;if(e.format===`includes`)return`המחרוזת חייבת לכלול "${e.includes}"`;if(e.format===`regex`)return`המחרוזת חייבת להתאים לתבנית ${e.pattern}`;let n=s[e.format];return`${n?.label??e.format} לא ${(n?.gender??`m`)===`f`?`תקינה`:`תקין`}`}case`not_multiple_of`:return`מספר לא תקין: חייב להיות מכפלה של ${t.divisor}`;case`unrecognized_keys`:return`מפתח${t.keys.length>1?`ות`:``} לא מזוה${t.keys.length>1?`ים`:`ה`}: ${v(t.keys,`, `)}`;case`invalid_key`:return`שדה לא תקין באובייקט`;case`invalid_union`:return`קלט לא תקין`;case`invalid_element`:return`ערך לא תקין ב${i(t.origin??`array`)}`;default:return`קלט לא תקין`}}}}));function ao(){return{localeError:oo()}}var oo,so=t((()=>{D(),oo=()=>{let e={string:{unit:`znakova`,verb:`imati`},file:{unit:`bajtova`,verb:`imati`},array:{unit:`stavki`,verb:`imati`},set:{unit:`stavki`,verb:`imati`}};function t(t){return e[t]??null}let 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`},r={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 e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Neispravan unos: očekuje se instanceof ${e.expected}, a primljeno je ${i}`:`Neispravan unos: očekuje se ${t}, a primljeno je ${i}`}case`invalid_value`:return e.values.length===1?`Neispravna vrijednost: očekivano ${T(e.values[0])}`:`Neispravna opcija: očekivano jedno od ${v(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,i=t(e.origin),a=r[e.origin]??e.origin;return i?`Preveliko: očekivano da ${a??`vrijednost`} ima ${n}${e.maximum.toString()} ${i.unit??`elemenata`}`:`Preveliko: očekivano da ${a??`vrijednost`} bude ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,i=t(e.origin),a=r[e.origin]??e.origin;return i?`Premalo: očekivano da ${a} ima ${n}${e.minimum.toString()} ${i.unit}`:`Premalo: očekivano da ${a} bude ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Neispravan tekst: mora započinjati s "${t.prefix}"`:t.format===`ends_with`?`Neispravan tekst: mora završavati s "${t.suffix}"`:t.format===`includes`?`Neispravan tekst: mora sadržavati "${t.includes}"`:t.format===`regex`?`Neispravan tekst: mora odgovarati uzorku ${t.pattern}`:`Neispravna ${n[t.format]??e.format}`}case`not_multiple_of`:return`Neispravan broj: mora biti višekratnik od ${e.divisor}`;case`unrecognized_keys`:return`Neprepoznat${e.keys.length>1?`i ključevi`:` ključ`}: ${v(e.keys,`, `)}`;case`invalid_key`:return`Neispravan ključ u ${r[e.origin]??e.origin}`;case`invalid_union`:return`Neispravan unos`;case`invalid_element`:return`Neispravna vrijednost u ${r[e.origin]??e.origin}`;default:return`Neispravan unos`}}}}));function co(){return{localeError:lo()}}var lo,uo=t((()=>{D(),lo=()=>{let e={string:{unit:`karakter`,verb:`legyen`},file:{unit:`byte`,verb:`legyen`},array:{unit:`elem`,verb:`legyen`},set:{unit:`elem`,verb:`legyen`}};function t(t){return e[t]??null}let 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`},r={nan:`NaN`,number:`szám`,array:`tömb`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Érvénytelen bemenet: a várt érték instanceof ${e.expected}, a kapott érték ${i}`:`Érvénytelen bemenet: a várt érték ${t}, a kapott érték ${i}`}case`invalid_value`:return e.values.length===1?`Érvénytelen bemenet: a várt érték ${T(e.values[0])}`:`Érvénytelen opció: valamelyik érték várt ${v(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Túl nagy: ${e.origin??`érték`} mérete túl nagy ${n}${e.maximum.toString()} ${r.unit??`elem`}`:`Túl nagy: a bemeneti érték ${e.origin??`érték`} túl nagy: ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Túl kicsi: a bemeneti érték ${e.origin} mérete túl kicsi ${n}${e.minimum.toString()} ${r.unit}`:`Túl kicsi: a bemeneti érték ${e.origin} túl kicsi ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Érvénytelen string: "${t.prefix}" értékkel kell kezdődnie`:t.format===`ends_with`?`Érvénytelen string: "${t.suffix}" értékkel kell végződnie`:t.format===`includes`?`Érvénytelen string: "${t.includes}" értéket kell tartalmaznia`:t.format===`regex`?`Érvénytelen string: ${t.pattern} mintának kell megfelelnie`:`Érvénytelen ${n[t.format]??e.format}`}case`not_multiple_of`:return`Érvénytelen szám: ${e.divisor} többszörösének kell lennie`;case`unrecognized_keys`:return`Ismeretlen kulcs${e.keys.length>1?`s`:``}: ${v(e.keys,`, `)}`;case`invalid_key`:return`Érvénytelen kulcs ${e.origin}`;case`invalid_union`:return`Érvénytelen bemenet`;case`invalid_element`:return`Érvénytelen érték: ${e.origin}`;default:return`Érvénytelen bemenet`}}}}));function fo(e,t,n){return Math.abs(e)===1?t:n}function po(e){if(!e)return``;let t=[`ա`,`ե`,`ը`,`ի`,`ո`,`ու`,`օ`],n=e[e.length-1];return e+(t.includes(n)?`ն`:`ը`)}function mo(){return{localeError:ho()}}var ho,go=t((()=>{D(),ho=()=>{let e={string:{unit:{one:`նշան`,many:`նշաններ`},verb:`ունենալ`},file:{unit:{one:`բայթ`,many:`բայթեր`},verb:`ունենալ`},array:{unit:{one:`տարր`,many:`տարրեր`},verb:`ունենալ`},set:{unit:{one:`տարր`,many:`տարրեր`},verb:`ունենալ`}};function t(t){return e[t]??null}let 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:`մուտք`},r={nan:`NaN`,number:`թիվ`,array:`զանգված`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Սխալ մուտքագրում․ սպասվում էր instanceof ${e.expected}, ստացվել է ${i}`:`Սխալ մուտքագրում․ սպասվում էր ${t}, ստացվել է ${i}`}case`invalid_value`:return e.values.length===1?`Սխալ մուտքագրում․ սպասվում էր ${T(e.values[1])}`:`Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${v(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);if(r){let t=fo(Number(e.maximum),r.unit.one,r.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${po(e.origin??`արժեք`)} կունենա ${n}${e.maximum.toString()} ${t}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${po(e.origin??`արժեք`)} լինի ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);if(r){let t=fo(Number(e.minimum),r.unit.one,r.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${po(e.origin)} կունենա ${n}${e.minimum.toString()} ${t}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${po(e.origin)} լինի ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Սխալ տող․ պետք է սկսվի "${t.prefix}"-ով`:t.format===`ends_with`?`Սխալ տող․ պետք է ավարտվի "${t.suffix}"-ով`:t.format===`includes`?`Սխալ տող․ պետք է պարունակի "${t.includes}"`:t.format===`regex`?`Սխալ տող․ պետք է համապատասխանի ${t.pattern} ձևաչափին`:`Սխալ ${n[t.format]??e.format}`}case`not_multiple_of`:return`Սխալ թիվ․ պետք է բազմապատիկ լինի ${e.divisor}-ի`;case`unrecognized_keys`:return`Չճանաչված բանալի${e.keys.length>1?`ներ`:``}. ${v(e.keys,`, `)}`;case`invalid_key`:return`Սխալ բանալի ${po(e.origin)}-ում`;case`invalid_union`:return`Սխալ մուտքագրում`;case`invalid_element`:return`Սխալ արժեք ${po(e.origin)}-ում`;default:return`Սխալ մուտքագրում`}}}}));function _o(){return{localeError:vo()}}var vo,yo=t((()=>{D(),vo=()=>{let e={string:{unit:`karakter`,verb:`memiliki`},file:{unit:`byte`,verb:`memiliki`},array:{unit:`item`,verb:`memiliki`},set:{unit:`item`,verb:`memiliki`}};function t(t){return e[t]??null}let 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`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Input tidak valid: diharapkan instanceof ${e.expected}, diterima ${i}`:`Input tidak valid: diharapkan ${t}, diterima ${i}`}case`invalid_value`:return e.values.length===1?`Input tidak valid: diharapkan ${T(e.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${v(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Terlalu besar: diharapkan ${e.origin??`value`} memiliki ${n}${e.maximum.toString()} ${r.unit??`elemen`}`:`Terlalu besar: diharapkan ${e.origin??`value`} menjadi ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Terlalu kecil: diharapkan ${e.origin} memiliki ${n}${e.minimum.toString()} ${r.unit}`:`Terlalu kecil: diharapkan ${e.origin} menjadi ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`String tidak valid: harus dimulai dengan "${t.prefix}"`:t.format===`ends_with`?`String tidak valid: harus berakhir dengan "${t.suffix}"`:t.format===`includes`?`String tidak valid: harus menyertakan "${t.includes}"`:t.format===`regex`?`String tidak valid: harus sesuai pola ${t.pattern}`:`${n[t.format]??e.format} tidak valid`}case`not_multiple_of`:return`Angka tidak valid: harus kelipatan dari ${e.divisor}`;case`unrecognized_keys`:return`Kunci tidak dikenali ${e.keys.length>1?`s`:``}: ${v(e.keys,`, `)}`;case`invalid_key`:return`Kunci tidak valid di ${e.origin}`;case`invalid_union`:return`Input tidak valid`;case`invalid_element`:return`Nilai tidak valid di ${e.origin}`;default:return`Input tidak valid`}}}}));function bo(){return{localeError:xo()}}var xo,So=t((()=>{D(),xo=()=>{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(t){return e[t]??null}let 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`},r={nan:`NaN`,number:`númer`,array:`fylki`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Rangt gildi: Þú slóst inn ${i} þar sem á að vera instanceof ${e.expected}`:`Rangt gildi: Þú slóst inn ${i} þar sem á að vera ${t}`}case`invalid_value`:return e.values.length===1?`Rangt gildi: gert ráð fyrir ${T(e.values[0])}`:`Ógilt val: má vera eitt af eftirfarandi ${v(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Of stórt: gert er ráð fyrir að ${e.origin??`gildi`} hafi ${n}${e.maximum.toString()} ${r.unit??`hluti`}`:`Of stórt: gert er ráð fyrir að ${e.origin??`gildi`} sé ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Of lítið: gert er ráð fyrir að ${e.origin} hafi ${n}${e.minimum.toString()} ${r.unit}`:`Of lítið: gert er ráð fyrir að ${e.origin} sé ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ógildur strengur: verður að byrja á "${t.prefix}"`:t.format===`ends_with`?`Ógildur strengur: verður að enda á "${t.suffix}"`:t.format===`includes`?`Ógildur strengur: verður að innihalda "${t.includes}"`:t.format===`regex`?`Ógildur strengur: verður að fylgja mynstri ${t.pattern}`:`Rangt ${n[t.format]??e.format}`}case`not_multiple_of`:return`Röng tala: verður að vera margfeldi af ${e.divisor}`;case`unrecognized_keys`:return`Óþekkt ${e.keys.length>1?`ir lyklar`:`ur lykill`}: ${v(e.keys,`, `)}`;case`invalid_key`:return`Rangur lykill í ${e.origin}`;case`invalid_union`:return`Rangt gildi`;case`invalid_element`:return`Rangt gildi í ${e.origin}`;default:return`Rangt gildi`}}}}));function Co(){return{localeError:wo()}}var wo,To=t((()=>{D(),wo=()=>{let e={string:{unit:`caratteri`,verb:`avere`},file:{unit:`byte`,verb:`avere`},array:{unit:`elementi`,verb:`avere`},set:{unit:`elementi`,verb:`avere`}};function t(t){return e[t]??null}let 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`},r={nan:`NaN`,number:`numero`,array:`vettore`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Input non valido: atteso instanceof ${e.expected}, ricevuto ${i}`:`Input non valido: atteso ${t}, ricevuto ${i}`}case`invalid_value`:return e.values.length===1?`Input non valido: atteso ${T(e.values[0])}`:`Opzione non valida: atteso uno tra ${v(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Troppo grande: ${e.origin??`valore`} deve avere ${n}${e.maximum.toString()} ${r.unit??`elementi`}`:`Troppo grande: ${e.origin??`valore`} deve essere ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Troppo piccolo: ${e.origin} deve avere ${n}${e.minimum.toString()} ${r.unit}`:`Troppo piccolo: ${e.origin} deve essere ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Stringa non valida: deve iniziare con "${t.prefix}"`:t.format===`ends_with`?`Stringa non valida: deve terminare con "${t.suffix}"`:t.format===`includes`?`Stringa non valida: deve includere "${t.includes}"`:t.format===`regex`?`Stringa non valida: deve corrispondere al pattern ${t.pattern}`:`Input non valido: ${n[t.format]??e.format}`}case`not_multiple_of`:return`Numero non valido: deve essere un multiplo di ${e.divisor}`;case`unrecognized_keys`:return`Chiav${e.keys.length>1?`i`:`e`} non riconosciut${e.keys.length>1?`e`:`a`}: ${v(e.keys,`, `)}`;case`invalid_key`:return`Chiave non valida in ${e.origin}`;case`invalid_union`:return`Input non valido`;case`invalid_element`:return`Valore non valido in ${e.origin}`;default:return`Input non valido`}}}}));function Eo(){return{localeError:Do()}}var Do,Oo=t((()=>{D(),Do=()=>{let e={string:{unit:`文字`,verb:`である`},file:{unit:`バイト`,verb:`である`},array:{unit:`要素`,verb:`である`},set:{unit:`要素`,verb:`である`}};function t(t){return e[t]??null}let 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:`入力値`},r={nan:`NaN`,number:`数値`,array:`配列`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`無効な入力: instanceof ${e.expected}が期待されましたが、${i}が入力されました`:`無効な入力: ${t}が期待されましたが、${i}が入力されました`}case`invalid_value`:return e.values.length===1?`無効な入力: ${T(e.values[0])}が期待されました`:`無効な選択: ${v(e.values,`、`)}のいずれかである必要があります`;case`too_big`:{let n=e.inclusive?`以下である`:`より小さい`,r=t(e.origin);return r?`大きすぎる値: ${e.origin??`値`}は${e.maximum.toString()}${r.unit??`要素`}${n}必要があります`:`大きすぎる値: ${e.origin??`値`}は${e.maximum.toString()}${n}必要があります`}case`too_small`:{let n=e.inclusive?`以上である`:`より大きい`,r=t(e.origin);return r?`小さすぎる値: ${e.origin}は${e.minimum.toString()}${r.unit}${n}必要があります`:`小さすぎる値: ${e.origin}は${e.minimum.toString()}${n}必要があります`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`無効な文字列: "${t.prefix}"で始まる必要があります`:t.format===`ends_with`?`無効な文字列: "${t.suffix}"で終わる必要があります`:t.format===`includes`?`無効な文字列: "${t.includes}"を含む必要があります`:t.format===`regex`?`無効な文字列: パターン${t.pattern}に一致する必要があります`:`無効な${n[t.format]??e.format}`}case`not_multiple_of`:return`無効な数値: ${e.divisor}の倍数である必要があります`;case`unrecognized_keys`:return`認識されていないキー${e.keys.length>1?`群`:``}: ${v(e.keys,`、`)}`;case`invalid_key`:return`${e.origin}内の無効なキー`;case`invalid_union`:return`無効な入力`;case`invalid_element`:return`${e.origin}内の無効な値`;default:return`無効な入力`}}}}));function ko(){return{localeError:Ao()}}var Ao,jo=t((()=>{D(),Ao=()=>{let e={string:{unit:`სიმბოლო`,verb:`უნდა შეიცავდეს`},file:{unit:`ბაიტი`,verb:`უნდა შეიცავდეს`},array:{unit:`ელემენტი`,verb:`უნდა შეიცავდეს`},set:{unit:`ელემენტი`,verb:`უნდა შეიცავდეს`}};function t(t){return e[t]??null}let 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:`შეყვანა`},r={nan:`NaN`,number:`რიცხვი`,string:`ველი`,boolean:`ბულეანი`,function:`ფუნქცია`,array:`მასივი`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`არასწორი შეყვანა: მოსალოდნელი instanceof ${e.expected}, მიღებული ${i}`:`არასწორი შეყვანა: მოსალოდნელი ${t}, მიღებული ${i}`}case`invalid_value`:return e.values.length===1?`არასწორი შეყვანა: მოსალოდნელი ${T(e.values[0])}`:`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${v(e.values,`|`)}-დან`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`ზედმეტად დიდი: მოსალოდნელი ${e.origin??`მნიშვნელობა`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit}`:`ზედმეტად დიდი: მოსალოდნელი ${e.origin??`მნიშვნელობა`} იყოს ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`ზედმეტად პატარა: მოსალოდნელი ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`ზედმეტად პატარა: მოსალოდნელი ${e.origin} იყოს ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`არასწორი ველი: უნდა იწყებოდეს "${t.prefix}"-ით`:t.format===`ends_with`?`არასწორი ველი: უნდა მთავრდებოდეს "${t.suffix}"-ით`:t.format===`includes`?`არასწორი ველი: უნდა შეიცავდეს "${t.includes}"-ს`:t.format===`regex`?`არასწორი ველი: უნდა შეესაბამებოდეს შაბლონს ${t.pattern}`:`არასწორი ${n[t.format]??e.format}`}case`not_multiple_of`:return`არასწორი რიცხვი: უნდა იყოს ${e.divisor}-ის ჯერადი`;case`unrecognized_keys`:return`უცნობი გასაღებ${e.keys.length>1?`ები`:`ი`}: ${v(e.keys,`, `)}`;case`invalid_key`:return`არასწორი გასაღები ${e.origin}-ში`;case`invalid_union`:return`არასწორი შეყვანა`;case`invalid_element`:return`არასწორი მნიშვნელობა ${e.origin}-ში`;default:return`არასწორი შეყვანა`}}}}));function Mo(){return{localeError:No()}}var No,Po=t((()=>{D(),No=()=>{let e={string:{unit:`តួអក្សរ`,verb:`គួរមាន`},file:{unit:`បៃ`,verb:`គួរមាន`},array:{unit:`ធាតុ`,verb:`គួរមាន`},set:{unit:`ធាតុ`,verb:`គួរមាន`}};function t(t){return e[t]??null}let 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:`ទិន្នន័យបញ្ចូល`},r={nan:`NaN`,number:`លេខ`,array:`អារេ (Array)`,null:`គ្មានតម្លៃ (null)`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${e.expected} ប៉ុន្តែទទួលបាន ${i}`:`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${t} ប៉ុន្តែទទួលបាន ${i}`}case`invalid_value`:return e.values.length===1?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${T(e.values[0])}`:`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${v(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`ធំពេក៖ ត្រូវការ ${e.origin??`តម្លៃ`} ${n} ${e.maximum.toString()} ${r.unit??`ធាតុ`}`:`ធំពេក៖ ត្រូវការ ${e.origin??`តម្លៃ`} ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`តូចពេក៖ ត្រូវការ ${e.origin} ${n} ${e.minimum.toString()} ${r.unit}`:`តូចពេក៖ ត្រូវការ ${e.origin} ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${t.prefix}"`:t.format===`ends_with`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${t.suffix}"`:t.format===`includes`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${t.includes}"`:t.format===`regex`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${t.pattern}`:`មិនត្រឹមត្រូវ៖ ${n[t.format]??e.format}`}case`not_multiple_of`:return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${e.divisor}`;case`unrecognized_keys`:return`រកឃើញសោមិនស្គាល់៖ ${v(e.keys,`, `)}`;case`invalid_key`:return`សោមិនត្រឹមត្រូវនៅក្នុង ${e.origin}`;case`invalid_union`:return`ទិន្នន័យមិនត្រឹមត្រូវ`;case`invalid_element`:return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${e.origin}`;default:return`ទិន្នន័យមិនត្រឹមត្រូវ`}}}}));function Fo(){return Mo()}var Io=t((()=>{Po()}));function Lo(){return{localeError:Ro()}}var Ro,zo=t((()=>{D(),Ro=()=>{let e={string:{unit:`문자`,verb:`to have`},file:{unit:`바이트`,verb:`to have`},array:{unit:`개`,verb:`to have`},set:{unit:`개`,verb:`to have`}};function t(t){return e[t]??null}let 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:`입력`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`잘못된 입력: 예상 타입은 instanceof ${e.expected}, 받은 타입은 ${i}입니다`:`잘못된 입력: 예상 타입은 ${t}, 받은 타입은 ${i}입니다`}case`invalid_value`:return e.values.length===1?`잘못된 입력: 값은 ${T(e.values[0])} 이어야 합니다`:`잘못된 옵션: ${v(e.values,`또는 `)} 중 하나여야 합니다`;case`too_big`:{let n=e.inclusive?`이하`:`미만`,r=n===`미만`?`이어야 합니다`:`여야 합니다`,i=t(e.origin),a=i?.unit??`요소`;return i?`${e.origin??`값`}이 너무 큽니다: ${e.maximum.toString()}${a} ${n}${r}`:`${e.origin??`값`}이 너무 큽니다: ${e.maximum.toString()} ${n}${r}`}case`too_small`:{let n=e.inclusive?`이상`:`초과`,r=n===`이상`?`이어야 합니다`:`여야 합니다`,i=t(e.origin),a=i?.unit??`요소`;return i?`${e.origin??`값`}이 너무 작습니다: ${e.minimum.toString()}${a} ${n}${r}`:`${e.origin??`값`}이 너무 작습니다: ${e.minimum.toString()} ${n}${r}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`잘못된 문자열: "${t.prefix}"(으)로 시작해야 합니다`:t.format===`ends_with`?`잘못된 문자열: "${t.suffix}"(으)로 끝나야 합니다`:t.format===`includes`?`잘못된 문자열: "${t.includes}"을(를) 포함해야 합니다`:t.format===`regex`?`잘못된 문자열: 정규식 ${t.pattern} 패턴과 일치해야 합니다`:`잘못된 ${n[t.format]??e.format}`}case`not_multiple_of`:return`잘못된 숫자: ${e.divisor}의 배수여야 합니다`;case`unrecognized_keys`:return`인식할 수 없는 키: ${v(e.keys,`, `)}`;case`invalid_key`:return`잘못된 키: ${e.origin}`;case`invalid_union`:return`잘못된 입력`;case`invalid_element`:return`잘못된 값: ${e.origin}`;default:return`잘못된 입력`}}}}));function Bo(e){let t=Math.abs(e),n=t%10,r=t%100;return r>=11&&r<=19||n===0?`many`:n===1?`one`:`few`}function Vo(){return{localeError:Uo()}}var Ho,Uo,Wo=t((()=>{D(),Ho=e=>e.charAt(0).toUpperCase()+e.slice(1),Uo=()=>{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(t,n,r,i){let a=e[t]??null;return a===null?a:{unit:a.unit[n],verb:a.verb[i][r?`inclusive`:`notInclusive`]}}let 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`},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 e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Gautas tipas ${i}, o tikėtasi - instanceof ${e.expected}`:`Gautas tipas ${i}, o tikėtasi - ${t}`}case`invalid_value`:return e.values.length===1?`Privalo būti ${T(e.values[0])}`:`Privalo būti vienas iš ${v(e.values,`|`)} pasirinkimų`;case`too_big`:{let n=r[e.origin]??e.origin,i=t(e.origin,Bo(Number(e.maximum)),e.inclusive??!1,`smaller`);if(i?.verb)return`${Ho(n??e.origin??`reikšmė`)} ${i.verb} ${e.maximum.toString()} ${i.unit??`elementų`}`;let a=e.inclusive?`ne didesnis kaip`:`mažesnis kaip`;return`${Ho(n??e.origin??`reikšmė`)} turi būti ${a} ${e.maximum.toString()} ${i?.unit}`}case`too_small`:{let n=r[e.origin]??e.origin,i=t(e.origin,Bo(Number(e.minimum)),e.inclusive??!1,`bigger`);if(i?.verb)return`${Ho(n??e.origin??`reikšmė`)} ${i.verb} ${e.minimum.toString()} ${i.unit??`elementų`}`;let a=e.inclusive?`ne mažesnis kaip`:`didesnis kaip`;return`${Ho(n??e.origin??`reikšmė`)} turi būti ${a} ${e.minimum.toString()} ${i?.unit}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Eilutė privalo prasidėti "${t.prefix}"`:t.format===`ends_with`?`Eilutė privalo pasibaigti "${t.suffix}"`:t.format===`includes`?`Eilutė privalo įtraukti "${t.includes}"`:t.format===`regex`?`Eilutė privalo atitikti ${t.pattern}`:`Neteisingas ${n[t.format]??e.format}`}case`not_multiple_of`:return`Skaičius privalo būti ${e.divisor} kartotinis.`;case`unrecognized_keys`:return`Neatpažint${e.keys.length>1?`i`:`as`} rakt${e.keys.length>1?`ai`:`as`}: ${v(e.keys,`, `)}`;case`invalid_key`:return`Rastas klaidingas raktas`;case`invalid_union`:return`Klaidinga įvestis`;case`invalid_element`:return`${Ho(r[e.origin]??e.origin??e.origin??`reikšmė`)} turi klaidingą įvestį`;default:return`Klaidinga įvestis`}}}}));function Go(){return{localeError:Ko()}}var Ko,qo=t((()=>{D(),Ko=()=>{let e={string:{unit:`знаци`,verb:`да имаат`},file:{unit:`бајти`,verb:`да имаат`},array:{unit:`ставки`,verb:`да имаат`},set:{unit:`ставки`,verb:`да имаат`}};function t(t){return e[t]??null}let 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:`внес`},r={nan:`NaN`,number:`број`,array:`низа`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Грешен внес: се очекува instanceof ${e.expected}, примено ${i}`:`Грешен внес: се очекува ${t}, примено ${i}`}case`invalid_value`:return e.values.length===1?`Invalid input: expected ${T(e.values[0])}`:`Грешана опција: се очекува една ${v(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Премногу голем: се очекува ${e.origin??`вредноста`} да има ${n}${e.maximum.toString()} ${r.unit??`елементи`}`:`Премногу голем: се очекува ${e.origin??`вредноста`} да биде ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Премногу мал: се очекува ${e.origin} да има ${n}${e.minimum.toString()} ${r.unit}`:`Премногу мал: се очекува ${e.origin} да биде ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Неважечка низа: мора да започнува со "${t.prefix}"`:t.format===`ends_with`?`Неважечка низа: мора да завршува со "${t.suffix}"`:t.format===`includes`?`Неважечка низа: мора да вклучува "${t.includes}"`:t.format===`regex`?`Неважечка низа: мора да одгоара на патернот ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Грешен број: мора да биде делив со ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Непрепознаени клучеви`:`Непрепознаен клуч`}: ${v(e.keys,`, `)}`;case`invalid_key`:return`Грешен клуч во ${e.origin}`;case`invalid_union`:return`Грешен внес`;case`invalid_element`:return`Грешна вредност во ${e.origin}`;default:return`Грешен внес`}}}}));function Jo(){return{localeError:Yo()}}var Yo,Xo=t((()=>{D(),Yo=()=>{let e={string:{unit:`aksara`,verb:`mempunyai`},file:{unit:`bait`,verb:`mempunyai`},array:{unit:`elemen`,verb:`mempunyai`},set:{unit:`elemen`,verb:`mempunyai`}};function t(t){return e[t]??null}let 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`},r={nan:`NaN`,number:`nombor`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Input tidak sah: dijangka instanceof ${e.expected}, diterima ${i}`:`Input tidak sah: dijangka ${t}, diterima ${i}`}case`invalid_value`:return e.values.length===1?`Input tidak sah: dijangka ${T(e.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${v(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Terlalu besar: dijangka ${e.origin??`nilai`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`elemen`}`:`Terlalu besar: dijangka ${e.origin??`nilai`} adalah ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Terlalu kecil: dijangka ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Terlalu kecil: dijangka ${e.origin} adalah ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`String tidak sah: mesti bermula dengan "${t.prefix}"`:t.format===`ends_with`?`String tidak sah: mesti berakhir dengan "${t.suffix}"`:t.format===`includes`?`String tidak sah: mesti mengandungi "${t.includes}"`:t.format===`regex`?`String tidak sah: mesti sepadan dengan corak ${t.pattern}`:`${n[t.format]??e.format} tidak sah`}case`not_multiple_of`:return`Nombor tidak sah: perlu gandaan ${e.divisor}`;case`unrecognized_keys`:return`Kunci tidak dikenali: ${v(e.keys,`, `)}`;case`invalid_key`:return`Kunci tidak sah dalam ${e.origin}`;case`invalid_union`:return`Input tidak sah`;case`invalid_element`:return`Nilai tidak sah dalam ${e.origin}`;default:return`Input tidak sah`}}}}));function Zo(){return{localeError:Qo()}}var Qo,$o=t((()=>{D(),Qo=()=>{let e={string:{unit:`tekens`,verb:`heeft`},file:{unit:`bytes`,verb:`heeft`},array:{unit:`elementen`,verb:`heeft`},set:{unit:`elementen`,verb:`heeft`}};function t(t){return e[t]??null}let 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`},r={nan:`NaN`,number:`getal`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ongeldige invoer: verwacht instanceof ${e.expected}, ontving ${i}`:`Ongeldige invoer: verwacht ${t}, ontving ${i}`}case`invalid_value`:return e.values.length===1?`Ongeldige invoer: verwacht ${T(e.values[0])}`:`Ongeldige optie: verwacht één van ${v(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin),i=e.origin===`date`?`laat`:e.origin===`string`?`lang`:`groot`;return r?`Te ${i}: verwacht dat ${e.origin??`waarde`} ${n}${e.maximum.toString()} ${r.unit??`elementen`} ${r.verb}`:`Te ${i}: verwacht dat ${e.origin??`waarde`} ${n}${e.maximum.toString()} is`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin),i=e.origin===`date`?`vroeg`:e.origin===`string`?`kort`:`klein`;return r?`Te ${i}: verwacht dat ${e.origin} ${n}${e.minimum.toString()} ${r.unit} ${r.verb}`:`Te ${i}: verwacht dat ${e.origin} ${n}${e.minimum.toString()} is`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ongeldige tekst: moet met "${t.prefix}" beginnen`:t.format===`ends_with`?`Ongeldige tekst: moet op "${t.suffix}" eindigen`:t.format===`includes`?`Ongeldige tekst: moet "${t.includes}" bevatten`:t.format===`regex`?`Ongeldige tekst: moet overeenkomen met patroon ${t.pattern}`:`Ongeldig: ${n[t.format]??e.format}`}case`not_multiple_of`:return`Ongeldig getal: moet een veelvoud van ${e.divisor} zijn`;case`unrecognized_keys`:return`Onbekende key${e.keys.length>1?`s`:``}: ${v(e.keys,`, `)}`;case`invalid_key`:return`Ongeldige key in ${e.origin}`;case`invalid_union`:return`Ongeldige invoer`;case`invalid_element`:return`Ongeldige waarde in ${e.origin}`;default:return`Ongeldige invoer`}}}}));function es(){return{localeError:ts()}}var ts,ns=t((()=>{D(),ts=()=>{let e={string:{unit:`tegn`,verb:`å ha`},file:{unit:`bytes`,verb:`å ha`},array:{unit:`elementer`,verb:`å inneholde`},set:{unit:`elementer`,verb:`å inneholde`}};function t(t){return e[t]??null}let 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`},r={nan:`NaN`,number:`tall`,array:`liste`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ugyldig input: forventet instanceof ${e.expected}, fikk ${i}`:`Ugyldig input: forventet ${t}, fikk ${i}`}case`invalid_value`:return e.values.length===1?`Ugyldig verdi: forventet ${T(e.values[0])}`:`Ugyldig valg: forventet en av ${v(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`For stor(t): forventet ${e.origin??`value`} til å ha ${n}${e.maximum.toString()} ${r.unit??`elementer`}`:`For stor(t): forventet ${e.origin??`value`} til å ha ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`For lite(n): forventet ${e.origin} til å ha ${n}${e.minimum.toString()} ${r.unit}`:`For lite(n): forventet ${e.origin} til å ha ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ugyldig streng: må starte med "${t.prefix}"`:t.format===`ends_with`?`Ugyldig streng: må ende med "${t.suffix}"`:t.format===`includes`?`Ugyldig streng: må inneholde "${t.includes}"`:t.format===`regex`?`Ugyldig streng: må matche mønsteret ${t.pattern}`:`Ugyldig ${n[t.format]??e.format}`}case`not_multiple_of`:return`Ugyldig tall: må være et multiplum av ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Ukjente nøkler`:`Ukjent nøkkel`}: ${v(e.keys,`, `)}`;case`invalid_key`:return`Ugyldig nøkkel i ${e.origin}`;case`invalid_union`:return`Ugyldig input`;case`invalid_element`:return`Ugyldig verdi i ${e.origin}`;default:return`Ugyldig input`}}}}));function rs(){return{localeError:is()}}var is,as=t((()=>{D(),is=()=>{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(t){return e[t]??null}let 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`},r={nan:`NaN`,number:`numara`,array:`saf`,null:`gayb`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Fâsit giren: umulan instanceof ${e.expected}, alınan ${i}`:`Fâsit giren: umulan ${t}, alınan ${i}`}case`invalid_value`:return e.values.length===1?`Fâsit giren: umulan ${T(e.values[0])}`:`Fâsit tercih: mûteberler ${v(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Fazla büyük: ${e.origin??`value`}, ${n}${e.maximum.toString()} ${r.unit??`elements`} sahip olmalıydı.`:`Fazla büyük: ${e.origin??`value`}, ${n}${e.maximum.toString()} olmalıydı.`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Fazla küçük: ${e.origin}, ${n}${e.minimum.toString()} ${r.unit} sahip olmalıydı.`:`Fazla küçük: ${e.origin}, ${n}${e.minimum.toString()} olmalıydı.`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Fâsit metin: "${t.prefix}" ile başlamalı.`:t.format===`ends_with`?`Fâsit metin: "${t.suffix}" ile bitmeli.`:t.format===`includes`?`Fâsit metin: "${t.includes}" ihtivâ etmeli.`:t.format===`regex`?`Fâsit metin: ${t.pattern} nakşına uymalı.`:`Fâsit ${n[t.format]??e.format}`}case`not_multiple_of`:return`Fâsit sayı: ${e.divisor} katı olmalıydı.`;case`unrecognized_keys`:return`Tanınmayan anahtar ${e.keys.length>1?`s`:``}: ${v(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} için tanınmayan anahtar var.`;case`invalid_union`:return`Giren tanınamadı.`;case`invalid_element`:return`${e.origin} için tanınmayan kıymet var.`;default:return`Kıymet tanınamadı.`}}}}));function os(){return{localeError:ss()}}var ss,cs=t((()=>{D(),ss=()=>{let e={string:{unit:`توکي`,verb:`ولري`},file:{unit:`بایټس`,verb:`ولري`},array:{unit:`توکي`,verb:`ولري`},set:{unit:`توکي`,verb:`ولري`}};function t(t){return e[t]??null}let 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:`ورودي`},r={nan:`NaN`,number:`عدد`,array:`ارې`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`ناسم ورودي: باید instanceof ${e.expected} وای, مګر ${i} ترلاسه شو`:`ناسم ورودي: باید ${t} وای, مګر ${i} ترلاسه شو`}case`invalid_value`:return e.values.length===1?`ناسم ورودي: باید ${T(e.values[0])} وای`:`ناسم انتخاب: باید یو له ${v(e.values,`|`)} څخه وای`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`ډیر لوی: ${e.origin??`ارزښت`} باید ${n}${e.maximum.toString()} ${r.unit??`عنصرونه`} ولري`:`ډیر لوی: ${e.origin??`ارزښت`} باید ${n}${e.maximum.toString()} وي`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`ډیر کوچنی: ${e.origin} باید ${n}${e.minimum.toString()} ${r.unit} ولري`:`ډیر کوچنی: ${e.origin} باید ${n}${e.minimum.toString()} وي`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`ناسم متن: باید د "${t.prefix}" سره پیل شي`:t.format===`ends_with`?`ناسم متن: باید د "${t.suffix}" سره پای ته ورسيږي`:t.format===`includes`?`ناسم متن: باید "${t.includes}" ولري`:t.format===`regex`?`ناسم متن: باید د ${t.pattern} سره مطابقت ولري`:`${n[t.format]??e.format} ناسم دی`}case`not_multiple_of`:return`ناسم عدد: باید د ${e.divisor} مضرب وي`;case`unrecognized_keys`:return`ناسم ${e.keys.length>1?`کلیډونه`:`کلیډ`}: ${v(e.keys,`, `)}`;case`invalid_key`:return`ناسم کلیډ په ${e.origin} کې`;case`invalid_union`:return`ناسمه ورودي`;case`invalid_element`:return`ناسم عنصر په ${e.origin} کې`;default:return`ناسمه ورودي`}}}}));function ls(){return{localeError:us()}}var us,ds=t((()=>{D(),us=()=>{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(t){return e[t]??null}let 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`},r={nan:`NaN`,number:`liczba`,array:`tablica`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Nieprawidłowe dane wejściowe: oczekiwano instanceof ${e.expected}, otrzymano ${i}`:`Nieprawidłowe dane wejściowe: oczekiwano ${t}, otrzymano ${i}`}case`invalid_value`:return e.values.length===1?`Nieprawidłowe dane wejściowe: oczekiwano ${T(e.values[0])}`:`Nieprawidłowa opcja: oczekiwano jednej z wartości ${v(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Za duża wartość: oczekiwano, że ${e.origin??`wartość`} będzie mieć ${n}${e.maximum.toString()} ${r.unit??`elementów`}`:`Zbyt duż(y/a/e): oczekiwano, że ${e.origin??`wartość`} będzie wynosić ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Za mała wartość: oczekiwano, że ${e.origin??`wartość`} będzie mieć ${n}${e.minimum.toString()} ${r.unit??`elementów`}`:`Zbyt mał(y/a/e): oczekiwano, że ${e.origin??`wartość`} będzie wynosić ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Nieprawidłowy ciąg znaków: musi zaczynać się od "${t.prefix}"`:t.format===`ends_with`?`Nieprawidłowy ciąg znaków: musi kończyć się na "${t.suffix}"`:t.format===`includes`?`Nieprawidłowy ciąg znaków: musi zawierać "${t.includes}"`:t.format===`regex`?`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${t.pattern}`:`Nieprawidłow(y/a/e) ${n[t.format]??e.format}`}case`not_multiple_of`:return`Nieprawidłowa liczba: musi być wielokrotnością ${e.divisor}`;case`unrecognized_keys`:return`Nierozpoznane klucze${e.keys.length>1?`s`:``}: ${v(e.keys,`, `)}`;case`invalid_key`:return`Nieprawidłowy klucz w ${e.origin}`;case`invalid_union`:return`Nieprawidłowe dane wejściowe`;case`invalid_element`:return`Nieprawidłowa wartość w ${e.origin}`;default:return`Nieprawidłowe dane wejściowe`}}}}));function fs(){return{localeError:ps()}}var ps,ms=t((()=>{D(),ps=()=>{let e={string:{unit:`caracteres`,verb:`ter`},file:{unit:`bytes`,verb:`ter`},array:{unit:`itens`,verb:`ter`},set:{unit:`itens`,verb:`ter`}};function t(t){return e[t]??null}let 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`},r={nan:`NaN`,number:`número`,null:`nulo`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Tipo inválido: esperado instanceof ${e.expected}, recebido ${i}`:`Tipo inválido: esperado ${t}, recebido ${i}`}case`invalid_value`:return e.values.length===1?`Entrada inválida: esperado ${T(e.values[0])}`:`Opção inválida: esperada uma das ${v(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Muito grande: esperado que ${e.origin??`valor`} tivesse ${n}${e.maximum.toString()} ${r.unit??`elementos`}`:`Muito grande: esperado que ${e.origin??`valor`} fosse ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Muito pequeno: esperado que ${e.origin} tivesse ${n}${e.minimum.toString()} ${r.unit}`:`Muito pequeno: esperado que ${e.origin} fosse ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Texto inválido: deve começar com "${t.prefix}"`:t.format===`ends_with`?`Texto inválido: deve terminar com "${t.suffix}"`:t.format===`includes`?`Texto inválido: deve incluir "${t.includes}"`:t.format===`regex`?`Texto inválido: deve corresponder ao padrão ${t.pattern}`:`${n[t.format]??e.format} inválido`}case`not_multiple_of`:return`Número inválido: deve ser múltiplo de ${e.divisor}`;case`unrecognized_keys`:return`Chave${e.keys.length>1?`s`:``} desconhecida${e.keys.length>1?`s`:``}: ${v(e.keys,`, `)}`;case`invalid_key`:return`Chave inválida em ${e.origin}`;case`invalid_union`:return`Entrada inválida`;case`invalid_element`:return`Valor inválido em ${e.origin}`;default:return`Campo inválido`}}}}));function hs(){return{localeError:gs()}}var gs,_s=t((()=>{D(),gs=()=>{let e={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 t(t){return e[t]??null}let 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`},r={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 e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input);return`Intrare invalidă: așteptat ${t}, primit ${r[n]??n}`}case`invalid_value`:return e.values.length===1?`Intrare invalidă: așteptat ${T(e.values[0])}`:`Opțiune invalidă: așteptat una dintre ${v(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Prea mare: așteptat ca ${e.origin??`valoarea`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`elemente`}`:`Prea mare: așteptat ca ${e.origin??`valoarea`} să fie ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Prea mic: așteptat ca ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Prea mic: așteptat ca ${e.origin} să fie ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Șir invalid: trebuie să înceapă cu "${t.prefix}"`:t.format===`ends_with`?`Șir invalid: trebuie să se termine cu "${t.suffix}"`:t.format===`includes`?`Șir invalid: trebuie să includă "${t.includes}"`:t.format===`regex`?`Șir invalid: trebuie să se potrivească cu modelul ${t.pattern}`:`Format invalid: ${n[t.format]??e.format}`}case`not_multiple_of`:return`Număr invalid: trebuie să fie multiplu de ${e.divisor}`;case`unrecognized_keys`:return`Chei nerecunoscute: ${v(e.keys,`, `)}`;case`invalid_key`:return`Cheie invalidă în ${e.origin}`;case`invalid_union`:return`Intrare invalidă`;case`invalid_element`:return`Valoare invalidă în ${e.origin}`;default:return`Intrare invalidă`}}}}));function vs(e,t,n,r){let i=Math.abs(e),a=i%10,o=i%100;return o>=11&&o<=19?r:a===1?t:a>=2&&a<=4?n:r}function ys(){return{localeError:bs()}}var bs,xs=t((()=>{D(),bs=()=>{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(t){return e[t]??null}let 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:`ввод`},r={nan:`NaN`,number:`число`,array:`массив`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Неверный ввод: ожидалось instanceof ${e.expected}, получено ${i}`:`Неверный ввод: ожидалось ${t}, получено ${i}`}case`invalid_value`:return e.values.length===1?`Неверный ввод: ожидалось ${T(e.values[0])}`:`Неверный вариант: ожидалось одно из ${v(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);if(r){let t=vs(Number(e.maximum),r.unit.one,r.unit.few,r.unit.many);return`Слишком большое значение: ожидалось, что ${e.origin??`значение`} будет иметь ${n}${e.maximum.toString()} ${t}`}return`Слишком большое значение: ожидалось, что ${e.origin??`значение`} будет ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);if(r){let t=vs(Number(e.minimum),r.unit.one,r.unit.few,r.unit.many);return`Слишком маленькое значение: ожидалось, что ${e.origin} будет иметь ${n}${e.minimum.toString()} ${t}`}return`Слишком маленькое значение: ожидалось, что ${e.origin} будет ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Неверная строка: должна начинаться с "${t.prefix}"`:t.format===`ends_with`?`Неверная строка: должна заканчиваться на "${t.suffix}"`:t.format===`includes`?`Неверная строка: должна содержать "${t.includes}"`:t.format===`regex`?`Неверная строка: должна соответствовать шаблону ${t.pattern}`:`Неверный ${n[t.format]??e.format}`}case`not_multiple_of`:return`Неверное число: должно быть кратным ${e.divisor}`;case`unrecognized_keys`:return`Нераспознанн${e.keys.length>1?`ые`:`ый`} ключ${e.keys.length>1?`и`:``}: ${v(e.keys,`, `)}`;case`invalid_key`:return`Неверный ключ в ${e.origin}`;case`invalid_union`:return`Неверные входные данные`;case`invalid_element`:return`Неверное значение в ${e.origin}`;default:return`Неверные входные данные`}}}}));function Ss(){return{localeError:Cs()}}var Cs,ws=t((()=>{D(),Cs=()=>{let e={string:{unit:`znakov`,verb:`imeti`},file:{unit:`bajtov`,verb:`imeti`},array:{unit:`elementov`,verb:`imeti`},set:{unit:`elementov`,verb:`imeti`}};function t(t){return e[t]??null}let 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`},r={nan:`NaN`,number:`število`,array:`tabela`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Neveljaven vnos: pričakovano instanceof ${e.expected}, prejeto ${i}`:`Neveljaven vnos: pričakovano ${t}, prejeto ${i}`}case`invalid_value`:return e.values.length===1?`Neveljaven vnos: pričakovano ${T(e.values[0])}`:`Neveljavna možnost: pričakovano eno izmed ${v(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Preveliko: pričakovano, da bo ${e.origin??`vrednost`} imelo ${n}${e.maximum.toString()} ${r.unit??`elementov`}`:`Preveliko: pričakovano, da bo ${e.origin??`vrednost`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Premajhno: pričakovano, da bo ${e.origin} imelo ${n}${e.minimum.toString()} ${r.unit}`:`Premajhno: pričakovano, da bo ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Neveljaven niz: mora se začeti z "${t.prefix}"`:t.format===`ends_with`?`Neveljaven niz: mora se končati z "${t.suffix}"`:t.format===`includes`?`Neveljaven niz: mora vsebovati "${t.includes}"`:t.format===`regex`?`Neveljaven niz: mora ustrezati vzorcu ${t.pattern}`:`Neveljaven ${n[t.format]??e.format}`}case`not_multiple_of`:return`Neveljavno število: mora biti večkratnik ${e.divisor}`;case`unrecognized_keys`:return`Neprepoznan${e.keys.length>1?`i ključi`:` ključ`}: ${v(e.keys,`, `)}`;case`invalid_key`:return`Neveljaven ključ v ${e.origin}`;case`invalid_union`:return`Neveljaven vnos`;case`invalid_element`:return`Neveljavna vrednost v ${e.origin}`;default:return`Neveljaven vnos`}}}}));function Ts(){return{localeError:Es()}}var Es,Ds=t((()=>{D(),Es=()=>{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(t){return e[t]??null}let 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`},r={nan:`NaN`,number:`antal`,array:`lista`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ogiltig inmatning: förväntat instanceof ${e.expected}, fick ${i}`:`Ogiltig inmatning: förväntat ${t}, fick ${i}`}case`invalid_value`:return e.values.length===1?`Ogiltig inmatning: förväntat ${T(e.values[0])}`:`Ogiltigt val: förväntade en av ${v(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`För stor(t): förväntade ${e.origin??`värdet`} att ha ${n}${e.maximum.toString()} ${r.unit??`element`}`:`För stor(t): förväntat ${e.origin??`värdet`} att ha ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`För lite(t): förväntade ${e.origin??`värdet`} att ha ${n}${e.minimum.toString()} ${r.unit}`:`För lite(t): förväntade ${e.origin??`värdet`} att ha ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ogiltig sträng: måste börja med "${t.prefix}"`:t.format===`ends_with`?`Ogiltig sträng: måste sluta med "${t.suffix}"`:t.format===`includes`?`Ogiltig sträng: måste innehålla "${t.includes}"`:t.format===`regex`?`Ogiltig sträng: måste matcha mönstret "${t.pattern}"`:`Ogiltig(t) ${n[t.format]??e.format}`}case`not_multiple_of`:return`Ogiltigt tal: måste vara en multipel av ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Okända nycklar`:`Okänd nyckel`}: ${v(e.keys,`, `)}`;case`invalid_key`:return`Ogiltig nyckel i ${e.origin??`värdet`}`;case`invalid_union`:return`Ogiltig input`;case`invalid_element`:return`Ogiltigt värde i ${e.origin??`värdet`}`;default:return`Ogiltig input`}}}}));function Os(){return{localeError:ks()}}var ks,As=t((()=>{D(),ks=()=>{let e={string:{unit:`எழுத்துக்கள்`,verb:`கொண்டிருக்க வேண்டும்`},file:{unit:`பைட்டுகள்`,verb:`கொண்டிருக்க வேண்டும்`},array:{unit:`உறுப்புகள்`,verb:`கொண்டிருக்க வேண்டும்`},set:{unit:`உறுப்புகள்`,verb:`கொண்டிருக்க வேண்டும்`}};function t(t){return e[t]??null}let 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`},r={nan:`NaN`,number:`எண்`,array:`அணி`,null:`வெறுமை`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${e.expected}, பெறப்பட்டது ${i}`:`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${t}, பெறப்பட்டது ${i}`}case`invalid_value`:return e.values.length===1?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${T(e.values[0])}`:`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${v(e.values,`|`)} இல் ஒன்று`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${e.origin??`மதிப்பு`} ${n}${e.maximum.toString()} ${r.unit??`உறுப்புகள்`} ஆக இருக்க வேண்டும்`:`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${e.origin??`மதிப்பு`} ${n}${e.maximum.toString()} ஆக இருக்க வேண்டும்`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${e.origin} ${n}${e.minimum.toString()} ${r.unit} ஆக இருக்க வேண்டும்`:`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${e.origin} ${n}${e.minimum.toString()} ஆக இருக்க வேண்டும்`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`தவறான சரம்: "${t.prefix}" இல் தொடங்க வேண்டும்`:t.format===`ends_with`?`தவறான சரம்: "${t.suffix}" இல் முடிவடைய வேண்டும்`:t.format===`includes`?`தவறான சரம்: "${t.includes}" ஐ உள்ளடக்க வேண்டும்`:t.format===`regex`?`தவறான சரம்: ${t.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`:`தவறான ${n[t.format]??e.format}`}case`not_multiple_of`:return`தவறான எண்: ${e.divisor} இன் பலமாக இருக்க வேண்டும்`;case`unrecognized_keys`:return`அடையாளம் தெரியாத விசை${e.keys.length>1?`கள்`:``}: ${v(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} இல் தவறான விசை`;case`invalid_union`:return`தவறான உள்ளீடு`;case`invalid_element`:return`${e.origin} இல் தவறான மதிப்பு`;default:return`தவறான உள்ளீடு`}}}}));function js(){return{localeError:Ms()}}var Ms,Ns=t((()=>{D(),Ms=()=>{let e={string:{unit:`ตัวอักษร`,verb:`ควรมี`},file:{unit:`ไบต์`,verb:`ควรมี`},array:{unit:`รายการ`,verb:`ควรมี`},set:{unit:`รายการ`,verb:`ควรมี`}};function t(t){return e[t]??null}let 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:`ข้อมูลที่ป้อน`},r={nan:`NaN`,number:`ตัวเลข`,array:`อาร์เรย์ (Array)`,null:`ไม่มีค่า (null)`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${e.expected} แต่ได้รับ ${i}`:`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${t} แต่ได้รับ ${i}`}case`invalid_value`:return e.values.length===1?`ค่าไม่ถูกต้อง: ควรเป็น ${T(e.values[0])}`:`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${v(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`ไม่เกิน`:`น้อยกว่า`,r=t(e.origin);return r?`เกินกำหนด: ${e.origin??`ค่า`} ควรมี${n} ${e.maximum.toString()} ${r.unit??`รายการ`}`:`เกินกำหนด: ${e.origin??`ค่า`} ควรมี${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`อย่างน้อย`:`มากกว่า`,r=t(e.origin);return r?`น้อยกว่ากำหนด: ${e.origin} ควรมี${n} ${e.minimum.toString()} ${r.unit}`:`น้อยกว่ากำหนด: ${e.origin} ควรมี${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${t.prefix}"`:t.format===`ends_with`?`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${t.suffix}"`:t.format===`includes`?`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${t.includes}" อยู่ในข้อความ`:t.format===`regex`?`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${t.pattern}`:`รูปแบบไม่ถูกต้อง: ${n[t.format]??e.format}`}case`not_multiple_of`:return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${e.divisor} ได้ลงตัว`;case`unrecognized_keys`:return`พบคีย์ที่ไม่รู้จัก: ${v(e.keys,`, `)}`;case`invalid_key`:return`คีย์ไม่ถูกต้องใน ${e.origin}`;case`invalid_union`:return`ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้`;case`invalid_element`:return`ข้อมูลไม่ถูกต้องใน ${e.origin}`;default:return`ข้อมูลไม่ถูกต้อง`}}}}));function Ps(){return{localeError:Fs()}}var Fs,Is=t((()=>{D(),Fs=()=>{let e={string:{unit:`karakter`,verb:`olmalı`},file:{unit:`bayt`,verb:`olmalı`},array:{unit:`öğe`,verb:`olmalı`},set:{unit:`öğe`,verb:`olmalı`}};function t(t){return e[t]??null}let 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`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Geçersiz değer: beklenen instanceof ${e.expected}, alınan ${i}`:`Geçersiz değer: beklenen ${t}, alınan ${i}`}case`invalid_value`:return e.values.length===1?`Geçersiz değer: beklenen ${T(e.values[0])}`:`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${v(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Çok büyük: beklenen ${e.origin??`değer`} ${n}${e.maximum.toString()} ${r.unit??`öğe`}`:`Çok büyük: beklenen ${e.origin??`değer`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Çok küçük: beklenen ${e.origin} ${n}${e.minimum.toString()} ${r.unit}`:`Çok küçük: beklenen ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Geçersiz metin: "${t.prefix}" ile başlamalı`:t.format===`ends_with`?`Geçersiz metin: "${t.suffix}" ile bitmeli`:t.format===`includes`?`Geçersiz metin: "${t.includes}" içermeli`:t.format===`regex`?`Geçersiz metin: ${t.pattern} desenine uymalı`:`Geçersiz ${n[t.format]??e.format}`}case`not_multiple_of`:return`Geçersiz sayı: ${e.divisor} ile tam bölünebilmeli`;case`unrecognized_keys`:return`Tanınmayan anahtar${e.keys.length>1?`lar`:``}: ${v(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} içinde geçersiz anahtar`;case`invalid_union`:return`Geçersiz değer`;case`invalid_element`:return`${e.origin} içinde geçersiz değer`;default:return`Geçersiz değer`}}}}));function Ls(){return{localeError:Rs()}}var Rs,zs=t((()=>{D(),Rs=()=>{let e={string:{unit:`символів`,verb:`матиме`},file:{unit:`байтів`,verb:`матиме`},array:{unit:`елементів`,verb:`матиме`},set:{unit:`елементів`,verb:`матиме`}};function t(t){return e[t]??null}let 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:`вхідні дані`},r={nan:`NaN`,number:`число`,array:`масив`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Неправильні вхідні дані: очікується instanceof ${e.expected}, отримано ${i}`:`Неправильні вхідні дані: очікується ${t}, отримано ${i}`}case`invalid_value`:return e.values.length===1?`Неправильні вхідні дані: очікується ${T(e.values[0])}`:`Неправильна опція: очікується одне з ${v(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Занадто велике: очікується, що ${e.origin??`значення`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`елементів`}`:`Занадто велике: очікується, що ${e.origin??`значення`} буде ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Занадто мале: очікується, що ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Занадто мале: очікується, що ${e.origin} буде ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Неправильний рядок: повинен починатися з "${t.prefix}"`:t.format===`ends_with`?`Неправильний рядок: повинен закінчуватися на "${t.suffix}"`:t.format===`includes`?`Неправильний рядок: повинен містити "${t.includes}"`:t.format===`regex`?`Неправильний рядок: повинен відповідати шаблону ${t.pattern}`:`Неправильний ${n[t.format]??e.format}`}case`not_multiple_of`:return`Неправильне число: повинно бути кратним ${e.divisor}`;case`unrecognized_keys`:return`Нерозпізнаний ключ${e.keys.length>1?`і`:``}: ${v(e.keys,`, `)}`;case`invalid_key`:return`Неправильний ключ у ${e.origin}`;case`invalid_union`:return`Неправильні вхідні дані`;case`invalid_element`:return`Неправильне значення у ${e.origin}`;default:return`Неправильні вхідні дані`}}}}));function Bs(){return Ls()}var Vs=t((()=>{zs()}));function Hs(){return{localeError:Us()}}var Us,Ws=t((()=>{D(),Us=()=>{let e={string:{unit:`حروف`,verb:`ہونا`},file:{unit:`بائٹس`,verb:`ہونا`},array:{unit:`آئٹمز`,verb:`ہونا`},set:{unit:`آئٹمز`,verb:`ہونا`}};function t(t){return e[t]??null}let 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:`ان پٹ`},r={nan:`NaN`,number:`نمبر`,array:`آرے`,null:`نل`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`غلط ان پٹ: instanceof ${e.expected} متوقع تھا، ${i} موصول ہوا`:`غلط ان پٹ: ${t} متوقع تھا، ${i} موصول ہوا`}case`invalid_value`:return e.values.length===1?`غلط ان پٹ: ${T(e.values[0])} متوقع تھا`:`غلط آپشن: ${v(e.values,`|`)} میں سے ایک متوقع تھا`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`بہت بڑا: ${e.origin??`ویلیو`} کے ${n}${e.maximum.toString()} ${r.unit??`عناصر`} ہونے متوقع تھے`:`بہت بڑا: ${e.origin??`ویلیو`} کا ${n}${e.maximum.toString()} ہونا متوقع تھا`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`بہت چھوٹا: ${e.origin} کے ${n}${e.minimum.toString()} ${r.unit} ہونے متوقع تھے`:`بہت چھوٹا: ${e.origin} کا ${n}${e.minimum.toString()} ہونا متوقع تھا`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`غلط سٹرنگ: "${t.prefix}" سے شروع ہونا چاہیے`:t.format===`ends_with`?`غلط سٹرنگ: "${t.suffix}" پر ختم ہونا چاہیے`:t.format===`includes`?`غلط سٹرنگ: "${t.includes}" شامل ہونا چاہیے`:t.format===`regex`?`غلط سٹرنگ: پیٹرن ${t.pattern} سے میچ ہونا چاہیے`:`غلط ${n[t.format]??e.format}`}case`not_multiple_of`:return`غلط نمبر: ${e.divisor} کا مضاعف ہونا چاہیے`;case`unrecognized_keys`:return`غیر تسلیم شدہ کی${e.keys.length>1?`ز`:``}: ${v(e.keys,`، `)}`;case`invalid_key`:return`${e.origin} میں غلط کی`;case`invalid_union`:return`غلط ان پٹ`;case`invalid_element`:return`${e.origin} میں غلط ویلیو`;default:return`غلط ان پٹ`}}}}));function Gs(){return{localeError:Ks()}}var Ks,qs=t((()=>{D(),Ks=()=>{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`},map:{unit:`yozuv`,verb:`bo‘lishi kerak`}};function t(t){return e[t]??null}let 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`},r={nan:`NaN`,number:`raqam`,array:`massiv`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Noto‘g‘ri kirish: kutilgan instanceof ${e.expected}, qabul qilingan ${i}`:`Noto‘g‘ri kirish: kutilgan ${t}, qabul qilingan ${i}`}case`invalid_value`:return e.values.length===1?`Noto‘g‘ri kirish: kutilgan ${T(e.values[0])}`:`Noto‘g‘ri variant: quyidagilardan biri kutilgan ${v(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Juda katta: kutilgan ${e.origin??`qiymat`} ${n}${e.maximum.toString()} ${r.unit} ${r.verb}`:`Juda katta: kutilgan ${e.origin??`qiymat`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Juda kichik: kutilgan ${e.origin} ${n}${e.minimum.toString()} ${r.unit} ${r.verb}`:`Juda kichik: kutilgan ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Noto‘g‘ri satr: "${t.prefix}" bilan boshlanishi kerak`:t.format===`ends_with`?`Noto‘g‘ri satr: "${t.suffix}" bilan tugashi kerak`:t.format===`includes`?`Noto‘g‘ri satr: "${t.includes}" ni o‘z ichiga olishi kerak`:t.format===`regex`?`Noto‘g‘ri satr: ${t.pattern} shabloniga mos kelishi kerak`:`Noto‘g‘ri ${n[t.format]??e.format}`}case`not_multiple_of`:return`Noto‘g‘ri raqam: ${e.divisor} ning karralisi bo‘lishi kerak`;case`unrecognized_keys`:return`Noma’lum kalit${e.keys.length>1?`lar`:``}: ${v(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} dagi kalit noto‘g‘ri`;case`invalid_union`:return`Noto‘g‘ri kirish`;case`invalid_element`:return`${e.origin} da noto‘g‘ri qiymat`;default:return`Noto‘g‘ri kirish`}}}}));function Js(){return{localeError:Ys()}}var Ys,Xs=t((()=>{D(),Ys=()=>{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(t){return e[t]??null}let 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`},r={nan:`NaN`,number:`số`,array:`mảng`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Đầu vào không hợp lệ: mong đợi instanceof ${e.expected}, nhận được ${i}`:`Đầu vào không hợp lệ: mong đợi ${t}, nhận được ${i}`}case`invalid_value`:return e.values.length===1?`Đầu vào không hợp lệ: mong đợi ${T(e.values[0])}`:`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${v(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Quá lớn: mong đợi ${e.origin??`giá trị`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`phần tử`}`:`Quá lớn: mong đợi ${e.origin??`giá trị`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Quá nhỏ: mong đợi ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Quá nhỏ: mong đợi ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Chuỗi không hợp lệ: phải bắt đầu bằng "${t.prefix}"`:t.format===`ends_with`?`Chuỗi không hợp lệ: phải kết thúc bằng "${t.suffix}"`:t.format===`includes`?`Chuỗi không hợp lệ: phải bao gồm "${t.includes}"`:t.format===`regex`?`Chuỗi không hợp lệ: phải khớp với mẫu ${t.pattern}`:`${n[t.format]??e.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 ${e.divisor}`;case`unrecognized_keys`:return`Khóa không được nhận dạng: ${v(e.keys,`, `)}`;case`invalid_key`:return`Khóa không hợp lệ trong ${e.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 ${e.origin}`;default:return`Đầu vào không hợp lệ`}}}}));function Zs(){return{localeError:Qs()}}var Qs,$s=t((()=>{D(),Qs=()=>{let e={string:{unit:`字符`,verb:`包含`},file:{unit:`字节`,verb:`包含`},array:{unit:`项`,verb:`包含`},set:{unit:`项`,verb:`包含`}};function t(t){return e[t]??null}let 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:`输入`},r={nan:`NaN`,number:`数字`,array:`数组`,null:`空值(null)`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`无效输入:期望 instanceof ${e.expected},实际接收 ${i}`:`无效输入:期望 ${t},实际接收 ${i}`}case`invalid_value`:return e.values.length===1?`无效输入:期望 ${T(e.values[0])}`:`无效选项:期望以下之一 ${v(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`数值过大:期望 ${e.origin??`值`} ${n}${e.maximum.toString()} ${r.unit??`个元素`}`:`数值过大:期望 ${e.origin??`值`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`数值过小:期望 ${e.origin} ${n}${e.minimum.toString()} ${r.unit}`:`数值过小:期望 ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`无效字符串:必须以 "${t.prefix}" 开头`:t.format===`ends_with`?`无效字符串:必须以 "${t.suffix}" 结尾`:t.format===`includes`?`无效字符串:必须包含 "${t.includes}"`:t.format===`regex`?`无效字符串:必须满足正则表达式 ${t.pattern}`:`无效${n[t.format]??e.format}`}case`not_multiple_of`:return`无效数字:必须是 ${e.divisor} 的倍数`;case`unrecognized_keys`:return`出现未知的键(key): ${v(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} 中的键(key)无效`;case`invalid_union`:return`无效输入`;case`invalid_element`:return`${e.origin} 中包含无效值(value)`;default:return`无效输入`}}}}));function ec(){return{localeError:tc()}}var tc,nc=t((()=>{D(),tc=()=>{let e={string:{unit:`字元`,verb:`擁有`},file:{unit:`位元組`,verb:`擁有`},array:{unit:`項目`,verb:`擁有`},set:{unit:`項目`,verb:`擁有`}};function t(t){return e[t]??null}let 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:`輸入`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`無效的輸入值:預期為 instanceof ${e.expected},但收到 ${i}`:`無效的輸入值:預期為 ${t},但收到 ${i}`}case`invalid_value`:return e.values.length===1?`無效的輸入值:預期為 ${T(e.values[0])}`:`無效的選項:預期為以下其中之一 ${v(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`數值過大:預期 ${e.origin??`值`} 應為 ${n}${e.maximum.toString()} ${r.unit??`個元素`}`:`數值過大:預期 ${e.origin??`值`} 應為 ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`數值過小:預期 ${e.origin} 應為 ${n}${e.minimum.toString()} ${r.unit}`:`數值過小:預期 ${e.origin} 應為 ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`無效的字串:必須以 "${t.prefix}" 開頭`:t.format===`ends_with`?`無效的字串:必須以 "${t.suffix}" 結尾`:t.format===`includes`?`無效的字串:必須包含 "${t.includes}"`:t.format===`regex`?`無效的字串:必須符合格式 ${t.pattern}`:`無效的 ${n[t.format]??e.format}`}case`not_multiple_of`:return`無效的數字:必須為 ${e.divisor} 的倍數`;case`unrecognized_keys`:return`無法識別的鍵值${e.keys.length>1?`們`:``}:${v(e.keys,`、`)}`;case`invalid_key`:return`${e.origin} 中有無效的鍵值`;case`invalid_union`:return`無效的輸入值`;case`invalid_element`:return`${e.origin} 中有無效的值`;default:return`無效的輸入值`}}}}));function rc(){return{localeError:ic()}}var ic,ac=t((()=>{D(),ic=()=>{let e={string:{unit:`àmi`,verb:`ní`},file:{unit:`bytes`,verb:`ní`},array:{unit:`nkan`,verb:`ní`},set:{unit:`nkan`,verb:`ní`}};function t(t){return e[t]??null}let 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é`},r={nan:`NaN`,number:`nọ́mbà`,array:`akopọ`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${e.expected}, àmọ̀ a rí ${i}`:`Ìbáwọlé aṣìṣe: a ní láti fi ${t}, àmọ̀ a rí ${i}`}case`invalid_value`:return e.values.length===1?`Ìbáwọlé aṣìṣe: a ní láti fi ${T(e.values[0])}`:`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${v(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Tó pọ̀ jù: a ní láti jẹ́ pé ${e.origin??`iye`} ${r.verb} ${n}${e.maximum} ${r.unit}`:`Tó pọ̀ jù: a ní láti jẹ́ ${n}${e.maximum}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Kéré ju: a ní láti jẹ́ pé ${e.origin} ${r.verb} ${n}${e.minimum} ${r.unit}`:`Kéré ju: a ní láti jẹ́ ${n}${e.minimum}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${t.prefix}"`:t.format===`ends_with`?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${t.suffix}"`:t.format===`includes`?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${t.includes}"`:t.format===`regex`?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${t.pattern}`:`Aṣìṣe: ${n[t.format]??e.format}`}case`not_multiple_of`:return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${e.divisor}`;case`unrecognized_keys`:return`Bọtìnì àìmọ̀: ${v(e.keys,`, `)}`;case`invalid_key`:return`Bọtìnì aṣìṣe nínú ${e.origin}`;case`invalid_union`:return`Ìbáwọlé aṣìṣe`;case`invalid_element`:return`Iye aṣìṣe nínú ${e.origin}`;default:return`Ìbáwọlé aṣìṣe`}}}})),oc=n({ar:()=>sa,az:()=>ua,be:()=>ma,bg:()=>_a,ca:()=>ba,cs:()=>Ca,da:()=>Ea,de:()=>ka,el:()=>Ma,en:()=>Fa,eo:()=>Ra,es:()=>Va,fa:()=>Wa,fi:()=>qa,fr:()=>Xa,frCA:()=>$a,he:()=>no,hr:()=>ao,hu:()=>co,hy:()=>mo,id:()=>_o,is:()=>bo,it:()=>Co,ja:()=>Eo,ka:()=>ko,kh:()=>Fo,km:()=>Mo,ko:()=>Lo,lt:()=>Vo,mk:()=>Go,ms:()=>Jo,nl:()=>Zo,no:()=>es,ota:()=>rs,pl:()=>ls,ps:()=>os,pt:()=>fs,ro:()=>hs,ru:()=>ys,sl:()=>Ss,sv:()=>Ts,ta:()=>Os,th:()=>js,tr:()=>Ps,ua:()=>Bs,uk:()=>Ls,ur:()=>Hs,uz:()=>Gs,vi:()=>Js,yo:()=>rc,zhCN:()=>Zs,zhTW:()=>ec}),sc=t((()=>{la(),fa(),ga(),ya(),Sa(),Ta(),Oa(),ja(),Pa(),La(),Ba(),Ua(),Ka(),Ya(),Qa(),to(),io(),so(),uo(),go(),yo(),So(),To(),Oo(),jo(),Io(),Po(),zo(),Wo(),qo(),Xo(),$o(),ns(),as(),cs(),ds(),ms(),_s(),xs(),ws(),Ds(),As(),Ns(),Is(),Vs(),zs(),Ws(),qs(),Xs(),$s(),nc(),ac()}));function cc(){return new fc}var lc,uc,dc,fc,pc,mc=t((()=>{uc=Symbol(`ZodOutput`),dc=Symbol(`ZodInput`),fc=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}},(lc=globalThis).__zod_globalRegistry??(lc.__zod_globalRegistry=cc()),pc=globalThis.__zod_globalRegistry}));function hc(e,t){return new e({type:`string`,...w(t)})}function gc(e,t){return new e({type:`string`,coerce:!0,...w(t)})}function _c(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...w(t)})}function vc(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...w(t)})}function yc(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...w(t)})}function bc(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...w(t)})}function xc(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...w(t)})}function Sc(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...w(t)})}function Cc(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...w(t)})}function wc(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...w(t)})}function Tc(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...w(t)})}function Ec(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...w(t)})}function Dc(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...w(t)})}function Oc(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...w(t)})}function kc(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...w(t)})}function Ac(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...w(t)})}function jc(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...w(t)})}function Mc(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...w(t)})}function Nc(e,t){return new e({type:`string`,format:`mac`,check:`string_format`,abort:!1,...w(t)})}function Pc(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...w(t)})}function Fc(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...w(t)})}function Ic(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...w(t)})}function Lc(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...w(t)})}function Rc(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...w(t)})}function zc(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...w(t)})}function Bc(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...w(t)})}function Vc(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...w(t)})}function Hc(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...w(t)})}function Uc(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...w(t)})}function Wc(e,t){return new e({type:`number`,checks:[],...w(t)})}function Gc(e,t){return new e({type:`number`,coerce:!0,checks:[],...w(t)})}function Kc(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...w(t)})}function qc(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`float32`,...w(t)})}function Jc(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`float64`,...w(t)})}function Yc(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`int32`,...w(t)})}function Xc(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`uint32`,...w(t)})}function Zc(e,t){return new e({type:`boolean`,...w(t)})}function Qc(e,t){return new e({type:`boolean`,coerce:!0,...w(t)})}function $c(e,t){return new e({type:`bigint`,...w(t)})}function el(e,t){return new e({type:`bigint`,coerce:!0,...w(t)})}function tl(e,t){return new e({type:`bigint`,check:`bigint_format`,abort:!1,format:`int64`,...w(t)})}function nl(e,t){return new e({type:`bigint`,check:`bigint_format`,abort:!1,format:`uint64`,...w(t)})}function rl(e,t){return new e({type:`symbol`,...w(t)})}function il(e,t){return new e({type:`undefined`,...w(t)})}function al(e,t){return new e({type:`null`,...w(t)})}function ol(e){return new e({type:`any`})}function sl(e){return new e({type:`unknown`})}function cl(e,t){return new e({type:`never`,...w(t)})}function ll(e,t){return new e({type:`void`,...w(t)})}function ul(e,t){return new e({type:`date`,...w(t)})}function dl(e,t){return new e({type:`date`,coerce:!0,...w(t)})}function fl(e,t){return new e({type:`nan`,...w(t)})}function pl(e,t){return new Kn({check:`less_than`,...w(t),value:e,inclusive:!1})}function ml(e,t){return new Kn({check:`less_than`,...w(t),value:e,inclusive:!0})}function hl(e,t){return new qn({check:`greater_than`,...w(t),value:e,inclusive:!1})}function gl(e,t){return new qn({check:`greater_than`,...w(t),value:e,inclusive:!0})}function _l(e){return hl(0,e)}function vl(e){return pl(0,e)}function yl(e){return ml(0,e)}function bl(e){return gl(0,e)}function xl(e,t){return new Jn({check:`multiple_of`,...w(t),value:e})}function Sl(e,t){return new Zn({check:`max_size`,...w(t),maximum:e})}function Cl(e,t){return new Qn({check:`min_size`,...w(t),minimum:e})}function wl(e,t){return new $n({check:`size_equals`,...w(t),size:e})}function Tl(e,t){return new er({check:`max_length`,...w(t),maximum:e})}function El(e,t){return new tr({check:`min_length`,...w(t),minimum:e})}function Dl(e,t){return new nr({check:`length_equals`,...w(t),length:e})}function Ol(e,t){return new ir({check:`string_format`,format:`regex`,...w(t),pattern:e})}function kl(e){return new ar({check:`string_format`,format:`lowercase`,...w(e)})}function Al(e){return new or({check:`string_format`,format:`uppercase`,...w(e)})}function jl(e,t){return new sr({check:`string_format`,format:`includes`,...w(t),includes:e})}function Ml(e,t){return new cr({check:`string_format`,format:`starts_with`,...w(t),prefix:e})}function Nl(e,t){return new lr({check:`string_format`,format:`ends_with`,...w(t),suffix:e})}function Pl(e,t,n){return new ur({check:`property`,property:e,schema:t,...w(n)})}function Fl(e,t){return new dr({check:`mime_type`,mime:e,...w(t)})}function Il(e){return new fr({check:`overwrite`,tx:e})}function Ll(e){return Il(t=>t.normalize(e))}function Rl(){return Il(e=>e.trim())}function zl(){return Il(e=>e.toLowerCase())}function Bl(){return Il(e=>e.toUpperCase())}function Vl(){return Il(e=>fe(e))}function Hl(e,t,n){return new e({type:`array`,element:t,...w(n)})}function Ul(e,t,n){return new e({type:`union`,options:t,...w(n)})}function Wl(e,t,n){return new e({type:`union`,options:t,inclusive:!1,...w(n)})}function Gl(e,t,n,r){return new e({type:`union`,options:n,discriminator:t,...w(r)})}function Kl(e,t,n){return new e({type:`intersection`,left:t,right:n})}function ql(e,t,n,r){let i=n instanceof k;return new e({type:`tuple`,items:t,rest:i?n:null,...w(i?r:n)})}function Jl(e,t,n,r){return new e({type:`record`,keyType:t,valueType:n,...w(r)})}function Yl(e,t,n,r){return new e({type:`map`,keyType:t,valueType:n,...w(r)})}function Xl(e,t,n){return new e({type:`set`,valueType:t,...w(n)})}function Zl(e,t,n){return new e({type:`enum`,entries:Array.isArray(t)?Object.fromEntries(t.map(e=>[e,e])):t,...w(n)})}function Ql(e,t,n){return new e({type:`enum`,entries:t,...w(n)})}function $l(e,t,n){return new e({type:`literal`,values:Array.isArray(t)?t:[t],...w(n)})}function eu(e,t){return new e({type:`file`,...w(t)})}function tu(e,t){return new e({type:`transform`,transform:t})}function nu(e,t){return new e({type:`optional`,innerType:t})}function ru(e,t){return new e({type:`nullable`,innerType:t})}function iu(e,t,n){return new e({type:`default`,innerType:t,get defaultValue(){return typeof n==`function`?n():he(n)}})}function au(e,t,n){return new e({type:`nonoptional`,innerType:t,...w(n)})}function ou(e,t){return new e({type:`success`,innerType:t})}function su(e,t,n){return new e({type:`catch`,innerType:t,catchValue:typeof n==`function`?n:()=>n})}function cu(e,t,n){return new e({type:`pipe`,in:t,out:n})}function lu(e,t){return new e({type:`readonly`,innerType:t})}function uu(e,t,n){return new e({type:`template_literal`,parts:t,...w(n)})}function du(e,t){return new e({type:`lazy`,getter:t})}function fu(e,t){return new e({type:`promise`,innerType:t})}function pu(e,t,n){let r=w(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function mu(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...w(n)})}function hu(e,t){let n=gu(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Pe(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(Pe(r))}},e(t.value,t)),t);return n}function gu(e,t){let n=new O({check:`custom`,...w(t)});return n._zod.check=e,n}function _u(e){let t=new O({check:`describe`});return t._zod.onattach=[t=>{let n=pc.get(t)??{};pc.add(t,{...n,description:e})}],t._zod.check=()=>{},t}function vu(e){let t=new O({check:`meta`});return t._zod.onattach=[t=>{let n=pc.get(t)??{};pc.add(t,{...n,...e})}],t._zod.check=()=>{},t}function yu(e,t){let n=w(t),r=n.truthy??[`true`,`1`,`yes`,`on`,`y`,`enabled`],i=n.falsy??[`false`,`0`,`no`,`off`,`n`,`disabled`];n.case!==`sensitive`&&(r=r.map(e=>typeof e==`string`?e.toLowerCase():e),i=i.map(e=>typeof e==`string`?e.toLowerCase():e));let a=new Set(r),o=new Set(i),s=e.Codec??Qi,c=e.Boolean??gi,l=new s({type:`pipe`,in:new(e.String??Hr)({type:`string`,error:n.error}),out:new c({type:`boolean`,error:n.error}),transform:((e,t)=>{let r=e;return n.case!==`sensitive`&&(r=r.toLowerCase()),a.has(r)?!0:o.has(r)?!1:(t.issues.push({code:`invalid_value`,expected:`stringbool`,values:[...a,...o],input:t.value,inst:l,continue:!1}),{})}),reverseTransform:((e,t)=>e===!0?r[0]||`true`:i[0]||`false`),error:n.error});return l}function bu(e,t,n,r={}){let i=w(r),a={...w(r),check:`string_format`,type:`string`,format:t,fn:typeof n==`function`?n:e=>n.test(e),...i};return n instanceof RegExp&&(a.pattern=n),new e(a)}var xu,Su=t((()=>{pr(),mc(),oa(),D(),xu={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}}));function Cu(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??pc,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 j(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,j(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&Eu(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function wu(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
1258
+ `)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=fe,s=!d.jitless,c=s&&We.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?wr([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}}),Ai=i(`$ZodUnion`,(e,t)=>{k.init(e,t),y(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),y(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),y(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),y(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>ae(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>Tr(t,r,e,i)):Tr(o,r,e,i)}}),ji=i(`$ZodXor`,(e,t)=>{Ai.init(e,t),t.inclusive=!1;let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);t instanceof Promise?(o.push(t),a=!0):o.push(t)}return a?Promise.all(o).then(t=>Er(t,r,e,i)):Er(o,r,e,i)}}),Mi=i(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,Ai.init(e,t);let n=e._zod.parse;y(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=v(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!fe(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()),input:o,path:[t.discriminator],inst:e}),i)}}),Ni=i(`$ZodIntersection`,(e,t)=>{k.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Or(e,t,n)):Or(e,i,a)}}),Pi=i(`$ZodTuple`,(e,t)=>{k.init(e,t);let n=t.items;e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({input:a,inst:e,expected:`tuple`,code:`invalid_type`}),r;r.value=[];let o=[],s=kr(n,`optin`),c=kr(n,`optout`);if(!t.rest){if(a.length<s)return r.issues.push({code:`too_small`,minimum:s,inclusive:!0,input:a,inst:e,origin:`array`}),r;a.length>n.length&&r.issues.push({code:`too_big`,maximum:n.length,inclusive:!0,input:a,inst:e,origin:`array`})}let l=Array(n.length);for(let e=0;e<n.length;e++){let t=n[e]._zod.run({value:a[e],issues:[]},i);t instanceof Promise?o.push(t.then(t=>{l[e]=t})):l[e]=t}if(t.rest){let e=n.length-1,s=a.slice(n.length);for(let n of s){e++;let a=t.rest._zod.run({value:n,issues:[]},i);a instanceof Promise?o.push(a.then(t=>Ar(t,r,e))):Ar(a,r,e)}}return o.length?Promise.all(o).then(()=>jr(l,r,n,a,c)):jr(l,r,n,a,c)}}),Fi=i(`$ZodRecord`,(e,t)=>{k.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!pe(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let o=[],s=t.keyType._zod.values;if(s){n.value={};let c=new Set;for(let l of s)if(typeof l==`string`||typeof l==`number`||typeof l==`symbol`){c.add(typeof l==`number`?l.toString():l);let s=t.keyType._zod.run({value:l,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>je(e,r,a())),input:l,path:[l],inst:e});continue}let u=s.value,d=t.valueType._zod.run({value:i[l],issues:[]},r);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&n.issues.push(...ke(l,e.issues)),n.value[u]=e.value})):(d.issues.length&&n.issues.push(...ke(l,d.issues)),n.value[u]=d.value)}let l;for(let e in i)c.has(e)||(l??=[],l.push(e));l&&l.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:l})}else{n.value={};for(let s of Reflect.ownKeys(i)){if(s===`__proto__`||!Object.prototype.propertyIsEnumerable.call(i,s))continue;let c=t.keyType._zod.run({value:s,issues:[]},r);if(c instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof s==`string`&&xn.test(s)&&c.issues.length){let e=t.keyType._zod.run({value:Number(s),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(c=e)}if(c.issues.length){t.mode===`loose`?n.value[s]=i[s]:n.issues.push({code:`invalid_key`,origin:`record`,issues:c.issues.map(e=>je(e,r,a())),input:s,path:[s],inst:e});continue}let l=t.valueType._zod.run({value:i[s],issues:[]},r);l instanceof Promise?o.push(l.then(e=>{e.issues.length&&n.issues.push(...ke(s,e.issues)),n.value[c.value]=e.value})):(l.issues.length&&n.issues.push(...ke(s,l.issues)),n.value[c.value]=l.value)}}return o.length?Promise.all(o).then(()=>n):n}}),Ii=i(`$ZodMap`,(e,t)=>{k.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!(i instanceof Map))return n.issues.push({expected:`map`,code:`invalid_type`,input:i,inst:e}),n;let a=[];n.value=new Map;for(let[o,s]of i){let c=t.keyType._zod.run({value:o,issues:[]},r),l=t.valueType._zod.run({value:s,issues:[]},r);c instanceof Promise||l instanceof Promise?a.push(Promise.all([c,l]).then(([t,a])=>{Mr(t,a,n,o,i,e,r)})):Mr(c,l,n,o,i,e,r)}return a.length?Promise.all(a).then(()=>n):n}}),Li=i(`$ZodSet`,(e,t)=>{k.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!(i instanceof Set))return n.issues.push({input:i,inst:e,expected:`set`,code:`invalid_type`}),n;let a=[];n.value=new Set;for(let e of i){let i=t.valueType._zod.run({value:e,issues:[]},r);i instanceof Promise?a.push(i.then(e=>Nr(e,n))):Nr(i,n)}return a.length?Promise.all(a).then(()=>n):n}}),Ri=i(`$ZodEnum`,(e,t)=>{k.init(e,t);let n=g(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>Ke.has(typeof e)).map(e=>typeof e==`string`?ge(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),zi=i(`$ZodLiteral`,(e,t)=>{if(k.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?ge(e):e?ge(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),Bi=i(`$ZodFile`,(e,t)=>{k.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return r instanceof File||t.issues.push({expected:`file`,code:`invalid_type`,input:r,inst:e}),t}}),Vi=i(`$ZodTransform`,(e,t)=>{k.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new u(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n.fallback=!0,n));if(i instanceof Promise)throw new l;return n.value=i,n.fallback=!0,n}}),Hi=i(`$ZodOptional`,(e,t)=>{k.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,y(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),y(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${ae(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>Pr(e,r)):Pr(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Ui=i(`$ZodExactOptional`,(e,t)=>{Hi.init(e,t),y(e._zod,`values`,()=>t.innerType._zod.values),y(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Wi=i(`$ZodNullable`,(e,t)=>{k.init(e,t),y(e._zod,`optin`,()=>t.innerType._zod.optin),y(e._zod,`optout`,()=>t.innerType._zod.optout),y(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${ae(e.source)}|null)$`):void 0}),y(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Gi=i(`$ZodDefault`,(e,t)=>{k.init(e,t),e._zod.optin=`optional`,y(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Fr(e,t)):Fr(r,t)}}),Ki=i(`$ZodPrefault`,(e,t)=>{k.init(e,t),e._zod.optin=`optional`,y(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),qi=i(`$ZodNonOptional`,(e,t)=>{k.init(e,t),y(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Ir(t,e)):Ir(i,e)}}),Ji=i(`$ZodSuccess`,(e,t)=>{k.init(e,t),e._zod.parse=(e,n)=>{if(n.direction===`backward`)throw new u(`ZodSuccess`);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>(e.value=t.issues.length===0,e)):(e.value=r.issues.length===0,e)}}),Yi=i(`$ZodCatch`,(e,t)=>{k.init(e,t),e._zod.optin=`optional`,y(e._zod,`optout`,()=>t.innerType._zod.optout),y(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>je(e,n,a()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>je(e,n,a()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),Xi=i(`$ZodNaN`,(e,t)=>{k.init(e,t),e._zod.parse=(t,n)=>((typeof t.value!=`number`||!Number.isNaN(t.value))&&t.issues.push({input:t.value,inst:e,expected:`nan`,code:`invalid_type`}),t)}),Zi=i(`$ZodPipe`,(e,t)=>{k.init(e,t),y(e._zod,`values`,()=>t.in._zod.values),y(e._zod,`optin`,()=>t.in._zod.optin),y(e._zod,`optout`,()=>t.out._zod.optout),y(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Lr(e,t.in,n)):Lr(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Lr(e,t.out,n)):Lr(r,t.out,n)}}),Qi=i(`$ZodCodec`,(e,t)=>{k.init(e,t),y(e._zod,`values`,()=>t.in._zod.values),y(e._zod,`optin`,()=>t.in._zod.optin),y(e._zod,`optout`,()=>t.out._zod.optout),y(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if((n.direction||`forward`)===`forward`){let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Rr(e,t,n)):Rr(r,t,n)}else{let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Rr(e,t,n)):Rr(r,t,n)}}}),$i=i(`$ZodPreprocess`,(e,t)=>{Zi.init(e,t)}),ea=i(`$ZodReadonly`,(e,t)=>{k.init(e,t),y(e._zod,`propValues`,()=>t.innerType._zod.propValues),y(e._zod,`values`,()=>t.innerType._zod.values),y(e._zod,`optin`,()=>t.innerType?._zod?.optin),y(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Br):Br(r)}}),ta=i(`$ZodTemplateLiteral`,(e,t)=>{k.init(e,t);let n=[];for(let e of t.parts)if(typeof e==`object`&&e){if(!e._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...e._zod.traits].shift()}`);let t=e._zod.pattern instanceof RegExp?e._zod.pattern.source:e._zod.pattern;if(!t)throw Error(`Invalid template literal part: ${e._zod.traits}`);let r=+!!t.startsWith(`^`),i=t.endsWith(`$`)?t.length-1:t.length;n.push(t.slice(r,i))}else if(e===null||qe.has(typeof e))n.push(ge(`${e}`));else throw Error(`Invalid template literal part: ${e}`);e._zod.pattern=RegExp(`^${n.join(``)}$`),e._zod.parse=(n,r)=>typeof n.value==`string`?(e._zod.pattern.lastIndex=0,e._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:e,code:`invalid_format`,format:t.format??`template_literal`,pattern:e._zod.pattern.source}),n):(n.issues.push({input:n.value,inst:e,expected:`string`,code:`invalid_type`}),n)}),na=i(`$ZodFunction`,(e,t)=>(k.init(e,t),e._def=t,e._zod.def=t,e.implement=t=>{if(typeof t!=`function`)throw Error(`implement() must be called with a function`);return function(...n){let r=e._def.input?st(e._def.input,n):n,i=Reflect.apply(t,this,r);return e._def.output?st(e._def.output,i):i}},e.implementAsync=t=>{if(typeof t!=`function`)throw Error(`implementAsync() must be called with a function`);return async function(...n){let r=e._def.input?await lt(e._def.input,n):n,i=await Reflect.apply(t,this,r);return e._def.output?await lt(e._def.output,i):i}},e._zod.parse=(t,n)=>typeof t.value==`function`?(e._def.output&&e._def.output._zod.def.type===`promise`?t.value=e.implementAsync(t.value):t.value=e.implement(t.value),t):(t.issues.push({code:`invalid_type`,expected:`function`,input:t.value,inst:e}),t),e.input=(...t)=>{let n=e.constructor;return Array.isArray(t[0])?new n({type:`function`,input:new Pi({type:`tuple`,items:t[0],rest:t[1]}),output:e._def.output}):new n({type:`function`,input:t[0],output:e._def.output})},e.output=t=>{let n=e.constructor;return new n({type:`function`,input:e._def.input,output:t})},e)),ra=i(`$ZodPromise`,(e,t)=>{k.init(e,t),e._zod.parse=(e,n)=>Promise.resolve(e.value).then(e=>t.innerType._zod.run({value:e,issues:[]},n))}),ia=i(`$ZodLazy`,(e,t)=>{k.init(e,t),y(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),y(e._zod,`pattern`,()=>e._zod.innerType?._zod?.pattern),y(e._zod,`propValues`,()=>e._zod.innerType?._zod?.propValues),y(e._zod,`optin`,()=>e._zod.innerType?._zod?.optin??void 0),y(e._zod,`optout`,()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),aa=i(`$ZodCustom`,(e,t)=>{O.init(e,t),k.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Vr(t,n,r,e));Vr(i,n,r,e)}})}));function sa(){return{localeError:ca()}}var ca,la=t((()=>{D(),ca=()=>{let e={string:{unit:`حرف`,verb:`أن يحوي`},file:{unit:`بايت`,verb:`أن يحوي`},array:{unit:`عنصر`,verb:`أن يحوي`},set:{unit:`عنصر`,verb:`أن يحوي`}};function t(t){return e[t]??null}let 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:`مدخل`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`مدخلات غير مقبولة: يفترض إدخال instanceof ${e.expected}، ولكن تم إدخال ${i}`:`مدخلات غير مقبولة: يفترض إدخال ${t}، ولكن تم إدخال ${i}`}case`invalid_value`:return e.values.length===1?`مدخلات غير مقبولة: يفترض إدخال ${T(e.values[0])}`:`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${_(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?` أكبر من اللازم: يفترض أن تكون ${e.origin??`القيمة`} ${n} ${e.maximum.toString()} ${r.unit??`عنصر`}`:`أكبر من اللازم: يفترض أن تكون ${e.origin??`القيمة`} ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`أصغر من اللازم: يفترض لـ ${e.origin} أن يكون ${n} ${e.minimum.toString()} ${r.unit}`:`أصغر من اللازم: يفترض لـ ${e.origin} أن يكون ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`نَص غير مقبول: يجب أن يبدأ بـ "${e.prefix}"`:t.format===`ends_with`?`نَص غير مقبول: يجب أن ينتهي بـ "${t.suffix}"`:t.format===`includes`?`نَص غير مقبول: يجب أن يتضمَّن "${t.includes}"`:t.format===`regex`?`نَص غير مقبول: يجب أن يطابق النمط ${t.pattern}`:`${n[t.format]??e.format} غير مقبول`}case`not_multiple_of`:return`رقم غير مقبول: يجب أن يكون من مضاعفات ${e.divisor}`;case`unrecognized_keys`:return`معرف${e.keys.length>1?`ات`:``} غريب${e.keys.length>1?`ة`:``}: ${_(e.keys,`، `)}`;case`invalid_key`:return`معرف غير مقبول في ${e.origin}`;case`invalid_union`:return`مدخل غير مقبول`;case`invalid_element`:return`مدخل غير مقبول في ${e.origin}`;default:return`مدخل غير مقبول`}}}}));function ua(){return{localeError:da()}}var da,fa=t((()=>{D(),da=()=>{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(t){return e[t]??null}let 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`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Yanlış dəyər: gözlənilən instanceof ${e.expected}, daxil olan ${i}`:`Yanlış dəyər: gözlənilən ${t}, daxil olan ${i}`}case`invalid_value`:return e.values.length===1?`Yanlış dəyər: gözlənilən ${T(e.values[0])}`:`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${_(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Çox böyük: gözlənilən ${e.origin??`dəyər`} ${n}${e.maximum.toString()} ${r.unit??`element`}`:`Çox böyük: gözlənilən ${e.origin??`dəyər`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Çox kiçik: gözlənilən ${e.origin} ${n}${e.minimum.toString()} ${r.unit}`:`Çox kiçik: gözlənilən ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Yanlış mətn: "${t.prefix}" ilə başlamalıdır`:t.format===`ends_with`?`Yanlış mətn: "${t.suffix}" ilə bitməlidir`:t.format===`includes`?`Yanlış mətn: "${t.includes}" daxil olmalıdır`:t.format===`regex`?`Yanlış mətn: ${t.pattern} şablonuna uyğun olmalıdır`:`Yanlış ${n[t.format]??e.format}`}case`not_multiple_of`:return`Yanlış ədəd: ${e.divisor} ilə bölünə bilən olmalıdır`;case`unrecognized_keys`:return`Tanınmayan açar${e.keys.length>1?`lar`:``}: ${_(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} daxilində yanlış açar`;case`invalid_union`:return`Yanlış dəyər`;case`invalid_element`:return`${e.origin} daxilində yanlış dəyər`;default:return`Yanlış dəyər`}}}}));function pa(e,t,n,r){let i=Math.abs(e),a=i%10,o=i%100;return o>=11&&o<=19?r:a===1?t:a>=2&&a<=4?n:r}function ma(){return{localeError:ha()}}var ha,ga=t((()=>{D(),ha=()=>{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(t){return e[t]??null}let 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:`увод`},r={nan:`NaN`,number:`лік`,array:`масіў`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Няправільны ўвод: чакаўся instanceof ${e.expected}, атрымана ${i}`:`Няправільны ўвод: чакаўся ${t}, атрымана ${i}`}case`invalid_value`:return e.values.length===1?`Няправільны ўвод: чакалася ${T(e.values[0])}`:`Няправільны варыянт: чакаўся адзін з ${_(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);if(r){let t=pa(Number(e.maximum),r.unit.one,r.unit.few,r.unit.many);return`Занадта вялікі: чакалася, што ${e.origin??`значэнне`} павінна ${r.verb} ${n}${e.maximum.toString()} ${t}`}return`Занадта вялікі: чакалася, што ${e.origin??`значэнне`} павінна быць ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);if(r){let t=pa(Number(e.minimum),r.unit.one,r.unit.few,r.unit.many);return`Занадта малы: чакалася, што ${e.origin} павінна ${r.verb} ${n}${e.minimum.toString()} ${t}`}return`Занадта малы: чакалася, што ${e.origin} павінна быць ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Няправільны радок: павінен пачынацца з "${t.prefix}"`:t.format===`ends_with`?`Няправільны радок: павінен заканчвацца на "${t.suffix}"`:t.format===`includes`?`Няправільны радок: павінен змяшчаць "${t.includes}"`:t.format===`regex`?`Няправільны радок: павінен адпавядаць шаблону ${t.pattern}`:`Няправільны ${n[t.format]??e.format}`}case`not_multiple_of`:return`Няправільны лік: павінен быць кратным ${e.divisor}`;case`unrecognized_keys`:return`Нераспазнаны ${e.keys.length>1?`ключы`:`ключ`}: ${_(e.keys,`, `)}`;case`invalid_key`:return`Няправільны ключ у ${e.origin}`;case`invalid_union`:return`Няправільны ўвод`;case`invalid_element`:return`Няправільнае значэнне ў ${e.origin}`;default:return`Няправільны ўвод`}}}}));function _a(){return{localeError:va()}}var va,ya=t((()=>{D(),va=()=>{let e={string:{unit:`символа`,verb:`да съдържа`},file:{unit:`байта`,verb:`да съдържа`},array:{unit:`елемента`,verb:`да съдържа`},set:{unit:`елемента`,verb:`да съдържа`}};function t(t){return e[t]??null}let 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:`вход`},r={nan:`NaN`,number:`число`,array:`масив`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Невалиден вход: очакван instanceof ${e.expected}, получен ${i}`:`Невалиден вход: очакван ${t}, получен ${i}`}case`invalid_value`:return e.values.length===1?`Невалиден вход: очакван ${T(e.values[0])}`:`Невалидна опция: очаквано едно от ${_(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Твърде голямо: очаква се ${e.origin??`стойност`} да съдържа ${n}${e.maximum.toString()} ${r.unit??`елемента`}`:`Твърде голямо: очаква се ${e.origin??`стойност`} да бъде ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Твърде малко: очаква се ${e.origin} да съдържа ${n}${e.minimum.toString()} ${r.unit}`:`Твърде малко: очаква се ${e.origin} да бъде ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;if(t.format===`starts_with`)return`Невалиден низ: трябва да започва с "${t.prefix}"`;if(t.format===`ends_with`)return`Невалиден низ: трябва да завършва с "${t.suffix}"`;if(t.format===`includes`)return`Невалиден низ: трябва да включва "${t.includes}"`;if(t.format===`regex`)return`Невалиден низ: трябва да съвпада с ${t.pattern}`;let r=`Невалиден`;return t.format===`emoji`&&(r=`Невалидно`),t.format===`datetime`&&(r=`Невалидно`),t.format===`date`&&(r=`Невалидна`),t.format===`time`&&(r=`Невалидно`),t.format===`duration`&&(r=`Невалидна`),`${r} ${n[t.format]??e.format}`}case`not_multiple_of`:return`Невалидно число: трябва да бъде кратно на ${e.divisor}`;case`unrecognized_keys`:return`Неразпознат${e.keys.length>1?`и`:``} ключ${e.keys.length>1?`ове`:``}: ${_(e.keys,`, `)}`;case`invalid_key`:return`Невалиден ключ в ${e.origin}`;case`invalid_union`:return`Невалиден вход`;case`invalid_element`:return`Невалидна стойност в ${e.origin}`;default:return`Невалиден вход`}}}}));function ba(){return{localeError:xa()}}var xa,Sa=t((()=>{D(),xa=()=>{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(t){return e[t]??null}let 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`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Tipus invàlid: s'esperava instanceof ${e.expected}, s'ha rebut ${i}`:`Tipus invàlid: s'esperava ${t}, s'ha rebut ${i}`}case`invalid_value`:return e.values.length===1?`Valor invàlid: s'esperava ${T(e.values[0])}`:`Opció invàlida: s'esperava una de ${_(e.values,` o `)}`;case`too_big`:{let n=e.inclusive?`com a màxim`:`menys de`,r=t(e.origin);return r?`Massa gran: s'esperava que ${e.origin??`el valor`} contingués ${n} ${e.maximum.toString()} ${r.unit??`elements`}`:`Massa gran: s'esperava que ${e.origin??`el valor`} fos ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`com a mínim`:`més de`,r=t(e.origin);return r?`Massa petit: s'esperava que ${e.origin} contingués ${n} ${e.minimum.toString()} ${r.unit}`:`Massa petit: s'esperava que ${e.origin} fos ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Format invàlid: ha de començar amb "${t.prefix}"`:t.format===`ends_with`?`Format invàlid: ha d'acabar amb "${t.suffix}"`:t.format===`includes`?`Format invàlid: ha d'incloure "${t.includes}"`:t.format===`regex`?`Format invàlid: ha de coincidir amb el patró ${t.pattern}`:`Format invàlid per a ${n[t.format]??e.format}`}case`not_multiple_of`:return`Número invàlid: ha de ser múltiple de ${e.divisor}`;case`unrecognized_keys`:return`Clau${e.keys.length>1?`s`:``} no reconeguda${e.keys.length>1?`s`:``}: ${_(e.keys,`, `)}`;case`invalid_key`:return`Clau invàlida a ${e.origin}`;case`invalid_union`:return`Entrada invàlida`;case`invalid_element`:return`Element invàlid a ${e.origin}`;default:return`Entrada invàlida`}}}}));function Ca(){return{localeError:wa()}}var wa,Ta=t((()=>{D(),wa=()=>{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(t){return e[t]??null}let 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`},r={nan:`NaN`,number:`číslo`,string:`řetězec`,function:`funkce`,array:`pole`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Neplatný vstup: očekáváno instanceof ${e.expected}, obdrženo ${i}`:`Neplatný vstup: očekáváno ${t}, obdrženo ${i}`}case`invalid_value`:return e.values.length===1?`Neplatný vstup: očekáváno ${T(e.values[0])}`:`Neplatná možnost: očekávána jedna z hodnot ${_(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Hodnota je příliš velká: ${e.origin??`hodnota`} musí mít ${n}${e.maximum.toString()} ${r.unit??`prvků`}`:`Hodnota je příliš velká: ${e.origin??`hodnota`} musí být ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Hodnota je příliš malá: ${e.origin??`hodnota`} musí mít ${n}${e.minimum.toString()} ${r.unit??`prvků`}`:`Hodnota je příliš malá: ${e.origin??`hodnota`} musí být ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Neplatný řetězec: musí začínat na "${t.prefix}"`:t.format===`ends_with`?`Neplatný řetězec: musí končit na "${t.suffix}"`:t.format===`includes`?`Neplatný řetězec: musí obsahovat "${t.includes}"`:t.format===`regex`?`Neplatný řetězec: musí odpovídat vzoru ${t.pattern}`:`Neplatný formát ${n[t.format]??e.format}`}case`not_multiple_of`:return`Neplatné číslo: musí být násobkem ${e.divisor}`;case`unrecognized_keys`:return`Neznámé klíče: ${_(e.keys,`, `)}`;case`invalid_key`:return`Neplatný klíč v ${e.origin}`;case`invalid_union`:return`Neplatný vstup`;case`invalid_element`:return`Neplatná hodnota v ${e.origin}`;default:return`Neplatný vstup`}}}}));function Ea(){return{localeError:Da()}}var Da,Oa=t((()=>{D(),Da=()=>{let e={string:{unit:`tegn`,verb:`havde`},file:{unit:`bytes`,verb:`havde`},array:{unit:`elementer`,verb:`indeholdt`},set:{unit:`elementer`,verb:`indeholdt`}};function t(t){return e[t]??null}let 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`},r={nan:`NaN`,string:`streng`,number:`tal`,boolean:`boolean`,array:`liste`,object:`objekt`,set:`sæt`,file:`fil`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ugyldigt input: forventede instanceof ${e.expected}, fik ${i}`:`Ugyldigt input: forventede ${t}, fik ${i}`}case`invalid_value`:return e.values.length===1?`Ugyldig værdi: forventede ${T(e.values[0])}`:`Ugyldigt valg: forventede en af følgende ${_(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,i=t(e.origin),a=r[e.origin]??e.origin;return i?`For stor: forventede ${a??`value`} ${i.verb} ${n} ${e.maximum.toString()} ${i.unit??`elementer`}`:`For stor: forventede ${a??`value`} havde ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,i=t(e.origin),a=r[e.origin]??e.origin;return i?`For lille: forventede ${a} ${i.verb} ${n} ${e.minimum.toString()} ${i.unit}`:`For lille: forventede ${a} havde ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ugyldig streng: skal starte med "${t.prefix}"`:t.format===`ends_with`?`Ugyldig streng: skal ende med "${t.suffix}"`:t.format===`includes`?`Ugyldig streng: skal indeholde "${t.includes}"`:t.format===`regex`?`Ugyldig streng: skal matche mønsteret ${t.pattern}`:`Ugyldig ${n[t.format]??e.format}`}case`not_multiple_of`:return`Ugyldigt tal: skal være deleligt med ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Ukendte nøgler`:`Ukendt nøgle`}: ${_(e.keys,`, `)}`;case`invalid_key`:return`Ugyldig nøgle i ${e.origin}`;case`invalid_union`:return`Ugyldigt input: matcher ingen af de tilladte typer`;case`invalid_element`:return`Ugyldig værdi i ${e.origin}`;default:return`Ugyldigt input`}}}}));function ka(){return{localeError:Aa()}}var Aa,ja=t((()=>{D(),Aa=()=>{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(t){return e[t]??null}let 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`},r={nan:`NaN`,number:`Zahl`,array:`Array`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ungültige Eingabe: erwartet instanceof ${e.expected}, erhalten ${i}`:`Ungültige Eingabe: erwartet ${t}, erhalten ${i}`}case`invalid_value`:return e.values.length===1?`Ungültige Eingabe: erwartet ${T(e.values[0])}`:`Ungültige Option: erwartet eine von ${_(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Zu groß: erwartet, dass ${e.origin??`Wert`} ${n}${e.maximum.toString()} ${r.unit??`Elemente`} hat`:`Zu groß: erwartet, dass ${e.origin??`Wert`} ${n}${e.maximum.toString()} ist`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Zu klein: erwartet, dass ${e.origin} ${n}${e.minimum.toString()} ${r.unit} hat`:`Zu klein: erwartet, dass ${e.origin} ${n}${e.minimum.toString()} ist`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ungültiger String: muss mit "${t.prefix}" beginnen`:t.format===`ends_with`?`Ungültiger String: muss mit "${t.suffix}" enden`:t.format===`includes`?`Ungültiger String: muss "${t.includes}" enthalten`:t.format===`regex`?`Ungültiger String: muss dem Muster ${t.pattern} entsprechen`:`Ungültig: ${n[t.format]??e.format}`}case`not_multiple_of`:return`Ungültige Zahl: muss ein Vielfaches von ${e.divisor} sein`;case`unrecognized_keys`:return`${e.keys.length>1?`Unbekannte Schlüssel`:`Unbekannter Schlüssel`}: ${_(e.keys,`, `)}`;case`invalid_key`:return`Ungültiger Schlüssel in ${e.origin}`;case`invalid_union`:return`Ungültige Eingabe`;case`invalid_element`:return`Ungültiger Wert in ${e.origin}`;default:return`Ungültige Eingabe`}}}}));function Ma(){return{localeError:Na()}}var Na,Pa=t((()=>{D(),Na=()=>{let e={string:{unit:`χαρακτήρες`,verb:`να έχει`},file:{unit:`bytes`,verb:`να έχει`},array:{unit:`στοιχεία`,verb:`να έχει`},set:{unit:`στοιχεία`,verb:`να έχει`},map:{unit:`καταχωρήσεις`,verb:`να έχει`}};function t(t){return e[t]??null}let 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:`είσοδος`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return typeof e.expected==`string`&&/^[A-Z]/.test(e.expected)?`Μη έγκυρη είσοδος: αναμενόταν instanceof ${e.expected}, λήφθηκε ${i}`:`Μη έγκυρη είσοδος: αναμενόταν ${t}, λήφθηκε ${i}`}case`invalid_value`:return e.values.length===1?`Μη έγκυρη είσοδος: αναμενόταν ${T(e.values[0])}`:`Μη έγκυρη επιλογή: αναμενόταν ένα από ${_(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Πολύ μεγάλο: αναμενόταν ${e.origin??`τιμή`} να έχει ${n}${e.maximum.toString()} ${r.unit??`στοιχεία`}`:`Πολύ μεγάλο: αναμενόταν ${e.origin??`τιμή`} να είναι ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Πολύ μικρό: αναμενόταν ${e.origin} να έχει ${n}${e.minimum.toString()} ${r.unit}`:`Πολύ μικρό: αναμενόταν ${e.origin} να είναι ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Μη έγκυρη συμβολοσειρά: πρέπει να ξεκινά με "${t.prefix}"`:t.format===`ends_with`?`Μη έγκυρη συμβολοσειρά: πρέπει να τελειώνει με "${t.suffix}"`:t.format===`includes`?`Μη έγκυρη συμβολοσειρά: πρέπει να περιέχει "${t.includes}"`:t.format===`regex`?`Μη έγκυρη συμβολοσειρά: πρέπει να ταιριάζει με το μοτίβο ${t.pattern}`:`Μη έγκυρο: ${n[t.format]??e.format}`}case`not_multiple_of`:return`Μη έγκυρος αριθμός: πρέπει να είναι πολλαπλάσιο του ${e.divisor}`;case`unrecognized_keys`:return`Άγνωστ${e.keys.length>1?`α`:`ο`} κλειδ${e.keys.length>1?`ιά`:`ί`}: ${_(e.keys,`, `)}`;case`invalid_key`:return`Μη έγκυρο κλειδί στο ${e.origin}`;case`invalid_union`:return`Μη έγκυρη είσοδος`;case`invalid_element`:return`Μη έγκυρη τιμή στο ${e.origin}`;default:return`Μη έγκυρη είσοδος`}}}}));function Fa(){return{localeError:Ia()}}var Ia,La=t((()=>{D(),Ia=()=>{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(t){return e[t]??null}let 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`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input);return`Invalid input: expected ${t}, received ${r[n]??n}`}case`invalid_value`:return e.values.length===1?`Invalid input: expected ${T(e.values[0])}`:`Invalid option: expected one of ${_(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${_(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}}}));function Ra(){return{localeError:za()}}var za,Ba=t((()=>{D(),za=()=>{let e={string:{unit:`karaktrojn`,verb:`havi`},file:{unit:`bajtojn`,verb:`havi`},array:{unit:`elementojn`,verb:`havi`},set:{unit:`elementojn`,verb:`havi`}};function t(t){return e[t]??null}let 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`},r={nan:`NaN`,number:`nombro`,array:`tabelo`,null:`senvalora`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Nevalida enigo: atendiĝis instanceof ${e.expected}, riceviĝis ${i}`:`Nevalida enigo: atendiĝis ${t}, riceviĝis ${i}`}case`invalid_value`:return e.values.length===1?`Nevalida enigo: atendiĝis ${T(e.values[0])}`:`Nevalida opcio: atendiĝis unu el ${_(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Tro granda: atendiĝis ke ${e.origin??`valoro`} havu ${n}${e.maximum.toString()} ${r.unit??`elementojn`}`:`Tro granda: atendiĝis ke ${e.origin??`valoro`} havu ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Tro malgranda: atendiĝis ke ${e.origin} havu ${n}${e.minimum.toString()} ${r.unit}`:`Tro malgranda: atendiĝis ke ${e.origin} estu ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Nevalida karaktraro: devas komenciĝi per "${t.prefix}"`:t.format===`ends_with`?`Nevalida karaktraro: devas finiĝi per "${t.suffix}"`:t.format===`includes`?`Nevalida karaktraro: devas inkluzivi "${t.includes}"`:t.format===`regex`?`Nevalida karaktraro: devas kongrui kun la modelo ${t.pattern}`:`Nevalida ${n[t.format]??e.format}`}case`not_multiple_of`:return`Nevalida nombro: devas esti oblo de ${e.divisor}`;case`unrecognized_keys`:return`Nekonata${e.keys.length>1?`j`:``} ŝlosilo${e.keys.length>1?`j`:``}: ${_(e.keys,`, `)}`;case`invalid_key`:return`Nevalida ŝlosilo en ${e.origin}`;case`invalid_union`:return`Nevalida enigo`;case`invalid_element`:return`Nevalida valoro en ${e.origin}`;default:return`Nevalida enigo`}}}}));function Va(){return{localeError:Ha()}}var Ha,Ua=t((()=>{D(),Ha=()=>{let e={string:{unit:`caracteres`,verb:`tener`},file:{unit:`bytes`,verb:`tener`},array:{unit:`elementos`,verb:`tener`},set:{unit:`elementos`,verb:`tener`}};function t(t){return e[t]??null}let 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`},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 e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Entrada inválida: se esperaba instanceof ${e.expected}, recibido ${i}`:`Entrada inválida: se esperaba ${t}, recibido ${i}`}case`invalid_value`:return e.values.length===1?`Entrada inválida: se esperaba ${T(e.values[0])}`:`Opción inválida: se esperaba una de ${_(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,i=t(e.origin),a=r[e.origin]??e.origin;return i?`Demasiado grande: se esperaba que ${a??`valor`} tuviera ${n}${e.maximum.toString()} ${i.unit??`elementos`}`:`Demasiado grande: se esperaba que ${a??`valor`} fuera ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,i=t(e.origin),a=r[e.origin]??e.origin;return i?`Demasiado pequeño: se esperaba que ${a} tuviera ${n}${e.minimum.toString()} ${i.unit}`:`Demasiado pequeño: se esperaba que ${a} fuera ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Cadena inválida: debe comenzar con "${t.prefix}"`:t.format===`ends_with`?`Cadena inválida: debe terminar en "${t.suffix}"`:t.format===`includes`?`Cadena inválida: debe incluir "${t.includes}"`:t.format===`regex`?`Cadena inválida: debe coincidir con el patrón ${t.pattern}`:`Inválido ${n[t.format]??e.format}`}case`not_multiple_of`:return`Número inválido: debe ser múltiplo de ${e.divisor}`;case`unrecognized_keys`:return`Llave${e.keys.length>1?`s`:``} desconocida${e.keys.length>1?`s`:``}: ${_(e.keys,`, `)}`;case`invalid_key`:return`Llave inválida en ${r[e.origin]??e.origin}`;case`invalid_union`:return`Entrada inválida`;case`invalid_element`:return`Valor inválido en ${r[e.origin]??e.origin}`;default:return`Entrada inválida`}}}}));function Wa(){return{localeError:Ga()}}var Ga,Ka=t((()=>{D(),Ga=()=>{let e={string:{unit:`کاراکتر`,verb:`داشته باشد`},file:{unit:`بایت`,verb:`داشته باشد`},array:{unit:`آیتم`,verb:`داشته باشد`},set:{unit:`آیتم`,verb:`داشته باشد`}};function t(t){return e[t]??null}let 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:`ورودی`},r={nan:`NaN`,number:`عدد`,array:`آرایه`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`ورودی نامعتبر: می‌بایست instanceof ${e.expected} می‌بود، ${i} دریافت شد`:`ورودی نامعتبر: می‌بایست ${t} می‌بود، ${i} دریافت شد`}case`invalid_value`:return e.values.length===1?`ورودی نامعتبر: می‌بایست ${T(e.values[0])} می‌بود`:`گزینه نامعتبر: می‌بایست یکی از ${_(e.values,`|`)} می‌بود`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`خیلی بزرگ: ${e.origin??`مقدار`} باید ${n}${e.maximum.toString()} ${r.unit??`عنصر`} باشد`:`خیلی بزرگ: ${e.origin??`مقدار`} باید ${n}${e.maximum.toString()} باشد`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`خیلی کوچک: ${e.origin} باید ${n}${e.minimum.toString()} ${r.unit} باشد`:`خیلی کوچک: ${e.origin} باید ${n}${e.minimum.toString()} باشد`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`رشته نامعتبر: باید با "${t.prefix}" شروع شود`:t.format===`ends_with`?`رشته نامعتبر: باید با "${t.suffix}" تمام شود`:t.format===`includes`?`رشته نامعتبر: باید شامل "${t.includes}" باشد`:t.format===`regex`?`رشته نامعتبر: باید با الگوی ${t.pattern} مطابقت داشته باشد`:`${n[t.format]??e.format} نامعتبر`}case`not_multiple_of`:return`عدد نامعتبر: باید مضرب ${e.divisor} باشد`;case`unrecognized_keys`:return`کلید${e.keys.length>1?`های`:``} ناشناس: ${_(e.keys,`, `)}`;case`invalid_key`:return`کلید ناشناس در ${e.origin}`;case`invalid_union`:return`ورودی نامعتبر`;case`invalid_element`:return`مقدار نامعتبر در ${e.origin}`;default:return`ورودی نامعتبر`}}}}));function qa(){return{localeError:Ja()}}var Ja,Ya=t((()=>{D(),Ja=()=>{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(t){return e[t]??null}let 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`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Virheellinen tyyppi: odotettiin instanceof ${e.expected}, oli ${i}`:`Virheellinen tyyppi: odotettiin ${t}, oli ${i}`}case`invalid_value`:return e.values.length===1?`Virheellinen syöte: täytyy olla ${T(e.values[0])}`:`Virheellinen valinta: täytyy olla yksi seuraavista: ${_(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Liian suuri: ${r.subject} täytyy olla ${n}${e.maximum.toString()} ${r.unit}`.trim():`Liian suuri: arvon täytyy olla ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Liian pieni: ${r.subject} täytyy olla ${n}${e.minimum.toString()} ${r.unit}`.trim():`Liian pieni: arvon täytyy olla ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Virheellinen syöte: täytyy alkaa "${t.prefix}"`:t.format===`ends_with`?`Virheellinen syöte: täytyy loppua "${t.suffix}"`:t.format===`includes`?`Virheellinen syöte: täytyy sisältää "${t.includes}"`:t.format===`regex`?`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${t.pattern}`:`Virheellinen ${n[t.format]??e.format}`}case`not_multiple_of`:return`Virheellinen luku: täytyy olla luvun ${e.divisor} monikerta`;case`unrecognized_keys`:return`${e.keys.length>1?`Tuntemattomat avaimet`:`Tuntematon avain`}: ${_(e.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 Xa(){return{localeError:Za()}}var Za,Qa=t((()=>{D(),Za=()=>{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(t){return e[t]??null}let 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`},r={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 e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Entrée invalide : instanceof ${e.expected} attendu, ${i} reçu`:`Entrée invalide : ${t} attendu, ${i} reçu`}case`invalid_value`:return e.values.length===1?`Entrée invalide : ${T(e.values[0])} attendu`:`Option invalide : une valeur parmi ${_(e.values,`|`)} attendue`;case`too_big`:{let n=e.inclusive?`<=`:`<`,i=t(e.origin);return i?`Trop grand : ${r[e.origin]??`valeur`} doit ${i.verb} ${n}${e.maximum.toString()} ${i.unit??`élément(s)`}`:`Trop grand : ${r[e.origin]??`valeur`} doit être ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,i=t(e.origin);return i?`Trop petit : ${r[e.origin]??`valeur`} doit ${i.verb} ${n}${e.minimum.toString()} ${i.unit}`:`Trop petit : ${r[e.origin]??`valeur`} doit être ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Chaîne invalide : doit commencer par "${t.prefix}"`:t.format===`ends_with`?`Chaîne invalide : doit se terminer par "${t.suffix}"`:t.format===`includes`?`Chaîne invalide : doit inclure "${t.includes}"`:t.format===`regex`?`Chaîne invalide : doit correspondre au modèle ${t.pattern}`:`${n[t.format]??e.format} invalide`}case`not_multiple_of`:return`Nombre invalide : doit être un multiple de ${e.divisor}`;case`unrecognized_keys`:return`Clé${e.keys.length>1?`s`:``} non reconnue${e.keys.length>1?`s`:``} : ${_(e.keys,`, `)}`;case`invalid_key`:return`Clé invalide dans ${e.origin}`;case`invalid_union`:return`Entrée invalide`;case`invalid_element`:return`Valeur invalide dans ${e.origin}`;default:return`Entrée invalide`}}}}));function $a(){return{localeError:eo()}}var eo,to=t((()=>{D(),eo=()=>{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(t){return e[t]??null}let 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`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Entrée invalide : attendu instanceof ${e.expected}, reçu ${i}`:`Entrée invalide : attendu ${t}, reçu ${i}`}case`invalid_value`:return e.values.length===1?`Entrée invalide : attendu ${T(e.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${_(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`≤`:`<`,r=t(e.origin);return r?`Trop grand : attendu que ${e.origin??`la valeur`} ait ${n}${e.maximum.toString()} ${r.unit}`:`Trop grand : attendu que ${e.origin??`la valeur`} soit ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`≥`:`>`,r=t(e.origin);return r?`Trop petit : attendu que ${e.origin} ait ${n}${e.minimum.toString()} ${r.unit}`:`Trop petit : attendu que ${e.origin} soit ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Chaîne invalide : doit commencer par "${t.prefix}"`:t.format===`ends_with`?`Chaîne invalide : doit se terminer par "${t.suffix}"`:t.format===`includes`?`Chaîne invalide : doit inclure "${t.includes}"`:t.format===`regex`?`Chaîne invalide : doit correspondre au motif ${t.pattern}`:`${n[t.format]??e.format} invalide`}case`not_multiple_of`:return`Nombre invalide : doit être un multiple de ${e.divisor}`;case`unrecognized_keys`:return`Clé${e.keys.length>1?`s`:``} non reconnue${e.keys.length>1?`s`:``} : ${_(e.keys,`, `)}`;case`invalid_key`:return`Clé invalide dans ${e.origin}`;case`invalid_union`:return`Entrée invalide`;case`invalid_element`:return`Valeur invalide dans ${e.origin}`;default:return`Entrée invalide`}}}}));function no(){return{localeError:ro()}}var ro,io=t((()=>{D(),ro=()=>{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:`גדול`}},n=t=>t?e[t]:void 0,r=t=>{let r=n(t);return r?r.label:t??e.unknown.label},i=e=>`ה${r(e)}`,a=e=>(n(e)?.gender??`m`)===`f`?`צריכה להיות`:`צריך להיות`,o=e=>e?t[e]??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`}},c={nan:`NaN`};return t=>{switch(t.code){case`invalid_type`:{let n=t.expected,i=c[n??``]??r(n),a=E(t.input),o=c[a]??e[a]?.label??a;return/^[A-Z]/.test(t.expected)?`קלט לא תקין: צריך להיות instanceof ${t.expected}, התקבל ${o}`:`קלט לא תקין: צריך להיות ${i}, התקבל ${o}`}case`invalid_value`:{if(t.values.length===1)return`ערך לא תקין: הערך חייב להיות ${T(t.values[0])}`;let e=t.values.map(e=>T(e));if(t.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${e[0]} או ${e[1]}`;let n=e[e.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${e.slice(0,-1).join(`, `)} או ${n}`}case`too_big`:{let e=o(t.origin),n=i(t.origin??`value`);if(t.origin===`string`)return`${e?.longLabel??`ארוך`} מדי: ${n} צריכה להכיל ${t.maximum.toString()} ${e?.unit??``} ${t.inclusive?`או פחות`:`לכל היותר`}`.trim();if(t.origin===`number`)return`גדול מדי: ${n} צריך להיות ${t.inclusive?`קטן או שווה ל-${t.maximum}`:`קטן מ-${t.maximum}`}`;if(t.origin===`array`||t.origin===`set`)return`גדול מדי: ${n} ${t.origin===`set`?`צריכה`:`צריך`} להכיל ${t.inclusive?`${t.maximum} ${e?.unit??``} או פחות`:`פחות מ-${t.maximum} ${e?.unit??``}`}`.trim();let r=t.inclusive?`<=`:`<`,s=a(t.origin??`value`);return e?.unit?`${e.longLabel} מדי: ${n} ${s} ${r}${t.maximum.toString()} ${e.unit}`:`${e?.longLabel??`גדול`} מדי: ${n} ${s} ${r}${t.maximum.toString()}`}case`too_small`:{let e=o(t.origin),n=i(t.origin??`value`);if(t.origin===`string`)return`${e?.shortLabel??`קצר`} מדי: ${n} צריכה להכיל ${t.minimum.toString()} ${e?.unit??``} ${t.inclusive?`או יותר`:`לפחות`}`.trim();if(t.origin===`number`)return`קטן מדי: ${n} צריך להיות ${t.inclusive?`גדול או שווה ל-${t.minimum}`:`גדול מ-${t.minimum}`}`;if(t.origin===`array`||t.origin===`set`){let r=t.origin===`set`?`צריכה`:`צריך`;return t.minimum===1&&t.inclusive?`קטן מדי: ${n} ${r} להכיל ${t.origin,`לפחות פריט אחד`}`:`קטן מדי: ${n} ${r} להכיל ${t.inclusive?`${t.minimum} ${e?.unit??``} או יותר`:`יותר מ-${t.minimum} ${e?.unit??``}`}`.trim()}let r=t.inclusive?`>=`:`>`,s=a(t.origin??`value`);return e?.unit?`${e.shortLabel} מדי: ${n} ${s} ${r}${t.minimum.toString()} ${e.unit}`:`${e?.shortLabel??`קטן`} מדי: ${n} ${s} ${r}${t.minimum.toString()}`}case`invalid_format`:{let e=t;if(e.format===`starts_with`)return`המחרוזת חייבת להתחיל ב "${e.prefix}"`;if(e.format===`ends_with`)return`המחרוזת חייבת להסתיים ב "${e.suffix}"`;if(e.format===`includes`)return`המחרוזת חייבת לכלול "${e.includes}"`;if(e.format===`regex`)return`המחרוזת חייבת להתאים לתבנית ${e.pattern}`;let n=s[e.format];return`${n?.label??e.format} לא ${(n?.gender??`m`)===`f`?`תקינה`:`תקין`}`}case`not_multiple_of`:return`מספר לא תקין: חייב להיות מכפלה של ${t.divisor}`;case`unrecognized_keys`:return`מפתח${t.keys.length>1?`ות`:``} לא מזוה${t.keys.length>1?`ים`:`ה`}: ${_(t.keys,`, `)}`;case`invalid_key`:return`שדה לא תקין באובייקט`;case`invalid_union`:return`קלט לא תקין`;case`invalid_element`:return`ערך לא תקין ב${i(t.origin??`array`)}`;default:return`קלט לא תקין`}}}}));function ao(){return{localeError:oo()}}var oo,so=t((()=>{D(),oo=()=>{let e={string:{unit:`znakova`,verb:`imati`},file:{unit:`bajtova`,verb:`imati`},array:{unit:`stavki`,verb:`imati`},set:{unit:`stavki`,verb:`imati`}};function t(t){return e[t]??null}let 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`},r={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 e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Neispravan unos: očekuje se instanceof ${e.expected}, a primljeno je ${i}`:`Neispravan unos: očekuje se ${t}, a primljeno je ${i}`}case`invalid_value`:return e.values.length===1?`Neispravna vrijednost: očekivano ${T(e.values[0])}`:`Neispravna opcija: očekivano jedno od ${_(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,i=t(e.origin),a=r[e.origin]??e.origin;return i?`Preveliko: očekivano da ${a??`vrijednost`} ima ${n}${e.maximum.toString()} ${i.unit??`elemenata`}`:`Preveliko: očekivano da ${a??`vrijednost`} bude ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,i=t(e.origin),a=r[e.origin]??e.origin;return i?`Premalo: očekivano da ${a} ima ${n}${e.minimum.toString()} ${i.unit}`:`Premalo: očekivano da ${a} bude ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Neispravan tekst: mora započinjati s "${t.prefix}"`:t.format===`ends_with`?`Neispravan tekst: mora završavati s "${t.suffix}"`:t.format===`includes`?`Neispravan tekst: mora sadržavati "${t.includes}"`:t.format===`regex`?`Neispravan tekst: mora odgovarati uzorku ${t.pattern}`:`Neispravna ${n[t.format]??e.format}`}case`not_multiple_of`:return`Neispravan broj: mora biti višekratnik od ${e.divisor}`;case`unrecognized_keys`:return`Neprepoznat${e.keys.length>1?`i ključevi`:` ključ`}: ${_(e.keys,`, `)}`;case`invalid_key`:return`Neispravan ključ u ${r[e.origin]??e.origin}`;case`invalid_union`:return`Neispravan unos`;case`invalid_element`:return`Neispravna vrijednost u ${r[e.origin]??e.origin}`;default:return`Neispravan unos`}}}}));function co(){return{localeError:lo()}}var lo,uo=t((()=>{D(),lo=()=>{let e={string:{unit:`karakter`,verb:`legyen`},file:{unit:`byte`,verb:`legyen`},array:{unit:`elem`,verb:`legyen`},set:{unit:`elem`,verb:`legyen`}};function t(t){return e[t]??null}let 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`},r={nan:`NaN`,number:`szám`,array:`tömb`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Érvénytelen bemenet: a várt érték instanceof ${e.expected}, a kapott érték ${i}`:`Érvénytelen bemenet: a várt érték ${t}, a kapott érték ${i}`}case`invalid_value`:return e.values.length===1?`Érvénytelen bemenet: a várt érték ${T(e.values[0])}`:`Érvénytelen opció: valamelyik érték várt ${_(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Túl nagy: ${e.origin??`érték`} mérete túl nagy ${n}${e.maximum.toString()} ${r.unit??`elem`}`:`Túl nagy: a bemeneti érték ${e.origin??`érték`} túl nagy: ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Túl kicsi: a bemeneti érték ${e.origin} mérete túl kicsi ${n}${e.minimum.toString()} ${r.unit}`:`Túl kicsi: a bemeneti érték ${e.origin} túl kicsi ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Érvénytelen string: "${t.prefix}" értékkel kell kezdődnie`:t.format===`ends_with`?`Érvénytelen string: "${t.suffix}" értékkel kell végződnie`:t.format===`includes`?`Érvénytelen string: "${t.includes}" értéket kell tartalmaznia`:t.format===`regex`?`Érvénytelen string: ${t.pattern} mintának kell megfelelnie`:`Érvénytelen ${n[t.format]??e.format}`}case`not_multiple_of`:return`Érvénytelen szám: ${e.divisor} többszörösének kell lennie`;case`unrecognized_keys`:return`Ismeretlen kulcs${e.keys.length>1?`s`:``}: ${_(e.keys,`, `)}`;case`invalid_key`:return`Érvénytelen kulcs ${e.origin}`;case`invalid_union`:return`Érvénytelen bemenet`;case`invalid_element`:return`Érvénytelen érték: ${e.origin}`;default:return`Érvénytelen bemenet`}}}}));function fo(e,t,n){return Math.abs(e)===1?t:n}function po(e){if(!e)return``;let t=[`ա`,`ե`,`ը`,`ի`,`ո`,`ու`,`օ`],n=e[e.length-1];return e+(t.includes(n)?`ն`:`ը`)}function mo(){return{localeError:ho()}}var ho,go=t((()=>{D(),ho=()=>{let e={string:{unit:{one:`նշան`,many:`նշաններ`},verb:`ունենալ`},file:{unit:{one:`բայթ`,many:`բայթեր`},verb:`ունենալ`},array:{unit:{one:`տարր`,many:`տարրեր`},verb:`ունենալ`},set:{unit:{one:`տարր`,many:`տարրեր`},verb:`ունենալ`}};function t(t){return e[t]??null}let 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:`մուտք`},r={nan:`NaN`,number:`թիվ`,array:`զանգված`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Սխալ մուտքագրում․ սպասվում էր instanceof ${e.expected}, ստացվել է ${i}`:`Սխալ մուտքագրում․ սպասվում էր ${t}, ստացվել է ${i}`}case`invalid_value`:return e.values.length===1?`Սխալ մուտքագրում․ սպասվում էր ${T(e.values[1])}`:`Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${_(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);if(r){let t=fo(Number(e.maximum),r.unit.one,r.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${po(e.origin??`արժեք`)} կունենա ${n}${e.maximum.toString()} ${t}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${po(e.origin??`արժեք`)} լինի ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);if(r){let t=fo(Number(e.minimum),r.unit.one,r.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${po(e.origin)} կունենա ${n}${e.minimum.toString()} ${t}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${po(e.origin)} լինի ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Սխալ տող․ պետք է սկսվի "${t.prefix}"-ով`:t.format===`ends_with`?`Սխալ տող․ պետք է ավարտվի "${t.suffix}"-ով`:t.format===`includes`?`Սխալ տող․ պետք է պարունակի "${t.includes}"`:t.format===`regex`?`Սխալ տող․ պետք է համապատասխանի ${t.pattern} ձևաչափին`:`Սխալ ${n[t.format]??e.format}`}case`not_multiple_of`:return`Սխալ թիվ․ պետք է բազմապատիկ լինի ${e.divisor}-ի`;case`unrecognized_keys`:return`Չճանաչված բանալի${e.keys.length>1?`ներ`:``}. ${_(e.keys,`, `)}`;case`invalid_key`:return`Սխալ բանալի ${po(e.origin)}-ում`;case`invalid_union`:return`Սխալ մուտքագրում`;case`invalid_element`:return`Սխալ արժեք ${po(e.origin)}-ում`;default:return`Սխալ մուտքագրում`}}}}));function _o(){return{localeError:vo()}}var vo,yo=t((()=>{D(),vo=()=>{let e={string:{unit:`karakter`,verb:`memiliki`},file:{unit:`byte`,verb:`memiliki`},array:{unit:`item`,verb:`memiliki`},set:{unit:`item`,verb:`memiliki`}};function t(t){return e[t]??null}let 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`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Input tidak valid: diharapkan instanceof ${e.expected}, diterima ${i}`:`Input tidak valid: diharapkan ${t}, diterima ${i}`}case`invalid_value`:return e.values.length===1?`Input tidak valid: diharapkan ${T(e.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${_(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Terlalu besar: diharapkan ${e.origin??`value`} memiliki ${n}${e.maximum.toString()} ${r.unit??`elemen`}`:`Terlalu besar: diharapkan ${e.origin??`value`} menjadi ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Terlalu kecil: diharapkan ${e.origin} memiliki ${n}${e.minimum.toString()} ${r.unit}`:`Terlalu kecil: diharapkan ${e.origin} menjadi ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`String tidak valid: harus dimulai dengan "${t.prefix}"`:t.format===`ends_with`?`String tidak valid: harus berakhir dengan "${t.suffix}"`:t.format===`includes`?`String tidak valid: harus menyertakan "${t.includes}"`:t.format===`regex`?`String tidak valid: harus sesuai pola ${t.pattern}`:`${n[t.format]??e.format} tidak valid`}case`not_multiple_of`:return`Angka tidak valid: harus kelipatan dari ${e.divisor}`;case`unrecognized_keys`:return`Kunci tidak dikenali ${e.keys.length>1?`s`:``}: ${_(e.keys,`, `)}`;case`invalid_key`:return`Kunci tidak valid di ${e.origin}`;case`invalid_union`:return`Input tidak valid`;case`invalid_element`:return`Nilai tidak valid di ${e.origin}`;default:return`Input tidak valid`}}}}));function bo(){return{localeError:xo()}}var xo,So=t((()=>{D(),xo=()=>{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(t){return e[t]??null}let 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`},r={nan:`NaN`,number:`númer`,array:`fylki`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Rangt gildi: Þú slóst inn ${i} þar sem á að vera instanceof ${e.expected}`:`Rangt gildi: Þú slóst inn ${i} þar sem á að vera ${t}`}case`invalid_value`:return e.values.length===1?`Rangt gildi: gert ráð fyrir ${T(e.values[0])}`:`Ógilt val: má vera eitt af eftirfarandi ${_(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Of stórt: gert er ráð fyrir að ${e.origin??`gildi`} hafi ${n}${e.maximum.toString()} ${r.unit??`hluti`}`:`Of stórt: gert er ráð fyrir að ${e.origin??`gildi`} sé ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Of lítið: gert er ráð fyrir að ${e.origin} hafi ${n}${e.minimum.toString()} ${r.unit}`:`Of lítið: gert er ráð fyrir að ${e.origin} sé ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ógildur strengur: verður að byrja á "${t.prefix}"`:t.format===`ends_with`?`Ógildur strengur: verður að enda á "${t.suffix}"`:t.format===`includes`?`Ógildur strengur: verður að innihalda "${t.includes}"`:t.format===`regex`?`Ógildur strengur: verður að fylgja mynstri ${t.pattern}`:`Rangt ${n[t.format]??e.format}`}case`not_multiple_of`:return`Röng tala: verður að vera margfeldi af ${e.divisor}`;case`unrecognized_keys`:return`Óþekkt ${e.keys.length>1?`ir lyklar`:`ur lykill`}: ${_(e.keys,`, `)}`;case`invalid_key`:return`Rangur lykill í ${e.origin}`;case`invalid_union`:return`Rangt gildi`;case`invalid_element`:return`Rangt gildi í ${e.origin}`;default:return`Rangt gildi`}}}}));function Co(){return{localeError:wo()}}var wo,To=t((()=>{D(),wo=()=>{let e={string:{unit:`caratteri`,verb:`avere`},file:{unit:`byte`,verb:`avere`},array:{unit:`elementi`,verb:`avere`},set:{unit:`elementi`,verb:`avere`}};function t(t){return e[t]??null}let 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`},r={nan:`NaN`,number:`numero`,array:`vettore`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Input non valido: atteso instanceof ${e.expected}, ricevuto ${i}`:`Input non valido: atteso ${t}, ricevuto ${i}`}case`invalid_value`:return e.values.length===1?`Input non valido: atteso ${T(e.values[0])}`:`Opzione non valida: atteso uno tra ${_(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Troppo grande: ${e.origin??`valore`} deve avere ${n}${e.maximum.toString()} ${r.unit??`elementi`}`:`Troppo grande: ${e.origin??`valore`} deve essere ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Troppo piccolo: ${e.origin} deve avere ${n}${e.minimum.toString()} ${r.unit}`:`Troppo piccolo: ${e.origin} deve essere ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Stringa non valida: deve iniziare con "${t.prefix}"`:t.format===`ends_with`?`Stringa non valida: deve terminare con "${t.suffix}"`:t.format===`includes`?`Stringa non valida: deve includere "${t.includes}"`:t.format===`regex`?`Stringa non valida: deve corrispondere al pattern ${t.pattern}`:`Input non valido: ${n[t.format]??e.format}`}case`not_multiple_of`:return`Numero non valido: deve essere un multiplo di ${e.divisor}`;case`unrecognized_keys`:return`Chiav${e.keys.length>1?`i`:`e`} non riconosciut${e.keys.length>1?`e`:`a`}: ${_(e.keys,`, `)}`;case`invalid_key`:return`Chiave non valida in ${e.origin}`;case`invalid_union`:return`Input non valido`;case`invalid_element`:return`Valore non valido in ${e.origin}`;default:return`Input non valido`}}}}));function Eo(){return{localeError:Do()}}var Do,Oo=t((()=>{D(),Do=()=>{let e={string:{unit:`文字`,verb:`である`},file:{unit:`バイト`,verb:`である`},array:{unit:`要素`,verb:`である`},set:{unit:`要素`,verb:`である`}};function t(t){return e[t]??null}let 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:`入力値`},r={nan:`NaN`,number:`数値`,array:`配列`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`無効な入力: instanceof ${e.expected}が期待されましたが、${i}が入力されました`:`無効な入力: ${t}が期待されましたが、${i}が入力されました`}case`invalid_value`:return e.values.length===1?`無効な入力: ${T(e.values[0])}が期待されました`:`無効な選択: ${_(e.values,`、`)}のいずれかである必要があります`;case`too_big`:{let n=e.inclusive?`以下である`:`より小さい`,r=t(e.origin);return r?`大きすぎる値: ${e.origin??`値`}は${e.maximum.toString()}${r.unit??`要素`}${n}必要があります`:`大きすぎる値: ${e.origin??`値`}は${e.maximum.toString()}${n}必要があります`}case`too_small`:{let n=e.inclusive?`以上である`:`より大きい`,r=t(e.origin);return r?`小さすぎる値: ${e.origin}は${e.minimum.toString()}${r.unit}${n}必要があります`:`小さすぎる値: ${e.origin}は${e.minimum.toString()}${n}必要があります`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`無効な文字列: "${t.prefix}"で始まる必要があります`:t.format===`ends_with`?`無効な文字列: "${t.suffix}"で終わる必要があります`:t.format===`includes`?`無効な文字列: "${t.includes}"を含む必要があります`:t.format===`regex`?`無効な文字列: パターン${t.pattern}に一致する必要があります`:`無効な${n[t.format]??e.format}`}case`not_multiple_of`:return`無効な数値: ${e.divisor}の倍数である必要があります`;case`unrecognized_keys`:return`認識されていないキー${e.keys.length>1?`群`:``}: ${_(e.keys,`、`)}`;case`invalid_key`:return`${e.origin}内の無効なキー`;case`invalid_union`:return`無効な入力`;case`invalid_element`:return`${e.origin}内の無効な値`;default:return`無効な入力`}}}}));function ko(){return{localeError:Ao()}}var Ao,jo=t((()=>{D(),Ao=()=>{let e={string:{unit:`სიმბოლო`,verb:`უნდა შეიცავდეს`},file:{unit:`ბაიტი`,verb:`უნდა შეიცავდეს`},array:{unit:`ელემენტი`,verb:`უნდა შეიცავდეს`},set:{unit:`ელემენტი`,verb:`უნდა შეიცავდეს`}};function t(t){return e[t]??null}let 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:`შეყვანა`},r={nan:`NaN`,number:`რიცხვი`,string:`ველი`,boolean:`ბულეანი`,function:`ფუნქცია`,array:`მასივი`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`არასწორი შეყვანა: მოსალოდნელი instanceof ${e.expected}, მიღებული ${i}`:`არასწორი შეყვანა: მოსალოდნელი ${t}, მიღებული ${i}`}case`invalid_value`:return e.values.length===1?`არასწორი შეყვანა: მოსალოდნელი ${T(e.values[0])}`:`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${_(e.values,`|`)}-დან`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`ზედმეტად დიდი: მოსალოდნელი ${e.origin??`მნიშვნელობა`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit}`:`ზედმეტად დიდი: მოსალოდნელი ${e.origin??`მნიშვნელობა`} იყოს ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`ზედმეტად პატარა: მოსალოდნელი ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`ზედმეტად პატარა: მოსალოდნელი ${e.origin} იყოს ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`არასწორი ველი: უნდა იწყებოდეს "${t.prefix}"-ით`:t.format===`ends_with`?`არასწორი ველი: უნდა მთავრდებოდეს "${t.suffix}"-ით`:t.format===`includes`?`არასწორი ველი: უნდა შეიცავდეს "${t.includes}"-ს`:t.format===`regex`?`არასწორი ველი: უნდა შეესაბამებოდეს შაბლონს ${t.pattern}`:`არასწორი ${n[t.format]??e.format}`}case`not_multiple_of`:return`არასწორი რიცხვი: უნდა იყოს ${e.divisor}-ის ჯერადი`;case`unrecognized_keys`:return`უცნობი გასაღებ${e.keys.length>1?`ები`:`ი`}: ${_(e.keys,`, `)}`;case`invalid_key`:return`არასწორი გასაღები ${e.origin}-ში`;case`invalid_union`:return`არასწორი შეყვანა`;case`invalid_element`:return`არასწორი მნიშვნელობა ${e.origin}-ში`;default:return`არასწორი შეყვანა`}}}}));function Mo(){return{localeError:No()}}var No,Po=t((()=>{D(),No=()=>{let e={string:{unit:`តួអក្សរ`,verb:`គួរមាន`},file:{unit:`បៃ`,verb:`គួរមាន`},array:{unit:`ធាតុ`,verb:`គួរមាន`},set:{unit:`ធាតុ`,verb:`គួរមាន`}};function t(t){return e[t]??null}let 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:`ទិន្នន័យបញ្ចូល`},r={nan:`NaN`,number:`លេខ`,array:`អារេ (Array)`,null:`គ្មានតម្លៃ (null)`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${e.expected} ប៉ុន្តែទទួលបាន ${i}`:`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${t} ប៉ុន្តែទទួលបាន ${i}`}case`invalid_value`:return e.values.length===1?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${T(e.values[0])}`:`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${_(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`ធំពេក៖ ត្រូវការ ${e.origin??`តម្លៃ`} ${n} ${e.maximum.toString()} ${r.unit??`ធាតុ`}`:`ធំពេក៖ ត្រូវការ ${e.origin??`តម្លៃ`} ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`តូចពេក៖ ត្រូវការ ${e.origin} ${n} ${e.minimum.toString()} ${r.unit}`:`តូចពេក៖ ត្រូវការ ${e.origin} ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${t.prefix}"`:t.format===`ends_with`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${t.suffix}"`:t.format===`includes`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${t.includes}"`:t.format===`regex`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${t.pattern}`:`មិនត្រឹមត្រូវ៖ ${n[t.format]??e.format}`}case`not_multiple_of`:return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${e.divisor}`;case`unrecognized_keys`:return`រកឃើញសោមិនស្គាល់៖ ${_(e.keys,`, `)}`;case`invalid_key`:return`សោមិនត្រឹមត្រូវនៅក្នុង ${e.origin}`;case`invalid_union`:return`ទិន្នន័យមិនត្រឹមត្រូវ`;case`invalid_element`:return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${e.origin}`;default:return`ទិន្នន័យមិនត្រឹមត្រូវ`}}}}));function Fo(){return Mo()}var Io=t((()=>{Po()}));function Lo(){return{localeError:Ro()}}var Ro,zo=t((()=>{D(),Ro=()=>{let e={string:{unit:`문자`,verb:`to have`},file:{unit:`바이트`,verb:`to have`},array:{unit:`개`,verb:`to have`},set:{unit:`개`,verb:`to have`}};function t(t){return e[t]??null}let 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:`입력`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`잘못된 입력: 예상 타입은 instanceof ${e.expected}, 받은 타입은 ${i}입니다`:`잘못된 입력: 예상 타입은 ${t}, 받은 타입은 ${i}입니다`}case`invalid_value`:return e.values.length===1?`잘못된 입력: 값은 ${T(e.values[0])} 이어야 합니다`:`잘못된 옵션: ${_(e.values,`또는 `)} 중 하나여야 합니다`;case`too_big`:{let n=e.inclusive?`이하`:`미만`,r=n===`미만`?`이어야 합니다`:`여야 합니다`,i=t(e.origin),a=i?.unit??`요소`;return i?`${e.origin??`값`}이 너무 큽니다: ${e.maximum.toString()}${a} ${n}${r}`:`${e.origin??`값`}이 너무 큽니다: ${e.maximum.toString()} ${n}${r}`}case`too_small`:{let n=e.inclusive?`이상`:`초과`,r=n===`이상`?`이어야 합니다`:`여야 합니다`,i=t(e.origin),a=i?.unit??`요소`;return i?`${e.origin??`값`}이 너무 작습니다: ${e.minimum.toString()}${a} ${n}${r}`:`${e.origin??`값`}이 너무 작습니다: ${e.minimum.toString()} ${n}${r}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`잘못된 문자열: "${t.prefix}"(으)로 시작해야 합니다`:t.format===`ends_with`?`잘못된 문자열: "${t.suffix}"(으)로 끝나야 합니다`:t.format===`includes`?`잘못된 문자열: "${t.includes}"을(를) 포함해야 합니다`:t.format===`regex`?`잘못된 문자열: 정규식 ${t.pattern} 패턴과 일치해야 합니다`:`잘못된 ${n[t.format]??e.format}`}case`not_multiple_of`:return`잘못된 숫자: ${e.divisor}의 배수여야 합니다`;case`unrecognized_keys`:return`인식할 수 없는 키: ${_(e.keys,`, `)}`;case`invalid_key`:return`잘못된 키: ${e.origin}`;case`invalid_union`:return`잘못된 입력`;case`invalid_element`:return`잘못된 값: ${e.origin}`;default:return`잘못된 입력`}}}}));function Bo(e){let t=Math.abs(e),n=t%10,r=t%100;return r>=11&&r<=19||n===0?`many`:n===1?`one`:`few`}function Vo(){return{localeError:Uo()}}var Ho,Uo,Wo=t((()=>{D(),Ho=e=>e.charAt(0).toUpperCase()+e.slice(1),Uo=()=>{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(t,n,r,i){let a=e[t]??null;return a===null?a:{unit:a.unit[n],verb:a.verb[i][r?`inclusive`:`notInclusive`]}}let 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`},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 e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Gautas tipas ${i}, o tikėtasi - instanceof ${e.expected}`:`Gautas tipas ${i}, o tikėtasi - ${t}`}case`invalid_value`:return e.values.length===1?`Privalo būti ${T(e.values[0])}`:`Privalo būti vienas iš ${_(e.values,`|`)} pasirinkimų`;case`too_big`:{let n=r[e.origin]??e.origin,i=t(e.origin,Bo(Number(e.maximum)),e.inclusive??!1,`smaller`);if(i?.verb)return`${Ho(n??e.origin??`reikšmė`)} ${i.verb} ${e.maximum.toString()} ${i.unit??`elementų`}`;let a=e.inclusive?`ne didesnis kaip`:`mažesnis kaip`;return`${Ho(n??e.origin??`reikšmė`)} turi būti ${a} ${e.maximum.toString()} ${i?.unit}`}case`too_small`:{let n=r[e.origin]??e.origin,i=t(e.origin,Bo(Number(e.minimum)),e.inclusive??!1,`bigger`);if(i?.verb)return`${Ho(n??e.origin??`reikšmė`)} ${i.verb} ${e.minimum.toString()} ${i.unit??`elementų`}`;let a=e.inclusive?`ne mažesnis kaip`:`didesnis kaip`;return`${Ho(n??e.origin??`reikšmė`)} turi būti ${a} ${e.minimum.toString()} ${i?.unit}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Eilutė privalo prasidėti "${t.prefix}"`:t.format===`ends_with`?`Eilutė privalo pasibaigti "${t.suffix}"`:t.format===`includes`?`Eilutė privalo įtraukti "${t.includes}"`:t.format===`regex`?`Eilutė privalo atitikti ${t.pattern}`:`Neteisingas ${n[t.format]??e.format}`}case`not_multiple_of`:return`Skaičius privalo būti ${e.divisor} kartotinis.`;case`unrecognized_keys`:return`Neatpažint${e.keys.length>1?`i`:`as`} rakt${e.keys.length>1?`ai`:`as`}: ${_(e.keys,`, `)}`;case`invalid_key`:return`Rastas klaidingas raktas`;case`invalid_union`:return`Klaidinga įvestis`;case`invalid_element`:return`${Ho(r[e.origin]??e.origin??e.origin??`reikšmė`)} turi klaidingą įvestį`;default:return`Klaidinga įvestis`}}}}));function Go(){return{localeError:Ko()}}var Ko,qo=t((()=>{D(),Ko=()=>{let e={string:{unit:`знаци`,verb:`да имаат`},file:{unit:`бајти`,verb:`да имаат`},array:{unit:`ставки`,verb:`да имаат`},set:{unit:`ставки`,verb:`да имаат`}};function t(t){return e[t]??null}let 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:`внес`},r={nan:`NaN`,number:`број`,array:`низа`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Грешен внес: се очекува instanceof ${e.expected}, примено ${i}`:`Грешен внес: се очекува ${t}, примено ${i}`}case`invalid_value`:return e.values.length===1?`Invalid input: expected ${T(e.values[0])}`:`Грешана опција: се очекува една ${_(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Премногу голем: се очекува ${e.origin??`вредноста`} да има ${n}${e.maximum.toString()} ${r.unit??`елементи`}`:`Премногу голем: се очекува ${e.origin??`вредноста`} да биде ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Премногу мал: се очекува ${e.origin} да има ${n}${e.minimum.toString()} ${r.unit}`:`Премногу мал: се очекува ${e.origin} да биде ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Неважечка низа: мора да започнува со "${t.prefix}"`:t.format===`ends_with`?`Неважечка низа: мора да завршува со "${t.suffix}"`:t.format===`includes`?`Неважечка низа: мора да вклучува "${t.includes}"`:t.format===`regex`?`Неважечка низа: мора да одгоара на патернот ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Грешен број: мора да биде делив со ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Непрепознаени клучеви`:`Непрепознаен клуч`}: ${_(e.keys,`, `)}`;case`invalid_key`:return`Грешен клуч во ${e.origin}`;case`invalid_union`:return`Грешен внес`;case`invalid_element`:return`Грешна вредност во ${e.origin}`;default:return`Грешен внес`}}}}));function Jo(){return{localeError:Yo()}}var Yo,Xo=t((()=>{D(),Yo=()=>{let e={string:{unit:`aksara`,verb:`mempunyai`},file:{unit:`bait`,verb:`mempunyai`},array:{unit:`elemen`,verb:`mempunyai`},set:{unit:`elemen`,verb:`mempunyai`}};function t(t){return e[t]??null}let 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`},r={nan:`NaN`,number:`nombor`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Input tidak sah: dijangka instanceof ${e.expected}, diterima ${i}`:`Input tidak sah: dijangka ${t}, diterima ${i}`}case`invalid_value`:return e.values.length===1?`Input tidak sah: dijangka ${T(e.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${_(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Terlalu besar: dijangka ${e.origin??`nilai`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`elemen`}`:`Terlalu besar: dijangka ${e.origin??`nilai`} adalah ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Terlalu kecil: dijangka ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Terlalu kecil: dijangka ${e.origin} adalah ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`String tidak sah: mesti bermula dengan "${t.prefix}"`:t.format===`ends_with`?`String tidak sah: mesti berakhir dengan "${t.suffix}"`:t.format===`includes`?`String tidak sah: mesti mengandungi "${t.includes}"`:t.format===`regex`?`String tidak sah: mesti sepadan dengan corak ${t.pattern}`:`${n[t.format]??e.format} tidak sah`}case`not_multiple_of`:return`Nombor tidak sah: perlu gandaan ${e.divisor}`;case`unrecognized_keys`:return`Kunci tidak dikenali: ${_(e.keys,`, `)}`;case`invalid_key`:return`Kunci tidak sah dalam ${e.origin}`;case`invalid_union`:return`Input tidak sah`;case`invalid_element`:return`Nilai tidak sah dalam ${e.origin}`;default:return`Input tidak sah`}}}}));function Zo(){return{localeError:Qo()}}var Qo,$o=t((()=>{D(),Qo=()=>{let e={string:{unit:`tekens`,verb:`heeft`},file:{unit:`bytes`,verb:`heeft`},array:{unit:`elementen`,verb:`heeft`},set:{unit:`elementen`,verb:`heeft`}};function t(t){return e[t]??null}let 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`},r={nan:`NaN`,number:`getal`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ongeldige invoer: verwacht instanceof ${e.expected}, ontving ${i}`:`Ongeldige invoer: verwacht ${t}, ontving ${i}`}case`invalid_value`:return e.values.length===1?`Ongeldige invoer: verwacht ${T(e.values[0])}`:`Ongeldige optie: verwacht één van ${_(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin),i=e.origin===`date`?`laat`:e.origin===`string`?`lang`:`groot`;return r?`Te ${i}: verwacht dat ${e.origin??`waarde`} ${n}${e.maximum.toString()} ${r.unit??`elementen`} ${r.verb}`:`Te ${i}: verwacht dat ${e.origin??`waarde`} ${n}${e.maximum.toString()} is`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin),i=e.origin===`date`?`vroeg`:e.origin===`string`?`kort`:`klein`;return r?`Te ${i}: verwacht dat ${e.origin} ${n}${e.minimum.toString()} ${r.unit} ${r.verb}`:`Te ${i}: verwacht dat ${e.origin} ${n}${e.minimum.toString()} is`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ongeldige tekst: moet met "${t.prefix}" beginnen`:t.format===`ends_with`?`Ongeldige tekst: moet op "${t.suffix}" eindigen`:t.format===`includes`?`Ongeldige tekst: moet "${t.includes}" bevatten`:t.format===`regex`?`Ongeldige tekst: moet overeenkomen met patroon ${t.pattern}`:`Ongeldig: ${n[t.format]??e.format}`}case`not_multiple_of`:return`Ongeldig getal: moet een veelvoud van ${e.divisor} zijn`;case`unrecognized_keys`:return`Onbekende key${e.keys.length>1?`s`:``}: ${_(e.keys,`, `)}`;case`invalid_key`:return`Ongeldige key in ${e.origin}`;case`invalid_union`:return`Ongeldige invoer`;case`invalid_element`:return`Ongeldige waarde in ${e.origin}`;default:return`Ongeldige invoer`}}}}));function es(){return{localeError:ts()}}var ts,ns=t((()=>{D(),ts=()=>{let e={string:{unit:`tegn`,verb:`å ha`},file:{unit:`bytes`,verb:`å ha`},array:{unit:`elementer`,verb:`å inneholde`},set:{unit:`elementer`,verb:`å inneholde`}};function t(t){return e[t]??null}let 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`},r={nan:`NaN`,number:`tall`,array:`liste`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ugyldig input: forventet instanceof ${e.expected}, fikk ${i}`:`Ugyldig input: forventet ${t}, fikk ${i}`}case`invalid_value`:return e.values.length===1?`Ugyldig verdi: forventet ${T(e.values[0])}`:`Ugyldig valg: forventet en av ${_(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`For stor(t): forventet ${e.origin??`value`} til å ha ${n}${e.maximum.toString()} ${r.unit??`elementer`}`:`For stor(t): forventet ${e.origin??`value`} til å ha ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`For lite(n): forventet ${e.origin} til å ha ${n}${e.minimum.toString()} ${r.unit}`:`For lite(n): forventet ${e.origin} til å ha ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ugyldig streng: må starte med "${t.prefix}"`:t.format===`ends_with`?`Ugyldig streng: må ende med "${t.suffix}"`:t.format===`includes`?`Ugyldig streng: må inneholde "${t.includes}"`:t.format===`regex`?`Ugyldig streng: må matche mønsteret ${t.pattern}`:`Ugyldig ${n[t.format]??e.format}`}case`not_multiple_of`:return`Ugyldig tall: må være et multiplum av ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Ukjente nøkler`:`Ukjent nøkkel`}: ${_(e.keys,`, `)}`;case`invalid_key`:return`Ugyldig nøkkel i ${e.origin}`;case`invalid_union`:return`Ugyldig input`;case`invalid_element`:return`Ugyldig verdi i ${e.origin}`;default:return`Ugyldig input`}}}}));function rs(){return{localeError:is()}}var is,as=t((()=>{D(),is=()=>{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(t){return e[t]??null}let 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`},r={nan:`NaN`,number:`numara`,array:`saf`,null:`gayb`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Fâsit giren: umulan instanceof ${e.expected}, alınan ${i}`:`Fâsit giren: umulan ${t}, alınan ${i}`}case`invalid_value`:return e.values.length===1?`Fâsit giren: umulan ${T(e.values[0])}`:`Fâsit tercih: mûteberler ${_(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Fazla büyük: ${e.origin??`value`}, ${n}${e.maximum.toString()} ${r.unit??`elements`} sahip olmalıydı.`:`Fazla büyük: ${e.origin??`value`}, ${n}${e.maximum.toString()} olmalıydı.`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Fazla küçük: ${e.origin}, ${n}${e.minimum.toString()} ${r.unit} sahip olmalıydı.`:`Fazla küçük: ${e.origin}, ${n}${e.minimum.toString()} olmalıydı.`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Fâsit metin: "${t.prefix}" ile başlamalı.`:t.format===`ends_with`?`Fâsit metin: "${t.suffix}" ile bitmeli.`:t.format===`includes`?`Fâsit metin: "${t.includes}" ihtivâ etmeli.`:t.format===`regex`?`Fâsit metin: ${t.pattern} nakşına uymalı.`:`Fâsit ${n[t.format]??e.format}`}case`not_multiple_of`:return`Fâsit sayı: ${e.divisor} katı olmalıydı.`;case`unrecognized_keys`:return`Tanınmayan anahtar ${e.keys.length>1?`s`:``}: ${_(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} için tanınmayan anahtar var.`;case`invalid_union`:return`Giren tanınamadı.`;case`invalid_element`:return`${e.origin} için tanınmayan kıymet var.`;default:return`Kıymet tanınamadı.`}}}}));function os(){return{localeError:ss()}}var ss,cs=t((()=>{D(),ss=()=>{let e={string:{unit:`توکي`,verb:`ولري`},file:{unit:`بایټس`,verb:`ولري`},array:{unit:`توکي`,verb:`ولري`},set:{unit:`توکي`,verb:`ولري`}};function t(t){return e[t]??null}let 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:`ورودي`},r={nan:`NaN`,number:`عدد`,array:`ارې`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`ناسم ورودي: باید instanceof ${e.expected} وای, مګر ${i} ترلاسه شو`:`ناسم ورودي: باید ${t} وای, مګر ${i} ترلاسه شو`}case`invalid_value`:return e.values.length===1?`ناسم ورودي: باید ${T(e.values[0])} وای`:`ناسم انتخاب: باید یو له ${_(e.values,`|`)} څخه وای`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`ډیر لوی: ${e.origin??`ارزښت`} باید ${n}${e.maximum.toString()} ${r.unit??`عنصرونه`} ولري`:`ډیر لوی: ${e.origin??`ارزښت`} باید ${n}${e.maximum.toString()} وي`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`ډیر کوچنی: ${e.origin} باید ${n}${e.minimum.toString()} ${r.unit} ولري`:`ډیر کوچنی: ${e.origin} باید ${n}${e.minimum.toString()} وي`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`ناسم متن: باید د "${t.prefix}" سره پیل شي`:t.format===`ends_with`?`ناسم متن: باید د "${t.suffix}" سره پای ته ورسيږي`:t.format===`includes`?`ناسم متن: باید "${t.includes}" ولري`:t.format===`regex`?`ناسم متن: باید د ${t.pattern} سره مطابقت ولري`:`${n[t.format]??e.format} ناسم دی`}case`not_multiple_of`:return`ناسم عدد: باید د ${e.divisor} مضرب وي`;case`unrecognized_keys`:return`ناسم ${e.keys.length>1?`کلیډونه`:`کلیډ`}: ${_(e.keys,`, `)}`;case`invalid_key`:return`ناسم کلیډ په ${e.origin} کې`;case`invalid_union`:return`ناسمه ورودي`;case`invalid_element`:return`ناسم عنصر په ${e.origin} کې`;default:return`ناسمه ورودي`}}}}));function ls(){return{localeError:us()}}var us,ds=t((()=>{D(),us=()=>{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(t){return e[t]??null}let 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`},r={nan:`NaN`,number:`liczba`,array:`tablica`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Nieprawidłowe dane wejściowe: oczekiwano instanceof ${e.expected}, otrzymano ${i}`:`Nieprawidłowe dane wejściowe: oczekiwano ${t}, otrzymano ${i}`}case`invalid_value`:return e.values.length===1?`Nieprawidłowe dane wejściowe: oczekiwano ${T(e.values[0])}`:`Nieprawidłowa opcja: oczekiwano jednej z wartości ${_(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Za duża wartość: oczekiwano, że ${e.origin??`wartość`} będzie mieć ${n}${e.maximum.toString()} ${r.unit??`elementów`}`:`Zbyt duż(y/a/e): oczekiwano, że ${e.origin??`wartość`} będzie wynosić ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Za mała wartość: oczekiwano, że ${e.origin??`wartość`} będzie mieć ${n}${e.minimum.toString()} ${r.unit??`elementów`}`:`Zbyt mał(y/a/e): oczekiwano, że ${e.origin??`wartość`} będzie wynosić ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Nieprawidłowy ciąg znaków: musi zaczynać się od "${t.prefix}"`:t.format===`ends_with`?`Nieprawidłowy ciąg znaków: musi kończyć się na "${t.suffix}"`:t.format===`includes`?`Nieprawidłowy ciąg znaków: musi zawierać "${t.includes}"`:t.format===`regex`?`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${t.pattern}`:`Nieprawidłow(y/a/e) ${n[t.format]??e.format}`}case`not_multiple_of`:return`Nieprawidłowa liczba: musi być wielokrotnością ${e.divisor}`;case`unrecognized_keys`:return`Nierozpoznane klucze${e.keys.length>1?`s`:``}: ${_(e.keys,`, `)}`;case`invalid_key`:return`Nieprawidłowy klucz w ${e.origin}`;case`invalid_union`:return`Nieprawidłowe dane wejściowe`;case`invalid_element`:return`Nieprawidłowa wartość w ${e.origin}`;default:return`Nieprawidłowe dane wejściowe`}}}}));function fs(){return{localeError:ps()}}var ps,ms=t((()=>{D(),ps=()=>{let e={string:{unit:`caracteres`,verb:`ter`},file:{unit:`bytes`,verb:`ter`},array:{unit:`itens`,verb:`ter`},set:{unit:`itens`,verb:`ter`}};function t(t){return e[t]??null}let 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`},r={nan:`NaN`,number:`número`,null:`nulo`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Tipo inválido: esperado instanceof ${e.expected}, recebido ${i}`:`Tipo inválido: esperado ${t}, recebido ${i}`}case`invalid_value`:return e.values.length===1?`Entrada inválida: esperado ${T(e.values[0])}`:`Opção inválida: esperada uma das ${_(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Muito grande: esperado que ${e.origin??`valor`} tivesse ${n}${e.maximum.toString()} ${r.unit??`elementos`}`:`Muito grande: esperado que ${e.origin??`valor`} fosse ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Muito pequeno: esperado que ${e.origin} tivesse ${n}${e.minimum.toString()} ${r.unit}`:`Muito pequeno: esperado que ${e.origin} fosse ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Texto inválido: deve começar com "${t.prefix}"`:t.format===`ends_with`?`Texto inválido: deve terminar com "${t.suffix}"`:t.format===`includes`?`Texto inválido: deve incluir "${t.includes}"`:t.format===`regex`?`Texto inválido: deve corresponder ao padrão ${t.pattern}`:`${n[t.format]??e.format} inválido`}case`not_multiple_of`:return`Número inválido: deve ser múltiplo de ${e.divisor}`;case`unrecognized_keys`:return`Chave${e.keys.length>1?`s`:``} desconhecida${e.keys.length>1?`s`:``}: ${_(e.keys,`, `)}`;case`invalid_key`:return`Chave inválida em ${e.origin}`;case`invalid_union`:return`Entrada inválida`;case`invalid_element`:return`Valor inválido em ${e.origin}`;default:return`Campo inválido`}}}}));function hs(){return{localeError:gs()}}var gs,_s=t((()=>{D(),gs=()=>{let e={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 t(t){return e[t]??null}let 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`},r={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 e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input);return`Intrare invalidă: așteptat ${t}, primit ${r[n]??n}`}case`invalid_value`:return e.values.length===1?`Intrare invalidă: așteptat ${T(e.values[0])}`:`Opțiune invalidă: așteptat una dintre ${_(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Prea mare: așteptat ca ${e.origin??`valoarea`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`elemente`}`:`Prea mare: așteptat ca ${e.origin??`valoarea`} să fie ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Prea mic: așteptat ca ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Prea mic: așteptat ca ${e.origin} să fie ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Șir invalid: trebuie să înceapă cu "${t.prefix}"`:t.format===`ends_with`?`Șir invalid: trebuie să se termine cu "${t.suffix}"`:t.format===`includes`?`Șir invalid: trebuie să includă "${t.includes}"`:t.format===`regex`?`Șir invalid: trebuie să se potrivească cu modelul ${t.pattern}`:`Format invalid: ${n[t.format]??e.format}`}case`not_multiple_of`:return`Număr invalid: trebuie să fie multiplu de ${e.divisor}`;case`unrecognized_keys`:return`Chei nerecunoscute: ${_(e.keys,`, `)}`;case`invalid_key`:return`Cheie invalidă în ${e.origin}`;case`invalid_union`:return`Intrare invalidă`;case`invalid_element`:return`Valoare invalidă în ${e.origin}`;default:return`Intrare invalidă`}}}}));function vs(e,t,n,r){let i=Math.abs(e),a=i%10,o=i%100;return o>=11&&o<=19?r:a===1?t:a>=2&&a<=4?n:r}function ys(){return{localeError:bs()}}var bs,xs=t((()=>{D(),bs=()=>{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(t){return e[t]??null}let 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:`ввод`},r={nan:`NaN`,number:`число`,array:`массив`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Неверный ввод: ожидалось instanceof ${e.expected}, получено ${i}`:`Неверный ввод: ожидалось ${t}, получено ${i}`}case`invalid_value`:return e.values.length===1?`Неверный ввод: ожидалось ${T(e.values[0])}`:`Неверный вариант: ожидалось одно из ${_(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);if(r){let t=vs(Number(e.maximum),r.unit.one,r.unit.few,r.unit.many);return`Слишком большое значение: ожидалось, что ${e.origin??`значение`} будет иметь ${n}${e.maximum.toString()} ${t}`}return`Слишком большое значение: ожидалось, что ${e.origin??`значение`} будет ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);if(r){let t=vs(Number(e.minimum),r.unit.one,r.unit.few,r.unit.many);return`Слишком маленькое значение: ожидалось, что ${e.origin} будет иметь ${n}${e.minimum.toString()} ${t}`}return`Слишком маленькое значение: ожидалось, что ${e.origin} будет ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Неверная строка: должна начинаться с "${t.prefix}"`:t.format===`ends_with`?`Неверная строка: должна заканчиваться на "${t.suffix}"`:t.format===`includes`?`Неверная строка: должна содержать "${t.includes}"`:t.format===`regex`?`Неверная строка: должна соответствовать шаблону ${t.pattern}`:`Неверный ${n[t.format]??e.format}`}case`not_multiple_of`:return`Неверное число: должно быть кратным ${e.divisor}`;case`unrecognized_keys`:return`Нераспознанн${e.keys.length>1?`ые`:`ый`} ключ${e.keys.length>1?`и`:``}: ${_(e.keys,`, `)}`;case`invalid_key`:return`Неверный ключ в ${e.origin}`;case`invalid_union`:return`Неверные входные данные`;case`invalid_element`:return`Неверное значение в ${e.origin}`;default:return`Неверные входные данные`}}}}));function Ss(){return{localeError:Cs()}}var Cs,ws=t((()=>{D(),Cs=()=>{let e={string:{unit:`znakov`,verb:`imeti`},file:{unit:`bajtov`,verb:`imeti`},array:{unit:`elementov`,verb:`imeti`},set:{unit:`elementov`,verb:`imeti`}};function t(t){return e[t]??null}let 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`},r={nan:`NaN`,number:`število`,array:`tabela`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Neveljaven vnos: pričakovano instanceof ${e.expected}, prejeto ${i}`:`Neveljaven vnos: pričakovano ${t}, prejeto ${i}`}case`invalid_value`:return e.values.length===1?`Neveljaven vnos: pričakovano ${T(e.values[0])}`:`Neveljavna možnost: pričakovano eno izmed ${_(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Preveliko: pričakovano, da bo ${e.origin??`vrednost`} imelo ${n}${e.maximum.toString()} ${r.unit??`elementov`}`:`Preveliko: pričakovano, da bo ${e.origin??`vrednost`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Premajhno: pričakovano, da bo ${e.origin} imelo ${n}${e.minimum.toString()} ${r.unit}`:`Premajhno: pričakovano, da bo ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Neveljaven niz: mora se začeti z "${t.prefix}"`:t.format===`ends_with`?`Neveljaven niz: mora se končati z "${t.suffix}"`:t.format===`includes`?`Neveljaven niz: mora vsebovati "${t.includes}"`:t.format===`regex`?`Neveljaven niz: mora ustrezati vzorcu ${t.pattern}`:`Neveljaven ${n[t.format]??e.format}`}case`not_multiple_of`:return`Neveljavno število: mora biti večkratnik ${e.divisor}`;case`unrecognized_keys`:return`Neprepoznan${e.keys.length>1?`i ključi`:` ključ`}: ${_(e.keys,`, `)}`;case`invalid_key`:return`Neveljaven ključ v ${e.origin}`;case`invalid_union`:return`Neveljaven vnos`;case`invalid_element`:return`Neveljavna vrednost v ${e.origin}`;default:return`Neveljaven vnos`}}}}));function Ts(){return{localeError:Es()}}var Es,Ds=t((()=>{D(),Es=()=>{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(t){return e[t]??null}let 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`},r={nan:`NaN`,number:`antal`,array:`lista`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ogiltig inmatning: förväntat instanceof ${e.expected}, fick ${i}`:`Ogiltig inmatning: förväntat ${t}, fick ${i}`}case`invalid_value`:return e.values.length===1?`Ogiltig inmatning: förväntat ${T(e.values[0])}`:`Ogiltigt val: förväntade en av ${_(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`För stor(t): förväntade ${e.origin??`värdet`} att ha ${n}${e.maximum.toString()} ${r.unit??`element`}`:`För stor(t): förväntat ${e.origin??`värdet`} att ha ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`För lite(t): förväntade ${e.origin??`värdet`} att ha ${n}${e.minimum.toString()} ${r.unit}`:`För lite(t): förväntade ${e.origin??`värdet`} att ha ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ogiltig sträng: måste börja med "${t.prefix}"`:t.format===`ends_with`?`Ogiltig sträng: måste sluta med "${t.suffix}"`:t.format===`includes`?`Ogiltig sträng: måste innehålla "${t.includes}"`:t.format===`regex`?`Ogiltig sträng: måste matcha mönstret "${t.pattern}"`:`Ogiltig(t) ${n[t.format]??e.format}`}case`not_multiple_of`:return`Ogiltigt tal: måste vara en multipel av ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Okända nycklar`:`Okänd nyckel`}: ${_(e.keys,`, `)}`;case`invalid_key`:return`Ogiltig nyckel i ${e.origin??`värdet`}`;case`invalid_union`:return`Ogiltig input`;case`invalid_element`:return`Ogiltigt värde i ${e.origin??`värdet`}`;default:return`Ogiltig input`}}}}));function Os(){return{localeError:ks()}}var ks,As=t((()=>{D(),ks=()=>{let e={string:{unit:`எழுத்துக்கள்`,verb:`கொண்டிருக்க வேண்டும்`},file:{unit:`பைட்டுகள்`,verb:`கொண்டிருக்க வேண்டும்`},array:{unit:`உறுப்புகள்`,verb:`கொண்டிருக்க வேண்டும்`},set:{unit:`உறுப்புகள்`,verb:`கொண்டிருக்க வேண்டும்`}};function t(t){return e[t]??null}let 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`},r={nan:`NaN`,number:`எண்`,array:`அணி`,null:`வெறுமை`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${e.expected}, பெறப்பட்டது ${i}`:`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${t}, பெறப்பட்டது ${i}`}case`invalid_value`:return e.values.length===1?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${T(e.values[0])}`:`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${_(e.values,`|`)} இல் ஒன்று`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${e.origin??`மதிப்பு`} ${n}${e.maximum.toString()} ${r.unit??`உறுப்புகள்`} ஆக இருக்க வேண்டும்`:`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${e.origin??`மதிப்பு`} ${n}${e.maximum.toString()} ஆக இருக்க வேண்டும்`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${e.origin} ${n}${e.minimum.toString()} ${r.unit} ஆக இருக்க வேண்டும்`:`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${e.origin} ${n}${e.minimum.toString()} ஆக இருக்க வேண்டும்`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`தவறான சரம்: "${t.prefix}" இல் தொடங்க வேண்டும்`:t.format===`ends_with`?`தவறான சரம்: "${t.suffix}" இல் முடிவடைய வேண்டும்`:t.format===`includes`?`தவறான சரம்: "${t.includes}" ஐ உள்ளடக்க வேண்டும்`:t.format===`regex`?`தவறான சரம்: ${t.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`:`தவறான ${n[t.format]??e.format}`}case`not_multiple_of`:return`தவறான எண்: ${e.divisor} இன் பலமாக இருக்க வேண்டும்`;case`unrecognized_keys`:return`அடையாளம் தெரியாத விசை${e.keys.length>1?`கள்`:``}: ${_(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} இல் தவறான விசை`;case`invalid_union`:return`தவறான உள்ளீடு`;case`invalid_element`:return`${e.origin} இல் தவறான மதிப்பு`;default:return`தவறான உள்ளீடு`}}}}));function js(){return{localeError:Ms()}}var Ms,Ns=t((()=>{D(),Ms=()=>{let e={string:{unit:`ตัวอักษร`,verb:`ควรมี`},file:{unit:`ไบต์`,verb:`ควรมี`},array:{unit:`รายการ`,verb:`ควรมี`},set:{unit:`รายการ`,verb:`ควรมี`}};function t(t){return e[t]??null}let 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:`ข้อมูลที่ป้อน`},r={nan:`NaN`,number:`ตัวเลข`,array:`อาร์เรย์ (Array)`,null:`ไม่มีค่า (null)`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${e.expected} แต่ได้รับ ${i}`:`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${t} แต่ได้รับ ${i}`}case`invalid_value`:return e.values.length===1?`ค่าไม่ถูกต้อง: ควรเป็น ${T(e.values[0])}`:`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${_(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`ไม่เกิน`:`น้อยกว่า`,r=t(e.origin);return r?`เกินกำหนด: ${e.origin??`ค่า`} ควรมี${n} ${e.maximum.toString()} ${r.unit??`รายการ`}`:`เกินกำหนด: ${e.origin??`ค่า`} ควรมี${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`อย่างน้อย`:`มากกว่า`,r=t(e.origin);return r?`น้อยกว่ากำหนด: ${e.origin} ควรมี${n} ${e.minimum.toString()} ${r.unit}`:`น้อยกว่ากำหนด: ${e.origin} ควรมี${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${t.prefix}"`:t.format===`ends_with`?`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${t.suffix}"`:t.format===`includes`?`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${t.includes}" อยู่ในข้อความ`:t.format===`regex`?`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${t.pattern}`:`รูปแบบไม่ถูกต้อง: ${n[t.format]??e.format}`}case`not_multiple_of`:return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${e.divisor} ได้ลงตัว`;case`unrecognized_keys`:return`พบคีย์ที่ไม่รู้จัก: ${_(e.keys,`, `)}`;case`invalid_key`:return`คีย์ไม่ถูกต้องใน ${e.origin}`;case`invalid_union`:return`ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้`;case`invalid_element`:return`ข้อมูลไม่ถูกต้องใน ${e.origin}`;default:return`ข้อมูลไม่ถูกต้อง`}}}}));function Ps(){return{localeError:Fs()}}var Fs,Is=t((()=>{D(),Fs=()=>{let e={string:{unit:`karakter`,verb:`olmalı`},file:{unit:`bayt`,verb:`olmalı`},array:{unit:`öğe`,verb:`olmalı`},set:{unit:`öğe`,verb:`olmalı`}};function t(t){return e[t]??null}let 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`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Geçersiz değer: beklenen instanceof ${e.expected}, alınan ${i}`:`Geçersiz değer: beklenen ${t}, alınan ${i}`}case`invalid_value`:return e.values.length===1?`Geçersiz değer: beklenen ${T(e.values[0])}`:`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${_(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Çok büyük: beklenen ${e.origin??`değer`} ${n}${e.maximum.toString()} ${r.unit??`öğe`}`:`Çok büyük: beklenen ${e.origin??`değer`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Çok küçük: beklenen ${e.origin} ${n}${e.minimum.toString()} ${r.unit}`:`Çok küçük: beklenen ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Geçersiz metin: "${t.prefix}" ile başlamalı`:t.format===`ends_with`?`Geçersiz metin: "${t.suffix}" ile bitmeli`:t.format===`includes`?`Geçersiz metin: "${t.includes}" içermeli`:t.format===`regex`?`Geçersiz metin: ${t.pattern} desenine uymalı`:`Geçersiz ${n[t.format]??e.format}`}case`not_multiple_of`:return`Geçersiz sayı: ${e.divisor} ile tam bölünebilmeli`;case`unrecognized_keys`:return`Tanınmayan anahtar${e.keys.length>1?`lar`:``}: ${_(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} içinde geçersiz anahtar`;case`invalid_union`:return`Geçersiz değer`;case`invalid_element`:return`${e.origin} içinde geçersiz değer`;default:return`Geçersiz değer`}}}}));function Ls(){return{localeError:Rs()}}var Rs,zs=t((()=>{D(),Rs=()=>{let e={string:{unit:`символів`,verb:`матиме`},file:{unit:`байтів`,verb:`матиме`},array:{unit:`елементів`,verb:`матиме`},set:{unit:`елементів`,verb:`матиме`}};function t(t){return e[t]??null}let 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:`вхідні дані`},r={nan:`NaN`,number:`число`,array:`масив`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Неправильні вхідні дані: очікується instanceof ${e.expected}, отримано ${i}`:`Неправильні вхідні дані: очікується ${t}, отримано ${i}`}case`invalid_value`:return e.values.length===1?`Неправильні вхідні дані: очікується ${T(e.values[0])}`:`Неправильна опція: очікується одне з ${_(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Занадто велике: очікується, що ${e.origin??`значення`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`елементів`}`:`Занадто велике: очікується, що ${e.origin??`значення`} буде ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Занадто мале: очікується, що ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Занадто мале: очікується, що ${e.origin} буде ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Неправильний рядок: повинен починатися з "${t.prefix}"`:t.format===`ends_with`?`Неправильний рядок: повинен закінчуватися на "${t.suffix}"`:t.format===`includes`?`Неправильний рядок: повинен містити "${t.includes}"`:t.format===`regex`?`Неправильний рядок: повинен відповідати шаблону ${t.pattern}`:`Неправильний ${n[t.format]??e.format}`}case`not_multiple_of`:return`Неправильне число: повинно бути кратним ${e.divisor}`;case`unrecognized_keys`:return`Нерозпізнаний ключ${e.keys.length>1?`і`:``}: ${_(e.keys,`, `)}`;case`invalid_key`:return`Неправильний ключ у ${e.origin}`;case`invalid_union`:return`Неправильні вхідні дані`;case`invalid_element`:return`Неправильне значення у ${e.origin}`;default:return`Неправильні вхідні дані`}}}}));function Bs(){return Ls()}var Vs=t((()=>{zs()}));function Hs(){return{localeError:Us()}}var Us,Ws=t((()=>{D(),Us=()=>{let e={string:{unit:`حروف`,verb:`ہونا`},file:{unit:`بائٹس`,verb:`ہونا`},array:{unit:`آئٹمز`,verb:`ہونا`},set:{unit:`آئٹمز`,verb:`ہونا`}};function t(t){return e[t]??null}let 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:`ان پٹ`},r={nan:`NaN`,number:`نمبر`,array:`آرے`,null:`نل`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`غلط ان پٹ: instanceof ${e.expected} متوقع تھا، ${i} موصول ہوا`:`غلط ان پٹ: ${t} متوقع تھا، ${i} موصول ہوا`}case`invalid_value`:return e.values.length===1?`غلط ان پٹ: ${T(e.values[0])} متوقع تھا`:`غلط آپشن: ${_(e.values,`|`)} میں سے ایک متوقع تھا`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`بہت بڑا: ${e.origin??`ویلیو`} کے ${n}${e.maximum.toString()} ${r.unit??`عناصر`} ہونے متوقع تھے`:`بہت بڑا: ${e.origin??`ویلیو`} کا ${n}${e.maximum.toString()} ہونا متوقع تھا`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`بہت چھوٹا: ${e.origin} کے ${n}${e.minimum.toString()} ${r.unit} ہونے متوقع تھے`:`بہت چھوٹا: ${e.origin} کا ${n}${e.minimum.toString()} ہونا متوقع تھا`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`غلط سٹرنگ: "${t.prefix}" سے شروع ہونا چاہیے`:t.format===`ends_with`?`غلط سٹرنگ: "${t.suffix}" پر ختم ہونا چاہیے`:t.format===`includes`?`غلط سٹرنگ: "${t.includes}" شامل ہونا چاہیے`:t.format===`regex`?`غلط سٹرنگ: پیٹرن ${t.pattern} سے میچ ہونا چاہیے`:`غلط ${n[t.format]??e.format}`}case`not_multiple_of`:return`غلط نمبر: ${e.divisor} کا مضاعف ہونا چاہیے`;case`unrecognized_keys`:return`غیر تسلیم شدہ کی${e.keys.length>1?`ز`:``}: ${_(e.keys,`، `)}`;case`invalid_key`:return`${e.origin} میں غلط کی`;case`invalid_union`:return`غلط ان پٹ`;case`invalid_element`:return`${e.origin} میں غلط ویلیو`;default:return`غلط ان پٹ`}}}}));function Gs(){return{localeError:Ks()}}var Ks,qs=t((()=>{D(),Ks=()=>{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`},map:{unit:`yozuv`,verb:`bo‘lishi kerak`}};function t(t){return e[t]??null}let 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`},r={nan:`NaN`,number:`raqam`,array:`massiv`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Noto‘g‘ri kirish: kutilgan instanceof ${e.expected}, qabul qilingan ${i}`:`Noto‘g‘ri kirish: kutilgan ${t}, qabul qilingan ${i}`}case`invalid_value`:return e.values.length===1?`Noto‘g‘ri kirish: kutilgan ${T(e.values[0])}`:`Noto‘g‘ri variant: quyidagilardan biri kutilgan ${_(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Juda katta: kutilgan ${e.origin??`qiymat`} ${n}${e.maximum.toString()} ${r.unit} ${r.verb}`:`Juda katta: kutilgan ${e.origin??`qiymat`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Juda kichik: kutilgan ${e.origin} ${n}${e.minimum.toString()} ${r.unit} ${r.verb}`:`Juda kichik: kutilgan ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Noto‘g‘ri satr: "${t.prefix}" bilan boshlanishi kerak`:t.format===`ends_with`?`Noto‘g‘ri satr: "${t.suffix}" bilan tugashi kerak`:t.format===`includes`?`Noto‘g‘ri satr: "${t.includes}" ni o‘z ichiga olishi kerak`:t.format===`regex`?`Noto‘g‘ri satr: ${t.pattern} shabloniga mos kelishi kerak`:`Noto‘g‘ri ${n[t.format]??e.format}`}case`not_multiple_of`:return`Noto‘g‘ri raqam: ${e.divisor} ning karralisi bo‘lishi kerak`;case`unrecognized_keys`:return`Noma’lum kalit${e.keys.length>1?`lar`:``}: ${_(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} dagi kalit noto‘g‘ri`;case`invalid_union`:return`Noto‘g‘ri kirish`;case`invalid_element`:return`${e.origin} da noto‘g‘ri qiymat`;default:return`Noto‘g‘ri kirish`}}}}));function Js(){return{localeError:Ys()}}var Ys,Xs=t((()=>{D(),Ys=()=>{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(t){return e[t]??null}let 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`},r={nan:`NaN`,number:`số`,array:`mảng`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Đầu vào không hợp lệ: mong đợi instanceof ${e.expected}, nhận được ${i}`:`Đầu vào không hợp lệ: mong đợi ${t}, nhận được ${i}`}case`invalid_value`:return e.values.length===1?`Đầu vào không hợp lệ: mong đợi ${T(e.values[0])}`:`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${_(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Quá lớn: mong đợi ${e.origin??`giá trị`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`phần tử`}`:`Quá lớn: mong đợi ${e.origin??`giá trị`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Quá nhỏ: mong đợi ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Quá nhỏ: mong đợi ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Chuỗi không hợp lệ: phải bắt đầu bằng "${t.prefix}"`:t.format===`ends_with`?`Chuỗi không hợp lệ: phải kết thúc bằng "${t.suffix}"`:t.format===`includes`?`Chuỗi không hợp lệ: phải bao gồm "${t.includes}"`:t.format===`regex`?`Chuỗi không hợp lệ: phải khớp với mẫu ${t.pattern}`:`${n[t.format]??e.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 ${e.divisor}`;case`unrecognized_keys`:return`Khóa không được nhận dạng: ${_(e.keys,`, `)}`;case`invalid_key`:return`Khóa không hợp lệ trong ${e.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 ${e.origin}`;default:return`Đầu vào không hợp lệ`}}}}));function Zs(){return{localeError:Qs()}}var Qs,$s=t((()=>{D(),Qs=()=>{let e={string:{unit:`字符`,verb:`包含`},file:{unit:`字节`,verb:`包含`},array:{unit:`项`,verb:`包含`},set:{unit:`项`,verb:`包含`}};function t(t){return e[t]??null}let 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:`输入`},r={nan:`NaN`,number:`数字`,array:`数组`,null:`空值(null)`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`无效输入:期望 instanceof ${e.expected},实际接收 ${i}`:`无效输入:期望 ${t},实际接收 ${i}`}case`invalid_value`:return e.values.length===1?`无效输入:期望 ${T(e.values[0])}`:`无效选项:期望以下之一 ${_(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`数值过大:期望 ${e.origin??`值`} ${n}${e.maximum.toString()} ${r.unit??`个元素`}`:`数值过大:期望 ${e.origin??`值`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`数值过小:期望 ${e.origin} ${n}${e.minimum.toString()} ${r.unit}`:`数值过小:期望 ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`无效字符串:必须以 "${t.prefix}" 开头`:t.format===`ends_with`?`无效字符串:必须以 "${t.suffix}" 结尾`:t.format===`includes`?`无效字符串:必须包含 "${t.includes}"`:t.format===`regex`?`无效字符串:必须满足正则表达式 ${t.pattern}`:`无效${n[t.format]??e.format}`}case`not_multiple_of`:return`无效数字:必须是 ${e.divisor} 的倍数`;case`unrecognized_keys`:return`出现未知的键(key): ${_(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} 中的键(key)无效`;case`invalid_union`:return`无效输入`;case`invalid_element`:return`${e.origin} 中包含无效值(value)`;default:return`无效输入`}}}}));function ec(){return{localeError:tc()}}var tc,nc=t((()=>{D(),tc=()=>{let e={string:{unit:`字元`,verb:`擁有`},file:{unit:`位元組`,verb:`擁有`},array:{unit:`項目`,verb:`擁有`},set:{unit:`項目`,verb:`擁有`}};function t(t){return e[t]??null}let 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:`輸入`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`無效的輸入值:預期為 instanceof ${e.expected},但收到 ${i}`:`無效的輸入值:預期為 ${t},但收到 ${i}`}case`invalid_value`:return e.values.length===1?`無效的輸入值:預期為 ${T(e.values[0])}`:`無效的選項:預期為以下其中之一 ${_(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`數值過大:預期 ${e.origin??`值`} 應為 ${n}${e.maximum.toString()} ${r.unit??`個元素`}`:`數值過大:預期 ${e.origin??`值`} 應為 ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`數值過小:預期 ${e.origin} 應為 ${n}${e.minimum.toString()} ${r.unit}`:`數值過小:預期 ${e.origin} 應為 ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`無效的字串:必須以 "${t.prefix}" 開頭`:t.format===`ends_with`?`無效的字串:必須以 "${t.suffix}" 結尾`:t.format===`includes`?`無效的字串:必須包含 "${t.includes}"`:t.format===`regex`?`無效的字串:必須符合格式 ${t.pattern}`:`無效的 ${n[t.format]??e.format}`}case`not_multiple_of`:return`無效的數字:必須為 ${e.divisor} 的倍數`;case`unrecognized_keys`:return`無法識別的鍵值${e.keys.length>1?`們`:``}:${_(e.keys,`、`)}`;case`invalid_key`:return`${e.origin} 中有無效的鍵值`;case`invalid_union`:return`無效的輸入值`;case`invalid_element`:return`${e.origin} 中有無效的值`;default:return`無效的輸入值`}}}}));function rc(){return{localeError:ic()}}var ic,ac=t((()=>{D(),ic=()=>{let e={string:{unit:`àmi`,verb:`ní`},file:{unit:`bytes`,verb:`ní`},array:{unit:`nkan`,verb:`ní`},set:{unit:`nkan`,verb:`ní`}};function t(t){return e[t]??null}let 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é`},r={nan:`NaN`,number:`nọ́mbà`,array:`akopọ`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=E(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${e.expected}, àmọ̀ a rí ${i}`:`Ìbáwọlé aṣìṣe: a ní láti fi ${t}, àmọ̀ a rí ${i}`}case`invalid_value`:return e.values.length===1?`Ìbáwọlé aṣìṣe: a ní láti fi ${T(e.values[0])}`:`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${_(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Tó pọ̀ jù: a ní láti jẹ́ pé ${e.origin??`iye`} ${r.verb} ${n}${e.maximum} ${r.unit}`:`Tó pọ̀ jù: a ní láti jẹ́ ${n}${e.maximum}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Kéré ju: a ní láti jẹ́ pé ${e.origin} ${r.verb} ${n}${e.minimum} ${r.unit}`:`Kéré ju: a ní láti jẹ́ ${n}${e.minimum}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${t.prefix}"`:t.format===`ends_with`?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${t.suffix}"`:t.format===`includes`?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${t.includes}"`:t.format===`regex`?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${t.pattern}`:`Aṣìṣe: ${n[t.format]??e.format}`}case`not_multiple_of`:return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${e.divisor}`;case`unrecognized_keys`:return`Bọtìnì àìmọ̀: ${_(e.keys,`, `)}`;case`invalid_key`:return`Bọtìnì aṣìṣe nínú ${e.origin}`;case`invalid_union`:return`Ìbáwọlé aṣìṣe`;case`invalid_element`:return`Iye aṣìṣe nínú ${e.origin}`;default:return`Ìbáwọlé aṣìṣe`}}}})),oc=n({ar:()=>sa,az:()=>ua,be:()=>ma,bg:()=>_a,ca:()=>ba,cs:()=>Ca,da:()=>Ea,de:()=>ka,el:()=>Ma,en:()=>Fa,eo:()=>Ra,es:()=>Va,fa:()=>Wa,fi:()=>qa,fr:()=>Xa,frCA:()=>$a,he:()=>no,hr:()=>ao,hu:()=>co,hy:()=>mo,id:()=>_o,is:()=>bo,it:()=>Co,ja:()=>Eo,ka:()=>ko,kh:()=>Fo,km:()=>Mo,ko:()=>Lo,lt:()=>Vo,mk:()=>Go,ms:()=>Jo,nl:()=>Zo,no:()=>es,ota:()=>rs,pl:()=>ls,ps:()=>os,pt:()=>fs,ro:()=>hs,ru:()=>ys,sl:()=>Ss,sv:()=>Ts,ta:()=>Os,th:()=>js,tr:()=>Ps,ua:()=>Bs,uk:()=>Ls,ur:()=>Hs,uz:()=>Gs,vi:()=>Js,yo:()=>rc,zhCN:()=>Zs,zhTW:()=>ec}),sc=t((()=>{la(),fa(),ga(),ya(),Sa(),Ta(),Oa(),ja(),Pa(),La(),Ba(),Ua(),Ka(),Ya(),Qa(),to(),io(),so(),uo(),go(),yo(),So(),To(),Oo(),jo(),Io(),Po(),zo(),Wo(),qo(),Xo(),$o(),ns(),as(),cs(),ds(),ms(),_s(),xs(),ws(),Ds(),As(),Ns(),Is(),Vs(),zs(),Ws(),qs(),Xs(),$s(),nc(),ac()}));function cc(){return new fc}var lc,uc,dc,fc,pc,mc=t((()=>{uc=Symbol(`ZodOutput`),dc=Symbol(`ZodInput`),fc=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}},(lc=globalThis).__zod_globalRegistry??(lc.__zod_globalRegistry=cc()),pc=globalThis.__zod_globalRegistry}));function hc(e,t){return new e({type:`string`,...w(t)})}function gc(e,t){return new e({type:`string`,coerce:!0,...w(t)})}function _c(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...w(t)})}function vc(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...w(t)})}function yc(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...w(t)})}function bc(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...w(t)})}function xc(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...w(t)})}function Sc(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...w(t)})}function Cc(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...w(t)})}function wc(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...w(t)})}function Tc(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...w(t)})}function Ec(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...w(t)})}function Dc(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...w(t)})}function Oc(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...w(t)})}function kc(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...w(t)})}function Ac(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...w(t)})}function jc(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...w(t)})}function Mc(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...w(t)})}function Nc(e,t){return new e({type:`string`,format:`mac`,check:`string_format`,abort:!1,...w(t)})}function Pc(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...w(t)})}function Fc(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...w(t)})}function Ic(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...w(t)})}function Lc(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...w(t)})}function Rc(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...w(t)})}function zc(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...w(t)})}function Bc(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...w(t)})}function Vc(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...w(t)})}function Hc(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...w(t)})}function Uc(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...w(t)})}function Wc(e,t){return new e({type:`number`,checks:[],...w(t)})}function Gc(e,t){return new e({type:`number`,coerce:!0,checks:[],...w(t)})}function Kc(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...w(t)})}function qc(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`float32`,...w(t)})}function Jc(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`float64`,...w(t)})}function Yc(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`int32`,...w(t)})}function Xc(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`uint32`,...w(t)})}function Zc(e,t){return new e({type:`boolean`,...w(t)})}function Qc(e,t){return new e({type:`boolean`,coerce:!0,...w(t)})}function $c(e,t){return new e({type:`bigint`,...w(t)})}function el(e,t){return new e({type:`bigint`,coerce:!0,...w(t)})}function tl(e,t){return new e({type:`bigint`,check:`bigint_format`,abort:!1,format:`int64`,...w(t)})}function nl(e,t){return new e({type:`bigint`,check:`bigint_format`,abort:!1,format:`uint64`,...w(t)})}function rl(e,t){return new e({type:`symbol`,...w(t)})}function il(e,t){return new e({type:`undefined`,...w(t)})}function al(e,t){return new e({type:`null`,...w(t)})}function ol(e){return new e({type:`any`})}function sl(e){return new e({type:`unknown`})}function cl(e,t){return new e({type:`never`,...w(t)})}function ll(e,t){return new e({type:`void`,...w(t)})}function ul(e,t){return new e({type:`date`,...w(t)})}function dl(e,t){return new e({type:`date`,coerce:!0,...w(t)})}function fl(e,t){return new e({type:`nan`,...w(t)})}function pl(e,t){return new Kn({check:`less_than`,...w(t),value:e,inclusive:!1})}function ml(e,t){return new Kn({check:`less_than`,...w(t),value:e,inclusive:!0})}function hl(e,t){return new qn({check:`greater_than`,...w(t),value:e,inclusive:!1})}function gl(e,t){return new qn({check:`greater_than`,...w(t),value:e,inclusive:!0})}function _l(e){return hl(0,e)}function vl(e){return pl(0,e)}function yl(e){return ml(0,e)}function bl(e){return gl(0,e)}function xl(e,t){return new Jn({check:`multiple_of`,...w(t),value:e})}function Sl(e,t){return new Zn({check:`max_size`,...w(t),maximum:e})}function Cl(e,t){return new Qn({check:`min_size`,...w(t),minimum:e})}function wl(e,t){return new $n({check:`size_equals`,...w(t),size:e})}function Tl(e,t){return new er({check:`max_length`,...w(t),maximum:e})}function El(e,t){return new tr({check:`min_length`,...w(t),minimum:e})}function Dl(e,t){return new nr({check:`length_equals`,...w(t),length:e})}function Ol(e,t){return new ir({check:`string_format`,format:`regex`,...w(t),pattern:e})}function kl(e){return new ar({check:`string_format`,format:`lowercase`,...w(e)})}function Al(e){return new or({check:`string_format`,format:`uppercase`,...w(e)})}function jl(e,t){return new sr({check:`string_format`,format:`includes`,...w(t),includes:e})}function Ml(e,t){return new cr({check:`string_format`,format:`starts_with`,...w(t),prefix:e})}function Nl(e,t){return new lr({check:`string_format`,format:`ends_with`,...w(t),suffix:e})}function Pl(e,t,n){return new ur({check:`property`,property:e,schema:t,...w(n)})}function Fl(e,t){return new dr({check:`mime_type`,mime:e,...w(t)})}function Il(e){return new fr({check:`overwrite`,tx:e})}function Ll(e){return Il(t=>t.normalize(e))}function Rl(){return Il(e=>e.trim())}function zl(){return Il(e=>e.toLowerCase())}function Bl(){return Il(e=>e.toUpperCase())}function Vl(){return Il(e=>de(e))}function Hl(e,t,n){return new e({type:`array`,element:t,...w(n)})}function Ul(e,t,n){return new e({type:`union`,options:t,...w(n)})}function Wl(e,t,n){return new e({type:`union`,options:t,inclusive:!1,...w(n)})}function Gl(e,t,n,r){return new e({type:`union`,options:n,discriminator:t,...w(r)})}function Kl(e,t,n){return new e({type:`intersection`,left:t,right:n})}function ql(e,t,n,r){let i=n instanceof k;return new e({type:`tuple`,items:t,rest:i?n:null,...w(i?r:n)})}function Jl(e,t,n,r){return new e({type:`record`,keyType:t,valueType:n,...w(r)})}function Yl(e,t,n,r){return new e({type:`map`,keyType:t,valueType:n,...w(r)})}function Xl(e,t,n){return new e({type:`set`,valueType:t,...w(n)})}function Zl(e,t,n){return new e({type:`enum`,entries:Array.isArray(t)?Object.fromEntries(t.map(e=>[e,e])):t,...w(n)})}function Ql(e,t,n){return new e({type:`enum`,entries:t,...w(n)})}function $l(e,t,n){return new e({type:`literal`,values:Array.isArray(t)?t:[t],...w(n)})}function eu(e,t){return new e({type:`file`,...w(t)})}function tu(e,t){return new e({type:`transform`,transform:t})}function nu(e,t){return new e({type:`optional`,innerType:t})}function ru(e,t){return new e({type:`nullable`,innerType:t})}function iu(e,t,n){return new e({type:`default`,innerType:t,get defaultValue(){return typeof n==`function`?n():me(n)}})}function au(e,t,n){return new e({type:`nonoptional`,innerType:t,...w(n)})}function ou(e,t){return new e({type:`success`,innerType:t})}function su(e,t,n){return new e({type:`catch`,innerType:t,catchValue:typeof n==`function`?n:()=>n})}function cu(e,t,n){return new e({type:`pipe`,in:t,out:n})}function lu(e,t){return new e({type:`readonly`,innerType:t})}function uu(e,t,n){return new e({type:`template_literal`,parts:t,...w(n)})}function du(e,t){return new e({type:`lazy`,getter:t})}function fu(e,t){return new e({type:`promise`,innerType:t})}function pu(e,t,n){let r=w(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function mu(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...w(n)})}function hu(e,t){let n=gu(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Pe(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(Pe(r))}},e(t.value,t)),t);return n}function gu(e,t){let n=new O({check:`custom`,...w(t)});return n._zod.check=e,n}function _u(e){let t=new O({check:`describe`});return t._zod.onattach=[t=>{let n=pc.get(t)??{};pc.add(t,{...n,description:e})}],t._zod.check=()=>{},t}function vu(e){let t=new O({check:`meta`});return t._zod.onattach=[t=>{let n=pc.get(t)??{};pc.add(t,{...n,...e})}],t._zod.check=()=>{},t}function yu(e,t){let n=w(t),r=n.truthy??[`true`,`1`,`yes`,`on`,`y`,`enabled`],i=n.falsy??[`false`,`0`,`no`,`off`,`n`,`disabled`];n.case!==`sensitive`&&(r=r.map(e=>typeof e==`string`?e.toLowerCase():e),i=i.map(e=>typeof e==`string`?e.toLowerCase():e));let a=new Set(r),o=new Set(i),s=e.Codec??Qi,c=e.Boolean??gi,l=new s({type:`pipe`,in:new(e.String??Hr)({type:`string`,error:n.error}),out:new c({type:`boolean`,error:n.error}),transform:((e,t)=>{let r=e;return n.case!==`sensitive`&&(r=r.toLowerCase()),a.has(r)?!0:o.has(r)?!1:(t.issues.push({code:`invalid_value`,expected:`stringbool`,values:[...a,...o],input:t.value,inst:l,continue:!1}),{})}),reverseTransform:((e,t)=>e===!0?r[0]||`true`:i[0]||`false`),error:n.error});return l}function bu(e,t,n,r={}){let i=w(r),a={...w(r),check:`string_format`,type:`string`,format:t,fn:typeof n==`function`?n:e=>n.test(e),...i};return n instanceof RegExp&&(a.pattern=n),new e(a)}var xu,Su=t((()=>{pr(),mc(),oa(),D(),xu={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}}));function Cu(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??pc,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 j(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,j(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&Eu(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function wu(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
1259
1259
 
1260
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function Tu(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,`~standard`,{value:{...t[`~standard`],jsonSchema:{input:Ou(t,`input`,e.processors),output:Ou(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Eu(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return Eu(r.element,n);if(r.type===`set`)return Eu(r.valueType,n);if(r.type===`lazy`)return Eu(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type===`default`||r.type===`prefault`)return Eu(r.innerType,n);if(r.type===`intersection`)return Eu(r.left,n)||Eu(r.right,n);if(r.type===`record`||r.type===`map`)return Eu(r.keyType,n)||Eu(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:Eu(r.in,n)||Eu(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Eu(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Eu(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Eu(e,n))return!0;return!!(r.rest&&Eu(r.rest,n))}return!1}var Du,Ou,ku=t((()=>{mc(),Du=(e,t={})=>n=>{let r=Cu({...n,processors:t});return j(e,r),wu(r,e),Tu(r,e)},Ou=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Cu({...i??{},target:a,io:t,processors:n});return j(e,o),wu(o,e),Tu(o,e)}}));function Au(e,t){if(`_idmap`in e){let n=e,r=Cu({...t,processors:_d}),i={};for(let e of n._idmap.entries()){let[t,n]=e;j(n,r)}let a={};r.external={registry:n,uri:t?.uri,defs:i};for(let e of n._idmap.entries()){let[t,n]=e;wu(r,n),a[t]=Tu(r,n)}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=Cu({...t,processors:_d});return j(e,n),wu(n,e),Tu(n,e)}var ju,Mu,Nu,Pu,Fu,Iu,Lu,Ru,zu,Bu,Vu,Hu,Uu,Wu,Gu,Ku,qu,Ju,Yu,Xu,Zu,Qu,$u,ed,td,nd,rd,id,ad,od,sd,cd,ld,ud,dd,fd,pd,md,hd,gd,_d,vd=t((()=>{ku(),D(),ju={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Mu=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=ju[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Nu=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},Pu=(e,t,n,r)=>{n.type=`boolean`},Fu=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`BigInt cannot be represented in JSON Schema`)},Iu=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Symbols cannot be represented in JSON Schema`)},Lu=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},Ru=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Undefined cannot be represented in JSON Schema`)},zu=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`)},Bu=(e,t,n,r)=>{n.not={}},Vu=(e,t,n,r)=>{},Hu=(e,t,n,r)=>{},Uu=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Date cannot be represented in JSON Schema`)},Wu=(e,t,n,r)=>{let i=e._zod.def,a=te(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Gu=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},Ku=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`NaN cannot be represented in JSON Schema`)},qu=(e,t,n,r)=>{let i=n,a=e._zod.pattern;if(!a)throw Error(`Pattern not found in template literal`);i.type=`string`,i.pattern=a.source},Ju=(e,t,n,r)=>{let i=n,a={type:`string`,format:`binary`,contentEncoding:`binary`},{minimum:o,maximum:s,mime:c}=e._zod.bag;o!==void 0&&(a.minLength=o),s!==void 0&&(a.maxLength=s),c?c.length===1?(a.contentMediaType=c[0],Object.assign(i,a)):(Object.assign(i,a),i.anyOf=c.map(e=>({contentMediaType:e}))):Object.assign(i,a)},Yu=(e,t,n,r)=>{n.type=`boolean`},Xu=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},Zu=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Function types cannot be represented in JSON Schema`)},Qu=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},$u=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Map cannot be represented in JSON Schema`)},ed=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Set cannot be represented in JSON Schema`)},td=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=j(a.element,t,{...r,path:[...r.path,`items`]})},nd=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=j(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=j(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},rd=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>j(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},id=(e,t,n,r)=>{let i=e._zod.def,a=j(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=j(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},ad=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>j(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?j(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null;t.target===`draft-2020-12`?(i.prefixItems=c,l&&(i.items=l)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),i.minItems=c.length,l||(i.maxItems=c.length)):(i.items=c,l&&(i.additionalItems=l));let{minimum:u,maximum:d}=e._zod.bag;typeof u==`number`&&(i.minItems=u),typeof d==`number`&&(i.maxItems=d)},od=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=j(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else (t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=j(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=j(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},sd=(e,t,n,r)=>{let i=e._zod.def,a=j(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},cd=(e,t,n,r)=>{let i=e._zod.def;j(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},ld=(e,t,n,r)=>{let i=e._zod.def;j(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},ud=(e,t,n,r)=>{let i=e._zod.def;j(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},dd=(e,t,n,r)=>{let i=e._zod.def;j(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},fd=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;j(o,t,r);let s=t.seen.get(e);s.ref=o},pd=(e,t,n,r)=>{let i=e._zod.def;j(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},md=(e,t,n,r)=>{let i=e._zod.def;j(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},hd=(e,t,n,r)=>{let i=e._zod.def;j(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},gd=(e,t,n,r)=>{let i=e._zod.innerType;j(i,t,r);let a=t.seen.get(e);a.ref=i},_d={string:Mu,number:Nu,boolean:Pu,bigint:Fu,symbol:Iu,null:Lu,undefined:Ru,void:zu,never:Bu,any:Vu,unknown:Hu,date:Uu,enum:Wu,literal:Gu,nan:Ku,template_literal:qu,file:Ju,success:Yu,custom:Xu,function:Zu,transform:Qu,map:$u,set:ed,array:td,object:nd,union:rd,intersection:id,tuple:ad,record:od,nullable:sd,nonoptional:cd,default:ld,prefault:ud,catch:dd,pipe:fd,readonly:pd,promise:md,optional:hd,lazy:gd}})),yd,bd=t((()=>{vd(),ku(),yd=class{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 t=e?.target??`draft-2020-12`;t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),this.ctx=Cu({processors:_d,target:t,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,t={path:[],schemaPath:[]}){return j(e,this.ctx,t)}emit(e,t){t&&(t.cycles&&(this.ctx.cycles=t.cycles),t.reused&&(this.ctx.reused=t.reused),t.external&&(this.ctx.external=t.external)),wu(this.ctx,e);let{"~standard":n,...r}=Tu(this.ctx,e);return r}}})),xd=n({}),Sd=t((()=>{})),Cd=n({$ZodAny:()=>Si,$ZodArray:()=>Di,$ZodAsyncError:()=>l,$ZodBase64:()=>li,$ZodBase64URL:()=>ui,$ZodBigInt:()=>_i,$ZodBigIntFormat:()=>vi,$ZodBoolean:()=>gi,$ZodCIDRv4:()=>si,$ZodCIDRv6:()=>ci,$ZodCUID:()=>Yr,$ZodCUID2:()=>Xr,$ZodCatch:()=>Yi,$ZodCheck:()=>O,$ZodCheckBigIntFormat:()=>Xn,$ZodCheckEndsWith:()=>lr,$ZodCheckGreaterThan:()=>qn,$ZodCheckIncludes:()=>sr,$ZodCheckLengthEquals:()=>nr,$ZodCheckLessThan:()=>Kn,$ZodCheckLowerCase:()=>ar,$ZodCheckMaxLength:()=>er,$ZodCheckMaxSize:()=>Zn,$ZodCheckMimeType:()=>dr,$ZodCheckMinLength:()=>tr,$ZodCheckMinSize:()=>Qn,$ZodCheckMultipleOf:()=>Jn,$ZodCheckNumberFormat:()=>Yn,$ZodCheckOverwrite:()=>fr,$ZodCheckProperty:()=>ur,$ZodCheckRegex:()=>ir,$ZodCheckSizeEquals:()=>$n,$ZodCheckStartsWith:()=>cr,$ZodCheckStringFormat:()=>rr,$ZodCheckUpperCase:()=>or,$ZodCodec:()=>Qi,$ZodCustom:()=>aa,$ZodCustomStringFormat:()=>pi,$ZodDate:()=>Ei,$ZodDefault:()=>Gi,$ZodDiscriminatedUnion:()=>Mi,$ZodE164:()=>di,$ZodEmail:()=>Gr,$ZodEmoji:()=>qr,$ZodEncodeError:()=>u,$ZodEnum:()=>Ri,$ZodError:()=>rt,$ZodExactOptional:()=>Ui,$ZodFile:()=>Bi,$ZodFunction:()=>na,$ZodGUID:()=>Ur,$ZodIPv4:()=>ii,$ZodIPv6:()=>ai,$ZodISODate:()=>ti,$ZodISODateTime:()=>ei,$ZodISODuration:()=>ri,$ZodISOTime:()=>ni,$ZodIntersection:()=>Ni,$ZodJWT:()=>fi,$ZodKSUID:()=>$r,$ZodLazy:()=>ia,$ZodLiteral:()=>zi,$ZodMAC:()=>oi,$ZodMap:()=>Ii,$ZodNaN:()=>Xi,$ZodNanoID:()=>Jr,$ZodNever:()=>wi,$ZodNonOptional:()=>qi,$ZodNull:()=>xi,$ZodNullable:()=>Wi,$ZodNumber:()=>mi,$ZodNumberFormat:()=>hi,$ZodObject:()=>Oi,$ZodObjectJIT:()=>ki,$ZodOptional:()=>Hi,$ZodPipe:()=>Zi,$ZodPrefault:()=>Ki,$ZodPreprocess:()=>$i,$ZodPromise:()=>ra,$ZodReadonly:()=>ea,$ZodRealError:()=>it,$ZodRecord:()=>Fi,$ZodRegistry:()=>fc,$ZodSet:()=>Li,$ZodString:()=>Hr,$ZodStringFormat:()=>A,$ZodSuccess:()=>Ji,$ZodSymbol:()=>yi,$ZodTemplateLiteral:()=>ta,$ZodTransform:()=>Vi,$ZodTuple:()=>Pi,$ZodType:()=>k,$ZodULID:()=>Zr,$ZodURL:()=>Kr,$ZodUUID:()=>Wr,$ZodUndefined:()=>bi,$ZodUnion:()=>Ai,$ZodUnknown:()=>Ci,$ZodVoid:()=>Ti,$ZodXID:()=>Qr,$ZodXor:()=>ji,$brand:()=>c,$constructor:()=>i,$input:()=>dc,$output:()=>uc,Doc:()=>mr,JSONSchema:()=>xd,JSONSchemaGenerator:()=>yd,NEVER:()=>s,TimePrecision:()=>xu,_any:()=>ol,_array:()=>Hl,_base64:()=>Ic,_base64url:()=>Lc,_bigint:()=>$c,_boolean:()=>Zc,_catch:()=>su,_check:()=>gu,_cidrv4:()=>Pc,_cidrv6:()=>Fc,_coercedBigint:()=>el,_coercedBoolean:()=>Qc,_coercedDate:()=>dl,_coercedNumber:()=>Gc,_coercedString:()=>gc,_cuid:()=>Ec,_cuid2:()=>Dc,_custom:()=>pu,_date:()=>ul,_decode:()=>gt,_decodeAsync:()=>bt,_default:()=>iu,_discriminatedUnion:()=>Gl,_e164:()=>Rc,_email:()=>_c,_emoji:()=>wc,_encode:()=>mt,_encodeAsync:()=>vt,_endsWith:()=>Nl,_enum:()=>Zl,_file:()=>eu,_float32:()=>qc,_float64:()=>Jc,_gt:()=>hl,_gte:()=>gl,_guid:()=>vc,_includes:()=>jl,_int:()=>Kc,_int32:()=>Yc,_int64:()=>tl,_intersection:()=>Kl,_ipv4:()=>jc,_ipv6:()=>Mc,_isoDate:()=>Vc,_isoDateTime:()=>Bc,_isoDuration:()=>Uc,_isoTime:()=>Hc,_jwt:()=>zc,_ksuid:()=>Ac,_lazy:()=>du,_length:()=>Dl,_literal:()=>$l,_lowercase:()=>kl,_lt:()=>pl,_lte:()=>ml,_mac:()=>Nc,_map:()=>Yl,_max:()=>ml,_maxLength:()=>Tl,_maxSize:()=>Sl,_mime:()=>Fl,_min:()=>gl,_minLength:()=>El,_minSize:()=>Cl,_multipleOf:()=>xl,_nan:()=>fl,_nanoid:()=>Tc,_nativeEnum:()=>Ql,_negative:()=>vl,_never:()=>cl,_nonnegative:()=>bl,_nonoptional:()=>au,_nonpositive:()=>yl,_normalize:()=>Ll,_null:()=>al,_nullable:()=>ru,_number:()=>Wc,_optional:()=>nu,_overwrite:()=>Il,_parse:()=>ot,_parseAsync:()=>ct,_pipe:()=>cu,_positive:()=>_l,_promise:()=>fu,_property:()=>Pl,_readonly:()=>lu,_record:()=>Jl,_refine:()=>mu,_regex:()=>Ol,_safeDecode:()=>wt,_safeDecodeAsync:()=>Ot,_safeEncode:()=>St,_safeEncodeAsync:()=>Et,_safeParse:()=>ut,_safeParseAsync:()=>ft,_set:()=>Xl,_size:()=>wl,_slugify:()=>Vl,_startsWith:()=>Ml,_string:()=>hc,_stringFormat:()=>bu,_stringbool:()=>yu,_success:()=>ou,_superRefine:()=>hu,_symbol:()=>rl,_templateLiteral:()=>uu,_toLowerCase:()=>zl,_toUpperCase:()=>Bl,_transform:()=>tu,_trim:()=>Rl,_tuple:()=>ql,_uint32:()=>Xc,_uint64:()=>nl,_ulid:()=>Oc,_undefined:()=>il,_union:()=>Ul,_unknown:()=>sl,_uppercase:()=>Al,_url:()=>Cc,_uuid:()=>yc,_uuidv4:()=>bc,_uuidv6:()=>xc,_uuidv7:()=>Sc,_void:()=>ll,_xid:()=>kc,_xor:()=>Wl,clone:()=>_e,config:()=>a,createStandardJSONSchemaMethod:()=>Ou,createToJSONSchemaMethod:()=>Du,decode:()=>_t,decodeAsync:()=>xt,describe:()=>_u,encode:()=>ht,encodeAsync:()=>yt,extractDefs:()=>wu,finalize:()=>Tu,flattenError:()=>Ze,formatError:()=>Qe,globalConfig:()=>d,globalRegistry:()=>pc,initializeContext:()=>Cu,isValidBase64:()=>vr,isValidBase64URL:()=>yr,isValidJWT:()=>br,locales:()=>oc,meta:()=>vu,parse:()=>st,parseAsync:()=>lt,prettifyError:()=>tt,process:()=>j,regexes:()=>jt,registry:()=>cc,safeDecode:()=>Tt,safeDecodeAsync:()=>kt,safeEncode:()=>Ct,safeEncodeAsync:()=>Dt,safeParse:()=>dt,safeParseAsync:()=>pt,toDotPath:()=>et,toJSONSchema:()=>Au,treeifyError:()=>$e,util:()=>p,version:()=>gr}),wd=t((()=>{f(),At(),at(),oa(),pr(),_r(),D(),Un(),sc(),mc(),hr(),Su(),ku(),vd(),bd(),Sd()}));function Td(e){return!!e._zod}function Ed(e,t){return Td(e)?dt(e,t):e.safeParse(t)}function Dd(e){if(!e)return;let t;if(t=Td(e)?e._zod?.def?.shape:e.shape,t){if(typeof t==`function`)try{return t()}catch{return}return t}}function Od(e){if(Td(e)){let t=e._zod?.def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}}let t=e._def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}let n=e.value;if(n!==void 0)return n}var kd=n({endsWith:()=>Nl,gt:()=>hl,gte:()=>gl,includes:()=>jl,length:()=>Dl,lowercase:()=>kl,lt:()=>pl,lte:()=>ml,maxLength:()=>Tl,maxSize:()=>Sl,mime:()=>Fl,minLength:()=>El,minSize:()=>Cl,multipleOf:()=>xl,negative:()=>vl,nonnegative:()=>bl,nonpositive:()=>yl,normalize:()=>Ll,overwrite:()=>Il,positive:()=>_l,property:()=>Pl,regex:()=>Ol,size:()=>wl,slugify:()=>Vl,startsWith:()=>Ml,toLowerCase:()=>zl,toUpperCase:()=>Bl,trim:()=>Rl,uppercase:()=>Al}),Ad=t((()=>{wd()})),jd=n({ZodISODate:()=>Ld,ZodISODateTime:()=>Id,ZodISODuration:()=>zd,ZodISOTime:()=>Rd,date:()=>Nd,datetime:()=>Md,duration:()=>Fd,time:()=>Pd});function Md(e){return Bc(Id,e)}function Nd(e){return Vc(Ld,e)}function Pd(e){return Hc(Rd,e)}function Fd(e){return Uc(zd,e)}var Id,Ld,Rd,zd,Bd=t((()=>{wd(),Qm(),Id=i(`ZodISODateTime`,(e,t)=>{ei.init(e,t),W.init(e,t)}),Ld=i(`ZodISODate`,(e,t)=>{ti.init(e,t),W.init(e,t)}),Rd=i(`ZodISOTime`,(e,t)=>{ni.init(e,t),W.init(e,t)}),zd=i(`ZodISODuration`,(e,t)=>{ri.init(e,t),W.init(e,t)})})),Vd,Hd,Ud,Wd=t((()=>{wd(),D(),Vd=(e,t)=>{rt.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Qe(e,t)},flatten:{value:t=>Ze(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,ne,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,ne,2)}},isEmpty:{get(){return e.issues.length===0}}})},Hd=i(`ZodError`,Vd),Ud=i(`ZodError`,Vd,{Parent:Error})})),Gd,Kd,qd,Jd,Yd,Xd,Zd,Qd,$d,ef,tf,nf,rf=t((()=>{wd(),Wd(),Gd=ot(Ud),Kd=ct(Ud),qd=ut(Ud),Jd=ft(Ud),Yd=mt(Ud),Xd=gt(Ud),Zd=vt(Ud),Qd=bt(Ud),$d=St(Ud),ef=wt(Ud),tf=Et(Ud),nf=Ot(Ud)})),af=n({ZodAny:()=>fm,ZodArray:()=>_m,ZodBase64:()=>$p,ZodBase64URL:()=>em,ZodBigInt:()=>sm,ZodBigIntFormat:()=>cm,ZodBoolean:()=>om,ZodCIDRv4:()=>Zp,ZodCIDRv6:()=>Qp,ZodCUID:()=>Up,ZodCUID2:()=>Wp,ZodCatch:()=>Rm,ZodCodec:()=>Vm,ZodCustom:()=>Jm,ZodCustomStringFormat:()=>rm,ZodDate:()=>gm,ZodDefault:()=>Pm,ZodDiscriminatedUnion:()=>xm,ZodE164:()=>tm,ZodEmail:()=>Lp,ZodEmoji:()=>Vp,ZodEnum:()=>Dm,ZodExactOptional:()=>Mm,ZodFile:()=>km,ZodFunction:()=>qm,ZodGUID:()=>Rp,ZodIPv4:()=>Jp,ZodIPv6:()=>Xp,ZodIntersection:()=>Sm,ZodJWT:()=>nm,ZodKSUID:()=>qp,ZodLazy:()=>Gm,ZodLiteral:()=>Om,ZodMAC:()=>Yp,ZodMap:()=>Tm,ZodNaN:()=>zm,ZodNanoID:()=>Hp,ZodNever:()=>mm,ZodNonOptional:()=>Im,ZodNull:()=>dm,ZodNullable:()=>Nm,ZodNumber:()=>im,ZodNumberFormat:()=>am,ZodObject:()=>vm,ZodOptional:()=>jm,ZodPipe:()=>Bm,ZodPrefault:()=>Fm,ZodPreprocess:()=>Hm,ZodPromise:()=>Km,ZodReadonly:()=>Um,ZodRecord:()=>wm,ZodSet:()=>Em,ZodString:()=>Ip,ZodStringFormat:()=>W,ZodSuccess:()=>Lm,ZodSymbol:()=>lm,ZodTemplateLiteral:()=>Wm,ZodTransform:()=>Am,ZodTuple:()=>Cm,ZodType:()=>U,ZodULID:()=>Gp,ZodURL:()=>Bp,ZodUUID:()=>zp,ZodUndefined:()=>um,ZodUnion:()=>ym,ZodUnknown:()=>pm,ZodVoid:()=>hm,ZodXID:()=>Kp,ZodXor:()=>bm,_ZodString:()=>Fp,_default:()=>pp,_function:()=>Ep,any:()=>Kf,array:()=>I,base64:()=>Df,base64url:()=>Of,bigint:()=>Bf,boolean:()=>P,catch:()=>_p,check:()=>Dp,cidrv4:()=>Tf,cidrv6:()=>Ef,codec:()=>bp,cuid:()=>_f,cuid2:()=>vf,custom:()=>Op,date:()=>Yf,describe:()=>Ym,discriminatedUnion:()=>ep,e164:()=>kf,email:()=>sf,emoji:()=>hf,enum:()=>B,exactOptional:()=>up,file:()=>cp,float32:()=>If,float64:()=>Lf,function:()=>Ep,guid:()=>cf,hash:()=>Pf,hex:()=>Nf,hostname:()=>Mf,httpUrl:()=>mf,instanceof:()=>jp,int:()=>Ff,int32:()=>Rf,int64:()=>Vf,intersection:()=>tp,invertCodec:()=>xp,ipv4:()=>Sf,ipv6:()=>wf,json:()=>Mp,jwt:()=>Af,keyof:()=>Xf,ksuid:()=>xf,lazy:()=>wp,literal:()=>V,looseObject:()=>Qf,looseRecord:()=>ip,mac:()=>Cf,map:()=>ap,meta:()=>Xm,nan:()=>vp,nanoid:()=>gf,nativeEnum:()=>sp,never:()=>qf,nonoptional:()=>hp,null:()=>Gf,nullable:()=>dp,nullish:()=>fp,number:()=>N,object:()=>L,optional:()=>H,partialRecord:()=>rp,pipe:()=>yp,prefault:()=>mp,preprocess:()=>Np,promise:()=>Tp,readonly:()=>Sp,record:()=>z,refine:()=>kp,set:()=>op,strictObject:()=>Zf,string:()=>M,stringFormat:()=>jf,stringbool:()=>Zm,success:()=>gp,superRefine:()=>Ap,symbol:()=>Uf,templateLiteral:()=>Cp,transform:()=>lp,tuple:()=>np,uint32:()=>zf,uint64:()=>Hf,ulid:()=>yf,undefined:()=>Wf,union:()=>R,unknown:()=>F,url:()=>pf,uuid:()=>lf,uuidv4:()=>uf,uuidv6:()=>df,uuidv7:()=>ff,void:()=>Jf,xid:()=>bf,xor:()=>$f});function of(e,t,n){let r=Object.getPrototypeOf(e),i=Pp.get(r);if(i||(i=new Set,Pp.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}function M(e){return hc(Ip,e)}function sf(e){return _c(Lp,e)}function cf(e){return vc(Rp,e)}function lf(e){return yc(zp,e)}function uf(e){return bc(zp,e)}function df(e){return xc(zp,e)}function ff(e){return Sc(zp,e)}function pf(e){return Cc(Bp,e)}function mf(e){return Cc(Bp,{protocol:mn,hostname:pn,...w(e)})}function hf(e){return wc(Vp,e)}function gf(e){return Tc(Hp,e)}function _f(e){return Ec(Up,e)}function vf(e){return Dc(Wp,e)}function yf(e){return Oc(Gp,e)}function bf(e){return kc(Kp,e)}function xf(e){return Ac(qp,e)}function Sf(e){return jc(Jp,e)}function Cf(e){return Nc(Yp,e)}function wf(e){return Mc(Xp,e)}function Tf(e){return Pc(Zp,e)}function Ef(e){return Fc(Qp,e)}function Df(e){return Ic($p,e)}function Of(e){return Lc(em,e)}function kf(e){return Rc(tm,e)}function Af(e){return zc(nm,e)}function jf(e,t,n={}){return bu(rm,e,t,n)}function Mf(e){return bu(rm,`hostname`,fn,e)}function Nf(e){return bu(rm,`hex`,Dn,e)}function Pf(e,t){let n=`${e}_${t?.enc??`hex`}`,r=jt[n];if(!r)throw Error(`Unrecognized hash format: ${n}`);return bu(rm,n,r,t)}function N(e){return Wc(im,e)}function Ff(e){return Kc(am,e)}function If(e){return qc(am,e)}function Lf(e){return Jc(am,e)}function Rf(e){return Yc(am,e)}function zf(e){return Xc(am,e)}function P(e){return Zc(om,e)}function Bf(e){return $c(sm,e)}function Vf(e){return tl(cm,e)}function Hf(e){return nl(cm,e)}function Uf(e){return rl(lm,e)}function Wf(e){return il(um,e)}function Gf(e){return al(dm,e)}function Kf(){return ol(fm)}function F(){return sl(pm)}function qf(e){return cl(mm,e)}function Jf(e){return ll(hm,e)}function Yf(e){return ul(gm,e)}function I(e,t){return Hl(_m,e,t)}function Xf(e){let t=e._zod.def.shape;return B(Object.keys(t))}function L(e,t){return new vm({type:`object`,shape:e??{},...w(t)})}function Zf(e,t){return new vm({type:`object`,shape:e,catchall:qf(),...w(t)})}function Qf(e,t){return new vm({type:`object`,shape:e,catchall:F(),...w(t)})}function R(e,t){return new ym({type:`union`,options:e,...w(t)})}function $f(e,t){return new bm({type:`union`,options:e,inclusive:!1,...w(t)})}function ep(e,t,n){return new xm({type:`union`,options:t,discriminator:e,...w(n)})}function tp(e,t){return new Sm({type:`intersection`,left:e,right:t})}function np(e,t,n){let r=t instanceof k;return new Cm({type:`tuple`,items:e,rest:r?t:null,...w(r?n:t)})}function z(e,t,n){return!t||!t._zod?new wm({type:`record`,keyType:M(),valueType:e,...w(t)}):new wm({type:`record`,keyType:e,valueType:t,...w(n)})}function rp(e,t,n){let r=_e(e);return r._zod.values=void 0,new wm({type:`record`,keyType:r,valueType:t,...w(n)})}function ip(e,t,n){return new wm({type:`record`,keyType:e,valueType:t,mode:`loose`,...w(n)})}function ap(e,t,n){return new Tm({type:`map`,keyType:e,valueType:t,...w(n)})}function op(e,t){return new Em({type:`set`,valueType:e,...w(t)})}function B(e,t){return new Dm({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...w(t)})}function sp(e,t){return new Dm({type:`enum`,entries:e,...w(t)})}function V(e,t){return new Om({type:`literal`,values:Array.isArray(e)?e:[e],...w(t)})}function cp(e){return eu(km,e)}function lp(e){return new Am({type:`transform`,transform:e})}function H(e){return new jm({type:`optional`,innerType:e})}function up(e){return new Mm({type:`optional`,innerType:e})}function dp(e){return new Nm({type:`nullable`,innerType:e})}function fp(e){return H(dp(e))}function pp(e,t){return new Pm({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():he(t)}})}function mp(e,t){return new Fm({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():he(t)}})}function hp(e,t){return new Im({type:`nonoptional`,innerType:e,...w(t)})}function gp(e){return new Lm({type:`success`,innerType:e})}function _p(e,t){return new Rm({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}function vp(e){return fl(zm,e)}function yp(e,t){return new Bm({type:`pipe`,in:e,out:t})}function bp(e,t,n){return new Vm({type:`pipe`,in:e,out:t,transform:n.decode,reverseTransform:n.encode})}function xp(e){let t=e._zod.def;return new Vm({type:`pipe`,in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}function Sp(e){return new Um({type:`readonly`,innerType:e})}function Cp(e,t){return new Wm({type:`template_literal`,parts:e,...w(t)})}function wp(e){return new Gm({type:`lazy`,getter:e})}function Tp(e){return new Km({type:`promise`,innerType:e})}function Ep(e){return new qm({type:`function`,input:Array.isArray(e?.input)?np(e?.input):e?.input??I(F()),output:e?.output??F()})}function Dp(e){let t=new O({check:`custom`});return t._zod.check=e,t}function Op(e,t){return pu(Jm,e??(()=>!0),t)}function kp(e,t={}){return mu(Jm,e,t)}function Ap(e,t){return hu(e,t)}function jp(e,t={}){let n=new Jm({type:`custom`,check:`custom`,fn:t=>t instanceof e,abort:!0,...w(t)});return n._zod.bag.Class=e,n._zod.check=t=>{t.value instanceof e||t.issues.push({code:`invalid_type`,expected:e.name,input:t.value,inst:n,path:[...n._zod.def.path??[]]})},n}function Mp(e){let t=wp(()=>R([M(e),N(),P(),Gf(),I(t),z(M(),t)]));return t}function Np(e,t){return new Hm({type:`pipe`,in:lp(e),out:t})}var Pp,U,Fp,Ip,W,Lp,Rp,zp,Bp,Vp,Hp,Up,Wp,Gp,Kp,qp,Jp,Yp,Xp,Zp,Qp,$p,em,tm,nm,rm,im,am,om,sm,cm,lm,um,dm,fm,pm,mm,hm,gm,_m,vm,ym,bm,xm,Sm,Cm,wm,Tm,Em,Dm,Om,km,Am,jm,Mm,Nm,Pm,Fm,Im,Lm,Rm,zm,Bm,Vm,Hm,Um,Wm,Gm,Km,qm,Jm,Ym,Xm,Zm,Qm=t((()=>{wd(),vd(),ku(),Ad(),Bd(),rf(),Pp=new WeakMap,U=i(`ZodType`,(e,t)=>(k.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:Ou(e,`input`),output:Ou(e,`output`)}}),e.toJSONSchema=Du(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.parse=(t,n)=>Gd(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>qd(e,t,n),e.parseAsync=async(t,n)=>Kd(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Jd(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Yd(e,t,n),e.decode=(t,n)=>Xd(e,t,n),e.encodeAsync=async(t,n)=>Zd(e,t,n),e.decodeAsync=async(t,n)=>Qd(e,t,n),e.safeEncode=(t,n)=>$d(e,t,n),e.safeDecode=(t,n)=>ef(e,t,n),e.safeEncodeAsync=async(t,n)=>tf(e,t,n),e.safeDecodeAsync=async(t,n)=>nf(e,t,n),of(e,`ZodType`,{check(...e){let t=this.def;return this.clone(S(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return _e(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(kp(e,t))},superRefine(e,t){return this.check(Ap(e,t))},overwrite(e){return this.check(Il(e))},optional(){return H(this)},exactOptional(){return up(this)},nullable(){return dp(this)},nullish(){return H(dp(this))},nonoptional(e){return hp(this,e)},array(){return I(this)},or(e){return R([this,e])},and(e){return tp(this,e)},transform(e){return yp(this,lp(e))},default(e){return pp(this,e)},prefault(e){return mp(this,e)},catch(e){return _p(this,e)},pipe(e){return yp(this,e)},readonly(){return Sp(this)},describe(e){let t=this.clone();return pc.add(t,{description:e}),t},meta(...e){if(e.length===0)return pc.get(this);let t=this.clone();return pc.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,`description`,{get(){return pc.get(e)?.description},configurable:!0}),e)),Fp=i(`_ZodString`,(e,t)=>{Hr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mu(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,of(e,`_ZodString`,{regex(...e){return this.check(Ol(...e))},includes(...e){return this.check(jl(...e))},startsWith(...e){return this.check(Ml(...e))},endsWith(...e){return this.check(Nl(...e))},min(...e){return this.check(El(...e))},max(...e){return this.check(Tl(...e))},length(...e){return this.check(Dl(...e))},nonempty(...e){return this.check(El(1,...e))},lowercase(e){return this.check(kl(e))},uppercase(e){return this.check(Al(e))},trim(){return this.check(Rl())},normalize(...e){return this.check(Ll(...e))},toLowerCase(){return this.check(zl())},toUpperCase(){return this.check(Bl())},slugify(){return this.check(Vl())}})}),Ip=i(`ZodString`,(e,t)=>{Hr.init(e,t),Fp.init(e,t),e.email=t=>e.check(_c(Lp,t)),e.url=t=>e.check(Cc(Bp,t)),e.jwt=t=>e.check(zc(nm,t)),e.emoji=t=>e.check(wc(Vp,t)),e.guid=t=>e.check(vc(Rp,t)),e.uuid=t=>e.check(yc(zp,t)),e.uuidv4=t=>e.check(bc(zp,t)),e.uuidv6=t=>e.check(xc(zp,t)),e.uuidv7=t=>e.check(Sc(zp,t)),e.nanoid=t=>e.check(Tc(Hp,t)),e.guid=t=>e.check(vc(Rp,t)),e.cuid=t=>e.check(Ec(Up,t)),e.cuid2=t=>e.check(Dc(Wp,t)),e.ulid=t=>e.check(Oc(Gp,t)),e.base64=t=>e.check(Ic($p,t)),e.base64url=t=>e.check(Lc(em,t)),e.xid=t=>e.check(kc(Kp,t)),e.ksuid=t=>e.check(Ac(qp,t)),e.ipv4=t=>e.check(jc(Jp,t)),e.ipv6=t=>e.check(Mc(Xp,t)),e.cidrv4=t=>e.check(Pc(Zp,t)),e.cidrv6=t=>e.check(Fc(Qp,t)),e.e164=t=>e.check(Rc(tm,t)),e.datetime=t=>e.check(Md(t)),e.date=t=>e.check(Nd(t)),e.time=t=>e.check(Pd(t)),e.duration=t=>e.check(Fd(t))}),W=i(`ZodStringFormat`,(e,t)=>{A.init(e,t),Fp.init(e,t)}),Lp=i(`ZodEmail`,(e,t)=>{Gr.init(e,t),W.init(e,t)}),Rp=i(`ZodGUID`,(e,t)=>{Ur.init(e,t),W.init(e,t)}),zp=i(`ZodUUID`,(e,t)=>{Wr.init(e,t),W.init(e,t)}),Bp=i(`ZodURL`,(e,t)=>{Kr.init(e,t),W.init(e,t)}),Vp=i(`ZodEmoji`,(e,t)=>{qr.init(e,t),W.init(e,t)}),Hp=i(`ZodNanoID`,(e,t)=>{Jr.init(e,t),W.init(e,t)}),Up=i(`ZodCUID`,(e,t)=>{Yr.init(e,t),W.init(e,t)}),Wp=i(`ZodCUID2`,(e,t)=>{Xr.init(e,t),W.init(e,t)}),Gp=i(`ZodULID`,(e,t)=>{Zr.init(e,t),W.init(e,t)}),Kp=i(`ZodXID`,(e,t)=>{Qr.init(e,t),W.init(e,t)}),qp=i(`ZodKSUID`,(e,t)=>{$r.init(e,t),W.init(e,t)}),Jp=i(`ZodIPv4`,(e,t)=>{ii.init(e,t),W.init(e,t)}),Yp=i(`ZodMAC`,(e,t)=>{oi.init(e,t),W.init(e,t)}),Xp=i(`ZodIPv6`,(e,t)=>{ai.init(e,t),W.init(e,t)}),Zp=i(`ZodCIDRv4`,(e,t)=>{si.init(e,t),W.init(e,t)}),Qp=i(`ZodCIDRv6`,(e,t)=>{ci.init(e,t),W.init(e,t)}),$p=i(`ZodBase64`,(e,t)=>{li.init(e,t),W.init(e,t)}),em=i(`ZodBase64URL`,(e,t)=>{ui.init(e,t),W.init(e,t)}),tm=i(`ZodE164`,(e,t)=>{di.init(e,t),W.init(e,t)}),nm=i(`ZodJWT`,(e,t)=>{fi.init(e,t),W.init(e,t)}),rm=i(`ZodCustomStringFormat`,(e,t)=>{pi.init(e,t),W.init(e,t)}),im=i(`ZodNumber`,(e,t)=>{mi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Nu(e,t,n,r),of(e,`ZodNumber`,{gt(e,t){return this.check(hl(e,t))},gte(e,t){return this.check(gl(e,t))},min(e,t){return this.check(gl(e,t))},lt(e,t){return this.check(pl(e,t))},lte(e,t){return this.check(ml(e,t))},max(e,t){return this.check(ml(e,t))},int(e){return this.check(Ff(e))},safe(e){return this.check(Ff(e))},positive(e){return this.check(hl(0,e))},nonnegative(e){return this.check(gl(0,e))},negative(e){return this.check(pl(0,e))},nonpositive(e){return this.check(ml(0,e))},multipleOf(e,t){return this.check(xl(e,t))},step(e,t){return this.check(xl(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null}),am=i(`ZodNumberFormat`,(e,t)=>{hi.init(e,t),im.init(e,t)}),om=i(`ZodBoolean`,(e,t)=>{gi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pu(e,t,n,r)}),sm=i(`ZodBigInt`,(e,t)=>{_i.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fu(e,t,n,r),e.gte=(t,n)=>e.check(gl(t,n)),e.min=(t,n)=>e.check(gl(t,n)),e.gt=(t,n)=>e.check(hl(t,n)),e.gte=(t,n)=>e.check(gl(t,n)),e.min=(t,n)=>e.check(gl(t,n)),e.lt=(t,n)=>e.check(pl(t,n)),e.lte=(t,n)=>e.check(ml(t,n)),e.max=(t,n)=>e.check(ml(t,n)),e.positive=t=>e.check(hl(BigInt(0),t)),e.negative=t=>e.check(pl(BigInt(0),t)),e.nonpositive=t=>e.check(ml(BigInt(0),t)),e.nonnegative=t=>e.check(gl(BigInt(0),t)),e.multipleOf=(t,n)=>e.check(xl(t,n));let n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null}),cm=i(`ZodBigIntFormat`,(e,t)=>{vi.init(e,t),sm.init(e,t)}),lm=i(`ZodSymbol`,(e,t)=>{yi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Iu(e,t,n,r)}),um=i(`ZodUndefined`,(e,t)=>{bi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ru(e,t,n,r)}),dm=i(`ZodNull`,(e,t)=>{xi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Lu(e,t,n,r)}),fm=i(`ZodAny`,(e,t)=>{Si.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vu(e,t,n,r)}),pm=i(`ZodUnknown`,(e,t)=>{Ci.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hu(e,t,n,r)}),mm=i(`ZodNever`,(e,t)=>{wi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bu(e,t,n,r)}),hm=i(`ZodVoid`,(e,t)=>{Ti.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zu(e,t,n,r)}),gm=i(`ZodDate`,(e,t)=>{Ei.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Uu(e,t,n,r),e.min=(t,n)=>e.check(gl(t,n)),e.max=(t,n)=>e.check(ml(t,n));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null}),_m=i(`ZodArray`,(e,t)=>{Di.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>td(e,t,n,r),e.element=t.element,of(e,`ZodArray`,{min(e,t){return this.check(El(e,t))},nonempty(e){return this.check(El(1,e))},max(e,t){return this.check(Tl(e,t))},length(e,t){return this.check(Dl(e,t))},unwrap(){return this.element}})}),vm=i(`ZodObject`,(e,t)=>{ki.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>nd(e,t,n,r),b(e,`shape`,()=>t.shape),of(e,`ZodObject`,{keyof(){return B(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:F()})},loose(){return this.clone({...this._zod.def,catchall:F()})},strict(){return this.clone({...this._zod.def,catchall:qf()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return Se(this,e)},safeExtend(e){return Ce(this,e)},merge(e){return we(this,e)},pick(e){return be(this,e)},omit(e){return xe(this,e)},partial(...e){return Te(jm,this,e[0])},required(...e){return Ee(Im,this,e[0])}})}),ym=i(`ZodUnion`,(e,t)=>{Ai.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>rd(e,t,n,r),e.options=t.options}),bm=i(`ZodXor`,(e,t)=>{ym.init(e,t),ji.init(e,t),e._zod.processJSONSchema=(t,n,r)=>rd(e,t,n,r),e.options=t.options}),xm=i(`ZodDiscriminatedUnion`,(e,t)=>{ym.init(e,t),Mi.init(e,t)}),Sm=i(`ZodIntersection`,(e,t)=>{Ni.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>id(e,t,n,r)}),Cm=i(`ZodTuple`,(e,t)=>{Pi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ad(e,t,n,r),e.rest=t=>e.clone({...e._zod.def,rest:t})}),wm=i(`ZodRecord`,(e,t)=>{Fi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>od(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType}),Tm=i(`ZodMap`,(e,t)=>{Ii.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$u(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...t)=>e.check(Cl(...t)),e.nonempty=t=>e.check(Cl(1,t)),e.max=(...t)=>e.check(Sl(...t)),e.size=(...t)=>e.check(wl(...t))}),Em=i(`ZodSet`,(e,t)=>{Li.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ed(e,t,n,r),e.min=(...t)=>e.check(Cl(...t)),e.nonempty=t=>e.check(Cl(1,t)),e.max=(...t)=>e.check(Sl(...t)),e.size=(...t)=>e.check(wl(...t))}),Dm=i(`ZodEnum`,(e,t)=>{Ri.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wu(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Dm({...t,checks:[],...w(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Dm({...t,checks:[],...w(r),entries:i})}}),Om=i(`ZodLiteral`,(e,t)=>{zi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gu(e,t,n,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]}})}),km=i(`ZodFile`,(e,t)=>{Bi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ju(e,t,n,r),e.min=(t,n)=>e.check(Cl(t,n)),e.max=(t,n)=>e.check(Sl(t,n)),e.mime=(t,n)=>e.check(Fl(Array.isArray(t)?t:[t],n))}),Am=i(`ZodTransform`,(e,t)=>{Vi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qu(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new u(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Pe(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(Pe(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}}),jm=i(`ZodOptional`,(e,t)=>{Hi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hd(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),Mm=i(`ZodExactOptional`,(e,t)=>{Ui.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hd(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),Nm=i(`ZodNullable`,(e,t)=>{Wi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>sd(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),Pm=i(`ZodDefault`,(e,t)=>{Gi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ld(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}),Fm=i(`ZodPrefault`,(e,t)=>{Ki.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ud(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),Im=i(`ZodNonOptional`,(e,t)=>{qi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cd(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),Lm=i(`ZodSuccess`,(e,t)=>{Ji.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),Rm=i(`ZodCatch`,(e,t)=>{Yi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>dd(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}),zm=i(`ZodNaN`,(e,t)=>{Xi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ku(e,t,n,r)}),Bm=i(`ZodPipe`,(e,t)=>{Zi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fd(e,t,n,r),e.in=t.in,e.out=t.out}),Vm=i(`ZodCodec`,(e,t)=>{Bm.init(e,t),Qi.init(e,t)}),Hm=i(`ZodPreprocess`,(e,t)=>{Bm.init(e,t),$i.init(e,t)}),Um=i(`ZodReadonly`,(e,t)=>{ea.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pd(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),Wm=i(`ZodTemplateLiteral`,(e,t)=>{ta.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qu(e,t,n,r)}),Gm=i(`ZodLazy`,(e,t)=>{ia.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gd(e,t,n,r),e.unwrap=()=>e._zod.def.getter()}),Km=i(`ZodPromise`,(e,t)=>{ra.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>md(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),qm=i(`ZodFunction`,(e,t)=>{na.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zu(e,t,n,r)}),Jm=i(`ZodCustom`,(e,t)=>{aa.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xu(e,t,n,r)}),Ym=_u,Xm=vu,Zm=(...e)=>yu({Codec:Vm,Boolean:om,String:Ip},...e)}));function $m(e){a({customError:e})}function eh(){return a().customError}var th,nh,rh=t((()=>{wd(),th={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(e){})(nh||={})}));function ih(e,t){let n=e.$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`:t??`draft-2020-12`}function ah(e,t){if(!e.startsWith(`#`))throw Error(`External $ref is not supported, only local refs (#/...) are allowed`);let n=e.slice(1).split(`/`).filter(Boolean);if(n.length===0)return t.rootSchema;let r=t.version===`draft-2020-12`?`$defs`:`definitions`;if(n[0]===r){let r=n[1];if(!r||!t.defs[r])throw Error(`Reference not found: ${e}`);return t.defs[r]}throw Error(`Reference not found: ${e}`)}function oh(e,t){if(e.not!==void 0){if(typeof e.not==`object`&&Object.keys(e.not).length===0)return G.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 G.lazy(()=>{if(!t.refs.has(n))throw Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);let r=sh(ah(n,t),t);return t.refs.set(n,r),t.processing.delete(n),r}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 G.null();if(n.length===0)return G.never();if(n.length===1)return G.literal(n[0]);if(n.every(e=>typeof e==`string`))return G.enum(n);let r=n.map(e=>G.literal(e));return r.length<2?r[0]:G.union([r[0],r[1],...r.slice(2)])}if(e.const!==void 0)return G.literal(e.const);let n=e.type;if(Array.isArray(n)){let r=n.map(n=>oh({...e,type:n},t));return r.length===0?G.never():r.length===1?r[0]:G.union(r)}if(!n)return G.any();let r;switch(n){case`string`:{let t=G.string();if(e.format){let n=e.format;n===`email`?t=t.check(G.email()):n===`uri`||n===`uri-reference`?t=t.check(G.url()):n===`uuid`||n===`guid`?t=t.check(G.uuid()):n===`date-time`?t=t.check(G.iso.datetime()):n===`date`?t=t.check(G.iso.date()):n===`time`?t=t.check(G.iso.time()):n===`duration`?t=t.check(G.iso.duration()):n===`ipv4`?t=t.check(G.ipv4()):n===`ipv6`?t=t.check(G.ipv6()):n===`mac`?t=t.check(G.mac()):n===`cidr`?t=t.check(G.cidrv4()):n===`cidr-v6`?t=t.check(G.cidrv6()):n===`base64`?t=t.check(G.base64()):n===`base64url`?t=t.check(G.base64url()):n===`e164`?t=t.check(G.e164()):n===`jwt`?t=t.check(G.jwt()):n===`emoji`?t=t.check(G.emoji()):n===`nanoid`?t=t.check(G.nanoid()):n===`cuid`?t=t.check(G.cuid()):n===`cuid2`?t=t.check(G.cuid2()):n===`ulid`?t=t.check(G.ulid()):n===`xid`?t=t.check(G.xid()):n===`ksuid`&&(t=t.check(G.ksuid()))}typeof e.minLength==`number`&&(t=t.min(e.minLength)),typeof e.maxLength==`number`&&(t=t.max(e.maxLength)),e.pattern&&(t=t.regex(new RegExp(e.pattern))),r=t;break}case`number`:case`integer`:{let t=n===`integer`?G.number().int():G.number();typeof e.minimum==`number`&&(t=t.min(e.minimum)),typeof e.maximum==`number`&&(t=t.max(e.maximum)),typeof e.exclusiveMinimum==`number`?t=t.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum==`number`&&(t=t.gt(e.minimum)),typeof e.exclusiveMaximum==`number`?t=t.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum==`number`&&(t=t.lt(e.maximum)),typeof e.multipleOf==`number`&&(t=t.multipleOf(e.multipleOf)),r=t;break}case`boolean`:r=G.boolean();break;case`null`:r=G.null();break;case`object`:{let n={},i=e.properties||{},a=new Set(e.required||[]);for(let[e,r]of Object.entries(i)){let i=sh(r,t);n[e]=a.has(e)?i:i.optional()}if(e.propertyNames){let i=sh(e.propertyNames,t),a=e.additionalProperties&&typeof e.additionalProperties==`object`?sh(e.additionalProperties,t):G.any();if(Object.keys(n).length===0){r=G.record(i,a);break}let o=G.object(n).passthrough(),s=G.looseRecord(i,a);r=G.intersection(o,s);break}if(e.patternProperties){let i=e.patternProperties,a=Object.keys(i),o=[];for(let e of a){let n=sh(i[e],t),r=G.string().regex(new RegExp(e));o.push(G.looseRecord(r,n))}let s=[];if(Object.keys(n).length>0&&s.push(G.object(n).passthrough()),s.push(...o),s.length===0)r=G.object({}).passthrough();else if(s.length===1)r=s[0];else{let e=G.intersection(s[0],s[1]);for(let t=2;t<s.length;t++)e=G.intersection(e,s[t]);r=e}break}let o=G.object(n);r=e.additionalProperties===!1?o.strict():typeof e.additionalProperties==`object`?o.catchall(sh(e.additionalProperties,t)):o.passthrough();break}case`array`:{let n=e.prefixItems,i=e.items;if(n&&Array.isArray(n)){let a=n.map(e=>sh(e,t)),o=i&&typeof i==`object`&&!Array.isArray(i)?sh(i,t):void 0;r=o?G.tuple(a).rest(o):G.tuple(a),typeof e.minItems==`number`&&(r=r.check(G.minLength(e.minItems))),typeof e.maxItems==`number`&&(r=r.check(G.maxLength(e.maxItems)))}else if(Array.isArray(i)){let n=i.map(e=>sh(e,t)),a=e.additionalItems&&typeof e.additionalItems==`object`?sh(e.additionalItems,t):void 0;r=a?G.tuple(n).rest(a):G.tuple(n),typeof e.minItems==`number`&&(r=r.check(G.minLength(e.minItems))),typeof e.maxItems==`number`&&(r=r.check(G.maxLength(e.maxItems)))}else if(i!==void 0){let n=sh(i,t),a=G.array(n);typeof e.minItems==`number`&&(a=a.min(e.minItems)),typeof e.maxItems==`number`&&(a=a.max(e.maxItems)),r=a}else r=G.array(G.any());break}default:throw Error(`Unsupported type: ${n}`)}return r}function sh(e,t){if(typeof e==`boolean`)return e?G.any():G.never();let n=oh(e,t),r=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let i=e.anyOf.map(e=>sh(e,t)),a=G.union(i);n=r?G.intersection(n,a):a}if(e.oneOf&&Array.isArray(e.oneOf)){let i=e.oneOf.map(e=>sh(e,t)),a=G.xor(i);n=r?G.intersection(n,a):a}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)n=r?n:G.any();else{let i=r?n:sh(e.allOf[0],t),a=+!r;for(let n=a;n<e.allOf.length;n++)i=G.intersection(i,sh(e.allOf[n],t));n=i}e.nullable===!0&&t.version===`openapi-3.0`&&(n=G.nullable(n)),e.readOnly===!0&&(n=G.readonly(n)),e.default!==void 0&&(n=n.default(e.default));let i={};for(let t of[`$id`,`id`,`$comment`,`$anchor`,`$vocabulary`,`$dynamicRef`,`$dynamicAnchor`])t in e&&(i[t]=e[t]);for(let t of[`contentEncoding`,`contentMediaType`,`contentSchema`])t in e&&(i[t]=e[t]);for(let t of Object.keys(e))lh.has(t)||(i[t]=e[t]);return Object.keys(i).length>0&&t.registry.add(n,i),e.description&&(n=n.describe(e.description)),n}function ch(e,t){if(typeof e==`boolean`)return e?G.any():G.never();let n;try{n=JSON.parse(JSON.stringify(e))}catch{throw Error(`fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas`)}let r={version:ih(n,t?.defaultTarget),defs:n.$defs||n.definitions||{},refs:new Map,processing:new Set,rootSchema:n,registry:t?.registry??pc};return sh(n,r)}var G,lh,uh=t((()=>{mc(),Ad(),Bd(),Qm(),G={...af,...kd,iso:jd},lh=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`.split(`.`))})),dh=n({bigint:()=>hh,boolean:()=>mh,date:()=>gh,number:()=>ph,string:()=>fh});function fh(e){return gc(Ip,e)}function ph(e){return Gc(im,e)}function mh(e){return Qc(om,e)}function hh(e){return el(sm,e)}function gh(e){return dl(gm,e)}var _h=t((()=>{wd(),Qm()})),vh=n({$brand:()=>c,$input:()=>dc,$output:()=>uc,NEVER:()=>s,TimePrecision:()=>xu,ZodAny:()=>fm,ZodArray:()=>_m,ZodBase64:()=>$p,ZodBase64URL:()=>em,ZodBigInt:()=>sm,ZodBigIntFormat:()=>cm,ZodBoolean:()=>om,ZodCIDRv4:()=>Zp,ZodCIDRv6:()=>Qp,ZodCUID:()=>Up,ZodCUID2:()=>Wp,ZodCatch:()=>Rm,ZodCodec:()=>Vm,ZodCustom:()=>Jm,ZodCustomStringFormat:()=>rm,ZodDate:()=>gm,ZodDefault:()=>Pm,ZodDiscriminatedUnion:()=>xm,ZodE164:()=>tm,ZodEmail:()=>Lp,ZodEmoji:()=>Vp,ZodEnum:()=>Dm,ZodError:()=>Hd,ZodExactOptional:()=>Mm,ZodFile:()=>km,ZodFirstPartyTypeKind:()=>nh,ZodFunction:()=>qm,ZodGUID:()=>Rp,ZodIPv4:()=>Jp,ZodIPv6:()=>Xp,ZodISODate:()=>Ld,ZodISODateTime:()=>Id,ZodISODuration:()=>zd,ZodISOTime:()=>Rd,ZodIntersection:()=>Sm,ZodIssueCode:()=>th,ZodJWT:()=>nm,ZodKSUID:()=>qp,ZodLazy:()=>Gm,ZodLiteral:()=>Om,ZodMAC:()=>Yp,ZodMap:()=>Tm,ZodNaN:()=>zm,ZodNanoID:()=>Hp,ZodNever:()=>mm,ZodNonOptional:()=>Im,ZodNull:()=>dm,ZodNullable:()=>Nm,ZodNumber:()=>im,ZodNumberFormat:()=>am,ZodObject:()=>vm,ZodOptional:()=>jm,ZodPipe:()=>Bm,ZodPrefault:()=>Fm,ZodPreprocess:()=>Hm,ZodPromise:()=>Km,ZodReadonly:()=>Um,ZodRealError:()=>Ud,ZodRecord:()=>wm,ZodSet:()=>Em,ZodString:()=>Ip,ZodStringFormat:()=>W,ZodSuccess:()=>Lm,ZodSymbol:()=>lm,ZodTemplateLiteral:()=>Wm,ZodTransform:()=>Am,ZodTuple:()=>Cm,ZodType:()=>U,ZodULID:()=>Gp,ZodURL:()=>Bp,ZodUUID:()=>zp,ZodUndefined:()=>um,ZodUnion:()=>ym,ZodUnknown:()=>pm,ZodVoid:()=>hm,ZodXID:()=>Kp,ZodXor:()=>bm,_ZodString:()=>Fp,_default:()=>pp,_function:()=>Ep,any:()=>Kf,array:()=>I,base64:()=>Df,base64url:()=>Of,bigint:()=>Bf,boolean:()=>P,catch:()=>_p,check:()=>Dp,cidrv4:()=>Tf,cidrv6:()=>Ef,clone:()=>_e,codec:()=>bp,coerce:()=>dh,config:()=>a,core:()=>Cd,cuid:()=>_f,cuid2:()=>vf,custom:()=>Op,date:()=>Yf,decode:()=>Xd,decodeAsync:()=>Qd,describe:()=>Ym,discriminatedUnion:()=>ep,e164:()=>kf,email:()=>sf,emoji:()=>hf,encode:()=>Yd,encodeAsync:()=>Zd,endsWith:()=>Nl,enum:()=>B,exactOptional:()=>up,file:()=>cp,flattenError:()=>Ze,float32:()=>If,float64:()=>Lf,formatError:()=>Qe,fromJSONSchema:()=>ch,function:()=>Ep,getErrorMap:()=>eh,globalRegistry:()=>pc,gt:()=>hl,gte:()=>gl,guid:()=>cf,hash:()=>Pf,hex:()=>Nf,hostname:()=>Mf,httpUrl:()=>mf,includes:()=>jl,instanceof:()=>jp,int:()=>Ff,int32:()=>Rf,int64:()=>Vf,intersection:()=>tp,invertCodec:()=>xp,ipv4:()=>Sf,ipv6:()=>wf,iso:()=>jd,json:()=>Mp,jwt:()=>Af,keyof:()=>Xf,ksuid:()=>xf,lazy:()=>wp,length:()=>Dl,literal:()=>V,locales:()=>oc,looseObject:()=>Qf,looseRecord:()=>ip,lowercase:()=>kl,lt:()=>pl,lte:()=>ml,mac:()=>Cf,map:()=>ap,maxLength:()=>Tl,maxSize:()=>Sl,meta:()=>Xm,mime:()=>Fl,minLength:()=>El,minSize:()=>Cl,multipleOf:()=>xl,nan:()=>vp,nanoid:()=>gf,nativeEnum:()=>sp,negative:()=>vl,never:()=>qf,nonnegative:()=>bl,nonoptional:()=>hp,nonpositive:()=>yl,normalize:()=>Ll,null:()=>Gf,nullable:()=>dp,nullish:()=>fp,number:()=>N,object:()=>L,optional:()=>H,overwrite:()=>Il,parse:()=>Gd,parseAsync:()=>Kd,partialRecord:()=>rp,pipe:()=>yp,positive:()=>_l,prefault:()=>mp,preprocess:()=>Np,prettifyError:()=>tt,promise:()=>Tp,property:()=>Pl,readonly:()=>Sp,record:()=>z,refine:()=>kp,regex:()=>Ol,regexes:()=>jt,registry:()=>cc,safeDecode:()=>ef,safeDecodeAsync:()=>nf,safeEncode:()=>$d,safeEncodeAsync:()=>tf,safeParse:()=>qd,safeParseAsync:()=>Jd,set:()=>op,setErrorMap:()=>$m,size:()=>wl,slugify:()=>Vl,startsWith:()=>Ml,strictObject:()=>Zf,string:()=>M,stringFormat:()=>jf,stringbool:()=>Zm,success:()=>gp,superRefine:()=>Ap,symbol:()=>Uf,templateLiteral:()=>Cp,toJSONSchema:()=>Au,toLowerCase:()=>zl,toUpperCase:()=>Bl,transform:()=>lp,treeifyError:()=>$e,trim:()=>Rl,tuple:()=>np,uint32:()=>zf,uint64:()=>Hf,ulid:()=>yf,undefined:()=>Wf,union:()=>R,unknown:()=>F,uppercase:()=>Al,url:()=>pf,util:()=>p,uuid:()=>lf,uuidv4:()=>uf,uuidv6:()=>df,uuidv7:()=>ff,void:()=>Jf,xid:()=>bf,xor:()=>$f}),yh=t((()=>{wd(),Qm(),Ad(),Wd(),rf(),rh(),La(),vd(),uh(),sc(),Bd(),_h(),a(Fa())})),bh,xh=t((()=>{yh(),yh(),bh=vh})),Sh=n({$brand:()=>c,$input:()=>dc,$output:()=>uc,NEVER:()=>s,TimePrecision:()=>xu,ZodAny:()=>fm,ZodArray:()=>_m,ZodBase64:()=>$p,ZodBase64URL:()=>em,ZodBigInt:()=>sm,ZodBigIntFormat:()=>cm,ZodBoolean:()=>om,ZodCIDRv4:()=>Zp,ZodCIDRv6:()=>Qp,ZodCUID:()=>Up,ZodCUID2:()=>Wp,ZodCatch:()=>Rm,ZodCodec:()=>Vm,ZodCustom:()=>Jm,ZodCustomStringFormat:()=>rm,ZodDate:()=>gm,ZodDefault:()=>Pm,ZodDiscriminatedUnion:()=>xm,ZodE164:()=>tm,ZodEmail:()=>Lp,ZodEmoji:()=>Vp,ZodEnum:()=>Dm,ZodError:()=>Hd,ZodExactOptional:()=>Mm,ZodFile:()=>km,ZodFirstPartyTypeKind:()=>nh,ZodFunction:()=>qm,ZodGUID:()=>Rp,ZodIPv4:()=>Jp,ZodIPv6:()=>Xp,ZodISODate:()=>Ld,ZodISODateTime:()=>Id,ZodISODuration:()=>zd,ZodISOTime:()=>Rd,ZodIntersection:()=>Sm,ZodIssueCode:()=>th,ZodJWT:()=>nm,ZodKSUID:()=>qp,ZodLazy:()=>Gm,ZodLiteral:()=>Om,ZodMAC:()=>Yp,ZodMap:()=>Tm,ZodNaN:()=>zm,ZodNanoID:()=>Hp,ZodNever:()=>mm,ZodNonOptional:()=>Im,ZodNull:()=>dm,ZodNullable:()=>Nm,ZodNumber:()=>im,ZodNumberFormat:()=>am,ZodObject:()=>vm,ZodOptional:()=>jm,ZodPipe:()=>Bm,ZodPrefault:()=>Fm,ZodPreprocess:()=>Hm,ZodPromise:()=>Km,ZodReadonly:()=>Um,ZodRealError:()=>Ud,ZodRecord:()=>wm,ZodSet:()=>Em,ZodString:()=>Ip,ZodStringFormat:()=>W,ZodSuccess:()=>Lm,ZodSymbol:()=>lm,ZodTemplateLiteral:()=>Wm,ZodTransform:()=>Am,ZodTuple:()=>Cm,ZodType:()=>U,ZodULID:()=>Gp,ZodURL:()=>Bp,ZodUUID:()=>zp,ZodUndefined:()=>um,ZodUnion:()=>ym,ZodUnknown:()=>pm,ZodVoid:()=>hm,ZodXID:()=>Kp,ZodXor:()=>bm,_ZodString:()=>Fp,_default:()=>pp,_function:()=>Ep,any:()=>Kf,array:()=>I,base64:()=>Df,base64url:()=>Of,bigint:()=>Bf,boolean:()=>P,catch:()=>_p,check:()=>Dp,cidrv4:()=>Tf,cidrv6:()=>Ef,clone:()=>_e,codec:()=>bp,coerce:()=>dh,config:()=>a,core:()=>Cd,cuid:()=>_f,cuid2:()=>vf,custom:()=>Op,date:()=>Yf,decode:()=>Xd,decodeAsync:()=>Qd,default:()=>Ch,describe:()=>Ym,discriminatedUnion:()=>ep,e164:()=>kf,email:()=>sf,emoji:()=>hf,encode:()=>Yd,encodeAsync:()=>Zd,endsWith:()=>Nl,enum:()=>B,exactOptional:()=>up,file:()=>cp,flattenError:()=>Ze,float32:()=>If,float64:()=>Lf,formatError:()=>Qe,fromJSONSchema:()=>ch,function:()=>Ep,getErrorMap:()=>eh,globalRegistry:()=>pc,gt:()=>hl,gte:()=>gl,guid:()=>cf,hash:()=>Pf,hex:()=>Nf,hostname:()=>Mf,httpUrl:()=>mf,includes:()=>jl,instanceof:()=>jp,int:()=>Ff,int32:()=>Rf,int64:()=>Vf,intersection:()=>tp,invertCodec:()=>xp,ipv4:()=>Sf,ipv6:()=>wf,iso:()=>jd,json:()=>Mp,jwt:()=>Af,keyof:()=>Xf,ksuid:()=>xf,lazy:()=>wp,length:()=>Dl,literal:()=>V,locales:()=>oc,looseObject:()=>Qf,looseRecord:()=>ip,lowercase:()=>kl,lt:()=>pl,lte:()=>ml,mac:()=>Cf,map:()=>ap,maxLength:()=>Tl,maxSize:()=>Sl,meta:()=>Xm,mime:()=>Fl,minLength:()=>El,minSize:()=>Cl,multipleOf:()=>xl,nan:()=>vp,nanoid:()=>gf,nativeEnum:()=>sp,negative:()=>vl,never:()=>qf,nonnegative:()=>bl,nonoptional:()=>hp,nonpositive:()=>yl,normalize:()=>Ll,null:()=>Gf,nullable:()=>dp,nullish:()=>fp,number:()=>N,object:()=>L,optional:()=>H,overwrite:()=>Il,parse:()=>Gd,parseAsync:()=>Kd,partialRecord:()=>rp,pipe:()=>yp,positive:()=>_l,prefault:()=>mp,preprocess:()=>Np,prettifyError:()=>tt,promise:()=>Tp,property:()=>Pl,readonly:()=>Sp,record:()=>z,refine:()=>kp,regex:()=>Ol,regexes:()=>jt,registry:()=>cc,safeDecode:()=>ef,safeDecodeAsync:()=>nf,safeEncode:()=>$d,safeEncodeAsync:()=>tf,safeParse:()=>qd,safeParseAsync:()=>Jd,set:()=>op,setErrorMap:()=>$m,size:()=>wl,slugify:()=>Vl,startsWith:()=>Ml,strictObject:()=>Zf,string:()=>M,stringFormat:()=>jf,stringbool:()=>Zm,success:()=>gp,superRefine:()=>Ap,symbol:()=>Uf,templateLiteral:()=>Cp,toJSONSchema:()=>Au,toLowerCase:()=>zl,toUpperCase:()=>Bl,transform:()=>lp,treeifyError:()=>$e,trim:()=>Rl,tuple:()=>np,uint32:()=>zf,uint64:()=>Hf,ulid:()=>yf,undefined:()=>Wf,union:()=>R,unknown:()=>F,uppercase:()=>Al,url:()=>pf,util:()=>p,uuid:()=>lf,uuidv4:()=>uf,uuidv6:()=>df,uuidv7:()=>ff,void:()=>Jf,xid:()=>bf,xor:()=>$f,z:()=>vh}),Ch,wh=t((()=>{xh(),xh(),Ch=bh}));wh();var Th=`io.modelcontextprotocol/related-task`,Eh=Op(e=>e!==null&&(typeof e==`object`||typeof e==`function`)),Dh=R([M(),N().int()]),Oh=M();Qf({ttl:N().optional(),pollInterval:N().optional()});var kh=L({ttl:N().optional()}),Ah=L({taskId:M()}),jh=Qf({progressToken:Dh.optional(),[Th]:Ah.optional()}),Mh=L({_meta:jh.optional()}),Nh=Mh.extend({task:kh.optional()}),Ph=e=>Nh.safeParse(e).success,Fh=L({method:M(),params:Mh.loose().optional()}),Ih=L({_meta:jh.optional()}),Lh=L({method:M(),params:Ih.loose().optional()}),Rh=Qf({_meta:jh.optional()}),zh=R([M(),N().int()]),Bh=L({jsonrpc:V(`2.0`),id:zh,...Fh.shape}).strict(),Vh=e=>Bh.safeParse(e).success,Hh=L({jsonrpc:V(`2.0`),...Lh.shape}).strict(),Uh=e=>Hh.safeParse(e).success,Wh=L({jsonrpc:V(`2.0`),id:zh,result:Rh}).strict(),Gh=e=>Wh.safeParse(e).success,K;(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`})(K||={});var Kh=L({jsonrpc:V(`2.0`),id:zh.optional(),error:L({code:N().int(),message:M(),data:F().optional()})}).strict(),qh=e=>Kh.safeParse(e).success,Jh=R([Bh,Hh,Wh,Kh]);R([Wh,Kh]);var Yh=Rh.strict(),Xh=Ih.extend({requestId:zh.optional(),reason:M().optional()}),Zh=Lh.extend({method:V(`notifications/cancelled`),params:Xh}),Qh=L({icons:I(L({src:M(),mimeType:M().optional(),sizes:I(M()).optional(),theme:B([`light`,`dark`]).optional()})).optional()}),$h=L({name:M(),title:M().optional()}),eg=$h.extend({...$h.shape,...Qh.shape,version:M(),websiteUrl:M().optional(),description:M().optional()}),tg=Np(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,tp(L({form:tp(L({applyDefaults:P().optional()}),z(M(),F())).optional(),url:Eh.optional()}),z(M(),F()).optional())),ng=Qf({list:Eh.optional(),cancel:Eh.optional(),requests:Qf({sampling:Qf({createMessage:Eh.optional()}).optional(),elicitation:Qf({create:Eh.optional()}).optional()}).optional()}),rg=Qf({list:Eh.optional(),cancel:Eh.optional(),requests:Qf({tools:Qf({call:Eh.optional()}).optional()}).optional()}),ig=L({experimental:z(M(),Eh).optional(),sampling:L({context:Eh.optional(),tools:Eh.optional()}).optional(),elicitation:tg.optional(),roots:L({listChanged:P().optional()}).optional(),tasks:ng.optional(),extensions:z(M(),Eh).optional()}),ag=Mh.extend({protocolVersion:M(),capabilities:ig,clientInfo:eg}),og=Fh.extend({method:V(`initialize`),params:ag}),sg=L({experimental:z(M(),Eh).optional(),logging:Eh.optional(),completions:Eh.optional(),prompts:L({listChanged:P().optional()}).optional(),resources:L({subscribe:P().optional(),listChanged:P().optional()}).optional(),tools:L({listChanged:P().optional()}).optional(),tasks:rg.optional(),extensions:z(M(),Eh).optional()}),cg=Rh.extend({protocolVersion:M(),capabilities:sg,serverInfo:eg,instructions:M().optional()}),lg=Lh.extend({method:V(`notifications/initialized`),params:Ih.optional()}),ug=Fh.extend({method:V(`ping`),params:Mh.optional()}),dg=L({progress:N(),total:H(N()),message:H(M())}),fg=L({...Ih.shape,...dg.shape,progressToken:Dh}),pg=Lh.extend({method:V(`notifications/progress`),params:fg}),mg=Mh.extend({cursor:Oh.optional()}),hg=Fh.extend({params:mg.optional()}),gg=Rh.extend({nextCursor:Oh.optional()}),_g=B([`working`,`input_required`,`completed`,`failed`,`cancelled`]),vg=L({taskId:M(),status:_g,ttl:R([N(),Gf()]),createdAt:M(),lastUpdatedAt:M(),pollInterval:H(N()),statusMessage:H(M())}),yg=Rh.extend({task:vg}),bg=Ih.merge(vg),xg=Lh.extend({method:V(`notifications/tasks/status`),params:bg}),Sg=Fh.extend({method:V(`tasks/get`),params:Mh.extend({taskId:M()})}),Cg=Rh.merge(vg),wg=Fh.extend({method:V(`tasks/result`),params:Mh.extend({taskId:M()})});Rh.loose();var Tg=hg.extend({method:V(`tasks/list`)}),Eg=gg.extend({tasks:I(vg)}),Dg=Fh.extend({method:V(`tasks/cancel`),params:Mh.extend({taskId:M()})}),Og=Rh.merge(vg),kg=L({uri:M(),mimeType:H(M()),_meta:z(M(),F()).optional()}),Ag=kg.extend({text:M()}),jg=M().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),Mg=kg.extend({blob:jg}),Ng=B([`user`,`assistant`]),Pg=L({audience:I(Ng).optional(),priority:N().min(0).max(1).optional(),lastModified:Md({offset:!0}).optional()}),Fg=L({...$h.shape,...Qh.shape,uri:M(),description:H(M()),mimeType:H(M()),size:H(N()),annotations:Pg.optional(),_meta:H(Qf({}))}),Ig=L({...$h.shape,...Qh.shape,uriTemplate:M(),description:H(M()),mimeType:H(M()),annotations:Pg.optional(),_meta:H(Qf({}))}),Lg=hg.extend({method:V(`resources/list`)}),Rg=gg.extend({resources:I(Fg)}),zg=hg.extend({method:V(`resources/templates/list`)}),Bg=gg.extend({resourceTemplates:I(Ig)}),Vg=Mh.extend({uri:M()}),Hg=Vg,Ug=Fh.extend({method:V(`resources/read`),params:Hg}),Wg=Rh.extend({contents:I(R([Ag,Mg]))}),Gg=Lh.extend({method:V(`notifications/resources/list_changed`),params:Ih.optional()}),Kg=Vg,qg=Fh.extend({method:V(`resources/subscribe`),params:Kg}),Jg=Vg,Yg=Fh.extend({method:V(`resources/unsubscribe`),params:Jg}),Xg=Ih.extend({uri:M()}),Zg=Lh.extend({method:V(`notifications/resources/updated`),params:Xg}),Qg=L({name:M(),description:H(M()),required:H(P())}),$g=L({...$h.shape,...Qh.shape,description:H(M()),arguments:H(I(Qg)),_meta:H(Qf({}))}),e_=hg.extend({method:V(`prompts/list`)}),t_=gg.extend({prompts:I($g)}),n_=Mh.extend({name:M(),arguments:z(M(),M()).optional()}),r_=Fh.extend({method:V(`prompts/get`),params:n_}),i_=L({type:V(`text`),text:M(),annotations:Pg.optional(),_meta:z(M(),F()).optional()}),a_=L({type:V(`image`),data:jg,mimeType:M(),annotations:Pg.optional(),_meta:z(M(),F()).optional()}),o_=L({type:V(`audio`),data:jg,mimeType:M(),annotations:Pg.optional(),_meta:z(M(),F()).optional()}),s_=L({type:V(`tool_use`),name:M(),id:M(),input:z(M(),F()),_meta:z(M(),F()).optional()}),c_=L({type:V(`resource`),resource:R([Ag,Mg]),annotations:Pg.optional(),_meta:z(M(),F()).optional()}),l_=Fg.extend({type:V(`resource_link`)}),u_=R([i_,a_,o_,l_,c_]),d_=L({role:Ng,content:u_}),f_=Rh.extend({description:M().optional(),messages:I(d_)}),p_=Lh.extend({method:V(`notifications/prompts/list_changed`),params:Ih.optional()}),m_=L({title:M().optional(),readOnlyHint:P().optional(),destructiveHint:P().optional(),idempotentHint:P().optional(),openWorldHint:P().optional()}),h_=L({taskSupport:B([`required`,`optional`,`forbidden`]).optional()}),g_=L({...$h.shape,...Qh.shape,description:M().optional(),inputSchema:L({type:V(`object`),properties:z(M(),Eh).optional(),required:I(M()).optional()}).catchall(F()),outputSchema:L({type:V(`object`),properties:z(M(),Eh).optional(),required:I(M()).optional()}).catchall(F()).optional(),annotations:m_.optional(),execution:h_.optional(),_meta:z(M(),F()).optional()}),__=hg.extend({method:V(`tools/list`)}),v_=gg.extend({tools:I(g_)}),y_=Rh.extend({content:I(u_).default([]),structuredContent:z(M(),F()).optional(),isError:P().optional()});y_.or(Rh.extend({toolResult:F()}));var b_=Nh.extend({name:M(),arguments:z(M(),F()).optional()}),x_=Fh.extend({method:V(`tools/call`),params:b_}),S_=Lh.extend({method:V(`notifications/tools/list_changed`),params:Ih.optional()});L({autoRefresh:P().default(!0),debounceMs:N().int().nonnegative().default(300)});var C_=B([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),w_=Mh.extend({level:C_}),T_=Fh.extend({method:V(`logging/setLevel`),params:w_}),E_=Ih.extend({level:C_,logger:M().optional(),data:F()}),D_=Lh.extend({method:V(`notifications/message`),params:E_}),O_=L({hints:I(L({name:M().optional()})).optional(),costPriority:N().min(0).max(1).optional(),speedPriority:N().min(0).max(1).optional(),intelligencePriority:N().min(0).max(1).optional()}),k_=L({mode:B([`auto`,`required`,`none`]).optional()}),A_=L({type:V(`tool_result`),toolUseId:M().describe(`The unique identifier for the corresponding tool call.`),content:I(u_).default([]),structuredContent:L({}).loose().optional(),isError:P().optional(),_meta:z(M(),F()).optional()}),j_=ep(`type`,[i_,a_,o_]),M_=ep(`type`,[i_,a_,o_,s_,A_]),N_=L({role:Ng,content:R([M_,I(M_)]),_meta:z(M(),F()).optional()}),P_=Nh.extend({messages:I(N_),modelPreferences:O_.optional(),systemPrompt:M().optional(),includeContext:B([`none`,`thisServer`,`allServers`]).optional(),temperature:N().optional(),maxTokens:N().int(),stopSequences:I(M()).optional(),metadata:Eh.optional(),tools:I(g_).optional(),toolChoice:k_.optional()}),F_=Fh.extend({method:V(`sampling/createMessage`),params:P_}),I_=Rh.extend({model:M(),stopReason:H(B([`endTurn`,`stopSequence`,`maxTokens`]).or(M())),role:Ng,content:j_}),L_=Rh.extend({model:M(),stopReason:H(B([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(M())),role:Ng,content:R([M_,I(M_)])}),R_=L({type:V(`boolean`),title:M().optional(),description:M().optional(),default:P().optional()}),z_=L({type:V(`string`),title:M().optional(),description:M().optional(),minLength:N().optional(),maxLength:N().optional(),format:B([`email`,`uri`,`date`,`date-time`]).optional(),default:M().optional()}),B_=L({type:B([`number`,`integer`]),title:M().optional(),description:M().optional(),minimum:N().optional(),maximum:N().optional(),default:N().optional()}),V_=L({type:V(`string`),title:M().optional(),description:M().optional(),enum:I(M()),default:M().optional()}),H_=L({type:V(`string`),title:M().optional(),description:M().optional(),oneOf:I(L({const:M(),title:M()})),default:M().optional()}),U_=R([R([L({type:V(`string`),title:M().optional(),description:M().optional(),enum:I(M()),enumNames:I(M()).optional(),default:M().optional()}),R([V_,H_]),R([L({type:V(`array`),title:M().optional(),description:M().optional(),minItems:N().optional(),maxItems:N().optional(),items:L({type:V(`string`),enum:I(M())}),default:I(M()).optional()}),L({type:V(`array`),title:M().optional(),description:M().optional(),minItems:N().optional(),maxItems:N().optional(),items:L({anyOf:I(L({const:M(),title:M()}))}),default:I(M()).optional()})])]),R_,z_,B_]),W_=R([Nh.extend({mode:V(`form`).optional(),message:M(),requestedSchema:L({type:V(`object`),properties:z(M(),U_),required:I(M()).optional()})}),Nh.extend({mode:V(`url`),message:M(),elicitationId:M(),url:M().url()})]),G_=Fh.extend({method:V(`elicitation/create`),params:W_}),K_=Ih.extend({elicitationId:M()}),q_=Lh.extend({method:V(`notifications/elicitation/complete`),params:K_}),J_=Rh.extend({action:B([`accept`,`decline`,`cancel`]),content:Np(e=>e===null?void 0:e,z(M(),R([M(),N(),P(),I(M())])).optional())}),Y_=L({type:V(`ref/resource`),uri:M()}),X_=L({type:V(`ref/prompt`),name:M()}),Z_=Mh.extend({ref:R([X_,Y_]),argument:L({name:M(),value:M()}),context:L({arguments:z(M(),M()).optional()}).optional()}),Q_=Fh.extend({method:V(`completion/complete`),params:Z_}),$_=Rh.extend({completion:Qf({values:I(M()).max(100),total:H(N().int()),hasMore:H(P())})}),ev=L({uri:M().startsWith(`file://`),name:M().optional(),_meta:z(M(),F()).optional()}),tv=Fh.extend({method:V(`roots/list`),params:Mh.optional()}),nv=Rh.extend({roots:I(ev)}),rv=Lh.extend({method:V(`notifications/roots/list_changed`),params:Ih.optional()});R([ug,og,Q_,T_,r_,e_,Lg,zg,Ug,qg,Yg,x_,__,Sg,wg,Tg,Dg]),R([Zh,pg,lg,rv,xg]),R([Yh,I_,L_,J_,nv,Cg,Eg,yg]),R([ug,F_,G_,tv,Sg,wg,Tg,Dg]),R([Zh,pg,D_,Zg,Gg,S_,p_,xg,q_]),R([Yh,cg,$_,f_,t_,Rg,Bg,Wg,y_,v_,Cg,Eg,yg]);var q=class e extends Error{constructor(e,t,n){super(`MCP error ${e}: ${t}`),this.code=e,this.data=n,this.name=`McpError`}static fromError(t,n,r){if(t===K.UrlElicitationRequired&&r){let e=r;if(e.elicitations)return new iv(e.elicitations,n)}return new e(t,n,r)}},iv=class extends q{constructor(e,t=`URL elicitation${e.length>1?`s`:``} required`){super(K.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};function av(e){return e===`completed`||e===`failed`||e===`cancelled`}function ov(e){let t=Dd(e)?.method;if(!t)throw Error(`Schema is missing a method literal`);let n=Od(t);if(typeof n!=`string`)throw Error(`Schema method literal must be a string`);return n}function sv(e,t){let n=Ed(e,t);if(!n.success)throw n.error;return n.data}var cv=class{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(Zh,e=>{this._oncancel(e)}),this.setNotificationHandler(pg,e=>{this._onprogress(e)}),this.setRequestHandler(ug,e=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(Sg,async(e,t)=>{let n=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!n)throw new q(K.InvalidParams,`Failed to retrieve task: Task not found`);return{...n}}),this.setRequestHandler(wg,async(e,t)=>{let n=async()=>{let r=e.params.taskId;if(this._taskMessageQueue){let e;for(;e=await this._taskMessageQueue.dequeue(r,t.sessionId);){if(e.type===`response`||e.type===`error`){let t=e.message,n=t.id,r=this._requestResolvers.get(n);if(r)if(this._requestResolvers.delete(n),e.type===`response`)r(t);else{let e=t;r(new q(e.error.code,e.error.message,e.error.data))}else{let t=e.type===`response`?`Response`:`Error`;this._onerror(Error(`${t} handler missing for request ${n}`))}continue}await this._transport?.send(e.message,{relatedRequestId:t.requestId})}}let i=await this._taskStore.getTask(r,t.sessionId);if(!i)throw new q(K.InvalidParams,`Task not found: ${r}`);if(!av(i.status))return await this._waitForTaskUpdate(r,t.signal),await n();if(av(i.status)){let e=await this._taskStore.getTaskResult(r,t.sessionId);return this._clearTaskQueue(r),{...e,_meta:{...e._meta,[Th]:{taskId:r}}}}return await n()};return await n()}),this.setRequestHandler(Tg,async(e,t)=>{try{let{tasks:n,nextCursor:r}=await this._taskStore.listTasks(e.params?.cursor,t.sessionId);return{tasks:n,nextCursor:r,_meta:{}}}catch(e){throw new q(K.InvalidParams,`Failed to list tasks: ${e instanceof Error?e.message:String(e)}`)}}),this.setRequestHandler(Dg,async(e,t)=>{try{let n=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!n)throw new q(K.InvalidParams,`Task not found: ${e.params.taskId}`);if(av(n.status))throw new q(K.InvalidParams,`Cannot cancel task in terminal status: ${n.status}`);await this._taskStore.updateTaskStatus(e.params.taskId,`cancelled`,`Client cancelled task execution.`,t.sessionId),this._clearTaskQueue(e.params.taskId);let r=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!r)throw new q(K.InvalidParams,`Task not found after cancellation: ${e.params.taskId}`);return{_meta:{},...r}}catch(e){throw e instanceof q?e:new q(K.InvalidRequest,`Failed to cancel task: ${e instanceof Error?e.message:String(e)}`)}}))}async _oncancel(e){e.params.requestId&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,n,r,i=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:n,resetTimeoutOnProgress:i,onTimeout:r})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let n=Date.now()-t.startTime;if(t.maxTotalTimeout&&n>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),q.fromError(K.RequestTimeout,`Maximum total timeout exceeded`,{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:n});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw 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;let t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=e=>{n?.(e),this._onerror(e)};let r=this._transport?.onmessage;this._transport.onmessage=(e,t)=>{r?.(e,t),Gh(e)||qh(e)?this._onresponse(e):Vh(e)?this._onrequest(e,t):Uh(e)?this._onnotification(e):this._onerror(Error(`Unknown message type: ${JSON.stringify(e)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let e of this._timeoutInfo.values())clearTimeout(e.timeoutId);this._timeoutInfo.clear();for(let e of this._requestHandlerAbortControllers.values())e.abort();this._requestHandlerAbortControllers.clear();let t=q.fromError(K.ConnectionClosed,`Connection closed`);this._transport=void 0,this.onclose?.();for(let n of e.values())n(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){let t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(e=>this._onerror(Error(`Uncaught error in notification handler: ${e}`)))}_onrequest(e,t){let n=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,r=this._transport,i=e.params?._meta?.[Th]?.taskId;if(n===void 0){let t={jsonrpc:`2.0`,id:e.id,error:{code:K.MethodNotFound,message:`Method not found`}};i&&this._taskMessageQueue?this._enqueueTaskMessage(i,{type:`error`,message:t,timestamp:Date.now()},r?.sessionId).catch(e=>this._onerror(Error(`Failed to enqueue error response: ${e}`))):r?.send(t).catch(e=>this._onerror(Error(`Failed to send an error response: ${e}`)));return}let a=new AbortController;this._requestHandlerAbortControllers.set(e.id,a);let o=Ph(e.params)?e.params.task:void 0,s=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,c={signal:a.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async t=>{if(a.signal.aborted)return;let n={relatedRequestId:e.id};i&&(n.relatedTask={taskId:i}),await this.notification(t,n)},sendRequest:async(t,n,r)=>{if(a.signal.aborted)throw new q(K.ConnectionClosed,`Request was cancelled`);let o={...r,relatedRequestId:e.id};i&&!o.relatedTask&&(o.relatedTask={taskId:i});let c=o.relatedTask?.taskId??i;return c&&s&&await s.updateTaskStatus(c,`input_required`),await this.request(t,n,o)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:i,taskStore:s,taskRequestedTtl:o?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{o&&this.assertTaskHandlerCapability(e.method)}).then(()=>n(e,c)).then(async t=>{if(a.signal.aborted)return;let n={result:t,jsonrpc:`2.0`,id:e.id};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:`response`,message:n,timestamp:Date.now()},r?.sessionId):await r?.send(n)},async t=>{if(a.signal.aborted)return;let n={jsonrpc:`2.0`,id:e.id,error:{code:Number.isSafeInteger(t.code)?t.code:K.InternalError,message:t.message??`Internal error`,...t.data!==void 0&&{data:t.data}}};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:`error`,message:n,timestamp:Date.now()},r?.sessionId):await r?.send(n)}).catch(e=>this._onerror(Error(`Failed to send response: ${e}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===a&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:t,...n}=e.params,r=Number(t),i=this._progressHandlers.get(r);if(!i){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let a=this._responseHandlers.get(r),o=this._timeoutInfo.get(r);if(o&&a&&o.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(e){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),a(e);return}i(n)}_onresponse(e){let t=Number(e.id),n=this._requestResolvers.get(t);if(n){this._requestResolvers.delete(t),Gh(e)?n(e):n(new q(e.error.code,e.error.message,e.error.data));return}let r=this._responseHandlers.get(t);if(r===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let i=!1;if(Gh(e)&&e.result&&typeof e.result==`object`){let n=e.result;if(n.task&&typeof n.task==`object`){let e=n.task;typeof e.taskId==`string`&&(i=!0,this._taskProgressTokens.set(e.taskId,t))}}i||this._progressHandlers.delete(t),Gh(e)?r(e):r(q.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,n){let{task:r}=n??{};if(!r){try{yield{type:`result`,result:await this.request(e,t,n)}}catch(e){yield{type:`error`,error:e instanceof q?e:new q(K.InternalError,String(e))}}return}let i;try{let r=await this.request(e,yg,n);if(r.task)i=r.task.taskId,yield{type:`taskCreated`,task:r.task};else throw new q(K.InternalError,`Task creation did not return a task`);for(;;){let e=await this.getTask({taskId:i},n);if(yield{type:`taskStatus`,task:e},av(e.status)){e.status===`completed`?yield{type:`result`,result:await this.getTaskResult({taskId:i},t,n)}:e.status===`failed`?yield{type:`error`,error:new q(K.InternalError,`Task ${i} failed`)}:e.status===`cancelled`&&(yield{type:`error`,error:new q(K.InternalError,`Task ${i} was cancelled`)});return}if(e.status===`input_required`){yield{type:`result`,result:await this.getTaskResult({taskId:i},t,n)};return}let r=e.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(e=>setTimeout(e,r)),n?.signal?.throwIfAborted()}}catch(e){yield{type:`error`,error:e instanceof q?e:new q(K.InternalError,String(e))}}}request(e,t,n){let{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a,task:o,relatedTask:s}=n??{};return new Promise((c,l)=>{let u=e=>{l(e)};if(!this._transport){u(Error(`Not connected`));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),o&&this.assertTaskCapability(e.method)}catch(e){u(e);return}n?.signal?.throwIfAborted();let d=this._requestMessageId++,f={...e,jsonrpc:`2.0`,id:d};n?.onprogress&&(this._progressHandlers.set(d,n.onprogress),f.params={...e.params,_meta:{...e.params?._meta||{},progressToken:d}}),o&&(f.params={...f.params,task:o}),s&&(f.params={...f.params,_meta:{...f.params?._meta||{},[Th]:s}});let p=e=>{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(e)}},{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a}).catch(e=>this._onerror(Error(`Failed to send cancellation: ${e}`))),l(e instanceof q?e:new q(K.RequestTimeout,String(e)))};this._responseHandlers.set(d,e=>{if(!n?.signal?.aborted){if(e instanceof Error)return l(e);try{let n=Ed(t,e.result);n.success?c(n.data):l(n.error)}catch(e){l(e)}}}),n?.signal?.addEventListener(`abort`,()=>{p(n?.signal?.reason)});let m=n?.timeout??6e4;this._setupTimeout(d,m,n?.maxTotalTimeout,()=>p(q.fromError(K.RequestTimeout,`Request timed out`,{timeout:m})),n?.resetTimeoutOnProgress??!1);let h=s?.taskId;h?(this._requestResolvers.set(d,e=>{let t=this._responseHandlers.get(d);t?t(e):this._onerror(Error(`Response handler missing for side-channeled request ${d}`))}),this._enqueueTaskMessage(h,{type:`request`,message:f,timestamp:Date.now()}).catch(e=>{this._cleanupTimeout(d),l(e)})):this._transport.send(f,{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a}).catch(e=>{this._cleanupTimeout(d),l(e)})})}async getTask(e,t){return this.request({method:`tasks/get`,params:e},Cg,t)}async getTaskResult(e,t,n){return this.request({method:`tasks/result`,params:e},t,n)}async listTasks(e,t){return this.request({method:`tasks/list`,params:e},Eg,t)}async cancelTask(e,t){return this.request({method:`tasks/cancel`,params:e},Og,t)}async notification(e,t){if(!this._transport)throw Error(`Not connected`);this.assertNotificationCapability(e.method);let n=t?.relatedTask?.taskId;if(n){let r={...e,jsonrpc:`2.0`,params:{...e.params,_meta:{...e.params?._meta||{},[Th]:t.relatedTask}}};await this._enqueueTaskMessage(n,{type:`notification`,message:r,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.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 n={...e,jsonrpc:`2.0`};t?.relatedTask&&(n={...n,params:{...n.params,_meta:{...n.params?._meta||{},[Th]:t.relatedTask}}}),this._transport?.send(n,t).catch(e=>this._onerror(e))});return}let r={...e,jsonrpc:`2.0`};t?.relatedTask&&(r={...r,params:{...r.params,_meta:{...r.params?._meta||{},[Th]:t.relatedTask}}}),await this._transport.send(r,t)}setRequestHandler(e,t){let n=ov(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(n,r)=>{let i=sv(e,n);return Promise.resolve(t(i,r))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){let n=ov(e);this._notificationHandlers.set(n,n=>{let r=sv(e,n);return Promise.resolve(t(r))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,n){if(!this._taskStore||!this._taskMessageQueue)throw Error(`Cannot enqueue task message: taskStore and taskMessageQueue are not configured`);let r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,n,r)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(e,t);for(let t of n)if(t.type===`request`&&Vh(t.message)){let n=t.message.id,r=this._requestResolvers.get(n);r?(r(new q(K.InternalError,`Task cancelled or completed`)),this._requestResolvers.delete(n)):this._onerror(Error(`Resolver missing for request ${n} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let n=this._options?.defaultTaskPollInterval??1e3;try{let t=await this._taskStore?.getTask(e);t?.pollInterval&&(n=t.pollInterval)}catch{}return new Promise((e,r)=>{if(t.aborted){r(new q(K.InvalidRequest,`Request cancelled`));return}let i=setTimeout(e,n);t.addEventListener(`abort`,()=>{clearTimeout(i),r(new q(K.InvalidRequest,`Request cancelled`))},{once:!0})})}requestTaskStore(e,t){let n=this._taskStore;if(!n)throw Error(`No task store configured`);return{createTask:async r=>{if(!e)throw Error(`No request provided`);return await n.createTask(r,e.id,{method:e.method,params:e.params},t)},getTask:async e=>{let r=await n.getTask(e,t);if(!r)throw new q(K.InvalidParams,`Failed to retrieve task: Task not found`);return r},storeTaskResult:async(e,r,i)=>{await n.storeTaskResult(e,r,i,t);let a=await n.getTask(e,t);if(a){let t=xg.parse({method:`notifications/tasks/status`,params:a});await this.notification(t),av(a.status)&&this._cleanupTaskProgressHandler(e)}},getTaskResult:e=>n.getTaskResult(e,t),updateTaskStatus:async(e,r,i)=>{let a=await n.getTask(e,t);if(!a)throw new q(K.InvalidParams,`Task "${e}" not found - it may have been cleaned up`);if(av(a.status))throw new q(K.InvalidParams,`Cannot update task "${e}" from terminal status "${a.status}" to "${r}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(e,r,i,t);let o=await n.getTask(e,t);if(o){let t=xg.parse({method:`notifications/tasks/status`,params:o});await this.notification(t),av(o.status)&&this._cleanupTaskProgressHandler(e)}},listTasks:e=>n.listTasks(e,t)}}};function lv(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function uv(e,t){let n={...e};for(let e in t){let r=e,i=t[r];if(i===void 0)continue;let a=n[r];lv(a)&&lv(i)?n[r]={...a,...i}:n[r]=i}return n}var dv=`modulepreload`,fv=function(e){return`/`+e},pv={},mv=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=fv(t,n),t in pv)return;pv[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:dv,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};wh(),(e=>typeof r<`u`?r:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof r<`u`?r:e)[t]}):e)(function(e){if(typeof r<`u`)return r.apply(this,arguments);throw Error(`Dynamic require of "`+e+`" is not supported`)});var hv=class extends cv{_registeredMethods=new Set;_eventSlots=new Map;onEventDispatch(e,t){}_ensureEventSlot(e){let t=this._eventSlots.get(e);if(!t){let n=this.eventSchemas[e];if(!n)throw Error(`Unknown event: ${String(e)}`);t={listeners:[]},this._eventSlots.set(e,t);let r=n.shape.method.value;this._registeredMethods.add(r);let i=t;super.setNotificationHandler(n,t=>{let n=t.params;this.onEventDispatch(e,n),i.onHandler?.(n);for(let e of[...i.listeners])e(n)})}return t}setEventHandler(e,t){let n=this._ensureEventSlot(e);n.onHandler&&t&&console.warn(`[MCP Apps] on${String(e)} handler replaced. Use addEventListener("${String(e)}", …) to add multiple listeners without replacing.`),n.onHandler=t}getEventHandler(e){return this._eventSlots.get(e)?.onHandler}addEventListener(e,t){this._ensureEventSlot(e).listeners.push(t)}removeEventListener(e,t){let n=this._eventSlots.get(e);if(!n)return;let r=n.listeners.indexOf(t);r!==-1&&n.listeners.splice(r,1)}setRequestHandler=(e,t)=>{this._assertMethodNotRegistered(e,`setRequestHandler`),super.setRequestHandler(e,t)};setNotificationHandler=(e,t)=>{this._assertMethodNotRegistered(e,`setNotificationHandler`),super.setNotificationHandler(e,t)};warnIfRequestHandlerReplaced(e,t,n){t&&n&&console.warn(`[MCP Apps] ${e} handler replaced. Previous handler will no longer be called.`)}replaceRequestHandler=(e,t)=>{let n=e.shape.method.value;this._registeredMethods.add(n),super.setRequestHandler(e,t)};_assertMethodNotRegistered(e,t){let n=e.shape.method.value;if(this._registeredMethods.has(n))throw Error(`Handler for "${n}" already registered (via ${t}). Use addEventListener() to attach multiple listeners, or the on* setter for replace semantics.`);this._registeredMethods.add(n)}},gv=`2026-01-26`,_v=class{eventTarget;eventSource;messageListener;constructor(e=window.parent,t){this.eventTarget=e,this.eventSource=t,this.messageListener=e=>{if(t&&e.source!==this.eventSource){console.debug(`Ignoring message from unknown source`,e);return}let n=Jh.safeParse(e.data);n.success?(console.debug(`Parsed message`,n.data),this.onmessage?.(n.data)):e.data?.jsonrpc===`2.0`?(console.error(`Failed to parse message`,n.error.message,e),this.onerror?.(Error(`Invalid JSON-RPC message received: `+n.error.message))):console.debug(`Ignoring non-JSON-RPC message`,n.error.message,e)}}async start(){window.addEventListener(`message`,this.messageListener)}async send(e,t){e.method!==`ui/notifications/tool-input-partial`&&console.debug(`Sending message`,e),this.eventTarget.postMessage(e,`*`)}async close(){window.removeEventListener(`message`,this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion},vv=R([V(`light`),V(`dark`)]).describe(`Color theme preference for the host environment.`),yv=R([V(`inline`),V(`fullscreen`),V(`pip`)]).describe(`Display mode for UI presentation.`),bv=z(R([V(`--color-background-primary`),V(`--color-background-secondary`),V(`--color-background-tertiary`),V(`--color-background-inverse`),V(`--color-background-ghost`),V(`--color-background-info`),V(`--color-background-danger`),V(`--color-background-success`),V(`--color-background-warning`),V(`--color-background-disabled`),V(`--color-text-primary`),V(`--color-text-secondary`),V(`--color-text-tertiary`),V(`--color-text-inverse`),V(`--color-text-ghost`),V(`--color-text-info`),V(`--color-text-danger`),V(`--color-text-success`),V(`--color-text-warning`),V(`--color-text-disabled`),V(`--color-border-primary`),V(`--color-border-secondary`),V(`--color-border-tertiary`),V(`--color-border-inverse`),V(`--color-border-ghost`),V(`--color-border-info`),V(`--color-border-danger`),V(`--color-border-success`),V(`--color-border-warning`),V(`--color-border-disabled`),V(`--color-ring-primary`),V(`--color-ring-secondary`),V(`--color-ring-inverse`),V(`--color-ring-info`),V(`--color-ring-danger`),V(`--color-ring-success`),V(`--color-ring-warning`),V(`--font-sans`),V(`--font-mono`),V(`--font-weight-normal`),V(`--font-weight-medium`),V(`--font-weight-semibold`),V(`--font-weight-bold`),V(`--font-text-xs-size`),V(`--font-text-sm-size`),V(`--font-text-md-size`),V(`--font-text-lg-size`),V(`--font-heading-xs-size`),V(`--font-heading-sm-size`),V(`--font-heading-md-size`),V(`--font-heading-lg-size`),V(`--font-heading-xl-size`),V(`--font-heading-2xl-size`),V(`--font-heading-3xl-size`),V(`--font-text-xs-line-height`),V(`--font-text-sm-line-height`),V(`--font-text-md-line-height`),V(`--font-text-lg-line-height`),V(`--font-heading-xs-line-height`),V(`--font-heading-sm-line-height`),V(`--font-heading-md-line-height`),V(`--font-heading-lg-line-height`),V(`--font-heading-xl-line-height`),V(`--font-heading-2xl-line-height`),V(`--font-heading-3xl-line-height`),V(`--border-radius-xs`),V(`--border-radius-sm`),V(`--border-radius-md`),V(`--border-radius-lg`),V(`--border-radius-xl`),V(`--border-radius-full`),V(`--border-width-regular`),V(`--shadow-hairline`),V(`--shadow-sm`),V(`--shadow-md`),V(`--shadow-lg`)]).describe(`CSS variable keys available to MCP apps for theming.`).describe(`Style variables for theming MCP apps.
1260
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function Tu(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:Ou(t,`input`,e.processors),output:Ou(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Eu(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return Eu(r.element,n);if(r.type===`set`)return Eu(r.valueType,n);if(r.type===`lazy`)return Eu(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return Eu(r.innerType,n);if(r.type===`intersection`)return Eu(r.left,n)||Eu(r.right,n);if(r.type===`record`||r.type===`map`)return Eu(r.keyType,n)||Eu(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:Eu(r.in,n)||Eu(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Eu(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Eu(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Eu(e,n))return!0;return!!(r.rest&&Eu(r.rest,n))}return!1}var Du,Ou,ku=t((()=>{mc(),Du=(e,t={})=>n=>{let r=Cu({...n,processors:t});return j(e,r),wu(r,e),Tu(r,e)},Ou=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Cu({...i??{},target:a,io:t,processors:n});return j(e,o),wu(o,e),Tu(o,e)}}));function Au(e,t){if(`_idmap`in e){let n=e,r=Cu({...t,processors:_d}),i={};for(let e of n._idmap.entries()){let[t,n]=e;j(n,r)}let a={};r.external={registry:n,uri:t?.uri,defs:i};for(let e of n._idmap.entries()){let[t,n]=e;wu(r,n),a[t]=Tu(r,n)}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=Cu({...t,processors:_d});return j(e,n),wu(n,e),Tu(n,e)}var ju,Mu,Nu,Pu,Fu,Iu,Lu,Ru,zu,Bu,Vu,Hu,Uu,Wu,Gu,Ku,qu,Ju,Yu,Xu,Zu,Qu,$u,ed,td,nd,rd,id,ad,od,sd,cd,ld,ud,dd,fd,pd,md,hd,gd,_d,vd=t((()=>{ku(),D(),ju={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Mu=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=ju[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Nu=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},Pu=(e,t,n,r)=>{n.type=`boolean`},Fu=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`BigInt cannot be represented in JSON Schema`)},Iu=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Symbols cannot be represented in JSON Schema`)},Lu=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},Ru=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Undefined cannot be represented in JSON Schema`)},zu=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`)},Bu=(e,t,n,r)=>{n.not={}},Vu=(e,t,n,r)=>{},Hu=(e,t,n,r)=>{},Uu=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Date cannot be represented in JSON Schema`)},Wu=(e,t,n,r)=>{let i=e._zod.def,a=g(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Gu=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},Ku=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`NaN cannot be represented in JSON Schema`)},qu=(e,t,n,r)=>{let i=n,a=e._zod.pattern;if(!a)throw Error(`Pattern not found in template literal`);i.type=`string`,i.pattern=a.source},Ju=(e,t,n,r)=>{let i=n,a={type:`string`,format:`binary`,contentEncoding:`binary`},{minimum:o,maximum:s,mime:c}=e._zod.bag;o!==void 0&&(a.minLength=o),s!==void 0&&(a.maxLength=s),c?c.length===1?(a.contentMediaType=c[0],Object.assign(i,a)):(Object.assign(i,a),i.anyOf=c.map(e=>({contentMediaType:e}))):Object.assign(i,a)},Yu=(e,t,n,r)=>{n.type=`boolean`},Xu=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},Zu=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Function types cannot be represented in JSON Schema`)},Qu=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},$u=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Map cannot be represented in JSON Schema`)},ed=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Set cannot be represented in JSON Schema`)},td=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=j(a.element,t,{...r,path:[...r.path,`items`]})},nd=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=j(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=j(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},rd=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>j(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},id=(e,t,n,r)=>{let i=e._zod.def,a=j(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=j(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},ad=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>j(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?j(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null;t.target===`draft-2020-12`?(i.prefixItems=c,l&&(i.items=l)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),i.minItems=c.length,l||(i.maxItems=c.length)):(i.items=c,l&&(i.additionalItems=l));let{minimum:u,maximum:d}=e._zod.bag;typeof u==`number`&&(i.minItems=u),typeof d==`number`&&(i.maxItems=d)},od=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=j(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else (t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=j(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=j(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},sd=(e,t,n,r)=>{let i=e._zod.def,a=j(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},cd=(e,t,n,r)=>{let i=e._zod.def;j(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},ld=(e,t,n,r)=>{let i=e._zod.def;j(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},ud=(e,t,n,r)=>{let i=e._zod.def;j(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},dd=(e,t,n,r)=>{let i=e._zod.def;j(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},fd=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;j(o,t,r);let s=t.seen.get(e);s.ref=o},pd=(e,t,n,r)=>{let i=e._zod.def;j(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},md=(e,t,n,r)=>{let i=e._zod.def;j(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},hd=(e,t,n,r)=>{let i=e._zod.def;j(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},gd=(e,t,n,r)=>{let i=e._zod.innerType;j(i,t,r);let a=t.seen.get(e);a.ref=i},_d={string:Mu,number:Nu,boolean:Pu,bigint:Fu,symbol:Iu,null:Lu,undefined:Ru,void:zu,never:Bu,any:Vu,unknown:Hu,date:Uu,enum:Wu,literal:Gu,nan:Ku,template_literal:qu,file:Ju,success:Yu,custom:Xu,function:Zu,transform:Qu,map:$u,set:ed,array:td,object:nd,union:rd,intersection:id,tuple:ad,record:od,nullable:sd,nonoptional:cd,default:ld,prefault:ud,catch:dd,pipe:fd,readonly:pd,promise:md,optional:hd,lazy:gd}})),yd,bd=t((()=>{vd(),ku(),yd=class{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 t=e?.target??`draft-2020-12`;t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),this.ctx=Cu({processors:_d,target:t,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,t={path:[],schemaPath:[]}){return j(e,this.ctx,t)}emit(e,t){t&&(t.cycles&&(this.ctx.cycles=t.cycles),t.reused&&(this.ctx.reused=t.reused),t.external&&(this.ctx.external=t.external)),wu(this.ctx,e);let{"~standard":n,...r}=Tu(this.ctx,e);return r}}})),xd=n({}),Sd=t((()=>{})),Cd=n({$ZodAny:()=>Si,$ZodArray:()=>Di,$ZodAsyncError:()=>l,$ZodBase64:()=>li,$ZodBase64URL:()=>ui,$ZodBigInt:()=>_i,$ZodBigIntFormat:()=>vi,$ZodBoolean:()=>gi,$ZodCIDRv4:()=>si,$ZodCIDRv6:()=>ci,$ZodCUID:()=>Yr,$ZodCUID2:()=>Xr,$ZodCatch:()=>Yi,$ZodCheck:()=>O,$ZodCheckBigIntFormat:()=>Xn,$ZodCheckEndsWith:()=>lr,$ZodCheckGreaterThan:()=>qn,$ZodCheckIncludes:()=>sr,$ZodCheckLengthEquals:()=>nr,$ZodCheckLessThan:()=>Kn,$ZodCheckLowerCase:()=>ar,$ZodCheckMaxLength:()=>er,$ZodCheckMaxSize:()=>Zn,$ZodCheckMimeType:()=>dr,$ZodCheckMinLength:()=>tr,$ZodCheckMinSize:()=>Qn,$ZodCheckMultipleOf:()=>Jn,$ZodCheckNumberFormat:()=>Yn,$ZodCheckOverwrite:()=>fr,$ZodCheckProperty:()=>ur,$ZodCheckRegex:()=>ir,$ZodCheckSizeEquals:()=>$n,$ZodCheckStartsWith:()=>cr,$ZodCheckStringFormat:()=>rr,$ZodCheckUpperCase:()=>or,$ZodCodec:()=>Qi,$ZodCustom:()=>aa,$ZodCustomStringFormat:()=>pi,$ZodDate:()=>Ei,$ZodDefault:()=>Gi,$ZodDiscriminatedUnion:()=>Mi,$ZodE164:()=>di,$ZodEmail:()=>Gr,$ZodEmoji:()=>qr,$ZodEncodeError:()=>u,$ZodEnum:()=>Ri,$ZodError:()=>rt,$ZodExactOptional:()=>Ui,$ZodFile:()=>Bi,$ZodFunction:()=>na,$ZodGUID:()=>Ur,$ZodIPv4:()=>ii,$ZodIPv6:()=>ai,$ZodISODate:()=>ti,$ZodISODateTime:()=>ei,$ZodISODuration:()=>ri,$ZodISOTime:()=>ni,$ZodIntersection:()=>Ni,$ZodJWT:()=>fi,$ZodKSUID:()=>$r,$ZodLazy:()=>ia,$ZodLiteral:()=>zi,$ZodMAC:()=>oi,$ZodMap:()=>Ii,$ZodNaN:()=>Xi,$ZodNanoID:()=>Jr,$ZodNever:()=>wi,$ZodNonOptional:()=>qi,$ZodNull:()=>xi,$ZodNullable:()=>Wi,$ZodNumber:()=>mi,$ZodNumberFormat:()=>hi,$ZodObject:()=>Oi,$ZodObjectJIT:()=>ki,$ZodOptional:()=>Hi,$ZodPipe:()=>Zi,$ZodPrefault:()=>Ki,$ZodPreprocess:()=>$i,$ZodPromise:()=>ra,$ZodReadonly:()=>ea,$ZodRealError:()=>it,$ZodRecord:()=>Fi,$ZodRegistry:()=>fc,$ZodSet:()=>Li,$ZodString:()=>Hr,$ZodStringFormat:()=>A,$ZodSuccess:()=>Ji,$ZodSymbol:()=>yi,$ZodTemplateLiteral:()=>ta,$ZodTransform:()=>Vi,$ZodTuple:()=>Pi,$ZodType:()=>k,$ZodULID:()=>Zr,$ZodURL:()=>Kr,$ZodUUID:()=>Wr,$ZodUndefined:()=>bi,$ZodUnion:()=>Ai,$ZodUnknown:()=>Ci,$ZodVoid:()=>Ti,$ZodXID:()=>Qr,$ZodXor:()=>ji,$brand:()=>c,$constructor:()=>i,$input:()=>dc,$output:()=>uc,Doc:()=>mr,JSONSchema:()=>xd,JSONSchemaGenerator:()=>yd,NEVER:()=>s,TimePrecision:()=>xu,_any:()=>ol,_array:()=>Hl,_base64:()=>Ic,_base64url:()=>Lc,_bigint:()=>$c,_boolean:()=>Zc,_catch:()=>su,_check:()=>gu,_cidrv4:()=>Pc,_cidrv6:()=>Fc,_coercedBigint:()=>el,_coercedBoolean:()=>Qc,_coercedDate:()=>dl,_coercedNumber:()=>Gc,_coercedString:()=>gc,_cuid:()=>Ec,_cuid2:()=>Dc,_custom:()=>pu,_date:()=>ul,_decode:()=>gt,_decodeAsync:()=>bt,_default:()=>iu,_discriminatedUnion:()=>Gl,_e164:()=>Rc,_email:()=>_c,_emoji:()=>wc,_encode:()=>mt,_encodeAsync:()=>vt,_endsWith:()=>Nl,_enum:()=>Zl,_file:()=>eu,_float32:()=>qc,_float64:()=>Jc,_gt:()=>hl,_gte:()=>gl,_guid:()=>vc,_includes:()=>jl,_int:()=>Kc,_int32:()=>Yc,_int64:()=>tl,_intersection:()=>Kl,_ipv4:()=>jc,_ipv6:()=>Mc,_isoDate:()=>Vc,_isoDateTime:()=>Bc,_isoDuration:()=>Uc,_isoTime:()=>Hc,_jwt:()=>zc,_ksuid:()=>Ac,_lazy:()=>du,_length:()=>Dl,_literal:()=>$l,_lowercase:()=>kl,_lt:()=>pl,_lte:()=>ml,_mac:()=>Nc,_map:()=>Yl,_max:()=>ml,_maxLength:()=>Tl,_maxSize:()=>Sl,_mime:()=>Fl,_min:()=>gl,_minLength:()=>El,_minSize:()=>Cl,_multipleOf:()=>xl,_nan:()=>fl,_nanoid:()=>Tc,_nativeEnum:()=>Ql,_negative:()=>vl,_never:()=>cl,_nonnegative:()=>bl,_nonoptional:()=>au,_nonpositive:()=>yl,_normalize:()=>Ll,_null:()=>al,_nullable:()=>ru,_number:()=>Wc,_optional:()=>nu,_overwrite:()=>Il,_parse:()=>ot,_parseAsync:()=>ct,_pipe:()=>cu,_positive:()=>_l,_promise:()=>fu,_property:()=>Pl,_readonly:()=>lu,_record:()=>Jl,_refine:()=>mu,_regex:()=>Ol,_safeDecode:()=>wt,_safeDecodeAsync:()=>Ot,_safeEncode:()=>St,_safeEncodeAsync:()=>Et,_safeParse:()=>ut,_safeParseAsync:()=>ft,_set:()=>Xl,_size:()=>wl,_slugify:()=>Vl,_startsWith:()=>Ml,_string:()=>hc,_stringFormat:()=>bu,_stringbool:()=>yu,_success:()=>ou,_superRefine:()=>hu,_symbol:()=>rl,_templateLiteral:()=>uu,_toLowerCase:()=>zl,_toUpperCase:()=>Bl,_transform:()=>tu,_trim:()=>Rl,_tuple:()=>ql,_uint32:()=>Xc,_uint64:()=>nl,_ulid:()=>Oc,_undefined:()=>il,_union:()=>Ul,_unknown:()=>sl,_uppercase:()=>Al,_url:()=>Cc,_uuid:()=>yc,_uuidv4:()=>bc,_uuidv6:()=>xc,_uuidv7:()=>Sc,_void:()=>ll,_xid:()=>kc,_xor:()=>Wl,clone:()=>_e,config:()=>a,createStandardJSONSchemaMethod:()=>Ou,createToJSONSchemaMethod:()=>Du,decode:()=>_t,decodeAsync:()=>xt,describe:()=>_u,encode:()=>ht,encodeAsync:()=>yt,extractDefs:()=>wu,finalize:()=>Tu,flattenError:()=>Ze,formatError:()=>Qe,globalConfig:()=>d,globalRegistry:()=>pc,initializeContext:()=>Cu,isValidBase64:()=>vr,isValidBase64URL:()=>yr,isValidJWT:()=>br,locales:()=>oc,meta:()=>vu,parse:()=>st,parseAsync:()=>lt,prettifyError:()=>tt,process:()=>j,regexes:()=>jt,registry:()=>cc,safeDecode:()=>Tt,safeDecodeAsync:()=>kt,safeEncode:()=>Ct,safeEncodeAsync:()=>Dt,safeParse:()=>dt,safeParseAsync:()=>pt,toDotPath:()=>et,toJSONSchema:()=>Au,treeifyError:()=>$e,util:()=>p,version:()=>gr}),wd=t((()=>{f(),At(),at(),oa(),pr(),_r(),D(),Un(),sc(),mc(),hr(),Su(),ku(),vd(),bd(),Sd()}));Su(),D(),Un(),f(),At(),vd(),at(),sc(),wd(),mc();function Td(e){return!!e._zod}function Ed(e,t){return Td(e)?dt(e,t):e.safeParse(t)}function Dd(e){if(!e)return;let t;if(t=Td(e)?e._zod?.def?.shape:e.shape,t){if(typeof t==`function`)try{return t()}catch{return}return t}}function Od(e){if(Td(e)){let t=e._zod?.def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}}let t=e._def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}let n=e.value;if(n!==void 0)return n}var kd=n({endsWith:()=>Nl,gt:()=>hl,gte:()=>gl,includes:()=>jl,length:()=>Dl,lowercase:()=>kl,lt:()=>pl,lte:()=>ml,maxLength:()=>Tl,maxSize:()=>Sl,mime:()=>Fl,minLength:()=>El,minSize:()=>Cl,multipleOf:()=>xl,negative:()=>vl,nonnegative:()=>bl,nonpositive:()=>yl,normalize:()=>Ll,overwrite:()=>Il,positive:()=>_l,property:()=>Pl,regex:()=>Ol,size:()=>wl,slugify:()=>Vl,startsWith:()=>Ml,toLowerCase:()=>zl,toUpperCase:()=>Bl,trim:()=>Rl,uppercase:()=>Al}),Ad=t((()=>{wd()})),jd=n({ZodISODate:()=>Ld,ZodISODateTime:()=>Id,ZodISODuration:()=>zd,ZodISOTime:()=>Rd,date:()=>Nd,datetime:()=>Md,duration:()=>Fd,time:()=>Pd});function Md(e){return Bc(Id,e)}function Nd(e){return Vc(Ld,e)}function Pd(e){return Hc(Rd,e)}function Fd(e){return Uc(zd,e)}var Id,Ld,Rd,zd,Bd=t((()=>{wd(),Qm(),Id=i(`ZodISODateTime`,(e,t)=>{ei.init(e,t),W.init(e,t)}),Ld=i(`ZodISODate`,(e,t)=>{ti.init(e,t),W.init(e,t)}),Rd=i(`ZodISOTime`,(e,t)=>{ni.init(e,t),W.init(e,t)}),zd=i(`ZodISODuration`,(e,t)=>{ri.init(e,t),W.init(e,t)})})),Vd,Hd,Ud,Wd=t((()=>{wd(),D(),Vd=(e,t)=>{rt.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Qe(e,t)},flatten:{value:t=>Ze(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,re,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,re,2)}},isEmpty:{get(){return e.issues.length===0}}})},Hd=i(`ZodError`,Vd),Ud=i(`ZodError`,Vd,{Parent:Error})})),Gd,Kd,qd,Jd,Yd,Xd,Zd,Qd,$d,ef,tf,nf,rf=t((()=>{wd(),Wd(),Gd=ot(Ud),Kd=ct(Ud),qd=ut(Ud),Jd=ft(Ud),Yd=mt(Ud),Xd=gt(Ud),Zd=vt(Ud),Qd=bt(Ud),$d=St(Ud),ef=wt(Ud),tf=Et(Ud),nf=Ot(Ud)})),af=n({ZodAny:()=>fm,ZodArray:()=>_m,ZodBase64:()=>$p,ZodBase64URL:()=>em,ZodBigInt:()=>sm,ZodBigIntFormat:()=>cm,ZodBoolean:()=>om,ZodCIDRv4:()=>Zp,ZodCIDRv6:()=>Qp,ZodCUID:()=>Up,ZodCUID2:()=>Wp,ZodCatch:()=>Rm,ZodCodec:()=>Vm,ZodCustom:()=>Jm,ZodCustomStringFormat:()=>rm,ZodDate:()=>gm,ZodDefault:()=>Pm,ZodDiscriminatedUnion:()=>xm,ZodE164:()=>tm,ZodEmail:()=>Lp,ZodEmoji:()=>Vp,ZodEnum:()=>Dm,ZodExactOptional:()=>Mm,ZodFile:()=>km,ZodFunction:()=>qm,ZodGUID:()=>Rp,ZodIPv4:()=>Jp,ZodIPv6:()=>Xp,ZodIntersection:()=>Sm,ZodJWT:()=>nm,ZodKSUID:()=>qp,ZodLazy:()=>Gm,ZodLiteral:()=>Om,ZodMAC:()=>Yp,ZodMap:()=>Tm,ZodNaN:()=>zm,ZodNanoID:()=>Hp,ZodNever:()=>mm,ZodNonOptional:()=>Im,ZodNull:()=>dm,ZodNullable:()=>Nm,ZodNumber:()=>im,ZodNumberFormat:()=>am,ZodObject:()=>vm,ZodOptional:()=>jm,ZodPipe:()=>Bm,ZodPrefault:()=>Fm,ZodPreprocess:()=>Hm,ZodPromise:()=>Km,ZodReadonly:()=>Um,ZodRecord:()=>wm,ZodSet:()=>Em,ZodString:()=>Ip,ZodStringFormat:()=>W,ZodSuccess:()=>Lm,ZodSymbol:()=>lm,ZodTemplateLiteral:()=>Wm,ZodTransform:()=>Am,ZodTuple:()=>Cm,ZodType:()=>U,ZodULID:()=>Gp,ZodURL:()=>Bp,ZodUUID:()=>zp,ZodUndefined:()=>um,ZodUnion:()=>ym,ZodUnknown:()=>pm,ZodVoid:()=>hm,ZodXID:()=>Kp,ZodXor:()=>bm,_ZodString:()=>Fp,_default:()=>pp,_function:()=>Ep,any:()=>Kf,array:()=>I,base64:()=>Df,base64url:()=>Of,bigint:()=>Bf,boolean:()=>P,catch:()=>_p,check:()=>Dp,cidrv4:()=>Tf,cidrv6:()=>Ef,codec:()=>bp,cuid:()=>_f,cuid2:()=>vf,custom:()=>Op,date:()=>Yf,describe:()=>Ym,discriminatedUnion:()=>ep,e164:()=>kf,email:()=>sf,emoji:()=>hf,enum:()=>B,exactOptional:()=>up,file:()=>cp,float32:()=>If,float64:()=>Lf,function:()=>Ep,guid:()=>cf,hash:()=>Pf,hex:()=>Nf,hostname:()=>Mf,httpUrl:()=>mf,instanceof:()=>jp,int:()=>Ff,int32:()=>Rf,int64:()=>Vf,intersection:()=>tp,invertCodec:()=>xp,ipv4:()=>Sf,ipv6:()=>wf,json:()=>Mp,jwt:()=>Af,keyof:()=>Xf,ksuid:()=>xf,lazy:()=>wp,literal:()=>V,looseObject:()=>Qf,looseRecord:()=>ip,mac:()=>Cf,map:()=>ap,meta:()=>Xm,nan:()=>vp,nanoid:()=>gf,nativeEnum:()=>sp,never:()=>qf,nonoptional:()=>hp,null:()=>Gf,nullable:()=>dp,nullish:()=>fp,number:()=>N,object:()=>L,optional:()=>H,partialRecord:()=>rp,pipe:()=>yp,prefault:()=>mp,preprocess:()=>Np,promise:()=>Tp,readonly:()=>Sp,record:()=>z,refine:()=>kp,set:()=>op,strictObject:()=>Zf,string:()=>M,stringFormat:()=>jf,stringbool:()=>Zm,success:()=>gp,superRefine:()=>Ap,symbol:()=>Uf,templateLiteral:()=>Cp,transform:()=>lp,tuple:()=>np,uint32:()=>zf,uint64:()=>Hf,ulid:()=>yf,undefined:()=>Wf,union:()=>R,unknown:()=>F,url:()=>pf,uuid:()=>lf,uuidv4:()=>uf,uuidv6:()=>df,uuidv7:()=>ff,void:()=>Jf,xid:()=>bf,xor:()=>$f});function of(e,t,n){let r=Object.getPrototypeOf(e),i=Pp.get(r);if(i||(i=new Set,Pp.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}function M(e){return hc(Ip,e)}function sf(e){return _c(Lp,e)}function cf(e){return vc(Rp,e)}function lf(e){return yc(zp,e)}function uf(e){return bc(zp,e)}function df(e){return xc(zp,e)}function ff(e){return Sc(zp,e)}function pf(e){return Cc(Bp,e)}function mf(e){return Cc(Bp,{protocol:mn,hostname:pn,...w(e)})}function hf(e){return wc(Vp,e)}function gf(e){return Tc(Hp,e)}function _f(e){return Ec(Up,e)}function vf(e){return Dc(Wp,e)}function yf(e){return Oc(Gp,e)}function bf(e){return kc(Kp,e)}function xf(e){return Ac(qp,e)}function Sf(e){return jc(Jp,e)}function Cf(e){return Nc(Yp,e)}function wf(e){return Mc(Xp,e)}function Tf(e){return Pc(Zp,e)}function Ef(e){return Fc(Qp,e)}function Df(e){return Ic($p,e)}function Of(e){return Lc(em,e)}function kf(e){return Rc(tm,e)}function Af(e){return zc(nm,e)}function jf(e,t,n={}){return bu(rm,e,t,n)}function Mf(e){return bu(rm,`hostname`,fn,e)}function Nf(e){return bu(rm,`hex`,Dn,e)}function Pf(e,t){let n=`${e}_${t?.enc??`hex`}`,r=jt[n];if(!r)throw Error(`Unrecognized hash format: ${n}`);return bu(rm,n,r,t)}function N(e){return Wc(im,e)}function Ff(e){return Kc(am,e)}function If(e){return qc(am,e)}function Lf(e){return Jc(am,e)}function Rf(e){return Yc(am,e)}function zf(e){return Xc(am,e)}function P(e){return Zc(om,e)}function Bf(e){return $c(sm,e)}function Vf(e){return tl(cm,e)}function Hf(e){return nl(cm,e)}function Uf(e){return rl(lm,e)}function Wf(e){return il(um,e)}function Gf(e){return al(dm,e)}function Kf(){return ol(fm)}function F(){return sl(pm)}function qf(e){return cl(mm,e)}function Jf(e){return ll(hm,e)}function Yf(e){return ul(gm,e)}function I(e,t){return Hl(_m,e,t)}function Xf(e){let t=e._zod.def.shape;return B(Object.keys(t))}function L(e,t){return new vm({type:`object`,shape:e??{},...w(t)})}function Zf(e,t){return new vm({type:`object`,shape:e,catchall:qf(),...w(t)})}function Qf(e,t){return new vm({type:`object`,shape:e,catchall:F(),...w(t)})}function R(e,t){return new ym({type:`union`,options:e,...w(t)})}function $f(e,t){return new bm({type:`union`,options:e,inclusive:!1,...w(t)})}function ep(e,t,n){return new xm({type:`union`,options:t,discriminator:e,...w(n)})}function tp(e,t){return new Sm({type:`intersection`,left:e,right:t})}function np(e,t,n){let r=t instanceof k;return new Cm({type:`tuple`,items:e,rest:r?t:null,...w(r?n:t)})}function z(e,t,n){return!t||!t._zod?new wm({type:`record`,keyType:M(),valueType:e,...w(t)}):new wm({type:`record`,keyType:e,valueType:t,...w(n)})}function rp(e,t,n){let r=_e(e);return r._zod.values=void 0,new wm({type:`record`,keyType:r,valueType:t,...w(n)})}function ip(e,t,n){return new wm({type:`record`,keyType:e,valueType:t,mode:`loose`,...w(n)})}function ap(e,t,n){return new Tm({type:`map`,keyType:e,valueType:t,...w(n)})}function op(e,t){return new Em({type:`set`,valueType:e,...w(t)})}function B(e,t){return new Dm({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...w(t)})}function sp(e,t){return new Dm({type:`enum`,entries:e,...w(t)})}function V(e,t){return new Om({type:`literal`,values:Array.isArray(e)?e:[e],...w(t)})}function cp(e){return eu(km,e)}function lp(e){return new Am({type:`transform`,transform:e})}function H(e){return new jm({type:`optional`,innerType:e})}function up(e){return new Mm({type:`optional`,innerType:e})}function dp(e){return new Nm({type:`nullable`,innerType:e})}function fp(e){return H(dp(e))}function pp(e,t){return new Pm({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():me(t)}})}function mp(e,t){return new Fm({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():me(t)}})}function hp(e,t){return new Im({type:`nonoptional`,innerType:e,...w(t)})}function gp(e){return new Lm({type:`success`,innerType:e})}function _p(e,t){return new Rm({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}function vp(e){return fl(zm,e)}function yp(e,t){return new Bm({type:`pipe`,in:e,out:t})}function bp(e,t,n){return new Vm({type:`pipe`,in:e,out:t,transform:n.decode,reverseTransform:n.encode})}function xp(e){let t=e._zod.def;return new Vm({type:`pipe`,in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}function Sp(e){return new Um({type:`readonly`,innerType:e})}function Cp(e,t){return new Wm({type:`template_literal`,parts:e,...w(t)})}function wp(e){return new Gm({type:`lazy`,getter:e})}function Tp(e){return new Km({type:`promise`,innerType:e})}function Ep(e){return new qm({type:`function`,input:Array.isArray(e?.input)?np(e?.input):e?.input??I(F()),output:e?.output??F()})}function Dp(e){let t=new O({check:`custom`});return t._zod.check=e,t}function Op(e,t){return pu(Jm,e??(()=>!0),t)}function kp(e,t={}){return mu(Jm,e,t)}function Ap(e,t){return hu(e,t)}function jp(e,t={}){let n=new Jm({type:`custom`,check:`custom`,fn:t=>t instanceof e,abort:!0,...w(t)});return n._zod.bag.Class=e,n._zod.check=t=>{t.value instanceof e||t.issues.push({code:`invalid_type`,expected:e.name,input:t.value,inst:n,path:[...n._zod.def.path??[]]})},n}function Mp(e){let t=wp(()=>R([M(e),N(),P(),Gf(),I(t),z(M(),t)]));return t}function Np(e,t){return new Hm({type:`pipe`,in:lp(e),out:t})}var Pp,U,Fp,Ip,W,Lp,Rp,zp,Bp,Vp,Hp,Up,Wp,Gp,Kp,qp,Jp,Yp,Xp,Zp,Qp,$p,em,tm,nm,rm,im,am,om,sm,cm,lm,um,dm,fm,pm,mm,hm,gm,_m,vm,ym,bm,xm,Sm,Cm,wm,Tm,Em,Dm,Om,km,Am,jm,Mm,Nm,Pm,Fm,Im,Lm,Rm,zm,Bm,Vm,Hm,Um,Wm,Gm,Km,qm,Jm,Ym,Xm,Zm,Qm=t((()=>{wd(),vd(),ku(),Ad(),Bd(),rf(),Pp=new WeakMap,U=i(`ZodType`,(e,t)=>(k.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:Ou(e,`input`),output:Ou(e,`output`)}}),e.toJSONSchema=Du(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>Gd(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>qd(e,t,n),e.parseAsync=async(t,n)=>Kd(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Jd(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Yd(e,t,n),e.decode=(t,n)=>Xd(e,t,n),e.encodeAsync=async(t,n)=>Zd(e,t,n),e.decodeAsync=async(t,n)=>Qd(e,t,n),e.safeEncode=(t,n)=>$d(e,t,n),e.safeDecode=(t,n)=>ef(e,t,n),e.safeEncodeAsync=async(t,n)=>tf(e,t,n),e.safeDecodeAsync=async(t,n)=>nf(e,t,n),of(e,`ZodType`,{check(...e){let t=this.def;return this.clone(x(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return _e(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(kp(e,t))},superRefine(e,t){return this.check(Ap(e,t))},overwrite(e){return this.check(Il(e))},optional(){return H(this)},exactOptional(){return up(this)},nullable(){return dp(this)},nullish(){return H(dp(this))},nonoptional(e){return hp(this,e)},array(){return I(this)},or(e){return R([this,e])},and(e){return tp(this,e)},transform(e){return yp(this,lp(e))},default(e){return pp(this,e)},prefault(e){return mp(this,e)},catch(e){return _p(this,e)},pipe(e){return yp(this,e)},readonly(){return Sp(this)},describe(e){let t=this.clone();return pc.add(t,{description:e}),t},meta(...e){if(e.length===0)return pc.get(this);let t=this.clone();return pc.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return pc.get(e)?.description},configurable:!0}),e)),Fp=i(`_ZodString`,(e,t)=>{Hr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mu(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,of(e,`_ZodString`,{regex(...e){return this.check(Ol(...e))},includes(...e){return this.check(jl(...e))},startsWith(...e){return this.check(Ml(...e))},endsWith(...e){return this.check(Nl(...e))},min(...e){return this.check(El(...e))},max(...e){return this.check(Tl(...e))},length(...e){return this.check(Dl(...e))},nonempty(...e){return this.check(El(1,...e))},lowercase(e){return this.check(kl(e))},uppercase(e){return this.check(Al(e))},trim(){return this.check(Rl())},normalize(...e){return this.check(Ll(...e))},toLowerCase(){return this.check(zl())},toUpperCase(){return this.check(Bl())},slugify(){return this.check(Vl())}})}),Ip=i(`ZodString`,(e,t)=>{Hr.init(e,t),Fp.init(e,t),e.email=t=>e.check(_c(Lp,t)),e.url=t=>e.check(Cc(Bp,t)),e.jwt=t=>e.check(zc(nm,t)),e.emoji=t=>e.check(wc(Vp,t)),e.guid=t=>e.check(vc(Rp,t)),e.uuid=t=>e.check(yc(zp,t)),e.uuidv4=t=>e.check(bc(zp,t)),e.uuidv6=t=>e.check(xc(zp,t)),e.uuidv7=t=>e.check(Sc(zp,t)),e.nanoid=t=>e.check(Tc(Hp,t)),e.guid=t=>e.check(vc(Rp,t)),e.cuid=t=>e.check(Ec(Up,t)),e.cuid2=t=>e.check(Dc(Wp,t)),e.ulid=t=>e.check(Oc(Gp,t)),e.base64=t=>e.check(Ic($p,t)),e.base64url=t=>e.check(Lc(em,t)),e.xid=t=>e.check(kc(Kp,t)),e.ksuid=t=>e.check(Ac(qp,t)),e.ipv4=t=>e.check(jc(Jp,t)),e.ipv6=t=>e.check(Mc(Xp,t)),e.cidrv4=t=>e.check(Pc(Zp,t)),e.cidrv6=t=>e.check(Fc(Qp,t)),e.e164=t=>e.check(Rc(tm,t)),e.datetime=t=>e.check(Md(t)),e.date=t=>e.check(Nd(t)),e.time=t=>e.check(Pd(t)),e.duration=t=>e.check(Fd(t))}),W=i(`ZodStringFormat`,(e,t)=>{A.init(e,t),Fp.init(e,t)}),Lp=i(`ZodEmail`,(e,t)=>{Gr.init(e,t),W.init(e,t)}),Rp=i(`ZodGUID`,(e,t)=>{Ur.init(e,t),W.init(e,t)}),zp=i(`ZodUUID`,(e,t)=>{Wr.init(e,t),W.init(e,t)}),Bp=i(`ZodURL`,(e,t)=>{Kr.init(e,t),W.init(e,t)}),Vp=i(`ZodEmoji`,(e,t)=>{qr.init(e,t),W.init(e,t)}),Hp=i(`ZodNanoID`,(e,t)=>{Jr.init(e,t),W.init(e,t)}),Up=i(`ZodCUID`,(e,t)=>{Yr.init(e,t),W.init(e,t)}),Wp=i(`ZodCUID2`,(e,t)=>{Xr.init(e,t),W.init(e,t)}),Gp=i(`ZodULID`,(e,t)=>{Zr.init(e,t),W.init(e,t)}),Kp=i(`ZodXID`,(e,t)=>{Qr.init(e,t),W.init(e,t)}),qp=i(`ZodKSUID`,(e,t)=>{$r.init(e,t),W.init(e,t)}),Jp=i(`ZodIPv4`,(e,t)=>{ii.init(e,t),W.init(e,t)}),Yp=i(`ZodMAC`,(e,t)=>{oi.init(e,t),W.init(e,t)}),Xp=i(`ZodIPv6`,(e,t)=>{ai.init(e,t),W.init(e,t)}),Zp=i(`ZodCIDRv4`,(e,t)=>{si.init(e,t),W.init(e,t)}),Qp=i(`ZodCIDRv6`,(e,t)=>{ci.init(e,t),W.init(e,t)}),$p=i(`ZodBase64`,(e,t)=>{li.init(e,t),W.init(e,t)}),em=i(`ZodBase64URL`,(e,t)=>{ui.init(e,t),W.init(e,t)}),tm=i(`ZodE164`,(e,t)=>{di.init(e,t),W.init(e,t)}),nm=i(`ZodJWT`,(e,t)=>{fi.init(e,t),W.init(e,t)}),rm=i(`ZodCustomStringFormat`,(e,t)=>{pi.init(e,t),W.init(e,t)}),im=i(`ZodNumber`,(e,t)=>{mi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Nu(e,t,n,r),of(e,`ZodNumber`,{gt(e,t){return this.check(hl(e,t))},gte(e,t){return this.check(gl(e,t))},min(e,t){return this.check(gl(e,t))},lt(e,t){return this.check(pl(e,t))},lte(e,t){return this.check(ml(e,t))},max(e,t){return this.check(ml(e,t))},int(e){return this.check(Ff(e))},safe(e){return this.check(Ff(e))},positive(e){return this.check(hl(0,e))},nonnegative(e){return this.check(gl(0,e))},negative(e){return this.check(pl(0,e))},nonpositive(e){return this.check(ml(0,e))},multipleOf(e,t){return this.check(xl(e,t))},step(e,t){return this.check(xl(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null}),am=i(`ZodNumberFormat`,(e,t)=>{hi.init(e,t),im.init(e,t)}),om=i(`ZodBoolean`,(e,t)=>{gi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pu(e,t,n,r)}),sm=i(`ZodBigInt`,(e,t)=>{_i.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fu(e,t,n,r),e.gte=(t,n)=>e.check(gl(t,n)),e.min=(t,n)=>e.check(gl(t,n)),e.gt=(t,n)=>e.check(hl(t,n)),e.gte=(t,n)=>e.check(gl(t,n)),e.min=(t,n)=>e.check(gl(t,n)),e.lt=(t,n)=>e.check(pl(t,n)),e.lte=(t,n)=>e.check(ml(t,n)),e.max=(t,n)=>e.check(ml(t,n)),e.positive=t=>e.check(hl(BigInt(0),t)),e.negative=t=>e.check(pl(BigInt(0),t)),e.nonpositive=t=>e.check(ml(BigInt(0),t)),e.nonnegative=t=>e.check(gl(BigInt(0),t)),e.multipleOf=(t,n)=>e.check(xl(t,n));let n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null}),cm=i(`ZodBigIntFormat`,(e,t)=>{vi.init(e,t),sm.init(e,t)}),lm=i(`ZodSymbol`,(e,t)=>{yi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Iu(e,t,n,r)}),um=i(`ZodUndefined`,(e,t)=>{bi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ru(e,t,n,r)}),dm=i(`ZodNull`,(e,t)=>{xi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Lu(e,t,n,r)}),fm=i(`ZodAny`,(e,t)=>{Si.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vu(e,t,n,r)}),pm=i(`ZodUnknown`,(e,t)=>{Ci.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hu(e,t,n,r)}),mm=i(`ZodNever`,(e,t)=>{wi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bu(e,t,n,r)}),hm=i(`ZodVoid`,(e,t)=>{Ti.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zu(e,t,n,r)}),gm=i(`ZodDate`,(e,t)=>{Ei.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Uu(e,t,n,r),e.min=(t,n)=>e.check(gl(t,n)),e.max=(t,n)=>e.check(ml(t,n));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null}),_m=i(`ZodArray`,(e,t)=>{Di.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>td(e,t,n,r),e.element=t.element,of(e,`ZodArray`,{min(e,t){return this.check(El(e,t))},nonempty(e){return this.check(El(1,e))},max(e,t){return this.check(Tl(e,t))},length(e,t){return this.check(Dl(e,t))},unwrap(){return this.element}})}),vm=i(`ZodObject`,(e,t)=>{ki.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>nd(e,t,n,r),y(e,`shape`,()=>t.shape),of(e,`ZodObject`,{keyof(){return B(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:F()})},loose(){return this.clone({...this._zod.def,catchall:F()})},strict(){return this.clone({...this._zod.def,catchall:qf()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return Se(this,e)},safeExtend(e){return Ce(this,e)},merge(e){return we(this,e)},pick(e){return be(this,e)},omit(e){return xe(this,e)},partial(...e){return Te(jm,this,e[0])},required(...e){return Ee(Im,this,e[0])}})}),ym=i(`ZodUnion`,(e,t)=>{Ai.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>rd(e,t,n,r),e.options=t.options}),bm=i(`ZodXor`,(e,t)=>{ym.init(e,t),ji.init(e,t),e._zod.processJSONSchema=(t,n,r)=>rd(e,t,n,r),e.options=t.options}),xm=i(`ZodDiscriminatedUnion`,(e,t)=>{ym.init(e,t),Mi.init(e,t)}),Sm=i(`ZodIntersection`,(e,t)=>{Ni.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>id(e,t,n,r)}),Cm=i(`ZodTuple`,(e,t)=>{Pi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ad(e,t,n,r),e.rest=t=>e.clone({...e._zod.def,rest:t})}),wm=i(`ZodRecord`,(e,t)=>{Fi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>od(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType}),Tm=i(`ZodMap`,(e,t)=>{Ii.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$u(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...t)=>e.check(Cl(...t)),e.nonempty=t=>e.check(Cl(1,t)),e.max=(...t)=>e.check(Sl(...t)),e.size=(...t)=>e.check(wl(...t))}),Em=i(`ZodSet`,(e,t)=>{Li.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ed(e,t,n,r),e.min=(...t)=>e.check(Cl(...t)),e.nonempty=t=>e.check(Cl(1,t)),e.max=(...t)=>e.check(Sl(...t)),e.size=(...t)=>e.check(wl(...t))}),Dm=i(`ZodEnum`,(e,t)=>{Ri.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wu(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Dm({...t,checks:[],...w(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Dm({...t,checks:[],...w(r),entries:i})}}),Om=i(`ZodLiteral`,(e,t)=>{zi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gu(e,t,n,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]}})}),km=i(`ZodFile`,(e,t)=>{Bi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ju(e,t,n,r),e.min=(t,n)=>e.check(Cl(t,n)),e.max=(t,n)=>e.check(Sl(t,n)),e.mime=(t,n)=>e.check(Fl(Array.isArray(t)?t:[t],n))}),Am=i(`ZodTransform`,(e,t)=>{Vi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qu(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new u(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Pe(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(Pe(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}}),jm=i(`ZodOptional`,(e,t)=>{Hi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hd(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),Mm=i(`ZodExactOptional`,(e,t)=>{Ui.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hd(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),Nm=i(`ZodNullable`,(e,t)=>{Wi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>sd(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),Pm=i(`ZodDefault`,(e,t)=>{Gi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ld(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}),Fm=i(`ZodPrefault`,(e,t)=>{Ki.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ud(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),Im=i(`ZodNonOptional`,(e,t)=>{qi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cd(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),Lm=i(`ZodSuccess`,(e,t)=>{Ji.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),Rm=i(`ZodCatch`,(e,t)=>{Yi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>dd(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}),zm=i(`ZodNaN`,(e,t)=>{Xi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ku(e,t,n,r)}),Bm=i(`ZodPipe`,(e,t)=>{Zi.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fd(e,t,n,r),e.in=t.in,e.out=t.out}),Vm=i(`ZodCodec`,(e,t)=>{Bm.init(e,t),Qi.init(e,t)}),Hm=i(`ZodPreprocess`,(e,t)=>{Bm.init(e,t),$i.init(e,t)}),Um=i(`ZodReadonly`,(e,t)=>{ea.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pd(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),Wm=i(`ZodTemplateLiteral`,(e,t)=>{ta.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qu(e,t,n,r)}),Gm=i(`ZodLazy`,(e,t)=>{ia.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gd(e,t,n,r),e.unwrap=()=>e._zod.def.getter()}),Km=i(`ZodPromise`,(e,t)=>{ra.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>md(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),qm=i(`ZodFunction`,(e,t)=>{na.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zu(e,t,n,r)}),Jm=i(`ZodCustom`,(e,t)=>{aa.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xu(e,t,n,r)}),Ym=_u,Xm=vu,Zm=(...e)=>yu({Codec:Vm,Boolean:om,String:Ip},...e)}));function $m(e){a({customError:e})}function eh(){return a().customError}var th,nh,rh=t((()=>{wd(),th={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`},nh||={}}));function ih(e,t){let n=e.$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`:t??`draft-2020-12`}function ah(e,t){if(!e.startsWith(`#`))throw Error(`External $ref is not supported, only local refs (#/...) are allowed`);let n=e.slice(1).split(`/`).filter(Boolean);if(n.length===0)return t.rootSchema;let r=t.version===`draft-2020-12`?`$defs`:`definitions`;if(n[0]===r){let r=n[1];if(!r||!t.defs[r])throw Error(`Reference not found: ${e}`);return t.defs[r]}throw Error(`Reference not found: ${e}`)}function oh(e,t){if(e.not!==void 0){if(typeof e.not==`object`&&Object.keys(e.not).length===0)return G.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 G.lazy(()=>{if(!t.refs.has(n))throw Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);let r=sh(ah(n,t),t);return t.refs.set(n,r),t.processing.delete(n),r}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 G.null();if(n.length===0)return G.never();if(n.length===1)return G.literal(n[0]);if(n.every(e=>typeof e==`string`))return G.enum(n);let r=n.map(e=>G.literal(e));return r.length<2?r[0]:G.union([r[0],r[1],...r.slice(2)])}if(e.const!==void 0)return G.literal(e.const);let n=e.type;if(Array.isArray(n)){let r=n.map(n=>oh({...e,type:n},t));return r.length===0?G.never():r.length===1?r[0]:G.union(r)}if(!n)return G.any();let r;switch(n){case`string`:{let t=G.string();if(e.format){let n=e.format;n===`email`?t=t.check(G.email()):n===`uri`||n===`uri-reference`?t=t.check(G.url()):n===`uuid`||n===`guid`?t=t.check(G.uuid()):n===`date-time`?t=t.check(G.iso.datetime()):n===`date`?t=t.check(G.iso.date()):n===`time`?t=t.check(G.iso.time()):n===`duration`?t=t.check(G.iso.duration()):n===`ipv4`?t=t.check(G.ipv4()):n===`ipv6`?t=t.check(G.ipv6()):n===`mac`?t=t.check(G.mac()):n===`cidr`?t=t.check(G.cidrv4()):n===`cidr-v6`?t=t.check(G.cidrv6()):n===`base64`?t=t.check(G.base64()):n===`base64url`?t=t.check(G.base64url()):n===`e164`?t=t.check(G.e164()):n===`jwt`?t=t.check(G.jwt()):n===`emoji`?t=t.check(G.emoji()):n===`nanoid`?t=t.check(G.nanoid()):n===`cuid`?t=t.check(G.cuid()):n===`cuid2`?t=t.check(G.cuid2()):n===`ulid`?t=t.check(G.ulid()):n===`xid`?t=t.check(G.xid()):n===`ksuid`&&(t=t.check(G.ksuid()))}typeof e.minLength==`number`&&(t=t.min(e.minLength)),typeof e.maxLength==`number`&&(t=t.max(e.maxLength)),e.pattern&&(t=t.regex(new RegExp(e.pattern))),r=t;break}case`number`:case`integer`:{let t=n===`integer`?G.number().int():G.number();typeof e.minimum==`number`&&(t=t.min(e.minimum)),typeof e.maximum==`number`&&(t=t.max(e.maximum)),typeof e.exclusiveMinimum==`number`?t=t.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum==`number`&&(t=t.gt(e.minimum)),typeof e.exclusiveMaximum==`number`?t=t.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum==`number`&&(t=t.lt(e.maximum)),typeof e.multipleOf==`number`&&(t=t.multipleOf(e.multipleOf)),r=t;break}case`boolean`:r=G.boolean();break;case`null`:r=G.null();break;case`object`:{let n={},i=e.properties||{},a=new Set(e.required||[]);for(let[e,r]of Object.entries(i)){let i=sh(r,t);n[e]=a.has(e)?i:i.optional()}if(e.propertyNames){let i=sh(e.propertyNames,t),a=e.additionalProperties&&typeof e.additionalProperties==`object`?sh(e.additionalProperties,t):G.any();if(Object.keys(n).length===0){r=G.record(i,a);break}let o=G.object(n).passthrough(),s=G.looseRecord(i,a);r=G.intersection(o,s);break}if(e.patternProperties){let i=e.patternProperties,a=Object.keys(i),o=[];for(let e of a){let n=sh(i[e],t),r=G.string().regex(new RegExp(e));o.push(G.looseRecord(r,n))}let s=[];if(Object.keys(n).length>0&&s.push(G.object(n).passthrough()),s.push(...o),s.length===0)r=G.object({}).passthrough();else if(s.length===1)r=s[0];else{let e=G.intersection(s[0],s[1]);for(let t=2;t<s.length;t++)e=G.intersection(e,s[t]);r=e}break}let o=G.object(n);r=e.additionalProperties===!1?o.strict():typeof e.additionalProperties==`object`?o.catchall(sh(e.additionalProperties,t)):o.passthrough();break}case`array`:{let n=e.prefixItems,i=e.items;if(n&&Array.isArray(n)){let a=n.map(e=>sh(e,t)),o=i&&typeof i==`object`&&!Array.isArray(i)?sh(i,t):void 0;r=o?G.tuple(a).rest(o):G.tuple(a),typeof e.minItems==`number`&&(r=r.check(G.minLength(e.minItems))),typeof e.maxItems==`number`&&(r=r.check(G.maxLength(e.maxItems)))}else if(Array.isArray(i)){let n=i.map(e=>sh(e,t)),a=e.additionalItems&&typeof e.additionalItems==`object`?sh(e.additionalItems,t):void 0;r=a?G.tuple(n).rest(a):G.tuple(n),typeof e.minItems==`number`&&(r=r.check(G.minLength(e.minItems))),typeof e.maxItems==`number`&&(r=r.check(G.maxLength(e.maxItems)))}else if(i!==void 0){let n=sh(i,t),a=G.array(n);typeof e.minItems==`number`&&(a=a.min(e.minItems)),typeof e.maxItems==`number`&&(a=a.max(e.maxItems)),r=a}else r=G.array(G.any());break}default:throw Error(`Unsupported type: ${n}`)}return r}function sh(e,t){if(typeof e==`boolean`)return e?G.any():G.never();let n=oh(e,t),r=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let i=e.anyOf.map(e=>sh(e,t)),a=G.union(i);n=r?G.intersection(n,a):a}if(e.oneOf&&Array.isArray(e.oneOf)){let i=e.oneOf.map(e=>sh(e,t)),a=G.xor(i);n=r?G.intersection(n,a):a}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)n=r?n:G.any();else{let i=r?n:sh(e.allOf[0],t),a=+!r;for(let n=a;n<e.allOf.length;n++)i=G.intersection(i,sh(e.allOf[n],t));n=i}e.nullable===!0&&t.version===`openapi-3.0`&&(n=G.nullable(n)),e.readOnly===!0&&(n=G.readonly(n)),e.default!==void 0&&(n=n.default(e.default));let i={};for(let t of[`$id`,`id`,`$comment`,`$anchor`,`$vocabulary`,`$dynamicRef`,`$dynamicAnchor`])t in e&&(i[t]=e[t]);for(let t of[`contentEncoding`,`contentMediaType`,`contentSchema`])t in e&&(i[t]=e[t]);for(let t of Object.keys(e))lh.has(t)||(i[t]=e[t]);return Object.keys(i).length>0&&t.registry.add(n,i),e.description&&(n=n.describe(e.description)),n}function ch(e,t){if(typeof e==`boolean`)return e?G.any():G.never();let n;try{n=JSON.parse(JSON.stringify(e))}catch{throw Error(`fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas`)}let r={version:ih(n,t?.defaultTarget),defs:n.$defs||n.definitions||{},refs:new Map,processing:new Set,rootSchema:n,registry:t?.registry??pc};return sh(n,r)}var G,lh,uh=t((()=>{mc(),Ad(),Bd(),Qm(),G={...af,...kd,iso:jd},lh=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`.split(`.`))})),dh=n({bigint:()=>hh,boolean:()=>mh,date:()=>gh,number:()=>ph,string:()=>fh});function fh(e){return gc(Ip,e)}function ph(e){return Gc(im,e)}function mh(e){return Qc(om,e)}function hh(e){return el(sm,e)}function gh(e){return dl(gm,e)}var _h=t((()=>{wd(),Qm()})),vh=n({$brand:()=>c,$input:()=>dc,$output:()=>uc,NEVER:()=>s,TimePrecision:()=>xu,ZodAny:()=>fm,ZodArray:()=>_m,ZodBase64:()=>$p,ZodBase64URL:()=>em,ZodBigInt:()=>sm,ZodBigIntFormat:()=>cm,ZodBoolean:()=>om,ZodCIDRv4:()=>Zp,ZodCIDRv6:()=>Qp,ZodCUID:()=>Up,ZodCUID2:()=>Wp,ZodCatch:()=>Rm,ZodCodec:()=>Vm,ZodCustom:()=>Jm,ZodCustomStringFormat:()=>rm,ZodDate:()=>gm,ZodDefault:()=>Pm,ZodDiscriminatedUnion:()=>xm,ZodE164:()=>tm,ZodEmail:()=>Lp,ZodEmoji:()=>Vp,ZodEnum:()=>Dm,ZodError:()=>Hd,ZodExactOptional:()=>Mm,ZodFile:()=>km,ZodFirstPartyTypeKind:()=>nh,ZodFunction:()=>qm,ZodGUID:()=>Rp,ZodIPv4:()=>Jp,ZodIPv6:()=>Xp,ZodISODate:()=>Ld,ZodISODateTime:()=>Id,ZodISODuration:()=>zd,ZodISOTime:()=>Rd,ZodIntersection:()=>Sm,ZodIssueCode:()=>th,ZodJWT:()=>nm,ZodKSUID:()=>qp,ZodLazy:()=>Gm,ZodLiteral:()=>Om,ZodMAC:()=>Yp,ZodMap:()=>Tm,ZodNaN:()=>zm,ZodNanoID:()=>Hp,ZodNever:()=>mm,ZodNonOptional:()=>Im,ZodNull:()=>dm,ZodNullable:()=>Nm,ZodNumber:()=>im,ZodNumberFormat:()=>am,ZodObject:()=>vm,ZodOptional:()=>jm,ZodPipe:()=>Bm,ZodPrefault:()=>Fm,ZodPreprocess:()=>Hm,ZodPromise:()=>Km,ZodReadonly:()=>Um,ZodRealError:()=>Ud,ZodRecord:()=>wm,ZodSet:()=>Em,ZodString:()=>Ip,ZodStringFormat:()=>W,ZodSuccess:()=>Lm,ZodSymbol:()=>lm,ZodTemplateLiteral:()=>Wm,ZodTransform:()=>Am,ZodTuple:()=>Cm,ZodType:()=>U,ZodULID:()=>Gp,ZodURL:()=>Bp,ZodUUID:()=>zp,ZodUndefined:()=>um,ZodUnion:()=>ym,ZodUnknown:()=>pm,ZodVoid:()=>hm,ZodXID:()=>Kp,ZodXor:()=>bm,_ZodString:()=>Fp,_default:()=>pp,_function:()=>Ep,any:()=>Kf,array:()=>I,base64:()=>Df,base64url:()=>Of,bigint:()=>Bf,boolean:()=>P,catch:()=>_p,check:()=>Dp,cidrv4:()=>Tf,cidrv6:()=>Ef,clone:()=>_e,codec:()=>bp,coerce:()=>dh,config:()=>a,core:()=>Cd,cuid:()=>_f,cuid2:()=>vf,custom:()=>Op,date:()=>Yf,decode:()=>Xd,decodeAsync:()=>Qd,describe:()=>Ym,discriminatedUnion:()=>ep,e164:()=>kf,email:()=>sf,emoji:()=>hf,encode:()=>Yd,encodeAsync:()=>Zd,endsWith:()=>Nl,enum:()=>B,exactOptional:()=>up,file:()=>cp,flattenError:()=>Ze,float32:()=>If,float64:()=>Lf,formatError:()=>Qe,fromJSONSchema:()=>ch,function:()=>Ep,getErrorMap:()=>eh,globalRegistry:()=>pc,gt:()=>hl,gte:()=>gl,guid:()=>cf,hash:()=>Pf,hex:()=>Nf,hostname:()=>Mf,httpUrl:()=>mf,includes:()=>jl,instanceof:()=>jp,int:()=>Ff,int32:()=>Rf,int64:()=>Vf,intersection:()=>tp,invertCodec:()=>xp,ipv4:()=>Sf,ipv6:()=>wf,iso:()=>jd,json:()=>Mp,jwt:()=>Af,keyof:()=>Xf,ksuid:()=>xf,lazy:()=>wp,length:()=>Dl,literal:()=>V,locales:()=>oc,looseObject:()=>Qf,looseRecord:()=>ip,lowercase:()=>kl,lt:()=>pl,lte:()=>ml,mac:()=>Cf,map:()=>ap,maxLength:()=>Tl,maxSize:()=>Sl,meta:()=>Xm,mime:()=>Fl,minLength:()=>El,minSize:()=>Cl,multipleOf:()=>xl,nan:()=>vp,nanoid:()=>gf,nativeEnum:()=>sp,negative:()=>vl,never:()=>qf,nonnegative:()=>bl,nonoptional:()=>hp,nonpositive:()=>yl,normalize:()=>Ll,null:()=>Gf,nullable:()=>dp,nullish:()=>fp,number:()=>N,object:()=>L,optional:()=>H,overwrite:()=>Il,parse:()=>Gd,parseAsync:()=>Kd,partialRecord:()=>rp,pipe:()=>yp,positive:()=>_l,prefault:()=>mp,preprocess:()=>Np,prettifyError:()=>tt,promise:()=>Tp,property:()=>Pl,readonly:()=>Sp,record:()=>z,refine:()=>kp,regex:()=>Ol,regexes:()=>jt,registry:()=>cc,safeDecode:()=>ef,safeDecodeAsync:()=>nf,safeEncode:()=>$d,safeEncodeAsync:()=>tf,safeParse:()=>qd,safeParseAsync:()=>Jd,set:()=>op,setErrorMap:()=>$m,size:()=>wl,slugify:()=>Vl,startsWith:()=>Ml,strictObject:()=>Zf,string:()=>M,stringFormat:()=>jf,stringbool:()=>Zm,success:()=>gp,superRefine:()=>Ap,symbol:()=>Uf,templateLiteral:()=>Cp,toJSONSchema:()=>Au,toLowerCase:()=>zl,toUpperCase:()=>Bl,transform:()=>lp,treeifyError:()=>$e,trim:()=>Rl,tuple:()=>np,uint32:()=>zf,uint64:()=>Hf,ulid:()=>yf,undefined:()=>Wf,union:()=>R,unknown:()=>F,uppercase:()=>Al,url:()=>pf,util:()=>p,uuid:()=>lf,uuidv4:()=>uf,uuidv6:()=>df,uuidv7:()=>ff,void:()=>Jf,xid:()=>bf,xor:()=>$f}),yh=t((()=>{wd(),Qm(),Ad(),Wd(),rf(),rh(),La(),vd(),uh(),sc(),Bd(),_h(),a(Fa())})),bh,xh=t((()=>{yh(),yh(),bh=vh})),Sh=n({$brand:()=>c,$input:()=>dc,$output:()=>uc,NEVER:()=>s,TimePrecision:()=>xu,ZodAny:()=>fm,ZodArray:()=>_m,ZodBase64:()=>$p,ZodBase64URL:()=>em,ZodBigInt:()=>sm,ZodBigIntFormat:()=>cm,ZodBoolean:()=>om,ZodCIDRv4:()=>Zp,ZodCIDRv6:()=>Qp,ZodCUID:()=>Up,ZodCUID2:()=>Wp,ZodCatch:()=>Rm,ZodCodec:()=>Vm,ZodCustom:()=>Jm,ZodCustomStringFormat:()=>rm,ZodDate:()=>gm,ZodDefault:()=>Pm,ZodDiscriminatedUnion:()=>xm,ZodE164:()=>tm,ZodEmail:()=>Lp,ZodEmoji:()=>Vp,ZodEnum:()=>Dm,ZodError:()=>Hd,ZodExactOptional:()=>Mm,ZodFile:()=>km,ZodFirstPartyTypeKind:()=>nh,ZodFunction:()=>qm,ZodGUID:()=>Rp,ZodIPv4:()=>Jp,ZodIPv6:()=>Xp,ZodISODate:()=>Ld,ZodISODateTime:()=>Id,ZodISODuration:()=>zd,ZodISOTime:()=>Rd,ZodIntersection:()=>Sm,ZodIssueCode:()=>th,ZodJWT:()=>nm,ZodKSUID:()=>qp,ZodLazy:()=>Gm,ZodLiteral:()=>Om,ZodMAC:()=>Yp,ZodMap:()=>Tm,ZodNaN:()=>zm,ZodNanoID:()=>Hp,ZodNever:()=>mm,ZodNonOptional:()=>Im,ZodNull:()=>dm,ZodNullable:()=>Nm,ZodNumber:()=>im,ZodNumberFormat:()=>am,ZodObject:()=>vm,ZodOptional:()=>jm,ZodPipe:()=>Bm,ZodPrefault:()=>Fm,ZodPreprocess:()=>Hm,ZodPromise:()=>Km,ZodReadonly:()=>Um,ZodRealError:()=>Ud,ZodRecord:()=>wm,ZodSet:()=>Em,ZodString:()=>Ip,ZodStringFormat:()=>W,ZodSuccess:()=>Lm,ZodSymbol:()=>lm,ZodTemplateLiteral:()=>Wm,ZodTransform:()=>Am,ZodTuple:()=>Cm,ZodType:()=>U,ZodULID:()=>Gp,ZodURL:()=>Bp,ZodUUID:()=>zp,ZodUndefined:()=>um,ZodUnion:()=>ym,ZodUnknown:()=>pm,ZodVoid:()=>hm,ZodXID:()=>Kp,ZodXor:()=>bm,_ZodString:()=>Fp,_default:()=>pp,_function:()=>Ep,any:()=>Kf,array:()=>I,base64:()=>Df,base64url:()=>Of,bigint:()=>Bf,boolean:()=>P,catch:()=>_p,check:()=>Dp,cidrv4:()=>Tf,cidrv6:()=>Ef,clone:()=>_e,codec:()=>bp,coerce:()=>dh,config:()=>a,core:()=>Cd,cuid:()=>_f,cuid2:()=>vf,custom:()=>Op,date:()=>Yf,decode:()=>Xd,decodeAsync:()=>Qd,default:()=>Ch,describe:()=>Ym,discriminatedUnion:()=>ep,e164:()=>kf,email:()=>sf,emoji:()=>hf,encode:()=>Yd,encodeAsync:()=>Zd,endsWith:()=>Nl,enum:()=>B,exactOptional:()=>up,file:()=>cp,flattenError:()=>Ze,float32:()=>If,float64:()=>Lf,formatError:()=>Qe,fromJSONSchema:()=>ch,function:()=>Ep,getErrorMap:()=>eh,globalRegistry:()=>pc,gt:()=>hl,gte:()=>gl,guid:()=>cf,hash:()=>Pf,hex:()=>Nf,hostname:()=>Mf,httpUrl:()=>mf,includes:()=>jl,instanceof:()=>jp,int:()=>Ff,int32:()=>Rf,int64:()=>Vf,intersection:()=>tp,invertCodec:()=>xp,ipv4:()=>Sf,ipv6:()=>wf,iso:()=>jd,json:()=>Mp,jwt:()=>Af,keyof:()=>Xf,ksuid:()=>xf,lazy:()=>wp,length:()=>Dl,literal:()=>V,locales:()=>oc,looseObject:()=>Qf,looseRecord:()=>ip,lowercase:()=>kl,lt:()=>pl,lte:()=>ml,mac:()=>Cf,map:()=>ap,maxLength:()=>Tl,maxSize:()=>Sl,meta:()=>Xm,mime:()=>Fl,minLength:()=>El,minSize:()=>Cl,multipleOf:()=>xl,nan:()=>vp,nanoid:()=>gf,nativeEnum:()=>sp,negative:()=>vl,never:()=>qf,nonnegative:()=>bl,nonoptional:()=>hp,nonpositive:()=>yl,normalize:()=>Ll,null:()=>Gf,nullable:()=>dp,nullish:()=>fp,number:()=>N,object:()=>L,optional:()=>H,overwrite:()=>Il,parse:()=>Gd,parseAsync:()=>Kd,partialRecord:()=>rp,pipe:()=>yp,positive:()=>_l,prefault:()=>mp,preprocess:()=>Np,prettifyError:()=>tt,promise:()=>Tp,property:()=>Pl,readonly:()=>Sp,record:()=>z,refine:()=>kp,regex:()=>Ol,regexes:()=>jt,registry:()=>cc,safeDecode:()=>ef,safeDecodeAsync:()=>nf,safeEncode:()=>$d,safeEncodeAsync:()=>tf,safeParse:()=>qd,safeParseAsync:()=>Jd,set:()=>op,setErrorMap:()=>$m,size:()=>wl,slugify:()=>Vl,startsWith:()=>Ml,strictObject:()=>Zf,string:()=>M,stringFormat:()=>jf,stringbool:()=>Zm,success:()=>gp,superRefine:()=>Ap,symbol:()=>Uf,templateLiteral:()=>Cp,toJSONSchema:()=>Au,toLowerCase:()=>zl,toUpperCase:()=>Bl,transform:()=>lp,treeifyError:()=>$e,trim:()=>Rl,tuple:()=>np,uint32:()=>zf,uint64:()=>Hf,ulid:()=>yf,undefined:()=>Wf,union:()=>R,unknown:()=>F,uppercase:()=>Al,url:()=>pf,util:()=>p,uuid:()=>lf,uuidv4:()=>uf,uuidv6:()=>df,uuidv7:()=>ff,void:()=>Jf,xid:()=>bf,xor:()=>$f,z:()=>vh}),Ch,wh=t((()=>{xh(),xh(),Ch=bh}));wh();var Th=`io.modelcontextprotocol/related-task`,Eh=Op(e=>e!==null&&(typeof e==`object`||typeof e==`function`)),Dh=R([M(),N().int()]),Oh=M();Qf({ttl:N().optional(),pollInterval:N().optional()});var kh=L({ttl:N().optional()}),Ah=L({taskId:M()}),jh=Qf({progressToken:Dh.optional(),[Th]:Ah.optional()}),Mh=L({_meta:jh.optional()}),Nh=Mh.extend({task:kh.optional()}),Ph=e=>Nh.safeParse(e).success,Fh=L({method:M(),params:Mh.loose().optional()}),Ih=L({_meta:jh.optional()}),Lh=L({method:M(),params:Ih.loose().optional()}),Rh=Qf({_meta:jh.optional()}),zh=R([M(),N().int()]),Bh=L({jsonrpc:V(`2.0`),id:zh,...Fh.shape}).strict(),Vh=e=>Bh.safeParse(e).success,Hh=L({jsonrpc:V(`2.0`),...Lh.shape}).strict(),Uh=e=>Hh.safeParse(e).success,Wh=L({jsonrpc:V(`2.0`),id:zh,result:Rh}).strict(),Gh=e=>Wh.safeParse(e).success,K;(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`})(K||={});var Kh=L({jsonrpc:V(`2.0`),id:zh.optional(),error:L({code:N().int(),message:M(),data:F().optional()})}).strict(),qh=e=>Kh.safeParse(e).success,Jh=R([Bh,Hh,Wh,Kh]);R([Wh,Kh]);var Yh=Rh.strict(),Xh=Ih.extend({requestId:zh.optional(),reason:M().optional()}),Zh=Lh.extend({method:V(`notifications/cancelled`),params:Xh}),Qh=L({icons:I(L({src:M(),mimeType:M().optional(),sizes:I(M()).optional(),theme:B([`light`,`dark`]).optional()})).optional()}),$h=L({name:M(),title:M().optional()}),eg=$h.extend({...$h.shape,...Qh.shape,version:M(),websiteUrl:M().optional(),description:M().optional()}),tg=Np(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,tp(L({form:tp(L({applyDefaults:P().optional()}),z(M(),F())).optional(),url:Eh.optional()}),z(M(),F()).optional())),ng=Qf({list:Eh.optional(),cancel:Eh.optional(),requests:Qf({sampling:Qf({createMessage:Eh.optional()}).optional(),elicitation:Qf({create:Eh.optional()}).optional()}).optional()}),rg=Qf({list:Eh.optional(),cancel:Eh.optional(),requests:Qf({tools:Qf({call:Eh.optional()}).optional()}).optional()}),ig=L({experimental:z(M(),Eh).optional(),sampling:L({context:Eh.optional(),tools:Eh.optional()}).optional(),elicitation:tg.optional(),roots:L({listChanged:P().optional()}).optional(),tasks:ng.optional(),extensions:z(M(),Eh).optional()}),ag=Mh.extend({protocolVersion:M(),capabilities:ig,clientInfo:eg}),og=Fh.extend({method:V(`initialize`),params:ag}),sg=L({experimental:z(M(),Eh).optional(),logging:Eh.optional(),completions:Eh.optional(),prompts:L({listChanged:P().optional()}).optional(),resources:L({subscribe:P().optional(),listChanged:P().optional()}).optional(),tools:L({listChanged:P().optional()}).optional(),tasks:rg.optional(),extensions:z(M(),Eh).optional()}),cg=Rh.extend({protocolVersion:M(),capabilities:sg,serverInfo:eg,instructions:M().optional()}),lg=Lh.extend({method:V(`notifications/initialized`),params:Ih.optional()}),ug=Fh.extend({method:V(`ping`),params:Mh.optional()}),dg=L({progress:N(),total:H(N()),message:H(M())}),fg=L({...Ih.shape,...dg.shape,progressToken:Dh}),pg=Lh.extend({method:V(`notifications/progress`),params:fg}),mg=Mh.extend({cursor:Oh.optional()}),hg=Fh.extend({params:mg.optional()}),gg=Rh.extend({nextCursor:Oh.optional()}),_g=B([`working`,`input_required`,`completed`,`failed`,`cancelled`]),vg=L({taskId:M(),status:_g,ttl:R([N(),Gf()]),createdAt:M(),lastUpdatedAt:M(),pollInterval:H(N()),statusMessage:H(M())}),yg=Rh.extend({task:vg}),bg=Ih.merge(vg),xg=Lh.extend({method:V(`notifications/tasks/status`),params:bg}),Sg=Fh.extend({method:V(`tasks/get`),params:Mh.extend({taskId:M()})}),Cg=Rh.merge(vg),wg=Fh.extend({method:V(`tasks/result`),params:Mh.extend({taskId:M()})});Rh.loose();var Tg=hg.extend({method:V(`tasks/list`)}),Eg=gg.extend({tasks:I(vg)}),Dg=Fh.extend({method:V(`tasks/cancel`),params:Mh.extend({taskId:M()})}),Og=Rh.merge(vg),kg=L({uri:M(),mimeType:H(M()),_meta:z(M(),F()).optional()}),Ag=kg.extend({text:M()}),jg=M().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),Mg=kg.extend({blob:jg}),Ng=B([`user`,`assistant`]),Pg=L({audience:I(Ng).optional(),priority:N().min(0).max(1).optional(),lastModified:Md({offset:!0}).optional()}),Fg=L({...$h.shape,...Qh.shape,uri:M(),description:H(M()),mimeType:H(M()),size:H(N()),annotations:Pg.optional(),_meta:H(Qf({}))}),Ig=L({...$h.shape,...Qh.shape,uriTemplate:M(),description:H(M()),mimeType:H(M()),annotations:Pg.optional(),_meta:H(Qf({}))}),Lg=hg.extend({method:V(`resources/list`)}),Rg=gg.extend({resources:I(Fg)}),zg=hg.extend({method:V(`resources/templates/list`)}),Bg=gg.extend({resourceTemplates:I(Ig)}),Vg=Mh.extend({uri:M()}),Hg=Vg,Ug=Fh.extend({method:V(`resources/read`),params:Hg}),Wg=Rh.extend({contents:I(R([Ag,Mg]))}),Gg=Lh.extend({method:V(`notifications/resources/list_changed`),params:Ih.optional()}),Kg=Vg,qg=Fh.extend({method:V(`resources/subscribe`),params:Kg}),Jg=Vg,Yg=Fh.extend({method:V(`resources/unsubscribe`),params:Jg}),Xg=Ih.extend({uri:M()}),Zg=Lh.extend({method:V(`notifications/resources/updated`),params:Xg}),Qg=L({name:M(),description:H(M()),required:H(P())}),$g=L({...$h.shape,...Qh.shape,description:H(M()),arguments:H(I(Qg)),_meta:H(Qf({}))}),e_=hg.extend({method:V(`prompts/list`)}),t_=gg.extend({prompts:I($g)}),n_=Mh.extend({name:M(),arguments:z(M(),M()).optional()}),r_=Fh.extend({method:V(`prompts/get`),params:n_}),i_=L({type:V(`text`),text:M(),annotations:Pg.optional(),_meta:z(M(),F()).optional()}),a_=L({type:V(`image`),data:jg,mimeType:M(),annotations:Pg.optional(),_meta:z(M(),F()).optional()}),o_=L({type:V(`audio`),data:jg,mimeType:M(),annotations:Pg.optional(),_meta:z(M(),F()).optional()}),s_=L({type:V(`tool_use`),name:M(),id:M(),input:z(M(),F()),_meta:z(M(),F()).optional()}),c_=L({type:V(`resource`),resource:R([Ag,Mg]),annotations:Pg.optional(),_meta:z(M(),F()).optional()}),l_=Fg.extend({type:V(`resource_link`)}),u_=R([i_,a_,o_,l_,c_]),d_=L({role:Ng,content:u_}),f_=Rh.extend({description:M().optional(),messages:I(d_)}),p_=Lh.extend({method:V(`notifications/prompts/list_changed`),params:Ih.optional()}),m_=L({title:M().optional(),readOnlyHint:P().optional(),destructiveHint:P().optional(),idempotentHint:P().optional(),openWorldHint:P().optional()}),h_=L({taskSupport:B([`required`,`optional`,`forbidden`]).optional()}),g_=L({...$h.shape,...Qh.shape,description:M().optional(),inputSchema:L({type:V(`object`),properties:z(M(),Eh).optional(),required:I(M()).optional()}).catchall(F()),outputSchema:L({type:V(`object`),properties:z(M(),Eh).optional(),required:I(M()).optional()}).catchall(F()).optional(),annotations:m_.optional(),execution:h_.optional(),_meta:z(M(),F()).optional()}),__=hg.extend({method:V(`tools/list`)}),v_=gg.extend({tools:I(g_)}),y_=Rh.extend({content:I(u_).default([]),structuredContent:z(M(),F()).optional(),isError:P().optional()});y_.or(Rh.extend({toolResult:F()}));var b_=Nh.extend({name:M(),arguments:z(M(),F()).optional()}),x_=Fh.extend({method:V(`tools/call`),params:b_}),S_=Lh.extend({method:V(`notifications/tools/list_changed`),params:Ih.optional()});L({autoRefresh:P().default(!0),debounceMs:N().int().nonnegative().default(300)});var C_=B([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),w_=Mh.extend({level:C_}),T_=Fh.extend({method:V(`logging/setLevel`),params:w_}),E_=Ih.extend({level:C_,logger:M().optional(),data:F()}),D_=Lh.extend({method:V(`notifications/message`),params:E_}),O_=L({hints:I(L({name:M().optional()})).optional(),costPriority:N().min(0).max(1).optional(),speedPriority:N().min(0).max(1).optional(),intelligencePriority:N().min(0).max(1).optional()}),k_=L({mode:B([`auto`,`required`,`none`]).optional()}),A_=L({type:V(`tool_result`),toolUseId:M().describe(`The unique identifier for the corresponding tool call.`),content:I(u_).default([]),structuredContent:L({}).loose().optional(),isError:P().optional(),_meta:z(M(),F()).optional()}),j_=ep(`type`,[i_,a_,o_]),M_=ep(`type`,[i_,a_,o_,s_,A_]),N_=L({role:Ng,content:R([M_,I(M_)]),_meta:z(M(),F()).optional()}),P_=Nh.extend({messages:I(N_),modelPreferences:O_.optional(),systemPrompt:M().optional(),includeContext:B([`none`,`thisServer`,`allServers`]).optional(),temperature:N().optional(),maxTokens:N().int(),stopSequences:I(M()).optional(),metadata:Eh.optional(),tools:I(g_).optional(),toolChoice:k_.optional()}),F_=Fh.extend({method:V(`sampling/createMessage`),params:P_}),I_=Rh.extend({model:M(),stopReason:H(B([`endTurn`,`stopSequence`,`maxTokens`]).or(M())),role:Ng,content:j_}),L_=Rh.extend({model:M(),stopReason:H(B([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(M())),role:Ng,content:R([M_,I(M_)])}),R_=L({type:V(`boolean`),title:M().optional(),description:M().optional(),default:P().optional()}),z_=L({type:V(`string`),title:M().optional(),description:M().optional(),minLength:N().optional(),maxLength:N().optional(),format:B([`email`,`uri`,`date`,`date-time`]).optional(),default:M().optional()}),B_=L({type:B([`number`,`integer`]),title:M().optional(),description:M().optional(),minimum:N().optional(),maximum:N().optional(),default:N().optional()}),V_=L({type:V(`string`),title:M().optional(),description:M().optional(),enum:I(M()),default:M().optional()}),H_=L({type:V(`string`),title:M().optional(),description:M().optional(),oneOf:I(L({const:M(),title:M()})),default:M().optional()}),U_=R([R([L({type:V(`string`),title:M().optional(),description:M().optional(),enum:I(M()),enumNames:I(M()).optional(),default:M().optional()}),R([V_,H_]),R([L({type:V(`array`),title:M().optional(),description:M().optional(),minItems:N().optional(),maxItems:N().optional(),items:L({type:V(`string`),enum:I(M())}),default:I(M()).optional()}),L({type:V(`array`),title:M().optional(),description:M().optional(),minItems:N().optional(),maxItems:N().optional(),items:L({anyOf:I(L({const:M(),title:M()}))}),default:I(M()).optional()})])]),R_,z_,B_]),W_=R([Nh.extend({mode:V(`form`).optional(),message:M(),requestedSchema:L({type:V(`object`),properties:z(M(),U_),required:I(M()).optional()})}),Nh.extend({mode:V(`url`),message:M(),elicitationId:M(),url:M().url()})]),G_=Fh.extend({method:V(`elicitation/create`),params:W_}),K_=Ih.extend({elicitationId:M()}),q_=Lh.extend({method:V(`notifications/elicitation/complete`),params:K_}),J_=Rh.extend({action:B([`accept`,`decline`,`cancel`]),content:Np(e=>e===null?void 0:e,z(M(),R([M(),N(),P(),I(M())])).optional())}),Y_=L({type:V(`ref/resource`),uri:M()}),X_=L({type:V(`ref/prompt`),name:M()}),Z_=Mh.extend({ref:R([X_,Y_]),argument:L({name:M(),value:M()}),context:L({arguments:z(M(),M()).optional()}).optional()}),Q_=Fh.extend({method:V(`completion/complete`),params:Z_}),$_=Rh.extend({completion:Qf({values:I(M()).max(100),total:H(N().int()),hasMore:H(P())})}),ev=L({uri:M().startsWith(`file://`),name:M().optional(),_meta:z(M(),F()).optional()}),tv=Fh.extend({method:V(`roots/list`),params:Mh.optional()}),nv=Rh.extend({roots:I(ev)}),rv=Lh.extend({method:V(`notifications/roots/list_changed`),params:Ih.optional()});R([ug,og,Q_,T_,r_,e_,Lg,zg,Ug,qg,Yg,x_,__,Sg,wg,Tg,Dg]),R([Zh,pg,lg,rv,xg]),R([Yh,I_,L_,J_,nv,Cg,Eg,yg]),R([ug,F_,G_,tv,Sg,wg,Tg,Dg]),R([Zh,pg,D_,Zg,Gg,S_,p_,xg,q_]),R([Yh,cg,$_,f_,t_,Rg,Bg,Wg,y_,v_,Cg,Eg,yg]);var q=class e extends Error{constructor(e,t,n){super(`MCP error ${e}: ${t}`),this.code=e,this.data=n,this.name=`McpError`}static fromError(t,n,r){if(t===K.UrlElicitationRequired&&r){let e=r;if(e.elicitations)return new iv(e.elicitations,n)}return new e(t,n,r)}},iv=class extends q{constructor(e,t=`URL elicitation${e.length>1?`s`:``} required`){super(K.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};function av(e){return e===`completed`||e===`failed`||e===`cancelled`}function ov(e){let t=Dd(e)?.method;if(!t)throw Error(`Schema is missing a method literal`);let n=Od(t);if(typeof n!=`string`)throw Error(`Schema method literal must be a string`);return n}function sv(e,t){let n=Ed(e,t);if(!n.success)throw n.error;return n.data}var cv=class{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(Zh,e=>{this._oncancel(e)}),this.setNotificationHandler(pg,e=>{this._onprogress(e)}),this.setRequestHandler(ug,e=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(Sg,async(e,t)=>{let n=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!n)throw new q(K.InvalidParams,`Failed to retrieve task: Task not found`);return{...n}}),this.setRequestHandler(wg,async(e,t)=>{let n=async()=>{let r=e.params.taskId;if(this._taskMessageQueue){let e;for(;e=await this._taskMessageQueue.dequeue(r,t.sessionId);){if(e.type===`response`||e.type===`error`){let t=e.message,n=t.id,r=this._requestResolvers.get(n);if(r)if(this._requestResolvers.delete(n),e.type===`response`)r(t);else{let e=t;r(new q(e.error.code,e.error.message,e.error.data))}else{let t=e.type===`response`?`Response`:`Error`;this._onerror(Error(`${t} handler missing for request ${n}`))}continue}await this._transport?.send(e.message,{relatedRequestId:t.requestId})}}let i=await this._taskStore.getTask(r,t.sessionId);if(!i)throw new q(K.InvalidParams,`Task not found: ${r}`);if(!av(i.status))return await this._waitForTaskUpdate(r,t.signal),await n();if(av(i.status)){let e=await this._taskStore.getTaskResult(r,t.sessionId);return this._clearTaskQueue(r),{...e,_meta:{...e._meta,[Th]:{taskId:r}}}}return await n()};return await n()}),this.setRequestHandler(Tg,async(e,t)=>{try{let{tasks:n,nextCursor:r}=await this._taskStore.listTasks(e.params?.cursor,t.sessionId);return{tasks:n,nextCursor:r,_meta:{}}}catch(e){throw new q(K.InvalidParams,`Failed to list tasks: ${e instanceof Error?e.message:String(e)}`)}}),this.setRequestHandler(Dg,async(e,t)=>{try{let n=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!n)throw new q(K.InvalidParams,`Task not found: ${e.params.taskId}`);if(av(n.status))throw new q(K.InvalidParams,`Cannot cancel task in terminal status: ${n.status}`);await this._taskStore.updateTaskStatus(e.params.taskId,`cancelled`,`Client cancelled task execution.`,t.sessionId),this._clearTaskQueue(e.params.taskId);let r=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!r)throw new q(K.InvalidParams,`Task not found after cancellation: ${e.params.taskId}`);return{_meta:{},...r}}catch(e){throw e instanceof q?e:new q(K.InvalidRequest,`Failed to cancel task: ${e instanceof Error?e.message:String(e)}`)}}))}async _oncancel(e){e.params.requestId&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,n,r,i=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:n,resetTimeoutOnProgress:i,onTimeout:r})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let n=Date.now()-t.startTime;if(t.maxTotalTimeout&&n>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),q.fromError(K.RequestTimeout,`Maximum total timeout exceeded`,{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:n});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw 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;let t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=e=>{n?.(e),this._onerror(e)};let r=this._transport?.onmessage;this._transport.onmessage=(e,t)=>{r?.(e,t),Gh(e)||qh(e)?this._onresponse(e):Vh(e)?this._onrequest(e,t):Uh(e)?this._onnotification(e):this._onerror(Error(`Unknown message type: ${JSON.stringify(e)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let e of this._timeoutInfo.values())clearTimeout(e.timeoutId);this._timeoutInfo.clear();for(let e of this._requestHandlerAbortControllers.values())e.abort();this._requestHandlerAbortControllers.clear();let t=q.fromError(K.ConnectionClosed,`Connection closed`);this._transport=void 0,this.onclose?.();for(let n of e.values())n(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){let t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(e=>this._onerror(Error(`Uncaught error in notification handler: ${e}`)))}_onrequest(e,t){let n=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,r=this._transport,i=e.params?._meta?.[Th]?.taskId;if(n===void 0){let t={jsonrpc:`2.0`,id:e.id,error:{code:K.MethodNotFound,message:`Method not found`}};i&&this._taskMessageQueue?this._enqueueTaskMessage(i,{type:`error`,message:t,timestamp:Date.now()},r?.sessionId).catch(e=>this._onerror(Error(`Failed to enqueue error response: ${e}`))):r?.send(t).catch(e=>this._onerror(Error(`Failed to send an error response: ${e}`)));return}let a=new AbortController;this._requestHandlerAbortControllers.set(e.id,a);let o=Ph(e.params)?e.params.task:void 0,s=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,c={signal:a.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async t=>{if(a.signal.aborted)return;let n={relatedRequestId:e.id};i&&(n.relatedTask={taskId:i}),await this.notification(t,n)},sendRequest:async(t,n,r)=>{if(a.signal.aborted)throw new q(K.ConnectionClosed,`Request was cancelled`);let o={...r,relatedRequestId:e.id};i&&!o.relatedTask&&(o.relatedTask={taskId:i});let c=o.relatedTask?.taskId??i;return c&&s&&await s.updateTaskStatus(c,`input_required`),await this.request(t,n,o)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:i,taskStore:s,taskRequestedTtl:o?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{o&&this.assertTaskHandlerCapability(e.method)}).then(()=>n(e,c)).then(async t=>{if(a.signal.aborted)return;let n={result:t,jsonrpc:`2.0`,id:e.id};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:`response`,message:n,timestamp:Date.now()},r?.sessionId):await r?.send(n)},async t=>{if(a.signal.aborted)return;let n={jsonrpc:`2.0`,id:e.id,error:{code:Number.isSafeInteger(t.code)?t.code:K.InternalError,message:t.message??`Internal error`,...t.data!==void 0&&{data:t.data}}};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:`error`,message:n,timestamp:Date.now()},r?.sessionId):await r?.send(n)}).catch(e=>this._onerror(Error(`Failed to send response: ${e}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===a&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:t,...n}=e.params,r=Number(t),i=this._progressHandlers.get(r);if(!i){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let a=this._responseHandlers.get(r),o=this._timeoutInfo.get(r);if(o&&a&&o.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(e){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),a(e);return}i(n)}_onresponse(e){let t=Number(e.id),n=this._requestResolvers.get(t);if(n){this._requestResolvers.delete(t),Gh(e)?n(e):n(new q(e.error.code,e.error.message,e.error.data));return}let r=this._responseHandlers.get(t);if(r===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let i=!1;if(Gh(e)&&e.result&&typeof e.result==`object`){let n=e.result;if(n.task&&typeof n.task==`object`){let e=n.task;typeof e.taskId==`string`&&(i=!0,this._taskProgressTokens.set(e.taskId,t))}}i||this._progressHandlers.delete(t),Gh(e)?r(e):r(q.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,n){let{task:r}=n??{};if(!r){try{yield{type:`result`,result:await this.request(e,t,n)}}catch(e){yield{type:`error`,error:e instanceof q?e:new q(K.InternalError,String(e))}}return}let i;try{let r=await this.request(e,yg,n);if(r.task)i=r.task.taskId,yield{type:`taskCreated`,task:r.task};else throw new q(K.InternalError,`Task creation did not return a task`);for(;;){let e=await this.getTask({taskId:i},n);if(yield{type:`taskStatus`,task:e},av(e.status)){e.status===`completed`?yield{type:`result`,result:await this.getTaskResult({taskId:i},t,n)}:e.status===`failed`?yield{type:`error`,error:new q(K.InternalError,`Task ${i} failed`)}:e.status===`cancelled`&&(yield{type:`error`,error:new q(K.InternalError,`Task ${i} was cancelled`)});return}if(e.status===`input_required`){yield{type:`result`,result:await this.getTaskResult({taskId:i},t,n)};return}let r=e.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(e=>setTimeout(e,r)),n?.signal?.throwIfAborted()}}catch(e){yield{type:`error`,error:e instanceof q?e:new q(K.InternalError,String(e))}}}request(e,t,n){let{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a,task:o,relatedTask:s}=n??{};return new Promise((c,l)=>{let u=e=>{l(e)};if(!this._transport){u(Error(`Not connected`));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),o&&this.assertTaskCapability(e.method)}catch(e){u(e);return}n?.signal?.throwIfAborted();let d=this._requestMessageId++,f={...e,jsonrpc:`2.0`,id:d};n?.onprogress&&(this._progressHandlers.set(d,n.onprogress),f.params={...e.params,_meta:{...e.params?._meta||{},progressToken:d}}),o&&(f.params={...f.params,task:o}),s&&(f.params={...f.params,_meta:{...f.params?._meta||{},[Th]:s}});let p=e=>{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(e)}},{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a}).catch(e=>this._onerror(Error(`Failed to send cancellation: ${e}`))),l(e instanceof q?e:new q(K.RequestTimeout,String(e)))};this._responseHandlers.set(d,e=>{if(!n?.signal?.aborted){if(e instanceof Error)return l(e);try{let n=Ed(t,e.result);n.success?c(n.data):l(n.error)}catch(e){l(e)}}}),n?.signal?.addEventListener(`abort`,()=>{p(n?.signal?.reason)});let m=n?.timeout??6e4;this._setupTimeout(d,m,n?.maxTotalTimeout,()=>p(q.fromError(K.RequestTimeout,`Request timed out`,{timeout:m})),n?.resetTimeoutOnProgress??!1);let ee=s?.taskId;ee?(this._requestResolvers.set(d,e=>{let t=this._responseHandlers.get(d);t?t(e):this._onerror(Error(`Response handler missing for side-channeled request ${d}`))}),this._enqueueTaskMessage(ee,{type:`request`,message:f,timestamp:Date.now()}).catch(e=>{this._cleanupTimeout(d),l(e)})):this._transport.send(f,{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a}).catch(e=>{this._cleanupTimeout(d),l(e)})})}async getTask(e,t){return this.request({method:`tasks/get`,params:e},Cg,t)}async getTaskResult(e,t,n){return this.request({method:`tasks/result`,params:e},t,n)}async listTasks(e,t){return this.request({method:`tasks/list`,params:e},Eg,t)}async cancelTask(e,t){return this.request({method:`tasks/cancel`,params:e},Og,t)}async notification(e,t){if(!this._transport)throw Error(`Not connected`);this.assertNotificationCapability(e.method);let n=t?.relatedTask?.taskId;if(n){let r={...e,jsonrpc:`2.0`,params:{...e.params,_meta:{...e.params?._meta||{},[Th]:t.relatedTask}}};await this._enqueueTaskMessage(n,{type:`notification`,message:r,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.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 n={...e,jsonrpc:`2.0`};t?.relatedTask&&(n={...n,params:{...n.params,_meta:{...n.params?._meta||{},[Th]:t.relatedTask}}}),this._transport?.send(n,t).catch(e=>this._onerror(e))});return}let r={...e,jsonrpc:`2.0`};t?.relatedTask&&(r={...r,params:{...r.params,_meta:{...r.params?._meta||{},[Th]:t.relatedTask}}}),await this._transport.send(r,t)}setRequestHandler(e,t){let n=ov(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(n,r)=>{let i=sv(e,n);return Promise.resolve(t(i,r))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){let n=ov(e);this._notificationHandlers.set(n,n=>{let r=sv(e,n);return Promise.resolve(t(r))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,n){if(!this._taskStore||!this._taskMessageQueue)throw Error(`Cannot enqueue task message: taskStore and taskMessageQueue are not configured`);let r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,n,r)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(e,t);for(let t of n)if(t.type===`request`&&Vh(t.message)){let n=t.message.id,r=this._requestResolvers.get(n);r?(r(new q(K.InternalError,`Task cancelled or completed`)),this._requestResolvers.delete(n)):this._onerror(Error(`Resolver missing for request ${n} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let n=this._options?.defaultTaskPollInterval??1e3;try{let t=await this._taskStore?.getTask(e);t?.pollInterval&&(n=t.pollInterval)}catch{}return new Promise((e,r)=>{if(t.aborted){r(new q(K.InvalidRequest,`Request cancelled`));return}let i=setTimeout(e,n);t.addEventListener(`abort`,()=>{clearTimeout(i),r(new q(K.InvalidRequest,`Request cancelled`))},{once:!0})})}requestTaskStore(e,t){let n=this._taskStore;if(!n)throw Error(`No task store configured`);return{createTask:async r=>{if(!e)throw Error(`No request provided`);return await n.createTask(r,e.id,{method:e.method,params:e.params},t)},getTask:async e=>{let r=await n.getTask(e,t);if(!r)throw new q(K.InvalidParams,`Failed to retrieve task: Task not found`);return r},storeTaskResult:async(e,r,i)=>{await n.storeTaskResult(e,r,i,t);let a=await n.getTask(e,t);if(a){let t=xg.parse({method:`notifications/tasks/status`,params:a});await this.notification(t),av(a.status)&&this._cleanupTaskProgressHandler(e)}},getTaskResult:e=>n.getTaskResult(e,t),updateTaskStatus:async(e,r,i)=>{let a=await n.getTask(e,t);if(!a)throw new q(K.InvalidParams,`Task "${e}" not found - it may have been cleaned up`);if(av(a.status))throw new q(K.InvalidParams,`Cannot update task "${e}" from terminal status "${a.status}" to "${r}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(e,r,i,t);let o=await n.getTask(e,t);if(o){let t=xg.parse({method:`notifications/tasks/status`,params:o});await this.notification(t),av(o.status)&&this._cleanupTaskProgressHandler(e)}},listTasks:e=>n.listTasks(e,t)}}};function lv(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function uv(e,t){let n={...e};for(let e in t){let r=e,i=t[r];if(i===void 0)continue;let a=n[r];lv(a)&&lv(i)?n[r]={...a,...i}:n[r]=i}return n}var dv=`modulepreload`,fv=function(e){return`/`+e},pv={},mv=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=fv(t,n),t in pv)return;pv[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:dv,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};wh(),(e=>typeof r<`u`?r:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof r<`u`?r:e)[t]}):e)(function(e){if(typeof r<`u`)return r.apply(this,arguments);throw Error(`Dynamic require of "`+e+`" is not supported`)});var hv=class extends cv{_registeredMethods=new Set;_eventSlots=new Map;onEventDispatch(e,t){}_ensureEventSlot(e){let t=this._eventSlots.get(e);if(!t){let n=this.eventSchemas[e];if(!n)throw Error(`Unknown event: ${String(e)}`);t={listeners:[]},this._eventSlots.set(e,t);let r=n.shape.method.value;this._registeredMethods.add(r);let i=t;super.setNotificationHandler(n,t=>{let n=t.params;this.onEventDispatch(e,n),i.onHandler?.(n);for(let e of[...i.listeners])e(n)})}return t}setEventHandler(e,t){let n=this._ensureEventSlot(e);n.onHandler&&t&&console.warn(`[MCP Apps] on${String(e)} handler replaced. Use addEventListener("${String(e)}", …) to add multiple listeners without replacing.`),n.onHandler=t}getEventHandler(e){return this._eventSlots.get(e)?.onHandler}addEventListener(e,t){this._ensureEventSlot(e).listeners.push(t)}removeEventListener(e,t){let n=this._eventSlots.get(e);if(!n)return;let r=n.listeners.indexOf(t);r!==-1&&n.listeners.splice(r,1)}setRequestHandler=(e,t)=>{this._assertMethodNotRegistered(e,`setRequestHandler`),super.setRequestHandler(e,t)};setNotificationHandler=(e,t)=>{this._assertMethodNotRegistered(e,`setNotificationHandler`),super.setNotificationHandler(e,t)};warnIfRequestHandlerReplaced(e,t,n){t&&n&&console.warn(`[MCP Apps] ${e} handler replaced. Previous handler will no longer be called.`)}replaceRequestHandler=(e,t)=>{let n=e.shape.method.value;this._registeredMethods.add(n),super.setRequestHandler(e,t)};_assertMethodNotRegistered(e,t){let n=e.shape.method.value;if(this._registeredMethods.has(n))throw Error(`Handler for "${n}" already registered (via ${t}). Use addEventListener() to attach multiple listeners, or the on* setter for replace semantics.`);this._registeredMethods.add(n)}},gv=`2026-01-26`,_v=class{eventTarget;eventSource;messageListener;constructor(e=window.parent,t){this.eventTarget=e,this.eventSource=t,this.messageListener=e=>{if(t&&e.source!==this.eventSource){console.debug(`Ignoring message from unknown source`,e);return}let n=Jh.safeParse(e.data);n.success?(console.debug(`Parsed message`,n.data),this.onmessage?.(n.data)):e.data?.jsonrpc===`2.0`?(console.error(`Failed to parse message`,n.error.message,e),this.onerror?.(Error(`Invalid JSON-RPC message received: `+n.error.message))):console.debug(`Ignoring non-JSON-RPC message`,n.error.message,e)}}async start(){window.addEventListener(`message`,this.messageListener)}async send(e,t){e.method!==`ui/notifications/tool-input-partial`&&console.debug(`Sending message`,e),this.eventTarget.postMessage(e,`*`)}async close(){window.removeEventListener(`message`,this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion},vv=R([V(`light`),V(`dark`)]).describe(`Color theme preference for the host environment.`),yv=R([V(`inline`),V(`fullscreen`),V(`pip`)]).describe(`Display mode for UI presentation.`),bv=z(R([V(`--color-background-primary`),V(`--color-background-secondary`),V(`--color-background-tertiary`),V(`--color-background-inverse`),V(`--color-background-ghost`),V(`--color-background-info`),V(`--color-background-danger`),V(`--color-background-success`),V(`--color-background-warning`),V(`--color-background-disabled`),V(`--color-text-primary`),V(`--color-text-secondary`),V(`--color-text-tertiary`),V(`--color-text-inverse`),V(`--color-text-ghost`),V(`--color-text-info`),V(`--color-text-danger`),V(`--color-text-success`),V(`--color-text-warning`),V(`--color-text-disabled`),V(`--color-border-primary`),V(`--color-border-secondary`),V(`--color-border-tertiary`),V(`--color-border-inverse`),V(`--color-border-ghost`),V(`--color-border-info`),V(`--color-border-danger`),V(`--color-border-success`),V(`--color-border-warning`),V(`--color-border-disabled`),V(`--color-ring-primary`),V(`--color-ring-secondary`),V(`--color-ring-inverse`),V(`--color-ring-info`),V(`--color-ring-danger`),V(`--color-ring-success`),V(`--color-ring-warning`),V(`--font-sans`),V(`--font-mono`),V(`--font-weight-normal`),V(`--font-weight-medium`),V(`--font-weight-semibold`),V(`--font-weight-bold`),V(`--font-text-xs-size`),V(`--font-text-sm-size`),V(`--font-text-md-size`),V(`--font-text-lg-size`),V(`--font-heading-xs-size`),V(`--font-heading-sm-size`),V(`--font-heading-md-size`),V(`--font-heading-lg-size`),V(`--font-heading-xl-size`),V(`--font-heading-2xl-size`),V(`--font-heading-3xl-size`),V(`--font-text-xs-line-height`),V(`--font-text-sm-line-height`),V(`--font-text-md-line-height`),V(`--font-text-lg-line-height`),V(`--font-heading-xs-line-height`),V(`--font-heading-sm-line-height`),V(`--font-heading-md-line-height`),V(`--font-heading-lg-line-height`),V(`--font-heading-xl-line-height`),V(`--font-heading-2xl-line-height`),V(`--font-heading-3xl-line-height`),V(`--border-radius-xs`),V(`--border-radius-sm`),V(`--border-radius-md`),V(`--border-radius-lg`),V(`--border-radius-xl`),V(`--border-radius-full`),V(`--border-width-regular`),V(`--shadow-hairline`),V(`--shadow-sm`),V(`--shadow-md`),V(`--shadow-lg`)]).describe(`CSS variable keys available to MCP apps for theming.`).describe(`Style variables for theming MCP apps.
1261
1261
 
1262
1262
  Individual style keys are optional - hosts may provide any subset of these values.
1263
1263
  Values are strings containing CSS values (colors, sizes, font stacks, etc.).
@@ -1303,7 +1303,7 @@ Boolean requesting whether a visible border and background is provided by the ho
1303
1303
  - omitted: host decides border`)}),L({method:V(`ui/request-display-mode`),params:L({mode:yv.describe(`The display mode being requested.`)})});var Fv=L({mode:yv.describe(`The display mode that was actually set. May differ from requested if not supported.`)}).passthrough(),Iv=R([V(`model`),V(`app`)]).describe(`Tool visibility scope - who can access the tool.`);L({resourceUri:M().optional(),visibility:I(Iv).optional().describe(`Who can access this tool. Default: ["model", "app"]
1304
1304
  - "model": Tool visible to and callable by the agent
1305
1305
  - "app": Tool callable by the app from this server only`),csp:qf().optional(),permissions:qf().optional()}),L({mimeTypes:I(M()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')}),L({method:V(`ui/download-file`),params:L({contents:I(R([c_,l_])).describe(`Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.`)})}),L({method:V(`ui/message`),params:L({role:V(`user`).describe(`Message role, currently only "user" is supported.`),content:I(u_).describe(`Message content blocks (text, image, etc.).`)})}),L({method:V(`ui/notifications/sandbox-resource-ready`),params:L({html:M().describe(`HTML content to load into the inner iframe.`),sandbox:M().optional().describe(`Optional override for the inner iframe's sandbox attribute.`),csp:wv.optional().describe(`CSP configuration from resource metadata.`),permissions:Tv.optional().describe(`Sandbox permissions from resource metadata.`)})});var Lv=L({method:V(`ui/notifications/tool-result`),params:y_.describe(`Standard MCP tool execution result.`)}),Rv=L({toolInfo:L({id:zh.optional().describe(`JSON-RPC id of the tools/call request.`),tool:g_.describe(`Tool definition including name, inputSchema, etc.`)}).optional().describe(`Metadata of the tool call that instantiated this App.`),theme:vv.optional().describe(`Current color theme preference.`),styles:Av.optional().describe(`Style configuration for theming the app.`),displayMode:yv.optional().describe(`How the UI is currently displayed.`),availableDisplayModes:I(yv).optional().describe(`Display modes the host supports.`),containerDimensions:R([L({height:N().describe(`Fixed container height in pixels.`)}),L({maxHeight:R([N(),Wf()]).optional().describe(`Maximum container height in pixels.`)})]).and(R([L({width:N().describe(`Fixed container width in pixels.`)}),L({maxWidth:R([N(),Wf()]).optional().describe(`Maximum container width in pixels.`)})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
1306
- container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:M().optional().describe(`User's language and region preference in BCP 47 format.`),timeZone:M().optional().describe(`User's timezone in IANA format.`),userAgent:M().optional().describe(`Host application identifier.`),platform:R([V(`web`),V(`desktop`),V(`mobile`)]).optional().describe(`Platform type for responsive design decisions.`),deviceCapabilities:L({touch:P().optional().describe(`Whether the device supports touch input.`),hover:P().optional().describe(`Whether the device supports hover interactions.`)}).optional().describe(`Device input capabilities.`),safeAreaInsets:L({top:N().describe(`Top safe area inset in pixels.`),right:N().describe(`Right safe area inset in pixels.`),bottom:N().describe(`Bottom safe area inset in pixels.`),left:N().describe(`Left safe area inset in pixels.`)}).optional().describe(`Mobile safe area boundaries in pixels.`)}).passthrough(),zv=L({method:V(`ui/notifications/host-context-changed`),params:Rv.describe(`Partial context update containing only changed fields.`)});L({method:V(`ui/update-model-context`),params:L({content:I(u_).optional().describe(`Context content blocks (text, image, etc.).`),structuredContent:z(M(),F().describe(`Structured content for machine-readable context data.`)).optional().describe(`Structured content for machine-readable context data.`)})}),L({method:V(`ui/initialize`),params:L({appInfo:eg.describe(`App identification (name and version).`),appCapabilities:Pv.describe(`Features and capabilities this app provides.`),protocolVersion:M().describe(`Protocol version this app supports.`)})});var Bv=L({protocolVersion:M().describe(`Negotiated protocol version string (e.g., "2025-11-21").`),hostInfo:eg.describe(`Host application identification and version.`),hostCapabilities:Nv.describe(`Features and capabilities provided by the host.`),hostContext:Rv.describe(`Rich context about the host environment.`)}).passthrough(),Vv={target:`draft-2020-12`};async function Hv(e,t){let n=e[`~standard`];if(n.jsonSchema)return n.jsonSchema[t](Vv);if(n.vendor===`zod`){let{z:n}=await mv(async()=>{let{z:e}=await Promise.resolve().then(()=>(wh(),Sh));return{z:e}},void 0);return n.toJSONSchema(e,{io:t})}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 Uv(e,t,n=``){let r=await e[`~standard`].validate(t);if(r.issues){let e=r.issues.map(e=>{let t=e.path?.map(e=>typeof e==`object`?e.key:e).join(`.`);return t?`${t}: ${e.message}`:e.message}).join(`; `);throw Error(n+e)}return r.value}var Wv=class e extends hv{_appInfo;_capabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_assertInitialized(e){if(this._initializedSent)return;let t=`[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(t);console.warn(`${t}. This will throw in a future release.`)}eventSchemas={toolinput:Ev,toolinputpartial:Dv,toolresult:Lv,toolcancelled:Ov,hostcontextchanged:zv};static ONE_SHOT_EVENTS=new Set([`toolinput`,`toolinputpartial`,`toolresult`,`toolcancelled`]);_everHadListener=new Set;_assertHandlerTiming(t){if(!e.ONE_SHOT_EVENTS.has(t)||this._everHadListener.has(t)||(this._everHadListener.add(t),!this._initializedSent))return;let n=`[ext-apps] "${String(t)}" 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,t){t&&this._assertHandlerTiming(e),super.setEventHandler(e,t)}addEventListener(e,t){this._assertHandlerTiming(e),super.addEventListener(e,t)}onEventDispatch(e,t){e===`hostcontextchanged`&&(this._hostContext={...this._hostContext,...t})}constructor(e,t={},n={autoResize:!0}){super(n),this._appInfo=e,this._capabilities=t,this.options=n,n.allowUnsafeEval||a({jitless:!0}),this.setRequestHandler(ug,e=>(console.log(`Received ping:`,e.params),{})),this.setEventHandler(`hostcontextchanged`,void 0)}registerCapabilities(e){if(this.transport)throw Error(`Cannot register capabilities after transport is established`);this._capabilities=uv(this._capabilities,e)}registerTool(e,t,n){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let r=this,i=()=>{r._initializedSent&&r._capabilities.tools?.listChanged&&r.sendToolListChanged()},a=t.inputSchema!==void 0,o={title:t.title,description:t.description,inputSchema:t.inputSchema,outputSchema:t.outputSchema,annotations:t.annotations,_meta:t._meta,enabled:!0,enable(){this.enabled=!0,i()},disable(){this.enabled=!1,i()},update(e){Object.assign(this,e),i()},remove(){r._registeredTools[e]===o&&(delete r._registeredTools[e],i())},handler:async(t,r)=>{if(!o.enabled)throw Error(`Tool ${e} is disabled`);let i;if(a){let a=o.inputSchema;i=await n(a?await Uv(a,t??{},`Invalid input for tool ${e}: `):t??{},r)}else i=await n(r);return o.outputSchema&&!i.isError&&(i.structuredContent=await Uv(o.outputSchema,i.structuredContent,`Invalid output for tool ${e}: `)),i}};return this._registeredTools[e]=o,!this._capabilities.tools&&!this.transport&&this.registerCapabilities({tools:{listChanged:!0}}),this.ensureToolHandlersInitialized(),i(),o}_toolHandlersInitialized=!1;ensureToolHandlersInitialized(){this._toolHandlersInitialized||(this._toolHandlersInitialized=!0,this.oncalltool=async(e,t)=>{let n=this._registeredTools[e.name];if(!n)throw Error(`Tool ${e.name} not found`);return n.handler(e.arguments,t)},this.onlisttools=async(e,t)=>({tools:await Promise.all(Object.entries(this._registeredTools).filter(([e,t])=>t.enabled).map(async([e,t])=>{let n={name:e,title:t.title,description:t.description,inputSchema:t.inputSchema?await Hv(t.inputSchema,`input`):{type:`object`,properties:{}}};return t.outputSchema&&(n.outputSchema=await Hv(t.outputSchema,`output`)),t.annotations&&(n.annotations=t.annotations),t._meta&&(n._meta=t._meta),n}))}))}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(jv,(e,t)=>{if(!this._onteardown)throw Error(`No onteardown handler set`);return this._onteardown(e.params,t)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(e){this.warnIfRequestHandlerReplaced(`oncalltool`,this._oncalltool,e),this._oncalltool=e,this.replaceRequestHandler(x_,(e,t)=>{if(!this._oncalltool)throw Error(`No oncalltool handler set`);return this._oncalltool(e.params,t)})}_onlisttools;get onlisttools(){return this._onlisttools}set onlisttools(e){this.warnIfRequestHandlerReplaced(`onlisttools`,this._onlisttools,e),this._onlisttools=e,this.replaceRequestHandler(__,(e,t)=>{if(!this._onlisttools)throw Error(`No onlisttools handler set`);return this._onlisttools(e.params,t)})}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,t){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},y_,{onprogress:()=>{},resetTimeoutOnProgress:!0,...t})}async readServerResource(e,t){return this._assertInitialized(`readServerResource`),await this.request({method:`resources/read`,params:e},Wg,t)}async listServerResources(e,t){return this._assertInitialized(`listServerResources`),await this.request({method:`resources/list`,params:e},Rg,t)}async createSamplingMessage(e,t){this._assertInitialized(`createSamplingMessage`);let n=e.tools?L_:I_;return await this.request({method:`sampling/createMessage`,params:e},n,t)}sendMessage(e,t){return this._assertInitialized(`sendMessage`),this.request({method:`ui/message`,params:e},Cv,t)}sendLog(e){return this.notification({method:`notifications/message`,params:e})}updateModelContext(e,t){return this._assertInitialized(`updateModelContext`),this.request({method:`ui/update-model-context`,params:e},Yh,t)}openLink(e,t){return this._assertInitialized(`openLink`),this.request({method:`ui/open-link`,params:e},xv,t)}sendOpenLink=this.openLink;downloadFile(e,t){return this._assertInitialized(`downloadFile`),this.request({method:`ui/download-file`,params:e},Sv,t)}requestTeardown(e={}){return this.notification({method:`ui/notifications/request-teardown`,params:e})}requestDisplayMode(e,t){return this._assertInitialized(`requestDisplayMode`),this.request({method:`ui/request-display-mode`,params:e},Fv,t)}sendSizeChanged(e){return this.notification({method:`ui/notifications/size-changed`,params:e})}setupSizeChangedNotifications(){let e=!1,t=0,n=0,r=()=>{e||(e=!0,requestAnimationFrame(()=>{e=!1;let r=document.documentElement,i=r.style.height;r.style.height=`max-content`;let a=Math.ceil(r.getBoundingClientRect().height);r.style.height=i;let o=Math.ceil(window.innerWidth);(o!==t||a!==n)&&(t=o,n=a,this.sendSizeChanged({width:o,height:a}))}))};r();let i=new ResizeObserver(r);return i.observe(document.documentElement),i.observe(document.body),()=>i.disconnect()}async connect(e=new _v(window.parent,window.parent),t){if(this.transport)throw Error(`App is already connected. Call close() before connecting again.`);this._initializedSent=!1,await super.connect(e);try{let e=await this.request({method:`ui/initialize`,params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:gv}},Bv,t);if(e===void 0)throw Error(`Server sent invalid initialize result: ${e}`);this._hostCapabilities=e.hostCapabilities,this._hostInfo=e.hostInfo,this._hostContext=e.hostContext,await this.notification({method:`ui/notifications/initialized`}),this._initializedSent=!0,this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(e){throw this.close(),e}}};function Gv(e){let t=new Date(e);return Number.isFinite(t.getTime())?`${t.toISOString().slice(0,19).replace(`T`,` `)} UTC`:typeof e==`number`?`${e} milliseconds since 1970-01-01T00:00:00Z`:e}function J(e,t,n){let r=document.createElement(e);return t&&(r.className=t),n!==void 0&&(r.textContent=n),r}function Kv(e,t,n=`primary`){let r=document.createElement(`button`);return r.type=`button`,r.className=n===`primary`?`ui-btn ui-btn--primary`:n===`danger`?`ui-btn ui-btn--danger`:`ui-btn`,r.textContent=e,r.addEventListener(`click`,t),r}function qv(e,t){let n=document.createElement(`a`);return n.className=`ui-link`,n.textContent=e,n.href=t,n}function Jv(e){let t=document.createElement(`input`);return t.className=`ui-input`,t.type=e.type??`text`,e.value!==void 0&&(t.value=e.value),e.placeholder!==void 0&&(t.placeholder=e.placeholder),e.id&&(t.id=e.id),e.name&&(t.name=e.name),t.autocomplete=`off`,t}function Yv(e,t){let n=document.createElement(`label`);return n.className=`ui-field`,n.append(J(`span`,void 0,e),t),n}function Xv(e){let t=document.createElement(`select`);t.className=`ui-select`;for(let n of e.choices){let r=document.createElement(`option`);r.value=n.value,r.textContent=n.label,e.value===n.value&&(r.selected=!0),t.append(r)}return e.id&&(t.id=e.id),e.name&&(t.name=e.name),e.onChange&&t.addEventListener(`change`,()=>e.onChange(t.value)),t}function Zv(e,t=!1){let n=document.createElement(`details`);n.className=`ui-accordion`,n.open=t;let r=document.createElement(`summary`);r.className=`ui-accordion-summary`,r.append(J(`span`,void 0,e));let i=J(`div`,`ui-accordion-body`);return n.append(r,i),{details:n,body:i}}function Qv(e){let t=J(`time`,void 0,Gv(e));return t.dateTime=e,t.title=e,t.setAttribute(`aria-label`,e),t}var $v=/^(?!.*(^(?!@)|[-.@])($|[-.@]))(?:[a-z0-9-]{0,63}(?:\.[a-z0-9-]{0,63})*)?@[a-z0-9-]{0,63}$/i,ey=/^(?!.*(^|[-.])($|[-.]))(?:[a-z0-9-]{0,63}\.)+sui$/i,ty=235;function ny(e){return e.length>ty?!1:e.includes(`@`)?$v.test(e):ey.test(e)}function ry(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`&&`BYTES_PER_ELEMENT`in e&&e.BYTES_PER_ELEMENT===1}function iy(e,t){return Array.isArray(t)?t.length===0?!0:e?t.every(e=>typeof e==`string`):t.every(e=>Number.isSafeInteger(e)):!1}function ay(e){if(typeof e!=`function`)throw TypeError(`function expected`);return!0}function oy(e,t){if(typeof t!=`string`)throw TypeError(`${e}: string expected`);return!0}function sy(e){if(typeof e!=`number`)throw TypeError(`number expected, got ${typeof e}`);if(!Number.isSafeInteger(e))throw RangeError(`invalid integer: ${e}`)}function cy(e){if(!Array.isArray(e))throw TypeError(`array expected`)}function ly(e,t){if(!iy(!0,t))throw TypeError(`${e}: array of strings expected`)}function uy(e,t){if(!iy(!1,t))throw TypeError(`${e}: array of numbers expected`)}function dy(...e){let t=e=>e,n=(e,t)=>n=>e(t(n));return{encode:e.map(e=>e.encode).reduceRight(n,t),decode:e.map(e=>e.decode).reduce(n,t)}}function fy(e){let t=typeof e==`string`?e.split(``):e,n=t.length;ly(`alphabet`,t);let r=new Map(t.map((e,t)=>[e,t]));return{encode:r=>(cy(r),r.map(r=>{if(!Number.isSafeInteger(r)||r<0||r>=n)throw Error(`alphabet.encode: digit index outside alphabet "${r}". Allowed: ${e}`);return t[r]})),decode:t=>(cy(t),t.map(t=>{oy(`alphabet.decode`,t);let n=r.get(t);if(n===void 0)throw Error(`Unknown letter: "${t}". Allowed: ${e}`);return n}))}}function py(e=``){return oy(`join`,e),{encode:t=>(ly(`join.decode`,t),t.join(e)),decode:t=>(oy(`join.decode`,t),t.split(e))}}function my(e,t=`=`){return sy(e),oy(`padding`,t),{encode(n){for(ly(`padding.encode`,n);n.length*e%8;)n.push(t);return n},decode(n){ly(`padding.decode`,n);let r=n.length;if(r*e%8)throw Error(`padding: invalid, string should have whole number of bytes`);for(;r>0&&n[r-1]===t;r--)if((r-1)*e%8==0)throw Error(`padding: invalid, string has too much padding`);return n.slice(0,r)}}}function hy(e){return ay(e),{encode:e=>e,decode:t=>e(t)}}function gy(e,t,n){if(t<2)throw RangeError(`convertRadix: invalid from=${t}, base cannot be less than 2`);if(n<2)throw RangeError(`convertRadix: invalid to=${n}, base cannot be less than 2`);if(cy(e),!e.length)return[];let r=0,i=[],a=Array.from(e,e=>{if(sy(e),e<0||e>=t)throw Error(`invalid integer: ${e}`);return e}),o=a.length;for(;;){let e=0,s=!0;for(let i=r;i<o;i++){let o=a[i],c=t*e,l=c+o;if(!Number.isSafeInteger(l)||c/t!==e||l-o!==c)throw Error(`convertRadix: carry overflow`);let u=l/n;e=l%n;let d=Math.floor(u);if(a[i]=d,!Number.isSafeInteger(d)||d*n+e!==l)throw Error(`convertRadix: carry overflow`);if(s)d?s=!1:r=i;else continue}if(i.push(e),s)break}for(let t=0;t<e.length-1&&e[t]===0;t++)i.push(0);return i.reverse()}var _y=(e,t)=>t===0?e:_y(t,e%t),vy=(e,t)=>e+(t-_y(e,t)),yy=(()=>{let e=[];for(let t=0;t<40;t++)e.push(2**t);return e})();function by(e,t,n,r){if(cy(e),t<=0||t>32)throw RangeError(`convertRadix2: wrong from=${t}`);if(n<=0||n>32)throw RangeError(`convertRadix2: wrong to=${n}`);if(vy(t,n)>32)throw Error(`convertRadix2: carry overflow from=${t} to=${n} carryBits=${vy(t,n)}`);let i=0,a=0,o=yy[t],s=yy[n]-1,c=[];for(let r of e){if(sy(r),r>=o)throw Error(`convertRadix2: invalid data word=${r} from=${t}`);if(i=i<<t|r,a+t>32)throw Error(`convertRadix2: carry overflow pos=${a} from=${t}`);for(a+=t;a>=n;a-=n)c.push((i>>a-n&s)>>>0);let e=yy[a];if(e===void 0)throw Error(`invalid carry`);i&=e-1}if(i=i<<n-a&s,!r&&a>=t)throw Error(`Excess padding`);if(!r&&i>0)throw Error(`Non-zero padding: ${i}`);return r&&a>0&&c.push(i>>>0),c}function xy(e){return sy(e),{encode:t=>{if(!ry(t))throw TypeError(`radix.encode input should be Uint8Array`);return gy(Array.from(t),256,e)},decode:t=>(uy(`radix.decode`,t),Uint8Array.from(gy(t,e,256)))}}function Sy(e,t=!1){if(sy(e),e<=0||e>32)throw RangeError(`radix2: bits should be in (0..32]`);if(vy(8,e)>32||vy(e,8)>32)throw RangeError(`radix2: carry overflow`);return{encode:n=>{if(!ry(n))throw TypeError(`radix2.encode input should be Uint8Array`);return by(Array.from(n),8,e,!t)},decode:n=>(uy(`radix2.decode`,n),Uint8Array.from(by(n,e,8,t)))}}function Cy(e){return ay(e),function(...t){try{return e.apply(null,t)}catch{}}}function wy(e,t){if(sy(e),e<=0)throw RangeError(`checksum length must be positive: ${e}`);ay(t);let n=t;return{encode(t){if(!ry(t))throw TypeError(`checksum.encode: input should be Uint8Array`);let r=n(t).slice(0,e),i=new Uint8Array(t.length+e);return i.set(t),i.set(r,t.length),i},decode(t){if(!ry(t))throw TypeError(`checksum.decode: input should be Uint8Array`);let r=t.slice(0,-e),i=t.slice(-e),a=n(r).slice(0,e);for(let t=0;t<e;t++)if(a[t]!==i[t])throw Error(`Invalid checksum`);return r}}}var Ty=Object.freeze({alphabet:fy,chain:dy,checksum:wy,convertRadix:gy,convertRadix2:by,radix:xy,radix2:Sy,join:py,padding:my});dy(Sy(4),fy(`0123456789ABCDEF`),py(``)),dy(Sy(5),fy(`ABCDEFGHIJKLMNOPQRSTUVWXYZ234567`),my(5),py(``)),dy(Sy(5),fy(`ABCDEFGHIJKLMNOPQRSTUVWXYZ234567`),py(``)),dy(Sy(5),fy(`0123456789ABCDEFGHIJKLMNOPQRSTUV`),my(5),py(``)),dy(Sy(5),fy(`0123456789ABCDEFGHIJKLMNOPQRSTUV`),py(``)),dy(Sy(5),fy(`0123456789ABCDEFGHJKMNPQRSTVWXYZ`),py(``),hy(e=>e.toUpperCase().replace(/O/g,`0`).replace(/[IL]/g,`1`)));var Ey=typeof Uint8Array.from([]).toBase64==`function`&&typeof Uint8Array.fromBase64==`function`;Ey||dy(Sy(6),fy(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`),my(6),py(``)),dy(Sy(6),fy(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`),py(``)),Ey||dy(Sy(6),fy(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`),my(6),py(``)),dy(Sy(6),fy(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`),py(``));var Dy=Object.freeze((e=>dy(xy(58),fy(e),py(``)))(`123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz`)),Oy=dy(fy(`qpzry9x8gf2tvdw0s3jn54khce6mua7l`),py(``)),ky=[996825010,642813549,513874426,1027748829,705979059];function Ay(e){let t=e>>25,n=(e&33554431)<<5;for(let e=0;e<ky.length;e++)(t>>e&1)==1&&(n^=ky[e]);return n}function jy(e,t,n=1){let r=e.length,i=1;for(let t=0;t<r;t++){let n=e.charCodeAt(t);if(n<33||n>126)throw Error(`Invalid prefix (${e})`);i=Ay(i)^n>>5}i=Ay(i);for(let t=0;t<r;t++)i=Ay(i)^e.charCodeAt(t)&31;for(let e of t)i=Ay(i)^e;for(let e=0;e<6;e++)i=Ay(i);return i^=n,Oy.encode(by([i%yy[30]],30,5,!1))}function My(e){let t=e===`bech32`?1:734539939,n=Sy(5),r=n.decode,i=n.encode,a=Cy(r);function o(e,n,r=90){oy(`bech32.encode prefix`,e),ry(n)&&(n=Array.from(n)),uy(`bech32.encode`,n);let i=e.length;if(i===0)throw TypeError(`Invalid prefix length ${i}`);let a=i+7+n.length;if(r!==!1&&a>r)throw TypeError(`Length ${a} exceeds limit ${r}`);let o=e.toLowerCase(),s=jy(o,n,t);return`${o}1${Oy.encode(n)}${s}`}function s(e,n=90){oy(`bech32.decode input`,e);let r=e.length;if(r<8||n!==!1&&r>n)throw TypeError(`invalid string length: ${r} (${e}). Expected (8..${n})`);let i=e.toLowerCase();if(e!==i&&e!==e.toUpperCase())throw Error(`String must be lowercase or uppercase`);let a=i.lastIndexOf(`1`);if(a===0||a===-1)throw Error(`Letter "1" must be present between prefix and data only`);let o=i.slice(0,a),s=i.slice(a+1);if(s.length<6)throw Error(`Data must be at least 6 characters long`);let c=Oy.decode(s).slice(0,-6),l=jy(o,c,t);if(!s.endsWith(l))throw Error(`Invalid checksum in ${e}: expected "${l}"`);return{prefix:o,words:c}}let c=Cy(s);function l(e){let{prefix:t,words:n}=s(e,!1);return{prefix:t,words:n,bytes:r(n)}}function u(e,t){return o(e,i(t))}return{encode:o,decode:s,encodeFromBytes:u,decodeToBytes:l,decodeUnsafe:c,fromWords:r,fromWordsUnsafe:a,toWords:i}}var Ny=Object.freeze(My(`bech32`));My(`bech32m`),``.isWellFormed,typeof Uint8Array.from([]).toHex==`function`&&typeof Uint8Array.fromHex==`function`||dy(Sy(4),fy(`0123456789abcdef`),py(``),hy(e=>{if(typeof e!=`string`||e.length%2!=0)throw TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()}));var Py=e=>Dy.decode(e);function Fy(e,t=[`<`,`>`]){let[n,r]=t,i=[],a=``,o=0;for(let t=0;t<e.length;t++){let s=e[t];if(s===n&&o++,s===r&&o--,o===0&&s===`,`){i.push(a.trim()),a=``;continue}a+=s}return i.push(a.trim()),i}var Iy=32;function Ly(e){try{return Py(e).length===Iy}catch{return!1}}function Ry(e){return Uy(e)&&Wy(e)===32}function zy(e){if(e.startsWith(`vector<`)){if(!e.endsWith(`>`))throw Error(`Invalid type tag: ${e}`);let t=e.slice(7,-1);if(!t)throw Error(`Invalid type tag: ${e}`);let n=zy(t);return typeof n==`string`?`vector<${n}>`:`vector<${Vy(n)}>`}return e.includes(`::`)?By(e):e}function By(e){let t=e.split(`::`);if(t.length<3)throw Error(`Invalid struct tag: ${e}`);let[n,r]=t;if(!n||!r)throw Error(`Invalid struct tag: ${e}`);let i=Yy(n),a=e.slice(n.length+r.length+4),o=a.includes(`<`)?a.slice(0,a.indexOf(`<`)):a;if(!o||a.includes(`<`)&&!a.endsWith(`>`))throw Error(`Invalid struct tag: ${e}`);let s=a.includes(`<`)?Fy(a.slice(a.indexOf(`<`)+1,a.lastIndexOf(`>`))).map(e=>zy(e.trim())):[];return{address:i?n:Hy(n),module:r,name:o,typeParams:s}}function Vy(e){if(typeof e==`string`&&e.startsWith(`vector<`))throw Error(`normalizeStructTag does not support vector types. Use normalizeTypeTag instead.`);let{address:t,module:n,name:r,typeParams:i}=typeof e==`string`?By(e):e;return`${t}::${n}::${r}${i?.length>0?`<${i.map(e=>typeof e==`string`?e:Vy(e)).join(`,`)}>`:``}`}function Hy(e,t=!1){let n=e.toLowerCase();return!t&&n.startsWith(`0x`)&&(n=n.slice(2)),`0x${n.padStart(64,`0`)}`}function Uy(e){return/^(0x|0X)?[a-fA-F0-9]+$/.test(e)&&e.length%2==0}function Wy(e){return/^(0x|0X)/.test(e)?(e.length-2)/2:e.length/2}var Gy=/^([a-z0-9]+(?:-[a-z0-9]+)*)$/,Ky=/^\d+$/,qy=64,Jy=`/`,Yy=e=>{let t=e.split(Jy);if(t.length<2||t.length>3)return!1;let[n,r,i]=t;return i!==void 0&&!Ky.test(i)||!ny(n)?!1:Gy.test(r)&&r.length<qy};function Xy(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`&&`BYTES_PER_ELEMENT`in e&&e.BYTES_PER_ELEMENT===1}function Zy(e,t,n=``){let r=Xy(e),i=e?.length,a=t!==void 0;if(!r||a&&i!==t){let o=n&&`"${n}" `,s=a?` of length ${t}`:``,c=r?`length=${i}`:`type=${typeof e}`,l=o+`expected Uint8Array`+s+`, got `+c;throw r?RangeError(l):TypeError(l)}return e}function Qy(e,t=!0){if(e.destroyed)throw Error(`Hash instance has been destroyed`);if(t&&e.finished)throw Error(`Hash#digest() has already been called`)}function $y(e,t){Zy(e,void 0,`digestInto() output`);let n=t.outputLen;if(e.length<n)throw RangeError(`"digestInto() output" expected to be of length >=`+n)}function eb(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function tb(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function nb(e,t){return e<<32-t|e>>>t}new Uint8Array(new Uint32Array([287454020]).buffer)[0],typeof Uint8Array.from([]).toHex==`function`&&Uint8Array.fromHex;function rb(e,t={}){let n=(t,n)=>e(n).update(t).digest(),r=e(void 0);return n.outputLen=r.outputLen,n.blockLen=r.blockLen,n.canXOF=r.canXOF,n.create=t=>e(t),Object.assign(n,t),Object.freeze(n)}var ib=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});function ab(e,t,n){return e&t^~e&n}function ob(e,t,n){return e&t^e&n^t&n}var sb=class{blockLen;outputLen;canXOF=!1;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(e,t,n,r){this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.buffer=new Uint8Array(e),this.view=tb(this.buffer)}update(e){Qy(this),Zy(e);let{view:t,buffer:n,blockLen:r}=this,i=e.length;for(let a=0;a<i;){let o=Math.min(r-this.pos,i-a);if(o===r){let t=tb(e);for(;r<=i-a;a+=r)this.process(t,a);continue}n.set(e.subarray(a,a+o),this.pos),this.pos+=o,a+=o,this.pos===r&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Qy(this),$y(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:r,isLE:i}=this,{pos:a}=this;t[a++]=128,eb(this.buffer.subarray(a)),this.padOffset>r-a&&(this.process(n,0),a=0);for(let e=a;e<r;e++)t[e]=0;n.setBigUint64(r-8,BigInt(this.length*8),i),this.process(n,0);let o=tb(e),s=this.outputLen;if(s%4)throw Error(`_sha2: outputLen must be aligned to 32bit`);let c=s/4,l=this.get();if(c>l.length)throw Error(`_sha2: outputLen bigger than state`);for(let e=0;e<c;e++)o.setUint32(4*e,l[e],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||=new this.constructor,e.set(...this.get());let{blockLen:t,buffer:n,length:r,finished:i,destroyed:a,pos:o}=this;return e.destroyed=a,e.finished=i,e.length=r,e.pos=o,r%t&&e.buffer.set(n),e}clone(){return this._cloneInto()}},cb=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),lb=BigInt(2**32-1),ub=BigInt(32);function db(e,t=!1){return t?{h:Number(e&lb),l:Number(e>>ub&lb)}:{h:Number(e>>ub&lb)|0,l:Number(e&lb)|0}}function fb(e,t=!1){let n=e.length,r=new Uint32Array(n),i=new Uint32Array(n);for(let a=0;a<n;a++){let{h:n,l:o}=db(e[a],t);[r[a],i[a]]=[n,o]}return[r,i]}var pb=`0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI`,mb=M().refine(Ry,`Expected a 32-byte Sui address`),hb=M().refine(Ly,`Expected a Sui transaction digest`);mb.transform(e=>Hy(e));var gb=`sui:mainnet`,_b=M().uuid(),vb=B([`process_start`,`sdk_start`,`session_restore`,`state_sync`]),yb=B([`initialization_failed`,`restoration_failed`,`wallet_state_unavailable`]),bb=ep(`status`,[L({status:V(`available`),walletRunId:_b}).strict(),L({status:V(`initializing`),walletRunId:_b,stage:vb,message:M()}).strict(),L({status:V(`recovering`),walletRunId:_b,message:M()}).strict(),L({status:V(`unavailable`),walletRunId:_b.optional(),reason:yb,message:M()}).strict()]),xb=ep(`status`,[L({status:V(`idle`)}).strict(),L({status:V(`waiting`)}).strict(),L({status:V(`unavailable`),reason:V(`wallet_unavailable`),message:M()}).strict()]),Sb=B([`awaiting_approval`,`connected`,`rejected`,`failed`,`expired`,`stopped`,`disconnected`]),Cb=L({connectionId:M().min(1),status:Sb,revision:N().int().nonnegative(),accounts:I(mb),methods:I(M()),chain:V(gb),createdAt:M().datetime(),updatedAt:M().datetime(),expiresAt:M().datetime(),walletName:M().optional(),reason:M().optional()}).strict(),wb=L({reason:V(`multiple_connections`),connectionIds:I(M().min(1)).min(2).refine(e=>new Set(e).size===e.length)}).strict(),Tb=ep(`status`,[L({status:V(`available`),account:mb}).strict(),L({status:V(`address_required`)}).strict()]),Eb=(1n<<64n)-1n,Db=/^(?:0|[1-9][0-9]*)$/,Ob=/^(?:0|-?[1-9][0-9]*)$/;function kb(e,t,n={}){if(!/^\d+$/.test(e))throw Error(`${t} must be an unsigned integer string`);let r=BigInt(e);if(n.positive&&r===0n)throw Error(`${t} must be positive`);if(r>Eb)throw Error(`${t} must fit u64`);return r}function Ab(e){let t=e===`rawAmount`?`amount`:e;return M().min(1).refine(t=>{try{return kb(t,e),!0}catch{return!1}},`Expected a raw u64 ${t} string`)}function jb(e,t,n={}){if(!Db.test(e))throw Error(`${t} must be a canonical unsigned integer string`);return kb(e,t,n)}function Mb(e){return M().min(1).refine(t=>{try{return jb(t,e),!0}catch{return!1}},`Expected an unsigned integer string`)}function Nb(e,t){if(!Ob.test(e))throw Error(`${t} must be a signed integer string`);return BigInt(e)}function Pb(e){return M().min(1).refine(t=>{try{return Nb(t,e),!0}catch{return!1}},`Expected a signed integer string`)}function Fb(e){return Vy(e)}var Ib=[`transaction`,`effects`,`balanceChanges`,`objectTypes`],Lb=M().refine(e=>{let t=new Date(e);return Number.isFinite(t.getTime())&&t.toISOString()===e},`Expected ISO 8601 UTC timestamp`),Rb=I(B(Ib)).length(Ib.length).superRefine((e,t)=>{for(let n of Ib)e.includes(n)||t.addIssue({code:`custom`,path:[],message:`chain receipt include is missing '${n}'`});new Set(e).size!==e.length&&t.addIssue({code:`custom`,path:[],message:`chain receipt include fields must not be duplicated`})}),zb=M().min(1).max(512).refine(e=>{try{return Fb(e),!0}catch{return!1}},`Expected a Sui struct tag coin type`),Bb=L({commandIndex:N().int().nonnegative(),packageId:mb,module:M().min(1).max(128),function:M().min(1).max(128),target:M().min(1).max(512)}).strict().superRefine((e,t)=>{let n=`${e.packageId}::${e.module}::${e.function}`;e.target!==n&&t.addIssue({code:`custom`,path:[`target`],message:`package call target must match packageId::module::function`})}),Vb=L({index:N().int().nonnegative(),coinType:zb,amountRaw:Pb(`accountBalanceChanges[].amountRaw`),direction:B([`increase`,`decrease`,`zero`])}).strict().superRefine((e,t)=>{let n=Nb(e.amountRaw,`accountBalanceChanges[].amountRaw`),r=n>0n?`increase`:n<0n?`decrease`:`zero`;e.direction!==r&&t.addIssue({code:`custom`,path:[`direction`],message:`balance change direction must match amountRaw sign`})}),Hb=ep(`success`,[L({success:V(!0),errorKind:qf().optional(),errorMessage:qf().optional()}).strict(),L({success:V(!1),errorKind:M().min(1).max(200).optional(),errorMessage:M().min(1).max(2e3).optional()}).strict()]),Ub=L({kind:V(`sui_chain_receipt_v1`),source:L({method:V(`client.core.getTransaction`),network:V(`sui:mainnet`),chainIdentifier:M().min(1),fetchedAt:Lb,include:Rb}).strict(),txDigest:hb,sender:mb,effectsStatus:Hb,packageCalls:I(Bb),accountBalanceChanges:I(Vb),objectTypes:z(mb,M().min(1).max(512))}).strict(),Wb=B([`awaiting_signature`,`submitting`,`awaiting_chain_result`,`stopped`,`request_failed`,`outcome_unknown`,`completed`]),Gb=L({reviewSessionId:M().min(1),attemptId:M().min(1),planId:M().min(1),status:B([`success`,`failure`]),txDigest:hb,chainReceipt:Ub,failureReason:V(`chain_execution_failed`).optional(),recordedAt:M().datetime()}).strict().superRefine((e,t)=>{(e.txDigest!==e.chainReceipt.txDigest||e.status===`success`!==e.chainReceipt.effectsStatus.success)&&t.addIssue({code:`custom`,message:`Execution must match the observed chain receipt.`}),e.status===`failure`!=(e.failureReason!==void 0)&&t.addIssue({code:`custom`,message:`Only a chain failure has a chain execution failure reason.`})}),Kb=L({attemptId:M().min(1),reviewSessionId:M().min(1),planId:M().min(1),reviewRevision:N().int().nonnegative(),account:mb,transactionDigest:hb,requestStatus:Wb,revision:N().int().nonnegative(),createdAt:M().datetime(),updatedAt:M().datetime(),signatureVerifiedAt:M().datetime().optional(),submittedAt:M().datetime().optional(),reason:M().optional(),execution:Gb.optional()}).strict().superRefine((e,t)=>{let n=e.execution;e.requestStatus===`completed`!=(n!==void 0)&&t.addIssue({code:`custom`,message:`Completed requests require an observed execution result.`}),n&&(n.attemptId!==e.attemptId||n.reviewSessionId!==e.reviewSessionId||n.planId!==e.planId||n.txDigest!==e.transactionDigest||n.chainReceipt.sender!==e.account)&&t.addIssue({code:`custom`,message:`Execution identity differs from the admitted request.`})}),qb=[`connect`,`disconnect`,`use_account`,`stop_connection`,`prepare_review`,`request_signature`,`cancel`,`stop_waiting`,`read_result`],Jb=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]),Yb=new Uint32Array(64),Xb=class extends sb{constructor(e){super(64,e,8,!1)}get(){let{A:e,B:t,C:n,D:r,E:i,F:a,G:o,H:s}=this;return[e,t,n,r,i,a,o,s]}set(e,t,n,r,i,a,o,s){this.A=e|0,this.B=t|0,this.C=n|0,this.D=r|0,this.E=i|0,this.F=a|0,this.G=o|0,this.H=s|0}process(e,t){for(let n=0;n<16;n++,t+=4)Yb[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=Yb[e-15],n=Yb[e-2],r=nb(t,7)^nb(t,18)^t>>>3;Yb[e]=(nb(n,17)^nb(n,19)^n>>>10)+Yb[e-7]+r+Yb[e-16]|0}let{A:n,B:r,C:i,D:a,E:o,F:s,G:c,H:l}=this;for(let e=0;e<64;e++){let t=nb(o,6)^nb(o,11)^nb(o,25),u=l+t+ab(o,s,c)+Jb[e]+Yb[e]|0,d=(nb(n,2)^nb(n,13)^nb(n,22))+ob(n,r,i)|0;l=c,c=s,s=o,o=a+u|0,a=i,i=r,r=n,n=u+d|0}n=n+this.A|0,r=r+this.B|0,i=i+this.C|0,a=a+this.D|0,o=o+this.E|0,s=s+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(n,r,i,a,o,s,c,l)}roundClean(){eb(Yb)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),eb(this.buffer)}},Zb=class extends Xb{A=cb[0]|0;B=cb[1]|0;C=cb[2]|0;D=cb[3]|0;E=cb[4]|0;F=cb[5]|0;G=cb[6]|0;H=cb[7]|0;constructor(){super(32)}},Qb=fb(`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`.split(`.`).map(e=>BigInt(e)));Qb[0],Qb[1];var $b=rb(()=>new Zb,ib(1));function ex(e){if(typeof e!=`string`)throw TypeError(`invalid mnemonic type: `+typeof e);return e.normalize(`NFKD`)}function tx(e){let t=ex(e),n=t.split(` `);if(![12,15,18,21,24].includes(n.length))throw Error(`Invalid mnemonic`);return{nfkd:t,words:n}}function nx(e){if(Zy(e),![16,20,24,28,32].includes(e.length))throw RangeError(`invalid entropy length`)}var rx=e=>{let t=8-e.length/4;return new Uint8Array([$b(e)[0]>>t<<t])};function ix(e){if(!Array.isArray(e)||e.length!==2048||typeof e[0]!=`string`)throw TypeError(`Wordlist: expected array of 2048 strings`);return e.forEach(e=>{if(typeof e!=`string`)throw TypeError(`wordlist: non-string element: `+e)}),Ty.chain(Ty.checksum(1,rx),Ty.radix2(11,!0),Ty.alphabet(e))}function ax(e,t){let{words:n}=tx(e),r=ix(t).decode(n);return nx(r),r}function ox(e,t){try{ax(e,t)}catch{return!1}return!0}var sx=Object.freeze(`abandon
1306
+ container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:M().optional().describe(`User's language and region preference in BCP 47 format.`),timeZone:M().optional().describe(`User's timezone in IANA format.`),userAgent:M().optional().describe(`Host application identifier.`),platform:R([V(`web`),V(`desktop`),V(`mobile`)]).optional().describe(`Platform type for responsive design decisions.`),deviceCapabilities:L({touch:P().optional().describe(`Whether the device supports touch input.`),hover:P().optional().describe(`Whether the device supports hover interactions.`)}).optional().describe(`Device input capabilities.`),safeAreaInsets:L({top:N().describe(`Top safe area inset in pixels.`),right:N().describe(`Right safe area inset in pixels.`),bottom:N().describe(`Bottom safe area inset in pixels.`),left:N().describe(`Left safe area inset in pixels.`)}).optional().describe(`Mobile safe area boundaries in pixels.`)}).passthrough(),zv=L({method:V(`ui/notifications/host-context-changed`),params:Rv.describe(`Partial context update containing only changed fields.`)});L({method:V(`ui/update-model-context`),params:L({content:I(u_).optional().describe(`Context content blocks (text, image, etc.).`),structuredContent:z(M(),F().describe(`Structured content for machine-readable context data.`)).optional().describe(`Structured content for machine-readable context data.`)})}),L({method:V(`ui/initialize`),params:L({appInfo:eg.describe(`App identification (name and version).`),appCapabilities:Pv.describe(`Features and capabilities this app provides.`),protocolVersion:M().describe(`Protocol version this app supports.`)})});var Bv=L({protocolVersion:M().describe(`Negotiated protocol version string (e.g., "2025-11-21").`),hostInfo:eg.describe(`Host application identification and version.`),hostCapabilities:Nv.describe(`Features and capabilities provided by the host.`),hostContext:Rv.describe(`Rich context about the host environment.`)}).passthrough(),Vv={target:`draft-2020-12`};async function Hv(e,t){let n=e[`~standard`];if(n.jsonSchema)return n.jsonSchema[t](Vv);if(n.vendor===`zod`){let{z:n}=await mv(async()=>{let{z:e}=await Promise.resolve().then(()=>(wh(),Sh));return{z:e}},void 0);return n.toJSONSchema(e,{io:t})}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 Uv(e,t,n=``){let r=await e[`~standard`].validate(t);if(r.issues){let e=r.issues.map(e=>{let t=e.path?.map(e=>typeof e==`object`?e.key:e).join(`.`);return t?`${t}: ${e.message}`:e.message}).join(`; `);throw Error(n+e)}return r.value}var Wv=class e extends hv{_appInfo;_capabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_assertInitialized(e){if(this._initializedSent)return;let t=`[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(t);console.warn(`${t}. This will throw in a future release.`)}eventSchemas={toolinput:Ev,toolinputpartial:Dv,toolresult:Lv,toolcancelled:Ov,hostcontextchanged:zv};static ONE_SHOT_EVENTS=new Set([`toolinput`,`toolinputpartial`,`toolresult`,`toolcancelled`]);_everHadListener=new Set;_assertHandlerTiming(t){if(!e.ONE_SHOT_EVENTS.has(t)||this._everHadListener.has(t)||(this._everHadListener.add(t),!this._initializedSent))return;let n=`[ext-apps] "${String(t)}" 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,t){t&&this._assertHandlerTiming(e),super.setEventHandler(e,t)}addEventListener(e,t){this._assertHandlerTiming(e),super.addEventListener(e,t)}onEventDispatch(e,t){e===`hostcontextchanged`&&(this._hostContext={...this._hostContext,...t})}constructor(e,t={},n={autoResize:!0}){super(n),this._appInfo=e,this._capabilities=t,this.options=n,n.allowUnsafeEval||a({jitless:!0}),this.setRequestHandler(ug,e=>(console.log(`Received ping:`,e.params),{})),this.setEventHandler(`hostcontextchanged`,void 0)}registerCapabilities(e){if(this.transport)throw Error(`Cannot register capabilities after transport is established`);this._capabilities=uv(this._capabilities,e)}registerTool(e,t,n){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let r=this,i=()=>{r._initializedSent&&r._capabilities.tools?.listChanged&&r.sendToolListChanged()},a=t.inputSchema!==void 0,o={title:t.title,description:t.description,inputSchema:t.inputSchema,outputSchema:t.outputSchema,annotations:t.annotations,_meta:t._meta,enabled:!0,enable(){this.enabled=!0,i()},disable(){this.enabled=!1,i()},update(e){Object.assign(this,e),i()},remove(){r._registeredTools[e]===o&&(delete r._registeredTools[e],i())},handler:async(t,r)=>{if(!o.enabled)throw Error(`Tool ${e} is disabled`);let i;if(a){let a=o.inputSchema;i=await n(a?await Uv(a,t??{},`Invalid input for tool ${e}: `):t??{},r)}else i=await n(r);return o.outputSchema&&!i.isError&&(i.structuredContent=await Uv(o.outputSchema,i.structuredContent,`Invalid output for tool ${e}: `)),i}};return this._registeredTools[e]=o,!this._capabilities.tools&&!this.transport&&this.registerCapabilities({tools:{listChanged:!0}}),this.ensureToolHandlersInitialized(),i(),o}_toolHandlersInitialized=!1;ensureToolHandlersInitialized(){this._toolHandlersInitialized||(this._toolHandlersInitialized=!0,this.oncalltool=async(e,t)=>{let n=this._registeredTools[e.name];if(!n)throw Error(`Tool ${e.name} not found`);return n.handler(e.arguments,t)},this.onlisttools=async(e,t)=>({tools:await Promise.all(Object.entries(this._registeredTools).filter(([e,t])=>t.enabled).map(async([e,t])=>{let n={name:e,title:t.title,description:t.description,inputSchema:t.inputSchema?await Hv(t.inputSchema,`input`):{type:`object`,properties:{}}};return t.outputSchema&&(n.outputSchema=await Hv(t.outputSchema,`output`)),t.annotations&&(n.annotations=t.annotations),t._meta&&(n._meta=t._meta),n}))}))}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(jv,(e,t)=>{if(!this._onteardown)throw Error(`No onteardown handler set`);return this._onteardown(e.params,t)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(e){this.warnIfRequestHandlerReplaced(`oncalltool`,this._oncalltool,e),this._oncalltool=e,this.replaceRequestHandler(x_,(e,t)=>{if(!this._oncalltool)throw Error(`No oncalltool handler set`);return this._oncalltool(e.params,t)})}_onlisttools;get onlisttools(){return this._onlisttools}set onlisttools(e){this.warnIfRequestHandlerReplaced(`onlisttools`,this._onlisttools,e),this._onlisttools=e,this.replaceRequestHandler(__,(e,t)=>{if(!this._onlisttools)throw Error(`No onlisttools handler set`);return this._onlisttools(e.params,t)})}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,t){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},y_,{onprogress:()=>{},resetTimeoutOnProgress:!0,...t})}async readServerResource(e,t){return this._assertInitialized(`readServerResource`),await this.request({method:`resources/read`,params:e},Wg,t)}async listServerResources(e,t){return this._assertInitialized(`listServerResources`),await this.request({method:`resources/list`,params:e},Rg,t)}async createSamplingMessage(e,t){this._assertInitialized(`createSamplingMessage`);let n=e.tools?L_:I_;return await this.request({method:`sampling/createMessage`,params:e},n,t)}sendMessage(e,t){return this._assertInitialized(`sendMessage`),this.request({method:`ui/message`,params:e},Cv,t)}sendLog(e){return this.notification({method:`notifications/message`,params:e})}updateModelContext(e,t){return this._assertInitialized(`updateModelContext`),this.request({method:`ui/update-model-context`,params:e},Yh,t)}openLink(e,t){return this._assertInitialized(`openLink`),this.request({method:`ui/open-link`,params:e},xv,t)}sendOpenLink=this.openLink;downloadFile(e,t){return this._assertInitialized(`downloadFile`),this.request({method:`ui/download-file`,params:e},Sv,t)}requestTeardown(e={}){return this.notification({method:`ui/notifications/request-teardown`,params:e})}requestDisplayMode(e,t){return this._assertInitialized(`requestDisplayMode`),this.request({method:`ui/request-display-mode`,params:e},Fv,t)}sendSizeChanged(e){return this.notification({method:`ui/notifications/size-changed`,params:e})}setupSizeChangedNotifications(){let e=!1,t=0,n=0,r=()=>{e||(e=!0,requestAnimationFrame(()=>{e=!1;let r=document.documentElement,i=r.style.height;r.style.height=`max-content`;let a=Math.ceil(r.getBoundingClientRect().height);r.style.height=i;let o=Math.ceil(window.innerWidth);(o!==t||a!==n)&&(t=o,n=a,this.sendSizeChanged({width:o,height:a}))}))};r();let i=new ResizeObserver(r);return i.observe(document.documentElement),i.observe(document.body),()=>i.disconnect()}async connect(e=new _v(window.parent,window.parent),t){if(this.transport)throw Error(`App is already connected. Call close() before connecting again.`);this._initializedSent=!1,await super.connect(e);try{let e=await this.request({method:`ui/initialize`,params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:gv}},Bv,t);if(e===void 0)throw Error(`Server sent invalid initialize result: ${e}`);this._hostCapabilities=e.hostCapabilities,this._hostInfo=e.hostInfo,this._hostContext=e.hostContext,await this.notification({method:`ui/notifications/initialized`}),this._initializedSent=!0,this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(e){throw this.close(),e}}};function Gv(e){let t=new Date(e);return Number.isFinite(t.getTime())?`${t.toISOString().slice(0,19).replace(`T`,` `)} UTC`:typeof e==`number`?`${e} milliseconds since 1970-01-01T00:00:00Z`:e}function Kv(e,t,n){let r=document.createElement(e);return t&&(r.className=t),n!==void 0&&(r.textContent=n),r}function qv(e,t,n=`primary`){let r=document.createElement(`button`);return r.type=`button`,r.className=n===`primary`?`ui-btn ui-btn--primary`:n===`danger`?`ui-btn ui-btn--danger`:`ui-btn`,r.textContent=e,r.addEventListener(`click`,t),r}function Jv(e,t){let n=document.createElement(`a`);return n.className=`ui-link`,n.textContent=e,n.href=t,n}function Yv(e){let t=document.createElement(`input`);return t.className=`ui-input`,t.type=e.type??`text`,e.value!==void 0&&(t.value=e.value),e.placeholder!==void 0&&(t.placeholder=e.placeholder),e.id&&(t.id=e.id),e.name&&(t.name=e.name),t.autocomplete=`off`,t}function Xv(e,t){let n=document.createElement(`label`);return n.className=`ui-field`,n.append(Kv(`span`,void 0,e),t),n}function Zv(e){let t=document.createElement(`select`);t.className=`ui-select`;for(let n of e.choices){let r=document.createElement(`option`);r.value=n.value,r.textContent=n.label,e.value===n.value&&(r.selected=!0),t.append(r)}return e.id&&(t.id=e.id),e.name&&(t.name=e.name),e.onChange&&t.addEventListener(`change`,()=>e.onChange(t.value)),t}function Qv(e,t=!1){let n=document.createElement(`details`);n.className=`ui-accordion`,n.open=t;let r=document.createElement(`summary`);r.className=`ui-accordion-summary`,r.append(Kv(`span`,void 0,e));let i=Kv(`div`,`ui-accordion-body`);return n.append(r,i),{details:n,body:i}}function $v(e){let t=Kv(`time`,void 0,Gv(e));return t.dateTime=e,t.title=e,t.setAttribute(`aria-label`,e),t}var ey=/^(?!.*(^(?!@)|[-.@])($|[-.@]))(?:[a-z0-9-]{0,63}(?:\.[a-z0-9-]{0,63})*)?@[a-z0-9-]{0,63}$/i,ty=/^(?!.*(^|[-.])($|[-.]))(?:[a-z0-9-]{0,63}\.)+sui$/i,ny=235;function ry(e){return e.length>ny?!1:e.includes(`@`)?ey.test(e):ty.test(e)}function iy(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`&&`BYTES_PER_ELEMENT`in e&&e.BYTES_PER_ELEMENT===1}function ay(e,t){return Array.isArray(t)?t.length===0?!0:e?t.every(e=>typeof e==`string`):t.every(e=>Number.isSafeInteger(e)):!1}function oy(e){if(typeof e!=`function`)throw TypeError(`function expected`);return!0}function sy(e,t){if(typeof t!=`string`)throw TypeError(`${e}: string expected`);return!0}function cy(e){if(typeof e!=`number`)throw TypeError(`number expected, got ${typeof e}`);if(!Number.isSafeInteger(e))throw RangeError(`invalid integer: ${e}`)}function ly(e){if(!Array.isArray(e))throw TypeError(`array expected`)}function uy(e,t){if(!ay(!0,t))throw TypeError(`${e}: array of strings expected`)}function dy(e,t){if(!ay(!1,t))throw TypeError(`${e}: array of numbers expected`)}function fy(...e){let t=e=>e,n=(e,t)=>n=>e(t(n));return{encode:e.map(e=>e.encode).reduceRight(n,t),decode:e.map(e=>e.decode).reduce(n,t)}}function py(e){let t=typeof e==`string`?e.split(``):e,n=t.length;uy(`alphabet`,t);let r=new Map(t.map((e,t)=>[e,t]));return{encode:r=>(ly(r),r.map(r=>{if(!Number.isSafeInteger(r)||r<0||r>=n)throw Error(`alphabet.encode: digit index outside alphabet "${r}". Allowed: ${e}`);return t[r]})),decode:t=>(ly(t),t.map(t=>{sy(`alphabet.decode`,t);let n=r.get(t);if(n===void 0)throw Error(`Unknown letter: "${t}". Allowed: ${e}`);return n}))}}function my(e=``){return sy(`join`,e),{encode:t=>(uy(`join.decode`,t),t.join(e)),decode:t=>(sy(`join.decode`,t),t.split(e))}}function hy(e,t=`=`){return cy(e),sy(`padding`,t),{encode(n){for(uy(`padding.encode`,n);n.length*e%8;)n.push(t);return n},decode(n){uy(`padding.decode`,n);let r=n.length;if(r*e%8)throw Error(`padding: invalid, string should have whole number of bytes`);for(;r>0&&n[r-1]===t;r--)if((r-1)*e%8==0)throw Error(`padding: invalid, string has too much padding`);return n.slice(0,r)}}}function gy(e){return oy(e),{encode:e=>e,decode:t=>e(t)}}function _y(e,t,n){if(t<2)throw RangeError(`convertRadix: invalid from=${t}, base cannot be less than 2`);if(n<2)throw RangeError(`convertRadix: invalid to=${n}, base cannot be less than 2`);if(ly(e),!e.length)return[];let r=0,i=[],a=Array.from(e,e=>{if(cy(e),e<0||e>=t)throw Error(`invalid integer: ${e}`);return e}),o=a.length;for(;;){let e=0,s=!0;for(let i=r;i<o;i++){let o=a[i],c=t*e,l=c+o;if(!Number.isSafeInteger(l)||c/t!==e||l-o!==c)throw Error(`convertRadix: carry overflow`);let u=l/n;e=l%n;let d=Math.floor(u);if(a[i]=d,!Number.isSafeInteger(d)||d*n+e!==l)throw Error(`convertRadix: carry overflow`);if(s)d?s=!1:r=i;else continue}if(i.push(e),s)break}for(let t=0;t<e.length-1&&e[t]===0;t++)i.push(0);return i.reverse()}var vy=(e,t)=>t===0?e:vy(t,e%t),yy=(e,t)=>e+(t-vy(e,t)),by=(()=>{let e=[];for(let t=0;t<40;t++)e.push(2**t);return e})();function xy(e,t,n,r){if(ly(e),t<=0||t>32)throw RangeError(`convertRadix2: wrong from=${t}`);if(n<=0||n>32)throw RangeError(`convertRadix2: wrong to=${n}`);if(yy(t,n)>32)throw Error(`convertRadix2: carry overflow from=${t} to=${n} carryBits=${yy(t,n)}`);let i=0,a=0,o=by[t],s=by[n]-1,c=[];for(let r of e){if(cy(r),r>=o)throw Error(`convertRadix2: invalid data word=${r} from=${t}`);if(i=i<<t|r,a+t>32)throw Error(`convertRadix2: carry overflow pos=${a} from=${t}`);for(a+=t;a>=n;a-=n)c.push((i>>a-n&s)>>>0);let e=by[a];if(e===void 0)throw Error(`invalid carry`);i&=e-1}if(i=i<<n-a&s,!r&&a>=t)throw Error(`Excess padding`);if(!r&&i>0)throw Error(`Non-zero padding: ${i}`);return r&&a>0&&c.push(i>>>0),c}function Sy(e){return cy(e),{encode:t=>{if(!iy(t))throw TypeError(`radix.encode input should be Uint8Array`);return _y(Array.from(t),256,e)},decode:t=>(dy(`radix.decode`,t),Uint8Array.from(_y(t,e,256)))}}function Cy(e,t=!1){if(cy(e),e<=0||e>32)throw RangeError(`radix2: bits should be in (0..32]`);if(yy(8,e)>32||yy(e,8)>32)throw RangeError(`radix2: carry overflow`);return{encode:n=>{if(!iy(n))throw TypeError(`radix2.encode input should be Uint8Array`);return xy(Array.from(n),8,e,!t)},decode:n=>(dy(`radix2.decode`,n),Uint8Array.from(xy(n,e,8,t)))}}function wy(e){return oy(e),function(...t){try{return e.apply(null,t)}catch{}}}function Ty(e,t){if(cy(e),e<=0)throw RangeError(`checksum length must be positive: ${e}`);oy(t);let n=t;return{encode(t){if(!iy(t))throw TypeError(`checksum.encode: input should be Uint8Array`);let r=n(t).slice(0,e),i=new Uint8Array(t.length+e);return i.set(t),i.set(r,t.length),i},decode(t){if(!iy(t))throw TypeError(`checksum.decode: input should be Uint8Array`);let r=t.slice(0,-e),i=t.slice(-e),a=n(r).slice(0,e);for(let t=0;t<e;t++)if(a[t]!==i[t])throw Error(`Invalid checksum`);return r}}}var Ey=Object.freeze({alphabet:py,chain:fy,checksum:Ty,convertRadix:_y,convertRadix2:xy,radix:Sy,radix2:Cy,join:my,padding:hy});fy(Cy(4),py(`0123456789ABCDEF`),my(``)),fy(Cy(5),py(`ABCDEFGHIJKLMNOPQRSTUVWXYZ234567`),hy(5),my(``)),fy(Cy(5),py(`ABCDEFGHIJKLMNOPQRSTUVWXYZ234567`),my(``)),fy(Cy(5),py(`0123456789ABCDEFGHIJKLMNOPQRSTUV`),hy(5),my(``)),fy(Cy(5),py(`0123456789ABCDEFGHIJKLMNOPQRSTUV`),my(``)),fy(Cy(5),py(`0123456789ABCDEFGHJKMNPQRSTVWXYZ`),my(``),gy(e=>e.toUpperCase().replace(/O/g,`0`).replace(/[IL]/g,`1`)));var Dy=typeof Uint8Array.from([]).toBase64==`function`&&typeof Uint8Array.fromBase64==`function`;Dy||fy(Cy(6),py(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`),hy(6),my(``)),fy(Cy(6),py(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`),my(``)),Dy||fy(Cy(6),py(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`),hy(6),my(``)),fy(Cy(6),py(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`),my(``));var Oy=Object.freeze((e=>fy(Sy(58),py(e),my(``)))(`123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz`)),ky=fy(py(`qpzry9x8gf2tvdw0s3jn54khce6mua7l`),my(``)),Ay=[996825010,642813549,513874426,1027748829,705979059];function jy(e){let t=e>>25,n=(e&33554431)<<5;for(let e=0;e<Ay.length;e++)(t>>e&1)==1&&(n^=Ay[e]);return n}function My(e,t,n=1){let r=e.length,i=1;for(let t=0;t<r;t++){let n=e.charCodeAt(t);if(n<33||n>126)throw Error(`Invalid prefix (${e})`);i=jy(i)^n>>5}i=jy(i);for(let t=0;t<r;t++)i=jy(i)^e.charCodeAt(t)&31;for(let e of t)i=jy(i)^e;for(let e=0;e<6;e++)i=jy(i);return i^=n,ky.encode(xy([i%by[30]],30,5,!1))}function Ny(e){let t=e===`bech32`?1:734539939,n=Cy(5),r=n.decode,i=n.encode,a=wy(r);function o(e,n,r=90){sy(`bech32.encode prefix`,e),iy(n)&&(n=Array.from(n)),dy(`bech32.encode`,n);let i=e.length;if(i===0)throw TypeError(`Invalid prefix length ${i}`);let a=i+7+n.length;if(r!==!1&&a>r)throw TypeError(`Length ${a} exceeds limit ${r}`);let o=e.toLowerCase(),s=My(o,n,t);return`${o}1${ky.encode(n)}${s}`}function s(e,n=90){sy(`bech32.decode input`,e);let r=e.length;if(r<8||n!==!1&&r>n)throw TypeError(`invalid string length: ${r} (${e}). Expected (8..${n})`);let i=e.toLowerCase();if(e!==i&&e!==e.toUpperCase())throw Error(`String must be lowercase or uppercase`);let a=i.lastIndexOf(`1`);if(a===0||a===-1)throw Error(`Letter "1" must be present between prefix and data only`);let o=i.slice(0,a),s=i.slice(a+1);if(s.length<6)throw Error(`Data must be at least 6 characters long`);let c=ky.decode(s).slice(0,-6),l=My(o,c,t);if(!s.endsWith(l))throw Error(`Invalid checksum in ${e}: expected "${l}"`);return{prefix:o,words:c}}let c=wy(s);function l(e){let{prefix:t,words:n}=s(e,!1);return{prefix:t,words:n,bytes:r(n)}}function u(e,t){return o(e,i(t))}return{encode:o,decode:s,encodeFromBytes:u,decodeToBytes:l,decodeUnsafe:c,fromWords:r,fromWordsUnsafe:a,toWords:i}}var Py=Object.freeze(Ny(`bech32`));Ny(`bech32m`),typeof Uint8Array.from([]).toHex==`function`&&typeof Uint8Array.fromHex==`function`||fy(Cy(4),py(`0123456789abcdef`),my(``),gy(e=>{if(typeof e!=`string`||e.length%2!=0)throw TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()}));var Fy=e=>Oy.decode(e);function Iy(e,t=[`<`,`>`]){let[n,r]=t,i=[],a=``,o=0;for(let t=0;t<e.length;t++){let s=e[t];if(s===n&&o++,s===r&&o--,o===0&&s===`,`){i.push(a.trim()),a=``;continue}a+=s}return i.push(a.trim()),i}var Ly=32;function Ry(e){try{return Fy(e).length===Ly}catch{return!1}}function zy(e){return Wy(e)&&Gy(e)===32}function By(e){if(e.startsWith(`vector<`)){if(!e.endsWith(`>`))throw Error(`Invalid type tag: ${e}`);let t=e.slice(7,-1);if(!t)throw Error(`Invalid type tag: ${e}`);let n=By(t);return typeof n==`string`?`vector<${n}>`:`vector<${Hy(n)}>`}return e.includes(`::`)?Vy(e):e}function Vy(e){let t=e.split(`::`);if(t.length<3)throw Error(`Invalid struct tag: ${e}`);let[n,r]=t;if(!n||!r)throw Error(`Invalid struct tag: ${e}`);let i=Xy(n),a=e.slice(n.length+r.length+4),o=a.includes(`<`)?a.slice(0,a.indexOf(`<`)):a;if(!o||a.includes(`<`)&&!a.endsWith(`>`))throw Error(`Invalid struct tag: ${e}`);let s=a.includes(`<`)?Iy(a.slice(a.indexOf(`<`)+1,a.lastIndexOf(`>`))).map(e=>By(e.trim())):[];return{address:i?n:Uy(n),module:r,name:o,typeParams:s}}function Hy(e){if(typeof e==`string`&&e.startsWith(`vector<`))throw Error(`normalizeStructTag does not support vector types. Use normalizeTypeTag instead.`);let{address:t,module:n,name:r,typeParams:i}=typeof e==`string`?Vy(e):e;return`${t}::${n}::${r}${i?.length>0?`<${i.map(e=>typeof e==`string`?e:Hy(e)).join(`,`)}>`:``}`}function Uy(e,t=!1){let n=e.toLowerCase();return!t&&n.startsWith(`0x`)&&(n=n.slice(2)),`0x${n.padStart(64,`0`)}`}function Wy(e){return/^(0x|0X)?[a-fA-F0-9]+$/.test(e)&&e.length%2==0}function Gy(e){return/^(0x|0X)/.test(e)?(e.length-2)/2:e.length/2}var Ky=/^([a-z0-9]+(?:-[a-z0-9]+)*)$/,qy=/^\d+$/,Jy=64,Yy=`/`,Xy=e=>{let t=e.split(Yy);if(t.length<2||t.length>3)return!1;let[n,r,i]=t;return i!==void 0&&!qy.test(i)||!ry(n)?!1:Ky.test(r)&&r.length<Jy};function Zy(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`&&`BYTES_PER_ELEMENT`in e&&e.BYTES_PER_ELEMENT===1}function Qy(e,t,n=``){let r=Zy(e),i=e?.length,a=t!==void 0;if(!r||a&&i!==t){let o=n&&`"${n}" `,s=a?` of length ${t}`:``,c=r?`length=${i}`:`type=${typeof e}`,l=o+`expected Uint8Array`+s+`, got `+c;throw r?RangeError(l):TypeError(l)}return e}function $y(e,t=!0){if(e.destroyed)throw Error(`Hash instance has been destroyed`);if(t&&e.finished)throw Error(`Hash#digest() has already been called`)}function eb(e,t){Qy(e,void 0,`digestInto() output`);let n=t.outputLen;if(e.length<n)throw RangeError(`"digestInto() output" expected to be of length >=`+n)}function tb(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function nb(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function rb(e,t){return e<<32-t|e>>>t}function ib(e,t={}){let n=(t,n)=>e(n).update(t).digest(),r=e(void 0);return n.outputLen=r.outputLen,n.blockLen=r.blockLen,n.canXOF=r.canXOF,n.create=t=>e(t),Object.assign(n,t),Object.freeze(n)}var ab=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});function ob(e,t,n){return e&t^~e&n}function sb(e,t,n){return e&t^e&n^t&n}var cb=class{blockLen;outputLen;canXOF=!1;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(e,t,n,r){this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.buffer=new Uint8Array(e),this.view=nb(this.buffer)}update(e){$y(this),Qy(e);let{view:t,buffer:n,blockLen:r}=this,i=e.length;for(let a=0;a<i;){let o=Math.min(r-this.pos,i-a);if(o===r){let t=nb(e);for(;r<=i-a;a+=r)this.process(t,a);continue}n.set(e.subarray(a,a+o),this.pos),this.pos+=o,a+=o,this.pos===r&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){$y(this),eb(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:r,isLE:i}=this,{pos:a}=this;t[a++]=128,tb(this.buffer.subarray(a)),this.padOffset>r-a&&(this.process(n,0),a=0);for(let e=a;e<r;e++)t[e]=0;n.setBigUint64(r-8,BigInt(this.length*8),i),this.process(n,0);let o=nb(e),s=this.outputLen;if(s%4)throw Error(`_sha2: outputLen must be aligned to 32bit`);let c=s/4,l=this.get();if(c>l.length)throw Error(`_sha2: outputLen bigger than state`);for(let e=0;e<c;e++)o.setUint32(4*e,l[e],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||=new this.constructor,e.set(...this.get());let{blockLen:t,buffer:n,length:r,finished:i,destroyed:a,pos:o}=this;return e.destroyed=a,e.finished=i,e.length=r,e.pos=o,r%t&&e.buffer.set(n),e}clone(){return this._cloneInto()}},lb=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ub=`0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI`;yh();var db=M().refine(zy,`Expected a 32-byte Sui address`),fb=M().refine(Ry,`Expected a Sui transaction digest`);db.transform(e=>Uy(e)),yh();var pb=(1n<<64n)-1n,mb=/^(?:0|[1-9][0-9]*)$/,hb=/^(?:0|-?[1-9][0-9]*)$/;function gb(e,t,n={}){if(!/^\d+$/.test(e))throw Error(`${t} must be an unsigned integer string`);let r=BigInt(e);if(n.positive&&r===0n)throw Error(`${t} must be positive`);if(r>pb)throw Error(`${t} must fit u64`);return r}function _b(e){let t=e===`rawAmount`?`amount`:e;return M().min(1).refine(t=>{try{return gb(t,e),!0}catch{return!1}},`Expected a raw u64 ${t} string`)}function vb(e,t,n={}){if(!mb.test(e))throw Error(`${t} must be a canonical unsigned integer string`);return gb(e,t,n)}function yb(e){return M().min(1).refine(t=>{try{return vb(t,e),!0}catch{return!1}},`Expected an unsigned integer string`)}function bb(e,t){if(!hb.test(e))throw Error(`${t} must be a signed integer string`);return BigInt(e)}function xb(e){return M().min(1).refine(t=>{try{return bb(t,e),!0}catch{return!1}},`Expected a signed integer string`)}function Sb(e){return Hy(e)}yh();var Cb=[`transaction`,`effects`,`balanceChanges`,`objectTypes`],wb=M().refine(e=>{let t=new Date(e);return Number.isFinite(t.getTime())&&t.toISOString()===e},`Expected ISO 8601 UTC timestamp`),Tb=I(B(Cb)).length(Cb.length).superRefine((e,t)=>{for(let n of Cb)e.includes(n)||t.addIssue({code:`custom`,path:[],message:`chain receipt include is missing '${n}'`});new Set(e).size!==e.length&&t.addIssue({code:`custom`,path:[],message:`chain receipt include fields must not be duplicated`})}),Eb=M().min(1).max(512).refine(e=>{try{return Sb(e),!0}catch{return!1}},`Expected a Sui struct tag coin type`),Db=L({commandIndex:N().int().nonnegative(),packageId:db,module:M().min(1).max(128),function:M().min(1).max(128),target:M().min(1).max(512)}).strict().superRefine((e,t)=>{let n=`${e.packageId}::${e.module}::${e.function}`;e.target!==n&&t.addIssue({code:`custom`,path:[`target`],message:`package call target must match packageId::module::function`})}),Ob=L({index:N().int().nonnegative(),coinType:Eb,amountRaw:xb(`accountBalanceChanges[].amountRaw`),direction:B([`increase`,`decrease`,`zero`])}).strict().superRefine((e,t)=>{let n=bb(e.amountRaw,`accountBalanceChanges[].amountRaw`),r=n>0n?`increase`:n<0n?`decrease`:`zero`;e.direction!==r&&t.addIssue({code:`custom`,path:[`direction`],message:`balance change direction must match amountRaw sign`})}),kb=ep(`success`,[L({success:V(!0),errorKind:qf().optional(),errorMessage:qf().optional()}).strict(),L({success:V(!1),errorKind:M().min(1).max(200).optional(),errorMessage:M().min(1).max(2e3).optional()}).strict()]),Ab=L({kind:V(`sui_chain_receipt_v1`),source:L({method:V(`client.core.getTransaction`),network:V(`sui:mainnet`),chainIdentifier:M().min(1),fetchedAt:wb,include:Tb}).strict(),txDigest:fb,sender:db,effectsStatus:kb,packageCalls:I(Db),accountBalanceChanges:I(Ob),objectTypes:z(db,M().min(1).max(512))}).strict();yh();var jb=B([`awaiting_signature`,`submitting`,`awaiting_chain_result`,`stopped`,`request_failed`,`outcome_unknown`,`completed`]),Mb=L({reviewSessionId:M().min(1),attemptId:M().min(1),planId:M().min(1),status:B([`success`,`failure`]),txDigest:fb,chainReceipt:Ab,failureReason:V(`chain_execution_failed`).optional(),recordedAt:M().datetime()}).strict().superRefine((e,t)=>{(e.txDigest!==e.chainReceipt.txDigest||e.status===`success`!==e.chainReceipt.effectsStatus.success)&&t.addIssue({code:`custom`,message:`Execution must match the observed chain receipt.`}),e.status===`failure`!=(e.failureReason!==void 0)&&t.addIssue({code:`custom`,message:`Only a chain failure has a chain execution failure reason.`})}),Nb=L({attemptId:M().min(1),reviewSessionId:M().min(1),planId:M().min(1),reviewRevision:N().int().nonnegative(),account:db,transactionDigest:fb,requestStatus:jb,revision:N().int().nonnegative(),createdAt:M().datetime(),updatedAt:M().datetime(),signatureVerifiedAt:M().datetime().optional(),submittedAt:M().datetime().optional(),reason:M().optional(),execution:Mb.optional()}).strict().superRefine((e,t)=>{let n=e.execution;e.requestStatus===`completed`!=(n!==void 0)&&t.addIssue({code:`custom`,message:`Completed requests require an observed execution result.`}),n&&(n.attemptId!==e.attemptId||n.reviewSessionId!==e.reviewSessionId||n.planId!==e.planId||n.txDigest!==e.transactionDigest||n.chainReceipt.sender!==e.account)&&t.addIssue({code:`custom`,message:`Execution identity differs from the admitted request.`})});yh();var Pb=`sui:mainnet`,Fb=M().uuid(),Ib=B([`process_start`,`sdk_start`,`session_restore`,`state_sync`]),Lb=B([`initialization_failed`,`restoration_failed`,`wallet_state_unavailable`]),Rb=ep(`status`,[L({status:V(`available`),walletRunId:Fb}).strict(),L({status:V(`initializing`),walletRunId:Fb,stage:Ib,message:M()}).strict(),L({status:V(`recovering`),walletRunId:Fb,message:M()}).strict(),L({status:V(`unavailable`),walletRunId:Fb.optional(),reason:Lb,message:M()}).strict()]),zb=ep(`status`,[L({status:V(`idle`)}).strict(),L({status:V(`waiting`)}).strict(),L({status:V(`unavailable`),reason:V(`wallet_unavailable`),message:M()}).strict()]),Bb=B([`awaiting_approval`,`connected`,`rejected`,`failed`,`expired`,`stopped`,`disconnected`]);L({runId:M().uuid(),connections:I(L({connectionId:M().min(1),revision:N().int().nonnegative(),status:Bb,accounts:I(db),walletName:M().optional(),sdkPending:P(),disconnectPending:P()}).strict()),preparations:I(L({id:M().min(1),revision:N().int().nonnegative(),review_revision:N().int().nonnegative(),preparation_id:M().nullable(),wallet_connection_id:M().nullable()}).strict()),requests:I(L({attempt_id:M().min(1),revision:N().int().nonnegative(),request_status:jb,can_submit:N().int().min(0).max(1),sdk_pending:N().int().min(0).max(1),submit_pending:N().int().min(0).max(1),lookup_pending:N().int().min(0).max(1)}).strict())}).strict();var Vb=L({connectionId:M().min(1),status:Bb,revision:N().int().nonnegative(),accounts:I(db),methods:I(M()),chain:V(Pb),createdAt:M().datetime(),updatedAt:M().datetime(),expiresAt:M().datetime(),walletName:M().optional(),reason:M().optional()}).strict(),Hb=L({reason:V(`multiple_connections`),connectionIds:I(M().min(1)).min(2).refine(e=>new Set(e).size===e.length)}).strict(),Ub=ep(`status`,[L({status:V(`available`),account:db}).strict(),L({status:V(`address_required`)}).strict()]),Wb=[`connect`,`disconnect`,`use_account`,`stop_connection`,`prepare_review`,`request_signature`,`cancel`,`stop_waiting`,`read_result`],Gb=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]),Kb=new Uint32Array(64),qb=class extends cb{constructor(e){super(64,e,8,!1)}get(){let{A:e,B:t,C:n,D:r,E:i,F:a,G:o,H:s}=this;return[e,t,n,r,i,a,o,s]}set(e,t,n,r,i,a,o,s){this.A=e|0,this.B=t|0,this.C=n|0,this.D=r|0,this.E=i|0,this.F=a|0,this.G=o|0,this.H=s|0}process(e,t){for(let n=0;n<16;n++,t+=4)Kb[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=Kb[e-15],n=Kb[e-2],r=rb(t,7)^rb(t,18)^t>>>3;Kb[e]=(rb(n,17)^rb(n,19)^n>>>10)+Kb[e-7]+r+Kb[e-16]|0}let{A:n,B:r,C:i,D:a,E:o,F:s,G:c,H:l}=this;for(let e=0;e<64;e++){let t=rb(o,6)^rb(o,11)^rb(o,25),u=l+t+ob(o,s,c)+Gb[e]+Kb[e]|0,d=(rb(n,2)^rb(n,13)^rb(n,22))+sb(n,r,i)|0;l=c,c=s,s=o,o=a+u|0,a=i,i=r,r=n,n=u+d|0}n=n+this.A|0,r=r+this.B|0,i=i+this.C|0,a=a+this.D|0,o=o+this.E|0,s=s+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(n,r,i,a,o,s,c,l)}roundClean(){tb(Kb)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),tb(this.buffer)}},Jb=class extends qb{A=lb[0]|0;B=lb[1]|0;C=lb[2]|0;D=lb[3]|0;E=lb[4]|0;F=lb[5]|0;G=lb[6]|0;H=lb[7]|0;constructor(){super(32)}},Yb=ib(()=>new Jb,ab(1));function Xb(e){if(typeof e!=`string`)throw TypeError(`invalid mnemonic type: `+typeof e);return e.normalize(`NFKD`)}function Zb(e){let t=Xb(e),n=t.split(` `);if(![12,15,18,21,24].includes(n.length))throw Error(`Invalid mnemonic`);return{nfkd:t,words:n}}function Qb(e){if(Qy(e),![16,20,24,28,32].includes(e.length))throw RangeError(`invalid entropy length`)}var $b=e=>{let t=8-e.length/4;return new Uint8Array([Yb(e)[0]>>t<<t])};function ex(e){if(!Array.isArray(e)||e.length!==2048||typeof e[0]!=`string`)throw TypeError(`Wordlist: expected array of 2048 strings`);return e.forEach(e=>{if(typeof e!=`string`)throw TypeError(`wordlist: non-string element: `+e)}),Ey.chain(Ey.checksum(1,$b),Ey.radix2(11,!0),Ey.alphabet(e))}function tx(e,t){let{words:n}=Zb(e),r=ex(t).decode(n);return Qb(r),r}function nx(e,t){try{tx(e,t)}catch{return!1}return!0}var rx=Object.freeze(`abandon
1307
1307
  ability
1308
1308
  able
1309
1309
  about
@@ -3351,4 +3351,4 @@ zebra
3351
3351
  zero
3352
3352
  zone
3353
3353
  zoo`.split(`
3354
- `)),cx={0:`ED25519`,1:`Secp256k1`,2:`Secp256r1`,3:`MultiSig`,5:`ZkLogin`,6:`Passkey`};function lx(e){let{prefix:t,words:n}=Ny.decode(e);if(t!==`suiprivkey`)throw Error(`invalid private key prefix`);let r=new Uint8Array(Ny.fromWords(n)),i=r.slice(1);return{scheme:cx[r[0]],secretKey:i}}var ux=`external-proposal-alpha-2026-05-25`,dx=`proposal-review-model-alpha-2026-05-25`,fx=M().refine(e=>{let t=new Date(e);return!Number.isNaN(t.getTime())&&t.toISOString()===e},`Expected ISO 8601 UTC timestamp`),px=/transaction\s*bytes?|transactionBytes|tx\s*bytes?|serialized\s*transaction|serializedTransaction|signed\s*transaction|signing\s*request|signingRequest|wallet\s*authorization|walletAuthorization|private\s*key|privateKey|secret\s*key|secretKey|seed\s*phrase|mnemonic|suiprivkey|signature|route[-_\s]*selected|routeSelectedPlan|bcs\s*transaction|programmable\s*transaction/i,mx=/(?:0x[0-9a-fA-F]{160,}|[A-Za-z0-9+/_=-]{160,})/,hx=/suiprivkey1[023456789acdefghjklmnpqrstuvwxyz]+/gi,gx=/(^|[^0-9a-fA-F])(?:0x)?[0-9a-fA-F]{64}($|[^0-9a-fA-F])/,_x=/(^|[^A-Za-z0-9+/_=-])(?:[A-Za-z0-9+/]{43}=|[A-Za-z0-9+/]{44}|[A-Za-z0-9_-]{43,44})($|[^A-Za-z0-9+/_=-])/,vx=/^(?:0|[1-9][0-9]*)(?:\.[0-9]+)?$/,yx=[12,15,18,21,24];function bx(e,t,n={}){return M().min(1).max(e).superRefine((e,r)=>{(px.test(e)||mx.test(e)||Sx(e)||Cx(e)||!n.allowRawSecretLikeText&&wx(e))&&r.addIssue({code:`custom`,message:`${t} must not contain executable, signing, private-key, mnemonic, route-selected, or encoded secret-like material`})})}function xx(e,t){return bx(e,t,{allowRawSecretLikeText:!0})}function Sx(e){return(e.match(hx)??[]).some(e=>{try{return lx(e.toLowerCase()),!0}catch{return e.toLowerCase().startsWith(`suiprivkey1`)}})}function Cx(e){let t=e.normalize(`NFKD`).toLowerCase().replace(/[^a-z]+/g,` `).trim().split(/\s+/).filter(Boolean);for(let e of yx)if(!(t.length<e)){for(let n=0;n<=t.length-e;n+=1)if(ox(t.slice(n,n+e).join(` `),sx))return!0}return!1}function wx(e){return gx.test(e)||_x.test(e)}var Tx=bx(80,`amountDisplay`).refine(e=>vx.test(e)&&/[1-9]/.test(e),{message:`Expected a positive decimal display amount`}),Ex=L({kind:B([`mcp_server`,`ai_client`,`user`,`other`]),name:bx(120,`source.name`),reference:bx(256,`source.reference`).optional()}).strict(),Dx=L({address:mb.optional(),label:bx(120,`party.label`).optional()}).strict().refine(e=>e.address!==void 0||e.label!==void 0,{message:`Expected address or label`}),Ox=L({amountDisplay:Tx,amountKind:V(`display_proposal`).default(`display_proposal`),symbol:bx(64,`amount.symbol`).optional(),coinType:xx(512,`amount.coinType`).optional(),denomination:bx(64,`amount.denomination`).optional()}).strict(),kx=L({packageId:xx(128,`action.target.packageId`).optional(),module:bx(128,`action.target.module`).optional(),function:bx(128,`action.target.function`).optional(),objectId:xx(128,`action.target.objectId`).optional(),label:bx(120,`action.target.label`).optional()}).strict().refine(e=>e.packageId!==void 0||e.module!==void 0||e.function!==void 0||e.objectId!==void 0||e.label!==void 0,{message:`Expected at least one action target field`}),Ax=L({direction:B([`outgoing`,`expected_incoming`,`fee`]),amount:Ox,recipient:Dx.optional(),description:bx(512,`assetFlow.description`).optional()}).strict(),jx=L({id:bx(120,`proposal.id`),source:Ex,network:V(`sui:mainnet`),createdAt:fx,expiresAt:fx.optional(),purpose:bx(512,`purpose`),assumptions:I(bx(512,`assumptions[]`)).max(20).optional(),requiredUserChoices:I(bx(512,`requiredUserChoices[]`)).max(20).optional()}).strict(),Mx=ep(`type`,[jx.extend({type:V(`payment`),payment:L({amount:Ox,recipient:Dx,target:bx(512,`payment.target`).optional()}).strict()}).strict(),jx.extend({type:V(`sui_action`),action:L({actionKind:bx(120,`action.actionKind`),target:kx,recipient:Dx.optional(),assetFlow:I(Ax).max(20).optional()}).strict()}).strict()]),Nx=L({id:M(),label:M(),status:B([`pass`,`warning`,`fail`]),message:M(),source:B([`proposal`,`adapter`,`registry`,`quote`,`wallet`,`simulation`,`network`])}).strict(),Px=L({id:M(),label:M(),reason:M()}).strict(),Fx=L({modelVersion:V(dx),contractVersion:V(ux),proposalId:M(),proposalType:B([`payment`,`sui_action`]),proposalSource:Ex,proposedAction:L({kind:B([`payment`,`sui_action`]),title:M(),purpose:M(),network:V(`sui:mainnet`),recipient:Dx.optional(),target:R([M(),kx]).optional()}).strict(),assetFlow:L({outgoing:I(Ox),expectedIncoming:I(Ox),fees:I(Ox)}).strict(),recipients:I(Dx),targets:I(R([M(),kx])),evidenceUsed:I(L({id:M(),label:M(),source:B([`external_proposal`,`local_schema`]),summary:M()}).strict()),missingEvidence:I(Px),requiredUserChoices:I(Px),unsupportedClaims:I(L({id:M(),label:M(),reason:M()}).strict()),rejectedExecutableFields:I(L({fieldName:M(),reason:M()}).strict()),freshness:L({proposalCreatedAt:fx,proposalExpiresAt:fx.optional(),evaluatedAt:fx,status:B([`current`,`expired`,`created_in_future`,`expiry_not_provided`]),reason:M()}).strict(),blockingChecks:I(Nx),nonSignableReason:L({code:V(`external_proposal_review_only`),message:M(),blockedCapabilities:I(M())}).strict()}).strict();L({requestedIntent:Mx,implementationStatus:V(`read_only_review_only`),contractVersion:V(ux)}).strict();var Ix=[`adapter_not_implemented`,`producer_stage_missing`,`wallet_review_contract_emit_missing`,`network_mismatch`,`insufficient_balance`,`insufficient_gas`,`allowlist_violation`,`asset_mismatch`,`amount_mismatch`,`wallet_mismatch`,`unsupported_action`,`object_resolution_failed`,`proposal_review_only`],Lx=[`review_evidence_stale`,`quote_stale`,`quote_unavailable`,`simulation_transient_failure`,`review_update_failed`,`wallet_connection_changed`],Rx=[`proposed`,`awaiting_wallet`,`wallet_connected`,`ready_for_wallet_review`,`refresh_required`,`blocked`,`expired`],zx=[`humanReadableReview`,`simulation`,`transactionReviewData`,`ptbVisualization`,`assetFlowActual`,`beforeAfterBalance`],Bx=B([`client.core.simulateTransaction`,`client.transactionExecutionService.simulateTransaction`]),Vx=`ptb-visualization-contract-alpha-2026-05-25`,Hx=[`proposedAction`,`assetFlow`,`recipients`,`targets`,`evidenceUsed`,`missingEvidence`,`requiredUserChoices`,`unsupportedClaims`,`freshness`,`blockingChecks`],Ux=[`effects`,`balanceChanges`,`objectTypes`,`transaction`],Wx=[`transaction_bytes`,`serialized_transaction`,`wallet_signature_request`,`private_key_material`,`wallet_authorization`,`signing_data`,`signing_readiness`,`payment_execution_readiness`],Gx=[`transaction_building_input`,`wallet_authorization`,`signing_data`,`signing_readiness`,`payment_execution_readiness`,`route_recommendation`],Kx=pb,qx=`MIST`,Jx=[`checkedAt`,`expiresAt`],Yx=[`checkedAt`,`expiryStatus`],Xx=[`rawAmount`,`asset`,`amountRole`],Zx=[`minOutRaw`,`asset`,`amountRole`],Qx=[`gasBudgetRaw`,`asset`,`amountRole`],$x=[`gasUsedRaw`,`asset`,`amountRole`],eS=[`checkedAt`,`gasResolutionStatus`,`unresolvedReason`],tS=[`balanceChanges`,`asset`,`amountRole`],nS=[`coinType`,`decimals`],rS=[`quoteEvidenceId`,`minOutRaw`],iS=[`maxSlippageBps`,`userSelection`],aS=[`maxSlippageBps`,`minOutRaw`],oS=[`ownerAccount`,`objects`],sS=[`pinned_sdk_registry`,`verified_mainnet_onchain_metadata`,`wallet_account_read`,`quote_evidence`,`review_time_simulation`,`validated_request_fact`,`user_explicit_choice`],cS=[`input`,`expected_output`,`minimum_output`,`gas_budget`,`gas_used`,`fee`,`balance_delta`],lS={input:{kinds:[`validated_request_fact`,`wallet_account_read`,`user_explicit_choice`],fields:Xx},expected_output:{kinds:[`quote_evidence`,`review_time_simulation`],fields:Xx},minimum_output:{kinds:[`quote_evidence`],fields:Zx},gas_budget:{kinds:[`review_time_simulation`],fields:Qx},gas_used:{kinds:[`review_time_simulation`],fields:$x},fee:{kinds:[`review_time_simulation`],fields:Xx},balance_delta:{kinds:[`review_time_simulation`],fields:tS}},uS={pinned_sdk_metadata:{kinds:[`pinned_sdk_registry`],fields:nS},verified_mainnet_onchain_metadata:{kinds:[`verified_mainnet_onchain_metadata`],fields:nS}},dS={user_explicit:{kinds:[`user_explicit_choice`],fields:iS},adapter_policy_from_quote_evidence:{kinds:[`quote_evidence`],fields:aS}},fS={kinds:[`review_time_simulation`],fields:eS},pS={kinds:[`quote_evidence`],fields:rS},mS={kinds:[`validated_request_fact`],fields:Jx},hS={kinds:[`validated_request_fact`],fields:Yx},gS={raw_quantity_amount:{byRole:lS},unit_metadata:{bySource:uS},gas_unresolved_status:fS,expiry_status:{current:mS,expired:mS,not_provided:hS,not_applicable:hS},quote_min_out:pS,slippage_policy:{bySource:dS},object_ownership:{kinds:[`wallet_account_read`],fields:oS},simulation_result:{kinds:[`review_time_simulation`],fields:Ux}},_S={gasBudgetClaimId:{factKind:`raw_quantity_amount`,role:`gas_budget`,assetCoinType:Kx,rawUnit:qx},gasUsedClaimId:{factKind:`raw_quantity_amount`,role:`gas_used`,assetCoinType:Kx,rawUnit:qx},gasObjectOwnershipClaimId:{factKind:`object_ownership`,ownership:`owned_by_account`}},vS=M().refine(e=>{let t=new Date(e);return!Number.isNaN(t.getTime())&&t.toISOString()===e},`Expected ISO 8601 UTC timestamp`),yS=Mb(`unsigned integer`),bS=M().regex(/^0x[0-9a-fA-F]{1,64}$/,{message:`Expected a Sui object id`}),xS=M().min(1).max(512).refine(e=>{try{return Fb(e)===e}catch{return!1}},`Expected a normalized Sui struct tag coin type`),Y=M().min(1).max(120),SS=L({symbol:M().min(1).max(64).optional(),coinType:xS}).strict(),CS=/transaction\s*bytes?|tx\s*bytes?|serialized\s*transaction|serializedTransaction|signed\s*transaction|signing\s*request|signingRequest|wallet\s*authorization|walletAuthorization|private\s*key|privateKey|secret\s*key|secretKey|seed\s*phrase|mnemonic|suiprivkey|signature|bcs\s*transaction/i,wS=/(?:0x[0-9a-fA-F]{160,}|[A-Za-z0-9+/_=-]{160,})/;function TS(e,t){return M().min(1).max(e).superRefine((e,n)=>{(CS.test(e)||wS.test(e))&&n.addIssue({code:`custom`,message:`${t} must not contain executable transaction, signing, private-key, mnemonic, or long encoded material`})})}function ES(e,t){let n=new Set(e);return t.filter(e=>!n.has(e))}function DS(e,t,n,r,i){let a=ES(t,n);a.length!==0&&e.addIssue({code:`custom`,path:r,message:`${i} must include ${a.join(`, `)}`})}function OS(e,t,n,r,i){DS(e,t,n,r,i)}function kS(e,t,n){e.addIssue({code:`custom`,path:t,message:`${n} must match referenced evidence claim`})}function X(e,t,n,r,i){t!==n&&kS(e,r,i)}function AS(e,t,n,r,i){let a=new Set(t),o=new Set(n);if(a.size!==o.size){kS(e,r,i);return}for(let t of a)if(!o.has(t)){kS(e,r,i);return}}function jS(e,t,n,r,i){(t.symbol!==n.symbol||t.coinType!==n.coinType)&&kS(e,r,i)}function MS(e,t,n,r,i){try{Fb(t.coinType)!==n&&kS(e,r,i)}catch{kS(e,r,i)}}var NS=L({kind:B([`natural_language_intent`,`external_proposal`,`mcp_action_request`,`local_review_request`]),sourceId:M().min(1).max(160),capturedAt:vS,authority:V(`untrusted_until_review_regenerates_and_verifies`),userSelectionSource:B([`user_explicit`,`prior_user_explicit_context`]).optional()}).strict(),PS=L({id:Y,kind:B(sS),network:V(`sui:mainnet`),source:M().min(1).max(240),verifiedAt:vS,fields:I(M().min(1).max(120)).min(1)}).strict(),FS=ep(`factKind`,[L({id:Y,factKind:V(`raw_quantity_amount`),sourceEvidenceId:Y,role:B(cS),asset:SS,rawAmount:yS}).strict(),L({id:Y,factKind:V(`unit_metadata`),sourceEvidenceId:Y,source:B([`pinned_sdk_metadata`,`verified_mainnet_onchain_metadata`]),coinType:xS,decimals:N().int().min(0).max(255)}).strict(),L({id:Y,factKind:V(`gas_unresolved_status`),sourceEvidenceId:Y,checkedAt:vS,status:V(`unresolved`),reason:M().min(1).max(240)}).strict(),L({id:Y,factKind:V(`expiry_status`),sourceEvidenceId:Y,checkedAt:vS,status:B([`current`,`expired`,`not_provided`,`not_applicable`]),expiresAt:vS.optional(),reason:M().min(1).max(240).optional()}).strict(),L({id:Y,factKind:V(`quote_min_out`),sourceEvidenceId:Y,quoteEvidenceId:M().min(1).max(120),minOutRaw:yS}).strict(),L({id:Y,factKind:V(`slippage_policy`),sourceEvidenceId:Y,policySource:B([`user_explicit`,`adapter_policy_from_quote_evidence`]),maxSlippageBps:N().int().min(0).max(1e4),minOutRaw:yS.optional()}).strict(),L({id:Y,factKind:V(`object_ownership`),sourceEvidenceId:Y,objectId:bS,ownerAccount:mb,ownership:B([`owned_by_account`,`shared_object`,`immutable_or_package`,`not_owned_by_account`])}).strict(),L({id:Y,factKind:V(`simulation_result`),sourceEvidenceId:Y,provider:Bx,checksEnabled:V(!0),simulatedAt:vS,status:B([`success`,`failed`,`unavailable`]),requiredFields:I(B(Ux)).min(Ux.length),missingFields:I(B(Ux)).default([]),failureReason:M().min(1).max(240).optional()}).strict()]),IS=L({id:Y,role:B(cS),asset:SS,rawAmount:yS,unit:L({decimals:N().int().min(0).max(255),source:B([`pinned_sdk_metadata`,`verified_mainnet_onchain_metadata`]),sourceField:M().min(1).max(160),unitClaimId:Y}).strict(),amountClaimId:Y,displayOnly:L({amountDisplay:M().min(1).max(120),reason:V(`presentation_only_not_signing_input`)}).strict().optional()}).strict(),LS=L({objectId:bS,ownerAccount:mb,ownershipClaimId:Y}).strict(),RS=L({source:V(`review_time_simulation`),checkedAt:vS,gasBudgetRaw:yS.optional(),gasBudgetClaimId:Y.optional(),gasUsedRaw:yS.optional(),gasUsedClaimId:Y.optional(),gasObjects:I(LS).optional(),unresolvedReason:M().min(1).max(240).optional(),unresolvedClaimId:Y.optional()}).strict().superRefine((e,t)=>{let n=e.gasBudgetRaw!==void 0||e.gasUsedRaw!==void 0;!n&&e.unresolvedReason===void 0&&t.addIssue({code:`custom`,message:`Expected gas evidence or unresolvedReason`}),n&&e.unresolvedReason!==void 0&&t.addIssue({code:`custom`,path:[`unresolvedReason`],message:`Resolved gas quantities must not include unresolvedReason`}),e.gasBudgetRaw!==void 0&&e.gasBudgetClaimId===void 0&&t.addIssue({code:`custom`,path:[`gasBudgetClaimId`],message:`gasBudgetRaw requires gasBudgetClaimId`}),e.gasBudgetRaw===void 0&&e.gasBudgetClaimId!==void 0&&t.addIssue({code:`custom`,path:[`gasBudgetClaimId`],message:`gasBudgetClaimId requires gasBudgetRaw`}),e.gasUsedRaw!==void 0&&e.gasUsedClaimId===void 0&&t.addIssue({code:`custom`,path:[`gasUsedClaimId`],message:`gasUsedRaw requires gasUsedClaimId`}),e.gasUsedRaw===void 0&&e.gasUsedClaimId!==void 0&&t.addIssue({code:`custom`,path:[`gasUsedClaimId`],message:`gasUsedClaimId requires gasUsedRaw`}),e.unresolvedReason!==void 0&&e.unresolvedClaimId===void 0&&t.addIssue({code:`custom`,path:[`unresolvedClaimId`],message:`unresolvedReason requires unresolvedClaimId`}),e.unresolvedReason===void 0&&e.unresolvedClaimId!==void 0&&t.addIssue({code:`custom`,path:[`unresolvedClaimId`],message:`unresolvedClaimId requires unresolvedReason`})}),zS=ep(`status`,[L({checkedAt:vS,status:V(`current`),expiresAt:vS,evidenceClaimId:Y}).strict(),L({checkedAt:vS,status:V(`expired`),expiresAt:vS,evidenceClaimId:Y}).strict(),L({checkedAt:vS,status:V(`not_provided`),evidenceClaimId:Y,reason:M().min(1).max(240),expiresAt:qf().optional()}).strict(),L({checkedAt:vS,status:V(`not_applicable`),evidenceClaimId:Y,reason:M().min(1).max(240),expiresAt:qf().optional()}).strict()]).superRefine((e,t)=>{e.status===`current`&&Date.parse(e.expiresAt)<=Date.parse(e.checkedAt)&&t.addIssue({code:`custom`,path:[`expiresAt`],message:`Current expiry evidence requires expiresAt after checkedAt`}),e.status===`expired`&&Date.parse(e.expiresAt)>Date.parse(e.checkedAt)&&t.addIssue({code:`custom`,path:[`expiresAt`],message:`Expired expiry evidence requires expiresAt at or before checkedAt`})}),BS=L({status:B([`required_and_verified`,`not_required_for_action`,`missing`,`stale`]),quoteEvidenceId:M().min(1).max(120).optional(),quoteEvidenceClaimId:Y.optional(),maxSlippageBps:N().int().min(0).max(1e4).optional(),minOutRaw:yS.optional(),policySource:B([`user_explicit`,`adapter_policy_from_quote_evidence`]).optional(),policyEvidenceClaimId:Y.optional()}).strict().superRefine((e,t)=>{e.status===`required_and_verified`&&(e.quoteEvidenceId===void 0||e.quoteEvidenceClaimId===void 0||e.maxSlippageBps===void 0||e.minOutRaw===void 0||e.policySource===void 0||e.policyEvidenceClaimId===void 0)&&t.addIssue({code:`custom`,message:`Verified min-out evidence requires quoteEvidenceId, quoteEvidenceClaimId, maxSlippageBps, minOutRaw, policySource, and policyEvidenceClaimId`}),e.quoteEvidenceId!==void 0&&e.quoteEvidenceClaimId===void 0&&t.addIssue({code:`custom`,path:[`quoteEvidenceClaimId`],message:`quoteEvidenceId requires quoteEvidenceClaimId`}),e.quoteEvidenceId===void 0&&e.quoteEvidenceClaimId!==void 0&&t.addIssue({code:`custom`,path:[`quoteEvidenceClaimId`],message:`quoteEvidenceClaimId requires quoteEvidenceId`}),e.minOutRaw!==void 0&&e.quoteEvidenceClaimId===void 0&&t.addIssue({code:`custom`,path:[`quoteEvidenceClaimId`],message:`minOutRaw requires quoteEvidenceClaimId`}),e.maxSlippageBps!==void 0&&e.policySource===void 0&&t.addIssue({code:`custom`,path:[`policySource`],message:`maxSlippageBps requires policySource`}),e.policySource!==void 0&&e.policyEvidenceClaimId===void 0&&t.addIssue({code:`custom`,path:[`policyEvidenceClaimId`],message:`policySource requires policyEvidenceClaimId`}),e.policySource===void 0&&e.policyEvidenceClaimId!==void 0&&t.addIssue({code:`custom`,path:[`policyEvidenceClaimId`],message:`policyEvidenceClaimId requires policySource`})}),VS=L({checkedAt:vS,ownerAccount:mb,objects:I(L({objectId:bS,role:B([`input_coin`,`gas_coin`,`protocol_object`,`shared_object`,`receiving_object`]),ownership:B([`owned_by_account`,`shared_object`,`immutable_or_package`,`not_owned_by_account`]),evidenceClaimId:Y}).strict()).min(1)}).strict(),HS=L({evidenceClaimId:Y,transactionDigest:hb,provider:Bx,checksEnabled:V(!0),simulatedAt:vS,status:B([`success`,`failed`,`unavailable`]),requiredFields:I(B(Ux)).min(Ux.length),missingFields:I(B(Ux)).default([]),failureReason:M().min(1).max(240).optional()}).strict().refine(e=>e.status!==`success`||e.missingFields.length===0,{message:`Successful simulation evidence must not have missing required fields`}).refine(e=>Ux.every(t=>e.requiredFields.includes(t)),{message:`Simulation evidence must include every required simulation field`}).refine(e=>e.status===`success`||e.failureReason!==void 0,{message:`Failed or unavailable simulation evidence requires failureReason`}).refine(e=>e.status!==`success`||e.failureReason===void 0,{message:`Successful simulation evidence must not include failureReason`}),US=L({fields:I(B(Hx)).min(Hx.length),transactionDigest:hb,source:V(`review_model_or_adapter_equivalent`),purpose:V(`human_review_before_wallet_authorization`)}).strict().refine(e=>Hx.every(t=>e.fields.includes(t)),{message:`Human-readable review fields must include every required review field`}),WS=L({runtimeStatus:V(`emitted_pre_handoff`),mcpAndReviewUiMayExpose:I(B([`human_readable_review`,`ptb_visualization_artifact`,`diagnostics`,`status_checks`])).min(1),prohibited:I(B(Wx)).min(1)}).strict().superRefine((e,t)=>{OS(t,e.prohibited,Wx,[`prohibited`],`prohibited`)}),GS=L({schemaVersion:V(1),adapterId:M().min(1).max(120),protocol:M().min(1).max(120),actionKind:M().min(1).max(120),network:V(`sui:mainnet`),inputProvenance:NS,sourceReferences:I(PS).min(1),evidenceClaims:I(FS).min(1),rawQuantities:I(IS).min(1),gas:RS,expiry:zS,slippageOrMinOut:BS,objectOwnership:VS,simulation:HS,humanReadableReview:US,outputBoundary:WS,reviewedTransactionDigest:hb}).strict().superRefine((e,t)=>{let n=new Set,r=new Map,i=new Map;e.sourceReferences.forEach((e,a)=>{n.has(e.id)&&t.addIssue({code:`custom`,path:[`sourceReferences`,a,`id`],message:`sourceReferences id must be unique: ${e.id}`}),n.add(e.id),r.has(e.id)||(r.set(e.id,e),i.set(e.id,a))});let a=new Set,o=new Map,s=new Map;e.evidenceClaims.forEach((e,n)=>{a.has(e.id)&&t.addIssue({code:`custom`,path:[`evidenceClaims`,n,`id`],message:`evidenceClaims id must be unique: ${e.id}`}),a.add(e.id),o.has(e.id)||(o.set(e.id,e),s.set(e.id,n))});let c=(e,n)=>{if(e===void 0)return;let i=r.get(e);if(i!==void 0)return i;t.addIssue({code:`custom`,path:n,message:`source evidence id must reference sourceReferences[].id: ${e}`})},l=(e,n,r,a)=>{if(e===void 0)return;let o=c(e,r);if(o===void 0)return;let s=i.get(e),l=s===void 0?r:[`sourceReferences`,s];n.kinds.includes(o.kind)||t.addIssue({code:`custom`,path:[...l,`kind`],message:`${a} source kind must be one of ${n.kinds.join(`, `)}`}),DS(t,o.fields,n.fields,[...l,`fields`],`${a} sourceReferences fields`)},u=(e,n,r,i)=>{if(e===void 0){t.addIssue({code:`custom`,path:r,message:`${i} must reference evidenceClaims[].id`});return}let a=o.get(e);if(a===void 0){t.addIssue({code:`custom`,path:r,message:`${i} must reference evidenceClaims[].id: ${e}`});return}if(a.factKind!==n){let a=s.get(e),o=a===void 0?r:[`evidenceClaims`,a,`factKind`];t.addIssue({code:`custom`,path:o,message:`${i} evidence claim factKind must be ${n}`})}return a};if(e.evidenceClaims.forEach((e,n)=>{e.factKind===`raw_quantity_amount`&&l(e.sourceEvidenceId,gS.raw_quantity_amount.byRole[e.role],[`evidenceClaims`,n,`sourceEvidenceId`],`evidenceClaims[${n}].raw_quantity_amount`),e.factKind===`unit_metadata`&&l(e.sourceEvidenceId,gS.unit_metadata.bySource[e.source],[`evidenceClaims`,n,`sourceEvidenceId`],`evidenceClaims[${n}].unit_metadata`),e.factKind===`gas_unresolved_status`&&l(e.sourceEvidenceId,gS.gas_unresolved_status,[`evidenceClaims`,n,`sourceEvidenceId`],`evidenceClaims[${n}].gas_unresolved_status`),e.factKind===`expiry_status`&&(l(e.sourceEvidenceId,gS.expiry_status[e.status],[`evidenceClaims`,n,`sourceEvidenceId`],`evidenceClaims[${n}].expiry_status`),(e.status===`current`||e.status===`expired`)&&e.expiresAt===void 0&&t.addIssue({code:`custom`,path:[`evidenceClaims`,n,`expiresAt`],message:`Current or expired expiry claim requires expiresAt`}),(e.status===`not_provided`||e.status===`not_applicable`)&&e.reason===void 0&&t.addIssue({code:`custom`,path:[`evidenceClaims`,n,`reason`],message:`Unavailable expiry claim requires reason`}),(e.status===`not_provided`||e.status===`not_applicable`)&&e.expiresAt!==void 0&&t.addIssue({code:`custom`,path:[`evidenceClaims`,n,`expiresAt`],message:`Unavailable expiry claim must not include expiresAt`}),e.status===`current`&&e.expiresAt!==void 0&&Date.parse(e.expiresAt)<=Date.parse(e.checkedAt)&&t.addIssue({code:`custom`,path:[`evidenceClaims`,n,`expiresAt`],message:`Current expiry claim requires expiresAt after checkedAt`}),e.status===`expired`&&e.expiresAt!==void 0&&Date.parse(e.expiresAt)>Date.parse(e.checkedAt)&&t.addIssue({code:`custom`,path:[`evidenceClaims`,n,`expiresAt`],message:`Expired expiry claim requires expiresAt at or before checkedAt`})),e.factKind===`quote_min_out`&&l(e.sourceEvidenceId,gS.quote_min_out,[`evidenceClaims`,n,`sourceEvidenceId`],`evidenceClaims[${n}].quote_min_out`),e.factKind===`slippage_policy`&&(l(e.sourceEvidenceId,gS.slippage_policy.bySource[e.policySource],[`evidenceClaims`,n,`sourceEvidenceId`],`evidenceClaims[${n}].slippage_policy`),e.policySource===`adapter_policy_from_quote_evidence`&&e.minOutRaw===void 0&&t.addIssue({code:`custom`,path:[`evidenceClaims`,n,`minOutRaw`],message:`Adapter-derived slippage policy claim requires minOutRaw`})),e.factKind===`object_ownership`&&l(e.sourceEvidenceId,gS.object_ownership,[`evidenceClaims`,n,`sourceEvidenceId`],`evidenceClaims[${n}].object_ownership`),e.factKind===`simulation_result`&&(l(e.sourceEvidenceId,gS.simulation_result,[`evidenceClaims`,n,`sourceEvidenceId`],`evidenceClaims[${n}].simulation_result`),e.status===`success`&&e.missingFields.length!==0&&t.addIssue({code:`custom`,path:[`evidenceClaims`,n,`missingFields`],message:`Successful simulation claim must not have missing required fields`}),Ux.every(t=>e.requiredFields.includes(t))||t.addIssue({code:`custom`,path:[`evidenceClaims`,n,`requiredFields`],message:`Simulation claim must include every required simulation field`}),e.status!==`success`&&e.failureReason===void 0&&t.addIssue({code:`custom`,path:[`evidenceClaims`,n,`failureReason`],message:`Failed or unavailable simulation claim requires failureReason`}),e.status===`success`&&e.failureReason!==void 0&&t.addIssue({code:`custom`,path:[`evidenceClaims`,n,`failureReason`],message:`Successful simulation claim must not include failureReason`}))}),e.rawQuantities.forEach((e,n)=>{let r=u(e.amountClaimId,`raw_quantity_amount`,[`rawQuantities`,n,`amountClaimId`],`rawQuantities[${n}].amountClaimId`);r?.factKind===`raw_quantity_amount`&&(X(t,e.role,r.role,[`rawQuantities`,n,`role`],`rawQuantities[${n}].role`),X(t,e.rawAmount,r.rawAmount,[`rawQuantities`,n,`rawAmount`],`rawQuantities[${n}].rawAmount`),jS(t,e.asset,r.asset,[`rawQuantities`,n,`asset`],`rawQuantities[${n}].asset`));let i=u(e.unit.unitClaimId,`unit_metadata`,[`rawQuantities`,n,`unit`,`unitClaimId`],`rawQuantities[${n}].unit.unitClaimId`);i?.factKind===`unit_metadata`&&(X(t,e.unit.source,i.source,[`rawQuantities`,n,`unit`,`source`],`rawQuantities[${n}].unit.source`),X(t,e.unit.decimals,i.decimals,[`rawQuantities`,n,`unit`,`decimals`],`rawQuantities[${n}].unit.decimals`),e.asset.coinType!==void 0&&X(t,e.asset.coinType,i.coinType,[`rawQuantities`,n,`asset`,`coinType`],`rawQuantities[${n}].asset.coinType`))}),e.gas.gasBudgetRaw!==void 0){let n=u(e.gas.gasBudgetClaimId,`raw_quantity_amount`,[`gas`,`gasBudgetClaimId`],`gas.gasBudgetClaimId`);n?.factKind===`raw_quantity_amount`&&(X(t,n.role,_S.gasBudgetClaimId.role,[`gas`,`gasBudgetClaimId`],`gas.gasBudgetClaimId role`),MS(t,n.asset,_S.gasBudgetClaimId.assetCoinType,[`gas`,`gasBudgetClaimId`],`gas.gasBudgetClaimId asset`),X(t,e.gas.gasBudgetRaw,n.rawAmount,[`gas`,`gasBudgetRaw`],`gas.gasBudgetRaw`))}if(e.gas.gasUsedRaw!==void 0){let n=u(e.gas.gasUsedClaimId,`raw_quantity_amount`,[`gas`,`gasUsedClaimId`],`gas.gasUsedClaimId`);n?.factKind===`raw_quantity_amount`&&(X(t,n.role,_S.gasUsedClaimId.role,[`gas`,`gasUsedClaimId`],`gas.gasUsedClaimId role`),MS(t,n.asset,_S.gasUsedClaimId.assetCoinType,[`gas`,`gasUsedClaimId`],`gas.gasUsedClaimId asset`),X(t,e.gas.gasUsedRaw,n.rawAmount,[`gas`,`gasUsedRaw`],`gas.gasUsedRaw`))}if(e.gas.unresolvedReason!==void 0){let n=u(e.gas.unresolvedClaimId,`gas_unresolved_status`,[`gas`,`unresolvedClaimId`],`gas.unresolvedClaimId`);n?.factKind===`gas_unresolved_status`&&(X(t,n.status,`unresolved`,[`gas`,`unresolvedClaimId`],`gas.unresolvedClaimId status`),X(t,e.gas.checkedAt,n.checkedAt,[`gas`,`checkedAt`],`gas.checkedAt`),X(t,e.gas.unresolvedReason,n.reason,[`gas`,`unresolvedReason`],`gas.unresolvedReason`))}e.gas.gasObjects?.forEach((e,n)=>{let r=u(e.ownershipClaimId,`object_ownership`,[`gas`,`gasObjects`,n,`ownershipClaimId`],`gas.gasObjects[${n}].ownershipClaimId`);r?.factKind===`object_ownership`&&(X(t,e.objectId,r.objectId,[`gas`,`gasObjects`,n,`objectId`],`gas.gasObjects[${n}].objectId`),X(t,e.ownerAccount,r.ownerAccount,[`gas`,`gasObjects`,n,`ownerAccount`],`gas.gasObjects[${n}].ownerAccount`),X(t,r.ownership,_S.gasObjectOwnershipClaimId.ownership,[`gas`,`gasObjects`,n,`ownershipClaimId`],`gas.gasObjects[${n}].ownershipClaimId ownership`))});let d=u(e.expiry.evidenceClaimId,`expiry_status`,[`expiry`,`evidenceClaimId`],`expiry.evidenceClaimId`);if(d?.factKind===`expiry_status`&&(X(t,e.expiry.status,d.status,[`expiry`,`status`],`expiry.status`),X(t,e.expiry.checkedAt,d.checkedAt,[`expiry`,`checkedAt`],`expiry.checkedAt`),e.expiry.status===`current`||e.expiry.status===`expired`?X(t,e.expiry.expiresAt,d.expiresAt,[`expiry`,`expiresAt`],`expiry.expiresAt`):X(t,e.expiry.reason,d.reason,[`expiry`,`reason`],`expiry.reason`)),e.slippageOrMinOut.quoteEvidenceClaimId!==void 0){let n=u(e.slippageOrMinOut.quoteEvidenceClaimId,`quote_min_out`,[`slippageOrMinOut`,`quoteEvidenceClaimId`],`slippageOrMinOut.quoteEvidenceClaimId`);n?.factKind===`quote_min_out`&&(X(t,e.slippageOrMinOut.quoteEvidenceId,n.quoteEvidenceId,[`slippageOrMinOut`,`quoteEvidenceId`],`slippageOrMinOut.quoteEvidenceId`),X(t,e.slippageOrMinOut.minOutRaw,n.minOutRaw,[`slippageOrMinOut`,`minOutRaw`],`slippageOrMinOut.minOutRaw`))}if(e.slippageOrMinOut.minOutRaw!==void 0&&(e.rawQuantities.some(t=>t.role===`minimum_output`&&t.rawAmount===e.slippageOrMinOut.minOutRaw)||t.addIssue({code:`custom`,path:[`slippageOrMinOut`,`minOutRaw`],message:`slippageOrMinOut.minOutRaw must match a minimum_output rawQuantities entry`})),e.slippageOrMinOut.policyEvidenceClaimId!==void 0){let n=u(e.slippageOrMinOut.policyEvidenceClaimId,`slippage_policy`,[`slippageOrMinOut`,`policyEvidenceClaimId`],`slippageOrMinOut.policyEvidenceClaimId`);n?.factKind===`slippage_policy`&&(X(t,e.slippageOrMinOut.policySource,n.policySource,[`slippageOrMinOut`,`policySource`],`slippageOrMinOut.policySource`),X(t,e.slippageOrMinOut.maxSlippageBps,n.maxSlippageBps,[`slippageOrMinOut`,`maxSlippageBps`],`slippageOrMinOut.maxSlippageBps`),n.policySource===`adapter_policy_from_quote_evidence`&&X(t,e.slippageOrMinOut.minOutRaw,n.minOutRaw,[`slippageOrMinOut`,`minOutRaw`],`slippageOrMinOut.minOutRaw`))}e.objectOwnership.objects.forEach((n,r)=>{let i=u(n.evidenceClaimId,`object_ownership`,[`objectOwnership`,`objects`,r,`evidenceClaimId`],`objectOwnership.objects[${r}].evidenceClaimId`);i?.factKind===`object_ownership`&&(X(t,n.objectId,i.objectId,[`objectOwnership`,`objects`,r,`objectId`],`objectOwnership.objects[${r}].objectId`),X(t,e.objectOwnership.ownerAccount,i.ownerAccount,[`objectOwnership`,`ownerAccount`],`objectOwnership.ownerAccount`),X(t,n.ownership,i.ownership,[`objectOwnership`,`objects`,r,`ownership`],`objectOwnership.objects[${r}].ownership`))});let f=u(e.simulation.evidenceClaimId,`simulation_result`,[`simulation`,`evidenceClaimId`],`simulation.evidenceClaimId`);f?.factKind===`simulation_result`&&(X(t,e.simulation.provider,f.provider,[`simulation`,`provider`],`simulation.provider`),X(t,e.simulation.checksEnabled,f.checksEnabled,[`simulation`,`checksEnabled`],`simulation.checksEnabled`),X(t,e.simulation.simulatedAt,f.simulatedAt,[`simulation`,`simulatedAt`],`simulation.simulatedAt`),X(t,e.simulation.status,f.status,[`simulation`,`status`],`simulation.status`),AS(t,e.simulation.requiredFields,f.requiredFields,[`simulation`,`requiredFields`],`simulation.requiredFields`),AS(t,e.simulation.missingFields,f.missingFields,[`simulation`,`missingFields`],`simulation.missingFields`),X(t,e.simulation.failureReason,f.failureReason,[`simulation`,`failureReason`],`simulation.failureReason`))}).superRefine((e,t)=>{let n=e.reviewedTransactionDigest;X(t,e.humanReadableReview.transactionDigest,n,[`humanReadableReview`,`transactionDigest`],`humanReadableReview.transactionDigest`),X(t,e.simulation.transactionDigest,n,[`simulation`,`transactionDigest`],`simulation.transactionDigest`)}),KS=L({contractVersion:V(Vx),artifactKind:V(`ptb_visualization`),generatedAt:vS,source:L({adapterId:M().min(1).max(120),planId:M().min(1).max(120).optional(),sourceKind:B([`review_time_generated_transaction_kind`,`review_time_ir`,`renderer_model`]),authority:V(`visualization_only_not_wallet_authorization`),renderer:L({name:M().min(1).max(120),packageName:M().min(1).max(120).optional(),version:M().min(1).max(80).optional()}).strict().optional()}).strict(),mermaid:L({diagramType:V(`flowchart`),text:TS(2e4,`mermaid.text`),namedText:TS(2e4,`mermaid.namedText`)}).strict(),diagnostics:I(L({severity:B([`info`,`warning`,`error`]),code:M().min(1).max(120),message:TS(512,`diagnostics.message`),source:B([`adapter`,`renderer`,`schema`,`simulation`])}).strict()).default([]),unsupportedUse:I(B(Gx)).min(1),executableMaterial:L({included:V(!1),policy:V(`mcp_and_review_ui_outputs_must_not_include_executable_transaction_material`)}).strict()}).strict().superRefine((e,t)=>{OS(t,e.unsupportedUse,Gx,[`unsupportedUse`],`unsupportedUse`)}),qS=z(M(),F()),JS=B(Ix),YS=B(Lx);B([`ready_for_wallet_review`,`refresh_required`,`blocked`]);var XS=B(Rx);B([`proposed`,`awaiting_wallet`,`wallet_connected`,`ready_for_wallet_review`,`refresh_required`,`blocked`,`expired`,`awaiting_signature`,`submitting`,`awaiting_chain_result`,`stopped`,`request_failed`,`outcome_unknown`,`completed`]);var ZS=L({id:M(),label:M(),status:B([`pass`,`warning`,`fail`]),message:M(),source:B([`registry`,`quote`,`wallet`,`simulation`,`adapter`,`network`,`proposal`])}),QS=M().min(1),$S=`human_readable_review`,eC=`review_time_simulation`,tC=L({stageCatalogId:M().min(1),adapterId:M(),protocol:M(),actionKind:M(),completedStages:I(QS),missingStages:I(QS)}).strict().superRefine((e,t)=>{let n=nC(e.completedStages);n&&t.addIssue({code:`custom`,path:[`completedStages`],message:`completedStages contains duplicate stage '${n}'`});let r=nC(e.missingStages);r&&t.addIssue({code:`custom`,path:[`missingStages`],message:`missingStages contains duplicate stage '${r}'`});for(let n of e.completedStages)e.missingStages.includes(n)&&t.addIssue({code:`custom`,path:[`missingStages`],message:`stage '${n}' cannot be both completed and missing`})});function nC(e){let t=new Set;for(let n of e){if(t.has(n))return n;t.add(n)}}var rC=L({symbol:M(),amount:M(),coinType:M().optional(),approx:P().optional()}).strict(),iC=rC.extend({amountKind:V(`display_intent`).default(`display_intent`)}),aC=L({outgoing:I(iC),expectedIncoming:I(iC),minimumIncoming:I(iC).optional(),fees:I(iC).optional()}),oC=L({outgoing:I(rC),expectedIncoming:I(rC),minimumIncoming:I(rC).optional(),fees:I(rC).optional()}),sC=L({before:I(rC),after:I(rC),delta:I(rC)}),cC=L({computationCostRaw:Ab(`computationCostRaw`),storageCostRaw:Ab(`storageCostRaw`),storageRebateRaw:Ab(`storageRebateRaw`),nonRefundableStorageFeeRaw:Ab(`nonRefundableStorageFeeRaw`)}).strict(),lC=L({address:mb,coinType:M().min(1).max(512).refine(e=>{try{return Fb(e)===e}catch{return!1}},`Expected a normalized Sui struct tag coin type`),amount:Pb(`balanceChanges[].amount`)}).strict(),uC=L({objectId:mb,objectType:M().min(1).max(512).optional(),inputState:M().min(1).max(80),outputState:M().min(1).max(80),idOperation:M().min(1).max(80)}).strict(),dC=L({provider:Bx,checksEnabled:P(),success:P(),gasCostSummary:cC.optional(),balanceChanges:I(lC).optional(),objectChanges:I(uC).optional(),error:M().optional()}),fC=dC,pC=dC.extend({checksEnabled:V(!0),success:V(!0),gasCostSummary:cC,balanceChanges:I(lC),objectChanges:I(uC),error:qf().optional()}).strict(),mC=L({role:B([`input`,`expected_output`,`minimum_output`,`fee`]),symbol:M(),coinType:M().min(1).max(512).refine(e=>{try{return Fb(e),!0}catch{return!1}},`Expected a Sui struct tag coin type`),decimals:N().int().min(0).max(255),rawAmount:Ab(`rawAmount`),rawAmountSource:V(`quote_policy_evidence`),displayAmount:M().optional(),displayAmountSource:V(`user_display_intent_not_signing_input`).optional()}).strict().superRefine((e,t)=>{e.displayAmount!==void 0&&e.displayAmountSource===void 0&&t.addIssue({code:`custom`,path:[`displayAmountSource`],message:`displayAmountSource is required when displayAmount is present`}),e.displayAmount===void 0&&e.displayAmountSource!==void 0&&t.addIssue({code:`custom`,path:[`displayAmount`],message:`displayAmount is required when displayAmountSource is present`})}),hC=L({role:B([`connected_account`,`output_recipient`]),address:mb}).strict(),gC=L({kind:V(`swap_output_asset`),symbol:M(),coinType:M().min(1).max(512).refine(e=>{try{return Fb(e),!0}catch{return!1}},`Expected a Sui struct tag coin type`),protocol:M(),poolKey:M(),direction:B([`base_to_quote`,`quote_to_base`])}).strict(),_C=L({id:M(),label:M(),source:R([B([`registry`,`quote`,`wallet`,`simulation`,`adapter`,`network`,`proposal`]),B([`transaction_material`,`digest_commitment`])]),summary:M()}).strict(),vC=L({id:M(),label:M(),reason:M()}).strict(),yC=L({proposedAction:L({title:M(),summary:M(),actionKind:M(),adapterId:M(),protocol:M(),network:V(`sui:mainnet`)}).strict(),recipients:I(hC),evidenceUsed:I(_C),missingEvidence:I(vC),requiredUserChoices:I(vC),unsupportedClaims:I(vC),freshness:L({status:V(`current`),evaluatedAt:M(),expiresAt:M(),reason:M()}).strict(),blockingChecks:I(ZS)}).strict(),bC=L({assetFlow:L({outgoing:I(mC),expectedIncoming:I(mC),minimumIncoming:I(mC),fees:I(mC)}).strict(),targets:I(gC)}).strict(),xC=ep(`kind`,[yC.extend({kind:V(`swap_human_readable_review`)}).merge(bC)]),SC=L({id:M(),actionKind:M(),adapterId:M(),protocol:M(),title:M(),summary:M(),assetFlowPreview:aC,reviewModel:Fx.optional(),adapterData:qS,createdAt:M(),expiresAt:M().optional(),registryVersion:M().optional(),preliminaryChecks:I(ZS).optional()}),CC=L({planId:M(),reviewSessionId:M(),account:mb,checks:I(ZS),assetFlowActual:oC.optional(),beforeAfterBalance:sC.optional(),simulation:fC.optional(),humanReadableReview:xC.optional(),transactionReviewData:GS.optional(),ptbVisualization:KS.optional(),adapterLifecycle:tC.optional(),updatedAt:M()}),wC=ep(`status`,[CC.extend({status:V(`ready_for_wallet_review`),evidenceValidity:qf().optional(),blockedReason:qf().optional(),refreshReason:qf().optional()}),CC.extend({status:V(`refresh_required`),evidenceValidity:V(`invalidated`).optional(),refreshReason:YS,blockedReason:qf().optional()}),CC.extend({status:V(`blocked`),evidenceValidity:V(`invalidated`).optional(),blockedReason:JS,refreshReason:qf().optional()})]).superRefine((e,t)=>{if(e.evidenceValidity===`invalidated`)for(let n of zx)e[n]!==void 0&&t.addIssue({code:`custom`,path:[n],message:`Invalidated review evidence cannot carry current material-derived facts`});let n=e.adapterLifecycle;if(n!==void 0&&TC(e,t),e.humanReadableReview!==void 0&&n===void 0&&t.addIssue({code:`custom`,path:[`humanReadableReview`],message:`humanReadableReview requires adapterLifecycle evidence stage provenance`}),e.simulation!==void 0&&n===void 0&&t.addIssue({code:`custom`,path:[`simulation`],message:`simulation requires adapterLifecycle evidence stage provenance`}),e.ptbVisualization!==void 0){let e=n?.completedStages??[];e.includes(`transaction_material_build_or_verify`)&&e.includes(`digest_commitment`)||t.addIssue({code:`custom`,path:[`ptbVisualization`],message:`ptbVisualization requires completed transaction material and digest commitment lifecycle stages`})}let r=e.status===`ready_for_wallet_review`;e.transactionReviewData!==void 0&&!r&&t.addIssue({code:`custom`,path:[`transactionReviewData`],message:`transactionReviewData is only valid on ready_for_wallet_review`}),e.status===`ready_for_wallet_review`&&n!==void 0&&(e.transactionReviewData===void 0&&t.addIssue({code:`custom`,path:[`transactionReviewData`],message:`ready_for_wallet_review requires an emitted wallet review contract`}),(n===void 0||n.missingStages.length!==0)&&t.addIssue({code:`custom`,path:[`adapterLifecycle`],message:`ready_for_wallet_review requires a completed adapterLifecycle with no missing stages`}),e.humanReadableReview===void 0&&t.addIssue({code:`custom`,path:[`humanReadableReview`],message:`ready_for_wallet_review requires humanReadableReview public evidence`}),e.simulation===void 0&&t.addIssue({code:`custom`,path:[`simulation`],message:`ready_for_wallet_review requires successful simulation public evidence`})),e.status===`blocked`&&(e.blockedReason===`producer_stage_missing`&&n===void 0&&t.addIssue({code:`custom`,path:[`adapterLifecycle`],message:`producer_stage_missing requires adapterLifecycle with at least one missing stage`}),e.blockedReason===`producer_stage_missing`&&n!==void 0&&n.missingStages.length===0&&t.addIssue({code:`custom`,path:[`blockedReason`],message:`producer_stage_missing requires at least one adapterLifecycle.missingStages entry`}),e.blockedReason===`wallet_review_contract_emit_missing`&&e.transactionReviewData!==void 0&&t.addIssue({code:`custom`,path:[`transactionReviewData`],message:`wallet_review_contract_emit_missing requires the wallet review contract to be absent`}),e.blockedReason===`wallet_review_contract_emit_missing`&&n===void 0&&t.addIssue({code:`custom`,path:[`adapterLifecycle`],message:`wallet_review_contract_emit_missing requires adapterLifecycle`}),e.blockedReason===`wallet_review_contract_emit_missing`&&n!==void 0&&n.missingStages.length!==0&&t.addIssue({code:`custom`,path:[`blockedReason`],message:`wallet_review_contract_emit_missing requires a completed adapterLifecycle with no missing stages`}),e.blockedReason===`wallet_review_contract_emit_missing`&&e.evidenceValidity!==`invalidated`&&e.humanReadableReview===void 0&&t.addIssue({code:`custom`,path:[`humanReadableReview`],message:`wallet_review_contract_emit_missing requires humanReadableReview public evidence`}),e.blockedReason===`wallet_review_contract_emit_missing`&&e.evidenceValidity!==`invalidated`&&e.simulation===void 0&&t.addIssue({code:`custom`,path:[`simulation`],message:`wallet_review_contract_emit_missing requires simulation public evidence`}))});function TC(e,t){let n=e.adapterLifecycle;n&&(e.humanReadableReview!==void 0&&EC(t,n,$S,[`humanReadableReview`]),e.simulation!==void 0&&(EC(t,n,eC,[`simulation`]),EC(t,n,$S,[`simulation`]),DC(t,e.simulation,[`simulation`])),n.missingStages.includes(eC)&&e.simulation!==void 0&&t.addIssue({code:`custom`,path:[`simulation`],message:`simulation public evidence cannot be present while review_time_simulation is missing`}),n.missingStages.includes($S)&&e.humanReadableReview!==void 0&&t.addIssue({code:`custom`,path:[`humanReadableReview`],message:`humanReadableReview public evidence cannot be present while human_readable_review is missing`}))}function EC(e,t,n,r){t.completedStages.includes(n)||e.addIssue({code:`custom`,path:r,message:`${r.join(`.`)} requires completed adapterLifecycle stage '${n}'`}),t.missingStages.includes(n)&&e.addIssue({code:`custom`,path:r,message:`${r.join(`.`)} cannot be present while adapterLifecycle stage '${n}' is missing`})}function DC(e,t,n){pC.safeParse(t).success||e.addIssue({code:`custom`,path:n,message:`simulation public evidence requires a successful checks-enabled review-time simulation projection`})}var OC=L({topic:M().min(1),accounts:I(mb).min(1),methods:I(M()),chain:V(gb),expiresAt:M().datetime(),walletName:M().optional()}).strict(),kC=ep(`status`,[L({topic:M().min(1),version:N().int().positive(),status:V(`present`),session:OC}).strict(),L({topic:M().min(1),version:N().int().positive(),status:B([`absent`,`unusable`])}).strict()]),AC=L({runId:_b,sequence:N().int().positive(),observedAt:M().datetime()}).strict();AC.extend({sessions:I(kC)}).strict();var jC=L({kind:V(`wallet_service_recovery`),priorRunId:_b,admittedAt:M().datetime(),updatedAt:M().datetime()}),MC=R([jC.extend({phase:V(`stopping`)}).strict(),jC.extend({phase:V(`starting`),nextRunId:_b}).strict(),jC.extend({outcome:B([`available`,`failed`,`superseded`,`server_restarted`]),nextRunId:_b.optional(),message:M().optional()}).strict()]),NC=`A wallet connection provides account context; it is not a transaction approval or proof of address ownership.`,PC=`Review evidence is not a safety guarantee. Only an explicit card action and wallet approval may authorize this exact transaction.`,FC=Cb.extend({pendingAction:V(`disconnect`).optional()});B([`input_required`,`awaiting_approval`,`disconnect_pending`]);var IC=L({action:V(`connect`),walletRunId:_b}).strict(),LC=L({action:V(`disconnect`),walletRunId:_b,connectionId:M().min(1)}).strict(),RC=L({action:V(`use_account`),walletRunId:_b,connectionId:M().min(1),account:mb}).strict(),zC=L({action:B([`prepare_review`,`request_signature`]),connectionId:M().min(1),walletRunId:_b,account:mb,reviewRevision:N().int().nonnegative()}).strict(),BC=R([IC,LC,RC,zC,L({action:B([`cancel`,`stop_connection`,`stop_waiting`,`read_result`])}).strict()]),VC=R([IC,zC.extend({action:V(`prepare_review`)})]),HC=L({kind:B([`connect`,`review`]),mode:B([`connect`,`review`,`review_manage`]),allowedActions:I(B(qb)),actionRemainingMs:N().int().nonnegative(),nextStateReadAfterMs:N().int().nonnegative().optional(),automaticAction:VC.optional(),observe:P(),walletAvailability:bb,walletObservation:AC.optional(),runtimeRecovery:MC.optional(),connectionConflict:wb.optional(),usableConnectionId:M().min(1).optional(),assetReadAccount:Tb.optional(),acceptedWalletRunId:_b.optional(),progress:xb,boundary:B([NC,PC]),connections:I(FC),activeAccount:M().optional(),connection:FC.optional(),connectionAction:B([`connect`,`disconnect`]).optional(),review:L({reviewSessionId:M(),plan:SC,reviewRevision:N().int().nonnegative(),status:XS,account:M().optional(),preparing:P(),accountRequestPending:V(!0).optional(),error:M().optional(),state:wC.optional()}).strict().optional(),request:Kb.optional(),receipt:F().optional(),netGasMist:M().regex(/^-?[0-9]+$/).optional(),observationStopped:P().optional()}).strict().superRefine((e,t)=>{let n=e.connections.find(t=>t.connectionId===e.usableConnectionId);e.usableConnectionId&&(!n||n.status!==`connected`||e.walletAvailability.status!==`available`||e.connectionConflict||e.connections.some(e=>e.pendingAction||e.status===`awaiting_approval`))&&t.addIssue({code:`custom`,path:[`usableConnectionId`],message:`The usable connection must match current connection facts.`}),e.assetReadAccount?.status===`available`&&(!n||!n.accounts.includes(e.assetReadAccount.account)||e.activeAccount!==e.assetReadAccount.account)&&t.addIssue({code:`custom`,path:[`assetReadAccount`],message:`The default address must belong to the usable connection and stored selection.`})});function UC(e,t,n=!1){return e.connections.filter(r=>r.connectionId===e.usableConnectionId&&r.accounts.includes(t)&&(!n||r.methods.includes(`sui_signTransaction`)))}var WC={uiOpenAccount:`ui.open_account`,uiOpenReceipt:`ui.open_receipt`,uiOpenChart:`ui.open_chart`,uiReadCard:`ui.read_card`,uiSubmitCard:`ui.submit_card`,uiActCard:`ui.act_card`,sessionOpenReviewManagement:`session.open_review_management`,readGetServerStatus:`read.get_server_status`,readListSupportedProtocols:`read.list_supported_protocols`,readListDeepbookPools:`read.list_deepbook_pools`,readListDeepbookTokens:`read.list_deepbook_tokens`,readInspectDeepbookOrderbook:`read.inspect_deepbook_orderbook`,readGetDeepbookMidPrice:`read.get_deepbook_mid_price`,readGetDeepbookUsdcPriceHistory:`read.get_deepbook_usdc_price_history`,readGetDeepbookUsdcPriceAtTime:`read.get_deepbook_usdc_price_at_time`,readQuoteDeepbookAction:`read.quote_deepbook_action`,readQuoteDeepbookDisplayAmount:`read.quote_deepbook_display_amount`,readSummarizeDeepbookAccountInventory:`read.summarize_deepbook_account_inventory`,readSummarizeWalletAssets:`read.summarize_wallet_assets`,readClassifyWalletAssets:`read.classify_wallet_assets`,readListSettlementAssetGroups:`read.list_settlement_asset_groups`,readSummarizeSettlementAssetGroupParity:`read.summarize_settlement_asset_group_parity`,readPreviewIntentEvidence:`read.preview_intent_evidence`,readListReviewActivity:`read.list_review_activity`,readSummarizeReviewFunnel:`read.summarize_review_funnel`,readGetReviewSessionDetail:`read.get_review_session_detail`,readInspectSuiTransaction:`read.inspect_sui_transaction`,readScanSuiAccountActivity:`read.scan_sui_account_activity`,readSummarizeSuiActivityScan:`read.summarize_sui_activity_scan`,readScanSuiFunctionActivity:`read.scan_sui_function_activity`,readSummarizeSuiFunctionActivityScan:`read.summarize_sui_function_activity_scan`,readSummarizeSuiAccountActivity:`read.summarize_sui_account_activity`,readGetAccountAssetTimeline:`read.get_account_asset_timeline`,settingsCreateLocalSettingsSession:`settings.create_local_settings_session`,settingsGetLocalSettings:`settings.get_local_settings`,actionPrepareSuiActionReview:`action.prepare_sui_action_review`,actionPrepareExternalProposalReview:`action.prepare_external_proposal_review`,sessionCreateWalletConnection:`session.create_wallet_connection`,sessionGetWalletConnection:`session.get_wallet_connection`,sessionWaitWalletConnection:`session.wait_wallet_connection`,sessionGetInteractionStatus:`session.get_interaction_status`,sessionGetReviewStatus:`session.get_review_status`,sessionGetExecutionResult:`session.get_execution_result`,sessionWaitExecutionResult:`session.wait_execution_result`,accountGetActiveAccount:`account.get_active_account`,accountClearActiveAccount:`account.clear_active_account`},GC=L({connectionId:M().min(1),pairingUri:M().startsWith(`wc:`),expiresAt:M().datetime()}).strict(),KC=B([`account`,`receipt`,`chart`,`connect`,`review`]),qC=L({cardId:M().min(1),kind:KC,state:B([`ready`,`running`,`closed`]),revision:N().int().nonnegative(),createdAt:M().datetime(),expiresAt:M().datetime(),input:z(M(),F()),data:F().optional(),reason:B([`completed`,`expired`,`failed`,`server_restarted`,`cancelled`]).optional(),error:M().optional()}).strict().extend({pollAfterMs:N().int().positive(),inputRemainingMs:N().int().nonnegative()}),JC=L({transactionDigest:M().min(1),pureInputs:I(L({index:N().int().nonnegative(),bytes:M().regex(/^0x(?:[0-9a-f]{2})*$/i)}).strict()).refine(e=>new Set(e.map(e=>e.index)).size===e.length,`Duplicate input index.`),ptbGraph:L({mermaid:L({text:M(),namedText:M()}).strict()}).strict().optional()}).strict(),YC=`sui-mcp/card`,XC=`sui-mcp/receipt-display`,ZC=`sui-mcp/wallet-display`,QC=`suimcp://cards/`,$C=ep(`kind`,[L({kind:V(`account`),status:V(`input_required`),field:V(`account`),message:M().min(1)}).strict(),L({kind:V(`receipt`),status:V(`input_required`),field:V(`digest`),message:M().min(1)}).strict()]),ew=L({cardId:M().min(1),permission:M().min(1)}).strict();ew.extend({revision:N().int().nonnegative(),input:z(M(),F())}).strict();var tw=JC.extend({cardId:M().min(1),revision:N().int().nonnegative(),attemptId:M().min(1).optional()}),nw=GC.extend({cardId:M().min(1),revision:N().int().nonnegative()}),rw={account:WC.uiOpenAccount,receipt:WC.uiOpenReceipt,chart:WC.uiOpenChart,read:WC.uiReadCard,submit:WC.uiSubmitCard,act:WC.uiActCard};function Z(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}function iw(e,t){let n=Z(e);if(!n)throw Error(`The app did not provide a usable card response.`);if(n.structuredContent!==void 0)return n;if(Array.isArray(n.content))for(let e of n.content){let r=Z(e);if(r?.type!==`text`||typeof r.text!=`string`)continue;let i;try{i=Z(JSON.parse(r.text))}catch{continue}if(i?.ok!==void 0)return{...n,structuredContent:i};if(t===`chatgpt`&&i&&Array.isArray(i.content))return iw(i,void 0)}return n}function aw(e,t){let n=Z(Z(e?.data)?.request);return!!e&&(e.kind===`receipt`||e.kind===`review`)&&t.cardId===e.cardId&&t.revision===e.revision&&t.transactionDigest===(e.kind===`receipt`?e.input.digest:n?.transactionDigest)&&(e.kind!==`review`||t.attemptId===n?.attemptId)}function ow(e,t){let n;for(let r of Array.isArray(e.content)?e.content:[]){let e=Z(r),i;if(e?.type===`resource_link`&&typeof e.uri==`string`&&e.uri.startsWith(`suimcp://cards/`)&&(i=e.uri),t===`Claude`&&e?.type===`text`&&typeof e.text==`string`){let t=/^\[Resource link: card_([A-Za-z0-9_-]+)\] (suimcp:\/\/cards\/([A-Za-z0-9_-]+)) \(Saved data for this exact card\.\)$/.exec(e.text);if(t){if(t[1]!==t[3])throw Error(`The saved card links could not be matched to one card.`);i=t[2]}}if(i===void 0)continue;let a=i.slice(QC.length);if(!a||encodeURIComponent(a)!==a||n!==void 0&&a!==n||e?.type===`resource_link`&&typeof e.name==`string`&&e.name.startsWith(`card_`)&&e.name!==`card_${a}`)throw Error(`The saved card links could not be matched to one card.`);n=a}return n}function sw(e){let t=Z(e.structuredContent),n=t?.ok===!0?$C.safeParse(t.data):void 0,r=Z(Z(t?.error)?.details),i=n?.success?void 0:t?.ok===!0?Z(t.data)?.card??t.data:r?.snapshot,a=i===void 0?void 0:qC.parse(i),o=Z(e._meta)?.[XC],s=o===void 0?void 0:tw.parse(o);if(s&&!aw(a,s))throw Error(`Transaction details do not match this saved result.`);let c=Z(e._meta)?.[ZC],l=c===void 0?void 0:nw.parse(c);if(l&&(!a||a.kind!==`connect`||l.cardId!==a.cardId||l.revision!==a.revision||l.connectionId!==Z(Z(a.data)?.connection)?.connectionId))throw Error(`The connection QR code does not match this card.`);return{snapshot:a,display:s,wallet:l,inputRequired:n?.success?n.data:void 0,error:typeof r?.message==`string`?r.message:typeof r?.reason==`string`?r.reason:void 0}}function cw(e,t){let n=document.getElementById(`app`);if(!n)throw Error(`Card root is unavailable.`);let r=document.createElement(`h1`);r.textContent=t.title;let i=document.createElement(`p`);i.className=`ui-note`,i.setAttribute(`role`,`status`);let a=document.createElement(`p`);a.className=`ui-error`,a.setAttribute(`role`,`alert`);let o=document.createElement(`p`);o.className=`ui-note card-guidance`;let s=document.createElement(`section`),c=document.createElement(`div`);c.className=`card-actions`;let l=document.createElement(`div`);l.className=`card-progress-hint`,l.hidden=!0,n.replaceChildren(r,i,a,s,o,l,c);let u=new Wv({name:`sui-mcp-card`,version:`0.5.0`},{},{autoResize:!0,strict:!0}),d=new AbortController,f=e===`connect`||e===`review`,p,m,h,g,_,ee,te,v=!1,ne=!1,re,ie,y={status:`unconfirmed`},ae,b,oe,x,S,se=`continue`,ce,le,ue=0,de=0,fe,pe,me,he,C,ge,_e,w,ve=!1;function T(){if(!x||!g)return;let{input:e,basis:t}=x,n=Z(g.data),r=Z(t.data),i=Z(n?.request),a=Z(n?.review),o=Z(n?.connection),s=Z(r?.request),c=Z(r?.connection),l=!!i&&i.attemptId===s?.attemptId,u=!!o&&o.connectionId===c?.connectionId;if(!f)return g.state===`running`||g.reason===`completed`?x.delivery===`rejected`?`past`:`observed`:g.state===`closed`?`past`:`active`;if(e.walletRunId&&e.walletRunId!==Z(n?.walletAvailability)?.walletRunId&&e.walletRunId!==n?.acceptedWalletRunId)return`past`;switch(e.action){case`connect`:if(g.state!==`ready`&&o)return`observed`;if(n?.walletAvailability&&Z(n.walletAvailability)?.status===`available`&&Array.isArray(n.connections)&&n.connections.some(e=>Z(e)?.status===`connected`))return`past`;break;case`prepare_review`:if(typeof a?.reviewRevision==`number`&&typeof e.reviewRevision==`number`&&a.reviewRevision>e.reviewRevision)return a.account===e.account?`observed`:`past`;break;case`request_signature`:if(i?.account===e.account&&i?.reviewRevision===e.reviewRevision)return`observed`;if(typeof a?.reviewRevision==`number`&&typeof e.reviewRevision==`number`&&a.reviewRevision>e.reviewRevision||!i&&a&&a.reviewRevision===e.reviewRevision&&a.account===e.account&&a.status===`refresh_required`&&Z(a.state)?.refreshReason===`review_evidence_stale`&&Array.isArray(n?.allowedActions)&&n.allowedActions.includes(`prepare_review`))return`past`;break;case`cancel`:if(g.reason===`cancelled`)return`observed`;break;case`disconnect`:if(o&&o.connectionId===e.connectionId&&(o.pendingAction===`disconnect`||g.state!==`ready`&&o.status===`disconnected`))return`observed`;break;case`use_account`:if(g.reason===`completed`&&n?.activeAccount===e.account&&o?.connectionId===e.connectionId)return`observed`;break;case`stop_connection`:if(u&&o?.status===`stopped`)return`observed`;if(u&&o?.status!==`awaiting_approval`)return`past`;break;case`stop_waiting`:if(l&&(i?.requestStatus===`stopped`||n?.observationStopped===!0))return`observed`;if(l&&[`completed`,`request_failed`,`outcome_unknown`].includes(String(i?.requestStatus)))return`past`;break;case`read_result`:if(l&&(n?.observe===!0||i?.requestStatus===`completed`))return`observed`;if(l&&[`stopped`,`request_failed`].includes(String(i?.requestStatus)))return`past`;break}return ye()||typeof n?.actionRemainingMs==`number`&&n.actionRemainingMs<=0||[`connect`,`disconnect`,`use_account`,`cancel`,`prepare_review`,`request_signature`].includes(String(e.action))&&(g.state!==`ready`||a?.status===`expired`)?`past`:`active`}function ye(){let e=BC.safeParse(x?.input);if(!e.success||e.data.action!==`disconnect`&&e.data.action!==`use_account`)return!1;let t=e.data,n=HC.safeParse(g?.data);if(!n.success)return!1;let r=n.data.connections.find(e=>e.connectionId===t.connectionId);return r?[`disconnected`,`failed`,`rejected`,`stopped`,`expired`].includes(r.status)||t.action===`use_account`&&r.status===`connected`&&!r.accounts.includes(t.account):!1}function be(){if(!x)return;let e=T();e&&x.disposition!==`observed`&&(e!==`active`||x.disposition===`active`)&&(x.disposition=e),x.disposition===`observed`&&(x.retryRequired=!1)}function xe(){let e=VC.safeParse(Z(g?.data)?.automaticAction);return x?.retryRequired&&e.success&&x.input.action===e.data.action?e.data:void 0}function Se(e){let t={connect:`connection request`,prepare_review:`review update`,request_signature:`wallet approval request`,read_result:`transaction status check`,cancel:`cancellation request`,stop_connection:`request to stop connecting`,stop_waiting:Z(Z(e.basis.data)?.request)?.requestStatus===`awaiting_signature`?`request to stop wallet approval`:`request to stop checking the result`,disconnect:`wallet disconnect request`,use_account:`account selection`};return f?t[String(e.input.action)]??`request`:`data request`}function Ce(e){if(e!==`past`||!x)return;let t=Se(x),n=x.input.action===`read_result`&&Z(Z(g?.data)?.request)?.requestStatus===`outcome_unknown`?` To check this transaction again, ask to open its result in chat.`:``;return`Message from an earlier ${t}: “${x.message}”${n}`}function we(){let t=Z(g?.data),n=Array.isArray(t?.allowedActions)?t.allowedActions:[],r=e===`review`&&t?.mode===`review`&&!t.request&&!!p&&g?.state===`ready`,i=r&&fe!==void 0&&Date.now()>=fe,a=document.visibilityState!==`hidden`,o=d.signal.aborted||y.status===`rejected`,s=y.status===`confirmed`,c=x?.disposition,l=c===`active`,u=x?.retryRequired===!0,h=x?.input.action===`request_signature`&&c===`active`,_=se===`paused`,ee=ge?.pending?.()===!0,te=ge?.displayRecovery?.(),ne=s&&!o&&!b&&!ee&&!i&&!!p,re=ne&&!S&&(!f||!(ce&&(l||u||_))),ue=VC.safeParse(t?.automaticAction),pe=!!g&&(f?t?.observe===!0:g.state===`running`),me=!!m&&v&&!o&&!ce&&a&&(le===`explicit`||y.status!==`read_failed`&&(le===`background`||y.status===`needed`&&y.automatic)),he=a&&ne&&!ae&&!ce&&!le&&!S&&!u&&!h&&!_&&f&&ue.success&&n.includes(ue.data.action)?ue.data:void 0,C;!o&&m&&(y.status===`read_failed`||ae||y.status===`unconfirmed`?C=`read`:y.status===`needed`?y.automatic||(C=`read`):b||te?C=`read`:p?Z(t?.progress)?.status===`unavailable`||Z(t?.walletAvailability)?.status===`initializing`&&Z(t?.walletAvailability)?.stage===`state_sync`?C=`read`:!_&&xe()?C=`retry`:l&&!pe&&!(_&&n.length>0)&&!(x?.input.action===`prepare_review`&&n.includes(`prepare_review`)&&t?.automaticAction===void 0)&&f&&(C=`read`):(g?.state!==`closed`||b)&&(C=`read`));let _e=f?t?.actionRemainingMs:g?.inputRemainingMs;C===`retry`&&i&&(C=`read`);let w=f?t?.nextStateReadAfterMs:void 0,ve=[(f?n.length>0:g?.state===`ready`)?_e:void 0,w].filter(e=>typeof e==`number`&&Number.isFinite(e)&&e>0),T=!o&&!!p&&a&&!ie&&!ae&&y.status!==`read_failed`,ye=Z(t?.review),be=r&&!o&&!ae&&!b&&!l&&!u&&!_&&y.status!==`read_failed`&&(ee||S?.input.action===`prepare_review`||ye?.preparing===!0||ue.success&&ue.data.action===`prepare_review`||y.status===`needed`&&ye?.status===`ready_for_wallet_review`);return{current:s,inputEnabled:re,permitted:n,disposition:c,read:me,auto:he,recover:C,paused:_,partialDisplayFailure:te,reviewUpdatePending:be,reviewCommandDeliveryFailed:l&&x?.input.action===`prepare_review`,reviewHint:i?void 0:be?ee||ye?.preparing||S?.input.action===`prepare_review`?`Updating review…`:`Checking status…`:r&&Z(ye?.state)?.refreshReason===`review_evidence_stale`?`Review details are out of date.`:void 0,errors:[y.status===`rejected`?y.message:y.status===`read_failed`?`This card's status could not be checked. Reported message: “${y.message}”`:void 0,ae&&y.status!==`rejected`?`This card could not be opened. Reported message: “${ae}”`:void 0,l&&x?`Message for this ${Se(x)}: “${x.message}”`:void 0,b,te?.message],note:[oe,Ce(c)].filter(Boolean).join(` `),expiryAt:T&&s&&ve.length?de+Math.min(...ve):void 0,poll:T&&(pe||y.status===`needed`&&!y.automatic),lifetimeAt:!o&&a&&r?fe:void 0}}function Te(e){return e.recover===`retry`?x?.input.action===`connect`?`Retry connection`:`Retry review`:e.recover===`read`?`Check status`:void 0}function Ee(e){if(d.signal.aborted)return``;let n=e.errors.some(Boolean)||e.recover!==void 0||!!g&&!p&&g.state!==`closed`||g?.state===`closed`&&g.reason!==`completed`,r=e.errors.some(Boolean)||y.status!==`confirmed`||e.recover===`retry`;if(n&&r&&y.status!==`rejected`){if(ce||e.read)return`Checking status…`;let t=Te(e);if(t)return t===`Check status`?b||e.partialDisplayFailure?`Use Check status to read this card and try displaying it again.`:`Use Check status to read this card again.`:t===`Retry connection`?`Use Retry connection to try connecting your wallet again.`:`Use Retry review to try again with the displayed wallet and account.`;if(De(e)&&ge?.selectionHint)return ge.selectionHint}return t.guidance?.(g,{confirmed:e.current,readOnly:!p,recoveryNeeded:n,visibleConfirmation:ge?.visibleConfirmation?.(),commandPending:f&&S&&e.current&&!e.errors.some(Boolean)&&(S.phase===`confirming`||g?.state===`ready`&&!Z(g.data)?.runtimeRecovery&&!Z(g.data)?.request&&!Z(Z(g.data)?.review)?.preparing)?{phase:S.phase,action:String(S.input.action)}:void 0,approvalUnresolved:x?.input.action===`request_signature`&&e.disposition===`active`||S?.input.action===`request_signature`,automaticPaused:e.paused})??``}function De(e=we()){return e.inputEnabled&&g?.state===`ready`&&ve}function Oe(e,t=we()){return f&&t.inputEnabled&&(e?t.permitted.includes(e.action):t.permitted.length>0)}function ke(e){let u=Z(g?.data),m=s.querySelector(`.review-action-feedback`),h=s.querySelector(`.review-primary-action`);if(h&&m){let e=s.querySelector(`.review-lifetime`);e?(e.append(l),m.prepend(a)):m.prepend(l,a),m.append(o)}else n.insertBefore(a,s),n.insertBefore(l,c),n.insertBefore(o,l);a.className=h?`ui-note`:`ui-error`,g?(r.textContent=t.titleFor?.(g)??t.title,i.textContent=y.status===`rejected`?`Card unavailable`:!e.current&&g.state===`ready`?h?``:!d.signal.aborted&&(ce||e.read)?`Checking whether actions are available in this card…`:`Actions are unavailable until this card's status is checked.`:!p&&g.state!==`closed`?`View only.`:f?Z(u?.progress)?.status===`unavailable`?`Current progress is unavailable. The last recorded state is shown.`:!u?.request&&g.state===`closed`&&[`expired`,`server_restarted`,`cancelled`].includes(g.reason??``)?`This card no longer accepts actions.`:``:g.state===`running`?`Reading the requested data…`:g.reason===`completed`?``:g.error??(g.reason===`expired`?`The time to make a selection has ended.`:g.reason===`server_restarted`?`This request ended when Sui MCP restarted.`:``)):i.textContent=ie?``:y.status===`read_failed`?`Card status unavailable`:ae||y.status===`rejected`?`Card unavailable`:`Opening card…`,i.hidden=!i.textContent,a.textContent=[...new Set(e.errors.filter(Boolean))].join(` `),a.hidden=!a.textContent;let _=s.querySelector(`.review-status`);_&&(_.hidden=!!h&&(e.reviewUpdatePending||!!a.textContent));let ee=s.querySelector(`.review-material-status`);if(ee&&(ee.textContent=ee.dataset.previous===`true`||!e.current||e.reviewUpdatePending?ee.dataset.previousLabel??``:ee.dataset.currentLabel??``),o.textContent=[e.note,Ee(e)].filter(Boolean).join(` `),o.hidden=!o.textContent,ve)for(let t of s.querySelectorAll(`input, button, select`))(!f||t.tagName!==`BUTTON`||t.dataset.cardAction!==void 0)&&(t.disabled=f?!Oe(void 0,e):!De(e));if(f)for(let t of s.querySelectorAll(`[data-card-action]`))t.disabled=!Oe({action:t.dataset.cardAction},e);h&&(e.reviewUpdatePending||h.dataset.cardAction===`request_signature`&&e.reviewCommandDeliveryFailed||h.dataset.cardAction===void 0)&&(h.disabled=!0),C&&(C.disabled=!!S||!!ce)}function Ae(e){try{e?.()}catch{b=`The card display could not be closed cleanly. Its stored information is unchanged.`}}function je(e){if(!g||d.signal.aborted||g.state===`ready`&&y.status!==`confirmed`)return;if(g.state===`running`&&!f){b=void 0;return}let n=f?{...Z(g.data),actionRemainingMs:void 0,nextStateReadAfterMs:void 0}:void 0,r=`${se===`paused`}:${g.revision}:${p!==void 0}:${_!==void 0}:${te!==void 0}:${JSON.stringify(n)}`;if(r===_e||r===w&&!e)return;w=r;let i=[...s.children],a=new Set([...s.querySelectorAll(`details`)].filter(e=>e.open).map(e=>e.querySelector(`summary`)?.textContent)),o,c=!1,l=!1;try{let e={automaticPaused:se===`paused`,onDisplayChange:()=>Fe()};if(ge?.update?.(g,e)){_e=r,b=void 0;return}if(g.state===`ready`&&p){let n=t.controls(g,e=>{He(e)},_,te,e);o=`node`in n?n:{node:n},c=!0}else (f||g.reason===`completed`)&&g.data!==void 0&&(o=t.result(g,_,p?e=>{He(e)}:void 0,te,e));s.replaceChildren(...o?[o.node]:[]),l=!0,o?.mount?.();for(let e of s.querySelectorAll(`details`))a.has(e.querySelector(`summary`)?.textContent)&&(e.open=!0)}catch{l&&s.replaceChildren(...i),Ae(o?.dispose),b=`This card could not be displayed. Its stored information is unchanged.`;return}let u=ge?.dispose;ge=o,ve=c,_e=r,b=void 0,Ae(u)}function Me(t,n,r,i,a){if(d.signal.aborted||y.status===`rejected`)return!1;if(t.kind!==e||t.cardId!==m)throw y={status:`rejected`,message:`The returned information does not match this card.`},Error(`The returned information does not match this card.`);let o=Z(t.data),s=Z(o?.request),c=Z(s?.execution),l=o?.automaticAction===void 0?void 0:VC.safeParse(o.automaticAction);if(l&&!l.success)throw Error(`This card could not start the next step.`);if(g&&t.revision<g.revision)return!1;if(h&&[...new Set([...Object.keys(h),...Object.keys(t.input)])].some(e=>JSON.stringify(t.input[e])!==JSON.stringify(h[e])))throw y={status:`rejected`,message:`The returned information does not match this card.`},Error(`The returned information does not match this card.`);if(e===`review`&&(Z(o?.review)?.reviewSessionId!==void 0&&Z(o?.review)?.reviewSessionId!==t.input.reviewSessionId||s&&(s.reviewSessionId!==t.input.reviewSessionId||t.input.attemptId!==void 0&&s.attemptId!==t.input.attemptId)||c&&(c.reviewSessionId!==s?.reviewSessionId||c.attemptId!==s?.attemptId||c.txDigest!==s?.transactionDigest)||Z(o?.receipt)?.status===`found`&&Z(Z(o?.receipt)?.receipt)?.txDigest!==s?.transactionDigest)||e===`receipt`&&o?.status===`found`&&Z(o.receipt)?.txDigest!==t.input.digest)throw y={status:`rejected`,message:`The saved result does not match the information requested in this card.`},Error(y.message);!h&&(f||t.state!==`ready`)&&(h={...t.input});let u=r!==`preview`;return(!g||t.revision!==g.revision)&&(_=void 0,te=void 0),g=t,be(),u&&(de=Date.now(),p&&e===`review`&&o?.mode===`review`&&!o.request&&typeof o.actionRemainingMs==`number`&&Number.isFinite(o.actionRemainingMs)&&o.actionRemainingMs>=0&&(fe=Math.min(fe??1/0,de+o.actionRemainingMs))),r===`read`&&(y.status!==`needed`||a>y.afterRead)&&(y={status:`confirmed`},ae=void 0),n&&(_=n),te=i,!0}function Ne(){pe!==void 0&&clearTimeout(pe),me!==void 0&&clearTimeout(me),he!==void 0&&clearTimeout(he),pe=void 0,me=void 0,he=void 0,l.hidden=!0}function E(e){let t=Te(e);C?.textContent!==t&&(C?.remove(),C=void 0,t&&(C=Kv(t,()=>{if(!(ce||S||d.signal.aborted))if(we().recover===`retry`){let e=xe();e&&Ve(e)}else Pe()})));let n=s.querySelector(`.review-primary-action`),r=s.querySelector(`.review-primary-slot`);n&&(n.hidden=!!C&&!!r),C&&(C.disabled=!!ce||!!S,r?(C.classList.add(`review-recovery-action`),r.append(C)):(C.classList.remove(`review-recovery-action`),c.append(C)))}async function Pe(){let e=ge,t=e?.displayRecovery?.(),n=await Le(!0);n?.kind===`accepted`&&g===n.snapshot&&y.status===`confirmed`&&!d.signal.aborted&&document.visibilityState!==`hidden`&&!b&&e===ge&&t&&e?.displayRecovery?.()===t&&(t.retry(),Fe())}function Fe(e=!1){if(ie){let e=document.createElement(`p`);e.className=`ui-note`,e.textContent=ie,s.replaceChildren(e)}else je(e);let t=we();if(ke(t),Ne(),E(t),d.signal.aborted||y.status===`rejected`)return;t.expiryAt!==void 0&&(me=setTimeout(()=>{Ie(),Fe()},Math.max(0,t.expiryAt-Date.now()))),t.reviewHint&&!a.textContent&&(l.replaceChildren(),l.textContent=t.reviewHint,l.setAttribute(`role`,`status`),l.hidden=!1);let n=s.querySelector(`.review-time-remaining`);if(n&&t.lifetimeAt!==void 0){let e=t.lifetimeAt,r=()=>{if(d.signal.aborted)return;let t=Math.max(0,e-Date.now()),i=Math.ceil(t/1e3);if(n.textContent=t>0?`Review expires in ${Math.floor(i/60)}:${String(i%60).padStart(2,`0`)}`:`Review time elapsed`,t>0)he=setTimeout(r,Math.min(1e3,t));else{let e=we();ke(e),E(e)}};r()}if(t.poll&&g){let e=de+g.pollAfterMs-Date.now();pe=setTimeout(()=>{Le(!1)},e>0?e:g.pollAfterMs)}t.read?(le=void 0,Re()):t.auto&&(pe=setTimeout(()=>{let e=we().auto;e&&We(e,`automatic`)},0))}function Ie(){y.status!==`rejected`&&y.status!==`read_failed`&&(y={status:`needed`,afterRead:ue,automatic:!0})}function Le(e){return d.signal.aborted||y.status===`rejected`||!m||!v?Promise.resolve(void 0):ce?ce.promise:y.status===`read_failed`&&!e?Promise.resolve(void 0):(le=e?`explicit`:`background`,Fe(),ce?.promise??Promise.resolve(void 0))}function Re(){let e=++ue,t={id:e,promise:Promise.resolve().then(async()=>{try{let t,n,r;if(p){let e=sw(await ze(rw.read,p));if(!e.snapshot)throw Error(e.error??`Saved card data is unavailable.`);if(e.error)throw Error(e.error);t=e.snapshot,n=e.display,r=e.wallet}else{let e=`${QC}${encodeURIComponent(m)}`,r=(await u.readServerResource({uri:e},{signal:d.signal})).contents.find(t=>t.uri===e&&`text`in t);if(!r||!(`text`in r))throw Error(`Saved card data is unavailable.`);t=qC.parse(JSON.parse(r.text));let i=_??ee;n=i&&aw(t,i)?i:void 0}if(d.signal.aborted||y.status===`rejected`)return{kind:`disposed`,id:e};let i=Me(t,n,`read`,r,e);return ee=void 0,!i&&y.status===`needed`&&e>y.afterRead&&(y={...y,automatic:!1}),Fe(i),i&&y.status===`confirmed`?{kind:`accepted`,snapshot:t,id:e}:{kind:`ignored`,id:e}}catch(t){return d.signal.aborted?{kind:`disposed`,id:e}:(y.status!==`rejected`&&(y={status:`read_failed`,message:t instanceof Error?t.message:`Saved card data could not be read. The last displayed result is unchanged.`}),{kind:`failed`,id:e})}}).finally(()=>{ce===t&&(ce=void 0),Fe()})};ce=t,Fe()}async function ze(e,t){return iw(await u.callServerTool({name:e,arguments:t},{signal:d.signal}),u.getHostVersion()?.name)}function Be(e,t,n){let r=HC.safeParse(n.data);if(!r.success||!r.data.allowedActions.some(t=>t===e.action))return!1;let i=r.data,a=Z(t.data);return e.walletRunId&&e.walletRunId!==i.walletAvailability.walletRunId?!1:e.action===`connect`?i.allowedActions.includes(`connect`)&&[`connect`,`manage`].includes(String(n.input.intent)):e.action===`prepare_review`||e.action===`request_signature`?i.review?.reviewRevision===e.reviewRevision&&(e.action===`prepare_review`?i.assetReadAccount?.status===`available`?i.assetReadAccount.account:void 0:i.review?.account)===e.account&&UC(i,String(e.account),e.action===`request_signature`).some(t=>t.connectionId===e.connectionId):e.action===`disconnect`||e.action===`use_account`?i.connections.some(t=>t.connectionId===e.connectionId&&t.status===`connected`&&!t.pendingAction&&(e.action!==`use_account`||t.connectionId===i.usableConnectionId&&t.accounts.includes(String(e.account)))):i.connection?.connectionId===Z(a?.connection)?.connectionId&&i.request?.attemptId===Z(a?.request)?.attemptId&&i.review?.reviewRevision===Z(a?.review)?.reviewRevision}async function Ve(e){if(!g||ce||!Oe(e))return;let t={input:e,basis:g,phase:`confirming`};S=t;let n=await Le(!1);S===t&&(S=void 0,n?.kind===`accepted`&&g===n.snapshot&&y.status===`confirmed`&&!d.signal.aborted&&document.visibilityState!==`hidden`&&Be(e,t.basis,n.snapshot)&&Oe(e)?await We(e):y.status!==`read_failed`&&y.status!==`rejected`&&!d.signal.aborted&&(oe=`The card state changed. Check the current selection before trying again.`),Fe())}async function He(e){f&&(x?.disposition===`active`||x?.retryRequired||se===`paused`)?await Ve(e):await We(e)}function Ue(e,t,n){x={input:e.input,basis:e.basis,message:t,delivery:n,disposition:`active`,retryRequired:e.input.action===`connect`||e.input.action===`prepare_review`},be(),[`cancel`,`disconnect`,`stop_connection`,`stop_waiting`,`use_account`].includes(String(e.input.action))&&(se=`paused`),(f||n===`unknown`)&&Ie()}async function We(e,t=`user`){if(!g||!p||(f?!Oe(e):!De()))return;let n={input:e,basis:g,phase:`sending`};S=n,se=`continue`,(t===`user`||x?.disposition!==`past`)&&(x=void 0),oe=void 0,Fe();try{let t=sw(await ze(f?rw.act:rw.submit,{...p,revision:n.basis.revision,input:e}));if(d.signal.aborted||y.status===`rejected`)return;if(!t.snapshot)throw Error(t.error??`The request could not be confirmed.`);t.error&&Ue(n,t.error,`rejected`),Me(t.snapshot,t.display,`action`,t.wallet)}catch(e){!d.signal.aborted&&y.status!==`rejected`&&Ue(n,e instanceof Error?e.message:`The request could not be confirmed.`,`unknown`)}finally{S===n&&(S=void 0),Fe()}}async function Ge(){if(!(!v||re===void 0||ne)){ne=!0;try{let t=iw(re,u.getHostVersion()?.name),n=Z(t._meta);if(t._meta!==void 0&&!n)throw Error(`This card cannot accept actions with the access information provided by the app.`);let r=n?.[YC];if(r!==void 0){let e=ew.safeParse(r);if(!e.success)throw Error(`This card cannot accept actions with the access information provided by the app.`);p=e.data}let i=sw(t);if(i.inputRequired){if(i.inputRequired.kind!==e||p)throw Error(`The app provided inconsistent card input information.`);ie=i.inputRequired.message,Fe();return}let a=ow(t,u.getHostVersion()?.name),o=[i.snapshot?.cardId,p?.cardId,a].filter(e=>e!==void 0);if(!o.length)throw Error(`Card data is unavailable.`);if(o.some(e=>e!==o[0])||i.snapshot&&i.snapshot.kind!==e)throw y={status:`rejected`,message:`The returned information does not match this card.`},Error(y.message);m=o[0];let s=i.snapshot;s&&(f||s.state!==`ready`)&&(h={...s.input}),ee=i.display,s&&p&&Me(s,i.display,`preview`,i.wallet),Ie(),Fe()}catch(e){if(d.signal.aborted)return;ae=e instanceof Error?e.message:`Card data could not be read.`,Fe()}}}u.ontoolresult=e=>{if(re===void 0){re=e,Ge();return}try{let t=sw(iw(re,u.getHostVersion()?.name)).snapshot??g,n=sw(iw(e,u.getHostVersion()?.name)).snapshot;if(t&&n&&(t.cardId!==n.cardId||t.kind!==n.kind))throw Error(`The app returned a different card.`)}catch{y={status:`rejected`,message:`The returned information does not match this card.`},Fe()}},u.onhostcontextchanged=e=>{e.theme&&(document.documentElement.dataset.theme=e.theme)};let Ke=()=>{document.visibilityState!==`hidden`&&p&&ne&&y.status!==`read_failed`?Le(!1):Fe()};document.addEventListener?.(`visibilitychange`,Ke),u.onteardown=async()=>{if(d.signal.aborted)return{};d.abort(),S=void 0,document.removeEventListener?.(`visibilitychange`,Ke);let e=ge?.dispose;return ge=void 0,Ae(e),Fe(),{}},u.connect().then(()=>{d.signal.aborted||(v=!0,document.documentElement.dataset.theme=u.getHostContext()?.theme??`light`,Ge())}).catch(()=>{d.signal.aborted||(ae=`Could not connect this card to the app.`,Fe())})}function Q(e){var t=e.width,n=e.height;if(t<0)throw Error(`Negative width is not allowed for Size`);if(n<0)throw Error(`Negative height is not allowed for Size`);return{width:t,height:n}}function lw(e,t){return e.width===t.width&&e.height===t.height}var uw=function(){function e(e){var t=this;this._resolutionListener=function(){return t._onResolutionChanged()},this._resolutionMediaQueryList=null,this._observers=[],this._window=e,this._installResolutionListener()}return e.prototype.dispose=function(){this._uninstallResolutionListener(),this._window=null},Object.defineProperty(e.prototype,`value`,{get:function(){return this._window.devicePixelRatio},enumerable:!1,configurable:!0}),e.prototype.subscribe=function(e){var t=this,n={next:e};return this._observers.push(n),{unsubscribe:function(){t._observers=t._observers.filter(function(e){return e!==n})}}},e.prototype._installResolutionListener=function(){if(this._resolutionMediaQueryList!==null)throw Error(`Resolution listener is already installed`);var e=this._window.devicePixelRatio;this._resolutionMediaQueryList=this._window.matchMedia(`all and (resolution: ${e}dppx)`),this._resolutionMediaQueryList.addListener(this._resolutionListener)},e.prototype._uninstallResolutionListener=function(){this._resolutionMediaQueryList!==null&&(this._resolutionMediaQueryList.removeListener(this._resolutionListener),this._resolutionMediaQueryList=null)},e.prototype._reinstallResolutionListener=function(){this._uninstallResolutionListener(),this._installResolutionListener()},e.prototype._onResolutionChanged=function(){var e=this;this._observers.forEach(function(t){return t.next(e._window.devicePixelRatio)}),this._reinstallResolutionListener()},e}();function dw(e){return new uw(e)}var fw=function(){function e(e,t,n){this._canvasElement=null,this._bitmapSizeChangedListeners=[],this._suggestedBitmapSize=null,this._suggestedBitmapSizeChangedListeners=[],this._devicePixelRatioObservable=null,this._canvasElementResizeObserver=null,this._canvasElement=e,this._canvasElementClientSize=Q({width:this._canvasElement.clientWidth,height:this._canvasElement.clientHeight}),this._transformBitmapSize=t??(function(e){return e}),this._allowResizeObserver=n?.allowResizeObserver??!0,this._chooseAndInitObserver()}return e.prototype.dispose=function(){var e,t;if(this._canvasElement===null)throw Error(`Object is disposed`);(e=this._canvasElementResizeObserver)==null||e.disconnect(),this._canvasElementResizeObserver=null,(t=this._devicePixelRatioObservable)==null||t.dispose(),this._devicePixelRatioObservable=null,this._suggestedBitmapSizeChangedListeners.length=0,this._bitmapSizeChangedListeners.length=0,this._canvasElement=null},Object.defineProperty(e.prototype,`canvasElement`,{get:function(){if(this._canvasElement===null)throw Error(`Object is disposed`);return this._canvasElement},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,`canvasElementClientSize`,{get:function(){return this._canvasElementClientSize},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,`bitmapSize`,{get:function(){return Q({width:this.canvasElement.width,height:this.canvasElement.height})},enumerable:!1,configurable:!0}),e.prototype.resizeCanvasElement=function(e){this._canvasElementClientSize=Q(e),this.canvasElement.style.width=`${this._canvasElementClientSize.width}px`,this.canvasElement.style.height=`${this._canvasElementClientSize.height}px`,this._invalidateBitmapSize()},e.prototype.subscribeBitmapSizeChanged=function(e){this._bitmapSizeChangedListeners.push(e)},e.prototype.unsubscribeBitmapSizeChanged=function(e){this._bitmapSizeChangedListeners=this._bitmapSizeChangedListeners.filter(function(t){return t!==e})},Object.defineProperty(e.prototype,`suggestedBitmapSize`,{get:function(){return this._suggestedBitmapSize},enumerable:!1,configurable:!0}),e.prototype.subscribeSuggestedBitmapSizeChanged=function(e){this._suggestedBitmapSizeChangedListeners.push(e)},e.prototype.unsubscribeSuggestedBitmapSizeChanged=function(e){this._suggestedBitmapSizeChangedListeners=this._suggestedBitmapSizeChangedListeners.filter(function(t){return t!==e})},e.prototype.applySuggestedBitmapSize=function(){if(this._suggestedBitmapSize!==null){var e=this._suggestedBitmapSize;this._suggestedBitmapSize=null,this._resizeBitmap(e),this._emitSuggestedBitmapSizeChanged(e,this._suggestedBitmapSize)}},e.prototype._resizeBitmap=function(e){var t=this.bitmapSize;lw(t,e)||(this.canvasElement.width=e.width,this.canvasElement.height=e.height,this._emitBitmapSizeChanged(t,e))},e.prototype._emitBitmapSizeChanged=function(e,t){var n=this;this._bitmapSizeChangedListeners.forEach(function(r){return r.call(n,e,t)})},e.prototype._suggestNewBitmapSize=function(e){var t=this._suggestedBitmapSize,n=Q(this._transformBitmapSize(e,this._canvasElementClientSize)),r=lw(this.bitmapSize,n)?null:n;t===null&&r===null||t!==null&&r!==null&&lw(t,r)||(this._suggestedBitmapSize=r,this._emitSuggestedBitmapSizeChanged(t,r))},e.prototype._emitSuggestedBitmapSizeChanged=function(e,t){var n=this;this._suggestedBitmapSizeChangedListeners.forEach(function(r){return r.call(n,e,t)})},e.prototype._chooseAndInitObserver=function(){var e=this;if(!this._allowResizeObserver){this._initDevicePixelRatioObservable();return}hw().then(function(t){return t?e._initResizeObserver():e._initDevicePixelRatioObservable()})},e.prototype._initDevicePixelRatioObservable=function(){var e=this;if(this._canvasElement!==null){var t=mw(this._canvasElement);if(t===null)throw Error(`No window is associated with the canvas`);this._devicePixelRatioObservable=dw(t),this._devicePixelRatioObservable.subscribe(function(){return e._invalidateBitmapSize()}),this._invalidateBitmapSize()}},e.prototype._invalidateBitmapSize=function(){if(this._canvasElement!==null){var e=mw(this._canvasElement);if(e!==null){var t=this._devicePixelRatioObservable?.value??e.devicePixelRatio,n=this._canvasElement.getClientRects(),r=n[0]===void 0?Q({width:this._canvasElementClientSize.width*t,height:this._canvasElementClientSize.height*t}):gw(n[0],t);this._suggestNewBitmapSize(r)}}},e.prototype._initResizeObserver=function(){var e=this;this._canvasElement!==null&&(this._canvasElementResizeObserver=new ResizeObserver(function(t){var n=t.find(function(t){return t.target===e._canvasElement});if(!(!n||!n.devicePixelContentBoxSize||!n.devicePixelContentBoxSize[0])){var r=n.devicePixelContentBoxSize[0],i=Q({width:r.inlineSize,height:r.blockSize});e._suggestNewBitmapSize(i)}}),this._canvasElementResizeObserver.observe(this._canvasElement,{box:`device-pixel-content-box`}))},e}();function pw(e,t){if(t.type===`device-pixel-content-box`)return new fw(e,t.transform,t.options);throw Error(`Unsupported binding target`)}function mw(e){return e.ownerDocument.defaultView}function hw(){return new Promise(function(e){var t=new ResizeObserver(function(n){e(n.every(function(e){return`devicePixelContentBoxSize`in e})),t.disconnect()});t.observe(document.body,{box:`device-pixel-content-box`})}).catch(function(){return!1})}function gw(e,t){return Q({width:Math.round(e.left*t+e.width*t)-Math.round(e.left*t),height:Math.round(e.top*t+e.height*t)-Math.round(e.top*t)})}var _w=function(){function e(e,t,n){if(t.width===0||t.height===0)throw TypeError(`Rendering target could only be created on a media with positive width and height`);if(this._mediaSize=t,n.width===0||n.height===0)throw TypeError(`Rendering target could only be created using a bitmap with positive integer width and height`);this._bitmapSize=n,this._context=e}return e.prototype.useMediaCoordinateSpace=function(e){try{return this._context.save(),this._context.setTransform(1,0,0,1,0,0),this._context.scale(this._horizontalPixelRatio,this._verticalPixelRatio),e({context:this._context,mediaSize:this._mediaSize})}finally{this._context.restore()}},e.prototype.useBitmapCoordinateSpace=function(e){try{return this._context.save(),this._context.setTransform(1,0,0,1,0,0),e({context:this._context,mediaSize:this._mediaSize,bitmapSize:this._bitmapSize,horizontalPixelRatio:this._horizontalPixelRatio,verticalPixelRatio:this._verticalPixelRatio})}finally{this._context.restore()}},Object.defineProperty(e.prototype,`_horizontalPixelRatio`,{get:function(){return this._bitmapSize.width/this._mediaSize.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,`_verticalPixelRatio`,{get:function(){return this._bitmapSize.height/this._mediaSize.height},enumerable:!1,configurable:!0}),e}();function vw(e,t){var n=e.canvasElementClientSize;if(n.width===0||n.height===0)return null;var r=e.bitmapSize;if(r.width===0||r.height===0)return null;var i=e.canvasElement.getContext(`2d`,t);return i===null?null:new _w(i,n,r)}var yw={title:``,visible:!0,hitTestTolerance:3,lastValueVisible:!0,priceLineVisible:!0,priceLineSource:0,priceLineWidth:1,priceLineColor:``,priceLineStyle:2,baseLineVisible:!0,baseLineWidth:1,baseLineColor:`#B2B5BE`,baseLineStyle:0,priceFormat:{type:`price`,precision:2,minMove:.01}},bw,xw;function Sw(e,t){let n=function(e,t){switch(e){case 0:default:return[];case 1:return[t,t];case 2:return[2*t,2*t];case 3:return[6*t,6*t];case 4:return[t,4*t]}}(t,e.lineWidth);return e.setLineDash(n),n}function Cw(e,t,n,r){e.beginPath();let i=e.lineWidth%2?.5:0;e.moveTo(n,t+i),e.lineTo(r,t+i),e.stroke()}function ww(e,t){if(!e)throw Error(`Assertion failed`+(t?`: `+t:``))}function Tw(e){if(e===void 0)throw Error(`Value is undefined`);return e}function $(e){if(e===null)throw Error(`Value is null`);return e}function Ew(e){return $(Tw(e))}(function(e){e[e.Simple=0]=`Simple`,e[e.WithSteps=1]=`WithSteps`,e[e.Curved=2]=`Curved`})(bw||={}),function(e){e[e.Solid=0]=`Solid`,e[e.Dotted=1]=`Dotted`,e[e.Dashed=2]=`Dashed`,e[e.LargeDashed=3]=`LargeDashed`,e[e.SparseDotted=4]=`SparseDotted`}(xw||={});var Dw=class{constructor(){this.t=[]}i(e,t,n){let r={h:e,l:t,o:!0===n};this.t.push(r)}_(e){let t=this.t.findIndex((t=>e===t.h));t>-1&&this.t.splice(t,1)}u(e){this.t=this.t.filter((t=>t.l!==e))}p(e,t,n){let r=[...this.t];this.t=this.t.filter((e=>!e.o)),r.forEach((r=>r.h(e,t,n)))}v(){return this.t.length>0}m(){this.t=[]}};function Ow(e,...t){for(let n of t)for(let t in n)n[t]!==void 0&&Object.prototype.hasOwnProperty.call(n,t)&&![`__proto__`,`constructor`,`prototype`].includes(t)&&(typeof n[t]!=`object`||e[t]===void 0||Array.isArray(n[t])?e[t]=n[t]:Ow(e[t],n[t]));return e}function kw(e){return typeof e==`number`&&isFinite(e)}function Aw(e){return typeof e==`number`&&e%1==0}function jw(e){return typeof e==`string`}function Mw(e){return typeof e==`boolean`}function Nw(e){let t=e;if(!t||typeof t!=`object`)return t;let n,r,i;for(r in n=Array.isArray(t)?[]:{},t)t.hasOwnProperty(r)&&(i=t[r],n[r]=i&&typeof i==`object`?Nw(i):i);return n}function Pw(e){return e!==null}function Fw(e){return e===null?void 0:e}var Iw=`-apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif`;function Lw(e,t,n){return t===void 0&&(t=Iw),`${n=n===void 0?``:`${n} `}${e}px ${t}`}var Rw=class{constructor(e){this.M={S:1,C:5,k:NaN,P:``,T:``,R:``,D:``,I:0,V:0,B:0,A:0,L:0},this.O=e}N(){let e=this.M,t=this.F(),n=this.W();return e.k===t&&e.T===n||(e.k=t,e.T=n,e.P=Lw(t,n),e.A=2.5/12*t,e.I=e.A,e.V=t/12*e.C,e.B=t/12*e.C,e.L=0),e.R=this.H(),e.D=this.U(),this.M}H(){return this.O.N().layout.textColor}U(){return this.O.$()}F(){return this.O.N().layout.fontSize}W(){return this.O.N().layout.fontFamily}};function zw(e){return e<0?0:e>255?255:Math.round(e)||0}function Bw(e){return .199*e[0]+.687*e[1]+.114*e[2]}var Vw=class{constructor(e,t){this.j=new Map,this.q=e,t&&(this.j=t)}Y(e,t){if(e===`transparent`)return e;let n=this.K(e),r=n[3];return`rgba(${n[0]}, ${n[1]}, ${n[2]}, ${t*r})`}Z(e){let t=this.K(e);return{G:`rgb(${t[0]}, ${t[1]}, ${t[2]})`,X:Bw(t)>160?`black`:`white`}}J(e){return Bw(this.K(e))}tt(e,t,n){let[r,i,a,o]=this.K(e),[s,c,l,u]=this.K(t),d=[zw(r+n*(s-r)),zw(i+n*(c-i)),zw(a+n*(l-a)),(f=o+n*(u-o),f<=0||f>1?Math.min(Math.max(f,0),1):Math.round(1e4*f)/1e4)];var f;return`rgba(${d[0]}, ${d[1]}, ${d[2]}, ${d[3]})`}K(e){let t=this.j.get(e);if(t)return t;let n=function(e){let t=document.createElement(`div`);t.style.display=`none`,document.body.appendChild(t),t.style.color=e;let n=window.getComputedStyle(t).color;return document.body.removeChild(t),n}(e).match(/^rgba?\s*\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d*\.?\d+))?\)$/);if(!n){if(this.q.length)for(let t of this.q){let n=t(e);if(n)return this.j.set(e,n),n}throw Error(`Failed to parse color: ${e}`)}let r=[parseInt(n[1],10),parseInt(n[2],10),parseInt(n[3],10),n[4]?parseFloat(n[4]):1];return this.j.set(e,r),r}},Hw=class{constructor(){this.it=[]}nt(e){this.it=e}st(e,t,n){this.it.forEach((r=>{r.st(e,t,n)}))}},Uw=class{st(e,t,n){e.useBitmapCoordinateSpace((e=>this.et(e,t,n)))}},Ww=class extends Uw{constructor(){super(...arguments),this.rt=null}ht(e){this.rt=e}et({context:e,horizontalPixelRatio:t,verticalPixelRatio:n}){if(this.rt===null||this.rt.lt===null)return;let r=this.rt.lt,i=this.rt,a=Math.max(1,Math.floor(t))%2/2,o=o=>{e.beginPath();for(let s=r.to-1;s>=r.from;--s){let r=i.ot[s],c=Math.round(r._t*t)+a,l=r.ut*n,u=o*n+a;e.moveTo(c,l),e.arc(c,l,u,0,2*Math.PI)}e.fill()};i.ct>0&&(e.fillStyle=i.dt,o(i.ft+i.ct)),e.fillStyle=i.vt,o(i.ft)}};function Gw(){return{ot:[{_t:0,ut:0,wt:0,Mt:0}],vt:``,dt:``,ft:0,ct:0,lt:null}}var Kw={from:0,to:1},qw=class{constructor(e,t,n){this.gt=new Hw,this.bt=[],this.St=[],this.xt=!0,this.O=e,this.Ct=t,this.yt=n,this.gt.nt(this.bt)}kt(e){this.Pt(),this.xt=!0}Tt(){return this.xt&&=(this.Rt(),!1),this.gt}Pt(){let e=this.yt.Dt();e.length!==this.bt.length&&(this.St=e.map(Gw),this.bt=this.St.map((e=>{let t=new Ww;return t.ht(e),t})),this.gt.nt(this.bt))}Rt(){let e=this.Ct.N().mode===2||!this.Ct.It(),t=this.yt.Vt(),n=this.Ct.Bt(),r=this.O.Et();this.Pt(),t.forEach(((t,i)=>{let a=this.St[i],o=t.At(n),s=t.Lt();!e&&o!==null&&t.It()&&s!==null?(a.vt=o.zt,a.ft=o.ft,a.ct=o.Ot,a.ot[0].Mt=o.Mt,a.ot[0].ut=t.Ft().Nt(o.Mt,s.Wt),a.dt=o.Ht??this.O.Ut(a.ot[0].ut/t.Ft().$t()),a.ot[0].wt=n,a.ot[0]._t=r.jt(n),a.lt=Kw):a.lt=null}))}},Jw=class extends Uw{constructor(e){super(),this.qt=e}et({context:e,bitmapSize:t,horizontalPixelRatio:n,verticalPixelRatio:r}){if(this.qt===null)return;let i=this.qt.Yt.It,a=this.qt.Kt.It;if(!i&&!a)return;let o=Math.round(this.qt._t*n),s=Math.round(this.qt.ut*r);e.lineCap=`butt`,i&&o>=0&&(e.lineWidth=Math.floor(this.qt.Yt.ct*n),e.strokeStyle=this.qt.Yt.R,e.fillStyle=this.qt.Yt.R,Sw(e,this.qt.Yt.Zt),function(e,t,n,r){e.beginPath();let i=e.lineWidth%2?.5:0;e.moveTo(t+i,n),e.lineTo(t+i,r),e.stroke()}(e,o,0,t.height)),a&&s>=0&&(e.lineWidth=Math.floor(this.qt.Kt.ct*r),e.strokeStyle=this.qt.Kt.R,e.fillStyle=this.qt.Kt.R,Sw(e,this.qt.Kt.Zt),Cw(e,s,0,t.width))}},Yw=class{constructor(e,t){this.xt=!0,this.Gt={Yt:{ct:1,Zt:0,R:``,It:!1},Kt:{ct:1,Zt:0,R:``,It:!1},_t:0,ut:0},this.Xt=new Jw(this.Gt),this.Jt=e,this.yt=t}kt(){this.xt=!0}Tt(e){return this.xt&&=(this.Rt(),!1),this.Xt}Rt(){let e=this.Jt.It(),t=this.yt.Qt().N().crosshair,n=this.Gt;if(t.mode===2)return n.Kt.It=!1,void(n.Yt.It=!1);n.Kt.It=e&&this.Jt.ti(this.yt),n.Yt.It=e&&this.Jt.ii(),n.Kt.ct=t.horzLine.width,n.Kt.Zt=t.horzLine.style,n.Kt.R=t.horzLine.color,n.Yt.ct=t.vertLine.width,n.Yt.Zt=t.vertLine.style,n.Yt.R=t.vertLine.color,n._t=this.Jt.ni(),n.ut=this.Jt.si()}};function Xw(e,t,n,r,i,a){e.fillRect(t+a,n,r-2*a,a),e.fillRect(t+a,n+i-a,r-2*a,a),e.fillRect(t,n,a,i),e.fillRect(t+r-a,n,a,i)}function Zw(e,t,n,r,i,a){e.save(),e.globalCompositeOperation=`copy`,e.fillStyle=a,e.fillRect(t,n,r,i),e.restore()}function Qw(e,t,n,r,i,a){e.beginPath(),e.roundRect?e.roundRect(t,n,r,i,a):(e.lineTo(t+r-a[1],n),a[1]!==0&&e.arcTo(t+r,n,t+r,n+a[1],a[1]),e.lineTo(t+r,n+i-a[2]),a[2]!==0&&e.arcTo(t+r,n+i,t+r-a[2],n+i,a[2]),e.lineTo(t+a[3],n+i),a[3]!==0&&e.arcTo(t,n+i,t,n+i-a[3],a[3]),e.lineTo(t,n+a[0]),a[0]!==0&&e.arcTo(t,n,t+a[0],n,a[0]))}function $w(e,t,n,r,i,a,o=0,s=[0,0,0,0],c=``){if(e.save(),!o||!c||c===a)return Qw(e,t,n,r,i,s),e.fillStyle=a,e.fill(),void e.restore();let l=o/2;var u;Qw(e,t+l,n+l,r-o,i-o,(u=-l,s.map((e=>e===0?e:e+u)))),a!==`transparent`&&(e.fillStyle=a,e.fill()),c!==`transparent`&&(e.lineWidth=o,e.strokeStyle=c,e.closePath(),e.stroke()),e.restore()}function eT(e,t,n,r,i,a,o){e.save(),e.globalCompositeOperation=`copy`;let s=e.createLinearGradient(0,0,0,i);s.addColorStop(0,a),s.addColorStop(1,o),e.fillStyle=s,e.fillRect(t,n,r,i),e.restore()}var tT=class{constructor(e,t){this.ht(e,t)}ht(e,t){this.qt=e,this.ei=t}$t(e,t){return this.qt.It?e.k+e.A+e.I:0}st(e,t,n,r){if(!this.qt.It||this.qt.ri.length===0)return;let i=this.qt.R,a=this.ei.G,o=e.useBitmapCoordinateSpace((e=>{let o=e.context;o.font=t.P;let s=this.hi(e,t,n,r),c=s.ai;return s.li?$w(o,c.oi,c._i,c.ui,c.ci,a,c.di,[c.ft,0,0,c.ft],a):$w(o,c.fi,c._i,c.ui,c.ci,a,c.di,[0,c.ft,c.ft,0],a),this.qt.pi&&(o.fillStyle=i,o.fillRect(c.fi,c.mi,c.wi-c.fi,c.Mi)),this.qt.gi&&(o.fillStyle=t.D,o.fillRect(s.li?c.bi-c.di:0,c._i,c.di,c.Si-c._i)),s}));e.useMediaCoordinateSpace((({context:e})=>{let n=o.xi;e.font=t.P,e.textAlign=o.li?`right`:`left`,e.textBaseline=`middle`,e.fillStyle=i,e.fillText(this.qt.ri,n.Ci,(n._i+n.Si)/2+n.yi)}))}hi(e,t,n,r){let{context:i,bitmapSize:a,mediaSize:o,horizontalPixelRatio:s,verticalPixelRatio:c}=e,l=this.qt.pi||!this.qt.ki?t.C:0,u=this.qt.Pi?t.S:0,d=t.A+this.ei.Ti,f=t.I+this.ei.Ri,p=t.V,m=t.B,h=this.qt.ri,g=t.k,_=n.Di(i,h),ee=Math.ceil(n.Ii(i,h)),te=g+d+f,v=t.S+p+m+ee+l,ne=Math.max(1,Math.floor(c)),re=Math.round(te*c);re%2!=ne%2&&(re+=1);let ie=u>0?Math.max(1,Math.floor(u*s)):0,y=Math.round(v*s),ae=Math.round(l*s),b=this.ei.Vi??this.ei.Bi??this.ei.Ei,oe=Math.round(b*c)-Math.floor(.5*c),x=Math.floor(oe+ne/2-re/2),S=x+re,se=r===`right`,ce=se?o.width-u:u,le=se?a.width-ie:ie,ue,de,fe;return se?(ue=le-y,de=le-ae,fe=ce-l-p-u):(ue=le+y,de=le+ae,fe=ce+l+p),{li:se,ai:{_i:x,mi:oe,Si:S,ui:y,ci:re,ft:2*s,di:ie,oi:ue,fi:le,wi:de,Mi:ne,bi:a.width},xi:{_i:x/c,Si:S/c,Ci:fe,yi:_}}}},nT=class{constructor(e){this.Ai={Ei:0,G:`#000`,Ri:0,Ti:0},this.Li={ri:``,It:!1,pi:!0,ki:!1,Ht:``,R:`#FFF`,gi:!1,Pi:!1},this.zi={ri:``,It:!1,pi:!1,ki:!0,Ht:``,R:`#FFF`,gi:!0,Pi:!0},this.xt=!0,this.Oi=new(e||tT)(this.Li,this.Ai),this.Ni=new(e||tT)(this.zi,this.Ai)}ri(){return this.Fi(),this.Li.ri}Ei(){return this.Fi(),this.Ai.Ei}kt(){this.xt=!0}$t(e,t=!1){return Math.max(this.Oi.$t(e,t),this.Ni.$t(e,t))}Wi(){return this.Ai.Vi??null}Hi(){return this.Ai.Vi??this.Ai.Bi??this.Ei()}Ui(e){this.Ai.Bi=e??void 0}$i(){return this.Fi(),this.Li.It||this.zi.It}ji(){return this.Fi(),this.Li.It}Tt(e){return this.Fi(),this.Li.pi=this.Li.pi&&e.N().ticksVisible,this.zi.pi=this.zi.pi&&e.N().ticksVisible,this.Oi.ht(this.Li,this.Ai),this.Ni.ht(this.zi,this.Ai),this.Oi}qi(){return this.Fi(),this.Oi.ht(this.Li,this.Ai),this.Ni.ht(this.zi,this.Ai),this.Ni}Fi(){this.xt&&(this.Li.pi=!0,this.zi.pi=!1,this.Yi(this.Li,this.zi,this.Ai))}},rT=class extends nT{constructor(e,t,n){super(),this.Jt=e,this.Ki=t,this.Zi=n}Yi(e,t,n){if(e.It=!1,this.Jt.N().mode===2)return;let r=this.Jt.N().horzLine;if(!r.labelVisible)return;let i=this.Ki.Lt();if(!this.Jt.It()||this.Ki.Gi()||i===null)return;let a=this.Ki.Xi().Z(r.labelBackgroundColor);n.G=a.G,e.R=a.X;let o=2/12*this.Ki.k();n.Ti=o,n.Ri=o;let s=this.Zi(this.Ki);n.Ei=s.Ei,e.ri=this.Ki.Ji(s.Mt,i),e.It=!0}},iT=/[1-9]/g,aT=class{constructor(){this.qt=null}ht(e){this.qt=e}st(e,t){if(this.qt===null||!1===this.qt.It||this.qt.ri.length===0)return;let n=e.useMediaCoordinateSpace((({context:e})=>(e.font=t.P,Math.round(t.Qi.Ii(e,$(this.qt).ri,iT)))));if(n<=0)return;let r=t.tn,i=n+2*r,a=i/2,o=this.qt.nn,s=this.qt.Ei,c=Math.floor(s-a)+.5;c<0?(s+=Math.abs(0-c),c=Math.floor(s-a)+.5):c+i>o&&(s-=Math.abs(o-(c+i)),c=Math.floor(s-a)+.5);let l=c+i,u=Math.ceil(0+t.S+t.C+t.A+t.k+t.I);e.useBitmapCoordinateSpace((({context:e,horizontalPixelRatio:n,verticalPixelRatio:r})=>{let i=$(this.qt);e.fillStyle=i.G;let a=Math.round(c*n),o=Math.round(0*r),s=Math.round(l*n),d=Math.round(u*r),f=Math.round(2*n);if(e.beginPath(),e.moveTo(a,o),e.lineTo(a,d-f),e.arcTo(a,d,a+f,d,f),e.lineTo(s-f,d),e.arcTo(s,d,s,d-f,f),e.lineTo(s,o),e.fill(),i.pi){let a=Math.round(i.Ei*n),s=o,c=Math.round((s+t.C)*r);e.fillStyle=i.R;let l=Math.max(1,Math.floor(n)),u=Math.floor(.5*n);e.fillRect(a-u,s,l,c-s)}})),e.useMediaCoordinateSpace((({context:e})=>{let n=$(this.qt),i=0+t.S+t.C+t.A+t.k/2;e.font=t.P,e.textAlign=`left`,e.textBaseline=`middle`,e.fillStyle=n.R;let a=t.Qi.Di(e,`Apr0`);e.translate(c+r,i+a),e.fillText(n.ri,0,0)}))}},oT=class{constructor(e,t,n){this.xt=!0,this.Xt=new aT,this.Gt={It:!1,G:`#4c525e`,R:`white`,ri:``,nn:0,Ei:NaN,pi:!0},this.Ct=e,this.sn=t,this.Zi=n}kt(){this.xt=!0}Tt(){return this.xt&&=(this.Rt(),!1),this.Xt.ht(this.Gt),this.Xt}Rt(){let e=this.Gt;if(e.It=!1,this.Ct.N().mode===2)return;let t=this.Ct.N().vertLine;if(!t.labelVisible)return;let n=this.sn.Et();if(n.Gi())return;e.nn=n.nn();let r=this.Zi();if(r===null)return;e.Ei=r.Ei;let i=n.en(this.Ct.Bt());e.ri=n.rn($(i)),e.It=!0;let a=this.sn.Xi().Z(t.labelBackgroundColor);e.G=a.G,e.R=a.X,e.pi=n.N().ticksVisible}},sT=class{constructor(){this.hn=null,this.an=0}ln(){return this.an}_n(e){this.an=e}Ft(){return this.hn}un(e){this.hn=e}cn(e){return[]}dn(){return[]}It(){return!0}},cT;(function(e){e[e.Normal=0]=`Normal`,e[e.Magnet=1]=`Magnet`,e[e.Hidden=2]=`Hidden`,e[e.MagnetOHLC=3]=`MagnetOHLC`})(cT||={});var lT=class extends sT{constructor(e,t){super(),this.yt=null,this.fn=NaN,this.pn=0,this.vn=!1,this.mn=new Map,this.wn=!1,this.Mn=new WeakMap,this.gn=new WeakMap,this.bn=NaN,this.Sn=NaN,this.xn=NaN,this.Cn=NaN,this.sn=e,this.yn=t,this.kn=((e,t)=>n=>{let r=t(),i=e();if(n===$(this.yt).Pn())return{Mt:i,Ei:r};{let e=$(n.Lt());return{Mt:n.Tn(r,e),Ei:r}}})((()=>this.fn),(()=>this.Sn));let n=((e,t)=>()=>{let n=this.sn.Et().Rn(e()),r=t();return n&&Number.isFinite(r)?{wt:n,Ei:r}:null})((()=>this.pn),(()=>this.ni()));this.Dn=new oT(this,e,n)}N(){return this.yn}In(e,t){this.xn=e,this.Cn=t}Vn(){this.xn=NaN,this.Cn=NaN}Bn(){return this.xn}En(){return this.Cn}An(e,t,n){this.wn||=!0,this.vn=!0,this.Ln(e,t,n)}Bt(){return this.pn}ni(){return this.bn}si(){return this.Sn}It(){return this.vn}zn(){this.vn=!1,this.On(),this.fn=NaN,this.bn=NaN,this.Sn=NaN,this.yt=null,this.Vn(),this.Nn()}Fn(e){if(!this.yn.doNotSnapToHiddenSeriesIndices)return e;let t=this.sn,n=t.Et(),r=null,i=null;for(let n of t.Wn()){let t=n.Un().Hn(e,-1);if(t){if(t.$n===e)return e;(r===null||t.$n>r)&&(r=t.$n)}let a=n.Un().Hn(e,1);if(a){if(a.$n===e)return e;(i===null||a.$n<i)&&(i=a.$n)}}let a=[r,i].filter(Pw);if(a.length===0)return e;let o=n.jt(e),s=a.map((e=>Math.abs(o-n.jt(e))));return a[s.indexOf(Math.min(...s))]}jn(e){let t=this.Mn.get(e);t||(t=new Yw(this,e),this.Mn.set(e,t));let n=this.gn.get(e);return n||(n=new qw(this.sn,this,e),this.gn.set(e,n)),[t,n]}ti(e){return e===this.yt&&this.yn.horzLine.visible}ii(){return this.yn.vertLine.visible}qn(e,t){this.vn&&this.yt===e||this.mn.clear();let n=[];return this.yt===e&&n.push(this.Yn(this.mn,t,this.kn)),n}dn(){return this.vn?[this.Dn]:[]}Kn(){return this.yt}Nn(){this.sn.Zn().forEach((e=>{this.Mn.get(e)?.kt(),this.gn.get(e)?.kt()})),this.mn.forEach((e=>e.kt())),this.Dn.kt()}Gn(e){return e&&!e.Pn().Gi()?e.Pn():null}Ln(e,t,n){this.Xn(e,t,n)&&this.Nn()}Xn(e,t,n){let r=this.bn,i=this.Sn,a=this.fn,o=this.pn,s=this.yt,c=this.Gn(n);this.pn=e,this.bn=isNaN(e)?NaN:this.sn.Et().jt(e),this.yt=n;let l=c===null?null:c.Lt();return c!==null&&l!==null?(this.fn=t,this.Sn=c.Nt(t,l)):(this.fn=NaN,this.Sn=NaN),r!==this.bn||i!==this.Sn||o!==this.pn||a!==this.fn||s!==this.yt}On(){let e=this.sn.Jn().map((e=>e.Un().Qn())).filter(Pw),t=e.length===0?null:Math.max(...e);this.pn=t===null?NaN:t}Yn(e,t,n){let r=e.get(t);return r===void 0&&(r=new rT(this,t,n),e.set(t,r)),r}};function uT(e){return e===`left`||e===`right`}var dT=class e{constructor(e){this.ts=new Map,this.ns=[],this.ss=e}es(e,t){let n=function(e,t){return e===void 0?t:{rs:Math.max(e.rs,t.rs),hs:e.hs||t.hs}}(this.ts.get(e),t);this.ts.set(e,n)}ls(){return this.ss}_s(e){let t=this.ts.get(e);return t===void 0?{rs:this.ss}:{rs:Math.max(this.ss,t.rs),hs:t.hs}}us(){this.cs(),this.ns=[{ds:0}]}fs(e){this.cs(),this.ns=[{ds:1,Wt:e}]}ps(e){this.vs(),this.ns.push({ds:5,Wt:e})}cs(){this.vs(),this.ns.push({ds:6})}ws(){this.cs(),this.ns=[{ds:4}]}Ms(e){this.cs(),this.ns.push({ds:2,Wt:e})}gs(e){this.cs(),this.ns.push({ds:3,Wt:e})}bs(){return this.ns}Ss(e){for(let t of e.ns)this.xs(t);this.ss=Math.max(this.ss,e.ss),e.ts.forEach(((e,t)=>{this.es(t,e)}))}static Cs(){return new e(2)}static ys(){return new e(3)}xs(e){switch(e.ds){case 0:this.us();break;case 1:this.fs(e.Wt);break;case 2:this.Ms(e.Wt);break;case 3:this.gs(e.Wt);break;case 4:this.ws();break;case 5:this.ps(e.Wt);break;case 6:this.vs()}}vs(){let e=this.ns.findIndex((e=>e.ds===5));e!==-1&&this.ns.splice(e,1)}},fT=class{formatTickmarks(e){return e.map((e=>this.format(e)))}},pT=`.`;function mT(e,t){if(!kw(e))return`n/a`;if(!Aw(t)||t<0||t>16)throw TypeError(`invalid length`);return t===0?e.toString():(`0000000000000000`+e.toString()).slice(-t)}var hT=class extends fT{constructor(e,t){if(super(),t||=1,kw(e)&&Aw(e)||(e=100),e<0)throw TypeError(`invalid base`);this.Ki=e,this.ks=t,this.Ps()}format(e){let t=e<0?`−`:``;return e=Math.abs(e),t+this.Ts(e)}Ps(){if(this.Rs=0,this.Ki>0&&this.ks>0){let e=this.Ki;for(;e>1;)e/=10,this.Rs++}}Ts(e){let t=this.Ki/this.ks,n=Math.floor(e),r=``,i=this.Rs===void 0?NaN:this.Rs;if(t>1){let a=+(Math.round(e*t)-n*t).toFixed(this.Rs);a>=t&&(a-=t,n+=1),r=pT+mT(+a.toFixed(this.Rs)*this.ks,i)}else n=Math.round(n*t)/t,i>0&&(r=pT+mT(0,i));return n.toFixed(0)+r}},gT=class extends hT{constructor(e=100){super(e)}format(e){return`${super.format(e)}%`}},_T=class extends fT{constructor(e){super(),this.Ds=e}format(e){let t=``;return e<0&&(t=`-`,e=-e),e<995?t+this.Is(e):e<999995?t+this.Is(e/1e3)+`K`:e<999999995?(e=1e3*Math.round(e/1e3),t+this.Is(e/1e6)+`M`):(e=1e6*Math.round(e/1e6),t+this.Is(e/1e9)+`B`)}Is(e){let t,n=10**this.Ds;return t=(e=Math.round(e*n)/n)>=1e-15&&e<1?e.toFixed(this.Ds).replace(/\.?0+$/,``):String(e),t.replace(/(\.[1-9]*)0+$/,((e,t)=>t))}},vT=/[2-9]/g,yT=class{constructor(e=50){this.Vs=0,this.Bs=1,this.Es=1,this.As={},this.Ls=new Map,this.zs=e}Os(){this.Vs=0,this.Ls.clear(),this.Bs=1,this.Es=1,this.As={}}Ii(e,t,n){return this.Ns(e,t,n).width}Di(e,t,n){let r=this.Ns(e,t,n);return((r.actualBoundingBoxAscent||0)-(r.actualBoundingBoxDescent||0))/2}Ns(e,t,n){let r=n||vT,i=String(t).replace(r,`0`);if(this.Ls.has(i))return Tw(this.Ls.get(i)).Fs;if(this.Vs===this.zs){let e=this.As[this.Es];delete this.As[this.Es],this.Ls.delete(e),this.Es++,this.Vs--}e.save(),e.textBaseline=`middle`;let a=e.measureText(i);return e.restore(),a.width===0&&t.length||(this.Ls.set(i,{Fs:a,Ws:this.Bs}),this.As[this.Bs]=i,this.Vs++,this.Bs++),a}},bT=class{constructor(e){this.Hs=null,this.M=null,this.Us=`right`,this.$s=e}js(e,t,n){this.Hs=e,this.M=t,this.Us=n}st(e){this.M!==null&&this.Hs!==null&&this.Hs.st(e,this.M,this.$s,this.Us)}},xT=class{constructor(e,t,n){this.qs=e,this.$s=new yT(50),this.Ys=t,this.O=n,this.F=-1,this.Xt=new bT(this.$s)}Tt(){let e=this.O.Ks(this.Ys);if(e===null)return null;let t=e.Zs(this.Ys)?e.Gs():this.Ys.Ft();if(t===null)return null;let n=e.Xs(t);if(n===`overlay`)return null;let r=this.O.Js();return r.k!==this.F&&(this.F=r.k,this.$s.Os()),this.Xt.js(this.qs.qi(),r,n),this.Xt}},ST=class extends Uw{constructor(){super(...arguments),this.qt=null}ht(e){this.qt=e}Qs(e,t){if(!this.qt?.It)return null;let{ut:n,ct:r,te:i}=this.qt;return t>=n-r-7&&t<=n+r+7?{ie:this.qt,ne:Math.abs(t-n),se:2,ee:`price-line`,te:i}:null}et({context:e,bitmapSize:t,horizontalPixelRatio:n,verticalPixelRatio:r}){if(this.qt===null||!1===this.qt.It)return;let i=Math.round(this.qt.ut*r);i<0||i>t.height||(e.lineCap=`butt`,e.strokeStyle=this.qt.R,e.lineWidth=Math.floor(this.qt.ct*n),Sw(e,this.qt.Zt),Cw(e,i,0,t.width))}},CT=class{constructor(e){this.re={ut:0,R:`rgba(0, 0, 0, 0)`,ct:1,Zt:0,It:!1},this.he=new ST,this.xt=!0,this.ae=e,this.le=e.Qt(),this.he.ht(this.re)}kt(){this.xt=!0}Tt(){return this.ae.It()?(this.xt&&=(this.oe(),!1),this.he):null}},wT=class extends CT{constructor(e){super(e)}oe(){this.re.It=!1;let e=this.ae.Ft(),t=e._e()._e;if(t!==2&&t!==3)return;let n=this.ae.N();if(!n.baseLineVisible||!this.ae.It())return;let r=this.ae.Lt();r!==null&&(this.re.It=!0,this.re.ut=e.Nt(r.Wt,r.Wt),this.re.R=n.baseLineColor,this.re.ct=n.baseLineWidth,this.re.Zt=n.baseLineStyle)}},TT=class extends Uw{constructor(){super(...arguments),this.qt=null}ht(e){this.qt=e}ue(){return this.qt}et({context:e,horizontalPixelRatio:t,verticalPixelRatio:n}){let r=this.qt;if(r===null)return;let i=Math.max(1,Math.floor(t)),a=i%2/2,o=Math.round(r.ce.x*t)+a,s=r.ce.y*n;e.fillStyle=r.de,e.beginPath();let c=Math.max(2,1.5*r.fe)*t;e.arc(o,s,c,0,2*Math.PI,!1),e.fill(),e.fillStyle=r.pe,e.beginPath(),e.arc(o,s,r.ft*t,0,2*Math.PI,!1),e.fill(),e.lineWidth=i,e.strokeStyle=r.ve,e.beginPath(),e.arc(o,s,r.ft*t+i/2,0,2*Math.PI,!1),e.stroke()}},ET=[{me:0,we:.25,Me:4,ge:10,be:.25,Se:0,xe:.4,Ce:.8},{me:.25,we:.525,Me:10,ge:14,be:0,Se:0,xe:.8,Ce:0},{me:.525,we:1,Me:14,ge:14,be:0,Se:0,xe:0,Ce:0}],DT=class{constructor(e){this.Xt=new TT,this.xt=!0,this.ye=!0,this.ke=performance.now(),this.Pe=this.ke-1,this.Te=e}Re(){this.Pe=this.ke-1,this.kt()}De(){if(this.kt(),this.Te.N().lastPriceAnimation===2){let e=performance.now(),t=this.Pe-e;if(t>0)return void(t<650&&(this.Pe+=2600));this.ke=e,this.Pe=e+2600}}kt(){this.xt=!0}Ie(){this.ye=!0}It(){return this.Te.N().lastPriceAnimation!==0}Ve(){switch(this.Te.N().lastPriceAnimation){case 0:return!1;case 1:return!0;case 2:return performance.now()<=this.Pe}}Tt(){return this.xt?(this.Rt(),this.xt=!1,this.ye=!1):this.ye&&=(this.Be(),!1),this.Xt}Rt(){this.Xt.ht(null);let e=this.Te.Qt().Et(),t=e.Ee(),n=this.Te.Lt();if(t===null||n===null)return;let r=this.Te.Ae(!0);if(r.Le||!t.ze(r.$n))return;let i={x:e.jt(r.$n),y:this.Te.Ft().Nt(r.Mt,n.Wt)},a=r.R,o=this.Te.N().lineWidth,s=this.Oe(this.Ne(),a);this.Xt.ht({de:a,fe:o,pe:s.pe,ve:s.ve,ft:s.ft,ce:i})}Be(){let e=this.Xt.ue();if(e!==null){let t=this.Oe(this.Ne(),e.de);e.pe=t.pe,e.ve=t.ve,e.ft=t.ft}}Ne(){return this.Ve()?performance.now()-this.ke:2599}Fe(e,t,n,r){let i=n+(r-n)*t;return this.Te.Qt().Xi().Y(e,i)}Oe(e,t){let n=e%2600/2600,r;for(let e of ET)if(n>=e.me&&n<=e.we){r=e;break}ww(r!==void 0,`Last price animation internal logic error`);let i=(n-r.me)/(r.we-r.me);return{pe:this.Fe(t,i,r.be,r.Se),ve:this.Fe(t,i,r.xe,r.Ce),ft:(a=i,o=r.Me,s=r.ge,o+(s-o)*a)};var a,o,s}},OT=class extends CT{constructor(e){super(e)}oe(){let e=this.re;e.It=!1;let t=this.ae.N();if(!t.priceLineVisible||!this.ae.It())return;let n=this.ae.Ae(t.priceLineSource===0);n.Le||(e.It=!0,e.ut=n.Ei,e.R=this.ae.We(n.R),e.ct=t.priceLineWidth,e.Zt=t.priceLineStyle)}},kT=class extends nT{constructor(e){super(),this.Jt=e}Yi(e,t,n){e.It=!1,t.It=!1;let r=this.Jt;if(!r.It())return;let i=r.N(),a=i.lastValueVisible,o=r.He()!==``,s=i.seriesLastValueMode===0,c=r.Ae(!1);if(c.Le)return;a&&(e.ri=this.Ue(c,a,s),e.It=e.ri.length!==0),(o||s)&&(t.ri=this.$e(c,a,o,s),t.It=t.ri.length>0);let l=r.We(c.R),u=this.Jt.Qt().Xi().Z(l);n.G=u.G,n.Ei=c.Ei,t.Ht=r.Qt().Ut(c.Ei/r.Ft().$t()),e.Ht=l,e.R=u.X,t.R=u.X}$e(e,t,n,r){let i=``,a=this.Jt.He();return n&&a.length!==0&&(i+=`${a} `),t&&r&&(i+=this.Jt.Ft().je()?e.qe:e.Ye),i.trim()}Ue(e,t,n){return t?n?this.Jt.Ft().je()?e.Ye:e.qe:e.ri:``}};function AT(e,t,n,r){let i=Number.isFinite(t),a=Number.isFinite(n);return i&&a?e(t,n):i||a?i?t:n:r}var jT=class e{constructor(e,t){this.Ke=e,this.Ze=t}Ge(e){return e!==null&&this.Ke===e.Ke&&this.Ze===e.Ze}Xe(){return new e(this.Ke,this.Ze)}Je(){return this.Ke}Qe(){return this.Ze}tr(){return this.Ze-this.Ke}Gi(){return this.Ze===this.Ke||Number.isNaN(this.Ze)||Number.isNaN(this.Ke)}Ss(t){return t===null?this:new e(AT(Math.min,this.Je(),t.Je(),-1/0),AT(Math.max,this.Qe(),t.Qe(),1/0))}ir(e){if(!kw(e)||this.Ze-this.Ke===0)return;let t=.5*(this.Ze+this.Ke),n=this.Ze-t,r=this.Ke-t;n*=e,r*=e,this.Ze=t+n,this.Ke=t+r}nr(e){kw(e)&&(this.Ze+=e,this.Ke+=e)}sr(){return{minValue:this.Ke,maxValue:this.Ze}}static er(t){return t===null?null:new e(t.minValue,t.maxValue)}},MT=class e{constructor(e,t){this.rr=e,this.hr=t||null}ar(){return this.rr}lr(){return this.hr}sr(){return{priceRange:this.rr===null?null:this.rr.sr(),margins:this.hr||void 0}}static er(t){return t===null?null:new e(jT.er(t.priceRange),t.margins)}},NT=[2,4,8,16,32,64,128,256,512],PT=`Custom series with conflation reducer must have a priceValueBuilder method`,FT=class extends CT{constructor(e,t){super(e),this._r=t}oe(){let e=this.re;e.It=!1;let t=this._r.N();if(!this.ae.It()||!t.lineVisible)return;let n=this._r.ur();n!==null&&(e.It=!0,e.ut=n,e.R=t.color,e.ct=t.lineWidth,e.Zt=t.lineStyle,e.te=this._r.N().id)}},IT=class extends nT{constructor(e,t){super(),this.Te=e,this._r=t}Yi(e,t,n){e.It=!1,t.It=!1;let r=this._r.N(),i=r.axisLabelVisible,a=r.title!==``,o=this.Te;if(!i||!o.It())return;let s=this._r.ur();if(s===null)return;a&&(t.ri=r.title,t.It=!0),t.Ht=o.Qt().Ut(s/o.Ft().$t()),e.ri=this.cr(r.price),e.It=!0;let c=this.Te.Qt().Xi().Z(r.axisLabelColor||r.color);n.G=c.G;let l=r.axisLabelTextColor||c.X;e.R=l,t.R=l,n.Ei=s}cr(e){let t=this.Te.Lt();return t===null?``:this.Te.Ft().Ji(e,t.Wt)}},LT=class{constructor(e,t){this.Te=e,this.yn=t,this.dr=new FT(e,this),this.qs=new IT(e,this),this.pr=new xT(this.qs,e,e.Qt())}vr(e){Ow(this.yn,e),this.kt(),this.Te.Qt().mr()}N(){return this.yn}wr(){return this.dr}Mr(){return this.pr}gr(){return this.qs}kt(){this.dr.kt(),this.qs.kt()}ur(){let e=this.Te,t=e.Ft();if(e.Qt().Et().Gi()||t.Gi())return null;let n=e.Lt();return n===null?null:t.Nt(this.yn.price,n.Wt)}},RT=class{constructor(){this.br=new WeakMap}Sr(e,t,n){let r=1/t*n;if(e>=r)return 1;let i=r/e;return Math.min(2**Math.floor(Math.log2(i)),512)}Cr(e,t,n,r=!1,i){if(e.length===0||t<=1)return e;let a=this.yr(t);if(a<=1)return e;let o=this.kr(e),s=o.Pr.get(a);return s!==void 0||(s=this.Tr(e,a,n,r,i,o.Pr),o.Pr.set(a,s)),s}Rr(e,t,n,r,i=!1,a){if(n<1||e.length===0)return e;let o=this.kr(e),s=o.Pr.get(n);if(!s)return this.Cr(e,n,r,i,a);let c=this.Dr(e,t,n,s,i,r,a);return o.Pr.set(n,c),c}yr(e){if(e<=2)return 2;for(let t of NT)if(e<=t)return t;return 512}Ir(e){if(e.length===0)return 0;let t=e[0],n=e[e.length-1];return 31*e.length+17*t.$n+13*n.$n}Tr(e,t,n,r=!1,i,a=new Map){if(t===2)return this.Vr(e,2,n,r,i);let o=t/2,s=a.get(o);return s||(s=this.Tr(e,o,n,r,i,a),a.set(o,s)),this.Br(s,n,r,i)}Vr(e,t,n,r=!1,i){let a=this.Er(e,t,n,r,i);return this.Ar(a,r)}Br(e,t,n=!1,r){let i=this.Er(e,2,t,n,r);return this.Ar(i,n)}Er(e,t,n,r=!1,i){let a=[];for(let o=0;o<e.length;o+=t)if(e.length-o>=t){let t=this.Lr(e[o],e[o+1],n,r,i);t.zr=!1,a.push(t)}else if(a.length===0)a.push(this.Or(e[o],!0));else{let t=a[a.length-1];a[a.length-1]=this.Nr(t,e[o],n,r,i)}return a}Fr(e,t){return(e??1)+(t??1)}Lr(e,t,n,r=!1,i){if(!r||!n||!i){let n=e.Wt[1]>t.Wt[1]?e.Wt[1]:t.Wt[1],r=e.Wt[2]<t.Wt[2]?e.Wt[2]:t.Wt[2];return{Wr:e.$n,Hr:t.$n,Ur:e.wt,$r:t.wt,jr:e.Wt[0],qr:n,Yr:r,Kr:t.Wt[3],Zr:this.Fr(e.Zr,t.Zr),Gr:void 0,zr:!1}}let a=n(this.Xr(e,i),this.Xr(t,i)),o=i(a),s=o.length?o[o.length-1]:0;return{Wr:e.$n,Hr:t.$n,Ur:e.wt,$r:t.wt,jr:e.Wt[0],qr:Math.max(e.Wt[1],s),Yr:Math.min(e.Wt[2],s),Kr:s,Zr:this.Fr(e.Zr,t.Zr),Gr:a,zr:!1}}Nr(e,t,n,r=!1,i){if(!r||!n||!i)return{Wr:e.Wr,Hr:t.$n,Ur:e.Ur,$r:t.wt,jr:e.jr,qr:e.qr>t.Wt[1]?e.qr:t.Wt[1],Yr:e.Yr<t.Wt[2]?e.Yr:t.Wt[2],Kr:t.Wt[3],Zr:e.Zr+(t.Zr??1),Gr:e.Gr,zr:!1};let a=e.Gr,o=this.Xr(t,i),s=a?{data:a,index:e.Wr,originalTime:e.Ur,time:e.Ur,priceValues:i(a)}:null,c=s?n(s,o):o.data,l=s?i(c):o.priceValues,u=l.length?l[l.length-1]:0;return{Wr:e.Wr,Hr:t.$n,Ur:e.Ur,$r:t.wt,jr:e.jr,qr:Math.max(e.qr,u),Yr:Math.min(e.Yr,u),Kr:u,Zr:e.Zr+(t.Zr??1),Gr:c,zr:!1}}Jr(e,t,n,r,i,a,o=!1,s){let c=t===r?i:e[t];if(n-t==1)return this.Or(c,!0);let l=t+1===r?i:e[t+1],u=this.Lr(c,l,a,o,s);for(let c=t+2;c<n;c++){let t=c===r?i:e[c];u=this.Nr(u,t,a,o,s)}return u}Xr(e,t){let n=e.ue??{};return{data:e.ue,index:e.$n,originalTime:e.Qr,time:e.wt,priceValues:t(n)}}th(e,t=!1){let n=!0===t,r=!!e.Gr;return{$n:e.Wr,wt:e.Ur,Qr:e.Ur,Wt:[n?e.Kr:e.jr,e.qr,e.Yr,e.Kr],Zr:e.Zr,ue:n?r?e.Gr:{wt:e.Ur}:void 0}}Ar(e,t=!1){return e.map((e=>this.th(e,t)))}Dr(e,t,n,r,i=!1,a,o){if(r.length===0)return r;let s=e.length-1,c=Math.floor(s/n)*n;if(Math.min(c+n,e.length)-c<n&&e.length>n){let r=e.slice();return r[r.length-1]=t,this.Cr(r,n,a,i,o)}if(Math.floor((s-1)/n)===Math.floor(s/n)||r.length===1){let l=Math.min(c+n,e.length),u=l-c;if(u<=0)return r;let d=u===1?this.Or(c===s?t:e[c],!0):this.Jr(e,c,l,s,t,a,i,o);return r[r.length-1]=this.th(d,i),r}{let r=e.slice();return r[r.length-1]=t,this.Cr(r,n,a,i,o)}}Or(e,t=!1){return{Wr:e.$n,Hr:e.$n,Ur:e.wt,$r:e.wt,jr:e.Wt[0],qr:e.Wt[1],Yr:e.Wt[2],Kr:e.Wt[3],Zr:e.Zr??1,Gr:e.ue,zr:t}}kr(e){let t=this.ih(e),n=this.Ir(e);return t.nh!==n&&(t.Pr.clear(),t.nh=n),t}ih(e){let t=this.br.get(e);return t===void 0&&(t={nh:this.Ir(e),Pr:new Map},this.br.set(e,t)),t}},zT=class extends sT{constructor(e){super(),this.sn=e}Qt(){return this.sn}},BT={Bar:(e,t,n,r)=>{let i=t.upColor,a=t.downColor,o=$(e(n,r)),s=Ew(o.Wt[0])<=Ew(o.Wt[3]);return{sh:o.R??(s?i:a)}},Candlestick:(e,t,n,r)=>{let i=t.upColor,a=t.downColor,o=t.borderUpColor,s=t.borderDownColor,c=t.wickUpColor,l=t.wickDownColor,u=$(e(n,r)),d=Ew(u.Wt[0])<=Ew(u.Wt[3]);return{sh:u.R??(d?i:a),eh:u.Ht??(d?o:s),rh:u.hh??(d?c:l)}},Custom:(e,t,n,r)=>({sh:$(e(n,r)).R??t.color}),Area:(e,t,n,r)=>{let i=$(e(n,r));return{sh:i.vt??t.lineColor,vt:i.vt??t.lineColor,ah:i.ah??t.topColor,oh:i.oh??t.bottomColor}},Baseline:(e,t,n,r)=>{let i=$(e(n,r));return{sh:i.Wt[3]>=t.baseValue.price?t.topLineColor:t.bottomLineColor,_h:i._h??t.topLineColor,uh:i.uh??t.bottomLineColor,dh:i.dh??t.topFillColor1,fh:i.fh??t.topFillColor2,ph:i.ph??t.bottomFillColor1,mh:i.mh??t.bottomFillColor2}},Line:(e,t,n,r)=>{let i=$(e(n,r));return{sh:i.R??t.color,vt:i.R??t.color}},Histogram:(e,t,n,r)=>({sh:$(e(n,r)).R??t.color})},VT=class{constructor(e){this.wh=(e,t)=>t===void 0?this.Te.Un().Mh(e):t.Wt,this.Te=e,this.gh=BT[e.bh()]}Sh(e,t){return this.gh(this.wh,this.Te.N(),e,t)}};function HT(e,t,n,r,i=0,a=t.length){let o=a-i;for(;0<o;){let a=o>>1,s=i+a;r(t[s],n)===e?(i=s+1,o-=a+1):o=a}return i}var UT=HT.bind(null,!0),WT=HT.bind(null,!1),GT;(function(e){e[e.NearestLeft=-1]=`NearestLeft`,e[e.None=0]=`None`,e[e.NearestRight=1]=`NearestRight`})(GT||={});var KT=30,qT=class{constructor(){this.xh=[],this.Ch=new Map,this.yh=new Map,this.kh=[]}Ph(){return this.Th()>0?this.xh[this.xh.length-1]:null}Rh(){return this.Th()>0?this.Dh(0):null}Qn(){return this.Th()>0?this.Dh(this.xh.length-1):null}Th(){return this.xh.length}Gi(){return this.Th()===0}ze(e){return this.Ih(e,0)!==null}Mh(e){return this.Hn(e)}Hn(e,t=0){let n=this.Ih(e,t);return n===null?null:{...this.Vh(n),$n:this.Dh(n)}}Bh(){return this.xh}Eh(e,t,n){if(this.Gi())return null;let r=null;for(let i of n)r=JT(r,this.Ah(e,t,i));return r}ht(e){this.yh.clear(),this.Ch.clear(),this.xh=e,this.kh=e.map((e=>e.$n))}Lh(){return this.kh}Dh(e){return this.xh[e].$n}Vh(e){return this.xh[e]}Ih(e,t){let n=this.zh(e);if(n===null&&t!==0)switch(t){case-1:return this.Oh(e);case 1:return this.Nh(e);default:throw TypeError(`Unknown search mode`)}return n}Oh(e){let t=this.Fh(e);return t>0&&--t,t!==this.xh.length&&this.Dh(t)<e?t:null}Nh(e){let t=this.Wh(e);return t!==this.xh.length&&e<this.Dh(t)?t:null}zh(e){let t=this.Fh(e);return t===this.xh.length||e<this.xh[t].$n?null:t}Fh(e){return UT(this.xh,e,((e,t)=>e.$n<t))}Wh(e){return WT(this.xh,e,((e,t)=>e.$n>t))}Hh(e,t,n){let r=null;for(let i=e;i<t;i++){let e=this.xh[i].Wt[n];Number.isNaN(e)||(r===null?r={Uh:e,$h:e}:(e<r.Uh&&(r.Uh=e),e>r.$h&&(r.$h=e)))}return r}Ah(e,t,n){if(this.Gi())return null;let r=null,i=$(this.Rh()),a=$(this.Qn()),o=Math.max(e,i),s=Math.min(t,a),c=Math.ceil(o/KT)*KT,l=Math.max(c,Math.floor(s/KT)*KT);{let e=this.Fh(o),i=this.Wh(Math.min(s,c,t));r=JT(r,this.Hh(e,i,n))}let u=this.Ch.get(n);u===void 0&&(u=new Map,this.Ch.set(n,u));for(let e=Math.max(c+1,o);e<l;e+=KT){let t=Math.floor(e/KT),i=u.get(t);if(i===void 0){let e=this.Fh(t*KT),r=this.Wh((t+1)*KT-1);i=this.Hh(e,r,n),u.set(t,i)}r=JT(r,i)}{let e=this.Fh(l),t=this.Wh(s);r=JT(r,this.Hh(e,t,n))}return r}};function JT(e,t){return e===null?t:t===null?e:{Uh:Math.min(e.Uh,t.Uh),$h:Math.max(e.$h,t.$h)}}function YT(){return new qT}var XT={setLineStyle:Sw},ZT=class{constructor(e){this.jh=e}st(e,t,n){this.jh.draw(e,XT)}qh(e,t,n){this.jh.drawBackground?.(e,XT)}},QT=class{constructor(e){this.Ls=null,this.Yh=e}Tt(){let e=this.Yh.renderer();if(e===null)return null;if(this.Ls?.Kh===e)return this.Ls.Zh;let t=new ZT(e);return this.Ls={Kh:e,Zh:t},t}Gh(){return this.Yh.zOrder?.()??`normal`}},$T=class{constructor(e){this.Xh=null,this.Jh=e}Qh(){return this.Jh}Nn(){this.Jh.updateAllViews?.()}jn(){let e=this.Jh.paneViews?.()??[];if(this.Xh?.Kh===e)return this.Xh.Zh;let t=e.map((e=>new QT(e)));return this.Xh={Kh:e,Zh:t},t}Qs(e,t){return this.Jh.hitTest?.(e,t)??null}},eE=class extends $T{cn(){return[]}},tE=class{constructor(e){this.jh=e}st(e,t,n){this.jh.draw(e,XT)}qh(e,t,n){this.jh.drawBackground?.(e,XT)}},nE=class{constructor(e){this.Ls=null,this.Yh=e}Tt(){let e=this.Yh.renderer();if(e===null)return null;if(this.Ls?.Kh===e)return this.Ls.Zh;let t=new tE(e);return this.Ls={Kh:e,Zh:t},t}Gh(){return this.Yh.zOrder?.()??`normal`}};function rE(e){return{ri:e.text(),Ei:e.coordinate(),Vi:e.fixedCoordinate?.(),R:e.textColor(),G:e.backColor(),It:e.visible?.()??!0,pi:e.tickVisible?.()??!0}}var iE=class{constructor(e,t){this.Xt=new aT,this.ta=e,this.ia=t}Tt(){return this.Xt.ht({nn:this.ia.nn(),...rE(this.ta)}),this.Xt}},aE=class extends nT{constructor(e,t){super(),this.ta=e,this.Ki=t}Yi(e,t,n){let r=rE(this.ta);n.G=r.G,e.R=r.R;let i=2/12*this.Ki.k();n.Ti=i,n.Ri=i,n.Ei=r.Ei,n.Vi=r.Vi,e.ri=r.ri,e.It=r.It,e.pi=r.pi}},oE=class extends $T{constructor(e,t){super(e),this.na=null,this.sa=null,this.ea=null,this.ra=null,this.Te=t}dn(){let e=this.Jh.timeAxisViews?.()??[];if(this.na?.Kh===e)return this.na.Zh;let t=this.Te.Qt().Et(),n=e.map((e=>new iE(e,t)));return this.na={Kh:e,Zh:n},n}qn(){let e=this.Jh.priceAxisViews?.()??[];if(this.sa?.Kh===e)return this.sa.Zh;let t=this.Te.Ft(),n=e.map((e=>new aE(e,t)));return this.sa={Kh:e,Zh:n},n}ha(){let e=this.Jh.priceAxisPaneViews?.()??[];if(this.ea?.Kh===e)return this.ea.Zh;let t=e.map((e=>new nE(e)));return this.ea={Kh:e,Zh:t},t}aa(){let e=this.Jh.timeAxisPaneViews?.()??[];if(this.ra?.Kh===e)return this.ra.Zh;let t=e.map((e=>new nE(e)));return this.ra={Kh:e,Zh:t},t}la(e,t){return this.Jh.autoscaleInfo?.(e,t)??null}};function sE(e,t,n,r){e.forEach((e=>{t(e).forEach((e=>{e.Gh()===n&&r.push(e)}))}))}function cE(e){return e.jn()}function lE(e){return e.ha()}function uE(e){return e.aa()}var dE=[`Area`,`Line`,`Baseline`],fE=class extends zT{constructor(e,t,n,r,i){super(e),this.qt=YT(),this.dr=new OT(this),this.oa=[],this._a=new wT(this),this.ua=null,this.ca=null,this.da=null,this.fa=[],this.pa=new RT,this.va=new Map,this.ma=null,this.yn=n,this.wa=t;let a=new kT(this);if(this.mn=[a],this.pr=new xT(a,this,e),dE.includes(this.wa)&&(this.ua=new DT(this)),this.Ma(),this.Yh=r(this,this.Qt(),i),this.wa===`Custom`){let e=this.Yh;e.ga&&this.ba(e.ga)}}m(){this.da!==null&&clearTimeout(this.da)}We(e){return this.yn.priceLineColor||e}Ae(e){let t={Le:!0},n=this.Ft();if(this.Qt().Et().Gi()||n.Gi()||this.qt.Gi())return t;let r=this.Qt().Et().Ee(),i=this.Lt();if(r===null||i===null)return t;let a,o;if(e){let e=this.qt.Ph();if(e===null)return t;a=e,o=e.$n}else{let e=this.qt.Hn(r.bi(),-1);if(e===null||(a=this.qt.Mh(e.$n),a===null))return t;o=e.$n}let s=a.Wt[3],c=this.Sa().Sh(o,{Wt:a}),l=n.Nt(s,i.Wt);return{Le:!1,Mt:s,ri:n.Ji(s,i.Wt),qe:n.xa(s),Ye:n.Ca(s,i.Wt),R:c.sh,Ei:l,$n:o}}Sa(){return this.ca!==null||(this.ca=new VT(this)),this.ca}N(){return this.yn}vr(e){let t=this.Qt(),{priceScaleId:n,visible:r,priceFormat:i}=e;n!==void 0&&n!==this.yn.priceScaleId&&t.ya(this,n),r!==void 0&&r!==this.yn.visible&&t.ka();let a=e.conflationThresholdFactor!==void 0;Ow(this.yn,e),a&&(this.va.clear(),this.Qt().mr()),i!==void 0&&(this.Ma(),t.Pa()),t.Ta(this),t.Ra(),this.Yh.kt(`options`)}ht(e,t){this.qt.ht(e),this.va.clear();let n=this.Qt().Et().N();n.enableConflation&&n.precomputeConflationOnInit&&this.Da(n.precomputeConflationPriority),this.Yh.kt(`data`),this.ua!==null&&(t&&t.Ia?this.ua.De():e.length===0&&this.ua.Re());let r=this.Qt().Ks(this);this.Qt().Va(r),this.Qt().Ta(this),this.Qt().Ra(),this.Qt().mr()}Ba(e){let t=new LT(this,e);return this.oa.push(t),this.Qt().Ta(this),t}Ea(e){let t=this.oa.indexOf(e);t!==-1&&this.oa.splice(t,1),this.Qt().Ta(this)}Aa(){return this.oa}bh(){return this.wa}Lt(){let e=this.La();return e===null?null:{Wt:e.Wt[3],za:e.wt}}La(){let e=this.Qt().Et().Ee();if(e===null)return null;let t=e.Oa();return this.qt.Hn(t,1)}Un(){return this.qt}ba(e){this.ma=e,this.va.clear()}Na(){return!!this.Qt().Et().N().enableConflation&&this.Fa()>1}Rr(e){if(!this.Na())return;let t=this.Fa();if(!this.va.has(t))return;let n=this.wa===`Custom`,r=n&&this.ma||void 0,i=n&&this.Yh.Wa?e=>{let t=e,n=this.Yh.Wa(t);return Array.isArray(n)?n:[typeof n==`number`?n:0]}:void 0,a=this.pa.Rr(this.qt.Bh(),e,t,r,n,i),o=YT();o.ht(a),this.va.set(t,o)}Ha(){let e=this.Qt().Et().N().enableConflation;if(this.wa===`Custom`&&this.ma===null||!e)return this.qt;let t=this.Fa();return this.va.get(t)||(this.Ua(t),this.va.get(t)??this.qt)}$a(e){let t=this.qt.Mh(e);return t===null?null:this.wa===`Bar`||this.wa===`Candlestick`||this.wa===`Custom`?{jr:t.Wt[0],qr:t.Wt[1],Yr:t.Wt[2],Kr:t.Wt[3]}:t.Wt[3]}ja(e){let t=[];sE(this.fa,cE,`top`,t);let n=this.ua;return n!==null&&n.It()?(this.da===null&&n.Ve()&&(this.da=setTimeout((()=>{this.da=null,this.Qt().qa()}),0)),n.Ie(),t.unshift(n),t):t}jn(){let e=[];this.Ya()||e.push(this._a),e.push(this.Yh,this.dr);let t=this.oa.map((e=>e.wr()));return e.push(...t),sE(this.fa,cE,`normal`,e),e}Ka(){return this.Za(cE,`bottom`)}Ga(e){return this.Za(lE,e)}Xa(e){return this.Za(uE,e)}Ja(e,t){return this.fa.map((n=>n.Qs(e,t))).filter((e=>e!==null))}cn(){return[this.pr,...this.oa.map((e=>e.Mr()))]}qn(e,t){if(t!==this.hn&&!this.Ya())return[];let n=[...this.mn];for(let e of this.oa)n.push(e.gr());return this.fa.forEach((e=>{n.push(...e.qn())})),n}dn(){let e=[];return this.fa.forEach((t=>{e.push(...t.dn())})),e}la(e,t){if(this.yn.autoscaleInfoProvider!==void 0){let n=this.yn.autoscaleInfoProvider((()=>{let n=this.Qa(e,t);return n===null?null:n.sr()}));return MT.er(n)}return this.Qa(e,t)}Kh(){let e=this.yn.priceFormat;return e.base??1/e.minMove}tl(){return this.il}Nn(){this.Yh.kt();for(let e of this.mn)e.kt();for(let e of this.oa)e.kt();this.dr.kt(),this._a.kt(),this.ua?.kt(),this.fa.forEach((e=>e.Nn()))}Ft(){return $(super.Ft())}At(e){if(!((this.wa===`Line`||this.wa===`Area`||this.wa===`Baseline`)&&this.yn.crosshairMarkerVisible))return null;let t=this.qt.Mh(e);return t===null?null:{Mt:t.Wt[3],ft:this.nl(),Ht:this.sl(),Ot:this.el(),zt:this.rl(e)}}He(){return this.yn.title}It(){return this.yn.visible}hl(e){this.fa.push(new oE(e,this))}al(e){this.fa=this.fa.filter((t=>t.Qh()!==e))}ll(){if(this.wa===`Custom`)return e=>this.Yh.Wa(e)}ol(){if(this.wa===`Custom`)return e=>this.Yh._l(e)}ul(){return this.qt.Lh()}Ya(){return!uT(this.Ft().cl())}Qa(e,t){if(!Aw(e)||!Aw(t)||this.qt.Gi())return null;let n=this.wa===`Line`||this.wa===`Area`||this.wa===`Baseline`||this.wa===`Histogram`?[3]:[2,1],r=this.qt.Eh(e,t,n),i=r===null?null:new jT(r.Uh,r.$h),a=null;if(this.bh()===`Histogram`){let e=this.yn.base,t=new jT(e,e);i=i===null?t:i.Ss(t)}return this.fa.forEach((n=>{let r=n.la(e,t);if(r?.priceRange){let e=new jT(r.priceRange.minValue,r.priceRange.maxValue);i=i===null?e:i.Ss(e)}r?.margins&&(a=r.margins)})),new MT(i,a)}nl(){switch(this.wa){case`Line`:case`Area`:case`Baseline`:return this.yn.crosshairMarkerRadius}return 0}sl(){switch(this.wa){case`Line`:case`Area`:case`Baseline`:{let e=this.yn.crosshairMarkerBorderColor;if(e.length!==0)return e}}return null}el(){switch(this.wa){case`Line`:case`Area`:case`Baseline`:return this.yn.crosshairMarkerBorderWidth}return 0}rl(e){switch(this.wa){case`Line`:case`Area`:case`Baseline`:{let e=this.yn.crosshairMarkerBackgroundColor;if(e.length!==0)return e}}return this.Sa().Sh(e).sh}Ma(){switch(this.yn.priceFormat.type){case`custom`:{let e=this.yn.priceFormat.formatter;this.il={format:e,formatTickmarks:this.yn.priceFormat.tickmarksFormatter??(t=>t.map(e))};break}case`volume`:this.il=new _T(this.yn.priceFormat.precision);break;case`percent`:this.il=new gT(this.yn.priceFormat.precision);break;default:{let e=10**this.yn.priceFormat.precision;this.il=new hT(e,this.yn.priceFormat.minMove*e)}}this.hn!==null&&this.hn.dl()}Za(e,t){let n=[];return sE(this.fa,e,t,n),n}Fa(){let{fl:e,pl:t,vl:n}=this.ml();return this.pa.Sr(e,t,n)}ml(){let e=this.Qt().Et(),t=e.fl(),n=window.devicePixelRatio||1,r=e.N().conflationThresholdFactor;return{fl:t,pl:n,vl:this.yn.conflationThresholdFactor??r??1}}wl(e){let t=this.qt.Bh(),n;if(this.wa===`Custom`&&this.ma!==null){let r=this.ll();if(!r)throw Error(PT);n=this.pa.Cr(t,e,this.ma,!0,(e=>r(e)))}else n=this.pa.Cr(t,e);let r=YT();return r.ht(n),r}Ua(e){let t=this.wl(e);this.va.set(e,t)}Da(e){if(this.wa===`Custom`&&(this.ma===null||!this.ll()))return;this.va.clear();let t=this.Qt().Et().Ml();for(let n of t){let t=()=>{this.gl(n)},r=typeof window==`object`&&window||typeof self==`object`&&self;r?.Sl?.bl?r.Sl.bl((()=>{t()}),{se:e}):Promise.resolve().then((()=>t()))}}gl(e){if(this.va.has(e)||this.qt.Bh().length===0)return;let t=this.wl(e);this.va.set(e,t)}},pE=[3],mE=[0,1,2,3],hE=class{constructor(e){this.yn=e}xl(e,t,n){let r=e;if(this.yn.mode===0)return r;let i=n.Pn(),a=i.Lt();if(a===null)return r;let o=i.Nt(e,a),s=n.Cl().filter((e=>e instanceof fE)).reduce(((e,r)=>{if(n.Zs(r)||!r.It())return e;let i=r.Ft(),a=r.Un();if(i.Gi()||!a.ze(t))return e;let o=a.Mh(t);if(o===null)return e;let s=Ew(r.Lt()),c=this.yn.mode===3?mE:pE;return e.concat(c.map((e=>i.Nt(o.Wt[e],s.Wt))))}),[]);if(s.length===0)return r;s.sort(((e,t)=>Math.abs(e-o)-Math.abs(t-o)));let c=s[0];return r=i.Tn(c,a),r}};function gE(e,t,n){return Math.min(Math.max(e,t),n)}function _E(e,t,n){return t-e<=n}var vE=class extends Uw{constructor(){super(...arguments),this.qt=null}ht(e){this.qt=e}et({context:e,bitmapSize:t,horizontalPixelRatio:n,verticalPixelRatio:r}){if(this.qt===null)return;let i=Math.max(1,Math.floor(n));e.lineWidth=i,function(e,t){e.save(),e.lineWidth%2&&e.translate(.5,.5),t(),e.restore()}(e,(()=>{let a=$(this.qt);if(a.yl){e.strokeStyle=a.kl,Sw(e,a.Pl),e.beginPath();for(let r of a.Tl){let a=Math.round(r.Rl*n);e.moveTo(a,-i),e.lineTo(a,t.height+i)}e.stroke()}if(a.Dl){e.strokeStyle=a.Il,Sw(e,a.Vl),e.beginPath();for(let n of a.Bl){let a=Math.round(n.Rl*r);e.moveTo(-i,a),e.lineTo(t.width+i,a)}e.stroke()}}))}},yE=class{constructor(e){this.Xt=new vE,this.xt=!0,this.yt=e}kt(){this.xt=!0}Tt(){if(this.xt){let e=this.yt.Qt().N().grid,t={Dl:e.horzLines.visible,yl:e.vertLines.visible,Il:e.horzLines.color,kl:e.vertLines.color,Vl:e.horzLines.style,Pl:e.vertLines.style,Bl:this.yt.Pn().El(),Tl:(this.yt.Qt().Et().El()||[]).map((e=>({Rl:e.coord})))};this.Xt.ht(t),this.xt=!1}return this.Xt}},bE=class{constructor(e){this.Yh=new yE(e)}wr(){return this.Yh}},xE={Al:4,Ll:1e-4};function SE(e,t){let n=100*(e-t)/t;return t<0?-n:n}function CE(e,t){return new jT(SE(e.Je(),t),SE(e.Qe(),t))}function wE(e,t){let n=100*(e-t)/t+100;return t<0?-n:n}function TE(e,t){return new jT(wE(e.Je(),t),wE(e.Qe(),t))}function EE(e,t){let n=Math.abs(e);if(n<1e-15)return 0;let r=Math.log10(n+t.Ll)+t.Al;return e<0?-r:r}function DE(e,t){let n=Math.abs(e);if(n<1e-15)return 0;let r=10**(n-t.Al)-t.Ll;return e<0?-r:r}function OE(e,t){return e===null?null:new jT(EE(e.Je(),t),EE(e.Qe(),t))}function kE(e,t){return e===null?null:new jT(DE(e.Je(),t),DE(e.Qe(),t))}function AE(e){if(e===null)return xE;let t=Math.abs(e.Qe()-e.Je());if(t>=1||t<1e-15)return xE;let n=Math.ceil(Math.abs(Math.log10(t))),r=xE.Al+n;return{Al:r,Ll:1/10**r}}var jE=class{constructor(e,t){if(this.zl=e,this.Ol=t,function(e){if(e<0)return!1;if(e>0xde0b6b3a7640000)return!0;for(let t=e;t>1;t/=10)if(t%10!=0)return!1;return!0}(this.zl))this.Nl=[2,2.5,2];else{this.Nl=[];for(let e=this.zl;e!==1;){if(e%2==0)this.Nl.push(2),e/=2;else{if(e%5!=0)throw Error(`unexpected base`);this.Nl.push(2,2.5),e/=5}if(this.Nl.length>100)throw Error(`something wrong with base`)}}}Fl(e,t,n){let r=this.zl===0?0:1/this.zl,i=10**Math.max(0,Math.ceil(Math.log10(e-t))),a=0,o=this.Ol[0];for(;;){let e=_E(i,r,1e-14)&&i>r+1e-14,t=_E(i,n*o,1e-14),s=_E(i,1,1e-14);if(!(e&&t&&s))break;i/=o,o=this.Ol[++a%this.Ol.length]}if(i<=r+1e-14&&(i=r),i=Math.max(1,i),this.Nl.length>0&&(s=i,c=1,l=1e-14,Math.abs(s-c)<l))for(a=0,o=this.Nl[0];_E(i,n*o,1e-14)&&i>r+1e-14;)i/=o,o=this.Nl[++a%this.Nl.length];var s,c,l;return i}},ME=class{constructor(e,t,n,r){this.Wl=[],this.Ki=e,this.zl=t,this.Hl=n,this.Ul=r}Fl(e,t){if(e<t)throw Error(`high < low`);let n=this.Ki.$t(),r=(e-t)*this.$l()/n,i=new jE(this.zl,[2,2.5,2]),a=new jE(this.zl,[2,2,2.5]),o=new jE(this.zl,[2.5,2,2]),s=[];return s.push(i.Fl(e,t,r),a.Fl(e,t,r),o.Fl(e,t,r)),function(e){if(e.length<1)throw Error(`array is empty`);let t=e[0];for(let n=1;n<e.length;++n)e[n]<t&&(t=e[n]);return t}(s)}jl(){let e=this.Ki,t=e.Lt();if(t===null)return void(this.Wl=[]);let n=e.$t(),r=this.Hl(n-1,t),i=this.Hl(0,t),a=this.Ki.N().entireTextOnly?this.ql()/2:0,o=a,s=n-1-a,c=Math.max(r,i),l=Math.min(r,i);if(c===l)return void(this.Wl=[]);let u=this.Fl(c,l);if(this.Yl(t,u,c,l,o,s),e.Kl()&&this.Zl(u,l,c)){let e=this.Ki.Gl();this.Xl(t,u,o,s,e,2*e)}let d=this.Wl.map((e=>e.Jl)),f=this.Ki.Ql(d);for(let e=0;e<this.Wl.length;e++)this.Wl[e].io=f[e]}El(){return this.Wl}ql(){return this.Ki.k()}$l(){return Math.ceil(this.ql()*this.Ki.N().tickMarkDensity)}Yl(e,t,n,r,i,a){let o=this.Wl,s=this.Ki,c=n%t;c+=c<0?t:0;let l=n>=r?1:-1,u=null,d=0;for(let f=n-c;f>r;f-=t){let n=this.Ul(f,e,!0);u!==null&&Math.abs(n-u)<this.$l()||n<i||n>a||(d<o.length?(o[d].Rl=n,o[d].io=s.no(f),o[d].Jl=f):o.push({Rl:n,io:s.no(f),Jl:f}),d++,u=n,s.so()&&(t=this.Fl(f*l,r)))}o.length=d}Xl(e,t,n,r,i,a){let o=this.Wl,s=this.eo(e,n,i,a),c=this.eo(e,r,-a,-i),l=this.Ul(0,e,!0)-this.Ul(t,e,!0);o.length>0&&o[0].Rl-s.Rl<l/2&&o.shift(),o.length>0&&c.Rl-o[o.length-1].Rl<l/2&&o.pop(),o.unshift(s),o.push(c)}eo(e,t,n,r){let i=(n+r)/2,a=this.Hl(t+n,e),o=this.Hl(t+r,e),s=Math.min(a,o),c=Math.max(a,o),l=Math.max(.1,this.Fl(c,s)),u=this.Hl(t+i,e),d=u-u%l,f=this.Ul(d,e,!0);return{io:this.Ki.no(d),Rl:f,Jl:d}}Zl(e,t,n){let r=Ew(this.Ki.ar());return this.Ki.so()&&(r=kE(r,this.Ki.ro())),r.Je()-t<e&&n-r.Qe()<e}};function NE(e){return e.slice().sort(((e,t)=>$(e.ln())-$(t.ln())))}var PE;(function(e){e[e.Normal=0]=`Normal`,e[e.Logarithmic=1]=`Logarithmic`,e[e.Percentage=2]=`Percentage`,e[e.IndexedTo100=3]=`IndexedTo100`})(PE||={});var FE=new gT,IE=new hT(100,1),LE=class{constructor(e,t,n,r,i){this.ho=0,this.ao=null,this.rr=null,this.lo=null,this.oo={_o:!1,uo:null},this.co=!1,this.do=0,this.fo=0,this.po=new Dw,this.vo=new Dw,this.mo=[],this.wo=null,this.Mo=null,this.bo=null,this.So=null,this.xo=null,this.il=IE,this.Co=AE(null),this.yo=e,this.yn=t,this.ko=n,this.Po=r,this.To=i,this.Ro=new ME(this,100,this.Do.bind(this),this.Io.bind(this))}cl(){return this.yo}N(){return this.yn}vr(e){if(Ow(this.yn,e),this.dl(),e.mode!==void 0&&this.Vo({_e:e.mode}),e.scaleMargins!==void 0){let t=Tw(e.scaleMargins.top),n=Tw(e.scaleMargins.bottom);if(t<0||t>1)throw Error(`Invalid top margin - expect value between 0 and 1, given=${t}`);if(n<0||n>1)throw Error(`Invalid bottom margin - expect value between 0 and 1, given=${n}`);if(t+n>1)throw Error(`Invalid margins - sum of margins must be less than 1, given=${t+n}`);this.Bo(),this.bo=null}}Eo(){return this.yn.autoScale}Ao(){return this.co}so(){return this.yn.mode===1}je(){return this.yn.mode===2}Lo(){return this.yn.mode===3}ro(){return this.Co}_e(){return{hs:this.yn.autoScale,zo:this.yn.invertScale,_e:this.yn.mode}}Vo(e){let t=this._e(),n=null;e.hs!==void 0&&(this.yn.autoScale=e.hs),e._e!==void 0&&(this.yn.mode=e._e,e._e!==2&&e._e!==3||(this.yn.autoScale=!0),this.oo._o=!1),t._e===1&&e._e!==t._e&&(function(e,t){if(e===null)return!1;let n=DE(e.Je(),t),r=DE(e.Qe(),t);return isFinite(n)&&isFinite(r)}(this.rr,this.Co)?(n=kE(this.rr,this.Co),n!==null&&this.Oo(n)):this.yn.autoScale=!0),e._e===1&&e._e!==t._e&&(n=OE(this.rr,this.Co),n!==null&&this.Oo(n));let r=t._e!==this.yn.mode;r&&(t._e===2||this.je())&&this.dl(),r&&(t._e===3||this.Lo())&&this.dl(),e.zo!==void 0&&t.zo!==e.zo&&(this.yn.invertScale=e.zo,this.No()),this.vo.p(t,this._e())}Fo(){return this.vo}k(){return this.ko.fontSize}$t(){return this.ho}Wo(e){this.ho!==e&&(this.ho=e,this.Bo(),this.bo=null)}Ho(){if(this.ao)return this.ao;let e=this.$t()-this.Uo()-this.$o();return this.ao=e,e}ar(){return this.jo(),this.rr}Oo(e,t){let n=this.rr;(t||n===null&&e!==null||n!==null&&!n.Ge(e))&&(this.bo=null,this.rr=e)}qo(e){this.Oo(e),this.Yo(e!==null)}Gi(){return this.jo(),this.ho===0||!this.rr||this.rr.Gi()}Ko(e){return this.zo()?e:this.$t()-1-e}Nt(e,t){return this.je()?e=SE(e,t):this.Lo()&&(e=wE(e,t)),this.Io(e,t)}Zo(e,t,n){this.jo();let r=this.$o(),i=$(this.ar()),a=i.Je(),o=i.Qe(),s=this.Ho()-1,c=this.zo(),l=s/(o-a),u=n===void 0?0:n.from,d=n===void 0?e.length:n.to,f=this.Go();for(let n=u;n<d;n++){let i=e[n],o=i.Mt;if(isNaN(o))continue;let s=o;f!==null&&(s=f(i.Mt,t));let u=r+l*(s-a);i.ut=c?u:this.ho-1-u}}Xo(e,t,n){this.jo();let r=this.$o(),i=$(this.ar()),a=i.Je(),o=i.Qe(),s=this.Ho()-1,c=this.zo(),l=s/(o-a),u=n===void 0?0:n.from,d=n===void 0?e.length:n.to,f=this.Go();for(let n=u;n<d;n++){let i=e[n],o=i.jr,s=i.qr,u=i.Yr,d=i.Kr;f!==null&&(o=f(i.jr,t),s=f(i.qr,t),u=f(i.Yr,t),d=f(i.Kr,t));let p=r+l*(o-a),m=c?p:this.ho-1-p;i.Jo=m,p=r+l*(s-a),m=c?p:this.ho-1-p,i.Qo=m,p=r+l*(u-a),m=c?p:this.ho-1-p,i.t_=m,p=r+l*(d-a),m=c?p:this.ho-1-p,i.i_=m}}Tn(e,t){let n=this.Do(e,t);return this.n_(n,t)}n_(e,t){let n=e;return this.je()?n=function(e,t){return t<0&&(e=-e),e/100*t+t}(n,t):this.Lo()&&(n=function(e,t){return e-=100,t<0&&(e=-e),e/100*t+t}(n,t)),n}Cl(){return this.mo}Dt(){return this.Mo||=NE(this.mo),this.Mo}s_(e){this.mo.indexOf(e)===-1&&(this.mo.push(e),this.dl(),this.e_())}r_(e){let t=this.mo.indexOf(e);if(t===-1)throw Error(`source is not attached to scale`);this.mo.splice(t,1),this.mo.length===0&&(this.Vo({hs:!0}),this.Oo(null)),this.dl(),this.e_()}Lt(){let e=null;for(let t of this.mo){let n=t.Lt();n!==null&&(e===null||n.za<e.za)&&(e=n)}return e===null?null:e.Wt}zo(){return this.yn.invertScale}El(){let e=this.Lt()===null;if(this.bo!==null&&(e||this.bo.h_===e))return this.bo.El;this.Ro.jl();let t=this.Ro.El();return this.bo={El:t,h_:e},this.po.p(),t}a_(){return this.po}l_(e){this.je()||this.Lo()||this.So===null&&this.lo===null&&(this.Gi()||(this.So=this.ho-e,this.lo=$(this.ar()).Xe()))}o_(e){if(this.je()||this.Lo()||this.So===null)return;this.Vo({hs:!1}),(e=this.ho-e)<0&&(e=0);let t=(this.So+.2*(this.ho-1))/(e+.2*(this.ho-1)),n=$(this.lo).Xe();t=Math.max(t,.1),n.ir(t),this.Oo(n)}__(){this.je()||this.Lo()||(this.So=null,this.lo=null)}u_(e){this.Eo()||this.xo===null&&this.lo===null&&(this.Gi()||(this.xo=e,this.lo=$(this.ar()).Xe()))}c_(e){if(this.Eo()||this.xo===null)return;let t=$(this.ar()).tr()/(this.Ho()-1),n=e-this.xo;this.zo()&&(n*=-1);let r=n*t,i=$(this.lo).Xe();i.nr(r),this.Oo(i,!0),this.bo=null}d_(){this.Eo()||this.xo!==null&&(this.xo=null,this.lo=null)}tl(){return this.il||this.dl(),this.il}Ji(e,t){switch(this.yn.mode){case 2:return this.f_(SE(e,t));case 3:return this.tl().format(wE(e,t));default:return this.cr(e)}}no(e){switch(this.yn.mode){case 2:return this.f_(e);case 3:return this.tl().format(e);default:return this.cr(e)}}Ql(e){switch(this.yn.mode){case 2:return this.p_(e);case 3:return this.tl().formatTickmarks(e);default:return this.v_(e)}}xa(e){return this.cr(e,$(this.wo).tl())}Ca(e,t){return e=SE(e,t),this.f_(e,FE)}m_(){return this.mo}w_(e){this.oo={uo:e,_o:!1}}Nn(){this.mo.forEach((e=>e.Nn()))}Kl(){return this.yn.ensureEdgeTickMarksVisible&&this.Eo()}Gl(){return this.k()/2}dl(){this.bo=null;let e=1/0;this.wo=null;for(let t of this.mo)t.ln()<e&&(e=t.ln(),this.wo=t);let t=100;this.wo!==null&&(t=Math.round(this.wo.Kh())),this.il=IE,this.je()?(this.il=FE,t=100):this.Lo()?(this.il=new hT(100,1),t=100):this.wo!==null&&(this.il=this.wo.tl()),this.Ro=new ME(this,t,this.Do.bind(this),this.Io.bind(this)),this.Ro.jl()}e_(){this.Mo=null}M_(){return this.wo===null||this.je()||this.Lo()?1:1/this.wo.Kh()}Xi(){return this.To}Yo(e){this.co=e}Uo(){return this.zo()?this.yn.scaleMargins.bottom*this.$t()+this.fo:this.yn.scaleMargins.top*this.$t()+this.do}$o(){return this.zo()?this.yn.scaleMargins.top*this.$t()+this.do:this.yn.scaleMargins.bottom*this.$t()+this.fo}jo(){this.oo._o||(this.oo._o=!0,this.g_())}Bo(){this.ao=null}Io(e,t){if(this.jo(),this.Gi())return 0;e=this.so()&&e?EE(e,this.Co):e;let n=$(this.ar()),r=this.$o()+(this.Ho()-1)*(e-n.Je())/n.tr();return this.Ko(r)}Do(e,t){if(this.jo(),this.Gi())return 0;let n=this.Ko(e),r=$(this.ar()),i=r.Je()+r.tr()*((n-this.$o())/(this.Ho()-1));return this.so()?DE(i,this.Co):i}No(){this.bo=null,this.Ro.jl()}g_(){if(this.Ao()&&!this.Eo())return;let e=this.oo.uo;if(e===null)return;let t=null,n=this.m_(),r=0,i=0;for(let a of n){if(!a.It())continue;let n=a.Lt();if(n===null)continue;let o=a.la(e.Oa(),e.bi()),s=o&&o.ar();if(s!==null){switch(this.yn.mode){case 1:s=OE(s,this.Co);break;case 2:s=CE(s,n.Wt);break;case 3:s=TE(s,n.Wt)}if(t=t===null?s:t.Ss($(s)),o!==null){let e=o.lr();e!==null&&(r=Math.max(r,e.above),i=Math.max(i,e.below))}}}if(this.Kl()&&(r=Math.max(r,this.Gl()),i=Math.max(i,this.Gl())),r===this.do&&i===this.fo||(this.do=r,this.fo=i,this.bo=null,this.Bo()),t!==null){if(t.Je()===t.Qe()){let e=5*this.M_();this.so()&&(t=kE(t,this.Co)),t=new jT(t.Je()-e,t.Qe()+e),this.so()&&(t=OE(t,this.Co))}if(this.so()){let e=kE(t,this.Co),n=AE(e);if(a=n,o=this.Co,a.Al!==o.Al||a.Ll!==o.Ll){let r=this.lo===null?null:kE(this.lo,this.Co);this.Co=n,t=OE(e,n),r!==null&&(this.lo=OE(r,n))}}this.Oo(t)}else this.rr===null&&(this.Oo(new jT(-.5,.5)),this.Co=AE(null));var a,o}Go(){return this.je()?SE:this.Lo()?wE:this.so()?e=>EE(e,this.Co):null}b_(e,t,n){return t===void 0?(n===void 0&&(n=this.tl()),n.format(e)):t(e)}S_(e,t,n){return t===void 0?(n===void 0&&(n=this.tl()),n.formatTickmarks(e)):t(e)}cr(e,t){return this.b_(e,this.Po.priceFormatter,t)}v_(e,t){let n=this.Po.priceFormatter;return this.S_(e,this.Po.tickmarksPriceFormatter??(n?e=>e.map(n):void 0),t)}f_(e,t){return this.b_(e,this.Po.percentageFormatter,t)}p_(e,t){let n=this.Po.percentageFormatter;return this.S_(e,this.Po.tickmarksPercentageFormatter??(n?e=>e.map(n):void 0),t)}};function RE(e){return e instanceof fE}var zE=class{constructor(e,t){this.mo=[],this.x_=new Map,this.ho=0,this.C_=0,this.y_=1,this.Mo=null,this.k_=null,this.P_=!1,this.T_=new Dw,this.fa=[],this.ia=e,this.sn=t,this.R_=new bE(this);let n=t.N();this.D_=this.I_(`left`,n.leftPriceScale),this.V_=this.I_(`right`,n.rightPriceScale),this.D_.Fo().i(this.B_.bind(this,this.D_),this),this.V_.Fo().i(this.B_.bind(this,this.V_),this),this.E_(n)}E_(e){if(e.leftPriceScale&&this.D_.vr(e.leftPriceScale),e.rightPriceScale&&this.V_.vr(e.rightPriceScale),e.localization&&(this.D_.dl(),this.V_.dl()),e.overlayPriceScales){let t=Array.from(this.x_.values());for(let n of t){let t=$(n[0].Ft());t.vr(e.overlayPriceScales),e.localization&&t.dl()}}}A_(e){switch(e){case`left`:return this.D_;case`right`:return this.V_}return this.x_.has(e)?Tw(this.x_.get(e))[0].Ft():null}m(){this.Qt().L_().u(this),this.D_.Fo().u(this),this.V_.Fo().u(this),this.mo.forEach((e=>{e.m&&e.m()})),this.fa=this.fa.filter((e=>{let t=e.Qh();return t.detached&&t.detached(),!1})),this.T_.p()}z_(){return this.y_}O_(e){this.y_=e}Qt(){return this.sn}nn(){return this.C_}$t(){return this.ho}N_(e){this.C_=e,this.F_()}Wo(e){this.ho=e,this.D_.Wo(e),this.V_.Wo(e),this.mo.forEach((t=>{if(this.Zs(t)){let n=t.Ft();n!==null&&n.Wo(e)}})),this.F_()}W_(e){this.P_=e}H_(){return this.P_}U_(){return this.mo.filter(RE)}Cl(){return this.mo}Zs(e){let t=e.Ft();return t===null||this.D_!==t&&this.V_!==t}s_(e,t,n){this.j_(e,t,n?e.ln():this.mo.length)}r_(e,t){let n=this.mo.indexOf(e);ww(n!==-1,`removeDataSource: invalid data source`),this.mo.splice(n,1),t||this.mo.forEach(((e,t)=>e._n(t)));let r=$(e.Ft()).cl();if(this.x_.has(r)){let t=Tw(this.x_.get(r)),n=t.indexOf(e);n!==-1&&(t.splice(n,1),t.length===0&&this.x_.delete(r))}let i=e.Ft();i&&i.Cl().indexOf(e)>=0&&(i.r_(e),this.q_(i)),this.Y_()}Xs(e){return e===this.D_?`left`:e===this.V_?`right`:`overlay`}K_(){return this.D_}Z_(){return this.V_}G_(e,t){e.l_(t)}X_(e,t){e.o_(t),this.F_()}J_(e){e.__()}Q_(e,t){e.u_(t)}tu(e,t){e.c_(t),this.F_()}iu(e){e.d_()}F_(){this.mo.forEach((e=>{e.Nn()}))}Pn(){let[e,t]=this.nu(),n=null;return e.N().visible&&e.Cl().length!==0?n=e:t.N().visible&&t.Cl().length!==0?n=t:this.mo.length!==0&&(n=this.mo[0].Ft()),n===null&&(n=this.Gs()??e),n}Gs(){let[e,t]=this.nu();return e.N().visible?e:t.N().visible?t:null}q_(e){e!==null&&e.Eo()&&this.su(e)}eu(e){let t=this.ia.Ee();e.Vo({hs:!0}),t!==null&&e.w_(t),this.F_()}ru(){this.su(this.D_),this.su(this.V_)}hu(){this.q_(this.D_),this.q_(this.V_),this.mo.forEach((e=>{this.Zs(e)&&this.q_(e.Ft())})),this.F_(),this.sn.mr()}Dt(){return this.Mo===null&&(this.Mo=NE(this.mo)),this.Mo}au(){let e=this.Dt(),t=this.sn.ou()?.lu,n=this.sn.N().hoveredSeriesOnTop,r=this.k_;if(r!==null&&r.Kh===e&&r._u===t&&r.uu===n)return r.cu;let i=function(e,t,n){if(!n)return e;let r=e.indexOf(t);if(r===-1||r===e.length-1)return e;let i=[];for(let t=0;t<e.length;t++)t!==r&&i.push(e[t]);return i.push(e[r]),i}(e,t,n);return this.k_={Kh:e,_u:t,uu:n,cu:i},i}du(e,t){t=gE(t,0,this.mo.length-1);let n=this.mo.indexOf(e);ww(n!==-1,`setSeriesOrder: invalid data source`),this.mo.splice(n,1),this.mo.splice(t,0,e),this.mo.forEach(((e,t)=>e._n(t))),this.Y_();for(let e of[this.D_,this.V_])e.e_(),e.dl();this.sn.mr()}Vt(){return this.Dt().filter(RE)}fu(){return this.T_}pu(){return this.R_}hl(e){this.fa.push(new eE(e))}al(e){this.fa=this.fa.filter((t=>t.Qh()!==e)),e.detached&&e.detached(),this.sn.mr()}vu(){return this.fa}Ja(e,t){return this.fa.map((n=>n.Qs(e,t))).filter((e=>e!==null))}su(e){let t=e.m_();if(t&&t.length>0&&!this.ia.Gi()){let t=this.ia.Ee();t!==null&&e.w_(t)}e.Nn()}j_(e,t,n){let r=this.A_(t);if(r===null&&(r=this.I_(t,this.sn.N().overlayPriceScales)),this.mo.splice(n,0,e),!uT(t)){let n=this.x_.get(t)||[];n.push(e),this.x_.set(t,n)}e._n(n),r.s_(e),e.un(r),this.q_(r),this.Y_()}Y_(){this.Mo=null,this.k_=null}nu(){return this.sn.N().defaultVisiblePriceScaleId===`left`?[this.D_,this.V_]:[this.V_,this.D_]}B_(e,t,n){t._e!==n._e&&this.su(e)}I_(e,t){let n=new LE(e,{visible:!0,autoScale:!0,...Nw(t)},this.sn.N().layout,this.sn.N().localization,this.sn.Xi());return n.Wo(this.$t()),n}};function BE(e,t){return t===null||e.se===2&&t.se!==2||(t.se!==2||e.se===2)&&e.ne!==t.ne&&e.ne<t.ne}function VE(e){return{te:e.te,ie:e.ie}}function HE(e){return{ne:e.distance??0,se:e.hitTestPriority??(e.itemType===`marker`?2:0),ee:e.itemType??`primitive`,mu:e.cursorStyle,te:e.externalId}}function UE(e){return{lu:e.lu,wu:VE(e.Mu),mu:e.Mu.mu,ee:e.Mu.ee??`primitive`}}function WE(e,t,n,r){let i=null;for(let a of e){let e=a.Qs?.(t,n,r)??null;if(e===null){let i=a.Tt(r);e=i!==null&&i.Qs?i.Qs(t,n):null}if(e!==null){let t={gu:a,Mu:e};(i===null||BE(t.Mu,i.Mu))&&(i=t)}}return i}function GE(e){return e.jn!==void 0}function KE(e,t,n){let r=[e,...e.Dt()].reverse(),i=function(e,t,n){let r,i,a;for(let c of e){let e=c.Ja?.(t,n)??[];for(let t of e){let e=HE(t);o=t.zOrder,s=r?.zOrder,(!s||o===`top`&&s!==`top`||o===`normal`&&s===`bottom`||t.zOrder===r?.zOrder&&i!==void 0&&BE(e,i)||t.zOrder===r?.zOrder&&i===void 0)&&(r=t,i=e,a=c)}}var o,s;return r&&a&&i?{Mu:i,bu:r,lu:a}:null}(r,t,n);if(i?.bu.zOrder===`top`)return UE(i);let a=null,o=null;for(let s of r){if(i&&i.lu===s&&i.bu.zOrder!==`bottom`&&!i.bu.isBackground)return a??UE(i);if(GE(s)){let r=WE(s.jn(e),t,n,e);if(r!==null){let e={lu:s,gu:r.gu,wu:VE(r.Mu),mu:r.Mu.mu,ee:r.Mu.ee??`primitive`};(a===null||BE(r.Mu,o))&&(a=e,o=r.Mu)}}if(i&&i.lu===s&&i.bu.zOrder!==`bottom`&&i.bu.isBackground)return a??UE(i)}return a===null?i?.bu?UE(i):null:a}var qE=class{constructor(e,t,n=50){this.Vs=0,this.Bs=1,this.Es=1,this.Ls=new Map,this.As=new Map,this.Su=e,this.xu=t,this.zs=n}Cu(e){let t=e.time,n=this.xu.cacheKey(t),r=this.Ls.get(n);if(r!==void 0)return r.yu;if(this.Vs===this.zs){let e=this.As.get(this.Es);this.As.delete(this.Es),this.Ls.delete(Tw(e)),this.Es++,this.Vs--}let i=this.Su(e);return this.Ls.set(n,{yu:i,Ws:this.Bs}),this.As.set(this.Bs,n),this.Vs++,this.Bs++,i}},JE=class{constructor(e,t){ww(e<=t,`right should be >= left`),this.ku=e,this.Pu=t}Oa(){return this.ku}bi(){return this.Pu}Tu(){return this.Pu-this.ku+1}ze(e){return this.ku<=e&&e<=this.Pu}Ge(e){return this.ku===e.Oa()&&this.Pu===e.bi()}};function YE(e,t){return e===null||t===null?e===t:e.Ge(t)}var XE=class{constructor(){this.Ru=new Map,this.Ls=null,this.Du=!1}Iu(e){this.Du=e,this.Ls=null}Vu(e,t){this.Bu(t),this.Ls=null;for(let n=t;n<e.length;++n){let t=e[n],r=this.Ru.get(t.timeWeight);r===void 0&&(r=[],this.Ru.set(t.timeWeight,r)),r.push({index:n,time:t.time,weight:t.timeWeight,originalTime:t.originalTime})}}Eu(e,t,n,r,i){let a=Math.ceil(t/e);return this.Ls!==null&&this.Ls.Au===a&&i===this.Ls.Lu&&n===this.Ls.zu||(this.Ls={Lu:i,zu:n,El:this.Ou(a,n,r),Au:a}),this.Ls.El}Bu(e){if(e===0)return void this.Ru.clear();let t=[];this.Ru.forEach(((n,r)=>{e<=n[0].index?t.push(r):n.splice(UT(n,e,(t=>t.index<e)),1/0)}));for(let e of t)this.Ru.delete(e)}Ou(e,t,n){let r=[],i=e=>!t||n.has(e.index);for(let t of Array.from(this.Ru.keys()).sort(((e,t)=>t-e))){if(!this.Ru.get(t))continue;let n=r;r=[];let a=n.length,o=0,s=Tw(this.Ru.get(t)),c=s.length,l=1/0,u=-1/0;for(let t=0;t<c;t++){let c=s[t],d=c.index;for(;o<a;){let e=n[o],t=e.index;if(!(t<d&&i(e))){l=t;break}o++,r.push(e),u=t,l=1/0}if(l-d>=e&&d-u>=e&&i(c))r.push(c),u=d;else if(this.Du)return n}for(;o<a;o++)i(n[o])&&r.push(n[o])}return r}},ZE=class e{constructor(e){this.Nu=e}Fu(){return this.Nu===null?null:new JE(Math.floor(this.Nu.Oa()),Math.ceil(this.Nu.bi()))}Wu(){return this.Nu}static Hu(){return new e(null)}};function QE(e,t){return e.weight>t.weight?e:t}var $E=class{constructor(e,t,n,r){this.C_=0,this.Uu=null,this.$u=[],this.xo=null,this.So=null,this.ju=new XE,this.qu=new Map,this.Yu=ZE.Hu(),this.Ku=!0,this.Zu=new Dw,this.Gu=new Dw,this.Xu=new Dw,this.Ju=null,this.Qu=null,this.tc=new Map,this.nc=-1,this.sc=[],this.ec=1,this.yn=t,this.Po=n,this.rc=t.rightOffset,this.hc=t.barSpacing,this.sn=e,this.ac(t),this.xu=r,this.lc(),this.ju.Iu(t.uniformDistribution),this.oc(),this._c()}N(){return this.yn}uc(e){Ow(this.Po,e),this.cc(),this.lc()}vr(e,t){Ow(this.yn,e),this.yn.fixLeftEdge&&this.dc(),this.yn.fixRightEdge&&this.fc(),e.barSpacing!==void 0&&this.sn.Ms(e.barSpacing),e.rightOffset!==void 0&&this.sn.gs(e.rightOffset),this.ac(e),e.minBarSpacing===void 0&&e.maxBarSpacing===void 0||this.sn.Ms(e.barSpacing??this.hc),e.ignoreWhitespaceIndices!==void 0&&e.ignoreWhitespaceIndices!==this.yn.ignoreWhitespaceIndices&&this._c(),this.cc(),this.lc(),e.enableConflation===void 0&&e.conflationThresholdFactor===void 0||this.oc(),this.Xu.p()}Rn(e){return this.$u[e]?.time??null}en(e){return this.$u[e]??null}vc(e,t){if(this.$u.length<1)return null;if(this.xu.key(e)>this.xu.key(this.$u[this.$u.length-1].time))return t?this.$u.length-1:null;let n=UT(this.$u,this.xu.key(e),((e,t)=>this.xu.key(e.time)<t));return this.xu.key(e)<this.xu.key(this.$u[n].time)?t?n:null:n}Gi(){return this.C_===0||this.$u.length===0||this.Uu===null}mc(){return this.$u.length>0}Ee(){return this.wc(),this.Yu.Fu()}Mc(){return this.wc(),this.Yu.Wu()}gc(){let e=this.Ee();if(e===null)return null;let t={from:e.Oa(),to:e.bi()};return this.bc(t)}bc(e){let t=Math.round(e.from),n=Math.round(e.to),r=$(this.Sc()),i=$(this.xc());return{from:$(this.en(Math.max(r,t))),to:$(this.en(Math.min(i,n)))}}Cc(e){return{from:$(this.vc(e.from,!0)),to:$(this.vc(e.to,!0))}}nn(){return this.C_}N_(e){if(!isFinite(e)||e<=0||this.C_===e)return;let t=this.Mc(),n=this.C_;if(this.C_=e,this.Ku=!0,this.yn.lockVisibleTimeRangeOnResize&&n!==0){let t=this.hc*e/n;this.hc=t}if(this.yn.fixLeftEdge&&t!==null&&t.Oa()<=0){let t=n-e;this.rc-=Math.round(t/this.hc)+1,this.Ku=!0}this.yc(),this.kc()}jt(e){if(this.Gi()||!Aw(e))return 0;let t=this.Pc()+this.rc-e;return this.C_-(t+.5)*this.hc-1}Tc(e,t){let n=this.Pc(),r=t===void 0?0:t.from,i=t===void 0?e.length:t.to;for(let t=r;t<i;t++){let r=e[t].wt,i=n+this.rc-r,a=this.C_-(i+.5)*this.hc-1;e[t]._t=a}}Rc(e,t){let n=Math.ceil(this.Dc(e));return t&&this.yn.ignoreWhitespaceIndices&&!this.Ic(n)?this.Vc(n):n}gs(e){this.Ku=!0,this.rc=e,this.kc(),this.sn.Bc(),this.sn.mr()}fl(){return this.hc}Ms(e){let t=this.hc;if(this.Ec(e),this.yn.rightOffsetPixels!==void 0&&t!==0){let e=this.rc*t/this.hc;this.rc=e}this.kc(),this.sn.Bc(),this.sn.mr()}Ac(){return this.rc}El(){if(this.Gi())return null;if(this.Qu!==null)return this.Qu;let e=this.hc,t=5*(this.sn.N().layout.fontSize+4)/8*(this.yn.tickMarkMaxCharacterLength||8),n=Math.round(t/e),r=$(this.Ee()),i=Math.max(r.Oa(),r.Oa()-n),a=Math.max(r.bi(),r.bi()-n),o=this.ju.Eu(e,t,this.yn.ignoreWhitespaceIndices,this.tc,this.nc),s=this.Sc()+n,c=this.xc()-n,l=this.Lc(),u=this.yn.fixLeftEdge||l,d=this.yn.fixRightEdge||l,f=0;for(let e of o){if(!(i<=e.index&&e.index<=a))continue;let n;f<this.sc.length?(n=this.sc[f],n.coord=this.jt(e.index),n.label=this.zc(e),n.weight=e.weight):(n={needAlignCoordinate:!1,coord:this.jt(e.index),label:this.zc(e),weight:e.weight},this.sc.push(n)),this.hc>t/2&&!l?n.needAlignCoordinate=!1:n.needAlignCoordinate=u&&e.index<=s||d&&e.index>=c,f++}return this.sc.length=f,this.Qu=this.sc,this.sc}Oc(){let e;this.Ku=!0,this.Ms(this.yn.barSpacing),e=this.yn.rightOffsetPixels===void 0?this.yn.rightOffset:this.yn.rightOffsetPixels/this.fl(),this.gs(e)}Nc(e){this.Ku=!0,this.Uu=e,this.kc(),this.dc()}Fc(e,t){let n=this.Dc(e),r=this.fl(),i=r+r/10*t;this.Ms(i),this.yn.rightBarStaysOnScroll||this.gs(this.Ac()+(n-this.Dc(e)))}l_(e){this.xo&&this.d_(),this.So===null&&this.Ju===null&&(this.Gi()||(this.So=e,this.Wc()))}o_(e){if(this.Ju===null)return;let t=gE(this.C_-e,0,this.C_),n=gE(this.C_-$(this.So),0,this.C_);t!==0&&n!==0&&this.Ms(this.Ju.fl*t/n)}__(){this.So!==null&&(this.So=null,this.Hc())}u_(e){this.xo===null&&this.Ju===null&&(this.Gi()||(this.xo=e,this.Wc()))}c_(e){if(this.xo===null)return;let t=(this.xo-e)/this.fl();this.rc=$(this.Ju).Ac+t,this.Ku=!0,this.kc()}d_(){this.xo!==null&&(this.xo=null,this.Hc())}Uc(){this.$c(this.yn.rightOffset)}$c(e,t=400){if(!isFinite(e))throw RangeError(`offset is required and must be finite number`);if(!isFinite(t)||t<=0)throw RangeError(`animationDuration (optional) must be finite positive number`);let n=this.rc,r=performance.now();this.sn.ps({jc:e=>(e-r)/t>=1,qc:i=>{let a=(i-r)/t;return a>=1?e:n+(e-n)*a}})}kt(e,t){this.Ku=!0,this.$u=e,this.ju.Vu(e,t),this.kc()}Yc(){return this.Zu}Kc(){return this.Gu}Zc(){return this.Xu}Pc(){return this.Uu||0}Gc(e,t){let n=e.Tu(),r=t&&this.yn.rightOffsetPixels||0;this.Ec((this.C_-r)/n),this.rc=e.bi()-this.Pc(),t&&(this.rc=r?r/this.fl():this.yn.rightOffset),this.kc(),this.Ku=!0,this.sn.Bc(),this.sn.mr()}Xc(){let e=this.Sc(),t=this.xc();if(e===null||t===null)return;let n=!this.yn.rightOffsetPixels&&this.yn.rightOffset||0;this.Gc(new JE(e,t+n),!0)}Jc(e){let t=new JE(e.from,e.to);this.Gc(t)}rn(e){return this.Po.timeFormatter===void 0?this.xu.formatHorzItem(e.time):this.Po.timeFormatter(e.originalTime)}_c(){if(!this.yn.ignoreWhitespaceIndices)return;this.tc.clear();let e=this.sn.Jn();for(let t of e)for(let e of t.ul())this.tc.set(e,!0);this.nc++}Qc(){return this.ec}Ml(){let e=1/(window.devicePixelRatio||1),t=this.yn.minBarSpacing;if(t>=e)return[1];let n=[1],r=2;for(;r<=512;)t<e/r&&n.push(r),r*=2;return n}Lc(){let e=this.sn.N().handleScroll,t=this.sn.N().handleScale;return!(e.horzTouchDrag||e.mouseWheel||e.pressedMouseMove||e.vertTouchDrag||t.axisDoubleClickReset.time||t.axisPressedMouseMove.time||t.mouseWheel||t.pinch)}Sc(){return this.$u.length===0?null:0}xc(){return this.$u.length===0?null:this.$u.length-1}td(e){return(this.C_-1-e)/this.hc}Dc(e){let t=this.td(e),n=this.Pc()+this.rc-t;return Math.round(1e6*n)/1e6}Ec(e){let t=this.hc;this.hc=e,this.yc(),t!==this.hc&&(this.Ku=!0,this.nd(),this.oc())}wc(){if(!this.Ku)return;if(this.Ku=!1,this.Gi())return void this.sd(ZE.Hu());let e=this.Pc(),t=this.C_/this.hc,n=this.rc+e,r=new JE(n-t+1,n);this.sd(new ZE(r))}yc(){let e=gE(this.hc,this.ed(),this.rd());this.hc!==e&&(this.hc=e,this.Ku=!0)}rd(){return this.yn.maxBarSpacing>0?this.yn.maxBarSpacing:.5*this.C_}ed(){return this.yn.fixLeftEdge&&this.yn.fixRightEdge&&this.$u.length!==0?this.C_/this.$u.length:this.yn.minBarSpacing}oc(){if(!this.yn.enableConflation)return void(this.ec=1);let e=1/(window.devicePixelRatio||1)*(this.yn.conflationThresholdFactor??1);if(this.hc>=e)return void(this.ec=1);let t=e/this.hc,n=2**Math.floor(Math.log2(t));this.ec=Math.min(n,512)}kc(){let e=this.hd();e!==null&&this.rc<e&&(this.rc=e,this.Ku=!0);let t=this.ad();this.rc>t&&(this.rc=t,this.Ku=!0)}hd(){let e=this.Sc(),t=this.Uu;return e===null||t===null?null:e-t-1+(this.yn.fixLeftEdge?this.C_/this.hc:Math.min(2,this.$u.length))}ad(){return this.yn.fixRightEdge?0:this.C_/this.hc-Math.min(2,this.$u.length)}Wc(){this.Ju={fl:this.fl(),Ac:this.Ac()}}Hc(){this.Ju=null}zc(e){let t=this.qu.get(e.weight);return t===void 0&&(t=new qE((e=>this.ld(e)),this.xu),this.qu.set(e.weight,t)),t.Cu(e)}ld(e){return this.xu.formatTickmark(e,this.Po)}sd(e){let t=this.Yu;this.Yu=e,YE(t.Fu(),this.Yu.Fu())||this.Zu.p(),YE(t.Wu(),this.Yu.Wu())||this.Gu.p(),this.nd()}nd(){this.Qu=null}cc(){this.nd(),this.qu.clear()}lc(){this.xu.updateFormatter(this.Po)}dc(){if(!this.yn.fixLeftEdge)return;let e=this.Sc();if(e===null)return;let t=this.Ee();if(t===null)return;let n=t.Oa()-e;if(n<0){let e=this.rc-n-1;this.gs(e)}this.yc()}fc(){this.kc(),this.yc()}Ic(e){return!this.yn.ignoreWhitespaceIndices||this.tc.get(e)||!1}Vc(e){let t=function*(e){let t=Math.round(e),n=t<e,r=1;for(;;)n?(yield t+r,yield t-r):(yield t-r,yield t+r),r++}(e),n=this.xc();for(;n;){let e=t.next().value;if(this.tc.get(e))return e;if(e<0||e>n)break}return e}ac(e){if(e.rightOffsetPixels!==void 0){let t=e.rightOffsetPixels/(e.barSpacing||this.hc);this.sn.gs(t)}}},eD,tD,nD,rD,iD;(function(e){e[e.OnTouchEnd=0]=`OnTouchEnd`,e[e.OnNextTap=1]=`OnNextTap`})(eD||={});var aD=class{constructor(e,t,n){this.od=[],this._d=[],this.ud=null,this.C_=0,this.dd=null,this.fd=new Dw,this.pd=new Dw,this.vd=null,this.md=e,this.yn=t,this.xu=n,this.To=new Vw(this.yn.layout.colorParsers),this.wd=new Rw(this),this.ia=new $E(this,t.timeScale,this.yn.localization,n),this.Ct=new lT(this,t.crosshair),this.Md=new hE(t.crosshair),t.addDefaultPane&&(this.gd(0),this.od[0].O_(2)),this.bd=this.Sd(0),this.xd=this.Sd(1)}Pa(){this.Cd(dT.ys())}mr(){this.Cd(dT.Cs())}qa(){this.Cd(new dT(1))}Ta(e){let t=this.yd(e);this.Cd(t)}ou(){return this.dd}kd(e){if(this.dd?.lu===e?.lu&&this.dd?.wu?.te===e?.wu?.te&&this.dd?.wu?.ie===e?.wu?.ie&&this.dd?.mu===e?.mu&&this.dd?.ee===e?.ee)return;let t=this.dd;this.dd=e,t!==null&&this.Ta(t.lu),e!==null&&e.lu!==t?.lu&&this.Ta(e.lu)}N(){return this.yn}vr(e){Ow(this.yn,e),this.od.forEach((t=>t.E_(e))),e.timeScale!==void 0&&this.ia.vr(e.timeScale),e.localization!==void 0&&this.ia.uc(e.localization),(e.leftPriceScale||e.rightPriceScale)&&this.fd.p(),this.bd=this.Sd(0),this.xd=this.Sd(1),this.Pa()}Pd(e,t,n=0){let r=this.od[n];if(r===void 0)return;if(e===`left`)return Ow(this.yn,{leftPriceScale:t}),r.E_({leftPriceScale:t}),this.fd.p(),void this.Pa();if(e===`right`)return Ow(this.yn,{rightPriceScale:t}),r.E_({rightPriceScale:t}),this.fd.p(),void this.Pa();let i=this.Td(e,n);i!==null&&(i.Ft.vr(t),this.fd.p())}Td(e,t){let n=this.od[t];if(n===void 0)return null;let r=n.A_(e);return r===null?null:{Kn:n,Ft:r}}Et(){return this.ia}Zn(){return this.od}Rd(){return this.Ct}Dd(){return this.pd}Id(e,t){e.Wo(t),this.Bc()}N_(e){this.C_=e,this.ia.N_(this.C_),this.od.forEach((t=>t.N_(e))),this.Bc()}Vd(e){this.od.length!==1&&(ww(e>=0&&e<this.od.length,`Invalid pane index`),this.od.splice(e,1),this.Pa())}Bd(e,t){if(this.od.length<2)return;ww(e>=0&&e<this.od.length,`Invalid pane index`);let n=this.od[e],r=this.od.reduce(((e,t)=>e+t.z_()),0),i=this.od.reduce(((e,t)=>e+t.$t()),0),a=i-30*(this.od.length-1);t=Math.min(a,Math.max(30,t));let o=r/i,s=n.$t();n.O_(t*o);let c=t-s,l=this.od.length-1;for(let e of this.od)if(e!==n){let t=Math.min(a,Math.max(30,e.$t()-c/l));c-=e.$t()-t,--l;let n=t*o;e.O_(n)}this.Pa()}Ed(e,t){ww(e>=0&&e<this.od.length&&t>=0&&t<this.od.length,`Invalid pane index`);let n=this.od[e],r=this.od[t];this.od[e]=r,this.od[t]=n,this.Pa()}Ad(e,t){if(ww(e>=0&&e<this.od.length&&t>=0&&t<this.od.length,`Invalid pane index`),e===t)return;let[n]=this.od.splice(e,1);this.od.splice(t,0,n),this.Pa()}G_(e,t,n){e.G_(t,n)}X_(e,t,n){e.X_(t,n),this.Ra(),this.Cd(this.Ld(e,2))}J_(e,t){e.J_(t),this.Cd(this.Ld(e,2))}Q_(e,t,n){t.Eo()||e.Q_(t,n)}tu(e,t,n){t.Eo()||(e.tu(t,n),this.Ra(),this.Cd(this.Ld(e,2)))}iu(e,t){t.Eo()||(e.iu(t),this.Cd(this.Ld(e,2)))}eu(e,t){e.eu(t),this.Cd(this.Ld(e,2))}zd(e){this.ia.l_(e)}Od(e,t){let n=this.Et();if(n.Gi()||t===0)return;let r=n.nn();e=Math.max(1,Math.min(e,r)),n.Fc(e,t),this.Bc()}Nd(e){this.Fd(0),this.Wd(e),this.Hd()}Ud(e){this.ia.o_(e),this.Bc()}$d(){this.ia.__(),this.mr()}Fd(e){this.ia.u_(e)}Wd(e){this.ia.c_(e),this.Bc()}Hd(){this.ia.d_(),this.mr()}Jn(){return this._d}Wn(){return this.ud===null&&(this.ud=this._d.filter((e=>e.It()))),this.ud}ka(){this.ud=null}jd(e,t,n,r,i){this.Ct.In(e,t);let a=NaN,o=this.ia.Rc(e,!0),s=this.ia.Ee();s!==null&&(o=Math.min(Math.max(s.Oa(),o),s.bi())),o=this.Ct.Fn(o);let c=r.Pn(),l=c.Lt();if(l!==null&&(a=c.Tn(t,l)),a=this.Md.xl(a,o,r),this.Ct.An(o,a,r),this.qa(),!i){let i=KE(r,e,t);this.kd(i&&{lu:i.lu,wu:i.wu,mu:i.mu||null,ee:i.ee}),this.pd.p(this.Ct.Bt(),{x:e,y:t},n)}}qd(e,t,n){let r=n.Pn(),i=r.Lt(),a=r.Nt(e,$(i)),o=this.ia.vc(t,!0),s=this.ia.jt($(o));this.jd(s,a,null,n,!0)}Yd(e){this.Rd().zn(),this.qa(),e||this.pd.p(null,null,null)}Ra(){let e=this.Ct.Kn();if(e!==null){let t=this.Ct.Bn(),n=this.Ct.En();this.jd(t,n,null,e)}this.Ct.Nn()}Kd(e,t,n){let r=this.ia.Rn(0);t!==void 0&&n!==void 0&&this.ia.kt(t,n);let i=this.ia.Rn(0),a=this.ia.Pc(),o=this.ia.Ee();if(o!==null&&r!==null&&i!==null){let t=o.ze(a),s=this.xu.key(r)>this.xu.key(i),c=e!==null&&e>a&&!s,l=this.ia.N().allowShiftVisibleRangeOnWhitespaceReplacement,u=t&&(n!==void 0||l)&&this.ia.N().shiftVisibleRangeOnNewBar;if(c&&!u){let t=e-a;this.ia.gs(this.ia.Ac()-t)}}this.ia.Nc(e)}Va(e){e!==null&&e.hu()}Ks(e){if(function(e){return e instanceof zE}(e))return e;let t=this.od.find((t=>t.Dt().includes(e)));return t===void 0?null:t}Bc(){this.od.forEach((e=>e.hu())),this.Ra()}m(){this.od.forEach((e=>e.m())),this.od.length=0,this.yn.localization.priceFormatter=void 0,this.yn.localization.percentageFormatter=void 0,this.yn.localization.timeFormatter=void 0}Zd(){return this.wd}Js(){return this.wd.N()}L_(){return this.fd}Gd(e,t){let n=this.gd(t);this.Xd(e,n),this._d.push(e),this.ka(),this._d.length===1?this.Pa():this.mr()}Jd(e){let t=this.Ks(e),n=this._d.indexOf(e);ww(n!==-1,`Series not found`);let r=$(t);this._d.splice(n,1),r.r_(e),e.m&&e.m(),this.ka(),this.ia._c(),this.Qd(r)}ya(e,t){let n=$(this.Ks(e));n.r_(e,!0),n.s_(e,t,!0)}Xc(){let e=dT.Cs();e.us(),this.Cd(e)}tf(e){let t=dT.Cs();t.fs(e),this.Cd(t)}ws(){let e=dT.Cs();e.ws(),this.Cd(e)}Ms(e){let t=dT.Cs();t.Ms(e),this.Cd(t)}gs(e){let t=dT.Cs();t.gs(e),this.Cd(t)}ps(e){let t=dT.Cs();t.ps(e),this.Cd(t)}cs(){let e=dT.Cs();e.cs(),this.Cd(e)}if(){let e=this.yn.defaultVisiblePriceScaleId,t=this.yn.leftPriceScale.visible;return t===this.yn.rightPriceScale.visible?e:t?`left`:`right`}nf(e,t){if(ww(t>=0,`Index should be greater or equal to 0`),t===this.sf(e))return;let n=$(this.Ks(e));n.r_(e);let r=this.gd(t);this.Xd(e,r);let i=!1;n.Cl().length===0&&(i=this.Qd(n)),i||this.Pa()}ef(){return this.xd}$(){return this.bd}Ut(e){let t=this.xd,n=this.bd;if(t===n)return t;if(e=Math.max(0,Math.min(100,Math.round(100*e))),this.vd===null||this.vd.ah!==n||this.vd.oh!==t)this.vd={ah:n,oh:t,rf:new Map};else{let t=this.vd.rf.get(e);if(t!==void 0)return t}let r=this.To.tt(n,t,e/100);return this.vd.rf.set(e,r),r}hf(e){return this.od.indexOf(e)}Xi(){return this.To}af(){return this.lf()}lf(e){let t=new zE(this.ia,this);this.od.push(t);let n=e??this.od.length-1,r=dT.ys();return r.es(n,{rs:0,hs:!0}),this.Cd(r),t}gd(e){return ww(e>=0,`Index should be greater or equal to 0`),(e=Math.min(this.od.length,e))<this.od.length?this.od[e]:this.lf(e)}sf(e){return this.od.findIndex((t=>t.U_().includes(e)))}Ld(e,t){let n=new dT(t);if(e!==null){let r=this.od.indexOf(e);n.es(r,{rs:t})}return n}yd(e,t){return t===void 0&&(t=2),this.Ld(this.Ks(e),t)}Cd(e){this.md&&this.md(e),this.od.forEach((e=>e.pu().wr().kt()))}Xd(e,t){let n=e.N().priceScaleId,r=n===void 0?this.if():n;t.s_(e,r),uT(r)||e.vr(e.N())}Sd(e){let t=this.yn.layout;return t.background.type===`gradient`?e===0?t.background.topColor:t.background.bottomColor:t.background.color}Qd(e){return!e.H_()&&e.Cl().length===0&&this.od.length>1&&(this.od.splice(this.hf(e),1),this.Pa(),!0)}};function oD(e){if(e>=1)return 0;let t=0;for(;t<8;t++){if(Math.abs(Math.round(e)-e)<1e-8)return t;e*=10}return t}function sD(e){return!kw(e)&&!jw(e)}function cD(e){return kw(e)}(function(e){e[e.Disabled=0]=`Disabled`,e[e.Continuous=1]=`Continuous`,e[e.OnDataUpdate=2]=`OnDataUpdate`})(tD||={}),function(e){e[e.LastBar=0]=`LastBar`,e[e.LastVisible=1]=`LastVisible`}(nD||={}),function(e){e.Solid=`solid`,e.VerticalGradient=`gradient`}(rD||={}),function(e){e[e.Year=0]=`Year`,e[e.Month=1]=`Month`,e[e.DayOfMonth=2]=`DayOfMonth`,e[e.Time=3]=`Time`,e[e.TimeWithSeconds=4]=`TimeWithSeconds`}(iD||={});var lD=e=>e.getUTCFullYear();function uD(e,t,n){return t.replace(/yyyy/g,(e=>mT(lD(e),4))(e)).replace(/yy/g,(e=>mT(lD(e)%100,2))(e)).replace(/MMMM/g,((e,t)=>new Date(e.getUTCFullYear(),e.getUTCMonth(),1).toLocaleString(t,{month:`long`}))(e,n)).replace(/MMM/g,((e,t)=>new Date(e.getUTCFullYear(),e.getUTCMonth(),1).toLocaleString(t,{month:`short`}))(e,n)).replace(/MM/g,(e=>mT((e=>e.getUTCMonth()+1)(e),2))(e)).replace(/dd/g,(e=>mT((e=>e.getUTCDate())(e),2))(e))}var dD=class{constructor(e=`yyyy-MM-dd`,t=`default`){this._f=e,this.uf=t}Cu(e){return uD(e,this._f,this.uf)}},fD=class{constructor(e){this.cf=e||`%h:%m:%s`}Cu(e){return this.cf.replace(`%h`,mT(e.getUTCHours(),2)).replace(`%m`,mT(e.getUTCMinutes(),2)).replace(`%s`,mT(e.getUTCSeconds(),2))}},pD={df:`yyyy-MM-dd`,ff:`%h:%m:%s`,pf:` `,vf:`default`},mD=class{constructor(e={}){let t={...pD,...e};this.mf=new dD(t.df,t.vf),this.wf=new fD(t.ff),this.Mf=t.pf}Cu(e){return`${this.mf.Cu(e)}${this.Mf}${this.wf.Cu(e)}`}};function hD(e){return 60*e*60*1e3}function gD(e){return 60*e*1e3}var _D=[{gf:(vD=1,1e3*vD),bf:10},{gf:gD(1),bf:20},{gf:gD(5),bf:21},{gf:gD(30),bf:22},{gf:hD(1),bf:30},{gf:hD(3),bf:31},{gf:hD(6),bf:32},{gf:hD(12),bf:33}],vD;function yD(e,t){if(e.getUTCFullYear()!==t.getUTCFullYear())return 70;if(e.getUTCMonth()!==t.getUTCMonth())return 60;if(e.getUTCDate()!==t.getUTCDate())return 50;for(let n=_D.length-1;n>=0;--n)if(Math.floor(t.getTime()/_D[n].gf)!==Math.floor(e.getTime()/_D[n].gf))return _D[n].bf;return 0}function bD(e){let t=e;if(jw(e)&&(t=SD(e)),!sD(t))throw Error(`time must be of type BusinessDay`);let n=new Date(Date.UTC(t.year,t.month-1,t.day,0,0,0,0));return{Sf:Math.round(n.getTime()/1e3),xf:t}}function xD(e){if(!cD(e))throw Error(`time must be of type isUTCTimestamp`);return{Sf:e}}function SD(e){let t=new Date(e);if(isNaN(t.getTime()))throw Error(`Invalid date string=${e}, expected format=yyyy-mm-dd`);return{day:t.getUTCDate(),month:t.getUTCMonth()+1,year:t.getUTCFullYear()}}function CD(e){jw(e.time)&&(e.time=SD(e.time))}var wD=class{options(){return this.yn}setOptions(e){this.yn=e,this.updateFormatter(e.localization)}preprocessData(e){Array.isArray(e)?function(e){e.forEach(CD)}(e):CD(e)}createConverterToInternalObj(e){return $(function(e){return e.length===0?null:sD(e[0].time)||jw(e[0].time)?bD:xD}(e))}key(e){return typeof e==`object`&&`Sf`in e?e.Sf:this.key(this.convertHorzItemToInternal(e))}cacheKey(e){let t=e;return t.xf===void 0?new Date(1e3*t.Sf).getTime():new Date(Date.UTC(t.xf.year,t.xf.month-1,t.xf.day)).getTime()}convertHorzItemToInternal(e){return cD(t=e)?xD(t):sD(t)?bD(t):bD(SD(t));var t}updateFormatter(e){if(!this.yn)return;let t=e.dateFormat;this.yn.timeScale.timeVisible?this.Cf=new mD({df:t,ff:this.yn.timeScale.secondsVisible?`%h:%m:%s`:`%h:%m`,pf:` `,vf:e.locale}):this.Cf=new dD(t,e.locale)}formatHorzItem(e){let t=e;return this.Cf.Cu(new Date(1e3*t.Sf))}formatTickmark(e,t){let n=function(e,t,n){switch(e){case 0:case 10:return t?n?4:3:2;case 20:case 21:case 22:case 30:case 31:case 32:case 33:return t?3:2;case 50:return 2;case 60:return 1;case 70:return 0}}(e.weight,this.yn.timeScale.timeVisible,this.yn.timeScale.secondsVisible),r=this.yn.timeScale;if(r.tickMarkFormatter!==void 0){let i=r.tickMarkFormatter(e.originalTime,n,t.locale);if(i!==null)return i}return function(e,t,n){let r={};switch(t){case 0:r.year=`numeric`;break;case 1:r.month=`short`;break;case 2:r.day=`numeric`;break;case 3:r.hour12=!1,r.hour=`2-digit`,r.minute=`2-digit`;break;case 4:r.hour12=!1,r.hour=`2-digit`,r.minute=`2-digit`,r.second=`2-digit`}let i=e.xf===void 0?new Date(1e3*e.Sf):new Date(Date.UTC(e.xf.year,e.xf.month-1,e.xf.day));return new Date(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate(),i.getUTCHours(),i.getUTCMinutes(),i.getUTCSeconds(),i.getUTCMilliseconds()).toLocaleString(n,r)}(e.time,n,t.locale)}maxTickMarkWeight(e){let t=e.reduce(QE,e[0]).weight;return t>30&&t<50&&(t=30),t}fillWeightsForPoints(e,t){(function(e,t=0){if(e.length===0)return;let n=t===0?null:e[t-1].time.Sf,r=n===null?null:new Date(1e3*n),i=0;for(let a=t;a<e.length;++a){let t=e[a],o=new Date(1e3*t.time.Sf);r!==null&&(t.timeWeight=yD(o,r)),i+=t.time.Sf-(n||t.time.Sf),n=t.time.Sf,r=o}if(t===0&&e.length>1){let t=Math.ceil(i/(e.length-1)),n=new Date(1e3*(e[0].time.Sf-t));e[0].timeWeight=yD(new Date(1e3*e[0].time.Sf),n)}})(e,t)}static yf(e){return Ow({localization:{dateFormat:`dd MMM 'yy`}},e??{})}},TD=typeof window<`u`;function ED(){return!!TD&&window.navigator.userAgent.toLowerCase().indexOf(`firefox`)>-1}function DD(){return!!TD&&/iPhone|iPad|iPod/.test(window.navigator.platform)}function OD(e,t){switch(e){case`custom`:return t===void 0?`series`:`custom-object`;case`price-line`:return`custom-price-line`;case`marker`:return`series-marker`;case`primitive`:return`primitive`;default:return`series`}}function kD(e){return e+e%2}function AD(e){TD&&window.chrome!==void 0&&e.addEventListener(`mousedown`,(e=>{if(e.button===1)return e.preventDefault(),!1}))}var jD=class{constructor(e,t,n){this.kf=0,this.Pf=null,this.Tf={_t:-1/0,ut:1/0},this.Rf=0,this.Df=null,this.If={_t:-1/0,ut:1/0},this.Vf=null,this.Bf=!1,this.Ef=null,this.Af=null,this.Lf=!1,this.zf=!1,this.Of=!1,this.Nf=null,this.Ff=null,this.Wf=null,this.Hf=null,this.Uf=null,this.$f=null,this.jf=null,this.qf=0,this.Yf=!1,this.Kf=!1,this.Zf=!1,this.Gf=0,this.Xf=null,this.Jf=!DD(),this.Qf=e=>{this.tp(e)},this.ip=e=>{if(this.np(e)){let t=this.sp(e);if(++this.Rf,this.Df&&this.Rf>1){let{ep:n}=this.rp(PD(e),this.If);n<30&&!this.Of&&this.hp(t,this.lp.ap),this.op()}}else{let t=this.sp(e);if(++this.kf,this.Pf&&this.kf>1){let{ep:n}=this.rp(PD(e),this.Tf);n<5&&!this.zf&&this._p(t,this.lp.up),this.cp()}}},this.dp=e,this.lp=t,this.yn=n,this.fp()}m(){this.Nf!==null&&(this.Nf(),this.Nf=null),this.Ff!==null&&(this.Ff(),this.Ff=null),this.Hf!==null&&(this.Hf(),this.Hf=null),this.Uf!==null&&(this.Uf(),this.Uf=null),this.$f!==null&&(this.$f(),this.$f=null),this.Wf!==null&&(this.Wf(),this.Wf=null),this.pp(),this.cp()}vp(e){this.Hf&&this.Hf();let t=this.mp.bind(this);if(this.Hf=()=>{this.dp.removeEventListener(`mousemove`,t)},this.dp.addEventListener(`mousemove`,t),this.np(e))return;let n=this.sp(e);this._p(n,this.lp.wp),this.Jf=!0}cp(){this.Pf!==null&&clearTimeout(this.Pf),this.kf=0,this.Pf=null,this.Tf={_t:-1/0,ut:1/0}}op(){this.Df!==null&&clearTimeout(this.Df),this.Rf=0,this.Df=null,this.If={_t:-1/0,ut:1/0}}mp(e){if(this.Zf||this.Af!==null||this.np(e))return;let t=this.sp(e);this._p(t,this.lp.Mp),this.Jf=!0}gp(e){let t=ID(e.changedTouches,$(this.Xf));if(t===null||(this.Gf=FD(e),this.jf!==null)||this.Kf)return;this.Yf=!0;let{bp:n,Sp:r,ep:i}=this.rp(PD(t),$(this.Af));if(this.Lf||!(i<5)){if(!this.Lf){let e=.5*n,t=r>=e&&!this.yn.xp(),i=e>r&&!this.yn.Cp();t||i||(this.Kf=!0),this.Lf=!0,this.Of=!0,this.pp(),this.op()}if(!this.Kf){let n=this.sp(e,t);this.hp(n,this.lp.yp),ND(e)}}}kp(e){if(e.button!==0)return;let{ep:t}=this.rp(PD(e),$(this.Ef));if(t>=5&&(this.zf=!0,this.cp()),this.zf){let t=this.sp(e);this._p(t,this.lp.Pp)}}rp(e,t){let n=Math.abs(t._t-e._t),r=Math.abs(t.ut-e.ut);return{bp:n,Sp:r,ep:n+r}}Tp(e){let t=ID(e.changedTouches,$(this.Xf));if(t===null&&e.touches.length===0&&(t=e.changedTouches[0]),t===null)return;this.Xf=null,this.Gf=FD(e),this.pp(),this.Af=null,this.$f&&=(this.$f(),null);let n=this.sp(e,t);if(this.hp(n,this.lp.Rp),++this.Rf,this.Df&&this.Rf>1){let{ep:e}=this.rp(PD(t),this.If);e<30&&!this.Of&&this.hp(n,this.lp.ap),this.op()}else this.Of||(this.hp(n,this.lp.Dp),this.lp.Dp&&ND(e));this.Rf===0&&ND(e),e.touches.length===0&&this.Bf&&(this.Bf=!1,ND(e))}tp(e){if(e.button!==0)return;let t=this.sp(e);if(this.Ef=null,this.Zf=!1,this.Uf&&=(this.Uf(),null),ED()&&this.dp.ownerDocument.documentElement.removeEventListener(`mouseleave`,this.Qf),!this.np(e))if(this._p(t,this.lp.Ip),++this.kf,this.Pf&&this.kf>1){let{ep:n}=this.rp(PD(e),this.Tf);n<5&&!this.zf&&this._p(t,this.lp.up),this.cp()}else this.zf||this._p(t,this.lp.Vp)}pp(){this.Vf!==null&&(clearTimeout(this.Vf),this.Vf=null)}Bp(e){if(this.Xf!==null)return;let t=e.changedTouches[0];this.Xf=t.identifier,this.Gf=FD(e);let n=this.dp.ownerDocument.documentElement;this.Of=!1,this.Lf=!1,this.Kf=!1,this.Af=PD(t),this.$f&&=(this.$f(),null);{let t=this.gp.bind(this),r=this.Tp.bind(this);this.$f=()=>{n.removeEventListener(`touchmove`,t),n.removeEventListener(`touchend`,r)},n.addEventListener(`touchmove`,t,{passive:!1}),n.addEventListener(`touchend`,r,{passive:!1}),this.pp(),this.Vf=setTimeout(this.Ep.bind(this,e),240)}let r=this.sp(e,t);this.hp(r,this.lp.Ap),this.Df||(this.Rf=0,this.Df=setTimeout(this.op.bind(this),500),this.If=PD(t))}Lp(e){if(e.button!==0)return;let t=this.dp.ownerDocument.documentElement;ED()&&t.addEventListener(`mouseleave`,this.Qf),this.zf=!1,this.Ef=PD(e),this.Uf&&=(this.Uf(),null);{let e=this.kp.bind(this),n=this.tp.bind(this);this.Uf=()=>{t.removeEventListener(`mousemove`,e),t.removeEventListener(`mouseup`,n)},t.addEventListener(`mousemove`,e),t.addEventListener(`mouseup`,n)}if(this.Zf=!0,this.np(e))return;let n=this.sp(e);this._p(n,this.lp.zp),this.Pf||(this.kf=0,this.Pf=setTimeout(this.cp.bind(this),500),this.Tf=PD(e))}fp(){this.dp.addEventListener(`mouseenter`,this.vp.bind(this)),this.dp.addEventListener(`touchcancel`,this.pp.bind(this));{let e=this.dp.ownerDocument,t=e=>{this.lp.Op&&(e.composed&&this.dp.contains(e.composedPath()[0])||e.target&&this.dp.contains(e.target)||this.lp.Op())};this.Ff=()=>{e.removeEventListener(`touchstart`,t)},this.Nf=()=>{e.removeEventListener(`mousedown`,t)},e.addEventListener(`mousedown`,t),e.addEventListener(`touchstart`,t,{passive:!0})}DD()&&(this.Wf=()=>{this.dp.removeEventListener(`dblclick`,this.ip)},this.dp.addEventListener(`dblclick`,this.ip)),this.dp.addEventListener(`mouseleave`,this.Np.bind(this)),this.dp.addEventListener(`touchstart`,this.Bp.bind(this),{passive:!0}),AD(this.dp),this.dp.addEventListener(`mousedown`,this.Lp.bind(this)),this.Fp(),this.dp.addEventListener(`touchmove`,(()=>{}),{passive:!1})}Fp(){this.lp.Wp===void 0&&this.lp.Hp===void 0&&this.lp.Up===void 0||(this.dp.addEventListener(`touchstart`,(e=>this.$p(e.touches)),{passive:!0}),this.dp.addEventListener(`touchmove`,(e=>{if(e.touches.length===2&&this.jf!==null&&this.lp.Hp!==void 0){let t=MD(e.touches[0],e.touches[1])/this.qf;this.lp.Hp(this.jf,t),ND(e)}}),{passive:!1}),this.dp.addEventListener(`touchend`,(e=>{this.$p(e.touches)})))}$p(e){e.length===1&&(this.Yf=!1),e.length!==2||this.Yf||this.Bf?this.jp():this.qp(e)}qp(e){let t=this.dp.getBoundingClientRect()||{left:0,top:0};this.jf={_t:(e[0].clientX-t.left+(e[1].clientX-t.left))/2,ut:(e[0].clientY-t.top+(e[1].clientY-t.top))/2},this.qf=MD(e[0],e[1]),this.lp.Wp!==void 0&&this.lp.Wp(),this.pp()}jp(){this.jf!==null&&(this.jf=null,this.lp.Up!==void 0&&this.lp.Up())}Np(e){if(this.Hf&&this.Hf(),this.np(e)||!this.Jf)return;let t=this.sp(e);this._p(t,this.lp.Yp),this.Jf=!DD()}Ep(e){let t=ID(e.touches,$(this.Xf));if(t===null)return;let n=this.sp(e,t);this.hp(n,this.lp.Kp),this.Of=!0,this.Bf=!0}np(e){return e.sourceCapabilities&&e.sourceCapabilities.firesTouchEvents!==void 0?e.sourceCapabilities.firesTouchEvents:FD(e)<this.Gf+500}hp(e,t){t&&t.call(this.lp,e)}_p(e,t){t&&t.call(this.lp,e)}sp(e,t){let n=t||e,r=this.dp.getBoundingClientRect()||{left:0,top:0};return{clientX:n.clientX,clientY:n.clientY,pageX:n.pageX,pageY:n.pageY,screenX:n.screenX,screenY:n.screenY,localX:n.clientX-r.left,localY:n.clientY-r.top,ctrlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey,metaKey:e.metaKey,Zp:!e.type.startsWith(`mouse`)&&e.type!==`contextmenu`&&e.type!==`click`,Gp:e.type,Xp:n.target,gu:e.view,Jp:()=>{e.type!==`touchstart`&&ND(e)}}}};function MD(e,t){let n=e.clientX-t.clientX,r=e.clientY-t.clientY;return Math.sqrt(n*n+r*r)}function ND(e){e.cancelable&&e.preventDefault()}function PD(e){return{_t:e.pageX,ut:e.pageY}}function FD(e){return e.timeStamp||performance.now()}function ID(e,t){for(let n=0;n<e.length;++n)if(e[n].identifier===t)return e[n];return null}var LD=class{constructor(e,t,n){this.Qp=null,this.tv=null,this.iv=!0,this.nv=null,this.sv=e,this.ev=e.rv()[t],this.hv=e.rv()[n],this.av=document.createElement(`tr`),this.av.style.height=`1px`,this.lv=document.createElement(`td`),this.lv.style.position=`relative`,this.lv.style.padding=`0`,this.lv.style.margin=`0`,this.lv.setAttribute(`colspan`,`3`),this.ov(),this.av.appendChild(this.lv),this.iv=this.sv.N().layout.panes.enableResize,this.iv?this._v():(this.Qp=null,this.tv=null)}m(){this.tv!==null&&this.tv.m()}uv(){return this.av}cv(){return Q({width:this.ev.cv().width,height:1})}dv(){return Q({width:this.ev.dv().width,height:1*window.devicePixelRatio})}fv(e,t,n){let r=this.dv();e.fillStyle=this.sv.N().layout.panes.separatorColor,e.fillRect(t,n,r.width,r.height)}kt(){this.ov(),this.sv.N().layout.panes.enableResize!==this.iv&&(this.iv=this.sv.N().layout.panes.enableResize,this.iv?this._v():(this.Qp!==null&&(this.lv.removeChild(this.Qp.pv),this.lv.removeChild(this.Qp.vv),this.Qp=null),this.tv!==null&&(this.tv.m(),this.tv=null)))}_v(){let e=document.createElement(`div`),t=e.style;t.position=`fixed`,t.display=`none`,t.zIndex=`49`,t.top=`0`,t.left=`0`,t.width=`100%`,t.height=`100%`,t.cursor=`row-resize`,this.lv.appendChild(e);let n=document.createElement(`div`),r=n.style;r.position=`absolute`,r.zIndex=`50`,r.top=`-4px`,r.height=`9px`,r.width=`100%`,r.backgroundColor=``,r.cursor=`row-resize`,this.lv.appendChild(n);let i={wp:this.mv.bind(this),Yp:this.wv.bind(this),zp:this.Mv.bind(this),Ap:this.Mv.bind(this),Pp:this.gv.bind(this),yp:this.gv.bind(this),Ip:this.bv.bind(this),Rp:this.bv.bind(this)};this.tv=new jD(n,i,{xp:()=>!1,Cp:()=>!0}),this.Qp={vv:n,pv:e}}ov(){this.lv.style.background=this.sv.N().layout.panes.separatorColor}mv(e){this.Qp!==null&&(this.Qp.vv.style.backgroundColor=this.sv.N().layout.panes.separatorHoverColor)}wv(e){this.Qp!==null&&this.nv===null&&(this.Qp.vv.style.backgroundColor=``)}Mv(e){if(this.Qp===null)return;let t=this.ev.Sv().z_()+this.hv.Sv().z_(),n=t/(this.ev.cv().height+this.hv.cv().height),r=30*n;t<=2*r||(this.nv={xv:e.pageY,Cv:this.ev.Sv().z_(),yv:t-r,kv:t,Pv:n,Tv:r},this.Qp.pv.style.display=`block`)}gv(e){let t=this.nv;if(t===null)return;let n=(e.pageY-t.xv)*t.Pv,r=gE(t.Cv+n,t.Tv,t.yv);this.ev.Sv().O_(r),this.hv.Sv().O_(t.kv-r),this.sv.Qt().Pa()}bv(e){this.nv!==null&&this.Qp!==null&&(this.nv=null,this.Qp.pv.style.display=`none`)}};function RD(e,t){return e.Rv-t.Rv}function zD(e,t,n){let r=(e.Rv-t.Rv)/(e.wt-t.wt);return Math.sign(r)*Math.min(Math.abs(r),n)}var BD=class{constructor(e,t,n,r){this.Dv=null,this.Iv=null,this.Vv=null,this.Bv=null,this.Ev=null,this.Av=0,this.Lv=0,this.zv=e,this.Ov=t,this.Nv=n,this.ks=r}Fv(e,t){if(this.Dv!==null){if(this.Dv.wt===t)return void(this.Dv.Rv=e);if(Math.abs(this.Dv.Rv-e)<this.ks)return}this.Bv=this.Vv,this.Vv=this.Iv,this.Iv=this.Dv,this.Dv={wt:t,Rv:e}}me(e,t){if(this.Dv===null||this.Iv===null||t-this.Dv.wt>50)return;let n=0,r=zD(this.Dv,this.Iv,this.Ov),i=RD(this.Dv,this.Iv),a=[r],o=[i];if(n+=i,this.Vv!==null){let e=zD(this.Iv,this.Vv,this.Ov);if(Math.sign(e)===Math.sign(r)){let t=RD(this.Iv,this.Vv);if(a.push(e),o.push(t),n+=t,this.Bv!==null){let e=zD(this.Vv,this.Bv,this.Ov);if(Math.sign(e)===Math.sign(r)){let t=RD(this.Vv,this.Bv);a.push(e),o.push(t),n+=t}}}}let s=0;for(let e=0;e<a.length;++e)s+=o[e]/n*a[e];Math.abs(s)<this.zv||(this.Ev={Rv:e,wt:t},this.Lv=s,this.Av=function(e,t){let n=Math.log(t);return Math.log(1*n/-e)/n}(Math.abs(s),this.Nv))}qc(e){let t=$(this.Ev),n=e-t.wt;return t.Rv+this.Lv*(this.Nv**+n-1)/Math.log(this.Nv)}jc(e){return this.Ev===null||this.Wv(e)===this.Av}Wv(e){let t=e-$(this.Ev).wt;return Math.min(t,this.Av)}},VD=class{constructor(e,t){this.Hv=void 0,this.Uv=void 0,this.$v=void 0,this.vn=!1,this.jv=e,this.qv=t,this.Yv()}kt(){this.Yv()}Kv(){this.Hv&&this.jv.removeChild(this.Hv),this.Uv&&this.jv.removeChild(this.Uv),this.Hv=void 0,this.Uv=void 0}Zv(){return this.vn!==this.Gv()||this.$v!==this.Xv()}Xv(){return this.qv.Qt().Xi().J(this.qv.N().layout.textColor)>160?`dark`:`light`}Gv(){return this.qv.N().layout.attributionLogo}Jv(){let e=new URL(location.href);return e.hostname?`&utm_source=`+e.hostname+e.pathname:``}Yv(){this.Zv()&&(this.Kv(),this.vn=this.Gv(),this.vn&&(this.$v=this.Xv(),this.Uv=document.createElement(`style`),this.Uv.innerText=`a#tv-attr-logo{--fill:#131722;--stroke:#fff;position:absolute;left:10px;bottom:10px;height:19px;width:35px;margin:0;padding:0;border:0;z-index:3;}a#tv-attr-logo[data-dark]{--fill:#D1D4DC;--stroke:#131722;}`,this.Hv=document.createElement(`a`),this.Hv.href=`https://www.tradingview.com/?utm_medium=lwc-link&utm_campaign=lwc-chart${this.Jv()}`,this.Hv.title=`Charting by TradingView`,this.Hv.id=`tv-attr-logo`,this.Hv.target=`_blank`,this.Hv.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" width="35" height="19" fill="none"><g fill-rule="evenodd" clip-path="url(#a)" clip-rule="evenodd"><path fill="var(--stroke)" d="M2 0H0v10h6v9h21.4l.5-1.3 6-15 1-2.7H23.7l-.5 1.3-.2.6a5 5 0 0 0-7-.9V0H2Zm20 17h4l5.2-13 .8-2h-7l-1 2.5-.2.5-1.5 3.8-.3.7V17Zm-.8-10a3 3 0 0 0 .7-2.7A3 3 0 1 0 16.8 7h4.4ZM14 7V2H2v6h6v9h4V7h2Z"/><path fill="var(--fill)" d="M14 2H2v6h6v9h6V2Zm12 15h-7l6-15h7l-6 15Zm-7-9a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"/></g><defs><clipPath id="a"><path fill="var(--stroke)" d="M0 0h35v19H0z"/></clipPath></defs></svg>`,this.Hv.toggleAttribute(`data-dark`,this.$v===`dark`),this.jv.appendChild(this.Uv),this.jv.appendChild(this.Hv)))}};function HD(e,t){let n=$(e.ownerDocument).createElement(`canvas`);e.appendChild(n);let r=pw(n,{type:`device-pixel-content-box`,options:{allowResizeObserver:!0},transform:(e,t)=>({width:Math.max(e.width,t.width),height:Math.max(e.height,t.height)})});return r.resizeCanvasElement(t),r}function UD(e){e.width=1,e.height=1,e.getContext(`2d`)?.clearRect(0,0,1,1)}function WD(e,t,n,r){e.qh&&e.qh(t,n,r)}function GD(e,t,n,r){e.st(t,n,r)}function KD(e,t,n,r){let i=e(n,r);for(let e of i){let n=e.Tt(r);n!==null&&t(n)}}function qD(e,t){return n=>function(e){return e.Ft!==void 0}(n)&&(n.Ft()?.cl()??``)===t?n.Ga?.(e)??[]:[]}function JD(e,t,n,r){if(!e.length)return;let i=0,a=e[0].$t(r,!0),o=t===1?n/2-(e[0].Hi()-a/2):e[0].Hi()-a/2-n/2;o=Math.max(0,o);for(let a=1;a<e.length;a++){let s=e[a],c=e[a-1],l=c.$t(r,!1),u=s.Hi(),d=c.Hi();if(t===1?u>d-l:u<d+l){let r=d-l*t;s.Ui(r);let a=r-t*l/2;if((t===1?a<0:a>n)&&o>0){let r=t===1?-1-a:a-n,s=Math.min(r,o);for(let n=i;n<e.length;n++)e[n].Ui(e[n].Hi()+t*s);o-=s}}else i=a,o=t===1?d-l-u:u-(d+l)}}var YD=class{constructor(e,t,n,r){this.Ki=null,this.Qv=null,this.tm=!1,this.im=new yT(200),this.nm=null,this.sm=0,this.rm=!1,this.hm=()=>{this.rm||this.yt.am().Qt().mr()},this.lm=()=>{this.rm||this.yt.am().Qt().mr()},this.yt=e,this.yn=t,this.ko=t.layout,this.wd=n,this.om=r===`left`,this._m=qD(`normal`,r),this.um=qD(`top`,r),this.dm=qD(`bottom`,r),this.lv=document.createElement(`div`),this.lv.style.height=`100%`,this.lv.style.overflow=`hidden`,this.lv.style.width=`25px`,this.lv.style.left=`0`,this.lv.style.position=`relative`,this.fm=HD(this.lv,Q({width:16,height:16})),this.fm.subscribeSuggestedBitmapSizeChanged(this.hm);let i=this.fm.canvasElement;i.style.position=`absolute`,i.style.zIndex=`1`,i.style.left=`0`,i.style.top=`0`,this.pm=HD(this.lv,Q({width:16,height:16})),this.pm.subscribeSuggestedBitmapSizeChanged(this.lm);let a=this.pm.canvasElement;a.style.position=`absolute`,a.style.zIndex=`2`,a.style.left=`0`,a.style.top=`0`;let o={zp:this.Mv.bind(this),Ap:this.Mv.bind(this),Pp:this.gv.bind(this),yp:this.gv.bind(this),Op:this.vm.bind(this),Ip:this.bv.bind(this),Rp:this.bv.bind(this),up:this.wm.bind(this),ap:this.wm.bind(this),wp:this.Mm.bind(this),Yp:this.wv.bind(this)};this.tv=new jD(this.pm.canvasElement,o,{xp:()=>!this.yn.handleScroll.vertTouchDrag,Cp:()=>!0})}m(){this.tv.m(),this.pm.unsubscribeSuggestedBitmapSizeChanged(this.lm),UD(this.pm.canvasElement),this.pm.dispose(),this.fm.unsubscribeSuggestedBitmapSizeChanged(this.hm),UD(this.fm.canvasElement),this.fm.dispose(),this.Ki!==null&&this.Ki.a_().u(this),this.Ki=null}uv(){return this.lv}k(){return this.ko.fontSize}gm(){let e=this.wd.N();return this.nm!==e.P&&(this.im.Os(),this.nm=e.P),e}bm(){if(this.Ki===null)return 0;let e=0,t=this.gm(),n=$(this.fm.canvasElement.getContext(`2d`,{colorSpace:this.yt.am().N().layout.colorSpace}));n.save();let r=this.Ki.El();n.font=this.Sm(),r.length>0&&(e=Math.max(this.im.Ii(n,r[0].io),this.im.Ii(n,r[r.length-1].io)));let i=this.xm();for(let t=i.length;t--;){let r=this.im.Ii(n,i[t].ri());r>e&&(e=r)}let a=this.Ki.Lt();if(a!==null&&this.Qv!==null&&(o=this.yn.crosshair).mode!==2&&o.horzLine.visible&&o.horzLine.labelVisible){let t=this.Ki.Tn(1,a),r=this.Ki.Tn(this.Qv.height-2,a);e=Math.max(e,this.im.Ii(n,this.Ki.Ji(Math.floor(Math.min(t,r))+.11111111111111,a)),this.im.Ii(n,this.Ki.Ji(Math.ceil(Math.max(t,r))-.11111111111111,a)))}var o;n.restore();let s=e||34;return kD(Math.ceil(t.S+t.C+t.V+t.B+5+s))}Cm(e){this.Qv!==null&&lw(this.Qv,e)||(this.Qv=e,this.rm=!0,this.fm.resizeCanvasElement(e),this.pm.resizeCanvasElement(e),this.rm=!1,this.lv.style.width=`${e.width}px`,this.lv.style.height=`${e.height}px`)}ym(){return $(this.Qv).width}un(e){this.Ki!==e&&(this.Ki!==null&&this.Ki.a_().u(this),this.Ki=e,e.a_().i(this.po.bind(this),this))}Ft(){return this.Ki}Os(){let e=this.yt.Sv();this.yt.am().Qt().eu(e,$(this.Ft()))}km(e){if(this.Qv===null)return;let t={colorSpace:this.yt.am().N().layout.colorSpace};if(e!==1){this.Pm(),this.fm.applySuggestedBitmapSize();let e=vw(this.fm,t);e!==null&&(e.useBitmapCoordinateSpace((e=>{this.Tm(e),this.Rm(e)})),this.yt.Dm(e,this.dm),this.Im(e),this.yt.Dm(e,this._m),this.Vm(e))}this.pm.applySuggestedBitmapSize();let n=vw(this.pm,t);n!==null&&(n.useBitmapCoordinateSpace((({context:e,bitmapSize:t})=>{e.clearRect(0,0,t.width,t.height)})),this.Bm(n),this.yt.Dm(n,this.um))}dv(){return this.fm.bitmapSize}fv(e,t,n,r){let i=this.dv();if(i.width>0&&i.height>0&&(e.drawImage(this.fm.canvasElement,t,n),r)){let r=this.pm.canvasElement;e.drawImage(r,t,n)}}kt(){this.Ki?.El()}Mv(e){if(this.Ki===null||this.Ki.Gi()||!this.yn.handleScale.axisPressedMouseMove.price)return;let t=this.yt.am().Qt(),n=this.yt.Sv();this.tm=!0,t.G_(n,this.Ki,e.localY)}gv(e){if(this.Ki===null||!this.yn.handleScale.axisPressedMouseMove.price)return;let t=this.yt.am().Qt(),n=this.yt.Sv(),r=this.Ki;t.X_(n,r,e.localY)}vm(){if(this.Ki===null||!this.yn.handleScale.axisPressedMouseMove.price)return;let e=this.yt.am().Qt(),t=this.yt.Sv(),n=this.Ki;this.tm&&(this.tm=!1,e.J_(t,n))}bv(e){if(this.Ki===null||!this.yn.handleScale.axisPressedMouseMove.price)return;let t=this.yt.am().Qt(),n=this.yt.Sv();this.tm=!1,t.J_(n,this.Ki)}wm(e){this.yn.handleScale.axisDoubleClickReset.price&&this.Os()}Mm(e){this.Ki!==null&&(!this.yt.am().Qt().N().handleScale.axisPressedMouseMove.price||this.Ki.je()||this.Ki.Lo()||this.Em(1))}wv(e){this.Em(0)}xm(){let e=[],t=this.Ki===null?void 0:this.Ki;return(n=>{for(let r=0;r<n.length;++r){let i=n[r].qn(this.yt.Sv(),t);for(let t=0;t<i.length;t++)e.push(i[t])}})(this.yt.Sv().Dt()),e}Tm({context:e,bitmapSize:t}){let{width:n,height:r}=t,i=this.yt.Sv().Qt(),a=i.$(),o=i.ef();a===o?Zw(e,0,0,n,r,a):eT(e,0,0,n,r,a,o)}Rm({context:e,bitmapSize:t,horizontalPixelRatio:n}){if(this.Qv===null||this.Ki===null||!this.Ki.N().borderVisible)return;e.fillStyle=this.Ki.N().borderColor;let r=Math.max(1,Math.floor(this.gm().S*n)),i;i=this.om?t.width-r:0,e.fillRect(i,0,r,t.height)}Im(e){if(this.Qv===null||this.Ki===null)return;let t=this.Ki.El(),n=this.Ki.N(),r=this.gm(),i=this.om?this.Qv.width-r.C:0;n.borderVisible&&n.ticksVisible&&e.useBitmapCoordinateSpace((({context:e,horizontalPixelRatio:a,verticalPixelRatio:o})=>{e.fillStyle=n.borderColor;let s=Math.max(1,Math.floor(o)),c=Math.floor(.5*o),l=Math.round(r.C*a);e.beginPath();for(let n of t)e.rect(Math.floor(i*a),Math.round(n.Rl*o)-c,l,s);e.fill()})),e.useMediaCoordinateSpace((({context:e})=>{e.font=this.Sm(),e.fillStyle=n.textColor??this.ko.textColor,e.textAlign=this.om?`right`:`left`,e.textBaseline=`middle`;let a=this.om?Math.round(i-r.V):Math.round(i+r.C+r.V),o=t.map((t=>this.im.Di(e,t.io)));for(let n=t.length;n--;){let r=t[n];e.fillText(r.io,a,r.Rl+o[n])}}))}Pm(){if(this.Qv===null||this.Ki===null)return;let e=this.Qv.height/2,t=[],n=this.Ki.Dt().slice(),r=this.yt.Sv(),i=this.gm();this.Ki===r.Gs()&&this.yt.Sv().Dt().forEach((e=>{r.Zs(e)&&n.push(e)}));let a=this.Ki.Cl()[0],o=this.Ki;n.forEach((n=>{let i=n.qn(r,o);i.forEach((e=>{e.$i()&&e.Wi()===null&&(e.Ui(null),t.push(e))})),a===n&&i.length>0&&(e=i[0].Ei())})),this.Ki.N().alignLabels&&this.Am(t,i,e)}Am(e,t,n){if(this.Qv===null)return;let r=e.filter((e=>e.Ei()<=n)),i=e.filter((e=>e.Ei()>n));r.sort(((e,t)=>t.Ei()-e.Ei())),r.length&&i.length&&i.push(r[0]),i.sort(((e,t)=>e.Ei()-t.Ei()));for(let n of e){let e=Math.floor(n.$t(t)/2),r=n.Ei();r>-e&&r<e&&n.Ui(e),r>this.Qv.height-e&&r<this.Qv.height+e&&n.Ui(this.Qv.height-e)}JD(r,1,this.Qv.height,t),JD(i,-1,this.Qv.height,t)}Vm(e){if(this.Qv===null)return;let t=this.xm(),n=this.gm(),r=this.om?`right`:`left`;t.forEach((t=>{t.ji()&&t.Tt($(this.Ki)).st(e,n,this.im,r)}))}Bm(e){if(this.Qv===null||this.Ki===null)return;let t=this.yt.am().Qt(),n=[],r=this.yt.Sv(),i=t.Rd().qn(r,this.Ki);i.length&&n.push(i);let a=this.gm(),o=this.om?`right`:`left`;n.forEach((t=>{t.forEach((t=>{t.Tt($(this.Ki)).st(e,a,this.im,o)}))}))}Em(e){this.lv.style.cursor=e===1?`ns-resize`:`default`}po(){let e=this.bm();this.sm<e&&this.yt.am().Qt().Pa(),this.sm=e}Sm(){return Lw(this.ko.fontSize,this.ko.fontFamily)}};function XD(e,t){return e.Ka?.(t)??[]}function ZD(e,t){return e.jn?.(t)??[]}function QD(e,t){return e.cn?.(t)??[]}function $D(e,t){return e.ja?.(t)??[]}var eO=class e{constructor(e,t){this.Qv=Q({width:0,height:0}),this.Lm=null,this.zm=null,this.Om=null,this.Nm=null,this.Fm=!1,this.Wm=new Dw,this.Hm=new Dw,this.Um=0,this.$m=!1,this.jm=null,this.qm=!1,this.Ym=null,this.Km=null,this.rm=!1,this.hm=()=>{this.rm||this.Zm===null||this.sn().mr()},this.lm=()=>{this.rm||this.Zm===null||this.sn().mr()},this.qv=e,this.Zm=t,this.Zm.fu().i(this.Gm.bind(this),this,!0),this.Xm=document.createElement(`td`),this.Xm.style.padding=`0`,this.Xm.style.position=`relative`;let n=document.createElement(`div`);n.style.width=`100%`,n.style.height=`100%`,n.style.position=`relative`,n.style.overflow=`hidden`,this.Jm=document.createElement(`td`),this.Jm.style.padding=`0`,this.Qm=document.createElement(`td`),this.Qm.style.padding=`0`,this.Xm.appendChild(n),this.fm=HD(n,Q({width:16,height:16})),this.fm.subscribeSuggestedBitmapSizeChanged(this.hm);let r=this.fm.canvasElement;r.style.position=`absolute`,r.style.zIndex=`1`,r.style.left=`0`,r.style.top=`0`,this.pm=HD(n,Q({width:16,height:16})),this.pm.subscribeSuggestedBitmapSizeChanged(this.lm);let i=this.pm.canvasElement;i.style.position=`absolute`,i.style.zIndex=`2`,i.style.left=`0`,i.style.top=`0`,this.av=document.createElement(`tr`),this.av.appendChild(this.Jm),this.av.appendChild(this.Xm),this.av.appendChild(this.Qm),this.tw(),this.tv=new jD(this.pm.canvasElement,this,{xp:()=>this.jm===null&&!this.qv.N().handleScroll.vertTouchDrag,Cp:()=>this.jm===null&&!this.qv.N().handleScroll.horzTouchDrag})}m(){this.Lm!==null&&this.Lm.m(),this.zm!==null&&this.zm.m(),this.Om=null,this.pm.unsubscribeSuggestedBitmapSizeChanged(this.lm),UD(this.pm.canvasElement),this.pm.dispose(),this.fm.unsubscribeSuggestedBitmapSizeChanged(this.hm),UD(this.fm.canvasElement),this.fm.dispose(),this.Zm!==null&&(this.Zm.fu().u(this),this.Zm.m()),this.tv.m()}Sv(){return $(this.Zm)}iw(t){this.Zm!==null&&this.Zm.fu().u(this),this.Zm=t,this.Zm!==null&&this.Zm.fu().i(e.prototype.Gm.bind(this),this,!0),this.tw(),this.qv.rv().indexOf(this)===this.qv.rv().length-1?(this.Om=this.Om??new VD(this.Xm,this.qv),this.Om.kt()):(this.Om?.Kv(),this.Om=null)}am(){return this.qv}uv(){return this.av}tw(){if(this.Zm!==null&&(this.nw(),this.sn().Jn().length!==0)){if(this.Lm!==null){let e=this.Zm.K_();this.Lm.un($(e))}if(this.zm!==null){let e=this.Zm.Z_();this.zm.un($(e))}}}sw(){this.Lm!==null&&this.Lm.kt(),this.zm!==null&&this.zm.kt()}z_(){return this.Zm===null?0:this.Zm.z_()}O_(e){this.Zm&&this.Zm.O_(e)}wp(e){if(!this.Zm)return;this.ew();let t=e.localX,n=e.localY;this.rw(t,n,e)}zp(e){this.ew(),this.hw(),this.rw(e.localX,e.localY,e)}Mp(e){if(!this.Zm)return;this.ew();let t=e.localX,n=e.localY;this.rw(t,n,e)}Vp(e){this.Zm!==null&&(this.ew(),this.rw(e.localX,e.localY,e),this.aw(e))}up(e){this.Zm!==null&&this.lw(this.Hm,e)}ap(e){this.up(e)}Pp(e){this.ew(),this.ow(e),this.rw(e.localX,e.localY,e)}Ip(e){this.Zm!==null&&(this.ew(),this.$m=!1,this._w(e))}Dp(e){this.Zm!==null&&this.aw(e)}Kp(e){if(this.$m=!0,this.jm===null){let t={x:e.localX,y:e.localY};this.uw(t,t,e)}}Yp(e){this.Zm!==null&&(this.ew(),this.Zm.Qt().kd(null),this.cw())}dw(){return this.Wm}fw(){return this.Hm}Wp(){this.Um=1,this.sn().cs()}Hp(e,t){if(!this.qv.N().handleScale.pinch)return;let n=5*(t-this.Um);this.Um=t,this.sn().Od(e._t,n)}Ap(e){this.$m=!1,this.qm=this.jm!==null,this.hw();let t=this.sn().Rd();this.jm!==null&&t.It()&&(this.Ym={x:t.ni(),y:t.si()},this.jm={x:e.localX,y:e.localY})}yp(e){if(this.Zm===null)return;let t=e.localX,n=e.localY;if(this.jm===null)this.ow(e);else{this.qm=!1;let r=$(this.Ym),i=r.x+(t-this.jm.x),a=r.y+(n-this.jm.y);this.rw(i,a,e)}}Rp(e){this.am().N().trackingMode.exitMode===0&&(this.qm=!0),this.pw(),this._w(e)}Qs(e,t){let n=this.Zm;return n===null?null:KE(n,e,t)}mw(e,t){$(t===`left`?this.Lm:this.zm).Cm(Q({width:e,height:this.Qv.height}))}cv(){return this.Qv}Cm(e){lw(this.Qv,e)||(this.Qv=e,this.rm=!0,this.fm.resizeCanvasElement(e),this.pm.resizeCanvasElement(e),this.rm=!1,this.Xm.style.width=e.width+`px`,this.Xm.style.height=e.height+`px`)}ww(){let e=$(this.Zm);e.q_(e.K_()),e.q_(e.Z_());for(let t of e.Cl())if(e.Zs(t)){let n=t.Ft();n!==null&&e.q_(n),t.Nn()}for(let t of e.vu())t.Nn()}dv(){return this.fm.bitmapSize}fv(e,t,n,r){let i=this.dv();if(i.width>0&&i.height>0&&(e.drawImage(this.fm.canvasElement,t,n),r)){let r=this.pm.canvasElement;e!==null&&e.drawImage(r,t,n)}}km(e){if(e===0||this.Zm===null)return;e>1&&this.ww(),this.Lm!==null&&this.Lm.km(e),this.zm!==null&&this.zm.km(e);let t={colorSpace:this.qv.N().layout.colorSpace};if(e!==1){this.fm.applySuggestedBitmapSize();let e=vw(this.fm,t);e!==null&&(e.useBitmapCoordinateSpace((e=>{this.Tm(e)})),this.Zm&&(this.Mw(e,XD),this.gw(e),this.Mw(e,ZD),this.Mw(e,QD)))}this.pm.applySuggestedBitmapSize();let n=vw(this.pm,t);n!==null&&(n.useBitmapCoordinateSpace((({context:e,bitmapSize:t})=>{e.clearRect(0,0,t.width,t.height)})),this.bw(n),this.Mw(n,$D),this.Mw(n,QD))}Sw(){return this.Lm}xw(){return this.zm}Dm(e,t){this.Mw(e,t)}Gm(){this.Zm!==null&&this.Zm.fu().u(this),this.Zm=null}aw(e){this.lw(this.Wm,e)}lw(e,t){let n=t.localX,r=t.localY;e.v()&&e.p(this.sn().Et().Rc(n),{x:n,y:r},t)}Tm({context:e,bitmapSize:t}){let{width:n,height:r}=t,i=this.sn(),a=i.$(),o=i.ef();a===o?Zw(e,0,0,n,r,o):eT(e,0,0,n,r,a,o)}gw(e){let t=$(this.Zm),n=t.pu().wr().Tt(t);n!==null&&n.st(e,!1)}bw(e){this.Cw(e,ZD,GD,this.sn().Rd())}Mw(e,t){let n=$(this.Zm),r=n.au(),i=n.vu();for(let n of i)this.Cw(e,t,WD,n);for(let n of r)this.Cw(e,t,WD,n);for(let n of i)this.Cw(e,t,GD,n);for(let n of r)this.Cw(e,t,GD,n)}Cw(e,t,n,r){let i=$(this.Zm),a=i.Qt().ou(),o=a!==null&&a.lu===r,s=a!==null&&o&&a.wu!==void 0?a.wu.ie:void 0;KD(t,(t=>n(t,e,o,s)),r,i)}nw(){if(this.Zm===null)return;let e=this.qv,t=this.Zm.K_().N().visible,n=this.Zm.Z_().N().visible;t||this.Lm===null||(this.Jm.removeChild(this.Lm.uv()),this.Lm.m(),this.Lm=null),n||this.zm===null||(this.Qm.removeChild(this.zm.uv()),this.zm.m(),this.zm=null);let r=e.Qt().Zd();t&&this.Lm===null&&(this.Lm=new YD(this,e.N(),r,`left`),this.Jm.appendChild(this.Lm.uv())),n&&this.zm===null&&(this.zm=new YD(this,e.N(),r,`right`),this.Qm.appendChild(this.zm.uv()))}yw(e){return e.Zp&&this.$m||this.jm!==null}rw(e,t,n){e=Math.max(0,Math.min(e,this.Qv.width-1)),t=Math.max(0,Math.min(t,this.Qv.height-1)),this.sn().jd(e,t,n,$(this.Zm))}cw(){this.sn().Yd()}pw(){this.qm&&(this.jm=null,this.cw())}uw(e,t,n){this.jm=e,this.qm=!1,this.rw(t.x,t.y,n);let r=this.sn().Rd();this.Ym={x:r.ni(),y:r.si()}}sn(){return this.qv.Qt()}_w(e){if(!this.Fm)return;let t=this.sn(),n=this.Sv();if(t.iu(n,n.Pn()),this.Nm=null,this.Fm=!1,t.Hd(),this.Km!==null){let e=performance.now(),n=t.Et();this.Km.me(n.Ac(),e),this.Km.jc(e)||t.ps(this.Km)}}ew(){this.jm=null}hw(){if(this.Zm){if(this.sn().cs(),document.activeElement!==document.body&&document.activeElement!==document.documentElement)$(document.activeElement).blur();else{let e=document.getSelection();e!==null&&e.removeAllRanges()}!this.Zm.Pn().Gi()&&this.sn().Et().Gi()}}ow(e){if(this.Zm===null)return;let t=this.sn(),n=t.Et();if(n.Gi())return;let r=this.qv.N(),i=r.handleScroll,a=r.kineticScroll;if((!i.pressedMouseMove||e.Zp)&&(!i.horzTouchDrag&&!i.vertTouchDrag||!e.Zp))return;let o=this.Zm.Pn(),s=performance.now();if(this.Nm!==null||this.yw(e)||(this.Nm={x:e.clientX,y:e.clientY,Sf:s,kw:e.localX,Pw:e.localY}),this.Nm!==null&&!this.Fm&&(this.Nm.x!==e.clientX||this.Nm.y!==e.clientY)){if(e.Zp&&a.touch||!e.Zp&&a.mouse){let e=n.fl();this.Km=new BD(.2/e,7/e,.997,15/e),this.Km.Fv(n.Ac(),this.Nm.Sf)}else this.Km=null;o.Gi()||t.Q_(this.Zm,o,e.localY),t.Fd(e.localX),this.Fm=!0}this.Fm&&(o.Gi()||t.tu(this.Zm,o,e.localY),t.Wd(e.localX),this.Km!==null&&this.Km.Fv(n.Ac(),s))}},tO=class{constructor(e,t,n,r,i){this.xt=!0,this.Qv=Q({width:0,height:0}),this.hm=()=>this.km(3),this.om=e===`left`,this.wd=n.Zd,this.yn=t,this.Tw=r,this.Rw=i,this.lv=document.createElement(`div`),this.lv.style.width=`25px`,this.lv.style.height=`100%`,this.lv.style.overflow=`hidden`,this.fm=HD(this.lv,Q({width:16,height:16})),this.fm.subscribeSuggestedBitmapSizeChanged(this.hm)}m(){this.fm.unsubscribeSuggestedBitmapSizeChanged(this.hm),UD(this.fm.canvasElement),this.fm.dispose()}uv(){return this.lv}cv(){return this.Qv}Cm(e){lw(this.Qv,e)||(this.Qv=e,this.fm.resizeCanvasElement(e),this.lv.style.width=`${e.width}px`,this.lv.style.height=`${e.height}px`,this.xt=!0)}km(e){if(e<3&&!this.xt||this.Qv.width===0||this.Qv.height===0)return;this.xt=!1,this.fm.applySuggestedBitmapSize();let t=vw(this.fm,{colorSpace:this.yn.layout.colorSpace});t!==null&&t.useBitmapCoordinateSpace((e=>{this.Tm(e),this.Rm(e)}))}dv(){return this.fm.bitmapSize}fv(e,t,n){let r=this.dv();r.width>0&&r.height>0&&e.drawImage(this.fm.canvasElement,t,n)}Rm({context:e,bitmapSize:t,horizontalPixelRatio:n,verticalPixelRatio:r}){if(!this.Tw())return;e.fillStyle=this.yn.timeScale.borderColor;let i=Math.floor(this.wd.N().S*n),a=Math.floor(this.wd.N().S*r),o=this.om?t.width-i:0;e.fillRect(o,0,i,a)}Tm({context:e,bitmapSize:t}){Zw(e,0,0,t.width,t.height,this.Rw())}};function nO(e){return t=>t.Xa?.(e)??[]}var rO=nO(`normal`),iO=nO(`top`),aO=nO(`bottom`),oO=class{constructor(e,t){this.Dw=null,this.Iw=null,this.M=null,this.Vw=!1,this.Qv=Q({width:0,height:0}),this.Bw=new Dw,this.im=new yT(5),this.rm=!1,this.hm=()=>{this.rm||this.qv.Qt().mr()},this.lm=()=>{this.rm||this.qv.Qt().mr()},this.qv=e,this.xu=t,this.yn=e.N().layout,this.Hv=document.createElement(`tr`),this.Ew=document.createElement(`td`),this.Ew.style.padding=`0`,this.Aw=document.createElement(`td`),this.Aw.style.padding=`0`,this.lv=document.createElement(`td`),this.lv.style.height=`25px`,this.lv.style.padding=`0`,this.Lw=document.createElement(`div`),this.Lw.style.width=`100%`,this.Lw.style.height=`100%`,this.Lw.style.position=`relative`,this.Lw.style.overflow=`hidden`,this.lv.appendChild(this.Lw),this.fm=HD(this.Lw,Q({width:16,height:16})),this.fm.subscribeSuggestedBitmapSizeChanged(this.hm);let n=this.fm.canvasElement;n.style.position=`absolute`,n.style.zIndex=`1`,n.style.left=`0`,n.style.top=`0`,this.pm=HD(this.Lw,Q({width:16,height:16})),this.pm.subscribeSuggestedBitmapSizeChanged(this.lm);let r=this.pm.canvasElement;r.style.position=`absolute`,r.style.zIndex=`2`,r.style.left=`0`,r.style.top=`0`,this.Hv.appendChild(this.Ew),this.Hv.appendChild(this.lv),this.Hv.appendChild(this.Aw),this.zw(),this.qv.Qt().L_().i(this.zw.bind(this),this),this.tv=new jD(this.pm.canvasElement,this,{xp:()=>!0,Cp:()=>!this.qv.N().handleScroll.horzTouchDrag})}m(){this.tv.m(),this.Dw!==null&&this.Dw.m(),this.Iw!==null&&this.Iw.m(),this.pm.unsubscribeSuggestedBitmapSizeChanged(this.lm),UD(this.pm.canvasElement),this.pm.dispose(),this.fm.unsubscribeSuggestedBitmapSizeChanged(this.hm),UD(this.fm.canvasElement),this.fm.dispose()}uv(){return this.Hv}Ow(){return this.Dw}Nw(){return this.Iw}zp(e){if(this.Vw)return;this.Vw=!0;let t=this.qv.Qt();!t.Et().Gi()&&this.qv.N().handleScale.axisPressedMouseMove.time&&t.zd(e.localX)}Ap(e){this.zp(e)}Op(){let e=this.qv.Qt();!e.Et().Gi()&&this.Vw&&(this.Vw=!1,this.qv.N().handleScale.axisPressedMouseMove.time&&e.$d())}Pp(e){let t=this.qv.Qt();!t.Et().Gi()&&this.qv.N().handleScale.axisPressedMouseMove.time&&t.Ud(e.localX)}yp(e){this.Pp(e)}Ip(){this.Vw=!1;let e=this.qv.Qt();e.Et().Gi()&&!this.qv.N().handleScale.axisPressedMouseMove.time||e.$d()}Rp(){this.Ip()}up(){this.qv.N().handleScale.axisDoubleClickReset.time&&this.qv.Qt().ws()}ap(){this.up()}wp(){this.qv.Qt().N().handleScale.axisPressedMouseMove.time&&this.Em(1)}Yp(){this.Em(0)}cv(){return this.Qv}Fw(){return this.Bw}Ww(e,t,n){lw(this.Qv,e)||(this.Qv=e,this.rm=!0,this.fm.resizeCanvasElement(e),this.pm.resizeCanvasElement(e),this.rm=!1,this.lv.style.width=`${e.width}px`,this.lv.style.height=`${e.height}px`,this.Bw.p(e)),this.Dw!==null&&this.Dw.Cm(Q({width:t,height:e.height})),this.Iw!==null&&this.Iw.Cm(Q({width:n,height:e.height}))}Hw(){let e=this.Uw();return Math.ceil(e.S+e.C+e.k+e.A+e.I+e.$w)}kt(){this.qv.Qt().Et().El()}dv(){return this.fm.bitmapSize}fv(e,t,n,r){let i=this.dv();if(i.width>0&&i.height>0&&(e.drawImage(this.fm.canvasElement,t,n),r)){let r=this.pm.canvasElement;e.drawImage(r,t,n)}}km(e){if(e===0)return;let t={colorSpace:this.yn.colorSpace};if(e!==1){this.fm.applySuggestedBitmapSize();let n=vw(this.fm,t);n!==null&&(n.useBitmapCoordinateSpace((e=>{this.Tm(e),this.Rm(e),this.jw(n,aO)})),this.Im(n),this.jw(n,rO)),this.Dw!==null&&this.Dw.km(e),this.Iw!==null&&this.Iw.km(e)}this.pm.applySuggestedBitmapSize();let n=vw(this.pm,t);n!==null&&(n.useBitmapCoordinateSpace((({context:e,bitmapSize:t})=>{e.clearRect(0,0,t.width,t.height)})),this.qw([...this.qv.Qt().Jn(),this.qv.Qt().Rd()],n),this.jw(n,iO))}jw(e,t){let n=this.qv.Qt().Jn();for(let r of n)KD(t,(t=>WD(t,e,!1,void 0)),r,void 0);for(let r of n)KD(t,(t=>GD(t,e,!1,void 0)),r,void 0)}Tm({context:e,bitmapSize:t}){Zw(e,0,0,t.width,t.height,this.qv.Qt().ef())}Rm({context:e,bitmapSize:t,verticalPixelRatio:n}){if(this.qv.N().timeScale.borderVisible){e.fillStyle=this.Yw();let r=Math.max(1,Math.floor(this.Uw().S*n));e.fillRect(0,0,t.width,r)}}Im(e){let t=this.qv.Qt().Et(),n=t.El();if(!n||n.length===0)return;let r=this.xu.maxTickMarkWeight(n),i=this.Uw(),a=t.N();a.borderVisible&&a.ticksVisible&&e.useBitmapCoordinateSpace((({context:e,horizontalPixelRatio:t,verticalPixelRatio:r})=>{e.strokeStyle=this.Yw(),e.fillStyle=this.Yw();let a=Math.max(1,Math.floor(t)),o=Math.floor(.5*t);e.beginPath();let s=Math.round(i.C*r);for(let r=n.length;r--;){let i=Math.round(n[r].coord*t);e.rect(i-o,0,a,s)}e.fill()})),e.useMediaCoordinateSpace((({context:e})=>{let t=i.S+i.C+i.A+i.k/2;e.textAlign=`center`,e.textBaseline=`middle`,e.fillStyle=this.H(),e.font=this.Sm();for(let i of n)if(i.weight<r){let n=i.needAlignCoordinate?this.Kw(e,i.coord,i.label):i.coord;e.fillText(i.label,n,t)}this.qv.N().timeScale.allowBoldLabels&&(e.font=this.Zw());for(let i of n)if(i.weight>=r){let n=i.needAlignCoordinate?this.Kw(e,i.coord,i.label):i.coord;e.fillText(i.label,n,t)}}))}Kw(e,t,n){let r=this.im.Ii(e,n),i=r/2,a=Math.floor(t-i)+.5;return a<0?t+=Math.abs(0-a):a+r>this.Qv.width&&(t-=Math.abs(this.Qv.width-(a+r))),t}qw(e,t){let n=this.Uw();for(let r of e)for(let e of r.dn())e.Tt().st(t,n)}Yw(){return this.qv.N().timeScale.borderColor}H(){return this.yn.textColor}F(){return this.yn.fontSize}Sm(){return Lw(this.F(),this.yn.fontFamily)}Zw(){return Lw(this.F(),this.yn.fontFamily,`bold`)}Uw(){this.M===null&&(this.M={S:1,L:NaN,A:NaN,I:NaN,tn:NaN,C:5,k:NaN,P:``,Qi:new yT,$w:0});let e=this.M,t=this.Sm();if(e.P!==t){let n=this.F();e.k=n,e.P=t,e.A=3*n/12,e.I=3*n/12,e.tn=9*n/12,e.L=0,e.$w=4*n/12,e.Qi.Os()}return this.M}Em(e){this.lv.style.cursor=e===1?`ew-resize`:`default`}zw(){let e=this.qv.Qt(),t=e.N();t.leftPriceScale.visible||this.Dw===null||(this.Ew.removeChild(this.Dw.uv()),this.Dw.m(),this.Dw=null),t.rightPriceScale.visible||this.Iw===null||(this.Aw.removeChild(this.Iw.uv()),this.Iw.m(),this.Iw=null);let n={Zd:this.qv.Qt().Zd()},r=()=>t.leftPriceScale.borderVisible&&e.Et().N().borderVisible,i=()=>e.ef();t.leftPriceScale.visible&&this.Dw===null&&(this.Dw=new tO(`left`,t,n,r,i),this.Ew.appendChild(this.Dw.uv())),t.rightPriceScale.visible&&this.Iw===null&&(this.Iw=new tO(`right`,t,n,r,i),this.Aw.appendChild(this.Iw.uv()))}},sO=!!TD&&!!navigator.userAgentData&&navigator.userAgentData.brands.some((e=>e.brand.includes(`Chromium`)))&&!!TD&&(navigator?.userAgentData?.platform?navigator.userAgentData.platform===`Windows`:navigator.userAgent.toLowerCase().indexOf(`win`)>=0),cO=class{constructor(e,t,n){var r;this.Gw=[],this.Xw=[],this.Jw=0,this.ho=0,this.C_=0,this.Qw=0,this.tM=0,this.iM=null,this.nM=!1,this.Wm=new Dw,this.Hm=new Dw,this.pd=new Dw,this.sM=null,this.eM=null,this.jv=e,this.yn=t,this.xu=n,this.Hv=document.createElement(`div`),this.Hv.classList.add(`tv-lightweight-charts`),this.Hv.style.overflow=`hidden`,this.Hv.style.direction=`ltr`,this.Hv.style.width=`100%`,this.Hv.style.height=`100%`,(r=this.Hv).style.userSelect=`none`,r.style.webkitUserSelect=`none`,r.style.msUserSelect=`none`,r.style.MozUserSelect=`none`,r.style.webkitTapHighlightColor=`transparent`,this.rM=document.createElement(`table`),this.rM.setAttribute(`cellspacing`,`0`),this.Hv.appendChild(this.rM),this.hM=this.aM.bind(this),lO(this.yn)&&this.lM(!0),this.sn=new aD(this.md.bind(this),this.yn,n),this.Qt().Dd().i(this.oM.bind(this),this),this._M=new oO(this,this.xu),this.rM.appendChild(this._M.uv());let i=t.autoSize&&this.uM(),a=this.yn.width,o=this.yn.height;if(i||a===0||o===0){let t=e.getBoundingClientRect();a||=t.width,o||=t.height}this.cM(a,o),this.dM(),e.appendChild(this.Hv),this.fM(),this.sn.Et().Zc().i(this.sn.Pa.bind(this.sn),this),this.sn.L_().i(this.sn.Pa.bind(this.sn),this)}Qt(){return this.sn}N(){return this.yn}rv(){return this.Gw}pM(){return this._M}m(){this.lM(!1),this.Jw!==0&&window.cancelAnimationFrame(this.Jw),this.sn.Dd().u(this),this.sn.Et().Zc().u(this),this.sn.L_().u(this),this.sn.m();for(let e of this.Gw)this.rM.removeChild(e.uv()),e.dw().u(this),e.fw().u(this),e.m();this.Gw=[];for(let e of this.Xw)this.vM(e);this.Xw=[],$(this._M).m(),this.Hv.parentElement!==null&&this.Hv.parentElement.removeChild(this.Hv),this.pd.m(),this.Wm.m(),this.Hm.m(),this.mM()}cM(e,t,n=!1){if(this.ho===t&&this.C_===e)return;let r=function(e){let t=Math.floor(e.width),n=Math.floor(e.height);return Q({width:t-t%2,height:n-n%2})}(Q({width:e,height:t}));this.ho=r.height,this.C_=r.width;let i=this.ho+`px`,a=this.C_+`px`;if(this.wM()||($(this.Hv).style.height=i,$(this.Hv).style.width=a),this.rM.style.height=i,this.rM.style.width=a,n){this.Jw!==0&&(window.cancelAnimationFrame(this.Jw),this.Jw=0),this.nM=!1;let e=dT.ys();this.iM!==null&&(e.Ss(this.iM),this.iM=null),this.MM(e,performance.now())}else this.sn.Pa()}km(e){e===void 0&&(e=dT.ys());for(let t=0;t<this.Gw.length;t++)this.Gw[t].km(e._s(t).rs);this.yn.timeScale.visible&&this._M.km(e.ls())}vr(e){let t=lO(this.yn);this.sn.vr(e);let n=lO(this.yn);n!==t&&this.lM(n),e.layout?.panes&&this.gM(),this.fM(),this.bM(e)}dw(){return this.Wm}fw(){return this.Hm}Dd(){return this.pd}SM(e=!1){this.iM!==null&&(this.MM(this.iM,performance.now()),this.iM=null);let t=this.xM(null),n=document.createElement(`canvas`);n.width=t.width,n.height=t.height;let r=$(n.getContext(`2d`));return this.xM(r,e),n}CM(e){return e===`left`&&!this.yM()||e===`right`&&!this.kM()||this.Gw.length===0?0:$(e===`left`?this.Gw[0].Sw():this.Gw[0].xw()).ym()}wM(){return this.yn.autoSize&&this.sM!==null}vv(){return this.Hv}PM(e){this.eM=e,this.eM?this.vv().style.setProperty(`cursor`,e):this.vv().style.removeProperty(`cursor`)}TM(){return this.eM}RM(e){return Tw(this.Gw[e]).cv()}gM(){this.Xw.forEach((e=>{e.kt()}))}bM(e){(e.autoSize!==void 0||!this.sM||e.width===void 0&&e.height===void 0)&&(e.autoSize&&!this.sM&&this.uM(),!1===e.autoSize&&this.sM!==null&&this.mM(),e.autoSize||e.width===void 0&&e.height===void 0||this.cM(e.width||this.C_,e.height||this.ho))}xM(e,t){let n=0,r=0,i=this.Gw[0],a=(n,r)=>{let i=0;for(let a=0;a<this.Gw.length;a++){let o=this.Gw[a],s=$(n===`left`?o.Sw():o.xw()),c=s.dv();if(e!==null&&s.fv(e,r,i,t),i+=c.height,a<this.Gw.length-1){let t=this.Xw[a],n=t.dv();e!==null&&t.fv(e,r,i),i+=n.height}}};this.yM()&&(a(`left`,0),n+=$(i.Sw()).dv().width);for(let i=0;i<this.Gw.length;i++){let a=this.Gw[i],o=a.dv();if(e!==null&&a.fv(e,n,r,t),r+=o.height,i<this.Gw.length-1){let t=this.Xw[i],a=t.dv();e!==null&&t.fv(e,n,r),r+=a.height}}n+=i.dv().width,this.kM()&&(a(`right`,n),n+=$(i.xw()).dv().width);let o=(t,n,r)=>{$(t===`left`?this._M.Ow():this._M.Nw()).fv($(e),n,r)};if(this.yn.timeScale.visible){let n=this._M.dv();if(e!==null){let a=0;this.yM()&&(o(`left`,a,r),a=$(i.Sw()).dv().width),this._M.fv(e,a,r,t),a+=n.width,this.kM()&&o(`right`,a,r)}r+=n.height}return Q({width:n,height:r})}DM(){let e=0,t=0,n=0;for(let r of this.Gw)this.yM()&&(t=Math.max(t,$(r.Sw()).bm(),this.yn.leftPriceScale.minimumWidth)),this.kM()&&(n=Math.max(n,$(r.xw()).bm(),this.yn.rightPriceScale.minimumWidth)),e+=r.z_();t=kD(t),n=kD(n);let r=this.C_,i=this.ho,a=Math.max(r-t-n,0),o=1*this.Xw.length,s=this.yn.timeScale.visible,c=s?Math.max(this._M.Hw(),this.yn.timeScale.minimumHeight):0;var l;c=(l=c)+l%2;let u=o+c,d=i<u?0:i-u,f=d/e,p=0,m=window.devicePixelRatio||1;for(let e=0;e<this.Gw.length;++e){let r=this.Gw[e];r.iw(this.sn.Zn()[e]);let i=0,o=0;o=e===this.Gw.length-1?Math.ceil((d-p)*m)/m:Math.round(r.z_()*f*m)/m,i=Math.max(o,2),p+=i,r.Cm(Q({width:a,height:i})),this.yM()&&r.mw(t,`left`),this.kM()&&r.mw(n,`right`),r.Sv()&&this.sn.Id(r.Sv(),i)}this._M.Ww(Q({width:s?a:0,height:c}),s?t:0,s?n:0),this.sn.N_(a),this.Qw!==t&&(this.Qw=t),this.tM!==n&&(this.tM=n)}lM(e){e?this.Hv.addEventListener(`wheel`,this.hM,{passive:!1}):this.Hv.removeEventListener(`wheel`,this.hM)}IM(e){switch(e.deltaMode){case e.DOM_DELTA_PAGE:return 120;case e.DOM_DELTA_LINE:return 32}return sO?1/window.devicePixelRatio:1}aM(e){if(!(e.deltaX!==0&&this.yn.handleScroll.mouseWheel||e.deltaY!==0&&this.yn.handleScale.mouseWheel))return;let t=this.IM(e),n=t*e.deltaX/100,r=-t*e.deltaY/100;if(e.cancelable&&e.preventDefault(),r!==0&&this.yn.handleScale.mouseWheel){let t=Math.sign(r)*Math.min(1,Math.abs(r)),n=e.clientX-this.Hv.getBoundingClientRect().left;this.Qt().Od(n,t)}n!==0&&this.yn.handleScroll.mouseWheel&&this.Qt().Nd(-80*n)}MM(e,t){let n=e.ls();n===3&&this.VM(),n!==3&&n!==2||(this.BM(e),this.EM(e,t),this._M.kt(),this.Gw.forEach((e=>{e.sw()})),this.iM?.ls()===3&&(this.iM.Ss(e),this.VM(),this.BM(this.iM),this.EM(this.iM,t),e=this.iM,this.iM=null)),this.km(e)}EM(e,t){for(let n of e.bs())this.xs(n,t)}BM(e){let t=this.sn.Zn();for(let n=0;n<t.length;n++)e._s(n).hs&&t[n].ru()}xs(e,t){let n=this.sn.Et();switch(e.ds){case 0:n.Xc();break;case 1:n.Jc(e.Wt);break;case 2:n.Ms(e.Wt);break;case 3:n.gs(e.Wt);break;case 4:n.Oc();break;case 5:e.Wt.jc(t)||n.gs(e.Wt.qc(t))}}md(e){this.iM===null?this.iM=e:this.iM.Ss(e),this.nM||(this.nM=!0,this.Jw=window.requestAnimationFrame((e=>{if(this.nM=!1,this.Jw=0,this.iM!==null){let t=this.iM;this.iM=null,this.MM(t,e);for(let n of t.bs())if(n.ds===5&&!n.Wt.jc(e)){this.Qt().ps(n.Wt);break}}})))}VM(){this.dM()}vM(e){this.rM.removeChild(e.uv()),e.m()}dM(){let e=this.sn.Zn(),t=e.length,n=this.Gw.length;for(let e=t;e<n;e++){let e=Tw(this.Gw.pop());this.rM.removeChild(e.uv()),e.dw().u(this),e.fw().u(this),e.m();let t=this.Xw.pop();t!==void 0&&this.vM(t)}for(let r=n;r<t;r++){let t=new eO(this,e[r]);if(t.dw().i(this.AM.bind(this,t),this),t.fw().i(this.LM.bind(this,t),this),this.Gw.push(t),r>0){let e=new LD(this,r-1,r);this.Xw.push(e),this.rM.insertBefore(e.uv(),this._M.uv())}this.rM.insertBefore(t.uv(),this._M.uv())}for(let n=0;n<t;n++){let t=e[n],r=this.Gw[n];r.Sv()===t?r.tw():r.iw(t)}this.fM(),this.DM()}zM(e,t,n,r){let i=new Map;e!==null&&this.sn.Jn().forEach((t=>{let n=t.Un().Hn(e);n!==null&&i.set(t,n)}));let a;if(e!==null){let t=this.sn.Et().en(e)?.originalTime;t!==void 0&&(a=t)}let o=this.Qt().ou(),s=this.OM(r),c=function(e,t){let n=e!==null&&e.lu instanceof fE?e.lu:void 0,r=e?.wu?.te,i=t!==void 0&&t!==-1?t:void 0;return e===null||e.ee===void 0?{NM:n,FM:r}:{NM:n,FM:r,WM:{ds:e.ee,HM:(a=e.lu,o=e.ee,a instanceof zE?`pane-primitive`:o===`marker`||o===`primitive`?`series-primitive`:`series`),UM:OD(e.ee,r),U_:n,$M:r,jM:i}};var a,o}(o,s);return{Qr:a,$n:e??void 0,qM:t??void 0,jM:s===-1?void 0:s,NM:c.NM,YM:i,FM:c.FM,WM:c.WM,KM:n??void 0}}OM(e){let t=-1;if(e)t=this.Gw.indexOf(e);else{let e=this.Qt().Rd().Kn();e!==null&&(t=this.Qt().Zn().indexOf(e))}return t}AM(e,t,n,r){this.Wm.p((()=>this.zM(t,n,r,e)))}LM(e,t,n,r){this.Hm.p((()=>this.zM(t,n,r,e)))}oM(e,t,n){this.PM(this.Qt().ou()?.mu??null),this.pd.p((()=>this.zM(e,t,n)))}fM(){let e=this.yn.timeScale.visible?``:`none`;this._M.uv().style.display=e}yM(){return this.Gw[0].Sv().K_().N().visible}kM(){return this.Gw[0].Sv().Z_().N().visible}uM(){return`ResizeObserver`in window&&(this.sM=new ResizeObserver((e=>{let t=e[e.length-1];if(!t)return;let n=t.contentRect.width,r=t.contentRect.height;this.cM(n,r,!0)})),this.sM.observe(this.jv,{box:`border-box`}),!0)}mM(){this.sM!==null&&this.sM.disconnect(),this.sM=null}};function lO(e){return!!(e.handleScroll.mouseWheel||e.handleScale.mouseWheel)}function uO(e){return e.open===void 0&&e.value===void 0}function dO(e){return function(e){return e.open!==void 0}(e)||function(e){return e.value!==void 0}(e)}function fO(e,t,n,r){let i=n.value,a={$n:t,wt:e,Wt:[i,i,i,i],Qr:r};return n.color!==void 0&&(a.R=n.color),a}function pO(e,t,n,r){let i=n.value,a={$n:t,wt:e,Wt:[i,i,i,i],Qr:r};return n.lineColor!==void 0&&(a.vt=n.lineColor),n.topColor!==void 0&&(a.ah=n.topColor),n.bottomColor!==void 0&&(a.oh=n.bottomColor),a}function mO(e,t,n,r){let i=n.value,a={$n:t,wt:e,Wt:[i,i,i,i],Qr:r};return n.topLineColor!==void 0&&(a._h=n.topLineColor),n.bottomLineColor!==void 0&&(a.uh=n.bottomLineColor),n.topFillColor1!==void 0&&(a.dh=n.topFillColor1),n.topFillColor2!==void 0&&(a.fh=n.topFillColor2),n.bottomFillColor1!==void 0&&(a.ph=n.bottomFillColor1),n.bottomFillColor2!==void 0&&(a.mh=n.bottomFillColor2),a}function hO(e,t,n,r){let i={$n:t,wt:e,Wt:[n.open,n.high,n.low,n.close],Qr:r};return n.color!==void 0&&(i.R=n.color),i}function gO(e,t,n,r){let i={$n:t,wt:e,Wt:[n.open,n.high,n.low,n.close],Qr:r};return n.color!==void 0&&(i.R=n.color),n.borderColor!==void 0&&(i.Ht=n.borderColor),n.wickColor!==void 0&&(i.hh=n.wickColor),i}function _O(e,t,n,r,i){let a=Tw(i)(n),o=Math.max(...a),s=Math.min(...a),c=a[a.length-1],l=[c,o,s,c],{time:u,color:d,...f}=n;return{$n:t,wt:e,Wt:l,Qr:r,ue:f,R:d}}function vO(e){return e.Wt!==void 0}function yO(e,t){return t.customValues!==void 0&&(e.ZM=t.customValues),e}function bO(e){return(t,n,r,i,a,o)=>function(e,t){return t?t(e):uO(e)}(r,o)?yO({wt:t,$n:n,Qr:i},r):yO(e(t,n,r,i,a),r)}function xO(e){return{Candlestick:bO(gO),Bar:bO(hO),Area:bO(pO),Baseline:bO(mO),Histogram:bO(fO),Line:bO(fO),Custom:bO(_O)}[e]}function SO(e){return{$n:0,GM:new Map,za:e}}function CO(e,t){if(e!==void 0&&e.length!==0)return{XM:t.key(e[0].wt),JM:t.key(e[e.length-1].wt)}}function wO(e){let t;return e.forEach((e=>{t===void 0&&(t=e.Qr)})),Tw(t)}var TO=class{constructor(e){this.QM=new Map,this.tg=new Map,this.ig=new Map,this.ng=[],this.xu=e}m(){this.QM.clear(),this.tg.clear(),this.ig.clear(),this.ng=[]}sg(e,t){let n=this.QM.size!==0,r=!1,i=this.tg.get(e);if(i!==void 0)if(this.tg.size===1)n=!1,r=!0,this.QM.clear();else for(let t of this.ng)t.pointData.GM.delete(e)&&(r=!0);let a=[];if(t.length!==0){let n=t.map((e=>e.time)),i=this.xu.createConverterToInternalObj(t),o=xO(e.bh()),s=e.ll(),c=e.ol();a=t.map(((t,a)=>{let l=i(t.time),u=this.xu.key(l),d=this.QM.get(u);d===void 0&&(d=SO(l),this.QM.set(u,d),r=!0);let f=o(l,d.$n,t,n[a],s,c);return d.GM.set(e,f),f}))}n&&this.eg(),this.rg(e,a);let o=-1;if(r){let e=[];this.QM.forEach((t=>{e.push({timeWeight:0,time:t.za,pointData:t,originalTime:wO(t.GM)})})),e.sort(((e,t)=>this.xu.key(e.time)-this.xu.key(t.time))),o=this.hg(e)}return this.ag(e,o,function(e,t,n){let r=CO(e,n),i=CO(t,n);if(r!==void 0&&i!==void 0)return{lg:!1,Ia:r.JM>=i.JM&&r.XM>=i.XM}}(this.tg.get(e),i,this.xu))}Jd(e){return this.sg(e,[])}og(e,t,n){if(n&&e.Na())throw Error(`Historical updates are not supported when conflation is enabled. Conflation requires data to be processed in order.`);let r=t;(function(e){e.Qr===void 0&&(e.Qr=e.time)})(r),this.xu.preprocessData(t);let i=this.xu.createConverterToInternalObj([t])(t.time),a=this.ig.get(e);if(!n&&a!==void 0&&this.xu.key(i)<this.xu.key(a))throw Error(`Cannot update oldest data, last time=${a}, new time=${i}`);let o=this.QM.get(this.xu.key(i));if(n&&o===void 0)throw Error(`Cannot update non-existing data point when historicalUpdate is true`);let s=o===void 0;o===void 0&&(o=SO(i),this.QM.set(this.xu.key(i),o));let c=xO(e.bh()),l=e.ll(),u=e.ol(),d=c(i,o.$n,t,r.Qr,l,u),f=!n&&!s&&a!==void 0&&this.xu.key(i)===this.xu.key(a);o.GM.set(e,d),n?this._g(e,d,o.$n):(f&&e.Na()&&vO(d)&&e.Rr(d),this.ug(e,d));let p={Ia:vO(d),lg:n};if(!s)return this.ag(e,-1,p);let m={timeWeight:0,time:o.za,pointData:o,originalTime:wO(o.GM)},h=UT(this.ng,this.xu.key(m.time),((e,t)=>this.xu.key(e.time)<t));this.ng.splice(h,0,m);for(let e=h;e<this.ng.length;++e)EO(this.ng[e].pointData,e);return this.xu.fillWeightsForPoints(this.ng,h),this.ag(e,h,p)}cg(e,t){let n=this.tg.get(e);if(n===void 0||t<=0)return[[],this.dg()];t=Math.min(t,n.length);let r=n.splice(-t).reverse();n.length===0?this.ig.delete(e):this.ig.set(e,n[n.length-1].wt);for(let t of r){let n=this.QM.get(this.xu.key(t.wt));if(n&&(n.GM.delete(e),n.GM.size===0)){this.QM.delete(this.xu.key(n.za)),this.ng.splice(n.$n,1);for(let e=n.$n;e<this.ng.length;++e)EO(this.ng[e].pointData,e)}}return[r,this.ag(e,this.ng.length-1,{lg:!1,Ia:!1})]}ug(e,t){let n=this.tg.get(e);n===void 0&&(n=[],this.tg.set(e,n));let r=n.length===0?null:n[n.length-1];r===null||this.xu.key(t.wt)>this.xu.key(r.wt)?vO(t)&&n.push(t):vO(t)?n[n.length-1]=t:n.splice(-1,1),this.ig.set(e,t.wt)}_g(e,t,n){let r=this.tg.get(e);if(r===void 0)return;let i=UT(r,n,((e,t)=>e.$n<t));vO(t)?r[i]=t:r.splice(i,1)}rg(e,t){t.length===0?(this.tg.delete(e),this.ig.delete(e)):(this.tg.set(e,t.filter(vO)),this.ig.set(e,t[t.length-1].wt))}eg(){for(let e of this.ng)e.pointData.GM.size===0&&this.QM.delete(this.xu.key(e.time))}hg(e){let t=-1;for(let n=0;n<this.ng.length&&n<e.length;++n){let r=this.ng[n],i=e[n];if(this.xu.key(r.time)!==this.xu.key(i.time)){t=n;break}i.timeWeight=r.timeWeight,EO(i.pointData,n)}if(t===-1&&this.ng.length!==e.length&&(t=Math.min(this.ng.length,e.length)),t===-1)return-1;for(let n=t;n<e.length;++n)EO(e[n].pointData,n);return this.xu.fillWeightsForPoints(e,t),this.ng=e,t}fg(){if(this.tg.size===0)return null;let e=0;return this.tg.forEach((t=>{t.length!==0&&(e=Math.max(e,t[t.length-1].$n))})),e}ag(e,t,n){let r=this.dg();if(t!==-1)this.tg.forEach(((t,i)=>{r.U_.set(i,{ue:t,pg:i===e?n:void 0})})),this.tg.has(e)||r.U_.set(e,{ue:[],pg:n}),r.Et.vg=this.ng,r.Et.mg=t;else{let t=this.tg.get(e);r.U_.set(e,{ue:t||[],pg:n})}return r}dg(){return{U_:new Map,Et:{Pc:this.fg()}}}};function EO(e,t){e.$n=t,e.GM.forEach((e=>{e.$n=t}))}function DO(e,t){return e._t<t}function OO(e,t){return t<e._t}function kO(e,t,n,r){return UT(e,t,DO,n,r)}function AO(e,t,n,r){return WT(e,t,OO,n,r)}function jO(e,t,n){return{ne:e,se:t,ee:n}}var MO=[0,0];function NO(e,t,n){return t===void 0||t.wt!==e.wt-1?e._t-n/2:(t._t+e._t)/2}function PO(e,t,n){return t===void 0||t.wt!==e.wt+1?e._t+n/2:(e._t+t._t)/2}function FO(e,t,n,r,i,a,o){if(t===null||t.from>=t.to||e.length===0)return null;let s=i/2+a,c=kO(e,n-s,t.from,t.to),l=AO(e,n+s,c,t.to);if(c>=l)return null;let u=1/0;for(let s=c;s<l;s++){let c=e[s],l=s>t.from?e[s-1]:void 0,d=s<t.to-1?e[s+1]:void 0,f=NO(c,l,i)-a,p=PO(c,d,i)+a;if(n<f||n>p)continue;o(c,MO);let m=MO[0],h=MO[1],g=Math.min(m,h),_=Math.max(m,h),ee=g-a,te=_+a;if(r>=g&&r<=_)u=Math.min(u,0);else if(r>=ee&&r<=te){let e=Math.min(Math.abs(r-g),Math.abs(_-r));u=Math.min(u,e)}}return Number.isFinite(u)?jO(u,0,`series-range`):null}function IO(e,t){return e.wt<t}function LO(e,t){return t<e.wt}function RO(e,t,n){let r=t.Oa(),i=t.bi(),a=UT(e,r,IO),o=WT(e,i,LO);if(!n)return{from:a,to:o};let s=a,c=o;return a>0&&a<e.length&&e[a].wt>=r&&(s=a-1),o>0&&o<e.length&&e[o-1].wt<=i&&(c=o+1),{from:s,to:c}}var zO=class{constructor(e,t,n){this.wg=!0,this.Mg=!0,this.gg=!0,this.bg=[],this.Sg=null,this.xg=-1,this.ae=e,this.le=t,this.Cg=n}kt(e){this.wg=!0,e===`data`&&(this.Mg=!0),e===`options`&&(this.gg=!0)}Tt(){return this.ae.It()?(this.yg(),this.Sg===null?null:this.kg):null}Qs(e,t){return this.ae.It()?(this.yg(),this.Sg===null?null:this.Pg(e,t)):null}Pg(e,t){return null}Tg(){this.bg=this.bg.map((e=>({...e,...this.ae.Sa().Sh(e.wt)})))}Rg(){this.Sg=null}yg(){let e=this.le.Et(),t=e.N().enableConflation?e.Qc():0;t!==this.xg&&(this.Mg=!0,this.xg=t),this.Mg&&=(this.Dg(),!1),this.gg&&=(this.Tg(),!1),this.wg&&=(this.Ig(),!1)}Ig(){let e=this.ae.Ft(),t=this.le.Et();if(this.Rg(),t.Gi()||e.Gi())return;let n=t.Ee();if(n===null||this.ae.Un().Th()===0)return;let r=this.ae.Lt();r!==null&&(this.Sg=RO(this.bg,n,this.Cg),this.Vg(e,t,r.Wt),this.Bg())}},BO=class{constructor(e,t){this.Eg=e,this.Ki=t}st(e,t,n){this.Eg.draw(e,this.Ki,t,n)}};function VO(e){switch(e){case`point`:return 2;case`range`:return 0;default:return 1}}var HO=class extends zO{constructor(e,t,n){super(e,t,!1),this.Yh=n,this.Eg=this.Yh.renderer(),this.kg=new BO(this.Eg,(e=>this.Ag(e)))}get ga(){return this.Yh.conflationReducer}Wa(e){return this.Yh.priceValueBuilder(e)}_l(e){return this.Yh.isWhitespace(e)}Pg(e,t){let n=this.Eg.hitTest?.(e,t,(e=>this.Ag(e)));if(n!=null)return{ne:(r=n).distance,se:VO(r.type),ee:`custom`,mu:r.cursorStyle,te:r.objectId,ie:r.hitTestData};var r;let i=FO(this.bg,this.Sg,e,t,this.le.Et().fl(),this.ae.N().hitTestTolerance,((e,t)=>{let n=e.Lg,r=NaN,i=NaN;if(n!==void 0&&!this.Yh.isWhitespace(n))for(let e of this.Yh.priceValueBuilder(n)){let t=this.Ag(e);t!==null&&(r=Number.isNaN(r)?t:Math.min(r,t),i=Number.isNaN(i)?t:Math.max(i,t))}t[0]=r,t[1]=i}));return i===null?null:{...i,ee:`custom`}}Dg(){let e=this.ae.Sa();this.bg=this.ae.Ha().Bh().map((t=>({wt:t.$n,_t:NaN,...e.Sh(t.$n),Lg:t.ue})))}Vg(e,t){t.Tc(this.bg,Fw(this.Sg))}Bg(){this.Yh.update({bars:this.bg.map(UO),barSpacing:this.le.Et().fl(),visibleRange:this.Sg,conflationFactor:this.le.Et().Qc()},this.ae.N())}Ag(e){let t=this.ae.Lt();return t===null?null:this.ae.Ft().Nt(e,t.Wt)}};function UO(e){return{x:e._t,time:e.wt,originalData:e.Lg,barColor:e.sh}}var WO={color:`#2196f3`},GO=(e,t,n)=>new HO(e,t,Ew(n));function KO(e){let t={value:e.Wt[3],time:e.Qr};return e.ZM!==void 0&&(t.customValues=e.ZM),t}function qO(e){let t=KO(e);return e.R!==void 0&&(t.color=e.R),t}function JO(e){let t=KO(e);return e.vt!==void 0&&(t.lineColor=e.vt),e.ah!==void 0&&(t.topColor=e.ah),e.oh!==void 0&&(t.bottomColor=e.oh),t}function YO(e){let t=KO(e);return e._h!==void 0&&(t.topLineColor=e._h),e.uh!==void 0&&(t.bottomLineColor=e.uh),e.dh!==void 0&&(t.topFillColor1=e.dh),e.fh!==void 0&&(t.topFillColor2=e.fh),e.ph!==void 0&&(t.bottomFillColor1=e.ph),e.mh!==void 0&&(t.bottomFillColor2=e.mh),t}function XO(e){let t={open:e.Wt[0],high:e.Wt[1],low:e.Wt[2],close:e.Wt[3],time:e.Qr};return e.ZM!==void 0&&(t.customValues=e.ZM),t}function ZO(e){let t=XO(e);return e.R!==void 0&&(t.color=e.R),t}function QO(e){let t=XO(e),{R:n,Ht:r,hh:i}=e;return n!==void 0&&(t.color=n),r!==void 0&&(t.borderColor=r),i!==void 0&&(t.wickColor=i),t}function $O(e){return{Area:JO,Line:qO,Baseline:YO,Histogram:qO,Bar:ZO,Candlestick:QO,Custom:ek}[e]}function ek(e){let t=e.Qr;return{...e.ue,time:t}}var tk={vertLine:{color:`#9598A1`,width:1,style:3,visible:!0,labelVisible:!0,labelBackgroundColor:`#131722`},horzLine:{color:`#9598A1`,width:1,style:3,visible:!0,labelVisible:!0,labelBackgroundColor:`#131722`},mode:1,doNotSnapToHiddenSeriesIndices:!1},nk={vertLines:{color:`#D6DCDE`,style:0,visible:!0},horzLines:{color:`#D6DCDE`,style:0,visible:!0}},rk={background:{type:`solid`,color:`#FFFFFF`},textColor:`#191919`,fontSize:12,fontFamily:Iw,panes:{enableResize:!0,separatorColor:`#E0E3EB`,separatorHoverColor:`rgba(178, 181, 189, 0.2)`},attributionLogo:!0,colorSpace:`srgb`,colorParsers:[]},ik={autoScale:!0,mode:0,invertScale:!1,alignLabels:!0,borderVisible:!0,borderColor:`#2B2B43`,entireTextOnly:!1,visible:!1,ticksVisible:!1,scaleMargins:{bottom:.1,top:.2},minimumWidth:0,ensureEdgeTickMarksVisible:!1,tickMarkDensity:2.5},ak={rightOffset:0,barSpacing:6,minBarSpacing:.5,maxBarSpacing:0,fixLeftEdge:!1,fixRightEdge:!1,lockVisibleTimeRangeOnResize:!1,rightBarStaysOnScroll:!1,borderVisible:!0,borderColor:`#2B2B43`,visible:!0,timeVisible:!1,secondsVisible:!0,shiftVisibleRangeOnNewBar:!0,allowShiftVisibleRangeOnWhitespaceReplacement:!1,ticksVisible:!1,uniformDistribution:!1,minimumHeight:0,allowBoldLabels:!0,ignoreWhitespaceIndices:!1,enableConflation:!1,conflationThresholdFactor:1,precomputeConflationOnInit:!1,precomputeConflationPriority:`background`};function ok(){return{addDefaultPane:!0,hoveredSeriesOnTop:!0,width:0,height:0,autoSize:!1,layout:rk,crosshair:tk,grid:nk,overlayPriceScales:{...ik},leftPriceScale:{...ik,visible:!1},rightPriceScale:{...ik,visible:!0},defaultVisiblePriceScaleId:`right`,timeScale:ak,localization:{locale:TD?navigator.language:``,dateFormat:`dd MMM 'yy`},handleScroll:{mouseWheel:!0,pressedMouseMove:!0,horzTouchDrag:!0,vertTouchDrag:!0},handleScale:{axisPressedMouseMove:{time:!0,price:!0},axisDoubleClickReset:{time:!0,price:!0},mouseWheel:!0,pinch:!0},kineticScroll:{mouse:!1,touch:!0},trackingMode:{exitMode:1}}}var sk=class{constructor(e,t,n){this.sv=e,this.zg=t,this.Og=n??0}applyOptions(e){this.sv.Qt().Pd(this.zg,e,this.Og)}options(){return this.Ki().N()}width(){return uT(this.zg)?this.sv.CM(this.zg):0}setVisibleRange(e){this.setAutoScale(!1),this.Ki().qo(new jT(e.from,e.to))}getVisibleRange(){let e,t,n=this.Ki().ar();if(n===null)return null;if(this.Ki().so()){let r=this.Ki().M_(),i=oD(r);n=kE(n,this.Ki().ro()),e=Number((Math.round(n.Je()/r)*r).toFixed(i)),t=Number((Math.round(n.Qe()/r)*r).toFixed(i))}else e=n.Je(),t=n.Qe();return{from:e,to:t}}setAutoScale(e){this.applyOptions({autoScale:e})}Ki(){return $(this.sv.Qt().Td(this.zg,this.Og)).Ft}},ck=class{constructor(e,t,n,r){this.sv=e,this.yt=n,this.Ng=t,this.Fg=r}getHeight(){return this.yt.$t()}setHeight(e){let t=this.sv.Qt(),n=t.hf(this.yt);t.Bd(n,e)}getStretchFactor(){return this.yt.z_()}setStretchFactor(e){this.yt.O_(e),this.sv.Qt().Pa()}paneIndex(){return this.sv.Qt().hf(this.yt)}moveTo(e){let t=this.paneIndex();t!==e&&(ww(e>=0&&e<this.sv.rv().length,`Invalid pane index`),this.sv.Qt().Ad(t,e))}getSeries(){return this.yt.U_().map((e=>this.Ng(e)))??[]}getHTMLElement(){let e=this.sv.rv();return e&&e.length!==0&&e[this.paneIndex()]?e[this.paneIndex()].uv():null}attachPrimitive(e){this.yt.hl(e),e.attached&&e.attached({chart:this.Fg,requestUpdate:()=>this.yt.Qt().Pa()})}detachPrimitive(e){this.yt.al(e)}priceScale(e){if(this.yt.A_(e)===null)throw Error(`Cannot find price scale with id: ${e}`);return new sk(this.sv,e,this.paneIndex())}setPreserveEmptyPane(e){this.yt.W_(e)}preserveEmptyPane(){return this.yt.H_()}addCustomSeries(e,t={},n=0){return this.Fg.addCustomSeries(e,t,n)}addSeries(e,t={}){return this.Fg.addSeries(e,t,this.paneIndex())}},lk={color:`#FF0000`,price:0,lineStyle:2,lineWidth:1,lineVisible:!0,axisLabelVisible:!0,title:``,axisLabelColor:``,axisLabelTextColor:``},uk=class{constructor(e){this._r=e}applyOptions(e){this._r.vr(e)}options(){return this._r.N()}Wg(){return this._r}},dk=class{constructor(e,t,n,r,i,a){this.Hg=new Dw,this.ae=e,this.Ug=t,this.$g=n,this.xu=i,this.Fg=r,this.jg=a}m(){this.Hg.m()}priceFormatter(){return this.ae.tl()}priceToCoordinate(e){let t=this.ae.Lt();return t===null?null:this.ae.Ft().Nt(e,t.Wt)}coordinateToPrice(e){let t=this.ae.Lt();return t===null?null:this.ae.Ft().Tn(e,t.Wt)}barsInLogicalRange(e){if(e===null)return null;let t=new ZE(new JE(e.from,e.to)).Fu(),n=this.ae.Un();if(n.Gi())return null;let r=n.Hn(t.Oa(),1),i=n.Hn(t.bi(),-1),a=$(n.Rh()),o=$(n.Qn());if(r!==null&&i!==null&&r.$n>i.$n)return{barsBefore:e.from-a,barsAfter:o-e.to};let s={barsBefore:r===null||r.$n===a?e.from-a:r.$n-a,barsAfter:i===null||i.$n===o?o-e.to:o-i.$n};return r!==null&&i!==null&&(s.from=r.Qr,s.to=i.Qr),s}setData(e){this.xu,this.ae.bh(),this.Ug.qg(this.ae,e),this.Yg(`full`)}update(e,t=!1){this.ae.bh(),this.Ug.Kg(this.ae,e,t),this.Yg(`update`)}pop(e=1){let t=this.Ug.Zg(this.ae,e);t.length!==0&&this.Yg(`update`);let n=$O(this.seriesType());return t.map((e=>n(e)))}dataByIndex(e,t){let n=this.ae.Un().Hn(e,t);return n===null?null:$O(this.seriesType())(n)}data(){let e=$O(this.seriesType());return this.ae.Un().Bh().map((t=>e(t)))}subscribeDataChanged(e){this.Hg.i(e)}unsubscribeDataChanged(e){this.Hg._(e)}applyOptions(e){this.ae.vr(e)}options(){return Nw(this.ae.N())}priceScale(){return this.$g.priceScale(this.ae.Ft().cl(),this.getPane().paneIndex())}createPriceLine(e){let t=Ow(Nw(lk),e);return new uk(this.ae.Ba(t))}removePriceLine(e){this.ae.Ea(e.Wg())}priceLines(){return this.ae.Aa().map((e=>new uk(e)))}seriesType(){return this.ae.bh()}lastValueData(e){let t=this.ae.Ae(e);return t.Le?{noData:!0}:{noData:!1,price:t.Mt,color:t.R}}attachPrimitive(e){this.ae.hl(e),e.attached&&e.attached({chart:this.Fg,series:this,requestUpdate:()=>this.ae.Qt().Pa(),horzScaleBehavior:this.xu})}detachPrimitive(e){this.ae.al(e),e.detached&&e.detached(),this.ae.Qt().Pa()}getPane(){let e=this.ae,t=$(this.ae.Qt().Ks(e));return this.jg(t)}moveToPane(e){this.ae.Qt().nf(this.ae,e)}seriesOrder(){let e=this.ae.Qt().Ks(this.ae);return e===null?-1:e.U_().indexOf(this.ae)}setSeriesOrder(e){let t=this.ae.Qt().Ks(this.ae);t!==null&&t.du(this.ae,e)}Yg(e){this.Hg.v()&&this.Hg.p(e)}},fk=class{constructor(e,t,n){this.Gg=new Dw,this.Gu=new Dw,this.Bw=new Dw,this.sn=e,this.ia=e.Et(),this._M=t,this.ia.Yc().i(this.Xg.bind(this)),this.ia.Kc().i(this.Jg.bind(this)),this._M.Fw().i(this.Qg.bind(this)),this.xu=n}m(){this.ia.Yc().u(this),this.ia.Kc().u(this),this._M.Fw().u(this),this.Gg.m(),this.Gu.m(),this.Bw.m()}scrollPosition(){return this.ia.Ac()}scrollToPosition(e,t){t?this.ia.$c(e,1e3):this.sn.gs(e)}scrollToRealTime(){this.ia.Uc()}getVisibleRange(){let e=this.ia.gc();return e===null?null:{from:e.from.originalTime,to:e.to.originalTime}}setVisibleRange(e){let t={from:this.xu.convertHorzItemToInternal(e.from),to:this.xu.convertHorzItemToInternal(e.to)},n=this.ia.Cc(t);this.sn.tf(n)}getVisibleLogicalRange(){let e=this.ia.Mc();return e===null?null:{from:e.Oa(),to:e.bi()}}setVisibleLogicalRange(e){ww(e.from<=e.to,`The from index cannot be after the to index.`),this.sn.tf(e)}resetTimeScale(){this.sn.ws()}fitContent(){this.sn.Xc()}logicalToCoordinate(e){let t=this.sn.Et();return t.Gi()?null:t.jt(e)}coordinateToLogical(e){return this.ia.Gi()?null:this.ia.Rc(e)}timeToIndex(e,t){let n=this.xu.convertHorzItemToInternal(e);return this.ia.vc(n,t)}timeToCoordinate(e){let t=this.timeToIndex(e,!1);return t===null?null:this.ia.jt(t)}coordinateToTime(e){let t=this.sn.Et(),n=t.Rc(e),r=t.en(n);return r===null?null:r.originalTime}width(){return this._M.cv().width}height(){return this._M.cv().height}subscribeVisibleTimeRangeChange(e){this.Gg.i(e)}unsubscribeVisibleTimeRangeChange(e){this.Gg._(e)}subscribeVisibleLogicalRangeChange(e){this.Gu.i(e)}unsubscribeVisibleLogicalRangeChange(e){this.Gu._(e)}subscribeSizeChange(e){this.Bw.i(e)}unsubscribeSizeChange(e){this.Bw._(e)}applyOptions(e){this.ia.vr(e)}options(){return{...Nw(this.ia.N()),barSpacing:this.ia.fl()}}Xg(){this.Gg.v()&&this.Gg.p(this.getVisibleRange())}Jg(){this.Gu.v()&&this.Gu.p(this.getVisibleLogicalRange())}Qg(e){this.Bw.p(e.width,e.height)}};function pk(e){return function(e){if(Mw(e.handleScale)){let t=e.handleScale;e.handleScale={axisDoubleClickReset:{time:t,price:t},axisPressedMouseMove:{time:t,price:t},mouseWheel:t,pinch:t}}else if(e.handleScale!==void 0){let{axisPressedMouseMove:t,axisDoubleClickReset:n}=e.handleScale;Mw(t)&&(e.handleScale.axisPressedMouseMove={time:t,price:t}),Mw(n)&&(e.handleScale.axisDoubleClickReset={time:n,price:n})}let t=e.handleScroll;Mw(t)&&(e.handleScroll={horzTouchDrag:t,vertTouchDrag:t,mouseWheel:t,pressedMouseMove:t})}(e),e}var mk=class{constructor(e,t,n){this.tb=new Map,this.ib=new Map,this.nb=new Dw,this.sb=new Dw,this.eb=new Dw,this.od=new WeakMap,this.rb=new TO(t);let r=n===void 0?Nw(ok()):Ow(Nw(ok()),pk(n));this.hb=t,this.sv=new cO(e,r,t),this.sv.dw().i((e=>{this.nb.v()&&this.nb.p(this.ab(e()))}),this),this.sv.fw().i((e=>{this.sb.v()&&this.sb.p(this.ab(e()))}),this),this.sv.Dd().i((e=>{this.eb.v()&&this.eb.p(this.ab(e()))}),this);let i=this.sv.Qt();this.lb=new fk(i,this.sv.pM(),this.hb)}remove(){this.sv.dw().u(this),this.sv.fw().u(this),this.sv.Dd().u(this),this.lb.m(),this.sv.m(),this.tb.clear(),this.ib.clear(),this.nb.m(),this.sb.m(),this.eb.m(),this.rb.m()}resize(e,t,n){this.autoSizeActive()||this.sv.cM(e,t,n)}addCustomSeries(e,t={},n=0){let r=(e=>({type:`Custom`,isBuiltIn:!1,defaultOptions:{...WO,...e.defaultOptions()},ob:GO,_b:e}))(Ew(e));return this.ub(r,t,n)}addSeries(e,t={},n=0){return this.ub(e,t,n)}removeSeries(e){let t=Tw(this.tb.get(e)),n=this.rb.Jd(t);this.sv.Qt().Jd(t),this.cb(n),this.tb.delete(e),this.ib.delete(t)}qg(e,t){this.cb(this.rb.sg(e,t))}Kg(e,t,n){this.cb(this.rb.og(e,t,n))}Zg(e,t){let[n,r]=this.rb.cg(e,t);return n.length!==0&&this.cb(r),n}subscribeClick(e){this.nb.i(e)}unsubscribeClick(e){this.nb._(e)}subscribeCrosshairMove(e){this.eb.i(e)}unsubscribeCrosshairMove(e){this.eb._(e)}subscribeDblClick(e){this.sb.i(e)}unsubscribeDblClick(e){this.sb._(e)}priceScale(e,t=0){return new sk(this.sv,e,t)}timeScale(){return this.lb}applyOptions(e){this.sv.vr(pk(e))}options(){return this.sv.N()}takeScreenshot(e=!1,t=!1){let n,r;try{t||(n=this.sv.Qt().N().crosshair.mode,this.sv.vr({crosshair:{mode:2}})),r=this.sv.SM(e)}finally{t||n===void 0||this.sv.Qt().vr({crosshair:{mode:n}})}return r}addPane(e=!1){let t=this.sv.Qt().af();return t.W_(e),this.fb(t)}removePane(e){this.sv.Qt().Vd(e)}swapPanes(e,t){this.sv.Qt().Ed(e,t)}autoSizeActive(){return this.sv.wM()}chartElement(){return this.sv.vv()}panes(){return this.sv.Qt().Zn().map((e=>this.fb(e)))}paneSize(e=0){let t=this.sv.RM(e);return{height:t.height,width:t.width}}setCrosshairPosition(e,t,n){let r=this.tb.get(n);if(r===void 0)return;let i=this.sv.Qt().Ks(r);i!==null&&this.sv.Qt().qd(e,t,i)}clearCrosshairPosition(){this.sv.Qt().Yd(!0)}horzBehaviour(){return this.hb}ub(e,t={},n=0){ww(e.ob!==void 0),function(e){if(e===void 0||e.type===`custom`)return;let t=e;t.minMove!==void 0&&t.precision===void 0&&(t.precision=oD(t.minMove))}(t.priceFormat),e.type===`Candlestick`&&function(e){e.borderColor!==void 0&&(e.borderUpColor=e.borderColor,e.borderDownColor=e.borderColor),e.wickColor!==void 0&&(e.wickUpColor=e.wickColor,e.wickDownColor=e.wickColor)}(t);let r=Ow(Nw(yw),Nw(e.defaultOptions),t),i=e.ob,a=new fE(this.sv.Qt(),e.type,r,i,e._b);this.sv.Qt().Gd(a,n);let o=new dk(a,this,this,this,this.hb,(e=>this.fb(e)));return this.tb.set(o,a),this.ib.set(a,o),o}cb(e){let t=this.sv.Qt();t.Kd(e.Et.Pc,e.Et.vg,e.Et.mg),e.U_.forEach(((e,t)=>t.ht(e.ue,e.pg))),t.Et()._c(),t.Bc()}pb(e){return Tw(this.ib.get(e))}mb(e){return e!==void 0&&this.ib.has(e)?this.pb(e):void 0}ab(e){let t=new Map;e.YM.forEach(((e,n)=>{let r=n.bh(),i=$O(r)(e);if(r!==`Custom`)ww(dO(i));else{let e=n.ol();ww(!e||!1===e(i))}t.set(this.pb(n),i)}));let n=this.mb(e.NM),r=e.WM===void 0?void 0:{type:e.WM.ds,sourceKind:e.WM.HM,objectKind:e.WM.UM,series:this.mb(e.WM.U_),objectId:e.WM.$M,paneIndex:e.WM.jM};return{time:e.Qr,logical:e.$n,point:e.qM,paneIndex:e.jM,hoveredInfo:r,hoveredSeries:n,hoveredObjectId:e.FM,seriesData:t,sourceEvent:e.KM}}fb(e){let t=this.od.get(e);return t||(t=new ck(this.sv,(e=>this.pb(e)),e,this),this.od.set(e,t)),t}};function hk(e){if(jw(e)){let t=document.getElementById(e);return ww(t!==null,`Cannot find element in DOM with id=${e}`),t}return e}function gk(e,t,n){let r=new mk(hk(e),t,n);return t.setOptions(r.options()),r}function _k(e,t){return gk(e,new wD,wD.yf(t))}var vk=class extends zO{constructor(e,t){super(e,t,!0)}Vg(e,t,n){t.Tc(this.bg,Fw(this.Sg)),e.Zo(this.bg,n,Fw(this.Sg))}Sb(e,t){return{wt:e,Mt:t,_t:NaN,ut:NaN}}Dg(){let e=this.ae.Sa();this.bg=this.ae.Ha().Bh().map((t=>{let n;if((t.Zr??1)>1){let e=t.Wt[1],r=t.Wt[2],i=t.Wt[3];n=Math.abs(e-i)>Math.abs(r-i)?e:r}else n=t.Wt[3];return this.xb(t.$n,n,e)}))}},yk=class extends zO{constructor(e,t){super(e,t,!1)}Pg(e,t){return FO(this.bg,this.Sg,e,t,this.le.Et().fl(),this.ae.N().hitTestTolerance,((e,t)=>{t[0]=e.Qo,t[1]=e.t_}))}Vg(e,t,n){t.Tc(this.bg,Fw(this.Sg)),e.Xo(this.bg,n,Fw(this.Sg))}Qb(e,t,n){return{wt:e,jr:t.Wt[0],qr:t.Wt[1],Yr:t.Wt[2],Kr:t.Wt[3],_t:NaN,Jo:NaN,Qo:NaN,t_:NaN,i_:NaN}}Dg(){let e=this.ae.Sa();this.bg=this.ae.Ha().Bh().map((t=>this.xb(t.$n,t,e)))}},bk=class extends Uw{constructor(){super(...arguments),this.qt=null,this.Kb=0}ht(e){this.qt=e}et(e){if(this.qt===null||this.qt.Un.length===0||this.qt.lt===null)return;let{horizontalPixelRatio:t}=e;this.Kb=function(e,t){if(e>=2.5&&e<=4)return Math.floor(3*t);let n=1-.2*Math.atan(Math.max(4,e)-4)/(.5*Math.PI),r=Math.floor(e*n*t),i=Math.floor(e*t);return Math.max(Math.floor(t),Math.min(r,i))}(this.qt.fl,t),this.Kb>=2&&Math.floor(t)%2!=this.Kb%2&&this.Kb--;let n=this.qt.Un;this.qt.tS&&this.iS(e,n,this.qt.lt),this.qt.gi&&this.Rm(e,n,this.qt.lt);let r=this.nS(t);(!this.qt.gi||this.Kb>2*r)&&this.sS(e,n,this.qt.lt)}iS(e,t,n){if(this.qt===null)return;let{context:r,horizontalPixelRatio:i,verticalPixelRatio:a}=e,o=``,s=Math.min(Math.floor(i),Math.floor(this.qt.fl*i));s=Math.max(Math.floor(i),Math.min(s,this.Kb));let c=Math.floor(.5*s),l=null;for(let e=n.from;e<n.to;e++){let n=t[e];n.rh!==o&&(r.fillStyle=n.rh,o=n.rh);let u=Math.round(Math.min(n.Jo,n.i_)*a),d=Math.round(Math.max(n.Jo,n.i_)*a),f=Math.round(n.Qo*a),p=Math.round(n.t_*a),m=Math.round(i*n._t)-c,h=m+s-1;l!==null&&(m=Math.max(l+1,m),m=Math.min(m,h));let g=h-m+1;r.fillRect(m,f,g,u-f),r.fillRect(m,d+1,g,p-d),l=h}}nS(e){let t=Math.floor(1*e);this.Kb<=2*t&&(t=Math.floor(.5*(this.Kb-1)));let n=Math.max(Math.floor(e),t);return this.Kb<=2*n?Math.max(Math.floor(e),Math.floor(1*e)):n}Rm(e,t,n){if(this.qt===null)return;let{context:r,horizontalPixelRatio:i,verticalPixelRatio:a}=e,o=``,s=this.nS(i),c=null;for(let e=n.from;e<n.to;e++){let n=t[e];n.eh!==o&&(r.fillStyle=n.eh,o=n.eh);let l=Math.round(n._t*i)-Math.floor(.5*this.Kb),u=l+this.Kb-1,d=Math.round(Math.min(n.Jo,n.i_)*a),f=Math.round(Math.max(n.Jo,n.i_)*a);if(c!==null&&(l=Math.max(c+1,l),l=Math.min(l,u)),this.qt.fl*i>2*s)Xw(r,l,d,u-l+1,f-d+1,s);else{let e=u-l+1;r.fillRect(l,d,e,f-d+1)}c=u}}sS(e,t,n){if(this.qt===null)return;let{context:r,horizontalPixelRatio:i,verticalPixelRatio:a}=e,o=``,s=this.nS(i);for(let e=n.from;e<n.to;e++){let n=t[e],c=Math.round(Math.min(n.Jo,n.i_)*a),l=Math.round(Math.max(n.Jo,n.i_)*a),u=Math.round(n._t*i)-Math.floor(.5*this.Kb),d=u+this.Kb-1;if(n.sh!==o){let e=n.sh;r.fillStyle=e,o=e}this.qt.gi&&(u+=s,c+=s,d-=s,l-=s),c>l||r.fillRect(u,c,d-u+1,l-c+1)}}},xk=class extends yk{constructor(){super(...arguments),this.kg=new bk}xb(e,t,n){return{...this.Qb(e,t,n),...n.Sh(e)}}Bg(){let e=this.ae.N();this.kg.ht({Un:this.bg,fl:this.le.Et().fl(),tS:e.wickVisible,gi:e.borderVisible,lt:this.Sg})}},Sk={type:`Candlestick`,isBuiltIn:!0,defaultOptions:{upColor:`#26a69a`,downColor:`#ef5350`,wickVisible:!0,borderVisible:!0,borderColor:`#378658`,borderUpColor:`#26a69a`,borderDownColor:`#ef5350`,wickColor:`#737375`,wickUpColor:`#26a69a`,wickDownColor:`#ef5350`},ob:(e,t)=>new xk(e,t)},Ck=class extends Uw{constructor(){super(...arguments),this.qt=null,this.eS=[]}ht(e){this.qt=e,this.eS=[]}et({context:e,horizontalPixelRatio:t,verticalPixelRatio:n}){if(this.qt===null||this.qt.ot.length===0||this.qt.lt===null)return;this.eS.length||this.rS(t);let r=Math.max(1,Math.floor(n)),i=Math.round(this.qt.hS*n)-Math.floor(r/2),a=i+r;for(let t=this.qt.lt.from;t<this.qt.lt.to;t++){let o=this.qt.ot[t],s=this.eS[t-this.qt.lt.from],c=Math.round(o.ut*n),l,u;e.fillStyle=o.sh,c<=i?(l=c,u=a):(l=i,u=c-Math.floor(r/2)+r),e.fillRect(s.Oa,l,s.bi-s.Oa+1,u-l)}}rS(e){if(this.qt===null||this.qt.ot.length===0||this.qt.lt===null)return void(this.eS=[]);let t=Math.ceil(this.qt.fl*e)<=1?0:Math.max(1,Math.floor(e)),n=Math.round(this.qt.fl*e)-t;this.eS=Array(this.qt.lt.to-this.qt.lt.from);for(let t=this.qt.lt.from;t<this.qt.lt.to;t++){let r=this.qt.ot[t],i=Math.round(r._t*e),a,o;if(n%2){let e=(n-1)/2;a=i-e,o=i+e}else{let e=n/2;a=i-e,o=i+e-1}this.eS[t-this.qt.lt.from]={Oa:a,bi:o,aS:i,ce:r._t*e,wt:r.wt}}for(let e=this.qt.lt.from+1;e<this.qt.lt.to;e++){let n=this.eS[e-this.qt.lt.from],r=this.eS[e-this.qt.lt.from-1];n.wt===r.wt+1&&n.Oa-r.bi!==t+1&&(r.aS>r.ce?r.bi=n.Oa-t-1:n.Oa=r.bi+t+1)}let r=Math.ceil(this.qt.fl*e);for(let e=this.qt.lt.from;e<this.qt.lt.to;e++){let t=this.eS[e-this.qt.lt.from];t.bi<t.Oa&&(t.bi=t.Oa);let n=t.bi-t.Oa+1;r=Math.min(n,r)}if(t>0&&r<4)for(let e=this.qt.lt.from;e<this.qt.lt.to;e++){let t=this.eS[e-this.qt.lt.from];t.bi-t.Oa+1>r&&(t.aS>t.ce?--t.bi:t.Oa+=1)}}},wk=class extends vk{constructor(){super(...arguments),this.kg=new Ck}Pg(e,t){let n=this.ae.Ft().Nt(this.ae.N().base,$(this.ae.Lt()).Wt);return n===null?null:FO(this.bg,this.Sg,e,t,this.le.Et().fl(),this.ae.N().hitTestTolerance,((e,t)=>{t[0]=e.ut,t[1]=n}))}xb(e,t,n){return{...this.Sb(e,t),...n.Sh(e)}}Bg(){let e={ot:this.bg,fl:this.le.Et().fl(),lt:this.Sg,hS:this.ae.Ft().Nt(this.ae.N().base,$(this.ae.Lt()).Wt)};this.kg.ht(e)}},Tk={type:`Histogram`,isBuiltIn:!0,defaultOptions:{color:`#26a69a`,base:0},ob:(e,t)=>new wk(e,t)};({...yw});var Ek={brand:`Sui MCP`,shell:{toggleTheme:`Toggle theme`},account:{name:`Name`,address:`Account address`,balances:`Balances`,noBalances:`No token balances were returned.`,nfts:`NFTs`,noNfts:`No NFTs in the scanned objects.`,noImage:`No image`,objectsTruncated:`Some objects beyond the scanned range are omitted.`},receipt:{success:`Transaction succeeded on Sui`,failure:`Transaction failed on Sui`,sender:`Sender`,account:`Affected account`,object:`Object`,noBalanceChanges:`No balance changes were recorded.`,gasComputation:`Computation cost`,gasStorage:`Storage cost`,gasRebate:`Storage rebate`,gasBudget:`Network fee limit (gas budget)`,netFeeExplanation:`The network fee shown above includes the storage rebate. If it is negative, the rebate exceeds the computation and storage charges.`,estimatedNetFeeExplanation:`The estimated network fee shown above includes the storage rebate. If it is negative, the rebate exceeds the estimated computation and storage charges.`,gasLimitExplanation:`The gas budget limits network fee spending. It is not an estimate of the amount charged.`,gasPrice:`Gas price`,gasPayment:`Gas payment object`,graph:`Transaction graph`,graphTip:`A diagram of this transaction's programmable transaction block (PTB), derived from public on-chain data. It is a diagnostic view only, not transaction input, signing, or a safety verdict.`,graphReviewTip:`A diagram of the transaction prepared for this review and simulation. It shows what is being reviewed, not an actual result, permission to sign, or a guarantee of safety.`,graphRendering:`Rendering the transaction graph…`,graphFailed:`The transaction graph could not be rendered`,graphZoomIn:`Zoom in`,graphZoomOut:`Zoom out`,graphCenter:`Center`,graphShowAddresses:`Show full addresses`,graphShowNames:`Show readable labels`,moveCalls:`Move calls`,noMoveCalls:`No Move calls were recorded.`,inputs:`Inputs`,noInputs:`No inputs were recorded.`,inputKinds:{object:`Owned object`,shared_object:`Shared object`,receiving:`Receiving object`,pure:`Pure value`,withdrawal:`Balance withdrawal`,unknown:`Input`},bytes:`bytes`,events:`Events`,noEvents:`No events were recorded.`,objectChanges:`Object changes`,noObjectChanges:`No object changes were recorded.`},chart:{boundaryUsdc:`Prices are in USDC, not USD; dollar parity is not guaranteed.`,boundaryScope:`Historical prices, not live quotes.`,source:`Source: DeepBookV3 Indexer.`,renderedWith:`Rendered with`,library:`TradingView Lightweight Charts`},common:{walletStatusRecovery:`To restart the connection service, fully quit all apps using Sui MCP, then reopen them. This does not confirm removal of a connection in your wallet app.`,mainnet:`Sui mainnet`,retrievedAt:`Data retrieved`}},Dk={en:Ek};function Ok(){try{return(navigator.language||`en`).slice(0,2).toLowerCase()}catch{return`en`}}function kk(e=Ok()){return Dk[e]??Ek}var Ak=kk(),jk={source_unavailable:`Chart data is unavailable right now.`,source_timeout:`The chart data source did not respond in time.`,source_http_error:`The chart data source returned an error.`,official_indexer_invalid_payload:`The chart data source returned information that could not be used.`,missing_pool_name:`No trading pair was selected.`,unsupported_interval:`This candle interval is not supported.`,invalid_timestamp:`A start or end time could not be read.`,invalid_timestamp_window:`The start time must be before the end time.`,invalid_limit:`The requested number of candles is not valid.`,unsupported_query_field:`This chart request includes an unsupported option.`,duplicate_query_field:`This chart request repeats an option.`,limit_exceeds_chart_cap:`This chart request exceeds the candle limit.`,pool_not_in_official_usdc_pools:`This trading pair is not available in the supported USDC charts.`},Mk=L({start:M(),timestampMs:N().int(),open:M(),high:M(),low:M(),close:M(),volume:M()}),Nk=[`Latest 500`,`Last 24h`,`Last 7d`,`Last 30d`],Pk=L({status:V(`ok`),pools:I(L({poolName:M(),baseAsset:L({symbol:M()})})),intervals:I(M()),defaultInterval:M(),defaultLimit:N().int().positive(),maxCandles:N().int().positive()}),Fk=L({status:B([`ok`,`empty_result`]),candles:I(Mk),candleCount:N().int().nonnegative(),query:L({poolName:M(),interval:M(),startTimeMs:N().int().nonnegative().optional(),endTimeMs:N().int().nonnegative().optional(),limit:N().int().positive()}),source:L({fetchedAt:M()}),pair:L({baseAsset:L({symbol:M()}),quoteAsset:L({symbol:V(`USDC`)})})}).refine(e=>e.candleCount===e.candles.length,`Candle count differs from returned rows.`),Ik={title:`DeepBook USDC chart`,guidance:(e,t)=>t.recoveryNeeded?`Ask in chat for a new chart with the pair and time range you want.`:void 0,controls(e,t){let n=Pk.parse(e.data),r=document.createElement(`form`);r.className=`ui-form`;let i=Xv({choices:[{label:`Choose a pair`,value:``},...n.pools.map(e=>({label:`${e.baseAsset.symbol} / USDC`,value:e.poolName}))]});i.required=!0;let a=Xv({choices:n.intervals.map(e=>({label:e,value:e}))});a.value=typeof e.input.interval==`string`?e.input.interval:n.defaultInterval;let o=Jv({placeholder:`YYYY-MM-DDTHH:mm`}),s=Jv({placeholder:`YYYY-MM-DDTHH:mm`});typeof e.input.startTimeMs==`number`&&(o.value=Vk(e.input.startTimeMs)),typeof e.input.endTimeMs==`number`&&(s.value=Vk(e.input.endTimeMs));let c=Number(e.input.limit??n.defaultLimit),l=Zv(`Time range & interval`,e.input.startTimeMs!==void 0||e.input.endTimeMs!==void 0),u=J(`p`,`ui-note`,Rk(e.input));for(let e of[o,s])e.addEventListener(`input`,()=>{u.textContent=`Custom range · UTC`});let d=J(`div`,`card-actions`);for(let e of Nk){let t=Kv(e===`Latest 500`?`Recent`:e,()=>{let t=zk(e,new Date);o.value=t.startInput,s.value=t.endInput,c=Number(t.limitInput),u.textContent=e===`Latest 500`?`Recent candles · UTC`:`${e} · UTC`,p()},`secondary`);d.append(t)}let f=J(`p`,`ui-error`);f.setAttribute(`role`,`alert`),l.body.append(Yv(`Candle interval`,a),d,u,Yv(`Start (UTC)`,o),Yv(`End (UTC)`,s)),r.append(J(`p`,`ui-note`,`Set the time range and interval before choosing a pair, if needed.`),Yv(`Choose a pair to open the chart`,i),l.details,f);function p(){if(i.value)try{let e=Bk(o.value),n=Bk(s.value);if(e!==void 0&&n!==void 0&&e>=n)throw Error(`Start must precede end.`);t({poolName:i.value,interval:a.value,limit:c,...e===void 0?{}:{startTimeMs:e},...n===void 0?{}:{endTimeMs:n}})}catch(e){f.textContent=e instanceof Error?e.message:`Invalid chart input.`}}r.addEventListener(`submit`,e=>{e.preventDefault(),p()});for(let e of[i,a,o,s])e.addEventListener(`change`,p);return{node:r,selectionHint:`To retry, clear the pair with “Choose a pair”, then select your pair again. Your time range and interval are kept.`}},result(e){let t=Fk.safeParse(e.data);if(!t.success){let t=e.data;if(t?.status===`source_unavailable`||t?.status===`unsupported_input`||t?.status===`unsupported_pool`||t?.status===`over_limit`){let e=typeof t.reason==`string`?t.reason:t.status,n=Object.hasOwn(jk,e)?jk[e]:`The requested chart could not be loaded.`,r=J(`div`);r.append(J(`p`,`ui-note`,n),J(`p`,`ui-note`,`Ask in chat for a new chart with the pair and time range you want.`));let i=Zv(`Details`);return i.body.append(J(`p`,void 0,`Reported reason: ${e}`)),r.append(i.details),{node:r}}throw Error(`Chart data is incomplete.`)}let n=t.data,r=J(`div`);r.append(J(`p`,`ui-note`,`${n.pair.baseAsset.symbol} / USDC · ${n.query.interval}`),J(`p`,`ui-note`,Rk(n.query)));let i=Zv(`Details`),a=J(`p`,`ui-note`,`${Ak.common.retrievedAt}: `);a.append(Qv(n.source.fetchedAt)),i.body.append(a);let o=e=>e===void 0?`not specified`:Number.isFinite(new Date(e).getTime())?new Date(e).toISOString():Gv(e);i.body.append(J(`p`,void 0,`Start: ${o(n.query.startTimeMs)} · End: ${o(n.query.endTimeMs)}`)),n.candleCount>=n.query.limit&&r.append(J(`p`,`ui-note`,`This view is limited to ${n.query.limit} candles; the requested period may contain more.`));let s=J(`p`,`ui-note`,`${Ak.chart.boundaryUsdc} ${Ak.chart.boundaryScope} ${Ak.chart.source}`),c=qv(Ak.chart.library,`https://www.tradingview.com/`);if(c.target=`_blank`,c.rel=`noopener noreferrer`,s.append(` ${Ak.chart.renderedWith} `,c,`.`),n.candles.length===0)return i.body.append(s),r.append(J(`p`,`ui-note`,`No candles returned for this range.`),i.details),{node:r};let l=J(`div`,`card-chart`),u=J(`p`,`ui-note`),d=n.candles.at(-1),f=e=>`${Gv(e.start)} · Open ${e.open} · High ${e.high} · Low ${e.low} · Close ${e.close} · Volume ${e.volume}`;u.textContent=f(d),i.body.append(u,s),r.append(l,i.details);let p,m,h,g,_=!1,ee=!1,te=0,v=0,ne=()=>{let e=getComputedStyle(document.documentElement),t=t=>e.getPropertyValue(t).trim();p?.applyOptions({layout:{background:{color:t(`--ui-surface`)},textColor:t(`--ui-text`)},grid:{vertLines:{color:t(`--ui-border`)},horzLines:{color:t(`--ui-border`)}}})},re=()=>{ee||(ee=!0,m?.disconnect(),h?.disconnect(),p?.remove(),g!==void 0&&cancelAnimationFrame(g))},ie=()=>{if(ee||!l.isConnected)return;let e=l.clientWidth,t=l.clientHeight;if(!(e<=0||t<=0||e===te&&t===v))try{if(p)p.resize(e,t);else{p=_k(l,{width:e,height:t,autoSize:!1,layout:{attributionLogo:!1},timeScale:{timeVisible:!0,secondsVisible:!1,minBarSpacing:0,lockVisibleTimeRangeOnResize:!0}});let r=p.addSeries(Sk,{upColor:`#167752`,downColor:`#b44336`,borderVisible:!1,wickUpColor:`#167752`,wickDownColor:`#b44336`,priceFormat:{type:`price`,precision:6,minMove:1e-6}}),i=p.addSeries(Tk,{priceFormat:{type:`volume`},priceScaleId:``},1),a=Lk(n.candles,n.query);r.setData(a.prices),i.setData(a.volumes),p.panes()[0]?.setStretchFactor(3),p.panes()[1]?.setStretchFactor(1),a.range?p.timeScale().setVisibleRange(a.range):p.timeScale().fitContent();let o=new Map(n.candles.map(e=>[Wk(e),e]));p.subscribeCrosshairMove(e=>{u.textContent=f((typeof e.time==`number`?o.get(e.time):void 0)??d)}),ne(),h=new MutationObserver(ne),h.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-theme`]})}te=e,v=t}catch{re(),l.replaceChildren(J(`p`,`ui-error`,`The chart could not be displayed. The saved query and source data are unchanged.`))}};return{node:r,mount:()=>{_||ee||(_=!0,m=new ResizeObserver(()=>{ee||g!==void 0||(g=requestAnimationFrame(()=>{g=void 0,ie()}))}),m.observe(l),ie())},dispose:re}}};function Lk(e,t){let n=e.map(Hk),r=e.map(Uk),i=new Set(n.map(e=>e.time));for(let e of[t.startTimeMs,t.endTimeMs]){if(e===void 0)continue;let t=e/1e3;i.has(t)||(n.push({time:t}),r.push({time:t}),i.add(t))}n.sort((e,t)=>e.time-t.time),r.sort((e,t)=>e.time-t.time);let a=t.startTimeMs===void 0?n[0]?.time:t.startTimeMs/1e3,o=t.endTimeMs===void 0?n.at(-1)?.time:t.endTimeMs/1e3;return{prices:n,volumes:r,range:(t.startTimeMs!==void 0||t.endTimeMs!==void 0)&&a!==void 0&&o!==void 0&&a<o?{from:a,to:o}:void 0}}function Rk(e){if(e.startTimeMs===void 0&&e.endTimeMs===void 0)return`Recent candles · UTC`;let t=e=>{if(e===void 0)return`not specified`;let t=new Date(e);return Number.isNaN(t.getTime())?`${e} milliseconds since 1970-01-01T00:00:00Z`:Gv(e)};return`Range (UTC): ${t(e.startTimeMs)} → ${t(e.endTimeMs)}`}function zk(e,t){if(e===`Latest 500`)return{startInput:``,endInput:``,limitInput:`500`};let n=e===`Last 24h`?1440*60*1e3:e===`Last 7d`?10080*60*1e3:720*60*60*1e3,r=t.getTime();return{startInput:Vk(r-n),endInput:Vk(r),limitInput:`10000`}}function Bk(e){let t=e.trim();if(t===``)return;if(!/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}$/.test(t))throw Error(`UTC timestamps must use YYYY-MM-DDTHH:mm.`);let n=Date.parse(`${t}:00.000Z`);if(!Number.isSafeInteger(n))throw Error(`UTC timestamp is invalid.`);return n}function Vk(e){return new Date(e).toISOString().slice(0,16)}function Hk(e){return{time:Wk(e),open:Number(e.open),high:Number(e.high),low:Number(e.low),close:Number(e.close)}}function Uk(e){return{time:Wk(e),value:Number(e.volume),color:Number(e.close)>=Number(e.open)?`rgba(22, 119, 82, 0.45)`:`rgba(180, 67, 54, 0.45)`}}function Wk(e){return Math.floor(e.timestampMs/1e3)}cw(`chart`,Ik);</script></body></html>
3354
+ `)),ix={0:`ED25519`,1:`Secp256k1`,2:`Secp256r1`,3:`MultiSig`,5:`ZkLogin`,6:`Passkey`};function ax(e){let{prefix:t,words:n}=Py.decode(e);if(t!==`suiprivkey`)throw Error(`invalid private key prefix`);let r=new Uint8Array(Py.fromWords(n)),i=r.slice(1);return{scheme:ix[r[0]],secretKey:i}}var ox=`external-proposal-alpha-2026-05-25`,sx=`proposal-review-model-alpha-2026-05-25`;yh();var cx=M().refine(e=>{let t=new Date(e);return!Number.isNaN(t.getTime())&&t.toISOString()===e},`Expected ISO 8601 UTC timestamp`),lx=/transaction\s*bytes?|transactionBytes|tx\s*bytes?|serialized\s*transaction|serializedTransaction|signed\s*transaction|signing\s*request|signingRequest|wallet\s*authorization|walletAuthorization|private\s*key|privateKey|secret\s*key|secretKey|seed\s*phrase|mnemonic|suiprivkey|signature|route[-_\s]*selected|routeSelectedPlan|bcs\s*transaction|programmable\s*transaction/i,ux=/(?:0x[0-9a-fA-F]{160,}|[A-Za-z0-9+/_=-]{160,})/,dx=/suiprivkey1[023456789acdefghjklmnpqrstuvwxyz]+/gi,fx=/(^|[^0-9a-fA-F])(?:0x)?[0-9a-fA-F]{64}($|[^0-9a-fA-F])/,px=/(^|[^A-Za-z0-9+/_=-])(?:[A-Za-z0-9+/]{43}=|[A-Za-z0-9+/]{44}|[A-Za-z0-9_-]{43,44})($|[^A-Za-z0-9+/_=-])/,mx=/^(?:0|[1-9][0-9]*)(?:\.[0-9]+)?$/,hx=[12,15,18,21,24];function gx(e,t,n={}){return M().min(1).max(e).superRefine((e,r)=>{(lx.test(e)||ux.test(e)||vx(e)||yx(e)||!n.allowRawSecretLikeText&&bx(e))&&r.addIssue({code:`custom`,message:`${t} must not contain executable, signing, private-key, mnemonic, route-selected, or encoded secret-like material`})})}function _x(e,t){return gx(e,t,{allowRawSecretLikeText:!0})}function vx(e){return(e.match(dx)??[]).some(e=>{try{return ax(e.toLowerCase()),!0}catch{return e.toLowerCase().startsWith(`suiprivkey1`)}})}function yx(e){let t=e.normalize(`NFKD`).toLowerCase().replace(/[^a-z]+/g,` `).trim().split(/\s+/).filter(Boolean);for(let e of hx)if(!(t.length<e)){for(let n=0;n<=t.length-e;n+=1)if(nx(t.slice(n,n+e).join(` `),rx))return!0}return!1}function bx(e){return fx.test(e)||px.test(e)}var xx=gx(80,`amountDisplay`).refine(e=>mx.test(e)&&/[1-9]/.test(e),{message:`Expected a positive decimal display amount`}),Sx=L({kind:B([`mcp_server`,`ai_client`,`user`,`other`]),name:gx(120,`source.name`),reference:gx(256,`source.reference`).optional()}).strict(),Cx=L({address:db.optional(),label:gx(120,`party.label`).optional()}).strict().refine(e=>e.address!==void 0||e.label!==void 0,{message:`Expected address or label`}),wx=L({amountDisplay:xx,amountKind:V(`display_proposal`).default(`display_proposal`),symbol:gx(64,`amount.symbol`).optional(),coinType:_x(512,`amount.coinType`).optional(),denomination:gx(64,`amount.denomination`).optional()}).strict(),Tx=L({packageId:_x(128,`action.target.packageId`).optional(),module:gx(128,`action.target.module`).optional(),function:gx(128,`action.target.function`).optional(),objectId:_x(128,`action.target.objectId`).optional(),label:gx(120,`action.target.label`).optional()}).strict().refine(e=>e.packageId!==void 0||e.module!==void 0||e.function!==void 0||e.objectId!==void 0||e.label!==void 0,{message:`Expected at least one action target field`}),Ex=L({direction:B([`outgoing`,`expected_incoming`,`fee`]),amount:wx,recipient:Cx.optional(),description:gx(512,`assetFlow.description`).optional()}).strict(),Dx=L({id:gx(120,`proposal.id`),source:Sx,network:V(`sui:mainnet`),createdAt:cx,expiresAt:cx.optional(),purpose:gx(512,`purpose`),assumptions:I(gx(512,`assumptions[]`)).max(20).optional(),requiredUserChoices:I(gx(512,`requiredUserChoices[]`)).max(20).optional()}).strict(),Ox=ep(`type`,[Dx.extend({type:V(`payment`),payment:L({amount:wx,recipient:Cx,target:gx(512,`payment.target`).optional()}).strict()}).strict(),Dx.extend({type:V(`sui_action`),action:L({actionKind:gx(120,`action.actionKind`),target:Tx,recipient:Cx.optional(),assetFlow:I(Ex).max(20).optional()}).strict()}).strict()]),kx=L({id:M(),label:M(),status:B([`pass`,`warning`,`fail`]),message:M(),source:B([`proposal`,`adapter`,`registry`,`quote`,`wallet`,`simulation`,`network`])}).strict(),Ax=L({id:M(),label:M(),reason:M()}).strict(),jx=L({modelVersion:V(sx),contractVersion:V(ox),proposalId:M(),proposalType:B([`payment`,`sui_action`]),proposalSource:Sx,proposedAction:L({kind:B([`payment`,`sui_action`]),title:M(),purpose:M(),network:V(`sui:mainnet`),recipient:Cx.optional(),target:R([M(),Tx]).optional()}).strict(),assetFlow:L({outgoing:I(wx),expectedIncoming:I(wx),fees:I(wx)}).strict(),recipients:I(Cx),targets:I(R([M(),Tx])),evidenceUsed:I(L({id:M(),label:M(),source:B([`external_proposal`,`local_schema`]),summary:M()}).strict()),missingEvidence:I(Ax),requiredUserChoices:I(Ax),unsupportedClaims:I(L({id:M(),label:M(),reason:M()}).strict()),rejectedExecutableFields:I(L({fieldName:M(),reason:M()}).strict()),freshness:L({proposalCreatedAt:cx,proposalExpiresAt:cx.optional(),evaluatedAt:cx,status:B([`current`,`expired`,`created_in_future`,`expiry_not_provided`]),reason:M()}).strict(),blockingChecks:I(kx),nonSignableReason:L({code:V(`external_proposal_review_only`),message:M(),blockedCapabilities:I(M())}).strict()}).strict();L({requestedIntent:Ox,implementationStatus:V(`read_only_review_only`),contractVersion:V(ox)}).strict();var Mx=[`adapter_not_implemented`,`producer_stage_missing`,`wallet_review_contract_emit_missing`,`network_mismatch`,`insufficient_balance`,`insufficient_gas`,`allowlist_violation`,`asset_mismatch`,`amount_mismatch`,`wallet_mismatch`,`unsupported_action`,`object_resolution_failed`,`proposal_review_only`],Nx=[`review_evidence_stale`,`quote_stale`,`quote_unavailable`,`simulation_transient_failure`,`review_update_failed`,`wallet_connection_changed`],Px=[`proposed`,`awaiting_wallet`,`wallet_connected`,`ready_for_wallet_review`,`refresh_required`,`blocked`,`expired`],Fx=[`humanReadableReview`,`simulation`,`transactionReviewData`,`ptbVisualization`,`assetFlowActual`,`beforeAfterBalance`];yh();var Ix=B([`client.core.simulateTransaction`,`client.transactionExecutionService.simulateTransaction`]),Lx=`ptb-visualization-contract-alpha-2026-05-25`,Rx=[`proposedAction`,`assetFlow`,`recipients`,`targets`,`evidenceUsed`,`missingEvidence`,`requiredUserChoices`,`unsupportedClaims`,`freshness`,`blockingChecks`],zx=[`effects`,`balanceChanges`,`objectTypes`,`transaction`],Bx=[`transaction_bytes`,`serialized_transaction`,`wallet_signature_request`,`private_key_material`,`wallet_authorization`,`signing_data`,`signing_readiness`,`payment_execution_readiness`],Vx=[`transaction_building_input`,`wallet_authorization`,`signing_data`,`signing_readiness`,`payment_execution_readiness`,`route_recommendation`],Hx=ub,Ux=`MIST`,Wx=[`checkedAt`,`expiresAt`],Gx=[`checkedAt`,`expiryStatus`],Kx=[`rawAmount`,`asset`,`amountRole`],qx=[`minOutRaw`,`asset`,`amountRole`],Jx=[`gasBudgetRaw`,`asset`,`amountRole`],Yx=[`gasUsedRaw`,`asset`,`amountRole`],Xx=[`checkedAt`,`gasResolutionStatus`,`unresolvedReason`],Zx=[`balanceChanges`,`asset`,`amountRole`],Qx=[`coinType`,`decimals`],$x=[`quoteEvidenceId`,`minOutRaw`],eS=[`maxSlippageBps`,`userSelection`],tS=[`maxSlippageBps`,`minOutRaw`],nS=[`ownerAccount`,`objects`],rS=[`pinned_sdk_registry`,`verified_mainnet_onchain_metadata`,`wallet_account_read`,`quote_evidence`,`review_time_simulation`,`validated_request_fact`,`user_explicit_choice`],iS=[`input`,`expected_output`,`minimum_output`,`gas_budget`,`gas_used`,`fee`,`balance_delta`],aS={input:{kinds:[`validated_request_fact`,`wallet_account_read`,`user_explicit_choice`],fields:Kx},expected_output:{kinds:[`quote_evidence`,`review_time_simulation`],fields:Kx},minimum_output:{kinds:[`quote_evidence`],fields:qx},gas_budget:{kinds:[`review_time_simulation`],fields:Jx},gas_used:{kinds:[`review_time_simulation`],fields:Yx},fee:{kinds:[`review_time_simulation`],fields:Kx},balance_delta:{kinds:[`review_time_simulation`],fields:Zx}},oS={pinned_sdk_metadata:{kinds:[`pinned_sdk_registry`],fields:Qx},verified_mainnet_onchain_metadata:{kinds:[`verified_mainnet_onchain_metadata`],fields:Qx}},sS={user_explicit:{kinds:[`user_explicit_choice`],fields:eS},adapter_policy_from_quote_evidence:{kinds:[`quote_evidence`],fields:tS}},cS={kinds:[`review_time_simulation`],fields:Xx},lS={kinds:[`quote_evidence`],fields:$x},uS={kinds:[`validated_request_fact`],fields:Wx},dS={kinds:[`validated_request_fact`],fields:Gx},fS={raw_quantity_amount:{byRole:aS},unit_metadata:{bySource:oS},gas_unresolved_status:cS,expiry_status:{current:uS,expired:uS,not_provided:dS,not_applicable:dS},quote_min_out:lS,slippage_policy:{bySource:sS},object_ownership:{kinds:[`wallet_account_read`],fields:nS},simulation_result:{kinds:[`review_time_simulation`],fields:zx}},pS={gasBudgetClaimId:{factKind:`raw_quantity_amount`,role:`gas_budget`,assetCoinType:Hx,rawUnit:Ux},gasUsedClaimId:{factKind:`raw_quantity_amount`,role:`gas_used`,assetCoinType:Hx,rawUnit:Ux},gasObjectOwnershipClaimId:{factKind:`object_ownership`,ownership:`owned_by_account`}},mS=M().refine(e=>{let t=new Date(e);return!Number.isNaN(t.getTime())&&t.toISOString()===e},`Expected ISO 8601 UTC timestamp`),hS=yb(`unsigned integer`),gS=M().regex(/^0x[0-9a-fA-F]{1,64}$/,{message:`Expected a Sui object id`}),_S=M().min(1).max(512).refine(e=>{try{return Sb(e)===e}catch{return!1}},`Expected a normalized Sui struct tag coin type`),J=M().min(1).max(120),vS=L({symbol:M().min(1).max(64).optional(),coinType:_S}).strict(),yS=/transaction\s*bytes?|tx\s*bytes?|serialized\s*transaction|serializedTransaction|signed\s*transaction|signing\s*request|signingRequest|wallet\s*authorization|walletAuthorization|private\s*key|privateKey|secret\s*key|secretKey|seed\s*phrase|mnemonic|suiprivkey|signature|bcs\s*transaction/i,bS=/(?:0x[0-9a-fA-F]{160,}|[A-Za-z0-9+/_=-]{160,})/;function xS(e,t){return M().min(1).max(e).superRefine((e,n)=>{(yS.test(e)||bS.test(e))&&n.addIssue({code:`custom`,message:`${t} must not contain executable transaction, signing, private-key, mnemonic, or long encoded material`})})}function SS(e,t){let n=new Set(e);return t.filter(e=>!n.has(e))}function CS(e,t,n,r,i){let a=SS(t,n);a.length!==0&&e.addIssue({code:`custom`,path:r,message:`${i} must include ${a.join(`, `)}`})}function wS(e,t,n,r,i){CS(e,t,n,r,i)}function TS(e,t,n){e.addIssue({code:`custom`,path:t,message:`${n} must match referenced evidence claim`})}function Y(e,t,n,r,i){t!==n&&TS(e,r,i)}function ES(e,t,n,r,i){let a=new Set(t),o=new Set(n);if(a.size!==o.size){TS(e,r,i);return}for(let t of a)if(!o.has(t)){TS(e,r,i);return}}function DS(e,t,n,r,i){(t.symbol!==n.symbol||t.coinType!==n.coinType)&&TS(e,r,i)}function OS(e,t,n,r,i){try{Sb(t.coinType)!==n&&TS(e,r,i)}catch{TS(e,r,i)}}var kS=L({kind:B([`natural_language_intent`,`external_proposal`,`mcp_action_request`,`local_review_request`]),sourceId:M().min(1).max(160),capturedAt:mS,authority:V(`untrusted_until_review_regenerates_and_verifies`),userSelectionSource:B([`user_explicit`,`prior_user_explicit_context`]).optional()}).strict(),AS=L({id:J,kind:B(rS),network:V(`sui:mainnet`),source:M().min(1).max(240),verifiedAt:mS,fields:I(M().min(1).max(120)).min(1)}).strict(),jS=ep(`factKind`,[L({id:J,factKind:V(`raw_quantity_amount`),sourceEvidenceId:J,role:B(iS),asset:vS,rawAmount:hS}).strict(),L({id:J,factKind:V(`unit_metadata`),sourceEvidenceId:J,source:B([`pinned_sdk_metadata`,`verified_mainnet_onchain_metadata`]),coinType:_S,decimals:N().int().min(0).max(255)}).strict(),L({id:J,factKind:V(`gas_unresolved_status`),sourceEvidenceId:J,checkedAt:mS,status:V(`unresolved`),reason:M().min(1).max(240)}).strict(),L({id:J,factKind:V(`expiry_status`),sourceEvidenceId:J,checkedAt:mS,status:B([`current`,`expired`,`not_provided`,`not_applicable`]),expiresAt:mS.optional(),reason:M().min(1).max(240).optional()}).strict(),L({id:J,factKind:V(`quote_min_out`),sourceEvidenceId:J,quoteEvidenceId:M().min(1).max(120),minOutRaw:hS}).strict(),L({id:J,factKind:V(`slippage_policy`),sourceEvidenceId:J,policySource:B([`user_explicit`,`adapter_policy_from_quote_evidence`]),maxSlippageBps:N().int().min(0).max(1e4),minOutRaw:hS.optional()}).strict(),L({id:J,factKind:V(`object_ownership`),sourceEvidenceId:J,objectId:gS,ownerAccount:db,ownership:B([`owned_by_account`,`shared_object`,`immutable_or_package`,`not_owned_by_account`])}).strict(),L({id:J,factKind:V(`simulation_result`),sourceEvidenceId:J,provider:Ix,checksEnabled:V(!0),simulatedAt:mS,status:B([`success`,`failed`,`unavailable`]),requiredFields:I(B(zx)).min(zx.length),missingFields:I(B(zx)).default([]),failureReason:M().min(1).max(240).optional()}).strict()]),MS=L({id:J,role:B(iS),asset:vS,rawAmount:hS,unit:L({decimals:N().int().min(0).max(255),source:B([`pinned_sdk_metadata`,`verified_mainnet_onchain_metadata`]),sourceField:M().min(1).max(160),unitClaimId:J}).strict(),amountClaimId:J,displayOnly:L({amountDisplay:M().min(1).max(120),reason:V(`presentation_only_not_signing_input`)}).strict().optional()}).strict(),NS=L({objectId:gS,ownerAccount:db,ownershipClaimId:J}).strict(),PS=L({source:V(`review_time_simulation`),checkedAt:mS,gasBudgetRaw:hS.optional(),gasBudgetClaimId:J.optional(),gasUsedRaw:hS.optional(),gasUsedClaimId:J.optional(),gasObjects:I(NS).optional(),unresolvedReason:M().min(1).max(240).optional(),unresolvedClaimId:J.optional()}).strict().superRefine((e,t)=>{let n=e.gasBudgetRaw!==void 0||e.gasUsedRaw!==void 0;!n&&e.unresolvedReason===void 0&&t.addIssue({code:`custom`,message:`Expected gas evidence or unresolvedReason`}),n&&e.unresolvedReason!==void 0&&t.addIssue({code:`custom`,path:[`unresolvedReason`],message:`Resolved gas quantities must not include unresolvedReason`}),e.gasBudgetRaw!==void 0&&e.gasBudgetClaimId===void 0&&t.addIssue({code:`custom`,path:[`gasBudgetClaimId`],message:`gasBudgetRaw requires gasBudgetClaimId`}),e.gasBudgetRaw===void 0&&e.gasBudgetClaimId!==void 0&&t.addIssue({code:`custom`,path:[`gasBudgetClaimId`],message:`gasBudgetClaimId requires gasBudgetRaw`}),e.gasUsedRaw!==void 0&&e.gasUsedClaimId===void 0&&t.addIssue({code:`custom`,path:[`gasUsedClaimId`],message:`gasUsedRaw requires gasUsedClaimId`}),e.gasUsedRaw===void 0&&e.gasUsedClaimId!==void 0&&t.addIssue({code:`custom`,path:[`gasUsedClaimId`],message:`gasUsedClaimId requires gasUsedRaw`}),e.unresolvedReason!==void 0&&e.unresolvedClaimId===void 0&&t.addIssue({code:`custom`,path:[`unresolvedClaimId`],message:`unresolvedReason requires unresolvedClaimId`}),e.unresolvedReason===void 0&&e.unresolvedClaimId!==void 0&&t.addIssue({code:`custom`,path:[`unresolvedClaimId`],message:`unresolvedClaimId requires unresolvedReason`})}),FS=ep(`status`,[L({checkedAt:mS,status:V(`current`),expiresAt:mS,evidenceClaimId:J}).strict(),L({checkedAt:mS,status:V(`expired`),expiresAt:mS,evidenceClaimId:J}).strict(),L({checkedAt:mS,status:V(`not_provided`),evidenceClaimId:J,reason:M().min(1).max(240),expiresAt:qf().optional()}).strict(),L({checkedAt:mS,status:V(`not_applicable`),evidenceClaimId:J,reason:M().min(1).max(240),expiresAt:qf().optional()}).strict()]).superRefine((e,t)=>{e.status===`current`&&Date.parse(e.expiresAt)<=Date.parse(e.checkedAt)&&t.addIssue({code:`custom`,path:[`expiresAt`],message:`Current expiry evidence requires expiresAt after checkedAt`}),e.status===`expired`&&Date.parse(e.expiresAt)>Date.parse(e.checkedAt)&&t.addIssue({code:`custom`,path:[`expiresAt`],message:`Expired expiry evidence requires expiresAt at or before checkedAt`})}),IS=L({status:B([`required_and_verified`,`not_required_for_action`,`missing`,`stale`]),quoteEvidenceId:M().min(1).max(120).optional(),quoteEvidenceClaimId:J.optional(),maxSlippageBps:N().int().min(0).max(1e4).optional(),minOutRaw:hS.optional(),policySource:B([`user_explicit`,`adapter_policy_from_quote_evidence`]).optional(),policyEvidenceClaimId:J.optional()}).strict().superRefine((e,t)=>{e.status===`required_and_verified`&&(e.quoteEvidenceId===void 0||e.quoteEvidenceClaimId===void 0||e.maxSlippageBps===void 0||e.minOutRaw===void 0||e.policySource===void 0||e.policyEvidenceClaimId===void 0)&&t.addIssue({code:`custom`,message:`Verified min-out evidence requires quoteEvidenceId, quoteEvidenceClaimId, maxSlippageBps, minOutRaw, policySource, and policyEvidenceClaimId`}),e.quoteEvidenceId!==void 0&&e.quoteEvidenceClaimId===void 0&&t.addIssue({code:`custom`,path:[`quoteEvidenceClaimId`],message:`quoteEvidenceId requires quoteEvidenceClaimId`}),e.quoteEvidenceId===void 0&&e.quoteEvidenceClaimId!==void 0&&t.addIssue({code:`custom`,path:[`quoteEvidenceClaimId`],message:`quoteEvidenceClaimId requires quoteEvidenceId`}),e.minOutRaw!==void 0&&e.quoteEvidenceClaimId===void 0&&t.addIssue({code:`custom`,path:[`quoteEvidenceClaimId`],message:`minOutRaw requires quoteEvidenceClaimId`}),e.maxSlippageBps!==void 0&&e.policySource===void 0&&t.addIssue({code:`custom`,path:[`policySource`],message:`maxSlippageBps requires policySource`}),e.policySource!==void 0&&e.policyEvidenceClaimId===void 0&&t.addIssue({code:`custom`,path:[`policyEvidenceClaimId`],message:`policySource requires policyEvidenceClaimId`}),e.policySource===void 0&&e.policyEvidenceClaimId!==void 0&&t.addIssue({code:`custom`,path:[`policyEvidenceClaimId`],message:`policyEvidenceClaimId requires policySource`})}),LS=L({checkedAt:mS,ownerAccount:db,objects:I(L({objectId:gS,role:B([`input_coin`,`gas_coin`,`protocol_object`,`shared_object`,`receiving_object`]),ownership:B([`owned_by_account`,`shared_object`,`immutable_or_package`,`not_owned_by_account`]),evidenceClaimId:J}).strict()).min(1)}).strict(),RS=L({evidenceClaimId:J,transactionDigest:fb,provider:Ix,checksEnabled:V(!0),simulatedAt:mS,status:B([`success`,`failed`,`unavailable`]),requiredFields:I(B(zx)).min(zx.length),missingFields:I(B(zx)).default([]),failureReason:M().min(1).max(240).optional()}).strict().refine(e=>e.status!==`success`||e.missingFields.length===0,{message:`Successful simulation evidence must not have missing required fields`}).refine(e=>zx.every(t=>e.requiredFields.includes(t)),{message:`Simulation evidence must include every required simulation field`}).refine(e=>e.status===`success`||e.failureReason!==void 0,{message:`Failed or unavailable simulation evidence requires failureReason`}).refine(e=>e.status!==`success`||e.failureReason===void 0,{message:`Successful simulation evidence must not include failureReason`}),zS=L({fields:I(B(Rx)).min(Rx.length),transactionDigest:fb,source:V(`review_model_or_adapter_equivalent`),purpose:V(`human_review_before_wallet_authorization`)}).strict().refine(e=>Rx.every(t=>e.fields.includes(t)),{message:`Human-readable review fields must include every required review field`}),BS=L({runtimeStatus:V(`emitted_pre_handoff`),mcpAndReviewUiMayExpose:I(B([`human_readable_review`,`ptb_visualization_artifact`,`diagnostics`,`status_checks`])).min(1),prohibited:I(B(Bx)).min(1)}).strict().superRefine((e,t)=>{wS(t,e.prohibited,Bx,[`prohibited`],`prohibited`)}),VS=L({schemaVersion:V(1),adapterId:M().min(1).max(120),protocol:M().min(1).max(120),actionKind:M().min(1).max(120),network:V(`sui:mainnet`),inputProvenance:kS,sourceReferences:I(AS).min(1),evidenceClaims:I(jS).min(1),rawQuantities:I(MS).min(1),gas:PS,expiry:FS,slippageOrMinOut:IS,objectOwnership:LS,simulation:RS,humanReadableReview:zS,outputBoundary:BS,reviewedTransactionDigest:fb}).strict().superRefine((e,t)=>{let n=new Set,r=new Map,i=new Map;e.sourceReferences.forEach((e,a)=>{n.has(e.id)&&t.addIssue({code:`custom`,path:[`sourceReferences`,a,`id`],message:`sourceReferences id must be unique: ${e.id}`}),n.add(e.id),r.has(e.id)||(r.set(e.id,e),i.set(e.id,a))});let a=new Set,o=new Map,s=new Map;e.evidenceClaims.forEach((e,n)=>{a.has(e.id)&&t.addIssue({code:`custom`,path:[`evidenceClaims`,n,`id`],message:`evidenceClaims id must be unique: ${e.id}`}),a.add(e.id),o.has(e.id)||(o.set(e.id,e),s.set(e.id,n))});let c=(e,n)=>{if(e===void 0)return;let i=r.get(e);if(i!==void 0)return i;t.addIssue({code:`custom`,path:n,message:`source evidence id must reference sourceReferences[].id: ${e}`})},l=(e,n,r,a)=>{if(e===void 0)return;let o=c(e,r);if(o===void 0)return;let s=i.get(e),l=s===void 0?r:[`sourceReferences`,s];n.kinds.includes(o.kind)||t.addIssue({code:`custom`,path:[...l,`kind`],message:`${a} source kind must be one of ${n.kinds.join(`, `)}`}),CS(t,o.fields,n.fields,[...l,`fields`],`${a} sourceReferences fields`)},u=(e,n,r,i)=>{if(e===void 0){t.addIssue({code:`custom`,path:r,message:`${i} must reference evidenceClaims[].id`});return}let a=o.get(e);if(a===void 0){t.addIssue({code:`custom`,path:r,message:`${i} must reference evidenceClaims[].id: ${e}`});return}if(a.factKind!==n){let a=s.get(e),o=a===void 0?r:[`evidenceClaims`,a,`factKind`];t.addIssue({code:`custom`,path:o,message:`${i} evidence claim factKind must be ${n}`})}return a};if(e.evidenceClaims.forEach((e,n)=>{e.factKind===`raw_quantity_amount`&&l(e.sourceEvidenceId,fS.raw_quantity_amount.byRole[e.role],[`evidenceClaims`,n,`sourceEvidenceId`],`evidenceClaims[${n}].raw_quantity_amount`),e.factKind===`unit_metadata`&&l(e.sourceEvidenceId,fS.unit_metadata.bySource[e.source],[`evidenceClaims`,n,`sourceEvidenceId`],`evidenceClaims[${n}].unit_metadata`),e.factKind===`gas_unresolved_status`&&l(e.sourceEvidenceId,fS.gas_unresolved_status,[`evidenceClaims`,n,`sourceEvidenceId`],`evidenceClaims[${n}].gas_unresolved_status`),e.factKind===`expiry_status`&&(l(e.sourceEvidenceId,fS.expiry_status[e.status],[`evidenceClaims`,n,`sourceEvidenceId`],`evidenceClaims[${n}].expiry_status`),(e.status===`current`||e.status===`expired`)&&e.expiresAt===void 0&&t.addIssue({code:`custom`,path:[`evidenceClaims`,n,`expiresAt`],message:`Current or expired expiry claim requires expiresAt`}),(e.status===`not_provided`||e.status===`not_applicable`)&&e.reason===void 0&&t.addIssue({code:`custom`,path:[`evidenceClaims`,n,`reason`],message:`Unavailable expiry claim requires reason`}),(e.status===`not_provided`||e.status===`not_applicable`)&&e.expiresAt!==void 0&&t.addIssue({code:`custom`,path:[`evidenceClaims`,n,`expiresAt`],message:`Unavailable expiry claim must not include expiresAt`}),e.status===`current`&&e.expiresAt!==void 0&&Date.parse(e.expiresAt)<=Date.parse(e.checkedAt)&&t.addIssue({code:`custom`,path:[`evidenceClaims`,n,`expiresAt`],message:`Current expiry claim requires expiresAt after checkedAt`}),e.status===`expired`&&e.expiresAt!==void 0&&Date.parse(e.expiresAt)>Date.parse(e.checkedAt)&&t.addIssue({code:`custom`,path:[`evidenceClaims`,n,`expiresAt`],message:`Expired expiry claim requires expiresAt at or before checkedAt`})),e.factKind===`quote_min_out`&&l(e.sourceEvidenceId,fS.quote_min_out,[`evidenceClaims`,n,`sourceEvidenceId`],`evidenceClaims[${n}].quote_min_out`),e.factKind===`slippage_policy`&&(l(e.sourceEvidenceId,fS.slippage_policy.bySource[e.policySource],[`evidenceClaims`,n,`sourceEvidenceId`],`evidenceClaims[${n}].slippage_policy`),e.policySource===`adapter_policy_from_quote_evidence`&&e.minOutRaw===void 0&&t.addIssue({code:`custom`,path:[`evidenceClaims`,n,`minOutRaw`],message:`Adapter-derived slippage policy claim requires minOutRaw`})),e.factKind===`object_ownership`&&l(e.sourceEvidenceId,fS.object_ownership,[`evidenceClaims`,n,`sourceEvidenceId`],`evidenceClaims[${n}].object_ownership`),e.factKind===`simulation_result`&&(l(e.sourceEvidenceId,fS.simulation_result,[`evidenceClaims`,n,`sourceEvidenceId`],`evidenceClaims[${n}].simulation_result`),e.status===`success`&&e.missingFields.length!==0&&t.addIssue({code:`custom`,path:[`evidenceClaims`,n,`missingFields`],message:`Successful simulation claim must not have missing required fields`}),zx.every(t=>e.requiredFields.includes(t))||t.addIssue({code:`custom`,path:[`evidenceClaims`,n,`requiredFields`],message:`Simulation claim must include every required simulation field`}),e.status!==`success`&&e.failureReason===void 0&&t.addIssue({code:`custom`,path:[`evidenceClaims`,n,`failureReason`],message:`Failed or unavailable simulation claim requires failureReason`}),e.status===`success`&&e.failureReason!==void 0&&t.addIssue({code:`custom`,path:[`evidenceClaims`,n,`failureReason`],message:`Successful simulation claim must not include failureReason`}))}),e.rawQuantities.forEach((e,n)=>{let r=u(e.amountClaimId,`raw_quantity_amount`,[`rawQuantities`,n,`amountClaimId`],`rawQuantities[${n}].amountClaimId`);r?.factKind===`raw_quantity_amount`&&(Y(t,e.role,r.role,[`rawQuantities`,n,`role`],`rawQuantities[${n}].role`),Y(t,e.rawAmount,r.rawAmount,[`rawQuantities`,n,`rawAmount`],`rawQuantities[${n}].rawAmount`),DS(t,e.asset,r.asset,[`rawQuantities`,n,`asset`],`rawQuantities[${n}].asset`));let i=u(e.unit.unitClaimId,`unit_metadata`,[`rawQuantities`,n,`unit`,`unitClaimId`],`rawQuantities[${n}].unit.unitClaimId`);i?.factKind===`unit_metadata`&&(Y(t,e.unit.source,i.source,[`rawQuantities`,n,`unit`,`source`],`rawQuantities[${n}].unit.source`),Y(t,e.unit.decimals,i.decimals,[`rawQuantities`,n,`unit`,`decimals`],`rawQuantities[${n}].unit.decimals`),e.asset.coinType!==void 0&&Y(t,e.asset.coinType,i.coinType,[`rawQuantities`,n,`asset`,`coinType`],`rawQuantities[${n}].asset.coinType`))}),e.gas.gasBudgetRaw!==void 0){let n=u(e.gas.gasBudgetClaimId,`raw_quantity_amount`,[`gas`,`gasBudgetClaimId`],`gas.gasBudgetClaimId`);n?.factKind===`raw_quantity_amount`&&(Y(t,n.role,pS.gasBudgetClaimId.role,[`gas`,`gasBudgetClaimId`],`gas.gasBudgetClaimId role`),OS(t,n.asset,pS.gasBudgetClaimId.assetCoinType,[`gas`,`gasBudgetClaimId`],`gas.gasBudgetClaimId asset`),Y(t,e.gas.gasBudgetRaw,n.rawAmount,[`gas`,`gasBudgetRaw`],`gas.gasBudgetRaw`))}if(e.gas.gasUsedRaw!==void 0){let n=u(e.gas.gasUsedClaimId,`raw_quantity_amount`,[`gas`,`gasUsedClaimId`],`gas.gasUsedClaimId`);n?.factKind===`raw_quantity_amount`&&(Y(t,n.role,pS.gasUsedClaimId.role,[`gas`,`gasUsedClaimId`],`gas.gasUsedClaimId role`),OS(t,n.asset,pS.gasUsedClaimId.assetCoinType,[`gas`,`gasUsedClaimId`],`gas.gasUsedClaimId asset`),Y(t,e.gas.gasUsedRaw,n.rawAmount,[`gas`,`gasUsedRaw`],`gas.gasUsedRaw`))}if(e.gas.unresolvedReason!==void 0){let n=u(e.gas.unresolvedClaimId,`gas_unresolved_status`,[`gas`,`unresolvedClaimId`],`gas.unresolvedClaimId`);n?.factKind===`gas_unresolved_status`&&(Y(t,n.status,`unresolved`,[`gas`,`unresolvedClaimId`],`gas.unresolvedClaimId status`),Y(t,e.gas.checkedAt,n.checkedAt,[`gas`,`checkedAt`],`gas.checkedAt`),Y(t,e.gas.unresolvedReason,n.reason,[`gas`,`unresolvedReason`],`gas.unresolvedReason`))}e.gas.gasObjects?.forEach((e,n)=>{let r=u(e.ownershipClaimId,`object_ownership`,[`gas`,`gasObjects`,n,`ownershipClaimId`],`gas.gasObjects[${n}].ownershipClaimId`);r?.factKind===`object_ownership`&&(Y(t,e.objectId,r.objectId,[`gas`,`gasObjects`,n,`objectId`],`gas.gasObjects[${n}].objectId`),Y(t,e.ownerAccount,r.ownerAccount,[`gas`,`gasObjects`,n,`ownerAccount`],`gas.gasObjects[${n}].ownerAccount`),Y(t,r.ownership,pS.gasObjectOwnershipClaimId.ownership,[`gas`,`gasObjects`,n,`ownershipClaimId`],`gas.gasObjects[${n}].ownershipClaimId ownership`))});let d=u(e.expiry.evidenceClaimId,`expiry_status`,[`expiry`,`evidenceClaimId`],`expiry.evidenceClaimId`);if(d?.factKind===`expiry_status`&&(Y(t,e.expiry.status,d.status,[`expiry`,`status`],`expiry.status`),Y(t,e.expiry.checkedAt,d.checkedAt,[`expiry`,`checkedAt`],`expiry.checkedAt`),e.expiry.status===`current`||e.expiry.status===`expired`?Y(t,e.expiry.expiresAt,d.expiresAt,[`expiry`,`expiresAt`],`expiry.expiresAt`):Y(t,e.expiry.reason,d.reason,[`expiry`,`reason`],`expiry.reason`)),e.slippageOrMinOut.quoteEvidenceClaimId!==void 0){let n=u(e.slippageOrMinOut.quoteEvidenceClaimId,`quote_min_out`,[`slippageOrMinOut`,`quoteEvidenceClaimId`],`slippageOrMinOut.quoteEvidenceClaimId`);n?.factKind===`quote_min_out`&&(Y(t,e.slippageOrMinOut.quoteEvidenceId,n.quoteEvidenceId,[`slippageOrMinOut`,`quoteEvidenceId`],`slippageOrMinOut.quoteEvidenceId`),Y(t,e.slippageOrMinOut.minOutRaw,n.minOutRaw,[`slippageOrMinOut`,`minOutRaw`],`slippageOrMinOut.minOutRaw`))}if(e.slippageOrMinOut.minOutRaw!==void 0&&(e.rawQuantities.some(t=>t.role===`minimum_output`&&t.rawAmount===e.slippageOrMinOut.minOutRaw)||t.addIssue({code:`custom`,path:[`slippageOrMinOut`,`minOutRaw`],message:`slippageOrMinOut.minOutRaw must match a minimum_output rawQuantities entry`})),e.slippageOrMinOut.policyEvidenceClaimId!==void 0){let n=u(e.slippageOrMinOut.policyEvidenceClaimId,`slippage_policy`,[`slippageOrMinOut`,`policyEvidenceClaimId`],`slippageOrMinOut.policyEvidenceClaimId`);n?.factKind===`slippage_policy`&&(Y(t,e.slippageOrMinOut.policySource,n.policySource,[`slippageOrMinOut`,`policySource`],`slippageOrMinOut.policySource`),Y(t,e.slippageOrMinOut.maxSlippageBps,n.maxSlippageBps,[`slippageOrMinOut`,`maxSlippageBps`],`slippageOrMinOut.maxSlippageBps`),n.policySource===`adapter_policy_from_quote_evidence`&&Y(t,e.slippageOrMinOut.minOutRaw,n.minOutRaw,[`slippageOrMinOut`,`minOutRaw`],`slippageOrMinOut.minOutRaw`))}e.objectOwnership.objects.forEach((n,r)=>{let i=u(n.evidenceClaimId,`object_ownership`,[`objectOwnership`,`objects`,r,`evidenceClaimId`],`objectOwnership.objects[${r}].evidenceClaimId`);i?.factKind===`object_ownership`&&(Y(t,n.objectId,i.objectId,[`objectOwnership`,`objects`,r,`objectId`],`objectOwnership.objects[${r}].objectId`),Y(t,e.objectOwnership.ownerAccount,i.ownerAccount,[`objectOwnership`,`ownerAccount`],`objectOwnership.ownerAccount`),Y(t,n.ownership,i.ownership,[`objectOwnership`,`objects`,r,`ownership`],`objectOwnership.objects[${r}].ownership`))});let f=u(e.simulation.evidenceClaimId,`simulation_result`,[`simulation`,`evidenceClaimId`],`simulation.evidenceClaimId`);f?.factKind===`simulation_result`&&(Y(t,e.simulation.provider,f.provider,[`simulation`,`provider`],`simulation.provider`),Y(t,e.simulation.checksEnabled,f.checksEnabled,[`simulation`,`checksEnabled`],`simulation.checksEnabled`),Y(t,e.simulation.simulatedAt,f.simulatedAt,[`simulation`,`simulatedAt`],`simulation.simulatedAt`),Y(t,e.simulation.status,f.status,[`simulation`,`status`],`simulation.status`),ES(t,e.simulation.requiredFields,f.requiredFields,[`simulation`,`requiredFields`],`simulation.requiredFields`),ES(t,e.simulation.missingFields,f.missingFields,[`simulation`,`missingFields`],`simulation.missingFields`),Y(t,e.simulation.failureReason,f.failureReason,[`simulation`,`failureReason`],`simulation.failureReason`))}).superRefine((e,t)=>{let n=e.reviewedTransactionDigest;Y(t,e.humanReadableReview.transactionDigest,n,[`humanReadableReview`,`transactionDigest`],`humanReadableReview.transactionDigest`),Y(t,e.simulation.transactionDigest,n,[`simulation`,`transactionDigest`],`simulation.transactionDigest`)}),HS=L({contractVersion:V(Lx),artifactKind:V(`ptb_visualization`),generatedAt:mS,source:L({adapterId:M().min(1).max(120),planId:M().min(1).max(120).optional(),sourceKind:B([`review_time_generated_transaction_kind`,`review_time_ir`,`renderer_model`]),authority:V(`visualization_only_not_wallet_authorization`),renderer:L({name:M().min(1).max(120),packageName:M().min(1).max(120).optional(),version:M().min(1).max(80).optional()}).strict().optional()}).strict(),mermaid:L({diagramType:V(`flowchart`),text:xS(2e4,`mermaid.text`),namedText:xS(2e4,`mermaid.namedText`)}).strict(),diagnostics:I(L({severity:B([`info`,`warning`,`error`]),code:M().min(1).max(120),message:xS(512,`diagnostics.message`),source:B([`adapter`,`renderer`,`schema`,`simulation`])}).strict()).default([]),unsupportedUse:I(B(Vx)).min(1),executableMaterial:L({included:V(!1),policy:V(`mcp_and_review_ui_outputs_must_not_include_executable_transaction_material`)}).strict()}).strict().superRefine((e,t)=>{wS(t,e.unsupportedUse,Vx,[`unsupportedUse`],`unsupportedUse`)});yh();var US=z(M(),F()),WS=B(Mx),GS=B(Nx);B([`ready_for_wallet_review`,`refresh_required`,`blocked`]);var KS=B(Px);B([`proposed`,`awaiting_wallet`,`wallet_connected`,`ready_for_wallet_review`,`refresh_required`,`blocked`,`expired`,`awaiting_signature`,`submitting`,`awaiting_chain_result`,`stopped`,`request_failed`,`outcome_unknown`,`completed`]);var qS=L({id:M(),label:M(),status:B([`pass`,`warning`,`fail`]),message:M(),source:B([`registry`,`quote`,`wallet`,`simulation`,`adapter`,`network`,`proposal`])}),JS=M().min(1),YS=`human_readable_review`,XS=`review_time_simulation`,ZS=L({stageCatalogId:M().min(1),adapterId:M(),protocol:M(),actionKind:M(),completedStages:I(JS),missingStages:I(JS)}).strict().superRefine((e,t)=>{let n=QS(e.completedStages);n&&t.addIssue({code:`custom`,path:[`completedStages`],message:`completedStages contains duplicate stage '${n}'`});let r=QS(e.missingStages);r&&t.addIssue({code:`custom`,path:[`missingStages`],message:`missingStages contains duplicate stage '${r}'`});for(let n of e.completedStages)e.missingStages.includes(n)&&t.addIssue({code:`custom`,path:[`missingStages`],message:`stage '${n}' cannot be both completed and missing`})});function QS(e){let t=new Set;for(let n of e){if(t.has(n))return n;t.add(n)}}var $S=L({symbol:M(),amount:M(),coinType:M().optional(),approx:P().optional()}).strict(),eC=$S.extend({amountKind:V(`display_intent`).default(`display_intent`)}),tC=L({outgoing:I(eC),expectedIncoming:I(eC),minimumIncoming:I(eC).optional(),fees:I(eC).optional()}),nC=L({outgoing:I($S),expectedIncoming:I($S),minimumIncoming:I($S).optional(),fees:I($S).optional()}),rC=L({before:I($S),after:I($S),delta:I($S)}),iC=L({computationCostRaw:_b(`computationCostRaw`),storageCostRaw:_b(`storageCostRaw`),storageRebateRaw:_b(`storageRebateRaw`),nonRefundableStorageFeeRaw:_b(`nonRefundableStorageFeeRaw`)}).strict(),aC=L({address:db,coinType:M().min(1).max(512).refine(e=>{try{return Sb(e)===e}catch{return!1}},`Expected a normalized Sui struct tag coin type`),amount:xb(`balanceChanges[].amount`)}).strict(),oC=L({objectId:db,objectType:M().min(1).max(512).optional(),inputState:M().min(1).max(80),outputState:M().min(1).max(80),idOperation:M().min(1).max(80)}).strict(),sC=L({provider:Ix,checksEnabled:P(),success:P(),gasCostSummary:iC.optional(),balanceChanges:I(aC).optional(),objectChanges:I(oC).optional(),error:M().optional()}),cC=sC,lC=sC.extend({checksEnabled:V(!0),success:V(!0),gasCostSummary:iC,balanceChanges:I(aC),objectChanges:I(oC),error:qf().optional()}).strict(),uC=L({role:B([`input`,`expected_output`,`minimum_output`,`fee`]),symbol:M(),coinType:M().min(1).max(512).refine(e=>{try{return Sb(e),!0}catch{return!1}},`Expected a Sui struct tag coin type`),decimals:N().int().min(0).max(255),rawAmount:_b(`rawAmount`),rawAmountSource:V(`quote_policy_evidence`),displayAmount:M().optional(),displayAmountSource:V(`user_display_intent_not_signing_input`).optional()}).strict().superRefine((e,t)=>{e.displayAmount!==void 0&&e.displayAmountSource===void 0&&t.addIssue({code:`custom`,path:[`displayAmountSource`],message:`displayAmountSource is required when displayAmount is present`}),e.displayAmount===void 0&&e.displayAmountSource!==void 0&&t.addIssue({code:`custom`,path:[`displayAmount`],message:`displayAmount is required when displayAmountSource is present`})}),dC=L({role:B([`connected_account`,`output_recipient`]),address:db}).strict(),fC=L({kind:V(`swap_output_asset`),symbol:M(),coinType:M().min(1).max(512).refine(e=>{try{return Sb(e),!0}catch{return!1}},`Expected a Sui struct tag coin type`),protocol:M(),poolKey:M(),direction:B([`base_to_quote`,`quote_to_base`])}).strict(),pC=L({id:M(),label:M(),source:R([B([`registry`,`quote`,`wallet`,`simulation`,`adapter`,`network`,`proposal`]),B([`transaction_material`,`digest_commitment`])]),summary:M()}).strict(),mC=L({id:M(),label:M(),reason:M()}).strict(),hC=L({proposedAction:L({title:M(),summary:M(),actionKind:M(),adapterId:M(),protocol:M(),network:V(`sui:mainnet`)}).strict(),recipients:I(dC),evidenceUsed:I(pC),missingEvidence:I(mC),requiredUserChoices:I(mC),unsupportedClaims:I(mC),freshness:L({status:V(`current`),evaluatedAt:M(),expiresAt:M(),reason:M()}).strict(),blockingChecks:I(qS)}).strict(),gC=L({assetFlow:L({outgoing:I(uC),expectedIncoming:I(uC),minimumIncoming:I(uC),fees:I(uC)}).strict(),targets:I(fC)}).strict(),_C=ep(`kind`,[hC.extend({kind:V(`swap_human_readable_review`)}).merge(gC)]),vC=L({id:M(),actionKind:M(),adapterId:M(),protocol:M(),title:M(),summary:M(),assetFlowPreview:tC,reviewModel:jx.optional(),adapterData:US,createdAt:M(),expiresAt:M().optional(),registryVersion:M().optional(),preliminaryChecks:I(qS).optional()}),yC=L({planId:M(),reviewSessionId:M(),account:db,checks:I(qS),assetFlowActual:nC.optional(),beforeAfterBalance:rC.optional(),simulation:cC.optional(),humanReadableReview:_C.optional(),transactionReviewData:VS.optional(),ptbVisualization:HS.optional(),adapterLifecycle:ZS.optional(),updatedAt:M()}),bC=ep(`status`,[yC.extend({status:V(`ready_for_wallet_review`),evidenceValidity:qf().optional(),blockedReason:qf().optional(),refreshReason:qf().optional()}),yC.extend({status:V(`refresh_required`),evidenceValidity:V(`invalidated`).optional(),refreshReason:GS,blockedReason:qf().optional()}),yC.extend({status:V(`blocked`),evidenceValidity:V(`invalidated`).optional(),blockedReason:WS,refreshReason:qf().optional()})]).superRefine((e,t)=>{if(e.evidenceValidity===`invalidated`)for(let n of Fx)e[n]!==void 0&&t.addIssue({code:`custom`,path:[n],message:`Invalidated review evidence cannot carry current material-derived facts`});let n=e.adapterLifecycle;if(n!==void 0&&xC(e,t),e.humanReadableReview!==void 0&&n===void 0&&t.addIssue({code:`custom`,path:[`humanReadableReview`],message:`humanReadableReview requires adapterLifecycle evidence stage provenance`}),e.simulation!==void 0&&n===void 0&&t.addIssue({code:`custom`,path:[`simulation`],message:`simulation requires adapterLifecycle evidence stage provenance`}),e.ptbVisualization!==void 0){let e=n?.completedStages??[];e.includes(`transaction_material_build_or_verify`)&&e.includes(`digest_commitment`)||t.addIssue({code:`custom`,path:[`ptbVisualization`],message:`ptbVisualization requires completed transaction material and digest commitment lifecycle stages`})}let r=e.status===`ready_for_wallet_review`;e.transactionReviewData!==void 0&&!r&&t.addIssue({code:`custom`,path:[`transactionReviewData`],message:`transactionReviewData is only valid on ready_for_wallet_review`}),e.status===`ready_for_wallet_review`&&n!==void 0&&(e.transactionReviewData===void 0&&t.addIssue({code:`custom`,path:[`transactionReviewData`],message:`ready_for_wallet_review requires an emitted wallet review contract`}),(n===void 0||n.missingStages.length!==0)&&t.addIssue({code:`custom`,path:[`adapterLifecycle`],message:`ready_for_wallet_review requires a completed adapterLifecycle with no missing stages`}),e.humanReadableReview===void 0&&t.addIssue({code:`custom`,path:[`humanReadableReview`],message:`ready_for_wallet_review requires humanReadableReview public evidence`}),e.simulation===void 0&&t.addIssue({code:`custom`,path:[`simulation`],message:`ready_for_wallet_review requires successful simulation public evidence`})),e.status===`blocked`&&(e.blockedReason===`producer_stage_missing`&&n===void 0&&t.addIssue({code:`custom`,path:[`adapterLifecycle`],message:`producer_stage_missing requires adapterLifecycle with at least one missing stage`}),e.blockedReason===`producer_stage_missing`&&n!==void 0&&n.missingStages.length===0&&t.addIssue({code:`custom`,path:[`blockedReason`],message:`producer_stage_missing requires at least one adapterLifecycle.missingStages entry`}),e.blockedReason===`wallet_review_contract_emit_missing`&&e.transactionReviewData!==void 0&&t.addIssue({code:`custom`,path:[`transactionReviewData`],message:`wallet_review_contract_emit_missing requires the wallet review contract to be absent`}),e.blockedReason===`wallet_review_contract_emit_missing`&&n===void 0&&t.addIssue({code:`custom`,path:[`adapterLifecycle`],message:`wallet_review_contract_emit_missing requires adapterLifecycle`}),e.blockedReason===`wallet_review_contract_emit_missing`&&n!==void 0&&n.missingStages.length!==0&&t.addIssue({code:`custom`,path:[`blockedReason`],message:`wallet_review_contract_emit_missing requires a completed adapterLifecycle with no missing stages`}),e.blockedReason===`wallet_review_contract_emit_missing`&&e.evidenceValidity!==`invalidated`&&e.humanReadableReview===void 0&&t.addIssue({code:`custom`,path:[`humanReadableReview`],message:`wallet_review_contract_emit_missing requires humanReadableReview public evidence`}),e.blockedReason===`wallet_review_contract_emit_missing`&&e.evidenceValidity!==`invalidated`&&e.simulation===void 0&&t.addIssue({code:`custom`,path:[`simulation`],message:`wallet_review_contract_emit_missing requires simulation public evidence`}))});function xC(e,t){let n=e.adapterLifecycle;n&&(e.humanReadableReview!==void 0&&SC(t,n,YS,[`humanReadableReview`]),e.simulation!==void 0&&(SC(t,n,XS,[`simulation`]),SC(t,n,YS,[`simulation`]),CC(t,e.simulation,[`simulation`])),n.missingStages.includes(XS)&&e.simulation!==void 0&&t.addIssue({code:`custom`,path:[`simulation`],message:`simulation public evidence cannot be present while review_time_simulation is missing`}),n.missingStages.includes(YS)&&e.humanReadableReview!==void 0&&t.addIssue({code:`custom`,path:[`humanReadableReview`],message:`humanReadableReview public evidence cannot be present while human_readable_review is missing`}))}function SC(e,t,n,r){t.completedStages.includes(n)||e.addIssue({code:`custom`,path:r,message:`${r.join(`.`)} requires completed adapterLifecycle stage '${n}'`}),t.missingStages.includes(n)&&e.addIssue({code:`custom`,path:r,message:`${r.join(`.`)} cannot be present while adapterLifecycle stage '${n}' is missing`})}function CC(e,t,n){lC.safeParse(t).success||e.addIssue({code:`custom`,path:n,message:`simulation public evidence requires a successful checks-enabled review-time simulation projection`})}yh();var wC=L({topic:M().min(1),accounts:I(db).min(1),methods:I(M()),chain:V(Pb),expiresAt:M().datetime(),walletName:M().optional()}).strict(),TC=ep(`status`,[L({topic:M().min(1),version:N().int().positive(),status:V(`present`),session:wC}).strict(),L({topic:M().min(1),version:N().int().positive(),status:B([`absent`,`unusable`])}).strict()]),EC=L({runId:Fb,sequence:N().int().positive(),observedAt:M().datetime()}).strict();EC.extend({sessions:I(TC)}).strict();var DC=L({kind:V(`wallet_service_recovery`),priorRunId:Fb,admittedAt:M().datetime(),updatedAt:M().datetime()}),OC=R([DC.extend({phase:V(`stopping`)}).strict(),DC.extend({phase:V(`starting`),nextRunId:Fb}).strict(),DC.extend({outcome:B([`available`,`failed`,`superseded`,`server_restarted`]),nextRunId:Fb.optional(),message:M().optional()}).strict()]);yh();var kC=`A wallet connection provides account context; it is not a transaction approval or proof of address ownership.`,AC=`Review evidence is not a safety guarantee. Only an explicit card action and wallet approval may authorize this exact transaction.`,jC=Vb.extend({pendingAction:V(`disconnect`).optional()});B([`input_required`,`awaiting_approval`,`disconnect_pending`]);var MC=L({action:V(`connect`),walletRunId:Fb}).strict(),NC=L({action:V(`disconnect`),walletRunId:Fb,connectionId:M().min(1)}).strict(),PC=L({action:V(`use_account`),walletRunId:Fb,connectionId:M().min(1),account:db}).strict(),FC=L({action:B([`prepare_review`,`request_signature`]),connectionId:M().min(1),walletRunId:Fb,account:db,reviewRevision:N().int().nonnegative()}).strict(),IC=R([MC,NC,PC,FC,L({action:B([`cancel`,`stop_connection`,`stop_waiting`,`read_result`])}).strict()]),LC=R([MC,FC.extend({action:V(`prepare_review`)})]),RC=L({kind:B([`connect`,`review`]),mode:B([`connect`,`review`,`review_manage`]),allowedActions:I(B(Wb)),actionRemainingMs:N().int().nonnegative(),nextStateReadAfterMs:N().int().nonnegative().optional(),automaticAction:LC.optional(),observe:P(),walletAvailability:Rb,walletObservation:EC.optional(),runtimeRecovery:OC.optional(),connectionConflict:Hb.optional(),manageableConnectionIds:I(M().min(1)),connectionReconciliationRequired:V(!0).optional(),usableConnectionId:M().min(1).optional(),assetReadAccount:Ub.optional(),acceptedWalletRunId:Fb.optional(),progress:zb,boundary:B([kC,AC]),connections:I(jC),activeAccount:M().optional(),connection:jC.optional(),connectionAction:B([`connect`,`disconnect`]).optional(),review:L({reviewSessionId:M(),plan:vC,reviewRevision:N().int().nonnegative(),status:KS,account:M().optional(),preparing:P(),accountRequestPending:V(!0).optional(),error:M().optional(),state:bC.optional()}).strict().optional(),request:Nb.optional(),receipt:F().optional(),netGasMist:M().regex(/^-?[0-9]+$/).optional(),observationStopped:P().optional()}).strict().superRefine((e,t)=>{let n=e.connections.find(t=>t.connectionId===e.usableConnectionId);e.usableConnectionId&&(!n||n.status!==`connected`||e.walletAvailability.status!==`available`||e.connectionConflict||e.connectionReconciliationRequired||e.connections.some(e=>e.pendingAction||e.status===`awaiting_approval`))&&t.addIssue({code:`custom`,path:[`usableConnectionId`],message:`The usable connection must match current connection facts.`}),(new Set(e.manageableConnectionIds).size!==e.manageableConnectionIds.length||e.manageableConnectionIds.some(t=>!e.connections.some(e=>e.connectionId===t&&!e.pendingAction&&e.status!==`awaiting_approval`)))&&t.addIssue({code:`custom`,path:[`manageableConnectionIds`],message:`Management must name distinct recorded targets without pending operations.`}),e.connectionReconciliationRequired&&(e.usableConnectionId||e.assetReadAccount?.status===`available`||e.allowedActions.some(e=>[`connect`,`use_account`,`prepare_review`,`request_signature`].includes(e)))&&t.addIssue({code:`custom`,path:[`connectionReconciliationRequired`],message:`Unrecorded SDK connections cannot authorize connection or account use.`}),e.assetReadAccount?.status===`available`&&(!n||!n.accounts.includes(e.assetReadAccount.account)||e.activeAccount!==e.assetReadAccount.account)&&t.addIssue({code:`custom`,path:[`assetReadAccount`],message:`The default address must belong to the usable connection and stored selection.`})});function zC(e,t,n=!1){return e.connections.filter(r=>r.connectionId===e.usableConnectionId&&r.accounts.includes(t)&&(!n||r.methods.includes(`sui_signTransaction`)))}var BC=`sui-mcp.local-data`;yh();var VC=16*1024*1024,X=M().uuid(),HC=N().int().nonnegative().safe(),UC=M().regex(/^[a-f0-9]{64}$/),WC=ep(`status`,[L({status:V(`no_file`)}).strict(),L({status:V(`receiving`)}).strict(),L({status:V(`checking`)}).strict(),L({status:V(`check_required`),message:M().min(1)}).strict(),L({status:V(`can_restore`)}).strict(),L({status:V(`cannot_restore`),reason:B([`invalid_backup`,`file_unavailable`,`wallet_request_unsettled`,`operation_busy`,`input_unavailable`,`check_failed`]),message:M().min(1)}).strict()]);L({fileId:X,sha256:UC,totalSize:HC,dataEpoch:HC,userDataRevision:HC,check:WC}).strict();var GC=ep(`kind`,[L({kind:V(`set_endpoint`),endpoint:B([`grpc`,`graphql`]),value:M().min(1)}).strict(),L({kind:V(`restore_endpoint`),endpoint:B([`grpc`,`graphql`])}).strict(),L({kind:B([`clear_read_address`,`export_local_data`,`download_backup`,`import_local_data`,`reset_local_data`,`restart_wallet_service`])}).strict()]),KC=B([`acknowledged`,`not_completed`,`unconfirmed`,`unsupported`]),qC=L({method:V(`ui/download-file`),code:V(-32601)}).strict(),JC=B([`acknowledged`,`cancelled`,`expired`,`server_restarted`,`data_replaced`,`source_unavailable`,`stored_locally`,`local_save_failed`]),YC=L({device:M().regex(/^\d+$/),inode:M().regex(/^\d+$/)}).strict(),XC=B([`not_published`,`target_conflict`,`source_unavailable`,`interrupted`]),ZC=L({status:B([`needs_consent`,`saving`,`saved`,`failed`]),attemptId:X,fileId:X,sha256:UC,totalSize:HC,destination:M(),ownerId:M().min(1),currentSaveAttemptId:X.optional(),attempts:I(L({saveAttemptId:X,previousSaveAttemptId:X.optional(),admittedAt:M().datetime(),allowPossibleCopy:P()}).strict()),sourceIdentity:YC.optional(),savedAt:M().datetime().optional(),failure:XC.optional()}).strict().superRefine((e,t)=>{(e.status===`needs_consent`?e.attempts.length!==0||e.currentSaveAttemptId!==void 0:!e.currentSaveAttemptId||!e.attempts.some(t=>t.saveAttemptId===e.currentSaveAttemptId))&&t.addIssue({code:`custom`,message:`A local save must identify its admitted attempt.`}),(new Set(e.attempts.map(e=>e.saveAttemptId)).size!==e.attempts.length||e.status===`saved`!=(e.savedAt!==void 0)||e.status===`saved`&&!e.sourceIdentity||e.status===`failed`!=(e.failure!==void 0))&&t.addIssue({code:`custom`,message:`Local save evidence must match its state.`})});L({currentAttemptId:X,attempts:I(L({attemptId:X,admittedAt:M().datetime(),previousAttemptId:X.optional(),hostReport:KC.optional(),failure:qC.optional()}).strict()).min(1),readyAt:M().datetime().optional(),expiresAt:M().datetime().optional(),endReason:JC.optional(),localSave:ZC.optional()}).strict().superRefine((e,t)=>{(new Set(e.attempts.map(e=>e.attemptId)).size!==e.attempts.length||!e.attempts.some(t=>t.attemptId===e.currentAttemptId)||e.readyAt===void 0!=(e.expiresAt===void 0))&&t.addIssue({code:`custom`,message:`Download attempts and lifetime must identify one stored snapshot.`}),(e.endReason===`stored_locally`&&e.localSave?.status!==`saved`||e.endReason===`local_save_failed`&&e.localSave?.status!==`failed`||e.attempts.some(e=>e.hostReport===`unsupported`!=(e.failure!==void 0))||e.localSave&&(e.localSave.attemptId!==e.currentAttemptId||!e.attempts.some(t=>t.attemptId===e.currentAttemptId&&t.hostReport===`unsupported`)||e.localSave.status===`saving`&&e.endReason!==void 0||e.localSave.status===`saved`!=(e.endReason===`stored_locally`)))&&t.addIssue({code:`custom`,message:`Local saving requires the current download's unsupported report.`})});var QC=B([`settings_retry_download`,`settings_report_download`,`settings_cancel_download`,`settings_store_backup`]),$C=ep(`action`,[L({action:V(`settings_download_backup`),operationId:X,attemptId:X}).strict(),L({action:V(`settings_retry_download`),operationId:X,fileId:X,previousAttemptId:X,attemptId:X}).strict(),L({action:V(`settings_report_download`),operationId:X,fileId:X,attemptId:X,status:KC,failure:qC.optional()}).strict().refine(e=>e.status===`unsupported`==(e.failure!==void 0),`Only unsupported downloads require the exact method failure.`),L({action:V(`settings_store_backup`),operationId:X,fileId:X,attemptId:X,saveAttemptId:X,previousSaveAttemptId:X.optional(),allowPossibleCopy:P()}).strict(),L({action:V(`settings_cancel_download`),operationId:X,fileId:X,attemptId:X}).strict(),L({action:V(`settings_select`),draft:GC}).strict(),L({action:V(`settings_prepare`),operationId:X}).strict(),L({action:V(`settings_begin_upload`),operationId:X,name:M().min(1),totalSize:HC.max(VC),sha256:UC}).strict(),L({action:V(`settings_upload_chunk`),operationId:X,fileId:X,offset:HC.max(VC),chunkBase64:M()}).strict(),L({action:V(`settings_seal_upload`),operationId:X,fileId:X}).strict(),L({action:V(`settings_confirm`),operationId:X,preparationId:X}).strict(),L({action:V(`settings_back`),operationId:X}).strict(),L({action:V(`settings_cancel`)}).strict()]),ew=L({outcome:B([`completed`,`failed`,`interrupted`,`superseded`]),recordedAt:M().datetime(),message:M().min(1),details:z(M(),F()).optional(),completionScope:V(`backup_snapshot`).optional()}).strict(),tw=L({storedValue:M(),effectiveValue:M(),source:B([`environment`,`local_db`,`builtin_default`]),pendingStoredValue:M().optional(),appliesAfter:V(`mcp_server_restart`).optional()}).strict(),nw=L({endpoint:B([`grpc`,`graphql`]),key:B([`suiGrpcUrl`,`suiGraphqlUrl`]),value:M().min(1),status:B([`saved`,`reset`]),storedValue:M(),effectiveValue:M(),source:tw.shape.source}).strict().refine(e=>e.key===(e.endpoint===`grpc`?`suiGrpcUrl`:`suiGraphqlUrl`),`The endpoint kind and preference key must agree.`),rw=N().int().nonnegative().safe(),iw=L({accounts:rw,reviewSessions:rw,reviewStateSnapshots:rw,reviewStatusTransitions:rw,reviewExecutions:rw,reviewRequests:rw,outcomeUnknownRequests:rw,externalActivityScans:rw,externalActivityTransactions:rw,localSettings:rw}).strict(),aw=L({status:V(`valid`),format:V(BC),network:V(`mainnet`),exportedAt:M().datetime(),currentCounts:iw,incomingCounts:iw,willReplace:V(!0),activeAccountChange:B([`unchanged`,`set`,`cleared`]),currentReadAddress:db.nullable(),incomingReadAddress:db.nullable(),restartRequiredAfterImport:P()}).strict(),ow=L({kind:V(`settings`),operationId:X,phase:B([`draft`,`uploading`,`sealed`,`prepared`,`executing`,`stopping`,`starting`,`terminal`]),draft:GC.optional(),preparationId:X.optional(),preparation:z(M(),F()).optional(),file:L({fileId:X,displayName:M(),totalSize:HC,receivedSize:HC,sha256:UC,sealed:P(),cleanup:B([`pending`,`complete`,`failed`])}).strict().optional(),download:L({availability:B([`preparing`,`available`,`ended`]),currentAttemptId:X,hostReport:KC.optional(),previousUnconfirmed:P(),endReason:JC.optional(),expiresAt:M().datetime().optional(),remainingMs:HC.optional(),localSave:L({status:B([`needs_consent`,`saving`,`saved`,`failed`]),currentSaveAttemptId:X.optional(),failure:XC.optional(),savedAt:M().datetime().optional()}).strict().optional(),allowedFileActions:I(QC)}).strict().optional(),restoreCheck:WC.optional(),backupLocation:L({directory:M().min(1),filename:M().min(1)}).strict().optional(),result:ew.optional(),temporaryFileCleanup:B([`pending`,`complete`,`failed`]).optional(),priorRunId:X.optional(),nextRunId:X.optional(),supersedesOperationId:X.optional(),supersededByOperationId:X.optional(),allowedActions:I(B($C.options.map(e=>e.shape.action.value))),observe:P(),facts:L({server:L({name:M(),version:M(),network:V(`mainnet`)}).strict(),localSettings:L({suiGrpcUrl:tw,suiGraphqlUrl:tw}).strict(),readAddress:M().optional(),assetReadAccount:Ub,walletAvailability:Rb,connectionReconciliationRequired:V(!0).optional(),observedAt:M().datetime().optional(),counts:iw}).strict().optional()}).strict().superRefine((e,t)=>{if(e.download&&(e.draft?.kind!==`download_backup`||!e.file||e.download.availability===`available`&&(!e.file.sealed||!e.result||e.download.endReason||!e.download.expiresAt)||e.download.availability===`ended`&&!e.download.endReason)&&t.addIssue({code:`custom`,message:`Download delivery must describe its own snapshot and lifetime.`}),e.draft?.kind===`download_backup`&&e.preparation!==void 0&&t.addIssue({code:`custom`,message:`Private download preparation is not public preparation data.`}),e.restoreCheck&&(e.draft?.kind!==`import_local_data`||e.result)&&t.addIssue({code:`custom`,message:`Restore checks belong to an uncompleted import preparation.`}),e.restoreCheck?.status===`can_restore`&&(e.phase!==`prepared`||!e.file?.sealed||!e.allowedActions.includes(`settings_confirm`))&&t.addIssue({code:`custom`,message:`Restore availability requires a sealed file and current confirmation.`}),e.draft?.kind===`import_local_data`&&e.restoreCheck?.status!==`can_restore`&&e.allowedActions.includes(`settings_confirm`)&&t.addIssue({code:`custom`,message:`An unchecked or blocked import cannot offer confirmation.`}),e.restoreCheck?.status===`receiving`&&(!e.file||e.file.sealed||![`draft`,`uploading`].includes(e.phase))&&t.addIssue({code:`custom`,message:`Receiving requires the selected unsealed upload.`}),e.restoreCheck?.status===`check_required`&&(!e.file?.sealed||e.phase!==`sealed`)&&t.addIssue({code:`custom`,message:`A new check requires the same complete sealed upload.`}),e.restoreCheck?.status===`cannot_restore`&&e.restoreCheck.reason===`invalid_backup`&&(e.phase===`prepared`||e.allowedActions.includes(`settings_prepare`))&&t.addIssue({code:`custom`,message:`A rejected backup requires an explicit new selection.`}),e.backupLocation&&!(e.result?.outcome===`completed`&&(e.draft?.kind===`export_local_data`||e.draft?.kind===`download_backup`&&e.download?.localSave?.status===`saved`&&e.download.endReason===`stored_locally`))&&t.addIssue({code:`custom`,message:`A backup location requires its recorded successful export.`}),e.download?.localSave?.status===`saved`&&!e.backupLocation&&t.addIssue({code:`custom`,message:`A saved backup must identify its verified location.`}),e.draft?.kind===`export_local_data`&&e.result?.outcome===`completed`&&typeof e.result.details?.path==`string`&&!e.backupLocation&&t.addIssue({code:`custom`,message:`A recorded backup path must provide its folder and file name.`}),e.temporaryFileCleanup&&!e.result&&t.addIssue({code:`custom`,message:`Cleanup of an applied or ended operation requires its recorded result.`}),(e.phase===`terminal`!=(e.result!==void 0)||e.phase===`terminal`&&(e.observe||e.allowedActions.length))&&t.addIssue({code:`custom`,message:`A terminal Settings result cannot grant input or observation.`}),e.phase===`prepared`&&(!e.preparationId||!e.draft||!e.preparation)&&t.addIssue({code:`custom`,message:`Settings confirmation requires a prepared identity and facts.`}),e.phase===`prepared`&&e.draft?.kind===`import_local_data`&&!aw.safeParse(e.preparation?.preview).success&&t.addIssue({code:`custom`,path:[`preparation`,`preview`],message:`Import confirmation requires the validated current and incoming read context and record counts.`}),e.phase===`prepared`&&(e.draft?.kind===`set_endpoint`||e.draft?.kind===`restore_endpoint`)){let n=nw.safeParse(e.preparation?.endpoint);(!n.success||n.data.endpoint!==e.draft.endpoint||n.data.status!==(e.draft.kind===`set_endpoint`?`saved`:`reset`)||e.draft.kind===`set_endpoint`&&n.data.value!==e.draft.value)&&t.addIssue({code:`custom`,path:[`preparation`,`endpoint`],message:`Endpoint confirmation must name its exact prepared target.`})}e.file&&e.file.receivedSize>e.file.totalSize&&t.addIssue({code:`custom`,message:`Received content exceeds the selected file.`})}),sw=64*1024;function cw(e){return new TextEncoder().encode(JSON.stringify(e)).length}function lw(e){let t=sw-cw(e);return t>0?3*Math.floor(t/4):0}function uw(e){if(!e||typeof e!=`object`)return;let t=structuredClone(e);if(!(t.method!==`tools/call`||t.params?.name!==`ui.act_card`||t.params.arguments?.input?.action!==`settings_upload_chunk`))return t.id=2**53-1,t.params.arguments.revision=2**53-1,t.params.arguments.input.offset=VC,t.params.arguments.input.chunkBase64=``,lw(t)}var dw={uiOpenAccount:`ui.open_account`,uiOpenReceipt:`ui.open_receipt`,uiOpenChart:`ui.open_chart`,uiReadCard:`ui.read_card`,uiSubmitCard:`ui.submit_card`,uiActCard:`ui.act_card`,uiReadSettingsFile:`ui.read_settings_file`,sessionOpenReviewManagement:`session.open_review_management`,readGetServerStatus:`read.get_server_status`,readListSupportedProtocols:`read.list_supported_protocols`,readListDeepbookPools:`read.list_deepbook_pools`,readListDeepbookTokens:`read.list_deepbook_tokens`,readInspectDeepbookOrderbook:`read.inspect_deepbook_orderbook`,readGetDeepbookMidPrice:`read.get_deepbook_mid_price`,readGetDeepbookUsdcPriceHistory:`read.get_deepbook_usdc_price_history`,readGetDeepbookUsdcPriceAtTime:`read.get_deepbook_usdc_price_at_time`,readQuoteDeepbookAction:`read.quote_deepbook_action`,readQuoteDeepbookDisplayAmount:`read.quote_deepbook_display_amount`,readSummarizeDeepbookAccountInventory:`read.summarize_deepbook_account_inventory`,readSummarizeWalletAssets:`read.summarize_wallet_assets`,readClassifyWalletAssets:`read.classify_wallet_assets`,readListSettlementAssetGroups:`read.list_settlement_asset_groups`,readSummarizeSettlementAssetGroupParity:`read.summarize_settlement_asset_group_parity`,readPreviewIntentEvidence:`read.preview_intent_evidence`,readListReviewActivity:`read.list_review_activity`,readSummarizeReviewFunnel:`read.summarize_review_funnel`,readGetReviewSessionDetail:`read.get_review_session_detail`,readInspectSuiTransaction:`read.inspect_sui_transaction`,readScanSuiAccountActivity:`read.scan_sui_account_activity`,readSummarizeSuiActivityScan:`read.summarize_sui_activity_scan`,readScanSuiFunctionActivity:`read.scan_sui_function_activity`,readSummarizeSuiFunctionActivityScan:`read.summarize_sui_function_activity_scan`,readSummarizeSuiAccountActivity:`read.summarize_sui_account_activity`,readGetAccountAssetTimeline:`read.get_account_asset_timeline`,settingsCreateLocalSettingsSession:`settings.create_local_settings_session`,settingsGetLocalSettings:`settings.get_local_settings`,actionPrepareSuiActionReview:`action.prepare_sui_action_review`,actionPrepareExternalProposalReview:`action.prepare_external_proposal_review`,sessionCreateWalletConnection:`session.create_wallet_connection`,sessionGetWalletConnection:`session.get_wallet_connection`,sessionWaitWalletConnection:`session.wait_wallet_connection`,sessionGetInteractionStatus:`session.get_interaction_status`,sessionGetReviewStatus:`session.get_review_status`,sessionGetExecutionResult:`session.get_execution_result`,sessionWaitExecutionResult:`session.wait_execution_result`,accountGetActiveAccount:`account.get_active_account`};yh();var fw=L({connectionId:M().min(1),pairingUri:M().startsWith(`wc:`),expiresAt:M().datetime()}).strict(),pw=B([`account`,`receipt`,`chart`,`connect`,`review`,`settings`]),mw=L({cardId:M().min(1),kind:pw,state:B([`ready`,`running`,`closed`]),revision:N().int().nonnegative(),createdAt:M().datetime(),expiresAt:M().datetime(),input:z(M(),F()),data:F().optional(),reason:B([`completed`,`expired`,`failed`,`server_restarted`,`cancelled`]).optional(),error:M().optional()}).strict().extend({pollAfterMs:N().int().positive(),inputRemainingMs:N().int().nonnegative()}),hw=L({transactionDigest:M().min(1),pureInputs:I(L({index:N().int().nonnegative(),bytes:M().regex(/^0x(?:[0-9a-f]{2})*$/i)}).strict()).refine(e=>new Set(e.map(e=>e.index)).size===e.length,`Duplicate input index.`),ptbGraph:L({mermaid:L({text:M(),namedText:M()}).strict()}).strict().optional()}).strict();yh();var gw=`sui-mcp/card`,_w=`sui-mcp/receipt-display`,vw=`sui-mcp/wallet-display`,yw=`sui-mcp/settings-file`,bw=`suimcp://cards/`,xw=ep(`kind`,[L({kind:V(`account`),status:V(`input_required`),field:V(`account`),message:M().min(1)}).strict(),L({kind:V(`receipt`),status:V(`input_required`),field:V(`digest`),message:M().min(1)}).strict()]),Sw=L({cardId:M().min(1),permission:M().min(1)}).strict();Sw.extend({revision:N().int().nonnegative(),input:z(M(),F())}).strict();var Cw=hw.extend({cardId:M().min(1),revision:N().int().nonnegative(),attemptId:M().min(1).optional()}),ww=fw.extend({cardId:M().min(1),revision:N().int().nonnegative()}),Tw=L({attemptId:M().uuid().optional(),cardId:M().min(1),operationId:M().uuid(),fileId:M().uuid(),offset:N().int().nonnegative().safe(),totalSize:N().int().nonnegative().safe(),sha256:M().regex(/^[a-f0-9]{64}$/),chunkBase64:M()}).strict(),Ew={account:dw.uiOpenAccount,receipt:dw.uiOpenReceipt,chart:dw.uiOpenChart,read:dw.uiReadCard,submit:dw.uiSubmitCard,act:dw.uiActCard,readSettingsFile:dw.uiReadSettingsFile};function Z(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}function Dw(e){return e.kind!==`import_local_data`}function Ow(e,t,n){if(e.kind!==`settings`||t.kind!==`settings`||e.cardId!==t.cardId||t.state!==`ready`)return;let r=ow.safeParse(e.data),i=ow.safeParse(t.data);if(!r.success||!i.success)return;let a=r.data,o=i.data,s=o.draft;if(!s||!a.draft||a.operationId!==o.operationId||n.operationId!==o.operationId||JSON.stringify(a.draft)!==JSON.stringify(s))return;if(Dw(s))return n.action===`settings_prepare`?{kind:`preparation_response`,cardId:t.cardId,operationId:o.operationId,draft:s}:void 0;let c=o.file?.fileId;if(!(!c||!a.file?.fileId||a.file.fileId!==c||n.action!==`settings_prepare`&&n.action!==`settings_seal_upload`||n.action===`settings_seal_upload`&&n.fileId!==c))return{kind:`backup_check_response`,cardId:t.cardId,operationId:o.operationId,fileId:c,action:n.action}}function kw(e,t){let n=Z(e);if(!n)throw Error(`The app did not provide a usable card response.`);if(n.structuredContent!==void 0)return n;if(Array.isArray(n.content))for(let e of n.content){let r=Z(e);if(r?.type!==`text`||typeof r.text!=`string`)continue;let i;try{i=Z(JSON.parse(r.text))}catch{continue}if(i?.ok!==void 0)return{...n,structuredContent:i};if(t===`chatgpt`&&i&&Array.isArray(i.content))return kw(i,void 0)}return n}function Aw(e,t){let n=Z(Z(e?.data)?.request);return!!e&&(e.kind===`receipt`||e.kind===`review`)&&t.cardId===e.cardId&&t.revision===e.revision&&t.transactionDigest===(e.kind===`receipt`?e.input.digest:n?.transactionDigest)&&(e.kind!==`review`||t.attemptId===n?.attemptId)}function jw(e,t){let n;for(let r of Array.isArray(e.content)?e.content:[]){let e=Z(r),i;if(e?.type===`resource_link`&&typeof e.uri==`string`&&e.uri.startsWith(`suimcp://cards/`)&&(i=e.uri),t===`Claude`&&e?.type===`text`&&typeof e.text==`string`){let t=/^\[Resource link: card_([A-Za-z0-9_-]+)\] (suimcp:\/\/cards\/([A-Za-z0-9_-]+)) \(Saved data for this exact card\.\)$/.exec(e.text);if(t){if(t[1]!==t[3])throw Error(`The saved card links could not be matched to one card.`);i=t[2]}}if(i===void 0)continue;let a=i.slice(bw.length);if(!a||encodeURIComponent(a)!==a||n!==void 0&&a!==n||e?.type===`resource_link`&&typeof e.name==`string`&&e.name.startsWith(`card_`)&&e.name!==`card_${a}`)throw Error(`The saved card links could not be matched to one card.`);n=a}return n}function Mw(e){let t=Z(e.structuredContent),n=t?.ok===!0?xw.safeParse(t.data):void 0,r=Z(Z(t?.error)?.details),i=n?.success?void 0:t?.ok===!0?Z(t.data)?.card??t.data:r?.snapshot,a=i===void 0?void 0:mw.parse(i);a?.kind===`settings`&&ow.parse(a.data);let o=Z(e._meta)?.[_w],s=o===void 0?void 0:Cw.parse(o);if(s&&!Aw(a,s))throw Error(`Transaction details do not match this saved result.`);let c=Z(e._meta)?.[vw],l=c===void 0?void 0:ww.parse(c);if(l&&(!a||a.kind!==`connect`||l.cardId!==a.cardId||l.revision!==a.revision||l.connectionId!==Z(Z(a.data)?.connection)?.connectionId))throw Error(`The connection QR code does not match this card.`);return{snapshot:a,display:s,wallet:l,inputRequired:n?.success?n.data:void 0,error:typeof r?.message==`string`?r.message:typeof r?.reason==`string`?r.reason:void 0}}function Nw(e,t){let n=document.getElementById(`app`);if(!n)throw Error(`Card root is unavailable.`);let r=document.createElement(`h1`);r.textContent=t.title;let i=document.createElement(`p`);i.className=`ui-note`,i.setAttribute(`role`,`status`);let a=document.createElement(`p`);a.className=`ui-error`,a.setAttribute(`role`,`alert`);let o=document.createElement(`p`);o.className=`ui-note card-guidance`;let s=document.createElement(`section`),c=document.createElement(`div`);c.className=`card-actions`;let l=document.createElement(`div`);l.className=`card-progress-hint`,l.hidden=!0,n.replaceChildren(r,i,a,s,o,l,c);let u=new Wv({name:`sui-mcp-card`,version:`0.6.0`},{},{autoResize:!0,strict:!0}),d=new AbortController,f=e===`connect`||e===`review`,p=e===`settings`,m=f||p,ee=!1,h,te,ne,g,_,re,v,ie=!1,ae=!1,oe,y,b={status:`unconfirmed`},se,x,ce,S,C,le=`continue`,ue,de,fe=0,pe=0,me,he,ge,_e,w,ve,T,ye,be=!1;function xe(){if(!S||!g)return;let{input:e,basis:t}=S,n=Z(g.data),r=Z(t.data),i=Z(n?.request),a=Z(n?.review),o=Z(n?.connection),s=Z(r?.request),c=Z(r?.connection),l=!!i&&i.attemptId===s?.attemptId,u=!!o&&o.connectionId===c?.connectionId;if(!f)return g.state===`running`||g.reason===`completed`?S.delivery===`rejected`?`past`:`observed`:g.state===`closed`?`past`:`active`;if(e.walletRunId&&e.walletRunId!==Z(n?.walletAvailability)?.walletRunId&&e.walletRunId!==n?.acceptedWalletRunId)return`past`;switch(e.action){case`connect`:if(g.state!==`ready`&&o)return`observed`;if(n?.walletAvailability&&Z(n.walletAvailability)?.status===`available`&&Array.isArray(n.connections)&&n.connections.some(e=>Z(e)?.status===`connected`))return`past`;break;case`prepare_review`:if(typeof a?.reviewRevision==`number`&&typeof e.reviewRevision==`number`&&a.reviewRevision>e.reviewRevision)return a.account===e.account?`observed`:`past`;break;case`request_signature`:if(i?.account===e.account&&i?.reviewRevision===e.reviewRevision)return`observed`;if(typeof a?.reviewRevision==`number`&&typeof e.reviewRevision==`number`&&a.reviewRevision>e.reviewRevision||!i&&a&&a.reviewRevision===e.reviewRevision&&a.account===e.account&&a.status===`refresh_required`&&Z(a.state)?.refreshReason===`review_evidence_stale`&&Array.isArray(n?.allowedActions)&&n.allowedActions.includes(`prepare_review`))return`past`;break;case`cancel`:if(g.reason===`cancelled`)return`observed`;break;case`disconnect`:if(o&&o.connectionId===e.connectionId&&(o.pendingAction===`disconnect`||g.state!==`ready`&&o.status===`disconnected`))return`observed`;break;case`use_account`:if(g.reason===`completed`&&n?.activeAccount===e.account&&o?.connectionId===e.connectionId)return`observed`;break;case`stop_connection`:if(u&&o?.status===`stopped`)return`observed`;if(u&&o?.status!==`awaiting_approval`)return`past`;break;case`stop_waiting`:if(l&&(i?.requestStatus===`stopped`||n?.observationStopped===!0))return`observed`;if(l&&[`completed`,`request_failed`,`outcome_unknown`].includes(String(i?.requestStatus)))return`past`;break;case`read_result`:if(l&&(n?.observe===!0||i?.requestStatus===`completed`))return`observed`;if(l&&[`stopped`,`request_failed`].includes(String(i?.requestStatus)))return`past`;break}return Se()||typeof n?.actionRemainingMs==`number`&&n.actionRemainingMs<=0||[`connect`,`disconnect`,`use_account`,`cancel`,`prepare_review`,`request_signature`].includes(String(e.action))&&(g.state!==`ready`||a?.status===`expired`)?`past`:`active`}function Se(){let e=IC.safeParse(S?.input);if(!e.success||e.data.action!==`disconnect`&&e.data.action!==`use_account`)return!1;let t=e.data,n=RC.safeParse(g?.data);if(!n.success)return!1;let r=n.data.connections.find(e=>e.connectionId===t.connectionId);return r?t.action===`disconnect`?n.data.walletAvailability.status===`available`&&!r.pendingAction&&!n.data.manageableConnectionIds.includes(t.connectionId)&&[`disconnected`,`failed`,`rejected`,`stopped`,`expired`].includes(r.status):[`disconnected`,`failed`,`rejected`,`stopped`,`expired`].includes(r.status)||t.action===`use_account`&&r.status===`connected`&&!r.accounts.includes(t.account):!1}function Ce(){if(!S)return;let e=xe();e&&S.disposition!==`observed`&&(e!==`active`||S.disposition===`active`)&&(S.disposition=e),S.disposition===`observed`&&(S.retryRequired=!1)}function we(){let e=LC.safeParse(Z(g?.data)?.automaticAction);return S?.retryRequired&&e.success&&S.input.action===e.data.action?e.data:void 0}function Te(e){let t={connect:`connection request`,prepare_review:`review update`,request_signature:`wallet approval request`,read_result:`transaction status check`,cancel:`cancellation request`,stop_connection:`request to stop connecting`,stop_waiting:Z(Z(e.basis.data)?.request)?.requestStatus===`awaiting_signature`?`request to stop wallet approval`:`request to stop checking the result`,disconnect:`wallet disconnect request`,use_account:`account selection`};return f?t[String(e.input.action)]??`request`:`data request`}function Ee(e){if(e!==`past`||!S)return;let t=Te(S),n=S.input.action===`read_result`&&Z(Z(g?.data)?.request)?.requestStatus===`outcome_unknown`?` To check this transaction again, ask to open its result in chat.`:``;return`Message from an earlier ${t}: “${S.message}”${n}`}let De,Oe;function ke(){let t=Z(g?.data),n=p?Z(t?.download):void 0,r=Array.isArray(n?.allowedFileActions)?n.allowedFileActions:[],i=[...Array.isArray(t?.allowedActions)?t.allowedActions:[],...r.filter(e=>e===`settings_report_download`||De===void 0||Date.now()<De)],a=e===`review`&&t?.mode===`review`&&!t.request&&!!h&&g?.state===`ready`,o=a&&me!==void 0&&Date.now()>=me,s=document.visibilityState!==`hidden`,c=d.signal.aborted||b.status===`rejected`,l=b.status===`confirmed`,u=S?.disposition,ne=u===`active`,_=S?.retryRequired===!0,re=S?.input.action===`request_signature`&&u===`active`,v=le===`paused`,ae=ve?.pending?.()===!0,oe=ve?.displayRecovery?.(),fe=l&&!c&&!x&&!ae&&!o&&!!h,he=fe&&!C&&!ee&&(!m||!(ue&&(ne||_||v))),ge=LC.safeParse(t?.automaticAction),_e=p?Z(n?.localSave):void 0,w=!!g&&(m?t?.observe===!0||_e?.status===`saving`:g.state===`running`),T=!!te&&ie&&!c&&!ue&&s&&(de===`explicit`||b.status!==`read_failed`&&(de===`background`||b.status===`needed`&&b.automatic)),ye=s&&fe&&!se&&!ue&&!de&&!C&&!_&&!re&&!v&&f&&ge.success&&i.includes(ge.data.action)?ge.data:void 0,be=Z(t?.restoreCheck),xe=p&&fe&&g?.state===`ready`&&!C&&!ee&&!t?.result&&t?.observe!==!0&&(be?.status===`cannot_restore`&&[`operation_busy`,`wallet_request_unsettled`].includes(String(be.reason))||!i.includes(`settings_select`)||!i.includes(`settings_download_backup`)||t?.phase===`prepared`&&!i.includes(`settings_confirm`)||t?.phase===`draft`&&Z(t.draft)?.kind!==void 0&&Z(t.draft)?.kind!==`import_local_data`&&!i.includes(`settings_prepare`)),Se;!c&&te&&(b.status===`read_failed`||se||b.status===`unconfirmed`?Se=`read`:b.status===`needed`?b.automatic||(Se=`read`):x||oe||p&&[`pending`,`failed`].includes(String(t?.temporaryFileCleanup))||_e?.status===`saving`||_e?.status===`needs_consent`&&!i.includes(`settings_store_backup`)||_e?.status===`failed`&&_e.failure===`not_published`&&!n?.endReason&&!i.includes(`settings_store_backup`)||xe?Se=`read`:h?Z(t?.progress)?.status===`unavailable`||Z(t?.walletAvailability)?.status===`initializing`&&Z(t?.walletAvailability)?.stage===`state_sync`?Se=`read`:!v&&we()?Se=`retry`:ne&&!w&&!(v&&i.length>0)&&!(S?.input.action===`prepare_review`&&i.includes(`prepare_review`)&&t?.automaticAction===void 0)&&f&&(Se=`read`):(g?.state!==`closed`||x)&&(Se=`read`));let Ce=f?t?.actionRemainingMs:g?.inputRemainingMs;Se===`retry`&&o&&(Se=`read`);let Oe=f?t?.nextStateReadAfterMs:p&&De!==void 0?Math.max(0,De-pe):void 0,ke=[(f?i.length>0:g?.state===`ready`)?Ce:void 0,Oe].filter(e=>typeof e==`number`&&Number.isFinite(e)&&e>0),Ae=!c&&!!h&&s&&!y&&!se&&b.status!==`read_failed`,je=Z(t?.review),Me=a&&!c&&!se&&!x&&!ne&&!_&&!v&&b.status!==`read_failed`&&(ae||C?.input.action===`prepare_review`||je?.preparing===!0||ge.success&&ge.data.action===`prepare_review`||b.status===`needed`&&je?.status===`ready_for_wallet_review`);return{current:l,inputEnabled:he,permitted:i,disposition:u,read:T,auto:ye,recover:Se,paused:v,partialDisplayFailure:oe,settingsInputBlocked:xe,reviewUpdatePending:Me,reviewCommandDeliveryFailed:ne&&S?.input.action===`prepare_review`,reviewHint:o?void 0:Me?ae||je?.preparing||C?.input.action===`prepare_review`?`Updating review…`:`Checking status…`:a&&Z(je?.state)?.refreshReason===`review_evidence_stale`?`Review details are out of date.`:void 0,errors:[b.status===`rejected`?b.message:b.status===`read_failed`?`This card's status could not be checked. Reported message: “${b.message}”`:void 0,se&&b.status!==`rejected`?`This card could not be opened. Reported message: “${se}”`:void 0,ne&&S?`Message for this ${Te(S)}: “${S.message}”`:void 0,x,oe?.message],note:[ce,Ee(u)].filter(Boolean).join(` `),expiryAt:Ae&&l&&ke.length?pe+Math.min(...ke):void 0,poll:Ae&&(w||b.status===`needed`&&!b.automatic),lifetimeAt:!c&&s&&a?me:void 0}}function Ae(e){return e.recover===`retry`?S?.input.action===`connect`?`Retry connection`:`Retry review`:e.recover===`read`?`Check status`:void 0}function je(e){if(d.signal.aborted)return``;let n=e.errors.some(Boolean)||e.recover!==void 0||!!g&&!h&&g.state!==`closed`||g?.state===`closed`&&g.reason!==`completed`,r=e.errors.some(Boolean)||b.status!==`confirmed`||e.recover===`retry`||e.settingsInputBlocked;if(n&&r&&b.status!==`rejected`){if(ue||e.read)return`Checking status…`;let t=Ae(e);if(t)return t===`Check status`?x||e.partialDisplayFailure?`Use Check status to read this card and try displaying it again.`:`Use Check status to read this card again.`:t===`Retry connection`?`Use Retry connection to try connecting your wallet again.`:`Use Retry review to try again with the displayed wallet and account.`;if(Me(e)&&ve?.selectionHint)return ve.selectionHint}return t.guidance?.(g,{confirmed:e.current,readOnly:!h,recoveryNeeded:n,visibleConfirmation:ve?.visibleConfirmation?.(),commandPending:m&&C&&e.current&&!e.errors.some(Boolean)&&(C.phase===`confirming`||g?.state===`ready`&&!Z(g.data)?.runtimeRecovery&&!Z(g.data)?.request&&!Z(Z(g.data)?.review)?.preparing)?{phase:C.phase,action:String(C.input.action)}:void 0,approvalUnresolved:S?.input.action===`request_signature`&&e.disposition===`active`||C?.input.action===`request_signature`,automaticPaused:e.paused})??``}function Me(e=ke()){return e.inputEnabled&&g?.state===`ready`&&be}function Ne(e,t=ke()){return m&&t.inputEnabled&&(e?t.permitted.includes(e.action):t.permitted.length>0)}function E(e){let t=ke();return p&&ee&&t.current&&!!h&&!C&&!ue&&!x&&!d.signal.aborted&&[`settings_begin_upload`,`settings_upload_chunk`,`settings_seal_upload`,`settings_retry_download`,`settings_report_download`,`settings_cancel_download`,`settings_store_backup`].includes(String(e.action))&&t.permitted.includes(e.action)}function Pe(e){let u=Z(g?.data),f=s.querySelector(`.review-action-feedback`),te=s.querySelector(`.review-primary-action`);if(te&&f){let e=s.querySelector(`.review-lifetime`);e?(e.append(l),f.prepend(a)):f.prepend(l,a),f.append(o)}else n.insertBefore(a,s),n.insertBefore(l,c),n.insertBefore(o,l);a.className=te?`ui-note`:`ui-error`,g?(r.textContent=t.titleFor?.(g)??t.title,i.textContent=b.status===`rejected`?`Card unavailable`:!e.current&&g.state===`ready`?te?``:!d.signal.aborted&&(ue||e.read)?`Checking whether actions are available in this card…`:`Actions are unavailable until this card's status is checked.`:!h&&g.state!==`closed`?`View only.`:m?Z(u?.progress)?.status===`unavailable`?`Current progress is unavailable. The last recorded state is shown.`:!u?.request&&g.state===`closed`&&[`expired`,`server_restarted`,`cancelled`].includes(g.reason??``)?`This card no longer accepts actions.`:``:g.state===`running`?`Reading the requested data…`:g.reason===`completed`?``:g.error??(g.reason===`expired`?`The time to make a selection has ended.`:g.reason===`server_restarted`?`This request ended when Sui MCP restarted.`:``)):i.textContent=y?``:b.status===`read_failed`?`Card status unavailable`:se||b.status===`rejected`?`Card unavailable`:`Opening card…`,i.hidden=!i.textContent,a.textContent=[...new Set(e.errors.filter(Boolean))].join(` `),a.hidden=!a.textContent;let ne=s.querySelector(`.review-status`);ne&&(ne.hidden=!!te&&(e.reviewUpdatePending||!!a.textContent));let _=s.querySelector(`.review-material-status`);if(_&&(_.textContent=_.dataset.previous===`true`||!e.current||e.reviewUpdatePending?_.dataset.previousLabel??``:_.dataset.currentLabel??``),o.textContent=[e.note,je(e)].filter(Boolean).join(` `),o.hidden=!o.textContent,be)for(let t of s.querySelectorAll(`input, button, select`))(!m||t.tagName!==`BUTTON`||t.dataset.cardAction!==void 0)&&(t.disabled=m?!Ne(void 0,e):!Me(e));if(m)for(let t of s.querySelectorAll(`[data-card-action]`))t.disabled=!Ne({action:t.dataset.cardAction},e);if(p)for(let t of s.querySelectorAll(`[data-settings-file-action]`))t.disabled=t.dataset.settingsLocalBlocked===`true`||!(ee?E({action:t.dataset.cardAction}):Ne({action:t.dataset.cardAction},e));te&&(e.reviewUpdatePending||te.dataset.cardAction===`request_signature`&&e.reviewCommandDeliveryFailed||te.dataset.cardAction===void 0)&&(te.disabled=!0),w&&(w.disabled=!!C||!!ue)}function Fe(e){try{e?.()}catch{x=`The card display could not be closed cleanly. Its stored information is unchanged.`}}function Ie(e){if(!g||d.signal.aborted)return;if(g.state===`ready`&&b.status!==`confirmed`){if(p&&ve?.update)try{ve.update(g,{automaticPaused:le===`paused`,settings:D,settingsCommandProgress:void 0,onDisplayChange:()=>Ve()})}catch{x=`This card could not be displayed. Its stored information is unchanged.`}return}if(g.state===`running`&&!m){x=void 0;return}let n=m?{...Z(g.data),actionRemainingMs:void 0,nextStateReadAfterMs:void 0,...p&&Z(g.data)?.download?{download:{...Z(Z(g.data)?.download),remainingMs:void 0}}:{}}:void 0,r=p&&C?.phase===`sending`&&b.status===`confirmed`?Ow(C.basis,g,C.input):void 0,i=`${le===`paused`}:${JSON.stringify(r)}:${g.revision}:${h!==void 0}:${_!==void 0}:${v!==void 0}:${JSON.stringify(n)}`;if(i===T||i===ye&&!e)return;ye=i;let a=[...s.children],o=new Set([...s.querySelectorAll(`details`)].filter(e=>e.open).map(e=>e.querySelector(`summary`)?.textContent)),c,l=!1,u=!1;try{let e={automaticPaused:le===`paused`,onDisplayChange:()=>Ve(),...p?{settings:D,settingsCommandProgress:r}:{}};if(ve?.update?.(g,e)){T=i,x=void 0;return}if(g.state===`ready`&&h){let n=t.controls(g,e=>{Je(e)},_,v,e);c=`node`in n?n:{node:n},l=!0}else (m||g.reason===`completed`)&&g.data!==void 0&&(c=t.result(g,_,h?e=>{Je(e)}:void 0,v,e));s.replaceChildren(...c?[c.node]:[]),u=!0,c?.mount?.();for(let e of s.querySelectorAll(`details`))o.has(e.querySelector(`summary`)?.textContent)&&(e.open=!0)}catch{u&&s.replaceChildren(...a),Fe(c?.dispose),x=`This card could not be displayed. Its stored information is unchanged.`;return}let f=ve?.dispose;ve=c,be=l,T=i,x=void 0,Fe(f)}function Le(t,n,r,i,a){if(d.signal.aborted||b.status===`rejected`)return!1;if(t.kind!==e||t.cardId!==te)throw b={status:`rejected`,message:`The returned information does not match this card.`},Error(`The returned information does not match this card.`);let o=Z(t.data),s=Z(o?.request),c=Z(s?.execution),l=o?.automaticAction===void 0?void 0:LC.safeParse(o.automaticAction);if(l&&!l.success)throw Error(`This card could not start the next step.`);if(g&&t.revision<g.revision)return!1;if(ne&&[...new Set([...Object.keys(ne),...Object.keys(t.input)])].some(e=>JSON.stringify(t.input[e])!==JSON.stringify(ne[e])))throw b={status:`rejected`,message:`The returned information does not match this card.`},Error(`The returned information does not match this card.`);if(e===`review`&&(Z(o?.review)?.reviewSessionId!==void 0&&Z(o?.review)?.reviewSessionId!==t.input.reviewSessionId||s&&(s.reviewSessionId!==t.input.reviewSessionId||t.input.attemptId!==void 0&&s.attemptId!==t.input.attemptId)||c&&(c.reviewSessionId!==s?.reviewSessionId||c.attemptId!==s?.attemptId||c.txDigest!==s?.transactionDigest)||Z(o?.receipt)?.status===`found`&&Z(Z(o?.receipt)?.receipt)?.txDigest!==s?.transactionDigest)||e===`receipt`&&o?.status===`found`&&Z(o.receipt)?.txDigest!==t.input.digest)throw b={status:`rejected`,message:`The saved result does not match the information requested in this card.`},Error(b.message);!ne&&(f||t.state!==`ready`)&&(ne={...t.input});let u=r!==`preview`;if((!g||t.revision!==g.revision)&&(_=void 0,v=void 0),g=t,Ce(),u){pe=Date.now();let t=p?Z(o?.download):void 0;if(t?.availability===`available`&&typeof t.remainingMs==`number`&&Number.isFinite(t.remainingMs)){let e=`${o?.operationId}:${Z(o?.file)?.fileId}:${t.expiresAt}`;Oe!==e&&(Oe=e,De=void 0),De=Math.min(De??1/0,pe+Math.max(0,t.remainingMs))}else p&&t?.availability===`ended`&&(De=void 0);h&&e===`review`&&o?.mode===`review`&&!o.request&&typeof o.actionRemainingMs==`number`&&Number.isFinite(o.actionRemainingMs)&&o.actionRemainingMs>=0&&(me=Math.min(me??1/0,pe+o.actionRemainingMs))}return r===`read`&&(b.status!==`needed`||a>b.afterRead)&&(b={status:`confirmed`},se=void 0),n&&(_=n),v=i,!0}function Re(){he!==void 0&&clearTimeout(he),ge!==void 0&&clearTimeout(ge),_e!==void 0&&clearTimeout(_e),he=void 0,ge=void 0,_e=void 0,l.hidden=!0}function ze(e){let t=Ae(e);w?.textContent!==t&&(w?.remove(),w=void 0,t&&(w=qv(t,()=>{if(!(ue||C||d.signal.aborted))if(ke().recover===`retry`){let e=we();e&&qe(e)}else Be()})));let n=s.querySelector(`.review-primary-action`),r=s.querySelector(`.review-primary-slot`);n&&(n.hidden=!!w&&!!r),w&&(w.disabled=!!ue||!!C,r?(w.classList.add(`review-recovery-action`),r.append(w)):(w.classList.remove(`review-recovery-action`),c.append(w)))}async function Be(){let e=ve,t=e?.displayRecovery?.(),n=await Ue(!0);n?.kind===`accepted`&&g===n.snapshot&&b.status===`confirmed`&&!d.signal.aborted&&document.visibilityState!==`hidden`&&!x&&e===ve&&t&&e?.displayRecovery?.()===t&&(t.retry(),Ve())}function Ve(e=!1){if(y){let e=document.createElement(`p`);e.className=`ui-note`,e.textContent=y,s.replaceChildren(e)}else Ie(e);let t=ke();if(Pe(t),Re(),ze(t),d.signal.aborted||b.status===`rejected`)return;t.expiryAt!==void 0&&(ge=setTimeout(()=>{He(),Ve()},Math.max(0,t.expiryAt-Date.now()))),t.reviewHint&&!a.textContent&&(l.replaceChildren(),l.textContent=t.reviewHint,l.setAttribute(`role`,`status`),l.hidden=!1);let n=s.querySelector(`.review-time-remaining`);if(n&&t.lifetimeAt!==void 0){let e=t.lifetimeAt,r=()=>{if(d.signal.aborted)return;let t=Math.max(0,e-Date.now()),i=Math.ceil(t/1e3);if(n.textContent=t>0?`Review expires in ${Math.floor(i/60)}:${String(i%60).padStart(2,`0`)}`:`Review time elapsed`,t>0)_e=setTimeout(r,Math.min(1e3,t));else{let e=ke();Pe(e),ze(e)}};r()}if(t.poll&&g){let e=pe+g.pollAfterMs-Date.now();he=setTimeout(()=>{Ue(!1)},e>0?e:g.pollAfterMs)}t.read?(de=void 0,We()):t.auto&&(he=setTimeout(()=>{let e=ke().auto;e&&Xe(e,`automatic`)},0))}function He(){b.status!==`rejected`&&b.status!==`read_failed`&&(b={status:`needed`,afterRead:fe,automatic:!0})}function Ue(e){return d.signal.aborted||b.status===`rejected`||!te||!ie?Promise.resolve(void 0):ue?ue.promise:b.status===`read_failed`&&!e?Promise.resolve(void 0):(de=e?`explicit`:`background`,Ve(),ue?.promise??Promise.resolve(void 0))}function We(){let e=++fe,t=performance.now(),n={id:e,promise:Promise.resolve().then(async()=>{try{let n,r,i;if(h){let e=Mw(await Ge(Ew.read,h));if(!e.snapshot)throw Error(e.error??`Saved card data is unavailable.`);if(e.error)throw Error(e.error);n=e.snapshot,r=e.display,i=e.wallet}else{let e=`${bw}${encodeURIComponent(te)}`,t=(await u.readServerResource({uri:e},{signal:d.signal})).contents.find(t=>t.uri===e&&`text`in t);if(!t||!(`text`in t))throw Error(`Saved card data is unavailable.`);n=mw.parse(JSON.parse(t.text));let i=_??re;r=i&&Aw(n,i)?i:void 0}if(d.signal.aborted||b.status===`rejected`)return{kind:`disposed`,id:e};let a=Le(n,r,`read`,i,e);return re=void 0,!a&&b.status===`needed`&&e>b.afterRead&&(b={...b,automatic:!1}),Ve(a),a&&b.status===`confirmed`?{kind:`accepted`,snapshot:n,id:e,requestStartedAt:t}:{kind:`ignored`,id:e}}catch(t){return d.signal.aborted?{kind:`disposed`,id:e}:(b.status!==`rejected`&&(b={status:`read_failed`,message:t instanceof Error?t.message:`Saved card data could not be read. The last displayed result is unchanged.`}),{kind:`failed`,id:e})}}).finally(()=>{ue===n&&(ue=void 0),Ve()})};ue=n,Ve()}async function Ge(e,t){return kw(await u.callServerTool({name:e,arguments:t},{signal:d.signal}),u.getHostVersion()?.name)}function Ke(e,t,n){let r=RC.safeParse(n.data);if(!r.success||!r.data.allowedActions.some(t=>t===e.action))return!1;let i=r.data,a=Z(t.data);return e.walletRunId&&e.walletRunId!==i.walletAvailability.walletRunId?!1:e.action===`connect`?i.allowedActions.includes(`connect`)&&[`connect`,`manage`].includes(String(n.input.intent)):e.action===`prepare_review`||e.action===`request_signature`?i.review?.reviewRevision===e.reviewRevision&&(e.action===`prepare_review`?i.assetReadAccount?.status===`available`?i.assetReadAccount.account:void 0:i.review?.account)===e.account&&zC(i,String(e.account),e.action===`request_signature`).some(t=>t.connectionId===e.connectionId):e.action===`disconnect`?i.manageableConnectionIds.includes(String(e.connectionId))&&i.connections.some(t=>t.connectionId===e.connectionId&&!t.pendingAction):e.action===`use_account`?i.connections.some(t=>t.connectionId===e.connectionId&&t.status===`connected`&&!t.pendingAction&&t.connectionId===i.usableConnectionId&&t.accounts.includes(String(e.account))):i.connection?.connectionId===Z(a?.connection)?.connectionId&&i.request?.attemptId===Z(a?.request)?.attemptId&&i.review?.reviewRevision===Z(a?.review)?.reviewRevision}async function qe(e){if(!g||ue||!Ne(e))return;let t={input:e,basis:g,phase:`confirming`};C=t;let n=await Ue(!1);C===t&&(C=void 0,n?.kind===`accepted`&&g===n.snapshot&&b.status===`confirmed`&&!d.signal.aborted&&document.visibilityState!==`hidden`&&Ke(e,t.basis,n.snapshot)&&Ne(e)?await Xe(e):b.status!==`read_failed`&&b.status!==`rejected`&&!d.signal.aborted&&(ce=`The card state changed. Check the current selection before trying again.`),Ve())}async function Je(e){f&&(S?.disposition===`active`||S?.retryRequired||le===`paused`)?await qe(e):await Xe(e)}function Ye(e,t,n){S={input:e.input,basis:e.basis,message:t,delivery:n,disposition:`active`,retryRequired:e.input.action===`connect`||e.input.action===`prepare_review`},Ce(),[`cancel`,`disconnect`,`stop_connection`,`stop_waiting`,`use_account`].includes(String(e.input.action))&&(le=`paused`),(m||n===`unknown`)&&He()}async function Xe(e,t=`user`){if(!g||!h||(t===`file`?!E(e):m?!Ne(e):!Me()))return;let n={input:e,basis:g,phase:`sending`};C=n,le=`continue`,(t===`user`||S?.disposition!==`past`)&&(S=void 0),ce=void 0,Ve();try{let t=Mw(await Ge(m?Ew.act:Ew.submit,{...h,revision:n.basis.revision,input:e}));if(d.signal.aborted||b.status===`rejected`)return;if(!t.snapshot)throw Error(t.error??`The request could not be confirmed.`);t.error&&Ye(n,t.error,`rejected`),Le(t.snapshot,t.display,`action`,t.wallet)}catch(e){!d.signal.aborted&&b.status!==`rejected`&&(Ye(n,e instanceof Error?e.message:`The request could not be confirmed.`,`unknown`),S&&(S.data=Z(e)?.data))}finally{C===n&&(C=void 0),Ve()}}let D={uploadChunkLimit(e,t){return h?uw({jsonrpc:`2.0`,id:2**53-1,method:`tools/call`,params:{name:Ew.act,arguments:{...h,revision:2**53-1,input:{action:`settings_upload_chunk`,operationId:e,fileId:t,offset:2**53-1,chunkBase64:``}}}})??0:0},async readCurrent(){let e=await Ue(!0);if(e?.kind!==`accepted`)throw Error(`The current Settings selection could not be checked. Use Check status before continuing.`);return{snapshot:e.snapshot,requestStartedAt:e.requestStartedAt}},async act(e,t=!1){if(t?!E(e):!Ne(e))throw Error(`This Settings action is unavailable until its current status has been checked.`);if(await Xe(e,t?`file`:`user`),d.signal.aborted)throw Error(`This card closed before the request finished. Reopen the same conversation to check its status.`);if(S?.input===e){let e=Error(S.message);throw e.data=S.data,e}if(!g)throw Error(`The current Settings status could not be checked.`);return g},setFileTransferActive(e){ee=e,Ve()},async readFile(e){if(!h||!te||!ke().current||d.signal.aborted)throw Error(`Backup read permission is unavailable.`);let t=await Ge(Ew.readSettingsFile,{...h,...e}),n=Tw.parse(Z(t._meta)?.[yw]);if(n.cardId!==te||n.operationId!==e.operationId||n.fileId!==e.fileId||n.offset!==e.offset||n.attemptId!==e.attemptId)throw Error(`The backup response does not match this card's selected file.`);return n},download:async(e,t,n)=>{let r=Z(Z(g?.data)?.download);if(!h||!ke().current||d.signal.aborted||document.visibilityState===`hidden`||r&&(r.currentAttemptId!==n||r.localSave||r.availability!==`available`||De===void 0||Date.now()>=De))throw Error(`This download is no longer available in this card.`);try{return{isError:(await u.downloadFile({contents:[{type:`resource`,resource:{uri:`file:///${encodeURIComponent(e)}`,mimeType:`application/json`,blob:t}}]},{signal:d.signal})).isError}}catch(e){if(e&&typeof e==`object`&&`code`in e&&e.code===-32601)return{unsupported:!0};throw e}}};async function Ze(){if(!(!ie||oe===void 0||ae)){ae=!0;try{let t=kw(oe,u.getHostVersion()?.name),n=Z(t._meta);if(t._meta!==void 0&&!n)throw Error(`This card cannot accept actions with the access information provided by the app.`);let r=n?.[gw];if(r!==void 0){let e=Sw.safeParse(r);if(!e.success)throw Error(`This card cannot accept actions with the access information provided by the app.`);h=e.data}let i=Mw(t);if(i.inputRequired){if(i.inputRequired.kind!==e||h)throw Error(`The app provided inconsistent card input information.`);y=i.inputRequired.message,Ve();return}let a=jw(t,u.getHostVersion()?.name),o=[i.snapshot?.cardId,h?.cardId,a].filter(e=>e!==void 0);if(!o.length)throw Error(`Card data is unavailable.`);if(o.some(e=>e!==o[0])||i.snapshot&&i.snapshot.kind!==e)throw b={status:`rejected`,message:`The returned information does not match this card.`},Error(b.message);te=o[0];let s=i.snapshot;s&&(f||s.state!==`ready`)&&(ne={...s.input}),re=i.display,s&&h&&Le(s,i.display,`preview`,i.wallet),He(),Ve()}catch(e){if(d.signal.aborted)return;se=e instanceof Error?e.message:`Card data could not be read.`,Ve()}}}u.ontoolresult=e=>{if(oe===void 0){oe=e,Ze();return}try{let t=Mw(kw(oe,u.getHostVersion()?.name)).snapshot??g,n=Mw(kw(e,u.getHostVersion()?.name)).snapshot;if(t&&n&&(t.cardId!==n.cardId||t.kind!==n.kind))throw Error(`The app returned a different card.`)}catch{b={status:`rejected`,message:`The returned information does not match this card.`},Ve()}},u.onhostcontextchanged=e=>{e.theme&&(document.documentElement.dataset.theme=e.theme)};let Qe=()=>{document.visibilityState!==`hidden`&&h&&ae&&b.status!==`read_failed`?Ue(!1):Ve()};document.addEventListener?.(`visibilitychange`,Qe),u.onteardown=async()=>{if(d.signal.aborted)return{};d.abort(),C=void 0,document.removeEventListener?.(`visibilitychange`,Qe);let e=ve?.dispose;return ve=void 0,Fe(e),Ve(),{}},u.connect().then(()=>{d.signal.aborted||(ie=!0,document.documentElement.dataset.theme=u.getHostContext()?.theme??`light`,Ze())}).catch(()=>{d.signal.aborted||(se=`Could not connect this card to the app.`,Ve())})}function Q(e){var t=e.width,n=e.height;if(t<0)throw Error(`Negative width is not allowed for Size`);if(n<0)throw Error(`Negative height is not allowed for Size`);return{width:t,height:n}}function Pw(e,t){return e.width===t.width&&e.height===t.height}var Fw=function(){function e(e){var t=this;this._resolutionListener=function(){return t._onResolutionChanged()},this._resolutionMediaQueryList=null,this._observers=[],this._window=e,this._installResolutionListener()}return e.prototype.dispose=function(){this._uninstallResolutionListener(),this._window=null},Object.defineProperty(e.prototype,"value",{get:function(){return this._window.devicePixelRatio},enumerable:!1,configurable:!0}),e.prototype.subscribe=function(e){var t=this,n={next:e};return this._observers.push(n),{unsubscribe:function(){t._observers=t._observers.filter(function(e){return e!==n})}}},e.prototype._installResolutionListener=function(){if(this._resolutionMediaQueryList!==null)throw Error(`Resolution listener is already installed`);var e=this._window.devicePixelRatio;this._resolutionMediaQueryList=this._window.matchMedia(`all and (resolution: ${e}dppx)`),this._resolutionMediaQueryList.addListener(this._resolutionListener)},e.prototype._uninstallResolutionListener=function(){this._resolutionMediaQueryList!==null&&(this._resolutionMediaQueryList.removeListener(this._resolutionListener),this._resolutionMediaQueryList=null)},e.prototype._reinstallResolutionListener=function(){this._uninstallResolutionListener(),this._installResolutionListener()},e.prototype._onResolutionChanged=function(){var e=this;this._observers.forEach(function(t){return t.next(e._window.devicePixelRatio)}),this._reinstallResolutionListener()},e}();function Iw(e){return new Fw(e)}var Lw=function(){function e(e,t,n){this._canvasElement=null,this._bitmapSizeChangedListeners=[],this._suggestedBitmapSize=null,this._suggestedBitmapSizeChangedListeners=[],this._devicePixelRatioObservable=null,this._canvasElementResizeObserver=null,this._canvasElement=e,this._canvasElementClientSize=Q({width:this._canvasElement.clientWidth,height:this._canvasElement.clientHeight}),this._transformBitmapSize=t??(function(e){return e}),this._allowResizeObserver=n?.allowResizeObserver??!0,this._chooseAndInitObserver()}return e.prototype.dispose=function(){var e,t;if(this._canvasElement===null)throw Error(`Object is disposed`);(e=this._canvasElementResizeObserver)==null||e.disconnect(),this._canvasElementResizeObserver=null,(t=this._devicePixelRatioObservable)==null||t.dispose(),this._devicePixelRatioObservable=null,this._suggestedBitmapSizeChangedListeners.length=0,this._bitmapSizeChangedListeners.length=0,this._canvasElement=null},Object.defineProperty(e.prototype,"canvasElement",{get:function(){if(this._canvasElement===null)throw Error(`Object is disposed`);return this._canvasElement},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"canvasElementClientSize",{get:function(){return this._canvasElementClientSize},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bitmapSize",{get:function(){return Q({width:this.canvasElement.width,height:this.canvasElement.height})},enumerable:!1,configurable:!0}),e.prototype.resizeCanvasElement=function(e){this._canvasElementClientSize=Q(e),this.canvasElement.style.width=`${this._canvasElementClientSize.width}px`,this.canvasElement.style.height=`${this._canvasElementClientSize.height}px`,this._invalidateBitmapSize()},e.prototype.subscribeBitmapSizeChanged=function(e){this._bitmapSizeChangedListeners.push(e)},e.prototype.unsubscribeBitmapSizeChanged=function(e){this._bitmapSizeChangedListeners=this._bitmapSizeChangedListeners.filter(function(t){return t!==e})},Object.defineProperty(e.prototype,"suggestedBitmapSize",{get:function(){return this._suggestedBitmapSize},enumerable:!1,configurable:!0}),e.prototype.subscribeSuggestedBitmapSizeChanged=function(e){this._suggestedBitmapSizeChangedListeners.push(e)},e.prototype.unsubscribeSuggestedBitmapSizeChanged=function(e){this._suggestedBitmapSizeChangedListeners=this._suggestedBitmapSizeChangedListeners.filter(function(t){return t!==e})},e.prototype.applySuggestedBitmapSize=function(){if(this._suggestedBitmapSize!==null){var e=this._suggestedBitmapSize;this._suggestedBitmapSize=null,this._resizeBitmap(e),this._emitSuggestedBitmapSizeChanged(e,this._suggestedBitmapSize)}},e.prototype._resizeBitmap=function(e){var t=this.bitmapSize;Pw(t,e)||(this.canvasElement.width=e.width,this.canvasElement.height=e.height,this._emitBitmapSizeChanged(t,e))},e.prototype._emitBitmapSizeChanged=function(e,t){var n=this;this._bitmapSizeChangedListeners.forEach(function(r){return r.call(n,e,t)})},e.prototype._suggestNewBitmapSize=function(e){var t=this._suggestedBitmapSize,n=Q(this._transformBitmapSize(e,this._canvasElementClientSize)),r=Pw(this.bitmapSize,n)?null:n;t===null&&r===null||t!==null&&r!==null&&Pw(t,r)||(this._suggestedBitmapSize=r,this._emitSuggestedBitmapSizeChanged(t,r))},e.prototype._emitSuggestedBitmapSizeChanged=function(e,t){var n=this;this._suggestedBitmapSizeChangedListeners.forEach(function(r){return r.call(n,e,t)})},e.prototype._chooseAndInitObserver=function(){var e=this;if(!this._allowResizeObserver){this._initDevicePixelRatioObservable();return}Bw().then(function(t){return t?e._initResizeObserver():e._initDevicePixelRatioObservable()})},e.prototype._initDevicePixelRatioObservable=function(){var e=this;if(this._canvasElement!==null){var t=zw(this._canvasElement);if(t===null)throw Error(`No window is associated with the canvas`);this._devicePixelRatioObservable=Iw(t),this._devicePixelRatioObservable.subscribe(function(){return e._invalidateBitmapSize()}),this._invalidateBitmapSize()}},e.prototype._invalidateBitmapSize=function(){if(this._canvasElement!==null){var e=zw(this._canvasElement);if(e!==null){var t=this._devicePixelRatioObservable?.value??e.devicePixelRatio,n=this._canvasElement.getClientRects(),r=n[0]===void 0?Q({width:this._canvasElementClientSize.width*t,height:this._canvasElementClientSize.height*t}):Vw(n[0],t);this._suggestNewBitmapSize(r)}}},e.prototype._initResizeObserver=function(){var e=this;this._canvasElement!==null&&(this._canvasElementResizeObserver=new ResizeObserver(function(t){var n=t.find(function(t){return t.target===e._canvasElement});if(!(!n||!n.devicePixelContentBoxSize||!n.devicePixelContentBoxSize[0])){var r=n.devicePixelContentBoxSize[0],i=Q({width:r.inlineSize,height:r.blockSize});e._suggestNewBitmapSize(i)}}),this._canvasElementResizeObserver.observe(this._canvasElement,{box:`device-pixel-content-box`}))},e}();function Rw(e,t){if(t.type===`device-pixel-content-box`)return new Lw(e,t.transform,t.options);throw Error(`Unsupported binding target`)}function zw(e){return e.ownerDocument.defaultView}function Bw(){return new Promise(function(e){var t=new ResizeObserver(function(n){e(n.every(function(e){return`devicePixelContentBoxSize`in e})),t.disconnect()});t.observe(document.body,{box:`device-pixel-content-box`})}).catch(function(){return!1})}function Vw(e,t){return Q({width:Math.round(e.left*t+e.width*t)-Math.round(e.left*t),height:Math.round(e.top*t+e.height*t)-Math.round(e.top*t)})}var Hw=function(){function e(e,t,n){if(t.width===0||t.height===0)throw TypeError(`Rendering target could only be created on a media with positive width and height`);if(this._mediaSize=t,n.width===0||n.height===0)throw TypeError(`Rendering target could only be created using a bitmap with positive integer width and height`);this._bitmapSize=n,this._context=e}return e.prototype.useMediaCoordinateSpace=function(e){try{return this._context.save(),this._context.setTransform(1,0,0,1,0,0),this._context.scale(this._horizontalPixelRatio,this._verticalPixelRatio),e({context:this._context,mediaSize:this._mediaSize})}finally{this._context.restore()}},e.prototype.useBitmapCoordinateSpace=function(e){try{return this._context.save(),this._context.setTransform(1,0,0,1,0,0),e({context:this._context,mediaSize:this._mediaSize,bitmapSize:this._bitmapSize,horizontalPixelRatio:this._horizontalPixelRatio,verticalPixelRatio:this._verticalPixelRatio})}finally{this._context.restore()}},Object.defineProperty(e.prototype,"_horizontalPixelRatio",{get:function(){return this._bitmapSize.width/this._mediaSize.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_verticalPixelRatio",{get:function(){return this._bitmapSize.height/this._mediaSize.height},enumerable:!1,configurable:!0}),e}();function Uw(e,t){var n=e.canvasElementClientSize;if(n.width===0||n.height===0)return null;var r=e.bitmapSize;if(r.width===0||r.height===0)return null;var i=e.canvasElement.getContext(`2d`,t);return i===null?null:new Hw(i,n,r)}var Ww={title:``,visible:!0,hitTestTolerance:3,lastValueVisible:!0,priceLineVisible:!0,priceLineSource:0,priceLineWidth:1,priceLineColor:``,priceLineStyle:2,baseLineVisible:!0,baseLineWidth:1,baseLineColor:`#B2B5BE`,baseLineStyle:0,priceFormat:{type:`price`,precision:2,minMove:.01}},Gw,Kw;function qw(e,t){let n=function(e,t){switch(e){case 0:default:return[];case 1:return[t,t];case 2:return[2*t,2*t];case 3:return[6*t,6*t];case 4:return[t,4*t]}}(t,e.lineWidth);return e.setLineDash(n),n}function Jw(e,t,n,r){e.beginPath();let i=e.lineWidth%2?.5:0;e.moveTo(n,t+i),e.lineTo(r,t+i),e.stroke()}function Yw(e,t){if(!e)throw Error(`Assertion failed`+(t?`: `+t:``))}function Xw(e){if(e===void 0)throw Error(`Value is undefined`);return e}function $(e){if(e===null)throw Error(`Value is null`);return e}function Zw(e){return $(Xw(e))}(function(e){e[e.Simple=0]=`Simple`,e[e.WithSteps=1]=`WithSteps`,e[e.Curved=2]=`Curved`})(Gw||={}),function(e){e[e.Solid=0]=`Solid`,e[e.Dotted=1]=`Dotted`,e[e.Dashed=2]=`Dashed`,e[e.LargeDashed=3]=`LargeDashed`,e[e.SparseDotted=4]=`SparseDotted`}(Kw||={});var Qw=class{constructor(){this.t=[]}i(e,t,n){let r={h:e,l:t,o:!0===n};this.t.push(r)}_(e){let t=this.t.findIndex((t=>e===t.h));t>-1&&this.t.splice(t,1)}u(e){this.t=this.t.filter((t=>t.l!==e))}p(e,t,n){let r=[...this.t];this.t=this.t.filter((e=>!e.o)),r.forEach((r=>r.h(e,t,n)))}v(){return this.t.length>0}m(){this.t=[]}};function $w(e,...t){for(let n of t)for(let t in n)n[t]!==void 0&&Object.prototype.hasOwnProperty.call(n,t)&&![`__proto__`,`constructor`,`prototype`].includes(t)&&(typeof n[t]!=`object`||e[t]===void 0||Array.isArray(n[t])?e[t]=n[t]:$w(e[t],n[t]));return e}function eT(e){return typeof e==`number`&&isFinite(e)}function tT(e){return typeof e==`number`&&e%1==0}function nT(e){return typeof e==`string`}function rT(e){return typeof e==`boolean`}function iT(e){let t=e;if(!t||typeof t!=`object`)return t;let n,r,i;for(r in n=Array.isArray(t)?[]:{},t)t.hasOwnProperty(r)&&(i=t[r],n[r]=i&&typeof i==`object`?iT(i):i);return n}function aT(e){return e!==null}function oT(e){return e===null?void 0:e}var sT=`-apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif`;function cT(e,t,n){return t===void 0&&(t=sT),`${n=n===void 0?``:`${n} `}${e}px ${t}`}var lT=class{constructor(e){this.M={S:1,C:5,k:NaN,P:``,T:``,R:``,D:``,I:0,V:0,B:0,A:0,L:0},this.O=e}N(){let e=this.M,t=this.F(),n=this.W();return e.k===t&&e.T===n||(e.k=t,e.T=n,e.P=cT(t,n),e.A=2.5/12*t,e.I=e.A,e.V=t/12*e.C,e.B=t/12*e.C,e.L=0),e.R=this.H(),e.D=this.U(),this.M}H(){return this.O.N().layout.textColor}U(){return this.O.$()}F(){return this.O.N().layout.fontSize}W(){return this.O.N().layout.fontFamily}};function uT(e){return e<0?0:e>255?255:Math.round(e)||0}function dT(e){return .199*e[0]+.687*e[1]+.114*e[2]}var fT=class{constructor(e,t){this.j=new Map,this.q=e,t&&(this.j=t)}Y(e,t){if(e===`transparent`)return e;let n=this.K(e),r=n[3];return`rgba(${n[0]}, ${n[1]}, ${n[2]}, ${t*r})`}Z(e){let t=this.K(e);return{G:`rgb(${t[0]}, ${t[1]}, ${t[2]})`,X:dT(t)>160?`black`:`white`}}J(e){return dT(this.K(e))}tt(e,t,n){let[r,i,a,o]=this.K(e),[s,c,l,u]=this.K(t),d=[uT(r+n*(s-r)),uT(i+n*(c-i)),uT(a+n*(l-a)),(f=o+n*(u-o),f<=0||f>1?Math.min(Math.max(f,0),1):Math.round(1e4*f)/1e4)];var f;return`rgba(${d[0]}, ${d[1]}, ${d[2]}, ${d[3]})`}K(e){let t=this.j.get(e);if(t)return t;let n=function(e){let t=document.createElement(`div`);t.style.display=`none`,document.body.appendChild(t),t.style.color=e;let n=window.getComputedStyle(t).color;return document.body.removeChild(t),n}(e).match(/^rgba?\s*\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d*\.?\d+))?\)$/);if(!n){if(this.q.length)for(let t of this.q){let n=t(e);if(n)return this.j.set(e,n),n}throw Error(`Failed to parse color: ${e}`)}let r=[parseInt(n[1],10),parseInt(n[2],10),parseInt(n[3],10),n[4]?parseFloat(n[4]):1];return this.j.set(e,r),r}},pT=class{constructor(){this.it=[]}nt(e){this.it=e}st(e,t,n){this.it.forEach((r=>{r.st(e,t,n)}))}},mT=class{st(e,t,n){e.useBitmapCoordinateSpace((e=>this.et(e,t,n)))}},hT=class extends mT{constructor(){super(...arguments),this.rt=null}ht(e){this.rt=e}et({context:e,horizontalPixelRatio:t,verticalPixelRatio:n}){if(this.rt===null||this.rt.lt===null)return;let r=this.rt.lt,i=this.rt,a=Math.max(1,Math.floor(t))%2/2,o=o=>{e.beginPath();for(let s=r.to-1;s>=r.from;--s){let r=i.ot[s],c=Math.round(r._t*t)+a,l=r.ut*n,u=o*n+a;e.moveTo(c,l),e.arc(c,l,u,0,2*Math.PI)}e.fill()};i.ct>0&&(e.fillStyle=i.dt,o(i.ft+i.ct)),e.fillStyle=i.vt,o(i.ft)}};function gT(){return{ot:[{_t:0,ut:0,wt:0,Mt:0}],vt:``,dt:``,ft:0,ct:0,lt:null}}var _T={from:0,to:1},vT=class{constructor(e,t,n){this.gt=new pT,this.bt=[],this.St=[],this.xt=!0,this.O=e,this.Ct=t,this.yt=n,this.gt.nt(this.bt)}kt(e){this.Pt(),this.xt=!0}Tt(){return this.xt&&=(this.Rt(),!1),this.gt}Pt(){let e=this.yt.Dt();e.length!==this.bt.length&&(this.St=e.map(gT),this.bt=this.St.map((e=>{let t=new hT;return t.ht(e),t})),this.gt.nt(this.bt))}Rt(){let e=this.Ct.N().mode===2||!this.Ct.It(),t=this.yt.Vt(),n=this.Ct.Bt(),r=this.O.Et();this.Pt(),t.forEach(((t,i)=>{let a=this.St[i],o=t.At(n),s=t.Lt();!e&&o!==null&&t.It()&&s!==null?(a.vt=o.zt,a.ft=o.ft,a.ct=o.Ot,a.ot[0].Mt=o.Mt,a.ot[0].ut=t.Ft().Nt(o.Mt,s.Wt),a.dt=o.Ht??this.O.Ut(a.ot[0].ut/t.Ft().$t()),a.ot[0].wt=n,a.ot[0]._t=r.jt(n),a.lt=_T):a.lt=null}))}},yT=class extends mT{constructor(e){super(),this.qt=e}et({context:e,bitmapSize:t,horizontalPixelRatio:n,verticalPixelRatio:r}){if(this.qt===null)return;let i=this.qt.Yt.It,a=this.qt.Kt.It;if(!i&&!a)return;let o=Math.round(this.qt._t*n),s=Math.round(this.qt.ut*r);e.lineCap=`butt`,i&&o>=0&&(e.lineWidth=Math.floor(this.qt.Yt.ct*n),e.strokeStyle=this.qt.Yt.R,e.fillStyle=this.qt.Yt.R,qw(e,this.qt.Yt.Zt),function(e,t,n,r){e.beginPath();let i=e.lineWidth%2?.5:0;e.moveTo(t+i,n),e.lineTo(t+i,r),e.stroke()}(e,o,0,t.height)),a&&s>=0&&(e.lineWidth=Math.floor(this.qt.Kt.ct*r),e.strokeStyle=this.qt.Kt.R,e.fillStyle=this.qt.Kt.R,qw(e,this.qt.Kt.Zt),Jw(e,s,0,t.width))}},bT=class{constructor(e,t){this.xt=!0,this.Gt={Yt:{ct:1,Zt:0,R:``,It:!1},Kt:{ct:1,Zt:0,R:``,It:!1},_t:0,ut:0},this.Xt=new yT(this.Gt),this.Jt=e,this.yt=t}kt(){this.xt=!0}Tt(e){return this.xt&&=(this.Rt(),!1),this.Xt}Rt(){let e=this.Jt.It(),t=this.yt.Qt().N().crosshair,n=this.Gt;if(t.mode===2)return n.Kt.It=!1,void(n.Yt.It=!1);n.Kt.It=e&&this.Jt.ti(this.yt),n.Yt.It=e&&this.Jt.ii(),n.Kt.ct=t.horzLine.width,n.Kt.Zt=t.horzLine.style,n.Kt.R=t.horzLine.color,n.Yt.ct=t.vertLine.width,n.Yt.Zt=t.vertLine.style,n.Yt.R=t.vertLine.color,n._t=this.Jt.ni(),n.ut=this.Jt.si()}};function xT(e,t,n,r,i,a){e.fillRect(t+a,n,r-2*a,a),e.fillRect(t+a,n+i-a,r-2*a,a),e.fillRect(t,n,a,i),e.fillRect(t+r-a,n,a,i)}function ST(e,t,n,r,i,a){e.save(),e.globalCompositeOperation=`copy`,e.fillStyle=a,e.fillRect(t,n,r,i),e.restore()}function CT(e,t,n,r,i,a){e.beginPath(),e.roundRect?e.roundRect(t,n,r,i,a):(e.lineTo(t+r-a[1],n),a[1]!==0&&e.arcTo(t+r,n,t+r,n+a[1],a[1]),e.lineTo(t+r,n+i-a[2]),a[2]!==0&&e.arcTo(t+r,n+i,t+r-a[2],n+i,a[2]),e.lineTo(t+a[3],n+i),a[3]!==0&&e.arcTo(t,n+i,t,n+i-a[3],a[3]),e.lineTo(t,n+a[0]),a[0]!==0&&e.arcTo(t,n,t+a[0],n,a[0]))}function wT(e,t,n,r,i,a,o=0,s=[0,0,0,0],c=``){if(e.save(),!o||!c||c===a)return CT(e,t,n,r,i,s),e.fillStyle=a,e.fill(),void e.restore();let l=o/2;var u;CT(e,t+l,n+l,r-o,i-o,(u=-l,s.map((e=>e===0?e:e+u)))),a!==`transparent`&&(e.fillStyle=a,e.fill()),c!==`transparent`&&(e.lineWidth=o,e.strokeStyle=c,e.closePath(),e.stroke()),e.restore()}function TT(e,t,n,r,i,a,o){e.save(),e.globalCompositeOperation=`copy`;let s=e.createLinearGradient(0,0,0,i);s.addColorStop(0,a),s.addColorStop(1,o),e.fillStyle=s,e.fillRect(t,n,r,i),e.restore()}var ET=class{constructor(e,t){this.ht(e,t)}ht(e,t){this.qt=e,this.ei=t}$t(e,t){return this.qt.It?e.k+e.A+e.I:0}st(e,t,n,r){if(!this.qt.It||this.qt.ri.length===0)return;let i=this.qt.R,a=this.ei.G,o=e.useBitmapCoordinateSpace((e=>{let o=e.context;o.font=t.P;let s=this.hi(e,t,n,r),c=s.ai;return s.li?wT(o,c.oi,c._i,c.ui,c.ci,a,c.di,[c.ft,0,0,c.ft],a):wT(o,c.fi,c._i,c.ui,c.ci,a,c.di,[0,c.ft,c.ft,0],a),this.qt.pi&&(o.fillStyle=i,o.fillRect(c.fi,c.mi,c.wi-c.fi,c.Mi)),this.qt.gi&&(o.fillStyle=t.D,o.fillRect(s.li?c.bi-c.di:0,c._i,c.di,c.Si-c._i)),s}));e.useMediaCoordinateSpace((({context:e})=>{let n=o.xi;e.font=t.P,e.textAlign=o.li?`right`:`left`,e.textBaseline=`middle`,e.fillStyle=i,e.fillText(this.qt.ri,n.Ci,(n._i+n.Si)/2+n.yi)}))}hi(e,t,n,r){let{context:i,bitmapSize:a,mediaSize:o,horizontalPixelRatio:s,verticalPixelRatio:c}=e,l=this.qt.pi||!this.qt.ki?t.C:0,u=this.qt.Pi?t.S:0,d=t.A+this.ei.Ti,f=t.I+this.ei.Ri,p=t.V,m=t.B,ee=this.qt.ri,h=t.k,te=n.Di(i,ee),ne=Math.ceil(n.Ii(i,ee)),g=h+d+f,_=t.S+p+m+ne+l,re=Math.max(1,Math.floor(c)),v=Math.round(g*c);v%2!=re%2&&(v+=1);let ie=u>0?Math.max(1,Math.floor(u*s)):0,ae=Math.round(_*s),oe=Math.round(l*s),y=this.ei.Vi??this.ei.Bi??this.ei.Ei,b=Math.round(y*c)-Math.floor(.5*c),se=Math.floor(b+re/2-v/2),x=se+v,ce=r===`right`,S=ce?o.width-u:u,C=ce?a.width-ie:ie,le,ue,de;return ce?(le=C-ae,ue=C-oe,de=S-l-p-u):(le=C+ae,ue=C+oe,de=S+l+p),{li:ce,ai:{_i:se,mi:b,Si:x,ui:ae,ci:v,ft:2*s,di:ie,oi:le,fi:C,wi:ue,Mi:re,bi:a.width},xi:{_i:se/c,Si:x/c,Ci:de,yi:te}}}},DT=class{constructor(e){this.Ai={Ei:0,G:`#000`,Ri:0,Ti:0},this.Li={ri:``,It:!1,pi:!0,ki:!1,Ht:``,R:`#FFF`,gi:!1,Pi:!1},this.zi={ri:``,It:!1,pi:!1,ki:!0,Ht:``,R:`#FFF`,gi:!0,Pi:!0},this.xt=!0,this.Oi=new(e||ET)(this.Li,this.Ai),this.Ni=new(e||ET)(this.zi,this.Ai)}ri(){return this.Fi(),this.Li.ri}Ei(){return this.Fi(),this.Ai.Ei}kt(){this.xt=!0}$t(e,t=!1){return Math.max(this.Oi.$t(e,t),this.Ni.$t(e,t))}Wi(){return this.Ai.Vi??null}Hi(){return this.Ai.Vi??this.Ai.Bi??this.Ei()}Ui(e){this.Ai.Bi=e??void 0}$i(){return this.Fi(),this.Li.It||this.zi.It}ji(){return this.Fi(),this.Li.It}Tt(e){return this.Fi(),this.Li.pi=this.Li.pi&&e.N().ticksVisible,this.zi.pi=this.zi.pi&&e.N().ticksVisible,this.Oi.ht(this.Li,this.Ai),this.Ni.ht(this.zi,this.Ai),this.Oi}qi(){return this.Fi(),this.Oi.ht(this.Li,this.Ai),this.Ni.ht(this.zi,this.Ai),this.Ni}Fi(){this.xt&&(this.Li.pi=!0,this.zi.pi=!1,this.Yi(this.Li,this.zi,this.Ai))}},OT=class extends DT{constructor(e,t,n){super(),this.Jt=e,this.Ki=t,this.Zi=n}Yi(e,t,n){if(e.It=!1,this.Jt.N().mode===2)return;let r=this.Jt.N().horzLine;if(!r.labelVisible)return;let i=this.Ki.Lt();if(!this.Jt.It()||this.Ki.Gi()||i===null)return;let a=this.Ki.Xi().Z(r.labelBackgroundColor);n.G=a.G,e.R=a.X;let o=2/12*this.Ki.k();n.Ti=o,n.Ri=o;let s=this.Zi(this.Ki);n.Ei=s.Ei,e.ri=this.Ki.Ji(s.Mt,i),e.It=!0}},kT=/[1-9]/g,AT=class{constructor(){this.qt=null}ht(e){this.qt=e}st(e,t){if(this.qt===null||!1===this.qt.It||this.qt.ri.length===0)return;let n=e.useMediaCoordinateSpace((({context:e})=>(e.font=t.P,Math.round(t.Qi.Ii(e,$(this.qt).ri,kT)))));if(n<=0)return;let r=t.tn,i=n+2*r,a=i/2,o=this.qt.nn,s=this.qt.Ei,c=Math.floor(s-a)+.5;c<0?(s+=Math.abs(0-c),c=Math.floor(s-a)+.5):c+i>o&&(s-=Math.abs(o-(c+i)),c=Math.floor(s-a)+.5);let l=c+i,u=Math.ceil(0+t.S+t.C+t.A+t.k+t.I);e.useBitmapCoordinateSpace((({context:e,horizontalPixelRatio:n,verticalPixelRatio:r})=>{let i=$(this.qt);e.fillStyle=i.G;let a=Math.round(c*n),o=Math.round(0*r),s=Math.round(l*n),d=Math.round(u*r),f=Math.round(2*n);if(e.beginPath(),e.moveTo(a,o),e.lineTo(a,d-f),e.arcTo(a,d,a+f,d,f),e.lineTo(s-f,d),e.arcTo(s,d,s,d-f,f),e.lineTo(s,o),e.fill(),i.pi){let a=Math.round(i.Ei*n),s=o,c=Math.round((s+t.C)*r);e.fillStyle=i.R;let l=Math.max(1,Math.floor(n)),u=Math.floor(.5*n);e.fillRect(a-u,s,l,c-s)}})),e.useMediaCoordinateSpace((({context:e})=>{let n=$(this.qt),i=0+t.S+t.C+t.A+t.k/2;e.font=t.P,e.textAlign=`left`,e.textBaseline=`middle`,e.fillStyle=n.R;let a=t.Qi.Di(e,`Apr0`);e.translate(c+r,i+a),e.fillText(n.ri,0,0)}))}},jT=class{constructor(e,t,n){this.xt=!0,this.Xt=new AT,this.Gt={It:!1,G:`#4c525e`,R:`white`,ri:``,nn:0,Ei:NaN,pi:!0},this.Ct=e,this.sn=t,this.Zi=n}kt(){this.xt=!0}Tt(){return this.xt&&=(this.Rt(),!1),this.Xt.ht(this.Gt),this.Xt}Rt(){let e=this.Gt;if(e.It=!1,this.Ct.N().mode===2)return;let t=this.Ct.N().vertLine;if(!t.labelVisible)return;let n=this.sn.Et();if(n.Gi())return;e.nn=n.nn();let r=this.Zi();if(r===null)return;e.Ei=r.Ei;let i=n.en(this.Ct.Bt());e.ri=n.rn($(i)),e.It=!0;let a=this.sn.Xi().Z(t.labelBackgroundColor);e.G=a.G,e.R=a.X,e.pi=n.N().ticksVisible}},MT=class{constructor(){this.hn=null,this.an=0}ln(){return this.an}_n(e){this.an=e}Ft(){return this.hn}un(e){this.hn=e}cn(e){return[]}dn(){return[]}It(){return!0}},NT;(function(e){e[e.Normal=0]=`Normal`,e[e.Magnet=1]=`Magnet`,e[e.Hidden=2]=`Hidden`,e[e.MagnetOHLC=3]=`MagnetOHLC`})(NT||={});var PT=class extends MT{constructor(e,t){super(),this.yt=null,this.fn=NaN,this.pn=0,this.vn=!1,this.mn=new Map,this.wn=!1,this.Mn=new WeakMap,this.gn=new WeakMap,this.bn=NaN,this.Sn=NaN,this.xn=NaN,this.Cn=NaN,this.sn=e,this.yn=t,this.kn=((e,t)=>n=>{let r=t(),i=e();if(n===$(this.yt).Pn())return{Mt:i,Ei:r};{let e=$(n.Lt());return{Mt:n.Tn(r,e),Ei:r}}})((()=>this.fn),(()=>this.Sn));let n=((e,t)=>()=>{let n=this.sn.Et().Rn(e()),r=t();return n&&Number.isFinite(r)?{wt:n,Ei:r}:null})((()=>this.pn),(()=>this.ni()));this.Dn=new jT(this,e,n)}N(){return this.yn}In(e,t){this.xn=e,this.Cn=t}Vn(){this.xn=NaN,this.Cn=NaN}Bn(){return this.xn}En(){return this.Cn}An(e,t,n){this.wn||=!0,this.vn=!0,this.Ln(e,t,n)}Bt(){return this.pn}ni(){return this.bn}si(){return this.Sn}It(){return this.vn}zn(){this.vn=!1,this.On(),this.fn=NaN,this.bn=NaN,this.Sn=NaN,this.yt=null,this.Vn(),this.Nn()}Fn(e){if(!this.yn.doNotSnapToHiddenSeriesIndices)return e;let t=this.sn,n=t.Et(),r=null,i=null;for(let n of t.Wn()){let t=n.Un().Hn(e,-1);if(t){if(t.$n===e)return e;(r===null||t.$n>r)&&(r=t.$n)}let a=n.Un().Hn(e,1);if(a){if(a.$n===e)return e;(i===null||a.$n<i)&&(i=a.$n)}}let a=[r,i].filter(aT);if(a.length===0)return e;let o=n.jt(e),s=a.map((e=>Math.abs(o-n.jt(e))));return a[s.indexOf(Math.min(...s))]}jn(e){let t=this.Mn.get(e);t||(t=new bT(this,e),this.Mn.set(e,t));let n=this.gn.get(e);return n||(n=new vT(this.sn,this,e),this.gn.set(e,n)),[t,n]}ti(e){return e===this.yt&&this.yn.horzLine.visible}ii(){return this.yn.vertLine.visible}qn(e,t){this.vn&&this.yt===e||this.mn.clear();let n=[];return this.yt===e&&n.push(this.Yn(this.mn,t,this.kn)),n}dn(){return this.vn?[this.Dn]:[]}Kn(){return this.yt}Nn(){this.sn.Zn().forEach((e=>{this.Mn.get(e)?.kt(),this.gn.get(e)?.kt()})),this.mn.forEach((e=>e.kt())),this.Dn.kt()}Gn(e){return e&&!e.Pn().Gi()?e.Pn():null}Ln(e,t,n){this.Xn(e,t,n)&&this.Nn()}Xn(e,t,n){let r=this.bn,i=this.Sn,a=this.fn,o=this.pn,s=this.yt,c=this.Gn(n);this.pn=e,this.bn=isNaN(e)?NaN:this.sn.Et().jt(e),this.yt=n;let l=c===null?null:c.Lt();return c!==null&&l!==null?(this.fn=t,this.Sn=c.Nt(t,l)):(this.fn=NaN,this.Sn=NaN),r!==this.bn||i!==this.Sn||o!==this.pn||a!==this.fn||s!==this.yt}On(){let e=this.sn.Jn().map((e=>e.Un().Qn())).filter(aT),t=e.length===0?null:Math.max(...e);this.pn=t===null?NaN:t}Yn(e,t,n){let r=e.get(t);return r===void 0&&(r=new OT(this,t,n),e.set(t,r)),r}};function FT(e){return e===`left`||e===`right`}var IT=class e{constructor(e){this.ts=new Map,this.ns=[],this.ss=e}es(e,t){let n=function(e,t){return e===void 0?t:{rs:Math.max(e.rs,t.rs),hs:e.hs||t.hs}}(this.ts.get(e),t);this.ts.set(e,n)}ls(){return this.ss}_s(e){let t=this.ts.get(e);return t===void 0?{rs:this.ss}:{rs:Math.max(this.ss,t.rs),hs:t.hs}}us(){this.cs(),this.ns=[{ds:0}]}fs(e){this.cs(),this.ns=[{ds:1,Wt:e}]}ps(e){this.vs(),this.ns.push({ds:5,Wt:e})}cs(){this.vs(),this.ns.push({ds:6})}ws(){this.cs(),this.ns=[{ds:4}]}Ms(e){this.cs(),this.ns.push({ds:2,Wt:e})}gs(e){this.cs(),this.ns.push({ds:3,Wt:e})}bs(){return this.ns}Ss(e){for(let t of e.ns)this.xs(t);this.ss=Math.max(this.ss,e.ss),e.ts.forEach(((e,t)=>{this.es(t,e)}))}static Cs(){return new e(2)}static ys(){return new e(3)}xs(e){switch(e.ds){case 0:this.us();break;case 1:this.fs(e.Wt);break;case 2:this.Ms(e.Wt);break;case 3:this.gs(e.Wt);break;case 4:this.ws();break;case 5:this.ps(e.Wt);break;case 6:this.vs()}}vs(){let e=this.ns.findIndex((e=>e.ds===5));e!==-1&&this.ns.splice(e,1)}},LT=class{formatTickmarks(e){return e.map((e=>this.format(e)))}},RT=`.`;function zT(e,t){if(!eT(e))return`n/a`;if(!tT(t)||t<0||t>16)throw TypeError(`invalid length`);return t===0?e.toString():(`0000000000000000`+e.toString()).slice(-t)}var BT=class extends LT{constructor(e,t){if(super(),t||=1,eT(e)&&tT(e)||(e=100),e<0)throw TypeError(`invalid base`);this.Ki=e,this.ks=t,this.Ps()}format(e){let t=e<0?`−`:``;return e=Math.abs(e),t+this.Ts(e)}Ps(){if(this.Rs=0,this.Ki>0&&this.ks>0){let e=this.Ki;for(;e>1;)e/=10,this.Rs++}}Ts(e){let t=this.Ki/this.ks,n=Math.floor(e),r=``,i=this.Rs===void 0?NaN:this.Rs;if(t>1){let a=+(Math.round(e*t)-n*t).toFixed(this.Rs);a>=t&&(a-=t,n+=1),r=RT+zT(+a.toFixed(this.Rs)*this.ks,i)}else n=Math.round(n*t)/t,i>0&&(r=RT+zT(0,i));return n.toFixed(0)+r}},VT=class extends BT{constructor(e=100){super(e)}format(e){return`${super.format(e)}%`}},HT=class extends LT{constructor(e){super(),this.Ds=e}format(e){let t=``;return e<0&&(t=`-`,e=-e),e<995?t+this.Is(e):e<999995?t+this.Is(e/1e3)+`K`:e<999999995?(e=1e3*Math.round(e/1e3),t+this.Is(e/1e6)+`M`):(e=1e6*Math.round(e/1e6),t+this.Is(e/1e9)+`B`)}Is(e){let t,n=10**this.Ds;return t=(e=Math.round(e*n)/n)>=1e-15&&e<1?e.toFixed(this.Ds).replace(/\.?0+$/,``):String(e),t.replace(/(\.[1-9]*)0+$/,((e,t)=>t))}},UT=/[2-9]/g,WT=class{constructor(e=50){this.Vs=0,this.Bs=1,this.Es=1,this.As={},this.Ls=new Map,this.zs=e}Os(){this.Vs=0,this.Ls.clear(),this.Bs=1,this.Es=1,this.As={}}Ii(e,t,n){return this.Ns(e,t,n).width}Di(e,t,n){let r=this.Ns(e,t,n);return((r.actualBoundingBoxAscent||0)-(r.actualBoundingBoxDescent||0))/2}Ns(e,t,n){let r=n||UT,i=String(t).replace(r,`0`);if(this.Ls.has(i))return Xw(this.Ls.get(i)).Fs;if(this.Vs===this.zs){let e=this.As[this.Es];delete this.As[this.Es],this.Ls.delete(e),this.Es++,this.Vs--}e.save(),e.textBaseline=`middle`;let a=e.measureText(i);return e.restore(),a.width===0&&t.length||(this.Ls.set(i,{Fs:a,Ws:this.Bs}),this.As[this.Bs]=i,this.Vs++,this.Bs++),a}},GT=class{constructor(e){this.Hs=null,this.M=null,this.Us=`right`,this.$s=e}js(e,t,n){this.Hs=e,this.M=t,this.Us=n}st(e){this.M!==null&&this.Hs!==null&&this.Hs.st(e,this.M,this.$s,this.Us)}},KT=class{constructor(e,t,n){this.qs=e,this.$s=new WT(50),this.Ys=t,this.O=n,this.F=-1,this.Xt=new GT(this.$s)}Tt(){let e=this.O.Ks(this.Ys);if(e===null)return null;let t=e.Zs(this.Ys)?e.Gs():this.Ys.Ft();if(t===null)return null;let n=e.Xs(t);if(n===`overlay`)return null;let r=this.O.Js();return r.k!==this.F&&(this.F=r.k,this.$s.Os()),this.Xt.js(this.qs.qi(),r,n),this.Xt}},qT=class extends mT{constructor(){super(...arguments),this.qt=null}ht(e){this.qt=e}Qs(e,t){if(!this.qt?.It)return null;let{ut:n,ct:r,te:i}=this.qt;return t>=n-r-7&&t<=n+r+7?{ie:this.qt,ne:Math.abs(t-n),se:2,ee:`price-line`,te:i}:null}et({context:e,bitmapSize:t,horizontalPixelRatio:n,verticalPixelRatio:r}){if(this.qt===null||!1===this.qt.It)return;let i=Math.round(this.qt.ut*r);i<0||i>t.height||(e.lineCap=`butt`,e.strokeStyle=this.qt.R,e.lineWidth=Math.floor(this.qt.ct*n),qw(e,this.qt.Zt),Jw(e,i,0,t.width))}},JT=class{constructor(e){this.re={ut:0,R:`rgba(0, 0, 0, 0)`,ct:1,Zt:0,It:!1},this.he=new qT,this.xt=!0,this.ae=e,this.le=e.Qt(),this.he.ht(this.re)}kt(){this.xt=!0}Tt(){return this.ae.It()?(this.xt&&=(this.oe(),!1),this.he):null}},YT=class extends JT{constructor(e){super(e)}oe(){this.re.It=!1;let e=this.ae.Ft(),t=e._e()._e;if(t!==2&&t!==3)return;let n=this.ae.N();if(!n.baseLineVisible||!this.ae.It())return;let r=this.ae.Lt();r!==null&&(this.re.It=!0,this.re.ut=e.Nt(r.Wt,r.Wt),this.re.R=n.baseLineColor,this.re.ct=n.baseLineWidth,this.re.Zt=n.baseLineStyle)}},XT=class extends mT{constructor(){super(...arguments),this.qt=null}ht(e){this.qt=e}ue(){return this.qt}et({context:e,horizontalPixelRatio:t,verticalPixelRatio:n}){let r=this.qt;if(r===null)return;let i=Math.max(1,Math.floor(t)),a=i%2/2,o=Math.round(r.ce.x*t)+a,s=r.ce.y*n;e.fillStyle=r.de,e.beginPath();let c=Math.max(2,1.5*r.fe)*t;e.arc(o,s,c,0,2*Math.PI,!1),e.fill(),e.fillStyle=r.pe,e.beginPath(),e.arc(o,s,r.ft*t,0,2*Math.PI,!1),e.fill(),e.lineWidth=i,e.strokeStyle=r.ve,e.beginPath(),e.arc(o,s,r.ft*t+i/2,0,2*Math.PI,!1),e.stroke()}},ZT=[{me:0,we:.25,Me:4,ge:10,be:.25,Se:0,xe:.4,Ce:.8},{me:.25,we:.525,Me:10,ge:14,be:0,Se:0,xe:.8,Ce:0},{me:.525,we:1,Me:14,ge:14,be:0,Se:0,xe:0,Ce:0}],QT=class{constructor(e){this.Xt=new XT,this.xt=!0,this.ye=!0,this.ke=performance.now(),this.Pe=this.ke-1,this.Te=e}Re(){this.Pe=this.ke-1,this.kt()}De(){if(this.kt(),this.Te.N().lastPriceAnimation===2){let e=performance.now(),t=this.Pe-e;if(t>0)return void(t<650&&(this.Pe+=2600));this.ke=e,this.Pe=e+2600}}kt(){this.xt=!0}Ie(){this.ye=!0}It(){return this.Te.N().lastPriceAnimation!==0}Ve(){switch(this.Te.N().lastPriceAnimation){case 0:return!1;case 1:return!0;case 2:return performance.now()<=this.Pe}}Tt(){return this.xt?(this.Rt(),this.xt=!1,this.ye=!1):this.ye&&=(this.Be(),!1),this.Xt}Rt(){this.Xt.ht(null);let e=this.Te.Qt().Et(),t=e.Ee(),n=this.Te.Lt();if(t===null||n===null)return;let r=this.Te.Ae(!0);if(r.Le||!t.ze(r.$n))return;let i={x:e.jt(r.$n),y:this.Te.Ft().Nt(r.Mt,n.Wt)},a=r.R,o=this.Te.N().lineWidth,s=this.Oe(this.Ne(),a);this.Xt.ht({de:a,fe:o,pe:s.pe,ve:s.ve,ft:s.ft,ce:i})}Be(){let e=this.Xt.ue();if(e!==null){let t=this.Oe(this.Ne(),e.de);e.pe=t.pe,e.ve=t.ve,e.ft=t.ft}}Ne(){return this.Ve()?performance.now()-this.ke:2599}Fe(e,t,n,r){let i=n+(r-n)*t;return this.Te.Qt().Xi().Y(e,i)}Oe(e,t){let n=e%2600/2600,r;for(let e of ZT)if(n>=e.me&&n<=e.we){r=e;break}Yw(r!==void 0,`Last price animation internal logic error`);let i=(n-r.me)/(r.we-r.me);return{pe:this.Fe(t,i,r.be,r.Se),ve:this.Fe(t,i,r.xe,r.Ce),ft:(a=i,o=r.Me,s=r.ge,o+(s-o)*a)};var a,o,s}},$T=class extends JT{constructor(e){super(e)}oe(){let e=this.re;e.It=!1;let t=this.ae.N();if(!t.priceLineVisible||!this.ae.It())return;let n=this.ae.Ae(t.priceLineSource===0);n.Le||(e.It=!0,e.ut=n.Ei,e.R=this.ae.We(n.R),e.ct=t.priceLineWidth,e.Zt=t.priceLineStyle)}},eE=class extends DT{constructor(e){super(),this.Jt=e}Yi(e,t,n){e.It=!1,t.It=!1;let r=this.Jt;if(!r.It())return;let i=r.N(),a=i.lastValueVisible,o=r.He()!==``,s=i.seriesLastValueMode===0,c=r.Ae(!1);if(c.Le)return;a&&(e.ri=this.Ue(c,a,s),e.It=e.ri.length!==0),(o||s)&&(t.ri=this.$e(c,a,o,s),t.It=t.ri.length>0);let l=r.We(c.R),u=this.Jt.Qt().Xi().Z(l);n.G=u.G,n.Ei=c.Ei,t.Ht=r.Qt().Ut(c.Ei/r.Ft().$t()),e.Ht=l,e.R=u.X,t.R=u.X}$e(e,t,n,r){let i=``,a=this.Jt.He();return n&&a.length!==0&&(i+=`${a} `),t&&r&&(i+=this.Jt.Ft().je()?e.qe:e.Ye),i.trim()}Ue(e,t,n){return t?n?this.Jt.Ft().je()?e.Ye:e.qe:e.ri:``}};function tE(e,t,n,r){let i=Number.isFinite(t),a=Number.isFinite(n);return i&&a?e(t,n):i||a?i?t:n:r}var nE=class e{constructor(e,t){this.Ke=e,this.Ze=t}Ge(e){return e!==null&&this.Ke===e.Ke&&this.Ze===e.Ze}Xe(){return new e(this.Ke,this.Ze)}Je(){return this.Ke}Qe(){return this.Ze}tr(){return this.Ze-this.Ke}Gi(){return this.Ze===this.Ke||Number.isNaN(this.Ze)||Number.isNaN(this.Ke)}Ss(t){return t===null?this:new e(tE(Math.min,this.Je(),t.Je(),-1/0),tE(Math.max,this.Qe(),t.Qe(),1/0))}ir(e){if(!eT(e)||this.Ze-this.Ke===0)return;let t=.5*(this.Ze+this.Ke),n=this.Ze-t,r=this.Ke-t;n*=e,r*=e,this.Ze=t+n,this.Ke=t+r}nr(e){eT(e)&&(this.Ze+=e,this.Ke+=e)}sr(){return{minValue:this.Ke,maxValue:this.Ze}}static er(t){return t===null?null:new e(t.minValue,t.maxValue)}},rE=class e{constructor(e,t){this.rr=e,this.hr=t||null}ar(){return this.rr}lr(){return this.hr}sr(){return{priceRange:this.rr===null?null:this.rr.sr(),margins:this.hr||void 0}}static er(t){return t===null?null:new e(nE.er(t.priceRange),t.margins)}},iE=[2,4,8,16,32,64,128,256,512],aE=`Custom series with conflation reducer must have a priceValueBuilder method`,oE=class extends JT{constructor(e,t){super(e),this._r=t}oe(){let e=this.re;e.It=!1;let t=this._r.N();if(!this.ae.It()||!t.lineVisible)return;let n=this._r.ur();n!==null&&(e.It=!0,e.ut=n,e.R=t.color,e.ct=t.lineWidth,e.Zt=t.lineStyle,e.te=this._r.N().id)}},sE=class extends DT{constructor(e,t){super(),this.Te=e,this._r=t}Yi(e,t,n){e.It=!1,t.It=!1;let r=this._r.N(),i=r.axisLabelVisible,a=r.title!==``,o=this.Te;if(!i||!o.It())return;let s=this._r.ur();if(s===null)return;a&&(t.ri=r.title,t.It=!0),t.Ht=o.Qt().Ut(s/o.Ft().$t()),e.ri=this.cr(r.price),e.It=!0;let c=this.Te.Qt().Xi().Z(r.axisLabelColor||r.color);n.G=c.G;let l=r.axisLabelTextColor||c.X;e.R=l,t.R=l,n.Ei=s}cr(e){let t=this.Te.Lt();return t===null?``:this.Te.Ft().Ji(e,t.Wt)}},cE=class{constructor(e,t){this.Te=e,this.yn=t,this.dr=new oE(e,this),this.qs=new sE(e,this),this.pr=new KT(this.qs,e,e.Qt())}vr(e){$w(this.yn,e),this.kt(),this.Te.Qt().mr()}N(){return this.yn}wr(){return this.dr}Mr(){return this.pr}gr(){return this.qs}kt(){this.dr.kt(),this.qs.kt()}ur(){let e=this.Te,t=e.Ft();if(e.Qt().Et().Gi()||t.Gi())return null;let n=e.Lt();return n===null?null:t.Nt(this.yn.price,n.Wt)}},lE=class{constructor(){this.br=new WeakMap}Sr(e,t,n){let r=1/t*n;if(e>=r)return 1;let i=r/e;return Math.min(2**Math.floor(Math.log2(i)),512)}Cr(e,t,n,r=!1,i){if(e.length===0||t<=1)return e;let a=this.yr(t);if(a<=1)return e;let o=this.kr(e),s=o.Pr.get(a);return s!==void 0||(s=this.Tr(e,a,n,r,i,o.Pr),o.Pr.set(a,s)),s}Rr(e,t,n,r,i=!1,a){if(n<1||e.length===0)return e;let o=this.kr(e),s=o.Pr.get(n);if(!s)return this.Cr(e,n,r,i,a);let c=this.Dr(e,t,n,s,i,r,a);return o.Pr.set(n,c),c}yr(e){if(e<=2)return 2;for(let t of iE)if(e<=t)return t;return 512}Ir(e){if(e.length===0)return 0;let t=e[0],n=e[e.length-1];return 31*e.length+17*t.$n+13*n.$n}Tr(e,t,n,r=!1,i,a=new Map){if(t===2)return this.Vr(e,2,n,r,i);let o=t/2,s=a.get(o);return s||(s=this.Tr(e,o,n,r,i,a),a.set(o,s)),this.Br(s,n,r,i)}Vr(e,t,n,r=!1,i){let a=this.Er(e,t,n,r,i);return this.Ar(a,r)}Br(e,t,n=!1,r){let i=this.Er(e,2,t,n,r);return this.Ar(i,n)}Er(e,t,n,r=!1,i){let a=[];for(let o=0;o<e.length;o+=t)if(e.length-o>=t){let t=this.Lr(e[o],e[o+1],n,r,i);t.zr=!1,a.push(t)}else if(a.length===0)a.push(this.Or(e[o],!0));else{let t=a[a.length-1];a[a.length-1]=this.Nr(t,e[o],n,r,i)}return a}Fr(e,t){return(e??1)+(t??1)}Lr(e,t,n,r=!1,i){if(!r||!n||!i){let n=e.Wt[1]>t.Wt[1]?e.Wt[1]:t.Wt[1],r=e.Wt[2]<t.Wt[2]?e.Wt[2]:t.Wt[2];return{Wr:e.$n,Hr:t.$n,Ur:e.wt,$r:t.wt,jr:e.Wt[0],qr:n,Yr:r,Kr:t.Wt[3],Zr:this.Fr(e.Zr,t.Zr),Gr:void 0,zr:!1}}let a=n(this.Xr(e,i),this.Xr(t,i)),o=i(a),s=o.length?o[o.length-1]:0;return{Wr:e.$n,Hr:t.$n,Ur:e.wt,$r:t.wt,jr:e.Wt[0],qr:Math.max(e.Wt[1],s),Yr:Math.min(e.Wt[2],s),Kr:s,Zr:this.Fr(e.Zr,t.Zr),Gr:a,zr:!1}}Nr(e,t,n,r=!1,i){if(!r||!n||!i)return{Wr:e.Wr,Hr:t.$n,Ur:e.Ur,$r:t.wt,jr:e.jr,qr:e.qr>t.Wt[1]?e.qr:t.Wt[1],Yr:e.Yr<t.Wt[2]?e.Yr:t.Wt[2],Kr:t.Wt[3],Zr:e.Zr+(t.Zr??1),Gr:e.Gr,zr:!1};let a=e.Gr,o=this.Xr(t,i),s=a?{data:a,index:e.Wr,originalTime:e.Ur,time:e.Ur,priceValues:i(a)}:null,c=s?n(s,o):o.data,l=s?i(c):o.priceValues,u=l.length?l[l.length-1]:0;return{Wr:e.Wr,Hr:t.$n,Ur:e.Ur,$r:t.wt,jr:e.jr,qr:Math.max(e.qr,u),Yr:Math.min(e.Yr,u),Kr:u,Zr:e.Zr+(t.Zr??1),Gr:c,zr:!1}}Jr(e,t,n,r,i,a,o=!1,s){let c=t===r?i:e[t];if(n-t==1)return this.Or(c,!0);let l=t+1===r?i:e[t+1],u=this.Lr(c,l,a,o,s);for(let c=t+2;c<n;c++){let t=c===r?i:e[c];u=this.Nr(u,t,a,o,s)}return u}Xr(e,t){let n=e.ue??{};return{data:e.ue,index:e.$n,originalTime:e.Qr,time:e.wt,priceValues:t(n)}}th(e,t=!1){let n=!0===t,r=!!e.Gr;return{$n:e.Wr,wt:e.Ur,Qr:e.Ur,Wt:[n?e.Kr:e.jr,e.qr,e.Yr,e.Kr],Zr:e.Zr,ue:n?r?e.Gr:{wt:e.Ur}:void 0}}Ar(e,t=!1){return e.map((e=>this.th(e,t)))}Dr(e,t,n,r,i=!1,a,o){if(r.length===0)return r;let s=e.length-1,c=Math.floor(s/n)*n;if(Math.min(c+n,e.length)-c<n&&e.length>n){let r=e.slice();return r[r.length-1]=t,this.Cr(r,n,a,i,o)}if(Math.floor((s-1)/n)===Math.floor(s/n)||r.length===1){let l=Math.min(c+n,e.length),u=l-c;if(u<=0)return r;let d=u===1?this.Or(c===s?t:e[c],!0):this.Jr(e,c,l,s,t,a,i,o);return r[r.length-1]=this.th(d,i),r}{let r=e.slice();return r[r.length-1]=t,this.Cr(r,n,a,i,o)}}Or(e,t=!1){return{Wr:e.$n,Hr:e.$n,Ur:e.wt,$r:e.wt,jr:e.Wt[0],qr:e.Wt[1],Yr:e.Wt[2],Kr:e.Wt[3],Zr:e.Zr??1,Gr:e.ue,zr:t}}kr(e){let t=this.ih(e),n=this.Ir(e);return t.nh!==n&&(t.Pr.clear(),t.nh=n),t}ih(e){let t=this.br.get(e);return t===void 0&&(t={nh:this.Ir(e),Pr:new Map},this.br.set(e,t)),t}},uE=class extends MT{constructor(e){super(),this.sn=e}Qt(){return this.sn}},dE={Bar:(e,t,n,r)=>{let i=t.upColor,a=t.downColor,o=$(e(n,r)),s=Zw(o.Wt[0])<=Zw(o.Wt[3]);return{sh:o.R??(s?i:a)}},Candlestick:(e,t,n,r)=>{let i=t.upColor,a=t.downColor,o=t.borderUpColor,s=t.borderDownColor,c=t.wickUpColor,l=t.wickDownColor,u=$(e(n,r)),d=Zw(u.Wt[0])<=Zw(u.Wt[3]);return{sh:u.R??(d?i:a),eh:u.Ht??(d?o:s),rh:u.hh??(d?c:l)}},Custom:(e,t,n,r)=>({sh:$(e(n,r)).R??t.color}),Area:(e,t,n,r)=>{let i=$(e(n,r));return{sh:i.vt??t.lineColor,vt:i.vt??t.lineColor,ah:i.ah??t.topColor,oh:i.oh??t.bottomColor}},Baseline:(e,t,n,r)=>{let i=$(e(n,r));return{sh:i.Wt[3]>=t.baseValue.price?t.topLineColor:t.bottomLineColor,_h:i._h??t.topLineColor,uh:i.uh??t.bottomLineColor,dh:i.dh??t.topFillColor1,fh:i.fh??t.topFillColor2,ph:i.ph??t.bottomFillColor1,mh:i.mh??t.bottomFillColor2}},Line:(e,t,n,r)=>{let i=$(e(n,r));return{sh:i.R??t.color,vt:i.R??t.color}},Histogram:(e,t,n,r)=>({sh:$(e(n,r)).R??t.color})},fE=class{constructor(e){this.wh=(e,t)=>t===void 0?this.Te.Un().Mh(e):t.Wt,this.Te=e,this.gh=dE[e.bh()]}Sh(e,t){return this.gh(this.wh,this.Te.N(),e,t)}};function pE(e,t,n,r,i=0,a=t.length){let o=a-i;for(;0<o;){let a=o>>1,s=i+a;r(t[s],n)===e?(i=s+1,o-=a+1):o=a}return i}var mE=pE.bind(null,!0),hE=pE.bind(null,!1),gE;(function(e){e[e.NearestLeft=-1]=`NearestLeft`,e[e.None=0]=`None`,e[e.NearestRight=1]=`NearestRight`})(gE||={});var _E=30,vE=class{constructor(){this.xh=[],this.Ch=new Map,this.yh=new Map,this.kh=[]}Ph(){return this.Th()>0?this.xh[this.xh.length-1]:null}Rh(){return this.Th()>0?this.Dh(0):null}Qn(){return this.Th()>0?this.Dh(this.xh.length-1):null}Th(){return this.xh.length}Gi(){return this.Th()===0}ze(e){return this.Ih(e,0)!==null}Mh(e){return this.Hn(e)}Hn(e,t=0){let n=this.Ih(e,t);return n===null?null:{...this.Vh(n),$n:this.Dh(n)}}Bh(){return this.xh}Eh(e,t,n){if(this.Gi())return null;let r=null;for(let i of n)r=yE(r,this.Ah(e,t,i));return r}ht(e){this.yh.clear(),this.Ch.clear(),this.xh=e,this.kh=e.map((e=>e.$n))}Lh(){return this.kh}Dh(e){return this.xh[e].$n}Vh(e){return this.xh[e]}Ih(e,t){let n=this.zh(e);if(n===null&&t!==0)switch(t){case-1:return this.Oh(e);case 1:return this.Nh(e);default:throw TypeError(`Unknown search mode`)}return n}Oh(e){let t=this.Fh(e);return t>0&&--t,t!==this.xh.length&&this.Dh(t)<e?t:null}Nh(e){let t=this.Wh(e);return t!==this.xh.length&&e<this.Dh(t)?t:null}zh(e){let t=this.Fh(e);return t===this.xh.length||e<this.xh[t].$n?null:t}Fh(e){return mE(this.xh,e,((e,t)=>e.$n<t))}Wh(e){return hE(this.xh,e,((e,t)=>e.$n>t))}Hh(e,t,n){let r=null;for(let i=e;i<t;i++){let e=this.xh[i].Wt[n];Number.isNaN(e)||(r===null?r={Uh:e,$h:e}:(e<r.Uh&&(r.Uh=e),e>r.$h&&(r.$h=e)))}return r}Ah(e,t,n){if(this.Gi())return null;let r=null,i=$(this.Rh()),a=$(this.Qn()),o=Math.max(e,i),s=Math.min(t,a),c=Math.ceil(o/_E)*_E,l=Math.max(c,Math.floor(s/_E)*_E);{let e=this.Fh(o),i=this.Wh(Math.min(s,c,t));r=yE(r,this.Hh(e,i,n))}let u=this.Ch.get(n);u===void 0&&(u=new Map,this.Ch.set(n,u));for(let e=Math.max(c+1,o);e<l;e+=_E){let t=Math.floor(e/_E),i=u.get(t);if(i===void 0){let e=this.Fh(t*_E),r=this.Wh((t+1)*_E-1);i=this.Hh(e,r,n),u.set(t,i)}r=yE(r,i)}{let e=this.Fh(l),t=this.Wh(s);r=yE(r,this.Hh(e,t,n))}return r}};function yE(e,t){return e===null?t:t===null?e:{Uh:Math.min(e.Uh,t.Uh),$h:Math.max(e.$h,t.$h)}}function bE(){return new vE}var xE={setLineStyle:qw},SE=class{constructor(e){this.jh=e}st(e,t,n){this.jh.draw(e,xE)}qh(e,t,n){this.jh.drawBackground?.(e,xE)}},CE=class{constructor(e){this.Ls=null,this.Yh=e}Tt(){let e=this.Yh.renderer();if(e===null)return null;if(this.Ls?.Kh===e)return this.Ls.Zh;let t=new SE(e);return this.Ls={Kh:e,Zh:t},t}Gh(){return this.Yh.zOrder?.()??`normal`}},wE=class{constructor(e){this.Xh=null,this.Jh=e}Qh(){return this.Jh}Nn(){this.Jh.updateAllViews?.()}jn(){let e=this.Jh.paneViews?.()??[];if(this.Xh?.Kh===e)return this.Xh.Zh;let t=e.map((e=>new CE(e)));return this.Xh={Kh:e,Zh:t},t}Qs(e,t){return this.Jh.hitTest?.(e,t)??null}},TE=class extends wE{cn(){return[]}},EE=class{constructor(e){this.jh=e}st(e,t,n){this.jh.draw(e,xE)}qh(e,t,n){this.jh.drawBackground?.(e,xE)}},DE=class{constructor(e){this.Ls=null,this.Yh=e}Tt(){let e=this.Yh.renderer();if(e===null)return null;if(this.Ls?.Kh===e)return this.Ls.Zh;let t=new EE(e);return this.Ls={Kh:e,Zh:t},t}Gh(){return this.Yh.zOrder?.()??`normal`}};function OE(e){return{ri:e.text(),Ei:e.coordinate(),Vi:e.fixedCoordinate?.(),R:e.textColor(),G:e.backColor(),It:e.visible?.()??!0,pi:e.tickVisible?.()??!0}}var kE=class{constructor(e,t){this.Xt=new AT,this.ta=e,this.ia=t}Tt(){return this.Xt.ht({nn:this.ia.nn(),...OE(this.ta)}),this.Xt}},AE=class extends DT{constructor(e,t){super(),this.ta=e,this.Ki=t}Yi(e,t,n){let r=OE(this.ta);n.G=r.G,e.R=r.R;let i=2/12*this.Ki.k();n.Ti=i,n.Ri=i,n.Ei=r.Ei,n.Vi=r.Vi,e.ri=r.ri,e.It=r.It,e.pi=r.pi}},jE=class extends wE{constructor(e,t){super(e),this.na=null,this.sa=null,this.ea=null,this.ra=null,this.Te=t}dn(){let e=this.Jh.timeAxisViews?.()??[];if(this.na?.Kh===e)return this.na.Zh;let t=this.Te.Qt().Et(),n=e.map((e=>new kE(e,t)));return this.na={Kh:e,Zh:n},n}qn(){let e=this.Jh.priceAxisViews?.()??[];if(this.sa?.Kh===e)return this.sa.Zh;let t=this.Te.Ft(),n=e.map((e=>new AE(e,t)));return this.sa={Kh:e,Zh:n},n}ha(){let e=this.Jh.priceAxisPaneViews?.()??[];if(this.ea?.Kh===e)return this.ea.Zh;let t=e.map((e=>new DE(e)));return this.ea={Kh:e,Zh:t},t}aa(){let e=this.Jh.timeAxisPaneViews?.()??[];if(this.ra?.Kh===e)return this.ra.Zh;let t=e.map((e=>new DE(e)));return this.ra={Kh:e,Zh:t},t}la(e,t){return this.Jh.autoscaleInfo?.(e,t)??null}};function ME(e,t,n,r){e.forEach((e=>{t(e).forEach((e=>{e.Gh()===n&&r.push(e)}))}))}function NE(e){return e.jn()}function PE(e){return e.ha()}function FE(e){return e.aa()}var IE=[`Area`,`Line`,`Baseline`],LE=class extends uE{constructor(e,t,n,r,i){super(e),this.qt=bE(),this.dr=new $T(this),this.oa=[],this._a=new YT(this),this.ua=null,this.ca=null,this.da=null,this.fa=[],this.pa=new lE,this.va=new Map,this.ma=null,this.yn=n,this.wa=t;let a=new eE(this);if(this.mn=[a],this.pr=new KT(a,this,e),IE.includes(this.wa)&&(this.ua=new QT(this)),this.Ma(),this.Yh=r(this,this.Qt(),i),this.wa===`Custom`){let e=this.Yh;e.ga&&this.ba(e.ga)}}m(){this.da!==null&&clearTimeout(this.da)}We(e){return this.yn.priceLineColor||e}Ae(e){let t={Le:!0},n=this.Ft();if(this.Qt().Et().Gi()||n.Gi()||this.qt.Gi())return t;let r=this.Qt().Et().Ee(),i=this.Lt();if(r===null||i===null)return t;let a,o;if(e){let e=this.qt.Ph();if(e===null)return t;a=e,o=e.$n}else{let e=this.qt.Hn(r.bi(),-1);if(e===null||(a=this.qt.Mh(e.$n),a===null))return t;o=e.$n}let s=a.Wt[3],c=this.Sa().Sh(o,{Wt:a}),l=n.Nt(s,i.Wt);return{Le:!1,Mt:s,ri:n.Ji(s,i.Wt),qe:n.xa(s),Ye:n.Ca(s,i.Wt),R:c.sh,Ei:l,$n:o}}Sa(){return this.ca!==null||(this.ca=new fE(this)),this.ca}N(){return this.yn}vr(e){let t=this.Qt(),{priceScaleId:n,visible:r,priceFormat:i}=e;n!==void 0&&n!==this.yn.priceScaleId&&t.ya(this,n),r!==void 0&&r!==this.yn.visible&&t.ka();let a=e.conflationThresholdFactor!==void 0;$w(this.yn,e),a&&(this.va.clear(),this.Qt().mr()),i!==void 0&&(this.Ma(),t.Pa()),t.Ta(this),t.Ra(),this.Yh.kt(`options`)}ht(e,t){this.qt.ht(e),this.va.clear();let n=this.Qt().Et().N();n.enableConflation&&n.precomputeConflationOnInit&&this.Da(n.precomputeConflationPriority),this.Yh.kt(`data`),this.ua!==null&&(t&&t.Ia?this.ua.De():e.length===0&&this.ua.Re());let r=this.Qt().Ks(this);this.Qt().Va(r),this.Qt().Ta(this),this.Qt().Ra(),this.Qt().mr()}Ba(e){let t=new cE(this,e);return this.oa.push(t),this.Qt().Ta(this),t}Ea(e){let t=this.oa.indexOf(e);t!==-1&&this.oa.splice(t,1),this.Qt().Ta(this)}Aa(){return this.oa}bh(){return this.wa}Lt(){let e=this.La();return e===null?null:{Wt:e.Wt[3],za:e.wt}}La(){let e=this.Qt().Et().Ee();if(e===null)return null;let t=e.Oa();return this.qt.Hn(t,1)}Un(){return this.qt}ba(e){this.ma=e,this.va.clear()}Na(){return!!this.Qt().Et().N().enableConflation&&this.Fa()>1}Rr(e){if(!this.Na())return;let t=this.Fa();if(!this.va.has(t))return;let n=this.wa===`Custom`,r=n&&this.ma||void 0,i=n&&this.Yh.Wa?e=>{let t=e,n=this.Yh.Wa(t);return Array.isArray(n)?n:[typeof n==`number`?n:0]}:void 0,a=this.pa.Rr(this.qt.Bh(),e,t,r,n,i),o=bE();o.ht(a),this.va.set(t,o)}Ha(){let e=this.Qt().Et().N().enableConflation;if(this.wa===`Custom`&&this.ma===null||!e)return this.qt;let t=this.Fa();return this.va.get(t)||(this.Ua(t),this.va.get(t)??this.qt)}$a(e){let t=this.qt.Mh(e);return t===null?null:this.wa===`Bar`||this.wa===`Candlestick`||this.wa===`Custom`?{jr:t.Wt[0],qr:t.Wt[1],Yr:t.Wt[2],Kr:t.Wt[3]}:t.Wt[3]}ja(e){let t=[];ME(this.fa,NE,`top`,t);let n=this.ua;return n!==null&&n.It()?(this.da===null&&n.Ve()&&(this.da=setTimeout((()=>{this.da=null,this.Qt().qa()}),0)),n.Ie(),t.unshift(n),t):t}jn(){let e=[];this.Ya()||e.push(this._a),e.push(this.Yh,this.dr);let t=this.oa.map((e=>e.wr()));return e.push(...t),ME(this.fa,NE,`normal`,e),e}Ka(){return this.Za(NE,`bottom`)}Ga(e){return this.Za(PE,e)}Xa(e){return this.Za(FE,e)}Ja(e,t){return this.fa.map((n=>n.Qs(e,t))).filter((e=>e!==null))}cn(){return[this.pr,...this.oa.map((e=>e.Mr()))]}qn(e,t){if(t!==this.hn&&!this.Ya())return[];let n=[...this.mn];for(let e of this.oa)n.push(e.gr());return this.fa.forEach((e=>{n.push(...e.qn())})),n}dn(){let e=[];return this.fa.forEach((t=>{e.push(...t.dn())})),e}la(e,t){if(this.yn.autoscaleInfoProvider!==void 0){let n=this.yn.autoscaleInfoProvider((()=>{let n=this.Qa(e,t);return n===null?null:n.sr()}));return rE.er(n)}return this.Qa(e,t)}Kh(){let e=this.yn.priceFormat;return e.base??1/e.minMove}tl(){return this.il}Nn(){this.Yh.kt();for(let e of this.mn)e.kt();for(let e of this.oa)e.kt();this.dr.kt(),this._a.kt(),this.ua?.kt(),this.fa.forEach((e=>e.Nn()))}Ft(){return $(super.Ft())}At(e){if(!((this.wa===`Line`||this.wa===`Area`||this.wa===`Baseline`)&&this.yn.crosshairMarkerVisible))return null;let t=this.qt.Mh(e);return t===null?null:{Mt:t.Wt[3],ft:this.nl(),Ht:this.sl(),Ot:this.el(),zt:this.rl(e)}}He(){return this.yn.title}It(){return this.yn.visible}hl(e){this.fa.push(new jE(e,this))}al(e){this.fa=this.fa.filter((t=>t.Qh()!==e))}ll(){if(this.wa===`Custom`)return e=>this.Yh.Wa(e)}ol(){if(this.wa===`Custom`)return e=>this.Yh._l(e)}ul(){return this.qt.Lh()}Ya(){return!FT(this.Ft().cl())}Qa(e,t){if(!tT(e)||!tT(t)||this.qt.Gi())return null;let n=this.wa===`Line`||this.wa===`Area`||this.wa===`Baseline`||this.wa===`Histogram`?[3]:[2,1],r=this.qt.Eh(e,t,n),i=r===null?null:new nE(r.Uh,r.$h),a=null;if(this.bh()===`Histogram`){let e=this.yn.base,t=new nE(e,e);i=i===null?t:i.Ss(t)}return this.fa.forEach((n=>{let r=n.la(e,t);if(r?.priceRange){let e=new nE(r.priceRange.minValue,r.priceRange.maxValue);i=i===null?e:i.Ss(e)}r?.margins&&(a=r.margins)})),new rE(i,a)}nl(){switch(this.wa){case`Line`:case`Area`:case`Baseline`:return this.yn.crosshairMarkerRadius}return 0}sl(){switch(this.wa){case`Line`:case`Area`:case`Baseline`:{let e=this.yn.crosshairMarkerBorderColor;if(e.length!==0)return e}}return null}el(){switch(this.wa){case`Line`:case`Area`:case`Baseline`:return this.yn.crosshairMarkerBorderWidth}return 0}rl(e){switch(this.wa){case`Line`:case`Area`:case`Baseline`:{let e=this.yn.crosshairMarkerBackgroundColor;if(e.length!==0)return e}}return this.Sa().Sh(e).sh}Ma(){switch(this.yn.priceFormat.type){case`custom`:{let e=this.yn.priceFormat.formatter;this.il={format:e,formatTickmarks:this.yn.priceFormat.tickmarksFormatter??(t=>t.map(e))};break}case`volume`:this.il=new HT(this.yn.priceFormat.precision);break;case`percent`:this.il=new VT(this.yn.priceFormat.precision);break;default:{let e=10**this.yn.priceFormat.precision;this.il=new BT(e,this.yn.priceFormat.minMove*e)}}this.hn!==null&&this.hn.dl()}Za(e,t){let n=[];return ME(this.fa,e,t,n),n}Fa(){let{fl:e,pl:t,vl:n}=this.ml();return this.pa.Sr(e,t,n)}ml(){let e=this.Qt().Et(),t=e.fl(),n=window.devicePixelRatio||1,r=e.N().conflationThresholdFactor;return{fl:t,pl:n,vl:this.yn.conflationThresholdFactor??r??1}}wl(e){let t=this.qt.Bh(),n;if(this.wa===`Custom`&&this.ma!==null){let r=this.ll();if(!r)throw Error(aE);n=this.pa.Cr(t,e,this.ma,!0,(e=>r(e)))}else n=this.pa.Cr(t,e);let r=bE();return r.ht(n),r}Ua(e){let t=this.wl(e);this.va.set(e,t)}Da(e){if(this.wa===`Custom`&&(this.ma===null||!this.ll()))return;this.va.clear();let t=this.Qt().Et().Ml();for(let n of t){let t=()=>{this.gl(n)},r=typeof window==`object`&&window||typeof self==`object`&&self;r?.Sl?.bl?r.Sl.bl((()=>{t()}),{se:e}):Promise.resolve().then((()=>t()))}}gl(e){if(this.va.has(e)||this.qt.Bh().length===0)return;let t=this.wl(e);this.va.set(e,t)}},RE=[3],zE=[0,1,2,3],BE=class{constructor(e){this.yn=e}xl(e,t,n){let r=e;if(this.yn.mode===0)return r;let i=n.Pn(),a=i.Lt();if(a===null)return r;let o=i.Nt(e,a),s=n.Cl().filter((e=>e instanceof LE)).reduce(((e,r)=>{if(n.Zs(r)||!r.It())return e;let i=r.Ft(),a=r.Un();if(i.Gi()||!a.ze(t))return e;let o=a.Mh(t);if(o===null)return e;let s=Zw(r.Lt()),c=this.yn.mode===3?zE:RE;return e.concat(c.map((e=>i.Nt(o.Wt[e],s.Wt))))}),[]);if(s.length===0)return r;s.sort(((e,t)=>Math.abs(e-o)-Math.abs(t-o)));let c=s[0];return r=i.Tn(c,a),r}};function VE(e,t,n){return Math.min(Math.max(e,t),n)}function HE(e,t,n){return t-e<=n}var UE=class extends mT{constructor(){super(...arguments),this.qt=null}ht(e){this.qt=e}et({context:e,bitmapSize:t,horizontalPixelRatio:n,verticalPixelRatio:r}){if(this.qt===null)return;let i=Math.max(1,Math.floor(n));e.lineWidth=i,function(e,t){e.save(),e.lineWidth%2&&e.translate(.5,.5),t(),e.restore()}(e,(()=>{let a=$(this.qt);if(a.yl){e.strokeStyle=a.kl,qw(e,a.Pl),e.beginPath();for(let r of a.Tl){let a=Math.round(r.Rl*n);e.moveTo(a,-i),e.lineTo(a,t.height+i)}e.stroke()}if(a.Dl){e.strokeStyle=a.Il,qw(e,a.Vl),e.beginPath();for(let n of a.Bl){let a=Math.round(n.Rl*r);e.moveTo(-i,a),e.lineTo(t.width+i,a)}e.stroke()}}))}},WE=class{constructor(e){this.Xt=new UE,this.xt=!0,this.yt=e}kt(){this.xt=!0}Tt(){if(this.xt){let e=this.yt.Qt().N().grid,t={Dl:e.horzLines.visible,yl:e.vertLines.visible,Il:e.horzLines.color,kl:e.vertLines.color,Vl:e.horzLines.style,Pl:e.vertLines.style,Bl:this.yt.Pn().El(),Tl:(this.yt.Qt().Et().El()||[]).map((e=>({Rl:e.coord})))};this.Xt.ht(t),this.xt=!1}return this.Xt}},GE=class{constructor(e){this.Yh=new WE(e)}wr(){return this.Yh}},KE={Al:4,Ll:1e-4};function qE(e,t){let n=100*(e-t)/t;return t<0?-n:n}function JE(e,t){return new nE(qE(e.Je(),t),qE(e.Qe(),t))}function YE(e,t){let n=100*(e-t)/t+100;return t<0?-n:n}function XE(e,t){return new nE(YE(e.Je(),t),YE(e.Qe(),t))}function ZE(e,t){let n=Math.abs(e);if(n<1e-15)return 0;let r=Math.log10(n+t.Ll)+t.Al;return e<0?-r:r}function QE(e,t){let n=Math.abs(e);if(n<1e-15)return 0;let r=10**(n-t.Al)-t.Ll;return e<0?-r:r}function $E(e,t){return e===null?null:new nE(ZE(e.Je(),t),ZE(e.Qe(),t))}function eD(e,t){return e===null?null:new nE(QE(e.Je(),t),QE(e.Qe(),t))}function tD(e){if(e===null)return KE;let t=Math.abs(e.Qe()-e.Je());if(t>=1||t<1e-15)return KE;let n=Math.ceil(Math.abs(Math.log10(t))),r=KE.Al+n;return{Al:r,Ll:1/10**r}}var nD=class{constructor(e,t){if(this.zl=e,this.Ol=t,function(e){if(e<0)return!1;if(e>0xde0b6b3a7640000)return!0;for(let t=e;t>1;t/=10)if(t%10!=0)return!1;return!0}(this.zl))this.Nl=[2,2.5,2];else{this.Nl=[];for(let e=this.zl;e!==1;){if(e%2==0)this.Nl.push(2),e/=2;else{if(e%5!=0)throw Error(`unexpected base`);this.Nl.push(2,2.5),e/=5}if(this.Nl.length>100)throw Error(`something wrong with base`)}}}Fl(e,t,n){let r=this.zl===0?0:1/this.zl,i=10**Math.max(0,Math.ceil(Math.log10(e-t))),a=0,o=this.Ol[0];for(;;){let e=HE(i,r,1e-14)&&i>r+1e-14,t=HE(i,n*o,1e-14),s=HE(i,1,1e-14);if(!(e&&t&&s))break;i/=o,o=this.Ol[++a%this.Ol.length]}if(i<=r+1e-14&&(i=r),i=Math.max(1,i),this.Nl.length>0&&(s=i,c=1,l=1e-14,Math.abs(s-c)<l))for(a=0,o=this.Nl[0];HE(i,n*o,1e-14)&&i>r+1e-14;)i/=o,o=this.Nl[++a%this.Nl.length];var s,c,l;return i}},rD=class{constructor(e,t,n,r){this.Wl=[],this.Ki=e,this.zl=t,this.Hl=n,this.Ul=r}Fl(e,t){if(e<t)throw Error(`high < low`);let n=this.Ki.$t(),r=(e-t)*this.$l()/n,i=new nD(this.zl,[2,2.5,2]),a=new nD(this.zl,[2,2,2.5]),o=new nD(this.zl,[2.5,2,2]),s=[];return s.push(i.Fl(e,t,r),a.Fl(e,t,r),o.Fl(e,t,r)),function(e){if(e.length<1)throw Error(`array is empty`);let t=e[0];for(let n=1;n<e.length;++n)e[n]<t&&(t=e[n]);return t}(s)}jl(){let e=this.Ki,t=e.Lt();if(t===null)return void(this.Wl=[]);let n=e.$t(),r=this.Hl(n-1,t),i=this.Hl(0,t),a=this.Ki.N().entireTextOnly?this.ql()/2:0,o=a,s=n-1-a,c=Math.max(r,i),l=Math.min(r,i);if(c===l)return void(this.Wl=[]);let u=this.Fl(c,l);if(this.Yl(t,u,c,l,o,s),e.Kl()&&this.Zl(u,l,c)){let e=this.Ki.Gl();this.Xl(t,u,o,s,e,2*e)}let d=this.Wl.map((e=>e.Jl)),f=this.Ki.Ql(d);for(let e=0;e<this.Wl.length;e++)this.Wl[e].io=f[e]}El(){return this.Wl}ql(){return this.Ki.k()}$l(){return Math.ceil(this.ql()*this.Ki.N().tickMarkDensity)}Yl(e,t,n,r,i,a){let o=this.Wl,s=this.Ki,c=n%t;c+=c<0?t:0;let l=n>=r?1:-1,u=null,d=0;for(let f=n-c;f>r;f-=t){let n=this.Ul(f,e,!0);u!==null&&Math.abs(n-u)<this.$l()||n<i||n>a||(d<o.length?(o[d].Rl=n,o[d].io=s.no(f),o[d].Jl=f):o.push({Rl:n,io:s.no(f),Jl:f}),d++,u=n,s.so()&&(t=this.Fl(f*l,r)))}o.length=d}Xl(e,t,n,r,i,a){let o=this.Wl,s=this.eo(e,n,i,a),c=this.eo(e,r,-a,-i),l=this.Ul(0,e,!0)-this.Ul(t,e,!0);o.length>0&&o[0].Rl-s.Rl<l/2&&o.shift(),o.length>0&&c.Rl-o[o.length-1].Rl<l/2&&o.pop(),o.unshift(s),o.push(c)}eo(e,t,n,r){let i=(n+r)/2,a=this.Hl(t+n,e),o=this.Hl(t+r,e),s=Math.min(a,o),c=Math.max(a,o),l=Math.max(.1,this.Fl(c,s)),u=this.Hl(t+i,e),d=u-u%l,f=this.Ul(d,e,!0);return{io:this.Ki.no(d),Rl:f,Jl:d}}Zl(e,t,n){let r=Zw(this.Ki.ar());return this.Ki.so()&&(r=eD(r,this.Ki.ro())),r.Je()-t<e&&n-r.Qe()<e}};function iD(e){return e.slice().sort(((e,t)=>$(e.ln())-$(t.ln())))}var aD;(function(e){e[e.Normal=0]=`Normal`,e[e.Logarithmic=1]=`Logarithmic`,e[e.Percentage=2]=`Percentage`,e[e.IndexedTo100=3]=`IndexedTo100`})(aD||={});var oD=new VT,sD=new BT(100,1),cD=class{constructor(e,t,n,r,i){this.ho=0,this.ao=null,this.rr=null,this.lo=null,this.oo={_o:!1,uo:null},this.co=!1,this.do=0,this.fo=0,this.po=new Qw,this.vo=new Qw,this.mo=[],this.wo=null,this.Mo=null,this.bo=null,this.So=null,this.xo=null,this.il=sD,this.Co=tD(null),this.yo=e,this.yn=t,this.ko=n,this.Po=r,this.To=i,this.Ro=new rD(this,100,this.Do.bind(this),this.Io.bind(this))}cl(){return this.yo}N(){return this.yn}vr(e){if($w(this.yn,e),this.dl(),e.mode!==void 0&&this.Vo({_e:e.mode}),e.scaleMargins!==void 0){let t=Xw(e.scaleMargins.top),n=Xw(e.scaleMargins.bottom);if(t<0||t>1)throw Error(`Invalid top margin - expect value between 0 and 1, given=${t}`);if(n<0||n>1)throw Error(`Invalid bottom margin - expect value between 0 and 1, given=${n}`);if(t+n>1)throw Error(`Invalid margins - sum of margins must be less than 1, given=${t+n}`);this.Bo(),this.bo=null}}Eo(){return this.yn.autoScale}Ao(){return this.co}so(){return this.yn.mode===1}je(){return this.yn.mode===2}Lo(){return this.yn.mode===3}ro(){return this.Co}_e(){return{hs:this.yn.autoScale,zo:this.yn.invertScale,_e:this.yn.mode}}Vo(e){let t=this._e(),n=null;e.hs!==void 0&&(this.yn.autoScale=e.hs),e._e!==void 0&&(this.yn.mode=e._e,e._e!==2&&e._e!==3||(this.yn.autoScale=!0),this.oo._o=!1),t._e===1&&e._e!==t._e&&(function(e,t){if(e===null)return!1;let n=QE(e.Je(),t),r=QE(e.Qe(),t);return isFinite(n)&&isFinite(r)}(this.rr,this.Co)?(n=eD(this.rr,this.Co),n!==null&&this.Oo(n)):this.yn.autoScale=!0),e._e===1&&e._e!==t._e&&(n=$E(this.rr,this.Co),n!==null&&this.Oo(n));let r=t._e!==this.yn.mode;r&&(t._e===2||this.je())&&this.dl(),r&&(t._e===3||this.Lo())&&this.dl(),e.zo!==void 0&&t.zo!==e.zo&&(this.yn.invertScale=e.zo,this.No()),this.vo.p(t,this._e())}Fo(){return this.vo}k(){return this.ko.fontSize}$t(){return this.ho}Wo(e){this.ho!==e&&(this.ho=e,this.Bo(),this.bo=null)}Ho(){if(this.ao)return this.ao;let e=this.$t()-this.Uo()-this.$o();return this.ao=e,e}ar(){return this.jo(),this.rr}Oo(e,t){let n=this.rr;(t||n===null&&e!==null||n!==null&&!n.Ge(e))&&(this.bo=null,this.rr=e)}qo(e){this.Oo(e),this.Yo(e!==null)}Gi(){return this.jo(),this.ho===0||!this.rr||this.rr.Gi()}Ko(e){return this.zo()?e:this.$t()-1-e}Nt(e,t){return this.je()?e=qE(e,t):this.Lo()&&(e=YE(e,t)),this.Io(e,t)}Zo(e,t,n){this.jo();let r=this.$o(),i=$(this.ar()),a=i.Je(),o=i.Qe(),s=this.Ho()-1,c=this.zo(),l=s/(o-a),u=n===void 0?0:n.from,d=n===void 0?e.length:n.to,f=this.Go();for(let n=u;n<d;n++){let i=e[n],o=i.Mt;if(isNaN(o))continue;let s=o;f!==null&&(s=f(i.Mt,t));let u=r+l*(s-a);i.ut=c?u:this.ho-1-u}}Xo(e,t,n){this.jo();let r=this.$o(),i=$(this.ar()),a=i.Je(),o=i.Qe(),s=this.Ho()-1,c=this.zo(),l=s/(o-a),u=n===void 0?0:n.from,d=n===void 0?e.length:n.to,f=this.Go();for(let n=u;n<d;n++){let i=e[n],o=i.jr,s=i.qr,u=i.Yr,d=i.Kr;f!==null&&(o=f(i.jr,t),s=f(i.qr,t),u=f(i.Yr,t),d=f(i.Kr,t));let p=r+l*(o-a),m=c?p:this.ho-1-p;i.Jo=m,p=r+l*(s-a),m=c?p:this.ho-1-p,i.Qo=m,p=r+l*(u-a),m=c?p:this.ho-1-p,i.t_=m,p=r+l*(d-a),m=c?p:this.ho-1-p,i.i_=m}}Tn(e,t){let n=this.Do(e,t);return this.n_(n,t)}n_(e,t){let n=e;return this.je()?n=function(e,t){return t<0&&(e=-e),e/100*t+t}(n,t):this.Lo()&&(n=function(e,t){return e-=100,t<0&&(e=-e),e/100*t+t}(n,t)),n}Cl(){return this.mo}Dt(){return this.Mo||=iD(this.mo),this.Mo}s_(e){this.mo.indexOf(e)===-1&&(this.mo.push(e),this.dl(),this.e_())}r_(e){let t=this.mo.indexOf(e);if(t===-1)throw Error(`source is not attached to scale`);this.mo.splice(t,1),this.mo.length===0&&(this.Vo({hs:!0}),this.Oo(null)),this.dl(),this.e_()}Lt(){let e=null;for(let t of this.mo){let n=t.Lt();n!==null&&(e===null||n.za<e.za)&&(e=n)}return e===null?null:e.Wt}zo(){return this.yn.invertScale}El(){let e=this.Lt()===null;if(this.bo!==null&&(e||this.bo.h_===e))return this.bo.El;this.Ro.jl();let t=this.Ro.El();return this.bo={El:t,h_:e},this.po.p(),t}a_(){return this.po}l_(e){this.je()||this.Lo()||this.So===null&&this.lo===null&&(this.Gi()||(this.So=this.ho-e,this.lo=$(this.ar()).Xe()))}o_(e){if(this.je()||this.Lo()||this.So===null)return;this.Vo({hs:!1}),(e=this.ho-e)<0&&(e=0);let t=(this.So+.2*(this.ho-1))/(e+.2*(this.ho-1)),n=$(this.lo).Xe();t=Math.max(t,.1),n.ir(t),this.Oo(n)}__(){this.je()||this.Lo()||(this.So=null,this.lo=null)}u_(e){this.Eo()||this.xo===null&&this.lo===null&&(this.Gi()||(this.xo=e,this.lo=$(this.ar()).Xe()))}c_(e){if(this.Eo()||this.xo===null)return;let t=$(this.ar()).tr()/(this.Ho()-1),n=e-this.xo;this.zo()&&(n*=-1);let r=n*t,i=$(this.lo).Xe();i.nr(r),this.Oo(i,!0),this.bo=null}d_(){this.Eo()||this.xo!==null&&(this.xo=null,this.lo=null)}tl(){return this.il||this.dl(),this.il}Ji(e,t){switch(this.yn.mode){case 2:return this.f_(qE(e,t));case 3:return this.tl().format(YE(e,t));default:return this.cr(e)}}no(e){switch(this.yn.mode){case 2:return this.f_(e);case 3:return this.tl().format(e);default:return this.cr(e)}}Ql(e){switch(this.yn.mode){case 2:return this.p_(e);case 3:return this.tl().formatTickmarks(e);default:return this.v_(e)}}xa(e){return this.cr(e,$(this.wo).tl())}Ca(e,t){return e=qE(e,t),this.f_(e,oD)}m_(){return this.mo}w_(e){this.oo={uo:e,_o:!1}}Nn(){this.mo.forEach((e=>e.Nn()))}Kl(){return this.yn.ensureEdgeTickMarksVisible&&this.Eo()}Gl(){return this.k()/2}dl(){this.bo=null;let e=1/0;this.wo=null;for(let t of this.mo)t.ln()<e&&(e=t.ln(),this.wo=t);let t=100;this.wo!==null&&(t=Math.round(this.wo.Kh())),this.il=sD,this.je()?(this.il=oD,t=100):this.Lo()?(this.il=new BT(100,1),t=100):this.wo!==null&&(this.il=this.wo.tl()),this.Ro=new rD(this,t,this.Do.bind(this),this.Io.bind(this)),this.Ro.jl()}e_(){this.Mo=null}M_(){return this.wo===null||this.je()||this.Lo()?1:1/this.wo.Kh()}Xi(){return this.To}Yo(e){this.co=e}Uo(){return this.zo()?this.yn.scaleMargins.bottom*this.$t()+this.fo:this.yn.scaleMargins.top*this.$t()+this.do}$o(){return this.zo()?this.yn.scaleMargins.top*this.$t()+this.do:this.yn.scaleMargins.bottom*this.$t()+this.fo}jo(){this.oo._o||(this.oo._o=!0,this.g_())}Bo(){this.ao=null}Io(e,t){if(this.jo(),this.Gi())return 0;e=this.so()&&e?ZE(e,this.Co):e;let n=$(this.ar()),r=this.$o()+(this.Ho()-1)*(e-n.Je())/n.tr();return this.Ko(r)}Do(e,t){if(this.jo(),this.Gi())return 0;let n=this.Ko(e),r=$(this.ar()),i=r.Je()+r.tr()*((n-this.$o())/(this.Ho()-1));return this.so()?QE(i,this.Co):i}No(){this.bo=null,this.Ro.jl()}g_(){if(this.Ao()&&!this.Eo())return;let e=this.oo.uo;if(e===null)return;let t=null,n=this.m_(),r=0,i=0;for(let a of n){if(!a.It())continue;let n=a.Lt();if(n===null)continue;let o=a.la(e.Oa(),e.bi()),s=o&&o.ar();if(s!==null){switch(this.yn.mode){case 1:s=$E(s,this.Co);break;case 2:s=JE(s,n.Wt);break;case 3:s=XE(s,n.Wt)}if(t=t===null?s:t.Ss($(s)),o!==null){let e=o.lr();e!==null&&(r=Math.max(r,e.above),i=Math.max(i,e.below))}}}if(this.Kl()&&(r=Math.max(r,this.Gl()),i=Math.max(i,this.Gl())),r===this.do&&i===this.fo||(this.do=r,this.fo=i,this.bo=null,this.Bo()),t!==null){if(t.Je()===t.Qe()){let e=5*this.M_();this.so()&&(t=eD(t,this.Co)),t=new nE(t.Je()-e,t.Qe()+e),this.so()&&(t=$E(t,this.Co))}if(this.so()){let e=eD(t,this.Co),n=tD(e);if(a=n,o=this.Co,a.Al!==o.Al||a.Ll!==o.Ll){let r=this.lo===null?null:eD(this.lo,this.Co);this.Co=n,t=$E(e,n),r!==null&&(this.lo=$E(r,n))}}this.Oo(t)}else this.rr===null&&(this.Oo(new nE(-.5,.5)),this.Co=tD(null));var a,o}Go(){return this.je()?qE:this.Lo()?YE:this.so()?e=>ZE(e,this.Co):null}b_(e,t,n){return t===void 0?(n===void 0&&(n=this.tl()),n.format(e)):t(e)}S_(e,t,n){return t===void 0?(n===void 0&&(n=this.tl()),n.formatTickmarks(e)):t(e)}cr(e,t){return this.b_(e,this.Po.priceFormatter,t)}v_(e,t){let n=this.Po.priceFormatter;return this.S_(e,this.Po.tickmarksPriceFormatter??(n?e=>e.map(n):void 0),t)}f_(e,t){return this.b_(e,this.Po.percentageFormatter,t)}p_(e,t){let n=this.Po.percentageFormatter;return this.S_(e,this.Po.tickmarksPercentageFormatter??(n?e=>e.map(n):void 0),t)}};function lD(e){return e instanceof LE}var uD=class{constructor(e,t){this.mo=[],this.x_=new Map,this.ho=0,this.C_=0,this.y_=1,this.Mo=null,this.k_=null,this.P_=!1,this.T_=new Qw,this.fa=[],this.ia=e,this.sn=t,this.R_=new GE(this);let n=t.N();this.D_=this.I_(`left`,n.leftPriceScale),this.V_=this.I_(`right`,n.rightPriceScale),this.D_.Fo().i(this.B_.bind(this,this.D_),this),this.V_.Fo().i(this.B_.bind(this,this.V_),this),this.E_(n)}E_(e){if(e.leftPriceScale&&this.D_.vr(e.leftPriceScale),e.rightPriceScale&&this.V_.vr(e.rightPriceScale),e.localization&&(this.D_.dl(),this.V_.dl()),e.overlayPriceScales){let t=Array.from(this.x_.values());for(let n of t){let t=$(n[0].Ft());t.vr(e.overlayPriceScales),e.localization&&t.dl()}}}A_(e){switch(e){case`left`:return this.D_;case`right`:return this.V_}return this.x_.has(e)?Xw(this.x_.get(e))[0].Ft():null}m(){this.Qt().L_().u(this),this.D_.Fo().u(this),this.V_.Fo().u(this),this.mo.forEach((e=>{e.m&&e.m()})),this.fa=this.fa.filter((e=>{let t=e.Qh();return t.detached&&t.detached(),!1})),this.T_.p()}z_(){return this.y_}O_(e){this.y_=e}Qt(){return this.sn}nn(){return this.C_}$t(){return this.ho}N_(e){this.C_=e,this.F_()}Wo(e){this.ho=e,this.D_.Wo(e),this.V_.Wo(e),this.mo.forEach((t=>{if(this.Zs(t)){let n=t.Ft();n!==null&&n.Wo(e)}})),this.F_()}W_(e){this.P_=e}H_(){return this.P_}U_(){return this.mo.filter(lD)}Cl(){return this.mo}Zs(e){let t=e.Ft();return t===null||this.D_!==t&&this.V_!==t}s_(e,t,n){this.j_(e,t,n?e.ln():this.mo.length)}r_(e,t){let n=this.mo.indexOf(e);Yw(n!==-1,`removeDataSource: invalid data source`),this.mo.splice(n,1),t||this.mo.forEach(((e,t)=>e._n(t)));let r=$(e.Ft()).cl();if(this.x_.has(r)){let t=Xw(this.x_.get(r)),n=t.indexOf(e);n!==-1&&(t.splice(n,1),t.length===0&&this.x_.delete(r))}let i=e.Ft();i&&i.Cl().indexOf(e)>=0&&(i.r_(e),this.q_(i)),this.Y_()}Xs(e){return e===this.D_?`left`:e===this.V_?`right`:`overlay`}K_(){return this.D_}Z_(){return this.V_}G_(e,t){e.l_(t)}X_(e,t){e.o_(t),this.F_()}J_(e){e.__()}Q_(e,t){e.u_(t)}tu(e,t){e.c_(t),this.F_()}iu(e){e.d_()}F_(){this.mo.forEach((e=>{e.Nn()}))}Pn(){let[e,t]=this.nu(),n=null;return e.N().visible&&e.Cl().length!==0?n=e:t.N().visible&&t.Cl().length!==0?n=t:this.mo.length!==0&&(n=this.mo[0].Ft()),n===null&&(n=this.Gs()??e),n}Gs(){let[e,t]=this.nu();return e.N().visible?e:t.N().visible?t:null}q_(e){e!==null&&e.Eo()&&this.su(e)}eu(e){let t=this.ia.Ee();e.Vo({hs:!0}),t!==null&&e.w_(t),this.F_()}ru(){this.su(this.D_),this.su(this.V_)}hu(){this.q_(this.D_),this.q_(this.V_),this.mo.forEach((e=>{this.Zs(e)&&this.q_(e.Ft())})),this.F_(),this.sn.mr()}Dt(){return this.Mo===null&&(this.Mo=iD(this.mo)),this.Mo}au(){let e=this.Dt(),t=this.sn.ou()?.lu,n=this.sn.N().hoveredSeriesOnTop,r=this.k_;if(r!==null&&r.Kh===e&&r._u===t&&r.uu===n)return r.cu;let i=function(e,t,n){if(!n)return e;let r=e.indexOf(t);if(r===-1||r===e.length-1)return e;let i=[];for(let t=0;t<e.length;t++)t!==r&&i.push(e[t]);return i.push(e[r]),i}(e,t,n);return this.k_={Kh:e,_u:t,uu:n,cu:i},i}du(e,t){t=VE(t,0,this.mo.length-1);let n=this.mo.indexOf(e);Yw(n!==-1,`setSeriesOrder: invalid data source`),this.mo.splice(n,1),this.mo.splice(t,0,e),this.mo.forEach(((e,t)=>e._n(t))),this.Y_();for(let e of[this.D_,this.V_])e.e_(),e.dl();this.sn.mr()}Vt(){return this.Dt().filter(lD)}fu(){return this.T_}pu(){return this.R_}hl(e){this.fa.push(new TE(e))}al(e){this.fa=this.fa.filter((t=>t.Qh()!==e)),e.detached&&e.detached(),this.sn.mr()}vu(){return this.fa}Ja(e,t){return this.fa.map((n=>n.Qs(e,t))).filter((e=>e!==null))}su(e){let t=e.m_();if(t&&t.length>0&&!this.ia.Gi()){let t=this.ia.Ee();t!==null&&e.w_(t)}e.Nn()}j_(e,t,n){let r=this.A_(t);if(r===null&&(r=this.I_(t,this.sn.N().overlayPriceScales)),this.mo.splice(n,0,e),!FT(t)){let n=this.x_.get(t)||[];n.push(e),this.x_.set(t,n)}e._n(n),r.s_(e),e.un(r),this.q_(r),this.Y_()}Y_(){this.Mo=null,this.k_=null}nu(){return this.sn.N().defaultVisiblePriceScaleId===`left`?[this.D_,this.V_]:[this.V_,this.D_]}B_(e,t,n){t._e!==n._e&&this.su(e)}I_(e,t){let n=new cD(e,{visible:!0,autoScale:!0,...iT(t)},this.sn.N().layout,this.sn.N().localization,this.sn.Xi());return n.Wo(this.$t()),n}};function dD(e,t){return t===null||e.se===2&&t.se!==2||(t.se!==2||e.se===2)&&e.ne!==t.ne&&e.ne<t.ne}function fD(e){return{te:e.te,ie:e.ie}}function pD(e){return{ne:e.distance??0,se:e.hitTestPriority??(e.itemType===`marker`?2:0),ee:e.itemType??`primitive`,mu:e.cursorStyle,te:e.externalId}}function mD(e){return{lu:e.lu,wu:fD(e.Mu),mu:e.Mu.mu,ee:e.Mu.ee??`primitive`}}function hD(e,t,n,r){let i=null;for(let a of e){let e=a.Qs?.(t,n,r)??null;if(e===null){let i=a.Tt(r);e=i!==null&&i.Qs?i.Qs(t,n):null}if(e!==null){let t={gu:a,Mu:e};(i===null||dD(t.Mu,i.Mu))&&(i=t)}}return i}function gD(e){return e.jn!==void 0}function _D(e,t,n){let r=[e,...e.Dt()].reverse(),i=function(e,t,n){let r,i,a;for(let c of e){let e=c.Ja?.(t,n)??[];for(let t of e){let e=pD(t);o=t.zOrder,s=r?.zOrder,(!s||o===`top`&&s!==`top`||o===`normal`&&s===`bottom`||t.zOrder===r?.zOrder&&i!==void 0&&dD(e,i)||t.zOrder===r?.zOrder&&i===void 0)&&(r=t,i=e,a=c)}}var o,s;return r&&a&&i?{Mu:i,bu:r,lu:a}:null}(r,t,n);if(i?.bu.zOrder===`top`)return mD(i);let a=null,o=null;for(let s of r){if(i&&i.lu===s&&i.bu.zOrder!==`bottom`&&!i.bu.isBackground)return a??mD(i);if(gD(s)){let r=hD(s.jn(e),t,n,e);if(r!==null){let e={lu:s,gu:r.gu,wu:fD(r.Mu),mu:r.Mu.mu,ee:r.Mu.ee??`primitive`};(a===null||dD(r.Mu,o))&&(a=e,o=r.Mu)}}if(i&&i.lu===s&&i.bu.zOrder!==`bottom`&&i.bu.isBackground)return a??mD(i)}return a===null?i?.bu?mD(i):null:a}var vD=class{constructor(e,t,n=50){this.Vs=0,this.Bs=1,this.Es=1,this.Ls=new Map,this.As=new Map,this.Su=e,this.xu=t,this.zs=n}Cu(e){let t=e.time,n=this.xu.cacheKey(t),r=this.Ls.get(n);if(r!==void 0)return r.yu;if(this.Vs===this.zs){let e=this.As.get(this.Es);this.As.delete(this.Es),this.Ls.delete(Xw(e)),this.Es++,this.Vs--}let i=this.Su(e);return this.Ls.set(n,{yu:i,Ws:this.Bs}),this.As.set(this.Bs,n),this.Vs++,this.Bs++,i}},yD=class{constructor(e,t){Yw(e<=t,`right should be >= left`),this.ku=e,this.Pu=t}Oa(){return this.ku}bi(){return this.Pu}Tu(){return this.Pu-this.ku+1}ze(e){return this.ku<=e&&e<=this.Pu}Ge(e){return this.ku===e.Oa()&&this.Pu===e.bi()}};function bD(e,t){return e===null||t===null?e===t:e.Ge(t)}var xD=class{constructor(){this.Ru=new Map,this.Ls=null,this.Du=!1}Iu(e){this.Du=e,this.Ls=null}Vu(e,t){this.Bu(t),this.Ls=null;for(let n=t;n<e.length;++n){let t=e[n],r=this.Ru.get(t.timeWeight);r===void 0&&(r=[],this.Ru.set(t.timeWeight,r)),r.push({index:n,time:t.time,weight:t.timeWeight,originalTime:t.originalTime})}}Eu(e,t,n,r,i){let a=Math.ceil(t/e);return this.Ls!==null&&this.Ls.Au===a&&i===this.Ls.Lu&&n===this.Ls.zu||(this.Ls={Lu:i,zu:n,El:this.Ou(a,n,r),Au:a}),this.Ls.El}Bu(e){if(e===0)return void this.Ru.clear();let t=[];this.Ru.forEach(((n,r)=>{e<=n[0].index?t.push(r):n.splice(mE(n,e,(t=>t.index<e)),1/0)}));for(let e of t)this.Ru.delete(e)}Ou(e,t,n){let r=[],i=e=>!t||n.has(e.index);for(let t of Array.from(this.Ru.keys()).sort(((e,t)=>t-e))){if(!this.Ru.get(t))continue;let n=r;r=[];let a=n.length,o=0,s=Xw(this.Ru.get(t)),c=s.length,l=1/0,u=-1/0;for(let t=0;t<c;t++){let c=s[t],d=c.index;for(;o<a;){let e=n[o],t=e.index;if(!(t<d&&i(e))){l=t;break}o++,r.push(e),u=t,l=1/0}if(l-d>=e&&d-u>=e&&i(c))r.push(c),u=d;else if(this.Du)return n}for(;o<a;o++)i(n[o])&&r.push(n[o])}return r}},SD=class e{constructor(e){this.Nu=e}Fu(){return this.Nu===null?null:new yD(Math.floor(this.Nu.Oa()),Math.ceil(this.Nu.bi()))}Wu(){return this.Nu}static Hu(){return new e(null)}};function CD(e,t){return e.weight>t.weight?e:t}var wD=class{constructor(e,t,n,r){this.C_=0,this.Uu=null,this.$u=[],this.xo=null,this.So=null,this.ju=new xD,this.qu=new Map,this.Yu=SD.Hu(),this.Ku=!0,this.Zu=new Qw,this.Gu=new Qw,this.Xu=new Qw,this.Ju=null,this.Qu=null,this.tc=new Map,this.nc=-1,this.sc=[],this.ec=1,this.yn=t,this.Po=n,this.rc=t.rightOffset,this.hc=t.barSpacing,this.sn=e,this.ac(t),this.xu=r,this.lc(),this.ju.Iu(t.uniformDistribution),this.oc(),this._c()}N(){return this.yn}uc(e){$w(this.Po,e),this.cc(),this.lc()}vr(e,t){$w(this.yn,e),this.yn.fixLeftEdge&&this.dc(),this.yn.fixRightEdge&&this.fc(),e.barSpacing!==void 0&&this.sn.Ms(e.barSpacing),e.rightOffset!==void 0&&this.sn.gs(e.rightOffset),this.ac(e),e.minBarSpacing===void 0&&e.maxBarSpacing===void 0||this.sn.Ms(e.barSpacing??this.hc),e.ignoreWhitespaceIndices!==void 0&&e.ignoreWhitespaceIndices!==this.yn.ignoreWhitespaceIndices&&this._c(),this.cc(),this.lc(),e.enableConflation===void 0&&e.conflationThresholdFactor===void 0||this.oc(),this.Xu.p()}Rn(e){return this.$u[e]?.time??null}en(e){return this.$u[e]??null}vc(e,t){if(this.$u.length<1)return null;if(this.xu.key(e)>this.xu.key(this.$u[this.$u.length-1].time))return t?this.$u.length-1:null;let n=mE(this.$u,this.xu.key(e),((e,t)=>this.xu.key(e.time)<t));return this.xu.key(e)<this.xu.key(this.$u[n].time)?t?n:null:n}Gi(){return this.C_===0||this.$u.length===0||this.Uu===null}mc(){return this.$u.length>0}Ee(){return this.wc(),this.Yu.Fu()}Mc(){return this.wc(),this.Yu.Wu()}gc(){let e=this.Ee();if(e===null)return null;let t={from:e.Oa(),to:e.bi()};return this.bc(t)}bc(e){let t=Math.round(e.from),n=Math.round(e.to),r=$(this.Sc()),i=$(this.xc());return{from:$(this.en(Math.max(r,t))),to:$(this.en(Math.min(i,n)))}}Cc(e){return{from:$(this.vc(e.from,!0)),to:$(this.vc(e.to,!0))}}nn(){return this.C_}N_(e){if(!isFinite(e)||e<=0||this.C_===e)return;let t=this.Mc(),n=this.C_;if(this.C_=e,this.Ku=!0,this.yn.lockVisibleTimeRangeOnResize&&n!==0){let t=this.hc*e/n;this.hc=t}if(this.yn.fixLeftEdge&&t!==null&&t.Oa()<=0){let t=n-e;this.rc-=Math.round(t/this.hc)+1,this.Ku=!0}this.yc(),this.kc()}jt(e){if(this.Gi()||!tT(e))return 0;let t=this.Pc()+this.rc-e;return this.C_-(t+.5)*this.hc-1}Tc(e,t){let n=this.Pc(),r=t===void 0?0:t.from,i=t===void 0?e.length:t.to;for(let t=r;t<i;t++){let r=e[t].wt,i=n+this.rc-r,a=this.C_-(i+.5)*this.hc-1;e[t]._t=a}}Rc(e,t){let n=Math.ceil(this.Dc(e));return t&&this.yn.ignoreWhitespaceIndices&&!this.Ic(n)?this.Vc(n):n}gs(e){this.Ku=!0,this.rc=e,this.kc(),this.sn.Bc(),this.sn.mr()}fl(){return this.hc}Ms(e){let t=this.hc;if(this.Ec(e),this.yn.rightOffsetPixels!==void 0&&t!==0){let e=this.rc*t/this.hc;this.rc=e}this.kc(),this.sn.Bc(),this.sn.mr()}Ac(){return this.rc}El(){if(this.Gi())return null;if(this.Qu!==null)return this.Qu;let e=this.hc,t=5*(this.sn.N().layout.fontSize+4)/8*(this.yn.tickMarkMaxCharacterLength||8),n=Math.round(t/e),r=$(this.Ee()),i=Math.max(r.Oa(),r.Oa()-n),a=Math.max(r.bi(),r.bi()-n),o=this.ju.Eu(e,t,this.yn.ignoreWhitespaceIndices,this.tc,this.nc),s=this.Sc()+n,c=this.xc()-n,l=this.Lc(),u=this.yn.fixLeftEdge||l,d=this.yn.fixRightEdge||l,f=0;for(let e of o){if(!(i<=e.index&&e.index<=a))continue;let n;f<this.sc.length?(n=this.sc[f],n.coord=this.jt(e.index),n.label=this.zc(e),n.weight=e.weight):(n={needAlignCoordinate:!1,coord:this.jt(e.index),label:this.zc(e),weight:e.weight},this.sc.push(n)),this.hc>t/2&&!l?n.needAlignCoordinate=!1:n.needAlignCoordinate=u&&e.index<=s||d&&e.index>=c,f++}return this.sc.length=f,this.Qu=this.sc,this.sc}Oc(){let e;this.Ku=!0,this.Ms(this.yn.barSpacing),e=this.yn.rightOffsetPixels===void 0?this.yn.rightOffset:this.yn.rightOffsetPixels/this.fl(),this.gs(e)}Nc(e){this.Ku=!0,this.Uu=e,this.kc(),this.dc()}Fc(e,t){let n=this.Dc(e),r=this.fl(),i=r+r/10*t;this.Ms(i),this.yn.rightBarStaysOnScroll||this.gs(this.Ac()+(n-this.Dc(e)))}l_(e){this.xo&&this.d_(),this.So===null&&this.Ju===null&&(this.Gi()||(this.So=e,this.Wc()))}o_(e){if(this.Ju===null)return;let t=VE(this.C_-e,0,this.C_),n=VE(this.C_-$(this.So),0,this.C_);t!==0&&n!==0&&this.Ms(this.Ju.fl*t/n)}__(){this.So!==null&&(this.So=null,this.Hc())}u_(e){this.xo===null&&this.Ju===null&&(this.Gi()||(this.xo=e,this.Wc()))}c_(e){if(this.xo===null)return;let t=(this.xo-e)/this.fl();this.rc=$(this.Ju).Ac+t,this.Ku=!0,this.kc()}d_(){this.xo!==null&&(this.xo=null,this.Hc())}Uc(){this.$c(this.yn.rightOffset)}$c(e,t=400){if(!isFinite(e))throw RangeError(`offset is required and must be finite number`);if(!isFinite(t)||t<=0)throw RangeError(`animationDuration (optional) must be finite positive number`);let n=this.rc,r=performance.now();this.sn.ps({jc:e=>(e-r)/t>=1,qc:i=>{let a=(i-r)/t;return a>=1?e:n+(e-n)*a}})}kt(e,t){this.Ku=!0,this.$u=e,this.ju.Vu(e,t),this.kc()}Yc(){return this.Zu}Kc(){return this.Gu}Zc(){return this.Xu}Pc(){return this.Uu||0}Gc(e,t){let n=e.Tu(),r=t&&this.yn.rightOffsetPixels||0;this.Ec((this.C_-r)/n),this.rc=e.bi()-this.Pc(),t&&(this.rc=r?r/this.fl():this.yn.rightOffset),this.kc(),this.Ku=!0,this.sn.Bc(),this.sn.mr()}Xc(){let e=this.Sc(),t=this.xc();if(e===null||t===null)return;let n=!this.yn.rightOffsetPixels&&this.yn.rightOffset||0;this.Gc(new yD(e,t+n),!0)}Jc(e){let t=new yD(e.from,e.to);this.Gc(t)}rn(e){return this.Po.timeFormatter===void 0?this.xu.formatHorzItem(e.time):this.Po.timeFormatter(e.originalTime)}_c(){if(!this.yn.ignoreWhitespaceIndices)return;this.tc.clear();let e=this.sn.Jn();for(let t of e)for(let e of t.ul())this.tc.set(e,!0);this.nc++}Qc(){return this.ec}Ml(){let e=1/(window.devicePixelRatio||1),t=this.yn.minBarSpacing;if(t>=e)return[1];let n=[1],r=2;for(;r<=512;)t<e/r&&n.push(r),r*=2;return n}Lc(){let e=this.sn.N().handleScroll,t=this.sn.N().handleScale;return!(e.horzTouchDrag||e.mouseWheel||e.pressedMouseMove||e.vertTouchDrag||t.axisDoubleClickReset.time||t.axisPressedMouseMove.time||t.mouseWheel||t.pinch)}Sc(){return this.$u.length===0?null:0}xc(){return this.$u.length===0?null:this.$u.length-1}td(e){return(this.C_-1-e)/this.hc}Dc(e){let t=this.td(e),n=this.Pc()+this.rc-t;return Math.round(1e6*n)/1e6}Ec(e){let t=this.hc;this.hc=e,this.yc(),t!==this.hc&&(this.Ku=!0,this.nd(),this.oc())}wc(){if(!this.Ku)return;if(this.Ku=!1,this.Gi())return void this.sd(SD.Hu());let e=this.Pc(),t=this.C_/this.hc,n=this.rc+e,r=new yD(n-t+1,n);this.sd(new SD(r))}yc(){let e=VE(this.hc,this.ed(),this.rd());this.hc!==e&&(this.hc=e,this.Ku=!0)}rd(){return this.yn.maxBarSpacing>0?this.yn.maxBarSpacing:.5*this.C_}ed(){return this.yn.fixLeftEdge&&this.yn.fixRightEdge&&this.$u.length!==0?this.C_/this.$u.length:this.yn.minBarSpacing}oc(){if(!this.yn.enableConflation)return void(this.ec=1);let e=1/(window.devicePixelRatio||1)*(this.yn.conflationThresholdFactor??1);if(this.hc>=e)return void(this.ec=1);let t=e/this.hc,n=2**Math.floor(Math.log2(t));this.ec=Math.min(n,512)}kc(){let e=this.hd();e!==null&&this.rc<e&&(this.rc=e,this.Ku=!0);let t=this.ad();this.rc>t&&(this.rc=t,this.Ku=!0)}hd(){let e=this.Sc(),t=this.Uu;return e===null||t===null?null:e-t-1+(this.yn.fixLeftEdge?this.C_/this.hc:Math.min(2,this.$u.length))}ad(){return this.yn.fixRightEdge?0:this.C_/this.hc-Math.min(2,this.$u.length)}Wc(){this.Ju={fl:this.fl(),Ac:this.Ac()}}Hc(){this.Ju=null}zc(e){let t=this.qu.get(e.weight);return t===void 0&&(t=new vD((e=>this.ld(e)),this.xu),this.qu.set(e.weight,t)),t.Cu(e)}ld(e){return this.xu.formatTickmark(e,this.Po)}sd(e){let t=this.Yu;this.Yu=e,bD(t.Fu(),this.Yu.Fu())||this.Zu.p(),bD(t.Wu(),this.Yu.Wu())||this.Gu.p(),this.nd()}nd(){this.Qu=null}cc(){this.nd(),this.qu.clear()}lc(){this.xu.updateFormatter(this.Po)}dc(){if(!this.yn.fixLeftEdge)return;let e=this.Sc();if(e===null)return;let t=this.Ee();if(t===null)return;let n=t.Oa()-e;if(n<0){let e=this.rc-n-1;this.gs(e)}this.yc()}fc(){this.kc(),this.yc()}Ic(e){return!this.yn.ignoreWhitespaceIndices||this.tc.get(e)||!1}Vc(e){let t=function*(e){let t=Math.round(e),n=t<e,r=1;for(;;)n?(yield t+r,yield t-r):(yield t-r,yield t+r),r++}(e),n=this.xc();for(;n;){let e=t.next().value;if(this.tc.get(e))return e;if(e<0||e>n)break}return e}ac(e){if(e.rightOffsetPixels!==void 0){let t=e.rightOffsetPixels/(e.barSpacing||this.hc);this.sn.gs(t)}}},TD,ED,DD,OD,kD;(function(e){e[e.OnTouchEnd=0]=`OnTouchEnd`,e[e.OnNextTap=1]=`OnNextTap`})(TD||={});var AD=class{constructor(e,t,n){this.od=[],this._d=[],this.ud=null,this.C_=0,this.dd=null,this.fd=new Qw,this.pd=new Qw,this.vd=null,this.md=e,this.yn=t,this.xu=n,this.To=new fT(this.yn.layout.colorParsers),this.wd=new lT(this),this.ia=new wD(this,t.timeScale,this.yn.localization,n),this.Ct=new PT(this,t.crosshair),this.Md=new BE(t.crosshair),t.addDefaultPane&&(this.gd(0),this.od[0].O_(2)),this.bd=this.Sd(0),this.xd=this.Sd(1)}Pa(){this.Cd(IT.ys())}mr(){this.Cd(IT.Cs())}qa(){this.Cd(new IT(1))}Ta(e){let t=this.yd(e);this.Cd(t)}ou(){return this.dd}kd(e){if(this.dd?.lu===e?.lu&&this.dd?.wu?.te===e?.wu?.te&&this.dd?.wu?.ie===e?.wu?.ie&&this.dd?.mu===e?.mu&&this.dd?.ee===e?.ee)return;let t=this.dd;this.dd=e,t!==null&&this.Ta(t.lu),e!==null&&e.lu!==t?.lu&&this.Ta(e.lu)}N(){return this.yn}vr(e){$w(this.yn,e),this.od.forEach((t=>t.E_(e))),e.timeScale!==void 0&&this.ia.vr(e.timeScale),e.localization!==void 0&&this.ia.uc(e.localization),(e.leftPriceScale||e.rightPriceScale)&&this.fd.p(),this.bd=this.Sd(0),this.xd=this.Sd(1),this.Pa()}Pd(e,t,n=0){let r=this.od[n];if(r===void 0)return;if(e===`left`)return $w(this.yn,{leftPriceScale:t}),r.E_({leftPriceScale:t}),this.fd.p(),void this.Pa();if(e===`right`)return $w(this.yn,{rightPriceScale:t}),r.E_({rightPriceScale:t}),this.fd.p(),void this.Pa();let i=this.Td(e,n);i!==null&&(i.Ft.vr(t),this.fd.p())}Td(e,t){let n=this.od[t];if(n===void 0)return null;let r=n.A_(e);return r===null?null:{Kn:n,Ft:r}}Et(){return this.ia}Zn(){return this.od}Rd(){return this.Ct}Dd(){return this.pd}Id(e,t){e.Wo(t),this.Bc()}N_(e){this.C_=e,this.ia.N_(this.C_),this.od.forEach((t=>t.N_(e))),this.Bc()}Vd(e){this.od.length!==1&&(Yw(e>=0&&e<this.od.length,`Invalid pane index`),this.od.splice(e,1),this.Pa())}Bd(e,t){if(this.od.length<2)return;Yw(e>=0&&e<this.od.length,`Invalid pane index`);let n=this.od[e],r=this.od.reduce(((e,t)=>e+t.z_()),0),i=this.od.reduce(((e,t)=>e+t.$t()),0),a=i-30*(this.od.length-1);t=Math.min(a,Math.max(30,t));let o=r/i,s=n.$t();n.O_(t*o);let c=t-s,l=this.od.length-1;for(let e of this.od)if(e!==n){let t=Math.min(a,Math.max(30,e.$t()-c/l));c-=e.$t()-t,--l;let n=t*o;e.O_(n)}this.Pa()}Ed(e,t){Yw(e>=0&&e<this.od.length&&t>=0&&t<this.od.length,`Invalid pane index`);let n=this.od[e],r=this.od[t];this.od[e]=r,this.od[t]=n,this.Pa()}Ad(e,t){if(Yw(e>=0&&e<this.od.length&&t>=0&&t<this.od.length,`Invalid pane index`),e===t)return;let[n]=this.od.splice(e,1);this.od.splice(t,0,n),this.Pa()}G_(e,t,n){e.G_(t,n)}X_(e,t,n){e.X_(t,n),this.Ra(),this.Cd(this.Ld(e,2))}J_(e,t){e.J_(t),this.Cd(this.Ld(e,2))}Q_(e,t,n){t.Eo()||e.Q_(t,n)}tu(e,t,n){t.Eo()||(e.tu(t,n),this.Ra(),this.Cd(this.Ld(e,2)))}iu(e,t){t.Eo()||(e.iu(t),this.Cd(this.Ld(e,2)))}eu(e,t){e.eu(t),this.Cd(this.Ld(e,2))}zd(e){this.ia.l_(e)}Od(e,t){let n=this.Et();if(n.Gi()||t===0)return;let r=n.nn();e=Math.max(1,Math.min(e,r)),n.Fc(e,t),this.Bc()}Nd(e){this.Fd(0),this.Wd(e),this.Hd()}Ud(e){this.ia.o_(e),this.Bc()}$d(){this.ia.__(),this.mr()}Fd(e){this.ia.u_(e)}Wd(e){this.ia.c_(e),this.Bc()}Hd(){this.ia.d_(),this.mr()}Jn(){return this._d}Wn(){return this.ud===null&&(this.ud=this._d.filter((e=>e.It()))),this.ud}ka(){this.ud=null}jd(e,t,n,r,i){this.Ct.In(e,t);let a=NaN,o=this.ia.Rc(e,!0),s=this.ia.Ee();s!==null&&(o=Math.min(Math.max(s.Oa(),o),s.bi())),o=this.Ct.Fn(o);let c=r.Pn(),l=c.Lt();if(l!==null&&(a=c.Tn(t,l)),a=this.Md.xl(a,o,r),this.Ct.An(o,a,r),this.qa(),!i){let i=_D(r,e,t);this.kd(i&&{lu:i.lu,wu:i.wu,mu:i.mu||null,ee:i.ee}),this.pd.p(this.Ct.Bt(),{x:e,y:t},n)}}qd(e,t,n){let r=n.Pn(),i=r.Lt(),a=r.Nt(e,$(i)),o=this.ia.vc(t,!0),s=this.ia.jt($(o));this.jd(s,a,null,n,!0)}Yd(e){this.Rd().zn(),this.qa(),e||this.pd.p(null,null,null)}Ra(){let e=this.Ct.Kn();if(e!==null){let t=this.Ct.Bn(),n=this.Ct.En();this.jd(t,n,null,e)}this.Ct.Nn()}Kd(e,t,n){let r=this.ia.Rn(0);t!==void 0&&n!==void 0&&this.ia.kt(t,n);let i=this.ia.Rn(0),a=this.ia.Pc(),o=this.ia.Ee();if(o!==null&&r!==null&&i!==null){let t=o.ze(a),s=this.xu.key(r)>this.xu.key(i),c=e!==null&&e>a&&!s,l=this.ia.N().allowShiftVisibleRangeOnWhitespaceReplacement,u=t&&(n!==void 0||l)&&this.ia.N().shiftVisibleRangeOnNewBar;if(c&&!u){let t=e-a;this.ia.gs(this.ia.Ac()-t)}}this.ia.Nc(e)}Va(e){e!==null&&e.hu()}Ks(e){if(function(e){return e instanceof uD}(e))return e;let t=this.od.find((t=>t.Dt().includes(e)));return t===void 0?null:t}Bc(){this.od.forEach((e=>e.hu())),this.Ra()}m(){this.od.forEach((e=>e.m())),this.od.length=0,this.yn.localization.priceFormatter=void 0,this.yn.localization.percentageFormatter=void 0,this.yn.localization.timeFormatter=void 0}Zd(){return this.wd}Js(){return this.wd.N()}L_(){return this.fd}Gd(e,t){let n=this.gd(t);this.Xd(e,n),this._d.push(e),this.ka(),this._d.length===1?this.Pa():this.mr()}Jd(e){let t=this.Ks(e),n=this._d.indexOf(e);Yw(n!==-1,`Series not found`);let r=$(t);this._d.splice(n,1),r.r_(e),e.m&&e.m(),this.ka(),this.ia._c(),this.Qd(r)}ya(e,t){let n=$(this.Ks(e));n.r_(e,!0),n.s_(e,t,!0)}Xc(){let e=IT.Cs();e.us(),this.Cd(e)}tf(e){let t=IT.Cs();t.fs(e),this.Cd(t)}ws(){let e=IT.Cs();e.ws(),this.Cd(e)}Ms(e){let t=IT.Cs();t.Ms(e),this.Cd(t)}gs(e){let t=IT.Cs();t.gs(e),this.Cd(t)}ps(e){let t=IT.Cs();t.ps(e),this.Cd(t)}cs(){let e=IT.Cs();e.cs(),this.Cd(e)}if(){let e=this.yn.defaultVisiblePriceScaleId,t=this.yn.leftPriceScale.visible;return t===this.yn.rightPriceScale.visible?e:t?`left`:`right`}nf(e,t){if(Yw(t>=0,`Index should be greater or equal to 0`),t===this.sf(e))return;let n=$(this.Ks(e));n.r_(e);let r=this.gd(t);this.Xd(e,r);let i=!1;n.Cl().length===0&&(i=this.Qd(n)),i||this.Pa()}ef(){return this.xd}$(){return this.bd}Ut(e){let t=this.xd,n=this.bd;if(t===n)return t;if(e=Math.max(0,Math.min(100,Math.round(100*e))),this.vd===null||this.vd.ah!==n||this.vd.oh!==t)this.vd={ah:n,oh:t,rf:new Map};else{let t=this.vd.rf.get(e);if(t!==void 0)return t}let r=this.To.tt(n,t,e/100);return this.vd.rf.set(e,r),r}hf(e){return this.od.indexOf(e)}Xi(){return this.To}af(){return this.lf()}lf(e){let t=new uD(this.ia,this);this.od.push(t);let n=e??this.od.length-1,r=IT.ys();return r.es(n,{rs:0,hs:!0}),this.Cd(r),t}gd(e){return Yw(e>=0,`Index should be greater or equal to 0`),(e=Math.min(this.od.length,e))<this.od.length?this.od[e]:this.lf(e)}sf(e){return this.od.findIndex((t=>t.U_().includes(e)))}Ld(e,t){let n=new IT(t);if(e!==null){let r=this.od.indexOf(e);n.es(r,{rs:t})}return n}yd(e,t){return t===void 0&&(t=2),this.Ld(this.Ks(e),t)}Cd(e){this.md&&this.md(e),this.od.forEach((e=>e.pu().wr().kt()))}Xd(e,t){let n=e.N().priceScaleId,r=n===void 0?this.if():n;t.s_(e,r),FT(r)||e.vr(e.N())}Sd(e){let t=this.yn.layout;return t.background.type===`gradient`?e===0?t.background.topColor:t.background.bottomColor:t.background.color}Qd(e){return!e.H_()&&e.Cl().length===0&&this.od.length>1&&(this.od.splice(this.hf(e),1),this.Pa(),!0)}};function jD(e){if(e>=1)return 0;let t=0;for(;t<8;t++){if(Math.abs(Math.round(e)-e)<1e-8)return t;e*=10}return t}function MD(e){return!eT(e)&&!nT(e)}function ND(e){return eT(e)}(function(e){e[e.Disabled=0]=`Disabled`,e[e.Continuous=1]=`Continuous`,e[e.OnDataUpdate=2]=`OnDataUpdate`})(ED||={}),function(e){e[e.LastBar=0]=`LastBar`,e[e.LastVisible=1]=`LastVisible`}(DD||={}),function(e){e.Solid=`solid`,e.VerticalGradient=`gradient`}(OD||={}),function(e){e[e.Year=0]=`Year`,e[e.Month=1]=`Month`,e[e.DayOfMonth=2]=`DayOfMonth`,e[e.Time=3]=`Time`,e[e.TimeWithSeconds=4]=`TimeWithSeconds`}(kD||={});var PD=e=>e.getUTCFullYear();function FD(e,t,n){return t.replace(/yyyy/g,(e=>zT(PD(e),4))(e)).replace(/yy/g,(e=>zT(PD(e)%100,2))(e)).replace(/MMMM/g,((e,t)=>new Date(e.getUTCFullYear(),e.getUTCMonth(),1).toLocaleString(t,{month:`long`}))(e,n)).replace(/MMM/g,((e,t)=>new Date(e.getUTCFullYear(),e.getUTCMonth(),1).toLocaleString(t,{month:`short`}))(e,n)).replace(/MM/g,(e=>zT((e=>e.getUTCMonth()+1)(e),2))(e)).replace(/dd/g,(e=>zT((e=>e.getUTCDate())(e),2))(e))}var ID=class{constructor(e=`yyyy-MM-dd`,t=`default`){this._f=e,this.uf=t}Cu(e){return FD(e,this._f,this.uf)}},LD=class{constructor(e){this.cf=e||`%h:%m:%s`}Cu(e){return this.cf.replace(`%h`,zT(e.getUTCHours(),2)).replace(`%m`,zT(e.getUTCMinutes(),2)).replace(`%s`,zT(e.getUTCSeconds(),2))}},RD={df:`yyyy-MM-dd`,ff:`%h:%m:%s`,pf:` `,vf:`default`},zD=class{constructor(e={}){let t={...RD,...e};this.mf=new ID(t.df,t.vf),this.wf=new LD(t.ff),this.Mf=t.pf}Cu(e){return`${this.mf.Cu(e)}${this.Mf}${this.wf.Cu(e)}`}};function BD(e){return 60*e*60*1e3}function VD(e){return 60*e*1e3}var HD=[{gf:(UD=1,1e3*UD),bf:10},{gf:VD(1),bf:20},{gf:VD(5),bf:21},{gf:VD(30),bf:22},{gf:BD(1),bf:30},{gf:BD(3),bf:31},{gf:BD(6),bf:32},{gf:BD(12),bf:33}],UD;function WD(e,t){if(e.getUTCFullYear()!==t.getUTCFullYear())return 70;if(e.getUTCMonth()!==t.getUTCMonth())return 60;if(e.getUTCDate()!==t.getUTCDate())return 50;for(let n=HD.length-1;n>=0;--n)if(Math.floor(t.getTime()/HD[n].gf)!==Math.floor(e.getTime()/HD[n].gf))return HD[n].bf;return 0}function GD(e){let t=e;if(nT(e)&&(t=qD(e)),!MD(t))throw Error(`time must be of type BusinessDay`);let n=new Date(Date.UTC(t.year,t.month-1,t.day,0,0,0,0));return{Sf:Math.round(n.getTime()/1e3),xf:t}}function KD(e){if(!ND(e))throw Error(`time must be of type isUTCTimestamp`);return{Sf:e}}function qD(e){let t=new Date(e);if(isNaN(t.getTime()))throw Error(`Invalid date string=${e}, expected format=yyyy-mm-dd`);return{day:t.getUTCDate(),month:t.getUTCMonth()+1,year:t.getUTCFullYear()}}function JD(e){nT(e.time)&&(e.time=qD(e.time))}var YD=class{options(){return this.yn}setOptions(e){this.yn=e,this.updateFormatter(e.localization)}preprocessData(e){Array.isArray(e)?function(e){e.forEach(JD)}(e):JD(e)}createConverterToInternalObj(e){return $(function(e){return e.length===0?null:MD(e[0].time)||nT(e[0].time)?GD:KD}(e))}key(e){return typeof e==`object`&&`Sf`in e?e.Sf:this.key(this.convertHorzItemToInternal(e))}cacheKey(e){let t=e;return t.xf===void 0?new Date(1e3*t.Sf).getTime():new Date(Date.UTC(t.xf.year,t.xf.month-1,t.xf.day)).getTime()}convertHorzItemToInternal(e){return ND(t=e)?KD(t):MD(t)?GD(t):GD(qD(t));var t}updateFormatter(e){if(!this.yn)return;let t=e.dateFormat;this.yn.timeScale.timeVisible?this.Cf=new zD({df:t,ff:this.yn.timeScale.secondsVisible?`%h:%m:%s`:`%h:%m`,pf:` `,vf:e.locale}):this.Cf=new ID(t,e.locale)}formatHorzItem(e){let t=e;return this.Cf.Cu(new Date(1e3*t.Sf))}formatTickmark(e,t){let n=function(e,t,n){switch(e){case 0:case 10:return t?n?4:3:2;case 20:case 21:case 22:case 30:case 31:case 32:case 33:return t?3:2;case 50:return 2;case 60:return 1;case 70:return 0}}(e.weight,this.yn.timeScale.timeVisible,this.yn.timeScale.secondsVisible),r=this.yn.timeScale;if(r.tickMarkFormatter!==void 0){let i=r.tickMarkFormatter(e.originalTime,n,t.locale);if(i!==null)return i}return function(e,t,n){let r={};switch(t){case 0:r.year=`numeric`;break;case 1:r.month=`short`;break;case 2:r.day=`numeric`;break;case 3:r.hour12=!1,r.hour=`2-digit`,r.minute=`2-digit`;break;case 4:r.hour12=!1,r.hour=`2-digit`,r.minute=`2-digit`,r.second=`2-digit`}let i=e.xf===void 0?new Date(1e3*e.Sf):new Date(Date.UTC(e.xf.year,e.xf.month-1,e.xf.day));return new Date(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate(),i.getUTCHours(),i.getUTCMinutes(),i.getUTCSeconds(),i.getUTCMilliseconds()).toLocaleString(n,r)}(e.time,n,t.locale)}maxTickMarkWeight(e){let t=e.reduce(CD,e[0]).weight;return t>30&&t<50&&(t=30),t}fillWeightsForPoints(e,t){(function(e,t=0){if(e.length===0)return;let n=t===0?null:e[t-1].time.Sf,r=n===null?null:new Date(1e3*n),i=0;for(let a=t;a<e.length;++a){let t=e[a],o=new Date(1e3*t.time.Sf);r!==null&&(t.timeWeight=WD(o,r)),i+=t.time.Sf-(n||t.time.Sf),n=t.time.Sf,r=o}if(t===0&&e.length>1){let t=Math.ceil(i/(e.length-1)),n=new Date(1e3*(e[0].time.Sf-t));e[0].timeWeight=WD(new Date(1e3*e[0].time.Sf),n)}})(e,t)}static yf(e){return $w({localization:{dateFormat:`dd MMM 'yy`}},e??{})}},XD=typeof window<`u`;function ZD(){return!!XD&&window.navigator.userAgent.toLowerCase().indexOf(`firefox`)>-1}function QD(){return!!XD&&/iPhone|iPad|iPod/.test(window.navigator.platform)}function $D(e,t){switch(e){case`custom`:return t===void 0?`series`:`custom-object`;case`price-line`:return`custom-price-line`;case`marker`:return`series-marker`;case`primitive`:return`primitive`;default:return`series`}}function eO(e){return e+e%2}function tO(e){XD&&window.chrome!==void 0&&e.addEventListener(`mousedown`,(e=>{if(e.button===1)return e.preventDefault(),!1}))}var nO=class{constructor(e,t,n){this.kf=0,this.Pf=null,this.Tf={_t:-1/0,ut:1/0},this.Rf=0,this.Df=null,this.If={_t:-1/0,ut:1/0},this.Vf=null,this.Bf=!1,this.Ef=null,this.Af=null,this.Lf=!1,this.zf=!1,this.Of=!1,this.Nf=null,this.Ff=null,this.Wf=null,this.Hf=null,this.Uf=null,this.$f=null,this.jf=null,this.qf=0,this.Yf=!1,this.Kf=!1,this.Zf=!1,this.Gf=0,this.Xf=null,this.Jf=!QD(),this.Qf=e=>{this.tp(e)},this.ip=e=>{if(this.np(e)){let t=this.sp(e);if(++this.Rf,this.Df&&this.Rf>1){let{ep:n}=this.rp(aO(e),this.If);n<30&&!this.Of&&this.hp(t,this.lp.ap),this.op()}}else{let t=this.sp(e);if(++this.kf,this.Pf&&this.kf>1){let{ep:n}=this.rp(aO(e),this.Tf);n<5&&!this.zf&&this._p(t,this.lp.up),this.cp()}}},this.dp=e,this.lp=t,this.yn=n,this.fp()}m(){this.Nf!==null&&(this.Nf(),this.Nf=null),this.Ff!==null&&(this.Ff(),this.Ff=null),this.Hf!==null&&(this.Hf(),this.Hf=null),this.Uf!==null&&(this.Uf(),this.Uf=null),this.$f!==null&&(this.$f(),this.$f=null),this.Wf!==null&&(this.Wf(),this.Wf=null),this.pp(),this.cp()}vp(e){this.Hf&&this.Hf();let t=this.mp.bind(this);if(this.Hf=()=>{this.dp.removeEventListener(`mousemove`,t)},this.dp.addEventListener(`mousemove`,t),this.np(e))return;let n=this.sp(e);this._p(n,this.lp.wp),this.Jf=!0}cp(){this.Pf!==null&&clearTimeout(this.Pf),this.kf=0,this.Pf=null,this.Tf={_t:-1/0,ut:1/0}}op(){this.Df!==null&&clearTimeout(this.Df),this.Rf=0,this.Df=null,this.If={_t:-1/0,ut:1/0}}mp(e){if(this.Zf||this.Af!==null||this.np(e))return;let t=this.sp(e);this._p(t,this.lp.Mp),this.Jf=!0}gp(e){let t=sO(e.changedTouches,$(this.Xf));if(t===null||(this.Gf=oO(e),this.jf!==null)||this.Kf)return;this.Yf=!0;let{bp:n,Sp:r,ep:i}=this.rp(aO(t),$(this.Af));if(this.Lf||!(i<5)){if(!this.Lf){let e=.5*n,t=r>=e&&!this.yn.xp(),i=e>r&&!this.yn.Cp();t||i||(this.Kf=!0),this.Lf=!0,this.Of=!0,this.pp(),this.op()}if(!this.Kf){let n=this.sp(e,t);this.hp(n,this.lp.yp),iO(e)}}}kp(e){if(e.button!==0)return;let{ep:t}=this.rp(aO(e),$(this.Ef));if(t>=5&&(this.zf=!0,this.cp()),this.zf){let t=this.sp(e);this._p(t,this.lp.Pp)}}rp(e,t){let n=Math.abs(t._t-e._t),r=Math.abs(t.ut-e.ut);return{bp:n,Sp:r,ep:n+r}}Tp(e){let t=sO(e.changedTouches,$(this.Xf));if(t===null&&e.touches.length===0&&(t=e.changedTouches[0]),t===null)return;this.Xf=null,this.Gf=oO(e),this.pp(),this.Af=null,this.$f&&=(this.$f(),null);let n=this.sp(e,t);if(this.hp(n,this.lp.Rp),++this.Rf,this.Df&&this.Rf>1){let{ep:e}=this.rp(aO(t),this.If);e<30&&!this.Of&&this.hp(n,this.lp.ap),this.op()}else this.Of||(this.hp(n,this.lp.Dp),this.lp.Dp&&iO(e));this.Rf===0&&iO(e),e.touches.length===0&&this.Bf&&(this.Bf=!1,iO(e))}tp(e){if(e.button!==0)return;let t=this.sp(e);if(this.Ef=null,this.Zf=!1,this.Uf&&=(this.Uf(),null),ZD()&&this.dp.ownerDocument.documentElement.removeEventListener(`mouseleave`,this.Qf),!this.np(e))if(this._p(t,this.lp.Ip),++this.kf,this.Pf&&this.kf>1){let{ep:n}=this.rp(aO(e),this.Tf);n<5&&!this.zf&&this._p(t,this.lp.up),this.cp()}else this.zf||this._p(t,this.lp.Vp)}pp(){this.Vf!==null&&(clearTimeout(this.Vf),this.Vf=null)}Bp(e){if(this.Xf!==null)return;let t=e.changedTouches[0];this.Xf=t.identifier,this.Gf=oO(e);let n=this.dp.ownerDocument.documentElement;this.Of=!1,this.Lf=!1,this.Kf=!1,this.Af=aO(t),this.$f&&=(this.$f(),null);{let t=this.gp.bind(this),r=this.Tp.bind(this);this.$f=()=>{n.removeEventListener(`touchmove`,t),n.removeEventListener(`touchend`,r)},n.addEventListener(`touchmove`,t,{passive:!1}),n.addEventListener(`touchend`,r,{passive:!1}),this.pp(),this.Vf=setTimeout(this.Ep.bind(this,e),240)}let r=this.sp(e,t);this.hp(r,this.lp.Ap),this.Df||(this.Rf=0,this.Df=setTimeout(this.op.bind(this),500),this.If=aO(t))}Lp(e){if(e.button!==0)return;let t=this.dp.ownerDocument.documentElement;ZD()&&t.addEventListener(`mouseleave`,this.Qf),this.zf=!1,this.Ef=aO(e),this.Uf&&=(this.Uf(),null);{let e=this.kp.bind(this),n=this.tp.bind(this);this.Uf=()=>{t.removeEventListener(`mousemove`,e),t.removeEventListener(`mouseup`,n)},t.addEventListener(`mousemove`,e),t.addEventListener(`mouseup`,n)}if(this.Zf=!0,this.np(e))return;let n=this.sp(e);this._p(n,this.lp.zp),this.Pf||(this.kf=0,this.Pf=setTimeout(this.cp.bind(this),500),this.Tf=aO(e))}fp(){this.dp.addEventListener(`mouseenter`,this.vp.bind(this)),this.dp.addEventListener(`touchcancel`,this.pp.bind(this));{let e=this.dp.ownerDocument,t=e=>{this.lp.Op&&(e.composed&&this.dp.contains(e.composedPath()[0])||e.target&&this.dp.contains(e.target)||this.lp.Op())};this.Ff=()=>{e.removeEventListener(`touchstart`,t)},this.Nf=()=>{e.removeEventListener(`mousedown`,t)},e.addEventListener(`mousedown`,t),e.addEventListener(`touchstart`,t,{passive:!0})}QD()&&(this.Wf=()=>{this.dp.removeEventListener(`dblclick`,this.ip)},this.dp.addEventListener(`dblclick`,this.ip)),this.dp.addEventListener(`mouseleave`,this.Np.bind(this)),this.dp.addEventListener(`touchstart`,this.Bp.bind(this),{passive:!0}),tO(this.dp),this.dp.addEventListener(`mousedown`,this.Lp.bind(this)),this.Fp(),this.dp.addEventListener(`touchmove`,(()=>{}),{passive:!1})}Fp(){this.lp.Wp===void 0&&this.lp.Hp===void 0&&this.lp.Up===void 0||(this.dp.addEventListener(`touchstart`,(e=>this.$p(e.touches)),{passive:!0}),this.dp.addEventListener(`touchmove`,(e=>{if(e.touches.length===2&&this.jf!==null&&this.lp.Hp!==void 0){let t=rO(e.touches[0],e.touches[1])/this.qf;this.lp.Hp(this.jf,t),iO(e)}}),{passive:!1}),this.dp.addEventListener(`touchend`,(e=>{this.$p(e.touches)})))}$p(e){e.length===1&&(this.Yf=!1),e.length!==2||this.Yf||this.Bf?this.jp():this.qp(e)}qp(e){let t=this.dp.getBoundingClientRect()||{left:0,top:0};this.jf={_t:(e[0].clientX-t.left+(e[1].clientX-t.left))/2,ut:(e[0].clientY-t.top+(e[1].clientY-t.top))/2},this.qf=rO(e[0],e[1]),this.lp.Wp!==void 0&&this.lp.Wp(),this.pp()}jp(){this.jf!==null&&(this.jf=null,this.lp.Up!==void 0&&this.lp.Up())}Np(e){if(this.Hf&&this.Hf(),this.np(e)||!this.Jf)return;let t=this.sp(e);this._p(t,this.lp.Yp),this.Jf=!QD()}Ep(e){let t=sO(e.touches,$(this.Xf));if(t===null)return;let n=this.sp(e,t);this.hp(n,this.lp.Kp),this.Of=!0,this.Bf=!0}np(e){return e.sourceCapabilities&&e.sourceCapabilities.firesTouchEvents!==void 0?e.sourceCapabilities.firesTouchEvents:oO(e)<this.Gf+500}hp(e,t){t&&t.call(this.lp,e)}_p(e,t){t&&t.call(this.lp,e)}sp(e,t){let n=t||e,r=this.dp.getBoundingClientRect()||{left:0,top:0};return{clientX:n.clientX,clientY:n.clientY,pageX:n.pageX,pageY:n.pageY,screenX:n.screenX,screenY:n.screenY,localX:n.clientX-r.left,localY:n.clientY-r.top,ctrlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey,metaKey:e.metaKey,Zp:!e.type.startsWith(`mouse`)&&e.type!==`contextmenu`&&e.type!==`click`,Gp:e.type,Xp:n.target,gu:e.view,Jp:()=>{e.type!==`touchstart`&&iO(e)}}}};function rO(e,t){let n=e.clientX-t.clientX,r=e.clientY-t.clientY;return Math.sqrt(n*n+r*r)}function iO(e){e.cancelable&&e.preventDefault()}function aO(e){return{_t:e.pageX,ut:e.pageY}}function oO(e){return e.timeStamp||performance.now()}function sO(e,t){for(let n=0;n<e.length;++n)if(e[n].identifier===t)return e[n];return null}var cO=class{constructor(e,t,n){this.Qp=null,this.tv=null,this.iv=!0,this.nv=null,this.sv=e,this.ev=e.rv()[t],this.hv=e.rv()[n],this.av=document.createElement(`tr`),this.av.style.height=`1px`,this.lv=document.createElement(`td`),this.lv.style.position=`relative`,this.lv.style.padding=`0`,this.lv.style.margin=`0`,this.lv.setAttribute(`colspan`,`3`),this.ov(),this.av.appendChild(this.lv),this.iv=this.sv.N().layout.panes.enableResize,this.iv?this._v():(this.Qp=null,this.tv=null)}m(){this.tv!==null&&this.tv.m()}uv(){return this.av}cv(){return Q({width:this.ev.cv().width,height:1})}dv(){return Q({width:this.ev.dv().width,height:1*window.devicePixelRatio})}fv(e,t,n){let r=this.dv();e.fillStyle=this.sv.N().layout.panes.separatorColor,e.fillRect(t,n,r.width,r.height)}kt(){this.ov(),this.sv.N().layout.panes.enableResize!==this.iv&&(this.iv=this.sv.N().layout.panes.enableResize,this.iv?this._v():(this.Qp!==null&&(this.lv.removeChild(this.Qp.pv),this.lv.removeChild(this.Qp.vv),this.Qp=null),this.tv!==null&&(this.tv.m(),this.tv=null)))}_v(){let e=document.createElement(`div`),t=e.style;t.position=`fixed`,t.display=`none`,t.zIndex=`49`,t.top=`0`,t.left=`0`,t.width=`100%`,t.height=`100%`,t.cursor=`row-resize`,this.lv.appendChild(e);let n=document.createElement(`div`),r=n.style;r.position=`absolute`,r.zIndex=`50`,r.top=`-4px`,r.height=`9px`,r.width=`100%`,r.backgroundColor=``,r.cursor=`row-resize`,this.lv.appendChild(n);let i={wp:this.mv.bind(this),Yp:this.wv.bind(this),zp:this.Mv.bind(this),Ap:this.Mv.bind(this),Pp:this.gv.bind(this),yp:this.gv.bind(this),Ip:this.bv.bind(this),Rp:this.bv.bind(this)};this.tv=new nO(n,i,{xp:()=>!1,Cp:()=>!0}),this.Qp={vv:n,pv:e}}ov(){this.lv.style.background=this.sv.N().layout.panes.separatorColor}mv(e){this.Qp!==null&&(this.Qp.vv.style.backgroundColor=this.sv.N().layout.panes.separatorHoverColor)}wv(e){this.Qp!==null&&this.nv===null&&(this.Qp.vv.style.backgroundColor=``)}Mv(e){if(this.Qp===null)return;let t=this.ev.Sv().z_()+this.hv.Sv().z_(),n=t/(this.ev.cv().height+this.hv.cv().height),r=30*n;t<=2*r||(this.nv={xv:e.pageY,Cv:this.ev.Sv().z_(),yv:t-r,kv:t,Pv:n,Tv:r},this.Qp.pv.style.display=`block`)}gv(e){let t=this.nv;if(t===null)return;let n=(e.pageY-t.xv)*t.Pv,r=VE(t.Cv+n,t.Tv,t.yv);this.ev.Sv().O_(r),this.hv.Sv().O_(t.kv-r),this.sv.Qt().Pa()}bv(e){this.nv!==null&&this.Qp!==null&&(this.nv=null,this.Qp.pv.style.display=`none`)}};function lO(e,t){return e.Rv-t.Rv}function uO(e,t,n){let r=(e.Rv-t.Rv)/(e.wt-t.wt);return Math.sign(r)*Math.min(Math.abs(r),n)}var dO=class{constructor(e,t,n,r){this.Dv=null,this.Iv=null,this.Vv=null,this.Bv=null,this.Ev=null,this.Av=0,this.Lv=0,this.zv=e,this.Ov=t,this.Nv=n,this.ks=r}Fv(e,t){if(this.Dv!==null){if(this.Dv.wt===t)return void(this.Dv.Rv=e);if(Math.abs(this.Dv.Rv-e)<this.ks)return}this.Bv=this.Vv,this.Vv=this.Iv,this.Iv=this.Dv,this.Dv={wt:t,Rv:e}}me(e,t){if(this.Dv===null||this.Iv===null||t-this.Dv.wt>50)return;let n=0,r=uO(this.Dv,this.Iv,this.Ov),i=lO(this.Dv,this.Iv),a=[r],o=[i];if(n+=i,this.Vv!==null){let e=uO(this.Iv,this.Vv,this.Ov);if(Math.sign(e)===Math.sign(r)){let t=lO(this.Iv,this.Vv);if(a.push(e),o.push(t),n+=t,this.Bv!==null){let e=uO(this.Vv,this.Bv,this.Ov);if(Math.sign(e)===Math.sign(r)){let t=lO(this.Vv,this.Bv);a.push(e),o.push(t),n+=t}}}}let s=0;for(let e=0;e<a.length;++e)s+=o[e]/n*a[e];Math.abs(s)<this.zv||(this.Ev={Rv:e,wt:t},this.Lv=s,this.Av=function(e,t){let n=Math.log(t);return Math.log(1*n/-e)/n}(Math.abs(s),this.Nv))}qc(e){let t=$(this.Ev),n=e-t.wt;return t.Rv+this.Lv*(this.Nv**+n-1)/Math.log(this.Nv)}jc(e){return this.Ev===null||this.Wv(e)===this.Av}Wv(e){let t=e-$(this.Ev).wt;return Math.min(t,this.Av)}},fO=class{constructor(e,t){this.Hv=void 0,this.Uv=void 0,this.$v=void 0,this.vn=!1,this.jv=e,this.qv=t,this.Yv()}kt(){this.Yv()}Kv(){this.Hv&&this.jv.removeChild(this.Hv),this.Uv&&this.jv.removeChild(this.Uv),this.Hv=void 0,this.Uv=void 0}Zv(){return this.vn!==this.Gv()||this.$v!==this.Xv()}Xv(){return this.qv.Qt().Xi().J(this.qv.N().layout.textColor)>160?`dark`:`light`}Gv(){return this.qv.N().layout.attributionLogo}Jv(){let e=new URL(location.href);return e.hostname?`&utm_source=`+e.hostname+e.pathname:``}Yv(){this.Zv()&&(this.Kv(),this.vn=this.Gv(),this.vn&&(this.$v=this.Xv(),this.Uv=document.createElement(`style`),this.Uv.innerText=`a#tv-attr-logo{--fill:#131722;--stroke:#fff;position:absolute;left:10px;bottom:10px;height:19px;width:35px;margin:0;padding:0;border:0;z-index:3;}a#tv-attr-logo[data-dark]{--fill:#D1D4DC;--stroke:#131722;}`,this.Hv=document.createElement(`a`),this.Hv.href=`https://www.tradingview.com/?utm_medium=lwc-link&utm_campaign=lwc-chart${this.Jv()}`,this.Hv.title=`Charting by TradingView`,this.Hv.id=`tv-attr-logo`,this.Hv.target=`_blank`,this.Hv.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" width="35" height="19" fill="none"><g fill-rule="evenodd" clip-path="url(#a)" clip-rule="evenodd"><path fill="var(--stroke)" d="M2 0H0v10h6v9h21.4l.5-1.3 6-15 1-2.7H23.7l-.5 1.3-.2.6a5 5 0 0 0-7-.9V0H2Zm20 17h4l5.2-13 .8-2h-7l-1 2.5-.2.5-1.5 3.8-.3.7V17Zm-.8-10a3 3 0 0 0 .7-2.7A3 3 0 1 0 16.8 7h4.4ZM14 7V2H2v6h6v9h4V7h2Z"/><path fill="var(--fill)" d="M14 2H2v6h6v9h6V2Zm12 15h-7l6-15h7l-6 15Zm-7-9a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"/></g><defs><clipPath id="a"><path fill="var(--stroke)" d="M0 0h35v19H0z"/></clipPath></defs></svg>`,this.Hv.toggleAttribute(`data-dark`,this.$v===`dark`),this.jv.appendChild(this.Uv),this.jv.appendChild(this.Hv)))}};function pO(e,t){let n=$(e.ownerDocument).createElement(`canvas`);e.appendChild(n);let r=Rw(n,{type:`device-pixel-content-box`,options:{allowResizeObserver:!0},transform:(e,t)=>({width:Math.max(e.width,t.width),height:Math.max(e.height,t.height)})});return r.resizeCanvasElement(t),r}function mO(e){e.width=1,e.height=1,e.getContext(`2d`)?.clearRect(0,0,1,1)}function hO(e,t,n,r){e.qh&&e.qh(t,n,r)}function gO(e,t,n,r){e.st(t,n,r)}function _O(e,t,n,r){let i=e(n,r);for(let e of i){let n=e.Tt(r);n!==null&&t(n)}}function vO(e,t){return n=>function(e){return e.Ft!==void 0}(n)&&(n.Ft()?.cl()??``)===t?n.Ga?.(e)??[]:[]}function yO(e,t,n,r){if(!e.length)return;let i=0,a=e[0].$t(r,!0),o=t===1?n/2-(e[0].Hi()-a/2):e[0].Hi()-a/2-n/2;o=Math.max(0,o);for(let a=1;a<e.length;a++){let s=e[a],c=e[a-1],l=c.$t(r,!1),u=s.Hi(),d=c.Hi();if(t===1?u>d-l:u<d+l){let r=d-l*t;s.Ui(r);let a=r-t*l/2;if((t===1?a<0:a>n)&&o>0){let r=t===1?-1-a:a-n,s=Math.min(r,o);for(let n=i;n<e.length;n++)e[n].Ui(e[n].Hi()+t*s);o-=s}}else i=a,o=t===1?d-l-u:u-(d+l)}}var bO=class{constructor(e,t,n,r){this.Ki=null,this.Qv=null,this.tm=!1,this.im=new WT(200),this.nm=null,this.sm=0,this.rm=!1,this.hm=()=>{this.rm||this.yt.am().Qt().mr()},this.lm=()=>{this.rm||this.yt.am().Qt().mr()},this.yt=e,this.yn=t,this.ko=t.layout,this.wd=n,this.om=r===`left`,this._m=vO(`normal`,r),this.um=vO(`top`,r),this.dm=vO(`bottom`,r),this.lv=document.createElement(`div`),this.lv.style.height=`100%`,this.lv.style.overflow=`hidden`,this.lv.style.width=`25px`,this.lv.style.left=`0`,this.lv.style.position=`relative`,this.fm=pO(this.lv,Q({width:16,height:16})),this.fm.subscribeSuggestedBitmapSizeChanged(this.hm);let i=this.fm.canvasElement;i.style.position=`absolute`,i.style.zIndex=`1`,i.style.left=`0`,i.style.top=`0`,this.pm=pO(this.lv,Q({width:16,height:16})),this.pm.subscribeSuggestedBitmapSizeChanged(this.lm);let a=this.pm.canvasElement;a.style.position=`absolute`,a.style.zIndex=`2`,a.style.left=`0`,a.style.top=`0`;let o={zp:this.Mv.bind(this),Ap:this.Mv.bind(this),Pp:this.gv.bind(this),yp:this.gv.bind(this),Op:this.vm.bind(this),Ip:this.bv.bind(this),Rp:this.bv.bind(this),up:this.wm.bind(this),ap:this.wm.bind(this),wp:this.Mm.bind(this),Yp:this.wv.bind(this)};this.tv=new nO(this.pm.canvasElement,o,{xp:()=>!this.yn.handleScroll.vertTouchDrag,Cp:()=>!0})}m(){this.tv.m(),this.pm.unsubscribeSuggestedBitmapSizeChanged(this.lm),mO(this.pm.canvasElement),this.pm.dispose(),this.fm.unsubscribeSuggestedBitmapSizeChanged(this.hm),mO(this.fm.canvasElement),this.fm.dispose(),this.Ki!==null&&this.Ki.a_().u(this),this.Ki=null}uv(){return this.lv}k(){return this.ko.fontSize}gm(){let e=this.wd.N();return this.nm!==e.P&&(this.im.Os(),this.nm=e.P),e}bm(){if(this.Ki===null)return 0;let e=0,t=this.gm(),n=$(this.fm.canvasElement.getContext(`2d`,{colorSpace:this.yt.am().N().layout.colorSpace}));n.save();let r=this.Ki.El();n.font=this.Sm(),r.length>0&&(e=Math.max(this.im.Ii(n,r[0].io),this.im.Ii(n,r[r.length-1].io)));let i=this.xm();for(let t=i.length;t--;){let r=this.im.Ii(n,i[t].ri());r>e&&(e=r)}let a=this.Ki.Lt();if(a!==null&&this.Qv!==null&&(o=this.yn.crosshair).mode!==2&&o.horzLine.visible&&o.horzLine.labelVisible){let t=this.Ki.Tn(1,a),r=this.Ki.Tn(this.Qv.height-2,a);e=Math.max(e,this.im.Ii(n,this.Ki.Ji(Math.floor(Math.min(t,r))+.11111111111111,a)),this.im.Ii(n,this.Ki.Ji(Math.ceil(Math.max(t,r))-.11111111111111,a)))}var o;n.restore();let s=e||34;return eO(Math.ceil(t.S+t.C+t.V+t.B+5+s))}Cm(e){this.Qv!==null&&Pw(this.Qv,e)||(this.Qv=e,this.rm=!0,this.fm.resizeCanvasElement(e),this.pm.resizeCanvasElement(e),this.rm=!1,this.lv.style.width=`${e.width}px`,this.lv.style.height=`${e.height}px`)}ym(){return $(this.Qv).width}un(e){this.Ki!==e&&(this.Ki!==null&&this.Ki.a_().u(this),this.Ki=e,e.a_().i(this.po.bind(this),this))}Ft(){return this.Ki}Os(){let e=this.yt.Sv();this.yt.am().Qt().eu(e,$(this.Ft()))}km(e){if(this.Qv===null)return;let t={colorSpace:this.yt.am().N().layout.colorSpace};if(e!==1){this.Pm(),this.fm.applySuggestedBitmapSize();let e=Uw(this.fm,t);e!==null&&(e.useBitmapCoordinateSpace((e=>{this.Tm(e),this.Rm(e)})),this.yt.Dm(e,this.dm),this.Im(e),this.yt.Dm(e,this._m),this.Vm(e))}this.pm.applySuggestedBitmapSize();let n=Uw(this.pm,t);n!==null&&(n.useBitmapCoordinateSpace((({context:e,bitmapSize:t})=>{e.clearRect(0,0,t.width,t.height)})),this.Bm(n),this.yt.Dm(n,this.um))}dv(){return this.fm.bitmapSize}fv(e,t,n,r){let i=this.dv();if(i.width>0&&i.height>0&&(e.drawImage(this.fm.canvasElement,t,n),r)){let r=this.pm.canvasElement;e.drawImage(r,t,n)}}kt(){this.Ki?.El()}Mv(e){if(this.Ki===null||this.Ki.Gi()||!this.yn.handleScale.axisPressedMouseMove.price)return;let t=this.yt.am().Qt(),n=this.yt.Sv();this.tm=!0,t.G_(n,this.Ki,e.localY)}gv(e){if(this.Ki===null||!this.yn.handleScale.axisPressedMouseMove.price)return;let t=this.yt.am().Qt(),n=this.yt.Sv(),r=this.Ki;t.X_(n,r,e.localY)}vm(){if(this.Ki===null||!this.yn.handleScale.axisPressedMouseMove.price)return;let e=this.yt.am().Qt(),t=this.yt.Sv(),n=this.Ki;this.tm&&(this.tm=!1,e.J_(t,n))}bv(e){if(this.Ki===null||!this.yn.handleScale.axisPressedMouseMove.price)return;let t=this.yt.am().Qt(),n=this.yt.Sv();this.tm=!1,t.J_(n,this.Ki)}wm(e){this.yn.handleScale.axisDoubleClickReset.price&&this.Os()}Mm(e){this.Ki!==null&&(!this.yt.am().Qt().N().handleScale.axisPressedMouseMove.price||this.Ki.je()||this.Ki.Lo()||this.Em(1))}wv(e){this.Em(0)}xm(){let e=[],t=this.Ki===null?void 0:this.Ki;return(n=>{for(let r=0;r<n.length;++r){let i=n[r].qn(this.yt.Sv(),t);for(let t=0;t<i.length;t++)e.push(i[t])}})(this.yt.Sv().Dt()),e}Tm({context:e,bitmapSize:t}){let{width:n,height:r}=t,i=this.yt.Sv().Qt(),a=i.$(),o=i.ef();a===o?ST(e,0,0,n,r,a):TT(e,0,0,n,r,a,o)}Rm({context:e,bitmapSize:t,horizontalPixelRatio:n}){if(this.Qv===null||this.Ki===null||!this.Ki.N().borderVisible)return;e.fillStyle=this.Ki.N().borderColor;let r=Math.max(1,Math.floor(this.gm().S*n)),i;i=this.om?t.width-r:0,e.fillRect(i,0,r,t.height)}Im(e){if(this.Qv===null||this.Ki===null)return;let t=this.Ki.El(),n=this.Ki.N(),r=this.gm(),i=this.om?this.Qv.width-r.C:0;n.borderVisible&&n.ticksVisible&&e.useBitmapCoordinateSpace((({context:e,horizontalPixelRatio:a,verticalPixelRatio:o})=>{e.fillStyle=n.borderColor;let s=Math.max(1,Math.floor(o)),c=Math.floor(.5*o),l=Math.round(r.C*a);e.beginPath();for(let n of t)e.rect(Math.floor(i*a),Math.round(n.Rl*o)-c,l,s);e.fill()})),e.useMediaCoordinateSpace((({context:e})=>{e.font=this.Sm(),e.fillStyle=n.textColor??this.ko.textColor,e.textAlign=this.om?`right`:`left`,e.textBaseline=`middle`;let a=this.om?Math.round(i-r.V):Math.round(i+r.C+r.V),o=t.map((t=>this.im.Di(e,t.io)));for(let n=t.length;n--;){let r=t[n];e.fillText(r.io,a,r.Rl+o[n])}}))}Pm(){if(this.Qv===null||this.Ki===null)return;let e=this.Qv.height/2,t=[],n=this.Ki.Dt().slice(),r=this.yt.Sv(),i=this.gm();this.Ki===r.Gs()&&this.yt.Sv().Dt().forEach((e=>{r.Zs(e)&&n.push(e)}));let a=this.Ki.Cl()[0],o=this.Ki;n.forEach((n=>{let i=n.qn(r,o);i.forEach((e=>{e.$i()&&e.Wi()===null&&(e.Ui(null),t.push(e))})),a===n&&i.length>0&&(e=i[0].Ei())})),this.Ki.N().alignLabels&&this.Am(t,i,e)}Am(e,t,n){if(this.Qv===null)return;let r=e.filter((e=>e.Ei()<=n)),i=e.filter((e=>e.Ei()>n));r.sort(((e,t)=>t.Ei()-e.Ei())),r.length&&i.length&&i.push(r[0]),i.sort(((e,t)=>e.Ei()-t.Ei()));for(let n of e){let e=Math.floor(n.$t(t)/2),r=n.Ei();r>-e&&r<e&&n.Ui(e),r>this.Qv.height-e&&r<this.Qv.height+e&&n.Ui(this.Qv.height-e)}yO(r,1,this.Qv.height,t),yO(i,-1,this.Qv.height,t)}Vm(e){if(this.Qv===null)return;let t=this.xm(),n=this.gm(),r=this.om?`right`:`left`;t.forEach((t=>{t.ji()&&t.Tt($(this.Ki)).st(e,n,this.im,r)}))}Bm(e){if(this.Qv===null||this.Ki===null)return;let t=this.yt.am().Qt(),n=[],r=this.yt.Sv(),i=t.Rd().qn(r,this.Ki);i.length&&n.push(i);let a=this.gm(),o=this.om?`right`:`left`;n.forEach((t=>{t.forEach((t=>{t.Tt($(this.Ki)).st(e,a,this.im,o)}))}))}Em(e){this.lv.style.cursor=e===1?`ns-resize`:`default`}po(){let e=this.bm();this.sm<e&&this.yt.am().Qt().Pa(),this.sm=e}Sm(){return cT(this.ko.fontSize,this.ko.fontFamily)}};function xO(e,t){return e.Ka?.(t)??[]}function SO(e,t){return e.jn?.(t)??[]}function CO(e,t){return e.cn?.(t)??[]}function wO(e,t){return e.ja?.(t)??[]}var TO=class e{constructor(e,t){this.Qv=Q({width:0,height:0}),this.Lm=null,this.zm=null,this.Om=null,this.Nm=null,this.Fm=!1,this.Wm=new Qw,this.Hm=new Qw,this.Um=0,this.$m=!1,this.jm=null,this.qm=!1,this.Ym=null,this.Km=null,this.rm=!1,this.hm=()=>{this.rm||this.Zm===null||this.sn().mr()},this.lm=()=>{this.rm||this.Zm===null||this.sn().mr()},this.qv=e,this.Zm=t,this.Zm.fu().i(this.Gm.bind(this),this,!0),this.Xm=document.createElement(`td`),this.Xm.style.padding=`0`,this.Xm.style.position=`relative`;let n=document.createElement(`div`);n.style.width=`100%`,n.style.height=`100%`,n.style.position=`relative`,n.style.overflow=`hidden`,this.Jm=document.createElement(`td`),this.Jm.style.padding=`0`,this.Qm=document.createElement(`td`),this.Qm.style.padding=`0`,this.Xm.appendChild(n),this.fm=pO(n,Q({width:16,height:16})),this.fm.subscribeSuggestedBitmapSizeChanged(this.hm);let r=this.fm.canvasElement;r.style.position=`absolute`,r.style.zIndex=`1`,r.style.left=`0`,r.style.top=`0`,this.pm=pO(n,Q({width:16,height:16})),this.pm.subscribeSuggestedBitmapSizeChanged(this.lm);let i=this.pm.canvasElement;i.style.position=`absolute`,i.style.zIndex=`2`,i.style.left=`0`,i.style.top=`0`,this.av=document.createElement(`tr`),this.av.appendChild(this.Jm),this.av.appendChild(this.Xm),this.av.appendChild(this.Qm),this.tw(),this.tv=new nO(this.pm.canvasElement,this,{xp:()=>this.jm===null&&!this.qv.N().handleScroll.vertTouchDrag,Cp:()=>this.jm===null&&!this.qv.N().handleScroll.horzTouchDrag})}m(){this.Lm!==null&&this.Lm.m(),this.zm!==null&&this.zm.m(),this.Om=null,this.pm.unsubscribeSuggestedBitmapSizeChanged(this.lm),mO(this.pm.canvasElement),this.pm.dispose(),this.fm.unsubscribeSuggestedBitmapSizeChanged(this.hm),mO(this.fm.canvasElement),this.fm.dispose(),this.Zm!==null&&(this.Zm.fu().u(this),this.Zm.m()),this.tv.m()}Sv(){return $(this.Zm)}iw(t){this.Zm!==null&&this.Zm.fu().u(this),this.Zm=t,this.Zm!==null&&this.Zm.fu().i(e.prototype.Gm.bind(this),this,!0),this.tw(),this.qv.rv().indexOf(this)===this.qv.rv().length-1?(this.Om=this.Om??new fO(this.Xm,this.qv),this.Om.kt()):(this.Om?.Kv(),this.Om=null)}am(){return this.qv}uv(){return this.av}tw(){if(this.Zm!==null&&(this.nw(),this.sn().Jn().length!==0)){if(this.Lm!==null){let e=this.Zm.K_();this.Lm.un($(e))}if(this.zm!==null){let e=this.Zm.Z_();this.zm.un($(e))}}}sw(){this.Lm!==null&&this.Lm.kt(),this.zm!==null&&this.zm.kt()}z_(){return this.Zm===null?0:this.Zm.z_()}O_(e){this.Zm&&this.Zm.O_(e)}wp(e){if(!this.Zm)return;this.ew();let t=e.localX,n=e.localY;this.rw(t,n,e)}zp(e){this.ew(),this.hw(),this.rw(e.localX,e.localY,e)}Mp(e){if(!this.Zm)return;this.ew();let t=e.localX,n=e.localY;this.rw(t,n,e)}Vp(e){this.Zm!==null&&(this.ew(),this.rw(e.localX,e.localY,e),this.aw(e))}up(e){this.Zm!==null&&this.lw(this.Hm,e)}ap(e){this.up(e)}Pp(e){this.ew(),this.ow(e),this.rw(e.localX,e.localY,e)}Ip(e){this.Zm!==null&&(this.ew(),this.$m=!1,this._w(e))}Dp(e){this.Zm!==null&&this.aw(e)}Kp(e){if(this.$m=!0,this.jm===null){let t={x:e.localX,y:e.localY};this.uw(t,t,e)}}Yp(e){this.Zm!==null&&(this.ew(),this.Zm.Qt().kd(null),this.cw())}dw(){return this.Wm}fw(){return this.Hm}Wp(){this.Um=1,this.sn().cs()}Hp(e,t){if(!this.qv.N().handleScale.pinch)return;let n=5*(t-this.Um);this.Um=t,this.sn().Od(e._t,n)}Ap(e){this.$m=!1,this.qm=this.jm!==null,this.hw();let t=this.sn().Rd();this.jm!==null&&t.It()&&(this.Ym={x:t.ni(),y:t.si()},this.jm={x:e.localX,y:e.localY})}yp(e){if(this.Zm===null)return;let t=e.localX,n=e.localY;if(this.jm===null)this.ow(e);else{this.qm=!1;let r=$(this.Ym),i=r.x+(t-this.jm.x),a=r.y+(n-this.jm.y);this.rw(i,a,e)}}Rp(e){this.am().N().trackingMode.exitMode===0&&(this.qm=!0),this.pw(),this._w(e)}Qs(e,t){let n=this.Zm;return n===null?null:_D(n,e,t)}mw(e,t){$(t===`left`?this.Lm:this.zm).Cm(Q({width:e,height:this.Qv.height}))}cv(){return this.Qv}Cm(e){Pw(this.Qv,e)||(this.Qv=e,this.rm=!0,this.fm.resizeCanvasElement(e),this.pm.resizeCanvasElement(e),this.rm=!1,this.Xm.style.width=e.width+`px`,this.Xm.style.height=e.height+`px`)}ww(){let e=$(this.Zm);e.q_(e.K_()),e.q_(e.Z_());for(let t of e.Cl())if(e.Zs(t)){let n=t.Ft();n!==null&&e.q_(n),t.Nn()}for(let t of e.vu())t.Nn()}dv(){return this.fm.bitmapSize}fv(e,t,n,r){let i=this.dv();if(i.width>0&&i.height>0&&(e.drawImage(this.fm.canvasElement,t,n),r)){let r=this.pm.canvasElement;e!==null&&e.drawImage(r,t,n)}}km(e){if(e===0||this.Zm===null)return;e>1&&this.ww(),this.Lm!==null&&this.Lm.km(e),this.zm!==null&&this.zm.km(e);let t={colorSpace:this.qv.N().layout.colorSpace};if(e!==1){this.fm.applySuggestedBitmapSize();let e=Uw(this.fm,t);e!==null&&(e.useBitmapCoordinateSpace((e=>{this.Tm(e)})),this.Zm&&(this.Mw(e,xO),this.gw(e),this.Mw(e,SO),this.Mw(e,CO)))}this.pm.applySuggestedBitmapSize();let n=Uw(this.pm,t);n!==null&&(n.useBitmapCoordinateSpace((({context:e,bitmapSize:t})=>{e.clearRect(0,0,t.width,t.height)})),this.bw(n),this.Mw(n,wO),this.Mw(n,CO))}Sw(){return this.Lm}xw(){return this.zm}Dm(e,t){this.Mw(e,t)}Gm(){this.Zm!==null&&this.Zm.fu().u(this),this.Zm=null}aw(e){this.lw(this.Wm,e)}lw(e,t){let n=t.localX,r=t.localY;e.v()&&e.p(this.sn().Et().Rc(n),{x:n,y:r},t)}Tm({context:e,bitmapSize:t}){let{width:n,height:r}=t,i=this.sn(),a=i.$(),o=i.ef();a===o?ST(e,0,0,n,r,o):TT(e,0,0,n,r,a,o)}gw(e){let t=$(this.Zm),n=t.pu().wr().Tt(t);n!==null&&n.st(e,!1)}bw(e){this.Cw(e,SO,gO,this.sn().Rd())}Mw(e,t){let n=$(this.Zm),r=n.au(),i=n.vu();for(let n of i)this.Cw(e,t,hO,n);for(let n of r)this.Cw(e,t,hO,n);for(let n of i)this.Cw(e,t,gO,n);for(let n of r)this.Cw(e,t,gO,n)}Cw(e,t,n,r){let i=$(this.Zm),a=i.Qt().ou(),o=a!==null&&a.lu===r,s=a!==null&&o&&a.wu!==void 0?a.wu.ie:void 0;_O(t,(t=>n(t,e,o,s)),r,i)}nw(){if(this.Zm===null)return;let e=this.qv,t=this.Zm.K_().N().visible,n=this.Zm.Z_().N().visible;t||this.Lm===null||(this.Jm.removeChild(this.Lm.uv()),this.Lm.m(),this.Lm=null),n||this.zm===null||(this.Qm.removeChild(this.zm.uv()),this.zm.m(),this.zm=null);let r=e.Qt().Zd();t&&this.Lm===null&&(this.Lm=new bO(this,e.N(),r,`left`),this.Jm.appendChild(this.Lm.uv())),n&&this.zm===null&&(this.zm=new bO(this,e.N(),r,`right`),this.Qm.appendChild(this.zm.uv()))}yw(e){return e.Zp&&this.$m||this.jm!==null}rw(e,t,n){e=Math.max(0,Math.min(e,this.Qv.width-1)),t=Math.max(0,Math.min(t,this.Qv.height-1)),this.sn().jd(e,t,n,$(this.Zm))}cw(){this.sn().Yd()}pw(){this.qm&&(this.jm=null,this.cw())}uw(e,t,n){this.jm=e,this.qm=!1,this.rw(t.x,t.y,n);let r=this.sn().Rd();this.Ym={x:r.ni(),y:r.si()}}sn(){return this.qv.Qt()}_w(e){if(!this.Fm)return;let t=this.sn(),n=this.Sv();if(t.iu(n,n.Pn()),this.Nm=null,this.Fm=!1,t.Hd(),this.Km!==null){let e=performance.now(),n=t.Et();this.Km.me(n.Ac(),e),this.Km.jc(e)||t.ps(this.Km)}}ew(){this.jm=null}hw(){if(this.Zm){if(this.sn().cs(),document.activeElement!==document.body&&document.activeElement!==document.documentElement)$(document.activeElement).blur();else{let e=document.getSelection();e!==null&&e.removeAllRanges()}!this.Zm.Pn().Gi()&&this.sn().Et().Gi()}}ow(e){if(this.Zm===null)return;let t=this.sn(),n=t.Et();if(n.Gi())return;let r=this.qv.N(),i=r.handleScroll,a=r.kineticScroll;if((!i.pressedMouseMove||e.Zp)&&(!i.horzTouchDrag&&!i.vertTouchDrag||!e.Zp))return;let o=this.Zm.Pn(),s=performance.now();if(this.Nm!==null||this.yw(e)||(this.Nm={x:e.clientX,y:e.clientY,Sf:s,kw:e.localX,Pw:e.localY}),this.Nm!==null&&!this.Fm&&(this.Nm.x!==e.clientX||this.Nm.y!==e.clientY)){if(e.Zp&&a.touch||!e.Zp&&a.mouse){let e=n.fl();this.Km=new dO(.2/e,7/e,.997,15/e),this.Km.Fv(n.Ac(),this.Nm.Sf)}else this.Km=null;o.Gi()||t.Q_(this.Zm,o,e.localY),t.Fd(e.localX),this.Fm=!0}this.Fm&&(o.Gi()||t.tu(this.Zm,o,e.localY),t.Wd(e.localX),this.Km!==null&&this.Km.Fv(n.Ac(),s))}},EO=class{constructor(e,t,n,r,i){this.xt=!0,this.Qv=Q({width:0,height:0}),this.hm=()=>this.km(3),this.om=e===`left`,this.wd=n.Zd,this.yn=t,this.Tw=r,this.Rw=i,this.lv=document.createElement(`div`),this.lv.style.width=`25px`,this.lv.style.height=`100%`,this.lv.style.overflow=`hidden`,this.fm=pO(this.lv,Q({width:16,height:16})),this.fm.subscribeSuggestedBitmapSizeChanged(this.hm)}m(){this.fm.unsubscribeSuggestedBitmapSizeChanged(this.hm),mO(this.fm.canvasElement),this.fm.dispose()}uv(){return this.lv}cv(){return this.Qv}Cm(e){Pw(this.Qv,e)||(this.Qv=e,this.fm.resizeCanvasElement(e),this.lv.style.width=`${e.width}px`,this.lv.style.height=`${e.height}px`,this.xt=!0)}km(e){if(e<3&&!this.xt||this.Qv.width===0||this.Qv.height===0)return;this.xt=!1,this.fm.applySuggestedBitmapSize();let t=Uw(this.fm,{colorSpace:this.yn.layout.colorSpace});t!==null&&t.useBitmapCoordinateSpace((e=>{this.Tm(e),this.Rm(e)}))}dv(){return this.fm.bitmapSize}fv(e,t,n){let r=this.dv();r.width>0&&r.height>0&&e.drawImage(this.fm.canvasElement,t,n)}Rm({context:e,bitmapSize:t,horizontalPixelRatio:n,verticalPixelRatio:r}){if(!this.Tw())return;e.fillStyle=this.yn.timeScale.borderColor;let i=Math.floor(this.wd.N().S*n),a=Math.floor(this.wd.N().S*r),o=this.om?t.width-i:0;e.fillRect(o,0,i,a)}Tm({context:e,bitmapSize:t}){ST(e,0,0,t.width,t.height,this.Rw())}};function DO(e){return t=>t.Xa?.(e)??[]}var OO=DO(`normal`),kO=DO(`top`),AO=DO(`bottom`),jO=class{constructor(e,t){this.Dw=null,this.Iw=null,this.M=null,this.Vw=!1,this.Qv=Q({width:0,height:0}),this.Bw=new Qw,this.im=new WT(5),this.rm=!1,this.hm=()=>{this.rm||this.qv.Qt().mr()},this.lm=()=>{this.rm||this.qv.Qt().mr()},this.qv=e,this.xu=t,this.yn=e.N().layout,this.Hv=document.createElement(`tr`),this.Ew=document.createElement(`td`),this.Ew.style.padding=`0`,this.Aw=document.createElement(`td`),this.Aw.style.padding=`0`,this.lv=document.createElement(`td`),this.lv.style.height=`25px`,this.lv.style.padding=`0`,this.Lw=document.createElement(`div`),this.Lw.style.width=`100%`,this.Lw.style.height=`100%`,this.Lw.style.position=`relative`,this.Lw.style.overflow=`hidden`,this.lv.appendChild(this.Lw),this.fm=pO(this.Lw,Q({width:16,height:16})),this.fm.subscribeSuggestedBitmapSizeChanged(this.hm);let n=this.fm.canvasElement;n.style.position=`absolute`,n.style.zIndex=`1`,n.style.left=`0`,n.style.top=`0`,this.pm=pO(this.Lw,Q({width:16,height:16})),this.pm.subscribeSuggestedBitmapSizeChanged(this.lm);let r=this.pm.canvasElement;r.style.position=`absolute`,r.style.zIndex=`2`,r.style.left=`0`,r.style.top=`0`,this.Hv.appendChild(this.Ew),this.Hv.appendChild(this.lv),this.Hv.appendChild(this.Aw),this.zw(),this.qv.Qt().L_().i(this.zw.bind(this),this),this.tv=new nO(this.pm.canvasElement,this,{xp:()=>!0,Cp:()=>!this.qv.N().handleScroll.horzTouchDrag})}m(){this.tv.m(),this.Dw!==null&&this.Dw.m(),this.Iw!==null&&this.Iw.m(),this.pm.unsubscribeSuggestedBitmapSizeChanged(this.lm),mO(this.pm.canvasElement),this.pm.dispose(),this.fm.unsubscribeSuggestedBitmapSizeChanged(this.hm),mO(this.fm.canvasElement),this.fm.dispose()}uv(){return this.Hv}Ow(){return this.Dw}Nw(){return this.Iw}zp(e){if(this.Vw)return;this.Vw=!0;let t=this.qv.Qt();!t.Et().Gi()&&this.qv.N().handleScale.axisPressedMouseMove.time&&t.zd(e.localX)}Ap(e){this.zp(e)}Op(){let e=this.qv.Qt();!e.Et().Gi()&&this.Vw&&(this.Vw=!1,this.qv.N().handleScale.axisPressedMouseMove.time&&e.$d())}Pp(e){let t=this.qv.Qt();!t.Et().Gi()&&this.qv.N().handleScale.axisPressedMouseMove.time&&t.Ud(e.localX)}yp(e){this.Pp(e)}Ip(){this.Vw=!1;let e=this.qv.Qt();e.Et().Gi()&&!this.qv.N().handleScale.axisPressedMouseMove.time||e.$d()}Rp(){this.Ip()}up(){this.qv.N().handleScale.axisDoubleClickReset.time&&this.qv.Qt().ws()}ap(){this.up()}wp(){this.qv.Qt().N().handleScale.axisPressedMouseMove.time&&this.Em(1)}Yp(){this.Em(0)}cv(){return this.Qv}Fw(){return this.Bw}Ww(e,t,n){Pw(this.Qv,e)||(this.Qv=e,this.rm=!0,this.fm.resizeCanvasElement(e),this.pm.resizeCanvasElement(e),this.rm=!1,this.lv.style.width=`${e.width}px`,this.lv.style.height=`${e.height}px`,this.Bw.p(e)),this.Dw!==null&&this.Dw.Cm(Q({width:t,height:e.height})),this.Iw!==null&&this.Iw.Cm(Q({width:n,height:e.height}))}Hw(){let e=this.Uw();return Math.ceil(e.S+e.C+e.k+e.A+e.I+e.$w)}kt(){this.qv.Qt().Et().El()}dv(){return this.fm.bitmapSize}fv(e,t,n,r){let i=this.dv();if(i.width>0&&i.height>0&&(e.drawImage(this.fm.canvasElement,t,n),r)){let r=this.pm.canvasElement;e.drawImage(r,t,n)}}km(e){if(e===0)return;let t={colorSpace:this.yn.colorSpace};if(e!==1){this.fm.applySuggestedBitmapSize();let n=Uw(this.fm,t);n!==null&&(n.useBitmapCoordinateSpace((e=>{this.Tm(e),this.Rm(e),this.jw(n,AO)})),this.Im(n),this.jw(n,OO)),this.Dw!==null&&this.Dw.km(e),this.Iw!==null&&this.Iw.km(e)}this.pm.applySuggestedBitmapSize();let n=Uw(this.pm,t);n!==null&&(n.useBitmapCoordinateSpace((({context:e,bitmapSize:t})=>{e.clearRect(0,0,t.width,t.height)})),this.qw([...this.qv.Qt().Jn(),this.qv.Qt().Rd()],n),this.jw(n,kO))}jw(e,t){let n=this.qv.Qt().Jn();for(let r of n)_O(t,(t=>hO(t,e,!1,void 0)),r,void 0);for(let r of n)_O(t,(t=>gO(t,e,!1,void 0)),r,void 0)}Tm({context:e,bitmapSize:t}){ST(e,0,0,t.width,t.height,this.qv.Qt().ef())}Rm({context:e,bitmapSize:t,verticalPixelRatio:n}){if(this.qv.N().timeScale.borderVisible){e.fillStyle=this.Yw();let r=Math.max(1,Math.floor(this.Uw().S*n));e.fillRect(0,0,t.width,r)}}Im(e){let t=this.qv.Qt().Et(),n=t.El();if(!n||n.length===0)return;let r=this.xu.maxTickMarkWeight(n),i=this.Uw(),a=t.N();a.borderVisible&&a.ticksVisible&&e.useBitmapCoordinateSpace((({context:e,horizontalPixelRatio:t,verticalPixelRatio:r})=>{e.strokeStyle=this.Yw(),e.fillStyle=this.Yw();let a=Math.max(1,Math.floor(t)),o=Math.floor(.5*t);e.beginPath();let s=Math.round(i.C*r);for(let r=n.length;r--;){let i=Math.round(n[r].coord*t);e.rect(i-o,0,a,s)}e.fill()})),e.useMediaCoordinateSpace((({context:e})=>{let t=i.S+i.C+i.A+i.k/2;e.textAlign=`center`,e.textBaseline=`middle`,e.fillStyle=this.H(),e.font=this.Sm();for(let i of n)if(i.weight<r){let n=i.needAlignCoordinate?this.Kw(e,i.coord,i.label):i.coord;e.fillText(i.label,n,t)}this.qv.N().timeScale.allowBoldLabels&&(e.font=this.Zw());for(let i of n)if(i.weight>=r){let n=i.needAlignCoordinate?this.Kw(e,i.coord,i.label):i.coord;e.fillText(i.label,n,t)}}))}Kw(e,t,n){let r=this.im.Ii(e,n),i=r/2,a=Math.floor(t-i)+.5;return a<0?t+=Math.abs(0-a):a+r>this.Qv.width&&(t-=Math.abs(this.Qv.width-(a+r))),t}qw(e,t){let n=this.Uw();for(let r of e)for(let e of r.dn())e.Tt().st(t,n)}Yw(){return this.qv.N().timeScale.borderColor}H(){return this.yn.textColor}F(){return this.yn.fontSize}Sm(){return cT(this.F(),this.yn.fontFamily)}Zw(){return cT(this.F(),this.yn.fontFamily,`bold`)}Uw(){this.M===null&&(this.M={S:1,L:NaN,A:NaN,I:NaN,tn:NaN,C:5,k:NaN,P:``,Qi:new WT,$w:0});let e=this.M,t=this.Sm();if(e.P!==t){let n=this.F();e.k=n,e.P=t,e.A=3*n/12,e.I=3*n/12,e.tn=9*n/12,e.L=0,e.$w=4*n/12,e.Qi.Os()}return this.M}Em(e){this.lv.style.cursor=e===1?`ew-resize`:`default`}zw(){let e=this.qv.Qt(),t=e.N();t.leftPriceScale.visible||this.Dw===null||(this.Ew.removeChild(this.Dw.uv()),this.Dw.m(),this.Dw=null),t.rightPriceScale.visible||this.Iw===null||(this.Aw.removeChild(this.Iw.uv()),this.Iw.m(),this.Iw=null);let n={Zd:this.qv.Qt().Zd()},r=()=>t.leftPriceScale.borderVisible&&e.Et().N().borderVisible,i=()=>e.ef();t.leftPriceScale.visible&&this.Dw===null&&(this.Dw=new EO(`left`,t,n,r,i),this.Ew.appendChild(this.Dw.uv())),t.rightPriceScale.visible&&this.Iw===null&&(this.Iw=new EO(`right`,t,n,r,i),this.Aw.appendChild(this.Iw.uv()))}},MO=!!XD&&!!navigator.userAgentData&&navigator.userAgentData.brands.some((e=>e.brand.includes(`Chromium`)))&&!!XD&&(navigator?.userAgentData?.platform?navigator.userAgentData.platform===`Windows`:navigator.userAgent.toLowerCase().indexOf(`win`)>=0),NO=class{constructor(e,t,n){var r;this.Gw=[],this.Xw=[],this.Jw=0,this.ho=0,this.C_=0,this.Qw=0,this.tM=0,this.iM=null,this.nM=!1,this.Wm=new Qw,this.Hm=new Qw,this.pd=new Qw,this.sM=null,this.eM=null,this.jv=e,this.yn=t,this.xu=n,this.Hv=document.createElement(`div`),this.Hv.classList.add(`tv-lightweight-charts`),this.Hv.style.overflow=`hidden`,this.Hv.style.direction=`ltr`,this.Hv.style.width=`100%`,this.Hv.style.height=`100%`,(r=this.Hv).style.userSelect=`none`,r.style.webkitUserSelect=`none`,r.style.msUserSelect=`none`,r.style.MozUserSelect=`none`,r.style.webkitTapHighlightColor=`transparent`,this.rM=document.createElement(`table`),this.rM.setAttribute(`cellspacing`,`0`),this.Hv.appendChild(this.rM),this.hM=this.aM.bind(this),PO(this.yn)&&this.lM(!0),this.sn=new AD(this.md.bind(this),this.yn,n),this.Qt().Dd().i(this.oM.bind(this),this),this._M=new jO(this,this.xu),this.rM.appendChild(this._M.uv());let i=t.autoSize&&this.uM(),a=this.yn.width,o=this.yn.height;if(i||a===0||o===0){let t=e.getBoundingClientRect();a||=t.width,o||=t.height}this.cM(a,o),this.dM(),e.appendChild(this.Hv),this.fM(),this.sn.Et().Zc().i(this.sn.Pa.bind(this.sn),this),this.sn.L_().i(this.sn.Pa.bind(this.sn),this)}Qt(){return this.sn}N(){return this.yn}rv(){return this.Gw}pM(){return this._M}m(){this.lM(!1),this.Jw!==0&&window.cancelAnimationFrame(this.Jw),this.sn.Dd().u(this),this.sn.Et().Zc().u(this),this.sn.L_().u(this),this.sn.m();for(let e of this.Gw)this.rM.removeChild(e.uv()),e.dw().u(this),e.fw().u(this),e.m();this.Gw=[];for(let e of this.Xw)this.vM(e);this.Xw=[],$(this._M).m(),this.Hv.parentElement!==null&&this.Hv.parentElement.removeChild(this.Hv),this.pd.m(),this.Wm.m(),this.Hm.m(),this.mM()}cM(e,t,n=!1){if(this.ho===t&&this.C_===e)return;let r=function(e){let t=Math.floor(e.width),n=Math.floor(e.height);return Q({width:t-t%2,height:n-n%2})}(Q({width:e,height:t}));this.ho=r.height,this.C_=r.width;let i=this.ho+`px`,a=this.C_+`px`;if(this.wM()||($(this.Hv).style.height=i,$(this.Hv).style.width=a),this.rM.style.height=i,this.rM.style.width=a,n){this.Jw!==0&&(window.cancelAnimationFrame(this.Jw),this.Jw=0),this.nM=!1;let e=IT.ys();this.iM!==null&&(e.Ss(this.iM),this.iM=null),this.MM(e,performance.now())}else this.sn.Pa()}km(e){e===void 0&&(e=IT.ys());for(let t=0;t<this.Gw.length;t++)this.Gw[t].km(e._s(t).rs);this.yn.timeScale.visible&&this._M.km(e.ls())}vr(e){let t=PO(this.yn);this.sn.vr(e);let n=PO(this.yn);n!==t&&this.lM(n),e.layout?.panes&&this.gM(),this.fM(),this.bM(e)}dw(){return this.Wm}fw(){return this.Hm}Dd(){return this.pd}SM(e=!1){this.iM!==null&&(this.MM(this.iM,performance.now()),this.iM=null);let t=this.xM(null),n=document.createElement(`canvas`);n.width=t.width,n.height=t.height;let r=$(n.getContext(`2d`));return this.xM(r,e),n}CM(e){return e===`left`&&!this.yM()||e===`right`&&!this.kM()||this.Gw.length===0?0:$(e===`left`?this.Gw[0].Sw():this.Gw[0].xw()).ym()}wM(){return this.yn.autoSize&&this.sM!==null}vv(){return this.Hv}PM(e){this.eM=e,this.eM?this.vv().style.setProperty(`cursor`,e):this.vv().style.removeProperty(`cursor`)}TM(){return this.eM}RM(e){return Xw(this.Gw[e]).cv()}gM(){this.Xw.forEach((e=>{e.kt()}))}bM(e){(e.autoSize!==void 0||!this.sM||e.width===void 0&&e.height===void 0)&&(e.autoSize&&!this.sM&&this.uM(),!1===e.autoSize&&this.sM!==null&&this.mM(),e.autoSize||e.width===void 0&&e.height===void 0||this.cM(e.width||this.C_,e.height||this.ho))}xM(e,t){let n=0,r=0,i=this.Gw[0],a=(n,r)=>{let i=0;for(let a=0;a<this.Gw.length;a++){let o=this.Gw[a],s=$(n===`left`?o.Sw():o.xw()),c=s.dv();if(e!==null&&s.fv(e,r,i,t),i+=c.height,a<this.Gw.length-1){let t=this.Xw[a],n=t.dv();e!==null&&t.fv(e,r,i),i+=n.height}}};this.yM()&&(a(`left`,0),n+=$(i.Sw()).dv().width);for(let i=0;i<this.Gw.length;i++){let a=this.Gw[i],o=a.dv();if(e!==null&&a.fv(e,n,r,t),r+=o.height,i<this.Gw.length-1){let t=this.Xw[i],a=t.dv();e!==null&&t.fv(e,n,r),r+=a.height}}n+=i.dv().width,this.kM()&&(a(`right`,n),n+=$(i.xw()).dv().width);let o=(t,n,r)=>{$(t===`left`?this._M.Ow():this._M.Nw()).fv($(e),n,r)};if(this.yn.timeScale.visible){let n=this._M.dv();if(e!==null){let a=0;this.yM()&&(o(`left`,a,r),a=$(i.Sw()).dv().width),this._M.fv(e,a,r,t),a+=n.width,this.kM()&&o(`right`,a,r)}r+=n.height}return Q({width:n,height:r})}DM(){let e=0,t=0,n=0;for(let r of this.Gw)this.yM()&&(t=Math.max(t,$(r.Sw()).bm(),this.yn.leftPriceScale.minimumWidth)),this.kM()&&(n=Math.max(n,$(r.xw()).bm(),this.yn.rightPriceScale.minimumWidth)),e+=r.z_();t=eO(t),n=eO(n);let r=this.C_,i=this.ho,a=Math.max(r-t-n,0),o=1*this.Xw.length,s=this.yn.timeScale.visible,c=s?Math.max(this._M.Hw(),this.yn.timeScale.minimumHeight):0;var l;c=(l=c)+l%2;let u=o+c,d=i<u?0:i-u,f=d/e,p=0,m=window.devicePixelRatio||1;for(let e=0;e<this.Gw.length;++e){let r=this.Gw[e];r.iw(this.sn.Zn()[e]);let i=0,o=0;o=e===this.Gw.length-1?Math.ceil((d-p)*m)/m:Math.round(r.z_()*f*m)/m,i=Math.max(o,2),p+=i,r.Cm(Q({width:a,height:i})),this.yM()&&r.mw(t,`left`),this.kM()&&r.mw(n,`right`),r.Sv()&&this.sn.Id(r.Sv(),i)}this._M.Ww(Q({width:s?a:0,height:c}),s?t:0,s?n:0),this.sn.N_(a),this.Qw!==t&&(this.Qw=t),this.tM!==n&&(this.tM=n)}lM(e){e?this.Hv.addEventListener(`wheel`,this.hM,{passive:!1}):this.Hv.removeEventListener(`wheel`,this.hM)}IM(e){switch(e.deltaMode){case e.DOM_DELTA_PAGE:return 120;case e.DOM_DELTA_LINE:return 32}return MO?1/window.devicePixelRatio:1}aM(e){if(!(e.deltaX!==0&&this.yn.handleScroll.mouseWheel||e.deltaY!==0&&this.yn.handleScale.mouseWheel))return;let t=this.IM(e),n=t*e.deltaX/100,r=-t*e.deltaY/100;if(e.cancelable&&e.preventDefault(),r!==0&&this.yn.handleScale.mouseWheel){let t=Math.sign(r)*Math.min(1,Math.abs(r)),n=e.clientX-this.Hv.getBoundingClientRect().left;this.Qt().Od(n,t)}n!==0&&this.yn.handleScroll.mouseWheel&&this.Qt().Nd(-80*n)}MM(e,t){let n=e.ls();n===3&&this.VM(),n!==3&&n!==2||(this.BM(e),this.EM(e,t),this._M.kt(),this.Gw.forEach((e=>{e.sw()})),this.iM?.ls()===3&&(this.iM.Ss(e),this.VM(),this.BM(this.iM),this.EM(this.iM,t),e=this.iM,this.iM=null)),this.km(e)}EM(e,t){for(let n of e.bs())this.xs(n,t)}BM(e){let t=this.sn.Zn();for(let n=0;n<t.length;n++)e._s(n).hs&&t[n].ru()}xs(e,t){let n=this.sn.Et();switch(e.ds){case 0:n.Xc();break;case 1:n.Jc(e.Wt);break;case 2:n.Ms(e.Wt);break;case 3:n.gs(e.Wt);break;case 4:n.Oc();break;case 5:e.Wt.jc(t)||n.gs(e.Wt.qc(t))}}md(e){this.iM===null?this.iM=e:this.iM.Ss(e),this.nM||(this.nM=!0,this.Jw=window.requestAnimationFrame((e=>{if(this.nM=!1,this.Jw=0,this.iM!==null){let t=this.iM;this.iM=null,this.MM(t,e);for(let n of t.bs())if(n.ds===5&&!n.Wt.jc(e)){this.Qt().ps(n.Wt);break}}})))}VM(){this.dM()}vM(e){this.rM.removeChild(e.uv()),e.m()}dM(){let e=this.sn.Zn(),t=e.length,n=this.Gw.length;for(let e=t;e<n;e++){let e=Xw(this.Gw.pop());this.rM.removeChild(e.uv()),e.dw().u(this),e.fw().u(this),e.m();let t=this.Xw.pop();t!==void 0&&this.vM(t)}for(let r=n;r<t;r++){let t=new TO(this,e[r]);if(t.dw().i(this.AM.bind(this,t),this),t.fw().i(this.LM.bind(this,t),this),this.Gw.push(t),r>0){let e=new cO(this,r-1,r);this.Xw.push(e),this.rM.insertBefore(e.uv(),this._M.uv())}this.rM.insertBefore(t.uv(),this._M.uv())}for(let n=0;n<t;n++){let t=e[n],r=this.Gw[n];r.Sv()===t?r.tw():r.iw(t)}this.fM(),this.DM()}zM(e,t,n,r){let i=new Map;e!==null&&this.sn.Jn().forEach((t=>{let n=t.Un().Hn(e);n!==null&&i.set(t,n)}));let a;if(e!==null){let t=this.sn.Et().en(e)?.originalTime;t!==void 0&&(a=t)}let o=this.Qt().ou(),s=this.OM(r),c=function(e,t){let n=e!==null&&e.lu instanceof LE?e.lu:void 0,r=e?.wu?.te,i=t!==void 0&&t!==-1?t:void 0;return e===null||e.ee===void 0?{NM:n,FM:r}:{NM:n,FM:r,WM:{ds:e.ee,HM:(a=e.lu,o=e.ee,a instanceof uD?`pane-primitive`:o===`marker`||o===`primitive`?`series-primitive`:`series`),UM:$D(e.ee,r),U_:n,$M:r,jM:i}};var a,o}(o,s);return{Qr:a,$n:e??void 0,qM:t??void 0,jM:s===-1?void 0:s,NM:c.NM,YM:i,FM:c.FM,WM:c.WM,KM:n??void 0}}OM(e){let t=-1;if(e)t=this.Gw.indexOf(e);else{let e=this.Qt().Rd().Kn();e!==null&&(t=this.Qt().Zn().indexOf(e))}return t}AM(e,t,n,r){this.Wm.p((()=>this.zM(t,n,r,e)))}LM(e,t,n,r){this.Hm.p((()=>this.zM(t,n,r,e)))}oM(e,t,n){this.PM(this.Qt().ou()?.mu??null),this.pd.p((()=>this.zM(e,t,n)))}fM(){let e=this.yn.timeScale.visible?``:`none`;this._M.uv().style.display=e}yM(){return this.Gw[0].Sv().K_().N().visible}kM(){return this.Gw[0].Sv().Z_().N().visible}uM(){return`ResizeObserver`in window&&(this.sM=new ResizeObserver((e=>{let t=e[e.length-1];if(!t)return;let n=t.contentRect.width,r=t.contentRect.height;this.cM(n,r,!0)})),this.sM.observe(this.jv,{box:`border-box`}),!0)}mM(){this.sM!==null&&this.sM.disconnect(),this.sM=null}};function PO(e){return!!(e.handleScroll.mouseWheel||e.handleScale.mouseWheel)}function FO(e){return e.open===void 0&&e.value===void 0}function IO(e){return function(e){return e.open!==void 0}(e)||function(e){return e.value!==void 0}(e)}function LO(e,t,n,r){let i=n.value,a={$n:t,wt:e,Wt:[i,i,i,i],Qr:r};return n.color!==void 0&&(a.R=n.color),a}function RO(e,t,n,r){let i=n.value,a={$n:t,wt:e,Wt:[i,i,i,i],Qr:r};return n.lineColor!==void 0&&(a.vt=n.lineColor),n.topColor!==void 0&&(a.ah=n.topColor),n.bottomColor!==void 0&&(a.oh=n.bottomColor),a}function zO(e,t,n,r){let i=n.value,a={$n:t,wt:e,Wt:[i,i,i,i],Qr:r};return n.topLineColor!==void 0&&(a._h=n.topLineColor),n.bottomLineColor!==void 0&&(a.uh=n.bottomLineColor),n.topFillColor1!==void 0&&(a.dh=n.topFillColor1),n.topFillColor2!==void 0&&(a.fh=n.topFillColor2),n.bottomFillColor1!==void 0&&(a.ph=n.bottomFillColor1),n.bottomFillColor2!==void 0&&(a.mh=n.bottomFillColor2),a}function BO(e,t,n,r){let i={$n:t,wt:e,Wt:[n.open,n.high,n.low,n.close],Qr:r};return n.color!==void 0&&(i.R=n.color),i}function VO(e,t,n,r){let i={$n:t,wt:e,Wt:[n.open,n.high,n.low,n.close],Qr:r};return n.color!==void 0&&(i.R=n.color),n.borderColor!==void 0&&(i.Ht=n.borderColor),n.wickColor!==void 0&&(i.hh=n.wickColor),i}function HO(e,t,n,r,i){let a=Xw(i)(n),o=Math.max(...a),s=Math.min(...a),c=a[a.length-1],l=[c,o,s,c],{time:u,color:d,...f}=n;return{$n:t,wt:e,Wt:l,Qr:r,ue:f,R:d}}function UO(e){return e.Wt!==void 0}function WO(e,t){return t.customValues!==void 0&&(e.ZM=t.customValues),e}function GO(e){return(t,n,r,i,a,o)=>function(e,t){return t?t(e):FO(e)}(r,o)?WO({wt:t,$n:n,Qr:i},r):WO(e(t,n,r,i,a),r)}function KO(e){return{Candlestick:GO(VO),Bar:GO(BO),Area:GO(RO),Baseline:GO(zO),Histogram:GO(LO),Line:GO(LO),Custom:GO(HO)}[e]}function qO(e){return{$n:0,GM:new Map,za:e}}function JO(e,t){if(e!==void 0&&e.length!==0)return{XM:t.key(e[0].wt),JM:t.key(e[e.length-1].wt)}}function YO(e){let t;return e.forEach((e=>{t===void 0&&(t=e.Qr)})),Xw(t)}var XO=class{constructor(e){this.QM=new Map,this.tg=new Map,this.ig=new Map,this.ng=[],this.xu=e}m(){this.QM.clear(),this.tg.clear(),this.ig.clear(),this.ng=[]}sg(e,t){let n=this.QM.size!==0,r=!1,i=this.tg.get(e);if(i!==void 0)if(this.tg.size===1)n=!1,r=!0,this.QM.clear();else for(let t of this.ng)t.pointData.GM.delete(e)&&(r=!0);let a=[];if(t.length!==0){let n=t.map((e=>e.time)),i=this.xu.createConverterToInternalObj(t),o=KO(e.bh()),s=e.ll(),c=e.ol();a=t.map(((t,a)=>{let l=i(t.time),u=this.xu.key(l),d=this.QM.get(u);d===void 0&&(d=qO(l),this.QM.set(u,d),r=!0);let f=o(l,d.$n,t,n[a],s,c);return d.GM.set(e,f),f}))}n&&this.eg(),this.rg(e,a);let o=-1;if(r){let e=[];this.QM.forEach((t=>{e.push({timeWeight:0,time:t.za,pointData:t,originalTime:YO(t.GM)})})),e.sort(((e,t)=>this.xu.key(e.time)-this.xu.key(t.time))),o=this.hg(e)}return this.ag(e,o,function(e,t,n){let r=JO(e,n),i=JO(t,n);if(r!==void 0&&i!==void 0)return{lg:!1,Ia:r.JM>=i.JM&&r.XM>=i.XM}}(this.tg.get(e),i,this.xu))}Jd(e){return this.sg(e,[])}og(e,t,n){if(n&&e.Na())throw Error(`Historical updates are not supported when conflation is enabled. Conflation requires data to be processed in order.`);let r=t;(function(e){e.Qr===void 0&&(e.Qr=e.time)})(r),this.xu.preprocessData(t);let i=this.xu.createConverterToInternalObj([t])(t.time),a=this.ig.get(e);if(!n&&a!==void 0&&this.xu.key(i)<this.xu.key(a))throw Error(`Cannot update oldest data, last time=${a}, new time=${i}`);let o=this.QM.get(this.xu.key(i));if(n&&o===void 0)throw Error(`Cannot update non-existing data point when historicalUpdate is true`);let s=o===void 0;o===void 0&&(o=qO(i),this.QM.set(this.xu.key(i),o));let c=KO(e.bh()),l=e.ll(),u=e.ol(),d=c(i,o.$n,t,r.Qr,l,u),f=!n&&!s&&a!==void 0&&this.xu.key(i)===this.xu.key(a);o.GM.set(e,d),n?this._g(e,d,o.$n):(f&&e.Na()&&UO(d)&&e.Rr(d),this.ug(e,d));let p={Ia:UO(d),lg:n};if(!s)return this.ag(e,-1,p);let m={timeWeight:0,time:o.za,pointData:o,originalTime:YO(o.GM)},ee=mE(this.ng,this.xu.key(m.time),((e,t)=>this.xu.key(e.time)<t));this.ng.splice(ee,0,m);for(let e=ee;e<this.ng.length;++e)ZO(this.ng[e].pointData,e);return this.xu.fillWeightsForPoints(this.ng,ee),this.ag(e,ee,p)}cg(e,t){let n=this.tg.get(e);if(n===void 0||t<=0)return[[],this.dg()];t=Math.min(t,n.length);let r=n.splice(-t).reverse();n.length===0?this.ig.delete(e):this.ig.set(e,n[n.length-1].wt);for(let t of r){let n=this.QM.get(this.xu.key(t.wt));if(n&&(n.GM.delete(e),n.GM.size===0)){this.QM.delete(this.xu.key(n.za)),this.ng.splice(n.$n,1);for(let e=n.$n;e<this.ng.length;++e)ZO(this.ng[e].pointData,e)}}return[r,this.ag(e,this.ng.length-1,{lg:!1,Ia:!1})]}ug(e,t){let n=this.tg.get(e);n===void 0&&(n=[],this.tg.set(e,n));let r=n.length===0?null:n[n.length-1];r===null||this.xu.key(t.wt)>this.xu.key(r.wt)?UO(t)&&n.push(t):UO(t)?n[n.length-1]=t:n.splice(-1,1),this.ig.set(e,t.wt)}_g(e,t,n){let r=this.tg.get(e);if(r===void 0)return;let i=mE(r,n,((e,t)=>e.$n<t));UO(t)?r[i]=t:r.splice(i,1)}rg(e,t){t.length===0?(this.tg.delete(e),this.ig.delete(e)):(this.tg.set(e,t.filter(UO)),this.ig.set(e,t[t.length-1].wt))}eg(){for(let e of this.ng)e.pointData.GM.size===0&&this.QM.delete(this.xu.key(e.time))}hg(e){let t=-1;for(let n=0;n<this.ng.length&&n<e.length;++n){let r=this.ng[n],i=e[n];if(this.xu.key(r.time)!==this.xu.key(i.time)){t=n;break}i.timeWeight=r.timeWeight,ZO(i.pointData,n)}if(t===-1&&this.ng.length!==e.length&&(t=Math.min(this.ng.length,e.length)),t===-1)return-1;for(let n=t;n<e.length;++n)ZO(e[n].pointData,n);return this.xu.fillWeightsForPoints(e,t),this.ng=e,t}fg(){if(this.tg.size===0)return null;let e=0;return this.tg.forEach((t=>{t.length!==0&&(e=Math.max(e,t[t.length-1].$n))})),e}ag(e,t,n){let r=this.dg();if(t!==-1)this.tg.forEach(((t,i)=>{r.U_.set(i,{ue:t,pg:i===e?n:void 0})})),this.tg.has(e)||r.U_.set(e,{ue:[],pg:n}),r.Et.vg=this.ng,r.Et.mg=t;else{let t=this.tg.get(e);r.U_.set(e,{ue:t||[],pg:n})}return r}dg(){return{U_:new Map,Et:{Pc:this.fg()}}}};function ZO(e,t){e.$n=t,e.GM.forEach((e=>{e.$n=t}))}function QO(e,t){return e._t<t}function $O(e,t){return t<e._t}function ek(e,t,n,r){return mE(e,t,QO,n,r)}function tk(e,t,n,r){return hE(e,t,$O,n,r)}function nk(e,t,n){return{ne:e,se:t,ee:n}}var rk=[0,0];function ik(e,t,n){return t===void 0||t.wt!==e.wt-1?e._t-n/2:(t._t+e._t)/2}function ak(e,t,n){return t===void 0||t.wt!==e.wt+1?e._t+n/2:(e._t+t._t)/2}function ok(e,t,n,r,i,a,o){if(t===null||t.from>=t.to||e.length===0)return null;let s=i/2+a,c=ek(e,n-s,t.from,t.to),l=tk(e,n+s,c,t.to);if(c>=l)return null;let u=1/0;for(let s=c;s<l;s++){let c=e[s],l=s>t.from?e[s-1]:void 0,d=s<t.to-1?e[s+1]:void 0,f=ik(c,l,i)-a,p=ak(c,d,i)+a;if(n<f||n>p)continue;o(c,rk);let m=rk[0],ee=rk[1],h=Math.min(m,ee),te=Math.max(m,ee),ne=h-a,g=te+a;if(r>=h&&r<=te)u=Math.min(u,0);else if(r>=ne&&r<=g){let e=Math.min(Math.abs(r-h),Math.abs(te-r));u=Math.min(u,e)}}return Number.isFinite(u)?nk(u,0,`series-range`):null}function sk(e,t){return e.wt<t}function ck(e,t){return t<e.wt}function lk(e,t,n){let r=t.Oa(),i=t.bi(),a=mE(e,r,sk),o=hE(e,i,ck);if(!n)return{from:a,to:o};let s=a,c=o;return a>0&&a<e.length&&e[a].wt>=r&&(s=a-1),o>0&&o<e.length&&e[o-1].wt<=i&&(c=o+1),{from:s,to:c}}var uk=class{constructor(e,t,n){this.wg=!0,this.Mg=!0,this.gg=!0,this.bg=[],this.Sg=null,this.xg=-1,this.ae=e,this.le=t,this.Cg=n}kt(e){this.wg=!0,e===`data`&&(this.Mg=!0),e===`options`&&(this.gg=!0)}Tt(){return this.ae.It()?(this.yg(),this.Sg===null?null:this.kg):null}Qs(e,t){return this.ae.It()?(this.yg(),this.Sg===null?null:this.Pg(e,t)):null}Pg(e,t){return null}Tg(){this.bg=this.bg.map((e=>({...e,...this.ae.Sa().Sh(e.wt)})))}Rg(){this.Sg=null}yg(){let e=this.le.Et(),t=e.N().enableConflation?e.Qc():0;t!==this.xg&&(this.Mg=!0,this.xg=t),this.Mg&&=(this.Dg(),!1),this.gg&&=(this.Tg(),!1),this.wg&&=(this.Ig(),!1)}Ig(){let e=this.ae.Ft(),t=this.le.Et();if(this.Rg(),t.Gi()||e.Gi())return;let n=t.Ee();if(n===null||this.ae.Un().Th()===0)return;let r=this.ae.Lt();r!==null&&(this.Sg=lk(this.bg,n,this.Cg),this.Vg(e,t,r.Wt),this.Bg())}},dk=class{constructor(e,t){this.Eg=e,this.Ki=t}st(e,t,n){this.Eg.draw(e,this.Ki,t,n)}};function fk(e){switch(e){case`point`:return 2;case`range`:return 0;default:return 1}}var pk=class extends uk{constructor(e,t,n){super(e,t,!1),this.Yh=n,this.Eg=this.Yh.renderer(),this.kg=new dk(this.Eg,(e=>this.Ag(e)))}get ga(){return this.Yh.conflationReducer}Wa(e){return this.Yh.priceValueBuilder(e)}_l(e){return this.Yh.isWhitespace(e)}Pg(e,t){let n=this.Eg.hitTest?.(e,t,(e=>this.Ag(e)));if(n!=null)return{ne:(r=n).distance,se:fk(r.type),ee:`custom`,mu:r.cursorStyle,te:r.objectId,ie:r.hitTestData};var r;let i=ok(this.bg,this.Sg,e,t,this.le.Et().fl(),this.ae.N().hitTestTolerance,((e,t)=>{let n=e.Lg,r=NaN,i=NaN;if(n!==void 0&&!this.Yh.isWhitespace(n))for(let e of this.Yh.priceValueBuilder(n)){let t=this.Ag(e);t!==null&&(r=Number.isNaN(r)?t:Math.min(r,t),i=Number.isNaN(i)?t:Math.max(i,t))}t[0]=r,t[1]=i}));return i===null?null:{...i,ee:`custom`}}Dg(){let e=this.ae.Sa();this.bg=this.ae.Ha().Bh().map((t=>({wt:t.$n,_t:NaN,...e.Sh(t.$n),Lg:t.ue})))}Vg(e,t){t.Tc(this.bg,oT(this.Sg))}Bg(){this.Yh.update({bars:this.bg.map(mk),barSpacing:this.le.Et().fl(),visibleRange:this.Sg,conflationFactor:this.le.Et().Qc()},this.ae.N())}Ag(e){let t=this.ae.Lt();return t===null?null:this.ae.Ft().Nt(e,t.Wt)}};function mk(e){return{x:e._t,time:e.wt,originalData:e.Lg,barColor:e.sh}}var hk={color:`#2196f3`},gk=(e,t,n)=>new pk(e,t,Zw(n));function _k(e){let t={value:e.Wt[3],time:e.Qr};return e.ZM!==void 0&&(t.customValues=e.ZM),t}function vk(e){let t=_k(e);return e.R!==void 0&&(t.color=e.R),t}function yk(e){let t=_k(e);return e.vt!==void 0&&(t.lineColor=e.vt),e.ah!==void 0&&(t.topColor=e.ah),e.oh!==void 0&&(t.bottomColor=e.oh),t}function bk(e){let t=_k(e);return e._h!==void 0&&(t.topLineColor=e._h),e.uh!==void 0&&(t.bottomLineColor=e.uh),e.dh!==void 0&&(t.topFillColor1=e.dh),e.fh!==void 0&&(t.topFillColor2=e.fh),e.ph!==void 0&&(t.bottomFillColor1=e.ph),e.mh!==void 0&&(t.bottomFillColor2=e.mh),t}function xk(e){let t={open:e.Wt[0],high:e.Wt[1],low:e.Wt[2],close:e.Wt[3],time:e.Qr};return e.ZM!==void 0&&(t.customValues=e.ZM),t}function Sk(e){let t=xk(e);return e.R!==void 0&&(t.color=e.R),t}function Ck(e){let t=xk(e),{R:n,Ht:r,hh:i}=e;return n!==void 0&&(t.color=n),r!==void 0&&(t.borderColor=r),i!==void 0&&(t.wickColor=i),t}function wk(e){return{Area:yk,Line:vk,Baseline:bk,Histogram:vk,Bar:Sk,Candlestick:Ck,Custom:Tk}[e]}function Tk(e){let t=e.Qr;return{...e.ue,time:t}}var Ek={vertLine:{color:`#9598A1`,width:1,style:3,visible:!0,labelVisible:!0,labelBackgroundColor:`#131722`},horzLine:{color:`#9598A1`,width:1,style:3,visible:!0,labelVisible:!0,labelBackgroundColor:`#131722`},mode:1,doNotSnapToHiddenSeriesIndices:!1},Dk={vertLines:{color:`#D6DCDE`,style:0,visible:!0},horzLines:{color:`#D6DCDE`,style:0,visible:!0}},Ok={background:{type:`solid`,color:`#FFFFFF`},textColor:`#191919`,fontSize:12,fontFamily:sT,panes:{enableResize:!0,separatorColor:`#E0E3EB`,separatorHoverColor:`rgba(178, 181, 189, 0.2)`},attributionLogo:!0,colorSpace:`srgb`,colorParsers:[]},kk={autoScale:!0,mode:0,invertScale:!1,alignLabels:!0,borderVisible:!0,borderColor:`#2B2B43`,entireTextOnly:!1,visible:!1,ticksVisible:!1,scaleMargins:{bottom:.1,top:.2},minimumWidth:0,ensureEdgeTickMarksVisible:!1,tickMarkDensity:2.5},Ak={rightOffset:0,barSpacing:6,minBarSpacing:.5,maxBarSpacing:0,fixLeftEdge:!1,fixRightEdge:!1,lockVisibleTimeRangeOnResize:!1,rightBarStaysOnScroll:!1,borderVisible:!0,borderColor:`#2B2B43`,visible:!0,timeVisible:!1,secondsVisible:!0,shiftVisibleRangeOnNewBar:!0,allowShiftVisibleRangeOnWhitespaceReplacement:!1,ticksVisible:!1,uniformDistribution:!1,minimumHeight:0,allowBoldLabels:!0,ignoreWhitespaceIndices:!1,enableConflation:!1,conflationThresholdFactor:1,precomputeConflationOnInit:!1,precomputeConflationPriority:`background`};function jk(){return{addDefaultPane:!0,hoveredSeriesOnTop:!0,width:0,height:0,autoSize:!1,layout:Ok,crosshair:Ek,grid:Dk,overlayPriceScales:{...kk},leftPriceScale:{...kk,visible:!1},rightPriceScale:{...kk,visible:!0},defaultVisiblePriceScaleId:`right`,timeScale:Ak,localization:{locale:XD?navigator.language:``,dateFormat:`dd MMM 'yy`},handleScroll:{mouseWheel:!0,pressedMouseMove:!0,horzTouchDrag:!0,vertTouchDrag:!0},handleScale:{axisPressedMouseMove:{time:!0,price:!0},axisDoubleClickReset:{time:!0,price:!0},mouseWheel:!0,pinch:!0},kineticScroll:{mouse:!1,touch:!0},trackingMode:{exitMode:1}}}var Mk=class{constructor(e,t,n){this.sv=e,this.zg=t,this.Og=n??0}applyOptions(e){this.sv.Qt().Pd(this.zg,e,this.Og)}options(){return this.Ki().N()}width(){return FT(this.zg)?this.sv.CM(this.zg):0}setVisibleRange(e){this.setAutoScale(!1),this.Ki().qo(new nE(e.from,e.to))}getVisibleRange(){let e,t,n=this.Ki().ar();if(n===null)return null;if(this.Ki().so()){let r=this.Ki().M_(),i=jD(r);n=eD(n,this.Ki().ro()),e=Number((Math.round(n.Je()/r)*r).toFixed(i)),t=Number((Math.round(n.Qe()/r)*r).toFixed(i))}else e=n.Je(),t=n.Qe();return{from:e,to:t}}setAutoScale(e){this.applyOptions({autoScale:e})}Ki(){return $(this.sv.Qt().Td(this.zg,this.Og)).Ft}},Nk=class{constructor(e,t,n,r){this.sv=e,this.yt=n,this.Ng=t,this.Fg=r}getHeight(){return this.yt.$t()}setHeight(e){let t=this.sv.Qt(),n=t.hf(this.yt);t.Bd(n,e)}getStretchFactor(){return this.yt.z_()}setStretchFactor(e){this.yt.O_(e),this.sv.Qt().Pa()}paneIndex(){return this.sv.Qt().hf(this.yt)}moveTo(e){let t=this.paneIndex();t!==e&&(Yw(e>=0&&e<this.sv.rv().length,`Invalid pane index`),this.sv.Qt().Ad(t,e))}getSeries(){return this.yt.U_().map((e=>this.Ng(e)))??[]}getHTMLElement(){let e=this.sv.rv();return e&&e.length!==0&&e[this.paneIndex()]?e[this.paneIndex()].uv():null}attachPrimitive(e){this.yt.hl(e),e.attached&&e.attached({chart:this.Fg,requestUpdate:()=>this.yt.Qt().Pa()})}detachPrimitive(e){this.yt.al(e)}priceScale(e){if(this.yt.A_(e)===null)throw Error(`Cannot find price scale with id: ${e}`);return new Mk(this.sv,e,this.paneIndex())}setPreserveEmptyPane(e){this.yt.W_(e)}preserveEmptyPane(){return this.yt.H_()}addCustomSeries(e,t={},n=0){return this.Fg.addCustomSeries(e,t,n)}addSeries(e,t={}){return this.Fg.addSeries(e,t,this.paneIndex())}},Pk={color:`#FF0000`,price:0,lineStyle:2,lineWidth:1,lineVisible:!0,axisLabelVisible:!0,title:``,axisLabelColor:``,axisLabelTextColor:``},Fk=class{constructor(e){this._r=e}applyOptions(e){this._r.vr(e)}options(){return this._r.N()}Wg(){return this._r}},Ik=class{constructor(e,t,n,r,i,a){this.Hg=new Qw,this.ae=e,this.Ug=t,this.$g=n,this.xu=i,this.Fg=r,this.jg=a}m(){this.Hg.m()}priceFormatter(){return this.ae.tl()}priceToCoordinate(e){let t=this.ae.Lt();return t===null?null:this.ae.Ft().Nt(e,t.Wt)}coordinateToPrice(e){let t=this.ae.Lt();return t===null?null:this.ae.Ft().Tn(e,t.Wt)}barsInLogicalRange(e){if(e===null)return null;let t=new SD(new yD(e.from,e.to)).Fu(),n=this.ae.Un();if(n.Gi())return null;let r=n.Hn(t.Oa(),1),i=n.Hn(t.bi(),-1),a=$(n.Rh()),o=$(n.Qn());if(r!==null&&i!==null&&r.$n>i.$n)return{barsBefore:e.from-a,barsAfter:o-e.to};let s={barsBefore:r===null||r.$n===a?e.from-a:r.$n-a,barsAfter:i===null||i.$n===o?o-e.to:o-i.$n};return r!==null&&i!==null&&(s.from=r.Qr,s.to=i.Qr),s}setData(e){this.xu,this.ae.bh(),this.Ug.qg(this.ae,e),this.Yg(`full`)}update(e,t=!1){this.ae.bh(),this.Ug.Kg(this.ae,e,t),this.Yg(`update`)}pop(e=1){let t=this.Ug.Zg(this.ae,e);t.length!==0&&this.Yg(`update`);let n=wk(this.seriesType());return t.map((e=>n(e)))}dataByIndex(e,t){let n=this.ae.Un().Hn(e,t);return n===null?null:wk(this.seriesType())(n)}data(){let e=wk(this.seriesType());return this.ae.Un().Bh().map((t=>e(t)))}subscribeDataChanged(e){this.Hg.i(e)}unsubscribeDataChanged(e){this.Hg._(e)}applyOptions(e){this.ae.vr(e)}options(){return iT(this.ae.N())}priceScale(){return this.$g.priceScale(this.ae.Ft().cl(),this.getPane().paneIndex())}createPriceLine(e){let t=$w(iT(Pk),e);return new Fk(this.ae.Ba(t))}removePriceLine(e){this.ae.Ea(e.Wg())}priceLines(){return this.ae.Aa().map((e=>new Fk(e)))}seriesType(){return this.ae.bh()}lastValueData(e){let t=this.ae.Ae(e);return t.Le?{noData:!0}:{noData:!1,price:t.Mt,color:t.R}}attachPrimitive(e){this.ae.hl(e),e.attached&&e.attached({chart:this.Fg,series:this,requestUpdate:()=>this.ae.Qt().Pa(),horzScaleBehavior:this.xu})}detachPrimitive(e){this.ae.al(e),e.detached&&e.detached(),this.ae.Qt().Pa()}getPane(){let e=this.ae,t=$(this.ae.Qt().Ks(e));return this.jg(t)}moveToPane(e){this.ae.Qt().nf(this.ae,e)}seriesOrder(){let e=this.ae.Qt().Ks(this.ae);return e===null?-1:e.U_().indexOf(this.ae)}setSeriesOrder(e){let t=this.ae.Qt().Ks(this.ae);t!==null&&t.du(this.ae,e)}Yg(e){this.Hg.v()&&this.Hg.p(e)}},Lk=class{constructor(e,t,n){this.Gg=new Qw,this.Gu=new Qw,this.Bw=new Qw,this.sn=e,this.ia=e.Et(),this._M=t,this.ia.Yc().i(this.Xg.bind(this)),this.ia.Kc().i(this.Jg.bind(this)),this._M.Fw().i(this.Qg.bind(this)),this.xu=n}m(){this.ia.Yc().u(this),this.ia.Kc().u(this),this._M.Fw().u(this),this.Gg.m(),this.Gu.m(),this.Bw.m()}scrollPosition(){return this.ia.Ac()}scrollToPosition(e,t){t?this.ia.$c(e,1e3):this.sn.gs(e)}scrollToRealTime(){this.ia.Uc()}getVisibleRange(){let e=this.ia.gc();return e===null?null:{from:e.from.originalTime,to:e.to.originalTime}}setVisibleRange(e){let t={from:this.xu.convertHorzItemToInternal(e.from),to:this.xu.convertHorzItemToInternal(e.to)},n=this.ia.Cc(t);this.sn.tf(n)}getVisibleLogicalRange(){let e=this.ia.Mc();return e===null?null:{from:e.Oa(),to:e.bi()}}setVisibleLogicalRange(e){Yw(e.from<=e.to,`The from index cannot be after the to index.`),this.sn.tf(e)}resetTimeScale(){this.sn.ws()}fitContent(){this.sn.Xc()}logicalToCoordinate(e){let t=this.sn.Et();return t.Gi()?null:t.jt(e)}coordinateToLogical(e){return this.ia.Gi()?null:this.ia.Rc(e)}timeToIndex(e,t){let n=this.xu.convertHorzItemToInternal(e);return this.ia.vc(n,t)}timeToCoordinate(e){let t=this.timeToIndex(e,!1);return t===null?null:this.ia.jt(t)}coordinateToTime(e){let t=this.sn.Et(),n=t.Rc(e),r=t.en(n);return r===null?null:r.originalTime}width(){return this._M.cv().width}height(){return this._M.cv().height}subscribeVisibleTimeRangeChange(e){this.Gg.i(e)}unsubscribeVisibleTimeRangeChange(e){this.Gg._(e)}subscribeVisibleLogicalRangeChange(e){this.Gu.i(e)}unsubscribeVisibleLogicalRangeChange(e){this.Gu._(e)}subscribeSizeChange(e){this.Bw.i(e)}unsubscribeSizeChange(e){this.Bw._(e)}applyOptions(e){this.ia.vr(e)}options(){return{...iT(this.ia.N()),barSpacing:this.ia.fl()}}Xg(){this.Gg.v()&&this.Gg.p(this.getVisibleRange())}Jg(){this.Gu.v()&&this.Gu.p(this.getVisibleLogicalRange())}Qg(e){this.Bw.p(e.width,e.height)}};function Rk(e){return function(e){if(rT(e.handleScale)){let t=e.handleScale;e.handleScale={axisDoubleClickReset:{time:t,price:t},axisPressedMouseMove:{time:t,price:t},mouseWheel:t,pinch:t}}else if(e.handleScale!==void 0){let{axisPressedMouseMove:t,axisDoubleClickReset:n}=e.handleScale;rT(t)&&(e.handleScale.axisPressedMouseMove={time:t,price:t}),rT(n)&&(e.handleScale.axisDoubleClickReset={time:n,price:n})}let t=e.handleScroll;rT(t)&&(e.handleScroll={horzTouchDrag:t,vertTouchDrag:t,mouseWheel:t,pressedMouseMove:t})}(e),e}var zk=class{constructor(e,t,n){this.tb=new Map,this.ib=new Map,this.nb=new Qw,this.sb=new Qw,this.eb=new Qw,this.od=new WeakMap,this.rb=new XO(t);let r=n===void 0?iT(jk()):$w(iT(jk()),Rk(n));this.hb=t,this.sv=new NO(e,r,t),this.sv.dw().i((e=>{this.nb.v()&&this.nb.p(this.ab(e()))}),this),this.sv.fw().i((e=>{this.sb.v()&&this.sb.p(this.ab(e()))}),this),this.sv.Dd().i((e=>{this.eb.v()&&this.eb.p(this.ab(e()))}),this);let i=this.sv.Qt();this.lb=new Lk(i,this.sv.pM(),this.hb)}remove(){this.sv.dw().u(this),this.sv.fw().u(this),this.sv.Dd().u(this),this.lb.m(),this.sv.m(),this.tb.clear(),this.ib.clear(),this.nb.m(),this.sb.m(),this.eb.m(),this.rb.m()}resize(e,t,n){this.autoSizeActive()||this.sv.cM(e,t,n)}addCustomSeries(e,t={},n=0){let r=(e=>({type:`Custom`,isBuiltIn:!1,defaultOptions:{...hk,...e.defaultOptions()},ob:gk,_b:e}))(Zw(e));return this.ub(r,t,n)}addSeries(e,t={},n=0){return this.ub(e,t,n)}removeSeries(e){let t=Xw(this.tb.get(e)),n=this.rb.Jd(t);this.sv.Qt().Jd(t),this.cb(n),this.tb.delete(e),this.ib.delete(t)}qg(e,t){this.cb(this.rb.sg(e,t))}Kg(e,t,n){this.cb(this.rb.og(e,t,n))}Zg(e,t){let[n,r]=this.rb.cg(e,t);return n.length!==0&&this.cb(r),n}subscribeClick(e){this.nb.i(e)}unsubscribeClick(e){this.nb._(e)}subscribeCrosshairMove(e){this.eb.i(e)}unsubscribeCrosshairMove(e){this.eb._(e)}subscribeDblClick(e){this.sb.i(e)}unsubscribeDblClick(e){this.sb._(e)}priceScale(e,t=0){return new Mk(this.sv,e,t)}timeScale(){return this.lb}applyOptions(e){this.sv.vr(Rk(e))}options(){return this.sv.N()}takeScreenshot(e=!1,t=!1){let n,r;try{t||(n=this.sv.Qt().N().crosshair.mode,this.sv.vr({crosshair:{mode:2}})),r=this.sv.SM(e)}finally{t||n===void 0||this.sv.Qt().vr({crosshair:{mode:n}})}return r}addPane(e=!1){let t=this.sv.Qt().af();return t.W_(e),this.fb(t)}removePane(e){this.sv.Qt().Vd(e)}swapPanes(e,t){this.sv.Qt().Ed(e,t)}autoSizeActive(){return this.sv.wM()}chartElement(){return this.sv.vv()}panes(){return this.sv.Qt().Zn().map((e=>this.fb(e)))}paneSize(e=0){let t=this.sv.RM(e);return{height:t.height,width:t.width}}setCrosshairPosition(e,t,n){let r=this.tb.get(n);if(r===void 0)return;let i=this.sv.Qt().Ks(r);i!==null&&this.sv.Qt().qd(e,t,i)}clearCrosshairPosition(){this.sv.Qt().Yd(!0)}horzBehaviour(){return this.hb}ub(e,t={},n=0){Yw(e.ob!==void 0),function(e){if(e===void 0||e.type===`custom`)return;let t=e;t.minMove!==void 0&&t.precision===void 0&&(t.precision=jD(t.minMove))}(t.priceFormat),e.type===`Candlestick`&&function(e){e.borderColor!==void 0&&(e.borderUpColor=e.borderColor,e.borderDownColor=e.borderColor),e.wickColor!==void 0&&(e.wickUpColor=e.wickColor,e.wickDownColor=e.wickColor)}(t);let r=$w(iT(Ww),iT(e.defaultOptions),t),i=e.ob,a=new LE(this.sv.Qt(),e.type,r,i,e._b);this.sv.Qt().Gd(a,n);let o=new Ik(a,this,this,this,this.hb,(e=>this.fb(e)));return this.tb.set(o,a),this.ib.set(a,o),o}cb(e){let t=this.sv.Qt();t.Kd(e.Et.Pc,e.Et.vg,e.Et.mg),e.U_.forEach(((e,t)=>t.ht(e.ue,e.pg))),t.Et()._c(),t.Bc()}pb(e){return Xw(this.ib.get(e))}mb(e){return e!==void 0&&this.ib.has(e)?this.pb(e):void 0}ab(e){let t=new Map;e.YM.forEach(((e,n)=>{let r=n.bh(),i=wk(r)(e);if(r!==`Custom`)Yw(IO(i));else{let e=n.ol();Yw(!e||!1===e(i))}t.set(this.pb(n),i)}));let n=this.mb(e.NM),r=e.WM===void 0?void 0:{type:e.WM.ds,sourceKind:e.WM.HM,objectKind:e.WM.UM,series:this.mb(e.WM.U_),objectId:e.WM.$M,paneIndex:e.WM.jM};return{time:e.Qr,logical:e.$n,point:e.qM,paneIndex:e.jM,hoveredInfo:r,hoveredSeries:n,hoveredObjectId:e.FM,seriesData:t,sourceEvent:e.KM}}fb(e){let t=this.od.get(e);return t||(t=new Nk(this.sv,(e=>this.pb(e)),e,this),this.od.set(e,t)),t}};function Bk(e){if(nT(e)){let t=document.getElementById(e);return Yw(t!==null,`Cannot find element in DOM with id=${e}`),t}return e}function Vk(e,t,n){let r=new zk(Bk(e),t,n);return t.setOptions(r.options()),r}function Hk(e,t){return Vk(e,new YD,YD.yf(t))}var Uk=class extends uk{constructor(e,t){super(e,t,!0)}Vg(e,t,n){t.Tc(this.bg,oT(this.Sg)),e.Zo(this.bg,n,oT(this.Sg))}Sb(e,t){return{wt:e,Mt:t,_t:NaN,ut:NaN}}Dg(){let e=this.ae.Sa();this.bg=this.ae.Ha().Bh().map((t=>{let n;if((t.Zr??1)>1){let e=t.Wt[1],r=t.Wt[2],i=t.Wt[3];n=Math.abs(e-i)>Math.abs(r-i)?e:r}else n=t.Wt[3];return this.xb(t.$n,n,e)}))}},Wk=class extends uk{constructor(e,t){super(e,t,!1)}Pg(e,t){return ok(this.bg,this.Sg,e,t,this.le.Et().fl(),this.ae.N().hitTestTolerance,((e,t)=>{t[0]=e.Qo,t[1]=e.t_}))}Vg(e,t,n){t.Tc(this.bg,oT(this.Sg)),e.Xo(this.bg,n,oT(this.Sg))}Qb(e,t,n){return{wt:e,jr:t.Wt[0],qr:t.Wt[1],Yr:t.Wt[2],Kr:t.Wt[3],_t:NaN,Jo:NaN,Qo:NaN,t_:NaN,i_:NaN}}Dg(){let e=this.ae.Sa();this.bg=this.ae.Ha().Bh().map((t=>this.xb(t.$n,t,e)))}},Gk=class extends mT{constructor(){super(...arguments),this.qt=null,this.Kb=0}ht(e){this.qt=e}et(e){if(this.qt===null||this.qt.Un.length===0||this.qt.lt===null)return;let{horizontalPixelRatio:t}=e;this.Kb=function(e,t){if(e>=2.5&&e<=4)return Math.floor(3*t);let n=1-.2*Math.atan(Math.max(4,e)-4)/(.5*Math.PI),r=Math.floor(e*n*t),i=Math.floor(e*t);return Math.max(Math.floor(t),Math.min(r,i))}(this.qt.fl,t),this.Kb>=2&&Math.floor(t)%2!=this.Kb%2&&this.Kb--;let n=this.qt.Un;this.qt.tS&&this.iS(e,n,this.qt.lt),this.qt.gi&&this.Rm(e,n,this.qt.lt);let r=this.nS(t);(!this.qt.gi||this.Kb>2*r)&&this.sS(e,n,this.qt.lt)}iS(e,t,n){if(this.qt===null)return;let{context:r,horizontalPixelRatio:i,verticalPixelRatio:a}=e,o=``,s=Math.min(Math.floor(i),Math.floor(this.qt.fl*i));s=Math.max(Math.floor(i),Math.min(s,this.Kb));let c=Math.floor(.5*s),l=null;for(let e=n.from;e<n.to;e++){let n=t[e];n.rh!==o&&(r.fillStyle=n.rh,o=n.rh);let u=Math.round(Math.min(n.Jo,n.i_)*a),d=Math.round(Math.max(n.Jo,n.i_)*a),f=Math.round(n.Qo*a),p=Math.round(n.t_*a),m=Math.round(i*n._t)-c,ee=m+s-1;l!==null&&(m=Math.max(l+1,m),m=Math.min(m,ee));let h=ee-m+1;r.fillRect(m,f,h,u-f),r.fillRect(m,d+1,h,p-d),l=ee}}nS(e){let t=Math.floor(1*e);this.Kb<=2*t&&(t=Math.floor(.5*(this.Kb-1)));let n=Math.max(Math.floor(e),t);return this.Kb<=2*n?Math.max(Math.floor(e),Math.floor(1*e)):n}Rm(e,t,n){if(this.qt===null)return;let{context:r,horizontalPixelRatio:i,verticalPixelRatio:a}=e,o=``,s=this.nS(i),c=null;for(let e=n.from;e<n.to;e++){let n=t[e];n.eh!==o&&(r.fillStyle=n.eh,o=n.eh);let l=Math.round(n._t*i)-Math.floor(.5*this.Kb),u=l+this.Kb-1,d=Math.round(Math.min(n.Jo,n.i_)*a),f=Math.round(Math.max(n.Jo,n.i_)*a);if(c!==null&&(l=Math.max(c+1,l),l=Math.min(l,u)),this.qt.fl*i>2*s)xT(r,l,d,u-l+1,f-d+1,s);else{let e=u-l+1;r.fillRect(l,d,e,f-d+1)}c=u}}sS(e,t,n){if(this.qt===null)return;let{context:r,horizontalPixelRatio:i,verticalPixelRatio:a}=e,o=``,s=this.nS(i);for(let e=n.from;e<n.to;e++){let n=t[e],c=Math.round(Math.min(n.Jo,n.i_)*a),l=Math.round(Math.max(n.Jo,n.i_)*a),u=Math.round(n._t*i)-Math.floor(.5*this.Kb),d=u+this.Kb-1;if(n.sh!==o){let e=n.sh;r.fillStyle=e,o=e}this.qt.gi&&(u+=s,c+=s,d-=s,l-=s),c>l||r.fillRect(u,c,d-u+1,l-c+1)}}},Kk=class extends Wk{constructor(){super(...arguments),this.kg=new Gk}xb(e,t,n){return{...this.Qb(e,t,n),...n.Sh(e)}}Bg(){let e=this.ae.N();this.kg.ht({Un:this.bg,fl:this.le.Et().fl(),tS:e.wickVisible,gi:e.borderVisible,lt:this.Sg})}},qk={type:`Candlestick`,isBuiltIn:!0,defaultOptions:{upColor:`#26a69a`,downColor:`#ef5350`,wickVisible:!0,borderVisible:!0,borderColor:`#378658`,borderUpColor:`#26a69a`,borderDownColor:`#ef5350`,wickColor:`#737375`,wickUpColor:`#26a69a`,wickDownColor:`#ef5350`},ob:(e,t)=>new Kk(e,t)},Jk=class extends mT{constructor(){super(...arguments),this.qt=null,this.eS=[]}ht(e){this.qt=e,this.eS=[]}et({context:e,horizontalPixelRatio:t,verticalPixelRatio:n}){if(this.qt===null||this.qt.ot.length===0||this.qt.lt===null)return;this.eS.length||this.rS(t);let r=Math.max(1,Math.floor(n)),i=Math.round(this.qt.hS*n)-Math.floor(r/2),a=i+r;for(let t=this.qt.lt.from;t<this.qt.lt.to;t++){let o=this.qt.ot[t],s=this.eS[t-this.qt.lt.from],c=Math.round(o.ut*n),l,u;e.fillStyle=o.sh,c<=i?(l=c,u=a):(l=i,u=c-Math.floor(r/2)+r),e.fillRect(s.Oa,l,s.bi-s.Oa+1,u-l)}}rS(e){if(this.qt===null||this.qt.ot.length===0||this.qt.lt===null)return void(this.eS=[]);let t=Math.ceil(this.qt.fl*e)<=1?0:Math.max(1,Math.floor(e)),n=Math.round(this.qt.fl*e)-t;this.eS=Array(this.qt.lt.to-this.qt.lt.from);for(let t=this.qt.lt.from;t<this.qt.lt.to;t++){let r=this.qt.ot[t],i=Math.round(r._t*e),a,o;if(n%2){let e=(n-1)/2;a=i-e,o=i+e}else{let e=n/2;a=i-e,o=i+e-1}this.eS[t-this.qt.lt.from]={Oa:a,bi:o,aS:i,ce:r._t*e,wt:r.wt}}for(let e=this.qt.lt.from+1;e<this.qt.lt.to;e++){let n=this.eS[e-this.qt.lt.from],r=this.eS[e-this.qt.lt.from-1];n.wt===r.wt+1&&n.Oa-r.bi!==t+1&&(r.aS>r.ce?r.bi=n.Oa-t-1:n.Oa=r.bi+t+1)}let r=Math.ceil(this.qt.fl*e);for(let e=this.qt.lt.from;e<this.qt.lt.to;e++){let t=this.eS[e-this.qt.lt.from];t.bi<t.Oa&&(t.bi=t.Oa);let n=t.bi-t.Oa+1;r=Math.min(n,r)}if(t>0&&r<4)for(let e=this.qt.lt.from;e<this.qt.lt.to;e++){let t=this.eS[e-this.qt.lt.from];t.bi-t.Oa+1>r&&(t.aS>t.ce?--t.bi:t.Oa+=1)}}},Yk=class extends Uk{constructor(){super(...arguments),this.kg=new Jk}Pg(e,t){let n=this.ae.Ft().Nt(this.ae.N().base,$(this.ae.Lt()).Wt);return n===null?null:ok(this.bg,this.Sg,e,t,this.le.Et().fl(),this.ae.N().hitTestTolerance,((e,t)=>{t[0]=e.ut,t[1]=n}))}xb(e,t,n){return{...this.Sb(e,t),...n.Sh(e)}}Bg(){let e={ot:this.bg,fl:this.le.Et().fl(),lt:this.Sg,hS:this.ae.Ft().Nt(this.ae.N().base,$(this.ae.Lt()).Wt)};this.kg.ht(e)}},Xk={type:`Histogram`,isBuiltIn:!0,defaultOptions:{color:`#26a69a`,base:0},ob:(e,t)=>new Yk(e,t)};({...Ww});var Zk={account:{name:`Name`,address:`Account address`,balances:`Balances`,noBalances:`No token balances were returned.`,nfts:`NFTs`,noNfts:`No NFTs in the scanned objects.`,noImage:`No image`,objectsTruncated:`Some objects beyond the scanned range are omitted.`},receipt:{success:`Transaction succeeded on Sui`,failure:`Transaction failed on Sui`,sender:`Sender`,account:`Affected account`,object:`Object`,noBalanceChanges:`No balance changes were recorded.`,gasComputation:`Computation cost`,gasStorage:`Storage cost`,gasRebate:`Storage rebate`,gasBudget:`Network fee limit (gas budget)`,netFeeExplanation:`The network fee shown above includes the storage rebate. If it is negative, the rebate exceeds the computation and storage charges.`,estimatedNetFeeExplanation:`The estimated network fee shown above includes the storage rebate. If it is negative, the rebate exceeds the estimated computation and storage charges.`,gasLimitExplanation:`The gas budget limits network fee spending. It is not an estimate of the amount charged.`,gasPrice:`Gas price`,gasPayment:`Gas payment object`,graph:`Transaction graph`,graphTip:`A diagram of this transaction's programmable transaction block (PTB), derived from public on-chain data. It is a diagnostic view only, not transaction input, signing, or a safety verdict.`,graphReviewTip:`A diagram of the transaction prepared for this review and simulation. It shows what is being reviewed, not an actual result, permission to sign, or a guarantee of safety.`,graphRendering:`Rendering the transaction graph…`,graphFailed:`The transaction graph could not be rendered`,graphZoomIn:`Zoom in`,graphZoomOut:`Zoom out`,graphCenter:`Center`,graphShowAddresses:`Show full addresses`,graphShowNames:`Show readable labels`,moveCalls:`Move calls`,noMoveCalls:`No Move calls were recorded.`,inputs:`Inputs`,noInputs:`No inputs were recorded.`,inputKinds:{object:`Owned object`,shared_object:`Shared object`,receiving:`Receiving object`,pure:`Pure value`,withdrawal:`Balance withdrawal`,unknown:`Input`},bytes:`bytes`,events:`Events`,noEvents:`No events were recorded.`,objectChanges:`Object changes`,noObjectChanges:`No object changes were recorded.`},chart:{boundaryUsdc:`Prices are in USDC, not USD; dollar parity is not guaranteed.`,boundaryScope:`Historical prices, not live quotes.`,source:`Source: DeepBookV3 Indexer.`,renderedWith:`Rendered with`,library:`TradingView Lightweight Charts`},common:{walletStatusRecovery:`Ask in chat to open Settings, then use Troubleshooting to restart the connection service. This does not confirm removal of a connection in your wallet app.`,mainnet:`Sui mainnet`,retrievedAt:`Data retrieved`}},Qk={en:Zk};function $k(){try{return(navigator.language||`en`).slice(0,2).toLowerCase()}catch{return`en`}}function eA(e=$k()){return Qk[e]??Zk}var tA=eA();yh();var nA={source_unavailable:`Chart data is unavailable right now.`,source_timeout:`The chart data source did not respond in time.`,source_http_error:`The chart data source returned an error.`,official_indexer_invalid_payload:`The chart data source returned information that could not be used.`,missing_pool_name:`No trading pair was selected.`,unsupported_interval:`This candle interval is not supported.`,invalid_timestamp:`A start or end time could not be read.`,invalid_timestamp_window:`The start time must be before the end time.`,invalid_limit:`The requested number of candles is not valid.`,unsupported_query_field:`This chart request includes an unsupported option.`,duplicate_query_field:`This chart request repeats an option.`,limit_exceeds_chart_cap:`This chart request exceeds the candle limit.`,pool_not_in_official_usdc_pools:`This trading pair is not available in the supported USDC charts.`},rA=L({start:M(),timestampMs:N().int(),open:M(),high:M(),low:M(),close:M(),volume:M()}),iA=[`Latest 500`,`Last 24h`,`Last 7d`,`Last 30d`],aA=L({status:V(`ok`),pools:I(L({poolName:M(),baseAsset:L({symbol:M()})})),intervals:I(M()),defaultInterval:M(),defaultLimit:N().int().positive(),maxCandles:N().int().positive()}),oA=L({status:B([`ok`,`empty_result`]),candles:I(rA),candleCount:N().int().nonnegative(),query:L({poolName:M(),interval:M(),startTimeMs:N().int().nonnegative().optional(),endTimeMs:N().int().nonnegative().optional(),limit:N().int().positive()}),source:L({fetchedAt:M()}),pair:L({baseAsset:L({symbol:M()}),quoteAsset:L({symbol:V(`USDC`)})})}).refine(e=>e.candleCount===e.candles.length,`Candle count differs from returned rows.`),sA={title:`DeepBook USDC chart`,guidance:(e,t)=>t.recoveryNeeded?`Ask in chat for a new chart with the pair and time range you want.`:void 0,controls(e,t){let n=aA.parse(e.data),r=document.createElement(`form`);r.className=`ui-form`;let i=Zv({choices:[{label:`Choose a pair`,value:``},...n.pools.map(e=>({label:`${e.baseAsset.symbol} / USDC`,value:e.poolName}))]});i.required=!0;let a=Zv({choices:n.intervals.map(e=>({label:e,value:e}))});a.value=typeof e.input.interval==`string`?e.input.interval:n.defaultInterval;let o=Yv({placeholder:`YYYY-MM-DDTHH:mm`}),s=Yv({placeholder:`YYYY-MM-DDTHH:mm`});typeof e.input.startTimeMs==`number`&&(o.value=fA(e.input.startTimeMs)),typeof e.input.endTimeMs==`number`&&(s.value=fA(e.input.endTimeMs));let c=Number(e.input.limit??n.defaultLimit),l=Qv(`Time range & interval`,e.input.startTimeMs!==void 0||e.input.endTimeMs!==void 0),u=Kv(`p`,`ui-note`,lA(e.input));for(let e of[o,s])e.addEventListener(`input`,()=>{u.textContent=`Custom range · UTC`});let d=Kv(`div`,`card-actions`);for(let e of iA){let t=qv(e===`Latest 500`?`Recent`:e,()=>{let t=uA(e,new Date);o.value=t.startInput,s.value=t.endInput,c=Number(t.limitInput),u.textContent=e===`Latest 500`?`Recent candles · UTC`:`${e} · UTC`,p()},`secondary`);d.append(t)}let f=Kv(`p`,`ui-error`);f.setAttribute(`role`,`alert`),l.body.append(Xv(`Candle interval`,a),d,u,Xv(`Start (UTC)`,o),Xv(`End (UTC)`,s)),r.append(Kv(`p`,`ui-note`,`Set the time range and interval before choosing a pair, if needed.`),Xv(`Choose a pair to open the chart`,i),l.details,f);function p(){if(i.value)try{let e=dA(o.value),n=dA(s.value);if(e!==void 0&&n!==void 0&&e>=n)throw Error(`Start must precede end.`);t({poolName:i.value,interval:a.value,limit:c,...e===void 0?{}:{startTimeMs:e},...n===void 0?{}:{endTimeMs:n}})}catch(e){f.textContent=e instanceof Error?e.message:`Invalid chart input.`}}r.addEventListener(`submit`,e=>{e.preventDefault(),p()});for(let e of[i,a,o,s])e.addEventListener(`change`,p);return{node:r,selectionHint:`To retry, clear the pair with “Choose a pair”, then select your pair again. Your time range and interval are kept.`}},result(e){let t=oA.safeParse(e.data);if(!t.success){let t=e.data;if(t?.status===`source_unavailable`||t?.status===`unsupported_input`||t?.status===`unsupported_pool`||t?.status===`over_limit`){let e=typeof t.reason==`string`?t.reason:t.status,n=Object.hasOwn(nA,e)?nA[e]:`The requested chart could not be loaded.`,r=Kv(`div`);r.append(Kv(`p`,`ui-note`,n),Kv(`p`,`ui-note`,`Ask in chat for a new chart with the pair and time range you want.`));let i=Qv(`Details`);return i.body.append(Kv(`p`,void 0,`Reported reason: ${e}`)),r.append(i.details),{node:r}}throw Error(`Chart data is incomplete.`)}let n=t.data,r=Kv(`div`);r.append(Kv(`p`,`ui-note`,`${n.pair.baseAsset.symbol} / USDC · ${n.query.interval}`),Kv(`p`,`ui-note`,lA(n.query)));let i=Qv(`Details`),a=Kv(`p`,`ui-note`,`${tA.common.retrievedAt}: `);a.append($v(n.source.fetchedAt)),i.body.append(a);let o=e=>e===void 0?`not specified`:Number.isFinite(new Date(e).getTime())?new Date(e).toISOString():Gv(e);i.body.append(Kv(`p`,void 0,`Start: ${o(n.query.startTimeMs)} · End: ${o(n.query.endTimeMs)}`)),n.candleCount>=n.query.limit&&r.append(Kv(`p`,`ui-note`,`This view is limited to ${n.query.limit} candles; the requested period may contain more.`));let s=Kv(`p`,`ui-note`,`${tA.chart.boundaryUsdc} ${tA.chart.boundaryScope} ${tA.chart.source}`),c=Jv(tA.chart.library,`https://www.tradingview.com/`);if(c.target=`_blank`,c.rel=`noopener noreferrer`,s.append(` ${tA.chart.renderedWith} `,c,`.`),n.candles.length===0)return i.body.append(s),r.append(Kv(`p`,`ui-note`,`No candles returned for this range.`),i.details),{node:r};let l=Kv(`div`,`card-chart`),u=Kv(`p`,`ui-note`),d=n.candles.at(-1),f=e=>`${Gv(e.start)} · Open ${e.open} · High ${e.high} · Low ${e.low} · Close ${e.close} · Volume ${e.volume}`;u.textContent=f(d),i.body.append(u,s),r.append(l,i.details);let p,m,ee,h,te=!1,ne=!1,g=0,_=0,re=()=>{let e=getComputedStyle(document.documentElement),t=t=>e.getPropertyValue(t).trim();p?.applyOptions({layout:{background:{color:t(`--ui-surface`)},textColor:t(`--ui-text`)},grid:{vertLines:{color:t(`--ui-border`)},horzLines:{color:t(`--ui-border`)}}})},v=()=>{ne||(ne=!0,m?.disconnect(),ee?.disconnect(),p?.remove(),h!==void 0&&cancelAnimationFrame(h))},ie=()=>{if(ne||!l.isConnected)return;let e=l.clientWidth,t=l.clientHeight;if(!(e<=0||t<=0||e===g&&t===_))try{if(p)p.resize(e,t);else{p=Hk(l,{width:e,height:t,autoSize:!1,layout:{attributionLogo:!1},timeScale:{timeVisible:!0,secondsVisible:!1,minBarSpacing:0,lockVisibleTimeRangeOnResize:!0}});let r=p.addSeries(qk,{upColor:`#167752`,downColor:`#b44336`,borderVisible:!1,wickUpColor:`#167752`,wickDownColor:`#b44336`,priceFormat:{type:`price`,precision:6,minMove:1e-6}}),i=p.addSeries(Xk,{priceFormat:{type:`volume`},priceScaleId:``},1),a=cA(n.candles,n.query);r.setData(a.prices),i.setData(a.volumes),p.panes()[0]?.setStretchFactor(3),p.panes()[1]?.setStretchFactor(1),a.range?p.timeScale().setVisibleRange(a.range):p.timeScale().fitContent();let o=new Map(n.candles.map(e=>[hA(e),e]));p.subscribeCrosshairMove(e=>{u.textContent=f((typeof e.time==`number`?o.get(e.time):void 0)??d)}),re(),ee=new MutationObserver(re),ee.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-theme`]})}g=e,_=t}catch{v(),l.replaceChildren(Kv(`p`,`ui-error`,`The chart could not be displayed. The saved query and source data are unchanged.`))}};return{node:r,mount:()=>{te||ne||(te=!0,m=new ResizeObserver(()=>{ne||h!==void 0||(h=requestAnimationFrame(()=>{h=void 0,ie()}))}),m.observe(l),ie())},dispose:v}}};function cA(e,t){let n=e.map(pA),r=e.map(mA),i=new Set(n.map(e=>e.time));for(let e of[t.startTimeMs,t.endTimeMs]){if(e===void 0)continue;let t=e/1e3;i.has(t)||(n.push({time:t}),r.push({time:t}),i.add(t))}n.sort((e,t)=>e.time-t.time),r.sort((e,t)=>e.time-t.time);let a=t.startTimeMs===void 0?n[0]?.time:t.startTimeMs/1e3,o=t.endTimeMs===void 0?n.at(-1)?.time:t.endTimeMs/1e3;return{prices:n,volumes:r,range:(t.startTimeMs!==void 0||t.endTimeMs!==void 0)&&a!==void 0&&o!==void 0&&a<o?{from:a,to:o}:void 0}}function lA(e){if(e.startTimeMs===void 0&&e.endTimeMs===void 0)return`Recent candles · UTC`;let t=e=>{if(e===void 0)return`not specified`;let t=new Date(e);return Number.isNaN(t.getTime())?`${e} milliseconds since 1970-01-01T00:00:00Z`:Gv(e)};return`Range (UTC): ${t(e.startTimeMs)} → ${t(e.endTimeMs)}`}function uA(e,t){if(e===`Latest 500`)return{startInput:``,endInput:``,limitInput:`500`};let n=e===`Last 24h`?1440*60*1e3:e===`Last 7d`?10080*60*1e3:720*60*60*1e3,r=t.getTime();return{startInput:fA(r-n),endInput:fA(r),limitInput:`10000`}}function dA(e){let t=e.trim();if(t===``)return;if(!/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}$/.test(t))throw Error(`UTC timestamps must use YYYY-MM-DDTHH:mm.`);let n=Date.parse(`${t}:00.000Z`);if(!Number.isSafeInteger(n))throw Error(`UTC timestamp is invalid.`);return n}function fA(e){return new Date(e).toISOString().slice(0,16)}function pA(e){return{time:hA(e),open:Number(e.open),high:Number(e.high),low:Number(e.low),close:Number(e.close)}}function mA(e){return{time:hA(e),value:Number(e.volume),color:Number(e.close)>=Number(e.open)?`rgba(22, 119, 82, 0.45)`:`rgba(180, 67, 54, 0.45)`}}function hA(e){return Math.floor(e.timestampMs/1e3)}Nw(`chart`,sA);</script></body></html>