@kitn.ai/ui 0.29.0 → 0.31.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 (280) hide show
  1. package/README.md +11 -7
  2. package/dist/{Icon-DObhsRtm.js → Icon-DJDuE_-x.js} +1 -1
  3. package/dist/action-icons-xkBBVKkF.js +1 -0
  4. package/dist/agent-tooling/construct/schema-url.d.ts +9 -0
  5. package/dist/agent-tooling/construct/schema.d.ts +76 -1
  6. package/dist/agent-tooling/construct/templates.d.ts +45 -0
  7. package/dist/arrow-down-DU6wOl-h.js +1 -0
  8. package/dist/arrow-left-DD46kN17.js +1 -0
  9. package/dist/artifact-DoUAr1Fd.js +1 -0
  10. package/dist/assets/dev-DwzHsqYD.js +553 -0
  11. package/dist/{attachments-Qr4kg-2b.js → attachments-BLWPDiLH.js} +1 -1
  12. package/dist/{audio-visualizer-DToYdfSc.js → audio-visualizer-DhHicYvV.js} +1 -1
  13. package/dist/{badge-CdEu_jn2.js → badge-BGm7pcwi.js} +1 -1
  14. package/dist/{bell-DQAAOpDz.js → bell-CMEdSo7A.js} +1 -1
  15. package/dist/builder-app/App.d.ts +1 -0
  16. package/dist/builder-app/edit-guard.d.ts +8 -0
  17. package/dist/builder-app/main.d.ts +0 -0
  18. package/dist/builder-page/assets/index-C10OF-ur.js +72 -0
  19. package/dist/builder-page/assets/index-CFyKLBlu.css +1 -0
  20. package/dist/builder-page/index.html +20 -0
  21. package/dist/button-BM0YTTDQ.js +1 -0
  22. package/dist/{card-renderer-Jx70m6_l.js → card-renderer-Ds-wXc6_.js} +1 -1
  23. package/dist/check-BG1VfYjm.js +1 -0
  24. package/dist/{checkbox-group-B2_rpoPM.js → checkbox-group-CqXj8ehz.js} +1 -1
  25. package/dist/{checkbox-D7iRB3nL.js → checkbox-np_5mKxM.js} +1 -1
  26. package/dist/chevron-down-CZ4W0hy6.js +1 -0
  27. package/dist/chevron-right-5gdxkCTF.js +1 -0
  28. package/dist/{choice-card-m0BYqqOK.js → choice-card-BYBmPAT5.js} +1 -1
  29. package/dist/circle-C0lwjD2A.js +1 -0
  30. package/dist/circle-check-BfT1cxQU.js +1 -0
  31. package/dist/{circle-x-BPG0iPst.js → circle-x-DzUfvRqr.js} +1 -1
  32. package/dist/{code-block-ClMLKb7C.js → code-block-H6E5Eurc.js} +1 -1
  33. package/dist/{collapsible-B4DlWicL.js → collapsible-CBq1Tj6y.js} +1 -1
  34. package/dist/components/builder-composer-triggers.d.ts +62 -0
  35. package/dist/components/builder-layout.d.ts +54 -0
  36. package/dist/components/builder-message-actions.d.ts +63 -0
  37. package/dist/components/builder-panel-derived.d.ts +18 -0
  38. package/dist/components/builder-panel.d.ts +240 -0
  39. package/dist/components/builder-preview.d.ts +11 -0
  40. package/dist/components/builder-shell-controls.d.ts +69 -0
  41. package/dist/components/builder-skeleton.d.ts +58 -0
  42. package/dist/components/builder-start.d.ts +79 -0
  43. package/dist/components/builder-workspace-variants.d.ts +23 -0
  44. package/dist/components/captions.d.ts +66 -0
  45. package/dist/components/chat-thread.d.ts +27 -1
  46. package/dist/components/construct-form-paths.d.ts +54 -0
  47. package/dist/components/message.d.ts +5 -0
  48. package/dist/{composer-sQ0HcvyG.js → composer-B5IvgxAF.js} +1 -1
  49. package/dist/{confirm-card-rQWDQsnC.js → confirm-card-B63pZIfG.js} +1 -1
  50. package/dist/construct-cli.es.js +469 -125
  51. package/dist/construct-templates.d.ts +5 -0
  52. package/dist/construct-templates.js +266 -0
  53. package/dist/construct.js +269 -86
  54. package/dist/{context-0kg4ZX1J.js → context-Byqor78j.js} +1 -1
  55. package/dist/controllable-C4BSt73s.js +1 -0
  56. package/dist/{conversation-item-BxwQLaFJ.js → conversation-item-piXZFRWa.js} +1 -1
  57. package/dist/{conversation-list-BCfGN1JU.js → conversation-list-B5yu9cPg.js} +1 -1
  58. package/dist/{copy-n9u9rqpi.js → copy-DfI2NYEX.js} +1 -1
  59. package/dist/{create-tween-uPkArjIG.js → create-tween-C4j96_Aj.js} +1 -1
  60. package/dist/{create-tween-C-q-JCM-.js → create-tween-CHleHI8m.js} +1 -1
  61. package/dist/{create-tween-CRrJXxBd.js → create-tween-DQ6lOhdl.js} +1 -1
  62. package/dist/{create-tween-DZ3RRDHD.js → create-tween-DyjTgkJi.js} +1 -1
  63. package/dist/custom-elements.json +40 -5
  64. package/dist/{default-input-CaMrJkgH.js → default-input-Bwmt8Lai.js} +1 -1
  65. package/dist/define-B3OpsIDE.js +1 -0
  66. package/dist/define.js +41 -41
  67. package/dist/define.server.js +46 -46
  68. package/dist/{disclosure-WUImBbDv.js → disclosure-ZSAlD4wg.js} +1 -1
  69. package/dist/{dropdown-wZVeJOMd.js → dropdown-CSRhiMN2.js} +1 -1
  70. package/dist/elements/agent-card.js +1 -1
  71. package/dist/elements/artifact.js +1 -1
  72. package/dist/elements/attachments.js +1 -1
  73. package/dist/elements/audio-visualizer.js +1 -1
  74. package/dist/elements/avatar.js +1 -1
  75. package/dist/elements/badge.js +1 -1
  76. package/dist/elements/button.js +1 -1
  77. package/dist/elements/card.js +1 -1
  78. package/dist/elements/cards.js +1 -1
  79. package/dist/elements/chain-of-thought.js +1 -1
  80. package/dist/elements/chat-actions.d.ts +12 -0
  81. package/dist/elements/chat-scope-picker.js +1 -1
  82. package/dist/elements/chat-types.d.ts +7 -2
  83. package/dist/elements/chat-workspace.js +1 -1
  84. package/dist/elements/chat.js +1 -1
  85. package/dist/elements/checkbox-group.js +1 -1
  86. package/dist/elements/checkbox.js +1 -1
  87. package/dist/elements/checkpoint.js +1 -1
  88. package/dist/elements/choice.js +1 -1
  89. package/dist/elements/coachmark.js +1 -1
  90. package/dist/elements/code-block.js +1 -1
  91. package/dist/elements/command.js +1 -1
  92. package/dist/elements/compare.js +1 -1
  93. package/dist/elements/composer.js +1 -1
  94. package/dist/elements/confirm-card.js +1 -1
  95. package/dist/elements/context-meter.js +1 -1
  96. package/dist/elements/conversation-item.js +1 -1
  97. package/dist/elements/conversation-list.js +1 -1
  98. package/dist/elements/dialog.js +1 -1
  99. package/dist/elements/dock.js +1 -1
  100. package/dist/elements/dropdown.js +1 -1
  101. package/dist/elements/editable-label.js +1 -1
  102. package/dist/elements/embed.js +1 -1
  103. package/dist/elements/empty.js +1 -1
  104. package/dist/elements/feedback-bar.js +1 -1
  105. package/dist/elements/file-tree.js +1 -1
  106. package/dist/elements/file-upload.js +1 -1
  107. package/dist/elements/form.js +1 -1
  108. package/dist/elements/hover-card.js +1 -1
  109. package/dist/elements/icon.js +1 -1
  110. package/dist/elements/image.js +1 -1
  111. package/dist/elements/input.js +1 -1
  112. package/dist/elements/kbd.js +1 -1
  113. package/dist/elements/link-preview.js +1 -1
  114. package/dist/elements/loader.js +1 -1
  115. package/dist/elements/markdown.js +1 -1
  116. package/dist/elements/menu.js +1 -1
  117. package/dist/elements/message-skills.js +1 -1
  118. package/dist/elements/message.js +1 -1
  119. package/dist/elements/model-switcher.js +1 -1
  120. package/dist/elements/nav.js +1 -1
  121. package/dist/elements/notice.js +1 -1
  122. package/dist/elements/pane-grid.js +1 -1
  123. package/dist/elements/pane-group.js +1 -1
  124. package/dist/elements/pane.js +1 -1
  125. package/dist/elements/popover.js +1 -1
  126. package/dist/elements/progress-bar.js +1 -1
  127. package/dist/elements/prompt-dock.js +1 -1
  128. package/dist/elements/prompt-input.js +1 -1
  129. package/dist/elements/prompt-suggestions.js +1 -1
  130. package/dist/elements/radio-group.js +1 -1
  131. package/dist/elements/reasoning.js +1 -1
  132. package/dist/elements/remote.js +1 -1
  133. package/dist/elements/resizable.js +1 -1
  134. package/dist/elements/response-stream.js +1 -1
  135. package/dist/elements/screen.js +1 -1
  136. package/dist/elements/scroll-area.js +1 -1
  137. package/dist/elements/scroll-button.js +1 -1
  138. package/dist/elements/search.js +1 -1
  139. package/dist/elements/segmented.js +1 -1
  140. package/dist/elements/select.js +1 -1
  141. package/dist/elements/separator.js +1 -1
  142. package/dist/elements/setting-item.js +1 -1
  143. package/dist/elements/settings-group.js +1 -1
  144. package/dist/elements/skeleton.js +1 -1
  145. package/dist/elements/slider.js +1 -1
  146. package/dist/elements/source.js +1 -1
  147. package/dist/elements/status.js +1 -1
  148. package/dist/elements/switch.js +1 -1
  149. package/dist/elements/tabs.js +1 -1
  150. package/dist/elements/tasks.js +1 -1
  151. package/dist/elements/text-shimmer.js +1 -1
  152. package/dist/elements/thinking-bar.js +1 -1
  153. package/dist/elements/thread.js +1 -1
  154. package/dist/elements/toast.js +1 -1
  155. package/dist/elements/tool.js +1 -1
  156. package/dist/elements/tooltip.js +1 -1
  157. package/dist/elements/voice-input.js +1 -1
  158. package/dist/elements/voice-output.js +1 -1
  159. package/dist/elements.d.ts +22 -10
  160. package/dist/{ellipsis-CbOpJnU3.js → ellipsis-CJ5QIjWo.js} +1 -1
  161. package/dist/{embed-CrfjkbUG.js → embed-6Vji0PfS.js} +1 -1
  162. package/dist/{external-link-ByXAwBBQ.js → external-link-BPTtTdet.js} +1 -1
  163. package/dist/{file-text-DMib2qwt.js → file-text-eVjcFDrK.js} +1 -1
  164. package/dist/{file-tree-CJqM2aP7.js → file-tree-a9tfWYmg.js} +1 -1
  165. package/dist/{folder-_BAb929C.js → folder-DN6Ilq6d.js} +1 -1
  166. package/dist/{form-DSZgZQZk.js → form-U1cwhcQx.js} +1 -1
  167. package/dist/{hover-card-BQbul9eq.js → hover-card-C5ptzZOZ.js} +1 -1
  168. package/dist/{icon-CdcfRhYI.js → icon-BOMrFp0D.js} +1 -1
  169. package/dist/index.js +2297 -2279
  170. package/dist/index.server.js +2102 -2084
  171. package/dist/{info-DsFjGuI_.js → info-DxzKsIHn.js} +1 -1
  172. package/dist/{input-DKbmkMos.js → input-aW72PACH.js} +1 -1
  173. package/dist/kai.es.js +1 -1
  174. package/dist/{kbd-PvdGhX4s.js → kbd-BP-6MwUs.js} +1 -1
  175. package/dist/{link-preview-DbM1866N.js → link-preview-CZaDilMG.js} +1 -1
  176. package/dist/{link-zF8PzWfF.js → link-rlN11N0B.js} +1 -1
  177. package/dist/loader-BdFK70fF.js +1 -0
  178. package/dist/{markdown-LMvmAyBk.js → markdown-DjEaoNz-.js} +1 -1
  179. package/dist/mcp.es.js +587 -111
  180. package/dist/message--Nlbemtp.js +1 -0
  181. package/dist/message-C88yTu2A.js +1 -0
  182. package/dist/message-circle-CZeVDN1f.js +1 -0
  183. package/dist/message-square-BXNBKC6i.js +1 -0
  184. package/dist/{minimize-2-BQRoBV1V.js → minimize-2-BxLOOSEf.js} +1 -1
  185. package/dist/{model-switcher-CMpCOYcB.js → model-switcher-BxRvub2A.js} +1 -1
  186. package/dist/{overlay-Cb-MkyDa.js → overlay-CDwKJtHN.js} +1 -1
  187. package/dist/{panel-right-i8warFxT.js → panel-right-BovedCwW.js} +1 -1
  188. package/dist/{paperclip-ByY3UVO6.js → paperclip-D0Xyjja2.js} +1 -1
  189. package/dist/play-DGJ4MgB2.js +1 -0
  190. package/dist/primitives/speech.d.ts +35 -0
  191. package/dist/primitives/use-auto-resize.d.ts +11 -0
  192. package/dist/{progress-bar-jVAHvMUf.js → progress-bar-D-aQfy5h.js} +1 -1
  193. package/dist/{prompt-suggestion-CD-qtNgC.js → prompt-suggestion-C6qLjMEQ.js} +1 -1
  194. package/dist/{radio-BsoBMhkF.js → radio-D1CkXISc.js} +1 -1
  195. package/dist/react/index.d.ts +22 -6
  196. package/dist/react.js +13 -13
  197. package/dist/{reasoning-4kBPtlTx.js → reasoning-DARmbgmE.js} +1 -1
  198. package/dist/register-impl-WcrdIihK.js +424 -0
  199. package/dist/{resizable-uPmY9VY-.js → resizable-Da6oSO2z.js} +1 -1
  200. package/dist/{rotate-ccw-B2xn93py.js → rotate-ccw-31ed1xK_.js} +1 -1
  201. package/dist/{rotate-cw-CMVLoCyH.js → rotate-cw-qkl39dw3.js} +1 -1
  202. package/dist/{scroll-area-BqLUo8ZZ.js → scroll-area-RrKnLYlA.js} +1 -1
  203. package/dist/{scroll-button-DslXiJyL.js → scroll-button--QeNjobK.js} +1 -1
  204. package/dist/{select-2cLRtPGT.js → select-CS_0mWW3.js} +1 -1
  205. package/dist/{separator-BWQtNJcM.js → separator-fT-zBypW.js} +1 -1
  206. package/dist/{settings-BBR63jLg.js → settings-dfkV_WDm.js} +1 -1
  207. package/dist/{settings-group-B2ciy-Iw.js → settings-group-CX694npG.js} +1 -1
  208. package/dist/{skeleton-CkHI-HgC.js → skeleton-BsqKD9TV.js} +1 -1
  209. package/dist/{slider-DDR9U-i0.js → slider-_EWfTH9H.js} +1 -1
  210. package/dist/{solid-DruVOXnf.js → solid-BITWG_VE.js} +4214 -3996
  211. package/dist/{solid-BzCFdL25.js → solid-CRFYWlBw.js} +5647 -5373
  212. package/dist/solid.d.ts +6 -0
  213. package/dist/solid.js +259 -254
  214. package/dist/solid.server.js +259 -254
  215. package/dist/{source-GEnFF528.js → source-Da1TFiuj.js} +1 -1
  216. package/dist/speech-CjbWuqG2.js +1 -0
  217. package/dist/{star-CilHq8GP.js → star-ZvSbbXS6.js} +1 -1
  218. package/dist/{store-Ciyk6eZG.js → store-DE5lcr9q.js} +1 -1
  219. package/dist/{switch-KkeQIbuH.js → switch-P_fsHqv3.js} +1 -1
  220. package/dist/{tasks-card-BrN4bggJ.js → tasks-card-B86qqyZm.js} +1 -1
  221. package/dist/text-shimmer-BAkw_65G.js +1 -0
  222. package/dist/textarea-Bkinatpi.js +1 -0
  223. package/dist/theme.tokens.css +22 -21
  224. package/dist/{thumbs-up-CsT9Wzb9.js → thumbs-up-CDGW7a4o.js} +1 -1
  225. package/dist/{toast-store-tgK6MuMv.js → toast-store-B94I50AO.js} +1 -1
  226. package/dist/{tool-DzUjIBT8.js → tool-CUiCeyi1.js} +1 -1
  227. package/dist/{tooltip-Bkkg_4t0.js → tooltip-B3wlQSPh.js} +1 -1
  228. package/dist/{trash-2-jBKxjGGQ.js → trash-2-Cu8yZmFQ.js} +1 -1
  229. package/dist/{triangle-alert-DlQ68ppf.js → triangle-alert-CCtDUUmn.js} +1 -1
  230. package/dist/ui/button-variant-names.d.ts +12 -0
  231. package/dist/ui/button.d.ts +6 -0
  232. package/dist/ui/color-field.d.ts +48 -0
  233. package/dist/ui/textarea.d.ts +4 -0
  234. package/dist/ui/toggle-chip.d.ts +40 -0
  235. package/dist/{upload-TcAHXv9W.js → upload-CxotJlLv.js} +1 -1
  236. package/dist/{use-card-resolution-DaZqAdWf.js → use-card-resolution-DILUvNyj.js} +1 -1
  237. package/dist/{variant-aurora-DbW_OWL2.js → variant-aurora-BGaXBBGf.js} +1 -1
  238. package/dist/{variant-aurora-BhLuYxJR.js → variant-aurora-BLcQmvkd.js} +1 -1
  239. package/dist/{variant-aurora-CNmfHhcx.js → variant-aurora-DZIfAtx1.js} +2 -2
  240. package/dist/{variant-aurora-D6GsdTPA.js → variant-aurora-DpoIW4ZX.js} +2 -2
  241. package/dist/{variant-custom-BRvaNHSi.js → variant-custom-BhtWdAxE.js} +1 -1
  242. package/dist/{variant-custom-DMTrEO5w.js → variant-custom-BtApuSyr.js} +2 -2
  243. package/dist/{variant-custom-DV2x254s.js → variant-custom-C-zS4ZtE.js} +2 -2
  244. package/dist/{variant-custom-BvYHR62b.js → variant-custom-swi9PXxU.js} +1 -1
  245. package/dist/{variant-wave-sp-qwsdI.js → variant-wave-7JCIwhpb.js} +1 -1
  246. package/dist/{variant-wave-BpDd8t3Z.js → variant-wave-BG4nGr6x.js} +1 -1
  247. package/dist/{variant-wave-BNMGrDfj.js → variant-wave-C32lM9G2.js} +2 -2
  248. package/dist/{variant-wave-CyBueXj9.js → variant-wave-Dl6jOiK3.js} +2 -2
  249. package/dist/x-C4niw05N.js +1 -0
  250. package/frameworks/react/index.tsx +12 -6
  251. package/kit-base.css +311 -0
  252. package/llms-full.txt +9 -6
  253. package/llms.txt +1 -1
  254. package/package.json +23 -4
  255. package/solid.css +48 -0
  256. package/src/elements/element-meta.json +39 -14
  257. package/theme.css +39 -23
  258. package/dist/action-icons-CcgNN2oT.js +0 -1
  259. package/dist/arrow-down-CjRU3JgV.js +0 -1
  260. package/dist/arrow-left-Bnpb1UEW.js +0 -1
  261. package/dist/artifact-Bwt7OgcR.js +0 -1
  262. package/dist/assets/dev-5XzXYR21.js +0 -91
  263. package/dist/button-DkuOnGLy.js +0 -1
  264. package/dist/check-njkVdZu2.js +0 -1
  265. package/dist/chevron-down-B72s6PXR.js +0 -1
  266. package/dist/chevron-right-BatuHzUm.js +0 -1
  267. package/dist/circle-check-B62pODB3.js +0 -1
  268. package/dist/circle-zx0ByzY9.js +0 -1
  269. package/dist/controllable-CnGpMF6r.js +0 -1
  270. package/dist/define-By-uL588.js +0 -1
  271. package/dist/loader-BM4CEz4G.js +0 -1
  272. package/dist/message-BSsgvHvf.js +0 -1
  273. package/dist/message-BYZECyek.js +0 -1
  274. package/dist/message-circle-DruwObfX.js +0 -1
  275. package/dist/message-square-BG6q6mlm.js +0 -1
  276. package/dist/play-BvKKq3fX.js +0 -1
  277. package/dist/register-impl-B1hLkrI8.js +0 -424
  278. package/dist/text-shimmer-Dcj1MHuq.js +0 -1
  279. package/dist/textarea-Dpvbngbg.js +0 -1
  280. package/dist/x-Z5UntkIJ.js +0 -1
