@navette-js/panels 0.0.0-stage → 1.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +8 -2
- package/THIRD-PARTY-NOTICES.md +12 -0
- package/dist/FILAMENT-LICENSE.md +21 -0
- package/dist/filament/css/filament/filament/app.css +2 -0
- package/dist/filament/fonts/INTER-LICENSE.txt +92 -0
- package/dist/filament/fonts/filament/filament/inter/index.css +1 -0
- package/dist/filament/fonts/filament/filament/inter/inter-cyrillic-ext-wght-normal-SP7Z6XGK.woff2 +0 -0
- package/dist/filament/fonts/filament/filament/inter/inter-cyrillic-wght-normal-DR6K5BQD.woff2 +0 -0
- package/dist/filament/fonts/filament/filament/inter/inter-greek-ext-wght-normal-A2J6H3EX.woff2 +0 -0
- package/dist/filament/fonts/filament/filament/inter/inter-greek-wght-normal-ZABHMKQG.woff2 +0 -0
- package/dist/filament/fonts/filament/filament/inter/inter-latin-ext-wght-normal-ZIT2UBIY.woff2 +0 -0
- package/dist/filament/fonts/filament/filament/inter/inter-latin-wght-normal-DIHYUR35.woff2 +0 -0
- package/dist/filament/fonts/filament/filament/inter/inter-vietnamese-wght-normal-VWEHJHBA.woff2 +0 -0
- package/dist/filament/js/filament/actions/actions.js +1 -0
- package/dist/filament/js/filament/filament/app.js +1 -0
- package/dist/filament/js/filament/filament/echo.js +13 -0
- package/dist/filament/js/filament/forms/components/builder.js +1 -0
- package/dist/filament/js/filament/forms/components/checkbox-list.js +1 -0
- package/dist/filament/js/filament/forms/components/code-editor.js +38 -0
- package/dist/filament/js/filament/forms/components/color-picker.js +1 -0
- package/dist/filament/js/filament/forms/components/date-time-picker.js +1 -0
- package/dist/filament/js/filament/forms/components/file-upload.js +116 -0
- package/dist/filament/js/filament/forms/components/js-field.js +1 -0
- package/dist/filament/js/filament/forms/components/key-value.js +1 -0
- package/dist/filament/js/filament/forms/components/markdown-editor.js +51 -0
- package/dist/filament/js/filament/forms/components/repeater.js +1 -0
- package/dist/filament/js/filament/forms/components/rich-editor.js +161 -0
- package/dist/filament/js/filament/forms/components/select.js +11 -0
- package/dist/filament/js/filament/forms/components/slider.js +1 -0
- package/dist/filament/js/filament/forms/components/tags-input.js +1 -0
- package/dist/filament/js/filament/forms/components/text-input/password-reveal.js +1 -0
- package/dist/filament/js/filament/forms/components/textarea.js +1 -0
- package/dist/filament/js/filament/forms/components/toggle-buttons.js +1 -0
- package/dist/filament/js/filament/notifications/notifications.js +1 -0
- package/dist/filament/js/filament/schemas/components/actions.js +1 -0
- package/dist/filament/js/filament/schemas/components/js-component.js +1 -0
- package/dist/filament/js/filament/schemas/components/tabs.js +1 -0
- package/dist/filament/js/filament/schemas/components/wizard.js +1 -0
- package/dist/filament/js/filament/schemas/schemas.js +1 -0
- package/dist/filament/js/filament/support/support.js +46 -0
- package/dist/filament/js/filament/tables/components/columns/checkbox.js +1 -0
- package/dist/filament/js/filament/tables/components/columns/select.js +11 -0
- package/dist/filament/js/filament/tables/components/columns/text-input.js +1 -0
- package/dist/filament/js/filament/tables/components/columns/toggle.js +1 -0
- package/dist/filament/js/filament/tables/tables.js +1 -0
- package/dist/filament/js/filament/widgets/components/chart.js +31 -0
- package/dist/filament/js/filament/widgets/components/js-widget.js +1 -0
- package/dist/filament/js/filament/widgets/components/stats-overview/stat/chart.js +20 -0
- package/dist/navette/navette/calendar.css +108 -0
- package/dist/navette/navette/motion.css +101 -0
- package/dist/navette/navette/motion.js +49 -0
- package/lib/auth.d.ts +61 -0
- package/lib/auth.js +142 -0
- package/lib/calendar.d.ts +82 -0
- package/lib/calendar.js +107 -0
- package/lib/index.d.ts +1619 -0
- package/lib/index.js +3487 -0
- package/lib/notifications.d.ts +76 -0
- package/lib/notifications.js +112 -0
- package/lib/topbar.d.ts +90 -0
- package/lib/topbar.js +241 -0
- package/package.json +59 -4
- package/resources/filament/LICENSE.md +21 -0
- package/resources/filament/README.md +2 -0
- package/resources/filament/packages/actions/resources/css/actions.css +30 -0
- package/resources/filament/packages/actions/resources/css/index.css +1 -0
- package/resources/filament/packages/forms/dist/index.css +1 -0
- package/resources/filament/packages/forms/resources/css/components/builder.css +206 -0
- package/resources/filament/packages/forms/resources/css/components/checkbox-list.css +55 -0
- package/resources/filament/packages/forms/resources/css/components/code-editor.css +79 -0
- package/resources/filament/packages/forms/resources/css/components/color-picker.css +17 -0
- package/resources/filament/packages/forms/resources/css/components/date-time-picker.css +127 -0
- package/resources/filament/packages/forms/resources/css/components/field.css +88 -0
- package/resources/filament/packages/forms/resources/css/components/file-upload/filepond-plugin-media-preview.css +104 -0
- package/resources/filament/packages/forms/resources/css/components/file-upload.css +199 -0
- package/resources/filament/packages/forms/resources/css/components/key-value.css +57 -0
- package/resources/filament/packages/forms/resources/css/components/markdown-editor.css +343 -0
- package/resources/filament/packages/forms/resources/css/components/modal-table-select.css +17 -0
- package/resources/filament/packages/forms/resources/css/components/radio.css +41 -0
- package/resources/filament/packages/forms/resources/css/components/repeater.css +401 -0
- package/resources/filament/packages/forms/resources/css/components/rich-editor.css +666 -0
- package/resources/filament/packages/forms/resources/css/components/select.css +13 -0
- package/resources/filament/packages/forms/resources/css/components/slider.css +54 -0
- package/resources/filament/packages/forms/resources/css/components/tags-input.css +33 -0
- package/resources/filament/packages/forms/resources/css/components/text-input.css +20 -0
- package/resources/filament/packages/forms/resources/css/components/textarea.css +26 -0
- package/resources/filament/packages/forms/resources/css/components/toggle-buttons.css +49 -0
- package/resources/filament/packages/forms/resources/css/index.css +32 -0
- package/resources/filament/packages/infolists/resources/css/components/code.css +21 -0
- package/resources/filament/packages/infolists/resources/css/components/color.css +34 -0
- package/resources/filament/packages/infolists/resources/css/components/entry.css +68 -0
- package/resources/filament/packages/infolists/resources/css/components/icon.css +39 -0
- package/resources/filament/packages/infolists/resources/css/components/image.css +161 -0
- package/resources/filament/packages/infolists/resources/css/components/key-value.css +24 -0
- package/resources/filament/packages/infolists/resources/css/components/repeatable.css +136 -0
- package/resources/filament/packages/infolists/resources/css/components/text.css +234 -0
- package/resources/filament/packages/infolists/resources/css/index.css +14 -0
- package/resources/filament/packages/notifications/resources/css/database-notifications.css +56 -0
- package/resources/filament/packages/notifications/resources/css/index.css +3 -0
- package/resources/filament/packages/notifications/resources/css/notification.css +109 -0
- package/resources/filament/packages/notifications/resources/css/notifications.css +29 -0
- package/resources/filament/packages/panels/resources/css/base.css +13 -0
- package/resources/filament/packages/panels/resources/css/components/global-search.css +93 -0
- package/resources/filament/packages/panels/resources/css/components/header.css +56 -0
- package/resources/filament/packages/panels/resources/css/components/layout.css +182 -0
- package/resources/filament/packages/panels/resources/css/components/logo.css +11 -0
- package/resources/filament/packages/panels/resources/css/components/page.css +60 -0
- package/resources/filament/packages/panels/resources/css/components/sidebar.css +311 -0
- package/resources/filament/packages/panels/resources/css/components/tenant-menu.css +49 -0
- package/resources/filament/packages/panels/resources/css/components/theme-switcher.css +15 -0
- package/resources/filament/packages/panels/resources/css/components/topbar.css +89 -0
- package/resources/filament/packages/panels/resources/css/components/user-menu.css +46 -0
- package/resources/filament/packages/panels/resources/css/index.css +40 -0
- package/resources/filament/packages/panels/resources/css/theme.css +2 -0
- package/resources/filament/packages/panels/resources/css/utilities.css +3 -0
- package/resources/filament/packages/panels/resources/css/widgets/account-widget.css +21 -0
- package/resources/filament/packages/panels/resources/css/widgets/filament-info-widget.css +21 -0
- package/resources/filament/packages/schemas/resources/css/components/actions.css +29 -0
- package/resources/filament/packages/schemas/resources/css/components/flex.css +106 -0
- package/resources/filament/packages/schemas/resources/css/components/form.css +7 -0
- package/resources/filament/packages/schemas/resources/css/components/fused-group.css +337 -0
- package/resources/filament/packages/schemas/resources/css/components/icon.css +11 -0
- package/resources/filament/packages/schemas/resources/css/components/image.css +12 -0
- package/resources/filament/packages/schemas/resources/css/components/section.css +24 -0
- package/resources/filament/packages/schemas/resources/css/components/tabs.css +77 -0
- package/resources/filament/packages/schemas/resources/css/components/text.css +77 -0
- package/resources/filament/packages/schemas/resources/css/components/unordered-list.css +15 -0
- package/resources/filament/packages/schemas/resources/css/components/wizard.css +177 -0
- package/resources/filament/packages/schemas/resources/css/index.css +12 -0
- package/resources/filament/packages/schemas/resources/css/schema.css +132 -0
- package/resources/filament/packages/support/dist/index.css +1 -0
- package/resources/filament/packages/support/resources/css/base.css +23 -0
- package/resources/filament/packages/support/resources/css/components/avatar.css +15 -0
- package/resources/filament/packages/support/resources/css/components/badge.css +90 -0
- package/resources/filament/packages/support/resources/css/components/breadcrumbs.css +25 -0
- package/resources/filament/packages/support/resources/css/components/button.css +214 -0
- package/resources/filament/packages/support/resources/css/components/callout.css +57 -0
- package/resources/filament/packages/support/resources/css/components/dropdown/header.css +21 -0
- package/resources/filament/packages/support/resources/css/components/dropdown/index.css +79 -0
- package/resources/filament/packages/support/resources/css/components/dropdown/list/index.css +7 -0
- package/resources/filament/packages/support/resources/css/components/dropdown/list/item.css +74 -0
- package/resources/filament/packages/support/resources/css/components/empty-state.css +67 -0
- package/resources/filament/packages/support/resources/css/components/fieldset.css +23 -0
- package/resources/filament/packages/support/resources/css/components/grid.css +511 -0
- package/resources/filament/packages/support/resources/css/components/icon-button.css +124 -0
- package/resources/filament/packages/support/resources/css/components/icon.css +31 -0
- package/resources/filament/packages/support/resources/css/components/input/checkbox.css +32 -0
- package/resources/filament/packages/support/resources/css/components/input/index.css +55 -0
- package/resources/filament/packages/support/resources/css/components/input/one-time-code.css +7 -0
- package/resources/filament/packages/support/resources/css/components/input/radio.css +11 -0
- package/resources/filament/packages/support/resources/css/components/input/select.css +154 -0
- package/resources/filament/packages/support/resources/css/components/input/wrapper.css +107 -0
- package/resources/filament/packages/support/resources/css/components/link.css +90 -0
- package/resources/filament/packages/support/resources/css/components/loading-indicator.css +3 -0
- package/resources/filament/packages/support/resources/css/components/loading-section.css +3 -0
- package/resources/filament/packages/support/resources/css/components/modal.css +494 -0
- package/resources/filament/packages/support/resources/css/components/pagination.css +160 -0
- package/resources/filament/packages/support/resources/css/components/section.css +234 -0
- package/resources/filament/packages/support/resources/css/components/tabs.css +70 -0
- package/resources/filament/packages/support/resources/css/components/toggle.css +60 -0
- package/resources/filament/packages/support/resources/css/components/tooltip.css +36 -0
- package/resources/filament/packages/support/resources/css/index.css +133 -0
- package/resources/filament/packages/support/resources/css/sortable.css +3 -0
- package/resources/filament/packages/support/resources/css/utilities.css +897 -0
- package/resources/filament/packages/tables/resources/css/actions.css +51 -0
- package/resources/filament/packages/tables/resources/css/cell.css +139 -0
- package/resources/filament/packages/tables/resources/css/column-manager.css +48 -0
- package/resources/filament/packages/tables/resources/css/columns/checkbox.css +54 -0
- package/resources/filament/packages/tables/resources/css/columns/color.css +76 -0
- package/resources/filament/packages/tables/resources/css/columns/icon.css +81 -0
- package/resources/filament/packages/tables/resources/css/columns/image.css +207 -0
- package/resources/filament/packages/tables/resources/css/columns/layout/grid.css +49 -0
- package/resources/filament/packages/tables/resources/css/columns/layout/panel.css +3 -0
- package/resources/filament/packages/tables/resources/css/columns/layout/split.css +35 -0
- package/resources/filament/packages/tables/resources/css/columns/layout/stack.css +29 -0
- package/resources/filament/packages/tables/resources/css/columns/select.css +36 -0
- package/resources/filament/packages/tables/resources/css/columns/summaries/icon-count.css +43 -0
- package/resources/filament/packages/tables/resources/css/columns/summaries/range.css +27 -0
- package/resources/filament/packages/tables/resources/css/columns/summaries/text.css +29 -0
- package/resources/filament/packages/tables/resources/css/columns/summaries/values.css +33 -0
- package/resources/filament/packages/tables/resources/css/columns/text-input.css +36 -0
- package/resources/filament/packages/tables/resources/css/columns/text.css +319 -0
- package/resources/filament/packages/tables/resources/css/columns/toggle.css +54 -0
- package/resources/filament/packages/tables/resources/css/container.css +311 -0
- package/resources/filament/packages/tables/resources/css/content.css +342 -0
- package/resources/filament/packages/tables/resources/css/empty-state.css +31 -0
- package/resources/filament/packages/tables/resources/css/group-header.css +54 -0
- package/resources/filament/packages/tables/resources/css/header-cell.css +224 -0
- package/resources/filament/packages/tables/resources/css/index.css +26 -0
- package/resources/filament/packages/tables/resources/css/row.css +47 -0
- package/resources/filament/packages/tables/resources/css/table.css +394 -0
- package/resources/filament/packages/widgets/resources/css/chart-widget.css +88 -0
- package/resources/filament/packages/widgets/resources/css/index.css +3 -0
- package/resources/filament/packages/widgets/resources/css/stats-overview-widget.css +67 -0
- package/resources/filament/packages/widgets/resources/css/widget.css +3 -0
- package/theme.css +17 -0
- package/views/components/logo.ejs +9 -0
- package/views/components/tenant-menu.ejs +13 -0
- package/views/components/user-menu.ejs +82 -0
- package/views/layout/base.ejs +129 -0
- package/views/layout/index.ejs +41 -0
- package/views/layout/simple.ejs +19 -0
- package/views/livewire/sidebar.ejs +123 -0
- package/views/livewire/topbar.ejs +47 -0
- package/views/pages/page.ejs +143 -0
- package/views/pages/simple.ejs +32 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
var $t=Math.min,vt=Math.max,Vt=Math.round;var ot=i=>({x:i,y:i}),on={left:"right",right:"left",bottom:"top",top:"bottom"};function Le(i,t,e){return vt(i,$t(t,e))}function Wt(i,t){return typeof i=="function"?i(t):i}function yt(i){return i.split("-")[0]}function zt(i){return i.split("-")[1]}function Re(i){return i==="x"?"y":"x"}function Te(i){return i==="y"?"height":"width"}function ft(i){let t=i[0];return t==="t"||t==="b"?"y":"x"}function Ie(i){return Re(ft(i))}function ei(i,t,e){e===void 0&&(e=!1);let n=zt(i),s=Ie(i),o=Te(s),r=s==="x"?n===(e?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(r=Ht(r)),[r,Ht(r)]}function ii(i){let t=Ht(i);return[oe(i),t,oe(t)]}function oe(i){return i.includes("start")?i.replace("start","end"):i.replace("end","start")}var Ze=["left","right"],ti=["right","left"],rn=["top","bottom"],an=["bottom","top"];function ln(i,t,e){switch(i){case"top":case"bottom":return e?t?ti:Ze:t?Ze:ti;case"left":case"right":return t?rn:an;default:return[]}}function ni(i,t,e,n){let s=zt(i),o=ln(yt(i),e==="start",n);return s&&(o=o.map(r=>r+"-"+s),t&&(o=o.concat(o.map(oe)))),o}function Ht(i){let t=yt(i);return on[t]+i.slice(t.length)}function cn(i){return{top:0,right:0,bottom:0,left:0,...i}}function si(i){return typeof i!="number"?cn(i):{top:i,right:i,bottom:i,left:i}}function Ot(i){let{x:t,y:e,width:n,height:s}=i;return{width:n,height:s,top:e,left:t,right:t+n,bottom:e+s,x:t,y:e}}function oi(i,t,e){let{reference:n,floating:s}=i,o=ft(t),r=Ie(t),a=Te(r),l=yt(t),c=o==="y",h=n.x+n.width/2-s.width/2,u=n.y+n.height/2-s.height/2,f=n[a]/2-s[a]/2,p;switch(l){case"top":p={x:h,y:n.y-s.height};break;case"bottom":p={x:h,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:u};break;case"left":p={x:n.x-s.width,y:u};break;default:p={x:n.x,y:n.y}}switch(zt(t)){case"start":p[r]-=f*(e&&c?-1:1);break;case"end":p[r]+=f*(e&&c?-1:1);break}return p}async function ri(i,t){var e;t===void 0&&(t={});let{x:n,y:s,platform:o,rects:r,elements:a,strategy:l}=i,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:u="floating",altBoundary:f=!1,padding:p=0}=Wt(t,i),m=si(p),w=a[f?u==="floating"?"reference":"floating":u],x=Ot(await o.getClippingRect({element:(e=await(o.isElement==null?void 0:o.isElement(w)))==null||e?w:w.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:h,strategy:l})),S=u==="floating"?{x:n,y:s,width:r.floating.width,height:r.floating.height}:r.reference,A=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),D=await(o.isElement==null?void 0:o.isElement(A))?await(o.getScale==null?void 0:o.getScale(A))||{x:1,y:1}:{x:1,y:1},_=Ot(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:S,offsetParent:A,strategy:l}):S);return{top:(x.top-_.top+m.top)/D.y,bottom:(_.bottom-x.bottom+m.bottom)/D.y,left:(x.left-_.left+m.left)/D.x,right:(_.right-x.right+m.right)/D.x}}var hn=50,ai=async(i,t,e)=>{let{placement:n="bottom",strategy:s="absolute",middleware:o=[],platform:r}=e,a=r.detectOverflow?r:{...r,detectOverflow:ri},l=await(r.isRTL==null?void 0:r.isRTL(t)),c=await r.getElementRects({reference:i,floating:t,strategy:s}),{x:h,y:u}=oi(c,n,l),f=n,p=0,m={};for(let g=0;g<o.length;g++){let w=o[g];if(!w)continue;let{name:x,fn:S}=w,{x:A,y:D,data:_,reset:C}=await S({x:h,y:u,initialPlacement:n,placement:f,strategy:s,middlewareData:m,rects:c,platform:a,elements:{reference:i,floating:t}});h=A??h,u=D??u,m[x]={...m[x],..._},C&&p<hn&&(p++,typeof C=="object"&&(C.placement&&(f=C.placement),C.rects&&(c=C.rects===!0?await r.getElementRects({reference:i,floating:t,strategy:s}):C.rects),{x:h,y:u}=oi(c,f,l)),g=-1)}return{x:h,y:u,placement:f,strategy:s,middlewareData:m}};var li=function(i){return i===void 0&&(i={}),{name:"flip",options:i,async fn(t){var e,n;let{placement:s,middlewareData:o,rects:r,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:h=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...w}=Wt(i,t);if((e=o.arrow)!=null&&e.alignmentOffset)return{};let x=yt(s),S=ft(a),A=yt(a)===a,D=await(l.isRTL==null?void 0:l.isRTL(c.floating)),_=f||(A||!g?[Ht(a)]:ii(a)),C=m!=="none";!f&&C&&_.push(...ni(a,g,m,D));let V=[a,..._],J=await l.detectOverflow(t,w),I=[],W=((n=o.flip)==null?void 0:n.overflows)||[];if(h&&I.push(J[x]),u){let P=ei(s,r,D);I.push(J[P[0]],J[P[1]])}if(W=[...W,{placement:s,overflows:I}],!I.every(P=>P<=0)){var Y,tt;let P=(((Y=o.flip)==null?void 0:Y.index)||0)+1,N=V[P];if(N&&(!(u==="alignment"?S!==ft(N):!1)||W.every(F=>ft(F.placement)===S?F.overflows[0]>0:!0)))return{data:{index:P,overflows:W},reset:{placement:N}};let L=(tt=W.filter(q=>q.overflows[0]<=0).sort((q,F)=>q.overflows[1]-F.overflows[1])[0])==null?void 0:tt.placement;if(!L)switch(p){case"bestFit":{var z;let q=(z=W.filter(F=>{if(C){let et=ft(F.placement);return et===S||et==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(et=>et>0).reduce((et,se)=>et+se,0)]).sort((F,et)=>F[1]-et[1])[0])==null?void 0:z[0];q&&(L=q);break}case"initialPlacement":L=a;break}if(s!==L)return{reset:{placement:L}}}return{}}}};var un=new Set(["left","top"]);async function dn(i,t){let{placement:e,platform:n,elements:s}=i,o=await(n.isRTL==null?void 0:n.isRTL(s.floating)),r=yt(e),a=zt(e),l=ft(e)==="y",c=un.has(r)?-1:1,h=o&&l?-1:1,u=Wt(t,i),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&typeof m=="number"&&(p=a==="end"?m*-1:m),l?{x:p*h,y:f*c}:{x:f*c,y:p*h}}var ci=function(i){return i===void 0&&(i=0),{name:"offset",options:i,async fn(t){var e,n;let{x:s,y:o,placement:r,middlewareData:a}=t,l=await dn(t,i);return r===((e=a.offset)==null?void 0:e.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:s+l.x,y:o+l.y,data:{...l,placement:r}}}}},hi=function(i){return i===void 0&&(i={}),{name:"shift",options:i,async fn(t){let{x:e,y:n,placement:s,platform:o}=t,{mainAxis:r=!0,crossAxis:a=!1,limiter:l={fn:x=>{let{x:S,y:A}=x;return{x:S,y:A}}},...c}=Wt(i,t),h={x:e,y:n},u=await o.detectOverflow(t,c),f=ft(yt(s)),p=Re(f),m=h[p],g=h[f];if(r){let x=p==="y"?"top":"left",S=p==="y"?"bottom":"right",A=m+u[x],D=m-u[S];m=Le(A,m,D)}if(a){let x=f==="y"?"top":"left",S=f==="y"?"bottom":"right",A=g+u[x],D=g-u[S];g=Le(A,g,D)}let w=l.fn({...t,[p]:m,[f]:g});return{...w,data:{x:w.x-e,y:w.y-n,enabled:{[p]:r,[f]:a}}}}}};function ae(){return typeof window<"u"}function xt(i){return di(i)?(i.nodeName||"").toLowerCase():"#document"}function K(i){var t;return(i==null||(t=i.ownerDocument)==null?void 0:t.defaultView)||window}function lt(i){var t;return(t=(di(i)?i.ownerDocument:i.document)||window.document)==null?void 0:t.documentElement}function di(i){return ae()?i instanceof Node||i instanceof K(i).Node:!1}function it(i){return ae()?i instanceof Element||i instanceof K(i).Element:!1}function ct(i){return ae()?i instanceof HTMLElement||i instanceof K(i).HTMLElement:!1}function ui(i){return!ae()||typeof ShadowRoot>"u"?!1:i instanceof ShadowRoot||i instanceof K(i).ShadowRoot}function Tt(i){let{overflow:t,overflowX:e,overflowY:n,display:s}=nt(i);return/auto|scroll|overlay|hidden|clip/.test(t+n+e)&&s!=="inline"&&s!=="contents"}function fi(i){return/^(table|td|th)$/.test(xt(i))}function Xt(i){try{if(i.matches(":popover-open"))return!0}catch{}try{return i.matches(":modal")}catch{return!1}}var fn=/transform|translate|scale|rotate|perspective|filter/,pn=/paint|layout|strict|content/,Dt=i=>!!i&&i!=="none",Me;function le(i){let t=it(i)?nt(i):i;return Dt(t.transform)||Dt(t.translate)||Dt(t.scale)||Dt(t.rotate)||Dt(t.perspective)||!ce()&&(Dt(t.backdropFilter)||Dt(t.filter))||fn.test(t.willChange||"")||pn.test(t.contain||"")}function pi(i){let t=pt(i);for(;ct(t)&&!At(t);){if(le(t))return t;if(Xt(t))return null;t=pt(t)}return null}function ce(){return Me==null&&(Me=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Me}function At(i){return/^(html|body|#document)$/.test(xt(i))}function nt(i){return K(i).getComputedStyle(i)}function Yt(i){return it(i)?{scrollLeft:i.scrollLeft,scrollTop:i.scrollTop}:{scrollLeft:i.scrollX,scrollTop:i.scrollY}}function pt(i){if(xt(i)==="html")return i;let t=i.assignedSlot||i.parentNode||ui(i)&&i.host||lt(i);return ui(t)?t.host:t}function mi(i){let t=pt(i);return At(t)?i.ownerDocument?i.ownerDocument.body:i.body:ct(t)&&Tt(t)?t:mi(t)}function re(i,t,e){var n;t===void 0&&(t=[]),e===void 0&&(e=!0);let s=mi(i),o=s===((n=i.ownerDocument)==null?void 0:n.body),r=K(s);if(o){let a=he(r);return t.concat(r,r.visualViewport||[],Tt(s)?s:[],a&&e?re(a):[])}else return t.concat(s,re(s,[],e))}function he(i){return i.parent&&Object.getPrototypeOf(i.parent)?i.frameElement:null}function yi(i){let t=nt(i),e=parseFloat(t.width)||0,n=parseFloat(t.height)||0,s=ct(i),o=s?i.offsetWidth:e,r=s?i.offsetHeight:n,a=Vt(e)!==o||Vt(n)!==r;return a&&(e=o,n=r),{width:e,height:n,$:a}}function wi(i){return it(i)?i:i.contextElement}function It(i){let t=wi(i);if(!ct(t))return ot(1);let e=t.getBoundingClientRect(),{width:n,height:s,$:o}=yi(t),r=(o?Vt(e.width):e.width)/n,a=(o?Vt(e.height):e.height)/s;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}var mn=ot(0);function Si(i){let t=K(i);return!ce()||!t.visualViewport?mn:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function gn(i,t,e){return t===void 0&&(t=!1),!e||t&&e!==K(i)?!1:t}function jt(i,t,e,n){t===void 0&&(t=!1),e===void 0&&(e=!1);let s=i.getBoundingClientRect(),o=wi(i),r=ot(1);t&&(n?it(n)&&(r=It(n)):r=It(i));let a=gn(o,e,n)?Si(o):ot(0),l=(s.left+a.x)/r.x,c=(s.top+a.y)/r.y,h=s.width/r.x,u=s.height/r.y;if(o){let f=K(o),p=n&&it(n)?K(n):n,m=f,g=he(m);for(;g&&n&&p!==m;){let w=It(g),x=g.getBoundingClientRect(),S=nt(g),A=x.left+(g.clientLeft+parseFloat(S.paddingLeft))*w.x,D=x.top+(g.clientTop+parseFloat(S.paddingTop))*w.y;l*=w.x,c*=w.y,h*=w.x,u*=w.y,l+=A,c+=D,m=K(g),g=he(m)}}return Ot({width:h,height:u,x:l,y:c})}function ue(i,t){let e=Yt(i).scrollLeft;return t?t.left+e:jt(lt(i)).left+e}function Ei(i,t){let e=i.getBoundingClientRect(),n=e.left+t.scrollLeft-ue(i,e),s=e.top+t.scrollTop;return{x:n,y:s}}function bn(i){let{elements:t,rect:e,offsetParent:n,strategy:s}=i,o=s==="fixed",r=lt(n),a=t?Xt(t.floating):!1;if(n===r||a&&o)return e;let l={scrollLeft:0,scrollTop:0},c=ot(1),h=ot(0),u=ct(n);if((u||!u&&!o)&&((xt(n)!=="body"||Tt(r))&&(l=Yt(n)),u)){let p=jt(n);c=It(n),h.x=p.x+n.clientLeft,h.y=p.y+n.clientTop}let f=r&&!u&&!o?Ei(r,l):ot(0);return{width:e.width*c.x,height:e.height*c.y,x:e.x*c.x-l.scrollLeft*c.x+h.x+f.x,y:e.y*c.y-l.scrollTop*c.y+h.y+f.y}}function vn(i){return Array.from(i.getClientRects())}function yn(i){let t=lt(i),e=Yt(i),n=i.ownerDocument.body,s=vt(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=vt(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight),r=-e.scrollLeft+ue(i),a=-e.scrollTop;return nt(n).direction==="rtl"&&(r+=vt(t.clientWidth,n.clientWidth)-s),{width:s,height:o,x:r,y:a}}var gi=25;function wn(i,t){let e=K(i),n=lt(i),s=e.visualViewport,o=n.clientWidth,r=n.clientHeight,a=0,l=0;if(s){o=s.width,r=s.height;let h=ce();(!h||h&&t==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}let c=ue(n);if(c<=0){let h=n.ownerDocument,u=h.body,f=getComputedStyle(u),p=h.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,m=Math.abs(n.clientWidth-u.clientWidth-p);m<=gi&&(o-=m)}else c<=gi&&(o+=c);return{width:o,height:r,x:a,y:l}}function Sn(i,t){let e=jt(i,!0,t==="fixed"),n=e.top+i.clientTop,s=e.left+i.clientLeft,o=ct(i)?It(i):ot(1),r=i.clientWidth*o.x,a=i.clientHeight*o.y,l=s*o.x,c=n*o.y;return{width:r,height:a,x:l,y:c}}function bi(i,t,e){let n;if(t==="viewport")n=wn(i,e);else if(t==="document")n=yn(lt(i));else if(it(t))n=Sn(t,e);else{let s=Si(i);n={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Ot(n)}function Oi(i,t){let e=pt(i);return e===t||!it(e)||At(e)?!1:nt(e).position==="fixed"||Oi(e,t)}function En(i,t){let e=t.get(i);if(e)return e;let n=re(i,[],!1).filter(a=>it(a)&&xt(a)!=="body"),s=null,o=nt(i).position==="fixed",r=o?pt(i):i;for(;it(r)&&!At(r);){let a=nt(r),l=le(r);!l&&a.position==="fixed"&&(s=null),(o?!l&&!s:!l&&a.position==="static"&&!!s&&(s.position==="absolute"||s.position==="fixed")||Tt(r)&&!l&&Oi(i,r))?n=n.filter(h=>h!==r):s=a,r=pt(r)}return t.set(i,n),n}function On(i){let{element:t,boundary:e,rootBoundary:n,strategy:s}=i,r=[...e==="clippingAncestors"?Xt(t)?[]:En(t,this._c):[].concat(e),n],a=bi(t,r[0],s),l=a.top,c=a.right,h=a.bottom,u=a.left;for(let f=1;f<r.length;f++){let p=bi(t,r[f],s);l=vt(p.top,l),c=$t(p.right,c),h=$t(p.bottom,h),u=vt(p.left,u)}return{width:c-u,height:h-l,x:u,y:l}}function Dn(i){let{width:t,height:e}=yi(i);return{width:t,height:e}}function xn(i,t,e){let n=ct(t),s=lt(t),o=e==="fixed",r=jt(i,!0,o,t),a={scrollLeft:0,scrollTop:0},l=ot(0);function c(){l.x=ue(s)}if(n||!n&&!o)if((xt(t)!=="body"||Tt(s))&&(a=Yt(t)),n){let p=jt(t,!0,o,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else s&&c();o&&!n&&s&&c();let h=s&&!n&&!o?Ei(s,a):ot(0),u=r.left+a.scrollLeft-l.x-h.x,f=r.top+a.scrollTop-l.y-h.y;return{x:u,y:f,width:r.width,height:r.height}}function _e(i){return nt(i).position==="static"}function vi(i,t){if(!ct(i)||nt(i).position==="fixed")return null;if(t)return t(i);let e=i.offsetParent;return lt(i)===e&&(e=e.ownerDocument.body),e}function Di(i,t){let e=K(i);if(Xt(i))return e;if(!ct(i)){let s=pt(i);for(;s&&!At(s);){if(it(s)&&!_e(s))return s;s=pt(s)}return e}let n=vi(i,t);for(;n&&fi(n)&&_e(n);)n=vi(n,t);return n&&At(n)&&_e(n)&&!le(n)?e:n||pi(i)||e}var An=async function(i){let t=this.getOffsetParent||Di,e=this.getDimensions,n=await e(i.floating);return{reference:xn(i.reference,await t(i.floating),i.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function Cn(i){return nt(i).direction==="rtl"}var Ln={convertOffsetParentRelativeRectToViewportRelativeRect:bn,getDocumentElement:lt,getClippingRect:On,getOffsetParent:Di,getElementRects:An,getClientRects:vn,getDimensions:Dn,getScale:It,isElement:it,isRTL:Cn};var xi=ci;var Ai=hi,Ci=li;var Li=(i,t,e)=>{let n=new Map,s={platform:Ln,...e},o={...s.platform,_c:n};return ai(i,t,{...s,platform:o})};function Rn(i,t,e){return(t=_n(t))in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}function gt(){return gt=Object.assign?Object.assign.bind():function(i){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var n in e)({}).hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},gt.apply(null,arguments)}function Ri(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(i,s).enumerable})),e.push.apply(e,n)}return e}function ut(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?Ri(Object(e),!0).forEach(function(n){Rn(i,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(e)):Ri(Object(e)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(e,n))})}return i}function Tn(i,t){if(i==null)return{};var e,n,s=In(i,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(i);for(n=0;n<o.length;n++)e=o[n],t.indexOf(e)===-1&&{}.propertyIsEnumerable.call(i,e)&&(s[e]=i[e])}return s}function In(i,t){if(i==null)return{};var e={};for(var n in i)if({}.hasOwnProperty.call(i,n)){if(t.indexOf(n)!==-1)continue;e[n]=i[n]}return e}function Mn(i,t){if(typeof i!="object"||!i)return i;var e=i[Symbol.toPrimitive];if(e!==void 0){var n=e.call(i,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(i)}function _n(i){var t=Mn(i,"string");return typeof t=="symbol"?t:t+""}function ze(i){"@babel/helpers - typeof";return ze=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ze(i)}var Pn="1.15.7";function mt(i){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(i)}var bt=mt(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),ee=mt(/Edge/i),Ti=mt(/firefox/i),Gt=mt(/safari/i)&&!mt(/chrome/i)&&!mt(/android/i),Ke=mt(/iP(ad|od|hone)/i),Fi=mt(/chrome/i)&&mt(/android/i),Hi={capture:!1,passive:!1};function O(i,t,e){i.addEventListener(t,e,!bt&&Hi)}function E(i,t,e){i.removeEventListener(t,e,!bt&&Hi)}function we(i,t){if(t){if(t[0]===">"&&(t=t.substring(1)),i)try{if(i.matches)return i.matches(t);if(i.msMatchesSelector)return i.msMatchesSelector(t);if(i.webkitMatchesSelector)return i.webkitMatchesSelector(t)}catch{return!1}return!1}}function $i(i){return i.host&&i!==document&&i.host.nodeType&&i.host!==i?i.host:i.parentNode}function at(i,t,e,n){if(i){e=e||document;do{if(t!=null&&(t[0]===">"?i.parentNode===e&&we(i,t):we(i,t))||n&&i===e)return i;if(i===e)break}while(i=$i(i))}return null}var Ii=/\s+/g;function Q(i,t,e){if(i&&t)if(i.classList)i.classList[e?"add":"remove"](t);else{var n=(" "+i.className+" ").replace(Ii," ").replace(" "+t+" "," ");i.className=(n+(e?" "+t:"")).replace(Ii," ")}}function b(i,t,e){var n=i&&i.style;if(n){if(e===void 0)return document.defaultView&&document.defaultView.getComputedStyle?e=document.defaultView.getComputedStyle(i,""):i.currentStyle&&(e=i.currentStyle),t===void 0?e:e[t];!(t in n)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),n[t]=e+(typeof e=="string"?"":"px")}}function Bt(i,t){var e="";if(typeof i=="string")e=i;else do{var n=b(i,"transform");n&&n!=="none"&&(e=n+" "+e)}while(!t&&(i=i.parentNode));var s=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return s&&new s(e)}function Vi(i,t,e){if(i){var n=i.getElementsByTagName(t),s=0,o=n.length;if(e)for(;s<o;s++)e(n[s],s);return n}return[]}function ht(){var i=document.scrollingElement;return i||document.documentElement}function k(i,t,e,n,s){if(!(!i.getBoundingClientRect&&i!==window)){var o,r,a,l,c,h,u;if(i!==window&&i.parentNode&&i!==ht()?(o=i.getBoundingClientRect(),r=o.top,a=o.left,l=o.bottom,c=o.right,h=o.height,u=o.width):(r=0,a=0,l=window.innerHeight,c=window.innerWidth,h=window.innerHeight,u=window.innerWidth),(t||e)&&i!==window&&(s=s||i.parentNode,!bt))do if(s&&s.getBoundingClientRect&&(b(s,"transform")!=="none"||e&&b(s,"position")!=="static")){var f=s.getBoundingClientRect();r-=f.top+parseInt(b(s,"border-top-width")),a-=f.left+parseInt(b(s,"border-left-width")),l=r+o.height,c=a+o.width;break}while(s=s.parentNode);if(n&&i!==window){var p=Bt(s||i),m=p&&p.a,g=p&&p.d;p&&(r/=g,a/=m,u/=m,h/=g,l=r+h,c=a+u)}return{top:r,left:a,bottom:l,right:c,width:u,height:h}}}function Mi(i,t,e){for(var n=Et(i,!0),s=k(i)[t];n;){var o=k(n)[e],r=void 0;if(e==="top"||e==="left"?r=s>=o:r=s<=o,!r)return n;if(n===ht())break;n=Et(n,!1)}return!1}function kt(i,t,e,n){for(var s=0,o=0,r=i.children;o<r.length;){if(r[o].style.display!=="none"&&r[o]!==v.ghost&&(n||r[o]!==v.dragged)&&at(r[o],e.draggable,i,!1)){if(s===t)return r[o];s++}o++}return null}function Ue(i,t){for(var e=i.lastElementChild;e&&(e===v.ghost||b(e,"display")==="none"||t&&!we(e,t));)e=e.previousElementSibling;return e||null}function st(i,t){var e=0;if(!i||!i.parentNode)return-1;for(;i=i.previousElementSibling;)i.nodeName.toUpperCase()!=="TEMPLATE"&&i!==v.clone&&(!t||we(i,t))&&e++;return e}function _i(i){var t=0,e=0,n=ht();if(i)do{var s=Bt(i),o=s.a,r=s.d;t+=i.scrollLeft*o,e+=i.scrollTop*r}while(i!==n&&(i=i.parentNode));return[t,e]}function Nn(i,t){for(var e in i)if(i.hasOwnProperty(e)){for(var n in t)if(t.hasOwnProperty(n)&&t[n]===i[e][n])return Number(e)}return-1}function Et(i,t){if(!i||!i.getBoundingClientRect)return ht();var e=i,n=!1;do if(e.clientWidth<e.scrollWidth||e.clientHeight<e.scrollHeight){var s=b(e);if(e.clientWidth<e.scrollWidth&&(s.overflowX=="auto"||s.overflowX=="scroll")||e.clientHeight<e.scrollHeight&&(s.overflowY=="auto"||s.overflowY=="scroll")){if(!e.getBoundingClientRect||e===document.body)return ht();if(n||t)return e;n=!0}}while(e=e.parentNode);return ht()}function Bn(i,t){if(i&&t)for(var e in t)t.hasOwnProperty(e)&&(i[e]=t[e]);return i}function Pe(i,t){return Math.round(i.top)===Math.round(t.top)&&Math.round(i.left)===Math.round(t.left)&&Math.round(i.height)===Math.round(t.height)&&Math.round(i.width)===Math.round(t.width)}var Jt;function Wi(i,t){return function(){if(!Jt){var e=arguments,n=this;e.length===1?i.call(n,e[0]):i.apply(n,e),Jt=setTimeout(function(){Jt=void 0},t)}}}function kn(){clearTimeout(Jt),Jt=void 0}function zi(i,t,e){i.scrollLeft+=t,i.scrollTop+=e}function Xi(i){var t=window.Polymer,e=window.jQuery||window.Zepto;return t&&t.dom?t.dom(i).cloneNode(!0):e?e(i).clone(!0)[0]:i.cloneNode(!0)}function Yi(i,t,e){var n={};return Array.from(i.children).forEach(function(s){var o,r,a,l;if(!(!at(s,t.draggable,i,!1)||s.animated||s===e)){var c=k(s);n.left=Math.min((o=n.left)!==null&&o!==void 0?o:1/0,c.left),n.top=Math.min((r=n.top)!==null&&r!==void 0?r:1/0,c.top),n.right=Math.max((a=n.right)!==null&&a!==void 0?a:-1/0,c.right),n.bottom=Math.max((l=n.bottom)!==null&&l!==void 0?l:-1/0,c.bottom)}}),n.width=n.right-n.left,n.height=n.bottom-n.top,n.x=n.left,n.y=n.top,n}var G="Sortable"+new Date().getTime();function Fn(){var i=[],t;return{captureAnimationState:function(){if(i=[],!!this.options.animation){var n=[].slice.call(this.el.children);n.forEach(function(s){if(!(b(s,"display")==="none"||s===v.ghost)){i.push({target:s,rect:k(s)});var o=ut({},i[i.length-1].rect);if(s.thisAnimationDuration){var r=Bt(s,!0);r&&(o.top-=r.f,o.left-=r.e)}s.fromRect=o}})}},addAnimationState:function(n){i.push(n)},removeAnimationState:function(n){i.splice(Nn(i,{target:n}),1)},animateAll:function(n){var s=this;if(!this.options.animation){clearTimeout(t),typeof n=="function"&&n();return}var o=!1,r=0;i.forEach(function(a){var l=0,c=a.target,h=c.fromRect,u=k(c),f=c.prevFromRect,p=c.prevToRect,m=a.rect,g=Bt(c,!0);g&&(u.top-=g.f,u.left-=g.e),c.toRect=u,c.thisAnimationDuration&&Pe(f,u)&&!Pe(h,u)&&(m.top-u.top)/(m.left-u.left)===(h.top-u.top)/(h.left-u.left)&&(l=$n(m,f,p,s.options)),Pe(u,h)||(c.prevFromRect=h,c.prevToRect=u,l||(l=s.options.animation),s.animate(c,m,u,l)),l&&(o=!0,r=Math.max(r,l),clearTimeout(c.animationResetTimer),c.animationResetTimer=setTimeout(function(){c.animationTime=0,c.prevFromRect=null,c.fromRect=null,c.prevToRect=null,c.thisAnimationDuration=null},l),c.thisAnimationDuration=l)}),clearTimeout(t),o?t=setTimeout(function(){typeof n=="function"&&n()},r):typeof n=="function"&&n(),i=[]},animate:function(n,s,o,r){if(r){b(n,"transition",""),b(n,"transform","");var a=Bt(this.el),l=a&&a.a,c=a&&a.d,h=(s.left-o.left)/(l||1),u=(s.top-o.top)/(c||1);n.animatingX=!!h,n.animatingY=!!u,b(n,"transform","translate3d("+h+"px,"+u+"px,0)"),this.forRepaintDummy=Hn(n),b(n,"transition","transform "+r+"ms"+(this.options.easing?" "+this.options.easing:"")),b(n,"transform","translate3d(0,0,0)"),typeof n.animated=="number"&&clearTimeout(n.animated),n.animated=setTimeout(function(){b(n,"transition",""),b(n,"transform",""),n.animated=!1,n.animatingX=!1,n.animatingY=!1},r)}}}}function Hn(i){return i.offsetWidth}function $n(i,t,e,n){return Math.sqrt(Math.pow(t.top-i.top,2)+Math.pow(t.left-i.left,2))/Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))*n.animation}var Mt=[],Ne={initializeByDefault:!0},ie={mount:function(t){for(var e in Ne)Ne.hasOwnProperty(e)&&!(e in t)&&(t[e]=Ne[e]);Mt.forEach(function(n){if(n.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),Mt.push(t)},pluginEvent:function(t,e,n){var s=this;this.eventCanceled=!1,n.cancel=function(){s.eventCanceled=!0};var o=t+"Global";Mt.forEach(function(r){e[r.pluginName]&&(e[r.pluginName][o]&&e[r.pluginName][o](ut({sortable:e},n)),e.options[r.pluginName]&&e[r.pluginName][t]&&e[r.pluginName][t](ut({sortable:e},n)))})},initializePlugins:function(t,e,n,s){Mt.forEach(function(a){var l=a.pluginName;if(!(!t.options[l]&&!a.initializeByDefault)){var c=new a(t,e,t.options);c.sortable=t,c.options=t.options,t[l]=c,gt(n,c.defaults)}});for(var o in t.options)if(t.options.hasOwnProperty(o)){var r=this.modifyOption(t,o,t.options[o]);typeof r<"u"&&(t.options[o]=r)}},getEventProperties:function(t,e){var n={};return Mt.forEach(function(s){typeof s.eventProperties=="function"&>(n,s.eventProperties.call(e[s.pluginName],t))}),n},modifyOption:function(t,e,n){var s;return Mt.forEach(function(o){t[o.pluginName]&&o.optionListeners&&typeof o.optionListeners[e]=="function"&&(s=o.optionListeners[e].call(t[o.pluginName],n))}),s}};function Vn(i){var t=i.sortable,e=i.rootEl,n=i.name,s=i.targetEl,o=i.cloneEl,r=i.toEl,a=i.fromEl,l=i.oldIndex,c=i.newIndex,h=i.oldDraggableIndex,u=i.newDraggableIndex,f=i.originalEvent,p=i.putSortable,m=i.extraEventProperties;if(t=t||e&&e[G],!!t){var g,w=t.options,x="on"+n.charAt(0).toUpperCase()+n.substr(1);window.CustomEvent&&!bt&&!ee?g=new CustomEvent(n,{bubbles:!0,cancelable:!0}):(g=document.createEvent("Event"),g.initEvent(n,!0,!0)),g.to=r||e,g.from=a||e,g.item=s||e,g.clone=o,g.oldIndex=l,g.newIndex=c,g.oldDraggableIndex=h,g.newDraggableIndex=u,g.originalEvent=f,g.pullMode=p?p.lastPutMode:void 0;var S=ut(ut({},m),ie.getEventProperties(n,t));for(var A in S)g[A]=S[A];e&&e.dispatchEvent(g),w[x]&&w[x].call(t,g)}}var Wn=["evt"],U=function(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=n.evt,o=Tn(n,Wn);ie.pluginEvent.bind(v)(t,e,ut({dragEl:d,parentEl:M,ghostEl:y,rootEl:R,nextEl:Rt,lastDownEl:ge,cloneEl:T,cloneHidden:St,dragStarted:qt,putSortable:$,activeSortable:v.active,originalEvent:s,oldIndex:Nt,oldDraggableIndex:Qt,newIndex:Z,newDraggableIndex:wt,hideGhostForTarget:Ui,unhideGhostForTarget:Gi,cloneNowHidden:function(){St=!0},cloneNowShown:function(){St=!1},dispatchSortableEvent:function(a){j({sortable:e,name:a,originalEvent:s})}},o))};function j(i){Vn(ut({putSortable:$,cloneEl:T,targetEl:d,rootEl:R,oldIndex:Nt,oldDraggableIndex:Qt,newIndex:Z,newDraggableIndex:wt},i))}var d,M,y,R,Rt,ge,T,St,Nt,Z,Qt,wt,de,$,Pt=!1,Se=!1,Ee=[],Ct,rt,Be,ke,Pi,Ni,qt,_t,Zt,te=!1,fe=!1,be,X,Fe=[],Xe=!1,Oe=[],xe=typeof document<"u",pe=Ke,Bi=ee||bt?"cssFloat":"float",zn=xe&&!Fi&&!Ke&&"draggable"in document.createElement("div"),ji=(function(){if(xe){if(bt)return!1;var i=document.createElement("x");return i.style.cssText="pointer-events:auto",i.style.pointerEvents==="auto"}})(),qi=function(t,e){var n=b(t),s=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),o=kt(t,0,e),r=kt(t,1,e),a=o&&b(o),l=r&&b(r),c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+k(o).width,h=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+k(r).width;if(n.display==="flex")return n.flexDirection==="column"||n.flexDirection==="column-reverse"?"vertical":"horizontal";if(n.display==="grid")return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(o&&a.float&&a.float!=="none"){var u=a.float==="left"?"left":"right";return r&&(l.clear==="both"||l.clear===u)?"vertical":"horizontal"}return o&&(a.display==="block"||a.display==="flex"||a.display==="table"||a.display==="grid"||c>=s&&n[Bi]==="none"||r&&n[Bi]==="none"&&c+h>s)?"vertical":"horizontal"},Xn=function(t,e,n){var s=n?t.left:t.top,o=n?t.right:t.bottom,r=n?t.width:t.height,a=n?e.left:e.top,l=n?e.right:e.bottom,c=n?e.width:e.height;return s===a||o===l||s+r/2===a+c/2},Yn=function(t,e){var n;return Ee.some(function(s){var o=s[G].options.emptyInsertThreshold;if(!(!o||Ue(s))){var r=k(s),a=t>=r.left-o&&t<=r.right+o,l=e>=r.top-o&&e<=r.bottom+o;if(a&&l)return n=s}}),n},Ki=function(t){function e(o,r){return function(a,l,c,h){var u=a.options.group.name&&l.options.group.name&&a.options.group.name===l.options.group.name;if(o==null&&(r||u))return!0;if(o==null||o===!1)return!1;if(r&&o==="clone")return o;if(typeof o=="function")return e(o(a,l,c,h),r)(a,l,c,h);var f=(r?a:l).options.group.name;return o===!0||typeof o=="string"&&o===f||o.join&&o.indexOf(f)>-1}}var n={},s=t.group;(!s||ze(s)!="object")&&(s={name:s}),n.name=s.name,n.checkPull=e(s.pull,!0),n.checkPut=e(s.put),n.revertClone=s.revertClone,t.group=n},Ui=function(){!ji&&y&&b(y,"display","none")},Gi=function(){!ji&&y&&b(y,"display","")};xe&&!Fi&&document.addEventListener("click",function(i){if(Se)return i.preventDefault(),i.stopPropagation&&i.stopPropagation(),i.stopImmediatePropagation&&i.stopImmediatePropagation(),Se=!1,!1},!0);var Lt=function(t){if(d){t=t.touches?t.touches[0]:t;var e=Yn(t.clientX,t.clientY);if(e){var n={};for(var s in t)t.hasOwnProperty(s)&&(n[s]=t[s]);n.target=n.rootEl=e,n.preventDefault=void 0,n.stopPropagation=void 0,e[G]._onDragOver(n)}}},jn=function(t){d&&d.parentNode[G]._isOutsideThisEl(t.target)};function v(i,t){if(!(i&&i.nodeType&&i.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(i));this.el=i,this.options=t=gt({},t),i[G]=this;var e={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(i.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return qi(i,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(r,a){r.setData("Text",a.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:v.supportPointer!==!1&&"PointerEvent"in window&&(!Gt||Ke),emptyInsertThreshold:5};ie.initializePlugins(this,i,e);for(var n in e)!(n in t)&&(t[n]=e[n]);Ki(t);for(var s in this)s.charAt(0)==="_"&&typeof this[s]=="function"&&(this[s]=this[s].bind(this));this.nativeDraggable=t.forceFallback?!1:zn,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?O(i,"pointerdown",this._onTapStart):(O(i,"mousedown",this._onTapStart),O(i,"touchstart",this._onTapStart)),this.nativeDraggable&&(O(i,"dragover",this),O(i,"dragenter",this)),Ee.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),gt(this,Fn())}v.prototype={constructor:v,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(_t=null)},_getDirection:function(t,e){return typeof this.options.direction=="function"?this.options.direction.call(this,t,e,d):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,n=this.el,s=this.options,o=s.preventOnFilter,r=t.type,a=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,l=(a||t).target,c=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||l,h=s.filter;if(ts(n),!d&&!(/mousedown|pointerdown/.test(r)&&t.button!==0||s.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&Gt&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=at(l,s.draggable,n,!1),!(l&&l.animated)&&ge!==l)){if(Nt=st(l),Qt=st(l,s.draggable),typeof h=="function"){if(h.call(this,t,l,this)){j({sortable:e,rootEl:c,name:"filter",targetEl:l,toEl:n,fromEl:n}),U("filter",e,{evt:t}),o&&t.preventDefault();return}}else if(h&&(h=h.split(",").some(function(u){if(u=at(c,u.trim(),n,!1),u)return j({sortable:e,rootEl:u,name:"filter",targetEl:l,fromEl:n,toEl:n}),U("filter",e,{evt:t}),!0}),h)){o&&t.preventDefault();return}s.handle&&!at(c,s.handle,n,!1)||this._prepareDragStart(t,a,l)}}},_prepareDragStart:function(t,e,n){var s=this,o=s.el,r=s.options,a=o.ownerDocument,l;if(n&&!d&&n.parentNode===o){var c=k(n);if(R=o,d=n,M=d.parentNode,Rt=d.nextSibling,ge=n,de=r.group,v.dragged=d,Ct={target:d,clientX:(e||t).clientX,clientY:(e||t).clientY},Pi=Ct.clientX-c.left,Ni=Ct.clientY-c.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,d.style["will-change"]="all",l=function(){if(U("delayEnded",s,{evt:t}),v.eventCanceled){s._onDrop();return}s._disableDelayedDragEvents(),!Ti&&s.nativeDraggable&&(d.draggable=!0),s._triggerDragStart(t,e),j({sortable:s,name:"choose",originalEvent:t}),Q(d,r.chosenClass,!0)},r.ignore.split(",").forEach(function(h){Vi(d,h.trim(),He)}),O(a,"dragover",Lt),O(a,"mousemove",Lt),O(a,"touchmove",Lt),r.supportPointer?(O(a,"pointerup",s._onDrop),!this.nativeDraggable&&O(a,"pointercancel",s._onDrop)):(O(a,"mouseup",s._onDrop),O(a,"touchend",s._onDrop),O(a,"touchcancel",s._onDrop)),Ti&&this.nativeDraggable&&(this.options.touchStartThreshold=4,d.draggable=!0),U("delayStart",this,{evt:t}),r.delay&&(!r.delayOnTouchOnly||e)&&(!this.nativeDraggable||!(ee||bt))){if(v.eventCanceled){this._onDrop();return}r.supportPointer?(O(a,"pointerup",s._disableDelayedDrag),O(a,"pointercancel",s._disableDelayedDrag)):(O(a,"mouseup",s._disableDelayedDrag),O(a,"touchend",s._disableDelayedDrag),O(a,"touchcancel",s._disableDelayedDrag)),O(a,"mousemove",s._delayedDragTouchMoveHandler),O(a,"touchmove",s._delayedDragTouchMoveHandler),r.supportPointer&&O(a,"pointermove",s._delayedDragTouchMoveHandler),s._dragStartTimer=setTimeout(l,r.delay)}else l()}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){d&&He(d),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;E(t,"mouseup",this._disableDelayedDrag),E(t,"touchend",this._disableDelayedDrag),E(t,"touchcancel",this._disableDelayedDrag),E(t,"pointerup",this._disableDelayedDrag),E(t,"pointercancel",this._disableDelayedDrag),E(t,"mousemove",this._delayedDragTouchMoveHandler),E(t,"touchmove",this._delayedDragTouchMoveHandler),E(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||t.pointerType=="touch"&&t,!this.nativeDraggable||e?this.options.supportPointer?O(document,"pointermove",this._onTouchMove):e?O(document,"touchmove",this._onTouchMove):O(document,"mousemove",this._onTouchMove):(O(d,"dragend",this),O(R,"dragstart",this._onDragStart));try{document.selection?ve(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,e){if(Pt=!1,R&&d){U("dragStarted",this,{evt:e}),this.nativeDraggable&&O(document,"dragover",jn);var n=this.options;!t&&Q(d,n.dragClass,!1),Q(d,n.ghostClass,!0),v.active=this,t&&this._appendGhost(),j({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(rt){this._lastX=rt.clientX,this._lastY=rt.clientY,Ui();for(var t=document.elementFromPoint(rt.clientX,rt.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(rt.clientX,rt.clientY),t!==e);)e=t;if(d.parentNode[G]._isOutsideThisEl(t),e)do{if(e[G]){var n=void 0;if(n=e[G]._onDragOver({clientX:rt.clientX,clientY:rt.clientY,target:t,rootEl:e}),n&&!this.options.dragoverBubble)break}t=e}while(e=$i(e));Gi()}},_onTouchMove:function(t){if(Ct){var e=this.options,n=e.fallbackTolerance,s=e.fallbackOffset,o=t.touches?t.touches[0]:t,r=y&&Bt(y,!0),a=y&&r&&r.a,l=y&&r&&r.d,c=pe&&X&&_i(X),h=(o.clientX-Ct.clientX+s.x)/(a||1)+(c?c[0]-Fe[0]:0)/(a||1),u=(o.clientY-Ct.clientY+s.y)/(l||1)+(c?c[1]-Fe[1]:0)/(l||1);if(!v.active&&!Pt){if(n&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))<n)return;this._onDragStart(t,!0)}if(y){r?(r.e+=h-(Be||0),r.f+=u-(ke||0)):r={a:1,b:0,c:0,d:1,e:h,f:u};var f="matrix(".concat(r.a,",").concat(r.b,",").concat(r.c,",").concat(r.d,",").concat(r.e,",").concat(r.f,")");b(y,"webkitTransform",f),b(y,"mozTransform",f),b(y,"msTransform",f),b(y,"transform",f),Be=h,ke=u,rt=o}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!y){var t=this.options.fallbackOnBody?document.body:R,e=k(d,!0,pe,!0,t),n=this.options;if(pe){for(X=t;b(X,"position")==="static"&&b(X,"transform")==="none"&&X!==document;)X=X.parentNode;X!==document.body&&X!==document.documentElement?(X===document&&(X=ht()),e.top+=X.scrollTop,e.left+=X.scrollLeft):X=ht(),Fe=_i(X)}y=d.cloneNode(!0),Q(y,n.ghostClass,!1),Q(y,n.fallbackClass,!0),Q(y,n.dragClass,!0),b(y,"transition",""),b(y,"transform",""),b(y,"box-sizing","border-box"),b(y,"margin",0),b(y,"top",e.top),b(y,"left",e.left),b(y,"width",e.width),b(y,"height",e.height),b(y,"opacity","0.8"),b(y,"position",pe?"absolute":"fixed"),b(y,"zIndex","100000"),b(y,"pointerEvents","none"),v.ghost=y,t.appendChild(y),b(y,"transform-origin",Pi/parseInt(y.style.width)*100+"% "+Ni/parseInt(y.style.height)*100+"%")}},_onDragStart:function(t,e){var n=this,s=t.dataTransfer,o=n.options;if(U("dragStart",this,{evt:t}),v.eventCanceled){this._onDrop();return}U("setupClone",this),v.eventCanceled||(T=Xi(d),T.removeAttribute("id"),T.draggable=!1,T.style["will-change"]="",this._hideClone(),Q(T,this.options.chosenClass,!1),v.clone=T),n.cloneId=ve(function(){U("clone",n),!v.eventCanceled&&(n.options.removeCloneOnHide||R.insertBefore(T,d),n._hideClone(),j({sortable:n,name:"clone"}))}),!e&&Q(d,o.dragClass,!0),e?(Se=!0,n._loopId=setInterval(n._emulateDragOver,50)):(E(document,"mouseup",n._onDrop),E(document,"touchend",n._onDrop),E(document,"touchcancel",n._onDrop),s&&(s.effectAllowed="move",o.setData&&o.setData.call(n,s,d)),O(document,"drop",n),b(d,"transform","translateZ(0)")),Pt=!0,n._dragStartId=ve(n._dragStarted.bind(n,e,t)),O(document,"selectstart",n),qt=!0,window.getSelection().removeAllRanges(),Gt&&b(document.body,"user-select","none")},_onDragOver:function(t){var e=this.el,n=t.target,s,o,r,a=this.options,l=a.group,c=v.active,h=de===l,u=a.sort,f=$||c,p,m=this,g=!1;if(Xe)return;function w(F,et){U(F,m,ut({evt:t,isOwner:h,axis:p?"vertical":"horizontal",revert:r,dragRect:s,targetRect:o,canSort:u,fromSortable:f,target:n,completed:S,onMove:function(Ft,Ce){return me(R,e,d,s,Ft,k(Ft),t,Ce)},changed:A},et))}function x(){w("dragOverAnimationCapture"),m.captureAnimationState(),m!==f&&f.captureAnimationState()}function S(F){return w("dragOverCompleted",{insertion:F}),F&&(h?c._hideClone():c._showClone(m),m!==f&&(Q(d,$?$.options.ghostClass:c.options.ghostClass,!1),Q(d,a.ghostClass,!0)),$!==m&&m!==v.active?$=m:m===v.active&&$&&($=null),f===m&&(m._ignoreWhileAnimating=n),m.animateAll(function(){w("dragOverAnimationComplete"),m._ignoreWhileAnimating=null}),m!==f&&(f.animateAll(),f._ignoreWhileAnimating=null)),(n===d&&!d.animated||n===e&&!n.animated)&&(_t=null),!a.dragoverBubble&&!t.rootEl&&n!==document&&(d.parentNode[G]._isOutsideThisEl(t.target),!F&&Lt(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),g=!0}function A(){Z=st(d),wt=st(d,a.draggable),j({sortable:m,name:"change",toEl:e,newIndex:Z,newDraggableIndex:wt,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),n=at(n,a.draggable,e,!0),w("dragOver"),v.eventCanceled)return g;if(d.contains(t.target)||n.animated&&n.animatingX&&n.animatingY||m._ignoreWhileAnimating===n)return S(!1);if(Se=!1,c&&!a.disabled&&(h?u||(r=M!==R):$===this||(this.lastPutMode=de.checkPull(this,c,d,t))&&l.checkPut(this,c,d,t))){if(p=this._getDirection(t,n)==="vertical",s=k(d),w("dragOverValid"),v.eventCanceled)return g;if(r)return M=R,x(),this._hideClone(),w("revert"),v.eventCanceled||(Rt?R.insertBefore(d,Rt):R.appendChild(d)),S(!0);var D=Ue(e,a.draggable);if(!D||Gn(t,p,this)&&!D.animated){if(D===d)return S(!1);if(D&&e===t.target&&(n=D),n&&(o=k(n)),me(R,e,d,s,n,o,t,!!n)!==!1)return x(),D&&D.nextSibling?e.insertBefore(d,D.nextSibling):e.appendChild(d),M=e,A(),S(!0)}else if(D&&Un(t,p,this)){var _=kt(e,0,a,!0);if(_===d)return S(!1);if(n=_,o=k(n),me(R,e,d,s,n,o,t,!1)!==!1)return x(),e.insertBefore(d,_),M=e,A(),S(!0)}else if(n.parentNode===e){o=k(n);var C=0,V,J=d.parentNode!==e,I=!Xn(d.animated&&d.toRect||s,n.animated&&n.toRect||o,p),W=p?"top":"left",Y=Mi(n,"top","top")||Mi(d,"top","top"),tt=Y?Y.scrollTop:void 0;_t!==n&&(V=o[W],te=!1,fe=!I&&a.invertSwap||J),C=Jn(t,n,o,p,I?1:a.swapThreshold,a.invertedSwapThreshold==null?a.swapThreshold:a.invertedSwapThreshold,fe,_t===n);var z;if(C!==0){var P=st(d);do P-=C,z=M.children[P];while(z&&(b(z,"display")==="none"||z===y))}if(C===0||z===n)return S(!1);_t=n,Zt=C;var N=n.nextElementSibling,L=!1;L=C===1;var q=me(R,e,d,s,n,o,t,L);if(q!==!1)return(q===1||q===-1)&&(L=q===1),Xe=!0,setTimeout(Kn,30),x(),L&&!N?e.appendChild(d):n.parentNode.insertBefore(d,L?N:n),Y&&zi(Y,0,tt-Y.scrollTop),M=d.parentNode,V!==void 0&&!fe&&(be=Math.abs(V-k(n)[W])),A(),S(!0)}if(e.contains(d))return S(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){E(document,"mousemove",this._onTouchMove),E(document,"touchmove",this._onTouchMove),E(document,"pointermove",this._onTouchMove),E(document,"dragover",Lt),E(document,"mousemove",Lt),E(document,"touchmove",Lt)},_offUpEvents:function(){var t=this.el.ownerDocument;E(t,"mouseup",this._onDrop),E(t,"touchend",this._onDrop),E(t,"pointerup",this._onDrop),E(t,"pointercancel",this._onDrop),E(t,"touchcancel",this._onDrop),E(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;if(Z=st(d),wt=st(d,n.draggable),U("drop",this,{evt:t}),M=d&&d.parentNode,Z=st(d),wt=st(d,n.draggable),v.eventCanceled){this._nulling();return}Pt=!1,fe=!1,te=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Ye(this.cloneId),Ye(this._dragStartId),this.nativeDraggable&&(E(document,"drop",this),E(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Gt&&b(document.body,"user-select",""),b(d,"transform",""),t&&(qt&&(t.cancelable&&t.preventDefault(),!n.dropBubble&&t.stopPropagation()),y&&y.parentNode&&y.parentNode.removeChild(y),(R===M||$&&$.lastPutMode!=="clone")&&T&&T.parentNode&&T.parentNode.removeChild(T),d&&(this.nativeDraggable&&E(d,"dragend",this),He(d),d.style["will-change"]="",qt&&!Pt&&Q(d,$?$.options.ghostClass:this.options.ghostClass,!1),Q(d,this.options.chosenClass,!1),j({sortable:this,name:"unchoose",toEl:M,newIndex:null,newDraggableIndex:null,originalEvent:t}),R!==M?(Z>=0&&(j({rootEl:M,name:"add",toEl:M,fromEl:R,originalEvent:t}),j({sortable:this,name:"remove",toEl:M,originalEvent:t}),j({rootEl:M,name:"sort",toEl:M,fromEl:R,originalEvent:t}),j({sortable:this,name:"sort",toEl:M,originalEvent:t})),$&&$.save()):Z!==Nt&&Z>=0&&(j({sortable:this,name:"update",toEl:M,originalEvent:t}),j({sortable:this,name:"sort",toEl:M,originalEvent:t})),v.active&&((Z==null||Z===-1)&&(Z=Nt,wt=Qt),j({sortable:this,name:"end",toEl:M,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){U("nulling",this),R=d=M=y=Rt=T=ge=St=Ct=rt=qt=Z=wt=Nt=Qt=_t=Zt=$=de=v.dragged=v.ghost=v.clone=v.active=null;var t=this.el;Oe.forEach(function(e){t.contains(e)&&(e.checked=!0)}),Oe.length=Be=ke=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":d&&(this._onDragOver(t),qn(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],e,n=this.el.children,s=0,o=n.length,r=this.options;s<o;s++)e=n[s],at(e,r.draggable,this.el,!1)&&t.push(e.getAttribute(r.dataIdAttr)||Zn(e));return t},sort:function(t,e){var n={},s=this.el;this.toArray().forEach(function(o,r){var a=s.children[r];at(a,this.options.draggable,s,!1)&&(n[o]=a)},this),e&&this.captureAnimationState(),t.forEach(function(o){n[o]&&(s.removeChild(n[o]),s.appendChild(n[o]))}),e&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,e){return at(t,e||this.options.draggable,this.el,!1)},option:function(t,e){var n=this.options;if(e===void 0)return n[t];var s=ie.modifyOption(this,t,e);typeof s<"u"?n[t]=s:n[t]=e,t==="group"&&Ki(n)},destroy:function(){U("destroy",this);var t=this.el;t[G]=null,E(t,"mousedown",this._onTapStart),E(t,"touchstart",this._onTapStart),E(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(E(t,"dragover",this),E(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(e){e.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Ee.splice(Ee.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!St){if(U("hideClone",this),v.eventCanceled)return;b(T,"display","none"),this.options.removeCloneOnHide&&T.parentNode&&T.parentNode.removeChild(T),St=!0}},_showClone:function(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(St){if(U("showClone",this),v.eventCanceled)return;d.parentNode==R&&!this.options.group.revertClone?R.insertBefore(T,d):Rt?R.insertBefore(T,Rt):R.appendChild(T),this.options.group.revertClone&&this.animate(d,T),b(T,"display",""),St=!1}}};function qn(i){i.dataTransfer&&(i.dataTransfer.dropEffect="move"),i.cancelable&&i.preventDefault()}function me(i,t,e,n,s,o,r,a){var l,c=i[G],h=c.options.onMove,u;return window.CustomEvent&&!bt&&!ee?l=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(l=document.createEvent("Event"),l.initEvent("move",!0,!0)),l.to=t,l.from=i,l.dragged=e,l.draggedRect=n,l.related=s||t,l.relatedRect=o||k(t),l.willInsertAfter=a,l.originalEvent=r,i.dispatchEvent(l),h&&(u=h.call(c,l,r)),u}function He(i){i.draggable=!1}function Kn(){Xe=!1}function Un(i,t,e){var n=k(kt(e.el,0,e.options,!0)),s=Yi(e.el,e.options,y),o=10;return t?i.clientX<s.left-o||i.clientY<n.top&&i.clientX<n.right:i.clientY<s.top-o||i.clientY<n.bottom&&i.clientX<n.left}function Gn(i,t,e){var n=k(Ue(e.el,e.options.draggable)),s=Yi(e.el,e.options,y),o=10;return t?i.clientX>s.right+o||i.clientY>n.bottom&&i.clientX>n.left:i.clientY>s.bottom+o||i.clientX>n.right&&i.clientY>n.top}function Jn(i,t,e,n,s,o,r,a){var l=n?i.clientY:i.clientX,c=n?e.height:e.width,h=n?e.top:e.left,u=n?e.bottom:e.right,f=!1;if(!r){if(a&&be<c*s){if(!te&&(Zt===1?l>h+c*o/2:l<u-c*o/2)&&(te=!0),te)f=!0;else if(Zt===1?l<h+be:l>u-be)return-Zt}else if(l>h+c*(1-s)/2&&l<u-c*(1-s)/2)return Qn(t)}return f=f||r,f&&(l<h+c*o/2||l>u-c*o/2)?l>h+c/2?1:-1:0}function Qn(i){return st(d)<st(i)?1:-1}function Zn(i){for(var t=i.tagName+i.className+i.src+i.href+i.textContent,e=t.length,n=0;e--;)n+=t.charCodeAt(e);return n.toString(36)}function ts(i){Oe.length=0;for(var t=i.getElementsByTagName("input"),e=t.length;e--;){var n=t[e];n.checked&&Oe.push(n)}}function ve(i){return setTimeout(i,0)}function Ye(i){return clearTimeout(i)}xe&&O(document,"touchmove",function(i){(v.active||Pt)&&i.cancelable&&i.preventDefault()});v.utils={on:O,off:E,css:b,find:Vi,is:function(t,e){return!!at(t,e,t,!1)},extend:Bn,throttle:Wi,closest:at,toggleClass:Q,clone:Xi,index:st,nextTick:ve,cancelNextTick:Ye,detectDirection:qi,getChild:kt,expando:G};v.get=function(i){return i[G]};v.mount=function(){for(var i=arguments.length,t=new Array(i),e=0;e<i;e++)t[e]=arguments[e];t[0].constructor===Array&&(t=t[0]),t.forEach(function(n){if(!n.prototype||!n.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(n));n.utils&&(v.utils=ut(ut({},v.utils),n.utils)),ie.mount(n)})};v.create=function(i,t){return new v(i,t)};v.version=Pn;var B=[],Kt,je,qe=!1,$e,Ve,De,Ut;function es(){function i(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var t in this)t.charAt(0)==="_"&&typeof this[t]=="function"&&(this[t]=this[t].bind(this))}return i.prototype={dragStarted:function(e){var n=e.originalEvent;this.sortable.nativeDraggable?O(document,"dragover",this._handleAutoScroll):this.options.supportPointer?O(document,"pointermove",this._handleFallbackAutoScroll):n.touches?O(document,"touchmove",this._handleFallbackAutoScroll):O(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var n=e.originalEvent;!this.options.dragOverBubble&&!n.rootEl&&this._handleAutoScroll(n)},drop:function(){this.sortable.nativeDraggable?E(document,"dragover",this._handleAutoScroll):(E(document,"pointermove",this._handleFallbackAutoScroll),E(document,"touchmove",this._handleFallbackAutoScroll),E(document,"mousemove",this._handleFallbackAutoScroll)),ki(),ye(),kn()},nulling:function(){De=je=Kt=qe=Ut=$e=Ve=null,B.length=0},_handleFallbackAutoScroll:function(e){this._handleAutoScroll(e,!0)},_handleAutoScroll:function(e,n){var s=this,o=(e.touches?e.touches[0]:e).clientX,r=(e.touches?e.touches[0]:e).clientY,a=document.elementFromPoint(o,r);if(De=e,n||this.options.forceAutoScrollFallback||ee||bt||Gt){We(e,this.options,a,n);var l=Et(a,!0);qe&&(!Ut||o!==$e||r!==Ve)&&(Ut&&ki(),Ut=setInterval(function(){var c=Et(document.elementFromPoint(o,r),!0);c!==l&&(l=c,ye()),We(e,s.options,c,n)},10),$e=o,Ve=r)}else{if(!this.options.bubbleScroll||Et(a,!0)===ht()){ye();return}We(e,this.options,Et(a,!1),!1)}}},gt(i,{pluginName:"scroll",initializeByDefault:!0})}function ye(){B.forEach(function(i){clearInterval(i.pid)}),B=[]}function ki(){clearInterval(Ut)}var We=Wi(function(i,t,e,n){if(t.scroll){var s=(i.touches?i.touches[0]:i).clientX,o=(i.touches?i.touches[0]:i).clientY,r=t.scrollSensitivity,a=t.scrollSpeed,l=ht(),c=!1,h;je!==e&&(je=e,ye(),Kt=t.scroll,h=t.scrollFn,Kt===!0&&(Kt=Et(e,!0)));var u=0,f=Kt;do{var p=f,m=k(p),g=m.top,w=m.bottom,x=m.left,S=m.right,A=m.width,D=m.height,_=void 0,C=void 0,V=p.scrollWidth,J=p.scrollHeight,I=b(p),W=p.scrollLeft,Y=p.scrollTop;p===l?(_=A<V&&(I.overflowX==="auto"||I.overflowX==="scroll"||I.overflowX==="visible"),C=D<J&&(I.overflowY==="auto"||I.overflowY==="scroll"||I.overflowY==="visible")):(_=A<V&&(I.overflowX==="auto"||I.overflowX==="scroll"),C=D<J&&(I.overflowY==="auto"||I.overflowY==="scroll"));var tt=_&&(Math.abs(S-s)<=r&&W+A<V)-(Math.abs(x-s)<=r&&!!W),z=C&&(Math.abs(w-o)<=r&&Y+D<J)-(Math.abs(g-o)<=r&&!!Y);if(!B[u])for(var P=0;P<=u;P++)B[P]||(B[P]={});(B[u].vx!=tt||B[u].vy!=z||B[u].el!==p)&&(B[u].el=p,B[u].vx=tt,B[u].vy=z,clearInterval(B[u].pid),(tt!=0||z!=0)&&(c=!0,B[u].pid=setInterval(function(){n&&this.layer===0&&v.active._onTouchMove(De);var N=B[this.layer].vy?B[this.layer].vy*a:0,L=B[this.layer].vx?B[this.layer].vx*a:0;typeof h=="function"&&h.call(v.dragged.parentNode[G],L,N,i,De,B[this.layer].el)!=="continue"||zi(B[this.layer].el,L,N)}.bind({layer:u}),24))),u++}while(t.bubbleScroll&&f!==l&&(f=Et(f,!1)));qe=c}},30),Ji=function(t){var e=t.originalEvent,n=t.putSortable,s=t.dragEl,o=t.activeSortable,r=t.dispatchSortableEvent,a=t.hideGhostForTarget,l=t.unhideGhostForTarget;if(e){var c=n||o;a();var h=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e,u=document.elementFromPoint(h.clientX,h.clientY);l(),c&&!c.el.contains(u)&&(r("spill"),this.onSpill({dragEl:s,putSortable:n}))}};function Ge(){}Ge.prototype={startIndex:null,dragStart:function(t){var e=t.oldDraggableIndex;this.startIndex=e},onSpill:function(t){var e=t.dragEl,n=t.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var s=kt(this.sortable.el,this.startIndex,this.options);s?this.sortable.el.insertBefore(e,s):this.sortable.el.appendChild(e),this.sortable.animateAll(),n&&n.animateAll()},drop:Ji};gt(Ge,{pluginName:"revertOnSpill"});function Je(){}Je.prototype={onSpill:function(t){var e=t.dragEl,n=t.putSortable,s=n||this.sortable;s.captureAnimationState(),e.parentNode&&e.parentNode.removeChild(e),s.animateAll()},drop:Ji};gt(Je,{pluginName:"removeOnSpill"});v.mount(new es);v.mount(Je,Ge);var Qi=v;function dt(i){return i.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase()}function ne(i){return i==null||i===""||typeof i=="string"&&i.trim()===""}function H(i){return!ne(i)}var Ae=class{constructor({accessibilityAttributes:t={},ariaLabel:e=null,canOptionLabelsWrap:n=!0,canSelectPlaceholder:s=!0,clearButtonLabel:o="Clear selection",element:r,errorMessage:a="The options could not be loaded. Please try again.",getOptionLabelUsing:l=null,getOptionLabelsUsing:c=null,getOptionsUsing:h=null,getSearchResultsUsing:u=null,hasDynamicOptions:f=!1,hasDynamicSearchResults:p=!0,hasInitialNoOptionsMessage:m=!1,id:g=null,initialOptionLabel:w=null,initialOptionLabels:x=null,initialState:S=null,isAutofocused:A=!1,isDisabled:D=!1,isHtmlAllowed:_=!1,isMultiple:C=!1,isReorderable:V=!1,isSearchable:J=!1,livewireId:I=null,loadingMessage:W="Loading...",maxItems:Y=null,maxItemsMessage:tt="Maximum number of items selected",noOptionsMessage:z="No options available",noSearchResultsMessage:P="No results found",onStateChange:N=()=>{},options:L,optionsLimit:q=null,placeholder:F,position:et=null,removeButtonLabel:se="Remove :label",searchableOptionFields:Ft=["label"],searchDebounce:Ce=1e3,searchingMessage:Zi="Searching...",searchLabel:tn="Search",searchPrompt:en="Search...",state:nn,statePath:sn=null}){this.accessibilityAttributes=t,this.ariaLabel=e,this.canOptionLabelsWrap=n,this.canSelectPlaceholder=s,this.clearButtonLabel=o,this.element=r,this.errorMessage=a,this.getOptionLabelUsing=l,this.getOptionLabelsUsing=c,this.getOptionsUsing=h,this.getSearchResultsUsing=u,this.hasDynamicOptions=f,this.hasDynamicSearchResults=p&&typeof u=="function",this.hasInitialNoOptionsMessage=m,this.id=g,this.initialOptionLabel=w,this.initialOptionLabels=x,this.initialState=S,this.isAutofocused=A,this.isDisabled=D,this.isHtmlAllowed=_,this.isMultiple=C,this.isReorderable=V,this.isSearchable=J,this.livewireId=I,this.loadingMessage=W,this.maxItems=Y,this.maxItemsMessage=tt,this.noOptionsMessage=z,this.noSearchResultsMessage=P,this.onStateChange=N,this.options=L,this.optionsLimit=q,this.originalOptions=JSON.parse(JSON.stringify(L)),this.placeholder=F,this.position=et,this.removeButtonLabel=se,this.searchableOptionFields=Array.isArray(Ft)?Ft:["label"],this.searchDebounce=Ce,this.searchingMessage=Zi,this.searchLabel=tn,this.searchPrompt=en,this.state=nn,this.statePath=sn,this.activeSearchId=0,this.openId=0,this.isDestroyed=!1,this.labelRepository={},this.isOpen=!1,this.activeValue=null,this.typeahead="",this.typeaheadTime=0,this.searchQuery="",this.searchTimeout=null,this.isSearching=!1,this.isLoadingOptions=!1,this.hasOptionsError=!1,this.maxItemsMessageElement=null,this.badgesSortable=null,this.selectedDisplayVersion=0,this.render(),this.setUpEventListeners(),this.isAutofocused&&this.selectButton.focus()}populateLabelRepositoryFromOptions(t){if(!(!t||!Array.isArray(t)))for(let e of t)e.options&&Array.isArray(e.options)?this.populateLabelRepositoryFromOptions(e.options):e.value!==void 0&&e.label!==void 0&&(this.labelRepository[e.value]=e.label)}render(){this.populateLabelRepositoryFromOptions(this.options),this.container=document.createElement("div"),this.container.className="fi-select-input-ctn",this.canOptionLabelsWrap||this.container.classList.add("fi-select-input-ctn-option-labels-not-wrapped"),this.selectButton=document.createElement("button"),this.selectButton.className="fi-select-input-btn",this.selectButton.type="button",this.isSearchable||this.selectButton.setAttribute("role","combobox"),this.selectButton.setAttribute("aria-haspopup","listbox"),this.selectButton.setAttribute("aria-expanded","false"),H(this.id)&&(this.selectButton.id=this.id),H(this.ariaLabel)&&this.selectButton.setAttribute("aria-label",this.ariaLabel),this.selectedDisplay=document.createElement("div"),this.selectedDisplay.className="fi-select-input-value-ctn",this.isMultiple?(this.container.classList.add("fi-select-input-ctn-multiple"),this.isReorderable&&this.container.classList.add("fi-select-input-ctn-reorderable"),this.selectionSummary=document.createElement("span"),this.selectionSummary.className="fi-sr-only",this.selectButton.appendChild(this.selectionSummary)):this.selectButton.appendChild(this.selectedDisplay),this.dropdown=document.createElement("div"),this.dropdown.className="fi-dropdown-panel fi-scrollable",this.dropdown.style.display="none",this.dropdownId=`fi-select-input-dropdown-${Math.random().toString(36).substring(2,11)}`,this.selectButton.setAttribute("aria-controls",this.dropdownId),this.selectionSummary||(this.selectionSummary=document.createElement("span"),this.selectionSummary.className="fi-sr-only",this.container.appendChild(this.selectionSummary)),this.selectionSummary.id=`${this.dropdownId}-value`,this.isSearchable&&(this.searchContainer=document.createElement("div"),this.searchContainer.className="fi-select-input-search-ctn",this.searchInput=document.createElement("input"),this.searchInput.className="fi-input",this.searchInput.type="text",this.searchInput.placeholder=this.searchPrompt,this.searchInput.setAttribute("role","combobox"),this.searchInput.setAttribute("aria-autocomplete","list"),this.searchInput.setAttribute("aria-expanded","false"),this.searchInput.setAttribute("aria-controls",this.dropdownId),this.searchContainer.appendChild(this.searchInput),this.dropdown.appendChild(this.searchContainer),this.searchInput.addEventListener("input",t=>{this.isDisabled||this.handleSearch(t)})),this.optionsList=document.createElement("ul"),this.optionsList.id=this.dropdownId,this.optionsList.setAttribute("role","listbox"),this.isMultiple&&this.optionsList.setAttribute("aria-multiselectable","true"),this.optionsList.addEventListener("mousedown",t=>t.preventDefault()),this.dropdown.addEventListener("mousedown",t=>{t.target===this.dropdown&&t.preventDefault()}),this.statusRegion=document.createElement("div"),this.statusRegion.className="fi-sr-only",this.statusRegion.setAttribute("role","status"),this.statusRegion.setAttribute("aria-live","polite"),this.statusRegion.setAttribute("aria-atomic","true"),this.renderOptions(),this.container.appendChild(this.selectButton),this.isMultiple&&this.container.appendChild(this.selectedDisplay),this.container.appendChild(this.dropdown),this.container.appendChild(this.statusRegion),this.element.appendChild(this.container),this.setAccessibilityAttributes(this.accessibilityAttributes),this.updateSelectedDisplay(),this.applyDisabledState()}renderOptions(){if(this.isSearching||this.hasOptionsError||this.isLoadingOptions&&(!this.searchQuery||!this.hasDynamicSearchResults))return;let t=this.activeValue;this.setActiveOption(null),this.optionsList.innerHTML="";let e=0,n=this.options,s=0,o=!1;this.options.forEach(l=>{l.options&&Array.isArray(l.options)?(s+=l.options.length,o=!0):s++}),o?this.optionsList.className="fi-select-input-options-ctn":s>0&&(this.optionsList.className="fi-dropdown-list");let r=o?null:this.optionsList,a=0;for(let l of n){if(this.optionsLimit>0&&a>=this.optionsLimit)break;if(l.options&&Array.isArray(l.options)){let c=l.options;if(this.isMultiple&&Array.isArray(this.state)&&this.state.length>0&&(c=l.options.filter(h=>!this.state.includes(h.value))),c.length>0){if(this.optionsLimit>0){let h=this.optionsLimit-a;h<c.length&&(c=c.slice(0,h))}this.renderOptionGroup(l.label,c),r=null,a+=c.length,e+=c.length}}else{if(this.isMultiple&&Array.isArray(this.state)&&this.state.includes(l.value))continue;!r&&o&&(r=document.createElement("ul"),r.className="fi-dropdown-list",r.setAttribute("role","presentation"),this.optionsList.appendChild(r));let c=this.createOptionElement(l.value,l);r.appendChild(c),a++,e++}}if(e===0?(this.searchQuery?this.showNoResultsMessage():(this.hasInitialNoOptionsMessage||this.hasDynamicOptions)&&this.showNoOptionsMessage(),this.optionsList.hidden=!0):(this.optionsList.hidden=!1,this.hideLoadingState(),this.optionsList.parentNode!==this.dropdown&&this.dropdown.appendChild(this.optionsList)),this.optionsList.parentNode!==this.dropdown&&this.dropdown.appendChild(this.optionsList),this.isOpen){let l=this.getEnabledOptions();this.setActiveOption(l.find(c=>c.dataset.value===t)??(t!==null||!this.isSearchable?l.find(c=>this.typeahead&&dt(c.textContent.trim()).startsWith(this.typeahead))??l.find(c=>c.dataset.value===this.state)??l[0]:null))}}renderOptionGroup(t,e){if(e.length===0)return;let n=document.createElement("li");n.className="fi-select-input-option-group",n.setAttribute("role","presentation");let s=document.createElement("div");s.className="fi-dropdown-header",s.textContent=t;let o=document.createElement("ul");o.className="fi-dropdown-list",o.setAttribute("role","group"),o.setAttribute("aria-label",t),e.forEach(r=>{let a=this.createOptionElement(r.value,r);o.appendChild(a)}),n.appendChild(s),n.appendChild(o),this.optionsList.appendChild(n)}createOptionElement(t,e){let n=t,s=e,o=!1;typeof e=="object"&&e!==null&&"label"in e&&"value"in e&&(n=e.value,s=e.label,o=e.isDisabled||!1);let r=document.createElement("li");r.className="fi-dropdown-list-item fi-select-input-option",o&&r.classList.add("fi-disabled");let a=`fi-select-input-option-${Math.random().toString(36).substring(2,11)}`;if(r.id=a,r.setAttribute("role","option"),r.setAttribute("data-value",n),o&&r.setAttribute("aria-disabled","true"),this.isHtmlAllowed&&typeof s=="string"){let h=document.createElement("div");h.innerHTML=s;let u=h.textContent||h.innerText||s;r.setAttribute("aria-label",u)}let l=this.isMultiple?Array.isArray(this.state)&&this.state.includes(n):this.state===n;r.setAttribute("aria-selected",l?"true":"false");let c=document.createElement("span");return this.isHtmlAllowed?c.innerHTML=s:c.textContent=s,r.appendChild(c),o||r.addEventListener("click",h=>{h.preventDefault(),h.stopPropagation(),this.selectOption(n)}),r}async updateSelectedDisplay(){if(this.isDestroyed)return;this.selectedDisplayVersion=this.selectedDisplayVersion+1;let t=this.selectedDisplayVersion,e=document.createDocumentFragment();if(this.isMultiple){if(!Array.isArray(this.state)||this.state.length===0){let s=document.createElement("span");s.textContent=this.placeholder,s.classList.add("fi-select-input-placeholder"),e.appendChild(s)}else{let s=await this.getLabelsForMultipleSelection();if(t!==this.selectedDisplayVersion)return;this.addBadgesForSelectedOptions(s,e)}t===this.selectedDisplayVersion&&(e.querySelector(".fi-select-input-value-badges-ctn")||this.destroyBadgesSortable(),this.commitSelectedDisplay(e),this.isOpen&&this.deferPositionDropdown());return}if(this.state===null||this.state===""){let s=document.createElement("span");if(s.textContent=this.placeholder,s.classList.add("fi-select-input-placeholder"),e.appendChild(s),t===this.selectedDisplayVersion){this.destroyBadgesSortable(),this.commitSelectedDisplay(e);let o=this.container.querySelector(".fi-select-input-value-remove-btn");o&&o.remove(),this.container.classList.remove("fi-select-input-ctn-clearable")}return}let n=await this.getLabelForSingleSelection();t===this.selectedDisplayVersion&&(this.addSingleSelectionDisplay(n,e),t===this.selectedDisplayVersion&&(this.destroyBadgesSortable(),this.commitSelectedDisplay(e)))}commitSelectedDisplay(t){let e=this.selectedDisplay.contains(document.activeElement)?document.activeElement:null,n=e?.closest("[data-value]")?.dataset.value;this.selectedDisplay.replaceChildren(t),this.updateSelectionSummary(),e&&(this.isOpen?this.getFocusOwner():this.selectedDisplay.querySelector(`[data-value="${CSS.escape(n??"")}"] button`)??this.selectButton).focus()}updateSelectionSummary(){this.selectionSummary.textContent=Array.from(this.selectedDisplay.querySelectorAll(".fi-badge-label, .fi-select-input-value-label, .fi-select-input-placeholder"),t=>t.textContent).join(", ")}async getLabelsForMultipleSelection(){let t=this.selectedDisplayVersion,e=this.getSelectedOptionLabels(),n=[];if(Array.isArray(this.state)){for(let o of this.state)if(!H(this.labelRepository[o])){if(H(e[o])){this.labelRepository[o]=e[o];continue}n.push(o.toString())}}if(n.length>0&&H(this.initialOptionLabels)&&JSON.stringify(this.state)===JSON.stringify(this.initialState)){if(Array.isArray(this.initialOptionLabels))for(let o of this.initialOptionLabels)H(o)&&o.value!==void 0&&o.label!==void 0&&n.includes(o.value)&&(this.labelRepository[o.value]=o.label)}else if(n.length>0&&this.getOptionLabelsUsing)try{let o=await this.getOptionLabelsUsing();if(this.isDestroyed||t!==this.selectedDisplayVersion)return[];for(let r of o)H(r)&&r.value!==void 0&&r.label!==void 0&&(this.labelRepository[r.value]=r.label)}catch(o){console.error("Error fetching option labels:",o)}let s=[];if(Array.isArray(this.state))for(let o of this.state)H(this.labelRepository[o])?s.push(this.labelRepository[o]):H(e[o])?s.push(e[o]):s.push(o);return s}createBadgeElement(t,e){let n=document.createElement("span");n.className="fi-badge fi-size-md fi-color fi-color-primary fi-text-color-700 dark:fi-text-color-200",H(t)&&n.setAttribute("data-value",t);let s=document.createElement("span");s.className="fi-badge-label-ctn";let o=document.createElement("span");o.className="fi-badge-label",this.canOptionLabelsWrap&&o.classList.add("fi-wrapped"),this.isHtmlAllowed?o.innerHTML=e:o.textContent=e,s.appendChild(o),n.appendChild(s);let r=this.createRemoveButton(t,e);return n.appendChild(r),n}createRemoveButton(t,e){let n=document.createElement("button");n.type="button",n.className="fi-badge-delete-btn",n.setAttribute("aria-label",this.removeButtonLabel.replace(":label",this.isHtmlAllowed?e.replace(/<[^>]*>/g,""):e));let s=document.createElement("span");return s.className="fi-badge-delete-btn-icon",s.setAttribute("aria-hidden","true"),n.appendChild(s),this.isDisabled&&(n.setAttribute("disabled","disabled"),n.classList.add("fi-disabled")),n.addEventListener("click",o=>{if(o.stopPropagation(),H(t)){let r=Array.from(this.selectedDisplay.querySelectorAll(".fi-badge-delete-btn")),a=r.indexOf(n),l=this.isOpen?this.getFocusOwner():r[a+1]??r[a-1]??this.selectButton;this.selectOption(t),this.isDisabled||l.focus()}}),n.addEventListener("keydown",o=>{(o.key===" "||o.key==="Enter")&&(o.preventDefault(),o.stopPropagation(),n.click())}),n}addBadgesForSelectedOptions(t,e=this.selectedDisplay){let n=document.createElement("div");n.className="fi-select-input-value-badges-ctn",t.forEach((s,o)=>{let r=Array.isArray(this.state)?this.state[o]:null,a=this.createBadgeElement(r,s);n.appendChild(a)}),e.appendChild(n),this.isReorderable&&(n.addEventListener("click",s=>{s.stopPropagation()}),n.addEventListener("mousedown",s=>{s.stopPropagation()}),this.destroyBadgesSortable(),this.badgesSortable=new Qi(n,{animation:150,disabled:this.isDisabled,onEnd:()=>{let s=[];n.querySelectorAll("[data-value]").forEach(o=>{s.push(o.getAttribute("data-value"))}),this.state=s,this.updateSelectionSummary(),this.onStateChange(this.state)}}))}destroyBadgesSortable(){this.badgesSortable?.destroy(),this.badgesSortable=null}async getLabelForSingleSelection(){let t=this.state,e=this.selectedDisplayVersion,n=this.labelRepository[this.state];if(ne(n)&&(n=this.getSelectedOptionLabel(this.state)),ne(n)&&H(this.initialOptionLabel)&&this.state===this.initialState)n=this.initialOptionLabel,H(this.state)&&(this.labelRepository[this.state]=n);else if(ne(n)&&this.getOptionLabelUsing)try{if(n=await this.getOptionLabelUsing(),this.isDestroyed||e!==this.selectedDisplayVersion||t!==this.state)return null;H(n)&&H(this.state)&&(this.labelRepository[t]=n)}catch(s){console.error("Error fetching option label:",s),n=this.state}else ne(n)&&(n=this.state);return n}addSingleSelectionDisplay(t,e=this.selectedDisplay){let n=document.createElement("span");if(n.className="fi-select-input-value-label",this.isHtmlAllowed?n.innerHTML=t:n.textContent=t,e.appendChild(n),!this.canSelectPlaceholder||this.container.querySelector(".fi-select-input-value-remove-btn"))return;let s=document.createElement("button");s.type="button",s.className="fi-select-input-value-remove-btn",s.setAttribute("aria-label",this.clearButtonLabel),this.isDisabled&&(s.setAttribute("disabled","disabled"),s.classList.add("fi-disabled")),s.addEventListener("click",o=>{o.stopPropagation(),this.selectOption("")}),s.addEventListener("keydown",o=>{(o.key===" "||o.key==="Enter")&&(o.preventDefault(),o.stopPropagation(),this.selectOption(""))}),this.container.appendChild(s),this.container.classList.add("fi-select-input-ctn-clearable")}getSelectedOptionLabel(t){if(H(this.labelRepository[t]))return this.labelRepository[t];let e="";for(let n of this.options)if(n.options&&Array.isArray(n.options)){for(let s of n.options)if(s.value===t){e=s.label,this.labelRepository[t]=e;break}}else if(n.value===t){e=n.label,this.labelRepository[t]=e;break}return e}setUpEventListeners(){this.buttonClickListener=()=>{this.toggleDropdown()},this.documentClickListener=t=>{!this.container.contains(t.target)&&this.isOpen&&this.closeDropdown()},this.buttonKeydownListener=t=>{this.isDisabled||this.handleSelectButtonKeydown(t)},this.dropdownKeydownListener=t=>{this.isDisabled||this.handleDropdownKeydown(t)},this.focusinListener=()=>this.syncActiveDescendant(),this.focusoutListener=t=>{this.selectButton.removeAttribute("aria-activedescendant"),this.searchInput?.removeAttribute("aria-activedescendant"),queueMicrotask(()=>{this.isDestroyed||!this.isOpen||(this.isTabbing||!this.container.contains(t.relatedTarget))&&(this.isTabbing=!1,this.closeDropdown())})},this.dropdownEscapeListener=t=>{this.isOpen&&(this.closeDropdown(),this.selectButton.focus(),t.preventDefault(),t.stopPropagation())},this.selectButton.addEventListener("click",this.buttonClickListener),document.addEventListener("click",this.documentClickListener),this.selectButton.addEventListener("keydown",this.buttonKeydownListener),this.dropdown.addEventListener("keydown",this.dropdownKeydownListener),this.container.addEventListener("focusin",this.focusinListener),this.container.addEventListener("focusout",this.focusoutListener),this.element.addEventListener("dropdown-escape",this.dropdownEscapeListener),!this.isMultiple&&this.livewireId&&this.statePath&&this.getOptionLabelUsing&&(this.refreshOptionLabelListener=async t=>{if(t.detail.livewireId===this.livewireId&&t.detail.statePath===this.statePath&&H(this.state))try{let e=this.state,n=++this.selectedDisplayVersion;delete this.labelRepository[this.state];let s=await this.getOptionLabelUsing();if(this.isDestroyed||e!==this.state||n!==this.selectedDisplayVersion)return;this.updateOptionLabelInList(this.state,s),this.updateSelectedDisplay()}catch(e){console.error("Error refreshing option label:",e)}},window.addEventListener("filament-forms::select.refreshSelectedOptionLabel",this.refreshOptionLabelListener))}updateOptionLabelInList(t,e){this.labelRepository[t]=e;let n=this.getVisibleOptions();for(let s of n)if(s.getAttribute("data-value")===String(t)){if(s.innerHTML="",this.isHtmlAllowed){let o=document.createElement("span");o.innerHTML=e,s.appendChild(o),s.setAttribute("aria-label",o.textContent||o.innerText||e)}else s.appendChild(document.createTextNode(e));break}for(let s of this.options)if(s.options&&Array.isArray(s.options)){for(let o of s.options)if(o.value===t){o.label=e;break}}else if(s.value===t){s.label=e;break}for(let s of this.originalOptions)if(s.options&&Array.isArray(s.options)){for(let o of s.options)if(o.value===t){o.label=e;break}}else if(s.value===t){s.label=e;break}}handleSelectButtonKeydown(t){if(!(t.isComposing||t.keyCode===229)){if((!this.isOpen||this.isSearchable)&&["Enter"," ","ArrowDown","ArrowUp"].includes(t.key)){t.preventDefault(),t.stopPropagation(),this.openDropdown();return}this.handleDropdownKeydown(t)}}handleDropdownKeydown(t){if(t.isComposing||t.keyCode===229)return;let e=t.target===this.searchInput,n=this.getEnabledOptions();switch(t.key){case"ArrowDown":t.preventDefault(),t.stopPropagation(),this.focusNextOption();break;case"ArrowUp":t.preventDefault(),t.stopPropagation(),this.focusPreviousOption();break;case" ":if(e)return;case"Enter":if(!this.isOpen)return;t.preventDefault(),t.stopPropagation();let s=n.find(o=>o.dataset.value===this.activeValue)??(e?n[0]:null);s&&this.selectOption(s.dataset.value);break;case"Escape":if(!this.isOpen)return;t.preventDefault(),t.stopPropagation(),this.closeDropdown(),this.selectButton.focus();break;case"Tab":this.isTabbing=this.isOpen;break;case"Home":case"End":if(e||!this.isOpen)return;t.preventDefault(),t.stopPropagation(),this.setActiveOption(t.key==="Home"?n[0]:n.at(-1));break;default:if(!e&&!t.ctrlKey&&!t.metaKey&&!t.altKey&&typeof t.key=="string"&&t.key.length===1)if(t.preventDefault(),this.isOpen||this.openDropdown(),this.isSearchable)this.searchInput.value=(this.searchInput.value||"")+t.key,this.searchInput.dispatchEvent(new Event("input",{bubbles:!0}));else{let o=Date.now();this.typeahead=(o-this.typeaheadTime<1e3?this.typeahead:"")+dt(t.key),this.typeaheadTime=o;let r=this.getEnabledOptions().find(a=>dt(a.textContent.trim()).startsWith(this.typeahead));r&&this.setActiveOption(r)}break}}toggleDropdown(){if(!this.isDisabled){if(this.isOpen){this.closeDropdown();return}this.openDropdown()}}async openDropdown(){if(this.isDestroyed||this.isDisabled)return;if(this.isOpen){this.getFocusOwner().focus();return}let t=++this.openId,e=++this.activeSearchId;this.typeahead="",this.hasOptionsError=!1;let n=`${this.selectButton.offsetWidth}px`;this.dropdown.style.display="block",this.dropdown.style.opacity="0";let s=this.selectButton.closest(".fi-fixed-positioning-context")!==null&&this.selectButton.closest(".fi-absolute-positioning-context")===null;if(this.dropdown.style.position=s?"fixed":"absolute",this.dropdown.style.width=n,this.selectButton.setAttribute("aria-expanded","true"),this.searchInput?.setAttribute("aria-expanded","true"),this.isOpen=!0,this.isTabbing=!1,this.getFocusOwner().focus(),this.positionDropdown(),this.resizeListener||(this.resizeListener=()=>{this.dropdown.style.width=`${this.selectButton.offsetWidth}px`,this.positionDropdown()},window.addEventListener("resize",this.resizeListener)),this.scrollListener||(this.scrollListener=()=>this.positionDropdown(),window.addEventListener("scroll",this.scrollListener,!0)),this.dropdown.style.opacity="1",this.isSearchable&&this.searchInput&&(this.searchInput.value="",this.searchQuery=""),this.hasDynamicOptions||(this.options=JSON.parse(JSON.stringify(this.originalOptions)),this.renderOptions()),this.hasDynamicOptions&&this.getOptionsUsing){this.isLoadingOptions=!0,this.showLoadingState(!1);try{let o=await this.getOptionsUsing();if(this.isDestroyed||!this.isOpen||t!==this.openId)return;this.isLoadingOptions=!1;let r=Array.isArray(o)?o:o&&Array.isArray(o.options)?o.options:[];this.originalOptions=JSON.parse(JSON.stringify(r)),(!this.searchQuery||!this.hasDynamicSearchResults)&&(this.populateLabelRepositoryFromOptions(r),this.searchQuery?this.filterOptions(this.searchQuery):(this.options=r,this.renderOptions(),this.positionDropdown()))}catch(o){if(this.isDestroyed||!this.isOpen||t!==this.openId||(this.isLoadingOptions=!1,this.searchQuery&&this.hasDynamicSearchResults&&e!==this.activeSearchId))return;console.error("Error fetching options:",o),this.showErrorMessage()}}else(!this.hasInitialNoOptionsMessage||this.searchQuery)&&this.hideLoadingState()}positionDropdown(){if(this.isDestroyed||!this.isOpen)return;let t=this.openId,e=this.position==="top"?"top-start":"bottom-start",n=[xi(4),Ai({padding:5})];this.position!=="top"&&this.position!=="bottom"&&n.push(Ci());let s=this.selectButton.closest(".fi-fixed-positioning-context")!==null&&this.selectButton.closest(".fi-absolute-positioning-context")===null;Li(this.selectButton,this.dropdown,{placement:e,middleware:n,strategy:s?"fixed":"absolute"}).then(({x:o,y:r})=>{this.isDestroyed||!this.isOpen||t!==this.openId||Object.assign(this.dropdown.style,{left:`${o}px`,top:`${r}px`})})}deferPositionDropdown(){this.isOpen&&(this.positioningRequestAnimationFrame&&(cancelAnimationFrame(this.positioningRequestAnimationFrame),this.positioningRequestAnimationFrame=null),this.positioningRequestAnimationFrame=requestAnimationFrame(()=>{this.positionDropdown(),this.positioningRequestAnimationFrame=null}))}closeDropdown(){this.dropdown.style.display="none",this.selectButton.setAttribute("aria-expanded","false"),this.searchInput?.setAttribute("aria-expanded","false"),this.isOpen=!1,this.openId++,this.searchTimeout&&(clearTimeout(this.searchTimeout),this.searchTimeout=null),this.activeSearchId++,this.isSearching=!1,this.isLoadingOptions=!1,this.hideLoadingState(),this.hideMaxItemsMessage(),this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null),this.scrollListener&&(window.removeEventListener("scroll",this.scrollListener,!0),this.scrollListener=null),this.setActiveOption(null)}focusNextOption(){let t=this.getEnabledOptions();if(t.length===0)return;let e=t.findIndex(n=>n.dataset.value===this.activeValue);this.setActiveOption(t[Math.min(e+1,t.length-1)])}focusPreviousOption(){let t=this.getEnabledOptions();if(t.length===0)return;let e=t.findIndex(n=>n.dataset.value===this.activeValue);this.setActiveOption(t[e<0?t.length-1:Math.max(e-1,0)])}scrollOptionIntoView(t){if(!t)return;let e=this.dropdown.getBoundingClientRect(),n=t.getBoundingClientRect();n.bottom>e.bottom?this.dropdown.scrollTop+=n.bottom-e.bottom:n.top<e.top&&(this.dropdown.scrollTop-=e.top-n.top)}getVisibleOptions(){return Array.from(this.optionsList.querySelectorAll('[role="option"]'))}getEnabledOptions(){return this.isSearching||this.optionsList.hidden||!this.optionsList.isConnected?[]:this.getVisibleOptions().filter(t=>t.getAttribute("aria-disabled")!=="true")}getFocusOwner(){return this.searchInput??this.selectButton}setActiveOption(t){this.activeValue=t?.dataset.value??null,this.getVisibleOptions().forEach(e=>e.classList.toggle("fi-selected",e===t)),this.syncActiveDescendant(),t&&this.isOpen&&this.scrollOptionIntoView(t)}syncActiveDescendant(){this.selectButton.removeAttribute("aria-activedescendant"),this.searchInput?.removeAttribute("aria-activedescendant");let t=this.getFocusOwner();if(!this.isOpen||document.activeElement!==t)return;let e=this.getEnabledOptions().find(n=>n.dataset.value===this.activeValue);e&&t.setAttribute("aria-activedescendant",e.id)}setAccessibilityAttributes(t){this.accessibilityAttributes=t;for(let s of["aria-label","aria-labelledby","aria-describedby","aria-invalid","aria-busy","aria-required"]){let o=t[s];for(let r of[this.selectButton,this.searchInput].filter(Boolean))H(o)?r.setAttribute(s,o):r.removeAttribute(s)}!this.selectButton.hasAttribute("aria-label")&&!this.selectButton.hasAttribute("aria-labelledby")&&H(this.ariaLabel)&&this.selectButton.setAttribute("aria-label",this.ariaLabel);let e=(this.selectButton.getAttribute("aria-labelledby")??"").split(/\s+/).map(s=>document.getElementById(s)?.textContent??"").join(" ").trim()||this.selectButton.getAttribute("aria-label")||Array.from(this.selectButton.labels??[],s=>s.textContent).join(" ").trim();this.optionsList.setAttribute("aria-label",e),this.isSearchable&&(this.searchInput.removeAttribute("aria-labelledby"),this.searchInput.setAttribute("aria-label",`${e}: ${this.searchLabel}`),this.selectButton.removeAttribute("aria-required"));let n=[t["aria-describedby"],this.selectionSummary.id].filter(Boolean).join(" ").split(/\s+/);this.selectButton.setAttribute("aria-describedby",[...new Set(n)].join(" "))}getSelectedOptionLabels(){if(!Array.isArray(this.state)||this.state.length===0)return{};let t={};for(let e of this.state){let n=!1;for(let s of this.options)if(s.options&&Array.isArray(s.options)){for(let o of s.options)if(o.value===e){t[e]=o.label,n=!0;break}if(n)break}else if(s.value===e){t[e]=s.label;break}}return t}handleSearch(t){if(this.isDestroyed||!this.isOpen)return;let e=t.target.value.trim();this.searchQuery=e,this.hasOptionsError=!1;let n=++this.activeSearchId;if(this.setActiveOption(null),this.searchTimeout&&clearTimeout(this.searchTimeout),e===""){if(this.isSearching=!1,this.isLoadingOptions){this.showLoadingState();return}this.hideLoadingState(),this.options=JSON.parse(JSON.stringify(this.originalOptions)),this.renderOptions(),this.positionDropdown();return}if(!this.getSearchResultsUsing||typeof this.getSearchResultsUsing!="function"||!this.hasDynamicSearchResults){this.isSearching=!1,this.filterOptions(e);return}this.isSearching=!0,this.showLoadingState(!0),this.searchTimeout=setTimeout(async()=>{this.searchTimeout=null;try{let s=await this.getSearchResultsUsing(e);if(this.isDestroyed||n!==this.activeSearchId||!this.isOpen)return;let o=Array.isArray(s)?s:s&&Array.isArray(s.options)?s.options:[];this.options=o,this.populateLabelRepositoryFromOptions(o),this.isSearching=!1,this.hideLoadingState(),this.renderOptions(),this.isOpen&&this.deferPositionDropdown(),this.options.length===0&&this.showNoResultsMessage()}catch(s){!this.isDestroyed&&this.isOpen&&n===this.activeSearchId&&(console.error("Error fetching search results:",s),this.showErrorMessage())}finally{n===this.activeSearchId&&(this.isSearching=!1)}},this.searchDebounce)}showLoadingState(t=!1){this.setActiveOption(null),this.optionsList.hidden=!0,this.hideLoadingState(),this.optionsList.setAttribute("aria-busy","true");let e=document.createElement("div");e.className="fi-select-input-message",e.textContent=t?this.searchingMessage:this.loadingMessage,this.dropdown.appendChild(e),this.isOpen&&(this.deferPositionDropdown(),this.statusRegion.textContent=e.textContent),this.positionDropdown()}hideLoadingState(){this.optionsList.removeAttribute("aria-busy");let t=this.dropdown.querySelector(".fi-select-input-message");t&&(t.remove(),this.statusRegion.textContent="")}showNoOptionsMessage(){this.setActiveOption(null),this.optionsList.hidden=!0,this.hideLoadingState();let t=document.createElement("div");t.className="fi-select-input-message",t.textContent=this.noOptionsMessage,this.dropdown.appendChild(t),this.isOpen&&(this.deferPositionDropdown(),this.statusRegion.textContent=this.noOptionsMessage)}showNoResultsMessage(){this.setActiveOption(null),this.optionsList.hidden=!0,this.hideLoadingState();let t=document.createElement("div");t.className="fi-select-input-message",t.textContent=this.noSearchResultsMessage,this.dropdown.appendChild(t),this.isOpen&&(this.deferPositionDropdown(),this.statusRegion.textContent=this.noSearchResultsMessage)}showErrorMessage(){this.hasOptionsError=!0,this.showLoadingState(),this.optionsList.removeAttribute("aria-busy"),this.dropdown.querySelector(".fi-select-input-message").textContent=this.errorMessage,this.statusRegion.textContent=this.errorMessage,this.positionDropdown()}showMaxItemsMessage(){this.hideMaxItemsMessage(),this.maxItemsMessageElement=document.createElement("div"),this.maxItemsMessageElement.className="fi-select-input-max-items-message",this.maxItemsMessageElement.textContent=this.maxItemsMessage,this.optionsList.parentNode===this.dropdown?this.dropdown.insertBefore(this.maxItemsMessageElement,this.optionsList):this.dropdown.appendChild(this.maxItemsMessageElement),this.deferPositionDropdown(),this.statusRegion.textContent=this.maxItemsMessage}hideMaxItemsMessage(){this.maxItemsMessageElement&&(this.maxItemsMessageElement.remove(),this.maxItemsMessageElement=null,this.statusRegion.textContent===this.maxItemsMessage&&(this.statusRegion.textContent=""))}filterOptions(t){let e=this.searchableOptionFields.includes("label"),n=this.searchableOptionFields.includes("value");t=dt(t);let s=[];for(let o of this.originalOptions)if(o.options&&Array.isArray(o.options)){let r=o.options.filter(a=>e&&dt(a.label).includes(t)||n&&dt(String(a.value)).includes(t));r.length>0&&s.push({label:o.label,options:r})}else(e&&dt(o.label).includes(t)||n&&dt(String(o.value)).includes(t))&&s.push(o);this.options=s,this.renderOptions(),this.isOpen&&this.positionDropdown()}selectOption(t){if(this.isDisabled)return;if(!this.isMultiple){let n=this.container.contains(document.activeElement);this.state=t,this.updateSelectedDisplay(),this.renderOptions(),this.closeDropdown(),n&&this.selectButton.focus(),this.onStateChange(this.state);return}let e=Array.isArray(this.state)?[...this.state]:[];if(e.includes(t)){this.state=e.filter(n=>n!==t),this.updateSelectedDisplay(),this.hideMaxItemsMessage(),this.renderOptions(),this.isOpen&&this.deferPositionDropdown(),this.maintainFocusInMultipleMode(),this.updateSelectionSummary(),this.onStateChange(this.state);return}if(this.maxItems&&e.length>=this.maxItems){this.maxItemsMessage&&this.showMaxItemsMessage();return}this.hideMaxItemsMessage(),e.push(t),this.state=e,this.updateSelectedDisplay(),this.renderOptions(),this.isOpen&&this.deferPositionDropdown(),this.maintainFocusInMultipleMode(),this.onStateChange(this.state)}maintainFocusInMultipleMode(){this.isOpen&&this.container.contains(document.activeElement)&&this.getFocusOwner().focus()}disable(){this.isDisabled||(this.isDisabled=!0,this.applyDisabledState(),this.isOpen&&this.closeDropdown())}enable(){this.isDisabled&&(this.isDisabled=!1,this.applyDisabledState())}applyDisabledState(){if(this.badgesSortable?.option("disabled",this.isDisabled),this.isDisabled){if(this.selectButton.setAttribute("disabled","disabled"),this.selectButton.setAttribute("aria-disabled","true"),this.selectButton.classList.add("fi-disabled"),this.isMultiple&&this.container.querySelectorAll(".fi-badge-delete-btn").forEach(e=>{e.setAttribute("disabled","disabled"),e.classList.add("fi-disabled")}),!this.isMultiple&&this.canSelectPlaceholder){let t=this.container.querySelector(".fi-select-input-value-remove-btn");t&&(t.setAttribute("disabled","disabled"),t.classList.add("fi-disabled"))}this.isSearchable&&this.searchInput&&(this.searchInput.setAttribute("disabled","disabled"),this.searchInput.classList.add("fi-disabled"))}else{if(this.selectButton.removeAttribute("disabled"),this.selectButton.removeAttribute("aria-disabled"),this.selectButton.classList.remove("fi-disabled"),this.isMultiple&&this.container.querySelectorAll(".fi-badge-delete-btn").forEach(e=>{e.removeAttribute("disabled"),e.classList.remove("fi-disabled")}),!this.isMultiple&&this.canSelectPlaceholder){let t=this.container.querySelector(".fi-select-input-value-remove-btn");t&&(t.removeAttribute("disabled"),t.classList.remove("fi-disabled"))}this.isSearchable&&this.searchInput&&(this.searchInput.removeAttribute("disabled"),this.searchInput.classList.remove("fi-disabled"))}}destroy(){this.isDestroyed=!0,this.openId++,this.activeSearchId++,this.selectedDisplayVersion++,this.destroyBadgesSortable(),this.selectButton&&this.buttonClickListener&&this.selectButton.removeEventListener("click",this.buttonClickListener),this.documentClickListener&&document.removeEventListener("click",this.documentClickListener),this.selectButton&&this.buttonKeydownListener&&this.selectButton.removeEventListener("keydown",this.buttonKeydownListener),this.dropdown&&this.dropdownKeydownListener&&this.dropdown.removeEventListener("keydown",this.dropdownKeydownListener),this.dropdownEscapeListener&&this.element.removeEventListener("dropdown-escape",this.dropdownEscapeListener),this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null),this.scrollListener&&(window.removeEventListener("scroll",this.scrollListener,!0),this.scrollListener=null),this.refreshOptionLabelListener&&window.removeEventListener("filament-forms::select.refreshSelectedOptionLabel",this.refreshOptionLabelListener),this.isOpen&&this.closeDropdown(),this.searchTimeout&&(clearTimeout(this.searchTimeout),this.searchTimeout=null),this.container&&this.container.remove()}};function Qe({name:i,recordKey:t,state:e,messages:n}){let s=o=>o.method==="updateTableColumnState"&&o.params[0]===i&&String(o.params[1])===String(t);return{error:void 0,isLoading:!1,isDestroyed:!1,isRefreshing:!1,hasRenderedState:!1,state:e,status:void 0,unsubscribeLivewireHook:null,unsubscribeRequestHook:null,initEditableColumn(){this.unsubscribeLivewireHook=Livewire.interceptMessage(({message:o,onSuccess:r})=>{if(o.component.id!==this.$wire.$id)return;let a=o.calls.some(s),l=this.isRefreshing;r(({payload:c,onMorphed:h})=>h(()=>{let u=c.effects;(a||l)&&(this.hasRenderedState=!!u.html),l&&(this.isRefreshing=!1),u.html&&this.$nextTick(()=>{!this.isDestroyed&&!this.isLoading&&this.syncServerState()})}))}),this.$watch("state",async()=>{let o=this.getServerState();if(!(this.isDestroyed||this.isLoading||o===void 0||this.getNormalizedState()===o)){this.clearError(),this.isLoading=!0,this.hasRenderedState=!1,this.status=n?.saving,this.unsubscribeRequestHook=Livewire.interceptRequest(({request:r,onResponse:a})=>{r.payload.components.some(l=>JSON.parse(l.snapshot).memo.id===this.$wire.$id&&(this.isRefreshing||l.calls.some(s)))&&a(({response:l})=>{let c=l.text.bind(l);l.text=async()=>{try{return await c()}catch(h){throw r.cancel(),this.handleSaveFailure(),h}}})});try{let r=await this.$wire.updateTableColumnState(i,t,this.state);if(await this.$nextTick(),!this.isDestroyed&&!this.hasRenderedState&&(this.isRefreshing=!0,await this.$wire.$refresh(),await this.$nextTick(),!this.hasRenderedState)){this.handleSaveFailure();return}if(this.unsubscribeRequestHook?.(),this.unsubscribeRequestHook=null,this.isDestroyed)return;this.error=r?.error??void 0,this.status=this.error??n?.saved,this.isLoading=!1,this.syncServerState()}catch{this.handleSaveFailure()}}})},syncServerState(){let o=this.getServerState();o!==void 0&&(this.state=o)},getNormalizedState(){return Alpine.raw(this.state)??""},clearError(){this.isLoading||(this.error=void 0,this.status=void 0)},handleSaveFailure(){this.unsubscribeRequestHook?.(),this.unsubscribeRequestHook=null,!this.isDestroyed&&(this.error=n?.failure??"The save could not be confirmed. Refresh the page before trying again.",this.status=this.error,this.isRefreshing=!1,this.isLoading=!1)},preventEdit(o){!this.isLoading||o.type==="keydown"&&["Tab","Escape"].includes(o.key)||(o.preventDefault(),o.stopImmediatePropagation())},getAccessibilityAttributes(o={}){return{...o,"aria-invalid":this.error?"true":o["aria-invalid"]??null,"aria-busy":this.isLoading?"true":o["aria-busy"]??null,"aria-describedby":[o["aria-describedby"],this.error&&n?this.$id("table-column-error"):null].filter(Boolean).join(" ")||null}},destroy(){this.isDestroyed=!0,this.unsubscribeLivewireHook?.(),this.unsubscribeRequestHook?.(),this.unsubscribeRequestHook=null}}}function is({accessibilityAttributes:i,ariaLabel:t,canOptionLabelsWrap:e,canSelectPlaceholder:n,clearButtonLabel:s,errorMessage:o,hasDynamicOptions:r,hasDynamicSearchResults:a,hasInitialNoOptionsMessage:l,initialOptionLabel:c,isDisabled:h,isHtmlAllowed:u,isNative:f,isSearchable:p,loadingMessage:m,messages:g,name:w,noOptionsMessage:x,noSearchResultsMessage:S,options:A,optionsLimit:D,placeholder:_,position:C,recordKey:V,searchableOptionFields:J,searchDebounce:I,searchingMessage:W,searchLabel:Y,searchPrompt:tt,state:z}){let P=Qe({name:w,recordKey:V,state:z,messages:g});return{...P,select:null,init(){if(!f){this.select=new Ae({accessibilityAttributes:i,ariaLabel:t,canOptionLabelsWrap:e,canSelectPlaceholder:n,clearButtonLabel:s,element:this.$refs.select,errorMessage:o,getOptionLabelUsing:()=>this.$wire.callTableColumnMethod(w,V,"getOptionLabel"),getOptionsUsing:()=>Livewire.fireAction(this.$wire.__instance,"callTableColumnMethod",[w,V,"getOptionsForJs"],{async:!0}),getSearchResultsUsing:L=>Livewire.fireAction(this.$wire.__instance,"callTableColumnMethod",[w,V,"getOptionsSearchResultsForJs",{search:L}],{async:!0}),hasDynamicOptions:r,hasDynamicSearchResults:a,hasInitialNoOptionsMessage:l,initialOptionLabel:c,initialState:this.state,isDisabled:h,isHtmlAllowed:u,isSearchable:p,loadingMessage:m,noOptionsMessage:x,noSearchResultsMessage:S,onStateChange:L=>{this.clearError(),this.state=L},options:A,optionsLimit:D,placeholder:_,position:C,searchableOptionFields:J,searchDebounce:I,searchingMessage:W,searchLabel:Y,searchPrompt:tt,state:this.state});let N=()=>{this.select.setAccessibilityAttributes(this.getAccessibilityAttributes(i)),this.select.selectButton.setAttribute("aria-disabled",this.isLoading||this.select.isDisabled?"true":"false")};this.$watch("error",N),this.$watch("isLoading",N)}this.initEditableColumn(),this.$watch("state",N=>{!f&&this.select&&this.select.state!==N&&(this.select.state=N,this.select.updateSelectedDisplay(),this.select.renderOptions())})},syncServerState(){if(!f&&this.select&&this.$refs.serverState?.hasAttribute("data-option-label")){let N=this.getServerState(),L=this.$refs.serverState.dataset.optionLabel;this.select.labelRepository[N]!==L&&(this.select.updateOptionLabelInList(N,L),this.select.state===N&&this.select.updateSelectedDisplay())}P.syncServerState.call(this),!f&&this.select&&this.$refs.serverState?.hasAttribute("data-disabled")&&(this.$refs.serverState.dataset.disabled==="true"?this.select.disable():this.select.enable())},getServerState(){if(this.$refs.serverState)return[null,void 0].includes(this.$refs.serverState.value)?"":this.$refs.serverState.value.replaceAll('\\"','"')},destroy(){P.destroy.call(this),this.select&&(this.select.destroy(),this.select=null)}}}export{is as default};
|
|
2
|
+
/*! Bundled license information:
|
|
3
|
+
|
|
4
|
+
sortablejs/modular/sortable.esm.js:
|
|
5
|
+
(**!
|
|
6
|
+
* Sortable 1.15.7
|
|
7
|
+
* @author RubaXa <trash@rubaxa.org>
|
|
8
|
+
* @author owenm <owen23355@gmail.com>
|
|
9
|
+
* @license MIT
|
|
10
|
+
*)
|
|
11
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function u({name:s,recordKey:h,state:f,messages:r}){let l=e=>e.method==="updateTableColumnState"&&e.params[0]===s&&String(e.params[1])===String(h);return{error:void 0,isLoading:!1,isDestroyed:!1,isRefreshing:!1,hasRenderedState:!1,state:f,status:void 0,unsubscribeLivewireHook:null,unsubscribeRequestHook:null,initEditableColumn(){this.unsubscribeLivewireHook=Livewire.interceptMessage(({message:e,onSuccess:i})=>{if(e.component.id!==this.$wire.$id)return;let a=e.calls.some(l),t=this.isRefreshing;i(({payload:n,onMorphed:o})=>o(()=>{let d=n.effects;(a||t)&&(this.hasRenderedState=!!d.html),t&&(this.isRefreshing=!1),d.html&&this.$nextTick(()=>{!this.isDestroyed&&!this.isLoading&&this.syncServerState()})}))}),this.$watch("state",async()=>{let e=this.getServerState();if(!(this.isDestroyed||this.isLoading||e===void 0||this.getNormalizedState()===e)){this.clearError(),this.isLoading=!0,this.hasRenderedState=!1,this.status=r?.saving,this.unsubscribeRequestHook=Livewire.interceptRequest(({request:i,onResponse:a})=>{i.payload.components.some(t=>JSON.parse(t.snapshot).memo.id===this.$wire.$id&&(this.isRefreshing||t.calls.some(l)))&&a(({response:t})=>{let n=t.text.bind(t);t.text=async()=>{try{return await n()}catch(o){throw i.cancel(),this.handleSaveFailure(),o}}})});try{let i=await this.$wire.updateTableColumnState(s,h,this.state);if(await this.$nextTick(),!this.isDestroyed&&!this.hasRenderedState&&(this.isRefreshing=!0,await this.$wire.$refresh(),await this.$nextTick(),!this.hasRenderedState)){this.handleSaveFailure();return}if(this.unsubscribeRequestHook?.(),this.unsubscribeRequestHook=null,this.isDestroyed)return;this.error=i?.error??void 0,this.status=this.error??r?.saved,this.isLoading=!1,this.syncServerState()}catch{this.handleSaveFailure()}}})},syncServerState(){let e=this.getServerState();e!==void 0&&(this.state=e)},getNormalizedState(){return Alpine.raw(this.state)??""},clearError(){this.isLoading||(this.error=void 0,this.status=void 0)},handleSaveFailure(){this.unsubscribeRequestHook?.(),this.unsubscribeRequestHook=null,!this.isDestroyed&&(this.error=r?.failure??"The save could not be confirmed. Refresh the page before trying again.",this.status=this.error,this.isRefreshing=!1,this.isLoading=!1)},preventEdit(e){!this.isLoading||e.type==="keydown"&&["Tab","Escape"].includes(e.key)||(e.preventDefault(),e.stopImmediatePropagation())},getAccessibilityAttributes(e={}){return{...e,"aria-invalid":this.error?"true":e["aria-invalid"]??null,"aria-busy":this.isLoading?"true":e["aria-busy"]??null,"aria-describedby":[e["aria-describedby"],this.error&&r?this.$id("table-column-error"):null].filter(Boolean).join(" ")||null}},destroy(){this.isDestroyed=!0,this.unsubscribeLivewireHook?.(),this.unsubscribeRequestHook?.(),this.unsubscribeRequestHook=null}}}function c(s){return{...u(s),init(){this.initEditableColumn()},getServerState(){if(this.$refs.serverState)return[null,void 0].includes(this.$refs.serverState.value)?"":this.$refs.serverState.value.replaceAll('\\"','"')}}}export{c as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function h({name:s,recordKey:u,state:f,messages:r}){let d=e=>e.method==="updateTableColumnState"&&e.params[0]===s&&String(e.params[1])===String(u);return{error:void 0,isLoading:!1,isDestroyed:!1,isRefreshing:!1,hasRenderedState:!1,state:f,status:void 0,unsubscribeLivewireHook:null,unsubscribeRequestHook:null,initEditableColumn(){this.unsubscribeLivewireHook=Livewire.interceptMessage(({message:e,onSuccess:i})=>{if(e.component.id!==this.$wire.$id)return;let a=e.calls.some(d),t=this.isRefreshing;i(({payload:n,onMorphed:o})=>o(()=>{let l=n.effects;(a||t)&&(this.hasRenderedState=!!l.html),t&&(this.isRefreshing=!1),l.html&&this.$nextTick(()=>{!this.isDestroyed&&!this.isLoading&&this.syncServerState()})}))}),this.$watch("state",async()=>{let e=this.getServerState();if(!(this.isDestroyed||this.isLoading||e===void 0||this.getNormalizedState()===e)){this.clearError(),this.isLoading=!0,this.hasRenderedState=!1,this.status=r?.saving,this.unsubscribeRequestHook=Livewire.interceptRequest(({request:i,onResponse:a})=>{i.payload.components.some(t=>JSON.parse(t.snapshot).memo.id===this.$wire.$id&&(this.isRefreshing||t.calls.some(d)))&&a(({response:t})=>{let n=t.text.bind(t);t.text=async()=>{try{return await n()}catch(o){throw i.cancel(),this.handleSaveFailure(),o}}})});try{let i=await this.$wire.updateTableColumnState(s,u,this.state);if(await this.$nextTick(),!this.isDestroyed&&!this.hasRenderedState&&(this.isRefreshing=!0,await this.$wire.$refresh(),await this.$nextTick(),!this.hasRenderedState)){this.handleSaveFailure();return}if(this.unsubscribeRequestHook?.(),this.unsubscribeRequestHook=null,this.isDestroyed)return;this.error=i?.error??void 0,this.status=this.error??r?.saved,this.isLoading=!1,this.syncServerState()}catch{this.handleSaveFailure()}}})},syncServerState(){let e=this.getServerState();e!==void 0&&(this.state=e)},getNormalizedState(){return Alpine.raw(this.state)??""},clearError(){this.isLoading||(this.error=void 0,this.status=void 0)},handleSaveFailure(){this.unsubscribeRequestHook?.(),this.unsubscribeRequestHook=null,!this.isDestroyed&&(this.error=r?.failure??"The save could not be confirmed. Refresh the page before trying again.",this.status=this.error,this.isRefreshing=!1,this.isLoading=!1)},preventEdit(e){!this.isLoading||e.type==="keydown"&&["Tab","Escape"].includes(e.key)||(e.preventDefault(),e.stopImmediatePropagation())},getAccessibilityAttributes(e={}){return{...e,"aria-invalid":this.error?"true":e["aria-invalid"]??null,"aria-busy":this.isLoading?"true":e["aria-busy"]??null,"aria-describedby":[e["aria-describedby"],this.error&&r?this.$id("table-column-error"):null].filter(Boolean).join(" ")||null}},destroy(){this.isDestroyed=!0,this.unsubscribeLivewireHook?.(),this.unsubscribeRequestHook?.(),this.unsubscribeRequestHook=null}}}function c(s){return{...h(s),init(){this.initEditableColumn()},getServerState(){if(this.$refs.serverState)return[1,"1"].includes(this.$refs.serverState.value)}}}export{c as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{var H=Math.min,E=Math.max,N=Math.round,I=Math.floor,A=e=>({x:e,y:e});function Z(e,t,o){return E(e,H(t,o))}function j(e,t){return typeof e=="function"?e(t):e}function X(e){return e.split("-")[0]}function ee(e){return e.split("-")[1]}function te(e){return e==="x"?"y":"x"}function le(e){return e==="y"?"height":"width"}function _(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function ce(e){return te(_(e))}function $e(e){return{top:0,right:0,bottom:0,left:0,...e}}function ae(e){return typeof e!="number"?$e(e):{top:e,right:e,bottom:e,left:e}}function k(e){let{x:t,y:o,width:i,height:s}=e;return{width:i,height:s,top:o,left:t,right:t+i,bottom:o+s,x:t,y:o}}function de(e,t,o){let{reference:i,floating:s}=e,c=_(t),l=ce(t),n=le(l),r=X(t),a=c==="y",u=i.x+i.width/2-s.width/2,f=i.y+i.height/2-s.height/2,h=i[n]/2-s[n]/2,d;switch(r){case"top":d={x:u,y:i.y-s.height};break;case"bottom":d={x:u,y:i.y+i.height};break;case"right":d={x:i.x+i.width,y:f};break;case"left":d={x:i.x-s.width,y:f};break;default:d={x:i.x,y:i.y}}switch(ee(t)){case"start":d[l]-=h*(o&&a?-1:1);break;case"end":d[l]+=h*(o&&a?-1:1);break}return d}async function fe(e,t){var o;t===void 0&&(t={});let{x:i,y:s,platform:c,rects:l,elements:n,strategy:r}=e,{boundary:a="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:d=0}=j(t,e),m=ae(d),w=n[h?f==="floating"?"reference":"floating":f],g=k(await c.getClippingRect({element:(o=await(c.isElement==null?void 0:c.isElement(w)))==null||o?w:w.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(n.floating)),boundary:a,rootBoundary:u,strategy:r})),b=f==="floating"?{x:i,y:s,width:l.floating.width,height:l.floating.height}:l.reference,R=await(c.getOffsetParent==null?void 0:c.getOffsetParent(n.floating)),y=await(c.isElement==null?void 0:c.isElement(R))?await(c.getScale==null?void 0:c.getScale(R))||{x:1,y:1}:{x:1,y:1},L=k(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:n,rect:b,offsetParent:R,strategy:r}):b);return{top:(g.top-L.top+m.top)/y.y,bottom:(L.bottom-g.bottom+m.bottom)/y.y,left:(g.left-L.left+m.left)/y.x,right:(L.right-g.right+m.right)/y.x}}var Me=50,ue=async(e,t,o)=>{let{placement:i="bottom",strategy:s="absolute",middleware:c=[],platform:l}=o,n=l.detectOverflow?l:{...l,detectOverflow:fe},r=await(l.isRTL==null?void 0:l.isRTL(t)),a=await l.getElementRects({reference:e,floating:t,strategy:s}),{x:u,y:f}=de(a,i,r),h=i,d=0,m={};for(let p=0;p<c.length;p++){let w=c[p];if(!w)continue;let{name:g,fn:b}=w,{x:R,y,data:L,reset:S}=await b({x:u,y:f,initialPlacement:i,placement:h,strategy:s,middlewareData:m,rects:a,platform:n,elements:{reference:e,floating:t}});u=R??u,f=y??f,m[g]={...m[g],...L},S&&d<Me&&(d++,typeof S=="object"&&(S.placement&&(h=S.placement),S.rects&&(a=S.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:s}):S.rects),{x:u,y:f}=de(a,h,r)),p=-1)}return{x:u,y:f,placement:h,strategy:s,middlewareData:m}};var He=new Set(["left","top"]);async function Ve(e,t){let{placement:o,platform:i,elements:s}=e,c=await(i.isRTL==null?void 0:i.isRTL(s.floating)),l=X(o),n=ee(o),r=_(o)==="y",a=He.has(l)?-1:1,u=c&&r?-1:1,f=j(t,e),{mainAxis:h,crossAxis:d,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return n&&typeof m=="number"&&(d=n==="end"?m*-1:m),r?{x:d*u,y:h*a}:{x:h*a,y:d*u}}var he=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var o,i;let{x:s,y:c,placement:l,middlewareData:n}=t,r=await Ve(t,e);return l===((o=n.offset)==null?void 0:o.placement)&&(i=n.arrow)!=null&&i.alignmentOffset?{}:{x:s+r.x,y:c+r.y,data:{...r,placement:l}}}}},me=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:o,y:i,placement:s,platform:c}=t,{mainAxis:l=!0,crossAxis:n=!1,limiter:r={fn:g=>{let{x:b,y:R}=g;return{x:b,y:R}}},...a}=j(e,t),u={x:o,y:i},f=await c.detectOverflow(t,a),h=_(X(s)),d=te(h),m=u[d],p=u[h];if(l){let g=d==="y"?"top":"left",b=d==="y"?"bottom":"right",R=m+f[g],y=m-f[b];m=Z(R,m,y)}if(n){let g=h==="y"?"top":"left",b=h==="y"?"bottom":"right",R=p+f[g],y=p-f[b];p=Z(R,p,y)}let w=r.fn({...t,[d]:m,[h]:p});return{...w,data:{x:w.x-o,y:w.y-i,enabled:{[d]:l,[h]:n}}}}}};function K(){return typeof window<"u"}function D(e){return pe(e)?(e.nodeName||"").toLowerCase():"#document"}function x(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function O(e){var t;return(t=(pe(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function pe(e){return K()?e instanceof Node||e instanceof x(e).Node:!1}function v(e){return K()?e instanceof Element||e instanceof x(e).Element:!1}function T(e){return K()?e instanceof HTMLElement||e instanceof x(e).HTMLElement:!1}function ge(e){return!K()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof x(e).ShadowRoot}function W(e){let{overflow:t,overflowX:o,overflowY:i,display:s}=C(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+o)&&s!=="inline"&&s!=="contents"}function we(e){return/^(table|td|th)$/.test(D(e))}function z(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}var We=/transform|translate|scale|rotate|perspective|filter/,Be=/paint|layout|strict|content/,P=e=>!!e&&e!=="none",ne;function G(e){let t=v(e)?C(e):e;return P(t.transform)||P(t.translate)||P(t.scale)||P(t.rotate)||P(t.perspective)||!Y()&&(P(t.backdropFilter)||P(t.filter))||We.test(t.willChange||"")||Be.test(t.contain||"")}function be(e){let t=F(e);for(;T(t)&&!$(t);){if(G(t))return t;if(z(t))return null;t=F(t)}return null}function Y(){return ne==null&&(ne=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),ne}function $(e){return/^(html|body|#document)$/.test(D(e))}function C(e){return x(e).getComputedStyle(e)}function q(e){return v(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function F(e){if(D(e)==="html")return e;let t=e.assignedSlot||e.parentNode||ge(e)&&e.host||O(e);return ge(t)?t.host:t}function Re(e){let t=F(e);return $(t)?e.ownerDocument?e.ownerDocument.body:e.body:T(t)&&W(t)?t:Re(t)}function V(e,t,o){var i;t===void 0&&(t=[]),o===void 0&&(o=!0);let s=Re(e),c=s===((i=e.ownerDocument)==null?void 0:i.body),l=x(s);if(c){let n=J(l);return t.concat(l,l.visualViewport||[],W(s)?s:[],n&&o?V(n):[])}else return t.concat(s,V(s,[],o))}function J(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ce(e){let t=C(e),o=parseFloat(t.width)||0,i=parseFloat(t.height)||0,s=T(e),c=s?e.offsetWidth:o,l=s?e.offsetHeight:i,n=N(o)!==c||N(i)!==l;return n&&(o=c,i=l),{width:o,height:i,$:n}}function oe(e){return v(e)?e:e.contextElement}function B(e){let t=oe(e);if(!T(t))return A(1);let o=t.getBoundingClientRect(),{width:i,height:s,$:c}=Ce(t),l=(c?N(o.width):o.width)/i,n=(c?N(o.height):o.height)/s;return(!l||!Number.isFinite(l))&&(l=1),(!n||!Number.isFinite(n))&&(n=1),{x:l,y:n}}var Ne=A(0);function Ae(e){let t=x(e);return!Y()||!t.visualViewport?Ne:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ie(e,t,o){return t===void 0&&(t=!1),!o||t&&o!==x(e)?!1:t}function M(e,t,o,i){t===void 0&&(t=!1),o===void 0&&(o=!1);let s=e.getBoundingClientRect(),c=oe(e),l=A(1);t&&(i?v(i)&&(l=B(i)):l=B(e));let n=Ie(c,o,i)?Ae(c):A(0),r=(s.left+n.x)/l.x,a=(s.top+n.y)/l.y,u=s.width/l.x,f=s.height/l.y;if(c){let h=x(c),d=i&&v(i)?x(i):i,m=h,p=J(m);for(;p&&i&&d!==m;){let w=B(p),g=p.getBoundingClientRect(),b=C(p),R=g.left+(p.clientLeft+parseFloat(b.paddingLeft))*w.x,y=g.top+(p.clientTop+parseFloat(b.paddingTop))*w.y;r*=w.x,a*=w.y,u*=w.x,f*=w.y,r+=R,a+=y,m=x(p),p=J(m)}}return k({width:u,height:f,x:r,y:a})}function Q(e,t){let o=q(e).scrollLeft;return t?t.left+o:M(O(e)).left+o}function Oe(e,t){let o=e.getBoundingClientRect(),i=o.left+t.scrollLeft-Q(e,o),s=o.top+t.scrollTop;return{x:i,y:s}}function _e(e){let{elements:t,rect:o,offsetParent:i,strategy:s}=e,c=s==="fixed",l=O(i),n=t?z(t.floating):!1;if(i===l||n&&c)return o;let r={scrollLeft:0,scrollTop:0},a=A(1),u=A(0),f=T(i);if((f||!f&&!c)&&((D(i)!=="body"||W(l))&&(r=q(i)),f)){let d=M(i);a=B(i),u.x=d.x+i.clientLeft,u.y=d.y+i.clientTop}let h=l&&!f&&!c?Oe(l,r):A(0);return{width:o.width*a.x,height:o.height*a.y,x:o.x*a.x-r.scrollLeft*a.x+u.x+h.x,y:o.y*a.y-r.scrollTop*a.y+u.y+h.y}}function ze(e){return Array.from(e.getClientRects())}function qe(e){let t=O(e),o=q(e),i=e.ownerDocument.body,s=E(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),c=E(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight),l=-o.scrollLeft+Q(e),n=-o.scrollTop;return C(i).direction==="rtl"&&(l+=E(t.clientWidth,i.clientWidth)-s),{width:s,height:c,x:l,y:n}}var ye=25;function Ue(e,t){let o=x(e),i=O(e),s=o.visualViewport,c=i.clientWidth,l=i.clientHeight,n=0,r=0;if(s){c=s.width,l=s.height;let u=Y();(!u||u&&t==="fixed")&&(n=s.offsetLeft,r=s.offsetTop)}let a=Q(i);if(a<=0){let u=i.ownerDocument,f=u.body,h=getComputedStyle(f),d=u.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,m=Math.abs(i.clientWidth-f.clientWidth-d);m<=ye&&(c-=m)}else a<=ye&&(c+=a);return{width:c,height:l,x:n,y:r}}function je(e,t){let o=M(e,!0,t==="fixed"),i=o.top+e.clientTop,s=o.left+e.clientLeft,c=T(e)?B(e):A(1),l=e.clientWidth*c.x,n=e.clientHeight*c.y,r=s*c.x,a=i*c.y;return{width:l,height:n,x:r,y:a}}function xe(e,t,o){let i;if(t==="viewport")i=Ue(e,o);else if(t==="document")i=qe(O(e));else if(v(t))i=je(t,o);else{let s=Ae(e);i={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return k(i)}function Se(e,t){let o=F(e);return o===t||!v(o)||$(o)?!1:C(o).position==="fixed"||Se(o,t)}function Xe(e,t){let o=t.get(e);if(o)return o;let i=V(e,[],!1).filter(n=>v(n)&&D(n)!=="body"),s=null,c=C(e).position==="fixed",l=c?F(e):e;for(;v(l)&&!$(l);){let n=C(l),r=G(l);!r&&n.position==="fixed"&&(s=null),(c?!r&&!s:!r&&n.position==="static"&&!!s&&(s.position==="absolute"||s.position==="fixed")||W(l)&&!r&&Se(e,l))?i=i.filter(u=>u!==l):s=n,l=F(l)}return t.set(e,i),i}function Ke(e){let{element:t,boundary:o,rootBoundary:i,strategy:s}=e,l=[...o==="clippingAncestors"?z(t)?[]:Xe(t,this._c):[].concat(o),i],n=xe(t,l[0],s),r=n.top,a=n.right,u=n.bottom,f=n.left;for(let h=1;h<l.length;h++){let d=xe(t,l[h],s);r=E(d.top,r),a=H(d.right,a),u=H(d.bottom,u),f=E(d.left,f)}return{width:a-f,height:u-r,x:f,y:r}}function Ge(e){let{width:t,height:o}=Ce(e);return{width:t,height:o}}function Ye(e,t,o){let i=T(t),s=O(t),c=o==="fixed",l=M(e,!0,c,t),n={scrollLeft:0,scrollTop:0},r=A(0);function a(){r.x=Q(s)}if(i||!i&&!c)if((D(t)!=="body"||W(s))&&(n=q(t)),i){let d=M(t,!0,c,t);r.x=d.x+t.clientLeft,r.y=d.y+t.clientTop}else s&&a();c&&!i&&s&&a();let u=s&&!i&&!c?Oe(s,n):A(0),f=l.left+n.scrollLeft-r.x-u.x,h=l.top+n.scrollTop-r.y-u.y;return{x:f,y:h,width:l.width,height:l.height}}function ie(e){return C(e).position==="static"}function ve(e,t){if(!T(e)||C(e).position==="fixed")return null;if(t)return t(e);let o=e.offsetParent;return O(e)===o&&(o=o.ownerDocument.body),o}function Te(e,t){let o=x(e);if(z(e))return o;if(!T(e)){let s=F(e);for(;s&&!$(s);){if(v(s)&&!ie(s))return s;s=F(s)}return o}let i=ve(e,t);for(;i&&we(i)&&ie(i);)i=ve(i,t);return i&&$(i)&&ie(i)&&!G(i)?o:i||be(e)||o}var Je=async function(e){let t=this.getOffsetParent||Te,o=this.getDimensions,i=await o(e.floating);return{reference:Ye(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function Qe(e){return C(e).direction==="rtl"}var Ze={convertOffsetParentRelativeRectToViewportRelativeRect:_e,getDocumentElement:O,getClippingRect:Ke,getOffsetParent:Te,getElementRects:Je,getClientRects:ze,getDimensions:Ge,getScale:B,isElement:v,isRTL:Qe};function Le(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function et(e,t){let o=null,i,s=O(e);function c(){var n;clearTimeout(i),(n=o)==null||n.disconnect(),o=null}function l(n,r){n===void 0&&(n=!1),r===void 0&&(r=1),c();let a=e.getBoundingClientRect(),{left:u,top:f,width:h,height:d}=a;if(n||t(),!h||!d)return;let m=I(f),p=I(s.clientWidth-(u+h)),w=I(s.clientHeight-(f+d)),g=I(u),R={rootMargin:-m+"px "+-p+"px "+-w+"px "+-g+"px",threshold:E(0,H(1,r))||1},y=!0;function L(S){let U=S[0].intersectionRatio;if(U!==r){if(!y)return l();U?l(!1,U):i=setTimeout(()=>{l(!1,1e-7)},1e3)}U===1&&!Le(a,e.getBoundingClientRect())&&l(),y=!1}try{o=new IntersectionObserver(L,{...R,root:s.ownerDocument})}catch{o=new IntersectionObserver(L,R)}o.observe(e)}return l(!0),c}function Ee(e,t,o,i){i===void 0&&(i={});let{ancestorScroll:s=!0,ancestorResize:c=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:n=typeof IntersectionObserver=="function",animationFrame:r=!1}=i,a=oe(e),u=s||c?[...a?V(a):[],...t?V(t):[]]:[];u.forEach(g=>{s&&g.addEventListener("scroll",o,{passive:!0}),c&&g.addEventListener("resize",o)});let f=a&&n?et(a,o):null,h=-1,d=null;l&&(d=new ResizeObserver(g=>{let[b]=g;b&&b.target===a&&d&&t&&(d.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var R;(R=d)==null||R.observe(t)})),o()}),a&&!r&&d.observe(a),t&&d.observe(t));let m,p=r?M(e):null;r&&w();function w(){let g=M(e);p&&!Le(p,g)&&o(),p=g,m=requestAnimationFrame(w)}return o(),()=>{var g;u.forEach(b=>{s&&b.removeEventListener("scroll",o),c&&b.removeEventListener("resize",o)}),f?.(),(g=d)==null||g.disconnect(),d=null,r&&cancelAnimationFrame(m)}}var Fe=he;var ke=me;var Pe=(e,t,o)=>{let i=new Map,s={platform:Ze,...o},c={...s.platform,_c:i};return ue(e,t,{...s,platform:c})};function se({areGroupsCollapsedByDefault:e,canTrackDeselectedRecords:t,currentSelectionLivewireProperty:o,maxSelectableRecords:i,reorderMessage:s,selectsCurrentPageOnly:c}){let l=this.$wire;return{areFiltersOpen:!1,checkboxClickController:null,groupVisibility:[],isLoading:!1,selectedRecords:new Set,deselectedRecords:new Set,isTrackingDeselectedRecords:!1,shouldCheckUniqueSelection:!0,lastCheckedRecord:null,livewireId:null,entangledSelectedRecords:o?l.$entangle(o):null,cleanUpFiltersDropdown:null,livewireEventListenersController:null,unsubscribeLivewireHook:null,tableReorderOperation:null,tableReorderFrame:null,tableReorderRoot:null,init(){this.tableReorderRoot=this.$root,this.livewireId=this.$root.closest("[wire\\:id]")?.attributes["wire:id"].value,this.livewireEventListenersController=new AbortController;let{signal:n}=this.livewireEventListenersController;l.$el.addEventListener("deselectAllTableRecords",()=>this.deselectAllRecords(),{signal:n}),l.$el.addEventListener("scrollToTopOfTable",()=>this.$root.scrollIntoView({block:"start",inline:"nearest"}),{signal:n}),o&&(i!==1?this.selectedRecords=new Set(this.entangledSelectedRecords):this.selectedRecords=new Set(this.entangledSelectedRecords?[this.entangledSelectedRecords]:[])),this.$nextTick(()=>this.watchForCheckboxClicks()),this.unsubscribeLivewireHook=Livewire.hook("element.init",({component:r})=>{r.id===this.livewireId&&this.watchForCheckboxClicks()})},getTableReorderItems(){return Array.from(this.tableReorderRoot.querySelector('[x-ref="tableReorderRecords"]')?.children??[]).filter(n=>n.hasAttribute("x-sortable-item"))},beginTableReorder(n,r){return this.tableReorderOperation?!1:(this.tableReorderOperation={recordKey:n,direction:r,before:this.getTableReorderItems().map(a=>a.getAttribute("x-sortable-item"))},!0)},startTableReorder(n){n.target===this.$refs.tableReorderRecords&&this.beginTableReorder(n.item.getAttribute("x-sortable-item"),"drag")},async reorderTableRecords(n){if(n.target===this.$refs.tableReorderRecords){if(n.oldDraggableIndex===n.newDraggableIndex){this.tableReorderOperation=null;return}await this.finishTableReorder(()=>l.reorderTable(n.target.sortable.toArray(),n.item.getAttribute("x-sortable-item")))}},async moveTableRecord(n,r,a){n.currentTarget.disabled||!this.beginTableReorder(r,a)||await this.finishTableReorder(()=>l.moveTableRecord(r,a))},async finishTableReorder(n){let r=this.tableReorderOperation;if(!r)return;this.tableReorderRoot.querySelector('[x-ref="tableReorderRecords"]')?.sortable?.option("disabled",!0);try{await n()}catch{if(this.tableReorderOperation!==r||!this.tableReorderRoot.isConnected)return;try{await l.$refresh()}catch{if(this.tableReorderOperation!==r||!this.tableReorderRoot.isConnected)return;this.tableReorderRoot.querySelector('[x-ref="tableReorderRecords"]')?.sortable?.sort(r.before)}}this.tableReorderOperation!==r||!this.tableReorderRoot.isConnected||(this.tableReorderFrame=requestAnimationFrame(()=>{if(this.tableReorderFrame=null,this.tableReorderOperation!==r||!this.tableReorderRoot.isConnected)return;let u=this.getTableReorderItems(),f=u.map(g=>g.getAttribute("x-sortable-item")),h=r.before.filter(g=>f.includes(g)),d=f.filter(g=>r.before.includes(g)),m=u.find(g=>g.getAttribute("x-sortable-item")===r.recordKey),p=m&&h.indexOf(r.recordKey)!==d.indexOf(r.recordKey),w=this.tableReorderRoot.querySelector('[x-ref="tableReorderStatus"]');if(p&&w){let g=m.querySelector("[data-table-reorder-label]")?.dataset.tableReorderLabel;w.textContent=s.replace(/:label|:position|:count/g,b=>({":label":g,":position":String(f.indexOf(r.recordKey)+1),":count":String(f.length)})[b])}this.tableReorderOperation=null,this.tableReorderRoot.querySelector('[x-ref="tableReorderRecords"]')?.sortable?.option("disabled",!1)}))},mountAction(...n){l.set("isTrackingDeselectedTableRecords",this.isTrackingDeselectedRecords,!1),l.set("selectedTableRecords",[...this.selectedRecords],!1),l.set("deselectedTableRecords",[...this.deselectedRecords],!1),l.mountAction(...n)},toggleSelectRecordsOnPage(){let n=this.getRecordsOnPage();if(this.areRecordsSelected(n)){this.deselectRecords(n);return}this.selectRecords(n)},toggleSelectRecords(n){this.areRecordsSelected(n)?this.deselectRecords(n):this.selectRecords(n)},getSelectedRecordsCount(){return this.isTrackingDeselectedRecords?(this.$refs.allSelectableRecordsCount?.value??this.deselectedRecords.size)-this.deselectedRecords.size:this.selectedRecords.size},getRecordsOnPage(){let n=[];for(let r of this.$root?.getElementsByClassName("fi-ta-record-checkbox")??[])n.push(r.value);return n},selectRecords(n){i===1&&(this.deselectAllRecords(),n=n.slice(0,1));for(let r of n)if(!this.isRecordSelected(r)){if(this.isTrackingDeselectedRecords){this.deselectedRecords.delete(r);continue}this.selectedRecords.add(r)}this.updatedSelectedRecords()},deselectRecords(n){for(let r of n){if(this.isTrackingDeselectedRecords){this.deselectedRecords.add(r);continue}this.selectedRecords.delete(r)}this.updatedSelectedRecords()},updatedSelectedRecords(){if(i!==1){this.entangledSelectedRecords=[...this.selectedRecords];return}this.entangledSelectedRecords=[...this.selectedRecords][0]??null},toggleSelectedRecord(n){if(this.isRecordSelected(n)){this.deselectRecords([n]);return}this.selectRecords([n])},async selectAllRecords(){if(!t||c){this.isLoading=!0,this.selectedRecords=new Set(await l.getAllSelectableTableRecordKeys()),this.updatedSelectedRecords(),this.isLoading=!1;return}this.isTrackingDeselectedRecords=!0,this.selectedRecords=new Set,this.deselectedRecords=new Set,this.updatedSelectedRecords()},canSelectAllRecords(){if(c){let a=this.getRecordsOnPage();return!this.areRecordsSelected(a)&&this.areRecordsToggleable(a)}let n=parseInt(this.$refs.allSelectableRecordsCount?.value);if(!n)return!1;let r=this.getSelectedRecordsCount();return n===r?!1:i===null||n<=i},deselectAllRecords(){this.isTrackingDeselectedRecords=!1,this.selectedRecords=new Set,this.deselectedRecords=new Set,this.updatedSelectedRecords()},isRecordSelected(n){return this.isTrackingDeselectedRecords?!this.deselectedRecords.has(n):this.selectedRecords.has(n)},areRecordsSelected(n){return n.every(r=>this.isRecordSelected(r))},areRecordsPartiallySelected(n){if(n.length===0)return!1;let r=n.filter(a=>this.isRecordSelected(a)).length;return r>0&&r<n.length},areRecordsToggleable(n){if(i===null||i===1)return!0;let r=n.filter(a=>this.isRecordSelected(a));return r.length===n.length?!0:this.getSelectedRecordsCount()+(n.length-r.length)<=i},toggleCollapseGroup(n){this.isGroupCollapsed(n)?e?this.groupVisibility.push(n):this.groupVisibility.splice(this.groupVisibility.indexOf(n),1):e?this.groupVisibility.splice(this.groupVisibility.indexOf(n),1):this.groupVisibility.push(n)},isGroupCollapsed(n){return e?!this.groupVisibility.includes(n):this.groupVisibility.includes(n)},resetCollapsedGroups(){this.groupVisibility=[]},watchForCheckboxClicks(){this.checkboxClickController&&this.checkboxClickController.abort(),this.checkboxClickController=new AbortController;let{signal:n}=this.checkboxClickController;this.$root?.addEventListener("click",r=>r.target?.matches(".fi-ta-record-checkbox")&&this.handleCheckboxClick(r,r.target),{signal:n})},handleCheckboxClick(n,r){if(!this.lastChecked){this.lastChecked=r;return}if(n.shiftKey){let a=Array.from(this.$root?.getElementsByClassName("fi-ta-record-checkbox")??[]);if(!a.includes(this.lastChecked)){this.lastChecked=r;return}let u=a.indexOf(this.lastChecked),f=a.indexOf(r),h=[u,f].sort((m,p)=>m-p),d=[];for(let m=h[0];m<=h[1];m++)d.push(a[m].value);if(r.checked){if(!this.areRecordsToggleable(d)){r.checked=!1,this.deselectRecords([r.value]);return}this.selectRecords(d)}else this.deselectRecords(d)}this.lastChecked=r},toggleFiltersDropdown(){if(this.areFiltersOpen=!this.areFiltersOpen,this.areFiltersOpen){let n=this.$refs.filtersTriggerActionContainer,r=this.$refs.filtersContentContainer,a=!0,u=Ee(n,r,async()=>{let{x:d,y:m}=await Pe(n,r,{placement:"bottom-end",middleware:[Fe(8),ke({padding:8})]});a&&Object.assign(r.style,{left:`${d}px`,top:`${m}px`})}),f=d=>{r&&r.contains(d.target)||n&&n.contains(d.target)||(this.areFiltersOpen=!1,this.cleanUpFiltersDropdown&&(this.cleanUpFiltersDropdown(),this.cleanUpFiltersDropdown=null))};document.addEventListener("mousedown",f),document.addEventListener("touchstart",f,{passive:!0});let h=d=>{d.key==="Escape"&&f(d)};document.addEventListener("keydown",h),this.cleanUpFiltersDropdown=()=>{a=!1,u(),document.removeEventListener("mousedown",f),document.removeEventListener("touchstart",f,{passive:!0}),document.removeEventListener("keydown",h)}}else this.cleanUpFiltersDropdown&&(this.cleanUpFiltersDropdown(),this.cleanUpFiltersDropdown=null)},destroy(){this.tableReorderOperation=null,cancelAnimationFrame(this.tableReorderFrame),this.cleanUpFiltersDropdown?.(),this.livewireEventListenersController?.abort(),this.unsubscribeLivewireHook?.()}}}var De=()=>({focusFrame:null,actionFocusFrame:null,actionRevision:0,removeActionCommitHook:null,dropdownPanel:null,dropdownOpenedListener:null,init(){this.dropdownPanel=this.$el.closest(".fi-dropdown-panel"),this.dropdownOpenedListener=e=>{this.actionRevision++,e.detail.shouldAutofocus&&(this.focusFirstControl(),this.$el.focus())},this.dropdownPanel?.addEventListener("dropdown-opened",this.dropdownOpenedListener)},handleActionClick(e){let t=e.target.closest("[data-table-filter-action]");if(t===null)return;let o=t.dataset.tableFilterAction,i=t.getAttribute("wire:click")?.split("(")[0],s=o==="apply"&&this.dropdownPanel!==null;if(!i||!s&&e.detail!==0)return;let c=++this.actionRevision;this.removeActionCommitHook?.(),this.removeActionCommitHook=Livewire.interceptMessage(({message:l,onSuccess:n})=>{l.component.id!==this.$wire.$id||!l.getActions().some(r=>r.name===i)||(this.removeActionCommitHook?.(),this.removeActionCommitHook=null,n(({payload:r,onMorphed:a})=>{Object.keys(r.snapshot.memo.errors??{}).some(u=>u==="tableDeferredFilters"||u.startsWith("tableDeferredFilters."))||a(()=>{this.actionFocusFrame=requestAnimationFrame(()=>{if(this.actionFocusFrame=null,!(l.isCancelled()||this.actionRevision!==c||!this.$el.isConnected||this.dropdownPanel?.style.display!=="block")){if(s){this.closeDropdown();return}document.activeElement===document.body&&this.$el.querySelector(`[data-table-filter-action="${o}"]`)?.focus()}})})}))})},closeDropdown(){let e=window.Alpine.$data(this.dropdownPanel.closest(".fi-dropdown")),t=document.activeElement===document.body||this.dropdownPanel.contains(document.activeElement);e?.close(),t&&e?.getTrigger()?.focus()},focusFirstControl(){this.focusFrame!==null&&cancelAnimationFrame(this.focusFrame),this.focusFrame=requestAnimationFrame(()=>{if(this.focusFrame=null,!this.$el.isConnected||this.$el.closest(".fi-dropdown-panel")?.style.display!=="block"||document.activeElement!==this.$el)return;Array.from(this.$el.querySelectorAll('button:not([disabled]), input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), [href], [tabindex]:not([tabindex="-1"])')).find(t=>!t.matches(":disabled")&&!t.closest(".fi-ta-filters-header, .fi-ta-filters-actions-ctn, [x-load][x-ignore], fieldset[disabled]")&&t.getClientRects().length>0&&getComputedStyle(t).visibility!=="hidden")?.focus()})},destroy(){this.actionRevision++,this.actionFocusFrame!==null&&(cancelAnimationFrame(this.actionFocusFrame),this.actionFocusFrame=null),this.focusFrame!==null&&(cancelAnimationFrame(this.focusFrame),this.focusFrame=null),this.removeActionCommitHook?.(),this.removeActionCommitHook=null,this.dropdownPanel?.removeEventListener("dropdown-opened",this.dropdownOpenedListener)}});function re({columns:e,isLive:t}){return{error:void 0,isLoading:!1,deferredColumns:[],columns:e,isLive:t,dropdownPanel:null,dropdownOpenedListener:null,dropdownRevision:0,hasReordered:!1,reorderAnnouncement:"",focusRevision:0,init(){if(this.dropdownPanel=this.$el.closest(".fi-dropdown-panel"),this.dropdownOpenedListener=()=>this.dropdownRevision++,this.dropdownPanel?.addEventListener("dropdown-opened",this.dropdownOpenedListener),!this.columns||this.columns.length===0){this.columns=[];return}this.deferredColumns=JSON.parse(JSON.stringify(this.columns)),this.$watch("columns",()=>{this.resetDeferredColumns()})},get groupedColumns(){let o={};return this.deferredColumns.filter(i=>i.type==="group").forEach(i=>{o[i.name]=this.calculateGroupedColumns(i)}),o},calculateGroupedColumns(o){if((o?.columns?.filter(n=>!n.isHidden)??[]).length===0)return{hidden:!0,checked:!1,disabled:!1,indeterminate:!1};let s=o.columns.filter(n=>!n.isHidden&&n.isToggleable!==!1);if(s.length===0)return{checked:!0,disabled:!0,indeterminate:!1};let c=s.filter(n=>n.isToggled).length,l=o.columns.filter(n=>!n.isHidden&&n.isToggleable===!1);return c===0&&l.length>0?{checked:!0,disabled:!1,indeterminate:!0}:c===0?{checked:!1,disabled:!1,indeterminate:!1}:c===s.length?{checked:!0,disabled:!1,indeterminate:!1}:{checked:!0,disabled:!1,indeterminate:!0}},getColumn(o,i=null){return i?this.deferredColumns.find(c=>c.type==="group"&&c.name===i)?.columns?.find(c=>c.name===o):this.deferredColumns.find(s=>s.name===o)},toggleGroup(o){let i=this.deferredColumns.find(r=>r.type==="group"&&r.name===o);if(!i?.columns)return;let s=this.calculateGroupedColumns(i);if(s.disabled)return;let l=i.columns.filter(r=>r.isToggleable!==!1).some(r=>r.isToggled),n=s.indeterminate?!0:!l;i.columns.filter(r=>r.isToggleable!==!1).forEach(r=>{r.isToggled=n}),this.deferredColumns=[...this.deferredColumns],this.isLive&&this.applyTableColumnManager()},toggleColumn(o,i=null){let s=this.getColumn(o,i);!s||s.isToggleable===!1||(s.isToggled=!s.isToggled,this.deferredColumns=[...this.deferredColumns],this.isLive&&this.applyTableColumnManager())},reorderColumns(o){let i=o.map(s=>s.split("::"));if(this.reorderTopLevel(i),this.hasReordered=!0,this.isLive)return this.applyTableColumnManager()},reorderGroupColumns(o,i){let s=this.deferredColumns.find(n=>n.type==="group"&&n.name===i);if(!s)return;let c=o.map(n=>n.split("::")),l=[];if(c.forEach(([n,r])=>{let a=s.columns.find(u=>u.name===r);a&&l.push(a)}),s.columns=l,this.deferredColumns=[...this.deferredColumns],this.hasReordered=!0,this.isLive)return this.applyTableColumnManager()},getVisibleColumns(o=null){return(o===null?this.deferredColumns:this.deferredColumns.find(s=>s.type==="group"&&s.name===o)?.columns??[]).filter(s=>!s.isHidden&&s.label)},getColumnLabel(o){let i=document.createElement("span");return i.innerHTML=o.label,i.textContent},getColumnPosition(o,i=null){return this.getVisibleColumns(i).findIndex(s=>s.type===o.type&&s.name===o.name)+1},canMoveColumn(o,i,s=null){let c=this.getColumnPosition(o,s);return c>0&&(i==="up"?c>1:c<this.getVisibleColumns(s).length)},async moveColumn(o,i,s,c,l){if(this.isLoading||!this.canMoveColumn(o,i,s))return;let n=this.getVisibleColumns(s),r=this.getColumnPosition(o,s)-1,a=r+(i==="up"?-1:1);[n[r],n[a]]=[n[a],n[r]];let u=document.activeElement===c,f=this.focusRevision,h=c.parentElement,d=n.map(p=>`${p.type}::${p.name}`);this.reorderAnnouncement="";let m=s===null?this.reorderColumns(d):this.reorderGroupColumns(d,s);this.$nextTick(()=>{!u||this.focusRevision!==f||!h.getClientRects().length||document.activeElement!==c&&document.activeElement!==document.body||(c.disabled?h.querySelector("button:not(:disabled)")?.focus():c.focus())}),!(this.isLive&&!await m)&&this.getColumnPosition(o,s)===a+1&&(this.reorderAnnouncement=l.replace(":column",this.getColumnLabel(o)).replace(":position",a+1).replace(":count",n.length).replace(":group",s===null?"":this.getColumnLabel({label:s})))},reorderTopLevel(o){let i=this.deferredColumns,s=[];o.forEach(([c,l])=>{let n=i.find(r=>c==="group"?r.type==="group"&&r.name===l:c==="column"?r.type!=="group"&&r.name===l:!1);n&&s.push(n)}),this.deferredColumns=s},async applyTableColumnManager(){let o=this.dropdownRevision;this.isLoading=!0;try{return this.columns=JSON.parse(JSON.stringify(this.deferredColumns)),await this.$wire.call("applyTableColumnManager",this.columns,this.hasReordered),this.hasReordered=!1,this.error=void 0,!this.isLive&&this.dropdownRevision===o&&this.closeDropdown(),!0}catch(i){return this.error="Failed to update column visibility",console.error("Table toggle columns error:",i),!1}finally{this.isLoading=!1}},closeDropdown(){let o=this.dropdownPanel;if(!this.$el.isConnected||this.$el.closest(".fi-dropdown-panel")!==o||o?.style.display!=="block")return;let i=window.Alpine.$data(o.closest(".fi-dropdown")),s=document.activeElement===document.body||o.contains(document.activeElement);i?.close(),s&&i?.getTrigger()?.focus()},resetDeferredColumns(){this.deferredColumns=JSON.parse(JSON.stringify(this.columns)),this.hasReordered=!1,this.reorderAnnouncement=""},destroy(){this.dropdownRevision++,this.dropdownPanel?.removeEventListener("dropdown-opened",this.dropdownOpenedListener)}}}document.addEventListener("alpine:init",()=>{window.Alpine.data("filamentTable",se),window.Alpine.data("filamentTableFilters",De),window.Alpine.data("filamentTableColumnManager",re)});})();
|