@spikonado/sprocket 0.5.0 → 0.5.1

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 (228) hide show
  1. package/README.md +2 -39
  2. package/package.json +7 -7
  3. package/web/_app/immutable/{abnfDiagram-WEYOIA3C-C3x8ZmcM.js → abnfDiagram-WEYOIA3C-BXHej1hm.js} +3 -3
  4. package/web/_app/immutable/{apl-C2EDYOM2.js → apl-BFDX0lkW.js} +1 -1
  5. package/web/_app/immutable/{arc-hYiEw9Va.js → arc-Dfz1diSj.js} +3 -3
  6. package/web/_app/immutable/{architecture-WOLXFQ4H-Bviuq5x7.js → architecture-WOLXFQ4H-D0f9GDzo.js} +2 -2
  7. package/web/_app/immutable/{architectureDiagram-ZHVYKT53-_EbTY6Pv.js → architectureDiagram-ZHVYKT53-DpyW3pux.js} +3 -3
  8. package/web/_app/immutable/{array-CeqPvvle.js → array-Exz96UGC.js} +1 -1
  9. package/web/_app/immutable/{asciiarmor-CwCvnlQ3.js → asciiarmor-CQkMLgqd.js} +1 -1
  10. package/web/_app/immutable/{asn1-ud5b3xln.js → asn1-Px0sjJNn.js} +1 -1
  11. package/web/_app/immutable/{asterisk-CKG8tA3I.js → asterisk-28qdzJOw.js} +1 -1
  12. package/web/_app/immutable/{blockDiagram-RJAE7QA3-CEs7FyeO.js → blockDiagram-RJAE7QA3-CsLdlfFz.js} +3 -3
  13. package/web/_app/immutable/{board-3d-scene-DnJqq-jE.js → board-3d-scene-CY2n21rR.js} +1 -1
  14. package/web/_app/immutable/{brainfuck-c4Fp4FqY.js → brainfuck-Cc6D2B0Q.js} +1 -1
  15. package/web/_app/immutable/{c4Diagram-XDPPPE54-CpMdQoUq.js → c4Diagram-XDPPPE54-CCIePFJ-.js} +3 -3
  16. package/web/_app/immutable/{channel-OgIk0q08.js → channel-CAJpaMMc.js} +3 -3
  17. package/web/_app/immutable/{chunk-2E7WHVMD-dnqsElNS.js → chunk-2E7WHVMD-BxroWLug.js} +3 -3
  18. package/web/_app/immutable/{chunk-2Q5K7J3B-CTLSlH2g.js → chunk-2Q5K7J3B-DQjA6tWz.js} +3 -3
  19. package/web/_app/immutable/{chunk-4EMNKR2T-Cr9XVVCG.js → chunk-4EMNKR2T-Cs2YBHYi.js} +3 -3
  20. package/web/_app/immutable/{chunk-55XCU76K-BtssGenK.js → chunk-55XCU76K-Ry8rGGoX.js} +3 -3
  21. package/web/_app/immutable/{chunk-5VM5RSS4-Zhf8rlHL.js → chunk-5VM5RSS4-DXT2hS65.js} +3 -3
  22. package/web/_app/immutable/{chunk-7S6XSTFO-XgTTUsM4.js → chunk-7S6XSTFO-DzYzXXRC.js} +3 -3
  23. package/web/_app/immutable/{chunk-AQDTSKZB-Csih77qg.js → chunk-AQDTSKZB-BeH9OL_4.js} +3 -3
  24. package/web/_app/immutable/{chunk-DSNLSHJZ-JPbExg8v.js → chunk-DSNLSHJZ-Z2c5FQ0X.js} +4 -4
  25. package/web/_app/immutable/{chunk-DUW6YSOI-Dd9NlETm.js → chunk-DUW6YSOI-BgM5wGO1.js} +3 -3
  26. package/web/_app/immutable/{chunk-HAGFOTED-Cft9bbR2.js → chunk-HAGFOTED-BWSxyD0x.js} +3 -3
  27. package/web/_app/immutable/{chunk-HNE4Q36P-4ztqRnHq.js → chunk-HNE4Q36P-V0a6HNb3.js} +3 -3
  28. package/web/_app/immutable/{chunk-J5ZVWO5B-BGrSubY7.js → chunk-J5ZVWO5B-DGHL5OSG.js} +3 -3
  29. package/web/_app/immutable/{chunk-JWPE2WC7-CY94Lc80.js → chunk-JWPE2WC7-DQpfMfQX.js} +3 -3
  30. package/web/_app/immutable/{chunk-NGNAAXSQ-CyJeljag.js → chunk-NGNAAXSQ-DYyBEiFL.js} +1 -1
  31. package/web/_app/immutable/{chunk-NQOKRVIF-BjsUGOPU.js → chunk-NQOKRVIF-B1ophFJ_.js} +3 -3
  32. package/web/_app/immutable/{chunk-UHW7PFBP-BCCsgeU8.js → chunk-UHW7PFBP-MU9ZSSoB.js} +3 -3
  33. package/web/_app/immutable/{chunk-VQ5W62QI-BtglZZRt.js → chunk-VQ5W62QI-BXZATYyU.js} +3 -3
  34. package/web/_app/immutable/{chunk-WQQL4CDK-Cj0kob7n.js → chunk-WQQL4CDK-Cd2f3Uk0.js} +3 -3
  35. package/web/_app/immutable/{chunk-XXDRQBXY-H6Rf6fLc.js → chunk-XXDRQBXY-sfLglx2r.js} +3 -3
  36. package/web/_app/immutable/{chunk-Y2CYZVJY-DXA2PeAW.js → chunk-Y2CYZVJY-D6bkR5RO.js} +1 -1
  37. package/web/_app/immutable/{chunk-YZO67HFG-8JflISf3.js → chunk-YZO67HFG-Cnw1mvWd.js} +3 -3
  38. package/web/_app/immutable/{chunk-ZAUX2LTX-BrhE26vf.js → chunk-ZAUX2LTX-j7KLy1y6.js} +3 -3
  39. package/web/_app/immutable/{chunk-ZCHMQSOR-Ct_RPWAz.js → chunk-ZCHMQSOR-DrOnWujT.js} +4 -4
  40. package/web/_app/immutable/{classDiagram-v2-4MYWR3UA-DsEI2sQ1.js → classDiagram-v2-4MYWR3UA-Zi2wjE8K.js} +3 -3
  41. package/web/_app/immutable/{clike-BYeCKHFc.js → clike-CcjskLs7.js} +1 -1
  42. package/web/_app/immutable/{clojure-DcnVVhQl.js → clojure-zWBh4w6p.js} +1 -1
  43. package/web/_app/immutable/{cmake-Bokwf3jo.js → cmake-BdBpKV5C.js} +1 -1
  44. package/web/_app/immutable/{cobol-DijMFzKK.js → cobol-BL0Tycz5.js} +1 -1
  45. package/web/_app/immutable/{code-highlighting-client-DIK38_ih.js → code-highlighting-client-QF4f-BKb.js} +1 -1
  46. package/web/_app/immutable/{coffeescript-Bxcfbh0i.js → coffeescript-B6XOb3hT.js} +1 -1
  47. package/web/_app/immutable/{commonlisp-HPpahXb-.js → commonlisp-DWIv0x0Z.js} +1 -1
  48. package/web/_app/immutable/{cose-bilkent-JH36ORCC-D6s4RI_k.js → cose-bilkent-JH36ORCC-D8e5UX5C.js} +3 -3
  49. package/web/_app/immutable/{crystal-Bt3HCvkv.js → crystal-ALMBcrYj.js} +1 -1
  50. package/web/_app/immutable/{css-xJW0atu9.js → css-BRtJ1Zvn.js} +1 -1
  51. package/web/_app/immutable/{cynefin-EF2NZ3EQ-bjI9SC8P.js → cynefin-EF2NZ3EQ-D3jARZ4N.js} +2 -2
  52. package/web/_app/immutable/{cynefinDiagram-WF24UDRP-CTd5GUra.js → cynefinDiagram-WF24UDRP-CgTEDNRd.js} +3 -3
  53. package/web/_app/immutable/{cypher-DtLU3rSt.js → cypher-DOqBo_f4.js} +1 -1
  54. package/web/_app/immutable/{cytoscape.esm-CNpivYH3.js → cytoscape.esm-CumUML_k.js} +1 -1
  55. package/web/_app/immutable/{d-RSH32i0-.js → d-ptZmCSMP.js} +1 -1
  56. package/web/_app/immutable/{dagre-NK4GIZVX-CKUvpr6Y.js → dagre-NK4GIZVX-CgNZRbV5.js} +3 -3
  57. package/web/_app/immutable/{defaultLocale-DxB6SmwM.js → defaultLocale-D88G6ST9.js} +1 -1
  58. package/web/_app/immutable/{diagram-CBK3MWTC-Ckz9DP33.js → diagram-CBK3MWTC-Dr69_ZIc.js} +3 -3
  59. package/web/_app/immutable/{diagram-I5XIIV2D-DfCD7vSE.js → diagram-I5XIIV2D-JnTi53KQ.js} +3 -3
  60. package/web/_app/immutable/{diagram-ODIL2UCW-G4uSpxcg.js → diagram-ODIL2UCW-DRHOSCoh.js} +3 -3
  61. package/web/_app/immutable/{diagram-PFBEJUXE-DGQXqEbu.js → diagram-PFBEJUXE-DvARkAUb.js} +3 -3
  62. package/web/_app/immutable/{diagram-RJA3I4VV-C3t_o3t2.js → diagram-RJA3I4VV-C1--ZIRA.js} +3 -3
  63. package/web/_app/immutable/{diagram-TYUNFSNR-DTvVpQgV.js → diagram-TYUNFSNR-DP0AlFvG.js} +3 -3
  64. package/web/_app/immutable/{diff-4FfVxTA-.js → diff-BifsCmsx.js} +1 -1
  65. package/web/_app/immutable/{dist-C3g2pqIM.js → dist-B-0ThB2j.js} +2 -2
  66. package/web/_app/immutable/{dist-CqfsKLw7.js → dist-B6pXwwwf.js} +2 -2
  67. package/web/_app/immutable/{dist-CI0Xp9jw.js → dist-BnoAdmuj.js} +2 -2
  68. package/web/_app/immutable/{dist-sxCib8r5.js → dist-Bq50HA7K.js} +2 -2
  69. package/web/_app/immutable/{dist-CC6EYemP.js → dist-BvPnWJN9.js} +2 -2
  70. package/web/_app/immutable/{dist-DdKBxgSc.js → dist-BwsvGcA3.js} +2 -2
  71. package/web/_app/immutable/{dist-BuW-lwms.js → dist-C1DL8XJw.js} +2 -2
  72. package/web/_app/immutable/{dist-DPwCubp-.js → dist-CIdGn2eC.js} +2 -2
  73. package/web/_app/immutable/{dist-BUzt5rsA.js → dist-COm1gFp6.js} +2 -2
  74. package/web/_app/immutable/{dist-CMg4lkoC.js → dist-CPhjCpPj.js} +2 -2
  75. package/web/_app/immutable/{dist-sb492LiU.js → dist-Cc6EKTJS.js} +2 -2
  76. package/web/_app/immutable/{dist-B-5HZquH.js → dist-CdHr23be.js} +2 -2
  77. package/web/_app/immutable/{dist-BffFdbN6.js → dist-Ch7wN0ap.js} +2 -2
  78. package/web/_app/immutable/{dist-CAAlbTrj.js → dist-CrqTCabe.js} +2 -2
  79. package/web/_app/immutable/{dist-yTkBcYZx.js → dist-CwxlbiRg.js} +2 -2
  80. package/web/_app/immutable/{dist-QhK9sQ5Y.js → dist-D0Eg0Xpn.js} +2 -2
  81. package/web/_app/immutable/{dist-DnfeOv7I.js → dist-D47Es6mM.js} +2 -2
  82. package/web/_app/immutable/{dist-b7RK6STY.js → dist-D7SeKGRV.js} +2 -2
  83. package/web/_app/immutable/{dist-BnuxWsqd.js → dist-DIdWvw6O.js} +2 -2
  84. package/web/_app/immutable/{dist-DTGcaTDp.js → dist-DKtI3nnf.js} +2 -2
  85. package/web/_app/immutable/{dist-DR-H3EmS.js → dist-DQV_DjrP.js} +2 -2
  86. package/web/_app/immutable/{dist-C7NNhl_k.js → dist-DoZbgbiv.js} +2 -2
  87. package/web/_app/immutable/{dist-DuJbg3S7.js → dist-gU-1ReT6.js} +2 -2
  88. package/web/_app/immutable/{dockerfile-pV8uFSyT.js → dockerfile-BtrVkOAn.js} +2 -2
  89. package/web/_app/immutable/{dtd-BSeTEnUo.js → dtd-Cyx_R579.js} +1 -1
  90. package/web/_app/immutable/{dylan-BxbssTY3.js → dylan-CDdi0Wv5.js} +1 -1
  91. package/web/_app/immutable/{ebnf-DjTRAnBo.js → ebnf-C8DcHply.js} +1 -1
  92. package/web/_app/immutable/{ebnfDiagram-V4P3TTPT-DyNH07PJ.js → ebnfDiagram-V4P3TTPT-CodNk1Qz.js} +3 -3
  93. package/web/_app/immutable/{ecl-CoJF8vMc.js → ecl-BEXyvSX7.js} +1 -1
  94. package/web/_app/immutable/{eiffel-BjoaCCfc.js → eiffel-DDawbYVm.js} +1 -1
  95. package/web/_app/immutable/{elk-QONTBCTQ-iAFm062C.js → elk-QONTBCTQ-C_pQmLGi.js} +3 -3
  96. package/web/_app/immutable/{elm-Bkj78qkt.js → elm-C3-bXtQW.js} +1 -1
  97. package/web/_app/immutable/{erDiagram-KYQIGQAA-DDsxiPqj.js → erDiagram-KYQIGQAA-Cl5hrQfm.js} +3 -3
  98. package/web/_app/immutable/{erlang-D59wkOqj.js → erlang-CZ_ddMf1.js} +1 -1
  99. package/web/_app/immutable/{eventmodeling-K75KTNOO-CPqynPrx.js → eventmodeling-K75KTNOO-kuWwx7J_.js} +2 -2
  100. package/web/_app/immutable/{factor-Bt-zIwaB.js → factor-XLG2s_97.js} +2 -2
  101. package/web/_app/immutable/{fcl-Su3oFFGy.js → fcl-DU2EqM5m.js} +1 -1
  102. package/web/_app/immutable/flowDiagram-IUGLLWBU-CI9lrszH.js +3 -0
  103. package/web/_app/immutable/{forth-DPT4wJ0u.js → forth-BtCTTAR7.js} +1 -1
  104. package/web/_app/immutable/{fortran-B5ZewhTs.js → fortran-CmaLbEVV.js} +1 -1
  105. package/web/_app/immutable/{ganttDiagram-R7GPNTJY-CHgRcDA7.js → ganttDiagram-R7GPNTJY-CRzXGdKW.js} +3 -3
  106. package/web/_app/immutable/{gas-DolN316C.js → gas-C4y07Z0c.js} +1 -1
  107. package/web/_app/immutable/{gherkin-9ADRv3F4.js → gherkin-nX01VV9q.js} +1 -1
  108. package/web/_app/immutable/{gitGraph-VSP46ZUC-CiPnRLSI.js → gitGraph-VSP46ZUC-BRX_giiU.js} +2 -2
  109. package/web/_app/immutable/{gitGraphDiagram-PDYL7XHY-Ca50uar7.js → gitGraphDiagram-PDYL7XHY-BEV5g024.js} +3 -3
  110. package/web/_app/immutable/{graphlib-DLjMBfjO.js → graphlib-Dj46vQQK.js} +1 -1
  111. package/web/_app/immutable/{groovy-B3aKkvex.js → groovy-fVNFdqe3.js} +1 -1
  112. package/web/_app/immutable/{haskell-M2ez575P.js → haskell-Am60Te_b.js} +1 -1
  113. package/web/_app/immutable/{haxe-Bk9ZKzt8.js → haxe-2mpAPFJ0.js} +1 -1
  114. package/web/_app/immutable/{http-CiDkxqOb.js → http-Bxrr3qdZ.js} +1 -1
  115. package/web/_app/immutable/{idl-LL4drwBm.js → idl-BLpqCdDM.js} +1 -1
  116. package/web/_app/immutable/index-C3Rri6h1.js +1955 -0
  117. package/web/_app/immutable/index-YtIaSO5M.css +1 -0
  118. package/web/_app/immutable/{info-OHQRW6UA-DaB3jIQY.js → info-OHQRW6UA-_YRL3G_Z.js} +2 -2
  119. package/web/_app/immutable/{infoDiagram-MVDRKAX5-sjprSTT3.js → infoDiagram-MVDRKAX5-CXoWGXhT.js} +3 -3
  120. package/web/_app/immutable/{init-D7bQrGTf.js → init-0Rsw8nLX.js} +1 -1
  121. package/web/_app/immutable/{ishikawaDiagram-HPEHV2GE-BFzGEnTH.js → ishikawaDiagram-HPEHV2GE-DWNsnluo.js} +3 -3
  122. package/web/_app/immutable/{javascript-DdS-nY7V.js → javascript-DnLASQ8a.js} +1 -1
  123. package/web/_app/immutable/{journeyDiagram-BOSHW7O7-ophNh21m.js → journeyDiagram-BOSHW7O7-j_ypXIZ9.js} +3 -3
  124. package/web/_app/immutable/json-render-view-CzmxnANK.js +178 -0
  125. package/web/_app/immutable/{julia-DZAu-uZ_.js → julia-B-nDWULd.js} +1 -1
  126. package/web/_app/immutable/{kanban-definition-FNSA4HC5-DerYr1wR.js → kanban-definition-FNSA4HC5-DBXyV0fk.js} +3 -3
  127. package/web/_app/immutable/{katex-B4ejBZLo.js → katex-CNNLMICA.js} +1 -1
  128. package/web/_app/immutable/{line-BcyKDPTs.js → line-DtvLGSr3.js} +3 -3
  129. package/web/_app/immutable/{linear-2cYC5ltX.js → linear-B_p1nlgy.js} +3 -3
  130. package/web/_app/immutable/{livescript-DffcKazj.js → livescript-cgviRHTR.js} +1 -1
  131. package/web/_app/immutable/{lua-CPhvhKsg.js → lua-Bt1TOjbI.js} +1 -1
  132. package/web/_app/immutable/{mathematica-BRZYuqFt.js → mathematica-C1fCF-pK.js} +1 -1
  133. package/web/_app/immutable/{mbox-Dqfqg6K0.js → mbox-YazAjmWT.js} +1 -1
  134. package/web/_app/immutable/{mermaid-parser.core-DhZWZXzW.js → mermaid-parser.core-Bj4N_5ia.js} +4 -4
  135. package/web/_app/immutable/{mermaid.core-Bn-MO58Z.js → mermaid.core-Bg-WC5Kf.js} +6 -6
  136. package/web/_app/immutable/{mindmap-definition-6OY57UG3-B_V0owuj.js → mindmap-definition-6OY57UG3-Ht5L7uSR.js} +3 -3
  137. package/web/_app/immutable/{mirc-DYE6g9Yc.js → mirc-ChiMGZ1q.js} +1 -1
  138. package/web/_app/immutable/{mllike-C7OBPxnB.js → mllike-etSVcvm6.js} +1 -1
  139. package/web/_app/immutable/{modelica-D4Z13Mv7.js → modelica-D3DdZ_9o.js} +1 -1
  140. package/web/_app/immutable/{mscgen-DyD9TPSI.js → mscgen-ByZ8Oc7q.js} +1 -1
  141. package/web/_app/immutable/{mumps-DsOvdFde.js → mumps-m_LJXU8f.js} +1 -1
  142. package/web/_app/immutable/{nginx-V3cgyjK-.js → nginx-BAMWPIvN.js} +1 -1
  143. package/web/_app/immutable/{nsis-D0B3LJ6C.js → nsis-SLSAWbM9.js} +2 -2
  144. package/web/_app/immutable/{ntriples-DNuIP-3z.js → ntriples-Isr2eMwg.js} +1 -1
  145. package/web/_app/immutable/{octave-9xS56dfr.js → octave-CFGwI_pW.js} +1 -1
  146. package/web/_app/immutable/{ordinal-CWrm7xtN.js → ordinal-C-dZyy7N.js} +3 -3
  147. package/web/_app/immutable/{oz-DO-AO-RO.js → oz-B-TrVbZS.js} +1 -1
  148. package/web/_app/immutable/{packet-JDAUHWVQ-CpXfrzkq.js → packet-JDAUHWVQ-Clxg99ti.js} +2 -2
  149. package/web/_app/immutable/{pascal-MyM2FJOj.js → pascal-xP5hur0P.js} +1 -1
  150. package/web/_app/immutable/{path-Ci7s6AG5.js → path-KIu7vHD1.js} +1 -1
  151. package/web/_app/immutable/{pegDiagram-ECIUJNBX-OrD2m_zD.js → pegDiagram-ECIUJNBX-C7moBDNV.js} +3 -3
  152. package/web/_app/immutable/{perl-H_wp7YOs.js → perl-kQQ-rLK4.js} +1 -1
  153. package/web/_app/immutable/{pie-XZMESJXO-DvYSSWV3.js → pie-XZMESJXO-TWjrXx8Q.js} +2 -2
  154. package/web/_app/immutable/{pieDiagram-GNMPY74T-BUcG21Pd.js → pieDiagram-GNMPY74T-DMt0HgDY.js} +3 -3
  155. package/web/_app/immutable/{pig-B_q9AORX.js → pig-BHribV2U.js} +1 -1
  156. package/web/_app/immutable/{powershell-DzwMRwEW.js → powershell-dK77zs0q.js} +1 -1
  157. package/web/_app/immutable/{properties-CvCDgreS.js → properties-BzjbC_2c.js} +1 -1
  158. package/web/_app/immutable/{protobuf-BlU0_yts.js → protobuf-ChRePd4I.js} +1 -1
  159. package/web/_app/immutable/{pug-Bq-NJArK.js → pug-CrP97q7v.js} +2 -2
  160. package/web/_app/immutable/{puppet-CPa4V8XA.js → puppet-BPOW9V12.js} +1 -1
  161. package/web/_app/immutable/{python-C0kcJRF3.js → python-e3DADkGZ.js} +1 -1
  162. package/web/_app/immutable/{q-BsfL6RGl.js → q-BDl2sq45.js} +1 -1
  163. package/web/_app/immutable/{quadrantDiagram-D57K4MC3-CVd20agD.js → quadrantDiagram-D57K4MC3-CfyLecK6.js} +3 -3
  164. package/web/_app/immutable/{r-BwaUrbPE.js → r-BHnopXdY.js} +1 -1
  165. package/web/_app/immutable/{radar-ABXABTNO-DVXbk8ny.js → radar-ABXABTNO-Dqi_Hjtv.js} +2 -2
  166. package/web/_app/immutable/{railroad-I3PHUGI6-B-d9uCRI.js → railroad-I3PHUGI6-BNvdQ8tr.js} +2 -2
  167. package/web/_app/immutable/{railroad-abnf-LNEFI6M7-B53t0zMz.js → railroad-abnf-LNEFI6M7-p3rwXDkj.js} +2 -2
  168. package/web/_app/immutable/{railroad-ebnf-DWYD2UWJ-DzR2Cer4.js → railroad-ebnf-DWYD2UWJ-QW7lHEzZ.js} +2 -2
  169. package/web/_app/immutable/{railroad-peg-JR7BVNR7-CiCX4OTW.js → railroad-peg-JR7BVNR7-2gZasFLF.js} +2 -2
  170. package/web/_app/immutable/{railroadDiagram-Y72NRBL7-HttnVoqz.js → railroadDiagram-Y72NRBL7-BGBw3jID.js} +3 -3
  171. package/web/_app/immutable/{requirementDiagram-EQYSW5RA-wPzPRWNn.js → requirementDiagram-EQYSW5RA-AW8mGp3t.js} +3 -3
  172. package/web/_app/immutable/{rolldown-runtime-DpAGH10J.js → rolldown-runtime-BorFIzZJ.js} +1 -1
  173. package/web/_app/immutable/{rough.esm-Whrw8iSy.js → rough.esm-D9sYYDhQ.js} +1 -1
  174. package/web/_app/immutable/{rpm-BGQP6Sig.js → rpm-BdsfK4FK.js} +1 -1
  175. package/web/_app/immutable/{ruby-GhSPXQpI.js → ruby-D7aAIAiF.js} +1 -1
  176. package/web/_app/immutable/{sankeyDiagram-SY24JHO5-iXa6PWzS.js → sankeyDiagram-SY24JHO5-B3g2eQU9.js} +3 -3
  177. package/web/_app/immutable/{sas-DO8POFDf.js → sas-BjR6dQlr.js} +1 -1
  178. package/web/_app/immutable/{scheme-CcjqHmxi.js → scheme-BZia4ZBS.js} +1 -1
  179. package/web/_app/immutable/{sequenceDiagram-BLEHNHQU-C406STJZ.js → sequenceDiagram-BLEHNHQU-end-F8aH.js} +3 -3
  180. package/web/_app/immutable/{shell-EXt7ZZm9.js → shell-BTVXtOjE.js} +1 -1
  181. package/web/_app/immutable/{sieve-CCXhM3HN.js → sieve-CK_pFfTY.js} +1 -1
  182. package/web/_app/immutable/{simple-mode-BjYcVrY6.js → simple-mode-lpKMIfct.js} +1 -1
  183. package/web/_app/immutable/{sizeCapture-INFHLROL-B2gqtgMi.js → sizeCapture-INFHLROL-CWXX-gwL.js} +3 -3
  184. package/web/_app/immutable/{smalltalk-B1J4NWMY.js → smalltalk-B9-F9F_X.js} +1 -1
  185. package/web/_app/immutable/{solr-B_2o8tJn.js → solr-HovTmTDw.js} +1 -1
  186. package/web/_app/immutable/{sparql-BrkwSdt3.js → sparql-D15JOdLE.js} +1 -1
  187. package/web/_app/immutable/{spreadsheet-hIShpyL4.js → spreadsheet-DzqANOvG.js} +1 -1
  188. package/web/_app/immutable/{sql-4uhh_Qqa.js → sql-BfN529QS.js} +1 -1
  189. package/web/_app/immutable/{src-UksNOXkQ.js → src-CkFC5JIw.js} +3 -3
  190. package/web/_app/immutable/{stateDiagram-v2-A6IESKWZ-Cqo6pHnc.js → stateDiagram-v2-A6IESKWZ-DvrTsCrq.js} +3 -3
  191. package/web/_app/immutable/{stex-CThFIHHN.js → stex-Byvv2w3Q.js} +1 -1
  192. package/web/_app/immutable/{stylus-CQ_m4YV3.js → stylus-DhIitb68.js} +1 -1
  193. package/web/_app/immutable/{swift-CkVzKVod.js → swift-B2ob9eys.js} +1 -1
  194. package/web/_app/immutable/{swimlanes-B3ENRKFQ-L6aKuwPP.js → swimlanes-B3ENRKFQ-0g5egyDD.js} +3 -3
  195. package/web/_app/immutable/swimlanesDiagram-AYQRV4AK-D2aqgxSr.js +10 -0
  196. package/web/_app/immutable/{tcl-DFuxE83t.js → tcl-Bjsf3fWc.js} +1 -1
  197. package/web/_app/immutable/{textile-WuzfluTF.js → textile-xvl3kbWr.js} +1 -1
  198. package/web/_app/immutable/{tiddlywiki-BvyiqOkC.js → tiddlywiki-FsJFUUTz.js} +1 -1
  199. package/web/_app/immutable/{tiki-BMuCKC5u.js → tiki-Cy2wUG9S.js} +1 -1
  200. package/web/_app/immutable/{timeline-definition-JXYKGLGB-DjBQ2003.js → timeline-definition-JXYKGLGB-C0re41tm.js} +3 -3
  201. package/web/_app/immutable/{toml-wcAitvar.js → toml-CSg4SR3L.js} +1 -1
  202. package/web/_app/immutable/{treeView-D4JQ5SDB-CCAq61j9.js → treeView-D4JQ5SDB-C-L-xfb7.js} +2 -2
  203. package/web/_app/immutable/{treemap-SAJKECNS-BP_EI9bd.js → treemap-SAJKECNS-CpyM6fOb.js} +2 -2
  204. package/web/_app/immutable/{troff-Cl4SvEKi.js → troff-C1BazigL.js} +1 -1
  205. package/web/_app/immutable/{ttcn-cfg-C3X6MYW3.js → ttcn-cfg-xifjQySV.js} +1 -1
  206. package/web/_app/immutable/{ttcn-vSiZz51s.js → ttcn-zWm21rzb.js} +1 -1
  207. package/web/_app/immutable/{turtle-DzurLEvV.js → turtle-GPQMiRif.js} +1 -1
  208. package/web/_app/immutable/{usecaseDiagram-WPOLBNNX-B-0mpuSG.js → usecaseDiagram-WPOLBNNX-Bp6D2qdr.js} +3 -3
  209. package/web/_app/immutable/{vb-CMRwCB3E.js → vb-DS1KUI9Z.js} +1 -1
  210. package/web/_app/immutable/{vbscript-BZWXRfJV.js → vbscript-i1oAIoMw.js} +1 -1
  211. package/web/_app/immutable/{velocity-DH5xmBFh.js → velocity-C74fTdaJ.js} +1 -1
  212. package/web/_app/immutable/{vennDiagram-Q3Y3IDCW-DpLkI15K.js → vennDiagram-Q3Y3IDCW-PjH_wCst.js} +3 -3
  213. package/web/_app/immutable/{verilog-fhfN6R37.js → verilog-CJpkFufT.js} +1 -1
  214. package/web/_app/immutable/{vhdl-BSCZ3pac.js → vhdl-C-qMwPcx.js} +1 -1
  215. package/web/_app/immutable/{wardley-7MLQ67FV-B8Rqp5dp.js → wardley-7MLQ67FV-B2YFGokQ.js} +2 -2
  216. package/web/_app/immutable/{wardleyDiagram-IVAIDKWA-DiD2eT5B.js → wardleyDiagram-IVAIDKWA-CXr7PMhY.js} +3 -3
  217. package/web/_app/immutable/{webidl-CXk0BfuC.js → webidl-mHwOZNCd.js} +1 -1
  218. package/web/_app/immutable/wiring-view-Alot3tKS.js +3 -0
  219. package/web/_app/immutable/{xquery-D7LAXmGG.js → xquery-BpYSQ1oZ.js} +1 -1
  220. package/web/_app/immutable/{xychartDiagram-4URNHDU4-W6cJYY7O.js → xychartDiagram-4URNHDU4-3O5b7ZCP.js} +3 -3
  221. package/web/_app/immutable/{yacas-BwOQAk7Q.js → yacas-Btga5z6U.js} +1 -1
  222. package/web/_app/immutable/{z80-BqMjK37S.js → z80-kGma2xtF.js} +1 -1
  223. package/web/index.html +3 -3
  224. package/web/_app/immutable/flowDiagram-IUGLLWBU-DYS8Xnyf.js +0 -3
  225. package/web/_app/immutable/index-BOo1x2Z5.js +0 -1954
  226. package/web/_app/immutable/index-BpWNd2h-.css +0 -1
  227. package/web/_app/immutable/json-render-view-CGYtQNG9.js +0 -177
  228. package/web/_app/immutable/swimlanesDiagram-AYQRV4AK-B_SXVmGq.js +0 -10
@@ -0,0 +1,178 @@
1
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e._posthogReleaseId=e._posthogReleaseId||"01a1d4e7-1d7c-0000-936b-9f26fd0186d7";var n=(new e.Error).stack;n&&(e._posthogChunkIds=e._posthogChunkIds||{},e._posthogChunkIds[n]="ba2b165a-e69b-59dd-b251-34b3dcf35212")}catch(e){}}();
2
+ import{i as e}from"./rolldown-runtime-BorFIzZJ.js";import{H as t,J as n,X as r,Y as i,_t as a,at as o,ct as s,dt as c,et as l,ft as u,gt as d,ht as f,it as p,lt as m,mt as h,ot as g,pt as _,rt as v,st as y,ut as b,vt as x,yt as S}from"./index-C3Rri6h1.js";var C=d([f(),c(),y(),p(),u({$state:f()})]);d([f(),u({$state:f()})]),d([c(),u({$state:f()})]),d([y(),u({$state:f()})]);function w(e,t){if(e!=null)return typeof e==`object`&&`$state`in e?D(t,e.$state):e}function T(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}function E(e){return(e.startsWith(`/`)?e.slice(1).split(`/`):e.split(`/`)).map(T)}function D(e,t){if(!t||t===`/`)return e;let n=E(t),r=e;for(let e of n){if(r==null)return;if(Array.isArray(r))r=r[parseInt(e,10)];else if(typeof r==`object`&&Object.hasOwn(r,e))r=r[e];else return}return r}function O(e,t){if(typeof e==`string`)return e;if(t!=null)return e.$item===``||e.$item===`/`?t:A(t,e.$item)}function k(e,t){return A(e,String(t))}function A(e,t){let n=t.startsWith(`/`)?t.slice(1):t;return e===``||e===`/`?`/${n}`:`${e}/${n}`}function j(e,t,n){let r=E(t);if(r.length===0)return e;let i={...e},a=i;for(let e=0;e<r.length-1;e++){let t=r[e],n=a[t];if(Array.isArray(n))a[t]=[...n];else if(typeof n==`object`&&n)a[t]={...n};else{let n=r[e+1];a[t]=n!==void 0&&/^\d+$/.test(n)?[]:{}}a=a[t]}let o=r[r.length-1];return Array.isArray(a)?o===`-`?a.push(n):a[parseInt(o,10)]=n:a[o]=n,i}function M(e={}){let t={...e},n=new Set;function r(){for(let e of n)e()}return{get(e){return D(t,e)},set(e,n){D(t,e)!==n&&(t=j(t,e,n),r())},update(e){let n=!1,i=t;for(let[t,r]of Object.entries(e))D(i,t)!==r&&(i=j(i,t,r),n=!0);n&&(t=i,r())},getSnapshot(){return t},getServerSnapshot(){return t},subscribe(e){return n.add(e),()=>{n.delete(e)}}}}var N=20;function P(e,t=``,n=0,r,i){let a=r??new Set,o=i??{current:!1},s={};for(let[r,i]of Object.entries(e)){let e=`${t}/${r}`;n<N&&typeof i==`object`&&i&&!Array.isArray(i)&&Object.getPrototypeOf(i)===Object.prototype&&!a.has(i)?(a.add(i),Object.assign(s,P(i,e,n+1,a,o))):s[e]=i}return s}var F=d([c(),u({$state:f()})]),I={eq:a().optional(),neq:a().optional(),gt:F.optional(),gte:F.optional(),lt:F.optional(),lte:F.optional(),not:b(!0).optional()},L=u({$state:f(),...I}),ee=u({$item:f(),...I}),te=u({$index:b(!0),...I}),ne=d([L,ee,te]),R=m(()=>d([y(),ne,g(ne),u({$and:g(R)}),u({$or:g(R)})])),re=d([h({$state:f(),...I}),h({$item:f(),...I}),h({$index:b(!0),...I})]);function z(e){return e===void 0||typeof e==`boolean`?!1:Array.isArray(e)?e.some(z):typeof e!=`object`||!e?!1:`$item`in e||`$index`in e?!0:`$and`in e?e.$and.some(z):`$or`in e&&e.$or.some(z)}function ie(e){if(e===void 0||!z(e))return{container:e,itemFilter:void 0};let t=e=>{let t=e.filter(e=>!z(e)),n=e.filter(e=>z(e));return{container:t.length>0?{$and:t}:void 0,itemFilter:n.length>0?{$and:n}:void 0}};return Array.isArray(e)?t(e):typeof e==`object`&&e&&`$and`in e?t(e.$and):{container:void 0,itemFilter:e}}var ae=m(()=>d([y(),re,g(re),h({$and:g(ae)}),h({$or:g(ae)})]));function oe(e,t){return typeof e==`object`&&e&&`$state`in e&&typeof e.$state==`string`?D(t.stateModel,e.$state):e}function se(e){return`$item`in e}function B(e){return`$index`in e}function ce(e,t){return B(e)?t.repeatIndex:se(e)?t.repeatItem===void 0?void 0:e.$item===``?t.repeatItem:D(t.repeatItem,e.$item):D(t.stateModel,e.$state)}function le(e,t){let n=ce(e,t),r;if(e.eq!==void 0)r=n===oe(e.eq,t);else if(e.neq!==void 0)r=n!==oe(e.neq,t);else if(e.gt!==void 0){let i=oe(e.gt,t);r=typeof n==`number`&&typeof i==`number`&&n>i}else if(e.gte!==void 0){let i=oe(e.gte,t);r=typeof n==`number`&&typeof i==`number`&&n>=i}else if(e.lt!==void 0){let i=oe(e.lt,t);r=typeof n==`number`&&typeof i==`number`&&n<i}else if(e.lte!==void 0){let i=oe(e.lte,t);r=typeof n==`number`&&typeof i==`number`&&n<=i}else r=!!n;return e.not===!0?!r:r}function ue(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&`$and`in e}function de(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&`$or`in e}function fe(e,t){return e===void 0?!0:typeof e==`boolean`?e:Array.isArray(e)?e.every(e=>le(e,t)):ue(e)?e.$and.every(e=>fe(e,t)):de(e)?e.$or.some(e=>fe(e,t)):le(e,t)}function pe(e){let t=new Map;for(let n of e)t.set(n.name,n);return t}function me(e,t){if(!t||t.size===0)return;let n;for(let[r,i]of t)if(r in e){if(n)throw Error(`Ambiguous directive: object has multiple directive keys ("${n.name}" and "${r}")`);n=i}return n}function he(e){return typeof e==`object`&&!!e&&`$state`in e&&typeof e.$state==`string`}function ge(e){return typeof e==`object`&&!!e&&`$item`in e&&typeof e.$item==`string`}function _e(e){return typeof e==`object`&&!!e&&`$index`in e&&e.$index===!0}function ve(e){return typeof e==`object`&&!!e&&`$bindState`in e&&typeof e.$bindState==`string`}function ye(e){return typeof e==`object`&&!!e&&`$bindItem`in e&&typeof e.$bindItem==`string`}function be(e){return typeof e==`object`&&!!e&&`$cond`in e&&`$then`in e&&`$else`in e}function xe(e){return typeof e==`object`&&!!e&&`$computed`in e&&typeof e.$computed==`string`}function Se(e){return typeof e==`object`&&!!e&&`$template`in e&&typeof e.$template==`string`}var Ce=100,we=new Set;function Te(e,t){if(t.repeatBasePath==null)console.warn(`$bindItem used outside repeat scope: "${e}"`);else return e===``?t.repeatBasePath:t.repeatBasePath+`/`+e}function Ee(e,t){if(e==null)return e;if(he(e))return D(t.stateModel,e.$state);if(ge(e))return t.repeatItem===void 0?void 0:e.$item===``?t.repeatItem:D(t.repeatItem,e.$item);if(_e(e))return t.repeatIndex;if(ve(e))return D(t.stateModel,e.$bindState);if(ye(e)){let n=Te(e.$bindItem,t);return n===void 0?void 0:D(t.stateModel,n)}if(be(e))return Ee(fe(e.$cond,t)?e.$then:e.$else,t);if(xe(e)){let n=t.functions?.[e.$computed];if(!n){we.has(e.$computed)||(we.size<Ce&&we.add(e.$computed),console.warn(`Unknown $computed function: "${e.$computed}"`));return}let r={};if(e.args)for(let[n,i]of Object.entries(e.args))r[n]=Ee(i,t);return n(r)}if(Se(e))return e.$template.replace(/\$\{([^}]+)\}/g,(e,n)=>{if(n.startsWith(`/`)){let e=D(t.stateModel,n);return e==null?``:String(e)}if(t.repeatItem!==void 0){let e=D(t.repeatItem,n);if(e!=null)return String(e)}let r=D(t.stateModel,`/`+n);return r==null?``:String(r)});if(Array.isArray(e))return e.map(e=>Ee(e,t));if(typeof e==`object`){let n=me(e,t.directives);if(n)return n.resolve(e,t);let r={};for(let[n,i]of Object.entries(e))r[n]=Ee(i,t);return r}return e}function De(e,t){let n={};for(let[r,i]of Object.entries(e))n[r]=Ee(i,t);return n}function Oe(e,t){let n;for(let[r,i]of Object.entries(e))if(ve(i))n||={},n[r]=i.$bindState;else if(ye(i)){let e=Te(i.$bindItem,t);e!==void 0&&(n||={},n[r]=e)}return n}function ke(e,t){return ge(e)?Te(e.$item,t):_e(e)?t.repeatIndex:Ee(e,t)}var Ae=new Set;function je(e){for(let t of Ae){let n=t.onDispatch;if(n)try{n(e)}catch{}}}function Me(e){for(let t of Ae){let n=t.onSettle;if(n)try{n(e)}catch{}}}var Ne=0;function Pe(){return Ne+=1,`${Date.now()}-${Ne}`}var Fe=0,Ie=new Set;function Le(){return Fe>0}function Re(e){return Ie.add(e),()=>{Ie.delete(e)}}var ze=u({title:f(),message:f(),confirmLabel:f().optional(),cancelLabel:f().optional(),variant:v([`default`,`danger`]).optional()}),Be=d([u({navigate:f()}),u({set:_(f(),a())}),u({action:f(),params:_(f(),C).optional()})]),Ve=d([u({set:_(f(),a())}),u({action:f(),params:_(f(),C).optional()})]),He=u({action:f(),params:_(f(),C).optional(),confirm:ze.optional(),onSuccess:Be.optional(),onError:Ve.optional(),preventDefault:y().optional()});function Ue(e,t){let n={};if(e.params)for(let[r,i]of Object.entries(e.params))n[r]=w(i,t);let r=e.confirm;return r&&={...r,message:We(r.message,t),title:We(r.title,t)},{action:e.action,params:n,confirm:r,onSuccess:e.onSuccess,onError:e.onError}}function We(e,t){return e.replace(/\$\{([^}]+)\}/g,(e,n)=>{let r=w({$state:n},t);return String(r??``)})}async function Ge(e){let{action:t,handler:n,setState:r,navigate:i,executeAction:a}=e;try{if(await n(t.params),t.onSuccess){if(`navigate`in t.onSuccess&&i)i(t.onSuccess.navigate);else if(`set`in t.onSuccess)for(let[e,n]of Object.entries(t.onSuccess.set))r(e,n);else`action`in t.onSuccess&&a&&await a(t.onSuccess)}}catch(e){if(t.onError){if(`set`in t.onError)for(let[n,i]of Object.entries(t.onError.set))r(n,typeof i==`string`&&i===`$error.message`?e.message:i);else`action`in t.onError&&a&&await a(t.onError)}else throw e}}var Ke=u({type:f(),args:_(f(),C).optional(),message:f()});u({checks:g(Ke).optional(),validateOn:v([`change`,`blur`,`submit`]).optional(),enabled:R.optional()});var qe=(e,t)=>e===t?.other,Je={required:e=>e==null?!1:typeof e==`string`?e.trim().length>0:!Array.isArray(e)||e.length>0,email:e=>typeof e==`string`&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e),minLength:(e,t)=>{if(typeof e!=`string`)return!1;let n=t?.min;return typeof n==`number`&&e.length>=n},maxLength:(e,t)=>{if(typeof e!=`string`)return!1;let n=t?.max;return typeof n==`number`&&e.length<=n},pattern:(e,t)=>{if(typeof e!=`string`)return!1;let n=t?.pattern;if(typeof n!=`string`)return!1;try{return new RegExp(n).test(e)}catch{return!1}},min:(e,t)=>{if(typeof e!=`number`)return!1;let n=t?.min;return typeof n==`number`&&e>=n},max:(e,t)=>{if(typeof e!=`number`)return!1;let n=t?.max;return typeof n==`number`&&e<=n},numeric:e=>typeof e==`number`?!isNaN(e):typeof e==`string`&&e.trim()!==``&&!isNaN(Number(e)),url:e=>{if(typeof e!=`string`)return!1;try{return new URL(e),!0}catch{return!1}},matches:qe,equalTo:qe,lessThan:(e,t)=>{let n=t?.other;if(e==null||n==null||e===``||n===``)return!1;if(typeof e==`number`&&typeof n==`number`||typeof e==`string`&&typeof n==`string`)return e<n;let r=Number(e),i=Number(n);return!isNaN(r)&&!isNaN(i)&&r<i},greaterThan:(e,t)=>{let n=t?.other;if(e==null||n==null||e===``||n===``)return!1;if(typeof e==`number`&&typeof n==`number`||typeof e==`string`&&typeof n==`string`)return e>n;let r=Number(e),i=Number(n);return!isNaN(r)&&!isNaN(i)&&r>i},requiredIf:(e,t)=>t?.field?e==null?!1:typeof e==`string`?e.trim().length>0:!Array.isArray(e)||e.length>0:!0};function Ye(e,t){let{value:n,stateModel:r,customFunctions:i}=t,a={};if(e.args)for(let[t,n]of Object.entries(e.args))a[t]=Ee(n,{stateModel:r});let o=Je[e.type]??i?.[e.type];if(!o)return console.warn(`Unknown validation function: ${e.type}`),{type:e.type,valid:!0,message:e.message};let s=o(n,a);return{type:e.type,valid:s,message:e.message}}function Xe(e,t){let n=[],r=[];if(e.enabled&&!fe(e.enabled,{stateModel:t.stateModel}))return{valid:!0,errors:[],checks:[]};if(e.checks)for(let i of e.checks){let e=Ye(i,t);n.push(e),e.valid||r.push(e.message)}return{valid:r.length===0,errors:r,checks:n}}var Ze=[`patch`];function Qe(e){return e?.modes?.length?e.modes:Ze}function $e(){return`PATCH MODE (RFC 6902 JSON Patch):
3
+ Output one JSON object per line. Each line is a patch operation.
4
+ - Add: {"op":"add","path":"/elements/new-key","value":{...}}
5
+ - Replace: {"op":"replace","path":"/elements/existing-key","value":{...}}
6
+ - Remove: {"op":"remove","path":"/elements/old-key"}
7
+ Only output patches for what needs to change.`}function et(){return`MERGE MODE (RFC 7396 JSON Merge Patch):
8
+ Output a single JSON object on one line with __json_edit set to true.
9
+ Include only the keys that changed. Unmentioned keys are preserved.
10
+ Set a key to null to delete it.
11
+
12
+ Example (update a title and add an element):
13
+ {"__json_edit":true,"elements":{"main":{"props":{"title":"New Title"}},"new-el":{"type":"Card","props":{},"children":[]}}}
14
+
15
+ Example (delete an element):
16
+ {"__json_edit":true,"elements":{"old-widget":null}}`}function tt(){return`DIFF MODE (unified diff):
17
+ Output a unified diff inside a \`\`\`diff code fence.
18
+ The diff applies against the JSON-serialized current spec.
19
+
20
+ Example:
21
+ \`\`\`diff
22
+ --- a/spec.json
23
+ +++ b/spec.json
24
+ @@ -3,1 +3,1 @@
25
+ - "title": "Login"
26
+ + "title": "Welcome Back"
27
+ \`\`\``}function nt(){return'PATCH MODE (RFC 6902 JSON Patch):\nOutput RFC 6902 JSON Patch lines inside a ```yaml-patch code fence.\nEach line is one JSON patch operation.\n\nExample:\n```yaml-patch\n{"op":"replace","path":"/elements/main/props/title","value":"New Title"}\n{"op":"add","path":"/elements/new-el","value":{"type":"Card","props":{},"children":[]}}\n```'}function rt(){return`MERGE MODE (RFC 7396 JSON Merge Patch):
28
+ Output only the changed parts in a \`\`\`yaml-edit code fence.
29
+ Uses deep merge semantics: only keys you include are updated. Unmentioned elements and props are preserved.
30
+ Set a key to null to delete it.
31
+
32
+ Example edit (update title, add a new element):
33
+ \`\`\`yaml-edit
34
+ elements:
35
+ main:
36
+ props:
37
+ title: Updated Title
38
+ new-chart:
39
+ type: Card
40
+ props: {}
41
+ children: []
42
+ \`\`\`
43
+
44
+ Example deletion:
45
+ \`\`\`yaml-edit
46
+ elements:
47
+ old-widget: null
48
+ \`\`\``}function it(){return`DIFF MODE (unified diff):
49
+ Output a unified diff inside a \`\`\`diff code fence.
50
+ The diff applies against the YAML-serialized current spec.
51
+
52
+ Example:
53
+ \`\`\`diff
54
+ --- a/spec.yaml
55
+ +++ b/spec.yaml
56
+ @@ -6,1 +6,1 @@
57
+ - title: Login
58
+ + title: Welcome Back
59
+ \`\`\``}function at(e){if(e.length===1)return``;let t=[`Choose the best edit strategy for the requested change:`];return e.includes(`patch`)&&t.push(`- PATCH: best for precise, targeted single-field updates`),e.includes(`merge`)&&t.push(`- MERGE: best for structural changes (add/remove elements, reparent children, update multiple props at once)`),e.includes(`diff`)&&t.push(`- DIFF: best for small text-level changes when you can see the exact lines to change`),t.join(`
60
+ `)}function ot(e,t){let n=Qe(e),r=[];r.push(`EDITING EXISTING SPECS:`),r.push(``);let i=at(n);i&&(r.push(i),r.push(``));for(let e of n){if(t===`json`)switch(e){case`patch`:r.push($e());break;case`merge`:r.push(et());break;case`diff`:r.push(tt())}else switch(e){case`patch`:r.push(nt());break;case`merge`:r.push(rt());break;case`diff`:r.push(it())}r.push(``)}return r.join(`
61
+ `)}function st(){return{string:()=>({kind:`string`}),number:()=>({kind:`number`}),boolean:()=>({kind:`boolean`}),array:e=>({kind:`array`,inner:e}),object:e=>({kind:`object`,inner:e}),record:e=>({kind:`record`,inner:e}),any:()=>({kind:`any`}),zod:()=>({kind:`zod`}),ref:e=>({kind:`ref`,inner:e}),propsOf:e=>({kind:`propsOf`,inner:e}),map:e=>({kind:`map`,inner:e}),optional:()=>({optional:!0})}}function ct(e,t){return{definition:e(st()),promptTemplate:t?.promptTemplate,defaultRules:t?.defaultRules,builtInActions:t?.builtInActions,createCatalog(e){return lt(this,e)}}}function lt(e,t){let n=t.components,r=t.actions,i=n?Object.keys(n):[],a=r?Object.keys(r):[],o=ut(e.definition,t);return{schema:e,data:t,componentNames:i,actionNames:a,prompt(e={}){return mt(this,e)},jsonSchema(e={}){return Ct(o,e.strict??!1)},validate(e){let t=o.safeParse(e);return t.success?{success:!0,data:t.data}:{success:!1,error:t.error}},zodSchema(){return o},get _specType(){throw Error(`_specType is only for type inference`)}}}function ut(e,t){return dt(e.spec,t)}function dt(e,t){switch(e.kind){case`string`:return f();case`number`:return c();case`boolean`:return y();case`any`:return o();case`array`:{let n=dt(e.inner,t);return g(n)}case`object`:{let n=e.inner,r={};for(let[e,i]of Object.entries(n)){let n=dt(i,t);i.optional&&(n=n.optional()),r[e]=n}return u(r)}case`record`:{let n=dt(e.inner,t);return _(f(),n)}case`ref`:{let n=e.inner,r=ft(n,t);return r.length===0?f():r.length===1?b(r[0]):v(r)}case`propsOf`:{let n=e.inner,r=pt(n,t);return r.length===0?_(f(),a()):r.length===1?r[0]:_(f(),a())}default:return a()}}function ft(e,t){let n=e.split(`.`),r={catalog:t};for(let e of n)if(r&&typeof r==`object`)r=r[e];else return[];return r&&typeof r==`object`?Object.keys(r):[]}function pt(e,t){let n=e.split(`.`),r={catalog:t};for(let e of n)if(r&&typeof r==`object`)r=r[e];else return[];return r&&typeof r==`object`?Object.values(r).map(e=>e.props).filter(e=>e!==void 0):[]}function mt(e,t){if(e.schema.promptTemplate){let n={catalog:e.data,componentNames:e.componentNames,actionNames:e.actionNames,options:t,formatZodType:bt};return e.schema.promptTemplate(n)}let{system:n=`You are a UI generator that outputs JSON.`,customRules:r=[],mode:i=`standalone`}=t,a=i===`chat`?(console.warn(`[json-render] mode "chat" is deprecated, use "inline" instead`),`inline`):i===`generate`?(console.warn(`[json-render] mode "generate" is deprecated, use "standalone" instead`),`standalone`):i,o=[];o.push(n),o.push(``),a===`inline`?(o.push(`OUTPUT FORMAT (text + JSONL, RFC 6902 JSON Patch):`),o.push("You respond conversationally. When generating UI, first write a brief explanation (1-3 sentences), then output JSONL patch lines wrapped in a ```spec code fence."),o.push("The JSONL lines use RFC 6902 JSON Patch operations to build a UI tree. Always wrap them in a ```spec fence block:"),o.push(" ```spec"),o.push(` {"op":"add","path":"/root","value":"main"}`),o.push(` {"op":"add","path":"/elements/main","value":{"type":"Card","props":{"title":"Hello"},"children":[]}}`),o.push(" ```"),o.push(`If the user's message does not require a UI (e.g. a greeting or clarifying question), respond with text only — no JSONL.`)):(o.push(`OUTPUT FORMAT (JSONL, RFC 6902 JSON Patch):`),o.push(`Output JSONL (one JSON object per line) using RFC 6902 JSON Patch operations to build a UI tree.`)),o.push(`Each line is a JSON patch operation (add, remove, replace). Start with /root, then stream /elements and /state patches interleaved so the UI fills in progressively as it streams.`),o.push(``),o.push(`Example output (each line is a separate JSON object):`),o.push(``);let s=e.data.components,c=e.schema.definition.spec,l=(c.kind===`object`?c.inner:void 0)?.elements,u=l?.kind===`record`?l.inner:void 0,d=(u?.kind===`object`?u.inner:void 0)?.slots!==void 0,f=e.componentNames,p=f[0]||`Component`,m=f.length>1?f[1]:p,h=s?.[p],g=s?.[m],_=h?ht(h):{},v=g?ht(g):{},y=g?.props?vt(g.props):null,b=y?{...v,[y]:{$item:`title`}}:v,x=[JSON.stringify({op:`add`,path:`/root`,value:`main`}),JSON.stringify({op:`add`,path:`/elements/main`,value:{type:p,props:_,children:[`child-1`,`list`]}}),JSON.stringify({op:`add`,path:`/elements/child-1`,value:{type:m,props:v,children:[]}}),JSON.stringify({op:`add`,path:`/elements/list`,value:{type:p,props:_,repeat:{statePath:`/items`,key:`id`},children:[`item`]}}),JSON.stringify({op:`add`,path:`/elements/item`,value:{type:m,props:b,children:[]}}),JSON.stringify({op:`add`,path:`/state/items`,value:[]}),JSON.stringify({op:`add`,path:`/state/items/0`,value:{id:`1`,title:`First Item`}}),JSON.stringify({op:`add`,path:`/state/items/1`,value:{id:`2`,title:`Second Item`}})].join(`
62
+ `);o.push(`${x}
63
+
64
+ Note: state patches appear right after the elements that use them, so the UI fills in as it streams. ONLY use component types from the AVAILABLE COMPONENTS list below.`),o.push(``),o.push(`INITIAL STATE:`),o.push(`Specs include a /state field to seed the state model. Components with { $bindState } or { $bindItem } read from and write to this state, and $state expressions read from it.`),o.push(`CRITICAL: You MUST include state patches whenever your UI displays data via $state, $bindState, $bindItem, $item, or $index expressions, or uses repeat to iterate over arrays. Without state, these references resolve to nothing and repeat lists render zero items.`),o.push(`Output state patches right after the elements that reference them, so the UI fills in progressively as it streams.`),o.push(`Stream state progressively - output one patch per array item instead of one giant blob:`),o.push(` For arrays: {"op":"add","path":"/state/posts/0","value":{"id":"1","title":"First Post",...}} then /state/posts/1, /state/posts/2, etc.`),o.push(` For scalars: {"op":"add","path":"/state/newTodoText","value":""}`),o.push(` Initialize the array first if needed: {"op":"add","path":"/state/posts","value":[]}`),o.push(`When content comes from the state model, use { "$state": "/some/path" } dynamic props to display it instead of hardcoding the same value in both state and props. The state model is the single source of truth.`),o.push(`Include realistic sample data in state. For blogs: 3-4 posts with titles, excerpts, authors, dates. For product lists: 3-5 items with names, prices, descriptions. Never leave arrays empty.`),o.push(``),o.push(`DYNAMIC LISTS (repeat field):`),o.push(`Any element can have a top-level "repeat" field to render its children once per item in a state array: { "repeat": { "statePath": "/arrayPath", "key": "id" } }.`),o.push(`The element itself renders once (as the container), and its children are expanded once per array item. "statePath" is the state array path. "key" is an optional field name on each item for stable React keys.`),o.push(`For nested lists, an inner repeat can read an array from the enclosing item with { "statePath": { "$item": "field" } }. This form is valid only inside another repeat. Use an empty field to repeat over the enclosing item itself.`),o.push(`Example: ${JSON.stringify({type:p,props:_,repeat:{statePath:`/todos`,key:`id`},children:[`todo-item`]})}`),o.push(`Inside children of a repeated element, use { "$item": "field" } to read a field from the current item, and { "$index": true } to get the current array index. For two-way binding to an item field use { "$bindItem": "completed" } on the appropriate prop.`),o.push(`ALWAYS use the repeat field for lists backed by state arrays. NEVER hardcode individual elements for each array item.`),o.push(`IMPORTANT: "repeat" is a top-level field on the element (sibling of type/props/children), NOT inside props.`),o.push(``),o.push(`ARRAY STATE ACTIONS:`),o.push(`Use action "pushState" to append items to arrays. Params: { statePath: "/arrayPath", value: { ...item }, clearStatePath: "/inputPath" }.`),o.push(`Values inside pushState can contain { "$state": "/statePath" } references to read current state (e.g. the text from an input field).`),o.push(`Use "$id" inside a pushState value to auto-generate a unique ID.`),o.push(`Example: on: { "press": { "action": "pushState", "params": { "statePath": "/todos", "value": { "id": "$id", "title": { "$state": "/newTodoText" }, "completed": false }, "clearStatePath": "/newTodoText" } } }`),o.push(`Use action "removeState" to remove items from arrays by index. Params: { statePath: "/arrayPath", index: N }. Inside a repeated element's children, use { "$index": true } for the current item index. Action params support the same expressions as props: { "$item": "field" } resolves to the absolute state path, { "$index": true } resolves to the index number, and { "$state": "/path" } reads a value from state.`),o.push(`For lists where users can add/remove items (todos, carts, etc.), use pushState and removeState instead of hardcoding with setState.`),o.push(``),o.push(`IMPORTANT: State paths use RFC 6901 JSON Pointer syntax (e.g. "/todos/0/title"). Do NOT use JavaScript-style dot notation (e.g. "/todos.length" is WRONG). To generate unique IDs for new items, use "$id" instead of trying to read array length.`),o.push(``);let S=s;if(S){o.push(`AVAILABLE COMPONENTS (${e.componentNames.length}):`),o.push(``);for(let[e,t]of Object.entries(S)){let n=t.props?bt(t.props):`{}`,r=t.slots??[],i=r.filter(e=>e!=="default"),a=r.includes(`default`),s=d?[a?`accepts children`:``,i.length>0?`slots: ${i.join(`, `)}`:``].filter(Boolean).join(`; `):r.length>0?`accepts children`:``,c=s?` [${s}]`:``,l=t.events&&t.events.length>0?` [events: ${t.events.join(`, `)}]`:``,u=t.description?` - ${t.description}`:``;o.push(`- ${e}: ${n}${u}${c}${l}`)}o.push(``)}let C=e.data.actions,w=e.schema.builtInActions??[],T=C&&e.actionNames.length>0,E=w.length>0;if(T||E){o.push(`AVAILABLE ACTIONS:`),o.push(``);for(let e of w)o.push(`- ${e.name}: ${e.description} [built-in]`);if(T)for(let[e,t]of Object.entries(C))o.push(`- ${e}${t.description?`: ${t.description}`:``}`);o.push(``)}o.push("EVENTS (the `on` field):"),o.push("Elements can have an optional `on` field to bind events to actions. The `on` field is a top-level field on the element (sibling of type/props/children), NOT inside props."),o.push('Each key in `on` is an event name (from the component\'s supported events), and the value is an action binding: `{ "action": "<actionName>", "params": { ... } }`.'),o.push(``),o.push(`Example:`),o.push(` ${JSON.stringify({type:p,props:_,on:{press:{action:`setState`,params:{statePath:`/saved`,value:!0}}},children:[]})}`),o.push(``),o.push(`Action params can use dynamic references to read from state: { "$state": "/statePath" }.`),o.push("IMPORTANT: Do NOT put action/actionParams inside props. Always use the `on` field for event bindings."),o.push(``),o.push(`VISIBILITY CONDITIONS:`),o.push("Elements can have an optional `visible` field to conditionally show/hide based on state. IMPORTANT: `visible` is a top-level field on the element object (sibling of type/props/children), NOT inside props."),o.push(`Correct: ${JSON.stringify({type:p,props:_,visible:{$state:`/activeTab`,eq:`home`},children:[`...`]})}`),o.push('- `{ "$state": "/path" }` - visible when state at path is truthy'),o.push('- `{ "$state": "/path", "not": true }` - visible when state at path is falsy'),o.push('- `{ "$state": "/path", "eq": "value" }` - visible when state equals value'),o.push('- `{ "$state": "/path", "neq": "value" }` - visible when state does not equal value'),o.push('- `{ "$state": "/path", "gt": N }` / `gte` / `lt` / `lte` - numeric comparisons'),o.push(`- Use ONE operator per condition (eq, neq, gt, gte, lt, lte). Do not combine multiple operators.`),o.push('- Any condition can add `"not": true` to invert its result'),o.push("- `[condition, condition]` - all conditions must be true (implicit AND)"),o.push('- `{ "$and": [condition, condition] }` - explicit AND (use when nesting inside $or)'),o.push('- `{ "$or": [condition, condition] }` - at least one must be true (OR)'),o.push("- `true` / `false` - always visible/hidden"),o.push(``),o.push(`Use a component with on.press bound to setState to update state and drive visibility.`),o.push(`Example: A ${p} with on: { "press": { "action": "setState", "params": { "statePath": "/activeTab", "value": "home" } } } sets state, then a container with visible: { "$state": "/activeTab", "eq": "home" } shows only when that tab is active.`),o.push(``),o.push(`For tab patterns where the first/default tab should be visible when no tab is selected yet, use $or to handle both cases: visible: { "$or": [{ "$state": "/activeTab", "eq": "home" }, { "$state": "/activeTab", "not": true }] }. This ensures the first tab is visible both when explicitly selected AND when /activeTab is not yet set.`),o.push(``),o.push(`DYNAMIC PROPS:`),o.push(`Any prop value can be a dynamic expression that resolves based on state. Three forms are supported:`),o.push(``),o.push('1. Read-only state: `{ "$state": "/statePath" }` - resolves to the value at that state path (one-way read).'),o.push(' Example: `"color": { "$state": "/theme/primary" }` reads the color from state.'),o.push(``),o.push('2. Two-way binding: `{ "$bindState": "/statePath" }` - resolves to the value at the state path AND enables write-back. Use on form input props (value, checked, pressed, etc.).'),o.push(' Example: `"value": { "$bindState": "/form/email" }` binds the input value to /form/email.'),o.push(' Inside repeat scopes: `"checked": { "$bindItem": "completed" }` binds to the current item\'s completed field.'),o.push(``),o.push('3. Conditional: `{ "$cond": <condition>, "$then": <value>, "$else": <value> }` - evaluates the condition (same syntax as visibility conditions) and picks the matching value.'),o.push(' Example: `"color": { "$cond": { "$state": "/activeTab", "eq": "home" }, "$then": "#007AFF", "$else": "#8E8E93" }`'),o.push(``),o.push(`Use $bindState for form inputs (text fields, checkboxes, selects, sliders, etc.) and $state for read-only data display. Inside repeat scopes, use $bindItem for form inputs bound to the current item. Use dynamic props instead of duplicating elements with opposing visible conditions when only prop values differ.`),o.push(``),o.push('4. Template: `{ "$template": "Hello, ${/name}!" }` - interpolates references in the string. Absolute paths like `${/path}` resolve against the state model. Bare names like `${field}` resolve against the current repeat item first, then fall back to the state model at `/<field>`.'),o.push(' Example: `"label": { "$template": "Items: ${/cart/count} | Total: ${/cart/total}" }` renders "Items: 3 | Total: 42.00" when /cart/count is 3 and /cart/total is 42.00. Inside a repeat, `{ "$template": "${name} - ${email}" }` reads name and email from each item.'),o.push(``);let D=e.data.functions;if(D&&Object.keys(D).length>0){o.push('5. Computed: `{ "$computed": "<functionName>", "args": { "key": <expression> } }` - calls a registered function with resolved args and returns the result.'),o.push(' Example: `"value": { "$computed": "fullName", "args": { "first": { "$state": "/form/firstName" }, "last": { "$state": "/form/lastName" } } }`'),o.push(` Available functions:`);for(let e of Object.keys(D))o.push(` - ${e}`);o.push(``)}let O=t.directives;if(O&&O.length>0){o.push(`CUSTOM DYNAMIC VALUES:`),o.push(``);for(let e of O){let t=e.description?` (${e.description})`:``;o.push(`- ${e.name}${t}: ${bt(e.schema)}`)}o.push(``),o.push(`Directives compose: any value field can contain another directive or a $state expression, resolved inside-out.`),o.push(``)}s&&Object.entries(s).some(([,e])=>e.props?bt(e.props).includes(`checks`):!1)&&(o.push(`VALIDATION:`),o.push("Form components that accept a `checks` prop support client-side validation."),o.push(`Each check is an object: { "type": "<name>", "message": "...", "args": { ... } }`),o.push(``),o.push(`Built-in validation types:`),o.push(` - required — value must be non-empty`),o.push(` - email — valid email format`),o.push(` - minLength — minimum string length (args: { "min": N })`),o.push(` - maxLength — maximum string length (args: { "max": N })`),o.push(` - pattern — match a regex (args: { "pattern": "regex" })`),o.push(` - min — minimum numeric value (args: { "min": N })`),o.push(` - max — maximum numeric value (args: { "max": N })`),o.push(` - numeric — value must be a number`),o.push(` - url — valid URL format`),o.push(` - matches — must equal another field (args: { "other": { "$state": "/path" } })`),o.push(` - equalTo — alias for matches (args: { "other": { "$state": "/path" } })`),o.push(` - lessThan — value must be less than another field (args: { "other": { "$state": "/path" } })`),o.push(` - greaterThan — value must be greater than another field (args: { "other": { "$state": "/path" } })`),o.push(` - requiredIf — required only when another field is truthy (args: { "field": { "$state": "/path" } })`),o.push(``),o.push(`Example:`),o.push(` "checks": [{ "type": "required", "message": "Email is required" }, { "type": "email", "message": "Invalid email" }]`),o.push(``),o.push(`IMPORTANT: When using checks, the component must also have a { $bindState } or { $bindItem } on its value/checked prop for two-way binding.`),o.push(`Always include validation checks on form inputs for a good user experience (e.g. required, email, minLength).`),o.push(``)),(T||E)&&(o.push(`STATE WATCHERS:`),o.push("Elements can have an optional `watch` field to react to state changes and trigger actions. The `watch` field is a top-level field on the element (sibling of type/props/children), NOT inside props."),o.push(`Maps state paths (JSON Pointers) to action bindings. When the value at a watched path changes, the bound actions fire automatically.`),o.push(``),o.push(`Example (cascading select — country changes trigger city loading):`),o.push(` ${JSON.stringify({type:`Select`,props:{value:{$bindState:`/form/country`},options:[`US`,`Canada`,`UK`]},watch:{"/form/country":{action:`loadCities`,params:{country:{$state:`/form/country`}}}},children:[]})}`),o.push(``),o.push("Use `watch` for cascading dependencies where changing one field should trigger side effects (loading data, resetting dependent fields, computing derived values)."),o.push("IMPORTANT: `watch` is a top-level field on the element (sibling of type/props/children), NOT inside props. Watchers only fire when the value changes, not on initial render."),o.push(``));let k=t.editModes;k&&k.length>0&&o.push(ot({modes:k},`json`)),o.push(`RULES:`);let A=a===`inline`?["When generating UI, wrap all JSONL patches in a ```spec code fence - one JSON object per line inside the fence",`Write a brief conversational response before any JSONL output`,`First set root: {"op":"add","path":"/root","value":"<root-key>"}`,`Then add each element: {"op":"add","path":"/elements/<key>","value":{...}}`,`Output /state patches right after the elements that use them, one per array item for progressive loading. REQUIRED whenever using $state, $bindState, $bindItem, $item, $index, or repeat.`,`ONLY use components listed above`,`Each element value needs: type, props, children (array of child keys)`,`Use unique keys for the element map entries (e.g., 'header', 'metric-1', 'chart-revenue')`]:[`Output ONLY JSONL patches - one JSON object per line, no markdown, no code fences`,`First set root: {"op":"add","path":"/root","value":"<root-key>"}`,`Then add each element: {"op":"add","path":"/elements/<key>","value":{...}}`,`Output /state patches right after the elements that use them, one per array item for progressive loading. REQUIRED whenever using $state, $bindState, $bindItem, $item, $index, or repeat.`,`ONLY use components listed above`,`Each element value needs: type, props, children (array of child keys)`,`Use unique keys for the element map entries (e.g., 'header', 'metric-1', 'chart-revenue')`],j=e.schema.defaultRules??[];return[...A,...j,...r].forEach((e,t)=>{o.push(`${t+1}. ${e}`)}),o.join(`
65
+ `)}function ht(e){return e.example&&Object.keys(e.example).length>0?e.example:e.props?gt(e.props):{}}function gt(e){if(!e||!e._def)return{};let t=e._def,n=yt(e);if(n!==`ZodObject`&&n!==`object`)return{};let r=typeof t.shape==`function`?t.shape():t.shape;if(!r)return{};let i={};for(let[e,t]of Object.entries(r)){let n=yt(t);n!==`ZodOptional`&&n!==`optional`&&n!==`ZodNullable`&&n!==`nullable`&&(i[e]=_t(t))}return i}function _t(e){if(!e||!e._def)return`...`;let t=e._def;switch(yt(e)){case`ZodString`:case`string`:return`example`;case`ZodNumber`:case`number`:return 0;case`ZodBoolean`:case`boolean`:return!0;case`ZodLiteral`:case`literal`:return t.value;case`ZodEnum`:case`enum`:if(Array.isArray(t.values)&&t.values.length>0)return t.values[0];if(t.entries&&typeof t.entries==`object`){let e=Object.values(t.entries);return e.length>0?e[0]:`example`}return`example`;case`ZodOptional`:case`optional`:case`ZodNullable`:case`nullable`:case`ZodDefault`:case`default`:{let e=t.innerType??t.wrapped;return e?_t(e):null}case`ZodArray`:case`array`:return[];case`ZodObject`:case`object`:return gt(e);case`ZodUnion`:case`union`:{let e=t.options;return e&&e.length>0?_t(e[0]):`...`}default:return`...`}}function vt(e){if(!e||!e._def)return null;let t=e._def,n=yt(e);if(n!==`ZodObject`&&n!==`object`)return null;let r=typeof t.shape==`function`?t.shape():t.shape;if(!r)return null;for(let[e,t]of Object.entries(r)){let n=yt(t);if(n!==`ZodOptional`&&n!==`optional`&&n!==`ZodNullable`&&n!==`nullable`&&(n===`ZodString`||n===`string`))return e}return null}function yt(e){if(!e||!e._def)return``;let t=e._def;return t.typeName??t.type??``}function bt(e){if(!e||!e._def)return`unknown`;let t=e._def;switch(yt(e)){case`ZodString`:case`string`:return`string`;case`ZodNumber`:case`number`:return`number`;case`ZodBoolean`:case`boolean`:return`boolean`;case`ZodLiteral`:case`literal`:{let e=t.values?.[0]??t.value;return JSON.stringify(e)}case`ZodEnum`:case`enum`:{let e;if(Array.isArray(t.values))e=t.values;else if(t.entries&&typeof t.entries==`object`)e=Object.values(t.entries);else return`enum`;return e.map(e=>`"${e}"`).join(` | `)}case`ZodArray`:case`array`:{let e=typeof t.element==`object`?t.element:typeof t.type==`object`?t.type:void 0;return e?`Array<${bt(e)}>`:`Array<unknown>`}case`ZodObject`:case`object`:{let e=typeof t.shape==`function`?t.shape():t.shape;return e?`{ ${Object.entries(e).map(([e,t])=>{let n=yt(t);return`${e}${n===`ZodOptional`||n===`ZodNullable`||n===`optional`||n===`nullable`?`?`:``}: ${bt(t)}`}).join(`, `)} }`:`object`}case`ZodOptional`:case`optional`:case`ZodNullable`:case`nullable`:{let e=t.innerType??t.wrapped;return e?bt(e):`unknown`}case`ZodUnion`:case`union`:{let e=t.options;return e?e.map(e=>bt(e)).join(` | `):`unknown`}case`ZodRecord`:case`record`:{let e=t.keyType??void 0,n=t.valueType??t.element??void 0;return`Record<${e?bt(e):`string`}, ${n?bt(n):`unknown`}>`}case`ZodDefault`:case`default`:{let e=t.innerType??t.wrapped;return e?bt(e):`unknown`}default:return`unknown`}}function xt(e){return typeof e.type==`string`?e.type:typeof e.typeName==`string`?e.typeName:``}function St(e){return e.startsWith(`Zod`)?e.slice(3).toLowerCase():e.toLowerCase()}function Ct(e,t=!1){let n=e._def;switch(St(xt(n))){case`string`:return{type:`string`};case`number`:return{type:`number`};case`boolean`:return{type:`boolean`};case`literal`:{let e=n.values;return{const:e?e[0]:n.value}}case`enum`:{let e=n.entries;return{enum:(e?Object.values(e):n.values)??[]}}case`array`:{let e=n.element??n.type;return{type:`array`,items:e?Ct(e,t):{}}}case`object`:{let e=n.shape,r=typeof e==`function`?e():e;if(!r)return t?{type:`object`,properties:{},required:[],additionalProperties:!1}:{type:`object`};let i={},a=[];for(let[e,n]of Object.entries(r)){let r=n._def,o=St(xt(r)),s=o===`optional`||o===`nullable`;t?(a.push(e),i[e]=s?{anyOf:[Ct(n,t),{type:`null`}]}:Ct(n,t)):(i[e]=Ct(n),s||a.push(e))}return{type:`object`,properties:i,required:a.length>0?a:void 0,additionalProperties:!1}}case`record`:{let e=n.valueType;return t?{type:`object`,properties:{},required:[],additionalProperties:!1}:{type:`object`,additionalProperties:!e||Ct(e)}}case`optional`:case`nullable`:{let e=n.innerType;return e?Ct(e,t):{}}case`union`:{let e=n.options;return e?{anyOf:e.map(e=>Ct(e,t))}:{}}case`any`:case`unknown`:return t?{type:`object`,properties:{},required:[],additionalProperties:!1}:{};default:return{}}}u({root:f().min(1),elements:_(f(),u({type:f(),props:_(f(),a()),children:g(f()).optional(),slots:_(f(),g(f())).optional(),on:_(f(),a()).optional(),visible:a().optional()}).strict()),state:_(f(),a()).optional()}).strict(),He.extend({params:_(f(),a()).optional(),onSuccess:a().optional(),onError:a().optional()}).strict();var wt=c().min(0).max(1);u({answers:_(f(),u({type:b(`choice`),choice:f()})),providerMetadata:u({typesafe:u({confidence:_(f(),wt)}).optional()}).optional(),usage:u({inputTokens:c().int().nonnegative().optional()}).optional()});var Tt=ct(e=>({spec:e.object({root:e.string(),elements:e.record(e.object({type:e.ref(`catalog.components`),props:e.propsOf(`catalog.components`),children:e.array(e.string()),slots:{...e.record(e.array(e.string())),...e.optional()},visible:{...e.any(),...e.optional()},repeat:{...e.any(),...e.optional()}}))}),catalog:e.object({components:e.map({props:e.zod(),slots:e.array(e.string()),description:e.string(),example:e.any()}),actions:e.map({params:e.zod(),description:e.string()})})}),{builtInActions:[{name:`setState`,description:`Update a value in the state model at the given statePath. Params: { statePath: string, value: any }`},{name:`pushState`,description:`Append an item to an array in state. Params: { statePath: string, value: any, clearStatePath?: string }. Value can contain {"$state":"/path"} refs and "$id" for auto IDs.`},{name:`removeState`,description:`Remove an item from an array in state by index. Params: { statePath: string, index: number }`},{name:`validateForm`,description:`Validate all registered form fields and write the result to state. Params: { statePath?: string }. Defaults to /formValidation. Result: { valid: boolean, errors: Record<string, string[]> }.`}],defaultRules:[`CRITICAL INTEGRITY CHECK: Before outputting ANY element that references children, you MUST have already output (or will output) each child as its own element. If an element has children: ['a', 'b'], then elements 'a' and 'b' MUST exist. A missing child element causes that entire branch of the UI to be invisible.`,`SELF-CHECK: After generating all elements, mentally walk the tree from root. Every key in every children array must resolve to a defined element. If you find a gap, output the missing element immediately.`,`REQUIRED FIELDS: Every element MUST include a "children" array. Leaf elements (text, badges, inputs, images) use an empty array: "children": []. Omitting "children" fails validation.`,`NAMED SLOTS: Use "children" for the default slot. For other slots declared by the component, use a top-level "slots" object that maps each slot name to child element keys, for example {"slots":{"header":["heading"],"footer":["actions"]}}. Never use "slots.default". Every referenced key must exist.`,`FILTERED LISTS: To render only the items matching a field value (kanban columns, tabbed lists, status sections), put "repeat" and a "visible" condition with $item on the same container element: {"repeat": {"statePath": "/tasks", "key": "id"}, "visible": {"$item": "status", "eq": "todo"}} renders one child per matching item. A visible condition object must use exactly one of $state, $item, or $index — never combine them in one object.`,`CRITICAL: The "visible" field goes on the ELEMENT object, NOT inside "props". Correct: {"type":"<ComponentName>","props":{},"visible":{"$state":"/tab","eq":"home"},"children":[...]}.`,`CRITICAL: The "on" field goes on the ELEMENT object, NOT inside "props". Use on.press, on.change, on.submit etc. NEVER put action/actionParams inside props.`,`When the user asks for a UI that displays data (e.g. blog posts, products, users), ALWAYS include a state field with realistic sample data. The state field is a top-level field on the spec (sibling of root/elements).`,`When building repeating content backed by a state array (e.g. posts, products, items), use the "repeat" field on a container element. Example: { "type": "<ContainerComponent>", "props": {}, "repeat": { "statePath": "/posts", "key": "id" }, "children": ["post-card"] }. For a nested list stored on the enclosing item, use "repeat": { "statePath": { "$item": "comments" }, "key": "id" }. The $item statePath form is valid only inside another repeat. Replace <ContainerComponent> with an appropriate component from the AVAILABLE COMPONENTS list. Inside repeated children, use { "$item": "field" } to read a field from the current item, and { "$index": true } for the current array index. For two-way binding to an item field use { "$bindItem": "completed" }. Do NOT hardcode individual elements for each array item.`,`Design with visual hierarchy: use container components to group content, heading components for section titles, proper spacing, and status indicators. ONLY use components from the AVAILABLE COMPONENTS list.`,`For data-rich UIs, use multi-column layout components if available. For forms and single-column content, use vertical layout components. ONLY use components from the AVAILABLE COMPONENTS list.`,`Always include realistic, professional-looking sample data. For blogs include 3-4 posts with varied titles, authors, dates, categories. For products include names, prices, images. Never leave data empty.`]}),V=e(S(),1),H=l(),Et=(0,V.createContext)(null);function Dt(e,t){return e?null:Object.keys(t).length===0?{}:P(t)}function Ot({store:e,initialState:t={},onStateChange:n,children:r}){let i=(0,V.useRef)(void 0);!e&&!i.current&&(i.current=M(t));let a=e??i.current,o=(0,V.useRef)(a);o.current=a;let s=(0,V.useRef)(!!e);s.current=!!e,(0,V.useRef)(e?`controlled`:`uncontrolled`),(0,V.useRef)(!1);let c=(0,V.useRef)(t),l=(0,V.useRef)(Dt(!!e,t));(0,V.useEffect)(()=>{if(e||t===c.current)return;c.current=t;let n=t&&Object.keys(t).length>0?P(t):{},r=l.current??{},i=new Set([...Object.keys(r),...Object.keys(n)]),o={};for(let e of i)r[e]!==n[e]&&(o[e]=e in n?n[e]:void 0);l.current=n,Object.keys(o).length>0&&a.update(o)},[e,t,a]);let u=(0,V.useSyncExternalStore)(a.subscribe,a.getSnapshot,a.getServerSnapshot??a.getSnapshot),d=(0,V.useRef)(n);d.current=n;let f=(0,V.useCallback)((e,t)=>{let n=o.current,r=n.getSnapshot();n.set(e,t),!s.current&&n.getSnapshot()!==r&&d.current?.([{path:e,value:t}])},[]),p=(0,V.useCallback)(e=>{let t=o.current,n=t.getSnapshot();if(t.update(e),!s.current&&t.getSnapshot()!==n){let t=[];for(let[r,i]of Object.entries(e))D(n,r)!==i&&t.push({path:r,value:i});t.length>0&&d.current?.(t)}},[]),m=(0,V.useCallback)(e=>o.current.get(e),[]),h=(0,V.useCallback)(()=>o.current.getSnapshot(),[]),g=(0,V.useMemo)(()=>({state:u,get:m,set:f,update:p,getSnapshot:h}),[u,m,f,p,h]);return(0,H.jsx)(Et.Provider,{value:g,children:r})}function kt(){let e=(0,V.useContext)(Et);if(!e)throw Error(`useStateStore must be used within a StateProvider`);return e}var At=(0,V.createContext)(null);function jt({children:e}){let{state:t}=kt(),n=(0,V.useMemo)(()=>({stateModel:t}),[t]),r=(0,V.useMemo)(()=>e=>fe(e,n),[n]),i=(0,V.useMemo)(()=>({isVisible:r,ctx:n}),[r,n]);return(0,H.jsx)(At.Provider,{value:i,children:e})}function Mt(){let e=(0,V.useContext)(At);if(!e)throw Error(`useVisibility must be used within a VisibilityProvider`);return e}var Nt=(0,V.createContext)(null),Pt={};function Ft(e,t){if(e===t)return!0;if(!e||!t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n){let n=e[r],i=t[r];if(n!==i){if(typeof n==`object`&&n&&typeof i==`object`&&i){let e=n.$state,t=i.$state;if(typeof e==`string`&&e===t)continue}return!1}}return!0}function It(e,t){if(e===t)return!0;if(e.validateOn!==t.validateOn)return!1;let n=e.checks??[],r=t.checks??[];if(n.length!==r.length)return!1;for(let e=0;e<n.length;e++){let t=n[e],i=r[e];if(t.type!==i.type||t.message!==i.message||!Ft(t.args,i.args))return!1}return!0}function Lt({customFunctions:e=Pt,children:t}){let{state:n,getSnapshot:r}=kt(),[i,a]=(0,V.useState)({}),o=(0,V.useRef)({}),[s,c]=(0,V.useState)({}),l=(0,V.useCallback)((e,t)=>{c(n=>{let r=n[e];return r&&It(r,t)?n:{...n,[e]:t}})},[]),u=(0,V.useCallback)((t,n)=>{let i=r(),s=t.split(`/`).filter(Boolean),c=i;for(let e of s)if(typeof c==`object`&&c)c=c[e];else{c=void 0;break}let l=Xe(n,{value:c,stateModel:i,customFunctions:e}),u={touched:o.current[t]?.touched??!0,validated:!0,result:l};return o.current={...o.current,[t]:u},a(o.current),l},[e,r]),d=(0,V.useCallback)(e=>{o.current={...o.current,[e]:{...o.current[e],touched:!0,validated:o.current[e]?.validated??!1,result:o.current[e]?.result??null}},a(o.current)},[]),f=(0,V.useCallback)(e=>{let{[e]:t,...n}=o.current;o.current=n,a(n)},[]),p=(0,V.useCallback)(()=>{let e=!0;for(let[t,n]of Object.entries(s))u(t,n).valid||(e=!1);return e},[s,u]),m=(0,V.useMemo)(()=>({customFunctions:e,get fieldStates(){return o.current},validate:u,touch:d,clear:f,validateAll:p,registerField:l}),[e,i,u,d,f,p,l]);return(0,H.jsx)(Nt.Provider,{value:m,children:t})}function Rt(){return(0,V.useContext)(Nt)}var zt=0;function Bt(){return zt+=1,`${Date.now()}-${zt}`}function Vt(e,t){if(e==null)return e;if(e===`$id`)return Bt();if(typeof e==`object`&&!Array.isArray(e)){let n=e,r=Object.keys(n);if(r.length===1&&typeof n.$state==`string`)return t(n.$state);if(r.length===1&&`$id`in n)return Bt()}if(Array.isArray(e))return e.map(e=>Vt(e,t));if(typeof e==`object`){let n={};for(let[r,i]of Object.entries(e))n[r]=Vt(i,t);return n}return e}var Ht=(0,V.createContext)(null);function Ut({handlers:e={},navigate:t,children:n}){let{get:r,set:i,getSnapshot:a}=kt(),o=Rt(),[s,c]=(0,V.useState)(e),[l,u]=(0,V.useState)(new Set),[d,f]=(0,V.useState)(null),p=(0,V.useCallback)((e,t)=>{c(n=>({...n,[e]:t}))},[]),m=(0,V.useCallback)(async e=>{let n=Ue(e,a()),c=Pe(),l=Date.now();je({id:c,name:n.action,params:n.params,at:l});let d=!0,p;try{if(n.action===`setState`&&n.params){let e=n.params.statePath,t=n.params.value;e&&i(e,t);return}if(n.action===`pushState`&&n.params){let e=n.params.statePath,t=n.params.value;if(e){let a=Vt(t,r),o=r(e)??[];i(e,[...o,a]);let s=n.params.clearStatePath;s&&i(s,``)}return}if(n.action===`removeState`&&n.params){let e=n.params.statePath,t=n.params.index;if(e!==void 0&&t!==void 0){let n=r(e)??[];i(e,n.filter((e,n)=>n!==t))}return}if(n.action===`push`&&n.params){let e=n.params.screen;if(e){let t=r(`/currentScreen`),n=r(`/navStack`)??[];t?i(`/navStack`,[...n,t]):i(`/navStack`,[...n,``]),i(`/currentScreen`,e)}return}if(n.action===`pop`){let e=r(`/navStack`)??[];if(e.length>0){let t=e[e.length-1];i(`/navStack`,e.slice(0,-1)),t?i(`/currentScreen`,t):i(`/currentScreen`,void 0)}return}if(n.action===`validateForm`){let e=o?.validateAll;if(!e){console.warn(`validateForm action was dispatched but no ValidationProvider is connected. Ensure ValidationProvider is rendered inside the provider tree.`);return}let t=e(),r={};for(let[e,t]of Object.entries(o.fieldStates))t.result&&!t.result.valid&&(r[e]=t.result.errors);let a=n.params?.statePath||`/formValidation`;i(a,{valid:t,errors:r});return}let e=s[n.action];if(!e){console.warn(`No handler registered for action: ${n.action}`);return}if(n.confirm)return new Promise((t,r)=>{f({action:n,handler:e,resolve:()=>{f(null),t()},reject:()=>{f(null),r(Error(`Action cancelled`))}})}).then(async()=>{u(e=>new Set(e).add(n.action));try{await Ge({action:n,handler:e,setState:i,navigate:t,executeAction:async e=>{await m(e)}})}finally{u(e=>{let t=new Set(e);return t.delete(n.action),t})}});u(e=>new Set(e).add(n.action));try{await Ge({action:n,handler:e,setState:i,navigate:t,executeAction:async e=>{await m(e)}})}finally{u(e=>{let t=new Set(e);return t.delete(n.action),t})}}catch(e){throw d=!1,p=e,e}finally{let e=Date.now();Me({id:c,name:n.action,ok:d,at:e,durationMs:e-l,error:p})}},[s,r,i,a,t,o]),h=(0,V.useCallback)(()=>{d?.resolve()},[d]),g=(0,V.useCallback)(()=>{d?.reject()},[d]),_=(0,V.useMemo)(()=>({handlers:s,loadingActions:l,pendingConfirmation:d,execute:m,confirm:h,cancel:g,registerHandler:p}),[s,l,d,m,h,g,p]);return(0,H.jsx)(Ht.Provider,{value:_,children:n})}function Wt(){let e=(0,V.useContext)(Ht);if(!e)throw Error(`useActions must be used within an ActionProvider`);return e}function Gt({confirm:e,onConfirm:t,onCancel:n}){let r=e.variant===`danger`;return(0,H.jsx)(`div`,{style:{position:`fixed`,inset:0,backgroundColor:`rgba(0, 0, 0, 0.5)`,display:`flex`,alignItems:`center`,justifyContent:`center`,zIndex:50},onClick:n,children:(0,H.jsxs)(`div`,{style:{backgroundColor:`white`,borderRadius:`8px`,padding:`24px`,maxWidth:`400px`,width:`100%`,boxShadow:`0 20px 25px -5px rgba(0, 0, 0, 0.1)`},onClick:e=>e.stopPropagation(),children:[(0,H.jsx)(`h3`,{style:{margin:`0 0 8px 0`,fontSize:`18px`,fontWeight:600},children:e.title}),(0,H.jsx)(`p`,{style:{margin:`0 0 24px 0`,color:`#6b7280`},children:e.message}),(0,H.jsxs)(`div`,{style:{display:`flex`,gap:`12px`,justifyContent:`flex-end`},children:[(0,H.jsx)(`button`,{onClick:n,style:{padding:`8px 16px`,borderRadius:`6px`,border:`1px solid #d1d5db`,backgroundColor:`white`,cursor:`pointer`},children:e.cancelLabel??`Cancel`}),(0,H.jsx)(`button`,{onClick:t,style:{padding:`8px 16px`,borderRadius:`6px`,border:`none`,backgroundColor:r?`#dc2626`:`#3b82f6`,color:`white`,cursor:`pointer`},children:e.confirmLabel??`Confirm`})]})]})})}var Kt=(0,V.createContext)(null);function qt({item:e,index:t,basePath:n,children:r}){return(0,H.jsx)(Kt.Provider,{value:{item:e,index:t,basePath:n},children:r})}function Jt(){return(0,V.useContext)(Kt)}var Yt=new WeakMap,Xt={},Zt=class extends V.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){console.error(`[json-render] Rendering error in <${this.props.elementType}>:`,e,t.componentStack)}componentDidUpdate(e){this.state.hasError&&e.resetKey!==this.props.resetKey&&this.setState({hasError:!1})}render(){return this.state.hasError?null:this.props.children}},Qt={},$t=V.createContext(Qt);function en(){return V.useContext($t)}var tn=V.createContext(void 0);function nn(){return V.useContext(tn)}function rn(e,t){let n=t.current;if(n===e)return n;if(n&&e){let t=Object.keys(e);if(t.length===Object.keys(n).length&&t.every(t=>Object.prototype.hasOwnProperty.call(n,t)&&n[t]===e[t]))return n}return t.current=e,e}function an(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function on(e,t){if(Object.is(e,t))return!0;let n=Array.isArray(e);if(n!==Array.isArray(t)||!n&&(e===null||t===null||typeof e!=`object`||typeof t!=`object`))return!1;let r=e,i=t,a=Object.keys(i);return n&&e.length!==t.length||a.length!==Object.keys(r).length?!1:a.every(e=>Object.prototype.hasOwnProperty.call(r,e)&&on(r[e],i[e]))}function sn(e){if(typeof e!=`object`||!e)return e;let t=Array.isArray(e)?Array(e.length):{};for(let n of Object.keys(e))t[n]=sn(e[n]);return t}function cn(e,t){if(Object.is(e,t))return e;let n=Array.isArray(e);if(n!==Array.isArray(t)||!n&&(!an(e)||!an(t)))return t;let r=e,i=t,a=Object.keys(i),o=n?Array(t.length):{},s=(!n||e.length===t.length)&&a.length===Object.keys(r).length;for(let e of a){let t=i[e];Object.prototype.hasOwnProperty.call(r,e)?(t=cn(r[e],t),Object.is(r[e],t)||(s=!1)):s=!1,o[e]=t}return s?e:o}function ln(e){let t=(0,V.useRef)({}),n=(0,V.useRef)(0);if(!e)return{};let r=t.current,i={},a={},o=new Set;for(let t of Object.keys(e.elements)){if(a[t]!==void 0)continue;let s=e.elements[t];if(!s)continue;o.add(t);let c=[{key:t,element:s,children:[...s.children??[],...Object.values(s.slots??{}).flat()],childIndex:0,childVersions:[]}];for(;c.length>0;){let t=c[c.length-1],s=t.children[t.childIndex];if(s!==void 0){let n=a[s];if(n!==void 0){t.childVersions.push([s,n]),t.childIndex+=1;continue}let r=e.elements[s];if(!r||o.has(s)){t.childVersions.push([s,-1]),t.childIndex+=1;continue}o.add(s),c.push({key:s,element:r,children:[...r.children??[],...Object.values(r.slots??{}).flat()],childIndex:0,childVersions:[]});continue}let l=r[t.key],u=l&&on(l.own,t.element)&&on(l.children,t.childVersions)?l.version:++n.current;o.delete(t.key),i[t.key]={own:sn(t.element),children:t.childVersions,version:u},a[t.key]=u,c.pop()}}return t.current=i,a}var un=V.memo(function({Component:e,element:t,slots:n,emit:r,on:i,bindings:a,loading:o,children:s}){return(0,H.jsx)(e,{element:t,slots:n,emit:r,on:i,bindings:a,loading:o,children:s})},(e,t)=>e.Component===t.Component&&e.signature===t.signature&&e.execute===t.execute&&e.actionContext?.item===t.actionContext?.item&&e.actionContext?.index===t.actionContext?.index&&e.actionContext?.basePath===t.actionContext?.basePath&&e.functions===t.functions&&e.directives===t.directives&&e.element.props===t.element.props&&e.bindings===t.bindings&&e.loading===t.loading);function dn(){return V.useSyncExternalStore(Re,Le,()=>!1)}function fn({element:e,elementKey:t,spec:n,registry:r,loading:i,fallback:a,signatures:o}){let s=dn(),c=Jt(),{ctx:l}=Mt(),{execute:u}=Wt(),{getSnapshot:d,state:f}=kt(),p=en(),m=nn(),h=(0,V.useMemo)(()=>{let e=c?{...l,repeatItem:c.item,repeatIndex:c.index,repeatBasePath:c.basePath}:{...l};return e.functions=p,e.directives=m,e},[l,c,p,m]),g=e.repeat!==void 0&&c==null?ie(e.visible):{container:e.visible,itemFilter:void 0},_=g.itemFilter,v=g.container===void 0||fe(g.container,h),y=e.on,b=(0,V.useCallback)(async e=>{let t=y?.[e];if(!t)return;let n=Array.isArray(t)?t:[t];for(let e of n){if(!e.params){await u(e);continue}let t={...h,stateModel:d()},n={};for(let[r,i]of Object.entries(e.params))n[r]=ke(i,t);await u({...e,params:n})}},[y,u,h,d]),x=(0,V.useCallback)(e=>{let t=y?.[e];return t?{emit:()=>b(e),shouldPreventDefault:(Array.isArray(t)?t:[t]).some(e=>e.preventDefault),bound:!0}:{emit:()=>{},shouldPreventDefault:!1,bound:!1}},[y,b]),S=e.watch,C=(0,V.useRef)(null),w=(0,V.useRef)(void 0),T=(0,V.useRef)(void 0),E=(0,V.useRef)({}),O=(0,V.useMemo)(()=>{if(!S)return;let e={};for(let t of Object.keys(S))e[t]=D(f,t);let t=w.current;if(t){let n=Object.keys(e);if(n.length===Object.keys(t).length&&n.every(n=>e[n]===t[n]))return t}return w.current=e,e},[S,f]);if((0,V.useEffect)(()=>{if(!S||!O)return;let e=Object.keys(S);if(e.length===0)return;let t=C.current;if(C.current=O,t===null)return;let n=!1;return(async()=>{for(let r of e){if(n)break;if(O[r]!==t[r]){let e=S[r];if(!e)continue;let t=Array.isArray(e)?e:[e];for(let e of t){if(n)break;if(!e.params){if(await u(e),n)break;continue}let t={...h,stateModel:d()},r={};for(let[n,i]of Object.entries(e.params))r[n]=ke(i,t);if(await u({...e,params:r}),n)break}}}})().catch(console.error),()=>{n=!0}},[S,O,u,h,d]),!v)return null;let k=e.props??Xt,A=rn(Oe(k,h),T),j=cn(E.current,De(k,h));E.current=j;let M=j===e.props?e:{...e,props:j},N=r[M.type]??a;if(!N)return console.warn(`No renderer for component type: ${M.type}`),null;let P=Yt.get(r)?.[M.type];if(M.slots&&P?.slots){let e=new Set(P.slots);for(let t of Object.keys(M.slots))t==="default"?console.warn(`[json-render] Component "${M.type}" uses slots.default. Use "children" for default slot content.`):e.has(t)||console.warn(`[json-render] Unknown slot "${t}" on component "${M.type}". Available slots: ${P.slots.join(`, `)}`)}let F=(e,t)=>e.map(e=>{let s=n.elements[e];if(!s){if(!i){let n=t?`in slot "${t}" of "${M.type}"`:`as child of "${M.type}"`;console.warn(`[json-render] Missing element "${e}" referenced ${n}. This element will not render.`)}return null}return(0,H.jsx)(pn,{element:s,elementKey:e,spec:n,registry:r,loading:i,fallback:a,signatures:o},e)}),I=M.repeat?(0,H.jsx)(mn,{element:M,spec:n,registry:r,loading:i,fallback:a,itemFilter:_,signatures:o}):M.children?F(M.children):void 0,L=M.slots?Object.fromEntries(Object.entries(M.slots).map(([e,t])=>[e,F(t,e)])):void 0,ee=(0,H.jsx)(un,{Component:N,signature:o[t??``],execute:u,actionContext:c,functions:p,directives:m,element:M,slots:L,emit:b,on:x,bindings:A,loading:i,children:I}),te=s&&t?(0,H.jsx)(`span`,{"data-jr-key":t,style:{display:`contents`},children:ee}):ee;return(0,H.jsx)(Zt,{elementType:M.type,resetKey:o[t??``],children:te})}var pn=V.memo(function(e){return(0,H.jsx)(fn,{...e})},(e,t)=>e.elementKey===t.elementKey&&e.signatures[e.elementKey??``]===t.signatures[t.elementKey??``]&&e.registry===t.registry&&e.loading===t.loading&&e.fallback===t.fallback);function mn({element:e,spec:t,registry:n,loading:r,fallback:i,signatures:a,itemFilter:o}){let{state:s}=kt(),{ctx:c}=Mt(),l=Jt(),u=e.repeat,d=O(u.statePath,l?.basePath);if(d===void 0)return console.warn(`[json-render] $item in repeat.statePath used outside of a repeat scope`),null;let f=(D(s,d)??[]).map((e,t)=>({itemValue:e,index:t})).filter(({itemValue:e,index:t})=>o===void 0||fe(o,{...c,repeatItem:e,repeatIndex:t}));return(0,H.jsx)(H.Fragment,{children:f.map(({itemValue:o,index:s})=>{let c=u.key&&typeof o==`object`&&o?String(o[u.key]??s):String(s);return(0,H.jsx)(qt,{item:o,index:s,basePath:k(d,s),children:e.children?.map(o=>{let s=t.elements[o];return s?(0,H.jsx)(pn,{element:s,elementKey:o,spec:t,registry:n,loading:r,fallback:i,signatures:a},o):(r||console.warn(`[json-render] Missing element "${o}" referenced as child of "${e.type}" (repeat). This element will not render.`),null)})},c)})})}function hn({spec:e,registry:t,loading:n,fallback:r}){let i=ln(e);if(!e||!e.root)return null;let a=e.elements[e.root];return a?(0,H.jsx)(pn,{element:a,elementKey:e.root,spec:e,registry:t,loading:n,fallback:r,signatures:i}):null}function gn({registry:e,store:t,initialState:n,handlers:r,navigate:i,validationFunctions:a,functions:o,directives:s,onStateChange:c,children:l}){let u=(0,V.useMemo)(()=>s?pe(s):void 0,[s]);return(0,H.jsx)(Ot,{store:t,initialState:n,onStateChange:c,children:(0,H.jsx)(jt,{children:(0,H.jsx)(Lt,{customFunctions:a,children:(0,H.jsx)(Ut,{handlers:r,navigate:i,children:(0,H.jsx)($t.Provider,{value:o??Qt,children:(0,H.jsxs)(tn.Provider,{value:u,children:[l,(0,H.jsx)(_n,{})]})})})})})})}function _n(){let{pendingConfirmation:e,confirm:t,cancel:n}=Wt();return e?.action.confirm?(0,H.jsx)(Gt,{confirm:e.action.confirm,onConfirm:t,onCancel:n}):null}function vn(e,t){let n={};if(t.components)for(let[e,r]of Object.entries(t.components))n[e]=({element:e,children:t,slots:n,emit:i,on:a,bindings:o,loading:s})=>r({props:e.props,children:t,slots:n,emit:i,on:a,bindings:o,loading:s});let r=e.data.components;r&&Yt.set(n,r);let i=t.actions?Object.entries(t.actions):[];return{registry:n,handlers:(e,t)=>{let n={};for(let[r,a]of i)n[r]=async n=>{let r=e()??(()=>void 0),i=t();await a(n,r,i)};return n},executeAction:async(e,t,n,r={})=>{let a=i.find(([t])=>t===e);a?await a[1](t,n,r):console.warn(`Unknown action: ${e}`)}}}var yn=d([f(),c(),y(),p(),u({$state:f()})]);d([f(),u({$state:f()})]),d([c(),u({$state:f()})]),d([y(),u({$state:f()})]);function bn(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}function xn(e){return(e.startsWith(`/`)?e.slice(1).split(`/`):e.split(`/`)).map(bn)}function Sn(e,t){if(!t||t===`/`)return e;let n=xn(t),r=e;for(let e of n){if(r==null)return;if(Array.isArray(r))r=r[parseInt(e,10)];else if(typeof r==`object`&&Object.hasOwn(r,e))r=r[e];else return}return r}function Cn(e,t){if(typeof e==`string`)return e;if(t!=null)return e.$item===``||e.$item===`/`?t:Tn(t,e.$item)}function wn(e,t){return Tn(e,String(t))}function Tn(e,t){let n=t.startsWith(`/`)?t.slice(1):t;return e===``||e===`/`?`/${n}`:`${e}/${n}`}function En(e){return/^\d+$/.test(e)}function Dn(e,t){return En(t)&&Number(t)<=e.length?Number(t):void 0}function On(e,t,n){let r=xn(t);if(r.length===0||r.includes(`__proto__`))return;let i=e;for(let e=0;e<r.length-1;e++){let t=r[e],n=r[e+1],a=n!==void 0&&(En(n)||n===`-`);if(Array.isArray(i)){let e=Dn(i,t);if(e===void 0)return;(i[e]===void 0||typeof i[e]!=`object`)&&(i[e]=a?[]:{}),i=i[e]}else Object.hasOwn(i,t)&&typeof i[t]==`object`||(i[t]=a?[]:{}),i=i[t]}let a=r[r.length-1];if(Array.isArray(i)){if(a===`-`)i.push(n);else{let e=Dn(i,a);e!==void 0&&(i[e]=n)}}else i[a]=n}function kn(e,t,n){let r=xn(t);if(r.length===0||r.includes(`__proto__`))return;let i=e;for(let e=0;e<r.length-1;e++){let t=r[e],n=r[e+1],a=n!==void 0&&(En(n)||n===`-`);if(Array.isArray(i)){let e=Dn(i,t);if(e===void 0)return;(i[e]===void 0||typeof i[e]!=`object`)&&(i[e]=a?[]:{}),i=i[e]}else Object.hasOwn(i,t)&&typeof i[t]==`object`||(i[t]=a?[]:{}),i=i[t]}let a=r[r.length-1];if(Array.isArray(i)){if(a===`-`)i.push(n);else{let e=Dn(i,a);e!==void 0&&i.splice(e,0,n)}}else i[a]=n}function An(e,t){let n=xn(t);if(n.length===0||n.includes(`__proto__`))return;let r=e;for(let e=0;e<n.length-1;e++){let t=n[e];if(Array.isArray(r)){let e=parseInt(t,10);if(r[e]===void 0||typeof r[e]!=`object`)return;r=r[e]}else{if(!Object.hasOwn(r,t)||typeof r[t]!=`object`)return;r=r[t]}}let i=n[n.length-1];if(Array.isArray(r)){let e=parseInt(i,10);e>=0&&e<r.length&&r.splice(e,1)}else delete r[i]}function jn(e,t){if(e===t)return!0;if(e===null||t===null||typeof e!=typeof t||typeof e!=`object`)return!1;if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:e.every((e,n)=>jn(e,t[n]));let n=e,r=t,i=Object.keys(n),a=Object.keys(r);return i.length===a.length&&i.every(e=>jn(n[e],r[e]))}function Mn(e){let t=e.trim();if(!t||!t.startsWith(`{`))return null;try{let e=JSON.parse(t);return e.op&&e.path!==void 0?e:null}catch{return null}}function Nn(e,t){switch(t.op){case`add`:kn(e,t.path,t.value);break;case`replace`:On(e,t.path,t.value);break;case`remove`:An(e,t.path);break;case`move`:{if(!t.from)break;let n=Sn(e,t.from);An(e,t.from),kn(e,t.path,n);break}case`copy`:{if(!t.from)break;let n=Sn(e,t.from);kn(e,t.path,n);break}case`test`:if(!jn(Sn(e,t.path),t.value))throw Error(`Test operation failed: value at "${t.path}" does not match`)}return e}function Pn(e,t={}){let n=e.split(`
66
+ `),r={...t};for(let e of n){let t=Mn(e);t&&Nn(r,t)}return r}var Fn=d([c(),u({$state:f()})]),In={eq:a().optional(),neq:a().optional(),gt:Fn.optional(),gte:Fn.optional(),lt:Fn.optional(),lte:Fn.optional(),not:b(!0).optional()},Ln=u({$state:f(),...In}),Rn=u({$item:f(),...In}),zn=u({$index:b(!0),...In}),Bn=d([Ln,Rn,zn]),Vn=m(()=>d([y(),Bn,g(Bn),u({$and:g(Vn)}),u({$or:g(Vn)})])),Hn=d([h({$state:f(),...In}),h({$item:f(),...In}),h({$index:b(!0),...In})]);function Un(e){return e===void 0||typeof e==`boolean`?!1:Array.isArray(e)?e.some(Un):typeof e!=`object`||!e?!1:`$item`in e||`$index`in e?!0:`$and`in e?e.$and.some(Un):`$or`in e&&e.$or.some(Un)}function Wn(e){if(e===void 0||!Un(e))return{container:e,itemFilter:void 0};let t=e=>{let t=e.filter(e=>!Un(e)),n=e.filter(e=>Un(e));return{container:t.length>0?{$and:t}:void 0,itemFilter:n.length>0?{$and:n}:void 0}};return Array.isArray(e)?t(e):typeof e==`object`&&e&&`$and`in e?t(e.$and):{container:void 0,itemFilter:e}}var Gn=m(()=>d([y(),Hn,g(Hn),h({$and:g(Gn)}),h({$or:g(Gn)})]));function Kn(e,t){return typeof e==`object`&&e&&`$state`in e&&typeof e.$state==`string`?Sn(t.stateModel,e.$state):e}function qn(e){return`$item`in e}function Jn(e){return`$index`in e}function Yn(e,t){return Jn(e)?t.repeatIndex:qn(e)?t.repeatItem===void 0?void 0:e.$item===``?t.repeatItem:Sn(t.repeatItem,e.$item):Sn(t.stateModel,e.$state)}function Xn(e,t){let n=Yn(e,t),r;if(e.eq!==void 0)r=n===Kn(e.eq,t);else if(e.neq!==void 0)r=n!==Kn(e.neq,t);else if(e.gt!==void 0){let i=Kn(e.gt,t);r=typeof n==`number`&&typeof i==`number`&&n>i}else if(e.gte!==void 0){let i=Kn(e.gte,t);r=typeof n==`number`&&typeof i==`number`&&n>=i}else if(e.lt!==void 0){let i=Kn(e.lt,t);r=typeof n==`number`&&typeof i==`number`&&n<i}else if(e.lte!==void 0){let i=Kn(e.lte,t);r=typeof n==`number`&&typeof i==`number`&&n<=i}else r=!!n;return e.not===!0?!r:r}function Zn(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&`$and`in e}function Qn(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&`$or`in e}function $n(e,t){return e===void 0?!0:typeof e==`boolean`?e:Array.isArray(e)?e.every(e=>Xn(e,t)):Zn(e)?e.$and.every(e=>$n(e,t)):Qn(e)?e.$or.some(e=>$n(e,t)):Xn(e,t)}function er(e,t){if(!t||t.size===0)return;let n;for(let[r,i]of t)if(r in e){if(n)throw Error(`Ambiguous directive: object has multiple directive keys ("${n.name}" and "${r}")`);n=i}return n}function tr(e){return typeof e==`object`&&!!e&&`$state`in e&&typeof e.$state==`string`}function nr(e){return typeof e==`object`&&!!e&&`$item`in e&&typeof e.$item==`string`}function rr(e){return typeof e==`object`&&!!e&&`$index`in e&&e.$index===!0}function ir(e){return typeof e==`object`&&!!e&&`$bindState`in e&&typeof e.$bindState==`string`}function ar(e){return typeof e==`object`&&!!e&&`$bindItem`in e&&typeof e.$bindItem==`string`}function or(e){return typeof e==`object`&&!!e&&`$cond`in e&&`$then`in e&&`$else`in e}function sr(e){return typeof e==`object`&&!!e&&`$computed`in e&&typeof e.$computed==`string`}function cr(e){return typeof e==`object`&&!!e&&`$template`in e&&typeof e.$template==`string`}var lr=100,ur=new Set;function dr(e,t){if(t.repeatBasePath==null)console.warn(`$bindItem used outside repeat scope: "${e}"`);else return e===``?t.repeatBasePath:t.repeatBasePath+`/`+e}function fr(e,t){if(e==null)return e;if(tr(e))return Sn(t.stateModel,e.$state);if(nr(e))return t.repeatItem===void 0?void 0:e.$item===``?t.repeatItem:Sn(t.repeatItem,e.$item);if(rr(e))return t.repeatIndex;if(ir(e))return Sn(t.stateModel,e.$bindState);if(ar(e)){let n=dr(e.$bindItem,t);return n===void 0?void 0:Sn(t.stateModel,n)}if(or(e))return fr($n(e.$cond,t)?e.$then:e.$else,t);if(sr(e)){let n=t.functions?.[e.$computed];if(!n){ur.has(e.$computed)||(ur.size<lr&&ur.add(e.$computed),console.warn(`Unknown $computed function: "${e.$computed}"`));return}let r={};if(e.args)for(let[n,i]of Object.entries(e.args))r[n]=fr(i,t);return n(r)}if(cr(e))return e.$template.replace(/\$\{([^}]+)\}/g,(e,n)=>{if(n.startsWith(`/`)){let e=Sn(t.stateModel,n);return e==null?``:String(e)}if(t.repeatItem!==void 0){let e=Sn(t.repeatItem,n);if(e!=null)return String(e)}let r=Sn(t.stateModel,`/`+n);return r==null?``:String(r)});if(Array.isArray(e))return e.map(e=>fr(e,t));if(typeof e==`object`){let n=er(e,t.directives);if(n)return n.resolve(e,t);let r={};for(let[n,i]of Object.entries(e))r[n]=fr(i,t);return r}return e}function pr(e,t){let n={};for(let[r,i]of Object.entries(e))n[r]=fr(i,t);return n}function mr(e,t){let n;for(let[r,i]of Object.entries(e))if(ir(i))n||={},n[r]=i.$bindState;else if(ar(i)){let e=dr(i.$bindItem,t);e!==void 0&&(n||={},n[r]=e)}return n}function hr(e,t){return nr(e)?dr(e.$item,t):rr(e)?t.repeatIndex:fr(e,t)}var gr=0,_r=new Set;function vr(){return gr>0}function yr(e){return _r.add(e),()=>{_r.delete(e)}}var br=u({title:f(),message:f(),confirmLabel:f().optional(),cancelLabel:f().optional(),variant:v([`default`,`danger`]).optional()}),xr=d([u({navigate:f()}),u({set:_(f(),a())}),u({action:f(),params:_(f(),yn).optional()})]),Sr=d([u({set:_(f(),a())}),u({action:f(),params:_(f(),yn).optional()})]),Cr=u({action:f(),params:_(f(),yn).optional(),confirm:br.optional(),onSuccess:xr.optional(),onError:Sr.optional(),preventDefault:y().optional()}),wr=u({type:f(),args:_(f(),yn).optional(),message:f()});u({checks:g(wr).optional(),validateOn:v([`change`,`blur`,`submit`]).optional(),enabled:Vn.optional()});var Tr=[`patch`];function Er(e){return e?.modes?.length?e.modes:Tr}function Dr(){return`PATCH MODE (RFC 6902 JSON Patch):
67
+ Output one JSON object per line. Each line is a patch operation.
68
+ - Add: {"op":"add","path":"/elements/new-key","value":{...}}
69
+ - Replace: {"op":"replace","path":"/elements/existing-key","value":{...}}
70
+ - Remove: {"op":"remove","path":"/elements/old-key"}
71
+ Only output patches for what needs to change.`}function Or(){return`MERGE MODE (RFC 7396 JSON Merge Patch):
72
+ Output a single JSON object on one line with __json_edit set to true.
73
+ Include only the keys that changed. Unmentioned keys are preserved.
74
+ Set a key to null to delete it.
75
+
76
+ Example (update a title and add an element):
77
+ {"__json_edit":true,"elements":{"main":{"props":{"title":"New Title"}},"new-el":{"type":"Card","props":{},"children":[]}}}
78
+
79
+ Example (delete an element):
80
+ {"__json_edit":true,"elements":{"old-widget":null}}`}function kr(){return`DIFF MODE (unified diff):
81
+ Output a unified diff inside a \`\`\`diff code fence.
82
+ The diff applies against the JSON-serialized current spec.
83
+
84
+ Example:
85
+ \`\`\`diff
86
+ --- a/spec.json
87
+ +++ b/spec.json
88
+ @@ -3,1 +3,1 @@
89
+ - "title": "Login"
90
+ + "title": "Welcome Back"
91
+ \`\`\``}function Ar(){return'PATCH MODE (RFC 6902 JSON Patch):\nOutput RFC 6902 JSON Patch lines inside a ```yaml-patch code fence.\nEach line is one JSON patch operation.\n\nExample:\n```yaml-patch\n{"op":"replace","path":"/elements/main/props/title","value":"New Title"}\n{"op":"add","path":"/elements/new-el","value":{"type":"Card","props":{},"children":[]}}\n```'}function jr(){return`MERGE MODE (RFC 7396 JSON Merge Patch):
92
+ Output only the changed parts in a \`\`\`yaml-edit code fence.
93
+ Uses deep merge semantics: only keys you include are updated. Unmentioned elements and props are preserved.
94
+ Set a key to null to delete it.
95
+
96
+ Example edit (update title, add a new element):
97
+ \`\`\`yaml-edit
98
+ elements:
99
+ main:
100
+ props:
101
+ title: Updated Title
102
+ new-chart:
103
+ type: Card
104
+ props: {}
105
+ children: []
106
+ \`\`\`
107
+
108
+ Example deletion:
109
+ \`\`\`yaml-edit
110
+ elements:
111
+ old-widget: null
112
+ \`\`\``}function Mr(){return`DIFF MODE (unified diff):
113
+ Output a unified diff inside a \`\`\`diff code fence.
114
+ The diff applies against the YAML-serialized current spec.
115
+
116
+ Example:
117
+ \`\`\`diff
118
+ --- a/spec.yaml
119
+ +++ b/spec.yaml
120
+ @@ -6,1 +6,1 @@
121
+ - title: Login
122
+ + title: Welcome Back
123
+ \`\`\``}function Nr(e){if(e.length===1)return``;let t=[`Choose the best edit strategy for the requested change:`];return e.includes(`patch`)&&t.push(`- PATCH: best for precise, targeted single-field updates`),e.includes(`merge`)&&t.push(`- MERGE: best for structural changes (add/remove elements, reparent children, update multiple props at once)`),e.includes(`diff`)&&t.push(`- DIFF: best for small text-level changes when you can see the exact lines to change`),t.join(`
124
+ `)}function Pr(e,t){let n=Er(e),r=[];r.push(`EDITING EXISTING SPECS:`),r.push(``);let i=Nr(n);i&&(r.push(i),r.push(``));for(let e of n){if(t===`json`)switch(e){case`patch`:r.push(Dr());break;case`merge`:r.push(Or());break;case`diff`:r.push(kr())}else switch(e){case`patch`:r.push(Ar());break;case`merge`:r.push(jr());break;case`diff`:r.push(Mr())}r.push(``)}return r.join(`
125
+ `)}function Fr(){return{string:()=>({kind:`string`}),number:()=>({kind:`number`}),boolean:()=>({kind:`boolean`}),array:e=>({kind:`array`,inner:e}),object:e=>({kind:`object`,inner:e}),record:e=>({kind:`record`,inner:e}),any:()=>({kind:`any`}),zod:()=>({kind:`zod`}),ref:e=>({kind:`ref`,inner:e}),propsOf:e=>({kind:`propsOf`,inner:e}),map:e=>({kind:`map`,inner:e}),optional:()=>({optional:!0})}}function Ir(e,t){return{definition:e(Fr()),promptTemplate:t?.promptTemplate,defaultRules:t?.defaultRules,builtInActions:t?.builtInActions,createCatalog(e){return Lr(this,e)}}}function Lr(e,t){let n=t.components,r=t.actions,i=n?Object.keys(n):[],a=r?Object.keys(r):[],o=Rr(e.definition,t);return{schema:e,data:t,componentNames:i,actionNames:a,prompt(e={}){return Hr(this,e)},jsonSchema(e={}){return Zr(o,e.strict??!1)},validate(e){let t=o.safeParse(e);return t.success?{success:!0,data:t.data}:{success:!1,error:t.error}},zodSchema(){return o},get _specType(){throw Error(`_specType is only for type inference`)}}}function Rr(e,t){return zr(e.spec,t)}function zr(e,t){switch(e.kind){case`string`:return f();case`number`:return c();case`boolean`:return y();case`any`:return o();case`array`:{let n=zr(e.inner,t);return g(n)}case`object`:{let n=e.inner,r={};for(let[e,i]of Object.entries(n)){let n=zr(i,t);i.optional&&(n=n.optional()),r[e]=n}return u(r)}case`record`:{let n=zr(e.inner,t);return _(f(),n)}case`ref`:{let n=e.inner,r=Br(n,t);return r.length===0?f():r.length===1?b(r[0]):v(r)}case`propsOf`:{let n=e.inner,r=Vr(n,t);return r.length===0?_(f(),a()):r.length===1?r[0]:_(f(),a())}default:return a()}}function Br(e,t){let n=e.split(`.`),r={catalog:t};for(let e of n)if(r&&typeof r==`object`)r=r[e];else return[];return r&&typeof r==`object`?Object.keys(r):[]}function Vr(e,t){let n=e.split(`.`),r={catalog:t};for(let e of n)if(r&&typeof r==`object`)r=r[e];else return[];return r&&typeof r==`object`?Object.values(r).map(e=>e.props).filter(e=>e!==void 0):[]}function Hr(e,t){if(e.schema.promptTemplate){let n={catalog:e.data,componentNames:e.componentNames,actionNames:e.actionNames,options:t,formatZodType:Jr};return e.schema.promptTemplate(n)}let{system:n=`You are a UI generator that outputs JSON.`,customRules:r=[],mode:i=`standalone`}=t,a=i===`chat`?(console.warn(`[json-render] mode "chat" is deprecated, use "inline" instead`),`inline`):i===`generate`?(console.warn(`[json-render] mode "generate" is deprecated, use "standalone" instead`),`standalone`):i,o=[];o.push(n),o.push(``),a===`inline`?(o.push(`OUTPUT FORMAT (text + JSONL, RFC 6902 JSON Patch):`),o.push("You respond conversationally. When generating UI, first write a brief explanation (1-3 sentences), then output JSONL patch lines wrapped in a ```spec code fence."),o.push("The JSONL lines use RFC 6902 JSON Patch operations to build a UI tree. Always wrap them in a ```spec fence block:"),o.push(" ```spec"),o.push(` {"op":"add","path":"/root","value":"main"}`),o.push(` {"op":"add","path":"/elements/main","value":{"type":"Card","props":{"title":"Hello"},"children":[]}}`),o.push(" ```"),o.push(`If the user's message does not require a UI (e.g. a greeting or clarifying question), respond with text only — no JSONL.`)):(o.push(`OUTPUT FORMAT (JSONL, RFC 6902 JSON Patch):`),o.push(`Output JSONL (one JSON object per line) using RFC 6902 JSON Patch operations to build a UI tree.`)),o.push(`Each line is a JSON patch operation (add, remove, replace). Start with /root, then stream /elements and /state patches interleaved so the UI fills in progressively as it streams.`),o.push(``),o.push(`Example output (each line is a separate JSON object):`),o.push(``);let s=e.data.components,c=e.schema.definition.spec,l=(c.kind===`object`?c.inner:void 0)?.elements,u=l?.kind===`record`?l.inner:void 0,d=(u?.kind===`object`?u.inner:void 0)?.slots!==void 0,f=e.componentNames,p=f[0]||`Component`,m=f.length>1?f[1]:p,h=s?.[p],g=s?.[m],_=h?Ur(h):{},v=g?Ur(g):{},y=g?.props?Kr(g.props):null,b=y?{...v,[y]:{$item:`title`}}:v,x=[JSON.stringify({op:`add`,path:`/root`,value:`main`}),JSON.stringify({op:`add`,path:`/elements/main`,value:{type:p,props:_,children:[`child-1`,`list`]}}),JSON.stringify({op:`add`,path:`/elements/child-1`,value:{type:m,props:v,children:[]}}),JSON.stringify({op:`add`,path:`/elements/list`,value:{type:p,props:_,repeat:{statePath:`/items`,key:`id`},children:[`item`]}}),JSON.stringify({op:`add`,path:`/elements/item`,value:{type:m,props:b,children:[]}}),JSON.stringify({op:`add`,path:`/state/items`,value:[]}),JSON.stringify({op:`add`,path:`/state/items/0`,value:{id:`1`,title:`First Item`}}),JSON.stringify({op:`add`,path:`/state/items/1`,value:{id:`2`,title:`Second Item`}})].join(`
126
+ `);o.push(`${x}
127
+
128
+ Note: state patches appear right after the elements that use them, so the UI fills in as it streams. ONLY use component types from the AVAILABLE COMPONENTS list below.`),o.push(``),o.push(`INITIAL STATE:`),o.push(`Specs include a /state field to seed the state model. Components with { $bindState } or { $bindItem } read from and write to this state, and $state expressions read from it.`),o.push(`CRITICAL: You MUST include state patches whenever your UI displays data via $state, $bindState, $bindItem, $item, or $index expressions, or uses repeat to iterate over arrays. Without state, these references resolve to nothing and repeat lists render zero items.`),o.push(`Output state patches right after the elements that reference them, so the UI fills in progressively as it streams.`),o.push(`Stream state progressively - output one patch per array item instead of one giant blob:`),o.push(` For arrays: {"op":"add","path":"/state/posts/0","value":{"id":"1","title":"First Post",...}} then /state/posts/1, /state/posts/2, etc.`),o.push(` For scalars: {"op":"add","path":"/state/newTodoText","value":""}`),o.push(` Initialize the array first if needed: {"op":"add","path":"/state/posts","value":[]}`),o.push(`When content comes from the state model, use { "$state": "/some/path" } dynamic props to display it instead of hardcoding the same value in both state and props. The state model is the single source of truth.`),o.push(`Include realistic sample data in state. For blogs: 3-4 posts with titles, excerpts, authors, dates. For product lists: 3-5 items with names, prices, descriptions. Never leave arrays empty.`),o.push(``),o.push(`DYNAMIC LISTS (repeat field):`),o.push(`Any element can have a top-level "repeat" field to render its children once per item in a state array: { "repeat": { "statePath": "/arrayPath", "key": "id" } }.`),o.push(`The element itself renders once (as the container), and its children are expanded once per array item. "statePath" is the state array path. "key" is an optional field name on each item for stable React keys.`),o.push(`For nested lists, an inner repeat can read an array from the enclosing item with { "statePath": { "$item": "field" } }. This form is valid only inside another repeat. Use an empty field to repeat over the enclosing item itself.`),o.push(`Example: ${JSON.stringify({type:p,props:_,repeat:{statePath:`/todos`,key:`id`},children:[`todo-item`]})}`),o.push(`Inside children of a repeated element, use { "$item": "field" } to read a field from the current item, and { "$index": true } to get the current array index. For two-way binding to an item field use { "$bindItem": "completed" } on the appropriate prop.`),o.push(`ALWAYS use the repeat field for lists backed by state arrays. NEVER hardcode individual elements for each array item.`),o.push(`IMPORTANT: "repeat" is a top-level field on the element (sibling of type/props/children), NOT inside props.`),o.push(``),o.push(`ARRAY STATE ACTIONS:`),o.push(`Use action "pushState" to append items to arrays. Params: { statePath: "/arrayPath", value: { ...item }, clearStatePath: "/inputPath" }.`),o.push(`Values inside pushState can contain { "$state": "/statePath" } references to read current state (e.g. the text from an input field).`),o.push(`Use "$id" inside a pushState value to auto-generate a unique ID.`),o.push(`Example: on: { "press": { "action": "pushState", "params": { "statePath": "/todos", "value": { "id": "$id", "title": { "$state": "/newTodoText" }, "completed": false }, "clearStatePath": "/newTodoText" } } }`),o.push(`Use action "removeState" to remove items from arrays by index. Params: { statePath: "/arrayPath", index: N }. Inside a repeated element's children, use { "$index": true } for the current item index. Action params support the same expressions as props: { "$item": "field" } resolves to the absolute state path, { "$index": true } resolves to the index number, and { "$state": "/path" } reads a value from state.`),o.push(`For lists where users can add/remove items (todos, carts, etc.), use pushState and removeState instead of hardcoding with setState.`),o.push(``),o.push(`IMPORTANT: State paths use RFC 6901 JSON Pointer syntax (e.g. "/todos/0/title"). Do NOT use JavaScript-style dot notation (e.g. "/todos.length" is WRONG). To generate unique IDs for new items, use "$id" instead of trying to read array length.`),o.push(``);let S=s;if(S){o.push(`AVAILABLE COMPONENTS (${e.componentNames.length}):`),o.push(``);for(let[e,t]of Object.entries(S)){let n=t.props?Jr(t.props):`{}`,r=t.slots??[],i=r.filter(e=>e!=="default"),a=r.includes(`default`),s=d?[a?`accepts children`:``,i.length>0?`slots: ${i.join(`, `)}`:``].filter(Boolean).join(`; `):r.length>0?`accepts children`:``,c=s?` [${s}]`:``,l=t.events&&t.events.length>0?` [events: ${t.events.join(`, `)}]`:``,u=t.description?` - ${t.description}`:``;o.push(`- ${e}: ${n}${u}${c}${l}`)}o.push(``)}let C=e.data.actions,w=e.schema.builtInActions??[],T=C&&e.actionNames.length>0,E=w.length>0;if(T||E){o.push(`AVAILABLE ACTIONS:`),o.push(``);for(let e of w)o.push(`- ${e.name}: ${e.description} [built-in]`);if(T)for(let[e,t]of Object.entries(C))o.push(`- ${e}${t.description?`: ${t.description}`:``}`);o.push(``)}o.push("EVENTS (the `on` field):"),o.push("Elements can have an optional `on` field to bind events to actions. The `on` field is a top-level field on the element (sibling of type/props/children), NOT inside props."),o.push('Each key in `on` is an event name (from the component\'s supported events), and the value is an action binding: `{ "action": "<actionName>", "params": { ... } }`.'),o.push(``),o.push(`Example:`),o.push(` ${JSON.stringify({type:p,props:_,on:{press:{action:`setState`,params:{statePath:`/saved`,value:!0}}},children:[]})}`),o.push(``),o.push(`Action params can use dynamic references to read from state: { "$state": "/statePath" }.`),o.push("IMPORTANT: Do NOT put action/actionParams inside props. Always use the `on` field for event bindings."),o.push(``),o.push(`VISIBILITY CONDITIONS:`),o.push("Elements can have an optional `visible` field to conditionally show/hide based on state. IMPORTANT: `visible` is a top-level field on the element object (sibling of type/props/children), NOT inside props."),o.push(`Correct: ${JSON.stringify({type:p,props:_,visible:{$state:`/activeTab`,eq:`home`},children:[`...`]})}`),o.push('- `{ "$state": "/path" }` - visible when state at path is truthy'),o.push('- `{ "$state": "/path", "not": true }` - visible when state at path is falsy'),o.push('- `{ "$state": "/path", "eq": "value" }` - visible when state equals value'),o.push('- `{ "$state": "/path", "neq": "value" }` - visible when state does not equal value'),o.push('- `{ "$state": "/path", "gt": N }` / `gte` / `lt` / `lte` - numeric comparisons'),o.push(`- Use ONE operator per condition (eq, neq, gt, gte, lt, lte). Do not combine multiple operators.`),o.push('- Any condition can add `"not": true` to invert its result'),o.push("- `[condition, condition]` - all conditions must be true (implicit AND)"),o.push('- `{ "$and": [condition, condition] }` - explicit AND (use when nesting inside $or)'),o.push('- `{ "$or": [condition, condition] }` - at least one must be true (OR)'),o.push("- `true` / `false` - always visible/hidden"),o.push(``),o.push(`Use a component with on.press bound to setState to update state and drive visibility.`),o.push(`Example: A ${p} with on: { "press": { "action": "setState", "params": { "statePath": "/activeTab", "value": "home" } } } sets state, then a container with visible: { "$state": "/activeTab", "eq": "home" } shows only when that tab is active.`),o.push(``),o.push(`For tab patterns where the first/default tab should be visible when no tab is selected yet, use $or to handle both cases: visible: { "$or": [{ "$state": "/activeTab", "eq": "home" }, { "$state": "/activeTab", "not": true }] }. This ensures the first tab is visible both when explicitly selected AND when /activeTab is not yet set.`),o.push(``),o.push(`DYNAMIC PROPS:`),o.push(`Any prop value can be a dynamic expression that resolves based on state. Three forms are supported:`),o.push(``),o.push('1. Read-only state: `{ "$state": "/statePath" }` - resolves to the value at that state path (one-way read).'),o.push(' Example: `"color": { "$state": "/theme/primary" }` reads the color from state.'),o.push(``),o.push('2. Two-way binding: `{ "$bindState": "/statePath" }` - resolves to the value at the state path AND enables write-back. Use on form input props (value, checked, pressed, etc.).'),o.push(' Example: `"value": { "$bindState": "/form/email" }` binds the input value to /form/email.'),o.push(' Inside repeat scopes: `"checked": { "$bindItem": "completed" }` binds to the current item\'s completed field.'),o.push(``),o.push('3. Conditional: `{ "$cond": <condition>, "$then": <value>, "$else": <value> }` - evaluates the condition (same syntax as visibility conditions) and picks the matching value.'),o.push(' Example: `"color": { "$cond": { "$state": "/activeTab", "eq": "home" }, "$then": "#007AFF", "$else": "#8E8E93" }`'),o.push(``),o.push(`Use $bindState for form inputs (text fields, checkboxes, selects, sliders, etc.) and $state for read-only data display. Inside repeat scopes, use $bindItem for form inputs bound to the current item. Use dynamic props instead of duplicating elements with opposing visible conditions when only prop values differ.`),o.push(``),o.push('4. Template: `{ "$template": "Hello, ${/name}!" }` - interpolates references in the string. Absolute paths like `${/path}` resolve against the state model. Bare names like `${field}` resolve against the current repeat item first, then fall back to the state model at `/<field>`.'),o.push(' Example: `"label": { "$template": "Items: ${/cart/count} | Total: ${/cart/total}" }` renders "Items: 3 | Total: 42.00" when /cart/count is 3 and /cart/total is 42.00. Inside a repeat, `{ "$template": "${name} - ${email}" }` reads name and email from each item.'),o.push(``);let D=e.data.functions;if(D&&Object.keys(D).length>0){o.push('5. Computed: `{ "$computed": "<functionName>", "args": { "key": <expression> } }` - calls a registered function with resolved args and returns the result.'),o.push(' Example: `"value": { "$computed": "fullName", "args": { "first": { "$state": "/form/firstName" }, "last": { "$state": "/form/lastName" } } }`'),o.push(` Available functions:`);for(let e of Object.keys(D))o.push(` - ${e}`);o.push(``)}let O=t.directives;if(O&&O.length>0){o.push(`CUSTOM DYNAMIC VALUES:`),o.push(``);for(let e of O){let t=e.description?` (${e.description})`:``;o.push(`- ${e.name}${t}: ${Jr(e.schema)}`)}o.push(``),o.push(`Directives compose: any value field can contain another directive or a $state expression, resolved inside-out.`),o.push(``)}s&&Object.entries(s).some(([,e])=>e.props?Jr(e.props).includes(`checks`):!1)&&(o.push(`VALIDATION:`),o.push("Form components that accept a `checks` prop support client-side validation."),o.push(`Each check is an object: { "type": "<name>", "message": "...", "args": { ... } }`),o.push(``),o.push(`Built-in validation types:`),o.push(` - required — value must be non-empty`),o.push(` - email — valid email format`),o.push(` - minLength — minimum string length (args: { "min": N })`),o.push(` - maxLength — maximum string length (args: { "max": N })`),o.push(` - pattern — match a regex (args: { "pattern": "regex" })`),o.push(` - min — minimum numeric value (args: { "min": N })`),o.push(` - max — maximum numeric value (args: { "max": N })`),o.push(` - numeric — value must be a number`),o.push(` - url — valid URL format`),o.push(` - matches — must equal another field (args: { "other": { "$state": "/path" } })`),o.push(` - equalTo — alias for matches (args: { "other": { "$state": "/path" } })`),o.push(` - lessThan — value must be less than another field (args: { "other": { "$state": "/path" } })`),o.push(` - greaterThan — value must be greater than another field (args: { "other": { "$state": "/path" } })`),o.push(` - requiredIf — required only when another field is truthy (args: { "field": { "$state": "/path" } })`),o.push(``),o.push(`Example:`),o.push(` "checks": [{ "type": "required", "message": "Email is required" }, { "type": "email", "message": "Invalid email" }]`),o.push(``),o.push(`IMPORTANT: When using checks, the component must also have a { $bindState } or { $bindItem } on its value/checked prop for two-way binding.`),o.push(`Always include validation checks on form inputs for a good user experience (e.g. required, email, minLength).`),o.push(``)),(T||E)&&(o.push(`STATE WATCHERS:`),o.push("Elements can have an optional `watch` field to react to state changes and trigger actions. The `watch` field is a top-level field on the element (sibling of type/props/children), NOT inside props."),o.push(`Maps state paths (JSON Pointers) to action bindings. When the value at a watched path changes, the bound actions fire automatically.`),o.push(``),o.push(`Example (cascading select — country changes trigger city loading):`),o.push(` ${JSON.stringify({type:`Select`,props:{value:{$bindState:`/form/country`},options:[`US`,`Canada`,`UK`]},watch:{"/form/country":{action:`loadCities`,params:{country:{$state:`/form/country`}}}},children:[]})}`),o.push(``),o.push("Use `watch` for cascading dependencies where changing one field should trigger side effects (loading data, resetting dependent fields, computing derived values)."),o.push("IMPORTANT: `watch` is a top-level field on the element (sibling of type/props/children), NOT inside props. Watchers only fire when the value changes, not on initial render."),o.push(``));let k=t.editModes;k&&k.length>0&&o.push(Pr({modes:k},`json`)),o.push(`RULES:`);let A=a===`inline`?["When generating UI, wrap all JSONL patches in a ```spec code fence - one JSON object per line inside the fence",`Write a brief conversational response before any JSONL output`,`First set root: {"op":"add","path":"/root","value":"<root-key>"}`,`Then add each element: {"op":"add","path":"/elements/<key>","value":{...}}`,`Output /state patches right after the elements that use them, one per array item for progressive loading. REQUIRED whenever using $state, $bindState, $bindItem, $item, $index, or repeat.`,`ONLY use components listed above`,`Each element value needs: type, props, children (array of child keys)`,`Use unique keys for the element map entries (e.g., 'header', 'metric-1', 'chart-revenue')`]:[`Output ONLY JSONL patches - one JSON object per line, no markdown, no code fences`,`First set root: {"op":"add","path":"/root","value":"<root-key>"}`,`Then add each element: {"op":"add","path":"/elements/<key>","value":{...}}`,`Output /state patches right after the elements that use them, one per array item for progressive loading. REQUIRED whenever using $state, $bindState, $bindItem, $item, $index, or repeat.`,`ONLY use components listed above`,`Each element value needs: type, props, children (array of child keys)`,`Use unique keys for the element map entries (e.g., 'header', 'metric-1', 'chart-revenue')`],j=e.schema.defaultRules??[];return[...A,...j,...r].forEach((e,t)=>{o.push(`${t+1}. ${e}`)}),o.join(`
129
+ `)}function Ur(e){return e.example&&Object.keys(e.example).length>0?e.example:e.props?Wr(e.props):{}}function Wr(e){if(!e||!e._def)return{};let t=e._def,n=qr(e);if(n!==`ZodObject`&&n!==`object`)return{};let r=typeof t.shape==`function`?t.shape():t.shape;if(!r)return{};let i={};for(let[e,t]of Object.entries(r)){let n=qr(t);n!==`ZodOptional`&&n!==`optional`&&n!==`ZodNullable`&&n!==`nullable`&&(i[e]=Gr(t))}return i}function Gr(e){if(!e||!e._def)return`...`;let t=e._def;switch(qr(e)){case`ZodString`:case`string`:return`example`;case`ZodNumber`:case`number`:return 0;case`ZodBoolean`:case`boolean`:return!0;case`ZodLiteral`:case`literal`:return t.value;case`ZodEnum`:case`enum`:if(Array.isArray(t.values)&&t.values.length>0)return t.values[0];if(t.entries&&typeof t.entries==`object`){let e=Object.values(t.entries);return e.length>0?e[0]:`example`}return`example`;case`ZodOptional`:case`optional`:case`ZodNullable`:case`nullable`:case`ZodDefault`:case`default`:{let e=t.innerType??t.wrapped;return e?Gr(e):null}case`ZodArray`:case`array`:return[];case`ZodObject`:case`object`:return Wr(e);case`ZodUnion`:case`union`:{let e=t.options;return e&&e.length>0?Gr(e[0]):`...`}default:return`...`}}function Kr(e){if(!e||!e._def)return null;let t=e._def,n=qr(e);if(n!==`ZodObject`&&n!==`object`)return null;let r=typeof t.shape==`function`?t.shape():t.shape;if(!r)return null;for(let[e,t]of Object.entries(r)){let n=qr(t);if(n!==`ZodOptional`&&n!==`optional`&&n!==`ZodNullable`&&n!==`nullable`&&(n===`ZodString`||n===`string`))return e}return null}function qr(e){if(!e||!e._def)return``;let t=e._def;return t.typeName??t.type??``}function Jr(e){if(!e||!e._def)return`unknown`;let t=e._def;switch(qr(e)){case`ZodString`:case`string`:return`string`;case`ZodNumber`:case`number`:return`number`;case`ZodBoolean`:case`boolean`:return`boolean`;case`ZodLiteral`:case`literal`:{let e=t.values?.[0]??t.value;return JSON.stringify(e)}case`ZodEnum`:case`enum`:{let e;if(Array.isArray(t.values))e=t.values;else if(t.entries&&typeof t.entries==`object`)e=Object.values(t.entries);else return`enum`;return e.map(e=>`"${e}"`).join(` | `)}case`ZodArray`:case`array`:{let e=typeof t.element==`object`?t.element:typeof t.type==`object`?t.type:void 0;return e?`Array<${Jr(e)}>`:`Array<unknown>`}case`ZodObject`:case`object`:{let e=typeof t.shape==`function`?t.shape():t.shape;return e?`{ ${Object.entries(e).map(([e,t])=>{let n=qr(t);return`${e}${n===`ZodOptional`||n===`ZodNullable`||n===`optional`||n===`nullable`?`?`:``}: ${Jr(t)}`}).join(`, `)} }`:`object`}case`ZodOptional`:case`optional`:case`ZodNullable`:case`nullable`:{let e=t.innerType??t.wrapped;return e?Jr(e):`unknown`}case`ZodUnion`:case`union`:{let e=t.options;return e?e.map(e=>Jr(e)).join(` | `):`unknown`}case`ZodRecord`:case`record`:{let e=t.keyType??void 0,n=t.valueType??t.element??void 0;return`Record<${e?Jr(e):`string`}, ${n?Jr(n):`unknown`}>`}case`ZodDefault`:case`default`:{let e=t.innerType??t.wrapped;return e?Jr(e):`unknown`}default:return`unknown`}}function Yr(e){return typeof e.type==`string`?e.type:typeof e.typeName==`string`?e.typeName:``}function Xr(e){return e.startsWith(`Zod`)?e.slice(3).toLowerCase():e.toLowerCase()}function Zr(e,t=!1){let n=e._def;switch(Xr(Yr(n))){case`string`:return{type:`string`};case`number`:return{type:`number`};case`boolean`:return{type:`boolean`};case`literal`:{let e=n.values;return{const:e?e[0]:n.value}}case`enum`:{let e=n.entries;return{enum:(e?Object.values(e):n.values)??[]}}case`array`:{let e=n.element??n.type;return{type:`array`,items:e?Zr(e,t):{}}}case`object`:{let e=n.shape,r=typeof e==`function`?e():e;if(!r)return t?{type:`object`,properties:{},required:[],additionalProperties:!1}:{type:`object`};let i={},a=[];for(let[e,n]of Object.entries(r)){let r=n._def,o=Xr(Yr(r)),s=o===`optional`||o===`nullable`;t?(a.push(e),i[e]=s?{anyOf:[Zr(n,t),{type:`null`}]}:Zr(n,t)):(i[e]=Zr(n),s||a.push(e))}return{type:`object`,properties:i,required:a.length>0?a:void 0,additionalProperties:!1}}case`record`:{let e=n.valueType;return t?{type:`object`,properties:{},required:[],additionalProperties:!1}:{type:`object`,additionalProperties:!e||Zr(e)}}case`optional`:case`nullable`:{let e=n.innerType;return e?Zr(e,t):{}}case`union`:{let e=n.options;return e?{anyOf:e.map(e=>Zr(e,t))}:{}}case`any`:case`unknown`:return t?{type:`object`,properties:{},required:[],additionalProperties:!1}:{};default:return{}}}function Qr(e,t){return e.createCatalog(t)}u({root:f().min(1),elements:_(f(),u({type:f(),props:_(f(),a()),children:g(f()).optional(),slots:_(f(),g(f())).optional(),on:_(f(),a()).optional(),visible:a().optional()}).strict()),state:_(f(),a()).optional()}).strict(),Cr.extend({params:_(f(),a()).optional(),onSuccess:a().optional(),onError:a().optional()}).strict();var $r=c().min(0).max(1);u({answers:_(f(),u({type:b(`choice`),choice:f()})),providerMetadata:u({typesafe:u({confidence:_(f(),$r)}).optional()}).optional(),usage:u({inputTokens:c().int().nonnegative().optional()}).optional()});var ei=u({root:f(),elements:_(f(),s()),state:_(f(),a()).optional()});function ti(e){try{return ei.safeParse(JSON.parse(e)).data}catch{return}}function ni(e){let t=Pn(``);for(let n of e.split(`
130
+ `)){let e=Mn(n);if(e)try{Nn(t,e)}catch{}}return ei.safeParse(t).data}function ri(e){let t=ti(e)??ni(e);return t?.elements[t.root]?t:null}var ii=(0,V.createContext)(!1),ai={sm:`max-w-xs`,md:`max-w-sm`,lg:`max-w-md`,full:`w-full`};function oi({props:e,children:t}){let r=(0,V.useContext)(ii);return(0,H.jsx)(ii.Provider,{value:!1,children:(0,H.jsxs)(`section`,{className:n(`flex min-w-0 flex-col gap-3`,ai[e.maxWidth??`full`],e.centered&&`mx-auto`,!r&&`bg-card text-card-foreground rounded-lg border p-4`),children:[e.title||e.description?(0,H.jsxs)(`header`,{className:`flex flex-col gap-0.5`,children:[e.title?(0,H.jsx)(`h3`,{className:n(`font-semibold tracking-tight`,r&&`text-[15px]`),children:e.title}):null,e.description?(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:e.description}):null]}):null,t]})})}function si({props:e}){return(0,H.jsx)(`div`,{className:`min-w-0 overflow-x-auto`,children:(0,H.jsxs)(`table`,{className:`w-full border-collapse text-left`,children:[e.caption?(0,H.jsx)(`caption`,{className:`text-muted-foreground caption-bottom pt-2 text-left text-xs`,children:e.caption}):null,(0,H.jsx)(`thead`,{className:`text-muted-foreground`,children:(0,H.jsx)(`tr`,{className:`border-b`,children:(e.columns??[]).map((e,t)=>(0,H.jsx)(`th`,{className:`px-2.5 py-2 font-normal first:pl-0`,children:e},t))})}),(0,H.jsx)(`tbody`,{children:(e.rows??[]).map((e,t)=>(0,H.jsx)(`tr`,{className:`border-b last:border-0`,children:e.map((e,t)=>(0,H.jsx)(`td`,{className:`px-2.5 py-2 first:pl-0`,children:String(e)},t))},t))})]})})}var ci={none:`gap-0`,sm:`gap-2`,md:`gap-3`,lg:`gap-4`,xl:`gap-6`},li={start:`items-start`,center:`items-center`,end:`items-end`,stretch:`items-stretch`},ui={start:`justify-start`,center:`justify-center`,end:`justify-end`,between:`justify-between`,around:`justify-around`};function di({props:e,children:t}){let r=e.direction===`horizontal`;return(0,H.jsx)(`div`,{className:n(`flex min-w-0`,r?`flex-row flex-wrap`:`flex-col`,ci[e.gap??`md`],li[e.align??(r?`center`:`stretch`)],ui[e.justify??`start`]),children:t})}function fi({props:e}){return(0,H.jsxs)(`div`,{className:`bg-card text-card-foreground flex min-w-0 flex-col gap-1 rounded-lg border p-4`,children:[(0,H.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:e.label}),(0,H.jsx)(`span`,{className:`truncate text-2xl font-semibold tracking-tight tabular-nums`,children:e.value}),e.detail?(0,H.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:e.detail}):null]})}var pi={info:`border-sky-500/25 bg-sky-500/10 text-sky-800 dark:text-sky-200`,success:`border-emerald-500/25 bg-emerald-500/10 text-emerald-800 dark:text-emerald-200`,warning:`border-amber-500/25 bg-amber-500/10 text-amber-800 dark:text-amber-200`,error:`border-rose-500/25 bg-rose-500/10 text-rose-800 dark:text-rose-200`};function mi({props:e}){return(0,H.jsxs)(`div`,{role:`alert`,className:n(`rounded-lg border px-3.5 py-3`,pi[e.type??`info`]),children:[(0,H.jsx)(`p`,{children:e.title}),e.message?(0,H.jsx)(`p`,{className:`opacity-90`,children:e.message}):null]})}function hi({props:e,on:n}){let{href:r}=e;return!r||!t.isValidAttribute(`a`,`href`,r)?(0,H.jsx)(`span`,{children:e.label}):(0,H.jsx)(`a`,{href:r,target:`_blank`,rel:`noopener noreferrer`,className:`text-accent-strong underline-offset-4 hover:underline`,onClick:e=>{let t=n(`press`);t.shouldPreventDefault&&e.preventDefault(),t.emit()},children:e.label})}var gi=140;function _i({title:e,children:t}){return(0,H.jsxs)(`figure`,{className:`m-0 flex min-w-0 flex-col gap-2`,children:[e?(0,H.jsx)(`figcaption`,{children:e}):null,t]})}function vi({props:e}){let t=e.data??[],n=Math.max(1,...t.map(e=>e.value));return(0,H.jsxs)(_i,{title:e.title,children:[(0,H.jsx)(`div`,{className:`flex items-end gap-3 border-b`,style:{height:gi},children:t.map((e,t)=>(0,H.jsxs)(`div`,{className:`flex h-full min-w-0 flex-1 flex-col items-center gap-1`,children:[(0,H.jsx)(`span`,{className:`text-muted-foreground text-xs tabular-nums`,children:e.value}),(0,H.jsx)(`div`,{className:`flex w-full flex-1 items-end justify-center`,children:(0,H.jsx)(`div`,{className:`w-full max-w-10 rounded-t-[4px] bg-[var(--chart-1)]`,style:{height:`${Math.max(0,e.value)/n*100}%`,minHeight:2}})})]},t))}),(0,H.jsx)(`div`,{className:`flex gap-3`,children:t.map((e,t)=>(0,H.jsx)(`span`,{className:`text-muted-foreground min-w-0 flex-1 truncate text-center text-xs`,children:e.label},t))})]})}var yi=300,bi=6;function xi({props:e}){let t=e.data??[],n=t.map(e=>e.value),r=Math.min(...n),i=Math.max(...n)-r||1,a=yi/Math.max(1,t.length),o=t.map((e,t)=>({x:(t+.5)*a,y:bi+(1-(e.value-r)/i)*128}));return(0,H.jsxs)(_i,{title:e.title,children:[(0,H.jsxs)(`div`,{className:`relative border-b`,style:{height:gi},children:[(0,H.jsx)(`svg`,{viewBox:`0 0 ${yi} ${gi}`,preserveAspectRatio:`none`,className:`absolute inset-0 size-full`,role:`img`,"aria-label":e.title??`Line chart`,children:(0,H.jsx)(`polyline`,{points:o.map(({x:e,y:t})=>`${e},${t}`).join(` `),fill:`none`,stroke:`var(--chart-1)`,strokeWidth:2,strokeLinejoin:`round`,vectorEffect:`non-scaling-stroke`})}),o.map(({x:e,y:n},r)=>(0,H.jsx)(`span`,{className:`border-background absolute size-2 -translate-1/2 rounded-full border bg-[var(--chart-1)]`,style:{left:`${e/yi*100}%`,top:`${n/gi*100}%`},title:`${t[r].label}: ${t[r].value}`},r))]}),(0,H.jsx)(`div`,{className:`text-muted-foreground grid text-center text-xs`,style:{gridTemplateColumns:`repeat(${t.length}, minmax(0, 1fr))`},children:t.map((e,t)=>(0,H.jsx)(`span`,{className:`truncate px-1`,children:e.label},t))})]})}var Si=g(u({type:f(),message:f(),args:_(f(),a()).optional()})).nullable(),Ci=v([`change`,`blur`,`submit`]).nullable(),wi={Card:{props:u({title:f().nullable(),description:f().nullable(),maxWidth:v([`sm`,`md`,`lg`,`full`]).nullable(),centered:y().nullable(),className:f().nullable().describe(`Additional CSS classes`)}),slots:[`default`],description:`Container card for content sections. Use for forms/content boxes, NOT for page headers.`,example:{title:`Overview`,description:`Your account summary`}},Stack:{props:u({direction:v([`horizontal`,`vertical`]).nullable(),gap:v([`none`,`sm`,`md`,`lg`,`xl`]).nullable(),align:v([`start`,`center`,`end`,`stretch`]).nullable(),justify:v([`start`,`center`,`end`,`between`,`around`]).nullable(),className:f().nullable().describe(`Additional CSS classes`)}),slots:[`default`],description:`Flex container for layouts`,example:{direction:`vertical`,gap:`md`}},Grid:{props:u({columns:c().nullable(),gap:v([`sm`,`md`,`lg`,`xl`]).nullable(),className:f().nullable().describe(`Additional CSS classes`)}),slots:[`default`],description:`Grid layout (1-6 columns)`,example:{columns:3,gap:`md`}},Separator:{props:u({orientation:v([`horizontal`,`vertical`]).nullable()}),description:`Visual separator line`},Tabs:{props:u({tabs:g(u({label:f(),value:f()})),defaultValue:f().nullable(),value:f().nullable()}),slots:[`default`],events:[`change`],description:`Tab navigation. Use { $bindState } on value for active tab binding.`},Accordion:{props:u({items:g(u({title:f(),content:f()})),type:v([`single`,`multiple`]).nullable()}),description:`Collapsible sections. Items as [{title, content}]. Type 'single' (default) or 'multiple'.`},Collapsible:{props:u({title:f(),defaultOpen:y().nullable()}),slots:[`default`],description:`Collapsible section with trigger. Children render inside.`},Dialog:{props:u({title:f(),description:f().nullable(),openPath:f()}),slots:[`default`],description:`Modal dialog. Set openPath to a boolean state path. Use setState to toggle.`},Drawer:{props:u({title:f(),description:f().nullable(),openPath:f()}),slots:[`default`],description:`Bottom sheet drawer. Set openPath to a boolean state path. Use setState to toggle.`},Carousel:{props:u({items:g(u({title:f().nullable(),description:f().nullable()}))}),description:`Horizontally scrollable carousel of cards.`},Table:{props:u({columns:g(f()),rows:g(g(f())),caption:f().nullable()}),description:`Data table. columns: header labels. rows: 2D array of cell strings, e.g. [["Alice","admin"],["Bob","user"]].`,example:{columns:[`Name`,`Role`],rows:[[`Alice`,`Admin`],[`Bob`,`User`]]}},Heading:{props:u({text:f(),level:v([`h1`,`h2`,`h3`,`h4`]).nullable()}),description:`Heading text (h1-h4)`,example:{text:`Welcome`,level:`h1`}},Text:{props:u({text:f(),variant:v([`body`,`caption`,`muted`,`lead`,`code`]).nullable()}),description:`Paragraph text`,example:{text:`Hello, world!`}},Image:{props:u({src:f().nullable(),alt:f(),width:c().nullable(),height:c().nullable()}),description:`Image component. Renders an img tag when src is provided, otherwise a placeholder.`},Avatar:{props:u({src:f().nullable(),name:f(),size:v([`sm`,`md`,`lg`]).nullable()}),description:`User avatar with fallback initials`,example:{name:`Jane Doe`,size:`md`}},Badge:{props:u({text:f(),variant:v([`default`,`secondary`,`destructive`,`outline`]).nullable()}),description:`Status badge`,example:{text:`Active`,variant:`default`}},Alert:{props:u({title:f(),message:f().nullable(),type:v([`info`,`success`,`warning`,`error`]).nullable()}),description:`Alert banner`,example:{title:`Note`,message:`Your changes have been saved.`,type:`success`}},Progress:{props:u({value:c(),max:c().nullable(),label:f().nullable()}),description:`Progress bar (value 0-100)`,example:{value:65,max:100,label:`Upload progress`}},Skeleton:{props:u({width:f().nullable(),height:f().nullable(),rounded:y().nullable()}),description:`Loading placeholder skeleton`},Spinner:{props:u({size:v([`sm`,`md`,`lg`]).nullable(),label:f().nullable()}),description:`Loading spinner indicator`},Tooltip:{props:u({content:f(),text:f()}),description:`Hover tooltip. Shows content on hover over text.`},Popover:{props:u({trigger:f(),content:f()}),description:`Popover that appears on click of trigger.`},Input:{props:u({label:f(),name:f(),type:v([`text`,`email`,`password`,`number`]).nullable(),placeholder:f().nullable(),value:f().nullable(),checks:Si,validateOn:Ci}),events:[`submit`,`focus`,`blur`],description:`Text input field. Use { $bindState } on value for two-way binding. Use checks for validation (e.g. required, email, minLength). validateOn controls timing (default: blur).`,example:{label:`Email`,name:`email`,type:`email`,placeholder:`you@example.com`}},Textarea:{props:u({label:f(),name:f(),placeholder:f().nullable(),rows:c().nullable(),value:f().nullable(),checks:Si,validateOn:Ci}),description:`Multi-line text input. Use { $bindState } on value for binding. Use checks for validation. validateOn controls timing (default: blur).`},Select:{props:u({label:f(),name:f(),options:g(f()),placeholder:f().nullable(),value:f().nullable(),checks:Si,validateOn:Ci}),events:[`change`],description:`Dropdown select input. Use { $bindState } on value for binding. Use checks for validation. validateOn controls timing (default: change).`},Checkbox:{props:u({label:f(),name:f(),checked:y().nullable(),checks:Si,validateOn:Ci}),events:[`change`],description:`Checkbox input. Use { $bindState } on checked for binding. Use checks for validation. validateOn controls timing (default: change).`},Radio:{props:u({label:f(),name:f(),options:g(f()),value:f().nullable(),checks:Si,validateOn:Ci}),events:[`change`],description:`Radio button group. Use { $bindState } on value for binding. Use checks for validation. validateOn controls timing (default: change).`},Switch:{props:u({label:f(),name:f(),checked:y().nullable(),checks:Si,validateOn:Ci}),events:[`change`],description:`Toggle switch. Use { $bindState } on checked for binding. Use checks for validation. validateOn controls timing (default: change).`},Slider:{props:u({label:f().nullable(),min:c().nullable(),max:c().nullable(),step:c().nullable(),value:c().nullable()}),events:[`change`],description:`Range slider input. Use { $bindState } on value for binding.`},Button:{props:u({label:f(),variant:v([`primary`,`secondary`,`danger`]).nullable(),disabled:y().nullable()}),events:[`press`],description:`Clickable button. Bind on.press for handler.`,example:{label:`Submit`,variant:`primary`}},Link:{props:u({label:f(),href:f()}),events:[`press`],description:`Anchor link. Bind on.press for click handler.`},DropdownMenu:{props:u({label:f(),items:g(u({label:f(),value:f()})),value:f().nullable()}),events:[`select`],description:`Dropdown menu with trigger button and selectable items. Use { $bindState } on value for selected item binding.`},Toggle:{props:u({label:f(),pressed:y().nullable(),variant:v([`default`,`outline`]).nullable()}),events:[`change`],description:`Toggle button. Use { $bindState } on pressed for state binding.`},ToggleGroup:{props:u({items:g(u({label:f(),value:f()})),type:v([`single`,`multiple`]).nullable(),value:f().nullable()}),events:[`change`],description:`Group of toggle buttons. Type 'single' (default) or 'multiple'. Use { $bindState } on value.`},ButtonGroup:{props:u({buttons:g(u({label:f(),value:f()})),selected:f().nullable()}),events:[`change`],description:`Segmented button group. Use { $bindState } on selected for selected value.`},Pagination:{props:u({totalPages:c(),page:c().nullable()}),events:[`change`],description:`Page navigation. Use { $bindState } on page for current page number.`}};Ir(e=>({spec:e.object({root:e.string(),elements:e.record(e.object({type:e.ref(`catalog.components`),props:e.propsOf(`catalog.components`),children:e.array(e.string()),slots:{...e.record(e.array(e.string())),...e.optional()},visible:{...e.any(),...e.optional()},repeat:{...e.any(),...e.optional()}}))}),catalog:e.object({components:e.map({props:e.zod(),slots:e.array(e.string()),description:e.string(),example:e.any()}),actions:e.map({params:e.zod(),description:e.string()})})}),{builtInActions:[{name:`setState`,description:`Update a value in the state model at the given statePath. Params: { statePath: string, value: any }`},{name:`pushState`,description:`Append an item to an array in state. Params: { statePath: string, value: any, clearStatePath?: string }. Value can contain {"$state":"/path"} refs and "$id" for auto IDs.`},{name:`removeState`,description:`Remove an item from an array in state by index. Params: { statePath: string, index: number }`},{name:`validateForm`,description:`Validate all registered form fields and write the result to state. Params: { statePath?: string }. Defaults to /formValidation. Result: { valid: boolean, errors: Record<string, string[]> }.`}],defaultRules:[`CRITICAL INTEGRITY CHECK: Before outputting ANY element that references children, you MUST have already output (or will output) each child as its own element. If an element has children: ['a', 'b'], then elements 'a' and 'b' MUST exist. A missing child element causes that entire branch of the UI to be invisible.`,`SELF-CHECK: After generating all elements, mentally walk the tree from root. Every key in every children array must resolve to a defined element. If you find a gap, output the missing element immediately.`,`REQUIRED FIELDS: Every element MUST include a "children" array. Leaf elements (text, badges, inputs, images) use an empty array: "children": []. Omitting "children" fails validation.`,`NAMED SLOTS: Use "children" for the default slot. For other slots declared by the component, use a top-level "slots" object that maps each slot name to child element keys, for example {"slots":{"header":["heading"],"footer":["actions"]}}. Never use "slots.default". Every referenced key must exist.`,`FILTERED LISTS: To render only the items matching a field value (kanban columns, tabbed lists, status sections), put "repeat" and a "visible" condition with $item on the same container element: {"repeat": {"statePath": "/tasks", "key": "id"}, "visible": {"$item": "status", "eq": "todo"}} renders one child per matching item. A visible condition object must use exactly one of $state, $item, or $index — never combine them in one object.`,`CRITICAL: The "visible" field goes on the ELEMENT object, NOT inside "props". Correct: {"type":"<ComponentName>","props":{},"visible":{"$state":"/tab","eq":"home"},"children":[...]}.`,`CRITICAL: The "on" field goes on the ELEMENT object, NOT inside "props". Use on.press, on.change, on.submit etc. NEVER put action/actionParams inside props.`,`When the user asks for a UI that displays data (e.g. blog posts, products, users), ALWAYS include a state field with realistic sample data. The state field is a top-level field on the spec (sibling of root/elements).`,`When building repeating content backed by a state array (e.g. posts, products, items), use the "repeat" field on a container element. Example: { "type": "<ContainerComponent>", "props": {}, "repeat": { "statePath": "/posts", "key": "id" }, "children": ["post-card"] }. For a nested list stored on the enclosing item, use "repeat": { "statePath": { "$item": "comments" }, "key": "id" }. The $item statePath form is valid only inside another repeat. Replace <ContainerComponent> with an appropriate component from the AVAILABLE COMPONENTS list. Inside repeated children, use { "$item": "field" } to read a field from the current item, and { "$index": true } for the current array index. For two-way binding to an item field use { "$bindItem": "completed" }. Do NOT hardcode individual elements for each array item.`,`Design with visual hierarchy: use container components to group content, heading components for section titles, proper spacing, and status indicators. ONLY use components from the AVAILABLE COMPONENTS list.`,`For data-rich UIs, use multi-column layout components if available. For forms and single-column content, use vertical layout components. ONLY use components from the AVAILABLE COMPONENTS list.`,`Always include realistic, professional-looking sample data. For blogs include 3-4 posts with varied titles, authors, dates, categories. For products include names, prices, images. Never leave data empty.`]});var Ti=(0,V.createContext)(null);function Ei(){let e=(0,V.useContext)(Ti);if(!e)throw Error(`useStateStore must be used within a StateProvider`);return e}function Di(e){let{state:t,set:n}=Ei();return[Sn(t,e),(0,V.useCallback)(t=>n(e,t),[e,n])]}var Oi=(0,V.createContext)(null);function ki(){let e=(0,V.useContext)(Oi);if(!e)throw Error(`useVisibility must be used within a VisibilityProvider`);return e}var Ai=(0,V.createContext)(null);function ji(){let e=(0,V.useContext)(Ai);if(!e)throw Error(`useValidation must be used within a ValidationProvider`);return e}function Mi(e,t){let{fieldStates:n,validate:r,touch:i,clear:a,registerField:o}=ji();V.useEffect(()=>{e&&t&&o(e,t)},[e,t,o]);let s=n[e]??{touched:!1,validated:!1,result:null};return{state:s,validate:(0,V.useCallback)(()=>r(e,t??{checks:[]}),[e,t,r]),touch:(0,V.useCallback)(()=>i(e),[e,i]),clear:(0,V.useCallback)(()=>a(e),[e,a]),errors:s.result?.errors??[],isValid:s.result?.valid??!0}}var Ni=(0,V.createContext)(null);function Pi(){let e=(0,V.useContext)(Ni);if(!e)throw Error(`useActions must be used within an ActionProvider`);return e}var Fi=(0,V.createContext)(null);function Ii({item:e,index:t,basePath:n,children:r}){return(0,H.jsx)(Fi.Provider,{value:{item:e,index:t,basePath:n},children:r})}function Li(){return(0,V.useContext)(Fi)}var Ri=new WeakMap,zi={},Bi=class extends V.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){console.error(`[json-render] Rendering error in <${this.props.elementType}>:`,e,t.componentStack)}componentDidUpdate(e){this.state.hasError&&e.resetKey!==this.props.resetKey&&this.setState({hasError:!1})}render(){return this.state.hasError?null:this.props.children}},Vi=V.createContext({});function Hi(){return V.useContext(Vi)}var Ui=V.createContext(void 0);function Wi(){return V.useContext(Ui)}function Gi(e,t){let n=t.current;if(n===e)return n;if(n&&e){let t=Object.keys(e);if(t.length===Object.keys(n).length&&t.every(t=>Object.prototype.hasOwnProperty.call(n,t)&&n[t]===e[t]))return n}return t.current=e,e}function Ki(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function qi(e,t){if(Object.is(e,t))return e;let n=Array.isArray(e);if(n!==Array.isArray(t)||!n&&(!Ki(e)||!Ki(t)))return t;let r=e,i=t,a=Object.keys(i),o=n?Array(t.length):{},s=(!n||e.length===t.length)&&a.length===Object.keys(r).length;for(let e of a){let t=i[e];Object.prototype.hasOwnProperty.call(r,e)?(t=qi(r[e],t),Object.is(r[e],t)||(s=!1)):s=!1,o[e]=t}return s?e:o}var Ji=V.memo(function({Component:e,element:t,slots:n,emit:r,on:i,bindings:a,loading:o,children:s}){return(0,H.jsx)(e,{element:t,slots:n,emit:r,on:i,bindings:a,loading:o,children:s})},(e,t)=>e.Component===t.Component&&e.signature===t.signature&&e.execute===t.execute&&e.actionContext?.item===t.actionContext?.item&&e.actionContext?.index===t.actionContext?.index&&e.actionContext?.basePath===t.actionContext?.basePath&&e.functions===t.functions&&e.directives===t.directives&&e.element.props===t.element.props&&e.bindings===t.bindings&&e.loading===t.loading);function Yi(){return V.useSyncExternalStore(yr,vr,()=>!1)}function Xi({element:e,elementKey:t,spec:n,registry:r,loading:i,fallback:a,signatures:o}){let s=Yi(),c=Li(),{ctx:l}=ki(),{execute:u}=Pi(),{getSnapshot:d,state:f}=Ei(),p=Hi(),m=Wi(),h=(0,V.useMemo)(()=>{let e=c?{...l,repeatItem:c.item,repeatIndex:c.index,repeatBasePath:c.basePath}:{...l};return e.functions=p,e.directives=m,e},[l,c,p,m]),g=e.repeat!==void 0&&c==null?Wn(e.visible):{container:e.visible,itemFilter:void 0},_=g.itemFilter,v=g.container===void 0||$n(g.container,h),y=e.on,b=(0,V.useCallback)(async e=>{let t=y?.[e];if(!t)return;let n=Array.isArray(t)?t:[t];for(let e of n){if(!e.params){await u(e);continue}let t={...h,stateModel:d()},n={};for(let[r,i]of Object.entries(e.params))n[r]=hr(i,t);await u({...e,params:n})}},[y,u,h,d]),x=(0,V.useCallback)(e=>{let t=y?.[e];return t?{emit:()=>b(e),shouldPreventDefault:(Array.isArray(t)?t:[t]).some(e=>e.preventDefault),bound:!0}:{emit:()=>{},shouldPreventDefault:!1,bound:!1}},[y,b]),S=e.watch,C=(0,V.useRef)(null),w=(0,V.useRef)(void 0),T=(0,V.useRef)(void 0),E=(0,V.useRef)({}),D=(0,V.useMemo)(()=>{if(!S)return;let e={};for(let t of Object.keys(S))e[t]=Sn(f,t);let t=w.current;if(t){let n=Object.keys(e);if(n.length===Object.keys(t).length&&n.every(n=>e[n]===t[n]))return t}return w.current=e,e},[S,f]);if((0,V.useEffect)(()=>{if(!S||!D)return;let e=Object.keys(S);if(e.length===0)return;let t=C.current;if(C.current=D,t===null)return;let n=!1;return(async()=>{for(let r of e){if(n)break;if(D[r]!==t[r]){let e=S[r];if(!e)continue;let t=Array.isArray(e)?e:[e];for(let e of t){if(n)break;if(!e.params){if(await u(e),n)break;continue}let t={...h,stateModel:d()},r={};for(let[n,i]of Object.entries(e.params))r[n]=hr(i,t);if(await u({...e,params:r}),n)break}}}})().catch(console.error),()=>{n=!0}},[S,D,u,h,d]),!v)return null;let O=e.props??zi,k=Gi(mr(O,h),T),A=qi(E.current,pr(O,h));E.current=A;let j=A===e.props?e:{...e,props:A},M=r[j.type]??a;if(!M)return console.warn(`No renderer for component type: ${j.type}`),null;let N=Ri.get(r)?.[j.type];if(j.slots&&N?.slots){let e=new Set(N.slots);for(let t of Object.keys(j.slots))t==="default"?console.warn(`[json-render] Component "${j.type}" uses slots.default. Use "children" for default slot content.`):e.has(t)||console.warn(`[json-render] Unknown slot "${t}" on component "${j.type}". Available slots: ${N.slots.join(`, `)}`)}let P=(e,t)=>e.map(e=>{let s=n.elements[e];if(!s){if(!i){let n=t?`in slot "${t}" of "${j.type}"`:`as child of "${j.type}"`;console.warn(`[json-render] Missing element "${e}" referenced ${n}. This element will not render.`)}return null}return(0,H.jsx)(Zi,{element:s,elementKey:e,spec:n,registry:r,loading:i,fallback:a,signatures:o},e)}),F=j.repeat?(0,H.jsx)(Qi,{element:j,spec:n,registry:r,loading:i,fallback:a,itemFilter:_,signatures:o}):j.children?P(j.children):void 0,I=j.slots?Object.fromEntries(Object.entries(j.slots).map(([e,t])=>[e,P(t,e)])):void 0,L=(0,H.jsx)(Ji,{Component:M,signature:o[t??``],execute:u,actionContext:c,functions:p,directives:m,element:j,slots:I,emit:b,on:x,bindings:k,loading:i,children:F}),ee=s&&t?(0,H.jsx)(`span`,{"data-jr-key":t,style:{display:`contents`},children:L}):L;return(0,H.jsx)(Bi,{elementType:j.type,resetKey:o[t??``],children:ee})}var Zi=V.memo(function(e){return(0,H.jsx)(Xi,{...e})},(e,t)=>e.elementKey===t.elementKey&&e.signatures[e.elementKey??``]===t.signatures[t.elementKey??``]&&e.registry===t.registry&&e.loading===t.loading&&e.fallback===t.fallback);function Qi({element:e,spec:t,registry:n,loading:r,fallback:i,signatures:a,itemFilter:o}){let{state:s}=Ei(),{ctx:c}=ki(),l=Li(),u=e.repeat,d=Cn(u.statePath,l?.basePath);if(d===void 0)return console.warn(`[json-render] $item in repeat.statePath used outside of a repeat scope`),null;let f=(Sn(s,d)??[]).map((e,t)=>({itemValue:e,index:t})).filter(({itemValue:e,index:t})=>o===void 0||$n(o,{...c,repeatItem:e,repeatIndex:t}));return(0,H.jsx)(H.Fragment,{children:f.map(({itemValue:o,index:s})=>{let c=u.key&&typeof o==`object`&&o?String(o[u.key]??s):String(s);return(0,H.jsx)(Ii,{item:o,index:s,basePath:wn(d,s),children:e.children?.map(o=>{let s=t.elements[o];return s?(0,H.jsx)(Zi,{element:s,elementKey:o,spec:t,registry:n,loading:r,fallback:i,signatures:a},o):(r||console.warn(`[json-render] Missing element "${o}" referenced as child of "${e.type}" (repeat). This element will not render.`),null)})},c)})})}function $i(e,t){let{set:n}=Ei();return[e,(0,V.useCallback)(e=>{t&&n(t,e)},[t,n])]}var ea=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,ta=r,na=(e,t)=>n=>{if(t?.variants==null)return ta(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=ea(t)||ea(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return ta(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},ra=Object.defineProperty,ia=(e,t)=>ra(e,`name`,{value:t,configurable:!0});function aa(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}ia(aa,`setRef`);function oa(...e){return t=>{let n=!1,r=e.map(e=>{let r=aa(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():aa(e[t],null)}}}}ia(oa,`composeRefs`);function U(...e){return V.useCallback(oa(...e),e)}ia(U,`useComposedRefs`);var sa=e(x(),1),ca=Object.defineProperty,la=(e,t)=>ca(e,`name`,{value:t,configurable:!0});function ua(e){let t=V.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];r=xa(r),V.Children.forEach(r,e=>{if(_a(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;for(;ya(n)&&typeof Ta==`function`;)n=Ta(n._payload);a=ma(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=V.cloneElement(a,void 0,s):!o&&V.Children.count(r)===1&&V.isValidElement(r)&&(a=r);let c=a?ga(a):void 0,l=U(n,c);if(!a){if(r||r===0)throw Error(o?wa(e):Ca(e));return r}let u=ha(i,a.props??{});return a.type!==V.Fragment&&(u.ref=n?l:c),V.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}la(ua,`createSlot`);var da=ua(`Slot`),fa=Symbol.for(`radix.slottable`);function pa(e){let t=la(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=fa,t}la(pa,`createSlottable`);var ma=la((e,t)=>`child`in e.props?V.isValidElement(t)?V.cloneElement(t,void 0,e.props.children(t.props.children)):null:V.isValidElement(t)?t:null,`getSlottableElementFromSlottable`);function ha(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`?n[r]=[i,a].filter(Boolean).join(` `):r===`aria-describedby`&&(n[r]=Sa(a,i))}return{...e,...n}}la(ha,`mergeProps`);function ga(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}la(ga,`getElementRef`);function _a(e){return V.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===fa}la(_a,`isSlottable`);var va=Symbol.for(`react.lazy`);function ya(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===va&&`_payload`in e&&ba(e._payload)}la(ya,`isLazyComponent`);function ba(e){return typeof e==`object`&&!!e&&`then`in e}la(ba,`isPromiseLike`);function xa(e){let t=e;for(;ya(t)&&typeof Ta==`function`;)t=Ta(t._payload);return t}la(xa,`useUnwrappedLazy`);function Sa(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}la(Sa,`concatAriaDescribedby`);var Ca=la(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),wa=la(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),Ta=V.use,Ea=Object.defineProperty,Da=(e,t)=>Ea(e,`name`,{value:t,configurable:!0}),W=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=ua(`Primitive.${t}`),r=V.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,H.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Oa(e,t){e&&sa.flushSync(()=>e.dispatchEvent(t))}Da(Oa,`dispatchDiscreteCustomEvent`);var ka=Object.defineProperty,Aa=(e,t)=>ka(e,`name`,{value:t,configurable:!0}),ja=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),Ma=V.forwardRef(Aa(function(e,t){return(0,H.jsx)(W.span,{...e,ref:t,style:{...ja,...e.style}})},`VisuallyHidden`)),Na=Object.defineProperty,Pa=(e,t)=>Na(e,`name`,{value:t,configurable:!0});function Fa(e,t){let n=V.createContext(t);n.displayName=e+`Context`;let r=Pa(e=>{let{children:t,...r}=e,i=V.useMemo(()=>r,Object.values(r));return(0,H.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=V.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return Pa(i,`useContext`),[r,i]}Pa(Fa,`createContext`);function G(e,t=[]){let n=[];function r(t,r){let i=V.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=Pa(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=V.useMemo(()=>o,Object.values(o));return(0,H.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=V.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return Pa(s,`useContext`),[o,s]}Pa(r,`createContext`);let i=Pa(()=>{let t=n.map(e=>V.createContext(e));return Pa(function(n){let r=n?.[e]||t;return V.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,Ia(i,...t)]}Pa(G,`createContextScope`);function Ia(...e){let t=e[0];if(e.length===1)return t;let n=Pa(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return Pa(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return V.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}Pa(Ia,`composeContextScopes`);var K=globalThis?.document?V.useLayoutEffect:()=>{},La=Object.defineProperty,Ra=(e,t)=>La(e,`name`,{value:t,configurable:!0});function za(e){let t=e+`CollectionProvider`,[n,r]=G(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=Ra(e=>{let{scope:t,children:n}=e,r=V.useRef(null),a=V.useRef(new Map).current;return(0,H.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=ua(s),l=V.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=U(t,a(s,n).collectionRef);return(0,H.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=ua(u),p=V.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=V.useRef(null),s=U(t,o),c=a(u,n);return V.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,H.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return V.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return Ra(m,`useCollection`),[{Provider:o,Slot:l,ItemSlot:p},m,r]}Ra(za,`createCollection`);var Ba=new WeakMap,Va=class e extends Map{static{Ra(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],Ba.set(this,!0)}set(e,t){return Ba.get(this)&&!this.has(e)&&this.#e.push(e),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=r?this.size:this.size+1,a=Wa(e),o=a>=0?Math.min(a,i-1):Math.max(i+a,0);if(r?this.#e.indexOf(t)===o:o===this.size)return this.set(t,n),this;let s=this.#e.filter(e=>e!==t);s.splice(o,0,t);let c=s.map(e=>[e,e===t?n:this.get(e)]);this.clear();for(let[e,t]of c)this.set(e,t);return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);if(r===-1)return this;let i=this.#e.indexOf(t),a=i!==-1&&i<r?r-1:r;return this.insert(a,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);if(r===-1)return this;let i=this.#e.indexOf(t),a=i!==-1&&i<=r?r:r+1;return this.insert(a,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=Ha(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=Ha(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return Ha(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=e.length>1;if(!r&&this.size===0)throw TypeError(`Reduce of empty OrderedDict with no initial value`);let i=0,a=n;for(let e of this)a=i===0&&!r?e:Reflect.apply(t,this,[a,e,i,this]),i++;return a}reduceRight(...e){let[t,n]=e,r=e.length>1;if(!r&&this.size===0)throw TypeError(`Reduce of empty OrderedDict with no initial value`);let i=n;for(let e=this.size-1;e>=0;e--){let n=this.entryAt(e);i=e===this.size-1&&!r?n:Reflect.apply(t,this,[i,n,e,this])}return i}sort(e){if(typeof e!=`function`)throw TypeError(`OrderedDict.sort requires a compare function`);let t=[...this.entries()].sort(e);this.clear();for(let[e,n]of t)this.set(e,n);return this}toSorted(t){if(typeof t!=`function`)throw TypeError(`OrderedDict.toSorted requires a compare function`);let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e;for(let e of this.#e.slice(t,n))r.set(e,this.get(e));return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function Ha(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=Ua(e,t);return n===-1?void 0:e[n]}Ra(Ha,`at`);function Ua(e,t){let n=e.length,r=Wa(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}Ra(Ua,`toSafeIndex`);function Wa(e){return e!==e||e===0?0:Math.trunc(e)}Ra(Wa,`toSafeInteger`);function Ga(e){let t=e+`CollectionProvider`,[n,r]=G(t),[i,a]=n(t);i.displayName=e+`CollectionStableContextProvider`;let[o,s]=n(t);o.displayName=e+`CollectionStatefulContextProvider`;let c=Ra(({state:e,...t})=>e?(0,H.jsx)(u,{...t,state:e}):(0,H.jsx)(l,{...t}),`CollectionProvider`);c.displayName=t;let l=Ra(e=>{let t=_();return(0,H.jsx)(u,{...e,state:t})},`CollectionInit`);l.displayName=e+`CollectionInit`;let u=Ra(e=>{let{scope:t,children:n,state:r}=e,a=V.useRef(null),[s,c]=V.useState(null),l=U(a,c),[u,d]=r,f=V.useRef(new Va),p=V.useCallback(()=>{let e=f.current;return Ja(e)||e.sort(Ya),e},[]);return V.useEffect(()=>{if(!s)return;let e=Xa(()=>{d(e=>{let t=e.toSorted(Ya);return t.some(([t],n)=>e.keyAt(n)!==t)?t:e})});return e.observe(s,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[s,d]),(0,H.jsx)(i,{scope:t,collectionElementRef:l,collectionElementRefObject:a,getCollection:p,setCollection:d,registryRef:f,children:(0,H.jsx)(o,{scope:t,collectionElement:s,collection:u,children:n})})},`CollectionProviderImpl`);u.displayName=e+`CollectionProviderImpl`;let d=e+`CollectionSlot`,f=ua(d),p=V.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=U(t,a(d,n).collectionElementRef);return(0,H.jsx)(f,{ref:i,children:r})});p.displayName=d;let m=e+`CollectionItemSlot`,h=ua(m),g=V.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=V.useRef(null),{setCollection:s,registryRef:c}=a(m,n),l=V.useRef(i);Ka(l.current,i)||(l.current=i);let u=l.current,d=U(t,V.useCallback(e=>{let t=c.current;e?t.set(e,{...l.current,element:e}):o.current&&t.delete(o.current)},[c]),o);K(()=>{let e=o.current,t=c.current;e&&t.has(e)&&t.set(e,{...u,element:e})},[u,c]);let f=V.useRef(null);return V.useEffect(()=>{let e=o.current,t=f.current;((t?.element??null)!==e||e&&t?.itemData!==u)&&(f.current=e?{element:e,itemData:u}:null,s(n=>{let r=new Va(n);return t&&t.element!==e&&r.delete(t.element),e&&r.set(e,{...u,element:e}),r.sort(Ya)}))}),V.useEffect(()=>()=>{let e=f.current;f.current=null,e&&s(t=>{if(!t.has(e.element))return t;let n=new Va(t);return n.delete(e.element),n})},[s]),(0,H.jsx)(h,{"data-radix-collection-item":``,ref:d,children:r})});g.displayName=m;function _(){return V.useState(new Va)}Ra(_,`useInitCollection`);function v(t){let{collection:n}=s(e+`CollectionConsumer`,t);return n}Ra(v,`useCollection`);function y(t){let{getCollection:n}=a(e+`CollectionConsumer`,t);return n}return Ra(y,`useGetCollection`),[{Provider:c,Slot:p,ItemSlot:g},{createCollectionScope:r,useCollection:v,useGetCollection:y,useInitCollection:_}]}Ra(Ga,`createCollection`);function Ka(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}Ra(Ka,`shallowEqual`);function qa(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Ra(qa,`isElementPreceding`);function Ja(e){let t;for(let n of e.keys()){if(t){let e=t.compareDocumentPosition(n);if(!(e&Node.DOCUMENT_POSITION_DISCONNECTED)&&e&Node.DOCUMENT_POSITION_PRECEDING)return!1}t=n}return!0}Ra(Ja,`isInDocumentOrder`);function Ya(e,t){return!e[1].element||!t[1].element?0:qa(e[1].element,t[1].element)?-1:1}Ra(Ya,`sortByDocumentPosition`);function Xa(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}Ra(Xa,`getChildListObserver`);var Za=Object.defineProperty,Qa=(e,t)=>Za(e,`name`,{value:t,configurable:!0}),$a=!!(typeof window<`u`&&window.document&&window.document.createElement);function q(e,t,{checkForDefaultPrevented:n=!0}={}){return Qa(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}Qa(q,`composeEventHandlers`);function eo(e){if(!$a)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}Qa(eo,`getOwnerWindow`);function to(e){if(!$a)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}Qa(to,`getOwnerDocument`);function no(e,t=!1){let{activeElement:n}=to(e);if(!n?.nodeName)return null;if(ro(n)&&n.contentDocument)return no(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=to(n).getElementById(e);if(t)return t}}return n}Qa(no,`getActiveElement`);function ro(e){return e.tagName===`IFRAME`}Qa(ro,`isFrame`);var io=Object.defineProperty,ao=(e,t)=>io(e,`name`,{value:t,configurable:!0}),oo=V.useEffectEvent,so=V.useInsertionEffect;function co(e){if(typeof oo==`function`)return oo(e);let t=V.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof so==`function`?so(()=>{t.current=e}):K(()=>{t.current=e}),V.useMemo(()=>((...e)=>t.current?.(...e)),[])}ao(co,`useEffectEvent`);var lo=Object.defineProperty,uo=(e,t)=>lo(e,`name`,{value:t,configurable:!0}),fo=V.useInsertionEffect||K;function po({prop:e,defaultProp:t,onChange:n=uo(()=>{},`onChange`),caller:r}){let[i,a,o]=mo({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,V.useCallback(t=>{if(s){let n=ho(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}uo(po,`useControllableState`);function mo({defaultProp:e,onChange:t}){let[n,r]=V.useState(e),i=V.useRef(n),a=V.useRef(t);return fo(()=>{a.current=t},[t]),V.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}uo(mo,`useUncontrolledState`);function ho(e){return typeof e==`function`}uo(ho,`isFunction`);var go=Symbol(`RADIX:SYNC_STATE`);function _o(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=co(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=V.useReducer((t,n)=>{if(n.type===go)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=V.useRef(p);V.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=V.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return V.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:go,state:i})},[i,d.state,c]),[h,f]}uo(_o,`useControllableStateReducer`);var vo=Object.defineProperty,yo=(e,t)=>vo(e,`name`,{value:t,configurable:!0});function bo(e,t){return V.useReducer((e,n)=>t[e][n]??e,e)}yo(bo,`useStateMachine`);var xo=yo(e=>{let{present:t,children:n}=e,r=So(t),i=typeof n==`function`?n({present:r.isPresent}):V.Children.only(n),a=wo(r.ref,Eo(i));return typeof n==`function`||r.isPresent?V.cloneElement(i,{ref:a}):null},`Presence`);function So(e){let[t,n]=V.useState(),r=V.useRef(null),i=V.useRef(e),a=V.useRef(`none`),o=V.useRef(void 0),[s,c]=bo(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return V.useEffect(()=>{s===`mounted`?(a.current=o.current??To(r.current),o.current=void 0):a.current=`none`},[s]),K(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=To(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),K(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=yo(a=>{let o=To(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=yo(e=>{e.target===t&&(a.current=To(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:V.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=To(t)}else r.current=null;n(e)},[])}}yo(So,`usePresence`);function Co(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}yo(Co,`setRef`);function wo(...e){let t=V.useRef(e);return t.current=e,V.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Co(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Co(n[e],null)}}},[])}yo(wo,`useStableComposedRefs`);function To(e){return e?.animationName||`none`}yo(To,`getAnimationName`);function Eo(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}yo(Eo,`getElementRef`);var Do=Object.defineProperty,Oo=(e,t)=>Do(e,`name`,{value:t,configurable:!0}),ko=V.useId||(()=>void 0),Ao=0;function jo(e){let[t,n]=V.useState(ko());return K(()=>{e||n(e=>e??String(Ao++))},[e]),e||(t?`radix-${t}`:``)}Oo(jo,`useId`);var Mo=Object.defineProperty,No=(e,t)=>Mo(e,`name`,{value:t,configurable:!0}),Po=`Collapsible`,[Fo,Io]=G(Po),[Lo,Ro]=Fo(Po),zo=V.forwardRef(No(function(e,t){let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...s}=e,[c,l]=po({prop:r,defaultProp:i??!1,onChange:o,caller:Po});return(0,H.jsx)(Lo,{scope:n,disabled:a,contentId:jo(),open:c,onOpenToggle:V.useCallback(()=>l(e=>!e),[l]),children:(0,H.jsx)(W.div,{"data-state":Go(c),"data-disabled":a?``:void 0,...s,ref:t})})},`Collapsible`)),Bo=`CollapsibleTrigger`,Vo=V.forwardRef(No(function(e,t){let{__scopeCollapsible:n,...r}=e,i=Ro(Bo,n);return(0,H.jsx)(W.button,{type:`button`,"aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":Go(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:q(e.onClick,i.onOpenToggle)})},`CollapsibleTrigger`)),Ho=`CollapsibleContent`,Uo=V.forwardRef(No(function(e,t){let{forceMount:n,...r}=e,i=Ro(Ho,e.__scopeCollapsible);return(0,H.jsx)(xo,{present:n||i.open,children:({present:e})=>(0,H.jsx)(Wo,{...r,ref:t,present:e})})},`CollapsibleContent`)),Wo=V.forwardRef(No(function(e,t){let{__scopeCollapsible:n,present:r,children:i,...a}=e,o=Ro(Ho,n),[s,c]=V.useState(r),l=V.useRef(null),u=U(t,l),d=V.useRef(0),f=d.current,p=V.useRef(0),m=p.current,h=o.open||s,g=V.useRef(h),_=V.useRef(void 0);return V.useEffect(()=>{let e=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(e)},[]),K(()=>{let e=l.current;if(e){_.current=_.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();d.current=t.height,p.current=t.width,g.current||(e.style.transitionDuration=_.current.transitionDuration,e.style.animationName=_.current.animationName),c(r)}},[o.open,r]),(0,H.jsx)(W.div,{"data-state":Go(o.open),"data-disabled":o.disabled?``:void 0,id:o.contentId,hidden:!h,...a,ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:h&&i})},`CollapsibleContentImpl`));function Go(e){return e?`open`:`closed`}No(Go,`getState`);var Ko=Object.defineProperty,qo=(e,t)=>Ko(e,`name`,{value:t,configurable:!0}),Jo={LTR:`ltr`,RTL:`rtl`},Yo=V.createContext(void 0);function Xo(e){let t=V.useContext(Yo);return e||t||Jo.LTR}qo(Xo,`useDirection`);var Zo=Object.defineProperty,Qo=(e,t)=>Zo(e,`name`,{value:t,configurable:!0}),$o={Single:`single`,Multiple:`multiple`},es={Vertical:`vertical`,Horizontal:`horizontal`},ts={LTR:`ltr`,RTL:`rtl`},ns=`Accordion`,rs=[`Home`,`End`,`ArrowDown`,`ArrowUp`,`ArrowLeft`,`ArrowRight`],[is,{useGetCollection:as,createCollectionScope:os}]=Ga(ns),[ss,cs]=G(ns,[os,Io]),ls=Io(),us=V.forwardRef(Qo(function(e,t){let{type:n,...r}=e,i=r,a=r;return(0,H.jsx)(is.Provider,{scope:e.__scopeAccordion,children:n===$o.Multiple?(0,H.jsx)(gs,{...a,ref:t}):(0,H.jsx)(hs,{...i,ref:t})})},`Accordion`)),[ds,fs]=ss(ns),[ps,ms]=ss(ns,{collapsible:!1}),hs=V.forwardRef(Qo(function(e,t){let{value:n,defaultValue:r,onValueChange:i=Qo(()=>{},`onValueChange`),collapsible:a=!1,...o}=e,[s,c]=po({prop:n,defaultProp:r??``,onChange:i,caller:ns});return(0,H.jsx)(ds,{scope:e.__scopeAccordion,value:V.useMemo(()=>s?[s]:[],[s]),onItemOpen:c,onItemClose:V.useCallback(()=>a&&c(``),[a,c]),children:(0,H.jsx)(ps,{scope:e.__scopeAccordion,collapsible:a,children:(0,H.jsx)(ys,{...o,ref:t})})})},`AccordionImplSingle`)),gs=V.forwardRef(Qo(function(e,t){let{value:n,defaultValue:r,onValueChange:i=Qo(()=>{},`onValueChange`),...a}=e,[o,s]=po({prop:n,defaultProp:r??[],onChange:i,caller:ns}),c=V.useCallback(e=>s((t=[])=>[...t,e]),[s]),l=V.useCallback(e=>s((t=[])=>t.filter(t=>t!==e)),[s]);return(0,H.jsx)(ds,{scope:e.__scopeAccordion,value:o,onItemOpen:c,onItemClose:l,children:(0,H.jsx)(ps,{scope:e.__scopeAccordion,collapsible:!0,children:(0,H.jsx)(ys,{...a,ref:t})})})},`AccordionImplMultiple`)),[_s,vs]=ss(ns),ys=V.forwardRef(Qo(function(e,t){let{__scopeAccordion:n,disabled:r,dir:i,orientation:a=es.Vertical,...o}=e,s=U(V.useRef(null),t),c=as(n),l=Xo(i)===ts.LTR,u=q(e.onKeyDown,e=>{if(!rs.includes(e.key))return;let t=c(),n=e.target,r=t.filter(([,e])=>!e.element.disabled),i=r.findIndex(([,e])=>e.element===n),o=r.size;if(i===-1)return;e.preventDefault();let s=i,u=o-1,d=Qo(()=>{s=i+1,s>u&&(s=0)},`moveNext`),f=Qo(()=>{s=i-1,s<0&&(s=u)},`movePrev`);switch(e.key){case`Home`:s=0;break;case`End`:s=u;break;case`ArrowRight`:a===es.Horizontal&&(l?d():f());break;case`ArrowDown`:a===es.Vertical&&d();break;case`ArrowLeft`:a===es.Horizontal&&(l?f():d());break;case`ArrowUp`:a===es.Vertical&&f()}let p=s%o;r.at(p)?.element.focus()});return(0,H.jsx)(_s,{scope:n,disabled:r,direction:i,orientation:a,children:(0,H.jsx)(is.Slot,{scope:n,children:(0,H.jsx)(W.div,{...o,"data-orientation":a,ref:s,onKeyDown:r?void 0:u})})})},`AccordionImpl`)),bs=`AccordionItem`,[xs,Ss]=ss(bs),Cs=V.forwardRef(Qo(function(e,t){let{__scopeAccordion:n,value:r,...i}=e,a=vs(bs,n),o=fs(bs,n),s=ls(n),c=jo(),l=r&&o.value.includes(r)||!1,u=a.disabled||e.disabled;return(0,H.jsx)(xs,{scope:n,open:l,disabled:u,triggerId:c,children:(0,H.jsx)(zo,{"data-orientation":a.orientation,"data-state":As(l),...s,...i,ref:t,disabled:u,open:l,onOpenChange:e=>{e?o.onItemOpen(r):o.onItemClose(r)}})})},`AccordionItem`)),ws=`AccordionHeader`,Ts=V.forwardRef(Qo(function(e,t){let{__scopeAccordion:n,...r}=e,i=vs(ns,n),a=Ss(ws,n);return(0,H.jsx)(W.h3,{"data-orientation":i.orientation,"data-state":As(a.open),"data-disabled":a.disabled?``:void 0,...r,ref:t})},`AccordionHeader`)),Es=`AccordionTrigger`,Ds=V.forwardRef(Qo(function(e,t){let{__scopeAccordion:n,...r}=e,i=vs(ns,n),a=Ss(Es,n),o=ms(Es,n),s=ls(n);return(0,H.jsx)(is.ItemSlot,{scope:n,children:(0,H.jsx)(Vo,{"aria-disabled":a.open&&!o.collapsible||void 0,"data-orientation":i.orientation,id:a.triggerId,...s,...r,ref:t})})},`AccordionTrigger`)),Os=`AccordionContent`,ks=V.forwardRef(Qo(function(e,t){let{__scopeAccordion:n,...r}=e,i=vs(ns,n),a=Ss(Os,n),o=ls(n);return(0,H.jsx)(Uo,{role:`region`,"aria-labelledby":a.triggerId,"data-orientation":i.orientation,...o,...r,ref:t,style:{"--radix-accordion-content-height":`var(--radix-collapsible-content-height)`,"--radix-accordion-content-width":`var(--radix-collapsible-content-width)`,...e.style}})},`AccordionContent`));function As(e){return e?`open`:`closed`}Qo(As,`getState`);var js=Object.defineProperty,Ms=(e,t)=>js(e,`name`,{value:t,configurable:!0}),Ns=V.useInsertionEffect;function Ps(e){let t=V.useRef(e);return typeof Ns==`function`?Ns(()=>{t.current=e}):K(()=>{t.current=e}),V.useMemo(()=>((...e)=>t.current?.(...e)),[])}Ms(Ps,`useCallbackRef`);var Fs=Object.defineProperty,Is=(e,t)=>Fs(e,`name`,{value:t,configurable:!0}),Ls=`dismissableLayer.update`,Rs=`dismissableLayer.pointerDownOutside`,zs=`dismissableLayer.focusOutside`,Bs,Vs=V.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Hs=V.forwardRef(Is(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=V.useContext(Vs),[d,f]=V.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=V.useState({}),h=U(t,f),g=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=_?g.indexOf(_):-1,y=d?g.indexOf(d):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,x=y>=v,S=V.useRef(!1),C=Gs(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:S,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:V.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return x&&!t},[u.branches,x])}),w=Ks(e=>{if(r&&S.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),T=d?y===g.length-1:!1,E=Ps(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return V.useEffect(()=>{if(T)return p.addEventListener(`keydown`,E,{capture:!0}),()=>p.removeEventListener(`keydown`,E,{capture:!0})},[p,T,E]),V.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Bs=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),qs(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=Bs))}},[d,p,n,u]),V.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),qs())},[d,u]),V.useEffect(()=>{let e=Is(()=>m({}),`handleUpdate`);return document.addEventListener(Ls,e),()=>document.removeEventListener(Ls,e)},[]),(0,H.jsx)(W.div,{...l,ref:h,style:{pointerEvents:b?x?`auto`:`none`:void 0,...e.style},onFocusCapture:q(e.onFocusCapture,w.onFocusCapture),onBlurCapture:q(e.onBlurCapture,w.onBlurCapture),onPointerDownCapture:q(e.onPointerDownCapture,C.onPointerDownCapture)})},`DismissableLayer`));function Us(){let e=V.useContext(Vs),[t,n]=V.useState(null);return V.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Is(Us,`useDismissableLayerSurface`);var Ws=Is(()=>!0,`IS_TRUE`);function Gs(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Ws}=t,s=Ps(e),c=V.useRef(!1),l=V.useRef(!1),u=V.useRef(new Map),d=V.useRef(()=>{});return V.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}Is(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}Is(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}Is(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}Is(p,`handleInteractionBubble`);let m=Is(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||Js(Rs,s,p,{discrete:!0})};if(Is(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:Is(()=>c.current=!0,`onPointerDownCapture`)}}Is(Gs,`usePointerDownOutside`);function Ks(e,t=globalThis?.document){let n=Ps(e),r=V.useRef(!1);return V.useEffect(()=>{let e=Is(e=>{e.target&&!r.current&&Js(zs,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:Is(()=>r.current=!0,`onFocusCapture`),onBlurCapture:Is(()=>r.current=!1,`onBlurCapture`)}}Is(Ks,`useFocusOutside`);function qs(){let e=new CustomEvent(Ls);document.dispatchEvent(e)}Is(qs,`dispatchUpdate`);function Js(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Oa(i,a):i.dispatchEvent(a)}Is(Js,`handleAndDispatchCustomEvent`);var Ys=Object.defineProperty,Xs=(e,t)=>Ys(e,`name`,{value:t,configurable:!0}),Zs=`focusScope.autoFocusOnMount`,Qs=`focusScope.autoFocusOnUnmount`,$s={bubbles:!1,cancelable:!0},ec=V.forwardRef(Xs(function(e,t){let{loop:n=!1,trapped:r=!1,branches:i,onMountAutoFocus:a,onUnmountAutoFocus:o,...s}=e,[c,l]=V.useState(null),u=Ps(a),d=Ps(o),f=V.useRef(null),p=U(t,l),m=V.useRef(i);V.useEffect(()=>{m.current=i});let h=V.useCallback(e=>e?c?.contains(e)?!0:!!m.current?.some(t=>t.contains(e)):!1,[c]),g=V.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;V.useEffect(()=>{if(r){let e=function(e){if(g.paused||!c)return;let t=e.target;h(t)?f.current=t:dc(f.current,{select:!0})},t=function(e){if(g.paused||!c)return;let t=e.relatedTarget;t!==null&&(h(t)||dc(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&dc(c)};Xs(e,`handleFocusIn`),Xs(t,`handleFocusOut`),Xs(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,c,g.paused,h]),V.useEffect(()=>{if(c){fc.add(g);let e=document.activeElement;if(!c.contains(e)){let t=new CustomEvent(Zs,$s);c.addEventListener(Zs,u),c.dispatchEvent(t),t.defaultPrevented||(ac(hc(sc(c)),{select:!0}),document.activeElement===e&&dc(c))}return()=>{c.removeEventListener(Zs,u);let t=c.ownerDocument,n=CustomEvent;setTimeout(()=>{let r=new n(Qs,$s);c.addEventListener(Qs,d),c.dispatchEvent(r),r.defaultPrevented||dc(e??t.body,{select:!0}),c.removeEventListener(Qs,d),fc.remove(g)},0)}}},[c,u,d,g]);let _=V.useCallback(e=>{if(!n&&!r||g.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=oc(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&dc(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&dc(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,g.paused]);return(0,H.jsx)(W.div,{tabIndex:-1,...s,ref:p,onKeyDown:_})},`FocusScope`)),tc=V.createContext(null);function nc({registry:e,children:t}){return e?(0,H.jsx)(tc.Provider,{value:e,children:t}):t}Xs(nc,`FocusScopeBranchProvider`);function rc(){let[e,t]=V.useState([]);return{nodes:e,registry:V.useMemo(()=>({add:Xs(e=>t(t=>t.includes(e)?t:[...t,e]),`add`),remove:Xs(e=>t(t=>t.filter(t=>t!==e)),`remove`)}),[])}}Xs(rc,`useFocusScopeBranchRegistry`);function ic(e){let t=V.useContext(tc);V.useEffect(()=>{if(e&&t)return t.add(e),()=>t.remove(e)},[e,t])}Xs(ic,`useFocusScopeBranch`);function ac(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(dc(r,{select:t}),document.activeElement!==n)return}Xs(ac,`focusFirst`);function oc(e){let t=sc(e);return[cc(t,e),cc(t.reverse(),e)]}Xs(oc,`getTabbableEdges`);function sc(e){let t=[],n=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Xs(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}Xs(sc,`getTabbableCandidates`);function cc(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):lc(r,{upTo:t})))return r}Xs(cc,`findVisible`);function lc(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}Xs(lc,`isHidden`);function uc(e){return e.tagName===`INPUT`&&typeof e.select==`function`}Xs(uc,`isSelectableInput`);function dc(e,{select:t=!1}={}){if(e&&e.focus){let n=(e.ownerDocument??document).activeElement;e.focus({preventScroll:!0}),e!==n&&uc(e)&&t&&e.select()}}Xs(dc,`focus`);var fc=pc();function pc(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=mc(e,t),e.unshift(t)},remove(t){e=mc(e,t),e[0]?.resume()}}}Xs(pc,`createFocusScopesStack`);function mc(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}Xs(mc,`arrayRemove`);function hc(e){return e.filter(e=>e.tagName!==`A`)}Xs(hc,`removeLinks`);var gc=Object.defineProperty,_c=V.forwardRef(((e,t)=>gc(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=V.useState(!1);K(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?sa.createPortal((0,H.jsx)(W.div,{...r,ref:t}),o):null},`Portal`)),vc=Object.defineProperty,yc=(e,t)=>vc(e,`name`,{value:t,configurable:!0}),bc=0,xc=null;function Sc(e){return Cc(),e.children}yc(Sc,`FocusGuards`);function Cc(){V.useEffect(()=>{xc||={start:wc(),end:wc()};let{start:e,end:t}=xc;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),bc++,()=>{bc===1&&(xc?.start.remove(),xc?.end.remove(),xc=null),bc=Math.max(0,bc-1)}},[])}yc(Cc,`useFocusGuards`);function wc(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}yc(wc,`createFocusGuard`);var Tc=function(){return Tc=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Tc.apply(this,arguments)};function Ec(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Dc(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Oc=`right-scroll-bar-position`,kc=`width-before-scroll-bar`,Ac=`with-scroll-bars-hidden`,jc=`--removed-body-scroll-bar-size`;function Mc(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Nc(e,t){var n=(0,V.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Pc=typeof window<`u`?V.useLayoutEffect:V.useEffect,Fc=new WeakMap;function Ic(e,t){var n=Nc(t||null,function(t){return e.forEach(function(e){return Mc(e,t)})});return Pc(function(){var t=Fc.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Mc(e,null)}),i.forEach(function(e){r.has(e)||Mc(e,a)})}Fc.set(n,e)},[e]),n}function Lc(e){return e}function Rc(e,t){t===void 0&&(t=Lc);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function zc(e){e===void 0&&(e={});var t=Rc(null);return t.options=Tc({async:!0,ssr:!1},e),t}var Bc=function(e){var t=e.sideCar,n=Ec(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return V.createElement(r,Tc({},n))};Bc.isSideCarExport=!0;function Vc(e,t){return e.useMedium(t),Bc}var Hc=zc(),Uc=function(){},Wc=V.forwardRef(function(e,t){var n=V.useRef(null),r=V.useState({onScrollCapture:Uc,onWheelCapture:Uc,onTouchMoveCapture:Uc}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=Ec(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Ic([n,t]),C=Tc(Tc({},b),i);return V.createElement(V.Fragment,null,u&&V.createElement(x,{sideCar:Hc,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?V.cloneElement(V.Children.only(s),Tc(Tc({},C),{ref:S})):V.createElement(v,Tc({},C,{className:c,ref:S}),s))});Wc.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Wc.classNames={fullWidth:kc,zeroRight:Oc};var Gc=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Kc(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Gc();return t&&e.setAttribute(`nonce`,t),e}function qc(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Jc(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Yc=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Kc())&&(qc(t,n),Jc(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Xc=function(){var e=Yc();return function(t,n){V.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Zc=function(){var e=Xc();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Qc={left:0,top:0,right:0,gap:0},$c=function(e){return parseInt(e||``,10)||0},el=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[$c(n),$c(r),$c(i)]},tl=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Qc;var t=el(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},nl=Zc(),rl=`data-scroll-locked`,il=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
131
+ .${Ac} {
132
+ overflow: hidden ${r};
133
+ padding-right: ${s}px ${r};
134
+ }
135
+ body[${rl}] {
136
+ overflow: hidden ${r};
137
+ overscroll-behavior: contain;
138
+ ${[t&&`position: relative ${r};`,n===`margin`&&`
139
+ padding-left: ${i}px;
140
+ padding-top: ${a}px;
141
+ padding-right: ${o}px;
142
+ margin-left:0;
143
+ margin-top:0;
144
+ margin-right: ${s}px ${r};
145
+ `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
146
+ }
147
+
148
+ .${Oc} {
149
+ right: ${s}px ${r};
150
+ }
151
+
152
+ .${kc} {
153
+ margin-right: ${s}px ${r};
154
+ }
155
+
156
+ .${Oc} .${Oc} {
157
+ right: 0 ${r};
158
+ }
159
+
160
+ .${kc} .${kc} {
161
+ margin-right: 0 ${r};
162
+ }
163
+
164
+ body[${rl}] {
165
+ ${jc}: ${s}px;
166
+ }
167
+ `},al=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},ol=function(){V.useEffect(function(){return document.body.setAttribute(rl,(al()+1).toString()),function(){var e=al()-1;e<=0?document.body.removeAttribute(rl):document.body.setAttribute(rl,e.toString())}},[])},sl=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;ol();var a=V.useMemo(function(){return tl(i)},[i]);return V.createElement(nl,{styles:il(a,!t,i,n?``:`!important`)})},cl=!1;if(typeof window<`u`)try{var ll=Object.defineProperty({},"passive",{get:function(){return cl=!0,!0}});window.addEventListener(`test`,ll,ll),window.removeEventListener(`test`,ll,ll)}catch{cl=!1}var ul=cl?{passive:!1}:!1,dl=function(e){return e.tagName===`TEXTAREA`},fl=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!dl(e)&&n[t]===`visible`)},pl=function(e){return fl(e,`overflowY`)},ml=function(e){return fl(e,`overflowX`)},hl=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),vl(e,r)){var i=yl(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},gl=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},_l=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},vl=function(e,t){return e===`v`?pl(t):ml(t)},yl=function(e,t){return e===`v`?gl(t):_l(t)},bl=function(e,t){return e===`h`&&t===`rtl`?-1:1},xl=function(e,t,n,r,i){var a=bl(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=yl(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&vl(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Sl=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Cl=function(e){return[e.deltaX,e.deltaY]},wl=function(e){return e&&`current`in e?e.current:e},Tl=function(e,t){return e[0]===t[0]&&e[1]===t[1]},El=function(e){return`
168
+ .block-interactivity-${e} {pointer-events: none;}
169
+ .allow-interactivity-${e} {pointer-events: all;}
170
+ `},Dl=0,Ol=[];function kl(e){var t=V.useRef([]),n=V.useRef([0,0]),r=V.useRef(),i=V.useState(Dl++)[0],a=V.useState(Zc)[0],o=V.useRef(e);V.useEffect(function(){o.current=e},[e]),V.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Dc([e.lockRef.current],(e.shards||[]).map(wl),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=V.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Sl(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=hl(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=hl(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return xl(h,t,e,h===`h`?s:c,!0)},[]),c=V.useCallback(function(e){var n=e;if(Ol.length&&Ol[Ol.length-1]===a){var r=`deltaY`in n?Cl(n):Sl(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Tl(e.delta,r)})[0];if(i&&i.should)n.cancelable&&n.preventDefault();else if(!i){var c=(o.current.shards||[]).map(wl).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=V.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Al(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=V.useCallback(function(e){n.current=Sl(e),r.current=void 0},[]),d=V.useCallback(function(t){l(t.type,Cl(t),t.target,s(t,e.lockRef.current))},[]),f=V.useCallback(function(t){l(t.type,Sl(t),t.target,s(t,e.lockRef.current))},[]);V.useEffect(function(){return Ol.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,ul),document.addEventListener(`touchmove`,c,ul),document.addEventListener(`touchstart`,u,ul),function(){Ol=Ol.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,ul),document.removeEventListener(`touchmove`,c,ul),document.removeEventListener(`touchstart`,u,ul)}},[]);var p=e.removeScrollBar,m=e.inert;return V.createElement(V.Fragment,null,m?V.createElement(a,{styles:El(i)}):null,p?V.createElement(sl,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Al(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var jl=Vc(Hc,kl),Ml=V.forwardRef(function(e,t){return V.createElement(Wc,Tc({},e,{ref:t,sideCar:jl}))});Ml.classNames=Wc.classNames;var Nl=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Pl=new WeakMap,Fl=new WeakMap,Il={},Ll=0,Rl=function(e){return e&&(e.host||Rl(e.parentNode))},zl=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Rl(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Bl=function(e,t,n,r){var i=zl(t,Array.isArray(e)?e:[e]);Il[n]||(Il[n]=new WeakMap);var a=Il[n],o=[],s=new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Pl.get(e)||0)+1,l=(a.get(e)||0)+1;Pl.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Fl.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Ll++,function(){o.forEach(function(e){var t=Pl.get(e)-1,i=a.get(e)-1;Pl.set(e,t),a.set(e,i),t||(Fl.has(e)||e.removeAttribute(r),Fl.delete(e)),i||e.removeAttribute(n)}),Ll--,Ll||(Pl=new WeakMap,Pl=new WeakMap,Fl=new WeakMap,Il={})}},Vl=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Nl(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Bl(r,i,n,`aria-hidden`)):function(){return null}},Hl=Object.defineProperty,Ul=(e,t)=>Hl(e,`name`,{value:t,configurable:!0}),Wl=`Dialog`,[Gl,Kl]=G(Wl),[ql,Jl]=Gl(Wl),Yl=Ul(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=V.useRef(null),c=V.useRef(null),{nodes:l,registry:u}=rc(),[d,f]=po({prop:r,defaultProp:i??!1,onChange:a,caller:Wl}),[p,m]=V.useState(0),[h,g]=V.useState(0);return(0,H.jsx)(ql,{scope:t,triggerRef:s,contentRef:c,contentId:jo(),titleId:jo(),descriptionId:jo(),titlePresent:p>0,descriptionPresent:h>0,setTitleCount:m,setDescriptionCount:g,open:d,onOpenChange:f,onOpenToggle:V.useCallback(()=>f(e=>!e),[f]),modal:o,branchNodes:l,branchRegistry:u,children:n})},`Dialog`),Xl=`DialogTrigger`,Zl=V.forwardRef(Ul(function(e,t){let{__scopeDialog:n,...r}=e,i=Jl(Xl,n),a=U(t,i.triggerRef);return(0,H.jsx)(W.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":gu(i.open),...r,ref:a,onClick:q(e.onClick,i.onOpenToggle)})},`DialogTrigger`)),Ql=`DialogPortal`,[$l,eu]=Gl(Ql,{forceMount:void 0}),tu=Ul(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Jl(Ql,t);return(0,H.jsx)($l,{scope:t,forceMount:n,children:V.Children.map(r,e=>(0,H.jsx)(xo,{present:n||a.open,children:(0,H.jsx)(_c,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),nu=`DialogOverlay`,ru=V.forwardRef(Ul(function(e,t){let n=eu(nu,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Jl(nu,e.__scopeDialog);return a.modal?(0,H.jsx)(xo,{present:r||a.open,children:(0,H.jsx)(au,{...i,ref:t})}):null},`DialogOverlay`)),iu=ua(`DialogOverlay.RemoveScroll`),au=V.forwardRef(Ul(function(e,t){let{__scopeDialog:n,...r}=e,i=Jl(nu,n),a=U(t,Us());return(0,H.jsx)(Ml,{as:iu,allowPinchZoom:!0,shards:V.useMemo(()=>[i.contentRef,...i.branchNodes.map(e=>({current:e}))],[i.contentRef,i.branchNodes]),children:(0,H.jsx)(W.div,{"data-state":gu(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),ou=`DialogContent`,su=V.forwardRef(Ul(function(e,t){let n=eu(ou,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Jl(ou,e.__scopeDialog);return(0,H.jsx)(xo,{present:r||a.open,children:a.modal?(0,H.jsx)(cu,{...i,ref:t}):(0,H.jsx)(lu,{...i,ref:t})})},`DialogContent`)),cu=V.forwardRef(Ul(function(e,t){let n=Jl(ou,e.__scopeDialog),r=V.useRef(null),i=U(t,n.contentRef,r);return V.useEffect(()=>{let e=r.current;if(e)return Vl(e)},[]),(0,H.jsx)(uu,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:q(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:q(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:q(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),lu=V.forwardRef(Ul(function(e,t){let n=Jl(ou,e.__scopeDialog),r=V.useRef(!1),i=V.useRef(!1);return(0,H.jsx)(uu,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),uu=V.forwardRef(Ul(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,"aria-describedby":o,children:s,...c}=e,l=Jl(ou,n);return Cc(),(0,H.jsx)(nc,{registry:l.branchRegistry,children:(0,H.jsx)(ec,{asChild:!0,loop:!0,trapped:r,branches:l.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,H.jsx)(Hs,{role:`dialog`,id:l.contentId,"aria-labelledby":l.titlePresent?l.titleId:void 0,"aria-describedby":l.descriptionPresent?hu(o,l.descriptionId):o,"data-state":gu(l.open),...c,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1),children:s})})})},`DialogContentImpl`)),du=V.forwardRef(Ul(function(e,t){let{__scopeDialog:n,...r}=e,i=Jl(`DialogTitle`,n),{setTitleCount:a}=i;return K(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,H.jsx)(W.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),fu=V.forwardRef(Ul(function(e,t){let{__scopeDialog:n,...r}=e,i=Jl(`DialogDescription`,n),{setDescriptionCount:a}=i;return K(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,H.jsx)(W.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),pu=`DialogClose`,mu=V.forwardRef(Ul(function(e,t){let{__scopeDialog:n,...r}=e,i=Jl(pu,n);return(0,H.jsx)(W.button,{type:`button`,...r,ref:t,onClick:q(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function hu(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}Ul(hu,`concatAriaDescribedby`);function gu(e){return e?`open`:`closed`}Ul(gu,`getState`);var _u=Object.defineProperty,vu=(e,t)=>_u(e,`name`,{value:t,configurable:!0}),yu=`Avatar`,[bu,xu]=G(yu),Su={Idle:`idle`,Loading:`loading`,Loaded:`loaded`,Error:`error`},Cu=[0,()=>void 0],[wu,Tu]=bu(yu),Eu=V.forwardRef(vu(function(e,t){let{__scopeAvatar:n,...r}=e,[i,a]=V.useState(Su.Idle),[o,s]=Nu();return(0,H.jsx)(wu,{scope:n,imageLoadingStatus:i,setImageLoadingStatus:a,imageCount:o,setImageCount:s,children:(0,H.jsx)(W.span,{...r,ref:t})})},`Avatar`)),Du=`AvatarImage`,Ou=V.forwardRef(vu(function(e,t){let{__scopeAvatar:n,src:r,onLoadingStatusChange:i,...a}=e,o=Tu(Du,n);o.setImageCount;let s=ju(r,{referrerPolicy:a.referrerPolicy,crossOrigin:a.crossOrigin,loadingStatus:o.imageLoadingStatus,setLoadingStatus:o.setImageLoadingStatus}),c=Ps(e=>{i?.(e)}),l=V.useRef(s);return K(()=>{let e=l.current;l.current=s,s!==e&&c(s)},[s,c]),s===Su.Loaded?(0,H.jsx)(W.img,{...a,ref:t,src:r}):null},`AvatarImage`)),ku=`AvatarFallback`,Au=V.forwardRef(vu(function(e,t){let{__scopeAvatar:n,delayMs:r,...i}=e,a=Tu(ku,n),[o,s]=V.useState(r===void 0);return V.useEffect(()=>{if(r!==void 0){let e=window.setTimeout(()=>s(!0),r);return()=>window.clearTimeout(e)}},[r]),o&&a.imageLoadingStatus!==Su.Loaded?(0,H.jsx)(W.span,{...i,ref:t}):null},`AvatarFallback`));function ju(e,{loadingStatus:t,setLoadingStatus:n,referrerPolicy:r,crossOrigin:i}){return K(()=>{if(!e){n(Su.Error);return}let t=new window.Image,a=vu(e=>{let t=e.currentTarget;n(Mu(t))},`handleLoad`),o=vu(()=>n(Su.Error),`handleError`);return t.addEventListener(`load`,a),t.addEventListener(`error`,o),r&&(t.referrerPolicy=r),t.crossOrigin=i??null,t.src=e,n(Mu(t)),()=>{t.removeEventListener(`load`,a),t.removeEventListener(`error`,o),n(Su.Idle)}},[e,i,r,n]),t}vu(ju,`useImageLoadingStatus`);function Mu(e){return e.complete?e.naturalWidth>0?Su.Loaded:Su.Error:Su.Loading}vu(Mu,`getImageLoadingStatus`);function Nu(){return Cu}vu(Nu,`useImageCount`);function Pu(e){}vu(Pu,`useUpdateImageCount`);var Fu=Object.defineProperty,Iu=(e,t)=>Fu(e,`name`,{value:t,configurable:!0});function Lu(e){let[t,n]=V.useState(void 0);return K(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=0,r=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;let i=r[0];window.cancelAnimationFrame(t),t=window.requestAnimationFrame(()=>{let t,r;if(`borderBoxSize`in i){let e=i.borderBoxSize,n=Array.isArray(e)?e[0]:e;t=n.inlineSize,r=n.blockSize}else t=e.offsetWidth,r=e.offsetHeight;n({width:t,height:r})})});return r.observe(e,{box:`border-box`}),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}n(void 0)},[e]),t}Iu(Lu,`useSize`);var Ru=Object.defineProperty,zu=(e,t)=>Ru(e,`name`,{value:t,configurable:!0}),Bu=`Checkbox`,[Vu,Hu]=G(Bu),[Uu,Wu]=Vu(Bu);function Gu(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=po({prop:n,defaultProp:i??!1,onChange:c,caller:Bu}),[m,h]=V.useState(null),[g,_]=V.useState(null),[v,y]=V.useState(null),b=!m||!!o||!!m.closest(`form`),x={checked:f,disabled:a,setChecked:p,control:m,setControl:h,name:s,form:o,value:u,userClick:v,onUserClick:y,required:l,defaultChecked:!ed(i)&&i,isFormControl:b,bubbleInput:g,setBubbleInput:_};return(0,H.jsx)(Uu,{scope:t,...x,children:$u(d)?d(x):r})}zu(Gu,`CheckboxProvider`);var Ku=`CheckboxTrigger`,qu=V.forwardRef(zu(function({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i){let{control:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,onUserClick:f,isFormControl:p,bubbleInput:m}=Wu(Ku,e),h=U(i,u),g=V.useRef(c);return V.useEffect(()=>{let e=a?.form;if(e){let t=zu(()=>d(g.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[a,d]),(0,H.jsx)(W.button,{type:`button`,role:`checkbox`,"aria-checked":ed(c)?`mixed`:c,"aria-required":l,"data-state":td(c),"data-disabled":s?``:void 0,disabled:s,value:o,...r,ref:h,onKeyDown:q(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:q(n,e=>{let t=e.isPropagationStopped();f({requestedChecked:ed(c)?!0:!c,hasConsumerStoppedPropagation:t}),d(e=>ed(e)?!0:!e),m&&p&&(t||e.stopPropagation())})})},`CheckboxTrigger`)),Ju=V.forwardRef(zu(function(e,t){let{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,H.jsx)(Gu,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(qu,{...d,ref:t,__scopeCheckbox:n}),e&&(0,H.jsx)(Qu,{__scopeCheckbox:n})]})})},`Checkbox`)),Yu=`CheckboxIndicator`,Xu=V.forwardRef(zu(function(e,t){let{__scopeCheckbox:n,forceMount:r,...i}=e,a=Wu(Yu,n);return(0,H.jsx)(xo,{present:r||ed(a.checked)||a.checked===!0,children:(0,H.jsx)(W.span,{"data-state":td(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})},`CheckboxIndicator`)),Zu=`CheckboxBubbleInput`,Qu=V.forwardRef(zu(function({__scopeCheckbox:e,onClick:t,...n},r){let{control:i,userClick:a,checked:o,defaultChecked:s,required:c,disabled:l,name:u,value:d,form:f,bubbleInput:p,setBubbleInput:m}=Wu(Zu,e),h=U(r,m),g=Lu(i),_=V.useRef(!1),v=V.useRef(o),y=V.useRef(a),b=V.useRef(null);V.useEffect(()=>{let e=p;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set;if(!n)return;let r=v.current!==o;v.current=o;let i=a!==null&&a!==y.current;if(y.current=a,i)b.current=r?null:a,r&&(e.indeterminate=ed(o),n.call(e,!ed(o)&&o)),e.dispatchEvent(new Event(`click`,{bubbles:!a.hasConsumerStoppedPropagation}));else if(r){let t=b.current;b.current=null;let r=t?.requestedChecked===o;_.current=!0,e.indeterminate=ed(o),n.call(e,!ed(o)&&o),e.dispatchEvent(new Event(`click`,{bubbles:!(r&&t.hasConsumerStoppedPropagation)})),_.current=!1}},[p,o,a]);let x=V.useRef(!ed(o)&&o);return(0,H.jsx)(W.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:s??x.current,required:c,disabled:l,name:u,value:d,form:f,...n,tabIndex:-1,ref:h,onClick:q(t,e=>{_.current&&e.stopPropagation()}),style:{...n.style,...g,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`CheckboxBubbleInput`));function $u(e){return typeof e==`function`}zu($u,`isFunction`);function ed(e){return e===`indeterminate`}zu(ed,`isIndeterminate`);function td(e){return ed(e)?`indeterminate`:e?`checked`:`unchecked`}zu(td,`getState`);var nd=[`top`,`right`,`bottom`,`left`],rd=Math.min,id=Math.max,ad=Math.round,od=Math.floor,sd=e=>({x:e,y:e}),cd={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function ld(e,t,n){return id(e,rd(t,n))}function ud(e,t){return typeof e==`function`?e(t):e}function dd(e){return e.split(`-`)[0]}function fd(e){return e.split(`-`)[1]}function pd(e){return e===`x`?`y`:`x`}function md(e){return e===`y`?`height`:`width`}function hd(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function gd(e){return pd(hd(e))}function _d(e,t,n){n===void 0&&(n=!1);let r=fd(e),i=gd(e),a=md(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Ed(o)),[o,Ed(o)]}function vd(e){let t=Ed(e);return[yd(e),t,yd(t)]}function yd(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var bd=[`left`,`right`],xd=[`right`,`left`],Sd=[`top`,`bottom`],Cd=[`bottom`,`top`];function wd(e,t,n){switch(e){case`top`:case`bottom`:return n?t?xd:bd:t?bd:xd;case`left`:case`right`:return t?Sd:Cd;default:return[]}}function Td(e,t,n,r){let i=fd(e),a=wd(dd(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(yd)))),a}function Ed(e){let t=dd(e);return cd[t]+e.slice(t.length)}function Dd(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Od(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Dd(e)}function kd(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Ad(e,t,n){let{reference:r,floating:i}=e,a=hd(t),o=gd(t),s=md(o),c=dd(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=fd(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function jd(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=ud(t,e),p=Od(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=kd(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=kd(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Md=50,Nd=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:jd},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Ad(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Md&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Ad(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Pd=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=ud(e,t)||{};if(l==null)return{};let d=Od(u),f={x:n,y:r},p=gd(i),m=md(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;C&&await(o.isElement==null?void 0:o.isElement(S))||(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=rd(d[_],T),D=rd(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=ld(E,k,O),j=!c.arrow&&fd(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,M=j?k<E?k-E:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),Fd=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=ud(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=dd(r),_=hd(o),v=dd(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Ed(o)]:vd(o)),x=p!==`none`;!d&&x&&b.push(...Td(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=_d(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===hd(t)||T.every(e=>hd(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=hd(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function Id(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ld(e){return nd.some(t=>e[t]>=0)}var Rd=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=ud(e,t);switch(i){case`referenceHidden`:{let e=Id(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Ld(e)}}}case`escaped`:{let e=Id(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Ld(e)}}}default:return{}}}}},zd=new Set([`left`,`top`]);async function Bd(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=dd(n),s=fd(n),c=hd(n)===`y`,l=zd.has(o)?-1:1,u=a&&c?-1:1,d=ud(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Vd=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Bd(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Hd=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=ud(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=hd(i),p=pd(f),m=u[p],h=u[f],g=(e,t)=>ld(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Ud=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=ud(e,t),u={x:n,y:r},d=hd(i),f=pd(d),p=u[f],m=u[d],h=ud(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=zd.has(dd(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Wd=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=ud(e,t),c=await i.detectOverflow(t,s),l=dd(n),u=fd(n),d=hd(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=rd(p-c[m],g),y=rd(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*id(c.left,c.right):S=p-2*id(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Gd(){return typeof window<`u`}function Kd(e){return Yd(e)?(e.nodeName||``).toLowerCase():`#document`}function qd(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Jd(e){return((Yd(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Yd(e){return Gd()?e instanceof Node||e instanceof qd(e).Node:!1}function Xd(e){return Gd()?e instanceof Element||e instanceof qd(e).Element:!1}function Zd(e){return Gd()?e instanceof HTMLElement||e instanceof qd(e).HTMLElement:!1}function Qd(e){return!Gd()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof qd(e).ShadowRoot}function $d(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=df(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function ef(e){return/^(table|td|th)$/.test(Kd(e))}function tf(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var nf=/transform|translate|scale|rotate|perspective|filter/,rf=/paint|layout|strict|content/,af=e=>!!e&&e!==`none`,of;function sf(e){let t=Xd(e)?df(e):e;return af(t.transform)||af(t.translate)||af(t.scale)||af(t.rotate)||af(t.perspective)||!lf()&&(af(t.backdropFilter)||af(t.filter))||nf.test(t.willChange||``)||rf.test(t.contain||``)}function cf(e){let t=pf(e);for(;Zd(t)&&!uf(t);){if(sf(t))return t;if(tf(t))return null;t=pf(t)}return null}function lf(){return of??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),of}function uf(e){return/^(html|body|#document)$/.test(Kd(e))}function df(e){return qd(e).getComputedStyle(e)}function ff(e){return Xd(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function pf(e){if(Kd(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Qd(e)&&e.host||Jd(e);return Qd(t)?t.host:t}function mf(e){let t=pf(e);return uf(t)?(e.ownerDocument||e).body:Zd(t)&&$d(t)?t:mf(t)}function hf(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=mf(e),i=r===e.ownerDocument?.body,a=qd(r);if(i){let e=gf(a);return t.concat(a,a.visualViewport||[],$d(r)?r:[],e&&n?hf(e):[])}return t.concat(r,hf(r,[],n))}function gf(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function _f(e){let t=df(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Zd(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=ad(n)!==a||ad(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function vf(e){return Xd(e)?e:e.contextElement}function yf(e){let t=vf(e);if(!Zd(t))return sd(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=_f(t),o=(a?ad(n.width):n.width)/r,s=(a?ad(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}var bf=sd(0);function xf(e){let t=qd(e);return!lf()||!t.visualViewport?bf:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Sf(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===qd(e)}function Cf(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=vf(e),o=sd(1);t&&(r?Xd(r)&&(o=yf(r)):o=yf(e));let s=Sf(a,n,r)?xf(a):sd(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=qd(a),t=Xd(r)?qd(r):r,n=e,i=gf(n);for(;i&&t!==n;){let e=yf(i),t=i.getBoundingClientRect(),r=df(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=qd(i),i=gf(n)}}return kd({width:u,height:d,x:c,y:l})}function wf(e,t){let n=ff(e).scrollLeft;return t?t.left+n:Cf(Jd(e)).left+n}function Tf(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-wf(e,n),y:n.top+t.scrollTop}}function Ef(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Jd(r),s=t?tf(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=sd(1),u=sd(0),d=Zd(r);if((d||!a)&&((Kd(r)!==`body`||$d(o))&&(c=ff(r)),d)){let e=Cf(r);l=yf(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Tf(o,c):sd(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Df(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Of(e){let t=ff(e),n=e.ownerDocument.body,r=id(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=id(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+wf(e),o=-t.scrollTop;return df(n).direction===`rtl`&&(a+=id(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var kf=25;function Af(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=qd(e),a=Jd(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!lf()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(wf(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=kf&&(s-=o)}return{width:s,height:c,x:l,y:u}}function jf(e,t){let n=Cf(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=yf(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Mf(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Af(e,n,t);else if(t===`document`)r=Of(Jd(e));else if(Xd(t))r=jf(t,n);else{let n=xf(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return kd(r)}function Nf(e,t){let n=t.get(e);if(n)return n;let r=hf(e,[],!1).filter(e=>Xd(e)&&Kd(e)!==`body`),i=null,a=df(e).position===`fixed`,o=a?pf(e):e;for(;Xd(o)&&!uf(o);){let e=df(o),t=sf(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=pf(o)}return t.set(e,r),r}function Pf(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?tf(t)?[]:Nf(t,this._c):[].concat(n),r],o=Mf(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Mf(t,a[e],i);s=id(n.top,s),c=rd(n.right,c),l=rd(n.bottom,l),u=id(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Ff(e){let{width:t,height:n}=_f(e);return{width:t,height:n}}function If(e,t,n){let r=Zd(t),i=Jd(t),a=n===`fixed`,o=Cf(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=sd(0);if((r||!a)&&((Kd(t)!==`body`||$d(i))&&(s=ff(t)),r)){let e=Cf(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=wf(i));let l=i&&!r&&!a?Tf(i,s):sd(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function Lf(e){return df(e).position===`static`}function Rf(e,t){if(!Zd(e)||df(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Jd(e)===n&&(n=n.ownerDocument.body),n}function zf(e,t){let n=qd(e);if(tf(e))return n;if(!Zd(e)){let t=pf(e);for(;t&&!uf(t);){if(Xd(t)&&!Lf(t))return t;t=pf(t)}return n}let r=Rf(e,t);for(;r&&ef(r)&&Lf(r);)r=Rf(r,t);return r&&uf(r)&&Lf(r)&&!sf(r)?n:r||cf(e)||n}var Bf=async function(e){let t=this.getOffsetParent||zf,n=this.getDimensions,r=await n(e.floating);return{reference:If(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Vf(e){return df(e).direction===`rtl`}var Hf={convertOffsetParentRelativeRectToViewportRelativeRect:Ef,getDocumentElement:Jd,getClippingRect:Pf,getOffsetParent:zf,getElementRects:Bf,getClientRects:Df,getDimensions:Ff,getScale:yf,isElement:Xd,isRTL:Vf};function Uf(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Wf(e,t,n){let r=null,i,a=Jd(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=od(d),h=od(a.clientWidth-(u+f)),g=od(a.clientHeight-(d+p)),_=od(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:id(0,rd(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Uf(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=qd(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Gf(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=vf(e),u=i||a?[...l?hf(l):[],...t?hf(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Wf(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Cf(e):null;c&&g();function g(){let t=Cf(e);h&&!Uf(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Kf=Vd,qf=Hd,Jf=Fd,Yf=Wd,Xf=Rd,Zf=Pd,Qf=Ud,$f=(e,t,n)=>{let r=new Map,i=n??{},a={...Hf,...i.platform,_c:r};return Nd(e,t,{...i,platform:a})},ep=typeof document<`u`?V.useLayoutEffect:function(){};function tp(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!tp(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!tp(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function np(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function rp(e,t){let n=np(e);return Math.round(t*n)/n}function ip(e){let t=V.useRef(e);return ep(()=>{t.current=e}),t}function ap(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=V.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=V.useState(r);tp(f,r)||p(r);let[m,h]=V.useState(null),[g,_]=V.useState(null),v=V.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=V.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=V.useRef(null),C=V.useRef(null),w=V.useRef(u),T=c!=null,E=ip(c),D=ip(i),O=ip(l),k=V.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),$f(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!tp(w.current,t)&&(w.current=t,sa.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);ep(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=V.useRef(!1);ep(()=>(A.current=!0,()=>{A.current=!1}),[]),ep(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=V.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=V.useMemo(()=>({reference:b,floating:x}),[b,x]),N=V.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=rp(M.floating,u.x),r=rp(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...np(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return V.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var op=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Zf({element:r.current,padding:i}).fn(n):r?Zf({element:r,padding:i}).fn(n):{}}}},sp=(e,t)=>{let n=Kf(e);return{name:n.name,fn:n.fn,options:[e,t]}},cp=(e,t)=>{let n=qf(e);return{name:n.name,fn:n.fn,options:[e,t]}},lp=(e,t)=>({fn:Qf(e).fn,options:[e,t]}),up=(e,t)=>{let n=Jf(e);return{name:n.name,fn:n.fn,options:[e,t]}},dp=(e,t)=>{let n=Yf(e);return{name:n.name,fn:n.fn,options:[e,t]}},fp=(e,t)=>{let n=Xf(e);return{name:n.name,fn:n.fn,options:[e,t]}},pp=(e,t)=>{let n=op(e);return{name:n.name,fn:n.fn,options:[e,t]}},mp=Object.defineProperty,hp=V.forwardRef(((e,t)=>mp(e,`name`,{value:t,configurable:!0}))(function(e,t){let{children:n,width:r=10,height:i=5,...a}=e;return(0,H.jsx)(W.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,H.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})},`Arrow`)),gp=Object.defineProperty,_p=(e,t)=>gp(e,`name`,{value:t,configurable:!0}),vp={Partial:`partial`,Always:`always`},yp={Optimized:`optimized`,Always:`always`},bp=`Popper`,[xp,Sp]=G(bp),[Cp,wp]=xp(bp),Tp=_p(e=>{let{__scopePopper:t,children:n}=e,[r,i]=V.useState(null),[a,o]=V.useState(void 0);return(0,H.jsx)(Cp,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),Ep=`PopperAnchor`,Dp=V.forwardRef(_p(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=wp(Ep,n),o=V.useRef(null),s=a.onAnchorChange,c=U(t,V.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=V.useRef(null);V.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&Lp(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,H.jsx)(W.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),Op=`PopperContent`,[kp,Ap]=xp(Op),jp=V.forwardRef(_p(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=vp.Partial,hideWhenDetached:f=!1,updatePositionStrategy:p=yp.Optimized,onPlaced:m,...h}=e,g=wp(Op,n),[_,v]=V.useState(null),y=U(t,v),[b,x]=V.useState(null),S=Lu(b),C=S?.width??0,w=S?.height??0,T=r+(a===`center`?``:`-`+a),E=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},D=Array.isArray(l)?l:[l],O=D.length>0,k={padding:E,boundary:D.filter(Fp),altBoundary:O},{refs:A,floatingStyles:j,placement:M,isPositioned:N,middlewareData:P}=ap({strategy:`fixed`,placement:T,whileElementsMounted:_p((...e)=>Gf(...e,{animationFrame:p===yp.Always}),`whileElementsMounted`),elements:{reference:g.anchor},middleware:[sp({mainAxis:i+w,alignmentAxis:o}),c&&cp({mainAxis:!0,crossAxis:!1,...d===vp.Partial?{limiter:lp()}:{},...k}),c&&up({...k}),dp({...k,apply:_p(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),b&&pp({element:b,padding:s}),Ip({arrowWidth:C,arrowHeight:w}),f&&fp(O?{strategy:`referenceHidden`,...k}:{strategy:`referenceHidden`,padding:k.padding,altBoundary:k.altBoundary})]}),F=g.setPlacementState;K(()=>(F(M),()=>{F(void 0)}),[M,F]);let[I,L]=Lp(M),ee=Ps(m);K(()=>{N&&ee?.()},[N,ee]);let te=P.arrow?.x,ne=P.arrow?.y,R=P.arrow?.centerOffset!==0,[re,z]=V.useState();return K(()=>{_&&z(window.getComputedStyle(_).zIndex)},[_]),(0,H.jsx)(`div`,{ref:A.setFloating,"data-radix-popper-content-wrapper":``,style:{...j,transform:N?j.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:re,"--radix-popper-transform-origin":[P.transformOrigin?.x,P.transformOrigin?.y].join(` `),...P.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,H.jsx)(kp,{scope:n,placedSide:I,placedAlign:L,onArrowChange:x,arrowX:te,arrowY:ne,shouldHideArrow:R,children:(0,H.jsx)(W.div,{"data-side":I,"data-align":L,...h,ref:y,style:{...h.style,animation:N?h.style?.animation:`none`}})})})},`PopperContent`)),Mp=`PopperArrow`,Np={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Pp=V.forwardRef(_p(function(e,t){let{__scopePopper:n,...r}=e,i=Ap(Mp,n),a=Np[i.placedSide];return(0,H.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,H.jsx)(hp,{...r,ref:t,style:{...r.style,display:`block`}})})},`PopperArrow`));function Fp(e){return e!==null}_p(Fp,`isNotNull`);var Ip=_p(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Lp(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function Lp(e){let[t,n=`center`]=e.split(`-`);return[t,n]}_p(Lp,`getSideAndAlignFromPlacement`);var Rp=Object.defineProperty,zp=(e,t)=>Rp(e,`name`,{value:t,configurable:!0}),Bp=!1;function Vp(){let[e,t]=V.useState(Bp);return V.useEffect(()=>{Bp||(Bp=!0,t(!0))},[]),e}zp(Vp,`useIsHydrated`);var Hp=V.useSyncExternalStore;function Up(){return()=>{}}zp(Up,`subscribe`);function Wp(){return Hp(Up,()=>!0,()=>!1)}zp(Wp,`useIsHydratedModern`);var Gp=typeof Hp==`function`?Wp:Vp,Kp=Object.defineProperty,qp=(e,t)=>Kp(e,`name`,{value:t,configurable:!0}),Jp=`rovingFocusGroup.onEntryFocus`,Yp={bubbles:!1,cancelable:!0},Xp=`RovingFocusGroup`,[Zp,Qp,$p]=za(Xp),[em,tm]=G(Xp,[$p]),nm={Vertical:`vertical`,Horizontal:`horizontal`},rm={LTR:`ltr`,RTL:`rtl`},[im,am]=em(Xp),om=V.forwardRef(qp(function(e,t){return(0,H.jsx)(Zp.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,H.jsx)(Zp.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,H.jsx)(sm,{...e,ref:t})})})},`RovingFocusGroup`)),sm=V.forwardRef(qp(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=V.useRef(null),p=U(t,f),m=Xo(a),[h,g]=po({prop:o,defaultProp:s??null,onChange:c,caller:Xp}),[_,v]=V.useState(!1),y=Ps(l),b=Qp(n),x=V.useRef(!1),[S,C]=V.useState(0);return V.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(Jp,y),()=>e.removeEventListener(Jp,y)},[y]),(0,H.jsx)(im,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:V.useCallback(e=>g(e),[g]),onItemShiftTab:V.useCallback(()=>v(!0),[]),onFocusableItemAdd:V.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:V.useCallback(()=>C(e=>e-1),[]),children:(0,H.jsx)(W.div,{tabIndex:_||S===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:q(e.onMouseDown,()=>{x.current=!0}),onFocus:q(e.onFocus,e=>{let t=!x.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(Jp,Yp);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=b().filter(e=>e.focusable);pm([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}x.current=!1}),onBlur:q(e.onBlur,()=>v(!1))})})},`RovingFocusGroupImpl`)),cm=`RovingFocusGroupItem`,lm=V.forwardRef(qp(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=jo(),l=a||c,u=am(cm,n),d=u.currentTabStopId===l,f=Qp(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u,g=Gp();return K(()=>{if(g&&r)return p(),()=>m()},[g,r,p,m]),V.useEffect(()=>{if(!g&&r)return p(),()=>m()},[g,r,p,m]),(0,H.jsx)(Zp.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,H.jsx)(W.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:q(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:q(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:q(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=fm(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?mm(n,r+1):n.slice(r+1)}setTimeout(()=>pm(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})},`RovingFocusGroupItem`)),um={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function dm(e,t){return t===rm.RTL?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}qp(dm,`getDirectionAwareKey`);function fm(e,t,n){let r=dm(e.key,n);if(!(t===nm.Vertical&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===nm.Horizontal&&[`ArrowUp`,`ArrowDown`].includes(r)))return um[r]}qp(fm,`getFocusIntent`);function pm(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}qp(pm,`focusFirst`);function mm(e,t){return e.map((n,r)=>e[(t+r)%e.length])}qp(mm,`wrapArray`);var hm=Object.defineProperty,J=(e,t)=>hm(e,`name`,{value:t,configurable:!0}),gm=[`Enter`,` `],_m=[`ArrowDown`,`PageUp`,`Home`],vm=[`ArrowUp`,`PageDown`,`End`],ym=[..._m,...vm];[...gm],[...gm];var bm=`Menu`,[xm,Sm,Cm]=za(bm),[wm,Tm]=G(bm,[Cm,Sp,tm]),Em=Sp(),Dm=tm(),[Om,km]=wm(bm),[Am,jm]=wm(bm),Mm=J(e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=Em(t),[c,l]=V.useState(null),u=V.useRef(!1),d=Ps(a),f=Xo(i);return V.useEffect(()=>{let e=J(()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},`handleKeyDown`),t=J(()=>u.current=!1,`handlePointer`);return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),V.useEffect(()=>{if(!n)return;let e=J(()=>d(!1),`handleBlur`);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,d]),(0,H.jsx)(Tp,{...s,children:(0,H.jsx)(Om,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,H.jsx)(Am,{scope:t,onClose:V.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})},`Menu`),Nm=V.forwardRef(J(function(e,t){let{__scopeMenu:n,...r}=e,i=Em(n);return(0,H.jsx)(Dp,{...i,...r,ref:t})},`MenuAnchor`)),Pm=`MenuPortal`,[Fm,Im]=wm(Pm,{forceMount:void 0}),Lm=J(e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=km(Pm,t);return(0,H.jsx)(Fm,{scope:t,forceMount:n,children:(0,H.jsx)(xo,{present:n||a.open,children:(0,H.jsx)(_c,{asChild:!0,container:i,children:r})})})},`MenuPortal`),Rm=`MenuContent`,[zm,Bm]=wm(Rm),Vm=V.forwardRef(J(function(e,t){let n=Im(Rm,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=km(Rm,e.__scopeMenu),o=jm(Rm,e.__scopeMenu);return(0,H.jsx)(xm.Provider,{scope:e.__scopeMenu,children:(0,H.jsx)(xo,{present:r||a.open,children:(0,H.jsx)(xm.Slot,{scope:e.__scopeMenu,children:o.modal?(0,H.jsx)(Hm,{...i,ref:t}):(0,H.jsx)(Um,{...i,ref:t})})})})},`MenuContent`)),Hm=V.forwardRef(J(function(e,t){let n=km(Rm,e.__scopeMenu),r=V.useRef(null),i=U(t,r);return V.useEffect(()=>{let e=r.current;if(e)return Vl(e)},[]),(0,H.jsx)(Gm,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:q(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentModal`)),Um=V.forwardRef(J(function(e,t){let n=km(Rm,e.__scopeMenu);return(0,H.jsx)(Gm,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentNonModal`)),Wm=ua(`MenuContent.ScrollLock`),Gm=V.forwardRef(J(function(e,t){let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,g=km(Rm,n),_=jm(Rm,n),v=Em(n),y=Dm(n),b=Sm(n),[x,S]=V.useState(null),C=V.useRef(null),[w,T]=V.useState(null);ic(w);let{nodes:E,registry:D}=rc(),O=!!(i||m),k=U(t,C,g.onContentChange,T),A=V.useRef(0),j=V.useRef(``),M=V.useRef(0),N=V.useRef(null),P=V.useRef(`right`),F=V.useRef(0),I=V.useMemo(()=>m?[C,...E.map(e=>({current:e}))]:[],[C,E,m]),L=m?Ml:V.Fragment,ee=m?{as:Wm,allowPinchZoom:!0,shards:I}:void 0,te=J(e=>{let t=j.current+e,n=b().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=sh(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;function s(e){j.current=e,window.clearTimeout(A.current),e!==``&&(A.current=window.setTimeout(()=>s(``),1e3))}J(s,`updateSearch`),s(t),o&&setTimeout(()=>o.focus())},`handleTypeaheadSearch`);V.useEffect(()=>()=>window.clearTimeout(A.current),[]),Cc();let ne=V.useCallback(e=>P.current===N.current?.side&&lh(e,N.current?.area),[]);return(0,H.jsx)(zm,{scope:n,searchRef:j,onItemEnter:V.useCallback(e=>{ne(e)&&e.preventDefault()},[ne]),onItemLeave:V.useCallback(e=>{ne(e)||(C.current?.focus(),S(null))},[ne]),onTriggerLeave:V.useCallback(e=>{ne(e)&&e.preventDefault()},[ne]),pointerGraceTimerRef:M,onPointerGraceIntentChange:V.useCallback(e=>{N.current=e},[]),children:(0,H.jsx)(nc,{registry:O?D:null,children:(0,H.jsx)(L,{...ee,children:(0,H.jsx)(ec,{asChild:!0,trapped:i,branches:E,onMountAutoFocus:q(a,e=>{e.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,H.jsx)(Hs,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,H.jsx)(om,{asChild:!0,...y,dir:_.dir,orientation:`vertical`,loop:r,currentTabStopId:x,onCurrentTabStopIdChange:S,onEntryFocus:q(c,e=>{_.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,H.jsx)(jp,{role:`menu`,"aria-orientation":`vertical`,"data-state":nh(g.open),"data-radix-menu-content":``,dir:_.dir,...v,...h,ref:k,style:{outline:`none`,...h.style},onKeyDown:q(h.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&te(e.key));let i=C.current;if(e.target!==i||!ym.includes(e.key))return;e.preventDefault();let a=b().filter(e=>!e.disabled).map(e=>e.ref.current);vm.includes(e.key)&&a.reverse(),ah(a)}),onBlur:q(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(A.current),j.current=``)}),onPointerMove:q(e.onPointerMove,uh(e=>{let t=e.target,n=F.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>F.current?`right`:`left`;P.current=t,F.current=e.clientX}}))})})})})})})})},`MenuContentImpl`)),Km=`MenuItem`,qm=`menu.itemSelect`,Jm=V.forwardRef(J(function(e,t){let{disabled:n=!1,onSelect:r,...i}=e,a=V.useRef(null),o=jm(Km,e.__scopeMenu),s=Bm(Km,e.__scopeMenu),c=U(t,a),l=V.useRef(!1),u=J(()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(qm,{bubbles:!0,cancelable:!0});e.addEventListener(qm,e=>r?.(e),{once:!0}),Oa(e,t),t.defaultPrevented?l.current=!1:o.onClose()}},`handleSelect`);return(0,H.jsx)(Ym,{...i,ref:c,disabled:n,onClick:q(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:q(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:q(e.onKeyDown,e=>{n||e.target!==e.currentTarget||(s.searchRef.current===``||e.key!==` `)&&gm.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),Ym=V.forwardRef(J(function(e,t){let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=Bm(Km,n),s=Dm(n),c=V.useRef(null),l=U(t,c),[u,d]=V.useState(!1),[f,p]=V.useState(``);return V.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,H.jsx)(xm.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,H.jsx)(lm,{asChild:!0,...s,focusable:!r,children:(0,H.jsx)(W.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:q(e.onPointerMove,uh(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:q(e.onPointerLeave,uh(e=>o.onItemLeave(e))),onFocus:q(e.onFocus,()=>d(!0)),onBlur:q(e.onBlur,()=>d(!1))})})})},`MenuItemImpl`)),[Xm,Zm]=wm(`MenuRadioGroup`,{value:void 0,onValueChange:J(()=>{},`onValueChange`)}),[Qm,$m]=wm(`MenuItemIndicator`,{checked:!1}),[eh,th]=wm(`MenuSub`);function nh(e){return e?`open`:`closed`}J(nh,`getOpenState`);function rh(e){return e===`indeterminate`}J(rh,`isIndeterminate`);function ih(e){return rh(e)?`indeterminate`:e?`checked`:`unchecked`}J(ih,`getCheckedState`);function ah(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}J(ah,`focusFirst`);function oh(e,t){return e.map((n,r)=>e[(t+r)%e.length])}J(oh,`wrapArray`);function sh(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=oh(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}J(sh,`getNextMatch`);function ch(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}J(ch,`isPointInPolygon`);function lh(e,t){return t?ch({x:e.clientX,y:e.clientY},t):!1}J(lh,`isPointerInGraceArea`);function uh(e){return t=>t.pointerType===`mouse`?e(t):void 0}J(uh,`whenMouse`);var dh=Object.defineProperty,fh=(e,t)=>dh(e,`name`,{value:t,configurable:!0}),ph=`DropdownMenu`,[mh,hh]=G(ph,[Tm]),gh=Tm(),[_h,vh]=mh(ph),yh=fh(e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=gh(t),l=V.useRef(null),[u,d]=po({prop:i,defaultProp:a??!1,onChange:o,caller:ph});return(0,H.jsx)(_h,{scope:t,triggerId:jo(),triggerRef:l,contentId:jo(),open:u,onOpenChange:d,onOpenToggle:V.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,H.jsx)(Mm,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})},`DropdownMenu`),bh=`DropdownMenuTrigger`,xh=V.forwardRef(fh(function(e,t){let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=vh(bh,n),o=gh(n),s=U(t,a.triggerRef);return(0,H.jsx)(Nm,{asChild:!0,...o,children:(0,H.jsx)(W.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:s,onPointerDown:q(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:q(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})},`DropdownMenuTrigger`)),Sh=fh(e=>{let{__scopeDropdownMenu:t,...n}=e,r=gh(t);return(0,H.jsx)(Lm,{...r,...n})},`DropdownMenuPortal`),Ch=`DropdownMenuContent`,wh=V.forwardRef(fh(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=vh(Ch,n),a=gh(n),o=V.useRef(!1);return(0,H.jsx)(Vm,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:q(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:q(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuContent`)),Th=V.forwardRef(fh(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=gh(n);return(0,H.jsx)(Jm,{...i,...r,ref:t})},`DropdownMenuItem`)),Eh=Object.defineProperty,Dh=V.forwardRef(((e,t)=>Eh(e,`name`,{value:t,configurable:!0}))(function(e,t){return(0,H.jsx)(W.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},`Label`)),Oh=Object.defineProperty,kh=(e,t)=>Oh(e,`name`,{value:t,configurable:!0});function Ah(e,[t,n]){return Math.min(n,Math.max(t,e))}kh(Ah,`clamp`);var jh=Object.defineProperty,Mh=(e,t)=>jh(e,`name`,{value:t,configurable:!0}),Nh=`Popover`,[Ph,Fh]=G(Nh,[Sp]),Ih=Sp(),[Lh,Rh]=Ph(Nh),zh=Mh(e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=Ih(t),c=V.useRef(null),[l,u]=V.useState(!1),[d,f]=V.useState(0),[p,m]=V.useState(0),[h,g]=po({prop:r,defaultProp:i??!1,onChange:a,caller:Nh});return(0,H.jsx)(Tp,{...s,children:(0,H.jsx)(Lh,{scope:t,contentId:jo(),titleId:jo(),descriptionId:jo(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,triggerRef:c,open:h,onOpenChange:g,onOpenToggle:V.useCallback(()=>g(e=>!e),[g]),hasCustomAnchor:l,onCustomAnchorAdd:V.useCallback(()=>u(!0),[]),onCustomAnchorRemove:V.useCallback(()=>u(!1),[]),modal:o,children:n})})},`Popover`),Bh=`PopoverTrigger`,Vh=V.forwardRef(Mh(function(e,t){let{__scopePopover:n,...r}=e,i=Rh(Bh,n),a=Ih(n),o=U(t,i.triggerRef),s=(0,H.jsx)(W.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Qh(i.open),...r,ref:o,onClick:q(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,H.jsx)(Dp,{asChild:!0,...a,children:s})},`PopoverTrigger`)),Hh=`PopoverPortal`,[Uh,Wh]=Ph(Hh,{forceMount:void 0}),Gh=Mh(e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=Rh(Hh,t);return(0,H.jsx)(Uh,{scope:t,forceMount:n,children:(0,H.jsx)(xo,{present:n||a.open,children:(0,H.jsx)(_c,{asChild:!0,container:i,children:r})})})},`PopoverPortal`),Kh=`PopoverContent`,qh=V.forwardRef(Mh(function(e,t){let n=Wh(Kh,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=Rh(Kh,e.__scopePopover);return(0,H.jsx)(xo,{present:r||a.open,children:a.modal?(0,H.jsx)(Yh,{...i,ref:t}):(0,H.jsx)(Xh,{...i,ref:t})})},`PopoverContent`)),Jh=ua(`PopoverContent.RemoveScroll`),Yh=V.forwardRef(Mh(function(e,t){let n=Rh(Kh,e.__scopePopover),r=V.useRef(null),i=U(t,r),a=V.useRef(!1),{nodes:o,registry:s}=rc();return V.useEffect(()=>{let e=r.current;if(e)return Vl(e)},[]),(0,H.jsx)(Ml,{as:Jh,allowPinchZoom:!0,shards:V.useMemo(()=>[r,...o.map(e=>({current:e}))],[r,o]),children:(0,H.jsx)(Zh,{...e,ref:i,branchNodes:o,branchRegistry:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:q(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:q(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:q(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),Xh=V.forwardRef(Mh(function(e,t){let n=Rh(Kh,e.__scopePopover),r=V.useRef(!1),i=V.useRef(!1);return(0,H.jsx)(Zh,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`PopoverContentNonModal`)),Zh=V.forwardRef(Mh(function(e,t){let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,"aria-describedby":d,branchNodes:f,branchRegistry:p,...m}=e,h=Rh(Kh,n),g=Ih(n),[_,v]=V.useState(null),y=U(t,v);return ic(_),Cc(),(0,H.jsx)(nc,{registry:p,children:(0,H.jsx)(ec,{asChild:!0,loop:!0,trapped:r,branches:f,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,H.jsx)(Hs,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>h.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,H.jsx)(jp,{"data-state":Qh(h.open),role:`dialog`,id:h.contentId,"aria-labelledby":h.titlePresent?h.titleId:void 0,"aria-describedby":h.descriptionPresent?$h(d,h.descriptionId):d,...g,...m,ref:y,style:{...m.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})})},`PopoverContentImpl`));function Qh(e){return e?`open`:`closed`}Mh(Qh,`getState`);function $h(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}Mh($h,`concatAriaDescribedby`);var eg=Object.defineProperty,tg=(e,t)=>eg(e,`name`,{value:t,configurable:!0}),ng=`Progress`,rg=100,[ig,ag]=G(ng),[og,sg]=ig(ng),cg=V.forwardRef(tg(function(e,t){let{__scopeProgress:n,value:r=null,max:i,getValueLabel:a=dg,...o}=e;(i||i===0)&&!mg(i)&&console.error(gg(`${i}`,`Progress`));let s=mg(i)?i:rg;r!==null&&!hg(r,s)&&console.error(_g(`${r}`,`Progress`));let c=hg(r,s)?r:null,l=pg(c)?a(c,s):void 0;return(0,H.jsx)(og,{scope:n,value:c,max:s,children:(0,H.jsx)(W.div,{"aria-valuemax":s,"aria-valuemin":0,"aria-valuenow":pg(c)?c:void 0,"aria-valuetext":l,role:`progressbar`,"data-state":fg(c,s),"data-value":c??void 0,"data-max":s,...o,ref:t})})},`Progress`)),lg=`ProgressIndicator`,ug=V.forwardRef(tg(function(e,t){let{__scopeProgress:n,...r}=e,i=sg(lg,n);return(0,H.jsx)(W.div,{"data-state":fg(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...r,ref:t})},`ProgressIndicator`));function dg(e,t){return`${Math.round(e/t*100)}%`}tg(dg,`defaultGetValueLabel`);function fg(e,t){return e==null?`indeterminate`:e===t?`complete`:`loading`}tg(fg,`getProgressState`);function pg(e){return typeof e==`number`}tg(pg,`isNumber`);function mg(e){return pg(e)&&!isNaN(e)&&e>0}tg(mg,`isValidMaxNumber`);function hg(e,t){return pg(e)&&!isNaN(e)&&e<=t&&e>=0}tg(hg,`isValidValueNumber`);function gg(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${rg}\`.`}tg(gg,`getInvalidMaxError`);function _g(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
171
+ - a positive number
172
+ - less than the value passed to \`max\` (or ${rg} if no \`max\` prop is set)
173
+ - \`null\` or \`undefined\` if the progress is indeterminate.
174
+
175
+ Defaulting to \`null\`.`}tg(_g,`getInvalidValueError`);var vg=Object.defineProperty,yg=(e,t)=>vg(e,`name`,{value:t,configurable:!0}),bg=`Radio`,[xg,Sg]=G(bg),[Cg,wg]=xg(bg);function Tg(e){let{__scopeRadio:t,checked:n=!1,children:r,disabled:i,form:a,name:o,onCheck:s,required:c,value:l=`on`,internal_do_not_use_render:u}=e,[d,f]=V.useState(null),[p,m]=V.useState(null),[h,g]=V.useState(null),_={checked:n,disabled:i,required:c,name:o,form:a,value:l,control:d,setControl:f,userClick:h,onUserClick:g,isFormControl:!d||!!a||!!d.closest(`form`),bubbleInput:p,setBubbleInput:m,onCheck:yg(()=>s?.(),`onCheck`)};return(0,H.jsx)(Cg,{scope:t,..._,children:Mg(u)?u(_):r})}yg(Tg,`RadioProvider`);var Eg=`RadioTrigger`,Dg=V.forwardRef(yg(function({__scopeRadio:e,onClick:t,...n},r){let{checked:i,disabled:a,value:o,setControl:s,onCheck:c,onUserClick:l,isFormControl:u,bubbleInput:d}=wg(Eg,e),f=U(r,s);return(0,H.jsx)(W.button,{type:`button`,role:`radio`,"aria-checked":i,"data-state":Ng(i),"data-disabled":a?``:void 0,disabled:a,value:o,...n,ref:f,onClick:q(t,e=>{let t=e.isPropagationStopped();i||(l({hasConsumerStoppedPropagation:t}),c()),d&&u&&(t||e.stopPropagation())})})},`RadioTrigger`)),Og=`RadioIndicator`,kg=V.forwardRef(yg(function(e,t){let{__scopeRadio:n,forceMount:r,...i}=e,a=wg(Og,n);return(0,H.jsx)(xo,{present:r||a.checked,children:(0,H.jsx)(W.span,{"data-state":Ng(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t})})},`RadioIndicator`)),Ag=`RadioBubbleInput`,jg=V.forwardRef(yg(function({__scopeRadio:e,onClick:t,...n},r){let{control:i,checked:a,required:o,disabled:s,name:c,value:l,form:u,bubbleInput:d,setBubbleInput:f,userClick:p}=wg(Ag,e),m=U(r,f),h=Lu(i),g=V.useRef(!1),_=V.useRef(a),v=V.useRef(p),y=V.useRef(null);V.useEffect(()=>{let e=d;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set;if(!n)return;let r=_.current!==a;_.current=a;let i=p!==null&&p!==v.current;if(v.current=p,i)y.current=r?null:p,r&&n.call(e,a),e.dispatchEvent(new Event(`click`,{bubbles:!p.hasConsumerStoppedPropagation}));else if(r){let t=y.current;y.current=null;let r=a&&t!==null;g.current=!0,n.call(e,a),e.dispatchEvent(new Event(`click`,{bubbles:!(r&&t.hasConsumerStoppedPropagation)})),g.current=!1}},[d,a,p]);let b=V.useRef(a);return(0,H.jsx)(W.input,{type:`radio`,"aria-hidden":!0,defaultChecked:b.current,required:o,disabled:s,name:c,value:l,form:u,...n,tabIndex:-1,ref:m,onClick:q(t,e=>{g.current&&e.stopPropagation()}),style:{...n.style,...h,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`RadioBubbleInput`));function Mg(e){return typeof e==`function`}yg(Mg,`isFunction`);function Ng(e){return e?`checked`:`unchecked`}yg(Ng,`getState`);var Pg=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],Fg=`RadioGroup`,[Ig,Lg]=G(Fg,[tm,Sg]),Rg=tm(),zg=Sg(),[Bg,Vg]=Ig(Fg),Hg=V.forwardRef(yg(function(e,t){let{__scopeRadioGroup:n,name:r,form:i,defaultValue:a,value:o,required:s=!1,disabled:c=!1,orientation:l,dir:u,loop:d=!0,onValueChange:f,...p}=e,m=Rg(n),h=Xo(u),[g,_]=po({prop:o,defaultProp:a??null,onChange:f,caller:Fg}),[v,y]=V.useState(null),b=U(t,y),x=V.useRef(g);return V.useEffect(()=>{let e=i?v?.ownerDocument.getElementById(i):v?.closest(`form`);if(e instanceof HTMLFormElement){let t=yg(()=>_(x.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[v,i,_]),(0,H.jsx)(Bg,{scope:n,name:r,form:i,required:s,disabled:c,value:g,onValueChange:_,children:(0,H.jsx)(om,{asChild:!0,...m,orientation:l,dir:h,loop:d,children:(0,H.jsx)(W.div,{role:`radiogroup`,"aria-required":s,"aria-orientation":l,"data-disabled":c?``:void 0,dir:h,...p,ref:b})})})},`RadioGroup`)),Ug=`RadioGroupItemProvider`,Wg=`RadioGroupItemTrigger`;function Gg(e){let{__scopeRadioGroup:t,value:n,disabled:r,children:i,internal_do_not_use_render:a}=e,o=Vg(Ug,t),s=zg(t),c=o.disabled||r;return(0,H.jsx)(Tg,{...s,checked:o.value===n,disabled:c,required:o.required,name:o.name,form:o.form,value:n,onCheck:()=>o.onValueChange(n),internal_do_not_use_render:a,children:i})}yg(Gg,`RadioGroupItemProvider`);var Kg=V.forwardRef(yg(function(e,t){let{__scopeRadioGroup:n,...r}=e,i=Rg(n),a=zg(n),{checked:o,disabled:s}=wg(Wg,a.__scopeRadio),c=V.useRef(null),l=U(t,c),u=V.useRef(!1);return V.useEffect(()=>{let e=yg(e=>{Pg.includes(e.key)&&(u.current=!0)},`handleKeyDown`),t=yg(()=>u.current=!1,`handleKeyUp`);return document.addEventListener(`keydown`,e),document.addEventListener(`keyup`,t),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`keyup`,t)}},[]),(0,H.jsx)(lm,{asChild:!0,...i,focusable:!s,active:o,children:(0,H.jsx)(Dg,{...a,...r,ref:l,onKeyDown:q(r.onKeyDown,e=>{e.key===`Enter`&&e.preventDefault()}),onFocus:q(r.onFocus,()=>{u.current&&c.current?.click()})})})},`RadioGroupItemTrigger`)),qg=V.forwardRef(yg(function(e,t){let{__scopeRadioGroup:n,value:r,disabled:i,...a}=e;return(0,H.jsx)(Gg,{__scopeRadioGroup:n,value:r,disabled:i,internal_do_not_use_render:({isFormControl:e})=>(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Kg,{...a,ref:t,__scopeRadioGroup:n}),e&&(0,H.jsx)(Jg,{__scopeRadioGroup:n})]})})},`RadioGroupItem`)),Jg=V.forwardRef(yg(function(e,t){let{__scopeRadioGroup:n,...r}=e,i=zg(n);return(0,H.jsx)(jg,{...i,...r,ref:t})},`RadioGroupItemBubbleInput`)),Yg=V.forwardRef(yg(function(e,t){let{__scopeRadioGroup:n,...r}=e,i=zg(n);return(0,H.jsx)(kg,{...i,...r,ref:t})},`RadioGroupIndicator`)),Xg=Object.defineProperty,Y=(e,t)=>Xg(e,`name`,{value:t,configurable:!0}),Zg={ItemAligned:`item-aligned`,Popper:`popper`},Qg={LTR:`ltr`,RTL:`rtl`},$g=[` `,`Enter`,`ArrowUp`,`ArrowDown`],e_=[` `,`Enter`],t_=`Select`,[n_,r_,i_]=za(t_),[a_,o_]=G(t_,[i_,Sp]),s_=Sp(),[c_,l_]=a_(t_),[u_,d_]=a_(t_);function f_(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:m,internal_do_not_use_render:h}=e,g=s_(t),[_,v]=V.useState(null),[y,b]=V.useState(null),[x,S]=V.useState(!1),C=Xo(l),[w,T]=po({prop:r,defaultProp:i??!1,onChange:a,caller:t_}),[E,D]=po({prop:o,defaultProp:s,onChange:c,caller:t_}),O=V.useRef(null),k=V.useRef(!1),[A,j]=V.useState(null),M=Y(e=>{j({value:e,hasConsumerStoppedPropagation:k.current}),D(e)},`handleUserSelect`),N=V.useRef(E);V.useEffect(()=>{let e=m?_?.ownerDocument.getElementById(m):_?.form;if(e instanceof HTMLFormElement){let t=Y(()=>D(N.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[m,_,D]);let P=!_||!!m||!!_.closest(`form`),[F,I]=V.useState(new Set),L=jo(),ee=Array.from(F).map(e=>e.props.value).join(`;`),te=V.useCallback(e=>{I(t=>new Set(t).add(e))},[]),ne=V.useCallback(e=>{I(t=>{let n=new Set(t);return n.delete(e),n})},[]),R={required:p,trigger:_,onTriggerChange:v,valueNode:y,onValueNodeChange:b,valueNodeHasChildren:x,onValueNodeHasChildrenChange:S,contentId:L,value:E,onValueChange:D,hasConsumerStoppedPropagationRef:k,userSelection:A,onUserSelect:M,open:w,onOpenChange:T,dir:C,triggerPointerDownPosRef:O,disabled:f,name:u,autoComplete:d,form:m,nativeOptions:F,nativeSelectKey:ee,isFormControl:P};return(0,H.jsx)(Tp,{...g,children:(0,H.jsx)(c_,{scope:t,...R,children:(0,H.jsx)(n_.Provider,{scope:t,children:(0,H.jsx)(u_,{scope:t,onNativeOptionAdd:te,onNativeOptionRemove:ne,children:$_(h)?h(R):n})})})})}Y(f_,`SelectProvider`);var p_=Y(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,H.jsx)(f_,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,H.jsxs)(H.Fragment,{children:[n,e?(0,H.jsx)(Q_,{__scopeSelect:t}):null]})})},`Select`),m_=`SelectTrigger`,h_=V.forwardRef(Y(function(e,t){let{__scopeSelect:n,disabled:r=!1,...i}=e,a=s_(n),o=l_(m_,n),s=o.disabled||r,c=U(t,o.onTriggerChange),l=r_(n),u=V.useRef(`touch`),[d,f,p]=tv(e=>{let t=l().filter(e=>!e.disabled),n=nv(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onUserSelect(n.value)}),m=Y(e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},`handleOpen`);return(0,H.jsx)(Dp,{asChild:!0,...a,children:(0,H.jsx)(W.button,{type:`button`,role:`combobox`,"aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":ev(o.value)?``:void 0,...i,ref:c,onClick:q(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:q(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(m(e),e.preventDefault())}),onKeyDown:q(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&(o.hasConsumerStoppedPropagationRef.current=e.isPropagationStopped(),f(e.key)),t&&e.key===` `||$g.includes(e.key)&&(m(),e.preventDefault())})})})},`SelectTrigger`)),g_=`SelectValue`,__=V.forwardRef(Y(function(e,t){let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=l_(g_,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=U(t,c.onValueNodeChange);K(()=>{l(u)},[l,u]);let f=ev(c.value);return(0,H.jsx)(W.span,{...s,asChild:!f&&s.asChild,ref:d,style:{pointerEvents:`none`},children:(0,H.jsx)(V.Fragment,{children:f?o:a},f?`placeholder`:`value`)})},`SelectValue`)),v_=V.forwardRef(Y(function(e,t){let{__scopeSelect:n,children:r,...i}=e;return(0,H.jsx)(W.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})},`SelectIcon`)),[y_,b_]=a_(`SelectPortal`,{forceMount:void 0}),x_=Y(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,H.jsx)(y_,{scope:e.__scopeSelect,forceMount:n,children:(0,H.jsx)(_c,{asChild:!0,...r})})},`SelectPortal`),S_=`SelectContent`,C_=V.forwardRef(Y(function(e,t){let n=b_(S_,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=l_(S_,e.__scopeSelect),[o,s]=V.useState();return K(()=>{s(new DocumentFragment)},[]),(0,H.jsx)(xo,{present:r||a.open,children:({present:e})=>e?(0,H.jsx)(k_,{...i,ref:t}):(0,H.jsx)(w_,{...i,fragment:o})})},`SelectContent`)),w_=V.forwardRef(Y(function(e,t){let{__scopeSelect:n,children:r,fragment:i}=e;return i?sa.createPortal((0,H.jsx)(E_,{scope:n,children:(0,H.jsx)(n_.Slot,{scope:n,children:(0,H.jsx)(`div`,{ref:t,children:r})})}),i):null},`SelectContentFragment`)),T_=10,[E_,D_]=a_(S_),O_=ua(`SelectContent.RemoveScroll`),k_=V.forwardRef(Y(function(e,t){let{__scopeSelect:n}=e,{position:r=Zg.ItemAligned,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g,..._}=e,v=l_(S_,n),[y,b]=V.useState(null),[x,S]=V.useState(null),C=U(t,b),[w,T]=V.useState(null),[E,D]=V.useState(null),O=r_(n),[k,A]=V.useState(!1),j=V.useRef(!1),M=V.useRef(!1),N=V.useRef(!1);V.useEffect(()=>{if(y)return Vl(y)},[y]),Cc();let P=V.useCallback(e=>{let[t,...n]=O().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&x&&(x.scrollTop=0),n===r&&x&&(x.scrollTop=x.scrollHeight),n?.focus(),document.activeElement!==i))return},[O,x]),F=V.useCallback(()=>P([w,y]),[P,w,y]);V.useEffect(()=>{k&&F()},[k,F]);let{onOpenChange:I,triggerPointerDownPosRef:L}=v;V.useEffect(()=>{if(y){let e={x:0,y:0},t=Y(t=>{e={x:Math.abs(Math.round(t.pageX)-(L.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(L.current?.y??0))}},`handlePointerMove`),n=Y(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(y)||I(!1),document.removeEventListener(`pointermove`,t),L.current=null},`handlePointerUp`);return L.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[y,I,L]),V.useEffect(()=>{let e=Y(()=>I(!1),`close`);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[I]);let[ee,te]=tv(e=>{let t=O().filter(e=>!e.disabled),n=nv(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),ne=V.useCallback((e,t,n)=>{let r=!M.current;r&&(M.current=!0);let i=!j.current&&!n;v.value!==void 0&&v.value===t||i?(T(e),i&&(j.current=!0)):r&&T(e)},[v.value]),R=V.useCallback(()=>y?.focus(),[y]),re=V.useCallback((e,t,n)=>{if(!e)return;let r=!N.current;r&&(N.current=!0);let i=!j.current&&!n;(v.value!==void 0&&v.value===t||i||r)&&D(e)},[v.value]),z=r===Zg.Popper?j_:A_,ie=z===j_?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,H.jsx)(E_,{scope:n,content:y,viewport:x,onViewportChange:S,itemRefCallback:ne,selectedItem:w,onItemLeave:R,itemTextRefCallback:re,focusSelectedItem:F,selectedItemText:E,position:r,isPositioned:k,searchRef:ee,children:(0,H.jsx)(Ml,{as:O_,allowPinchZoom:!0,children:(0,H.jsx)(ec,{asChild:!0,trapped:v.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:q(i,e=>{v.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,H.jsx)(Hs,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:(0,H.jsx)(z,{role:`listbox`,id:v.contentId,"data-state":v.open?`open`:`closed`,dir:v.dir,onContextMenu:e=>e.preventDefault(),..._,...ie,onPlaced:()=>A(!0),ref:C,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:q(_.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&te(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=O().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>P(t)),e.preventDefault()}})})})})})})},`SelectContentImpl`)),A_=V.forwardRef(Y(function(e,t){let{__scopeSelect:n,onPlaced:r,...i}=e,a=l_(S_,n),o=D_(S_,n),[s,c]=V.useState(null),[l,u]=V.useState(null),d=U(t,u),f=r_(n),p=V.useRef(!1),m=V.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:_,focusSelectedItem:v}=o,y=V.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&g&&_){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=_.getBoundingClientRect();if(a.dir!==Qg.RTL){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-T_,d=Ah(a,[T_,Math.max(T_,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-T_,d=Ah(a,[T_,Math.max(T_,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-T_*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),v=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+v+u+b+y,S=Math.min(g.offsetHeight*5,x),C=window.getComputedStyle(h),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-T_,D=c-E,O=g.offsetHeight/2,k=g.offsetTop+O,A=m+v+k,j=x-A;if(A<=E){let e=o.length>0&&g===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-h.offsetTop-h.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&g===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+h.offsetTop+(e?w:0)+O)+j;s.style.height=t+`px`,h.scrollTop=A-E+h.offsetTop}s.style.margin=`${T_}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,h,g,_,a.dir,r]);K(()=>y(),[y]);let[b,x]=V.useState();K(()=>{l&&x(window.getComputedStyle(l).zIndex)},[l]);let S=V.useCallback(e=>{e&&m.current===!0&&(y(),v?.(),m.current=!1)},[y,v]);return(0,H.jsx)(M_,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:S,children:(0,H.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:b},children:(0,H.jsx)(W.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})},`SelectItemAlignedPosition`)),j_=V.forwardRef(Y(function(e,t){let{__scopeSelect:n,align:r=`start`,collisionPadding:i=T_,...a}=e,o=s_(n);return(0,H.jsx)(jp,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})},`SelectPopperPosition`)),[M_,N_]=a_(S_,{}),P_=`SelectViewport`,F_=V.forwardRef(Y(function(e,t){let{__scopeSelect:n,nonce:r,...i}=e,a=D_(P_,n),o=N_(P_,n),s=U(t,a.onViewportChange),c=V.useRef(0);return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,H.jsx)(n_.Slot,{scope:n,children:(0,H.jsx)(W.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:q(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-T_*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})},`SelectViewport`)),[I_,L_]=a_(`SelectGroup`),R_=`SelectItem`,[z_,B_]=a_(R_),V_=V.forwardRef(Y(function(e,t){let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=l_(R_,n),c=D_(R_,n),l=s.value===r,[u,d]=V.useState(a??``),[f,p]=V.useState(!1),m=U(t,Ps(e=>c.itemRefCallback?.(e,r,i))),h=jo(),g=V.useRef(`touch`);function _(e){s.hasConsumerStoppedPropagationRef.current=e.isPropagationStopped(),s.onUserSelect(r),s.onOpenChange(!1)}return Y(_,`handleSelect`),(0,H.jsx)(z_,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:V.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,H.jsx)(n_.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,H.jsx)(W.div,{role:`option`,"aria-labelledby":h,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:m,onFocus:q(o.onFocus,()=>p(!0)),onBlur:q(o.onBlur,()=>p(!1)),onClick:q(o.onClick,e=>{i||g.current!==`mouse`&&_(e)}),onPointerUp:q(o.onPointerUp,e=>{i||g.current===`mouse`&&_(e)}),onPointerDown:q(o.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:q(o.onPointerMove,e=>{g.current=e.pointerType,i?c.onItemLeave?.():g.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:q(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:q(o.onKeyDown,e=>{i||e.target!==e.currentTarget||(c.searchRef?.current===``||e.key!==` `)&&(e_.includes(e.key)&&_(e),e.key===` `&&e.preventDefault())})})})})},`SelectItem`)),H_=`SelectItemText`,U_=V.forwardRef(Y(function(e,t){let{__scopeSelect:n,className:r,style:i,...a}=e,o=l_(H_,n),s=D_(H_,n),c=B_(H_,n),l=d_(H_,n),[u,d]=V.useState(null),f=Ps(e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=U(t,d,c.onItemTextChange,f),m=u?.textContent,h=V.useMemo(()=>(0,H.jsx)(`option`,{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:_}=l;return K(()=>(g(h),()=>_(h)),[g,_,h]),(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(W.span,{id:c.textId,...a,ref:p}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!ev(o.value)?sa.createPortal(a.children,o.valueNode):null]})},`SelectItemText`)),W_=`SelectItemIndicator`,G_=V.forwardRef(Y(function(e,t){let{__scopeSelect:n,...r}=e;return B_(W_,n).isSelected?(0,H.jsx)(W.span,{"aria-hidden":!0,...r,ref:t}):null},`SelectItemIndicator`)),K_=`SelectScrollUpButton`,q_=V.forwardRef(Y(function(e,t){let n=D_(K_,e.__scopeSelect),r=N_(K_,e.__scopeSelect),[i,a]=V.useState(!1),o=U(t,r.onScrollButtonChange);return K(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollTop>0;a(e)};Y(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,H.jsx)(X_,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null},`SelectScrollUpButton`)),J_=`SelectScrollDownButton`,Y_=V.forwardRef(Y(function(e,t){let n=D_(J_,e.__scopeSelect),r=N_(J_,e.__scopeSelect),[i,a]=V.useState(!1),o=U(t,r.onScrollButtonChange);return K(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;a(n)};Y(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,H.jsx)(X_,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null},`SelectScrollDownButton`)),X_=V.forwardRef(Y(function(e,t){let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=D_(`SelectScrollButton`,n),o=V.useRef(null),s=r_(n),c=V.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return V.useEffect(()=>()=>c(),[c]),K(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,H.jsx)(W.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:q(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:q(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:q(i.onPointerLeave,()=>{c()})})},`SelectScrollButtonImpl`)),Z_=`SelectBubbleInput`,Q_=V.forwardRef(Y(function({__scopeSelect:e,...t},n){let r=l_(Z_,e),{value:i,onValueChange:a,required:o,disabled:s,name:c,autoComplete:l,form:u,userSelection:d}=r,{nativeOptions:f,nativeSelectKey:p}=r,m=V.useRef(null),h=U(n,m),g=i??``,_=V.useRef(g),v=V.useRef(d),y=V.useRef(!1),b=Array.from(f).some(e=>(e.props.value??``)===``);return V.useEffect(()=>{let e=m.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set,r=d!==null&&d!==v.current;v.current=d;let i=_.current!==g;_.current=g;let a=r&&i;if(r&&!i&&d.value!==g&&!d.hasConsumerStoppedPropagation&&n){y.current=!0;try{n.call(e,d.value),e.dispatchEvent(new Event(`change`,{bubbles:!0}))}finally{y.current=!1,n.call(e,g)}return}let o=a&&!d.hasConsumerStoppedPropagation;if(i&&n){let t=new Event(`change`,{bubbles:o});n.call(e,g),e.dispatchEvent(t)}},[g,d]),(0,H.jsxs)(W.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:l,disabled:s,form:u,onChange:e=>{y.current||a(e.target.value)},...t,style:{...ja,...t.style},ref:h,defaultValue:g,children:[ev(i)&&!b?(0,H.jsx)(`option`,{value:``}):null,Array.from(f)]},p)},`SelectBubbleInput`));function $_(e){return typeof e==`function`}Y($_,`isFunction`);function ev(e){return e===``||e===void 0}Y(ev,`shouldShowPlaceholder`);function tv(e){let t=Ps(e),n=V.useRef(``),r=V.useRef(0),i=V.useCallback(e=>{let i=n.current+e;t(i);function a(e){n.current=e,window.clearTimeout(r.current),e!==``&&(r.current=window.setTimeout(()=>a(``),1e3))}Y(a,`updateSearch`),a(i)},[t]),a=V.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return V.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}Y(tv,`useTypeaheadSearch`);function nv(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=rv(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}Y(nv,`findNextItem`);function rv(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Y(rv,`wrapArray`);var iv=Object.defineProperty,av=(e,t)=>iv(e,`name`,{value:t,configurable:!0}),ov={Horizontal:`horizontal`,Vertical:`vertical`},sv=ov.Horizontal,cv=Object.values(ov),lv=V.forwardRef(av(function(e,t){let{decorative:n,orientation:r=sv,...i}=e,a=uv(r)?r:sv,o=a===ov.Vertical?a:void 0,s=n?{role:`none`}:{"aria-orientation":o,role:`separator`};return(0,H.jsx)(W.div,{"data-orientation":a,...s,...i,ref:t})},`Separator`));function uv(e){return cv.includes(e)}av(uv,`isValidOrientation`);var dv=Object.defineProperty,X=(e,t)=>dv(e,`name`,{value:t,configurable:!0}),fv={Vertical:`vertical`,Horizontal:`horizontal`},pv={LTR:`ltr`,RTL:`rtl`},mv=[`PageUp`,`PageDown`],hv=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],gv={"from-left":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-right":[`Home`,`PageDown`,`ArrowDown`,`ArrowRight`],"from-bottom":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-top":[`Home`,`PageDown`,`ArrowUp`,`ArrowLeft`]},_v=`Slider`,[vv,yv,bv]=za(_v),[xv,Sv]=G(_v,[bv]),[Cv,wv]=xv(_v),Tv=V.forwardRef(X(function(e,t){let{name:n,min:r=0,max:i=100,step:a=1,orientation:o=fv.Horizontal,disabled:s=!1,minStepsBetweenThumbs:c=0,preserveThumbOrder:l=!1,defaultValue:u=[r],value:d,onValueChange:f=X(()=>{},`onValueChange`),onValueCommit:p=X(()=>{},`onValueCommit`),inverted:m=!1,form:h,...g}=e,_=V.useRef(new Set),v=V.useRef(0),y=V.useRef(!1),[b,x]=V.useState(null),S=o===fv.Horizontal?Ov:kv,[C,w]=V.useState(null),T=U(t,w),[E=[],D]=po({prop:d,defaultProp:u,onChange:X(e=>{[..._.current][v.current]?.focus({preventScroll:!0,focusVisible:y.current}),y.current=!1,f(e)},`onChange`)}),O=V.useRef(E),k=V.useRef(E);V.useEffect(()=>{let e=h?C?.ownerDocument.getElementById(h):C?.closest(`form`);if(e instanceof HTMLFormElement){let t=X(()=>D(k.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[C,h,D]);function A(e){N(e,qv(E,e))}X(A,`handleSlideStart`);function j(e){N(e,v.current)}X(j,`handleSlideMove`);function M(){String(E)!==String(O.current)&&p(E)}X(M,`handleSlideEnd`);function N(e,t,{commit:n}={commit:!1}){let o=Qv(a),s=Ah($v(Math.round((e-r)/a)*a+r,o),[r,i]),u=c*a;function d(e){let n=l?Ah(s,[e[t-1]===void 0?r:e[t-1]+u,e[t+1]===void 0?i:e[t+1]-u]):s,a=Wv(e,n,t);return Xv(a,u)?{nextValues:a,changedIndex:l?t:a.indexOf(n),hasChanged:String(a)!==String(e)}:null}X(d,`getNextValues`);let f=d(E);f?.hasChanged&&x(f.nextValues),D((e=[])=>{let t=d(e);return t?(v.current=t.changedIndex,t.hasChanged&&n&&p(t.nextValues),t.hasChanged?t.nextValues:e):e})}return X(N,`updateValues`),(0,H.jsx)(Cv,{scope:e.__scopeSlider,name:n,disabled:s,min:r,max:i,valueIndexToChangeRef:v,thumbs:_.current,values:E,orientation:o,form:h,userRequestedValues:b,children:(0,H.jsx)(vv.Provider,{scope:e.__scopeSlider,children:(0,H.jsx)(vv.Slot,{scope:e.__scopeSlider,children:(0,H.jsx)(S,{"aria-disabled":s,"data-disabled":s?``:void 0,...g,ref:T,onPointerDown:q(g.onPointerDown,()=>{s||(O.current=E,y.current=!1)}),min:r,max:i,inverted:m,onSlideStart:s?void 0:A,onSlideMove:s?void 0:j,onSlideEnd:s?void 0:M,onHomeKeyDown:()=>{s||(y.current=!0,N(r,0,{commit:!0}))},onEndKeyDown:()=>{s||(y.current=!0,N(i,E.length-1,{commit:!0}))},onStepKeyDown:({event:e,direction:t})=>{if(!s){y.current=!0;let n=mv.includes(e.key)||e.shiftKey&&hv.includes(e.key)?10:1,i=v.current,o=E[i];N(ey(o,{min:r,step:a,direction:t,multiplier:n}),i,{commit:!0})}}})})})})},`Slider`)),[Ev,Dv]=xv(_v,{startEdge:`left`,endEdge:`right`,size:`width`,direction:1}),Ov=V.forwardRef(X(function(e,t){let{min:n,max:r,dir:i,inverted:a,onSlideStart:o,onSlideMove:s,onSlideEnd:c,onStepKeyDown:l,...u}=e,[d,f]=V.useState(null),p=U(t,f),m=V.useRef(void 0),h=Xo(i),g=h===pv.LTR,_=g&&!a||!g&&a;function v(e){let t=m.current||d.getBoundingClientRect(),i=Zv([0,t.width],_?[n,r]:[r,n]);return m.current=t,i(e-t.left)}return X(v,`getValueFromPointer`),(0,H.jsx)(Ev,{scope:e.__scopeSlider,startEdge:_?`left`:`right`,endEdge:_?`right`:`left`,direction:_?1:-1,size:`width`,children:(0,H.jsx)(Av,{dir:h,"data-orientation":`horizontal`,...u,ref:p,style:{...u.style,"--radix-slider-thumb-transform":`translateX(-50%)`},onSlideStart:e=>{let t=v(e.clientX);o?.(t)},onSlideMove:e=>{let t=v(e.clientX);s?.(t)},onSlideEnd:()=>{m.current=void 0,c?.()},onStepKeyDown:e=>{let t=gv[_?`from-left`:`from-right`].includes(e.key);l?.({event:e,direction:t?-1:1})}})})},`SliderHorizontal`)),kv=V.forwardRef(X(function(e,t){let{min:n,max:r,inverted:i,onSlideStart:a,onSlideMove:o,onSlideEnd:s,onStepKeyDown:c,...l}=e,u=V.useRef(null),d=U(t,u),f=V.useRef(void 0),p=!i;function m(e){let t=f.current||u.current.getBoundingClientRect(),i=Zv([0,t.height],p?[r,n]:[n,r]);return f.current=t,i(e-t.top)}return X(m,`getValueFromPointer`),(0,H.jsx)(Ev,{scope:e.__scopeSlider,startEdge:p?`bottom`:`top`,endEdge:p?`top`:`bottom`,size:`height`,direction:p?1:-1,children:(0,H.jsx)(Av,{"data-orientation":`vertical`,...l,ref:d,style:{...l.style,"--radix-slider-thumb-transform":`translateY(50%)`},onSlideStart:e=>{let t=m(e.clientY);a?.(t)},onSlideMove:e=>{let t=m(e.clientY);o?.(t)},onSlideEnd:()=>{f.current=void 0,s?.()},onStepKeyDown:e=>{let t=gv[p?`from-bottom`:`from-top`].includes(e.key);c?.({event:e,direction:t?-1:1})}})})},`SliderVertical`)),Av=V.forwardRef(X(function(e,t){let{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:a,onHomeKeyDown:o,onEndKeyDown:s,onStepKeyDown:c,...l}=e,u=wv(_v,n);return(0,H.jsx)(W.span,{...l,ref:t,onKeyDown:q(e.onKeyDown,e=>{e.key===`Home`?(o(e),e.preventDefault()):e.key===`End`?(s(e),e.preventDefault()):mv.concat(hv).includes(e.key)&&(c(e),e.preventDefault())}),onPointerDown:q(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),u.thumbs.has(t)?t.focus({preventScroll:!0,focusVisible:!1}):r(e)}),onPointerMove:q(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&i(e)}),onPointerUp:q(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),a(e))})})},`SliderImpl`)),jv=`SliderTrack`,Mv=V.forwardRef(X(function(e,t){let{__scopeSlider:n,...r}=e,i=wv(jv,n);return(0,H.jsx)(W.span,{"data-disabled":i.disabled?``:void 0,"data-orientation":i.orientation,...r,ref:t})},`SliderTrack`)),Nv=`SliderRange`,Pv=V.forwardRef(X(function(e,t){let{__scopeSlider:n,...r}=e,i=wv(Nv,n),a=Dv(Nv,n),o=U(t,V.useRef(null)),s=i.values.length,c=i.values.map(e=>Gv(e,i.min,i.max)),l=s>1?Math.min(...c):0,u=100-Math.max(...c);return(0,H.jsx)(W.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?``:void 0,...r,ref:o,style:{...e.style,[a.startEdge]:l+`%`,[a.endEdge]:u+`%`}})},`SliderRange`)),[Fv,Iv]=xv(`SliderThumb`),Lv=`SliderThumbProvider`;function Rv(e){let{__scopeSlider:t,name:n,children:r,internal_do_not_use_render:i}=e,a=wv(Lv,t),o=yv(t),[s,c]=V.useState(null),l=V.useMemo(()=>s?o().findIndex(e=>e.ref.current===s):-1,[o,s]),u=Lu(s),d=!s||!!a.form||!!s.closest(`form`),f=a.values[l],p=n??(a.name?a.name+(a.values.length>1?`[]`:``):void 0),m=f===void 0?0:Gv(f,a.min,a.max);V.useEffect(()=>{if(s)return a.thumbs.add(s),()=>{a.thumbs.delete(s)}},[s,a.thumbs]);let h={value:f,name:p,form:a.form,isFormControl:d,index:l,thumb:s,onThumbChange:c,percent:m,size:u};return(0,H.jsx)(Fv,{scope:t,...h,children:ty(i)?i(h):r})}X(Rv,`SliderThumbProvider`);var zv=`SliderThumbTrigger`,Bv=V.forwardRef(X(function(e,t){let{__scopeSlider:n,...r}=e,i=wv(zv,n),a=Dv(zv,n),{index:o,value:s,percent:c,size:l,onThumbChange:u}=Iv(zv,n),d=U(t,u),f=Kv(o,i.values.length),p=l?.[a.size],m=p?Jv(p,c,a.direction):0;return(0,H.jsx)(`span`,{style:{transform:`var(--radix-slider-thumb-transform)`,position:`absolute`,[a.startEdge]:`calc(${c}% + ${m}px)`},children:(0,H.jsx)(vv.ItemSlot,{scope:n,children:(0,H.jsx)(W.span,{role:`slider`,"aria-label":e[`aria-label`]||f,"aria-valuemin":i.min,"aria-valuenow":s,"aria-valuemax":i.max,"aria-orientation":i.orientation,"data-orientation":i.orientation,"data-disabled":i.disabled?``:void 0,tabIndex:i.disabled?void 0:0,...r,ref:d,style:s===void 0?{display:`none`}:e.style,onFocus:q(e.onFocus,()=>{i.valueIndexToChangeRef.current=o})})})})},`SliderThumbTrigger`)),Vv=V.forwardRef(X(function(e,t){let{__scopeSlider:n,name:r,...i}=e;return(0,H.jsx)(Rv,{__scopeSlider:n,name:r,internal_do_not_use_render:({index:e,isFormControl:r})=>(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Bv,{...i,ref:t,__scopeSlider:n}),r?(0,H.jsx)(Uv,{__scopeSlider:n},e):null]})})},`SliderThumb`)),Hv=`SliderBubbleInput`,Uv=V.forwardRef(X(function({__scopeSlider:e,onInput:t,...n},r){let{index:i,value:a,name:o,form:s}=Iv(Hv,e),{userRequestedValues:c}=wv(Hv,e),l=V.useRef(null),u=U(l,r),d=V.useRef(!1),f=V.useRef(a),p=V.useRef(c),m=V.useRef(c);return V.useEffect(()=>{let e=l.current;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set,r=f.current,o=r!==a;f.current=a;let s=c!==m.current;if(m.current=c,o&&n){let t=c!==p.current;p.current=c;let o=c?.[i];d.current=!(t&&(s&&o!==r||o===a));let l=new Event(`input`,{bubbles:!0});n.call(e,a),e.dispatchEvent(l),d.current=!1}},[i,a,c]),(0,H.jsx)(W.input,{style:{display:`none`},name:o,form:s,...n,ref:u,defaultValue:a,onInput:q(t,e=>{d.current&&e.stopPropagation()})})},`SliderBubbleInput`));function Wv(e=[],t,n){let r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}X(Wv,`getNextSortedValues`);function Gv(e,t,n){return Ah(100/(n-t)*(e-t),[0,100])}X(Gv,`convertValueToPercentage`);function Kv(e,t){if(t>2)return`Value ${e+1} of ${t}`;if(t===2)return[`Minimum`,`Maximum`][e]}X(Kv,`getLabel`);function qv(e,t){if(e.length===1)return 0;let n=e.map(e=>Math.abs(e-t)),r=Math.min(...n);return n.indexOf(r)}X(qv,`getClosestValueIndex`);function Jv(e,t,n){let r=e/2;return(r-Zv([0,50],[0,r])(t)*n)*n}X(Jv,`getThumbInBoundsOffset`);function Yv(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}X(Yv,`getStepsBetweenValues`);function Xv(e,t){if(t>0){let n=Yv(e);return Math.min(...n)>=t}return!0}X(Xv,`hasMinStepsBetweenValues`);function Zv(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}X(Zv,`linearScale`);function Qv(e){if(!Number.isFinite(e))return 0;let t=e.toString();if(t.includes(`e`)){let[e,n]=t.split(`e`),r=e.split(`.`)[1]||``,i=Number(n);return Math.max(0,r.length-i)}let n=t.split(`.`)[1];return n?n.length:0}X(Qv,`getDecimalCount`);function $v(e,t){let n=10**t;return Math.round(e*n)/n}X($v,`roundValue`);function ey(e,{min:t,step:n,direction:r,multiplier:i}){let a=Qv(n),o=(e-t)/n,s=Math.round(o),c=$v(s*n+t,a)===$v(e,a),l;return l=c?s+i*r:r>0?Math.ceil(o):Math.floor(o),$v(l*n+t,a)}X(ey,`getNextStepValue`);function ty(e){return typeof e==`function`}X(ty,`isFunction`);var ny=Object.defineProperty,ry=(e,t)=>ny(e,`name`,{value:t,configurable:!0}),iy=`Switch`,[ay,oy]=G(iy),[sy,cy]=ay(iy);function ly(e){let{__scopeSwitch:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=po({prop:n,defaultProp:i??!1,onChange:c,caller:iy}),[m,h]=V.useState(null),[g,_]=V.useState(null),[v,y]=V.useState(null),b={checked:f,setChecked:p,disabled:a,control:m,setControl:h,name:s,form:o,value:u,userClick:v,onUserClick:y,required:l,defaultChecked:i,isFormControl:!m||!!o||!!m.closest(`form`),bubbleInput:g,setBubbleInput:_};return(0,H.jsx)(sy,{scope:t,...b,children:_y(d)?d(b):r})}ry(ly,`SwitchProvider`);var uy=`SwitchTrigger`,dy=V.forwardRef(ry(function({__scopeSwitch:e,onClick:t,...n},r){let{control:i,form:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,onUserClick:f,isFormControl:p,bubbleInput:m}=cy(uy,e),h=U(r,u),g=V.useRef(c);return V.useEffect(()=>{let e=a?i?.ownerDocument.getElementById(a):i?.form;if(e instanceof HTMLFormElement){let t=ry(()=>d(g.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[i,a,d]),(0,H.jsx)(W.button,{type:`button`,role:`switch`,"aria-checked":c,"aria-required":l,"data-state":vy(c),"data-disabled":s?``:void 0,disabled:s,value:o,...n,ref:h,onClick:q(t,e=>{let t=e.isPropagationStopped();f({requestedChecked:!c,hasConsumerStoppedPropagation:t}),d(e=>!e),m&&p&&(t||e.stopPropagation())})})},`SwitchTrigger`)),fy=V.forwardRef(ry(function(e,t){let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,H.jsx)(ly,{__scopeSwitch:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(dy,{...d,ref:t,__scopeSwitch:n}),e&&(0,H.jsx)(gy,{__scopeSwitch:n})]})})},`Switch`)),py=`SwitchThumb`,my=V.forwardRef(ry(function(e,t){let{__scopeSwitch:n,...r}=e,i=cy(py,n);return(0,H.jsx)(W.span,{"data-state":vy(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})},`SwitchThumb`)),hy=`SwitchBubbleInput`,gy=V.forwardRef(ry(function({__scopeSwitch:e,onClick:t,...n},r){let{control:i,userClick:a,checked:o,defaultChecked:s,required:c,disabled:l,name:u,value:d,form:f,bubbleInput:p,setBubbleInput:m}=cy(hy,e),h=U(r,m),g=Lu(i),_=V.useRef(!1),v=V.useRef(o),y=V.useRef(a),b=V.useRef(null);V.useEffect(()=>{let e=p;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set;if(!n)return;let r=v.current!==o;v.current=o;let i=a!==null&&a!==y.current;if(y.current=a,i)b.current=r?null:a,r&&n.call(e,o),e.dispatchEvent(new Event(`click`,{bubbles:!a.hasConsumerStoppedPropagation}));else if(r){let t=b.current;b.current=null;let r=t?.requestedChecked===o;_.current=!0,n.call(e,o),e.dispatchEvent(new Event(`click`,{bubbles:!(r&&t.hasConsumerStoppedPropagation)})),_.current=!1}},[p,o,a]);let x=V.useRef(o);return(0,H.jsx)(W.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:s??x.current,required:c,disabled:l,name:u,value:d,form:f,...n,tabIndex:-1,ref:h,onClick:q(t,e=>{_.current&&e.stopPropagation()}),style:{...n.style,...g,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`SwitchBubbleInput`));function _y(e){return typeof e==`function`}ry(_y,`isFunction`);function vy(e){return e?`checked`:`unchecked`}ry(vy,`getState`);var yy=Object.defineProperty,by=(e,t)=>yy(e,`name`,{value:t,configurable:!0}),xy={Automatic:`automatic`,Manual:`manual`},Sy=`Tabs`,[Cy,wy]=G(Sy,[tm]),Ty=tm(),[Ey,Dy]=Cy(Sy),Oy=V.forwardRef(by(function(e,t){let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=xy.Automatic,...l}=e,u=Xo(s),[d,f]=po({prop:r,onChange:i,defaultProp:a??``,caller:Sy});return(0,H.jsx)(Ey,{scope:n,baseId:jo(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,H.jsx)(W.div,{dir:u,"data-orientation":o,...l,ref:t})})},`Tabs`)),ky=`TabsList`,Ay=V.forwardRef(by(function(e,t){let{__scopeTabs:n,loop:r=!0,...i}=e,a=Dy(ky,n),o=Ty(n);return(0,H.jsx)(om,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,H.jsx)(W.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})},`TabsList`)),jy=`TabsTrigger`,My=V.forwardRef(by(function(e,t){let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=Dy(jy,n),s=Ty(n),c=Ny(o.baseId,r),l=Py(o.baseId,r),u=r===o.value;return(0,H.jsx)(lm,{asChild:!0,...s,focusable:!i,active:u,children:(0,H.jsx)(W.button,{type:`button`,role:`tab`,"aria-selected":u,"aria-controls":l,"data-state":u?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:q(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?(e.currentTarget.focus(),o.onValueChange(r)):e.preventDefault()}),onKeyDown:q(e.onKeyDown,e=>{i||e.target!==e.currentTarget||[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:q(e.onFocus,()=>{let e=o.activationMode!==xy.Manual;!u&&!i&&e&&o.onValueChange(r)})})})},`TabsTrigger`));function Ny(e,t){return`${e}-trigger-${t}`}by(Ny,`makeTriggerId`);function Py(e,t){return`${e}-content-${t}`}by(Py,`makeContentId`);var Fy=Object.defineProperty,Iy=(e,t)=>Fy(e,`name`,{value:t,configurable:!0}),Ly=`Toggle`,Ry=V.forwardRef(Iy(function(e,t){let{pressed:n,defaultPressed:r,onPressedChange:i,...a}=e,[o,s]=po({prop:n,onChange:i,defaultProp:r??!1,caller:Ly});return(0,H.jsx)(W.button,{type:`button`,"aria-pressed":o,"data-state":o?`on`:`off`,"data-disabled":e.disabled?``:void 0,...a,ref:t,onClick:q(e.onClick,()=>{e.disabled||s(!o)})})},`Toggle`)),zy=Object.defineProperty,By=(e,t)=>zy(e,`name`,{value:t,configurable:!0}),Vy=`ToggleGroup`,Hy={Single:`single`,Multiple:`multiple`},[Uy,Wy]=G(Vy,[tm]),Gy=tm(),Ky=V.forwardRef(By(function(e,t){let{type:n,...r}=e;if(n===Hy.Single)return(0,H.jsx)(Yy,{role:`radiogroup`,...r,ref:t});if(n===Hy.Multiple)return(0,H.jsx)(Xy,{role:`toolbar`,...r,ref:t});throw Error(`Missing prop \`type\` expected on \`${Vy}\``)},`ToggleGroup`)),[qy,Jy]=Uy(Vy),Yy=V.forwardRef(By(function(e,t){let{value:n,defaultValue:r,onValueChange:i=By(()=>{},`onValueChange`),...a}=e,[o,s]=po({prop:n,defaultProp:r??``,onChange:i,caller:Vy});return(0,H.jsx)(qy,{scope:e.__scopeToggleGroup,type:Hy.Single,value:V.useMemo(()=>o?[o]:[],[o]),onItemActivate:s,onItemDeactivate:V.useCallback(()=>s(``),[s]),children:(0,H.jsx)($y,{...a,ref:t})})},`ToggleGroupImplSingle`)),Xy=V.forwardRef(By(function(e,t){let{value:n,defaultValue:r,onValueChange:i=By(()=>{},`onValueChange`),...a}=e,[o,s]=po({prop:n,defaultProp:r??[],onChange:i,caller:Vy}),c=V.useCallback(e=>s((t=[])=>[...t,e]),[s]),l=V.useCallback(e=>s((t=[])=>t.filter(t=>t!==e)),[s]);return(0,H.jsx)(qy,{scope:e.__scopeToggleGroup,type:Hy.Multiple,value:o,onItemActivate:c,onItemDeactivate:l,children:(0,H.jsx)($y,{...a,ref:t})})},`ToggleGroupImplMultiple`)),[Zy,Qy]=Uy(Vy),$y=V.forwardRef(By(function(e,t){let{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:i=!0,orientation:a,dir:o,loop:s=!0,...c}=e,l=Gy(n),u=Xo(o),d={dir:u,...c};return(0,H.jsx)(Zy,{scope:n,rovingFocus:i,disabled:r,children:i?(0,H.jsx)(om,{asChild:!0,...l,orientation:a,dir:u,loop:s,children:(0,H.jsx)(W.div,{...d,ref:t})}):(0,H.jsx)(W.div,{...d,ref:t})})},`ToggleGroupImpl`)),eb=`ToggleGroupItem`,tb=V.forwardRef(By(function(e,t){let n=Jy(eb,e.__scopeToggleGroup),r=Qy(eb,e.__scopeToggleGroup),i=Gy(e.__scopeToggleGroup),a=n.value.includes(e.value),o=r.disabled||e.disabled,s={...e,pressed:a,disabled:o},c=V.useRef(null);return r.rovingFocus?(0,H.jsx)(lm,{asChild:!0,...i,focusable:!o,active:a,ref:c,children:(0,H.jsx)(nb,{...s,ref:t})}):(0,H.jsx)(nb,{...s,ref:t})},`ToggleGroupItem`)),nb=V.forwardRef(By(function(e,t){let{__scopeToggleGroup:n,value:r,...i}=e,a=Jy(eb,n),o={role:`radio`,"aria-checked":e.pressed,"aria-pressed":void 0},s=a.type===Hy.Single?o:void 0;return(0,H.jsx)(Ry,{...s,...i,ref:t,onPressedChange:e=>{e?a.onItemActivate(r):a.onItemDeactivate(r)}})},`ToggleGroupItemImpl`)),rb=Object.defineProperty,ib=(e,t)=>rb(e,`name`,{value:t,configurable:!0}),[ab,ob]=G(`Tooltip`,[Sp]),sb=Sp(),cb=`TooltipProvider`,lb=700,ub=`tooltip.open`,[db,fb]=ab(cb),pb=ib(e=>{let{__scopeTooltip:t,delayDuration:n=lb,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=V.useRef(!0),s=V.useRef(!1),c=V.useRef(0);return V.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,H.jsx)(db,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:V.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:V.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:V.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),mb=`Tooltip`,[hb,gb]=ab(mb),_b=ib(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=fb(mb,e.__scopeTooltip),l=sb(t),[u,d]=V.useState(null),[f,p]=V.useState(void 0),m=jo(),h=V.useRef(0),g=o??c.disableHoverableContent,_=s??c.delayDuration,v=V.useRef(!1),[y,b]=po({prop:r,defaultProp:i??!1,onChange:ib(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(ub))):c.onClose(),a?.(e)},`onChange`),caller:mb}),x=V.useMemo(()=>y?v.current?`delayed-open`:`instant-open`:`closed`,[y]),S=V.useCallback(()=>{window.clearTimeout(h.current),h.current=0,v.current=!1,b(!0)},[b]),C=V.useCallback(()=>{window.clearTimeout(h.current),h.current=0,b(!1)},[b]),w=V.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,b(!0),h.current=0},_)},[_,b]);V.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]);let T=f??m;return(0,H.jsx)(Tp,{...l,children:(0,H.jsx)(hb,{scope:t,contentId:T,setContentId:p,open:y,stateAttribute:x,trigger:u,onTriggerChange:d,onTriggerEnter:V.useCallback(()=>{c.isOpenDelayedRef.current?w():S()},[c.isOpenDelayedRef,w,S]),onTriggerLeave:V.useCallback(()=>{g?C():(window.clearTimeout(h.current),h.current=0)},[C,g]),onOpen:S,onClose:C,disableHoverableContent:g,children:n})})},`Tooltip`),vb=`TooltipTrigger`,yb=V.forwardRef(ib(function(e,t){let{__scopeTooltip:n,"aria-describedby":r,...i}=e,a=gb(vb,n),o=fb(vb,n),s=sb(n),c=U(t,V.useRef(null),a.onTriggerChange),l=V.useRef(!1),u=V.useRef(!1),d=V.useCallback(()=>l.current=!1,[]);return V.useEffect(()=>()=>document.removeEventListener(`pointerup`,d),[d]),(0,H.jsx)(Dp,{asChild:!0,...s,children:(0,H.jsx)(W.button,{"aria-describedby":a.open?Ib(r,a.contentId):r,"data-state":a.stateAttribute,...i,ref:c,onPointerMove:q(e.onPointerMove,e=>{e.pointerType!==`touch`&&!u.current&&!o.isPointerInTransitRef.current&&(a.onTriggerEnter(),u.current=!0)}),onPointerLeave:q(e.onPointerLeave,()=>{a.onTriggerLeave(),u.current=!1}),onPointerDown:q(e.onPointerDown,()=>{a.open&&a.onClose(),l.current=!0,document.addEventListener(`pointerup`,d,{once:!0})}),onFocus:q(e.onFocus,()=>{l.current||a.onOpen()}),onBlur:q(e.onBlur,a.onClose),onClick:q(e.onClick,a.onClose)})})},`TooltipTrigger`)),bb=`TooltipPortal`,[xb,Sb]=ab(bb,{forceMount:void 0}),Cb=ib(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=gb(bb,t);return(0,H.jsx)(xb,{scope:t,forceMount:n,children:(0,H.jsx)(xo,{present:n||a.open,children:(0,H.jsx)(_c,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),wb=`TooltipContent`,Tb=V.forwardRef(ib(function(e,t){let n=Sb(wb,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=gb(wb,e.__scopeTooltip);return(0,H.jsx)(xo,{present:r||o.open,children:o.disableHoverableContent?(0,H.jsx)(Ob,{side:i,...a,ref:t}):(0,H.jsx)(Eb,{side:i,...a,ref:t})})},`TooltipContent`)),Eb=V.forwardRef(ib(function(e,t){let n=gb(wb,e.__scopeTooltip),r=fb(wb,e.__scopeTooltip),i=V.useRef(null),a=U(t,i),[o,s]=V.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=V.useCallback(()=>{s(null),d(!1)},[d]),p=V.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=jb(r,Ab(r,n.getBoundingClientRect())),a=Mb(t.getBoundingClientRect()),o=Pb([...i,...a]);s(o),d(!0)},[d]);return V.useEffect(()=>()=>f(),[f]),V.useEffect(()=>{if(c&&u){let e=ib(e=>p(e,u),`handleTriggerLeave`),t=ib(e=>p(e,c),`handleContentLeave`);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),V.useEffect(()=>{if(o){let e=ib(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!Nb(n,o);r?f():i&&(f(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,H.jsx)(Ob,{...e,ref:a})},`TooltipContentHoverable`)),Db=pa(`TooltipContent`),Ob=V.forwardRef(ib(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=gb(wb,n),u=sb(n),{onClose:d}=l,[f,p]=V.useState(null),m=U(t,p);ic(f),V.useEffect(()=>(document.addEventListener(ub,d),()=>document.removeEventListener(ub,d)),[d]),V.useEffect(()=>{if(l.trigger){let e=ib(e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&d()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]);let{setContentId:h}=l;return K(()=>(h(a),()=>{h(void 0)}),[a,h]),(0,H.jsx)(Hs,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,H.jsxs)(jp,{"data-state":l.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:l.contentId,...u,...c,ref:m,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,H.jsx)(Db,{children:r}),i?(0,H.jsx)(Ma,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`)),kb=V.forwardRef(ib(function(e,t){let{__scopeTooltip:n,...r}=e,i=sb(n);return(0,H.jsx)(Pp,{...i,...r,ref:t})},`TooltipArrow`));function Ab(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}ib(Ab,`getExitSideFromRect`);function jb(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}ib(jb,`getPaddedExitPoints`);function Mb(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}ib(Mb,`getPointsFromRect`);function Nb(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}ib(Nb,`isPointInPolygon`);function Pb(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),Fb(t)}ib(Pb,`getHull`);function Fb(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}ib(Fb,`getHullPresorted`);function Ib(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}ib(Ib,`concatAriaDescribedby`);var Lb=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Rb=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),zb=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Bb=e=>{let t=zb(e);return t.charAt(0).toUpperCase()+t.slice(1)},Vb={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},Hb=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Ub=(0,V.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,V.createElement)(`svg`,{ref:c,...Vb,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Lb(`lucide`,i),...!a&&!Hb(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,V.createElement)(e,t)),...Array.isArray(a)?a:[a]])),Wb=(e,t)=>{let n=(0,V.forwardRef)(({className:n,...r},i)=>(0,V.createElement)(Ub,{ref:i,iconNode:t,className:Lb(`lucide-${Rb(Bb(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Bb(e),n},Gb=Wb(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),Kb=Wb(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),qb=Wb(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Jb=Wb(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Yb=Wb(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),Xb=Wb(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Zb=Wb(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),Qb=Wb(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),$b=Wb(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),ex=Wb(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);function tx(e){return Object.prototype.toString.call(e)===`[object Object]`}function nx(e){return tx(e)||Array.isArray(e)}function rx(){return!!(typeof window<`u`&&window.document&&window.document.createElement)}function ix(e,t){let n=Object.keys(e),r=Object.keys(t);return n.length!==r.length||JSON.stringify(Object.keys(e.breakpoints||{}))!==JSON.stringify(Object.keys(t.breakpoints||{}))?!1:n.every(n=>{let r=e[n],i=t[n];return typeof r==`function`?`${r}`==`${i}`:!nx(r)||!nx(i)?r===i:ix(r,i)})}function ax(e){return e.concat().sort((e,t)=>e.name>t.name?1:-1).map(e=>e.options)}function ox(e,t){if(e.length!==t.length)return!1;let n=ax(e),r=ax(t);return n.every((e,t)=>{let n=r[t];return ix(e,n)})}function sx(e){return typeof e==`number`}function cx(e){return typeof e==`string`}function lx(e){return typeof e==`boolean`}function ux(e){return Object.prototype.toString.call(e)===`[object Object]`}function Z(e){return Math.abs(e)}function dx(e){return Math.sign(e)}function fx(e,t){return Z(e-t)}function px(e,t){return e===0||t===0||Z(e)<=Z(t)?0:Z(fx(Z(e),Z(t))/e)}function mx(e){return Math.round(e*100)/100}function hx(e){return bx(e).map(Number)}function gx(e){return e[_x(e)]}function _x(e){return Math.max(0,e.length-1)}function vx(e,t){return t===_x(e)}function yx(e,t=0){return Array.from(Array(e),(e,n)=>t+n)}function bx(e){return Object.keys(e)}function xx(e,t){return[e,t].reduce((e,t)=>(bx(t).forEach(n=>{let r=e[n],i=t[n];e[n]=ux(r)&&ux(i)?xx(r,i):i}),e),{})}function Sx(e,t){return t.MouseEvent!==void 0&&e instanceof t.MouseEvent}function Cx(e,t){let n={start:r,center:i,end:a};function r(){return 0}function i(e){return a(e)/2}function a(e){return t-e}function o(r,i){return cx(e)?n[e](r):e(t,r,i)}return{measure:o}}function wx(){let e=[];function t(t,n,i,a={passive:!0}){let o;if(`addEventListener`in t)t.addEventListener(n,i,a),o=()=>t.removeEventListener(n,i,a);else{let e=t;e.addListener(i),o=()=>e.removeListener(i)}return e.push(o),r}function n(){e=e.filter(e=>e())}let r={add:t,clear:n};return r}function Tx(e,t,n,r){let i=wx(),a=1e3/60,o=null,s=0,c=0;function l(){i.add(e,`visibilitychange`,()=>{e.hidden&&m()})}function u(){p(),i.clear()}function d(e){if(!c)return;o||(o=e,n(),n());let i=e-o;for(o=e,s+=i;s>=a;)n(),s-=a;r(s/a),c&&=t.requestAnimationFrame(d)}function f(){c||=t.requestAnimationFrame(d)}function p(){t.cancelAnimationFrame(c),o=null,s=0,c=0}function m(){o=null,s=0}return{init:l,destroy:u,start:f,stop:p,update:n,render:r}}function Ex(e,t){let n=t===`rtl`,r=e===`y`,i=r?`y`:`x`,a=r?`x`:`y`,o=!r&&n?-1:1,s=u(),c=d();function l(e){let{height:t,width:n}=e;return r?t:n}function u(){return r?`top`:n?`right`:`left`}function d(){return r?`bottom`:n?`left`:`right`}function f(e){return e*o}return{scroll:i,cross:a,startEdge:s,endEdge:c,measureSize:l,direction:f}}function Dx(e=0,t=0){let n=Z(e-t);function r(t){return t<e}function i(e){return e>t}function a(e){return r(e)||i(e)}function o(n){return a(n)?r(n)?e:t:n}function s(e){return n?e-n*Math.ceil((e-t)/n):e}return{length:n,max:t,min:e,constrain:o,reachedAny:a,reachedMax:i,reachedMin:r,removeOffset:s}}function Ox(e,t,n){let{constrain:r}=Dx(0,e),i=e+1,a=o(t);function o(e){return n?Z((i+e)%i):r(e)}function s(){return a}function c(e){return a=o(e),d}function l(e){return u().set(s()+e)}function u(){return Ox(e,s(),n)}let d={get:s,set:c,add:l,clone:u};return d}function kx(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v){let{cross:y,direction:b}=e,x=[`INPUT`,`SELECT`,`TEXTAREA`],S={passive:!1},C=wx(),w=wx(),T=Dx(50,225).constrain(p.measure(20)),E={mouse:300,touch:400},D={mouse:500,touch:600},O=m?43:25,k=!1,A=0,j=0,M=!1,N=!1,P=!1,F=!1;function I(e){if(!v)return;function n(t){(lx(v)||v(e,t))&&re(t)}let r=t;C.add(r,`dragstart`,e=>e.preventDefault(),S).add(r,`touchmove`,()=>void 0,S).add(r,`touchend`,()=>void 0).add(r,`touchstart`,n).add(r,`mousedown`,n).add(r,`touchcancel`,ie).add(r,`contextmenu`,ie).add(r,`click`,ae,!0)}function L(){C.clear(),w.clear()}function ee(){let e=F?n:t;w.add(e,`touchmove`,z,S).add(e,`touchend`,ie).add(e,`mousemove`,z,S).add(e,`mouseup`,ie)}function te(e){let t=e.nodeName||``;return x.includes(t)}function ne(){return(m?D:E)[F?`mouse`:`touch`]}function R(e,t){let n=d.add(dx(e)*-1),r=u.byDistance(e,!m).distance;return m||Z(e)<T?r:g&&t?r*.5:u.byIndex(n.get(),0).distance}function re(e){let t=Sx(e,r);F=t,P=m&&t&&!e.buttons&&k,k=fx(i.get(),o.get())>=2,t&&e.button!==0||te(e.target)||(M=!0,a.pointerDown(e),l.useFriction(0).useDuration(0),i.set(o),ee(),A=a.readPoint(e),j=a.readPoint(e,y),f.emit(`pointerDown`))}function z(e){if(!Sx(e,r)&&e.touches.length>=2)return ie(e);let t=a.readPoint(e),n=a.readPoint(e,y),o=fx(t,A),c=fx(n,j);if(!N&&!F&&(!e.cancelable||(N=o>c,!N)))return ie(e);let u=a.pointerMove(e);o>h&&(P=!0),l.useFriction(.3).useDuration(.75),s.start(),i.add(b(u)),e.preventDefault()}function ie(e){let t=u.byDistance(0,!1).index!==d.get(),n=a.pointerUp(e)*ne(),r=R(b(n),t),i=px(n,r),o=O-10*i,s=_+i/50;N=!1,M=!1,w.clear(),l.useDuration(o).useFriction(s),c.distance(r,!m),F=!1,f.emit(`pointerUp`)}function ae(e){P&&=(e.stopPropagation(),e.preventDefault(),!1)}function oe(){return M}return{init:I,destroy:L,pointerDown:oe}}function Ax(e,t){let n,r;function i(e){return e.timeStamp}function a(n,r){let i=`client${(r||e.scroll)===`x`?`X`:`Y`}`;return(Sx(n,t)?n:n.touches[0])[i]}function o(e){return n=e,r=e,a(e)}function s(e){let t=a(e)-a(r),o=i(e)-i(n)>170;return r=e,o&&(n=e),t}function c(e){if(!n||!r)return 0;let t=a(r)-a(n),o=i(e)-i(n),s=i(e)-i(r)>170,c=t/o;return o&&!s&&Z(c)>.1?c:0}return{pointerDown:o,pointerMove:s,pointerUp:c,readPoint:a}}function jx(){function e(e){let{offsetTop:t,offsetLeft:n,offsetWidth:r,offsetHeight:i}=e;return{top:t,right:n+r,bottom:t+i,left:n,width:r,height:i}}return{measure:e}}function Mx(e){function t(t){return t/100*e}return{measure:t}}function Nx(e,t,n,r,i,a,o){let s=[e].concat(r),c,l,u=[],d=!1;function f(e){return i.measureSize(o.measure(e))}function p(i){if(!a)return;l=f(e),u=r.map(f);function o(n){for(let a of n){if(d)return;let n=a.target===e,o=r.indexOf(a.target),s=n?l:u[o];if(Z(f(n?e:r[o])-s)>=.5){i.reInit(),t.emit(`resize`);break}}}c=new ResizeObserver(e=>{(lx(a)||a(i,e))&&o(e)}),n.requestAnimationFrame(()=>{s.forEach(e=>c.observe(e))})}function m(){d=!0,c&&c.disconnect()}return{init:p,destroy:m}}function Px(e,t,n,r,i,a){let o=0,s=0,c=i,l=a,u=e.get(),d=0;function f(){let t=r.get()-e.get(),i=!c,a=0;return i?(o=0,n.set(r),e.set(r),a=t):(n.set(e),o+=t/c,o*=l,u+=o,e.add(o),a=u-d),s=dx(a),d=u,x}function p(){return Z(r.get()-t.get())<.001}function m(){return c}function h(){return s}function g(){return o}function _(){return y(i)}function v(){return b(a)}function y(e){return c=e,x}function b(e){return l=e,x}let x={direction:h,duration:m,velocity:g,seek:f,settled:p,useBaseFriction:v,useBaseDuration:_,useFriction:b,useDuration:y};return x}function Fx(e,t,n,r,i){let a=i.measure(10),o=i.measure(50),s=Dx(.1,.99),c=!1;function l(){return!(c||!e.reachedAny(n.get())||!e.reachedAny(t.get()))}function u(i){if(!l())return;let c=Z(e[e.reachedMin(t.get())?`min`:`max`]-t.get()),u=n.get()-t.get(),d=s.constrain(c/o);n.subtract(u*d),!i&&Z(u)<a&&(n.set(e.constrain(n.get())),r.useDuration(25).useBaseFriction())}function d(e){c=!e}return{shouldConstrain:l,constrain:u,toggleActive:d}}function Ix(e,t,n,r,i){let a=Dx(-t+e,0),o=d(),s=u(),c=f();function l(e,t){return fx(e,t)<=1}function u(){let e=o[0],t=gx(o);return Dx(o.lastIndexOf(e),o.indexOf(t)+1)}function d(){return n.map((e,t)=>{let{min:r,max:i}=a,o=a.constrain(e),s=!t,c=vx(n,t);return s?i:c||l(r,o)?r:l(i,o)?i:o}).map(e=>parseFloat(e.toFixed(3)))}function f(){if(t<=e+i)return[a.max];if(r===`keepSnaps`)return o;let{min:n,max:c}=s;return o.slice(n,c)}return{snapsContained:c,scrollContainLimit:s}}function Lx(e,t,n){let r=t[0];return{limit:Dx(n?r-e:gx(t),r)}}function Rx(e,t,n,r){let i=.1,{reachedMin:a,reachedMax:o}=Dx(t.min+i,t.max+i);function s(e){return e===1?o(n.get()):e===-1&&a(n.get())}function c(t){if(!s(t))return;let n=t*-1*e;r.forEach(e=>e.add(n))}return{loop:c}}function zx(e){let{max:t,length:n}=e;function r(e){let r=e-t;return n?r/-n:0}return{get:r}}function Bx(e,t,n,r,i){let{startEdge:a,endEdge:o}=e,{groupSlides:s}=i,c=d().map(t.measure),l=f(),u=p();function d(){return s(r).map(e=>gx(e)[o]-e[0][a]).map(Z)}function f(){return r.map(e=>n[a]-e[a]).map(e=>-Z(e))}function p(){return s(l).map(e=>e[0]).map((e,t)=>e+c[t])}return{snaps:l,snapsAligned:u}}function Vx(e,t,n,r,i,a){let{groupSlides:o}=i,{min:s,max:c}=r,l=u();function u(){let r=o(a),i=!e||t===`keepSnaps`;return n.length===1?[a]:i?r:r.slice(s,c).map((e,t,n)=>{let r=!t,i=vx(n,t);return r?yx(gx(n[0])+1):i?yx(_x(a)-gx(n)[0]+1,gx(n)[0]):e})}return{slideRegistry:l}}function Hx(e,t,n,r,i){let{reachedAny:a,removeOffset:o,constrain:s}=r;function c(e){return e.concat().sort((e,t)=>Z(e)-Z(t))[0]}function l(n){let r=e?o(n):s(n),{index:i}=t.map((e,t)=>({diff:u(e-r,0),index:t})).sort((e,t)=>Z(e.diff)-Z(t.diff))[0];return{index:i,distance:r}}function u(t,r){let i=[t,t+n,t-n];if(!e)return t;if(!r)return c(i);let a=i.filter(e=>dx(e)===r);return a.length?c(a):gx(i)-n}function d(e,n){return{index:e,distance:u(t[e]-i.get(),n)}}function f(n,r){let o=i.get()+n,{index:s,distance:c}=l(o),d=!e&&a(o);return!r||d?{index:s,distance:n}:{index:s,distance:n+u(t[s]-c,0)}}return{byDistance:f,byIndex:d,shortcut:u}}function Ux(e,t,n,r,i,a,o){function s(i){let s=i.distance,c=i.index!==t.get();a.add(s),s&&(r.duration()?e.start():(e.update(),e.render(1),e.update())),c&&(n.set(t.get()),t.set(i.index),o.emit(`select`))}function c(e,t){s(i.byDistance(e,t))}function l(e,n){let r=t.clone().set(e);s(i.byIndex(r.get(),n))}return{distance:c,index:l}}function Wx(e,t,n,r,i,a,o,s){let c={passive:!0,capture:!0},l=0;function u(u){if(!s)return;function f(t){if(new Date().getTime()-l>10)return;o.emit(`slideFocusStart`),e.scrollLeft=0;let a=n.findIndex(e=>e.includes(t));sx(a)&&(i.useDuration(0),r.index(a,0),o.emit(`slideFocus`))}a.add(document,`keydown`,d,!1),t.forEach((e,t)=>{a.add(e,`focus`,e=>{(lx(s)||s(u,e))&&f(t)},c)})}function d(e){e.code===`Tab`&&(l=new Date().getTime())}return{init:u}}function Gx(e){let t=e;function n(){return t}function r(e){t=o(e)}function i(e){t+=o(e)}function a(e){t-=o(e)}function o(e){return sx(e)?e:e.get()}return{get:n,set:r,add:i,subtract:a}}function Kx(e,t){let n=e.scroll===`x`?o:s,r=t.style,i=null,a=!1;function o(e){return`translate3d(${e}px,0px,0px)`}function s(e){return`translate3d(0px,${e}px,0px)`}function c(t){if(a)return;let o=mx(e.direction(t));o!==i&&(r.transform=n(o),i=o)}function l(e){a=!e}function u(){a||(r.transform=``,t.getAttribute(`style`)||t.removeAttribute(`style`))}return{clear:u,to:c,toggleActive:l}}function qx(e,t,n,r,i,a,o,s,c){let l=.5,u=hx(i),d=hx(i).reverse(),f=_().concat(v());function p(e,t){return e.reduce((e,t)=>e-i[t],t)}function m(e,t){return e.reduce((e,n)=>p(e,t)>0?e.concat([n]):e,[])}function h(e){return a.map((n,i)=>({start:n-r[i]+l+e,end:n+t-l+e}))}function g(t,r,i){let a=h(r);return t.map(t=>{let r=i?0:-n,o=i?n:0,l=i?`end`:`start`,u=a[t][l];return{index:t,loopPoint:u,slideLocation:Gx(-1),translate:Kx(e,c[t]),target:()=>s.get()>u?r:o}})}function _(){let e=o[0];return g(m(d,e),n,!1)}function v(){let e=t-o[0]-1;return g(m(u,e),-n,!0)}function y(){return f.every(({index:e})=>p(u.filter(t=>t!==e),t)<=.1)}function b(){f.forEach(e=>{let{target:t,translate:n,slideLocation:r}=e,i=t();i!==r.get()&&(n.to(i),r.set(i))})}function x(){f.forEach(e=>e.translate.clear())}return{canLoop:y,clear:x,loop:b,loopPoints:f}}function Jx(e,t,n){let r,i=!1;function a(a){if(!n)return;function o(e){for(let n of e)if(n.type===`childList`){a.reInit(),t.emit(`slidesChanged`);break}}r=new MutationObserver(e=>{i||(lx(n)||n(a,e))&&o(e)}),r.observe(e,{childList:!0})}function o(){r&&r.disconnect(),i=!0}return{init:a,destroy:o}}function Yx(e,t,n,r){let i={},a=null,o=null,s,c=!1;function l(){s=new IntersectionObserver(e=>{c||(e.forEach(e=>{let n=t.indexOf(e.target);i[n]=e}),a=null,o=null,n.emit(`slidesInView`))},{root:e.parentElement,threshold:r}),t.forEach(e=>s.observe(e))}function u(){s&&s.disconnect(),c=!0}function d(e){return bx(i).reduce((t,n)=>{let r=parseInt(n),{isIntersecting:a}=i[r];return(e&&a||!e&&!a)&&t.push(r),t},[])}function f(e=!0){if(e&&a)return a;if(!e&&o)return o;let t=d(e);return e&&(a=t),e||(o=t),t}return{init:l,destroy:u,get:f}}function Xx(e,t,n,r,i,a){let{measureSize:o,startEdge:s,endEdge:c}=e,l=n[0]&&i,u=m(),d=h(),f=n.map(o),p=g();function m(){if(!l)return 0;let e=n[0];return Z(t[s]-e[s])}function h(){if(!l)return 0;let e=a.getComputedStyle(gx(r));return parseFloat(e.getPropertyValue(`margin-${c}`))}function g(){return n.map((e,t,n)=>{let r=!t,i=vx(n,t);return r?f[t]+u:i?f[t]+d:n[t+1][s]-e[s]}).map(Z)}return{slideSizes:f,slideSizesWithGaps:p,startGap:u,endGap:d}}function Zx(e,t,n,r,i,a,o,s,c){let{startEdge:l,endEdge:u,direction:d}=e,f=sx(n);function p(e,t){return hx(e).filter(e=>e%t===0).map(n=>e.slice(n,n+t))}function m(e){return e.length?hx(e).reduce((n,f,p)=>{let m=gx(n)||0,h=m===0,g=f===_x(e),_=i[l]-a[m][l],v=i[l]-a[f][u],y=!r&&h?d(o):0,b=Z(v-(!r&&g?d(s):0)-(_+y));return p&&b>t+c&&n.push(f),g&&n.push(e.length),n},[]).map((t,n,r)=>{let i=Math.max(r[n-1]||0);return e.slice(i,t)}):[]}function h(e){return f?p(e,n):m(e)}return{groupSlides:h}}function Qx(e,t,n,r,i,a,o){let{align:s,axis:c,direction:l,startIndex:u,loop:d,duration:f,dragFree:p,dragThreshold:m,inViewThreshold:h,slidesToScroll:g,skipSnaps:_,containScroll:v,watchResize:y,watchSlides:b,watchDrag:x,watchFocus:S}=a,C=jx(),w=C.measure(t),T=n.map(C.measure),E=Ex(c,l),D=E.measureSize(w),O=Mx(D),k=Cx(s,D),A=!d&&!!v,{slideSizes:j,slideSizesWithGaps:M,startGap:N,endGap:P}=Xx(E,w,T,n,d||!!v,i),F=Zx(E,D,g,d,w,T,N,P,2),{snaps:I,snapsAligned:L}=Bx(E,k,w,T,F),ee=-gx(I)+gx(M),{snapsContained:te,scrollContainLimit:ne}=Ix(D,ee,L,v,2),R=A?te:L,{limit:re}=Lx(ee,R,d),z=Ox(_x(R),u,d),ie=z.clone(),ae=hx(n),oe=({dragHandler:e,scrollBody:t,scrollBounds:n,options:{loop:r}})=>{r||n.constrain(e.pointerDown()),t.seek()},se=({scrollBody:e,translate:t,location:n,offsetLocation:r,previousLocation:i,scrollLooper:a,slideLooper:o,dragHandler:s,animation:c,eventHandler:l,scrollBounds:u,options:{loop:d}},f)=>{let p=e.settled(),m=!u.shouldConstrain(),h=d?p:p&&m,g=h&&!s.pointerDown();g&&c.stop();let _=n.get()*f+i.get()*(1-f);r.set(_),d&&(a.loop(e.direction()),o.loop()),t.to(r.get()),g&&l.emit(`settle`),h||l.emit(`scroll`)},B=Tx(r,i,()=>oe(Se),e=>se(Se,e)),ce=.68,le=R[z.get()],ue=Gx(le),de=Gx(le),fe=Gx(le),pe=Gx(le),me=Px(ue,fe,de,pe,f,ce),he=Hx(d,R,ee,re,pe),ge=Ux(B,z,ie,me,he,pe,o),_e=zx(re),ve=wx(),ye=Yx(t,n,o,h),{slideRegistry:be}=Vx(A,v,R,ne,F,ae),xe=Wx(e,n,be,ge,me,ve,o,S),Se={ownerDocument:r,ownerWindow:i,eventHandler:o,containerRect:w,slideRects:T,animation:B,axis:E,dragHandler:kx(E,e,r,i,pe,Ax(E,i),ue,B,ge,me,he,z,o,O,p,m,_,ce,x),eventStore:ve,percentOfView:O,index:z,indexPrevious:ie,limit:re,location:ue,offsetLocation:fe,previousLocation:de,options:a,resizeHandler:Nx(t,o,i,n,E,y,C),scrollBody:me,scrollBounds:Fx(re,fe,pe,me,O),scrollLooper:Rx(ee,re,fe,[ue,fe,de,pe]),scrollProgress:_e,scrollSnapList:R.map(_e.get),scrollSnaps:R,scrollTarget:he,scrollTo:ge,slideLooper:qx(E,D,ee,j,M,I,R,fe,n),slideFocus:xe,slidesHandler:Jx(t,o,b),slidesInView:ye,slideIndexes:ae,slideRegistry:be,slidesToScroll:F,target:pe,translate:Kx(E,t)};return Se}function $x(){let e={},t;function n(e){t=e}function r(t){return e[t]||[]}function i(e){return r(e).forEach(n=>n(t,e)),c}function a(t,n){return e[t]=r(t).concat([n]),c}function o(t,n){return e[t]=r(t).filter(e=>e!==n),c}function s(){e={}}let c={init:n,emit:i,off:o,on:a,clear:s};return c}var eS={align:`center`,axis:`x`,container:null,slides:null,containScroll:`trimSnaps`,direction:`ltr`,slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function tS(e){function t(e,t){return xx(e,t||{})}function n(n){let r=n.breakpoints||{};return t(n,bx(r).filter(t=>e.matchMedia(t).matches).map(e=>r[e]).reduce((e,n)=>t(e,n),{}))}function r(t){return t.map(e=>bx(e.breakpoints||{})).reduce((e,t)=>e.concat(t),[]).map(e.matchMedia)}return{mergeOptions:t,optionsAtMedia:n,optionsMediaQueries:r}}function nS(e){let t=[];function n(n,r){return t=r.filter(({options:t})=>e.optionsAtMedia(t).active!==!1),t.forEach(t=>t.init(n,e)),r.reduce((e,t)=>Object.assign(e,{[t.name]:t}),{})}function r(){t=t.filter(e=>e.destroy())}return{init:n,destroy:r}}function rS(e,t,n){let r=e.ownerDocument,i=r.defaultView,a=tS(i),o=nS(a),s=wx(),c=$x(),{mergeOptions:l,optionsAtMedia:u,optionsMediaQueries:d}=a,{on:f,off:p,emit:m}=c,h=D,g=!1,_,v=l(eS,rS.globalOptions),y=l(v),b=[],x,S,C;function w(){let{container:t,slides:n}=y;S=(cx(t)?e.querySelector(t):t)||e.children[0];let r=cx(n)?S.querySelectorAll(n):n;C=[].slice.call(r||S.children)}function T(t){let n=Qx(e,S,C,r,i,t,c);return t.loop&&!n.slideLooper.canLoop()?T(Object.assign({},t,{loop:!1})):n}function E(e,t){g||(v=l(v,e),y=u(v),b=t||b,w(),_=T(y),d([v,...b.map(({options:e})=>e)]).forEach(e=>s.add(e,`change`,D)),y.active&&(_.translate.to(_.location.get()),_.animation.init(),_.slidesInView.init(),_.slideFocus.init(oe),_.eventHandler.init(oe),_.resizeHandler.init(oe),_.slidesHandler.init(oe),_.options.loop&&_.slideLooper.loop(),S.offsetParent&&C.length&&_.dragHandler.init(oe),x=o.init(oe,b)))}function D(e,t){let n=L();O(),E(l({startIndex:n},e),t),c.emit(`reInit`)}function O(){_.dragHandler.destroy(),_.eventStore.clear(),_.translate.clear(),_.slideLooper.clear(),_.resizeHandler.destroy(),_.slidesHandler.destroy(),_.slidesInView.destroy(),_.animation.destroy(),o.destroy(),s.clear()}function k(){g||(g=!0,s.clear(),O(),c.emit(`destroy`),c.clear())}function A(e,t,n){y.active&&!g&&(_.scrollBody.useBaseFriction().useDuration(t===!0?0:y.duration),_.scrollTo.index(e,n||0))}function j(e){A(_.index.add(1).get(),e,-1)}function M(e){A(_.index.add(-1).get(),e,1)}function N(){return _.index.add(1).get()!==L()}function P(){return _.index.add(-1).get()!==L()}function F(){return _.scrollSnapList}function I(){return _.scrollProgress.get(_.offsetLocation.get())}function L(){return _.index.get()}function ee(){return _.indexPrevious.get()}function te(){return _.slidesInView.get()}function ne(){return _.slidesInView.get(!1)}function R(){return x}function re(){return _}function z(){return e}function ie(){return S}function ae(){return C}let oe={canScrollNext:N,canScrollPrev:P,containerNode:ie,internalEngine:re,destroy:k,off:p,on:f,emit:m,plugins:R,previousScrollSnap:ee,reInit:h,rootNode:z,scrollNext:j,scrollPrev:M,scrollProgress:I,scrollSnapList:F,scrollTo:A,selectedScrollSnap:L,slideNodes:ae,slidesInView:te,slidesNotInView:ne};return E(t,n),setTimeout(()=>c.emit(`init`),0),oe}rS.globalOptions=void 0;function iS(e={},t=[]){let n=(0,V.useRef)(e),r=(0,V.useRef)(t),[i,a]=(0,V.useState)(),[o,s]=(0,V.useState)(),c=(0,V.useCallback)(()=>{i&&i.reInit(n.current,r.current)},[i]);return(0,V.useEffect)(()=>{ix(n.current,e)||(n.current=e,c())},[e,c]),(0,V.useEffect)(()=>{ox(r.current,t)||(r.current=t,c())},[t,c]),(0,V.useEffect)(()=>{if(rx()&&o){rS.globalOptions=iS.globalOptions;let e=rS(o,n.current,r.current);return a(e),()=>e.destroy()}a(void 0)},[o,a]),[s,i]}iS.globalOptions=void 0;function aS(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var oS=V.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:`bottom`,shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),sS=()=>{let e=V.useContext(oS);if(!e)throw Error(`useDrawerContext must be used within a Drawer.Root`);return e};aS(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(
176
+ [data-state=closed]
177
+ ){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}`);function cS(){let e=navigator.userAgent;return typeof window<`u`&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))}function lS(){return mS(/^Mac/)}function uS(){return mS(/^iPhone/)}function dS(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function fS(){return mS(/^iPad/)||lS()&&navigator.maxTouchPoints>1}function pS(){return uS()||fS()}function mS(e){return typeof window<`u`&&window.navigator!=null?e.test(window.navigator.platform):void 0}var hS=24,gS=typeof window<`u`?V.useLayoutEffect:V.useEffect;function _S(...e){return(...t)=>{for(let n of e)typeof n==`function`&&n(...t)}}var vS=typeof document<`u`&&window.visualViewport;function yS(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function bS(e){for(yS(e)&&(e=e.parentElement);e&&!yS(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}var xS=new Set([`checkbox`,`radio`,`range`,`color`,`file`,`image`,`button`,`submit`,`reset`]),SS=0,CS;function wS(e={}){let{isDisabled:t}=e;gS(()=>{if(!t)return SS++,SS===1&&pS()&&(CS=TS()),()=>{SS--,SS===0&&CS?.()}},[t])}function TS(){let e,t=0,n=n=>{e=bS(n.target),(e!==document.documentElement||e!==document.body)&&(t=n.changedTouches[0].pageY)},r=n=>{if(!e||e===document.documentElement||e===document.body){n.preventDefault();return}let r=n.changedTouches[0].pageY,i=e.scrollTop,a=e.scrollHeight-e.clientHeight;a!==0&&((i<=0&&r>t||i>=a&&r<t)&&n.preventDefault(),t=r)},i=e=>{let t=e.target;kS(t)&&t!==document.activeElement&&(e.preventDefault(),t.style.transform=`translateY(-2000px)`,t.focus(),requestAnimationFrame(()=>{t.style.transform=``}))},a=e=>{let t=e.target;kS(t)&&(t.style.transform=`translateY(-2000px)`,requestAnimationFrame(()=>{t.style.transform=``,vS&&(vS.height<window.innerHeight?requestAnimationFrame(()=>{OS(t)}):vS.addEventListener(`resize`,()=>OS(t),{once:!0}))}))},o=()=>{window.scrollTo(0,0)},s=window.pageXOffset,c=window.pageYOffset,l=_S(ES(document.documentElement,`paddingRight`,`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let u=_S(DS(document,`touchstart`,n,{passive:!1,capture:!0}),DS(document,`touchmove`,r,{passive:!1,capture:!0}),DS(document,`touchend`,i,{passive:!1,capture:!0}),DS(document,`focus`,a,!0),DS(window,`scroll`,o));return()=>{l(),u(),window.scrollTo(s,c)}}function ES(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function DS(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function OS(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let t=bS(e);if(t!==document.documentElement&&t!==document.body&&t!==e){let n=t.getBoundingClientRect().top,r=e.getBoundingClientRect().top;e.getBoundingClientRect().bottom>t.getBoundingClientRect().bottom+hS&&(t.scrollTop+=r-n)}e=t.parentElement}}function kS(e){return e instanceof HTMLInputElement&&!xS.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function AS(e,t){typeof e==`function`?e(t):e!=null&&(e.current=t)}function jS(...e){return t=>e.forEach(e=>AS(e,t))}function MS(...e){return V.useCallback(jS(...e),e)}var NS=new WeakMap;function PS(e,t,n=!1){if(!e||!(e instanceof HTMLElement))return;let r={};Object.entries(t).forEach(([t,n])=>{t.startsWith(`--`)?e.style.setProperty(t,n):(r[t]=e.style[t],e.style[t]=n)}),n||NS.set(e,r)}function FS(e,t){if(!e||!(e instanceof HTMLElement))return;let n=NS.get(e);n&&(e.style[t]=n[t])}var IS=e=>{switch(e){case`top`:case`bottom`:return!0;case`left`:case`right`:return!1;default:return e}};function LS(e,t){if(!e)return null;let n=window.getComputedStyle(e),r=n.transform||n.webkitTransform||n.mozTransform,i=r.match(/^matrix3d\((.+)\)$/);return i?parseFloat(i[1].split(`, `)[IS(t)?13:12]):(i=r.match(/^matrix\((.+)\)$/),i?parseFloat(i[1].split(`, `)[IS(t)?5:4]):null)}function RS(e){return 8*(Math.log(e+1)-2)}function zS(e,t){if(!e)return()=>{};let n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}var Q={DURATION:.5,EASE:[.32,.72,0,1]},BS=.4,VS=.25,HS=100,US=8,WS=16,GS=26,KS=`vaul-dragging`;function qS(e){let t=V.useRef(e);return V.useEffect(()=>{t.current=e}),V.useMemo(()=>(...e)=>t.current==null?void 0:t.current.call(t,...e),[])}function JS({defaultProp:e,onChange:t}){let n=V.useState(e),[r]=n,i=V.useRef(r),a=qS(t);return V.useEffect(()=>{i.current!==r&&(a(r),i.current=r)},[r,i,a]),n}function YS({prop:e,defaultProp:t,onChange:n=()=>{}}){let[r,i]=JS({defaultProp:t,onChange:n}),a=e!==void 0,o=a?e:r,s=qS(n);return[o,V.useCallback(t=>{if(a){let n=typeof t==`function`?t(e):t;n!==e&&s(n)}else i(t)},[a,e,i,s])]}function XS({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:n,drawerRef:r,overlayRef:i,fadeFromIndex:a,onSnapPointChange:o,direction:s=`bottom`,container:c,snapToSequentialPoint:l}){let[u,d]=YS({prop:e,defaultProp:n?.[0],onChange:t}),[f,p]=V.useState(typeof window<`u`?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);V.useEffect(()=>{function e(){p({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]);let m=V.useMemo(()=>u===n?.[n.length-1]||null,[n,u]),h=V.useMemo(()=>n?.findIndex(e=>e===u)??null,[n,u]),g=n&&n.length>0&&(a||a===0)&&!Number.isNaN(a)&&n[a]===u||!n,_=V.useMemo(()=>{let e=c?{width:c.getBoundingClientRect().width,height:c.getBoundingClientRect().height}:typeof window<`u`?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};return n?.map(t=>{let n=typeof t==`string`,r=0;if(n&&(r=parseInt(t,10)),IS(s)){let i=n?r:f?t*e.height:0;return f?s===`bottom`?e.height-i:-e.height+i:i}let i=n?r:f?t*e.width:0;return f?s===`right`?e.width-i:-e.width+i:i})??[]},[n,f,c]),v=V.useMemo(()=>h===null?null:_?.[h],[_,h]),y=V.useCallback(e=>{let t=_?.findIndex(t=>t===e)??null;o(t),PS(r.current,{transition:`transform ${Q.DURATION}s cubic-bezier(${Q.EASE.join(`,`)})`,transform:IS(s)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`}),_&&t!==_.length-1&&a!==void 0&&t!==a&&t<a?PS(i.current,{transition:`opacity ${Q.DURATION}s cubic-bezier(${Q.EASE.join(`,`)})`,opacity:`0`}):PS(i.current,{transition:`opacity ${Q.DURATION}s cubic-bezier(${Q.EASE.join(`,`)})`,opacity:`1`}),d(n?.[Math.max(t,0)])},[r.current,n,_,a,i,d]);V.useEffect(()=>{if(u||e){let t=n?.findIndex(t=>t===e||t===u)??-1;_&&t!==-1&&typeof _[t]==`number`&&y(_[t])}},[u,e,n,_,y]);function b({draggedDistance:e,closeDrawer:t,velocity:r,dismissible:o}){if(a===void 0)return;let c=s===`bottom`||s===`right`?(v??0)-e:(v??0)+e,u=h===a-1,d=h===0,f=e>0;if(u&&PS(i.current,{transition:`opacity ${Q.DURATION}s cubic-bezier(${Q.EASE.join(`,`)})`}),!l&&r>2&&!f){o?t():y(_[0]);return}if(!l&&r>2&&f&&_&&n){y(_[n.length-1]);return}let p=_?.reduce((e,t)=>typeof e!=`number`||typeof t!=`number`?e:Math.abs(t-c)<Math.abs(e-c)?t:e),g=IS(s)?window.innerHeight:window.innerWidth;if(r>BS&&Math.abs(e)<g*.4){let e=f?1:-1;if(e>0&&m&&n){y(_[n.length-1]);return}if(d&&e<0&&o&&t(),h===null)return;y(_[h+e])}else y(p)}function x({draggedDistance:e}){if(v===null)return;let t=s===`bottom`||s===`right`?v-e:v+e;(s===`bottom`||s===`right`)&&t<_[_.length-1]||(s===`top`||s===`left`)&&t>_[_.length-1]||PS(r.current,{transform:IS(s)?`translate3d(0, ${t}px, 0)`:`translate3d(${t}px, 0, 0)`})}function S(e,t){if(!n||typeof h!=`number`||!_||a===void 0)return null;let r=h===a-1;if(h>=a&&t)return 0;if(r&&!t)return 1;if(!g&&!r)return null;let i=r?h+1:h-1,o=r?_[i]-_[i-1]:_[i+1]-_[i],s=e/Math.abs(o);return r?1-s:s}return{isLastSnapPoint:m,activeSnapPoint:u,shouldFade:g,getPercentageDragged:S,setActiveSnapPoint:d,activeSnapPointIndex:h,onRelease:b,onDrag:x,snapPointsOffset:_}}function ZS(){let{direction:e,isOpen:t,shouldScaleBackground:n,setBackgroundColorOnScale:r,noBodyStyles:i}=sS(),a=V.useRef(null),o=(0,V.useMemo)(()=>document.body.style.backgroundColor,[]);function s(){return(window.innerWidth-GS)/window.innerWidth}V.useEffect(()=>{if(t&&n){a.current&&clearTimeout(a.current);let t=document.querySelector(`[data-vaul-drawer-wrapper]`)||document.querySelector(`[vaul-drawer-wrapper]`);if(!t)return;r&&!i&&zS(document.body,{background:`black`}),zS(t,{transformOrigin:IS(e)?`top`:`left`,transitionProperty:`transform, border-radius`,transitionDuration:`${Q.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Q.EASE.join(`,`)})`});let n=zS(t,{borderRadius:`${US}px`,overflow:`hidden`,...IS(e)?{transform:`scale(${s()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${s()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{n(),a.current=window.setTimeout(()=>{o?document.body.style.background=o:document.body.style.removeProperty(`background`)},Q.DURATION*1e3)}}},[t,n,o])}var QS=null;function $S({isOpen:e,modal:t,nested:n,hasBeenOpened:r,preventScrollRestoration:i,noBodyStyles:a}){let[o,s]=V.useState(()=>typeof window<`u`?window.location.href:``),c=V.useRef(0),l=V.useCallback(()=>{if(dS()&&QS===null&&e&&!a){QS={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:`unset`};let{scrollX:e,innerHeight:t}=window;document.body.style.setProperty(`position`,`fixed`,`important`),Object.assign(document.body.style,{top:`${-c.current}px`,left:`${-e}px`,right:`0px`,height:`auto`}),window.setTimeout(()=>window.requestAnimationFrame(()=>{let e=t-window.innerHeight;e&&c.current>=t&&(document.body.style.top=`${-(c.current+e)}px`)}),300)}},[e]),u=V.useCallback(()=>{if(dS()&&QS!==null&&!a){let e=-parseInt(document.body.style.top,10),t=-parseInt(document.body.style.left,10);Object.assign(document.body.style,QS),window.requestAnimationFrame(()=>{i&&o!==window.location.href?s(window.location.href):window.scrollTo(t,e)}),QS=null}},[o]);return V.useEffect(()=>{function e(){c.current=window.scrollY}return e(),window.addEventListener(`scroll`,e),()=>{window.removeEventListener(`scroll`,e)}},[]),V.useEffect(()=>{if(t)return()=>{typeof document<`u`&&(document.querySelector(`[data-vaul-drawer]`)||u())}},[t,u]),V.useEffect(()=>{!n&&r&&(e?(!window.matchMedia(`(display-mode: standalone)`).matches&&l(),t||window.setTimeout(()=>{u()},500)):u())},[e,r,o,t,n,l,u]),{restorePositionSetting:u}}function eC({open:e,onOpenChange:t,children:n,onDrag:r,onRelease:i,snapPoints:a,shouldScaleBackground:o=!1,setBackgroundColorOnScale:s=!0,closeThreshold:c=VS,scrollLockTimeout:l=HS,dismissible:u=!0,handleOnly:d=!1,fadeFromIndex:f=a&&a.length-1,activeSnapPoint:p,setActiveSnapPoint:m,fixed:h,modal:g=!0,onClose:_,nested:v,noBodyStyles:y=!1,direction:b=`bottom`,defaultOpen:x=!1,disablePreventScroll:S=!0,snapToSequentialPoint:C=!1,preventScrollRestoration:w=!1,repositionInputs:T=!0,onAnimationEnd:E,container:D,autoFocus:O=!1}){let[k=!1,A]=YS({defaultProp:x,prop:e,onChange:e=>{t?.(e),!e&&!v&&ye(),setTimeout(()=>{E?.(e)},Q.DURATION*1e3),e&&!g&&typeof window<`u`&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents=`auto`}),e||(document.body.style.pointerEvents=`auto`)}}),[j,M]=V.useState(!1),[N,P]=V.useState(!1),[F,I]=V.useState(!1),L=V.useRef(null),ee=V.useRef(null),te=V.useRef(null),ne=V.useRef(null),R=V.useRef(null),re=V.useRef(!1),z=V.useRef(null),ie=V.useRef(0),ae=V.useRef(!1),oe=V.useRef(!x),se=V.useRef(0),B=V.useRef(null),ce=V.useRef(B.current?.getBoundingClientRect().height||0),le=V.useRef(B.current?.getBoundingClientRect().width||0),ue=V.useRef(0),{activeSnapPoint:de,activeSnapPointIndex:fe,setActiveSnapPoint:pe,onRelease:me,snapPointsOffset:he,onDrag:ge,shouldFade:_e,getPercentageDragged:ve}=XS({snapPoints:a,activeSnapPointProp:p,setActiveSnapPointProp:m,drawerRef:B,fadeFromIndex:f,overlayRef:L,onSnapPointChange:V.useCallback(e=>{a&&e===he.length-1&&(ee.current=new Date)},[]),direction:b,container:D,snapToSequentialPoint:C});wS({isDisabled:!k||N||!g||F||!j||!T||!S});let{restorePositionSetting:ye}=$S({isOpen:k,modal:g,nested:v??!1,hasBeenOpened:j,preventScrollRestoration:w,noBodyStyles:y});function be(){return(window.innerWidth-GS)/window.innerWidth}function xe(e){(u||a)&&(!B.current||B.current.contains(e.target))&&(ce.current=B.current?.getBoundingClientRect().height||0,le.current=B.current?.getBoundingClientRect().width||0,P(!0),te.current=new Date,pS()&&window.addEventListener(`touchend`,()=>re.current=!1,{once:!0}),e.target.setPointerCapture(e.pointerId),ie.current=IS(b)?e.pageY:e.pageX)}function Se(e,t){let n=e,r=window.getSelection()?.toString(),i=B.current?LS(B.current,b):null,a=new Date;if(n.tagName===`SELECT`||n.hasAttribute(`data-vaul-no-drag`)||n.closest(`[data-vaul-no-drag]`))return!1;if(b===`right`||b===`left`)return!0;if(ee.current&&a.getTime()-ee.current.getTime()<500)return!1;if(i!==null&&(b===`bottom`?i>0:i<0))return!0;if(r&&r.length>0)return!1;if(R.current&&a.getTime()-R.current.getTime()<l&&i===0||t)return R.current=a,!1;for(;n;){if(n.scrollHeight>n.clientHeight){if(n.scrollTop!==0)return R.current=new Date,!1;if(n.getAttribute(`role`)===`dialog`)return!0}n=n.parentNode}return!0}function Ce(e){if(B.current&&N){let t=b===`bottom`||b===`right`?1:-1,n=(ie.current-(IS(b)?e.pageY:e.pageX))*t,i=n>0,s=a&&!u&&!i;if(s&&fe===0)return;let c=Math.abs(n),l=document.querySelector(`[data-vaul-drawer-wrapper]`),d=c/(b===`bottom`||b===`top`?ce.current:le.current),p=ve(c,i);if(p!==null&&(d=p),s&&d>=1||!re.current&&!Se(e.target,i))return;if(B.current.classList.add(KS),re.current=!0,PS(B.current,{transition:`none`}),PS(L.current,{transition:`none`}),a&&ge({draggedDistance:n}),i&&!a){let e=RS(n),r=Math.min(e*-1,0)*t;PS(B.current,{transform:IS(b)?`translate3d(0, ${r}px, 0)`:`translate3d(${r}px, 0, 0)`});return}let m=1-d;if((_e||f&&fe===f-1)&&(r?.(e,d),PS(L.current,{opacity:`${m}`,transition:`none`},!0)),l&&L.current&&o){let e=Math.min(be()+d*(1-be()),1),t=8-d*8,n=Math.max(0,14-d*14);PS(l,{borderRadius:`${t}px`,transform:IS(b)?`scale(${e}) translate3d(0, ${n}px, 0)`:`scale(${e}) translate3d(${n}px, 0, 0)`,transition:`none`},!0)}if(!a){let e=c*t;PS(B.current,{transform:IS(b)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})}}}V.useEffect(()=>{window.requestAnimationFrame(()=>{oe.current=!0})},[]),V.useEffect(()=>{var e;function t(){if(!B.current||!T)return;let e=document.activeElement;if(kS(e)||ae.current){let e=window.visualViewport?.height||0,t=window.innerHeight,n=t-e,r=B.current.getBoundingClientRect().height||0,i=r>t*.8;ue.current||=r;let o=B.current.getBoundingClientRect().top;if(Math.abs(se.current-n)>60&&(ae.current=!ae.current),a&&a.length>0&&he&&fe){let e=he[fe]||0;n+=e}if(se.current=n,r>e||ae.current){let t=B.current.getBoundingClientRect().height,r=t;t>e&&(r=e-(i?o:GS)),h?B.current.style.height=`${t-Math.max(n,0)}px`:B.current.style.height=`${Math.max(r,e-o)}px`}else cS()||(B.current.style.height=`${ue.current}px`);a&&a.length>0&&!ae.current?B.current.style.bottom=`0px`:B.current.style.bottom=`${Math.max(n,0)}px`}}return(e=window.visualViewport)==null||e.addEventListener(`resize`,t),()=>window.visualViewport?.removeEventListener(`resize`,t)},[fe,a,he]);function we(e){Ee(),_?.(),e||A(!1),setTimeout(()=>{a&&pe(a[0])},Q.DURATION*1e3)}function Te(){if(!B.current)return;let e=document.querySelector(`[data-vaul-drawer-wrapper]`),t=LS(B.current,b);PS(B.current,{transform:`translate3d(0, 0, 0)`,transition:`transform ${Q.DURATION}s cubic-bezier(${Q.EASE.join(`,`)})`}),PS(L.current,{transition:`opacity ${Q.DURATION}s cubic-bezier(${Q.EASE.join(`,`)})`,opacity:`1`}),o&&t&&t>0&&k&&PS(e,{borderRadius:`${US}px`,overflow:`hidden`,...IS(b)?{transform:`scale(${be()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:`top`}:{transform:`scale(${be()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:`left`},transitionProperty:`transform, border-radius`,transitionDuration:`${Q.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Q.EASE.join(`,`)})`},!0)}function Ee(){N&&B.current&&(B.current.classList.remove(KS),re.current=!1,P(!1),ne.current=new Date)}function De(e){if(!N||!B.current)return;B.current.classList.remove(KS),re.current=!1,P(!1),ne.current=new Date;let t=LS(B.current,b);if(!e||!Se(e.target,!1)||!t||Number.isNaN(t)||te.current===null)return;let n=ne.current.getTime()-te.current.getTime(),r=ie.current-(IS(b)?e.pageY:e.pageX),o=Math.abs(r)/n;if(o>.05&&(I(!0),setTimeout(()=>{I(!1)},200)),a){me({draggedDistance:r*(b===`bottom`||b===`right`?1:-1),closeDrawer:we,velocity:o,dismissible:u}),i?.(e,!0);return}if(b===`bottom`||b===`right`?r>0:r<0){Te(),i?.(e,!0);return}if(o>BS){we(),i?.(e,!1);return}let s=Math.min(B.current.getBoundingClientRect().height??0,window.innerHeight),l=Math.min(B.current.getBoundingClientRect().width??0,window.innerWidth);Math.abs(t)>=(b===`left`||b===`right`?l:s)*c?(we(),i?.(e,!1)):(i?.(e,!0),Te())}V.useEffect(()=>(k&&(PS(document.documentElement,{scrollBehavior:`auto`}),ee.current=new Date),()=>{FS(document.documentElement,`scrollBehavior`)}),[k]);function Oe(e){let t=e?(window.innerWidth-WS)/window.innerWidth:1,n=e?-16:0;z.current&&window.clearTimeout(z.current),PS(B.current,{transition:`transform ${Q.DURATION}s cubic-bezier(${Q.EASE.join(`,`)})`,transform:IS(b)?`scale(${t}) translate3d(0, ${n}px, 0)`:`scale(${t}) translate3d(${n}px, 0, 0)`}),!e&&B.current&&(z.current=setTimeout(()=>{let e=LS(B.current,b);PS(B.current,{transition:`none`,transform:IS(b)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})},500))}function ke(e,t){if(t<0)return;let n=(window.innerWidth-WS)/window.innerWidth,r=n+t*(1-n),i=-16+t*WS;PS(B.current,{transform:IS(b)?`scale(${r}) translate3d(0, ${i}px, 0)`:`scale(${r}) translate3d(${i}px, 0, 0)`,transition:`none`})}function Ae(e,t){let n=IS(b)?window.innerHeight:window.innerWidth,r=t?(n-WS)/n:1,i=t?-16:0;t&&PS(B.current,{transition:`transform ${Q.DURATION}s cubic-bezier(${Q.EASE.join(`,`)})`,transform:IS(b)?`scale(${r}) translate3d(0, ${i}px, 0)`:`scale(${r}) translate3d(${i}px, 0, 0)`})}return V.useEffect(()=>{g||window.requestAnimationFrame(()=>{document.body.style.pointerEvents=`auto`})},[g]),V.createElement(Yl,{defaultOpen:x,onOpenChange:e=>{(u||e)&&(e?M(!0):we(!0),A(e))},open:k},V.createElement(oS.Provider,{value:{activeSnapPoint:de,snapPoints:a,setActiveSnapPoint:pe,drawerRef:B,overlayRef:L,onOpenChange:t,onPress:xe,onRelease:De,onDrag:Ce,dismissible:u,shouldAnimate:oe,handleOnly:d,isOpen:k,isDragging:N,shouldFade:_e,closeDrawer:we,onNestedDrag:ke,onNestedOpenChange:Oe,onNestedRelease:Ae,keyboardIsOpen:ae,modal:g,snapPointsOffset:he,activeSnapPointIndex:fe,direction:b,shouldScaleBackground:o,setBackgroundColorOnScale:s,noBodyStyles:y,container:D,autoFocus:O}},n))}var tC=V.forwardRef(function({...e},t){let{overlayRef:n,snapPoints:r,onRelease:i,shouldFade:a,isOpen:o,modal:s,shouldAnimate:c}=sS(),l=MS(t,n),u=r&&r.length>0;if(!s)return null;let d=V.useCallback(e=>i(e),[i]);return V.createElement(ru,{onMouseUp:d,ref:l,"data-vaul-overlay":``,"data-vaul-snap-points":o&&u?`true`:`false`,"data-vaul-snap-points-overlay":o&&a?`true`:`false`,"data-vaul-animate":c?.current?`true`:`false`,...e})});tC.displayName=`Drawer.Overlay`;var nC=V.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:n,...r},i){let{drawerRef:a,onPress:o,onRelease:s,onDrag:c,keyboardIsOpen:l,snapPointsOffset:u,activeSnapPointIndex:d,modal:f,isOpen:p,direction:m,snapPoints:h,container:g,handleOnly:_,shouldAnimate:v,autoFocus:y}=sS(),[b,x]=V.useState(!1),S=MS(i,a),C=V.useRef(null),w=V.useRef(null),T=V.useRef(!1),E=h&&h.length>0;ZS();let D=(e,t,n=0)=>{if(T.current)return!0;let r=Math.abs(e.y),i=Math.abs(e.x),a=i>r,o=[`bottom`,`right`].includes(t)?1:-1;if(t===`left`||t===`right`){if(!(e.x*o<0)&&i>=0&&i<=n)return a}else if(!(e.y*o<0)&&r>=0&&r<=n)return!a;return T.current=!0,!0};V.useEffect(()=>{E&&window.requestAnimationFrame(()=>{x(!0)})},[]);function O(e){C.current=null,T.current=!1,s(e)}return V.createElement(su,{"data-vaul-drawer-direction":m,"data-vaul-drawer":``,"data-vaul-delayed-snap-points":b?`true`:`false`,"data-vaul-snap-points":p&&E?`true`:`false`,"data-vaul-custom-container":g?`true`:`false`,"data-vaul-animate":v?.current?`true`:`false`,...r,ref:S,style:u&&u.length>0?{"--snap-point-height":`${u[d??0]}px`,...t}:t,onPointerDown:e=>{_||(r.onPointerDown==null||r.onPointerDown.call(r,e),C.current={x:e.pageX,y:e.pageY},o(e))},onOpenAutoFocus:e=>{n?.(e),y||e.preventDefault()},onPointerDownOutside:t=>{e?.(t),!f||t.defaultPrevented?t.preventDefault():l.current&&=!1},onFocusOutside:e=>{f||e.preventDefault()},onPointerMove:e=>{if(w.current=e,_||(r.onPointerMove==null||r.onPointerMove.call(r,e),!C.current))return;let t=e.pageY-C.current.y,n=e.pageX-C.current.x,i=e.pointerType===`touch`?10:2;D({x:n,y:t},m,i)?c(e):(Math.abs(n)>i||Math.abs(t)>i)&&(C.current=null)},onPointerUp:e=>{r.onPointerUp==null||r.onPointerUp.call(r,e),C.current=null,T.current=!1,s(e)},onPointerOut:e=>{r.onPointerOut==null||r.onPointerOut.call(r,e),O(w.current)},onContextMenu:e=>{r.onContextMenu==null||r.onContextMenu.call(r,e),w.current&&O(w.current)}})});nC.displayName=`Drawer.Content`;var rC=250,iC=120,aC=V.forwardRef(function({preventCycle:e=!1,children:t,...n},r){let{closeDrawer:i,isDragging:a,snapPoints:o,activeSnapPoint:s,setActiveSnapPoint:c,dismissible:l,handleOnly:u,isOpen:d,onPress:f,onDrag:p}=sS(),m=V.useRef(null),h=V.useRef(!1);function g(){h.current?y():window.setTimeout(()=>{_()},iC)}function _(){if(a||e||h.current){y();return}if(y(),!o||o.length===0){l||i();return}if(s===o[o.length-1]&&l){i();return}let t=o.findIndex(e=>e===s);if(t===-1)return;let n=o[t+1];c(n)}function v(){m.current=window.setTimeout(()=>{h.current=!0},rC)}function y(){m.current&&window.clearTimeout(m.current),h.current=!1}return V.createElement(`div`,{onClick:g,onPointerCancel:y,onPointerDown:e=>{u&&f(e),v()},onPointerMove:e=>{u&&p(e)},ref:r,"data-vaul-drawer-visible":d?`true`:`false`,"data-vaul-handle":``,"aria-hidden":`true`,...n},V.createElement(`span`,{"data-vaul-handle-hitarea":``,"aria-hidden":`true`},t))});aC.displayName=`Drawer.Handle`;function oC({onDrag:e,onOpenChange:t,open:n,...r}){let{onNestedDrag:i,onNestedOpenChange:a,onNestedRelease:o}=sS();if(!i)throw Error(`Drawer.NestedRoot must be placed in another drawer`);return V.createElement(eC,{nested:!0,open:n,onClose:()=>{a(!1)},onDrag:(t,n)=>{i(t,n),e?.(t,n)},onOpenChange:e=>{e&&a(e),t?.(e)},onRelease:o,...r})}function sC(e){let t=sS(),{container:n=t.container,...r}=e;return V.createElement(tu,{container:n,...r})}var cC={Root:eC,NestedRoot:oC,Content:nC,Overlay:tC,Trigger:Zl,Portal:sC,Handle:aC,Close:mu,Title:du,Description:fu};function $(...e){return i(r(e))}var lC=na(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/90`,destructive:`bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60`,outline:`border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 px-4 py-2 has-[>svg]:px-3`,xs:`h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5`,lg:`h-10 rounded-md px-6 has-[>svg]:px-4`,icon:`size-9`,"icon-xs":`size-6 rounded-md [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-8`,"icon-lg":`size-10`}},defaultVariants:{variant:`default`,size:`default`}});function uC({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){let a=r?da:`button`;return(0,H.jsx)(a,{"data-slot":`button`,"data-variant":t,"data-size":n,className:$(lC({variant:t,size:n,className:e})),...i})}function dC({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`card`,className:$(`bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm`,e),...t})}function fC({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`card-header`,className:$(`@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6`,e),...t})}function pC({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`card-title`,className:$(`leading-none font-semibold`,e),...t})}function mC({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`card-description`,className:$(`text-muted-foreground text-sm`,e),...t})}function hC({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`card-content`,className:$(`px-6`,e),...t})}function gC({className:e,type:t,...n}){return(0,H.jsx)(`input`,{type:t,"data-slot":`input`,className:$(`file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,`focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]`,`aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive`,e),...n})}function _C({className:e,...t}){return(0,H.jsx)(Dh,{"data-slot":`label`,className:$(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}function vC({className:e,...t}){return(0,H.jsx)(`textarea`,{"data-slot":`textarea`,className:$(`border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,e),...t})}function yC({className:e,...t}){return(0,H.jsx)(Ju,{"data-slot":`checkbox`,className:$(`peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50`,e),...t,children:(0,H.jsx)(Xu,{"data-slot":`checkbox-indicator`,className:`grid place-content-center text-current transition-none`,children:(0,H.jsx)(qb,{className:`size-3.5`})})})}function bC({className:e,size:t=`default`,...n}){return(0,H.jsx)(fy,{"data-slot":`switch`,"data-size":t,className:$(`peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 group/switch inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6`,e),...n,children:(0,H.jsx)(my,{"data-slot":`switch-thumb`,className:$(`bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block rounded-full ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0`)})})}function xC({className:e,value:t,...n}){return(0,H.jsx)(cg,{"data-slot":`progress`,className:$(`bg-primary/20 relative h-2 w-full overflow-hidden rounded-full`,e),...n,children:(0,H.jsx)(ug,{"data-slot":`progress-indicator`,className:`bg-primary h-full w-full flex-1 transition-all`,style:{transform:`translateX(-${100-(t||0)}%)`}})})}function SC({className:e,orientation:t=`horizontal`,decorative:n=!0,...r}){return(0,H.jsx)(lv,{"data-slot":`separator`,decorative:n,orientation:t,className:$(`bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px`,e),...r})}var CC=na(`relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current`,{variants:{variant:{default:`bg-card text-card-foreground`,destructive:`text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90`}},defaultVariants:{variant:`default`}});function wC({className:e,variant:t,...n}){return(0,H.jsx)(`div`,{"data-slot":`alert`,role:`alert`,className:$(CC({variant:t}),e),...n})}function TC({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`alert-title`,className:$(`col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight`,e),...t})}function EC({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`alert-description`,className:$(`text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed`,e),...t})}function DC({...e}){return(0,H.jsx)(Yl,{"data-slot":`dialog`,...e})}function OC({...e}){return(0,H.jsx)(tu,{"data-slot":`dialog-portal`,...e})}function kC({className:e,...t}){return(0,H.jsx)(ru,{"data-slot":`dialog-overlay`,className:$(`data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50`,e),...t})}function AC({className:e,children:t,showCloseButton:n=!0,...r}){return(0,H.jsxs)(OC,{"data-slot":`dialog-portal`,children:[(0,H.jsx)(kC,{}),(0,H.jsxs)(su,{"data-slot":`dialog-content`,className:$(`bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg`,e),...r,children:[t,n&&(0,H.jsxs)(mu,{"data-slot":`dialog-close`,className:`ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,children:[(0,H.jsx)(ex,{}),(0,H.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function jC({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`dialog-header`,className:$(`flex flex-col gap-2 text-center sm:text-left`,e),...t})}function MC({className:e,...t}){return(0,H.jsx)(du,{"data-slot":`dialog-title`,className:$(`text-lg leading-none font-semibold`,e),...t})}function NC({className:e,...t}){return(0,H.jsx)(fu,{"data-slot":`dialog-description`,className:$(`text-muted-foreground text-sm`,e),...t})}function PC({...e}){return(0,H.jsx)(us,{"data-slot":`accordion`,...e})}function FC({className:e,...t}){return(0,H.jsx)(Cs,{"data-slot":`accordion-item`,className:$(`border-b last:border-b-0`,e),...t})}function IC({className:e,children:t,...n}){return(0,H.jsx)(Ts,{className:`flex`,children:(0,H.jsxs)(Ds,{"data-slot":`accordion-trigger`,className:$(`focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180`,e),...n,children:[t,(0,H.jsx)(Jb,{className:`text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200`})]})})}function LC({className:e,children:t,...n}){return(0,H.jsx)(ks,{"data-slot":`accordion-content`,className:`data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm`,...n,children:(0,H.jsx)(`div`,{className:$(`pt-0 pb-4`,e),children:t})})}function RC({className:e,...t}){return(0,H.jsx)(Eu,{"data-slot":`avatar`,className:$(`relative flex size-10 shrink-0 overflow-hidden rounded-full`,e),...t})}function zC({className:e,...t}){return(0,H.jsx)(Ou,{"data-slot":`avatar-image`,className:$(`aspect-square size-full`,e),...t})}function BC({className:e,...t}){return(0,H.jsx)(Au,{"data-slot":`avatar-fallback`,className:$(`bg-muted flex size-full items-center justify-center rounded-full`,e),...t})}var VC=na(`inline-flex items-center justify-center rounded-full border border-transparent px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden`,{variants:{variant:{default:`bg-primary text-primary-foreground [a&]:hover:bg-primary/90`,secondary:`bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90`,destructive:`bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60`,outline:`border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground`}},defaultVariants:{variant:`default`}});function HC({className:e,variant:t=`default`,asChild:n=!1,...r}){let i=n?da:`span`;return(0,H.jsx)(i,{"data-slot":`badge`,"data-variant":t,className:$(VC({variant:t}),e),...r})}function UC({className:e,...t}){return(0,H.jsx)(Hg,{"data-slot":`radio-group`,className:$(`grid gap-3`,e),...t})}function WC({className:e,...t}){return(0,H.jsx)(qg,{"data-slot":`radio-group-item`,className:$(`border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50`,e),...t,children:(0,H.jsx)(Yg,{"data-slot":`radio-group-indicator`,className:`relative flex items-center justify-center`,children:(0,H.jsx)(Qb,{className:`fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2`})})})}function GC({...e}){return(0,H.jsx)(p_,{"data-slot":`select`,...e})}function KC({...e}){return(0,H.jsx)(__,{"data-slot":`select-value`,...e})}function qC({className:e,size:t=`default`,children:n,...r}){return(0,H.jsxs)(h_,{"data-slot":`select-trigger`,"data-size":t,className:$(`border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[n,(0,H.jsx)(v_,{asChild:!0,children:(0,H.jsx)(Jb,{className:`size-4 opacity-50`})})]})}function JC({className:e,children:t,position:n=`item-aligned`,align:r=`center`,...i}){return(0,H.jsx)(x_,{children:(0,H.jsxs)(C_,{"data-slot":`select-content`,className:$(`bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:n,align:r,...i,children:[(0,H.jsx)(XC,{}),(0,H.jsx)(F_,{className:$(`p-1`,n===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1`),children:t}),(0,H.jsx)(ZC,{})]})})}function YC({className:e,children:t,...n}){return(0,H.jsxs)(V_,{"data-slot":`select-item`,className:$(`focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,H.jsx)(`span`,{"data-slot":`select-item-indicator`,className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,H.jsx)(G_,{children:(0,H.jsx)(qb,{className:`size-4`})})}),(0,H.jsx)(U_,{children:t})]})}function XC({className:e,...t}){return(0,H.jsx)(q_,{"data-slot":`select-scroll-up-button`,className:$(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,H.jsx)(Zb,{className:`size-4`})})}function ZC({className:e,...t}){return(0,H.jsx)(Y_,{"data-slot":`select-scroll-down-button`,className:$(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,H.jsx)(Jb,{className:`size-4`})})}var QC=V.createContext(null);function $C(){let e=V.useContext(QC);if(!e)throw Error(`useCarousel must be used within a <Carousel />`);return e}function ew({orientation:e=`horizontal`,opts:t,setApi:n,plugins:r,className:i,children:a,...o}){let[s,c]=iS({...t,axis:e===`horizontal`?`x`:`y`},r),[l,u]=V.useState(!1),[d,f]=V.useState(!1),p=V.useCallback(e=>{e&&(u(e.canScrollPrev()),f(e.canScrollNext()))},[]),m=V.useCallback(()=>{c?.scrollPrev()},[c]),h=V.useCallback(()=>{c?.scrollNext()},[c]),g=V.useCallback(e=>{e.key===`ArrowLeft`?(e.preventDefault(),m()):e.key===`ArrowRight`&&(e.preventDefault(),h())},[m,h]);return V.useEffect(()=>{c&&n&&n(c)},[c,n]),V.useEffect(()=>{if(c)return p(c),c.on(`reInit`,p),c.on(`select`,p),()=>{c?.off(`select`,p)}},[c,p]),(0,H.jsx)(QC.Provider,{value:{carouselRef:s,api:c,opts:t,orientation:e||(t?.axis===`y`?`vertical`:`horizontal`),scrollPrev:m,scrollNext:h,canScrollPrev:l,canScrollNext:d},children:(0,H.jsx)(`div`,{onKeyDownCapture:g,className:$(`relative`,i),role:`region`,"aria-roledescription":`carousel`,"data-slot":`carousel`,...o,children:a})})}function tw({className:e,...t}){let{carouselRef:n,orientation:r}=$C();return(0,H.jsx)(`div`,{ref:n,className:`overflow-hidden`,"data-slot":`carousel-content`,children:(0,H.jsx)(`div`,{className:$(`flex`,r===`horizontal`?`-ml-4`:`-mt-4 flex-col`,e),...t})})}function nw({className:e,...t}){let{orientation:n}=$C();return(0,H.jsx)(`div`,{role:`group`,"aria-roledescription":`slide`,"data-slot":`carousel-item`,className:$(`min-w-0 shrink-0 grow-0 basis-full`,n===`horizontal`?`pl-4`:`pt-4`,e),...t})}function rw({className:e,variant:t=`outline`,size:n=`icon`,...r}){let{orientation:i,scrollPrev:a,canScrollPrev:o}=$C();return(0,H.jsxs)(uC,{"data-slot":`carousel-previous`,variant:t,size:n,className:$(`absolute size-8 rounded-full`,i===`horizontal`?`top-1/2 -left-12 -translate-y-1/2`:`-top-12 left-1/2 -translate-x-1/2 rotate-90`,e),disabled:!o,onClick:a,...r,children:[(0,H.jsx)(Gb,{}),(0,H.jsx)(`span`,{className:`sr-only`,children:`Previous slide`})]})}function iw({className:e,variant:t=`outline`,size:n=`icon`,...r}){let{orientation:i,scrollNext:a,canScrollNext:o}=$C();return(0,H.jsxs)(uC,{"data-slot":`carousel-next`,variant:t,size:n,className:$(`absolute size-8 rounded-full`,i===`horizontal`?`top-1/2 -right-12 -translate-y-1/2`:`-bottom-12 left-1/2 -translate-x-1/2 rotate-90`,e),disabled:!o,onClick:a,...r,children:[(0,H.jsx)(Kb,{}),(0,H.jsx)(`span`,{className:`sr-only`,children:`Next slide`})]})}function aw({...e}){return(0,H.jsx)(zo,{"data-slot":`collapsible`,...e})}function ow({...e}){return(0,H.jsx)(Vo,{"data-slot":`collapsible-trigger`,...e})}function sw({...e}){return(0,H.jsx)(Uo,{"data-slot":`collapsible-content`,...e})}function cw({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`table-container`,className:`relative w-full overflow-x-auto`,children:(0,H.jsx)(`table`,{"data-slot":`table`,className:$(`w-full caption-bottom text-sm`,e),...t})})}function lw({className:e,...t}){return(0,H.jsx)(`thead`,{"data-slot":`table-header`,className:$(`[&_tr]:border-b`,e),...t})}function uw({className:e,...t}){return(0,H.jsx)(`tbody`,{"data-slot":`table-body`,className:$(`[&_tr:last-child]:border-0`,e),...t})}function dw({className:e,...t}){return(0,H.jsx)(`tr`,{"data-slot":`table-row`,className:$(`hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors`,e),...t})}function fw({className:e,...t}){return(0,H.jsx)(`th`,{"data-slot":`table-head`,className:$(`text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,e),...t})}function pw({className:e,...t}){return(0,H.jsx)(`td`,{"data-slot":`table-cell`,className:$(`p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,e),...t})}function mw({className:e,...t}){return(0,H.jsx)(`caption`,{"data-slot":`table-caption`,className:$(`text-muted-foreground mt-4 text-sm`,e),...t})}function hw({...e}){return(0,H.jsx)(cC.Root,{"data-slot":`drawer`,...e})}function gw({...e}){return(0,H.jsx)(cC.Portal,{"data-slot":`drawer-portal`,...e})}function _w({className:e,...t}){return(0,H.jsx)(cC.Overlay,{"data-slot":`drawer-overlay`,className:$(`data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50`,e),...t})}function vw({className:e,children:t,...n}){return(0,H.jsxs)(gw,{"data-slot":`drawer-portal`,children:[(0,H.jsx)(_w,{}),(0,H.jsxs)(cC.Content,{"data-slot":`drawer-content`,className:$(`group/drawer-content bg-background fixed z-50 flex h-auto flex-col`,`data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b`,`data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t`,`data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm`,`data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm`,e),...n,children:[(0,H.jsx)(`div`,{className:`bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block`}),t]})]})}function yw({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`drawer-header`,className:$(`flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left`,e),...t})}function bw({className:e,...t}){return(0,H.jsx)(cC.Title,{"data-slot":`drawer-title`,className:$(`text-foreground font-semibold`,e),...t})}function xw({className:e,...t}){return(0,H.jsx)(cC.Description,{"data-slot":`drawer-description`,className:$(`text-muted-foreground text-sm`,e),...t})}function Sw({...e}){return(0,H.jsx)(yh,{"data-slot":`dropdown-menu`,...e})}function Cw({...e}){return(0,H.jsx)(xh,{"data-slot":`dropdown-menu-trigger`,...e})}function ww({className:e,sideOffset:t=4,...n}){return(0,H.jsx)(Sh,{children:(0,H.jsx)(wh,{"data-slot":`dropdown-menu-content`,sideOffset:t,className:$(`bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md`,e),...n})})}function Tw({className:e,inset:t,variant:n=`default`,...r}){return(0,H.jsx)(Th,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:$(`focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r})}function Ew({className:e,...t}){return(0,H.jsx)(`nav`,{role:`navigation`,"aria-label":`pagination`,"data-slot":`pagination`,className:$(`mx-auto flex w-full justify-center`,e),...t})}function Dw({className:e,...t}){return(0,H.jsx)(`ul`,{"data-slot":`pagination-content`,className:$(`flex flex-row items-center gap-1`,e),...t})}function Ow({...e}){return(0,H.jsx)(`li`,{"data-slot":`pagination-item`,...e})}function kw({className:e,isActive:t,size:n=`icon`,...r}){return(0,H.jsx)(`a`,{"aria-current":t?`page`:void 0,"data-slot":`pagination-link`,"data-active":t,className:$(lC({variant:t?`outline`:`ghost`,size:n}),e),...r})}function Aw({className:e,...t}){return(0,H.jsxs)(kw,{"aria-label":`Go to previous page`,size:`default`,className:$(`gap-1 px-2.5 sm:pl-2.5`,e),...t,children:[(0,H.jsx)(Yb,{}),(0,H.jsx)(`span`,{className:`hidden sm:block`,children:`Previous`})]})}function jw({className:e,...t}){return(0,H.jsxs)(kw,{"aria-label":`Go to next page`,size:`default`,className:$(`gap-1 px-2.5 sm:pr-2.5`,e),...t,children:[(0,H.jsx)(`span`,{className:`hidden sm:block`,children:`Next`}),(0,H.jsx)(Xb,{})]})}function Mw({className:e,...t}){return(0,H.jsxs)(`span`,{"aria-hidden":!0,"data-slot":`pagination-ellipsis`,className:$(`flex size-9 items-center justify-center`,e),...t,children:[(0,H.jsx)($b,{className:`size-4`}),(0,H.jsx)(`span`,{className:`sr-only`,children:`More pages`})]})}function Nw({...e}){return(0,H.jsx)(zh,{"data-slot":`popover`,...e})}function Pw({...e}){return(0,H.jsx)(Vh,{"data-slot":`popover-trigger`,...e})}function Fw({className:e,align:t=`center`,sideOffset:n=4,...r}){return(0,H.jsx)(Gh,{children:(0,H.jsx)(qh,{"data-slot":`popover-content`,align:t,sideOffset:n,className:$(`bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden`,e),...r})})}function Iw({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`skeleton`,className:$(`bg-accent animate-pulse rounded-md`,e),...t})}function Lw({className:e,defaultValue:t,value:n,min:r=0,max:i=100,...a}){let o=V.useMemo(()=>Array.isArray(n)?n:Array.isArray(t)?t:[r,i],[n,t,r,i]);return(0,H.jsxs)(Tv,{"data-slot":`slider`,defaultValue:t,value:n,min:r,max:i,className:$(`relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col`,e),...a,children:[(0,H.jsx)(Mv,{"data-slot":`slider-track`,className:$(`bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5`),children:(0,H.jsx)(Pv,{"data-slot":`slider-range`,className:$(`bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full`)})}),Array.from({length:o.length},(e,t)=>(0,H.jsx)(Vv,{"data-slot":`slider-thumb`,className:`border-primary ring-ring/50 block size-4 shrink-0 rounded-full border bg-white shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50`},t))]})}function Rw({className:e,orientation:t=`horizontal`,...n}){return(0,H.jsx)(Oy,{"data-slot":`tabs`,"data-orientation":t,orientation:t,className:$(`group/tabs flex gap-2 data-[orientation=horizontal]:flex-col`,e),...n})}var zw=na(`rounded-lg p-[3px] group-data-[orientation=horizontal]/tabs:h-9 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function Bw({className:e,variant:t=`default`,...n}){return(0,H.jsx)(Ay,{"data-slot":`tabs-list`,"data-variant":t,className:$(zw({variant:t}),e),...n})}function Vw({className:e,...t}){return(0,H.jsx)(My,{"data-slot":`tabs-trigger`,className:$(`focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent`,`data-[state=active]:bg-background dark:data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 data-[state=active]:text-foreground`,`after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100`,e),...t})}var Hw=na(`inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap`,{variants:{variant:{default:`bg-transparent`,outline:`border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground`},size:{default:`h-9 px-2 min-w-9`,sm:`h-8 px-1.5 min-w-8`,lg:`h-10 px-2.5 min-w-10`}},defaultVariants:{variant:`default`,size:`default`}});function Uw({className:e,variant:t,size:n,...r}){return(0,H.jsx)(Ry,{"data-slot":`toggle`,className:$(Hw({variant:t,size:n,className:e})),...r})}var Ww=V.createContext({size:`default`,variant:`default`,spacing:0});function Gw({className:e,variant:t,size:n,spacing:r=0,children:i,...a}){return(0,H.jsx)(Ky,{"data-slot":`toggle-group`,"data-variant":t,"data-size":n,"data-spacing":r,style:{"--gap":r},className:$(`group/toggle-group flex w-fit items-center gap-[--spacing(var(--gap))] rounded-md data-[spacing=default]:data-[variant=outline]:shadow-xs`,e),...a,children:(0,H.jsx)(Ww.Provider,{value:{variant:t,size:n,spacing:r},children:i})})}function Kw({className:e,children:t,variant:n,size:r,...i}){let a=V.useContext(Ww);return(0,H.jsx)(tb,{"data-slot":`toggle-group-item`,"data-variant":a.variant||n,"data-size":a.size||r,"data-spacing":a.spacing,className:$(Hw({variant:a.variant||n,size:a.size||r}),`w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10`,`data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:first:rounded-l-md data-[spacing=0]:last:rounded-r-md data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:data-[variant=outline]:first:border-l`,e),...i,children:t})}function qw({delayDuration:e=0,...t}){return(0,H.jsx)(pb,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function Jw({...e}){return(0,H.jsx)(_b,{"data-slot":`tooltip`,...e})}function Yw({...e}){return(0,H.jsx)(yb,{"data-slot":`tooltip-trigger`,...e})}function Xw({className:e,sideOffset:t=0,children:n,...r}){return(0,H.jsx)(Cb,{children:(0,H.jsxs)(Tb,{"data-slot":`tooltip-content`,sideOffset:t,className:$(`bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance`,e),...r,children:[n,(0,H.jsx)(kb,{className:`bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]`})]})})}function Zw(e,t){if(t<=7)return Array.from({length:t},(e,t)=>t+1);let n=[];n.push(1),e>3&&n.push(`ellipsis`);let r=Math.max(2,e-1),i=Math.min(t-1,e+1);for(let e=r;e<=i;e++)n.push(e);return e<t-2&&n.push(`ellipsis`),n.push(t),n}var Qw={Card:({props:e,children:t})=>{let n=e.maxWidth===`sm`?`max-w-xs sm:min-w-[280px]`:e.maxWidth===`md`?`max-w-sm sm:min-w-[320px]`:e.maxWidth===`lg`?`max-w-md sm:min-w-[360px]`:`w-full`,r=e.centered?`mx-auto`:``;return(0,H.jsxs)(dC,{className:$(n,r,e.className),children:[(e.title||e.description)&&(0,H.jsxs)(fC,{children:[e.title&&(0,H.jsx)(pC,{children:e.title}),e.description&&(0,H.jsx)(mC,{children:e.description})]}),(0,H.jsx)(hC,{className:`flex flex-col gap-3`,children:t})]})},Stack:({props:e,children:t})=>{let n=e.direction===`horizontal`,r={none:`gap-0`,sm:`gap-2`,md:`gap-3`,lg:`gap-4`,xl:`gap-6`},i={start:`items-start`,center:`items-center`,end:`items-end`,stretch:`items-stretch`},a={start:``,center:`justify-center`,end:`justify-end`,between:`justify-between`,around:`justify-around`},o=r[e.gap??`md`]??`gap-3`,s=i[e.align??`start`]??`items-start`,c=a[e.justify??``]??``;return(0,H.jsx)(`div`,{className:$(`flex`,n?`flex-row flex-wrap`:`flex-col`,o,s,c,e.className),children:t})},Grid:({props:e,children:t})=>{let n={1:`grid-cols-1`,2:`grid-cols-2`,3:`grid-cols-3`,4:`grid-cols-4`,5:`grid-cols-5`,6:`grid-cols-6`},r={sm:`gap-2`,md:`gap-3`,lg:`gap-4`,xl:`gap-6`},i=n[Math.max(1,Math.min(6,e.columns??1))]??`grid-cols-1`,a=r[e.gap??`md`]??`gap-3`;return(0,H.jsx)(`div`,{className:$(`grid`,i,a,e.className),children:t})},Separator:({props:e})=>(0,H.jsx)(SC,{orientation:e.orientation??`horizontal`,className:e.orientation===`vertical`?`h-full mx-2`:`my-3`}),Tabs:({props:e,children:t,bindings:n,emit:r})=>{let i=e.tabs??[],[a,o]=$i(e.value,n?.value),[s,c]=(0,V.useState)(e.defaultValue??i[0]?.value??``),l=!!n?.value,u=l?a??i[0]?.value??``:s,d=l?o:c;return(0,H.jsxs)(Rw,{value:u,onValueChange:e=>{d(e),r(`change`)},children:[(0,H.jsx)(Bw,{children:i.map(e=>(0,H.jsx)(Vw,{value:e.value,children:e.label},e.value))}),t]})},Accordion:({props:e})=>{let t=e.items??[],n=e.type===`multiple`,r=t.map((e,t)=>(0,H.jsxs)(FC,{value:`item-${t}`,children:[(0,H.jsx)(IC,{children:e.title}),(0,H.jsx)(LC,{children:e.content})]},t));return n?(0,H.jsx)(PC,{type:`multiple`,className:`w-full`,children:r}):(0,H.jsx)(PC,{type:`single`,collapsible:!0,className:`w-full`,children:r})},Collapsible:({props:e,children:t})=>{let[n,r]=(0,V.useState)(e.defaultOpen??!1);return(0,H.jsxs)(aw,{open:n,onOpenChange:r,className:`w-full`,children:[(0,H.jsx)(ow,{asChild:!0,children:(0,H.jsxs)(`button`,{className:`flex w-full items-center justify-between rounded-md border border-border px-4 py-2 text-sm font-medium hover:bg-muted transition-colors`,children:[e.title,(0,H.jsx)(`svg`,{className:`h-4 w-4 transition-transform ${n?`rotate-180`:``}`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,children:(0,H.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M19 9l-7 7-7-7`})})]})}),(0,H.jsx)(sw,{className:`pt-2`,children:t})]})},Dialog:({props:e,children:t})=>{let[n,r]=Di(e.openPath??``);return(0,H.jsx)(DC,{open:n??!1,onOpenChange:e=>r(e),children:(0,H.jsxs)(AC,{children:[(0,H.jsxs)(jC,{children:[(0,H.jsx)(MC,{children:e.title}),e.description&&(0,H.jsx)(NC,{children:e.description})]}),t]})})},Drawer:({props:e,children:t})=>{let[n,r]=Di(e.openPath??``);return(0,H.jsx)(hw,{open:n??!1,onOpenChange:e=>r(e),children:(0,H.jsxs)(vw,{children:[(0,H.jsxs)(yw,{children:[(0,H.jsx)(bw,{children:e.title}),e.description&&(0,H.jsx)(xw,{children:e.description})]}),(0,H.jsx)(`div`,{className:`p-4`,children:t})]})})},Carousel:({props:e})=>{let t=e.items??[];return(0,H.jsxs)(ew,{className:`w-full`,children:[(0,H.jsx)(tw,{children:t.map((e,t)=>(0,H.jsx)(nw,{className:`basis-3/4 md:basis-1/2 lg:basis-1/3`,children:(0,H.jsxs)(`div`,{className:`border border-border rounded-lg p-4 bg-card h-full`,children:[e.title&&(0,H.jsx)(`h4`,{className:`font-semibold text-sm mb-1`,children:e.title}),e.description&&(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.description})]})},t))}),(0,H.jsx)(rw,{}),(0,H.jsx)(iw,{})]})},Table:({props:e})=>{let t=e.columns??[],n=(e.rows??[]).map(e=>e.map(String));return(0,H.jsx)(`div`,{className:`rounded-md border border-border overflow-hidden`,children:(0,H.jsxs)(cw,{children:[e.caption&&(0,H.jsx)(mw,{children:e.caption}),(0,H.jsx)(lw,{children:(0,H.jsx)(dw,{children:t.map(e=>(0,H.jsx)(fw,{children:e},e))})}),(0,H.jsx)(uw,{children:n.map((e,t)=>(0,H.jsx)(dw,{children:e.map((e,t)=>(0,H.jsx)(pw,{children:e},t))},t))})]})})},Heading:({props:e})=>{let t=e.level??`h2`,n=t===`h1`?`text-2xl font-bold`:t===`h3`?`text-base font-semibold`:t===`h4`?`text-sm font-semibold`:`text-lg font-semibold`;return t===`h1`?(0,H.jsx)(`h1`,{className:`${n} text-left`,children:e.text}):t===`h3`?(0,H.jsx)(`h3`,{className:`${n} text-left`,children:e.text}):t===`h4`?(0,H.jsx)(`h4`,{className:`${n} text-left`,children:e.text}):(0,H.jsx)(`h2`,{className:`${n} text-left`,children:e.text})},Text:({props:e})=>{let t=e.variant===`caption`?`text-xs`:e.variant===`muted`?`text-sm text-muted-foreground`:e.variant===`lead`?`text-xl text-muted-foreground`:e.variant===`code`?`font-mono text-sm bg-muted px-1.5 py-0.5 rounded`:`text-sm`;return e.variant===`code`?(0,H.jsx)(`code`,{className:`${t} text-left`,children:e.text}):(0,H.jsx)(`p`,{className:`${t} text-left`,children:e.text})},Image:({props:e})=>e.src?(0,H.jsx)(`img`,{src:e.src,alt:e.alt??``,width:e.width??void 0,height:e.height??void 0,className:`rounded max-w-full`}):(0,H.jsx)(`div`,{className:`bg-muted border border-border rounded flex items-center justify-center text-xs text-muted-foreground`,style:{width:e.width??80,height:e.height??60},children:e.alt||`img`}),Avatar:({props:e})=>{let t=e.name||`?`,n=t.split(` `).map(e=>e[0]).join(``).slice(0,2).toUpperCase(),r=e.size===`lg`?`h-12 w-12`:e.size===`sm`?`h-8 w-8`:`h-10 w-10`;return(0,H.jsxs)(RC,{className:r,children:[e.src&&(0,H.jsx)(zC,{src:e.src,alt:t}),(0,H.jsx)(BC,{children:n})]})},Badge:({props:e})=>(0,H.jsx)(HC,{variant:e.variant??`default`,children:e.text}),Alert:({props:e})=>{let t=e.type===`error`?`destructive`:`default`,n=e.type===`success`?`border-green-200 bg-green-50 text-green-900 dark:border-green-800 dark:bg-green-950 dark:text-green-100`:e.type===`warning`?`border-yellow-200 bg-yellow-50 text-yellow-900 dark:border-yellow-800 dark:bg-yellow-950 dark:text-yellow-100`:e.type===`info`?`border-blue-200 bg-blue-50 text-blue-900 dark:border-blue-800 dark:bg-blue-950 dark:text-blue-100`:``;return(0,H.jsxs)(wC,{variant:t,className:n,children:[(0,H.jsx)(TC,{children:e.title}),e.message&&(0,H.jsx)(EC,{children:e.message})]})},Progress:({props:e})=>{let t=Math.min(100,Math.max(0,e.value||0));return(0,H.jsxs)(`div`,{className:`space-y-2`,children:[e.label&&(0,H.jsx)(_C,{className:`text-sm text-muted-foreground`,children:e.label}),(0,H.jsx)(xC,{value:t})]})},Skeleton:({props:e})=>(0,H.jsx)(Iw,{className:e.rounded?`rounded-full`:`rounded-md`,style:{width:e.width??`100%`,height:e.height??`1.25rem`}}),Spinner:({props:e})=>{let t=e.size===`lg`?`h-8 w-8`:e.size===`sm`?`h-4 w-4`:`h-6 w-6`;return(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsxs)(`svg`,{className:`${t} animate-spin text-muted-foreground`,viewBox:`0 0 24 24`,fill:`none`,children:[(0,H.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),(0,H.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z`})]}),e.label&&(0,H.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:e.label})]})},Tooltip:({props:e})=>(0,H.jsx)(qw,{children:(0,H.jsxs)(Jw,{children:[(0,H.jsx)(Yw,{asChild:!0,children:(0,H.jsx)(`span`,{className:`text-sm underline decoration-dotted cursor-help`,children:e.text})}),(0,H.jsx)(Xw,{children:(0,H.jsx)(`p`,{children:e.content})})]})}),Popover:({props:e})=>(0,H.jsxs)(Nw,{children:[(0,H.jsx)(Pw,{asChild:!0,children:(0,H.jsx)(uC,{variant:`outline`,className:`text-sm`,children:e.trigger})}),(0,H.jsx)(Fw,{className:`w-64`,children:(0,H.jsx)(`p`,{className:`text-sm`,children:e.content})})]}),Input:({props:e,bindings:t,emit:n})=>{let[r,i]=$i(e.value,t?.value),[a,o]=(0,V.useState)(``),s=!!t?.value,c=s?r??``:a,l=s?i:o,u=e.validateOn??`blur`,d=!!(t?.value&&e.checks?.length),{errors:f,validate:p}=Mi(t?.value??``,d?{checks:e.checks??[],validateOn:u}:void 0);return(0,H.jsxs)(`div`,{className:`space-y-2`,children:[e.label&&(0,H.jsx)(_C,{htmlFor:e.name??void 0,children:e.label}),(0,H.jsx)(gC,{id:e.name??void 0,name:e.name??void 0,type:e.type??`text`,placeholder:e.placeholder??``,value:c,onChange:e=>{l(e.target.value),d&&u===`change`&&p()},onKeyDown:e=>{e.key===`Enter`&&n(`submit`)},onFocus:()=>n(`focus`),onBlur:()=>{d&&u===`blur`&&p(),n(`blur`)}}),f.length>0&&(0,H.jsx)(`p`,{className:`text-sm text-destructive`,children:f[0]})]})},Textarea:({props:e,bindings:t})=>{let[n,r]=$i(e.value,t?.value),[i,a]=(0,V.useState)(``),o=!!t?.value,s=o?n??``:i,c=o?r:a,l=e.validateOn??`blur`,u=!!(t?.value&&e.checks?.length),{errors:d,validate:f}=Mi(t?.value??``,u?{checks:e.checks??[],validateOn:l}:void 0);return(0,H.jsxs)(`div`,{className:`space-y-2`,children:[e.label&&(0,H.jsx)(_C,{htmlFor:e.name??void 0,children:e.label}),(0,H.jsx)(vC,{id:e.name??void 0,name:e.name??void 0,placeholder:e.placeholder??``,rows:e.rows??3,value:s,onChange:e=>{c(e.target.value),u&&l===`change`&&f()},onBlur:()=>{u&&l===`blur`&&f()}}),d.length>0&&(0,H.jsx)(`p`,{className:`text-sm text-destructive`,children:d[0]})]})},Select:({props:e,bindings:t,emit:n})=>{let[r,i]=$i(e.value,t?.value),[a,o]=(0,V.useState)(``),s=!!t?.value,c=s?r??``:a,l=s?i:o,u=(e.options??[]).map(e=>typeof e==`string`?e:String(e??``)),d=e.validateOn??`change`,f=!!(t?.value&&e.checks?.length),{errors:p,validate:m}=Mi(t?.value??``,f?{checks:e.checks??[],validateOn:d}:void 0);return(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(_C,{children:e.label}),(0,H.jsxs)(GC,{value:c,onValueChange:e=>{l(e),f&&d===`change`&&m(),n(`change`)},children:[(0,H.jsx)(qC,{className:`w-full`,children:(0,H.jsx)(KC,{placeholder:e.placeholder??`Select...`})}),(0,H.jsx)(JC,{children:u.map((e,t)=>(0,H.jsx)(YC,{value:e||`option-${t}`,children:e},`${t}-${e}`))})]}),p.length>0&&(0,H.jsx)(`p`,{className:`text-sm text-destructive`,children:p[0]})]})},Checkbox:({props:e,bindings:t,emit:n})=>{let[r,i]=$i(e.checked,t?.checked),[a,o]=(0,V.useState)(!!e.checked),s=!!t?.checked,c=s?r??!1:a,l=s?i:o,u=e.validateOn??`change`,d=!!(t?.checked&&e.checks?.length),{errors:f,validate:p}=Mi(t?.checked??``,d?{checks:e.checks??[],validateOn:u}:void 0);return(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,H.jsx)(yC,{id:e.name??void 0,checked:c,onCheckedChange:e=>{l(e===!0),d&&u===`change`&&p(),n(`change`)}}),(0,H.jsx)(_C,{htmlFor:e.name??void 0,className:`cursor-pointer`,children:e.label})]}),f.length>0&&(0,H.jsx)(`p`,{className:`text-sm text-destructive`,children:f[0]})]})},Radio:({props:e,bindings:t,emit:n})=>{let r=(e.options??[]).map(e=>typeof e==`string`?e:String(e??``)),[i,a]=$i(e.value,t?.value),[o,s]=(0,V.useState)(r[0]??``),c=!!t?.value,l=c?i??``:o,u=c?a:s,d=e.validateOn??`change`,f=!!(t?.value&&e.checks?.length),{errors:p,validate:m}=Mi(t?.value??``,f?{checks:e.checks??[],validateOn:d}:void 0);return(0,H.jsxs)(`div`,{className:`space-y-2`,children:[e.label&&(0,H.jsx)(_C,{children:e.label}),(0,H.jsx)(UC,{value:l,onValueChange:e=>{u(e),f&&d===`change`&&m(),n(`change`)},children:r.map((t,n)=>(0,H.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,H.jsx)(WC,{value:t||`option-${n}`,id:`${e.name}-${n}-${t}`}),(0,H.jsx)(_C,{htmlFor:`${e.name}-${n}-${t}`,className:`cursor-pointer`,children:t})]},`${n}-${t}`))}),p.length>0&&(0,H.jsx)(`p`,{className:`text-sm text-destructive`,children:p[0]})]})},Switch:({props:e,bindings:t,emit:n})=>{let[r,i]=$i(e.checked,t?.checked),[a,o]=(0,V.useState)(!!e.checked),s=!!t?.checked,c=s?r??!1:a,l=s?i:o,u=e.validateOn??`change`,d=!!(t?.checked&&e.checks?.length),{errors:f,validate:p}=Mi(t?.checked??``,d?{checks:e.checks??[],validateOn:u}:void 0);return(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between space-x-2`,children:[(0,H.jsx)(_C,{htmlFor:e.name??void 0,className:`cursor-pointer`,children:e.label}),(0,H.jsx)(bC,{id:e.name??void 0,checked:c,onCheckedChange:e=>{l(e),d&&u===`change`&&p(),n(`change`)}})]}),f.length>0&&(0,H.jsx)(`p`,{className:`text-sm text-destructive`,children:f[0]})]})},Slider:({props:e,bindings:t,emit:n})=>{let[r,i]=$i(e.value,t?.value),[a,o]=(0,V.useState)(e.min??0),s=!!t?.value,c=s?r??e.min??0:a,l=s?i:o;return(0,H.jsxs)(`div`,{className:`space-y-2`,children:[e.label&&(0,H.jsxs)(`div`,{className:`flex justify-between`,children:[(0,H.jsx)(_C,{className:`text-sm`,children:e.label}),(0,H.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:c})]}),(0,H.jsx)(Lw,{value:[c],min:e.min??0,max:e.max??100,step:e.step??1,onValueChange:e=>{l(e[0]??0),n(`change`)}})]})},Button:({props:e,emit:t})=>{let n=e.variant===`danger`?`destructive`:e.variant===`secondary`?`secondary`:`default`;return(0,H.jsx)(uC,{variant:n,disabled:e.disabled??!1,onClick:()=>t(`press`),children:e.label})},Link:({props:e,on:t})=>(0,H.jsx)(`a`,{href:e.href??`#`,className:`text-primary underline-offset-4 hover:underline text-sm font-medium`,onClick:e=>{let n=t(`press`);n.shouldPreventDefault&&e.preventDefault(),n.emit()},children:e.label}),DropdownMenu:({props:e,bindings:t,emit:n})=>{let r=e.items??[],[,i]=$i(e.value,t?.value);return(0,H.jsxs)(Sw,{children:[(0,H.jsx)(Cw,{asChild:!0,children:(0,H.jsx)(uC,{variant:`outline`,children:e.label})}),(0,H.jsx)(ww,{children:r.map(e=>(0,H.jsx)(Tw,{onClick:()=>{i(e.value),n(`select`)},children:e.label},e.value))})]})},Toggle:({props:e,bindings:t,emit:n})=>{let[r,i]=$i(e.pressed,t?.pressed),[a,o]=(0,V.useState)(e.pressed??!1),s=!!t?.pressed,c=s?r??!1:a,l=s?i:o;return(0,H.jsx)(Uw,{variant:e.variant??`default`,pressed:c,onPressedChange:e=>{l(e),n(`change`)},children:e.label})},ToggleGroup:({props:e,bindings:t,emit:n})=>{let r=e.type??`single`,i=e.items??[],[a,o]=$i(e.value,t?.value),[s,c]=(0,V.useState)(i[0]?.value??``),l=!!t?.value,u=l?a??``:s,d=l?o:c;if(r===`multiple`){let e=u?u.split(`,`).filter(Boolean):[];return(0,H.jsx)(Gw,{type:`multiple`,value:e,onValueChange:e=>{d(e.join(`,`)),n(`change`)},children:i.map(e=>(0,H.jsx)(Kw,{value:e.value,children:e.label},e.value))})}return(0,H.jsx)(Gw,{type:`single`,value:u,onValueChange:e=>{e&&(d(e),n(`change`))},children:i.map(e=>(0,H.jsx)(Kw,{value:e.value,children:e.label},e.value))})},ButtonGroup:({props:e,bindings:t,emit:n})=>{let r=e.buttons??[],[i,a]=$i(e.selected,t?.selected),[o,s]=(0,V.useState)(r[0]?.value??``),c=!!t?.selected,l=c?i??``:o,u=c?a:s;return(0,H.jsx)(`div`,{className:`inline-flex rounded-md border border-border`,children:r.map((e,t)=>(0,H.jsx)(`button`,{className:`px-3 py-1.5 text-sm transition-colors ${l===e.value?`bg-primary text-primary-foreground`:`bg-background hover:bg-muted`} ${t>0?`border-l border-border`:``} ${t===0?`rounded-l-md`:``} ${t===r.length-1?`rounded-r-md`:``}`,onClick:()=>{u(e.value),n(`change`)},children:e.label},e.value))})},Pagination:({props:e,bindings:t,emit:n})=>{let[r,i]=$i(e.page,t?.page),a=r??1,o=e.totalPages??1,s=Zw(a,o);return(0,H.jsx)(Ew,{children:(0,H.jsxs)(Dw,{children:[(0,H.jsx)(Ow,{children:(0,H.jsx)(Aw,{href:`#`,onClick:e=>{e.preventDefault(),a>1&&(i(a-1),n(`change`))}})}),s.map((e,t)=>e===`ellipsis`?(0,H.jsx)(Ow,{children:(0,H.jsx)(Mw,{})},`ellipsis-${t}`):(0,H.jsx)(Ow,{children:(0,H.jsx)(kw,{href:`#`,isActive:e===a,onClick:t=>{t.preventDefault(),i(e),n(`change`)},children:e})},e)),(0,H.jsx)(Ow,{children:(0,H.jsx)(jw,{href:`#`,onClick:e=>{e.preventDefault(),a<o&&(i(a+1),n(`change`))}})})]})})}},$w=u({title:f().nullable(),data:g(u({label:f(),value:c()}))}),{registry:eT}=vn(Qr(Tt,{components:{...wi,Metric:{props:u({label:f(),value:f(),detail:f().nullable()}),description:`One headline number with its label. Put several in a Grid for a dashboard`,example:{label:`Pass rate`,value:`96.5%`,detail:`+1.2% this week`}},BarGraph:{props:$w,description:`Vertical bar chart. Values must be zero or above`,example:{title:`Builds per day`,data:[{label:`Mon`,value:12}]}},LineGraph:{props:$w,description:`Line chart through the data points in order`,example:{title:`Latency (ms)`,data:[{label:`09:00`,value:120}]}}},actions:{}}),{components:{...Qw,Card:oi,Stack:di,Table:si,Alert:mi,Link:hi,Metric:fi,BarGraph:vi,LineGraph:xi}});function tT({element:e}){return(0,H.jsxs)(`p`,{className:`text-muted-foreground text-xs`,children:[`Unknown component `,e.type]})}function nT({source:e,fallback:t}){let n=(0,V.useMemo)(()=>ri(e),[e]);return n?(0,H.jsx)(`div`,{className:`text-foreground my-3 text-sm leading-normal`,children:(0,H.jsx)(ii.Provider,{value:n.elements[n.root].type===`Card`,children:(0,H.jsx)(gn,{registry:eT,initialState:n.state,children:(0,H.jsx)(hn,{spec:n,registry:eT,fallback:tT})})})}):t}export{nT as default};
178
+ //# chunkId=ba2b165a-e69b-59dd-b251-34b3dcf35212