@ui-sdk/web 0.0.0-stage → 0.1.0-beta.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.
- package/LICENSE +202 -0
- package/README.md +10 -2
- package/browser/web/accordion.js +1 -0
- package/browser/web/alert-dialog.js +1 -0
- package/browser/web/autocomplete.js +1 -0
- package/browser/web/avatar.js +1 -0
- package/browser/web/button.js +1 -0
- package/browser/web/calendar.js +1 -0
- package/browser/web/carousel.js +1 -0
- package/browser/web/checkbox.js +1 -0
- package/browser/web/chunks/0eRGibL6.js +1 -0
- package/browser/web/chunks/2bIEUO6_.js +1 -0
- package/browser/web/chunks/5A9w2ULz.js +1 -0
- package/browser/web/chunks/5RSyydjV.js +1 -0
- package/browser/web/chunks/9pWTy2wl.js +1 -0
- package/browser/web/chunks/B0f2j6zz.js +1 -0
- package/browser/web/chunks/B1rux6br.js +1 -0
- package/browser/web/chunks/B3-APaNf.js +1 -0
- package/browser/web/chunks/B7EgSgjQ.js +1 -0
- package/browser/web/chunks/B8QcOzJU.js +1 -0
- package/browser/web/chunks/BFueEkwm.js +3 -0
- package/browser/web/chunks/BJj3oS29.js +1 -0
- package/browser/web/chunks/BNSvTCpr.js +1 -0
- package/browser/web/chunks/BPD0kAZB.js +1 -0
- package/browser/web/chunks/BQeduZqT.js +1 -0
- package/browser/web/chunks/B_CVFyiz.js +1 -0
- package/browser/web/chunks/B_ns1YHO.js +1 -0
- package/browser/web/chunks/BcwkVTsR.js +1 -0
- package/browser/web/chunks/BeaQ6TYM.js +1 -0
- package/browser/web/chunks/BgBB013u.js +1 -0
- package/browser/web/chunks/BgsKhHDm.js +1 -0
- package/browser/web/chunks/BjMcbuhi.js +9 -0
- package/browser/web/chunks/Bjiy_F2N.js +1 -0
- package/browser/web/chunks/BqScCLwv.js +1 -0
- package/browser/web/chunks/BqX3Utqx.js +1 -0
- package/browser/web/chunks/BtVkQf3z.js +1 -0
- package/browser/web/chunks/By30h-7B.js +1 -0
- package/browser/web/chunks/C1zqYpy2.js +1 -0
- package/browser/web/chunks/C436juFf.js +1 -0
- package/browser/web/chunks/C4_bULs1.js +1 -0
- package/browser/web/chunks/C4omqJEz.js +1 -0
- package/browser/web/chunks/C7tt0T3n.js +1 -0
- package/browser/web/chunks/C8w7s5dg.js +1 -0
- package/browser/web/chunks/CElY4erO.js +1 -0
- package/browser/web/chunks/CFODo-m2.js +1 -0
- package/browser/web/chunks/CL4wjam9.js +1 -0
- package/browser/web/chunks/CMg-8UVf.js +1 -0
- package/browser/web/chunks/COWKfakj.js +1 -0
- package/browser/web/chunks/CQBU0qZ4.js +1 -0
- package/browser/web/chunks/CV6uABgc.js +1 -0
- package/browser/web/chunks/C_SWFpWQ.js +1 -0
- package/browser/web/chunks/C_Uanbrl.js +1 -0
- package/browser/web/chunks/Ce_CSanC.js +1 -0
- package/browser/web/chunks/Cg-ZmRhS.js +1 -0
- package/browser/web/chunks/Cgf2wPI_.js +1 -0
- package/browser/web/chunks/Cuep_3Vf.js +1 -0
- package/browser/web/chunks/D02PaHn6.js +1 -0
- package/browser/web/chunks/D5LiaI5R.js +1 -0
- package/browser/web/chunks/D9UgVYvF.js +1 -0
- package/browser/web/chunks/DC08tnkE.js +2 -0
- package/browser/web/chunks/DG8YGSvu.js +1 -0
- package/browser/web/chunks/DIQd0FYD.js +1 -0
- package/browser/web/chunks/DMLqacE8.js +1 -0
- package/browser/web/chunks/DSUI3yI-.js +1 -0
- package/browser/web/chunks/DT3Hb76X.js +1 -0
- package/browser/web/chunks/DY75g3-W.js +1 -0
- package/browser/web/chunks/DZpNQKZ9.js +1 -0
- package/browser/web/chunks/Db-W1wrC.js +1 -0
- package/browser/web/chunks/Dc1xK3Ii.js +1 -0
- package/browser/web/chunks/DdF6awFs.js +1 -0
- package/browser/web/chunks/DdaCLml8.js +1 -0
- package/browser/web/chunks/Dh8MLjQO.js +1 -0
- package/browser/web/chunks/DiuslJRy.js +1 -0
- package/browser/web/chunks/DjRcw3Y0.js +1 -0
- package/browser/web/chunks/Djdv-16J.js +1 -0
- package/browser/web/chunks/DnFXe_lF.js +1 -0
- package/browser/web/chunks/DneGv1oC.js +1 -0
- package/browser/web/chunks/DsVxP-p-.js +1 -0
- package/browser/web/chunks/DwDilCo2.js +1 -0
- package/browser/web/chunks/DwV48AXv.js +1 -0
- package/browser/web/chunks/F37aF4-L.js +1 -0
- package/browser/web/chunks/LyB6XIbN.js +1 -0
- package/browser/web/chunks/NKnbYGjC.js +1 -0
- package/browser/web/chunks/Vk-rVi16.js +1 -0
- package/browser/web/chunks/XsM0J1Ex.js +1 -0
- package/browser/web/chunks/asSN9iEp.js +1 -0
- package/browser/web/chunks/c-AjHfdF.js +1 -0
- package/browser/web/chunks/dR-12TPY.js +1 -0
- package/browser/web/chunks/hR4xM0EC.js +1 -0
- package/browser/web/chunks/hqOaBxAg.js +1 -0
- package/browser/web/chunks/kMKqqeG4.js +1 -0
- package/browser/web/chunks/kXboBcfi.js +1 -0
- package/browser/web/chunks/l4aQIg22.js +1 -0
- package/browser/web/chunks/tJC0JSU4.js +1 -0
- package/browser/web/chunks/wHdS_QYM.js +1 -0
- package/browser/web/chunks/yv8dTvNI.js +1 -0
- package/browser/web/chunks/yw9M3nfi.js +1 -0
- package/browser/web/collapsible.js +1 -0
- package/browser/web/color-picker.js +1 -0
- package/browser/web/combobox.js +2 -0
- package/browser/web/command.js +1 -0
- package/browser/web/core.js +5 -0
- package/browser/web/date-input.js +1 -0
- package/browser/web/date-picker.js +1 -0
- package/browser/web/dialog.js +1 -0
- package/browser/web/drawer.js +1 -0
- package/browser/web/field.js +1 -0
- package/browser/web/file-input.js +1 -0
- package/browser/web/hover-card.js +1 -0
- package/browser/web/image-cropper.js +1 -0
- package/browser/web/input.js +1 -0
- package/browser/web/label.js +1 -0
- package/browser/web/listbox.js +1 -0
- package/browser/web/menu.js +1 -0
- package/browser/web/menubar.js +1 -0
- package/browser/web/meter.js +1 -0
- package/browser/web/navigation-menu.js +1 -0
- package/browser/web/number-input.js +1 -0
- package/browser/web/otp-input.js +2 -0
- package/browser/web/overlays.js +1 -0
- package/browser/web/pagination.js +1 -0
- package/browser/web/password-input.js +1 -0
- package/browser/web/popover.js +1 -0
- package/browser/web/preferences.js +1 -0
- package/browser/web/progress.js +1 -0
- package/browser/web/radio.js +1 -0
- package/browser/web/rating.js +1 -0
- package/browser/web/resizable.js +1 -0
- package/browser/web/scroll-area.js +1 -0
- package/browser/web/segmented-control.js +1 -0
- package/browser/web/select.js +1 -0
- package/browser/web/separator.js +1 -0
- package/browser/web/slider.js +1 -0
- package/browser/web/switch.js +1 -0
- package/browser/web/tabs.js +1 -0
- package/browser/web/textarea.js +1 -0
- package/browser/web/time-input.js +1 -0
- package/browser/web/timeline.js +1 -0
- package/browser/web/toast.js +1 -0
- package/browser/web/toggle.js +1 -0
- package/browser/web/token-input.js +8 -0
- package/browser/web/toolbar.js +1 -0
- package/browser/web/tooltip.js +1 -0
- package/browser/web/tree.js +1 -0
- package/browser/web/trigger-menu.js +4 -0
- package/browser/web/waterfall.js +1 -0
- package/browser/web.css +3378 -0
- package/browser/web.js +3 -0
- package/custom-elements.json +32315 -0
- package/dist/accordion.d.ts +2 -0
- package/dist/accordion.js +57 -0
- package/dist/action.d.ts +16 -0
- package/dist/action.js +39 -0
- package/dist/agent.d.ts +2 -0
- package/dist/agent.js +7 -0
- package/dist/autocomplete.d.ts +2 -0
- package/dist/autocomplete.js +120 -0
- package/dist/autoload.d.ts +18 -0
- package/dist/autoload.js +63 -0
- package/dist/avatar.d.ts +2 -0
- package/dist/avatar.js +27 -0
- package/dist/browser-core.d.ts +2 -0
- package/dist/browser-core.js +8 -0
- package/dist/button.d.ts +2 -0
- package/dist/button.js +35 -0
- package/dist/calendar.d.ts +23 -0
- package/dist/calendar.js +429 -0
- package/dist/carousel.d.ts +2 -0
- package/dist/carousel.js +54 -0
- package/dist/checkbox.d.ts +4 -0
- package/dist/checkbox.js +75 -0
- package/dist/collapsible.d.ts +2 -0
- package/dist/collapsible.js +28 -0
- package/dist/color-picker.d.ts +2 -0
- package/dist/color-picker.js +64 -0
- package/dist/combobox.d.ts +2 -0
- package/dist/combobox.js +334 -0
- package/dist/command.d.ts +2 -0
- package/dist/command.js +122 -0
- package/dist/date-input.d.ts +3 -0
- package/dist/date-input.js +87 -0
- package/dist/date-picker.d.ts +2 -0
- package/dist/date-picker.js +174 -0
- package/dist/default-text.d.ts +3 -0
- package/dist/default-text.js +24 -0
- package/dist/define-element.d.ts +404 -0
- package/dist/define-element.js +1489 -0
- package/dist/dialog.d.ts +3 -0
- package/dist/dialog.js +94 -0
- package/dist/drawer.d.ts +2 -0
- package/dist/drawer.js +96 -0
- package/dist/entries/accordion.d.ts +3 -0
- package/dist/entries/accordion.js +7 -0
- package/dist/entries/alert-dialog.d.ts +3 -0
- package/dist/entries/alert-dialog.js +13 -0
- package/dist/entries/autocomplete.d.ts +3 -0
- package/dist/entries/autocomplete.js +7 -0
- package/dist/entries/avatar.d.ts +2 -0
- package/dist/entries/avatar.js +3 -0
- package/dist/entries/button.d.ts +2 -0
- package/dist/entries/button.js +3 -0
- package/dist/entries/calendar.d.ts +3 -0
- package/dist/entries/calendar.js +7 -0
- package/dist/entries/carousel.d.ts +3 -0
- package/dist/entries/carousel.js +7 -0
- package/dist/entries/checkbox.d.ts +3 -0
- package/dist/entries/checkbox.js +15 -0
- package/dist/entries/collapsible.d.ts +3 -0
- package/dist/entries/collapsible.js +7 -0
- package/dist/entries/color-picker.d.ts +3 -0
- package/dist/entries/color-picker.js +7 -0
- package/dist/entries/combobox.d.ts +3 -0
- package/dist/entries/combobox.js +7 -0
- package/dist/entries/command.d.ts +3 -0
- package/dist/entries/command.js +7 -0
- package/dist/entries/date-input.d.ts +3 -0
- package/dist/entries/date-input.js +7 -0
- package/dist/entries/date-picker.d.ts +3 -0
- package/dist/entries/date-picker.js +7 -0
- package/dist/entries/dialog.d.ts +3 -0
- package/dist/entries/dialog.js +7 -0
- package/dist/entries/drawer.d.ts +3 -0
- package/dist/entries/drawer.js +8 -0
- package/dist/entries/field.d.ts +2 -0
- package/dist/entries/field.js +3 -0
- package/dist/entries/file-input.d.ts +3 -0
- package/dist/entries/file-input.js +13 -0
- package/dist/entries/hover-card.d.ts +3 -0
- package/dist/entries/hover-card.js +7 -0
- package/dist/entries/image-cropper.d.ts +3 -0
- package/dist/entries/image-cropper.js +7 -0
- package/dist/entries/input.d.ts +3 -0
- package/dist/entries/input.js +8 -0
- package/dist/entries/label.d.ts +2 -0
- package/dist/entries/label.js +3 -0
- package/dist/entries/listbox.d.ts +3 -0
- package/dist/entries/listbox.js +7 -0
- package/dist/entries/menu.d.ts +3 -0
- package/dist/entries/menu.js +7 -0
- package/dist/entries/menubar.d.ts +3 -0
- package/dist/entries/menubar.js +7 -0
- package/dist/entries/meter.d.ts +2 -0
- package/dist/entries/meter.js +3 -0
- package/dist/entries/navigation-menu.d.ts +3 -0
- package/dist/entries/navigation-menu.js +7 -0
- package/dist/entries/number-input.d.ts +3 -0
- package/dist/entries/number-input.js +7 -0
- package/dist/entries/otp-input.d.ts +3 -0
- package/dist/entries/otp-input.js +7 -0
- package/dist/entries/overlays.d.ts +2 -0
- package/dist/entries/overlays.js +3 -0
- package/dist/entries/pagination.d.ts +3 -0
- package/dist/entries/pagination.js +11 -0
- package/dist/entries/password-input.d.ts +3 -0
- package/dist/entries/password-input.js +7 -0
- package/dist/entries/popover.d.ts +3 -0
- package/dist/entries/popover.js +7 -0
- package/dist/entries/preferences.d.ts +3 -0
- package/dist/entries/preferences.js +13 -0
- package/dist/entries/progress.d.ts +2 -0
- package/dist/entries/progress.js +3 -0
- package/dist/entries/radio.d.ts +3 -0
- package/dist/entries/radio.js +7 -0
- package/dist/entries/rating.d.ts +3 -0
- package/dist/entries/rating.js +8 -0
- package/dist/entries/resizable.d.ts +3 -0
- package/dist/entries/resizable.js +11 -0
- package/dist/entries/scroll-area.d.ts +3 -0
- package/dist/entries/scroll-area.js +7 -0
- package/dist/entries/segmented-control.d.ts +3 -0
- package/dist/entries/segmented-control.js +7 -0
- package/dist/entries/select.d.ts +3 -0
- package/dist/entries/select.js +7 -0
- package/dist/entries/separator.d.ts +2 -0
- package/dist/entries/separator.js +3 -0
- package/dist/entries/slider.d.ts +3 -0
- package/dist/entries/slider.js +7 -0
- package/dist/entries/switch.d.ts +3 -0
- package/dist/entries/switch.js +7 -0
- package/dist/entries/tabs.d.ts +3 -0
- package/dist/entries/tabs.js +7 -0
- package/dist/entries/textarea.d.ts +3 -0
- package/dist/entries/textarea.js +7 -0
- package/dist/entries/time-input.d.ts +3 -0
- package/dist/entries/time-input.js +7 -0
- package/dist/entries/timeline.d.ts +3 -0
- package/dist/entries/timeline.js +7 -0
- package/dist/entries/toast.d.ts +2 -0
- package/dist/entries/toast.js +3 -0
- package/dist/entries/toggle.d.ts +3 -0
- package/dist/entries/toggle.js +12 -0
- package/dist/entries/token-input.d.ts +3 -0
- package/dist/entries/token-input.js +17 -0
- package/dist/entries/toolbar.d.ts +3 -0
- package/dist/entries/toolbar.js +7 -0
- package/dist/entries/tooltip.d.ts +3 -0
- package/dist/entries/tooltip.js +7 -0
- package/dist/entries/tree.d.ts +3 -0
- package/dist/entries/tree.js +17 -0
- package/dist/entries/trigger-menu.d.ts +3 -0
- package/dist/entries/trigger-menu.js +11 -0
- package/dist/entries/waterfall.d.ts +3 -0
- package/dist/entries/waterfall.js +11 -0
- package/dist/events.d.ts +1658 -0
- package/dist/events.js +0 -0
- package/dist/field.d.ts +2 -0
- package/dist/field.js +101 -0
- package/dist/file-input.d.ts +2 -0
- package/dist/file-input.js +140 -0
- package/dist/forward-attributes.d.ts +2 -0
- package/dist/forward-attributes.js +22 -0
- package/dist/history.d.ts +2 -0
- package/dist/history.js +11 -0
- package/dist/hover-card.d.ts +2 -0
- package/dist/hover-card.js +31 -0
- package/dist/image-cropper.d.ts +2 -0
- package/dist/image-cropper.js +66 -0
- package/dist/index.d.ts +66 -0
- package/dist/index.js +269 -0
- package/dist/input.d.ts +3 -0
- package/dist/input.js +69 -0
- package/dist/label.d.ts +2 -0
- package/dist/label.js +11 -0
- package/dist/list.d.ts +40 -0
- package/dist/list.js +192 -0
- package/dist/listbox.d.ts +2 -0
- package/dist/listbox.js +84 -0
- package/dist/menu.d.ts +4 -0
- package/dist/menu.js +295 -0
- package/dist/menubar.d.ts +4 -0
- package/dist/menubar.js +30 -0
- package/dist/meter.d.ts +2 -0
- package/dist/meter.js +22 -0
- package/dist/navigation-menu.d.ts +2 -0
- package/dist/navigation-menu.js +114 -0
- package/dist/number-input.d.ts +2 -0
- package/dist/number-input.js +73 -0
- package/dist/observe.d.ts +2 -0
- package/dist/observe.js +7 -0
- package/dist/otp-input.d.ts +2 -0
- package/dist/otp-input.js +72 -0
- package/dist/overlays.d.ts +13 -0
- package/dist/overlays.js +156 -0
- package/dist/pagination.d.ts +2 -0
- package/dist/pagination.js +127 -0
- package/dist/password-input.d.ts +2 -0
- package/dist/password-input.js +57 -0
- package/dist/popover.d.ts +2 -0
- package/dist/popover.js +64 -0
- package/dist/popup.d.ts +40 -0
- package/dist/popup.js +112 -0
- package/dist/preferences.d.ts +2 -0
- package/dist/preferences.js +56 -0
- package/dist/progress.d.ts +2 -0
- package/dist/progress.js +22 -0
- package/dist/radio.d.ts +2 -0
- package/dist/radio.js +33 -0
- package/dist/rating.d.ts +2 -0
- package/dist/rating.js +64 -0
- package/dist/resizable.d.ts +2 -0
- package/dist/resizable.js +42 -0
- package/dist/scroll-area.d.ts +2 -0
- package/dist/scroll-area.js +45 -0
- package/dist/segmented-control.d.ts +2 -0
- package/dist/segmented-control.js +28 -0
- package/dist/select.d.ts +2 -0
- package/dist/select.js +239 -0
- package/dist/separator.d.ts +2 -0
- package/dist/separator.js +11 -0
- package/dist/slider.d.ts +2 -0
- package/dist/slider.js +77 -0
- package/dist/tabs.d.ts +2 -0
- package/dist/tabs.js +37 -0
- package/dist/timeline.d.ts +2 -0
- package/dist/timeline.js +27 -0
- package/dist/toast.d.ts +20 -0
- package/dist/toast.js +177 -0
- package/dist/toggle.d.ts +3 -0
- package/dist/toggle.js +64 -0
- package/dist/token-input.d.ts +2 -0
- package/dist/token-input.js +103 -0
- package/dist/toolbar.d.ts +2 -0
- package/dist/toolbar.js +36 -0
- package/dist/tooltip.d.ts +2 -0
- package/dist/tooltip.js +35 -0
- package/dist/tree.d.ts +2 -0
- package/dist/tree.js +147 -0
- package/dist/trigger-menu.d.ts +2 -0
- package/dist/trigger-menu.js +133 -0
- package/dist/waterfall.d.ts +2 -0
- package/dist/waterfall.js +140 -0
- package/docs/README.md +89 -0
- package/docs/agents.md +1523 -0
- package/docs/components/accordion.md +1401 -0
- package/docs/components/alert-dialog.md +788 -0
- package/docs/components/autocomplete.md +1692 -0
- package/docs/components/avatar.md +261 -0
- package/docs/components/button.md +441 -0
- package/docs/components/calendar.md +1536 -0
- package/docs/components/carousel.md +1055 -0
- package/docs/components/checkbox.md +1045 -0
- package/docs/components/collapsible.md +535 -0
- package/docs/components/color-picker.md +651 -0
- package/docs/components/combobox.md +3274 -0
- package/docs/components/command.md +1431 -0
- package/docs/components/date-input.md +563 -0
- package/docs/components/date-picker.md +1136 -0
- package/docs/components/dialog.md +1360 -0
- package/docs/components/drawer.md +1201 -0
- package/docs/components/field.md +519 -0
- package/docs/components/file-input.md +617 -0
- package/docs/components/hover-card.md +486 -0
- package/docs/components/image-cropper.md +489 -0
- package/docs/components/input.md +327 -0
- package/docs/components/label.md +208 -0
- package/docs/components/listbox.md +1015 -0
- package/docs/components/menu.md +1212 -0
- package/docs/components/menubar.md +460 -0
- package/docs/components/meter.md +298 -0
- package/docs/components/navigation-menu.md +1573 -0
- package/docs/components/number-input.md +1087 -0
- package/docs/components/otp-input.md +558 -0
- package/docs/components/pagination.md +639 -0
- package/docs/components/password-input.md +649 -0
- package/docs/components/popover.md +1433 -0
- package/docs/components/preferences.md +243 -0
- package/docs/components/progress.md +406 -0
- package/docs/components/radio.md +855 -0
- package/docs/components/rating.md +431 -0
- package/docs/components/resizable.md +866 -0
- package/docs/components/scroll-area.md +898 -0
- package/docs/components/segmented-control.md +421 -0
- package/docs/components/select.md +1957 -0
- package/docs/components/separator.md +238 -0
- package/docs/components/slider.md +1018 -0
- package/docs/components/switch.md +583 -0
- package/docs/components/tabs.md +948 -0
- package/docs/components/textarea.md +331 -0
- package/docs/components/time-input.md +235 -0
- package/docs/components/timeline.md +622 -0
- package/docs/components/toast.md +1223 -0
- package/docs/components/toggle.md +522 -0
- package/docs/components/token-input.md +854 -0
- package/docs/components/toolbar.md +815 -0
- package/docs/components/tooltip.md +860 -0
- package/docs/components/tree.md +1243 -0
- package/docs/components/trigger-menu.md +1110 -0
- package/docs/components/waterfall.md +709 -0
- package/docs/controllers.md +66 -0
- package/docs/core.md +8027 -0
- package/docs/custom-parts.md +91 -0
- package/docs/first-component.md +88 -0
- package/docs/forms.md +125 -0
- package/docs/installation.md +141 -0
- package/docs/introduction.md +32 -0
- package/docs/lists-and-menus.md +166 -0
- package/docs/llms.txt +1566 -0
- package/docs/parts-and-composition.md +57 -0
- package/docs/popups.md +92 -0
- package/docs/rendering.md +71 -0
- package/docs/server-rendering.md +118 -0
- package/docs/state-and-events.md +134 -0
- package/docs/styling-and-animation.md +104 -0
- package/docs/utilities/async-options.md +332 -0
- package/docs/utilities/shortcuts.md +184 -0
- package/html-custom-data.json +14792 -0
- package/package.json +302 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright 2026 Vercel, Inc.
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @ui-sdk/web
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
UI SDK as web components. A library of behaviors to build your components.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm install @ui-sdk/web @ui-sdk/core
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
[Read the docs](https://ui-sdk.dev/docs/web-components)
|
|
10
|
+
|
|
11
|
+
The docs also ship in this package as Markdown, starting at `docs/llms.txt`, for your editor and your agent.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{At as e,H as t,J as n,V as r,Vt as i,W as a,X as o,Zt as s,g as c,r as l}from"./chunks/DC08tnkE.js";import{n as u}from"./chunks/Dh8MLjQO.js";import{i as d,n as f,r as p}from"./chunks/BNSvTCpr.js";import{n as m,r as h}from"./chunks/B7EgSgjQ.js";import{i as g,n as _,r as v,t as y}from"./chunks/DnFXe_lF.js";import{n as b,t as x}from"./chunks/0eRGibL6.js";import{t as S}from"./chunks/Bjiy_F2N.js";function C(){return o()}function w(e,t,n,r){return n?e.includes(t)?e:r?[...e,t]:[t]:e.filter(e=>e!==t)}function T(e,t){return!e.multiple&&!e.collapsible&&e.value.includes(t)}function E(t){let{id:r,store:o,options:s,element:c,props:l}=t,u=b(t),d=/* @__PURE__ */ new Set,f=/* @__PURE__ */ new Set,p=/* @__PURE__ */ new Set,m=/* @__PURE__ */ new Map,h=_(`imperative`),g=e=>o.get().value.includes(e),v=e=>l(`item`,e),y=e=>i(o.get())||!!v(e)?.disabled;function C(e,{reason:t=`imperative`,event:n}={}){let r=o.get(),i=r.multiple?e:e.slice(0,1);for(let e of/* @__PURE__ */ new Set([...r.value,...i])){let o=i.includes(e);if(o===r.value.includes(e))continue;let s=v(e)?.onOpenChange;if(!s)continue;let c=a({reason:t,event:n},x(t,n));if(s(o,c),c.canceled)return!1}h.set(t);let s=u(`value`,i,{reason:t,event:n});return s||h.take(),s}function E(e,t,n={}){let r=o.get();return g(e)===t||!t&&T(r,e)?!1:C(w(r.value,e,t,r.multiple),n)}function D(e,t,n){let r=e.filter(e=>!t.includes(e)&&d.has(e)&&!n.includes(e));return[...n.filter(e=>!t.includes(e)),...r]}n(t,[`exiting`],(e,t)=>`value`in e&&e.value!==t.value?{exiting:D(t.value,e.value,t.exiting)}:void 0);let O=o.get().value;o.subscribe(()=>{let{value:e,exiting:t}=o.get();if(e===O)return;let n=O,r=h.take();for(let t of e)n.includes(t)||m.set(t,r);for(let t of n)e.includes(t)||m.delete(t);O=e,o.set({exiting:D(n,e,t)})});function k(){j=!1;let e=S(t,`item`).map(e=>e.key).filter(e=>f.has(e));o.set({items:[...e,...[...f].filter(t=>!e.includes(t))]})}let A=!1,j=!1;function M(e=!1){j||=e,!A&&(A=!0,queueMicrotask(()=>{A=!1,o.set({panels:[...d]}),j&&k()}))}return{id:r,options:s,getValue:()=>o.get().value,setValue:C,isOpen:g,open:(e,t)=>E(e,!0,t),close:(e,t)=>E(e,!1,t),toggle:(e,t)=>E(e,!g(e),t),openAll(t){if(!o.get().multiple)return e("openAll() needs an accordion with `multiple`.",{component:`accordion`,id:r}),!1;j&&k();let n=o.get().items.filter(e=>!y(e));return C([.../* @__PURE__ */ new Set([...o.get().value,...n])],t)},closeAll(e){let t=o.get();return C(t.value.filter(e=>T(t,e)||y(e)),e)},focus(e){(e===void 0?S(t,`trigger`)[0]?.el:c(`trigger`,e))?.focus()},internal:{itemDisabled:y,syncItems:k,triggerElement:e=>c(`trigger`,e),opening:e=>{let t=m.get(e);return t===void 0?`mount`:t===`find-in-page`?`instant`:`animate`},settled(e,t){m.delete(e),v(e)?.onOpenChangeComplete?.(t)},registerItem(e,t){return f.add(e),p.add(t),M(!0),()=>{f.delete(e),p.delete(t),M(!0)}},insideItem(e,t){for(;e&&e!==t;e=e.parentNode)if(p.has(e))return!0;return!1},registerPanel(e){return d.add(e),M(),()=>{d.delete(e),M();let{exiting:t}=o.get();t.includes(e)&&o.set({exiting:t.filter(t=>t!==e)})}},finishExit(e){o.set({exiting:o.get().exiting.filter(t=>t!==e)})}}}}const D=E,O=(e,t,n,r)=>!!r||i(e)||n.internal.itemDisabled(t),k=(e,t)=>t.keepMounted??e.keepMounted,A=(e,t)=>t.hiddenUntilFound??e.hiddenUntilFound,j=(e,t,n,r)=>({open:e.value.includes(t),disabled:O(e,t,n,r),index:e.items.indexOf(t)}),M=/* @__PURE__ */ t({name:`accordion`,options:{value:`list`,defaultValue:`list`,onValueChange:`callback`,multiple:`boolean`,collapsible:`boolean`,disabled:`boolean`,keepMounted:`boolean`,hiddenUntilFound:`boolean`,controller:`value`},state:e=>({value:e.defaultValue??[],multiple:!1,collapsible:!0,disabled:!1,formDisabled:!1,keepMounted:!1,hiddenUntilFound:!1,exiting:[],panels:[],items:[]}),live:[`panels`,`items`],sync:e=>({multiple:e.multiple??!1,collapsible:e.collapsible??!0,disabled:e.disabled??!1,keepMounted:e.keepMounted??!1,hiddenUntilFound:e.hiddenUntilFound??!1,...e.value===void 0?{}:{value:e.value}}),api:D,slots:e=>({root:e({state:e=>({value:e.value,disabled:i(e),multiple:e.multiple}),attrs:e=>({"data-disabled":i(e)?``:void 0}),bind(e,{api:t,store:n}){let r=s(e,n);if(typeof MutationObserver>`u`)return r;let i=new MutationObserver(n=>{n.some(n=>!t.internal.insideItem(n.target,e))&&t.internal.syncItems()});return i.observe(e,{childList:!0,subtree:!0}),()=>{i.disconnect(),r()}}}),item:e({props:{value:`id`,disabled:`boolean`,onOpenChange:`callback`,onOpenChangeComplete:`callback`},selects:u({value:({key:e})=>[e],exiting:[],panels:[]}),state:(e,{key:t,props:n,api:r})=>j(e,t,r,n.disabled),attrs:(e,{key:t,props:n,api:r})=>({...h(e.value.includes(t)),"data-disabled":O(e,t,r,n.disabled)?``:void 0}),live:r((e,{key:t})=>{let n=e.items.indexOf(t);return{"data-index":n===-1?void 0:String(n)}}),bind:(e,{api:t,key:n})=>t.internal.registerItem(n,e)}),header:e({props:{value:{kind:`string`,from:`item`}},selects:u({value:({key:e})=>[e],exiting:[],panels:[]}),state:(e,{key:t,api:n})=>j(e,t,n),attrs:(e,{key:t,api:n})=>({...h(e.value.includes(t)),"data-disabled":O(e,t,n)?``:void 0})}),trigger:e({props:{value:{kind:`string`,from:`item`},disabled:`boolean`},selects:u({value:({key:e})=>[e],exiting:[],panels:({key:e})=>[e]}),state:(e,{key:t,props:n,api:r})=>j(e,t,r,n.disabled),attrs:(e,{id:t,key:n,props:r,api:i})=>{let a=e.value.includes(n),o=O(e,n,i,r.disabled);return{id:`${t}-trigger-${m(n)}`,type:`button`,"aria-expanded":String(a),"aria-disabled":o||T(e,n)?`true`:void 0,...h(a),"data-disabled":o?``:void 0}},live:r((e,{id:t,key:n})=>({"aria-controls":e.panels.includes(n)?`${t}-panel-${m(n)}`:void 0})),press({api:e,el:t,key:n,props:r,store:i},a){if(O(i.get(),n,e,r.disabled)){a?.preventDefault();return}v(t),e.toggle(n,{reason:`trigger-press`,event:a})},on:{keydown:(e,{el:t})=>g(e,t)},bind:e=>y(e)}),panel:e({role:`region`,props:{value:{kind:`string`,from:`item`},keepMounted:`boolean`,hiddenUntilFound:`boolean`},selects:u({value:({key:e})=>[e],exiting:({key:e})=>[e],panels:[]}),present:(e,{key:t,props:n})=>e.value.includes(t)||e.exiting.includes(t)||k(e,n)||A(e,n),state:(e,{key:t,api:n})=>j(e,t,n),attrs:(e,{id:t,key:n,props:r,api:i})=>{let a=e.value.includes(n);return{id:`${t}-panel-${m(n)}`,"aria-labelledby":`${t}-trigger-${m(n)}`,...p(a||e.exiting.includes(n),A(e,r)),...h(a),"data-disabled":O(e,n,i)?``:void 0}},bind(e,t){let{api:n,key:r,store:i}=t,a=n.internal.registerPanel(r),o=f(e,{size(e,t,n){e.style.setProperty(`--accordion-panel-height`,t),e.style.setProperty(`--accordion-panel-width`,n)},isOpen:()=>n.isOpen(r),isExiting:()=>i.get().exiting.includes(r),isFindable:()=>A(i.get(),t.props),opening:()=>n.internal.opening(r),reveal:e=>n.open(r,{reason:`find-in-page`,event:e}),trigger:()=>n.internal.triggerElement(r),subscribe:d(i,t),settled:e=>n.internal.settled(r,e),exited:()=>n.internal.finishExit(r)});return()=>{o(),a()}}})}),agent:{actions:[`setValue`,`open`,`close`,`toggle`,`openAll`,`closeAll`],closed:!0,reveals:!0}}),N=`:scope > :is(h1, h2, h3, h4, h5, h6)`;function P(){l(M,{root:{tag:`ui-accordion`,display:`block`,defaults:{collapsible:!0},state:{value:{get:e=>e.getValue(),set:(e,t)=>e.setValue(t??[])}},api:[`getValue`,`setValue`,`isOpen`,`open`,`close`,`toggle`,`openAll`,`closeAll`,`focus`]},item:{tag:`ui-accordion-item`,display:`block`},header:{tag:`ui-accordion-header`,display:`block`,target:e=>e.querySelector(N)??e,render(e){e.querySelector(N)||(e.setAttribute(`role`,`heading`),e.hasAttribute(`aria-level`)||e.setAttribute(`aria-level`,`3`))}},trigger:{tag:`ui-accordion-trigger`,display:`contents`,target:c},panel:{tag:`ui-accordion-panel`,display:`block`}})}P();export{C as createAccordionController};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,i as t,o as n,t as r}from"./chunks/DMLqacE8.js";r();export{t as confirm,e as createAlertDialogController,n as createConfirm};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{H as e,J as t,Jt as n,Qt as r,Vt as i,X as a,Xt as o,_ as s,mt as ee,r as c}from"./chunks/DC08tnkE.js";import{n as l}from"./chunks/Dh8MLjQO.js";import{r as u}from"./chunks/B7EgSgjQ.js";import{f as te,l as d,n as ne,s as f}from"./chunks/0eRGibL6.js";import{t as re}from"./chunks/Bjiy_F2N.js";import{i as p}from"./chunks/D02PaHn6.js";import{i as m,t as h}from"./chunks/DwV48AXv.js";import{o as g,r as ie}from"./chunks/BQeduZqT.js";import{n as _,t as v}from"./chunks/Dc1xK3Ii.js";import{n as ae,u as y}from"./chunks/C7tt0T3n.js";import{a as b,r as x,s as S}from"./chunks/CL4wjam9.js";import{n as C}from"./chunks/NKnbYGjC.js";import{t as w}from"./chunks/LyB6XIbN.js";import{a as T,i as E,l as D,m as O,o as k,p as A,t as j,y as M}from"./chunks/BcwkVTsR.js";import{i as N,o as P}from"./chunks/dR-12TPY.js";import{i as F,n as I}from"./chunks/B0f2j6zz.js";import{n as L}from"./chunks/yv8dTvNI.js";import{a as R,i as z,n as B,r as V}from"./chunks/DZpNQKZ9.js";import{n as H}from"./chunks/DdaCLml8.js";import{n as U,r as W,t as G}from"./chunks/C_SWFpWQ.js";import{a as K,c as q,d as oe,n as J,u as se}from"./chunks/C_Uanbrl.js";const ce=[];function Y(e,{api:t}){return{open:e.open,presentation:e.presentation,status:e.status,items:t.internal.listbox.visibleData()?.list??ce}}const X=U(),le={open:[],mounted:[],value:[],query:[],initial:[],items:[],status:[],listed:[],labeled:[],inline:[],disabled:[],formDisabled:[],readOnly:[],required:[],name:[],form:[],mounts:[],settled:[],groupLabels:[],presentation:[],trigger:[],payload:[],titled:[],described:[],modal:[]},ue=e=>({label:e({attrs:(e,{id:t})=>({id:`${t}-label`,for:`${t}-input`,...T(e)}),press({api:e,el:t}){t instanceof HTMLLabelElement&&t.control||e.focus()},bind:(e,{store:t})=>w(t,`labeled`)}),input:e({...X,keys:e=>[...X.keys,`Enter`,`Escape`,`Tab`,...e.inline?[`ArrowRight`,`End`]:[]],state:B,attrs:(e,t)=>({...X.attrs(e,t),name:e.name,form:e.form,"aria-autocomplete":e.inline?`both`:`list`,"aria-controls":e.mounted?z(e,t.id):void 0,"aria-labelledby":e.labeled?`${t.id}-label`:void 0,required:e.required?``:void 0,readonly:e.readOnly?``:void 0,disabled:e.disabled?``:void 0,...u(e.open),...T(e)}),on:{...X.on,focusin(e,{api:t,store:n}){t.internal.options().openOnFocus&&!n.get().open&&t.internal.show({event:e,by:`keyboard`,reason:`trigger-focus`})},focusout(e,{api:t,store:n}){let r=e.relatedTarget;n.get().open&&(r||n.get().presentation!==`sheet`)&&(r&&(t.internal.ownsElement(r)||t.internal.contentElement()?.contains(r))||(r||document.hasFocus())&&t.internal.hide({reason:`focus-out`,event:e}))}},press({api:e,store:t},n){!t.get().open&&e.internal.options().openOnFocus&&e.internal.show({event:n,by:g(n),reason:`trigger-press`})},bind(e,t){let{api:n,id:r}=t,i=e,a=[X.bind(e,t),n.internal.bindReset(i),o(i,n.internal.setFormDisabled),y(e,{store:t.store,presentation:n.internal.presentation,open:e=>n.internal.show({event:e,by:`touch`,reason:`trigger-press`})})];return()=>a.forEach(e=>e())}}),trigger:e({state:B,attrs:(e,{id:t})=>({type:`button`,tabindex:`-1`,"aria-expanded":String(e.open),"aria-controls":e.mounted?z(e,t):void 0,disabled:i(e)?``:void 0,...u(e.open),...T(e)}),on:L,press({api:e,store:t},n){e.internal.inputElement()?.focus({preventScroll:!0}),t.get().open?e.internal.hide({reason:`trigger-press`,event:n}):e.internal.show({event:n,by:`pointer`,reason:`trigger-press`})}}),clear:e({props:{keepMounted:`boolean`},present:(e,{props:t})=>!!t.keepMounted||e.value!==``&&!D(e),state:e=>({disabled:D(e)}),attrs:e=>({type:`button`,tabindex:`-1`,disabled:i(e)?``:void 0,"data-disabled":D(e)?``:void 0}),on:L,press({api:e}){e.clear({reason:`clear-press`}),e.internal.inputElement()?.focus({preventScroll:!0})}}),content:e({...V(),state:Y}),viewport:e({present:e=>e.presentation===`sheet`}),header:e({present:e=>e.presentation===`sheet`&&e.open}),list:e({...R(),state:Y}),item:e({...W(),selects:l({highlighted:({key:e})=>[e],listing:({key:e})=>[e],...le}),state:(e,{key:t,props:n})=>({highlighted:e.highlighted===t,disabled:!!n.disabled})}),"item-text":e(N()),"item-icon":e(I({component:`autocomplete`,...F})),group:e(A()),"group-label":e(k()),separator:e(O()),empty:e(E()),status:e(M()),arrow:e(j())}),de=[`input`,`trigger`,`clear`,`label`];function fe(e){let t=e.value??e.defaultValue??``;return{..._(e),value:t,query:t,initial:e.defaultValue??``,highlighted:null,items:e.items,status:e.status??`idle`,listed:!1,labeled:!1,inline:!!e.inlineComplete,disabled:!!e.disabled,formDisabled:!1,readOnly:!!e.readOnly,required:!!e.required,name:e.name,form:e.form,mounts:0,settled:!1,focusInList:!1,groupLabels:[],presentation:`popover`,listing:C}}function Z(e){return{items:e.items,status:e.status??`idle`,inline:!!e.inlineComplete,disabled:!!e.disabled,readOnly:!!e.readOnly,required:!!e.required,name:e.name,form:e.form,...e.defaultValue===void 0?{}:{initial:e.defaultValue},...e.open===void 0?{}:{open:e.open},...e.value===void 0?{}:{value:e.value}}}function pe(e){let{id:a,store:o,options:s,element:c}=e;ie(e,[`highlighted`,`focusInList`],e=>e?void 0:{highlighted:null,focusInList:!1});let l=ne(e),u=o.get().value,m=`imperative`,g=null,_=()=>c(`input`),y=()=>D.element()??c(`content`),b=()=>{let e=o.get();return!i(e)&&!e.readOnly},x=()=>!!s().inlineComplete;function S(e,t){let n=p(e);if(n)return t.entries().find(e=>!t.disabled(e)&&p(e.label).startsWith(n))}let C=G(e,{query:()=>o.get().query,items:()=>o.get().items,emptyItems:()=>s().emptyItems,filter:()=>s().filter??`contains`,autoHighlight:()=>s().autoHighlight||x()?`typing`:!1,preferred:e=>x()?S(o.get().query,e)?.key:void 0,highlight(e,t){C.listbox.highlight(e,{event:t?.event}),e!==null&&x()&&t?.reason===`list-navigation`&&N(e,t.event)},open(e,t){e.altKey||(g=t),k({event:e,by:`keyboard`})},onHighlight:(e,t,n)=>s().onHighlight?.(e,{index:t,event:n}),container:()=>c(`list`)??y(),scrollRoot:y});t(e,[`highlighted`],(e,t)=>{if(e.items!==t.items)return{highlighted:o.view({...t,...e},()=>C.settledHighlight(!1))}});let w=t=>de.some(n=>re(e,n).some(({el:e})=>e.contains(t))),T=v(e,{preset:ae,rules:()=>({trigger:_,returnFocus:!1,dismiss:(e,{event:t})=>A({reason:e,event:t}),contains:w,onOpenChange(e){e||(g=null,o.set({highlighted:null,focusInList:!1}))},onShow(){let e=c(`content`);if(e)return te(e,f(m),()=>[_()])},open({event:e,by:t},n){b()&&(m=t===`touch`&&O.resolve()!==`sheet`?`pointer`:t??`imperative`,o.set({focusInList:P(e)&&e?.target!==_()}),n(m))},close(e,t){let n=o.get().focusInList&&!!y()?.contains(document.activeElement);t();let r=_();n&&r&&!o.get().open&&d(r)}})}),{control:E,popup:D}=T.internal,O=T.internal.presentation,{show:k,hide:A}=E;function j(e,t,{event:n,query:r=e}={}){let a=o.get();if((i(a)||a.readOnly)&&t!==`reset`)return!1;if(u=e,C.cause(t,n),e===a.value||l(`value`,e,{reason:t,event:n}))return u===e&&o.set({query:r}),!0;let s=_();return s&&s.value!==a.value&&(s.value=a.value),!1}function M(e,t){if(!b())return;let n=e.value,r=t,i=x()&&!r.isComposing&&r.inputType?.startsWith(`insert`)&&r.inputType!==`insertReplacementText`&&e.selectionEnd===n.length?S(n,C.listbox):void 0,a=i?n+i.label.slice(n.length):n;j(a,`input-change`,{event:t,query:n})&&(i&&a!==n&&(e.value=a,e.setSelectionRange(n.length,a.length)),o.get().open||(n&&(g=`first`),k({event:t,by:`keyboard`,reason:`input-change`})))}function N(e,t){let n=C.listbox.find(e)?.label,r=_(),{query:i}=o.get();if(n===void 0||!j(n,`list-navigation`,{event:t,query:i})||!r)return;r.value=n;let a=p(n).startsWith(p(i))?i.length:n.length;r.setSelectionRange(a,n.length)}function F(e){return s().onSubmit?.(o.get().value,{event:e}),!e?.defaultPrevented}function I(e,t){let n=C.listbox.find(e);if(!n||C.listbox.disabled(n)||!b())return!1;j(n.label,`item-press`,{event:t});let r=_();return r&&r.value!==o.get().value&&(r.value=o.get().value),A({reason:`item-press`,event:t}),!0}function L(e,t){I(e,t)&&s().submitOnSelect&&F(t)&&n(_()?.form)}function R(e){let{open:t,highlighted:n}=o.get();if(t&&n!==null){let t=C.listbox.element(n);if(t?.matches(`a[href]`))return e.preventDefault(),t.click();if(!I(n,e))return e.preventDefault();(!s().submitOnSelect||!F(e))&&e.preventDefault();return}t&&A({reason:`input-commit`,event:e}),F(e)||e.preventDefault()}function z(e){if(C.navigate(e))return;let{open:t,value:n,query:r}=o.get();switch(e.key){case`ArrowUp`:e.altKey&&t&&(e.preventDefault(),A({reason:`escape-key`,event:e}));return;case`ArrowDown`:e.altKey&&!t&&(e.preventDefault(),k({event:e,by:`keyboard`}));return;case`Enter`:return R(e);case`ArrowRight`:case`End`:x()&&n!==r&&!e.shiftKey&&(C.cause(`input-change`,e),o.set({query:n}));return;case`Escape`:if(t&&n!==r&&j(r,`escape-key`,{event:e})){let e=_();e&&(e.value=r)}return;case`Tab`:t&&A({reason:`focus-out`,event:e})}}function B(e){return ee(e.ownerDocument,`reset`,t=>{t.target===e.form&&r(t,()=>{let{initial:t}=o.get();j(t,`reset`),e.value!==o.get().value&&(e.value=o.get().value)})},{capture:!0})}let V={id:a,isOpen:T.isOpen,setOpen:T.setOpen,open:T.open,close:T.close,toggle:T.toggle,getValue:()=>o.get().value,setValue:(e,{reason:t=`imperative`,event:n}={})=>e!==o.get().value&&j(e,t,{event:n}),clear:({reason:e=`imperative`,event:t}={})=>o.get().value!==``&&j(``,e,{event:t}),focus:()=>_()?.focus(),internal:{...C,options:s,popup:D,presentation:O,show:k,hide:A,press:L,typed:M,onInputKeyDown:z,ownsElement:w,bindReset:B,inputElement:_,anchorElement:_,contentElement:y,arrowElement:()=>c(`arrow`),text:e=>e.value,itemProps:t=>e.props(`item`,t),setFormDisabled:e=>o.set({formDisabled:e}),initialFocus(){let e=g;if(g=null,o.get().focusInList){let e=C.listbox.firstEnabled();return e===void 0?y():(C.listbox.highlight(e,{focus:!1}),C.listbox.element(e)??y())}return e===`first`&&o.get().query?C.settle(!0,null):e&&C.listbox.highlight(C.listbox.stepKey(e)??null),o.get().presentation===`sheet`?_():void 0},onListKeyDown(e){o.get().focusInList&&e.target!==_()&&h(e,{listbox:C.listbox,highlighted:o.get().highlighted,choose:L,focusInput(){o.set({focusInList:!1}),_()?.focus({preventScroll:!0})}})},contentProps:e=>T.internal.contentProps(e)}};t(e,[`query`],(e,t)=>`value`in e&&e.value!==t.value&&e.value!==u?{query:e.value}:void 0);let H=o.get().value;return o.subscribe(()=>{let{value:e}=o.get();e!==H&&(H=e,e!==u&&(u=e,o.set({query:e})))}),V}const me=pe;function he(){return a()}const ge=/* @__PURE__ */ e({name:`autocomplete`,options:{container:`value`,value:`string`,defaultValue:`string`,onValueChange:`callback`,open:`boolean`,defaultOpen:`boolean`,onOpenChange:`callback`,onOpenChangeComplete:`callback`,onSubmit:`callback`,items:`value`,emptyItems:`value`,filter:m([`contains`,`startsWith`,`fuzzy`],`contains`),inlineComplete:`boolean`,autoHighlight:`boolean`,openOnFocus:`boolean`,submitOnSelect:`boolean`,status:`string`,onHighlight:`callback`,onLoadMore:`callback`,announcement:`value`,loop:`boolean`,modal:H,presentation:`string`,disabled:`boolean`,readOnly:`boolean`,required:`boolean`,name:`string`,form:`string`,controller:`value`,dismissible:`boolean`,onDismissAttempt:`callback`},state:fe,live:[`highlighted`],controlled:[`open`,`value`],sync:Z,api:me,slots:e=>ue(e),agent:{actions:[`setOpen`,`setValue`,`clear`]}}),Q=/* @__PURE__ */ new WeakMap;function _e(){c(ge,{root:{tag:`ui-autocomplete`,defaults:{loop:!0,dismissible:!0},display:`contents`,kinds:x,properties:[`filter`],options:e=>{let t=e;return{items:t.items,...(typeof t.filter==`function`||t.filter===!1)&&{filter:t.filter},container:void 0,onSubmit:(t,{event:n})=>ve(e,t,n)}},state:{value:{get:e=>e.getValue(),set:(e,t)=>e.setValue(t??``)},...b},api:[`isOpen`,`setOpen`,`open`,`close`,`toggle`,`getValue`,`setValue`,`clear`,`focus`],portal:S(`ui-autocomplete-viewport`),render(e,t){let n=e;return $(n,t.api),t.subscribe(()=>$(n,t.api))}},label:{tag:`ui-autocomplete-label`,display:`block`},input:{tag:`ui-autocomplete-input`,display:`contents`,target:s(`input`)},trigger:{tag:`ui-autocomplete-trigger`,display:`contents`,target:s(`button`)},clear:{tag:`ui-autocomplete-clear`,display:`contents`,target:s(`button`)},content:{tag:`ui-autocomplete-content`,kinds:x},list:{tag:`ui-autocomplete-list`,display:`block`},item:{tag:`ui-autocomplete-item`,display:`block`},"item-text":{tag:`ui-autocomplete-item-text`,...K},"item-icon":`ui-autocomplete-item-icon`,group:{tag:`ui-autocomplete-group`,display:`block`},"group-label":{tag:`ui-autocomplete-group-label`,display:`block`},separator:{tag:`ui-autocomplete-separator`,display:`block`},empty:{tag:`ui-autocomplete-empty`,...se},status:{tag:`ui-autocomplete-status`,display:`block`},arrow:{tag:`ui-autocomplete-arrow`,display:`block`}})}function ve(e,t,n){let r=new CustomEvent(`submit`,{cancelable:!0,composed:!0,detail:{value:t}});e.dispatchEvent(r)||n?.preventDefault()}function $(e,t){if(!e.items)return;let n=oe(e),r=Q.get(e)??[...e.querySelectorAll(`ui-autocomplete-content ui-autocomplete-list`)].find(t=>t.closest(`ui-autocomplete`)===e);if(!r){let t=J(n,`ui-autocomplete-content`,!1);r=J(n,`ui-autocomplete-list`,!1),t.append(r),e.append(t)}Q.set(e,r);let i=t.internal.listbox.visibleData()?.list??e.items;q(r,`ui-autocomplete`,i,n)}_e();export{he as createAutocompleteController};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{H as e,K as t,mt as n,r}from"./chunks/DC08tnkE.js";import{t as i}from"./chunks/XsM0J1Ex.js";import{t as a}from"./chunks/D5LiaI5R.js";function o(e,t){return t?e.complete?e.naturalWidth>0?`loaded`:`error`:`loading`:`error`}const s=a({position:`absolute`,width:`1px`,height:`1px`,opacity:0,"pointer-events":`none`});function c(e){return{"data-loading-status":e.loadingStatus}}function l(e){return!!(e.getAttribute(`src`)||e.getAttribute(`srcset`))}const u=/* @__PURE__ */ e({name:`avatar`,options:{onLoadingStatusChange:`callback`,fallbackDelay:`number`},state:e=>({loadingStatus:`idle`,delayElapsed:!1}),controlled:[],api:e=>{let{store:r,props:a,element:s,options:c}=e,u=i(e,e=>t(e)),d=(e,t,n)=>u(`loadingStatus`,e,{reason:t,event:n}),f=()=>{r.get().loadingStatus!==`loaded`&&d(`loading`,`src-change`)};return{internal:{watchImage(e){let t=()=>{let t=o(e,l(e));t===`loading`?f():d(t,t===`loaded`?`image-load`:`image-error`)};t();let r=new MutationObserver(t);r.observe(e,{attributeFilter:[`src`,`srcset`,`sizes`,`crossorigin`]});let i=[n(e,`load`,e=>d(`loaded`,`image-load`,e)),n(e,`error`,e=>d(`error`,`image-error`,e)),()=>r.disconnect()];return()=>{i.forEach(e=>e()),queueMicrotask(()=>{s(`image`)||d(`idle`,`src-change`)})}},watchImageRemoval(e){let t=new MutationObserver(()=>{r.get().loadingStatus!==`idle`&&!s(`image`)&&d(`idle`,`src-change`)});return t.observe(e,{childList:!0,subtree:!0}),()=>t.disconnect()},startDelay(){let e,t=!0;return queueMicrotask(()=>{if(!t)return;let n=a(`fallback`)?.delay??c().fallbackDelay??0;n>0&&(e=setTimeout(()=>r.set({delayElapsed:!0}),n))}),()=>{t=!1,clearTimeout(e)}}}}},slots:e=>({root:e({state:e=>({loadingStatus:e.loadingStatus}),attrs:c,bind:(e,{api:t})=>{let n=[t.internal.startDelay(),t.internal.watchImageRemoval(e)];return()=>n.forEach(e=>e())}}),image:e({state:e=>({loadingStatus:e.loadingStatus}),attrs:e=>({...c(e),"aria-hidden":e.loadingStatus===`loaded`?void 0:`true`,style:e.loadingStatus===`loaded`?void 0:s}),bind:(e,{api:t})=>t.internal.watchImage(e)}),fallback:e({props:{delay:`number`},present:(e,{props:t})=>e.loadingStatus!==`loaded`&&(!(t.delay&&t.delay>0)||e.delayElapsed),state:e=>({loadingStatus:e.loadingStatus}),attrs:c})})});function d(){r(u,{root:{tag:`ui-avatar`,children:{image:e=>e.querySelector(`:scope > img`)},options:e=>({fallbackDelay:Number(e.querySelector(`:scope > ui-avatar-fallback`)?.getAttribute(`delay`))||0}),optionalChildren:[`image`],kinds:{fallbackDelay:null}},fallback:{tag:`ui-avatar-fallback`,display:`block`}})}d();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{H as e,S as t,Vt as n,Zt as r,dt as i,g as a,r as o,v as s,y as c}from"./chunks/DC08tnkE.js";import{a as l}from"./chunks/0eRGibL6.js";import{n as u}from"./chunks/XsM0J1Ex.js";import{a as d,i as f,n as p,r as m,t as h}from"./chunks/BgBB013u.js";function g(e){let{store:r,options:a}=e,o=l(),s=(t,n,a)=>{i(r.get()[t],n)||(r.set({[t]:n}),u(e,t,n,{reason:`action`,source:a}))};return c(e,()=>r.get().pending),{internal:{press(e,i=t=>a().action?.(e,t)){let c=r.get();if(n(c)||c.pending)return e?.preventDefault();let l=o(`action`,e);s(`error`,void 0,l),t(i,l,{pending:e=>s(`pending`,e,l),done:()=>{},failed:e=>s(`error`,e,l)})}}}}const _=g,v=/* @__PURE__ */ e({name:`button`,options:{disabled:`boolean`,focusableWhenDisabled:`boolean`,type:`string`,pendingAnnouncement:`string`,action:`action`},state:e=>({disabled:!!e.disabled,formDisabled:!1,focusableWhenDisabled:!!e.focusableWhenDisabled,type:e.type??`button`,element:`unknown`,pending:!1,error:void 0}),sync:e=>({disabled:!!e.disabled,focusableWhenDisabled:!!e.focusableWhenDisabled,type:e.type??`button`}),api:e=>_(e),slots:e=>({root:e({...d(e=>e.element),focus:`tab-stop`,state:e=>({disabled:n(e),pending:e.pending,error:e.error}),attrs:e=>({...p(e.element,{type:e.type,disabled:n(e),focusable:e.focusableWhenDisabled}),...e.pending&&!n(e)&&{"aria-disabled":`true`},"aria-busy":e.pending?`true`:void 0,"data-disabled":n(e)?``:void 0,"data-pending":e.pending?``:void 0}),press:({api:e},t)=>e.internal.press(t),on:{keydown:(e,{el:t})=>m(e,t),keyup:(e,{el:t})=>f(e,t)},bind(e,{store:t}){return t.set({element:h(e)}),r(e,t)}})})}),y=/* @__PURE__ */ new WeakMap,b=e=>e===`button`||e===`submit`||e===`reset`;function x(e){let t=a(e);if(!t)return;let n=t.getAttribute(`type`),r=y.get(t),i=b(r)?r:`button`;(!y.has(t)||n!==i)&&y.set(t,n);let o=y.get(t);return b(o)?o:void 0}function S(){o(v,{root:{tag:`ui-button`,target:a,display:`contents`,kinds:{type:null},options:e=>({type:x(e),action:s(e)})}})}S();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,t}from"./chunks/C4_bULs1.js";t();export{e as createCalendarController};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{H as e,P as t,R as n,V as r,X as i,g as a,mt as o,r as s}from"./chunks/DC08tnkE.js";import{n as c}from"./chunks/B7EgSgjQ.js";import{n as l,o as u}from"./chunks/0eRGibL6.js";import{t as d}from"./chunks/Bjiy_F2N.js";import{a as f,c as p,i as m,r as h}from"./chunks/DwDilCo2.js";import{t as g}from"./chunks/DjRcw3Y0.js";import"./chunks/CMg-8UVf.js";import{o as _}from"./chunks/By30h-7B.js";import{o as v}from"./chunks/BgBB013u.js";import{t as y}from"./chunks/DT3Hb76X.js";import{n as b}from"./chunks/F37aF4-L.js";import{n as x,r as S}from"./chunks/BtVkQf3z.js";import{s as C,t as w}from"./chunks/CFODo-m2.js";import{i as T,n as E,o as D,s as O,t as k}from"./chunks/asSN9iEp.js";function A(e){let t=e.now??(()=>performance.now()),n=/* @__PURE__ */ new Set,r=!1,i,a=0,o=0,s=()=>r&&n.size>0;function c(){clearTimeout(i),i=void 0,!(!r||n.size>0)&&(o=t(),i=setTimeout(l,a))}function l(){i=void 0,a=e.interval(),e.onTick(),c()}function u(l,u){let d=s();u!==n.has(l)&&(u?(n.size===0&&r&&i&&(a=Math.max(0,a-(t()-o))),n.add(l),clearTimeout(i),i=void 0):(n.delete(l),c()),s()!==d&&e.onPausedChange(s()))}return{setRunning(t){if(t===r)return;let n=s();r=t,a=e.interval(),c(),s()!==n&&e.onPausedChange(s())},restart(){a=e.interval(),c()},setPaused:u,isPaused:s,destroy(){r=!1,clearTimeout(i)}}}const j=e=>parseFloat(e)||0;function M(e,t,n){let{vertical:r,rtl:i}=n,a=getComputedStyle(e),o=r?e.clientHeight:e.clientWidth,s=x(e);return{slides:t.map(({el:t,key:n})=>{let a=x(t),c=S(t),l=a.x-s.x-e.clientLeft,u=a.y-s.y-e.clientTop;return r?{key:n,box:{start:u,size:c.height}}:{key:n,box:{start:i?o-l-c.width:l,size:c.width}}}),viewportSize:o,maxScroll:Math.max(0,(r?e.scrollHeight:e.scrollWidth)-o),paddingStart:j(r?a.scrollPaddingTop:i?a.scrollPaddingRight:a.scrollPaddingLeft),paddingEnd:j(r?a.scrollPaddingBottom:i?a.scrollPaddingLeft:a.scrollPaddingRight)}}function N(e,t){e.forEach(({el:n},r)=>{let i=(r-t+e.length)%e.length;i?n.style.order=String(i):n.style.removeProperty(`order`)})}function P(e){for(let{el:t}of e)t.style.removeProperty(`order`)}function F(e,t,n){let[r,i]=n?I:[I[1],I[0]],a=new Map(t.map(e=>[e.leader,e.margin]));e.forEach(({el:e},t)=>{e.style.removeProperty(i);let n=a.get(t);if(n===void 0){e.style.setProperty(`scroll-snap-align`,`none`),e.style.removeProperty(r);return}e.style.setProperty(`scroll-snap-align`,`start`),e.style.setProperty(r,`${Math.round(n*100)/100}px`)})}const I=[`scroll-margin-block-start`,`scroll-margin-inline-start`];function ee(e,t){for(let{el:n}of e){n.style.setProperty(`scroll-snap-align`,t);for(let e of I)n.style.removeProperty(e)}}const L=/* @__PURE__ */ new WeakMap;function te(e,t,n){let r=L.get(e);if(e.hasAttribute(`aria-labelledby`)||e.hasAttribute(`aria-label`)&&e.getAttribute(`aria-label`)!==r)return()=>{};let i,a=()=>{let{order:r}=n.get();if(r===i)return;i=r;let a=r.indexOf(t);if(a<0)return;let o=`${a+1} of ${r.length}`;L.set(e,o),e.getAttribute(`aria-label`)!==o&&e.setAttribute(`aria-label`,o)};return a(),n.subscribe(a)}function R(e,t){let{id:n,store:r,element:i}=e;function a(e,t,n){return n?.page===void 0?e.indicators.indexOf(t)+1:n.page}let o=b(e,{slot:`indicator`,key:`stop`,remember:!1,focusable:e=>!i(`indicator`,e.key)?.hidden,preferred:e=>a(r.get(),e.key,e.props)===r.get().page,claims(e,t){let n=a(e,t.key,t.props);return n===0||n===e.page},move(e,{from:t,items:n,rtl:r}){if(e.ctrlKey||e.metaKey||e.shiftKey)return;let i=e.key===`Home`?`first`:e.key===`End`?`last`:f(e.key,r);if(i!==void 0)return n[h(n.indexOf(t),i,n.length,!0)].key},onItemsChange(){r.set({indicators:d(e,`indicator`).map(e=>e.key)}),o.check()}});return{indicatorPage:a,roving:o,bindIndicator(e,t){return o.bind(e,t)},pressIndicator(e,n,i,o){if(v(o,e))return;let s=a(r.get(),n,i);e&&document.activeElement!==e&&e.focus({preventScroll:!0}),s>0&&t(s,`item-press`,o)},onIndicatorKeyDown(n){let s=o.keydown(n,n.target);if(!s||s.key===s.from)return;let c=i(`indicator`,s.key);if(c?.matches(`a[href]`))return c.click();let l=a(r.get(),s.key,e.props(`indicator`,s.key));l>0&&t(l,`list-navigation`,n)}}}function z(e,t,n){let r=[];if(n!==`auto`){let t=Math.max(1,Math.floor(n));for(let n=0;n<e.length;n+=t)r.push(e.slice(n,n+t).map((e,t)=>n+t));return r}for(let n=0;n<e.length;n++){let i=r[r.length-1],a=i&&e[i[0]],o=e[n].start+e[n].size;a&&o-a.start<=t+.5?i.push(n):r.push([n])}return r}function B(e,t,n){return e===`start`?0:e===`center`?(t-n)/2:t-n}function ne(e,t){let{slides:n,snapport:r,paddingStart:i,maxScroll:a}=e,o=[];for(let e of z(n,r,t.slidesPerPage)){let s=n[e[0]],c=n[e[e.length-1]],l=B(t.align,r,c.start+c.size-s.start),u=y(s.start-l-i,0,a),d=o[o.length-1];if(d&&Math.abs(u-d.position)<1){d.slides.push(...e);continue}o.push({slides:[...e],position:u,leader:e[0],margin:l})}return o}function V(e,t){if(e.length<2||!e[t])return null;let n=e[t],r=e[(t+1)%e.length],i={sizes:e.map(e=>e.size),gap:r.start-n.start-n.size,start:n.start};return H(i,t).every((t,n)=>Math.abs(t.start-e[n].start)<1)?i:null}function H(e,t){let n=e.sizes.length,r=Array(n),i=e.start;for(let a=0;a<n;a++){let o=(t+a)%n;r[o]={start:i,size:e.sizes[o]},i+=e.sizes[o]+e.gap}return r}function U(e,t){return z(H(e,0),t.snapport,t.slidesPerPage)}function W(e,t,n){let r=e[t[0]],i=e[t[t.length-1]],a=B(n.align,n.snapport,i.start+i.size-r.start);return{slides:[...t],position:r.start-a-n.paddingStart,leader:t[0],margin:a}}function G(e,t){let n=U(e,t);if(n.length<2)return!1;let r=H(e,0),i=e.sizes.reduce((t,n)=>t+n+e.gap,0),a=0;return n.forEach((e,t)=>{let o=n[(t+1)%n.length];a=Math.max(a,(r[o[0]].start-r[e[0]].start+i)%i)}),t.maxScroll>=2*a-1}function K(e,t,n){let r=H(e,n);return U(e,t).map(e=>W(r,e,t))}function q(e,t,n,r,{lazy:i=!1}={}){let a=U(e,t),o=H(e,n.first),s=n.position+t.paddingStart,c=n.first;o.forEach((e,t)=>{e.start<=s+.5&&e.start>o[c].start&&(c=t)});let l=a.map(e=>e[0]);l.includes(n.first)&&l.unshift(n.first);let u=null;for(let s of l){let l=s===n.first?o:H(e,s),d=l[c].start-o[c].start,f=n.position+d,p=Math.min(f,t.maxScroll-f);if(r){let e=W(l,a[r.page],t).position;if((e-f)*r.heading<-.5)continue;p=Math.min(p,e,t.maxScroll-e)}if(!(p<-.5)&&((!u||p>u.room+.5)&&(u={first:s,delta:d,room:p}),i&&s===n.first))break}return u&&{first:u.first,delta:u.delta}}function J(e,t){let n=-1;for(let r=0;r<e.length;r++)(n===-1||Math.abs(e[r].position-t)<Math.abs(e[n].position-t))&&(n=r);return n}function re(e,t,n){return Math.min(e.start+e.size,t+n)-Math.max(e.start,t)>=Math.min(e.size,n)/2-.5}function Y(e,t,n,r){let i=e+t;return i>=1&&i<=n?i:!r||n<2?e:i<1?n:1}function ie(e,t,n){let{store:r}=e;return function(i){if(i.defaultPrevented||i.altKey||i.ctrlKey||i.metaKey||i.shiftKey)return;let a=i.target;if(a.closest(`input, textarea, select, [contenteditable]:not([contenteditable="false"]), [role="slider"], [role="spinbutton"], [role="listbox"], [role="grid"], [role="tablist"], [role="menu"], [role="menubar"], [role="radiogroup"], [role="tree"], [role="toolbar"]`))return;let{page:o,orientation:s,loop:c,pageCount:l}=r.get(),u=p(i.key,s,n());if(u===void 0||l===null)return;i.preventDefault();let f=u===`first`?1:u===`last`?l:Y(o,u===1?1:-1,l,c),m=d(e,`item`).find(({el:e})=>e.contains(a));if(!t(f,`list-navigation`,i,u===1||u===-1?u:void 0)||!m)return;let h=r.get().pages[r.get().page-1]?.[0];if(!h||h===m.key)return;let g=e.element(`item`,h);g&&(g.hasAttribute(`tabindex`)||g.setAttribute(`tabindex`,`-1`),r.set({focused:h}),g.focus({preventScroll:!0}))}}function X(e){let t=null,n,r=null,i=!1,a=!1,o=!1,s=e=>Math.max(0,e.findIndex(e=>e.key===r));function c(e){r=null,i&&(i=!1,P(e))}function l(i,{lazy:o=!1}={}){let c=e.motion();if(!t||!n||!c||c.isHeld())return;let l=e.slides(),u=s(l),d=c.position(),f=q(t,n,{position:d,first:u},i,{lazy:o});if(!f||f.first===u)return;let p=e.visual(),m=l[f.first].key;r=m,a=!0;try{e.measure()}finally{a=!1}if(r!==m)return;let h=e.visual();c.shift(d,f.delta,e=>e<0?e:h.indexOf(p[e]))}return{isActive:()=>t!==null,isRotating:()=>a,prepare(e,t){if(!t||o){c(e);return}let n=s(e);return n>0?(N(e,n),i=!0):i&&(i=!1,P(e)),n},layout(e,i,a){return n=i,t=a===void 0?null:V(e,a),a&&!t&&(o=!0),t&&!G(t,n)&&(t=null),a&&!t&&(r=null),t&&K(t,n,a??0)},reset(e){c(e),o=!1},rotateToward(n,r){let i=e.motion();if(!t||!i)return;let a=e.pages(),o=i.position(),s=(n-J(a,o)+a.length)%a.length;l({page:n,heading:(s===0?Math.sign(a[n].position-o):r??(s<=a.length/2?1:-1))<0?-1:1},{lazy:!0})},recenter(){t&&!a&&!e.motion()?.isMoving()&&l()}}}function ae(e){let{viewport:t}=e,n=t.ownerDocument,r=n.defaultView??window,i=E(0,0),a=null,s=null,c=0,l=0,u=null,d=!1,f=!1,p=!1,m=!1,h=0,g=null,v=!1,b=!1,x=[],S,k=!1,A={x:0,y:0},j=w(),M=`onscrollend`in t,N=[o(t,`scroll`,G,{passive:!0}),...M?[o(t,`scrollend`,e=>K(e))]:[],o(t,`touchstart`,q,{passive:!0}),o(t,`touchend`,re,{passive:!0}),o(t,`touchcancel`,re,{passive:!0}),o(t,`pointerdown`,ae),o(t,`dragstart`,t=>{e.canDrag()&&t.preventDefault()})];function P(){let{vertical:n,rtl:r}=e.axis();return n?t.scrollTop:r?-t.scrollLeft:t.scrollLeft}function F(n){if(k)return;let{vertical:r,rtl:i}=e.axis(),a=y(n,0,e.maxScroll());u=a,r?t.scrollTop=a:t.scrollLeft=i?-a:a,I(n-a),e.onScroll()}function I(t){let n=e.content();if(!n||t===0&&l===0)return;if(l=t,t===0)return n.style.removeProperty(`translate`);let{vertical:r,rtl:i}=e.axis(),a=`${Math.round(-t*(i&&!r?-1:1)*100)/100}px`;n.style.translate=r?`0 ${a}`:`${a} 0`}function ee(){return{snapPoints:e.positions().map((e,t)=>({id:String(t),extent:e})),dimension:e.viewportSize(),dismissible:!1,expandOnScroll:!1,physics:e.physics()}}function L(){let e=P();i=E(e,Math.max(0,J(te(),e)))}let te=()=>e.positions().map(e=>({position:e}));function R(t,n){if(k||e.positions().length===0)return;let r=T(i,t,ee());i=r.state,z(i.phase===`dragging`);let a=`time`in t?t.time:performance.now();for(let e of r.effects)B(e,a,n)}function z(t){t!==v&&(v=t,e.onDragChange(t))}function B(t,n,i){if(t.type===`move`){if(a)return H(),F(t.extent);e.setSnapping(!1),s=t.extent,c||=r.requestAnimationFrame(ne);return}if(t.type===`settle`)return V(t,n);t.type===`snap`&&t.reason===`swipe`&&i instanceof PointerEvent&&e.onRelease(Number(t.id),i)}function ne(){c=0,s!==null&&(F(s),s=null)}function V(t,n){H(),s=null;let{from:i,to:o,velocity:c}=t;if(Math.abs(o-i)<.5&&Math.abs(c)<.01||e.reducedMotion())return F(o),U();e.setSnapping(!1);let l=O(t.response,t.dampingRatio,i-o,c),u=D(l),d={frame:0,to:o},f=e=>{if(a!==d)return;let t=e-n;if(t>=u)return F(d.to),U();F(d.to+l.position(Math.max(0,t))),d.frame=r.requestAnimationFrame(f)};a=d,d.frame=r.requestAnimationFrame(f)}function H(){a&&r.cancelAnimationFrame(a.frame),a=null}function U(){a=null,R({type:`settled`}),i.phase===`idle`&&((!e.dragFree()||W())&&e.setSnapping(!0),e.onSettle())}function W(){let t=P();return e.positions().some(e=>Math.abs(e-t)<1)}function G(t){let n=P(),i=u!==null&&Math.abs(n-u)<1;u=null,!(a||v||i)&&(p=!0,S=t,e.onScroll(),!M&&(r.clearTimeout(h),h=r.setTimeout(()=>K(t),120)))}function K(t){if(a||v||!p)return;if(d){m=!0;return}p=!1;let n=f;f=!1,L(),e.onScrollRest(P(),{touch:n,event:t??S})}function q(){d=!0,f=!0,m=!1,a&&(H(),L(),p=!0)}function re(){d=!1,m&&(m=!1,K())}function Y(){return d||v||p||g!==null}function ie(e){return e instanceof Element&&e.closest(`input, textarea, select, [contenteditable]:not([contenteditable="false"]), [data-carousel-no-drag]`)!==null}function X(t,n){let{vertical:r,rtl:i}=e.axis();return A.y=r?n:i?-t:t,A.x=r?t:n,A}function ae(r){if(r.pointerType===`touch`||r.button!==0||g!==null||!e.canDrag()||ie(r.target))return;i.phase===`idle`&&L(),g=r.pointerId,b=!1,t.style.userSelect=`none`,j.reset(),X(r.clientX,r.clientY),j.add(r.timeStamp,A.y),x=[o(n,`pointermove`,oe,{capture:!0}),o(n,`pointerup`,se,{capture:!0}),o(n,`pointercancel`,se,{capture:!0})];let a=r.pointerType===`pen`?`pen`:`mouse`;R({type:`down`,time:r.timeStamp,x:A.x,y:A.y,pointer:a},r)}function oe(e){if(e.pointerId!==g)return;let r=e.getCoalescedEvents?.();for(let t of r?.length?r:[e])j.add(t.timeStamp,X(t.clientX,t.clientY).y);if(X(e.clientX,e.clientY),R({type:`move`,time:e.timeStamp,x:A.x,y:A.y,scroll:null},e),!(i.phase!==`dragging`||b)){b=!0,n.getSelection()?.removeAllRanges();try{t.setPointerCapture(e.pointerId)}catch{}}}function se(r){if(r.pointerId!==g)return;g=null,x.forEach(e=>e()),x=[],t.style.removeProperty(`user-select`);let a=r.type===`pointercancel`?0:j.velocity(r.timeStamp);i.phase===`dragging`&&e.dragFree()?ce(r,a):R({type:`up`,time:r.timeStamp,velocity:a},r),b&&_(n)}function ce(t,n){if(i.phase!==`dragging`)return;let r=-n,a=y(i.extent+C(r,.998),0,e.maxScroll()),o=e.physics(),s=Math.max(0,J(te(),a));i={phase:`settling`,extent:i.extent,restingIndex:i.restingIndex,targetIndex:s,from:i.extent,to:a,velocity:r,response:o.response,dampingRatio:1,startTime:t.timeStamp},z(!1),V({type:`settle`,...i},t.timeStamp),e.onRelease(s,t)}return{position:P,isHeld:Y,isMoving:()=>Y()||a!==null,moveTo(t,{animate:n=!0}={}){let r=e.positions();if(!(k||t<0||t>=r.length)&&!(d||v||g!==null)){if(!n){H(),F(r[t]),i=E(r[t],t),e.setSnapping(!0);return}i.phase===`idle`&&L(),R({type:`snap-to`,time:performance.now(),id:String(t),reason:`imperative`})}},shift(e,t,n){k||(a&&(a.to+=t),i.phase===`settling`&&(i={...i,extent:i.extent+t,from:i.from+t,to:i.to+t,restingIndex:n(i.restingIndex),targetIndex:n(i.targetIndex)}),F(e+t),i.phase===`idle`&&L())},destroy(){k=!0,H(),c&&r.cancelAnimationFrame(c),r.clearTimeout(h),N.forEach(e=>e()),x.forEach(e=>e()),v&&e.onDragChange(!1),t.style.removeProperty(`user-select`),e.content()?.style.removeProperty(`translate`)}}}const oe=/* @__PURE__ */ new Set([`previous-press`,`next-press`,`item-press`,`list-navigation`,`swipe`,`scroll`]),se={...k.ios,rubberBand:.55,rubberBandDimension:null};function ce(e,t){return e.addEventListener(`visibilitychange`,t),()=>e.removeEventListener(`visibilitychange`,t)}function le(e,t){return!t||e.dragFree?`none`:`${e.orientation===`vertical`?`y`:`x`} mandatory`}function ue(e){let{id:r,store:i,options:a,element:s,onDestroy:c}=e,f=l(e),p=[],m=[],h=[],_=0,v=0,b=!1,x=!1,S,C=!1,w,T,E=()=>C=n(s(`viewport`)??s(`root`)),D=()=>b&&C!==n(s(`viewport`)??s(`root`)),O=()=>(D()&&U(),C),k=()=>({vertical:i.get().orientation===`vertical`,rtl:C}),j=X({slides:()=>d(e,`item`),motion:()=>w,pages:()=>p,visual:()=>m,measure:U}),N=A({interval:()=>i.get().interval,onTick:()=>{let{page:e,pageCount:t}=i.get();t&&z(Y(e,1,t,!0),`timeout`,void 0,1)},onPausedChange:e=>i.set({paused:e})});c(N.destroy);let P=()=>i.get().pageCount,I=e=>{let{page:t,loop:n}=i.get(),r=P();return r===null?e===1||t>1:Y(t,e,r,n)!==t};function L(e,{reason:t=`imperative`,event:n}={}){let{page:r,loop:a}=i.get(),o=P(),s=o===null?r+e:Y(r,e,o,a);return s!==r&&s>=1&&z(s,t,n,e)}function z(e,t,n,r){O();let a=P(),o=a===null?Math.max(1,e):Math.min(Math.max(1,e),a);if(oe.has(t)&&i.get().playing&&f(`playing`,!1,{reason:t,event:n}),o===i.get().page)return!1;T=r;let s=f(`page`,o,{reason:t,event:n});return T=void 0,(!s||i.get().page!==o)&&queueMicrotask(V),s}function B(e,{reason:t=`imperative`,event:n}={}){return f(`playing`,e,{reason:t,event:n})}function V({animate:e=!0}={}){if(j.isRotating()||!w||!b||w.isHeld()||!e&&w.isMoving())return;let t=i.get().page-1;if(!p[t])return;e&&j.rotateToward(t,T);let n=y(p[t].position,0,_);(Math.abs(w.position()-n)>=1||!i.get().snapping)&&w.moveTo(m.indexOf(t),{animate:e})}let H=!1;function U(){x=!1;let t=s(`viewport`),n=d(e,`item`);if(!t||!t.isConnected)return;for(let{el:e}of n)S?.observe(e);E();let r=j.prepare(n,i.get().loop&&n.length>1&&w!==void 0);if(W({...M(t,n,k()),first:r}),r&&!j.isActive())return U();i.get().slidesPerPage===1?H&&=(ee(n,i.get().align),!1):(F(n,p,k().vertical),H=!0),j.recenter()}function W(e){let{paddingStart:t=0,paddingEnd:n=0,first:r}=e;v=e.viewportSize,_=e.maxScroll,h=e.slides.map(e=>e.box);let{align:a,slidesPerPage:o}=i.get(),s=v-t-n;p=j.layout(h,{snapport:s,paddingStart:t,maxScroll:_,align:a,slidesPerPage:o},r)??ne({slides:h,snapport:s,paddingStart:t,maxScroll:_},{align:a,slidesPerPage:o}),m=p.map((e,t)=>t).sort((e,t)=>p[e].position-p[t].position);let c=e.slides.map(e=>e.key);i.set({pageCount:p.length||null,order:c,pages:p.map(e=>e.slides.map(e=>c[e]))});let{page:l}=i.get();p.length&&l>p.length&&(b?z(p.length,`content-resize`):i.set({page:p.length})),b=p.length>0,!j.isRotating()&&(V({animate:!1}),K())}function G(){x||(x=!0,queueMicrotask(U))}function K(){if(!w)return;let e=w.position(),{order:t}=i.get(),n=t.filter((t,n)=>h[n]&&re(h[n],e,v));i.set({inView:n}),de()}function q(){if(!w||!p.length)return 0;let e=w.position();if(!j.isActive())return _>0?y(e/_,0,1):0;let t=0;for(;t<m.length-1&&p[m[t+1]].position<=e+.5;)t++;let n=p[m[t]].position,r=t<m.length-1?p[m[t+1]].position:n,i=r>n?y((e-n)/(r-n),0,1):0;return(m[t]+i)/p.length%1}let ue=-1;function de(){let e=s(`root`);if(!e)return;let t=Math.round(q()*1e4);t!==ue&&(ue=t,e.style.setProperty(`--carousel-progress`,(t/1e4).toFixed(4)))}function fe(){w&&!w.isMoving()&&(j.recenter(),a().onPageChangeComplete?.(i.get().page))}function pe(e,t){let n=C;O()!==n&&w&&(e=w.position()),K();let r=J(p,e);if(r===-1)return;let a=t.touch?`swipe`:`scroll`;r+1!==i.get().page&&z(r+1,a,t.event),i.get().dragFree||V(),fe()}function me(n){let r=[],a=ae({viewport:n,content:()=>s(`content`),axis:k,positions:()=>m.map(e=>y(p[e].position,0,_)),maxScroll:()=>_,viewportSize:()=>v,physics:()=>({...se,skipSnapPoints:i.get().skipSnaps}),canDrag:()=>i.get().drag,dragFree:()=>i.get().dragFree,reducedMotion:t,setSnapping:e=>{n.style.setProperty(`scroll-snap-type`,le(i.get(),e)),i.set({snapping:e})},onRelease:(e,t)=>z(m[e]+1,`swipe`,t),onScrollRest:pe,onSettle:()=>{i.get().dragFree||V(),fe()},onDragChange:e=>{i.set({dragging:e}),N.setPaused(`drag`,e)},onScroll:K});if(w=a,r.push(a.destroy,()=>{w===a&&(w=void 0),j.reset(d(e,`item`))}),r.push(o(n,`pointerdown`,O,{capture:!0})),r.push(o(n,`touchstart`,()=>N.setPaused(`touch`,!0),{passive:!0}),o(n,`touchend`,()=>N.setPaused(`touch`,!1),{passive:!0}),o(n,`touchcancel`,()=>N.setPaused(`touch`,!1),{passive:!0})),typeof ResizeObserver<`u`){let e=new ResizeObserver(G);e.observe(n),S=e,r.push(()=>{e.disconnect(),S===e&&(S=void 0)})}let c=g(n,()=>!0,{skipWhenHolding:!0});return r.push(c.stop),b=!1,G(),()=>r.forEach(e=>e())}function he(e=s(`root`)){e?.style.setProperty(`--carousel-interval`,`${i.get().interval}ms`)}function Z(e){he(e);let n=[o(e,`pointerenter`,e=>{e.pointerType===`mouse`&&N.setPaused(`hover`,!0)}),o(e,`pointerleave`,e=>{e.pointerType===`mouse`&&N.setPaused(`hover`,!1)}),o(e,`focusin`,t=>{let n=t.relatedTarget;i.get().playing&&u()&&!(n&&e.contains(n))&&B(!1,{reason:`focus-in`,event:t})}),ce(e.ownerDocument,()=>N.setPaused(`hidden`,e.ownerDocument.visibilityState===`hidden`))];if(typeof IntersectionObserver<`u`){let t=new IntersectionObserver(e=>{let t=e[e.length-1];t&&N.setPaused(`offscreen`,!t.isIntersecting)});t.observe(e),n.push(()=>t.disconnect())}return n.push(ge(t())),()=>n.forEach(e=>e())}function ge(e){return i.get().playing&&a().playing===void 0&&e&&i.set({playing:!1}),N.setRunning(i.get().playing),()=>N.setRunning(!1)}let Q=i.get();i.subscribe(()=>{let e=i.get(),t=Q;Q=e,e.playing!==t.playing&&N.setRunning(e.playing),e.interval!==t.interval&&he(),e.page!==t.page&&(N.restart(),D()?G():V()),(e.slidesPerPage!==t.slidesPerPage||e.align!==t.align)&&G(),(e.orientation!==t.orientation||e.loop!==t.loop)&&G()});let _e=R(e,z),$=ie(e,z,O);return{getPage:()=>i.get().page,getPageCount:P,setPage:(e,{reason:t=`imperative`,event:n}={})=>z(e,t,n),next:e=>L(1,e),canNext:()=>I(1),canPrevious:()=>I(-1),getProgress:q,previous:e=>L(-1,e),isPlaying:()=>i.get().playing,setPlaying:(e,t)=>B(e,t),play:e=>B(!0,e),pause:e=>B(!1,e),internal:{id:r,canStep:I,..._e,bindRoot:Z,bindViewport:me,onViewportKeyDown:$,bindItem(e,t){S?.observe(e),G();let n=[te(e,t,i),o(e,`focusin`,()=>i.set({focused:t})),o(e,`focusout`,n=>{!e.contains(n.relatedTarget)&&i.get().focused===t&&i.set({focused:null})})];return()=>{n.forEach(e=>e()),S?.unobserve(e),i.get().focused===t&&i.set({focused:null}),G()}}}}}const de=ue;function fe(){return i()}function pe(e){if(e!==null)return e===`auto`?`auto`:Number(e)}function me(e){let t=e.orientation===`vertical`,n=e.drag?`auto`:`hidden`;return[`position:relative`,`overflow-x:${t?`hidden`:n}`,`overflow-y:${t?n:`hidden`}`,`scroll-snap-type:${le(e,e.snapping)}`,`overscroll-behavior-${t?`y`:`x`}:contain`].join(`;`)}function he(e){let t=[`flex-shrink:0`];return e.slidesPerPage===1&&t.push(`scroll-snap-align:${e.align}`),e.skipSnaps||t.push(`scroll-snap-stop:always`),t.join(`;`)}const Z=e=>`${e}-content`,ge=(e,t)=>`${e}-slide-${c(t)}`,Q=(e,t)=>({type:`button`,"aria-controls":Z(t),"aria-disabled":e?`true`:void 0,"data-disabled":e?``:void 0}),_e=/* @__PURE__ */ e({name:`carousel`,options:{page:`number`,defaultPage:`number`,onPageChange:`callback`,onPageChangeComplete:`callback`,playing:`boolean`,defaultPlaying:`boolean`,onPlayingChange:`callback`,interval:`number`,orientation:`string`,align:`string`,slidesPerPage:pe,loop:`boolean`,skipSnaps:`boolean`,dragFree:`boolean`,drag:`boolean`,controller:`value`},state:e=>({page:Math.max(1,Math.floor(e.defaultPage??1)),playing:e.defaultPlaying??!1,orientation:`horizontal`,align:`start`,slidesPerPage:1,loop:!1,skipSnaps:!1,dragFree:!1,drag:!0,interval:5e3,pageCount:null,snapping:!0,indicators:[],stop:null,pages:[],order:[],inView:[],focused:null,dragging:!1,paused:!1}),live:[`pages`,`order`,`inView`,`focused`,`dragging`,`paused`],controlled:[`page`,`playing`],sync:e=>({orientation:m(e.orientation,`horizontal`),align:e.align??`start`,slidesPerPage:e.slidesPerPage??1,loop:e.loop??!1,skipSnaps:e.skipSnaps??!1,dragFree:e.dragFree??!1,drag:e.drag??!0,interval:e.interval??5e3,...e.page===void 0?{}:{page:e.page},...e.playing===void 0?{}:{playing:e.playing}}),api:de,slots:e=>({root:e({role:`region`,state:e=>({page:e.page,pageCount:e.pageCount,playing:e.playing,orientation:e.orientation}),attrs:e=>({"aria-roledescription":`carousel`,"data-orientation":e.orientation,"data-playing":e.playing?``:void 0}),live:r(e=>({"data-paused":e.playing&&e.paused?``:void 0})),bind:(e,{api:t})=>t.internal.bindRoot(e)}),viewport:e({state:e=>({orientation:e.orientation,dragging:e.dragging}),attrs:e=>({"data-orientation":e.orientation,style:me(e)}),live:r(e=>({"data-dragging":e.dragging?``:void 0})),on:{keydown:(e,{api:t})=>t.internal.onViewportKeyDown(e)},bind:(e,{api:t})=>t.internal.bindViewport(e)}),content:e({state:e=>({orientation:e.orientation}),attrs:(e,{id:t})=>({id:Z(t),"aria-live":e.playing?`off`:`polite`,"aria-atomic":`false`,"data-orientation":e.orientation,style:e.orientation===`vertical`?`display:flex;flex-direction:column`:`display:flex`})}),item:e({role:`group`,props:{id:`id`},state:(e,{key:t})=>({index:e.order.indexOf(t),active:!!e.pages[e.page-1]?.includes(t),inView:e.inView.includes(t)}),attrs:(e,{id:t,key:n})=>({id:ge(t,n),"aria-roledescription":`slide`,"data-orientation":e.orientation,style:he(e)}),live:r((e,{key:t})=>{let n=e.pageCount!==null&&!e.inView.includes(t)&&e.focused!==t;return{inert:n?``:void 0,"aria-hidden":n?`true`:void 0,"data-active":e.pages[e.page-1]?.includes(t)?``:void 0,"data-in-view":e.inView.includes(t)?``:void 0}}),bind:(e,{api:t,key:n})=>t.internal.bindItem(e,n)}),previous:e({state:(e,{api:t})=>({disabled:!t.internal.canStep(-1)}),attrs:(e,{id:t,api:n})=>Q(!n.internal.canStep(-1),t),press:({api:e},t)=>{e.previous({reason:`previous-press`,event:t})},bind:void 0}),next:e({state:(e,{api:t})=>({disabled:!t.internal.canStep(1)}),attrs:(e,{id:t,api:n})=>Q(!n.internal.canStep(1),t),press:({api:e},t)=>{e.next({reason:`next-press`,event:t})},bind:void 0}),"indicator-group":e({role:`tablist`,keys:[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Home`,`End`],state:e=>({page:e.page,pageCount:e.pageCount}),on:{keydown:(e,{api:t})=>t.internal.onIndicatorKeyDown(e)}}),indicator:e({role:`tab`,focus:`roving`,props:{page:`number`,id:`id`},state:(e,{key:t,props:n,api:r})=>{let i=r.internal.indicatorPage(e,t,n);return{page:i,selected:i===e.page}},attrs:(e,{id:t,key:n,props:r,api:i})=>{let a=i.internal.indicatorPage(e,n,r),o=a>0&&a===e.page;return{id:`${t}-indicator-${c(n)}`,type:`button`,tabindex:i.internal.roving.tabIndex(e,{key:n,props:r}),"aria-selected":String(o),"data-selected":o?``:void 0,hidden:e.pageCount!==null&&a>e.pageCount?``:void 0}},live:r((e,{id:t,key:n,props:r,api:i})=>{let a=i.internal.indicatorPage(e,n,r);return{"aria-controls":e.pages[a-1]?.map(e=>ge(t,e)).join(` `)||void 0}}),press:({api:e,el:t,key:n,props:r},i)=>e.internal.pressIndicator(t,n,r,i),bind:(e,t)=>t.api.internal.bindIndicator(e,t)}),"play-toggle":e({state:e=>({playing:e.playing,paused:e.paused}),attrs:(e,{id:t})=>({type:`button`,"aria-controls":Z(t),"data-playing":e.playing?``:void 0}),live:r(e=>({"data-paused":e.playing&&e.paused?``:void 0})),press:({api:e,store:t},n)=>{e.setPlaying(!t.get().playing,{reason:`toggle-press`,event:n})},bind:void 0})}),agent:{actions:[`setPage`,`next`,`previous`,`setPlaying`,`play`,`pause`]}}),$={display:`contents`,target:a};function ve(){s(_e,{root:{tag:`ui-carousel`,display:`block`,defaults:{drag:!0},state:{page:{get:e=>e.getPage(),set:(e,t)=>e.setPage(Number(t))},playing:{get:e=>e.isPlaying(),set:(e,t)=>e.setPlaying(!!t)}},api:[`getPage`,`getPageCount`,`setPage`,`next`,`previous`,`canNext`,`canPrevious`,`getProgress`,`isPlaying`,`setPlaying`,`play`,`pause`]},viewport:{tag:`ui-carousel-viewport`,display:`block`},content:{tag:`ui-carousel-content`,display:`block`},item:{tag:`ui-carousel-item`,display:`block`},previous:{tag:`ui-carousel-previous`,...$},next:{tag:`ui-carousel-next`,...$},"play-toggle":{tag:`ui-carousel-play-toggle`,...$},"indicator-group":{tag:`ui-carousel-indicator-group`,display:`block`},indicator:{tag:`ui-carousel-indicator`,...$,render:e=>e.setAttribute(`role`,`none`)}})}ve();export{fe as createCarouselController};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,n as t,o as n,t as r}from"./chunks/BFueEkwm.js";r(),t();export{e as createCheckboxController,n as createCheckboxGroupController};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{K as e,Q as t,U as n,W as r,nn as i,q as a}from"./DC08tnkE.js";import{r as o,t as s}from"./XsM0J1Ex.js";let c=`pointer`,l=!1,u=!1,d=!1,f=!1,p=!1,m=`mouse`,h=!1;const g=()=>h=!1;let _=null;const v=()=>_=null;function y(e){(e.key===`Enter`||e.key===` `)&&(_=e.target,setTimeout(v))}function b(e){y(e),p=!1;let t=e.metaKey||e.ctrlKey||e.altKey||/^(Meta|Control|Alt|Shift)$/.test(e.key);(e.key===`Tab`||!t)&&(c=`keyboard`)}function x(e){if(c=`pointer`,p=!1,!(`pointerType`in e)){h||(m=`touch`);return}h=!0,setTimeout(g);let t=e.pointerType;m=w(e)?`virtual`:t===`touch`||t===`pen`?t:`mouse`}function S(){l||typeof document>`u`||(l=!0,document.addEventListener(`keydown`,b,!0),document.addEventListener(`keyup`,y,!0),document.addEventListener(`pointerdown`,x,!0),document.addEventListener(`touchstart`,x,{capture:!0,passive:!0}),window.addEventListener(`blur`,e=>{e.target===window&&(p=!0)}))}function C(){l||u||(u=!0,queueMicrotask(S))}function w(e){return e.type===`pointermove`?!1:e.width===0&&e.height===0&&e.pressure===0||e.pointerType===`mouse`&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0}function T(e){return e.detail>0?m:_&&_.contains(e.target)?`keyboard`:`virtual`}const E=()=>c===`keyboard`?`keyboard`:m;function D(e){if(S(),!e)return E();if(!i(e))return`programmatic`;if(e.type.startsWith(`key`))return`keyboard`;if(e.type.startsWith(`touch`))return`touch`;if(e.type===`click`)return T(e);let t=e.pointerType;return t===`mouse`||t===`touch`||t===`pen`?w(e)?`virtual`:t:`button`in e?m:E()}function O(){return S(),c===`keyboard`&&!d&&!f&&!p}function k(e){S(),d=!0;try{e.focus({preventScroll:!0})}finally{d=!1}}function A(e){S(),f=!0;try{e.focus({preventScroll:!0})}finally{f=!1}}const j=e=>e===`pointer`||e===`touch`?`pointer`:`keyboard`;function M(e,t,n=()=>[]){let r=t,i,a=t=>{r=t,e.getAttribute(`data-modality`)!==t&&e.setAttribute(`data-modality`,t)};a(t);let o=e=>{e.metaKey||e.ctrlKey||/^(Meta|Control|Alt|Shift)$/.test(e.key)||a(`keyboard`)},s=()=>a(`pointer`),c=e=>{let t={x:e.clientX,y:e.clientY},n=i&&Math.hypot(t.x-i.x,t.y-i.y)>2;i=t,n&&r!==`pointer`&&a(`pointer`)},l=[e,...n().filter(e=>!!e)];for(let e of l)e.addEventListener(`keydown`,o,!0);return e.addEventListener(`pointerdown`,s,!0),e.addEventListener(`pointermove`,c,!0),()=>{for(let e of l)e.removeEventListener(`keydown`,o,!0);e.removeEventListener(`pointerdown`,s,!0),e.removeEventListener(`pointermove`,c,!0),e.removeAttribute(`data-modality`)}}const N=(t,n)=>e(t,n&&(()=>D(n)));function P(){return C(),N}function F(e,t=P()){return s(e,t)}function I(e,i=P()){return(s,c,l)=>{if(t())return;let u=r(l,i(l.reason,l.event),!1),d=e.options()[o(s,`Commit`)];d&&a(u.source,()=>d(c,u)),n.commit?.(e.id,s,c,u)}}function L(e,t,n,i){let o=r(i,i.source??N(i.reason,i.event)),s=e.options()[t];return typeof s==`function`&&a(o.source,()=>s(n,o)),o.canceled}export{P as a,A as c,C as d,M as f,L as i,k as l,F as n,O as o,I as r,j as s,N as t,D as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./B7EgSgjQ.js";const t=`\0select-all`,n=e=>e===void 0?t:`${t}:${e}`,r=e=>e.startsWith(t);function i(t,n){return n.startsWith(`\0`)?`${t}-${n.slice(1).replace(/[^\w-]/g,`-`)}`:`${t}-option-${e(n)}`}export{n as i,r as n,i as r,t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ft as e}from"./DC08tnkE.js";import{t}from"./Dh8MLjQO.js";const n=e=>!!e.props.disabled?.(),r=e=>e.props.focusable?.()??!0;function i(e){let t=!1;return()=>{t||(t=!0,queueMicrotask(()=>{t=!1,e()}))}}const a={stop:!0};function o(n,r,i){let o=[e(n,a,i),t(n,`stop`,r,i),t(n,`stop`,null,i)];return()=>o.forEach(e=>e())}export{i,n,r,o as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{bt as e,mt as t,xt as n}from"./DC08tnkE.js";import{a as r,i,r as a,t as o}from"./Vk-rVi16.js";function s(e){let t=e.getAttribute(`data-slot`);t&&n(e.ownerDocument,`ui-sdk-sheet-${t}`,`@layer ui-sdk { :where([data-slot="${t}"])::backdrop { background: var(--sheet-backdrop, rgb(0 0 0 / 0.2)); pointer-events: auto } }`)}function c(t,n){let r=[],i=t=>{for(let a of Array.from(t.children))n.includes(a)||(n.some(e=>e&&a.contains(e))?i(a):a instanceof HTMLElement&&r.push(e(a,`display`,`none`)))};return i(t),()=>r.forEach(e=>e())}function l(t,n,r){let i,a=n.bind(t,{...r,position:void 0,inline:!0,onShow(){let[e,n]=r.drillIn();return e&&(i=c(e,[t,n])),()=>i?.()},onClose(){i?.(),i=e(t,`display`,`none`)}});return()=>{a(),i?.()}}function u(e,t,n){if(n.drillIn)return l(e,t,n);let r=e.parentElement;if(!r)return;s(r);let i;return t.bind(e,{...n,position:void 0,host:()=>r,onShow(a){let o=d(e,r,t,n,a);return i=o.sheet,()=>{o.hide(),i=void 0}},onClose:()=>i?.close()})}function d(e,n,r,s,c){let l=null,u=a(c),d=!s.backdrop?.(),f=o(e,{host:n,snapPoints:()=>s.snapPoints??[`content`],snapPoint:()=>l,backdrop:s.backdrop,hostBackdrop:d,dismissible:s.dismissible,onDismissAttempt:s.onDismissAttempt,parent:()=>u?.(),onSnap:e=>l=e,onDismiss(e){r.requestClose(`swipe`,e),requestAnimationFrame(()=>{let e=l??f.snapPoints()[0]?.value;c.active()&&e!==void 0&&f.snapTo(e,`imperative`)})}});i.set(c,()=>f),s.onSheet?.(f);let p=t(e,`focusin`,e=>{let t=f.snapPoints().at(-1);t&&f.snapPoints().length>1&&e.target.matches(`input, textarea`)&&f.snapTo(t.value,`imperative`)}),m=d?getComputedStyle(e).getPropertyValue(`--sheet-backdrop`):`transparent`;return m&&n.style.setProperty(`--sheet-backdrop`,m),c.active()&&f.open(r.opener()!==`initial`),{sheet:f,hide(){p(),i.delete(c),f.destroy(),s.onSheet?.(void 0),n.style.removeProperty(`--sheet-backdrop`)}}}export{r as prepareVariables,u as presentSheet};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{H as e,Nt as t,Pt as n,R as r,Rt as i,Vt as a,X as o,Xt as s,Yt as c,at as l,qt as u,r as d}from"./DC08tnkE.js";import{n as f}from"./0eRGibL6.js";import{t as p}from"./Bjiy_F2N.js";import{n as m,t as ee}from"./Db-W1wrC.js";import{n as h}from"./C_Uanbrl.js";import{C as g,T as _,d as v}from"./COWKfakj.js";import{n as te}from"./BeaQ6TYM.js";const y=()=>({year:null,month:null,day:null,hour:null,minute:null,second:null,dayPeriod:null}),b=(e,t)=>String(e).padStart(t,`0`),x=/[]/g;function S({kind:e,granularity:t,hourCycle:n}){let r=e===`time`&&t===`day`?`minute`:t,i=e===`date`?[`year`,`month`,`day`]:[];return r===`day`?i:(i.push(`hour`),r!==`hour`&&i.push(`minute`),r===`second`&&i.push(`second`),n===12&&i.push(`dayPeriod`),i)}const C=/* @__PURE__ */ new Map;function w(e){let t=C.get(e);if(!t){let{hourCycle:n}=new Intl.DateTimeFormat(e,{hour:`numeric`}).resolvedOptions();t=n===`h11`||n===`h12`?12:24,C.set(e,t)}return t}const T=/* @__PURE__ */ new Map;function E(e){let t=JSON.stringify(e),n=T.get(t);if(n)return n;let r=S(e),i=e=>r.includes(e),a=new Intl.DateTimeFormat(e.locale,{timeZone:`UTC`,calendar:`gregory`,numberingSystem:`latn`,...i(`year`)&&{year:`numeric`,month:`2-digit`,day:`2-digit`},...i(`hour`)&&{hour:`2-digit`,hourCycle:e.hourCycle===12?`h12`:`h23`},...i(`minute`)&&{minute:`2-digit`},...i(`second`)&&{second:`2-digit`}});n=[];for(let e of a.formatToParts(Date.UTC(2001,1,3,16,5,6)))if(e.type===`literal`){let t=e.value.replace(x,``).replace(/\s/g,` `),r=n[n.length-1];r?.type===`literal`?r.text+=t:t&&n.push({type:`literal`,text:t})}else i(e.type)&&n.push({type:e.type,text:``});for(;n[0]?.type===`literal`;)n.shift();for(;n[n.length-1]?.type===`literal`;)n.pop();return T.set(t,n),n}const D=/* @__PURE__ */ new Map;function O(e){let t=D.get(e);if(!t){let n=new Intl.DateTimeFormat(e,{hour:`numeric`,hourCycle:`h12`,timeZone:`UTC`}),r=e=>n.formatToParts(Date.UTC(2001,0,1,e)).find(e=>e.type===`dayPeriod`)?.value;t=[r(0)??`AM`,r(12)??`PM`],D.set(e,t)}return t}const k=/* @__PURE__ */ new Map,A={year:`year`,month:`month`,day:`day`,hour:`hour`,minute:`minute`,second:`second`,dayPeriod:`AM/PM`};function j(e,t){let n=`${t}|${e}`,r=k.get(n);if(r===void 0){try{r=new Intl.DisplayNames(t,{type:`dateTimeField`}).of(e)??A[e]}catch{r=A[e]}k.set(n,r)}return r}function M(e,t,n){switch(e){case`year`:return[1,9999];case`month`:return[1,12];case`day`:return[1,t.month===null?31:g(t.year??2e3,t.month)];case`hour`:return n===12?[1,12]:[0,23];case`dayPeriod`:return[0,1];default:return[0,59]}}const N=e=>e===`year`?4:2;function P(e){if(e.day===null||e.month===null)return e;let t=g(e.year??2e3,e.month);return e.day>t?{...e,day:t}:e}function ne(e,t,n){return t===null?``:e===`dayPeriod`?O(n)[t]:b(t,N(e))}function re(e,t,n){let r=0;return E(e).map(({type:i,text:a})=>{if(i===`literal`)return{key:`literal-${r++}`,type:i,text:a,value:null,min:0,max:0,empty:!1,editable:!1,label:``};let o=t[i],[s,c]=M(i,t,e.hourCycle),l=n?.type===i?n.text:null;return{key:i,type:i,text:l??ne(i,o,e.locale),value:o,min:s,max:c,empty:o===null&&!l,editable:!0,label:j(i,e.locale)}})}function ie(e,t,n,r,i){let[a,o]=M(n,e,i),s=N(n),c=t?.type===n?t.text+r:r;(c.length>s||Number(c)>o)&&(c=r);let l=Number(c),u=c.length>=s||l*10>o,d=l>=a&&l<=o?l:null,f={...e,[n]:d};return{fields:n===`year`&&!u?f:P(f),buffer:u?null:{type:n,text:c},done:u}}function ae(e,t,n){let r=t.toLowerCase(),i=[...O(n)].findIndex((e,t)=>[e,t?`pm`:`am`].some(e=>e.toLowerCase().startsWith(r)));return i===-1?void 0:{...e,dayPeriod:i}}function oe(e,t,n,r,i){let[a,o]=M(t,e,r),s=e[t],c=o-a+1,l=s===null?i:a+((s-a+n)%c+c)%c;return P({...e,[t]:l})}function se(e,t,n,r){let[i,a]=M(t,e,r);return P({...e,[t]:n===`min`?i:a})}const ce={year:5,month:3,day:7,hour:3,minute:15,second:15,dayPeriod:1},le=e=>ce[e];function F(e,t){let n=S(t);if(n.some(t=>e[t]===null))return null;let r=``;if(t.kind===`date`){if(r=_(e.year,e.month,e.day)??``,!r)return null;if(!n.includes(`hour`))return r}let i=t.hourCycle===12?e.hour%12+(e.dayPeriod===1?12:0):e.hour,a=`${b(i,2)}:${b(e.minute??0,2)}`;return n.includes(`second`)&&(a+=`:${b(e.second,2)}`),t.kind===`date`?`${r}T${a}`:a}const I=/^(\d{4})-(\d{2})-(\d{2})$/,L=/^(\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?$/;function R(e){if(typeof e!=`string`)return;let[t,n]=e.includes(`T`)?e.split(`T`):L.test(e)?[``,e]:[e,``],r={};if(t){let e=I.exec(t);if(!e)return;let[n,i,a]=[Number(e[1]),Number(e[2]),Number(e[3])];if(!_(n,i,a))return;r.date={year:n,month:i,day:a}}if(n){let e=L.exec(n);if(!e)return;let[t,i,a]=[Number(e[1]),Number(e[2]),Number(e[3]??0)];if(t>23||i>59||a>59)return;Object.assign(r,{hour:t,minute:i,second:a})}return r.date||r.hour!==void 0?r:void 0}function z(e,t){let n=y(),r=R(e);if(!r)return n;let i=S(t);if(t.kind===`date`){if(!r.date)return n;Object.assign(n,r.date)}if(i.includes(`hour`)){if(r.hour===void 0){if(t.kind===`time`)return n;Object.assign(r,{hour:0,minute:0,second:0})}let e=r.hour;n.hour=t.hourCycle===12?e%12||12:e,t.hourCycle===12&&(n.dayPeriod=+(e>=12)),i.includes(`minute`)&&(n.minute=r.minute),i.includes(`second`)&&(n.second=r.second)}return n}function B(e,t){return F(z(typeof e==`string`?e:null,t),t)}function V(e){let t=e.hour===void 0?``:`${b(e.hour,2)}:${b(e.minute,2)}:${b(e.second,2)}`;if(!e.date)return t;let{year:n,month:r,day:i}=e.date;return`${b(n,4)}-${b(r,2)}-${b(i,2)}${t?`T${t}`:``}`}function H(e,t){let n=R(e),r=R(t);if(!n||!r)return 0;let i=V(n),a=V(r);return n.date&&r.date&&(r.hour===void 0||n.hour===void 0)&&(i=i.slice(0,10),a=a.slice(0,10)),i<a?-1:+(i>a)}const ue=e=>I.test(e.slice(0,10))?e.slice(0,10):void 0,U=e=>String(e),W=e=>{let t=m(e);return{kind:e.kind,granularity:e.granularity,hourCycle:e.hourCycle??w(t),locale:t}},G=e=>e.fieldsFor===U(e.value),K=e=>G(e)?e.fields:z(e.value,W(e)),de=/* @__PURE__ */ new WeakMap;function fe(e){let t=de.get(e);return t||(t=re(W(e),K(e),G(e)?e.buffer:null),de.set(e,t)),t}const q=(e,t)=>fe(e).find(e=>e.key===t);function J(e){if(e.value!==null)return!1;let t=K(e);return S(W(e)).some(e=>t[e]!==null)}function Y(e){let{value:t,min:n,max:r}=e;if(t===null)return;if(n!==null&&H(t,n)<0)return`rangeUnderflow`;if(r!==null&&H(t,r)>0)return`rangeOverflow`;let i=ue(t);if(i&&v(i,e.unavailable))return`unavailable`}const pe=(e,t)=>{let n=t.granularity??(e===`date`?`day`:`minute`),r={kind:e,granularity:n,hourCycle:24};return{kind:e,granularity:n,hourCycle:t.hourCycle===12||t.hourCycle===24?t.hourCycle:null,locale:t.locale??null,min:me(t.min,r),max:me(t.max,r),unavailable:e===`date`?t.unavailable??null:null,disabled:!!t.disabled,readOnly:!!t.readOnly,required:!!t.required,name:t.name,form:t.form}};function me(e,t){if(typeof e!=`string`)return null;let n=t.kind===`date`&&/^\d{4}-\d{2}-\d{2}$/.test(e);return B(e,{...t,granularity:n?`day`:`second`})}const X=(e,t,n)=>B(n,{kind:e,granularity:t.granularity??(e===`date`?`day`:`minute`),hourCycle:24});function he(e,t){return{...pe(e,t),value:X(e,t,t.value??t.defaultValue??null),initial:X(e,t,t.defaultValue??null),fields:y(),fieldsFor:``,buffer:null,pageLocale:null,formDisabled:!1}}const ge=(e,t)=>({...pe(e,t),...t.defaultValue===void 0?{}:{initial:X(e,t,t.defaultValue)},...t.value===void 0?{}:{value:X(e,t,t.value)}}),_e={value:`string`,defaultValue:`string`,onValueChange:`callback`,granularity:`string`,hourCycle:`number`,min:`string`,max:`string`,unavailable:`list`,locale:`string`,disabled:`boolean`,readOnly:`boolean`,required:`boolean`,name:`string`,form:`string`,controller:`value`},ve=/[\s/.,:\-–]/;function ye(e){let{store:t,element:n}=e,i=f(e),o=()=>W(t.get()),c=()=>p(e,`segment`).map(({el:e,props:n})=>({el:e,type:q(t.get(),n.segment?.key??``)?.type})).filter(e=>!!e.type&&e.type!==`literal`),l=e=>c().find(t=>t.type===e)?.el,u=null;function d(e,n,r,a){let s=t.get().value;if(n)return t.set({fields:e,buffer:n,fieldsFor:U(s)});let c=F(e,o());c!==s&&i(`value`,c,{reason:r,event:a}),t.set({fields:e,buffer:n,fieldsFor:U(c)})}function h(e){let n=t.get();if(n.buffer){if(!G(n))return t.set({buffer:null});d(P(n.fields),null,`input-change`,e)}}function g(e,n,r){let a=e===null?null:B(e,o());if(e!==null&&a===null)return!1;let s=a===t.get().value||i(`value`,a,{reason:n,event:r});return t.set({fields:y(),fieldsFor:``,buffer:null}),s}let _=()=>{let e=t.get();return!a(e)&&!e.readOnly};function v(e,t){let n=c().map(({el:e})=>e),r=n[n.indexOf(e)+t];return r?.focus({preventScroll:!0}),!!r}function b(e,t,n){let r=/* @__PURE__ */ new Date;if(e===`year`)return r.getFullYear();if(e===`month`)return r.getMonth()+1;let[i,a]=M(e,n,o().hourCycle);return e===`day`?Math.min(r.getDate(),a):t===1?i:a}function x(e,n,r){let i=K(t.get()),{hourCycle:a}=o(),s;if(n===`Home`||n===`End`)s=se(i,e,n===`Home`?`min`:`max`,a);else{let t=n===`ArrowUp`||n===`PageUp`?1:-1;s=oe(i,e,t*(n.startsWith(`Page`)?le(e):1),a,b(e,t,i))}d(s,null,`step-key`,r)}function S(e,n,r,i){let{hourCycle:a,locale:s}=o(),l=n,f=e;for(let e of r){let n=t.get(),r=K(n),o=G(n)?n.buffer:null,c=u===l;if(u=null,/\d/.test(e)&&f!==`dayPeriod`){let t=ie(r,o,f,e,a);if(d(t.fields,t.buffer,`input-change`,i),t.done&&p())u=l;else if(t.done)break}else if(ve.test(e)){if(c||o?.type!==f&&r[f]===null)continue;if(h(i),!p())break}else if(/\p{L}/u.test(e)){let t=ae(r,e,s);if(t&&(f===`dayPeriod`||a===12)&&(d(t,null,`input-change`,i),f===`dayPeriod`&&!p()))break}}function p(){let e=c(),t=e[e.findIndex(e=>e.el===l)+1];return t?(t.el.focus({preventScroll:!0}),l=t.el,f=t.type,!0):(h(i),!1)}}function C(e,n,r,i){let a=t.get(),s=K(a),c=G(a)?a.buffer:null;if(r&&c?.type===e&&c.text.length>1){let t=c.text.slice(0,-1);return d(ie({...s,[e]:null},null,e,t,o().hourCycle).fields,{type:e,text:t},`input-change`,i)}if(s[e]!==null||c?.type===e)return d({...s,[e]:null},null,`input-change`,i);r&&v(n,-1)}function w(e){let n=e.clipboardData?.getData(`text/plain`)?.trim();if(e.preventDefault(),!n||!_())return;let r=t.get(),i=B(n,o());if(i===null&&r.kind===`date`){let e=te(n,m(r));e&&(i=B(e,o()))}i!==null&&g(i,`paste`,e)}function T(e,t,n){if(e.isComposing||e.altKey||e.ctrlKey||e.metaKey)return;let{key:i}=e;i===`ArrowLeft`||i===`ArrowRight`?(e.preventDefault(),v(n,i===`ArrowRight`===r(n)?-1:1)):[`ArrowUp`,`ArrowDown`,`PageUp`,`PageDown`,`Home`,`End`].includes(i)?(e.preventDefault(),_()&&x(t,i,e)):i===`Backspace`||i===`Delete`?(e.preventDefault(),_()&&C(t,n,i===`Backspace`,e)):i===`Enter`&&h(e)}function E(e,t,n){if(e.isComposing&&!e.cancelable)return;if(e.inputType===`insertLineBreak`)return h(e);if(e.preventDefault(),!_())return;let r=e.inputType;r.startsWith(`insert`)&&r!==`insertFromPaste`&&r!==`insertFromDrop`&&e.data?S(t,n,e.data,e):r.startsWith(`delete`)&&C(t,n,r.includes(`Backward`),e)}function D(e,n,r,i){let a=q(t.get(),e)?.text??``;if(r===a||!_())return;let o=r.replace(/\D/g,``);if(e===`dayPeriod`||o===``){let a=r.replace(/[^\p{L}]/gu,``).slice(-1);return a?S(e,n,a,i??new Event(`input`)):d({...K(t.get()),[e]:null},null,`input-change`,i)}S(e,n,(a&&r.startsWith(a)?o.slice(a.replace(/\D/g,``).length):o)||o.slice(-1),i??new Event(`input`))}function O(e){let t=c();(e?t.find(t=>t.type===e):t[0])?.el.focus()}function k(e){let t=c();if(!_()||t.some(({el:t})=>t.contains(e.target)))return;let n=t=>{let{left:n,right:r}=t.getBoundingClientRect();return Math.max(n-e.clientX,e.clientX-r,0)};return t.reduce((e,{el:t})=>!e||n(t)<n(e)?t:e,void 0)}function A(e){u=null,h(e)}function j(){g(t.get().initial,`reset`)}function N(e){g(e||null,`restore`)}return{getValue:()=>t.get().value,setValue:(e,{reason:t=`imperative`,event:n}={})=>g(e,t,n),clear:({reason:e=`imperative`,event:t}={})=>g(null,e,t),focus:O,internal:{keydown:T,beforeinput:E,adopt:D,paste:w,blur:A,reset:j,restore:N,segmentElement:l,nearestSegment:k,firstSegment:()=>c()[0]?.el,setFormDisabled:e=>t.set({formDisabled:e}),bindRoot(e){return ee(e,e=>t.set({pageLocale:e})),s(e,e=>t.set({formDisabled:e}))},rootElement:()=>n(`root`)}}}const be=ye,xe={key:``,type:`literal`,text:``,value:null,min:0,max:0,empty:!0,editable:!1,label:``},Z=(e,t)=>(t.segment&&q(e,t.segment.key))??t.segment??xe,Se=e=>e.kind===`time`?`Enter a valid time.`:`Enter a valid date.`,Ce=/* @__PURE__ */ new Map;function we(e,t){let n=(t===`rangeUnderflow`?e.min:e.max)??``,r=t===`rangeUnderflow`?`Value must be ${n} or later.`:`Value must be ${n} or earlier.`;if(typeof document>`u`)return r;let i=e.kind===`time`?`time`:e.granularity===`day`?`date`:`datetime-local`,a=`${i}|${t}|${n}`,o=Ce.get(a);if(o===void 0){let e=Object.assign(document.createElement(`input`),{type:i}),s=i===`datetime-local`&&!n.includes(`T`)?`${n}T${t===`rangeUnderflow`?`00:00`:`23:59`}`:n;t===`rangeUnderflow`?(e.min=s,e.value=i===`time`?`00:00`:i===`date`?`0001-01-01`:`0001-01-01T00:00`):(e.max=s,e.value=i===`time`?`23:59`:i===`date`?`9999-12-31`:`9999-12-31T23:59`),o=e.validationMessage||r,Ce.set(a,o)}return o}function Te(e){if(J(e))return Se(e);let t=Y(e);return t===`unavailable`?`This date isn't available.`:t?we(e,t):``}const Q=e=>({"data-disabled":a(e)?``:void 0,"data-readonly":e.readOnly?``:void 0,"data-required":e.required?``:void 0,"data-invalid":Y(e)?``:void 0}),Ee=e=>({root:e({role:`group`,state:e=>({value:e.value,segments:fe(e),disabled:a(e),readOnly:e.readOnly,invalid:!!Y(e)}),attrs:e=>({...Q(e),"data-empty":e.value===null&&!J(e)?``:void 0}),on:{mousedown(e,{api:t}){t.internal.nearestSegment(e)&&e.preventDefault()},click:(e,{api:t})=>t.internal.nearestSegment(e)?.focus({preventScroll:!0})},bind(e,{api:n,store:r}){let a,o=()=>{if(i(e))return;let t=n.internal.firstSegment();a&&a!==t&&u(a,``),a=t,t&&u(t,Te(r.get()))};queueMicrotask(o);let s=[n.internal.bindRoot(e),r.subscribe(o),()=>a?.isConnected===!1&&u(a,``),t(e,{value:()=>r.get().value??``,state:()=>r.get().value??``,restore:n.internal.restore,valueMissing:()=>{let e=r.get();return e.required&&!e.readOnly&&e.value===null&&!J(e)},message:()=>c(`text`),invalid:()=>{let e=r.get(),t=e.readOnly?void 0:J(e)?`badInput`:Y(e);if(t)return{flags:{[t===`unavailable`?`customError`:t]:!0},message:Te(e),anchor:n.internal.firstSegment()}},focus:()=>n.focus(),reset:n.internal.reset,disabled:n.internal.setFormDisabled,subscribe:r.subscribe})];return()=>s.forEach(e=>e?.())}}),segment:e({props:{segment:`value`},role:(e,{props:t})=>Z(e,t).editable?`spinbutton`:void 0,roles:[`spinbutton`],focus:(e,{props:t})=>Z(e,t).editable?`native`:{none:`The text between segments is hidden and never focused.`},keys:[`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`,`PageUp`,`PageDown`,`Home`,`End`],state:(e,{props:t})=>({...Z(e,t),disabled:a(e),readOnly:e.readOnly,invalid:!!Y(e)}),attrs:(e,{props:t})=>{let n=Z(e,t);if(!n.editable)return{"aria-hidden":`true`,"data-type":`literal`,...Q(e)};let r=!!Y(e);return{type:`text`,value:n.text,inputmode:n.type===`dayPeriod`?`text`:`numeric`,"aria-label":n.label,"aria-valuenow":n.value===null?void 0:String(n.value),"aria-valuemin":String(n.min),"aria-valuemax":String(n.max),"aria-valuetext":n.empty?`Empty`:n.text,"aria-invalid":r?`true`:void 0,placeholder:n.type===`year`?`––––`:`––`,size:String(n.type===`year`?4:2),autocomplete:`off`,autocorrect:`off`,autocapitalize:`off`,spellcheck:`false`,required:e.required?``:void 0,form:e.form,disabled:a(e)?``:void 0,readonly:e.readOnly?``:void 0,"data-type":n.type,"data-empty":n.empty?``:void 0,...Q(e)}},on:{keydown(e,{api:t,el:n,props:r,store:i}){let a=Z(i.get(),r);n&&a.editable&&t.internal.keydown(e,a.type,n)},paste(e,{api:t,props:n,store:r}){Z(r.get(),n).editable&&t.internal.paste(e)},focusout:(e,{api:t})=>t.internal.blur(e)},bind(e,{api:t,store:n,props:r}){let i=Z(n.get(),r);if(!i.editable||!(e instanceof HTMLInputElement))return;let a=i.type,o=e,s=0,c=()=>{cancelAnimationFrame(s),s=requestAnimationFrame(()=>o.matches(`:focus`)&&o.select())},l=()=>{let e=q(n.get(),a)?.text??``;o.value!==e&&(o.value=e),o.matches(`:focus`)&&c()};t.internal.adopt(a,o,o.value),l();let u=e=>{e.defaultPrevented||t.internal.beforeinput(e,a,o)},d=e=>{e.isComposing||(t.internal.adopt(a,o,o.value,e),l())};o.addEventListener(`beforeinput`,u),o.addEventListener(`input`,d),o.addEventListener(`focus`,c);let f=n.subscribe(l);return()=>{f(),cancelAnimationFrame(s),o.removeEventListener(`beforeinput`,u),o.removeEventListener(`input`,d),o.removeEventListener(`focus`,c)}}}),"hidden-input":e({attrs:e=>({type:`hidden`,name:e.name,value:e.value??``,form:e.form,disabled:a(e)?``:void 0}),bind:(e,{api:t,store:r})=>n(e,{value:()=>r.get().value??``,subscribe:r.subscribe,focus:()=>t.focus(),reset:t.internal.reset,disabled:t.internal.setFormDisabled})})});function De(){return o()}const Oe=/* @__PURE__ */ e({name:`date-input`,options:_e,state:e=>he(`date`,e),sync:e=>ge(`date`,e),api:be,slots:e=>Ee(e),agent:{actions:[`setValue`,`clear`]}});function ke(){return o()}const{unavailable:Ae,...je}=_e,Me=/* @__PURE__ */ e({name:`time-input`,options:je,state:e=>he(`time`,e),sync:e=>ge(`time`,e),api:be,slots:e=>Ee(e),agent:{actions:[`setValue`,`clear`]}}),Ne=/* @__PURE__ */ new WeakMap;function Pe(e,t,n){let{segments:r}=l(t.part(`root`,{})),i=r.map(e=>e.editable?e.key:`${e.key}:${e.text}`).join(`|`);if(Ne.get(e)===i)return;Ne.set(e,i);let a=e.querySelector(`:scope > template`);for(let t of Array.from(e.querySelectorAll(`:scope > ${n}-segment`)))t.remove();for(let t of r){let r=h(a,`${n}-segment`);r.setAttribute(`segment`,t.key),t.editable?r.querySelector(`input`)||r.append(document.createElement(`input`)):r.textContent=t.text,e.append(r)}}function $(e,t,n){d(e,{root:{tag:t,display:`block`,formAssociated:!0,properties:n?[`unavailable`]:[],state:{value:{get:e=>e.getValue(),set:(e,t)=>{let n=t||null;n!==e.getValue()&&e.setValue(n)}}},api:[`getValue`,`setValue`,`clear`,`focus`],render(e,n){let r=()=>Pe(e,n,t);return r(),n.subscribe(r)}},segment:{tag:`${t}-segment`,target:e=>e.querySelector(`input`)??e,context:e=>{let t=e.getAttribute(`segment`)??``;return{segment:{key:t},id:t}},rebind:[`segment`]}})}function Fe(){$(Oe,`ui-date-input`,!0)}function Ie(){$(Me,`ui-time-input`,!1)}export{De as i,Ie as n,ke as r,Fe as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{xt as e}from"./DC08tnkE.js";import"./CMg-8UVf.js";const t=/* @__PURE__ */ new WeakMap;function n(e,n){let r=t.get(e);return r||t.set(e,r={}),r[n]=(r[n]??0)+1,r[n]===1&&e.setAttribute(n,``),()=>{r[n]--,r[n]===0&&e.removeAttribute(n)}}function r(t){e(t,`ui-sdk-mirror`,`@layer ui-sdk{:where([data-mirror][aria-hidden]){display:inline-block}:where([data-mirror][aria-hidden]:dir(rtl)){scale:-1 1}}`)}function i(e,t,r,i){let a,o,s,c=!0,l=()=>{let r=e.parentElement?.closest(t.item);if(!r)return!1;if(a||(a=n(r,`data-has-icon`),i(r)),!t.list)return!0;let s=r.parentElement?.closest(t.list);return s&&(o=n(s,`data-has-icons`)),!!s},u=()=>{l()&&(s?.(),s=void 0)};return l()||queueMicrotask(()=>{c&&!l()&&(s=r(u))}),()=>{c=!1,s?.(),a?.(),o?.()}}function a(e){return{props:{mirror:`boolean`,id:`id`,item:{kind:`string`,from:`item.value`}},state:(e,{props:t})=>({mirror:!!t.mirror}),attrs:(e,{props:t})=>({"aria-hidden":`true`,"data-mirror":t.mirror?``:void 0}),bind(t,{api:n,props:a,id:o,store:s}){r(t.ownerDocument);let c=i(t,e,s.subscribe,e=>!1),l=e.register?.(t,{api:n,props:a});return()=>{c(),l?.()}}}}function o(e){let t=/* @__PURE__ */ new Map,n=!1,r=()=>{n||(n=!0,queueMicrotask(()=>{n=!1,e.set({icons:e.get().icons+1})}))};return{get:e=>t.get(e),register(e,n,i){return t.set(e,n),r(),()=>{t.get(e)===n&&i&&t.set(e,i(n))}}}}function s(e){return{slots:{"item-icon":a(e),"value-icon":p()},extend(e){e.internal.hooks.icons=o(e.internal.store)}}}const c=e=>e.cloneNode(!0),l={item:`[role="option"]`,list:`[role="listbox"]`};function u(e,{api:t,props:n}){return n.item===void 0?()=>{}:t.internal.icons.register(n.item,e,c)}function d(e){let t=e.internal.selection.keys();return t.length===1?e.internal.icons.get(t[0]):void 0}function f(e,t){t.replaceChildren(...Array.from(e?.childNodes??[],e=>e.cloneNode(!0))),t.toggleAttribute(`data-mirror`,!!e?.hasAttribute(`data-mirror`))}function p(){return{present:(e,{api:t})=>d(t)!==void 0,attrs:()=>({"aria-hidden":`true`}),bind(e,{api:t,store:n}){let r,i=()=>{let n=d(t);n!==r&&(r=n,f(n,e))};return i(),n.subscribe(i)}}}export{u as a,l as i,a as n,s as r,o as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=(e,t)=>e.children(t).length===0;function t(t,n){let r=/* @__PURE__ */ new Set;for(let i of n)if(t.has(i)){if(e(t,i))r.add(i);else for(let n of t.descendants(i))e(t,n)&&r.add(n)}return r}function n(n,r,i=`leaf`){let a=/* @__PURE__ */ new Map;if(i===`independent`){for(let e of r)a.set(e,!0);return e=>a.get(e)??!1}let o=t(n,r),s=t=>{if(e(n,t)){let e=o.has(t);return e&&a.set(t,!0),[1,+!!e]}let r=0,i=0;for(let e of n.children(t)){let[t,n]=s(e);r+=t,i+=n}return i&&a.set(t,i===r||`indeterminate`),[r,i]};for(let e of n.children(null))s(e);return e=>a.get(e)??!1}function r(e,t,r){let i=n(e,[...t],`leaf`),a=e.keys();return r===`leaf`?a.filter(e=>t.has(e)):r===`branch`?a.filter(e=>i(e)===!0):a.filter(t=>{if(i(t)!==!0)return!1;let n=e.parent(t);return n===null||i(n)!==!0})}function i(n,i,a,{strategy:o=`leaf`,checkable:s=()=>!0}={}){if(!s(a))return[...i];if(o===`independent`)return i.includes(a)?i.filter(e=>e!==a):[...i,a];let c=t(n,i),l=e(n,a)?[a]:n.descendants(a).filter(t=>e(n,t)),u=n.ancestors(a).length+1,d=l.filter(e=>s(e)&&n.ancestors(e).slice(u).every(e=>s(e))),f=!d.every(e=>c.has(e));for(let e of d)f?c.add(e):c.delete(e);return r(n,c,o)}export{n,i as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as e,I as t,mt as n}from"./DC08tnkE.js";import{r}from"./B7EgSgjQ.js";import{o as i}from"./0eRGibL6.js";import{t as a}from"./Bjiy_F2N.js";import{c as o,i as s,l as c,o as l,u}from"./BQeduZqT.js";import{s as d}from"./DjRcw3Y0.js";import{n as f,t as p}from"./l4aQIg22.js";const m=[[`button`,`button`],[`a[href]`,`link`],[`input[type=checkbox][switch]`,`switch`],[`input[type=checkbox]`,`checkbox`],[`input[type=radio]`,`radio`],[`input[type=range]`,`slider`],[`dialog`,`dialog`],[`h1, h2, h3, h4, h5, h6`,`heading`]],h=/* @__PURE__ */ new Set([`button`,`cell`,`checkbox`,`columnheader`,`gridcell`,`heading`,`link`,`menuitem`,`menuitemcheckbox`,`menuitemradio`,`option`,`radio`,`row`,`rowheader`,`switch`,`tab`,`treeitem`]);function g(e){return e.getAttribute(`role`)?.trim().split(/\s+/)[0]||(m.find(([t])=>e.matches(t))?.[1]??``)}function _(e){if(e.hasAttribute(`hidden`)||e.getAttribute(`aria-hidden`)===`true`)return!0;let t=e.ownerDocument.defaultView?.getComputedStyle(e);return t?.display===`none`||t?.visibility===`hidden`}function v(e,t){return e.getRootNode().getElementById?.(t)??null}function y(e){return(e.getAttribute(`aria-labelledby`)??``).split(/\s+/).map(t=>t&&v(e,t)).filter(e=>!!e).map(e=>e.getAttribute(`aria-label`)??S(e,!0)).join(` `)}function b(e){return e.localName===`img`?e.getAttribute(`alt`)??``:e.localName===`svg`?[...e.children].find(e=>e.localName===`title`)?.textContent??``:``}function x(e,t,n){if(e.matches(`input, select, textarea`))return``;let r=!t&&y(e)||e.getAttribute(`aria-label`)?.trim()||b(e);if(r)return` ${r} `;if(e.localName===`svg`)return``;let i=S(e,t,n),a=e.getAttribute(`title`);return i||(a?` ${a} `:``)}function S(e,t=!1,n=_(e)){let r=``;for(let i of e.childNodes)i.nodeType===Node.TEXT_NODE?r+=i.nodeValue:i.nodeType===Node.ELEMENT_NODE&&(n||!_(i))&&(r+=x(i,t,n));return r}const C=e=>e.replace(/\s+/g,` `).trim(),w=e=>[...e.labels??[]].map(e=>S(e)).join(` `),T=[y,e=>e.getAttribute(`aria-label`)??``,w,b,e=>h.has(g(e))?S(e):``,e=>e.getAttribute(`title`)??``];[...T.filter(e=>e!==w)];function E(e,t){for(let n of t){let t=C(n(e));if(t)return t}return``}function D(e){return E(e,T)}function O(e,t,n=4){let r=A([e,t].flatMap(e=>[{x:e.left-n,y:e.top-n},{x:e.right+n,y:e.top-n},{x:e.right+n,y:e.bottom+n},{x:e.left-n,y:e.bottom+n}]));return(e,t)=>{for(let n=0;n<r.length;n++){let i=r[n],a=r[(n+1)%r.length];if((a.x-i.x)*(t-i.y)-(a.y-i.y)*(e-i.x)<0)return!1}return!0}}function k(e,t,n){return(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x)}function A(e){let t=[...e].sort((e,t)=>e.x-t.x||e.y-t.y),n=e=>{let t=[];for(let n of e){for(;t.length>=2&&k(t[t.length-2],t[t.length-1],n)<=0;)t.pop();t.push(n)}return t.pop(),t};return[...n(t),...n(t.reverse())]}function j(e){let t,r,i;function a(){i?.(),i=void 0}function o(){clearTimeout(t),clearTimeout(r),a()}function s(t){a(),clearTimeout(r),r=setTimeout(()=>e.close(t),e.closeDelay())}return{clear:o,enter(e,n,i=0){e.pointerType!==`touch`&&(clearTimeout(r),a(),n&&(clearTimeout(t),i>0?t=setTimeout(n,i):n()))},leave(r){if(r.pointerType===`touch`||(clearTimeout(t),!e.closesOnLeave()))return;let o=e.trigger(),c=e.popup();if(!o||!c)return s(r);let l=O(o.getBoundingClientRect(),c.getBoundingClientRect());if(!l(r.clientX,r.clientY))return s(r);a(),i=n(c.ownerDocument,`pointermove`,e=>{l(e.clientX,e.clientY)||s(e)})}}}function M(e,t,n){if(typeof t!=`string`)return t??n();let r=e.getRootNode();return(r===e.ownerDocument?null:r.querySelector(t))??e.ownerDocument.querySelector(t)}function N(e,t,n){return{side:e.side??t.side??`bottom`,align:e.align??t.align,sideOffset:e.sideOffset??t.sideOffset??4,alignOffset:e.alignOffset??t.alignOffset??0,collisionPadding:e.collisionPadding,arrow:n,arrowPadding:e.arrowPadding}}const P={position:p,prepare:()=>e(f),anchor:M,options:N};function F(e){let{store:n,preset:r}=e;function i(t,r,i){if(r.disabled)return;let a=l(i);if(!n.get().open)return e.control.show({event:i,by:a,reason:`trigger-press`,trigger:t,payload:r.payload});let o=n.get().trigger;if(o!==null&&o!==t)return e.control.takeOver({trigger:t,payload:r.payload,reason:`trigger-press`,event:i});if(e.popup.opener()===`hover`)return e.control.show({event:i,by:a});e.control.hide({reason:`trigger-press`,event:i})}return{press:i,keydown(e,t,n,r){return t.tagName===`BUTTON`||e.key!==`Enter`&&e.key!==` `?!1:(e.preventDefault(),i(n,r,e),!0)},contains:(t,n)=>!!n&&a(e,e.triggerSlot).some(({el:e,props:n})=>e.contains(t)&&!n.disabled),initialFocus(e,n=`auto`,r){if(n!==`none`)return n===`content`?e:n===`auto`?r?.()??d(e)[0]??e:typeof n==`function`?n()??e:typeof n==`string`?e.querySelector(n)??e:t&&n instanceof HTMLElement?n:e},contentAttrs:(e,t,n)=>({"aria-labelledby":n?e.titled?`${t}-title`:`${t}-trigger`:void 0,"aria-describedby":e.described?`${t}-description`:void 0,"aria-modal":(n===`dialog`||n===`alertdialog`)&&e.modal===!0?`true`:void 0,"data-presentation":r.presentation&&e.presentation}),triggerAttrs(e,t,n,r,i){let a=i===`menu`||i===`listbox`?i:i&&`dialog`;return{...o(e,t,a??``,n),"aria-haspopup":a,type:`button`,...s(r)}}}}function I(e,t){let{store:n,options:r,preset:i}=e,a=j({trigger:e.triggerElement,popup:()=>e.popup.element(),closesOnLeave:()=>n.get().open&&e.popup.opener()===`hover`,closeDelay:()=>r().closeDelay??i.closeDelay??0,close(t){e.popup.element()?.contains(document.activeElement)||e.control.hide({reason:`trigger-hover`,event:t,focus:!1})}});e.onDestroy(a.clear);let o=()=>(!i.press||!!r().openOnHover)&&!r().disabled,s=e=>o()&&a.leave(e);return{clear:a.clear,enter(s,c,l){if(!o())return;if(c===void 0)return a.enter(s);let u=()=>o()&&!e.triggerDisabled(c)&&e.control.show({by:`hover`,event:s,reason:`trigger-hover`,trigger:c,payload:l});if(n.get().open){a.enter(s),n.get().trigger!==c&&u();return}let d=r().delay??i.delay??300;a.enter(s,u,t?t.delay(d):d)},leave:s,leaveContent(t){let n=t.relatedTarget;(!n||!e.triggerElement()?.contains(n))&&s(t)}}}function L(e){let{store:t,options:n,preset:a}=e,o,s=()=>clearTimeout(o);return e.onDestroy(s),{clear:s,enter(t,r,c){if(n().disabled||!i())return;let l=()=>{!n().disabled&&!e.triggerDisabled(t)&&e.element(e.triggerSlot,t)?.contains(document.activeElement)&&e.control.show({by:`keyboard`,event:c,reason:`trigger-focus`,trigger:t,payload:r})},u=a.focusDelay??n().delay??a.delay??0;s(),u>0?o=setTimeout(l,u):l()},leave(n){if(s(),!t.get().open||e.popup.opener()===`hover`)return;let r=n.relatedTarget;r&&e.popup.element()?.contains(r)||e.control.hide({reason:`focus-out`,event:n,focus:!1})},keydown(t){let n=e.popup.element();return t.key===`Tab`&&!(n&&d(n).length)},triggerAttrs(e,t,n,i,a){let o=e.trigger===null||e.trigger===n;return{...r(e.open&&o),"aria-describedby":a===`tooltip`&&o?`${t}-content`:void 0,"data-disabled":i.disabled?``:void 0}}}}const R=e=>e&&D(e)||void 0;function z(e){return{contentAttrs:(t,n)=>({"aria-labelledby":t.titled===!1?void 0:`${n}-title`,"aria-label":t.titled===!1?R(e.triggerElement()):void 0,"aria-modal":t.modal===!0?`true`:void 0})}}const B={close:void 0,closedAt:-1/0},V=()=>!!B.close||performance.now()-B.closedAt<400;function H(e){return e?e.type.startsWith(`focus`)?`focus-out`:e.type.startsWith(`pointer`)?`trigger-hover`:`outside-press`:`imperative`}function U(e){let t=t=>e.control.hide({reason:H(t),event:t});function n(e){B.close!==t&&B.close?.(e)}let r=!1;return e.onDestroy(()=>{B.close===t&&(B.close=void 0)}),{delay:e=>V()?0:e,opening:n,change(e){if(e){r=V(),n(),B.close=t;return}B.close===t&&(B.close=void 0,B.closedAt=performance.now())},instant:()=>r,join(){e.store.get().open&&!B.close&&(B.close=t)}}}const W=/* @__PURE__ */ new Map,G={prepare(t,n){let r=`${t}-${n}`,i=W.get(r)??[`[data-slot="${r}"]`,`[data-slot="${t}-backdrop"]`];W.set(r,i),e(()=>c(i))},bind(e){u(e.ownerDocument,[`[data-slot="${e.getAttribute(`data-slot`)}"]`])}};export{N as a,z as c,P as i,U as l,L as n,F as o,I as r,G as s,M as t,j as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){return{"data-open":e?``:void 0,"data-closed":e?void 0:``}}function t(e){return{"data-checked":e===!0?``:void 0,"data-unchecked":e===!1?``:void 0,"data-indeterminate":e===`indeterminate`?``:void 0}}function n(e){return e.replace(/[\s%]/g,encodeURIComponent)}export{n,e as r,t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{H as e,R as t,X as n,c as r,r as i}from"./DC08tnkE.js";import{n as a,r as o,t as s}from"./D02PaHn6.js";import{i as c,r as l}from"./DwDilCo2.js";import{t as u}from"./C8w7s5dg.js";import{n as d}from"./DdaCLml8.js";import{n as f}from"./F37aF4-L.js";function p(){return n()}function m(e){let{store:n,options:r,element:i}=e,c=/* @__PURE__ */ new Map,d=s(),p=()=>n.get().orientation,m=()=>r().loop??!0,h=f(e,{slot:`trigger`,key:`stop`,orientation:p,loop:m,claims:(e,t)=>e.disabled||!t.props.disabled}),g=null,_=e=>{e.target===g&&(g=null)},v=u(),y=null,b=()=>{let e=n.get().open;return e===null?void 0:c.get(e)};function x(e,t,r){if(!e)return;let i=c.get(e.key);r&&i&&!i.disabled()?i.open({focus:`first`,reason:`trigger-press`,event:t}):b()?.close({reason:`submenu-switch`,event:t,focus:!1})!==!1&&e.el.focus();let a=n.get().open;(a===null||a===e.key)&&h.remember(e.key)}let S={focus:()=>h.focus(),isOpen:()=>n.get().open!==null,close:({reason:e=`imperative`,event:t}={})=>b()?.close({reason:e,event:t,focus:!0})??!1,internal:{orientation:p,disabled:()=>n.get().disabled,modal:()=>n.get().modal,stop:()=>n.get().stop,subscribe:n.subscribe,element:()=>i(`root`),isStop:(e,t)=>h.tabIndex(n.get(),{key:e,props:{disabled:!t}})===`0`,join(e,t,n){c.set(e,n);let r=h.bind(t,{key:e,props:{}});return()=>{c.get(e)===n&&c.delete(e),r()}},onTrigger:e=>h.items().some(t=>t.el.contains(e)),opening:(e,t)=>[...c].every(([n,r])=>n===e||!r.isOpen()||r.close({reason:`submenu-switch`,event:t,focus:!1})),openChanged(e,t){v.stop(),t?(g=null,n.set({open:e})):n.get().open===e&&n.set({open:null})},menuArrow(e,t,n){if(p()===`vertical`)return t===-1?`close`:void 0;let r=h.items(),i=r.findIndex(t=>t.key===e),a=r[l(i,t,r.length,m())];return a&&a.key!==e&&x(a,n,!0),`moved`},triggerKeydown(e,n,r,i){e.key===`Escape`&&(g=null);let s=c.get(n)?.isOpen()??!1,l=e.shiftKey?void 0:h.keydown(e,r);if(l){s&&l.key!==l.from&&x(h.items().find(e=>e.key===l.key),e,!0);return}if(e.defaultPrevented||e.altKey||e.ctrlKey||e.metaKey)return;if(a(e)&&e.key!==` `){let t=h.items(),r=d(e.key,t.map(e=>o(e.el)),t.findIndex(e=>e.key===n));return r===-1?void 0:(e.preventDefault(),x(t[r],e,s))}if(i)return;let u=p()===`vertical`,f=u?e.key===(t(r)?`ArrowLeft`:`ArrowRight`):e.key===`ArrowDown`,m=!u&&e.key===`ArrowUp`,_=r.tagName!==`BUTTON`&&(e.key===`Enter`||e.key===` `);if(f||m||_)return e.preventDefault(),m?`last`:`first`},hover(e,t){let r=n.get().open,i=c.get(e);if(!(r===null&&!g||r===e||!i||t.pointerType===`touch`||(y=e,v.contains({x:t.clientX,y:t.clientY},()=>y===e&&S.internal.hover(e,t))))){if(v.stop(),i.disabled()){let r=h.items().find(t=>t.key===e);if(!r||(x(r,t,!1),n.get().open!==null))return;g=r.el,r.el.addEventListener(`blur`,_,{once:!0});return}h.remember(e),i.open({focus:`popup`,reason:`trigger-hover`,event:t,by:`pointer`})}},hoverMove(e,t){v.active()&&S.internal.hover(e,t)},leave(e,t,r){y===e&&(y=null),n.get().open===e&&r&&v.start({x:t.clientX,y:t.clientY},r,p()===`vertical`?`x`:`y`)},enterMenu:()=>v.stop()}};return S}const h=/* @__PURE__ */ e({name:`menubar`,options:{orientation:`string`,loop:`boolean`,disabled:`boolean`,modal:d,controller:`value`},state:e=>({orientation:c(e.orientation,`horizontal`),disabled:!!e.disabled,modal:e.modal??`pointer`,stop:null,open:null}),controlled:[],sync:e=>({orientation:c(e.orientation,`horizontal`),disabled:!!e.disabled,modal:e.modal??`pointer`}),api:m,slots:e=>({root:e({role:`menubar`,keys:{none:`Each menu's trigger, an item of the menubar, handles them.`},state:e=>({orientation:e.orientation,disabled:e.disabled,open:e.open!==null,modal:e.modal}),attrs:e=>({"aria-orientation":e.orientation,"data-orientation":e.orientation,"data-disabled":e.disabled?``:void 0,"data-open":e.open===null?void 0:``})})}),agent:{actions:[`close`]}});function g(){i(h,{root:{tag:`ui-menubar`,display:`block`,defaults:{loop:!0},api:[`focus`,`isOpen`,`close`],render(e,{api:t}){for(let n of e.querySelectorAll(`ui-menu`))r(n)&&_(n)===t&&n.rebind?.()}}})}function _(e){let t=e.parentElement?.closest(`ui-menubar, ui-menu`);return t?.localName===`ui-menubar`?r(t)?.api:void 0}export{_ as n,p as r,g as t};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{H as e,It as t,J as n,Jt as r,Mt as i,Nt as a,Rt as o,V as s,Vt as c,X as l,Yt as u,c as d,in as f,r as p,zt as m}from"./DC08tnkE.js";import{n as h,t as g}from"./BJj3oS29.js";import{t as _}from"./B7EgSgjQ.js";import{n as v}from"./0eRGibL6.js";import{n as y}from"./DwDilCo2.js";function b(e){if(e!==null)return e===`indeterminate`?`indeterminate`:e!==`false`}function x(e){let t=e.checked??e.defaultChecked??!1;return{checked:t,initial:t,disabled:!!e.disabled,readOnly:!!e.readOnly,required:!!e.required,name:e.name,value:e.value??`on`,form:e.form,formDisabled:!1}}function S(e){return{disabled:!!e.disabled,readOnly:!!e.readOnly,required:!!e.required,name:e.name,value:e.value??`on`,form:e.form,...e.defaultChecked===void 0?{}:{initial:e.defaultChecked},...e.checked===void 0?{}:{checked:e.checked}}}function C({store:e,element:n},r,i){let a=()=>{let e=n(`root`);return o(e)?e:n(`input`)},s=()=>{let e=n(`root`);return o(e)?.form??n(`input`)?.form??i?.owner()?.formOwner()};function l(e,t){let n=i?.owner();return i&&n?i.write(n,e,t):r(`checked`,e,t)}function u(n,{reason:r=`imperative`,event:i}={}){let o=e.get();if(c(o)||o.readOnly)return!1;let s=l(n,{reason:r,event:i});return s&&r!==`restore`&&t(a()),s}return{getChecked:()=>e.get().checked,setChecked:(e,t)=>u(e,t),toggle(t={}){return u(e.get().checked!==!0,t)},focus:()=>n(`root`)?.focus(),form:s,internal:{restore(e){l(e===`indeterminate`?`indeterminate`:e===`true`,{reason:`restore`})},reset(){i?.owner()||r(`checked`,e.get().initial,{reason:`reset`})},setFormDisabled(t){e.set({formDisabled:t})},root:()=>n(`root`)}}}const w=e=>e instanceof HTMLButtonElement,T=e=>({checked:e.checked===!0,disabled:c(e),readOnly:e.readOnly,required:e.required}),E=e=>({..._(e.checked),"data-disabled":c(e)?``:void 0,"data-readonly":e.readOnly?``:void 0,"data-required":e.required?``:void 0});function D(e,t,n){return{root:t({...e===`checkbox`?{role:`checkbox`}:{role:`switch`},focus:`tab-stop`,state:n,attrs:e=>({type:`button`,"aria-checked":e.checked===`indeterminate`?`mixed`:String(e.checked),"aria-readonly":e.readOnly?`true`:void 0,"aria-required":e.required?`true`:void 0,"aria-disabled":c(e)?`true`:void 0,disabled:e.disabled?``:void 0,tabindex:c(e)?void 0:`0`,...E(e)}),press:({api:e},t)=>{t?.preventDefault(),e.toggle({reason:`press`,event:t})},on:{keydown:(e,{api:t,el:n})=>{e.key===`Enter`?(e.preventDefault(),e.repeat||r(t.form())):e.key===` `&&!w(n)&&e.preventDefault()},keyup:(e,{api:t,el:n})=>{e.key===` `&&!w(n)&&t.toggle({reason:`press`,event:e})}},bind:(e,{api:t,store:n})=>a(e,{value:()=>n.get().checked===!0&&n.get().name!==void 0?n.get().value:null,state:()=>String(n.get().checked),restore:t.internal.restore,valueMissing:()=>n.get().required&&n.get().checked!==!0,message:()=>u(`checkbox`),reset:t.internal.reset,disabled:t.internal.setFormDisabled,subscribe:n.subscribe})}),input:t({attrs:e=>({type:`checkbox`,name:e.name,value:e.value,form:e.form,checked:e.initial===!0?``:void 0,required:e.required?``:void 0,disabled:e.disabled?``:void 0,"aria-hidden":`true`,tabindex:`-1`,style:m}),bind:(e,{api:t,store:n})=>i(e,{checked:()=>n.get().checked===!0,indeterminate:()=>n.get().checked===`indeterminate`,subscribe:n.subscribe,focus:t.focus,control:t.internal.root,activate:e=>t.toggle({reason:`press`,event:e}),reset:t.internal.reset,disabled:t.internal.setFormDisabled})})}}function O(e,t){let n=t.filter(t=>e.includes(t)).length;return n===0?!1:n===t.length||`indeterminate`}function k(){return l()}const A=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),j=e=>e.enabled.filter(t=>e.value.includes(t));function M(e){let{id:t,store:n,element:r}=e,i=v(e),a=/* @__PURE__ */ new Map,s=()=>c(n.get()),l=()=>n.get().allValues??n.get().children;function u(){for(let e of n.get().children){let t=a.get(e);if(t?.el.isConnected&&!t.disabled())return t.el}}function d(e,t){return A(e,n.get().value)?!0:i(`value`,y(e,l()),t)}function p(){let e=[...a.entries()].filter(([,e])=>e.el.isConnected).sort(([,e],[,t])=>f(e.el,t.el)).map(([e])=>e),t=e.filter(e=>!a.get(e).disabled()),r=e.map(e=>a.get(e).el.id).join(` `),i=n.get();n.set({...A(e,i.children)?{}:{children:e},...A(t,i.enabled)?{}:{enabled:t},ids:r})}return{id:t,getValue:()=>n.get().value,setValue:(e,{reason:t=`imperative`,event:n}={})=>!s()&&d(e,{reason:t,event:n}),focus:()=>u()?.focus(),name:()=>n.get().name,form:()=>n.get().form,disabled:s,readOnly:()=>n.get().readOnly,checked:e=>n.get().value.includes(e),parentChecked:()=>O(n.get().value,l()),setChild(e,t,r){if(s())return!1;let i=n.get().value;return d(t?[...i.filter(t=>t!==e),e]:i.filter(t=>t!==e),r)},allEnabledChecked(){let e=n.get().value;return l().every(t=>a.get(t)?.disabled()||e.includes(t))},formOwner:()=>o(r(`group`))?.form??r(`group-input`)?.form??null,setAll(e,t){if(s())return!1;let r=e=>a.get(e)?.disabled()??!1,i=n.get().value;return d(e?[.../* @__PURE__ */ new Set([...i,...l().filter(e=>!r(e))])]:i.filter(e=>r(e)),t)},childIds:()=>n.get().ids,register(e,n,r){return n.id||=`${t}-${e.replace(/[\s%]/g,encodeURIComponent)}`,a.set(e,{el:n,disabled:r}),queueMicrotask(p),()=>{a.get(e)?.el===n&&a.delete(e),queueMicrotask(p)}},subscribe:n.subscribe,internal:{reset(){i(`value`,n.get().initial,{reason:`reset`})},restore(e){d(e?e.split(`
|
|
2
|
+
`):[],{reason:`restore`})},setFormDisabled(e){n.set({formDisabled:e})},refreshChildren:()=>queueMicrotask(p),anchor:u}}}const N=/* @__PURE__ */ e({name:`checkbox`,label:`checkbox-group`,options:{value:`list`,defaultValue:`list`,onValueChange:`callback`,allValues:`list`,disabled:`boolean`,readOnly:`boolean`,required:`boolean`,name:`string`,form:`string`,controller:`value`},state:e=>{let t=e.value??e.defaultValue??[];return{value:t,initial:t,allValues:e.allValues,disabled:!!e.disabled,readOnly:!!e.readOnly,required:!!e.required,name:e.name,form:e.form,formDisabled:!1,children:[],enabled:[],ids:``}},sync:e=>({allValues:e.allValues,disabled:!!e.disabled,readOnly:!!e.readOnly,required:!!e.required,name:e.name,form:e.form,...e.defaultValue===void 0?{}:{initial:e.defaultValue},...e.value===void 0?{}:{value:e.value}}),live:[`ids`],api:M,slots:e=>({group:e({role:`group`,state:e=>({value:e.value,disabled:c(e),readOnly:e.readOnly,required:e.required}),attrs:e=>({"aria-disabled":c(e)?`true`:void 0,"data-disabled":c(e)?``:void 0,"data-readonly":e.readOnly?``:void 0,"data-required":e.required?``:void 0}),bind:(e,{api:t,store:n})=>a(e,{value:()=>j(n.get()),name:()=>n.get().name,state:()=>n.get().value.join(`
|
|
3
|
+
`),restore:t.internal.restore,valueMissing:()=>n.get().required&&j(n.get()).length===0,message:()=>u(`checkbox`),anchor:t.internal.anchor,focus:t.focus,reset:t.internal.reset,disabled:t.internal.setFormDisabled,subscribe:n.subscribe})}),"group-input":e({attrs:e=>({type:`checkbox`,form:e.form,checked:e.initial.length?``:void 0,required:e.required?``:void 0,disabled:e.disabled?``:void 0,"aria-hidden":`true`,tabindex:`-1`,style:m}),bind:(e,{api:t,store:n})=>i(e,{checked:()=>j(n.get()).length>0,subscribe:n.subscribe,focus:t.focus,reset:t.internal.reset,disabled:t.internal.setFormDisabled})})}),agent:{actions:[`setValue`,`setAll`]}});function P(){return l()}function F(e){let t=e.group?.();if(!t)return;let n=!!e.parent;return{checked:n?t.parentChecked():t.checked(e.value??`on`),name:n?void 0:e.name??t.name(),disabled:!!e.disabled||t.disabled(),readOnly:!!e.readOnly||t.readOnly(),form:e.form??t.form()}}function I(e){let t=F(e);return t?{...t,required:!!e.required,value:e.value??`on`}:S(e)}function L(e){let{store:t,element:r,options:i}=e,a=v(e),o=()=>i().group?.(),s=()=>!!i().parent,l=C(e,a,{owner:o,write(e,n,r){let{reason:i,event:o}=r,c={reason:i===`press`?`item-press`:i,event:o};return(s()?e.setAll(n===!0&&!e.allEnabledChecked(),c):e.setChild(t.get().value,n===!0,c))?(a(`checked`,s()?e.parentChecked():e.checked(t.get().value),r),!0):!1}}),u=!1,d=(e,t)=>t===!1&&e!==!1&&!!r(`indicator`);n(e,[`exiting`],(e,t)=>`checked`in e&&e.checked!==t.checked?{exiting:d(t.checked,e.checked)}:void 0);let f=t.get().checked;return t.subscribe(()=>{let{checked:e}=t.get();if(e===f)return;let n=f;f=e,u=!0,t.set({exiting:d(n,e)})}),{...l,isChanged:()=>u,internal:{...l.internal,joinGroup(e){let n=o();if(!n)return()=>{};let r=()=>{let{name:e,disabled:r,readOnly:a,form:o}=F(i());t.set({checked:s()?n.parentChecked():n.checked(t.get().value),controls:s()&&n.childIds()||void 0,name:e,disabled:r,readOnly:a,form:o})},a=n.subscribe(r);if(r(),s())return a;let l=()=>n.register(t.get().value,e,()=>c(t.get())),u=l(),{value:d}=t.get(),f=c(t.get()),p=t.subscribe(()=>{let e=t.get();e.value===d?c(e)!==f&&n.internal.refreshChildren():(d=e.value,u(),u=l()),f=c(e)});return()=>{a(),p(),u()}},finishExit(){t.set({exiting:!1})}}}}const R=L,z=e=>({...T(e),indeterminate:e.checked===`indeterminate`}),B=/* @__PURE__ */ e({name:`checkbox`,options:{checked:b,defaultChecked:b,onCheckedChange:`callback`,disabled:`boolean`,readOnly:`boolean`,required:`boolean`,name:`string`,value:`string`,form:`string`,controller:`value`,parent:`boolean`,group:`value`},state:e=>{let t=F(e);return{...x(t?{...e,...t}:e),exiting:!1,controls:void 0}},controlled:[`checked`],live:[`controls`],sync:I,api:R,slots:e=>{let{root:t,input:n}=D(`checkbox`,e,z);return{root:e({...t,live:s(e=>({"aria-controls":e.controls})),bind:(e,n)=>{let r=n.api.internal.joinGroup(e),i=t.bind?.(e,n);return()=>{i?.(),r()}}}),input:n,indicator:e({props:{keepMounted:`boolean`},present:(e,{props:t})=>!!t.keepMounted||e.checked!==!1||e.exiting,state:z,attrs:e=>E(e),bind(e,{api:t,store:n,props:r}){let i,a=n.get().checked!==!1;a&&t.isChanged()&&(i=g(e));let o=n.subscribe(()=>{let{checked:o,exiting:s}=n.get();e.toggleAttribute(`data-checked`,o===!0),e.toggleAttribute(`data-unchecked`,o===!1),e.toggleAttribute(`data-indeterminate`,o===`indeterminate`),o!==!1!==a&&(a=o!==!1,i?.(),i=void 0,a?i=g(e):(s||r.keepMounted)&&(i=h(e,()=>{i=void 0,t.internal.finishExit()})))});return()=>{o(),i?.()}}})}},agent:{actions:[`setChecked`]}});function V(){return l()}const H=/* @__PURE__ */ e({name:`switch`,options:{checked:`boolean`,defaultChecked:`boolean`,onCheckedChange:`callback`,disabled:`boolean`,readOnly:`boolean`,required:`boolean`,name:`string`,value:`string`,form:`string`,controller:`value`},state:e=>x(e),controlled:[`checked`],sync:S,api:e=>C(e,v(e)),slots:e=>({...D(`switch`,e,T),thumb:e({state:T,attrs:e=>E(e)})}),agent:{actions:[`setChecked`]}}),U=[`getChecked`,`setChecked`,`toggle`,`focus`];function W(){p(B,{root:{tag:`ui-checkbox`,formAssociated:!0,kinds:{group:null},options:e=>({group:()=>d(e.parentElement?.closest(`ui-checkbox-group`))?.api}),state:{checked:{get:e=>e.getChecked(),set:(e,t)=>e.setChecked(t)}},api:U},indicator:`ui-checkbox-indicator`})}function G(){p(N,{root:{tag:`ui-checkbox-group`,self:`group`,display:`block`,formAssociated:!0,state:{value:{get:e=>e.getValue(),set:(e,t)=>e.setValue(t??[])}},api:[`getValue`,`setValue`,`focus`]}})}function K(){p(H,{root:{tag:`ui-switch`,formAssociated:!0,state:{checked:{get:e=>e.getChecked(),set:(e,t)=>e.setChecked(!!t)}},api:U},thumb:{tag:`ui-switch-thumb`,display:`block`}})}export{P as a,V as i,G as n,k as o,K as r,W as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{kt as e}from"./DC08tnkE.js";const t=/* @__PURE__ */ new WeakMap;function n(e,n){t.get(e)?.();let i=e.getAnimations?.().every(e=>!r(e));if(e.setAttribute(`data-starting-style`,``),i)for(let t of e.getAnimations())r(t)&&t.finish();let a,o,s=requestAnimationFrame(()=>o=setTimeout(()=>{e.removeAttribute(`data-starting-style`),n&&(a=c(e,n))}));return()=>{cancelAnimationFrame(s),clearTimeout(o),a?.(),e.removeAttribute(`data-starting-style`)}}const r=e=>`transitionProperty`in e;function i(e){return e.split(`,`).map(e=>{let t=parseFloat(e);return e.trim().endsWith(`ms`)?t/1e3:t})}function a(e){return Math.max(o(getComputedStyle(e)),o(getComputedStyle(e,`::backdrop`)))}function o(e){let t=(e,t,n=`1`)=>{let r=i(e),a=i(t),o=n.split(`,`).map(e=>e.trim()===`infinite`?1:parseFloat(e)||1);return r.map((e,t)=>(e*(o[t%o.length]??1)+(a[t%a.length]??0))*1e3)};return Math.max(0,...t(e.transitionDuration,e.transitionDelay),...t(e.animationDuration,e.animationDelay,e.animationIterationCount))}function s(e){let t=0;for(let n of e){let e=n.effect?.getComputedTiming(),r=Number(e?.endTime);e&&Number.isFinite(r)&&(t=Math.max(t,r-(Number(e.localTime)||0)))}return t}function c(t,n){let r=!1,i=t.getAnimations({subtree:!0}),o=()=>{r||(r=!0,clearTimeout(c),n())},c=i.length?setTimeout(o,Math.max(a(t),s(i))+50):void 0;return i.length?Promise.allSettled(i.map(e=>e.finished)).then(o):e(o),()=>{r=!0,clearTimeout(c)}}function l(e,t){e.toggleAttribute(`data-open`,t),e.toggleAttribute(`data-closed`,!t)}function u(e,n){t.get(e)?.(),e.removeAttribute(`data-starting-style`),e.setAttribute(`data-ending-style`,``),e.inert=!0;let r=0,i=()=>{cancelAnimationFrame(r),t.delete(e),e.removeAttribute(`data-ending-style`),e.inert=!1},a=!1,o=c(e,()=>{if(!a)return i(),n();t.set(e,i),r=requestAnimationFrame(()=>{r=requestAnimationFrame(i)}),n()});return a=!0,()=>{o(),i()}}export{u as n,l as r,n as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{it as e}from"./DC08tnkE.js";import{n as t,t as n}from"./BJj3oS29.js";function r(e,t){return{hidden:e?void 0:t?`until-found`:``}}function i(){return typeof document<`u`&&`onbeforematch`in document.body}function a(e,t){let n=()=>{if(t.shown())return;let n=e.getAttribute(`hidden`);t.findable()?n!==`until-found`&&e.setAttribute(`hidden`,`until-found`):n===`until-found`&&e.setAttribute(`hidden`,``)};n();let r=typeof MutationObserver>`u`?void 0:new MutationObserver(n);return r?.observe(e,{attributes:!0,attributeFilter:[`hidden`]}),e.addEventListener(`beforematch`,t.reveal),Object.assign(()=>{r?.disconnect(),e.removeEventListener(`beforematch`,t.reveal)},{check:n})}function o(e,r){let i=[],o=(t,n=t)=>r.size(e,t,n),s=a(e,{shown:()=>r.isOpen()||r.isExiting(),findable:r.isFindable,reveal:r.reveal});i.push(s);let c,l=()=>{c?.(),c=void 0},u=()=>{l();let t=r.opening();if(t!==`animate`){for(let t of e.getAnimations())t.finish();o(`auto`),t===`instant`&&r.settled(!0);return}e.removeAttribute(`hidden`),e.removeAttribute(`data-closed`),e.setAttribute(`data-open`,``),c=n(e,()=>{c=void 0,o(`auto`),r.settled(!0)}),o(`${e.scrollHeight}px`,`${e.scrollWidth}px`)},d=()=>{if(l(),e.contains(document.activeElement)&&r.trigger()?.focus({preventScroll:!0}),!r.isExiting()){o(`0px`),r.settled(!1);return}e.removeAttribute(`data-open`),e.setAttribute(`data-closed`,``);let n=getComputedStyle(e);o(n.height,n.width),e.offsetHeight,c=t(e,()=>{o(`0px`),r.exited(),r.settled(!1)})},f=r.isOpen();return f?u():o(`0px`),i.push(r.subscribe(()=>{s.check(),r.isOpen()!==f&&(f=!f,f?u():d())})),i.push(l),()=>i.forEach(e=>e())}function s(t,n){return r=>{let i=t.subscribe(r),a=e(n,r);return()=>{i(),a()}}}export{i as a,s as i,o as n,r,a as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Q as e,R as t}from"./DC08tnkE.js";import{n}from"./By30h-7B.js";import{o as r}from"./DT3Hb76X.js";const i=e=>({min:e?.min??0,max:e?.max??1,step:e?.step??.01,label:e?.label});function a(a,o){let{store:s}=a,c=()=>i(o.x?.()),l=()=>i(o.y?.()),u=()=>o.value(s.get()),d=n(a.onDestroy),f=(e,t)=>t.max===t.min?0:(e-t.min)/(t.max-t.min);function p(e,t){let n={x:r(e.x,c()),y:r(e.y,l())},i=u();return n.x===i.x&&n.y===i.y?!1:o.set(n,t)}function m(e,n,r){let i=e.getBoundingClientRect(),a=i.width?(n-i.left)/i.width:0;t(e)&&(a=1-a);let o=i.height?1-(r-i.top)/i.height:0,s=c(),u=l();return{x:s.min+Math.min(1,Math.max(0,a))*(s.max-s.min),y:u.min+Math.min(1,Math.max(0,o))*(u.max-u.min)}}let h={set:e=>p(e,{reason:`imperative`}),pointerdown(t,n){if(!d.accepts(t)||o.disabled?.())return;t.preventDefault(),p(m(n,t.clientX,t.clientY),{reason:`track-press`,event:t}),n.querySelector(`[data-area-thumb]`)?.focus({preventScroll:!0});let r=`track-press`,i=s.subscribe(()=>o.disabled?.()&&d.cancel());d.start(n,t,{onMove:e=>{p(m(n,e.x,e.y),{reason:`drag`,event:e.event})&&(r=`drag`)},onEnd:t=>{i(),e()||o.onCommit?.(u(),{reason:r,event:t})}})},keydown(e){if(e.defaultPrevented||o.disabled?.()||e.altKey||e.ctrlKey||e.metaKey)return!1;let n=c(),r=l(),i=u(),a=e.shiftKey?10:1,s=e.target instanceof Element&&t(e.target),d;if(e.key===`ArrowLeft`||e.key===`ArrowRight`){let t=(e.key===`ArrowRight`?1:-1)*(s?-1:1);d={...i,x:i.x+t*n.step*a}}else e.key===`ArrowUp`||e.key===`ArrowDown`?d={...i,y:i.y+(e.key===`ArrowUp`?1:-1)*r.step*a}:e.key===`PageUp`||e.key===`PageDown`?d={...i,y:i.y+(e.key===`PageUp`?1:-1)*(r.max-r.min)/10}:e.key===`Home`?d={...i,x:n.min}:e.key===`End`&&(d={...i,x:n.max});return d?(e.preventDefault(),p(d,{reason:`step-key`,event:e})&&o.onCommit?.(u(),{reason:`step-key`,event:e}),!0):!1},fractions(e){let t=o.value(e);return{x:f(t.x,c()),y:f(t.y,l())}},thumbStyle(e){let{x:t,y:n}=h.fractions(e),r=e=>Math.round(e*1e4)/100;return`position:absolute;inset-inline-start:${r(t)}%;top:${r(1-n)}%;--area-x:${t};--area-y:${n}`},thumbAttrs(e){let t=o.value(e),n=c(),r=l(),i=(e,t)=>`${Math.round(f(e,t)*100)}%`,a=o.valueText?.(t)??`${n.label??`X`} ${i(t.x,n)}, ${r.label??`Y`} ${i(t.y,r)}`;return{role:`slider`,tabindex:o.disabled?.()?`-1`:`0`,"aria-roledescription":`2D slider`,"aria-valuemin":String(n.min),"aria-valuemax":String(n.max),"aria-valuenow":String(t.x),"aria-valuetext":a,"aria-disabled":o.disabled?.()?`true`:void 0,"data-area-thumb":``}}};return h}export{a as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as e,E as t,F as n,I as r,J as i,L as a,X as o,_t as s,bt as c,gt as l,mt as u,on as d,vt as f,xt as p}from"./DC08tnkE.js";import{n as m,r as h,t as g}from"./BJj3oS29.js";import{r as _}from"./B7EgSgjQ.js";import{c as v,d as y,l as b,u as x}from"./0eRGibL6.js";import{c as ee,d as te,f as ne,h as re,i as ie,l as S,m as C,o as ae,p as w,r as T,u as oe}from"./Djdv-16J.js";import{a as E,i as D,o as O,s as k}from"./DjRcw3Y0.js";const A=globalThis[Symbol.for(`ui-sdk.modal@2`)]??={holders:/* @__PURE__ */ new WeakMap,thaw:/* @__PURE__ */ new WeakMap,inert:/* @__PURE__ */ new WeakMap};function se(e=document,t){let n={},r=A.holders.get(e);r||A.holders.set(e,r=/* @__PURE__ */ new Set),r.size||A.thaw.set(e,M(e)),r.add(n);let i=t&&a()?V(t):void 0;return()=>{r.delete(n)&&(i?.(),!r.size&&(A.thaw.get(e)?.(),A.thaw.delete(e)))}}function j({scrollbar:e,gutter:t,padding:n}){let r={overflow:`hidden`,"scroll-behavior":`auto`};return e>0&&(t?r[`scrollbar-gutter`]=`stable`:r[`padding-right`]=`${n+e}px`),r}function M(e){let{scroller:t,gutter:n,padding:r}=N.get(e)??F(e),i=j({scrollbar:n,gutter:typeof CSS<`u`&&CSS.supports(`scrollbar-gutter`,`stable`),padding:r}),a=Object.entries(i).map(([e,n])=>c(t,e,n));return a.push(c(e.documentElement,`--scrollbar-width`,`${Math.max(0,n)}px`)),()=>a.forEach(e=>e())}const N=/* @__PURE__ */ new WeakMap;function P(e){N.has(e)||(N.set(e,F(e)),setTimeout(()=>N.delete(e)))}function F(e){let t=e.defaultView??window,n=I(e,t),r=t.getComputedStyle(n);return{scroller:n,gutter:L(n,e,t,r),padding:parseFloat(r.paddingRight)||0}}function I(e,t){let{body:n,documentElement:r}=e;return!n||t.getComputedStyle(r).overflowY===`visible`?r:/auto|scroll/.test(t.getComputedStyle(n).overflowY)?n:r}function L(e,t,n,r){if(e===t.documentElement)return n.innerWidth-e.clientWidth;let i=(parseFloat(r.borderLeftWidth)||0)+(parseFloat(r.borderRightWidth)||0);return e.offsetWidth-e.clientWidth-i}function R(e,t){let n=t.getComputedStyle(e),r=/auto|scroll/.test(n.overflowY)&&e.scrollHeight>e.clientHeight,i=/auto|scroll/.test(n.overflowX)&&e.scrollWidth>e.clientWidth;return r||i}function z(e,t){let{body:n,documentElement:r}=e.ownerDocument;for(let i=e;i&&i!==n&&i!==r;i=i.parentElement)if(R(i,t))return!0;return!1}function B(e){return e.fingers>1||e.zoomed?`browser`:e.scroller||e.slider||e.selecting?`element`:`page`}function V(e){let t=e.ownerDocument,n=t.defaultView??window;p(t,`ui-sdk-scroll-guard`,`@layer ui-sdk { [data-scroll-guard], [data-scroll-guard] * { overscroll-behavior: contain } }`);let r=!e.hasAttribute(`data-scroll-guard`);r&&e.setAttribute(`data-scroll-guard`,``);let i=`browser`,a=u(t,`touchstart`,e=>{let r=e.target instanceof Element?e.target:null;i=B({fingers:e.touches.length,zoomed:(n.visualViewport?.scale??1)!==1,scroller:!!r&&z(r,n),slider:!!r?.closest(`input[type="range"]`),selecting:t.getSelection()?.type===`Range`})},{capture:!0,passive:!0}),o=u(t,`touchmove`,e=>{i===`page`&&e.cancelable&&e.preventDefault()},{passive:!1});return()=>{a(),o(),r&&e.removeAttribute(`data-scroll-guard`)}}function H(e){let t=e.parentNode;return t instanceof ShadowRoot?t.host:t}function U(e){let t=e[0]?.ownerDocument??document,n=[...e,...Array.from(t.querySelectorAll(`[aria-live]:not([aria-live="off"]),[role="status"],[role="alert"],[role="log"],output`)),...C()],r=n.filter(e=>!n.some(t=>t!==e&&t.contains(e))),i=/* @__PURE__ */ new Set;for(let e of r)for(let t=e;t;t=H(t))i.add(t);let a=[];for(let e of r)for(let n=e;n&&n!==t.body;n=H(n))for(let e of Array.from(n.parentNode?.children??[])){if(i.has(e)||!(e instanceof HTMLElement))continue;let t=A.inert.get(e)??(e.inert?1/0:0);t===0&&(e.inert=!0),t!==1/0&&A.inert.set(e,t+1),a.push(e)}return()=>{for(let e of a){let t=A.inert.get(e);t!==void 0&&(t<=1?(e.inert=!1,A.inert.delete(e)):A.inert.set(e,t-1))}}}function ce(e){let t=e,n=U(t),r=!1,i=e=>{let r=n;t=e,n=U(e),r()};return Object.assign(()=>{r||(r=!0,n())},{keep(e){return r?()=>{}:(i([...t,e]),()=>{r||i(t.filter(t=>t!==e))})}})}const W={tab:`close`,blur:`always`,outsidePress:`pointerdown`,shield:!1,keepTrigger:!0,focusOnMount:!1,dismissOnFocusLoss:!0,closeWatcher:!1,blocking:!1,movesFocus:!0},G=e=>e.trapFocus?`trap`:`flow`,le={menu:W,select:W,combobox:{...W,tab:`native`},popover:{...W,tab:G,blur:`iframe`},dialog:{...W,tab:G,blur:`never`,outsidePress:`click`,shield:!0,keepTrigger:!1,focusOnMount:!0,dismissOnFocusLoss:!1,closeWatcher:!0,blocking:e=>e.inertAndLock},tooltip:{...W,tab:`native`,movesFocus:!1},hoverCard:{...W,tab:`flow`},navigationMenu:{...W,tab:`flow`,blur:`never`}};function ue(e,t){let n={...le[e]};for(let e of Object.keys(W)){let r=t[e];r!==void 0&&Object.assign(n,{[e]:r})}return n}function K(e){return{consumeOutsidePress:e===!0||e===`pointer`,trapFocus:e===!0||e===`trap-focus`,inertAndLock:e===!0}}const q={mouse:`pointer`,pen:`pointer`,touch:`touch`,keyboard:`keyboard`,virtual:`keyboard`,programmatic:`imperative`,agent:`imperative`},de=e=>e?q[x(e)]:`imperative`;function fe(e){return e===`initial`||e===`hover`?`none`:e===`touch`?`popup`:`auto`}function pe(e){return e.focusable&&!e.consumed?!1:e.type!==`pointerdown`||`later`}function me(e,t){for(let n of e){let e=n();if(e&&t(e))return e}}function J(){return o()}function he(e,t,n){i(e,t,(e,t)=>`open`in e&&e.open!==t.open?n(!!e.open,t):void 0)}function Y(e,t,n,r=``){let i=e.trigger==null||e.trigger===r,a=e.open&&i;return{id:i?`${t}-trigger`:void 0,"aria-haspopup":n,"aria-expanded":String(a),"aria-controls":i&&e.mounted?`${t}-content`:void 0,..._(a)}}function ge(e){let t=e.disabled&&e.focusableWhenDisabled;return{disabled:e.disabled&&!t?``:void 0,"aria-disabled":t?`true`:void 0,"data-disabled":e.disabled?``:void 0}}function _e(e,t){return{id:`${t}-content`,tabindex:`-1`,hidden:e.mounted?void 0:``,..._(e.open)}}function ve(e,t){return typeof e==`function`?e()??void 0:typeof e==`string`?t.querySelector(e)??void 0:e}function X(e){return e.isConnected&&!e.closest(`[inert]`)}function ye(){let t=e();return!t||t===t.ownerDocument.body||!X(t)||t.checkVisibility?.()===!1}function be(e,t){return e.x<t.left||e.x>t.right||e.y<t.top||e.y>t.bottom}function xe(e){return e.getRootNode().activeElement}const Z=()=>globalThis[Symbol.for(`ui-sdk.popover-reset@2`)]??=/* @__PURE__ */ new WeakMap;function Q(e,t){let n=Z().get(e);n||Z().set(e,n={selectors:/* @__PURE__ */ new Set,css:``});let r=n.selectors;t.every(e=>r.has(e))||(t.forEach(e=>r.add(e)),n.css=`@layer ui-sdk { :where(${[...r].map(e=>`${e}[popover]`).join(`, `)}) { inset: auto; width: auto; height: auto; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; overflow: visible; color: inherit; background: none } }`),n.css&&p(e,`ui-sdk-popover-reset`,n.css)}const $=/* @__PURE__ */ new WeakSet;function Se(e){r&&!$.has(e)&&($.add(e),s(()=>{Q(document,e),f(document)}))}function Ce(e){let t=globalThis.CloseWatcher;if(!t||!/Android/.test(navigator.userAgent))return;let n;try{n=new t}catch{return}return n.addEventListener(`close`,t=>{performance.now()-S()<100||e(t)}),()=>n?.destroy()}const we=/* @__PURE__ */ new WeakMap;function Te(i){let a=ue(i.preset,i),o=()=>typeof a.tab==`function`?a.tab(i.modal()):a.tab,{store:s}=i,c,f,p,_,x,S,C=s.get().open?`initial`:`imperative`,A=a.focusOnMount&&s.get().open,j=!1,M=!1,N=!0,P,F=s.get().open,I=()=>void 0,L=[],R=i.returnTrigger??i.trigger,z,B,V,H,U=(e,t)=>i.onOpenChangeComplete?.(e,t),W=e=>e||!!f?.el&&r;he({store:s},[`mounted`],e=>W(e)===e?{mounted:e}:void 0);let G=s.get().open;s.subscribe(()=>{let{open:n}=s.get();if(n===G)return;if(G=n,n){if(H?.(!0),i.onOpenChange?.(!0),_?.(),_=void 0,f)for(let e of[f.el,f.backdrop])e&&h(e,!0);A=!0,j=!0,N=!0;let t=r?e():null;P=t&&t!==t.ownerDocument.body?t:void 0,F=C===`imperative`;let n=P&&ae(P),a=n?void 0:ee();I=n?.returnTarget??(()=>a);let o=!!f;s.set({mounted:!0}),c?(o&&$(),_e()):r||(j=!1,U(!0));return}let o=a.movesFocus&&N;N=!0,A=!1,j=!1,C=`imperative`;let l=H?.(!1),d=f?.el;p&&ne(q());let g=I;if(!d||!r){i.onOpenChange?.(!1,l),s.set({mounted:!1}),U(!1,l);return}let v=e(),y=i.trigger(),b=!v||v===d.ownerDocument.body||t(d,v)||!!p&&oe(p,v)&&!(y&&t(y,v));i.onOpenChange?.(!1,l),c?.config.onClose?.();let re=te(),ie=[d,...f?.backdrop?[f.backdrop]:[]],T=ie.length,E=ie.map(e=>(h(e,!1),m(e,()=>{--T>0||(_=void 0,s.set({mounted:!1}),$(),U(!1,l))})));if(_=()=>E.forEach(e=>e()),x?.(),x=void 0,S?.(),S=void 0,!o||!b)return;if(o===!0)return J(d,g);if(o===`unless-moved`){queueMicrotask(()=>{let n=e();(!n||n===d.ownerDocument.body||t(d,n))&&!w(re)&&J(d,g)});return}let D=()=>{O(),clearTimeout(k),setTimeout(()=>{let t=e();(!t||t===d.ownerDocument.body)&&J(d,g)})},O=u(window,`pointerup`,D,{capture:!0}),k=setTimeout(D,1e3)});function le(e,t,n=I){let r=()=>n(t);return F?[()=>P,r,R,()=>de(e),i.trigger]:[R,()=>P,r,()=>de(e),i.trigger]}let K=!1;function q(e=X){if(!K){K=!0;try{return me(le(f?.el,e),e)}finally{K=!1}}}function de(e){let t=L[0]?.node;if(t?.isConnected&&!e?.contains(t)){for(let n of[...L.slice(1).map(e=>e.node),t.ownerDocument.body]){let r=k(n).filter(t=>!e?.contains(t)),i=r.find(e=>d(t,e)&&!t.contains(e))??r.filter(e=>d(e,t)).pop();if(i)return i}return}let n=L.findIndex((e,t)=>!e.node.isConnected&&L[t+1]?.node.isConnected);if(n===-1)return;let{next:r,previous:i}=L[n],a=L[n+1].node,o=e=>!!e?.isConnected&&e.parentNode===a,s=(e,t)=>e.contains(t)||d(e,t),c=o(r)?e=>s(r,e):o(i)?e=>d(i,e)&&!i.contains(e):e=>s(a,e);for(let{node:t}of L.slice(n+1)){let n=k(t).filter(t=>!e?.contains(t)),r=o(i)?n.filter(e=>!s(i,e)||i.contains(e)).pop():void 0,a=n.find(c)??r??n[0];if(a)return a}}function J(t,n){let r=i.finalFocus?.()??`trigger`;if(r===`none`)return;let a=n=>!X(n)||t.contains(n)?!1:(b(n),e()===n),o=le(t,a,n);r!==`trigger`&&o.unshift(()=>ve(r,t.ownerDocument)),me(o,a)}function Y(e){if(!A||!f||!s.get().open||!a.movesFocus)return;A=!1;let t=C===`initial`&&a.focusOnMount?`auto`:fe(C);if(t===`none`)return;let n=()=>{if(!f||!s.get().open)return;let n=t===`popup`?f.el:e?.();n&&v(n)};M?requestAnimationFrame(n):n()}function ge(r,c){let d=[],m=i.trigger(),h=c.host?.()??r;if(C===`initial`&&!P){let n=e();n&&n!==n.ownerDocument.body&&!t(r,n)&&(P=n)}r.removeAttribute(`hidden`),h.removeAttribute(`hidden`);let _=f?.backdrop;if(_){let e=Z(_);d.push(()=>{e(),Q(_)})}if(!c.inline){h.setAttribute(`popover`,`manual`);try{h.showPopover()}catch{}}if(c.position&&i.position){let e=i.position(()=>c.anchor?.()??i.trigger(),r,c.position);z=e.place,B=e.follow,d.push(e,()=>z=B=void 0),c.rendered&&d.push(c.rendered(e.follow))}!n()&&!h.style.zIndex&&(h.style.zIndex=`2147483000`),d.push(g(r,j?()=>{j=!1,U(!0)}:void 0)),y();let v=i.modal(),b=a.blur,ee=i.persistent?.()??[],te=(e,t)=>e===r&&!!t&&`clientX`in t&&be({x:t.clientX,y:t.clientY},r.getBoundingClientRect()),ne=R();(ne||!m)&&(L=[]);for(let e=ne??null;e&&e!==r.ownerDocument.body;e=e.parentElement)L.push({node:e,next:e.nextElementSibling,previous:e.previousElementSibling});let w={parent:i.parent?.()??(m&&ae(m)),active:()=>s.get().open,exiting:()=>!s.get().open&&s.get().mounted,modal:v.consumeOutsidePress,blocking:typeof a.blocking==`function`?a.blocking(v):a.blocking,outsidePress:a.outsidePress,shield:a.shield,component:i.owner?.component,id:i.owner?.id,el:r,contains:(e,t)=>r.contains(e)&&!te(e,t)||ee.some(t=>t.contains(e))||(i.contains?i.contains(e,t):!!i.trigger()?.contains(e)),overBackdrop:(e,t)=>!!f?.backdrop&&!be({x:e,y:t},f.backdrop.getBoundingClientRect())&&be({x:e,y:t},r.getBoundingClientRect()),returnTarget:q,onOutsidePress:e=>{let t=e.composedPath()[0];i.close(`outside-press`,{event:e,focus:pe({type:e.type,focusable:!!t?.closest?.(`a[href],button,input,select,textarea,summary,[tabindex],[contenteditable]`),consumed:v.consumeOutsidePress})})},onEscape:e=>{e.preventDefault(),i.onEscape?i.onEscape(e):i.close(`escape-key`,{event:e,focus:!0})},onBlur:b===`never`?void 0:b===`always`?e=>i.close(`window-blur`,{event:e,focus:!1}):e=>setTimeout(()=>{let t=xe(r)??r.ownerDocument.activeElement;t?.tagName===`IFRAME`&&!r.contains(t)&&i.close(`focus-out`,{event:e,focus:!1})})};p=w,we.set(w,[r,..._?[_]:[]]),d.push(re(w));for(let e of[i.onShow,c.onShow]){let t=e?.(w);t&&d.push(t)}let T,E,D,O=()=>{let e=[r,...f?.backdrop?[f.backdrop]:[],...ee];m&&a.keepTrigger&&e.push(m);for(let t of ie())for(let n=t.parent;n;n=n.parent)n===w&&e.push(...we.get(t)??[]);T=se(r.ownerDocument,r);let t=ce(e);w.keep=t.keep,x=E=t},k=()=>{D?.(),E?.(),T?.(),x===E&&(x=void 0),E=T=w.keep=void 0};v.inertAndLock&&(D=l(()=>{if(D=void 0,!s.get().open)return;let t=e();O(),o()===`trap`&&t&&!X(t)&&(A=!0,Y(c.initialFocus))})),V=()=>{let e=i.modal();w.modal=e.consumeOutsidePress,w.blocking=typeof a.blocking==`function`?a.blocking(e):a.blocking,e.inertAndLock&&!v.inertAndLock&&s.get().open?O():!e.inertAndLock&&v.inertAndLock&&k(),v=e},d.push(k,()=>V=void 0);for(let e=w.parent;e;e=e.parent)if(e.keep)for(let t of[r,..._?[_]:[]])d.push(e.keep(t));if(o()===`flow`&&a.dismissOnFocusLoss){let e;d.push(u(r.ownerDocument,`mousedown`,t=>{e=t,setTimeout(()=>{e===t&&(e=void 0)})},{capture:!0}),u(r.ownerDocument,`focusin`,t=>{let n=xe(r)??t.target;s.get().open&&!oe(w,n)&&(e&&w.contains(n,e)||i.close(`focus-out`,{event:t,focus:!1}))}))}if(a.closeWatcher){let e=Ce(e=>i.close(`back`,{event:e,focus:!0}));e&&(S=e,d.push(()=>{e(),S===e&&(S=void 0)}))}let M=e=>{let t=e.target,n=e.submitter;(n?.getAttribute(`formmethod`)??t.getAttribute(`method`))?.toLowerCase()===`dialog`&&ae(t)===w&&(e.preventDefault(),i.close(`close-press`,{event:e,focus:!0,returnValue:n?.value||void 0}))};return r.addEventListener(`submit`,M),d.push(()=>r.removeEventListener(`submit`,M)),s.get().open&&!A&&o()===`trap`&&ye()&&(A=!0),queueMicrotask(()=>Y(c.initialFocus)),()=>{if(d.forEach(e=>e()),p===w&&(p=void 0),!s.get().mounted&&!c.inline)try{h.hidePopover()}catch{}}}function _e(){if(!c||f)return;let{el:e,config:t}=c;f={el:e,cleanup:()=>{},backdrop:t.backdrop?.()},f.cleanup=ge(e,t)}function Z(e){e.removeAttribute(`hidden`),e.setAttribute(`popover`,`manual`);try{e.showPopover()}catch{}return!n()&&!e.style.zIndex&&(e.style.zIndex=`2147483000`),g(e)}function Q(e){if(!s.get().mounted)try{e.hidePopover()}catch{}}function $(){if(!f)return;let{cleanup:e}=f;f=void 0,e()}function Se(t){let n=f?.el;if(t.key!==`Tab`||!n)return;let r=o();if(r===`native`)return;if(r===`close`)return i.close(`focus-out`,{event:t,focus:!1});let a=k(n),s=a[0],c=a.at(-1),l=e(),u=!s||l===s||l===n,d=!c||l===c,p=r===`trap`?E(a,n):[];if(p.length){let e=[...p,...a.filter(e=>!p.includes(e))],r=e.indexOf(l),i=l===n?e.at(t.shiftKey?-1:0):e.at((r+(t.shiftKey?-1:1))%e.length),o=p.includes(l)||!!i&&p.includes(i),s=l?.shadowRoot,c=!t.shiftKey&&!!s&&k(s).length>0;if(l!==n&&(r<0||!o||c))return;t.preventDefault(),i?.focus({preventScroll:!0});return}if(r===`trap`){if(t.shiftKey?u:d){t.preventDefault(),((t.shiftKey?c:s)??n).focus({preventScroll:!0});return}let e=a.indexOf(l),r=e<0?void 0:a[e+(t.shiftKey?-1:1)],i=r&&!r.checked?O(r):[];i.some(e=>e.checked)&&!i.includes(l)&&(t.preventDefault(),r?.focus({preventScroll:!0}));return}let m=i.trigger();if(m){if(t.shiftKey&&u)t.preventDefault(),m.focus({preventScroll:!0});else if(!t.shiftKey&&d){let e=D(m,n);if(!e)return;t.preventDefault(),e.focus()}}}return{bind(e,t={}){let n=!1,r=T(e),i=()=>{c={el:e,config:t},s.get().mounted&&(f&&f.el!==e&&$(),_e())};return e.isConnected?i():queueMicrotask(()=>{!n&&e.isConnected&&i()}),()=>{n=!0,r(),c?.el===e&&(c=void 0,f?.el===e&&$())}},keydown:Se,triggerKeydown(e){let t=f?.el;e.key===`Tab`&&!e.shiftKey&&t&&s.get().open&&o()===`flow`&&(e.preventDefault(),(k(t)[0]??t).focus({preventScroll:!0}))},opening(e,t){C=e,M=t?.type===`pointerdown`},opener:()=>C,observe(e){H=e},requestClose:(e,t)=>i.close(e,{event:t,focus:!0}),returnFocus(e){N=e},initialFocus:Y,place:()=>z?.(),checkPlacement:()=>B?.(),updateModal:()=>V?.(),layer:()=>p,element:()=>f?.el,mountedAs:W,backdrop(t){if(!f||f.backdrop===t)return()=>{};let{el:n}=f,r=c?.config.host?.()??n;f.backdrop=t;let i=Z(t),a=e();try{r.hidePopover(),r.showPopover()}catch{}a&&a!==e()&&a.focus({preventScroll:!0});let o=p?.keep?.(t);return()=>{o?.(),i(),f?.backdrop===t&&(f.backdrop=void 0),Q(t)}}}}export{K as a,Y as c,P as d,ge as i,Se as l,Te as n,de as o,he as r,_e as s,J as t,Q as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e,t,n){let r=e.indexOf(t),i=e.indexOf(n);return r===-1||i===-1?[]:e.slice(Math.min(r,i),Math.max(r,i)+1)}function t(t,n,r,{additive:i,selectable:a}){let o=e(t,n.key,r).filter(a),s=i?n.base:[],c=new Set(s);return[...s,...o.filter(e=>!c.has(e))]}function n(e,t){return e.includes(t)?e.filter(e=>e!==t):[...e,t]}function r(e,t){let n=new Set(e);if(t.length&&t.every(e=>n.has(e))){let n=new Set(t);return e.filter(e=>!n.has(e))}return[...e,...t.filter(e=>!n.has(e))]}function i(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function a(e){let{keys:a,set:o,order:s,selectable:c}=e,l=null;return{toggle(e,t){if(!c(e))return;let r=n(a(),e);o(r,t)&&(l={key:e,base:r})},replace(e,t){c(e)&&(i(a(),[e])||o([e],t))&&(l={key:e,base:[e]})},extend(e,{from:n,additive:r},u){let d=s();(!l||!d.includes(l.key))&&(l={key:n??e,base:a()});let f=t(d,l,e,{additive:r,selectable:c});i(f,a())||o(f,u)},toggleAll(e){let t=r(a(),s().filter(c));i(t,a())||o(t,e)},anchor:()=>l?.key??null,resetAnchor(){l=null}}}function o(e,t){let{store:n}=e,r=()=>n.get()[t.key]??[],o=()=>t.multiple?.()??!1,s=e=>t.selectable?.(e)??!0,c=null,l=a({keys:r,order:t.order,selectable:s,set(e,n){c=e;let r=t.set(e,n);return r||(c=null),r}}),u=r();return e.onDestroy(n.subscribe(()=>{let e=r();if(e===u)return;u=e;let t=c!==null&&i(c,e);c=null,(!t||!e.length)&&l.resetAnchor()})),{isSelected:e=>r().includes(e),choose:(e,t)=>l.replace(e,t),toggle(e,t){if(o())return l.toggle(e,t);s(e)&&(i(r(),[e])?l.toggle(e,t):l.replace(e,t))},extend(e,t){if(!o())return l.replace(e,t);l.extend(e,{from:t.from??null,additive:t.additive??!0},t)},toggleAll(e){o()&&l.toggleAll(e)},anchor:l.anchor}}export{o as n,i as r,a as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=Object.defineProperty,t=/* @__PURE__ */ ((t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r})({announce:()=>o,prepareAnnouncements:()=>a});const n=/* @__PURE__ */ new WeakMap,r={};function i(e,t){let r=n.get(e);r||n.set(e,r={});let i=r[t];if(i?.isConnected)return i;let a=e.createElement(`div`);return a.setAttribute(`role`,t===`assertive`?`alert`:`status`),a.setAttribute(`aria-live`,t),a.setAttribute(`aria-atomic`,`true`),a.setAttribute(`data-ui-sdk-announcer`,t===`assertive`?`assertive`:``),a.style.cssText=`position:fixed;width:1px;height:1px;margin:-1px;padding:0;border:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap`,e.body.append(a),r[t]=a,a}function a(e){e.body&&(i(e,`polite`),i(e,`assertive`))}function o(e,{priority:t=`polite`,doc:n=typeof document>`u`?void 0:document}={}){if(!e||!n?.body)return;let a=i(n,t);a.textContent=``,clearTimeout(r[t]),r[t]=setTimeout(()=>{a.textContent=e},100)}export{t as n,a as r,o as t};
|