@@ -0,0 +1,72 @@
1
+ (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();const le={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return vr(this.context.count)},getNextContextId(){return vr(this.context.count++)}};function vr(e){const t=String(e),n=t.length-1;return le.context.id+(n?String.fromCharCode(96+n):"")+t}function ji(e){le.context=e}const Di=!1,Mi=(e,t)=>e===t,pn=Symbol("solid-proxy"),xo=typeof Proxy=="function",Ui=Symbol("solid-track"),mn={equals:Mi};let _o=Co;const Xe=1,gn=2,$o={owned:null,cleanups:null,context:null,owner:null};var X=null;let Rn=null,Fi=null,re=null,_e=null,Ve=null,zn=0;function jt(e,t){const n=re,r=X,o=e.length===0,i=t===void 0?r:t,s=o?$o:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?e:()=>e(()=>Ie(()=>Mt(s)));X=s,re=null;try{return Ct(a,!0)}finally{re=n,X=r}}function me(e,t){t=t?Object.assign({},mn,t):mn;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(o=o(n.value)),zo(n,o));return[So.bind(n),r]}function F(e,t,n){const r=Xn(e,t,!1,Xe);Ht(r)}function He(e,t,n){_o=qi;const r=Xn(e,t,!1,Xe);(!n||!n.render)&&(r.user=!0),Ve?Ve.push(r):Ht(r)}function je(e,t,n){n=n?Object.assign({},mn,n):mn;const r=Xn(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,Ht(r),So.bind(r)}function Ie(e){if(re===null)return e();const t=re;re=null;try{return e()}finally{re=t}}function Yn(e,t,n){const r=Array.isArray(e);let o,i=n&&n.defer;return s=>{let a;if(r){a=Array(e.length);for(let u=0;u<e.length;u++)a[u]=e[u]()}else a=e();if(i)return i=!1,s;const l=Ie(()=>t(a,o,s));return o=a,l}}function Vi(e){He(()=>Ie(e))}function lt(e){return X===null||(X.cleanups===null?X.cleanups=[e]:X.cleanups.push(e)),e}function br(){return X}function Bi(e,t){const n=X,r=re;X=e,re=null;try{return Ct(t,!0)}catch(o){Qn(o)}finally{X=n,re=r}}function Gi(e,t){const n=Symbol("context");return{id:n,Provider:Xi(n),defaultValue:e}}function Hi(e){let t;return X&&X.context&&(t=X.context[e.id])!==void 0?t:e.defaultValue}function Wi(e){const t=je(e),n=je(()=>jn(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}function So(){if(this.sources&&this.state)if(this.state===Xe)Ht(this);else{const e=_e;_e=null,Ct(()=>bn(this),!1),_e=e}if(re){const e=this.observers;if(!e||e[e.length-1]!==re){const t=e?e.length:0;re.sources?(re.sources.push(this),re.sourceSlots.push(t)):(re.sources=[this],re.sourceSlots=[t]),e?(e.push(re),this.observerSlots.push(re.sources.length-1)):(this.observers=[re],this.observerSlots=[re.sources.length-1])}}return this.value}function zo(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&Ct(()=>{for(let o=0;o<e.observers.length;o+=1){const i=e.observers[o],s=Rn&&Rn.running;s&&Rn.disposed.has(i),(s?!i.tState:!i.state)&&(i.pure?_e.push(i):Ve.push(i),i.observers&&Ao(i)),s||(i.state=Xe)}if(_e.length>1e6)throw _e=[],new Error},!1)),t}function Ht(e){if(!e.fn)return;Mt(e);const t=zn;Ji(e,e.value,t)}function Ji(e,t,n){let r;const o=X,i=re;re=X=e;try{r=e.fn(t)}catch(s){return e.pure&&(e.state=Xe,e.owned&&e.owned.forEach(Mt),e.owned=null),e.updatedAt=n+1,Qn(s)}finally{re=i,X=o}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?zo(e,r):e.value=r,e.updatedAt=n)}function Xn(e,t,n,r=Xe,o){const i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:X,context:X?X.context:null,pure:n};return X===null||X!==$o&&(X.owned?X.owned.push(i):X.owned=[i]),i}function vn(e){if(e.state===0)return;if(e.state===gn)return bn(e);if(e.suspense&&Ie(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<zn);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===Xe)Ht(e);else if(e.state===gn){const r=_e;_e=null,Ct(()=>bn(e,t[0]),!1),_e=r}}function Ct(e,t){if(_e)return e();let n=!1;t||(_e=[]),Ve?n=!0:Ve=[],zn++;try{const r=e();return Ki(n),r}catch(r){n||(Ve=null),_e=null,Qn(r)}}function Ki(e){if(_e&&(Co(_e),_e=null),e)return;const t=Ve;Ve=null,t.length&&Ct(()=>_o(t),!1)}function Co(e){for(let t=0;t<e.length;t++)vn(e[t])}function qi(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:vn(r)}if(le.context){if(le.count){le.effects||(le.effects=[]),le.effects.push(...e.slice(0,n));return}ji()}for(le.effects&&!le.count&&(e=[...le.effects,...e],n+=le.effects.length,delete le.effects),t=0;t<n;t++)vn(e[t])}function bn(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){const r=e.sources[n];if(r.sources){const o=r.state;o===Xe?r!==t&&(!r.updatedAt||r.updatedAt<zn)&&vn(r):o===gn&&bn(r,t)}}}function Ao(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=gn,n.pure?_e.push(n):Ve.push(n),n.observers&&Ao(n))}}function Mt(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),r=e.sourceSlots.pop(),o=n.observers;if(o&&o.length){const i=o.pop(),s=n.observerSlots.pop();r<o.length&&(i.sourceSlots[s]=r,o[r]=i,n.observerSlots[r]=s)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)Mt(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)Mt(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function Yi(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function Qn(e,t=X){throw Yi(e)}function jn(e){if(typeof e=="function"&&!e.length)return jn(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=jn(e[n]);if(Array.isArray(r))if(r.length<32768)t.push.apply(t,r);else for(let o=0;o<r.length;o++)t.push(r[o]);else t.push(r)}return t}return e}function Xi(e,t){return function(r){let o;return F(()=>o=Ie(()=>(X.context={...X.context,[e]:r.value},Wi(()=>r.children))),void 0),o}}const Qi=Symbol("fallback");function yr(e){for(let t=0;t<e.length;t++)e[t]()}function es(e,t,n={}){let r=[],o=[],i=[],s=0,a=t.length>1?[]:null;return lt(()=>yr(i)),()=>{let l=e()||[],u=l.length,d,c;return l[Ui],Ie(()=>{let p,$,v,b,y,S,x,P,C;if(u===0)s!==0&&(yr(i),i=[],r=[],o=[],s=0,a&&(a=[])),n.fallback&&(r=[Qi],o[0]=jt(A=>(i[0]=A,n.fallback())),s=1);else if(s===0){for(o=new Array(u),c=0;c<u;c++)r[c]=l[c],o[c]=jt(f);s=u}else{for(v=new Array(u),b=new Array(u),a&&(y=new Array(u)),S=0,x=Math.min(s,u);S<x&&r[S]===l[S];S++);for(x=s-1,P=u-1;x>=S&&P>=S&&r[x]===l[P];x--,P--)v[P]=o[x],b[P]=i[x],a&&(y[P]=a[x]);for(p=new Map,$=new Array(P+1),c=P;c>=S;c--)C=l[c],d=p.get(C),$[c]=d===void 0?-1:d,p.set(C,c);for(d=S;d<=x;d++)C=r[d],c=p.get(C),c!==void 0&&c!==-1?(v[c]=o[d],b[c]=i[d],a&&(y[c]=a[d]),c=$[c],p.set(C,c)):i[d]();for(c=S;c<u;c++)c in v?(o[c]=v[c],i[c]=b[c],a&&(a[c]=y[c],a[c](c))):o[c]=jt(f);o=o.slice(0,s=u),r=l.slice(0)}return o});function f(p){if(i[c]=p,a){const[$,v]=me(c);return a[c]=v,t(l[c],$)}return t(l[c])}}}function h(e,t){return Ie(()=>e(t||{}))}function Qt(){return!0}const Dn={get(e,t,n){return t===pn?n:e.get(t)},has(e,t){return t===pn?!0:e.has(t)},set:Qt,deleteProperty:Qt,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:Qt,deleteProperty:Qt}},ownKeys(e){return e.keys()}};function Zn(e){return(e=typeof e=="function"?e():e)?e:{}}function ts(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function be(...e){let t=!1;for(let s=0;s<e.length;s++){const a=e[s];t=t||!!a&&pn in a,e[s]=typeof a=="function"?(t=!0,je(a)):a}if(xo&&t)return new Proxy({get(s){for(let a=e.length-1;a>=0;a--){const l=Zn(e[a])[s];if(l!==void 0)return l}},has(s){for(let a=e.length-1;a>=0;a--)if(s in Zn(e[a]))return!0;return!1},keys(){const s=[];for(let a=0;a<e.length;a++)s.push(...Object.keys(Zn(e[a])));return[...new Set(s)]}},Dn);const n={},r=Object.create(null);for(let s=e.length-1;s>=0;s--){const a=e[s];if(!a)continue;const l=Object.getOwnPropertyNames(a);for(let u=l.length-1;u>=0;u--){const d=l[u];if(d==="__proto__"||d==="constructor")continue;const c=Object.getOwnPropertyDescriptor(a,d);if(!r[d])r[d]=c.get?{enumerable:!0,configurable:!0,get:ts.bind(n[d]=[c.get.bind(a)])}:c.value!==void 0?c:void 0;else{const f=n[d];f&&(c.get?f.push(c.get.bind(a)):c.value!==void 0&&f.push(()=>c.value))}}}const o={},i=Object.keys(r);for(let s=i.length-1;s>=0;s--){const a=i[s],l=r[a];l&&l.get?Object.defineProperty(o,a,l):o[a]=l?l.value:void 0}return o}function We(e,...t){const n=t.length;if(xo&&pn in e){const o=n>1?t.flat():t[0],i=t.map(s=>new Proxy({get(a){return s.includes(a)?e[a]:void 0},has(a){return s.includes(a)&&a in e},keys(){return s.filter(a=>a in e)}},Dn));return i.push(new Proxy({get(s){return o.includes(s)?void 0:e[s]},has(s){return o.includes(s)?!1:s in e},keys(){return Object.keys(e).filter(s=>!o.includes(s))}},Dn)),i}const r=[];for(let o=0;o<=n;o++)r[o]={};for(const o of Object.getOwnPropertyNames(e)){let i=n;for(let l=0;l<t.length;l++)if(t[l].includes(o)){i=l;break}const s=Object.getOwnPropertyDescriptor(e,o);!s.get&&!s.set&&s.enumerable&&s.writable&&s.configurable?r[i][o]=s.value:Object.defineProperty(r[i],o,s)}return r}let ns=0;function Re(){return le.context?le.getNextContextId():`cl-${ns++}`}const rs=e=>`Stale read from <${e}>.`;function $e(e){const t="fallback"in e&&{fallback:()=>e.fallback};return je(es(()=>e.each,e.children,t||void 0))}function B(e){const t=e.keyed,n=je(()=>e.when,void 0,void 0),r=t?n:je(n,void 0,{equals:(o,i)=>!o==!i});return je(()=>{const o=r();if(o){const i=e.children;return typeof i=="function"&&i.length>0?Ie(()=>i(t?o:()=>{if(!Ie(r))throw rs("Show");return n()})):i}return e.fallback},void 0,void 0)}const os=["allowfullscreen","async","alpha","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected","adauctionheaders","browsingtopics","credentialless","defaultchecked","defaultmuted","defaultselected","defer","disablepictureinpicture","disableremoteplayback","preservespitch","shadowrootclonable","shadowrootcustomelementregistry","shadowrootdelegatesfocus","shadowrootserializable","sharedstoragewritable"],is=new Set(["className","value","readOnly","noValidate","formNoValidate","isMap","noModule","playsInline","adAuctionHeaders","allowFullscreen","browsingTopics","defaultChecked","defaultMuted","defaultSelected","disablePictureInPicture","disableRemotePlayback","preservesPitch","shadowRootClonable","shadowRootCustomElementRegistry","shadowRootDelegatesFocus","shadowRootSerializable","sharedStorageWritable",...os]),ss=new Set(["innerHTML","textContent","innerText","children"]),as=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),ls=Object.assign(Object.create(null),{class:"className",novalidate:{$:"noValidate",FORM:1},formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1},adauctionheaders:{$:"adAuctionHeaders",IFRAME:1},allowfullscreen:{$:"allowFullscreen",IFRAME:1},browsingtopics:{$:"browsingTopics",IMG:1},defaultchecked:{$:"defaultChecked",INPUT:1},defaultmuted:{$:"defaultMuted",AUDIO:1,VIDEO:1},defaultselected:{$:"defaultSelected",OPTION:1},disablepictureinpicture:{$:"disablePictureInPicture",VIDEO:1},disableremoteplayback:{$:"disableRemotePlayback",AUDIO:1,VIDEO:1},preservespitch:{$:"preservesPitch",AUDIO:1,VIDEO:1},shadowrootclonable:{$:"shadowRootClonable",TEMPLATE:1},shadowrootdelegatesfocus:{$:"shadowRootDelegatesFocus",TEMPLATE:1},shadowrootserializable:{$:"shadowRootSerializable",TEMPLATE:1},sharedstoragewritable:{$:"sharedStorageWritable",IFRAME:1,IMG:1}});function cs(e,t){const n=ls[e];return typeof n=="object"?n[t]?n.$:void 0:n}const us=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),ds=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),fs={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},Me=e=>je(()=>e());function hs(e,t,n){let r=n.length,o=t.length,i=r,s=0,a=0,l=t[o-1].nextSibling,u=null;for(;s<o||a<i;){if(t[s]===n[a]){s++,a++;continue}for(;t[o-1]===n[i-1];)o--,i--;if(o===s){const d=i<r?a?n[a-1].nextSibling:n[i-a]:l;for(;a<i;)e.insertBefore(n[a++],d)}else if(i===a)for(;s<o;)(!u||!u.has(t[s]))&&t[s].remove(),s++;else if(t[s]===n[i-1]&&n[a]===t[o-1]){const d=t[--o].nextSibling;e.insertBefore(n[a++],t[s++].nextSibling),e.insertBefore(n[--i],d),t[o]=n[i]}else{if(!u){u=new Map;let c=a;for(;c<i;)u.set(n[c],c++)}const d=u.get(t[s]);if(d!=null)if(a<d&&d<i){let c=s,f=1,p;for(;++c<o&&c<i&&!((p=u.get(t[c]))==null||p!==d+f);)f++;if(f>d-a){const $=t[s];for(;a<d;)e.insertBefore(n[a++],$)}else e.replaceChild(n[a++],t[s++])}else s++;else t[s++].remove()}}}const wr="_$DX_DELEGATE";function ps(e,t,n,r={}){let o;return jt(i=>{o=i,t===document?e():m(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{o(),t.textContent=""}}function w(e,t,n,r){let o;const i=()=>{const a=r?document.createElementNS("http://www.w3.org/1998/Math/MathML","template"):document.createElement("template");return a.innerHTML=e,n?a.content.firstChild.firstChild:r?a.firstChild:a.content.firstChild},s=t?()=>Ie(()=>document.importNode(o||(o=i()),!0)):()=>(o||(o=i())).cloneNode(!0);return s.cloneNode=s,s}function At(e,t=window.document){const n=t[wr]||(t[wr]=new Set);for(let r=0,o=e.length;r<o;r++){const i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,xs))}}function N(e,t,n){ut(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function ms(e,t,n,r){ut(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function gs(e,t,n){ut(e)||(n?e.setAttribute(t,""):e.removeAttribute(t))}function Oe(e,t){ut(e)||(t==null?e.removeAttribute("class"):e.className=t)}function Eo(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const o=n[0];e.addEventListener(t,n[0]=i=>o.call(e,n[1],i))}else e.addEventListener(t,n,typeof n!="function"&&n)}function vs(e,t,n={}){const r=Object.keys(t||{}),o=Object.keys(n);let i,s;for(i=0,s=o.length;i<s;i++){const a=o[i];!a||a==="undefined"||t[a]||(kr(e,a,!1),delete n[a])}for(i=0,s=r.length;i<s;i++){const a=r[i],l=!!t[a];!a||a==="undefined"||n[a]===l||!l||(kr(e,a,!0),n[a]=l)}return n}function z(e,t,n){if(!t)return n?N(e,"style"):t;const r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let o,i;for(i in n)t[i]==null&&r.removeProperty(i),delete n[i];for(i in t)o=t[i],o!==n[i]&&(r.setProperty(i,o),n[i]=o);return n}function bs(e,t,n){n!=null?e.style.setProperty(t,n):e.style.removeProperty(t)}function Qe(e,t={},n,r){const o={};return r||F(()=>o.children=Ut(e,t.children,o.children)),F(()=>typeof t.ref=="function"&&ct(t.ref,e)),F(()=>ys(e,t,n,!0,o,!0)),o}function ct(e,t,n){return Ie(()=>e(t,n))}function m(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return Ut(e,t,r,n);F(o=>Ut(e,t(),o,n),r)}function ys(e,t,n,r,o={},i=!1){t||(t={});for(const s in o)if(!(s in t)){if(s==="children")continue;o[s]=xr(e,s,null,o[s],n,i,t)}for(const s in t){if(s==="children")continue;const a=t[s];o[s]=xr(e,s,a,o[s],n,i,t)}}function ws(e){let t,n;return!ut()||!(t=le.registry.get(n=_s()))?e():(le.completed&&le.completed.add(t),le.registry.delete(n),t)}function ut(e){return!!le.context&&!0&&(!e||e.isConnected)}function ks(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function kr(e,t,n){const r=t.trim().split(/\s+/);for(let o=0,i=r.length;o<i;o++)e.classList.toggle(r[o],n)}function xr(e,t,n,r,o,i,s){let a,l,u,d,c;if(t==="style")return z(e,n,r);if(t==="classList")return vs(e,n,r);if(n===r)return r;if(t==="ref")i||n(e);else if(t.slice(0,3)==="on:"){const f=t.slice(3);r&&e.removeEventListener(f,r,typeof r!="function"&&r),n&&e.addEventListener(f,n,typeof n!="function"&&n)}else if(t.slice(0,10)==="oncapture:"){const f=t.slice(10);r&&e.removeEventListener(f,r,!0),n&&e.addEventListener(f,n,!0)}else if(t.slice(0,2)==="on"){const f=t.slice(2).toLowerCase(),p=us.has(f);if(!p&&r){const $=Array.isArray(r)?r[0]:r;e.removeEventListener(f,$)}(p||n)&&(Eo(e,f,n,p),p&&At([f]))}else if(t.slice(0,5)==="attr:")N(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")gs(e,t.slice(5),n);else if((c=t.slice(0,5)==="prop:")||(u=ss.has(t))||!o&&((d=cs(t,e.tagName))||(l=is.has(t)))||(a=e.nodeName.includes("-")||"is"in s)){if(c)t=t.slice(5),l=!0;else if(ut(e))return n;t==="class"||t==="className"?Oe(e,n):a&&!l&&!u?e[ks(t)]=n:e[d||t]=n}else{const f=o&&t.indexOf(":")>-1&&fs[t.split(":")[0]];f?ms(e,f,t,n):N(e,as[t]||t,n)}return n}function xs(e){let t=e.target;const n=`$$${e.type}`,r=e.target,o=e.currentTarget,i=l=>Object.defineProperty(e,"target",{configurable:!0,value:l}),s=()=>{const l=t[n];if(l&&!t.disabled){const u=t[`${n}Data`];if(u!==void 0?l.call(t,u,e):l.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&i(t.host),!0},a=()=>{for(;s()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),e.composedPath){const l=e.composedPath();i(l[0]);for(let u=0;u<l.length-2&&(t=l[u],!!s());u++){if(t._$host){t=t._$host,a();break}if(t.parentNode===o)break}}else a();i(r)}function Ut(e,t,n,r,o){const i=ut(e);if(i){!n&&(n=[...e.childNodes]);let l=[];for(let u=0;u<n.length;u++){const d=n[u];d.nodeType===8&&d.data.slice(0,2)==="!$"?d.remove():l.push(d)}n=l}for(;typeof n=="function";)n=n();if(t===n)return n;const s=typeof t,a=r!==void 0;if(e=a&&n[0]&&n[0].parentNode||e,s==="string"||s==="number"){if(i||s==="number"&&(t=t.toString(),t===n))return n;if(a){let l=n[0];l&&l.nodeType===3?l.data!==t&&(l.data=t):l=document.createTextNode(t),n=bt(e,n,r,l)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||s==="boolean"){if(i)return n;n=bt(e,n,r)}else{if(s==="function")return F(()=>{let l=t();for(;typeof l=="function";)l=l();n=Ut(e,l,n,r)}),()=>n;if(Array.isArray(t)){const l=[],u=n&&Array.isArray(n);if(Mn(l,t,n,o))return F(()=>n=Ut(e,l,n,r,!0)),()=>n;if(i){if(!l.length)return n;if(r===void 0)return n=[...e.childNodes];let d=l[0];if(d.parentNode!==e)return n;const c=[d];for(;(d=d.nextSibling)!==r;)c.push(d);return n=c}if(l.length===0){if(n=bt(e,n,r),a)return n}else u?n.length===0?_r(e,l,r):hs(e,n,l):(n&&bt(e),_r(e,l));n=l}else if(t.nodeType){if(i&&t.parentNode)return n=a?[t]:t;if(Array.isArray(n)){if(a)return n=bt(e,n,r,t);bt(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function Mn(e,t,n,r){let o=!1;for(let i=0,s=t.length;i<s;i++){let a=t[i],l=n&&n[e.length],u;if(!(a==null||a===!0||a===!1))if((u=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))o=Mn(e,a,l)||o;else if(u==="function")if(r){for(;typeof a=="function";)a=a();o=Mn(e,Array.isArray(a)?a:[a],Array.isArray(l)?l:[l])||o}else e.push(a),o=!0;else{const d=String(a);l&&l.nodeType===3&&l.data===d?e.push(l):e.push(document.createTextNode(d))}}return o}function _r(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function bt(e,t,n,r){if(n===void 0)return e.textContent="";const o=r||document.createTextNode("");if(t.length){let i=!1;for(let s=t.length-1;s>=0;s--){const a=t[s];if(o!==a){const l=a.parentNode===e;!i&&!s?l?e.replaceChild(o,a):e.insertBefore(o,n):l&&a.remove()}else i=!0}}else e.insertBefore(o,n);return[o]}function _s(){return le.getNextContextId()}const $s="http://www.w3.org/2000/svg";function Io(e,t=!1,n=void 0){return t?document.createElementNS($s,e):document.createElement(e,{is:n})}function Ss(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,o=br();let i,s=!!le.context;return He(()=>{s&&(br().user=s=!1),i||(i=Bi(o,()=>je(()=>e.children)));const a=r();if(a instanceof HTMLHeadElement){const[l,u]=me(!1),d=()=>u(!0);jt(c=>m(a,()=>l()?c():i(),null)),lt(d)}else{const l=Io(e.isSVG?"g":"div",e.isSVG),u=t&&l.attachShadow?l.attachShadow({mode:"open"}):l;Object.defineProperty(l,"_$host",{get(){return n.parentNode},configurable:!0}),m(u,i),a.appendChild(l),e.ref&&e.ref(l),lt(()=>a.removeChild(l))}},void 0,{render:!s}),n}function zs(e,t){const n=je(e);return je(()=>{const r=n();switch(typeof r){case"function":return Ie(()=>r(t));case"string":const o=ds.has(r),i=le.context?ws():Io(r,o,Ie(()=>t.is));return Qe(i,t,o),i}})}function er(e){const[,t]=We(e,["component"]);return zs(()=>e.component,t)}function Oo(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Oo(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function To(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Oo(e))&&(r&&(r+=" "),r+=t);return r}const Cs=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},As=(e,t)=>({classGroupId:e,validator:t}),Po=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),yn="-",$r=[],Es="arbitrary..",Is=e=>{const t=Ts(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return Os(s);const a=s.split(yn),l=a[0]===""&&a.length>1?1:0;return Ro(a,l,t)},getConflictingClassGroupIds:(s,a)=>{if(a){const l=r[s],u=n[s];return l?u?Cs(u,l):l:u||$r}return n[s]||$r}}},Ro=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],i=n.nextPart.get(o);if(i){const u=Ro(e,t+1,i);if(u)return u}const s=n.validators;if(s===null)return;const a=t===0?e.join(yn):e.slice(t).join(yn),l=s.length;for(let u=0;u<l;u++){const d=s[u];if(d.validator(a))return d.classGroupId}},Os=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?Es+r:void 0})(),Ts=e=>{const{theme:t,classGroups:n}=e;return Ps(n,t)},Ps=(e,t)=>{const n=Po();for(const r in e){const o=e[r];tr(o,n,r,t)}return n},tr=(e,t,n,r)=>{const o=e.length;for(let i=0;i<o;i++){const s=e[i];Rs(s,t,n,r)}},Rs=(e,t,n,r)=>{if(typeof e=="string"){Zs(e,t,n);return}if(typeof e=="function"){Ns(e,t,n,r);return}Ls(e,t,n,r)},Zs=(e,t,n)=>{const r=e===""?t:Zo(t,e);r.classGroupId=n},Ns=(e,t,n,r)=>{if(js(e)){tr(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(As(n,e))},Ls=(e,t,n,r)=>{const o=Object.entries(e),i=o.length;for(let s=0;s<i;s++){const[a,l]=o[s];tr(l,Zo(t,a),n,r)}},Zo=(e,t)=>{let n=e;const r=t.split(yn),o=r.length;for(let i=0;i<o;i++){const s=r[i];let a=n.nextPart.get(s);a||(a=Po(),n.nextPart.set(s,a)),n=a}return n},js=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Ds=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const o=(i,s)=>{n[i]=s,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(i){let s=n[i];if(s!==void 0)return s;if((s=r[i])!==void 0)return o(i,s),s},set(i,s){i in n?n[i]=s:o(i,s)}}},Un="!",Sr=":",Ms=[],zr=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),Us=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const i=[];let s=0,a=0,l=0,u;const d=o.length;for(let v=0;v<d;v++){const b=o[v];if(s===0&&a===0){if(b===Sr){i.push(o.slice(l,v)),l=v+1;continue}if(b==="/"){u=v;continue}}b==="["?s++:b==="]"?s--:b==="("?a++:b===")"&&a--}const c=i.length===0?o:o.slice(l);let f=c,p=!1;c.endsWith(Un)?(f=c.slice(0,-1),p=!0):c.startsWith(Un)&&(f=c.slice(1),p=!0);const $=u&&u>l?u-l:void 0;return zr(i,p,f,$)};if(t){const o=t+Sr,i=r;r=s=>s.startsWith(o)?i(s.slice(o.length)):zr(Ms,!1,s,void 0,!0)}if(n){const o=r;r=i=>n({className:i,parseClassName:o})}return r},Fs=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let i=0;i<n.length;i++){const s=n[i],a=s[0]==="[",l=t.has(s);a||l?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(s)):o.push(s)}return o.length>0&&(o.sort(),r.push(...o)),r}},Vs=e=>({cache:Ds(e.cacheSize),parseClassName:Us(e),sortModifiers:Fs(e),postfixLookupClassGroupIds:Bs(e),...Is(e)}),Bs=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let r=0;r<n.length;r++)t[n[r]]=!0;return t},Gs=/\s+/,Hs=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:i,postfixLookupClassGroupIds:s}=t,a=[],l=e.trim().split(Gs);let u="";for(let d=l.length-1;d>=0;d-=1){const c=l[d],{isExternal:f,modifiers:p,hasImportantModifier:$,baseClassName:v,maybePostfixModifierPosition:b}=n(c);if(f){u=c+(u.length>0?" "+u:u);continue}let y=!!b,S;if(y){const j=v.substring(0,b);S=r(j);const _=S&&s[S]?r(v):void 0;_&&_!==S&&(S=_,y=!1)}else S=r(v);if(!S){if(!y){u=c+(u.length>0?" "+u:u);continue}if(S=r(v),!S){u=c+(u.length>0?" "+u:u);continue}y=!1}const x=p.length===0?"":p.length===1?p[0]:i(p).join(":"),P=$?x+Un:x,C=P+S;if(a.indexOf(C)>-1)continue;a.push(C);const A=o(S,y);for(let j=0;j<A.length;++j){const _=A[j];a.push(P+_)}u=c+(u.length>0?" "+u:u)}return u},Ws=(...e)=>{let t=0,n,r,o="";for(;t<e.length;)(n=e[t++])&&(r=No(n))&&(o&&(o+=" "),o+=r);return o},No=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=No(e[r]))&&(n&&(n+=" "),n+=t);return n},Cr=(e,...t)=>{let n,r,o,i;const s=l=>{const u=t.reduce((d,c)=>c(d),e());return n=Vs(u),r=n.cache.get,o=n.cache.set,i=a,a(l)},a=l=>{const u=r(l);if(u)return u;const d=Hs(l,n);return o(l,d),d};return i=s,(...l)=>i(Ws(...l))},Js=[],ve=e=>{const t=n=>n[e]||Js;return t.isThemeGetter=!0,t},Lo=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,jo=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ks=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,qs=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ys=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Xs=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Qs=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ea=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,qe=e=>Ks.test(e),H=e=>!!e&&!Number.isNaN(Number(e)),De=e=>!!e&&Number.isInteger(Number(e)),Nn=e=>e.endsWith("%")&&H(e.slice(0,-1)),Fe=e=>qs.test(e),Do=()=>!0,ta=e=>Ys.test(e)&&!Xs.test(e),nr=()=>!1,na=e=>Qs.test(e),ra=e=>ea.test(e),oa=e=>!I(e)&&!O(e),ia=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),sa=e=>et(e,Fo,nr),I=e=>Lo.test(e),st=e=>et(e,Vo,ta),Ar=e=>et(e,pa,H),aa=e=>et(e,Go,Do),la=e=>et(e,Bo,nr),Er=e=>et(e,Mo,nr),ca=e=>et(e,Uo,ra),en=e=>et(e,Ho,na),O=e=>jo.test(e),Tt=e=>dt(e,Vo),ua=e=>dt(e,Bo),Ir=e=>dt(e,Mo),da=e=>dt(e,Fo),fa=e=>dt(e,Uo),tn=e=>dt(e,Ho,!0),ha=e=>dt(e,Go,!0),et=(e,t,n)=>{const r=Lo.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},dt=(e,t,n=!1)=>{const r=jo.exec(e);return r?r[1]?t(r[1]):n:!1},Mo=e=>e==="position"||e==="percentage",Uo=e=>e==="image"||e==="url",Fo=e=>e==="length"||e==="size"||e==="bg-size",Vo=e=>e==="length",pa=e=>e==="number",Bo=e=>e==="family-name",Go=e=>e==="number"||e==="weight",Ho=e=>e==="shadow",Or=()=>{const e=ve("color"),t=ve("font"),n=ve("text"),r=ve("font-weight"),o=ve("tracking"),i=ve("leading"),s=ve("breakpoint"),a=ve("container"),l=ve("spacing"),u=ve("radius"),d=ve("shadow"),c=ve("inset-shadow"),f=ve("text-shadow"),p=ve("drop-shadow"),$=ve("blur"),v=ve("perspective"),b=ve("aspect"),y=ve("ease"),S=ve("animate"),x=()=>["auto","avoid","all","avoid-page","page","left","right","column"],P=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],C=()=>[...P(),O,I],A=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto","contain","none"],_=()=>[O,I,l],Q=()=>[qe,"full","auto",..._()],M=()=>[De,"none","subgrid",O,I],L=()=>["auto",{span:["full",De,O,I]},De,O,I],V=()=>[De,"auto",O,I],he=()=>["auto","min","max","fr",O,I],R=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],U=()=>["start","end","center","stretch","center-safe","end-safe"],G=()=>["auto",..._()],de=()=>[qe,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",..._()],ae=()=>[qe,"screen","full","dvw","lvw","svw","min","max","fit",..._()],ye=()=>[qe,"screen","full","lh","dvh","lvh","svh","min","max","fit",..._()],Z=()=>[e,O,I],rt=()=>[...P(),Ir,Er,{position:[O,I]}],qt=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Yt=()=>["auto","cover","contain",da,sa,{size:[O,I]}],ht=()=>[Nn,Tt,st],we=()=>["","none","full",u,O,I],ke=()=>["",H,Tt,st],pt=()=>["solid","dashed","dotted","double"],Xt=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],pe=()=>[H,Nn,Ir,Er],Ke=()=>["","none",$,O,I],mt=()=>["none",H,O,I],gt=()=>["none",H,O,I],vt=()=>[H,O,I],ot=()=>[qe,"full",..._()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Fe],breakpoint:[Fe],color:[Do],container:[Fe],"drop-shadow":[Fe],ease:["in","out","in-out"],font:[oa],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Fe],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Fe],shadow:[Fe],spacing:["px",H],text:[Fe],"text-shadow":[Fe],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",qe,I,O,b]}],container:["container"],"container-type":[{"@container":["","normal","size",O,I]}],"container-named":[ia],columns:[{columns:[H,I,O,a]}],"break-after":[{"break-after":x()}],"break-before":[{"break-before":x()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:C()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Q()}],"inset-x":[{"inset-x":Q()}],"inset-y":[{"inset-y":Q()}],start:[{"inset-s":Q(),start:Q()}],end:[{"inset-e":Q(),end:Q()}],"inset-bs":[{"inset-bs":Q()}],"inset-be":[{"inset-be":Q()}],top:[{top:Q()}],right:[{right:Q()}],bottom:[{bottom:Q()}],left:[{left:Q()}],visibility:["visible","invisible","collapse"],z:[{z:[De,"auto",O,I]}],basis:[{basis:[qe,"full","auto",a,..._()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[H,qe,"auto","initial","none",I]}],grow:[{grow:["",H,O,I]}],shrink:[{shrink:["",H,O,I]}],order:[{order:[De,"first","last","none",O,I]}],"grid-cols":[{"grid-cols":M()}],"col-start-end":[{col:L()}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":M()}],"row-start-end":[{row:L()}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":he()}],"auto-rows":[{"auto-rows":he()}],gap:[{gap:_()}],"gap-x":[{"gap-x":_()}],"gap-y":[{"gap-y":_()}],"justify-content":[{justify:[...R(),"normal"]}],"justify-items":[{"justify-items":[...U(),"normal"]}],"justify-self":[{"justify-self":["auto",...U()]}],"align-content":[{content:["normal",...R()]}],"align-items":[{items:[...U(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...U(),{baseline:["","last"]}]}],"place-content":[{"place-content":R()}],"place-items":[{"place-items":[...U(),"baseline"]}],"place-self":[{"place-self":["auto",...U()]}],p:[{p:_()}],px:[{px:_()}],py:[{py:_()}],ps:[{ps:_()}],pe:[{pe:_()}],pbs:[{pbs:_()}],pbe:[{pbe:_()}],pt:[{pt:_()}],pr:[{pr:_()}],pb:[{pb:_()}],pl:[{pl:_()}],m:[{m:G()}],mx:[{mx:G()}],my:[{my:G()}],ms:[{ms:G()}],me:[{me:G()}],mbs:[{mbs:G()}],mbe:[{mbe:G()}],mt:[{mt:G()}],mr:[{mr:G()}],mb:[{mb:G()}],ml:[{ml:G()}],"space-x":[{"space-x":_()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":_()}],"space-y-reverse":["space-y-reverse"],size:[{size:de()}],"inline-size":[{inline:["auto",...ae()]}],"min-inline-size":[{"min-inline":["auto",...ae()]}],"max-inline-size":[{"max-inline":["none",...ae()]}],"block-size":[{block:["auto",...ye()]}],"min-block-size":[{"min-block":["auto",...ye()]}],"max-block-size":[{"max-block":["none",...ye()]}],w:[{w:[a,"screen",...de()]}],"min-w":[{"min-w":[a,"screen","none",...de()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[s]},...de()]}],h:[{h:["screen","lh",...de()]}],"min-h":[{"min-h":["screen","lh","none",...de()]}],"max-h":[{"max-h":["screen","lh",...de()]}],"font-size":[{text:["base",n,Tt,st]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ha,aa]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Nn,I]}],"font-family":[{font:[ua,la,t]}],"font-features":[{"font-features":[I]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,O,I]}],"line-clamp":[{"line-clamp":[H,"none",O,Ar]}],leading:[{leading:[i,..._()]}],"list-image":[{"list-image":["none",O,I]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",O,I]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:Z()}],"text-color":[{text:Z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...pt(),"wavy"]}],"text-decoration-thickness":[{decoration:[H,"from-font","auto",O,st]}],"text-decoration-color":[{decoration:Z()}],"underline-offset":[{"underline-offset":[H,"auto",O,I]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:_()}],"tab-size":[{tab:[De,O,I]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",O,I]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",O,I]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:rt()}],"bg-repeat":[{bg:qt()}],"bg-size":[{bg:Yt()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},De,O,I],radial:["",O,I],conic:[De,O,I]},fa,ca]}],"bg-color":[{bg:Z()}],"gradient-from-pos":[{from:ht()}],"gradient-via-pos":[{via:ht()}],"gradient-to-pos":[{to:ht()}],"gradient-from":[{from:Z()}],"gradient-via":[{via:Z()}],"gradient-to":[{to:Z()}],rounded:[{rounded:we()}],"rounded-s":[{"rounded-s":we()}],"rounded-e":[{"rounded-e":we()}],"rounded-t":[{"rounded-t":we()}],"rounded-r":[{"rounded-r":we()}],"rounded-b":[{"rounded-b":we()}],"rounded-l":[{"rounded-l":we()}],"rounded-ss":[{"rounded-ss":we()}],"rounded-se":[{"rounded-se":we()}],"rounded-ee":[{"rounded-ee":we()}],"rounded-es":[{"rounded-es":we()}],"rounded-tl":[{"rounded-tl":we()}],"rounded-tr":[{"rounded-tr":we()}],"rounded-br":[{"rounded-br":we()}],"rounded-bl":[{"rounded-bl":we()}],"border-w":[{border:ke()}],"border-w-x":[{"border-x":ke()}],"border-w-y":[{"border-y":ke()}],"border-w-s":[{"border-s":ke()}],"border-w-e":[{"border-e":ke()}],"border-w-bs":[{"border-bs":ke()}],"border-w-be":[{"border-be":ke()}],"border-w-t":[{"border-t":ke()}],"border-w-r":[{"border-r":ke()}],"border-w-b":[{"border-b":ke()}],"border-w-l":[{"border-l":ke()}],"divide-x":[{"divide-x":ke()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ke()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...pt(),"hidden","none"]}],"divide-style":[{divide:[...pt(),"hidden","none"]}],"border-color":[{border:Z()}],"border-color-x":[{"border-x":Z()}],"border-color-y":[{"border-y":Z()}],"border-color-s":[{"border-s":Z()}],"border-color-e":[{"border-e":Z()}],"border-color-bs":[{"border-bs":Z()}],"border-color-be":[{"border-be":Z()}],"border-color-t":[{"border-t":Z()}],"border-color-r":[{"border-r":Z()}],"border-color-b":[{"border-b":Z()}],"border-color-l":[{"border-l":Z()}],"divide-color":[{divide:Z()}],"outline-style":[{outline:[...pt(),"none","hidden"]}],"outline-offset":[{"outline-offset":[H,O,I]}],"outline-w":[{outline:["",H,Tt,st]}],"outline-color":[{outline:Z()}],shadow:[{shadow:["","none",d,tn,en]}],"shadow-color":[{shadow:Z()}],"inset-shadow":[{"inset-shadow":["none",c,tn,en]}],"inset-shadow-color":[{"inset-shadow":Z()}],"ring-w":[{ring:ke()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:Z()}],"ring-offset-w":[{"ring-offset":[H,st]}],"ring-offset-color":[{"ring-offset":Z()}],"inset-ring-w":[{"inset-ring":ke()}],"inset-ring-color":[{"inset-ring":Z()}],"text-shadow":[{"text-shadow":["none",f,tn,en]}],"text-shadow-color":[{"text-shadow":Z()}],opacity:[{opacity:[H,O,I]}],"mix-blend":[{"mix-blend":[...Xt(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Xt()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[H]}],"mask-image-linear-from-pos":[{"mask-linear-from":pe()}],"mask-image-linear-to-pos":[{"mask-linear-to":pe()}],"mask-image-linear-from-color":[{"mask-linear-from":Z()}],"mask-image-linear-to-color":[{"mask-linear-to":Z()}],"mask-image-t-from-pos":[{"mask-t-from":pe()}],"mask-image-t-to-pos":[{"mask-t-to":pe()}],"mask-image-t-from-color":[{"mask-t-from":Z()}],"mask-image-t-to-color":[{"mask-t-to":Z()}],"mask-image-r-from-pos":[{"mask-r-from":pe()}],"mask-image-r-to-pos":[{"mask-r-to":pe()}],"mask-image-r-from-color":[{"mask-r-from":Z()}],"mask-image-r-to-color":[{"mask-r-to":Z()}],"mask-image-b-from-pos":[{"mask-b-from":pe()}],"mask-image-b-to-pos":[{"mask-b-to":pe()}],"mask-image-b-from-color":[{"mask-b-from":Z()}],"mask-image-b-to-color":[{"mask-b-to":Z()}],"mask-image-l-from-pos":[{"mask-l-from":pe()}],"mask-image-l-to-pos":[{"mask-l-to":pe()}],"mask-image-l-from-color":[{"mask-l-from":Z()}],"mask-image-l-to-color":[{"mask-l-to":Z()}],"mask-image-x-from-pos":[{"mask-x-from":pe()}],"mask-image-x-to-pos":[{"mask-x-to":pe()}],"mask-image-x-from-color":[{"mask-x-from":Z()}],"mask-image-x-to-color":[{"mask-x-to":Z()}],"mask-image-y-from-pos":[{"mask-y-from":pe()}],"mask-image-y-to-pos":[{"mask-y-to":pe()}],"mask-image-y-from-color":[{"mask-y-from":Z()}],"mask-image-y-to-color":[{"mask-y-to":Z()}],"mask-image-radial":[{"mask-radial":[O,I]}],"mask-image-radial-from-pos":[{"mask-radial-from":pe()}],"mask-image-radial-to-pos":[{"mask-radial-to":pe()}],"mask-image-radial-from-color":[{"mask-radial-from":Z()}],"mask-image-radial-to-color":[{"mask-radial-to":Z()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":P()}],"mask-image-conic-pos":[{"mask-conic":[H]}],"mask-image-conic-from-pos":[{"mask-conic-from":pe()}],"mask-image-conic-to-pos":[{"mask-conic-to":pe()}],"mask-image-conic-from-color":[{"mask-conic-from":Z()}],"mask-image-conic-to-color":[{"mask-conic-to":Z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:rt()}],"mask-repeat":[{mask:qt()}],"mask-size":[{mask:Yt()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",O,I]}],filter:[{filter:["","none",O,I]}],blur:[{blur:Ke()}],brightness:[{brightness:[H,O,I]}],contrast:[{contrast:[H,O,I]}],"drop-shadow":[{"drop-shadow":["","none",p,tn,en]}],"drop-shadow-color":[{"drop-shadow":Z()}],grayscale:[{grayscale:["",H,O,I]}],"hue-rotate":[{"hue-rotate":[H,O,I]}],invert:[{invert:["",H,O,I]}],saturate:[{saturate:[H,O,I]}],sepia:[{sepia:["",H,O,I]}],"backdrop-filter":[{"backdrop-filter":["","none",O,I]}],"backdrop-blur":[{"backdrop-blur":Ke()}],"backdrop-brightness":[{"backdrop-brightness":[H,O,I]}],"backdrop-contrast":[{"backdrop-contrast":[H,O,I]}],"backdrop-grayscale":[{"backdrop-grayscale":["",H,O,I]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[H,O,I]}],"backdrop-invert":[{"backdrop-invert":["",H,O,I]}],"backdrop-opacity":[{"backdrop-opacity":[H,O,I]}],"backdrop-saturate":[{"backdrop-saturate":[H,O,I]}],"backdrop-sepia":[{"backdrop-sepia":["",H,O,I]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":_()}],"border-spacing-x":[{"border-spacing-x":_()}],"border-spacing-y":[{"border-spacing-y":_()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",O,I]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[H,"initial",O,I]}],ease:[{ease:["linear","initial",y,O,I]}],delay:[{delay:[H,O,I]}],animate:[{animate:["none",S,O,I]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[v,O,I]}],"perspective-origin":[{"perspective-origin":C()}],rotate:[{rotate:mt()}],"rotate-x":[{"rotate-x":mt()}],"rotate-y":[{"rotate-y":mt()}],"rotate-z":[{"rotate-z":mt()}],scale:[{scale:gt()}],"scale-x":[{"scale-x":gt()}],"scale-y":[{"scale-y":gt()}],"scale-z":[{"scale-z":gt()}],"scale-3d":["scale-3d"],skew:[{skew:vt()}],"skew-x":[{"skew-x":vt()}],"skew-y":[{"skew-y":vt()}],transform:[{transform:[O,I,"","none","gpu","cpu"]}],"transform-origin":[{origin:C()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ot()}],"translate-x":[{"translate-x":ot()}],"translate-y":[{"translate-y":ot()}],"translate-z":[{"translate-z":ot()}],"translate-none":["translate-none"],zoom:[{zoom:[De,O,I]}],accent:[{accent:Z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:Z()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",O,I]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":Z()}],"scrollbar-track-color":[{"scrollbar-track":Z()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":_()}],"scroll-mx":[{"scroll-mx":_()}],"scroll-my":[{"scroll-my":_()}],"scroll-ms":[{"scroll-ms":_()}],"scroll-me":[{"scroll-me":_()}],"scroll-mbs":[{"scroll-mbs":_()}],"scroll-mbe":[{"scroll-mbe":_()}],"scroll-mt":[{"scroll-mt":_()}],"scroll-mr":[{"scroll-mr":_()}],"scroll-mb":[{"scroll-mb":_()}],"scroll-ml":[{"scroll-ml":_()}],"scroll-p":[{"scroll-p":_()}],"scroll-px":[{"scroll-px":_()}],"scroll-py":[{"scroll-py":_()}],"scroll-ps":[{"scroll-ps":_()}],"scroll-pe":[{"scroll-pe":_()}],"scroll-pbs":[{"scroll-pbs":_()}],"scroll-pbe":[{"scroll-pbe":_()}],"scroll-pt":[{"scroll-pt":_()}],"scroll-pr":[{"scroll-pr":_()}],"scroll-pb":[{"scroll-pb":_()}],"scroll-pl":[{"scroll-pl":_()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",O,I]}],fill:[{fill:["none",...Z()]}],"stroke-w":[{stroke:[H,Tt,st,Ar]}],stroke:[{stroke:["none",...Z()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},ma=(e,{cacheSize:t,prefix:n,experimentalParseClassName:r,extend:o={},override:i={}})=>(wt(e,"cacheSize",t),wt(e,"prefix",n),wt(e,"experimentalParseClassName",r),nn(e.theme,i.theme),nn(e.classGroups,i.classGroups),nn(e.conflictingClassGroups,i.conflictingClassGroups),nn(e.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers),wt(e,"postfixLookupClassGroups",i.postfixLookupClassGroups),wt(e,"orderSensitiveModifiers",i.orderSensitiveModifiers),rn(e.theme,o.theme),rn(e.classGroups,o.classGroups),rn(e.conflictingClassGroups,o.conflictingClassGroups),rn(e.conflictingClassGroupModifiers,o.conflictingClassGroupModifiers),Fn(e,o,"postfixLookupClassGroups"),Fn(e,o,"orderSensitiveModifiers"),e),wt=(e,t,n)=>{n!==void 0&&(e[t]=n)},nn=(e,t)=>{if(t)for(const n in t)wt(e,n,t[n])},rn=(e,t)=>{if(t)for(const n in t)Fn(e,t,n)},Fn=(e,t,n)=>{const r=t[n];r!==void 0&&(e[n]=e[n]?e[n].concat(r):r)},ga=(e,...t)=>typeof e=="function"?Cr(Or,e,...t):Cr(()=>ma(Or(),e),...t),va=ga({extend:{classGroups:{"font-size":[{text:["micro","caption","meta","compact","body","title"]}]}}});function ie(...e){return va(To(e))}/**
2
+ * @license lucide-solid v0.400.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */var ba={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"},yt=ba,ya=w("<svg>"),wa=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ka=(...e)=>e.filter((t,n,r)=>!!t&&r.indexOf(t)===n).join(" "),xa=e=>{const[t,n]=We(e,["color","size","strokeWidth","children","class","name","iconNode","absoluteStrokeWidth"]);return(()=>{var r=ya();return Qe(r,be(yt,{get width(){return t.size??yt.width},get height(){return t.size??yt.height},get stroke(){return t.color??yt.stroke},get"stroke-width"(){return Me(()=>!!t.absoluteStrokeWidth)()?Number(t.strokeWidth??yt["stroke-width"])*24/Number(t.size):Number(t.strokeWidth??yt["stroke-width"])},get class(){return ka("lucide","lucide-icon",t.name!=null?`lucide-${wa(t==null?void 0:t.name)}`:void 0,t.class!=null?t.class:"")}},n),!0,!0),m(r,h($e,{get each(){return t.iconNode},children:([o,i])=>h(er,be({component:o},i))})),r})()},Je=xa,_a=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],$a=e=>h(Je,be(e,{name:"ChevronDown",iconNode:_a})),Wo=$a,Sa=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],za=e=>h(Je,be(e,{name:"ChevronUp",iconNode:Sa})),Ca=za,Aa=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Ea=e=>h(Je,be(e,{name:"Copy",iconNode:Aa})),Jo=Ea,Ia=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Oa=e=>h(Je,be(e,{name:"Pencil",iconNode:Ia})),Ta=Oa,Pa=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Ra=e=>h(Je,be(e,{name:"RefreshCw",iconNode:Pa})),Za=Ra,Na=[["path",{d:"M17 14V2",key:"8ymqnk"}],["path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z",key:"m61m77"}]],La=e=>h(Je,be(e,{name:"ThumbsDown",iconNode:Na})),ja=La,Da=[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]],Ma=e=>h(Je,be(e,{name:"ThumbsUp",iconNode:Da})),Ua=Ma,Fa=[["polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5",key:"16drj5"}],["path",{d:"M15.54 8.46a5 5 0 0 1 0 7.07",key:"ltjumu"}],["path",{d:"M19.07 4.93a10 10 0 0 1 0 14.14",key:"1kegas"}]],Va=e=>h(Je,be(e,{name:"Volume2",iconNode:Fa})),Ba=Va,Ga=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ha=e=>h(Je,be(e,{name:"X",iconNode:Ga})),Wt=Ha,Tr=w('<div class="min-w-0 flex-1">'),Wa=w('<div class="-mt-1 shrink-0">'),Ja=w('<div part=header class="flex items-start justify-between gap-3">'),Ka=w('<div part=body class="min-w-0 text-sm">'),qa=w("<div class=kc-actions>"),Ya=w("<div part=footer>"),Xa=w('<div class="flex min-w-0 flex-1 flex-col"style=padding:var(--kai-card-spacing);gap:var(--kai-card-spacing)>'),Qa=w('<button type=button part=dismiss aria-label=Dismiss class="absolute right-2 top-2 z-10 shrink-0 rounded p-1 opacity-60 transition-opacity hover:opacity-100">'),el=w("<style>"),tl=w("<div part=media class=kc-media>"),nl=w("<div class=kc-layout>");const rl={outlined:"border border-border bg-card text-card-foreground kai-elevation-sm",filled:"border border-transparent bg-surface-strong text-card-foreground",plain:"border border-transparent bg-transparent",accent:"border border-transparent bg-primary text-primary-foreground"};function Ko(e){const t=be({appearance:"outlined",orientation:"vertical",collapse:"28rem",dense:!1},e),[n,r]=We(t,["appearance","orientation","collapse","dense","media","header","headerActions","footer","footerActions","hasBody","dismissible","onDismiss","href","target","rel","clickable","onCardClick","class","children"]),[o,i]=me(!0),s=C=>{var A;C.stopPropagation(),i(!1),(A=n.onDismiss)==null||A.call(n)},a=()=>!!n.href,l=()=>!a()&&!!n.clickable,u=()=>a()||l(),d=/^[\d.]+(px|rem|em|ch|vw|vh|%)$/,c=()=>d.test(n.collapse)?n.collapse:"28rem",f=`kc-i-${Re()}`,p=()=>{const C=c(),A=n.orientation==="horizontal",j=n.orientation==="responsive",_=`.${f}`,Q=`${_} .kc-layout{display:flex;flex-direction:${A?"row":"column"}}${_} .kc-media{overflow:hidden;${A?"flex-shrink:0;align-self:stretch":"width:100%"}}${_} [part="footer"]{display:flex;flex-direction:column;gap:0.75rem}${_} .kc-actions{display:flex;flex-direction:column-reverse;align-items:stretch;gap:0.5rem}`,M=`${_} [part="footer"]{flex-direction:row;align-items:center}${_} .kc-actions{flex-direction:row;align-items:center;margin-left:auto}`+(j?`${_} .kc-layout{flex-direction:row}${_} .kc-media{width:auto;flex-shrink:0;align-self:stretch}`:"");return`${Q}@container (min-width:${C}){${M}}`},$=C=>{var A;return(A=n.onCardClick)==null?void 0:A.call(n,C)},v=C=>{l()&&(C.key==="Enter"||C.key===" "||C.key==="Spacebar")&&(C.preventDefault(),$(C))},b=()=>n.rel??(n.target==="_blank"?"noopener noreferrer":void 0),y=()=>!!n.header||!!n.headerActions,S=()=>!!n.footer||!!n.footerActions,x=()=>y()||n.hasBody||S(),P=(()=>{var C=Xa();return m(C,h(B,{get when(){return y()},get children(){var A=Ja();return m(A,h(B,{get when(){return n.header},get children(){var j=Tr();return m(j,()=>n.header),j}}),null),m(A,h(B,{get when(){return n.headerActions},get children(){var j=Wa();return m(j,()=>n.headerActions),j}}),null),A}}),null),m(C,h(B,{get when(){return n.hasBody},get children(){var A=Ka();return m(A,()=>n.children),A}}),null),m(C,h(B,{get when(){return S()},get children(){var A=Ya();return m(A,h(B,{get when(){return n.footer},get children(){var j=Tr();return m(j,()=>n.footer),j}}),null),m(A,h(B,{get when(){return n.footerActions},get children(){var j=qa();return m(j,()=>n.footerActions),j}}),null),A}}),null),C})();return h(B,{get when(){return o()},get children(){return h(er,be({get component(){return a()?"a":"div"},part:"card",get href(){return Me(()=>!!a())()?n.href:void 0},get target(){return Me(()=>!!a())()?n.target:void 0},get rel(){return Me(()=>!!a())()?b():void 0},get role(){return l()?"button":void 0},get tabindex(){return l()?0:void 0},get onClick(){return u()?$:void 0},get onKeyDown(){return l()?v:void 0},get style(){return{"--kai-card-spacing":n.dense?"0.875rem":"1.25rem"}},get class(){return ie("relative block overflow-hidden rounded-xl no-underline @container",f,rl[n.appearance],u()&&"cursor-pointer transition-colors hover:border-ring focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",n.class)}},r,{get children(){return[h(B,{get when(){return n.dismissible},get children(){var C=Qa();return C.$$click=s,m(C,h(Wt,{class:"size-3.5","aria-hidden":"true"})),C}}),(()=>{var C=el();return m(C,p),C})(),(()=>{var C=nl();return m(C,h(B,{get when(){return n.media},get children(){var A=tl();return m(A,()=>n.media),A}}),null),m(C,h(B,{get when(){return x()},children:P}),null),C})()]}}))}})}At(["click"]);const Jt="https://ui.kitn.ai/schemas/construct/v1.json",Pt={id:"identity",paths:["name"]},Rt={id:"theme",paths:["theme.accent","theme.mode","theme.unreadColor"]},on={id:"header",paths:["header.title"]},ol={id:"header",paths:["header.title","header.themeToggle","header.actions"]},il={id:"empty",paths:["empty.title","empty.description","empty.icon"]},sl={id:"home",paths:["home"]},Zt={id:"capabilities",paths:["capabilities.starters","capabilities.attachments","capabilities.history","capabilities.conversations","capabilities.reasoning","capabilities.reasoningOpen"]},sn={id:"messageActions",paths:["capabilities.messageActions.user","capabilities.messageActions.assistant"]},al={id:"sources",paths:["capabilities.sources.strip"]},ll={id:"widget",paths:["widget.position","widget.launcherIcon","widget.defaultOpen"]},cl={id:"aside",paths:["aside.position","aside.width"]},Pr={id:"composerTriggers",paths:["composer.triggers.slash","composer.triggers.mention"]},Rr={id:"shell",paths:["shell.commandPalette","shell.userMenu"]},ul={id:"cards",paths:["cards"]},Nt={id:"provider",paths:["provider"]},dl={$schema:Jt,name:"support-widget",layout:"widget",provider:{mode:"mock"},header:{title:"Support"},theme:{unreadColor:"#38BDF8",mode:"system"},empty:{title:"Hi, we're here to help",description:"Ask us about orders, refunds, and more."},home:{greeting:{title:"How can we help? 👋",subtitle:"Orders, refunds, anything."},recentConversation:!0,links:[{label:"Help center",href:"https://ui.kitn.ai",description:"Guides and FAQs",icon:"book-open"}]},widget:{position:"bottom-end"},capabilities:{starters:["Where's my order?","Request a refund"],attachments:{accept:["image/*","application/pdf"]},history:{persistence:"local"},conversations:!0}},fl={$schema:Jt,name:"in-app-assistant",layout:"aside",provider:{mode:"mock"},header:{title:"Assistant"},theme:{accent:"#0ea5e9",mode:"dark"},aside:{position:"end",width:"380px"},capabilities:{starters:["Deploy payments to production","Check the canary status"],attachments:{accept:["image/*","application/pdf"]},history:{persistence:"local"}}},hl={$schema:Jt,name:"daily-assistant",layout:"fullscreen",provider:{mode:"mock"},header:{title:"Assistant"},theme:{accent:"#7c3aed",mode:"dark"},empty:{title:"What can I help with?",description:"Ask anything, or start from a suggestion below."},capabilities:{starters:["Draft the Q3 board update","Summarize a document","Compare two options"],attachments:{accept:["image/*","application/pdf"]},history:{persistence:"local"},conversations:!0}},pl={$schema:Jt,name:"research-assistant",layout:"fullscreen",provider:{mode:"mock"},header:{title:"Research"},theme:{accent:"#0f766e",mode:"dark"},capabilities:{starters:["How does the wire adapter work?","What are message parts?"],attachments:{accept:["application/pdf"]},history:{persistence:"local"},sources:{strip:!0},messageActions:{user:["edit"],assistant:["copy","like","dislike"]}}},ml={triggers:{slash:[{id:"summarize",label:"summarize",description:"Summarize the thread so far"},{id:"translate",label:"translate",description:"Translate the last message"}],mention:[{id:"researcher",label:"researcher",description:"Hands off to the research agent"},{id:"coder",label:"coder",description:"Hands off to the coding agent"}]}},wn={$schema:Jt,name:"build-workspace",layout:"split",provider:{mode:"mock"},header:{title:"Workspace",themeToggle:!0,actions:[{label:"Share",variant:"outline"},{label:"Deploy",variant:"default"}]},theme:{accent:"#ea580c",mode:"dark"},shell:{commandPalette:!0,userMenu:{name:"Ada",plan:"Pro"}},composer:ml,capabilities:{starters:["Build a pricing table","Add a dark mode toggle"],attachments:{accept:["image/*"]},history:{persistence:"local"}}},gl={...wn,name:"artifact-workspace"},vl={...wn,name:"app-workspace",capabilities:{...wn.capabilities,starters:["Build a landing page for a coffee shop","Make the hero work on mobile"]}},Cn=[{id:"widget",name:"Support widget",description:"A floating chat that lives in the corner of your site.",availability:"buildable",starter:dl,controls:[Pt,Rt,on,sl,Zt,ll,Nt]},{id:"inAppAssistant",name:"In-app assistant",description:"An assistant docked inside your existing app.",availability:"buildable",starter:fl,controls:[Pt,Rt,on,cl,Pr,Zt,sn,ul,Nt]},{id:"assistant",name:"Assistant",description:"A full-page assistant with a history of past conversations.",availability:"buildable",starter:hl,controls:[Pt,Rt,on,Rr,il,Zt,sn,Nt]},{id:"research",name:"Research",description:"Search-first answers with cited sources.",availability:"buildable",starter:pl,controls:[Pt,Rt,on,Zt,al,sn,Nt]},{id:"workspace",name:"Workspace",description:"Chat drives a live work surface: previews, code, and artifacts build beside the conversation.",availability:"buildable",starter:wn,variants:[{id:"artifactPreview",name:"Artifact preview beside chat",description:"A code or rendered-output pane grows beside the conversation as you build.",starter:gl},{id:"appPreview",name:"App preview with device toggles",description:"A full browser-chrome preview of the running app, with desktop, tablet, and mobile views.",starter:vl}],controls:[Pt,Rt,ol,Rr,Pr,Zt,sn,Nt]},{id:"voice",name:"Voice",description:"A voice-first assistant you talk to, push-to-talk and all.",availability:"story-only"}];function bl(){return Cn.filter(e=>e.availability==="buildable")}function yl(e){return Cn.find(t=>t.id===e)}function wl(e){var t;switch(e.layout){case"widget":return"widget";case"aside":return"inAppAssistant";case"split":return"workspace";case"fullscreen":return(t=e.capabilities)!=null&&t.sources?"research":"assistant";default:return}}var kl=w('<style>[data-builder-start] [aria-pressed="true"]{--tw-ring-color:var(--color-primary) !important}'),xl=w("<div data-builder-start>"),_l=w('<button type=button><span class="text-sm font-medium underline-offset-4 hover:underline">Start from scratch</span><span class=text-xs>A bare chat, everything off. You can switch to a template later.'),$l=w('<div class="flex flex-col gap-1"><h2 class="text-sm font-semibold text-foreground"></h2><p class="text-sm leading-snug text-muted-foreground">'),Sl=w('<div class="flex h-44 items-center justify-center p-4">'),zl=w('<svg viewBox="0 0 160 100"class="h-full w-full"aria-hidden=true><rect x=4 y=4 width=152 height=92 rx=6 stroke-width=1.5></rect><line x1=16 y1=20 x2=88 y2=20 stroke-width=1.5 stroke-linecap=round></line><line x1=16 y1=30 x2=64 y2=30 stroke-width=1.5 stroke-linecap=round></line><rect x=92 y=30 width=56 height=48 rx=6 stroke-width=1.5></rect><line x1=100 y1=40 x2=130 y2=40 stroke-width=1.5 stroke-linecap=round></line><line x1=100 y1=48 x2=118 y2=48 stroke-width=1.5 stroke-linecap=round></line><circle cx=138 cy=88 r=7>'),Cl=w('<svg viewBox="0 0 160 100"class="h-full w-full"aria-hidden=true><rect x=4 y=4 width=152 height=92 rx=6 stroke-width=1.5></rect><line x1=42 y1=4 x2=42 y2=96 stroke-width=1.5></line><line x1=14 y1=20 x2=34 y2=20 stroke-width=1.5 stroke-linecap=round></line><line x1=14 y1=30 x2=34 y2=30 stroke-width=1.5 stroke-linecap=round></line><line x1=14 y1=40 x2=34 y2=40 stroke-width=1.5 stroke-linecap=round></line><rect x=54 y=16 width=92 height=60 rx=6 stroke-width=1.5></rect><line x1=64 y1=28 x2=100 y2=28 stroke-width=1.5 stroke-linecap=round></line><line x1=64 y1=38 x2=112 y2=38 stroke-width=1.5 stroke-linecap=round></line><line x1=64 y1=48 x2=94 y2=48 stroke-width=1.5 stroke-linecap=round></line><rect x=64 y=60 width=72 height=8 rx=4 stroke-width=1.5>'),Al=w('<svg viewBox="0 0 160 100"class="h-full w-full"aria-hidden=true><rect x=4 y=4 width=152 height=92 rx=6 stroke-width=1.5></rect><rect x=16 y=14 width=128 height=12 rx=6 stroke-width=1.5></rect><rect x=16 y=34 width=94 height=52 rx=6 stroke-width=1.5></rect><line x1=24 y1=44 x2=92 y2=44 stroke-width=1.5 stroke-linecap=round></line><line x1=24 y1=52 x2=80 y2=52 stroke-width=1.5 stroke-linecap=round></line><line x1=24 y1=60 x2=88 y2=60 stroke-width=1.5 stroke-linecap=round></line><rect x=118 y=34 width=26 height=52 rx=6 stroke-width=1.5></rect><line x1=124 y1=42 x2=138 y2=42 stroke-width=1.5 stroke-linecap=round></line><line x1=124 y1=50 x2=138 y2=50 stroke-width=1.5 stroke-linecap=round></line><line x1=124 y1=58 x2=138 y2=58 stroke-width=1.5 stroke-linecap=round>'),El=w('<svg viewBox="0 0 160 100"class="h-full w-full"aria-hidden=true><rect x=4 y=4 width=152 height=92 rx=6 stroke-width=1.5></rect><rect x=12 y=12 width=44 height=76 rx=6 stroke-width=1.5></rect><line x1=20 y1=24 x2=48 y2=24 stroke-width=1.5 stroke-linecap=round></line><line x1=20 y1=32 x2=40 y2=32 stroke-width=1.5 stroke-linecap=round></line><line x1=20 y1=40 x2=44 y2=40 stroke-width=1.5 stroke-linecap=round></line><rect x=64 y=12 width=84 height=76 rx=6 stroke-width=1.5></rect><line x1=74 y1=24 x2=120 y2=24 stroke-width=1.5 stroke-linecap=round></line><line x1=74 y1=34 x2=138 y2=34 stroke-width=1.5 stroke-linecap=round></line><rect x=74 y=46 width=30 height=30 rx=4 stroke-width=1.5></rect><rect x=110 y=46 width=30 height=30 rx=4 stroke-width=1.5>'),Il=w('<svg viewBox="0 0 160 100"class="h-full w-full"aria-hidden=true><rect x=4 y=4 width=152 height=92 rx=6 stroke-width=1.5></rect><line x1=16 y1=18 x2=80 y2=18 stroke-width=1.5 stroke-linecap=round></line><line x1=16 y1=28 x2=60 y2=28 stroke-width=1.5 stroke-linecap=round></line><rect x=16 y=42 width=52 height=38 rx=4 stroke-width=1.5></rect><rect x=112 y=4 width=44 height=92 rx=6 stroke-width=1.5></rect><line x1=120 y1=18 x2=146 y2=18 stroke-width=1.5 stroke-linecap=round></line><line x1=120 y1=28 x2=138 y2=28 stroke-width=1.5 stroke-linecap=round></line><line x1=120 y1=38 x2=142 y2=38 stroke-width=1.5 stroke-linecap=round></line><rect x=120 y=70 width=28 height=8 rx=4 stroke-width=1.5></rect><rect x=102 y=44 width=10 height=16 rx=3>'),Ol=w('<svg viewBox="0 0 160 100"class="h-full w-full"aria-hidden=true><circle cx=80 cy=82 r=12 stroke-width=1.5></circle><circle cx=80 cy=82 r=4>'),Tl=w("<svg><rect width=6 rx=3></svg>",!1,!0,!1);Cn.map(({id:e,name:t,description:n})=>({id:e,name:t,description:n}));const Vn=Cn.filter(e=>e.availability==="buildable").map(({id:e,name:t,description:n})=>({id:e,name:t,description:n})),qo={"background-image":"radial-gradient(circle, var(--color-border) 1px, transparent 1px)","background-size":"14px 14px"};function Zr(e){const t=()=>e.value==="scratch";return[kl(),(()=>{var n=xl();return m(n,h($e,{get each(){return e.templates??Vn},children:r=>{const o=()=>e.value===r.id,i=Dl[r.id];return h(Ko,{appearance:"outlined",clickable:!0,get"aria-pressed"(){return o()},onCardClick:()=>e.onSelect(r.id),hasBody:!0,get class(){return ie("text-left transition-shadow",o()?"border-primary ring-2 ring-primary":"hover:border-ring hover:shadow-md")},get media(){return(()=>{var s=Sl();return m(s,h(i,{})),F(a=>z(s,qo,a)),s})()},get children(){var s=$l(),a=s.firstChild,l=a.nextSibling;return m(a,()=>r.name),m(l,()=>r.description),s}})}})),F(()=>Oe(n,ie("grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-3",e.class))),n})(),(()=>{var n=_l();return n.$$click=()=>e.onSelect("scratch"),F(r=>{var o=t(),i=ie("mx-auto mt-6 flex flex-col items-center gap-0.5 rounded text-center transition-colors",t()?"text-foreground":"text-muted-foreground hover:text-foreground");return o!==r.e&&N(n,"aria-pressed",r.e=o),i!==r.t&&Oe(n,r.t=i),r},{e:void 0,t:void 0}),n})()]}const fe=1.5,W={stroke:"var(--color-muted-foreground)",fill:"none"},ze={stroke:"var(--color-border)",fill:"none"},Te={stroke:"var(--color-primary)",fill:"none"},kn={stroke:"none",fill:"var(--color-primary)"};function Pl(){return(()=>{var e=zl(),t=e.firstChild,n=t.nextSibling,r=n.nextSibling,o=r.nextSibling,i=o.nextSibling,s=i.nextSibling,a=s.nextSibling;return F(l=>{var u=ze,d=W,c=W,f=Te,p=Te,$=W,v=kn;return l.e=z(t,u,l.e),l.t=z(n,d,l.t),l.a=z(r,c,l.a),l.o=z(o,f,l.o),l.i=z(i,p,l.i),l.n=z(s,$,l.n),l.s=z(a,v,l.s),l},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),e})()}function Rl(){return(()=>{var e=Cl(),t=e.firstChild,n=t.nextSibling,r=n.nextSibling,o=r.nextSibling,i=o.nextSibling,s=i.nextSibling,a=s.nextSibling,l=a.nextSibling,u=l.nextSibling,d=u.nextSibling;return F(c=>{var f=ze,p=ze,$=W,v=W,b=W,y=Te,S=W,x=Te,P=W,C=ze;return c.e=z(t,f,c.e),c.t=z(n,p,c.t),c.a=z(r,$,c.a),c.o=z(o,v,c.o),c.i=z(i,b,c.i),c.n=z(s,y,c.n),c.s=z(a,S,c.s),c.h=z(l,x,c.h),c.r=z(u,P,c.r),c.d=z(d,C,c.d),c},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0}),e})()}function Zl(){return(()=>{var e=Al(),t=e.firstChild,n=t.nextSibling,r=n.nextSibling,o=r.nextSibling,i=o.nextSibling,s=i.nextSibling,a=s.nextSibling,l=a.nextSibling,u=l.nextSibling,d=u.nextSibling;return F(c=>{var f=ze,p=Te,$=Te,v=W,b=W,y=W,S=ze,x=W,P=W,C=W;return c.e=z(t,f,c.e),c.t=z(n,p,c.t),c.a=z(r,$,c.a),c.o=z(o,v,c.o),c.i=z(i,b,c.i),c.n=z(s,y,c.n),c.s=z(a,S,c.s),c.h=z(l,x,c.h),c.r=z(u,P,c.r),c.d=z(d,C,c.d),c},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0}),e})()}function Nl(){return(()=>{var e=El(),t=e.firstChild,n=t.nextSibling,r=n.nextSibling,o=r.nextSibling,i=o.nextSibling,s=i.nextSibling,a=s.nextSibling,l=a.nextSibling,u=l.nextSibling,d=u.nextSibling;return F(c=>{var f=ze,p=Te,$=W,v=Te,b=W,y=ze,S=W,x=W,P=W,C=W;return c.e=z(t,f,c.e),c.t=z(n,p,c.t),c.a=z(r,$,c.a),c.o=z(o,v,c.o),c.i=z(i,b,c.i),c.n=z(s,y,c.n),c.s=z(a,S,c.s),c.h=z(l,x,c.h),c.r=z(u,P,c.r),c.d=z(d,C,c.d),c},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0}),e})()}function Ll(){return(()=>{var e=Il(),t=e.firstChild,n=t.nextSibling,r=n.nextSibling,o=r.nextSibling,i=o.nextSibling,s=i.nextSibling,a=s.nextSibling,l=a.nextSibling,u=l.nextSibling,d=u.nextSibling;return F(c=>{var f=ze,p=W,$=W,v=W,b=Te,y=W,S=Te,x=W,P=ze,C=kn;return c.e=z(t,f,c.e),c.t=z(n,p,c.t),c.a=z(r,$,c.a),c.o=z(o,v,c.o),c.i=z(i,b,c.i),c.n=z(s,y,c.n),c.s=z(a,S,c.s),c.h=z(l,x,c.h),c.r=z(u,P,c.r),c.d=z(d,C,c.d),c},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0}),e})()}function jl(){const e=[18,32,46,60,40,54,24,44,30];return(()=>{var t=Ol(),n=t.firstChild,r=n.nextSibling;return m(t,h($e,{each:e,children:(o,i)=>{const s=20+i()*14,a=30-o/2+12;return(()=>{var l=Tl();return N(l,"x",s),N(l,"y",a),N(l,"height",o),F(u=>z(l,i()%3===1?W:kn,u)),l})()}}),n),F(o=>{var i=Te,s=kn;return o.e=z(n,i,o.e),o.t=z(r,s,o.t),o},{e:void 0,t:void 0}),t})()}const Dl={widget:Pl,inAppAssistant:Ll,assistant:Rl,research:Zl,workspace:Nl,voice:jl};At(["click"]);var Ml=w('<svg viewBox="0 0 160 100"class="h-full w-full"aria-hidden=true><rect x=4 y=4 width=152 height=92 rx=6></rect><rect x=12 y=12 width=44 height=76 rx=6></rect><line x1=20 y1=24 x2=48 y2=24 stroke-linecap=round></line><line x1=20 y1=32 x2=40 y2=32 stroke-linecap=round></line><rect x=64 y=12 width=84 height=76 rx=6></rect><line x1=74 y1=24 x2=128 y2=24 stroke-linecap=round></line><line x1=74 y1=32 x2=112 y2=32 stroke-linecap=round></line><line x1=74 y1=40 x2=122 y2=40 stroke-linecap=round></line><line x1=74 y1=48 x2=100 y2=48 stroke-linecap=round></line><line x1=74 y1=56 x2=118 y2=56 stroke-linecap=round>'),Ul=w('<svg viewBox="0 0 160 100"class="h-full w-full"aria-hidden=true><rect x=4 y=4 width=152 height=92 rx=6></rect><rect x=12 y=12 width=40 height=76 rx=6></rect><line x1=20 y1=24 x2=44 y2=24 stroke-linecap=round></line><rect x=60 y=12 width=88 height=76 rx=6></rect><line x1=60 y1=26 x2=148 y2=26></line><circle cx=68 cy=19 r=2></circle><circle cx=76 cy=19 r=2></circle><rect x=118 y=15 width=10 height=8 rx=2></rect><rect x=130 y=15 width=10 height=8 rx=2></rect><rect x=70 y=36 width=70 height=18 rx=3></rect><rect x=70 y=58 width=70 height=24 rx=3>'),Fl=w(`<div data-builder-workspace-variants><button type=button class="flex w-fit items-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground">← Back</button><div class="flex flex-col gap-1"><h2 class="text-lg font-semibold text-foreground">What kind of workspace?</h2><p class="text-sm text-muted-foreground">Both start from the same split shell. Pick the one closer to what you're building.</p></div><div class="grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-3">`),Vl=w('<div class="flex flex-col gap-1"><h3 class="text-sm font-semibold text-foreground"></h3><p class="text-sm leading-snug text-muted-foreground">'),Bl=w('<div class="flex h-44 items-center justify-center p-4">');const Gl=[{id:"artifactPreview",name:"Artifact preview beside chat",description:"A code or rendered-output pane grows beside the conversation as you build."},{id:"appPreview",name:"App preview with device toggles",description:"A full browser-chrome preview of the running app, with desktop, tablet, and mobile views."}];function Hl(){return(()=>{var e=Ml(),t=e.firstChild,n=t.nextSibling,r=n.nextSibling,o=r.nextSibling,i=o.nextSibling,s=i.nextSibling,a=s.nextSibling,l=a.nextSibling,u=l.nextSibling,d=u.nextSibling;return N(t,"stroke-width",fe),N(n,"stroke-width",fe),N(r,"stroke-width",fe),N(o,"stroke-width",fe),N(i,"stroke-width",fe),N(s,"stroke-width",fe),N(a,"stroke-width",fe),N(l,"stroke-width",fe),N(u,"stroke-width",fe),N(d,"stroke-width",fe),F(c=>{var f=ze,p=Te,$=W,v=Te,b=ze,y=W,S=W,x=W,P=W,C=W;return c.e=z(t,f,c.e),c.t=z(n,p,c.t),c.a=z(r,$,c.a),c.o=z(o,v,c.o),c.i=z(i,b,c.i),c.n=z(s,y,c.n),c.s=z(a,S,c.s),c.h=z(l,x,c.h),c.r=z(u,P,c.r),c.d=z(d,C,c.d),c},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0}),e})()}function Wl(){return(()=>{var e=Ul(),t=e.firstChild,n=t.nextSibling,r=n.nextSibling,o=r.nextSibling,i=o.nextSibling,s=i.nextSibling,a=s.nextSibling,l=a.nextSibling,u=l.nextSibling,d=u.nextSibling,c=d.nextSibling;return N(t,"stroke-width",fe),N(n,"stroke-width",fe),N(r,"stroke-width",fe),N(o,"stroke-width",fe),N(i,"stroke-width",fe),N(s,"stroke-width",fe),N(a,"stroke-width",fe),N(l,"stroke-width",fe),N(u,"stroke-width",fe),N(d,"stroke-width",fe),N(c,"stroke-width",fe),F(f=>{var p=ze,$=Te,v=W,b=ze,y=ze,S=W,x=W,P=W,C=W,A=W,j=W;return f.e=z(t,p,f.e),f.t=z(n,$,f.t),f.a=z(r,v,f.a),f.o=z(o,b,f.o),f.i=z(i,y,f.i),f.n=z(s,S,f.n),f.s=z(a,x,f.s),f.h=z(l,P,f.h),f.r=z(u,C,f.r),f.d=z(d,A,f.d),f.l=z(c,j,f.l),f},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0}),e})()}const Jl={artifactPreview:Hl,appPreview:Wl};function Kl(e){return(()=>{var t=Fl(),n=t.firstChild,r=n.nextSibling,o=r.nextSibling;return Eo(n,"click",e.onBack,!0),m(o,h($e,{each:Gl,children:i=>{const s=()=>e.value===i.id,a=Jl[i.id];return h(Ko,{appearance:"outlined",clickable:!0,get"aria-pressed"(){return s()},onCardClick:()=>e.onSelect(i.id),hasBody:!0,get class(){return ie("text-left transition-shadow",s()?"border-primary ring-2 ring-primary":"hover:border-ring hover:shadow-md")},get media(){return(()=>{var l=Bl();return m(l,h(a,{})),F(u=>z(l,qo,u)),l})()},get children(){var l=Vl(),u=l.firstChild,d=u.nextSibling;return m(u,()=>i.name),m(d,()=>i.description),l}})}})),F(()=>Oe(t,ie("flex flex-col gap-6",e.class))),t})()}At(["click"]);class Nr extends Error{}const Lr=64,ql=/[0-9]/u,Yl=/[\p{L}\p{N}]/u;function Kt(e){return e==="#"||e==="@"||e==="*"}function rr(e,t){return e==="#"?ql.test(t):Yl.test(t)}function Ln(e,t){if(e.length>Lr)throw new Nr(`format is ${e.length} characters; the maximum is ${Lr}`);if(t!==void 0&&t.length!==e.length)throw new Nr(`guide is ${t.length} characters but format is ${e.length}; they must align position for position`);const n=[];let r="";for(let o=0;o<e.length;o+=1){const i=e[o];Kt(i)?(n.push(o),r+=" "):r+=i}return{format:e,guide:t??r,fillIndexes:n,capacity:n.length}}function Xl(e,t){return t==="upper"?e.toUpperCase():t==="lower"?e.toLowerCase():e}function at(e,t,n="preserve"){let r="",o=0,i=0;for(;i<e.format.length&&o<t.length;){const s=e.format[i];if(!Kt(s)){t[o].toLowerCase()===s.toLowerCase()&&(o+=1),i+=1;continue}const a=Xl(t[o],n);rr(s,a)&&(r+=a,i+=1),o+=1}return r}function Ye(e,t){if(t.length===0)return"";let n="",r="",o=0;for(let i=0;i<e.format.length;i+=1)if(!Kt(e.format[i]))r+=e.format[i];else if(o<t.length)n+=r+t[o],r="",o+=1;else return n;return n+r}function Ql(e,t){let n="",r=0;for(let o=0;o<e.format.length;o+=1)Kt(e.format[o])&&r<t.length?(n+=t[r],r+=1):n+=e.guide[o]??"";return n}function Bn(e,t){let n="";for(const r of e.fillIndexes){const o=t[r];if(o===void 0||!rr(e.format[r],o))break;n+=o}return n}function ec(e,t,n){const r=Math.max(0,Math.min(n,t.length));let o=0;for(const i of e.fillIndexes){if(i>=r)break;const s=t[i];if(s===void 0||!rr(e.format[i],s))break;o+=1}return o}function an(e,t,n){if(e.capacity===0)return Math.min(e.format.length,t.length);const r=Math.max(0,Math.min(n,e.capacity));if(r===0)return Math.min(e.fillIndexes[0],t.length);let o=e.fillIndexes[r-1]+1;for(;o<e.format.length&&!Kt(e.format[o]);)o+=1;return Math.min(o,t.length)}const tc={spellcheck:!1,autocorrect:"off",autocapitalize:"off",canonical:"as-typed"};function nc(e){switch(e){case"tel":return{inputmode:"tel",autocomplete:"tel",spellcheck:!1,autocorrect:"off",autocapitalize:"off",defaultFormat:"###-###-####",canonical:"digits"};case"ssn":return{inputmode:"numeric",autocomplete:"off",spellcheck:!1,autocorrect:"off",autocapitalize:"off",defaultFormat:"###-##-####",canonical:"digits"};case"credit-card":return{inputmode:"numeric",autocomplete:"cc-number",spellcheck:!1,autocorrect:"off",autocapitalize:"off",defaultFormat:"#### #### #### ####",canonical:"digits"};case"custom":return{spellcheck:!1,autocorrect:"off",autocapitalize:"off",canonical:"formatted"};default:return console.warn(`fieldSemantics: unrecognized semantic type ${JSON.stringify(e)}; falling back to unmasked text`),tc}}function jr(e,t,n){const r=Bn(e,t);return r.length===0?"":n==="custom"?Ye(e,r):r}const rc=200,oc="•",ic=new Set(["insertText","insertFromPaste","insertFromPasteAsQuotation","insertFromDrop","insertReplacementText","insertFromYank","insertTranspose"]),sc=new Set(["deleteContent","deleteContentBackward","deleteContentForward","deleteWordBackward","deleteWordForward","deleteSoftLineBackward","deleteSoftLineForward","deleteHardLineBackward","deleteHardLineForward","deleteByDrag"]),ac=new Set(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown"]);function lc(e,t){let n={...t},r=Ln(n.format,n.guide),o=n.guide!==void 0,i=n.caseMode??"preserve",s=n.semantic??"custom",a=n.obscure??!1,l="",u=r,d="";const c=[],f=[];let p=!1,$=!1,v=!1,b=!1,y=null;const S=k=>o?Ql(r,k):Ye(r,k),x=k=>Math.min(ec(r,l,k),d.length);function P(){const k=e.selectionStart??l.length,E=e.selectionEnd??l.length;return[x(k),x(Math.max(k,E))]}function C(k,E){v=!0;try{e.setSelectionRange(k,E)}catch{}finally{v=!1}}function A(k,E){var T;(T=n.onReject)==null||T.call(n,{reason:k,data:E})}function j(k,E,T){var te;T.undo!=="none"&&((T.undo==="break"||!p)&&(c.push({formatted:l,pattern:u,selStart:e.selectionStart??l.length,selEnd:e.selectionEnd??l.length}),c.length>rc&&c.shift()),p=T.undo==="run",f.length=0),l=k,u=r,d=T.raw,e.value=k;const J=Math.max(0,Math.min(E,k.length)),q=Math.max(J,Math.min(T.selectionEnd??E,k.length));C(J,q),T.notify!==!1&&((te=n.onInput)==null||te.call(n,{canonical:vt(),formatted:l}))}function _(k,E,T){const J=S(k);j(J,an(r,J,E),{...T,raw:k})}function Q(k){try{return Ln(r.format+"@".repeat(k))}catch{return null}}function M(k,E,T,J){const q=r.capacity-(d.length-(E-k));if(T.length>0&&q<=0)return A("full",T),!1;const te=d.slice(0,k),Ce=Ye(r,te),it=at(r,Ce+T,i),Ot=it.slice(te.length),gr=d.slice(E),Pn=at(r,Ye(r,it)+gr,i);if(T.length>0&&Ot.length===0)return A("wrong-class",T),!1;if(Pn===d)return!1;_(Pn,te.length+Ot.length,{undo:J==="insert"?"run":"break",notify:!0});const Ni=Pn.length<it.length+gr.length,Li=it.length===r.capacity&&Ot.length<T.length&&L(Ce,T,it.length);return(Ni||Li)&&A("over-capacity",T),!0}function L(k,E,T){const J=Q(E.length);return J===null?!1:at(J,k+E,i).length>T}function V(){const k=e.value,E=Math.min(k.length,l.length);let T=0;for(;T<E&&k[T]===l[T];)T+=1;let J=0;for(;J<E-T&&k[k.length-1-J]===l[l.length-1-J];)J+=1;const q=k.slice(T,k.length-J),te=x(T),Ce=Math.max(te,x(l.length-J));M(te,Ce,q,"bulk"),e.value!==l&&j(l,an(r,l,d.length),{undo:"none",raw:d,notify:!1})}function he(){return{formatted:l,pattern:u,selStart:e.selectionStart??l.length,selEnd:e.selectionEnd??l.length}}function R(k){if(p=!1,k.pattern===r){j(k.formatted,k.selStart,{undo:"none",selectionEnd:k.selEnd,raw:Bn(r,k.formatted),notify:!0});return}const E=Bn(k.pattern,k.formatted),T=at(r,Ye(k.pattern,E),i);_(T,T.length,{undo:"none",notify:!0})}function U(){const k=c.pop();k!==void 0&&(f.push(he()),R(k))}function G(){const k=f.pop();k!==void 0&&(c.push(he()),R(k))}function de(k){const E=k.split("");for(let T=0;T<r.fillIndexes.length&&T<d.length;T+=1){const J=r.fillIndexes[T];r.format[J]==="*"&&J<E.length&&(E[J]=oc)}return E.join("")}function ae(){const k=e.selectionStart??0,E=e.selectionEnd??0;switch(ye()){case"blocked":return"";case"formatted":return l.slice(k,E);case"obscured":return de(l).slice(k,E);case"canonical":default:{const[T,J]=P();return T===0&&J===d.length?jr(r,Ye(r,d),s):d.slice(T,J)}}}function ye(){return n.copyPolicy??(a?"obscured":"canonical")}function Z(k){var J;if(b||$)return;const E=k;if(!E.cancelable)return;const T=E.inputType;if(ic.has(T)){E.preventDefault();const q=E.data??((J=E.dataTransfer)==null?void 0:J.getData("text/plain"))??"",[te,Ce]=P();M(te,Ce,q,T==="insertText"?"insert":"bulk");return}if(sc.has(T)){E.preventDefault();let[q,te]=P();if(q===te){if((e.selectionStart??0)!==(e.selectionEnd??0))return;const Ce=T.endsWith("Backward");if(/^delete(Word|SoftLine|HardLine)/.test(T))Ce?q=0:te=d.length;else if(Ce){if(q===0)return;q-=1}else{if(te>=d.length)return;te+=1}}M(q,te,"","bulk");return}if(T==="historyUndo"){E.preventDefault(),U();return}T==="historyRedo"&&(E.preventDefault(),G())}function rt(){b||$||e.value!==l&&V()}function qt(){b||($=!0)}function Yt(){if(b)return;$=!1;const k=y;if(y=null,k!==null){k();return}e.value!==l&&V()}function ht(k){if($){y=k;return}k()}function we(k){if(b||$)return;const E=k,T=E.ctrlKey||E.metaKey,J=E.key.toLowerCase();if(T&&J==="z"){E.preventDefault(),E.shiftKey?G():U();return}if(T&&J==="y"){E.preventDefault(),G();return}ac.has(E.key)&&(p=!1)}function ke(){p=!1}function pt(){p=!1}function Xt(){return[an(r,l,0),an(r,l,d.length)]}function pe(){return e.getRootNode().activeElement===e}function Ke(){if(b||$||v||!pe())return;const k=e.selectionStart,E=e.selectionEnd;if(k===null||E===null)return;const[T,J]=Xt();let q=k,te=E;k===E?q=te=Math.max(T,Math.min(k,J)):(te=Math.min(E,J),q=Math.min(Math.max(k,T),te)),!(q===k&&te===E)&&C(q,te)}function mt(k){var T;if(b)return;const E=k;E.preventDefault(),(T=E.clipboardData)==null||T.setData("text/plain",ae())}function gt(k){var q;if(b)return;const E=k;E.preventDefault(),(q=E.clipboardData)==null||q.setData("text/plain",ae());const[T,J]=P();T!==J&&(p=!1,M(T,J,"","bulk"))}function vt(){return jr(r,Ye(r,d),s)}const ot=[["beforeinput",Z],["input",rt],["compositionstart",qt],["compositionend",Yt],["keydown",we],["mousedown",ke],["keyup",Ke],["mouseup",Ke],["focus",Ke],["blur",pt],["copy",mt],["cut",gt]],mr=e.ownerDocument;for(const[k,E]of ot)e.addEventListener(k,E);mr.addEventListener("selectionchange",Ke);{const k=at(r,n.initialValue??e.value,i);_(k,k.length,{undo:"none",notify:!1})}return{setValue(k){ht(()=>{const E=at(r,k,i);_(E,E.length,{undo:"break",notify:!1})})},getRawValue:()=>d,getCanonicalValue:vt,getFormattedValue:()=>l,setObscure(k){a=k},update(k){const E=Ye(r,d),T=d,J=l,q={...n,...k},te=Ln(q.format,q.guide);n=q,r=te,o=q.guide!==void 0,i=q.caseMode??"preserve",s=q.semantic??"custom",a=q.obscure??!1,p=!1,f.length=0,ht(()=>{const Ce=at(r,E,i),Ot=S(Ce)!==J;Ce.length<T.length&&A("format-change-clipped",E),_(Ce,Ce.length,{undo:"none",notify:Ot})})},detach(){if(!b){b=!0,y=null;for(const[k,E]of ot)e.removeEventListener(k,E);mr.removeEventListener("selectionchange",Ke)}}}}var cc=w("<input>"),uc=w('<label part=label class="text-sm font-medium text-foreground">'),Dr=w('<span class="flex shrink-0 items-center text-muted-foreground">'),dc=w("<div part=field>"),fc=w("<p part=hint>"),hc=w('<div class="flex w-full flex-col gap-1.5">');const Mr="default",Yo="w-full rounded-md border border-input bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50 disabled:pointer-events-none",pc="flex w-full items-center gap-2 rounded-md border border-input bg-background px-3 py-2 text-sm focus-within:outline-none focus-within:ring-2 focus-within:ring-ring",mc="min-w-0 flex-1 bg-transparent text-sm text-foreground placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed",Ur="px-2.5 py-1",Xo="border-destructive dark:border-red-400/70",Fr=Xo,gc="[&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none [&::-webkit-search-cancel-button]:hidden";function xe(e){const[t,n]=We(e,["class","label","hint","error","size","invalid","leading","trailing","onValueInput","onValueChange","onBlur","id","disabled","format","guide","semantic","caseMode","copyPolicy","onMaskReject"]),r=t.id??Re(),o=`${r}-hint`,i=()=>!!t.invalid||!!t.error,s=()=>!!t.error||!!t.hint,a=()=>t.leading!=null||t.trailing!=null,l=()=>t.semantic===void 0?void 0:nc(t.semantic),u=new Set,d=(R,U)=>{u.has(R)||(u.add(R),console.warn(U))},c=R=>R.length<=32?R:`${R.slice(0,32)}… (${R.length} chars)`,f=()=>{var G;const R=t.format;if(R===void 0||R==="")return;if(R!==Mr)return R;const U=(G=l())==null?void 0:G.defaultFormat;return U===void 0&&d(`default:${String(t.semantic)}`,`Input: format=${Mr} resolves the default format of a semantic type, and semantic=${JSON.stringify(t.semantic)} has none. Rendering unmasked.`),U};let p,$,v,b;const y=()=>{v==null||v.detach(),v=void 0,b=void 0},S=(R,U,G)=>{const de=U instanceof Error?U.message:String(U);d(`format:${R}`,`Input: format ${JSON.stringify(c(R))} did not compile (${de}); `+(G?"the field keeps its previous format.":"rendering unmasked."))};He(()=>{const R=f(),U={guide:t.guide,semantic:t.semantic,caseMode:t.caseMode,copyPolicy:t.copyPolicy},G=a()?$:p;Ie(()=>{if(R===void 0||G===void 0){y();return}if(v!==void 0&&b===G){try{v.update({format:R,...U})}catch(ae){S(R,ae,!0)}return}const de=(v==null?void 0:v.getFormattedValue())??G.value;y();try{v=lc(G,{...U,format:R,initialValue:de,onInput:({canonical:ae})=>{var ye;return(ye=t.onValueInput)==null?void 0:ye.call(t,ae)},onReject:ae=>{var ye;return(ye=t.onMaskReject)==null?void 0:ye.call(t,ae)}}),b=G}catch(ae){S(R,ae,!1)}})}),lt(y);const x=()=>{var R;return n.inputmode??((R=l())==null?void 0:R.inputmode)},P=()=>{var R;return n.autocomplete??((R=l())==null?void 0:R.autocomplete)},C=()=>{const R=n.spellcheck;if(R!==void 0)return R===!0||R==="true"?"true":"false";const U=l();if(U!==void 0)return U.spellcheck?"true":"false"},A=()=>{var R;return n.autocorrect??((R=l())==null?void 0:R.autocorrect)},j=()=>{var R;return n.autocapitalize??((R=l())==null?void 0:R.autocapitalize)},_=(R,U,G)=>(()=>{var de=cc(),ae=G;return typeof ae=="function"?ct(ae,de):G=de,Qe(de,be(n,{id:r,part:U,get disabled(){return t.disabled},get"aria-invalid"(){return i()?"true":void 0},get"aria-describedby"(){return s()?o:void 0},get inputmode(){return x()},get autocomplete(){return P()},get spellcheck(){return C()},get autocorrect(){return A()},get autocapitalize(){return j()},get class(){return ie(gc,R())},onInput:ye=>{var Z;v===void 0&&((Z=t.onValueInput)==null||Z.call(t,ye.currentTarget.value))},onBlur:ye=>{var rt;const Z=t.onBlur;typeof Z=="function"&&Z(ye),(rt=t.onValueChange)==null||rt.call(t,(v==null?void 0:v.getCanonicalValue())??ye.currentTarget.value)}}),!1,!1),de})(),Q=()=>ie(Yo,t.size==="sm"&&Ur,i()&&Fr,t.class);let M;const L=()=>M??(M=_(Q,"field input",R=>p=R));let V;const he=()=>V??(V=_(()=>mc,"input",R=>$=R));return(()=>{var R=hc();return m(R,h(B,{get when(){return t.label},get children(){var U=uc();return N(U,"for",r),m(U,()=>t.label),U}}),null),m(R,h(B,{get when(){return a()},get fallback(){return L()},get children(){var U=dc();return m(U,h(B,{get when(){return t.leading},get children(){var G=Dr();return m(G,()=>t.leading),G}}),null),m(U,he,null),m(U,h(B,{get when(){return t.trailing},get children(){var G=Dr();return m(G,()=>t.trailing),G}}),null),F(()=>Oe(U,ie(pc,t.size==="sm"&&Ur,i()&&Fr,t.disabled&&"opacity-50 pointer-events-none",t.class))),U}}),null),m(R,h(B,{get when(){return s()},get children(){var U=fc();return N(U,"id",o),m(U,()=>t.error??t.hint),F(()=>Oe(U,ie("text-xs",t.error?"text-destructive":"text-muted-foreground"))),U}}),null),R})()}var vc=w("<option value disabled>"),bc=w("<div><select>"),yc=w("<option>");function Ft(e){const[t,n]=We(e,["class","containerClass","options","value","placeholder","invalid","children","ref"]),r=()=>!!n.multiple,o=s=>{const a=t.value;return Array.isArray(a)?a.includes(s):a===s},i=()=>{const s=t.value;return Array.isArray(s)?s.length===0:s==null||s===""};return(()=>{var s=bc(),a=s.firstChild;return ct(l=>{const u=t.ref;typeof u=="function"&&u(l),He(()=>{if(t.children===void 0)return;const d=t.value;if(d!=null)if(Array.isArray(d)){const c=new Set(d.map(String));for(const f of l.options)f.selected=c.has(f.value)}else l.value=String(d)})},a),Qe(a,be(n,{get class(){return ie(Yo,"peer",!r()&&"cursor-pointer appearance-none pr-9",t.invalid&&Xo,t.class)}}),!1,!0),m(a,h(B,{get when(){return t.placeholder!==void 0},get children(){var l=vc();return m(l,()=>t.placeholder),F(()=>l.selected=i()),l}}),null),m(a,h($e,{get each(){return t.options},children:l=>(()=>{var u=yc();return m(u,()=>l.label??String(l.value)),F(d=>{var c=l.disabled,f=o(l.value);return c!==d.e&&(u.disabled=d.e=c),f!==d.t&&(u.selected=d.t=f),d},{e:void 0,t:void 0}),F(()=>u.value=String(l.value)),u})()}),null),m(a,()=>t.children,null),m(s,h(B,{get when(){return!r()},get children(){return h(Wo,{"aria-hidden":"true",class:"pointer-events-none absolute right-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground peer-disabled:opacity-50"})}}),null),F(()=>Oe(s,ie("relative block w-full",t.containerClass))),s})()}var wc=w("<button><span>"),kc=w('<input type=checkbox aria-hidden=true tabindex=-1 style="position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap">');function $t(e){const[t,n]=We(e,["checked","defaultChecked","disabled","label","name","value","onChange","buttonRef","class"]),[r,o]=me(t.defaultChecked??!1),i=()=>t.checked!==void 0,s=()=>i()?!!t.checked:r(),a=()=>{var u;if(t.disabled)return;const l=!s();i()||o(l),(u=t.onChange)==null||u.call(t,l)};return[Me(()=>Me(()=>t.name!=null)()&&(()=>{var l=kc();return l.addEventListener("change",()=>{}),F(u=>{var d=t.name,c=t.disabled;return d!==u.e&&N(l,"name",u.e=d),c!==u.t&&(l.disabled=u.t=c),u},{e:void 0,t:void 0}),F(()=>l.value=t.value??"on"),F(()=>l.checked=s()),l})()),(()=>{var l=wc(),u=l.firstChild,d=t.buttonRef;return typeof d=="function"?ct(d,l):t.buttonRef=l,Qe(l,be(n,{type:"button",role:"switch",get"aria-checked"(){return s()},get"aria-label"(){return t.label},get disabled(){return t.disabled},onClick:a,onKeyDown:c=>{(c.key===" "||c.key==="Enter")&&(c.preventDefault(),a())},get class(){return ie("relative inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background","disabled:cursor-not-allowed disabled:opacity-50",s()?"border-transparent bg-primary":"border-input bg-muted",t.class)}}),!1,!0),F(()=>Oe(u,ie("inline-block h-4 w-4 rounded-full shadow transition-transform",s()?"translate-x-4 bg-primary-foreground":"translate-x-0.5 bg-white"))),l})()]}const Vr=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Br=To,Qo=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Br(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(u=>{const d=n==null?void 0:n[u],c=i==null?void 0:i[u];if(d===null)return null;const f=Vr(d)||Vr(c);return o[u][f]}),a=n&&Object.entries(n).reduce((u,d)=>{let[c,f]=d;return f===void 0||(u[c]=f),u},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:c,className:f,...p}=d;return Object.entries(p).every($=>{let[v,b]=$;return Array.isArray(b)?b.includes({...i,...a}[v]):{...i,...a}[v]===b})?[...u,c,f]:u},[]);return Br(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)};var xc=w("<button>");const _c={default:"bg-primary text-primary-foreground hover:bg-primary/90",ghost:"hover:bg-muted text-foreground",subtle:"text-muted-foreground hover:bg-accent hover:text-foreground",outline:"bg-muted/50 text-foreground hover:bg-muted",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90"},$c=Qo("inline-flex items-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50",{variants:{variant:_c,size:{sm:"h-8 px-3 text-xs rounded-md",md:"h-9 px-4 text-sm",lg:"h-10 px-6 text-sm",icon:"h-9 w-9","icon-sm":"h-7 w-7"},align:{start:"justify-start",center:"justify-center",end:"justify-end"}},defaultVariants:{variant:"default",size:"md",align:"center"}});function Ee(e){const[t,n]=We(e,["variant","size","align","full","class","children"]);return(()=>{var r=xc();return Qe(r,be({get class(){return ie($c({variant:t.variant,size:t.size,align:t.align}),t.full&&"w-full",t.class)}},n),!1,!0),m(r,()=>t.children),r})()}var Sc=w("<div><label><input type=color class=sr-only>");const zc=/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/;function Cc(e){return zc.test(e.trim())}function Ac(e){const t=e==null?void 0:e.trim();if(t===void 0)return"#000000";if(/^#[0-9a-fA-F]{6}$/.test(t))return t.toLowerCase();if(/^#[0-9a-fA-F]{3}$/.test(t)){const[n,r,o]=t.slice(1).split("");return`#${n}${n}${r}${r}${o}${o}`.toLowerCase()}return"#000000"}function ei(e){const[t,n]=me(e.value??"");He(Yn(()=>e.value,o=>n(o??""),{defer:!0}));const r=o=>{const i=o.trim();Cc(i)&&e.onChange(i)};return(()=>{var o=Sc(),i=o.firstChild,s=i.firstChild;return s.$$input=a=>e.onChange(a.currentTarget.value),m(o,h(xe,{size:"sm",class:"flex-1",get value(){return t()},get placeholder(){return e.placeholder},get disabled(){return e.disabled},get"aria-label"(){return`${e.label} hex value`},onValueInput:n,onValueChange:r}),null),F(a=>{var l=ie("flex items-center gap-2",e.class),u=ie("relative inline-flex size-7 shrink-0 items-center justify-center rounded-md border border-border",e.disabled?"cursor-not-allowed opacity-50":"cursor-pointer","has-[:focus-visible]:outline-none has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-ring has-[:focus-visible]:ring-offset-2 has-[:focus-visible]:ring-offset-background"),d=e.value||"var(--color-muted)",c=e.disabled,f=e.label;return l!==a.e&&Oe(o,a.e=l),u!==a.t&&Oe(i,a.t=u),d!==a.a&&bs(i,"background",a.a=d),c!==a.o&&(s.disabled=a.o=c),f!==a.i&&N(s,"aria-label",a.i=f),a},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),F(()=>s.value=Ac(e.value)),o})()}At(["input"]);const ti=["default","ghost","subtle","outline","destructive"];function Ec(e){const t=getComputedStyle(e);let n=parseFloat(t.lineHeight);Number.isNaN(n)&&(n=(parseFloat(t.fontSize)||14)*1.2);const r=(parseFloat(t.paddingTop)||0)+(parseFloat(t.paddingBottom)||0),o=(parseFloat(t.borderTopWidth)||0)+(parseFloat(t.borderBottomWidth)||0);return n+r+o}function Ic(e={}){let t,n;function r(){if(!t||t.offsetParent===null)return;t.style.height="auto";const i=t.scrollHeight,s=e.minHeight??Ec(t),a=Math.max(i,s);e.maxHeight&&a>e.maxHeight?(t.style.height=`${e.maxHeight}px`,t.style.overflowY="auto"):(t.style.height=`${a}px`,t.style.overflowY="hidden")}function o(i){t=i,i.addEventListener("input",r),requestAnimationFrame(r),typeof ResizeObserver<"u"&&(n=new ResizeObserver(()=>r()),n.observe(i)),lt(()=>{i.removeEventListener("input",r),n==null||n.disconnect()})}return{ref:o,resize:r}}var Oc=w("<textarea rows=1>");function Tc(e){const[t,n]=We(e,["class","maxHeight","minHeight","autoResize","value"]),{ref:r,resize:o}=Ic({maxHeight:t.maxHeight,minHeight:t.minHeight});return He(Yn(()=>t.value,()=>o(),{defer:!0})),(()=>{var i=Oc(),s=t.autoResize!==!1?r:void 0;return typeof s=="function"&&ct(s,i),Qe(i,be({get class(){return ie("w-full resize-none rounded-md bg-transparent text-sm text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",t.class)},get value(){return t.value}},n),!1,!1),i})()}var Pc=w("<button>");const Rc=Qo("inline-flex items-center justify-center gap-1 whitespace-nowrap rounded-full font-medium leading-none transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50",{variants:{pressed:{true:"bg-primary text-primary-foreground hover:bg-primary/90",false:"bg-muted/60 text-foreground hover:bg-muted"},size:{sm:"h-7 px-3 text-xs",md:"h-8 px-3.5 text-sm"}},defaultVariants:{pressed:!1,size:"sm"}});function Zc(e){const[t,n]=We(e,["pressed","defaultPressed","disabled","size","onChange","class","children"]),[r,o]=me(t.defaultPressed??!1),i=()=>t.pressed!==void 0,s=()=>i()?!!t.pressed:r(),a=()=>{var u;if(t.disabled)return;const l=!s();i()||o(l),(u=t.onChange)==null||u.call(t,l)};return(()=>{var l=Pc();return Qe(l,be(n,{type:"button",get"aria-pressed"(){return s()},get disabled(){return t.disabled},onClick:a,onKeyDown:u=>{(u.key===" "||u.key==="Enter")&&(u.preventDefault(),a())},get class(){return ie(Rc({pressed:s(),size:t.size}),t.class)}}),!1,!0),m(l,()=>t.children),l})()}var Nc=w('<p class="text-xs text-muted-foreground">'),Lc=w('<div class="flex flex-col gap-1.5"><label class="text-xs font-medium text-foreground">'),jc=w('<div class="flex items-center justify-between gap-3"><span>'),Dc=w('<div class="flex flex-wrap gap-1.5">'),Mc=w('<div class="flex flex-col gap-2"role=group><div class="flex items-center gap-2">'),Uc=w('<span class="inline-flex items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-xs text-foreground">'),Fc=w('<div class="flex flex-col gap-2"data-builder-accept-editor><div class="flex flex-wrap gap-1.5"role=group aria-label="Common file types"></div><details class=group><summary class="cursor-pointer text-xs font-medium text-muted-foreground hover:text-foreground">Advanced: exact MIME types</summary><div class="mt-2 flex flex-col gap-1.5"><p class="text-xs text-muted-foreground">One media type or glob per line — a chip above stays lit only while all of its patterns are here.'),Vc=w('<div class="flex flex-col gap-2"data-builder-links>'),Bc=w('<div class="flex flex-col gap-2 rounded-lg border border-border/70 bg-surface p-2.5"><div class="flex items-center justify-between"><span class="text-[11px] font-medium text-muted-foreground">Link ');const Gn=[{id:"images",label:"Images",patterns:["image/*"]},{id:"pdfs",label:"PDFs",patterns:["application/pdf"]},{id:"documents",label:"Documents",patterns:["application/vnd.openxmlformats-officedocument.wordprocessingml.document","text/plain","text/markdown"]},{id:"spreadsheets",label:"Spreadsheets",patterns:["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","text/csv"]},{id:"audio",label:"Audio",patterns:["audio/*"]},{id:"video",label:"Video",patterns:["video/*"]}];var wo,ko;[...((wo=Gn.find(e=>e.id==="images"))==null?void 0:wo.patterns)??[],...((ko=Gn.find(e=>e.id==="pdfs"))==null?void 0:ko.patterns)??[]];function or(e){return(()=>{var t=Lc(),n=t.firstChild;return m(n,()=>e.label),m(t,()=>e.children,null),m(t,h(B,{get when(){return e.hint},get children(){var r=Nc();return m(r,()=>e.hint),r}}),null),t})()}function Vt(e){return(()=>{var t=jc(),n=t.firstChild;return m(n,()=>e.label),m(t,()=>e.children,null),F(()=>Oe(n,ie("text-xs font-medium",e.muted?"text-muted-foreground":"text-foreground"))),t})()}function Gc(e){const[t,n]=me(""),r=()=>{const i=t().trim();i&&(e.onChange([...e.tags,i]),n(""))},o=i=>e.onChange(e.tags.filter((s,a)=>a!==i));return(()=>{var i=Mc(),s=i.firstChild;return m(i,h(B,{get when(){return e.tags.length>0},get children(){var a=Dc();return m(a,h($e,{get each(){return e.tags},children:(l,u)=>(()=>{var d=Uc();return m(d,l,null),m(d,h(Ee,{type:"button",variant:"ghost",size:"icon-sm",class:"size-4 rounded-full p-0 text-muted-foreground hover:bg-transparent hover:text-foreground","aria-label":`Remove ${l}`,onClick:()=>o(u()),get children(){return h(Wt,{size:12,"aria-hidden":"true"})}}),null),d})()})),a}}),s),m(s,h(xe,{"data-control":!0,size:"sm",type:"text",get value(){return t()},get placeholder(){return e.placeholder??"Add…"},get"aria-label"(){return e.ariaLabel},onValueInput:n,onKeyDown:a=>{a.key==="Enter"&&(a.preventDefault(),r())}}),null),m(s,h(Ee,{type:"button",variant:"outline",size:"sm",onClick:r,children:"Add"}),null),F(()=>N(i,"aria-label",e.ariaLabel)),i})()}function Hc(e){const t=s=>s.patterns.every(a=>e.accept.includes(a)),n=s=>{if(t(s)){e.onChange(e.accept.filter(l=>!s.patterns.includes(l)));return}const a=e.accept.slice();for(const l of s.patterns)a.includes(l)||a.push(l);e.onChange(a)},[r,o]=me(e.accept.join(`
7
+ `));He(Yn(()=>e.accept,s=>o(s.join(`
8
+ `)),{defer:!0}));const i=s=>{e.onChange(s.split(/[\n,]/).map(a=>a.trim()).filter(Boolean))};return(()=>{var s=Fc(),a=s.firstChild,l=a.nextSibling,u=l.firstChild,d=u.nextSibling,c=d.firstChild;return m(a,h($e,{each:Gn,children:f=>h(Zc,{get pressed(){return t(f)},onChange:()=>n(f),get children(){return f.label}})})),m(d,h(Tc,{"data-builder-accept-raw":!0,class:"rounded-md border border-input bg-background px-2.5 py-1.5 text-xs text-foreground",maxHeight:160,minHeight:46,get value(){return r()},placeholder:`image/*
9
+ application/pdf`,"aria-label":"Exact MIME types, one per line",onInput:f=>o(f.currentTarget.value),onBlur:f=>i(f.currentTarget.value)}),c),s})()}function Wc(e){const t=(o,i)=>{const s=e.links.slice();s[o]={...s[o],...i},e.onChange(s)},n=()=>e.onChange([...e.links,{label:"New link"}]),r=o=>e.onChange(e.links.filter((i,s)=>s!==o));return(()=>{var o=Vc();return m(o,h($e,{get each(){return e.links},children:(i,s)=>(()=>{var a=Bc(),l=a.firstChild,u=l.firstChild;return u.firstChild,m(u,()=>s()+1,null),m(l,h(Ee,{type:"button",variant:"ghost",size:"icon-sm",get"aria-label"(){return`Remove link ${s()+1}`},onClick:()=>r(s()),get children(){return h(Wt,{size:14,"aria-hidden":"true"})}}),null),m(a,h(xe,{size:"sm",get value(){return i.label},placeholder:"Label",get"aria-label"(){return`Link ${s()+1} label`},onValueInput:d=>t(s(),{label:d})}),null),m(a,h(xe,{size:"sm",get value(){return i.href??""},placeholder:"https://…",get"aria-label"(){return`Link ${s()+1} href`},onValueInput:d=>t(s(),{href:d||void 0})}),null),m(a,h(xe,{size:"sm",get value(){return i.description??""},placeholder:"Description",get"aria-label"(){return`Link ${s()+1} description`},onValueInput:d=>t(s(),{description:d||void 0})}),null),a})()}),null),m(o,h(Ee,{type:"button",variant:"outline",size:"sm",onClick:n,children:"Add link"}),null),o})()}var Jc=w('<div class="flex flex-col gap-1"role=group>'),Kc=w('<div class="flex items-center gap-2 rounded-md border border-border/70 bg-surface px-2 py-1.5"><span class="flex-1 truncate text-xs font-medium text-foreground"></span><div class="flex shrink-0 items-center gap-0.5">');const qc=[{id:"edit",label:"Edit",icon:Ta},{id:"copy",label:"Copy",icon:Jo}],Yc=[{id:"copy",label:"Copy",icon:Jo},{id:"like",label:"Like",icon:Ua},{id:"dislike",label:"Dislike",icon:ja},{id:"regenerate",label:"Regenerate",icon:Za},{id:"speak",label:"Read aloud",icon:Ba}];function Xc(e){const t=o=>e.catalog.find(i=>i.id===o),n=(o,i)=>{const s=o+i;if(s<0||s>=e.rows.length)return;const a=e.rows.slice();[a[o],a[s]]=[a[s],a[o]],e.onChange(a)},r=(o,i)=>{const s=e.rows.slice();s[o]={...s[o],enabled:i},e.onChange(s)};return(()=>{var o=Jc();return m(o,h($e,{get each(){return e.rows},children:(i,s)=>{const a=t(i.id),l=a==null?void 0:a.icon,u=(a==null?void 0:a.label)??i.id;return(()=>{var d=Kc(),c=d.firstChild,f=c.nextSibling;return m(d,l?h(l,{class:"size-3.5 shrink-0 text-muted-foreground"}):null,c),m(c,u),m(f,h(Ee,{type:"button",variant:"ghost",size:"icon-sm","aria-label":`Move ${u} up`,get disabled(){return s()===0},onClick:()=>n(s(),-1),get children(){return h(Ca,{size:12,"aria-hidden":"true"})}}),null),m(f,h(Ee,{type:"button",variant:"ghost",size:"icon-sm","aria-label":`Move ${u} down`,get disabled(){return s()===e.rows.length-1},onClick:()=>n(s(),1),get children(){return h(Wo,{size:12,"aria-hidden":"true"})}}),null),m(d,h($t,{get checked(){return i.enabled},label:`Enable ${u}`,onChange:p=>r(s(),p)}),null),d})()}})),F(()=>N(o,"aria-label",e.legend)),o})()}var Gr;function g(e,t,n){function r(a,l){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:l,constr:s,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,l);const u=s.prototype,d=Object.keys(u);for(let c=0;c<d.length;c++){const f=d[c];f in a||(a[f]=u[f].bind(a))}}const o=(n==null?void 0:n.Parent)??Object;class i extends o{}Object.defineProperty(i,"name",{value:e});function s(a){var l;const u=n!=null&&n.Parent?new i:this;r(u,a),(l=u._zod).deferred??(l.deferred=[]);for(const d of u._zod.deferred)d();return u}return Object.defineProperty(s,"init",{value:r}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>{var l,u;return n!=null&&n.Parent&&a instanceof n.Parent?!0:(u=(l=a==null?void 0:a._zod)==null?void 0:l.traits)==null?void 0:u.has(e)}}),Object.defineProperty(s,"name",{value:e}),s}class _t extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class ni extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(Gr=globalThis).__zod_globalConfig??(Gr.__zod_globalConfig={});const ir=globalThis.__zod_globalConfig;function Be(e){return ir}function ri(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,o])=>t.indexOf(+r)===-1).map(([r,o])=>o)}function Hn(e,t){return typeof t=="bigint"?t.toString():t}function An(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function sr(e){return e==null}function ar(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const Hr=Symbol("evaluating");function Y(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Hr)return r===void 0&&(r=Hr,r=n()),r},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function ft(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function tt(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function Wr(e){return JSON.stringify(e)}function Qc(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const oi="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Bt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const eu=An(()=>{var e;if(ir.jitless||typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function St(e){if(Bt(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Bt(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function ii(e){return St(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const tu=new Set(["string","number","symbol"]);function zt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function nt(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n!=null&&n.parent)&&(r._zod.parent=e),r}function D(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function nu(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function ru(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const i=tt(e._zod.def,{get shape(){const s={};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(s[a]=n.shape[a])}return ft(this,"shape",s),s},checks:[]});return nt(e,i)}function ou(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const i=tt(e._zod.def,{get shape(){const s={...e._zod.def.shape};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete s[a]}return ft(this,"shape",s),s},checks:[]});return nt(e,i)}function iu(e,t){if(!St(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const i=e._zod.def.shape;for(const s in t)if(Object.getOwnPropertyDescriptor(i,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=tt(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return ft(this,"shape",i),i}});return nt(e,o)}function su(e,t){if(!St(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=tt(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return ft(this,"shape",r),r}});return nt(e,n)}function au(e,t){var r;if((r=e._zod.def.checks)!=null&&r.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const n=tt(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t._zod.def.shape};return ft(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return nt(e,n)}function lu(e,t,n){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const s=tt(t._zod.def,{get shape(){const a=t._zod.def.shape,l={...a};if(n)for(const u in n){if(!(u in a))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(l[u]=e?new e({type:"optional",innerType:a[u]}):a[u])}else for(const u in a)l[u]=e?new e({type:"optional",innerType:a[u]}):a[u];return ft(this,"shape",l),l},checks:[]});return nt(t,s)}function cu(e,t,n){const r=tt(t._zod.def,{get shape(){const o=t._zod.def.shape,i={...o};if(n)for(const s in n){if(!(s in i))throw new Error(`Unrecognized key: "${s}"`);n[s]&&(i[s]=new e({type:"nonoptional",innerType:o[s]}))}else for(const s in o)i[s]=new e({type:"nonoptional",innerType:o[s]});return ft(this,"shape",i),i}});return nt(t,r)}function kt(e,t=0){var n;if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(((n=e.issues[r])==null?void 0:n.continue)!==!0)return!0;return!1}function uu(e,t=0){var n;if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(((n=e.issues[r])==null?void 0:n.continue)===!1)return!0;return!1}function xt(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function ln(e){return typeof e=="string"?e:e==null?void 0:e.message}function Ge(e,t,n){var l,u,d,c,f,p;const r=e.message?e.message:ln((d=(u=(l=e.inst)==null?void 0:l._zod.def)==null?void 0:u.error)==null?void 0:d.call(u,e))??ln((c=t==null?void 0:t.error)==null?void 0:c.call(t,e))??ln((f=n.customError)==null?void 0:f.call(n,e))??ln((p=n.localeError)==null?void 0:p.call(n,e))??"Invalid input",{inst:o,continue:i,input:s,...a}=e;return a.path??(a.path=[]),a.message=r,t!=null&&t.reportInput&&(a.input=s),a}function lr(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Gt(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const si=(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,Hn,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ai=g("$ZodError",si),li=g("$ZodError",si,{Parent:Error});function du(e,t=n=>n.message){const n={},r=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}function fu(e,t=n=>n.message){const n={_errors:[]},r=(o,i=[])=>{for(const s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>r({issues:a},[...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{const a=[...i,...s.path];if(a.length===0)n._errors.push(t(s));else{let l=n,u=0;for(;u<a.length;){const d=a[u];u===a.length-1?(l[d]=l[d]||{_errors:[]},l[d]._errors.push(t(s))):l[d]=l[d]||{_errors:[]},l=l[d],u++}}}};return r(e),n}const cr=e=>(t,n,r,o)=>{const i=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new _t;if(s.issues.length){const a=new((o==null?void 0:o.Err)??e)(s.issues.map(l=>Ge(l,i,Be())));throw oi(a,o==null?void 0:o.callee),a}return s.value},ur=e=>async(t,n,r,o)=>{const i=r?{...r,async:!0}:{async:!0};let s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){const a=new((o==null?void 0:o.Err)??e)(s.issues.map(l=>Ge(l,i,Be())));throw oi(a,o==null?void 0:o.callee),a}return s.value},En=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise)throw new _t;return i.issues.length?{success:!1,error:new(e??ai)(i.issues.map(s=>Ge(s,o,Be())))}:{success:!0,data:i.value}},hu=En(li),In=e=>async(t,n,r)=>{const o=r?{...r,async:!0}:{async:!0};let i=t._zod.run({value:n,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(s=>Ge(s,o,Be())))}:{success:!0,data:i.value}},pu=In(li),mu=e=>(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return cr(e)(t,n,o)},gu=e=>(t,n,r)=>cr(e)(t,n,r),vu=e=>async(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return ur(e)(t,n,o)},bu=e=>async(t,n,r)=>ur(e)(t,n,r),yu=e=>(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return En(e)(t,n,o)},wu=e=>(t,n,r)=>En(e)(t,n,r),ku=e=>async(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return In(e)(t,n,o)},xu=e=>async(t,n,r)=>In(e)(t,n,r),_u=/^[cC][0-9a-z]{6,}$/,$u=/^[0-9a-z]+$/,Su=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,zu=/^[0-9a-vA-V]{20}$/,Cu=/^[A-Za-z0-9]{27}$/,Au=/^[a-zA-Z0-9_-]{21}$/,Eu=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Iu=/^([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})$/,Jr=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Ou=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Tu="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Pu(){return new RegExp(Tu,"u")}const Ru=/^(?:(?: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])$/,Zu=/^(([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}|:))$/,Nu=/^((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])$/,Lu=/^(([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])$/,ju=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ci=/^[A-Za-z0-9_-]*$/,Du=/^https?$/,Mu=/^\+[1-9]\d{6,14}$/,ui="(?:(?:\\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])))",Uu=new RegExp(`^${ui}$`);function di(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Fu(e){return new RegExp(`^${di(e)}$`)}function Vu(e){const t=di({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${ui}T(?:${r})$`)}const Bu=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Gu=/^-?\d+(?:\.\d+)?$/,Hu=/^(?:true|false)$/i,Wu=/^[^A-Z]*$/,Ju=/^[^a-z]*$/,Ue=g("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Ku=g("$ZodCheckMaxLength",(e,t)=>{var n;Ue.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!sr(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const o=r.value;if(o.length<=t.maximum)return;const s=lr(o);r.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),qu=g("$ZodCheckMinLength",(e,t)=>{var n;Ue.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!sr(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const o=r.value;if(o.length>=t.minimum)return;const s=lr(o);r.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Yu=g("$ZodCheckLengthEquals",(e,t)=>{var n;Ue.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!sr(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=r=>{const o=r.value,i=o.length;if(i===t.length)return;const s=lr(o),a=i>t.length;r.issues.push({origin:s,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),On=g("$ZodCheckStringFormat",(e,t)=>{var n,r;Ue.init(e,t),e._zod.onattach.push(o=>{const i=o._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Xu=g("$ZodCheckRegex",(e,t)=>{On.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})}}),Qu=g("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Wu),On.init(e,t)}),ed=g("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Ju),On.init(e,t)}),td=g("$ZodCheckIncludes",(e,t)=>{Ue.init(e,t);const n=zt(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(o=>{const i=o._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),nd=g("$ZodCheckStartsWith",(e,t)=>{Ue.init(e,t);const n=new RegExp(`^${zt(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),rd=g("$ZodCheckEndsWith",(e,t)=>{Ue.init(e,t);const n=new RegExp(`.*${zt(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),od=g("$ZodCheckOverwrite",(e,t)=>{Ue.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class id{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
10
+ `).filter(s=>s),o=Math.min(...r.map(s=>s.length-s.trimStart().length)),i=r.map(s=>s.slice(o)).map(s=>" ".repeat(this.indent*2)+s);for(const s of i)this.content.push(s)}compile(){const t=Function,n=this==null?void 0:this.args,o=[...((this==null?void 0:this.content)??[""]).map(i=>` ${i}`)];return new t(...n,o.join(`
11
+ `))}}const sd={major:4,minor:4,patch:3},ce=g("$ZodType",(e,t)=>{var o;var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=sd;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const i of r)for(const s of i._zod.onattach)s(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),(o=e._zod.deferred)==null||o.push(()=>{e._zod.run=e._zod.parse});else{const i=(a,l,u)=>{let d=kt(a),c;for(const f of l){if(f._zod.def.when){if(uu(a)||!f._zod.def.when(a))continue}else if(d)continue;const p=a.issues.length,$=f._zod.check(a);if($ instanceof Promise&&(u==null?void 0:u.async)===!1)throw new _t;if(c||$ instanceof Promise)c=(c??Promise.resolve()).then(async()=>{await $,a.issues.length!==p&&(d||(d=kt(a,p)))});else{if(a.issues.length===p)continue;d||(d=kt(a,p))}}return c?c.then(()=>a):a},s=(a,l,u)=>{if(kt(a))return a.aborted=!0,a;const d=i(l,r,u);if(d instanceof Promise){if(u.async===!1)throw new _t;return d.then(c=>e._zod.parse(c,u))}return e._zod.parse(d,u)};e._zod.run=(a,l)=>{if(l.skipChecks)return e._zod.parse(a,l);if(l.direction==="backward"){const d=e._zod.parse({value:a.value,issues:[]},{...l,skipChecks:!0});return d instanceof Promise?d.then(c=>s(c,a,l)):s(d,a,l)}const u=e._zod.parse(a,l);if(u instanceof Promise){if(l.async===!1)throw new _t;return u.then(d=>i(d,r,l))}return i(u,r,l)}}Y(e,"~standard",()=>({validate:i=>{var s;try{const a=hu(e,i);return a.success?{value:a.data}:{issues:(s=a.error)==null?void 0:s.issues}}catch{return pu(e,i).then(l=>{var u;return l.success?{value:l.data}:{issues:(u=l.error)==null?void 0:u.issues}})}},vendor:"zod",version:1}))}),dr=g("$ZodString",(e,t)=>{var n;ce.init(e,t),e._zod.pattern=[...((n=e==null?void 0:e._zod.bag)==null?void 0:n.patterns)??[]].pop()??Bu(e._zod.bag),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),oe=g("$ZodStringFormat",(e,t)=>{On.init(e,t),dr.init(e,t)}),ad=g("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Iu),oe.init(e,t)}),ld=g("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Jr(r))}else t.pattern??(t.pattern=Jr());oe.init(e,t)}),cd=g("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Ou),oe.init(e,t)}),ud=g("$ZodURL",(e,t)=>{oe.init(e,t),e._zod.check=n=>{var r;try{const o=n.value.trim();if(!t.normalize&&((r=t.protocol)==null?void 0:r.source)===Du.source&&!/^https?:\/\//i.test(o)){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}const i=new URL(o);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=o;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),dd=g("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Pu()),oe.init(e,t)}),fd=g("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Au),oe.init(e,t)}),hd=g("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=_u),oe.init(e,t)}),pd=g("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=$u),oe.init(e,t)}),md=g("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Su),oe.init(e,t)}),gd=g("$ZodXID",(e,t)=>{t.pattern??(t.pattern=zu),oe.init(e,t)}),vd=g("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Cu),oe.init(e,t)}),bd=g("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Vu(t)),oe.init(e,t)}),yd=g("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Uu),oe.init(e,t)}),wd=g("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Fu(t)),oe.init(e,t)}),kd=g("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Eu),oe.init(e,t)}),xd=g("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Ru),oe.init(e,t),e._zod.bag.format="ipv4"}),_d=g("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Zu),oe.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})}}}),$d=g("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Nu),oe.init(e,t)}),Sd=g("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Lu),oe.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[o,i]=r;if(!i)throw new Error;const s=Number(i);if(`${s}`!==i)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${o}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function fi(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const zd=g("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=ju),oe.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{fi(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function Cd(e){if(!ci.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return fi(n)}const Ad=g("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=ci),oe.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{Cd(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Ed=g("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Mu),oe.init(e,t)});function Id(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const o=JSON.parse(atob(r));return!("typ"in o&&(o==null?void 0:o.typ)!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const Od=g("$ZodJWT",(e,t)=>{oe.init(e,t),e._zod.check=n=>{Id(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Td=g("$ZodBoolean",(e,t)=>{ce.init(e,t),e._zod.pattern=Hu,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const o=n.value;return typeof o=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}}),Pd=g("$ZodUnknown",(e,t)=>{ce.init(e,t),e._zod.parse=n=>n}),Rd=g("$ZodNever",(e,t)=>{ce.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function Kr(e,t,n){e.issues.length&&t.issues.push(...xt(n,e.issues)),t.value[n]=e.value}const Zd=g("$ZodArray",(e,t)=>{ce.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const i=[];for(let s=0;s<o.length;s++){const a=o[s],l=t.element._zod.run({value:a,issues:[]},r);l instanceof Promise?i.push(l.then(u=>Kr(u,n,s))):Kr(l,n,s)}return i.length?Promise.all(i).then(()=>n):n}});function xn(e,t,n,r,o,i){const s=n in r;if(e.issues.length){if(o&&i&&!s)return;t.issues.push(...xt(n,e.issues))}if(!s&&!o){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}e.value===void 0?s&&(t.value[n]=void 0):t.value[n]=e.value}function hi(e){var r,o,i,s;const t=Object.keys(e.shape);for(const a of t)if(!((s=(i=(o=(r=e.shape)==null?void 0:r[a])==null?void 0:o._zod)==null?void 0:i.traits)!=null&&s.has("$ZodType")))throw new Error(`Invalid element at key "${a}": expected a Zod schema`);const n=nu(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function pi(e,t,n,r,o,i){const s=[],a=o.keySet,l=o.catchall._zod,u=l.def.type,d=l.optin==="optional",c=l.optout==="optional";for(const f in t){if(f==="__proto__"||a.has(f))continue;if(u==="never"){s.push(f);continue}const p=l.run({value:t[f],issues:[]},r);p instanceof Promise?e.push(p.then($=>xn($,n,f,t,d,c))):xn(p,n,f,t,d,c)}return s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i}),e.length?Promise.all(e).then(()=>n):n}const Nd=g("$ZodObject",(e,t)=>{ce.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape");if(!(n!=null&&n.get)){const a=t.shape;Object.defineProperty(t,"shape",{get:()=>{const l={...a};return Object.defineProperty(t,"shape",{value:l}),l}})}const r=An(()=>hi(t));Y(e._zod,"propValues",()=>{const a=t.shape,l={};for(const u in a){const d=a[u]._zod;if(d.values){l[u]??(l[u]=new Set);for(const c of d.values)l[u].add(c)}}return l});const o=Bt,i=t.catchall;let s;e._zod.parse=(a,l)=>{s??(s=r.value);const u=a.value;if(!o(u))return a.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),a;a.value={};const d=[],c=s.shape;for(const f of s.keys){const p=c[f],$=p._zod.optin==="optional",v=p._zod.optout==="optional",b=p._zod.run({value:u[f],issues:[]},l);b instanceof Promise?d.push(b.then(y=>xn(y,a,f,u,$,v))):xn(b,a,f,u,$,v)}return i?pi(d,u,a,l,r.value,e):d.length?Promise.all(d).then(()=>a):a}}),Ld=g("$ZodObjectJIT",(e,t)=>{Nd.init(e,t);const n=e._zod.parse,r=An(()=>hi(t)),o=f=>{var x,P;const p=new id(["shape","payload","ctx"]),$=r.value,v=C=>{const A=Wr(C);return`shape[${A}]._zod.run({ value: input[${A}], issues: [] }, ctx)`};p.write("const input = payload.value;");const b=Object.create(null);let y=0;for(const C of $.keys)b[C]=`key_${y++}`;p.write("const newResult = {};");for(const C of $.keys){const A=b[C],j=Wr(C),_=f[C],Q=((x=_==null?void 0:_._zod)==null?void 0:x.optin)==="optional",M=((P=_==null?void 0:_._zod)==null?void 0:P.optout)==="optional";p.write(`const ${A} = ${v(C)};`),Q&&M?p.write(`
12
+ if (${A}.issues.length) {
13
+ if (${j} in input) {
14
+ payload.issues = payload.issues.concat(${A}.issues.map(iss => ({
15
+ ...iss,
16
+ path: iss.path ? [${j}, ...iss.path] : [${j}]
17
+ })));
18
+ }
19
+ }
20
+
21
+ if (${A}.value === undefined) {
22
+ if (${j} in input) {
23
+ newResult[${j}] = undefined;
24
+ }
25
+ } else {
26
+ newResult[${j}] = ${A}.value;
27
+ }
28
+
29
+ `):Q?p.write(`
30
+ if (${A}.issues.length) {
31
+ payload.issues = payload.issues.concat(${A}.issues.map(iss => ({
32
+ ...iss,
33
+ path: iss.path ? [${j}, ...iss.path] : [${j}]
34
+ })));
35
+ }
36
+
37
+ if (${A}.value === undefined) {
38
+ if (${j} in input) {
39
+ newResult[${j}] = undefined;
40
+ }
41
+ } else {
42
+ newResult[${j}] = ${A}.value;
43
+ }
44
+
45
+ `):p.write(`
46
+ const ${A}_present = ${j} in input;
47
+ if (${A}.issues.length) {
48
+ payload.issues = payload.issues.concat(${A}.issues.map(iss => ({
49
+ ...iss,
50
+ path: iss.path ? [${j}, ...iss.path] : [${j}]
51
+ })));
52
+ }
53
+ if (!${A}_present && !${A}.issues.length) {
54
+ payload.issues.push({
55
+ code: "invalid_type",
56
+ expected: "nonoptional",
57
+ input: undefined,
58
+ path: [${j}]
59
+ });
60
+ }
61
+
62
+ if (${A}_present) {
63
+ if (${A}.value === undefined) {
64
+ newResult[${j}] = undefined;
65
+ } else {
66
+ newResult[${j}] = ${A}.value;
67
+ }
68
+ }
69
+
70
+ `)}p.write("payload.value = newResult;"),p.write("return payload;");const S=p.compile();return(C,A)=>S(f,C,A)};let i;const s=Bt,a=!ir.jitless,u=a&&eu.value,d=t.catchall;let c;e._zod.parse=(f,p)=>{c??(c=r.value);const $=f.value;return s($)?a&&u&&(p==null?void 0:p.async)===!1&&p.jitless!==!0?(i||(i=o(t.shape)),f=i(f,p),d?pi([],$,f,p,c,e):f):n(f,p):(f.issues.push({expected:"object",code:"invalid_type",input:$,inst:e}),f)}});function qr(e,t,n,r){for(const i of e)if(i.issues.length===0)return t.value=i.value,t;const o=e.filter(i=>!kt(i));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(i=>i.issues.map(s=>Ge(s,r,Be())))}),t)}const mi=g("$ZodUnion",(e,t)=>{ce.init(e,t),Y(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),Y(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),Y(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),Y(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){const r=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${r.map(o=>ar(o.source)).join("|")})$`)}});const n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,o)=>{if(n)return n(r,o);let i=!1;const s=[];for(const a of t.options){const l=a._zod.run({value:r.value,issues:[]},o);if(l instanceof Promise)s.push(l),i=!0;else{if(l.issues.length===0)return l;s.push(l)}}return i?Promise.all(s).then(a=>qr(a,r,e,o)):qr(s,r,e,o)}}),jd=g("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,mi.init(e,t);const n=e._zod.parse;Y(e._zod,"propValues",()=>{const o={};for(const i of t.options){const s=i._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(const[a,l]of Object.entries(s)){o[a]||(o[a]=new Set);for(const u of l)o[a].add(u)}}return o});const r=An(()=>{var s;const o=t.options,i=new Map;for(const a of o){const l=(s=a._zod.propValues)==null?void 0:s[t.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(const u of l){if(i.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);i.set(u,a)}}return i});e._zod.parse=(o,i)=>{const s=o.value;if(!Bt(s))return o.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),o;const a=r.value.get(s==null?void 0:s[t.discriminator]);return a?a._zod.run(o,i):t.unionFallback||i.direction==="backward"?n(o,i):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(r.value.keys()),input:s,path:[t.discriminator],inst:e}),o)}}),Dd=g("$ZodIntersection",(e,t)=>{ce.init(e,t),e._zod.parse=(n,r)=>{const o=n.value,i=t.left._zod.run({value:o,issues:[]},r),s=t.right._zod.run({value:o,issues:[]},r);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([l,u])=>Yr(n,l,u)):Yr(n,i,s)}});function Wn(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(St(e)&&St(t)){const n=Object.keys(t),r=Object.keys(e).filter(i=>n.indexOf(i)!==-1),o={...e,...t};for(const i of r){const s=Wn(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};o[i]=s.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=e[r],i=t[r],s=Wn(o,i);if(!s.valid)return{valid:!1,mergeErrorPath:[r,...s.mergeErrorPath]};n.push(s.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Yr(e,t,n){const r=new Map;let o;for(const a of t.issues)if(a.code==="unrecognized_keys"){o??(o=a);for(const l of a.keys)r.has(l)||r.set(l,{}),r.get(l).l=!0}else e.issues.push(a);for(const a of n.issues)if(a.code==="unrecognized_keys")for(const l of a.keys)r.has(l)||r.set(l,{}),r.get(l).r=!0;else e.issues.push(a);const i=[...r].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(i.length&&o&&e.issues.push({...o,keys:i}),kt(e))return e;const s=Wn(t.value,n.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}const Md=g("$ZodRecord",(e,t)=>{ce.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!St(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),n;const i=[],s=t.keyType._zod.values;if(s){n.value={};const a=new Set;for(const u of s)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){a.add(typeof u=="number"?u.toString():u);const d=t.keyType._zod.run({value:u,issues:[]},r);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(d.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(p=>Ge(p,r,Be())),input:u,path:[u],inst:e});continue}const c=d.value,f=t.valueType._zod.run({value:o[u],issues:[]},r);f instanceof Promise?i.push(f.then(p=>{p.issues.length&&n.issues.push(...xt(u,p.issues)),n.value[c]=p.value})):(f.issues.length&&n.issues.push(...xt(u,f.issues)),n.value[c]=f.value)}let l;for(const u in o)a.has(u)||(l=l??[],l.push(u));l&&l.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:l})}else{n.value={};for(const a of Reflect.ownKeys(o)){if(a==="__proto__"||!Object.prototype.propertyIsEnumerable.call(o,a))continue;let l=t.keyType._zod.run({value:a,issues:[]},r);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&Gu.test(a)&&l.issues.length){const c=t.keyType._zod.run({value:Number(a),issues:[]},r);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");c.issues.length===0&&(l=c)}if(l.issues.length){t.mode==="loose"?n.value[a]=o[a]:n.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(c=>Ge(c,r,Be())),input:a,path:[a],inst:e});continue}const d=t.valueType._zod.run({value:o[a],issues:[]},r);d instanceof Promise?i.push(d.then(c=>{c.issues.length&&n.issues.push(...xt(a,c.issues)),n.value[l.value]=c.value})):(d.issues.length&&n.issues.push(...xt(a,d.issues)),n.value[l.value]=d.value)}}return i.length?Promise.all(i).then(()=>n):n}}),Ud=g("$ZodEnum",(e,t)=>{ce.init(e,t);const n=ri(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(o=>tu.has(typeof o)).map(o=>typeof o=="string"?zt(o):o.toString()).join("|")})$`),e._zod.parse=(o,i)=>{const s=o.value;return r.has(s)||o.issues.push({code:"invalid_value",values:n,input:s,inst:e}),o}}),Fd=g("$ZodLiteral",(e,t)=>{if(ce.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?zt(r):r?zt(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,o)=>{const i=r.value;return n.has(i)||r.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),r}}),Vd=g("$ZodTransform",(e,t)=>{ce.init(e,t),e._zod.optin="optional",e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new ni(e.constructor.name);const o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(s=>(n.value=s,n.fallback=!0,n));if(o instanceof Promise)throw new _t;return n.value=o,n.fallback=!0,n}});function Xr(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const gi=g("$ZodOptional",(e,t)=>{ce.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",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${ar(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const o=n.value,i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(s=>Xr(s,o)):Xr(i,o)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),Bd=g("$ZodExactOptional",(e,t)=>{gi.init(e,t),Y(e._zod,"values",()=>t.innerType._zod.values),Y(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),Gd=g("$ZodNullable",(e,t)=>{ce.init(e,t),Y(e._zod,"optin",()=>t.innerType._zod.optin),Y(e._zod,"optout",()=>t.innerType._zod.optout),Y(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${ar(n.source)}|null)$`):void 0}),Y(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),Hd=g("$ZodDefault",(e,t)=>{ce.init(e,t),e._zod.optin="optional",Y(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>Qr(i,t)):Qr(o,t)}});function Qr(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Wd=g("$ZodPrefault",(e,t)=>{ce.init(e,t),e._zod.optin="optional",Y(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),Jd=g("$ZodNonOptional",(e,t)=>{ce.init(e,t),Y(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>eo(i,e)):eo(o,e)}});function eo(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Kd=g("$ZodCatch",(e,t)=>{ce.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=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(s=>Ge(s,r,Be()))},input:n.value}),n.issues=[],n.fallback=!0),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(i=>Ge(i,r,Be()))},input:n.value}),n.issues=[],n.fallback=!0),n)}}),qd=g("$ZodPipe",(e,t)=>{ce.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=(n,r)=>{if(r.direction==="backward"){const i=t.out._zod.run(n,r);return i instanceof Promise?i.then(s=>cn(s,t.in,r)):cn(i,t.in,r)}const o=t.in._zod.run(n,r);return o instanceof Promise?o.then(i=>cn(i,t.out,r)):cn(o,t.out,r)}});function cn(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}const Yd=g("$ZodReadonly",(e,t)=>{ce.init(e,t),Y(e._zod,"propValues",()=>t.innerType._zod.propValues),Y(e._zod,"values",()=>t.innerType._zod.values),Y(e._zod,"optin",()=>{var n,r;return(r=(n=t.innerType)==null?void 0:n._zod)==null?void 0:r.optin}),Y(e._zod,"optout",()=>{var n,r;return(r=(n=t.innerType)==null?void 0:n._zod)==null?void 0:r.optout}),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(to):to(o)}});function to(e){return e.value=Object.freeze(e.value),e}const Xd=g("$ZodCustom",(e,t)=>{Ue.init(e,t),ce.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(i=>no(i,n,r,e));no(o,n,r,e)}});function no(e,t,n,r){if(!e){const o={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),t.issues.push(Gt(o))}}var ro;class Qd{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const o={...r,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function ef(){return new Qd}(ro=globalThis).__zod_globalRegistry??(ro.__zod_globalRegistry=ef());const Lt=globalThis.__zod_globalRegistry;function tf(e,t){return new e({type:"string",...D(t)})}function nf(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...D(t)})}function oo(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...D(t)})}function rf(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...D(t)})}function of(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...D(t)})}function sf(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...D(t)})}function af(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...D(t)})}function lf(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...D(t)})}function cf(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...D(t)})}function uf(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...D(t)})}function df(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...D(t)})}function ff(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...D(t)})}function hf(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...D(t)})}function pf(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...D(t)})}function mf(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...D(t)})}function gf(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...D(t)})}function vf(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...D(t)})}function bf(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...D(t)})}function yf(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...D(t)})}function wf(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...D(t)})}function kf(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...D(t)})}function xf(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...D(t)})}function _f(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...D(t)})}function $f(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...D(t)})}function Sf(e,t){return new e({type:"string",format:"date",check:"string_format",...D(t)})}function zf(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...D(t)})}function Cf(e,t){return new e({type:"string",format:"duration",check:"string_format",...D(t)})}function Af(e,t){return new e({type:"boolean",...D(t)})}function Ef(e){return new e({type:"unknown"})}function If(e,t){return new e({type:"never",...D(t)})}function vi(e,t){return new Ku({check:"max_length",...D(t),maximum:e})}function _n(e,t){return new qu({check:"min_length",...D(t),minimum:e})}function bi(e,t){return new Yu({check:"length_equals",...D(t),length:e})}function Of(e,t){return new Xu({check:"string_format",format:"regex",...D(t),pattern:e})}function Tf(e){return new Qu({check:"string_format",format:"lowercase",...D(e)})}function Pf(e){return new ed({check:"string_format",format:"uppercase",...D(e)})}function Rf(e,t){return new td({check:"string_format",format:"includes",...D(t),includes:e})}function Zf(e,t){return new nd({check:"string_format",format:"starts_with",...D(t),prefix:e})}function Nf(e,t){return new rd({check:"string_format",format:"ends_with",...D(t),suffix:e})}function Et(e){return new od({check:"overwrite",tx:e})}function Lf(e){return Et(t=>t.normalize(e))}function jf(){return Et(e=>e.trim())}function Df(){return Et(e=>e.toLowerCase())}function Mf(){return Et(e=>e.toUpperCase())}function Uf(){return Et(e=>Qc(e))}function Ff(e,t,n){return new e({type:"array",element:t,...D(n)})}function Vf(e,t,n){return new e({type:"custom",check:"custom",fn:t,...D(n)})}function Bf(e,t){const n=Gf(r=>(r.addIssue=o=>{if(typeof o=="string")r.issues.push(Gt(o,r.value,n._zod.def));else{const i=o;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=r.value),i.inst??(i.inst=n),i.continue??(i.continue=!n._zod.def.abort),r.issues.push(Gt(i))}},e(r.value,r)),t);return n}function Gf(e,t){const n=new Ue({check:"custom",...D(t)});return n._zod.check=e,n}function yi(e){let t=(e==null?void 0:e.target)??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:(e==null?void 0:e.metadata)??Lt,target:t,unrepresentable:(e==null?void 0:e.unrepresentable)??"throw",override:(e==null?void 0:e.override)??(()=>{}),io:(e==null?void 0:e.io)??"output",counter:0,seen:new Map,cycles:(e==null?void 0:e.cycles)??"ref",reused:(e==null?void 0:e.reused)??"inline",external:(e==null?void 0:e.external)??void 0}}function ge(e,t,n={path:[],schemaPath:[]}){var d,c;var r;const o=e._zod.def,i=t.seen.get(e);if(i)return i.count++,n.schemaPath.includes(e)&&(i.cycle=n.path),i.schema;const s={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,s);const a=(c=(d=e._zod).toJSONSchema)==null?void 0:c.call(d);if(a)s.schema=a;else{const f={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,f);else{const $=s.schema,v=t.processors[o.type];if(!v)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);v(e,t,$,f)}const p=e._zod.parent;p&&(s.ref||(s.ref=p),ge(p,t,f),t.seen.get(p).isParent=!0)}const l=t.metadataRegistry.get(e);return l&&Object.assign(s.schema,l),t.io==="input"&&Se(e)&&(delete s.schema.examples,delete s.schema.default),t.io==="input"&&"_prefault"in s.schema&&((r=s.schema).default??(r.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function wi(e,t){var s,a,l,u;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const d of e.seen.entries()){const c=(s=e.metadataRegistry.get(d[0]))==null?void 0:s.id;if(c){const f=r.get(c);if(f&&f!==d[0])throw new Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(c,d[0])}}const o=d=>{var v;const c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const b=(v=e.external.registry.get(d[0]))==null?void 0:v.id,y=e.external.uri??(x=>x);if(b)return{ref:y(b)};const S=d[1].defId??d[1].schema.id??`schema${e.counter++}`;return d[1].defId=S,{defId:S,ref:`${y("__shared")}#/${c}/${S}`}}if(d[1]===n)return{ref:"#"};const p=`#/${c}/`,$=d[1].schema.id??`__schema${e.counter++}`;return{defId:$,ref:p+$}},i=d=>{if(d[1].schema.$ref)return;const c=d[1],{ref:f,defId:p}=o(d);c.def={...c.schema},p&&(c.defId=p);const $=c.schema;for(const v in $)delete $[v];$.$ref=f};if(e.cycles==="throw")for(const d of e.seen.entries()){const c=d[1];if(c.cycle)throw new Error(`Cycle detected: #/${(a=c.cycle)==null?void 0:a.join("/")}/<root>
71
+
72
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const d of e.seen.entries()){const c=d[1];if(t===d[0]){i(d);continue}if(e.external){const p=(l=e.external.registry.get(d[0]))==null?void 0:l.id;if(t!==d[0]&&p){i(d);continue}}if((u=e.metadataRegistry.get(d[0]))==null?void 0:u.id){i(d);continue}if(c.cycle){i(d);continue}if(c.count>1&&e.reused==="ref"){i(d);continue}}}function ki(e,t){var a,l,u,d;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=c=>{const f=e.seen.get(c);if(f.ref===null)return;const p=f.def??f.schema,$={...p},v=f.ref;if(f.ref=null,v){r(v);const y=e.seen.get(v),S=y.schema;if(S.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(p.allOf=p.allOf??[],p.allOf.push(S)):Object.assign(p,S),Object.assign(p,$),c._zod.parent===v)for(const P in p)P==="$ref"||P==="allOf"||P in $||delete p[P];if(S.$ref&&y.def)for(const P in p)P==="$ref"||P==="allOf"||P in y.def&&JSON.stringify(p[P])===JSON.stringify(y.def[P])&&delete p[P]}const b=c._zod.parent;if(b&&b!==v){r(b);const y=e.seen.get(b);if(y!=null&&y.schema.$ref&&(p.$ref=y.schema.$ref,y.def))for(const S in p)S==="$ref"||S==="allOf"||S in y.def&&JSON.stringify(p[S])===JSON.stringify(y.def[S])&&delete p[S]}e.override({zodSchema:c,jsonSchema:p,path:f.path??[]})};for(const c of[...e.seen.entries()].reverse())r(c[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,(a=e.external)!=null&&a.uri){const c=(l=e.external.registry.get(t))==null?void 0:l.id;if(!c)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(c)}Object.assign(o,n.def??n.schema);const i=(u=e.metadataRegistry.get(t))==null?void 0:u.id;i!==void 0&&o.id===i&&delete o.id;const s=((d=e.external)==null?void 0:d.defs)??{};for(const c of e.seen.entries()){const f=c[1];f.def&&f.defId&&(f.def.id===f.defId&&delete f.def.id,s[f.defId]=f.def)}e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?o.$defs=s:o.definitions=s);try{const c=JSON.parse(JSON.stringify(o));return Object.defineProperty(c,"~standard",{value:{...t["~standard"],jsonSchema:{input:$n(t,"input",e.processors),output:$n(t,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch{throw new Error("Error converting schema to JSON.")}}function Se(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return Se(r.element,n);if(r.type==="set")return Se(r.valueType,n);if(r.type==="lazy")return Se(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 Se(r.innerType,n);if(r.type==="intersection")return Se(r.left,n)||Se(r.right,n);if(r.type==="record"||r.type==="map")return Se(r.keyType,n)||Se(r.valueType,n);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Se(r.in,n)||Se(r.out,n);if(r.type==="object"){for(const o in r.shape)if(Se(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(const o of r.options)if(Se(o,n))return!0;return!1}if(r.type==="tuple"){for(const o of r.items)if(Se(o,n))return!0;return!!(r.rest&&Se(r.rest,n))}return!1}const Hf=(e,t={})=>n=>{const r=yi({...n,processors:t});return ge(e,r),wi(r,e),ki(r,e)},$n=(e,t,n={})=>r=>{const{libraryOptions:o,target:i}=r??{},s=yi({...o??{},target:i,io:t,processors:n});return ge(e,s),wi(s,e),ki(s,e)},Wf={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Jf=(e,t,n,r)=>{const o=n;o.type="string";const{minimum:i,maximum:s,format:a,patterns:l,contentEncoding:u}=e._zod.bag;if(typeof i=="number"&&(o.minLength=i),typeof s=="number"&&(o.maxLength=s),a&&(o.format=Wf[a]??a,o.format===""&&delete o.format,a==="time"&&delete o.format),u&&(o.contentEncoding=u),l&&l.size>0){const d=[...l];d.length===1?o.pattern=d[0].source:d.length>1&&(o.allOf=[...d.map(c=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:c.source}))])}},Kf=(e,t,n,r)=>{n.type="boolean"},qf=(e,t,n,r)=>{n.not={}},Yf=(e,t,n,r)=>{},Xf=(e,t,n,r)=>{const o=e._zod.def,i=ri(o.entries);i.every(s=>typeof s=="number")&&(n.type="number"),i.every(s=>typeof s=="string")&&(n.type="string"),n.enum=i},Qf=(e,t,n,r)=>{const o=e._zod.def,i=[];for(const s of o.values)if(s===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(s))}else i.push(s);if(i.length!==0)if(i.length===1){const s=i[0];n.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[s]:n.const=s}else i.every(s=>typeof s=="number")&&(n.type="number"),i.every(s=>typeof s=="string")&&(n.type="string"),i.every(s=>typeof s=="boolean")&&(n.type="boolean"),i.every(s=>s===null)&&(n.type="null"),n.enum=i},eh=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},th=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},nh=(e,t,n,r)=>{const o=n,i=e._zod.def,{minimum:s,maximum:a}=e._zod.bag;typeof s=="number"&&(o.minItems=s),typeof a=="number"&&(o.maxItems=a),o.type="array",o.items=ge(i.element,t,{...r,path:[...r.path,"items"]})},rh=(e,t,n,r)=>{var u;const o=n,i=e._zod.def;o.type="object",o.properties={};const s=i.shape;for(const d in s)o.properties[d]=ge(s[d],t,{...r,path:[...r.path,"properties",d]});const a=new Set(Object.keys(s)),l=new Set([...a].filter(d=>{const c=i.shape[d]._zod;return t.io==="input"?c.optin===void 0:c.optout===void 0}));l.size>0&&(o.required=Array.from(l)),((u=i.catchall)==null?void 0:u._zod.def.type)==="never"?o.additionalProperties=!1:i.catchall?i.catchall&&(o.additionalProperties=ge(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},oh=(e,t,n,r)=>{const o=e._zod.def,i=o.inclusive===!1,s=o.options.map((a,l)=>ge(a,t,{...r,path:[...r.path,i?"oneOf":"anyOf",l]}));i?n.oneOf=s:n.anyOf=s},ih=(e,t,n,r)=>{const o=e._zod.def,i=ge(o.left,t,{...r,path:[...r.path,"allOf",0]}),s=ge(o.right,t,{...r,path:[...r.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,l=[...a(i)?i.allOf:[i],...a(s)?s.allOf:[s]];n.allOf=l},sh=(e,t,n,r)=>{const o=n,i=e._zod.def;o.type="object";const s=i.keyType,a=s._zod.bag,l=a==null?void 0:a.patterns;if(i.mode==="loose"&&l&&l.size>0){const d=ge(i.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});o.patternProperties={};for(const c of l)o.patternProperties[c.source]=d}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(o.propertyNames=ge(i.keyType,t,{...r,path:[...r.path,"propertyNames"]})),o.additionalProperties=ge(i.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const u=s._zod.values;if(u){const d=[...u].filter(c=>typeof c=="string"||typeof c=="number");d.length>0&&(o.required=d)}},ah=(e,t,n,r)=>{const o=e._zod.def,i=ge(o.innerType,t,r),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=o.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]},lh=(e,t,n,r)=>{const o=e._zod.def;ge(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType},ch=(e,t,n,r)=>{const o=e._zod.def;ge(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},uh=(e,t,n,r)=>{const o=e._zod.def;ge(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},dh=(e,t,n,r)=>{const o=e._zod.def;ge(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType;let s;try{s=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=s},fh=(e,t,n,r)=>{const o=e._zod.def,i=o.in._zod.traits.has("$ZodTransform"),s=t.io==="input"?i?o.out:o.in:o.out;ge(s,t,r);const a=t.seen.get(e);a.ref=s},hh=(e,t,n,r)=>{const o=e._zod.def;ge(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType,n.readOnly=!0},xi=(e,t,n,r)=>{const o=e._zod.def;ge(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType},ph=g("ZodISODateTime",(e,t)=>{bd.init(e,t),se.init(e,t)});function mh(e){return $f(ph,e)}const gh=g("ZodISODate",(e,t)=>{yd.init(e,t),se.init(e,t)});function vh(e){return Sf(gh,e)}const bh=g("ZodISOTime",(e,t)=>{wd.init(e,t),se.init(e,t)});function yh(e){return zf(bh,e)}const wh=g("ZodISODuration",(e,t)=>{kd.init(e,t),se.init(e,t)});function kh(e){return Cf(wh,e)}const xh=(e,t)=>{ai.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>fu(e,n)},flatten:{value:n=>du(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Hn,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Hn,2)}},isEmpty:{get(){return e.issues.length===0}}})},Ze=g("ZodError",xh,{Parent:Error}),_h=cr(Ze),$h=ur(Ze),Sh=En(Ze),zh=In(Ze),Ch=mu(Ze),Ah=gu(Ze),Eh=vu(Ze),Ih=bu(Ze),Oh=yu(Ze),Th=wu(Ze),Ph=ku(Ze),Rh=xu(Ze),io=new WeakMap;function Tn(e,t,n){const r=Object.getPrototypeOf(e);let o=io.get(r);if(o||(o=new Set,io.set(r,o)),!o.has(t)){o.add(t);for(const i in n){const s=n[i];Object.defineProperty(r,i,{configurable:!0,enumerable:!1,get(){const a=s.bind(this);return Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:a}),a},set(a){Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:a})}})}}}const ue=g("ZodType",(e,t)=>(ce.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:$n(e,"input"),output:$n(e,"output")}}),e.toJSONSchema=Hf(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(n,r)=>_h(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>Sh(e,n,r),e.parseAsync=async(n,r)=>$h(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>zh(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>Ch(e,n,r),e.decode=(n,r)=>Ah(e,n,r),e.encodeAsync=async(n,r)=>Eh(e,n,r),e.decodeAsync=async(n,r)=>Ih(e,n,r),e.safeEncode=(n,r)=>Oh(e,n,r),e.safeDecode=(n,r)=>Th(e,n,r),e.safeEncodeAsync=async(n,r)=>Ph(e,n,r),e.safeDecodeAsync=async(n,r)=>Rh(e,n,r),Tn(e,"ZodType",{check(...n){const r=this.def;return this.clone(tt(r,{checks:[...r.checks??[],...n.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),{parent:!0})},with(...n){return this.check(...n)},clone(n,r){return nt(this,n,r)},brand(){return this},register(n,r){return n.add(this,r),this},refine(n,r){return this.check(xp(n,r))},superRefine(n,r){return this.check(_p(n,r))},overwrite(n){return this.check(Et(n))},optional(){return lo(this)},exactOptional(){return up(this)},nullable(){return co(this)},nullish(){return lo(co(this))},nonoptional(n){return mp(this,n)},array(){return Ne(this)},or(n){return tp([this,n])},and(n){return ip(this,n)},transform(n){return uo(this,lp(n))},default(n){return fp(this,n)},prefault(n){return pp(this,n)},catch(n){return vp(this,n)},pipe(n){return uo(this,n)},readonly(){return wp(this)},describe(n){const r=this.clone();return Lt.add(r,{description:n}),r},meta(...n){if(n.length===0)return Lt.get(this);const r=this.clone();return Lt.add(r,n[0]),r},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(n){return n(this)}}),Object.defineProperty(e,"description",{get(){var n;return(n=Lt.get(e))==null?void 0:n.description},configurable:!0}),e)),_i=g("_ZodString",(e,t)=>{dr.init(e,t),ue.init(e,t),e._zod.processJSONSchema=(r,o,i)=>Jf(e,r,o);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,Tn(e,"_ZodString",{regex(...r){return this.check(Of(...r))},includes(...r){return this.check(Rf(...r))},startsWith(...r){return this.check(Zf(...r))},endsWith(...r){return this.check(Nf(...r))},min(...r){return this.check(_n(...r))},max(...r){return this.check(vi(...r))},length(...r){return this.check(bi(...r))},nonempty(...r){return this.check(_n(1,...r))},lowercase(r){return this.check(Tf(r))},uppercase(r){return this.check(Pf(r))},trim(){return this.check(jf())},normalize(...r){return this.check(Lf(...r))},toLowerCase(){return this.check(Df())},toUpperCase(){return this.check(Mf())},slugify(){return this.check(Uf())}})}),Jn=g("ZodString",(e,t)=>{dr.init(e,t),_i.init(e,t),e.email=n=>e.check(nf(Zh,n)),e.url=n=>e.check(lf(Nh,n)),e.jwt=n=>e.check(_f(Yh,n)),e.emoji=n=>e.check(cf(Lh,n)),e.guid=n=>e.check(oo(so,n)),e.uuid=n=>e.check(rf(un,n)),e.uuidv4=n=>e.check(of(un,n)),e.uuidv6=n=>e.check(sf(un,n)),e.uuidv7=n=>e.check(af(un,n)),e.nanoid=n=>e.check(uf(jh,n)),e.guid=n=>e.check(oo(so,n)),e.cuid=n=>e.check(df(Dh,n)),e.cuid2=n=>e.check(ff(Mh,n)),e.ulid=n=>e.check(hf(Uh,n)),e.base64=n=>e.check(wf(Jh,n)),e.base64url=n=>e.check(kf(Kh,n)),e.xid=n=>e.check(pf(Fh,n)),e.ksuid=n=>e.check(mf(Vh,n)),e.ipv4=n=>e.check(gf(Bh,n)),e.ipv6=n=>e.check(vf(Gh,n)),e.cidrv4=n=>e.check(bf(Hh,n)),e.cidrv6=n=>e.check(yf(Wh,n)),e.e164=n=>e.check(xf(qh,n)),e.datetime=n=>e.check(mh(n)),e.date=n=>e.check(vh(n)),e.time=n=>e.check(yh(n)),e.duration=n=>e.check(kh(n))});function K(e){return tf(Jn,e)}const se=g("ZodStringFormat",(e,t)=>{oe.init(e,t),_i.init(e,t)}),Zh=g("ZodEmail",(e,t)=>{cd.init(e,t),se.init(e,t)}),so=g("ZodGUID",(e,t)=>{ad.init(e,t),se.init(e,t)}),un=g("ZodUUID",(e,t)=>{ld.init(e,t),se.init(e,t)}),Nh=g("ZodURL",(e,t)=>{ud.init(e,t),se.init(e,t)}),Lh=g("ZodEmoji",(e,t)=>{dd.init(e,t),se.init(e,t)}),jh=g("ZodNanoID",(e,t)=>{fd.init(e,t),se.init(e,t)}),Dh=g("ZodCUID",(e,t)=>{hd.init(e,t),se.init(e,t)}),Mh=g("ZodCUID2",(e,t)=>{pd.init(e,t),se.init(e,t)}),Uh=g("ZodULID",(e,t)=>{md.init(e,t),se.init(e,t)}),Fh=g("ZodXID",(e,t)=>{gd.init(e,t),se.init(e,t)}),Vh=g("ZodKSUID",(e,t)=>{vd.init(e,t),se.init(e,t)}),Bh=g("ZodIPv4",(e,t)=>{xd.init(e,t),se.init(e,t)}),Gh=g("ZodIPv6",(e,t)=>{_d.init(e,t),se.init(e,t)}),Hh=g("ZodCIDRv4",(e,t)=>{$d.init(e,t),se.init(e,t)}),Wh=g("ZodCIDRv6",(e,t)=>{Sd.init(e,t),se.init(e,t)}),Jh=g("ZodBase64",(e,t)=>{zd.init(e,t),se.init(e,t)}),Kh=g("ZodBase64URL",(e,t)=>{Ad.init(e,t),se.init(e,t)}),qh=g("ZodE164",(e,t)=>{Ed.init(e,t),se.init(e,t)}),Yh=g("ZodJWT",(e,t)=>{Od.init(e,t),se.init(e,t)}),$i=g("ZodBoolean",(e,t)=>{Td.init(e,t),ue.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Kf(e,n,r)});function dn(e){return Af($i,e)}const Xh=g("ZodUnknown",(e,t)=>{Pd.init(e,t),ue.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Yf()});function Kn(){return Ef(Xh)}const Qh=g("ZodNever",(e,t)=>{Rd.init(e,t),ue.init(e,t),e._zod.processJSONSchema=(n,r,o)=>qf(e,n,r)});function ep(e){return If(Qh,e)}const Si=g("ZodArray",(e,t)=>{Zd.init(e,t),ue.init(e,t),e._zod.processJSONSchema=(n,r,o)=>nh(e,n,r,o),e.element=t.element,Tn(e,"ZodArray",{min(n,r){return this.check(_n(n,r))},nonempty(n){return this.check(_n(1,n))},max(n,r){return this.check(vi(n,r))},length(n,r){return this.check(bi(n,r))},unwrap(){return this.element}})});function Ne(e,t){return Ff(Si,e,t)}const fr=g("ZodObject",(e,t)=>{Ld.init(e,t),ue.init(e,t),e._zod.processJSONSchema=(n,r,o)=>rh(e,n,r,o),Y(e,"shape",()=>t.shape),Tn(e,"ZodObject",{keyof(){return Le(Object.keys(this._zod.def.shape))},catchall(n){return this.clone({...this._zod.def,catchall:n})},passthrough(){return this.clone({...this._zod.def,catchall:Kn()})},loose(){return this.clone({...this._zod.def,catchall:Kn()})},strict(){return this.clone({...this._zod.def,catchall:ep()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(n){return iu(this,n)},safeExtend(n){return su(this,n)},merge(n){return au(this,n)},pick(n){return ru(this,n)},omit(n){return ou(this,n)},partial(...n){return lu(hr,this,n[0])},required(...n){return cu(Ei,this,n[0])}})});function ne(e,t){const n={type:"object",shape:e??{},...D(t)};return new fr(n)}const zi=g("ZodUnion",(e,t)=>{mi.init(e,t),ue.init(e,t),e._zod.processJSONSchema=(n,r,o)=>oh(e,n,r,o),e.options=t.options});function tp(e,t){return new zi({type:"union",options:e,...D(t)})}const np=g("ZodDiscriminatedUnion",(e,t)=>{zi.init(e,t),jd.init(e,t)});function rp(e,t,n){return new np({type:"union",options:t,discriminator:e,...D(n)})}const op=g("ZodIntersection",(e,t)=>{Dd.init(e,t),ue.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ih(e,n,r,o)});function ip(e,t){return new op({type:"intersection",left:e,right:t})}const ao=g("ZodRecord",(e,t)=>{Md.init(e,t),ue.init(e,t),e._zod.processJSONSchema=(n,r,o)=>sh(e,n,r,o),e.keyType=t.keyType,e.valueType=t.valueType});function sp(e,t,n){return!t||!t._zod?new ao({type:"record",keyType:K(),valueType:e,...D(t)}):new ao({type:"record",keyType:e,valueType:t,...D(n)})}const Sn=g("ZodEnum",(e,t)=>{Ud.init(e,t),ue.init(e,t),e._zod.processJSONSchema=(r,o,i)=>Xf(e,r,o),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{const i={};for(const s of r)if(n.has(s))i[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new Sn({...t,checks:[],...D(o),entries:i})},e.exclude=(r,o)=>{const i={...t.entries};for(const s of r)if(n.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new Sn({...t,checks:[],...D(o),entries:i})}});function Le(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Sn({type:"enum",entries:n,...D(t)})}const Ci=g("ZodLiteral",(e,t)=>{Fd.init(e,t),ue.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Qf(e,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Dt(e,t){return new Ci({type:"literal",values:Array.isArray(e)?e:[e],...D(t)})}const ap=g("ZodTransform",(e,t)=>{Vd.init(e,t),ue.init(e,t),e._zod.processJSONSchema=(n,r,o)=>th(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new ni(e.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(Gt(i,n.value,t));else{const s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=e),n.issues.push(Gt(s))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(i=>(n.value=i,n.fallback=!0,n)):(n.value=o,n.fallback=!0,n)}});function lp(e){return new ap({type:"transform",transform:e})}const hr=g("ZodOptional",(e,t)=>{gi.init(e,t),ue.init(e,t),e._zod.processJSONSchema=(n,r,o)=>xi(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function lo(e){return new hr({type:"optional",innerType:e})}const cp=g("ZodExactOptional",(e,t)=>{Bd.init(e,t),ue.init(e,t),e._zod.processJSONSchema=(n,r,o)=>xi(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function up(e){return new cp({type:"optional",innerType:e})}const dp=g("ZodNullable",(e,t)=>{Gd.init(e,t),ue.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ah(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function co(e){return new dp({type:"nullable",innerType:e})}const Ai=g("ZodDefault",(e,t)=>{Hd.init(e,t),ue.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ch(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function fp(e,t){return new Ai({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():ii(t)}})}const hp=g("ZodPrefault",(e,t)=>{Wd.init(e,t),ue.init(e,t),e._zod.processJSONSchema=(n,r,o)=>uh(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function pp(e,t){return new hp({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():ii(t)}})}const Ei=g("ZodNonOptional",(e,t)=>{Jd.init(e,t),ue.init(e,t),e._zod.processJSONSchema=(n,r,o)=>lh(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function mp(e,t){return new Ei({type:"nonoptional",innerType:e,...D(t)})}const gp=g("ZodCatch",(e,t)=>{Kd.init(e,t),ue.init(e,t),e._zod.processJSONSchema=(n,r,o)=>dh(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function vp(e,t){return new gp({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const bp=g("ZodPipe",(e,t)=>{qd.init(e,t),ue.init(e,t),e._zod.processJSONSchema=(n,r,o)=>fh(e,n,r,o),e.in=t.in,e.out=t.out});function uo(e,t){return new bp({type:"pipe",in:e,out:t})}const yp=g("ZodReadonly",(e,t)=>{Yd.init(e,t),ue.init(e,t),e._zod.processJSONSchema=(n,r,o)=>hh(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function wp(e){return new yp({type:"readonly",innerType:e})}const kp=g("ZodCustom",(e,t)=>{Xd.init(e,t),ue.init(e,t),e._zod.processJSONSchema=(n,r,o)=>eh(e,n)});function xp(e,t={}){return Vf(kp,e,t)}function _p(e,t){return Bf(e,t)}const Ae={custom:"custom"},$p=["http:","https:","mailto:"];function Sp(e){try{return new URL(e,"http://_invalid_base").protocol}catch{return}}function fn(e){const t=Sp(e);return t!==void 0&&$p.includes(t)}const fo=["copy","like","dislike","regenerate","edit","speak"],zp=/^[a-z][a-z0-9]*-[a-z0-9-]+$/,ho=ne({id:K().min(1),label:K().min(1),description:K().min(1).optional()}).strict(),Cp=rp("mode",[ne({mode:Dt("mock")}).strict(),ne({mode:Dt("endpoint"),url:K().min(1),wire:Le(["openai","anthropic"])}).strict()]),Ap=ne({$schema:K().optional(),name:K().regex(zp,'must be a valid custom-element tag: lowercase, with a hyphen (e.g. "acme-support")'),layout:Le(["widget","fullscreen","aside","split","custom"]),provider:Cp,userId:K().min(1).regex(/^[\x20-\x7E]+$/,"must be printable ASCII with no line breaks (it becomes an HTTP header value)").optional(),theme:ne({accent:K().optional(),unreadColor:K().optional(),mode:Le(["light","dark","system"]).default("system")}).strict().optional(),header:ne({title:K().min(1).optional(),themeToggle:dn().optional(),actions:Ne(ne({label:K().min(1),variant:Le(ti).optional()}).strict()).min(1).optional()}).strict().optional(),empty:ne({title:K().min(1),description:K().min(1).optional(),icon:K().min(1).optional()}).strict().optional(),home:ne({greeting:ne({title:K().min(1).optional(),subtitle:K().min(1).optional()}).strict().optional(),recentConversation:Dt(!0).optional(),newConversation:ne({label:K().min(1).optional()}).strict().optional(),links:Ne(ne({label:K().min(1),href:K().min(1).optional(),description:K().min(1).optional(),icon:K().min(1).optional()}).strict()).optional()}).strict().optional(),capabilities:ne({starters:Ne(K().min(1)).min(1).max(6).optional(),attachments:ne({accept:Ne(K().min(1)).min(1)}).strict().optional(),history:ne({persistence:Le(["none","local","endpoint"]),url:K().min(1).optional()}).strict().optional(),reasoning:Le(["full","compact","off"]).optional(),reasoningOpen:dn().optional(),conversations:Dt(!0).optional(),messageActions:ne({user:Ne(Le(fo)).min(1).optional(),assistant:Ne(Le(fo)).min(1).optional()}).strict().optional(),sources:ne({strip:dn().optional()}).strict().optional()}).strict().optional(),cards:Ne(ne({name:K().regex(/^[a-z][a-z0-9_]*$/),schema:sp(K(),Kn())}).strict()).min(1).optional(),slots:Ne(K().regex(/^[a-z][a-z0-9-]*$/,"slot names must be kebab-case, starting with a letter")).min(1).max(8).optional(),widget:ne({position:Le(["bottom-end","bottom-start","top-end","top-start"]).optional(),launcherIcon:K().min(1).optional(),defaultOpen:dn().optional()}).strict().optional(),aside:ne({position:Le(["start","end"]).optional(),width:K().min(1).optional()}).strict().optional(),shell:ne({commandPalette:Dt(!0).optional(),userMenu:ne({name:K().min(1),plan:K().min(1).optional()}).strict().optional()}).strict().optional(),composer:ne({triggers:ne({slash:Ne(ho).min(1).optional(),mention:Ne(ho).min(1).optional()}).strict().optional()}).strict().optional()}).strict().superRefine((e,t)=>{for(const n of Ep)n.check(e,t)}),Ep=[{id:"slots-unique",paths:["slots"],check:(e,t)=>{if(!e.slots)return;const n=new Set;e.slots.forEach((r,o)=>{n.has(r)&&t.addIssue({code:Ae.custom,path:["slots",o],message:`duplicate slot name "${r}"`}),n.add(r)})}},{id:"custom-layout-needs-slots",paths:["layout","slots"],check:(e,t)=>{e.layout==="custom"&&(!e.slots||e.slots.length===0)&&t.addIssue({code:Ae.custom,path:["slots"],message:'"custom" layout requires at least one declared slot — custom IS the slots grain'})}},{id:"split-pane-slot-collision",paths:["layout","slots"],check:(e,t)=>{if(e.layout==="split"&&e.slots){const n=e.slots.indexOf("pane");n!==-1&&t.addIssue({code:Ae.custom,path:["slots",n],message:`"pane" collides with the "split" layout's own fixed <slot name="pane"> — choose a different slot name`})}}},{id:"widget-layout-scope",paths:["layout","widget"],check:(e,t)=>{e.widget&&e.layout!=="widget"&&t.addIssue({code:Ae.custom,path:["widget"],message:'"widget" is only valid on layout: "widget"'})}},{id:"aside-layout-scope",paths:["layout","aside"],check:(e,t)=>{e.aside&&e.layout!=="aside"&&t.addIssue({code:Ae.custom,path:["aside"],message:'"aside" is only valid on layout: "aside"'})}},{id:"message-actions-unique",paths:["capabilities.messageActions.user","capabilities.messageActions.assistant"],check:(e,t)=>{var r;const n=(r=e.capabilities)==null?void 0:r.messageActions;if(n)for(const o of["user","assistant"]){const i=n[o];if(!i)continue;const s=new Set;i.forEach((a,l)=>{s.has(a)&&t.addIssue({code:Ae.custom,path:["capabilities","messageActions",o,l],message:`duplicate action id "${a}"`}),s.add(a)})}}},{id:"launcher-icon-url",paths:["widget.launcherIcon"],check:(e,t)=>{var n;(n=e.widget)!=null&&n.launcherIcon&&!fn(e.widget.launcherIcon)&&t.addIssue({code:Ae.custom,path:["widget","launcherIcon"],message:"launcherIcon must be an http(s)/mailto or relative URL — no javascript:/data: schemes"})}},{id:"empty-icon-url",paths:["empty.icon"],check:(e,t)=>{var n;(n=e.empty)!=null&&n.icon&&!fn(e.empty.icon)&&t.addIssue({code:Ae.custom,path:["empty","icon"],message:"icon must be an http(s)/mailto or relative URL — no javascript:/data: schemes"})}},{id:"reasoning-open-scope",paths:["capabilities.reasoning","capabilities.reasoningOpen"],check:(e,t)=>{var o,i;const n=(o=e.capabilities)==null?void 0:o.reasoning;((i=e.capabilities)==null?void 0:i.reasoningOpen)!==void 0&&(n==="compact"||n==="off")&&t.addIssue({code:Ae.custom,path:["capabilities","reasoningOpen"],message:'"reasoningOpen" only applies when reasoning is "full" or omitted — "compact"/"off" have no disclosure to open'})}},{id:"conversations-need-history",paths:["capabilities.conversations","capabilities.history"],check:(e,t)=>{var r,o;const n=(r=e.capabilities)==null?void 0:r.history;(o=e.capabilities)!=null&&o.conversations&&(!n||n.persistence==="none")&&t.addIssue({code:Ae.custom,path:["capabilities","conversations"],message:'"conversations" requires capabilities.history.persistence to be "local" or "endpoint" — a conversation list needs somewhere to persist conversations'})}},{id:"home-link-urls",paths:["home.links"],check:(e,t)=>{var r;const n=/^[a-zA-Z][a-zA-Z0-9+.-]*:|^\/\//;for(const[o,i]of(((r=e.home)==null?void 0:r.links)??[]).entries())i.href&&!fn(i.href)&&t.addIssue({code:Ae.custom,path:["home","links",o,"href"],message:"href must be an http(s)/mailto or relative URL — no javascript:/data: schemes"}),i.icon&&n.test(i.icon)&&!fn(i.icon)&&t.addIssue({code:Ae.custom,path:["home","links",o,"icon"],message:"icon must be a kit icon name or an http(s)/relative URL — no javascript:/data: schemes"})}},{id:"history-endpoint-url",paths:["capabilities.history.persistence","capabilities.history.url"],check:(e,t)=>{var r;const n=(r=e.capabilities)==null?void 0:r.history;n&&(n.persistence==="endpoint"&&!n.url&&t.addIssue({code:Ae.custom,path:["capabilities","history","url"],message:'"endpoint" persistence requires a url'}),n.persistence!=="endpoint"&&n.url!==void 0&&t.addIssue({code:Ae.custom,path:["capabilities","history","url"],message:'url is only valid with "endpoint" persistence'}))}}];function Pe(e,t){let n=e;for(const r of t.split(".")){if(n===null||typeof n!="object")return;n=n[r]}return n}function Ip(e){return e===void 0||e===""?!0:Array.isArray(e)?e.length===0:!1}function ee(e,t,n){if(Ip(n))return It(e,t);const r=t.split("."),o=(i,s)=>{const a=r[s];if(s===r.length-1)return{...i,[a]:n};const l=i[a],u=l!==null&&typeof l=="object"&&!Array.isArray(l)?l:{};return{...i,[a]:o(u,s+1)}};return o(e,0)}function It(e,t){const n=t.split("."),r=(i,s)=>{const a=n[s];if(!(a in i))return i;if(s===n.length-1){const{[a]:d,...c}=i;return Object.keys(c).length===0?void 0:c}const l=i[a];if(l===null||typeof l!="object"||Array.isArray(l))return i;const u=r(l,s+1);if(u===l)return i;if(u===void 0){const{[a]:d,...c}=i;return Object.keys(c).length===0?void 0:c}return{...i,[a]:u}};return r(e,0)??e}const Op=["capabilities.conversations","home.recentConversation","shell.commandPalette"];function Ii(e,t){return Pe(e,t)===!0}function Oi(e,t,n){return n?ee(e,t,!0):It(e,t)}const Ti={"capabilities.sources.strip":!0};function Tp(e,t){const n=Pe(e,t);return typeof n=="boolean"?n:Ti[t]??!1}function Pp(e,t,n){return ee(e,t,n)}function qn(e){let t=e;for(;t instanceof hr||t instanceof Ai;)t=t.def.innerType;return t}function Rp(e){let t=Ap;for(const n of e.split(".")){if(!t)return;const r=qn(t);if(!(r instanceof fr))return;t=r.shape[n]}return t}function Zp(e){const t=qn(e);return t instanceof Sn?{kind:"enum",options:t.options}:t instanceof $i?{kind:"boolean"}:t instanceof Ci?{kind:"presence"}:t instanceof Jn?{kind:"string"}:t instanceof Si?qn(t.def.element)instanceof Jn?{kind:"string-list"}:{kind:"complex"}:t instanceof fr?{kind:"section",keys:Object.keys(t.shape)}:{kind:"complex"}}const po={"slots-unique":{treatment:"reject-only"},"custom-layout-needs-slots":{treatment:"reject-only"},"split-pane-slot-collision":{treatment:"reject-only"},"widget-layout-scope":{treatment:"hide-section",section:"widget"},"aside-layout-scope":{treatment:"hide-section",section:"aside"},"message-actions-unique":{treatment:"reject-only"},"launcher-icon-url":{treatment:"reject-only"},"empty-icon-url":{treatment:"reject-only"},"reasoning-open-scope":{treatment:"disable-with-reason",path:"capabilities.reasoningOpen",reason:"Only applies while Reasoning is Full — Compact and Off have no disclosure to open."},"conversations-need-history":{treatment:"disable-with-reason",path:"capabilities.conversations",reason:"Needs History set to Local or Endpoint — a conversation list needs somewhere to persist conversations."},"home-link-urls":{treatment:"reject-only"},"history-endpoint-url":{treatment:"show-requires",path:"capabilities.history.url"}};var Np=w('<div class="flex flex-col gap-1.5"><label class="text-xs font-medium text-foreground">History'),Pi=w('<div class="flex flex-col gap-1.5"><label class="text-xs font-medium text-foreground">Endpoint URL'),Lp=w('<div class="flex flex-col gap-1.5"data-builder-cards-list>'),jp=w('<p class="mt-1.5 text-xs text-muted-foreground">Read-only for now — card editing is a later round.'),Dp=w('<p class="text-xs text-muted-foreground">No cards declared.'),Mp=w('<div class="rounded-lg border border-border/70 bg-surface px-2.5 py-1.5 text-xs text-foreground">'),Up=w('<div class="flex flex-col gap-1.5"><span class="text-xs font-medium text-foreground">'),Fp=w('<div class="flex flex-col gap-2">'),Vp=w('<div class="flex flex-col gap-2 rounded-lg border border-border/70 bg-surface p-2.5"><div class="flex items-center justify-between"><span class="text-[11px] font-medium text-muted-foreground"> '),Bp=w('<div class="flex flex-col gap-2"data-header-actions>'),Gp=w('<div class="flex flex-col gap-2 rounded-lg border border-border/70 bg-surface p-2.5"><div class="flex items-center justify-between"><span class="text-[11px] font-medium text-muted-foreground">Action '),Hp=w('<div class="flex flex-col gap-3"><div class="flex flex-col gap-1.5"><label class="text-xs font-medium text-foreground">Name</label></div><div class="flex flex-col gap-1.5"><label class="text-xs font-medium text-foreground">Plan'),Wp=w('<div class="flex flex-col gap-3"><div class="flex flex-col gap-1.5"><label class="text-xs font-medium text-foreground">Greeting title</label></div><div class="flex flex-col gap-1.5"><label class="text-xs font-medium text-foreground">Greeting subtitle'),Jp=w('<div class="flex flex-col gap-1.5"><label class="text-xs font-medium text-foreground">Mode'),Kp=w('<div class="flex flex-col gap-1.5"><label class="text-xs font-medium text-foreground">Wire format'),mo=w('<div class="flex flex-col gap-1.5"><label class="text-xs font-medium text-foreground">'),qp=w('<p class="text-xs text-muted-foreground">'),Yp=w("<div data-derived-panel>"),Xp=w('<section class="flex flex-col gap-3 border-b border-border p-4 last:border-b-0"><h3 class="text-[11px] font-semibold uppercase tracking-wider text-muted-foreground">'),Qp=w('<p class="text-xs text-destructive"role=alert>: ');const em={name:"Name","aside.width":"Width","aside.position":"Position","header.title":"Header title","header.themeToggle":"Theme toggle","theme.mode":"Mode","theme.accent":"Accent","theme.unreadColor":"Unread color","capabilities.starters":"Starters","capabilities.reasoning":"Reasoning","capabilities.reasoningOpen":"Reasoning open","capabilities.conversations":"Conversations","capabilities.sources.strip":"Sources strip","shell.commandPalette":"Command palette","widget.position":"Position","widget.launcherIcon":"Launcher icon","widget.defaultOpen":"Open by default","home.recentConversation":"Recent conversation"};function pr(e){const t=em[e];if(t)return t;const n=e.split(".").at(-1);return n.charAt(0).toUpperCase()+n.slice(1).replace(/([A-Z])/g," $1").toLowerCase()}function tm(e){return h(ei,{get label(){return pr(e.path)},get value(){return Pe(e.value,e.path)},onChange:t=>e.write(ee(e.value,e.path,t||void 0))})}function nm(e){return h(ei,{get label(){return pr(e.path)},get value(){return Pe(e.value,e.path)},onChange:t=>e.write(ee(e.value,e.path,t||void 0))})}const rm=["image/*","application/pdf"];function om(e){const t=()=>Pe(e.value,e.path),n=r=>{e.write(r?ee(e.value,e.path,t()??{accept:rm.slice()}):It(e.value,e.path))};return[h(Vt,{label:"Attachments",get children(){return h($t,{get checked(){return t()!==void 0},label:"Attachments",onChange:n})}}),h(B,{get when(){return t()},children:r=>h(or,{label:"Accepted types",get children(){return h(Hc,{get accept(){return r().accept??[]},onChange:o=>e.write(ee(e.value,e.path,{accept:o}))})}})})]}const im=[{value:"none",label:"None — nothing saved"},{value:"local",label:"Local — this browser"},{value:"endpoint",label:"Endpoint — your backend"}];function sm(e){const t=()=>Pe(e.value,e.path),n=()=>{var i;return((i=t())==null?void 0:i.persistence)??"none"},r=Re(),o=Re();return[(()=>{var i=Np(),s=i.firstChild;return N(s,"for",r),m(i,h(Ft,{id:r,options:im,get value(){return n()},onChange:a=>e.write(ee(e.value,e.path,{persistence:a.currentTarget.value}))}),null),i})(),h(B,{get when(){return n()==="endpoint"},get children(){var i=Pi(),s=i.firstChild;return N(s,"for",o),m(i,h(xe,{id:o,size:"sm",required:!0,get value(){var a;return((a=t())==null?void 0:a.url)??""},placeholder:"/api/history",onValueInput:a=>e.write(ee(e.value,e.path,{...t(),url:a||void 0}))}),null),i}})]}function am(e){const t=()=>Pe(e.value,e.path)??[];return h(B,{get when(){return t().length>0},get fallback(){return Dp()},get children(){return[(()=>{var n=Lp();return m(n,h($e,{get each(){return t()},children:r=>(()=>{var o=Mp();return m(o,(()=>{var i=Me(()=>{var s;return typeof((s=r.schema)==null?void 0:s.title)=="string"});return()=>i()?r.schema.title:r.name})()),o})()})),n})(),jp()]}})}function Ri(e){const t=e==="user"?qc:Yc,n=e==="user"?"Your messages":"Assistant messages";return function(o){const i=()=>Pe(o.value,o.path)??[],s=()=>{const a=i(),l=a.map(d=>t.find(c=>c.id===d)).filter(d=>d!==void 0).map(d=>({id:d.id,enabled:!0})),u=t.filter(d=>!a.includes(d.id)).map(d=>({id:d.id,enabled:!1}));return[...l,...u]};return(()=>{var a=Up(),l=a.firstChild;return m(l,n),m(a,h(Xc,{legend:n,catalog:t,get rows(){return s()},onChange:u=>{const d=u.filter(c=>c.enabled).map(c=>c.id);o.write(ee(o.value,o.path,d))}}),null),a})()}}const lm=Ri("user"),cm=Ri("assistant");function go(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}function Zi(e){return function(n){const r=()=>Pe(n.value,n.path)??[],o=(l,u)=>{const d=r().slice(),c={...d[l],...u};c.id=c.id||go(c.label??""),d[l]=c,n.write(ee(n.value,n.path,d))},i=()=>n.write(ee(n.value,n.path,[...r(),{id:"new",label:"New"}])),s=l=>n.write(ee(n.value,n.path,r().filter((u,d)=>d!==l))),a=e==="slash"?"slash command":"mention";return(()=>{var l=Fp();return N(l,"data-trigger-entries",e),m(l,h($e,{get each(){return r()},children:(u,d)=>(()=>{var c=Vp(),f=c.firstChild,p=f.firstChild,$=p.firstChild;return m(p,a,$),m(p,()=>d()+1,null),m(f,h(Ee,{type:"button",variant:"ghost",size:"icon-sm",get"aria-label"(){return`Remove ${a} ${d()+1}`},onClick:()=>s(d()),get children(){return h(Wt,{size:14,"aria-hidden":"true"})}}),null),m(c,h(xe,{size:"sm",get value(){return u.label},placeholder:"Label",get"aria-label"(){return`${a} ${d()+1} label`},onValueInput:v=>o(d(),{label:v,id:go(v)})}),null),m(c,h(xe,{size:"sm",get value(){return u.id},placeholder:"id",get"aria-label"(){return`${a} ${d()+1} id`},onValueInput:v=>o(d(),{id:v})}),null),m(c,h(xe,{size:"sm",get value(){return u.description??""},placeholder:"Description",get"aria-label"(){return`${a} ${d()+1} description`},onValueInput:v=>o(d(),{description:v||void 0})}),null),c})()}),null),m(l,h(Ee,{type:"button",variant:"outline",size:"sm",onClick:i,get children(){return["Add ",a]}}),null),l})()}}const um=Zi("slash"),dm=Zi("mention");function fm(e){const t=()=>Pe(e.value,e.path)??[],n=(i,s)=>{const a=t().slice();a[i]={...a[i],...s},e.write(ee(e.value,e.path,a))},r=()=>e.write(ee(e.value,e.path,[...t(),{label:"New"}])),o=i=>e.write(ee(e.value,e.path,t().filter((s,a)=>a!==i)));return(()=>{var i=Bp();return m(i,h($e,{get each(){return t()},children:(s,a)=>(()=>{var l=Gp(),u=l.firstChild,d=u.firstChild;return d.firstChild,m(d,()=>a()+1,null),m(u,h(Ee,{type:"button",variant:"ghost",size:"icon-sm",get"aria-label"(){return`Remove action ${a()+1}`},onClick:()=>o(a()),get children(){return h(Wt,{size:14,"aria-hidden":"true"})}}),null),m(l,h(xe,{size:"sm",get value(){return s.label},placeholder:"Label",get"aria-label"(){return`Action ${a()+1} label`},onValueInput:c=>n(a(),{label:c})}),null),m(l,h(Ft,{get options(){return[{value:"",label:"Default"},...ti.map(c=>({value:c,label:c}))]},get value(){return s.variant??""},get"aria-label"(){return`Action ${a()+1} variant`},onChange:c=>n(a(),{variant:c.currentTarget.value||void 0})}),null),l})()}),null),m(i,h(Ee,{type:"button",variant:"outline",size:"sm",onClick:r,children:"Add action"}),null),i})()}function hm(e){const t=()=>Pe(e.value,e.path),n=i=>{e.write(i?ee(e.value,e.path,t()??{name:""}):It(e.value,e.path))},r=Re(),o=Re();return[h(Vt,{label:"User menu",get children(){return h($t,{get checked(){return t()!==void 0},label:"User menu",onChange:n})}}),h(B,{get when(){return t()},children:i=>(()=>{var s=Hp(),a=s.firstChild,l=a.firstChild,u=a.nextSibling,d=u.firstChild;return N(l,"for",r),m(a,h(xe,{id:r,size:"sm",required:!0,get value(){return i().name},onValueInput:c=>e.write(ee(e.value,e.path,{...i(),name:c}))}),null),N(d,"for",o),m(u,h(xe,{id:o,size:"sm",get value(){return i().plan??""},onValueInput:c=>e.write(ee(e.value,e.path,{...i(),plan:c||void 0}))}),null),s})()})]}function pm(e){const t=()=>Pe(e.value,e.path),n=i=>{e.write(i?ee(e.value,e.path,t()??{}):It(e.value,e.path))},r=Re(),o=Re();return[h(Vt,{label:"Home tab",get children(){return h($t,{get checked(){return t()!==void 0},label:"Home tab",onChange:n})}}),h(B,{get when(){return t()},children:i=>(()=>{var s=Wp(),a=s.firstChild,l=a.firstChild,u=a.nextSibling,d=u.firstChild;return N(l,"for",r),m(a,h(xe,{id:r,size:"sm",get value(){var c;return((c=i().greeting)==null?void 0:c.title)??""},onValueInput:c=>e.write(ee(e.value,`${e.path}.greeting`,{...i().greeting,title:c||void 0}))}),null),N(d,"for",o),m(u,h(xe,{id:o,size:"sm",get value(){var c;return((c=i().greeting)==null?void 0:c.subtitle)??""},onValueInput:c=>e.write(ee(e.value,`${e.path}.greeting`,{...i().greeting,subtitle:c||void 0}))}),null),m(s,h(Vt,{label:"Recent conversation",get children(){return h($t,{get checked(){return Ii(e.value,`${e.path}.recentConversation`)},label:"Recent conversation",onChange:c=>e.write(Oi(e.value,`${e.path}.recentConversation`,c))})}}),null),m(s,h(or,{label:"Links",get children(){return h(Wc,{get links(){return i().links??[]},onChange:c=>e.write(ee(e.value,`${e.path}.links`,c))})}}),null),s})()})]}const mm=[{value:"mock",label:"Mock — canned replies, no network calls"},{value:"endpoint",label:"Endpoint — your own chat route"}],gm=[{value:"openai",label:"OpenAI-compatible"},{value:"anthropic",label:"Anthropic"}];function vm(e){const t=()=>Pe(e.value,e.path),n=Re(),r=Re(),o=Re();return[(()=>{var i=Jp(),s=i.firstChild;return N(s,"for",n),m(i,h(Ft,{id:n,options:mm,get value(){var a;return((a=t())==null?void 0:a.mode)??"mock"},onChange:a=>{const l=a.currentTarget.value;e.write(ee(e.value,e.path,l==="mock"?{mode:"mock"}:{mode:"endpoint",url:"",wire:"openai"}))}}),null),i})(),h(B,{get when(){var i;return((i=t())==null?void 0:i.mode)==="endpoint"},get children(){return[(()=>{var i=Pi(),s=i.firstChild;return N(s,"for",r),m(i,h(xe,{id:r,size:"sm",get value(){var a;return((a=t())==null?void 0:a.url)??""},placeholder:"/api/chat",onValueInput:a=>e.write(ee(e.value,e.path,{...t(),url:a}))}),null),i})(),(()=>{var i=Kp(),s=i.firstChild;return N(s,"for",o),m(i,h(Ft,{id:o,options:gm,get value(){var a;return((a=t())==null?void 0:a.wire)??"openai"},onChange:a=>e.write(ee(e.value,e.path,{...t(),wire:a.currentTarget.value}))}),null),i})()]}})]}const bm={"theme.accent":tm,"theme.unreadColor":nm,"capabilities.attachments":om,"capabilities.history":sm,"capabilities.messageActions.user":lm,"capabilities.messageActions.assistant":cm,"composer.triggers.slash":um,"composer.triggers.mention":dm,"header.actions":fm,"shell.userMenu":hm,home:pm,provider:vm,cards:am};function ym(e){const t=()=>Rp(e.path),n=()=>t()?Zp(t()):{kind:"complex"},r=Re(),o=`${r}-reason`,i=pr(e.path),s=()=>Pe(e.value,e.path),a=d=>e.write(ee(e.value,e.path,d)),l=()=>e.path in Ti,u=()=>Op.includes(e.path);return[h(B,{get when(){return n().kind==="enum"},get children(){var d=mo(),c=d.firstChild;return N(c,"for",r),m(c,i),m(d,h(Ft,{id:r,get options(){return n().options.map(f=>({value:f,label:f}))},get value(){return s()??""},onChange:f=>a(f.currentTarget.value||void 0)}),null),d}}),h(B,{get when(){return n().kind==="boolean"||u()||l()},get children(){return[h(Vt,{label:i,get muted(){return!!e.disabledReason},get children(){return h($t,{get checked(){return Me(()=>!!l())()?Tp(e.value,e.path):Me(()=>!!u())()?Ii(e.value,e.path):s()===!0},get disabled(){return!!e.disabledReason},label:i,get"aria-describedby"(){return e.disabledReason?o:void 0},onChange:d=>e.write(l()?Pp(e.value,e.path,d):u()?Oi(e.value,e.path,d):d?ee(e.value,e.path,!0):It(e.value,e.path))})}}),h(B,{get when(){return e.disabledReason},get children(){var d=qp();return N(d,"id",o),m(d,()=>e.disabledReason),d}})]}}),h(B,{get when(){return n().kind==="string"},get children(){var d=mo(),c=d.firstChild;return N(c,"for",r),m(c,i),m(d,h(xe,{id:r,size:"sm",get value(){return s()??""},onValueInput:f=>a(f||void 0)}),null),d}}),h(B,{get when(){return n().kind==="string-list"},get children(){return h(or,{label:i,get children(){return h(Gc,{get tags(){return s()??[]},onChange:d=>a(d),ariaLabel:i})}})}})]}function wm(e){const t=()=>{const o=new Set;for(const[,i]of Object.entries(po))i.treatment==="hide-section"&&e.value.layout!==i.section&&o.add(i.section);return o},n=o=>{var i,s,a;for(const l of Object.values(po))if(!(l.treatment!=="disable-with-reason"||l.path!==o)){if(o==="capabilities.conversations"){const u=(s=(i=e.value.capabilities)==null?void 0:i.history)==null?void 0:s.persistence;if(!u||u==="none")return l.reason}if(o==="capabilities.reasoningOpen"){const u=(a=e.value.capabilities)==null?void 0:a.reasoning;if(u==="compact"||u==="off")return l.reason}}},r=o=>(e.problems??[]).filter(i=>o.paths.some(s=>i.path===s||i.path.startsWith(`${s}.`)));return(()=>{var o=Yp();return m(o,h($e,{get each(){return e.template.controls.filter(i=>!t().has(i.id))},children:i=>(()=>{var s=Xp(),a=s.firstChild;return m(a,()=>xm(i.id)),m(s,h($e,{get each(){return i.paths},children:l=>{const u=bm[l];return u?h(er,{component:u,path:l,get value(){return e.value},get write(){return e.onChange}}):h(ym,{path:l,get value(){return e.value},get write(){return e.onChange},get disabledReason(){return n(l)}})}}),null),m(s,h($e,{get each(){return r(i)},children:l=>(()=>{var u=Qp(),d=u.firstChild;return m(u,()=>l.path,d),m(u,()=>l.message,null),u})()}),null),F(()=>N(s,"data-derived-section",i.id)),s})()})),F(()=>Oe(o,ie("flex flex-col divide-y divide-border text-sm text-foreground",e.class))),o})()}const km={identity:"Identity",theme:"Theme",header:"Header",empty:"Empty state",home:"Home",capabilities:"Capabilities",messageActions:"Message actions",sources:"Sources",widget:"Widget",aside:"Aside",composerTriggers:"Composer triggers",shell:"Shell",provider:"Provider",cards:"Cards"};function xm(e){return km[e]??e}function _m(e){let t=0;return async function(r){const o=++t;try{const i=await e(r);if(o!==t)return;if(i.status===422)return{problems:(await i.json()).problems??[],serverError:void 0};if(!i.ok)throw new Error(`POST /api/construct → ${i.status}`);return{problems:[],serverError:void 0}}catch{return o!==t?void 0:{problems:[],serverError:"save failed"}}}}const $m={proseSize:()=>"sm",codeTheme:()=>"github-dark-dimmed",portalMount:()=>{},codeHighlight:()=>!0},Sm=Gi($m);function zm(){return Hi(Sm)}function Cm(e){const[t,n]=me(e()),[r,o]=me(e()?"open":"closed");let i,s=0;const a=l=>{i=l};return He(l=>{const u=e();if(u)s++,n(!0),o("open");else if(l){o("closed");const d=i,c=d&&(()=>{const $=getComputedStyle(d);return $.animationName!=="none"&&parseFloat($.animationDuration||"0")>0})();if(!d||!c){const $=++s;return queueMicrotask(()=>{$===s&&n(!1)}),u}const f=d,p=$=>{$.target===f&&(f.removeEventListener("animationend",p),n(!1))};f.addEventListener("animationend",p),lt(()=>f.removeEventListener("animationend",p))}return u}),{present:t,state:r,setRef:a}}var Am=w('<header part=header class="shrink-0 border-b border-border px-5 py-4 text-base font-semibold text-foreground">'),Em=w('<footer part=footer class="flex shrink-0 items-center justify-end gap-2 border-t border-border px-5 py-3">'),Im=w('<div part=backdrop><div part=panel role=dialog aria-modal=true tabindex=-1><div part=body class="min-h-0 flex-1 overflow-auto px-5 py-4 text-sm text-foreground">');const vo=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])','[tabindex]:not([tabindex="-1"])'].join(",");function Om(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)&&getComputedStyle(e).visibility!=="hidden"}function Tm(e){const t=[],n=r=>{for(const o of Array.from(r.children))if(o instanceof HTMLSlotElement)for(const i of o.assignedElements())i instanceof HTMLElement&&(i.matches(vo)&&t.push(i),n(i));else o instanceof HTMLElement&&(o.matches(vo)&&t.push(o),n(o))};return n(e),t.filter(Om)}function bo(){var t;let e=document.activeElement;for(;(t=e==null?void 0:e.shadowRoot)!=null&&t.activeElement;)e=e.shadowRoot.activeElement;return e}function Pm(e){var v;const t=zm(),[n,r]=me(e.defaultOpen??!1),o=`kai-dialog-title-${Re()}`,i=()=>e.open!==void 0,s=()=>i()?!!e.open:n(),a=b=>{var y;i()||r(b),(y=e.onOpenChange)==null||y.call(e,b)};(v=e.controllerRef)==null||v.call(e,{open:s,setOpen:a});const l=Cm(s);let u,d,c=null,f=!1;He(b=>{const y=s();if(y&&!b)c=bo(),queueMicrotask(()=>d==null?void 0:d.focus());else if(!y&&b){const S=c;c=null,S&&S.isConnected&&queueMicrotask(()=>S.focus())}return y},!1);const p=b=>{if(b.key==="Escape"){b.stopPropagation(),a(!1);return}if(b.key!=="Tab"||!d)return;const y=Tm(d);if(!y.length){b.preventDefault(),d.focus();return}const S=bo(),x=S?y.indexOf(S):-1;b.shiftKey?x<=0&&(b.preventDefault(),y[y.length-1].focus()):(x===-1||x===y.length-1)&&(b.preventDefault(),y[0].focus())},$=b=>{f&&b.target===u&&a(!1),f=!1};return h(B,{get when(){return l.present()},get children(){return h(Ss,{get mount(){return t.portalMount()},get children(){var b=Im(),y=b.firstChild,S=y.firstChild;return b.$$keydown=p,b.$$click=$,b.$$pointerdown=x=>{f=x.target===x.currentTarget},ct(x=>{u=x,l.setRef(x)},b),ct(x=>{var P;d=x,(P=e.panelRef)==null||P.call(e,x)},y),m(y,h(B,{get when(){return e.header},get children(){var x=Am();return N(x,"id",o),m(x,()=>e.header),x}}),S),m(S,()=>e.children),m(y,h(B,{get when(){return e.footer},get children(){var x=Em();return m(x,()=>e.footer),x}}),null),F(x=>{var P=l.state()==="open"?"":void 0,C=l.state()==="closed"?"":void 0,A=ie("fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4","animate-in fade-in-0 data-[closed]:animate-out data-[closed]:fade-out-0 motion-reduce:animate-none"),j=e.header?o:void 0,_=e.header?void 0:e["aria-label"],Q=l.state()==="open"?"":void 0,M=l.state()==="closed"?"":void 0,L=ie("flex max-h-[85vh] w-full max-w-lg flex-col overflow-hidden rounded-xl border border-border bg-background text-foreground shadow-xl outline-none","animate-in fade-in-0 zoom-in-95 data-[closed]:animate-out data-[closed]:fade-out-0 data-[closed]:zoom-out-95 motion-reduce:animate-none",e.class);return P!==x.e&&N(b,"data-expanded",x.e=P),C!==x.t&&N(b,"data-closed",x.t=C),A!==x.a&&Oe(b,x.a=A),j!==x.o&&N(y,"aria-labelledby",x.o=j),_!==x.i&&N(y,"aria-label",x.i=_),Q!==x.n&&N(y,"data-expanded",x.n=Q),M!==x.s&&N(y,"data-closed",x.s=M),L!==x.h&&Oe(y,x.h=L),x},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0}),b}})}})}At(["pointerdown","click","keydown"]);var Rm=w('<div role=alert class="sticky top-0 z-10 border-b border-destructive/40 bg-destructive/10 px-4 py-2 text-center text-sm text-destructive dark:bg-destructive/15 dark:text-red-400">'),Zm=w('<main class="mx-auto flex max-w-6xl flex-col gap-6 py-10"><div class="flex flex-col gap-1"><h1 class="text-xl font-semibold text-foreground">Start a construct</h1><p class="text-sm text-muted-foreground">Pick a template. You will get a live preview and a construct file you own.'),Nm=w('<main class="mx-auto max-w-4xl p-8">'),Lm=w('<iframe title=preview class="h-full w-full border-0">'),jm=w('<div class="grid h-dvh grid-cols-[380px_1fr]"><div class="flex flex-col overflow-y-auto border-r border-border"><div class="flex items-center justify-between border-b border-border p-3"><span class="text-sm font-semibold">'),Dm=w(`<p class="mb-4 text-sm text-muted-foreground">Switching resets this construct to the new template's starter. Your name is kept; everything else is replaced.`),Mm=w("<div>"),Um=w('<div class="min-h-dvh bg-background text-foreground">'),Fm=w('<main class="mx-auto flex max-w-md flex-col gap-6 py-10"><div class="flex flex-col gap-1"><h1 class="text-xl font-semibold text-foreground">Name your element</h1><p class="text-sm text-muted-foreground">The emitted custom-element tag: lowercase, with a hyphen (e.g. acme-support).</p></div><div class="flex flex-col gap-1.5"><label for=construct-name class="text-xs font-medium text-foreground">Element name</label></div><div class="flex gap-2">'),Vm=w('<p role=alert class="text-xs text-destructive">: '),Bm=w('<p class="p-8 text-sm text-muted-foreground">Preview starting…');const yo={"--color-primary":"#EC2295"},hn={id:"assistant",name:"Scratch",description:"A bare chat, everything off.",availability:"buildable",starter:{name:"my-chat",layout:"fullscreen",provider:{mode:"mock"}},controls:[{id:"identity",paths:["name"]},{id:"theme",paths:["theme.accent","theme.mode","theme.unreadColor"]},{id:"header",paths:["header.title"]},{id:"capabilities",paths:["capabilities.starters","capabilities.attachments","capabilities.history","capabilities.conversations","capabilities.reasoning","capabilities.reasoningOpen"]},{id:"provider",paths:["provider"]}]};function Gm(){const[e,t]=me({step:"start"}),[n,r]=me(hn),[o,i]=me(),[s,a]=me(),[l,u]=me([]),[d,c]=me(),[f,p]=me(""),[$,v]=me(!1),[b,y]=me();Vi(async()=>{try{const L=await fetch("/api/state");if(!L.ok)throw new Error(`GET /api/state → ${L.status}`);const V=await L.json();if(V.phase==="panel"){const he=V.construct;i(he),a(V.previewUrl),r(S(he)),t({step:"panel"})}y(void 0)}catch{y("can't reach the builder server")}const M=new EventSource("/api/events");M.onopen=()=>y(void 0),M.addEventListener("construct",async()=>{try{const L=await fetch("/api/construct");if(!L.ok)throw new Error(`GET /api/construct → ${L.status}`);const V=await L.json();V.problems?u(V.problems):(i(V),r(S(V)),u([])),y(void 0)}catch{y("can't reach the builder server")}}),M.onerror=()=>y("can't reach the builder server"),lt(()=>M.close())});const S=M=>{const L=wl(M);if(L){const V=yl(L);if(V&&V.availability==="buildable")return V}return{...hn,name:M.name}},x=M=>M==="scratch"?hn:bl().find(L=>L.id===M)??hn,P=M=>{c(M),M==="workspace"?t({step:"variant",templateId:"workspace"}):(p(x(M).starter.name),t({step:"name",templateId:M}))},C=async M=>{try{const L=await fetch("/api/create",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({templateId:d(),variantId:M,name:f()})});if(L.status===422){u((await L.json()).problems??[]),y(void 0);return}if(!L.ok)throw new Error(`POST /api/create → ${L.status}`);const V=await L.json();r(x(d())),i(V.construct),a(V.previewUrl),u([]),y(void 0),t({step:"panel"})}catch{y("save failed")}};let A;const j=_m(M=>fetch("/api/construct",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(M)})),_=M=>{i(M),clearTimeout(A),A=setTimeout(async()=>{const L=await j(M);L&&(u(L.problems),y(L.serverError))},300)},Q=async M=>{var he;const L=x(M).starter,V={...L,name:((he=o())==null?void 0:he.name)??L.name};r(x(M)),v(!1),_(V)};return(()=>{var M=Um();return m(M,h(B,{get when(){return b()},get children(){var L=Rm();return m(L,b),L}}),null),m(M,h(B,{get when(){return e().step==="start"},get children(){var L=Zm();return L.firstChild,m(L,h(Zr,{templates:Vn,get value(){return d()},onSelect:P}),null),F(V=>z(L,yo,V)),L}}),null),m(M,h(B,{get when(){return e().step==="variant"},get children(){var L=Nm();return m(L,h(Kl,{onBack:()=>t({step:"start"}),onSelect:V=>{p(x("workspace").starter.name),t({step:"name",templateId:"workspace",variantId:V})}})),L}}),null),m(M,h(B,{get when(){return e().step==="name"},children:L=>{const V=e();return(()=>{var he=Fm(),R=he.firstChild,U=R.nextSibling;U.firstChild;var G=U.nextSibling;return m(U,h(xe,{id:"construct-name",get value(){return f()},onValueInput:p,placeholder:"acme-support"}),null),m(he,h($e,{get each(){return l()},children:de=>(()=>{var ae=Vm(),ye=ae.firstChild;return m(ae,()=>de.path,ye),m(ae,()=>de.message,null),ae})()}),G),m(G,h(Ee,{variant:"outline",onClick:()=>t({step:"start"}),children:"Back"}),null),m(G,h(Ee,{onClick:()=>C(V.variantId),children:"Create"}),null),he})()}}),null),m(M,h(B,{get when(){return Me(()=>e().step==="panel")()&&o()},get children(){var L=jm(),V=L.firstChild,he=V.firstChild,R=he.firstChild;return m(R,()=>n().name),m(he,h(Ee,{variant:"ghost",size:"sm",onClick:()=>v(!0),children:"Switch template"}),null),m(V,h(wm,{get value(){return o()},onChange:_,get template(){return n()},get problems(){return l()}}),null),m(L,h(B,{get when(){return s()},get fallback(){return Bm()},get children(){var U=Lm();return F(()=>N(U,"src",s())),U}}),null),L}}),null),m(M,h(Pm,{get open(){return $()},onOpenChange:v,header:"Switch template",class:"max-w-5xl",get footer(){return h(Ee,{variant:"outline",size:"sm",onClick:()=>v(!1),children:"Cancel"})},get children(){return[Dm(),(()=>{var L=Mm();return m(L,h(Zr,{templates:Vn,onSelect:V=>Q(V)})),F(V=>z(L,yo,V)),L})()]}}),null),M})()}ps(()=>h(Gm,{}),document.getElementById("root"));