@expressivecss/expressive 0.16.0 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +306 -1
- package/README.md +1 -1
- package/dist/css/expressive.css +540 -646
- package/dist/css/expressive.css.map +1 -1
- package/dist/css/expressive.min.css +1 -1
- package/dist/css/expressive.min.css.map +1 -1
- package/dist/js/chunks/{chunk-PA7NU5AK.mjs → chunk-26VUH75M.mjs} +6 -3
- package/dist/js/chunks/chunk-26VUH75M.mjs.map +7 -0
- package/dist/js/chunks/{chunk-NBJAUGPP.mjs → chunk-2LFCOGC3.mjs} +12 -23
- package/dist/js/chunks/chunk-2LFCOGC3.mjs.map +7 -0
- package/dist/js/chunks/{chunk-OP43LLIC.mjs → chunk-36GELQGX.mjs} +4 -4
- package/dist/js/chunks/{chunk-OP43LLIC.mjs.map → chunk-36GELQGX.mjs.map} +2 -2
- package/dist/js/chunks/{chunk-EC26RU2D.mjs → chunk-3FKWIRHW.mjs} +6 -2
- package/dist/js/chunks/chunk-3FKWIRHW.mjs.map +7 -0
- package/dist/js/chunks/{chunk-Y6H2X7ZC.mjs → chunk-3KF65KGL.mjs} +3 -3
- package/dist/js/chunks/{chunk-4QUCNFSD.mjs → chunk-3KLZRQZI.mjs} +31 -10
- package/dist/js/chunks/chunk-3KLZRQZI.mjs.map +7 -0
- package/dist/js/chunks/{chunk-75E5EDJF.mjs → chunk-3XORNED5.mjs} +2 -2
- package/dist/js/chunks/{chunk-NNHVANQA.mjs → chunk-4WBGAQN3.mjs} +3 -3
- package/dist/js/chunks/{chunk-ZJNLAGY5.mjs → chunk-5F4URJHL.mjs} +2 -2
- package/dist/js/chunks/{chunk-ZVLOUDIJ.mjs → chunk-67UNY7RH.mjs} +50 -2
- package/dist/js/chunks/chunk-67UNY7RH.mjs.map +7 -0
- package/dist/js/chunks/{chunk-P6DRQ6KS.mjs → chunk-7CXNATJS.mjs} +6 -5
- package/dist/js/chunks/chunk-7CXNATJS.mjs.map +7 -0
- package/dist/js/chunks/{chunk-4TRZ2AER.mjs → chunk-7X44MKEQ.mjs} +15 -14
- package/dist/js/chunks/chunk-7X44MKEQ.mjs.map +7 -0
- package/dist/js/chunks/{chunk-GWZ76SR4.mjs → chunk-7ZAMOMGY.mjs} +12 -7
- package/dist/js/chunks/chunk-7ZAMOMGY.mjs.map +7 -0
- package/dist/js/chunks/{chunk-GVZQH2H5.mjs → chunk-AEG6LOAJ.mjs} +2 -2
- package/dist/js/chunks/{chunk-Y6TLRA3U.mjs → chunk-AQNFCJJ5.mjs} +27 -21
- package/dist/js/chunks/chunk-AQNFCJJ5.mjs.map +7 -0
- package/dist/js/chunks/{chunk-OUCHKSAW.mjs → chunk-B55LWKBM.mjs} +16 -4
- package/dist/js/chunks/chunk-B55LWKBM.mjs.map +7 -0
- package/dist/js/chunks/{chunk-AI73GJKG.mjs → chunk-BB5VXYXT.mjs} +2 -2
- package/dist/js/chunks/{chunk-2RLBDFH4.mjs → chunk-BDATLH3H.mjs} +4 -4
- package/dist/js/chunks/{chunk-2CS6TITK.mjs → chunk-CWMQOT4O.mjs} +23 -10
- package/dist/js/chunks/chunk-CWMQOT4O.mjs.map +7 -0
- package/dist/js/chunks/{chunk-ZKWUWBUB.mjs → chunk-CY2CTOVM.mjs} +2 -2
- package/dist/js/chunks/{chunk-CSYWKEK3.mjs → chunk-DWA5UYLJ.mjs} +58 -27
- package/dist/js/chunks/chunk-DWA5UYLJ.mjs.map +7 -0
- package/dist/js/chunks/{chunk-CMGXGYUC.mjs → chunk-EB2V4OKL.mjs} +14 -9
- package/dist/js/chunks/chunk-EB2V4OKL.mjs.map +7 -0
- package/dist/js/chunks/{chunk-Z4GICXR2.mjs → chunk-EWO662ZC.mjs} +5 -7
- package/dist/js/chunks/chunk-EWO662ZC.mjs.map +7 -0
- package/dist/js/chunks/{chunk-VGY4M57S.mjs → chunk-F7LAKFMX.mjs} +67 -34
- package/dist/js/chunks/chunk-F7LAKFMX.mjs.map +7 -0
- package/dist/js/chunks/{chunk-67ZPPKXS.mjs → chunk-FNIIH2LU.mjs} +3 -3
- package/dist/js/chunks/chunk-GE3YMFS6.mjs +15 -0
- package/dist/js/chunks/chunk-GE3YMFS6.mjs.map +7 -0
- package/dist/js/chunks/{chunk-DZYVU75J.mjs → chunk-GFWYMWYN.mjs} +18 -14
- package/dist/js/chunks/chunk-GFWYMWYN.mjs.map +7 -0
- package/dist/js/chunks/{chunk-3L3QIYLC.mjs → chunk-H5ISU45X.mjs} +8 -6
- package/dist/js/chunks/chunk-H5ISU45X.mjs.map +7 -0
- package/dist/js/chunks/{chunk-QXKWVHBD.mjs → chunk-H6YIKFAQ.mjs} +67 -46
- package/dist/js/chunks/chunk-H6YIKFAQ.mjs.map +7 -0
- package/dist/js/chunks/{chunk-KZPSAXIU.mjs → chunk-HEH7E3KO.mjs} +22 -12
- package/dist/js/chunks/chunk-HEH7E3KO.mjs.map +7 -0
- package/dist/js/chunks/{chunk-T3BNSRP3.mjs → chunk-HQRLBTNM.mjs} +3 -3
- package/dist/js/chunks/{chunk-NAC72P7R.mjs → chunk-I2F7MLUU.mjs} +2 -2
- package/dist/js/chunks/{chunk-ZM3XBHWV.mjs → chunk-IQOTGGHX.mjs} +86 -35
- package/dist/js/chunks/chunk-IQOTGGHX.mjs.map +7 -0
- package/dist/js/chunks/{chunk-QACZ6TUP.mjs → chunk-JH3YWKA6.mjs} +5 -4
- package/dist/js/chunks/chunk-JH3YWKA6.mjs.map +7 -0
- package/dist/js/chunks/chunk-JOLJAYIJ.mjs +7 -0
- package/dist/js/chunks/{chunk-4IKVPCSU.mjs.map → chunk-JOLJAYIJ.mjs.map} +1 -1
- package/dist/js/chunks/{chunk-BPF3I2MN.mjs → chunk-KOTGMCMI.mjs} +9 -2
- package/dist/js/chunks/chunk-KOTGMCMI.mjs.map +7 -0
- package/dist/js/chunks/{chunk-ANKFWNWT.mjs → chunk-LC4O5LFS.mjs} +3 -3
- package/dist/js/chunks/{chunk-4PIXLDNJ.mjs → chunk-LEF33SCP.mjs} +2 -2
- package/dist/js/chunks/{chunk-ILDRRG7T.mjs → chunk-LFORZRPH.mjs} +3 -3
- package/dist/js/chunks/{chunk-Z4OARDZ7.mjs → chunk-LWLNV5EC.mjs} +26 -17
- package/dist/js/chunks/chunk-LWLNV5EC.mjs.map +7 -0
- package/dist/js/chunks/{chunk-WU7XJ4RR.mjs → chunk-LXRHUQAX.mjs} +66 -25
- package/dist/js/chunks/chunk-LXRHUQAX.mjs.map +7 -0
- package/dist/js/chunks/{chunk-VMY55K2X.mjs → chunk-MA2SZZFB.mjs} +11 -7
- package/dist/js/chunks/chunk-MA2SZZFB.mjs.map +7 -0
- package/dist/js/chunks/{chunk-VJVQIXHC.mjs → chunk-MDBZAMIV.mjs} +8 -10
- package/dist/js/chunks/chunk-MDBZAMIV.mjs.map +7 -0
- package/dist/js/chunks/{chunk-4EWGD4V2.mjs → chunk-NODZ5VAD.mjs} +2 -2
- package/dist/js/chunks/{chunk-UGJHCHXG.mjs → chunk-O2WJB6TH.mjs} +79 -55
- package/dist/js/chunks/chunk-O2WJB6TH.mjs.map +7 -0
- package/dist/js/chunks/{chunk-7YZ5CN3V.mjs → chunk-PCABY5BN.mjs} +5 -3
- package/dist/js/chunks/chunk-PCABY5BN.mjs.map +7 -0
- package/dist/js/chunks/{chunk-X7SDA2J5.mjs → chunk-PWKYVMND.mjs} +9 -5
- package/dist/js/chunks/{chunk-X7SDA2J5.mjs.map → chunk-PWKYVMND.mjs.map} +2 -2
- package/dist/js/chunks/{chunk-SPPHF7YZ.mjs → chunk-QHZZT7YO.mjs} +35 -14
- package/dist/js/chunks/chunk-QHZZT7YO.mjs.map +7 -0
- package/dist/js/chunks/{chunk-LDXCC2L3.mjs → chunk-QND56EW2.mjs} +5 -4
- package/dist/js/chunks/chunk-QND56EW2.mjs.map +7 -0
- package/dist/js/chunks/{chunk-NVQ5EHCU.mjs → chunk-QNODAANY.mjs} +4 -4
- package/dist/js/chunks/{chunk-7NLUI3RR.mjs → chunk-QRO5FV3I.mjs} +23 -13
- package/dist/js/chunks/chunk-QRO5FV3I.mjs.map +7 -0
- package/dist/js/chunks/{chunk-FCNF4GRJ.mjs → chunk-R7A7JRC5.mjs} +6 -11
- package/dist/js/chunks/chunk-R7A7JRC5.mjs.map +7 -0
- package/dist/js/chunks/{chunk-S23RJ3XY.mjs → chunk-RKG2CBFE.mjs} +4 -16
- package/dist/js/chunks/chunk-RKG2CBFE.mjs.map +7 -0
- package/dist/js/chunks/{chunk-6FSEUFVW.mjs → chunk-RSNS5OYS.mjs} +6 -6
- package/dist/js/chunks/chunk-RSNS5OYS.mjs.map +7 -0
- package/dist/js/chunks/{chunk-ROH2HDB4.mjs → chunk-RUDYMEJ3.mjs} +2 -2
- package/dist/js/chunks/{chunk-BIGU5RCJ.mjs → chunk-STJR62SU.mjs} +13 -5
- package/dist/js/chunks/chunk-STJR62SU.mjs.map +7 -0
- package/dist/js/chunks/{chunk-752ADW4M.mjs → chunk-SUSD4UTN.mjs} +27 -32
- package/dist/js/chunks/chunk-SUSD4UTN.mjs.map +7 -0
- package/dist/js/chunks/{chunk-B7DQFHA5.mjs → chunk-SYBOA5HC.mjs} +7 -12
- package/dist/js/chunks/chunk-SYBOA5HC.mjs.map +7 -0
- package/dist/js/chunks/{chunk-TFABTUAZ.mjs → chunk-T4MOBP3J.mjs} +2 -2
- package/dist/js/chunks/{chunk-GCWWEZKO.mjs → chunk-TM7HPGTV.mjs} +3 -3
- package/dist/js/chunks/{chunk-5KIHWJI2.mjs → chunk-TMQDZSDC.mjs} +34 -12
- package/dist/js/chunks/chunk-TMQDZSDC.mjs.map +7 -0
- package/dist/js/chunks/{chunk-ZO6ZLHFF.mjs → chunk-TVSX5YA2.mjs} +3 -3
- package/dist/js/chunks/{chunk-INLZWHLY.mjs → chunk-UHO5CV6K.mjs} +2 -2
- package/dist/js/chunks/{chunk-INLZWHLY.mjs.map → chunk-UHO5CV6K.mjs.map} +2 -2
- package/dist/js/chunks/{chunk-7YQBHTK3.mjs → chunk-UKCNELUN.mjs} +6 -8
- package/dist/js/chunks/chunk-UKCNELUN.mjs.map +7 -0
- package/dist/js/chunks/{chunk-VH4BMAZS.mjs → chunk-UKQK5GWR.mjs} +13 -13
- package/dist/js/chunks/chunk-UKQK5GWR.mjs.map +7 -0
- package/dist/js/chunks/{chunk-OYNUDOHR.mjs → chunk-UTSLYQ65.mjs} +7 -6
- package/dist/js/chunks/{chunk-OYNUDOHR.mjs.map → chunk-UTSLYQ65.mjs.map} +2 -2
- package/dist/js/chunks/{chunk-7W7TV6NY.mjs → chunk-VS5OJBOD.mjs} +2 -2
- package/dist/js/chunks/{chunk-7W7TV6NY.mjs.map → chunk-VS5OJBOD.mjs.map} +2 -2
- package/dist/js/chunks/{chunk-KYIEG4U3.mjs → chunk-VZMROW5A.mjs} +43 -14
- package/dist/js/chunks/chunk-VZMROW5A.mjs.map +7 -0
- package/dist/js/chunks/{chunk-VFV75DHF.mjs → chunk-XB6Y7P5W.mjs} +11 -12
- package/dist/js/chunks/chunk-XB6Y7P5W.mjs.map +7 -0
- package/dist/js/chunks/{chunk-CZSQHXEV.mjs → chunk-XDAMOMVD.mjs} +20 -21
- package/dist/js/chunks/chunk-XDAMOMVD.mjs.map +7 -0
- package/dist/js/chunks/{chunk-EVCVFEV3.mjs → chunk-XJPMW5SP.mjs} +21 -35
- package/dist/js/chunks/chunk-XJPMW5SP.mjs.map +7 -0
- package/dist/js/chunks/{chunk-VR3L2WN5.mjs → chunk-YKANQILZ.mjs} +7 -6
- package/dist/js/chunks/chunk-YKANQILZ.mjs.map +7 -0
- package/dist/js/chunks/{chunk-JUKBBN6P.mjs → chunk-YLZOJLDI.mjs} +2 -2
- package/dist/js/chunks/{chunk-U4B3VHFS.mjs → chunk-ZK7YY322.mjs} +28 -21
- package/dist/js/chunks/chunk-ZK7YY322.mjs.map +7 -0
- package/dist/js/expressive.cjs +2739 -2387
- package/dist/js/expressive.cjs.map +4 -4
- package/dist/js/expressive.js +2739 -2387
- package/dist/js/expressive.js.map +4 -4
- package/dist/js/expressive.min.js +7 -7
- package/dist/js/expressive.min.js.map +4 -4
- package/dist/js/expressive.mjs +76 -75
- package/dist/js/expressive.mjs.map +1 -1
- package/dist/js/internal/behaviors/bottomSheets.mjs +3 -3
- package/dist/js/internal/behaviors/copy.mjs +3 -3
- package/dist/js/internal/behaviors/dataTables.mjs +2 -4
- package/dist/js/internal/behaviors/dialogs.mjs +2 -2
- package/dist/js/internal/behaviors/forms.mjs +2 -2
- package/dist/js/internal/behaviors/imageCompare.mjs +2 -2
- package/dist/js/internal/behaviors/lists.mjs +2 -2
- package/dist/js/internal/behaviors/paneResize.mjs +2 -2
- package/dist/js/internal/behaviors/sheetDrag.mjs +2 -2
- package/dist/js/internal/behaviors/sideSheets.mjs +3 -3
- package/dist/js/internal/behaviors/sortable.mjs +2 -2
- package/dist/js/internal/behaviors/theme.mjs +2 -2
- package/dist/js/internal/behaviors/tour.mjs +2 -2
- package/dist/js/internal/behaviors/transferList.mjs +2 -2
- package/dist/js/internal/components/appBar.mjs +3 -3
- package/dist/js/internal/components/autocomplete.mjs +5 -4
- package/dist/js/internal/components/backToTop.mjs +3 -3
- package/dist/js/internal/components/barChart.mjs +5 -5
- package/dist/js/internal/components/buttonGroup.mjs +3 -3
- package/dist/js/internal/components/buttons.mjs +3 -3
- package/dist/js/internal/components/cards.mjs +3 -3
- package/dist/js/internal/components/carousel.mjs +3 -3
- package/dist/js/internal/components/cascader.mjs +4 -4
- package/dist/js/internal/components/characterCounter.mjs +3 -3
- package/dist/js/internal/components/chips.mjs +7 -6
- package/dist/js/internal/components/colorPicker.mjs +3 -3
- package/dist/js/internal/components/columnChart.mjs +4 -4
- package/dist/js/internal/components/commandPalette.mjs +3 -3
- package/dist/js/internal/components/confetti.mjs +3 -3
- package/dist/js/internal/components/currencyInput.mjs +3 -3
- package/dist/js/internal/components/datepicker.mjs +8 -7
- package/dist/js/internal/components/expandingCard.mjs +3 -3
- package/dist/js/internal/components/funnelChart.mjs +4 -4
- package/dist/js/internal/components/heatmapChart.mjs +4 -4
- package/dist/js/internal/components/hoverCard.mjs +3 -3
- package/dist/js/internal/components/index.mjs +60 -59
- package/dist/js/internal/components/inputMask.mjs +3 -3
- package/dist/js/internal/components/keypad.mjs +3 -3
- package/dist/js/internal/components/lightbox.mjs +3 -3
- package/dist/js/internal/components/lineChart.mjs +23 -7
- package/dist/js/internal/components/loadingOverlay.mjs +3 -3
- package/dist/js/internal/components/mapView.mjs +3 -3
- package/dist/js/internal/components/menu.mjs +3 -3
- package/dist/js/internal/components/menubar.mjs +4 -4
- package/dist/js/internal/components/messageScroller.mjs +3 -3
- package/dist/js/internal/components/mixedChart.mjs +5 -5
- package/dist/js/internal/components/navigationRail.mjs +3 -3
- package/dist/js/internal/components/particles.mjs +3 -3
- package/dist/js/internal/components/pieChart.mjs +4 -4
- package/dist/js/internal/components/pullToRefresh.mjs +3 -3
- package/dist/js/internal/components/questionnaire.mjs +3 -3
- package/dist/js/internal/components/radarChart.mjs +4 -4
- package/dist/js/internal/components/radialChart.mjs +4 -4
- package/dist/js/internal/components/registry.mjs +59 -58
- package/dist/js/internal/components/richTextEditor.mjs +3 -3
- package/dist/js/internal/components/sankeyChart.mjs +4 -4
- package/dist/js/internal/components/scatterChart.mjs +4 -4
- package/dist/js/internal/components/scrollspy.mjs +3 -3
- package/dist/js/internal/components/select.mjs +5 -4
- package/dist/js/internal/components/showMore.mjs +3 -3
- package/dist/js/internal/components/slider.mjs +3 -3
- package/dist/js/internal/components/snackbar.mjs +2 -2
- package/dist/js/internal/components/swipeActions.mjs +3 -3
- package/dist/js/internal/components/tabs.mjs +3 -3
- package/dist/js/internal/components/timepicker.mjs +5 -5
- package/dist/js/internal/components/tooltip.mjs +3 -3
- package/dist/js/internal/components/treeSelect.mjs +6 -5
- package/dist/js/internal/components/treemapChart.mjs +4 -4
- package/dist/js/internal/core/component.mjs +6 -4
- package/dist/js/internal/core/formControl.mjs +2 -2
- package/dist/js/internal/core/imageURL.mjs +7 -0
- package/dist/js/internal/core/imageURL.mjs.map +7 -0
- package/dist/js/internal/core/utils.mjs +11 -1
- package/dist/js/internal/plugins/dockedDisplayPlugin.mjs +2 -2
- package/dist/js/internal/plugins/modalDisplayPlugin.mjs +3 -3
- package/dist/js/modular.mjs +76 -75
- package/dist/types/behaviors/bottomSheets.d.ts +5 -3
- package/dist/types/behaviors/dataTables.d.ts +2 -6
- package/dist/types/behaviors/forms.d.ts +7 -7
- package/dist/types/behaviors/imageCompare.d.ts +2 -1
- package/dist/types/behaviors/transferList.d.ts +2 -0
- package/dist/types/components/autocomplete.d.ts +14 -3
- package/dist/types/components/carousel.d.ts +7 -0
- package/dist/types/components/chips.d.ts +15 -0
- package/dist/types/components/colorPicker.d.ts +14 -0
- package/dist/types/components/currencyInput.d.ts +5 -4
- package/dist/types/components/datepicker.d.ts +54 -27
- package/dist/types/components/funnelChart.d.ts +1 -4
- package/dist/types/components/heatmapChart.d.ts +3 -0
- package/dist/types/components/hoverCard.d.ts +1 -0
- package/dist/types/components/inputMask.d.ts +0 -2
- package/dist/types/components/lineChart.d.ts +43 -5
- package/dist/types/components/mapView.d.ts +113 -11
- package/dist/types/components/menu.d.ts +14 -0
- package/dist/types/components/particles.d.ts +14 -1
- package/dist/types/components/pieChart.d.ts +1 -2
- package/dist/types/components/richTextEditor.d.ts +40 -9
- package/dist/types/components/select.d.ts +1 -3
- package/dist/types/components/showMore.d.ts +2 -0
- package/dist/types/components/slider.d.ts +0 -1
- package/dist/types/components/snackbar.d.ts +7 -1
- package/dist/types/components/tabs.d.ts +3 -3
- package/dist/types/components/timepicker.d.ts +15 -6
- package/dist/types/components/tooltip.d.ts +1 -1
- package/dist/types/components/treemapChart.d.ts +2 -2
- package/dist/types/core/component.d.ts +9 -3
- package/dist/types/core/imageURL.d.ts +2 -0
- package/dist/types/core/utils.d.ts +39 -1
- package/dist/types/modular.d.ts +1 -1
- package/dist/types/plugins/modalDisplayPlugin.d.ts +8 -1
- package/package.json +8 -6
- package/src/sass/abstracts/_mixins.scss +459 -59
- package/src/sass/abstracts/_variables.scss +25 -0
- package/src/sass/components/_accordion.scss +1 -3
- package/src/sass/components/_aura.scss +1 -0
- package/src/sass/components/_back-to-top.scss +3 -3
- package/src/sass/components/_bar-chart.scss +2 -83
- package/src/sass/components/_bottom-sheet.scss +7 -0
- package/src/sass/components/_breadcrumb.scss +1 -7
- package/src/sass/components/_button-groups.scss +15 -38
- package/src/sass/components/_buttons.scss +24 -74
- package/src/sass/components/_calendar.scss +1 -3
- package/src/sass/components/_carousel.scss +10 -10
- package/src/sass/components/_cascader.scss +3 -14
- package/src/sass/components/_column-chart.scss +1 -19
- package/src/sass/components/_confetti.scss +3 -4
- package/src/sass/components/_data-table.scss +10 -0
- package/src/sass/components/_dialog.scss +10 -18
- package/src/sass/components/_expanding-card.scss +1 -5
- package/src/sass/components/_fab-menu.scss +4 -12
- package/src/sass/components/_funnel-chart.scss +1 -62
- package/src/sass/components/_heatmap-chart.scss +2 -6
- package/src/sass/components/_icon-buttons.scss +1 -4
- package/src/sass/components/_line-chart.scss +2 -70
- package/src/sass/components/_map.scss +4 -0
- package/src/sass/components/_marquee.scss +3 -3
- package/src/sass/components/_mega-menu.scss +8 -17
- package/src/sass/components/_menu.scss +10 -11
- package/src/sass/components/_menubar.scss +1 -13
- package/src/sass/components/_mixed-chart.scss +1 -37
- package/src/sass/components/_navbar.scss +11 -16
- package/src/sass/components/_navigation-bar.scss +2 -5
- package/src/sass/components/_navigation-rail.scss +25 -15
- package/src/sass/components/_page-footer.scss +1 -3
- package/src/sass/components/_pagination.scss +3 -14
- package/src/sass/components/_panes.scss +3 -16
- package/src/sass/components/_particles.scss +3 -4
- package/src/sass/components/_pie-chart.scss +8 -70
- package/src/sass/components/_progress.scss +31 -13
- package/src/sass/components/_radar-chart.scss +2 -32
- package/src/sass/components/_radial-chart.scss +2 -48
- package/src/sass/components/_sankey-chart.scss +5 -28
- package/src/sass/components/_scatter-chart.scss +2 -11
- package/src/sass/components/_search.scss +1 -4
- package/src/sass/components/_side-sheet.scss +9 -14
- package/src/sass/components/_skeleton.scss +24 -15
- package/src/sass/components/_snackbar.scss +11 -13
- package/src/sass/components/_table_of_contents.scss +1 -3
- package/src/sass/components/_tabs.scss +4 -20
- package/src/sass/components/_timepicker.scss +2 -1
- package/src/sass/components/_toolbar.scss +1 -4
- package/src/sass/components/_tooltip.scss +9 -5
- package/src/sass/components/_tree.scss +5 -17
- package/src/sass/components/_treemap-chart.scss +2 -26
- package/src/sass/components/forms/_checkboxes.scss +2 -21
- package/src/sass/components/forms/_drop-zone.scss +1 -4
- package/src/sass/components/forms/_fieldset.scss +1 -4
- package/src/sass/components/forms/_file-input.scss +6 -0
- package/src/sass/components/forms/_input-fields.scss +21 -4
- package/src/sass/components/forms/_radio-buttons.scss +2 -24
- package/src/sass/components/forms/_select.scss +6 -7
- package/src/sass/components/forms/_slider.scss +1 -4
- package/src/sass/components/forms/_switches.scss +14 -21
- package/src/sass/utilities/_helpers.scss +1 -1
- package/src/sass/utilities/_visibility.scss +1 -3
- package/dist/js/chunks/chunk-2CS6TITK.mjs.map +0 -7
- package/dist/js/chunks/chunk-3L3QIYLC.mjs.map +0 -7
- package/dist/js/chunks/chunk-4IKVPCSU.mjs +0 -7
- package/dist/js/chunks/chunk-4QUCNFSD.mjs.map +0 -7
- package/dist/js/chunks/chunk-4TRZ2AER.mjs.map +0 -7
- package/dist/js/chunks/chunk-5KIHWJI2.mjs.map +0 -7
- package/dist/js/chunks/chunk-6FSEUFVW.mjs.map +0 -7
- package/dist/js/chunks/chunk-752ADW4M.mjs.map +0 -7
- package/dist/js/chunks/chunk-7NLUI3RR.mjs.map +0 -7
- package/dist/js/chunks/chunk-7YQBHTK3.mjs.map +0 -7
- package/dist/js/chunks/chunk-7YZ5CN3V.mjs.map +0 -7
- package/dist/js/chunks/chunk-B7DQFHA5.mjs.map +0 -7
- package/dist/js/chunks/chunk-BIGU5RCJ.mjs.map +0 -7
- package/dist/js/chunks/chunk-BPF3I2MN.mjs.map +0 -7
- package/dist/js/chunks/chunk-CMGXGYUC.mjs.map +0 -7
- package/dist/js/chunks/chunk-CSYWKEK3.mjs.map +0 -7
- package/dist/js/chunks/chunk-CZSQHXEV.mjs.map +0 -7
- package/dist/js/chunks/chunk-DZYVU75J.mjs.map +0 -7
- package/dist/js/chunks/chunk-EC26RU2D.mjs.map +0 -7
- package/dist/js/chunks/chunk-EVCVFEV3.mjs.map +0 -7
- package/dist/js/chunks/chunk-FCNF4GRJ.mjs.map +0 -7
- package/dist/js/chunks/chunk-GWZ76SR4.mjs.map +0 -7
- package/dist/js/chunks/chunk-KYIEG4U3.mjs.map +0 -7
- package/dist/js/chunks/chunk-KZPSAXIU.mjs.map +0 -7
- package/dist/js/chunks/chunk-LDXCC2L3.mjs.map +0 -7
- package/dist/js/chunks/chunk-NBJAUGPP.mjs.map +0 -7
- package/dist/js/chunks/chunk-OUCHKSAW.mjs.map +0 -7
- package/dist/js/chunks/chunk-P6DRQ6KS.mjs.map +0 -7
- package/dist/js/chunks/chunk-PA7NU5AK.mjs.map +0 -7
- package/dist/js/chunks/chunk-QACZ6TUP.mjs.map +0 -7
- package/dist/js/chunks/chunk-QXKWVHBD.mjs.map +0 -7
- package/dist/js/chunks/chunk-S23RJ3XY.mjs.map +0 -7
- package/dist/js/chunks/chunk-SPPHF7YZ.mjs.map +0 -7
- package/dist/js/chunks/chunk-U4B3VHFS.mjs.map +0 -7
- package/dist/js/chunks/chunk-UGJHCHXG.mjs.map +0 -7
- package/dist/js/chunks/chunk-VFV75DHF.mjs.map +0 -7
- package/dist/js/chunks/chunk-VGY4M57S.mjs.map +0 -7
- package/dist/js/chunks/chunk-VH4BMAZS.mjs.map +0 -7
- package/dist/js/chunks/chunk-VJVQIXHC.mjs.map +0 -7
- package/dist/js/chunks/chunk-VMY55K2X.mjs.map +0 -7
- package/dist/js/chunks/chunk-VR3L2WN5.mjs.map +0 -7
- package/dist/js/chunks/chunk-WU7XJ4RR.mjs.map +0 -7
- package/dist/js/chunks/chunk-Y6TLRA3U.mjs.map +0 -7
- package/dist/js/chunks/chunk-Z4GICXR2.mjs.map +0 -7
- package/dist/js/chunks/chunk-Z4OARDZ7.mjs.map +0 -7
- package/dist/js/chunks/chunk-ZM3XBHWV.mjs.map +0 -7
- package/dist/js/chunks/chunk-ZVLOUDIJ.mjs.map +0 -7
- /package/dist/js/chunks/{chunk-Y6H2X7ZC.mjs.map → chunk-3KF65KGL.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-75E5EDJF.mjs.map → chunk-3XORNED5.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-NNHVANQA.mjs.map → chunk-4WBGAQN3.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-ZJNLAGY5.mjs.map → chunk-5F4URJHL.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-GVZQH2H5.mjs.map → chunk-AEG6LOAJ.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-AI73GJKG.mjs.map → chunk-BB5VXYXT.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-2RLBDFH4.mjs.map → chunk-BDATLH3H.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-ZKWUWBUB.mjs.map → chunk-CY2CTOVM.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-67ZPPKXS.mjs.map → chunk-FNIIH2LU.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-T3BNSRP3.mjs.map → chunk-HQRLBTNM.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-NAC72P7R.mjs.map → chunk-I2F7MLUU.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-ANKFWNWT.mjs.map → chunk-LC4O5LFS.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-4PIXLDNJ.mjs.map → chunk-LEF33SCP.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-ILDRRG7T.mjs.map → chunk-LFORZRPH.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-4EWGD4V2.mjs.map → chunk-NODZ5VAD.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-NVQ5EHCU.mjs.map → chunk-QNODAANY.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-ROH2HDB4.mjs.map → chunk-RUDYMEJ3.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-TFABTUAZ.mjs.map → chunk-T4MOBP3J.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-GCWWEZKO.mjs.map → chunk-TM7HPGTV.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-ZO6ZLHFF.mjs.map → chunk-TVSX5YA2.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-JUKBBN6P.mjs.map → chunk-YLZOJLDI.mjs.map} +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var Expressive=(()=>{var yi=Object.defineProperty;var jn=Object.getOwnPropertyDescriptor;var Yn=Object.getOwnPropertyNames;var Xn=Object.prototype.hasOwnProperty;var Gn=(r,s)=>{for(var t in s)yi(r,t,{get:s[t],enumerable:!0})},Zn=(r,s,t,e)=>{if(s&&typeof s=="object"||typeof s=="function")for(let i of Yn(s))!Xn.call(r,i)&&i!==t&&yi(r,i,{get:()=>s[i],enumerable:!(e=jn(s,i))||e.enumerable});return r};var Qn=r=>Zn(yi({},"__esModule",{value:!0}),r);var Jl={};Gn(Jl,{AppBar:()=>ut,AutoInit:()=>Vn,Autocomplete:()=>Q,BackToTop:()=>$t,BarChart:()=>wt,BottomSheets:()=>Ut,ButtonGroup:()=>pt,Cards:()=>G,Carousel:()=>mt,Cascader:()=>vt,CharacterCounter:()=>Se,Chips:()=>it,ColorPicker:()=>yt,ColumnChart:()=>W,CommandPalette:()=>Tt,Confetti:()=>ce,Copy:()=>Gt,CurrencyInput:()=>gt,DataTables:()=>oe,Datepicker:()=>pe,Dialogs:()=>Wt,ExpandingCard:()=>Z,FloatingActionButton:()=>dt,FormSelect:()=>z,Forms:()=>Yt,FunnelChart:()=>It,HeatmapChart:()=>Mt,HoverCard:()=>_t,ImageCompare:()=>Jt,InputMask:()=>ft,Keypad:()=>Et,Lightbox:()=>Bt,LineChart:()=>k,Lists:()=>ie,LoadingOverlay:()=>Ft,MapView:()=>Re,Menu:()=>B,Menubar:()=>Pt,MessageScroller:()=>Rt,MixedChart:()=>At,NavigationRail:()=>zt,PaneResize:()=>Qt,Particles:()=>bt,PieChart:()=>xt,PullToRefresh:()=>me,Questionnaire:()=>Lt,RadarChart:()=>Ct,RadialChart:()=>St,RichTextEditor:()=>Pe,SankeyChart:()=>Ot,ScatterChart:()=>Ht,ScrollSpy:()=>fe,ShowMore:()=>le,SideSheets:()=>jt,Slider:()=>Vt,Snackbar:()=>Xt,Sortable:()=>ee,SwipeActions:()=>Nt,Tabs:()=>_e,Theme:()=>Zt,Timepicker:()=>ge,Tooltip:()=>ve,Tour:()=>te,TransferList:()=>ae,TreeSelect:()=>qt,TreemapChart:()=>Dt,version:()=>Ql});var ss=(r,s,t,e)=>r<e?e:r+s>t-e?t-s:r;function x(r,s,t){t===null?r.removeAttribute(s):r.setAttribute(s,t)}function Ti(r,s,t,e,i=!0){let n=document.createElement("button");n.className=`${t} text`,n.style.visibility=i?"visible":"hidden",n.type="button",n.tabIndex=i?0:-1,n.innerText=s,n.addEventListener("click",e),r.append(n)}function Be(r,{i18n:s,showClearBtn:t,autoSubmit:e},i,n,o,a){if(Ti(r,s.clear,i,n,t),e)return;let l=document.createElement("div");l.classList.add("confirmation-btns"),r.append(l),Ti(l,s.cancel,"btn-cancel",a),Ti(l,s.done,"btn-confirm",o)}function R(r){return new(r.ownerDocument?.defaultView??window).AbortController}function M(r,s={}){let t=document.createElementNS("http://www.w3.org/2000/svg",r);for(let e in s)t.setAttribute(e,s[e]);return t}var u=class r{static isComposing(s){return s.isComposing||s.keyCode===229}static ignoringComposition(s){return t=>{r.isComposing(t)||s(t)}}static onDocumentReady(s){typeof document>"u"||(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",s,{once:!0}):s())}static locale(s){let[t,e]=[s,void 0];for(;t&&e===void 0;)e=t.closest("[lang]")?.lang,t=t.getRootNode().host;try{return e?Intl.getCanonicalLocales(e)[0]:void 0}catch{return}}static guid(){return globalThis.crypto?.randomUUID?.()??`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}static portalRoot(s){let t=s.getRootNode();return t.host?t:document.body}static getElementById(s,t){let e=s.getRootNode();return e.getElementById?e.getElementById(t):document.getElementById(t)}static setAnchorName(s,t,e){let i=s.style.getPropertyValue("anchor-name").split(",").map(n=>n.trim()).filter(n=>n&&n!=="none"&&n!==t);e&&i.push(t),i.length?s.style.setProperty("anchor-name",i.join(", ")):s.style.removeProperty("anchor-name")}static emit(s,t,e,i=!1){return s.dispatchEvent(new CustomEvent(`expressive:${t}`,{bubbles:!0,composed:!0,cancelable:i,detail:e}))}static eventTarget(s){let t=s.composedPath()[0]??s.target;return t instanceof Element?t:null}static plainKey(s){return!(s.altKey||s.ctrlKey||s.metaKey)}static _keyIndex(s,t,e,i){return s==="Home"?0:s==="End"?e-1:t+(i[s]??NaN)}static focusTarget(s,t,e,i=!1){let n=s.filter(l=>!l.matches(':disabled, [aria-disabled="true"], .disabled')),o=n.indexOf(r.eventTarget(t));if(o<0||!r.plainKey(t))return;let a=r._keyIndex(t.key,o,n.length,e);return n[i?(a+n.length)%n.length:a]}static focusIsIn(...s){return s.some(t=>{let e=t&&t.getRootNode().activeElement;return!!e&&t.contains(e)})}static closestInPath(s,t){for(let e of s.composedPath())if(e instanceof Element&&e.matches(t))return e;return null}static getIdFromTrigger(s){return s.dataset.target||(s.getAttribute("href")?.slice(1)??"")}static _placeInOffsetParent(s,t){let{x:e,y:i}=t,n=s.offsetParent;if(n&&(n!==document.body||getComputedStyle(n).position!=="static")){let o=n.getBoundingClientRect(),a=n===document.scrollingElement;e-=o.left+window.scrollX+n.clientLeft-(a?0:n.scrollLeft),i-=o.top+window.scrollY+n.clientTop-(a?0:n.scrollTop)}s.style.top=i+"px",s.style.left=e+"px"}static _repositionWithinScreen(s,t,e,i,n,o,a){let l=n+(a==="right"?-o:o);return{x:window.scrollX+ss(s-window.scrollX,e,window.innerWidth,l),y:window.scrollY+ss(t-window.scrollY,i,window.innerHeight,l)}}};var b=class{constructor(s,t){s instanceof HTMLElement||console.error(Error(s+" is not an HTML Element")),new.target.getInstance(s)?.destroy(),this.el=s;let e=new.target.defaults,i=e.i18n&&{i18n:{...e.i18n,...t?.i18n}};this.options={...e,...t,...i},this._events=R(s),s[new.target.key]=this}static init(s,t={}){let e=i=>new this(i,t);return s instanceof Element?e(s):s?Array.from(s,e):null}static get defaults(){return{}}static getInstance(s){return s[this.key]}_notify(s,t,{args:e=[this.el],detail:i,current:n=()=>!0}={}){let o=()=>this.constructor.getInstance(this.el)===this&&n();return typeof t=="function"&&t.apply(this,e),o()?(u.emit(this.el,s,i),o()):!1}destroy(){this._events.abort(),this.el[this.constructor.key]=void 0}};var Jn={onOpen:null,onClose:null},wi='article:has(> aside[id]:not([id=""])):not(:has(> aside ~ aside)):has(> button.card-reveal-trigger[type="button"], > :not(aside) button.card-reveal-trigger[type="button"])',Li="card-reveal-initialized";function tr(r){if(r.getAttribute("aria-label")?.trim())return!0;let t=r.getAttribute("aria-labelledby");if(t&&t.trim().split(/\s+/).map(n=>u.getElementById(r,n)?.textContent??"").join(" ").trim())return!0;let e=r.cloneNode(!0);return e.querySelectorAll('[aria-hidden="true"]').forEach(i=>i.remove()),!!e.textContent?.trim()}function ns(r,s,t){return r.closest("article")===s&&!t.contains(r)&&!r.disabled&&r.getAttribute("aria-disabled")!=="true"&&tr(r)}function xi(r){if(r.tagName!=="ARTICLE")return!1;let s=r.querySelectorAll(":scope > aside");return s.length!==1||!s[0].id?!1:Array.from(r.querySelectorAll('button.card-reveal-trigger[type="button"]')).some(t=>ns(t,r,s[0]))}var G=class extends b{constructor(t,e={}){super(t,e);this.isOpen=!1;this._ownsRevealInitializedClass=!1;this._initialAriaControls=new Map;this._lastActivator=null;this._setupEventHandlers=()=>{let{signal:t}=this._events;this._activators.forEach(e=>e.addEventListener("click",this._handleClickInteraction,{signal:t})),this.el.addEventListener("keydown",this._handleKeydownEvent,{signal:t})};this._handleClickInteraction=t=>{this._lastActivator=t.currentTarget,this._handleRevealEvent()};this._handleKeydownEvent=t=>{(t.target instanceof Element?t.target.closest("article"):null)!==this.el||t.key!=="Escape"||!this.isOpen||(t.preventDefault(),this.close())};this._handleRevealEvent=()=>{this.isOpen?this.close():this.open()};this.open=()=>{this.isOpen||!this.cardReveal||(this.isOpen=!0,this.cardReveal.classList.add("open"),this.cardReveal.inert=!1,this._activators.forEach(t=>t.ariaExpanded="true"),this._notify("open",this.options.onOpen,{current:()=>this.isOpen}))};this.close=()=>{if(!this.isOpen||!this.cardReveal)return;let t=this.el.getRootNode().activeElement,e=this.cardReveal.contains(t);this.isOpen=!1,this.cardReveal.classList.remove("open"),this.cardReveal.inert=!0,this._activators.forEach(i=>i.ariaExpanded="false"),this._notify("close",this.options.onClose,{current:()=>!this.isOpen}),e&&(this._lastActivator??this._activators[0])?.focus()};let i=this.el.querySelectorAll(":scope > aside"),n=i.length===1?i[0]:null,o=n?Array.from(this.el.querySelectorAll('button.card-reveal-trigger[type="button"]')).filter(a=>ns(a,this.el,n)):[];this.cardReveal=n?.id&&o.length>0?n:null,this._activators=this.cardReveal?o:[],this.cardReveal&&(this._ownsRevealInitializedClass=!this.el.classList.contains(Li),this.el.classList.add(Li),this._activators.forEach(a=>{this._initialAriaControls.set(a,a.getAttribute("aria-controls")),a.ariaExpanded="false",a.setAttribute("aria-controls",this.cardReveal.id)}),this.cardReveal.classList.remove("open"),this.cardReveal.inert=!0,this._setupEventHandlers())}static get defaults(){return Jn}destroy(){this.cardReveal&&(this.cardReveal.classList.remove("open"),this.cardReveal.inert=!1,this._ownsRevealInitializedClass&&this.el.classList.remove(Li)),this._activators.forEach(t=>{t.removeAttribute("aria-expanded");let e=this._initialAriaControls.get(t);e!==void 0&&x(t,"aria-controls",e)}),this.isOpen=!1,this._activators=[],this._initialAriaControls.clear(),this._lastActivator=null,super.destroy()}static Init(){u.onDocumentReady(()=>{Array.from(document.querySelectorAll(wi)).filter(xi).forEach(e=>{e.Expressive_Cards==null&&this.init(e)})})}};G.key="Expressive_Cards";var er={onOpen:null,onClose:null},Mi="article.expanding-card:has(> dialog.expanding-card-dialog)",Z=class extends b{constructor(t,e){super(t,e);this.isOpen=!1;this.closeGeneration=0;this._initialTrigger={};this._setupEventHandlers=()=>{let{signal:t}=this._events;this.trigger?.addEventListener("click",this.open,{signal:t}),this.trigger?.addEventListener("keypress",this._handleTriggerKeypress,{signal:t}),this.closeButton?.addEventListener("click",this.close,{signal:t}),this.dialog?.addEventListener("cancel",this._handleCancel,{signal:t}),this.dialog?.addEventListener("close",this._handleNativeClose,{signal:t})};this._handleTriggerKeypress=t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),this.open())};this._handleCancel=t=>{t.preventDefault(),this.close()};this._handleNativeClose=()=>{if(this.dialog.open)return;let t=this.isOpen;this._collapse(),t&&this._notify("close",this.options.onClose,{current:()=>!this.isOpen})};this._setTransitionOrigin=()=>{if(!this.dialog)return;let t=this.el.getBoundingClientRect(),i=this.el.querySelector(":scope > figure, :scope > img")?.getBoundingClientRect(),n=(o,a)=>this.dialog.style.setProperty(`--md-comp-expanding-card-from-${o}`,`${Math.max(0,a)}px`);n("top",t.top),n("right",window.innerWidth-t.right),n("bottom",window.innerHeight-t.bottom),n("left",t.left),n("media-height",i?.height??0)};this.open=()=>{this.isOpen||!this.dialog||!this.trigger||(this.closeGeneration++,this._setTransitionOrigin(),this.isOpen=!0,this.trigger.ariaExpanded="true",this.dialog.showModal(),this.dialog.offsetWidth,this.dialog.classList.add("expanded"),this.closeButton?.focus(),this._notify("open",this.options.onOpen,{current:()=>this.isOpen}))};this.close=()=>{if(!this.isOpen||!this.dialog||!this.trigger)return;this._setTransitionOrigin(),this._collapse();let t=this.closeGeneration;this._notify("close",this.options.onClose,{current:()=>!this.isOpen});let e=()=>{t!==this.closeGeneration||this.isOpen||!this.dialog.open||(this.dialog.close(),this.dialog.isConnected&&this.trigger.isConnected&&this.trigger.focus())},n=window.matchMedia("(prefers-reduced-motion: reduce)").matches?[]:(this.dialog.getAnimations?.()??[]).filter(o=>o.transitionProperty==="clip-path");n.length===0?e():Promise.allSettled(n.map(o=>o.finished)).then(e)};if(this.dialog=this.el.querySelector(":scope > dialog.expanding-card-dialog"),this.trigger=this.el.querySelector(":scope > .expanding-card-trigger, :scope > figure > .expanding-card-trigger"),this.closeButton=this.dialog?.querySelector(".expanding-card-close")??null,this.trigger&&this.dialog){for(let i of["aria-expanded","aria-controls","tabindex","role"])this._initialTrigger[i]=this.trigger.getAttribute(i);this.trigger.ariaExpanded="false",this.dialog.id&&this.trigger.setAttribute("aria-controls",this.dialog.id),this.trigger.matches("a[href], button, input, select, textarea")||(this.trigger.tabIndex=0,this.trigger.setAttribute("role","button")),this._setupEventHandlers()}}static get defaults(){return er}destroy(){this._events.abort(),this._collapse(),this.dialog?.open&&this.dialog.close();for(let[t,e]of Object.entries(this._initialTrigger))x(this.trigger,t,e);super.destroy()}_collapse(){this.closeGeneration++,this.isOpen=!1,this.trigger&&(this.trigger.ariaExpanded="false"),this.dialog?.classList.remove("expanded")}static Init(){u.onDocumentReady(()=>{document.querySelectorAll(Mi).forEach(t=>{t.Expressive_ExpandingCard==null&&this.init(t)})})}};Z.key="Expressive_ExpandingCard";var rs=r=>r.parentElement??(r.getRootNode().host||null),ir={translate:/^(none|0px( 0px){0,2})$/,rotate:/^(none|(\S+ )*0deg)$/,scale:/^(none|1( 1){0,2})$/};function sr(r){for(let s=rs(r);s;s=rs(s)){let t=getComputedStyle(s);if(!new DOMMatrixReadOnly(t.transform).isIdentity||Object.entries(ir).some(([e,i])=>!i.test(t.getPropertyValue(e))))return!0}return!1}function nr(r){let s=[];for(let t=r.getRootNode();"host"in t;t=t.host.getRootNode())s.push(t);return s}function rr(r,s,t){let e=r.getBoundingClientRect();return{left:window.innerWidth-(e.left+s.width),right:e.right-s.width,top:window.innerHeight-(e.top+s.height+t),bottom:e.bottom-(s.height+t)}}var or={ArrowUp:-1,ArrowDown:1},os=':scope > li, :scope > li > ul[role="group"] > li',ar=typeof CSS<"u"&&!!CSS.supports?.("anchor-name: --a"),lr=["position","inset","max-height","position-anchor","position-area","position-try-fallbacks"],as=112,cr=280,hr={alignment:"left",autoFocus:!0,constrainWidth:!0,container:null,coverTrigger:!1,placement:"bottom",closeOnClick:!0,hover:!1,contextMenu:!1,inDuration:150,outDuration:250,onOpenStart:null,onOpenEnd:null,onCloseStart:null,onCloseEnd:null,onItemClick:null},$e=" ",et=class et extends b{constructor(t,e){super(t,{contextMenu:t.hasAttribute("data-context-menu"),...e});this._pendingTimers=new Set;this._transition=0;this._menuClickTargets=new WeakMap;this._spaceActivation=!1;this._openedByHover=!1;this._contextPoint=null;this._contextReturn=null;this._handleContextMenu=t=>{if(t.defaultPrevented){this.close();return}let e=t.composedPath();if(et._menus.some(o=>o!==this&&o.isOpen&&e.includes(o.menuEl)))return;if(t.preventDefault(),!this.isOpen){let o=this.el.getRootNode();this._contextReturn=o.activeElement instanceof HTMLElement?o.activeElement:null}let i=this.el.getBoundingClientRect(),n=(t.clientX!==0||t.clientY!==0)&&t.clientX>=i.left&&t.clientX<=i.right&&t.clientY>=i.top&&t.clientY<=i.bottom;this._contextPoint=n?{x:t.clientX,y:t.clientY}:null,this.isOpen?this.recalculateDimensions():this.open()};this._handleDocumentContextMenu=t=>{let e=t.composedPath();if(e.includes(this.menuEl)){t.preventDefault();return}e.includes(this.el)||this.close()};this._handleClick=t=>{t.preventDefault(),this.isOpen?this.close():this.open()};this._handleMouseEnter=()=>{this.isOpen||(this._openedByHover=!0,this.open())};this._handleMouseLeave=t=>{let e=t.relatedTarget;if(!e){this.close();return}!e.closest(".menu-trigger")?.Expressive_Menu?.isOpen&&!this.menuEl?.contains(e)&&this.close()};this._handleDocumentClick=t=>{let e=t.composedPath(),i=this._menuClickTargets.get(t);if(this._menuClickTargets.delete(t),!i&&!this.options.contextMenu&&e.includes(this.el)){this.isTouchMoving=!1;return}let n=i??(e[0]||t.target),o=!!i||e.includes(this.menuEl)||this.menuEl?.contains(n);this._isSubmenuTriggerClick(n)||(o&&this._closesOnClick(n)?this.close():o||this._schedule(()=>this.close(),0),this.isTouchMoving=!1)};this._handleDocumentKeydown=t=>{t.key!=="Escape"||!this._openedByHover||(u.focusIsIn(this.el)&&t.preventDefault(),this.close())};this._handleTriggerKeydown=t=>{if(this.options.contextMenu)return;if(t.key==="Escape"&&this.isOpen&&u.plainKey(t)&&!u.isComposing(t)){t.preventDefault(),this.close();return}[$e,"Enter","ArrowDown","ArrowUp"].includes(t.key)&&(this.isOpen?this._openedByHover&&(t.preventDefault(),this._openedByHover=!1,this._focusInitialItem()):(t.preventDefault(),this.open()))};this._handleMenuPointerdown=()=>{this.isTouchMoving=!1};this._handleDocumentTouchmove=t=>{let e=t.target;(t.composedPath().includes(this.menuEl)||this.menuEl?.contains(e))&&(this.isTouchMoving=!0)};this._handleMenuClick=t=>{let e=t.target;this._menuClickTargets.set(t,e);let i=e.closest("li");if(i?.matches('.disabled, [aria-disabled="true"]')){t.preventDefault(),t.stopPropagation();return}if(i&&this._isSubmenuTriggerClick(e)){t.preventDefault(),t.stopPropagation(),this._toggleSubmenu(i);return}i&&this._activateItem(i)};this._handleSubmenuAlign=t=>{let e=t.target;if(!(e instanceof Element))return;let i=e.closest("li");i?.querySelector(":scope > menu")&&this.menuEl?.contains(i)&&this._alignSubmenu(i)};this._handleMenuKeydown=t=>{if(!this.isOpen||!u.plainKey(t)||u.isComposing(t))return;let e=this._containingSubmenu(t)??this.menuEl,i=getComputedStyle(e).direction==="rtl",n=i?"ArrowLeft":"ArrowRight",o=i?"ArrowRight":"ArrowLeft";if([n,o,"ArrowUp","ArrowDown","Escape","Tab"].includes(t.key)&&(clearTimeout(this.filterTimeout),this._resetFilterQuery()),t.key==="Tab")t.preventDefault(),this.close();else if(t.key===n){let l=this._focusedRow(t);if(l?.querySelector(":scope > menu")&&!l.matches('.disabled, [aria-disabled="true"]')){t.preventDefault(),l.classList.add("open"),this._alignSubmenu(l),this._syncSubmenuAria(l,!0);let c=Array.from(l.querySelector(":scope > menu").children).find(h=>h instanceof HTMLElement&&h.tabIndex!==-1);c&&this._focusRow(c)}}else if(t.key===o){let l=this._containingSubmenu(t);if(l){t.preventDefault();let c=l.parentElement;this._closeSubmenu(c),this._focusRow(c)}}else if(this._moveFocus(e,t))t.preventDefault();else if(t.key==="Enter"||t.key===$e){let l=this._focusedRow(t);if(t.preventDefault(),l?.matches('.disabled, [aria-disabled="true"]'))return;if(l?.querySelector(":scope > menu")){this._toggleSubmenu(l);return}let c=l??this.menuEl.children[this.focusedIndex],h=c?.querySelector(":scope > a, :scope > button");this._spaceActivation=t.key===$e,h?h.click():c instanceof HTMLElement&&c.click(),this._spaceActivation=!1,this._closeAfterEnter(t,c)}else if(t.key==="Escape"){t.preventDefault();let l=this._containingSubmenu(t)?.parentElement??Array.from(this.menuEl.querySelectorAll("li.open")).reverse()[0];l?(this._closeSubmenu(l),this._focusRow(l)):this.close()}let a=t.key.toLowerCase();if(t.key.length===1&&t.key!==$e){this.filterQuery.push(a);let l=this.filterQuery.join(""),c=this._rows(e).find(h=>!h.matches('.disabled, [aria-disabled="true"]')&&Array.from(h.childNodes).filter(d=>!(d instanceof Element&&d.matches("menu"))).map(d=>d.textContent).join("").trim().toLowerCase().startsWith(l));c&&this._focusRow(c),clearTimeout(this.filterTimeout),this.filterTimeout=setTimeout(this._resetFilterQuery,1e3)}};this._handleWindowResize=()=>{this.el.offsetParent&&this.recalculateDimensions()};this._resetFilterQuery=()=>{this.filterQuery=[]};this._reanchorFrame=0;this._reanchor=t=>{this._reanchorFrame||this.options.contextMenu||this.menuEl.contains(t.target)||(this._reanchorFrame=requestAnimationFrame(()=>{if(this._reanchorFrame=0,!this.isOpen)return;if(this.menuEl.style.getPropertyValue("position-anchor"))return this._placeAnchored();let{scrollTop:e}=this.menuEl;this.recalculateDimensions(),this.menuEl.scrollTop=e}))};this.open=()=>{if(!this._canOpen)return;let t=this._clearPendingTimers();this.isOpen=!0,this._notify("open",this.options.onOpenStart,{current:()=>t===this._transition})&&(this._resetMenuStyles(),this.menuEl.isConnected&&this.menuEl.showPopover(),this._restoreInert(),this._placeMenu(),this._schedule(()=>this._setupTemporaryEventHandlers(),0),this._animateIn(),this._setExpanded(!0))};this.close=()=>{if(!this.isOpen)return;let t=this._clearPendingTimers(),e=this.menuEl.getRootNode(),i=e.activeElement;if(this.isOpen=!1,this._openedByHover=!1,this.menuEl.setAttribute("inert",""),clearTimeout(this.filterTimeout),this._resetFilterQuery(),this.focusedIndex=-1,this._clearActive(),this._closeSubmenus(),!!this._notify("close",this.options.onCloseStart,{current:()=>t===this._transition})){if(this._animateOut(),this._openEvents?.abort(),this._setExpanded(!1),this.options.autoFocus&&this.menuEl.contains(i)&&(e.activeElement===i||this.el.ownerDocument.activeElement===this.el.ownerDocument.body)){let n=this._contextReturn;(n?.isConnected&&n!==this.el.ownerDocument.body?n:this.el).focus()}this._contextReturn=null,this._contextPoint=null}};this.recalculateDimensions=()=>{this.isOpen&&(this._resetMenuPositioningStyles(),this._placeMenu())};if(et._menus.push(this),this.id=u.getIdFromTrigger(t),this.menuEl=u.getElementById(t,this.id),this.isOpen=!1,this.isScrollable=!1,this.isTouchMoving=!1,this.focusedIndex=-1,this.filterQuery=[],this.options.contextMenu||(this.el.ariaExpanded="false",this.el.hasAttribute("aria-haspopup")||this.el.setAttribute("aria-haspopup","menu"),this.id&&!this.el.hasAttribute("aria-controls")&&this.el.setAttribute("aria-controls",this.id)),!this.menuEl){console.warn(`Menu skipped: no element matches target "${this.id}".`,t);return}this._originalInert=this.menuEl.getAttribute("inert"),this._moveMenuToElement(),this._setupAccessibility(),this._makeMenuFocusable(),this._setupSubmenus(),this._setupEventHandlers()}static get defaults(){return hr}destroy(){this._clearPendingTimers(),this.isOpen=!1,this._setExpanded(!1),this.menuEl&&u.setAnchorName(this.el,`--menu-${this.menuEl.id}`,!1),clearTimeout(this.filterTimeout),this._resetMenuStyles(),this._restoreInert(),this._events.abort(),this._openEvents?.abort();let t=et._menus.indexOf(this);t>=0&&et._menus.splice(t,1),super.destroy()}_setupEventHandlers(){let{signal:t}=this._events;this.el.addEventListener("keydown",this._handleTriggerKeydown,{signal:t}),this.menuEl?.addEventListener("click",this._handleMenuClick,{signal:t}),this.menuEl?.querySelector(":scope > li > menu")&&this.menuEl.addEventListener("mouseover",this._handleSubmenuAlign,{signal:t}),this.options.contextMenu?this.el.addEventListener("contextmenu",this._handleContextMenu,{signal:t}):this.options.hover?(this.el.addEventListener("mouseenter",this._handleMouseEnter,{signal:t}),this.el.addEventListener("mouseleave",this._handleMouseLeave,{signal:t}),this.menuEl.addEventListener("mouseleave",this._handleMouseLeave,{signal:t})):this.el.addEventListener("click",this._handleClick,{signal:t})}_setupTemporaryEventHandlers(){this._openEvents?.abort(),this._openEvents=R(this.el);let{signal:t}=this._openEvents,e={passive:!0,signal:t};document.addEventListener("click",this._handleDocumentClick,{signal:t}),this.menuEl?.addEventListener("pointerdown",this._handleMenuPointerdown,e),this.menuEl?.addEventListener("touchmove",this._handleDocumentTouchmove,e),document.addEventListener("touchmove",this._handleDocumentTouchmove,e),this.menuEl?.addEventListener("keydown",this._handleMenuKeydown,{signal:t}),document.addEventListener("keydown",this._handleDocumentKeydown,{signal:t}),window.addEventListener("resize",this._handleWindowResize,{signal:t});for(let i of[window,...nr(this.el)])i.addEventListener("scroll",this._reanchor,{capture:!0,passive:!0,signal:t});this.options.contextMenu&&document.addEventListener("contextmenu",this._handleDocumentContextMenu,{signal:t})}_activateItem(t){let e=this._toggleChecked(t);this._notify("select",this.options.onItemClick,{args:[t],detail:{item:t}})&&e!==null&&this._notify("change",null,{detail:{item:t,checked:e}})}_toggleChecked(t){let e=t.getAttribute("role");if(e==="menuitemradio")return this._checkRadio(t);if(e!=="menuitemcheckbox")return null;let i=t.getAttribute("aria-checked")!=="true";return t.setAttribute("aria-checked",String(i)),i}_checkRadio(t){return t.getAttribute("aria-checked")==="true"?null:(t.parentElement.querySelectorAll(':scope > li[role="menuitemradio"]').forEach(e=>{e.setAttribute("aria-checked",String(e===t))}),!0)}_isCheckboxRow(t){return t?.closest("li")?.getAttribute("role")==="menuitemcheckbox"}_closesOnClick(t){return this.options.closeOnClick&&!this.isTouchMoving&&!this._keepsOpen(t)}_keepsOpen(t){let e=t.closest("li")?.getAttribute("role");return e==="menuitemcheckbox"?!0:this._spaceActivation&&e==="menuitemradio"}_closeAfterEnter(t,e){t.key==="Enter"&&this.options.closeOnClick&&this._isCheckboxRow(e)&&this.close()}_setupAccessibility(){if(!this.menuEl)return;this.menuEl.hasAttribute("role")||this.menuEl.setAttribute("role","menu"),[this.menuEl,...this.menuEl.querySelectorAll("menu")].forEach(e=>{e.hasAttribute("role")||e.setAttribute("role","menu"),e.getAttribute("role")==="menu"&&e.querySelectorAll(os).forEach(i=>{if(i.classList.contains("divider")){i.hasAttribute("role")||i.setAttribute("role","separator");return}if(i.classList.contains("gap")){i.setAttribute("aria-hidden","true");return}if(i.classList.contains("label")||i.classList.contains("optgroup")){i.hasAttribute("role")||i.setAttribute("role","presentation");return}i.hasAttribute("role")||i.setAttribute("role","menuitem"),i.classList.contains("disabled")&&!i.hasAttribute("aria-disabled")&&i.setAttribute("aria-disabled","true")})})}_isSubmenuTriggerClick(t){if(!this.menuEl)return!1;let e=t.closest("li");if(!e||!this.menuEl.contains(e))return!1;let i=e.querySelector(":scope > menu");return i?!i.contains(t):!1}_setupSubmenus(){this.menuEl?.querySelectorAll("li").forEach(t=>{if(!t.querySelector(":scope > menu"))return;let e=t.querySelector(":scope > a, :scope > button, :scope > span")??t;e.setAttribute("aria-haspopup","menu"),e.setAttribute("aria-expanded","false")})}_toggleSubmenu(t){let e=!t.classList.contains("open");t.parentElement?.querySelectorAll(":scope > li.open").forEach(i=>{i!==t&&this._closeSubmenu(i)}),t.classList.toggle("open",e),e&&this._alignSubmenu(t),this._syncSubmenuAria(t,e)}_syncSubmenuAria(t,e){(t.querySelector(":scope > a, :scope > button, :scope > span")??t).setAttribute("aria-expanded",e?"true":"false")}_alignSubmenu(t){let e=t.querySelector(":scope > menu");if(!e)return;t.classList.remove("submenu-start");let i=e.getBoundingClientRect();(i.left<8||i.right>window.innerWidth-8)&&t.classList.add("submenu-start")}_closeSubmenu(t){t.classList.remove("open","submenu-start"),this._syncSubmenuAria(t,!1)}_closeSubmenus(){this.menuEl?.querySelectorAll("li.open").forEach(t=>this._closeSubmenu(t))}_containingSubmenu(t){let e=t.target;if(!(e instanceof Element))return null;let i=e.closest("li > menu");return i instanceof HTMLElement&&this.menuEl?.contains(i)?i:null}_focusedRow(t){let e=t.target;if(!(e instanceof Element))return null;let i=e.closest("li");return i instanceof HTMLElement&&this.menuEl?.contains(i)?i:null}_restoreInert(){this.menuEl&&x(this.menuEl,"inert",this._originalInert)}_clearActive(){this.menuEl?.querySelectorAll("li.active").forEach(t=>t.classList.remove("active"))}_focusRow(t){this._clearActive(),this.focusedIndex=Array.from(t.parentElement.children).indexOf(t),t.focus({preventScroll:!0}),t.scrollIntoView({block:"nearest",inline:"nearest"})}_resetMenuStyles(){this.menuEl&&(this.menuEl.hidePopover(),this._resetMenuPositioningStyles(),this.menuEl.style.transform="",this.menuEl.style.opacity="")}_resetMenuPositioningStyles(){this.menuEl.style.width="",this.menuEl.style.height="",this.menuEl.style.left="",this.menuEl.style.top="",this.menuEl.style.transformOrigin="";for(let t of lr)this.menuEl.style.removeProperty(t);this._stopReanchoring()}_moveMenuToElement(){this.options.container?this.options.container.append(this.menuEl):this.el.after(this.menuEl)}_makeMenuFocusable(){this.menuEl&&(this.menuEl.popover="manual",this.menuEl.tabIndex=-1,this.menuEl.querySelectorAll(":scope li").forEach(t=>{if(t.matches('.divider, .gap, .label, .optgroup, [role="none"]')){t.setAttribute("tabindex","-1");return}t.getAttribute("tabindex")||t.setAttribute("tabindex","0")}))}_moveFocus(t,e){let i=this._rows(t),n=this._focusedRow(e)??t.children[this.focusedIndex],o=u._keyIndex(e.key,i.indexOf(n),i.length,or);if(Number.isNaN(o))return!1;let a=i[o];return a&&(this._focusRow(a),a.classList.add("active")),!0}_rows(t){return Array.from(t.querySelectorAll(os)).filter(e=>e instanceof HTMLElement&&e.tabIndex!==-1)}_focusInitialItem(){if(!this.menuEl||!this.options.autoFocus)return;let t=this._rows(this.menuEl)[0];t&&(this._clearActive(),this.focusedIndex=Array.from(t.parentElement.children).indexOf(t),t.focus({preventScroll:!0}))}_focusFocusedItem(){this.focusedIndex>=0&&this.focusedIndex<this.menuEl.children.length&&this.options.autoFocus&&(this.menuEl.children[this.focusedIndex].focus({preventScroll:!0}),this.menuEl.children[this.focusedIndex].scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"}))}_opensUp(t){return t.top<0||this.options.placement==="top"&&t.bottom>=0}_getMenuPosition(){let t=this.el.getBoundingClientRect(),e=this.menuEl.getBoundingClientRect(),i=e.height,n=e.width,o=t.left-e.left,a=t.top-e.top,l=rr(this.el,e,this.options.coverTrigger?0:t.height),c="top",h=this.options.alignment;if(a+=this.options.coverTrigger?0:t.height,this.isScrollable=!1,this._opensUp(l)&&(l.bottom>=0?(c="bottom",this.options.coverTrigger||(a-=t.height)):(this.isScrollable=!0,i-=20,l.bottom>l.top?(c="bottom",i+=l.bottom,a-=this.options.coverTrigger?l.bottom-20:l.bottom-20+t.height):i+=l.top)),l[h]<0){let d=h==="left"?"right":"left";l[d]>=0?h=d:l.right>l.left?(h="right",n+=l.right,o-=l.right):(h="left",n+=l.left)}return c==="bottom"&&(a=a-e.height+(this.options.coverTrigger?t.height:0)),h==="right"&&(o=o-e.width+t.width),{x:o,y:a,verticalAlignment:c,horizontalAlignment:h,height:i,width:n}}_schedule(t,e){let i=setTimeout(()=>{this._pendingTimers.delete(i),t()},e);this._pendingTimers.add(i)}_clearPendingTimers(){for(let t of this._pendingTimers)clearTimeout(t);return this._pendingTimers.clear(),++this._transition}_animateIn(){let t=this._transition,e=!this._openedByHover,i=this.options.inDuration;this.menuEl.style.transition="none",this.menuEl.style.opacity="0",this.menuEl.style.transform="scale(0.85)",this._schedule(()=>{this.menuEl.style.transition=`opacity ${i}ms ease, transform ${i}ms ease`,this.menuEl.style.opacity="1",this.menuEl.style.transform="scale(1)"},1),this._schedule(()=>{e&&this._focusInitialItem(),t===this._transition&&this._notify("opened",this.options.onOpenEnd,{current:()=>t===this._transition})},i)}_animateOut(){let t=this._transition,e=this.options.outDuration;this.menuEl.style.transition=`opacity ${e}ms ease, transform ${e}ms ease`,this.menuEl.style.opacity="0",this.menuEl.style.transform="scale(0.85)",this._schedule(()=>{this._resetMenuStyles(),this._notify("closed",this.options.onCloseEnd,{current:()=>t===this._transition})},e)}_placeMenu(){let t=this.menuEl.getBoundingClientRect().width,e=this.el.getBoundingClientRect().width,i=this.options.constrainWidth&&!this.options.contextMenu&&e>=as?e:Math.min(cr,Math.max(as,t));if(this.menuEl.style.width=i+"px",this.options.contextMenu){this._placeMenuAtPoint(this._contextPoint??this._regionCorner());return}ar&&!this.options.coverTrigger&&!sr(this.el)?this._anchorMenu():this._placeByCoordinates()}_side(){let t=this.el.getBoundingClientRect(),e={top:t.top,bottom:window.innerHeight-t.bottom},[i,n]=this.options.placement==="top"?["top","bottom"]:["bottom","top"];return e[i]>=this.menuEl.scrollHeight||e[i]>=e[n]?i:n}_anchorMenu(){let t=`--menu-${this.menuEl.id}`;u.setAnchorName(this.el,t,!0);let e=this.menuEl.style;e.position="fixed",e.inset="auto",e.maxHeight="100%",e.setProperty("position-anchor",t),this._placeAnchored()}_stopReanchoring(){cancelAnimationFrame(this._reanchorFrame),this._reanchorFrame=0}_placeAnchored(){let t=this.menuEl.style,[e,i]=[this._side(),this.options.alignment==="right"?"left":"right"];t.setProperty("position-area",`${e} span-${i}`),t.setProperty("position-try-fallbacks","flip-block, flip-inline, flip-block flip-inline"),t.transformOrigin=`${i==="left"?"100%":"0"} ${e==="top"?"100%":"0"}`,this.isScrollable=this.menuEl.scrollHeight>this.menuEl.clientHeight}_placeByCoordinates(){let t=this._getMenuPosition();this.menuEl.style.left=t.x+"px",this.menuEl.style.top=t.y+"px",this.menuEl.style.height=t.height+"px",this.menuEl.style.width=t.width+"px",this.menuEl.style.transformOrigin=`${t.horizontalAlignment==="left"?"0":"100%"} ${t.verticalAlignment==="top"?"0":"100%"}`}_regionCorner(){let t=this.el.getBoundingClientRect();return{x:getComputedStyle(this.el).direction==="rtl"?t.right:t.left,y:t.bottom}}_placeMenuAtPoint({x:t,y:e}){let{transform:i,transition:n}=this.menuEl.style;this.menuEl.style.transition="none",this.menuEl.style.transform="none";let o=this.menuEl.getBoundingClientRect();this.menuEl.style.transform=i,this.menuEl.style.transition=n;let a={left:0,top:0,right:window.innerWidth,bottom:window.innerHeight},l=o.width,c=Math.min(o.height,a.bottom-a.top);this.isScrollable=c<o.height,this.isScrollable&&(this.menuEl.style.height=c+"px");let h=getComputedStyle(this.el).direction==="rtl",d=t+l<=a.right,p=t-l>=a.left,g=h?p||!d:!d&&p,m=e+c>a.bottom&&e-c>=a.top,E=(_,L,S)=>Math.max(L,Math.min(_,S)),T=E(g?t-l:t,a.left,a.right-l),C=E(m?e-c:e,a.top,a.bottom-c);this.menuEl.style.left=T-o.left+"px",this.menuEl.style.top=C-o.top+"px",this.menuEl.style.transformOrigin=`${g?"100%":"0"} ${m?"100%":"0"}`}_setExpanded(t){this.options.contextMenu||(this.el.ariaExpanded=String(t))}get _canOpen(){return!this.isOpen&&!!this.menuEl&&this.el.Expressive_Menu===this}};et._menus=[],et.key="Expressive_Menu";var B=et;var ur={i18n:{loading:"Loading results.",noResults:"No results.",results:r=>`${r} ${r===1?"result":"results"} available.`,selected:r=>`${r} ${r===1?"item":"items"} selected.`,create:r=>`Add "${r}"`},data:[],onAutocomplete:null,menuOptions:{autoFocus:!1,closeOnClick:!1,coverTrigger:!1},minLength:1,searchDelay:0,allowCreate:!1,onCreate:null,isMultiSelect:!1,onSearch:(r,s)=>{let t=r.toLocaleLowerCase();s.setMenuItems(s.options.data.filter(e=>e.id.toString().toLocaleLowerCase().includes(t)||e.text?.toLocaleLowerCase().includes(t)))},maxMenuHeight:"300px",allowUnsafeHTML:!1,selected:[]},K=class K extends b{constructor(t,e){super(t,e);this._left=!0;this._selection=0;this._noResults=!1;this._handleInputBlur=()=>{this._pointerDown||(this._left=!0,this._cancelPendingSearch(),this.close(),this._resetAutocomplete())};this._handleInputKeyup=()=>{K._keydown=!1};this._handleInput=()=>{this._left=!1,this.count=0;let t=this.el.value.toLocaleLowerCase();this.oldVal!==t&&(this._resetCurrentElementPosition(),this._noResults=!1,this.el.matches(":focus-visible")&&(!this.menu.isOpen||t.length<this.options.minLength)&&this.open()),this._inputChangeDetection(t,!0)};this._handleInputFocus=()=>{this._left=!1,this.count=0;let t=this.el.value.toLocaleLowerCase();this._inputChangeDetection(t)};this._inputChangeDetection=(t,e)=>{let i=!this.options.isMultiSelect&&this.selectedValues.length>0&&this.el.value!==(this.selectedValues[0].text||String(this.selectedValues[0].id));i&&(this.selectedValues=[]),this.oldVal!==t&&(this._noResults=!1,this._setStatusLoading(),this._queueSearch(e)),i&&this._triggerChanged(),this.oldVal=t};this._handleInputKeydown=u.ignoringComposition(t=>{if(K._keydown=!0,t.key==="Escape"||t.key==="Tab"){this._dismiss(t);return}let e=this._options(),i=e.length;if(t.key==="Enter"&&this.activeIndex>=0){let n=e[this.activeIndex];n&&(this._choose(n),t.preventDefault());return}if(t.key==="ArrowUp"||t.key==="ArrowDown"){if(t.preventDefault(),!this.menu.isOpen&&this._openTimer===void 0){this.open();return}t.key==="ArrowUp"&&this.activeIndex>0&&this.activeIndex--,t.key==="ArrowDown"&&this.activeIndex<i-1&&this.activeIndex++,this._setActive(null),this.activeIndex>=0&&(this._setActive(e[this.activeIndex]),e[this.activeIndex].scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"}))}});this._handleInputClick=()=>{this.open()};this._handleContainerPointerDown=t=>{t.isPrimary&&(t.pointerType==="mouse"&&t.button!==0||(this._pointerDown=!0))};this._handleContainerPointerUp=()=>{this._pointerDown=!1};this._handleInertRowPress=t=>{!(t.target instanceof Element)||!t.target.closest('.autocomplete-no-results, .autocomplete-group-label, [aria-disabled="true"]')||(t.preventDefault(),t.stopPropagation())};this.open=()=>{let t=this.el.value.toLocaleLowerCase();this._resetAutocomplete(),t.length>=this.options.minLength&&(this._renderMenu(),this._announce(this._resultsMessage())),this.menu.isOpen?this.menu.recalculateDimensions():(this._openTimer!==void 0&&clearTimeout(this._openTimer),this._openTimer=setTimeout(()=>{this._openTimer=void 0,this.menu.open()},0))};this.close=()=>{this._announcer&&(this._announcer.textContent=""),this._openTimer!==void 0&&(clearTimeout(this._openTimer),this._openTimer=void 0),this.isOpen=!1,this.menu.close()};this.isOpen=!1,this.count=0,this.activeIndex=-1,this.oldVal="",this.selectedValues=this.options.selected.map(i=>this.options.data.find(n=>n.id===i)??{id:i}),this.menuItems=this.options.data||[],this.$active=null,this._pointerDown=!1,this._setupMenu(),this._setupEventHandlers()}_setActive(t){this.$active?.classList.remove("active"),this.$active=t,t?(t.classList.add("active"),this.el.setAttribute("aria-activedescendant",t.id)):this.el.removeAttribute("aria-activedescendant")}static get defaults(){return ur}static _loadingIndicator(){if(!K._loadingTemplate){let t=document.createElement("template");t.innerHTML=`<div style="height:100%;width:50px;"><svg version="1.1" id="L4" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 100 100" enable-background="new 0 0 0 0" xml:space="preserve">
|
|
1
|
+
var Expressive=(()=>{var Ai=Object.defineProperty;var lr=Object.getOwnPropertyDescriptor;var cr=Object.getOwnPropertyNames;var hr=Object.prototype.hasOwnProperty;var ur=(r,s)=>{for(var t in s)Ai(r,t,{get:s[t],enumerable:!0})},dr=(r,s,t,e)=>{if(s&&typeof s=="object"||typeof s=="function")for(let i of cr(s))!hr.call(r,i)&&i!==t&&Ai(r,i,{get:()=>s[i],enumerable:!(e=lr(s,i))||e.enumerable});return r};var pr=r=>dr(Ai({},"__esModule",{value:!0}),r);var Sc={};ur(Sc,{AppBar:()=>_t,AutoInit:()=>rr,Autocomplete:()=>it,BackToTop:()=>Wt,BarChart:()=>At,BottomSheets:()=>Qt,ButtonGroup:()=>vt,Cards:()=>nt,Carousel:()=>bt,Cascader:()=>Lt,CharacterCounter:()=>Ae,Chips:()=>rt,ColorPicker:()=>wt,ColumnChart:()=>G,CommandPalette:()=>Mt,Confetti:()=>pe,Copy:()=>ie,CurrencyInput:()=>Tt,DataTables:()=>he,Datepicker:()=>ve,Dialogs:()=>Zt,ExpandingCard:()=>et,FloatingActionButton:()=>gt,FormSelect:()=>K,Forms:()=>te,FunnelChart:()=>Ft,HeatmapChart:()=>Ht,HoverCard:()=>yt,ImageCompare:()=>re,InputMask:()=>Et,Keypad:()=>lt,Lightbox:()=>Vt,LineChart:()=>A,Lists:()=>le,LoadingOverlay:()=>zt,MapView:()=>$e,Menu:()=>$,Menubar:()=>$t,MessageScroller:()=>qt,MixedChart:()=>Pt,NavigationRail:()=>jt,PaneResize:()=>ne,Particles:()=>xt,PieChart:()=>It,PullToRefresh:()=>be,Questionnaire:()=>Ct,RadarChart:()=>Ot,RadialChart:()=>Dt,RichTextEditor:()=>Be,SankeyChart:()=>Nt,ScatterChart:()=>Rt,ScrollSpy:()=>Ee,ShowMore:()=>de,SideSheets:()=>Jt,Slider:()=>Gt,Snackbar:()=>ee,Sortable:()=>ae,SwipeActions:()=>Kt,Tabs:()=>ye,Theme:()=>se,Timepicker:()=>Te,Tooltip:()=>Yt,Tour:()=>oe,TransferList:()=>ue,TreeSelect:()=>Ut,TreemapChart:()=>Bt,version:()=>Cc});var fs=(r,s,t,e)=>r<e?e:r+s>t-e?t-s:r;function w(r,s,t){t===null?r.removeAttribute(s):r.setAttribute(s,t)}function Xt(r){let s=r.replace(/−/g,"-").replace(/[\s%\p{Sc}]/gu,"");if(!/^[+-]?(\d{1,3}(,\d{3})+|\d+)?(\.\d+)?(e[+-]?\d+)?$/i.test(s))return null;let t=parseFloat(s.replace(/,/g,""));return Number.isFinite(t)?t:null}function Hi(r){let s=r.getRootNode();return"host"in s?s:r.ownerDocument}function B(r,s,t){let e=new WeakSet,i=o=>{o.target!==r.form||e.has(o)||(e.add(o),setTimeout(()=>t.aborted||o.defaultPrevented||s()))},n=()=>{for(let o of[Hi(r),r.form])o?.addEventListener("reset",i,{capture:!0,signal:t})};return n(),n}function Ve(r){document.addEventListener("reset",s=>{let t=s.target;t instanceof HTMLFormElement&&setTimeout(()=>s.defaultPrevented||r(t))},!0)}function dt(r){let s=r.activeElement;for(;s?.shadowRoot?.activeElement;)s=s.shadowRoot.activeElement;return s}function Ii(r,s,t,e,i=!0){let n=document.createElement("button");n.className=`${t} text`,n.style.visibility=i?"visible":"hidden",n.type="button",n.tabIndex=i?0:-1,n.innerText=s??"",n.addEventListener("click",e),r.append(n)}function We(r,{i18n:s,showClearBtn:t,autoSubmit:e},i,n,o,a){if(Ii(r,s.clear,i,n,t),e)return;let l=document.createElement("div");l.classList.add("confirmation-btns"),r.append(l),Ii(l,s.cancel,"btn-cancel",a),Ii(l,s.done,"btn-confirm",o)}function R(r){return new(r.ownerDocument?.defaultView??window).AbortController}function M(r,s={}){let t=document.createElementNS("http://www.w3.org/2000/svg",r);for(let e in s)t.setAttribute(e,s[e]);return t}var u=class r{static isComposing(s){return s.isComposing||s.keyCode===229}static ignoringComposition(s){return t=>{r.isComposing(t)||s(t)}}static onDocumentReady(s){typeof document>"u"||(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",s,{once:!0}):s())}static locale(s){let[t,e]=[s,void 0];for(;t&&e===void 0;)e=t.closest("[lang]")?.lang,t=t.getRootNode().host;try{return e?Intl.getCanonicalLocales(e)[0]:void 0}catch{return}}static guid(){return globalThis.crypto?.randomUUID?.()??`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}static portalRoot(s){let t=s.getRootNode();return t.host?t:document.body}static getElementById(s,t){let e=s.getRootNode();return e.getElementById?e.getElementById(t):document.getElementById(t)}static querySelector(s,t){let e=s.getRootNode();return"getElementById"in e&&e.querySelector(t)||document.querySelector(t)}static setAnchorName(s,t,e){let i=s.style.getPropertyValue("anchor-name").split(",").map(n=>n.trim()).filter(n=>n&&n!=="none"&&n!==t);e&&i.push(t),i.length?s.style.setProperty("anchor-name",i.join(", ")):s.style.removeProperty("anchor-name")}static emit(s,t,e,i=!1){return s.dispatchEvent(new CustomEvent(`expressive:${t}`,{bubbles:!0,composed:!0,cancelable:i,detail:e}))}static eventTarget(s){let t=s.composedPath()[0]??s.target;return t instanceof Element?t:null}static plainKey(s){return!(s.altKey||s.ctrlKey||s.metaKey)}static _keyIndex(s,t,e,i){return s==="Home"?0:s==="End"?e-1:t+(i[s]??NaN)}static focusTarget(s,t,e,i=!1){let n=s.filter(l=>!l.matches(':disabled, [aria-disabled="true"], .disabled')),o=n.indexOf(r.eventTarget(t));if(o<0||!r.plainKey(t))return;let a=r._keyIndex(t.key,o,n.length,e);return n[i?(a+n.length)%n.length:a]}static focusIsIn(...s){return s.some(t=>{let e=t&&t.getRootNode().activeElement;return!!e&&t.contains(e)})}static closestInPath(s,t){for(let e of s.composedPath())if(e instanceof Element&&e.matches(t))return e;return null}static getIdFromTrigger(s){return s.dataset.target||(s.getAttribute("href")?.slice(1)??"")}static _placeInOffsetParent(s,t){let{x:e,y:i}=t,n=s.offsetParent;if(n&&(n!==document.body||getComputedStyle(n).position!=="static")){let o=n.getBoundingClientRect(),a=n===document.scrollingElement;e-=o.left+window.scrollX+n.clientLeft-(a?0:n.scrollLeft),i-=o.top+window.scrollY+n.clientTop-(a?0:n.scrollTop)}s.style.top=i+"px",s.style.left=e+"px"}static _repositionWithinScreen(s,t,e,i,n,o,a){let l=n+(a==="right"?-o:o);return{x:window.scrollX+fs(s-window.scrollX,e,window.innerWidth,l),y:window.scrollY+fs(t-window.scrollY,i,window.innerHeight,l)}}};var Me=r=>r&&Object.fromEntries(Object.entries(r).filter(([,s])=>s!==void 0)),b=class{constructor(s,t){s instanceof HTMLElement||console.error(Error(s+" is not an HTML Element")),new.target.getInstance(s)?.destroy(),this.el=s;let e=new.target.defaults,i=Me(t),n=e.i18n?{i18n:{...e.i18n,...Me(i?.i18n??{})}}:{};this.options={...e,...i,...n},this._events=R(s),Reflect.set(s,new.target.key,this)}static init(s,t={}){let e=i=>new this(i,t);return s instanceof Element?e(s):s?Array.from(s,e):null}static get defaults(){return{}}static getInstance(s){return Reflect.get(s,this.key)}_notify(s,t,{args:e=[this.el],detail:i,current:n=()=>!0}={}){let o=()=>this.constructor.getInstance(this.el)===this&&n();return typeof t=="function"&&Reflect.apply(t,this,e),o()?(u.emit(this.el,s,i),o()):!1}destroy(){this._events.abort();let{key:s}=this.constructor;Reflect.get(this.el,s)===this&&Reflect.set(this.el,s,void 0)}};var mr={onOpen:null,onClose:null},Di='article:has(> aside[id]:not([id=""])):not(:has(> aside ~ aside)):has(> button.card-reveal-trigger[type="button"], > :not(aside) button.card-reveal-trigger[type="button"])',Oi="card-reveal-initialized";function fr(r){if(r.getAttribute("aria-label")?.trim())return!0;let t=r.getAttribute("aria-labelledby");if(t&&t.trim().split(/\s+/).map(n=>u.getElementById(r,n)?.textContent??"").join(" ").trim())return!0;let e=r.cloneNode(!0);return e.querySelectorAll('[aria-hidden="true"]').forEach(i=>i.remove()),!!e.textContent?.trim()}function _s(r,s,t){return r.closest("article")===s&&!t.contains(r)&&!r.disabled&&r.getAttribute("aria-disabled")!=="true"&&fr(r)}function Pi(r){if(r.tagName!=="ARTICLE")return!1;let s=r.querySelectorAll(":scope > aside");return s.length!==1||!s[0].id?!1:Array.from(r.querySelectorAll('button.card-reveal-trigger[type="button"]')).some(t=>_s(t,r,s[0]))}var Ue=class Ue extends b{constructor(t,e={}){super(t,e);this.isOpen=!1;this._ownsRevealInitializedClass=!1;this._initialAriaControls=new Map;this._lastActivator=null;this._setupEventHandlers=()=>{let{signal:t}=this._events;this._activators.forEach(e=>e.addEventListener("click",this._handleClickInteraction,{signal:t})),this.el.addEventListener("keydown",this._handleKeydownEvent,{signal:t})};this._handleClickInteraction=t=>{this._lastActivator=t.currentTarget,this._handleRevealEvent()};this._handleKeydownEvent=t=>{(t.target instanceof Element?t.target.closest("article"):null)!==this.el||t.key!=="Escape"||!this.isOpen||(t.preventDefault(),this.close())};this._handleRevealEvent=()=>{this.isOpen?this.close():this.open()};this.open=()=>{this.isOpen||!this.cardReveal||(this.isOpen=!0,this.cardReveal.classList.add("open"),this.cardReveal.inert=!1,this._activators.forEach(t=>t.ariaExpanded="true"),this._notify("open",this.options.onOpen,{current:()=>this.isOpen}))};this.close=()=>{if(!this.isOpen||!this.cardReveal)return;let t=this.el.getRootNode().activeElement,e=this.cardReveal.contains(t);this.isOpen=!1,this.cardReveal.classList.remove("open"),this.cardReveal.inert=!0,this._activators.forEach(i=>i.ariaExpanded="false"),this._notify("close",this.options.onClose,{current:()=>!this.isOpen}),e&&(this._lastActivator??this._activators[0])?.focus()};let i=this.el.querySelectorAll(":scope > aside"),n=i.length===1?i[0]:null,o=n?Array.from(this.el.querySelectorAll('button.card-reveal-trigger[type="button"]')).filter(a=>_s(a,this.el,n)):[];this.cardReveal=n?.id&&o.length>0?n:null,this._activators=this.cardReveal?o:[],this.cardReveal&&(this._ownsRevealInitializedClass=!this.el.classList.contains(Oi),this.el.classList.add(Oi),this._activators.forEach(a=>{this._initialAriaControls.set(a,a.getAttribute("aria-controls")),a.ariaExpanded="false",a.setAttribute("aria-controls",this.cardReveal.id)}),this.cardReveal.classList.remove("open"),this.cardReveal.inert=!0,this._setupEventHandlers())}static get defaults(){return mr}destroy(){this.cardReveal&&(this.cardReveal.classList.remove("open"),this.cardReveal.inert=!1,this._ownsRevealInitializedClass&&this.el.classList.remove(Oi)),this._activators.forEach(t=>{t.removeAttribute("aria-expanded");let e=this._initialAriaControls.get(t);e!==void 0&&w(t,"aria-controls",e)}),this.isOpen=!1,this._activators=[],this._initialAriaControls.clear(),this._lastActivator=null,super.destroy()}static Init(){u.onDocumentReady(()=>{Array.from(document.querySelectorAll(Di)).filter(Pi).forEach(e=>{Ue.getInstance(e)||this.init(e)})})}};Ue.key="Expressive_Cards";var nt=Ue;var _r={onOpen:null,onClose:null},Ri="article.expanding-card:has(> dialog.expanding-card-dialog)",et=class extends b{constructor(t,e){super(t,e);this.isOpen=!1;this.closeGeneration=0;this._initialTrigger={};this._setupEventHandlers=()=>{let{signal:t}=this._events;this.trigger?.addEventListener("click",this.open,{signal:t}),this.trigger?.addEventListener("keypress",this._handleTriggerKeypress,{signal:t}),this.closeButton?.addEventListener("click",this.close,{signal:t}),this.dialog?.addEventListener("cancel",this._handleCancel,{signal:t}),this.dialog?.addEventListener("close",this._handleNativeClose,{signal:t})};this._handleTriggerKeypress=t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),this.open())};this._handleCancel=t=>{t.preventDefault(),this.close()};this._handleNativeClose=()=>{if(this.dialog.open)return;let t=this.isOpen;this._collapse(),t&&this._notify("close",this.options.onClose,{current:()=>!this.isOpen})};this._setTransitionOrigin=()=>{if(!this.dialog)return;let t=this.el.getBoundingClientRect(),i=this.el.querySelector(":scope > figure, :scope > img")?.getBoundingClientRect(),n=(o,a)=>this.dialog.style.setProperty(`--md-comp-expanding-card-from-${o}`,`${Math.max(0,a)}px`);n("top",t.top),n("right",window.innerWidth-t.right),n("bottom",window.innerHeight-t.bottom),n("left",t.left),n("media-height",i?.height??0)};this.open=()=>{this.isOpen||!this.dialog||!this.trigger||(this.closeGeneration++,this._setTransitionOrigin(),this.isOpen=!0,this.trigger.ariaExpanded="true",this.dialog.showModal(),this.dialog.offsetWidth,this.dialog.classList.add("expanded"),this.closeButton?.focus(),this._notify("open",this.options.onOpen,{current:()=>this.isOpen}))};this.close=()=>{if(!this.isOpen||!this.dialog||!this.trigger)return;this._setTransitionOrigin(),this._collapse();let t=this.closeGeneration;this._notify("close",this.options.onClose,{current:()=>!this.isOpen});let e=()=>{t!==this.closeGeneration||this.isOpen||!this.dialog.open||(this.dialog.close(),this.dialog.isConnected&&this.trigger.isConnected&&this.trigger.focus())},n=window.matchMedia("(prefers-reduced-motion: reduce)").matches?[]:(this.dialog.getAnimations?.()??[]).filter(o=>o.transitionProperty==="clip-path");n.length===0?e():Promise.allSettled(n.map(o=>o.finished)).then(e)};if(this.dialog=this.el.querySelector(":scope > dialog.expanding-card-dialog"),this.trigger=this.el.querySelector(":scope > .expanding-card-trigger, :scope > figure > .expanding-card-trigger"),this.closeButton=this.dialog?.querySelector(".expanding-card-close")??null,this.trigger&&this.dialog){for(let i of["aria-expanded","aria-controls","tabindex","role"])this._initialTrigger[i]=this.trigger.getAttribute(i);this.trigger.ariaExpanded="false",this.dialog.id&&this.trigger.setAttribute("aria-controls",this.dialog.id),this.trigger.matches("a[href], button, input, select, textarea")||(this.trigger.tabIndex=0,this.trigger.setAttribute("role","button")),this._setupEventHandlers()}}static get defaults(){return _r}destroy(){this._events.abort(),this._collapse(),this.dialog?.open&&this.dialog.close();for(let[t,e]of Object.entries(this._initialTrigger))w(this.trigger,t,e);super.destroy()}_collapse(){this.closeGeneration++,this.isOpen=!1,this.trigger&&(this.trigger.ariaExpanded="false"),this.dialog?.classList.remove("expanded")}static Init(){u.onDocumentReady(()=>{document.querySelectorAll(Ri).forEach(t=>{this.getInstance(t)===void 0&&this.init(t)})})}};et.key="Expressive_ExpandingCard";function je(r,s){if(r)try{let t=new URL(r,s);if(/^(?:https?:|blob:|data:image\/(?:avif|bmp|gif|jpeg|png|svg\+xml|webp|x-icon)(?:;|,))/i.test(t.href))return t.href}catch{}}var gs=r=>r.parentElement??(r.getRootNode().host||null),gr={translate:/^(none|0px( 0px){0,2})$/,rotate:/^(none|(\S+ )*0deg)$/,scale:/^(none|1( 1){0,2})$/};function vr(r){for(let s=gs(r);s;s=gs(s)){let t=getComputedStyle(s);if(!new DOMMatrixReadOnly(t.transform).isIdentity||Object.entries(gr).some(([e,i])=>!i.test(t.getPropertyValue(e))))return!0}return!1}function br(r){let s=[];for(let t=r.getRootNode();"host"in t;t=t.host.getRootNode())s.push(t);return s}function Er(r,s,t){let e=r.getBoundingClientRect();return{left:window.innerWidth-(e.left+s.width),right:e.right-s.width,top:window.innerHeight-(e.top+s.height+t),bottom:e.bottom-(s.height+t)}}var yr={ArrowUp:-1,ArrowDown:1},vs=':scope > li, :scope > li > ul[role="group"] > li',Tr=typeof CSS<"u"&&!!CSS.supports?.("anchor-name: --a"),Lr=["position","inset","max-height","position-anchor","position-area","position-try-fallbacks"],bs=112,xr=280,wr={alignment:"left",autoFocus:!0,constrainWidth:!0,container:null,coverTrigger:!1,placement:"bottom",closeOnClick:!0,hover:!1,contextMenu:!1,inDuration:150,outDuration:250,onOpenStart:null,onOpenEnd:null,onCloseStart:null,onCloseEnd:null,onItemClick:null},Ye=" ",U=class U extends b{constructor(t,e){super(t,{contextMenu:t.hasAttribute("data-context-menu"),...e});this._pendingTimers=new Set;this._transition=0;this._menuClickTargets=new WeakMap;this._spaceActivation=!1;this._openedByHover=!1;this._contextPoint=null;this._contextReturn=null;this._originalAttributes=new Map;this._originalPlace={parent:null,next:null};this._handleContextMenu=t=>{if(t.defaultPrevented){this.close();return}let e=t.composedPath();if(U._menus.some(o=>o!==this&&o.isOpen&&e.includes(o.menuEl)))return;if(t.preventDefault(),!this.isOpen){let o=this.el.getRootNode();this._contextReturn=o.activeElement instanceof HTMLElement?o.activeElement:null}let i=this.el.getBoundingClientRect(),n=(t.clientX!==0||t.clientY!==0)&&t.clientX>=i.left&&t.clientX<=i.right&&t.clientY>=i.top&&t.clientY<=i.bottom;this._contextPoint=n?{x:t.clientX,y:t.clientY}:null,this.isOpen?this.recalculateDimensions():this.open()};this._handleDocumentContextMenu=t=>{let e=t.composedPath();if(e.includes(this.menuEl)){t.preventDefault();return}e.includes(this.el)||this.close()};this._handleClick=t=>{t.preventDefault(),this.isOpen?this.close():this.open()};this._handleMouseEnter=()=>{this.isOpen||(this._openedByHover=!0,this.open())};this._handleMouseLeave=t=>{let e=t.relatedTarget;e&&(this.menuEl?.contains(e)||U._inOpenTrigger(e))||this.close()};this._handleDocumentClick=t=>{let e=t.composedPath(),i=this._menuClickTargets.get(t);if(this._menuClickTargets.delete(t),!i&&!this.options.contextMenu&&e.includes(this.el)){this.isTouchMoving=!1;return}let n=i??(e[0]||t.target),o=!!i||e.includes(this.menuEl)||this.menuEl?.contains(n);this._isSubmenuTriggerClick(n)||(o&&this._closesOnClick(n)?this.close():o||this._schedule(()=>this.close(),0),this.isTouchMoving=!1)};this._handleDocumentKeydown=t=>{t.key!=="Escape"||!this._openedByHover||(u.focusIsIn(this.el)&&t.preventDefault(),this.close())};this._handleTriggerKeydown=t=>{if(this.options.contextMenu)return;if(t.key==="Escape"&&this.isOpen&&u.plainKey(t)&&!u.isComposing(t)){t.preventDefault(),this.close();return}[Ye,"Enter","ArrowDown","ArrowUp"].includes(t.key)&&(this.isOpen?this._openedByHover&&(t.preventDefault(),this._openedByHover=!1,this._focusInitialItem()):(t.preventDefault(),this.open()))};this._handleMenuPointerdown=()=>{this.isTouchMoving=!1};this._handleDocumentTouchmove=t=>{let e=t.target;(t.composedPath().includes(this.menuEl)||this.menuEl?.contains(e))&&(this.isTouchMoving=!0)};this._handleMenuClick=t=>{let e=t.target;this._menuClickTargets.set(t,e);let i=e.closest("li");if(i?.matches('.disabled, [aria-disabled="true"], .divider, .gap, .label, .optgroup')){t.preventDefault(),t.stopPropagation();return}if(i&&this._isSubmenuTriggerClick(e)){t.preventDefault(),t.stopPropagation(),this._toggleSubmenu(i);return}i&&this._activateItem(i)};this._handleSubmenuAlign=t=>{let e=t.target;if(!(e instanceof Element))return;let i=e.closest("li");i?.querySelector(":scope > menu")&&this.menuEl?.contains(i)&&this._alignSubmenu(i)};this._handleMenuKeydown=t=>{if(!this.isOpen||!u.plainKey(t)||u.isComposing(t))return;let e=this._containingSubmenu(t)??this.menuEl,i=getComputedStyle(e).direction==="rtl",n=i?"ArrowLeft":"ArrowRight",o=i?"ArrowRight":"ArrowLeft";if([n,o,"ArrowUp","ArrowDown","Escape","Tab"].includes(t.key)&&(clearTimeout(this.filterTimeout),this._resetFilterQuery()),t.key==="Tab")t.preventDefault(),this.close();else if(t.key===n){let l=this._focusedRow(t);if(l?.querySelector(":scope > menu")&&!l.matches('.disabled, [aria-disabled="true"]')){t.preventDefault(),l.classList.add("open"),this._alignSubmenu(l),this._syncSubmenuAria(l,!0);let c=Array.from(l.querySelector(":scope > menu").children).find(h=>h instanceof HTMLElement&&h.tabIndex!==-1);c&&this._focusRow(c)}}else if(t.key===o){let l=this._containingSubmenu(t);if(l){t.preventDefault();let c=l.parentElement;this._closeSubmenu(c),this._focusRow(c)}}else if(this._moveFocus(e,t))t.preventDefault();else if(t.key==="Enter"||t.key===Ye){let l=this._focusedRow(t);if(t.preventDefault(),l?.matches('.disabled, [aria-disabled="true"]'))return;if(l?.querySelector(":scope > menu")){this._toggleSubmenu(l);return}let c=l??this.menuEl.children[this.focusedIndex],h=c?.querySelector(":scope > a, :scope > button");this._spaceActivation=t.key===Ye,h?h.click():c instanceof HTMLElement&&c.click(),this._spaceActivation=!1,this._closeAfterEnter(t,c)}else if(t.key==="Escape"){t.preventDefault();let l=this._containingSubmenu(t)?.parentElement??Array.from(this.menuEl.querySelectorAll("li.open")).reverse()[0];l?(this._closeSubmenu(l),this._focusRow(l)):this.close()}let a=t.key.toLowerCase();if(t.key.length===1&&t.key!==Ye){this.filterQuery.push(a);let l=this.filterQuery.join(""),c=this._rows(e).find(h=>!h.matches('.disabled, [aria-disabled="true"]')&&Array.from(h.childNodes).filter(d=>!(d instanceof Element&&d.matches("menu"))).map(d=>d.textContent).join("").trim().toLowerCase().startsWith(l));c&&this._focusRow(c),clearTimeout(this.filterTimeout),this.filterTimeout=setTimeout(this._resetFilterQuery,1e3)}};this._handleWindowResize=()=>{this.el.offsetParent&&this.recalculateDimensions()};this._resetFilterQuery=()=>{this.filterQuery=[]};this._reanchorFrame=0;this._reanchor=t=>{this._reanchorFrame||this.options.contextMenu||this.menuEl.contains(t.target)||(this._reanchorFrame=requestAnimationFrame(()=>{if(this._reanchorFrame=0,!this.isOpen)return;if(this.menuEl.style.getPropertyValue("position-anchor"))return this._placeAnchored();let{scrollTop:e}=this.menuEl;this.recalculateDimensions(),this.menuEl.scrollTop=e}))};this.open=()=>{if(!this._canOpen)return;let t=this._clearPendingTimers();this.isOpen=!0,this._notify("open",this.options.onOpenStart,{current:()=>t===this._transition})&&(this._resetMenuStyles(),this.menuEl.isConnected&&this.menuEl.showPopover(),this._restoreInert(),this._placeMenu(),this._schedule(()=>this._setupTemporaryEventHandlers(),0),this._animateIn(),this._setExpanded(!0))};this.close=()=>{if(!this.isOpen)return;let t=this._clearPendingTimers(),e=this.menuEl.getRootNode(),i=e.activeElement;if(this.isOpen=!1,this._openedByHover=!1,this.menuEl.setAttribute("inert",""),clearTimeout(this.filterTimeout),this._resetFilterQuery(),this.focusedIndex=-1,this._clearActive(),this._closeSubmenus(),!!this._notify("close",this.options.onCloseStart,{current:()=>t===this._transition})){if(this._animateOut(),this._openEvents?.abort(),this._setExpanded(!1),this.options.autoFocus&&this.menuEl.contains(i)&&(e.activeElement===i||this.el.ownerDocument.activeElement===this.el.ownerDocument.body)){let n=this._contextReturn;(n?.isConnected&&n!==this.el.ownerDocument.body?n:this.el).focus()}this._contextReturn=null,this._contextPoint=null}};this.recalculateDimensions=()=>{this.isOpen&&(this._resetMenuPositioningStyles(),this._placeMenu())};if(U._menus.push(this),this.id=u.getIdFromTrigger(t),this.menuEl=u.getElementById(t,this.id),this.isOpen=!1,this.isScrollable=!1,this.isTouchMoving=!1,this.focusedIndex=-1,this.filterQuery=[],this.options.contextMenu||(this._setAttribute(this.el,"aria-expanded","false"),this.el.hasAttribute("aria-haspopup")||this._setAttribute(this.el,"aria-haspopup","menu"),this.id&&!this.el.hasAttribute("aria-controls")&&this._setAttribute(this.el,"aria-controls",this.id)),!this.menuEl){console.warn(`Menu skipped: no element matches target "${this.id}".`,t);return}this._originalInert=this.menuEl.getAttribute("inert"),this._moveMenuToElement(),this._setupAccessibility(),this._makeMenuFocusable(),this._setupSubmenus(),this._setupEventHandlers()}static get defaults(){return wr}destroy(){this._clearPendingTimers(),this.isOpen=!1,this._setExpanded(!1),this.menuEl&&u.setAnchorName(this.el,`--menu-${this.menuEl.id}`,!1),clearTimeout(this.filterTimeout),this._resetMenuStyles(),this._restoreInert(),this._restoreSetup(),this._events.abort(),this._openEvents?.abort();let t=U._menus.indexOf(this);t>=0&&U._menus.splice(t,1),super.destroy()}_setupEventHandlers(){let{signal:t}=this._events;this.el.addEventListener("keydown",this._handleTriggerKeydown,{signal:t}),this.menuEl?.addEventListener("click",this._handleMenuClick,{signal:t}),this.menuEl?.querySelector(":scope > li > menu")&&this.menuEl.addEventListener("mouseover",this._handleSubmenuAlign,{signal:t}),this.options.contextMenu?this.el.addEventListener("contextmenu",this._handleContextMenu,{signal:t}):this.options.hover?(this.el.addEventListener("mouseenter",this._handleMouseEnter,{signal:t}),this.el.addEventListener("mouseleave",this._handleMouseLeave,{signal:t}),this.menuEl.addEventListener("mouseleave",this._handleMouseLeave,{signal:t})):this.el.addEventListener("click",this._handleClick,{signal:t})}_setupTemporaryEventHandlers(){this._openEvents?.abort(),this._openEvents=R(this.el);let{signal:t}=this._openEvents,e={passive:!0,signal:t};document.addEventListener("click",this._handleDocumentClick,{signal:t}),this.menuEl?.addEventListener("pointerdown",this._handleMenuPointerdown,e),this.menuEl?.addEventListener("touchmove",this._handleDocumentTouchmove,e),document.addEventListener("touchmove",this._handleDocumentTouchmove,e),this.menuEl?.addEventListener("keydown",this._handleMenuKeydown,{signal:t}),document.addEventListener("keydown",this._handleDocumentKeydown,{signal:t}),window.addEventListener("resize",this._handleWindowResize,{signal:t});for(let i of[window,...br(this.el)])i.addEventListener("scroll",this._reanchor,{capture:!0,passive:!0,signal:t});this.options.contextMenu&&document.addEventListener("contextmenu",this._handleDocumentContextMenu,{signal:t})}static _inOpenTrigger(t){let e=t.closest(".menu-trigger");return!!(e&&U.getInstance(e)?.isOpen)}_activateItem(t){let e=this._toggleChecked(t);this._notify("select",this.options.onItemClick,{args:[t],detail:{item:t}})&&e!==null&&this._notify("change",null,{detail:{item:t,checked:e}})}_toggleChecked(t){let e=t.getAttribute("role");if(e==="menuitemradio")return this._checkRadio(t);if(e!=="menuitemcheckbox")return null;let i=t.getAttribute("aria-checked")!=="true";return t.setAttribute("aria-checked",String(i)),i}_checkRadio(t){return t.getAttribute("aria-checked")==="true"?null:(t.parentElement.querySelectorAll(':scope > li[role="menuitemradio"]').forEach(e=>{e.setAttribute("aria-checked",String(e===t))}),!0)}_isCheckboxRow(t){return t?.closest("li")?.getAttribute("role")==="menuitemcheckbox"}_closesOnClick(t){return this.options.closeOnClick&&!this.isTouchMoving&&!this._keepsOpen(t)}_keepsOpen(t){let e=t.closest("li")?.getAttribute("role");return e==="menuitemcheckbox"?!0:this._spaceActivation&&e==="menuitemradio"}_closeAfterEnter(t,e){t.key==="Enter"&&this.options.closeOnClick&&this._isCheckboxRow(e)&&this.close()}_setupAccessibility(){if(!this.menuEl)return;this.menuEl.hasAttribute("role")||this._setAttribute(this.menuEl,"role","menu"),[this.menuEl,...this.menuEl.querySelectorAll("menu")].forEach(e=>{e.hasAttribute("role")||this._setAttribute(e,"role","menu"),e.getAttribute("role")==="menu"&&e.querySelectorAll(vs).forEach(i=>{if(i.classList.contains("divider")){i.hasAttribute("role")||this._setAttribute(i,"role","separator");return}if(i.classList.contains("gap")){this._setAttribute(i,"aria-hidden","true");return}if(i.classList.contains("label")||i.classList.contains("optgroup")){i.hasAttribute("role")||this._setAttribute(i,"role","presentation");return}i.hasAttribute("role")||this._setAttribute(i,"role","menuitem"),i.classList.contains("disabled")&&!i.hasAttribute("aria-disabled")&&this._setAttribute(i,"aria-disabled","true")})})}_isSubmenuTriggerClick(t){if(!this.menuEl)return!1;let e=t.closest("li");if(!e||!this.menuEl.contains(e))return!1;let i=e.querySelector(":scope > menu");return i?!i.contains(t):!1}_setupSubmenus(){this.menuEl?.querySelectorAll("li").forEach(t=>{if(!t.querySelector(":scope > menu"))return;let e=t.querySelector(":scope > a, :scope > button, :scope > span")??t;this._setAttribute(e,"aria-haspopup","menu"),this._setAttribute(e,"aria-expanded","false")})}_toggleSubmenu(t){let e=!t.classList.contains("open");t.parentElement?.querySelectorAll(":scope > li.open").forEach(i=>{i!==t&&this._closeSubmenu(i)}),t.classList.toggle("open",e),e&&this._alignSubmenu(t),this._syncSubmenuAria(t,e)}_syncSubmenuAria(t,e){(t.querySelector(":scope > a, :scope > button, :scope > span")??t).setAttribute("aria-expanded",e?"true":"false")}_alignSubmenu(t){let e=t.querySelector(":scope > menu");if(!e)return;t.classList.remove("submenu-start");let i=e.getBoundingClientRect();(i.left<8||i.right>window.innerWidth-8)&&t.classList.add("submenu-start")}_closeSubmenu(t){t.classList.remove("open","submenu-start"),this._syncSubmenuAria(t,!1)}_closeSubmenus(){this.menuEl?.querySelectorAll("li.open").forEach(t=>this._closeSubmenu(t))}_containingSubmenu(t){let e=t.target;if(!(e instanceof Element))return null;let i=e.closest("li > menu");return i instanceof HTMLElement&&this.menuEl?.contains(i)?i:null}_focusedRow(t){let e=t.target;if(!(e instanceof Element))return null;let i=e.closest("li");return i instanceof HTMLElement&&this.menuEl?.contains(i)?i:null}_restoreInert(){this.menuEl&&w(this.menuEl,"inert",this._originalInert)}_clearActive(){this.menuEl?.querySelectorAll("li.active").forEach(t=>t.classList.remove("active"))}_focusRow(t){this._clearActive(),this.focusedIndex=Array.from(t.parentElement.children).indexOf(t),t.focus({preventScroll:!0}),t.scrollIntoView({block:"nearest",inline:"nearest"})}_resetMenuStyles(){this.menuEl&&(this.menuEl.popover&&this.menuEl.hidePopover(),this._resetMenuPositioningStyles(),this.menuEl.style.transform="",this.menuEl.style.opacity="")}_resetMenuPositioningStyles(){this.menuEl.style.width="",this.menuEl.style.height="",this.menuEl.style.left="",this.menuEl.style.top="",this.menuEl.style.transformOrigin="";for(let t of Lr)this.menuEl.style.removeProperty(t);this._stopReanchoring()}_moveMenuToElement(){this._originalPlace={parent:this.menuEl.parentNode,next:this.menuEl.nextSibling},this.options.container?this.options.container.append(this.menuEl):this.el.after(this.menuEl)}_keepAttribute(t,e){let i=this._originalAttributes.get(t)??new Map;i.has(e)||i.set(e,t.getAttribute(e)),this._originalAttributes.set(t,i)}_setAttribute(t,e,i){this._keepAttribute(t,e),t.setAttribute(e,i)}_restoreSetup(){this._originalAttributes.forEach((i,n)=>i.forEach((o,a)=>w(n,a,o))),this._originalAttributes.clear();let{parent:t,next:e}=this._originalPlace;t?.isConnected&&t.insertBefore(this.menuEl,e?.parentNode===t?e:null)}_makeMenuFocusable(){this.menuEl&&(this._keepAttribute(this.menuEl,"popover"),this.menuEl.popover="manual",this._setAttribute(this.menuEl,"tabindex","-1"),this.menuEl.querySelectorAll(":scope li").forEach(t=>{if(t.matches('.divider, .gap, .label, .optgroup, [role="none"]')){this._setAttribute(t,"tabindex","-1");return}t.getAttribute("tabindex")||this._setAttribute(t,"tabindex","0")}))}_moveFocus(t,e){let i=this._rows(t),n=this._focusedRow(e)??t.children[this.focusedIndex],o=u._keyIndex(e.key,i.indexOf(n),i.length,yr);if(Number.isNaN(o))return!1;let a=i[o];return a&&(this._focusRow(a),a.classList.add("active")),!0}_rows(t){return Array.from(t.querySelectorAll(vs)).filter(e=>e instanceof HTMLElement&&e.tabIndex!==-1)}_focusInitialItem(){if(!this.menuEl||!this.options.autoFocus)return;let t=this._rows(this.menuEl)[0];t&&(this._clearActive(),this.focusedIndex=Array.from(t.parentElement.children).indexOf(t),t.focus({preventScroll:!0}))}_focusFocusedItem(){this.focusedIndex>=0&&this.focusedIndex<this.menuEl.children.length&&this.options.autoFocus&&(this.menuEl.children[this.focusedIndex].focus({preventScroll:!0}),this.menuEl.children[this.focusedIndex].scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"}))}_opensUp(t){return t.top<0||this.options.placement==="top"&&t.bottom>=0}_getMenuPosition(){let t=this.el.getBoundingClientRect(),e=this.menuEl.getBoundingClientRect(),i=e.height,n=e.width,o=t.left-e.left,a=t.top-e.top,l=Er(this.el,e,this.options.coverTrigger?0:t.height),c="top",h=this.options.alignment;if(a+=this.options.coverTrigger?0:t.height,this.isScrollable=!1,this._opensUp(l)&&(l.bottom>=0?(c="bottom",this.options.coverTrigger||(a-=t.height)):(this.isScrollable=!0,i-=20,l.bottom>l.top?(c="bottom",i+=l.bottom,a-=this.options.coverTrigger?l.bottom-20:l.bottom-20+t.height):i+=l.top)),l[h]<0){let d=h==="left"?"right":"left";l[d]>=0?h=d:l.right>l.left?(h="right",n+=l.right,o-=l.right):(h="left",n+=l.left)}return c==="bottom"&&(a=a-e.height+(this.options.coverTrigger?t.height:0)),h==="right"&&(o=o-e.width+t.width),{x:o,y:a,verticalAlignment:c,horizontalAlignment:h,height:i,width:n}}_schedule(t,e){let i=setTimeout(()=>{this._pendingTimers.delete(i),t()},e);this._pendingTimers.add(i)}_clearPendingTimers(){for(let t of this._pendingTimers)clearTimeout(t);return this._pendingTimers.clear(),++this._transition}_animateIn(){let t=this._transition,e=!this._openedByHover,i=this.options.inDuration;this.menuEl.style.transition="none",this.menuEl.style.opacity="0",this.menuEl.style.transform="scale(0.85)",this._schedule(()=>{this.menuEl.style.transition=`opacity ${i}ms ease, transform ${i}ms ease`,this.menuEl.style.opacity="1",this.menuEl.style.transform="scale(1)"},1),this._schedule(()=>{e&&this._focusInitialItem(),t===this._transition&&this._notify("opened",this.options.onOpenEnd,{current:()=>t===this._transition})},i)}_animateOut(){let t=this._transition,e=this.options.outDuration;this.menuEl.style.transition=`opacity ${e}ms ease, transform ${e}ms ease`,this.menuEl.style.opacity="0",this.menuEl.style.transform="scale(0.85)",this._schedule(()=>{this._resetMenuStyles(),this._notify("closed",this.options.onCloseEnd,{current:()=>t===this._transition})},e)}_placeMenu(){let t=this.menuEl.getBoundingClientRect().width,e=this.el.getBoundingClientRect().width,i=this.options.constrainWidth&&!this.options.contextMenu&&e>=bs?e:Math.min(xr,Math.max(bs,t));if(this.menuEl.style.width=i+"px",this.options.contextMenu){this._placeMenuAtPoint(this._contextPoint??this._regionCorner());return}Tr&&!this.options.coverTrigger&&!vr(this.el)?this._anchorMenu():this._placeByCoordinates()}_side(){let t=this.el.getBoundingClientRect(),e={top:t.top,bottom:window.innerHeight-t.bottom},[i,n]=this.options.placement==="top"?["top","bottom"]:["bottom","top"];return e[i]>=this.menuEl.scrollHeight||e[i]>=e[n]?i:n}_anchorMenu(){let t=`--menu-${this.menuEl.id}`;u.setAnchorName(this.el,t,!0);let e=this.menuEl.style;e.position="fixed",e.inset="auto",e.maxHeight="100%",e.setProperty("position-anchor",t),this._placeAnchored()}_stopReanchoring(){cancelAnimationFrame(this._reanchorFrame),this._reanchorFrame=0}_placeAnchored(){let t=this.menuEl.style,[e,i]=[this._side(),this.options.alignment==="right"?"left":"right"];t.setProperty("position-area",`${e} span-${i}`),t.setProperty("position-try-fallbacks","flip-block, flip-inline, flip-block flip-inline"),t.transformOrigin=`${i==="left"?"100%":"0"} ${e==="top"?"100%":"0"}`,this.isScrollable=this.menuEl.scrollHeight>this.menuEl.clientHeight}_placeByCoordinates(){let t=this._getMenuPosition();this.menuEl.style.left=t.x+"px",this.menuEl.style.top=t.y+"px",this.menuEl.style.height=t.height+"px",this.menuEl.style.width=t.width+"px",this.menuEl.style.transformOrigin=`${t.horizontalAlignment==="left"?"0":"100%"} ${t.verticalAlignment==="top"?"0":"100%"}`}_regionCorner(){let t=this.el.getBoundingClientRect();return{x:getComputedStyle(this.el).direction==="rtl"?t.right:t.left,y:t.bottom}}_placeMenuAtPoint({x:t,y:e}){let{transform:i,transition:n}=this.menuEl.style;this.menuEl.style.transition="none",this.menuEl.style.transform="none";let o=this.menuEl.getBoundingClientRect();this.menuEl.style.transform=i,this.menuEl.style.transition=n;let a={left:0,top:0,right:window.innerWidth,bottom:window.innerHeight},l=o.width,c=Math.min(o.height,a.bottom-a.top);this.isScrollable=c<o.height,this.isScrollable&&(this.menuEl.style.height=c+"px");let h=getComputedStyle(this.el).direction==="rtl",d=t+l<=a.right,p=t-l>=a.left,_=h?p||!d:!d&&p,m=e+c>a.bottom&&e-c>=a.top,E=(g,L,S)=>Math.max(L,Math.min(g,S)),T=E(_?t-l:t,a.left,a.right-l),C=E(m?e-c:e,a.top,a.bottom-c);this.menuEl.style.left=T-o.left+"px",this.menuEl.style.top=C-o.top+"px",this.menuEl.style.transformOrigin=`${_?"100%":"0"} ${m?"100%":"0"}`}_setExpanded(t){this.options.contextMenu||(this.el.ariaExpanded=String(t))}get _canOpen(){return!this.isOpen&&!!this.menuEl&&U.getInstance(this.el)===this}};U._menus=[],U.key="Expressive_Menu";var $=U;var Mr=r=>(r.key==="ArrowUp"||r.key==="ArrowDown")&&u.plainKey(r),Cr={i18n:{loading:"Loading results.",noResults:"No results.",results:r=>`${r} ${r===1?"result":"results"} available.`,selected:r=>`${r} ${r===1?"item":"items"} selected.`,create:r=>`Add "${r}"`},data:[],onAutocomplete:null,menuOptions:{autoFocus:!1,closeOnClick:!1,coverTrigger:!1},minLength:1,searchDelay:0,allowCreate:!1,onCreate:null,isMultiSelect:!1,onSearch:(r,s)=>{let t=r.toLocaleLowerCase();s.setMenuItems(s.options.data.filter(e=>e.id.toString().toLocaleLowerCase().includes(t)||e.text?.toLocaleLowerCase().includes(t)))},maxMenuHeight:"300px",maxResults:1/0,allowUnsafeHTML:!1,selected:[]},j=class j extends b{constructor(t,e){super(t,e);this._left=!0;this._selection=0;this._noResults=!1;this._handleReset=()=>{this._cancelPendingSearch(),this._searchAbort?.abort(),this._selection++,this.selectedValues=[...this._startingSelection],this.options.isMultiSelect||this._refreshInputText(),this._updateSelectedInfo(),this._resetAutocomplete(),this.close()};this._handleInputBlur=()=>{this._pointerDown||(this._left=!0,this._cancelPendingSearch(),this.close(),this._resetAutocomplete())};this._handleInput=()=>{this._left=!1,this.count=0;let t=this.el.value.toLocaleLowerCase();this.oldVal!==t&&(this._resetCurrentElementPosition(),this._noResults=!1,this.el.matches(":focus-visible")&&(!this.menu.isOpen||t.length<this.options.minLength)&&this.open()),this._inputChangeDetection(t,!0)};this._handleInputFocus=()=>{this._left=!1,this.count=0;let t=this.el.value.toLocaleLowerCase();this._inputChangeDetection(t)};this._inputChangeDetection=(t,e)=>{let i=!this.options.isMultiSelect&&this.selectedValues.length>0&&this.el.value!==(this.selectedValues[0].text||String(this.selectedValues[0].id));i&&(this.selectedValues=[]),this.oldVal!==t&&(this._noResults=!1,this._startSearch(e)),i&&this._triggerChanged(),this.oldVal=t};this._handleInputKeydown=u.ignoringComposition(t=>{if(t.key==="Escape"||t.key==="Tab"){this._dismiss(t);return}let e=this._options(),i=e.length;if(t.key==="Enter"&&this.activeIndex>=0){let n=e[this.activeIndex];n&&(this._choose(n),t.preventDefault());return}if(Mr(t)){if(t.preventDefault(),!this.menu.isOpen&&this._openTimer===void 0){this.open();return}t.key==="ArrowUp"&&this.activeIndex>0&&this.activeIndex--,t.key==="ArrowDown"&&this.activeIndex<i-1&&this.activeIndex++,this._setActive(null),this.activeIndex>=0&&(this._setActive(e[this.activeIndex]),e[this.activeIndex].scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"}))}});this._handleInputClick=()=>{this.open()};this._handleContainerPointerDown=t=>{if(!t.isPrimary||t.pointerType==="mouse"&&t.button!==0)return;this._pointerDown=!0;let e={capture:!0,once:!0,signal:this._events.signal};this.el.ownerDocument.addEventListener("pointerup",this._handleContainerPointerUp,e),this.el.ownerDocument.addEventListener("pointercancel",this._handleContainerPointerUp,e)};this._handleContainerPointerUp=()=>{this._pointerDown=!1};this._handleInertRowPress=t=>{!(t.target instanceof Element)||!t.target.closest('.autocomplete-no-results, .autocomplete-group-label, [aria-disabled="true"]')||(t.preventDefault(),t.stopPropagation())};this.open=()=>{let t=this.el.value.toLocaleLowerCase();this._resetAutocomplete(),t.length>=this.options.minLength&&(this._renderMenu(),this._announce(this._resultsMessage())),this.menu.isOpen?this.menu.recalculateDimensions():(this._openTimer!==void 0&&clearTimeout(this._openTimer),this._openTimer=setTimeout(()=>{this._openTimer=void 0,this.menu.open()},0))};this.close=()=>{this._announcer&&(this._announcer.textContent=""),this._openTimer!==void 0&&(clearTimeout(this._openTimer),this._openTimer=void 0),this.isOpen=!1,this.menu.close()};this.isOpen=!1,this.count=0,this.activeIndex=-1,this.oldVal="";let i=new Map;this.options.data.forEach(n=>i.has(n.id)||i.set(n.id,n)),this.selectedValues=this.options.selected.map(n=>i.get(n)??{id:n}),this.menuItems=this.options.data||[],this.$active=null,this._pointerDown=!1,this._setupMenu(),this._startingSelection=[...this.selectedValues],this._setupEventHandlers()}_setActive(t){this.$active?.classList.remove("active"),this.$active=t,t?(t.classList.add("active"),this.el.setAttribute("aria-activedescendant",t.id)):this.el.removeAttribute("aria-activedescendant")}static get defaults(){return Cr}static _loadingIndicator(){if(!j._loadingTemplate){let t=document.createElement("template");t.innerHTML=`<div style="height:100%;width:50px;"><svg version="1.1" id="L4" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 100 100" enable-background="new 0 0 0 0" xml:space="preserve">
|
|
2
2
|
<circle fill="#888c" stroke="none" cx="6" cy="50" r="6"><animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.1"/></circle>
|
|
3
3
|
<circle fill="#888c" stroke="none" cx="26" cy="50" r="6"><animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.2"/></circle>
|
|
4
4
|
<circle fill="#888c" stroke="none" cx="46" cy="50" r="6"><animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.3"/></circle>
|
|
5
|
-
</svg></div>`,K._loadingTemplate=t.content.firstElementChild}return K._loadingTemplate.cloneNode(!0)}destroy(){this._openTimer!==void 0&&(clearTimeout(this._openTimer),this._openTimer=void 0),this._cancelPendingSearch(),this._searchAbort?.abort(),this._events.abort(),this.menu.destroy(),this.isOpen=!1,this._removeMenu();for(let t of["role","aria-autocomplete","aria-controls","data-target","aria-haspopup","aria-expanded","aria-activedescendant"])this.el.removeAttribute(t);this._statusInfo.remove(),this._announcer.remove(),super.destroy()}_setupEventHandlers(){let{signal:t}=this._events;this.el.addEventListener("blur",this._handleInputBlur,{signal:t}),this.el.addEventListener("input",this._handleInput,{signal:t}),this.el.addEventListener("keyup",this._handleInputKeyup,{signal:t}),this.el.addEventListener("focus",this._handleInputFocus,{signal:t}),this.el.addEventListener("keydown",this._handleInputKeydown,{signal:t}),this.el.addEventListener("click",this._handleInputClick,{signal:t}),this.container.addEventListener("pointerdown",this._handleContainerPointerDown,{signal:t}),this.container.addEventListener("pointerup",this._handleContainerPointerUp,{signal:t}),this.container.addEventListener("pointercancel",this._handleContainerPointerUp,{signal:t}),this.container.addEventListener("mousedown",this._handleInertRowPress,{capture:!0,signal:t}),this.container.addEventListener("click",this._handleInertRowPress,{capture:!0,signal:t})}_setupMenu(){this.container=document.createElement("menu"),this.container.style.maxHeight=this.options.maxMenuHeight,this.container.id=`autocomplete-options-${u.guid()}`,this.container.classList.add("autocomplete-content"),this.container.ariaExpanded="true",this.container.setAttribute("role","listbox"),this.el.setAttribute("role","combobox"),this.el.setAttribute("aria-autocomplete","list"),this.el.setAttribute("aria-controls",this.container.id),this.el.setAttribute("data-target",this.container.id),this.menuItems.forEach(l=>{let c=this._createMenuItem(l);this.container.append(c)}),this.el.parentElement.appendChild(this.container);let t={...K.defaults.menuOptions,...this.options.menuOptions},e=t.onOpenStart,i=t.onCloseStart;t.onOpenStart=l=>{this.isOpen=!0,typeof e=="function"&&e.call(this.menu,l)},t.onCloseStart=l=>{this.isOpen=!1,typeof i=="function"&&i.call(this.menu,l)};let n=t.onItemClick;t.onItemClick=l=>{l&&(this._choose(l),typeof n=="function"&&n.call(this.menu,l))},this.menu=B.init(this.el,t),this.el.setAttribute("aria-haspopup","listbox");let o=this.el.parentElement.querySelector("label");o&&this.el.after(o),this.el.removeEventListener("click",this.menu._handleClick),this.el.removeEventListener("keydown",this.menu._handleTriggerKeydown),this.options.isMultiSelect||this._refreshInputText(),this.el.value&&this.selectOption(this.el.value);let a=document.createElement("div");a.classList.add("status-info"),a.setAttribute("aria-hidden","true"),a.setAttribute("style","position: absolute;right:0;top:0;"),this.el.parentElement.appendChild(a),this._statusInfo=a,this._announcer=document.createElement("div"),this._announcer.classList.add("autocomplete-status"),this._announcer.setAttribute("role","status"),this._announcer.setAttribute("aria-live","polite"),this._announcer.setAttribute("aria-atomic","true"),this.el.parentElement.appendChild(this._announcer),this._updateSelectedInfo()}_removeMenu(){this.container.ariaExpanded="false",this.container.parentNode.removeChild(this.container)}_queueSearch(t){this._cancelPendingSearch();let e=this.options.searchDelay;if(!t||!(e>0&&e<1/0))return this._search(this.el.value);this._searchAbort?.abort(),this._searchTimer=setTimeout(()=>{this._searchTimer=void 0,this._search(this.el.value)},e)}_cancelPendingSearch(){clearTimeout(this._searchTimer),this._searchTimer=void 0}_search(t){this._searchAbort?.abort(),this._searchAbort=new AbortController,this.options.onSearch(t,this,this._searchAbort.signal)}_dismiss(t){t.key==="Escape"&&((this.menu.isOpen||this._openTimer!==void 0)&&t.preventDefault(),this._left=!0),this.close(),this._resetCurrentElementPosition()}_options(){return this.container.querySelectorAll('li[role="option"]:not([aria-disabled="true"])')}_resetCurrentElementPosition(){this.activeIndex=-1,this._setActive(null)}_resetAutocomplete(){this.container.replaceChildren(),this._resetCurrentElementPosition(),this.oldVal=null,this._pointerDown=!1}_highlightPartialText(t,e){let i=e.toLocaleLowerCase().indexOf(t.toLocaleLowerCase()),n=i+t.length-1;return i==-1||n==-1?[e,"",""]:[e.slice(0,i),e.slice(i,n+1),e.slice(n+1)]}_createMenuItem(t){let e=document.createElement("li");e.id=`autocomplete-option-${u.guid()}`,e.setAttribute("role","option");let i=this.selectedValues.some(l=>l.id===t.id);if(e.setAttribute("aria-selected",i?"true":"false"),e.setAttribute("data-id",t.id),K._markDisabled(e,t),e.setAttribute("style","display:grid; grid-auto-flow: column; user-select: none; align-items: center;"),e.tabIndex=-1,this.options.isMultiSelect){let l=document.createElement("div");l.classList.add("item-selection"),l.style.textAlign="center";let c=document.createElement("input");c.type="checkbox",c.tabIndex=-1,c.checked=i,c.disabled=t.disabled===!0;let h=document.createElement("span");h.style.paddingLeft="21px",l.append(c,h),e.appendChild(l)}if(t.image){let l=document.createElement("img");l.classList.add("circle"),l.src=t.image,e.appendChild(l)}let n=this._createLabel(t),o=document.createElement("div");if(o.classList.add("item-text"),o.setAttribute("style","padding:5px;overflow:hidden;"),e.appendChild(o),o.appendChild(n),typeof t.description=="string"||typeof t.description=="number"&&!isNaN(t.description)){let l=document.createElement("small");l.setAttribute("style","line-height:1.3;color:grey;white-space:nowrap;text-overflow:ellipsis;display:block;width:90%;overflow:hidden;"),l.innerText=t.description,o.appendChild(l)}let a=()=>this.options.isMultiSelect?t.image?"40px min-content auto":"40px auto":t.image?"min-content auto":"auto";return e.style.gridTemplateColumns=a(),e}static _markDisabled(t,e){e.disabled===!0&&t.setAttribute("aria-disabled","true")}_createLabel(t){let e=this.el.value.toLocaleLowerCase(),i=(t.text||t.id).toString(),n=document.createElement("div");return n.setAttribute("style","line-height:1.2;font-weight:500;"),this.options.allowUnsafeHTML&&t.text?this._highlightHTML(n,i,e):this._highlightText(n,this._highlightPartialText(e,i)),n}_highlightHTML(t,e,i){t.innerHTML=e;let n=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(let o=n.nextNode();o;o=n.nextNode()){let[a,l]=this._highlightPartialText(i,o.data);if(!l)continue;let c=o.splitText(a.length);c.splitText(l.length);let h=document.createElement("span");h.classList.add("highlight"),c.replaceWith(h),h.append(c);break}}_highlightText(t,e){if(t.appendChild(document.createTextNode(e[0])),e[1]){let i=document.createElement("span");i.textContent=e[1],i.classList.add("highlight"),t.appendChild(i),t.appendChild(document.createTextNode(e[2]))}}_renderMenu(){this._resetAutocomplete(),this._noResults&&this.container.append(this._createNoResultsRow()),this.menuItems.length===0&&(this.menuItems=this.selectedValues);let t=new Map;this.menuItems.forEach(i=>this._groupList(i.group,t).append(this._createMenuItem(i)));let e=this._createText();e&&this.container.append(this._createRow(e))}_groupList(t,e){return t?(e.has(t)||e.set(t,this._createGroup(t)),e.get(t)):this.container}_createGroup(t){let e=document.createElement("li");e.id=`autocomplete-group-${u.guid()}`,e.setAttribute("role","presentation"),e.classList.add("label","autocomplete-group-label"),e.textContent=t;let i=document.createElement("ul");i.setAttribute("role","group"),i.setAttribute("aria-labelledby",e.id),i.append(e);let n=document.createElement("li");return n.setAttribute("role","none"),n.append(i),this.container.append(n),i}_createText(){let t=this.el.value.trim();if(!this.options.allowCreate||t.length<this.options.minLength)return"";let e=t.toLocaleLowerCase();return this.menuItems.some(i=>(i.text||String(i.id)).toLocaleLowerCase()===e)?"":t}_createRow(t){let e=document.createElement("li");e.id=`autocomplete-option-${u.guid()}`,e.setAttribute("role","option"),e.setAttribute("aria-selected","false"),e.setAttribute("data-create",t),e.classList.add("autocomplete-create"),e.setAttribute("style","display:grid; user-select: none; align-items: center;"),e.tabIndex=-1;let i=document.createElement("div");return i.classList.add("item-text"),i.setAttribute("style","padding:5px;overflow:hidden;line-height:1.2;font-weight:500;"),i.textContent=this.options.i18n.create(t),e.append(i),e}_createNoResultsRow(){let t=document.createElement("li");return t.classList.add("autocomplete-no-results"),t.setAttribute("role","none"),t.setAttribute("aria-hidden","true"),t.textContent=this.options.i18n.noResults,t}_setStatusLoading(){let t=this._statusInfo;t&&t.replaceChildren(K._loadingIndicator()),this._announce(this.options.i18n.loading)}_announce(t){if(!this._announcer)return;let e=this.el.matches(":focus")&&this.el.value.length>=this.options.minLength?t:"";this._announcer.textContent!==e&&(this._announcer.textContent=e)}_resultsMessage(){let t=this.menuItems.filter(e=>e.disabled!==!0).length;return t?this.options.i18n.results(t):this.options.i18n.noResults}_updateSelectedInfo(){let t=this._statusInfo;t&&(this.options.isMultiSelect?t.textContent=this.selectedValues.length.toString():t.replaceChildren())}_refreshInputText(){if(this.selectedValues.length===1){let t=this.selectedValues[0];this.el.value=t.text||t.id}}_triggerChanged(){let t=this.selectedValues,e=++this._selection;this.el.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0,composed:!0})),e===this._selection&&this._notify("autocomplete",this.options.onAutocomplete,{args:[t],detail:{values:t},current:()=>e===this._selection})}setMenuItems(t,e=null,i=!0){this.el.Expressive_Autocomplete===this&&(i&&(i=!this._left),this._noResults=t.length===0,this.menuItems=t,e&&(this.selectedValues=this.menuItems.filter(n=>e.indexOf(n.id)!==-1)),this.options.isMultiSelect?i||this._renderMenu():this._refreshInputText(),i&&this.open(),this._updateSelectedInfo(),this._announce(i?this._resultsMessage():""),e&&this._triggerChanged())}_toggleOption(t){let e=!this.selectedValues.some(n=>n.id===t.id);e?this.selectedValues.push(t):this.selectedValues=this.selectedValues.filter(n=>n.id!==t.id);let i=Array.from(this.container.querySelectorAll("li[data-id]")).find(n=>n.getAttribute("data-id")===String(t.id));i&&(i.setAttribute("aria-selected",String(e)),i.querySelector("input").checked=e),this.el.focus()}_selectSingle(t){let e=u.focusIsIn(this.container);this._cancelPendingSearch(),this.selectedValues=[t],this._refreshInputText(),this._resetAutocomplete(),this.close(),e&&(this.oldVal=this.el.value.toLocaleLowerCase(),this.el.focus())}_choose(t){t.hasAttribute("data-create")?this._create(t.getAttribute("data-create")):this.selectOption(t.getAttribute("data-id"))}_create(t){let e=u.focusIsIn(this.container);this._cancelPendingSearch(),this.oldVal=this.el.value.toLocaleLowerCase(),this.close(),e&&this.el.focus(),this._notify("create",this.options.onCreate,{args:[t,this],detail:{text:t}})}selectOption(t){let e=this.menuItems.find(i=>i.id==t&&i.disabled!==!0);e&&(this.options.isMultiSelect?this._toggleOption(e):this._selectSingle(e),this._updateSelectedInfo(),this.options.isMultiSelect&&this._announce(this.options.i18n.selected(this.selectedValues.length)),this._triggerChanged())}};K.key="Expressive_Autocomplete",K._loadingTemplate=null;var Q=K;var qe=()=>typeof ElementInternals<"u"&&"setFormValue"in ElementInternals.prototype,cs=new WeakMap;function dr(r){var s;customElements.get(r)||customElements.define(r,(s=class extends HTMLElement{constructor(){super(...arguments);this.internals=this.attachInternals();this.onFormReset=null}formResetCallback(){this.onFormReset?.()}get form(){return this.internals.form}get name(){return this.getAttribute("name")??""}get labels(){return this._input?.labels}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}get willValidate(){return this.internals.willValidate}checkValidity(){return this.internals.checkValidity()}reportValidity(){return this.internals.reportValidity()}focus(e){this._input?.focus(e)}get _input(){return this.querySelector(":scope > input")}},s.formAssociated=!0,s))}function ls(r,s){["disabled","form"].forEach(t=>x(r,t,s.getAttribute(t)))}function ze(r,s,t){dr(r);let e=document.createElement(r);e.style.display="contents",e.setAttribute("name",s.getAttribute("name")??""),s.removeAttribute("name"),s.replaceWith(e),e.append(s),ls(e,s);let i=new MutationObserver(()=>(ls(e,s),t()));return i.observe(s,{attributeFilter:["disabled","readonly","form"]}),cs.set(e,i),e}function Ke(r,s){cs.get(r)?.disconnect(),r.replaceWith(...r.childNodes),s.setAttribute("name",r.getAttribute("name")??"")}var pr="expressive-chips-control",mr=r=>(r.clipboardData?.getData("text")??"").split(/[,\t\n]/).map(s=>s.trim()).filter(Boolean),hs={data:[],placeholder:"",secondaryPlaceholder:"",closeIconClass:"material-symbols",autocompleteOptions:{},autocompleteOnly:!1,limit:1/0,allowUserInput:!1,i18n:{remove:"Remove",required:"Add at least one item."},onChipAdd:null,onChipSelect:null,onChipDelete:null},J=class J extends b{constructor(t,e){super(t,e);this._name="";this._initialData=[];this._ariaRequired=null;this._control=null;this._source=null;this._required=!1;this._handleInputPaste=t=>{let e=mr(t);e.length<2||this._suggestionsOnly||(t.preventDefault(),e.every(i=>(this.addChip({id:i}),J.getInstance(this.el)===this)))};this._handleChipClick=t=>{let e=t.target.closest(".chip"),i=!!t.target.closest(".close");if(e){let n=this._chips.indexOf(e);if(n<0)return;i?this._deleteChip(n,"input"):this.selectChip(n)}else this._input.focus()};this._handleFocusIn=t=>{let e=t.target.closest(".chip");this._setSelected(e&&this._chips.includes(e)?e:null)};this._handleFocusOut=t=>{this.el.contains(t.relatedTarget)||this._setSelected(null)};this._handleInputFocus=()=>{this.el.classList.add("focus")};this._handleInputBlur=()=>{this.el.classList.remove("focus")};this._handleInputKeydown=t=>{if(!u.isComposing(t))if(t.key==="Enter"){if(this.hasAutocomplete&&this.autocomplete?.isOpen&&this.autocomplete.container.querySelector('[role="option"]'))return;t.preventDefault(),(!this.hasAutocomplete||!this.options.autocompleteOnly)&&this.addChip({id:this._input.value}),this._input.value="",this.autocomplete?.close()}else this._input.value===""&&this.chipsData.length&&["Backspace",J._backKey(this.el)].includes(t.key)&&(t.preventDefault(),this.selectChip(this.chipsData.length-1))};this.el.classList.add("chips"),this.chipsData=[],this._chips=[],this._takeName(),this.options.data.length&&(this.chipsData=[...this.options.data],this._renderChips()),this.options.allowUserInput&&(this.el.classList.add("field"),this._setupInput(),this._setupEventHandlers(),this.el.append(this._end)),this._setupLabel(),this._sync(),this._initialData=[...this.chipsData]}_setSelected(t){this._selectedChip?.classList.remove("selected"),this._selectedChip=t,t?.classList.add("selected")}static get defaults(){return hs}getData(){return this.chipsData}destroy(){this.autocomplete&&Q.getInstance(this._input)===this.autocomplete&&this.autocomplete.destroy(),this._events.abort(),this._chips.forEach(t=>t.remove()),this._chips=[],this._giveNameBack(),super.destroy()}_setupEventHandlers(){let{signal:t}=this._events;this.el.addEventListener("click",this._handleChipClick,{signal:t}),this.el.addEventListener("keydown",J._handleChipsKeydown,{signal:t}),this.el.addEventListener("focusin",this._handleFocusIn,{signal:t}),this.el.addEventListener("focusout",this._handleFocusOut,{signal:t}),this._input.addEventListener("focus",this._handleInputFocus,{signal:t}),this._input.addEventListener("blur",this._handleInputBlur,{signal:t}),this._input.addEventListener("keydown",this._handleInputKeydown,{signal:t}),this._input.addEventListener("paste",this._handleInputPaste,{signal:t})}_takeName(){let t=this._editorInput();this._name=t?.getAttribute("name")??"",this._name&&qe()&&this._wrap(t)}_wrap(t){this._source=t,this._takeRequired(t),this._control=ze(pr,t,()=>this._validate()),this._control.onFormReset=()=>this._resetChips(),this._validate()}_editorInput(){return this.options.allowUserInput?this.el.querySelector('input:is(:not([type]), [type="text"])'):null}get _end(){return this._control??this._input}_sync(){if(!this._control)return;let t=new FormData;this.chipsData.forEach(e=>t.append(this._name,String(e.id))),this._control.internals.setFormValue(t),this._validate()}_takeRequired(t){this._required=t.required,this._required&&(this._ariaRequired=t.getAttribute("aria-required"),t.required=!1,t.setAttribute("aria-required","true"))}_validate(){let t=this._control.internals;this._required&&!this._source.readOnly&&!this.chipsData.length?t.setValidity({valueMissing:!0},this._requiredMessage,this._anchor):t.setValidity({})}get _anchor(){return this._control.contains(this._source)?this._source:void 0}get _requiredMessage(){return this.options.i18n.required||hs.i18n.required}_resetChips(){this._setSelected(null),this._chips.forEach(t=>t.remove()),this.chipsData=[...this._initialData],this._chips=this.chipsData.map(t=>this._renderChip(t)),this._control.before(...this._chips),this._setPlaceholder(),this._sync()}_giveNameBack(){this._control&&(Ke(this._control,this._source),this._control=null,this._required&&(this._source.required=!0,x(this._source,"aria-required",this._ariaRequired)))}get _suggestionsOnly(){return this.hasAutocomplete&&this.options.autocompleteOnly}static _backKey(t){return getComputedStyle(t).direction==="rtl"?"ArrowRight":"ArrowLeft"}static _handleChipsKeydown(t){let e=t.target.closest(".chips"),i=t.target.tagName;if(i==="INPUT"||i==="TEXTAREA"||!e)return;let n=e.Expressive_Chips;if(n){if(t.key==="Backspace"||t.key==="Delete"){let o=n._chips.indexOf(t.target.closest(".chip"));if(o<0)return;t.preventDefault(),n._deleteChip(o,"previous")}else if(t.key==="ArrowLeft"||t.key==="ArrowRight"){let o=t.target.closest(".chip")??n._selectedChip,a=n._chips.indexOf(o);if(a<0)return;if(t.key===J._backKey(e))a>0&&n.selectChip(a-1);else{let l=a+1;l>=n.chipsData.length?(n._setSelected(null),n._input.focus()):n.selectChip(l)}}}}_renderChip(t){if(!t.id&&t.id!==0)return;let e=t.text||t.id,i=document.createElement("span");if(i.classList.add("chip"),i.innerText=e,t.image){let n=document.createElement("img");n.setAttribute("src",t.image),i.insertBefore(n,i.firstChild)}if(this.options.allowUserInput){let n=document.createElement("button");n.type="button",n.classList.add("close"),n.setAttribute("aria-label",`${this.options.i18n.remove} ${e}`);let o=document.createElement("span");o.classList.add(this.options.closeIconClass),o.setAttribute("aria-hidden","true"),o.innerText="close",n.appendChild(o),i.appendChild(n)}return i}_renderChips(){this._chips=[];for(let t=0;t<this.chipsData.length;t++){let e=this._renderChip(this.chipsData[t]);this.el.appendChild(e),this._chips.push(e)}}_setupAutocomplete(){this.options.autocompleteOptions.onAutocomplete=e=>{J.getInstance(this.el)===this&&e.length>0&&(this.addChip({id:e[0].id,text:e[0].text,image:e[0].image}),this._input.value="",this._input.focus())};let t=this.options.autocompleteOptions.onCreate;this.autocomplete=Q.init(this._input,{...this.options.autocompleteOptions,onCreate:(e,i)=>{this._addTyped(e),typeof t=="function"&&t.call(i,e,i)}})}_addTyped(t){J.getInstance(this.el)===this&&(this.addChip({id:t}),this._input.value="",this._input.focus())}_setupInput(){this._input=this.el.querySelector("input"),this._input||(this._input=document.createElement("input"),this.el.append(this._input)),this._input.classList.add("input"),this.hasAutocomplete=Object.keys(this.options.autocompleteOptions).length>0,this.hasAutocomplete&&this._setupAutocomplete(),this._setPlaceholder(),this._input.getAttribute("id")||this._input.setAttribute("id",u.guid())}_setupLabel(){this._label=this.el.querySelector("label"),this._label&&this._input&&this._label.setAttribute("for",this._input.getAttribute("id"))}_setPlaceholder(){this._input&&(!this.chipsData.length&&this.options.placeholder?this._input.placeholder=this.options.placeholder:this.chipsData.length&&this.options.secondaryPlaceholder&&(this._input.placeholder=this.options.secondaryPlaceholder))}_isValidAndNotExist(t){let e=!!t.id||t.id===0,i=!this.chipsData.some(n=>n.id==t.id);return e&&i}addChip(t){if(!this._isValidAndNotExist(t)||this.chipsData.length>=this.options.limit)return;let e=this._renderChip(t);this._chips.push(e),this.chipsData.push(t),this._end?this._end.before(e):this.el.append(e),this._setPlaceholder(),this._sync(),this._notify("chip-add",this.options.onChipAdd,{args:[this.el,e],detail:{chip:e},current:()=>this._chips.includes(e)})}deleteChip(t){let e=this.el.getRootNode();this._deleteChip(t,this._chips[t]?.contains(e.activeElement)?"input":null)}_deleteChip(t,e){let i=this._chips[t];if(!i)return;this._selectedChip===i&&this._setSelected(null),i.remove(),this._chips.splice(t,1),this.chipsData.splice(t,1),this._setPlaceholder(),this._sync();let n=[],o=this.el.getRootNode();for(;o;)n.push({root:o,element:o.activeElement}),o="host"in o?o.host.getRootNode():null;this._notify("chip-delete",this.options.onChipDelete,{args:[this.el,i],detail:{chip:i},current:()=>!this._chips.includes(i)}),!(!e||n.some(({root:a,element:l})=>a.activeElement!==l)||this.el.Expressive_Chips!==this)&&(e==="previous"&&this._chips.length?this.selectChip(Math.max(t-1,0)):(this._setSelected(null),this._input?.focus()))}selectChip(t){let e=this._chips[t];e&&(this._setSelected(e),e.querySelector(".close")?.focus(),this._notify("chip-select",this.options.onChipSelect,{args:[this.el,e],detail:{chip:e},current:()=>this._selectedChip===e}))}static Init(){u.onDocumentReady(()=>{document.querySelectorAll(".chips").forEach(e=>{e.addEventListener("click",i=>{if(!i.target.closest(".close"))return;let n=i.target.closest(".chip");n&&!e.Expressive_Chips?._chips.includes(n)&&n.remove()})})})}};J.key="Expressive_Chips";var it=J;var fr={},Te=new WeakMap,Le=class Le extends b{constructor(t,e){super(t,e);this._resizeObserver=null;this._handleFormReset=()=>{setTimeout(()=>{Le.getInstance(this.el)===this&&this._sync()})};this._handleRangeChange=()=>{this._clampDual(),this._sync(),this.thumb.classList.add("active")};this._handleRangePointerDown=t=>{t.isPrimary&&(t.pointerType==="mouse"&&t.button!==0||(this._pointerDown=!0,this.el.classList.add("active"),this._clampDual(),this._sync(),this.thumb.classList.add("active")))};this._handleRangeInput=()=>{this._clampDual(),this._sync(),this.thumb.classList.add("active")};this._handleRangePointerUp=t=>{t.isPrimary&&(this._pointerDown=!1,this.el.classList.remove("active"))};this._handleRangeRelease=()=>{this._pointerDown||this.thumb.classList.remove("active")};this._pointerDown=!1,this._setupThumb(),this._sync(),this._setupEventHandlers(),this._resizeObserver=new ResizeObserver(()=>this._sync()),this._resizeObserver.observe(this.el),this.el.parentElement&&this._resizeObserver.observe(this.el.parentElement)}static get defaults(){return fr}destroy(){this._resizeObserver?.disconnect(),this._removeThumb(),super.destroy();let t=this._host();for(let e of[this.el,t]){for(let i in Te.get(e))e.style.setProperty(i,Te.get(e)[i]);Te.delete(e)}t?.querySelectorAll('input[type="range"]').forEach(e=>e.Expressive_Slider?._sync())}_set(t,e,i){let n=Te.get(t)??{};Te.set(t,n),n[e]??(n[e]=t.style.getPropertyValue(e)),t.style.setProperty(e,i)}_setupEventHandlers(){let{signal:t}=this._events;this.el.addEventListener("change",this._handleRangeChange,{signal:t}),this.el.addEventListener("pointerdown",this._handleRangePointerDown,{signal:t}),this.el.addEventListener("input",this._handleRangeInput,{signal:t}),this.el.addEventListener("pointerup",this._handleRangePointerUp,{signal:t}),this.el.addEventListener("pointercancel",this._handleRangePointerUp,{signal:t}),this.el.addEventListener("blur",this._handleRangeRelease,{signal:t}),this.el.addEventListener("mouseout",this._handleRangeRelease,{signal:t}),this.el.form?.addEventListener("reset",this._handleFormReset,{signal:t})}_setupThumb(){this.thumb=document.createElement("span"),this.value=document.createElement("span"),this.thumb.classList.add("thumb"),this.value.classList.add("value"),this.thumb.append(this.value),this.el.after(this.thumb)}_removeThumb(){this.thumb.remove()}_isVertical(){return!!this.el.closest(".vertical")}_host(){return this.el.closest(".slider, label")}_clampDual(){let e=this._host()?.querySelectorAll('input[type="range"]');if(!e||e.length!==2)return;let i=e[0],n=e[1];this.el===i&&+i.value>+n.value&&(i.value=n.value),this.el===n&&+n.value<+i.value&&(n.value=i.value)}_bounds(t){let e=parseFloat(t.max);return{max:Number.isNaN(e)?100:e,min:parseFloat(t.min)||0}}_fraction(t){let{max:e,min:i}=this._bounds(t),n=parseFloat(t.value)||0;return e===i?0:(n-i)/(e-i)}_sync(){let t=this._fraction(this.el),e=`${t*100}%`,i=this.el.offsetLeft,n=this.el.offsetTop,o=this.el.offsetWidth,a=this.el.offsetHeight,l=getComputedStyle(this.el),c=l.direction==="rtl",h=this._isVertical(),d=parseFloat(l.getPropertyValue("--md-comp-slider-handle-width"))||4,p=h?a:o,g=d/2+t*(p-d);this._set(this.el,"--md-comp-slider-active-fraction",e),this._set(this.el,"--md-comp-slider-active-position",`${g}px`);let m=this._host(),E=m?.querySelectorAll('input[type="range"]');if(m&&E&&E.length===2){let T=Array.from(E).map(C=>this._fraction(C));this._set(m,"--md-comp-slider-start-fraction",`${Math.min(...T)*100}%`),this._set(m,"--md-comp-slider-end-fraction",`${Math.max(...T)*100}%`),this._set(m,"--md-comp-slider-start-position",`${d/2+Math.min(...T)*(p-d)}px`),this._set(m,"--md-comp-slider-end-position",`${d/2+Math.max(...T)*(p-d)}px`)}if(m?.classList.contains("stops")){let{max:T,min:C}=this._bounds(this.el),_=parseFloat(this.el.step),L=_>0&&Number.isFinite(_)&&T>C;this._set(m,"--md-comp-slider-stop-count",L?String(Math.floor((T-C)/_+1e-9)+1):""),this._set(m,"--md-comp-slider-stop-spacing",L?`${(p-d)*_/(T-C)}px`:""),E?.length===1&&(this._set(m,"--md-comp-slider-active-position",`${g}px`),this._set(m,"--md-comp-slider-track-center",`${n+a/2}px`))}this.value.textContent=this.el.value,h?(this.thumb.style.left=`${i+o/2}px`,this.thumb.style.top=`${n+a-g}px`):(this.thumb.style.left=`${i+(c?o-g:g)}px`,this.thumb.style.top=`${n}px`)}static Init(){u.onDocumentReady(()=>{Le.init(document.querySelectorAll("input[type=range]:not(.image-compare > input, .color-picker-hue)"))})}};Le.key="Expressive_Slider";var Vt=Le;function Ci(r,s){let t=document.createElement(r);return t.textContent=s,t}function us(r,s){let t=Ci("button",r);return t.type="submit",t.value=s,t}var O=class O{static confirm(s){let t=O._confirmDialog(s);return document.body.append(t),t.showModal(),new Promise(e=>{let i=new MutationObserver(()=>{t.isConnected||n(!1)}),n=o=>{i.disconnect(),t.remove(),e(o)};i.observe(document,{childList:!0,subtree:!0}),t.addEventListener("close",()=>n(t.returnValue==="confirm"),{once:!0})})}static _confirmDialog({text:s,headline:t,confirm:e,cancel:i}){let n=document.createElement("dialog");n.setAttribute("role","alertdialog");let o=`expressive-confirm-${++O._confirms}`,a=Ci("p",s);a.id=`${o}-text`;let l=us(i??O.i18n.cancel,"");l.className="text",l.autofocus=!0;let c=document.createElement("form");return c.method="dialog",c.append(l,us(e??O.i18n.confirm,"confirm")),n.append(a,c),O._name(n,a,o,t),n}static _name(s,t,e,i){if(!i){s.setAttribute("aria-labelledby",t.id);return}let n=Ci("h2",i);n.id=`${e}-headline`,s.prepend(n),s.setAttribute("aria-labelledby",n.id),s.setAttribute("aria-describedby",t.id)}static Init(){u.onDocumentReady(()=>{document.addEventListener("pointerdown",O._onPointerDown,{passive:!0}),document.addEventListener("pointerup",O._onPointerUp,{passive:!0}),document.addEventListener("pointercancel",O._onPointerCancel,{passive:!0})})}static _onPointerDown(s){let t=O._isPrimaryPress(s)?O._backdropDialog(s):null;O._down=t&&O._lightDismissible(t)&&O._outside(s,t)?{dialog:t,pointerId:s.pointerId}:null}static _onPointerUp(s){let t=O._down;O._down=null,!(!t||t.pointerId!==s.pointerId)&&(!t.dialog.isConnected||!t.dialog.open||O._lightDismissible(t.dialog)&&O._backdropDialog(s)===t.dialog&&O._outside(s,t.dialog)&&t.dialog.close())}static _onPointerCancel(){O._down=null}static _backdropDialog(s){let t=u.eventTarget(s);return!(t instanceof HTMLDialogElement)||!t.open?null:t}static _outside(s,t){let e=t.getBoundingClientRect();return s.clientX<e.left||s.clientX>e.right||s.clientY<e.top||s.clientY>e.bottom}static _isPrimaryPress(s){return s.isPrimary?s.pointerType!=="mouse"||s.button===0:!1}static _lightDismissible(s){let t=s.getAttribute("closedby");return t==="any"?!("closedBy"in HTMLDialogElement.prototype):t!=="none"&&t!=="closerequest"}};O.i18n={confirm:"OK",cancel:"Cancel"},O._down=null,O._confirms=0;var Wt=O;function _r(r,s,{damping:t,stiffness:e},i){let n=Math.sqrt(e);if(t>=1)return Math.exp(-n*i)*(r+(s+n*r)*i);let o=n*Math.sqrt(1-t*t);return Math.exp(-t*n*i)*(r*Math.cos(o*i)+(s+t*n*r)/o*Math.sin(o*i))}function ds(r,s,t,e){let i=[r],[n,o]=[r-s,t*1e3];for(let a=1;a<300;a++){let l=_r(n,o,e,a/60);if(i.push(s+l),Math.abs(l)<.5&&Math.abs(s+l-i[a-1])<.5)break}return i.push(s),i}function ps(r,s){let t=getComputedStyle(r),e=o=>parseFloat(t.getPropertyValue(`--md-sys-motion-spring-${s}-${o}`)),[i,n]=[e("damping"),e("stiffness")];return i>0&&n>0?{damping:i,stiffness:n}:null}function ms(r,s,t,e){let i=t.map(n=>({[s]:e(n)}));return r.animate(i,{duration:(t.length-1)*1e3/60,easing:"linear"})}var fs="(prefers-reduced-motion: reduce)",ki=96,Ai=.5,gr=100,vr=4,_s=r=>Date.now()-r.lastT<gr?r.velocity:0,br=(r,s)=>r.shift*r.direction>ki||s*r.direction>Ai,Si=new WeakMap;function Er(r,s){let t=Si.get(r);if(!t)return 0;let[e,i="0"]=getComputedStyle(r).translate.split(" ");return t(!1),parseFloat(s==="x"?e:i)||0}var gs=new Set;function Ve(r){if(gs.has(r.selector))return;gs.add(r.selector);let s=_=>r.axis==="x"?_.clientX:_.clientY,t,e=null,i=_=>{let L=u.closestInPath(_,r.selector);return L instanceof HTMLDialogElement?L:null},n=_=>{_.style.transition="",_.style.setProperty(r.property,"0px")},o=_=>{if(!_.isPrimary||_.pointerType==="mouse"&&_.button!==0)return;C(),r.onPress?.();let L=i(_);if(!L?.open||!r.inHandle(_,L))return;L.style.transition="none";let S=s(_),P=Er(L,r.axis);L.style.setProperty(r.property,`${P}px`),e={dialog:L,pointerId:_.pointerId,direction:r.direction(L),start:S-P,last:S,lastT:Date.now(),velocity:0,shift:P};let N={childList:!0,subtree:!0,attributes:!0,attributeFilter:["open"],attributeOldValue:!0},rt=L.getRootNode();t.observe(document,N),rt!==document&&t.observe(rt,N)},a=_=>{if(!e||e.pointerId!==_.pointerId)return;if(!e.dialog.open||!e.dialog.isConnected){C();return}let L=s(_),S=L-e.start;if(e.shift=e.direction===1?Math.max(0,S):Math.min(0,S),L!==e.last){let P=Date.now();e.velocity=(L-e.last)/Math.max(1,P-e.lastT),e.last=L,e.lastT=P}e.dialog.style.setProperty(r.property,`${e.shift}px`)},l=_=>{let L=e;if(!(!L||L.pointerId!==_.pointerId)){if(!L.dialog.open||!L.dialog.isConnected){C();return}a(_),e=null,t.disconnect(),c(L)}},c=_=>{let L=d(_);_.dialog.style.transition="",h(_,!T(_)&&_.dialog.open?L:null)},h=(_,L)=>{L&&(_.dialog.style.transition="none"),_.dialog.style.setProperty(r.property,"0px"),L&&g(_,L)},d=_=>!_.shift||matchMedia(fs).matches||!p(_.dialog)?null:ps(_.dialog,"default-spatial"),p=_=>{let L=getComputedStyle(_),S=N=>L.getPropertyValue(N).trim(),P="--md-sys-motion-spring-default-spatial";return S(r.motion)===S(P)&&S(`${r.motion}-duration`)===S(`${P}-duration`)},g=(_,L)=>{let S=_.dialog,P=r.axis==="x"?X=>`${X}px 0`:X=>`0 ${X}px`,N=ms(S,"translate",ds(_.shift,0,_s(_),L),P),rt=matchMedia(fs),Ne=new MutationObserver(()=>S.open||Ee(!0)),Ee=X=>{Si.delete(S),Ne.disconnect(),rt.removeEventListener("change",Y),N.onfinish=null,N.cancel(),X&&(S.style.transition="")},Y=()=>Ee(!0);Si.set(S,Ee),N.onfinish=Y,rt.addEventListener("change",Y),Ne.observe(S,{attributes:!0,attributeFilter:["open"]})},m=r.onRelease??(()=>{}),E=r.release??(()=>!1),T=_=>{let L=_s(_),S=_.last-_.start,P=Math.abs(S)>vr;m(P);let N=!P||E(_.dialog,S,L);return!N&&br(_,L)&&_.dialog.close(),N},C=_=>{if(_&&e?.pointerId!==_.pointerId)return;t.disconnect(),m(!1);let L=e;e=null,L&&n(L.dialog)};u.onDocumentReady(()=>{t=new MutationObserver(_=>{let L=e?.dialog;L&&(!L.open||!L.isConnected||_.some(S=>S.type==="attributes"&&S.target===L&&S.oldValue===null||[...S.removedNodes].some(P=>P.contains(L))))&&C()}),document.addEventListener("pointerdown",o,{passive:!0}),document.addEventListener("pointermove",a,{passive:!0}),document.addEventListener("pointerup",l,{passive:!0}),document.addEventListener("pointercancel",C,{passive:!0})})}var Hi="dialog.bottom-sheet",yr=48,vs=(r,s,t,e)=>t*r>s||e*r>Ai,$=class ${static Init(){Ve({selector:Hi,axis:"y",property:"--md-comp-bottom-sheet-shift",motion:"--md-comp-bottom-sheet-motion",direction:()=>1,inHandle:(s,t)=>{if(u.closestInPath(s,".drag-handle"))return!0;let e=t.getBoundingClientRect();return s.clientY>=e.top&&s.clientY<=e.top+48},onPress:()=>{$._dragged=!1},onRelease:s=>{$._dragged=s},release:(s,t,e)=>$._resize(s,t,e)}),u.onDocumentReady(()=>{document.addEventListener("click",$._onClick),document.addEventListener("close",$._onClose,!0)})}static _resize(s,t,e){if(!s.classList.contains("expandable"))return!1;let i=s.classList.contains("expanded"),n=i?!vs(1,ki,t,e):vs(-1,yr,t,e);return n===i?!1:($.setExpanded(s,n),!0)}static setExpanded(s,t){s.classList.toggle("expanded",t),s.querySelector(":scope > button.drag-handle")?.setAttribute("aria-expanded",String(t))}static _onClose(s){let t=s.target;t.matches?.(`${Hi}.expandable`)&&$.setExpanded(t,!1)}static _onClick(s){let t=u.closestInPath(s,".drag-handle");if(!(t instanceof HTMLButtonElement)||s.detail!==0&&$._dragged)return;let e=t.closest(Hi);e instanceof HTMLDialogElement&&e.open&&$._activate(e)}static _activate(s){s.classList.contains("expandable")?$.setExpanded(s,!s.classList.contains("expanded")):s.close()}};$._dragged=!1;var Ut=$;var Tr=r=>r.classList.contains("start"),bs=r=>Tr(r)!==(getComputedStyle(r).direction==="rtl"),jt=class{static Init(){Ve({selector:"dialog.side-sheet",axis:"x",property:"--md-comp-side-sheet-shift",motion:"--md-comp-side-sheet-motion",direction:s=>bs(s)?-1:1,inHandle:(s,t)=>{let e=t.querySelector(":scope > header");if(e&&s.composedPath().includes(e))return!0;let i=t.getBoundingClientRect();return bs(t)?s.clientX>=i.right-24&&s.clientX<=i.right:s.clientX>=i.left&&s.clientX<=i.left+24}})}};var Ii='.drop-zone input[type="file"]:is([data-validate-types], [data-max-size], [data-max-files])';function We(r,s){let t=(r.getAttribute(s)||"").trim();if(!/^\d+$/.test(t))return 0;let e=Number(t);return Number.isSafeInteger(e)?e:0}function Lr(r){return r.endsWith("/*")?/^(image|audio|video)\/\*$/.test(r):/^\.[^\s/\\]+$/.test(r)||/^[!#$%&'*+.^_`|~0-9a-z-]+\/[!#$%&'*+.^_`|~0-9a-z-]+$/.test(r)}function wr(r,s){return s.startsWith(".")?r.name.toLowerCase().endsWith(s):s.endsWith("/*")?r.type.toLowerCase().startsWith(s.slice(0,-1)):r.type.toLowerCase()===s}var v=class v{static validateField(s){if(!s){console.error("No text field element found");return}if(v._validatedFile(s)){v._validateFiles(s);return}s.classList.contains("validate")&&(v._markInvalid(s,v._fails(s)),v._describeByError(s))}static _markInvalid(s,t){s.classList.toggle("invalid",t),t?s.setAttribute("aria-invalid","true"):s.removeAttribute("aria-invalid")}static _fails(s){return!v._blankOptional(s)&&(!s.validity.valid||s.value.length>parseInt(s.getAttribute("data-length")))}static _blankOptional(s){return s.value.length===0&&!s.validity.badInput&&!s.required}static _describeByError(s){let t=s.parentElement?.querySelector(":scope > [data-error]");t&&v._addDescription(s,v._idOf(t))}static _idOf(s){return s.id||(s.id=`field-error-${u.guid()}`),s.id}static _addDescription(s,t){let e=(s.getAttribute("aria-describedby")??"").split(/\s+/).filter(Boolean);e.includes(t)||s.setAttribute("aria-describedby",[...e,t].join(" "))}static textareaAutoResize(s){let t=s;if(!t)return;t.hasAttribute("original-height")||v._measureTextarea(t);let e=parseInt(t.getAttribute("original-height"));if(isNaN(e))return;t.style.height="auto";let i=t.offsetHeight-t.clientHeight,n=t.scrollHeight+i;t.style.height=Math.max(e,n)+"px"}static _measureTextarea(s){let t=s.getBoundingClientRect().height;t&&s.setAttribute("original-height",t.toString())}static _validatedFile(s){return s.matches(Ii)||v._fileErrors.has(s)}static _rejectedTypes(s){let t=s.accept.split(",").map(e=>e.trim().toLowerCase()).filter(Lr);return t.length?Array.from(s.files??[]).filter(e=>!t.some(i=>wr(e,i))):[]}static _validateFiles(s){if(s.matches(":disabled"))return;v._bindFileReset(s);let t=v._checkFiles(s);return v._showFileError(s,t?.message??s.validationMessage),t}static _checkFiles(s){if(v._clearFileError(s),!s.matches(Ii)){v._fileErrors.delete(s);return}v._fileErrors.set(s,"");let t=v._fileFailure(s);return t&&v._setFileError(s,t.message),t}static _fileFailure(s){return v._typeFailure(s)??v._sizeFailure(s)??v._countFailure(s)}static _typeFailure(s){if(!s.hasAttribute("data-validate-types"))return;let t=v._rejectedTypes(s);if(t.length)return{rejected:t,reason:"type",message:v._fileTypeMessage(s)}}static _sizeFailure(s){let t=We(s,"data-max-size");if(!t)return;let e=Array.from(s.files??[]).filter(i=>i.size>t);if(e.length)return{rejected:e,reason:"size",message:v._fileSizeMessage(s,t)}}static _fileSizeMessage(s,t){return v._fileError(s)?.getAttribute("data-error-size")?.trim()||`Maximum file size: ${t} bytes.`}static _countFailure(s){let t=We(s,"data-max-files");if(!t)return;let e=Array.from(s.files??[]);if(e.length>t)return{rejected:e,reason:"count",message:v._fileCountMessage(s,t)}}static _fileCountMessage(s,t){return v._fileError(s)?.getAttribute("data-error-count")?.trim()||`Maximum file count: ${t}.`}static _clearFileError(s){let t=v._fileErrors.get(s);t&&t===s.validationMessage&&s.setCustomValidity("")}static _setFileError(s,t){s.validity.customError||(s.setCustomValidity(t),v._fileErrors.set(s,t))}static _fileTypeMessage(s){return v._fileError(s)?.getAttribute("data-error")?.trim()||`Choose files matching: ${s.accept}.`}static _fileError(s){return Array.from(s.closest(".drop-zone")?.children??[]).find(t=>t.hasAttribute("data-error"))}static _showFileError(s,t){v._markInvalid(s,!s.validity.valid);let e=v._fileError(s);e&&(v._addDescription(s,v._idOf(e)),e.textContent=t,e.hidden=!t)}static _updateDropZone(s){v._bindFileReset(s);let t=s.closest(".drop-zone"),e=Array.from(s.files??[]),i=v._validateDropZone(s);v.listDropZoneFiles(t,s),v._reportFileRejection(s,e,i)}static _validateDropZone(s){if(v._validatedFile(s))return v._validateFiles(s);v.validateField(s)}static _reportFileRejection(s,t,e){if(!s.matches(Ii)){v._fileSelections.delete(s);return}v._newFileSelection(s,t)&&e&&u.emit(s.closest(".drop-zone"),"reject",{input:s,files:t.slice(),rejected:e.rejected.slice(),reason:e.reason})}static _newFileSelection(s,t){let e=JSON.stringify([s.hasAttribute("data-validate-types"),s.accept,We(s,"data-max-size"),We(s,"data-max-files")]),i=v._fileSelections.get(s);return v._fileSelections.set(s,{files:t,constraints:e}),!i||i.constraints!==e||i.files.length!==t.length||!i.files.every((n,o)=>n===t[o])}static _bindFileReset(s){if(!s.getRootNode().host)return;let t=s.form;!t||v._fileResetForms.has(t)||(v._fileResetForms.add(t),t.addEventListener("reset",v.resetFormExtras))}static _resetFileInput(s){s.files?.length||(v._fileSelections.delete(s),v._resetFileList(s),v._resetFileValidity(s))}static _resetFileList(s){let t=s.closest(".drop-zone");t&&(v.listDropZoneFiles(t,s),t.classList.remove("dragover"))}static _resetFileValidity(s){s.matches(":disabled")||v._validatedFile(s)&&(v._clearFileError(s),v._fileErrors.delete(s),v._showFileError(s,s.validationMessage))}static _resetDropZones(s){Array.from(s.elements).filter(t=>t instanceof HTMLInputElement&&t.type==="file").forEach(v._resetFileInput)}static Init(){v._initialized||(v._initialized=!0,u.onDocumentReady(()=>{document.addEventListener("input",v._onFileInput),document.addEventListener("change",s=>{let t=u.eventTarget(s);if(t instanceof HTMLInputElement){if(t.matches('.drop-zone input[type="file"]')){v._onFileInput(s);return}v.validateField(t)}}),document.addEventListener("click",v.togglePassword),document.addEventListener("click",v.stepNumber),document.addEventListener("submit",v.resetFormExtras,!0),document.addEventListener("submit",v.summarizeErrors,!0),document.addEventListener("click",v.focusSummaryField),document.addEventListener("reset",v.resetFormExtras,!0);for(let s of["dragenter","dragover","dragleave","drop"])document.addEventListener(s,v.markDropZone);document.querySelectorAll(".expressive-textarea").forEach(s=>{v.InitTextarea(s)}),document.querySelectorAll('.file-field input[type="file"]').forEach(s=>{v.InitFileInputPath(s)})}))}static togglePassword(s){let t=u.closestInPath(s,".password-toggle"),e=t?.closest(".field")?.querySelector('input[type="password"], input[data-password]');if(!e)return;let i=e.type==="password";e.toggleAttribute("data-password",i),e.type=i?"text":"password",t.setAttribute("aria-pressed",String(i))}static stepNumber(s){let t=u.closestInPath(s,".field > [data-step]:not(:disabled)"),e=t?.parentElement.querySelector(':scope > input[type="number"]:not(:disabled, [readonly], [step="any"])');e&&(e[t.dataset.step==="down"?"stepDown":"stepUp"](),e.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),e.dispatchEvent(new Event("change",{bubbles:!0})))}static resetFormExtras(s){let t=s.target;t instanceof HTMLFormElement&&(t.querySelectorAll("input[data-password]").forEach(e=>{e.removeAttribute("data-password"),e.type="password",e.closest(".field")?.querySelector(".password-toggle")?.setAttribute("aria-pressed","false")}),s.type==="reset"&&setTimeout(()=>{s.defaultPrevented||v._resetDropZones(t)},0))}static summarizeErrors(s){let t=s.target;if(!(t instanceof HTMLFormElement))return;let e=t.querySelector(".error-summary"),i=e?.querySelector("ul, ol");if(!i||s.submitter?.hasAttribute("formnovalidate"))return;if(t.checkValidity()){e.hidden=!0,i.replaceChildren();return}s.preventDefault(),s.stopPropagation();let n=new Set,o=[...t.elements].flatMap(a=>{if(!a.willValidate||a.validity.valid)return[];if(a.type==="radio"){if(n.has(a.name))return[];n.add(a.name)}a.id||(a.id=`field-${u.guid()}`);let h=((a.type==="radio"?a.closest("fieldset")?.querySelector("legend"):null)??a.labels?.[0]??a.closest(".field")?.querySelector("label"))?.cloneNode(!0);h?.querySelectorAll("select, textarea").forEach(m=>m.remove());let d=h?.textContent??a.getAttribute("aria-label")??"",p=document.createElement("a");p.href=`#${a.id}`,p.textContent=[d.replace(/\s+/g," ").trim(),a.validationMessage].filter(Boolean).join(": ");let g=document.createElement("li");return g.append(p),[g]});i.replaceChildren(...o),e.hasAttribute("tabindex")||(e.tabIndex=-1),e.hidden=!1,e.focus()}static focusSummaryField(s){let t=u.closestInPath(s,'.error-summary a[href^="#"]'),e=t&&u.getElementById(t,t.getAttribute("href").slice(1));e&&(s.preventDefault(),e.focus())}static markDropZone(s){let t=u.eventTarget(s);if(!(t instanceof HTMLInputElement)||t.type!=="file")return;let e=t.closest(".drop-zone");if(!e)return;let i=s.type==="dragenter"||s.type==="dragover";e.classList.toggle("dragover",i&&!t.disabled)}static listDropZoneFiles(s,t){let e=Array.from(s.querySelectorAll(".drop-zone-files")).find(n=>n.closest(".drop-zone")===s);if(!e)return;let i=n=>{let[o,a]=n>=1e6?[n/1e6,"megabyte"]:n>=1e3?[n/1e3,"kilobyte"]:[n,"byte"];return new Intl.NumberFormat(void 0,{style:"unit",unit:a,maximumFractionDigits:1}).format(o)};e.replaceChildren(...Array.from(t.files??[],n=>{let o=document.createElement("li"),a=document.createElement("span"),l=document.createElement("span");return a.textContent=n.name,l.textContent=i(n.size),o.append(a,l),o}))}static InitTextarea(s){s.removeAttribute("original-height"),v.textareaAutoResize(s),s.addEventListener("input",t=>v.textareaAutoResize(t.target)),s.addEventListener("focus",()=>{s.hasAttribute("original-height")||v.textareaAutoResize(s)})}static InitFileInputPath(s){s.addEventListener("change",()=>{let e=s.closest(".file-field")?.querySelector("input.file-path");e&&(e.value=Array.from(s.files,i=>i.name).join(", "),e.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0,composed:!0})))})}};v._initialized=!1,v._fileErrors=new WeakMap,v._fileSelections=new WeakMap,v._fileResetForms=new WeakSet,v._onFileInput=s=>{let t=u.closestInPath(s,'.drop-zone input[type="file"]');t&&(t.matches(":disabled")||v._updateDropZone(t))};var Yt=v;var xr={text:"",action:"",onAction:null,dismissible:!1,displayLength:4e3,inDuration:300,outDuration:375,classes:"",completeCallback:null,activationPercent:.8,root:null,replace:!1},y=class y{constructor(s={}){this._dismissed=!1;this._returnFocus=null;this._restoreElement=null;this.options={...y.defaults,...s},s.displayLength===void 0&&this.options.action&&(this.options.displayLength=1/0),s.dismissible===void 0&&(this.options.dismissible=y._needsClose(this.options)),this.message=this.options.text,this.panning=!1,this.timeRemaining=this.options.displayLength,this._portal=u.portalRoot(this.options.root??document.body),y._dropDetached(),this.options.snackbarId?this._requireBody():this._build(),this.options.replace?y._replaceShown(this):y._queue.push(this),y._advance()}static _needsClose(s){return!!s.action||s.displayLength===1/0}static _dropDetached(){for(let s of y._snackbars.filter(t=>!t.el.isConnected))s._dismissed=!0,s._remove(!1)}_requireBody(){if(!this._hasBody())throw new Error("Snackbar body not found")}_hasBody(){return!this.options.snackbarId||!!u.getElementById(this._portal,this.options.snackbarId)}_build(){this.el=this._createSnackbar(),this.el.Expressive_Snackbar=this}static _replaceShown(s){y._replacing=!0;try{for(;y._snackbars.length;)for(let t of y._snackbars.splice(0))t._dismissed=!0,t._restoreFocus(!0)}finally{y._replacing=!1}y._queue.unshift(s)}_show(){this.el||this._build(),this._returnFocus=y._focused(),y._containerIn(this._portal).appendChild(this.el),y._snackbars.push(this),this._animateIn(),this._setTimer(),u.emit(this.el,"open")}static _focused(){let s=document.activeElement;for(;s?.shadowRoot?.activeElement;)s=s.shadowRoot.activeElement;return s instanceof HTMLElement?s:null}static _containerIn(s){let t=y._container;return t?.isConnected&&t.parentNode===s?t:(y._removeContainer(),y._createContainer(s),y._container)}static get defaults(){return xr}static getInstance(s){return s.Expressive_Snackbar}static _createContainer(s=document.body){let t=document.createElement("div");t.setAttribute("id","snackbar-container"),t.addEventListener("pointerdown",y._onDragStart),document.addEventListener("pointermove",y._onDragMove),document.addEventListener("pointerup",y._onDragEnd),document.addEventListener("pointercancel",y._onDragCancel),s.appendChild(t),y._container=t}static _removeContainer(){document.removeEventListener("pointermove",y._onDragMove),document.removeEventListener("pointerup",y._onDragEnd),document.removeEventListener("pointercancel",y._onDragCancel),y._container?.remove(),y._container=null}static _onDragStart(s){if(!s.isPrimary||s.pointerType==="mouse"&&s.button!==0)return;let t=s.target;if(t&&!t.closest("button, a")&&t.closest(".snackbar")){let i=t.closest(".snackbar").Expressive_Snackbar;if(!i)return;i.panning=!0,i._pauseTimer(),y._draggedSnackbar=i,i.el.classList.add("panning"),i.el.style.transition="",y._dragPointerId=s.pointerId,i.startingXPos=s.clientX,i.velocityX=0,i.time=Date.now(),i.xPos=s.clientX,i._activationDistance=i.el.offsetWidth*i.options.activationPercent}}static _onDragMove(s){if(y._dragPointerId===s.pointerId&&y._draggedSnackbar){s.preventDefault();let t=y._draggedSnackbar;t.deltaX=Math.abs(t.xPos-s.clientX),t.xPos=s.clientX,t.velocityX=t.deltaX/Math.max(1,Date.now()-t.time),t.time=Date.now();let e=t.xPos-t.startingXPos,i=t._activationDistance;t.el.style.transform=`translateX(${e}px)`,t.el.style.opacity=(1-Math.abs(e/i)).toString()}}static _onDragEnd(s){if(y._dragPointerId===s.pointerId&&(y._dragPointerId=null,y._draggedSnackbar)){let t=y._draggedSnackbar;t.panning=!1,t.el.classList.remove("panning");let e=t.xPos-t.startingXPos,i=t._activationDistance,n=Date.now()-t.time<100?t.velocityX:0;Math.abs(e)>i||n>1?(t.wasSwiped=!0,t.dismiss()):t._snapBack(),y._draggedSnackbar=null}}static _onDragCancel(s){if(y._dragPointerId!==s.pointerId)return;y._dragPointerId=null;let t=y._draggedSnackbar;t&&(t.panning=!1,t.el.classList.remove("panning"),t._snapBack(),y._draggedSnackbar=null)}_snapBack(){this.el.style.transition="transform .2s, opacity .2s",this.el.style.transform="",this.el.style.opacity="",this._resumeTimer()}static dismissAll(){for(let s of[...y._queue,...y._snackbars])s.dismiss()}_leaveQueue(){if(this._dismissed)return!0;let s=y._queue.indexOf(this);return s<0?!1:(y._queue.splice(s,1),this._drop(),!0)}_drop(){this._dismissed=!0,this.el&&this._remove(!1),this.options.completeCallback?.()}_createSnackbar(){let s=this.options.snackbarId?u.getElementById(this._portal,this.options.snackbarId):document.createElement("div");if(s instanceof HTMLTemplateElement)s=s.content.cloneNode(!0).firstElementChild;else if(s&&this.options.snackbarId){let e=document.createComment("");s.before(e);let i=[...s.childNodes],n=["class","style","role","aria-live","aria-atomic","inert"].map(o=>[o,s.getAttribute(o)]);this._restoreElement=()=>{s.replaceChildren(...i);for(let[o,a]of n)x(s,o,a);e.replaceWith(s)}}if(!s)throw new Error("Snackbar body not found");this._events=R(s);let t={signal:this._events.signal};if(s.classList.add("snackbar"),s.setAttribute("role","status"),s.setAttribute("aria-live","polite"),s.setAttribute("aria-atomic","true"),s.inert=!1,s.addEventListener("focusin",e=>{e.relatedTarget instanceof HTMLElement&&!s.contains(e.relatedTarget)&&(this._returnFocus=e.relatedTarget),this._pauseTimer()},t),s.addEventListener("keydown",e=>{e.key!=="Escape"||e.defaultPrevented||this._dismissed||(e.preventDefault(),e.stopPropagation(),this.dismiss())},t),s.addEventListener("focusout",()=>{clearTimeout(this._focusTimer),this._focusTimer=setTimeout(()=>this._resumeTimer(),0)},t),s.addEventListener("pointerenter",()=>this._pauseTimer(),t),s.addEventListener("pointerleave",()=>this._resumeTimer(),t),this.options.classes.length>0&&s.classList.add(...this.options.classes.split(" ").filter(Boolean)),this.message){let e=document.createElement("p");e.textContent=this.message,s.replaceChildren(e)}if(this.options.action){let e=document.createElement("button");e.type="button",e.textContent=this.options.action,e.addEventListener("click",i=>{if(i.stopPropagation(),!this._dismissed)try{typeof this.options.onAction=="function"&&this.options.onAction(),u.emit(this.el,"action")}finally{this.dismiss()}},t),s.appendChild(e)}if(this.options.dismissible){let e=document.createElement("button");e.type="button",e.className="circle",e.setAttribute("aria-label","Dismiss");let i=document.createElement("span");i.className="material-symbols",i.setAttribute("aria-hidden","true"),i.textContent="close",e.appendChild(i),e.addEventListener("click",n=>{n.stopPropagation(),this.dismiss()},t),s.appendChild(e)}return s}_remove(s=!0){if(this._events.signal.aborted)return;this._events.abort(),clearTimeout(this.counterTimeout),clearTimeout(this._transitionTimer),clearTimeout(this._dismissTimer),clearTimeout(this._focusTimer),this.counterTimeout=null,y._draggedSnackbar===this&&(y._draggedSnackbar=null,y._dragPointerId=null),this.el.Expressive_Snackbar=void 0,this._restoreElement?this._restoreElement():this.el.remove();let t=y._snackbars.indexOf(this);t>=0&&y._snackbars.splice(t,1),s&&y._advance()}static _advance(){for(;!y._replacing&&!y._snackbars.length;){let s=y._queue.shift();if(!s)return y._tidy();y._showOrDrop(s)}}static _showOrDrop(s){y._canShow(s)?s._show():s._drop()}static _canShow(s){return s._portal.isConnected?!!s.el||s._hasBody():!1}static _tidy(){y._container?.childElementCount===0&&y._removeContainer()}_animateIn(){this.el.style.display="",this.el.style.opacity="0",this.el.style.transform="translateY(24px)",this.el.style.transition=`
|
|
5
|
+
</svg></div>`,j._loadingTemplate=t.content.firstElementChild}return j._loadingTemplate.cloneNode(!0)}destroy(){this._openTimer!==void 0&&(clearTimeout(this._openTimer),this._openTimer=void 0),this._cancelPendingSearch(),this._searchAbort?.abort(),this._events.abort(),this.menu.destroy(),this.isOpen=!1,this._removeMenu();for(let t of["role","aria-autocomplete","aria-controls","data-target","aria-haspopup","aria-expanded","aria-activedescendant"])this.el.removeAttribute(t);this._statusInfo.remove(),this._announcer.remove(),super.destroy()}_setupEventHandlers(){let{signal:t}=this._events;this.el.addEventListener("blur",this._handleInputBlur,{signal:t}),this.el.addEventListener("input",this._handleInput,{signal:t}),this.el.addEventListener("focus",this._handleInputFocus,{signal:t}),this.el.addEventListener("keydown",this._handleInputKeydown,{signal:t}),this.el.addEventListener("click",this._handleInputClick,{signal:t}),this.container.addEventListener("pointerdown",this._handleContainerPointerDown,{signal:t}),this.container.addEventListener("mousedown",this._handleInertRowPress,{capture:!0,signal:t}),this.container.addEventListener("click",this._handleInertRowPress,{capture:!0,signal:t}),B(this.el,this._handleReset,t)}_setupMenu(){this.container=document.createElement("menu"),this.container.style.maxHeight=this.options.maxMenuHeight,this.container.id=`autocomplete-options-${u.guid()}`,this.container.classList.add("autocomplete-content"),this.container.ariaExpanded="true",this.container.setAttribute("role","listbox"),this.el.setAttribute("role","combobox"),this.el.setAttribute("aria-autocomplete","list"),this.el.setAttribute("aria-controls",this.container.id),this.el.setAttribute("data-target",this.container.id),this._renderMenu(),this.oldVal="",this.el.parentElement.appendChild(this.container);let t={...j.defaults.menuOptions,...this.options.menuOptions},e=t.onOpenStart,i=t.onCloseStart;t.onOpenStart=l=>{this.isOpen=!0,typeof e=="function"&&e.call(this.menu,l)},t.onCloseStart=l=>{this.isOpen=!1,typeof i=="function"&&i.call(this.menu,l)};let n=t.onItemClick;t.onItemClick=l=>{l&&(this._choose(l),typeof n=="function"&&n.call(this.menu,l))},this.menu=$.init(this.el,t),this.el.setAttribute("aria-haspopup","listbox");let o=this.el.parentElement.querySelector("label");o&&this.el.after(o),this.el.removeEventListener("click",this.menu._handleClick),this.el.removeEventListener("keydown",this.menu._handleTriggerKeydown),this.options.isMultiSelect||this._refreshInputText(),this.el.value&&this.selectOption(this.el.value);let a=document.createElement("div");a.classList.add("status-info"),a.setAttribute("aria-hidden","true"),a.setAttribute("style","position: absolute;right:0;top:0;"),this.el.parentElement.appendChild(a),this._statusInfo=a,this._announcer=document.createElement("div"),this._announcer.classList.add("autocomplete-status"),this._announcer.setAttribute("role","status"),this._announcer.setAttribute("aria-live","polite"),this._announcer.setAttribute("aria-atomic","true"),this.el.parentElement.appendChild(this._announcer),this._updateSelectedInfo()}_removeMenu(){this.container.ariaExpanded="false",this.container.parentNode.removeChild(this.container)}_startSearch(t){if(this.el.value.length>=this.options.minLength)return this._setStatusLoading(),this._queueSearch(t);this._cancelPendingSearch(),this._searchAbort?.abort(),this.menuItems=[],this._updateSelectedInfo(),this._announce("")}_queueSearch(t){this._cancelPendingSearch();let e=this.options.searchDelay;if(!t||!(e>0&&e<1/0))return this._search(this.el.value);this._searchAbort?.abort(),this._searchTimer=setTimeout(()=>{this._searchTimer=void 0,this._search(this.el.value)},e)}_cancelPendingSearch(){clearTimeout(this._searchTimer),this._searchTimer=void 0}_search(t){this._searchAbort?.abort(),this._searchAbort=new AbortController,this.options.onSearch(t,this,this._searchAbort.signal)}_dismiss(t){t.key==="Escape"&&((this.menu.isOpen||this._openTimer!==void 0)&&t.preventDefault(),this._left=!0),this.close(),this._resetCurrentElementPosition()}_options(){return this.container.querySelectorAll('li[role="option"]:not([aria-disabled="true"])')}_resetCurrentElementPosition(){this.activeIndex=-1,this._setActive(null)}_resetAutocomplete(){this.container.replaceChildren(),this._resetCurrentElementPosition(),this.oldVal=null,this._pointerDown=!1}_highlightPartialText(t,e){let i=e.toLocaleLowerCase().indexOf(t.toLocaleLowerCase()),n=i+t.length-1;return i==-1||n==-1?[e,"",""]:[e.slice(0,i),e.slice(i,n+1),e.slice(n+1)]}_createMenuItem(t,e=new Set(this.selectedValues.map(i=>i.id))){let i=document.createElement("li");i.id=`autocomplete-option-${u.guid()}`,i.setAttribute("role","option");let n=e.has(t.id);if(i.setAttribute("aria-selected",n?"true":"false"),i.setAttribute("data-id",t.id),j._markDisabled(i,t),i.setAttribute("style","display:grid; grid-auto-flow: column; user-select: none; align-items: center;"),i.tabIndex=-1,this.options.isMultiSelect){let h=document.createElement("div");h.classList.add("item-selection"),h.style.textAlign="center";let d=document.createElement("input");d.type="checkbox",d.tabIndex=-1,d.checked=n,d.disabled=t.disabled===!0;let p=document.createElement("span");p.style.paddingLeft="21px",h.append(d,p),i.appendChild(h)}let o=je(t.image,this.el.ownerDocument.baseURI);if(o){let h=document.createElement("img");h.classList.add("circle"),h.src=o,i.appendChild(h)}let a=this._createLabel(t),l=document.createElement("div");if(l.classList.add("item-text"),l.setAttribute("style","padding:5px;overflow:hidden;"),i.appendChild(l),l.appendChild(a),typeof t.description=="string"||typeof t.description=="number"&&!isNaN(t.description)){let h=document.createElement("small");h.setAttribute("style","line-height:1.3;color:grey;white-space:nowrap;text-overflow:ellipsis;display:block;width:90%;overflow:hidden;"),h.innerText=t.description,l.appendChild(h)}let c=()=>this.options.isMultiSelect?t.image?"40px min-content auto":"40px auto":t.image?"min-content auto":"auto";return i.style.gridTemplateColumns=c(),i}static _markDisabled(t,e){e.disabled===!0&&t.setAttribute("aria-disabled","true")}_createLabel(t){let e=this.el.value.toLocaleLowerCase(),i=(t.text||t.id).toString(),n=document.createElement("div");return n.setAttribute("style","line-height:1.2;font-weight:500;"),this.options.allowUnsafeHTML&&t.text?this._highlightHTML(n,i,e):this._highlightText(n,this._highlightPartialText(e,i)),n}_highlightHTML(t,e,i){t.innerHTML=e;let n=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(let o=n.nextNode();o;o=n.nextNode()){let[a,l]=this._highlightPartialText(i,o.data);if(!l)continue;let c=o.splitText(a.length);c.splitText(l.length);let h=document.createElement("span");h.classList.add("highlight"),c.replaceWith(h),h.append(c);break}}_highlightText(t,e){if(t.appendChild(document.createTextNode(e[0])),e[1]){let i=document.createElement("span");i.textContent=e[1],i.classList.add("highlight"),t.appendChild(i),t.appendChild(document.createTextNode(e[2]))}}_visibleEntries(){let t=this.options.maxResults;return Number.isFinite(t)&&t>=0?this.menuItems.slice(0,Math.floor(t)):this.menuItems}_renderMenu(){this._resetAutocomplete(),this._noResults&&this.container.append(this._createNoResultsRow()),this.menuItems.length===0&&(this.menuItems=[...this.selectedValues]);let t=new Map,e=new Set(this.selectedValues.map(n=>n.id));this._visibleEntries().forEach(n=>this._groupList(n.group,t).append(this._createMenuItem(n,e)));let i=this._createText();i&&this.container.append(this._createRow(i))}_groupList(t,e){return t?(e.has(t)||e.set(t,this._createGroup(t)),e.get(t)):this.container}_createGroup(t){let e=document.createElement("li");e.id=`autocomplete-group-${u.guid()}`,e.setAttribute("role","presentation"),e.classList.add("label","autocomplete-group-label"),e.textContent=t;let i=document.createElement("ul");i.setAttribute("role","group"),i.setAttribute("aria-labelledby",e.id),i.append(e);let n=document.createElement("li");return n.setAttribute("role","none"),n.append(i),this.container.append(n),i}_createText(){let t=this.el.value.trim();if(!this.options.allowCreate||t.length<this.options.minLength)return"";let e=t.toLocaleLowerCase();return this.menuItems.some(i=>(i.text||String(i.id)).toLocaleLowerCase()===e)?"":t}_createRow(t){let e=document.createElement("li");e.id=`autocomplete-option-${u.guid()}`,e.setAttribute("role","option"),e.setAttribute("aria-selected","false"),e.setAttribute("data-create",t),e.classList.add("autocomplete-create"),e.setAttribute("style","display:grid; user-select: none; align-items: center;"),e.tabIndex=-1;let i=document.createElement("div");return i.classList.add("item-text"),i.setAttribute("style","padding:5px;overflow:hidden;line-height:1.2;font-weight:500;"),i.textContent=this.options.i18n.create(t),e.append(i),e}_createNoResultsRow(){let t=document.createElement("li");return t.classList.add("autocomplete-no-results"),t.setAttribute("role","none"),t.setAttribute("aria-hidden","true"),t.textContent=this.options.i18n.noResults,t}_setStatusLoading(){let t=this._statusInfo;t&&t.replaceChildren(j._loadingIndicator()),this._announce(this.options.i18n.loading)}_announce(t){if(!this._announcer)return;let e=this.el.matches(":focus")&&this.el.value.length>=this.options.minLength?t:"";this._announcer.textContent!==e&&(this._announcer.textContent=e)}_resultsMessage(){let t=this._noResults?0:this._visibleEntries().filter(e=>e.disabled!==!0).length;return t?this.options.i18n.results(t):this.options.i18n.noResults}_updateSelectedInfo(){let t=this._statusInfo;t&&(this.options.isMultiSelect?t.textContent=this.selectedValues.length.toString():t.replaceChildren())}_refreshInputText(){if(this.selectedValues.length===1){let t=this.selectedValues[0];this.el.value=t.text||t.id}}_triggerChanged(){let t=this.selectedValues,e=++this._selection;this.el.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0,composed:!0})),e===this._selection&&this._notify("autocomplete",this.options.onAutocomplete,{args:[t],detail:{values:t},current:()=>e===this._selection})}setMenuItems(t,e=null,i=!0){if(j.getInstance(this.el)===this){if(i&&(i=!this._left),this._noResults=t.length===0,this.menuItems=t,e){let n=new Set(e);this.selectedValues=this.menuItems.filter(o=>n.has(o.id))}this.options.isMultiSelect?i||this._renderMenu():this._refreshInputText(),i&&this.open(),this._updateSelectedInfo(),this._announce(i?this._resultsMessage():""),e&&this._triggerChanged()}}_toggleOption(t){let e=!this.selectedValues.some(n=>n.id===t.id);e?this.selectedValues.push(t):this.selectedValues=this.selectedValues.filter(n=>n.id!==t.id);let i=Array.from(this.container.querySelectorAll("li[data-id]")).find(n=>n.getAttribute("data-id")===String(t.id));i&&(i.setAttribute("aria-selected",String(e)),i.querySelector("input").checked=e),this.el.focus()}_selectSingle(t){let e=u.focusIsIn(this.container);this._cancelPendingSearch(),this.selectedValues=[t],this._refreshInputText(),this._resetAutocomplete(),this.close(),e&&(this.oldVal=this.el.value.toLocaleLowerCase(),this.el.focus())}_choose(t){t.hasAttribute("data-create")?this._create(t.getAttribute("data-create")):this.selectOption(t.getAttribute("data-id"))}_create(t){let e=u.focusIsIn(this.container);this._cancelPendingSearch(),this.oldVal=this.el.value.toLocaleLowerCase(),this.close(),e&&this.el.focus(),this._notify("create",this.options.onCreate,{args:[t,this],detail:{text:t}})}selectOption(t){let e=this.menuItems.find(i=>String(i.id)===String(t)&&i.disabled!==!0);e&&(this.options.isMultiSelect?this._toggleOption(e):this._selectSingle(e),this._updateSelectedInfo(),this.options.isMultiSelect&&this._announce(this.options.i18n.selected(this.selectedValues.length)),this._triggerChanged())}};j.key="Expressive_Autocomplete",j._loadingTemplate=null;var it=j;var Xe=()=>typeof ElementInternals<"u"&&"setFormValue"in ElementInternals.prototype,ys=new WeakMap;function Sr(r){var s;customElements.get(r)||customElements.define(r,(s=class extends HTMLElement{constructor(){super(...arguments);this.internals=this.attachInternals();this.onFormReset=null}formResetCallback(){this.onFormReset?.()}get form(){return this.internals.form}get name(){return this.getAttribute("name")??""}get labels(){return this._input?.labels}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}get willValidate(){return this.internals.willValidate}checkValidity(){return this.internals.checkValidity()}reportValidity(){return this.internals.reportValidity()}focus(e){this._input?.focus(e)}get _input(){return this.querySelector(":scope > input")}},s.formAssociated=!0,s))}function Es(r,s){["disabled","form"].forEach(t=>w(r,t,s.getAttribute(t)))}function Ge(r,s,t){Sr(r);let e=document.createElement(r);e.style.display="contents",e.setAttribute("name",s.getAttribute("name")??""),s.removeAttribute("name"),s.replaceWith(e),e.append(s),Es(e,s);let i=new MutationObserver(()=>(Es(e,s),t()));return i.observe(s,{attributeFilter:["disabled","readonly","form"]}),ys.set(e,i),e}function Ze(r,s){ys.get(r)?.disconnect(),r.replaceWith(...r.childNodes),s.setAttribute("name",r.getAttribute("name")??"")}var kr=r=>(r.key==="ArrowLeft"||r.key==="ArrowRight")&&u.plainKey(r),Ar="expressive-chips-control",Ir=r=>(r.clipboardData?.getData("text")??"").split(/[,\t\n]/).map(s=>s.trim()).filter(Boolean),Ts={data:[],placeholder:"",secondaryPlaceholder:"",closeIconClass:"material-symbols",autocompleteOptions:{},autocompleteOnly:!1,limit:1/0,allowUserInput:!1,i18n:{remove:"Remove",required:"Add at least one item."},onChipAdd:null,onChipSelect:null,onChipDelete:null},V=class V extends b{constructor(t,e){super(t,e);this._name="";this._initialData=[];this._undo=[];this._ariaRequired=null;this._control=null;this._source=null;this._required=!1;this._handleInputPaste=t=>{let e=Ir(t);e.length<2||this._suggestionsOnly||(t.preventDefault(),e.every(i=>(this.addChip({id:i}),V.getInstance(this.el)===this)))};this._handleChipClick=t=>{let e=t.target.closest(".chip"),i=!!t.target.closest(".close");if(e){let n=this._chips.indexOf(e);if(n<0)return;i?this._deleteChip(n,"input"):this.selectChip(n)}else this._input.focus()};this._handleFocusIn=t=>{let e=t.target.closest(".chip");this._setSelected(e&&this._chips.includes(e)?e:null)};this._handleFocusOut=t=>{this.el.contains(t.relatedTarget)||this._setSelected(null)};this._handleInputFocus=()=>{this.el.classList.add("focus")};this._handleInputBlur=()=>{this.el.classList.remove("focus")};this._handleInputKeydown=t=>{if(!u.isComposing(t))if(t.key==="Enter"){if(this.hasAutocomplete&&this.autocomplete?.isOpen&&this.autocomplete.container.querySelector('[role="option"]'))return;t.preventDefault(),(!this.hasAutocomplete||!this.options.autocompleteOnly)&&this.addChip({id:this._input.value.trim()}),this._input.value="",this.autocomplete?.close()}else this._leavesInput(t)&&(t.preventDefault(),this.selectChip(this.chipsData.length-1))};this._addClass(this.el,"chips"),this.chipsData=[],this._chips=[],this._takeName(),this._takeInitialData(this.options.data),this.chipsData.length&&this._renderChips(),this.options.allowUserInput&&(this._addClass(this.el,"field"),this._setupInput(),this._setupEventHandlers(),this.el.append(this._end)),this._setupLabel(),this._sync(),this._initialData=[...this.chipsData]}_setSelected(t){this._selectedChip?.classList.remove("selected"),this._selectedChip=t,t?.classList.add("selected")}static get defaults(){return Ts}getData(){return this.chipsData}destroy(){this.autocomplete&&it.getInstance(this._input)===this.autocomplete&&this.autocomplete.destroy(),this._events.abort(),this._chips.forEach(t=>t.remove()),this._chips=[],this._giveNameBack(),this.el.classList.remove("focus"),this._undo.reverse().forEach(t=>t()),this._undo=[],super.destroy()}_setupEventHandlers(){let{signal:t}=this._events;this.el.addEventListener("click",this._handleChipClick,{signal:t}),this.el.addEventListener("keydown",V._handleChipsKeydown,{signal:t}),this.el.addEventListener("focusin",this._handleFocusIn,{signal:t}),this.el.addEventListener("focusout",this._handleFocusOut,{signal:t}),this._input.addEventListener("focus",this._handleInputFocus,{signal:t}),this._input.addEventListener("blur",this._handleInputBlur,{signal:t}),this._input.addEventListener("keydown",this._handleInputKeydown,{signal:t}),this._input.addEventListener("paste",this._handleInputPaste,{signal:t})}_takeName(){let t=this._editorInput();this._name=t?.getAttribute("name")??"",this._name&&Xe()&&this._wrap(t)}_wrap(t){this._source=t,this._takeRequired(t),this._control=Ge(Ar,t,()=>this._validate()),this._control.onFormReset=()=>this._resetChips(),this._validate()}_editorInput(){return this.options.allowUserInput?this.el.querySelector('input:is(:not([type]), [type="text"])'):null}get _end(){return this._control??this._input}_sync(){if(!this._control)return;let t=new FormData;this.chipsData.forEach(e=>t.append(this._name,String(e.id))),this._control.internals.setFormValue(t),this._validate()}_takeRequired(t){this._required=t.required,this._required&&(this._ariaRequired=t.getAttribute("aria-required"),t.required=!1,t.setAttribute("aria-required","true"))}_validate(){let t=this._control.internals;this._required&&!this._source.readOnly&&!this.chipsData.length?t.setValidity({valueMissing:!0},this._requiredMessage,this._anchor):t.setValidity({})}get _anchor(){return this._control.contains(this._source)?this._source:void 0}get _requiredMessage(){return this.options.i18n.required||Ts.i18n.required}_resetChips(){this._setSelected(null),this._chips.forEach(t=>t.remove()),this.chipsData=[...this._initialData],this._chips=this.chipsData.map(t=>this._renderChip(t)),this._control.before(...this._chips),this._setPlaceholder(),this._sync()}_giveNameBack(){this._control&&(Ze(this._control,this._source),this._control=null,this._required&&(this._source.required=!0,w(this._source,"aria-required",this._ariaRequired)))}get _suggestionsOnly(){return this.hasAutocomplete&&this.options.autocompleteOnly}static _backKey(t){return getComputedStyle(t).direction==="rtl"?"ArrowRight":"ArrowLeft"}static _handleChipsKeydown(t){let e=t.target.closest(".chips"),i=t.target.tagName;if(i==="INPUT"||i==="TEXTAREA"||!e)return;let n=V.getInstance(e);if(n){if(t.key==="Backspace"||t.key==="Delete"){let o=n._chips.indexOf(t.target.closest(".chip"));if(o<0)return;t.preventDefault(),n._deleteChip(o,"previous")}else if(kr(t)){let o=t.target.closest(".chip")??n._selectedChip,a=n._chips.indexOf(o);if(a<0)return;if(t.key===V._backKey(e))a>0&&n.selectChip(a-1);else{let l=a+1;l>=n.chipsData.length?(n._setSelected(null),n._input.focus()):n.selectChip(l)}}}}_leavesInput(t){return this._input.value===""&&this.chipsData.length>0&&u.plainKey(t)&&["Backspace",V._backKey(this.el)].includes(t.key)}_renderChip(t){if(!t.id&&t.id!==0)return;let e=t.text||t.id,i=document.createElement("span");if(i.classList.add("chip"),i.innerText=e,t.image){let n=document.createElement("img");n.setAttribute("src",t.image),i.insertBefore(n,i.firstChild)}if(this.options.allowUserInput){let n=document.createElement("button");n.type="button",n.classList.add("close"),n.setAttribute("aria-label",`${this.options.i18n.remove} ${e}`);let o=document.createElement("span");o.classList.add(this.options.closeIconClass),o.setAttribute("aria-hidden","true"),o.innerText="close",n.appendChild(o),i.appendChild(n)}return i}_takeInitialData(t){for(let e of t)this.chipsData.length<this.options.limit&&this._isValidAndNotExist(e)&&this.chipsData.push(e)}_renderChips(){this._chips=[];for(let t=0;t<this.chipsData.length;t++){let e=this._renderChip(this.chipsData[t]);this.el.appendChild(e),this._chips.push(e)}}_setupAutocomplete(){this.options.autocompleteOptions.onAutocomplete=e=>{V.getInstance(this.el)===this&&e.length>0&&(this.addChip({id:e[0].id,text:e[0].text,image:e[0].image}),this._input.value="",this._input.focus())};let t=this.options.autocompleteOptions.onCreate;this.autocomplete=it.init(this._input,{...this.options.autocompleteOptions,onCreate:(e,i)=>{this._addTyped(e),typeof t=="function"&&t.call(i,e,i)}})}_addTyped(t){V.getInstance(this.el)===this&&(this.addChip({id:t.trim()}),this._input.value="",this._input.focus())}_setupInput(){if(this._input=this.el.querySelector("input"),!this._input){let t=this._input=document.createElement("input");this.el.append(t),this._undo.push(()=>t.remove())}this._addClass(this._input,"input"),this._keepAttribute(this._input,"placeholder"),this.hasAutocomplete=Object.keys(this.options.autocompleteOptions).length>0,this.hasAutocomplete&&this._setupAutocomplete(),this._setPlaceholder(),this._input.getAttribute("id")||(this._keepAttribute(this._input,"id"),this._input.setAttribute("id",u.guid()))}_setupLabel(){this._label=this.el.querySelector("label"),!(!this._label||!this._input)&&(this._keepAttribute(this._label,"for"),this._label.setAttribute("for",this._input.getAttribute("id")))}_addClass(t,e){if(t.classList.contains(e))return;let i=t.hasAttribute("class");t.classList.add(e),this._undo.push(()=>{t.classList.remove(e),!i&&!t.classList.length&&t.removeAttribute("class")})}_keepAttribute(t,e){let i=t.getAttribute(e);this._undo.push(()=>w(t,e,i))}_setPlaceholder(){this._input&&(!this.chipsData.length&&this.options.placeholder?this._input.placeholder=this.options.placeholder:this.chipsData.length&&this.options.secondaryPlaceholder&&(this._input.placeholder=this.options.secondaryPlaceholder))}_isValidAndNotExist(t){let e=(!!t.id||t.id===0)&&String(t.id).trim()!=="",i=!this.chipsData.some(n=>String(n.id)===String(t.id));return e&&i}addChip(t){if(!this._isValidAndNotExist(t)||this.chipsData.length>=this.options.limit)return;let e=this._renderChip(t);this._chips.push(e),this.chipsData.push(t),this._end?this._end.before(e):this.el.append(e),this._setPlaceholder(),this._sync(),this._notify("chip-add",this.options.onChipAdd,{args:[this.el,e],detail:{chip:e},current:()=>this._chips.includes(e)})}deleteChip(t){let e=this.el.getRootNode();this._deleteChip(t,this._chips[t]?.contains(e.activeElement)?"input":null)}_deleteChip(t,e){let i=this._chips[t];if(!i)return;this._selectedChip===i&&this._setSelected(null),i.remove(),this._chips.splice(t,1),this.chipsData.splice(t,1),this._setPlaceholder(),this._sync();let n=[],o=this.el.getRootNode();for(;o;)n.push({root:o,element:o.activeElement}),o="host"in o?o.host.getRootNode():null;this._notify("chip-delete",this.options.onChipDelete,{args:[this.el,i],detail:{chip:i},current:()=>!this._chips.includes(i)}),!(!e||n.some(({root:a,element:l})=>a.activeElement!==l)||V.getInstance(this.el)!==this)&&(e==="previous"&&this._chips.length?this.selectChip(Math.max(t-1,0)):(this._setSelected(null),this._input?.focus()))}selectChip(t){let e=this._chips[t];e&&(this._setSelected(e),e.querySelector(".close")?.focus(),this._notify("chip-select",this.options.onChipSelect,{args:[this.el,e],detail:{chip:e},current:()=>this._selectedChip===e}))}static Init(){u.onDocumentReady(()=>{document.querySelectorAll(".chips").forEach(e=>{e.addEventListener("click",i=>{if(!i.target.closest(".close"))return;let n=i.target.closest(".chip");n&&!V.getInstance(e)?._chips.includes(n)&&n.remove()})})})}};V.key="Expressive_Chips";var rt=V;var Hr={},Ce=new WeakMap,Se=class Se extends b{constructor(t,e){super(t,e);this._resizeObserver=null;this._handleRangeChange=()=>{this._clampDual(),this._sync(),this.thumb.classList.add("active")};this._handleRangePointerDown=t=>{t.isPrimary&&(t.pointerType==="mouse"&&t.button!==0||(this._pointerDown=!0,this.el.classList.add("active"),this._clampDual(),this._sync(),this.thumb.classList.add("active")))};this._handleRangeInput=()=>{this._clampDual(),this._sync(),this.thumb.classList.add("active")};this._handleRangePointerUp=t=>{t.isPrimary&&(this._pointerDown=!1,this.el.classList.remove("active"))};this._handleRangeRelease=()=>{this._pointerDown||this.thumb.classList.remove("active")};this._pointerDown=!1,this._setupThumb(),this._sync(),this._setupEventHandlers(),this._resizeObserver=new ResizeObserver(()=>this._sync()),this._resizeObserver.observe(this.el),this.el.parentElement&&this._resizeObserver.observe(this.el.parentElement)}static get defaults(){return Hr}destroy(){this._resizeObserver?.disconnect(),this._removeThumb(),super.destroy();let t=this._host();for(let e of[this.el,t]){for(let i in Ce.get(e))e.style.setProperty(i,Ce.get(e)[i]);Ce.delete(e)}t?.querySelectorAll('input[type="range"]').forEach(e=>Se.getInstance(e)?._sync())}_set(t,e,i){let n=Ce.get(t)??{};Ce.set(t,n),n[e]??(n[e]=t.style.getPropertyValue(e)),t.style.setProperty(e,i)}_setupEventHandlers(){let{signal:t}=this._events;this.el.addEventListener("change",this._handleRangeChange,{signal:t}),this.el.addEventListener("pointerdown",this._handleRangePointerDown,{signal:t}),this.el.addEventListener("input",this._handleRangeInput,{signal:t}),this.el.addEventListener("pointerup",this._handleRangePointerUp,{signal:t}),this.el.addEventListener("pointercancel",this._handleRangePointerUp,{signal:t}),this.el.addEventListener("blur",this._handleRangeRelease,{signal:t}),this.el.addEventListener("mouseout",this._handleRangeRelease,{signal:t}),B(this.el,()=>this._sync(),t)}_setupThumb(){this.thumb=document.createElement("span"),this.value=document.createElement("span"),this.thumb.classList.add("thumb"),this.value.classList.add("value"),this.thumb.append(this.value),this.el.after(this.thumb)}_removeThumb(){this.thumb.remove()}_isVertical(){return!!this.el.closest(".vertical")}_host(){return this.el.closest(".slider, label")}_clampDual(){let e=this._host()?.querySelectorAll('input[type="range"]');if(!e||e.length!==2)return;let i=e[0],n=e[1];this.el===i&&+i.value>+n.value&&(i.value=n.value),this.el===n&&+n.value<+i.value&&(n.value=i.value)}_bounds(t){let e=parseFloat(t.max);return{max:Number.isNaN(e)?100:e,min:parseFloat(t.min)||0}}_fraction(t){let{max:e,min:i}=this._bounds(t),n=parseFloat(t.value)||0;return e===i?0:(n-i)/(e-i)}_sync(){let t=this._fraction(this.el),e=`${t*100}%`,i=this.el.offsetLeft,n=this.el.offsetTop,o=this.el.offsetWidth,a=this.el.offsetHeight,l=getComputedStyle(this.el),c=l.direction==="rtl",h=this._isVertical(),d=parseFloat(l.getPropertyValue("--md-comp-slider-handle-width"))||4,p=h?a:o,_=d/2+t*(p-d);this._set(this.el,"--md-comp-slider-active-fraction",e),this._set(this.el,"--md-comp-slider-active-position",`${_}px`);let m=this._host(),E=m?.querySelectorAll('input[type="range"]');if(m&&E&&E.length===2){let T=Array.from(E).map(C=>this._fraction(C));this._set(m,"--md-comp-slider-start-fraction",`${Math.min(...T)*100}%`),this._set(m,"--md-comp-slider-end-fraction",`${Math.max(...T)*100}%`),this._set(m,"--md-comp-slider-start-position",`${d/2+Math.min(...T)*(p-d)}px`),this._set(m,"--md-comp-slider-end-position",`${d/2+Math.max(...T)*(p-d)}px`)}if(m?.classList.contains("stops")){let{max:T,min:C}=this._bounds(this.el),g=parseFloat(this.el.step),L=g>0&&Number.isFinite(g)&&T>C;this._set(m,"--md-comp-slider-stop-count",L?String(Math.floor((T-C)/g+1e-9)+1):""),this._set(m,"--md-comp-slider-stop-spacing",L?`${(p-d)*g/(T-C)}px`:""),E?.length===1&&(this._set(m,"--md-comp-slider-active-position",`${_}px`),this._set(m,"--md-comp-slider-track-center",`${n+a/2}px`))}this.value.textContent=this.el.value,h?(this.thumb.style.left=`${i+o/2}px`,this.thumb.style.top=`${n+a-_}px`):(this.thumb.style.left=`${i+(c?o-_:_)}px`,this.thumb.style.top=`${n}px`)}static Init(){u.onDocumentReady(()=>{Se.init(document.querySelectorAll("input[type=range]:not(.image-compare > input, .color-picker-hue)"))})}};Se.key="Expressive_Slider";var Gt=Se;function Fi(r,s){let t=document.createElement(r);return t.textContent=s,t}function Ls(r,s){let t=Fi("button",r);return t.type="submit",t.value=s,t}var D=class D{static confirm(s){let t=D._confirmDialog(s);return document.body.append(t),t.showModal(),new Promise(e=>{let i=new MutationObserver(()=>{t.isConnected||n(!1)}),n=o=>{i.disconnect(),t.remove(),e(o)};i.observe(document,{childList:!0,subtree:!0}),t.addEventListener("close",()=>n(t.returnValue==="confirm"),{once:!0})})}static _confirmDialog({text:s,headline:t,confirm:e,cancel:i}){let n=document.createElement("dialog");n.setAttribute("role","alertdialog");let o=`expressive-confirm-${++D._confirms}`,a=Fi("p",s);a.id=`${o}-text`;let l=Ls(i??D.i18n.cancel,"");l.className="text",l.autofocus=!0;let c=document.createElement("form");return c.method="dialog",c.append(l,Ls(e??D.i18n.confirm,"confirm")),n.append(a,c),D._name(n,a,o,t),n}static _name(s,t,e,i){if(!i){s.setAttribute("aria-labelledby",t.id);return}let n=Fi("h2",i);n.id=`${e}-headline`,s.prepend(n),s.setAttribute("aria-labelledby",n.id),s.setAttribute("aria-describedby",t.id)}static Init(){u.onDocumentReady(()=>{document.addEventListener("pointerdown",D._onPointerDown,{passive:!0}),document.addEventListener("pointerup",D._onPointerUp,{passive:!0}),document.addEventListener("pointercancel",D._onPointerCancel,{passive:!0})})}static _onPointerDown(s){let t=D._isPrimaryPress(s)?D._backdropDialog(s):null;D._down=t&&D._lightDismissible(t)&&D._outside(s,t)?{dialog:t,pointerId:s.pointerId}:null}static _onPointerUp(s){let t=D._down;D._down=null,!(!t||t.pointerId!==s.pointerId)&&(!t.dialog.isConnected||!t.dialog.open||D._lightDismissible(t.dialog)&&D._backdropDialog(s)===t.dialog&&D._outside(s,t.dialog)&&t.dialog.close())}static _onPointerCancel(){D._down=null}static _backdropDialog(s){let t=u.eventTarget(s);return!(t instanceof HTMLDialogElement)||!t.open?null:t}static _outside(s,t){let e=t.getBoundingClientRect();return s.clientX<e.left||s.clientX>e.right||s.clientY<e.top||s.clientY>e.bottom}static _isPrimaryPress(s){return s.isPrimary?s.pointerType!=="mouse"||s.button===0:!1}static _lightDismissible(s){let t=s.getAttribute("closedby");return t==="any"?!("closedBy"in HTMLDialogElement.prototype):t!=="none"&&t!=="closerequest"}};D.i18n={confirm:"OK",cancel:"Cancel"},D._down=null,D._confirms=0;var Zt=D;function Or(r,s,{damping:t,stiffness:e},i){let n=Math.sqrt(e);if(t>=1)return Math.exp(-n*i)*(r+(s+n*r)*i);let o=n*Math.sqrt(1-t*t);return Math.exp(-t*n*i)*(r*Math.cos(o*i)+(s+t*n*r)/o*Math.sin(o*i))}function xs(r,s,t,e){let i=[r],[n,o]=[r-s,t*1e3];for(let a=1;a<300;a++){let l=Or(n,o,e,a/60);if(i.push(s+l),Math.abs(l)<.5&&Math.abs(s+l-i[a-1])<.5)break}return i.push(s),i}function ws(r,s){let t=getComputedStyle(r),e=o=>parseFloat(t.getPropertyValue(`--md-sys-motion-spring-${s}-${o}`)),[i,n]=[e("damping"),e("stiffness")];return i>0&&n>0?{damping:i,stiffness:n}:null}function Ms(r,s,t,e){let i=t.map(n=>({[s]:e(n)}));return r.animate(i,{duration:(t.length-1)*1e3/60,easing:"linear"})}var Cs="(prefers-reduced-motion: reduce)",Bi=96,$i=.5,Dr=100,Pr=4,Ss=r=>Date.now()-r.lastT<Dr?r.velocity:0,Rr=(r,s)=>r.shift*r.direction>Bi||s*r.direction>$i,Ni=new WeakMap;function Fr(r,s){let t=Ni.get(r);if(!t)return 0;let[e,i="0"]=getComputedStyle(r).translate.split(" ");return t(!1),parseFloat(s==="x"?e:i)||0}var ks=new Set;function Qe(r){if(ks.has(r.selector))return;ks.add(r.selector);let s=g=>r.axis==="x"?g.clientX:g.clientY,t,e=null,i=g=>{let L=u.closestInPath(g,r.selector);return L instanceof HTMLDialogElement?L:null},n=g=>{g.style.transition="",g.style.setProperty(r.property,"0px")},o=g=>{if(!g.isPrimary||g.pointerType==="mouse"&&g.button!==0)return;C(),r.onPress?.();let L=i(g);if(!L?.open||!r.inHandle(g,L))return;L.style.transition="none";let S=s(g),P=Fr(L,r.axis);L.style.setProperty(r.property,`${P}px`),e={dialog:L,pointerId:g.pointerId,direction:r.direction(L),start:S-P,last:S,lastT:Date.now(),velocity:0,shift:P};let N={childList:!0,subtree:!0,attributes:!0,attributeFilter:["open"],attributeOldValue:!0},ut=L.getRootNode();t.observe(document,N),ut!==document&&t.observe(ut,N)},a=g=>{if(!e||e.pointerId!==g.pointerId)return;if(!e.dialog.open||!e.dialog.isConnected){C();return}let L=s(g),S=L-e.start;if(e.shift=e.direction===1?Math.max(0,S):Math.min(0,S),L!==e.last){let P=Date.now();e.velocity=(L-e.last)/Math.max(1,P-e.lastT),e.last=L,e.lastT=P}e.dialog.style.setProperty(r.property,`${e.shift}px`)},l=g=>{let L=e;if(!(!L||L.pointerId!==g.pointerId)){if(!L.dialog.open||!L.dialog.isConnected){C();return}a(g),e=null,t.disconnect(),c(L)}},c=g=>{let L=d(g);g.dialog.style.transition="",h(g,!T(g)&&g.dialog.open?L:null)},h=(g,L)=>{L&&(g.dialog.style.transition="none"),g.dialog.style.setProperty(r.property,"0px"),L&&_(g,L)},d=g=>!g.shift||matchMedia(Cs).matches||!p(g.dialog)?null:ws(g.dialog,"default-spatial"),p=g=>{let L=getComputedStyle(g),S=N=>L.getPropertyValue(N).trim(),P="--md-sys-motion-spring-default-spatial";return S(r.motion)===S(P)&&S(`${r.motion}-duration`)===S(`${P}-duration`)},_=(g,L)=>{let S=g.dialog,P=r.axis==="x"?tt=>`${tt}px 0`:tt=>`0 ${tt}px`,N=Ms(S,"translate",xs(g.shift,0,Ss(g),L),P),ut=matchMedia(Cs),Ke=new MutationObserver(()=>S.open||xe(!0)),xe=tt=>{Ni.delete(S),Ke.disconnect(),ut.removeEventListener("change",J),N.onfinish=null,N.cancel(),tt&&(S.style.transition="")},J=()=>xe(!0);Ni.set(S,xe),N.onfinish=J,ut.addEventListener("change",J),Ke.observe(S,{attributes:!0,attributeFilter:["open"]})},m=r.onRelease??(()=>{}),E=r.release??(()=>!1),T=g=>{let L=Ss(g),S=g.last-g.start,P=Math.abs(S)>Pr;m(P);let N=!P||E(g.dialog,S,L);return!N&&Rr(g,L)&&g.dialog.close(),N},C=g=>{if(g&&e?.pointerId!==g.pointerId)return;t.disconnect(),m(!1);let L=e;e=null,L&&n(L.dialog)};u.onDocumentReady(()=>{t=new MutationObserver(g=>{let L=e?.dialog;L&&(!L.open||!L.isConnected||g.some(S=>S.type==="attributes"&&S.target===L&&S.oldValue===null||[...S.removedNodes].some(P=>P.contains(L))))&&C()}),document.addEventListener("pointerdown",o,{passive:!0}),document.addEventListener("pointermove",a,{passive:!0}),document.addEventListener("pointerup",l,{passive:!0}),document.addEventListener("pointercancel",C,{passive:!0})})}var qi="dialog.bottom-sheet",Nr=48,As=(r,s,t,e)=>t*r>s||e*r>$i,q=class q{static Init(){Qe({selector:qi,axis:"y",property:"--md-comp-bottom-sheet-shift",motion:"--md-comp-bottom-sheet-motion",direction:()=>1,inHandle:(s,t)=>{let e=u.closestInPath(s,".drag-handle");if(e)return e.parentElement===t;let i=t.getBoundingClientRect();return s.clientY>=i.top&&s.clientY<=i.top+48},onPress:()=>{q._dragged=!1},onRelease:s=>{q._dragged=s},release:(s,t,e)=>q._resize(s,t,e)}),u.onDocumentReady(()=>{document.addEventListener("click",q._onClick),document.addEventListener("close",q._onClose,!0)})}static _resize(s,t,e){if(!s.classList.contains("expandable"))return!1;let i=s.classList.contains("expanded"),n=i?!As(1,Bi,t,e):As(-1,Nr,t,e);return n===i?!1:(q.setExpanded(s,n),!0)}static setExpanded(s,t){s.classList.toggle("expanded",t),t&&s.addEventListener("close",q._onClose,{once:!0}),s.querySelector(":scope > button.drag-handle")?.setAttribute("aria-expanded",String(t))}static _onClose(s){let t=s.target;t.matches?.(`${qi}.expandable`)&&q.setExpanded(t,!1)}static _onClick(s){let t=u.closestInPath(s,".drag-handle");if(!(t instanceof HTMLButtonElement)||s.detail!==0&&q._dragged)return;let e=t.parentElement;e?.matches(`${qi}[open]`)&&q._activate(e)}static _activate(s){s.classList.contains("expandable")?q.setExpanded(s,!s.classList.contains("expanded")):s.close()}};q._dragged=!1;var Qt=q;var Br=r=>r.classList.contains("start"),Is=r=>Br(r)!==(getComputedStyle(r).direction==="rtl"),Jt=class{static Init(){Qe({selector:"dialog.side-sheet",axis:"x",property:"--md-comp-side-sheet-shift",motion:"--md-comp-side-sheet-motion",direction:s=>Is(s)?-1:1,inHandle:(s,t)=>{let e=t.querySelector(":scope > header");if(e&&s.composedPath().includes(e))return!0;let i=t.getBoundingClientRect();return Is(t)?s.clientX>=i.right-24&&s.clientX<=i.right:s.clientX>=i.left&&s.clientX<=i.left+24}})}};var zi='.drop-zone input[type="file"]:is([data-validate-types], [data-max-size], [data-max-files])';function Je(r,s){let t=(r.getAttribute(s)||"").trim();if(!/^\d+$/.test(t))return 0;let e=Number(t);return Number.isSafeInteger(e)?e:0}function $r(r){return r.endsWith("/*")?/^(image|audio|video)\/\*$/.test(r):/^\.[^\s/\\]+$/.test(r)||/^[!#$%&'*+.^_`|~0-9a-z-]+\/[!#$%&'*+.^_`|~0-9a-z-]+$/.test(r)}function qr(r,s){return s.startsWith(".")?r.name.toLowerCase().endsWith(s):s.endsWith("/*")?r.type.toLowerCase().startsWith(s.slice(0,-1)):r.type.toLowerCase()===s}var v=class v{static validateField(s){if(!s){console.error("No text field element found");return}if(v._validatedFile(s)){v._validateFiles(s);return}s.classList.contains("validate")&&(v._markInvalid(s,v._fails(s)),v._describeByError(s))}static _markInvalid(s,t){s.classList.toggle("invalid",t),t?s.setAttribute("aria-invalid","true"):s.removeAttribute("aria-invalid")}static _fails(s){return!v._blankOptional(s)&&(!s.validity.valid||s.value.length>parseInt(s.getAttribute("data-length")))}static _blankOptional(s){return s.value.length===0&&!s.validity.badInput&&!s.required}static _describeByError(s){let t=s.parentElement?.querySelector(":scope > [data-error]");t&&v._addDescription(s,v._idOf(t))}static _idOf(s){return s.id||(s.id=`field-error-${u.guid()}`),s.id}static _addDescription(s,t){let e=(s.getAttribute("aria-describedby")??"").split(/\s+/).filter(Boolean);e.includes(t)||s.setAttribute("aria-describedby",[...e,t].join(" "))}static textareaAutoResize(s){let t=s;if(!t)return;t.hasAttribute("original-height")||v._measureTextarea(t);let e=parseInt(t.getAttribute("original-height"));if(isNaN(e))return;t.style.height="auto";let i=t.offsetHeight-t.clientHeight,n=t.scrollHeight+i;t.style.height=Math.max(e,n)+"px"}static _measureTextarea(s){let t=s.getBoundingClientRect().height;t&&s.setAttribute("original-height",t.toString())}static _validatedFile(s){return s.matches(zi)||v._fileErrors.has(s)}static _rejectedTypes(s){let t=s.accept.split(",").map(e=>e.trim().toLowerCase()).filter($r);return t.length?Array.from(s.files??[]).filter(e=>!t.some(i=>qr(e,i))):[]}static _validateFiles(s){if(s.matches(":disabled"))return;v._bindShadowForm(s);let t=v._checkFiles(s);return v._showFileError(s,t?.message??s.validationMessage),t}static _checkFiles(s){if(v._clearFileError(s),!s.matches(zi)){v._fileErrors.delete(s);return}v._fileErrors.set(s,"");let t=v._fileFailure(s);return t&&v._setFileError(s,t.message),t}static _fileFailure(s){return v._typeFailure(s)??v._sizeFailure(s)??v._countFailure(s)}static _typeFailure(s){if(!s.hasAttribute("data-validate-types"))return;let t=v._rejectedTypes(s);if(t.length)return{rejected:t,reason:"type",message:v._fileTypeMessage(s)}}static _sizeFailure(s){let t=Je(s,"data-max-size");if(!t)return;let e=Array.from(s.files??[]).filter(i=>i.size>t);if(e.length)return{rejected:e,reason:"size",message:v._fileSizeMessage(s,t)}}static _fileSizeMessage(s,t){return v._fileError(s)?.getAttribute("data-error-size")?.trim()||`Maximum file size: ${t} bytes.`}static _countFailure(s){let t=Je(s,"data-max-files");if(!t)return;let e=Array.from(s.files??[]);if(e.length>t)return{rejected:e,reason:"count",message:v._fileCountMessage(s,t)}}static _fileCountMessage(s,t){return v._fileError(s)?.getAttribute("data-error-count")?.trim()||`Maximum file count: ${t}.`}static _clearFileError(s){let t=v._fileErrors.get(s);t&&t===s.validationMessage&&s.setCustomValidity("")}static _setFileError(s,t){s.validity.customError||(s.setCustomValidity(t),v._fileErrors.set(s,t))}static _fileTypeMessage(s){return v._fileError(s)?.getAttribute("data-error")?.trim()||`Choose files matching: ${s.accept}.`}static _fileError(s){return Array.from(s.closest(".drop-zone")?.children??[]).find(t=>t.hasAttribute("data-error"))}static _showFileError(s,t){v._markInvalid(s,!s.validity.valid);let e=v._fileError(s);e&&(v._addDescription(s,v._idOf(e)),e.textContent=t,e.hidden=!t)}static _updateDropZone(s){v._bindShadowForm(s);let t=s.closest(".drop-zone"),e=Array.from(s.files??[]),i=v._validateDropZone(s);v.listDropZoneFiles(t,s),v._reportFileRejection(s,e,i)}static _validateDropZone(s){if(v._validatedFile(s))return v._validateFiles(s);v.validateField(s)}static _reportFileRejection(s,t,e){if(!s.matches(zi)){v._fileSelections.delete(s);return}v._newFileSelection(s,t)&&e&&u.emit(s.closest(".drop-zone"),"reject",{input:s,files:t.slice(),rejected:e.rejected.slice(),reason:e.reason})}static _newFileSelection(s,t){let e=JSON.stringify([s.hasAttribute("data-validate-types"),s.accept,Je(s,"data-max-size"),Je(s,"data-max-files")]),i=v._fileSelections.get(s);return v._fileSelections.set(s,{files:t,constraints:e}),!i||i.constraints!==e||i.files.length!==t.length||!i.files.every((n,o)=>n===t[o])}static _bindShadowForm(s){if(s.getRootNode().host)for(let t of["submit","reset"])s.form?.addEventListener(t,v.resetFormExtras,!0)}static _resetFileInput(s){s.files?.length||(v._fileSelections.delete(s),v._resetFileList(s),v._resetFileValidity(s))}static _resetFileList(s){let t=s.closest(".drop-zone");t&&(v.listDropZoneFiles(t,s),t.classList.remove("dragover"))}static _resetFileValidity(s){s.matches(":disabled")||v._validatedFile(s)&&(v._clearFileError(s),v._fileErrors.delete(s),v._showFileError(s,s.validationMessage))}static _afterReset(s){let t=Array.from(s.elements);t.filter(i=>i instanceof HTMLInputElement&&i.type==="file").forEach(v._resetFileInput),t.filter(i=>i.classList.contains("validate")).forEach(i=>v._markInvalid(i,!1)),t.filter(i=>i.classList.contains("expressive-textarea")).forEach(v.textareaAutoResize);let e=s.querySelector(".error-summary");e&&(e.hidden=!0,e.querySelector("ul, ol")?.replaceChildren())}static Init(){v._initialized||(v._initialized=!0,u.onDocumentReady(()=>{document.addEventListener("input",v._onFileInput),document.addEventListener("change",s=>{let t=u.eventTarget(s);if(t instanceof HTMLInputElement){if(t.matches('.drop-zone input[type="file"]')){v._onFileInput(s);return}v.validateField(t)}}),document.addEventListener("click",v.togglePassword),document.addEventListener("click",v.stepNumber),document.addEventListener("submit",v.resetFormExtras,!0),document.addEventListener("submit",v.summarizeErrors,!0),document.addEventListener("click",v.focusSummaryField),document.addEventListener("reset",v.resetFormExtras,!0);for(let s of["dragenter","dragover","dragleave","drop"])document.addEventListener(s,v.markDropZone);document.querySelectorAll(".expressive-textarea").forEach(s=>{v.InitTextarea(s)}),document.querySelectorAll('.file-field input[type="file"]').forEach(s=>{v.InitFileInputPath(s)})}))}static togglePassword(s){let t=u.closestInPath(s,".password-toggle"),e=t?.closest(".field")?.querySelector('input[type="password"], input[data-password]');if(!e)return;v._bindShadowForm(e);let i=e.type==="password";e.toggleAttribute("data-password",i),e.type=i?"text":"password",t.setAttribute("aria-pressed",String(i))}static stepNumber(s){let t=u.closestInPath(s,".field > [data-step]:not(:disabled)"),e=t?.parentElement.querySelector(':scope > input[type="number"]:not(:disabled, [readonly], [step="any"])');if(!e)return;let i=e.value;e[t.dataset.step==="down"?"stepDown":"stepUp"](),e.value!==i&&(e.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),e.dispatchEvent(new Event("change",{bubbles:!0})))}static resetFormExtras(s){let t=s.target;t instanceof HTMLFormElement&&(t.querySelectorAll("input[data-password]").forEach(e=>{e.removeAttribute("data-password"),e.type="password",e.closest(".field")?.querySelector(".password-toggle")?.setAttribute("aria-pressed","false")}),s.type==="reset"&&setTimeout(()=>{s.defaultPrevented||v._afterReset(t)},0))}static summarizeErrors(s){let t=s.target;if(!(t instanceof HTMLFormElement))return;let e=t.querySelector(".error-summary"),i=e?.querySelector("ul, ol");if(!i||s.submitter?.hasAttribute("formnovalidate"))return;if(t.checkValidity()){e.hidden=!0,i.replaceChildren();return}s.preventDefault(),s.stopPropagation();let n=new Set,o=[...t.elements].flatMap(a=>{if(!a.willValidate||a.validity.valid)return[];if(a.type==="radio"){if(n.has(a.name))return[];n.add(a.name)}a.id||(a.id=`field-${u.guid()}`);let h=((a.type==="radio"?a.closest("fieldset")?.querySelector("legend"):null)??a.labels?.[0]??a.closest(".field")?.querySelector("label"))?.cloneNode(!0);h?.querySelectorAll("select, textarea").forEach(m=>m.remove());let d=h?.textContent??a.getAttribute("aria-label")??"",p=document.createElement("a");p.href=`#${a.id}`,p.textContent=[d.replace(/\s+/g," ").trim(),a.validationMessage].filter(Boolean).join(": ");let _=document.createElement("li");return _.append(p),[_]});i.replaceChildren(...o),e.hasAttribute("tabindex")||(e.tabIndex=-1),e.hidden=!1,e.focus()}static focusSummaryField(s){let t=u.closestInPath(s,'.error-summary a[href^="#"]'),e=t&&u.getElementById(t,t.getAttribute("href").slice(1));e&&(s.preventDefault(),e.focus())}static markDropZone(s){let t=u.eventTarget(s);if(!(t instanceof HTMLInputElement)||t.type!=="file")return;let e=t.closest(".drop-zone");if(!e)return;let i=s.type==="dragenter"||s.type==="dragover";e.classList.toggle("dragover",i&&!t.disabled)}static listDropZoneFiles(s,t){let e=Array.from(s.querySelectorAll(".drop-zone-files")).find(n=>n.closest(".drop-zone")===s);if(!e)return;let i=n=>{let[o,a]=n>=1e6?[n/1e6,"megabyte"]:n>=1e3?[n/1e3,"kilobyte"]:[n,"byte"];return new Intl.NumberFormat(void 0,{style:"unit",unit:a,maximumFractionDigits:1}).format(o)};e.replaceChildren(...Array.from(t.files??[],n=>{let o=document.createElement("li"),a=document.createElement("span"),l=document.createElement("span");return a.textContent=n.name,l.textContent=i(n.size),o.append(a,l),o}))}static InitTextarea(s){s.removeAttribute("original-height"),v.textareaAutoResize(s),s.addEventListener("input",t=>v.textareaAutoResize(t.target)),s.addEventListener("focus",()=>{s.hasAttribute("original-height")||v.textareaAutoResize(s)})}static InitFileInputPath(s){s.addEventListener("change",()=>{let e=s.closest(".file-field")?.querySelector("input.file-path");e&&(e.value=Array.from(s.files,i=>i.name).join(", "),e.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0,composed:!0})))})}};v._initialized=!1,v._fileErrors=new WeakMap,v._fileSelections=new WeakMap,v._onFileInput=s=>{let t=u.closestInPath(s,'.drop-zone input[type="file"]');t&&(t.matches(":disabled")||v._updateDropZone(t))};var te=v;var zr={text:"",action:"",onAction:null,dismissible:!1,displayLength:4e3,inDuration:300,outDuration:375,classes:"",completeCallback:null,activationPercent:.8,root:null,replace:!1},y=class y{constructor(s={}){this._dismissed=!1;this._returnFocus=null;this._restoreElement=null;this.options={...y.defaults,...s},s.displayLength===void 0&&this.options.action&&(this.options.displayLength=1/0),s.dismissible===void 0&&(this.options.dismissible=y._needsClose(this.options)),this.message=this.options.text,this.panning=!1,this.timeRemaining=this.options.displayLength,this._portal=u.portalRoot(this.options.root??document.body),y._dropDetached(),this.options.snackbarId?this._requireBody():this._build(),this.options.replace?y._replaceShown(this):y._queue.push(this),y._advance()}static _needsClose(s){return!!s.action||s.displayLength===1/0}static _dropDetached(){for(let s of y._snackbars.filter(t=>!t.el.isConnected))s._dismissed=!0,s._remove(!1),s.options.completeCallback?.()}_evict(){this._dismissed||u.emit(this.el,"close"),this._dismissed=!0,u.emit(this.el,"closed"),this._restoreFocus(!0),this.options.completeCallback?.()}_requireBody(){if(!this._hasBody())throw new Error("Snackbar body not found")}_hasBody(){return!this.options.snackbarId||!!u.getElementById(this._portal,this.options.snackbarId)}_build(){this.el=this._createSnackbar(),Reflect.set(this.el,"Expressive_Snackbar",this)}static _replaceShown(s){y._replacing=!0;try{for(;y._snackbars.length;)for(let t of y._snackbars.splice(0))t._evict()}finally{y._replacing=!1}y._queue.unshift(s)}_show(){this.el||this._build(),this._returnFocus=y._focused(),y._containerIn(this._portal).appendChild(this.el),y._snackbars.push(this),this._animateIn(),this._setTimer(),u.emit(this.el,"open")}static _focused(){let s=dt(document);return s instanceof HTMLElement?s:null}static _containerIn(s){let t=y._container;return t?.isConnected&&t.parentNode===s?t:(y._removeContainer(),y._createContainer(s),y._container)}static get defaults(){return zr}static getInstance(s){return Reflect.get(s,"Expressive_Snackbar")}static _createContainer(s=document.body){let t=document.createElement("div");t.setAttribute("id","snackbar-container"),t.addEventListener("pointerdown",y._onDragStart),document.addEventListener("pointermove",y._onDragMove),document.addEventListener("pointerup",y._onDragEnd),document.addEventListener("pointercancel",y._onDragCancel),s.appendChild(t),y._container=t}static _removeContainer(){document.removeEventListener("pointermove",y._onDragMove),document.removeEventListener("pointerup",y._onDragEnd),document.removeEventListener("pointercancel",y._onDragCancel),y._container?.remove(),y._container=null}static _onDragStart(s){if(!s.isPrimary||s.pointerType==="mouse"&&s.button!==0)return;let t=s.target;if(t&&!t.closest("button, a")&&t.closest(".snackbar")){let e=t.closest(".snackbar"),i=y.getInstance(e);if(!i)return;i.panning=!0,i._pauseTimer(),y._draggedSnackbar=i,i.el.classList.add("panning"),i.el.style.transition="",y._dragPointerId=s.pointerId,i.startingXPos=s.clientX,i.velocityX=0,i.time=Date.now(),i.xPos=s.clientX,i._activationDistance=i.el.offsetWidth*i.options.activationPercent}}static _onDragMove(s){if(y._dragPointerId===s.pointerId&&y._draggedSnackbar){s.preventDefault();let t=y._draggedSnackbar;t.deltaX=Math.abs(t.xPos-s.clientX),t.xPos=s.clientX,t.velocityX=t.deltaX/Math.max(1,Date.now()-t.time),t.time=Date.now();let e=t.xPos-t.startingXPos,i=t._activationDistance;t.el.style.transform=`translateX(${e}px)`,t.el.style.opacity=(1-Math.abs(e/i)).toString()}}static _onDragEnd(s){if(y._dragPointerId===s.pointerId&&(y._dragPointerId=null,y._draggedSnackbar)){let t=y._draggedSnackbar;t.panning=!1,t.el.classList.remove("panning");let e=t.xPos-t.startingXPos,i=t._activationDistance,n=Date.now()-t.time<100?t.velocityX:0;Math.abs(e)>i||n>1?(t.wasSwiped=!0,t.dismiss()):t._snapBack(),y._draggedSnackbar=null}}static _onDragCancel(s){if(y._dragPointerId!==s.pointerId)return;y._dragPointerId=null;let t=y._draggedSnackbar;t&&(t.panning=!1,t.el.classList.remove("panning"),t._snapBack(),y._draggedSnackbar=null)}_snapBack(){this.el.style.transition="transform .2s, opacity .2s",this.el.style.transform="",this.el.style.opacity="",this._resumeTimer()}static dismissAll(){for(let s of[...y._queue,...y._snackbars])s.dismiss()}_leaveQueue(){if(this._dismissed)return!0;let s=y._queue.indexOf(this);return s<0?!1:(y._queue.splice(s,1),this._drop(),!0)}_drop(){this._dismissed=!0,this.el&&this._remove(!1),this.options.completeCallback?.()}_createSnackbar(){let s=this.options.snackbarId?u.getElementById(this._portal,this.options.snackbarId):document.createElement("div");if(s instanceof HTMLTemplateElement)s=s.content.cloneNode(!0).firstElementChild;else if(s&&this.options.snackbarId){let e=document.createComment("");s.before(e);let i=[...s.childNodes],n=["class","style","role","aria-live","aria-atomic","inert"].map(o=>[o,s.getAttribute(o)]);this._restoreElement=()=>{s.replaceChildren(...i);for(let[o,a]of n)w(s,o,a);e.replaceWith(s)}}if(!s)throw new Error("Snackbar body not found");this._events=R(s);let t={signal:this._events.signal};if(s.classList.add("snackbar"),s.setAttribute("role","status"),s.setAttribute("aria-live","polite"),s.setAttribute("aria-atomic","true"),s.inert=!1,s.addEventListener("focusin",e=>{e.relatedTarget instanceof HTMLElement&&!s.contains(e.relatedTarget)&&(this._returnFocus=e.relatedTarget),this._pauseTimer()},t),s.addEventListener("keydown",e=>{e.key!=="Escape"||e.defaultPrevented||this._dismissed||(e.preventDefault(),e.stopPropagation(),this.dismiss())},t),s.addEventListener("focusout",()=>{clearTimeout(this._focusTimer),this._focusTimer=setTimeout(()=>this._resumeTimer(),0)},t),s.addEventListener("pointerenter",()=>this._pauseTimer(),t),s.addEventListener("pointerleave",()=>this._resumeTimer(),t),this.options.classes.length>0&&s.classList.add(...this.options.classes.split(" ").filter(Boolean)),this.message){let e=document.createElement("p");e.textContent=this.message,s.replaceChildren(e)}if(this.options.action){let e=document.createElement("button");e.type="button",e.textContent=this.options.action,e.addEventListener("click",i=>{if(i.stopPropagation(),!this._dismissed)try{typeof this.options.onAction=="function"&&this.options.onAction(),u.emit(this.el,"action")}finally{this.dismiss()}},t),s.appendChild(e)}if(this.options.dismissible){let e=document.createElement("button");e.type="button",e.className="circle",e.setAttribute("aria-label","Dismiss");let i=document.createElement("span");i.className="material-symbols",i.setAttribute("aria-hidden","true"),i.textContent="close",e.appendChild(i),e.addEventListener("click",n=>{n.stopPropagation(),this.dismiss()},t),s.appendChild(e)}return s}_remove(s=!0){if(this._events.signal.aborted)return;this._events.abort(),clearTimeout(this.counterTimeout),clearTimeout(this._transitionTimer),clearTimeout(this._dismissTimer),clearTimeout(this._focusTimer),this.counterTimeout=null,y._draggedSnackbar===this&&(y._draggedSnackbar=null,y._dragPointerId=null),Reflect.set(this.el,"Expressive_Snackbar",void 0),this._restoreElement?this._restoreElement():this.el.remove();let t=y._snackbars.indexOf(this);t>=0&&y._snackbars.splice(t,1),s&&y._advance()}static _advance(){for(;!y._replacing&&!y._snackbars.length;){let s=y._queue.shift();if(!s)return y._tidy();y._showOrDrop(s)}}static _showOrDrop(s){y._canShow(s)?s._show():s._drop()}static _canShow(s){return s._portal.isConnected?!!s.el||s._hasBody():!1}static _tidy(){y._container?.childElementCount===0&&y._removeContainer()}_animateIn(){this.el.style.display="",this.el.style.opacity="0",this.el.style.transform="translateY(24px)",this.el.style.transition=`
|
|
6
6
|
transform ${this.options.inDuration}ms ease,
|
|
7
7
|
opacity ${this.options.inDuration}ms ease
|
|
8
|
-
`,this._transitionTimer=setTimeout(()=>{this.el.style.transform="",this.el.style.opacity="1"},1)}_setTimer(){this.timeRemaining!==1/0&&(this._deadline=Date.now()+this.timeRemaining,this.counterTimeout=setTimeout(()=>this.dismiss(),this.timeRemaining))}_pauseTimer(){this.counterTimeout!=null&&(clearTimeout(this.counterTimeout),this.counterTimeout=null,this.timeRemaining=Math.max(0,this._deadline-Date.now()))}_resumeTimer(){this._dismissed||this.panning||this.el.matches(":hover, :focus-within")||this.counterTimeout!=null||this._setTimer()}_restoreFocus(s=!1){let t=this.el.getRootNode().activeElement,e=t&&this.el.contains(t)?this._returnFocus:null;this.el.inert=!0,s&&this._remove(!1),e?.isConnected&&e.focus({preventScroll:!0})}dismiss(){if(this._leaveQueue()||(this._dismissed=!0,clearTimeout(this.counterTimeout),this.counterTimeout=null,this._restoreFocus(),this._events.signal.aborted))return;u.emit(this.el,"close");let s=this.options.outDuration,t=[`margin ${s}ms ease`,`opacity ${s}ms ease`];if(this.wasSwiped){let e=this.xPos<this.startingXPos?-1:1;this.el.style.transform=`translateX(${e*this.el.offsetWidth}px)`,this.el.style.opacity="0",t.push(`transform ${s}ms ease`)}this.el.style.transition=t.join(", "),clearTimeout(this._transitionTimer),this._transitionTimer=setTimeout(()=>{this.el.style.opacity="0",this.el.style.marginTop="-40px"},1),this._dismissTimer=setTimeout(()=>{u.emit(this.el,"closed"),this._remove(),typeof this.options.completeCallback=="function"&&this.options.completeCallback()},this.options.outDuration)}};y._replacing=!1,y._dragPointerId=null,y._snackbars=[],y._queue=[],y._container=null,y._draggedSnackbar=null;var Xt=y;var ot=class ot{static Init(){typeof document>"u"||document.addEventListener("click",ot._onClick)}static textFor(s){if(s.hasAttribute("data-copy"))return s.getAttribute("data-copy");let t=u.getElementById(s,s.getAttribute("data-copy-for")??"");return t?t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement?t.value:(t.textContent??"").trim():null}static async _onClick(s){let t=u.closestInPath(s,"[data-copy], [data-copy-for]");if(!t||t.matches(':disabled, [aria-disabled="true"]'))return;let e=ot.textFor(t);if(e===null)return;let i=!0;try{await navigator.clipboard.writeText(e)}catch{i=!1}new Xt({text:i?t.getAttribute("data-copy-message")||ot.i18n.copied:t.getAttribute("data-copy-error")||ot.i18n.failed,root:t,replace:!0}),u.emit(t,"copy",{text:e,copied:i})}};ot.i18n={copied:"Copied",failed:"Couldn't copy"};var Gt=ot;var Es=["light","dark","auto"],Mr="theme",V=class V{static Init(){V._initialized||typeof document>"u"||(V._initialized=!0,document.addEventListener("click",V._onClick),u.onDocumentReady(()=>V.sync()))}static get(){let s=document.documentElement.getAttribute("theme");return Es.includes(s)?s:"auto"}static set(s){if(Es.includes(s)){document.documentElement.setAttribute("theme",s);try{localStorage.setItem(Mr,s)}catch{}V.sync()}}static sync(s=document){let t=V.get();s.querySelectorAll("[data-theme-set]").forEach(e=>{let i=String(e.getAttribute("data-theme-set")===t),n=e.getAttribute("role"),o=n==="menuitemradio"||n==="radio";e.setAttribute(o?"aria-checked":"aria-pressed",i)})}static _onClick(s){let t=u.closestInPath(s,"[data-theme-set]");if(!t||t.matches(':disabled, [aria-disabled="true"]'))return;V.set(t.getAttribute("data-theme-set"));let e=t.getRootNode();e!==document&&V.sync(e)}};V._initialized=!1;var Zt=V;var Cr=":is(.panes, .pane-layout, .list-detail, .supporting-pane-layout):not(.equal, .three-pane)",Ue=`${Cr} > button.drag-handle`,ys=240,Ts=16,H=class H{static Init(){typeof document>"u"||(document.addEventListener("pointerdown",H._onPointerDown),document.addEventListener("keydown",H._onKeyDown),document.addEventListener("click",H._onClick))}static width(s){let t=H._pane(s);return t?t.getBoundingClientRect().width:null}static setWidth(s,t){if(!H._pane(s))return;let[i,n]=H._bounds(s),o=s.parentElement;o.style.setProperty(H._token(o),`${Math.round(Math.min(Math.max(t,i),n))}px`)}static _token(s){return s.matches(".supporting, .supporting-pane-layout")?"--md-comp-pane-supporting-width":"--md-comp-pane-list-width"}static _pane(s){if(!s.matches(Ue))return null;let t=s.parentElement;return t.matches(".supporting, .supporting-pane-layout")&&!t.matches(".start, .left")?s.nextElementSibling:s.previousElementSibling}static _bounds(s){let t=s.parentElement,e=getComputedStyle(t),i=parseFloat(e.getPropertyValue("--md-comp-pane-primary-min-width"))||360,o=t.clientWidth-parseFloat(e.paddingLeft)-parseFloat(e.paddingRight)-s.getBoundingClientRect().width-i;return[ys,Math.max(ys,o)]}static _paneIsLeft(s){return H._pane(s).getBoundingClientRect().left<s.getBoundingClientRect().left}static _onPointerDown(s){let t=u.closestInPath(s,Ue);if(!t||s.button!==0)return;let e=H._pane(t);if(!e)return;let i=s.clientX,n=e.getBoundingClientRect().width,o=H._paneIsLeft(t)?1:-1;H._dragged=!1,t.setPointerCapture(s.pointerId);let a=d=>{let p=d.clientX-i;Math.abs(p)<4&&!H._dragged||(H._dragged=!0,H.setWidth(t,n+o*p))},l=R(t),c=()=>l.abort(),{signal:h}=l;t.addEventListener("pointermove",a,{signal:h}),t.addEventListener("pointerup",c,{signal:h}),t.addEventListener("pointercancel",c,{signal:h})}static _onClick(s){let t=u.closestInPath(s,Ue);if(!t||s.detail!==0&&H._dragged)return;let[e,i]=H._bounds(t),n=H.width(t),o=[e,(e+i)/2,i].find(a=>a>n+1)??e;H.setWidth(t,o)}static _onKeyDown(s){let t=u.closestInPath(s,Ue);if(!t||!u.plainKey(s))return;let e=H.width(t),[i,n]=H._bounds(t),o=s.shiftKey?Ts*4:Ts,a={ArrowLeft:-o,ArrowRight:o}[s.key],l;if(a)l=e+(H._paneIsLeft(t)?a:-a);else if(s.key==="Home")l=i;else if(s.key==="End")l=n;else return;s.preventDefault(),H.setWidth(t,l)}};H._dragged=!1;var Qt=H;var Ls='.image-compare > input[type="range"]',at=class at{static Init(){at._initialized||typeof document>"u"||(at._initialized=!0,document.addEventListener("input",s=>{let t=u.eventTarget(s);t?.matches(Ls)&&at.sync(t)}),u.onDocumentReady(()=>{document.querySelectorAll(Ls).forEach(s=>at.sync(s))}))}static sync(s){let t=parseFloat(s.min)||0,e=Number.isNaN(parseFloat(s.max))?100:parseFloat(s.max),i=e===t?0:(parseFloat(s.value)-t)/(e-t);s.parentElement.style.setProperty("--md-comp-image-compare-position",`${i*100}%`)}};at._initialized=!1;var Jt=at;var tt=new WeakMap,ws="--tour-target",I=class I{static Init(){I._initialized||typeof document>"u"||(I._initialized=!0,document.addEventListener("click",I._onClick),document.addEventListener("keydown",s=>{let t=u.closestInPath(s,".tour");s.key==="Escape"&&t instanceof HTMLElement&&tt.has(t)&&I.end(t)}),document.addEventListener("toggle",s=>{let t=s.target;s.newState==="closed"&&tt.has(t)&&I.end(t)},!0))}static start(s,t=0){let e=[...s.querySelectorAll(":scope > section[data-tour-target]")].filter(o=>I._target(o)?.checkVisibility());if(!e.length)return;let i=tt.get(s);i&&I._release(i.steps[i.index]);let n={steps:e,index:0,opener:I._opener(s,i)};tt.set(s,n),I._show(s,!i),tt.get(s)===n&&I.go(s,t)}static _opener(s,t){if(t?.opener)return t.opener;let e=s.getRootNode().activeElement;return e instanceof HTMLElement?e:null}static _show(s,t){s.matches(":popover-open")||s.showPopover(),t&&u.emit(s,"open")}static go(s,t){let e=tt.get(s);if(!e)return;I._release(e.steps[e.index]),t=Math.min(Math.max(t,0),e.steps.length-1);let i=t<e.index?-1:1;for(;e.steps[t]&&!I._target(e.steps[t]);)t+=i;let n=e.steps[t];if(!n){I.end(s);return}e.index=t;let o=e.index===e.steps.length-1;s.querySelectorAll(":scope > section[data-tour-target]").forEach(p=>{p.hidden=p!==n});let a=n.querySelector("h1, h2, h3, h4, h5, h6");a&&(a.id||(a.id=`tour-${u.guid()}`),s.setAttribute("aria-labelledby",a.id));let l=s.querySelector(".tour-progress");l&&(l.textContent=I.i18n.progress.replace("{current}",String(e.index+1)).replace("{total}",String(e.steps.length)));let c=(p,g)=>s.querySelectorAll(p).forEach(m=>m.hidden=!g);c("[data-tour-back]",e.index>0),c("[data-tour-next]",!o),c("[data-tour-done]",o);let h=I._target(n);h.classList.add("tour-target"),u.setAnchorName(h,ws,!0);let d=!matchMedia("(prefers-reduced-motion: reduce)").matches;h.scrollIntoView({block:"center",behavior:d?"smooth":"auto"}),s.hasAttribute("tabindex")||(s.tabIndex=-1),s.focus({preventScroll:!0}),u.emit(s,"change",{step:n,index:e.index})}static end(s,t=!1){let e=tt.get(s);e&&(I._release(e.steps[e.index]),tt.delete(s),s.matches(":popover-open")&&s.hidePopover(),e.opener?.focus(),u.emit(s,"close",{completed:t}))}static _target(s){return u.getElementById(s,s.getAttribute("data-tour-target")??"")}static _release(s){let t=s&&I._target(s);t?.classList.remove("tour-target"),t&&u.setAnchorName(t,ws,!1)}static _onClick(s){let t=u.closestInPath(s,"[data-tour-start], [data-tour-back], [data-tour-next], [data-tour-done], [data-tour-close]");if(!t)return;if(t.hasAttribute("data-tour-start")){let n=u.getElementById(t,t.getAttribute("data-tour-start"));n?.matches(".tour")&&I.start(n);return}let e=t.closest(".tour"),i=e&&tt.get(e);i&&(t.hasAttribute("data-tour-back")?I.go(e,i.index-1):t.hasAttribute("data-tour-next")?I.go(e,i.index+1):I.end(e,t.hasAttribute("data-tour-done")))}};I.i18n={progress:"Step {current} of {total}"},I._initialized=!1;var te=I;var xs=".sortable > li",A=class A{static Init(){typeof document>"u"||(document.addEventListener("click",A._onClick),document.addEventListener("pointerdown",A._onPointerDown))}static move(s,t){let e=s.parentElement,i=[...e.children],n=i.indexOf(s);if(t=Math.min(Math.max(t,0),i.length-1),t===n)return;let o=s.getRootNode().activeElement,a=s.contains(o)?o:null;e.insertBefore(s,i[t>n?t+1:t]??null),a?.focus(),A._done(e,s,n,t)}static _done(s,t,e,i){let n=A._regions.get(s);n||(n=document.createElement("div"),n.className="visually-hidden",n.setAttribute("aria-live","polite"),s.after(n),A._regions.set(s,n)),n.textContent=A.i18n.moved.replace("{position}",String(i+1)).replace("{total}",String(s.children.length)),s.dispatchEvent(new CustomEvent("change",{bubbles:!0,detail:{item:t,from:e,to:i}}))}static _onClick(s){let t=u.closestInPath(s,"[data-move]"),e=t?.closest(xs);if(!e||t.matches(':disabled, [aria-disabled="true"]'))return;let i=[...e.parentElement.children].indexOf(e),n=t.getAttribute("data-move");n==="up"?A.move(e,i-1):n==="down"&&A.move(e,i+1)}static _onPointerDown(s){let e=u.closestInPath(s,".drag-handle")?.closest(xs);if(!e||s.button!==0||A._drag)return;s.preventDefault();let i=e.parentElement,n=R(e);A._drag={item:e,list:i,from:[...i.children].indexOf(e),pointerId:s.pointerId,events:n},e.classList.add("dragged");let{signal:o}=n;document.addEventListener("pointermove",A._onPointerMove,{signal:o}),document.addEventListener("pointerup",A._onPointerEnd,{signal:o}),document.addEventListener("pointercancel",A._onPointerEnd,{signal:o}),document.addEventListener("keydown",A._onKeyDown,{signal:o})}static _onPointerMove(s){let t=A._drag;if(!t||s.pointerId!==t.pointerId)return;let e=t.item.previousElementSibling,i=t.item.nextElementSibling,n=o=>{let a=o.getBoundingClientRect();return a.top+a.height/2};e&&s.clientY<n(e)?t.list.insertBefore(t.item,e):i&&s.clientY>n(i)&&t.list.insertBefore(t.item,i.nextElementSibling)}static _onPointerEnd(s){s.pointerId===A._drag?.pointerId&&A._finish(s.type==="pointercancel")}static _onKeyDown(s){s.key==="Escape"&&(s.preventDefault(),A._finish(!0))}static _finish(s){let t=A._drag;if(!t)return;A._drag=null,t.events.abort(),t.item.classList.remove("dragged");let e=[...t.list.children].indexOf(t.item);s?t.list.insertBefore(t.item,t.list.children[t.from>e?t.from+1:t.from]??null):e!==t.from&&A._done(t.list,t.item,t.from,e)}};A.i18n={moved:"Moved to position {position} of {total}"},A._drag=null,A._regions=new WeakMap;var ee=A;var Sr=":scope > li > :is(a[href], button):only-child",kr={ArrowUp:-1,ArrowDown:1},je=class je{static Init(){typeof document>"u"||document.addEventListener("keydown",je._onKeydown)}};je._onKeydown=s=>{let t=u.eventTarget(s)?.closest(".list");if(!t)return;let e=u.focusTarget([...t.querySelectorAll(Sr)],s,kr);e&&(s.preventDefault(),e.focus())};var ie=je;var Ar={min:null,max:null,watch:!1},Hr=4,Cs=4;function Ir(r,s){let t=document.createRange();return r.map(e=>{t.selectNodeContents(e);let i=t.getBoundingClientRect().width,{left:n,right:o}=e.getBoundingClientRect();return s?{width:i,start:-o,end:-n}:{width:i,start:n,end:o}})}function Or(r,s){let t=r[s];return s===0?t.start:s===r.length-1?t.end-t.width:(t.start+t.end-t.width)/2}function Dr(r,s){let t=r[r.length-1].end,e=-1/0;for(let i=0;i<r.length;i+=s){let n=Or(r,i);if(n<e+Cs||n+r[i].width>t)return!1;e=n+r[i].width}return!0}function Pr(r){if(r.every(s=>s.width+Cs<=s.end-s.start))return 1;for(let s=2;s<=r.length;s++)if(Dr(r,s))return s;return 1}function Rr(r,s){let t=Pr(Ir(s,getComputedStyle(r).direction==="rtl"));r.toggleAttribute("data-thinned",t>1),s.forEach((e,i)=>e.toggleAttribute("data-skip",i%t>0))}function Fr(r,s){let t=e=>e.nodeName==="TABLE";return r.some(e=>e.target!==s||[...e.addedNodes,...e.removedNodes].some(t))}function Ye(r,s,t){let e=document.createElement("ul");return e.className=r,e.setAttribute("aria-hidden","true"),e.append(...t.map((i,n)=>{let o=document.createElement("li");return s[n]&&(o.dataset.series=s[n]),o.append(...i.map(a=>Object.assign(document.createElement("span"),{textContent:a}))),o})),e}function se(r,s){let t=r*2*Math.PI;return`${(s*Math.sin(t)).toFixed(3)},${(-s*Math.cos(t)).toFixed(3)}`}var ne=r=>String(r%Hr+1),Nr=0,Br=r=>matchMedia("(prefers-reduced-motion: reduce)").matches?[]:r,$r=r=>/cubic-bezier\(([^)]*)\)/.exec(r)?.[1]??"0.2, 0, 0, 1";function we(r){let s=getComputedStyle(r),t=s.getPropertyValue("--md-sys-motion-duration-medium4").trim()||"400ms";return parseFloat(t)>0?{dur:t,keySplines:$r(s.getPropertyValue("--md-sys-motion-easing-standard"))}:null}function xe(r,s,t){let e=r.getAttribute("d");s!==e&&r.append(M("animate",{attributeName:"d",from:s,to:e,...t,calcMode:"spline",keyTimes:"0;1",fill:"remove"}))}var Ms=r=>r.flatMap(s=>Array.from(s.querySelectorAll("button"))),Oi=r=>r.values.some(s=>s!==null),qr=[1,2,2.5,5,10];function Xe(r,s=4){let t=r/s||1,e=10**Math.floor(Math.log10(t));return e*qr.find(i=>i*e>=t*(1-1e-9))}function Di(r,s,t){let e=[];for(let i=Math.ceil(r/t-1e-9);i*t<=s+t*1e-9;i++)e.push(Number((i*t).toPrecision(12)));return e}function U(r,s){return new Intl.NumberFormat(u.locale(r),s)}function lt(r){return r?Me(r.dataset.value??r.textContent):null}function Me(r){let s=r.replace(/\u2212/g,"-").replace(/[\s%\p{Sc}]/gu,"");if(!/^[+-]?(\d{1,3}(,\d{3})+|\d+)?(\.\d+)?(e[+-]?\d+)?$/i.test(s))return null;let t=parseFloat(s.replace(/,/g,""));return Number.isFinite(t)?t:null}function Pi(r,s,[t,e]){return r.format(s).replace(/^[-\u2212]?/,i=>i+t)+e}function Ri(r){let s=/^[\s\p{Sc}]*/u.exec(r)[0],t=e=>[...e].reverse().join("");return[s,t(/^[\s%\p{Sc}]*/u.exec(t(r.slice(s.length)))[0])]}function Fi(r){let s=r.find(t=>!t?.dataset.value&<(t)!==null);return Ri(s?.textContent.trim()??"")}function zr(r){return`M${r.join("L")}${r.length>1?"":"h0"}`}function Kr(r){let s=r.length;if(s===0)return"";if(s===1)return`M${r[0][0]},${r[0][1]}h0`;let t=[];for(let n=0;n<s-1;n++)t.push((r[n+1][1]-r[n][1])/(r[n+1][0]-r[n][0]));let e=r.map((n,o)=>{if(o===0)return t[0];if(o===s-1)return t[s-2];let[a,l]=[t[o-1],t[o]];return a*l<=0?0:2/(1/a+1/l)}),i=`M${r[0][0]},${r[0][1]}`;for(let n=0;n<s-1;n++){let[[o,a],[l,c]]=[r[n],r[n+1]],h=(l-o)/3;i+=`C${o+h},${a+e[n]*h} ${l-h},${c-e[n+1]*h} ${l},${c}`}return i}var k=class extends b{constructor(t,e){super(t,e);this.labels=[];this.series=[];this.activeIndex=-1;this._generated=[];this._labelSizes=null;this._tableWatch=null;this._all=[];this._before=[];this._hidden=new Set;this._header=[];this._rows=[];this._reversed=!1;this._onPointerMove=t=>{this.show(this._indexAt(t))};this._onFocus=()=>{this.activeIndex<0&&this._plot.matches(":focus-visible")&&this.show(0)};this._onLeave=t=>{t.pointerType==="touch"||this._plot.matches(":focus-visible")||this.show(-1)};this._onCancel=()=>{this.show(-1)};this._onKeyDown=t=>{let e=this._keyTarget(t.key);e!==void 0&&(t.preventDefault(),this.show(e))};this._build(),this._listen(),(this.options.watch||this.el.hasAttribute("data-watch"))&&(this._tableWatch=new MutationObserver(i=>Fr(i,this.el)&&this.update())),this._watch()}get _type(){return"line-chart"}get _seriesFrom(){return 1}get _seriesTo(){}get _fromZero(){return!1}get _horizontal(){return!1}get _circular(){return!1}get _axis(){return this.el.classList.contains("axis")&&!this.el.classList.contains("sparkline")}get _points(){return!0}get _count(){return this.labels.length}_watch(){if(!this._tableWatch)return;this._tableWatch.disconnect(),this._tableWatch.observe(this.el,{childList:!0});let t=this.el.querySelector(":scope > table");t&&this._tableWatch.observe(t,{subtree:!0,childList:!0,characterData:!0,attributeFilter:["data-value","class","data-label"]})}_build(){this._read(),!(!this.labels.length||!this.series.length)&&(this._reversed=!this._horizontal&&getComputedStyle(this.el).direction==="rtl",this._render())}get _interactive(){return!this.el.classList.contains("sparkline")}_listen(){this._plot&&this._interactive&&(this._plot.addEventListener("pointerdown",this._onPointerMove),this._plot.addEventListener("pointermove",this._onPointerMove),this._plot.addEventListener("pointerleave",this._onLeave),this._plot.addEventListener("pointercancel",this._onCancel),this._plot.addEventListener("keydown",this._onKeyDown),this._plot.addEventListener("focus",this._onFocus),this._plot.addEventListener("blur",this._onLeave))}static get defaults(){return Ar}destroy(){this._generated.forEach(t=>t.remove()),this._generated=[],this._labelSizes?.disconnect(),this._tableWatch?.disconnect(),super.destroy()}update(){if(this.constructor.getInstance(this.el)!==this)return;let t=this._generated,e=this.el.getRootNode().activeElement,[i,n]=[this.activeIndex,t.some(a=>a.contains(e))],o=Ms(t).indexOf(e);this._generated=[],this.activeIndex=-1,this._plot=this._cursor=this._tooltip=void 0,this._before=Br(this.series),this._build(),this._before=[],n&&(Ms(this._generated)[o]??this._plot)?.focus({preventScroll:!0}),t.forEach(a=>a.remove()),this._listen(),this.show(Math.min(i,this._count-1)),this._watch()}show(t){if(!this._tooltip||t===this.activeIndex)return;this.activeIndex=t;let e=t<0||t>=this.labels.length;if(this._cursor.hidden=this._tooltip.hidden=e,e)return;this._cursor.replaceChildren();let i=document.createElement("strong");i.textContent=this.labels[t],this._tooltip.replaceChildren(i),this.series.forEach(n=>{if(n.values[t]===null)return;let a=n.color,l=n.tops[t];if(l!==null&&this._points){let d=document.createElement("span");d.className=n.className,d.dataset.series=a,d.style.top=`${n.y(l)}%`,this._cursor.append(d)}let c=document.createElement("span");c.dataset.series=a,c.textContent=n.name;let h=document.createElement("span");h.textContent=n.text[t],this._tooltip.append(c,h)}),this._place(t)}_place(t){let e=this._x(t),i=this._horizontal?"top":"left";this._cursor.style[i]=this._tooltip.style[i]=`${e}%`,this._tooltip.classList.toggle("end",e>50)}_read(){let t=this.el.querySelector(":scope > table");if(!t)return;let e=t.tHead?.rows[0]??t.rows[0],i=Array.from(e?.cells??[]),n=Array.from(t.tBodies).flatMap(l=>Array.from(l.rows)).filter(l=>l!==e);[this._header,this._rows]=[i,n],this.labels=n.map(l=>l.cells[0]?.textContent.trim()??"");let o=this._seriesFrom;this.series=i.slice(o,this._seriesTo).map((l,c)=>{let h=n.map(d=>lt(d.cells[c+o]));return{name:l.textContent.trim(),className:l.className,column:c+o,color:ne(c),text:n.map(d=>d.cells[c+o]?.textContent.trim()??""),values:h,tops:h,y:void 0,scale:void 0,affix:Fi(n.map(d=>d.cells[c+o]))}}),this._all=this.series,this.series=this._shown(this._all);let a=l=>this._number(l)??this.options[l];this._y=this._scale(this.series,a("min"),a("max"))}_shown(t){let e=t.filter(i=>!this._hidden.has(i.column));return this._arrange(e),e.some(Oi)?e:this._hidden.size?(this._hidden.clear(),this._shown(t)):[]}_arrange(t){this.el.classList.contains("stacked")&&this._stack(t)}_stack(t){let e=this.labels.map(()=>0);for(let i of t)i.base=[...e],i.tops=i.values.map((n,o)=>e[o]=n===null||e[o]===null?null:e[o]+n)}_number(t){let e=parseFloat(this.el.dataset[t]??"");return Number.isFinite(e)?e:null}_scale(t,e,i,n=this._fromZero){let o=[e!==null,i!==null],a=this.el.classList.contains("stacked"),[l,c]=[1/0,-1/0];for(let{tops:h,base:d=[]}of t)for(let p of[...h,...d])p!==null&&(l=Math.min(l,p),c=Math.max(c,p));if(l>c&&(l=c=0),n){let[h,d]=[Math.min(0,l),Math.max(0,c)],p=(d-(e??h))*.1||1;e??(e=h<0?h-p:0),i??(i=d+p)}else{let h=(c-l)*.1||1;e??(e=a?Math.min(0,l):l-h),i??(i=c+(a?(c-e)*.1||1:h))}return this._apply(t,this._fit(e,i,o))}_fit(t,e,[i,n]){if(!this._axis)return{min:t,max:e,ticks:[]};let o=Xe(e-t),a=i?t:Math.floor(t/o+1e-9)*o,l=n?e:Math.ceil(e/o-1e-9)*o;return{min:a,max:l,ticks:Di(a,l,o)}}_apply(t,e){let i=n=>100-(n-e.min)/(e.max-e.min||1)*100;for(let n of t)Object.assign(n,{y:i,scale:e});return i}_x(t){let e=(t+.5)/this.labels.length*100;return this._reversed?100-e:e}_render(){let t=this._type;this._plot=document.createElement("div"),this._plot.className=`${t}-plot`;let e=this.el.querySelector(":scope > figcaption")?.textContent.trim();this._plot.setAttribute("role","group"),this._plot.setAttribute("aria-roledescription",t.replace(/-/g," ")),e&&this._plot.setAttribute("aria-label",e),this._interactive&&(this._plot.tabIndex=0),this._cursor=document.createElement("div"),this._cursor.className=`${t}-cursor`,this._cursor.hidden=!0,this._tooltip=document.createElement("div"),this._tooltip.className=`${t}-tooltip`,this._tooltip.hidden=!0,this._tooltip.setAttribute("aria-live","polite"),this._plot.append(...this._axes(),this._draw(),this._cursor,this._tooltip),this._generated=[this._plot,...this._guides()],this.el.append(...this._generated)}_total(t){let e=this.el.querySelector(":scope > table")?.tFoot?.rows[0];if(!e)return null;let i=document.createElement("div");i.className=t;let[n,o]=[document.createElement("span"),document.createElement("strong")];return n.textContent=e.cells[0]?.textContent.trim()??"",o.textContent=e.cells[1]?.textContent.trim()??"",i.append(o,n),i}_guides(){let t=document.createElement("ol");t.className=`${this._type}-labels`,t.setAttribute("aria-hidden","true");for(let e of this.labels){let i=document.createElement("li");i.append(document.createElement("span")),i.firstChild.textContent=e,t.append(i)}return this._observeLabels(t,Array.from(t.children)),[t,...this._legend()]}_observeLabels(t,e){this._labelSizes?.disconnect(),!(this._horizontal||!e.length)&&(this._labelSizes=new ResizeObserver(()=>Rr(t,e)),this._labelSizes.observe(t))}_axes(){if(!this._axis)return[];let t=n=>n.className.split(/\s+/).includes("end"),e=this.series.find(n=>!t(n))??this.series[0],i=this.series.find(n=>n.y!==e.y);return[e,i].filter(Boolean).map((n,o)=>this._valueAxis(n,o>0))}_valueAxis(t,e){let i=document.createElement("ol");i.className=`${this._type}-axis${e?" end":""}`,i.setAttribute("aria-hidden","true");let n=U(this.el,{notation:"compact",maximumSignificantDigits:3});for(let o of t.scale.ticks){let a=document.createElement("li"),l=document.createElement("span");l.textContent=Pi(n,o,t.affix),a.style.setProperty("--at",`${t.y(o)}%`),a.append(l),i.append(a)}return i}_legend(){if(this._all.length<2)return[];let t=this.el.classList.contains("toggle"),e=document.createElement("ul");return e.className=`${this._type}-legend`,t||e.setAttribute("aria-hidden","true"),e.append(...this._all.map(i=>{let n=document.createElement("li");return n.dataset.series=i.color,n.append(t?this._toggle(i):i.name),n})),[e]}_toggle(t){let e=document.createElement("button"),i=this.series.includes(t);return e.type="button",e.className="chart-toggle",e.textContent=t.name,e.setAttribute("aria-pressed",String(i)),i&&Oi(t)&&this.series.filter(Oi).length<2&&e.setAttribute("aria-disabled","true"),e.addEventListener("click",()=>{e.hasAttribute("aria-disabled")||(i?this._hidden.add(t.column):this._hidden.delete(t.column),this.update())}),e}_draw(t=this.series){let e=M("svg",{viewBox:"0 0 100 100",preserveAspectRatio:"none","aria-hidden":"true",focusable:"false"}),i=this._before.length?we(this.el):null,n=i?this._starts(t):[];return e.append(...t.map((o,a)=>this._line(o,n[a],i))),e}_starts(t){let e;return t.map(i=>{let n=i.base?e??this._baseY(i):()=>100;return e=this._was(i,n),this._shape(i,e,n)})}_was(t,e){let i=this._before.find(n=>n.column===t.column);return n=>{let o=i?.tops[n]??null;return o===null?e(n):i.y(o)}}_baseY(t){return e=>Math.min(100,t.y(t.base[e]))}_shape(t,e,i){let n=[[]];t.tops.forEach((h,d)=>{h===null?n.push([]):n[n.length-1].push(d)});let o=n.filter(h=>h.length),a=(h,d)=>h.map(p=>[this._x(p),d(p)]),l=this.el.classList.contains("straight")?zr:Kr,c=o.map(h=>l(a(h,e)));return{line:c.join(""),area:o.map((h,d)=>t.base?`${c[d]}L${l(a(h,i).reverse()).slice(1)}Z`:`${c[d]}V100H${this._x(h[0])}Z`).join(""),dots:o.flatMap(h=>a(h,e)).map(([h,d])=>`M${h},${d}h0`).join("")}}_line(t,e,i){let n=M("g",{class:`${this._type}-series ${t.className}`.trim(),"data-series":t.color}),o=this._shape(t,h=>t.y(t.tops[h]),this._baseY(t)),a=`line-chart-gradient-${++Nr}`,l=M("linearGradient",{id:a,x2:"0",y2:"1"});l.append(M("stop"),M("stop",{offset:"1"}));let c=(h,d,p={})=>{let g=M("path",{class:`${this._type}-${d}`,d:o[h],...p});return e&&xe(g,e[h],i),g};return n.append(l,c("area","area",{fill:`url(#${a})`}),c("line","line")),this.el.classList.contains("points")&&n.append(c("dots","points")),n}_indexAt(t){let e=this._plot.getBoundingClientRect(),i=this._horizontal?(t.clientY-e.top)/e.height:(t.clientX-e.left)/e.width,n=Math.floor((this._reversed?1-i:i)*this.labels.length);return Math.min(this.labels.length-1,Math.max(0,n))}_polarAt(t){let e=this._plot.getBoundingClientRect(),[i,n]=[t.clientX-e.left-e.width/2,t.clientY-e.top-e.height/2];return[(Math.atan2(i,-n)/(2*Math.PI)+1)%1,Math.hypot(i,n)/e.width]}get _arrows(){return this._circular?[["ArrowRight","ArrowDown"],["ArrowLeft","ArrowUp"]]:this._horizontal?[["ArrowDown"],["ArrowUp"]]:this._reversed?[["ArrowLeft"],["ArrowRight"]]:[["ArrowRight"],["ArrowLeft"]]}_keyTarget(t){let e=this.labels.length-1,[i,n]=this._arrows,o=a=>this._circular?this.activeIndex<0?a>0?0:e:(this.activeIndex+a+e+1)%(e+1):Math.min(e,Math.max(0,this.activeIndex+a));return t==="Escape"?this.activeIndex<0?void 0:-1:i.includes(t)?o(1):n.includes(t)?o(-1):{Home:0,End:e}[t]}};k.key="Expressive_LineChart";var Vr=":scope > tbody > tr:not(.data-table-detail)",Wr=':scope > :first-child input[type="checkbox"]',Ni=".data-table > table > thead > tr:first-child > th > button.drag-handle:last-child",Ur=16,jr={ascending:1,descending:-1},Ss='[role="menuitemcheckbox"][data-column]',zi="data-column-hidden",ks='input[type="search"][data-table-filter]',Ce="data-table-filter-hidden",Ze="data-table-page-hidden",As='button[type="button"]:is([data-table-page="previous"], [data-table-page="next"])',Yr={previous:-1,next:1},Xr="select[data-table-page-size]:not([multiple], :disabled):not(:has(option:checked:disabled))";function Gr(r){return r?[[r.page,1],[r.pageSize,1],[r.total,0]].every(([s,t])=>Number.isSafeInteger(s)&&s>=t):!1}function Bi(r,s,t){return Math.min(Math.max(r,1),Math.ceil(s/t))}function Is(r){let s=Number(r);return Number.isSafeInteger(s)&&s>0?s:0}function st(r){return Is(r.getAttribute("data-page-size"))}function $i(r,s){return Array.from(r.querySelectorAll(s)).find(t=>t.closest(".data-table")===r)}function Ge(r){if(r.closest(`[hidden], [${Ce}], [${Ze}]`))return!1;if(r.checkVisibility)return r.checkVisibility({visibilityProperty:!0});let s=getComputedStyle(r);return s.display!=="none"&&!["hidden","collapse"].includes(s.visibility)}function Os(r,s){let t=0;for(let e of Array.from(r.cells))if(t+=e.colSpan,s<t)return e}function qi(r,s){let t=Os(r,s);return(t?.dataset.value??t?.textContent??"").trim()}function Zr(r,s,t,e){for(let i=s;i<s+Math.max(1,e.rowSpan);i++)for(let n=t;n<t+e.colSpan;n++)(r[i]??(r[i]=new Set)).add(n)}function re(r){let[s,t]=[[],new Map];return Array.from(r.rows).forEach((e,i)=>{let n=0;for(let o of Array.from(e.cells)){for(;s[i]?.has(n);)n++;t.set(o,n),Zr(s,i,n,o),n+=o.colSpan}}),t}function Ds(r){let t=r.getRootNode().getElementById?.(r.getAttribute("data-column"));return t?.matches(".data-table > table > thead > tr:first-child > th")&&t.colSpan===1?t:null}function Qr(r,s){let t=[...re(r.tHead)].filter(([,i])=>i===s).map(([i])=>i),e=r.querySelectorAll(":scope > tbody > tr, :scope > tfoot > tr");return[...t,...Array.from(e,i=>Os(i,s))].filter(i=>i?.colSpan===1)}function Jr(r){r.hidden||(r.hidden=!0,r.setAttribute(zi,""))}function to(r){r.hasAttribute(zi)&&(r.hidden=!1,r.removeAttribute(zi))}function Hs(r){let s=Ds(r);if(!s)return;let t=s.closest("table"),e=r.getAttribute("aria-checked")==="true";Qr(t,re(t.tHead).get(s)).forEach(e?to:Jr),eo(t,s)}function eo(r,s){r.style.tableLayout==="fixed"&&(!s.hidden&&!s.style.width&&(s.style.width=`${Math.max(Qe(s)[0],s.scrollWidth)}px`),Ki(r))}function Ps(r){return Array.from(r.rows[0]?.cells??[]).filter(s=>!s.hidden)}function Ki(r){r.style.width=`${Ps(r).reduce((s,t)=>s+parseFloat(t.style.width),0)}px`}function io(r){if(r.style.tableLayout==="fixed")return;let s=Ps(r),t=s.map(e=>e.getBoundingClientRect().width);s.forEach((e,i)=>e.style.width=`${t[i]}px`),r.style.tableLayout="fixed",Ki(r)}function Qe(r){let s=parseFloat(getComputedStyle(r).minWidth)||0;return[s,Math.max(s,r.closest(".data-table").clientWidth)]}function so(r){let[s,t]=Qe(r),e=r.getBoundingClientRect().width;return[s,(s+t)/2,t].find(i=>i>e+1)??s}function no(r,s){let[t,e]=Qe(r),i=(s.shiftKey?4:1)*Ur*(getComputedStyle(r).direction==="rtl"?-1:1),n=r.getBoundingClientRect().width;return{ArrowRight:n+i,ArrowLeft:n-i,Home:t,End:e}[s.key]}var f=class f{static Init(){f._initialized||typeof document>"u"||(f._initialized=!0,document.addEventListener("input",f._onChange),document.addEventListener("input",f._onFilter),document.addEventListener("input",f._onPageSize),document.addEventListener("change",f._onPageSize),document.addEventListener("click",f._onClick),document.addEventListener("click",f._onPage),document.addEventListener("pointerdown",f._onPointerDown),document.addEventListener("click",f._onHandleClick),document.addEventListener("keydown",f._onKeyDown),document.addEventListener("expressive:change",f._onToggle),u.onDocumentReady(()=>document.querySelectorAll(".data-table").forEach(f.sync)))}static sync(s){let t=s.querySelector(":scope > table");t&&(t.querySelectorAll(`:scope > tbody > tr[${Ze}]`).forEach(e=>e.removeAttribute(Ze)),f._pages.get(s)?.server&&t.querySelectorAll(`:scope > tbody > tr[${Ce}]`).forEach(e=>e.removeAttribute(Ce)),f._filter(s,t),f._page(s,t),f._select(f._all(t),f._enabled(t),!1)),s.getRootNode().querySelectorAll(Ss).forEach(e=>{s.contains(Ds(e))&&Hs(e)})}static setPage(s,t){return!s?.matches?.(".data-table:has(> table)")||!f._storePage(s,t)?!1:(f._pageRequests.delete(s),f.sync(s),!0)}static _storePage(s,t){if(t===null)return f._pages.delete(s),!0;if(!t)return!1;let e={page:t.page,pageSize:t.pageSize,total:t.total};return Gr(e)?(s.setAttribute("data-page-size",String(e.pageSize)),f._pages.set(s,{...e,server:!0}),!0):!1}static width(s){return s.getBoundingClientRect().width}static setWidth(s,t){let e=s.closest("table"),[i,n]=Qe(s);io(e),s.style.width=`${Math.round(Math.min(Math.max(t,i),n))}px`,Ki(e)}static _all(s){let t=s.tHead,e='input[type="checkbox"]';return(t&&[...re(t)].find(([n,o])=>o===0&&n.querySelector(e))?.[0])?.querySelector(e)}static _enabled(s){return f._boxes(s).filter(t=>!t.matches(":disabled")&&Ge(t.closest("tr")))}static _boxes(s){return Array.from(s.querySelectorAll(Vr),t=>t.querySelector(Wr)).filter(Boolean)}static _filter(s,t){let e=$i(s,ks);if(!e)return;let i=u.locale(t),n=f._serverRecords(s)?"":e.value.trim().toLocaleLowerCase(i),a=(t.tHead?[...re(t.tHead)]:[]).filter(([h])=>h.hasAttribute("data-filter")&&h.colSpan===1).map(([,h])=>h),l=f._records(t);l.forEach(([h])=>h.removeAttribute(Ce));let c=l.map(([h])=>Ge(h)&&f._matches(h,a,n,i));l.forEach((h,d)=>h.forEach(p=>p.toggleAttribute(Ce,!c[d]))),f._filterCount(s,i,c.filter(Boolean).length)}static _filterCount(s,t,e){if(f._serverRecords(s))return;let i=$i(s,"[data-table-filter-count]");i&&(i.textContent=new Intl.NumberFormat(t).format(e))}static _serverRecords(s){return f._pages.get(s)?.server||f._serverFilters.has(s)}static _matches(s,t,e,i){return!e||t.some(n=>qi(s,n).toLocaleLowerCase(i).includes(e))}static _advancePage(s,t,e){let i=f._pageState(s),n=Bi(i.page+t,i.total,st(s));n<1||n===i.page||f._requestPage(s,{page:n,pageSize:st(s)},e)}static _setPageSize(s,t,e){let i=Is(t);if(!i||!st(s)||i===st(s))return;let n=f._pageState(s),o=Math.max(1,Bi(n.page,n.total,i));f._requestPage(s,{page:o,pageSize:i},e)}static _requestPage(s,t,e){let i=f._pageState(s);f._pageRequests.set(s,e),u.emit(s,"page",t,!0)&&f._pageRequests.get(s)===e&&(i.server||(s.setAttribute("data-page-size",String(t.pageSize)),f._pages.set(s,{...i,...t}),f.sync(s)))}static _pageState(s){let t=f._pages.get(s);if(t)return t;let e=s.querySelector(":scope > table"),i=e?f._records(e).filter(([n])=>Ge(n)).length:0;return{page:1,pageSize:st(s),total:i}}static _page(s,t){let e=st(s);if(!e)return;let i=f._records(t),n=i.filter(([c])=>Ge(c)),o=f._pageView(s,n.length,e);f._pages.set(s,o);let a=o.server?n:n.slice((o.page-1)*e,o.page*e),l=new Set(a.map(([c])=>c));i.forEach(c=>c.forEach(h=>h.toggleAttribute(Ze,!l.has(c[0])))),f._pageControls(s,o.page,Math.ceil(o.total/e))}static _pageView(s,t,e){let i=f._pages.get(s)??{page:1,pageSize:e,total:t},n=i.server?i.total:t;return{...i,page:Bi(i.page,n,e),pageSize:e,total:n}}static _pageControls(s,t,e){s.querySelectorAll(As).forEach(n=>{if(n.closest(".data-table")!==s)return;let o=n.dataset.tablePage==="previous"?t<=1:t>=e;n.setAttribute("aria-disabled",String(o))});let i=$i(s,"[data-table-page-status]");if(i){let n=new Intl.NumberFormat(u.locale(s));i.textContent=`${n.format(t)} / ${n.format(e)}`}}static _firstPage(s){st(s)&&f._resetPage(s)}static _resetPage(s){f._pages.get(s)?.server||(f._pages.delete(s),f.sync(s))}static _select(s,t,e){if(!s)return;e&&t.forEach(n=>n.checked=s.checked);let i=t.filter(n=>n.checked).length;s.indeterminate=i%t.length>0,s.checked=i>0&&!s.indeterminate}static _drag(s,t){let e=s.parentElement,i=f.width(e),n=getComputedStyle(e).direction==="rtl"?-1:1;f._dragged=!1,s.setPointerCapture(t.pointerId);let o=R(s),{signal:a}=o;s.addEventListener("pointermove",c=>{let h=c.clientX-t.clientX;Math.abs(h)<4&&!f._dragged||(f._dragged=!0,f.setWidth(e,i+n*h))},{signal:a});let l=()=>{o.abort(),f._dragged&&f._resized(e,i)};s.addEventListener("pointerup",l,{signal:a}),s.addEventListener("pointercancel",l,{signal:a})}static _resizeTo(s,t){let e=f.width(s);f.setWidth(s,t),f._resized(s,e)}static _resized(s,t){let e=f.width(s);if(Math.abs(e-t)<.5)return;let i=re(s.closest("thead")).get(s);u.emit(s.closest(".data-table"),"resize",{header:s,column:i,width:e})}static _sort(s,t,e,i){if(f._pages.get(s.closest(".data-table"))?.server)return;let n=f._compare(s,t);for(let o of Array.from(s.tBodies)){let a=f._groups(o);a.sort(([l],[c])=>i*n(qi(l,e),qi(c,e))),o.append(...a.flat())}}static _compare(s,t){if(!t.classList.contains("numeric"))return new Intl.Collator(u.locale(s),{numeric:!0,sensitivity:"base"}).compare;let e=i=>Me(i)??-1/0;return(i,n)=>e(i)-e(n)}static _records(s){return Array.from(s.tBodies).flatMap(f._groups).filter(([t])=>!t.classList.contains("data-table-detail"))}static _groups(s){let t=[];for(let e of Array.from(s.rows))t.length&&e.classList.contains("data-table-detail")?t[t.length-1].push(e):t.push([e]);return t}};f._initialized=!1,f._dragged=!1,f._serverFilters=new WeakMap,f._pages=new WeakMap,f._pageRequests=new WeakMap,f._onChange=s=>{let t=u.eventTarget(s),e=t?.closest(".data-table"),i=e?.querySelector(":scope > table");if(!i)return;let[n,o]=[f._all(i),f._boxes(i)];t!==n&&!o.includes(t)||(f._select(n,f._enabled(i),t===n),u.emit(e,"change",{selected:o.filter(a=>a.checked).map(a=>a.closest("tr"))}))},f._onFilter=s=>{let t=u.closestInPath(s,`.data-table ${ks}`);if(!t)return;let e=t.closest(".data-table");f._serverFilters.set(e,s),u.emit(e,"filter",{query:t.value.trim()},!0)&&f._serverFilters.get(e)===s&&(f._serverFilters.delete(e),f._resetPage(e))},f._onPage=s=>{let t=u.closestInPath(s,`.data-table[data-page-size] ${As}:not(:disabled, [aria-disabled="true"])`);if(!t)return;let e=t.closest(".data-table");st(e)&&f._advancePage(e,Yr[t.dataset.tablePage],s)},f._onPageSize=s=>{if(!s.composed)return;let t=u.closestInPath(s,`.data-table[data-page-size] ${Xr}`);t&&f._setPageSize(t.closest(".data-table"),t.value,s)},f._onClick=s=>{let t=u.closestInPath(s,'.data-table[data-sort] > table > thead > tr > th > button:not([aria-haspopup], :disabled, [aria-disabled="true"], .drag-handle)');if(!t)return;let e=t.parentElement,i=e.closest(".data-table"),n=e.getAttribute("aria-sort")==="ascending"?"descending":"ascending";e.closest("thead").querySelectorAll("th[aria-sort]").forEach(a=>a.removeAttribute("aria-sort")),e.setAttribute("aria-sort",n);let o=re(e.closest("thead")).get(e);u.emit(i,"sort",{header:e,column:o,direction:n},!0)&&(f._sort(e.closest("table"),e,o,jr[n]),f._firstPage(i))},f._onToggle=s=>{let t=s.detail?.item;t?.matches?.(Ss)&&Hs(t)},f._onPointerDown=s=>{let t=u.closestInPath(s,Ni);t&&s.button===0&&f._drag(t,s)},f._onHandleClick=s=>{let t=u.closestInPath(s,Ni);if(!t||s.detail!==0&&f._dragged)return;let e=t.parentElement;f._resizeTo(e,so(e))},f._onKeyDown=s=>{let t=u.closestInPath(s,Ni);if(!t||!u.plainKey(s))return;let e=t.parentElement,i=no(e,s);i!==void 0&&(s.preventDefault(),f._resizeTo(e,i))};var oe=f;var ct=".transfer-available",ht=".transfer-chosen",ro=new Map([["add",{from:ct,to:ht,all:!1}],["add-all",{from:ct,to:ht,all:!0}],["remove",{from:ht,to:ct,all:!1}],["remove-all",{from:ht,to:ct,all:!0}]]),D=class D{static Init(){typeof document>"u"||(document.addEventListener("click",D._onClick),document.addEventListener("formdata",D._onFormData,{capture:!0}),document.addEventListener("reset",D._onReset,{capture:!0}))}static _onClick(s){let t=u.closestInPath(s,'.transfer-list [data-transfer]:not(:disabled, [aria-disabled="true"])'),e=ro.get(t?.getAttribute("data-transfer"));e&&D._move(t.closest(".transfer-list"),e)}static _move(s,t){let[e,i]=[t.from,t.to].map(l=>s.querySelector(`:scope > ${l}`)),n=D._boxes(s,t.from).filter(l=>!l.disabled&&(t.all||l.checked));if(!i||!n.length)return;D._record(s);let o=n.map(l=>l.closest("li"));for(let[l,c]of o.entries())n[l].checked=!1,i.insertBefore(c,D._slot(s,c,i));let a=[...i.children].filter(l=>o.includes(l));D._announce(s,a.length,i),s.dispatchEvent(new CustomEvent("expressive:transfer",{bubbles:!0,detail:{rows:a,from:e,to:i}}))}static _boxes(s,t){return[...s.querySelectorAll(`:scope > ${t} > li > label > input[type="checkbox"]`)]}static _record(s){if(D._starts.has(s))return;let t=e=>[...s.querySelectorAll(`:scope > ${e} > li`)];D._starts.set(s,{available:t(ct),chosen:t(ht)})}static _slot(s,t,e){let i=D._starts.get(s),n=[...i.available,...i.chosen],o=n.indexOf(t);return!e.matches(ct)||o<0?null:[...e.children].find(a=>n.indexOf(a)>o)??null}static _announce(s,t,e){let i=D._regions.get(s);i||(i=document.createElement("div"),i.className="visually-hidden",i.setAttribute("aria-live","polite"),s.after(i),D._regions.set(s,i)),i.textContent=D.i18n.moved.replace("{count}",String(t)).replace("{list}",D._name(e))}static _name(s){let t=s.getAttribute("aria-label");if(t!==null)return t;let e=s.getRootNode();return(s.getAttribute("aria-labelledby")??"").split(/\s+/).map(n=>e.getElementById(n)?.textContent.trim()).filter(Boolean).join(" ")}static _onFormData(s){let t=s.target.querySelectorAll('.transfer-list:not([data-name=""])[data-name]');for(let e of t)for(let i of D._boxes(e,ht).filter(D._submits))s.formData.append(e.dataset.name,i.value)}static _submits(s){return!s.matches("fieldset[disabled] > :not(legend:first-of-type) *")}static _onReset(s){let t=[...s.target.querySelectorAll(".transfer-list")];setTimeout(()=>{s.defaultPrevented||t.forEach(D._restore)})}static _restore(s){let t=D._starts.get(s);if(!t)return;let e=i=>i.filter(n=>s.contains(n));s.querySelector(`:scope > ${ct}`)?.append(...e(t.available)),s.querySelector(`:scope > ${ht}`)?.append(...e(t.chosen))}};D.i18n={moved:"Moved {count} to {list}"},D._starts=new WeakMap,D._regions=new WeakMap;var ae=D;var oo={},ao=["Enter","ArrowDown"],ut=class extends b{constructor(t,e){super(t,e);this._observer=null;this._sentinel=null;this._input=null;this._view=null;this._restore=null;this._onIntersect=t=>{let e=t[0];e&&this.el.classList.toggle("collapsed",!e.isIntersecting&&e.boundingClientRect.top<this.el.getBoundingClientRect().top)};this._onSearchFocus=()=>{this._view instanceof HTMLDialogElement||this._openSearch()};this._onSearchKeydown=t=>{!ao.includes(t.key)||u.isComposing(t)||!(this._view instanceof HTMLDialogElement)||(t.preventDefault(),this._openSearch())};this._openSearch=()=>{if(this._view instanceof HTMLDialogElement){this._view.open||this._view.showModal();return}this._restore??(this._restore={hidden:this._view.hidden,expanded:this._input.getAttribute("aria-expanded")}),this._view.hidden=!1,this._input.setAttribute("aria-expanded","true")};this._setupCollapse(),this._setupSearch()}static get defaults(){return oo}destroy(){this._observer?.disconnect(),this._observer=null,this._sentinel?.remove(),this._sentinel=null,this._restore&&(this._view.hidden=this._restore.hidden,x(this._input,"aria-expanded",this._restore.expanded),this._restore=null),this.el.classList.remove("collapsed"),super.destroy()}_setupCollapse(){!this.el.classList.contains("medium")&&!this.el.classList.contains("large")||(this._sentinel=document.createElement("span"),this._sentinel.setAttribute("aria-hidden","true"),this._sentinel.style.cssText="display:block;height:0;position:relative;top:-64px;pointer-events:none;visibility:hidden",this.el.insertAdjacentElement("afterend",this._sentinel),this._observer=new IntersectionObserver(this._onIntersect),this._observer.observe(this._sentinel))}_setupSearch(){if(this._input=this.el.querySelector('input[type="search"]'),!this._input)return;let t=this._input.getAttribute("aria-controls");if(this._view=t&&u.getElementById(this.el,t)||this.el.querySelector(".search-view"),!this._view)return;let{signal:e}=this._events;this._input.addEventListener("focus",this._onSearchFocus,{signal:e}),this._input.addEventListener("click",this._openSearch,{signal:e}),this._input.addEventListener("keydown",this._onSearchKeydown,{signal:e})}};ut.key="Expressive_AppBar";var lo={},dt=class extends b{constructor(t,e){super(t,e);this._addedExpanded=!1;this.open=()=>{this.isOpen||(this.isOpen=!0,this._list&&(this._list.inert=!1),this.el.classList.add("active"),this._anchor?.setAttribute("aria-expanded","true"),document.addEventListener("click",this._handleDocumentClick),document.addEventListener("keydown",this._handleDocumentKeydown))};this.close=()=>{if(!this.isOpen)return;let t=this.el.getRootNode().activeElement;t&&this._list?.contains(t)&&this._anchor?.focus(),this._list&&(this._list.inert=!0),this.isOpen=!1,this.el.classList.remove("active"),this._anchor?.setAttribute("aria-expanded","false"),document.removeEventListener("click",this._handleDocumentClick),document.removeEventListener("keydown",this._handleDocumentKeydown)};this._handleFABClick=t=>{let e=t.target;if(!(e instanceof Element))return;let i=e.closest("a, button");!i||i.matches(':disabled, [aria-disabled="true"]')||(i===this._anchor?this._toggle():this._list?.contains(i)&&this.close())};this._handleAnchorKeydown=t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),this._toggle())};this._handleDocumentKeydown=t=>{t.key==="Escape"&&!t.defaultPrevented&&this.close()};this._handleDocumentClick=t=>{t.composedPath().includes(this.el)||this.close()};this.isOpen=!1,this._anchor=this.el.querySelector(":scope > a, :scope > button"),this._list=this.el.querySelector(":scope > ul, :scope > menu"),this._listWasInert=this._list?.inert??!1,this.el.classList.remove("active"),this._list&&(this._list.inert=!0),this._addedExpanded=!!this._anchor&&!this._anchor.hasAttribute("aria-expanded"),this._anchor?.setAttribute("aria-expanded","false"),this._anchor instanceof HTMLAnchorElement&&!this._anchor.hasAttribute("href")&&((!this._anchor.hasAttribute("tabindex")||this._anchor.tabIndex<0)&&(this._anchorTabIndex=this._anchor.getAttribute("tabindex"),this._anchor.tabIndex=0),this._anchor.addEventListener("keydown",this._handleAnchorKeydown,{signal:this._events.signal})),this.el.addEventListener("click",this._handleFABClick,{signal:this._events.signal})}static get defaults(){return lo}destroy(){this.close(),this._list&&(this._list.inert=this._listWasInert),this._addedExpanded&&this._anchor.removeAttribute("aria-expanded"),this._anchorTabIndex!==void 0&&x(this._anchor,"tabindex",this._anchorTabIndex),super.destroy()}_toggle(){this.isOpen?this.close():this.open()}};dt.key="Expressive_FloatingActionButton";var co={},ho=new Set(["single","multiple"]),Rs="button-group-pressed",uo=.15,pt=class extends b{constructor(t,e={}){super(t,e);this._pressedStyles=new Map;this._releaseStyles=new Map;this._releaseTimer=null;this._originalPressed=new Map;this._activeItem=null;this._handleClick=t=>{if(!this._selectionMode)return;let e=this._itemFromEvent(t);if(!(e instanceof HTMLButtonElement)||this._isDisabled(e))return;this._rememberPressed(e);let i=e.getAttribute("aria-pressed")!=="true",n=this._toggleItems.filter(o=>o.getAttribute("aria-pressed")==="true").length;!i&&this.el.hasAttribute("data-selection-required")&&n===1||(this._selectionMode==="single"&&i&&this._toggleItems.forEach(o=>{this._rememberPressed(o),o.setAttribute("aria-pressed","false")}),e.setAttribute("aria-pressed",i?"true":"false"),this._notify("change",null,{detail:{button:e,pressed:i}}))};this._handlePointerDown=t=>{if(t.button!==0)return;let e=this._itemFromEvent(t);e&&!this._isDisabled(e)&&this._startPress(e)};this._handleKeyDown=t=>{if(t.repeat||t.key!==" "&&t.key!=="Enter")return;let e=this._itemFromEvent(t);e&&!this._isDisabled(e)&&this._startPress(e)};this._handleKeyUp=t=>{(t.key===" "||t.key==="Enter")&&this._resetPress()};this._handleFocusOut=t=>{t.target===this._activeItem&&this._resetPress()};this._resetPress=()=>{if(this._activeItem?.classList.remove(Rs),this._activeItem=null,!!this._pressedStyles.size){this._finishRelease(),this._releaseStyles=new Map(this._pressedStyles);for(let[t,e]of this._releaseStyles)t.style.width=`${e.baseWidth}px`;this._pressedStyles.clear(),this._releaseTimer=window.setTimeout(this._finishRelease,200)}};this._finishRelease=()=>{this._releaseTimer!==null&&window.clearTimeout(this._releaseTimer),this._releaseTimer=null;for(let[t,e]of this._releaseStyles)t.style.width=e.width;this._releaseStyles.clear()};let{signal:i}=this._events;this._selectionMode&&(this._normalizeSelection(),this.el.addEventListener("click",this._handleClick,{capture:!0,signal:i})),this.el.addEventListener("pointerdown",this._handlePointerDown,{signal:i}),this.el.addEventListener("keydown",this._handleKeyDown,{signal:i}),this.el.addEventListener("focusout",this._handleFocusOut,{signal:i}),document.addEventListener("pointerup",this._resetPress,{signal:i}),document.addEventListener("pointercancel",this._resetPress,{signal:i}),document.addEventListener("keyup",this._handleKeyUp,{signal:i}),window.addEventListener("blur",this._resetPress,{signal:i})}static get defaults(){return co}destroy(){this._resetPress(),this._finishRelease();for(let[t,e]of this._originalPressed)x(t,"aria-pressed",e);this._originalPressed.clear(),super.destroy()}get _selectionMode(){let t=this.el.dataset.selection;return ho.has(t)?t:null}get _items(){return Array.from(this.el.children).filter(t=>t instanceof HTMLButtonElement||t instanceof HTMLAnchorElement&&t.classList.contains("button"))}get _toggleItems(){return this._items.filter(t=>t instanceof HTMLButtonElement)}_normalizeSelection(){let t=this._toggleItems;t.forEach(e=>{this._rememberPressed(e),["true","false"].includes(e.getAttribute("aria-pressed")||"")||e.setAttribute("aria-pressed","false")}),this._selectionMode==="single"&&t.filter(i=>i.getAttribute("aria-pressed")==="true").slice(1).forEach(i=>i.setAttribute("aria-pressed","false")),this.el.hasAttribute("data-selection-required")&&!t.some(e=>e.getAttribute("aria-pressed")==="true")&&t.find(e=>!this._isDisabled(e))?.setAttribute("aria-pressed","true")}_itemFromEvent(t){if(!(t.target instanceof Element))return null;let e=t.target.closest("button, a.button");return e instanceof HTMLElement&&e.parentElement===this.el?e:null}_isDisabled(t){return t instanceof HTMLButtonElement&&t.disabled||t.getAttribute("aria-disabled")==="true"||t.classList.contains("disabled")}_rememberPressed(t){this._originalPressed.has(t)||this._originalPressed.set(t,t.getAttribute("aria-pressed"))}_startPress(t){if(this._activeItem)return;this._finishRelease();let e=this._items,i=e.indexOf(t);if(i<0||(this._activeItem=t,t.classList.add(Rs),this.el.classList.contains("connected")||e.length<2))return;let n=e.map(g=>g.getBoundingClientRect()),o=n[i].width;if(o<=0)return;let a=Number.parseFloat(getComputedStyle(this.el).getPropertyValue("--md-comp-button-group-pressed-item-width-multiplier")),l=Number.isFinite(a)?a:.15,c=o*l,h=[i-1,i+1].filter(g=>g>=0&&g<e.length),d=new Map;if(h.length===1){let g=h[0];d.set(g,Math.min(c,this._compressionCapacity(e[g],n[g])))}else{let g=c/2;for(let E of h)d.set(E,Math.min(g,this._compressionCapacity(e[E],n[E])));let m=c-[...d.values()].reduce((E,T)=>E+T,0);for(let E of h){if(m<=0)break;let T=this._compressionCapacity(e[E],n[E])-d.get(E),C=Math.min(m,T);d.set(E,d.get(E)+C),m-=C}}let p=[...d.values()].reduce((g,m)=>g+m,0);p<=0||(e.forEach((g,m)=>{this._pressedStyles.set(g,{width:g.style.width,baseWidth:n[m].width}),g.style.width=`${n[m].width}px`}),this.el.offsetWidth,e.forEach((g,m)=>{let E=m===i?p:-(d.get(m)||0);g.style.width=`${n[m].width+E}px`}))}_compressionCapacity(t,e){let i=t.classList.contains("icon-button")?e.width*(1-uo):e.height;return Math.max(0,e.width-i)}};pt.key="Expressive_ButtonGroup";var po={duration:200,indicators:!1,noWrap:!1,interval:0,height:null,onCycleTo:null,i18n:{carousel:"Carousel",item:"Item",of:"of",indicators:"Slides",slide:"Slide"}},Je='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])',mt=class extends b{constructor(t,e){super(t,e);this.center=0;this._ownIndicators=!1;this._trackEl=null;this._ignoreScroll=!1;this._alignAfterResize=!1;this._trackRaf=null;this._started=!1;this._vertical=!1;this._resizeObserver=null;this._resizeTimeout=null;this._dragPointerId=null;this._dragStartX=0;this._dragStartY=0;this._dragStartScroll=0;this._suppressClick=!1;this._suppressClickTimeout=null;this._generatedContainerRole=!1;this._generatedContainerLabel=!1;this._generatedContainerDescription=!1;this._generatedWideLayout=!1;this._generatedFixedHeight=!1;this._authoredInlineHeight=null;this._autoAdvanceTimer=null;this._autoAdvances=!1;this._autoPaused=!1;this._hovered=!1;this._focused=!1;this._motion=window.matchMedia("(prefers-reduced-motion: reduce)");this._generatedItemTabIndexes=new Set;this._generatedItemLabels=new Set;this._generatedItemDescriptions=new Set;this._generatedItemSizes=new Set;this._authoredItemSizes=new Set;this._itemA11yOriginal=new Map;this._handleThrottledResize=()=>{!this._started||this._resizeTimeout!==null||(this._handleResize(),this._resizeTimeout=setTimeout(()=>{this._resizeTimeout=null,this._handleResize()},200))};this._handleAutoAdvanceState=t=>{t.type==="mouseenter"?this._hovered=!0:t.type==="mouseleave"?this._hovered=!1:t.type==="focusin"?this._focused=!0:t.type==="focusout"&&(this._focused=this.el.contains(t.relatedTarget)),this._syncAutoAdvance()};this._handleMotionChange=()=>{this._syncAutoAdvance(),this._motion.matches&&this._scrollToIndex(this.center,!1),this._updateParallax()};this._tick=()=>{this._autoAdvanceTimer=null,this._advance(),this._syncAutoAdvance()};this._advance=()=>{let t=this.center+1;if(t<this.count){this.set(t);return}if(this.options.noWrap){this._autoAdvances=!1,this._syncAutoAdvance();return}this.set(0)};this._handleNativeScroll=()=>{this._alignAfterResize=!1,this._finishScroll()};this._handleTrackPointerDown=t=>{this._handleNativeScroll(),!(t.pointerType!=="mouse"||t.button!==0)&&(this.pressed=!0,this.dragged=!1,this._suppressClick=!1,this._dragPointerId=t.pointerId,this._dragStartX=t.clientX,this._dragStartY=t.clientY,this._dragStartScroll=this._vertical?this._scroller.scrollTop:this._scroller.scrollLeft,this._setDragListeners(!0))};this._handleTrackPointerMove=t=>{if(!this.pressed||t.pointerId!==this._dragPointerId)return;let e=t.clientX-this._dragStartX,i=t.clientY-this._dragStartY,n=this._vertical?i:e,o=this._vertical?e:i;if(!this.dragged){if(Math.abs(n)<6||Math.abs(n)<=Math.abs(o))return;this.dragged=!0,this.el.classList.add("dragging");try{this._scroller.setPointerCapture(t.pointerId)}catch{}}this._vertical?this._scroller.scrollTop=this._dragStartScroll-i:this._scroller.scrollLeft=this._dragStartScroll-e,t.preventDefault()};this._handleTrackPointerUp=t=>{if(!(!this.pressed||t.pointerId!==this._dragPointerId)){this.pressed=!1,this._dragPointerId=null,this._setDragListeners(!1),this.el.classList.remove("dragging");try{this._scroller.releasePointerCapture(t.pointerId)}catch{}this.dragged&&(this._suppressClick=!0,window.clearTimeout(this._suppressClickTimeout),this._suppressClickTimeout=setTimeout(()=>{this._suppressClick=!1},0),this._syncActive(this._nearestIndex(),!0))}};this._handleTrackClick=t=>{this._suppressClick&&(this._suppressClick=!1,t.preventDefault(),t.stopImmediatePropagation())};this._handleTrackDragStart=t=>{t.target.closest("a, img, picture, video")&&t.preventDefault()};this._handleItemResize=t=>{this._alignAfterResize&&!this.pressed&&t.propertyName==="flex-basis"&&this.images.includes(t.target)&&this._scrollToIndex(this.center,!1)};this._handleIndicatorClick=t=>{t.stopPropagation();let e=t.target.closest(".indicator-item");if(!e||!this._indicators.contains(e))return;let i=[...this._indicators.children].indexOf(e);i<0||this._cycleTo(i)};this._handleKeydown=t=>{if(this._keyBelongsElsewhere(t))return;let e=getComputedStyle(this._scroller).direction==="rtl",i=this._vertical?t.key==="ArrowDown":t.key===(e?"ArrowLeft":"ArrowRight"),n=this._vertical?t.key==="ArrowUp":t.key===(e?"ArrowRight":"ArrowLeft");t.key==="Home"?(t.preventDefault(),this.set(0),this._focusItem(0)):t.key==="End"?(t.preventDefault(),this.set(this.count-1),this._focusItem(this.count-1)):i?(t.preventDefault(),this.next(),this._focusItem(this.center)):n&&(t.preventDefault(),this.prev(),this._focusItem(this.center))};this._handleTrackScroll=()=>{this.el.classList.contains("scrolling")||this.el.classList.add("scrolling"),window.clearTimeout(this.scrollingTimeout),this.scrollingTimeout=setTimeout(()=>this.el.classList.remove("scrolling"),120),this._trackRaf===null&&(this._trackRaf=requestAnimationFrame(()=>{this._trackRaf=null;let t=this._ignoreScroll?this.center:this._nearestIndex();this._updateParallax(),t!==this.center&&this._syncActive(t,this.dragged)}))};this._handleResize=()=>{!this._started||!this.images.length||(this._syncAdaptiveMode(),this._syncLayoutRoles(this.center),this.pressed||this._scrollToIndex(this.center,!1),this._updateParallax())};this._finishScroll=()=>{this._ignoreScroll=!1,this._scroller.style.scrollSnapType="",clearTimeout(this._scrollEndTimeout),this._scroller.removeEventListener("scrollend",this._handleScrollEnd)};this._handleScrollEnd=()=>{this._nearestIndex()===this.center&&!this.images.some(t=>t.getAnimations().some(e=>e.playState==="running"))&&this._finishScroll()};if(this._vertical=this.el.classList.contains("full-screen"),this.pressed=!1,this.dragged=!1,this.images=this._collectItems(),!this.images.length){console.error("Carousel: no .carousel-item elements to show");return}this.images.forEach(n=>{this._itemA11yOriginal.set(n,{ariaHidden:n.getAttribute("aria-hidden"),tabIndex:n.getAttribute("tabindex")}),n.hasAttribute("data-carousel-size")&&this._authoredItemSizes.add(n)}),this.hasMultipleSlides=this.images.length>1,this.showIndicators=this.options.indicators&&this.hasMultipleSlides,this.count=this.images.length,this._autoAdvances=this.options.interval>0&&this.hasMultipleSlides,this.images.forEach(n=>n.classList.add("carousel-item")),this.options.height!==null&&(this._generatedFixedHeight=!this.el.classList.contains("fixed-height"),this._authoredInlineHeight=this.el.style.getPropertyValue("--carousel-height")||null,this.el.classList.add("fixed-height"),this.el.style.setProperty("--carousel-height",`${this.options.height}px`)),this._wrapTrack(),this._syncAdaptiveMode(),this.showIndicators&&this._setupIndicators(),this._setupAccessibility(),this._setupEventHandlers(),this._started=!0;let i=Math.max(0,this.images.findIndex(n=>n.classList.contains("active")));this.center=i,this._syncActive(i,!1),this._updateParallax(),this._scrollToIndex(i,!1),this._syncAutoAdvance()}get _scroller(){return this._trackEl??this.el}static get defaults(){return po}destroy(){this._started&&this._teardown(),super.destroy()}_collectItems(){let t=Array.from(this.el.children).filter(e=>e instanceof HTMLElement&&e.classList.contains("carousel-item"));return t.length?t:Array.from(this.el.children).filter(e=>!(e instanceof HTMLElement)||e.classList.contains("indicators")?!1:e.tagName!=="NAV")}_setupAccessibility(){this.el.hasAttribute("role")||(this.el.setAttribute("role","region"),this._generatedContainerRole=!0),!this.el.hasAttribute("aria-label")&&!this.el.hasAttribute("aria-labelledby")&&(this.el.setAttribute("aria-label",this.options.i18n.carousel),this._generatedContainerLabel=!0),this.el.hasAttribute("aria-roledescription")||(this.el.setAttribute("aria-roledescription","carousel"),this._generatedContainerDescription=!0),this.images.forEach((t,e)=>{if(t.hasAttribute("aria-roledescription")||(t.setAttribute("aria-roledescription","slide"),this._generatedItemDescriptions.add(t)),!t.hasAttribute("aria-label")&&!t.hasAttribute("aria-labelledby")){let i=t.querySelector("img[alt]")?.getAttribute("alt")?.trim(),n=t.textContent?.replace(/\s+/g," ").trim(),o=i||n,a=`${this.options.i18n.item} ${e+1} ${this.options.i18n.of} ${this.count}`;t.setAttribute("aria-label",o?`${o}, ${a}`:a),this._generatedItemLabels.add(t)}!t.matches(Je)&&!t.querySelector(Je)&&(t.tabIndex=0,this._generatedItemTabIndexes.add(t))})}_setupIndicators(){let t=Array.from(this.el.children).find(e=>e instanceof HTMLElement&&e.classList.contains("indicators"));this._indicators=t??document.createElement("nav"),this._ownIndicators=!t,this._indicators.classList.add("indicators"),this._indicators.setAttribute("aria-label",this.options.i18n.indicators),this._indicators.replaceChildren(),this.images.forEach((e,i)=>{let n=document.createElement("button");n.type="button",n.classList.add("indicator-item"),n.setAttribute("aria-label",`${this.options.i18n.slide} ${i+1}`),this._indicators.appendChild(n)}),this._ownIndicators&&this.el.appendChild(this._indicators)}_setupEventHandlers(){let{signal:t}=this._events;this.el.addEventListener("keydown",this._handleKeydown,{signal:t}),this._motion.addEventListener("change",this._handleMotionChange,{signal:t}),this._autoAdvances&&(this.el.addEventListener("mouseenter",this._handleAutoAdvanceState,{signal:t}),this.el.addEventListener("mouseleave",this._handleAutoAdvanceState,{signal:t}),this.el.addEventListener("focusin",this._handleAutoAdvanceState,{signal:t}),this.el.addEventListener("focusout",this._handleAutoAdvanceState,{signal:t}),document.addEventListener("visibilitychange",this._handleAutoAdvanceState,{signal:t})),this.showIndicators&&this._indicators&&this._indicators.addEventListener("click",this._handleIndicatorClick,{signal:t}),this._resizeObserver=new ResizeObserver(()=>this._handleThrottledResize()),this._resizeObserver.observe(this.el),this.el.classList.contains("full-screen")&&window.addEventListener("resize",this._handleThrottledResize,{passive:!0,signal:t}),this._scroller.addEventListener("scroll",this._handleTrackScroll,{passive:!0,signal:t}),this._scroller.addEventListener("pointerdown",this._handleTrackPointerDown,{signal:t}),this._scroller.addEventListener("wheel",this._handleNativeScroll,{passive:!0,signal:t}),this._scroller.addEventListener("click",this._handleTrackClick,{capture:!0,signal:t}),this._scroller.addEventListener("dragstart",this._handleTrackDragStart,{signal:t}),this._scroller.addEventListener("transitionend",this._handleItemResize,{signal:t})}_teardown(){this._started=!1,this._events.abort(),this._resizeObserver?.disconnect(),this._resizeObserver=null,this._finishScroll(),this._autoAdvances=!1,this._syncAutoAdvance(),this._trackRaf!==null&&cancelAnimationFrame(this._trackRaf),window.clearTimeout(this.scrollingTimeout),window.clearTimeout(this._suppressClickTimeout),clearTimeout(this._resizeTimeout),this._ownIndicators&&this._indicators?.remove(),this._unwrapTrack(),this.images.forEach(t=>{t.style.removeProperty("--md-comp-carousel-item-parallax"),this._generatedItemLabels.has(t)&&t.removeAttribute("aria-label"),this._generatedItemDescriptions.has(t)&&t.removeAttribute("aria-roledescription"),this._generatedItemSizes.has(t)&&t.removeAttribute("data-carousel-size");let e=this._itemA11yOriginal.get(t);e&&(x(t,"aria-hidden",e.ariaHidden),x(t,"tabindex",e.tabIndex))}),this._generatedContainerRole&&this.el.removeAttribute("role"),this._generatedContainerLabel&&this.el.removeAttribute("aria-label"),this._generatedContainerDescription&&this.el.removeAttribute("aria-roledescription"),this._generatedFixedHeight&&this.el.classList.remove("fixed-height"),this.options.height!==null&&(this._authoredInlineHeight===null?this.el.style.removeProperty("--carousel-height"):this.el.style.setProperty("--carousel-height",this._authoredInlineHeight)),this._generatedWideLayout&&this.el.classList.remove("multi-wide","multi-large","multi-extra-large","full-screen-horizontal")}_syncAutoAdvance(){let t=this._autoAdvances&&!this._autoPaused&&!this._hovered&&!this._focused&&!this._motion.matches&&!document.hidden;t&&this._autoAdvanceTimer===null?this._autoAdvanceTimer=setTimeout(this._tick,this.options.duration+this.options.interval):!t&&this._autoAdvanceTimer!==null&&(clearTimeout(this._autoAdvanceTimer),this._autoAdvanceTimer=null)}_setDragListeners(t){let e=t?"addEventListener":"removeEventListener",i={signal:this._events.signal};document[e]("pointermove",this._handleTrackPointerMove,i),document[e]("pointerup",this._handleTrackPointerUp,i),document[e]("pointercancel",this._handleTrackPointerUp,i)}_keyBelongsElsewhere(t){let e=t.target;return[t.defaultPrevented,t.altKey,t.ctrlKey,t.metaKey,t.shiftKey,e.isContentEditable].some(Boolean)||this.el.contains(e.closest('input, textarea, select, video[controls], audio[controls], [role="slider"], [role="tablist"], [role="menu"]'))}_paintIndicators(t){if(!this.showIndicators||!this._indicators)return;let e=(t%this.count+this.count)%this.count;this._indicators.querySelectorAll(".indicator-item").forEach((i,n)=>{let o=n===e;i.classList.toggle("active",o),o?i.setAttribute("aria-current","true"):i.removeAttribute("aria-current")})}_syncActive(t,e){let i=this.center;this.center=t,this.images.forEach((a,l)=>a.classList.toggle("active",l===t)),this._paintIndicators(t),this._syncLayoutRoles(t);let n=this.images[t],o={item:n,dragged:e};return i!==t&&!this._notify("change",this.options.onCycleTo,{args:[n,e],detail:o,current:()=>this.center===t})?!1:(typeof this.oneTimeCallback=="function"&&(this.oneTimeCallback.call(this,n,e),this.oneTimeCallback=null),!0)}_syncLayoutRoles(t){let e=this.images.map(()=>"large"),i=(n,o)=>{this.images[n]&&(e[n]=o)};if(!(this.el.classList.contains("uncontained")||this.el.classList.contains("full-screen")&&this._vertical))if(this.el.classList.contains("hero")||this.el.classList.contains("full-screen-horizontal"))i(t+1,"small"),this.el.classList.contains("center-aligned")&&i(t-1,"small");else{let n=this.el.clientWidth,o=n>=1600?4:n>=1200?3:n>=600?2:1,a=Math.min(o,Math.max(1,this.count-2));this.el.classList.remove("multi-wide","multi-large","multi-extra-large"),a===2?this.el.classList.add("multi-wide"):a===3?this.el.classList.add("multi-large"):a>=4&&this.el.classList.add("multi-extra-large"),this._generatedWideLayout=this._generatedWideLayout||a>1,i(t+a,"medium"),i(t+a+1,"small")}this.images.forEach((n,o)=>{this._authoredItemSizes.has(n)||(n.setAttribute("data-carousel-size",e[o]),this._generatedItemSizes.add(n))})}_syncAdaptiveMode(){if(!this.el.classList.contains("full-screen"))return;let t=window.matchMedia("(orientation: landscape)").matches,e=this.el.clientWidth>=840||t,i=this._vertical;this._vertical=!e,this.el.classList.toggle("full-screen-horizontal",e),this._generatedWideLayout=this._generatedWideLayout||e,this._started&&i!==this._vertical&&this._scroller.scrollTo({left:0,top:0,behavior:"auto"})}_focusItem(t){let e=this.images[t];if(!e)return;((e.matches(Je)?e:e.querySelector(Je))??e).focus({preventScroll:!0})}_updateParallax(){if(this._motion.matches){this.images.forEach(o=>o.style.setProperty("--md-comp-carousel-item-parallax","0px"));return}let t=this._scroller.getBoundingClientRect(),e=this._vertical?t.top+t.height/2:t.left+t.width/2,i=Math.max(1,this._vertical?t.height:t.width),n=this.images.map(o=>o.getBoundingClientRect());this.images.forEach((o,a)=>{let l=n[a],c=this._vertical?l.top+l.height/2:l.left+l.width/2,h=Math.max(-1,Math.min(1,(c-e)/i));o.style.setProperty("--md-comp-carousel-item-parallax",`${h*-24}px`)})}_wrapTrack(){let t=document.createElement("div");t.className="carousel-track",this.images[0].before(t),this.images.forEach(e=>t.appendChild(e)),this._trackEl=t}_unwrapTrack(){this._trackEl&&(this.images.forEach(t=>this.el.insertBefore(t,this._trackEl)),this._trackEl.remove(),this._trackEl=null)}_nearestIndex(){let t=this.el.classList.contains("center-aligned"),e=getComputedStyle(this._scroller),i=!this._vertical&&e.direction==="rtl",n=this._vertical?this._scroller.scrollTop:this._scroller.scrollLeft,o=this._vertical?this._scroller.clientHeight:this._scroller.clientWidth,a=(this._vertical?this._scroller.scrollHeight:this._scroller.scrollWidth)-o,l=parseFloat(this._vertical?e.paddingBlockStart:e.paddingInlineStart)||0,c=this.center,h=1/0,d=1/0;return this.images.forEach((p,g)=>{let m=this._vertical?p.offsetTop:p.offsetLeft,E=this._vertical?p.offsetHeight:p.offsetWidth,T=t?m-(o-E)/2:m+(i?E-o+l:-l),C=Math.max(i?-a:0,Math.min(i?0:a,T)),_=Math.abs(C-n);g===this.center&&(d=_),_<h&&(h=_,c=g)}),d-h<=1?this.center:c}_scrollToIndex(t,e=!0){let i=this.images[t];if(!i)return;this._finishScroll();let n=this.el.classList.contains("center-aligned"),o=getComputedStyle(this._scroller),a=Number.parseFloat(o.paddingInlineStart)||0,l=Number.parseFloat(o.paddingBlockStart)||0,c=n?i.offsetLeft-(this._scroller.clientWidth-i.offsetWidth)/2:o.direction==="rtl"?i.offsetLeft+i.offsetWidth-this._scroller.clientWidth+a:i.offsetLeft-a,h=i.offsetTop-l;this._ignoreScroll=!0,this._scroller.style.scrollSnapType="none",this._scroller.scrollTo({left:this._vertical?0:c,top:this._vertical?h:0,behavior:e&&!this._motion.matches?"smooth":"instant"}),this._scroller.addEventListener("scrollend",this._handleScrollEnd),this._scrollEndTimeout=setTimeout(this._finishScroll,this.options.duration+350)}_cycleTo(t,e=null){this._alignAfterResize=!0,typeof e=="function"&&(this.oneTimeCallback=e),this._syncActive(t,!1)&&this._scrollToIndex(t)}pause(){this._autoPaused=!0,this._syncAutoAdvance()}start(){this._autoPaused=!1,this._syncAutoAdvance()}next(t=1){isNaN(t)&&(t=1);let e=this.center+t;e>=this.count||e<0||this._cycleTo(e)}prev(t=1){isNaN(t)&&(t=1);let e=this.center-t;e>=this.count||e<0||this._cycleTo(e)}set(t,e){(t===void 0||isNaN(t))&&(t=0),!(t>=this.count||t<0)&&this._cycleTo(t,e)}};mt.key="Expressive_Carousel";var mo=Object.freeze({}),Se=class extends b{constructor(t,e){super(t,e);this.updateCounter=()=>{let t=parseInt(this.el.getAttribute("maxlength")),e=this.el.value.length;this.isValidLength=e<=t;let i=e.toString();t&&(i+="/"+t,this._validateInput()),this.counterEl.textContent=i};this.isInvalid=!1,this.isValidLength=!1,this._setupCounter(),this._setupEventHandlers(),this.updateCounter()}static get defaults(){return mo}destroy(){super.destroy(),this._removeCounter(),this.isInvalid&&this.el.classList.remove("invalid")}_setupEventHandlers(){let t={capture:!0,signal:this._events.signal};this.el.addEventListener("focus",this.updateCounter,t),this.el.addEventListener("input",this.updateCounter,t)}_setupCounter(){this.counterEl=document.createElement("span"),this.counterEl.classList.add("character-counter"),this.counterEl.setAttribute("aria-live","polite"),this.counterEl.setAttribute("aria-atomic","true"),this.counterEl.style.fontSize="12px",this.counterEl.style.height="1",this.el.parentElement.appendChild(this.counterEl)}_removeCounter(){this.counterEl.remove()}_validateInput(){this.isValidLength&&this.isInvalid?(this.isInvalid=!1,this.el.classList.remove("invalid")):!this.isValidLength&&!this.isInvalid&&(this.isInvalid=!0,this.el.classList.remove("valid"),this.el.classList.add("invalid"))}};Se.key="Expressive_CharacterCounter";var fo=Object.freeze({}),Fs={0:/[0-9]/,a:/\p{L}/u,"*":/[0-9\p{L}]/u},_o={deleteContentBackward:-1,deleteContentForward:1},go=r=>(r.match(/\\[^]|[^]/gu)??[]).map(s=>Fs[s]?{accepts:Fs[s]}:{literal:s.slice(-1)});function vo(r,s,t){if(r[s]?.literal===t)return s;let e=r.findIndex((i,n)=>n>=s&&"accepts"in i);return e<0?r.length:e}function bo(r,s,t,e){let i=vo(r,s,t),n=r[i];return n?"literal"in n?i+1:n.accepts.test(t)?(e.push(t),i+1):s:s}function ti(r,s,t){let e=[],i=0,n=0,o=0;for(let a of s){for(let l of a.normalize("NFKC"))i=bo(r,i,l,e);n+=a.length,n<=t&&(o=e.length)}return{chars:e,before:o}}function Ns(r,s){let t="",e="",i=[];for(let n of r){if(i.length===s.length)break;"literal"in n?e+=n.literal:(t+=e+s[i.length],e="",i.push(t.length))}return{text:t,ends:i}}var ft=class extends b{constructor(t,e){super(t,e);this._onInput=t=>{t.isComposing||this._format()};this._onBeforeInput=t=>{let e=_o[t.inputType],i=e&&this.el.selectionStart===this.el.selectionEnd?this._acrossLiteral(e):-1;i<0||(t.preventDefault(),this._remove(i,t.inputType))};this._onReset=t=>{t.target===this.el.form&&setTimeout(this._afterReset)};this._afterReset=()=>{this._events.signal.aborted||this._rewrite()};this._format=()=>{let t=this._rewrite();t!==null&&this.el.ownerDocument.activeElement===this.el&&this.el.setSelectionRange(t,t)};if(this._tokens=go(t.dataset.mask??""),!this._tokens.some(n=>"accepts"in n))return;let i=this._events.signal;t.addEventListener("input",this._onInput,{capture:!0,signal:i}),t.addEventListener("compositionend",this._format,{signal:i}),t.addEventListener("beforeinput",this._onBeforeInput,{signal:i}),t.ownerDocument.addEventListener("reset",this._onReset,{capture:!0,signal:i}),this._rewrite()}static get defaults(){return fo}_acrossLiteral(t){let{selectionStart:e,value:i}=this.el,n=ti(this._tokens,i,e),o=n.before+Math.min(t,0);return ti(this._tokens,i,e+t).before===n.before&&o in n.chars?o:-1}_remove(t,e){let{chars:i}=ti(this._tokens,this.el.value,0);i.splice(t,1);let{text:n,ends:o}=Ns(this._tokens,i);this.el.value=n;let a=o[t-1]??0;this.el.setSelectionRange(a,a),this.el.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0,inputType:e}))}_rewrite(){let t=this.el,{chars:e,before:i}=ti(this._tokens,t.value,t.selectionEnd??t.value.length),{text:n,ends:o}=Ns(this._tokens,e);return n===t.value?null:(t.value=n,o[i-1]??0)}};ft.key="Expressive_InputMask";var Eo={onOpen:null,onClose:null,i18n:{showLess:"Show less"}},Bs=["-webkit-line-clamp","line-clamp"],$s=["aria-expanded","aria-controls","hidden"];function yo(r){let s=r.ownerDocument.createTreeWalker(r,NodeFilter.SHOW_TEXT),t=null;for(let e=s.nextNode();e;e=s.nextNode())e.textContent.trim()&&!e.parentElement.closest('[aria-hidden="true"]')&&(t=e);return t}var ei=class ei extends b{constructor(t,e){super(t,e);this.isOpen=!1;this._initial={};this._initialId=null;this._label=null;this._moreLabel="";this._observer=null;this.open=()=>{this.isOpen||!this.button||(this._show(!0),this._notify("open",this.options.onOpen,{current:()=>this.isOpen}))};this.close=()=>{this.isOpen&&(this._show(!1),this._notify("close",this.options.onClose,{current:()=>!this.isOpen}))};this._toggle=()=>this.isOpen?this.close():this.open();this._fit=()=>{this.isOpen||this.button.matches(":focus")||ei.getInstance(this.el)!==this||(this.button.hidden=this.text.scrollHeight-this.text.clientHeight<=1)};if(this.text=t.querySelector(":scope > :is(.line-clamp-1, .line-clamp-2, .line-clamp-3)"),this.button=t.querySelector(":scope > button"),!this.text||!this.button)return;this._wire();let{signal:i}=this._events;this.button.addEventListener("click",this._toggle,{signal:i}),this.button.addEventListener("blur",this._fit,{signal:i}),this._observer=new ResizeObserver(this._fit),this._observer.observe(this.text),t.ownerDocument.fonts?.ready.then(this._fit)}static get defaults(){return Eo}destroy(){if(this.button){this._observer.disconnect(),this.isOpen&&this._show(!1);for(let t of $s)x(this.button,t,this._initial[t]);x(this.text,"id",this._initialId)}super.destroy()}_wire(){for(let t of $s)this._initial[t]=this.button.getAttribute(t);this._initialId=this.text.getAttribute("id"),this.text.id||(this.text.id=`show-more-${u.guid()}`),this._label=yo(this.button),this._label&&(this._moreLabel=this._label.data),this.button.ariaExpanded="false",this.button.setAttribute("aria-controls",this.text.id)}_show(t){this.isOpen=t,this.button.ariaExpanded=String(t),this._label&&(this._label.data=t?this._lessLabel():this._moreLabel),this._clamp(!t)}_lessLabel(){return this.button.dataset.showLess||this.options.i18n.showLess}_clamp(t){if(t)this._restoreClamp();else for(let e of Bs)this.text.style.setProperty(e,"unset")}_restoreClamp(){for(let t of Bs)this.text.style.removeProperty(t);this.text.style.length||this.text.removeAttribute("style")}};ei.key="Expressive_ShowMore";var le=ei;var To={enterDelay:500,exitDelay:300},qs=new WeakMap,_t=class extends b{constructor(t,e){super(t,e);this._shown=!1;this._holds=new Set;this._anchorName=`--hover-card-${u.guid()}`;this.open=()=>{clearTimeout(this._timeout),!(!this.cardEl||this._shown)&&(qs.get(this.cardEl)?.close(),this.cardEl.showPopover.call(this.cardEl,{source:this.el}),qs.set(this.cardEl,this),this._shown=!0,this._listenForEscape(!0),this._anchor(!0),this._notify("open"))};this.close=()=>{clearTimeout(this._timeout),this._shown&&(this.cardEl.hidePopover(),this._hidden(),this._notify("close"))};this._handlePointerEnter=t=>{t.pointerType!=="touch"&&this._hold("pointer")};this._handlePointerLeave=t=>{t.pointerType!=="touch"&&this._release("pointer")};this._handleLinkFocus=()=>{this.el.matches(":focus-visible")&&this._hold("focus")};this._handleCardFocus=()=>this._hold("focus");this._handleFocusOut=t=>{let e=t.relatedTarget;(!e||!(this.el.contains(e)||this.cardEl.contains(e)))&&this._release("focus")};this._handleKeydown=t=>{t.key!=="Escape"||u.isComposing(t)||(u.focusIsIn(this.el,this.cardEl)&&this._takeEscape(t),this.close())};this._handleToggle=t=>{t.newState!=="closed"||!this._shown||(this._hidden(),this._notify("close"))};if(this.cardEl=u.getElementById(t,t.getAttribute("aria-details")??""),!this.cardEl){console.error("HoverCard: aria-details names no element; the link shows no card.");return}let{signal:i}=this._events;this.cardEl.addEventListener("toggle",this._handleToggle,{signal:i});for(let n of[this.el,this.cardEl])n.addEventListener("pointerenter",this._handlePointerEnter,{signal:i}),n.addEventListener("pointerleave",this._handlePointerLeave,{signal:i}),n.addEventListener("focusout",this._handleFocusOut,{signal:i});this.el.addEventListener("focus",this._handleLinkFocus,{signal:i}),this.cardEl.addEventListener("focusin",this._handleCardFocus,{signal:i})}static get defaults(){return To}destroy(){clearTimeout(this._timeout),this._shown&&(this.cardEl.hidePopover(),this._hidden()),super.destroy()}_hidden(){this._shown=!1,this._listenForEscape(!1),this._anchor(!1)}_anchor(t){u.setAnchorName(this.el,this._anchorName,t),t?this.cardEl.style.setProperty("position-anchor",this._anchorName):this.cardEl.style.removeProperty("position-anchor");for(let e of[this.el,this.cardEl])e.getAttribute("style")||e.removeAttribute("style")}_schedule(){clearTimeout(this._timeout);let t=this._holds.size>0;if(t===this._shown)return;let[e,i]=t?[this.open,this.options.enterDelay]:[this.close,this.options.exitDelay];this._timeout=setTimeout(e,i)}_hold(t){this._holds.add(t),this._schedule()}_release(t){this._holds.delete(t),this._schedule()}_listenForEscape(t){let e=this.el.ownerDocument;t?e.addEventListener("keydown",this._handleKeydown,{capture:!0,signal:this._events.signal}):e.removeEventListener("keydown",this._handleKeydown,!0)}_takeEscape(t){t.preventDefault(),t.stopPropagation(),u.focusIsIn(this.cardEl)&&this.el.focus()}};_t.key="Expressive_HoverCard";var Lo=Object.freeze({i18n:Object.freeze({invalid:"Enter an amount."})}),wo="9876543210";function xo(r,s){let t=Math.max(r.lastIndexOf("."),r.lastIndexOf(",")),e=r.slice(t+1);return t>=0&&e.length<=s?[r.slice(0,t),e]:[r,""]}function Mo(r,s){let t=r.replace(/[^\d.,]/g,"").replace(/[.,]+$/,"");if(!/\d/.test(t))return null;let[e,i]=xo(t,s);return(/^\D*[-−]/.test(r)?-1:1)*+`${e.replace(/[.,]/g,"")}.${i}`}var gt=class extends b{constructor(t,e){super(t,e);this._format=()=>{this._show(this.value)};this._onChange=()=>{this.el.matches(":focus")||this._format()};this._onFocus=()=>{let t=this.value;if(t===null)return;let e=this._edit.format(t);this.el.value=e,this.el.setSelectionRange(e.length,e.length)};this._validate=()=>{let{el:t}=this,e=t.value.trim()!==""&&this.value===null;t.setCustomValidity(e?this.options.i18n.invalid:"")};this._onReset=t=>{t.target===this.el.form&&setTimeout(this._afterReset)};this._afterReset=()=>{this._events.signal.aborted||this._start()};this._onFormData=t=>{this._submitsTo(t.target)&&t.formData.set(this.el.name,String(this.value??this.el.value))};let i=u.locale(t);try{this._display=new Intl.NumberFormat(i,{style:"currency",currency:t.dataset.currency})}catch{return}this._digits=this._display.resolvedOptions().maximumFractionDigits,this._edit=new Intl.NumberFormat(i,{useGrouping:!1,maximumFractionDigits:this._digits}),this._plain=new Intl.NumberFormat("en",{useGrouping:!1,maximumFractionDigits:this._digits}),this._native=new Intl.NumberFormat(i,{useGrouping:!1}).format(9876543210),this._decimal=new Intl.NumberFormat(i).formatToParts(.5).find(l=>l.type==="decimal").value;let n=this._events.signal;t.addEventListener("change",this._onChange,{capture:!0,signal:n}),t.addEventListener("blur",this._format,{signal:n}),t.addEventListener("focus",this._onFocus,{signal:n}),t.addEventListener("input",this._validate,{signal:n});let o=t.getRootNode(),a="host"in o?o:t.ownerDocument;a.addEventListener("formdata",this._onFormData,{capture:!0,signal:n}),a.addEventListener("reset",this._onReset,{capture:!0,signal:n}),this._start()}static get defaults(){return Lo}get value(){return this._round(this._read(this.el.value))}_read(t){let e=Array.from(t.normalize("NFKC"),i=>i===this._decimal?".":wo[this._native.indexOf(i)]??i);return Mo(e.join(""),this._digits)}_round(t){return t===null?null:Number(this._plain.format(t))}_start(){let t=this.el.value,e=Number(t);this._show(this._round(t.trim()&&Number.isFinite(e)?e:this._read(t)))}_show(t){t!==null&&(this.el.value=this._display.format(t)),this._validate()}_submitsTo(t){let{el:e}=this;return t===e.form&&e.name!==""&&!e.matches(":disabled")}destroy(){super.destroy(),this.el.setCustomValidity("")}};gt.key="Expressive_CurrencyInput";var Co="expressive-cascader-control",Vi=["readonly","role","aria-haspopup","aria-expanded","aria-controls","aria-required","aria-invalid"],So=["Enter"," ","ArrowDown"],ko={ArrowLeft:"ArrowRight",ArrowRight:"ArrowLeft"},Ao=" / ",Ho=r=>Array.from(r.childNodes,s=>s.nodeName==="UL"?" ":s.textContent).join("").replace(/\s+/g," ").trim();function Ks(r,s){return r?Array.from(r.querySelectorAll(":scope > li"),t=>{let e={value:t.dataset.value??"",label:Ho(t),parent:s,children:[],source:t};return e.children=Ks(t.querySelector(":scope > ul"),e),e}):[]}var Io=(r,s)=>r.length===s.length&&r.every((t,e)=>t===s[e]),Vs=r=>r.flatMap(s=>[s,...Vs(s.children)]);function Oo(r){let s=[];for(let t=r;t;t=t.parent)s.unshift(t);return s}var zs={i18n:{required:"Choose an option."}},vt=class extends b{constructor(t,e={}){super(t,e);this._path=[];this.isOpen=!1;this._open=[];this._columns=[];this._nodes=new Map;this._rendered=new Map;this._insidePress=null;this._openEvents=null;this._stampedLabel=null;this._ids=0;this._initialPath=[];this._control=null;this._formName="";this._required=!1;this._keys={ArrowDown:(t,e)=>this._move(t,e),ArrowUp:(t,e)=>this._move(t,e),Home:(t,e)=>this._move(t,e),End:(t,e)=>this._move(t,e),ArrowRight:t=>this._forward(t),ArrowLeft:t=>this._back(t),Enter:t=>this._activate(t)," ":t=>this._activate(t),Escape:()=>this._dismiss(),Tab:()=>this._dismiss()};this._handleInputKeydown=u.ignoringComposition(t=>{this.isOpen||!So.includes(t.key)||(t.preventDefault(),this.open())});this._handleOptionKeydown=t=>{let e=t.target.closest('[role="option"]'),i=e&&this._keys[this._keyName(t)];!i||!u.plainKey(t)||(t.preventDefault(),i(e,t))};this._handleInvalid=()=>{this.input.setAttribute("aria-invalid","true")};this._handleInputClick=()=>{this.isOpen?this.close():this.open()};this._handleOptionClick=t=>{let e=t.target.closest('[role="option"]');e&&(this._focus(e),this._pick(e))};this._handleInsidePointer=t=>{this._insidePress=t};this._handleOutsidePointer=t=>{t!==this._insidePress&&this.close()};if(this.input=this.el.querySelector(":scope > input"),this._options=Ks(this.el.querySelector(":scope > .cascader-options"),null),!this.input)return;this._saved=Vi.map(n=>this.input.getAttribute(n)),this.popover=document.createElement("div"),this.popover.id=`cascader-${u.guid()}`,this.popover.className="cascader-popover",this.popover.setAttribute("popover","manual"),this.popover.setAttribute("role","dialog"),this.el.append(this.popover),this._labelledBy=this.input.getAttribute("aria-labelledby")??this._labelId(),this._name(this.popover),this.input.readOnly=!0,this.input.setAttribute("role","combobox"),this.input.setAttribute("aria-haspopup","dialog"),this.input.setAttribute("aria-expanded","false"),this.input.setAttribute("aria-controls",this.popover.id),this._path=this._initialPath=this._startingPath(),this._show(),this._takeName();let{signal:i}=this._events;this.input.addEventListener("click",this._handleInputClick,{signal:i}),this.input.addEventListener("keydown",this._handleInputKeydown,{signal:i}),this.popover.addEventListener("click",this._handleOptionClick,{signal:i}),this.popover.addEventListener("keydown",this._handleOptionKeydown,{signal:i})}static get defaults(){return zs}get value(){return this._path.map(t=>t.value)}open(){this.isOpen||this.input.matches(":disabled")||(this.isOpen=!0,this._columns=[this._addColumn(this._options,null)],this._open=[],this._path.forEach((t,e)=>this._choose(e,t)),this._showPopover(),this._focus(this._optionFor(this._path.at(-1))??this._columns[0].querySelector('[role="option"]')))}close(){this.isOpen&&(this.isOpen=!1,this._openEvents.abort(),this.popover.hidePopover?.(),this.popover.replaceChildren(),this._columns=[],this._nodes.clear(),this._rendered.clear(),this.input.setAttribute("aria-expanded","false"))}destroy(){this.input&&(this.close(),this._giveNameBack(),this._stampedLabel?.removeAttribute("id"),this.popover.remove(),Vi.forEach((t,e)=>x(this.input,t,this._saved[e]))),super.destroy()}_startingPath(){return Oo(Vs(this._options).find(t=>!t.children.length&&t.source.hasAttribute("data-selected")))}_showPopover(){this.popover.showPopover?.({source:this.input}),this.input.setAttribute("aria-expanded","true"),this._openEvents=R(this.el);let{signal:t}=this._openEvents;this.el.addEventListener("pointerdown",this._handleInsidePointer,{signal:t}),document.addEventListener("pointerdown",this._handleOutsidePointer,{signal:t})}_labelId(){let t=this.input.labels?.[0];return t?(t.id||(t.id=`${this.popover.id}-label`,this._stampedLabel=t),t.id):null}_name(t){this._labelledBy?t.setAttribute("aria-labelledby",this._labelledBy):x(t,"aria-label",this.input.getAttribute("aria-label"))}_addColumn(t,e){let i=document.createElement("ul");return i.setAttribute("role","listbox"),e?i.setAttribute("aria-labelledby",this._optionFor(e).id):this._name(i),i.append(...t.map(n=>this._addOption(n))),i.firstElementChild?.setAttribute("tabindex","0"),this.popover.append(i),i}_addOption(t){let e=document.createElement("li");if(e.id=`${this.popover.id}-${this._ids++}`,e.setAttribute("role","option"),e.setAttribute("aria-selected","false"),e.tabIndex=-1,e.textContent=t.label,t.children.length){let i=document.createElement("span");i.className="cascader-chevron",i.setAttribute("aria-hidden","true"),e.append(i)}return this._nodes.set(e,t),this._rendered.set(t,e),e}_optionFor(t){return this._rendered.get(t)}_choose(t,e){this._open=[...this._open.slice(0,t),e],this._columns.splice(t+1).forEach(i=>i.remove()),this._columns[t].querySelectorAll('[role="option"]').forEach(i=>{let n=this._nodes.get(i)===e;i.setAttribute("aria-selected",String(n)),i.setAttribute("tabindex",n?"0":"-1")}),e.children.length&&this._columns.push(this._addColumn(e.children,e))}_focus(t){t instanceof HTMLElement&&(t.parentElement.querySelectorAll('[tabindex="0"]').forEach(e=>e.setAttribute("tabindex","-1")),t.tabIndex=0,t.focus())}_takeName(){this._formName=this.input.getAttribute("name")??"",this._formName&&qe()&&this._wrap()}_wrap(){this._required=this.input.required,this.input.required=!1,this._required&&this.input.setAttribute("aria-required","true"),this._control=ze(Co,this.input,()=>this._sync()),this._control.onFormReset=()=>this._reset(),this._control.addEventListener("invalid",this._handleInvalid,{signal:this._events.signal}),this._sync()}_sync(){if(!this._control)return;let t=new FormData;this.value.forEach(e=>t.append(this._formName,e)),this._control.internals.setFormValue(t),this._validate()}_validate(){let t=this._required&&!this._path.length;this._control.internals.setValidity({valueMissing:t},t?this._requiredMessage:"",this.input),t||x(this.input,"aria-invalid",this._saved[Vi.indexOf("aria-invalid")])}get _requiredMessage(){return this.options.i18n.required||zs.i18n.required}_reset(){this.close(),this._path=this._initialPath,this._show(),this._sync()}_giveNameBack(){this._control&&(Ke(this._control,this.input),this._control=null,this.input.required=this._required)}_commit(){let t=!Io(this._open,this._path);this._path=this._open,this._show(),this._sync(),this.close(),this.input.focus(),t&&(this.input.dispatchEvent(new Event("input",{bubbles:!0})),this.input.dispatchEvent(new Event("change",{bubbles:!0})))}_pick(t){if(this.input.matches(":disabled"))return this.close();let e=this._nodes.get(t);this._choose(this._columns.indexOf(t.parentElement),e),e.children.length||this._commit()}_forward(t){this._nodes.get(t).children.length&&this._enter(t)}_activate(t){this._nodes.get(t).children.length?this._enter(t):this._pick(t)}_enter(t){this._pick(t),this._focus(this._columns.at(-1)?.firstElementChild)}_back(t){let e=this._columns.indexOf(t.parentElement);e>0&&this._focus(this._optionFor(this._open[e-1]))}_dismiss(){this.close(),this.input.focus()}_move(t,e){this._focus(u.focusTarget(Array.from(t.parentElement.children),e,{ArrowDown:1,ArrowUp:-1}))}_keyName(t){return getComputedStyle(this.el).direction==="rtl"?ko[t.key]??t.key:t.key}_show(){this.input.value=this._path.map(t=>t.label).join(Ao)}};vt.key="Expressive_Cascader";var Do={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,origin:{x:.5,y:.5},colors:[],shapes:["square","circle"],scalar:1,manualStart:!1},Po=["primary","secondary","tertiary","primary-container","secondary-container","tertiary-container"],Ro=["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],Ws=Math.PI/180,ii=new Map,q=null,si=class si extends b{constructor(t,e){super(t,e);this._onClick=()=>{this.fire()};t instanceof HTMLCanvasElement?this.options.manualStart||this.fire():t.addEventListener("click",this._onClick,{signal:this._events.signal})}static get defaults(){return Do}static fire(t={}){return Wi(Us,document.body,{...si.defaults,...t})}fire(t={}){let e={...this.options,...t};if(this.el instanceof HTMLCanvasElement){let n=this.el;return Wi(()=>n,n.parentElement??document.body,e)}let i=this.el.getBoundingClientRect();return e.origin={x:(i.left+i.width/2)/innerWidth,y:(i.top+i.height/2)/innerHeight},Wi(Us,this.el.parentElement??document.body,e)}destroy(){this.el instanceof HTMLCanvasElement&&Ys(this.el),super.destroy()}};si.key="Expressive_Confetti";var ce=si;function Wi(r,s,t){if(matchMedia("(prefers-reduced-motion: reduce)").matches)return Promise.resolve();let e=r(),i=ii.get(e);if(!i){let d=e.getContext("2d");if(!d)return Promise.resolve();i={ctx:d,pieces:[],frame:0,last:0,done:[],overlay:e===q},ii.set(e,i)}let{width:n,height:o}=Xs(e),a=t.colors.length?t.colors:No(s),l=(t.origin.x??.5)*n,c=(t.origin.y??.5)*o;for(let d=0;d<t.particleCount;d++)i.pieces.push({x:l,y:c,velocity:t.startVelocity*(.5+Math.random()),angle:-t.angle*Ws+(.5-Math.random())*t.spread*Ws,wobble:Math.random()*10,wobbleSpeed:.05+Math.random()*.05,tilt:(.25+Math.random()/2)*Math.PI,tick:0,color:a[d%a.length],shape:t.shapes[Math.floor(Math.random()*t.shapes.length)]??"square",options:t});let h=i;return h.frame||(h.frame=requestAnimationFrame(d=>{h.last=d,js(e,h,d)})),new Promise(d=>h.done.push(d))}function js(r,s,t){let e=Math.min((t-s.last)/16.666666666666668,4);s.last=t;let{width:i,height:n}=Xs(r),{ctx:o}=s,a=r.width/(i||1);o.setTransform(1,0,0,1,0,0),o.clearRect(0,0,r.width,r.height),s.pieces=s.pieces.filter(l=>{let c=l.options;if(l.x+=(Math.cos(l.angle)*l.velocity+c.drift)*e,l.y+=(Math.sin(l.angle)*l.velocity+c.gravity*3)*e,l.velocity*=c.decay**e,l.wobble+=l.wobbleSpeed*e,l.tilt+=.1*e,l.tick+=e,l.tick>=c.ticks)return!1;let h=8*c.scalar;return o.setTransform(a,0,0,a,0,0),o.translate(l.x+10*c.scalar*Math.cos(l.wobble),l.y+10*c.scalar*Math.sin(l.wobble)),o.rotate(l.tilt),o.scale(1,Math.cos(l.wobble)),o.globalAlpha=1-l.tick/c.ticks,o.fillStyle=l.color,o.beginPath(),l.shape==="circle"?o.arc(0,0,h/2,0,2*Math.PI):l.shape==="star"?Fo(o,h*.75):o.rect(-h/2,-h/2,h,h),o.fill(),!0}),s.pieces.length?s.frame=requestAnimationFrame(l=>js(r,s,l)):Ys(r)}function Ys(r){let s=ii.get(r);if(s){cancelAnimationFrame(s.frame),ii.delete(r),s.ctx.setTransform(1,0,0,1,0,0),s.ctx.clearRect(0,0,r.width,r.height),s.overlay&&(r.remove(),q=null);for(let t of s.done)t()}}function Fo(r,s){for(let t=0;t<10;t++){let e=t*Math.PI/5-Math.PI/2,i=t%2?s/2:s;r.lineTo(Math.cos(e)*i,Math.sin(e)*i)}r.closePath()}function Xs(r){let s=r.clientWidth,t=r.clientHeight,e=Math.round(s*devicePixelRatio),i=Math.round(t*devicePixelRatio);return(r.width!==e||r.height!==i)&&(r.width=e,r.height=i),{width:s,height:t}}function Us(){return q?.isConnected||(q=document.createElement("canvas"),q.className="confetti-overlay",q.setAttribute("aria-hidden","true"),Object.assign(q.style,{position:"fixed",inset:"0",width:"100%",height:"100%",margin:"0",padding:"0",border:"0",background:"transparent",pointerEvents:"none",zIndex:"var(--expressive-z-confetti, 10001)"}),document.body.append(q),typeof q.showPopover=="function"&&(q.popover="manual",q.showPopover())),q}function No(r){let s=document.createElement("span");s.hidden=!0,r.append(s);let t=getComputedStyle(s),e=Po.filter(i=>t.getPropertyValue(`--md-sys-color-${i}`).trim()).map(i=>(s.style.color=`var(--md-sys-color-${i})`,getComputedStyle(s).color));return s.remove(),e.length?e:Ro}var Bo={quantity:100,staticity:50,ease:50,size:.4,color:"",vx:0,vy:0},bt=class extends b{constructor(t,e){super(t,e);this._particles=[];this._width=0;this._height=0;this._frame=0;this._last=0;this._mouse={x:0,y:0};this._still=!1;this._visible=!0;this._motion=null;this._theme=null;this._resizeObserver=null;this._visibility=null;this._onMotion=()=>{if(this._still=this._motion.matches,this._still){for(let t of this._particles)t.alpha=t.targetAlpha;this._paint()}this._animate()};this._repaint=()=>{this._still&&this._paint()};this._onPointerMove=t=>{let e=this.el.getBoundingClientRect(),i=t.clientX-e.left-e.width/2,n=t.clientY-e.top-e.height/2;Math.abs(i)<e.width/2&&Math.abs(n)<e.height/2&&(this._mouse={x:i,y:n})};if(this._ctx=this.el.getContext("2d"),!this._ctx)return;this._style=getComputedStyle(this.el),this._motion=matchMedia("(prefers-reduced-motion: reduce)");let{signal:i}=this._events;this._motion.addEventListener("change",this._onMotion,{signal:i}),matchMedia("(prefers-color-scheme: dark)").addEventListener("change",this._repaint,{signal:i}),this._theme=new MutationObserver(this._repaint),this._theme.observe(document.documentElement,{attributes:!0,attributeFilter:["theme"],subtree:!0}),this._still=this._motion.matches,this._reset(),this._resizeObserver=new ResizeObserver(()=>{(this.el.clientWidth!==this._width||this.el.clientHeight!==this._height)&&this._reset()}),this._resizeObserver.observe(this.el),this._visibility=new IntersectionObserver(n=>{this._visible=n[n.length-1].isIntersecting,this._animate()}),this._visibility.observe(this.el)}static get defaults(){return Bo}destroy(){this._stop(),this._theme?.disconnect(),this._resizeObserver?.disconnect(),this._visibility?.disconnect(),this._ctx&&(this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this.el.width,this.el.height)),super.destroy()}_animate(){this._visible&&!this._still?this._start():this._stop()}_start(){this._frame||(window.addEventListener("pointermove",this._onPointerMove,{passive:!0}),this._frame=requestAnimationFrame(t=>{this._last=t,this._draw(t)}))}_stop(){cancelAnimationFrame(this._frame),this._frame=0,window.removeEventListener("pointermove",this._onPointerMove)}_reset(){if(this._width=this.el.clientWidth,this._height=this.el.clientHeight,this.el.width=Math.round(this._width*devicePixelRatio),this.el.height=Math.round(this._height*devicePixelRatio),this._particles=Array.from({length:this.options.quantity},()=>this._particle()),this._still){for(let t of this._particles)t.alpha=t.targetAlpha;this._paint()}}_particle(){return{x:Math.floor(Math.random()*this._width),y:Math.floor(Math.random()*this._height),translateX:0,translateY:0,size:Math.floor(Math.random()*2)+this.options.size,alpha:0,targetAlpha:Math.round((Math.random()*.6+.1)*10)/10,dx:(Math.random()-.5)*.1,dy:(Math.random()-.5)*.1,magnetism:.1+Math.random()*4}}_draw(t){let e=Math.min((t-this._last)/16.666666666666668,4);this._last=t;let{staticity:i,ease:n,vx:o,vy:a}=this.options,l=Math.min(e/n,1);this._particles=this._particles.map(c=>{c.x+=(c.dx+o)*e,c.y+=(c.dy+a)*e,c.translateX+=(this._mouse.x/(i/c.magnetism)-c.translateX)*l,c.translateY+=(this._mouse.y/(i/c.magnetism)-c.translateY)*l;let h=c.x+c.translateX,d=c.y+c.translateY,p=Math.min(h-c.size,this._width-h-c.size,d-c.size,this._height-d-c.size)/20;return c.alpha=p>1?Math.min(c.alpha+.02*e,c.targetAlpha):c.targetAlpha*p,c.x<-c.size||c.x>this._width+c.size||c.y<-c.size||c.y>this._height+c.size?this._particle():c}),this._paint(),this._frame=requestAnimationFrame(c=>this._draw(c))}_paint(){let t=this._ctx,e=devicePixelRatio;t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,this.el.width,this.el.height),t.setTransform(e,0,0,e,0,0),t.fillStyle=this.options.color||this._style.color;for(let i of this._particles)i.alpha<=0||(t.globalAlpha=i.alpha,t.beginPath(),t.arc(i.x+i.translateX,i.y+i.translateY,i.size,0,2*Math.PI),t.fill());t.globalAlpha=1}};bt.key="Expressive_Particles";var $o={onKey:null,i18n:{tooShort:r=>`Use at least ${r} characters.`}},ke=r=>r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement,Ae=new Set,ni=new WeakSet,ri=new WeakMap,Ui=new WeakMap;function qo(r,s){if(!s)return ji(r);r.validity.customError||(r.setCustomValidity(s),Ui.set(r,s))}var ji=r=>{Ui.get(r)===r.validationMessage&&r.setCustomValidity(""),Ui.delete(r)},Gs;function Zs(r){let s=r.target.closest?.("button");if(!s)return null;let t=s.closest(".keypad, .keyboard")?.Expressive_Keypad;if(t)return[t,s];let e=s.dataset.key&&s.closest(".field");if(!e)return null;for(let i of Ae){let n=i.target;if(n&&e.contains(n))return[i,s]}return null}var zo=[["mousedown",r=>{let s=Zs(r);s&&s[0]._root?.activeElement===s[0].target&&r.preventDefault()}],["click",r=>{let s=Zs(r);s&&s[0]._press(s[1])}],["focusin",r=>{ke(r.target)&&ni.add(r.target)}],["input",r=>{ke(r.target)&&ri.get(r.target)?._checkLength(r.target)}],["reset",r=>{for(let s of r.target.elements??[])ke(s)&&ji(s)}],["keydown",r=>Qs(r,!0)],["keyup",r=>Qs(r,!1)]],Ko=["focusin","mousedown","click"];function Qs(r,s){for(let t of Ae)(!s||t.target===r.target)&&t._light(r.key,s)}var Vo=r=>!r.disabled&&(!!r.dataset.key||r.hasAttribute("value")),Wo=(r,s)=>r.dataset.key===s||r.hasAttribute("value")&&r.value.toLowerCase()===s.toLowerCase(),Et=class extends b{constructor(t,e){super(t,e);this._fields=new Set;this._attach=()=>{let t=this.el.getRootNode(),e=t.nodeType===9||t.nodeType===11;if(this._waitForInsertion(!e),!e)return;this._root=t,this._listen("addEventListener");let i=this._root.activeElement;ke(i)&&ni.add(i)};this._root=null,Ae.add(this),this._attach()}_waitForInsertion(t){for(let e of Ko)this.el[t?"addEventListener":"removeEventListener"](e,this._attach)}_listen(t){if(!(!this._root||this._shared()))for(let[e,i]of zo)this._root[t](e,i)}static get defaults(){return $o}destroy(){Ae.delete(this);for(let t of this._fields)ji(t),ri.get(t)===this&&ri.delete(t);this._waitForInsertion(!1),this._listen("removeEventListener"),super.destroy()}get target(){let t=this.el.getAttribute("aria-controls"),e=t?u.getElementById(this.el,t):null;return ke(e)?e:null}_shared(){for(let t of Ae)if(t!==this&&t._root===this._root)return!0;return!1}_press(t){if(!Vo(t))return;let e=this._act(t);this.options.onKey?.(e)}_act(t){let e=t.dataset.key;return e==="Layer"?this._layer(t):e==="Shift"||e==="CapsLock"?this._latch(t,e):this._type(t,e)}_latch(t,e){return t.setAttribute("aria-pressed",String(t.getAttribute("aria-pressed")!=="true")),e}_layer(t){for(let e of this.el.querySelectorAll("[data-layer]"))e.hidden=e.dataset.layer!==t.value;return"Layer"}_type(t,e){let i=e?"":this._case(t.value),n=this._editable;return n&&this._apply(n,e,i),e??i}_case(t){let e=this.el.querySelector('[data-key="Shift"][aria-pressed="true"]');return e?.setAttribute("aria-pressed","false"),e||this.el.querySelector('[data-key="CapsLock"][aria-pressed="true"]')?t.toUpperCase():t}get _editable(){let t=this.target;return t&&!t.matches(":disabled")&&!t.readOnly?t:null}_apply(t,e,i){if(e==="Enter")return this._enter(t);if(e==="Backspace")return this._edit(t,"","deleteContentBackward");i&&this._edit(t,i,"insertText")}_enter(t){t instanceof HTMLInputElement?t.form?.requestSubmit():this._edit(t,`
|
|
9
|
-
`,"insertLineBreak")}_light(t,e){for(let i of this.el.querySelectorAll("button"))Wo(i,t)&&i.classList.toggle("pressed",e)}_checkLength(t){if(t.minLength<1)return;let e=t.value.length>0&&t.value.length<t.minLength;qo(t,e?this.options.i18n.tooShort(t.minLength):"")}_edit(t,e,i){let{value:n}=t,o=t.selectionStart??n.length,a=t.selectionEnd??n.length;if(o===0&&a===0&&!ni.has(t)&&(o=a=n.length),i==="deleteContentBackward"&&o===a&&o){let c=n.slice(Math.max(0,o-64),o);o-=(Gs??(Gs=new Intl.Segmenter)).segment(c).containing(c.length-1).segment.length}if(o===a&&!e||e&&t.maxLength>=0&&n.length-(a-o)+e.length>t.maxLength)return;let l=n.slice(0,o)+e+n.slice(a);if(t.value=l,l&&!t.value){t.value=n;return}t.selectionStart!==null&&t.setSelectionRange(o+e.length,o+e.length),ni.add(t),ri.set(t,this),this._fields.add(t),t.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0,inputType:i,data:e||null}))}};Et.key="Expressive_Keypad";var Uo={onChange:null},oi=r=>Math.min(1,Math.max(0,r));function jo(r,s,t){let e=Math.max(r,s,t),i=e-Math.min(r,s,t);return i?((e===r?(s-t)/i:e===s?(t-r)/i+2:(r-s)/i+4)*60+360)%360:0}function ai(r){let s=/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(r.trim());if(!s)return null;let t=s[1].length===3?[...s[1]].map(a=>a+a).join(""):s[1],[e,i,n]=[0,2,4].map(a=>parseInt(t.slice(a,a+2),16)/255),o=Math.max(e,i,n);return{h:jo(e,i,n),s:o?(o-Math.min(e,i,n))/o:0,v:o}}function He({h:r,s,v:t}){let e=i=>{let n=(i+r/60)%6;return t-t*s*Math.max(0,Math.min(n,4-n,1))};return"#"+[5,3,1].map(i=>Math.round(e(i)*255).toString(16).padStart(2,"0")).join("")}var Yo={ArrowRight:[1,0],ArrowLeft:[-1,0],ArrowUp:[0,1],ArrowDown:[0,-1],PageUp:[0,10],PageDown:[0,-10],Home:[-100,0],End:[100,0]},yt=class extends b{constructor(t,e){super(t,e);this._hsv={h:0,s:0,v:0};this._area=null;this._thumb=null;this._hue=null;this._hex=null;this._writing=!1;this._onNativeInput=()=>{if(this._writing||!this.input)return;let t=ai(this.input.value);t&&(this._hsv=t,this._render())};this._onHex=()=>{let t=ai(this._hex.value);t&&He(t)!==this.input.value&&this._set(t),this._hex.value=He(this._hsv)};this._onPointerDown=t=>{if(t.button||this.input.disabled)return;let e=this._area;t.preventDefault(),this._thumb.focus(),e.setPointerCapture(t.pointerId),this._fromPoint(t,!1);let i=l=>this._fromPoint(l,!1),n=R(e),o=l=>{n.abort(),this._fromPoint(l,!0)},{signal:a}=n;e.addEventListener("pointermove",i,{signal:a}),e.addEventListener("pointerup",o,{signal:a}),e.addEventListener("pointercancel",o,{signal:a})};this._onKeyDown=t=>{let e=Yo[t.key];if(!e||this.input.disabled)return;t.preventDefault();let i=t.shiftKey?.1:.01,{s:n,v:o}=this._hsv;this._set({...this._hsv,s:oi(n+e[0]*i),v:oi(o+e[1]*i)})};this.input=t.querySelector(':scope > input[type="color"]'),this.input&&(this._hsv=ai(this.input.value)??this._hsv,this._build(),this.input.addEventListener("input",this._onNativeInput,{signal:this._events.signal}),this._render())}static get defaults(){return Uo}destroy(){for(let t of[this._area,this._hue,this._hex])t?.remove();this._area=this._thumb=this._hue=this._hex=null,this.el.style.removeProperty("--_color-picker-hue"),super.destroy()}get value(){return this.input?.value??""}set value(t){let e=ai(t);!e||!this.input||(this._hsv=e,this._writing=!0,this.input.value=He(e),this._writing=!1,this._render())}_build(){let t=this.input.disabled,e=document.createElement("div");e.className="color-picker-area";let i=document.createElement("div");i.className="color-picker-thumb",i.setAttribute("role","slider"),i.setAttribute("aria-label","Saturation and brightness"),i.setAttribute("aria-valuemin","0"),i.setAttribute("aria-valuemax","100"),i.tabIndex=t?-1:0,t&&i.setAttribute("aria-disabled","true"),e.append(i);let n=document.createElement("input");n.type="range",n.className="color-picker-hue",n.min="0",n.max="359",n.setAttribute("aria-label","Hue"),n.disabled=t;let o=document.createElement("input");o.type="text",o.className="color-picker-hex",o.setAttribute("aria-label","Hex color"),o.autocomplete="off",o.spellcheck=!1,o.maxLength=7,o.disabled=t,this.input.before(e,n),this.input.after(o),this._area=e,this._thumb=i,this._hue=n,this._hex=o,e.addEventListener("pointerdown",this._onPointerDown),i.addEventListener("keydown",this._onKeyDown),n.addEventListener("input",()=>this._set({...this._hsv,h:Number(n.value)},!1)),n.addEventListener("change",()=>this._commit()),o.addEventListener("change",this._onHex),o.addEventListener("keydown",a=>{a.key==="Enter"&&!u.isComposing(a)&&(a.preventDefault(),this._onHex())})}_render(){let{h:t,s:e,v:i}=this._hsv,n=He(this._hsv),o=this._thumb;this.el.style.setProperty("--_color-picker-hue",String(Math.round(t))),o.style.setProperty("--_color-picker-x",String(e)),o.style.setProperty("--_color-picker-y",String(1-i)),o.style.setProperty("--_color-picker-color",n),o.setAttribute("aria-valuenow",String(Math.round(e*100))),o.setAttribute("aria-valuetext",`Saturation ${Math.round(e*100)}%, brightness ${Math.round(i*100)}%`),this._hue.value=String(Math.round(t)),this._hex.value=n}_set(t,e=!0){let i=this.input;this._hsv=t;let n=He(t),o=i.value!==n;this._writing=!0,i.value=n,o&&i.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this._writing=!1,this._render(),e&&this._commit()}_commit(){this.input&&(this._writing=!0,this.input.dispatchEvent(new Event("change",{bubbles:!0})),this._writing=!1,this.options.onChange?.(this.input.value))}_fromPoint(t,e){let i=this._area.getBoundingClientRect(),n=oi((t.clientX-i.left)/i.width),o=1-oi((t.clientY-i.top)/i.height);this._set({...this._hsv,s:n,v:o},e)}};yt.key="Expressive_ColorPicker";var Xo={shortcut:"k",closeOnRun:!0},Go=typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/.test(navigator.platform),Js=r=>r.normalize("NFD").replace(/\p{Diacritic}/gu,"").toLowerCase(),Tt=class extends b{constructor(t,e){let i=t.dataset.shortcut;super(t,{...i!==void 0?{shortcut:i||null}:{},...e});this._active=null;this._generatedIds=[];this._observer=null;this.open=()=>{this.el.open||this.el.showModal(),this.input?.focus()};this.close=()=>{this.el.open&&this.el.close()};this._handleInput=()=>this._filter();this._handleKeydown=t=>{t.key==="ArrowDown"||t.key==="ArrowUp"?(t.preventDefault(),this._move(t.key==="ArrowDown"?1:-1)):t.key==="Enter"&&!u.isComposing(t)&&this._active&&(t.preventDefault(),this._run(this._active))};this._handleEscape=t=>{t.key!=="Escape"||!this.input.value||u.isComposing(t)||(t.preventDefault(),this.input.value="",this.input.dispatchEvent(new Event("input",{bubbles:!0})))};this._handleListClick=t=>{let e=t.target.closest('[role="option"]');if(!e||!this.list.contains(e)||e.getAttribute("aria-disabled")==="true")return;let i=this._action(e);if(i&&!i.contains(t.target)){i.click();return}this.options.closeOnRun&&this.close()};this._handlePointerMove=t=>{let e=t.target.closest('[role="option"]');e&&this.list.contains(e)&&e.getAttribute("aria-disabled")!=="true"&&this._setActive(e)};this._handleClose=()=>{this.el.open||(this.input.value="",this._filter())};this._handleShortcut=t=>{let{shortcut:e}=this.options;if(!e||t.defaultPrevented||t.altKey||t.shiftKey||!(Go?t.metaKey&&!t.ctrlKey:t.ctrlKey&&!t.metaKey))return;let i=e.toLowerCase(),n=/^[a-z]$/i.test(t.key);(t.key.toLowerCase()===i||!n&&/^[a-z]$/.test(i)&&t.code===`Key${i.toUpperCase()}`)&&(t.preventDefault(),this.el.open?this.close():this.open())};if(this.input=t.querySelector(":scope > input"),this.list=t.querySelector(":scope > :is(ul, ol)"),!this.input||!this.list){console.error("CommandPalette needs an <input> and a <ul> as children of the dialog.");return}this._setupAccessibility(),this._filter(),this._observer=new MutationObserver(()=>this._filter(!0)),this._observer.observe(this.list,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["hidden","disabled"]});let{signal:n}=this._events;this.input.addEventListener("input",this._handleInput,{signal:n}),this.input.addEventListener("keydown",this._handleKeydown,{signal:n}),this.input.addEventListener("keydown",this._handleEscape,{signal:n}),this.list.addEventListener("click",this._handleListClick,{signal:n}),this.list.addEventListener("pointermove",this._handlePointerMove,{signal:n}),this.el.addEventListener("close",this._handleClose,{signal:n}),document.addEventListener("keydown",this._handleShortcut,{signal:n})}static get defaults(){return Xo}get isOpen(){return this.el.open}destroy(){if(this._observer?.disconnect(),this.input&&this.list){for(let e of["role","aria-controls","aria-expanded","aria-autocomplete","aria-activedescendant"])this.input.removeAttribute(e);this.list.removeAttribute("role");for(let e of this._items()){for(let i of["role","aria-selected","aria-disabled","data-filtered"])e.removeAttribute(i);e.classList.remove("active"),this._action(e)?.removeAttribute("tabindex")}for(let e of this._labels())e.removeAttribute("role"),e.removeAttribute("data-filtered");for(let e of this._generatedIds)e.removeAttribute("id");let t=this._empty();t&&(t.hidden=!1)}super.destroy()}_items(){return Array.from(this.list.children).filter(t=>t instanceof HTMLElement&&!t.classList.contains("label"))}_labels(){return Array.from(this.list.querySelectorAll(":scope > .label"))}_empty(){return this.el.querySelector(":scope > .command-palette-empty")}_action(t){return t.querySelector(":scope > :is(a[href], button)")}_ensureId(t,e){return t.id||(t.id=`${e}-${u.guid()}`,this._generatedIds.push(t)),t.id}_setupAccessibility(){this.list.setAttribute("role","listbox"),this.input.setAttribute("role","combobox"),this.input.setAttribute("aria-controls",this._ensureId(this.list,"command-palette-list")),this.input.setAttribute("aria-expanded","true"),this.input.setAttribute("aria-autocomplete","list")}_wireItems(){for(let t of this._items())t.getAttribute("role")!=="option"&&(t.setAttribute("role","option"),this._ensureId(t,"command-palette-option"),this._action(t)?.setAttribute("tabindex","-1"));for(let t of this._labels())t.setAttribute("role","none")}_shown(){return this._items().filter(t=>!t.hidden&&!t.hasAttribute("data-filtered"))}_visible(){return this._shown().filter(t=>t.getAttribute("aria-disabled")!=="true")}_isDisabled(t){let e=this._action(t);return!!e&&(e.matches(":disabled")||e.getAttribute("aria-disabled")==="true")}_setActive(t){this._active!==t&&(this._active?.classList.remove("active"),this._active?.removeAttribute("aria-selected"),this._active=t,t?(t.classList.add("active"),t.setAttribute("aria-selected","true"),this.input.setAttribute("aria-activedescendant",t.id),t.scrollIntoView({block:"nearest"})):this.input.removeAttribute("aria-activedescendant"))}_filter(t=!1){this._wireItems();let e=Js(this.input.value).split(/\s+/).filter(Boolean);for(let o of this._items()){let a=o.dataset.keywords??this._action(o)?.dataset.keywords??"",l=Js(`${o.textContent} ${a}`);o.toggleAttribute("data-filtered",!e.every(c=>l.includes(c))),this._isDisabled(o)?o.setAttribute("aria-disabled","true"):o.removeAttribute("aria-disabled")}for(let o of this._labels()){let a=o.nextElementSibling,l=!1;for(;a&&!a.classList.contains("label");)!a.hidden&&!a.hasAttribute("data-filtered")&&(l=!0),a=a.nextElementSibling;o.toggleAttribute("data-filtered",!l)}let i=this._visible(),n=this._empty();n&&(n.hidden=this._shown().length>0),this._setActive(t&&i.includes(this._active)?this._active:i[0]??null)}_move(t){let e=this._visible();if(!e.length)return;let i=e.indexOf(this._active);this._setActive(e[(i+t+e.length)%e.length])}_run(t){(this._action(t)??t).click()}};Tt.key="Expressive_CommandPalette";var Zo={progressLabel:"Question {current} of {total}",requiredMessage:"Choose an answer to continue.",summaryLabel:"Review your answers",editLabel:"Edit",skippedLabel:"Not answered"},tn=["previous","skip","next"],Qo=["file","password","hidden"],Jo="abcdefghijklmnopqrstuvwxyz",Ie=r=>r instanceof HTMLInputElement&&(r.type==="radio"||r.type==="checkbox");function ta(r){let s=r.closest("label")?.cloneNode(!0);return s?.querySelectorAll("input, small").forEach(t=>t.remove()),s?.textContent.trim()||r.value}function ea(r){return r instanceof HTMLSelectElement?Array.from(r.selectedOptions,s=>s.text).join(", "):Ie(r)?r.checked?ta(r):"":r.value.trim()}var Yi=r=>r instanceof HTMLSelectElement?Array.from(r.selectedOptions,s=>s.value):Ie(r)?r.checked:r.value,ia=r=>Array.isArray(r?.answers)?r:null;function sa(r,s){if(r instanceof HTMLSelectElement)return na(r,s);Ie(r)?r.checked=s===!0:typeof s=="string"&&(r.value=s)}function na(r,s){if(Array.isArray(s))for(let t of r.options)t.selected=s.includes(t.value)}function ra(r,s){let t=JSON.stringify(Yi(r));sa(r,s),JSON.stringify(Yi(r))!==t&&r.dispatchEvent(new Event("change",{bubbles:!0}))}function oa(r){if(la(r.target)||!u.plainKey(r))return-1;let s="123456789".indexOf(r.key);return s>=0?s:ca(r.key)}var aa='textarea, select, [contenteditable], input:not([type="radio"], [type="checkbox"], [type="button"], [type="submit"], [type="reset"])',la=r=>!!r.matches?.(aa),ca=r=>r.length===1?Jo.indexOf(r.toLowerCase()):-1,Lt=class extends b{constructor(t,e){let i=t.dataset.progressLabel;super(t,{...i?{progressLabel:i}:{},...e});this._active=null;this._generated=[];this._generatedIds=[];this._reporting=!1;this._summary=null;this._reviewing=!1;this.goTo=t=>{let e=this.items[t];if(!e)return;this._active=e,this._reviewing=!1,this._render(),this._save();let i=this._controls(e).filter(n=>!n.disabled);(i.find(n=>n.checked)??i[0])?.focus()};this.next=()=>{this._validate(this._active)&&this._advance()};this.previous=()=>this.goTo(this._reviewing?this.items.length-1:this.index-1);this.review=()=>{this._summary&&(this._fillSummary(this._summary),this._reviewing=!0,this._render(),this._summary.focus())};this.skip=()=>{if(this._active){for(let t of this._controls(this._active)){let e=Ie(t);(e?!t.checked:!t.value)||(e?t.checked=!1:t.value="",t.dispatchEvent(new Event("change",{bubbles:!0})))}this._setInvalid(this._active,!1),this._advance()}};this._save=()=>{let t=this._key;if(!t)return;let e={index:this.index,answers:this._allControls().map(Yi)};try{localStorage.setItem(t,JSON.stringify(e))}catch{}};this._forget=()=>{try{this._key&&localStorage.removeItem(this._key)}catch{}};this._handleClick=t=>{let e=t.target.closest?.("button");if(!(!e||!this._buttons().includes(e))){if(tn.includes(e.value)){t.preventDefault(),this[e.value]();return}this._syncRequired()}};this._handleKeydown=t=>{if(t.key!=="Enter")return this._handleShortcut(t);t.defaultPrevented||u.isComposing(t)||!(t.target instanceof HTMLInputElement)||this._end||(t.preventDefault(),this.next())};this._handleInvalid=t=>{let e=this.items.find(i=>i.contains(t.target));e&&(t.preventDefault(),!this._reporting&&(this._reporting=!0,setTimeout(()=>this._reporting=!1),this._active=e,this._reviewing=!1,this._render(),this._validate(e)))};this._handleInput=t=>{this._syncRequired(),this._save();let e=t.target.closest?.("fieldset");e instanceof HTMLFieldSetElement&&e.classList.contains("invalid")&&this._setInvalid(e,!1)};this._progress=document.createElement("div"),this._progress.className="questionnaire-progress",this._progressText=document.createElement("span"),this._progressText.id=`questionnaire-progress-${u.guid()}`,this._progressBar=document.createElement("progress"),this._progressBar.className="progress",this._progressBar.setAttribute("aria-labelledby",this._progressText.id),this._progress.append(this._progressText,this._progressBar),this.el.prepend(this._progress);for(let o of this._fieldsets()){let a=Array.from(o.querySelectorAll(":scope > p:not(.questionnaire-error)")).map(l=>this._ensureId(l,"questionnaire-description"));a.length&&!o.hasAttribute("aria-describedby")&&(o.setAttribute("aria-describedby",a.join(" ")),this._generatedIds.push(o))}this._active=this.items[0]??null,this._summary=this._createSummary(),this._restore(),this._syncRequired(),this._render(),this._observer=new MutationObserver(()=>{this._syncRequired(),this._render()}),this._observer.observe(this.el,{attributes:!0,subtree:!0,attributeFilter:["disabled"]});let{signal:n}=this._events;this.el.addEventListener("click",this._handleClick,{signal:n}),this.el.addEventListener("keydown",this._handleKeydown,{signal:n}),this.el.addEventListener("input",this._handleInput,{signal:n}),this.el.addEventListener("change",this._save,{signal:n}),this.el.addEventListener("submit",this._forget,{signal:n}),this.el.addEventListener("invalid",this._handleInvalid,{capture:!0,signal:n})}static get defaults(){return Zo}get items(){return this._fieldsets().filter(t=>!t.disabled)}get index(){return this.items.indexOf(this._active)}_advance(){this._summary&&this.index===this.items.length-1?this.review():this.goTo(this.index+1)}destroy(){this._observer.disconnect(),this._summary?.remove();for(let t of this._fieldsets()){if(t.hasAttribute("data-required"))for(let e of this._controls(t))e.setCustomValidity("");t.hidden=!1,this._setInvalid(t,!1)}for(let t of this._buttons())t.hidden=!1;this._progress.remove();for(let t of this._generated)t.remove();for(let t of this._generatedIds)t.removeAttribute(t instanceof HTMLFieldSetElement?"aria-describedby":"id");super.destroy()}_fieldsets(){return Array.from(this.el.querySelectorAll(":scope > fieldset"))}_buttons(){return Array.from(this.el.querySelectorAll(":scope > footer > button")).filter(t=>tn.includes(t.value)||t.type==="submit")}_controls(t){return Array.from(t.elements).filter(e=>e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement||e instanceof HTMLInputElement&&e.type!=="button"&&e.type!=="submit")}_required(t){return t.hasAttribute("data-required")||this._controls(t).some(e=>e.required)}_ensureId(t,e){return t.id||(t.id=`${e}-${u.guid()}`,this._generatedIds.push(t)),t.id}_render(){let t=this.items;t.includes(this._active)||(this._active=this._after(t));let e=t.indexOf(this._active);for(let i of this._fieldsets())i.hidden=this._reviewing||i!==this._active;this._summary?.toggleAttribute("hidden",!this._reviewing);for(let i of this._buttons())i.hidden=!this._shows(i,e);this._renderProgress(e,t.length)}_after(t){let e=this._fieldsets();return e.slice(e.indexOf(this._active)+1).find(n=>!n.disabled)??t[t.length-1]??null}get _end(){return this._summary?this._reviewing:this.index===this.items.length-1}_shows(t,e){let i=this._end;return{previous:e>0||this._reviewing,skip:!i&&this._skippable(),next:!i}[t.value]??i}_skippable(){return!!this._active&&!this._required(this._active)}_renderProgress(t,e){this._progressText.textContent=this._reviewing?this.options.summaryLabel:this.options.progressLabel.replace("{current}",String(t+1)).replace("{total}",String(e)),this._progressBar.max=Math.max(e,1),this._progressBar.value=this._reviewing?e:t+1}_createSummary(){if(!this.el.hasAttribute("data-summary"))return null;let t=document.createElement("section");t.className="questionnaire-summary",t.tabIndex=-1,t.setAttribute("aria-label",this.options.summaryLabel),t.hidden=!0,t.addEventListener("click",i=>{let n=i.target.closest("button[data-question]");n&&this.goTo(Number(n.dataset.question))});let e=this.el.querySelector(":scope > footer");return e?e.before(t):this.el.append(t),t}_fillSummary(t){let e=document.createElement("dl");e.append(...this.items.map((i,n)=>{let o=document.createElement("div"),[a,l,c]=[document.createElement("dt"),document.createElement("dd"),document.createElement("dd")];a.id=`questionnaire-summary-${u.guid()}`,a.textContent=i.querySelector(":scope > legend")?.textContent.trim()??"",l.textContent=this._controls(i).map(ea).filter(Boolean).join(", ")||this.options.skippedLabel;let h=document.createElement("button");return Object.assign(h,{type:"button",className:"text",textContent:this.options.editLabel}),h.dataset.question=String(n),h.setAttribute("aria-describedby",a.id),c.append(h),o.append(a,l,c),o})),t.replaceChildren(e)}get _key(){let t=this.el.dataset.save;return t?`questionnaire:${t}`:""}_allControls(){return this._fieldsets().flatMap(t=>this._controls(t)).filter(t=>!Qo.includes(t.type))}_restore(){let t=this._read(),e=this._allControls();t?.answers.length===e.length&&(e.forEach((i,n)=>ra(i,t.answers[n])),this._active=this.items[t.index]??this._active)}_read(){try{return ia(JSON.parse(localStorage.getItem(this._key)??"null"))}catch{return null}}_syncRequired(){for(let t of this._fieldsets()){if(!t.hasAttribute("data-required"))continue;let e=this._controls(t).filter(n=>n instanceof HTMLInputElement&&n.type==="checkbox"),i=e.filter(n=>!n.disabled);for(let n of e)n.setCustomValidity("");if(i.length&&!i.some(n=>n.checked)){let n=t.querySelector(":scope > .questionnaire-error:not([data-generated])");i[0].setCustomValidity(n?.textContent.trim()||this.options.requiredMessage)}}}_invalidControl(t){return this._controls(t).find(e=>e.willValidate&&!e.validity.valid)}_validate(t){this._syncRequired();let e=t&&this._invalidControl(t);if(!e)return!0;let i=t.querySelector(":scope > .questionnaire-error");return i||(i=document.createElement("p"),i.className="questionnaire-error",i.dataset.generated="",i.textContent=e.validationMessage||this.options.requiredMessage,t.append(i),this._generated.push(i)),this._setInvalid(t,!0),e.focus(),!1}_setInvalid(t,e){t.classList.toggle("invalid",e);let i=t.querySelector(":scope > .questionnaire-error"),n=(t.getAttribute("aria-describedby")??"").split(" ").filter(o=>o&&o!==i?.id);e&&i&&n.push(this._ensureId(i,"questionnaire-error")),n.length?t.setAttribute("aria-describedby",n.join(" ")):t.removeAttribute("aria-describedby");for(let o of this._controls(t))e?o.setAttribute("aria-invalid","true"):o.removeAttribute("aria-invalid");!e&&this._generated.includes(i)&&(i.remove(),this._generated.splice(this._generated.indexOf(i),1))}get _shortcuts(){return this.el.hasAttribute("data-shortcuts")&&!!this._active&&!this._reviewing}_handleShortcut(t){if(!this._shortcuts)return;let e=this._controls(this._active).filter(Ie)[oa(t)];!e||e.disabled||(t.preventDefault(),e.click(),e.focus())}};Lt.key="Expressive_Questionnaire";function ha(r){let s=ua(r).map(Me);return s.length===2&&!s.includes(null)?[Math.min(s[0],s[1]),Math.max(s[0],s[1])]:[null,null]}function ua(r){return r?r.dataset.value?.trim().split(/\s+/)??r.textContent.split(/\s*[–—]\s*|\s+(?:-|to)\s+/):[]}var en=(r,s)=>r.base?.[s]??0;function sn(r,s,t,e){return[e(Math.max(r,s),t),100-e(Math.min(r,s),t)]}var W=class extends k{get _type(){return"column-chart"}get _fromZero(){return!0}get _points(){return!1}_arrange(s){let t=this._ranges=s.filter(e=>e.className.split(/\s+/).includes("range"));for(let e of t){let i=this._rows.map(n=>ha(n.cells[e.column]));e.base=i.map(([n])=>n),e.values=e.tops=i.map(([,n])=>n)}super._arrange(s.filter(e=>!t.includes(e)))}_draw(s=this.series){let t=document.createElement("div");t.className="column-chart-columns",t.setAttribute("aria-hidden","true");let e=(o,a=s[0]?.y??this._y)=>Math.min(100,Math.max(0,a(o))),i=this.el.classList.contains("stacked"),n=e(0);return t.style.setProperty("--zero",`${n}%`),this._plot.style.setProperty("--rows",String(this.labels.length)),this.labels.forEach((o,a)=>{let l=document.createElement("div"),c=n;s.forEach(h=>{let d=h.tops[a],p=en(h,a);if(i&&(d===null||p===null))return;let g=document.createElement("span");if(d!==null){g.className=h.className,g.dataset.series=h.color,g.classList.toggle("negative",!h.base&&d<p),g.classList.toggle("floating",this._ranges.includes(h));let[m,E]=sn(p,d,h.y,e);g.style.setProperty("--top",`${m}%`),g.style.setProperty("--bottom",`${E}%`),c=this._start(g,h,a,c,e),this._horizontal&&(g.dataset.text=h.text[a])}l.append(g)}),t.append(l)}),t}_start(s,t,e,i,n){if(!this._before.length)return i;let[o,a]=this._oldInsets(t,e,n)??[i,100-i];return s.style.setProperty("--from-top",`${o}%`),s.style.setProperty("--from-bottom",`${a}%`),this.el.classList.contains("stacked")?o:i}_oldInsets(s,t,e){let i=this._before.find(o=>o.column===s.column),n=i?.tops[t]??null;return n===null?null:sn(en(i,t),n,i.y,e)}};W.key="Expressive_ColumnChart";var wt=class extends W{get _type(){return"bar-chart"}get _horizontal(){return!0}_draw(){let s=super._draw();if(s.className="bar-chart-bars",s.classList.toggle("rtl",getComputedStyle(this.el).direction==="rtl"),!this.el.classList.contains("values"))return s;let t=s.cloneNode(!0);t.classList.replace("bar-chart-bars","bar-chart-values"),t.querySelectorAll("span[data-text]").forEach(i=>{i.textContent=i.dataset.text});let e=document.createElement("div");return e.className="bar-chart-layers",e.append(s,t),e}};wt.key="Expressive_BarChart";var nn=6,j=46,da=1.06,pa=.05,ma=0;function fa(r){let[,s="",t="0"]=/(?:\.(\d+))?(?:e([+-]?\d+))?$/i.exec(r.replace(/[^\d.e+-]/gi,""));return Math.max(0,s.length-Number(t))}function rn(r,s,t){r.sort(([n],[o])=>(n-o)*s);let e=r.map(([n])=>n);t!==void 0&&e.unshift(t);let i=e.length-r.length;r.forEach(([,n],o)=>{let a=e.slice(0,i+o+1).map((l,c)=>`calc(50cqw + ${l} * var(--pie-chart-name-at) + ${(i+o-c)*s} * var(--pie-chart-name-step))`);n.style.setProperty("--pie-chart-name-top",`${s>0?"max":"min"}(${a.join(", ")})`)})}var xt=class extends k{get _type(){return"pie-chart"}get _axis(){return!1}get _points(){return!1}get _circular(){return!0}_read(){super._read();let s=this._small();if(!s)return;let t=this.series[0].values.reduce((n,o,a)=>n+(s[a]?Math.max(0,o):0),0),e=this._written(t,this._rows.filter((n,o)=>s[o]).map(n=>n.cells[1])),i=(n,o)=>[...n.filter((a,l)=>!s[l]),o];this.labels=i(this.labels,this.el.dataset.otherLabel||"Other"),this.series=this.series.map((n,o)=>{let a=i(n.values,o?null:t);return{...n,values:a,tops:a,text:i(n.text,o?"":e)}})}_written(s,t){let e=t.map(o=>o.textContent.trim()),[i,n]=Ri(e[0]);return`${i}${U(this.el,this._precision(e,t)).format(s)}${n}`}_precision(s,t){if(t.some(i=>i.dataset.value))return{notation:"compact",maximumSignificantDigits:3};let e=Math.max(0,...s.map(fa));return e>20?{maximumSignificantDigits:3}:{maximumFractionDigits:e}}_small(){let s=this._number("other"),t=this.series[0]?.values.map(n=>n===null?null:Math.max(0,n));if(!t||!(s>0))return null;let e=t.reduce((n,o)=>n+(o??0),0),i=t.map(n=>n!==null&&n/e*100<s-1e-9);return i.filter(Boolean).length>1?i:null}show(s){if(!this._tooltip||s===this.activeIndex||(super.show(s),this._slices.forEach((n,o)=>n?.classList.toggle("active",o===s)),this._tooltip.hidden))return;let t=this._colors[s];this._tooltip.querySelectorAll("[data-series]").forEach(n=>{t?n.dataset.series=t:delete n.dataset.series});let e=this._share(s),i=this._tooltip.querySelector("span:nth-of-type(2)");e&&i&&(i.textContent+=` (${e})`)}_place(s){let t=(this._turns[s][0]+this._turns[s][1])/2;this._tooltip.style.setProperty("--turn",String(t)),this._tooltip.classList.toggle("end",t<.5)}_share(s){var o;let[t,e]=this._turns[s];if(e<=t)return"";let i=e-t,n=i<.1?1:0;return(o=this._percents??(this._percents=[]))[n]??(o[n]=this._percent(n)),this._percents[n].format(i)}_percent(s){return U(this.el,{style:"percent",maximumFractionDigits:s})}_names(){let s=document.createElement("div");s.className="pie-chart-names";let t=[[],[],[],[]];this._turns.forEach(([e,i],n)=>{if(i<=e)return;let o=(e+i)/2,a=-Math.cos(o*2*Math.PI),l=document.createElement("span");l.dataset.series=this._colors[n],l.style.setProperty("--turn",String(o)),l.classList.toggle("end",o>=.5);let c=document.createElement("span");c.textContent=this.labels[n],l.append(c),s.append(l),t[(o>=.5?2:0)+ +(a>=0)].push([a,l])});for(let e of[0,2])rn(t[e],-1),rn(t[e+1],1,t[e][0]?.[0]);return s}_guides(){this._percents=[];let s=this.series[0].text;return[Ye("pie-chart-legend",this._colors,this.labels.map((t,e)=>[t,s[e],this._share(e)]))]}_indexAt(s){let[t,e]=this._polarAt(s),i=e*100,n=this.el.classList.contains("donut")&&parseFloat(getComputedStyle(this.el).getPropertyValue("--md-comp-pie-chart-hole"))||0;if(i<j*n)return-1;let o=this._turns.findIndex(([a,l])=>a<=t&&t<l);return i>j*(o===this.activeIndex?da:1)?-1:o}_draw(){let s=this.series[0].values.map(m=>Math.max(0,m??0)),t=s.reduce((m,E)=>m+E,0),e=0;this._turns=s.map(m=>[e,e+=t?m/t:0]);let i=this._turns.filter(([m,E])=>E>m),n=0;this._colors=this._turns.map(([m,E])=>{if(E<=m)return;let T=n++;return String(T===i.length-1&&T>0&&T%nn===0?2:T%nn+1)});let o=document.createElement("div");o.className="pie-chart-pie",o.setAttribute("aria-hidden","true");let a=M("svg",{viewBox:"-50 -50 100 100",focusable:"false"}),l=`pie-chart-mask-${++ma}`,c={x:"-50",y:"-50",width:"100",height:"100"},h=M("mask",{id:l,maskUnits:"userSpaceOnUse",...c});h.append(M("rect",{...c,fill:"white"}),M("path",{class:"pie-chart-gaps",stroke:"black",d:i.length>1?i.map(([m])=>`M0,0L${se(m,50)}`).join(""):""}),M("circle",{class:"pie-chart-hole",r:String(j),fill:"black"}));let d=M("g",{mask:`url(#${l})`}),p=`A${j},${j} 0`;this._slices=this._turns.map(([m,E],T)=>{if(E<=m)return null;let C=M("path",{class:"pie-chart-slice","data-series":this._colors[T],d:E-m>=1?`M0,${-j}${p} 1 1 0,${j}${p} 1 1 0,${-j}Z`:`M0,0L${se(m,j)}${p} ${E-m>.5?1:0} 1 ${se(E,j)}Z`});return d.append(C),C}),a.append(h,d),o.append(a,...this._texts());let g=this._total("pie-chart-total");return g&&o.append(g),o}_texts(){let s=[];return this.el.classList.contains("values")&&s.push(this._values()),this.el.classList.contains("labels")&&!this.el.classList.contains("sparkline")&&s.push(this._names()),s}_values(){let s=document.createElement("div");return s.className="pie-chart-values",this._turns.forEach(([t,e],i)=>{if(e-t<pa)return;let n=document.createElement("span");n.dataset.series=this._colors[i],n.style.setProperty("--turn",String((t+e)/2)),n.textContent=this._share(i),s.append(n)}),s}};xt.key="Expressive_PieChart";function _a(r,s){return Math.sign(r)*Math.min(s-1,Math.floor(Math.abs(r)*s))/(s-1)}var Mt=class extends k{get _type(){return"heatmap-chart"}get _axis(){return!1}get _count(){return this.labels.length*this.series.length}update(){let s=this._scroll?.scrollLeft;super.update(),this._scroll&&s&&(this._scroll.scrollLeft=s)}show(s){!this._tooltip||s===this.activeIndex||this._activate(this._cells[s],s)}_activate(s,t){let e=s?this._box(s):null;this._cells[this.activeIndex]?.classList.remove("active"),this.activeIndex=t,this._tooltip.hidden=!e,e&&this._fill(s,t,e)}_box(s){return this._plot.matches(":focus-visible")&&s.scrollIntoView({block:"nearest",inline:"nearest"}),this._measure(s)}_measure(s){let[t,e]=[s.getBoundingClientRect(),this._plot.getBoundingClientRect()];return[t.left-e.left,t.top-e.top,t.width,this._plot.clientWidth]}_follow(s){let t=this._cells[this.activeIndex];if(!t)return;let[e,i]=[s.getBoundingClientRect(),t.getBoundingClientRect()];i.right<=e.left||i.left>=e.right?this.show(-1):this._position(this._measure(t))}_fill(s,t,[e,i,n,o]){s.classList.add("active");let a=this.series.length,[l,c]=[Math.floor(t/a),this.series[t%a]],h=document.createElement("strong");h.textContent=this.labels[l];let[d,p]=[document.createElement("span"),document.createElement("span")];d.textContent=c.name,this._levels[t]===null?d.className="gap":d.style.setProperty("--level",String(this._levels[t])),p.textContent=c.text[l],this._tooltip.replaceChildren(h,d,p),this._position([e,i,n,o])}_position([s,t,e,i]){let n=s+e/2>i/2;this._tooltip.classList.toggle("end",n),this._tooltip.style.left=`${s+(n?0:e)}px`,this._tooltip.style.top=`${t}px`}_keyTarget(s){if(s==="Escape")return this.activeIndex<0?void 0:-1;let[t,e]=[this.series.length,this.labels.length-1],i=Math.max(0,this.activeIndex),[n,o]=[Math.floor(i/t),i%t],[a,l]=this._reversed?["ArrowLeft","ArrowRight"]:["ArrowRight","ArrowLeft"],c={[a]:[n,o+1],[l]:[n,o-1],ArrowDown:[n+1,o],ArrowUp:[n-1,o],Home:[n,0],End:[n,t-1]}[s];if(!c)return;if(this.activeIndex<0)return 0;let h=(d,p)=>Math.min(p,Math.max(0,d));return h(c[0],e)*t+h(c[1],t-1)}_indexAt(s){let[t,e]=[this.series.length,this.labels.length],i=this._cells[0].getBoundingClientRect(),n=this._cells[this._cells.length-1].getBoundingClientRect(),[o,a]=[Math.min(i.left,n.left),Math.max(i.right,n.right)],[l,c]=[s.clientX,s.clientY];if(this._off(l,c,[o,a,i.top,n.bottom]))return-1;let h=(p,g,m)=>Math.min(m-1,Math.floor(p/(g||1)*m)),d=h(l-o,a-o,t);return h(c-i.top,n.bottom-i.top,e)*t+(this._reversed?t-1-d:d)}_off(s,t,[e,i,n,o]){let a=this._scroll.getBoundingClientRect();return s<Math.max(e,a.left)||s>Math.min(i,a.right)||t<n||t>o}_guides(){let s=document.createElement("div");s.className="heatmap-chart-legend",s.setAttribute("aria-hidden","true");let[t,e,i]=["span","span","span"].map(a=>document.createElement(a));[t.textContent,i.textContent]=this._ends,e.className="heatmap-chart-scale",this._reversed&&e.style.setProperty("--heatmap-chart-to","left");let[n,o]=this._endLevels;return e.style.setProperty("--low",String(n)),e.style.setProperty("--high",String(o)),e.classList.toggle("diverging",n<0&&o>0),e.style.setProperty("--mid",`${-n/(o-n||1)*100}%`),e.append(...this._bands().filter(a=>a>=n&&a<=o).map(a=>{let l=document.createElement("span");return l.style.setProperty("--level",String(a)),l})),s.append(t,e,i),[s]}_bands(){let s=this._steps;return s?Array.from({length:2*s-1},(t,e)=>(e-s+1)/(s-1)):[]}get _steps(){let s=Math.round(this._number("steps")??0);return s>1?s:0}_shade(s,t){let e=(h,d)=>this._number(h)??this.options[h]??d,[i,n,o]=[e("min",s),e("max",t),this._number("mid")],a=(h,d)=>Math.min(1,Math.max(d,h)),l=o===null?h=>a((h-i)/(n-i||1),0):h=>a((Math.min(n,Math.max(i,h))-o)/(Math.max(n-o,o-i)||1),-1),c=this._steps;return c?h=>_a(l(h),c):l}_draw(){let s=this.series.length,[t,e]=[1/0,-1/0];this._ends=["",""],this.series.forEach(m=>m.values.forEach((E,T)=>{E!==null&&(E<t&&([t,this._ends[0]]=[E,m.text[T]]),E>e&&([e,this._ends[1]]=[E,m.text[T]]))}));let i=this._shade(t,e);this._endLevels=[i(t),i(e)];let n=document.createElement("div");n.className="heatmap-chart-grid",n.setAttribute("aria-hidden","true"),n.style.setProperty("--columns",String(s)),n.style.setProperty("--rows",String(this.labels.length));let o=(m,E="")=>{let T=document.createElement("span");return T.className=m,T.textContent=E,T},a=m=>m?.dataset.label??m?.textContent.trim()??"",l=this.el.classList.contains("values");this._cells=[],this._levels=[];let[c,h]=[document.createElement("div"),document.createElement("div")];c.className="heatmap-chart-rows",h.className="heatmap-chart-cells",this.labels.forEach((m,E)=>{c.append(o("heatmap-chart-row",a(this._rows[E].cells[0]))),this.series.forEach(T=>{let C=T.values[E],_=C===null?null:i(C),L=o("heatmap-chart-cell",l?T.text[E]:"");_===null?L.classList.add("gap"):L.style.setProperty("--level",String(_)),this._cells.push(L),this._levels.push(_),h.append(L)})});let d=this._header.slice(1,s+1).map(a),p=[];d.forEach((m,E)=>{if(!m)return;let T=E+1;for(;T<s&&!d[T];)T++;let C=o("heatmap-chart-column",m);C.classList.toggle("run",T>E+1),C.style.gridArea=`${this.labels.length+1} / ${E+1} / auto / ${T+1}`,h.append(C),p.push(C)}),this._observeLabels(h,p.some(m=>m.classList.contains("run"))?[]:p);let g=this._scroll=document.createElement("div");return g.className="heatmap-chart-scroll",g.tabIndex=-1,g.addEventListener("focus",()=>this._plot.focus()),g.addEventListener("scroll",()=>this._follow(g),{passive:!0}),g.append(h),n.append(c,g),n}};Mt.key="Expressive_HeatmapChart";var on=4;function ga(r){let s=[[]];return r.forEach((t,e)=>t===null?s.push([]):s[s.length-1].push(e)),s.length>1&&(s[0]=[...s.pop(),...s[0]]),s.filter(t=>t.length)}var an=r=>`M${r.join("L")}Z`,va=r=>`M${r.join("L")}${r.length>1?"":"h0"}`,ba=r=>`M0,0L${r.join("L")}Z`,Ct=class extends k{get _type(){return"radar-chart"}get _fromZero(){return!0}get _circular(){return!0}_place(s){for(let e of this._cursor.children)e.style.top=`${Math.min(100,Math.max(0,parseFloat(e.style.top)))}%`;let t=this._turn(s);this._cursor.style.setProperty("--turn",String(t)),this._tooltip.style.setProperty("--turn",String(t)),this._tooltip.classList.toggle("end",t>0&&t<.5)}_turn(s){return s/this.labels.length}_guides(){return this._legend()}_indexAt(s){let[t]=this._polarAt(s);return Math.round(t*this.labels.length)%this.labels.length}_rings(s){return this._axis?this.series[0].scale.ticks.filter(t=>t>0).map(s):Array.from({length:on},(t,e)=>(e+1)/on)}_series(s,t){let e=M("g",{class:`radar-chart-series ${s.className}`.trim(),"data-series":s.color}),i=ga(s.values).map(l=>l.map(t)),[n,o]=s.values.includes(null)?[va,ba]:[an,an];e.append(M("path",{class:"radar-chart-shape",d:i.map(n).join("")}));let a=this.el.classList;return a.contains("area")&&e.append(M("path",{class:"radar-chart-area",d:i.map(o).join("")})),a.contains("points")&&e.append(M("path",{class:"radar-chart-points",d:i.flat().map(l=>`M${l}h0`).join("")})),e}_draw(){let s=(l,c)=>se(this._turn(l),50*c),t=l=>Math.min(1,Math.max(0,1-this._y(l)/100)),e=this.labels.map((l,c)=>c),i=l=>`M${e.map(c=>s(c,l)).join("L")}Z`,n=M("svg",{viewBox:"-50 -50 100 100","aria-hidden":"true",focusable:"false"});n.append(M("path",{class:"radar-chart-grid",d:this._rings(t).map(i).join("")+e.map(l=>`M0,0L${s(l,1)}`).join("")})),this.series.forEach(l=>n.append(this._series(l,c=>s(c,t(l.values[c])))));let o=document.createElement("ol");o.className="radar-chart-axes",o.setAttribute("aria-hidden","true"),this.labels.forEach((l,c)=>{let h=document.createElement("li");h.textContent=l,h.style.setProperty("--turn",String(this._turn(c))),o.append(h)});let a=document.createElement("div");return a.className="radar-chart-web",a.append(n,o),a}};Ct.key="Expressive_RadarChart";var ln=46,Ea=.8,St=class extends k{get _type(){return"radial-chart"}get _axis(){return!1}get _points(){return!1}get _circular(){return!0}get _gauge(){return this.el.classList.contains("gauge")}get _labeled(){let s=this.el.classList;return s.contains("labels")&&!s.contains("sparkline")}get _span(){return this._gauge?.5:this._labeled?.75:1}get _segments(){let s=Math.round(this._number("segments")??0);return s>1?s:0}_lit(s){let t=this._segments;return t?Math.round(s*t)/t:s}_dash(s,t,e){let[i,n,o]=[e?this._width:0,this._segments,this._span*t];if(!n)return`${Math.max(.001,s*o-i).toFixed(3)} ${t.toFixed(3)}`;let a=o/n,l=Math.max(.001,a-this._gap-i);return`${Array.from({length:Math.round(s*n)},()=>`${l.toFixed(3)} ${(a-l).toFixed(3)}`).join(" ").replace(/ [\d.]+$/,"")||0} ${t.toFixed(3)}`}get _step(){return this._radii.length>1?this._radii[0]-this._radii[1]:this._width}show(s){if(!this._tooltip||s===this.activeIndex||(super.show(s),this._rings.forEach((e,i)=>e.classList.toggle("active",i===s)),this._sweeps.forEach((e,i)=>e?.classList.toggle("active",i===s)),this._tooltip.hidden))return;let t=ne(s);this._tooltip.querySelectorAll("[data-series]").forEach(e=>{e.dataset.series=t})}_place(s){let t=this._turn(this._fractions[s]),e=this._radii[s],[i,n]=[e*Math.sin(t*2*Math.PI),-e*Math.cos(t*2*Math.PI)];this._tooltip.style.left=`${50+i}%`,this._tooltip.style.top=`${(50+n)/(this._gauge?50:100)*100}%`,this._tooltip.classList.toggle("end",i>0)}_turn(s){return s*this._span-(this._gauge?.25:0)}_guides(){if(this.labels.length<2)return[];let s=this.series[0].text,t=this.labels.map((e,i)=>ne(i));return[Ye("radial-chart-legend",t,this.labels.map((e,i)=>[e,s[i]]))]}_indexAt(s){let t=this._plot.getBoundingClientRect(),[e,i]=[s.clientX-t.left-t.width/2,s.clientY-t.top-t.width/2];if(this._gauge&&i>0)return this._nameAt(s);let n=this._distance(e,i,t.width);return this._radii.findIndex(o=>Math.abs(n-o)<=this._step/2)}_distance(s,t,e){return this._span===.75&&s<0&&t<0?-t/e*100:Math.hypot(s,t)/e*100}_nameAt(s){let t=s.target.closest(".radial-chart-names > span");return t?[...t.parentElement.children].indexOf(t):-1}get _frame(){return this._gauge?["rotate(180)","-50 -50 100 50"]:["rotate(-90)","-50 -50 100 100"]}_sweep(s,t,e){let i=this._fractions[t];if(!i||!this.el.classList.contains("gradient"))return null;let[n,o]=this._frame,a=this._width.toFixed(3),l=this._dash(i,e,!0),c=`<svg xmlns='http://www.w3.org/2000/svg' viewBox='${o}'><circle r='${s.toFixed(3)}' stroke-width='${a}' transform='${n}' stroke-dasharray='${l}' stroke-dashoffset='${(-this._width/2).toFixed(3)}' stroke-linecap='round' fill='none' stroke='black'/></svg>`,h=document.createElement("div");return h.className="radial-chart-sweep",h.dataset.series=ne(t),h.style.setProperty("--radial-chart-shape",`url("data:image/svg+xml,${encodeURIComponent(c)}")`),h.style.setProperty("--radial-chart-from",`${this._turn(0)}turn`),h.style.setProperty("--radial-chart-to",`${i*this._span}turn`),h}_names(){if(!this._labeled)return[];let s=this._radii.length,t=document.createElement("div");return t.className="radial-chart-names",t.style.setProperty("--radial-chart-step",this._step.toFixed(3)),this._plot.style.setProperty("--radial-chart-rows",String(s)),t.append(...this._radii.map((e,i)=>{let n=document.createElement("span");return n.style.setProperty("--radial-chart-at",`${(50-e).toFixed(3)}%`),n.style.setProperty("--radial-chart-row",String(s-1-i)),n.textContent=this.labels[i],n})),[t]}_draw(){let s=getComputedStyle(this.el),t=(m,E)=>{let T=parseFloat(s.getPropertyValue(`--md-comp-radial-chart-${m}`));return Number.isFinite(T)?T:E},e=this.labels.length,[i,n]=[Math.max(0,t("thickness",8)),Math.max(0,t("gap",2))],o=Math.min(1,ln*Ea/(e*i+(e-1)*n||1));[i,n]=[i*o,n*o],[this._width,this._gap]=[i,n],this._radii=this.labels.map((m,E)=>ln-i/2-E*(i+n));let a=[parseFloat(this.el.dataset.max??""),this.options.max??NaN,100].find(m=>m>0);this._fractions=this.series[0].values.map(m=>this._lit(Math.min(1,Math.max(0,(m??0)/a))));let[l,c]=this._frame,h=M("svg",{viewBox:c,focusable:"false"}),d=this._span;this._sweeps=[],this._rings=this._radii.map((m,E)=>{let T=2*Math.PI*m,C=(L,S,P)=>{let N=M("circle",{class:L,r:m.toFixed(3),transform:l,"stroke-width":i.toFixed(3)});return N.style.setProperty("--radial-chart-dash",this._dash(S,T,P)),P&&(N.style.setProperty("--radial-chart-offset",(-i/2).toFixed(3)),N.classList.add("capped")),N},_=C("radial-chart-ring",this._fractions[E],!0);return _.dataset.series=ne(E),this._fractions[E]||_.classList.add("empty"),h.append(C("radial-chart-track",1,d<1||!!this._segments),_),this._sweeps.push(this._sweep(m,E,T)),_});let p=document.createElement("div");p.className="radial-chart-rings",p.setAttribute("aria-hidden","true"),p.style.setProperty("--radial-chart-middle",`${(this._radii[e-1]-this._width/2)*2}%`),p.append(h,...this._sweeps.filter(m=>m!==null),...this._names());let g=this._total("radial-chart-total");return g&&p.append(g),p}};St.key="Expressive_RadialChart";function ya(r,s,t){let e=Xe(s-r,t);for(;Math.floor(r/e)*e+t*e<s;)e=Xe(e*t*1.001,t);return[Math.floor(r/e)*e,e]}var kt=(r,s)=>r.className.split(/\s+/).includes(s),At=class extends W{get _type(){return"mixed-chart"}get _points(){return!0}_stack(s){let t=s.filter(e=>kt(e,"column"));super._stack(t.filter(e=>!kt(e,"end"))),super._stack(t.filter(e=>kt(e,"end")))}_scale(s,t,e){let i=s.filter(c=>kt(c,"end")),n=s.filter(c=>!i.includes(c)),o=c=>c.some(h=>kt(h,"column")),a=[this._number("endMin"),this._number("endMax")],l=super._scale(n,t,e,o(n));return super._scale(i,...a,o(i)),[t,e,...a].every(c=>c===null)&&this._align(n,i),l}_align(s,t){let e=s.length?s[0].scale.ticks.length-1:0;if(e<1||!t.length)return;let[i,n]=ya(t[0].scale.min,t[0].scale.max,e),o=i+e*n;this._apply(t,{min:i,max:o,ticks:Di(i,o,n)})}_draw(){let s=document.createElement("div");s.className="mixed-chart-marks";let t=super._draw(this.series.filter(e=>kt(e,"column")));return t.className="mixed-chart-columns",s.append(t,k.prototype._draw.call(this,this.series.filter(e=>!kt(e,"column")))),s}};At.key="Expressive_MixedChart";var cn=r=>r.map(({x:s,y:t})=>`M${s},${t}h0`).join(""),Xi=({row:r,series:s})=>`${r} ${s.column}`,li=r=>Object.assign(document.createElement("span"),{textContent:r}),Ta=r=>parseFloat(r)*(r.trim().endsWith("ms")?1:1e3);function La(r,s,t,e){r.style.setProperty("--scatter-chart-size",`${s}`),!(!e||!t||t.size===s)&&r.animate({"--scatter-chart-size":[`${t.size}`,`${s}`]},{duration:Ta(e.dur),easing:`cubic-bezier(${e.keySplines})`})}var Ht=class extends k{get _type(){return"scatter-chart"}get _seriesFrom(){return 2}get _seriesTo(){return this._bubble?-1:void 0}get _bubble(){return this.el.classList.contains("bubble")}static get defaults(){return{...k.defaults,xMin:null,xMax:null}}_arrange(s){let t=this._xs=this._rows.map(i=>lt(i.cells[1])),e=this._sizes=this._rows.map(i=>this._size(i));for(let i of s)i.values=i.tops=i.values.map((n,o)=>t[o]===null||e[o]===null?null:n)}_size(s){if(!this._bubble)return 1;let t=lt(s.cells[this._header.length-1])??0;return t>0?t:null}get _count(){return this._marks?.length??0}show(s){if(!this._tooltip||s===this.activeIndex)return;this.activeIndex=s;let t=this._marks[s];this._cursor.hidden=this._tooltip.hidden=!t,t&&this._fill(t)}_fill({row:s,series:t,x:e,y:i,size:n}){this._cursor.dataset.series=t.color,this._cursor.style.setProperty("--scatter-chart-size",`${n}`);for(let c of[this._cursor,this._tooltip])Object.assign(c.style,{left:`${e}%`,top:`${i}%`});this._tooltip.classList.toggle("end",e>50);let[o,a]=[document.createElement("strong"),li(t.name)];o.textContent=this.labels[s],a.dataset.series=t.color;let l=this._bubble?this._cellText(s,this._header.length-1):[];this._tooltip.replaceChildren(o,...this._cellText(s,1),a,li(t.text[s]),...l)}_cellText(s,t){let e=li(this._header[t].textContent.trim());return e.className="x",[e,li(this._rows[s].cells[t]?.textContent.trim()??"")]}_indexAt(s){let[t,e]=[this._plot,this._plot.getBoundingClientRect()],i=({x:n,y:o})=>Math.hypot(e.left+t.clientLeft+n/100*t.clientWidth-s.clientX,e.top+t.clientTop+o/100*t.clientHeight-s.clientY);return this._marks.reduce((n,o,a)=>n<0||i(o)<i(this._marks[n])?a:n,-1)}_keyTarget(s){if(s==="Escape")return this.activeIndex<0?void 0:-1;let t=this._marks.length-1,e={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1}[s];return e?Math.min(t,Math.max(0,this.activeIndex+e)):{Home:0,End:t}[s]}_read(){[this._drawn,this._marks]=[this._marks??[],[]],super._read(),this.series.length&&(this._xFit=this._xScale(),this._xAffix=Fi(this._rows.map(s=>s.cells[1])))}_xScale(){let[s,t]=this._xRange(),[e,i]=[this._xEnd("xMin"),this._xEnd("xMax")];return this._fit(e??s,i??t,[e!==null,i!==null])}_xRange(){let s=this._xs.filter((n,o)=>this._hasPoint(o));if(!s.length)return[-1,1];let[t,e]=[s.reduce((n,o)=>Math.min(n,o)),s.reduce((n,o)=>Math.max(n,o))],i=(e-t)*.1||1;return[t-i,e+i]}_xEnd(s){return this._number(s)??this.options[s]??null}_xAt(s){let{min:t,max:e}=this._xFit,i=(s-t)/(e-t||1)*100;return this._reversed?100-i:i}_hasPoint(s){return this.series.some(t=>t.values[s]!==null)}_layout(){let s=this._sizes.reduce((t,e,i)=>this._hasPoint(i)?Math.max(t,e):t,0);return this.labels.flatMap((t,e)=>this.series.filter(i=>i.values[e]!==null).map(i=>({row:e,series:i,x:this._xAt(this._xs[e]),y:i.y(i.values[e]),size:Math.sqrt(this._sizes[e]/s)})))}_draw(){this._marks=this._layout();let s=M("svg",{viewBox:"0 0 100 100",preserveAspectRatio:"none","aria-hidden":"true",focusable:"false"}),t=this._before.length?we(this.el):null,e=new Map(this._drawn.map(i=>[Xi(i),i]));return s.append(...this.series.map(i=>this._group(i,t,e))),s}_group(s,t,e){let i=M("g",{class:`scatter-chart-series ${s.className}`.trim(),"data-series":s.color}),n=this._marks.filter(a=>a.series===s),o=this._bubble?n.sort((a,l)=>l.size-a.size).map(a=>[a]):[n];return i.append(...o.map(a=>this._pointPath(a,t,e))),i}_pointPath(s,t,e){let i=M("path",{class:"scatter-chart-points",d:cn(s)});return t&&xe(i,cn(s.map(n=>e.get(Xi(n))??n)),t),this._bubble&&La(i,s[0].size,e.get(Xi(s[0])),t),i}_axes(){return this._axis?[...super._axes(),this._xAxis()]:[]}_xAxis(){let s=document.createElement("ol");s.className="scatter-chart-axis x",s.setAttribute("aria-hidden","true");let t=U(this.el,{notation:"compact",maximumSignificantDigits:3});for(let e of this._xFit.ticks){let i=document.createElement("li"),n=document.createElement("span");n.textContent=Pi(t,e,this._xAffix),i.style.setProperty("--at",`${this._xAt(e)}%`),i.append(n),s.append(i)}return s}_guides(){return this._legend()}};Ht.key="Expressive_ScatterChart";function hn(r){let s=r.reduce((t,e)=>Math.max(t,e??0),0);return r.map(t=>t>0?t/s*100:null)}function wa(r,s){let t=document.createElement("span");return t.dataset.series="1",t.style.setProperty("--width",String(r)),s!=null&&t.style.setProperty("--from-width",String(s)),t}var It=class extends k{get _type(){return"funnel-chart"}get _horizontal(){return!0}get _axis(){return!1}get _points(){return!1}_read(){super._read();for(let s of this.series)s.color="1"}show(s){!this._tooltip||s===this.activeIndex||(super.show(s),this._addShare(s))}_addShare(s){let t=this._share(s),e=this._tooltip.querySelector("span:nth-of-type(2)");t&&e&&(e.textContent+=` (${t})`)}_share(s){let t=this.series[0].values,[e,i]=[t[0],t[s]];if(!(e>0&&i>0))return"";let n=i/e;return U(this.el,{style:"percent",maximumFractionDigits:n<.1?1:0}).format(n)}_legend(){return[]}_draw(){let s=document.createElement("div");s.className="funnel-chart-stages",s.setAttribute("aria-hidden","true"),this._plot.style.setProperty("--rows",String(this.labels.length));let t=hn(this._before[0]?.values??[]);return hn(this.series[0].values).forEach((e,i)=>{let n=document.createElement("div");e!==null&&n.append(wa(e,t[i])),s.append(n)}),s}};It.key="Expressive_FunnelChart";var Oe=2,xa=4,Ma=6,he=r=>Object.assign(document.createElement("span"),{textContent:r}),Gi=(r,s)=>r.cells[s]?.textContent.trim()??"",un=r=>r.reduce((s,t)=>s+t.value,0);function Ca(r,s){let[t,e,i]=[Gi(r,0),Gi(r,1),Number(lt(r.cells[2]))];return t&&e&&i>0?{row:s,source:t,target:e,value:i}:null}function dn(r,s,t,e=new Set){return s===t?!0:(e.add(s),r.some(i=>i.source===s&&!e.has(i.target)&&dn(r,i.target,t,e)))}function Sa(r){let s=[];return r.forEach((t,e)=>{let i=Ca(t,e);i&&!dn(s,i.target,i.source)&&s.push(i)}),s}function pn(r,s,t){if(!t.has(r)){let e=s.filter(i=>i.target===r).map(i=>pn(i.source,s,t)+1);t.set(r,Math.max(0,...e))}return t.get(r)}function ka(r){let s=new Map;return[...new Set(r.flatMap(t=>[t.source,t.target]))].map((t,e)=>({name:t,color:String(e%Ma+1),column:pn(t,r,s),size:Math.max(un(r.filter(i=>i.target===t)),un(r.filter(i=>i.source===t))),x:0,top:0,height:0}))}function Aa(r){let s=Math.max(...r.map(a=>a.column))+1,t=Array.from({length:s},(a,l)=>r.filter(c=>c.column===l)),e=Math.min(xa,50/Math.max(...t.map(a=>a.length))),i=a=>100-(a.length-1)*e,n=a=>a.reduce((l,c)=>l+c.size,0),o=Math.min(...t.map(a=>i(a)/n(a)));return t.forEach((a,l)=>{let c=(i(a)-n(a)*o)/2;for(let h of a)Object.assign(h,{x:l/(s-1)*(100-Oe),top:c,height:h.size*o}),c+=h.height+e}),o}function Ha(r,s,t){let e=new Map(s.map(a=>[a.name,a])),[i,n]=[new Map,new Map],o=(a,l,c)=>{let h=l.top+(a.get(l)??0);return a.set(l,h-l.top+c),h};return r.map(a=>{let[l,c,h]=[e.get(a.source),e.get(a.target),a.value*t];return{flow:a,source:l,target:c,from:o(i,l,h),to:o(n,c,h),size:h}})}var Ot=class extends k{get _type(){return"sankey-chart"}get _seriesFrom(){return 2}get _seriesTo(){return 3}get _axis(){return!1}get _count(){return this._links?.length??0}show(s){if(!this._tooltip||s===this.activeIndex)return;this.activeIndex=s;let t=this._links[s];this._paths.forEach((e,i)=>e.classList.toggle("active",i===s)),this._tooltip.hidden=!t,t&&this._fill(t)}_fill({flow:s,source:t,target:e,from:i,to:n,size:o}){let a=this._across((t.x+Oe+e.x)/2);Object.assign(this._tooltip.style,{left:`${a}%`,top:`${(i+n+o)/2}%`}),this._tooltip.classList.toggle("end",a>50);let l=this._header.map(p=>p.textContent.trim()),[c,h,d]=[he(l[0]),he(l[1]),he(l[2])];c.dataset.series=t.color,h.dataset.series=e.color,d.className="value",this._tooltip.replaceChildren(c,he(t.name),h,he(e.name),d,he(Gi(this._rows[s.row],2)))}_indexAt(s){let e=this.el.getRootNode().elementsFromPoint(s.clientX,s.clientY).find(i=>this._paths.includes(i));return this._paths.indexOf(e)}_keyTarget(s){if(s==="Escape")return this.activeIndex<0?void 0:-1;let t=this._links.length-1,e={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1}[s];return e?Math.min(t,Math.max(0,this.activeIndex+e)):{Home:0,End:t}[s]}_read(){super._read();let s=Sa(this._rows);if(!s.length){[this.series,this._nodes,this._links]=[[],[],[]];return}this._nodes=ka(s),this._links=Ha(s,this._nodes,Aa(this._nodes))}_across(s){return this._reversed?100-s:s}_nodePath({x:s,top:t,height:e}){let[i,n]=[this._across(s),this._across(s+Oe)];return`M${i},${t}H${n}V${t+e}H${i}Z`}_linkPath({source:s,target:t,from:e,to:i,size:n}){let[o,a]=[s.x+Oe,t.x],[l,c,h]=[this._across(o),this._across((o+a)/2),this._across(a)];return`M${l},${e}C${c},${e} ${c},${i} ${h},${i}V${i+n}C${c},${i+n} ${c},${e+n} ${l},${e+n}Z`}_draw(){let s=M("svg",{viewBox:"0 0 100 100",preserveAspectRatio:"none","aria-hidden":"true",focusable:"false"}),[t,e]=[this._shapes??new Map,this._before.length?we(this.el):null];this._shapes=new Map;let i=(o,a,l,c)=>{let h=M("path",{class:o,"data-series":l,d:c});return e&&t.has(a)&&xe(h,t.get(a),e),this._shapes.set(a,c),h};this._paths=this._links.map(o=>i("sankey-chart-link",JSON.stringify([o.source.name,o.target.name]),o.source.color,this._linkPath(o)));let n=this._nodes.map(o=>i("sankey-chart-node",JSON.stringify(o.name),o.color,this._nodePath(o)));return s.append(...this._paths,...n),s}_axes(){let s=document.createElement("div");s.className="sankey-chart-names",s.setAttribute("aria-hidden","true");let t=Math.max(...this._nodes.map(e=>e.column));return s.append(...this._nodes.map(e=>this._name(e,e.column===t))),[s]}_name({name:s,x:t,top:e,height:i},n){let o=document.createElement("span");return o.className=n?"sankey-chart-name end":"sankey-chart-name",o.textContent=s,o.style.setProperty("--sankey-chart-x",`${n?t:t+Oe}%`),o.style.setProperty("--sankey-chart-y",`${e+i/2}%`),o}_guides(){return[]}};Ot.key="Expressive_SankeyChart";var Ia=6,Oa=["ArrowRight","ArrowDown"],Da=["ArrowLeft","ArrowUp"],ci=r=>r.reduce((s,t)=>s+t,0),Zi=([r,s,t,e])=>[s,r,e,t];function mn(r,s){let[t,e]=[ci(r)**2,s**2];return Math.max(...r.map(i=>Math.max(e*i/t,t/(e*i))))}function Qi(r,s){if(s[2]<s[3]){let[c,h]=Qi(r,Zi(s));return[c.map(Zi),Zi(h)]}let[t,e,i,n]=s,o=ci(r)/n,a=e;return[r.map(c=>{let h=[t,a,o,c/o];return a+=c/o,h}),[t+o,e,i-o,n]]}function Pa(r,s){let t=[],e=[];for(let i of r){let n=Math.min(s[2],s[3]);if(e.length&&mn([...e,i],n)>mn(e,n)){let[o,a]=Qi(e,s);t.push(...o),[s,e]=[a,[]]}e.push(i)}return[...t,...Qi(e,s)[0]]}var Ra=([r,s,t,e],i,n)=>i>=r&&i<r+t&&n>=s&&n<s+e,Fa=(r,s)=>r+s/2>.5?{top:"auto",bottom:`${(1-r-s)*100}%`}:{top:`${r*100}%`,bottom:"auto"},Dt=class extends k{get _type(){return"treemap-chart"}get _axis(){return!1}get _points(){return!1}show(s){let t=this._drawnFrom(s);!this._tooltip||t===this.activeIndex||(this._boxes.forEach((e,i)=>e?.classList.toggle("active",i===t)),super.show(t),this._share(t))}_drawnFrom(s){return s<0?s:this._boxes.findIndex((t,e)=>e>=s&&t)}_share(s){if(s<0)return;let t=this._values[s]/ci(this._values),e=U(this.el,{style:"percent",maximumFractionDigits:t<.1?1:0});this._tooltip.querySelector("span:nth-of-type(2)").textContent+=` (${e.format(t)})`}_place(s){let[t,e,i,n]=this._places[s],o=t+i/2,a=this._reversed?1-o:o;Object.assign(this._tooltip.style,{left:`${a*100}%`,...Fa(e,n)}),this._tooltip.classList.toggle("end",a>.5)}_indexAt(s){let t=this._plot.getBoundingClientRect(),e=(s.clientX-t.left)/t.width,[i,n]=[this._reversed?1-e:e,(s.clientY-t.top)/t.height];return this._places.findIndex(o=>o&&Ra(o,i,n))}_keyTarget(s){let t=this._boxes.flatMap((o,a)=>o?[a]:[]),[e,i]=[t.indexOf(this.activeIndex),t.length-1],n=Oa.includes(s)?Math.min(e+1,i):Da.includes(s)?Math.max(e-1,0):{Home:0,End:i}[s];return n===void 0?super._keyTarget(s):t[n]}destroy(){this._sizes?.disconnect(),super.destroy()}_guides(){return[]}_draw(){this._values=this.series[0].values.map(e=>Math.max(0,e??0));let s=document.createElement("div");s.className="treemap-chart-boxes",s.setAttribute("aria-hidden","true");let t=0;return this._boxes=this._values.map((e,i)=>{if(!e)return null;let n=document.createElement("div");n.className="treemap-chart-box",n.dataset.series=String(t++%Ia+1);let[o,a]=[document.createElement("span"),document.createElement("span")];return[o.textContent,a.textContent]=[this.labels[i],this.series[0].text[i]],n.append(o,a),s.append(n),n}),this.el.append(this._plot),this._layout(),this._sizes?.disconnect(),this._sizes=new ResizeObserver(()=>this._layout()),this._sizes.observe(this._plot),s}_layout(){let[s,t]=[this._plot.clientWidth||1,this._plot.clientHeight||1],e=this._values.map((o,a)=>a).filter(o=>this._values[o]).sort((o,a)=>this._values[a]-this._values[o]),i=s*t/ci(this._values),n=Pa(e.map(o=>this._values[o]*i),[0,0,s,t]);this._places=[],e.forEach((o,a)=>{let[l,c,h,d]=n[a],p=this._places[o]=[l/s,c/t,h/s,d/t];Object.assign(this._boxes[o].style,{insetInlineStart:`${p[0]*100}%`,top:`${p[1]*100}%`,width:`${p[2]*100}%`,height:`${p[3]*100}%`})})}};Dt.key="Expressive_TreemapChart";var Na={classes:"",menuOptions:{},searchable:!1,i18n:{searchLabel:"Search options",noResults:"No results"}},De=class De extends b{constructor(t,e){super(t,e);this._originalLabels=new Map;this._validationMessage=null;this._handleSelectChange=()=>{this._setValueToInput(),this._setSelectedStates(),this._syncValidationError()};this._handleInvalid=t=>{t.defaultPrevented||(this._validationMessage||(this._validationMessage=document.createElement("small"),this._validationMessage.id=this.input.id+"-error",this._validationMessage.className="supporting-text",this._validationMessage.style.color="var(--md-sys-color-error)",this.wrapper.append(this._validationMessage),this.input.setAttribute("aria-describedby",[this.input.getAttribute("aria-describedby"),this._validationMessage.id].filter(Boolean).join(" "))),this.input.ariaInvalid="true",this._syncValidationError())};this._handleNativeFocus=()=>queueMicrotask(()=>{this.constructor.getInstance(this.el)===this&&this.el.matches(":focus")&&this.input.focus()});this._handleReset=t=>{clearTimeout(this._resetTimer),this._resetTimer=setTimeout(()=>{t.defaultPrevented||(this._resetSearch(),this._handleSelectChange(),this._clearValidationError())},0)};this._handleOptionKeydown=t=>{(t.key===" "||t.key==="Enter")&&this._handleOptionClick(t)};this._handleOptionClick=t=>{t.target.matches('input[type="checkbox"]')||t.preventDefault();let e=t.target.closest("li");this._selectOptionElement(e),t.stopPropagation()};this._handleOptionFocus=t=>{if(this._searchInput)return;let e=t.target;if(!(e instanceof Element))return;let i=e.closest('li[role="option"]');i&&this.input.setAttribute("aria-activedescendant",i.id)};this._handleInputClick=()=>{this.menu&&this.menu.isOpen&&(this._setValueToInput(),this._setSelectedStates())};this._filterOptions=()=>{let t=this._searchInput.value.trim().toLowerCase();this._filterSearch(t),this._searchStatus.textContent=this._values.some(({optionEl:e})=>!e.hidden)?"":this.options.i18n.noResults,this.input.removeAttribute("aria-activedescendant"),this.menu?.recalculateDimensions()};this._handleSearchKeydown=t=>{t.stopPropagation(),!(!u.plainKey(t)||u.isComposing(t))&&(this._searchDismissKey(t)||this._searchNavigate(t))};if(this.el.classList.contains("browser-default")||new.target===De&&this.el.matches("[data-tree]")){this.el[new.target.key]=void 0;return}this.isMultiple=this.el.multiple,this._searchable=this._canSearch(),this.nativeTabIndex=this.el.tabIndex,this.el.tabIndex=-1,this._values=[],this._createdWrapper=!1,this._setupMenu(),this._setupEventHandlers()}static get defaults(){return Na}_canSearch(){return this.constructor===De&&this.options.searchable}destroy(){this._events.abort(),this.menuEl&&(clearTimeout(this._resetTimer),this._clearValidationError(),this.menu?.destroy(),this._removeMenu(),this.el.tabIndex=this.nativeTabIndex,super.destroy())}refresh(){if(!this.menuEl)return;this._bindForm();let t=this.menuEl.getRootNode(),e=this._values.find(i=>i.optionEl.contains(t.activeElement))?.el;this.input.disabled=this.el.matches(":disabled"),this.wrapper.classList.toggle("disabled",this.input.disabled),this.input.disabled?this.menu?.close():this.menu||this._initMenu(),this.input.removeAttribute("aria-activedescendant"),this._rebuildOptions(),this._handleSelectChange(),this.menu&&(this.menu.focusedIndex=-1),this.menu?.isOpen&&(this.menu.recalculateDimensions(),this._restoreOptionFocus(e))}_restoreOptionFocus(t){if(!t)return;(this._values.filter(({el:i,optionEl:n})=>i===t&&n.tabIndex===0).map(({optionEl:i})=>i)[0]||this._searchInput||this.input).focus()}_setupEventHandlers(){let{signal:t}=this._events;this._setupOptionHandlers(),this.el.addEventListener("change",this._handleSelectChange,{signal:t}),this.el.addEventListener("invalid",this._handleInvalid,{signal:t}),this.el.addEventListener("focus",this._handleNativeFocus,{signal:t}),this.input.addEventListener("click",this._handleInputClick,{signal:t}),this.menuEl.addEventListener("focusin",this._handleOptionFocus,{signal:t}),this._bindForm()}_bindForm(){this._form?.removeEventListener("reset",this._handleReset),this._form=this.el.form,this._form?.addEventListener("reset",this._handleReset,{signal:this._events.signal})}_setupOptionHandlers(){let{signal:t}=this._events;this.menuEl.querySelectorAll("li:not(.optgroup)").forEach(e=>{e.addEventListener("click",this._handleOptionClick,{signal:t}),e.addEventListener("keydown",this._handleOptionKeydown,{signal:t})})}_syncValidationError(){this._validationMessage&&(this.el.willValidate&&!this.el.validity.valid?this._validationMessage.textContent=this.el.validationMessage:this._clearValidationError())}_clearValidationError(){if(!this._validationMessage)return;let t=this.input.getAttribute("aria-describedby")?.split(/\s+/).filter(e=>e!==this._validationMessage.id).join(" ");t?this.input.setAttribute("aria-describedby",t):this.input.removeAttribute("aria-describedby"),this.input.ariaInvalid=this.el.ariaInvalid,this._validationMessage.remove(),this._validationMessage=null}_selectOptionElement(t){if(!t.hidden&&!this.el.matches(":disabled")&&!t.classList.contains("disabled")&&!t.classList.contains("optgroup")){let e=this._values.find(n=>n.optionEl===t);if(!e||e.el.matches(":disabled"))return;let i=JSON.stringify(this.getSelectedValues());e.el.selected=!this.isMultiple||!e.el.selected,this._handleSelectChange(),JSON.stringify(this.getSelectedValues())!==i&&this.el.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0,composed:!0})),this.isMultiple||this._closeSingleSelect()}}_closeSingleSelect(){this.menu?.close(),this._searchInput&&this.input.focus()}_setupMenu(){this.labelEl=this.el.labels?.[0]??null,Array.from(this.el.labels??[]).forEach(t=>{this._originalLabels.set(t,{for:t.getAttribute("for"),id:t.getAttribute("id")})}),this.labelEl&&!this.el.closest("label")&&(this._labelPlaceholder=document.createComment(""),this.labelEl.before(this._labelPlaceholder)),this._setupWrapper(),this._hideNativeSelect(),this.el.matches(":disabled")&&this.wrapper.classList.add("disabled"),this.menuEl=document.createElement(this._searchable?"div":"menu"),this.menuEl.popover="manual",this.menuEl.id=`select-options-${u.guid()}`,this.menuEl.setAttribute("role","listbox"),this.menuEl.ariaMultiSelectable=this.isMultiple.toString(),this.isMultiple&&this.menuEl.classList.add("multiple-select-menu"),this._buildOptions(),this.wrapper.append(this.menuEl),this._buildInput(),this._searchable&&this._buildSearch(),this._buildCaret(),this._initMenu(),this._setSelectedStates(),this._labelPlaceholder&&this.input.after(this.labelEl)}_setupWrapper(){let t=this.el.parentElement;t&&t.matches(".field")&&!t.querySelector(":scope > .hide-select")&&!t.querySelector(":scope > input, :scope > textarea")?(this.wrapper=t,this._createdWrapper=!1):(this.wrapper=document.createElement("div"),this.wrapper.classList.add("field"),this._createdWrapper=!0,this.el.before(this.wrapper)),this.options.classes.length>0&&this.wrapper.classList.add(...this.options.classes.split(" ").filter(Boolean))}_hideNativeSelect(){let t=document.createElement("div");t.classList.add("hide-select"),t.ariaHidden="true",this.el.before(t),t.appendChild(this.el),this._createdWrapper&&this.wrapper.append(t)}_buildInput(){this.input=document.createElement("input"),this.input.id="select-input-"+u.guid(),this.input.classList.add("menu-trigger","no-autoinit"),this.input.type="text",this.input.readOnly=!0,this.input.setAttribute("data-target",this.menuEl.id),this.input.ariaReadOnly="true",this.input.ariaRequired=this.el.hasAttribute("required").toString(),this.input.disabled=this.el.matches(":disabled"),this.input.setAttribute("tabindex",this.nativeTabIndex.toString());let t=this.el.attributes;for(let e=0;e<t.length;++e){let i=t[e];i.name.startsWith("aria-")&&this.input.setAttribute(i.name,i.value)}this.input.setAttribute("role","combobox"),this.input.setAttribute("aria-haspopup","listbox"),this.input.ariaExpanded="false",this.input.setAttribute("aria-controls",this.menuEl.id),this.input.placeholder=" ",this._originalLabels.forEach((e,i)=>{i.htmlFor=this.input.id}),this._labelPlaceholder&&this._originalLabels.size>1&&!this.input.getAttribute("aria-label")&&!this.input.getAttribute("aria-labelledby")&&this.input.setAttribute("aria-labelledby",Array.from(this._originalLabels.keys(),(e,i)=>(e.id||(e.id=`${this.input.id}-label-${i}`),e.id)).join(" ")),this.wrapper.prepend(this.input),this._setValueToInput()}_buildCaret(){let t=document.createElement("span");t.classList.add("caret"),t.setAttribute("aria-hidden","true"),this.wrapper.prepend(t)}_buildSearch(){this.menuEl.classList.add("select-search-popup"),this.menuEl.setAttribute("role","dialog"),this.menuEl.removeAttribute("aria-multiselectable"),this.menuEl.classList.remove("multiple-select-menu"),this.input.setAttribute("aria-haspopup","dialog"),this._searchResults=this._searchList(),this._searchInput=document.createElement("input"),this._searchInput.type="search",this._searchInput.placeholder=this.options.i18n.searchLabel,this._searchInput.setAttribute("aria-label",this.options.i18n.searchLabel),this._searchStatus=document.createElement("div"),this._searchStatus.setAttribute("role","status"),this.menuEl.append(this._searchInput,this._searchStatus,this._searchResults),this._searchInput.addEventListener("input",this._filterOptions,{signal:this._events.signal}),this.menuEl.addEventListener("keydown",this._handleSearchKeydown,{signal:this._events.signal,capture:!0}),this._nameSearch(),this._filterOptions()}_searchList(){let t=document.createElement("menu");return t.id=this.menuEl.id+"-list",t.setAttribute("role","listbox"),t.ariaMultiSelectable=this.isMultiple.toString(),t.classList.toggle("multiple-select-menu",this.isMultiple),t.append(...this.menuEl.childNodes),t}_nameSearch(){let t=Array.from(this._originalLabels.keys(),(n,o)=>(n.id||(n.id=this.input.id+"-label-"+o),n.id)).join(" "),e=this.input.hasAttribute("aria-labelledby")?"aria-labelledby":"aria-label",i=this.input.getAttribute(e);[this.menuEl,this._searchResults].forEach(n=>n.setAttribute(i?e:"aria-labelledby",i||t))}_filterSearch(t){this._values.forEach(({el:e,optionEl:i})=>{i.hidden=!e.textContent.trim().toLowerCase().includes(t),i.tabIndex=i.hidden||e.matches(":disabled")?-1:0}),this._filterGroups()}_filterGroups(){for(let t of this._searchResults.querySelectorAll(":scope > li.optgroup")){let e=new Set(t.getAttribute("aria-owns").split(" "));t.hidden=!this._values.some(({optionEl:i})=>e.has(i.id)&&!i.hidden)}}_searchRows(){return this._values.map(({optionEl:t})=>t).filter(t=>t.tabIndex!==-1)}_searchDismissKey(t){return t.key==="Tab"?(this._searchTab(t),!0):t.key!=="Escape"?!1:(t.preventDefault(),this._closeSingleSelect(),!0)}_searchTab(t){if(t.shiftKey){t.preventDefault(),this._searchBackwardTab(t);return}let e=this._searchRows()[0];if(t.target===this._searchInput&&e){t.preventDefault(),e.focus();return}this._closeSingleSelect()}_searchBackwardTab(t){t.target===this._searchInput?this._closeSingleSelect():this._searchInput.focus()}_searchNavigate(t){if(t.target===this._searchInput){this._searchInputKey(t);return}this._searchRowKey(t)}_searchInputKey(t){if(t.key==="Enter"&&t.preventDefault(),!["ArrowDown","ArrowUp"].includes(t.key))return;t.preventDefault();let e=this._searchRows();this._focusSearchRow(e[t.key==="ArrowUp"?e.length-1:0])}_focusSearchRow(t){t&&t.focus()}_searchRowKey(t){if(["Enter"," "].includes(t.key)){t.preventDefault(),this._selectOptionElement(t.target);return}let e=u.focusTarget([this._searchInput,...this._searchRows()],t,{ArrowDown:1,ArrowUp:-1});e&&(t.preventDefault(),t.key==="Home"?this._searchRows()[0]?.focus():e.focus())}_clearSearch(){this._searchInput&&(this._searchInput.value="",this._filterOptions())}_resetSearch(){this._searchInput&&(this.menu?.close(),this._clearSearch())}_bindSearchClose(t){let e=t.onCloseStart;t.onCloseStart=()=>(this._clearSearch(),e?.call(this.menu,this.el))}_initMenu(){if(this.el.matches(":disabled"))return;let t={...this.options.menuOptions};this._searchInput&&this._bindSearchClose(t),t.coverTrigger=!1;let e=t.onOpenEnd,i=t.onCloseEnd;t.onOpenEnd=()=>{this._focusMenu(),this.input.ariaExpanded="true",typeof e=="function"&&e.call(this.menu,this.el)},t.onCloseEnd=()=>{this.input.ariaExpanded="false",this.input.removeAttribute("aria-activedescendant"),typeof i=="function"&&i.call(this.menu,this.el)},t.closeOnClick=!1,this.menu=B.init(this.input,t)}_focusMenu(){if(!this._searchInput)return this._focusSelected();this.menu.options.autoFocus&&!u.focusIsIn(this.menuEl)&&this._searchInput.focus()}_focusSelected(){let t=this.menuEl.querySelector(".selected");if(t){if(this.menu.focusedIndex=[...t.parentNode.children].indexOf(t),this.menu._focusFocusedItem(),this.menu.isScrollable){let e=t.getBoundingClientRect().top-this.menuEl.getBoundingClientRect().top;e-=this.menuEl.clientHeight/2,this.menuEl.scrollTop=e}t.id&&this.input.setAttribute("aria-activedescendant",t.id)}}_nativeOptions(){return Array.from(this.el.children).filter(t=>["OPTION","OPTGROUP"].includes(t.tagName))}get _optionList(){return this._searchResults??this.menuEl}_buildOptions(){this.selectOptions=this._nativeOptions(),this._values=[],this.selectOptions.forEach(t=>{if(t.tagName==="OPTION"){let e=this._createAndAppendOptionWithIcon(t,this.isMultiple?"multiple":void 0);this._values.push({el:t,optionEl:e})}else if(t.tagName==="OPTGROUP"){let e="opt-group-"+u.guid(),i=document.createElement("li");i.classList.add("optgroup"),i.tabIndex=-1,i.setAttribute("role","group"),i.setAttribute("aria-labelledby",e);let n=document.createElement("span");n.id=e,n.setAttribute("role","presentation"),n.textContent=t.getAttribute("label")??"",i.replaceChildren(n),this._optionList.append(i);let o=[];Array.from(t.children).filter(l=>l.tagName==="OPTION").forEach(l=>{let c=this._createAndAppendOptionWithIcon(l,"optgroup-option");o.push(c.id),this._values.push({el:l,optionEl:c})}),i.setAttribute("aria-owns",o.join(" "))}})}_rebuildOptions(){this._optionList.replaceChildren(),this._buildOptions(),this._setupOptionHandlers(),this.menu?._makeMenuFocusable(),this._searchInput&&this._filterOptions()}_removeMenu(){this.wrapper?.querySelector(":scope > .caret")?.remove(),this.input?.remove(),this.menuEl?.remove();let t=this.el.parentElement;t?.classList.contains("hide-select")&&t.replaceWith(this.el),this._originalLabels.forEach((e,i)=>{for(let n of["for","id"])x(i,n,e[n])}),this._labelPlaceholder?.replaceWith(this.labelEl),this.wrapper&&(this._createdWrapper?this.wrapper.replaceWith(this.el):(this.wrapper.classList.remove("disabled"),this.options.classes.length>0&&this.wrapper.classList.remove(...this.options.classes.split(" ").filter(Boolean))))}_createAndAppendOptionWithIcon(t,e){let i=document.createElement("li");i.id="select-option-"+u.guid(),i.setAttribute("role","option"),i.tabIndex=0;let n=this.el.matches(":disabled")||t.matches(":disabled");n&&(i.classList.add("disabled"),i.ariaDisabled="true",i.tabIndex=-1),e==="optgroup-option"&&i.classList.add(e);let o=t.textContent,a=document.createElement("span");if(this.isMultiple&&!n){let d=document.createElement("label"),p=document.createElement("input");p.type="checkbox",p.tabIndex=-1;let g=document.createElement("span");g.textContent=o,d.append(p,g),a.appendChild(d)}else a.textContent=o;i.appendChild(a);let l=t.getAttribute("data-icon"),c;if(l)try{let d=new URL(l,this.el.ownerDocument.baseURI);(["http:","https:","blob:"].includes(d.protocol)||/^data:image\/(?:avif|bmp|gif|jpeg|png|svg\+xml|webp|x-icon)(?:;|,)/i.test(d.href))&&(c=d)}catch{}let h=t.getAttribute("class")?.split(" ").filter(Boolean);if(c){let d=document.createElement("img");h?.length&&d.classList.add(...h),d.src=c.href,d.ariaHidden="true",i.prepend(d)}return this._optionList.append(i),i}_setValueToInput(){this.input.value=Array.from(this.el.selectedOptions,t=>t.textContent.trim()).join(", ")}_setSelectedStates(){this._values.forEach(({el:t,optionEl:e})=>{e.classList.toggle("selected",t.selected),e.ariaSelected=String(t.selected);let i=e.querySelector('input[type="checkbox"]');i&&(i.checked=t.selected)})}getSelectedValues(){return Array.from(this.el.selectedOptions,t=>t.value)}};De.key="Expressive_FormSelect";var z=De;var Ba={margin:5,transition:10,duration:250,align:"left"},hi=class{constructor(s,t,e){this._handleDocumentClick=s=>{if(!this.visible)return;let t=s.composedPath();[...this.triggers,this.container].some(e=>t.includes(e))||this.hide()};this.destroy=()=>{document.removeEventListener("click",this._handleDocumentClick),this.container.remove()};this.show=()=>{this.visible||(this.visible=!0,document.addEventListener("click",this._handleDocumentClick),this._place(),this.container.style.visibility="visible",this._animate(this.options.transition,"1"))};this.hide=()=>{this.visible&&(this.visible=!1,document.removeEventListener("click",this._handleDocumentClick),this.container.removeAttribute("style"),this._animate(0,"0"))};this.el=s,this.triggers=[s],this.options={...Ba,...e},this.container=document.createElement("div"),this.container.classList.add("display-docked"),this.container.append(t),s.parentElement.append(this.container)}_animate(s,t){let{duration:e}=this.options;this.container.style.transition=`transform ${e}ms ease-out, opacity ${e}ms ease-out`,setTimeout(()=>{this.container.style.transform=`translateX(0px) translateY(${s}px)`,this.container.style.opacity=t},1)}_place(){let{margin:s,transition:t,align:e}=this.options,{offsetHeight:i,offsetWidth:n}=this.el,o=this.container.offsetWidth,a=this.el.getBoundingClientRect(),l=a.left+window.scrollX;e==="center"?l+=n/2-o/2:e==="right"&&(l+=n-o-s);let c=a.top+window.scrollY+i+s,h=u._repositionWithinScreen(l,c,o,this.container.offsetHeight,s,t,e);u._placeInOffsetParent(this.container,h)}};var ue=class{constructor(s,t,e){this._settled=!1;this._opener=null;this._handleClick=s=>{s.target===this.dialog&&this.dialog.close()};this._handleClose=()=>{let s=!this._settled;this._settled=!1,this._opener?.focus({preventScroll:!0}),s&&this.onDismiss()};this.destroy=()=>{this.dialog.removeEventListener("click",this._handleClick),this.dialog.removeEventListener("close",this._handleClose),this.dialog.remove()};this.show=()=>{if(this.dialog.open)return;let s=this.dialog.getRootNode();this._opener=s.activeElement,this.dialog.showModal()};this.hide=()=>{this.dialog.open&&(this._settled=!0,this.dialog.close())};this.triggers=[s],this.onDismiss=e,this.dialog=document.createElement("dialog"),this.dialog.className="display-modal";let i=s.labels?.[0]?.textContent.trim()||s.getAttribute("aria-label");i&&this.dialog.setAttribute("aria-label",i),this.dialog.append(t),s.parentElement.append(this.dialog),this.dialog.addEventListener("click",this._handleClick),this.dialog.addEventListener("close",this._handleClose)}};function ui(r,s,t,e,i){if(r==="modal")return new ue(s,t,i);if(r==="docked")return new hi(s,t,e)}function de(r){r instanceof ue&&r.hide()}var fn=Array.from({length:12},(r,s)=>new Date(Date.UTC(2023,s,1))),Ji=Array.from({length:7},(r,s)=>new Date(Date.UTC(2023,0,1+s)));function $a(r){let s=(i,n)=>{let o=new Intl.DateTimeFormat(r,{...n,calendar:"gregory",timeZone:"UTC"});return i.map(a=>o.format(a))},t=new Intl.Locale(r),e=t.getWeekInfo?.()??t.weekInfo;return{week:e?{firstDay:e.firstDay%7}:{},i18n:{months:s(fn,{month:"long"}),monthsShort:s(fn,{month:"short"}),weekdays:s(Ji,{weekday:"long"}),weekdaysShort:s(Ji,{weekday:"short"}),weekdaysAbbrev:s(Ji,{weekday:"narrow"})}}}var vn=r=>r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),di="(\\d{1,2})",pi=(r,s)=>[`(${r.map(vn).join("|")})`,(t,e)=>s&&(t[s]=r.findIndex(i=>i.toLowerCase()===e.toLowerCase()))],qa={d:()=>[di,(r,s)=>r.day=+s],dd:()=>[di,(r,s)=>r.day=+s],ddd:r=>pi(r.weekdaysShort),dddd:r=>pi(r.weekdays),m:()=>[di,(r,s)=>r.month=+s-1],mm:()=>[di,(r,s)=>r.month=+s-1],mmm:r=>pi(r.monthsShort,"month"),mmmm:r=>pi(r.months,"month"),yy:()=>["(\\d{2})",(r,s)=>r.year=+s+(+s<50?2e3:1900)],yyyy:()=>["(\\d{4})",(r,s)=>r.year=+s]},_n=r=>String(r).padStart(2,"0"),gn={d:r=>r.getDate(),dd:r=>_n(r.getDate()),ddd:(r,s)=>s.weekdaysShort[r.getDay()],dddd:(r,s)=>s.weekdays[r.getDay()],m:r=>r.getMonth()+1,mm:r=>_n(r.getMonth()+1),mmm:(r,s)=>s.monthsShort[r.getMonth()],mmmm:(r,s)=>s.months[r.getMonth()],yy:r=>String(r.getFullYear()).slice(2),yyyy:r=>r.getFullYear()};function za(r,s,t){let e=[],i=s.split(/(d{1,4}|m{1,4}|y{4}|yy|!.)/g).map(c=>{let h=qa[c]?.(t);return h&&e.push(h),h?h[0]:vn(c)}),n=new RegExp(`^\\s*${i.join("")}\\s*$`,"iu").exec(r);if(!n)return null;let o={};e.forEach(([,c],h)=>c(o,n[h+1]));let a=new Date(2e3,0,1);return a.setFullYear(o.year,o.month,o.day),[a.getFullYear(),a.getMonth(),a.getDate()].join()===[o.year,o.month,o.day].join()?a:null}function Ka(r,s={}){let t=u.locale(r);if(!t)return s;let{week:e,i18n:i}=$a(t);return{...e,...s,i18n:{...i,...s.i18n}}}var Va={format:"mmm dd, yyyy",parse:null,isDateRange:!1,dateRangeEndEl:null,isMultipleSelection:!1,defaultDate:null,defaultEndDate:null,setDefaultDate:!1,setDefaultEndDate:!1,disableWeekends:!1,disableDayFn:null,firstDay:0,minDate:null,maxDate:null,yearRange:10,minYear:0,maxYear:9999,minMonth:void 0,maxMonth:void 0,isRTL:!1,yearRangeReverse:!1,showMonthAfterYear:!1,showDaysInNextAndPreviousMonths:!1,openByDefault:!1,container:null,showClearBtn:!1,autoSubmit:!0,i18n:{cancel:"Cancel",clear:"Clear",done:"Ok",previousMonth:"Previous month",nextMonth:"Next month",months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],weekdaysAbbrev:["S","M","T","W","T","F","S"]},events:[],onSelect:null,onDraw:null,onInputInteraction:null,displayPlugin:null,displayPluginOptions:null,onConfirm:null,onCancel:null},w=class w extends b{constructor(t,e){e=Ka(t,e);super(t,e);this.multiple=!1;this._writtenInputs=new WeakMap;this._form=null;this._resetDates=new WeakMap;this._selection=0;this._drawDepth=0;this._drawDirty=!1;this._controlsKey=null;this._randId=null;this._focusedDate=null;this._handleInputClick=t=>{t.target.type=="date"&&(this.options.openByDefault||this.options.container)&&t.preventDefault(),this._batchDraws(()=>{this.setDateFromInput(t.target),this.draw(),this.gotoDate(t.target===this.el?this.date:this.endDate)}),this._showDisplay(),this.options.onInputInteraction&&this.options.onInputInteraction.call(this)};this._handleInputKeydown=u.ignoringComposition(t=>{t.key==="Enter"&&(t.preventDefault(),this._batchDraws(()=>{this.setDateFromInput(t.target),this._focusedDate=t.target===this.endDateEl?this.endDate:this.date,this.draw()}),this.displayPlugin&&this.displayPlugin.show(),this._syncCalendarFocus(!0),this.options.onInputInteraction&&this.options.onInputInteraction.call(this))});this._handleCalendarFocus=t=>{let e=t.target;e.matches(".datepicker-day-button")&&(this._focusedDate=this._dayDate(e),this._syncCalendarFocus())};this._handleCalendarKeydown=t=>{let e=t.target;if(!e.matches(".datepicker-day-button")||!u.plainKey(t))return;let i=this._dayDate(e),n=(i.getDay()-this.options.firstDay+7)%7,o={ArrowLeft:this.options.isRTL?1:-1,ArrowRight:this.options.isRTL?-1:1,ArrowUp:-7,ArrowDown:7,Home:-n,End:6-n};if(Object.hasOwn(o,t.key))i.setDate(i.getDate()+o[t.key]);else if(t.key==="PageUp"||t.key==="PageDown"){let E=i.getDate();i.setDate(1),i.setMonth(i.getMonth()+(t.key==="PageUp"?-1:1)*(t.shiftKey?12:1));let T=new Date(i.getTime());T.setMonth(T.getMonth()+1,0),i.setDate(Math.min(E,T.getDate()))}else return;t.preventDefault();let{minDate:a,maxDate:l,minYear:c,maxYear:h,minMonth:d,maxMonth:p}=this.options;if(a&&i<a&&i.setTime(a.getTime()),l&&i>l&&i.setTime(l.getTime()),i.getFullYear()<c||i.getFullYear()>h||i.getFullYear()===c&&i.getMonth()<(d??0)||i.getFullYear()===h&&i.getMonth()>(p??11))return;this._focusedDate=i;let{year:g,month:m}=this.calendars[0];i.getFullYear()===g&&i.getMonth()===m?this._syncCalendarFocus(!0):this.gotoDate(i)};this._handleCalendarClick=t=>{let e=t.target;e.classList.contains("is-disabled")||this._batchDraws(()=>{if(e.classList.contains("datepicker-day-button")&&!e.classList.contains("is-empty")&&!e.parentElement.classList.contains("is-disabled")&&!e.parentElement.classList.contains("is-selection-disabled")){let i=new Date(t.target.getAttribute("data-year"),t.target.getAttribute("data-month"),t.target.getAttribute("data-day"));(!this.multiple||this.options.isMultipleSelection)&&this.setDate(i),this.options.isDateRange&&this._handleDateRangeCalendarClick(i),this.options.autoSubmit&&this._finishSelection()}else e.closest(".month-prev")?this.prevMonth():e.closest(".month-next")&&this.nextMonth()})};this._handleDateRangeCalendarClick=t=>{if(this.endDate==null||!w._compareDates(t,this.endDate)){if(w._isDate(this.date)&&t<this.date)return;this.setDate(t,!1,w._isDate(this.date));return}this._clearDates(),this.draw()};this._handleClearClick=()=>{this._clearDates(),this.setInputValues()};this._clearDates=()=>{this.date=null,this.endDate=null,this.dates?.splice(0),this.draw()};this._handleMonthChange=t=>{this.gotoMonth(t.target.value)};this._handleYearChange=t=>{this.gotoYear(t.target.value)};this._handleFormReset=t=>{clearTimeout(this._resetTimer),this._resetTimer=setTimeout(()=>{t.defaultPrevented||(this.options.isMultipleSelection?this._readBackMultiple():this._readBackSingle(),this.draw())})};this._handleInputChange=t=>{t.detail?.firedBy!==this&&this.setDateFromInput(t.target)};this._finishSelection=()=>{this.setInputValues()};this._confirm=()=>{this._finishSelection(),de(this.displayPlugin),this._notify("confirm",this.options.onConfirm,{args:[]})};this._cancel=()=>{de(this.displayPlugin),this._notify("cancel",this.options.onCancel,{args:[]})};this.options.displayPlugin==="modal"&&Object.assign(this.options,{openByDefault:!0,autoSubmit:!1});let{minDate:i,maxDate:n}=this.options;i&&(this.options.minDate=new Date(new Date(i.getTime()).setHours(0,0,0,0))),n&&(this.options.maxDate=new Date(new Date(n.getTime()).setHours(0,0,0,0))),this.id=u.guid(),this.options.isMultipleSelection&&(this.multiple=!0,this.dates=[],this.dateEls=[t]),this._setupVariables(),this._insertHTMLIntoDOM(),this._setupEventHandlers();let o=!this.options.defaultDate;o&&(this.options.defaultDate=this._parseInput(this.el.value));let a=this.options.defaultDate;if(w._isDate(a)?this.options.setDefaultDate?(this.setDate(a,!0),this.setInputValue(this.el,a)):o&&this._isSelectableDay(a)?this.setDate(a,!0):this.gotoDate(a):this.gotoDate(new Date),this.options.isDateRange){this.multiple=!0;let l=this.options.defaultEndDate;w._isDate(l)&&this.options.setDefaultEndDate&&(this.setDate(l,!0,!0),this.setInputValue(this.endDateEl,l))}this.displayPlugin=ui(this.options.displayPlugin,this.el,this.containerEl,this.options.displayPluginOptions,this._cancel),this.endDateEl&&this.displayPlugin?.triggers.push(this.endDateEl);for(let l of[this.el,this.endDateEl])this._rememberResetDate(l)}_rememberResetDate(t){let e=t&&this._writtenInputs.get(t);e&&e.value===t.defaultValue&&this._resetDates.set(t,e)}static get defaults(){return Va}static _escape(t){return String(t??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}static _isDate(t){return/Date/.test(Object.prototype.toString.call(t))&&!isNaN(t.getTime())}_readDefault(t,e){let{format:i,i18n:n}=this.options;return(typeof i=="string"&&e.type!=="date"?za(t,i,n):null)??w._parseDate(t)}static _parseDate(t){if(t=t.trim(),!/^\d{4}-\d{2}-\d{2}$/.test(t))return new Date(Date.parse(t));let e=new Date(t+"T00:00:00");return e.getDate()===Number(t.slice(-2))?e:new Date(NaN)}_parseInput(t,e=this.el){return!t.trim()||!this.options.parse?this._readDefault(t,e):this.options.parse(t,typeof this.options.format=="string"?this.options.format:"")}static _setToStartOfDay(t){w._isDate(t)&&t.setHours(0,0,0,0)}static _compareDates(t,e){return t.getTime()===e.getTime()}destroy(){this._events.abort(),clearTimeout(this._resetTimer),this.dateEls?.slice(1).forEach(t=>this._removeDateInput(t)),!this.options.dateRangeEndEl&&this.endDateEl&&this._removeDateInput(this.endDateEl),this.displayPlugin?.destroy(),this.containerEl.remove(),this.destroySelects(),this._removeDateOverlay(),super.destroy()}_removeDateOverlay(){this.el.classList.remove("datepicker-date-input");for(let t of[this.el,this.endDateEl])t?.type==="date"&&t.removeAttribute("data-date")}destroySelects(){this._formSelect(".orig-select-year")?.destroy(),this._formSelect(".orig-select-month")?.destroy()}_insertHTMLIntoDOM(){if(this.el.type=="date"&&this.el.classList.add("datepicker-date-input"),this._renderDateInputFormat(this.el),this.options.isDateRange&&(this.containerEl.classList.add("daterange"),this.options.dateRangeEndEl?(this.endDateEl=document.querySelector(this.options.dateRangeEndEl),this.endDateEl?this._renderDateInputFormat(this.endDateEl):console.warn("Specified date range end input element in dateRangeEndEl not found")):(this.endDateEl=this.createDateInput(),this.endDateEl.classList.add("datepicker-end-date"))),Be(this.footer,this.options,"datepicker-clear",this._handleClearClick,this._confirm,this._cancel),this.options.container){let t=this.options.container;this.options.container=t instanceof HTMLElement?t:document.querySelector(t),this.options.container.append(this.containerEl)}else{let t=this.endDateEl?this.endDateEl:this.el;this.options.openByDefault||this.containerEl.setAttribute("style","display: none; visibility: hidden;"),t.parentElement.after(this.containerEl)}}_renderDateInputFormat(t){let e=t.parentElement?.querySelector(".datepicker-format");e&&(e.textContent=typeof this.options.format=="function"?"":String(this.options.format))}toString(t=this.date,e=null){return e=e||this.options.format,typeof e=="function"?e(t):w._isDate(t)?this.formatDate(t,e):""}formatDate(t,e){return e.split(/(d{1,4}|m{1,4}|y{4}|yy|!.)/g).map(n=>gn[n]?gn[n](t,this.options.i18n):n).join("")}setDateFromInput(t){if(this._syncDataDate(t),(this.options.isDateRange||!this.options.isMultipleSelection)&&!t.value.trim()){this.setSingleDate(null,t===this.endDateEl),this.draw();return}let e=this._dateInInput(t);if(!w._isDate(e))return;let i=new Date(e.getTime());w._setToStartOfDay(i);let n=t===this.endDateEl;if(this.options.isDateRange&&(n?this.date&&i<this.date:this.endDate&&i>this.endDate)||this._isDisabledDay(i)){this.setInputValue(t,this._selectedDateFor(t));return}this._selectTypedMultiDate(t,i),this.setDate(i,!1,n,!0)}_selectTypedMultiDate(t,e){if(!this.options.isMultipleSelection)return;let i=this._selectedDateFor(t);this.dates=this.dates.filter(n=>n!==i&&n.getTime()!==e.getTime()),this.setMultiDate(e)}setDate(t=null,e=!1,i=!1,n=!1){let o=this.validateDate(t);if(!o)return;w._setToStartOfDay(o);let a=++this._selection;this.options.isMultipleSelection?n||this.setMultiDate(o):this.setSingleDate(o,i),this.gotoDate(o),!e&&this._notify("select",this.options.onSelect,{args:[o],detail:{date:o},current:()=>a===this._selection})}validateDate(t){if(!t)return this._renderDateDisplay(t),this.draw();if(typeof t=="string"&&(t=w._parseDate(t)),!w._isDate(t))return;let e=this.options.minDate,i=this.options.maxDate;return w._isDate(e)&&t<e?t=e:w._isDate(i)&&t>i&&(t=i),new Date(t.getTime())}_dateInInput(t){let e=!this.options.parse&&[this._writtenInputs.get(t),this._resetDates.get(t)].find(i=>i?.value===t.value);return e?e.date:this._parseInput(t.value,t)}_selectedDateFor(t){return this.options.isMultipleSelection?this.dates[this.dateEls.indexOf(t)]??null:t===this.endDateEl?this.endDate:this.date}_isSelectableDay(t){let e=new Date(t.getTime());return w._setToStartOfDay(e),!this._isDisabledDay(e)}_isDisabledDay(t){return this._isOutOfBounds(t)||this._isRefusedDay(t)}_isOutOfBounds(t){let{minDate:e,maxDate:i}=this.options;return e&&t<e||i&&t>i}_isRefusedDay(t){let{disableWeekends:e,disableDayFn:i}=this.options;return e&&[0,6].includes(t.getDay())||!!i?.(t)}setSingleDate(t,e){e?this.endDate=t:this.date=t}setMultiDate(t){let e=this.dates.findIndex(i=>i.getTime()===t.getTime());e===-1?this.dates.push(t):this.dates.splice(e,1),this.dates.sort((i,n)=>i.getTime()-n.getTime())}setDataDate(t,e){t.setAttribute("data-date",w._isDate(e)?this.toString(e):"")}setInputValues(){if(!this.options?.isMultipleSelection){this.setInputValue(this.el,this.date),this.options?.isDateRange&&this.setInputValue(this.endDateEl,this.endDate);return}this.setMultipleSelectionInputValues()}setMultipleSelectionInputValues(){let t=Math.max(1,this.dates.length);for(let e of this.dateEls.splice(t))this._removeDateInput(e);for(;this.dateEls.length<t;)this.dateEls.push(this.createDateInput());this.dateEls.forEach((e,i)=>this.setInputValue(e,this.dates[i]??null))}setInputValue(t,e){t&&(t.type=="date"&&this.setDataDate(t,e),w._isDate(e)?t.type=="date"?t.value=this.formatDate(e,"yyyy-mm-dd"):t.value=this.toString(e):t.value="",this._writtenInputs.set(t,{value:t.value,date:w._isDate(e)?new Date(e.getTime()):null}),t.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!0,composed:!0,detail:{firedBy:this}})))}_renderDateDisplay(t,e=null){let i=w._isDate(t)?t:new Date;if(!this.options.isDateRange)this.dateTextEl.textContent=this.formatDate(i,"ddd, mmm d");else{let n=w._isDate(e)?e:new Date;this.dateTextEl.textContent=`${this.formatDate(i,"mmm d")} - ${this.formatDate(n,"mmm d")}`}}gotoDate(t){let e=!0;if(w._isDate(t)){if(this.calendars){let i=new Date(this.calendars[0].year,this.calendars[0].month,1),n=new Date(this.calendars[this.calendars.length-1].year,this.calendars[this.calendars.length-1].month,1),o=t.getTime();n.setMonth(n.getMonth()+1),n.setDate(n.getDate()-1),e=o<i.getTime()||n.getTime()<o}e&&(this.calendars=[{month:t.getMonth(),year:t.getFullYear()}]),this.adjustCalendars()}}adjustCalendars(){this.calendars[0]=this.adjustCalendar(this.calendars[0]),this.draw()}adjustCalendar(t){return t.month<0&&(t.year-=Math.ceil(Math.abs(t.month)/12),t.month+=12),t.month>11&&(t.year+=Math.floor(Math.abs(t.month)/12),t.month-=12),t}nextMonth(){this.calendars[0].month++,this.adjustCalendars()}prevMonth(){this.calendars[0].month--,this.adjustCalendars()}render(t,e,i){let n=new Date,o=new Date(t,e+1,0).getDate(),a=[],l=new Date(t,e,1).getDay(),c=[];w._setToStartOfDay(n),this.options.firstDay>0&&(l-=this.options.firstDay,l<0&&(l+=7));let h=e===0?11:e-1,d=e===11?0:e+1,p=e===0?t-1:t,g=e===11?t+1:t,m=new Date(t,e,0).getDate(),E=Math.ceil((o+l)/7)*7;for(let T=0,C=0;T<E;T++){let _=new Date(t,e,1+(T-l)),L=w._compareDates(_,n),S=this.options.events.indexOf(_.toDateString())!==-1,P=T<l||T>=o+l,N=this._isDisabledDay(_),rt=this.options.isDateRange&&this.date&&this.endDate&&w._compareDates(this.date,_),Ne=this.options.isDateRange&&this.endDate&&w._compareDates(this.endDate,_),Ee=this.options.isDateRange&&[this.date,this.endDate].every(w._isDate)&&_>this.date&&_<this.endDate,Y=1+(T-l),X=e,Ei=t,ye=!1;w._isDate(this.date)&&(ye=w._compareDates(_,this.date)),!ye&&w._isDate(this.endDate)&&(ye=w._compareDates(_,this.endDate)),this.options.isMultipleSelection&&this.dates?.some(Un=>Un.getTime()===_.getTime())&&(ye=!0),P&&(T<l?(Y=m+Y,X=h,Ei=p):(Y=Y-o,X=d,Ei=g));let Wn={day:Y,month:X,year:Ei,hasEvent:S,isSelected:ye,isToday:L,isDisabled:N,isEmpty:P,showDaysInNextAndPreviousMonths:this.options.showDaysInNextAndPreviousMonths,isDateRangeStart:rt,isDateRangeEnd:Ne,isDateRange:Ee};c.push(this.renderDay(Wn)),++C===7&&(a.push(this.renderRow(c,this.options.isRTL,!1)),c=[],C=0)}return this.renderTable(this.options,a,i)}renderDay(t){let e={isDisabled:"is-disabled",isToday:"is-today",isSelected:"is-selected",hasEvent:"has-event",isDateRangeStart:"is-daterange-start",isDateRangeEnd:"is-daterange-end",isDateRange:"is-daterange"},i=t.isSelected===!0||t.isDateRange===!0,n=["datepicker-day"];if(t.isEmpty)if(t.showDaysInNextAndPreviousMonths)n.push("is-outside-current-month"),n.push("is-selection-disabled");else return'<td class="is-empty"></td>';for(let[c,h]of Object.entries(e))t.hasOwnProperty(c)&&t[c]&&n.push(h);let o=w._escape(t.day),a=w._escape(t.month),l=w._escape(t.year);return`<td data-day="${o}" class="${n.join(" ")}" aria-selected="${i}"><button class="datepicker-day-button" type="button" data-year="${l}" data-month="${a}" data-day="${o}">${o}</button></td>`}renderRow(t,e,i){return'<tr class="datepicker-row'+(i?" is-selected":"")+'">'+w._calendarMarkup((e?t.reverse():t).join(""),"tr")+"</tr>"}renderTable(t,e,i){return'<div class="datepicker-table-wrapper"><table cellpadding="0" cellspacing="0" class="datepicker-table" role="grid" aria-labelledby="'+w._escape(i)+'">'+this.renderHead(t)+this.renderBody(e)+"</table></div>"}renderHead(t){let e=[],i;for(i=0;i<7;i++){let n=w._escape(this.renderDayName(t,i)),o=w._escape(this.renderDayName(t,i,!0));e.push(`<th scope="col"><abbr title="${n}">${o}</abbr></th>`)}return"<thead><tr>"+(t.isRTL?e.reverse():e).join("")+"</tr></thead>"}renderBody(t){let e=t.join("");return"<tbody>"+w._calendarMarkup(e,"tbody")+"</tbody>"}static _calendarMarkup(t,e){let i=document.createElement("template");i.innerHTML=t;let n={tbody:"tr",tr:"td",td:"button"},o={tr:["class"],td:["class","data-day","aria-selected"],button:["class","type","data-year","data-month","data-day","aria-label","disabled","tabindex"]},a=(l,c)=>{if(l.nodeType===Node.TEXT_NODE){if((c==="tbody"||c==="tr")&&l.textContent.trim())throw new TypeError("Unsupported calendar row content");return w._escape(l.textContent)}if(!(l instanceof HTMLElement))throw new TypeError("Unsupported calendar row content");let h=n[c];if(!h||l.localName!==h)throw new TypeError("Unsupported calendar row element");if([...l.attributes].some(p=>!o[h].includes(p.name)))throw new TypeError("Unsupported calendar row attribute");if(h==="button"&&l.getAttribute("type")!=="button")throw new TypeError('Calendar day buttons require type="button"');let d=o[h].filter(p=>l.hasAttribute(p)).map(p=>` ${p}="${w._escape(l.getAttribute(p))}"`).join("");return`<${h}${d}>${[...l.childNodes].map(p=>a(p,h)).join("")}</${h}>`};return[...i.content.childNodes].map(l=>a(l,e)).join("")}_arrowState(t,e){let i=this.options,n=t===i.minYear,o=t===i.maxYear;return{prev:!(n&&(e===0||i.minMonth>=e)),next:!(o&&(e===11||i.maxMonth<=e))}}_controlsCacheKey(t){let e=this.options;return[t,e.minYear,e.maxYear,e.minMonth,e.maxMonth,Array.isArray(e.yearRange)?e.yearRange.join("-"):e.yearRange,e.yearRangeReverse,e.showMonthAfterYear].join("|")}renderTitle(t,e,i,n,o,a){let l=this.options,c=i===l.minYear,h=i===l.maxYear,d,p,g=[],m='<div id="'+w._escape(a)+'" class="datepicker-controls" role="heading" aria-live="assertive">',{prev:E,next:T}=this._arrowState(i,n);for(d=0;d<12;d++)g.push('<option value="'+(i===o?d-e:12+d-e)+'"'+(d===n?' selected="selected"':"")+(c&&d<l.minMonth||h&&d>l.maxMonth?'disabled="disabled"':"")+">"+w._escape(l.i18n.months[d])+"</option>");let C='<select class="datepicker-select orig-select-month" tabindex="-1">'+g.join("")+"</select>";for(Array.isArray(l.yearRange)?(d=l.yearRange[0],p=l.yearRange[1]+1):(d=i-l.yearRange,p=1+i+l.yearRange),g=[];d<p&&d<=l.maxYear;d++)d>=l.minYear&&g.push(`<option value="${d}" ${d===i?'selected="selected"':""}>${d}</option>`);l.yearRangeReverse&&g.reverse();let _=`<select class="datepicker-select orig-select-year" tabindex="-1">${g.join("")}</select>`;return m+=`<button class="month-prev${E?"":" is-disabled"}" type="button" aria-label="${w._escape(l.i18n.previousMonth)}"><svg height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"/><path d="M0-.5h24v24H0z" fill="none"/></svg></button>`,m+='<div class="selects-container">',l.showMonthAfterYear?m+=_+C:m+=C+_,m+="</div>",m+=`<button class="month-next${T?"":" is-disabled"}" type="button" aria-label="${w._escape(l.i18n.nextMonth)}"><svg height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"/><path d="M0-.25h24v24H0z" fill="none"/></svg></button>`,m+="</div>"}_batchDraws(t){this._drawDepth++;try{t()}finally{this._drawDepth--,this._drawDepth===0&&this._drawDirty&&(this._drawDirty=!1,this.draw())}}draw(){if(this._drawDepth>0){this._drawDirty=!0;return}let t=this.calendarEl.getRootNode().activeElement,e=t?.matches(".datepicker-day-button")&&this.calendarEl.contains(t),i=this.calendarEl.contains(t)&&t?.matches(".month-prev, .month-next")?t.classList.contains("month-prev")?".month-prev":".month-next":null,n=this._selectFocusRestorer(t),o=this.calendars[0].year,a=this.calendars[0].month;this._renderDateDisplay(this.date,this.endDate);let l=this._controlsCacheKey(o);l===this._controlsKey&&this.calendarEl.querySelector(".datepicker-controls")?this._reuseControls(o,a):(this._controlsKey=l,this._randId="datepicker-title-"+u.guid(),this._rebuildControls(o,a)),this._renderCalendarTable(o,a),this._syncCalendarFocus(!!e),i&&this.calendarEl.querySelector(i)?.focus(),n(),typeof this.options.onDraw=="function"&&this.options.onDraw.call(this)}_formSelect(t){let e=this.calendarEl.querySelector(t);return e?z.getInstance(e):void 0}_selectFocusRestorer(t){let e=n=>!!n&&(n.input===t||!!n.menuEl?.contains(t)),i=[".orig-select-year",".orig-select-month"].find(n=>e(this._formSelect(n)));return()=>{i&&!t.isConnected&&this._formSelect(i)?.input.focus()}}_rebuildControls(t,e){this.destroySelects(),this.calendarEl.innerHTML=this.renderTitle(this,0,t,e,t,this._randId);let i=this.calendarEl.querySelector(".orig-select-year"),n=this.calendarEl.querySelector(".orig-select-month");z.init(i,{classes:"select-year",menuOptions:{container:u.portalRoot(this.el),constrainWidth:!1}}),z.init(n,{classes:"select-month",menuOptions:{container:u.portalRoot(this.el),constrainWidth:!1}}),i.addEventListener("change",this._handleYearChange),n.addEventListener("change",this._handleMonthChange)}_reuseControls(t,e){let i=this.calendarEl.querySelector(".orig-select-month");i&&i.value!==e.toString()&&(i.value=e.toString(),z.getInstance(i)?.refresh());let{prev:n,next:o}=this._arrowState(t,e);this.calendarEl.querySelector(".month-prev")?.classList.toggle("is-disabled",!n),this.calendarEl.querySelector(".month-next")?.classList.toggle("is-disabled",!o)}_renderCalendarTable(t,e){let i=this.render(t,e,this._randId),n=this.calendarEl.querySelector(".datepicker-table-wrapper");n?n.outerHTML=i:this.calendarEl.insertAdjacentHTML("beforeend",i)}_setupEventHandlers(){this._addInputEventHandlers(this.el),this.endDateEl&&this._addInputEventHandlers(this.endDateEl),this._form=this.el.form;let{signal:t}=this._events;this._form?.addEventListener("reset",this._handleFormReset,{signal:t}),this.calendarEl.addEventListener("click",this._handleCalendarClick,{signal:t}),this.calendarEl.addEventListener("keydown",this._handleCalendarKeydown,{signal:t}),this.calendarEl.addEventListener("focusin",this._handleCalendarFocus,{signal:t})}_setupVariables(){let t=document.createElement("template");t.innerHTML=w._template.trim(),this.containerEl=t.content.firstChild,this.calendarEl=this.containerEl.querySelector(".datepicker-calendar"),this.dateTextEl=this.containerEl.querySelector(".date-text"),this.footer=this.containerEl.querySelector(".datepicker-footer")}_addInputEventHandlers(t){let{signal:e}=this._events;t.addEventListener("click",this._handleInputClick,{signal:e}),t.addEventListener("keydown",this._handleInputKeydown,{signal:e}),t.addEventListener("change",this._handleInputChange,{signal:e})}_removeDateInput(t){let e=t.getRootNode().activeElement===t;t.remove(),e&&document.activeElement===document.body&&this.el.focus()}_showDisplay(){this.displayPlugin?.show(),this.displayPlugin instanceof ue&&this._syncCalendarFocus(!0)}_dayDate(t){let e=new Date(0);return e.setFullYear(Number(t.dataset.year),Number(t.dataset.month),Number(t.dataset.day)),w._setToStartOfDay(e),e}_syncCalendarFocus(t=!1){let e=[...this.calendarEl.querySelectorAll(".datepicker-day-button")],i=e.filter(a=>!a.parentElement.classList.contains("is-selection-disabled")),n=this._focusedDate||this.date||new Date(new Date().setHours(0,0,0,0)),o=i.find(a=>w._compareDates(this._dayDate(a),n))||i.find(a=>a.parentElement.classList.contains("is-selected"))||i.find(a=>!a.parentElement.classList.contains("is-disabled"))||i[0];for(let a of e)a.tabIndex=a===o?0:-1,a.setAttribute("aria-disabled",String(a.parentElement.matches(".is-disabled, .is-selection-disabled")));o&&(this._focusedDate=this._dayDate(o),t&&o.focus())}gotoMonth(t){isNaN(t)||(this.calendars[0].month=parseInt(t,10),this.adjustCalendars())}gotoYear(t){isNaN(t)||(this.calendars[0].year=parseInt(t,10),this.adjustCalendars())}_readBackMultiple(){for(let e of this.dateEls.splice(1))this._removeDateInput(e);this.dates=[],this._syncDataDate(this.el);let t=this._dateInInput(this.el);w._isDate(t)&&this._isSelectableDay(t)&&this.setDate(t,!0)}_syncDataDate(t){t.type==="date"&&this.setDataDate(t,w._parseDate(t.value))}_readBackSingle(){this.setSingleDate(null,!1),this.setSingleDate(null,!0);for(let t of[this.el,this.endDateEl])t&&this.setDateFromInput(t)}renderDayName(t,e,i=!1){for(e+=t.firstDay;e>=7;)e-=7;return i?t.i18n.weekdaysAbbrev[e]:t.i18n.weekdays[e]}createDateInput(){let t=this.el.cloneNode(!0);return t.removeAttribute("id"),t.classList.add("no-autoinit"),this._addInputEventHandlers(t),this.el.parentElement.appendChild(t),t}};w.key="Expressive_Datepicker",w._template=`
|
|
8
|
+
`,this._transitionTimer=setTimeout(()=>{this.el.style.transform="",this.el.style.opacity="1"},1)}_setTimer(){this.timeRemaining!==1/0&&(this._deadline=Date.now()+this.timeRemaining,this.counterTimeout=setTimeout(()=>this.dismiss(),this.timeRemaining))}_pauseTimer(){this.counterTimeout!=null&&(clearTimeout(this.counterTimeout),this.counterTimeout=null,this.timeRemaining=Math.max(0,this._deadline-Date.now()))}_resumeTimer(){this._dismissed||this.panning||this.el.matches(":hover, :focus-within")||this.counterTimeout!=null||this._setTimer()}_restoreFocus(s=!1){let t=this.el.getRootNode().activeElement,e=t&&this.el.contains(t)?this._returnFocus:null;this.el.inert=!0,s&&this._remove(!1),e?.isConnected&&e.focus({preventScroll:!0})}dismiss(){if(this._leaveQueue()||(this._dismissed=!0,clearTimeout(this.counterTimeout),this.counterTimeout=null,this._restoreFocus(),this._events.signal.aborted))return;u.emit(this.el,"close");let s=this.options.outDuration,t=[`margin ${s}ms ease`,`opacity ${s}ms ease`];if(this.wasSwiped){let e=this.xPos<this.startingXPos?-1:1;this.el.style.transform=`translateX(${e*this.el.offsetWidth}px)`,this.el.style.opacity="0",t.push(`transform ${s}ms ease`)}this.el.style.transition=t.join(", "),clearTimeout(this._transitionTimer),this._transitionTimer=setTimeout(()=>{this.el.style.opacity="0",this.el.style.marginTop="-40px"},1),this._dismissTimer=setTimeout(()=>{u.emit(this.el,"closed"),this._remove(),typeof this.options.completeCallback=="function"&&this.options.completeCallback()},this.options.outDuration)}};y._replacing=!1,y._dragPointerId=null,y._snackbars=[],y._queue=[],y._container=null,y._draggedSnackbar=null;var ee=y;var pt=class pt{static Init(){typeof document>"u"||document.addEventListener("click",pt._onClick)}static textFor(s){if(s.hasAttribute("data-copy"))return s.getAttribute("data-copy");let t=u.getElementById(s,s.getAttribute("data-copy-for")??"");return t?t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement?t.value:(t.textContent??"").trim():null}static async _onClick(s){let t=u.closestInPath(s,"[data-copy], [data-copy-for]");if(!t||t.matches(':disabled, [aria-disabled="true"]'))return;let e=pt.textFor(t);if(e===null)return;let i=!0;try{await navigator.clipboard.writeText(e)}catch{i=!1}new ee({text:i?t.getAttribute("data-copy-message")||pt.i18n.copied:t.getAttribute("data-copy-error")||pt.i18n.failed,root:t,replace:!0}),u.emit(t,"copy",{text:e,copied:i})}};pt.i18n={copied:"Copied",failed:"Couldn't copy"};var ie=pt;var Hs=["light","dark","auto"],Kr="theme",Y=class Y{static Init(){Y._initialized||typeof document>"u"||(Y._initialized=!0,document.addEventListener("click",Y._onClick),u.onDocumentReady(()=>Y.sync()))}static get(){let s=document.documentElement.getAttribute("theme");return Hs.includes(s)?s:"auto"}static set(s){if(Hs.includes(s)){document.documentElement.setAttribute("theme",s);try{localStorage.setItem(Kr,s)}catch{}Y.sync()}}static sync(s=document){let t=Y.get();s.querySelectorAll("[data-theme-set]").forEach(e=>{let i=String(e.getAttribute("data-theme-set")===t),n=e.getAttribute("role"),o=n==="menuitemradio"||n==="radio";e.setAttribute(o?"aria-checked":"aria-pressed",i)})}static _onClick(s){let t=u.closestInPath(s,"[data-theme-set]");if(!t||t.matches(':disabled, [aria-disabled="true"]'))return;Y.set(t.getAttribute("data-theme-set"));let e=t.getRootNode();e!==document&&Y.sync(e)}};Y._initialized=!1;var se=Y;var Vr=":is(.panes, .pane-layout, .list-detail, .supporting-pane-layout):not(.equal, .three-pane)",ti=`${Vr} > button.drag-handle`,Os=240,Ds=16,I=class I{static Init(){typeof document>"u"||(document.addEventListener("pointerdown",I._onPointerDown),document.addEventListener("keydown",I._onKeyDown),document.addEventListener("click",I._onClick))}static width(s){let t=I._pane(s);return t?t.getBoundingClientRect().width:null}static setWidth(s,t){if(!I._pane(s))return;let[i,n]=I._bounds(s),o=s.parentElement;o.style.setProperty(I._token(o),`${Math.round(Math.min(Math.max(t,i),n))}px`)}static _token(s){return s.matches(".supporting, .supporting-pane-layout")?"--md-comp-pane-supporting-width":"--md-comp-pane-list-width"}static _pane(s){if(!s.matches(ti))return null;let t=s.parentElement;return t.matches(".supporting, .supporting-pane-layout")&&!t.matches(".start, .left")?s.nextElementSibling:s.previousElementSibling}static _bounds(s){let t=s.parentElement,e=getComputedStyle(t),i=parseFloat(e.getPropertyValue("--md-comp-pane-primary-min-width"))||360,o=t.clientWidth-parseFloat(e.paddingLeft)-parseFloat(e.paddingRight)-s.getBoundingClientRect().width-i;return[Os,Math.max(Os,o)]}static _paneIsLeft(s){return I._pane(s).getBoundingClientRect().left<s.getBoundingClientRect().left}static _onPointerDown(s){let t=u.closestInPath(s,ti);if(!t||s.button!==0)return;let e=I._pane(t);if(!e)return;let i=s.clientX,n=e.getBoundingClientRect().width,o=I._paneIsLeft(t)?1:-1;I._dragged=!1,t.setPointerCapture(s.pointerId);let a=d=>{let p=d.clientX-i;Math.abs(p)<4&&!I._dragged||(I._dragged=!0,I.setWidth(t,n+o*p))},l=R(t),c=()=>l.abort(),{signal:h}=l;t.addEventListener("pointermove",a,{signal:h}),t.addEventListener("pointerup",c,{signal:h}),t.addEventListener("pointercancel",c,{signal:h})}static _onClick(s){let t=u.closestInPath(s,ti);if(!t||s.detail!==0&&I._dragged)return;let[e,i]=I._bounds(t),n=I.width(t),o=[e,(e+i)/2,i].find(a=>a>n+1)??e;I.setWidth(t,o)}static _onKeyDown(s){let t=u.closestInPath(s,ti);if(!t||!u.plainKey(s))return;let e=I.width(t),[i,n]=I._bounds(t),o=s.shiftKey?Ds*4:Ds,a={ArrowLeft:-o,ArrowRight:o}[s.key],l;if(a)l=e+(I._paneIsLeft(t)?a:-a);else if(s.key==="Home")l=i;else if(s.key==="End")l=n;else return;s.preventDefault(),I.setWidth(t,l)}};I._dragged=!1;var ne=I;var Ki='.image-compare > input[type="range"]',ot=class ot{static Init(){ot._initialized||typeof document>"u"||(ot._initialized=!0,document.addEventListener("input",s=>{let t=u.eventTarget(s);t?.matches(Ki)&&ot.sync(t)}),Ve(s=>s.querySelectorAll(Ki).forEach(ot.sync)),u.onDocumentReady(()=>{document.querySelectorAll(Ki).forEach(s=>ot.sync(s))}))}static sync(s){let t=parseFloat(s.min)||0,e=Number.isNaN(parseFloat(s.max))?100:parseFloat(s.max),i=e===t?0:(parseFloat(s.value)-t)/(e-t);s.parentElement.style.setProperty("--md-comp-image-compare-position",`${i*100}%`)}};ot._initialized=!1;var re=ot;var st=new WeakMap,Ps="--tour-target",H=class H{static Init(){H._initialized||typeof document>"u"||(H._initialized=!0,document.addEventListener("click",H._onClick),document.addEventListener("keydown",s=>{let t=u.closestInPath(s,".tour");s.key==="Escape"&&t instanceof HTMLElement&&st.has(t)&&H.end(t)}),document.addEventListener("toggle",s=>{let t=s.target;s.newState==="closed"&&st.has(t)&&H.end(t)},!0))}static start(s,t=0){let e=[...s.querySelectorAll(":scope > section[data-tour-target]")].filter(o=>H._target(o)?.checkVisibility());if(!e.length)return;let i=st.get(s);i&&H._release(i.steps[i.index]);let n={steps:e,index:0,opener:H._opener(s,i)};st.set(s,n),H._show(s,!i),st.get(s)===n&&H.go(s,t)}static _opener(s,t){if(t?.opener)return t.opener;let e=s.getRootNode().activeElement;return e instanceof HTMLElement?e:null}static _show(s,t){s.matches(":popover-open")||s.showPopover(),t&&u.emit(s,"open")}static go(s,t){let e=st.get(s);if(!e)return;H._release(e.steps[e.index]),t=Math.min(Math.max(t,0),e.steps.length-1);let i=t<e.index?-1:1;for(;e.steps[t]&&!H._target(e.steps[t]);)t+=i;let n=e.steps[t];if(!n){H.end(s);return}e.index=t;let o=e.index===e.steps.length-1;s.querySelectorAll(":scope > section[data-tour-target]").forEach(p=>{p.hidden=p!==n});let a=n.querySelector("h1, h2, h3, h4, h5, h6");a&&(a.id||(a.id=`tour-${u.guid()}`),s.setAttribute("aria-labelledby",a.id));let l=s.querySelector(".tour-progress");l&&(l.textContent=H.i18n.progress.replace("{current}",String(e.index+1)).replace("{total}",String(e.steps.length)));let c=(p,_)=>s.querySelectorAll(p).forEach(m=>m.hidden=!_);c("[data-tour-back]",e.index>0),c("[data-tour-next]",!o),c("[data-tour-done]",o);let h=H._target(n);h.classList.add("tour-target"),u.setAnchorName(h,Ps,!0);let d=!matchMedia("(prefers-reduced-motion: reduce)").matches;h.scrollIntoView({block:"center",behavior:d?"smooth":"auto"}),s.hasAttribute("tabindex")||(s.tabIndex=-1),s.focus({preventScroll:!0}),u.emit(s,"change",{step:n,index:e.index})}static end(s,t=!1){let e=st.get(s);e&&(H._release(e.steps[e.index]),st.delete(s),s.matches(":popover-open")&&s.hidePopover(),e.opener?.focus(),u.emit(s,"close",{completed:t}))}static _target(s){return u.getElementById(s,s.getAttribute("data-tour-target")??"")}static _release(s){let t=s&&H._target(s);t?.classList.remove("tour-target"),t&&u.setAnchorName(t,Ps,!1)}static _onClick(s){let t=u.closestInPath(s,"[data-tour-start], [data-tour-back], [data-tour-next], [data-tour-done], [data-tour-close]");if(!t)return;if(t.hasAttribute("data-tour-start")){let n=u.getElementById(t,t.getAttribute("data-tour-start"));n?.matches(".tour")&&H.start(n);return}let e=t.closest(".tour"),i=e&&st.get(e);i&&(t.hasAttribute("data-tour-back")?H.go(e,i.index-1):t.hasAttribute("data-tour-next")?H.go(e,i.index+1):H.end(e,t.hasAttribute("data-tour-done")))}};H.i18n={progress:"Step {current} of {total}"},H._initialized=!1;var oe=H;var Rs=".sortable > li",k=class k{static Init(){typeof document>"u"||(document.addEventListener("click",k._onClick),document.addEventListener("pointerdown",k._onPointerDown))}static move(s,t){let e=s.parentElement,i=[...e.children],n=i.indexOf(s);if(t=Math.min(Math.max(t,0),i.length-1),t===n)return;let o=s.getRootNode().activeElement,a=s.contains(o)?o:null;e.insertBefore(s,i[t>n?t+1:t]??null),a?.focus(),k._done(e,s,n,t)}static _done(s,t,e,i){let n=k._regions.get(s);n||(n=document.createElement("div"),n.className="visually-hidden",n.setAttribute("aria-live","polite"),s.after(n),k._regions.set(s,n)),n.textContent=k.i18n.moved.replace("{position}",String(i+1)).replace("{total}",String(s.children.length)),s.dispatchEvent(new CustomEvent("change",{bubbles:!0,detail:{item:t,from:e,to:i}}))}static _onClick(s){let t=u.closestInPath(s,"[data-move]"),e=t?.closest(Rs);if(!e||t.matches(':disabled, [aria-disabled="true"]'))return;let i=[...e.parentElement.children].indexOf(e),n=t.getAttribute("data-move");n==="up"?k.move(e,i-1):n==="down"&&k.move(e,i+1)}static _onPointerDown(s){let e=u.closestInPath(s,".drag-handle")?.closest(Rs);if(!e||s.button!==0||k._drag)return;s.preventDefault();let i=e.parentElement,n=R(e);k._drag={item:e,list:i,from:[...i.children].indexOf(e),pointerId:s.pointerId,events:n},e.classList.add("dragged");let{signal:o}=n;document.addEventListener("pointermove",k._onPointerMove,{signal:o}),document.addEventListener("pointerup",k._onPointerEnd,{signal:o}),document.addEventListener("pointercancel",k._onPointerEnd,{signal:o}),document.addEventListener("keydown",k._onKeyDown,{signal:o})}static _onPointerMove(s){let t=k._drag;if(!t||s.pointerId!==t.pointerId)return;let e=t.item.previousElementSibling,i=t.item.nextElementSibling,n=o=>{let a=o.getBoundingClientRect();return a.top+a.height/2};e&&s.clientY<n(e)?t.list.insertBefore(t.item,e):i&&s.clientY>n(i)&&t.list.insertBefore(t.item,i.nextElementSibling)}static _onPointerEnd(s){s.pointerId===k._drag?.pointerId&&k._finish(s.type==="pointercancel")}static _onKeyDown(s){s.key==="Escape"&&(s.preventDefault(),k._finish(!0))}static _finish(s){let t=k._drag;if(!t)return;k._drag=null,t.events.abort(),t.item.classList.remove("dragged");let e=[...t.list.children].indexOf(t.item);s?t.list.insertBefore(t.item,t.list.children[t.from>e?t.from+1:t.from]??null):e!==t.from&&k._done(t.list,t.item,t.from,e)}};k.i18n={moved:"Moved to position {position} of {total}"},k._drag=null,k._regions=new WeakMap;var ae=k;var Wr=":scope > li > :is(a[href], button):only-child",Ur={ArrowUp:-1,ArrowDown:1},ei=class ei{static Init(){typeof document>"u"||document.addEventListener("keydown",ei._onKeydown)}};ei._onKeydown=s=>{let t=u.eventTarget(s)?.closest(".list");if(!t)return;let e=u.focusTarget([...t.querySelectorAll(Wr)],s,Ur);e&&(s.preventDefault(),e.focus())};var le=ei;var jr=":scope > tbody > tr:not(.data-table-detail)",Yr=':scope > :first-child input[type="checkbox"]',Vi=".data-table > table > thead > tr:first-child > th > button.drag-handle:last-child",Xr=16,Gr={ascending:1,descending:-1},Fs='[role="menuitemcheckbox"][data-column]',ji="data-column-hidden",Ns='input[type="search"][data-table-filter]',ke="data-table-filter-hidden",si="data-table-page-hidden",Bs='button[type="button"]:is([data-table-page="previous"], [data-table-page="next"])',Zr={previous:-1,next:1},Qr="select[data-table-page-size]:not([multiple], :disabled):not(:has(option:checked:disabled))";function Jr(r){return r?[[r.page,1],[r.pageSize,1],[r.total,0]].every(([s,t])=>Number.isSafeInteger(s)&&s>=t):!1}function Wi(r,s,t){return Math.min(Math.max(r,1),Math.ceil(s/t))}function zs(r){let s=Number(r);return Number.isSafeInteger(s)&&s>0?s:0}function at(r){return zs(r.getAttribute("data-page-size"))}function Ui(r,s){return Array.from(r.querySelectorAll(s)).find(t=>t.closest(".data-table")===r)}function ii(r){let s=r.closest("table");return to(r,s)?!1:s.checkVisibility?.()?r.checkVisibility({visibilityProperty:!0}):eo(r)}function to(r,s){let t=r.closest(`[hidden], [${ke}], [${si}]`);return t!==null&&s.contains(t)}function eo(r){let s=getComputedStyle(r);return s.display!=="none"&&!["hidden","collapse"].includes(s.visibility)}function Ks(r,s){let t=0;for(let e of Array.from(r.cells))if(t+=e.colSpan,s<t)return e}function $s(r,s){let t=Ks(r,s);return(t?.dataset.value??t?.textContent??"").trim()}function io(r,s,t,e){for(let i=s;i<s+Math.max(1,e.rowSpan);i++)for(let n=t;n<t+e.colSpan;n++)(r[i]??(r[i]=new Set)).add(n)}function ce(r){let[s,t]=[[],new Map];return Array.from(r.rows).forEach((e,i)=>{let n=0;for(let o of Array.from(e.cells)){for(;s[i]?.has(n);)n++;t.set(o,n),io(s,i,n,o),n+=o.colSpan}}),t}function Vs(r){let t=r.getRootNode().getElementById?.(r.getAttribute("data-column"));return t?.matches(".data-table > table > thead > tr:first-child > th")&&t.colSpan===1?t:null}function so(r,s){let t=[...ce(r.tHead)].filter(([,i])=>i===s).map(([i])=>i),e=r.querySelectorAll(":scope > tbody > tr, :scope > tfoot > tr");return[...t,...Array.from(e,i=>Ks(i,s))].filter(i=>i?.colSpan===1)}function no(r){r.hidden||(r.hidden=!0,r.setAttribute(ji,""))}function ro(r){r.hasAttribute(ji)&&(r.hidden=!1,r.removeAttribute(ji))}function qs(r){let s=Vs(r);if(!s)return;let t=s.closest("table"),e=r.getAttribute("aria-checked")==="true";so(t,ce(t.tHead).get(s)).forEach(e?ro:no),oo(t,s)}function oo(r,s){r.style.tableLayout==="fixed"&&(!s.hidden&&!s.style.width&&(s.style.width=`${Math.max(ni(s)[0],s.scrollWidth)}px`),Yi(r))}function Ws(r){return Array.from(r.rows[0]?.cells??[]).filter(s=>!s.hidden)}function Yi(r){r.style.width=`${Ws(r).reduce((s,t)=>s+parseFloat(t.style.width),0)}px`}function ao(r){if(r.style.tableLayout==="fixed")return;let s=Ws(r),t=s.map(e=>e.getBoundingClientRect().width);s.forEach((e,i)=>e.style.width=`${t[i]}px`),r.style.tableLayout="fixed",Yi(r)}function ni(r){let s=parseFloat(getComputedStyle(r).minWidth)||0;return[s,Math.max(s,r.closest(".data-table").clientWidth)]}function lo(r){let[s,t]=ni(r),e=r.getBoundingClientRect().width;return[s,(s+t)/2,t].find(i=>i>e+1)??s}function co(r,s){let[t,e]=ni(r),i=(s.shiftKey?4:1)*Xr*(getComputedStyle(r).direction==="rtl"?-1:1),n=r.getBoundingClientRect().width;return{ArrowRight:n+i,ArrowLeft:n-i,Home:t,End:e}[s.key]}var f=class f{static Init(){f._initialized||typeof document>"u"||(f._initialized=!0,document.addEventListener("input",f._onChange),document.addEventListener("input",f._onFilter),document.addEventListener("input",f._onPageSize),document.addEventListener("change",f._onPageSize),document.addEventListener("click",f._onClick),document.addEventListener("click",f._onPage),document.addEventListener("pointerdown",f._onPointerDown),document.addEventListener("click",f._onHandleClick),document.addEventListener("keydown",f._onKeyDown),document.addEventListener("expressive:change",f._onToggle),Ve(s=>s.querySelectorAll(".data-table").forEach(f.sync)),u.onDocumentReady(()=>document.querySelectorAll(".data-table").forEach(f.sync)))}static sync(s){let t=s.querySelector(":scope > table");t&&(t.querySelectorAll(`:scope > tbody > tr[${si}]`).forEach(e=>e.removeAttribute(si)),f._pages.get(s)?.server&&t.querySelectorAll(`:scope > tbody > tr[${ke}]`).forEach(e=>e.removeAttribute(ke)),f._filter(s,t),f._page(s,t),f._select(f._all(t),f._enabled(t),!1)),s.getRootNode().querySelectorAll(Fs).forEach(e=>{s.contains(Vs(e))&&qs(e)})}static setPage(s,t){return!s?.matches?.(".data-table:has(> table)")||!f._storePage(s,t)?!1:(f._pageRequests.delete(s),f.sync(s),!0)}static _storePage(s,t){if(t===null)return f._pages.delete(s),!0;if(!t)return!1;let e={page:t.page,pageSize:t.pageSize,total:t.total};return Jr(e)?(s.setAttribute("data-page-size",String(e.pageSize)),f._pages.set(s,{...e,server:!0}),!0):!1}static width(s){return s.getBoundingClientRect().width}static setWidth(s,t){let e=s.closest("table"),[i,n]=ni(s);ao(e),s.style.width=`${Math.round(Math.min(Math.max(t,i),n))}px`,Yi(e)}static _all(s){let t=s.tHead,e='input[type="checkbox"]';return(t&&[...ce(t)].find(([n,o])=>o===0&&n.querySelector(e))?.[0])?.querySelector(e)}static _enabled(s){return f._boxes(s).filter(t=>!t.matches(":disabled")&&ii(t.closest("tr")))}static _boxes(s){return Array.from(s.querySelectorAll(jr),t=>t.querySelector(Yr)).filter(Boolean)}static _filter(s,t){let e=Ui(s,Ns);if(!e)return;let i=u.locale(t),n=f._serverRecords(s)?"":e.value.trim().toLocaleLowerCase(i),a=(t.tHead?[...ce(t.tHead)]:[]).filter(([h])=>h.hasAttribute("data-filter")&&h.colSpan===1).map(([,h])=>h),l=f._records(t);l.forEach(([h])=>h.removeAttribute(ke));let c=l.map(([h])=>ii(h)&&f._matches(h,a,n,i));l.forEach((h,d)=>h.forEach(p=>p.toggleAttribute(ke,!c[d]))),f._filterCount(s,i,c.filter(Boolean).length)}static _filterCount(s,t,e){if(f._serverRecords(s))return;let i=Ui(s,"[data-table-filter-count]");i&&(i.textContent=new Intl.NumberFormat(t).format(e))}static _serverRecords(s){return f._pages.get(s)?.server||f._serverFilters.has(s)}static _matches(s,t,e,i){return!e||t.some(n=>$s(s,n).toLocaleLowerCase(i).includes(e))}static _advancePage(s,t,e){let i=f._pageState(s),n=Wi(i.page+t,i.total,at(s));n<1||n===i.page||f._requestPage(s,{page:n,pageSize:at(s)},e)}static _setPageSize(s,t,e){let i=zs(t);if(!i||!at(s)||i===at(s))return;let n=f._pageState(s),o=Math.max(1,Wi(n.page,n.total,i));f._requestPage(s,{page:o,pageSize:i},e)}static _requestPage(s,t,e){let i=f._pageState(s);f._pageRequests.set(s,e),u.emit(s,"page",t,!0)&&f._pageRequests.get(s)===e&&(i.server||(s.setAttribute("data-page-size",String(t.pageSize)),f._pages.set(s,{...i,...t}),f.sync(s)))}static _pageState(s){let t=f._pages.get(s);if(t)return t;let e=s.querySelector(":scope > table"),i=e?f._records(e).filter(([n])=>ii(n)).length:0;return{page:1,pageSize:at(s),total:i}}static _page(s,t){let e=at(s);if(!e)return;let i=f._records(t),n=i.filter(([c])=>ii(c)),o=f._pageView(s,n.length,e);f._pages.set(s,o);let a=o.server?n:n.slice((o.page-1)*e,o.page*e),l=new Set(a.map(([c])=>c));i.forEach(c=>c.forEach(h=>h.toggleAttribute(si,!l.has(c[0])))),f._pageControls(s,o.page,Math.ceil(o.total/e))}static _pageView(s,t,e){let i=f._pages.get(s)??{page:1,pageSize:e,total:t},n=i.server?i.total:t;return{...i,page:Wi(i.page,n,e),pageSize:e,total:n}}static _pageControls(s,t,e){s.querySelectorAll(Bs).forEach(n=>{if(n.closest(".data-table")!==s)return;let o=n.dataset.tablePage==="previous"?t<=1:t>=e;n.setAttribute("aria-disabled",String(o))});let i=Ui(s,"[data-table-page-status]");if(i){let n=new Intl.NumberFormat(u.locale(s));i.textContent=`${n.format(t)} / ${n.format(e)}`}}static _firstPage(s){at(s)&&f._resetPage(s)}static _resetPage(s){f._pages.get(s)?.server||(f._pages.delete(s),f.sync(s))}static _select(s,t,e){if(!s)return;e&&t.forEach(n=>n.checked=s.checked);let i=t.filter(n=>n.checked).length;s.indeterminate=i%t.length>0,s.checked=i>0&&!s.indeterminate}static _drag(s,t){let e=s.parentElement,i=f.width(e),n=getComputedStyle(e).direction==="rtl"?-1:1;f._dragged=!1,s.setPointerCapture(t.pointerId);let o=R(s),{signal:a}=o;s.addEventListener("pointermove",c=>{let h=c.clientX-t.clientX;Math.abs(h)<4&&!f._dragged||(f._dragged=!0,f.setWidth(e,i+n*h))},{signal:a});let l=()=>{o.abort(),f._dragged&&f._resized(e,i)};s.addEventListener("pointerup",l,{signal:a}),s.addEventListener("pointercancel",l,{signal:a})}static _resizeTo(s,t){let e=f.width(s);f.setWidth(s,t),f._resized(s,e)}static _resized(s,t){let e=f.width(s);if(Math.abs(e-t)<.5)return;let i=ce(s.closest("thead")).get(s);u.emit(s.closest(".data-table"),"resize",{header:s,column:i,width:e})}static _sort(s,t,e,i){if(f._pages.get(s.closest(".data-table"))?.server)return;let n=t.classList.contains("numeric"),o=f._compare(s,t);for(let a of Array.from(s.tBodies)){let l=f._groups(a).map(c=>{let h=$s(c[0],e);return{rows:c,text:h,value:n?Xt(h)??-1/0:0}});l.sort((c,h)=>i*o(c,h)),a.append(...l.flatMap(({rows:c})=>c))}}static _compare(s,t){if(t.classList.contains("numeric"))return(i,n)=>i.value-n.value;let e=new Intl.Collator(u.locale(s),{numeric:!0,sensitivity:"base"}).compare;return(i,n)=>e(i.text,n.text)}static _records(s){return Array.from(s.tBodies).flatMap(f._groups).filter(([t])=>!t.classList.contains("data-table-detail"))}static _groups(s){let t=[];for(let e of Array.from(s.rows))t.length&&e.classList.contains("data-table-detail")?t[t.length-1].push(e):t.push([e]);return t}};f._initialized=!1,f._dragged=!1,f._serverFilters=new WeakMap,f._pages=new WeakMap,f._pageRequests=new WeakMap,f._onChange=s=>{let t=u.closestInPath(s,'input[type="checkbox"]'),e=t?.closest(".data-table"),i=e?.querySelector(":scope > table");if(!i)return;let[n,o]=[f._all(i),f._boxes(i)];t!==n&&!o.includes(t)||(f._select(n,f._enabled(i),t===n),u.emit(e,"change",{selected:o.filter(a=>a.checked).map(a=>a.closest("tr"))}))},f._onFilter=s=>{let t=u.closestInPath(s,`.data-table ${Ns}`);if(!t)return;let e=t.closest(".data-table");f._serverFilters.set(e,s),u.emit(e,"filter",{query:t.value.trim()},!0)&&f._serverFilters.get(e)===s&&(f._serverFilters.delete(e),f._resetPage(e))},f._onPage=s=>{let t=u.closestInPath(s,`.data-table[data-page-size] ${Bs}:not(:disabled, [aria-disabled="true"])`);if(!t)return;let e=t.closest(".data-table");at(e)&&f._advancePage(e,Zr[t.dataset.tablePage],s)},f._onPageSize=s=>{if(!s.composed)return;let t=u.closestInPath(s,`.data-table[data-page-size] ${Qr}`);t&&f._setPageSize(t.closest(".data-table"),t.value,s)},f._onClick=s=>{let t=u.closestInPath(s,'.data-table[data-sort] > table > thead > tr > th > button:not([aria-haspopup], :disabled, [aria-disabled="true"], .drag-handle)');if(!t)return;let e=t.parentElement,i=e.closest(".data-table"),n=e.getAttribute("aria-sort")==="ascending"?"descending":"ascending";e.closest("thead").querySelectorAll("th[aria-sort]").forEach(a=>a.removeAttribute("aria-sort")),e.setAttribute("aria-sort",n);let o=ce(e.closest("thead")).get(e);u.emit(i,"sort",{header:e,column:o,direction:n},!0)&&(f._sort(e.closest("table"),e,o,Gr[n]),f._firstPage(i))},f._onToggle=s=>{let t=s.detail?.item;t?.matches?.(Fs)&&qs(t)},f._onPointerDown=s=>{let t=u.closestInPath(s,Vi);t&&s.button===0&&f._drag(t,s)},f._onHandleClick=s=>{let t=u.closestInPath(s,Vi);if(!t||s.detail!==0&&f._dragged)return;let e=t.parentElement;f._resizeTo(e,lo(e))},f._onKeyDown=s=>{let t=u.closestInPath(s,Vi);if(!t||!u.plainKey(s))return;let e=t.parentElement,i=co(e,s);i!==void 0&&(s.preventDefault(),f._resizeTo(e,i))};var he=f;var mt=".transfer-available",ft=".transfer-chosen",ho=new Map([["add",{from:mt,to:ft,all:!1}],["add-all",{from:mt,to:ft,all:!0}],["remove",{from:ft,to:mt,all:!1}],["remove-all",{from:ft,to:mt,all:!0}]]),O=class O{static Init(){typeof document>"u"||(document.addEventListener("click",O._onClick),document.addEventListener("formdata",O._onFormData,{capture:!0}),document.addEventListener("reset",O._onReset,{capture:!0}))}static _onClick(s){let t=u.closestInPath(s,'.transfer-list [data-transfer]:not(:disabled, [aria-disabled="true"])'),e=ho.get(t?.getAttribute("data-transfer"));e&&O._move(t.closest(".transfer-list"),e)}static _move(s,t){let[e,i]=[t.from,t.to].map(h=>s.querySelector(`:scope > ${h}`)),n=O._boxes(s,t.from).filter(h=>!h.disabled&&(t.all||h.checked));if(!i||!n.length)return;O._record(s);let o=O._starts.get(s),a=new Map([...o.available,...o.chosen].map((h,d)=>[h,d])),l=new Set(n.map(h=>h.closest("li")));n.forEach(h=>h.checked=!1),l.forEach(h=>i.insertBefore(h,O._slot(a,h,i)));let c=[...i.children].filter(h=>l.has(h));O._announce(s,c.length,i),s.dispatchEvent(new CustomEvent("expressive:transfer",{bubbles:!0,detail:{rows:c,from:e,to:i}}))}static _boxes(s,t){return[...s.querySelectorAll(`:scope > ${t} > li > label > input[type="checkbox"]`)]}static _record(s){if(O._starts.has(s))return;let t=e=>[...s.querySelectorAll(`:scope > ${e} > li`)];O._starts.set(s,{available:t(mt),chosen:t(ft)})}static _slot(s,t,e){let i=s.get(t);return!e.matches(mt)||i===void 0?null:O._firstAfter(s,e,i)}static _firstAfter(s,t,e){let i=t.firstElementChild;for(;i&&(s.get(i)??-1)<=e;)i=i.nextElementSibling;return i}static _announce(s,t,e){let i=O._regions.get(s);i||(i=document.createElement("div"),i.className="visually-hidden",i.setAttribute("aria-live","polite"),s.after(i),O._regions.set(s,i)),i.textContent=O.i18n.moved.replace("{count}",String(t)).replace("{list}",O._name(e))}static _name(s){let t=s.getAttribute("aria-label");if(t!==null)return t;let e=s.getRootNode();return(s.getAttribute("aria-labelledby")??"").split(/\s+/).map(n=>e.getElementById(n)?.textContent.trim()).filter(Boolean).join(" ")}static _onFormData(s){let t=s.target.querySelectorAll('.transfer-list:not([data-name=""])[data-name]');for(let e of t)for(let i of O._boxes(e,ft).filter(O._submits))s.formData.append(e.dataset.name,i.value)}static _submits(s){return!s.matches("fieldset[disabled] > :not(legend:first-of-type) *")}static _onReset(s){let t=[...s.target.querySelectorAll(".transfer-list")];setTimeout(()=>{s.defaultPrevented||t.forEach(O._restore)})}static _restore(s){let t=O._starts.get(s);if(!t)return;let e=i=>i.filter(n=>s.contains(n));s.querySelector(`:scope > ${mt}`)?.append(...e(t.available)),s.querySelector(`:scope > ${ft}`)?.append(...e(t.chosen))}};O.i18n={moved:"Moved {count} to {list}"},O._starts=new WeakMap,O._regions=new WeakMap;var ue=O;var uo={},po=["Enter","ArrowDown"],mo=r=>po.includes(r.key)&&u.plainKey(r)&&!u.isComposing(r),_t=class extends b{constructor(t,e){super(t,e);this._observer=null;this._sentinel=null;this._input=null;this._view=null;this._restore=null;this._onIntersect=t=>{let e=t.at(-1);e&&this.el.classList.toggle("collapsed",!e.isIntersecting&&e.boundingClientRect.top<this.el.getBoundingClientRect().top)};this._onSearchFocus=()=>{this._view instanceof HTMLDialogElement||this._openSearch()};this._onSearchKeydown=t=>{!mo(t)||!(this._view instanceof HTMLDialogElement)||(t.preventDefault(),this._openSearch())};this._openSearch=()=>{if(this._view instanceof HTMLDialogElement){this._view.open||this._view.showModal();return}this._restore??(this._restore={hidden:this._view.hidden,expanded:this._input.getAttribute("aria-expanded")}),this._view.hidden=!1,this._input.setAttribute("aria-expanded","true")};this._setupCollapse(),this._setupSearch()}static get defaults(){return uo}destroy(){this._observer?.disconnect(),this._observer=null,this._sentinel?.remove(),this._sentinel=null,this._restore&&(this._view.hidden=this._restore.hidden,w(this._input,"aria-expanded",this._restore.expanded),this._restore=null),this.el.classList.remove("collapsed"),super.destroy()}_setupCollapse(){!this.el.classList.contains("medium")&&!this.el.classList.contains("large")||(this._sentinel=document.createElement("span"),this._sentinel.setAttribute("aria-hidden","true"),this._sentinel.style.cssText="display:block;height:0;position:relative;top:-64px;pointer-events:none;visibility:hidden",this.el.insertAdjacentElement("afterend",this._sentinel),this._observer=new IntersectionObserver(this._onIntersect),this._observer.observe(this._sentinel))}_setupSearch(){if(this._input=this.el.querySelector('input[type="search"]'),!this._input)return;let t=this._input.getAttribute("aria-controls");if(this._view=t&&u.getElementById(this.el,t)||this.el.querySelector(".search-view"),!this._view)return;let{signal:e}=this._events;this._input.addEventListener("focus",this._onSearchFocus,{signal:e}),this._input.addEventListener("click",this._openSearch,{signal:e}),this._input.addEventListener("keydown",this._onSearchKeydown,{signal:e})}};_t.key="Expressive_AppBar";var fo={},gt=class extends b{constructor(t,e){super(t,e);this._addedExpanded=!1;this.open=()=>{this.isOpen||(this.isOpen=!0,this._list&&(this._list.inert=!1),this.el.classList.add("active"),this._anchor?.setAttribute("aria-expanded","true"),document.addEventListener("click",this._handleDocumentClick),document.addEventListener("keydown",this._handleDocumentKeydown))};this.close=()=>{if(!this.isOpen)return;let t=this.el.getRootNode().activeElement;t&&this._list?.contains(t)&&this._anchor?.focus(),this._list&&(this._list.inert=!0),this.isOpen=!1,this.el.classList.remove("active"),this._anchor?.setAttribute("aria-expanded","false"),document.removeEventListener("click",this._handleDocumentClick),document.removeEventListener("keydown",this._handleDocumentKeydown)};this._handleFABClick=t=>{let e=t.target;if(!(e instanceof Element))return;let i=e.closest("a, button");!i||i.matches(':disabled, [aria-disabled="true"]')||(i===this._anchor?this._toggle():this._list?.contains(i)&&this.close())};this._handleAnchorKeydown=t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),this._toggle())};this._handleDocumentKeydown=t=>{t.key==="Escape"&&!t.defaultPrevented&&this.close()};this._handleDocumentClick=t=>{t.composedPath().includes(this.el)||this.close()};this.isOpen=!1,this._anchor=this.el.querySelector(":scope > a, :scope > button"),this._list=this.el.querySelector(":scope > ul, :scope > menu"),this._listWasInert=this._list?.inert??!1,this.el.classList.remove("active"),this._list&&(this._list.inert=!0),this._addedExpanded=!!this._anchor&&!this._anchor.hasAttribute("aria-expanded"),this._anchor?.setAttribute("aria-expanded","false"),this._anchor instanceof HTMLAnchorElement&&!this._anchor.hasAttribute("href")&&((!this._anchor.hasAttribute("tabindex")||this._anchor.tabIndex<0)&&(this._anchorTabIndex=this._anchor.getAttribute("tabindex"),this._anchor.tabIndex=0),this._anchor.addEventListener("keydown",this._handleAnchorKeydown,{signal:this._events.signal})),this.el.addEventListener("click",this._handleFABClick,{signal:this._events.signal})}static get defaults(){return fo}destroy(){this.close(),this._list&&(this._list.inert=this._listWasInert),this._addedExpanded&&this._anchor.removeAttribute("aria-expanded"),this._anchorTabIndex!==void 0&&w(this._anchor,"tabindex",this._anchorTabIndex),super.destroy()}_toggle(){this.isOpen?this.close():this.open()}};gt.key="Expressive_FloatingActionButton";var _o={},go=new Set(["single","multiple"]),Us="button-group-pressed",vo=.15,vt=class extends b{constructor(t,e={}){super(t,e);this._pressedStyles=new Map;this._releaseStyles=new Map;this._releaseTimer=null;this._originalPressed=new Map;this._activeItem=null;this._handleClick=t=>{if(!this._selectionMode)return;let e=this._itemFromEvent(t);if(!(e instanceof HTMLButtonElement)||this._isDisabled(e))return;this._rememberPressed(e);let i=e.getAttribute("aria-pressed")!=="true",n=this._toggleItems.filter(o=>o.getAttribute("aria-pressed")==="true").length;!i&&this.el.hasAttribute("data-selection-required")&&n===1||(this._selectionMode==="single"&&i&&this._toggleItems.forEach(o=>{this._rememberPressed(o),o.setAttribute("aria-pressed","false")}),e.setAttribute("aria-pressed",i?"true":"false"),this._notify("change",null,{detail:{button:e,pressed:i}}))};this._handlePointerDown=t=>{if(t.button!==0)return;let e=this._itemFromEvent(t);e&&!this._isDisabled(e)&&this._startPress(e)};this._handleKeyDown=t=>{if(t.repeat||t.key!==" "&&t.key!=="Enter")return;let e=this._itemFromEvent(t);e&&!this._isDisabled(e)&&this._startPress(e)};this._handleKeyUp=t=>{(t.key===" "||t.key==="Enter")&&this._resetPress()};this._handleFocusOut=t=>{t.target===this._activeItem&&this._resetPress()};this._resetPress=()=>{if(this._activeItem?.classList.remove(Us),this._activeItem=null,!!this._pressedStyles.size){this._finishRelease(),this._releaseStyles=new Map(this._pressedStyles);for(let[t,e]of this._releaseStyles)t.style.width=`${e.baseWidth}px`;this._pressedStyles.clear(),this._releaseTimer=window.setTimeout(this._finishRelease,200)}};this._finishRelease=()=>{this._releaseTimer!==null&&window.clearTimeout(this._releaseTimer),this._releaseTimer=null;for(let[t,e]of this._releaseStyles)t.style.width=e.width;this._releaseStyles.clear()};let{signal:i}=this._events;this._selectionMode&&(this._normalizeSelection(),this.el.addEventListener("click",this._handleClick,{capture:!0,signal:i})),this.el.addEventListener("pointerdown",this._handlePointerDown,{signal:i}),this.el.addEventListener("keydown",this._handleKeyDown,{signal:i}),this.el.addEventListener("focusout",this._handleFocusOut,{signal:i}),document.addEventListener("pointerup",this._resetPress,{signal:i}),document.addEventListener("pointercancel",this._resetPress,{signal:i}),document.addEventListener("keyup",this._handleKeyUp,{signal:i}),window.addEventListener("blur",this._resetPress,{signal:i})}static get defaults(){return _o}destroy(){this._resetPress(),this._finishRelease();for(let[t,e]of this._originalPressed)w(t,"aria-pressed",e);this._originalPressed.clear(),super.destroy()}get _selectionMode(){let t=this.el.dataset.selection;return go.has(t)?t:null}get _items(){return Array.from(this.el.children).filter(t=>t instanceof HTMLButtonElement||t instanceof HTMLAnchorElement&&t.classList.contains("button"))}get _toggleItems(){return this._items.filter(t=>t instanceof HTMLButtonElement)}_normalizeSelection(){let t=this._toggleItems;t.forEach(e=>{this._rememberPressed(e),["true","false"].includes(e.getAttribute("aria-pressed")||"")||e.setAttribute("aria-pressed","false")}),this._selectionMode==="single"&&t.filter(i=>i.getAttribute("aria-pressed")==="true").slice(1).forEach(i=>i.setAttribute("aria-pressed","false")),this.el.hasAttribute("data-selection-required")&&!t.some(e=>e.getAttribute("aria-pressed")==="true")&&t.find(e=>!this._isDisabled(e))?.setAttribute("aria-pressed","true")}_itemFromEvent(t){if(!(t.target instanceof Element))return null;let e=t.target.closest("button, a.button");return e instanceof HTMLElement&&e.parentElement===this.el?e:null}_isDisabled(t){return t instanceof HTMLButtonElement&&t.disabled||t.getAttribute("aria-disabled")==="true"||t.classList.contains("disabled")}_rememberPressed(t){this._originalPressed.has(t)||this._originalPressed.set(t,t.getAttribute("aria-pressed"))}_startPress(t){if(this._activeItem)return;this._finishRelease();let e=this._items,i=e.indexOf(t);if(i<0||(this._activeItem=t,t.classList.add(Us),this.el.classList.contains("connected")||e.length<2))return;let n=e.map(_=>_.getBoundingClientRect()),o=n[i].width;if(o<=0)return;let a=Number.parseFloat(getComputedStyle(this.el).getPropertyValue("--md-comp-button-group-pressed-item-width-multiplier")),l=Number.isFinite(a)?a:.15,c=o*l,h=[i-1,i+1].filter(_=>_>=0&&_<e.length),d=new Map;if(h.length===1){let _=h[0];d.set(_,Math.min(c,this._compressionCapacity(e[_],n[_])))}else{let _=c/2;for(let E of h)d.set(E,Math.min(_,this._compressionCapacity(e[E],n[E])));let m=c-[...d.values()].reduce((E,T)=>E+T,0);for(let E of h){if(m<=0)break;let T=this._compressionCapacity(e[E],n[E])-d.get(E),C=Math.min(m,T);d.set(E,d.get(E)+C),m-=C}}let p=[...d.values()].reduce((_,m)=>_+m,0);p<=0||(e.forEach((_,m)=>{this._pressedStyles.set(_,{width:_.style.width,baseWidth:n[m].width}),_.style.width=`${n[m].width}px`}),this.el.offsetWidth,e.forEach((_,m)=>{let E=m===i?p:-(d.get(m)||0);_.style.width=`${n[m].width+E}px`}))}_compressionCapacity(t,e){let i=t.classList.contains("icon-button")?e.width*(1-vo):e.height;return Math.max(0,e.width-i)}};vt.key="Expressive_ButtonGroup";var bo={duration:200,indicators:!1,noWrap:!1,interval:0,height:null,onCycleTo:null,i18n:{carousel:"Carousel",item:"Item",of:"of",indicators:"Slides",slide:"Slide"}},ri='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])',bt=class extends b{constructor(t,e){super(t,e);this.center=0;this._ownIndicators=!1;this._trackEl=null;this._ignoreScroll=!1;this._alignAfterResize=!1;this._trackRaf=null;this._started=!1;this._vertical=!1;this._resizeObserver=null;this._resizeTimeout=null;this._dragPointerId=null;this._dragStartX=0;this._dragStartY=0;this._dragStartScroll=0;this._suppressClick=!1;this._suppressClickTimeout=null;this._generatedContainerRole=!1;this._generatedContainerLabel=!1;this._generatedContainerDescription=!1;this._generatedWideLayout=!1;this._generatedFixedHeight=!1;this._authoredInlineHeight=null;this._autoAdvanceTimer=null;this._autoAdvances=!1;this._autoPaused=!1;this._hovered=!1;this._focused=!1;this._motion=window.matchMedia("(prefers-reduced-motion: reduce)");this._generatedItemTabIndexes=new Set;this._generatedItemLabels=new Set;this._generatedItemDescriptions=new Set;this._generatedItemSizes=new Set;this._authoredItemSizes=new Set;this._itemA11yOriginal=new Map;this._handleThrottledResize=()=>{!this._started||this._resizeTimeout!==null||(this._handleResize(),this._resizeTimeout=setTimeout(()=>{this._resizeTimeout=null,this._handleResize()},200))};this._handleAutoAdvanceState=t=>{t.type==="mouseenter"?this._hovered=!0:t.type==="mouseleave"?this._hovered=!1:t.type==="focusin"?this._focused=u.eventTarget(t).matches(":focus-visible"):t.type==="focusout"&&(this._focused=this.el.contains(t.relatedTarget)),this._syncAutoAdvance()};this._handleAutoAdvanceKey=()=>{this._focused=!0,this._syncAutoAdvance()};this._handleMotionChange=()=>{this._syncAutoAdvance(),this._motion.matches&&this._scrollToIndex(this.center,!1),this._updateParallax()};this._tick=()=>{this._autoAdvanceTimer=null,this._advance(),this._syncAutoAdvance()};this._advance=()=>{let t=this.center+1;if(t<this.count){this.set(t);return}if(this.options.noWrap){this._autoAdvances=!1,this._syncAutoAdvance();return}this.set(0)};this._handleNativeScroll=()=>{this._alignAfterResize=!1,this._finishScroll()};this._handleTrackPointerDown=t=>{this._handleNativeScroll(),!(t.pointerType!=="mouse"||t.button!==0)&&(this.pressed=!0,this.dragged=!1,this._suppressClick=!1,this._dragPointerId=t.pointerId,this._dragStartX=t.clientX,this._dragStartY=t.clientY,this._dragStartScroll=this._vertical?this._scroller.scrollTop:this._scroller.scrollLeft,this._setDragListeners(!0))};this._handleTrackPointerMove=t=>{if(!this.pressed||t.pointerId!==this._dragPointerId)return;let e=t.clientX-this._dragStartX,i=t.clientY-this._dragStartY,n=this._vertical?i:e,o=this._vertical?e:i;if(!this.dragged){if(Math.abs(n)<6||Math.abs(n)<=Math.abs(o))return;this.dragged=!0,this.el.classList.add("dragging");try{this._scroller.setPointerCapture(t.pointerId)}catch{}}this._vertical?this._scroller.scrollTop=this._dragStartScroll-i:this._scroller.scrollLeft=this._dragStartScroll-e,t.preventDefault()};this._handleTrackPointerUp=t=>{if(!(!this.pressed||t.pointerId!==this._dragPointerId)){this.pressed=!1,this._dragPointerId=null,this._setDragListeners(!1),this.el.classList.remove("dragging");try{this._scroller.releasePointerCapture(t.pointerId)}catch{}this.dragged&&(this._suppressClick=!0,window.clearTimeout(this._suppressClickTimeout),this._suppressClickTimeout=setTimeout(()=>{this._suppressClick=!1},0),this._syncActive(this._nearestIndex(),!0),this.dragged=!1)}};this._handleTrackClick=t=>{this._suppressClick&&(this._suppressClick=!1,t.preventDefault(),t.stopImmediatePropagation())};this._handleTrackDragStart=t=>{t.target.closest("a, img, picture, video")&&t.preventDefault()};this._handleItemResize=t=>{this._alignAfterResize&&!this.pressed&&t.propertyName==="flex-basis"&&this.images.includes(t.target)&&this._scrollToIndex(this.center,!1)};this._handleIndicatorClick=t=>{t.stopPropagation();let e=t.target.closest(".indicator-item");if(!e||!this._indicators.contains(e))return;let i=[...this._indicators.children].indexOf(e);i<0||this._cycleTo(i)};this._handleKeydown=t=>{if(this._keyBelongsElsewhere(t))return;let e=getComputedStyle(this._scroller).direction==="rtl",i=this._vertical?t.key==="ArrowDown":t.key===(e?"ArrowLeft":"ArrowRight"),n=this._vertical?t.key==="ArrowUp":t.key===(e?"ArrowRight":"ArrowLeft");t.key==="Home"?(t.preventDefault(),this.set(0),this._focusItem(0)):t.key==="End"?(t.preventDefault(),this.set(this.count-1),this._focusItem(this.count-1)):i?(t.preventDefault(),this.next(),this._focusItem(this.center)):n&&(t.preventDefault(),this.prev(),this._focusItem(this.center))};this._handleTrackScroll=()=>{this.el.classList.contains("scrolling")||this.el.classList.add("scrolling"),window.clearTimeout(this.scrollingTimeout),this.scrollingTimeout=setTimeout(()=>this.el.classList.remove("scrolling"),120),this._trackRaf===null&&(this._trackRaf=requestAnimationFrame(()=>{this._trackRaf=null;let t=this._ignoreScroll?this.center:this._nearestIndex();this._updateParallax(),t!==this.center&&this._syncActive(t,this.dragged)}))};this._handleResize=()=>{!this._started||!this.images.length||(this._syncAdaptiveMode(),this._syncLayoutRoles(this.center),this.pressed||this._scrollToIndex(this.center,!1),this._updateParallax())};this._finishScroll=()=>{this._ignoreScroll=!1,this._scroller.style.scrollSnapType="",clearTimeout(this._scrollEndTimeout),this._scroller.removeEventListener("scrollend",this._handleScrollEnd)};this._handleScrollEnd=()=>{this._nearestIndex()===this.center&&!this.images.some(t=>t.getAnimations().some(e=>e.playState==="running"))&&this._finishScroll()};if(this._vertical=this.el.classList.contains("full-screen"),this.pressed=!1,this.dragged=!1,this.images=this._collectItems(),!this.images.length){console.error("Carousel: no .carousel-item elements to show");return}this.images.forEach(n=>{this._itemA11yOriginal.set(n,{ariaHidden:n.getAttribute("aria-hidden"),tabIndex:n.getAttribute("tabindex"),active:n.classList.contains("active"),itemClass:n.classList.contains("carousel-item")}),n.hasAttribute("data-carousel-size")&&this._authoredItemSizes.add(n)}),this.hasMultipleSlides=this.images.length>1,this.showIndicators=this.options.indicators&&this.hasMultipleSlides,this.count=this.images.length,this._autoAdvances=this.options.interval>0&&this.hasMultipleSlides,this.images.forEach(n=>n.classList.add("carousel-item")),this.options.height!==null&&(this._generatedFixedHeight=!this.el.classList.contains("fixed-height"),this._authoredInlineHeight=this.el.style.getPropertyValue("--carousel-height")||null,this.el.classList.add("fixed-height"),this.el.style.setProperty("--carousel-height",`${this.options.height}px`)),this._wrapTrack(),this._syncAdaptiveMode(),this.showIndicators&&this._setupIndicators(),this._setupAccessibility(),this._setupEventHandlers(),this._started=!0;let i=Math.max(0,this.images.findIndex(n=>n.classList.contains("active")));this.center=i,this._syncActive(i,!1),this._updateParallax(),this._scrollToIndex(i,!1),this._syncAutoAdvance()}get _scroller(){return this._trackEl??this.el}static get defaults(){return bo}destroy(){this._started&&this._teardown(),super.destroy()}_collectItems(){let t=Array.from(this.el.children).filter(e=>e instanceof HTMLElement&&e.classList.contains("carousel-item"));return t.length?t:Array.from(this.el.children).filter(e=>!(e instanceof HTMLElement)||e.classList.contains("indicators")?!1:e.tagName!=="NAV")}_setupAccessibility(){this.el.hasAttribute("role")||(this.el.setAttribute("role","region"),this._generatedContainerRole=!0),!this.el.hasAttribute("aria-label")&&!this.el.hasAttribute("aria-labelledby")&&(this.el.setAttribute("aria-label",this.options.i18n.carousel),this._generatedContainerLabel=!0),this.el.hasAttribute("aria-roledescription")||(this.el.setAttribute("aria-roledescription","carousel"),this._generatedContainerDescription=!0),this.images.forEach((t,e)=>{if(t.hasAttribute("aria-roledescription")||(t.setAttribute("aria-roledescription","slide"),this._generatedItemDescriptions.add(t)),!t.hasAttribute("aria-label")&&!t.hasAttribute("aria-labelledby")){let i=t.querySelector("img[alt]")?.getAttribute("alt")?.trim(),n=t.textContent?.replace(/\s+/g," ").trim(),o=i||n,a=`${this.options.i18n.item} ${e+1} ${this.options.i18n.of} ${this.count}`;t.setAttribute("aria-label",o?`${o}, ${a}`:a),this._generatedItemLabels.add(t)}!t.matches(ri)&&!t.querySelector(ri)&&(t.tabIndex=0,this._generatedItemTabIndexes.add(t))})}_setupIndicators(){let t=Array.from(this.el.children).find(e=>e instanceof HTMLElement&&e.classList.contains("indicators"));this._indicators=t??document.createElement("nav"),this._ownIndicators=!t,this._indicators.classList.add("indicators"),this._indicators.setAttribute("aria-label",this.options.i18n.indicators),this._indicators.replaceChildren(),this.images.forEach((e,i)=>{let n=document.createElement("button");n.type="button",n.classList.add("indicator-item"),n.setAttribute("aria-label",`${this.options.i18n.slide} ${i+1}`),this._indicators.appendChild(n)}),this._ownIndicators&&this.el.appendChild(this._indicators)}_setupEventHandlers(){let{signal:t}=this._events;this.el.addEventListener("keydown",this._handleKeydown,{signal:t}),this._motion.addEventListener("change",this._handleMotionChange,{signal:t}),this._autoAdvances&&(this.el.addEventListener("mouseenter",this._handleAutoAdvanceState,{signal:t}),this.el.addEventListener("mouseleave",this._handleAutoAdvanceState,{signal:t}),this.el.addEventListener("focusin",this._handleAutoAdvanceState,{signal:t}),this.el.addEventListener("focusout",this._handleAutoAdvanceState,{signal:t}),this.el.addEventListener("keydown",this._handleAutoAdvanceKey,{signal:t}),document.addEventListener("visibilitychange",this._handleAutoAdvanceState,{signal:t})),this.showIndicators&&this._indicators&&this._indicators.addEventListener("click",this._handleIndicatorClick,{signal:t}),this._resizeObserver=new ResizeObserver(()=>this._handleThrottledResize()),this._resizeObserver.observe(this.el),this.el.classList.contains("full-screen")&&window.addEventListener("resize",this._handleThrottledResize,{passive:!0,signal:t}),this._scroller.addEventListener("scroll",this._handleTrackScroll,{passive:!0,signal:t}),this._scroller.addEventListener("pointerdown",this._handleTrackPointerDown,{signal:t}),this._scroller.addEventListener("wheel",this._handleNativeScroll,{passive:!0,signal:t}),this._scroller.addEventListener("click",this._handleTrackClick,{capture:!0,signal:t}),this._scroller.addEventListener("dragstart",this._handleTrackDragStart,{signal:t}),this._scroller.addEventListener("transitionend",this._handleItemResize,{signal:t})}_teardown(){this._started=!1,this._events.abort(),this._resizeObserver?.disconnect(),this._resizeObserver=null,this._finishScroll(),this._autoAdvances=!1,this._syncAutoAdvance(),this._trackRaf!==null&&cancelAnimationFrame(this._trackRaf),window.clearTimeout(this.scrollingTimeout),window.clearTimeout(this._suppressClickTimeout),clearTimeout(this._resizeTimeout),this._ownIndicators&&this._indicators?.remove(),this._unwrapTrack(),this.images.forEach(t=>{t.style.removeProperty("--md-comp-carousel-item-parallax"),this._generatedItemLabels.has(t)&&t.removeAttribute("aria-label"),this._generatedItemDescriptions.has(t)&&t.removeAttribute("aria-roledescription"),this._generatedItemSizes.has(t)&&t.removeAttribute("data-carousel-size"),this._restoreItemState(t)}),this.el.classList.remove("dragging","scrolling"),this._generatedContainerRole&&this.el.removeAttribute("role"),this._generatedContainerLabel&&this.el.removeAttribute("aria-label"),this._generatedContainerDescription&&this.el.removeAttribute("aria-roledescription"),this._generatedFixedHeight&&this.el.classList.remove("fixed-height"),this.options.height!==null&&(this._authoredInlineHeight===null?this.el.style.removeProperty("--carousel-height"):this.el.style.setProperty("--carousel-height",this._authoredInlineHeight)),this._generatedWideLayout&&this.el.classList.remove("multi-wide","multi-large","multi-extra-large","full-screen-horizontal")}_restoreItemState(t){let e=this._itemA11yOriginal.get(t);e&&(w(t,"aria-hidden",e.ariaHidden),w(t,"tabindex",e.tabIndex),t.classList.toggle("active",e.active),e.itemClass||t.classList.remove("carousel-item"))}_syncAutoAdvance(){let t=this._autoAdvances&&!this._autoPaused&&!this._hovered&&!this._focused&&!this._motion.matches&&!document.hidden;t&&this._autoAdvanceTimer===null?this._autoAdvanceTimer=setTimeout(this._tick,this.options.duration+this.options.interval):!t&&this._autoAdvanceTimer!==null&&(clearTimeout(this._autoAdvanceTimer),this._autoAdvanceTimer=null)}_setDragListeners(t){let e=t?"addEventListener":"removeEventListener",i={signal:this._events.signal};document[e]("pointermove",this._handleTrackPointerMove,i),document[e]("pointerup",this._handleTrackPointerUp,i),document[e]("pointercancel",this._handleTrackPointerUp,i)}_keyBelongsElsewhere(t){let e=t.target;return[t.defaultPrevented,t.altKey,t.ctrlKey,t.metaKey,t.shiftKey,e.isContentEditable].some(Boolean)||this.el.contains(e.closest('input, textarea, select, video[controls], audio[controls], [role="slider"], [role="tablist"], [role="menu"]'))}_paintIndicators(t){if(!this.showIndicators||!this._indicators)return;let e=(t%this.count+this.count)%this.count;this._indicators.querySelectorAll(".indicator-item").forEach((i,n)=>{let o=n===e;i.classList.toggle("active",o),o?i.setAttribute("aria-current","true"):i.removeAttribute("aria-current")})}_syncActive(t,e){let i=this.center;this.center=t,this.images.forEach((a,l)=>a.classList.toggle("active",l===t)),this._paintIndicators(t),this._syncLayoutRoles(t);let n=this.images[t],o={item:n,dragged:e};return i!==t&&!this._notify("change",this.options.onCycleTo,{args:[n,e],detail:o,current:()=>this.center===t})?!1:(typeof this.oneTimeCallback=="function"&&(this.oneTimeCallback.call(this,n,e),this.oneTimeCallback=null),!0)}_syncLayoutRoles(t){let e=this.images.map(()=>"large"),i=(n,o)=>{this.images[n]&&(e[n]=o)};if(!(this.el.classList.contains("uncontained")||this.el.classList.contains("full-screen")&&this._vertical))if(this.el.classList.contains("hero")||this.el.classList.contains("full-screen-horizontal"))i(t+1,"small"),this.el.classList.contains("center-aligned")&&i(t-1,"small");else{let n=this.el.clientWidth,o=n>=1600?4:n>=1200?3:n>=600?2:1,a=Math.min(o,Math.max(1,this.count-2));this.el.classList.remove("multi-wide","multi-large","multi-extra-large"),a===2?this.el.classList.add("multi-wide"):a===3?this.el.classList.add("multi-large"):a>=4&&this.el.classList.add("multi-extra-large"),this._generatedWideLayout=this._generatedWideLayout||a>1,i(t+a,"medium"),i(t+a+1,"small")}this.images.forEach((n,o)=>{this._authoredItemSizes.has(n)||(n.setAttribute("data-carousel-size",e[o]),this._generatedItemSizes.add(n))})}_syncAdaptiveMode(){if(!this.el.classList.contains("full-screen"))return;let t=window.matchMedia("(orientation: landscape)").matches,e=this.el.clientWidth>=840||t,i=this._vertical;this._vertical=!e,this.el.classList.toggle("full-screen-horizontal",e),this._generatedWideLayout=this._generatedWideLayout||e,this._started&&i!==this._vertical&&this._scroller.scrollTo({left:0,top:0,behavior:"auto"})}_focusItem(t){let e=this.images[t];if(!e)return;((e.matches(ri)?e:e.querySelector(ri))??e).focus({preventScroll:!0})}_updateParallax(){if(this._motion.matches){this.images.forEach(o=>o.style.setProperty("--md-comp-carousel-item-parallax","0px"));return}let t=this._scroller.getBoundingClientRect(),e=this._vertical?t.top+t.height/2:t.left+t.width/2,i=Math.max(1,this._vertical?t.height:t.width),n=this.images.map(o=>o.getBoundingClientRect());this.images.forEach((o,a)=>{let l=n[a],c=this._vertical?l.top+l.height/2:l.left+l.width/2,h=Math.max(-1,Math.min(1,(c-e)/i));o.style.setProperty("--md-comp-carousel-item-parallax",`${h*-24}px`)})}_wrapTrack(){let t=document.createElement("div");t.className="carousel-track",this.images[0].before(t),this.images.forEach(e=>t.appendChild(e)),this._trackEl=t}_unwrapTrack(){this._trackEl&&(this.images.forEach(t=>this.el.insertBefore(t,this._trackEl)),this._trackEl.remove(),this._trackEl=null)}_nearestIndex(){let t=this.el.classList.contains("center-aligned"),e=getComputedStyle(this._scroller),i=!this._vertical&&e.direction==="rtl",n=this._vertical?this._scroller.scrollTop:this._scroller.scrollLeft,o=this._vertical?this._scroller.clientHeight:this._scroller.clientWidth,a=(this._vertical?this._scroller.scrollHeight:this._scroller.scrollWidth)-o,l=parseFloat(this._vertical?e.paddingBlockStart:e.paddingInlineStart)||0,c=this.center,h=1/0,d=1/0;return this.images.forEach((p,_)=>{let m=this._vertical?p.offsetTop:p.offsetLeft,E=this._vertical?p.offsetHeight:p.offsetWidth,T=t?m-(o-E)/2:m+(i?E-o+l:-l),C=Math.max(i?-a:0,Math.min(i?0:a,T)),g=Math.abs(C-n);_===this.center&&(d=g),g<h&&(h=g,c=_)}),d-h<=1?this.center:c}_scrollToIndex(t,e=!0){let i=this.images[t];if(!i)return;this._finishScroll();let n=this.el.classList.contains("center-aligned"),o=getComputedStyle(this._scroller),a=Number.parseFloat(o.paddingInlineStart)||0,l=Number.parseFloat(o.paddingBlockStart)||0,c=n?i.offsetLeft-(this._scroller.clientWidth-i.offsetWidth)/2:o.direction==="rtl"?i.offsetLeft+i.offsetWidth-this._scroller.clientWidth+a:i.offsetLeft-a,h=i.offsetTop-l;this._ignoreScroll=!0,this._scroller.style.scrollSnapType="none",this._scroller.scrollTo({left:this._vertical?0:c,top:this._vertical?h:0,behavior:e&&!this._motion.matches?"smooth":"instant"}),this._scroller.addEventListener("scrollend",this._handleScrollEnd),this._scrollEndTimeout=setTimeout(this._finishScroll,this.options.duration+350)}_cycleTo(t,e=null){this._alignAfterResize=!0,typeof e=="function"&&(this.oneTimeCallback=e),this._syncActive(t,!1)&&this._scrollToIndex(t)}pause(){this._autoPaused=!0,this._syncAutoAdvance()}start(){this._autoPaused=!1,this._syncAutoAdvance()}next(t=1){isNaN(t)&&(t=1);let e=this.center+t;e>=this.count||e<0||this._cycleTo(e)}prev(t=1){isNaN(t)&&(t=1);let e=this.center-t;e>=this.count||e<0||this._cycleTo(e)}set(t,e){(t===void 0||isNaN(t))&&(t=0),!(t>=this.count||t<0)&&this._cycleTo(t,e)}};bt.key="Expressive_Carousel";var Eo=Object.freeze({}),Ae=class extends b{constructor(t,e){super(t,e);this.updateCounter=()=>{let t=parseInt(this.el.getAttribute("maxlength")),e=this.el.value.length;this.isValidLength=e<=t;let i=e.toString();t&&(i+="/"+t,this._validateInput()),this.counterEl.textContent=i};this.isInvalid=!1,this.isValidLength=!1,this._setupCounter(),this._setupEventHandlers(),this.updateCounter()}static get defaults(){return Eo}destroy(){super.destroy(),this._removeCounter(),this.isInvalid&&this.el.classList.remove("invalid")}_setupEventHandlers(){let t={capture:!0,signal:this._events.signal};this.el.addEventListener("focus",this.updateCounter,t),this.el.addEventListener("input",this.updateCounter,t),B(this.el,this.updateCounter,this._events.signal)}_setupCounter(){this.counterEl=document.createElement("span"),this.counterEl.classList.add("character-counter"),this.counterEl.setAttribute("aria-live","polite"),this.counterEl.setAttribute("aria-atomic","true"),this.counterEl.style.fontSize="12px",this.counterEl.style.height="1",this.el.parentElement.appendChild(this.counterEl)}_removeCounter(){this.counterEl.remove()}_validateInput(){this.isValidLength&&this.isInvalid?(this.isInvalid=!1,this.el.classList.remove("invalid")):!this.isValidLength&&!this.isInvalid&&(this.isInvalid=!0,this.el.classList.remove("valid"),this.el.classList.add("invalid"))}};Ae.key="Expressive_CharacterCounter";var yo=Object.freeze({}),js={0:/[0-9]/,a:/\p{L}/u,"*":/[0-9\p{L}]/u},To={deleteContentBackward:-1,deleteContentForward:1},Lo=r=>r.isComposing||!r.cancelable?void 0:To[r.inputType],xo=r=>(r.match(/\\[^]|[^]/gu)??[]).map(s=>js[s]?{accepts:js[s]}:{literal:s.slice(-1)});function wo(r,s,t){if(r[s]?.literal===t)return s;let e=r.findIndex((i,n)=>n>=s&&"accepts"in i);return e<0?r.length:e}function Mo(r,s,t,e){let i=wo(r,s,t),n=r[i];return n?"literal"in n?i+1:n.accepts.test(t)?(e.push(t),i+1):s:s}function oi(r,s,t){let e=[],i=0,n=0,o=0;for(let a of s){for(let l of a.normalize("NFKC"))i=Mo(r,i,l,e);n+=a.length,n<=t&&(o=e.length)}return{chars:e,before:o}}function Ys(r,s){let t="",e="",i=[];for(let n of r){if(i.length===s.length)break;"literal"in n?e+=n.literal:(t+=e+s[i.length],e="",i.push(t.length))}return{text:t,ends:i}}var Et=class extends b{constructor(t,e){super(t,e);this._onInput=t=>{t.isComposing||this._format()};this._onBeforeInput=t=>{let e=Lo(t),i=e&&this.el.selectionStart===this.el.selectionEnd?this._acrossLiteral(e):-1;i<0||(t.preventDefault(),this._remove(i,t.inputType))};this._format=()=>{let t=this._rewrite();t!==null&&this.el.ownerDocument.activeElement===this.el&&this.el.setSelectionRange(t,t)};if(this._tokens=xo(t.dataset.mask??""),!this._tokens.some(n=>"accepts"in n))return;let i=this._events.signal;t.addEventListener("input",this._onInput,{capture:!0,signal:i}),t.addEventListener("compositionend",this._format,{signal:i}),t.addEventListener("beforeinput",this._onBeforeInput,{signal:i}),B(t,()=>this._rewrite(),i),this._rewrite()}static get defaults(){return yo}_acrossLiteral(t){let{selectionStart:e,value:i}=this.el,n=oi(this._tokens,i,e),o=n.before+Math.min(t,0);return oi(this._tokens,i,e+t).before===n.before&&o in n.chars?o:-1}_remove(t,e){let{chars:i}=oi(this._tokens,this.el.value,0);i.splice(t,1);let{text:n,ends:o}=Ys(this._tokens,i);this.el.value=n;let a=o[t-1]??0;this.el.setSelectionRange(a,a),this.el.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0,inputType:e}))}_rewrite(){let t=this.el,{chars:e,before:i}=oi(this._tokens,t.value,t.selectionEnd??t.value.length),{text:n,ends:o}=Ys(this._tokens,e);return n===t.value?null:(t.value=n,o[i-1]??0)}};Et.key="Expressive_InputMask";var Co={onOpen:null,onClose:null,i18n:{showLess:"Show less"}},Xs=["-webkit-line-clamp","line-clamp"],Gs=["aria-expanded","aria-controls","hidden"];function So(r){let s=r.ownerDocument.createTreeWalker(r,NodeFilter.SHOW_TEXT),t=null;for(let e=s.nextNode();e;e=s.nextNode())e.textContent.trim()&&!e.parentElement.closest('[aria-hidden="true"]')&&(t=e);return t}var ai=class ai extends b{constructor(t,e){super(t,e);this.isOpen=!1;this._initial={};this._initialId=null;this._label=null;this._moreLabel="";this._observer=null;this.open=()=>{this.isOpen||!this._wired||(this._show(!0),this._notify("open",this.options.onOpen,{current:()=>this.isOpen}))};this.close=()=>{this.isOpen&&(this._show(!1),this._notify("close",this.options.onClose,{current:()=>!this.isOpen}))};this._toggle=()=>this.isOpen?this.close():this.open();this._fit=()=>{this.isOpen||this.button.matches(":focus")||ai.getInstance(this.el)!==this||(this.button.hidden=this.text.scrollHeight-this.text.clientHeight<=1)};if(this.text=t.querySelector(":scope > :is(.line-clamp-1, .line-clamp-2, .line-clamp-3)"),this.button=t.querySelector(":scope > button"),!this.text||!this.button)return;this._wire();let{signal:i}=this._events;this.button.addEventListener("click",this._toggle,{signal:i}),this.button.addEventListener("blur",this._fit,{signal:i}),this._observer=new ResizeObserver(this._fit),this._observer.observe(this.text),t.ownerDocument.fonts?.ready.then(this._fit)}static get defaults(){return Co}destroy(){if(this._wired){this._observer.disconnect(),this.isOpen&&this._show(!1);for(let t of Gs)w(this.button,t,this._initial[t]);w(this.text,"id",this._initialId)}super.destroy()}_wire(){for(let t of Gs)this._initial[t]=this.button.getAttribute(t);this._initialId=this.text.getAttribute("id"),this.text.id||(this.text.id=`show-more-${u.guid()}`),this._label=So(this.button),this._label&&(this._moreLabel=this._label.data),this.button.ariaExpanded="false",this.button.setAttribute("aria-controls",this.text.id)}get _wired(){return!!(this.text&&this.button)}_show(t){this.isOpen=t,this.button.ariaExpanded=String(t),this._label&&(this._label.data=t?this._lessLabel():this._moreLabel),this._clamp(!t)}_lessLabel(){return this.button.dataset.showLess||this.options.i18n.showLess}_clamp(t){if(t)this._restoreClamp();else for(let e of Xs)this.text.style.setProperty(e,"unset")}_restoreClamp(){for(let t of Xs)this.text.style.removeProperty(t);this.text.style.length||this.text.removeAttribute("style")}};ai.key="Expressive_ShowMore";var de=ai;var ko={enterDelay:500,exitDelay:300},Zs=new WeakMap,yt=class extends b{constructor(t,e){super(t,e);this._shown=!1;this._holds=new Set;this._anchorName=`--hover-card-${u.guid()}`;this.open=()=>{clearTimeout(this._timeout),!(!this.cardEl||this._shown)&&(Zs.get(this.cardEl)?.close(),this.cardEl.showPopover.call(this.cardEl,{source:this.el}),Zs.set(this.cardEl,this),this._shown=!0,this._listenForEscape(!0),this._anchor(!0),this._notify("open"))};this.close=()=>{clearTimeout(this._timeout),this._shown&&(this.cardEl.hidePopover(),this._hidden(),this._notify("close"))};this._handlePointerEnter=t=>{t.pointerType!=="touch"&&this._hold("pointer")};this._handlePointerLeave=t=>{t.pointerType!=="touch"&&this._release("pointer")};this._handleLinkFocus=()=>{this.el.matches(":focus-visible")&&this._hold("focus")};this._handleCardEnter=t=>{this._shown&&this._handlePointerEnter(t)};this._handleCardFocus=()=>{this._shown&&this._hold("focus")};this._handleFocusOut=t=>{let e=t.relatedTarget;(!e||!(this.el.contains(e)||this.cardEl.contains(e)))&&this._release("focus")};this._handleKeydown=t=>{t.key!=="Escape"||u.isComposing(t)||(u.focusIsIn(this.el,this.cardEl)&&this._takeEscape(t),this.close())};this._handleToggle=t=>{t.newState!=="closed"||!this._shown||(this._hidden(),this._notify("close"))};if(this.cardEl=u.getElementById(t,t.getAttribute("aria-details")??""),!this.cardEl){console.error("HoverCard: aria-details names no element; the link shows no card.");return}let{signal:i}=this._events;this.cardEl.addEventListener("toggle",this._handleToggle,{signal:i});for(let n of[this.el,this.cardEl])n.addEventListener("pointerleave",this._handlePointerLeave,{signal:i}),n.addEventListener("focusout",this._handleFocusOut,{signal:i});this.el.addEventListener("pointerenter",this._handlePointerEnter,{signal:i}),this.cardEl.addEventListener("pointerenter",this._handleCardEnter,{signal:i}),this.el.addEventListener("focus",this._handleLinkFocus,{signal:i}),this.cardEl.addEventListener("focusin",this._handleCardFocus,{signal:i})}static get defaults(){return ko}destroy(){clearTimeout(this._timeout),this._shown&&(this.cardEl.hidePopover(),this._hidden()),super.destroy()}_hidden(){this._shown=!1,this._listenForEscape(!1),this._anchor(!1)}_anchor(t){u.setAnchorName(this.el,this._anchorName,t),t?this.cardEl.style.setProperty("position-anchor",this._anchorName):this.cardEl.style.removeProperty("position-anchor");for(let e of[this.el,this.cardEl])e.getAttribute("style")||e.removeAttribute("style")}_schedule(){clearTimeout(this._timeout);let t=this._holds.size>0;if(t===this._shown)return;let[e,i]=t?[this.open,this.options.enterDelay]:[this.close,this.options.exitDelay];this._timeout=setTimeout(e,i)}_hold(t){this._holds.add(t),this._schedule()}_release(t){this._holds.delete(t),this._schedule()}_listenForEscape(t){let e=this.el.ownerDocument;t?e.addEventListener("keydown",this._handleKeydown,{capture:!0,signal:this._events.signal}):e.removeEventListener("keydown",this._handleKeydown,!0)}_takeEscape(t){t.preventDefault(),t.stopPropagation(),u.focusIsIn(this.cardEl)&&this.el.focus()}};yt.key="Expressive_HoverCard";var Ao=Object.freeze({i18n:Object.freeze({invalid:"Enter an amount."})}),Io="9876543210";function Ho(r,s,t){if(r.length-s!==4)return!1;let e=r[s],i=r.slice(0,s).replace(/^\D+|\d/g,"");return i.split(e).join("")?!1:i.includes(e)||!t.includes(e)}function Oo(r,s,t){let e=Math.max(r.lastIndexOf("."),r.lastIndexOf(",")),i=r.slice(e+1);return e>=0&&i.length<=s&&!Ho(r,e,t)?[r.slice(0,e),i]:[r,""]}function Do(r){return r.flatMap(s=>s.formatToParts(1.5).filter(t=>t.type==="decimal").map(t=>t.value))}function Po(r,s,t){let e=r.replace(/[^\d.,]/g,"").replace(/[.,]+$/,"");if(!/\d/.test(e))return null;let[i,n]=Oo(e,s,t);return(/^\D*[-−]/.test(r)?-1:1)*+`${i.replace(/[.,]/g,"")}.${n}`}var Tt=class extends b{constructor(t,e){super(t,e);this._format=()=>{this._show(this.value)};this._onChange=()=>{this.el.matches(":focus")||this._format()};this._onFocus=()=>{let t=this.value;if(t===null)return;let e=this._edit.format(t);this.el.value=e,this.el.setSelectionRange(e.length,e.length)};this._validate=()=>{let{el:t}=this,e=t.value.trim()!==""&&this.value===null;t.setCustomValidity(e?this.options.i18n.invalid:"")};this._onFormData=t=>{this._submitsTo(t.target)&&t.formData.set(this.el.name,String(this.value??this.el.value))};let i=u.locale(t);try{this._display=new Intl.NumberFormat(i,{style:"currency",currency:t.dataset.currency})}catch{return}this._digits=this._display.resolvedOptions().maximumFractionDigits,this._edit=new Intl.NumberFormat(i,{useGrouping:!1,maximumFractionDigits:this._digits}),this._plain=new Intl.NumberFormat("en",{useGrouping:!1,maximumFractionDigits:this._digits}),this._native=new Intl.NumberFormat(i,{useGrouping:!1}).format(9876543210);let n=Do([this._display,this._edit]);this._marks=Object.fromEntries(n.filter(a=>!".,".includes(a)).map(a=>[a,"."])),this._decimals=n.map(a=>this._marks[a]??a);let o=this._events.signal;t.addEventListener("change",this._onChange,{capture:!0,signal:o}),t.addEventListener("blur",this._format,{signal:o}),t.addEventListener("focus",this._onFocus,{signal:o}),t.addEventListener("input",this._validate,{signal:o}),Hi(t).addEventListener("formdata",this._onFormData,{capture:!0,signal:o}),B(t,()=>this._start(),o),this._start()}static get defaults(){return Ao}get value(){return this._round(this._read(this.el.value))}_read(t){let e=Array.from(t.normalize("NFKC"),i=>this._marks[i]??Io[this._native.indexOf(i)]??i);return Po(e.join(""),this._digits,this._decimals)}_round(t){return t===null?null:Number(this._plain.format(t))}_start(){let t=this.el.value,e=Number(t);this._show(this._round(t.trim()&&Number.isFinite(e)?e:this._read(t)))}_show(t){t!==null&&(this.el.value=this._display.format(t)),this._validate()}_submitsTo(t){let{el:e}=this;return t===e.form&&e.name!==""&&!e.matches(":disabled")}destroy(){super.destroy(),this.el.setCustomValidity("")}};Tt.key="Expressive_CurrencyInput";var Ro="expressive-cascader-control",Xi=["readonly","role","aria-haspopup","aria-expanded","aria-controls","aria-required","aria-invalid"],Fo=["Enter"," ","ArrowDown"],No={ArrowLeft:"ArrowRight",ArrowRight:"ArrowLeft"},Bo=" / ",$o=r=>Array.from(r.childNodes,s=>s.nodeName==="UL"?" ":s.textContent).join("").replace(/\s+/g," ").trim();function Js(r,s){return r?Array.from(r.querySelectorAll(":scope > li"),t=>{let e={value:t.dataset.value??"",label:$o(t),parent:s,children:[],source:t};return e.children=Js(t.querySelector(":scope > ul"),e),e}):[]}var qo=(r,s)=>r.length===s.length&&r.every((t,e)=>t===s[e]),tn=r=>r.flatMap(s=>[s,...tn(s.children)]);function zo(r){let s=[];for(let t=r;t;t=t.parent)s.unshift(t);return s}var Qs={i18n:{required:"Choose an option."}},Lt=class extends b{constructor(t,e={}){super(t,e);this._path=[];this.isOpen=!1;this._open=[];this._columns=[];this._nodes=new Map;this._rendered=new Map;this._insidePress=null;this._openEvents=null;this._stampedLabel=null;this._ids=0;this._initialPath=[];this._control=null;this._formName="";this._required=!1;this._keys={ArrowDown:(t,e)=>this._move(t,e),ArrowUp:(t,e)=>this._move(t,e),Home:(t,e)=>this._move(t,e),End:(t,e)=>this._move(t,e),ArrowRight:t=>this._forward(t),ArrowLeft:t=>this._back(t),Enter:t=>this._activate(t)," ":t=>this._activate(t),Escape:()=>this._dismiss(),Tab:()=>this._dismiss()};this._handleInputKeydown=u.ignoringComposition(t=>{this.isOpen||!Fo.includes(t.key)||(t.preventDefault(),this.open())});this._handleOptionKeydown=t=>{let e=t.target.closest('[role="option"]'),i=e&&this._keys[this._keyName(t)];!i||!u.plainKey(t)||(t.preventDefault(),i(e,t))};this._handleInvalid=()=>{this.input.setAttribute("aria-invalid","true")};this._handleInputClick=()=>{this.isOpen?this.close():this.open()};this._handleOptionClick=t=>{let e=t.target.closest('[role="option"]');e&&(this._focus(e),this._pick(e))};this._handleInsidePointer=t=>{this._insidePress=t};this._handleOutsidePointer=t=>{t!==this._insidePress&&this.close()};if(this.input=this.el.querySelector(":scope > input"),this._options=Js(this.el.querySelector(":scope > .cascader-options"),null),!this.input)return;this._saved=Xi.map(n=>this.input.getAttribute(n)),this.popover=document.createElement("div"),this.popover.id=`cascader-${u.guid()}`,this.popover.className="cascader-popover",this.popover.setAttribute("popover","manual"),this.popover.setAttribute("role","dialog"),this.el.append(this.popover),this._labelledBy=this.input.getAttribute("aria-labelledby")??this._labelId(),this._name(this.popover),this.input.readOnly=!0,this.input.setAttribute("role","combobox"),this.input.setAttribute("aria-haspopup","dialog"),this.input.setAttribute("aria-expanded","false"),this.input.setAttribute("aria-controls",this.popover.id),this._path=this._initialPath=this._startingPath(),this._show(),this._takeName();let{signal:i}=this._events;this.input.addEventListener("click",this._handleInputClick,{signal:i}),this.input.addEventListener("keydown",this._handleInputKeydown,{signal:i}),this.popover.addEventListener("click",this._handleOptionClick,{signal:i}),this.popover.addEventListener("keydown",this._handleOptionKeydown,{signal:i})}static get defaults(){return Qs}get value(){return this._path.map(t=>t.value)}open(){this.isOpen||this.input.matches(":disabled")||(this.isOpen=!0,this._columns=[this._addColumn(this._options,null)],this._open=[],this._path.forEach((t,e)=>this._choose(e,t)),this._showPopover(),this._focus(this._optionFor(this._path.at(-1))??this._columns[0].querySelector('[role="option"]')))}close(){this.isOpen&&(this.isOpen=!1,this._openEvents.abort(),this.popover.hidePopover?.(),this.popover.replaceChildren(),this._columns=[],this._nodes.clear(),this._rendered.clear(),this.input.setAttribute("aria-expanded","false"))}destroy(){this.input&&(this.close(),this._giveNameBack(),this._stampedLabel?.removeAttribute("id"),this.popover.remove(),Xi.forEach((t,e)=>w(this.input,t,this._saved[e]))),super.destroy()}_startingPath(){return zo(tn(this._options).find(t=>!t.children.length&&t.source.hasAttribute("data-selected")))}_showPopover(){this.popover.showPopover?.({source:this.input}),this.input.setAttribute("aria-expanded","true"),this._openEvents=R(this.el);let{signal:t}=this._openEvents;this.el.addEventListener("pointerdown",this._handleInsidePointer,{signal:t}),document.addEventListener("pointerdown",this._handleOutsidePointer,{signal:t})}_labelId(){let t=this.input.labels?.[0];return t?(t.id||(t.id=`${this.popover.id}-label`,this._stampedLabel=t),t.id):null}_name(t){this._labelledBy?t.setAttribute("aria-labelledby",this._labelledBy):w(t,"aria-label",this.input.getAttribute("aria-label"))}_addColumn(t,e){let i=document.createElement("ul");return i.setAttribute("role","listbox"),e?i.setAttribute("aria-labelledby",this._optionFor(e).id):this._name(i),i.append(...t.map(n=>this._addOption(n))),i.firstElementChild?.setAttribute("tabindex","0"),this.popover.append(i),i}_addOption(t){let e=document.createElement("li");if(e.id=`${this.popover.id}-${this._ids++}`,e.setAttribute("role","option"),e.setAttribute("aria-selected","false"),e.tabIndex=-1,e.textContent=t.label,t.children.length){let i=document.createElement("span");i.className="cascader-chevron",i.setAttribute("aria-hidden","true"),e.append(i)}return this._nodes.set(e,t),this._rendered.set(t,e),e}_optionFor(t){return this._rendered.get(t)}_choose(t,e){this._open=[...this._open.slice(0,t),e],this._columns.splice(t+1).forEach(i=>i.remove()),this._columns[t].querySelectorAll('[role="option"]').forEach(i=>{let n=this._nodes.get(i)===e;i.setAttribute("aria-selected",String(n)),i.setAttribute("tabindex",n?"0":"-1")}),e.children.length&&this._columns.push(this._addColumn(e.children,e))}_focus(t){t instanceof HTMLElement&&(t.parentElement.querySelectorAll('[tabindex="0"]').forEach(e=>e.setAttribute("tabindex","-1")),t.tabIndex=0,t.focus())}_takeName(){this._formName=this.input.getAttribute("name")??"",this._formName&&Xe()&&this._wrap()}_wrap(){this._required=this.input.required,this.input.required=!1,this._required&&this.input.setAttribute("aria-required","true"),this._control=Ge(Ro,this.input,()=>this._sync()),this._control.onFormReset=()=>this._reset(),this._control.addEventListener("invalid",this._handleInvalid,{signal:this._events.signal}),this._sync()}_sync(){if(!this._control)return;let t=new FormData;this.value.forEach(e=>t.append(this._formName,e)),this._control.internals.setFormValue(t),this._validate()}_validate(){let t=this._required&&!this._path.length;this._control.internals.setValidity({valueMissing:t},t?this._requiredMessage:"",this.input),t||w(this.input,"aria-invalid",this._saved[Xi.indexOf("aria-invalid")])}get _requiredMessage(){return this.options.i18n.required||Qs.i18n.required}_reset(){this.close(),this._path=this._initialPath,this._show(),this._sync()}_giveNameBack(){this._control&&(Ze(this._control,this.input),this._control=null,this.input.required=this._required)}_commit(){let t=!qo(this._open,this._path);this._path=this._open,this._show(),this._sync(),this.close(),this.input.focus(),t&&(this.input.dispatchEvent(new Event("input",{bubbles:!0})),this.input.dispatchEvent(new Event("change",{bubbles:!0})))}_pick(t){if(this.input.matches(":disabled"))return this.close();let e=this._nodes.get(t);this._choose(this._columns.indexOf(t.parentElement),e),e.children.length||this._commit()}_forward(t){this._nodes.get(t).children.length&&this._enter(t)}_activate(t){this._nodes.get(t).children.length?this._enter(t):this._pick(t)}_enter(t){this._pick(t),this._focus(this._columns.at(-1)?.firstElementChild)}_back(t){let e=this._columns.indexOf(t.parentElement);e>0&&this._focus(this._optionFor(this._open[e-1]))}_dismiss(){this.close(),this.input.focus()}_move(t,e){this._focus(u.focusTarget(Array.from(t.parentElement.children),e,{ArrowDown:1,ArrowUp:-1}))}_keyName(t){return getComputedStyle(this.el).direction==="rtl"?No[t.key]??t.key:t.key}_show(){this.input.value=this._path.map(t=>t.label).join(Bo)}};Lt.key="Expressive_Cascader";var Ko={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,origin:{x:.5,y:.5},colors:[],shapes:["square","circle"],scalar:1,manualStart:!1},Vo=["primary","secondary","tertiary","primary-container","secondary-container","tertiary-container"],Wo=["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],en=Math.PI/180,li=new Map,z=null,ci=class ci extends b{constructor(t,e){super(t,e);this._onClick=()=>{this.fire()};t instanceof HTMLCanvasElement?this.options.manualStart||this.fire():t.addEventListener("click",this._onClick,{signal:this._events.signal})}static get defaults(){return Ko}static fire(t={}){return Gi(sn,document.body,{...ci.defaults,...Me(t)})}fire(t={}){let e={...this.options,...Me(t)};if(this.el instanceof HTMLCanvasElement){let n=this.el;return Gi(()=>n,n.parentElement??document.body,e)}let i=this.el.getBoundingClientRect();return e.origin={x:(i.left+i.width/2)/innerWidth,y:(i.top+i.height/2)/innerHeight},Gi(sn,this.el.parentElement??document.body,e)}destroy(){this.el instanceof HTMLCanvasElement&&rn(this.el),super.destroy()}};ci.key="Expressive_Confetti";var pe=ci;function Gi(r,s,t){if(matchMedia("(prefers-reduced-motion: reduce)").matches)return Promise.resolve();let e=r(),i=li.get(e);if(!i){let d=e.getContext("2d");if(!d)return Promise.resolve();i={ctx:d,pieces:[],frame:0,last:0,done:[],overlay:e===z},li.set(e,i)}let{width:n,height:o}=on(e),a=t.colors.length?t.colors:jo(s),l=(t.origin.x??.5)*n,c=(t.origin.y??.5)*o;for(let d=0;d<t.particleCount;d++)i.pieces.push({x:l,y:c,velocity:t.startVelocity*(.5+Math.random()),angle:-t.angle*en+(.5-Math.random())*t.spread*en,wobble:Math.random()*10,wobbleSpeed:.05+Math.random()*.05,tilt:(.25+Math.random()/2)*Math.PI,tick:0,color:a[d%a.length],shape:t.shapes[Math.floor(Math.random()*t.shapes.length)]??"square",options:t});let h=i;return h.frame||(h.frame=requestAnimationFrame(d=>{h.last=d,nn(e,h,d)})),new Promise(d=>h.done.push(d))}function nn(r,s,t){let e=Math.min((t-s.last)/16.666666666666668,4);s.last=t;let{width:i,height:n}=on(r),{ctx:o}=s,a=r.width/(i||1);o.setTransform(1,0,0,1,0,0),o.clearRect(0,0,r.width,r.height),s.pieces=s.pieces.filter(l=>{let c=l.options;if(l.x+=(Math.cos(l.angle)*l.velocity+c.drift)*e,l.y+=(Math.sin(l.angle)*l.velocity+c.gravity*3)*e,l.velocity*=c.decay**e,l.wobble+=l.wobbleSpeed*e,l.tilt+=.1*e,l.tick+=e,l.tick>=c.ticks)return!1;let h=8*c.scalar;return o.setTransform(a,0,0,a,0,0),o.translate(l.x+10*c.scalar*Math.cos(l.wobble),l.y+10*c.scalar*Math.sin(l.wobble)),o.rotate(l.tilt),o.scale(1,Math.cos(l.wobble)),o.globalAlpha=1-l.tick/c.ticks,o.fillStyle=l.color,o.beginPath(),l.shape==="circle"?o.arc(0,0,h/2,0,2*Math.PI):l.shape==="star"?Uo(o,h*.75):o.rect(-h/2,-h/2,h,h),o.fill(),!0}),s.pieces.length?s.frame=requestAnimationFrame(l=>nn(r,s,l)):rn(r)}function rn(r){let s=li.get(r);if(s){cancelAnimationFrame(s.frame),li.delete(r),s.ctx.setTransform(1,0,0,1,0,0),s.ctx.clearRect(0,0,r.width,r.height),s.overlay&&(r.remove(),z===r&&(z=null));for(let t of s.done)t()}}function Uo(r,s){for(let t=0;t<10;t++){let e=t*Math.PI/5-Math.PI/2,i=t%2?s/2:s;r.lineTo(Math.cos(e)*i,Math.sin(e)*i)}r.closePath()}function on(r){let s=r.clientWidth,t=r.clientHeight,e=Math.round(s*devicePixelRatio),i=Math.round(t*devicePixelRatio);return(r.width!==e||r.height!==i)&&(r.width=e,r.height=i),{width:s,height:t}}function sn(){return z?.isConnected||(z=document.createElement("canvas"),z.className="confetti-overlay",z.setAttribute("aria-hidden","true"),Object.assign(z.style,{position:"fixed",inset:"0",width:"100%",height:"100%",margin:"0",padding:"0",border:"0",background:"transparent",pointerEvents:"none",zIndex:"var(--expressive-z-confetti, 10001)"}),document.body.append(z),typeof z.showPopover=="function"&&(z.popover="manual",z.showPopover())),z}function jo(r){let s=document.createElement("span");s.hidden=!0,r.append(s);let t=getComputedStyle(s),e=Vo.filter(i=>t.getPropertyValue(`--md-sys-color-${i}`).trim()).map(i=>(s.style.color=`var(--md-sys-color-${i})`,getComputedStyle(s).color));return s.remove(),e.length?e:Wo}var Yo={quantity:100,staticity:50,ease:50,size:.4,color:"",vx:0,vy:0},xt=class extends b{constructor(t,e){super(t,e);this._particles=[];this._width=0;this._height=0;this._dpr=1;this._frame=0;this._last=0;this._mouse={x:0,y:0};this._still=!1;this._visible=!0;this._motion=null;this._theme=null;this._resizeObserver=null;this._visibility=null;this._onMotion=()=>{if(this._still=this._motion.matches,this._still){for(let t of this._particles)t.alpha=t.targetAlpha;this._paint()}this._animate()};this._repaint=()=>{this._still&&this._paint()};this._onPointerMove=t=>{let e=this.el.getBoundingClientRect(),i=t.clientX-e.left-e.width/2,n=t.clientY-e.top-e.height/2;Math.abs(i)<e.width/2&&Math.abs(n)<e.height/2&&(this._mouse={x:i,y:n})};if(this._ctx=this.el.getContext("2d"),!this._ctx)return;this._style=getComputedStyle(this.el),this._motion=matchMedia("(prefers-reduced-motion: reduce)");let{signal:i}=this._events;this._motion.addEventListener("change",this._onMotion,{signal:i}),matchMedia("(prefers-color-scheme: dark)").addEventListener("change",this._repaint,{signal:i}),this._theme=new MutationObserver(this._repaint),this._theme.observe(document.documentElement,{attributes:!0,attributeFilter:["theme"],subtree:!0}),this._still=this._motion.matches,this._fit(),this._scatter(),this._resizeObserver=new ResizeObserver(()=>{(this.el.clientWidth!==this._width||this.el.clientHeight!==this._height)&&this._resize()}),this._resizeObserver.observe(this.el),this._visibility=new IntersectionObserver(n=>{this._visible=n[n.length-1].isIntersecting,this._animate()}),this._visibility.observe(this.el)}static get defaults(){return Yo}destroy(){this._stop(),this._theme?.disconnect(),this._resizeObserver?.disconnect(),this._visibility?.disconnect(),this._ctx&&(this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this.el.width,this.el.height)),super.destroy()}_animate(){this._visible&&!this._still?this._start():this._stop()}_start(){this._frame||(window.addEventListener("pointermove",this._onPointerMove,{passive:!0}),this._frame=requestAnimationFrame(t=>{this._last=t,this._draw(t)}))}_stop(){cancelAnimationFrame(this._frame),this._frame=0,window.removeEventListener("pointermove",this._onPointerMove)}_fit(){this._width=this.el.clientWidth,this._height=this.el.clientHeight,this._dpr=devicePixelRatio,this.el.width=Math.round(this._width*this._dpr),this.el.height=Math.round(this._height*this._dpr)}_scatter(){if(this._particles=Array.from({length:this.options.quantity},()=>this._particle()),this._still)for(let t of this._particles)t.alpha=t.targetAlpha;this._repaint()}_resize(){let[t,e]=[this._width,this._height];if(this._fit(),!t||!e)return this._scatter();for(let i of this._particles)i.x*=this._width/t,i.y*=this._height/e;this._paint()}_particle(){return{x:Math.floor(Math.random()*this._width),y:Math.floor(Math.random()*this._height),translateX:0,translateY:0,size:Math.floor(Math.random()*2)+this.options.size,alpha:0,targetAlpha:Math.round((Math.random()*.6+.1)*10)/10,dx:(Math.random()-.5)*.1,dy:(Math.random()-.5)*.1,magnetism:.1+Math.random()*4}}_draw(t){let e=Math.min((t-this._last)/16.666666666666668,4);this._last=t;let{staticity:i,ease:n,vx:o,vy:a}=this.options,l=Math.min(e/n,1);this._particles=this._particles.map(c=>{c.x+=(c.dx+o)*e,c.y+=(c.dy+a)*e,c.translateX+=(this._mouse.x/(i/c.magnetism)-c.translateX)*l,c.translateY+=(this._mouse.y/(i/c.magnetism)-c.translateY)*l;let h=c.x+c.translateX,d=c.y+c.translateY,p=Math.min(h-c.size,this._width-h-c.size,d-c.size,this._height-d-c.size)/20;return c.alpha=p>1?Math.min(c.alpha+.02*e,c.targetAlpha):c.targetAlpha*p,c.x<-c.size||c.x>this._width+c.size||c.y<-c.size||c.y>this._height+c.size?this._particle():c}),this._paint(),this._frame=requestAnimationFrame(c=>this._draw(c))}_paint(){let t=this._ctx,e=this._dpr;t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,this.el.width,this.el.height),t.setTransform(e,0,0,e,0,0),t.fillStyle=this.options.color||this._style.color;for(let i of this._particles)i.alpha<=0||(t.globalAlpha=i.alpha,t.beginPath(),t.arc(i.x+i.translateX,i.y+i.translateY,i.size,0,2*Math.PI),t.fill());t.globalAlpha=1}};xt.key="Expressive_Particles";var Xo={onKey:null,i18n:{tooShort:r=>`Use at least ${r} characters.`}},Ie=r=>r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement,He=new Set,hi=new WeakSet,ui=new WeakMap,Zi=new WeakMap;function Go(r,s){if(!s)return Qi(r);r.validity.customError||(r.setCustomValidity(s),Zi.set(r,s))}var Qi=r=>{Zi.get(r)===r.validationMessage&&r.setCustomValidity(""),Zi.delete(r)},an;function ln(r){let s=r.target.closest?.("button");if(!s)return null;let t=s.closest(".keypad, .keyboard"),e=t&<.getInstance(t);if(e)return[e,s];let i=s.dataset.key&&s.closest(".field");if(!i)return null;for(let n of He){let o=n.target;if(o&&i.contains(o))return[n,s]}return null}var Zo=[["mousedown",r=>{let s=ln(r);s&&s[0]._root?.activeElement===s[0].target&&r.preventDefault()}],["click",r=>{let s=ln(r);s&&s[0]._press(s[1])}],["focusin",r=>{Ie(r.target)&&hi.add(r.target)}],["input",r=>{Ie(r.target)&&ui.get(r.target)?._checkLength(r.target)}],["reset",r=>{for(let s of r.target.elements??[])Ie(s)&&Qi(s)}],["keydown",r=>cn(r,!0)],["keyup",r=>cn(r,!1)]],Qo=["focusin","mousedown","click"];function cn(r,s){for(let t of He)(!s||t.target===r.target)&&t._light(r.key,s)}var Jo=r=>!r.disabled&&(!!r.dataset.key||r.hasAttribute("value")),ta=(r,s)=>r.dataset.key===s||r.hasAttribute("value")&&r.value.toLowerCase()===s.toLowerCase(),lt=class extends b{constructor(t,e){super(t,e);this._fields=new Set;this._attach=()=>{let t=this.el.getRootNode(),e=t.nodeType===9||t.nodeType===11;if(this._waitForInsertion(!e),!e)return;this._root=t,this._listen("addEventListener");let i=this._root.activeElement;Ie(i)&&hi.add(i)};this._root=null,He.add(this),this._attach()}_waitForInsertion(t){for(let e of Qo)this.el[t?"addEventListener":"removeEventListener"](e,this._attach)}_listen(t){if(!(!this._root||this._shared()))for(let[e,i]of Zo)this._root[t](e,i)}static get defaults(){return Xo}destroy(){He.delete(this);for(let t of this._fields)Qi(t),ui.get(t)===this&&ui.delete(t);this._waitForInsertion(!1),this._listen("removeEventListener"),super.destroy()}get target(){let t=this.el.getAttribute("aria-controls"),e=t?u.getElementById(this.el,t):null;return Ie(e)?e:null}_shared(){for(let t of He)if(t!==this&&t._root===this._root)return!0;return!1}_press(t){if(!Jo(t))return;let e=this._act(t);this.options.onKey?.(e)}_act(t){let e=t.dataset.key;return e==="Layer"?this._layer(t):e==="Shift"||e==="CapsLock"?this._latch(t,e):this._type(t,e)}_latch(t,e){return t.setAttribute("aria-pressed",String(t.getAttribute("aria-pressed")!=="true")),e}_layer(t){for(let e of this.el.querySelectorAll("[data-layer]"))e.hidden=e.dataset.layer!==t.value;return"Layer"}_type(t,e){let i=e?"":this._case(t.value),n=this._editable;return n&&this._apply(n,e,i),e??i}_case(t){let e=this.el.querySelector('[data-key="Shift"][aria-pressed="true"]');return e?.setAttribute("aria-pressed","false"),e||this.el.querySelector('[data-key="CapsLock"][aria-pressed="true"]')?t.toUpperCase():t}get _editable(){let t=this.target;return t&&!t.matches(":disabled")&&!t.readOnly?t:null}_apply(t,e,i){if(e==="Enter")return this._enter(t);if(e==="Backspace")return this._edit(t,"","deleteContentBackward");i&&this._edit(t,i,"insertText")}_enter(t){t instanceof HTMLInputElement?t.form?.requestSubmit():this._edit(t,`
|
|
9
|
+
`,"insertLineBreak")}_light(t,e){for(let i of this.el.querySelectorAll("button"))ta(i,t)&&i.classList.toggle("pressed",e)}_checkLength(t){if(t.minLength<1)return;let e=t.value.length>0&&t.value.length<t.minLength;Go(t,e?this.options.i18n.tooShort(t.minLength):"")}_edit(t,e,i){let{value:n}=t,o=t.selectionStart??n.length,a=t.selectionEnd??n.length;if(o===0&&a===0&&!hi.has(t)&&(o=a=n.length),i==="deleteContentBackward"&&o===a&&o){let c=n.slice(Math.max(0,o-64),o);o-=(an??(an=new Intl.Segmenter)).segment(c).containing(c.length-1).segment.length}if(o===a&&!e||e&&t.maxLength>=0&&n.length-(a-o)+e.length>t.maxLength)return;let l=n.slice(0,o)+e+n.slice(a);if(t.value=l,l&&!t.value){t.value=n;return}t.selectionStart!==null&&t.setSelectionRange(o+e.length,o+e.length),hi.add(t),ui.set(t,this),this._fields.add(t),t.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0,inputType:i,data:e||null}))}};lt.key="Expressive_Keypad";var ea={onChange:null,i18n:{area:"Saturation and brightness",value:(r,s)=>`Saturation ${r}%, brightness ${s}%`,hue:"Hue",hex:"Hex color"}},di=r=>Math.min(1,Math.max(0,r));function ia(r,s,t){let e=Math.max(r,s,t),i=e-Math.min(r,s,t);return i?((e===r?(s-t)/i:e===s?(t-r)/i+2:(r-s)/i+4)*60+360)%360:0}function pi(r){let s=/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(r.trim());if(!s)return null;let t=s[1].length===3?[...s[1]].map(a=>a+a).join(""):s[1],[e,i,n]=[0,2,4].map(a=>parseInt(t.slice(a,a+2),16)/255),o=Math.max(e,i,n);return{h:ia(e,i,n),s:o?(o-Math.min(e,i,n))/o:0,v:o}}function Oe({h:r,s,v:t}){let e=i=>{let n=(i+r/60)%6;return t-t*s*Math.max(0,Math.min(n,4-n,1))};return"#"+[5,3,1].map(i=>Math.round(e(i)*255).toString(16).padStart(2,"0")).join("")}var sa={ArrowRight:[1,0],ArrowLeft:[-1,0],ArrowUp:[0,1],ArrowDown:[0,-1],PageUp:[0,10],PageDown:[0,-10],Home:[-100,0],End:[100,0]},wt=class extends b{constructor(t,e){super(t,e);this._hsv={h:0,s:0,v:0};this._area=null;this._thumb=null;this._hue=null;this._hex=null;this._writing=!1;this._onNativeInput=()=>{if(this._writing||!this.input)return;let t=pi(this.input.value);t&&(this._hsv=t,this._render())};this._onHex=()=>{let t=pi(this._hex.value);t&&Oe(t)!==this.input.value&&this._set(t),this._hex.value=Oe(this._hsv)};this._onPointerDown=t=>{if(t.button||this.input.disabled)return;let e=this._area;t.preventDefault(),this._thumb.focus(),e.setPointerCapture(t.pointerId),this._fromPoint(t,!1);let i=l=>this._fromPoint(l,!1),n=R(e),o=l=>{n.abort(),this._fromPoint(l,!0)},{signal:a}=n;e.addEventListener("pointermove",i,{signal:a}),e.addEventListener("pointerup",o,{signal:a}),e.addEventListener("pointercancel",o,{signal:a})};this._onKeyDown=t=>{let e=this._keySteps(t);if(!e)return;t.preventDefault();let i=t.shiftKey?.1:.01,{s:n,v:o}=this._hsv;this._set({...this._hsv,s:di(n+e[0]*i),v:di(o+e[1]*i)})};this.input=t.querySelector(':scope > input[type="color"]'),this.input&&(this._hsv=pi(this.input.value)??this._hsv,this._build(),this.input.addEventListener("input",this._onNativeInput,{signal:this._events.signal}),B(this.input,this._onNativeInput,this._events.signal),this._render())}static get defaults(){return ea}destroy(){for(let t of[this._area,this._hue,this._hex])t?.remove();this._area=this._thumb=this._hue=this._hex=null,this.el.style.removeProperty("--_color-picker-hue"),super.destroy()}get value(){return this.input?.value??""}set value(t){let e=pi(t);!e||!this.input||(this._hsv=e,this._writing=!0,this.input.value=Oe(e),this._writing=!1,this._render())}_build(){let t=this.input.disabled,{i18n:e}=this.options,i=document.createElement("div");i.className="color-picker-area";let n=document.createElement("div");n.className="color-picker-thumb",n.setAttribute("role","slider"),n.setAttribute("aria-label",e.area),n.setAttribute("aria-valuemin","0"),n.setAttribute("aria-valuemax","100"),n.tabIndex=t?-1:0,t&&n.setAttribute("aria-disabled","true"),i.append(n);let o=document.createElement("input");o.type="range",o.className="color-picker-hue",o.min="0",o.max="359",o.setAttribute("aria-label",e.hue),o.disabled=t;let a=document.createElement("input");a.type="text",a.className="color-picker-hex",a.setAttribute("aria-label",e.hex),a.autocomplete="off",a.spellcheck=!1,a.maxLength=7,a.disabled=t,this.input.before(i,o),this.input.after(a),this._area=i,this._thumb=n,this._hue=o,this._hex=a,i.addEventListener("pointerdown",this._onPointerDown),n.addEventListener("keydown",this._onKeyDown),o.addEventListener("input",()=>this._set({...this._hsv,h:Number(o.value)},!1)),o.addEventListener("change",()=>this._commit()),a.addEventListener("change",this._onHex),a.addEventListener("keydown",l=>{l.key==="Enter"&&!u.isComposing(l)&&(l.preventDefault(),this._onHex())})}_render(){let{h:t,s:e,v:i}=this._hsv,n=Oe(this._hsv),o=this._thumb;this.el.style.setProperty("--_color-picker-hue",String(Math.round(t))),o.style.setProperty("--_color-picker-x",String(e)),o.style.setProperty("--_color-picker-y",String(1-i)),o.style.setProperty("--_color-picker-color",n),o.setAttribute("aria-valuenow",String(Math.round(e*100))),o.setAttribute("aria-valuetext",this.options.i18n.value(Math.round(e*100),Math.round(i*100))),this._hue.value=String(Math.round(t)),this._hex.value=n}_set(t,e=!0){let i=this.input;this._hsv=t;let n=Oe(t),o=i.value!==n;this._writing=!0,i.value=n,o&&i.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this._writing=!1,this._render(),e&&this._commit()}_commit(){this.input&&(this._writing=!0,this.input.dispatchEvent(new Event("change",{bubbles:!0})),this._writing=!1,this.options.onChange?.(this.input.value))}_fromPoint(t,e){let i=this._area.getBoundingClientRect(),n=di((t.clientX-i.left)/i.width),o=1-di((t.clientY-i.top)/i.height);this._set({...this._hsv,s:n,v:o},e)}_keySteps(t){return u.plainKey(t)&&!this.input.disabled?sa[t.key]:void 0}};wt.key="Expressive_ColorPicker";var na={shortcut:"k",closeOnRun:!0},ra=typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/.test(navigator.platform),oa=r=>ra?r.metaKey&&!r.ctrlKey:r.ctrlKey&&!r.metaKey,aa=(r,s)=>r.key.toLowerCase()===s||!/^[a-z]$/i.test(r.key)&&/^[a-z]$/.test(s)&&r.code===`Key${s.toUpperCase()}`,la={ArrowDown:1,ArrowUp:-1},hn=r=>r.normalize("NFD").replace(/\p{Diacritic}/gu,"").toLowerCase(),Mt=class extends b{constructor(t,e){let i=t.dataset.shortcut;super(t,{...i!==void 0?{shortcut:i||null}:{},...e});this._active=null;this._generatedIds=[];this._observer=null;this.open=()=>{this.el.open||this.el.showModal(),this.input?.focus()};this.close=()=>{this.el.open&&this.el.close()};this._handleInput=()=>this._filter();this._handleKeydown=u.ignoringComposition(t=>{let e=u.plainKey(t)?la[t.key]:void 0;e?(t.preventDefault(),this._move(e)):t.key==="Enter"&&this._active&&(t.preventDefault(),this._run(this._active))});this._handleEscape=t=>{t.key!=="Escape"||!this.input.value||u.isComposing(t)||(t.preventDefault(),this.input.value="",this.input.dispatchEvent(new Event("input",{bubbles:!0})))};this._handleListClick=t=>{let e=t.target.closest('[role="option"]');if(!e||!this.list.contains(e)||e.getAttribute("aria-disabled")==="true")return;let i=this._action(e);if(i&&!i.contains(t.target)){i.click();return}this.options.closeOnRun&&this.close()};this._handlePointerMove=t=>{let e=t.target.closest('[role="option"]');e&&this.list.contains(e)&&e.getAttribute("aria-disabled")!=="true"&&this._setActive(e)};this._handleClose=()=>{this.el.open||(this.input.value="",this._filter())};this._handleShortcut=t=>{let{shortcut:e}=this.options;!e||t.defaultPrevented||t.altKey||t.shiftKey||!oa(t)||aa(t,e.toLowerCase())&&(t.preventDefault(),!t.repeat&&(this.el.open?this.close():this.open()))};if(this.input=t.querySelector(":scope > input"),this.list=t.querySelector(":scope > :is(ul, ol)"),!this.input||!this.list){console.error("CommandPalette needs an <input> and a <ul> as children of the dialog.");return}this._setupAccessibility(),this._filter(),this._observer=new MutationObserver(()=>this._filter(!0)),this._observer.observe(this.list,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["hidden","disabled"]});let{signal:n}=this._events;this.input.addEventListener("input",this._handleInput,{signal:n}),this.input.addEventListener("keydown",this._handleKeydown,{signal:n}),this.input.addEventListener("keydown",this._handleEscape,{signal:n}),this.list.addEventListener("click",this._handleListClick,{signal:n}),this.list.addEventListener("pointermove",this._handlePointerMove,{signal:n}),this.el.addEventListener("close",this._handleClose,{signal:n}),document.addEventListener("keydown",this._handleShortcut,{signal:n})}static get defaults(){return na}get isOpen(){return this.el.open}destroy(){if(this._observer?.disconnect(),this.input&&this.list){for(let e of["role","aria-controls","aria-expanded","aria-autocomplete","aria-activedescendant"])this.input.removeAttribute(e);this.list.removeAttribute("role");for(let e of this._items()){for(let i of["role","aria-selected","aria-disabled","data-filtered"])e.removeAttribute(i);e.classList.remove("active"),this._action(e)?.removeAttribute("tabindex")}for(let e of this._labels())e.removeAttribute("role"),e.removeAttribute("data-filtered");for(let e of this._generatedIds)e.removeAttribute("id");let t=this._empty();t&&(t.hidden=!1)}super.destroy()}_items(){return Array.from(this.list.children).filter(t=>t instanceof HTMLElement&&!t.classList.contains("label"))}_labels(){return Array.from(this.list.querySelectorAll(":scope > .label"))}_empty(){return this.el.querySelector(":scope > .command-palette-empty")}_action(t){return t.querySelector(":scope > :is(a[href], button)")}_ensureId(t,e){return t.id||(t.id=`${e}-${u.guid()}`,this._generatedIds.push(t)),t.id}_setupAccessibility(){this.list.setAttribute("role","listbox"),this.input.setAttribute("role","combobox"),this.input.setAttribute("aria-controls",this._ensureId(this.list,"command-palette-list")),this.input.setAttribute("aria-expanded","true"),this.input.setAttribute("aria-autocomplete","list")}_wireItems(){for(let t of this._items())t.getAttribute("role")!=="option"&&(t.setAttribute("role","option"),this._ensureId(t,"command-palette-option"),this._action(t)?.setAttribute("tabindex","-1"));for(let t of this._labels())t.setAttribute("role","none")}_shown(){return this._items().filter(t=>!t.hidden&&!t.hasAttribute("data-filtered"))}_visible(){return this._shown().filter(t=>t.getAttribute("aria-disabled")!=="true")}_isDisabled(t){let e=this._action(t);return!!e&&(e.matches(":disabled")||e.getAttribute("aria-disabled")==="true")}_setActive(t){this._active!==t&&(this._active?.classList.remove("active"),this._active?.removeAttribute("aria-selected"),this._active=t,t?(t.classList.add("active"),t.setAttribute("aria-selected","true"),this.input.setAttribute("aria-activedescendant",t.id),t.scrollIntoView({block:"nearest"})):this.input.removeAttribute("aria-activedescendant"))}_filter(t=!1){this._wireItems();let e=hn(this.input.value).split(/\s+/).filter(Boolean);for(let o of this._items()){let a=o.dataset.keywords??this._action(o)?.dataset.keywords??"",l=hn(`${o.textContent} ${a}`);o.toggleAttribute("data-filtered",!e.every(c=>l.includes(c))),this._isDisabled(o)?o.setAttribute("aria-disabled","true"):o.removeAttribute("aria-disabled")}for(let o of this._labels()){let a=o.nextElementSibling,l=!1;for(;a&&!a.classList.contains("label");)!a.hidden&&!a.hasAttribute("data-filtered")&&(l=!0),a=a.nextElementSibling;o.toggleAttribute("data-filtered",!l)}let i=this._visible(),n=this._empty();n&&(n.hidden=this._shown().length>0),this._setActive(t&&i.includes(this._active)?this._active:i[0]??null)}_move(t){let e=this._visible();if(!e.length)return;let i=e.indexOf(this._active);this._setActive(e[(i+t+e.length)%e.length])}_run(t){(this._action(t)??t).click()}};Mt.key="Expressive_CommandPalette";var ca={progressLabel:"Question {current} of {total}",requiredMessage:"Choose an answer to continue.",summaryLabel:"Review your answers",editLabel:"Edit",skippedLabel:"Not answered"},un=["previous","skip","next"],ha=["file","password","hidden"],ua="abcdefghijklmnopqrstuvwxyz",De=r=>r instanceof HTMLInputElement&&(r.type==="radio"||r.type==="checkbox");function da(r){let s=r.closest("label")?.cloneNode(!0);return s?.querySelectorAll("input, small").forEach(t=>t.remove()),s?.textContent.trim()||r.value}var pa={hidden:()=>"",password:r=>r.value?"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022":"",file:r=>Array.from(r.files??[],s=>s.name).join(", ")};function ma(r){return r instanceof HTMLSelectElement?Array.from(r.selectedOptions,s=>s.text).join(", "):De(r)?r.checked?da(r):"":pa[r.type]?.(r)??r.value.trim()}var Ji=r=>r instanceof HTMLSelectElement?Array.from(r.selectedOptions,s=>s.value):De(r)?r.checked:r.value,fa=r=>Array.isArray(r?.answers)?r:null;function _a(r,s){if(r instanceof HTMLSelectElement)return ga(r,s);De(r)?r.checked=s===!0:typeof s=="string"&&(r.value=s)}function ga(r,s){if(Array.isArray(s))for(let t of r.options)t.selected=s.includes(t.value)}function va(r,s){let t=JSON.stringify(Ji(r));_a(r,s),JSON.stringify(Ji(r))!==t&&r.dispatchEvent(new Event("change",{bubbles:!0}))}function ba(r){if(ya(r.target)||!u.plainKey(r))return-1;let s="123456789".indexOf(r.key);return s>=0?s:Ta(r.key)}var Ea='textarea, select, [contenteditable], input:not([type="radio"], [type="checkbox"], [type="button"], [type="submit"], [type="reset"])',ya=r=>!!r.matches?.(Ea),Ta=r=>r.length===1?ua.indexOf(r.toLowerCase()):-1,Ct=class extends b{constructor(t,e){let i=t.dataset.progressLabel;super(t,{...i?{progressLabel:i}:{},...e});this._active=null;this._generated=[];this._generatedIds=[];this._reporting=!1;this._summary=null;this._reviewing=!1;this.goTo=t=>{let e=this.items[t];if(!e)return;this._active=e,this._reviewing=!1,this._render(),this._save();let i=this._controls(e).filter(n=>!n.disabled);(i.find(n=>n.checked)??i[0])?.focus()};this.next=()=>{this._validate(this._active)&&this._advance()};this.previous=()=>this.goTo(this._reviewing?this.items.length-1:this.index-1);this.review=()=>{this._summary&&(this._fillSummary(this._summary),this._reviewing=!0,this._render(),this._summary.focus())};this.skip=()=>{if(this._active){for(let t of this._controls(this._active)){let e=De(t);(e?!t.checked:!t.value)||(e?t.checked=!1:t.value="",t.dispatchEvent(new Event("change",{bubbles:!0})))}this._setInvalid(this._active,!1),this._advance()}};this._save=()=>{let t=this._key;if(!t)return;let e={index:this.index,answers:this._allControls().map(Ji)};try{localStorage.setItem(t,JSON.stringify(e))}catch{}};this._forget=()=>{try{this._key&&localStorage.removeItem(this._key)}catch{}};this._handleClick=t=>{let e=t.target.closest?.("button");if(!(!e||!this._buttons().includes(e))){if(un.includes(e.value)){t.preventDefault(),this[e.value]();return}this._syncRequired()}};this._handleKeydown=t=>{if(t.key!=="Enter")return this._handleShortcut(t);t.defaultPrevented||u.isComposing(t)||!(t.target instanceof HTMLInputElement)||this._end||(t.preventDefault(),this.next())};this._handleInvalid=t=>{let e=this.items.find(i=>i.contains(t.target));e&&(t.preventDefault(),!this._reporting&&(this._reporting=!0,setTimeout(()=>this._reporting=!1),this._active=e,this._reviewing=!1,this._render(),this._validate(e)))};this._handleInput=t=>{this._syncRequired(this._fieldsets().filter(i=>i.contains(t.target))),this._save();let e=t.target.closest?.("fieldset");e instanceof HTMLFieldSetElement&&e.classList.contains("invalid")&&this._setInvalid(e,!1)};this._progress=document.createElement("div"),this._progress.className="questionnaire-progress",this._progressText=document.createElement("span"),this._progressText.id=`questionnaire-progress-${u.guid()}`,this._progressBar=document.createElement("progress"),this._progressBar.className="progress",this._progressBar.setAttribute("aria-labelledby",this._progressText.id),this._progress.append(this._progressText,this._progressBar),this.el.prepend(this._progress);for(let o of this._fieldsets()){let a=Array.from(o.querySelectorAll(":scope > p:not(.questionnaire-error)")).map(l=>this._ensureId(l,"questionnaire-description"));a.length&&!o.hasAttribute("aria-describedby")&&(o.setAttribute("aria-describedby",a.join(" ")),this._generatedIds.push(o))}this._active=this.items[0]??null,this._summary=this._createSummary(),this._restore(),this._syncRequired(),this._render(),this._observer=new MutationObserver(()=>{this._syncRequired(),this._render()}),this._observer.observe(this.el,{attributes:!0,subtree:!0,attributeFilter:["disabled"]});let{signal:n}=this._events;this.el.addEventListener("click",this._handleClick,{signal:n}),this.el.addEventListener("keydown",this._handleKeydown,{signal:n}),this.el.addEventListener("input",this._handleInput,{signal:n}),this.el.addEventListener("change",this._save,{signal:n}),this.el.addEventListener("submit",this._forget,{signal:n}),this.el.addEventListener("invalid",this._handleInvalid,{capture:!0,signal:n})}static get defaults(){return ca}get items(){return this._fieldsets().filter(t=>!t.disabled)}get index(){return this.items.indexOf(this._active)}_advance(){this._summary&&this.index===this.items.length-1?this.review():this.goTo(this.index+1)}destroy(){this._observer.disconnect(),this._summary?.remove();for(let t of this._fieldsets()){if(t.hasAttribute("data-required"))for(let e of this._controls(t))e.setCustomValidity("");t.hidden=!1,this._setInvalid(t,!1)}for(let t of this._buttons())t.hidden=!1;this._progress.remove();for(let t of this._generated)t.remove();for(let t of this._generatedIds)t.removeAttribute(t instanceof HTMLFieldSetElement?"aria-describedby":"id");super.destroy()}_fieldsets(){return Array.from(this.el.querySelectorAll(":scope > fieldset"))}_buttons(){return Array.from(this.el.querySelectorAll(":scope > footer > button")).filter(t=>un.includes(t.value)||t.type==="submit")}_controls(t){return Array.from(t.elements).filter(e=>e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement||e instanceof HTMLInputElement&&e.type!=="button"&&e.type!=="submit")}_required(t){return t.hasAttribute("data-required")||this._controls(t).some(e=>e.required)}_ensureId(t,e){return t.id||(t.id=`${e}-${u.guid()}`,this._generatedIds.push(t)),t.id}_render(){let t=this.items;t.includes(this._active)||(this._active=this._after(t));let e=t.indexOf(this._active);for(let i of this._fieldsets())i.hidden=this._reviewing||i!==this._active;this._summary?.toggleAttribute("hidden",!this._reviewing);for(let i of this._buttons())i.hidden=!this._shows(i,e);this._renderProgress(e,t.length)}_after(t){let e=this._fieldsets();return e.slice(e.indexOf(this._active)+1).find(n=>!n.disabled)??t[t.length-1]??null}get _end(){return this._summary?this._reviewing:this.index===this.items.length-1}_shows(t,e){let i=this._end;return{previous:e>0||this._reviewing,skip:!i&&this._skippable(),next:!i}[t.value]??i}_skippable(){return!!this._active&&!this._required(this._active)}_renderProgress(t,e){this._progressText.textContent=this._reviewing?this.options.summaryLabel:this.options.progressLabel.replace("{current}",String(t+1)).replace("{total}",String(e)),this._progressBar.max=Math.max(e,1),this._progressBar.value=this._reviewing?e:t+1}_createSummary(){if(!this.el.hasAttribute("data-summary"))return null;let t=document.createElement("section");t.className="questionnaire-summary",t.tabIndex=-1,t.setAttribute("aria-label",this.options.summaryLabel),t.hidden=!0,t.addEventListener("click",i=>{let n=i.target.closest("button[data-question]");n&&this.goTo(Number(n.dataset.question))});let e=this.el.querySelector(":scope > footer");return e?e.before(t):this.el.append(t),t}_fillSummary(t){let e=document.createElement("dl");e.append(...this.items.map((i,n)=>{let o=document.createElement("div"),[a,l,c]=[document.createElement("dt"),document.createElement("dd"),document.createElement("dd")];a.id=`questionnaire-summary-${u.guid()}`,a.textContent=i.querySelector(":scope > legend")?.textContent.trim()??"",l.textContent=this._controls(i).map(ma).filter(Boolean).join(", ")||this.options.skippedLabel;let h=document.createElement("button");return Object.assign(h,{type:"button",className:"text",textContent:this.options.editLabel}),h.dataset.question=String(n),h.setAttribute("aria-describedby",a.id),c.append(h),o.append(a,l,c),o})),t.replaceChildren(e)}get _key(){let t=this.el.dataset.save;return t?`questionnaire:${t}`:""}_allControls(){return this._fieldsets().flatMap(t=>this._controls(t)).filter(t=>!ha.includes(t.type))}_restore(){let t=this._read(),e=this._allControls();t?.answers.length===e.length&&(e.forEach((i,n)=>va(i,t.answers[n])),this._active=this.items[t.index]??this._active)}_read(){try{return fa(JSON.parse(localStorage.getItem(this._key)??"null"))}catch{return null}}_syncRequired(t=this._fieldsets()){for(let e of t){if(!e.hasAttribute("data-required"))continue;let i=this._controls(e).filter(o=>o instanceof HTMLInputElement&&o.type==="checkbox"),n=i.filter(o=>!o.disabled);for(let o of i)o.setCustomValidity("");if(n.length&&!n.some(o=>o.checked)){let o=e.querySelector(":scope > .questionnaire-error:not([data-generated])");n[0].setCustomValidity(o?.textContent.trim()||this.options.requiredMessage)}}}_invalidControl(t){return this._controls(t).find(e=>e.willValidate&&!e.validity.valid)}_validate(t){this._syncRequired();let e=t&&this._invalidControl(t);if(!e)return!0;let i=t.querySelector(":scope > .questionnaire-error");return i||(i=document.createElement("p"),i.className="questionnaire-error",i.dataset.generated="",i.textContent=e.validationMessage||this.options.requiredMessage,t.append(i),this._generated.push(i)),this._setInvalid(t,!0),e.focus(),!1}_setInvalid(t,e){t.classList.toggle("invalid",e);let i=t.querySelector(":scope > .questionnaire-error"),n=(t.getAttribute("aria-describedby")??"").split(" ").filter(o=>o&&o!==i?.id);e&&i&&n.push(this._ensureId(i,"questionnaire-error")),n.length?t.setAttribute("aria-describedby",n.join(" ")):t.removeAttribute("aria-describedby");for(let o of this._controls(t))e?o.setAttribute("aria-invalid","true"):o.removeAttribute("aria-invalid");!e&&this._generated.includes(i)&&(i.remove(),this._generated.splice(this._generated.indexOf(i),1))}get _shortcuts(){return this.el.hasAttribute("data-shortcuts")&&!!this._active&&!this._reviewing}_handleShortcut(t){if(!this._shortcuts)return;let e=this._controls(this._active).filter(De)[ba(t)];!e||e.disabled||(t.preventDefault(),e.click(),e.focus())}};Ct.key="Expressive_Questionnaire";var La={min:null,max:null,watch:!1},xa=4,St=6,pn=4;function wa(r,s){let t=document.createRange();return r.map(e=>{t.selectNodeContents(e);let i=t.getBoundingClientRect().width,{left:n,right:o}=e.getBoundingClientRect();return s?{width:i,start:-o,end:-n}:{width:i,start:n,end:o}})}function Ma(r,s){let t=r[s];return s===0?t.start:s===r.length-1?t.end-t.width:(t.start+t.end-t.width)/2}function Ca(r,s){let t=r[r.length-1].end,e=-1/0;for(let i=0;i<r.length;i+=s){let n=Ma(r,i);if(n<e+pn||n+r[i].width>t)return!1;e=n+r[i].width}return!0}function Sa(r){if(r.every(s=>s.width+pn<=s.end-s.start))return 1;for(let s=2;s<=r.length;s++)if(Ca(r,s))return s;return 1}function ka(r,s){let t=Sa(wa(s,getComputedStyle(r).direction==="rtl"));r.toggleAttribute("data-thinned",t>1),s.forEach((e,i)=>e.toggleAttribute("data-skip",i%t>0))}function Aa(r,s){let t=e=>e.nodeName==="TABLE";return r.some(e=>e.target!==s||[...e.addedNodes,...e.removedNodes].some(t))}function mi(r,s,t){let e=document.createElement("ul");return e.className=r,e.setAttribute("aria-hidden","true"),e.append(...t.map((i,n)=>{let o=document.createElement("li");return s[n]&&(o.dataset.series=s[n]),o.append(...i.map(a=>Object.assign(document.createElement("span"),{textContent:a}))),o})),e}function me(r,s){let t=r*2*Math.PI;return`${(s*Math.sin(t)).toFixed(3)},${(-s*Math.cos(t)).toFixed(3)}`}var Z=(r,s=xa)=>String(r%s+1),Ia=(r,s)=>s?`${r} (${s})`:r;function es(r){let s=[[]];return r.forEach((t,e)=>t===null?s.push([]):s[s.length-1].push(e)),s}function is(r,s,t,e){let i=document.createElement("ol");i.className=r,i.setAttribute("aria-hidden","true");for(let n of s){let o=document.createElement("li"),a=document.createElement("span");a.textContent=t(n),o.style.setProperty("--at",`${e(n)}%`),o.append(a),i.append(o)}return i}var Ha=0,Oa=r=>matchMedia("(prefers-reduced-motion: reduce)").matches?[]:r,Da=r=>/cubic-bezier\(([^)]*)\)/.exec(r)?.[1]??"0.2, 0, 0, 1";function Pe(r){let s=getComputedStyle(r),t=s.getPropertyValue("--md-sys-motion-duration-medium4").trim()||"400ms";return parseFloat(t)>0?{dur:t,keySplines:Da(s.getPropertyValue("--md-sys-motion-easing-standard"))}:null}function Re(r,s,t){let e=r.getAttribute("d");s!==e&&r.append(M("animate",{attributeName:"d",from:s,to:e,...t,calcMode:"spline",keyTimes:"0;1",fill:"remove"}))}var dn=r=>r.flatMap(s=>Array.from(s.querySelectorAll("button"))),ts=r=>r.values.some(s=>s!==null),Pa=[1,2,2.5,5,10];function fi(r,s=4){let t=Math.abs(r)/s||1,e=10**Math.floor(Math.log10(t));return e*(Pa.find(i=>i*e>=t*(1-1e-9))??10)}function ss(r,s,t){let e=[];for(let i=Math.ceil(r/t-1e-9);i*t<=s+t*1e-9;i++)e.push(Number((i*t).toPrecision(12)));return e}function _i(r,s){return new Intl.NumberFormat(u.locale(r),s)}function ns(r,s){for(let t=3;;t++){let e=_i(r,{notation:"compact",maximumSignificantDigits:t});if(t===21||new Set(s.map(i=>e.format(i))).size===s.length)return e}}function fe(r,s,t=[]){let e=s<.1?1:0;return t[e]??(t[e]=_i(r,{style:"percent",maximumFractionDigits:e})),t[e].format(s)}var X=(r,s)=>r.className.split(/\s+/).includes(s);function gi(r,s){r.querySelectorAll("[data-series]").forEach(t=>{s?t.dataset.series=s:delete t.dataset.series})}var W=r=>Object.assign(document.createElement("span"),{textContent:r}),Ra={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1};function vi(r,s,t){if(r==="Escape")return s<0?void 0:-1;let e=Ra[r];return e?Math.min(t,Math.max(0,s+e)):{Home:0,End:t}[r]}function kt(r){return r?Xt(r.dataset.value??r.textContent):null}function rs(r,s,[t,e]){return r.format(s).replace(/^[-\u2212]?/,i=>i+t)+e}function os(r){let s=/^[\s\p{Sc}]*/u.exec(r)[0],t=e=>[...e].reverse().join("");return[s,t(/^[\s%\p{Sc}]*/u.exec(t(r.slice(s.length)))[0])]}function as(r){let s=r.find(t=>!t?.dataset.value&&kt(t)!==null);return os(s?.textContent.trim()??"")}function Fa(r){return`M${r.join("L")}${r.length>1?"":"h0"}`}function Na(r){let s=r.length;if(s===0)return"";if(s===1)return`M${r[0][0]},${r[0][1]}h0`;let t=[];for(let n=0;n<s-1;n++)t.push((r[n+1][1]-r[n][1])/(r[n+1][0]-r[n][0]));let e=r.map((n,o)=>{if(o===0)return t[0];if(o===s-1)return t[s-2];let[a,l]=[t[o-1],t[o]];return a*l<=0?0:2/(1/a+1/l)}),i=`M${r[0][0]},${r[0][1]}`;for(let n=0;n<s-1;n++){let[[o,a],[l,c]]=[r[n],r[n+1]],h=(l-o)/3;i+=`C${o+h},${a+e[n]*h} ${l-h},${c-e[n+1]*h} ${l},${c}`}return i}var A=class extends b{constructor(t,e){super(t,e);this.labels=[];this.series=[];this.activeIndex=-1;this._generated=[];this._labelSizes=null;this._tableWatch=null;this._all=[];this._before=[];this._hidden=new Set;this._header=[];this._rows=[];this._reversed=!1;this._onPointerMove=t=>{this.show(this._indexAt(t))};this._onFocus=()=>{this.activeIndex<0&&this._plot.matches(":focus-visible")&&this.show(0)};this._onLeave=t=>{t.pointerType==="touch"||this._plot.matches(":focus-visible")||this.show(-1)};this._onCancel=()=>{this.show(-1)};this._onKeyDown=t=>{if(!u.plainKey(t))return;let e=this._keyTarget(t.key);e!==void 0&&(t.preventDefault(),this.show(e))};this._build(),this._listen(),(this.options.watch||this.el.hasAttribute("data-watch"))&&(this._tableWatch=new MutationObserver(i=>Aa(i,this.el)&&this.update())),this._watch()}get _type(){return"line-chart"}get _seriesFrom(){return 1}get _seriesTo(){}get _fromZero(){return!1}get _horizontal(){return!1}get _circular(){return!1}get _axis(){return this.el.classList.contains("axis")&&!this.el.classList.contains("sparkline")}get _points(){return!0}get _count(){return this.labels.length}_watch(){if(!this._tableWatch)return;this._tableWatch.disconnect(),this._tableWatch.observe(this.el,{childList:!0});let t=this.el.querySelector(":scope > table");t&&this._tableWatch.observe(t,{subtree:!0,childList:!0,characterData:!0,attributeFilter:["data-value","class","data-label"]})}_build(){this._read(),!(!this.labels.length||!this.series.length)&&(this._reversed=!this._horizontal&&getComputedStyle(this.el).direction==="rtl",this._render())}get _interactive(){return!this.el.classList.contains("sparkline")}_listen(){this._plot&&this._interactive&&(this._plot.addEventListener("pointerdown",this._onPointerMove),this._plot.addEventListener("pointermove",this._onPointerMove),this._plot.addEventListener("pointerleave",this._onLeave),this._plot.addEventListener("pointercancel",this._onCancel),this._plot.addEventListener("keydown",this._onKeyDown),this._plot.addEventListener("focus",this._onFocus),this._plot.addEventListener("blur",this._onLeave))}static get defaults(){return La}destroy(){this._generated.forEach(t=>t.remove()),this._generated=[],this._labelSizes?.disconnect(),this._tableWatch?.disconnect(),super.destroy()}update(){if(this.constructor.getInstance(this.el)!==this)return;let t=this._generated,e=this.el.getRootNode().activeElement,[i,n]=[this.activeIndex,t.some(a=>a.contains(e))],o=dn(t).indexOf(e);this._generated=[],this.activeIndex=-1,this._plot=this._cursor=this._tooltip=void 0,this._before=Oa(this.series),this._build(),this._before=[],n&&(dn(this._generated)[o]??this._plot)?.focus({preventScroll:!0}),t.forEach(a=>a.remove()),this._listen(),this.show(Math.min(i,this._count-1)),this._watch()}show(t){if(!this._tooltip||t===this.activeIndex)return;this.activeIndex=t;let e=t<0||t>=this.labels.length;if(this._cursor.hidden=this._tooltip.hidden=e,e)return;this._cursor.replaceChildren();let i=document.createElement("strong");i.textContent=this.labels[t],this._tooltip.replaceChildren(i);let n=this._share(t);this.series.forEach(o=>{if(o.values[t]===null)return;let l=o.color,c=o.tops[t];if(c!==null&&this._points){let p=document.createElement("span");p.className=o.className,p.dataset.series=l,p.style.top=`${o.y(c)}%`,this._cursor.append(p)}let h=document.createElement("span");h.dataset.series=l,h.textContent=o.name;let d=document.createElement("span");d.textContent=Ia(o.text[t],n),n=void 0,this._tooltip.append(h,d)}),this._place(t)}_place(t){let e=this._x(t),i=this._horizontal?"top":"left";this._cursor.style[i]=this._tooltip.style[i]=`${e}%`,this._tooltip.classList.toggle("end",e>50)}_read(){let t=this.el.querySelector(":scope > table");if(!t){[this._header,this._rows,this.labels,this.series,this._all]=[[],[],[],[],[]];return}let e=t.tHead?.rows[0]??t.rows[0],i=Array.from(e?.cells??[]),n=Array.from(t.tBodies).flatMap(l=>Array.from(l.rows)).filter(l=>l!==e);[this._header,this._rows]=[i,n],this.labels=n.map(l=>l.cells[0]?.textContent.trim()??"");let o=this._seriesFrom;this.series=i.slice(o,this._seriesTo).map((l,c)=>{let h=n.map(d=>kt(d.cells[c+o]));return{name:l.textContent.trim(),className:l.className,column:c+o,color:Z(c),text:n.map(d=>d.cells[c+o]?.textContent.trim()??""),values:h,tops:h,y:void 0,scale:void 0,affix:as(n.map(d=>d.cells[c+o]))}}),this._all=this.series,this.series=this._shown(this._all);let a=l=>this._number(l)??this.options[l];this._y=this._scale(this.series,a("min"),a("max"))}_shown(t){let e=t.filter(i=>!this._hidden.has(i.column));return this._arrange(e),e.some(ts)?e:this._hidden.size?(this._hidden.clear(),this._shown(t)):[]}_arrange(t){this.el.classList.contains("stacked")&&this._stack(t)}_stack(t){let e=this.labels.map(()=>0);for(let i of t)i.base=[...e],i.tops=i.values.map((n,o)=>e[o]=n===null||e[o]===null?null:e[o]+n)}_number(t){let e=parseFloat(this.el.dataset[t]??"");return Number.isFinite(e)?e:null}_scale(t,e,i,n=this._fromZero){let o=[e!==null,i!==null],a=this.el.classList.contains("stacked"),[l,c]=[1/0,-1/0];for(let{tops:h,base:d=[]}of t)for(let p of[...h,...d])p!==null&&(l=Math.min(l,p),c=Math.max(c,p));if(l>c&&(l=c=0),n){let[h,d]=[Math.min(0,l),Math.max(0,c)],p=(d-(e??h))*.1||1;e??(e=h<0?h-p:0),i??(i=d+p)}else{let h=(c-l)*.1||1;e??(e=a?Math.min(0,l):l-h),i??(i=c+(a?(c-e)*.1||1:h))}return this._apply(t,this._fit(e,i,o))}_fit(t,e,[i,n]){if(!this._axis)return{min:t,max:e,ticks:[]};let o=fi(e-t),a=i?t:Math.floor(t/o+1e-9)*o,l=n?e:Math.ceil(e/o-1e-9)*o;return{min:a,max:l,ticks:ss(a,l,o)}}_apply(t,e){let i=n=>100-(n-e.min)/(e.max-e.min||1)*100;for(let n of t)Object.assign(n,{y:i,scale:e});return i}_x(t){let e=(t+.5)/this.labels.length*100;return this._reversed?100-e:e}_render(){let t=this._type;this._plot=document.createElement("div"),this._plot.className=`${t}-plot`;let e=this.el.querySelector(":scope > figcaption")?.textContent.trim();this._plot.setAttribute("role","group"),this._plot.setAttribute("aria-roledescription",t.replace(/-/g," ")),e&&this._plot.setAttribute("aria-label",e),this._interactive&&(this._plot.tabIndex=0),this._cursor=document.createElement("div"),this._cursor.className=`${t}-cursor`,this._cursor.hidden=!0,this._tooltip=document.createElement("div"),this._tooltip.className=`${t}-tooltip`,this._tooltip.hidden=!0,this._tooltip.setAttribute("aria-live","polite"),this._plot.append(...this._axes(),this._draw(),this._cursor,this._tooltip),this._generated=[this._plot,...this._guides()],this.el.append(...this._generated)}_total(t){let e=this.el.querySelector(":scope > table")?.tFoot?.rows[0];if(!e)return null;let i=document.createElement("div");i.className=t;let[n,o]=[document.createElement("span"),document.createElement("strong")];return n.textContent=e.cells[0]?.textContent.trim()??"",o.textContent=e.cells[1]?.textContent.trim()??"",i.append(o,n),i}_guides(){let t=document.createElement("ol");t.className=`${this._type}-labels`,t.setAttribute("aria-hidden","true");for(let e of this.labels){let i=document.createElement("li");i.append(document.createElement("span")),i.firstChild.textContent=e,t.append(i)}return this._observeLabels(t,Array.from(t.children)),[t,...this._legend()]}_observeLabels(t,e){this._labelSizes?.disconnect(),!(this._horizontal||!e.length)&&(this._labelSizes=new ResizeObserver(()=>ka(t,e)),this._labelSizes.observe(t))}_axes(){if(!this._axis)return[];let t=n=>X(n,"end"),e=this.series.find(n=>!t(n))??this.series[0],i=this.series.find(n=>n.y!==e.y);return[e,i].filter(Boolean).map((n,o)=>this._valueAxis(n,o>0))}_valueAxis(t,e){let i=ns(this.el,t.scale.ticks);return is(`${this._type}-axis${e?" end":""}`,t.scale.ticks,n=>rs(i,n,t.affix),t.y)}_legend(){if(this._all.length<2)return[];let t=this.el.classList.contains("toggle"),e=document.createElement("ul");return e.className=`${this._type}-legend`,t||e.setAttribute("aria-hidden","true"),e.append(...this._all.map(i=>{let n=document.createElement("li");return n.dataset.series=i.color,n.append(t?this._toggle(i):i.name),n})),[e]}_toggle(t){let e=document.createElement("button"),i=this.series.includes(t);return e.type="button",e.className="chart-toggle",e.textContent=t.name,e.setAttribute("aria-pressed",String(i)),i&&ts(t)&&this.series.filter(ts).length<2&&e.setAttribute("aria-disabled","true"),e.addEventListener("click",()=>{e.hasAttribute("aria-disabled")||(i?this._hidden.add(t.column):this._hidden.delete(t.column),this.update())}),e}_draw(t=this.series){return this._drawLines(t)}_share(t){}_drawLines(t=this.series){let e=M("svg",{viewBox:"0 0 100 100",preserveAspectRatio:"none","aria-hidden":"true",focusable:"false"}),i=this._before.length?Pe(this.el):null,n=i?this._starts(t):[];return e.append(...t.map((o,a)=>this._line(o,n[a],i))),e}_starts(t){let e;return t.map(i=>{let n=i.base?e??this._baseY(i):()=>100;return e=this._was(i,n),this._shape(i,e,n)})}_was(t,e){let i=this._before.find(n=>n.column===t.column);return n=>{let o=i?.tops[n]??null;return o===null?e(n):i.y(o)}}_baseY(t){return e=>Math.min(100,t.y(t.base[e]))}_shape(t,e,i){let n=es(t.tops).filter(c=>c.length),o=(c,h)=>c.map(d=>[this._x(d),h(d)]),a=this.el.classList.contains("straight")?Fa:Na,l=n.map(c=>a(o(c,e)));return{line:l.join(""),area:n.map((c,h)=>t.base?`${l[h]}L${a(o(c,i).reverse()).slice(1)}Z`:`${l[h]}V100H${this._x(c[0])}Z`).join(""),dots:n.flatMap(c=>o(c,e)).map(([c,h])=>`M${c},${h}h0`).join("")}}_line(t,e,i){let n=M("g",{class:`${this._type}-series ${t.className}`.trim(),"data-series":t.color}),o=this._shape(t,h=>t.y(t.tops[h]),this._baseY(t)),a=`line-chart-gradient-${++Ha}`,l=M("linearGradient",{id:a,x2:"0",y2:"1"});l.append(M("stop"),M("stop",{offset:"1"}));let c=(h,d,p={})=>{let _=M("path",{class:`${this._type}-${d}`,d:o[h],...p});return e&&Re(_,e[h],i),_};return n.append(l,c("area","area",{fill:`url(#${a})`}),c("line","line")),this.el.classList.contains("points")&&n.append(c("dots","points")),n}_indexAt(t){let e=this._plot.getBoundingClientRect(),i=this._horizontal?(t.clientY-e.top)/e.height:(t.clientX-e.left)/e.width,n=Math.floor((this._reversed?1-i:i)*this.labels.length);return Math.min(this.labels.length-1,Math.max(0,n))}_polarAt(t){let e=this._plot.getBoundingClientRect(),[i,n]=[t.clientX-e.left-e.width/2,t.clientY-e.top-e.height/2];return[(Math.atan2(i,-n)/(2*Math.PI)+1)%1,Math.hypot(i,n)/e.width]}get _arrows(){return this._circular?[["ArrowRight","ArrowDown"],["ArrowLeft","ArrowUp"]]:this._horizontal?[["ArrowDown"],["ArrowUp"]]:this._reversed?[["ArrowLeft"],["ArrowRight"]]:[["ArrowRight"],["ArrowLeft"]]}_keyTarget(t){let e=this.labels.length-1,[i,n]=this._arrows,o=a=>this._circular?this.activeIndex<0?a>0?0:e:(this.activeIndex+a+e+1)%(e+1):Math.min(e,Math.max(0,this.activeIndex+a));return t==="Escape"?this.activeIndex<0?void 0:-1:i.includes(t)?o(1):n.includes(t)?o(-1):{Home:0,End:e}[t]}};A.key="Expressive_LineChart";function Ba(r){let s=$a(r).map(Xt);return s.length===2&&!s.includes(null)?[Math.min(s[0],s[1]),Math.max(s[0],s[1])]:[null,null]}function $a(r){return r?r.dataset.value?.trim().split(/\s+/)??r.textContent.split(/\s*[–—]\s*|\s+(?:-|to)\s+/):[]}var mn=(r,s)=>r.base?.[s]??0;function fn(r,s,t,e){return[e(Math.max(r,s),t),100-e(Math.min(r,s),t)]}var G=class extends A{get _type(){return"column-chart"}get _fromZero(){return!0}get _points(){return!1}_arrange(s){let t=this._ranges=s.filter(e=>X(e,"range"));for(let e of t){let i=this._rows.map(n=>Ba(n.cells[e.column]));e.base=i.map(([n])=>n),e.values=e.tops=i.map(([,n])=>n)}super._arrange(s.filter(e=>!t.includes(e)))}_draw(s=this.series){let t=document.createElement("div");t.className="column-chart-columns",t.setAttribute("aria-hidden","true");let e=(o,a=s[0]?.y??this._y)=>Math.min(100,Math.max(0,a(o))),i=this.el.classList.contains("stacked"),n=e(0);return t.style.setProperty("--zero",`${n}%`),this._plot.style.setProperty("--rows",String(this.labels.length)),this.labels.forEach((o,a)=>{let l=document.createElement("div"),c=n;s.forEach(h=>{let d=h.tops[a],p=mn(h,a);if(i&&(d===null||p===null))return;let _=document.createElement("span");if(d!==null){_.className=h.className,_.dataset.series=h.color,_.classList.toggle("negative",!h.base&&d<p),_.classList.toggle("floating",this._ranges.includes(h));let[m,E]=fn(p,d,h.y,e);_.style.setProperty("--top",`${m}%`),_.style.setProperty("--bottom",`${E}%`),c=this._start(_,h,a,c,e),this._horizontal&&(_.dataset.text=h.text[a])}l.append(_)}),t.append(l)}),t}_start(s,t,e,i,n){if(!this._before.length)return i;let[o,a]=this._oldInsets(t,e,n)??[i,100-i];return s.style.setProperty("--from-top",`${o}%`),s.style.setProperty("--from-bottom",`${a}%`),this.el.classList.contains("stacked")?o:i}_oldInsets(s,t,e){let i=this._before.find(o=>o.column===s.column),n=i?.tops[t]??null;return n===null?null:fn(mn(i,t),n,i.y,e)}};G.key="Expressive_ColumnChart";var At=class extends G{get _type(){return"bar-chart"}get _horizontal(){return!0}_draw(){let s=super._draw();if(s.className="bar-chart-bars",s.classList.toggle("rtl",getComputedStyle(this.el).direction==="rtl"),!this.el.classList.contains("values"))return s;let t=s.cloneNode(!0);t.classList.replace("bar-chart-bars","bar-chart-values"),t.querySelectorAll("span[data-text]").forEach(i=>{i.textContent=i.dataset.text});let e=document.createElement("div");return e.className="bar-chart-layers",e.append(s,t),e}};At.key="Expressive_BarChart";var Q=46,qa=1-1e-5,za=1.06,Ka=.05,Va=0;function Wa(r){let[,s="",t="0"]=/(?:\.(\d+))?(?:e([+-]?\d+))?$/i.exec(r.replace(/[^\d.e+-]/gi,""));return Math.max(0,s.length-Number(t))}function _n(r,s,t){r.sort(([n],[o])=>(n-o)*s);let e=r.map(([n])=>n);t!==void 0&&e.unshift(t);let i=e.length-r.length;r.forEach(([,n],o)=>{let a=e.slice(0,i+o+1).map((l,c)=>`calc(50cqw + ${l} * var(--pie-chart-name-at) + ${(i+o-c)*s} * var(--pie-chart-name-step))`);n.style.setProperty("--pie-chart-name-top",`${s>0?"max":"min"}(${a.join(", ")})`)})}var It=class extends A{get _type(){return"pie-chart"}get _axis(){return!1}get _points(){return!1}get _circular(){return!0}_read(){super._read();let s=this._small();if(!s)return;let t=this.series[0].values.reduce((n,o,a)=>n+(s[a]?Math.max(0,o):0),0),e=this._written(t,this._rows.filter((n,o)=>s[o]).map(n=>n.cells[1])),i=(n,o)=>[...n.filter((a,l)=>!s[l]),o];this.labels=i(this.labels,this.el.dataset.otherLabel||"Other"),this.series=this.series.map((n,o)=>{let a=i(n.values,o?null:t);return{...n,values:a,tops:a,text:i(n.text,o?"":e)}})}_written(s,t){let e=t.map(o=>o.textContent.trim()),[i,n]=os(e[0]);return`${i}${_i(this.el,this._precision(e,t)).format(s)}${n}`}_precision(s,t){if(t.some(i=>i.dataset.value))return{notation:"compact",maximumSignificantDigits:3};let e=Math.max(0,...s.map(Wa));return e>20?{maximumSignificantDigits:3}:{maximumFractionDigits:e}}_small(){let s=this._number("other"),t=this.series[0]?.values.map(n=>n===null?null:Math.max(0,n));if(!t||!(s>0))return null;let e=t.reduce((n,o)=>n+(o??0),0),i=t.map(n=>n!==null&&n/e*100<s-1e-9);return i.filter(Boolean).length>1?i:null}show(s){!this._tooltip||s===this.activeIndex||(super.show(s),this._slices.forEach((t,e)=>t?.classList.toggle("active",e===s)),!this._tooltip.hidden&&gi(this._tooltip,this._colors[s]))}_place(s){let t=(this._turns[s][0]+this._turns[s][1])/2;this._tooltip.style.setProperty("--turn",String(t)),this._tooltip.classList.toggle("end",t<.5)}_share(s){let[t,e]=this._turns[s];return e<=t?"":fe(this.el,e-t,this._percents??(this._percents=[]))}_names(){let s=document.createElement("div");s.className="pie-chart-names";let t=[[],[],[],[]];this._turns.forEach(([e,i],n)=>{if(i<=e)return;let o=(e+i)/2,a=-Math.cos(o*2*Math.PI),l=document.createElement("span");l.dataset.series=this._colors[n],l.style.setProperty("--turn",String(o)),l.classList.toggle("end",o>=.5);let c=document.createElement("span");c.textContent=this.labels[n],l.append(c),s.append(l),t[(o>=.5?2:0)+ +(a>=0)].push([a,l])});for(let e of[0,2])_n(t[e],-1),_n(t[e+1],1,t[e][0]?.[0]);return s}_guides(){this._percents=[];let s=this.series[0].text;return[mi("pie-chart-legend",this._colors,this.labels.map((t,e)=>[t,s[e],this._share(e)]))]}_indexAt(s){let[t,e]=this._polarAt(s),i=e*100,n=this.el.classList.contains("donut")&&parseFloat(getComputedStyle(this.el).getPropertyValue("--md-comp-pie-chart-hole"))||0;if(i<Q*n)return-1;let o=this._turns.findIndex(([a,l])=>a<=t&&t<l);return i>Q*(o===this.activeIndex?za:1)?-1:o}_draw(){let s=this.series[0].values.map(m=>Math.max(0,m??0)),t=s.reduce((m,E)=>m+E,0),e=0;this._turns=s.map(m=>[e,e+=t?m/t:0]);let i=this._turns.filter(([m,E])=>E>m),n=0;this._colors=this._turns.map(([m,E])=>{if(E<=m)return;let T=n++;return String(T===i.length-1&&T>0&&T%St===0?2:T%St+1)});let o=document.createElement("div");o.className="pie-chart-pie",o.setAttribute("aria-hidden","true");let a=M("svg",{viewBox:"-50 -50 100 100",focusable:"false"}),l=`pie-chart-mask-${++Va}`,c={x:"-50",y:"-50",width:"100",height:"100"},h=M("mask",{id:l,maskUnits:"userSpaceOnUse",...c});h.append(M("rect",{...c,fill:"white"}),M("path",{class:"pie-chart-gaps",stroke:"black",d:i.length>1?i.map(([m])=>`M0,0L${me(m,50)}`).join(""):""}),M("circle",{class:"pie-chart-hole",r:String(Q),fill:"black"}));let d=M("g",{mask:`url(#${l})`}),p=`A${Q},${Q} 0`;this._slices=this._turns.map(([m,E],T)=>{if(E<=m)return null;let C=M("path",{class:"pie-chart-slice","data-series":this._colors[T],d:E-m>=qa?`M0,${-Q}${p} 1 1 0,${Q}${p} 1 1 0,${-Q}Z`:`M0,0L${me(m,Q)}${p} ${E-m>.5?1:0} 1 ${me(E,Q)}Z`});return d.append(C),C}),a.append(h,d),o.append(a,...this._texts());let _=this._total("pie-chart-total");return _&&o.append(_),o}_texts(){let s=[];return this.el.classList.contains("values")&&s.push(this._values()),this.el.classList.contains("labels")&&!this.el.classList.contains("sparkline")&&s.push(this._names()),s}_values(){let s=document.createElement("div");return s.className="pie-chart-values",this._turns.forEach(([t,e],i)=>{if(e-t<Ka)return;let n=document.createElement("span");n.dataset.series=this._colors[i],n.style.setProperty("--turn",String((t+e)/2)),n.textContent=this._share(i),s.append(n)}),s}};It.key="Expressive_PieChart";function Ua(r,s){return Math.sign(r)*Math.min(s-1,Math.floor(Math.abs(r)*s))/(s-1)}var Ht=class extends A{get _type(){return"heatmap-chart"}get _axis(){return!1}get _count(){return this.labels.length*this.series.length}destroy(){this._resizes?.disconnect(),super.destroy()}update(){let s=this._scroll?.scrollLeft;super.update(),this._scroll&&s&&(this._scroll.scrollLeft=s)}show(s){!this._tooltip||s===this.activeIndex||this._activate(this._cells[s],s)}_activate(s,t){let e=s?this._box(s):null;this._cells[this.activeIndex]?.classList.remove("active"),this.activeIndex=t,this._tooltip.hidden=!e,e&&this._fill(s,t,e)}_box(s){return this._plot.matches(":focus-visible")&&s.scrollIntoView({block:"nearest",inline:"nearest"}),this._measure(s)}_measure(s){let[t,e]=[s.getBoundingClientRect(),this._plot.getBoundingClientRect()];return[t.left-e.left,t.top-e.top,t.width,this._plot.clientWidth]}_follow(s){let t=this._cells[this.activeIndex];if(!t)return;let[e,i]=[s.getBoundingClientRect(),t.getBoundingClientRect()];i.right<=e.left||i.left>=e.right?this.show(-1):this._position(this._measure(t))}_fill(s,t,[e,i,n,o]){s.classList.add("active");let a=this.series.length,[l,c]=[Math.floor(t/a),this.series[t%a]],h=document.createElement("strong");h.textContent=this.labels[l];let[d,p]=[document.createElement("span"),document.createElement("span")];d.textContent=c.name,this._levels[t]===null?d.className="gap":d.style.setProperty("--level",String(this._levels[t])),p.textContent=c.text[l],this._tooltip.replaceChildren(h,d,p),this._position([e,i,n,o])}_position([s,t,e,i]){let n=s+e/2>i/2;this._tooltip.classList.toggle("end",n),this._tooltip.style.left=`${s+(n?0:e)}px`,this._tooltip.style.top=`${t}px`}_keyTarget(s){if(s==="Escape")return this.activeIndex<0?void 0:-1;let[t,e]=[this.series.length,this.labels.length-1],i=Math.max(0,this.activeIndex),[n,o]=[Math.floor(i/t),i%t],[a,l]=this._reversed?["ArrowLeft","ArrowRight"]:["ArrowRight","ArrowLeft"],c={[a]:[n,o+1],[l]:[n,o-1],ArrowDown:[n+1,o],ArrowUp:[n-1,o],Home:[n,0],End:[n,t-1]}[s];if(!c)return;if(this.activeIndex<0)return 0;let h=(d,p)=>Math.min(p,Math.max(0,d));return h(c[0],e)*t+h(c[1],t-1)}_indexAt(s){let[t,e]=[this.series.length,this.labels.length],i=this._cells[0].getBoundingClientRect(),n=this._cells[this._cells.length-1].getBoundingClientRect(),[o,a]=[Math.min(i.left,n.left),Math.max(i.right,n.right)],[l,c]=[s.clientX,s.clientY];if(this._off(l,c,[o,a,i.top,n.bottom]))return-1;let h=(p,_,m)=>Math.min(m-1,Math.floor(p/(_||1)*m)),d=h(l-o,a-o,t);return h(c-i.top,n.bottom-i.top,e)*t+(this._reversed?t-1-d:d)}_off(s,t,[e,i,n,o]){let a=this._scroll.getBoundingClientRect();return s<Math.max(e,a.left)||s>Math.min(i,a.right)||t<n||t>o}_guides(){let s=document.createElement("div");s.className="heatmap-chart-legend",s.setAttribute("aria-hidden","true");let[t,e,i]=["span","span","span"].map(a=>document.createElement(a));[t.textContent,i.textContent]=this._ends,e.className="heatmap-chart-scale",this._reversed&&e.style.setProperty("--heatmap-chart-to","left");let[n,o]=this._endLevels;return e.style.setProperty("--low",String(n)),e.style.setProperty("--high",String(o)),e.classList.toggle("diverging",n<0&&o>0),e.style.setProperty("--mid",`${-n/(o-n||1)*100}%`),e.append(...this._bands().filter(a=>a>=n&&a<=o).map(a=>{let l=document.createElement("span");return l.style.setProperty("--level",String(a)),l})),s.append(t,e,i),[s]}_bands(){let s=this._steps;return s?Array.from({length:2*s-1},(t,e)=>(e-s+1)/(s-1)):[]}get _steps(){let s=Math.round(this._number("steps")??0);return s>1?s:0}_shade(s,t){let e=(h,d)=>this._number(h)??this.options[h]??d,[i,n,o]=[e("min",s),e("max",t),this._number("mid")],a=(h,d)=>Math.min(1,Math.max(d,h)),l=o===null?h=>a((h-i)/(n-i||1),0):h=>a((Math.min(n,Math.max(i,h))-o)/(Math.max(n-o,o-i)||1),-1),c=this._steps;return c?h=>Ua(l(h),c):l}_draw(){let s=this.series.length,[t,e]=[1/0,-1/0];this._ends=["",""],this.series.forEach(m=>m.values.forEach((E,T)=>{E!==null&&(E<t&&([t,this._ends[0]]=[E,m.text[T]]),E>e&&([e,this._ends[1]]=[E,m.text[T]]))}));let i=this._shade(t,e);this._endLevels=[i(t),i(e)];let n=document.createElement("div");n.className="heatmap-chart-grid",n.setAttribute("aria-hidden","true"),n.style.setProperty("--columns",String(s)),n.style.setProperty("--rows",String(this.labels.length));let o=(m,E="")=>{let T=document.createElement("span");return T.className=m,T.textContent=E,T},a=m=>m?.dataset.label??m?.textContent.trim()??"",l=this.el.classList.contains("values");this._cells=[],this._levels=[];let[c,h]=[document.createElement("div"),document.createElement("div")];c.className="heatmap-chart-rows",h.className="heatmap-chart-cells",this.labels.forEach((m,E)=>{c.append(o("heatmap-chart-row",a(this._rows[E].cells[0]))),this.series.forEach(T=>{let C=T.values[E],g=C===null?null:i(C),L=o("heatmap-chart-cell",l?T.text[E]:"");g===null?L.classList.add("gap"):L.style.setProperty("--level",String(g)),this._cells.push(L),this._levels.push(g),h.append(L)})});let d=this._header.slice(1,s+1).map(a),p=[];d.forEach((m,E)=>{if(!m)return;let T=E+1;for(;T<s&&!d[T];)T++;let C=o("heatmap-chart-column",m);C.classList.toggle("run",T>E+1),C.style.gridArea=`${this.labels.length+1} / ${E+1} / auto / ${T+1}`,h.append(C),p.push(C)}),this._observeLabels(h,p.some(m=>m.classList.contains("run"))?[]:p);let _=this._scroll=document.createElement("div");return _.className="heatmap-chart-scroll",_.tabIndex=-1,_.addEventListener("focus",()=>this._plot.focus()),_.addEventListener("scroll",()=>this._follow(_),{passive:!0}),this._resizes?.disconnect(),this._resizes=new ResizeObserver(()=>this._follow(_)),this._resizes.observe(_),_.append(h),n.append(c,_),n}};Ht.key="Expressive_HeatmapChart";var gn=4;function ja(r){let s=es(r);return s.length>1&&(s[0]=[...s.pop(),...s[0]]),s.filter(t=>t.length)}var vn=r=>`M${r.join("L")}Z`,Ya=r=>`M${r.join("L")}${r.length>1?"":"h0"}`,Xa=r=>`M0,0L${r.join("L")}Z`,Ot=class extends A{get _type(){return"radar-chart"}get _fromZero(){return!0}get _circular(){return!0}_place(s){for(let e of this._cursor.children)e.style.top=`${Math.min(100,Math.max(0,parseFloat(e.style.top)))}%`;let t=this._turn(s);this._cursor.style.setProperty("--turn",String(t)),this._tooltip.style.setProperty("--turn",String(t)),this._tooltip.classList.toggle("end",t>0&&t<.5)}_turn(s){return s/this.labels.length}_guides(){return this._legend()}_indexAt(s){let[t]=this._polarAt(s);return Math.round(t*this.labels.length)%this.labels.length}_rings(s){return this._axis?this.series[0].scale.ticks.filter(t=>t>0).map(s):Array.from({length:gn},(t,e)=>(e+1)/gn)}_series(s,t){let e=M("g",{class:`radar-chart-series ${s.className}`.trim(),"data-series":s.color}),i=ja(s.values).map(l=>l.map(t)),[n,o]=s.values.includes(null)?[Ya,Xa]:[vn,vn];e.append(M("path",{class:"radar-chart-shape",d:i.map(n).join("")}));let a=this.el.classList;return a.contains("area")&&e.append(M("path",{class:"radar-chart-area",d:i.map(o).join("")})),a.contains("points")&&e.append(M("path",{class:"radar-chart-points",d:i.flat().map(l=>`M${l}h0`).join("")})),e}_draw(){let s=(l,c)=>me(this._turn(l),50*c),t=l=>Math.min(1,Math.max(0,1-this._y(l)/100)),e=this.labels.map((l,c)=>c),i=l=>`M${e.map(c=>s(c,l)).join("L")}Z`,n=M("svg",{viewBox:"-50 -50 100 100","aria-hidden":"true",focusable:"false"});n.append(M("path",{class:"radar-chart-grid",d:this._rings(t).map(i).join("")+e.map(l=>`M0,0L${s(l,1)}`).join("")})),this.series.forEach(l=>n.append(this._series(l,c=>s(c,t(l.values[c])))));let o=document.createElement("ol");o.className="radar-chart-axes",o.setAttribute("aria-hidden","true"),this.labels.forEach((l,c)=>{let h=document.createElement("li");h.textContent=l,h.style.setProperty("--turn",String(this._turn(c))),o.append(h)});let a=document.createElement("div");return a.className="radar-chart-web",a.append(n,o),a}};Ot.key="Expressive_RadarChart";var bn=46,Ga=.8,Dt=class extends A{get _type(){return"radial-chart"}get _axis(){return!1}get _points(){return!1}get _circular(){return!0}get _gauge(){return this.el.classList.contains("gauge")}get _labeled(){let s=this.el.classList;return s.contains("labels")&&!s.contains("sparkline")}get _span(){return this._gauge?.5:this._labeled?.75:1}get _segments(){let s=Math.round(this._number("segments")??0);return s>1?s:0}_lit(s){let t=this._segments;return t?Math.round(s*t)/t:s}_dash(s,t,e){let[i,n,o]=[e?this._width:0,this._segments,this._span*t];if(!n)return`${Math.max(.001,s*o-i).toFixed(3)} ${t.toFixed(3)}`;let a=o/n,l=Math.max(.001,a-this._gap-i);return`${Array.from({length:Math.round(s*n)},()=>`${l.toFixed(3)} ${(a-l).toFixed(3)}`).join(" ").replace(/ [\d.]+$/,"")||0} ${t.toFixed(3)}`}get _step(){return this._radii.length>1?this._radii[0]-this._radii[1]:this._width}show(s){!this._tooltip||s===this.activeIndex||(super.show(s),this._rings.forEach((t,e)=>t.classList.toggle("active",e===s)),this._sweeps.forEach((t,e)=>t?.classList.toggle("active",e===s)),!this._tooltip.hidden&&gi(this._tooltip,Z(s)))}_place(s){let t=this._turn(this._fractions[s]),e=this._radii[s],[i,n]=[e*Math.sin(t*2*Math.PI),-e*Math.cos(t*2*Math.PI)];this._tooltip.style.left=`${50+i}%`,this._tooltip.style.top=`${(50+n)/(this._gauge?50:100)*100}%`,this._tooltip.classList.toggle("end",i>0)}_turn(s){return s*this._span-(this._gauge?.25:0)}_guides(){if(this.labels.length<2)return[];let s=this.series[0].text,t=this.labels.map((e,i)=>Z(i));return[mi("radial-chart-legend",t,this.labels.map((e,i)=>[e,s[i]]))]}_indexAt(s){let t=this._plot.getBoundingClientRect(),[e,i]=[s.clientX-t.left-t.width/2,s.clientY-t.top-t.width/2];if(this._gauge&&i>0)return this._nameAt(s);let n=this._distance(e,i,t.width);return this._radii.findIndex(o=>Math.abs(n-o)<=this._step/2)}_distance(s,t,e){return this._span===.75&&s<0&&t<0?-t/e*100:Math.hypot(s,t)/e*100}_nameAt(s){let t=s.target.closest(".radial-chart-names > span");return t?[...t.parentElement.children].indexOf(t):-1}get _frame(){return this._gauge?["rotate(180)","-50 -50 100 50"]:["rotate(-90)","-50 -50 100 100"]}_sweep(s,t,e){let i=this._fractions[t];if(!i||!this.el.classList.contains("gradient"))return null;let[n,o]=this._frame,a=this._width.toFixed(3),l=this._dash(i,e,!0),c=`<svg xmlns='http://www.w3.org/2000/svg' viewBox='${o}'><circle r='${s.toFixed(3)}' stroke-width='${a}' transform='${n}' stroke-dasharray='${l}' stroke-dashoffset='${(-this._width/2).toFixed(3)}' stroke-linecap='round' fill='none' stroke='black'/></svg>`,h=document.createElement("div");return h.className="radial-chart-sweep",h.dataset.series=Z(t),h.style.setProperty("--radial-chart-shape",`url("data:image/svg+xml,${encodeURIComponent(c)}")`),h.style.setProperty("--radial-chart-from",`${this._turn(0)}turn`),h.style.setProperty("--radial-chart-to",`${i*this._span}turn`),h}_names(){if(!this._labeled)return[];let s=this._radii.length,t=document.createElement("div");return t.className="radial-chart-names",t.style.setProperty("--radial-chart-step",this._step.toFixed(3)),this._plot.style.setProperty("--radial-chart-rows",String(s)),t.append(...this._radii.map((e,i)=>{let n=document.createElement("span");return n.style.setProperty("--radial-chart-at",`${(50-e).toFixed(3)}%`),n.style.setProperty("--radial-chart-row",String(s-1-i)),n.textContent=this.labels[i],n})),[t]}_draw(){let s=getComputedStyle(this.el),t=(m,E)=>{let T=parseFloat(s.getPropertyValue(`--md-comp-radial-chart-${m}`));return Number.isFinite(T)?T:E},e=this.labels.length,[i,n]=[Math.max(0,t("thickness",8)),Math.max(0,t("gap",2))],o=Math.min(1,bn*Ga/(e*i+(e-1)*n||1));[i,n]=[i*o,n*o],[this._width,this._gap]=[i,n],this._radii=this.labels.map((m,E)=>bn-i/2-E*(i+n));let a=[parseFloat(this.el.dataset.max??""),this.options.max??NaN,100].find(m=>m>0);this._fractions=this.series[0].values.map(m=>this._lit(Math.min(1,Math.max(0,(m??0)/a))));let[l,c]=this._frame,h=M("svg",{viewBox:c,focusable:"false"}),d=this._span;this._sweeps=[],this._rings=this._radii.map((m,E)=>{let T=2*Math.PI*m,C=(L,S,P)=>{let N=M("circle",{class:L,r:m.toFixed(3),transform:l,"stroke-width":i.toFixed(3)});return N.style.setProperty("--radial-chart-dash",this._dash(S,T,P)),P&&(N.style.setProperty("--radial-chart-offset",(-i/2).toFixed(3)),N.classList.add("capped")),N},g=C("radial-chart-ring",this._fractions[E],!0);return g.dataset.series=Z(E),this._fractions[E]||g.classList.add("empty"),h.append(C("radial-chart-track",1,d<1||!!this._segments),g),this._sweeps.push(this._sweep(m,E,T)),g});let p=document.createElement("div");p.className="radial-chart-rings",p.setAttribute("aria-hidden","true"),p.style.setProperty("--radial-chart-middle",`${(this._radii[e-1]-this._width/2)*2}%`),p.append(h,...this._sweeps.filter(m=>m!==null),...this._names());let _=this._total("radial-chart-total");return _&&p.append(_),p}};Dt.key="Expressive_RadialChart";function Za(r,s,t){let e=fi(s-r,t);for(;Math.floor(r/e)*e+t*e<s;)e=fi(e*t*1.001,t);return[Math.floor(r/e)*e,e]}var Pt=class extends G{get _type(){return"mixed-chart"}get _points(){return!0}_stack(s){let t=s.filter(e=>X(e,"column"));super._stack(t.filter(e=>!X(e,"end"))),super._stack(t.filter(e=>X(e,"end")))}_scale(s,t,e){let i=s.filter(c=>X(c,"end")),n=s.filter(c=>!i.includes(c)),o=c=>c.some(h=>X(h,"column")),a=[this._number("endMin"),this._number("endMax")],l=super._scale(n,t,e,o(n));return super._scale(i,...a,o(i)),[t,e,...a].every(c=>c===null)&&this._align(n,i),l}_align(s,t){let e=s.length?s[0].scale.ticks.length-1:0;if(e<1||!t.length)return;let[i,n]=Za(t[0].scale.min,t[0].scale.max,e),o=i+e*n;this._apply(t,{min:i,max:o,ticks:ss(i,o,n)})}_draw(){let s=document.createElement("div");s.className="mixed-chart-marks";let t=super._draw(this.series.filter(e=>X(e,"column")));return t.className="mixed-chart-columns",s.append(t,this._drawLines(this.series.filter(e=>!X(e,"column")))),s}};Pt.key="Expressive_MixedChart";var En=r=>r.map(({x:s,y:t})=>`M${s},${t}h0`).join(""),ls=({row:r,series:s})=>`${r} ${s.column}`,Qa=r=>parseFloat(r)*(r.trim().endsWith("ms")?1:1e3);function Ja(r,s,t,e){r.style.setProperty("--scatter-chart-size",`${s}`),!(!e||!t||t.size===s)&&r.animate({"--scatter-chart-size":[`${t.size}`,`${s}`]},{duration:Qa(e.dur),easing:`cubic-bezier(${e.keySplines})`})}var Rt=class extends A{get _type(){return"scatter-chart"}get _seriesFrom(){return 2}get _seriesTo(){return this._bubble?-1:void 0}get _bubble(){return this.el.classList.contains("bubble")}static get defaults(){return{...A.defaults,xMin:null,xMax:null}}_arrange(s){let t=this._xs=this._rows.map(i=>kt(i.cells[1])),e=this._sizes=this._rows.map(i=>this._size(i));for(let i of s)i.values=i.tops=i.values.map((n,o)=>t[o]===null||e[o]===null?null:n)}_size(s){if(!this._bubble)return 1;let t=kt(s.cells[this._header.length-1])??0;return t>0?t:null}get _count(){return this._marks?.length??0}show(s){if(!this._tooltip||s===this.activeIndex)return;this.activeIndex=s;let t=this._marks[s];this._cursor.hidden=this._tooltip.hidden=!t,t&&this._fill(t)}_fill({row:s,series:t,x:e,y:i,size:n}){this._cursor.dataset.series=t.color,this._cursor.style.setProperty("--scatter-chart-size",`${n}`);for(let c of[this._cursor,this._tooltip])Object.assign(c.style,{left:`${e}%`,top:`${i}%`});this._tooltip.classList.toggle("end",e>50);let[o,a]=[document.createElement("strong"),W(t.name)];o.textContent=this.labels[s],a.dataset.series=t.color;let l=this._bubble?this._cellText(s,this._header.length-1):[];this._tooltip.replaceChildren(o,...this._cellText(s,1),a,W(t.text[s]),...l)}_cellText(s,t){let e=W(this._header[t].textContent.trim());return e.className="x",[e,W(this._rows[s].cells[t]?.textContent.trim()??"")]}_indexAt(s){let[t,e]=[this._plot,this._plot.getBoundingClientRect()],i=e.left+t.clientLeft,n=e.top+t.clientTop,[o,a]=[t.clientWidth,t.clientHeight],l=-1,c=1/0;return this._marks.forEach(({x:h,y:d},p)=>{let _=Math.hypot(i+h/100*o-s.clientX,n+d/100*a-s.clientY);(l<0||_<c)&&(l=p,c=_)}),l}_keyTarget(s){return vi(s,this.activeIndex,this._marks.length-1)}_read(){[this._drawn,this._marks]=[this._marks??[],[]],super._read(),this.series.length&&(this._xFit=this._xScale(),this._xAffix=as(this._rows.map(s=>s.cells[1])))}_xScale(){let[s,t]=this._xRange(),[e,i]=[this._xEnd("xMin"),this._xEnd("xMax")];return this._fit(e??s,i??t,[e!==null,i!==null])}_xRange(){let s=this._xs.filter((n,o)=>this._hasPoint(o));if(!s.length)return[-1,1];let[t,e]=[s.reduce((n,o)=>Math.min(n,o)),s.reduce((n,o)=>Math.max(n,o))],i=(e-t)*.1||1;return[t-i,e+i]}_xEnd(s){return this._number(s)??this.options[s]??null}_xAt(s){let{min:t,max:e}=this._xFit,i=(s-t)/(e-t||1)*100;return this._reversed?100-i:i}_hasPoint(s){return this.series.some(t=>t.values[s]!==null)}_layout(){let s=this._sizes.reduce((t,e,i)=>this._hasPoint(i)?Math.max(t,e):t,0);return this.labels.flatMap((t,e)=>this.series.filter(i=>i.values[e]!==null).map(i=>({row:e,series:i,x:this._xAt(this._xs[e]),y:i.y(i.values[e]),size:Math.sqrt(this._sizes[e]/s)})))}_draw(){this._marks=this._layout();let s=M("svg",{viewBox:"0 0 100 100",preserveAspectRatio:"none","aria-hidden":"true",focusable:"false"}),t=this._before.length?Pe(this.el):null,e=new Map(this._drawn.map(i=>[ls(i),i]));return s.append(...this.series.map(i=>this._group(i,t,e))),s}_group(s,t,e){let i=M("g",{class:`scatter-chart-series ${s.className}`.trim(),"data-series":s.color}),n=this._marks.filter(a=>a.series===s),o=this._bubble?n.sort((a,l)=>l.size-a.size).map(a=>[a]):[n];return i.append(...o.map(a=>this._pointPath(a,t,e))),i}_pointPath(s,t,e){let i=M("path",{class:"scatter-chart-points",d:En(s)});return t&&Re(i,En(s.map(n=>e.get(ls(n))??n)),t),this._bubble&&Ja(i,s[0].size,e.get(ls(s[0])),t),i}_axes(){return this._axis?[...super._axes(),this._xAxis()]:[]}_xAxis(){let s=ns(this.el,this._xFit.ticks);return is("scatter-chart-axis x",this._xFit.ticks,t=>rs(s,t,this._xAffix),t=>this._xAt(t))}_guides(){return this._legend()}};Rt.key="Expressive_ScatterChart";function yn(r){let s=r.reduce((t,e)=>Math.max(t,e??0),0);return r.map(t=>t>0?t/s*100:null)}function tl(r,s){let t=document.createElement("span");return t.dataset.series="1",t.style.setProperty("--width",String(r)),s!=null&&t.style.setProperty("--from-width",String(s)),t}var Ft=class extends A{get _type(){return"funnel-chart"}get _horizontal(){return!0}get _axis(){return!1}get _points(){return!1}_read(){super._read();for(let s of this.series)s.color="1"}_share(s){let t=this.series[0].values,[e,i]=[t[0],t[s]];return e>0&&i>0?fe(this.el,i/e):""}_legend(){return[]}_draw(){let s=document.createElement("div");s.className="funnel-chart-stages",s.setAttribute("aria-hidden","true"),this._plot.style.setProperty("--rows",String(this.labels.length));let t=yn(this._before[0]?.values??[]);return yn(this.series[0].values).forEach((e,i)=>{let n=document.createElement("div");e!==null&&n.append(tl(e,t[i])),s.append(n)}),s}};Ft.key="Expressive_FunnelChart";var Fe=2,el=4,cs=(r,s)=>r.cells[s]?.textContent.trim()??"",Tn=r=>r.reduce((s,t)=>s+t.value,0);function il(r,s){let[t,e,i]=[cs(r,0),cs(r,1),Number(kt(r.cells[2]))];return t&&e&&i>0?{row:s,source:t,target:e,value:i}:null}function Ln(r,s,t,e=new Set){return s===t?!0:(e.add(s),r.some(i=>i.source===s&&!e.has(i.target)&&Ln(r,i.target,t,e)))}function sl(r){let s=[];return r.forEach((t,e)=>{let i=il(t,e);i&&!Ln(s,i.target,i.source)&&s.push(i)}),s}function xn(r,s,t){if(!t.has(r)){let e=s.filter(i=>i.target===r).map(i=>xn(i.source,s,t)+1);t.set(r,Math.max(0,...e))}return t.get(r)}function nl(r){let s=new Map;return[...new Set(r.flatMap(t=>[t.source,t.target]))].map((t,e)=>({name:t,color:Z(e,St),column:xn(t,r,s),size:Math.max(Tn(r.filter(i=>i.target===t)),Tn(r.filter(i=>i.source===t))),x:0,top:0,height:0}))}function rl(r){let s=Math.max(...r.map(a=>a.column))+1,t=Array.from({length:s},(a,l)=>r.filter(c=>c.column===l)),e=Math.min(el,50/Math.max(...t.map(a=>a.length))),i=a=>100-(a.length-1)*e,n=a=>a.reduce((l,c)=>l+c.size,0),o=Math.min(...t.map(a=>i(a)/n(a)));return t.forEach((a,l)=>{let c=(i(a)-n(a)*o)/2;for(let h of a)Object.assign(h,{x:l/(s-1)*(100-Fe),top:c,height:h.size*o}),c+=h.height+e}),o}function ol(r,s,t){let e=new Map(s.map(a=>[a.name,a])),[i,n]=[new Map,new Map],o=(a,l,c)=>{let h=l.top+(a.get(l)??0);return a.set(l,h-l.top+c),h};return r.map(a=>{let[l,c,h]=[e.get(a.source),e.get(a.target),a.value*t];return{flow:a,source:l,target:c,from:o(i,l,h),to:o(n,c,h),size:h}})}var Nt=class extends A{get _type(){return"sankey-chart"}get _seriesFrom(){return 2}get _seriesTo(){return 3}get _axis(){return!1}get _count(){return this._links?.length??0}show(s){if(!this._tooltip||s===this.activeIndex)return;this._paths[this.activeIndex]?.classList.remove("active"),this._paths[s]?.classList.add("active"),this.activeIndex=s;let t=this._links[s];this._tooltip.hidden=!t,t&&this._fill(t)}_fill({flow:s,source:t,target:e,from:i,to:n,size:o}){let a=this._across((t.x+Fe+e.x)/2);Object.assign(this._tooltip.style,{left:`${a}%`,top:`${(i+n+o)/2}%`}),this._tooltip.classList.toggle("end",a>50);let l=this._header.map(p=>p.textContent.trim()),[c,h,d]=[W(l[0]),W(l[1]),W(l[2])];c.dataset.series=t.color,h.dataset.series=e.color,d.className="value",this._tooltip.replaceChildren(c,W(t.name),h,W(e.name),d,W(cs(this._rows[s.row],2)))}_indexAt(s){let e=this.el.getRootNode().elementsFromPoint(s.clientX,s.clientY).find(i=>this._paths.includes(i));return this._paths.indexOf(e)}_keyTarget(s){return vi(s,this.activeIndex,this._links.length-1)}_read(){super._read();let s=sl(this._rows);if(!s.length){[this.series,this._nodes,this._links]=[[],[],[]];return}this._nodes=nl(s),this._links=ol(s,this._nodes,rl(this._nodes))}_across(s){return this._reversed?100-s:s}_nodePath({x:s,top:t,height:e}){let[i,n]=[this._across(s),this._across(s+Fe)];return`M${i},${t}H${n}V${t+e}H${i}Z`}_linkPath({source:s,target:t,from:e,to:i,size:n}){let[o,a]=[s.x+Fe,t.x],[l,c,h]=[this._across(o),this._across((o+a)/2),this._across(a)];return`M${l},${e}C${c},${e} ${c},${i} ${h},${i}V${i+n}C${c},${i+n} ${c},${e+n} ${l},${e+n}Z`}_draw(){let s=M("svg",{viewBox:"0 0 100 100",preserveAspectRatio:"none","aria-hidden":"true",focusable:"false"}),[t,e]=[this._shapes??new Map,this._before.length?Pe(this.el):null];this._shapes=new Map;let i=(o,a,l,c)=>{let h=M("path",{class:o,"data-series":l,d:c});return e&&t.has(a)&&Re(h,t.get(a),e),this._shapes.set(a,c),h};this._paths=this._links.map(o=>i("sankey-chart-link",JSON.stringify([o.source.name,o.target.name]),o.source.color,this._linkPath(o)));let n=this._nodes.map(o=>i("sankey-chart-node",JSON.stringify(o.name),o.color,this._nodePath(o)));return s.append(...this._paths,...n),s}_axes(){let s=document.createElement("div");s.className="sankey-chart-names",s.setAttribute("aria-hidden","true");let t=Math.max(...this._nodes.map(e=>e.column));return s.append(...this._nodes.map(e=>this._name(e,e.column===t))),[s]}_name({name:s,x:t,top:e,height:i},n){let o=document.createElement("span");return o.className=n?"sankey-chart-name end":"sankey-chart-name",o.textContent=s,o.style.setProperty("--sankey-chart-x",`${n?t:t+Fe}%`),o.style.setProperty("--sankey-chart-y",`${e+i/2}%`),o}_guides(){return[]}};Nt.key="Expressive_SankeyChart";var al=["ArrowRight","ArrowDown"],ll=["ArrowLeft","ArrowUp"],bi=r=>r.reduce((s,t)=>s+t,0),hs=([r,s,t,e])=>[s,r,e,t];function wn(r,s){let[t,e]=[bi(r)**2,s**2];return Math.max(...r.map(i=>Math.max(e*i/t,t/(e*i))))}function us(r,s){if(s[2]<s[3]){let[c,h]=us(r,hs(s));return[c.map(hs),hs(h)]}let[t,e,i,n]=s,o=bi(r)/n,a=e;return[r.map(c=>{let h=[t,a,o,c/o];return a+=c/o,h}),[t+o,e,i-o,n]]}function cl(r,s){let t=[],e=[];for(let i of r){let n=Math.min(s[2],s[3]);if(e.length&&wn([...e,i],n)>wn(e,n)){let[o,a]=us(e,s);t.push(...o),[s,e]=[a,[]]}e.push(i)}return[...t,...us(e,s)[0]]}var hl=([r,s,t,e],i,n)=>i>=r&&i<r+t&&n>=s&&n<s+e,ul=(r,s)=>r+s/2>.5?{top:"auto",bottom:`${(1-r-s)*100}%`}:{top:`${r*100}%`,bottom:"auto"},Bt=class extends A{get _type(){return"treemap-chart"}get _axis(){return!1}get _points(){return!1}show(s){if(!this._tooltip)return;let t=this._drawnFrom(s);t!==this.activeIndex&&(this._boxes[this.activeIndex]?.classList.remove("active"),this._boxes[t]?.classList.add("active"),super.show(t))}_drawnFrom(s){return s<0?s:this._boxes.findIndex((t,e)=>e>=s&&t)}_share(s){return fe(this.el,this._values[s]/bi(this._values))}_place(s){let[t,e,i,n]=this._places[s],o=t+i/2,a=this._reversed?1-o:o;Object.assign(this._tooltip.style,{left:`${a*100}%`,...ul(e,n)}),this._tooltip.classList.toggle("end",a>.5)}_indexAt(s){let t=this._plot.getBoundingClientRect(),e=(s.clientX-t.left)/t.width,[i,n]=[this._reversed?1-e:e,(s.clientY-t.top)/t.height];return this._places.findIndex(o=>o&&hl(o,i,n))}_keyTarget(s){let t=this._boxes.flatMap((o,a)=>o?[a]:[]),[e,i]=[t.indexOf(this.activeIndex),t.length-1],n=al.includes(s)?Math.min(e+1,i):ll.includes(s)?Math.max(e-1,0):{Home:0,End:i}[s];return n===void 0?super._keyTarget(s):t[n]}destroy(){this._sizes?.disconnect(),super.destroy()}_guides(){return[]}_draw(){this._values=this.series[0].values.map(e=>Math.max(0,e??0));let s=document.createElement("div");s.className="treemap-chart-boxes",s.setAttribute("aria-hidden","true");let t=0;return this._boxes=this._values.map((e,i)=>{if(!e)return null;let n=document.createElement("div");n.className="treemap-chart-box",n.dataset.series=Z(t++,St);let[o,a]=[document.createElement("span"),document.createElement("span")];return[o.textContent,a.textContent]=[this.labels[i],this.series[0].text[i]],n.append(o,a),s.append(n),n}),this.el.append(this._plot),this._layout(),this._sizes?.disconnect(),this._sizes=new ResizeObserver(()=>this._layout()),this._sizes.observe(this._plot),s}_layout(){if(!this._plot)return this._sizes.disconnect();let[s,t]=[this._plot.clientWidth||1,this._plot.clientHeight||1],e=this._values.map((o,a)=>a).filter(o=>this._values[o]).sort((o,a)=>this._values[a]-this._values[o]),i=s*t/bi(this._values),n=cl(e.map(o=>this._values[o]*i),[0,0,s,t]);this._places=[],e.forEach((o,a)=>{let[l,c,h,d]=n[a],p=this._places[o]=[l/s,c/t,h/s,d/t];Object.assign(this._boxes[o].style,{insetInlineStart:`${p[0]*100}%`,top:`${p[1]*100}%`,width:`${p[2]*100}%`,height:`${p[3]*100}%`})})}};Bt.key="Expressive_TreemapChart";var dl={classes:"",menuOptions:{},searchable:!1,i18n:{searchLabel:"Search options",noResults:"No results"}},Ne=class Ne extends b{constructor(t,e){super(t,e);this._originalLabels=new Map;this._validationMessage=null;this._bindReset=()=>{};this._handleSelectChange=()=>{this._setValueToInput(),this._setSelectedStates(),this._syncValidationError()};this._handleInvalid=t=>{t.defaultPrevented||(this._validationMessage||(this._validationMessage=document.createElement("small"),this._validationMessage.id=this.input.id+"-error",this._validationMessage.className="supporting-text",this._validationMessage.style.color="var(--md-sys-color-error)",this.wrapper.append(this._validationMessage),this.input.setAttribute("aria-describedby",[this.input.getAttribute("aria-describedby"),this._validationMessage.id].filter(Boolean).join(" "))),this.input.ariaInvalid="true",this._syncValidationError())};this._handleNativeFocus=()=>queueMicrotask(()=>{this.constructor.getInstance(this.el)===this&&this.el.matches(":focus")&&this.input.focus()});this._handleReset=()=>{this._resetSearch(),this._handleSelectChange(),this._clearValidationError()};this._handleOptionKeydown=t=>{(t.key===" "||t.key==="Enter")&&this._handleOptionClick(t)};this._handleOptionClick=t=>{t.target.matches('input[type="checkbox"]')||t.preventDefault();let e=t.target.closest("li");this._selectOptionElement(e),t.stopPropagation()};this._handleOptionFocus=t=>{if(this._searchInput)return;let e=t.target;if(!(e instanceof Element))return;let i=e.closest('li[role="option"]');i&&this.input.setAttribute("aria-activedescendant",i.id)};this._handleInputClick=()=>{this.menu&&this.menu.isOpen&&(this._setValueToInput(),this._setSelectedStates())};this._filterOptions=()=>{let t=this._searchInput.value.trim().toLowerCase();this._filterSearch(t),this._searchStatus.textContent=this._values.some(({optionEl:e})=>!e.hidden)?"":this.options.i18n.noResults,this.input.removeAttribute("aria-activedescendant"),this.menu?.recalculateDimensions()};this._handleSearchKeydown=t=>{t.stopPropagation(),!(!u.plainKey(t)||u.isComposing(t))&&(this._searchDismissKey(t)||this._searchNavigate(t))};if(this.el.classList.contains("browser-default")||new.target===Ne&&this.el.matches("[data-tree]")){Reflect.set(this.el,new.target.key,void 0);return}this.isMultiple=this.el.multiple,this._searchable=this._canSearch(),this.nativeTabIndex=this.el.tabIndex,this.el.tabIndex=-1,this._values=[],this._createdWrapper=!1,this._setupMenu(),this._setupEventHandlers()}static get defaults(){return dl}_canSearch(){return this.constructor===Ne&&this.options.searchable}destroy(){this._events.abort(),this.menuEl&&(this._clearValidationError(),this.menu?.destroy(),this._removeMenu(),this.el.tabIndex=this.nativeTabIndex,super.destroy())}refresh(){if(!this.menuEl)return;this._bindReset();let t=this.menuEl.getRootNode(),e=this._values.find(i=>i.optionEl.contains(t.activeElement))?.el;this.input.disabled=this.el.matches(":disabled"),this.wrapper.classList.toggle("disabled",this.input.disabled),this.input.disabled?this.menu?.close():this.menu||this._initMenu(),this.input.removeAttribute("aria-activedescendant"),this._rebuildOptions(),this._handleSelectChange(),this.menu&&(this.menu.focusedIndex=-1),this.menu?.isOpen&&(this.menu.recalculateDimensions(),this._restoreOptionFocus(e))}_restoreOptionFocus(t){if(!t)return;(this._values.filter(({el:i,optionEl:n})=>i===t&&n.tabIndex===0).map(({optionEl:i})=>i)[0]||this._searchInput||this.input).focus()}_setupEventHandlers(){let{signal:t}=this._events;this._setupOptionHandlers(),this.el.addEventListener("change",this._handleSelectChange,{signal:t}),this.el.addEventListener("invalid",this._handleInvalid,{signal:t}),this.el.addEventListener("focus",this._handleNativeFocus,{signal:t}),this.input.addEventListener("click",this._handleInputClick,{signal:t}),this.menuEl.addEventListener("focusin",this._handleOptionFocus,{signal:t}),this._bindReset=B(this.el,this._handleReset,t)}_setupOptionHandlers(){let{signal:t}=this._events;this.menuEl.querySelectorAll("li:not(.optgroup)").forEach(e=>{e.addEventListener("click",this._handleOptionClick,{signal:t}),e.addEventListener("keydown",this._handleOptionKeydown,{signal:t})})}_syncValidationError(){this._validationMessage&&(this.el.willValidate&&!this.el.validity.valid?this._validationMessage.textContent=this.el.validationMessage:this._clearValidationError())}_clearValidationError(){if(!this._validationMessage)return;let t=this.input.getAttribute("aria-describedby")?.split(/\s+/).filter(e=>e!==this._validationMessage.id).join(" ");t?this.input.setAttribute("aria-describedby",t):this.input.removeAttribute("aria-describedby"),this.input.ariaInvalid=this.el.ariaInvalid,this._validationMessage.remove(),this._validationMessage=null}_selectOptionElement(t){if(!t.hidden&&!this.el.matches(":disabled")&&!t.classList.contains("disabled")&&!t.classList.contains("optgroup")){let e=this._values.find(n=>n.optionEl===t);if(!e||e.el.matches(":disabled"))return;let i=JSON.stringify(this.getSelectedValues());e.el.selected=!this.isMultiple||!e.el.selected,this._handleSelectChange(),JSON.stringify(this.getSelectedValues())!==i&&this.el.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0,composed:!0})),this.isMultiple||this._closeSingleSelect()}}_closeSingleSelect(){this.menu?.close(),this._searchInput&&this.input.focus()}_setupMenu(){this.labelEl=this.el.labels?.[0]??null,Array.from(this.el.labels??[]).forEach(t=>{this._originalLabels.set(t,{for:t.getAttribute("for"),id:t.getAttribute("id")})}),this.labelEl&&!this.el.closest("label")&&(this._labelPlaceholder=document.createComment(""),this.labelEl.before(this._labelPlaceholder)),this._setupWrapper(),this._hideNativeSelect(),this.el.matches(":disabled")&&this.wrapper.classList.add("disabled"),this.menuEl=document.createElement(this._searchable?"div":"menu"),this.menuEl.popover="manual",this.menuEl.id=`select-options-${u.guid()}`,this.menuEl.setAttribute("role","listbox"),this.menuEl.ariaMultiSelectable=this.isMultiple.toString(),this.isMultiple&&this.menuEl.classList.add("multiple-select-menu"),this._buildOptions(),this.wrapper.append(this.menuEl),this._buildInput(),this._searchable&&this._buildSearch(),this._buildCaret(),this._initMenu(),this._setSelectedStates(),this._labelPlaceholder&&this.input.after(this.labelEl)}_setupWrapper(){let t=this.el.parentElement;t&&t.matches(".field")&&!t.querySelector(":scope > .hide-select")&&!t.querySelector(":scope > input, :scope > textarea")?(this.wrapper=t,this._createdWrapper=!1):(this.wrapper=document.createElement("div"),this.wrapper.classList.add("field"),this._createdWrapper=!0,this.el.before(this.wrapper)),this.options.classes.length>0&&this.wrapper.classList.add(...this.options.classes.split(" ").filter(Boolean))}_hideNativeSelect(){let t=document.createElement("div");t.classList.add("hide-select"),t.ariaHidden="true",this.el.before(t),t.appendChild(this.el),this._createdWrapper&&this.wrapper.append(t)}_buildInput(){this.input=document.createElement("input"),this.input.id="select-input-"+u.guid(),this.input.classList.add("menu-trigger","no-autoinit"),this.input.type="text",this.input.readOnly=!0,this.input.setAttribute("data-target",this.menuEl.id),this.input.ariaReadOnly="true",this.input.ariaRequired=this.el.hasAttribute("required").toString(),this.input.disabled=this.el.matches(":disabled"),this.input.setAttribute("tabindex",this.nativeTabIndex.toString());let t=this.el.attributes;for(let e=0;e<t.length;++e){let i=t[e];i.name.startsWith("aria-")&&this.input.setAttribute(i.name,i.value)}this.input.setAttribute("role","combobox"),this.input.setAttribute("aria-haspopup","listbox"),this.input.ariaExpanded="false",this.input.setAttribute("aria-controls",this.menuEl.id),this.input.placeholder=" ",this._originalLabels.forEach((e,i)=>{i.htmlFor=this.input.id}),this._labelPlaceholder&&this._originalLabels.size>1&&!this.input.getAttribute("aria-label")&&!this.input.getAttribute("aria-labelledby")&&this.input.setAttribute("aria-labelledby",Array.from(this._originalLabels.keys(),(e,i)=>(e.id||(e.id=`${this.input.id}-label-${i}`),e.id)).join(" ")),this.wrapper.prepend(this.input),this._setValueToInput()}_buildCaret(){let t=document.createElement("span");t.classList.add("caret"),t.setAttribute("aria-hidden","true"),this.wrapper.prepend(t)}_buildSearch(){this.menuEl.classList.add("select-search-popup"),this.menuEl.setAttribute("role","dialog"),this.menuEl.removeAttribute("aria-multiselectable"),this.menuEl.classList.remove("multiple-select-menu"),this.input.setAttribute("aria-haspopup","dialog"),this._searchResults=this._searchList(),this._searchInput=document.createElement("input"),this._searchInput.type="search",this._searchInput.placeholder=this.options.i18n.searchLabel,this._searchInput.setAttribute("aria-label",this.options.i18n.searchLabel),this._searchStatus=document.createElement("div"),this._searchStatus.setAttribute("role","status"),this.menuEl.append(this._searchInput,this._searchStatus,this._searchResults),this._searchInput.addEventListener("input",this._filterOptions,{signal:this._events.signal}),this.menuEl.addEventListener("keydown",this._handleSearchKeydown,{signal:this._events.signal,capture:!0}),this._nameSearch(),this._filterOptions()}_searchList(){let t=document.createElement("menu");return t.id=this.menuEl.id+"-list",t.setAttribute("role","listbox"),t.ariaMultiSelectable=this.isMultiple.toString(),t.classList.toggle("multiple-select-menu",this.isMultiple),t.append(...this.menuEl.childNodes),t}_nameSearch(){let t=Array.from(this._originalLabels.keys(),(n,o)=>(n.id||(n.id=this.input.id+"-label-"+o),n.id)).join(" "),e=this.input.hasAttribute("aria-labelledby")?"aria-labelledby":"aria-label",i=this.input.getAttribute(e);[this.menuEl,this._searchResults].forEach(n=>n.setAttribute(i?e:"aria-labelledby",i||t))}_filterSearch(t){this._values.forEach(({el:e,optionEl:i})=>{i.hidden=!e.textContent.trim().toLowerCase().includes(t),i.tabIndex=i.hidden||e.matches(":disabled")?-1:0}),this._filterGroups()}_filterGroups(){let t=new Set(this._values.filter(({optionEl:e})=>!e.hidden).map(({optionEl:e})=>e.id));for(let e of this._searchResults.querySelectorAll(":scope > li.optgroup"))e.hidden=!e.getAttribute("aria-owns").split(" ").some(i=>t.has(i))}_searchRows(){return this._values.map(({optionEl:t})=>t).filter(t=>t.tabIndex!==-1)}_searchDismissKey(t){return t.key==="Tab"?(this._searchTab(t),!0):t.key!=="Escape"?!1:(t.preventDefault(),this._closeSingleSelect(),!0)}_searchTab(t){if(t.shiftKey){t.preventDefault(),this._searchBackwardTab(t);return}let e=this._searchRows()[0];if(t.target===this._searchInput&&e){t.preventDefault(),e.focus();return}this._closeSingleSelect()}_searchBackwardTab(t){t.target===this._searchInput?this._closeSingleSelect():this._searchInput.focus()}_searchNavigate(t){if(t.target===this._searchInput){this._searchInputKey(t);return}this._searchRowKey(t)}_searchInputKey(t){if(t.key==="Enter"&&t.preventDefault(),!["ArrowDown","ArrowUp"].includes(t.key))return;t.preventDefault();let e=this._searchRows();this._focusSearchRow(e[t.key==="ArrowUp"?e.length-1:0])}_focusSearchRow(t){t&&t.focus()}_searchRowKey(t){if(["Enter"," "].includes(t.key)){t.preventDefault(),this._selectOptionElement(t.target);return}let e=u.focusTarget([this._searchInput,...this._searchRows()],t,{ArrowDown:1,ArrowUp:-1});e&&(t.preventDefault(),t.key==="Home"?this._searchRows()[0]?.focus():e.focus())}_clearSearch(){this._searchInput&&(this._searchInput.value="",this._filterOptions())}_resetSearch(){this._searchInput&&(this.menu?.close(),this._clearSearch())}_bindSearchClose(t){let e=t.onCloseStart;t.onCloseStart=()=>(this._clearSearch(),e?.call(this.menu,this.el))}_initMenu(){if(this.el.matches(":disabled"))return;let t={...this.options.menuOptions};this._searchInput&&this._bindSearchClose(t),t.coverTrigger=!1;let e=t.onOpenEnd,i=t.onCloseEnd;t.onOpenEnd=()=>{this._focusMenu(),this.input.ariaExpanded="true",typeof e=="function"&&e.call(this.menu,this.el)},t.onCloseEnd=()=>{this.input.ariaExpanded="false",this.input.removeAttribute("aria-activedescendant"),typeof i=="function"&&i.call(this.menu,this.el)},t.closeOnClick=!1,this.menu=$.init(this.input,t)}_focusMenu(){if(!this._searchInput)return this._focusSelected();this.menu.options.autoFocus&&!u.focusIsIn(this.menuEl)&&this._searchInput.focus()}_focusSelected(){let t=this.menuEl.querySelector(".selected");if(t){if(this.menu.focusedIndex=[...t.parentNode.children].indexOf(t),this.menu._focusFocusedItem(),this.menu.isScrollable){let e=t.getBoundingClientRect().top-this.menuEl.getBoundingClientRect().top;e-=this.menuEl.clientHeight/2,this.menuEl.scrollTop=e}t.id&&this.input.setAttribute("aria-activedescendant",t.id)}}_nativeOptions(){return Array.from(this.el.children).filter(t=>["OPTION","OPTGROUP"].includes(t.tagName))}get _optionList(){return this._searchResults??this.menuEl}_buildOptions(){this.selectOptions=this._nativeOptions(),this._values=[],this.selectOptions.forEach(t=>{if(t.tagName==="OPTION"){let e=this._createAndAppendOptionWithIcon(t,this.isMultiple?"multiple":void 0);this._values.push({el:t,optionEl:e})}else if(t.tagName==="OPTGROUP"){let e="opt-group-"+u.guid(),i=document.createElement("li");i.classList.add("optgroup"),i.tabIndex=-1,i.setAttribute("role","group"),i.setAttribute("aria-labelledby",e);let n=document.createElement("span");n.id=e,n.setAttribute("role","presentation"),n.textContent=t.getAttribute("label")??"",i.replaceChildren(n),this._optionList.append(i);let o=[];Array.from(t.children).filter(l=>l.tagName==="OPTION").forEach(l=>{let c=this._createAndAppendOptionWithIcon(l,"optgroup-option");o.push(c.id),this._values.push({el:l,optionEl:c})}),i.setAttribute("aria-owns",o.join(" "))}})}_rebuildOptions(){this._optionList.replaceChildren(),this._buildOptions(),this._setupOptionHandlers(),this.menu?._makeMenuFocusable(),this._searchInput&&this._filterOptions()}_removeMenu(){this.wrapper?.querySelector(":scope > .caret")?.remove(),this.input?.remove(),this.menuEl?.remove();let t=this.el.parentElement;t?.classList.contains("hide-select")&&t.replaceWith(this.el),this._originalLabels.forEach((e,i)=>{for(let n of["for","id"])w(i,n,e[n])}),this._labelPlaceholder?.replaceWith(this.labelEl),this.wrapper&&(this._createdWrapper?this.wrapper.replaceWith(this.el):(this.wrapper.classList.remove("disabled"),this.options.classes.length>0&&this.wrapper.classList.remove(...this.options.classes.split(" ").filter(Boolean))))}_createAndAppendOptionWithIcon(t,e){let i=document.createElement("li");i.id="select-option-"+u.guid(),i.setAttribute("role","option"),i.tabIndex=0;let n=this.el.matches(":disabled")||t.matches(":disabled");n&&(i.classList.add("disabled"),i.ariaDisabled="true",i.tabIndex=-1),e==="optgroup-option"&&i.classList.add(e);let o=t.textContent,a=document.createElement("span");if(this.isMultiple&&!n){let d=document.createElement("label"),p=document.createElement("input");p.type="checkbox",p.tabIndex=-1;let _=document.createElement("span");_.textContent=o,d.append(p,_),a.appendChild(d)}else a.textContent=o;i.appendChild(a);let l=t.getAttribute("data-icon"),c=je(l,this.el.ownerDocument.baseURI),h=t.getAttribute("class")?.split(" ").filter(Boolean);if(c){let d=document.createElement("img");h?.length&&d.classList.add(...h),d.src=c,d.ariaHidden="true",i.prepend(d)}return this._optionList.append(i),i}_setValueToInput(){this.input.value=Array.from(this.el.selectedOptions,t=>t.textContent.trim()).join(", ")}_setSelectedStates(){this._values.forEach(({el:t,optionEl:e})=>{e.classList.toggle("selected",t.selected),e.ariaSelected=String(t.selected);let i=e.querySelector('input[type="checkbox"]');i&&(i.checked=t.selected)})}getSelectedValues(){return Array.from(this.el.selectedOptions,t=>t.value)}};Ne.key="Expressive_FormSelect";var K=Ne;var pl={margin:5,transition:10,duration:250,align:"left"},Ei=class{constructor(s,t,e){this._handleDocumentClick=s=>{if(!this.visible)return;let t=s.composedPath();[...this.triggers,this.container].some(e=>t.includes(e))||this.hide()};this.destroy=()=>{document.removeEventListener("click",this._handleDocumentClick),this.container.remove()};this.show=()=>{this.visible||(this.visible=!0,document.addEventListener("click",this._handleDocumentClick),this._place(),this.container.style.visibility="visible",this._animate(this.options.transition,"1"))};this.hide=()=>{this.visible&&(this.visible=!1,document.removeEventListener("click",this._handleDocumentClick),this.container.removeAttribute("style"),this._animate(0,"0"))};this.el=s,this.triggers=[s],this.options={...pl,...e},this.container=document.createElement("div"),this.container.classList.add("display-docked"),this.container.append(t),s.parentElement.append(this.container)}_animate(s,t){let{duration:e}=this.options;this.container.style.transition=`transform ${e}ms ease-out, opacity ${e}ms ease-out`,setTimeout(()=>{this.container.style.transform=`translateX(0px) translateY(${s}px)`,this.container.style.opacity=t},1)}_place(){let{margin:s,transition:t,align:e}=this.options,{offsetHeight:i,offsetWidth:n}=this.el,o=this.container.offsetWidth,a=this.el.getBoundingClientRect(),l=a.left+window.scrollX;e==="center"?l+=n/2-o/2:e==="right"&&(l+=n-o-s);let c=a.top+window.scrollY+i+s,h=u._repositionWithinScreen(l,c,o,this.container.offsetHeight,s,t,e);u._placeInOffsetParent(this.container,h)}};var _e=class{constructor(s,t,e){this._settled=!1;this._opener=null;this._downOnScrim=!1;this._handlePointerDown=s=>{this._downOnScrim=s.target===this.dialog};this._handleClick=s=>{s.target===this.dialog&&this._downOnScrim&&this.dialog.close(),this._downOnScrim=!1};this._handleClose=()=>{let s=!this._settled;this._settled=!1,this._opener?.focus({preventScroll:!0}),s&&this.onDismiss()};this.destroy=()=>{this.dialog.removeEventListener("pointerdown",this._handlePointerDown),this.dialog.removeEventListener("click",this._handleClick),this.dialog.removeEventListener("close",this._handleClose),this.dialog.remove()};this.show=()=>{if(this.dialog.open)return;let s=this.dialog.getRootNode();this._opener=s.activeElement,this.dialog.showModal()};this.hide=()=>{this.dialog.open&&(this._settled=!0,this.dialog.close())};this.triggers=[s],this.onDismiss=e,this.dialog=document.createElement("dialog"),this.dialog.className="display-modal";let i=s.labels?.[0]?.textContent.trim()||s.getAttribute("aria-label");i&&this.dialog.setAttribute("aria-label",i),this.dialog.append(t),s.parentElement.append(this.dialog),this.dialog.addEventListener("pointerdown",this._handlePointerDown),this.dialog.addEventListener("click",this._handleClick),this.dialog.addEventListener("close",this._handleClose)}};function yi(r,s,t,e,i){if(r==="modal")return new _e(s,t,i);if(r==="docked")return new Ei(s,t,e)}function ge(r){r instanceof _e&&r.hide()}var Mn=Array.from({length:12},(r,s)=>new Date(Date.UTC(2023,s,1))),ds=Array.from({length:7},(r,s)=>new Date(Date.UTC(2023,0,1+s)));function ml(r){let s=(i,n)=>{let o=new Intl.DateTimeFormat(r,{...n,calendar:"gregory",timeZone:"UTC"});return i.map(a=>o.format(a))},t=new Intl.Locale(r),e=t.getWeekInfo?.()??t.weekInfo;return{week:e?{firstDay:e.firstDay%7}:{},i18n:{months:s(Mn,{month:"long"}),monthsShort:s(Mn,{month:"short"}),weekdays:s(ds,{weekday:"long"}),weekdaysShort:s(ds,{weekday:"short"}),weekdaysAbbrev:s(ds,{weekday:"narrow"})}}}var kn=r=>r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Ti="(\\d{1,2})",Li=(r,s)=>[`(${r.map(kn).join("|")})`,(t,e)=>s&&(t[s]=r.findIndex(i=>i.toLowerCase()===e.toLowerCase()))],fl={d:()=>[Ti,(r,s)=>r.day=+s],dd:()=>[Ti,(r,s)=>r.day=+s],ddd:r=>Li(r.weekdaysShort),dddd:r=>Li(r.weekdays),m:()=>[Ti,(r,s)=>r.month=+s-1],mm:()=>[Ti,(r,s)=>r.month=+s-1],mmm:r=>Li(r.monthsShort,"month"),mmmm:r=>Li(r.months,"month"),yy:()=>["(\\d{2})",(r,s)=>r.year=+s+(+s<50?2e3:1900)],yyyy:()=>["(\\d{4})",(r,s)=>r.year=+s]},Cn=r=>String(r).padStart(2,"0"),Sn={d:r=>r.getDate(),dd:r=>Cn(r.getDate()),ddd:(r,s)=>s.weekdaysShort[r.getDay()],dddd:(r,s)=>s.weekdays[r.getDay()],m:r=>r.getMonth()+1,mm:r=>Cn(r.getMonth()+1),mmm:(r,s)=>s.monthsShort[r.getMonth()],mmmm:(r,s)=>s.months[r.getMonth()],yy:r=>String(r.getFullYear()).slice(2),yyyy:r=>r.getFullYear()};function _l(r,s,t){let e=[],i=s.split(/(d{1,4}|m{1,4}|y{4}|yy|!.)/g).map(c=>{let h=fl[c]?.(t);return h&&e.push(h),h?h[0]:kn(c)}),n=new RegExp(`^\\s*${i.join("")}\\s*$`,"iu").exec(r);if(!n)return null;let o={};e.forEach(([,c],h)=>c(o,n[h+1]));let a=new Date(2e3,0,1);return a.setFullYear(o.year,o.month,o.day),[a.getFullYear(),a.getMonth(),a.getDate()].join()===[o.year,o.month,o.day].join()?a:null}function gl(r,s={}){let t=u.locale(r);if(!t)return s;let{week:e,i18n:i}=ml(t);return{...e,...s,i18n:{...i,...s.i18n}}}var vl={format:"mmm dd, yyyy",parse:null,isDateRange:!1,dateRangeEndEl:null,isMultipleSelection:!1,defaultDate:null,defaultEndDate:null,setDefaultDate:!1,setDefaultEndDate:!1,disableWeekends:!1,disableDayFn:null,firstDay:0,minDate:null,maxDate:null,yearRange:10,minYear:0,maxYear:9999,minMonth:void 0,maxMonth:void 0,isRTL:!1,yearRangeReverse:!1,showMonthAfterYear:!1,showDaysInNextAndPreviousMonths:!1,openByDefault:!1,container:null,showClearBtn:!1,autoSubmit:!0,i18n:{cancel:"Cancel",clear:"Clear",done:"Ok",previousMonth:"Previous month",nextMonth:"Next month",months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],weekdaysAbbrev:["S","M","T","W","T","F","S"]},events:[],onSelect:null,onDraw:null,onInputInteraction:null,displayPlugin:null,displayPluginOptions:null,onConfirm:null,onCancel:null},x=class x extends b{constructor(t,e){e=gl(t,e);super(t,e);this.multiple=!1;this._writtenInputs=new WeakMap;this._resetDates=new WeakMap;this._selection=0;this._drawDepth=0;this._drawDirty=!1;this._controlsKey=null;this._randId=null;this._focusedDate=null;this._handleInputClick=t=>{let e=t.target;e.type=="date"&&(this.options.openByDefault||this.options.container)&&t.preventDefault(),this._batchDraws(()=>{this.setDateFromInput(e),this.draw(),this.gotoDate(e===this.el?this.date:this.endDate)}),this._showDisplay(),this.options.onInputInteraction&&this.options.onInputInteraction.call(this)};this._handleInputKeydown=u.ignoringComposition(t=>{t.key==="Enter"&&(t.preventDefault(),this._batchDraws(()=>{this.setDateFromInput(t.target),this._focusedDate=t.target===this.endDateEl?this.endDate:this.date,this.draw()}),this.displayPlugin&&this.displayPlugin.show(),this._syncCalendarFocus(!0),this.options.onInputInteraction&&this.options.onInputInteraction.call(this))});this._handleCalendarFocus=t=>{let e=t.target;e.matches(".datepicker-day-button")&&(this._focusedDate=this._dayDate(e),this._syncCalendarFocus())};this._handleCalendarKeydown=t=>{let e=t.target;if(!e.matches(".datepicker-day-button")||!u.plainKey(t))return;let i=this._dayDate(e),n=(i.getDay()-this.options.firstDay+7)%7,o={ArrowLeft:this.options.isRTL?1:-1,ArrowRight:this.options.isRTL?-1:1,ArrowUp:-7,ArrowDown:7,Home:-n,End:6-n};if(Object.hasOwn(o,t.key))i.setDate(i.getDate()+o[t.key]);else if(t.key==="PageUp"||t.key==="PageDown"){let E=i.getDate();i.setDate(1),i.setMonth(i.getMonth()+(t.key==="PageUp"?-1:1)*(t.shiftKey?12:1));let T=new Date(i.getTime());T.setMonth(T.getMonth()+1,0),i.setDate(Math.min(E,T.getDate()))}else return;t.preventDefault();let{minDate:a,maxDate:l,minYear:c,maxYear:h,minMonth:d,maxMonth:p}=this.options;if(a&&i<a&&i.setTime(a.getTime()),l&&i>l&&i.setTime(l.getTime()),i.getFullYear()<c||i.getFullYear()>h||i.getFullYear()===c&&i.getMonth()<(d??0)||i.getFullYear()===h&&i.getMonth()>(p??11))return;this._focusedDate=i;let{year:_,month:m}=this.calendars[0];i.getFullYear()===_&&i.getMonth()===m?this._syncCalendarFocus(!0):this.gotoDate(i)};this._handleCalendarClick=t=>{let e=t.target;e.closest(".is-disabled")||this._batchDraws(()=>{if(e.classList.contains("datepicker-day-button")&&!e.classList.contains("is-empty")&&!e.parentElement.classList.contains("is-disabled")&&!e.parentElement.classList.contains("is-selection-disabled")){let i=new Date(Number(e.getAttribute("data-year")),Number(e.getAttribute("data-month")),Number(e.getAttribute("data-day")));(!this.multiple||this.options.isMultipleSelection)&&this.setDate(i),this.options.isDateRange&&this._handleDateRangeCalendarClick(i),this.options.autoSubmit&&this._finishSelection()}else e.closest(".month-prev")?this.prevMonth():e.closest(".month-next")&&this.nextMonth()})};this._handleDateRangeCalendarClick=t=>{if(this.endDate==null||!x._compareDates(t,this.endDate)){this.setDate(t,!1,x._isDate(this.date)&&t>=this.date);return}this._clearDates(),this.draw()};this._handleClearClick=()=>{this._clearDates(),this.options.autoSubmit&&this._finishSelection()};this._clearDates=()=>{this.date=null,this.endDate=null,this.dates?.splice(0),this.draw()};this._handleMonthChange=t=>{this.gotoMonth(t.target.value)};this._handleYearChange=t=>{this.gotoYear(t.target.value)};this._readBack=()=>{this.options.isMultipleSelection?this._readBackMultiple():this._readBackSingle(),this.draw()};this._handleInputChange=t=>{t instanceof CustomEvent&&t.detail?.firedBy===this||this.setDateFromInput(t.target)};this._finishSelection=()=>{this.setInputValues()};this._confirm=()=>{this._finishSelection(),ge(this.displayPlugin),this._notify("confirm",this.options.onConfirm,{args:[]})};this._cancel=()=>{ge(this.displayPlugin),this._notify("cancel",this.options.onCancel,{args:[]})};this.options.displayPlugin==="modal"&&Object.assign(this.options,{openByDefault:!0,autoSubmit:!1}),this._setDateBounds(),this.id=u.guid(),this.options.isMultipleSelection&&(this.multiple=!0,this.dates=[],this.dateEls=[t]),this._setupVariables(),this._insertHTMLIntoDOM(),this._setupEventHandlers();let i=!this.options.defaultDate;i&&(this.options.defaultDate=this._parseInput(this.el.value));let n=this.options.defaultDate;if(x._isDate(n)?this.options.setDefaultDate?(this.setDate(n,!0),this.setInputValue(this.el,n)):i&&this._isSelectableDay(n)?this.setDate(n,!0):this.gotoDate(this._withinBounds(n)):this.gotoDate(this._withinBounds(new Date)),this.options.isDateRange){this.multiple=!0;let o=this.options.defaultEndDate;x._isDate(o)&&this.options.setDefaultEndDate&&(this.setDate(o,!0,!0),this.setInputValue(this.endDateEl,o))}this.displayPlugin=yi(this.options.displayPlugin,this.el,this.containerEl,this.options.displayPluginOptions,this._cancel),this.endDateEl&&this.displayPlugin?.triggers.push(this.endDateEl);for(let o of[this.el,this.endDateEl])this._rememberResetDate(o)}_rememberResetDate(t){let e=t&&this._writtenInputs.get(t);e&&e.value===t.defaultValue&&this._resetDates.set(t,e)}static get defaults(){return vl}static _escape(t){return String(t??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}static _isDate(t){return/Date/.test(Object.prototype.toString.call(t))&&!isNaN(t.getTime())}_readDefault(t,e){let{format:i,i18n:n}=this.options;return(typeof i=="string"&&e.type!=="date"?_l(t,i,n):null)??x._parseDate(t)}static _parseDate(t){if(t=t.trim(),!/^\d{4}-\d{2}-\d{2}$/.test(t))return new Date(Date.parse(t));let e=new Date(t+"T00:00:00");return e.getDate()===Number(t.slice(-2))?e:new Date(NaN)}_parseInput(t,e=this.el){return!t.trim()||!this.options.parse?this._readDefault(t,e):this.options.parse(t,typeof this.options.format=="string"?this.options.format:"")}static _setToStartOfDay(t){x._isDate(t)&&t.setHours(0,0,0,0)}static _compareDates(t,e){return t.getTime()===e.getTime()}destroy(){this._events.abort(),this.dateEls?.slice(1).forEach(t=>this._removeDateInput(t)),!this.options.dateRangeEndEl&&this.endDateEl&&this._removeDateInput(this.endDateEl),this.displayPlugin?.destroy(),this.containerEl.remove(),this.destroySelects(),this._removeDateOverlay(),super.destroy()}_removeDateOverlay(){this.el.classList.remove("datepicker-date-input");for(let t of[this.el,this.endDateEl])t?.type==="date"&&t.removeAttribute("data-date")}destroySelects(){this._formSelect(".orig-select-year")?.destroy(),this._formSelect(".orig-select-month")?.destroy()}_insertHTMLIntoDOM(){this.el.type=="date"&&this.el.classList.add("datepicker-date-input"),this._renderDateInputFormat(this.el),this.options.isDateRange&&(this.containerEl.classList.add("daterange"),this.options.dateRangeEndEl?(this.endDateEl=u.querySelector(this.el,this.options.dateRangeEndEl),this.endDateEl?this._renderDateInputFormat(this.endDateEl):console.warn("Specified date range end input element in dateRangeEndEl not found")):(this.endDateEl=this.createDateInput(),this.endDateEl.classList.add("datepicker-end-date"))),We(this.footer,this.options,"datepicker-clear",this._handleClearClick,this._confirm,this._cancel);let t=this.options.container,e=typeof t=="string"?u.querySelector(this.el,t):t;if(e)this.options.container=e,e.append(this.containerEl);else{let i=this.endDateEl?this.endDateEl:this.el;this.options.openByDefault||this.containerEl.setAttribute("style","display: none; visibility: hidden;"),i.parentElement.after(this.containerEl)}}_renderDateInputFormat(t){let e=t.parentElement?.querySelector(".datepicker-format");e&&(e.textContent=typeof this.options.format=="function"?"":String(this.options.format))}toString(t=this.date,e=null){return e=e||this.options.format,typeof e=="function"?e(t):x._isDate(t)?this.formatDate(t,e):""}formatDate(t,e){return e.split(/(d{1,4}|m{1,4}|y{4}|yy|!.)/g).map(n=>Sn[n]?Sn[n](t,this.options.i18n):n).join("")}setDateFromInput(t){if(this._syncDataDate(t),(this.options.isDateRange||!this.options.isMultipleSelection)&&!t.value.trim()){this.setSingleDate(null,t===this.endDateEl),this.draw();return}let e=this._dateInInput(t);if(!x._isDate(e))return;let i=new Date(e.getTime());x._setToStartOfDay(i);let n=t===this.endDateEl;if(this.options.isDateRange&&(n?this.date&&i<this.date:this.endDate&&i>this.endDate)||this._isDisabledDay(i)){this.setInputValue(t,this._selectedDateFor(t));return}let a=this._shows(t,i);this._selectTypedMultiDate(t,i),this.setDate(i,a,n,!0)}_shows(t,e){return this._selectedDateFor(t)?.getTime()===e.getTime()}_selectTypedMultiDate(t,e){if(!this.options.isMultipleSelection)return;let i=this._selectedDateFor(t);this.dates=this.dates.filter(n=>n!==i&&n.getTime()!==e.getTime()),this.setMultiDate(e)}setDate(t=null,e=!1,i=!1,n=!1){let o=this.validateDate(t);if(!o)return;x._setToStartOfDay(o);let a=++this._selection;this.options.isMultipleSelection?n||this.setMultiDate(o):this.setSingleDate(o,i),this.gotoDate(o),!e&&this._notify("select",this.options.onSelect,{args:[o],detail:{date:o},current:()=>a===this._selection})}validateDate(t){if(!t)return this._renderDateDisplay(t),this.draw();if(typeof t=="string"&&(t=x._parseDate(t)),!!x._isDate(t))return this._withinBounds(t)}_withinBounds(t){let e=this.options.minDate,i=this.options.maxDate;return x._isDate(e)&&t<e?t=e:x._isDate(i)&&t>i&&(t=i),new Date(t.getTime())}_dateInInput(t){let e=!this.options.parse&&[this._writtenInputs.get(t),this._resetDates.get(t)].find(i=>i?.value===t.value);return e?e.date:this._parseInput(t.value,t)}_selectedDateFor(t){return this.options.isMultipleSelection?this.dates[this.dateEls.indexOf(t)]??null:t===this.endDateEl?this.endDate:this.date}_isSelectableDay(t){let e=new Date(t.getTime());return x._setToStartOfDay(e),!this._isDisabledDay(e)}_isDisabledDay(t){return this._isOutOfBounds(t)||this._isRefusedDay(t)}_isOutOfBounds(t){let{minDate:e,maxDate:i}=this.options;return e&&t<e||i&&t>i}_isRefusedDay(t){let{disableWeekends:e,disableDayFn:i}=this.options;return e&&[0,6].includes(t.getDay())||!!i?.(t)}setSingleDate(t,e){e?this.endDate=t:this.date=t}setMultiDate(t){let e=this.dates.findIndex(i=>i.getTime()===t.getTime());e===-1?this.dates.push(t):this.dates.splice(e,1),this.dates.sort((i,n)=>i.getTime()-n.getTime())}setDataDate(t,e){t.setAttribute("data-date",x._isDate(e)?this.toString(e):"")}setInputValues(){if(!this.options?.isMultipleSelection){this.setInputValue(this.el,this.date),this.options?.isDateRange&&this.setInputValue(this.endDateEl,this.endDate);return}this.setMultipleSelectionInputValues()}setMultipleSelectionInputValues(){let t=Math.max(1,this.dates.length);for(let e of this.dateEls.splice(t))this._removeDateInput(e);for(;this.dateEls.length<t;)this.dateEls.push(this.createDateInput());this.dateEls.forEach((e,i)=>this.setInputValue(e,this.dates[i]??null))}setInputValue(t,e){t&&(t.type=="date"&&this.setDataDate(t,e),x._isDate(e)?t.type=="date"?t.value=this.formatDate(e,"yyyy-mm-dd"):t.value=this.toString(e):t.value="",this._writtenInputs.set(t,{value:t.value,date:x._isDate(e)?new Date(e.getTime()):null}),t.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!0,composed:!0,detail:{firedBy:this}})))}_renderDateDisplay(t,e=null){let i=x._isDate(t)?t:new Date;if(!this.options.isDateRange)this.dateTextEl.textContent=this.formatDate(i,"ddd, mmm d");else{let n=x._isDate(e)?e:new Date;this.dateTextEl.textContent=`${this.formatDate(i,"mmm d")} - ${this.formatDate(n,"mmm d")}`}}gotoDate(t){let e=!0;if(x._isDate(t)){if(this.calendars){let i=new Date(this.calendars[0].year,this.calendars[0].month,1),n=new Date(this.calendars[this.calendars.length-1].year,this.calendars[this.calendars.length-1].month,1),o=t.getTime();n.setMonth(n.getMonth()+1),n.setDate(n.getDate()-1),e=o<i.getTime()||n.getTime()<o}e&&(this.calendars=[{month:t.getMonth(),year:t.getFullYear()}]),this.adjustCalendars()}}adjustCalendars(){this.calendars[0]=this.adjustCalendar(this.calendars[0]),this.draw()}adjustCalendar(t){return t.month<0&&(t.year-=Math.ceil(Math.abs(t.month)/12),t.month+=12),t.month>11&&(t.year+=Math.floor(Math.abs(t.month)/12),t.month-=12),t}nextMonth(){this.calendars[0].month++,this.adjustCalendars()}prevMonth(){this.calendars[0].month--,this.adjustCalendars()}render(t,e,i){let n=new Date,o=new Date(t,e+1,0).getDate(),a=[],l=new Date(t,e,1).getDay(),c=[];x._setToStartOfDay(n),this.options.firstDay>0&&(l-=this.options.firstDay,l<0&&(l+=7));let h=e===0?11:e-1,d=e===11?0:e+1,p=e===0?t-1:t,_=e===11?t+1:t,m=new Date(t,e,0).getDate(),E=Math.ceil((o+l)/7)*7;for(let T=0,C=0;T<E;T++){let g=new Date(t,e,1+(T-l)),L=x._compareDates(g,n),S=this.options.events.indexOf(g.toDateString())!==-1,P=T<l||T>=o+l,N=this._isDisabledDay(g),ut=this.options.isDateRange&&this.date&&this.endDate&&x._compareDates(this.date,g),Ke=this.options.isDateRange&&this.endDate&&x._compareDates(this.endDate,g),xe=this.options.isDateRange&&[this.date,this.endDate].every(x._isDate)&&g>this.date&&g<this.endDate,J=1+(T-l),tt=e,ki=t,we=!1;x._isDate(this.date)&&(we=x._compareDates(g,this.date)),!we&&x._isDate(this.endDate)&&(we=x._compareDates(g,this.endDate)),this.options.isMultipleSelection&&this.dates?.some(ar=>ar.getTime()===g.getTime())&&(we=!0),P&&(T<l?(J=m+J,tt=h,ki=p):(J=J-o,tt=d,ki=_));let or={day:J,month:tt,year:ki,hasEvent:S,isSelected:we,isToday:L,isDisabled:N,isEmpty:P,showDaysInNextAndPreviousMonths:this.options.showDaysInNextAndPreviousMonths,isDateRangeStart:ut,isDateRangeEnd:Ke,isDateRange:xe};c.push(this.renderDay(or)),++C===7&&(a.push(this.renderRow(c,this.options.isRTL,!1)),c=[],C=0)}return this.renderTable(this.options,a,i)}renderDay(t){let e={isDisabled:"is-disabled",isToday:"is-today",isSelected:"is-selected",hasEvent:"has-event",isDateRangeStart:"is-daterange-start",isDateRangeEnd:"is-daterange-end",isDateRange:"is-daterange"},i=t.isSelected===!0||t.isDateRange===!0,n=["datepicker-day"];if(t.isEmpty)if(t.showDaysInNextAndPreviousMonths)n.push("is-outside-current-month"),n.push("is-selection-disabled");else return'<td class="is-empty"></td>';for(let[c,h]of Object.entries(e))t[c]&&n.push(h);let o=x._escape(t.day),a=x._escape(t.month),l=x._escape(t.year);return`<td data-day="${o}" class="${n.join(" ")}" aria-selected="${i}"><button class="datepicker-day-button" type="button" data-year="${l}" data-month="${a}" data-day="${o}">${o}</button></td>`}renderRow(t,e,i){return'<tr class="datepicker-row'+(i?" is-selected":"")+'">'+x._calendarMarkup((e?t.reverse():t).join(""),"tr")+"</tr>"}renderTable(t,e,i){return'<div class="datepicker-table-wrapper"><table cellpadding="0" cellspacing="0" class="datepicker-table" role="grid" aria-labelledby="'+x._escape(i)+'">'+this.renderHead(t)+this.renderBody(e)+"</table></div>"}renderHead(t){let e=[],i;for(i=0;i<7;i++){let n=x._escape(this.renderDayName(t,i)),o=x._escape(this.renderDayName(t,i,!0));e.push(`<th scope="col"><abbr title="${n}">${o}</abbr></th>`)}return"<thead><tr>"+(t.isRTL?e.reverse():e).join("")+"</tr></thead>"}renderBody(t){let e=t.join("");return"<tbody>"+x._calendarMarkup(e,"tbody")+"</tbody>"}static _calendarMarkup(t,e){let i=document.createElement("template");i.innerHTML=t;let n={tbody:"tr",tr:"td",td:"button"},o={tr:["class"],td:["class","data-day","aria-selected"],button:["class","type","data-year","data-month","data-day","aria-label","disabled","tabindex"]},a=(l,c)=>{if(l.nodeType===Node.TEXT_NODE){if((c==="tbody"||c==="tr")&&l.textContent.trim())throw new TypeError("Unsupported calendar row content");return x._escape(l.textContent)}if(!(l instanceof HTMLElement))throw new TypeError("Unsupported calendar row content");let h=n[c];if(!h||l.localName!==h)throw new TypeError("Unsupported calendar row element");if([...l.attributes].some(p=>!o[h].includes(p.name)))throw new TypeError("Unsupported calendar row attribute");if(h==="button"&&l.getAttribute("type")!=="button")throw new TypeError('Calendar day buttons require type="button"');let d=o[h].filter(p=>l.hasAttribute(p)).map(p=>` ${p}="${x._escape(l.getAttribute(p))}"`).join("");return`<${h}${d}>${[...l.childNodes].map(p=>a(p,h)).join("")}</${h}>`};return[...i.content.childNodes].map(l=>a(l,e)).join("")}_setDateBounds(){let{minDate:t,maxDate:e}=this.options;t&&(this.options.minDate=new Date(new Date(t.getTime()).setHours(0,0,0,0)),Object.assign(this.options,{minYear:t.getFullYear(),minMonth:t.getMonth()})),e&&(this.options.maxDate=new Date(new Date(e.getTime()).setHours(0,0,0,0)),Object.assign(this.options,{maxYear:e.getFullYear(),maxMonth:e.getMonth()}))}_arrowState(t,e){let i=this.options,n=t===i.minYear,o=t===i.maxYear;return{prev:!(n&&(e===0||i.minMonth>=e)),next:!(o&&(e===11||i.maxMonth<=e))}}_controlsCacheKey(t){let e=this.options;return[t,e.minYear,e.maxYear,e.minMonth,e.maxMonth,Array.isArray(e.yearRange)?e.yearRange.join("-"):e.yearRange,e.yearRangeReverse,e.showMonthAfterYear].join("|")}renderTitle(t,e,i,n,o,a){let l=this.options,c=i===l.minYear,h=i===l.maxYear,d,p,_=[],m='<div id="'+x._escape(a)+'" class="datepicker-controls" role="heading" aria-live="assertive">',{prev:E,next:T}=this._arrowState(i,n);for(d=0;d<12;d++)_.push('<option value="'+(i===o?d-e:12+d-e)+'"'+(d===n?' selected="selected"':"")+(c&&d<l.minMonth||h&&d>l.maxMonth?'disabled="disabled"':"")+">"+x._escape(l.i18n.months[d])+"</option>");let C='<select class="datepicker-select orig-select-month" tabindex="-1">'+_.join("")+"</select>";for(Array.isArray(l.yearRange)?(d=l.yearRange[0],p=l.yearRange[1]+1):(d=i-l.yearRange,p=1+i+l.yearRange),_=[];d<p&&d<=l.maxYear;d++)d>=l.minYear&&_.push(`<option value="${d}" ${d===i?'selected="selected"':""}>${d}</option>`);l.yearRangeReverse&&_.reverse();let g=`<select class="datepicker-select orig-select-year" tabindex="-1">${_.join("")}</select>`;return m+=`<button class="month-prev${E?"":" is-disabled"}" type="button" aria-label="${x._escape(l.i18n.previousMonth)}"><svg height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"/><path d="M0-.5h24v24H0z" fill="none"/></svg></button>`,m+='<div class="selects-container">',l.showMonthAfterYear?m+=g+C:m+=C+g,m+="</div>",m+=`<button class="month-next${T?"":" is-disabled"}" type="button" aria-label="${x._escape(l.i18n.nextMonth)}"><svg height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"/><path d="M0-.25h24v24H0z" fill="none"/></svg></button>`,m+="</div>"}_batchDraws(t){this._drawDepth++;try{t()}finally{this._drawDepth--,this._drawDepth===0&&this._drawDirty&&(this._drawDirty=!1,this.draw())}}draw(){if(this._drawDepth>0){this._drawDirty=!0;return}let t=this.calendarEl.getRootNode().activeElement,e=t?.matches(".datepicker-day-button")&&this.calendarEl.contains(t),i=this.calendarEl.contains(t)&&t?.matches(".month-prev, .month-next")?t.classList.contains("month-prev")?".month-prev":".month-next":null,n=this._selectFocusRestorer(t),o=this.calendars[0].year,a=this.calendars[0].month;this._renderDateDisplay(this.date,this.endDate);let l=this._controlsCacheKey(o);l===this._controlsKey&&this.calendarEl.querySelector(".datepicker-controls")?this._reuseControls(o,a):(this._controlsKey=l,this._randId="datepicker-title-"+u.guid(),this._rebuildControls(o,a)),this._renderCalendarTable(o,a),this._syncCalendarFocus(!!e),i&&this.calendarEl.querySelector(i)?.focus(),n(),typeof this.options.onDraw=="function"&&this.options.onDraw.call(this)}_formSelect(t){let e=this.calendarEl.querySelector(t);return e?K.getInstance(e):void 0}_selectFocusRestorer(t){let e=n=>!!n&&(n.input===t||!!n.menuEl?.contains(t)),i=[".orig-select-year",".orig-select-month"].find(n=>e(this._formSelect(n)));return()=>{i&&!t.isConnected&&this._formSelect(i)?.input.focus()}}_rebuildControls(t,e){this.destroySelects(),this.calendarEl.innerHTML=this.renderTitle(this,0,t,e,t,this._randId);let i=this.calendarEl.querySelector(".orig-select-year"),n=this.calendarEl.querySelector(".orig-select-month");K.init(i,{classes:"select-year",menuOptions:{container:u.portalRoot(this.el),constrainWidth:!1}}),K.init(n,{classes:"select-month",menuOptions:{container:u.portalRoot(this.el),constrainWidth:!1}}),i.addEventListener("change",this._handleYearChange),n.addEventListener("change",this._handleMonthChange)}_reuseControls(t,e){let i=this.calendarEl.querySelector(".orig-select-month");i&&i.value!==e.toString()&&(i.value=e.toString(),K.getInstance(i)?.refresh());let{prev:n,next:o}=this._arrowState(t,e);this.calendarEl.querySelector(".month-prev")?.classList.toggle("is-disabled",!n),this.calendarEl.querySelector(".month-next")?.classList.toggle("is-disabled",!o)}_renderCalendarTable(t,e){let i=this.render(t,e,this._randId),n=this.calendarEl.querySelector(".datepicker-table-wrapper");n?n.outerHTML=i:this.calendarEl.insertAdjacentHTML("beforeend",i)}_setupEventHandlers(){this._addInputEventHandlers(this.el),this.endDateEl&&this._addInputEventHandlers(this.endDateEl);let{signal:t}=this._events;B(this.el,this._readBack,t),this.calendarEl.addEventListener("click",this._handleCalendarClick,{signal:t}),this.calendarEl.addEventListener("keydown",this._handleCalendarKeydown,{signal:t}),this.calendarEl.addEventListener("focusin",this._handleCalendarFocus,{signal:t})}_setupVariables(){let t=document.createElement("template");t.innerHTML=x._template.trim(),this.containerEl=t.content.firstChild,this.calendarEl=this.containerEl.querySelector(".datepicker-calendar"),this.dateTextEl=this.containerEl.querySelector(".date-text"),this.footer=this.containerEl.querySelector(".datepicker-footer")}_addInputEventHandlers(t){let{signal:e}=this._events;t.addEventListener("click",this._handleInputClick,{signal:e}),t.addEventListener("keydown",this._handleInputKeydown,{signal:e}),t.addEventListener("change",this._handleInputChange,{signal:e})}_removeDateInput(t){let e=t.getRootNode().activeElement===t;t.remove(),e&&document.activeElement===document.body&&this.el.focus()}_showDisplay(){this.displayPlugin?.show(),this.displayPlugin instanceof _e&&this._syncCalendarFocus(!0)}_dayDate(t){let e=new Date(0);return e.setFullYear(Number(t.dataset.year),Number(t.dataset.month),Number(t.dataset.day)),x._setToStartOfDay(e),e}_syncCalendarFocus(t=!1){let e=[...this.calendarEl.querySelectorAll(".datepicker-day-button")],i=e.filter(a=>!a.parentElement.classList.contains("is-selection-disabled")),n=this._focusedDate||this.date||new Date(new Date().setHours(0,0,0,0)),o=i.find(a=>x._compareDates(this._dayDate(a),n))||i.find(a=>a.parentElement.classList.contains("is-selected"))||i.find(a=>!a.parentElement.classList.contains("is-disabled"))||i[0];for(let a of e)a.tabIndex=a===o?0:-1,a.setAttribute("aria-disabled",String(a.parentElement.matches(".is-disabled, .is-selection-disabled")));o&&(this._focusedDate=this._dayDate(o),t&&o.focus())}gotoMonth(t){isNaN(Number(t))||(this.calendars[0].month=parseInt(String(t),10),this.adjustCalendars())}gotoYear(t){isNaN(Number(t))||(this.calendars[0].year=parseInt(String(t),10),this.adjustCalendars())}_readBackMultiple(){for(let e of this.dateEls.splice(1))this._removeDateInput(e);this.dates=[],this._syncDataDate(this.el);let t=this._dateInInput(this.el);x._isDate(t)&&this._isSelectableDay(t)&&this.setDate(t,!0)}_syncDataDate(t){t.type==="date"&&this.setDataDate(t,x._parseDate(t.value))}_readBackSingle(){this.setSingleDate(null,!1),this.setSingleDate(null,!0);for(let t of[this.el,this.endDateEl])t&&this.setDateFromInput(t)}renderDayName(t,e,i=!1){for(e+=t.firstDay;e>=7;)e-=7;return i?t.i18n.weekdaysAbbrev[e]:t.i18n.weekdays[e]}createDateInput(){let t=this.el.cloneNode(!0);return t.removeAttribute("id"),t.classList.add("no-autoinit"),this._addInputEventHandlers(t),this.el.parentElement.appendChild(t),t}};x.key="Expressive_Datepicker",x._template=`
|
|
10
10
|
<div class="datepicker-container">
|
|
11
11
|
<div class="datepicker-date-display">
|
|
12
12
|
<span class="date-text"></span>
|
|
@@ -15,7 +15,7 @@ var Expressive=(()=>{var yi=Object.defineProperty;var jn=Object.getOwnPropertyDe
|
|
|
15
15
|
<div class="datepicker-calendar"></div>
|
|
16
16
|
<div class="datepicker-footer"></div>
|
|
17
17
|
</div>
|
|
18
|
-
</div>`;var pe=w;var Wa={menuOptions:{constrainWidth:!1,coverTrigger:!1}},Pt=class extends b{constructor(t,e){super(t,e);this._added=[];this._onFocusin=t=>{let e=this._items;e.includes(t.target)&&e.forEach(i=>i.tabIndex=i===t.target?0:-1)};this._onBarKeydown=t=>{if(!u.plainKey(t))return;let e=this._items,i=e.indexOf(t.target);if(i<0)return;let n=this._step(t.key);if(n)this._focusItem(i,n,!1);else if(t.key==="Home")this._focusItem(-1,1,!1);else if(t.key==="End")this._focusItem(e.length,-1,!1);else return;t.preventDefault()};this._onMenuKeydown=t=>{let e=this._step(t.key);if(!e||t.defaultPrevented||!u.plainKey(t))return;let i=this._items,n=t.composedPath(),o=i.findIndex(a=>{let l=B.getInstance(a);return l?.isOpen&&l.menuEl&&n.includes(l.menuEl)});o<0||(t.preventDefault(),this._focusItem(o,e,!0))};this._setAttribute(this.el,"role","menubar"),this._items.forEach((n,o)=>{B.init(n,this.options.menuOptions),this._setAttribute(n,"role","menuitem"),n.tabIndex=o===0?0:-1});let{signal:i}=this._events;this.el.addEventListener("keydown",this._onBarKeydown,{signal:i}),this.el.addEventListener("focusin",this._onFocusin,{signal:i}),document.addEventListener("keydown",this._onMenuKeydown,{signal:i})}static get defaults(){return Wa}destroy(){this._items.forEach(t=>{B.getInstance(t)?.destroy(),t.removeAttribute("tabindex")}),this._added.forEach(({el:t,name:e})=>t.removeAttribute(e)),this._added=[],super.destroy()}get _items(){return[...this.el.querySelectorAll(":scope > .menu-trigger")]}_setAttribute(t,e,i){t.hasAttribute(e)||(t.setAttribute(e,i),this._added.push({el:t,name:e}))}_step(t){let e=getComputedStyle(this.el).direction==="rtl";return t==="ArrowRight"?e?-1:1:t==="ArrowLeft"?e?1:-1:null}_focusItem(t,e,i){let n=this._items,o=n.length,a=n.map((l,c)=>n[((t+e*(c+1))%o+o)%o]).find(l=>!l.matches(':disabled, [aria-disabled="true"]'));a&&(n.forEach(l=>{let c=B.getInstance(l);l!==a&&c?.isOpen&&c.close()}),a.focus(),i&&B.getInstance(a)?.open())}};Pt.key="Expressive_Menubar";var Ua={autoScroll:!0,defaultScrollPosition:"end",peek:64},mi=2,ja=new Set(["ArrowUp","PageUp","Home"]),Ya=["pointerup","pointercancel","touchend","touchcancel"],Rt=class extends b{constructor(t,e){super(t,e);this._opened=!1;this._following=!1;this._holding=!1;this._lastTop=0;this._target=null;this._distance=1/0;this._ref=null;this._refOffset=0;this._anchor=null;this._spacer=0;this._last=null;this._resizeObserver=null;this._mutationObserver=null;this._handleScroll=()=>{if(this._target!==null){let t=Math.abs(this.viewport.scrollTop-this._resolve(this._target));if(t>mi&&t<this._distance){this._distance=t;return}this._target=null}this._settle()};this._handleUserScroll=t=>{t.type==="wheel"&&t.deltaY>=0||t.type==="keydown"&&!ja.has(t.key)||(this._target=null,t.type==="pointerdown"||t.type==="touchstart"?this._holding=!0:this._following=!1)};this._handleRelease=()=>{this._holding&&(this._holding=!1,this._following&&(this.viewport.scrollTop=this.viewport.scrollHeight),this._sync())};this._handleButtonClick=()=>this.scrollToEnd();this._handleMutations=t=>{for(let i of t)i.addedNodes.forEach(n=>{n instanceof Element&&this._resizeObserver.observe(n)}),i.removedNodes.forEach(n=>{n instanceof Element&&this._resizeObserver.unobserve(n)});let e=this._last;if(this._last=this.viewport.lastElementChild,!!this._opened&&(!this._following&&this._target===null&&this._restore(),!!this.options.autoScroll&&!(e&&e.parentElement!==this.viewport))){for(let i=this._last;i&&i!==e;i=i.previousElementSibling)if(i.hasAttribute("data-scroll-anchor")){this._anchor=i,this._updateSpacer(),this._following=!0,this._scrollTo(this._top(i)-this.options.peek);return}}};this._handleResize=()=>{if(!this._opened){this.viewport.clientHeight>0&&this._open();return}this._updateSpacer();let t=this.viewport;this._target==="end"?this._scrollTo("end"):this._target===null&&(this._following&&!this._holding?t.scrollTop=t.scrollHeight:this._restore()),this._sync()};if(this.viewport=t.querySelector(":scope > .message-scroller-viewport"),this.button=t.querySelector(":scope > .message-scroller-button"),!this.viewport){console.error("MessageScroller needs a .message-scroller-viewport child.");return}this._last=this.viewport.lastElementChild,this.viewport.clientHeight>0&&this._open(),this._resizeObserver=new ResizeObserver(this._handleResize),this._resizeObserver.observe(this.viewport,{box:"border-box"});for(let n of Array.from(this.viewport.children))this._resizeObserver.observe(n);this._mutationObserver=new MutationObserver(this._handleMutations),this._mutationObserver.observe(this.viewport,{childList:!0});let{signal:i}=this._events;this.viewport.addEventListener("scroll",this._handleScroll,{passive:!0,signal:i});for(let n of["wheel","touchstart","pointerdown","keydown"])this.viewport.addEventListener(n,this._handleUserScroll,{passive:!0,signal:i});for(let n of Ya)document.addEventListener(n,this._handleRelease,{signal:i});this.button?.addEventListener("click",this._handleButtonClick,{signal:i})}static get defaults(){return Ua}destroy(){super.destroy(),this.viewport&&(this._resizeObserver?.disconnect(),this._mutationObserver?.disconnect(),this.viewport.style.removeProperty("--md-comp-message-scroller-spacer"),this.button&&(this.button.inert=!1))}scrollToEnd(){this._following=this.options.autoScroll,this._scrollTo("end")}scrollToStart(){this._following=!1,this._scrollTo(0)}scrollToMessage(t){let e=u.getElementById(this.viewport,t);return!e||!this.viewport.contains(e)?!1:(this._following=!1,this._scrollTo(this._top(e)-this.options.peek),!0)}_open(){this._opened=!0;let t=this.viewport,e=this.options.defaultScrollPosition,i=t.querySelectorAll(":scope > [data-scroll-anchor]"),n=e==="last-anchor"?i[i.length-1]:null;e==="start"?t.scrollTop=0:n&&this._contentEnd()-this._top(n)+this.options.peek>t.clientHeight?t.scrollTop=this._top(n)-this.options.peek:t.scrollTop=t.scrollHeight,this._settle()}_settle(){let t=this.viewport.scrollTop,e=this._following&&t>=this._lastTop-mi;this._following=this.options.autoScroll&&(e||this._atEnd()),this._lastTop=t,this._capture(),this._sync()}_scrollTo(t){let e=this.viewport;if(Math.abs(e.scrollTop-this._resolve(t))<=mi){this._target=null,this._settle();return}this._target=t,this._distance=1/0;let i=matchMedia("(prefers-reduced-motion: reduce)").matches;e.scrollTo({top:t==="end"?e.scrollHeight:t,behavior:i?"auto":"smooth"})}_resolve(t){let e=this.viewport.scrollHeight-this.viewport.clientHeight;return t==="end"?e:Math.max(0,Math.min(t,e))}_atEnd(){let t=this.viewport;return t.scrollHeight-t.scrollTop-t.clientHeight<=mi}_top(t){let e=this.viewport;return t.getBoundingClientRect().top-e.getBoundingClientRect().top-e.clientTop+e.scrollTop}_contentEnd(){let t=this.viewport.lastElementChild;if(!t)return 0;let e=parseFloat(getComputedStyle(this.viewport).paddingBlockEnd)-this._spacer;return this._top(t)+t.getBoundingClientRect().height+e}_capture(){let t=this.viewport.children,e=this.viewport.getBoundingClientRect().top+this.viewport.clientTop,i=0,n=t.length-1;for(;i<n;){let o=i+n>>1;t[o].getBoundingClientRect().bottom>e?n=o:i=o+1}this._ref=t[i]??null,this._refOffset=this._ref?this._ref.getBoundingClientRect().top-e:0}_restore(){if(this._ref?.parentElement!==this.viewport){this._capture();return}let t=this.viewport.getBoundingClientRect().top+this.viewport.clientTop,e=this._ref.getBoundingClientRect().top-t-this._refOffset;Math.abs(e)>=1&&(this.viewport.scrollTop+=e)}_updateSpacer(){let t=0;if(this._anchor?.parentElement===this.viewport){let e=this._top(this._anchor)-this.options.peek+this.viewport.clientHeight;t=Math.max(0,Math.ceil(e-this._contentEnd()))}else this._anchor=null;t!==this._spacer&&(this._spacer=t,t?this.viewport.style.setProperty("--md-comp-message-scroller-spacer",`${t}px`):this.viewport.style.removeProperty("--md-comp-message-scroller-spacer"))}_sync(){if(!this.button)return;let t=this._atEnd(),e=this.button.getRootNode();t&&e.activeElement===this.button&&this.viewport.focus({preventScroll:!0}),this.button.inert=t}};Rt.key="Expressive_MessageScroller";var bn={threshold:64,onRefresh:null,i18n:{refreshing:"Refreshing",refreshed:"Refreshed"}},Xa=4,Ga=new Set(["auto","scroll"]),Za=(r,s)=>Ga.has(getComputedStyle(r).overflowY)&&(r.scrollTop>0||r.contains(s)),fi=class fi extends b{constructor(t,e){super(t,e);this._start=null;this._pulling=!1;this._travel=0;this._refresh=null;this._onStart=t=>{if(this._refresh)return;if(t.touches.length!==1){this._endPull();return}let{clientX:e,clientY:i}=t.touches[0];this._start={x:e,y:i,target:u.eventTarget(t)}};this._onMove=t=>{if(!this._start)return;let{clientX:e,clientY:i}=t.touches[0],n=e-this._start.x,o=i-this._start.y;this._pulling||this._decide(n,o,this._start.target),this._pulling&&this._drag(t,o)};this._onEnd=()=>{let t=this._pulling&&this._travel>=this.options.threshold;this._endPull(),t&&this.refresh()};this._endPull=()=>{this._start=null,this._pulling=!1,this._travel=0,this.el.classList.remove("pulling"),this.el.style.removeProperty("--pull-to-refresh-offset"),this.el.style.removeProperty("--pull-to-refresh-progress")};this._onClick=t=>{let e=u.eventTarget(t)?.closest("[data-refresh]");e&&this.el.contains(e)&&this.refresh()};this.options.threshold>0||(this.options.threshold=bn.threshold),this._status=t.ownerDocument.createElement("span"),this._status.className="pull-to-refresh-status",this._status.setAttribute("role","status"),t.append(this._status);let i=this._events.signal;t.addEventListener("touchstart",this._onStart,{passive:!0,signal:i}),t.addEventListener("touchmove",this._onMove,{passive:!1,signal:i}),t.addEventListener("touchend",this._onEnd,{signal:i}),t.addEventListener("touchcancel",this._endPull,{signal:i}),t.addEventListener("click",this._onClick,{signal:i})}static get defaults(){return bn}refresh(){if(this._refresh||fi.getInstance(this.el)!==this)return;let t={pending:0};this._refresh=t,this.el.setAttribute("aria-busy","true"),this._status.textContent=this.options.i18n.refreshing;let e=()=>{--t.pending===0&&this._refresh===t&&this.complete()},i={waitUntil:n=>{t.pending++,Promise.resolve(n).finally(e)}};this._fireRefresh(t,i)}complete(){this._refresh&&(this._status.textContent=this.options.i18n.refreshed),this._refresh=null,this.el.removeAttribute("aria-busy")}destroy(){this._endPull(),this.complete(),this._status.remove(),super.destroy()}_fireRefresh(t,e){try{this._notify("refresh",this.options.onRefresh,{args:[e],detail:e})}catch(i){throw this._refresh===t&&this.complete(),i}}_canScrollUp(t){let e=t;for(;e&&!Za(e,this.el);)e=e.parentElement;return(e??this.el.ownerDocument.scrollingElement).scrollTop>0}_decide(t,e,i){Math.max(Math.abs(t),Math.abs(e))<=Xa||(e>Math.abs(t)&&!this._canScrollUp(i)?this._pulling=!0:this._start=null)}_drag(t,e){t.cancelable&&t.preventDefault();let{threshold:i}=this.options;this._travel=Math.max(e,0),this.el.classList.add("pulling"),this.el.style.setProperty("--pull-to-refresh-offset",`${Math.min(this._travel,i*2)/2}px`),this.el.style.setProperty("--pull-to-refresh-progress",`${Math.min(this._travel/i,1)}`)}};fi.key="Expressive_PullToRefresh";var me=fi;var Qa={i18n:{loading:"Loading",loaded:"Loaded"}},Ja=r=>!r.activeElement||r.activeElement===r.body,Ft=class extends b{constructor(t,e){super(t,e);this._busy=!1;this._wasInert=!1;this._focus=null;this._status=t.ownerDocument.createElement("span"),this._status.className="loading-overlay-status",this._status.setAttribute("role","status"),t.after(this._status),this._observer=new MutationObserver(()=>this._sync()),this._observer.observe(t,{attributeFilter:["aria-busy"]}),this._sync(),this._busy&&(this._status.textContent="",requestAnimationFrame(()=>this._announceStart()))}static get defaults(){return Qa}destroy(){this._observer.disconnect(),this._busy&&(this.el.inert=this._wasInert),this._status.remove(),super.destroy()}_sync(){let t=this.el.getAttribute("aria-busy")==="true";t!==this._busy&&(this._busy=t,t?this._start():this._clear())}_start(){let t=this.el.getRootNode().activeElement;this._focus=t instanceof HTMLElement&&this.el.contains(t)?t:null,this._wasInert=this.el.inert,this.el.inert=!0,this._focus?.blur(),this._status.textContent=this.options.i18n.loading}_clear(){this.el.inert=this._wasInert,this._status.textContent=this.options.i18n.loaded;let t=this._focus;this._focus=null,t?.isConnected&&Ja(this.el.ownerDocument)&&t.focus()}_announceStart(){this._busy&&this._status.isConnected&&(this._status.textContent=this.options.i18n.loading)}};Ft.key="Expressive_LoadingOverlay";var tl={onToggle:null},el=4,il=.5,sl=100,nl=r=>Date.now()-r.lastT<sl?r.velocity*r.sign:0,rl=r=>{let s=nl(r);return Math.abs(s)>il?s>0:r.reveal>r.width/2},Nt=class extends b{constructor(t,e){super(t,e);this._open=null;this._swipe=null;this._onStart=t=>{if(t.touches.length!==1){this._cancel();return}let e=this._rowFor(u.eventTarget(t));if(!e)return;let{clientX:i,clientY:n}=t.touches[0],o=this._width(e),a=e===this._open?o:0;this._swipe={row:e,x:i,y:n,sign:this._sign(e),width:o,base:a,reveal:a,swiping:!1,last:i,lastT:Date.now(),velocity:0}};this._onMove=t=>{let e=this._swipe;if(!e)return;let{clientX:i,clientY:n}=t.touches[0];(e.swiping||this._decide(e,i-e.x,n-e.y))&&this._drag(t,e,i)};this._onEnd=()=>{let t=this._swipe;this._swipe=null,t?.swiping&&(t.row.classList.remove("swiping"),this._settle(t.row,rl(t)))};this._onCancel=()=>this._cancel();this._onClick=t=>{let e=u.eventTarget(t);e.closest(".swipe-actions button")?this._closeFrom(e.closest("li")):e.closest("[data-swipe-toggle]")&&this._toggle(this._rowFor(e))};this._onKeydown=t=>{t.key==="Escape"&&this._closeFrom(this._rowFor(u.eventTarget(t)))};this._onFocusin=t=>{let e=u.eventTarget(t);e?.closest(".swipe-actions")?this.open(this._rowFor(e)):this._closeOutside(e)};this._onPointerdown=t=>this._closeOutside(u.eventTarget(t));this._rows().forEach(o=>this._toggleFor(o)?.setAttribute("aria-expanded","false"));let i=this._events.signal,n=t.ownerDocument;t.addEventListener("click",this._onClick,{signal:i}),t.addEventListener("keydown",this._onKeydown,{signal:i}),t.addEventListener("touchstart",this._onStart,{passive:!0,signal:i}),t.addEventListener("touchmove",this._onMove,{passive:!1,signal:i}),t.addEventListener("touchcancel",this._onCancel,{signal:i}),t.addEventListener("touchend",this._onEnd,{signal:i}),n.addEventListener("focusin",this._onFocusin,{signal:i}),n.addEventListener("pointerdown",this._onPointerdown,{signal:i})}static get defaults(){return tl}open(t){this._isRow(t)&&(this._place(t,this._width(t)),this._open!==t&&(this.close(),this._open=t,t.classList.add("swipe-open"),this._toggleFor(t)?.setAttribute("aria-expanded","true"),this._fire(t,!0)))}close(){let t=this._open;t&&(this._open=null,this._shut(t),this._fire(t,!1))}destroy(){let t=[this._swipe?.row,this._open];this._swipe=null,this._open=null,t.forEach(e=>e&&this._shut(e)),this._rows().forEach(e=>this._toggleFor(e)?.removeAttribute("aria-expanded")),super.destroy()}_rows(){return[...this.el.querySelectorAll(":scope > li:has(> .swipe-actions)")]}_isRow(t){return!!t&&t.parentElement===this.el&&!!t.querySelector(":scope > .swipe-actions")}_rowFor(t){let e=t?.closest("li")??null;return this._isRow(e)?e:null}_toggleFor(t){return t.querySelector("[data-swipe-toggle]")}_width(t){return t.querySelector(":scope > .swipe-actions").offsetWidth}_sign(t){return getComputedStyle(t).direction==="rtl"?1:-1}_place(t,e){t.style.setProperty("--swipe-offset",`${e*this._sign(t)}px`)}_shut(t){t.classList.remove("swipe-open","swiping"),t.style.removeProperty("--swipe-offset"),this._toggleFor(t)?.setAttribute("aria-expanded","false")}_fire(t,e){let i={row:t,open:e};this._notify("swipetoggle",this.options.onToggle,{args:[i],detail:i})}_decide(t,e,i){return Math.max(Math.abs(e),Math.abs(i))<=el?!1:(t.swiping=Math.abs(e)>Math.abs(i),t.swiping||(this._swipe=null),t.swiping)}_drag(t,e,i){t.cancelable&&t.preventDefault();let n=Date.now();i!==e.last&&(e.velocity=(i-e.last)/Math.max(1,n-e.lastT),e.last=i,e.lastT=n),e.reveal=Math.min(Math.max(e.base+(i-e.x)*e.sign,0),e.width),e.row.classList.add("swiping"),this._place(e.row,e.reveal)}_settle(t,e){e?this.open(t):t===this._open?this.close():this._shut(t)}_cancel(){let t=this._swipe;this._swipe=null,t?.swiping&&(t.row.classList.remove("swiping"),this._settle(t.row,t.row===this._open))}_toggle(t){t===this._open?this.close():this.open(t)}_closeFrom(t){if(!t||t!==this._open)return;let e=t.querySelector(":scope > .swipe-actions").contains(t.ownerDocument.activeElement);this.close(),e&&this._focusToggle(t)}_focusToggle(t){this._toggleFor(t)?.focus()}_closeOutside(t){this._open&&!this._open.contains(t)&&this.close()}};Nt.key="Expressive_SwipeActions";var ol={Editor:null,extensions:[]},al=["aria-label","aria-labelledby","aria-describedby"],Pe=class extends b{constructor(t,e){super(t,e);this.editor=null;this.content=null;this._actions=new Map;this._label=null;this._required=!1;this._form=null;this._handleClick=t=>{let e=t.target.closest("button[data-command]"),i=this._actions.get(e);i&&!e.disabled&&this.editor.chain().focus()[i.command](i.attributes).run()};this._handleLabelClick=()=>{this.editor.chain().focus().run()};this._handleSubmit=t=>{this._skipsValidation(t)||!this.editor.isEditable||!this.editor.isEmpty||(t.preventDefault(),t.stopImmediatePropagation(),this.editor.chain().focus().run())};this._handleUpdate=()=>{this.textarea.value=this.editor.isEmpty?"":this.editor.getHTML(),this.textarea.dispatchEvent(new Event("input",{bubbles:!0}))};this._handleTransaction=()=>{let t=this.editor.isEditable&&this.editor.can();for(let[e,{command:i,attributes:n,active:o}]of this._actions){if(e.disabled=!t||!(i in this.editor.commands)||!t[i](n),!o)continue;let a=this.editor.isActive(o,n);e.setAttribute("aria-pressed",String(a)),e.classList.toggle("active",a)}};if(this.textarea=t.querySelector(":scope > textarea"),!this.textarea||!this.options.Editor){console.error("RichTextEditor needs a <textarea> child and the Tiptap Editor class in options.Editor.");return}for(let n of t.querySelectorAll("button[data-command]")){let o=n.dataset.command,a;try{a=n.dataset.attributes?JSON.parse(n.dataset.attributes):void 0}catch{console.warn("RichTextEditor ignored invalid JSON in data-attributes:",n.dataset.attributes)}let l=o.startsWith("toggle")?o[6].toLowerCase()+o.slice(7):void 0;this._actions.set(n,{command:o,attributes:a,active:l})}let i={role:"textbox","aria-multiline":"true"};for(let n of al){let o=this.textarea.getAttribute(n);o&&(i[n]=o)}this._label=this.textarea.labels?.[0]??null,this._label&&!i["aria-labelledby"]&&(this._label.id||(this._label.id=`rich-text-editor-label-${u.guid()}`),i["aria-labelledby"]=this._label.id,this._label.addEventListener("click",this._handleLabelClick,{signal:this._events.signal})),this._required=this.textarea.required,this._required&&(i["aria-required"]="true",this.textarea.required=!1,this._form=this.textarea.form,this._form?.addEventListener("submit",this._handleSubmit,{capture:!0,signal:this._events.signal})),this.content=document.createElement("div"),this.content.className="rich-text-editor-content",this.textarea.after(this.content),this.textarea.hidden=!0,this.editor=new this.options.Editor({element:this.content,extensions:this.options.extensions,content:this.textarea.value,editable:!(this.textarea.disabled||this.textarea.readOnly),editorProps:{attributes:i}}),this.editor.on("update",this._handleUpdate),this.editor.on("transaction",this._handleTransaction),this._handleTransaction(),t.addEventListener("click",this._handleClick,{signal:this._events.signal})}static get defaults(){return ol}destroy(){if(super.destroy(),!!this.editor){this.editor.off("update",this._handleUpdate),this.editor.off("transaction",this._handleTransaction),this.editor.destroy(),this.editor=null,this.content.remove(),this.textarea.hidden=!1,this.textarea.required=this._required;for(let t of this._actions.keys())t.disabled=!1,t.classList.remove("active"),t.removeAttribute("aria-pressed")}}_skipsValidation(t){return this._form.noValidate||!!t.submitter?.formNoValidate}};Pe.key="Expressive_RichTextEditor";var En="https://tiles.openfreemap.org/styles/",ll={maplibregl:null,style:{light:`${En}positron`,dark:`${En}dark`},center:[0,20],zoom:1,mapOptions:{}},cl=r=>r.length===2&&r.every(Number.isFinite)&&Math.abs(r[1])<=90,hl=r=>{let s=r.dataset.lngLat.split(",").map(t=>t.trim()?Number(t):NaN);return cl(s)?s:(console.warn(`MapView skipped data-lng-lat="${r.dataset.lngLat}": expected "longitude,latitude".`,r),null)},yn=r=>r.map(s=>[s,hl(s)]).filter(s=>s[1]!==null);function ul([r,s],[t,e],i=32){let n=t>=r?.25:-.25,o=(r+t)/2-(e-s)*n,a=(s+e)/2+(t-r)*n;return Array.from({length:i+1},(l,c)=>{let h=c/i,d=1-h;return[d*d*r+2*d*h*o+h*h*t,d*d*s+2*d*h*a+h*h*e]})}var dl={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]},pl=r=>u.plainKey(r)?dl[r.key]:void 0,Re=class extends b{constructor(t,e){super(t,e);this.map=null;this.markers=[];this._children=[];this._popups=[];this._markerPopups=new Map;this._overlays=new Map;this._styleReady=!1;this._dark=!1;this._location=null;this._observer=null;this._zoomIn=[];this._zoomOut=[];this._picked=null;this._dragged=null;this._restore=[];this._actions={"zoom-in":()=>this.map.zoomIn(),"zoom-out":()=>this.map.zoomOut(),compass:()=>this.map.resetNorthPitch(),locate:t=>this._locate(t),fullscreen:()=>this._toggleFullscreen(),"pan-up":()=>this._pan(0,-1),"pan-down":()=>this._pan(0,1),"pan-left":()=>this._pan(-1,0),"pan-right":()=>this._pan(1,0)};this._handleStyleLoad=()=>{this._styleReady=!0;for(let t of this._overlays.values())t.draw()};this._handleScheme=()=>{let t=this._isDark();t!==this._dark&&(this._dark=t,this._styleReady=!1,this.map.setStyle(this._style(),{diff:!1}))};this._sync=()=>{let t=this.map.getZoom();for(let e of this._zoomIn)e.disabled=t>=this.map.getMaxZoom();for(let e of this._zoomOut)e.disabled=t<=this.map.getMinZoom();this.el.style.setProperty("--md-comp-map-bearing",`${-this.map.getBearing()}deg`)};this._handleFullscreen=()=>{for(let t of this._buttons("fullscreen"))t.setAttribute("aria-pressed",String(document.fullscreenElement===this.el))};this._handleClick=t=>{let e=t.target,i=e.closest(".map-controls [data-action]");i?this._actions[i.dataset.action]?.(i):this._tapMarker(e.closest(".map-marker"))};this._handleMapClick=t=>{let e=t.originalEvent.target;this._drop(e,t.lngLat);for(let[i,n]of this._markerPopups)!i.contains(e)&&!n.getElement()?.contains(e)&&n.remove()};this._handleKeydown=t=>{t.key==="Escape"&&this._escape(t)};let i=this.options.maplibregl;if(!i){console.error("MapView needs the maplibre-gl module in options.maplibregl.");return}this._children=[...t.children],this._zoomIn=[...this._buttons("zoom-in")],this._zoomOut=[...this._buttons("zoom-out")],this._dark=this._isDark(),this.map=new i.Map({...this.options.mapOptions,container:t,style:this._style(),center:this.options.center,zoom:this.options.zoom}),this.map.on("style.load",this._handleStyleLoad),this.map.on("move",this._sync),this.map.on("click",this._handleMapClick);let n=this._children.filter(l=>l instanceof HTMLElement),o=new Set;for(let[l,c]of yn(n.filter(h=>h.matches(".map-marker[data-lng-lat]")))){let h=l.hasAttribute("aria-controls")?u.getElementById(l,l.getAttribute("aria-controls")):null,d=h?.parentElement===t&&h.matches(".map-popup")?h:null;d&&o.add(d),this._addMarker(l,d,c)}for(let[l,c]of yn(n.filter(h=>h.matches(".map-popup[data-lng-lat]")&&!o.has(h))))this._popup(l,0).setLngLat(c).addTo(this.map);let{signal:a}=this._events;this._themed()&&(matchMedia("(prefers-color-scheme: dark)").addEventListener("change",this._handleScheme,{signal:a}),this._observer=new MutationObserver(this._handleScheme),this._observer.observe(document.documentElement,{attributes:!0,attributeFilter:["theme"],subtree:!0}));for(let l of this._buttons("fullscreen"))l.hidden=!document.fullscreenEnabled;document.addEventListener("fullscreenchange",this._handleFullscreen,{signal:a}),t.addEventListener("click",this._handleClick,{signal:a}),t.addEventListener("keydown",this._handleKeydown,{signal:a}),this._sync()}static get defaults(){return ll}destroy(){if(super.destroy(),!!this.map){this._releaseMarkers(),this._observer?.disconnect();for(let t of this._overlays.values())t.off?.();for(let t of this._popups)t.remove();for(let t of this.markers){t.remove();let e=t.getElement();e.classList.remove(...[...e.classList].filter(i=>i.startsWith("maplibregl-"))),e.style.removeProperty("transform"),e.style.removeProperty("opacity"),e.hasAttribute("aria-controls")&&e.removeAttribute("aria-expanded")}this._location?.remove(),this._location=null,this.map.remove(),this.map=null,this.markers=[],this._popups=[],this._markerPopups.clear(),this._overlays.clear(),this.el.style.removeProperty("--md-comp-map-bearing");for(let t of this.el.querySelectorAll(".map-controls [data-action]"))t.disabled=!1,t.hidden=!1,t.removeAttribute("aria-pressed");this.el.append(...this._children)}}addRoute(t,e,i={}){this._line(t,{type:"LineString",coordinates:e},"route",{width:4,...i})}addArcs(t,e,i={}){this._line(t,{type:"MultiLineString",coordinates:e.map(({from:n,to:o})=>ul(n,o))},"arc",{width:2,...i})}addClusters(t,e,i={}){let n=`${t}-clusters`,o=`${t}-points`,a=async d=>{let[p]=d.features,g=await this.map.getSource(t).getClusterExpansionZoom(p.properties.cluster_id);this.map?.easeTo({center:p.geometry.coordinates,zoom:g})},l=()=>{this.map.getCanvas().style.cursor="pointer"},c=()=>{this.map.getCanvas().style.cursor=""},h=d=>{this.map[d]("click",n,a);for(let p of[n,o])this.map[d]("mouseenter",p,l),this.map[d]("mouseleave",p,c)};this._draw(t,{draw:()=>{let d=i.color??this._color("var(--md-comp-map-cluster-color)"),p=this._color("var(--md-comp-map-marker-ring-color)");this.map.addSource(t,{type:"geojson",data:e,cluster:!0,clusterRadius:i.radius??50,clusterMaxZoom:i.maxZoom??14}),this.map.addLayer({id:n,type:"circle",source:t,filter:["has","point_count"],paint:{"circle-color":d,"circle-radius":["step",["get","point_count"],16,10,20,100,26],"circle-stroke-width":6,"circle-stroke-color":d,"circle-stroke-opacity":.3}});let g=this.map.getStyle(),m=g.glyphs&&g.layers.find(E=>E.layout?.["text-font"])?.layout["text-font"];m&&this.map.addLayer({id:`${t}-count`,type:"symbol",source:t,filter:["has","point_count"],layout:{"text-field":["get","point_count_abbreviated"],"text-font":m,"text-size":12},paint:{"text-color":this._color("var(--md-comp-map-cluster-label-color)")}}),this.map.addLayer({id:o,type:"circle",source:t,filter:["!",["has","point_count"]],paint:{"circle-color":d,"circle-radius":6,"circle-stroke-width":2,"circle-stroke-color":p}})},off:()=>h("off")}),h("on")}removeOverlay(t){let e=this._overlays.get(t);if(e&&(this._overlays.delete(t),e.off?.(),!(!this._styleReady||!this.map.getSource(t)))){for(let i of this.map.getStyle().layers)i.source===t&&this.map.removeLayer(i.id);this.map.removeSource(t)}}_line(t,e,i,n){this._draw(t,{draw:()=>{this.map.addSource(t,{type:"geojson",data:{type:"Feature",properties:{},geometry:e}}),this.map.addLayer({id:t,type:"line",source:t,layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":n.color??this._color(`var(--md-comp-map-${i}-color)`),"line-width":n.width,"line-opacity":n.opacity??1,...n.dashArray&&{"line-dasharray":n.dashArray}}})}})}_draw(t,e){this.removeOverlay(t),this._overlays.set(t,e),this._styleReady&&e.draw()}_addMarker(t,e,i){let n=new this.options.maplibregl.Marker({element:t,draggable:t.hasAttribute("data-draggable")}).setLngLat(i).addTo(this.map);if(n.on("dragend",()=>this._moved(n)),t.hasAttribute("data-draggable")&&this._makeMovable(t,n),this.markers.push(n),!e)return;t.setAttribute("aria-expanded","false");let o=this._popup(e,16);o.on("open",()=>t.setAttribute("aria-expanded","true")),o.on("close",()=>{t.setAttribute("aria-expanded","false"),(!document.activeElement||document.activeElement===document.body)&&t.focus()}),this._markerPopups.set(t,o)}_moved(t){let e=t.getElement(),{lng:i,lat:n}=t.getLngLat();e.dataset.lngLat=`${i},${n}`,e.dispatchEvent(new Event("change",{bubbles:!0}))}_makeMovable(t,e){let i=t instanceof HTMLButtonElement?[]:["role","tabindex"].filter(n=>!t.hasAttribute(n));i.includes("role")&&t.setAttribute("role","button"),i.includes("tabindex")&&(t.tabIndex=0),t.setAttribute("aria-pressed","false"),this._restore.push(()=>["aria-pressed",...i].forEach(n=>t.removeAttribute(n))),t.addEventListener("keydown",n=>this._nudge(n,e),{signal:this._events.signal}),e.on("dragstart",()=>this._dragged=t),e.on("dragend",()=>setTimeout(()=>this._dragged=null))}_releaseMarkers(){this._restore.splice(0).forEach(t=>t()),this._picked=null}_nudge(t,e){let i=pl(t);if(!i)return;t.preventDefault(),t.stopPropagation();let n=this.map.project(e.getLngLat());e.setLngLat(this.map.unproject([n.x+i[0]*10,n.y+i[1]*10])),this._moved(e)}_pick(t){this._picked?.setAttribute("aria-pressed","false"),this._picked=t,t?.setAttribute("aria-pressed","true")}_tapMarker(t){t?.hasAttribute("data-draggable")?this._tapMovable(t):this._markerPopups.has(t)&&this._toggle(t)}_tapMovable(t){this._dragged!==t&&this._pick(this._picked===t?null:t)}_pan(t,e){let{width:i,height:n}=this.el.getBoundingClientRect();this.map.panBy([t*i/3,e*n/3])}_toggleFullscreen(){(document.fullscreenElement===this.el?document.exitFullscreen():this.el.requestFullscreen()).catch(()=>{})}_popup(t,e){let i=new this.options.maplibregl.Popup({closeOnClick:!1,maxWidth:"none",offset:e}).setDOMContent(t);return this._popups.push(i),i}_toggle(t){let e=this._markerPopups.get(t);e.isOpen()?e.remove():e.setLngLat(this.markers.find(i=>i.getElement()===t).getLngLat()).addTo(this.map)}_buttons(t){return this.el.querySelectorAll(`.map-controls [data-action="${t}"]`)}_locate(t){navigator.geolocation?.getCurrentPosition(({coords:e})=>{if(!this.map)return;let i=[e.longitude,e.latitude];if(!this._location){let n=document.createElement("span");n.className="map-marker location",n.setAttribute("aria-hidden","true"),this._location=new this.options.maplibregl.Marker({element:n})}this._location.setLngLat(i).addTo(this.map),this.map.flyTo({center:i,zoom:Math.max(this.map.getZoom(),14)})},e=>{this.map&&e.code===e.PERMISSION_DENIED&&(t.disabled=!0)})}_color(t){let e=document.createElement("span");e.hidden=!0,e.style.color=t,this.el.append(e);let i=document.createElement("canvas").getContext("2d",{willReadFrequently:!0});i.fillStyle=getComputedStyle(e).color,e.remove(),i.fillRect(0,0,1,1);let[n,o,a,l]=i.getImageData(0,0,1,1).data;return`rgba(${n}, ${o}, ${a}, ${Math.round(l/255*100)/100})`}_isDark(){return this._color("light-dark(black, white)")==="rgba(255, 255, 255, 1)"}_themed(){let t=this.options.style;return typeof t=="object"&&"light"in t&&"dark"in t}_style(){return this._themed()?this.options.style[this._dark?"dark":"light"]:this.options.style}_drop(t,e){if(!this._picked||t.closest?.(".map-marker"))return;let i=this.markers.find(n=>n.getElement()===this._picked);i.setLngLat(e),this._moved(i),this._pick(null)}_escape(t){if(this._picked){t.preventDefault(),this._pick(null);return}for(let e of this._popups)e.getElement()?.contains(t.target)&&(t.preventDefault(),e.remove())}};Re.key="Expressive_MapView";var ml={inDuration:275,outDuration:200,onOpenStart:null,onOpenEnd:null,onCloseStart:null,onCloseEnd:null},Bt=class extends b{constructor(t,e){super(t,e);this._timers=new Map;this._motion=window.matchMedia("(prefers-reduced-motion: reduce)");this._isOpen=!1;this._destroyed=!1;this._revision=0;this._phase=0;this._handleMotionChange=()=>{if(!this._motion.matches)return;let t=[...this._timers.values()],e=this._cancel();for(let i of t){if(e!==this._revision)break;i()}if(this.overlayActive)for(let i of[this.el,this._overlay,this._photoCaption])i&&(i.style.transition="none")};this._handleLightboxKeypress=t=>{this._trigger===this.el&&(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),this._handleLightboxToggle())};this._handleLightboxToggle=()=>{this._isOpen?this.close():this.open()};this._handleWindowChange=()=>{this.overlayActive&&this.close()};this._handleWindowEscape=t=>{t.key==="Escape"&&this.close()};this._handleWindowTab=t=>{t.key==="Tab"&&this.close()};this.open=()=>{if(this._destroyed||this._isOpen)return;this._phase++;let t=this._cancel();this.overlayActive&&this._reset(),this._updateVars();let e=this.el.getBoundingClientRect(),i=this.placeholder.getBoundingClientRect();if(!e.width||!e.height||(this._isOpen=!0,this.originalWidth=e.width,this.originalHeight=e.height,this.doneAnimating=!1,this.el.classList.add("active"),this.overlayActive=!0,!this._notify("open",this.options.onOpenStart,{current:()=>t===this._revision})))return;this.placeholder.style.width=i.width+"px",this.placeholder.style.height=i.height+"px",this.el.style.position="absolute",this.el.style.inset="auto",this.el.style.left=i.left+window.scrollX+"px",this.el.style.top=i.top+window.scrollY+"px",this.el.style.willChange="left, top, width, height",this.attrWidth=this.el.getAttribute("width"),this.attrHeight=this.el.getAttribute("height"),this.attrWidth&&(this.el.style.width=this.attrWidth+"px",this.el.removeAttribute("width")),this.attrHeight&&(this.el.style.height=this.attrHeight+"px",this.el.removeAttribute("height")),this._addOverlay(),this._showOnTop(this.el),this.caption!==""&&this._addCaption();let n=this.originalWidth/this.windowWidth,o=this.originalHeight/this.windowHeight;if(n>o){let l=this.originalHeight/this.originalWidth;this.newWidth=this.windowWidth*.9,this.newHeight=this.windowWidth*.9*l}else{let l=this.originalWidth/this.originalHeight;this.newWidth=this.windowHeight*.9*l,this.newHeight=this.windowHeight*.9}this._windowEvents?.abort(),this._windowEvents=R(this.el);let{signal:a}=this._windowEvents;window.addEventListener("scroll",this._handleWindowChange,{passive:!0,signal:a}),window.addEventListener("resize",this._handleWindowChange,{passive:!0,signal:a}),window.addEventListener("keyup",this._handleWindowEscape,{signal:a}),window.addEventListener("keydown",this._handleWindowTab,{signal:a}),this._animateImageIn()};this.close=()=>{if(this._destroyed||!this._isOpen)return;this._phase++;let t=this._cancel();this._isOpen=!1,this.doneAnimating=!1,this._notify("close",this.options.onCloseStart,{current:()=>t===this._revision})&&(this._windowEvents?.abort(),this._restoreFocus(),this._overlay&&this._fadeOut(this._overlay),this._photoCaption&&this._fadeOut(this._photoCaption),this._animateImageOut())};this.overlayActive=!1,this.doneAnimating=!0,this.placeholder=document.createElement("div"),this.placeholder.classList.add("material-placeholder"),this.originalWidth=0,this.originalHeight=0,this.originInlineStyles=this.el.getAttribute("style"),this.caption=this.el.getAttribute("data-caption")||"",this._tabindex=this.el.getAttribute("tabindex"),this._trigger=this.el.closest("button")??this.el,this.el.tabIndex=this._trigger===this.el?0:-1,this.el.before(this.placeholder),this.placeholder.append(this.el),this._setupEventHandlers()}static get defaults(){return ml}destroy(){if(this._destroyed)return;this._destroyed=!0;let t=this.el.getRootNode().activeElement===this.el;this._cancel(),this._reset(),this.placeholder.replaceWith(this.el),t&&this._restoreFocus(),x(this.el,"tabindex",this._tabindex),super.destroy()}_restoreFocus(){let t=this.el.getRootNode(),e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;[document.body,t.host].includes(e)&&this._trigger.focus({preventScroll:!0})}_reset(){this._windowEvents?.abort(),this._overlay?.remove(),this._photoCaption?.remove(),this.el.removeAttribute("popover"),this.attrWidth!=null&&this.el.setAttribute("width",this.attrWidth),this.attrHeight!=null&&this.el.setAttribute("height",this.attrHeight),this.el.classList.remove("active"),this.placeholder.removeAttribute("style"),x(this.el,"style",this.originInlineStyles),this.overlayActive=!1,this._isOpen=!1,this.doneAnimating=!0}_cancel(){for(let t of this._timers.keys())clearTimeout(t);return this._timers.clear(),++this._revision}_schedule(t,e){if(this._motion.matches){t();return}let i=setTimeout(()=>{this._timers.delete(i),t()},e);this._timers.set(i,t)}_setupEventHandlers(){let{signal:t}=this._events;this._motion.addEventListener("change",this._handleMotionChange,{signal:t}),this._trigger.addEventListener("click",this._handleLightboxToggle,{signal:t}),this.el.addEventListener("keydown",this._handleLightboxKeypress,{signal:t})}_showOnTop(t){t.setAttribute("popover","manual"),t.showPopover()}_restingPlace(){let t=this.placeholder.getBoundingClientRect();return{left:t.left+window.scrollX+"px",top:t.top+window.scrollY+"px"}}_updateVars(){this.windowWidth=window.innerWidth,this.windowHeight=window.innerHeight,this.caption=this.el.getAttribute("data-caption")||""}_animateImageIn(){let t=this._phase;this.el.style.maxHeight=this.newHeight.toString()+"px",this.el.style.maxWidth=this.newWidth.toString()+"px";let e=this._motion.matches?0:this.options.inDuration;this.el.style.transition="none",this.el.style.height=this.originalHeight+"px",this.el.style.width=this.originalWidth+"px",this._schedule(()=>{this.el.style.transition=`height ${e}ms ease,
|
|
18
|
+
</div>`;var ve=x;var bl={menuOptions:{constrainWidth:!1,coverTrigger:!1}},$t=class extends b{constructor(t,e){super(t,e);this._added=[];this._onFocusin=t=>{let e=this._items;e.includes(t.target)&&e.forEach(i=>i.tabIndex=i===t.target?0:-1)};this._onBarKeydown=t=>{if(!u.plainKey(t))return;let e=this._items,i=e.indexOf(t.target);if(i<0)return;let n=this._step(t.key);if(n)this._focusItem(i,n,!1);else if(t.key==="Home")this._focusItem(-1,1,!1);else if(t.key==="End")this._focusItem(e.length,-1,!1);else return;t.preventDefault()};this._onMenuKeydown=t=>{let e=this._step(t.key);if(!e||t.defaultPrevented||!u.plainKey(t))return;let i=this._items,n=t.composedPath(),o=i.findIndex(a=>{let l=$.getInstance(a);return l?.isOpen&&l.menuEl&&n.includes(l.menuEl)});o<0||(t.preventDefault(),this._focusItem(o,e,!0))};this._setAttribute(this.el,"role","menubar"),this._items.forEach((n,o)=>{$.init(n,this.options.menuOptions),this._setAttribute(n,"role","menuitem"),n.tabIndex=o===0?0:-1});let{signal:i}=this._events;this.el.addEventListener("keydown",this._onBarKeydown,{signal:i}),this.el.addEventListener("focusin",this._onFocusin,{signal:i}),document.addEventListener("keydown",this._onMenuKeydown,{signal:i})}static get defaults(){return bl}destroy(){this._items.forEach(t=>{$.getInstance(t)?.destroy(),t.removeAttribute("tabindex")}),this._added.forEach(({el:t,name:e})=>t.removeAttribute(e)),this._added=[],super.destroy()}get _items(){return[...this.el.querySelectorAll(":scope > .menu-trigger")]}_setAttribute(t,e,i){t.hasAttribute(e)||(t.setAttribute(e,i),this._added.push({el:t,name:e}))}_step(t){let e=getComputedStyle(this.el).direction==="rtl";return t==="ArrowRight"?e?-1:1:t==="ArrowLeft"?e?1:-1:null}_focusItem(t,e,i){let n=this._items,o=n.length,a=n.map((l,c)=>n[((t+e*(c+1))%o+o)%o]).find(l=>!l.matches(':disabled, [aria-disabled="true"]'));a&&(n.forEach(l=>{let c=$.getInstance(l);l!==a&&c?.isOpen&&c.close()}),a.focus(),i&&$.getInstance(a)?.open())}};$t.key="Expressive_Menubar";var El={autoScroll:!0,defaultScrollPosition:"end",peek:64},xi=2,yl=new Set(["ArrowUp","PageUp","Home"]),Tl=["pointerup","pointercancel","touchend","touchcancel"],qt=class extends b{constructor(t,e){super(t,e);this._opened=!1;this._following=!1;this._holding=!1;this._lastTop=0;this._target=null;this._distance=1/0;this._ref=null;this._refOffset=0;this._anchor=null;this._spacer=0;this._last=null;this._resizeObserver=null;this._mutationObserver=null;this._handleScroll=()=>{if(this._target!==null){let t=Math.abs(this.viewport.scrollTop-this._resolve(this._target));if(t>xi&&t<this._distance){this._distance=t;return}this._target=null}this._settle()};this._handleUserScroll=t=>{t.type==="wheel"&&t.deltaY>=0||t.type==="keydown"&&!yl.has(t.key)||(this._target=null,t.type==="pointerdown"||t.type==="touchstart"?this._holding=!0:this._following=!1)};this._handleRelease=()=>{this._holding&&(this._holding=!1,this._following&&(this.viewport.scrollTop=this.viewport.scrollHeight),this._sync())};this._handleButtonClick=()=>this.scrollToEnd();this._handleMutations=t=>{for(let i of t)i.addedNodes.forEach(n=>{n instanceof Element&&this._resizeObserver.observe(n)}),i.removedNodes.forEach(n=>{n instanceof Element&&this._resizeObserver.unobserve(n)});let e=this._last;if(this._last=this.viewport.lastElementChild,!!this._opened&&(!this._following&&this._target===null&&this._restore(),!!this.options.autoScroll&&!(e&&e.parentElement!==this.viewport))){for(let i=this._last;i&&i!==e;i=i.previousElementSibling)if(i.hasAttribute("data-scroll-anchor")){this._anchor=i,this._updateSpacer(),this._following=!0,this._scrollTo(this._top(i)-this.options.peek);return}}};this._handleResize=()=>{if(!this._opened){this.viewport.clientHeight>0&&this._open();return}this._updateSpacer();let t=this.viewport;this._target==="end"?this._scrollTo("end"):this._target===null&&(this._following&&!this._holding?t.scrollTop=t.scrollHeight:this._restore()),this._sync()};if(this.viewport=t.querySelector(":scope > .message-scroller-viewport"),this.button=t.querySelector(":scope > .message-scroller-button"),!this.viewport){console.error("MessageScroller needs a .message-scroller-viewport child.");return}this._last=this.viewport.lastElementChild,this.viewport.clientHeight>0&&this._open(),this._resizeObserver=new ResizeObserver(this._handleResize),this._resizeObserver.observe(this.viewport,{box:"border-box"});for(let n of Array.from(this.viewport.children))this._resizeObserver.observe(n);this._mutationObserver=new MutationObserver(this._handleMutations),this._mutationObserver.observe(this.viewport,{childList:!0});let{signal:i}=this._events;this.viewport.addEventListener("scroll",this._handleScroll,{passive:!0,signal:i});for(let n of["wheel","touchstart","pointerdown","keydown"])this.viewport.addEventListener(n,this._handleUserScroll,{passive:!0,signal:i});for(let n of Tl)document.addEventListener(n,this._handleRelease,{signal:i});this.button?.addEventListener("click",this._handleButtonClick,{signal:i})}static get defaults(){return El}destroy(){super.destroy(),this.viewport&&(this._resizeObserver?.disconnect(),this._mutationObserver?.disconnect(),this.viewport.style.removeProperty("--md-comp-message-scroller-spacer"),this.button&&(this.button.inert=!1))}scrollToEnd(){this._following=this.options.autoScroll,this._scrollTo("end")}scrollToStart(){this._following=!1,this._scrollTo(0)}scrollToMessage(t){let e=u.getElementById(this.viewport,t);return!e||!this.viewport.contains(e)?!1:(this._following=!1,this._scrollTo(this._top(e)-this.options.peek),!0)}_open(){this._opened=!0;let t=this.viewport,e=this.options.defaultScrollPosition,i=t.querySelectorAll(":scope > [data-scroll-anchor]"),n=e==="last-anchor"?i[i.length-1]:null;e==="start"?t.scrollTop=0:n&&this._contentEnd()-this._top(n)+this.options.peek>t.clientHeight?t.scrollTop=this._top(n)-this.options.peek:t.scrollTop=t.scrollHeight,this._settle()}_settle(){let t=this.viewport.scrollTop,e=this._following&&t>=this._lastTop-xi;this._following=this.options.autoScroll&&(e||this._atEnd()),this._lastTop=t,this._capture(),this._sync()}_scrollTo(t){let e=this.viewport;if(Math.abs(e.scrollTop-this._resolve(t))<=xi){this._target=null,this._settle();return}this._target=t,this._distance=1/0;let i=matchMedia("(prefers-reduced-motion: reduce)").matches;e.scrollTo({top:t==="end"?e.scrollHeight:t,behavior:i?"auto":"smooth"})}_resolve(t){let e=this.viewport.scrollHeight-this.viewport.clientHeight;return t==="end"?e:Math.max(0,Math.min(t,e))}_atEnd(){let t=this.viewport;return t.scrollHeight-t.scrollTop-t.clientHeight<=xi}_top(t){let e=this.viewport;return t.getBoundingClientRect().top-e.getBoundingClientRect().top-e.clientTop+e.scrollTop}_contentEnd(){let t=this.viewport.lastElementChild;if(!t)return 0;let e=parseFloat(getComputedStyle(this.viewport).paddingBlockEnd)-this._spacer;return this._top(t)+t.getBoundingClientRect().height+e}_capture(){let t=this.viewport.children,e=this.viewport.getBoundingClientRect().top+this.viewport.clientTop,i=0,n=t.length-1;for(;i<n;){let o=i+n>>1;t[o].getBoundingClientRect().bottom>e?n=o:i=o+1}this._ref=t[i]??null,this._refOffset=this._ref?this._ref.getBoundingClientRect().top-e:0}_restore(){if(this._ref?.parentElement!==this.viewport){this._capture();return}let t=this.viewport.getBoundingClientRect().top+this.viewport.clientTop,e=this._ref.getBoundingClientRect().top-t-this._refOffset;Math.abs(e)>=1&&(this.viewport.scrollTop+=e)}_updateSpacer(){let t=0;if(this._anchor?.parentElement===this.viewport){let e=this._top(this._anchor)-this.options.peek+this.viewport.clientHeight;t=Math.max(0,Math.ceil(e-this._contentEnd()))}else this._anchor=null;t!==this._spacer&&(this._spacer=t,t?this.viewport.style.setProperty("--md-comp-message-scroller-spacer",`${t}px`):this.viewport.style.removeProperty("--md-comp-message-scroller-spacer"))}_sync(){if(!this.button)return;let t=this._atEnd(),e=this.button.getRootNode();t&&e.activeElement===this.button&&this.viewport.focus({preventScroll:!0}),this.button.inert=t}};qt.key="Expressive_MessageScroller";var An={threshold:64,onRefresh:null,i18n:{refreshing:"Refreshing",refreshed:"Refreshed"}},Ll=4,xl=new Set(["auto","scroll"]),wl=(r,s)=>xl.has(getComputedStyle(r).overflowY)&&(r.scrollTop>0||r.contains(s)),wi=class wi extends b{constructor(t,e){super(t,e);this._start=null;this._pulling=!1;this._travel=0;this._refresh=null;this._onStart=t=>{if(this._refresh)return;if(t.touches.length!==1){this._endPull();return}let{clientX:e,clientY:i}=t.touches[0];this._start={x:e,y:i,target:u.eventTarget(t)}};this._onMove=t=>{if(!this._start)return;let{clientX:e,clientY:i}=t.touches[0],n=e-this._start.x,o=i-this._start.y;this._pulling||this._decide(n,o,this._start.target),this._pulling&&this._drag(t,o)};this._onEnd=()=>{let t=this._pulling&&this._travel>=this.options.threshold;this._endPull(),t&&this.refresh()};this._endPull=()=>{this._start=null,this._pulling=!1,this._travel=0,this.el.classList.remove("pulling"),this.el.style.removeProperty("--pull-to-refresh-offset"),this.el.style.removeProperty("--pull-to-refresh-progress")};this._onClick=t=>{let e=u.eventTarget(t)?.closest("[data-refresh]");e&&this.el.contains(e)&&this.refresh()};this.options.threshold>0||(this.options.threshold=An.threshold),this._status=t.ownerDocument.createElement("span"),this._status.className="pull-to-refresh-status",this._status.setAttribute("role","status"),t.append(this._status);let i=this._events.signal;t.addEventListener("touchstart",this._onStart,{passive:!0,signal:i}),t.addEventListener("touchmove",this._onMove,{passive:!1,signal:i}),t.addEventListener("touchend",this._onEnd,{signal:i}),t.addEventListener("touchcancel",this._endPull,{signal:i}),t.addEventListener("click",this._onClick,{signal:i})}static get defaults(){return An}refresh(){if(this._refresh||wi.getInstance(this.el)!==this)return;let t={pending:0};this._refresh=t,this.el.setAttribute("aria-busy","true"),this._status.textContent=this.options.i18n.refreshing;let e=()=>{--t.pending===0&&this._refresh===t&&this.complete()},i={waitUntil:n=>{t.pending++,Promise.resolve(n).finally(e)}};this._fireRefresh(t,i)}complete(){this._refresh&&(this._status.textContent=this.options.i18n.refreshed),this._refresh=null,this.el.removeAttribute("aria-busy")}destroy(){this._endPull(),this.complete(),this._status.remove(),super.destroy()}_fireRefresh(t,e){try{this._notify("refresh",this.options.onRefresh,{args:[e],detail:e})}catch(i){throw this._refresh===t&&this.complete(),i}}_canScrollUp(t){let e=t;for(;e&&!wl(e,this.el);)e=e.parentElement;return(e??this.el.ownerDocument.scrollingElement).scrollTop>0}_decide(t,e,i){Math.max(Math.abs(t),Math.abs(e))<=Ll||(e>Math.abs(t)&&!this._canScrollUp(i)?this._pulling=!0:this._start=null)}_drag(t,e){t.cancelable&&t.preventDefault();let{threshold:i}=this.options;this._travel=Math.max(e,0),this.el.classList.add("pulling"),this.el.style.setProperty("--pull-to-refresh-offset",`${Math.min(this._travel,i*2)/2}px`),this.el.style.setProperty("--pull-to-refresh-progress",`${Math.min(this._travel/i,1)}`)}};wi.key="Expressive_PullToRefresh";var be=wi;var Ml={i18n:{loading:"Loading",loaded:"Loaded"}},Cl=r=>!r.activeElement||r.activeElement===r.body,zt=class extends b{constructor(t,e){super(t,e);this._busy=!1;this._wasInert=!1;this._focus=null;this._status=t.ownerDocument.createElement("span"),this._status.className="loading-overlay-status",this._status.setAttribute("role","status"),t.after(this._status),this._observer=new MutationObserver(()=>this._sync()),this._observer.observe(t,{attributeFilter:["aria-busy"]}),this._sync(),this._busy&&(this._status.textContent="",requestAnimationFrame(()=>this._announceStart()))}static get defaults(){return Ml}destroy(){this._observer.disconnect(),this._busy&&(this.el.inert=this._wasInert),this._status.remove(),super.destroy()}_sync(){let t=this.el.getAttribute("aria-busy")==="true";t!==this._busy&&(this._busy=t,t?this._start():this._clear())}_start(){let t=this.el.getRootNode().activeElement;this._focus=t instanceof HTMLElement&&this.el.contains(t)?t:null,this._wasInert=this.el.inert,this.el.inert=!0,this._focus?.blur(),this._status.textContent=this.options.i18n.loading}_clear(){this.el.inert=this._wasInert,this._status.textContent=this.options.i18n.loaded;let t=this._focus;this._focus=null,t?.isConnected&&Cl(this.el.ownerDocument)&&t.focus()}_announceStart(){this._busy&&this._status.isConnected&&(this._status.textContent=this.options.i18n.loading)}};zt.key="Expressive_LoadingOverlay";var Sl={onToggle:null},kl=4,Al=.5,Il=100,Hl=r=>Date.now()-r.lastT<Il?r.velocity*r.sign:0,Ol=r=>{let s=Hl(r);return Math.abs(s)>Al?s>0:r.reveal>r.width/2},Kt=class extends b{constructor(t,e){super(t,e);this._open=null;this._swipe=null;this._onStart=t=>{if(t.touches.length!==1){this._cancel();return}let e=this._rowFor(u.eventTarget(t));if(!e)return;let{clientX:i,clientY:n}=t.touches[0],o=this._width(e),a=e===this._open?o:0;this._swipe={row:e,x:i,y:n,sign:this._sign(e),width:o,base:a,reveal:a,swiping:!1,last:i,lastT:Date.now(),velocity:0}};this._onMove=t=>{let e=this._swipe;if(!e)return;let{clientX:i,clientY:n}=t.touches[0];(e.swiping||this._decide(e,i-e.x,n-e.y))&&this._drag(t,e,i)};this._onEnd=()=>{let t=this._swipe;this._swipe=null,t?.swiping&&(t.row.classList.remove("swiping"),this._settle(t.row,Ol(t)))};this._onCancel=()=>this._cancel();this._onClick=t=>{let e=u.eventTarget(t);e.closest(".swipe-actions button")?this._closeFrom(e.closest("li")):e.closest("[data-swipe-toggle]")&&this._toggle(this._rowFor(e))};this._onKeydown=t=>{t.key==="Escape"&&this._closeFrom(this._rowFor(u.eventTarget(t)))};this._onFocusin=t=>{let e=u.eventTarget(t);e?.closest(".swipe-actions")?this.open(this._rowFor(e)):this._closeOutside(e)};this._onPointerdown=t=>this._closeOutside(u.eventTarget(t));this._rows().forEach(o=>this._toggleFor(o)?.setAttribute("aria-expanded","false"));let i=this._events.signal,n=t.ownerDocument;t.addEventListener("click",this._onClick,{signal:i}),t.addEventListener("keydown",this._onKeydown,{signal:i}),t.addEventListener("touchstart",this._onStart,{passive:!0,signal:i}),t.addEventListener("touchmove",this._onMove,{passive:!1,signal:i}),t.addEventListener("touchcancel",this._onCancel,{signal:i}),t.addEventListener("touchend",this._onEnd,{signal:i}),n.addEventListener("focusin",this._onFocusin,{signal:i}),n.addEventListener("pointerdown",this._onPointerdown,{signal:i})}static get defaults(){return Sl}open(t){this._isRow(t)&&(this._place(t,this._width(t)),this._open!==t&&(this.close(),this._open=t,t.classList.add("swipe-open"),this._toggleFor(t)?.setAttribute("aria-expanded","true"),this._fire(t,!0)))}close(){let t=this._open;t&&(this._open=null,this._shut(t),this._fire(t,!1))}destroy(){let t=[this._swipe?.row,this._open];this._swipe=null,this._open=null,t.forEach(e=>e&&this._shut(e)),this._rows().forEach(e=>this._toggleFor(e)?.removeAttribute("aria-expanded")),super.destroy()}_rows(){return[...this.el.querySelectorAll(":scope > li:has(> .swipe-actions)")]}_isRow(t){return!!t&&t.parentElement===this.el&&!!t.querySelector(":scope > .swipe-actions")}_rowFor(t){let e=t?.closest("li")??null;return this._isRow(e)?e:null}_toggleFor(t){return t.querySelector("[data-swipe-toggle]")}_width(t){return t.querySelector(":scope > .swipe-actions").offsetWidth}_sign(t){return getComputedStyle(t).direction==="rtl"?1:-1}_place(t,e){t.style.setProperty("--swipe-offset",`${e*this._sign(t)}px`)}_shut(t){t.classList.remove("swipe-open","swiping"),t.style.removeProperty("--swipe-offset"),this._toggleFor(t)?.setAttribute("aria-expanded","false")}_fire(t,e){let i={row:t,open:e};this._notify("swipetoggle",this.options.onToggle,{args:[i],detail:i})}_decide(t,e,i){return Math.max(Math.abs(e),Math.abs(i))<=kl?!1:(t.swiping=Math.abs(e)>Math.abs(i),t.swiping||(this._swipe=null),t.swiping)}_drag(t,e,i){t.cancelable&&t.preventDefault();let n=Date.now();i!==e.last&&(e.velocity=(i-e.last)/Math.max(1,n-e.lastT),e.last=i,e.lastT=n),e.reveal=Math.min(Math.max(e.base+(i-e.x)*e.sign,0),e.width),e.row.classList.add("swiping"),this._place(e.row,e.reveal)}_settle(t,e){e?this.open(t):t===this._open?this.close():this._shut(t)}_cancel(){let t=this._swipe;this._swipe=null,t?.swiping&&(t.row.classList.remove("swiping"),this._settle(t.row,t.row===this._open))}_toggle(t){t===this._open?this.close():this.open(t)}_closeFrom(t){if(!t||t!==this._open)return;let e=t.querySelector(":scope > .swipe-actions").contains(t.ownerDocument.activeElement);this.close(),e&&this._focusToggle(t)}_focusToggle(t){this._toggleFor(t)?.focus()}_closeOutside(t){this._open&&!this._open.contains(t)&&this.close()}};Kt.key="Expressive_SwipeActions";var Dl={Editor:null,extensions:[]},In=(r,s)=>Reflect.get(r,s),Pl=["aria-label","aria-labelledby","aria-describedby"],Be=class extends b{constructor(t,e){super(t,e);this.editor=null;this.content=null;this._actions=new Map;this._label=null;this._required=!1;this._form=null;this._handleClick=t=>{let e=t.target.closest("button[data-command]"),i=this._actions.get(e);i&&!e.disabled&&In(this.editor.chain().focus(),i.command)(i.attributes).run()};this._handleLabelClick=()=>{this.editor.chain().focus().run()};this._handleSubmit=t=>{this._skipsValidation(t)||!this.editor.isEditable||!this.editor.isEmpty||(t.preventDefault(),t.stopImmediatePropagation(),this.editor.chain().focus().run())};this._handleReset=()=>{if(!this.editor)return;this.editor.commands.setContent(this.textarea.value,{emitUpdate:!1})};this._handleUpdate=()=>{this.textarea.value=this.editor.isEmpty?"":this.editor.getHTML(),this.textarea.dispatchEvent(new Event("input",{bubbles:!0}))};this._handleTransaction=()=>{let t=this.editor.isEditable&&this.editor.can();for(let[e,{command:i,attributes:n,active:o}]of this._actions){if(e.disabled=!t||!(i in this.editor.commands)||!In(t,i)(n),!o)continue;let a=this.editor.isActive(o,n);e.setAttribute("aria-pressed",String(a)),e.classList.toggle("active",a)}};if(this.textarea=t.querySelector(":scope > textarea"),!this.textarea||!this.options.Editor){console.error("RichTextEditor needs a <textarea> child and the Tiptap Editor class in options.Editor.");return}for(let o of t.querySelectorAll("button[data-command]")){let a=o.dataset.command,l;try{l=o.dataset.attributes?JSON.parse(o.dataset.attributes):void 0}catch{console.warn("RichTextEditor ignored invalid JSON in data-attributes:",o.dataset.attributes)}let c=a.startsWith("toggle")?a[6].toLowerCase()+a.slice(7):void 0;this._actions.set(o,{command:a,attributes:l,active:c})}let i={role:"textbox","aria-multiline":"true"};for(let o of Pl){let a=this.textarea.getAttribute(o);a&&(i[o]=a)}this._label=this.textarea.labels?.[0]??null,this._label&&!i["aria-labelledby"]&&(this._label.id||(this._label.id=`rich-text-editor-label-${u.guid()}`),i["aria-labelledby"]=this._label.id,this._label.addEventListener("click",this._handleLabelClick,{signal:this._events.signal})),this._required=this.textarea.required,this._form=this.textarea.form,this._required&&(i["aria-required"]="true",this.textarea.required=!1,this._form?.addEventListener("submit",this._handleSubmit,{capture:!0,signal:this._events.signal})),B(this.textarea,this._handleReset,this._events.signal),this.content=document.createElement("div"),this.content.className="rich-text-editor-content",this.textarea.after(this.content),this.textarea.hidden=!0;let n={element:this.content,extensions:this.options.extensions,content:this.textarea.value,editable:!(this.textarea.disabled||this.textarea.readOnly),editorProps:{attributes:i}};this.editor=new this.options.Editor(n),this.editor.on("update",this._handleUpdate),this.editor.on("transaction",this._handleTransaction),this._handleTransaction(),t.addEventListener("click",this._handleClick,{signal:this._events.signal})}static init(t,e={}){return super.init.call(this,t,e)}static get defaults(){return Dl}destroy(){if(super.destroy(),!!this.editor){this.editor.off("update",this._handleUpdate),this.editor.off("transaction",this._handleTransaction),this.editor.destroy(),this.editor=null,this.content.remove(),this.textarea.hidden=!1,this.textarea.required=this._required;for(let t of this._actions.keys())t.disabled=!1,t.classList.remove("active"),t.removeAttribute("aria-pressed")}}_skipsValidation(t){return this._form.noValidate||!!t.submitter?.formNoValidate}};Be.key="Expressive_RichTextEditor";var Hn="https://tiles.openfreemap.org/styles/",Rl={maplibregl:null,style:{light:`${Hn}positron`,dark:`${Hn}dark`},center:[0,20],zoom:1,mapOptions:{}},Fl=r=>r.length===2&&r.every(Number.isFinite)&&Math.abs(r[1])<=90,Nl=r=>{let s=r.dataset.lngLat.split(",").map(t=>t.trim()?Number(t):NaN);return Fl(s)?s:(console.warn(`MapView skipped data-lng-lat="${r.dataset.lngLat}": expected "longitude,latitude".`,r),null)},On=r=>r.map(s=>[s,Nl(s)]).filter(s=>s[1]!==null);function Bl([r,s],[t,e],i=32){let n=t>=r?.25:-.25,o=(r+t)/2-(e-s)*n,a=(s+e)/2+(t-r)*n;return Array.from({length:i+1},(l,c)=>{let h=c/i,d=1-h;return[d*d*r+2*d*h*o+h*h*t,d*d*s+2*d*h*a+h*h*e]})}var $l={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]},ql=r=>u.plainKey(r)?$l[r.key]:void 0,$e=class extends b{constructor(t,e){super(t,e);this.map=null;this.markers=[];this._children=[];this._popups=[];this._markerPopups=new Map;this._overlays=new Map;this._styleReady=!1;this._dark=!1;this._location=null;this._observer=null;this._zoomIn=[];this._zoomOut=[];this._picked=null;this._dragged=null;this._restore=[];this._actions={"zoom-in":()=>this.map.zoomIn(),"zoom-out":()=>this.map.zoomOut(),compass:()=>this.map.resetNorthPitch(),locate:t=>this._locate(t),fullscreen:()=>this._toggleFullscreen(),"pan-up":()=>this._pan(0,-1),"pan-down":()=>this._pan(0,1),"pan-left":()=>this._pan(-1,0),"pan-right":()=>this._pan(1,0)};this._handleStyleLoad=()=>{this._styleReady=!0;for(let t of this._overlays.values())t.draw()};this._handleScheme=()=>{let t=this._isDark();t!==this._dark&&(this._dark=t,this._styleReady=!1,this.map.setStyle(this._style(),{diff:!1}))};this._sync=()=>{let t=this.map.getZoom();for(let e of this._zoomIn)e.disabled=t>=this.map.getMaxZoom();for(let e of this._zoomOut)e.disabled=t<=this.map.getMinZoom();this.el.style.setProperty("--md-comp-map-bearing",`${-this.map.getBearing()}deg`)};this._handleFullscreen=()=>{for(let t of this._buttons("fullscreen"))t.setAttribute("aria-pressed",String(document.fullscreenElement===this.el))};this._handleClick=t=>{let e=t.target,i=e.closest(".map-controls [data-action]");i?this._actions[i.dataset.action]?.(i):this._tapMarker(e.closest(".map-marker"))};this._handleMapClick=t=>{let e=t.originalEvent.target;this._drop(e,t.lngLat);for(let[i,n]of this._markerPopups)!i.contains(e)&&!n.getElement()?.contains(e)&&n.remove()};this._handleKeydown=t=>{t.key==="Escape"&&this._escape(t)};let i=this.options.maplibregl;if(!i){console.error("MapView needs the maplibre-gl module in options.maplibregl.");return}this._children=[...t.children],this._zoomIn=[...this._buttons("zoom-in")],this._zoomOut=[...this._buttons("zoom-out")],this._dark=this._isDark();let n={...this.options.mapOptions,container:t,style:this._style(),center:this.options.center,zoom:this.options.zoom};this.map=new i.Map(n),this.map.on("style.load",this._handleStyleLoad),this.map.on("move",this._sync),this.map.on("click",this._handleMapClick);let o=this._children.filter(c=>c instanceof HTMLElement),a=new Set;for(let[c,h]of On(o.filter(d=>d.matches(".map-marker[data-lng-lat]")))){let d=c.hasAttribute("aria-controls")?u.getElementById(c,c.getAttribute("aria-controls")):null,p=d?.parentElement===t&&d.matches(".map-popup")?d:null;p&&a.add(p),this._addMarker(c,p,h)}for(let[c,h]of On(o.filter(d=>d.matches(".map-popup[data-lng-lat]")&&!a.has(d))))this._popup(c,0).setLngLat(h).addTo(this.map);let{signal:l}=this._events;this._themed()&&(matchMedia("(prefers-color-scheme: dark)").addEventListener("change",this._handleScheme,{signal:l}),this._observer=new MutationObserver(this._handleScheme),this._observer.observe(document.documentElement,{attributes:!0,attributeFilter:["theme"],subtree:!0}));for(let c of this._buttons("fullscreen"))c.hidden=!document.fullscreenEnabled;document.addEventListener("fullscreenchange",this._handleFullscreen,{signal:l}),t.addEventListener("click",this._handleClick,{signal:l}),t.addEventListener("keydown",this._handleKeydown,{signal:l}),this._sync()}static init(t,e={}){return super.init.call(this,t,e)}static get defaults(){return Rl}destroy(){if(super.destroy(),!!this.map){this._releaseMarkers(),this._observer?.disconnect();for(let t of this._overlays.values())t.off?.();for(let t of this._popups)t.remove();for(let t of this.markers){t.remove();let e=t.getElement();e.classList.remove(...[...e.classList].filter(i=>i.startsWith("maplibregl-"))),e.style.removeProperty("transform"),e.style.removeProperty("opacity"),e.hasAttribute("aria-controls")&&e.removeAttribute("aria-expanded")}this._location?.remove(),this._location=null,this.map.remove(),this.map=null,this.markers=[],this._popups=[],this._markerPopups.clear(),this._overlays.clear(),this.el.style.removeProperty("--md-comp-map-bearing");for(let t of this.el.querySelectorAll(".map-controls [data-action]"))t.disabled=!1,t.hidden=!1,t.removeAttribute("aria-pressed");this.el.append(...this._children)}}addRoute(t,e,i={}){this._line(t,{type:"LineString",coordinates:e},"route",{width:4,...i})}addArcs(t,e,i={}){this._line(t,{type:"MultiLineString",coordinates:e.map(({from:n,to:o})=>Bl(n,o))},"arc",{width:2,...i})}addClusters(t,e,i={}){let n=`${t}-clusters`,o=`${t}-points`,a=async d=>{let[p]=d.features,m=await this.map.getSource(t).getClusterExpansionZoom(p.properties.cluster_id).catch(()=>null);m!==null&&this.map?.easeTo({center:p.geometry.coordinates,zoom:m})},l=()=>{this.map.getCanvas().style.cursor="pointer"},c=()=>{this.map.getCanvas().style.cursor=""},h=d=>{this.map[d]("click",n,a);for(let p of[n,o])this.map[d]("mouseenter",p,l),this.map[d]("mouseleave",p,c)};this._draw(t,{draw:()=>{let d=i.color??this._color("var(--md-comp-map-cluster-color)"),p=this._color("var(--md-comp-map-marker-ring-color)");this.map.addSource(t,{type:"geojson",data:e,cluster:!0,clusterRadius:i.radius??50,clusterMaxZoom:i.maxZoom??14}),this.map.addLayer({id:n,type:"circle",source:t,filter:["has","point_count"],paint:{"circle-color":d,"circle-radius":["step",["get","point_count"],16,10,20,100,26],"circle-stroke-width":6,"circle-stroke-color":d,"circle-stroke-opacity":.3}});let _=this.map.getStyle(),m=_.glyphs&&_.layers.find(E=>E.layout?.["text-font"])?.layout["text-font"];m&&this.map.addLayer({id:`${t}-count`,type:"symbol",source:t,filter:["has","point_count"],layout:{"text-field":["get","point_count_abbreviated"],"text-font":m,"text-size":12},paint:{"text-color":this._color("var(--md-comp-map-cluster-label-color)")}}),this.map.addLayer({id:o,type:"circle",source:t,filter:["!",["has","point_count"]],paint:{"circle-color":d,"circle-radius":6,"circle-stroke-width":2,"circle-stroke-color":p}})},off:()=>h("off")}),h("on")}removeOverlay(t){let e=this._overlays.get(t);if(e&&(this._overlays.delete(t),e.off?.(),!(!this._styleReady||!this.map.getSource(t)))){for(let i of this.map.getStyle().layers)i.source===t&&this.map.removeLayer(i.id);this.map.removeSource(t)}}_line(t,e,i,n){this._draw(t,{draw:()=>{this.map.addSource(t,{type:"geojson",data:{type:"Feature",properties:{},geometry:e}}),this.map.addLayer({id:t,type:"line",source:t,layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":n.color??this._color(`var(--md-comp-map-${i}-color)`),"line-width":n.width,"line-opacity":n.opacity??1,...n.dashArray&&{"line-dasharray":n.dashArray}}})}})}_draw(t,e){this.removeOverlay(t),this._overlays.set(t,e),this._styleReady&&e.draw()}_addMarker(t,e,i){let n=new this.options.maplibregl.Marker({element:t,draggable:t.hasAttribute("data-draggable")}).setLngLat(i).addTo(this.map);if(n.on("dragend",()=>this._moved(n)),t.hasAttribute("data-draggable")&&this._makeMovable(t,n),this.markers.push(n),!e)return;t.setAttribute("aria-expanded","false");let o=this._popup(e,16);o.on("open",()=>t.setAttribute("aria-expanded","true")),o.on("close",()=>{t.setAttribute("aria-expanded","false"),(!document.activeElement||document.activeElement===document.body)&&t.focus()}),this._markerPopups.set(t,o)}_moved(t){let e=t.getElement(),{lng:i,lat:n}=t.getLngLat();e.dataset.lngLat=`${i},${n}`,e.dispatchEvent(new Event("change",{bubbles:!0}))}_makeMovable(t,e){let i=t instanceof HTMLButtonElement?[]:["role","tabindex"].filter(n=>!t.hasAttribute(n));i.includes("role")&&t.setAttribute("role","button"),i.includes("tabindex")&&(t.tabIndex=0),t.setAttribute("aria-pressed","false"),this._restore.push(()=>["aria-pressed",...i].forEach(n=>t.removeAttribute(n))),t.addEventListener("keydown",n=>this._nudge(n,e),{signal:this._events.signal}),e.on("dragstart",()=>this._dragged=t),e.on("dragend",()=>setTimeout(()=>{this._dragged=null}))}_releaseMarkers(){this._restore.splice(0).forEach(t=>t()),this._picked=null}_nudge(t,e){let i=ql(t);if(!i)return;t.preventDefault(),t.stopPropagation();let n=this.map.project(e.getLngLat());e.setLngLat(this.map.unproject([n.x+i[0]*10,n.y+i[1]*10])),this._moved(e)}_pick(t){this._picked?.setAttribute("aria-pressed","false"),this._picked=t,t?.setAttribute("aria-pressed","true")}_tapMarker(t){t?.matches("[data-draggable][aria-pressed]")?this._tapMovable(t):this._markerPopups.has(t)&&this._toggle(t)}_tapMovable(t){this._dragged!==t&&this._pick(this._picked===t?null:t)}_pan(t,e){let{width:i,height:n}=this.el.getBoundingClientRect();this.map.panBy([t*i/3,e*n/3])}_toggleFullscreen(){(document.fullscreenElement===this.el?document.exitFullscreen():this.el.requestFullscreen()).catch(()=>{})}_popup(t,e){let i=new this.options.maplibregl.Popup({closeOnClick:!1,maxWidth:"none",offset:e}).setDOMContent(t);return this._popups.push(i),i}_toggle(t){let e=this._markerPopups.get(t);e.isOpen()?e.remove():e.setLngLat(this.markers.find(i=>i.getElement()===t).getLngLat()).addTo(this.map)}_buttons(t){return this.el.querySelectorAll(`.map-controls [data-action="${t}"]`)}_locate(t){navigator.geolocation?.getCurrentPosition(({coords:e})=>{if(!this.map)return;let i=[e.longitude,e.latitude];if(!this._location){let n=document.createElement("span");n.className="map-marker location",n.setAttribute("aria-hidden","true"),this._location=new this.options.maplibregl.Marker({element:n})}this._location.setLngLat(i).addTo(this.map),this.map.flyTo({center:i,zoom:Math.max(this.map.getZoom(),14)})},e=>{this.map&&e.code===e.PERMISSION_DENIED&&(t.disabled=!0)})}_color(t){let e=document.createElement("span");e.hidden=!0,e.style.color=t,this.el.append(e);let i=document.createElement("canvas").getContext("2d",{willReadFrequently:!0});i.fillStyle=getComputedStyle(e).color,e.remove(),i.fillRect(0,0,1,1);let[n,o,a,l]=i.getImageData(0,0,1,1).data;return`rgba(${n}, ${o}, ${a}, ${Math.round(l/255*100)/100})`}_isDark(){return this._color("light-dark(black, white)")==="rgba(255, 255, 255, 1)"}_themed(t=this.options.style){return typeof t=="object"&&"light"in t&&"dark"in t}_style(){let t=this.options.style;return this._themed(t)?t[this._dark?"dark":"light"]:t}_drop(t,e){if(!this._picked||t.closest?.(".map-marker"))return;let i=this.markers.find(n=>n.getElement()===this._picked);i.setLngLat(e),this._moved(i),this._pick(null)}_escape(t){if(this._picked){t.preventDefault(),this._pick(null);return}for(let e of this._popups)e.getElement()?.contains(t.target)&&(t.preventDefault(),e.remove())}};$e.key="Expressive_MapView";var zl={inDuration:275,outDuration:200,onOpenStart:null,onOpenEnd:null,onCloseStart:null,onCloseEnd:null},Vt=class extends b{constructor(t,e){super(t,e);this._timers=new Map;this._motion=window.matchMedia("(prefers-reduced-motion: reduce)");this._isOpen=!1;this._destroyed=!1;this._revision=0;this._phase=0;this._handleMotionChange=()=>{if(!this._motion.matches)return;let t=[...this._timers.values()],e=this._cancel();for(let i of t){if(e!==this._revision)break;i()}if(this.overlayActive)for(let i of[this.el,this._overlay,this._photoCaption])i&&(i.style.transition="none")};this._handleLightboxKeypress=t=>{this._trigger===this.el&&(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),this._handleLightboxToggle())};this._handleLightboxToggle=()=>{this._isOpen?this.close():this.open()};this._handleWindowChange=()=>{this.overlayActive&&this.close()};this._handleWindowEscape=t=>{t.key==="Escape"&&(t.preventDefault(),this.close())};this._handleWindowTab=t=>{t.key==="Tab"&&this.close()};this.open=()=>{if(this._destroyed||this._isOpen)return;this._phase++;let t=this._cancel();this.overlayActive&&this._reset(),this._updateVars();let e=this.el.getBoundingClientRect(),i=this.placeholder.getBoundingClientRect();if(!e.width||!e.height||(this._isOpen=!0,this.originalWidth=e.width,this.originalHeight=e.height,this.doneAnimating=!1,this.el.classList.add("active"),this.overlayActive=!0,!this._notify("open",this.options.onOpenStart,{current:()=>t===this._revision})))return;this.placeholder.style.width=i.width+"px",this.placeholder.style.height=i.height+"px",this.el.style.position="absolute",this.el.style.inset="auto",this.el.style.left=i.left+window.scrollX+"px",this.el.style.top=i.top+window.scrollY+"px",this.el.style.willChange="left, top, width, height",this.attrWidth=this.el.getAttribute("width"),this.attrHeight=this.el.getAttribute("height"),this.attrWidth&&(this.el.style.width=this.attrWidth+"px",this.el.removeAttribute("width")),this.attrHeight&&(this.el.style.height=this.attrHeight+"px",this.el.removeAttribute("height")),this._addOverlay(),this._showOnTop(this.el),this.caption!==""&&this._addCaption();let n=this.originalWidth/this.windowWidth,o=this.originalHeight/this.windowHeight;if(n>o){let l=this.originalHeight/this.originalWidth;this.newWidth=this.windowWidth*.9,this.newHeight=this.windowWidth*.9*l}else{let l=this.originalWidth/this.originalHeight;this.newWidth=this.windowHeight*.9*l,this.newHeight=this.windowHeight*.9}this._windowEvents?.abort(),this._windowEvents=R(this.el);let{signal:a}=this._windowEvents;window.addEventListener("scroll",this._handleWindowChange,{passive:!0,signal:a}),window.addEventListener("resize",this._handleWindowChange,{passive:!0,signal:a}),window.addEventListener("keydown",this._handleWindowEscape,{signal:a}),window.addEventListener("keydown",this._handleWindowTab,{signal:a}),this._animateImageIn()};this.close=()=>{if(this._destroyed||!this._isOpen)return;this._phase++;let t=this._cancel();this._isOpen=!1,this.doneAnimating=!1,this._notify("close",this.options.onCloseStart,{current:()=>t===this._revision})&&(this._windowEvents?.abort(),this._restoreFocus(),this._overlay&&this._fadeOut(this._overlay),this._photoCaption&&this._fadeOut(this._photoCaption),this._animateImageOut())};this.overlayActive=!1,this.doneAnimating=!0,this.placeholder=document.createElement("div"),this.placeholder.classList.add("material-placeholder"),this.originalWidth=0,this.originalHeight=0,this.originInlineStyles=this.el.getAttribute("style"),this.caption=this.el.getAttribute("data-caption")||"",this._tabindex=this.el.getAttribute("tabindex"),this._trigger=this.el.closest("button")??this.el,this.el.tabIndex=this._trigger===this.el?0:-1,this.el.before(this.placeholder),this.placeholder.append(this.el),this._setupEventHandlers()}static get defaults(){return zl}destroy(){if(this._destroyed)return;this._destroyed=!0;let t=this.el.getRootNode().activeElement===this.el;this._cancel(),this._reset(),this.placeholder.replaceWith(this.el),t&&this._restoreFocus(),w(this.el,"tabindex",this._tabindex),super.destroy()}_restoreFocus(){let t=this.el.getRootNode(),e=dt(document);[document.body,t.host].includes(e)&&this._trigger.focus({preventScroll:!0})}_reset(){this._windowEvents?.abort(),this._overlay?.remove(),this._photoCaption?.remove(),this.el.removeAttribute("popover"),this.attrWidth!=null&&this.el.setAttribute("width",this.attrWidth),this.attrHeight!=null&&this.el.setAttribute("height",this.attrHeight),this.el.classList.remove("active"),this.placeholder.removeAttribute("style"),w(this.el,"style",this.originInlineStyles),this.overlayActive=!1,this._isOpen=!1,this.doneAnimating=!0}_cancel(){for(let t of this._timers.keys())clearTimeout(t);return this._timers.clear(),++this._revision}_schedule(t,e){if(this._motion.matches){t();return}let i=setTimeout(()=>{this._timers.delete(i),t()},e);this._timers.set(i,t)}_setupEventHandlers(){let{signal:t}=this._events;this._motion.addEventListener("change",this._handleMotionChange,{signal:t}),this._trigger.addEventListener("click",this._handleLightboxToggle,{signal:t}),this.el.addEventListener("keydown",this._handleLightboxKeypress,{signal:t})}_showOnTop(t){t.setAttribute("popover","manual"),t.showPopover()}_restingPlace(){let t=this.placeholder.getBoundingClientRect();return{left:t.left+window.scrollX+"px",top:t.top+window.scrollY+"px"}}_updateVars(){this.windowWidth=window.innerWidth,this.windowHeight=window.innerHeight,this.caption=this.el.getAttribute("data-caption")||""}_animateImageIn(){let t=this._phase;this.el.style.maxHeight=this.newHeight.toString()+"px",this.el.style.maxWidth=this.newWidth.toString()+"px";let e=this._motion.matches?0:this.options.inDuration;this.el.style.transition="none",this.el.style.height=this.originalHeight+"px",this.el.style.width=this.originalWidth+"px",this._schedule(()=>{this.el.style.transition=`height ${e}ms ease,
|
|
19
19
|
width ${e}ms ease,
|
|
20
20
|
left ${e}ms ease,
|
|
21
21
|
top ${e}ms ease
|
|
@@ -23,7 +23,7 @@ var Expressive=(()=>{var yi=Object.defineProperty;var jn=Object.getOwnPropertyDe
|
|
|
23
23
|
width ${e}ms ease,
|
|
24
24
|
left ${e}ms ease,
|
|
25
25
|
top ${e}ms ease
|
|
26
|
-
`,this.el.style.height=this.originalHeight+"px",this.el.style.width=this.originalWidth+"px",Object.assign(this.el.style,this._restingPlace()),this._schedule(()=>{this._reset(),this._notify("closed",this.options.onCloseEnd,{current:()=>t===this._phase})},e)}_addCaption(){this._photoCaption=document.createElement("div"),this._photoCaption.classList.add("lightbox-caption"),this._photoCaption.innerText=this.caption,u.portalRoot(this.el).append(this._photoCaption),this._photoCaption.style.display="inline",this._showOnTop(this._photoCaption),this._fadeIn(this._photoCaption)}_addOverlay(){this._overlay=document.createElement("div"),this._overlay.id="lightbox-overlay",this._overlay.addEventListener("click",t=>{t.stopPropagation(),this.close()},{once:!0}),this.el.before(this._overlay),this._showOnTop(this._overlay),this._fadeIn(this._overlay)}_fadeIn(t){t.style.transition="none",t.style.opacity="0";let e=this._motion.matches?0:this.options.inDuration;this._schedule(()=>{t.style.transition=`opacity ${e}ms ease`,t.style.opacity="1"},1)}_fadeOut(t){let e=this._motion.matches?0:this.options.outDuration;t.style.transition=`opacity ${e}ms ease`,t.style.opacity="0"}};Bt.key="Expressive_Lightbox";var Tn=r=>`a[href="#${r}"]`,fl={scrollOffset:200,activeClass:"active",getActiveElement:Tn,keepTopElementActive:!1},F=class F extends b{constructor(t,e){super(t,e);this._ratio=0;this._link=null;this._offset=this.el.style.getPropertyValue("--md-comp-scrollspy-offset"),this._offsetPriority=this.el.style.getPropertyPriority("--md-comp-scrollspy-offset"),this.el.style.setProperty("--md-comp-scrollspy-offset",`${this.options.scrollOffset}px`),F._elements.push(this),this._observer=new IntersectionObserver(i=>{if(F.getInstance(this.el)===this){for(let n of i)this._ratio=n.isIntersecting?n.intersectionRatio:0;F._syncActive(this.options.getActiveElement)}},{rootMargin:`-${this.options.scrollOffset}px 0px -45% 0px`,threshold:[0,.1,.25,.5,.75,1]}),this._observer.observe(this.el)}static get defaults(){return fl}destroy(){let t=F._elements.indexOf(this);if(t<0)return;F._elements.splice(t,1),this._observer?.disconnect();let e=this.options.getActiveElement;F._active.get(e)===this&&F._clearActive(e),this.el.style.setProperty("--md-comp-scrollspy-offset",this._offset,this._offsetPriority),super.destroy(),F._syncActive(e)}static _syncActive(t){let e=F._elements.filter(l=>l.options.getActiveElement===t),i=null,n=0;for(let l of e){let c=l._ratio;c>n&&(n=c,i=l)}if(!i){let l=e.filter(c=>c.options.keepTopElementActive);i=F._nearestAbove(l)??l[0]}let o=F._active.get(t);if(i&&o===i&&i._link?.isConnected)return;let a=i?F._linkFor(i.el.id,i.options,i.el.getRootNode()):null;o===i&&o?._link===a||(F._clearActive(t),a&&(a.classList.add(i.options.activeClass),a.setAttribute("aria-current","true"),i._link=a,F._active.set(t,i),i._notify("change",null,{detail:{link:a}})))}static _nearestAbove(t){let e=null,i=-1/0;for(let n of t){let o=n.el.getBoundingClientRect().top;o<=0&&o>=i&&(i=o,e=n)}return e}static _clearActive(t){let e=F._active.get(t);e&&(e._link?.classList.remove(e.options.activeClass),e._link?.removeAttribute("aria-current"),e._link=null,F._active.delete(t))}static _linkFor(t,e,i=document){if(!t)return null;if(e.getActiveElement!==Tn)try{return i.querySelector(e.getActiveElement(t))}catch{return null}let n=`#${t}`;return Array.from(i.querySelectorAll('a[href^="#"]')).find(o=>o.getAttribute("href")===n)??null}};F._elements=[],F._active=new Map,F.key="Expressive_ScrollSpy";var fe=F;var Ln={threshold:"100vh"},_l=r=>r.ctrlKey||r.metaKey||r.shiftKey||r.altKey,$t=class extends b{constructor(t,e){super(t,e);this._observer=null;this._sentinel=null;this._temporary=null;this._blur=null;this._above=!0;this._onIntersect=t=>{let e=t[t.length-1];e&&(this._above=e.isIntersecting||e.boundingClientRect.top>=0,this._update())};this._update=()=>{this.el.toggleAttribute("inert",this._above&&!this.el.matches(":focus"))};this._onClick=t=>{if(t.defaultPrevented||_l(t))return;t.preventDefault(),this._focus(this._target());let e=this.el.ownerDocument.defaultView,i=e.matchMedia("(prefers-reduced-motion: reduce)").matches;e.scrollTo({top:0,behavior:i?"instant":"smooth"})};this._clearTabindex=()=>{this._blur?.abort(),this._temporary?.removeAttribute("tabindex"),this._temporary=this._blur=null};this.el.setAttribute("inert",""),this._sentinel=this.el.ownerDocument.createElement("span"),this._sentinel.setAttribute("aria-hidden","true"),this._sentinel.style.cssText="position:absolute;inset-inline-start:0;height:0;pointer-events:none;visibility:hidden",this._setThreshold(this.options.threshold),this.el.ownerDocument.body.prepend(this._sentinel),this._observer=new IntersectionObserver(this._onIntersect),this._observer.observe(this._sentinel);let{signal:i}=this._events;this.el.addEventListener("click",this._onClick,{signal:i}),this.el.addEventListener("blur",this._update,{signal:i})}static get defaults(){return Ln}destroy(){this._observer?.disconnect(),this._observer=null,this._sentinel?.remove(),this._sentinel=null,this._clearTabindex(),this.el.removeAttribute("inert"),super.destroy()}_setThreshold(t){this._sentinel.style.top=t,!this._sentinel.style.top&&(console.warn(`BackToTop ignored threshold "${t}": expected a CSS length.`,this.el),this._sentinel.style.top=Ln.threshold)}_target(){let t=/^#(.+)/.exec(String(this.el.getAttribute("href")));return t&&u.getElementById(this.el,t[1])||this.el.ownerDocument.body}_focus(t){t.focus({preventScroll:!0}),!this._focused(t)&&(this._clearTabindex(),t.setAttribute("tabindex","-1"),t.focus({preventScroll:!0}),this._temporary=t,this._blur=R(t),t.addEventListener("blur",this._clearTabindex,{once:!0,signal:this._blur.signal}))}_focused(t){return t===t.ownerDocument.body?t.hasAttribute("tabindex"):t.getRootNode().activeElement===t}};$t.key="Expressive_BackToTop";function gl(r){let s=new Map;r.forEach(o=>{s.has(o.value)||s.set(o.value,o)});let t=o=>s.get(o.dataset.parent||void 0),e=o=>{let a=t(o);for(let l=0;a&&a!==o&&l<r.length;l++)a=t(a);return a===o},i=new Map(r.map(o=>[o,{option:o,children:[]}])),n=[];return r.forEach(o=>{let a=e(o)?void 0:t(o);(a?i.get(a).children:n).push(i.get(o))}),n}var vl={ArrowUp:-1,ArrowDown:1},_i=(r,s,t)=>r._focusRow(u.focusTarget(r._visibleRows(),t,vl)),wn=(r,s)=>r._activate(s),bl={ArrowDown:_i,ArrowUp:_i,Home:_i,End:_i,ArrowRight:(r,s)=>r._openOrEnter(s),ArrowLeft:(r,s)=>r._closeOrLeave(s),"*":(r,s)=>r._openSiblings(s),Enter:wn," ":wn},El=(r,s,t)=>r._typeahead(s,t.key),yl={ArrowLeft:"ArrowRight",ArrowRight:"ArrowLeft"},qt=class extends z{constructor(t,e){super(t,e);this._typed="";this._handleTreeKeydown=u.ignoringComposition(t=>{let e=u.eventTarget(t)?.closest('li[role="treeitem"]'),i=e&&this._keyFor(t);i&&(t.preventDefault(),t.stopPropagation(),i(this,e,t))});this._handleTreeClick=t=>{let e=u.eventTarget(t);if(!this.tree.contains(e))return;let i=e.closest('li[role="treeitem"] > span');t.preventDefault(),t.stopPropagation(),i&&this._activate(i.parentElement)};if(!this.menuEl)return;let{signal:i}=this._events;this._searchInput||(this.menuEl.setAttribute("role","presentation"),this.input.setAttribute("aria-haspopup","tree"),this.input.setAttribute("aria-controls",this.tree.id)),this.menuEl.removeAttribute("aria-multiselectable"),this._nameTree(),this._leaveImplicitBranch(),this._handleSelectChange(),this._searchInput||this.menuEl.addEventListener("keydown",this._handleTreeKeydown,{signal:i,capture:!0}),this.menuEl.addEventListener("click",this._handleTreeClick,{signal:i,capture:!0})}_setValueToInput(){this.isMultiple&&this._branches.forEach(t=>{t.selected=!1}),super._setValueToInput()}_canSearch(){return this.options.searchable}_searchList(){return this.tree}_searchRows(){return this._enabledRows()}_filterSearch(t){let e=this._matchingRows(t);this.tree.querySelectorAll('li[role="treeitem"]').forEach(i=>{i.hidden=!e.has(i)}),this._searchExpansion(t)}_matchingRows(t){let e=new Set;return this._values.filter(({el:i})=>i.textContent.trim().toLowerCase().includes(t)).forEach(({optionEl:i})=>{for(let n=i;n;n=this._parentRow(n))e.add(n)}),e}_searchExpansion(t){if(t){this._searchOpen??(this._searchOpen=this._openValues()),this._branches.forEach((i,n)=>{n.hidden||this._setExpanded(n,!0)});return}let e=this._searchOpen;this._searchOpen=void 0,e&&this._branches.forEach((i,n)=>this._setExpanded(n,e.has(i.value)))}_searchNavigate(t){t.target===this._searchInput?super._searchNavigate(t):this._handleTreeKeydown(t)}destroy(){clearTimeout(this._typedTimer),this._restoreBranches(),super.destroy()}refresh(){let t=this._focusedOption();this._keepOpen=this._searchOpen??this._openValues(),super.refresh(),this._keepOpen=void 0,this._restoreOpenFocus(t)}_restoreOpenFocus(t){t&&this.menu?.isOpen&&this._restoreFocus(t)}_focusedOption(){let t=this.menuEl?.getRootNode();return this._optionOf(t?.activeElement?.closest('li[role="treeitem"]'))}_openValues(){return new Set(Array.from(this._branches??[],([t,e])=>t.ariaExpanded==="true"?e.value:null))}_restoreFocus(t){let e=this._rowOf(t);this._expandTo(e);let i=this._enabledRows(),n=i.includes(e)?e:i[0];n?this._focusRow(n):(this._searchInput??this.input).focus()}_nameTree(){let{input:t}=this;t.hasAttribute("aria-labelledby")?this.tree.setAttribute("aria-labelledby",t.getAttribute("aria-labelledby")):t.ariaLabel?this.tree.ariaLabel=t.ariaLabel:this._labelTree()}_labelTree(){let t=Array.from(this.input.labels??[],(e,i)=>e.id||(e.id=`${this.input.id}-label-${i}`));t.length&&this.tree.setAttribute("aria-labelledby",t.join(" "))}_setupOptionHandlers(){}_buildOptions(){this._restoreBranches(),this._branches=new Map,this.selectOptions=this._nativeOptions(),this._values=[];let t=this.selectOptions.filter(e=>e.tagName==="OPTION");this.tree||(this.tree=document.createElement("ul"),this.tree.id="select-tree-"+u.guid(),this.tree.setAttribute("role","tree")),this.tree.ariaMultiSelectable=String(this.isMultiple),this.tree.replaceChildren(...gl(t).map(e=>this._row(e))),this.menuEl.append(this.tree)}_leaveImplicitBranch(){if(this.isMultiple||!this._browserPickedBranch())return;let t=Array.from(this.el.options).find(e=>!e.disabled);t?t.selected=!0:this.el.selectedIndex=-1}_browserPickedBranch(){let t=this.el.selectedOptions[0];return!!t&&!t.defaultSelected&&this._disabledBranches.has(t)}_row(t){let e=document.createElement("li");e.id="select-option-"+u.guid(),e.setAttribute("role","treeitem"),e.tabIndex=-1;let i=document.createElement("span");return i.textContent=t.option.textContent,e.append(i),t.children.length?this._branch(e,t):this._leaf(e,t.option),e}_branch(t,e){let i=document.createElement("ul");i.setAttribute("role","group"),i.append(...e.children.map(n=>this._row(n))),t.append(i),this._setExpanded(t,!!this._keepOpen?.has(e.option.value)),this._branches.set(t,e.option),!e.option.disabled&&(e.option.disabled=!0,this._disabledBranches.add(e.option))}_leaf(t,e){(this.el.matches(":disabled")||e.disabled)&&(t.classList.add("disabled"),t.ariaDisabled="true"),this._values.push({el:e,optionEl:t})}_restoreBranches(){this._disabledBranches?.forEach(t=>{t.disabled=!1}),this._disabledBranches=new Set}_setExpanded(t,e){t.ariaExpanded=String(e),t.querySelector(":scope > ul").hidden=!e}_visibleRows(){return Array.from(this.tree.querySelectorAll('li[role="treeitem"]')).filter(t=>!t.closest("[hidden]"))}_enabledRows(){return this._visibleRows().filter(t=>!t.matches(".disabled"))}_focusRow(t){t?.focus({preventScroll:!0}),t?.scrollIntoView({block:"nearest",inline:"nearest"})}_focusSelected(){if(!this.menu.options.autoFocus||u.focusIsIn(this.menuEl))return;let t=this._values.find(({el:e,optionEl:i})=>e.selected&&!i.matches(".disabled"));this._restoreFocus(t?.el)}_expandTo(t){for(let e=this._parentRow(t);e;e=this._parentRow(e))this._setExpanded(e,!0)}_parentRow(t){let e=t?.parentElement.closest('li[role="treeitem"]');return this._branches.has(e)?e:null}_optionOf(t){return this._branches?.get(t)??this._values?.find(({optionEl:e})=>e===t)?.el}_rowOf(t){return Array.from(this._branches).find(([,i])=>i===t)?.[0]??this._values.find(({el:i})=>i===t)?.optionEl}_activate(t){t.closest("[hidden]")||(this._branches.has(t)?this._toggle(t,t.ariaExpanded!=="true"):this._selectOptionElement(t))}_openOrEnter(t){this._branches.has(t)&&(t.ariaExpanded!=="true"?this._toggle(t,!0):this._focusRow(t.querySelector(":scope > ul > li:not(.disabled, [hidden])")))}_closeOrLeave(t){t.ariaExpanded==="true"?this._toggle(t,!1):this._focusRow(this._parentRow(t))}_openSiblings(t){Array.from(t.parentElement.children).forEach(e=>{this._branches.has(e)&&!e.hasAttribute("hidden")&&this._toggle(e,!0)})}_typeahead(t,e){clearTimeout(this._typedTimer),this._typed+=e.toLowerCase(),this._typedTimer=setTimeout(()=>{this._typed=""},1e3);let i=this._enabledRows(),n=i.indexOf(t)+(this._typed.length===1?1:0),o=[...i.slice(n),...i.slice(0,n)].find(a=>a.firstChild.textContent.trim().toLowerCase().startsWith(this._typed));this._focusRow(o)}_toggle(t,e){this._setExpanded(t,e),this.menu?.isOpen&&this.menu.recalculateDimensions()}_keyFor(t){if(u.plainKey(t))return bl[this._logicalKey(t.key)]??(t.key.length===1?El:void 0)}_logicalKey(t){return getComputedStyle(this.tree).direction==="rtl"&&yl[t]||t}};qt.key="Expressive_TreeSelect";var Tl={onOpenStart:null,onOpenEnd:null,onCloseStart:null,onCloseEnd:null},Ll="(width < 600px)",xn=200;function Mn(r){let s=r.activeElement;for(;s?.shadowRoot?.activeElement;)s=s.shadowRoot.activeElement;return s}var zt=class extends b{constructor(t,e){super(t,e);this._hoverPanel=null;this.expand=()=>{this.isExpanded||this._notify("open",this.options.onOpenStart,{current:()=>!this.isExpanded})&&(this.isExpanded=!0,this.el.classList.add("expanded"),this._sync(),this._notify("opened",this.options.onOpenEnd,{current:()=>this.isExpanded}))};this.collapse=()=>{this.isExpanded&&this._notify("close",this.options.onCloseStart,{current:()=>this.isExpanded})&&(this.isExpanded=!1,this.el.classList.remove("expanded"),this._sync(),this._notify("closed",this.options.onCloseEnd,{current:()=>!this.isExpanded}))};this.toggle=()=>{this.isExpanded?this.collapse():this.expand()};this._onPointerOver=t=>{if(t.pointerType!=="mouse")return;clearTimeout(this._hoverTimer);let e=t.target,i=this._panelAt(e);i?i!==this._hoverPanel&&(this._hoverTimer=setTimeout(()=>this._hoverOpen(e),xn)):this._hoverClose(e)};this._onPointerLeave=t=>{t.pointerType==="mouse"&&(clearTimeout(this._hoverTimer),this._hoverClose())};this._onClick=t=>{let e=t.target;if(!(!(e instanceof Node)||this._pinPanel(t))){if(this._toggle?.contains(e)){this.toggle(),t.preventDefault();return}this._isScrimClick(t)&&this.isExpanded&&this._isModal()&&this.collapse()}};this._onKeyDown=t=>{if(!(t.key!=="Escape"||t.defaultPrevented||this._escapePanel(t))&&this.isExpanded&&this._isModal()){let e=this.el.getRootNode(),i=this.el.contains(e.activeElement),n=Mn(e);this.collapse(),!this.isExpanded&&i&&Mn(e)===n&&this._toggle?.focus()}};this._toggle=this._findToggle(),this._mql=window.matchMedia(Ll),this.isExpanded=this.el.classList.contains("expanded"),this._sync();let{signal:i}=this._events;this.el.addEventListener("click",this._onClick,{signal:i}),this.el.addEventListener("pointerover",this._onPointerOver,{signal:i}),this.el.addEventListener("pointerleave",this._onPointerLeave,{signal:i}),document.addEventListener("keydown",this._onKeyDown,{signal:i})}static get defaults(){return Tl}destroy(){clearTimeout(this._hoverTimer),super.destroy()}_findToggle(){let t=this.el.querySelector(":scope > button:not(.button, [popovertarget])");return t instanceof HTMLButtonElement?t:null}_isCompact(){return this._mql.matches}_isModal(){return this.el.classList.contains("modal")||this._isCompact()}_sync(){this.el.setAttribute("aria-expanded",this.isExpanded?"true":"false"),this._toggle?.setAttribute("aria-expanded",this.isExpanded?"true":"false")}_panelAt(t){let i=(t instanceof Element?t.closest("button[popovertarget]:enabled"):null)?.popoverTargetElement;return i?.classList.contains("navigation-rail-panel")?i:null}_hoverOpen(t){let e=this._panelAt(t);!e||e.matches(":popover-open")||(e.showPopover.call(e,{source:t.closest("button[popovertarget]")}),this._hoverPanel=e)}_hoverClose(t=null){let e=this._hoverPanel;!e||e.contains(t)||(this._hoverTimer=setTimeout(()=>{let i=this.el.getRootNode();e.matches(":popover-open")&&!e.contains(i.activeElement)&&e.hidePopover(),this._hoverPanel===e&&(this._hoverPanel=null)},xn))}_pinPanel(t){let e=this._panelAt(t.target);return e?(clearTimeout(this._hoverTimer),e===this._hoverPanel&&e.matches(":popover-open")&&t.preventDefault(),this._hoverPanel=null,!0):!1}_escapePanel(t){clearTimeout(this._hoverTimer),this._hoverPanel=null;let e=Array.from(this.el.querySelectorAll(".navigation-rail-panel")).find(o=>o.matches(":popover-open"));if(!e)return!1;if(e.querySelector(":popover-open"))return!0;let i=this.el.getRootNode(),n=e.contains(i.activeElement);return e.hidePopover(),n&&e.previousElementSibling?.focus(),t.preventDefault(),!0}_isScrimClick(t){if(t.target!==this.el)return!1;let{left:e,right:i}=this.el.getBoundingClientRect();return t.clientX<e||t.clientX>i}};zt.key="Expressive_NavigationRail";var wl={ltr:{ArrowLeft:-1,ArrowRight:1},rtl:{ArrowLeft:1,ArrowRight:-1}},xl={duration:null,onShow:null,swipeable:!1,responsiveThreshold:1/0},Cn=()=>window.matchMedia("(prefers-reduced-motion: reduce)").matches?"instant":"smooth",kn=r=>r.matches('.disabled, [aria-disabled="true"]'),An=r=>r.checkVisibility?.()??!0,Sn=r=>!kn(r)&&An(r),Kt=class Kt extends b{constructor(t,e){var i;super(t,e);this._panels=[];this._scrollTarget=null;this._trackObserver=null;this._trackWidth=-1;this._originalPanels=new Map;this._originalLinks=new Map;this._tablist=!1;this._barTabindex=null;this._stripObserver=null;this._handleKeydown=t=>{let e=wl[getComputedStyle(this.el).direction==="rtl"?"rtl":"ltr"],i=u.focusTarget(Array.from(this._tabLinks).filter(An),t,e,!0);i&&(t.preventDefault(),i.focus(),this._followFocus(i))};this._handleTabClick=t=>{let e=t.target;if(!e)return;let i=e.closest("a");if(!i||!Array.from(this._tabLinks).includes(i))return;if(i.classList.contains("disabled")||i.getAttribute("aria-disabled")==="true"){t.preventDefault();return}i.hasAttribute("target")||(t.preventDefault(),this._select(i))};this._releaseScrollTarget=()=>{clearTimeout(this._scrollTimer),this._scrollTarget=null};this._handleTrackScroll=()=>{if(this._scrollTarget!==null){this._trackAt(this._scrollTarget)?this._releaseScrollTarget():this._waitForScroll();return}let t=this._panels[this._trackIndex()];!t||t===this._content||this._showPanel(Array.from(this._tabLinks).find(e=>this._panelFor(e)===t))};if(this._tabLinks=this._queryTabLinks(),!this._tabLinks.length){console.error("Tabs: no tab links (an <a> child) to show");return}this._setupTablist(),this._tabLinks.forEach(n=>{this._originalLinks.set(n,{active:n.classList.contains("active"),current:n.getAttribute("aria-current"),selected:n.getAttribute("aria-selected"),tabindex:n.getAttribute("tabindex")});let o=this._panelFor(n);o&&this._originalPanels.set(o,{display:o.style.display,priority:o.style.getPropertyPriority("display"),active:o.classList.contains("active"),inert:o.inert})}),(i=this.options).swipeable&&(i.swipeable=window.innerWidth<=this.options.responsiveThreshold&&this._originalPanels.size>0),this._index=0,this._setupActiveTabLink(),this.options.swipeable?this._setupSwipeableTabs():this._setupNormalTabs(),this._setTabsAndTabWidth(),this._createIndicator(),this._setupEventHandlers(),document.fonts?.ready.then(()=>{this.el.Expressive_Tabs===this&&this._remeasure()})}_setupTablist(){this._tablist=this.el.getAttribute("role")==="tablist",this._barTabindex=this.el.getAttribute("tabindex"),this._tablist&&(this.el.tabIndex=-1),this._stripObserver=new ResizeObserver(()=>{this._tablist&&this._refreshTabStop(),this._remeasure()}),this._stripObserver.observe(this.el),this._tabLinks.forEach(t=>this._stripObserver.observe(t))}static get defaults(){return xl}destroy(){this._stripObserver?.disconnect(),this._stripObserver=null,this._indicator?.remove(),this._track&&this._teardownSwipeableTabs(),this._originalPanels.forEach((t,e)=>{e.style.setProperty("display",t.display,t.priority),e.classList.toggle("active",t.active),e.inert=t.inert,e.className||e.removeAttribute("class")}),this._originalLinks.forEach((t,e)=>{e.classList.toggle("active",t.active),x(e,"aria-current",t.current),x(e,"aria-selected",t.selected),x(e,"tabindex",t.tabindex)}),x(this.el,"tabindex",this._barTabindex),super.destroy()}get index(){return this._index}_setupEventHandlers(){this.el.addEventListener("click",this._handleTabClick,{signal:this._events.signal}),this.el.addEventListener("keydown",this._handleKeydown,{signal:this._events.signal})}_followFocus(t){this._tablist&&t!==this._activeTabLink&&Kt.getInstance(this.el)===this&&this._select(t)}_remeasure(){this._setTabsAndTabWidth(),this._tabWidth!==0&&this._tabsWidth!==0&&this._positionIndicator()}_queryTabLinks(){return this.el.querySelectorAll(":scope > a")}_select(t){this.options.swipeable?this._clickSwipeable(t):this._clickTab(t)}_clickSwipeable(t){this._panels.includes(this._panelFor(t))&&(t!==this._activeTabLink&&!this._showPanel(t)||this._scrollToActivePanel(Cn()))}_clickTab(t){let e=this._content;this._tabLinks=this._queryTabLinks();let i=this._index;this._setActiveTabLink(t),!(this._content&&!this._swapPanels(e))&&(this._setTabsAndTabWidth(),this._animateIndicator(i))}_swapPanels(t){return this._content.style.display="",this._content.classList.add("active"),t&&t!==this._content&&(t.style.display="none",t.classList.remove("active")),this._notifyShow()}_createIndicator(){let t=document.createElement("span");t.classList.add("indicator"),this.el.appendChild(t),this._indicator=t,this._positionIndicator()}_positionIndicator(){let t=this._calcLeftPos(this._activeTabLink),e=this._calcRightPos(this._activeTabLink);this._indicator.style.left=t+"px",this._indicator.style.right=e+"px"}_panelFor(t){return!t.hash||t.hasAttribute("target")?null:u.getElementById(this.el,Kt._decodeHash(t.hash))}static _decodeHash(t){try{return decodeURIComponent(t.slice(1))}catch{return t.slice(1)}}_setActiveTabLink(t,e=Cn()){let i=this._tabStop(t);Array.from(this._tabLinks).forEach(n=>this._mark(n,n===t,n===i)),this._activeTabLink=t,this._index=Array.from(this._tabLinks).indexOf(t),this._content=this._panelFor(t),this._reveal(t,e)}_mark(t,e,i){t.classList.toggle("active",e),this._tablist?(t.setAttribute("aria-selected",String(e)),t.tabIndex=i?0:-1):e?t.setAttribute("aria-current","page"):t.removeAttribute("aria-current")}_tabStop(t){if(Sn(t))return t;let e=Array.from(this._tabLinks);return e.find(Sn)??e.find(i=>!kn(i))??t}_refreshTabStop(){let t=this._tabStop(this._activeTabLink);this._tabLinks.forEach(e=>e.tabIndex=e===t?0:-1)}_reveal(t,e){let i=this.el.getBoundingClientRect(),n=t.getBoundingClientRect(),o=Math.min(0,n.left-i.left)||Math.max(0,n.right-i.right);o&&this.el.scrollBy({left:o,behavior:e})}_setupActiveTabLink(){let t=location.hash&&Kt._decodeHash(location.hash);this._activeTabLink=Array.from(this._tabLinks).find(e=>t&&Kt._decodeHash(e.getAttribute("href")??"")===t)??this.el.querySelector("a.active")??this._tabStop(this._tabLinks[0]),this._setActiveTabLink(this._activeTabLink,"instant"),this._originalPanels.forEach((e,i)=>i.classList.toggle("active",i===this._content))}_setupSwipeableTabs(){this._panels=[...new Set(Array.from(this._tabLinks,i=>this._panelFor(i)).filter(Boolean))];let t=document.createElement("div");t.classList.add("tabs-content"),this._panels[0].before(t),this._panels.forEach(i=>{let n=document.createComment("");i.before(n),this._originalPanels.get(i).marker=n,t.appendChild(i),i.style.display=""}),this._track=t,this._syncPanels();let e={passive:!0,signal:this._events.signal};t.addEventListener("scroll",this._handleTrackScroll,e),t.addEventListener("pointerdown",this._releaseScrollTarget,e),t.addEventListener("wheel",this._releaseScrollTarget,e),this._trackObserver=new ResizeObserver(()=>{t.clientWidth!==this._trackWidth&&(this._trackWidth=t.clientWidth,this._scrollToActivePanel("instant"))}),this._trackObserver.observe(t),this._scrollToActivePanel("instant")}_teardownSwipeableTabs(){let t=this._track;this._trackObserver?.disconnect(),this._trackObserver=null,this._releaseScrollTarget(),this._originalPanels.forEach((e,i)=>e.marker?.replaceWith(i)),t.remove(),this._track=void 0}_syncPanels(){this._panels.forEach(t=>{t.classList.toggle("active",t===this._content),t.inert=t!==this._content})}_trackIndex(){return Math.round(Math.abs(this._track.scrollLeft)/(this._track.clientWidth||1))}_trackAt(t){return Math.abs(this._panels[t].getBoundingClientRect().left-this._track.getBoundingClientRect().left)<1}_scrollToActivePanel(t){let e=this._panels.indexOf(this._content);if(e<0||this._trackAt(e))return;let n=(getComputedStyle(this._track).direction==="rtl"?-1:1)*e*this._track.clientWidth;this._scrollTarget=e,this._waitForScroll(),this._track.scrollTo({left:n,behavior:t})}_waitForScroll(){clearTimeout(this._scrollTimer),this._scrollTimer=setTimeout(()=>{this._releaseScrollTarget(),this._scrollToActivePanel("instant")},500)}_showPanel(t){let e=this._index;return this._setActiveTabLink(t),this._syncPanels(),this._setTabsAndTabWidth(),this._animateIndicator(e),this._notifyShow()}_notifyShow(){let t=this._content;return this._notify("change",this.options.onShow,{args:[t],detail:{panel:t},current:()=>this._content===t})}_setupNormalTabs(){Array.from(this._tabLinks).forEach(t=>{if(t===this._activeTabLink)return;let e=this._panelFor(t);e&&(e.style.display="none")})}_setTabsAndTabWidth(){this._tabsWidth=this.el.getBoundingClientRect().width,this._tabWidth=Math.max(this._tabsWidth,this.el.scrollWidth)/this._tabLinks.length}_calcRightPos(t){return Math.ceil(this._tabsWidth-t.offsetLeft-t.getBoundingClientRect().width)}_calcLeftPos(t){return Math.floor(t.offsetLeft)}updateTabIndicator(){this._setTabsAndTabWidth(),this._animateIndicator(this._index)}_animateIndicator(t){let e=this.options.duration,i=e==null?["var(--md-comp-tabs-indicator-duration) var(--md-comp-tabs-indicator-easing)","calc(var(--md-comp-tabs-indicator-duration) * 0.3)"]:[`${e}ms ease-out`,`${e*.3}ms`],[n,o]=this._index-t>=0?[i[1],"0s"]:["0s",i[1]];this._indicator.style.transition=`left ${i[0]} ${n}, right ${i[0]} ${o}`,this._positionIndicator()}select(t){let e=Array.from(this._tabLinks).find(i=>i.getAttribute("href")==="#"+t);e&&e.click()}};Kt.key="Expressive_Tabs";var _e=Kt;var Ml=["hours","minutes","seconds"],Hn={ArrowUp:1,ArrowDown:-1,PageUp:5,PageDown:-5},Rn=(r,s)=>r%12+(s?12:0),In={hours:[3600,24],minutes:[60,60],seconds:[1,60]},Cl=(r,s)=>{let t=r%12+(s?0:12);return t%12?t:12-t},On=24*3600-1,nt=r=>String(r).padStart(2,"0");function Dn(r,s){let t=r.trim().toUpperCase();if(t.split(":")[0]==="NOW"){let l=new Date(+new Date+s);return[l.getHours(),l.getMinutes(),l.getSeconds()]}let e=/AM|PM/.exec(t)?.[0],i=t.replace(/AM|PM/,"").split(":"),[n,o,a]=[0,1,2].map(l=>+i[l]||0);return[e?Rn(n,e==="PM"):n,o,a]}var Pn=([r,s,t])=>r*3600+s*60+t;function Sl(r){let s=u.locale(r);if(!s)return{};let t=new Intl.DateTimeFormat(s,{hour:"numeric"}).resolvedOptions().hourCycle;return{twelveHour:t==="h11"||t==="h12"}}var kl={dialRadius:135,outerRadius:105,innerRadius:70,tickRadius:20,duration:350,container:null,defaultTime:"now",fromNow:0,showClearBtn:!1,autoSubmit:!0,i18n:{cancel:"Cancel",clear:"Clear",done:"Ok",hours:"Hours",minutes:"Minutes",seconds:"Seconds"},twelveHour:!0,showSeconds:!1,minTime:null,maxTime:null,vibrate:!0,onSelect:null,onInputInteraction:null,onDone:null,onCancel:null,displayPlugin:null,displayPluginOptions:null},Fe=class Fe extends b{constructor(t,e){var i;super(t,{...Sl(t),...e});this._dragPointerId=null;this._drag=null;this._clockBuilt=!1;this._handRefused=!1;this._limits=[0,On];this._handleInputClick=()=>{this._updateTimeFromInput(),this._ensureClockBuilt(),this.displayPlugin&&this.displayPlugin.show(),this.inputHours.focus(),typeof this.options.onInputInteraction=="function"&&this.options.onInputInteraction.call(this)};this._handleInputKeydown=u.ignoringComposition(t=>{t.key==="Enter"&&(t.preventDefault(),this._handleInputClick())});this._handleClockClickStart=t=>{if(!t.isPrimary||t.pointerType==="mouse"&&t.button!==0)return;t.preventDefault(),this._ensureClockBuilt();let e=this.plate.getBoundingClientRect(),i={x:e.left,y:e.top};this.x0=i.x+this.options.dialRadius,this.y0=i.y+this.options.dialRadius,this.moved=!1,this._dragPointerId=t.pointerId,this.dx=t.clientX-this.x0,this.dy=t.clientY-this.y0,this.setHand(this.dx,this.dy,!1),this._drag?.abort(),this._drag=R(this.el);let{signal:n}=this._drag;document.addEventListener("pointermove",this._handleDocumentClickMove,{signal:n}),document.addEventListener("pointerup",this._handleDocumentClickEnd,{signal:n}),document.addEventListener("pointercancel",this._handleDocumentClickCancel,{signal:n})};this._handleDocumentClickMove=t=>{if(t.pointerId!==this._dragPointerId)return;t.preventDefault();let e=t.clientX-this.x0,i=t.clientY-this.y0;this.moved=!0,this.setHand(e,i,!1)};this._handleDocumentClickEnd=t=>{if(t.pointerId!==this._dragPointerId)return;this._dragPointerId=null,t.preventDefault(),this._drag.abort();let e=t.clientX-this.x0,i=t.clientY-this.y0;this.moved&&e===this.dx&&i===this.dy&&this.setHand(e,i),this._handRefused||this._chooseHand()};this._handleDocumentClickCancel=t=>{t.pointerId===this._dragPointerId&&(this._dragPointerId=null,this.moved=!1,this._drag.abort())};this._handleAmPmClick=t=>{this._handleAmPmInteraction(t.target)};this._handleAmPmInteraction=t=>{this.amOrPm=t.classList.contains("am-btn")?"AM":"PM",this._updateAmPmView(),this._afterChange(),this.resetClock(null)};this.showView=(t,e=null)=>{this._ensureClockBuilt();let i=t==="hours",n=i?this.hoursView:this.minutesView,o=i?this.minutesView:this.hoursView;this.currentView=t,o.classList.add("timepicker-dial-out"),n.style.visibility="visible",n.classList.remove("timepicker-dial-out"),this.resetClock(e),clearTimeout(this.toggleViewTimer),this.toggleViewTimer=setTimeout(()=>{o.style.visibility="hidden"},this.options.duration)};this._handleDigitalKeydown=u.ignoringComposition(t=>{if(t.key in Hn)return this._step(t);t.key==="Enter"&&(t.preventDefault(),this._formatFields(),this.options.autoSubmit?this.done():this.confirm())});this._inputFromTextField=t=>{let e=t.target,i=this._unitOf(e);if(!i)return;i!=="seconds"&&this._cancelClockReset();let n=this._fieldValue(i,e.value);Number.isNaN(n)||(this[i]=n,this._afterChange(e),this._moveHand(i,n))};this.done=(t=null)=>{let e=this.el.value,i=t?"":this._clockTime(this.hours);this.time=i,t||(i=this._inputValue(i)),this.el.value=i,i!==e&&this.el.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0,composed:!0}))};this.confirm=()=>{this.done(),de(this.displayPlugin),this._notify("confirm",this.options.onDone,{args:[]})};this.cancel=()=>{de(this.displayPlugin),this._notify("cancel",this.options.onCancel,{args:[]})};this.clear=()=>{this.done(!0)};(i=this.options).autoSubmit&&(i.autoSubmit=this.options.displayPlugin!=="modal"),this.id=u.guid(),this._readLimits(),this._insertHTMLIntoDOM(),this._setupVariables(),this._setupEventHandlers(),this._pickerSetup(),this.displayPlugin=ui(this.options.displayPlugin,this.el,this.containerEl,this.options.displayPluginOptions,this.cancel)}static get defaults(){return kl}destroy(){clearTimeout(this._autoSubmitTimer),clearTimeout(this.toggleViewTimer),clearTimeout(this.vibrateTimer),this._cancelClockReset(),this._drag?.abort(),this.displayPlugin?.destroy(),this.containerEl.remove(),super.destroy()}_setupEventHandlers(){let{signal:t}=this._events;this.el.addEventListener("click",this._handleInputClick,{signal:t}),this.el.addEventListener("keydown",this._handleInputKeydown,{signal:t}),this.plate.addEventListener("pointerdown",this._handleClockClickStart),this.digitalClock.addEventListener("input",this._inputFromTextField,{signal:t}),this.digitalClock.addEventListener("keydown",this._handleDigitalKeydown,{signal:t}),this.inputHours.addEventListener("focus",()=>this.showView("hours")),this.inputHours.addEventListener("focusout",()=>this.formatHours()),this.inputMinutes.addEventListener("focus",()=>this.showView("minutes")),this.inputMinutes.addEventListener("focusout",()=>this.formatMinutes()),this.inputSeconds?.addEventListener("focusout",()=>this.formatSeconds())}_chooseHand(){this.currentView==="hours"?(this.inputMinutes.focus(),this.showView("minutes",this.options.duration/2)):(clearTimeout(this._autoSubmitTimer),this._autoSubmitTimer=setTimeout(()=>{this._autoSubmitTimer=null,this.options.autoSubmit&&this.done()},this.options.duration/2));let{hours:t,minutes:e}=this;this._notify("select",this.options.onSelect,{args:[t,e],detail:{hours:t,minutes:e},current:()=>this.hours===t&&this.minutes===e})}_readLimits(){let{minTime:t,maxTime:e,showSeconds:i,fromNow:n}=this.options,o=(c,h)=>c?Pn(Dn(c,n)):h,[a,l]=[o(t,0),o(e,On)];if(i||([a,l]=[Math.ceil(a/60)*60,Math.floor(l/60)*60+59]),a>l)return console.warn("Timepicker ignored minTime and maxTime: minTime is after maxTime.",this.el);this._limits=[a,l]}_insertHTMLIntoDOM(){let t=document.createElement("template");t.innerHTML=Fe._template.trim(),this.containerEl=t.content.firstChild,this.containerEl.id="container-"+this.id;let e=this.options.container,i=e instanceof HTMLElement?e:document.querySelector(e);this.options.container&&i?i.append(this.containerEl):this.el.parentElement.appendChild(this.containerEl)}_setupVariables(){this.currentView="hours",this.canVibrate=typeof navigator.vibrate=="function",this._canvas=this.containerEl.querySelector(".timepicker-canvas"),this.plate=this.containerEl.querySelector(".timepicker-plate"),this.digitalClock=this.containerEl.querySelector(".timepicker-display-column"),this.hoursView=this.containerEl.querySelector(".timepicker-hours"),this.minutesView=this.containerEl.querySelector(".timepicker-minutes"),this.inputHours=this.containerEl.querySelector(".timepicker-input-hours"),this.inputMinutes=this.containerEl.querySelector(".timepicker-input-minutes"),this.inputSeconds=this.containerEl.querySelector(".timepicker-input-seconds"),this.options.showSeconds||this._removeSecondsField();for(let t of this._units()){let[e,i]=this._bounds(t),n={role:"spinbutton","aria-valuemin":e,"aria-valuemax":i,"aria-label":this.options.i18n[t]};Object.entries(n).forEach(([o,a])=>this._input(t).setAttribute(o,String(a)))}this.spanAmPm=this.containerEl.querySelector(".timepicker-span-am-pm"),this.footer=this.containerEl.querySelector(".timepicker-footer"),this.amOrPm="PM"}_removeSecondsField(){this.containerEl.querySelectorAll(".timepicker-seconds-divider, .timepicker-input-seconds-wrapper").forEach(t=>t.remove()),this.inputSeconds=null}_input(t){return{hours:this.inputHours,minutes:this.inputMinutes,seconds:this.inputSeconds}[t]}_units(){return Ml.filter(t=>this._input(t))}_unitOf(t){return this._units().find(e=>this._input(e)===t)}_pickerSetup(){Be(this.footer,this.options,"timepicker-clear",this.clear,this.confirm,this.cancel),this._updateTimeFromInput(),this.options.displayPlugin||this.showView("hours")}_ensureClockBuilt(){this._clockBuilt||(this._clockBuilt=!0,this._clockSetup(),this._updateAmPmView(),this._updateRanges())}_clockSetup(){this.options.twelveHour&&(this._amBtn=document.createElement("button"),this._amBtn.type="button",this._amBtn.classList.add("am-btn"),this._amBtn.innerText="AM",this._amBtn.addEventListener("click",this._handleAmPmClick),this.spanAmPm.appendChild(this._amBtn),this._pmBtn=document.createElement("button"),this._pmBtn.type="button",this._pmBtn.classList.add("pm-btn"),this._pmBtn.innerText="PM",this._pmBtn.addEventListener("click",this._handleAmPmClick),this.spanAmPm.appendChild(this._pmBtn)),this._buildHoursView(),this._buildMinutesView(),this._buildSVGClock()}_buildSVGClock(){let t=this.options.dialRadius,e=this.options.tickRadius,i=t*2;this.plate.style.width=this.plate.style.height=i+"px";let n=M("svg",{class:"timepicker-svg",width:String(i),height:String(i)}),o=M("g",{transform:`translate(${t},${t})`}),a=M("circle",{class:"timepicker-canvas-bearing",cx:"0",cy:"0",r:"4"}),l=M("line",{x1:"0",y1:"0"}),c=M("circle",{class:"timepicker-canvas-bg",r:String(e)});o.appendChild(l),o.appendChild(c),o.appendChild(a),n.appendChild(o),this._canvas.appendChild(n),this.hand=l,this.bg=c,this.g=o}_buildHoursView(){if(this.options.twelveHour)for(let t=1;t<13;t+=1){let e=t/6*Math.PI,i=this.options.outerRadius;this._buildHoursTick(t,e,i)}else for(let t=0;t<24;t+=1){let e=t/6*Math.PI,n=t>0&&t<13?this.options.innerRadius:this.options.outerRadius;this._buildHoursTick(t,e,n)}}_buildHoursTick(t,e,i){this._placeTick(this.hoursView,e,i,t===0?"00":t.toString())}_buildMinutesView(){for(let t=0;t<60;t+=5){let e=t/30*Math.PI;this._placeTick(this.minutesView,e,this.options.outerRadius,nt(t))}}_placeTick(t,e,i,n){let o=document.createElement("div");o.classList.add("timepicker-tick"),o.style.left=this.options.dialRadius+Math.sin(e)*i-this.options.tickRadius+"px",o.style.top=this.options.dialRadius-Math.cos(e)*i-this.options.tickRadius+"px",o.textContent=n,t.appendChild(o)}_updateAmPmView(){!this._amBtn||!this._pmBtn||(this._amBtn.setAttribute("aria-pressed",String(this.amOrPm==="AM")),this._pmBtn.setAttribute("aria-pressed",String(this.amOrPm==="PM")),this._amBtn.classList.toggle("outlined",this.amOrPm!=="AM"),this._pmBtn.classList.toggle("outlined",this.amOrPm!=="PM"),this.options.twelveHour&&(this.amOrPm==="PM"?(this._amBtn.classList.remove("filled"),this._pmBtn.classList.add("filled")):this.amOrPm==="AM"&&(this._amBtn.classList.add("filled"),this._pmBtn.classList.remove("filled"))))}_updateTimeFromInput(){this._cancelClockReset();let[t,e,i]=Dn(`${this.el.value||this.options.defaultTime||""}`,this.options.fromNow);[this.minutes,this.seconds]=[e,i],this._setHours24(t),this._clamp(),this._writeFields(),this._updateAmPmView(),this._updateRanges()}_writeFields(t){this._units().forEach(e=>{this._input(e)!==t&&(this._input(e).value=nt(this[e]))})}_afterChange(t){this._clamp()&&this._writeFields(t),this._updateRanges()}_updateRanges(){for(let i of this._units()){let[n,o]=this._range(i);this._input(i).setAttribute("aria-valuemin",String(n)),this._input(i).setAttribute("aria-valuemax",String(o))}let[t,e]=this._dayRange("hours");this._amBtn&&([this._amBtn.disabled,this._pmBtn.disabled]=[t>11,e<12]),this._disableTicks(this.hoursView,"hours"),this._disableTicks(this.minutesView,"minutes")}_disableTicks(t,e){t.querySelectorAll(".timepicker-tick").forEach(i=>{i.classList.toggle("is-disabled",!this._allows(e,Number(i.textContent)))})}_setHours24(t){if(!this.options.twelveHour)return void(this.hours=t);this.amOrPm=t>=12?"PM":"AM",this.hours=t%12||12,this._updateAmPmView()}_time(){return Pn([this._dayValue("hours",this.hours),this.minutes,this.seconds])}_clamp(){let t=this._time(),e=Math.min(Math.max(t,this._limits[0]),this._limits[1]);return e===t?!1:(this._setHours24(Math.floor(e/3600)),[this.minutes,this.seconds]=[Math.floor(e/60)%60,e%60],!0)}_cancelClockReset(){clearTimeout(this._clockResetTimer),this._clockResetTimer=null,this._canvas?.classList.remove("timepicker-canvas-out")}resetClock(t){this._cancelClockReset();let e=this.currentView,i=this[e],n=e==="hours",o=Math.PI/(n?6:30),a=i*o,l=n&&i>0&&i<13?this.options.innerRadius:this.options.outerRadius,c=Math.sin(a)*l,h=-Math.cos(a)*l;t?(this._canvas?.classList.add("timepicker-canvas-out"),this._clockResetTimer=setTimeout(()=>{this.setHand(c,h)},t)):this.setHand(c,h)}_bounds(t){return t!=="hours"?[0,59]:this.options.twelveHour?[1,12]:[0,23]}_range(t){let[e,i]=this._bounds(t),n=Array.from({length:i-e+1},(o,a)=>e+a).filter(o=>this._allows(t,o));return n.length?[Math.min(...n),Math.max(...n)]:[e,i]}_dayRange(t){let[e,i]=In[t],n=this._time()-this._time()%(e*i);return this._limits.map(o=>Math.min(Math.max(Math.floor((o-n)/e),0),i-1))}_dayValue(t,e){return t==="hours"&&this.options.twelveHour?Rn(e,this.amOrPm==="PM"):e}_allows(t,e){let[i,n]=this._dayRange(t),o=this._dayValue(t,e);return Math.min(Math.max(o,i),n)===o}_fieldValue(t,e){let i=Number(e.trim()||NaN);return this._takes(t,i)?i:NaN}_takes(t,e){let[i,n]=this._bounds(t);return Number.isInteger(e)&&Math.min(Math.max(e,i),n)===e&&this._allows(t,e)}_moveHand(t,e){t!=="seconds"&&(this._cancelClockReset(),this.drawClockFromTimeInput(e,t==="hours"))}_step(t){let e=t.target,i=this._unitOf(e);if(!i)return;t.preventDefault();let n=this._stepValue(i,Hn[t.key]);i==="hours"?this._setHours24(n):this[i]=n,this._afterChange(),e.value=nt(this[i]),this._moveHand(i,this[i])}_stepValue(t,e){let[i,n]=this._dayRange(t),o=In[t][1],a=this._dayValue(t,this[t])+e;return i===0&&n===o-1?(a+o)%o:Math.min(Math.max(a,i),n)}drawClockFromTimeInput(t,e){let i=Math.PI/(e?6:30),n=t*i,o;this.options.twelveHour?o=this.options.outerRadius:o=e&&t>0&&t<13?this.options.innerRadius:this.options.outerRadius,this.setClockAttributes(n,o)}setHand(t,e,i=!1){this._cancelClockReset();let n=this.currentView==="hours",o=Math.PI/(n||i?6:30),a=Math.sqrt(t*t+e*e),l=n&&a<(this.options.outerRadius+this.options.innerRadius)/2,c=l&&!this.options.twelveHour?this.options.innerRadius:this.options.outerRadius,h=Math.atan2(t,-e);h<0&&(h=Math.PI*2+h);let d=Math.round(h/o);h=d*o;let p=n?this._hourAt(d,l):(i?d*5:d)%60;this._handRefused=!this._allows(this.currentView,p),!this._handRefused&&(this[this.currentView]!==p&&this.canVibrate&&this.options.vibrate&&!this.vibrateTimer&&(navigator.vibrate(10),this.vibrateTimer=setTimeout(()=>{this.vibrateTimer=null},100)),this[this.currentView]=p,(n?this.inputHours:this.inputMinutes).value=nt(p),this.setClockAttributes(h,c),this._afterChange())}_hourAt(t,e){return this.options.twelveHour?t%12||12:Cl(t,e)}setClockAttributes(t,e){if(!this.hand||!this.bg)return;let i=Math.sin(t)*(e-this.options.tickRadius),n=-Math.cos(t)*(e-this.options.tickRadius),o=Math.sin(t)*e,a=-Math.cos(t)*e;this.hand.setAttribute("x2",i.toString()),this.hand.setAttribute("y2",n.toString()),this.bg.setAttribute("cx",o.toString()),this.bg.setAttribute("cy",a.toString())}formatHours(){this.inputHours.value==""&&this.setHoursDefault(),this.inputHours.value=nt(this.hours)}formatMinutes(){this.inputMinutes.value==""&&(this.minutes=new Date().getMinutes()),this.inputMinutes.value=nt(this.minutes)}formatSeconds(){this.inputSeconds.value==""&&(this.seconds=new Date().getSeconds()),this.inputSeconds.value=nt(this.seconds)}_formatFields(){this.formatHours(),this.formatMinutes(),this.inputSeconds&&this.formatSeconds()}setHoursDefault(){this.hours=new Date().getHours(),this.options.twelveHour&&(this.hours=this.hours%12||12),this.inputHours.value=this.hours.toString()}_clockTime(t){return(this.inputSeconds?[t,this.minutes,this.seconds]:[t,this.minutes]).map(nt).join(":")}_inputValue(t){return this.el.type==="time"?this._clockTime(this._dayValue("hours",this.hours)):this.options.twelveHour?`${t} ${this.amOrPm}`:t}};Fe.key="Expressive_Timepicker",Fe._template=`<div class="timepicker-container">
|
|
26
|
+
`,this.el.style.height=this.originalHeight+"px",this.el.style.width=this.originalWidth+"px",Object.assign(this.el.style,this._restingPlace()),this._schedule(()=>{this._reset(),this._notify("closed",this.options.onCloseEnd,{current:()=>t===this._phase})},e)}_addCaption(){this._photoCaption=document.createElement("div"),this._photoCaption.classList.add("lightbox-caption"),this._photoCaption.innerText=this.caption,u.portalRoot(this.el).append(this._photoCaption),this._photoCaption.style.display="inline",this._showOnTop(this._photoCaption),this._fadeIn(this._photoCaption)}_addOverlay(){this._overlay=document.createElement("div"),this._overlay.id="lightbox-overlay",this._overlay.addEventListener("click",t=>{t.stopPropagation(),this.close()},{once:!0}),this.el.before(this._overlay),this._showOnTop(this._overlay),this._fadeIn(this._overlay)}_fadeIn(t){t.style.transition="none",t.style.opacity="0";let e=this._motion.matches?0:this.options.inDuration;this._schedule(()=>{t.style.transition=`opacity ${e}ms ease`,t.style.opacity="1"},1)}_fadeOut(t){let e=this._motion.matches?0:this.options.outDuration;t.style.transition=`opacity ${e}ms ease`,t.style.opacity="0"}};Vt.key="Expressive_Lightbox";var Dn=r=>`a[href="#${r}"]`,Kl={scrollOffset:200,activeClass:"active",getActiveElement:Dn,keepTopElementActive:!1},F=class F extends b{constructor(t,e){super(t,e);this._ratio=0;this._link=null;this._offset=this.el.style.getPropertyValue("--md-comp-scrollspy-offset"),this._offsetPriority=this.el.style.getPropertyPriority("--md-comp-scrollspy-offset"),this.el.style.setProperty("--md-comp-scrollspy-offset",`${this.options.scrollOffset}px`),F._elements.push(this),this._observer=new IntersectionObserver(i=>{if(F.getInstance(this.el)===this){for(let n of i)this._ratio=n.isIntersecting?n.intersectionRatio:0;F._syncActive(this.options.getActiveElement)}},{rootMargin:`-${this.options.scrollOffset}px 0px -45% 0px`,threshold:[0,.1,.25,.5,.75,1]}),this._observer.observe(this.el)}static get defaults(){return Kl}destroy(){let t=F._elements.indexOf(this);if(t<0)return;F._elements.splice(t,1),this._observer?.disconnect();let e=this.options.getActiveElement;F._active.get(e)===this&&F._clearActive(e),this.el.style.setProperty("--md-comp-scrollspy-offset",this._offset,this._offsetPriority),super.destroy(),F._syncActive(e)}static _syncActive(t){let e=F._elements.filter(l=>l.options.getActiveElement===t),i=null,n=0;for(let l of e){let c=l._ratio;c>n&&(n=c,i=l)}if(!i){let l=e.filter(c=>c.options.keepTopElementActive);i=F._nearestAbove(l)??l[0]}let o=F._active.get(t);if(i&&o===i&&i._link?.isConnected)return;let a=i?F._linkFor(i.el.id,i.options,i.el.getRootNode()):null;o===i&&o?._link===a||(F._clearActive(t),a&&(a.classList.add(i.options.activeClass),a.setAttribute("aria-current","true"),i._link=a,F._active.set(t,i),i._notify("change",null,{detail:{link:a}})))}static _nearestAbove(t){let e=null,i=-1/0;for(let n of t){let o=n.el.getBoundingClientRect().top;o<=0&&o>=i&&(i=o,e=n)}return e}static _clearActive(t){let e=F._active.get(t);e&&(e._link?.classList.remove(e.options.activeClass),e._link?.removeAttribute("aria-current"),e._link=null,F._active.delete(t))}static _linkFor(t,e,i=document){if(!t)return null;if(e.getActiveElement!==Dn)try{return i.querySelector(e.getActiveElement(t))}catch{return null}let n=`#${t}`;return Array.from(i.querySelectorAll('a[href^="#"]')).find(o=>o.getAttribute("href")===n)??null}};F._elements=[],F._active=new Map,F.key="Expressive_ScrollSpy";var Ee=F;var Pn={threshold:"100vh"},Vl=r=>r.ctrlKey||r.metaKey||r.shiftKey||r.altKey,Wt=class extends b{constructor(t,e){super(t,e);this._observer=null;this._sentinel=null;this._temporary=null;this._blur=null;this._above=!0;this._onIntersect=t=>{let e=t[t.length-1];e&&(this._above=e.isIntersecting||e.boundingClientRect.top>=0,this._update())};this._update=()=>{this.el.toggleAttribute("inert",this._above&&!this.el.matches(":focus"))};this._onClick=t=>{if(t.defaultPrevented||Vl(t))return;t.preventDefault(),this._focus(this._target());let e=this.el.ownerDocument.defaultView,i=e.matchMedia("(prefers-reduced-motion: reduce)").matches;e.scrollTo({top:0,behavior:i?"instant":"smooth"})};this._clearTabindex=()=>{this._blur?.abort(),this._temporary?.removeAttribute("tabindex"),this._temporary=this._blur=null};this.el.setAttribute("inert",""),this._sentinel=this.el.ownerDocument.createElement("span"),this._sentinel.setAttribute("aria-hidden","true"),this._sentinel.style.cssText="position:absolute;inset-inline-start:0;height:0;pointer-events:none;visibility:hidden",this._setThreshold(this.options.threshold),this.el.ownerDocument.body.prepend(this._sentinel),this._observer=new IntersectionObserver(this._onIntersect),this._observer.observe(this._sentinel);let{signal:i}=this._events;this.el.addEventListener("click",this._onClick,{signal:i}),this.el.addEventListener("blur",this._update,{signal:i})}static get defaults(){return Pn}destroy(){this._observer?.disconnect(),this._observer=null,this._sentinel?.remove(),this._sentinel=null,this._clearTabindex(),this.el.removeAttribute("inert"),super.destroy()}_setThreshold(t){this._sentinel.style.top=t,!this._sentinel.style.top&&(console.warn(`BackToTop ignored threshold "${t}": expected a CSS length.`,this.el),this._sentinel.style.top=Pn.threshold)}_target(){let t=/^#(.+)/.exec(String(this.el.getAttribute("href")));return t&&u.getElementById(this.el,t[1])||this.el.ownerDocument.body}_focus(t){t.focus({preventScroll:!0}),!this._focused(t)&&(this._clearTabindex(),t.setAttribute("tabindex","-1"),t.focus({preventScroll:!0}),this._temporary=t,this._blur=R(t),t.addEventListener("blur",this._clearTabindex,{once:!0,signal:this._blur.signal}))}_focused(t){return t===t.ownerDocument.body?t.hasAttribute("tabindex"):t.getRootNode().activeElement===t}};Wt.key="Expressive_BackToTop";function Wl(r){let s=new Map;r.forEach(o=>{s.has(o.value)||s.set(o.value,o)});let t=o=>s.get(o.dataset.parent||void 0),e=o=>{let a=t(o);for(let l=0;a&&a!==o&&l<r.length;l++)a=t(a);return a===o},i=new Map(r.map(o=>[o,{option:o,children:[]}])),n=[];return r.forEach(o=>{let a=e(o)?void 0:t(o);(a?i.get(a).children:n).push(i.get(o))}),n}var Ul={ArrowUp:-1,ArrowDown:1},Mi=(r,s,t)=>r._focusRow(u.focusTarget(r._visibleRows(),t,Ul)),Rn=(r,s)=>r._activate(s),jl={ArrowDown:Mi,ArrowUp:Mi,Home:Mi,End:Mi,ArrowRight:(r,s)=>r._openOrEnter(s),ArrowLeft:(r,s)=>r._closeOrLeave(s),"*":(r,s)=>r._openSiblings(s),Enter:Rn," ":Rn},Yl=(r,s,t)=>r._typeahead(s,t.key),Xl={ArrowLeft:"ArrowRight",ArrowRight:"ArrowLeft"},Ut=class extends K{constructor(t,e){super(t,e);this._typed="";this._handleTreeKeydown=u.ignoringComposition(t=>{let e=u.eventTarget(t)?.closest('li[role="treeitem"]'),i=e&&this._keyFor(t);i&&(t.preventDefault(),t.stopPropagation(),i(this,e,t))});this._handleTreeClick=t=>{let e=u.eventTarget(t);if(!this.tree.contains(e))return;let i=e.closest('li[role="treeitem"] > span');t.preventDefault(),t.stopPropagation(),i&&this._activate(i.parentElement)};if(!this.menuEl)return;let{signal:i}=this._events;this._searchInput||(this.menuEl.setAttribute("role","presentation"),this.input.setAttribute("aria-haspopup","tree"),this.input.setAttribute("aria-controls",this.tree.id)),this.menuEl.removeAttribute("aria-multiselectable"),this._nameTree(),this._leaveImplicitBranch(),this._handleSelectChange(),this._searchInput||this.menuEl.addEventListener("keydown",this._handleTreeKeydown,{signal:i,capture:!0}),this.menuEl.addEventListener("click",this._handleTreeClick,{signal:i,capture:!0})}_setValueToInput(){this.isMultiple&&this._branches.forEach(t=>{t.selected=!1}),super._setValueToInput()}_canSearch(){return this.options.searchable}_searchList(){return this.tree}_searchRows(){return this._enabledRows()}_filterSearch(t){let e=this._matchingRows(t);this.tree.querySelectorAll('li[role="treeitem"]').forEach(i=>{i.hidden=!e.has(i)}),this._searchExpansion(t)}_matchingRows(t){let e=new Set;return this._values.filter(({el:i})=>i.textContent.trim().toLowerCase().includes(t)).forEach(({optionEl:i})=>{for(let n=i;n;n=this._parentRow(n))e.add(n)}),e}_searchExpansion(t){if(t){this._searchOpen??(this._searchOpen=this._openValues()),this._branches.forEach((i,n)=>{n.hidden||this._setExpanded(n,!0)});return}let e=this._searchOpen;this._searchOpen=void 0,e&&this._branches.forEach((i,n)=>this._setExpanded(n,e.has(i.value)))}_searchNavigate(t){t.target===this._searchInput?super._searchNavigate(t):this._handleTreeKeydown(t)}destroy(){clearTimeout(this._typedTimer),this._restoreBranches(),super.destroy()}refresh(){let t=this._focusedOption();this._keepOpen=this._searchOpen??this._openValues(),super.refresh(),this._keepOpen=void 0,this._restoreOpenFocus(t)}_restoreOpenFocus(t){t&&this.menu?.isOpen&&this._restoreFocus(t)}_focusedOption(){let t=this.menuEl?.getRootNode();return this._optionOf(t?.activeElement?.closest('li[role="treeitem"]'))}_openValues(){return new Set(Array.from(this._branches??[],([t,e])=>t.ariaExpanded==="true"?e.value:null))}_restoreFocus(t){let e=this._rowOf(t);this._expandTo(e);let i=this._enabledRows(),n=i.includes(e)?e:i[0];n?this._focusRow(n):(this._searchInput??this.input).focus()}_nameTree(){let{input:t}=this;t.hasAttribute("aria-labelledby")?this.tree.setAttribute("aria-labelledby",t.getAttribute("aria-labelledby")):t.ariaLabel?this.tree.ariaLabel=t.ariaLabel:this._labelTree()}_labelTree(){let t=Array.from(this.input.labels??[],(e,i)=>e.id||(e.id=`${this.input.id}-label-${i}`));t.length&&this.tree.setAttribute("aria-labelledby",t.join(" "))}_setupOptionHandlers(){}_buildOptions(){this._restoreBranches(),this._branches=new Map,this.selectOptions=this._nativeOptions(),this._values=[];let t=this.selectOptions.filter(e=>e.tagName==="OPTION");this.tree||(this.tree=document.createElement("ul"),this.tree.id="select-tree-"+u.guid(),this.tree.setAttribute("role","tree")),this.tree.ariaMultiSelectable=String(this.isMultiple),this.tree.replaceChildren(...Wl(t).map(e=>this._row(e))),this.menuEl.append(this.tree)}_leaveImplicitBranch(){if(this.isMultiple||!this._browserPickedBranch())return;let t=Array.from(this.el.options).find(e=>!e.disabled);t?t.selected=!0:this.el.selectedIndex=-1}_browserPickedBranch(){let t=this.el.selectedOptions[0];return!!t&&!t.defaultSelected&&this._disabledBranches.has(t)}_row(t){let e=document.createElement("li");e.id="select-option-"+u.guid(),e.setAttribute("role","treeitem"),e.tabIndex=-1;let i=document.createElement("span");return i.textContent=t.option.textContent,e.append(i),t.children.length?this._branch(e,t):this._leaf(e,t.option),e}_branch(t,e){let i=document.createElement("ul");i.setAttribute("role","group"),i.append(...e.children.map(n=>this._row(n))),t.append(i),this._setExpanded(t,!!this._keepOpen?.has(e.option.value)),this._branches.set(t,e.option),!e.option.disabled&&(e.option.disabled=!0,this._disabledBranches.add(e.option))}_leaf(t,e){(this.el.matches(":disabled")||e.disabled)&&(t.classList.add("disabled"),t.ariaDisabled="true"),this._values.push({el:e,optionEl:t})}_restoreBranches(){this._disabledBranches?.forEach(t=>{t.disabled=!1}),this._disabledBranches=new Set}_setExpanded(t,e){t.ariaExpanded=String(e),t.querySelector(":scope > ul").hidden=!e}_visibleRows(){return Array.from(this.tree.querySelectorAll('li[role="treeitem"]')).filter(t=>!t.closest("[hidden]"))}_enabledRows(){return this._visibleRows().filter(t=>!t.matches(".disabled"))}_focusRow(t){t?.focus({preventScroll:!0}),t?.scrollIntoView({block:"nearest",inline:"nearest"})}_focusSelected(){if(!this.menu.options.autoFocus||u.focusIsIn(this.menuEl))return;let t=this._values.find(({el:e,optionEl:i})=>e.selected&&!i.matches(".disabled"));this._restoreFocus(t?.el)}_expandTo(t){for(let e=this._parentRow(t);e;e=this._parentRow(e))this._setExpanded(e,!0)}_parentRow(t){let e=t?.parentElement.closest('li[role="treeitem"]');return this._branches.has(e)?e:null}_optionOf(t){return this._branches?.get(t)??this._values?.find(({optionEl:e})=>e===t)?.el}_rowOf(t){return Array.from(this._branches).find(([,i])=>i===t)?.[0]??this._values.find(({el:i})=>i===t)?.optionEl}_activate(t){t.closest("[hidden]")||(this._branches.has(t)?this._toggle(t,t.ariaExpanded!=="true"):this._selectOptionElement(t))}_openOrEnter(t){this._branches.has(t)&&(t.ariaExpanded!=="true"?this._toggle(t,!0):this._focusRow(t.querySelector(":scope > ul > li:not(.disabled, [hidden])")))}_closeOrLeave(t){t.ariaExpanded==="true"?this._toggle(t,!1):this._focusRow(this._parentRow(t))}_openSiblings(t){Array.from(t.parentElement.children).forEach(e=>{this._branches.has(e)&&!e.hasAttribute("hidden")&&this._toggle(e,!0)})}_typeahead(t,e){clearTimeout(this._typedTimer),this._typed+=e.toLowerCase(),this._typedTimer=setTimeout(()=>{this._typed=""},1e3);let i=this._enabledRows(),n=i.indexOf(t)+(this._typed.length===1?1:0),o=[...i.slice(n),...i.slice(0,n)].find(a=>a.firstChild.textContent.trim().toLowerCase().startsWith(this._typed));this._focusRow(o)}_toggle(t,e){this._setExpanded(t,e),this.menu?.isOpen&&this.menu.recalculateDimensions()}_keyFor(t){if(u.plainKey(t))return jl[this._logicalKey(t.key)]??(t.key.length===1?Yl:void 0)}_logicalKey(t){return getComputedStyle(this.tree).direction==="rtl"&&Xl[t]||t}};Ut.key="Expressive_TreeSelect";var Gl={onOpenStart:null,onOpenEnd:null,onCloseStart:null,onCloseEnd:null},Zl="(width < 600px)",Fn=200,jt=class extends b{constructor(t,e){super(t,e);this._hoverPanel=null;this.expand=()=>{this.isExpanded||this._notify("open",this.options.onOpenStart,{current:()=>!this.isExpanded})&&(this.isExpanded=!0,this.el.classList.add("expanded"),this._sync(),this._notify("opened",this.options.onOpenEnd,{current:()=>this.isExpanded}))};this.collapse=()=>{this.isExpanded&&this._notify("close",this.options.onCloseStart,{current:()=>this.isExpanded})&&(this.isExpanded=!1,this.el.classList.remove("expanded"),this._sync(),this._notify("closed",this.options.onCloseEnd,{current:()=>!this.isExpanded}))};this.toggle=()=>{this.isExpanded?this.collapse():this.expand()};this._onPointerOver=t=>{if(t.pointerType!=="mouse")return;clearTimeout(this._hoverTimer);let e=t.target,i=this._panelAt(e);i?i!==this._hoverPanel&&(this._hoverTimer=setTimeout(()=>this._hoverOpen(e),Fn)):this._hoverClose(e)};this._onPointerLeave=t=>{t.pointerType==="mouse"&&(clearTimeout(this._hoverTimer),this._hoverClose())};this._onClick=t=>{let e=t.target;if(!(!(e instanceof Node)||this._pinPanel(t))){if(this._toggle?.contains(e)){this.toggle(),t.preventDefault();return}this._isScrimClick(t)&&this.isExpanded&&this._isModal()&&this.collapse()}};this._onKeyDown=t=>{if(!(t.key!=="Escape"||t.defaultPrevented||this._escapePanel(t))&&this.isExpanded&&this._isModal()){let e=this.el.getRootNode(),i=this.el.contains(e.activeElement),n=dt(e);this.collapse(),!this.isExpanded&&i&&dt(e)===n&&this._toggle?.focus()}};this._toggle=this._findToggle(),this._mql=window.matchMedia(Zl),this.isExpanded=this.el.classList.contains("expanded"),this._sync();let{signal:i}=this._events;this.el.addEventListener("click",this._onClick,{signal:i}),this.el.addEventListener("pointerover",this._onPointerOver,{signal:i}),this.el.addEventListener("pointerleave",this._onPointerLeave,{signal:i}),document.addEventListener("keydown",this._onKeyDown,{signal:i})}static get defaults(){return Gl}destroy(){clearTimeout(this._hoverTimer),super.destroy()}_findToggle(){let t=this.el.querySelector(":scope > button:not(.button, [popovertarget])");return t instanceof HTMLButtonElement?t:null}_isCompact(){return this._mql.matches}_isModal(){return this.el.classList.contains("modal")||this._isCompact()}_sync(){this.el.setAttribute("aria-expanded",this.isExpanded?"true":"false"),this._toggle?.setAttribute("aria-expanded",this.isExpanded?"true":"false")}_panelAt(t){let i=(t instanceof Element?t.closest("button[popovertarget]:enabled"):null)?.popoverTargetElement;return i?.classList.contains("navigation-rail-panel")?i:null}_hoverOpen(t){let e=this._panelAt(t);!e||e.matches(":popover-open")||(e.showPopover.call(e,{source:t.closest("button[popovertarget]")}),this._hoverPanel=e)}_hoverClose(t=null){let e=this._hoverPanel;!e||e.contains(t)||(this._hoverTimer=setTimeout(()=>{let i=this.el.getRootNode();e.matches(":popover-open")&&!e.contains(i.activeElement)&&e.hidePopover(),this._hoverPanel===e&&(this._hoverPanel=null)},Fn))}_pinPanel(t){let e=this._panelAt(t.target);return e?(clearTimeout(this._hoverTimer),e===this._hoverPanel&&e.matches(":popover-open")&&t.preventDefault(),this._hoverPanel=null,!0):!1}_escapePanel(t){clearTimeout(this._hoverTimer),this._hoverPanel=null;let e=Array.from(this.el.querySelectorAll(".navigation-rail-panel")).find(o=>o.matches(":popover-open"));if(!e)return!1;if(e.querySelector(":popover-open"))return!0;let i=this.el.getRootNode(),n=e.contains(i.activeElement);return e.hidePopover(),n&&e.previousElementSibling?.focus(),t.preventDefault(),!0}_isScrimClick(t){if(t.target!==this.el)return!1;let{left:e,right:i}=this.el.getBoundingClientRect();return t.clientX<e||t.clientX>i}};jt.key="Expressive_NavigationRail";var Ql={ltr:{ArrowLeft:-1,ArrowRight:1},rtl:{ArrowLeft:1,ArrowRight:-1}},Jl={duration:null,onShow:null,swipeable:!1,responsiveThreshold:1/0},Nn=()=>window.matchMedia("(prefers-reduced-motion: reduce)").matches?"instant":"smooth",$n=r=>r.matches('.disabled, [aria-disabled="true"]'),qn=r=>r.checkVisibility?.()??!0,Bn=r=>!$n(r)&&qn(r),ct=class ct extends b{constructor(t,e){var i;super(t,e);this._panels=[];this._scrollTarget=null;this._trackObserver=null;this._trackWidth=-1;this._originalPanels=new Map;this._originalLinks=new Map;this._tablist=!1;this._barTabindex=null;this._stripObserver=null;this._handleKeydown=t=>{let e=Ql[getComputedStyle(this.el).direction==="rtl"?"rtl":"ltr"],i=u.focusTarget(Array.from(this._tabLinks).filter(qn),t,e,!0);i&&(t.preventDefault(),i.focus(),this._followFocus(i))};this._handleTabClick=t=>{let e=t.target;if(!e)return;let i=e.closest("a");if(!i||!Array.from(this._tabLinks).includes(i))return;if(i.classList.contains("disabled")||i.getAttribute("aria-disabled")==="true"){t.preventDefault();return}i.hasAttribute("target")||(t.preventDefault(),this._select(i))};this._releaseScrollTarget=()=>{clearTimeout(this._scrollTimer),this._scrollTarget=null};this._handleTrackScroll=()=>{if(this._scrollTarget!==null){this._trackAt(this._scrollTarget)?this._releaseScrollTarget():this._waitForScroll();return}let t=this._panels[this._trackIndex()];!t||t===this._content||this._showPanel(Array.from(this._tabLinks).find(e=>this._panelFor(e)===t))};if(this._tabLinks=this._queryTabLinks(),!this._tabLinks.length){console.error("Tabs: no tab links (an <a> child) to show");return}this._setupTablist(),this._tabLinks.forEach(n=>{this._originalLinks.set(n,{active:n.classList.contains("active"),current:n.getAttribute("aria-current"),selected:n.getAttribute("aria-selected"),tabindex:n.getAttribute("tabindex")});let o=this._panelFor(n);o&&this._originalPanels.set(o,{display:o.style.display,priority:o.style.getPropertyPriority("display"),active:o.classList.contains("active"),inert:o.inert})}),(i=this.options).swipeable&&(i.swipeable=window.innerWidth<=this.options.responsiveThreshold&&this._originalPanels.size>0),this._index=0,this._setupActiveTabLink(),this.options.swipeable?this._setupSwipeableTabs():this._setupNormalTabs(),this._setTabsAndTabWidth(),this._createIndicator(),this._setupEventHandlers(),document.fonts?.ready.then(()=>{ct.getInstance(this.el)===this&&this._remeasure()})}_setupTablist(){this._tablist=this.el.getAttribute("role")==="tablist",this._barTabindex=this.el.getAttribute("tabindex"),this._tablist&&(this.el.tabIndex=-1),this._stripObserver=new ResizeObserver(()=>{this._tablist&&this._refreshTabStop(),this._remeasure()}),this._stripObserver.observe(this.el),this._tabLinks.forEach(t=>this._stripObserver.observe(t))}static get defaults(){return Jl}destroy(){this._stripObserver?.disconnect(),this._stripObserver=null,this._indicator?.remove(),this._track&&this._teardownSwipeableTabs(),this._originalPanels.forEach((t,e)=>{e.style.setProperty("display",t.display,t.priority),e.classList.toggle("active",t.active),e.inert=t.inert,e.className||e.removeAttribute("class")}),this._originalLinks.forEach((t,e)=>{e.classList.toggle("active",t.active),w(e,"aria-current",t.current),w(e,"aria-selected",t.selected),w(e,"tabindex",t.tabindex)}),w(this.el,"tabindex",this._barTabindex),super.destroy()}get index(){return this._index}_setupEventHandlers(){this.el.addEventListener("click",this._handleTabClick,{signal:this._events.signal}),this.el.addEventListener("keydown",this._handleKeydown,{signal:this._events.signal})}_followFocus(t){this._tablist&&t!==this._activeTabLink&&ct.getInstance(this.el)===this&&this._select(t)}_remeasure(){this._setTabsAndTabWidth(),this._tabWidth!==0&&this._tabsWidth!==0&&this._positionIndicator()}_queryTabLinks(){return this.el.querySelectorAll(":scope > a")}_select(t){this.options.swipeable?this._clickSwipeable(t):this._clickTab(t)}_clickSwipeable(t){this._panels.includes(this._panelFor(t))&&(t!==this._activeTabLink&&!this._showPanel(t)||this._scrollToActivePanel(Nn()))}_clickTab(t){if(t===this._activeTabLink)return;let e=this._content;this._tabLinks=this._queryTabLinks();let i=this._index;this._setActiveTabLink(t),!(this._content&&!this._swapPanels(e))&&(this._setTabsAndTabWidth(),this._animateIndicator(i))}_swapPanels(t){return this._content.style.display="",this._content.classList.add("active"),t&&t!==this._content&&(t.style.display="none",t.classList.remove("active")),this._notifyShow()}_createIndicator(){let t=document.createElement("span");t.classList.add("indicator"),this.el.appendChild(t),this._indicator=t,this._positionIndicator()}_positionIndicator(){let t=this._calcLeftPos(this._activeTabLink),e=this._calcRightPos(this._activeTabLink);this._indicator.style.left=t+"px",this._indicator.style.right=e+"px"}_panelFor(t){return!t.hash||t.hasAttribute("target")?null:u.getElementById(this.el,ct._decodeHash(t.hash))}static _decodeHash(t){try{return decodeURIComponent(t.slice(1))}catch{return t.slice(1)}}_setActiveTabLink(t,e=Nn()){let i=this._tabStop(t);Array.from(this._tabLinks).forEach(n=>this._mark(n,n===t,n===i)),this._activeTabLink=t,this._index=Array.from(this._tabLinks).indexOf(t),this._content=this._panelFor(t),this._reveal(t,e)}_mark(t,e,i){t.classList.toggle("active",e),this._tablist?(t.setAttribute("aria-selected",String(e)),t.tabIndex=i?0:-1):e?t.setAttribute("aria-current","page"):t.removeAttribute("aria-current")}_tabStop(t){if(Bn(t))return t;let e=Array.from(this._tabLinks);return e.find(Bn)??e.find(i=>!$n(i))??t}_refreshTabStop(){let t=this._tabStop(this._activeTabLink);this._tabLinks.forEach(e=>e.tabIndex=e===t?0:-1)}_reveal(t,e){let i=this.el.getBoundingClientRect(),n=t.getBoundingClientRect(),o=Math.min(0,n.left-i.left)||Math.max(0,n.right-i.right);o&&this.el.scrollBy({left:o,behavior:e})}_setupActiveTabLink(){let t=location.hash&&ct._decodeHash(location.hash);this._activeTabLink=Array.from(this._tabLinks).find(e=>t&&ct._decodeHash(e.getAttribute("href")??"")===t)??this.el.querySelector("a.active")??this._tabStop(this._tabLinks[0]),this._setActiveTabLink(this._activeTabLink,"instant"),this._originalPanels.forEach((e,i)=>i.classList.toggle("active",i===this._content))}_setupSwipeableTabs(){this._panels=[...new Set(Array.from(this._tabLinks,i=>this._panelFor(i)).filter(Boolean))];let t=document.createElement("div");t.classList.add("tabs-content"),this._panels[0].before(t),this._panels.forEach(i=>{let n=document.createComment("");i.before(n),this._originalPanels.get(i).marker=n,t.appendChild(i),i.style.display=""}),this._track=t,this._syncPanels();let e={passive:!0,signal:this._events.signal};t.addEventListener("scroll",this._handleTrackScroll,e),t.addEventListener("pointerdown",this._releaseScrollTarget,e),t.addEventListener("wheel",this._releaseScrollTarget,e),this._trackObserver=new ResizeObserver(()=>{t.clientWidth!==this._trackWidth&&(this._trackWidth=t.clientWidth,this._scrollToActivePanel("instant"))}),this._trackObserver.observe(t),this._scrollToActivePanel("instant")}_teardownSwipeableTabs(){let t=this._track;this._trackObserver?.disconnect(),this._trackObserver=null,this._releaseScrollTarget(),this._originalPanels.forEach((e,i)=>e.marker?.replaceWith(i)),t.remove(),this._track=void 0}_syncPanels(){this._panels.forEach(t=>{t.classList.toggle("active",t===this._content),t.inert=t!==this._content})}_trackIndex(){return Math.round(Math.abs(this._track.scrollLeft)/(this._track.clientWidth||1))}_trackAt(t){return Math.abs(this._panels[t].getBoundingClientRect().left-this._track.getBoundingClientRect().left)<1}_scrollToActivePanel(t){let e=this._panels.indexOf(this._content);if(e<0||this._trackAt(e))return;let n=(getComputedStyle(this._track).direction==="rtl"?-1:1)*e*this._track.clientWidth;this._scrollTarget=e,this._waitForScroll(),this._track.scrollTo({left:n,behavior:t})}_waitForScroll(){clearTimeout(this._scrollTimer),this._scrollTimer=setTimeout(()=>{this._releaseScrollTarget(),this._scrollToActivePanel("instant")},500)}_showPanel(t){let e=this._index;return this._setActiveTabLink(t),this._syncPanels(),this._setTabsAndTabWidth(),this._animateIndicator(e),this._notifyShow()}_notifyShow(){let t=this._content;return this._notify("change",this.options.onShow,{args:[t],detail:{panel:t},current:()=>this._content===t})}_setupNormalTabs(){Array.from(this._tabLinks).forEach(t=>{if(t===this._activeTabLink)return;let e=this._panelFor(t);e&&(e.style.display="none")})}_setTabsAndTabWidth(){this._tabsWidth=this.el.getBoundingClientRect().width,this._tabWidth=Math.max(this._tabsWidth,this.el.scrollWidth)/this._tabLinks.length}_calcRightPos(t){return Math.ceil(this._tabsWidth-t.offsetLeft-t.getBoundingClientRect().width)}_calcLeftPos(t){return Math.floor(t.offsetLeft)}updateTabIndicator(){this._setTabsAndTabWidth(),this._animateIndicator(this._index)}_animateIndicator(t){let e=this.options.duration,i=e==null?["var(--md-comp-tabs-indicator-duration) var(--md-comp-tabs-indicator-easing)","calc(var(--md-comp-tabs-indicator-duration) * 0.3)"]:[`${e}ms ease-out`,`${e*.3}ms`],[n,o]=this._index-t>=0?[i[1],"0s"]:["0s",i[1]];this._indicator.style.transition=`left ${i[0]} ${n}, right ${i[0]} ${o}`,this._positionIndicator()}select(t){let e=Array.from(this._tabLinks).find(i=>i.getAttribute("href")==="#"+t);e&&e.click()}};ct.key="Expressive_Tabs";var ye=ct;var tc=["hours","minutes","seconds"],Un={ArrowUp:1,ArrowDown:-1,PageUp:5,PageDown:-5},ec=r=>r.key in Un&&u.plainKey(r),jn=(r,s)=>r%12+(s?12:0),zn={hours:[3600,24],minutes:[60,60],seconds:[1,60]},ic=(r,s)=>{let t=r%12+(s?0:12);return t%12?t:12-t},Kn=24*3600-1,ht=r=>String(r).padStart(2,"0");function Vn(r,s){let t=r.trim().toUpperCase();if(t.split(":")[0]==="NOW"){let l=new Date(+new Date+s);return[l.getHours(),l.getMinutes(),l.getSeconds()]}let e=/AM|PM/.exec(t)?.[0],i=t.replace(/AM|PM/,"").split(":"),[n,o,a]=[0,1,2].map(l=>+i[l]||0);return[e?jn(n,e==="PM"):n,o,a]}var Wn=([r,s,t])=>r*3600+s*60+t;function sc(r){let s=u.locale(r);if(!s)return{};let t=new Intl.DateTimeFormat(s,{hour:"numeric"}).resolvedOptions().hourCycle;return{twelveHour:t==="h11"||t==="h12"}}var nc={dialRadius:135,outerRadius:105,innerRadius:70,tickRadius:20,duration:350,container:null,defaultTime:"now",fromNow:0,showClearBtn:!1,autoSubmit:!0,i18n:{cancel:"Cancel",clear:"Clear",done:"Ok",hours:"Hours",minutes:"Minutes",seconds:"Seconds"},twelveHour:!0,showSeconds:!1,minTime:null,maxTime:null,vibrate:!0,onSelect:null,onInputInteraction:null,onDone:null,onCancel:null,displayPlugin:null,displayPluginOptions:null},qe=class qe extends b{constructor(t,e){var i;super(t,{...sc(t),...e});this._dragPointerId=null;this._drag=null;this._clearPending=!1;this._clockBuilt=!1;this._handRefused=!1;this._limits=[0,Kn];this._handleInputClick=()=>{this._updateTimeFromInput(),this._ensureClockBuilt(),this.displayPlugin&&this.displayPlugin.show(),this.inputHours.focus(),typeof this.options.onInputInteraction=="function"&&this.options.onInputInteraction.call(this)};this._handleInputKeydown=u.ignoringComposition(t=>{t.key==="Enter"&&(t.preventDefault(),this._handleInputClick())});this._handleClockClickStart=t=>{if(!t.isPrimary||t.pointerType==="mouse"&&t.button!==0)return;t.preventDefault(),this._ensureClockBuilt();let e=this.plate.getBoundingClientRect(),i={x:e.left,y:e.top};this.x0=i.x+this.options.dialRadius,this.y0=i.y+this.options.dialRadius,this.moved=!1,this._dragPointerId=t.pointerId,this.dx=t.clientX-this.x0,this.dy=t.clientY-this.y0,this.setHand(this.dx,this.dy,!1),this._drag?.abort(),this._drag=R(this.el);let{signal:n}=this._drag;document.addEventListener("pointermove",this._handleDocumentClickMove,{signal:n}),document.addEventListener("pointerup",this._handleDocumentClickEnd,{signal:n}),document.addEventListener("pointercancel",this._handleDocumentClickCancel,{signal:n})};this._handleDocumentClickMove=t=>{if(t.pointerId!==this._dragPointerId)return;t.preventDefault();let e=t.clientX-this.x0,i=t.clientY-this.y0;this.moved=!0,this.setHand(e,i,!1)};this._handleDocumentClickEnd=t=>{if(t.pointerId!==this._dragPointerId)return;this._dragPointerId=null,t.preventDefault(),this._drag.abort();let e=t.clientX-this.x0,i=t.clientY-this.y0;this.moved&&e===this.dx&&i===this.dy&&this.setHand(e,i),this._handRefused||this._chooseHand()};this._handleDocumentClickCancel=t=>{t.pointerId===this._dragPointerId&&(this._dragPointerId=null,this.moved=!1,this._drag.abort())};this._handleAmPmClick=t=>{this._handleAmPmInteraction(t.target)};this._handleAmPmInteraction=t=>{this.amOrPm=t.classList.contains("am-btn")?"AM":"PM",this._updateAmPmView(),this._afterChange(),this.resetClock(null)};this.showView=(t,e=null)=>{this._ensureClockBuilt();let i=t==="hours",n=i?this.hoursView:this.minutesView,o=i?this.minutesView:this.hoursView;this.currentView=t,o.classList.add("timepicker-dial-out"),n.style.visibility="visible",n.classList.remove("timepicker-dial-out"),this.resetClock(e),clearTimeout(this.toggleViewTimer),this.toggleViewTimer=setTimeout(()=>{o.style.visibility="hidden"},this.options.duration)};this._handleDigitalKeydown=u.ignoringComposition(t=>{if(ec(t))return this._step(t);t.key==="Enter"&&(t.preventDefault(),this._formatFields(),this.options.autoSubmit?this.done():this.confirm())});this._inputFromTextField=t=>{let e=t.target,i=this._unitOf(e);if(!i)return;i!=="seconds"&&this._cancelClockReset();let n=this._fieldValue(i,e.value);Number.isNaN(n)||(this[i]=n,this._afterChange(e),this._moveHand(i,n))};this.done=(t=null)=>{let e=this.el.value,i=t?"":this._clockTime(this.hours);this.time=i,t||(i=this._inputValue(i)),this.el.value=i,i!==e&&this.el.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0,composed:!0}))};this.confirm=()=>{this.done(this._clearPending),this._clearPending=!1,ge(this.displayPlugin),this._notify("confirm",this.options.onDone,{args:[]})};this.cancel=()=>{this._clearPending=!1,ge(this.displayPlugin),this._notify("cancel",this.options.onCancel,{args:[]})};this.clear=()=>{if(this.options.autoSubmit)return this.done(!0);this._clearPending=!0,this._units().forEach(t=>this._input(t).value="")};this._keepTime=t=>{!this._clearPending||this.footer.contains(t.target)||(this._clearPending=!1,this._writeFields(t.type==="keydown"?t.target:void 0))};(i=this.options).autoSubmit&&(i.autoSubmit=this.options.displayPlugin!=="modal"),this.id=u.guid(),this._readLimits(),this._insertHTMLIntoDOM(),this._setupVariables(),this._setupEventHandlers(),this._pickerSetup(),this.displayPlugin=yi(this.options.displayPlugin,this.el,this.containerEl,this.options.displayPluginOptions,this.cancel)}static get defaults(){return nc}destroy(){clearTimeout(this._autoSubmitTimer),clearTimeout(this.toggleViewTimer),clearTimeout(this.vibrateTimer),this._cancelClockReset(),this._drag?.abort(),this.displayPlugin?.destroy(),this.containerEl.remove(),super.destroy()}_setupEventHandlers(){let{signal:t}=this._events;this.el.addEventListener("click",this._handleInputClick,{signal:t}),this.el.addEventListener("keydown",this._handleInputKeydown,{signal:t}),this.plate.addEventListener("pointerdown",this._handleClockClickStart),this.digitalClock.addEventListener("input",this._inputFromTextField,{signal:t}),this.digitalClock.addEventListener("keydown",this._handleDigitalKeydown,{signal:t}),this.containerEl.addEventListener("pointerdown",this._keepTime,{capture:!0,signal:t}),this.containerEl.addEventListener("keydown",this._keepTime,{capture:!0,signal:t}),this.inputHours.addEventListener("focus",()=>this.showView("hours")),this.inputHours.addEventListener("focusout",()=>this.formatHours()),this.inputMinutes.addEventListener("focus",()=>this.showView("minutes")),this.inputMinutes.addEventListener("focusout",()=>this.formatMinutes()),this.inputSeconds?.addEventListener("focusout",()=>this.formatSeconds())}_chooseHand(){this.currentView==="hours"?(this.inputMinutes.focus(),this.showView("minutes",this.options.duration/2)):(clearTimeout(this._autoSubmitTimer),this._autoSubmitTimer=setTimeout(()=>{this._autoSubmitTimer=null,this.options.autoSubmit&&this.done()},this.options.duration/2));let{hours:t,minutes:e}=this;this._notify("select",this.options.onSelect,{args:[t,e],detail:{hours:t,minutes:e},current:()=>this.hours===t&&this.minutes===e})}_readLimits(){let{minTime:t,maxTime:e,showSeconds:i,fromNow:n}=this.options,o=(c,h)=>c?Wn(Vn(c,n)):h,[a,l]=[o(t,0),o(e,Kn)];if(i||([a,l]=[Math.ceil(a/60)*60,Math.floor(l/60)*60+59]),a>l)return console.warn("Timepicker ignored minTime and maxTime: minTime is after maxTime.",this.el);this._limits=[a,l]}_insertHTMLIntoDOM(){let t=document.createElement("template");t.innerHTML=qe._template.trim(),this.containerEl=t.content.firstChild,this.containerEl.id="container-"+this.id;let e=this.options.container,i=typeof e=="string"?u.querySelector(this.el,e):e;i?i.append(this.containerEl):this.el.parentElement.appendChild(this.containerEl)}_setupVariables(){this.currentView="hours",this.canVibrate=typeof navigator.vibrate=="function",this._canvas=this.containerEl.querySelector(".timepicker-canvas"),this.plate=this.containerEl.querySelector(".timepicker-plate"),this.digitalClock=this.containerEl.querySelector(".timepicker-display-column"),this.hoursView=this.containerEl.querySelector(".timepicker-hours"),this.minutesView=this.containerEl.querySelector(".timepicker-minutes"),this.inputHours=this.containerEl.querySelector(".timepicker-input-hours"),this.inputMinutes=this.containerEl.querySelector(".timepicker-input-minutes"),this.inputSeconds=this.containerEl.querySelector(".timepicker-input-seconds"),this.options.showSeconds||this._removeSecondsField();for(let t of this._units()){let[e,i]=this._bounds(t),n={role:"spinbutton","aria-valuemin":e,"aria-valuemax":i,"aria-label":this.options.i18n[t]};Object.entries(n).forEach(([o,a])=>this._input(t).setAttribute(o,String(a)))}this.spanAmPm=this.containerEl.querySelector(".timepicker-span-am-pm"),this.footer=this.containerEl.querySelector(".timepicker-footer"),this.amOrPm="PM"}_removeSecondsField(){this.containerEl.querySelectorAll(".timepicker-seconds-divider, .timepicker-input-seconds-wrapper").forEach(t=>t.remove()),this.inputSeconds=null}_input(t){return{hours:this.inputHours,minutes:this.inputMinutes,seconds:this.inputSeconds}[t]}_units(){return tc.filter(t=>this._input(t))}_unitOf(t){return this._units().find(e=>this._input(e)===t)}_pickerSetup(){We(this.footer,this.options,"timepicker-clear",this.clear,this.confirm,this.cancel),this._updateTimeFromInput(),this.options.displayPlugin||this.showView("hours")}_ensureClockBuilt(){this._clockBuilt||(this._clockBuilt=!0,this._clockSetup(),this._updateAmPmView(),this._updateRanges())}_clockSetup(){this.options.twelveHour&&(this._amBtn=document.createElement("button"),this._amBtn.type="button",this._amBtn.classList.add("am-btn"),this._amBtn.innerText="AM",this._amBtn.addEventListener("click",this._handleAmPmClick),this.spanAmPm.appendChild(this._amBtn),this._pmBtn=document.createElement("button"),this._pmBtn.type="button",this._pmBtn.classList.add("pm-btn"),this._pmBtn.innerText="PM",this._pmBtn.addEventListener("click",this._handleAmPmClick),this.spanAmPm.appendChild(this._pmBtn)),this._buildHoursView(),this._buildMinutesView(),this._buildSVGClock()}_buildSVGClock(){let t=this.options.dialRadius,e=this.options.tickRadius,i=t*2;this.plate.style.width=this.plate.style.height=i+"px";let n=M("svg",{class:"timepicker-svg",width:String(i),height:String(i)}),o=M("g",{transform:`translate(${t},${t})`}),a=M("circle",{class:"timepicker-canvas-bearing",cx:"0",cy:"0",r:"4"}),l=M("line",{x1:"0",y1:"0"}),c=M("circle",{class:"timepicker-canvas-bg",r:String(e)});o.appendChild(l),o.appendChild(c),o.appendChild(a),n.appendChild(o),this._canvas.appendChild(n),this.hand=l,this.bg=c,this.g=o}_buildHoursView(){if(this.options.twelveHour)for(let t=1;t<13;t+=1){let e=t/6*Math.PI,i=this.options.outerRadius;this._buildHoursTick(t,e,i)}else for(let t=0;t<24;t+=1){let e=t/6*Math.PI,n=t>0&&t<13?this.options.innerRadius:this.options.outerRadius;this._buildHoursTick(t,e,n)}}_buildHoursTick(t,e,i){this._placeTick(this.hoursView,e,i,t===0?"00":t.toString())}_buildMinutesView(){for(let t=0;t<60;t+=5){let e=t/30*Math.PI;this._placeTick(this.minutesView,e,this.options.outerRadius,ht(t))}}_placeTick(t,e,i,n){let o=document.createElement("div");o.classList.add("timepicker-tick"),o.style.left=this.options.dialRadius+Math.sin(e)*i-this.options.tickRadius+"px",o.style.top=this.options.dialRadius-Math.cos(e)*i-this.options.tickRadius+"px",o.textContent=n,t.appendChild(o)}_updateAmPmView(){!this._amBtn||!this._pmBtn||(this._amBtn.setAttribute("aria-pressed",String(this.amOrPm==="AM")),this._pmBtn.setAttribute("aria-pressed",String(this.amOrPm==="PM")),this._amBtn.classList.toggle("outlined",this.amOrPm!=="AM"),this._pmBtn.classList.toggle("outlined",this.amOrPm!=="PM"),this.options.twelveHour&&(this.amOrPm==="PM"?(this._amBtn.classList.remove("filled"),this._pmBtn.classList.add("filled")):this.amOrPm==="AM"&&(this._amBtn.classList.add("filled"),this._pmBtn.classList.remove("filled"))))}_updateTimeFromInput(){this._clearPending=!1,this._cancelClockReset();let[t,e,i]=Vn(`${this.el.value||this.options.defaultTime||""}`,this.options.fromNow);[this.minutes,this.seconds]=[e,i],this._setHours24(t),this._clamp(),this._writeFields(),this._updateAmPmView(),this._updateRanges()}_writeFields(t){this._units().forEach(e=>{this._input(e)!==t&&(this._input(e).value=ht(this[e]))})}_afterChange(t){this._clamp()&&this._writeFields(t),this._updateRanges()}_updateRanges(){for(let i of this._units()){let[n,o]=this._range(i);this._input(i).setAttribute("aria-valuemin",String(n)),this._input(i).setAttribute("aria-valuemax",String(o))}let[t,e]=this._dayRange("hours");this._amBtn&&([this._amBtn.disabled,this._pmBtn.disabled]=[t>11,e<12]),this._disableTicks(this.hoursView,"hours"),this._disableTicks(this.minutesView,"minutes")}_disableTicks(t,e){t.querySelectorAll(".timepicker-tick").forEach(i=>{i.classList.toggle("is-disabled",!this._allows(e,Number(i.textContent)))})}_setHours24(t){if(!this.options.twelveHour)return void(this.hours=t);this.amOrPm=t>=12?"PM":"AM",this.hours=t%12||12,this._updateAmPmView()}_time(){return Wn([this._dayValue("hours",this.hours),this.minutes,this.seconds])}_clamp(){let t=this._time(),e=Math.min(Math.max(t,this._limits[0]),this._limits[1]);return e===t?!1:(this._setHours24(Math.floor(e/3600)),[this.minutes,this.seconds]=[Math.floor(e/60)%60,e%60],!0)}_cancelClockReset(){clearTimeout(this._clockResetTimer),this._clockResetTimer=null,this._canvas?.classList.remove("timepicker-canvas-out")}resetClock(t){this._cancelClockReset();let e=this.currentView,i=this[e],n=e==="hours",o=Math.PI/(n?6:30),a=i*o,l=n&&i>0&&i<13?this.options.innerRadius:this.options.outerRadius,c=Math.sin(a)*l,h=-Math.cos(a)*l;t?(this._canvas?.classList.add("timepicker-canvas-out"),this._clockResetTimer=setTimeout(()=>{this.setHand(c,h)},t)):this.setHand(c,h)}_bounds(t){return t!=="hours"?[0,59]:this.options.twelveHour?[1,12]:[0,23]}_range(t){let[e,i]=this._bounds(t),n=Array.from({length:i-e+1},(o,a)=>e+a).filter(o=>this._allows(t,o));return n.length?[Math.min(...n),Math.max(...n)]:[e,i]}_dayRange(t){let[e,i]=zn[t],n=this._time()-this._time()%(e*i);return this._limits.map(o=>Math.min(Math.max(Math.floor((o-n)/e),0),i-1))}_dayValue(t,e){return t==="hours"&&this.options.twelveHour?jn(e,this.amOrPm==="PM"):e}_allows(t,e){let[i,n]=this._dayRange(t),o=this._dayValue(t,e);return Math.min(Math.max(o,i),n)===o}_fieldValue(t,e){let i=Number(e.trim()||NaN);return this._takes(t,i)?i:NaN}_takes(t,e){let[i,n]=this._bounds(t);return Number.isInteger(e)&&Math.min(Math.max(e,i),n)===e&&this._allows(t,e)}_moveHand(t,e){t!=="seconds"&&(this._cancelClockReset(),this.drawClockFromTimeInput(e,t==="hours"))}_step(t){let e=t.target,i=this._unitOf(e);if(!i)return;t.preventDefault();let n=this._stepValue(i,Un[t.key]);i==="hours"?this._setHours24(n):this[i]=n,this._afterChange(),e.value=ht(this[i]),this._moveHand(i,this[i])}_stepValue(t,e){let[i,n]=this._dayRange(t),o=zn[t][1],a=this._dayValue(t,this[t])+e;return i===0&&n===o-1?(a+o)%o:Math.min(Math.max(a,i),n)}drawClockFromTimeInput(t,e){let i=Math.PI/(e?6:30),n=t*i,o;this.options.twelveHour?o=this.options.outerRadius:o=e&&t>0&&t<13?this.options.innerRadius:this.options.outerRadius,this.setClockAttributes(n,o)}setHand(t,e,i=!1){this._cancelClockReset();let n=this.currentView==="hours",o=Math.PI/(n||i?6:30),a=Math.sqrt(t*t+e*e),l=n&&a<(this.options.outerRadius+this.options.innerRadius)/2,c=l&&!this.options.twelveHour?this.options.innerRadius:this.options.outerRadius,h=Math.atan2(t,-e);h<0&&(h=Math.PI*2+h);let d=Math.round(h/o);h=d*o;let p=n?this._hourAt(d,l):(i?d*5:d)%60;this._handRefused=!this._allows(this.currentView,p),!this._handRefused&&(this[this.currentView]!==p&&this.canVibrate&&this.options.vibrate&&!this.vibrateTimer&&(navigator.vibrate(10),this.vibrateTimer=setTimeout(()=>{this.vibrateTimer=null},100)),this[this.currentView]=p,(n?this.inputHours:this.inputMinutes).value=ht(p),this.setClockAttributes(h,c),this._afterChange())}_hourAt(t,e){return this.options.twelveHour?t%12||12:ic(t,e)}setClockAttributes(t,e){if(!this.hand||!this.bg)return;let i=Math.sin(t)*(e-this.options.tickRadius),n=-Math.cos(t)*(e-this.options.tickRadius),o=Math.sin(t)*e,a=-Math.cos(t)*e;this.hand.setAttribute("x2",i.toString()),this.hand.setAttribute("y2",n.toString()),this.bg.setAttribute("cx",o.toString()),this.bg.setAttribute("cy",a.toString())}formatHours(){this.inputHours.value===""&&this.setHoursDefault(),this.inputHours.value=ht(this.hours)}formatMinutes(){this.inputMinutes.value===""&&(this.minutes=new Date().getMinutes(),this._afterChange()),this.inputMinutes.value=ht(this.minutes)}formatSeconds(){this.inputSeconds.value===""&&(this.seconds=new Date().getSeconds(),this._afterChange()),this.inputSeconds.value=ht(this.seconds)}_formatFields(){this.formatHours(),this.formatMinutes(),this.inputSeconds&&this.formatSeconds()}setHoursDefault(){this._setHours24(new Date().getHours()),this._afterChange(),this.inputHours.value=this.hours.toString()}_clockTime(t){return(this.inputSeconds?[t,this.minutes,this.seconds]:[t,this.minutes]).map(ht).join(":")}_inputValue(t){return this.el.type==="time"?this._clockTime(this._dayValue("hours",this.hours)):this.options.twelveHour?`${t} ${this.amOrPm}`:t}};qe.key="Expressive_Timepicker",qe._template=`<div class="timepicker-container">
|
|
27
27
|
<div class="timepicker-digital-display">
|
|
28
28
|
<div class="timepicker-text-container">
|
|
29
29
|
<div class="timepicker-display-column timepicker-display-digital-clock">
|
|
@@ -56,5 +56,5 @@ var Expressive=(()=>{var yi=Object.defineProperty;var jn=Object.getOwnPropertyDe
|
|
|
56
56
|
</div>
|
|
57
57
|
<div class="timepicker-footer"></div>
|
|
58
58
|
</div>
|
|
59
|
-
</div>`;var ge=Fe;var Al=typeof CSS<"u"&&!!CSS.supports?.("anchor-name: --a"),Fn={top:["top","justify-self"],right:["right","align-self"],left:["left","align-self"],bottom:["bottom","justify-self"]},Hl=500,Il=1500,Ol=800,Dl=400,Pl=300,Nn=-1/0,ts=-1/0,Bn=r=>r>=Nn&&r<ts;function Rl(r){let s=Date.now(),t=s+r+Pl;ts=Bn(s)?Math.max(ts,t):t,Nn=s}var Fl={exitDelay:200,enterDelay:0,text:"",margin:4,inDuration:250,outDuration:200,position:"bottom",transitionMovement:10,opacity:1,openOnClick:!1},gi=class gi extends b{constructor(t,e){super(t,e);this._insideClick=null;this._lastTouch=-1/0;this._touchShown=!1;this._swallowClickUntil=-1/0;this._shown=!1;this.open=(t=!0)=>{if(this.isOpen)return;clearTimeout(this._exitDelayTimeout),clearTimeout(this._animationTimeout),this.isOpen=!0;let{signal:e}=this._events;this.el.ownerDocument.addEventListener("keydown",this._handleKeydown,{capture:!0,signal:e}),this.options.openOnClick&&(this._outsideTimeout=setTimeout(()=>this.el.ownerDocument.addEventListener("click",this._handleDocumentClick,{signal:e}))),this.options={...this.options,...this._getAttributeOptions()},this._updateTooltipContent(),this._setEnterDelayTimeout(t)};this.close=()=>{clearTimeout(this._pressTimeout),clearTimeout(this._lingerTimeout),this._touchShown=!1,this.isOpen&&(this._shown&&Rl(this.options.exitDelay),this.isHovered=!1,this.isFocused=!1,this.isOpen=!1,this.el.ownerDocument.removeEventListener("keydown",this._handleKeydown,!0),clearTimeout(this._outsideTimeout),this.el.ownerDocument.removeEventListener("click",this._handleDocumentClick),clearTimeout(this._enterDelayTimeout),this._setExitDelayTimeout())};this._handleMouseEnter=()=>{this.options.openOnClick||performance.now()-this._lastTouch<Ol||(this._touchShown=!1,this.isHovered=!0,this.open(!1))};this._handlePointerEnter=t=>{this._touched(t)};this._handlePointerDown=t=>{this._longPress(t)&&(clearTimeout(this._lingerTimeout),clearTimeout(this._pressTimeout),this._pressTimeout=setTimeout(()=>{this.isHovered=!0,this._showNow(),this._touchShown=!0},Hl))};this._handlePointerEnd=t=>{this._longPress(t)&&(clearTimeout(this._pressTimeout),this._touchShown&&(this._swallowClickUntil=performance.now()+Dl),this.isOpen&&(this.isHovered=!1,this._lingerTimeout=setTimeout(()=>this.isHovered||this.isFocused||this.close(),Il)))};this._handleClick=t=>{if(this.options.openOnClick)return this._toggle(t);performance.now()>this._swallowClickUntil||(this._swallowClickUntil=-1/0,t.preventDefault(),t.stopImmediatePropagation())};this._handleTooltipClick=t=>{this._insideClick=t};this._handleDocumentClick=t=>{t!==this._insideClick&&this._hideNow()};this._handlePointerCancel=t=>{this._longPress(t)&&(clearTimeout(this._pressTimeout),this._touchShown&&(this.isHovered=!1,this.isFocused||this.close()))};this._handleMouseLeave=t=>{this.options.openOnClick||this._holds(t.relatedTarget)||(this.isHovered=!1,this.isFocused||this.close())};this._handleKeydown=t=>{t.key!=="Escape"||!this.isOpen||(u.focusIsIn(this.el,this.tooltipEl)&&(t.preventDefault(),t.stopPropagation()),this._hideNow())};this._handleFocus=t=>{!this.options.openOnClick&&t.target.matches(":focus-visible")&&(this.isFocused=!0,this.open(!1))};this._handleBlur=t=>{let e=t.relatedTarget;if(!this._holds(e)){if(this.options.openOnClick)return this._blurClickTooltip(e);this.isFocused=!1,this.isHovered||this.close()}};this.options={...gi.defaults,...this._getAttributeOptions(),...e},this.isOpen=!1,this.isHovered=!1,this.isFocused=!1,this._appendTooltipEl(),this._setupEventHandlers()}static get defaults(){return Fl}destroy(){clearTimeout(this._enterDelayTimeout),clearTimeout(this._exitDelayTimeout),clearTimeout(this._animationTimeout),clearTimeout(this._pressTimeout),clearTimeout(this._lingerTimeout),clearTimeout(this._outsideTimeout),this.isOpen=!1,this.isHovered=!1,this.isFocused=!1;let t=this.el.getAttribute("aria-describedby")?.split(/\s+/);if(t?.includes(this.tooltipEl.id)){let e=t.filter(i=>i&&i!==this.tooltipEl.id).join(" ");e?this.el.setAttribute("aria-describedby",e):this.el.removeAttribute("aria-describedby")}if(this._originalContent){let{el:e,marker:i,display:n,priority:o,hidden:a,contentClass:l}=this._originalContent;e.style.setProperty("display",n,o),x(e,"hidden",a),e.classList.toggle("tooltip-content",l),e.className||e.removeAttribute("class"),i.replaceWith(e),this._originalContent=null}this.tooltipEl.remove(),u.setAnchorName(this.el,`--${this.tooltipEl.id}`,!1),super.destroy()}_appendTooltipEl(){this.tooltipEl=document.createElement("div"),this.tooltipEl.classList.add("tooltip"),this.tooltipEl.id=`tooltip-${u.guid()}`,this.tooltipEl.setAttribute("role","tooltip"),this.el.setAttribute("aria-describedby",[this.el.getAttribute("aria-describedby"),this.tooltipEl.id].filter(Boolean).join(" "));let t=this.options.tooltipId?u.getElementById(this.el,this.options.tooltipId):null;this.options.tooltipId&&!t&&console.error(`Tooltip: no element with id "${this.options.tooltipId}"; showing the text tooltip instead.`);let e=t??document.createElement("div");if(t){this.tooltipEl.classList.add("rich");let i=document.createComment("");e.before(i),this._originalContent={el:e,marker:i,display:e.style.display,priority:e.style.getPropertyPriority("display"),hidden:e.getAttribute("hidden"),contentClass:e.classList.contains("tooltip-content")},e.removeAttribute("hidden")}e.style.display="",e.classList.add("tooltip-content"),this._setTooltipContent(e),this.tooltipEl.appendChild(e),u.portalRoot(this.el).appendChild(this.tooltipEl)}_setTooltipContent(t){this._originalContent||(t.innerText=this.options.text)}_updateTooltipContent(){this._setTooltipContent(this.tooltipEl.querySelector(".tooltip-content"))}_setupEventHandlers(){let{signal:t}=this._events,e={capture:!0,signal:t};for(let i of[this.el,this.tooltipEl])i.addEventListener("mouseenter",this._handleMouseEnter,{signal:t}),i.addEventListener("mouseleave",this._handleMouseLeave,{signal:t}),i.addEventListener("focus",this._handleFocus,e),i.addEventListener("blur",this._handleBlur,e);this.el.addEventListener("pointerenter",this._handlePointerEnter,{signal:t}),this.el.addEventListener("pointerdown",this._handlePointerDown,{signal:t}),this.el.addEventListener("pointerup",this._handlePointerEnd,{signal:t}),this.el.addEventListener("pointercancel",this._handlePointerCancel,{signal:t}),this.el.addEventListener("click",this._handleClick,e),this.tooltipEl.addEventListener("click",this._handleTooltipClick,e)}_showNow(){this.open(),clearTimeout(this._enterDelayTimeout),this._animateIn()}_hideNow(){this.close(),clearTimeout(this._exitDelayTimeout),this._animateOut()}_setExitDelayTimeout(){clearTimeout(this._exitDelayTimeout),this._exitDelayTimeout=setTimeout(()=>{this.isHovered||this.isFocused||this._animateOut()},this.options.exitDelay)}_setEnterDelayTimeout(t){clearTimeout(this._enterDelayTimeout);let e=Bn(Date.now());this._enterDelayTimeout=setTimeout(()=>{!this.isHovered&&!this.isFocused&&!t||this._animateIn()},e?0:this.options.enterDelay)}_positionTooltip(){let t=this.tooltipEl,e=this.el,i=e.offsetHeight,n=e.offsetWidth,o=t.offsetHeight,a=t.offsetWidth,l=this.options.margin;this.xMovement=0,this.yMovement=0;let c=e.getBoundingClientRect(),h=c.top+window.scrollY,d=c.left+window.scrollX;this.options.position==="top"?(h+=-o-l,d+=n/2-a/2,this.yMovement=-this.options.transitionMovement):this.options.position==="right"?(h+=i/2-o/2,d+=n+l,this.xMovement=this.options.transitionMovement):this.options.position==="left"?(h+=i/2-o/2,d+=-a-l,this.xMovement=-this.options.transitionMovement):(h+=i+l,d+=n/2-a/2,this.yMovement=this.options.transitionMovement);let p=u._repositionWithinScreen(d,h,a,o,l,this.options.transitionMovement,"center");t.style.setProperty("--md-comp-tooltip-anchor-gap",`${Math.max(0,l)+Math.abs(this.options.transitionMovement)}px`),u._placeInOffsetParent(t,p)}_place(){Al?this._anchorTooltip():this._positionTooltip()}_anchorTooltip(){let[t,e]=Fn[this.options.position]??Fn.bottom,i=`--${this.tooltipEl.id}`;this.xMovement=0,this.yMovement=0,u.setAnchorName(this.el,i,!0);let n=this.tooltipEl.style;n.position="fixed",n.inset="auto",n.margin=`${Math.max(0,this.options.margin)+Math.abs(this.options.transitionMovement)}px`,n.setProperty("position-anchor",i),n.setProperty("position-area",t),n.setProperty(e,"anchor-center"),n.setProperty("position-try-fallbacks","flip-block, flip-inline")}_animateIn(){this._animate(!0)}_animateOut(){this._animate(!1)}_animate(t){let e=this.tooltipEl.style,i=this.el.ownerDocument.defaultView.matchMedia("(prefers-reduced-motion: reduce)").matches,n=i?0:t?this.options.inDuration:this.options.outDuration;t&&(this._place(),e.visibility="visible",e.overflow="visible"),e.transition=`transform ${n}ms ease-out, opacity ${n}ms ease-out`,clearTimeout(this._animationTimeout),this._animationTimeout=setTimeout(()=>{e.transform=t&&!i?`translateX(${this.xMovement}px) translateY(${this.yMovement}px)`:"none",e.opacity=t?(this.options.opacity||1).toString():"0",t||(this._animationTimeout=setTimeout(()=>{e.visibility="hidden",e.overflow=""},n))},1),this._reportShown(t)}_reportShown(t){t!==this._shown&&(this._shown=t,this._notify(t?"open":"close"))}_touched(t){return t.pointerType!=="touch"?!1:(this._lastTouch=performance.now(),!0)}_longPress(t){return!this.options.openOnClick&&this._touched(t)}_toggle(t){this._insideClick=t,this._shown?this._hideNow():this._showNow()}_holds(t){return!!t&&(this.el.contains(t)||this.tooltipEl.contains(t))}_blurClickTooltip(t){t&&(this.isOpen||this._shown)&&this._hideNow()}_getAttributeOptions(){let t={},e=this.el.getAttribute("data-tooltip"),i=this.el.getAttribute("data-tooltip-id"),n=this.el.getAttribute("data-position");return e&&(t.text=e),n&&(t.position=n),i&&(t.tooltipId=i),t}};gi.key="Expressive_Tooltip";var ve=gi;var $n={AppBar:{component:ut,selector:"header.medium, header.large, header:has(> :is(nav:not(.tabs, .navigation-bar, .navigation-rail), .bar) > .search-bar)"},Autocomplete:{component:Q,selector:".autocomplete"},ButtonGroup:{component:pt,selector:".button-group"},Cards:{component:G,selector:wi,filter:xi},ExpandingCard:{component:Z,selector:Mi},Carousel:{component:mt,selector:".carousel"},Chips:{component:it,selector:".chips"},Confetti:{component:ce,selector:".confetti"},Particles:{component:bt,selector:"canvas.particles"},Keypad:{component:Et,selector:".keypad, .keyboard"},ColorPicker:{component:yt,selector:".color-picker"},ColumnChart:{component:W,selector:".column-chart"},BarChart:{component:wt,selector:".bar-chart"},PieChart:{component:xt,selector:".pie-chart"},HeatmapChart:{component:Mt,selector:".heatmap-chart"},RadarChart:{component:Ct,selector:".radar-chart"},RadialChart:{component:St,selector:".radial-chart"},MixedChart:{component:At,selector:".mixed-chart"},ScatterChart:{component:Ht,selector:".scatter-chart"},FunnelChart:{component:It,selector:".funnel-chart"},SankeyChart:{component:Ot,selector:".sankey-chart"},TreemapChart:{component:Dt,selector:".treemap-chart"},CommandPalette:{component:Tt,selector:"dialog.command-palette"},Questionnaire:{component:Lt,selector:"form.questionnaire"},Datepicker:{component:pe,selector:".date-picker"},LineChart:{component:k,selector:".line-chart"},Menu:{component:B,selector:".menu-trigger"},MessageScroller:{component:Rt,selector:".message-scroller"},PullToRefresh:{component:me,selector:".pull-to-refresh"},LoadingOverlay:{component:Ft,selector:".loading-overlay"},SwipeActions:{component:Nt,selector:".list.swipeable"},InputMask:{component:ft,selector:'input[data-mask]:is(:not([type]), [type="text" i], [type="tel" i], [type="search" i], [type="url" i], [type="password" i])'},ShowMore:{component:le,selector:".show-more"},CurrencyInput:{component:gt,selector:'input[data-currency]:is(:not([type]), [type="text" i])'},Lightbox:{component:Bt,selector:".lightboxed"},ScrollSpy:{component:fe,selector:".scrollspy"},BackToTop:{component:$t,selector:".back-to-top"},FormSelect:{component:z,selector:"select:not([data-tree])"},TreeSelect:{component:qt,selector:"select[data-tree]"},Cascader:{component:vt,selector:".cascader"},NavigationRail:{component:zt,selector:".navigation-rail"},Tabs:{component:_e,selector:".tabs"},Timepicker:{component:ge,selector:".time-picker"},Tooltip:{component:ve,selector:".tooltipped"},HoverCard:{component:_t,selector:".hover-card-trigger"},FloatingActionButton:{component:dt,selector:".fab-menu"},Menubar:{component:Pt,selector:".menubar"}},Bl=new Set(["allowUnsafeHTML","minYear","maxYear","data"]),vi="[object Object]",qn="[object Array]",$l=new Set(["[object String]","[object Number]","[object Boolean]",qn,vi]),ql=r=>`data-${r.replace(/\B[A-Z]/g,"-$&").toLowerCase()}-options`;function be(r){let s=Object.prototype.toString.call(r);return s===vi&&Object.getPrototypeOf(r)!==Object.prototype?"other":s}var zl=(r,s)=>!r.length||s.every(t=>be(t)===be(r[0]));function Kl(r,s){let t=be(r);return!$l.has(t)||be(s)!==t?!1:t!==qn||zl(r,s)}var Vl=(r,s,t)=>Object.hasOwn(r,s)&&!Bl.has(s)&&Kl(r[s],t),Wl=(r,s)=>{r.push(s)};function Ul(r,s,t,e){if(be(r)!==vi)return r;let i=t.length,n=zn(r,s,t,e);return t.length===i?n:void 0}function zn(r,s,t,e=""){let i={};for(let[n,o]of Object.entries(r)){let a=Vl(s,n,o)?Ul(o,s[n],t,`${e}${n}.`):Wl(t,e+n);a!==void 0&&(i[n]=a)}return i}function jl(r){try{let s=JSON.parse(r);return be(s)===vi?s:null}catch{return null}}function Yl(r,s,t){let e=ql(s),i=r.getAttribute(e);if(i===null)return{};let n=jl(i);if(!n)return console.warn(`${s} ignored ${e}: expected a JSON object.`,r),{};let o=[],a=zn(n,t,o);return o.forEach(l=>console.warn(`${s} ignored "${l}" in ${e}: markup cannot set that option to that value.`,r)),a}var bi=r=>$n[r],es=Object.keys($n);function Kn(r,s,t={}){let{component:e}=bi(r);e.init(s,{...Yl(s,r,e.defaults),...t})}function is(r,s,t=!1){let{selector:e,filter:i=()=>!0}=bi(r),n=`:is(${e}):not(.no-autoinit)`;return[...t&&s.matches(n)?[s]:[],...s.querySelectorAll(n)].filter(i)}function Xl(r,s){if(r.nodeType===Node.ELEMENT_NODE)for(let t of es)is(t,r,!0).forEach(e=>bi(t).component.getInstance(e)||Kn(t,e,s?.[t]))}function Gl(r){if(!(r.nodeType!==Node.ELEMENT_NODE||r.isConnected))for(let s of es)is(s,r,!0).forEach(t=>bi(s).component.getInstance(t)?.destroy())}function Zl(r,s){let t=i=>{for(let{addedNodes:n,removedNodes:o}of i)o.forEach(Gl),n.forEach(a=>r.contains(a)&&Xl(a,s))},e=new MutationObserver(t);return e.observe(r,{childList:!0,subtree:!0}),()=>{t(e.takeRecords()),e.disconnect()}}function Vn(r=document.body,s,t={}){for(let e of es)is(e,r).forEach(i=>Kn(e,i,s?.[e]));return t.watch?Zl(r,s):()=>{}}var Ql="0.16.0";Yt.Init();it.Init();Vt.Init();G.Init();Z.Init();Wt.Init();Ut.Init();jt.Init();Gt.Init();Zt.Init();Qt.Init();Jt.Init();te.Init();ee.Init();ie.Init();oe.Init();ae.Init();return Qn(Jl);})();
|
|
59
|
+
</div>`;var Te=qe;var rc=typeof CSS<"u"&&!!CSS.supports?.("anchor-name: --a"),Yn={top:["top","justify-self"],right:["right","align-self"],left:["left","align-self"],bottom:["bottom","justify-self"]},oc=500,ac=1500,lc=800,cc=400,hc=300,Xn=-1/0,ps=-1/0,Gn=r=>r>=Xn&&r<ps;function uc(r){let s=Date.now(),t=s+r+hc;ps=Gn(s)?Math.max(ps,t):t,Xn=s}var dc={exitDelay:200,enterDelay:0,text:"",margin:4,inDuration:250,outDuration:200,position:"bottom",transitionMovement:10,opacity:1,openOnClick:!1},Yt=class extends b{constructor(t,e){super(t,e);this._insideClick=null;this._lastTouch=-1/0;this._touchShown=!1;this._swallowClickUntil=-1/0;this._shown=!1;this.open=(t=!0)=>{if(this.isOpen)return;clearTimeout(this._exitDelayTimeout),clearTimeout(this._animationTimeout),this.isOpen=!0;let{signal:e}=this._events;this.el.ownerDocument.addEventListener("keydown",this._handleKeydown,{capture:!0,signal:e}),this.options.openOnClick&&(this._outsideTimeout=setTimeout(()=>this.el.ownerDocument.addEventListener("click",this._handleDocumentClick,{signal:e}))),this.options={...this.options,...this._getAttributeOptions()},this._updateTooltipContent(),this._setEnterDelayTimeout(t)};this.close=()=>{clearTimeout(this._pressTimeout),clearTimeout(this._lingerTimeout),this._touchShown=!1,this.isOpen&&(this._shown&&uc(this.options.exitDelay),this.isHovered=!1,this.isFocused=!1,this.isOpen=!1,this.el.ownerDocument.removeEventListener("keydown",this._handleKeydown,!0),clearTimeout(this._outsideTimeout),this.el.ownerDocument.removeEventListener("click",this._handleDocumentClick),clearTimeout(this._enterDelayTimeout),this._setExitDelayTimeout())};this._handleMouseEnter=()=>{this.options.openOnClick||performance.now()-this._lastTouch<lc||(this._touchShown=!1,this.isHovered=!0,this.open(!1))};this._handlePointerEnter=t=>{this._touched(t)};this._handlePointerDown=t=>{this._longPress(t)&&(clearTimeout(this._lingerTimeout),clearTimeout(this._pressTimeout),this._pressTimeout=setTimeout(()=>{this.isHovered=!0,this._showNow(),this._touchShown=!0},oc))};this._handlePointerEnd=t=>{this._longPress(t)&&(clearTimeout(this._pressTimeout),this._touchShown&&(this._swallowClickUntil=performance.now()+cc),this.isOpen&&(this.isHovered=!1,this._lingerTimeout=setTimeout(()=>this.isHovered||this.isFocused||this.close(),ac)))};this._handleClick=t=>{if(this.options.openOnClick)return this._toggle(t);performance.now()>this._swallowClickUntil||(this._swallowClickUntil=-1/0,t.preventDefault(),t.stopImmediatePropagation())};this._handleTooltipClick=t=>{this._insideClick=t};this._handleDocumentClick=t=>{t!==this._insideClick&&this._hideNow()};this._handlePointerCancel=t=>{this._longPress(t)&&(clearTimeout(this._pressTimeout),this._touchShown&&(this.isHovered=!1,this.isFocused||this.close()))};this._handleMouseLeave=t=>{this.options.openOnClick||this._holds(t.relatedTarget)||(this.isHovered=!1,this.isFocused||this.close())};this._handleKeydown=t=>{t.key!=="Escape"||!this.isOpen||(u.focusIsIn(this.el,this.tooltipEl)&&(t.preventDefault(),t.stopPropagation()),this._hideNow())};this._handleFocus=t=>{!this.options.openOnClick&&t.target.matches(":focus-visible")&&(this.isFocused=!0,this.open(!1))};this._handleBlur=t=>{let e=t.relatedTarget;if(!this._holds(e)){if(this.options.openOnClick)return this._blurClickTooltip(e);this.isFocused=!1,this.isHovered||this.close()}};this.options={...this.options,...this._getAttributeOptions()},this.isOpen=!1,this.isHovered=!1,this.isFocused=!1,this._appendTooltipEl(),this._setupEventHandlers()}static get defaults(){return dc}destroy(){clearTimeout(this._enterDelayTimeout),clearTimeout(this._exitDelayTimeout),clearTimeout(this._animationTimeout),clearTimeout(this._pressTimeout),clearTimeout(this._lingerTimeout),clearTimeout(this._outsideTimeout),this.isOpen=!1,this.isHovered=!1,this.isFocused=!1;let t=this.el.getAttribute("aria-describedby")?.split(/\s+/);if(t?.includes(this.tooltipEl.id)){let e=t.filter(i=>i&&i!==this.tooltipEl.id).join(" ");e?this.el.setAttribute("aria-describedby",e):this.el.removeAttribute("aria-describedby")}if(this._originalContent){let{el:e,marker:i,display:n,priority:o,hidden:a,contentClass:l}=this._originalContent;e.style.setProperty("display",n,o),w(e,"hidden",a),e.classList.toggle("tooltip-content",l),e.className||e.removeAttribute("class"),i.replaceWith(e),this._originalContent=null}this.tooltipEl.remove(),u.setAnchorName(this.el,`--${this.tooltipEl.id}`,!1),super.destroy()}_appendTooltipEl(){this.tooltipEl=document.createElement("div"),this.tooltipEl.classList.add("tooltip"),this.tooltipEl.id=`tooltip-${u.guid()}`,this.tooltipEl.setAttribute("role","tooltip"),this.el.setAttribute("aria-describedby",[this.el.getAttribute("aria-describedby"),this.tooltipEl.id].filter(Boolean).join(" "));let t=this.options.tooltipId?u.getElementById(this.el,this.options.tooltipId):null;this.options.tooltipId&&!t&&console.error(`Tooltip: no element with id "${this.options.tooltipId}"; showing the text tooltip instead.`);let e=t??document.createElement("div");if(t){this.tooltipEl.classList.add("rich");let i=document.createComment("");e.before(i),this._originalContent={el:e,marker:i,display:e.style.display,priority:e.style.getPropertyPriority("display"),hidden:e.getAttribute("hidden"),contentClass:e.classList.contains("tooltip-content")},e.removeAttribute("hidden")}e.style.display="",e.classList.add("tooltip-content"),this._setTooltipContent(e),this.tooltipEl.appendChild(e),u.portalRoot(this.el).appendChild(this.tooltipEl)}_setTooltipContent(t){this._originalContent||(t.innerText=this.options.text)}_updateTooltipContent(){this._setTooltipContent(this.tooltipEl.querySelector(".tooltip-content"))}_setupEventHandlers(){let{signal:t}=this._events,e={capture:!0,signal:t};for(let i of[this.el,this.tooltipEl])i.addEventListener("mouseenter",this._handleMouseEnter,{signal:t}),i.addEventListener("mouseleave",this._handleMouseLeave,{signal:t}),i.addEventListener("focus",this._handleFocus,e),i.addEventListener("blur",this._handleBlur,e);this.el.addEventListener("pointerenter",this._handlePointerEnter,{signal:t}),this.el.addEventListener("pointerdown",this._handlePointerDown,{signal:t}),this.el.addEventListener("pointerup",this._handlePointerEnd,{signal:t}),this.el.addEventListener("pointercancel",this._handlePointerCancel,{signal:t}),this.el.addEventListener("click",this._handleClick,e),this.tooltipEl.addEventListener("click",this._handleTooltipClick,e)}_showNow(){this.open(),clearTimeout(this._enterDelayTimeout),this._animateIn()}_hideNow(){this.close(),clearTimeout(this._exitDelayTimeout),this._animateOut()}_setExitDelayTimeout(){clearTimeout(this._exitDelayTimeout),this._exitDelayTimeout=setTimeout(()=>{this.isHovered||this.isFocused||this._animateOut()},this.options.exitDelay)}_setEnterDelayTimeout(t){clearTimeout(this._enterDelayTimeout);let e=Gn(Date.now());this._enterDelayTimeout=setTimeout(()=>{!this.isHovered&&!this.isFocused&&!t||this._animateIn()},e?0:this.options.enterDelay)}_positionTooltip(){let t=this.tooltipEl,e=this.el,i=e.offsetHeight,n=e.offsetWidth,o=t.offsetHeight,a=t.offsetWidth,l=this.options.margin;this.xMovement=0,this.yMovement=0;let c=e.getBoundingClientRect(),h=c.top+window.scrollY,d=c.left+window.scrollX;this.options.position==="top"?(h+=-o-l,d+=n/2-a/2,this.yMovement=-this.options.transitionMovement):this.options.position==="right"?(h+=i/2-o/2,d+=n+l,this.xMovement=this.options.transitionMovement):this.options.position==="left"?(h+=i/2-o/2,d+=-a-l,this.xMovement=-this.options.transitionMovement):(h+=i+l,d+=n/2-a/2,this.yMovement=this.options.transitionMovement);let p=u._repositionWithinScreen(d,h,a,o,l,this.options.transitionMovement,"center");t.style.setProperty("--md-comp-tooltip-anchor-gap",`${Math.max(0,l)+Math.abs(this.options.transitionMovement)}px`),u._placeInOffsetParent(t,p)}_place(){rc?this._anchorTooltip():this._positionTooltip()}_anchorTooltip(){let[t,e]=Yn[this.options.position]??Yn.bottom,i=`--${this.tooltipEl.id}`;this.xMovement=0,this.yMovement=0,u.setAnchorName(this.el,i,!0);let n=this.tooltipEl.style;n.position="fixed",n.inset="auto",n.margin=`${Math.max(0,this.options.margin)+Math.abs(this.options.transitionMovement)}px`,n.setProperty("position-anchor",i),n.setProperty("position-area",t),n.setProperty(e,"anchor-center"),n.setProperty("position-try-fallbacks","flip-block, flip-inline")}_animateIn(){this._animate(!0)}_animateOut(){this._animate(!1)}_animate(t){let e=this.tooltipEl.style,i=this.el.ownerDocument.defaultView.matchMedia("(prefers-reduced-motion: reduce)").matches,n=i?0:t?this.options.inDuration:this.options.outDuration;t&&(this._place(),e.visibility="visible",e.overflow="visible"),e.transition=`transform ${n}ms ease-out, opacity ${n}ms ease-out`,clearTimeout(this._animationTimeout),this._animationTimeout=setTimeout(()=>{e.transform=t&&!i?`translateX(${this.xMovement}px) translateY(${this.yMovement}px)`:"none",e.opacity=t?(this.options.opacity||1).toString():"0",t||(this._animationTimeout=setTimeout(()=>{e.visibility="hidden",e.overflow=""},n))},1),this._reportShown(t)}_reportShown(t){t!==this._shown&&(this._shown=t,this._notify(t?"open":"close"))}_touched(t){return t.pointerType!=="touch"?!1:(this._lastTouch=performance.now(),!0)}_longPress(t){return!this.options.openOnClick&&this._touched(t)}_toggle(t){this._insideClick=t,this._shown?this._hideNow():this._showNow()}_holds(t){return!!t&&(this.el.contains(t)||this.tooltipEl.contains(t))}_blurClickTooltip(t){t&&(this.isOpen||this._shown)&&this._hideNow()}_getAttributeOptions(){let t={},e=this.el.getAttribute("data-tooltip"),i=this.el.getAttribute("data-tooltip-id"),n=this.el.getAttribute("data-position");return e&&(t.text=e),n&&(t.position=n),i&&(t.tooltipId=i),t}};Yt.key="Expressive_Tooltip";var Qn={AppBar:{component:_t,selector:"header.medium, header.large, header:has(> :is(nav:not(.tabs, .navigation-bar, .navigation-rail), .bar) > .search-bar)"},Autocomplete:{component:it,selector:".autocomplete"},ButtonGroup:{component:vt,selector:".button-group"},Cards:{component:nt,selector:Di,filter:Pi},ExpandingCard:{component:et,selector:Ri},Carousel:{component:bt,selector:".carousel"},Chips:{component:rt,selector:".chips"},Confetti:{component:pe,selector:".confetti"},Particles:{component:xt,selector:"canvas.particles"},Keypad:{component:lt,selector:".keypad, .keyboard"},ColorPicker:{component:wt,selector:".color-picker"},ColumnChart:{component:G,selector:".column-chart"},BarChart:{component:At,selector:".bar-chart"},PieChart:{component:It,selector:".pie-chart"},HeatmapChart:{component:Ht,selector:".heatmap-chart"},RadarChart:{component:Ot,selector:".radar-chart"},RadialChart:{component:Dt,selector:".radial-chart"},MixedChart:{component:Pt,selector:".mixed-chart"},ScatterChart:{component:Rt,selector:".scatter-chart"},FunnelChart:{component:Ft,selector:".funnel-chart"},SankeyChart:{component:Nt,selector:".sankey-chart"},TreemapChart:{component:Bt,selector:".treemap-chart"},CommandPalette:{component:Mt,selector:"dialog.command-palette"},Questionnaire:{component:Ct,selector:"form.questionnaire"},Datepicker:{component:ve,selector:".date-picker"},LineChart:{component:A,selector:".line-chart"},Menu:{component:$,selector:".menu-trigger"},MessageScroller:{component:qt,selector:".message-scroller"},PullToRefresh:{component:be,selector:".pull-to-refresh"},LoadingOverlay:{component:zt,selector:".loading-overlay"},SwipeActions:{component:Kt,selector:".list.swipeable"},InputMask:{component:Et,selector:'input[data-mask]:is(:not([type]), [type="text" i], [type="tel" i], [type="search" i], [type="url" i], [type="password" i])'},ShowMore:{component:de,selector:".show-more"},CurrencyInput:{component:Tt,selector:'input[data-currency]:is(:not([type]), [type="text" i])'},Lightbox:{component:Vt,selector:".lightboxed"},ScrollSpy:{component:Ee,selector:".scrollspy"},BackToTop:{component:Wt,selector:".back-to-top"},FormSelect:{component:K,selector:"select:not([data-tree])"},TreeSelect:{component:Ut,selector:"select[data-tree]"},Cascader:{component:Lt,selector:".cascader"},NavigationRail:{component:jt,selector:".navigation-rail"},Tabs:{component:ye,selector:".tabs"},Timepicker:{component:Te,selector:".time-picker"},Tooltip:{component:Yt,selector:".tooltipped"},HoverCard:{component:yt,selector:".hover-card-trigger"},FloatingActionButton:{component:gt,selector:".fab-menu"},Menubar:{component:$t,selector:".menubar"}},mc=new Set(["allowUnsafeHTML","minYear","maxYear","data"]),Ci="[object Object]",Jn="[object Array]",fc=new Set(["[object String]","[object Number]","[object Boolean]",Jn,Ci]),_c=r=>`data-${r.replace(/\B[A-Z]/g,"-$&").toLowerCase()}-options`;function Le(r){let s=Object.prototype.toString.call(r);return s===Ci&&Object.getPrototypeOf(r)!==Object.prototype?"other":s}var gc=(r,s)=>!r.length||s.every(t=>Le(t)===Le(r[0]));function vc(r,s){let t=Le(r);return!fc.has(t)||Le(s)!==t?!1:t!==Jn||gc(r,s)}var tr=(r,s)=>Reflect.get(r,s),bc=(r,s,t)=>Object.hasOwn(r,s)&&!mc.has(s)&&vc(tr(r,s),t),Ec=(r,s)=>{r.push(s)};function yc(r,s,t,e){if(Le(r)!==Ci)return r;let i=t.length,n=er(r,s,t,e);return t.length===i?n:void 0}function er(r,s,t,e=""){let i={};for(let[n,o]of Object.entries(r)){let a=bc(s,n,o)?yc(o,tr(s,n),t,`${e}${n}.`):Ec(t,e+n);a!==void 0&&(i[n]=a)}return i}function Tc(r){try{let s=JSON.parse(r);return Le(s)===Ci?s:null}catch{return null}}function Lc(r,s,t){let e=_c(s),i=r.getAttribute(e);if(i===null)return{};let n=Tc(i);if(!n)return console.warn(`${s} ignored ${e}: expected a JSON object.`,r),{};let o=[],a=er(n,t,o);return o.forEach(l=>console.warn(`${s} ignored "${l}" in ${e}: markup cannot set that option to that value.`,r)),a}var ze=r=>Qn[r],Si=Object.keys(Qn),Zn=`:is(${Si.map(r=>ze(r).selector).join(",")}):not(.no-autoinit)`;function ir(r,s,t={}){let{component:e}=ze(r);try{e.init(s,{...Lc(s,r,e.defaults),...t})}catch(i){console.error(`${r} failed to start on`,s,i),sr(r,s)}}function sr(r,s){let t=ze(r).component.getInstance(s);try{t?.destroy()}catch(e){console.error(`${r} failed to stop on`,s,e),b.prototype.destroy.call(t)}}function ms(r,s,t=!1){let{selector:e,filter:i=()=>!0}=ze(r),n=`:is(${e}):not(.no-autoinit)`;return[...t&&s.matches(n)?[s]:[],...s.querySelectorAll(n)].filter(i)}function xc(r,s){if(nr(r))for(let t of Si)ms(t,r,!0).forEach(e=>ze(t).component.getInstance(e)||ir(t,e,s?.[t]))}function nr(r){if(r.nodeType!==Node.ELEMENT_NODE)return!1;let s=r;return s.matches(Zn)||s.querySelector(Zn)!==null}function wc(r){if(!(r.isConnected||!nr(r)))for(let s of Si)ms(s,r,!0).forEach(t=>sr(s,t))}function Mc(r,s){let t=i=>{for(let{addedNodes:n,removedNodes:o}of i)o.forEach(wc),n.forEach(a=>r.contains(a)&&xc(a,s))},e=new MutationObserver(t);return e.observe(r,{childList:!0,subtree:!0}),()=>{t(e.takeRecords()),e.disconnect()}}function rr(r=document.body,s,t={}){for(let e of Si)ms(e,r).forEach(i=>ir(e,i,s?.[e]));return t.watch?Mc(r,s):()=>{}}var Cc="0.17.0";te.Init();rt.Init();Gt.Init();nt.Init();et.Init();Zt.Init();Qt.Init();Jt.Init();ie.Init();se.Init();ne.Init();re.Init();oe.Init();ae.Init();le.Init();he.Init();ue.Init();return pr(Sc);})();
|
|
60
60
|
//# sourceMappingURL=expressive.min.js.map
|