@paperless/core 2.22.0-alpha.32 → 2.22.0-alpha.33
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/dist/build/{p-eb88330f.entry.js → p-0db34ade.entry.js} +1 -1
- package/dist/build/{p-dc7e3d2d.entry.js → p-114e0c9a.entry.js} +1 -1
- package/dist/build/{p-8527dffc.entry.js → p-1924cd9d.entry.js} +1 -1
- package/dist/build/{p-75c0d205.entry.js → p-1a17e046.entry.js} +1 -1
- package/dist/build/{p-a075f933.entry.js → p-1eed9342.entry.js} +1 -1
- package/dist/{paperless/p-a3c931c3.entry.js → build/p-1f260372.entry.js} +1 -1
- package/dist/build/{p-1bc013ea.entry.js → p-2695c4c1.entry.js} +1 -1
- package/dist/{paperless/p-88434ef8.entry.js → build/p-4752c1e2.entry.js} +1 -1
- package/dist/build/{p-ac64c055.entry.js → p-48862d6c.entry.js} +1 -1
- package/dist/build/{p-8d872235.entry.js → p-4ad6da03.entry.js} +1 -1
- package/dist/{paperless/p-d824b806.entry.js → build/p-4c1b92b5.entry.js} +1 -1
- package/dist/{paperless/p-f16b7c0e.entry.js → build/p-5c4efc42.entry.js} +1 -1
- package/dist/build/{p-96020614.entry.js → p-5e6e2031.entry.js} +1 -1
- package/dist/{paperless/p-cce41338.entry.js → build/p-608f6111.entry.js} +1 -1
- package/dist/build/p-6da67ab3.entry.js +1 -0
- package/dist/build/{p-3d4eed8c.entry.js → p-7e9886d6.entry.js} +1 -1
- package/dist/build/{p-26a84c2f.entry.js → p-84652e9e.entry.js} +1 -1
- package/dist/{paperless/p-8073ff56.entry.js → build/p-93542510.entry.js} +1 -1
- package/dist/{paperless/p-5abb4596.entry.js → build/p-94311485.entry.js} +1 -1
- package/dist/{paperless/p-443e1609.entry.js → build/p-a3f1e55c.entry.js} +1 -1
- package/dist/{paperless/p-d79097e9.entry.js → build/p-a6d1bac6.entry.js} +1 -1
- package/dist/build/{p-4c47faf5.entry.js → p-aa3c6754.entry.js} +1 -1
- package/dist/build/{p-39695802.js → p-bb93b60d.js} +1 -1
- package/dist/build/{p-7b05d594.entry.js → p-bf87972a.entry.js} +1 -1
- package/dist/build/{p-796ade92.entry.js → p-d15bb397.entry.js} +1 -1
- package/dist/build/{p-4ade4fd6.entry.js → p-d2de7714.entry.js} +1 -1
- package/dist/{paperless/p-16625524.entry.js → build/p-d388076a.entry.js} +1 -1
- package/dist/{paperless/p-2461cae0.entry.js → build/p-dafa1b62.entry.js} +1 -1
- package/dist/build/{p-3224460c.entry.js → p-e0b1116c.entry.js} +1 -1
- package/dist/build/p-f0405a75.entry.js +1 -0
- package/dist/build/{p-0595952f.entry.js → p-ff9f4b2b.entry.js} +1 -1
- package/dist/build/paperless.esm.js +1 -1
- package/dist/cjs/p-accordion.cjs.entry.js +1 -1
- package/dist/cjs/p-attachment.cjs.entry.js +5 -5
- package/dist/cjs/p-avatar.cjs.entry.js +1 -1
- package/dist/cjs/p-badge_3.cjs.entry.js +1 -1
- package/dist/cjs/p-button_3.cjs.entry.js +6 -6
- package/dist/cjs/p-calendar.cjs.entry.js +6 -6
- package/dist/cjs/p-card-header.cjs.entry.js +1 -1
- package/dist/cjs/p-checkbox_3.cjs.entry.js +4 -4
- package/dist/cjs/p-content-slider.cjs.entry.js +2 -2
- package/dist/cjs/p-cropper.cjs.entry.js +1 -1
- package/dist/cjs/p-datepicker.cjs.entry.js +5 -5
- package/dist/cjs/p-drawer-body_3.cjs.entry.js +1 -1
- package/dist/cjs/p-drawer.cjs.entry.js +1 -1
- package/dist/cjs/p-empty-state_8.cjs.entry.js +8 -8
- package/dist/cjs/p-field_3.cjs.entry.js +15 -15
- package/dist/cjs/p-floating-menu-item.cjs.entry.js +1 -1
- package/dist/cjs/p-label.cjs.entry.js +1 -1
- package/dist/cjs/p-modal-body_4.cjs.entry.js +1 -1
- package/dist/cjs/p-modal.cjs.entry.js +1 -1
- package/dist/cjs/p-navbar.cjs.entry.js +1 -1
- package/dist/cjs/p-pagination_3.cjs.entry.js +9 -9
- package/dist/cjs/p-profile.cjs.entry.js +1 -1
- package/dist/cjs/p-radio.cjs.entry.js +2 -2
- package/dist/cjs/p-range.cjs.entry.js +1 -1
- package/dist/cjs/p-select.cjs.entry.js +8 -8
- package/dist/cjs/p-stepper.cjs.entry.js +1 -1
- package/dist/cjs/p-table.cjs.entry.js +20 -42
- package/dist/cjs/p-toast.cjs.entry.js +1 -1
- package/dist/cjs/p-toggle.cjs.entry.js +2 -2
- package/dist/cjs/p-tooltip.cjs.entry.js +1 -1
- package/dist/collection/components/atoms/avatar/avatar/avatar.component.js +1 -1
- package/dist/collection/components/atoms/card/header/card-header.component.js +1 -1
- package/dist/collection/components/atoms/checkbox/checkbox.component.js +2 -2
- package/dist/collection/components/atoms/drawer/header/drawer-header.component.js +1 -1
- package/dist/collection/components/atoms/floating-menu/container/floating-menu-container.component.js +1 -1
- package/dist/collection/components/atoms/floating-menu/item/floating-menu-item.component.js +1 -1
- package/dist/collection/components/atoms/helper/helper.component.js +1 -1
- package/dist/collection/components/atoms/icon/icon.component.js +2 -2
- package/dist/collection/components/atoms/modal/header/modal-header.component.js +1 -1
- package/dist/collection/components/atoms/radio/radio.component.js +2 -2
- package/dist/collection/components/atoms/segment/item/segment-item.component.js +1 -1
- package/dist/collection/components/atoms/toggle/toggle.component.js +2 -2
- package/dist/collection/components/atoms/tooltip/tooltip.component.js +1 -1
- package/dist/collection/components/molecules/accordion/accordion.component.js +1 -1
- package/dist/collection/components/molecules/attachment/attachment.component.js +5 -5
- package/dist/collection/components/molecules/button/button.component.js +4 -4
- package/dist/collection/components/molecules/calendar/calendar.component.js +6 -6
- package/dist/collection/components/molecules/content-slider/content-slider.component.js +2 -2
- package/dist/collection/components/molecules/cropper/cropper.component.js +1 -1
- package/dist/collection/components/molecules/datepicker/datepicker.component.js +5 -5
- package/dist/collection/components/molecules/dropdown/dropdown.component.js +2 -2
- package/dist/collection/components/molecules/field/container/field-container.component.js +6 -6
- package/dist/collection/components/molecules/field/field/field.component.js +8 -8
- package/dist/collection/components/molecules/label/label.component.js +1 -1
- package/dist/collection/components/molecules/pagination/pages/pagination-pages.component.js +6 -6
- package/dist/collection/components/molecules/pagination/pagination/pagination.component.js +1 -1
- package/dist/collection/components/molecules/pagination/size/pagination-size.component.js +2 -2
- package/dist/collection/components/molecules/profile/profile.component.js +1 -1
- package/dist/collection/components/molecules/range/range.component.js +1 -1
- package/dist/collection/components/molecules/select/select.component.js +8 -8
- package/dist/collection/components/molecules/table/cell/table-cell.component.js +1 -1
- package/dist/collection/components/molecules/table/footer/table-footer.component.js +1 -1
- package/dist/collection/components/molecules/table/header/table-header.component.js +5 -5
- package/dist/collection/components/molecules/toast/toast.component.js +1 -1
- package/dist/collection/components/organisms/drawer/drawer.component.js +1 -1
- package/dist/collection/components/organisms/modal/modal.component.js +1 -1
- package/dist/collection/components/organisms/navbar/navbar.component.js +1 -1
- package/dist/collection/components/organisms/stepper/stepper.component.js +1 -1
- package/dist/collection/components/organisms/table/table.component.js +20 -42
- package/dist/components/index.js +1 -1
- package/dist/components/{p-Ch5U9kWZ.js → p-Bs4zUbgC.js} +1 -1
- package/dist/components/{p-OF_TU9VQ.js → p-Bsz5wpvX.js} +1 -1
- package/dist/components/{p-CCufTu-v.js → p-C4QFnooj.js} +1 -1
- package/dist/components/{p-nUd8Wpbr.js → p-C7oEohET.js} +1 -1
- package/dist/components/{p-BwD4wr14.js → p-CCdMFLeY.js} +1 -1
- package/dist/components/{p-DfBWP1bt.js → p-CCpo87pH.js} +1 -1
- package/dist/components/{p-PyPr6c8z.js → p-CGMb-Zik.js} +1 -1
- package/dist/components/{p-SggF_Jar.js → p-CGMitCrO.js} +1 -1
- package/dist/components/{p-DoDhkUVy.js → p-CJ7RtC-a.js} +1 -1
- package/dist/components/{p-CvE78NPe.js → p-CLQglqfD.js} +1 -1
- package/dist/components/{p-CkCQHYtH.js → p-CVCCA4eY.js} +1 -1
- package/dist/components/{p-ZcEew3GF.js → p-CWRAbDh-.js} +1 -1
- package/dist/components/{p-BBpjifjG.js → p-CzT4TxMT.js} +1 -1
- package/dist/components/{p-BQNrSoo9.js → p-D6xsDoHI.js} +1 -1
- package/dist/components/{p-BvUfWfx-.js → p-DCkiUXJN.js} +1 -1
- package/dist/components/{p-kAKe_qDq.js → p-DqtQfYz0.js} +1 -1
- package/dist/components/{p-D08B3cFE.js → p-DuNvWVbF.js} +1 -1
- package/dist/components/{p-CtHAbYCa.js → p-Dxh5RZDW.js} +1 -1
- package/dist/components/{p-h4mS749f.js → p-E_DVjH99.js} +1 -1
- package/dist/components/{p-BqgXqvox.js → p-KIL5rYXr.js} +1 -1
- package/dist/components/{p-2ng-Aose.js → p-Pk4ZTsZ4.js} +1 -1
- package/dist/components/{p-CGFPlslj.js → p-QVPuIpXI.js} +1 -1
- package/dist/components/{p-CNMa-_yN.js → p-TQjQ8aZG.js} +1 -1
- package/dist/components/p-accordion.js +1 -1
- package/dist/components/p-attachment.js +1 -1
- package/dist/components/p-avatar.js +1 -1
- package/dist/components/p-button.js +1 -1
- package/dist/components/p-calendar.js +1 -1
- package/dist/components/p-card-header.js +1 -1
- package/dist/components/p-checkbox.js +1 -1
- package/dist/components/p-content-slider.js +1 -1
- package/dist/components/p-cropper.js +2 -2
- package/dist/components/{p-CaN_dhnG.js → p-csyF2tkK.js} +1 -1
- package/dist/components/p-datepicker.js +1 -1
- package/dist/components/p-drawer-header.js +1 -1
- package/dist/components/p-drawer.js +1 -1
- package/dist/components/p-dropdown-menu-item.js +1 -1
- package/dist/components/p-dropdown.js +1 -1
- package/dist/components/p-empty-state.js +1 -1
- package/dist/components/p-field-container.js +1 -1
- package/dist/components/p-field.js +1 -1
- package/dist/components/p-floating-menu-container.js +1 -1
- package/dist/components/p-floating-menu-item.js +1 -1
- package/dist/components/p-helper.js +1 -1
- package/dist/components/p-icon.js +1 -1
- package/dist/components/p-info-panel.js +1 -1
- package/dist/components/p-label.js +1 -1
- package/dist/components/p-listing-item.js +1 -1
- package/dist/components/p-modal-header.js +1 -1
- package/dist/components/p-modal.js +1 -1
- package/dist/components/p-navbar.js +1 -1
- package/dist/components/p-navigation-item.js +1 -1
- package/dist/components/p-pagination-pages.js +1 -1
- package/dist/components/p-pagination-size.js +1 -1
- package/dist/components/p-pagination.js +1 -1
- package/dist/components/p-profile.js +1 -1
- package/dist/components/p-radio.js +1 -1
- package/dist/components/p-range.js +1 -1
- package/dist/components/p-segment-item.js +1 -1
- package/dist/components/p-select.js +1 -1
- package/dist/components/p-stepper.js +1 -1
- package/dist/components/p-table-cell.js +1 -1
- package/dist/components/p-table-footer.js +1 -1
- package/dist/components/p-table-header.js +1 -1
- package/dist/components/p-table.js +1 -1
- package/dist/components/p-toast.js +1 -1
- package/dist/components/p-toggle.js +1 -1
- package/dist/components/p-tooltip.js +1 -1
- package/dist/esm/p-accordion.entry.js +1 -1
- package/dist/esm/p-attachment.entry.js +5 -5
- package/dist/esm/p-avatar.entry.js +1 -1
- package/dist/esm/p-badge_3.entry.js +1 -1
- package/dist/esm/p-button_3.entry.js +6 -6
- package/dist/esm/p-calendar.entry.js +6 -6
- package/dist/esm/p-card-header.entry.js +1 -1
- package/dist/esm/p-checkbox_3.entry.js +4 -4
- package/dist/esm/p-content-slider.entry.js +2 -2
- package/dist/esm/p-cropper.entry.js +1 -1
- package/dist/esm/p-datepicker.entry.js +5 -5
- package/dist/esm/p-drawer-body_3.entry.js +1 -1
- package/dist/esm/p-drawer.entry.js +1 -1
- package/dist/esm/p-empty-state_8.entry.js +8 -8
- package/dist/esm/p-field_3.entry.js +15 -15
- package/dist/esm/p-floating-menu-item.entry.js +1 -1
- package/dist/esm/p-label.entry.js +1 -1
- package/dist/esm/p-modal-body_4.entry.js +1 -1
- package/dist/esm/p-modal.entry.js +1 -1
- package/dist/esm/p-navbar.entry.js +1 -1
- package/dist/esm/p-pagination_3.entry.js +9 -9
- package/dist/esm/p-profile.entry.js +1 -1
- package/dist/esm/p-radio.entry.js +2 -2
- package/dist/esm/p-range.entry.js +1 -1
- package/dist/esm/p-select.entry.js +8 -8
- package/dist/esm/p-stepper.entry.js +1 -1
- package/dist/esm/p-table.entry.js +20 -42
- package/dist/esm/p-toast.entry.js +1 -1
- package/dist/esm/p-toggle.entry.js +2 -2
- package/dist/esm/p-tooltip.entry.js +1 -1
- package/dist/index.html +1 -1
- package/dist/paperless/{p-eb88330f.entry.js → p-0db34ade.entry.js} +1 -1
- package/dist/paperless/{p-dc7e3d2d.entry.js → p-114e0c9a.entry.js} +1 -1
- package/dist/paperless/{p-8527dffc.entry.js → p-1924cd9d.entry.js} +1 -1
- package/dist/paperless/{p-75c0d205.entry.js → p-1a17e046.entry.js} +1 -1
- package/dist/paperless/{p-a075f933.entry.js → p-1eed9342.entry.js} +1 -1
- package/dist/{build/p-a3c931c3.entry.js → paperless/p-1f260372.entry.js} +1 -1
- package/dist/paperless/{p-1bc013ea.entry.js → p-2695c4c1.entry.js} +1 -1
- package/dist/{build/p-88434ef8.entry.js → paperless/p-4752c1e2.entry.js} +1 -1
- package/dist/paperless/{p-ac64c055.entry.js → p-48862d6c.entry.js} +1 -1
- package/dist/paperless/{p-8d872235.entry.js → p-4ad6da03.entry.js} +1 -1
- package/dist/{build/p-d824b806.entry.js → paperless/p-4c1b92b5.entry.js} +1 -1
- package/dist/{build/p-f16b7c0e.entry.js → paperless/p-5c4efc42.entry.js} +1 -1
- package/dist/paperless/{p-96020614.entry.js → p-5e6e2031.entry.js} +1 -1
- package/dist/{build/p-cce41338.entry.js → paperless/p-608f6111.entry.js} +1 -1
- package/dist/paperless/p-6da67ab3.entry.js +1 -0
- package/dist/paperless/{p-3d4eed8c.entry.js → p-7e9886d6.entry.js} +1 -1
- package/dist/paperless/{p-26a84c2f.entry.js → p-84652e9e.entry.js} +1 -1
- package/dist/{build/p-8073ff56.entry.js → paperless/p-93542510.entry.js} +1 -1
- package/dist/{build/p-5abb4596.entry.js → paperless/p-94311485.entry.js} +1 -1
- package/dist/{build/p-443e1609.entry.js → paperless/p-a3f1e55c.entry.js} +1 -1
- package/dist/{build/p-d79097e9.entry.js → paperless/p-a6d1bac6.entry.js} +1 -1
- package/dist/paperless/{p-4c47faf5.entry.js → p-aa3c6754.entry.js} +1 -1
- package/dist/paperless/{p-7b05d594.entry.js → p-bf87972a.entry.js} +1 -1
- package/dist/paperless/{p-796ade92.entry.js → p-d15bb397.entry.js} +1 -1
- package/dist/paperless/{p-4ade4fd6.entry.js → p-d2de7714.entry.js} +1 -1
- package/dist/{build/p-16625524.entry.js → paperless/p-d388076a.entry.js} +1 -1
- package/dist/{build/p-2461cae0.entry.js → paperless/p-dafa1b62.entry.js} +1 -1
- package/dist/paperless/{p-3224460c.entry.js → p-e0b1116c.entry.js} +1 -1
- package/dist/paperless/p-f0405a75.entry.js +1 -0
- package/dist/paperless/{p-0595952f.entry.js → p-ff9f4b2b.entry.js} +1 -1
- package/dist/paperless/paperless.esm.js +1 -1
- package/dist/sw.js +1 -1
- package/dist/sw.js.map +1 -1
- package/hydrate/index.js +109 -131
- package/hydrate/index.mjs +109 -131
- package/package.json +1 -1
- package/dist/build/p-4b03700c.entry.js +0 -1
- package/dist/build/p-fc461e09.entry.js +0 -1
- package/dist/paperless/p-4b03700c.entry.js +0 -1
- package/dist/paperless/p-fc461e09.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,h as t,a}from"./p-UEOqFwec.js";import{c as r}from"./p-CBWjHURv.js";import{T as o}from"./p-BaOYiNIi.js";import{a as d}from"./p-C5CTp9IA.js";import"./p-ChV9xqsO.js";import"./p-Ds4BJt6D.js";const i=r("bg-white dark:bg-hurricane-600 p-4 -mt-px",{variants:{roundedBottom:{true:"rounded-b-none desktop-xs:rounded-b-2xl pb-[calc(env(safe-area-inset-bottom)+1rem)]",false:"pb-4"},roundedTop:{true:"rounded-t-lg desktop-xs:rounded-t-2xl",false:null}}}),s=class{constructor(t){e(this,t)}roundedBottom=!1;roundedTop=!1;render(){return t(o,{key:"4dd5344c568a1b856dd92e13a982d8c2346f32a9"},t("div",{key:"755f6e8625cdafc7b2c861e849a0434f6b104a4a",class:i({roundedBottom:this.roundedBottom,roundedTop:this.roundedTop})},t("slot",{key:"a10c0615d4f3246cff520e87a1e82dff4f177aec"})))}};s.style="*{box-sizing:border-box}.static{position:static}.-mt-px{margin-top:-1px}.rounded{border-radius:.25rem}.rounded-b-none{border-bottom-left-radius:0;border-bottom-right-radius:0}.rounded-t-lg{border-top-left-radius:.5rem;border-top-right-radius:.5rem}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.p-4{padding:1rem}.pb-4{padding-bottom:1rem}.pb-\\[calc\\(env\\(safe-area-inset-bottom\\)\\+1rem\\)\\]{padding-bottom:calc(env(safe-area-inset-bottom) + 1rem)}@media (min-width:64rem){.desktop-xs\\:rounded-b-2xl{border-bottom-left-radius:1rem;border-bottom-right-radius:1rem}.desktop-xs\\:rounded-t-2xl{border-top-left-radius:1rem;border-top-right-radius:1rem}}.dark\\:bg-hurricane-600:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-bg-opacity:1;background-color:rgb(46 52 62/var(--tw-bg-opacity,1))}.dark\\:bg-hurricane-600:where([data-theme=dark],[data-theme=dark] *){--tw-bg-opacity:1;background-color:rgb(46 52 62/var(--tw-bg-opacity,1))}";const m=r(["flex-1 min-w-0 w-full","z-modal flex flex-col","rounded-b-none rounded-t-2xl desktop-xs:rounded-b-2xl","max-h-[calc(100dvh-4rem)]","shadow-modal","dark:border-hurricane-400 dark:border dark:border-solid"],{variants:{size:{xs:"tablet:max-w-[20rem]",base:"tablet:max-w-[35rem]",lg:"tablet:max-w-[41rem]",xl:"tablet:max-w-[45rem]","2xl":"tablet:max-w-[65rem]"},closing:{false:"animate-slide-in-bottom desktop-xs:animate-slide-in-bottom-small",true:"animate-slide-out-bottom desktop-xs:animate-slide-out-bottom-small pointer-events-none"}}}),n=class{constructor(t){e(this,t)}size="base";closing=!1;render(){return t(o,{key:"918f998bf6ff9f8aa64a323ef7e9208a6205467e"},t("div",{key:"531c0bc3232ff4f1bb795cc8a9c3c469b5c4a2f7",class:m({size:this.size,closing:d(this.closing)})},t("slot",{key:"fa2d654b38a33243cc1d437009caee6f262e88a8"})))}};n.style=".flex{display:flex}.w-full{width:100%}.justify-center{justify-content:center}*{box-sizing:border-box}:host{display:flex;justify-content:center;width:100%}@media (min-width:64rem){:host{margin:auto}}.pointer-events-none{pointer-events:none}.static{position:static}.z-modal{z-index:600}.max-h-\\[calc\\(100dvh-4rem\\)\\]{max-height:calc(100dvh - 4rem)}.min-w-0{min-width:0}.flex-1{flex:1 1 0%}@keyframes slideInBottom{0%{transform:translateY(100%)}to{transform:translateY(0)}}.animate-slide-in-bottom{animation:slideInBottom .5s ease forwards}@keyframes slideOutBottom{0%{transform:translateY(0)}to{transform:translateY(100%)}}.animate-slide-out-bottom{animation:slideOutBottom .5s ease forwards}.flex-col{flex-direction:column}.rounded-b-none{border-bottom-left-radius:0;border-bottom-right-radius:0}.rounded-t-2xl{border-top-left-radius:1rem;border-top-right-radius:1rem}.shadow-modal{--tw-shadow:0 0 0 1px rgba(0,2,2,.1),0 1px 1px 0 rgba(0,2,2,.2),0 2px 2px 0 rgba(0,2,2,.08),0 4px 4px 0 rgba(0,2,2,.08),0 8px 8px 0 rgba(0,2,2,.08);--tw-shadow-colored:0 0 0 1px var(--tw-shadow-color),0 1px 1px 0 var(--tw-shadow-color),0 2px 2px 0 var(--tw-shadow-color),0 4px 4px 0 var(--tw-shadow-color),0 8px 8px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:85.375rem){.container{max-width:85.375rem}}@media (min-width:90rem){.container{max-width:90rem}}@media (min-width:96rem){.container{max-width:96rem}}@media (min-width:105rem){.container{max-width:105rem}}@media (min-width:120rem){.container{max-width:120rem}}@media (min-width:160rem){.container{max-width:160rem}}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}@media (min-width:40rem){.tablet\\:max-w-\\[20rem\\]{max-width:20rem}.tablet\\:max-w-\\[35rem\\]{max-width:35rem}.tablet\\:max-w-\\[41rem\\]{max-width:41rem}.tablet\\:max-w-\\[45rem\\]{max-width:45rem}.tablet\\:max-w-\\[65rem\\]{max-width:65rem}}@media (min-width:64rem){@keyframes slideInBottomSmall{0%{transform:translateY(20%)}to{transform:translateY(0)}}.desktop-xs\\:animate-slide-in-bottom-small{animation:slideInBottomSmall .5s ease forwards}@keyframes slideOutBottomSmall{0%{transform:translateY(0)}to{transform:translateY(20%)}}.desktop-xs\\:animate-slide-out-bottom-small{animation:slideOutBottomSmall .5s ease forwards}.desktop-xs\\:rounded-b-2xl{border-bottom-left-radius:1rem;border-bottom-right-radius:1rem}}.dark\\:border:where(:host([data-theme=dark]),:host([data-theme=dark]) *){border-width:1px}.dark\\:border-solid:where(:host([data-theme=dark]),:host([data-theme=dark]) *){border-style:solid}.dark\\:border-hurricane-400:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-border-opacity:1;border-color:rgb(70 75 84/var(--tw-border-opacity,1))}.dark\\:border:where([data-theme=dark],[data-theme=dark] *){border-width:1px}.dark\\:border-solid:where([data-theme=dark],[data-theme=dark] *){border-style:solid}.dark\\:border-hurricane-400:where([data-theme=dark],[data-theme=dark] *){--tw-border-opacity:1;border-color:rgb(70 75 84/var(--tw-border-opacity,1))}";const l=class{constructor(t){e(this,t)}render(){return t(o,{key:"db7731369d6e62f4e6cd9a45d49202c1d9600284"},t("div",{key:"28bba6b89dcfeaa6d91e295575f8559a82bcb17c",class:"flex flex-col rounded-b-none bg-white px-4 pb-[calc(env(safe-area-inset-bottom)+1rem)] desktop-xs:rounded-b-2xl dark:bg-hurricane-600"},t("p-divider",{key:"d6449db5feef9f6553399b7ca8476fdaa8e38ebe",class:"mb-4 hidden text-off-white-700 desktop-xs:inline-block dark:text-white/10"}),t("div",{key:"ad7ba6598fc59911c04089471c03297de2f03c1f",class:"flex flex-col gap-4 tablet:flex-row"},t("slot",{key:"dddec1e9fd3580b37b08b5f988d4f7efae24eeca"}))))}};l.style="*{box-sizing:border-box}.static{position:static}.mb-4{margin-bottom:1rem}.flex{display:flex}.hidden{display:none}.flex-col{flex-direction:column}.gap-4{gap:1rem}.rounded-b-none{border-bottom-left-radius:0;border-bottom-right-radius:0}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.px-4{padding-left:1rem;padding-right:1rem}.pb-\\[calc\\(env\\(safe-area-inset-bottom\\)\\+1rem\\)\\]{padding-bottom:calc(env(safe-area-inset-bottom) + 1rem)}.text-off-white-700{--tw-text-opacity:1;color:rgb(222 219 213/var(--tw-text-opacity,1))}@media (min-width:40rem){.tablet\\:flex-row{flex-direction:row}}@media (min-width:64rem){.desktop-xs\\:inline-block{display:inline-block}.desktop-xs\\:rounded-b-2xl{border-bottom-left-radius:1rem;border-bottom-right-radius:1rem}}.dark\\:bg-hurricane-600:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-bg-opacity:1;background-color:rgb(46 52 62/var(--tw-bg-opacity,1))}.dark\\:text-white\\/10:where(:host([data-theme=dark]),:host([data-theme=dark]) *){color:hsla(0,0%,100%,.1)}.dark\\:bg-hurricane-600:where([data-theme=dark],[data-theme=dark] *){--tw-bg-opacity:1;background-color:rgb(46 52 62/var(--tw-bg-opacity,1))}.dark\\:text-white\\/10:where([data-theme=dark],[data-theme=dark] *){color:hsla(0,0%,100%,.1)}";const c=r(["w-full flex-col bg-white dark:bg-hurricane-600 relative rounded-t-2xl overflow-hidden z-[1]","inline-flex aspect-[7/1] max-h-28"]),b=r(["flex justify-end","w-full p-4 pb-0 h-12"]),h=r(["flex-1 text-center","w-[calc(100%-7rem)]","absolute top-1/2 -translate-y-1/2 left-1/2 -translate-x-1/2","text-storm-500 dark:text-white text-2xl text-ambit font-bold"]),x=class{constructor(t){e(this,t),this.close=a(this,"close",3)}showClose=!0;close;render(){return t(o,{key:"61310ca15062863fa75788e8621c845829835a83"},t("div",{key:"45d347c0906fb178470a22ee073f78d2c83a625d",class:c()},t("div",{key:"cd7903f26712a92149166a9016f397701c216ee3",class:b()},t("div",{key:"e1aa409159b2c19f97682ba5de0ebcdbca799e7a",class:h()},t("slot",{key:"605016d68fa57dde900543c0cee048f078613fa7"})),this.showClose&&t("p-button",{key:"885ebd89b2f63609e658debad4137df0dfb03b8c",variant:"secondary",icon:"negative",iconOnly:!0,onClick:e=>this.close.emit(e)})),t("p-smile",{key:"f461107c6a15c7c58e5944b0b19e54ff0ce88305",class:"dark:text-hurricane-400"})))}};x.style="*{box-sizing:border-box}.static{position:static}.absolute{position:absolute}.relative{position:relative}.left-1\\/2{left:50%}.top-1\\/2{top:50%}.z-\\[1\\]{z-index:1}.flex{display:flex}.inline-flex{display:inline-flex}.aspect-\\[7\\/1\\]{aspect-ratio:7/1}.h-12{height:3rem}.max-h-28{max-height:7rem}.w-\\[calc\\(100\\%-7rem\\)\\]{width:calc(100% - 7rem)}.w-full{width:100%}.flex-1{flex:1 1 0%}.-translate-x-1\\/2{--tw-translate-x:-50%}.-translate-x-1\\/2,.-translate-y-1\\/2{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\\/2{--tw-translate-y:-50%}.flex-col{flex-direction:column}.justify-end{justify-content:flex-end}.overflow-hidden{overflow:hidden}.rounded-t-2xl{border-top-left-radius:1rem;border-top-right-radius:1rem}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.p-4{padding:1rem}.pb-0{padding-bottom:0}.text-center{text-align:center}.text-2xl{font-size:1.5rem;line-height:2rem}.font-bold{font-weight:700}.text-storm-500{--tw-text-opacity:1;color:rgb(24 30 41/var(--tw-text-opacity,1))}.dark\\:bg-hurricane-600:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-bg-opacity:1;background-color:rgb(46 52 62/var(--tw-bg-opacity,1))}.dark\\:text-hurricane-400:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(70 75 84/var(--tw-text-opacity,1))}.dark\\:text-white:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.dark\\:bg-hurricane-600:where([data-theme=dark],[data-theme=dark] *){--tw-bg-opacity:1;background-color:rgb(46 52 62/var(--tw-bg-opacity,1))}.dark\\:text-hurricane-400:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(70 75 84/var(--tw-text-opacity,1))}.dark\\:text-white:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}";export{s as p_modal_body,n as p_modal_container,l as p_modal_footer,x as p_modal_header}
|
|
1
|
+
import{r as e,h as t,a}from"./p-UEOqFwec.js";import{c as r}from"./p-CBWjHURv.js";import{T as o}from"./p-BaOYiNIi.js";import{a as d}from"./p-C5CTp9IA.js";import"./p-ChV9xqsO.js";import"./p-Ds4BJt6D.js";const i=r("bg-white dark:bg-hurricane-600 p-4 -mt-px",{variants:{roundedBottom:{true:"rounded-b-none desktop-xs:rounded-b-2xl pb-[calc(env(safe-area-inset-bottom)+1rem)]",false:"pb-4"},roundedTop:{true:"rounded-t-lg desktop-xs:rounded-t-2xl",false:null}}}),s=class{constructor(t){e(this,t)}roundedBottom=!1;roundedTop=!1;render(){return t(o,{key:"4dd5344c568a1b856dd92e13a982d8c2346f32a9"},t("div",{key:"755f6e8625cdafc7b2c861e849a0434f6b104a4a",class:i({roundedBottom:this.roundedBottom,roundedTop:this.roundedTop})},t("slot",{key:"a10c0615d4f3246cff520e87a1e82dff4f177aec"})))}};s.style="*{box-sizing:border-box}.static{position:static}.-mt-px{margin-top:-1px}.rounded{border-radius:.25rem}.rounded-b-none{border-bottom-left-radius:0;border-bottom-right-radius:0}.rounded-t-lg{border-top-left-radius:.5rem;border-top-right-radius:.5rem}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.p-4{padding:1rem}.pb-4{padding-bottom:1rem}.pb-\\[calc\\(env\\(safe-area-inset-bottom\\)\\+1rem\\)\\]{padding-bottom:calc(env(safe-area-inset-bottom) + 1rem)}@media (min-width:64rem){.desktop-xs\\:rounded-b-2xl{border-bottom-left-radius:1rem;border-bottom-right-radius:1rem}.desktop-xs\\:rounded-t-2xl{border-top-left-radius:1rem;border-top-right-radius:1rem}}.dark\\:bg-hurricane-600:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-bg-opacity:1;background-color:rgb(46 52 62/var(--tw-bg-opacity,1))}.dark\\:bg-hurricane-600:where([data-theme=dark],[data-theme=dark] *){--tw-bg-opacity:1;background-color:rgb(46 52 62/var(--tw-bg-opacity,1))}";const m=r(["flex-1 min-w-0 w-full","z-modal flex flex-col","rounded-b-none rounded-t-2xl desktop-xs:rounded-b-2xl","max-h-[calc(100dvh-4rem)]","shadow-modal","dark:border-hurricane-400 dark:border dark:border-solid"],{variants:{size:{xs:"tablet:max-w-[20rem]",base:"tablet:max-w-[35rem]",lg:"tablet:max-w-[41rem]",xl:"tablet:max-w-[45rem]","2xl":"tablet:max-w-[65rem]"},closing:{false:"animate-slide-in-bottom desktop-xs:animate-slide-in-bottom-small",true:"animate-slide-out-bottom desktop-xs:animate-slide-out-bottom-small pointer-events-none"}}}),n=class{constructor(t){e(this,t)}size="base";closing=!1;render(){return t(o,{key:"918f998bf6ff9f8aa64a323ef7e9208a6205467e"},t("div",{key:"531c0bc3232ff4f1bb795cc8a9c3c469b5c4a2f7",class:m({size:this.size,closing:d(this.closing)})},t("slot",{key:"fa2d654b38a33243cc1d437009caee6f262e88a8"})))}};n.style=".flex{display:flex}.w-full{width:100%}.justify-center{justify-content:center}*{box-sizing:border-box}:host{display:flex;justify-content:center;width:100%}@media (min-width:64rem){:host{margin:auto}}.pointer-events-none{pointer-events:none}.static{position:static}.z-modal{z-index:600}.max-h-\\[calc\\(100dvh-4rem\\)\\]{max-height:calc(100dvh - 4rem)}.min-w-0{min-width:0}.flex-1{flex:1 1 0%}@keyframes slideInBottom{0%{transform:translateY(100%)}to{transform:translateY(0)}}.animate-slide-in-bottom{animation:slideInBottom .5s ease forwards}@keyframes slideOutBottom{0%{transform:translateY(0)}to{transform:translateY(100%)}}.animate-slide-out-bottom{animation:slideOutBottom .5s ease forwards}.flex-col{flex-direction:column}.rounded-b-none{border-bottom-left-radius:0;border-bottom-right-radius:0}.rounded-t-2xl{border-top-left-radius:1rem;border-top-right-radius:1rem}.shadow-modal{--tw-shadow:0 0 0 1px rgba(0,2,2,.1),0 1px 1px 0 rgba(0,2,2,.2),0 2px 2px 0 rgba(0,2,2,.08),0 4px 4px 0 rgba(0,2,2,.08),0 8px 8px 0 rgba(0,2,2,.08);--tw-shadow-colored:0 0 0 1px var(--tw-shadow-color),0 1px 1px 0 var(--tw-shadow-color),0 2px 2px 0 var(--tw-shadow-color),0 4px 4px 0 var(--tw-shadow-color),0 8px 8px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:85.375rem){.container{max-width:85.375rem}}@media (min-width:90rem){.container{max-width:90rem}}@media (min-width:96rem){.container{max-width:96rem}}@media (min-width:105rem){.container{max-width:105rem}}@media (min-width:120rem){.container{max-width:120rem}}@media (min-width:160rem){.container{max-width:160rem}}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}@media (min-width:40rem){.tablet\\:max-w-\\[20rem\\]{max-width:20rem}.tablet\\:max-w-\\[35rem\\]{max-width:35rem}.tablet\\:max-w-\\[41rem\\]{max-width:41rem}.tablet\\:max-w-\\[45rem\\]{max-width:45rem}.tablet\\:max-w-\\[65rem\\]{max-width:65rem}}@media (min-width:64rem){@keyframes slideInBottomSmall{0%{transform:translateY(20%)}to{transform:translateY(0)}}.desktop-xs\\:animate-slide-in-bottom-small{animation:slideInBottomSmall .5s ease forwards}@keyframes slideOutBottomSmall{0%{transform:translateY(0)}to{transform:translateY(20%)}}.desktop-xs\\:animate-slide-out-bottom-small{animation:slideOutBottomSmall .5s ease forwards}.desktop-xs\\:rounded-b-2xl{border-bottom-left-radius:1rem;border-bottom-right-radius:1rem}}.dark\\:border:where(:host([data-theme=dark]),:host([data-theme=dark]) *){border-width:1px}.dark\\:border-solid:where(:host([data-theme=dark]),:host([data-theme=dark]) *){border-style:solid}.dark\\:border-hurricane-400:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-border-opacity:1;border-color:rgb(70 75 84/var(--tw-border-opacity,1))}.dark\\:border:where([data-theme=dark],[data-theme=dark] *){border-width:1px}.dark\\:border-solid:where([data-theme=dark],[data-theme=dark] *){border-style:solid}.dark\\:border-hurricane-400:where([data-theme=dark],[data-theme=dark] *){--tw-border-opacity:1;border-color:rgb(70 75 84/var(--tw-border-opacity,1))}";const l=class{constructor(t){e(this,t)}render(){return t(o,{key:"db7731369d6e62f4e6cd9a45d49202c1d9600284"},t("div",{key:"28bba6b89dcfeaa6d91e295575f8559a82bcb17c",class:"flex flex-col rounded-b-none bg-white px-4 pb-[calc(env(safe-area-inset-bottom)+1rem)] desktop-xs:rounded-b-2xl dark:bg-hurricane-600"},t("p-divider",{key:"d6449db5feef9f6553399b7ca8476fdaa8e38ebe",class:"mb-4 hidden text-off-white-700 desktop-xs:inline-block dark:text-white/10"}),t("div",{key:"ad7ba6598fc59911c04089471c03297de2f03c1f",class:"flex flex-col gap-4 tablet:flex-row"},t("slot",{key:"dddec1e9fd3580b37b08b5f988d4f7efae24eeca"}))))}};l.style="*{box-sizing:border-box}.static{position:static}.mb-4{margin-bottom:1rem}.flex{display:flex}.hidden{display:none}.flex-col{flex-direction:column}.gap-4{gap:1rem}.rounded-b-none{border-bottom-left-radius:0;border-bottom-right-radius:0}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.px-4{padding-left:1rem;padding-right:1rem}.pb-\\[calc\\(env\\(safe-area-inset-bottom\\)\\+1rem\\)\\]{padding-bottom:calc(env(safe-area-inset-bottom) + 1rem)}.text-off-white-700{--tw-text-opacity:1;color:rgb(222 219 213/var(--tw-text-opacity,1))}@media (min-width:40rem){.tablet\\:flex-row{flex-direction:row}}@media (min-width:64rem){.desktop-xs\\:inline-block{display:inline-block}.desktop-xs\\:rounded-b-2xl{border-bottom-left-radius:1rem;border-bottom-right-radius:1rem}}.dark\\:bg-hurricane-600:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-bg-opacity:1;background-color:rgb(46 52 62/var(--tw-bg-opacity,1))}.dark\\:text-white\\/10:where(:host([data-theme=dark]),:host([data-theme=dark]) *){color:hsla(0,0%,100%,.1)}.dark\\:bg-hurricane-600:where([data-theme=dark],[data-theme=dark] *){--tw-bg-opacity:1;background-color:rgb(46 52 62/var(--tw-bg-opacity,1))}.dark\\:text-white\\/10:where([data-theme=dark],[data-theme=dark] *){color:hsla(0,0%,100%,.1)}";const c=r(["w-full flex-col bg-white dark:bg-hurricane-600 relative rounded-t-2xl overflow-hidden z-[1]","inline-flex aspect-[7/1] max-h-28"]),b=r(["flex justify-end","w-full p-4 pb-0 h-12"]),h=r(["flex-1 text-center","w-[calc(100%-7rem)]","absolute top-1/2 -translate-y-1/2 left-1/2 -translate-x-1/2","text-storm-500 dark:text-white text-2xl text-ambit font-bold"]),x=class{constructor(t){e(this,t),this.close=a(this,"close",3)}showClose=!0;close;render(){return t(o,{key:"61310ca15062863fa75788e8621c845829835a83"},t("div",{key:"45d347c0906fb178470a22ee073f78d2c83a625d",class:c()},t("div",{key:"cd7903f26712a92149166a9016f397701c216ee3",class:b()},t("div",{key:"e1aa409159b2c19f97682ba5de0ebcdbca799e7a",class:h()},t("slot",{key:"605016d68fa57dde900543c0cee048f078613fa7"})),this.showClose&&t("p-button",{key:"885ebd89b2f63609e658debad4137df0dfb03b8c",icon:"negative",iconOnly:!0,variant:"secondary",onClick:e=>this.close.emit(e)})),t("p-smile",{key:"f461107c6a15c7c58e5944b0b19e54ff0ce88305",class:"dark:text-hurricane-400"})))}};x.style="*{box-sizing:border-box}.static{position:static}.absolute{position:absolute}.relative{position:relative}.left-1\\/2{left:50%}.top-1\\/2{top:50%}.z-\\[1\\]{z-index:1}.flex{display:flex}.inline-flex{display:inline-flex}.aspect-\\[7\\/1\\]{aspect-ratio:7/1}.h-12{height:3rem}.max-h-28{max-height:7rem}.w-\\[calc\\(100\\%-7rem\\)\\]{width:calc(100% - 7rem)}.w-full{width:100%}.flex-1{flex:1 1 0%}.-translate-x-1\\/2{--tw-translate-x:-50%}.-translate-x-1\\/2,.-translate-y-1\\/2{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\\/2{--tw-translate-y:-50%}.flex-col{flex-direction:column}.justify-end{justify-content:flex-end}.overflow-hidden{overflow:hidden}.rounded-t-2xl{border-top-left-radius:1rem;border-top-right-radius:1rem}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.p-4{padding:1rem}.pb-0{padding-bottom:0}.text-center{text-align:center}.text-2xl{font-size:1.5rem;line-height:2rem}.font-bold{font-weight:700}.text-storm-500{--tw-text-opacity:1;color:rgb(24 30 41/var(--tw-text-opacity,1))}.dark\\:bg-hurricane-600:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-bg-opacity:1;background-color:rgb(46 52 62/var(--tw-bg-opacity,1))}.dark\\:text-hurricane-400:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(70 75 84/var(--tw-text-opacity,1))}.dark\\:text-white:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.dark\\:bg-hurricane-600:where([data-theme=dark],[data-theme=dark] *){--tw-bg-opacity:1;background-color:rgb(46 52 62/var(--tw-bg-opacity,1))}.dark\\:text-hurricane-400:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(70 75 84/var(--tw-text-opacity,1))}.dark\\:text-white:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}";export{s as p_modal_body,n as p_modal_container,l as p_modal_footer,x as p_modal_header}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,a as e,d as a,h as r}from"./p-UEOqFwec.js";import{a as i,c as o,o as s,f as h,s as d}from"./p-CeBIrPPx.js";import{c as n}from"./p-CBWjHURv.js";import{T as c}from"./p-BaOYiNIi.js";import"./p-ChV9xqsO.js";import"./p-Ds4BJt6D.js";const p=n(["inline-block px-2","text-xs","opacity-0 drop-shadow-3 transition-opacity","rounded-lg","z-tooltip","pointer-events-none"],{variants:{variant:{hover:"bg-storm-500 dark:bg-white text-white dark:text-storm-300 py-1 max-w-[14.5rem]",click:"max-w-[18rem]",error:"max-w-full w-full"},strategy:{fixed:"fixed",absolute:"absolute"}},compoundVariants:[{variant:["hover","click"],class:"w-max"},{variant:["click","error"],class:"bg-white dark:bg-hurricane-800 text-storm-300 dark:text-hurricane-200 py-2"}]}),l=class{constructor(a){t(this,a),this.isOpen=e(this,"isOpen",3)}variant="hover";content;placement;offset=8;strategy="absolute";enableUserInput=!0;show=!1;canManuallyClose=!0;isOpen;get _el(){return a(this)}_hasContentSlot=!1;_loaded=!1;_popover;_cleanup;componentWillLoad(){this._hasContentSlot=!!this._el.querySelector(':scope > [slot="content"]')}componentShouldUpdate(){this._update()}disconnectedCallback(){this._cleanup&&(this._cleanup(),this._cleanup=null)}render(){return r(c,{key:"ef3333212b88389556fa76159040a9dd6e0c2e17","data-filled":this.content?.length>0||this._hasContentSlot},r("slot",{key:"095bf08cf3d45b3baaf9921796392b6b51e13719",name:"trigger"}),r("div",{key:"46dcc7888a6c2e66e1e5e7d5a9492f117775be30",class:p({variant:this.variant,strategy:this.strategy}),
|
|
1
|
+
import{r as t,a as e,d as a,h as r}from"./p-UEOqFwec.js";import{a as i,c as o,o as s,f as h,s as d}from"./p-CeBIrPPx.js";import{c as n}from"./p-CBWjHURv.js";import{T as c}from"./p-BaOYiNIi.js";import"./p-ChV9xqsO.js";import"./p-Ds4BJt6D.js";const p=n(["inline-block px-2","text-xs","opacity-0 drop-shadow-3 transition-opacity","rounded-lg","z-tooltip","pointer-events-none"],{variants:{variant:{hover:"bg-storm-500 dark:bg-white text-white dark:text-storm-300 py-1 max-w-[14.5rem]",click:"max-w-[18rem]",error:"max-w-full w-full"},strategy:{fixed:"fixed",absolute:"absolute"}},compoundVariants:[{variant:["hover","click"],class:"w-max"},{variant:["click","error"],class:"bg-white dark:bg-hurricane-800 text-storm-300 dark:text-hurricane-200 py-2"}]}),l=class{constructor(a){t(this,a),this.isOpen=e(this,"isOpen",3)}variant="hover";content;placement;offset=8;strategy="absolute";enableUserInput=!0;show=!1;canManuallyClose=!0;isOpen;get _el(){return a(this)}_hasContentSlot=!1;_loaded=!1;_popover;_cleanup;componentWillLoad(){this._hasContentSlot=!!this._el.querySelector(':scope > [slot="content"]')}componentShouldUpdate(){this._update()}disconnectedCallback(){this._cleanup&&(this._cleanup(),this._cleanup=null)}render(){return r(c,{key:"ef3333212b88389556fa76159040a9dd6e0c2e17","data-filled":this.content?.length>0||this._hasContentSlot},r("slot",{key:"095bf08cf3d45b3baaf9921796392b6b51e13719",name:"trigger"}),r("div",{key:"46dcc7888a6c2e66e1e5e7d5a9492f117775be30",class:p({variant:this.variant,strategy:this.strategy}),"data-placement":this.placement,ref:t=>this._load(t),role:"popover"},r("div",{key:"5651334a58293cf9a6adc96b2d8cb1991691404a",class:"flex gap-2 whitespace-normal"},"error"===this.variant&&r("div",{key:"9db76dfaf31d1acbb72eedd0d90744bf913bb21f",class:"w-[2px] bg-negative-red-500 dark:bg-negative-red-alternative"}),this.content??r("slot",{key:"0bbaa654220dd3b99c26dd787c540a1ca85bd8af",name:"content"}))))}clickHandler(){"hover"!==this.variant&&this.enableUserInput&&this._popover&&(Object.hasOwn(this._popover.dataset,"show")||this._show())}documentClickHandler(){"hover"!==this.variant&&this.canManuallyClose&&!this.show&&this._popover&&Object.hasOwn(this._popover.dataset,"show")&&this._hide()}mouseEnterHandler(){"hover"===this.variant&&this.enableUserInput&&this._show()}mouseLeaveHandler(){!this.show&&"hover"===this.variant&&this.enableUserInput&&this._hide()}onShowChange(t){if(this._popover)return t&&!Object.hasOwn(this._popover.dataset,"show")?this._show():this._hide()}onContentChange(t){!t||t.length>0||this._hide()}_show(){this._loaded&&(this.content?.length||this._hasContentSlot?(this._cleanup=i(this._el,this._popover,(()=>this._update())),this._popover.dataset.show="",this._popover.classList.remove("opacity-0","pointer-events-none"),this._popover.classList.add("opacity-100","pointer-events-auto"),this.isOpen.emit(!0)):Object.hasOwn(this._popover.dataset,"show")&&this._hide())}_hide(){this._loaded&&(this._cleanup&&(this._cleanup(),this._cleanup=null),delete this._popover.dataset.show,this._popover.classList.remove("opacity-100","pointer-events-auto"),this._popover.classList.add("opacity-0","pointer-events-none"),this.isOpen.emit(!1))}_load(t){this._popover=t,t&&(this._update(),this._loaded=!0,this.show&&setTimeout((()=>this._show()),100))}_update(){this._popover&&o(this._el,this._popover,{placement:"error"!==this.variant||this.placement?this.placement??"top":"bottom-start",strategy:this.strategy,middleware:[s(this.offset),h(),d()]}).then((({x:t,y:e,placement:a})=>{this._popover.dataset.placement=a,Object.assign(this._popover.style,{top:`${e}px`,left:`${t}px`})}))}static get watchers(){return{show:[{onShowChange:0}],content:[{onContentChange:0}]}}};l.style=".relative{position:relative}.h-inherit{height:inherit}.w-inherit{width:inherit}*{box-sizing:border-box}:host{height:inherit;max-width:100%;position:relative;width:inherit}:host([data-filled]){cursor:pointer}:host(:not([data-filled])){cursor:auto}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.z-tooltip{z-index:400}.inline-block{display:inline-block}.flex{display:flex}.w-\\[2px\\]{width:2px}.w-full{width:100%}.w-max{width:max-content}.max-w-\\[14\\.5rem\\]{max-width:14.5rem}.max-w-\\[18rem\\]{max-width:18rem}.max-w-full{max-width:100%}.gap-2{gap:.5rem}.whitespace-normal{white-space:normal}.rounded-lg{border-radius:.5rem}.bg-negative-red-500{--tw-bg-opacity:1;background-color:rgb(230 30 30/var(--tw-bg-opacity,1))}.bg-storm-500{--tw-bg-opacity:1;background-color:rgb(24 30 41/var(--tw-bg-opacity,1))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.px-2{padding-left:.5rem;padding-right:.5rem}.py-1{padding-bottom:.25rem;padding-top:.25rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.text-xs{font-size:.75rem;line-height:1rem}.text-storm-300{--tw-text-opacity:1;color:rgb(116 120 127/var(--tw-text-opacity,1))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.opacity-0{opacity:0}.opacity-100{opacity:1}.blur{--tw-blur:blur(8px)}.blur,.drop-shadow-3{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.drop-shadow-3{--tw-drop-shadow:drop-shadow(0 1px 1px rgba(0,2,2,.08)) drop-shadow(0 2px 2px rgba(0,2,2,.08)) drop-shadow(0 4px 4px rgba(0,2,2,.08))}.transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.dark\\:bg-hurricane-800:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-bg-opacity:1;background-color:rgb(24 30 41/var(--tw-bg-opacity,1))}.dark\\:bg-negative-red-alternative:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-bg-opacity:1;background-color:rgb(255 92 92/var(--tw-bg-opacity,1))}.dark\\:bg-white:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.dark\\:text-hurricane-200:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(163 165 169/var(--tw-text-opacity,1))}.dark\\:text-storm-300:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(116 120 127/var(--tw-text-opacity,1))}.dark\\:bg-hurricane-800:where([data-theme=dark],[data-theme=dark] *){--tw-bg-opacity:1;background-color:rgb(24 30 41/var(--tw-bg-opacity,1))}.dark\\:bg-negative-red-alternative:where([data-theme=dark],[data-theme=dark] *){--tw-bg-opacity:1;background-color:rgb(255 92 92/var(--tw-bg-opacity,1))}.dark\\:bg-white:where([data-theme=dark],[data-theme=dark] *){--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.dark\\:text-hurricane-200:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(163 165 169/var(--tw-text-opacity,1))}.dark\\:text-storm-300:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(116 120 127/var(--tw-text-opacity,1))}";export{l as p_tooltip}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import{r as t,a as s,h as i}from"./p-UEOqFwec.js";import{T as e}from"./p-BaOYiNIi.js";import{s as h}from"./p-Ds4BJt6D.js";const n="undefined"!=typeof window&&void 0!==window.document,r=n?window:{},o=!!n&&"ontouchstart"in r.document.documentElement,a=!!n&&"PointerEvent"in r,c="cropper",l=`${c}-canvas`,d=`${c}-crosshair`,u=`${c}-grid`,p=`${c}-handle`,b=`${c}-image`,f=`${c}-selection`,m=`${c}-shade`,g=`${c}-viewer`,w="select",v="move",$="scale",k="rotate",y="transform",x="none",z="n-resize",M="e-resize",C="s-resize",A="w-resize",j="ne-resize",O="nw-resize",S="se-resize",T="sw-resize",E=a?"pointerdown":o?"touchstart":"mousedown",I=a?"pointermove":o?"touchmove":"mousemove",N=a?"pointerup pointercancel":o?"touchend touchcancel":"mouseup",_="error",R="keydown",X="load",Y="wheel",P="action",W="actionend",D="actionstart",L="change",B="transform",U=Number.isNaN||r.isNaN;function F(t){return"number"==typeof t&&!U(t)}function H(t){return F(t)&&t>0&&t<1/0}function q(t){return"object"==typeof t&&null!==t}const{hasOwnProperty:J}=Object.prototype;function K(t){if(!q(t))return!1;try{const{constructor:s}=t,{prototype:i}=s;return s&&i&&J.call(i,"isPrototypeOf")}catch(t){return!1}}function V(t){return"function"==typeof t}function Z(t){return"object"==typeof t&&null!==t&&1===t.nodeType}const G=/([a-z\d])([A-Z])/g;function Q(t){return String(t).replace(G,"$1-$2").toLowerCase()}const tt=/-[A-z\d]/g;function st(t){return t.replace(tt,(t=>t.slice(1).toUpperCase()))}const it=/\s\s*/;function et(t,s,i,e){s.trim().split(it).forEach((s=>{t.removeEventListener(s,i,e)}))}function ht(t,s,i,e){s.trim().split(it).forEach((s=>{t.addEventListener(s,i,e)}))}function nt(t,s,i,e){ht(t,s,i,Object.assign(Object.assign({},e),{once:!0}))}const rt={bubbles:!0,cancelable:!0,composed:!0},ot=Promise.resolve();function at(t){const{documentElement:s}=t.ownerDocument,i=t.getBoundingClientRect();return{left:i.left+(r.pageXOffset-s.clientLeft),top:i.top+(r.pageYOffset-s.clientTop)}}const ct=/deg|g?rad|turn$/i;function lt(t){const s=parseFloat(t)||0;if(0!==s){const[i="rad"]=String(t).match(ct)||[];switch(i.toLowerCase()){case"deg":return s/360*(2*Math.PI);case"grad":return s/400*(2*Math.PI);case"turn":return s*(2*Math.PI)}}return s}const dt="contain";function ut(t,s=dt){const{aspectRatio:i}=t;let{width:e,height:h}=t;const n=H(e),r=H(h);if(n&&r){const t=h*i;s===dt&&t>e||"cover"===s&&t<e?h=e/i:e=h*i}else n?h=e/i:r&&(e=h*i);return{width:e,height:h}}function pt(t,...s){if(0===s.length)return t;const[i,e,h,n,r,o]=t,[a,c,l,d,u,p]=s[0];return pt(t=[i*a+h*c,e*a+n*c,i*l+h*d,e*l+n*d,i*u+h*p+r,e*u+n*p+o],...s.slice(1))}const bt=/left|top|width|height/i,ft="open",mt=new WeakMap,gt=new WeakMap,wt=new Map,vt=r.document&&Array.isArray(r.document.adoptedStyleSheets)&&"replaceSync"in r.CSSStyleSheet.prototype;class $t extends HTMLElement{get $sharedStyle(){return(this.themeColor?`:host{--theme-color: ${this.themeColor};}`:"")+":host([hidden]){display:none!important}"}constructor(){var t,s;super(),this.shadowRootMode=ft,this.slottable=!0;const i=null===(s=null===(t=Object.getPrototypeOf(this))||void 0===t?void 0:t.constructor)||void 0===s?void 0:s.$name;i&&wt.set(i,this.tagName.toLowerCase())}static get observedAttributes(){return["shadow-root-mode","slottable","theme-color"]}attributeChangedCallback(t,s,i){if(Object.is(i,s))return;const e=st(t);let h=i;switch(typeof this[e]){case"boolean":h=null!==i&&"false"!==i;break;case"number":h=Number(i)}switch(this[e]=h,t){case"theme-color":{const t=gt.get(this),s=this.$sharedStyle;t&&s&&(vt?t.replaceSync(s):t.textContent=s);break}}}$propertyChangedCallback(t,s,i){if(!Object.is(i,s))switch(t=Q(t),typeof i){case"boolean":!0===i?this.hasAttribute(t)||this.setAttribute(t,""):this.removeAttribute(t);break;case"number":i=U(i)?"":String(i);default:i?this.getAttribute(t)!==i&&this.setAttribute(t,i):this.removeAttribute(t)}}connectedCallback(){Object.getPrototypeOf(this).constructor.observedAttributes.forEach((t=>{const s=st(t);let i=this[s];(function(t){return void 0===t})(i)||this.$propertyChangedCallback(s,void 0,i),Object.defineProperty(this,s,{enumerable:!0,configurable:!0,get:()=>i,set(t){const e=i;i=t,this.$propertyChangedCallback(s,e,t)}})}));const t=this.attachShadow({mode:this.shadowRootMode||ft});if(this.shadowRoot||mt.set(this,t),gt.set(this,this.$addStyles(this.$sharedStyle)),this.$style&&this.$addStyles(this.$style),this.$template){const s=document.createElement("template");s.innerHTML=this.$template,t.appendChild(s.content)}if(this.slottable){const s=document.createElement("slot");t.appendChild(s)}}disconnectedCallback(){gt.has(this)&>.delete(this),mt.has(this)&&mt.delete(this)}$getTagNameOf(t){var s;return null!==(s=wt.get(t))&&void 0!==s?s:t}$setStyles(t){return Object.keys(t).forEach((s=>{let i=t[s];F(i)&&(i=0!==i&&bt.test(s)?`${i}px`:String(i)),this.style[s]=i})),this}$getShadowRoot(){return this.shadowRoot||mt.get(this)}$addStyles(t){let s;const i=this.$getShadowRoot();return vt?(s=new CSSStyleSheet,s.replaceSync(t),i.adoptedStyleSheets=i.adoptedStyleSheets.concat(s)):(s=document.createElement("style"),s.textContent=t,i.appendChild(s)),s}$emit(t,s,i){return function(t,s,i,e){return t.dispatchEvent(new CustomEvent(s,Object.assign(Object.assign(Object.assign({},rt),{detail:i}),e)))}(this,t,s,i)}$nextTick(t){return function(t,s){return s?ot.then(t?s.bind(t):s):ot}(this,t)}static $define(t,s){q(t)&&(s=t,t=""),t||(t=this.$name||this.name),t=Q(t),n&&r.customElements&&!r.customElements.get(t)&&customElements.define(t,this,s)}}$t.$version="2.0.0";class kt extends $t{constructor(){super(...arguments),this.$onPointerDown=null,this.$onPointerMove=null,this.$onPointerUp=null,this.$onWheel=null,this.$wheeling=!1,this.$pointers=new Map,this.$style=':host{display:block;min-height:100px;min-width:200px;overflow:hidden;position:relative;touch-action:none;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}:host([background]){background-color:#fff;background-image:repeating-linear-gradient(45deg,#ccc 25%,transparent 0,transparent 75%,#ccc 0,#ccc),repeating-linear-gradient(45deg,#ccc 25%,transparent 0,transparent 75%,#ccc 0,#ccc);background-image:repeating-conic-gradient(#ccc 0 25%,#fff 0 50%);background-position:0 0,.5rem .5rem;background-size:1rem 1rem}:host([disabled]){pointer-events:none}:host([disabled]):after{bottom:0;content:"";cursor:not-allowed;display:block;left:0;pointer-events:none;position:absolute;right:0;top:0}',this.$action=x,this.background=!1,this.disabled=!1,this.scaleStep=.1,this.themeColor="#39f"}static get observedAttributes(){return super.observedAttributes.concat(["background","disabled","scale-step"])}connectedCallback(){super.connectedCallback(),this.disabled||this.$bind()}disconnectedCallback(){this.disabled||this.$unbind(),super.disconnectedCallback()}$propertyChangedCallback(t,s,i){Object.is(i,s)||(super.$propertyChangedCallback(t,s,i),"disabled"!==t)||(i?this.$unbind():this.$bind())}$bind(){this.$onPointerDown||(this.$onPointerDown=this.$handlePointerDown.bind(this),ht(this,E,this.$onPointerDown)),this.$onPointerMove||(this.$onPointerMove=this.$handlePointerMove.bind(this),ht(this.ownerDocument,I,this.$onPointerMove)),this.$onPointerUp||(this.$onPointerUp=this.$handlePointerUp.bind(this),ht(this.ownerDocument,N,this.$onPointerUp)),this.$onWheel||(this.$onWheel=this.$handleWheel.bind(this),ht(this,Y,this.$onWheel,{passive:!1,capture:!0}))}$unbind(){this.$onPointerDown&&(et(this,E,this.$onPointerDown),this.$onPointerDown=null),this.$onPointerMove&&(et(this.ownerDocument,I,this.$onPointerMove),this.$onPointerMove=null),this.$onPointerUp&&(et(this.ownerDocument,N,this.$onPointerUp),this.$onPointerUp=null),this.$onWheel&&(et(this,Y,this.$onWheel,{capture:!0}),this.$onWheel=null)}$handlePointerDown(t){const{buttons:s,button:i,type:e}=t;if(this.disabled||("pointerdown"===e&&"mouse"===t.pointerType||"mousedown"===e)&&(F(s)&&1!==s||F(i)&&0!==i||t.ctrlKey))return;const{$pointers:h}=this;let n="";if(t.changedTouches)Array.from(t.changedTouches).forEach((({identifier:t,pageX:s,pageY:i})=>{h.set(t,{startX:s,startY:i,endX:s,endY:i})}));else{const{pointerId:s=0,pageX:i,pageY:e}=t;h.set(s,{startX:i,startY:e,endX:i,endY:e})}h.size>1?n=y:Z(t.target)&&(n=t.target.action||t.target.getAttribute("action")||""),!1!==this.$emit(D,{action:n,relatedEvent:t})&&(t.preventDefault(),this.$action=n,this.style.willChange="transform")}$handlePointerMove(t){const{$action:s,$pointers:i}=this;if(this.disabled||s===x||0===i.size)return;if(!1===this.$emit("actionmove",{action:s,relatedEvent:t}))return;if(t.preventDefault(),t.changedTouches)Array.from(t.changedTouches).forEach((({identifier:t,pageX:s,pageY:e})=>{const h=i.get(t);h&&Object.assign(h,{endX:s,endY:e})}));else{const{pointerId:s=0,pageX:e,pageY:h}=t,n=i.get(s);n&&Object.assign(n,{endX:e,endY:h})}const e={action:s,relatedEvent:t};if(s===y){const s=new Map(i);let h=0,n=0,r=0,o=0,a=t.pageX,c=t.pageY;i.forEach(((t,i)=>{s.delete(i),s.forEach((s=>{let i=s.startX-t.startX,e=s.startY-t.startY,l=s.endX-t.endX,d=s.endY-t.endY,u=0,p=0,b=0,f=0;if(0===i?e<0?b=2*Math.PI:e>0&&(b=Math.PI):i>0?b=Math.PI/2+Math.atan(e/i):i<0&&(b=1.5*Math.PI+Math.atan(e/i)),0===l?d<0?f=2*Math.PI:d>0&&(f=Math.PI):l>0?f=Math.PI/2+Math.atan(d/l):l<0&&(f=1.5*Math.PI+Math.atan(d/l)),f>0||b>0){const i=f-b,e=Math.abs(i);e>h&&(h=e,r=i,a=(t.startX+s.startX)/2,c=(t.startY+s.startY)/2)}if(i=Math.abs(i),e=Math.abs(e),l=Math.abs(l),d=Math.abs(d),i>0&&e>0?u=Math.sqrt(i*i+e*e):i>0?u=i:e>0&&(u=e),l>0&&d>0?p=Math.sqrt(l*l+d*d):l>0?p=l:d>0&&(p=d),u>0&&p>0){const i=(p-u)/u,e=Math.abs(i);e>n&&(n=e,o=i,a=(t.startX+s.startX)/2,c=(t.startY+s.startY)/2)}}))}));const l=h>0,d=n>0;l&&d?(e.rotate=r,e.scale=o,e.centerX=a,e.centerY=c):l?(e.action=k,e.rotate=r,e.centerX=a,e.centerY=c):d?(e.action=$,e.scale=o,e.centerX=a,e.centerY=c):e.action=x}else{const[t]=Array.from(i.values());Object.assign(e,t)}i.forEach((t=>{t.startX=t.endX,t.startY=t.endY})),e.action!==x&&this.$emit(P,e,{cancelable:!1})}$handlePointerUp(t){const{$action:s,$pointers:i}=this;if(!this.disabled&&s!==x&&!1!==this.$emit(W,{action:s,relatedEvent:t})){if(t.preventDefault(),t.changedTouches)Array.from(t.changedTouches).forEach((({identifier:t})=>{i.delete(t)}));else{const{pointerId:s=0}=t;i.delete(s)}0===i.size&&(this.style.willChange="",this.$action=x)}}$handleWheel(t){this.disabled||(t.preventDefault(),this.$wheeling||(this.$wheeling=!0,setTimeout((()=>{this.$wheeling=!1}),50),this.$emit(P,{action:$,scale:(t.deltaY>0?-1:1)*this.scaleStep,relatedEvent:t},{cancelable:!1})))}$setAction(t){return"string"==typeof t&&(this.$action=t),this}$toCanvas(t){return new Promise(((s,i)=>{if(!this.isConnected)return void i(new Error("The current element is not connected to the DOM."));const e=document.createElement("canvas");let h=this.offsetWidth,n=this.offsetHeight,r=1;K(t)&&(H(t.width)||H(t.height))&&(({width:h,height:n}=ut({aspectRatio:h/n,width:t.width,height:t.height})),r=h/this.offsetWidth),e.width=h,e.height=n;const o=this.querySelector(this.$getTagNameOf(b));o?o.$ready().then((i=>{const a=e.getContext("2d");if(a){const[s,c,l,d,u,p]=o.$getTransform();let b=u,f=p,m=i.naturalWidth,g=i.naturalHeight;1!==r&&(b*=r,f*=r,m*=r,g*=r);const w=m/2,v=g/2;a.fillStyle="transparent",a.fillRect(0,0,h,n),K(t)&&V(t.beforeDraw)&&t.beforeDraw.call(this,a,e),a.save(),a.translate(w,v),a.transform(s,c,l,d,b,f),a.translate(-w,-v),a.drawImage(i,0,0,m,g),a.restore()}s(e)})).catch(i):s(e)}))}}kt.$name=l,kt.$version="2.0.0";const yt=new WeakMap,xt=["alt","crossorigin","decoding","importance","loading","referrerpolicy","sizes","src","srcset"];class zt extends $t{constructor(){super(...arguments),this.$matrix=[1,0,0,1,0,0],this.$onLoad=null,this.$onCanvasAction=null,this.$onCanvasActionEnd=null,this.$onCanvasActionStart=null,this.$actionStartTarget=null,this.$style=":host{display:inline-block}img{display:block;height:100%;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;width:100%}",this.$image=new Image,this.initialCenterSize="contain",this.rotatable=!1,this.scalable=!1,this.skewable=!1,this.slottable=!1,this.translatable=!1}set $canvas(t){yt.set(this,t)}get $canvas(){return yt.get(this)}static get observedAttributes(){return super.observedAttributes.concat(xt,["initial-center-size","rotatable","scalable","skewable","translatable"])}attributeChangedCallback(t,s,i){Object.is(i,s)||(super.attributeChangedCallback(t,s,i),xt.includes(t)&&this.$image.setAttribute(t,i))}$propertyChangedCallback(t,s,i){Object.is(i,s)||(super.$propertyChangedCallback(t,s,i),"initialCenterSize"!==t)||this.$nextTick((()=>{this.$center(i)}))}connectedCallback(){super.connectedCallback();const{$image:t}=this,s=this.closest(this.$getTagNameOf(l));s&&(this.$canvas=s,this.$setStyles({display:"block",position:"absolute"}),this.$onCanvasActionStart=t=>{var s,i;this.$actionStartTarget=null===(i=null===(s=t.detail)||void 0===s?void 0:s.relatedEvent)||void 0===i?void 0:i.target},this.$onCanvasActionEnd=()=>{this.$actionStartTarget=null},this.$onCanvasAction=this.$handleAction.bind(this),ht(s,D,this.$onCanvasActionStart),ht(s,W,this.$onCanvasActionEnd),ht(s,P,this.$onCanvasAction)),this.$onLoad=this.$handleLoad.bind(this),ht(t,X,this.$onLoad),this.$getShadowRoot().appendChild(t)}disconnectedCallback(){const{$image:t,$canvas:s}=this;s&&(this.$onCanvasActionStart&&(et(s,D,this.$onCanvasActionStart),this.$onCanvasActionStart=null),this.$onCanvasActionEnd&&(et(s,W,this.$onCanvasActionEnd),this.$onCanvasActionEnd=null),this.$onCanvasAction&&(et(s,P,this.$onCanvasAction),this.$onCanvasAction=null)),t&&this.$onLoad&&(et(t,X,this.$onLoad),this.$onLoad=null),this.$getShadowRoot().removeChild(t),super.disconnectedCallback()}$handleLoad(){const{$image:t}=this;this.$setStyles({width:t.naturalWidth,height:t.naturalHeight}),this.$canvas&&this.$center(this.initialCenterSize)}$handleAction(t){if(this.hidden||!(this.rotatable||this.scalable||this.translatable))return;const{$canvas:s}=this,{detail:i}=t;if(i){const{relatedEvent:t}=i;let{action:e}=i;switch(e!==y||this.rotatable&&this.scalable||(e=this.rotatable?k:this.scalable?$:x),e){case v:if(this.translatable){let e=null;t&&(e=t.target.closest(this.$getTagNameOf(f))),e||(e=s.querySelector(this.$getTagNameOf(f))),e&&e.multiple&&!e.active&&(e=s.querySelector(`${this.$getTagNameOf(f)}[active]`)),e&&!e.hidden&&e.movable&&!e.dynamic&&this.$actionStartTarget&&e.contains(this.$actionStartTarget)||this.$move(i.endX-i.startX,i.endY-i.startY)}break;case k:if(this.rotatable)if(t){const{x:s,y:e}=this.getBoundingClientRect();this.$rotate(i.rotate,t.clientX-s,t.clientY-e)}else this.$rotate(i.rotate);break;case $:if(this.scalable)if(t){const s=t.target.closest(this.$getTagNameOf(f));if(!s||!s.zoomable||s.zoomable&&s.dynamic){const{x:s,y:e}=this.getBoundingClientRect();this.$zoom(i.scale,t.clientX-s,t.clientY-e)}}else this.$zoom(i.scale);break;case y:if(this.rotatable&&this.scalable){const{rotate:s}=i;let{scale:e}=i;e<0?e=1/(1-e):e+=1;const h=Math.cos(s),n=Math.sin(s),[r,o,a,c]=[h*e,n*e,-n*e,h*e];if(t){const s=this.getBoundingClientRect(),i=t.clientX-s.x,e=t.clientY-s.y,[h,n,l,d]=this.$matrix,u=i-s.width/2,p=e-s.height/2,b=(u*d-l*p)/(h*d-l*n),f=(p*h-n*u)/(h*d-l*n);this.$transform(r,o,a,c,b*(1-r)+f*a,f*(1-c)+b*o)}else this.$transform(r,o,a,c,0,0)}}}}$ready(t){const{$image:s}=this,i=new Promise(((t,i)=>{const e=new Error("Failed to load the image source");if(s.complete)s.naturalWidth>0&&s.naturalHeight>0?t(s):i(e);else{const h=()=>{et(s,_,n),t(s)},n=()=>{et(s,X,h),i(e)};nt(s,X,h),nt(s,_,n)}}));return V(t)&&i.then((s=>(t(s),s))),i}$center(t){const{parentElement:s}=this;if(!s)return this;const i=s.getBoundingClientRect(),e=i.width,h=i.height,{x:n,y:r,width:o,height:a}=this.getBoundingClientRect();if(this.$move(i.x+e/2-(n+o/2),i.y+h/2-(r+a/2)),t&&(o!==e||a!==h)){const s=e/o,i=h/a;switch(t){case"cover":this.$scale(Math.max(s,i));break;case"contain":this.$scale(Math.min(s,i))}}return this}$move(t,s=t){if(this.translatable&&F(t)&&F(s)){const[i,e,h,n]=this.$matrix;this.$translate((t*n-h*s)/(i*n-h*e),(s*i-e*t)/(i*n-h*e))}return this}$moveTo(t,s=t){if(this.translatable&&F(t)&&F(s)){const[i,e,h,n]=this.$matrix;this.$setTransform(i,e,h,n,(t*n-h*s)/(i*n-h*e),(s*i-e*t)/(i*n-h*e))}return this}$rotate(t,s,i){if(this.rotatable){const e=lt(t),h=Math.cos(e),n=Math.sin(e),[r,o,a,c]=[h,n,-n,h];if(F(s)&&F(i)){const[t,e,h,n]=this.$matrix,{width:l,height:d}=this.getBoundingClientRect(),u=s-l/2,p=i-d/2,b=(u*n-h*p)/(t*n-h*e),f=(p*t-e*u)/(t*n-h*e);this.$transform(r,o,a,c,b*(1-r)-f*a,f*(1-c)-b*o)}else this.$transform(r,o,a,c,0,0)}return this}$zoom(t,s,i){if(!this.scalable||0===t)return this;if(t<0?t=1/(1-t):t+=1,F(s)&&F(i)){const[e,h,n,r]=this.$matrix,{width:o,height:a}=this.getBoundingClientRect(),c=s-o/2,l=i-a/2;this.$transform(t,0,0,t,(c*r-n*l)/(e*r-n*h)*(1-t),(l*e-h*c)/(e*r-n*h)*(1-t))}else this.$scale(t);return this}$scale(t,s=t){return this.scalable&&this.$transform(t,0,0,s,0,0),this}$skew(t,s=0){if(this.skewable){const i=lt(t),e=lt(s);this.$transform(1,Math.tan(e),Math.tan(i),1,0,0)}return this}$translate(t,s=t){return this.translatable&&F(t)&&F(s)&&this.$transform(1,0,0,1,t,s),this}$transform(t,s,i,e,h,n){return F(t)&&F(s)&&F(i)&&F(e)&&F(h)&&F(n)?this.$setTransform(pt(this.$matrix,[t,s,i,e,h,n])):this}$setTransform(t,s,i,e,h,n){if((this.rotatable||this.scalable||this.skewable||this.translatable)&&(Array.isArray(t)&&([t,s,i,e,h,n]=t),F(t)&&F(s)&&F(i)&&F(e)&&F(h)&&F(n))){const r=[...this.$matrix],o=[t,s,i,e,h,n];if(!1===this.$emit(B,{matrix:o,oldMatrix:r}))return this;this.$matrix=o,this.style.transform=`matrix(${o.join(", ")})`}return this}$getTransform(){return this.$matrix.slice()}$resetTransform(){return this.$setTransform([1,0,0,1,0,0])}}zt.$name=b,zt.$version="2.0.0";const Mt=new WeakMap;class Ct extends $t{constructor(){super(...arguments),this.$onCanvasChange=null,this.$onCanvasActionEnd=null,this.$onCanvasActionStart=null,this.$style=":host{display:block;height:0;left:0;outline:var(--theme-color) solid 1px;position:relative;top:0;width:0}:host([transparent]){outline-color:transparent}",this.x=0,this.y=0,this.width=0,this.height=0,this.slottable=!1,this.themeColor="rgba(0, 0, 0, 0.65)"}set $canvas(t){Mt.set(this,t)}get $canvas(){return Mt.get(this)}static get observedAttributes(){return super.observedAttributes.concat(["height","width","x","y"])}connectedCallback(){super.connectedCallback();const t=this.closest(this.$getTagNameOf(l));if(t){this.$canvas=t,this.style.position="absolute";const s=t.querySelector(this.$getTagNameOf(f));s&&(this.$onCanvasActionStart=t=>{s.hidden&&t.detail.action===w&&(this.hidden=!1)},this.$onCanvasActionEnd=t=>{s.hidden&&t.detail.action===w&&(this.hidden=!0)},this.$onCanvasChange=t=>{const{x:i,y:e,width:h,height:n}=t.detail;this.$change(i,e,h,n),(s.hidden||0===i&&0===e&&0===h&&0===n)&&(this.hidden=!0)},ht(t,D,this.$onCanvasActionStart),ht(t,W,this.$onCanvasActionEnd),ht(t,L,this.$onCanvasChange))}this.$render()}disconnectedCallback(){const{$canvas:t}=this;t&&(this.$onCanvasActionStart&&(et(t,D,this.$onCanvasActionStart),this.$onCanvasActionStart=null),this.$onCanvasActionEnd&&(et(t,W,this.$onCanvasActionEnd),this.$onCanvasActionEnd=null),this.$onCanvasChange&&(et(t,L,this.$onCanvasChange),this.$onCanvasChange=null)),super.disconnectedCallback()}$change(t,s,i=this.width,e=this.height){return F(t)&&F(s)&&F(i)&&F(e)&&(t!==this.x||s!==this.y||i!==this.width||e!==this.height)?(this.hidden&&(this.hidden=!1),this.x=t,this.y=s,this.width=i,this.height=e,this.$render()):this}$reset(){return this.$change(0,0,0,0)}$render(){return this.$setStyles({transform:`translate(${this.x}px, ${this.y}px)`,width:this.width,height:this.height,outlineWidth:r.innerWidth})}}Ct.$name=m,Ct.$version="2.0.0";class At extends $t{constructor(){super(...arguments),this.$onCanvasCropEnd=null,this.$onCanvasCropStart=null,this.$style=':host{background-color:var(--theme-color);display:block}:host([action=move]),:host([action=select]){height:100%;left:0;position:absolute;top:0;width:100%}:host([action=move]){cursor:move}:host([action=select]){cursor:crosshair}:host([action$=-resize]){background-color:transparent;height:15px;position:absolute;width:15px}:host([action$=-resize]):after{background-color:var(--theme-color);content:"";display:block;height:5px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:5px}:host([action=n-resize]),:host([action=s-resize]){cursor:ns-resize;left:50%;transform:translateX(-50%);width:100%}:host([action=n-resize]){top:-8px}:host([action=s-resize]){bottom:-8px}:host([action=e-resize]),:host([action=w-resize]){cursor:ew-resize;height:100%;top:50%;transform:translateY(-50%)}:host([action=e-resize]){right:-8px}:host([action=w-resize]){left:-8px}:host([action=ne-resize]){cursor:nesw-resize;right:-8px;top:-8px}:host([action=nw-resize]){cursor:nwse-resize;left:-8px;top:-8px}:host([action=se-resize]){bottom:-8px;cursor:nwse-resize;right:-8px}:host([action=se-resize]):after{height:15px;width:15px}@media (pointer:coarse){:host([action=se-resize]):after{height:10px;width:10px}}@media (pointer:fine){:host([action=se-resize]):after{height:5px;width:5px}}:host([action=sw-resize]){bottom:-8px;cursor:nesw-resize;left:-8px}:host([plain]){background-color:transparent}',this.action=x,this.plain=!1,this.slottable=!1,this.themeColor="rgba(51, 153, 255, 0.5)"}static get observedAttributes(){return super.observedAttributes.concat(["action","plain"])}}At.$name=p,At.$version="2.0.0";const jt=new WeakMap;class Ot extends $t{constructor(){super(...arguments),this.$onCanvasAction=null,this.$onCanvasActionStart=null,this.$onCanvasActionEnd=null,this.$onDocumentKeyDown=null,this.$action="",this.$actionStartTarget=null,this.$changing=!1,this.$style=':host{display:block;left:0;position:relative;right:0}:host([outlined]){outline:1px solid var(--theme-color)}:host([multiple]){outline:1px dashed hsla(0,0%,100%,.5)}:host([multiple]):after{bottom:0;content:"";cursor:pointer;display:block;left:0;position:absolute;right:0;top:0}:host([multiple][active]){outline-color:var(--theme-color);z-index:1}:host([multiple])>*{visibility:hidden}:host([multiple][active])>*{visibility:visible}:host([multiple][active]):after{display:none}',this.$initialSelection={x:0,y:0,width:0,height:0},this.x=0,this.y=0,this.width=0,this.height=0,this.aspectRatio=NaN,this.initialAspectRatio=NaN,this.initialCoverage=NaN,this.active=!1,this.linked=!1,this.dynamic=!1,this.movable=!1,this.resizable=!1,this.zoomable=!1,this.multiple=!1,this.keyboard=!1,this.outlined=!1,this.precise=!1}set $canvas(t){jt.set(this,t)}get $canvas(){return jt.get(this)}static get observedAttributes(){return super.observedAttributes.concat(["active","aspect-ratio","dynamic","height","initial-aspect-ratio","initial-coverage","keyboard","linked","movable","multiple","outlined","precise","resizable","width","x","y","zoomable"])}$propertyChangedCallback(t,s,i){if(!Object.is(i,s))switch(super.$propertyChangedCallback(t,s,i),t){case"x":case"y":case"width":case"height":this.$changing||this.$nextTick((()=>{this.$change(this.x,this.y,this.width,this.height,this.aspectRatio,!0)}));break;case"aspectRatio":case"initialAspectRatio":this.$nextTick((()=>{this.$initSelection()}));break;case"initialCoverage":this.$nextTick((()=>{H(i)&&i<=1&&this.$initSelection(!0,!0)}));break;case"keyboard":this.$nextTick((()=>{this.$canvas&&(i?this.$onDocumentKeyDown||(this.$onDocumentKeyDown=this.$handleKeyDown.bind(this),ht(this.ownerDocument,R,this.$onDocumentKeyDown)):this.$onDocumentKeyDown&&(et(this.ownerDocument,R,this.$onDocumentKeyDown),this.$onDocumentKeyDown=null))}));break;case"multiple":this.$nextTick((()=>{if(this.$canvas){const t=this.$getSelections();i?(t.forEach((t=>{t.active=!1})),this.active=!0,this.$emit(L,{x:this.x,y:this.y,width:this.width,height:this.height})):(this.active=!1,t.slice(1).forEach((t=>{this.$removeSelection(t)})))}}));break;case"precise":this.$nextTick((()=>{this.$change(this.x,this.y)}));break;case"linked":i&&(this.dynamic=!0)}}connectedCallback(){super.connectedCallback();const t=this.closest(this.$getTagNameOf(l));t?(this.$canvas=t,this.$setStyles({position:"absolute",transform:`translate(${this.x}px, ${this.y}px)`}),this.hidden||this.$render(),this.$initSelection(!0),this.$onCanvasActionStart=this.$handleActionStart.bind(this),this.$onCanvasActionEnd=this.$handleActionEnd.bind(this),this.$onCanvasAction=this.$handleAction.bind(this),ht(t,D,this.$onCanvasActionStart),ht(t,W,this.$onCanvasActionEnd),ht(t,P,this.$onCanvasAction)):this.$render()}disconnectedCallback(){const{$canvas:t}=this;t&&(this.$onCanvasActionStart&&(et(t,D,this.$onCanvasActionStart),this.$onCanvasActionStart=null),this.$onCanvasActionEnd&&(et(t,W,this.$onCanvasActionEnd),this.$onCanvasActionEnd=null),this.$onCanvasAction&&(et(t,P,this.$onCanvasAction),this.$onCanvasAction=null)),super.disconnectedCallback()}$getSelections(){let t=[];return this.parentElement&&(t=Array.from(this.parentElement.querySelectorAll(this.$getTagNameOf(f)))),t}$initSelection(t=!1,s=!1){const{initialCoverage:i,parentElement:e}=this;if(H(i)&&e){const h=this.aspectRatio||this.initialAspectRatio;let n=(s?0:this.width)||e.offsetWidth*i,r=(s?0:this.height)||e.offsetHeight*i;H(h)&&({width:n,height:r}=ut({aspectRatio:h,width:n,height:r})),this.$change(this.x,this.y,n,r),t&&this.$center(),this.$initialSelection={x:this.x,y:this.y,width:this.width,height:this.height}}}$createSelection(){const t=this.cloneNode(!0);return this.hasAttribute("id")&&t.removeAttribute("id"),t.initialCoverage=NaN,this.active=!1,this.parentElement&&this.parentElement.insertBefore(t,this.nextSibling),t}$removeSelection(t=this){if(this.parentElement){const s=this.$getSelections();if(s.length>1){const i=s.indexOf(t),e=s[i+1]||s[i-1];e&&(t.active=!1,this.parentElement.removeChild(t),e.active=!0,e.$emit(L,{x:e.x,y:e.y,width:e.width,height:e.height}))}else this.$clear()}}$handleActionStart(t){var s,i;const e=null===(i=null===(s=t.detail)||void 0===s?void 0:s.relatedEvent)||void 0===i?void 0:i.target;this.$action="",this.$actionStartTarget=e,!this.hidden&&this.multiple&&!this.active&&e===this&&this.parentElement&&(this.$getSelections().forEach((t=>{t.active=!1})),this.active=!0,this.$emit(L,{x:this.x,y:this.y,width:this.width,height:this.height}))}$handleAction(t){const{currentTarget:s,detail:i}=t;if(!s||!i)return;const{relatedEvent:e}=i;let{action:h}=i;if(!h&&this.multiple&&(h=this.$action||(null==e?void 0:e.target.action),this.$action=h),!h||this.hidden&&h!==w||this.multiple&&!this.active&&h!==$)return;const n=i.endX-i.startX,r=i.endY-i.startY,{width:o,height:a}=this;let{aspectRatio:c}=this;switch(!H(c)&&e.shiftKey&&(c=H(o)&&H(a)?o/a:1),h){case w:if(0!==n&&0!==r){const{$canvas:t}=this,e=at(s);(this.multiple&&!this.hidden?this.$createSelection():this).$change(i.startX-e.left,i.startY-e.top,Math.abs(n),Math.abs(r),c),n<0?r<0?h=O:r>0&&(h=T):n>0&&(r<0?h=j:r>0&&(h=S)),t&&(t.$action=h)}break;case v:this.movable&&(this.dynamic||this.$actionStartTarget&&this.contains(this.$actionStartTarget))&&this.$move(n,r);break;case $:if(e&&this.zoomable&&(this.dynamic||this.contains(e.target))){const t=at(s);this.$zoom(i.scale,e.pageX-t.left,e.pageY-t.top)}break;default:this.$resize(h,n,r,c)}}$handleActionEnd(){this.$action="",this.$actionStartTarget=null}$handleKeyDown(t){if(this.hidden||!this.keyboard||this.multiple&&!this.active||t.defaultPrevented)return;const{activeElement:s}=document;if(!s||!["INPUT","TEXTAREA"].includes(s.tagName)&&!["true","plaintext-only"].includes(s.contentEditable))switch(t.key){case"Backspace":t.metaKey&&(t.preventDefault(),this.$removeSelection());break;case"Delete":t.preventDefault(),this.$removeSelection();break;case"ArrowLeft":t.preventDefault(),this.$move(-1,0);break;case"ArrowRight":t.preventDefault(),this.$move(1,0);break;case"ArrowUp":t.preventDefault(),this.$move(0,-1);break;case"ArrowDown":t.preventDefault(),this.$move(0,1);break;case"+":t.preventDefault(),this.$zoom(.1);break;case"-":t.preventDefault(),this.$zoom(-.1)}}$center(){const{parentElement:t}=this;return t?this.$change((t.offsetWidth-this.width)/2,(t.offsetHeight-this.height)/2):this}$move(t,s=t){return this.$moveTo(this.x+t,this.y+s)}$moveTo(t,s=t){return this.movable?this.$change(t,s):this}$resize(t,s=0,i=0,e=this.aspectRatio){if(!this.resizable)return this;const h=H(e),{$canvas:n}=this;let{x:r,y:o,width:a,height:c}=this;switch(t){case z:o+=i,c-=i,c<0&&(t=C,c=-c,o-=c),h&&(r+=(s=i*e)/2,a-=s,a<0&&(a=-a,r-=a));break;case M:a+=s,a<0&&(t=A,a=-a,r-=a),h&&(o-=(i=s/e)/2,c+=i,c<0&&(c=-c,o-=c));break;case C:c+=i,c<0&&(t=z,c=-c,o-=c),h&&(r-=(s=i*e)/2,a+=s,a<0&&(a=-a,r-=a));break;case A:r+=s,a-=s,a<0&&(t=M,a=-a,r-=a),h&&(o+=(i=s/e)/2,c-=i,c<0&&(c=-c,o-=c));break;case j:h&&(i=-s/e),o+=i,c-=i,a+=s,a<0&&c<0?(t=T,a=-a,c=-c,r-=a,o-=c):a<0?(t=O,a=-a,r-=a):c<0&&(t=S,c=-c,o-=c);break;case O:h&&(i=s/e),r+=s,o+=i,a-=s,c-=i,a<0&&c<0?(t=S,a=-a,c=-c,r-=a,o-=c):a<0?(t=j,a=-a,r-=a):c<0&&(t=T,c=-c,o-=c);break;case S:h&&(i=s/e),a+=s,c+=i,a<0&&c<0?(t=O,a=-a,c=-c,r-=a,o-=c):a<0?(t=T,a=-a,r-=a):c<0&&(t=j,c=-c,o-=c);break;case T:h&&(i=-s/e),r+=s,a-=s,c+=i,a<0&&c<0?(t=j,a=-a,c=-c,r-=a,o-=c):a<0?(t=S,a=-a,r-=a):c<0&&(t=O,c=-c,o-=c)}return n&&n.$setAction(t),this.$change(r,o,a,c)}$zoom(t,s,i){if(!this.zoomable||0===t)return this;t<0?t=1/(1-t):t+=1;const{width:e,height:h}=this,n=e*t,r=h*t;let o=this.x,a=this.y;return F(s)&&F(i)?(o-=(s-this.x)/e*(n-e),a-=(i-this.y)/h*(r-h)):(o-=(n-e)/2,a-=(r-h)/2),this.$change(o,a,n,r)}$change(t,s,i=this.width,e=this.height,h=this.aspectRatio,n=!1){return this.$changing||!F(t)||!F(s)||!F(i)||!F(e)||i<0||e<0?this:(H(h)&&({width:i,height:e}=ut({aspectRatio:h,width:i,height:e},"cover")),this.precise||(t=Math.round(t),s=Math.round(s),i=Math.round(i),e=Math.round(e)),t===this.x&&s===this.y&&i===this.width&&e===this.height&&Object.is(h,this.aspectRatio)&&!n?this:(this.hidden&&(this.hidden=!1),!1===this.$emit(L,{x:t,y:s,width:i,height:e})?this:(this.$changing=!0,this.x=t,this.y=s,this.width=i,this.height=e,this.$changing=!1,this.$render())))}$reset(){const{x:t,y:s,width:i,height:e}=this.$initialSelection;return this.$change(t,s,i,e)}$clear(){return this.$change(0,0,0,0,NaN,!0),this.hidden=!0,this}$render(){return this.$setStyles({transform:`translate(${this.x}px, ${this.y}px)`,width:this.width,height:this.height})}$toCanvas(t){return new Promise(((s,i)=>{if(!this.isConnected)return void i(new Error("The current element is not connected to the DOM."));const e=document.createElement("canvas");let{width:h,height:n}=this,r=1;if(K(t)&&(H(t.width)||H(t.height))&&(({width:h,height:n}=ut({aspectRatio:h/n,width:t.width,height:t.height})),r=h/this.width),e.width=h,e.height=n,!this.$canvas)return void s(e);const o=this.$canvas.querySelector(this.$getTagNameOf(b));o?o.$ready().then((i=>{const a=e.getContext("2d");if(a){const[s,c,l,d,u,p]=o.$getTransform(),b=-this.x,f=-this.y,m=(b*d-l*f)/(s*d-l*c),g=(f*s-c*b)/(s*d-l*c);let w=s*m+l*g+u,v=c*m+d*g+p,$=i.naturalWidth,k=i.naturalHeight;1!==r&&(w*=r,v*=r,$*=r,k*=r);const y=$/2,x=k/2;a.fillStyle="transparent",a.fillRect(0,0,h,n),K(t)&&V(t.beforeDraw)&&t.beforeDraw.call(this,a,e),a.save(),a.translate(y,x),a.transform(s,c,l,d,w,v),a.translate(-y,-x),a.drawImage(i,0,0,$,k),a.restore()}s(e)})).catch(i):s(e)}))}}Ot.$name=f,Ot.$version="2.0.0";class St extends $t{constructor(){super(...arguments),this.$style=":host{display:flex;flex-direction:column;position:relative;touch-action:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}:host([bordered]){border:1px dashed var(--theme-color)}:host([covered]){bottom:0;left:0;position:absolute;right:0;top:0}:host>span{display:flex;flex:1}:host>span+span{border-top:1px dashed var(--theme-color)}:host>span>span{flex:1}:host>span>span+span{border-left:1px dashed var(--theme-color)}",this.bordered=!1,this.columns=3,this.covered=!1,this.rows=3,this.slottable=!1,this.themeColor="rgba(238, 238, 238, 0.5)"}static get observedAttributes(){return super.observedAttributes.concat(["bordered","columns","covered","rows"])}$propertyChangedCallback(t,s,i){Object.is(i,s)||(super.$propertyChangedCallback(t,s,i),"rows"!==t&&"columns"!==t||this.$nextTick((()=>{this.$render()})))}connectedCallback(){super.connectedCallback(),this.$render()}$render(){const t=this.$getShadowRoot(),s=document.createDocumentFragment();for(let t=0;t<this.rows;t+=1){const t=document.createElement("span");t.setAttribute("role","row");for(let s=0;s<this.columns;s+=1){const s=document.createElement("span");s.setAttribute("role","gridcell"),t.appendChild(s)}s.appendChild(t)}t&&(t.innerHTML="",t.appendChild(s))}}St.$name=u,St.$version="2.0.0";class Tt extends $t{constructor(){super(...arguments),this.$style=':host{display:inline-block;height:1em;position:relative;touch-action:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle;width:1em}:host:after,:host:before{background-color:var(--theme-color);content:"";display:block;position:absolute}:host:before{height:1px;left:0;top:50%;transform:translateY(-50%);width:100%}:host:after{height:100%;left:50%;top:0;transform:translateX(-50%);width:1px}:host([centered]){left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}',this.centered=!1,this.slottable=!1,this.themeColor="rgba(238, 238, 238, 0.5)"}static get observedAttributes(){return super.observedAttributes.concat(["centered"])}}Tt.$name=d,Tt.$version="2.0.0";const Et=new WeakMap,It=new WeakMap,Nt=new WeakMap,_t=new WeakMap,Rt="vertical";class Xt extends $t{constructor(){super(...arguments),this.$onSelectionChange=null,this.$onSourceImageLoad=null,this.$onSourceImageTransform=null,this.$scale=1,this.$style=":host{display:block;height:100%;overflow:hidden;position:relative;width:100%}",this.resize=Rt,this.selection="",this.slottable=!1}set $image(t){It.set(this,t)}get $image(){return It.get(this)}set $sourceImage(t){_t.set(this,t)}get $sourceImage(){return _t.get(this)}set $canvas(t){Et.set(this,t)}get $canvas(){return Et.get(this)}set $selection(t){Nt.set(this,t)}get $selection(){return Nt.get(this)}static get observedAttributes(){return super.observedAttributes.concat(["resize","selection"])}connectedCallback(){super.connectedCallback();let t=null;if(t=this.selection?this.ownerDocument.querySelector(this.selection):this.closest(this.$getTagNameOf(f)),Z(t)){this.$selection=t,this.$onSelectionChange=this.$handleSelectionChange.bind(this),ht(t,L,this.$onSelectionChange);const s=t.closest(this.$getTagNameOf(l));if(s){this.$canvas=s;const t=s.querySelector(this.$getTagNameOf(b));t&&(this.$sourceImage=t,this.$image=t.cloneNode(!0),this.$getShadowRoot().appendChild(this.$image),this.$onSourceImageLoad=this.$handleSourceImageLoad.bind(this),this.$onSourceImageTransform=this.$handleSourceImageTransform.bind(this),ht(t.$image,X,this.$onSourceImageLoad),ht(t,B,this.$onSourceImageTransform))}this.$render()}}disconnectedCallback(){const{$selection:t,$sourceImage:s}=this;t&&this.$onSelectionChange&&(et(t,L,this.$onSelectionChange),this.$onSelectionChange=null),s&&this.$onSourceImageLoad&&(et(s.$image,X,this.$onSourceImageLoad),this.$onSourceImageLoad=null),s&&this.$onSourceImageTransform&&(et(s,B,this.$onSourceImageTransform),this.$onSourceImageTransform=null),super.disconnectedCallback()}$handleSelectionChange(t){this.$render(t.detail)}$handleSourceImageLoad(){const{$image:t,$sourceImage:s}=this,i=t.getAttribute("src"),e=s.getAttribute("src");e&&e!==i&&(t.setAttribute("src",e),t.$ready((()=>{setTimeout((()=>{this.$render()}),50)})))}$handleSourceImageTransform(t){this.$render(void 0,t.detail.matrix)}$render(t,s){const{$canvas:i,$selection:e}=this;t||e.hidden||(t=e),(!t||0===t.x&&0===t.y&&0===t.width&&0===t.height)&&(t={x:0,y:0,width:i.offsetWidth,height:i.offsetHeight});const{x:h,y:n,width:r,height:o}=t,a={},{clientWidth:c,clientHeight:l}=this;let d=c,u=l,p=NaN;switch(this.resize){case"both":p=1,d=r,u=o,a.width=r,a.height=o;break;case"horizontal":p=o>0?l/o:0,d=r*p,a.width=d;break;case Rt:p=r>0?c/r:0,u=o*p,a.height=u;break;default:c>0?p=r>0?c/r:0:l>0&&(p=o>0?l/o:0)}this.$scale=p,this.$setStyles(a),this.$sourceImage&&this.$transformImageByOffset(null!=s?s:this.$sourceImage.$getTransform(),-h,-n)}$transformImageByOffset(t,s,i){const{$image:e,$scale:h,$sourceImage:n}=this;if(n&&e&&h>=0){const[n,r,o,a,c,l]=t,d=(s*a-o*i)/(n*a-o*r),u=(i*n-r*s)/(n*a-o*r),p=n*d+o*u+c,b=r*d+a*u+l;e.$ready((t=>{this.$setStyles.call(e,{width:t.naturalWidth*h,height:t.naturalHeight*h})})),e.$setTransform(n,r,o,a,p*h,b*h)}}}Xt.$name=g,Xt.$version="2.0.0",
|
|
2
2
|
/*! Cropper.js v2.0.0 | (c) 2015-present Chen Fengyuan | MIT */
|
|
3
|
-
kt.$define(),Tt.$define(),St.$define(),At.$define(),zt.$define(),Ot.$define(),Ct.$define(),Xt.$define();const Yt=class{constructor(i){t(this,i),this.valueChange=s(this,"valueChange",3)}value;returnType="base64";valueChange;_imageRef;_selectionRef;_maxScale=0;_minScale=0;_resizeDebounceTimeout;_toCanvasDebounceTimeout;_loaded=!1;_currentScale=0;onResize(){this._resizeDebounceTimeout&&clearTimeout(this._resizeDebounceTimeout),this._resizeDebounceTimeout=setTimeout((()=>{this._selectionRef.$center(),this._imageRef.$center()}),200)}componentDidLoad(){setTimeout((()=>{this._loaded=!0}),200)}render(){const t="dark"===h.theme?"rgba(70, 75, 84, 0.5)":"rgba(255, 255, 255, 0.5)";return i(e,{key:"dd4ea15cbdfbac6e25202bd1a4871d9635fd33a7"},this._loaded&&i("cropper-canvas",{key:"cb359d80b35eae4aa2e58c75bed8ccd5a15b2df2",class:"h-[17.5rem] w-full border-0 border-b border-solid border-off-white-700 bg-white dark:border-hurricane-200",onAction:()=>this._onAction()},i("cropper-image",{key:"8a96ad1f1f11adc4a8291a1376f329af52c3d920",
|
|
3
|
+
kt.$define(),Tt.$define(),St.$define(),At.$define(),zt.$define(),Ot.$define(),Ct.$define(),Xt.$define();const Yt=class{constructor(i){t(this,i),this.valueChange=s(this,"valueChange",3)}value;returnType="base64";valueChange;_imageRef;_selectionRef;_maxScale=0;_minScale=0;_resizeDebounceTimeout;_toCanvasDebounceTimeout;_loaded=!1;_currentScale=0;onResize(){this._resizeDebounceTimeout&&clearTimeout(this._resizeDebounceTimeout),this._resizeDebounceTimeout=setTimeout((()=>{this._selectionRef.$center(),this._imageRef.$center()}),200)}componentDidLoad(){setTimeout((()=>{this._loaded=!0}),200)}render(){const t="dark"===h.theme?"rgba(70, 75, 84, 0.5)":"rgba(255, 255, 255, 0.5)";return i(e,{key:"dd4ea15cbdfbac6e25202bd1a4871d9635fd33a7"},this._loaded&&i("cropper-canvas",{key:"cb359d80b35eae4aa2e58c75bed8ccd5a15b2df2",class:"h-[17.5rem] w-full border-0 border-b border-solid border-off-white-700 bg-white dark:border-hurricane-200",onAction:()=>this._onAction()},i("cropper-image",{key:"8a96ad1f1f11adc4a8291a1376f329af52c3d920",alt:"Picture",crossorigin:"anonymous",ref:t=>this._setImageRef(t),src:this.value,scalable:!0,translatable:!0}),i("cropper-shade",{key:"1b375fe73b98ec31776ba4762e10781a1c33117b",class:"aspect-branding rounded-full","theme-color":t,hidden:!0}),i("cropper-selection",{key:"ae41c83bf91f714beb89b79998c2636ffe837f51","aspect-ratio":"1","initial-coverage":"0.7",ref:t=>this._selectionRef=t}),i("cropper-handle",{key:"45148a814f6b3d1f04e94c0a8ee756b31d6dc7cb",action:"move",plain:!0})),i("p-range",{key:"b215e5dfc3aea8cae98d85dc590436a52c667c28",class:"w-full px-14 tablet:max-w-xs tablet:px-1",value:this._currentScale,onValueChange:t=>this._onInput(t.detail)}))}_setImageRef(t){!this._imageRef&&t&&(this._imageRef=t,this._imageRef.$ready((t=>setTimeout((()=>this._setInitialState(t)),100))))}_setInitialState(t){let s=200/t.naturalHeight;t.naturalHeight>=t.naturalWidth&&(s=200/t.naturalWidth),this._minScale=s,this._maxScale=5,this._selectionRef.$resize("nw-resize",200,200,1),this._selectionRef.$center(),this._toCanvas(),this._setScale(s)}_onAction(){this._setCurrentScale(),this._toCanvas()}_setScale(t,s=!0,i=!0){const e=this._imageRef.$getTransform();this._imageRef.$setTransform([t,0,0,t,e[4],e[5]]),s&&this._imageRef.$center(),i&&this._setCurrentScale()}_setCurrentScale(){const t=this._imageRef.$getTransform()[0];return t<this._minScale?(this._setScale(this._minScale,!0,!1),void(this._currentScale=0)):t>this._maxScale?(this._setScale(this._maxScale,!0,!1),void(this._currentScale=100)):void(this._currentScale=t!==this._minScale?t!==this._maxScale?(t-this._minScale)/(this._maxScale-this._minScale)*100:100:0)}_onInput(t){const s=this._imageRef.$getTransform(),i=t/100*(this._maxScale-this._minScale);i!==s[0]&&(this._setScale(i+this._minScale,!1,!1),this._currentScale=t,this._toCanvas())}_toCanvas(){this._toCanvasDebounceTimeout&&clearTimeout(this._toCanvasDebounceTimeout),this._toCanvasDebounceTimeout=setTimeout((async()=>{const t=await this._selectionRef.$toCanvas();if("canvas"===this.returnType)return void this.valueChange.emit(t);const s=t.toDataURL("image/png");this.valueChange.emit(s)}),200)}};Yt.style=".mb-6{margin-bottom:1.5rem}.flex{display:flex}.w-full{width:100%}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-between{justify-content:space-between}*{box-sizing:border-box}:host{align-items:center;display:flex;flex-direction:column;gap:1.5rem;justify-content:space-between;margin-bottom:1.5rem;width:100%}.static{position:static}.hidden{display:none}.aspect-branding{aspect-ratio:23/24}.h-\\[17\\.5rem\\]{height:17.5rem}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.resize{resize:both}.rounded-full{border-radius:9999px}.border-0{border-width:0}.border-b{border-bottom-width:1px}.border-solid{border-style:solid}.border-off-white-700{--tw-border-opacity:1;border-color:rgb(222 219 213/var(--tw-border-opacity,1))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.px-14{padding-left:3.5rem;padding-right:3.5rem}@media (min-width:40rem){.tablet\\:max-w-xs{max-width:20rem}.tablet\\:px-1{padding-left:.25rem;padding-right:.25rem}}.dark\\:border-hurricane-200:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-border-opacity:1;border-color:rgb(163 165 169/var(--tw-border-opacity,1))}.dark\\:border-hurricane-200:where([data-theme=dark],[data-theme=dark] *){--tw-border-opacity:1;border-color:rgb(163 165 169/var(--tw-border-opacity,1))}";export{Yt as p_cropper}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,a as e,h as a}from"./p-UEOqFwec.js";import{c as r}from"./p-CBWjHURv.js";import{T as o}from"./p-BaOYiNIi.js";import"./p-ChV9xqsO.js";import"./p-Ds4BJt6D.js";const i=r("w-[2px] rounded-full h-9 flex-shrink-0",{variants:{variant:{neutral:"bg-indigo-800 dark:bg-indigo-400",positive:"bg-positive-green-500 dark:bg-positive-green-alternative",biased:"bg-amber-500 dark:bg-amber-alternative",negative:"bg-negative-red-500 dark:bg-negative-red-alternative"}}}),d=r(["flex justify-between items-center gap-2","w-[calc(100%-2px-0.5rem)]"]),c=class{constructor(a){t(this,a),this.action=e(this,"action",3)}variant="positive";header;content;enableAction=!0;actionIcon="negative";actionIconFlip;actionIconRotate;action;render(){return a(o,{key:"6fd875b74af13f4a1c7dd6e924d7044ff06c944f"},a("div",{key:"f908fa3fc32e0818e5b7ccd64adf925678719072",class:"flex gap-2 rounded-lg border border-solid border-storm-100 bg-white p-2 shadow-2 dark:border-hurricane-800 dark:bg-hurricane-800",onClick:()=>this._onClick()},a("div",{key:"7f2788fde508ad480ffaaf544f6815f87e520499",class:i({variant:this.variant})}),a("div",{key:"99bde4f91347f270375852e62b573cba43d570d2",class:d()},a("div",{key:"2ea0b73745021b483607c52166204f3e00b33d38",class:"flex w-full min-w-0 flex-col"},a("p",{key:"d9cf48a043d897e211da6ce6d389ee65c59d7560",class:"m-0 overflow-hidden text-ellipsis whitespace-nowrap text-sm font-semibold text-storm-500 dark:text-white"},this.header?.length?this.header:a("slot",{name:"header"})),a("p",{key:"cbae153aafab6f54d0af33ab3a99f1c03a44cd78",class:"m-0 w-full overflow-hidden text-ellipsis whitespace-nowrap text-xs text-storm-300 dark:text-hurricane-200"},this.content?.length?this.content:a("slot",{name:"content"}))),this.enableAction&&a("div",{key:"300ae00c2e2e30c87c32f78bf05a3bb3a65e2a97",class:"flex-shrink-0 cursor-pointer p-2 text-storm-200 hover:text-storm-500 hover:text-white dark:text-hurricane-200"},a("p-icon",{key:"a7849a36ec22b1a300c0d788c0e41ea1e8e76340",
|
|
1
|
+
import{r as t,a as e,h as a}from"./p-UEOqFwec.js";import{c as r}from"./p-CBWjHURv.js";import{T as o}from"./p-BaOYiNIi.js";import"./p-ChV9xqsO.js";import"./p-Ds4BJt6D.js";const i=r("w-[2px] rounded-full h-9 flex-shrink-0",{variants:{variant:{neutral:"bg-indigo-800 dark:bg-indigo-400",positive:"bg-positive-green-500 dark:bg-positive-green-alternative",biased:"bg-amber-500 dark:bg-amber-alternative",negative:"bg-negative-red-500 dark:bg-negative-red-alternative"}}}),d=r(["flex justify-between items-center gap-2","w-[calc(100%-2px-0.5rem)]"]),c=class{constructor(a){t(this,a),this.action=e(this,"action",3)}variant="positive";header;content;enableAction=!0;actionIcon="negative";actionIconFlip;actionIconRotate;action;render(){return a(o,{key:"6fd875b74af13f4a1c7dd6e924d7044ff06c944f"},a("div",{key:"f908fa3fc32e0818e5b7ccd64adf925678719072",class:"flex gap-2 rounded-lg border border-solid border-storm-100 bg-white p-2 shadow-2 dark:border-hurricane-800 dark:bg-hurricane-800",onClick:()=>this._onClick()},a("div",{key:"7f2788fde508ad480ffaaf544f6815f87e520499",class:i({variant:this.variant})}),a("div",{key:"99bde4f91347f270375852e62b573cba43d570d2",class:d()},a("div",{key:"2ea0b73745021b483607c52166204f3e00b33d38",class:"flex w-full min-w-0 flex-col"},a("p",{key:"d9cf48a043d897e211da6ce6d389ee65c59d7560",class:"m-0 overflow-hidden text-ellipsis whitespace-nowrap text-sm font-semibold text-storm-500 dark:text-white"},this.header?.length?this.header:a("slot",{name:"header"})),a("p",{key:"cbae153aafab6f54d0af33ab3a99f1c03a44cd78",class:"m-0 w-full overflow-hidden text-ellipsis whitespace-nowrap text-xs text-storm-300 dark:text-hurricane-200"},this.content?.length?this.content:a("slot",{name:"content"}))),this.enableAction&&a("div",{key:"300ae00c2e2e30c87c32f78bf05a3bb3a65e2a97",class:"flex-shrink-0 cursor-pointer p-2 text-storm-200 hover:text-storm-500 hover:text-white dark:text-hurricane-200"},a("p-icon",{key:"a7849a36ec22b1a300c0d788c0e41ea1e8e76340",flip:this.actionIconFlip,rotate:this.actionIconRotate,variant:this.actionIcon})))))}_onClick(){this.enableAction&&this.action.emit()}};c.style="*{box-sizing:border-box}.static{position:static}.m-0{margin:0}.flex{display:flex}.h-9{height:2.25rem}.w-\\[2px\\]{width:2px}.w-\\[calc\\(100\\%-2px-0\\.5rem\\)\\]{width:calc(100% - 2px - .5rem)}.w-full{width:100%}.min-w-0{min-width:0}.flex-shrink-0{flex-shrink:0}.cursor-pointer{cursor:pointer}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-between{justify-content:space-between}.gap-2{gap:.5rem}.overflow-hidden{overflow:hidden}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.border{border-width:1px}.border-solid{border-style:solid}.border-storm-100{--tw-border-opacity:1;border-color:rgb(209 210 212/var(--tw-border-opacity,1))}.bg-amber-500{--tw-bg-opacity:1;background-color:rgb(225 159 35/var(--tw-bg-opacity,1))}.bg-indigo-800{--tw-bg-opacity:1;background-color:rgb(27 88 210/var(--tw-bg-opacity,1))}.bg-negative-red-500{--tw-bg-opacity:1;background-color:rgb(230 30 30/var(--tw-bg-opacity,1))}.bg-positive-green-500{--tw-bg-opacity:1;background-color:rgb(92 195 14/var(--tw-bg-opacity,1))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.p-2{padding:.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-semibold{font-weight:600}.text-storm-200{--tw-text-opacity:1;color:rgb(163 165 169/var(--tw-text-opacity,1))}.text-storm-300{--tw-text-opacity:1;color:rgb(116 120 127/var(--tw-text-opacity,1))}.text-storm-500{--tw-text-opacity:1;color:rgb(24 30 41/var(--tw-text-opacity,1))}.shadow-2{--tw-shadow:0 1px 1px rgba(0,2,2,.04),0 2px 2px rgba(0,2,2,.04),0 4px 4px rgba(0,2,2,.04);--tw-shadow-colored:0 1px 1px var(--tw-shadow-color),0 2px 2px var(--tw-shadow-color),0 4px 4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.hover\\:text-storm-500:hover{--tw-text-opacity:1;color:rgb(24 30 41/var(--tw-text-opacity,1))}.hover\\:text-white:hover{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.dark\\:border-hurricane-800:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-border-opacity:1;border-color:rgb(24 30 41/var(--tw-border-opacity,1))}.dark\\:bg-amber-alternative:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-bg-opacity:1;background-color:rgb(255 231 92/var(--tw-bg-opacity,1))}.dark\\:bg-hurricane-800:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-bg-opacity:1;background-color:rgb(24 30 41/var(--tw-bg-opacity,1))}.dark\\:bg-indigo-400:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-bg-opacity:1;background-color:rgb(165 194 252/var(--tw-bg-opacity,1))}.dark\\:bg-negative-red-alternative:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-bg-opacity:1;background-color:rgb(255 92 92/var(--tw-bg-opacity,1))}.dark\\:bg-positive-green-alternative:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-bg-opacity:1;background-color:rgb(98 255 92/var(--tw-bg-opacity,1))}.dark\\:text-hurricane-200:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(163 165 169/var(--tw-text-opacity,1))}.dark\\:text-white:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.dark\\:border-hurricane-800:where([data-theme=dark],[data-theme=dark] *){--tw-border-opacity:1;border-color:rgb(24 30 41/var(--tw-border-opacity,1))}.dark\\:bg-amber-alternative:where([data-theme=dark],[data-theme=dark] *){--tw-bg-opacity:1;background-color:rgb(255 231 92/var(--tw-bg-opacity,1))}.dark\\:bg-hurricane-800:where([data-theme=dark],[data-theme=dark] *){--tw-bg-opacity:1;background-color:rgb(24 30 41/var(--tw-bg-opacity,1))}.dark\\:bg-indigo-400:where([data-theme=dark],[data-theme=dark] *){--tw-bg-opacity:1;background-color:rgb(165 194 252/var(--tw-bg-opacity,1))}.dark\\:bg-negative-red-alternative:where([data-theme=dark],[data-theme=dark] *){--tw-bg-opacity:1;background-color:rgb(255 92 92/var(--tw-bg-opacity,1))}.dark\\:bg-positive-green-alternative:where([data-theme=dark],[data-theme=dark] *){--tw-bg-opacity:1;background-color:rgb(98 255 92/var(--tw-bg-opacity,1))}.dark\\:text-hurricane-200:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(163 165 169/var(--tw-text-opacity,1))}.dark\\:text-white:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}";export{c as p_toast}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,a as e,d as i,h as s,e as n}from"./p-UEOqFwec.js";import{f as o,g as a}from"./p-CwQG70_4.js";import{f as h}from"./p-CHZgJJeM.js";import{f as l}from"./p-CWO2YJCh.js";import{c as r}from"./p-xs4N_Y-0.js";import{P as c,a as d,T as u}from"./p-CEaB2BT0.js";import"./p-CBWjHURv.js";import"./p-ChV9xqsO.js";const f=class{constructor(i){t(this,i),this.selectedRowsChange=e(this,"selectedRowsChange",3),this.rowClick=e(this,"rowClick",3),this.rowSelected=e(this,"rowSelected",3),this.rowDeselected=e(this,"rowDeselected",3),this.hasRendered=e(this,"hasRendered",3),this.quickFilter=e(this,"quickFilter",3),this.queryChange=e(this,"queryChange",3),this.filter=e(this,"filter",3),this.action=e(this,"action",3),this.pageChange=e(this,"pageChange",3),this.pageSizeChange=e(this,"pageSizeChange",3),this.export=e(this,"export",3),this.emptyStateActionClick=e(this,"emptyStateActionClick",3)}items;loading=!1;headerLoading=!1;footerLoading=!1;amountOfLoadingRows=6;enableRowSelection=!0;rowSelectionLimit;enableRowClick=!0;selectedRows=[];enableFloatingMenu=!0;floatingMenuAmountSelectedTemplate=t=>o((1===t?this._locales.floating_menu?.amount_selected:this._locales.floating_menu?.amount_selected_plural)?.replace("{{amount}}",t));selectedRowsChange;selectionKey;canSelectKey;rowClick;rowSelected;rowDeselected;hasRendered;enableHeader=!0;quickFilters=[];activeQuickFilterIdentifier;enableSearch=!0;query;enableFilter=!0;enableFilterDesktop=!0;selectedFiltersAmount;filterButtonTemplate;enableAction=!1;actionButtonLoading=!1;actionButtonEnabled=!1;actionButtonIcon="pencil";actionButtonText;actionButtonTemplate;quickFilter;queryChange;filter;action;enableFooter=!0;enablePaginationSize=!0;enablePaginationPages=!0;enableExport=!0;page=1;total;pageChange;pageSize=c;pageSizeOptions=d;pageSizeChange;export;hideOnSinglePage=!0;emptyStateHeader=()=>o(this._locales.empty_state?.no_filter.header);emptyStateContent=()=>o(this._locales.empty_state?.no_filter.content);emptyStateAction=()=>o(this._locales.empty_state?.no_filter.action);enableEmptyStateAction=!0;emptyStateFilteredHeader=()=>o(this._locales.empty_state.filtered.header);emptyStateFilteredContent=()=>o(this._locales.empty_state.filtered.content);emptyStateActionClick;shadow=!0;get _el(){return i(this)}_locales={};_extraHeaders=[];_columns=[];_items=[];_enableRowSelection=this.enableRowSelection;_rowSelectionLimit;_rowActionsFloatingAll=[];_rowActionsFloating=[];_rowActionsRow=[];_footerHidden=!1;_ctrlDown=!1;_hasCustomFilterSlot=!1;_hasCustomActionsSlot=!1;_floatingMenuShown=!1;_resizeTimeout;componentWillLoad(){this._hasCustomFilterSlot=!!this._el.querySelector(':scope > [slot="custom-filter"]'),this._hasCustomActionsSlot=!!this._el.querySelector(':scope > [slot="custom-actions"]'),this._setRowSelectionData(),this._setLocales(),this._parseItems(this.items),this._generateExtraHeaders(),this._generateColumns()}componentDidRender(){this.hasRendered.emit()}render(){return s(n,{key:"7ece1479d7c90b408fa55f045feba734f9e27b28",class:"z-0 flex flex-col"},s("p-table-container",{key:"290cf20abdacab6257ebef5479b834df529bccbd"},this.enableHeader&&s("p-table-header",{key:"9d49ef03a1b0c8b47e8292f36ade24a2eb0b3f7d",class:"mb-8",quickFilters:this.quickFilters,activeQuickFilterIdentifier:this.activeQuickFilterIdentifier,onQuickFilter:({detail:t})=>this.quickFilter.emit(t),enableSearch:this.enableSearch,query:this.query,onQueryChange:({detail:t})=>this.queryChange.emit(t),enableFilter:this.enableFilter,enableFilterDesktop:this.enableFilterDesktop,selectedFiltersAmount:this.selectedFiltersAmount,filterButtonTemplate:this.filterButtonTemplate,onFilter:()=>this.filter.emit(),enableAction:this.enableAction,actionIcon:this.actionButtonIcon,actionText:this.actionButtonText,actionLoading:this.actionButtonLoading,canUseAction:this.actionButtonEnabled,actionButtonTemplate:this.actionButtonTemplate,onAction:()=>this.action.emit(),itemsSelectedAmount:this.selectedRows?.length,enableExport:this.enableExport,onExport:()=>this.export.emit(),loading:this.headerLoading},this._hasCustomFilterSlot&&s("slot",{key:"555237f446a654201d12321505062d4c4e06210c",name:"custom-filter",slot:"custom-filter"}),this._hasCustomActionsSlot&&s("slot",{key:"4e935caf48c9cf1b0516a61ca9076a3755f98546",name:"custom-actions",slot:"custom-actions"})),this._getExtraHeader(),this._getHeader(),s("div",{key:"23816ab229344ba5a7c5cc02a358b277e5ff8da1",class:"flex flex-1 flex-col"},this._getRows(),s("slot",{key:"d3012e94582c06ca536db0ab83d1bd0df4d80c48",name:"custom-rows"})),this.enableFloatingMenu&&this._enableRowSelection?s("p-floating-menu-container",{usedInTable:!0,class:h({hasFooter:this.enableFooter&&!this._footerHidden,active:!!this.selectedRows?.length,shown:this._floatingMenuShown}),amountSelectedTemplate:this.floatingMenuAmountSelectedTemplate,amount:this.selectedRows?.length,enableAmountSelected:!!this._rowActionsFloating?.length,onClose:()=>this._selectAllChange(null,!1)},this._rowActionsFloating?.length&&this._rowActionsFloating.map((t=>s("p-floating-menu-item",{slot:"floating-menu-item",disabled:t.disabled,loading:t.loading,icon:t.icon,iconRotate:t.iconRotate,iconFlip:t.iconFlip,onClick:()=>t.disabled||t.loading||!t.action||"single"!==t.type?t.action(this.selectedRows,!0):t.action(this.selectedRows[0],!1)},t.label)))):"",this.enableFooter&&s("p-table-footer",{key:"3c5138a3af7594642a8e750d40524bc13f138892",hideOnSinglePage:this.hideOnSinglePage,enablePaginationSize:this.enablePaginationSize,pageSize:this.pageSize,pageSizeOptions:this.pageSizeOptions,onPageSizeChange:({detail:t})=>this.pageSizeChange.emit(t),enablePaginationPages:this.enablePaginationPages,page:this.page,total:this.total,onPageChange:({detail:t})=>this.pageChange.emit(t),loading:this.footerLoading,onHiddenChange:({detail:t})=>this._footerHidden=t,tableHeaderHasAction:this.enableHeader&&this.enableAction&&this.actionButtonEnabled})))}async _setLocales(){this._locales=await a(this._el)}onTableDefinitionUpdated(){this._generateColumns()}keyDown({key:t}){"Control"===t&&!0!==this._ctrlDown&&(this._ctrlDown=!0)}keyUp({key:t}){"Control"===t&&!1!==this._ctrlDown&&(this._ctrlDown=!1)}visibilityChange(){"hidden"===document.visibilityState&&!1!==this._ctrlDown&&(this._ctrlDown=!1)}_parseItems(t){this._items=t?Array.isArray(t)?t:JSON.parse(t):[]}_setRowSelectionData(){this._resizeTimeout&&clearTimeout(this._resizeTimeout),this._resizeTimeout=setTimeout((()=>{const t=l(),e=[...this._el.querySelectorAll(":scope > p-table-row-action")];this._rowActionsRow=e.filter((t=>"both"===t.type||"single"===t.type)),this._rowActionsFloatingAll=e.filter((e=>this.enableRowSelection&&("both"===e.type||"multi"===e.type)||t&&"single"===e.type)).map((t=>("single"===t.type&&(t.disabled=this.selectedRows?.length>1),t)));let i=this.rowSelectionLimit;t&&this._rowActionsFloatingAll?.length&&(void 0!==i&&this.enableRowSelection||!this.enableRowSelection)&&(i=1),this._rowSelectionLimit=i;let s=this.enableRowSelection;t&&this._rowActionsFloatingAll?.length&&!s&&(s=!0),this._enableRowSelection=s,this._floatingMenuShown&&this._showFloatingMenu()}),200)}_generateExtraHeaders(){let t=[...this._el.querySelectorAll("p-table-extra-header")];t=this._parseDefinitions(t),this._extraHeaders=t}_generateColumns(){let t=[...this._el.querySelectorAll("p-table-column")];t=this._parseDefinitions(t),this._columns=t}_getExtraHeader(){return this._extraHeaders?.length?s("p-table-row",{variant:"header-secondary",isLast:!0},this._extraHeaders.map(((t,e)=>s("p-table-cell",{definition:t,variant:"header-secondary",checkboxOffset:0===e&&this._enableRowSelection,index:e},s("b",null,t.name))))):null}_getHeader(){return s("p-table-row",{variant:"header"},this._columns.map(((t,e)=>s("p-table-cell",{definition:t,value:t.name,variant:"header",checkbox:0===e||t.hasCheckbox?this._getCheckbox(null,this.loading?"loading":"header"):null,index:e}))))}_getRows(){return this.loading?Array.from({length:this.amountOfLoadingRows},((t,e)=>s("p-table-row",{enableHover:this._enableRowSelection||this.enableRowClick,isLast:e===this.amountOfLoadingRows-1},this._getLoadingColumns(e)))):0===this._items.length?this._getEmptyState():this._items.map(((t,e)=>s("p-table-row",{enableHover:this._enableRowSelection||this.enableRowClick,checked:this._selectionContains(e),onClick:t=>this._rowClick(t,e),isLast:e===this._items.length-1},this._getRowColumns(t,e),this._getActions(t,e))))}_getActions(t,e){const i=this._rowActionsRow.filter((e=>!e.showFunction||e.showFunction(t)));return i?.length&&!l()?s("p-table-row-actions-container",{slot:"actions",checked:this._selectionContains(e)},i.map((e=>s("p-tooltip",{strategy:"fixed",content:e.label},s("p-button",{"data-is-action":!0,variant:"secondary",slot:"trigger",icon:e.icon,iconRotate:e.iconRotate,iconFlip:e.iconFlip,iconOnly:!0,size:"sm",onClick:()=>"function"==typeof e.action&&e.action?.(t,!1)}))))):null}_getRowColumns(t,e){return this._columns.map(((i,n)=>s("p-table-cell",{definition:i,item:t,checkbox:0===n||i.hasCheckbox?this._getCheckbox(e):null,index:n,rowIndex:e})))}_getLoadingColumns(t){return this._columns.map(((e,i)=>s("p-table-cell",{definition:e,variant:"loading",checkbox:0===i||e.hasCheckbox?this._getCheckbox(t,"loading"):null,index:i,rowIndex:t})))}_getCheckbox(t,e="default"){if(!this._enableRowSelection||!this.selectionKey&&!this._rowActionsFloating?.length)return;if("loading"===e)return s("p-loader",{variant:"ghost",class:"h-6 w-6 rounded"});if("header"===e)return s("p-checkbox",{class:r({"opacity-0":void 0!==this._rowSelectionLimit}),checked:this._selectionContainsAll(),indeterminate:this._selectionIndeterminate(),disabled:void 0!==this._rowSelectionLimit,onCheckedChange:t=>this._selectAllChange(t)});const i=this._items[t],n=this._selectionContains(t);return s("p-checkbox",{class:"flex-shrink-0",disabled:this.canSelectKey&&!i[this.canSelectKey]||void 0!==this._rowSelectionLimit&&!n&&this.selectedRows.length===this._rowSelectionLimit,checked:n,onCheckedChange:e=>this._checkboxChange(e,t)})}_getEmptyState(){return s("p-empty-state",this.query?.length||this.selectedFiltersAmount?{class:"my-16 self-center",illustration:"search",header:this.emptyStateFilteredHeader(),content:this.emptyStateFilteredContent()}:{class:"my-16 self-center",illustration:"table",header:this.emptyStateHeader(),content:this.emptyStateContent(),enableAction:this.enableEmptyStateAction,actionIcon:"plus",actionText:this.emptyStateAction(),onAction:()=>this.enableAction&&this.action.emit()})}_selectAllChange(t,e){if(this._enableRowSelection){if(void 0===e?t?.detail??e:e){const t=[];for(let e=0;e<this._items.length;e++){const i=this._items[e];if((!this.canSelectKey||i[this.canSelectKey])&&!this._selectionContains(e)&&(t.push(i),this.rowSelected.emit(i),void 0!==this._rowSelectionLimit&&this.selectedRows.length+t.length===this._rowSelectionLimit))break}return this.selectedRows=[...this.selectedRows,...t],this.selectedRowsChange.emit(this.selectedRows),void(this.enableFloatingMenu&&!this._floatingMenuShown&&this._showFloatingMenu())}for(let t=0;t<this.selectedRows.length;t++){const e=this.selectedRows[t],i=this._items.find((i=>this._getSelectionValue(i,t)===this._getSelectionValue(e,t)));i&&this.rowDeselected.emit(i)}this.selectedRows=[],this.selectedRowsChange.emit(this.selectedRows)}}_checkboxChange({detail:t,target:e},i){if(!this._enableRowSelection)return;if(t&&void 0!==this._rowSelectionLimit&&this.selectedRows.length>=this._rowSelectionLimit)return void(e.checked=!1);const s=this._items[i];if(this.canSelectKey&&!s[this.canSelectKey])return void(e.checked=!1);if(t)return this.selectedRows=[...this.selectedRows,{...s,index:i}],this.selectedRowsChange.emit(this.selectedRows),this.rowSelected.emit(s),void(this.enableFloatingMenu&&!this._floatingMenuShown&&this._showFloatingMenu());const n=this._selectionContains(i,!0),o=[...this.selectedRows];o.splice(n,1),this.selectedRows=o,this.selectedRowsChange.emit(this.selectedRows),this.rowDeselected.emit(s)}_getSelectionValue(t,e){return this.selectionKey&&t?.[this.selectionKey]||e}_selectionContains(t,e=!1){const i=this.selectedRows.findIndex((e=>e.index===t));return e?i:-1!==i}_selectionContainsAll(){let t=!0;if(!this._items?.length)return!1;if(void 0!==this._rowSelectionLimit&&this.selectedRows.length===this._rowSelectionLimit)return!0;for(let e=0;e<this._items?.length;e++)if(!this._selectionContains(e)){t=!1;break}return t}_selectionIndeterminate(){if(!this._items?.length||!this.selectedRows?.length)return!1;if(void 0!==this._rowSelectionLimit&&this.selectedRows.length===this._rowSelectionLimit)return!1;let t=0;for(let e=0;e<this._items?.length;e++)this._selectionContains(e)&&t++;return t>0&&t!==this._items.length}_rowClick(t,e){const i=t.target;if("input"===i.tagName.toLowerCase()||"checkbox"===i.type)return;const s=this._findRow(t.target);if(this._findRowAction(t.target))return;if(this.enableRowClick)return void this.rowClick.emit({item:this._items[e],ctrlDown:this._ctrlDown});if(!this._enableRowSelection)return;const n=s?.querySelector('input[type="checkbox"]');n&&(n.checked=!n.checked,this._checkboxChange(n,e))}_findRow(t){return t?"p-table-row"===t?.tagName?.toLowerCase()?t:this._findRow(t?.parentElement):t}_findRowAction(t){return t?null!==t.dataset.isAction&&"false"!==t.dataset.isAction?t:"p-table-row"===t?.tagName?.toLowerCase()?null:this._findRowAction(t?.parentElement):null}_showFloatingMenu(){let t=this._rowActionsFloatingAll;1===this.rowSelectionLimit&&t.some((t=>("single"===t.type||"both"===t.type)&&t.showFunction))&&(t=t.filter((t=>"multi"===t.type||!t.showFunction||t.showFunction(this.selectedRows[0])))),this._rowActionsFloating=t,this._floatingMenuShown=!0}_parseDefinitions(t){return t.map((t=>this._parseDefinitionSizes(t)))}_parseDefinitionSizes(t){const e=t;let i={default:"full"};"string"!=typeof t.sizes||["auto","hidden","full"].includes(t.sizes)||(t.sizes=JSON.parse(t.sizes));for(const[t,s]of u.entries())i[s]="auto"!==e.sizes&&"hidden"!==e.sizes&&"full"!==e.sizes&&"number"!=typeof e.sizes?e.sizes[s]??i[u[t-1]]:"auto"===e.sizes?"full":e.sizes;return t.parsedSizes=i,t}static get watchers(){return{items:[{_parseItems:0}],enableRowSelection:[{_setRowSelectionData:0}],rowSelectionLimit:[{_setRowSelectionData:0}],selectedRows:[{_setRowSelectionData:0}]}}};f.style="*{box-sizing:border-box}.static{position:static}.fixed{position:fixed}.z-0{z-index:0}.my-16{margin-bottom:4rem;margin-top:4rem}.mb-8{margin-bottom:2rem}.flex{display:flex}.table{display:table}.hidden{display:none}.h-6{height:1.5rem}.w-6{width:1.5rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.resize{resize:both}.flex-col{flex-direction:column}.self-center{align-self:center}.rounded{border-radius:.25rem}.opacity-0{opacity:0}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}";export{f as p_table}
|
|
1
|
+
import{r as t,a as e,d as i,h as s,e as n}from"./p-UEOqFwec.js";import{f as o,g as a}from"./p-CwQG70_4.js";import{f as h}from"./p-CHZgJJeM.js";import{f as l}from"./p-CWO2YJCh.js";import{c as r}from"./p-xs4N_Y-0.js";import{P as c,a as d,T as u}from"./p-CEaB2BT0.js";import"./p-CBWjHURv.js";import"./p-ChV9xqsO.js";const f=class{constructor(i){t(this,i),this.selectedRowsChange=e(this,"selectedRowsChange",3),this.rowClick=e(this,"rowClick",3),this.rowSelected=e(this,"rowSelected",3),this.rowDeselected=e(this,"rowDeselected",3),this.hasRendered=e(this,"hasRendered",3),this.quickFilter=e(this,"quickFilter",3),this.queryChange=e(this,"queryChange",3),this.filter=e(this,"filter",3),this.action=e(this,"action",3),this.pageChange=e(this,"pageChange",3),this.pageSizeChange=e(this,"pageSizeChange",3),this.export=e(this,"export",3),this.emptyStateActionClick=e(this,"emptyStateActionClick",3)}items;loading=!1;headerLoading=!1;footerLoading=!1;amountOfLoadingRows=6;enableRowSelection=!0;rowSelectionLimit;enableRowClick=!0;selectedRows=[];enableFloatingMenu=!0;floatingMenuAmountSelectedTemplate=t=>o((1===t?this._locales.floating_menu?.amount_selected:this._locales.floating_menu?.amount_selected_plural)?.replace("{{amount}}",t));selectedRowsChange;selectionKey;canSelectKey;rowClick;rowSelected;rowDeselected;hasRendered;enableHeader=!0;quickFilters=[];activeQuickFilterIdentifier;enableSearch=!0;query;enableFilter=!0;enableFilterDesktop=!0;selectedFiltersAmount;filterButtonTemplate;enableAction=!1;actionButtonLoading=!1;actionButtonEnabled=!1;actionButtonIcon="pencil";actionButtonText;actionButtonTemplate;quickFilter;queryChange;filter;action;enableFooter=!0;enablePaginationSize=!0;enablePaginationPages=!0;enableExport=!0;page=1;total;pageChange;pageSize=c;pageSizeOptions=d;pageSizeChange;export;hideOnSinglePage=!0;emptyStateHeader=()=>o(this._locales.empty_state?.no_filter.header);emptyStateContent=()=>o(this._locales.empty_state?.no_filter.content);emptyStateAction=()=>o(this._locales.empty_state?.no_filter.action);enableEmptyStateAction=!0;emptyStateFilteredHeader=()=>o(this._locales.empty_state.filtered.header);emptyStateFilteredContent=()=>o(this._locales.empty_state.filtered.content);emptyStateActionClick;shadow=!0;get _el(){return i(this)}_locales={};_extraHeaders=[];_columns=[];_items=[];_enableRowSelection=this.enableRowSelection;_rowSelectionLimit;_rowActionsFloatingAll=[];_rowActionsFloating=[];_rowActionsRow=[];_footerHidden=!1;_ctrlDown=!1;_hasCustomFilterSlot=!1;_hasCustomActionsSlot=!1;_floatingMenuShown=!1;_resizeTimeout;componentWillLoad(){this._hasCustomFilterSlot=!!this._el.querySelector(':scope > [slot="custom-filter"]'),this._hasCustomActionsSlot=!!this._el.querySelector(':scope > [slot="custom-actions"]'),this._setRowSelectionData(),this._setLocales(),this._parseItems(this.items),this._generateExtraHeaders(),this._generateColumns()}componentDidRender(){this.hasRendered.emit()}render(){return s(n,{key:"7ece1479d7c90b408fa55f045feba734f9e27b28",class:"z-0 flex flex-col"},s("p-table-container",{key:"290cf20abdacab6257ebef5479b834df529bccbd"},this.enableHeader&&s("p-table-header",{key:"6a1af71c86b2b23d26d8d344b1528b1356d7bd7b",actionButtonTemplate:this.actionButtonTemplate,actionIcon:this.actionButtonIcon,actionLoading:this.actionButtonLoading,actionText:this.actionButtonText,activeQuickFilterIdentifier:this.activeQuickFilterIdentifier,canUseAction:this.actionButtonEnabled,class:"mb-8",enableAction:this.enableAction,enableExport:this.enableExport,enableFilter:this.enableFilter,enableFilterDesktop:this.enableFilterDesktop,enableSearch:this.enableSearch,filterButtonTemplate:this.filterButtonTemplate,itemsSelectedAmount:this.selectedRows?.length,loading:this.headerLoading,query:this.query,quickFilters:this.quickFilters,selectedFiltersAmount:this.selectedFiltersAmount,onAction:()=>this.action.emit(),onExport:()=>this.export.emit(),onFilter:()=>this.filter.emit(),onQueryChange:({detail:t})=>this.queryChange.emit(t),onQuickFilter:({detail:t})=>this.quickFilter.emit(t)},this._hasCustomFilterSlot&&s("slot",{key:"6bfe4727050ba7d6a3e6e280cc1c467259b9166b",name:"custom-filter",slot:"custom-filter"}),this._hasCustomActionsSlot&&s("slot",{key:"da4f2aea31f0daa62749393a0390219fa4342b20",name:"custom-actions",slot:"custom-actions"})),this._getExtraHeader(),this._getHeader(),s("div",{key:"799d65d57bf36a924ff40e6cb9416c4be0da4eaf",class:"flex flex-1 flex-col"},this._getRows(),s("slot",{key:"b0060fa16edf49898787df195c86a35adf397798",name:"custom-rows"})),this.enableFloatingMenu&&this._enableRowSelection?s("p-floating-menu-container",{amount:this.selectedRows?.length,amountSelectedTemplate:this.floatingMenuAmountSelectedTemplate,class:h({hasFooter:this.enableFooter&&!this._footerHidden,active:!!this.selectedRows?.length,shown:this._floatingMenuShown}),enableAmountSelected:!!this._rowActionsFloating?.length,usedInTable:!0,onClose:()=>this._selectAllChange(null,!1)},this._rowActionsFloating?.length&&this._rowActionsFloating.map((t=>s("p-floating-menu-item",{disabled:t.disabled,icon:t.icon,iconFlip:t.iconFlip,iconRotate:t.iconRotate,loading:t.loading,slot:"floating-menu-item",onClick:()=>t.disabled||t.loading||!t.action||"single"!==t.type?t.action(this.selectedRows,!0):t.action(this.selectedRows[0],!1)},t.label)))):"",this.enableFooter&&s("p-table-footer",{key:"57d24f1f3803e58053eba3da5fad1ab6474eccc6",enablePaginationPages:this.enablePaginationPages,enablePaginationSize:this.enablePaginationSize,hideOnSinglePage:this.hideOnSinglePage,loading:this.footerLoading,page:this.page,pageSize:this.pageSize,pageSizeOptions:this.pageSizeOptions,tableHeaderHasAction:this.enableHeader&&this.enableAction&&this.actionButtonEnabled,total:this.total,onHiddenChange:({detail:t})=>this._footerHidden=t,onPageChange:({detail:t})=>this.pageChange.emit(t),onPageSizeChange:({detail:t})=>this.pageSizeChange.emit(t)})))}async _setLocales(){this._locales=await a(this._el)}onTableDefinitionUpdated(){this._generateColumns()}keyDown({key:t}){"Control"===t&&!0!==this._ctrlDown&&(this._ctrlDown=!0)}keyUp({key:t}){"Control"===t&&!1!==this._ctrlDown&&(this._ctrlDown=!1)}visibilityChange(){"hidden"===document.visibilityState&&!1!==this._ctrlDown&&(this._ctrlDown=!1)}_parseItems(t){this._items=t?Array.isArray(t)?t:JSON.parse(t):[]}_setRowSelectionData(){this._resizeTimeout&&clearTimeout(this._resizeTimeout),this._resizeTimeout=setTimeout((()=>{const t=l(),e=[...this._el.querySelectorAll(":scope > p-table-row-action")];this._rowActionsRow=e.filter((t=>"both"===t.type||"single"===t.type)),this._rowActionsFloatingAll=e.filter((e=>this.enableRowSelection&&("both"===e.type||"multi"===e.type)||t&&"single"===e.type)).map((t=>("single"===t.type&&(t.disabled=this.selectedRows?.length>1),t)));let i=this.rowSelectionLimit;t&&this._rowActionsFloatingAll?.length&&(void 0!==i&&this.enableRowSelection||!this.enableRowSelection)&&(i=1),this._rowSelectionLimit=i;let s=this.enableRowSelection;t&&this._rowActionsFloatingAll?.length&&!s&&(s=!0),this._enableRowSelection=s,this._floatingMenuShown&&this._showFloatingMenu()}),200)}_generateExtraHeaders(){let t=[...this._el.querySelectorAll("p-table-extra-header")];t=this._parseDefinitions(t),this._extraHeaders=t}_generateColumns(){let t=[...this._el.querySelectorAll("p-table-column")];t=this._parseDefinitions(t),this._columns=t}_getExtraHeader(){return this._extraHeaders?.length?s("p-table-row",{isLast:!0,variant:"header-secondary"},this._extraHeaders.map(((t,e)=>s("p-table-cell",{checkboxOffset:0===e&&this._enableRowSelection,definition:t,index:e,variant:"header-secondary"},s("b",null,t.name))))):null}_getHeader(){return s("p-table-row",{variant:"header"},this._columns.map(((t,e)=>s("p-table-cell",{checkbox:0===e||t.hasCheckbox?this._getCheckbox(null,this.loading?"loading":"header"):null,definition:t,index:e,value:t.name,variant:"header"}))))}_getRows(){return this.loading?Array.from({length:this.amountOfLoadingRows},((t,e)=>s("p-table-row",{enableHover:this._enableRowSelection||this.enableRowClick,isLast:e===this.amountOfLoadingRows-1},this._getLoadingColumns(e)))):0===this._items.length?this._getEmptyState():this._items.map(((t,e)=>s("p-table-row",{checked:this._selectionContains(e),enableHover:this._enableRowSelection||this.enableRowClick,isLast:e===this._items.length-1,onClick:t=>this._rowClick(t,e)},this._getRowColumns(t,e),this._getActions(t,e))))}_getActions(t,e){const i=this._rowActionsRow.filter((e=>!e.showFunction||e.showFunction(t)));return i?.length&&!l()?s("p-table-row-actions-container",{checked:this._selectionContains(e),slot:"actions"},i.map((e=>s("p-tooltip",{content:e.label,strategy:"fixed"},s("p-button",{icon:e.icon,iconFlip:e.iconFlip,iconOnly:!0,iconRotate:e.iconRotate,size:"sm",slot:"trigger",variant:"secondary","data-is-action":!0,onClick:()=>"function"==typeof e.action&&e.action?.(t,!1)}))))):null}_getRowColumns(t,e){return this._columns.map(((i,n)=>s("p-table-cell",{checkbox:0===n||i.hasCheckbox?this._getCheckbox(e):null,definition:i,index:n,item:t,rowIndex:e})))}_getLoadingColumns(t){return this._columns.map(((e,i)=>s("p-table-cell",{checkbox:0===i||e.hasCheckbox?this._getCheckbox(t,"loading"):null,definition:e,index:i,rowIndex:t,variant:"loading"})))}_getCheckbox(t,e="default"){if(!this._enableRowSelection||!this.selectionKey&&!this._rowActionsFloating?.length)return;if("loading"===e)return s("p-loader",{class:"h-6 w-6 rounded",variant:"ghost"});if("header"===e)return s("p-checkbox",{checked:this._selectionContainsAll(),class:r({"opacity-0":void 0!==this._rowSelectionLimit}),disabled:void 0!==this._rowSelectionLimit,indeterminate:this._selectionIndeterminate(),onCheckedChange:t=>this._selectAllChange(t)});const i=this._items[t],n=this._selectionContains(t);return s("p-checkbox",{checked:n,class:"flex-shrink-0",disabled:this.canSelectKey&&!i[this.canSelectKey]||void 0!==this._rowSelectionLimit&&!n&&this.selectedRows.length===this._rowSelectionLimit,onCheckedChange:e=>this._checkboxChange(e,t)})}_getEmptyState(){return s("p-empty-state",this.query?.length||this.selectedFiltersAmount?{class:"my-16 self-center",content:this.emptyStateFilteredContent(),header:this.emptyStateFilteredHeader(),illustration:"search"}:{actionIcon:"plus",actionText:this.emptyStateAction(),class:"my-16 self-center",content:this.emptyStateContent(),enableAction:this.enableEmptyStateAction,header:this.emptyStateHeader(),illustration:"table",onAction:()=>this.enableAction&&this.action.emit()})}_selectAllChange(t,e){if(this._enableRowSelection){if(void 0===e?t?.detail??e:e){const t=[];for(let e=0;e<this._items.length;e++){const i=this._items[e];if((!this.canSelectKey||i[this.canSelectKey])&&!this._selectionContains(e)&&(t.push(i),this.rowSelected.emit(i),void 0!==this._rowSelectionLimit&&this.selectedRows.length+t.length===this._rowSelectionLimit))break}return this.selectedRows=[...this.selectedRows,...t],this.selectedRowsChange.emit(this.selectedRows),void(this.enableFloatingMenu&&!this._floatingMenuShown&&this._showFloatingMenu())}for(let t=0;t<this.selectedRows.length;t++){const e=this.selectedRows[t],i=this._items.find((i=>this._getSelectionValue(i,t)===this._getSelectionValue(e,t)));i&&this.rowDeselected.emit(i)}this.selectedRows=[],this.selectedRowsChange.emit(this.selectedRows)}}_checkboxChange({detail:t,target:e},i){if(!this._enableRowSelection)return;if(t&&void 0!==this._rowSelectionLimit&&this.selectedRows.length>=this._rowSelectionLimit)return void(e.checked=!1);const s=this._items[i];if(this.canSelectKey&&!s[this.canSelectKey])return void(e.checked=!1);if(t)return this.selectedRows=[...this.selectedRows,{...s,index:i}],this.selectedRowsChange.emit(this.selectedRows),this.rowSelected.emit(s),void(this.enableFloatingMenu&&!this._floatingMenuShown&&this._showFloatingMenu());const n=this._selectionContains(i,!0),o=[...this.selectedRows];o.splice(n,1),this.selectedRows=o,this.selectedRowsChange.emit(this.selectedRows),this.rowDeselected.emit(s)}_getSelectionValue(t,e){return this.selectionKey&&t?.[this.selectionKey]||e}_selectionContains(t,e=!1){const i=this.selectedRows.findIndex((e=>e.index===t));return e?i:-1!==i}_selectionContainsAll(){let t=!0;if(!this._items?.length)return!1;if(void 0!==this._rowSelectionLimit&&this.selectedRows.length===this._rowSelectionLimit)return!0;for(let e=0;e<this._items?.length;e++)if(!this._selectionContains(e)){t=!1;break}return t}_selectionIndeterminate(){if(!this._items?.length||!this.selectedRows?.length)return!1;if(void 0!==this._rowSelectionLimit&&this.selectedRows.length===this._rowSelectionLimit)return!1;let t=0;for(let e=0;e<this._items?.length;e++)this._selectionContains(e)&&t++;return t>0&&t!==this._items.length}_rowClick(t,e){const i=t.target;if("input"===i.tagName.toLowerCase()||"checkbox"===i.type)return;const s=this._findRow(t.target);if(this._findRowAction(t.target))return;if(this.enableRowClick)return void this.rowClick.emit({item:this._items[e],ctrlDown:this._ctrlDown});if(!this._enableRowSelection)return;const n=s?.querySelector('input[type="checkbox"]');n&&(n.checked=!n.checked,this._checkboxChange(n,e))}_findRow(t){return t?"p-table-row"===t?.tagName?.toLowerCase()?t:this._findRow(t?.parentElement):t}_findRowAction(t){return t?null!==t.dataset.isAction&&"false"!==t.dataset.isAction?t:"p-table-row"===t?.tagName?.toLowerCase()?null:this._findRowAction(t?.parentElement):null}_showFloatingMenu(){let t=this._rowActionsFloatingAll;1===this.rowSelectionLimit&&t.some((t=>("single"===t.type||"both"===t.type)&&t.showFunction))&&(t=t.filter((t=>"multi"===t.type||!t.showFunction||t.showFunction(this.selectedRows[0])))),this._rowActionsFloating=t,this._floatingMenuShown=!0}_parseDefinitions(t){return t.map((t=>this._parseDefinitionSizes(t)))}_parseDefinitionSizes(t){const e=t;let i={default:"full"};"string"!=typeof t.sizes||["auto","hidden","full"].includes(t.sizes)||(t.sizes=JSON.parse(t.sizes));for(const[t,s]of u.entries())i[s]="auto"!==e.sizes&&"hidden"!==e.sizes&&"full"!==e.sizes&&"number"!=typeof e.sizes?e.sizes[s]??i[u[t-1]]:"auto"===e.sizes?"full":e.sizes;return t.parsedSizes=i,t}static get watchers(){return{items:[{_parseItems:0}],enableRowSelection:[{_setRowSelectionData:0}],rowSelectionLimit:[{_setRowSelectionData:0}],selectedRows:[{_setRowSelectionData:0}]}}};f.style="*{box-sizing:border-box}.static{position:static}.fixed{position:fixed}.z-0{z-index:0}.my-16{margin-bottom:4rem;margin-top:4rem}.mb-8{margin-bottom:2rem}.flex{display:flex}.table{display:table}.hidden{display:none}.h-6{height:1.5rem}.w-6{width:1.5rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.resize{resize:both}.flex-col{flex-direction:column}.self-center{align-self:center}.rounded{border-radius:.25rem}.opacity-0{opacity:0}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}";export{f as p_table}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,a as e,d as i,h as s}from"./p-UEOqFwec.js";import{c as r}from"./p-CBWjHURv.js";import{T as a}from"./p-BaOYiNIi.js";import{a as h}from"./p-TyZ7uPES.js";import{c as o}from"./p-xs4N_Y-0.js";import{S as n}from"./p-CEaB2BT0.js";import"./p-ChV9xqsO.js";import"./p-Ds4BJt6D.js";const l=r(["flex items-center gap-2","flex-1 min-w-0 h-full","pointer-events-none overflow-hidden"]),d=r(["item group/item","pointer-events-auto cursor-pointer","flex h-[1.625rem] items-center gap-2","h-[1.625rem] px-2","text-sm font-semibold whitespace-nowrap","rounded-lg","bg-indigo-100","dark:bg-white/15"]),c=r("block w-full overflow-hidden text-start",{variants:{variant:{placeholder:"text-storm-400 dark:text-white",default:null},enableTextWrap:{true:!1,false:"text-ellipsis whitespace-nowrap"},error:{true:"text-negative-red-700 dark:text-negative-red-alternative group-hover/button:text-negative-red-800",false:null}}}),p=class{constructor(i){t(this,i),this.queryChange=e(this,"queryChange",3),this.valueChange=e(this,"valueChange",3),this.selectAllChange=e(this,"selectAllChange",3),this.dropdownShown=e(this,"dropdownShown",3),this.add=e(this,"add",3),i.$hostElement$["s-ei"]?this._internals=i.$hostElement$["s-ei"]:(this._internals=i.$hostElement$.attachInternals(),i.$hostElement$["s-ei"]=this._internals)}items;multi;strategy="absolute";icon;query;placeholder;autocompletePlaceholder="Search...";value;displayKey="text";dropdownDisplayKey;selectionDisplayKey;valueKey;avatarKey;iconKey="icon";iconClassKey="iconClass";showIconOnSelectedItem;classKey="class";applyClassOnSelectedItem;applyClassOnSelectedItemInMenu;avatarLettersKey;identifierKey;queryKey;autoSelectFirst=!0;showChevron=!0;maxDisplayedItems=n;enableAutocomplete=!0;enableTextWrap=!1;asyncFilter=!1;loading=!1;enableSelectAll=!1;selectAllText="Select all";selectAllIcon;queryChange;valueChange;selectAllChange;dropdownShown;size="base";prefix;label;helper;required=!0;showOptional=!0;error;disabled=!1;showAddItem=!1;addItemText="Add item";add;emptyStateText="No items available";get _el(){return i(this)}_showDropdown=!1;_selectedItem=null;_allSelected=!1;_amountHidden=0;_internals;_inputRef;autocompleteInputRef;_multiContainerRef;_resizeObserver;_resizeDebounceTimer;_checkSelectedItemsTimeout;get _items(){return this._getParsedItems()}get _displayValue(){const t=s("div",{class:c({variant:"placeholder"})},this.placeholder);return this._selectedItem?this.multi?0===this._selectedItem?.length?t:s("div",{class:l(),ref:t=>this._multiContainerRef=t},this._selectedItem.map((t=>s("div",{class:d(),onClick:()=>this._selectValue(t)},t[this.selectionDisplayKey??this.displayKey],s("p-icon",{class:"text-xs text-indigo-500 group-hover/item:text-indigo-800 dark:text-white/15 dark:group-hover/item:text-white",variant:"negative"})))),s("div",{class:"extra pointer-events-none hidden text-sm text-storm-100"},"+",this._amountHidden)):this._getDisplay(this._selectedItem,!0):t}get _identifierKey(){return this.identifierKey??this.valueKey??"value"}formResetCallback(){this._selectValue(null)}componentDidLoad(){if(!this.valueKey&&!this.identifierKey)throw new Error("You must provide a valueKey or identifierKey");this.multi&&(this._setMultiContainerMaxWidth(),this._resizeObserver=new ResizeObserver((()=>{this._resizeDebounceTimer&&(clearTimeout(this._resizeDebounceTimer),this._resizeDebounceTimer=null),this._resizeDebounceTimer=setTimeout((()=>{this._setMultiContainerMaxWidth(),this._setCheckSelectedItemsTimeout()}),200)})),this._resizeObserver.observe(this._el)),this.value?this._valueChange():this.itemChanges()}componentDidRender(){this.multi&&this._setMultiContainerMaxWidth()}disconnectedCallback(){this.multi&&this._resizeObserver.disconnect()}render(){let t=this.icon;return this._selectedItem&&!this.avatarKey&&this.iconKey&&this._selectedItem?.[this.iconKey]&&!this.showIconOnSelectedItem&&(t=this._selectedItem[this.iconKey]),(this.avatarKey&&this._selectedItem?.[this.avatarKey]||this.avatarLettersKey&&this._selectedItem?.[this.avatarLettersKey])&&(t=null),this.error?.length&&(t="warning"),s(a,{key:"617063ca6cf31255928f6f6856cb1902b1d225a2"},s("p-field-container",{key:"4a6d95f7bfbc79b886044f2fe31695990b4e210d",error:this.error,forceShowTooltip:!!this.error?.length&&!this._showDropdown,helper:this.helper,label:this.label,prefix:this.prefix,required:this.required,showOptional:this.showOptional,variant:"write"},s("p-dropdown",{key:"85f6409928f327efcfc78cef1dddb9c30178e6ed",applyChevron:!1,applyFullWidth:!0,applyMaxWidth:!1,"disable-trigger-click":this.disabled,insideClick:!0,manual:!0,scrollable:!this.enableAutocomplete||"large",show:this._showDropdown,slot:"content",strategy:this.strategy,onIsOpen:t=>this._onDropdownOpen(t)},s("p-button",{key:"9c892e4edc472af73e0c2cbba419012d08302adc",active:this._showDropdown,chevron:!!this.showChevron&&(this._showDropdown?"up":"down"),class:"w-full",error:!!this.error?.length,icon:t,iconClass:this.applyClassOnSelectedItem&&this._selectedItem?.[this.iconClassKey],size:this.size,slot:"trigger",variant:"secondary",onClick:t=>this._onClick(t)},s("div",{key:"6fa19bac84f26dbc0c3aa97985c6deb40c4eb641",class:"relative min-w-0 flex-1",ref:t=>this._inputRef=t},this._displayValue)),this.loading?this._getLoadingItems():this._getItems(),this.showAddItem&&this._getAddItem())))}documentClickHandler(t){this._showDropdown&&!h(t,this._el)&&(this._showDropdown=!1)}_valueChange(){setTimeout((()=>{this._preselectItem(),this._setCheckSelectedItemsTimeout()}))}itemChanges(){setTimeout((()=>this._preselectItem()))}_showDropdownChanges(){this.dropdownShown.emit({value:this._showDropdown,query:this.query})}multiChanges(){this._selectedItem&&!Array.isArray(this._selectedItem)&&(this._selectedItem=[])}_preselectItem(){let t="string"==typeof this.value&&this.multi?JSON.parse(this.value):this.value;if(this.multi)return Array.isArray(t)?(this.value=t,0===t.length?void(this._selectedItem=[]):void(this._selectedItem=this.valueKey&&"false"!==this.valueKey?this._items.filter((e=>t.includes(e?.[this.valueKey]))):[...t])):(this.value=[],void this.valueChange.emit(this.value));this._selectedItem||t||!this.autoSelectFirst||(t=this._items[0]);const e="object"==typeof t&&null!==t?t[this._identifierKey]:t,i="string"==typeof e||"number"==typeof e?e:JSON.stringify(e),s=this._selectedItem?this._selectedItem?.[this._identifierKey]:null,r="string"==typeof s||"number"==typeof s?s:JSON.stringify(s);if(this._selectedItem&&r===i)return;if(!this._items?.length&&t)return void this._selectValue(t,!1);const a=this._getParsedItems(!1).find((t=>{const e=t?.[this._identifierKey];return("string"==typeof e||"number"==typeof e?e:JSON.stringify(e))===i}));this._selectValue(a??t,!1)}_selectValue(t,e=!0){let i=this.valueKey&&"false"!==this.valueKey&&null!==t&&!this.loading?t?.[this.valueKey]:t;if(this.multi){this._selectedItem&&Array.isArray(this._selectedItem)||(this._selectedItem=[]),this.value&&Array.isArray(this.value)||(this.value=[]);const e=[...this._selectedItem],s=[...this.value],r=e.findIndex((e=>e[this._identifierKey]===t[this._identifierKey]));return-1===r?(e.push(t),s.push(i)):(e.splice(r,1),s.splice(r,1)),this._selectedItem=e,this.value=s,void this.valueChange.emit(s)}this._selectedItem=t,this._onBlur(e),i!==this.value&&(this.value=i,this.valueChange.emit(i))}_onClick(t){const e=t?.composedPath();for(const t of e){if("p-button"===t.nodeName.toLowerCase())break;if(t.classList?.contains("item"))return}this._showDropdown=!this._showDropdown}_onBlur(t=!1){this.enableAutocomplete&&!t||(this._showDropdown=!1)}_onAutoComplete(t){this.enableAutocomplete&&(this._showDropdown=!0,this.query=t.detail,this.queryChange.emit(t.detail))}_checkvalue(t,e){return e?.[t]?.toString()?.toLowerCase().indexOf(this.query?.toLowerCase())>=0}_getItems(){let t=this._items.map((t=>{const e=this.multi&&this._selectedItem&&Array.isArray(this._selectedItem)?this._selectedItem.some((e=>e[this._identifierKey]===t[this._identifierKey])):t[this._identifierKey]===this._selectedItem?.[this._identifierKey];return s("p-dropdown-menu-item",{active:e,checkbox:!!this.multi,enableTextWrap:this.enableTextWrap,slot:"items",useContainer:!1,onClick:()=>this._selectValue(t)},this._getDisplay(t,!1,e))}));return 0===this._items.length&&(t=[s("p",{class:"w-full p-2 text-center text-sm text-storm-400 dark:text-hurricane-200",slot:"items"},this.emptyStateText)]),this.enableSelectAll&&this._items.length>0&&t.unshift(s("p-dropdown-menu-item",{active:this._allSelected,slot:"items",useContainer:!1,checkbox:!0,onClick:()=>this._selectAllChange()},this.selectAllIcon?.length?s("span",{class:"flex items-center gap-2"},s("div",{class:"flex w-6 justify-center text-lg"},s("p-icon",{variant:this.selectAllIcon}))," ",this.selectAllText):this.selectAllText)),this.enableAutocomplete&&t.unshift(this._getAutoCompleteItem()),t}_getAddItem(){return s("p-dropdown-menu-item",{slot:"items",useContainer:!1,onClick:()=>this.add.emit()},s("span",{class:"flex items-center gap-1 font-semibold text-indigo-600"},this.addItemText,s("p-icon",{variant:"plus"})))}_getLoadingItems(){const t=[0,0,0].map((()=>s("p-dropdown-menu-item",{enableHover:!1,slot:"items"},s("p-loader",{class:"h-6 w-full rounded",variant:"ghost"}))));return this.enableAutocomplete&&t.unshift(this._getAutoCompleteItem()),t}_getAutoCompleteItem(){return s("div",{class:"sticky top-0 z-10 mb-3 h-8",slot:"items"},s("p-field",{class:"block",placeholder:this.autocompletePlaceholder,value:this.query,onInputRefChange:t=>this.autocompleteInputRef=t.detail,onValueChange:t=>this._onAutoComplete(t)}))}_setMultiContainerMaxWidth(){this._inputRef&&this._multiContainerRef&&(this._multiContainerRef.style.maxWidth=`${Math.max(this._inputRef.clientWidth-16,16)}px`)}_setCheckSelectedItemsTimeout(){this._checkSelectedItemsTimeout&&clearTimeout(this._checkSelectedItemsTimeout),this._checkSelectedItemsTimeout=setTimeout((()=>this._checkSelectedItems()),50)}_checkSelectedItems(){if(!this._multiContainerRef)return;const t=this._multiContainerRef.getBoundingClientRect(),e=this._multiContainerRef.querySelectorAll(".item");let i=0;for(const s of e)s.classList.remove("hidden"),s.classList.add("flex"),s.getBoundingClientRect().right>t.right&&(s.classList.remove("flex"),s.classList.add("hidden"),i++);this._amountHidden=i;const s=this._multiContainerRef.querySelector(".extra");s&&(s.classList.contains("hidden")||s.classList.add("hidden"),i>0&&s.classList.remove("hidden"))}_onDropdownOpen(t){t.detail&&this.autocompleteInputRef&&setTimeout((()=>this.autocompleteInputRef.focus()),100)}_selectAllChange(){this._allSelected=!this._allSelected,this.selectAllChange.emit(this._allSelected)}_getDisplay(t,e=!1,i=!1){let r=s("div",{class:c({variant:"default",error:!!this.error?.length,enableTextWrap:this.enableTextWrap&&!e})},t[e?this.selectionDisplayKey??this.displayKey:this.displayKey]);return this.avatarKey&&(r=s("span",{class:"flex items-center gap-2"},s("p-avatar",{letters:t[this.avatarLettersKey],size:"sm",src:t[this.avatarKey]}),s("div",{class:c({variant:"default",error:!!this.error?.length,enableTextWrap:this.enableTextWrap&&!e})},t[this.dropdownDisplayKey??this.displayKey]))),!this.iconKey||e&&!this.showIconOnSelectedItem||(r=s("span",{class:"flex items-center gap-2"},t[this.iconKey]&&s("p-icon",{class:o("text-storm-300 dark:text-hurricane-200",e&&!this.applyClassOnSelectedItem||i&&!this.applyClassOnSelectedItemInMenu?"":t?.[this.iconClassKey]??""),variant:t[this.iconKey]}),s("div",{class:c({variant:"default",error:!!this.error?.length,enableTextWrap:this.enableTextWrap&&!e})},t[this.dropdownDisplayKey??this.displayKey]))),e&&!this.applyClassOnSelectedItem||i&&!this.applyClassOnSelectedItemInMenu||!t?.[this.classKey]?.length?r:s("div",{class:t[this.classKey]},r)}_getParsedItems(t=!0){if(!this.items||this.loading)return[];let e="string"==typeof this.items?JSON.parse(this.items):this.items;return"string"==typeof e?.[0]&&(this.displayKey="text",this.valueKey="value",e=e.map((t=>({value:t,text:t})))),this.query?.length&&!this.asyncFilter&&(e=e.filter((t=>this.queryKey?this._checkvalue(this.queryKey,t):this._checkvalue(this._identifierKey,t)||this._checkvalue(this.displayKey,t)))),t?e?.slice(0,this.maxDisplayedItems):e}static get formAssociated(){return!0}static get watchers(){return{value:[{_valueChange:0}],items:[{itemChanges:0}],_showDropdown:[{_showDropdownChanges:0}],multi:[{multiChanges:0}]}}};p.style="*{box-sizing:border-box}:host{--tw-translate-y:0px!important;--tw-translate-x:0px!important}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.static{position:static}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.top-0{top:0}.z-10{z-index:10}.mb-3{margin-bottom:.75rem}.block{display:block}.flex{display:flex}.hidden{display:none}.h-6{height:1.5rem}.h-8{height:2rem}.h-\\[1\\.625rem\\]{height:1.625rem}.h-full{height:100%}.w-6{width:1.5rem}.w-full{width:100%}.min-w-0{min-width:0}.flex-1{flex:1 1 0%}.cursor-pointer{cursor:pointer}.items-center{align-items:center}.justify-center{justify-content:center}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.overflow-hidden{overflow:hidden}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.rounded-lg{border-radius:.5rem}.bg-indigo-100{--tw-bg-opacity:1;background-color:rgb(227 236 254/var(--tw-bg-opacity,1))}.p-2{padding:.5rem}.px-2{padding-left:.5rem;padding-right:.5rem}.text-center{text-align:center}.text-start{text-align:start}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-semibold{font-weight:600}.text-indigo-500{--tw-text-opacity:1;color:rgb(142 179 251/var(--tw-text-opacity,1))}.text-indigo-600{--tw-text-opacity:1;color:rgb(82 138 250/var(--tw-text-opacity,1))}.text-negative-red-700{--tw-text-opacity:1;color:rgb(147 16 16/var(--tw-text-opacity,1))}.text-storm-100{--tw-text-opacity:1;color:rgb(209 210 212/var(--tw-text-opacity,1))}.text-storm-300{--tw-text-opacity:1;color:rgb(116 120 127/var(--tw-text-opacity,1))}.text-storm-400{--tw-text-opacity:1;color:rgb(70 75 84/var(--tw-text-opacity,1))}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.group\\/button:hover .group-hover\\/button\\:text-negative-red-800{--tw-text-opacity:1;color:rgb(141 16 16/var(--tw-text-opacity,1))}.group\\/item:hover .group-hover\\/item\\:text-indigo-800{--tw-text-opacity:1;color:rgb(27 88 210/var(--tw-text-opacity,1))}.dark\\:bg-white\\/15:where(:host([data-theme=dark]),:host([data-theme=dark]) *){background-color:hsla(0,0%,100%,.15)}.dark\\:text-hurricane-200:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(163 165 169/var(--tw-text-opacity,1))}.dark\\:text-negative-red-alternative:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(255 92 92/var(--tw-text-opacity,1))}.dark\\:text-white:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.dark\\:text-white\\/15:where(:host([data-theme=dark]),:host([data-theme=dark]) *){color:hsla(0,0%,100%,.15)}.group\\/item:hover .dark\\:group-hover\\/item\\:text-white:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.dark\\:bg-white\\/15:where([data-theme=dark],[data-theme=dark] *){background-color:hsla(0,0%,100%,.15)}.dark\\:text-hurricane-200:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(163 165 169/var(--tw-text-opacity,1))}.dark\\:text-negative-red-alternative:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(255 92 92/var(--tw-text-opacity,1))}.dark\\:text-white:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.dark\\:text-white\\/15:where([data-theme=dark],[data-theme=dark] *){color:hsla(0,0%,100%,.15)}.group\\/item:hover .dark\\:group-hover\\/item\\:text-white:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}";export{p as p_select}
|