docker/entrypoint.sh runs `composer update "boboko/*" --with-all-dependencies` on boot; this is what it resolved, about 55 packages. boboko/core itself is unchanged. Mostly patch releases, notably: - laravel/framework v12.70.0 -> v12.70.2 - filament/* v4.15.2 -> v4.16.0 (published assets in public/ updated) - livewire/livewire v3.8.10 -> v3.8.11 - stripe/stripe-php v16.6.0 -> v16.6.1 - spatie/laravel-medialibrary 11.23.10 -> 11.23.11 - symfony/* 7.4.x/8.1.x patch releases Kept separate from the Caddy commit so it's easy to revert. Click through the admin panel and a Stripe test checkout before deploying. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
12 lines
90 KiB
JavaScript
12 lines
90 KiB
JavaScript
var $t=Math.min,vt=Math.max,Vt=Math.round;var ot=n=>({x:n,y:n}),rn={left:"right",right:"left",bottom:"top",top:"bottom"};function Le(n,t,e){return vt(n,$t(t,e))}function Wt(n,t){return typeof n=="function"?n(t):n}function yt(n){return n.split("-")[0]}function zt(n){return n.split("-")[1]}function Re(n){return n==="x"?"y":"x"}function Te(n){return n==="y"?"height":"width"}function ft(n){let t=n[0];return t==="t"||t==="b"?"y":"x"}function Ie(n){return Re(ft(n))}function ei(n,t,e){e===void 0&&(e=!1);let i=zt(n),s=Ie(n),o=Te(s),r=s==="x"?i===(e?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(r=Ht(r)),[r,Ht(r)]}function ii(n){let t=Ht(n);return[oe(n),t,oe(t)]}function oe(n){return n.includes("start")?n.replace("start","end"):n.replace("end","start")}var Ze=["left","right"],ti=["right","left"],an=["top","bottom"],ln=["bottom","top"];function cn(n,t,e){switch(n){case"top":case"bottom":return e?t?ti:Ze:t?Ze:ti;case"left":case"right":return t?an:ln;default:return[]}}function ni(n,t,e,i){let s=zt(n),o=cn(yt(n),e==="start",i);return s&&(o=o.map(r=>r+"-"+s),t&&(o=o.concat(o.map(oe)))),o}function Ht(n){let t=yt(n);return rn[t]+n.slice(t.length)}function un(n){return{top:0,right:0,bottom:0,left:0,...n}}function si(n){return typeof n!="number"?un(n):{top:n,right:n,bottom:n,left:n}}function Ot(n){let{x:t,y:e,width:i,height:s}=n;return{width:i,height:s,top:e,left:t,right:t+i,bottom:e+s,x:t,y:e}}function oi(n,t,e){let{reference:i,floating:s}=n,o=ft(t),r=Ie(t),a=Te(r),l=yt(t),c=o==="y",h=i.x+i.width/2-s.width/2,u=i.y+i.height/2-s.height/2,f=i[a]/2-s[a]/2,p;switch(l){case"top":p={x:h,y:i.y-s.height};break;case"bottom":p={x:h,y:i.y+i.height};break;case"right":p={x:i.x+i.width,y:u};break;case"left":p={x:i.x-s.width,y:u};break;default:p={x:i.x,y:i.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(n,t){var e;t===void 0&&(t={});let{x:i,y:s,platform:o,rects:r,elements:a,strategy:l}=n,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:u="floating",altBoundary:f=!1,padding:p=0}=Wt(t,n),m=si(p),w=a[f?u==="floating"?"reference":"floating":u],E=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:i,y:s,width:r.floating.width,height:r.floating.height}:r.reference,x=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),A=await(o.isElement==null?void 0:o.isElement(x))?await(o.getScale==null?void 0:o.getScale(x))||{x:1,y:1}:{x:1,y:1},_=Ot(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:S,offsetParent:x,strategy:l}):S);return{top:(E.top-_.top+m.top)/A.y,bottom:(_.bottom-E.bottom+m.bottom)/A.y,left:(E.left-_.left+m.left)/A.x,right:(_.right-E.right+m.right)/A.x}}var hn=50,ai=async(n,t,e)=>{let{placement:i="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:n,floating:t,strategy:s}),{x:h,y:u}=oi(c,i,l),f=i,p=0,m={};for(let g=0;g<o.length;g++){let w=o[g];if(!w)continue;let{name:E,fn:S}=w,{x,y:A,data:_,reset:C}=await S({x:h,y:u,initialPlacement:i,placement:f,strategy:s,middlewareData:m,rects:c,platform:a,elements:{reference:n,floating:t}});h=x??h,u=A??u,m[E]={...m[E],..._},C&&p<hn&&(p++,typeof C=="object"&&(C.placement&&(f=C.placement),C.rects&&(c=C.rects===!0?await r.getElementRects({reference:n,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(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(t){var e,i;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(n,t);if((e=o.arrow)!=null&&e.alignmentOffset)return{};let E=yt(s),S=ft(a),x=yt(a)===a,A=await(l.isRTL==null?void 0:l.isRTL(c.floating)),_=f||(x||!g?[Ht(a)]:ii(a)),C=m!=="none";!f&&C&&_.push(...ni(a,g,m,A));let V=[a,..._],J=await l.detectOverflow(t,w),I=[],W=((i=o.flip)==null?void 0:i.overflows)||[];if(h&&I.push(J[E]),u){let P=ei(s,r,A);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,q=V[P];if(q&&(!(u==="alignment"?S!==ft(q):!1)||W.every(N=>ft(N.placement)===S?N.overflows[0]>0:!0)))return{data:{index:P,overflows:W},reset:{placement:q}};let R=(tt=W.filter(B=>B.overflows[0]<=0).sort((B,N)=>B.overflows[1]-N.overflows[1])[0])==null?void 0:tt.placement;if(!R)switch(p){case"bestFit":{var z;let B=(z=W.filter(N=>{if(C){let et=ft(N.placement);return et===S||et==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(et=>et>0).reduce((et,se)=>et+se,0)]).sort((N,et)=>N[1]-et[1])[0])==null?void 0:z[0];B&&(R=B);break}case"initialPlacement":R=a;break}if(s!==R)return{reset:{placement:R}}}return{}}}};var dn=new Set(["left","top"]);async function fn(n,t){let{placement:e,platform:i,elements:s}=n,o=await(i.isRTL==null?void 0:i.isRTL(s.floating)),r=yt(e),a=zt(e),l=ft(e)==="y",c=dn.has(r)?-1:1,h=o&&l?-1:1,u=Wt(t,n),{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(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(t){var e,i;let{x:s,y:o,placement:r,middlewareData:a}=t,l=await fn(t,n);return r===((e=a.offset)==null?void 0:e.placement)&&(i=a.arrow)!=null&&i.alignmentOffset?{}:{x:s+l.x,y:o+l.y,data:{...l,placement:r}}}}},ui=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(t){let{x:e,y:i,placement:s,platform:o}=t,{mainAxis:r=!0,crossAxis:a=!1,limiter:l={fn:E=>{let{x:S,y:x}=E;return{x:S,y:x}}},...c}=Wt(n,t),h={x:e,y:i},u=await o.detectOverflow(t,c),f=ft(yt(s)),p=Re(f),m=h[p],g=h[f];if(r){let E=p==="y"?"top":"left",S=p==="y"?"bottom":"right",x=m+u[E],A=m-u[S];m=Le(x,m,A)}if(a){let E=f==="y"?"top":"left",S=f==="y"?"bottom":"right",x=g+u[E],A=g-u[S];g=Le(x,g,A)}let w=l.fn({...t,[p]:m,[f]:g});return{...w,data:{x:w.x-e,y:w.y-i,enabled:{[p]:r,[f]:a}}}}}};function ae(){return typeof window<"u"}function xt(n){return di(n)?(n.nodeName||"").toLowerCase():"#document"}function K(n){var t;return(n==null||(t=n.ownerDocument)==null?void 0:t.defaultView)||window}function lt(n){var t;return(t=(di(n)?n.ownerDocument:n.document)||window.document)==null?void 0:t.documentElement}function di(n){return ae()?n instanceof Node||n instanceof K(n).Node:!1}function it(n){return ae()?n instanceof Element||n instanceof K(n).Element:!1}function ct(n){return ae()?n instanceof HTMLElement||n instanceof K(n).HTMLElement:!1}function hi(n){return!ae()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof K(n).ShadowRoot}function Tt(n){let{overflow:t,overflowX:e,overflowY:i,display:s}=nt(n);return/auto|scroll|overlay|hidden|clip/.test(t+i+e)&&s!=="inline"&&s!=="contents"}function fi(n){return/^(table|td|th)$/.test(xt(n))}function Xt(n){try{if(n.matches(":popover-open"))return!0}catch{}try{return n.matches(":modal")}catch{return!1}}var pn=/transform|translate|scale|rotate|perspective|filter/,mn=/paint|layout|strict|content/,Dt=n=>!!n&&n!=="none",Me;function le(n){let t=it(n)?nt(n):n;return Dt(t.transform)||Dt(t.translate)||Dt(t.scale)||Dt(t.rotate)||Dt(t.perspective)||!ce()&&(Dt(t.backdropFilter)||Dt(t.filter))||pn.test(t.willChange||"")||mn.test(t.contain||"")}function pi(n){let t=pt(n);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(n){return/^(html|body|#document)$/.test(xt(n))}function nt(n){return K(n).getComputedStyle(n)}function Yt(n){return it(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function pt(n){if(xt(n)==="html")return n;let t=n.assignedSlot||n.parentNode||hi(n)&&n.host||lt(n);return hi(t)?t.host:t}function mi(n){let t=pt(n);return At(t)?n.ownerDocument?n.ownerDocument.body:n.body:ct(t)&&Tt(t)?t:mi(t)}function re(n,t,e){var i;t===void 0&&(t=[]),e===void 0&&(e=!0);let s=mi(n),o=s===((i=n.ownerDocument)==null?void 0:i.body),r=K(s);if(o){let a=ue(r);return t.concat(r,r.visualViewport||[],Tt(s)?s:[],a&&e?re(a):[])}else return t.concat(s,re(s,[],e))}function ue(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function yi(n){let t=nt(n),e=parseFloat(t.width)||0,i=parseFloat(t.height)||0,s=ct(n),o=s?n.offsetWidth:e,r=s?n.offsetHeight:i,a=Vt(e)!==o||Vt(i)!==r;return a&&(e=o,i=r),{width:e,height:i,$:a}}function wi(n){return it(n)?n:n.contextElement}function It(n){let t=wi(n);if(!ct(t))return ot(1);let e=t.getBoundingClientRect(),{width:i,height:s,$:o}=yi(t),r=(o?Vt(e.width):e.width)/i,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 gn=ot(0);function Si(n){let t=K(n);return!ce()||!t.visualViewport?gn:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function bn(n,t,e){return t===void 0&&(t=!1),!e||t&&e!==K(n)?!1:t}function qt(n,t,e,i){t===void 0&&(t=!1),e===void 0&&(e=!1);let s=n.getBoundingClientRect(),o=wi(n),r=ot(1);t&&(i?it(i)&&(r=It(i)):r=It(n));let a=bn(o,e,i)?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=i&&it(i)?K(i):i,m=f,g=ue(m);for(;g&&i&&p!==m;){let w=It(g),E=g.getBoundingClientRect(),S=nt(g),x=E.left+(g.clientLeft+parseFloat(S.paddingLeft))*w.x,A=E.top+(g.clientTop+parseFloat(S.paddingTop))*w.y;l*=w.x,c*=w.y,h*=w.x,u*=w.y,l+=x,c+=A,m=K(g),g=ue(m)}}return Ot({width:h,height:u,x:l,y:c})}function he(n,t){let e=Yt(n).scrollLeft;return t?t.left+e:qt(lt(n)).left+e}function Ei(n,t){let e=n.getBoundingClientRect(),i=e.left+t.scrollLeft-he(n,e),s=e.top+t.scrollTop;return{x:i,y:s}}function vn(n){let{elements:t,rect:e,offsetParent:i,strategy:s}=n,o=s==="fixed",r=lt(i),a=t?Xt(t.floating):!1;if(i===r||a&&o)return e;let l={scrollLeft:0,scrollTop:0},c=ot(1),h=ot(0),u=ct(i);if((u||!u&&!o)&&((xt(i)!=="body"||Tt(r))&&(l=Yt(i)),u)){let p=qt(i);c=It(i),h.x=p.x+i.clientLeft,h.y=p.y+i.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 yn(n){return Array.from(n.getClientRects())}function wn(n){let t=lt(n),e=Yt(n),i=n.ownerDocument.body,s=vt(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),o=vt(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight),r=-e.scrollLeft+he(n),a=-e.scrollTop;return nt(i).direction==="rtl"&&(r+=vt(t.clientWidth,i.clientWidth)-s),{width:s,height:o,x:r,y:a}}var gi=25;function Sn(n,t){let e=K(n),i=lt(n),s=e.visualViewport,o=i.clientWidth,r=i.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=he(i);if(c<=0){let h=i.ownerDocument,u=h.body,f=getComputedStyle(u),p=h.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,m=Math.abs(i.clientWidth-u.clientWidth-p);m<=gi&&(o-=m)}else c<=gi&&(o+=c);return{width:o,height:r,x:a,y:l}}function En(n,t){let e=qt(n,!0,t==="fixed"),i=e.top+n.clientTop,s=e.left+n.clientLeft,o=ct(n)?It(n):ot(1),r=n.clientWidth*o.x,a=n.clientHeight*o.y,l=s*o.x,c=i*o.y;return{width:r,height:a,x:l,y:c}}function bi(n,t,e){let i;if(t==="viewport")i=Sn(n,e);else if(t==="document")i=wn(lt(n));else if(it(t))i=En(t,e);else{let s=Si(n);i={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Ot(i)}function Oi(n,t){let e=pt(n);return e===t||!it(e)||At(e)?!1:nt(e).position==="fixed"||Oi(e,t)}function On(n,t){let e=t.get(n);if(e)return e;let i=re(n,[],!1).filter(a=>it(a)&&xt(a)!=="body"),s=null,o=nt(n).position==="fixed",r=o?pt(n):n;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(n,r))?i=i.filter(h=>h!==r):s=a,r=pt(r)}return t.set(n,i),i}function Dn(n){let{element:t,boundary:e,rootBoundary:i,strategy:s}=n,r=[...e==="clippingAncestors"?Xt(t)?[]:On(t,this._c):[].concat(e),i],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 xn(n){let{width:t,height:e}=yi(n);return{width:t,height:e}}function An(n,t,e){let i=ct(t),s=lt(t),o=e==="fixed",r=qt(n,!0,o,t),a={scrollLeft:0,scrollTop:0},l=ot(0);function c(){l.x=he(s)}if(i||!i&&!o)if((xt(t)!=="body"||Tt(s))&&(a=Yt(t)),i){let p=qt(t,!0,o,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else s&&c();o&&!i&&s&&c();let h=s&&!i&&!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(n){return nt(n).position==="static"}function vi(n,t){if(!ct(n)||nt(n).position==="fixed")return null;if(t)return t(n);let e=n.offsetParent;return lt(n)===e&&(e=e.ownerDocument.body),e}function Di(n,t){let e=K(n);if(Xt(n))return e;if(!ct(n)){let s=pt(n);for(;s&&!At(s);){if(it(s)&&!_e(s))return s;s=pt(s)}return e}let i=vi(n,t);for(;i&&fi(i)&&_e(i);)i=vi(i,t);return i&&At(i)&&_e(i)&&!le(i)?e:i||pi(n)||e}var Cn=async function(n){let t=this.getOffsetParent||Di,e=this.getDimensions,i=await e(n.floating);return{reference:An(n.reference,await t(n.floating),n.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function Ln(n){return nt(n).direction==="rtl"}var Rn={convertOffsetParentRelativeRectToViewportRelativeRect:vn,getDocumentElement:lt,getClippingRect:Dn,getOffsetParent:Di,getElementRects:Cn,getClientRects:yn,getDimensions:xn,getScale:It,isElement:it,isRTL:Ln};var xi=ci;var Ai=ui,Ci=li;var Li=(n,t,e)=>{let i=new Map,s={platform:Rn,...e},o={...s.platform,_c:i};return ai(n,t,{...s,platform:o})};function Tn(n,t,e){return(t=Pn(t))in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e,n}function gt(){return gt=Object.assign?Object.assign.bind():function(n){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var i in e)({}).hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},gt.apply(null,arguments)}function Ri(n,t){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);t&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),e.push.apply(e,i)}return e}function ht(n){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?Ri(Object(e),!0).forEach(function(i){Tn(n,i,e[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):Ri(Object(e)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(e,i))})}return n}function In(n,t){if(n==null)return{};var e,i,s=Mn(n,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(i=0;i<o.length;i++)e=o[i],t.indexOf(e)===-1&&{}.propertyIsEnumerable.call(n,e)&&(s[e]=n[e])}return s}function Mn(n,t){if(n==null)return{};var e={};for(var i in n)if({}.hasOwnProperty.call(n,i)){if(t.indexOf(i)!==-1)continue;e[i]=n[i]}return e}function _n(n,t){if(typeof n!="object"||!n)return n;var e=n[Symbol.toPrimitive];if(e!==void 0){var i=e.call(n,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(n)}function Pn(n){var t=_n(n,"string");return typeof t=="symbol"?t:t+""}function ze(n){"@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(n)}var Nn="1.15.7";function mt(n){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(n)}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 D(n,t,e){n.addEventListener(t,e,!bt&&Hi)}function O(n,t,e){n.removeEventListener(t,e,!bt&&Hi)}function we(n,t){if(t){if(t[0]===">"&&(t=t.substring(1)),n)try{if(n.matches)return n.matches(t);if(n.msMatchesSelector)return n.msMatchesSelector(t);if(n.webkitMatchesSelector)return n.webkitMatchesSelector(t)}catch{return!1}return!1}}function $i(n){return n.host&&n!==document&&n.host.nodeType&&n.host!==n?n.host:n.parentNode}function at(n,t,e,i){if(n){e=e||document;do{if(t!=null&&(t[0]===">"?n.parentNode===e&&we(n,t):we(n,t))||i&&n===e)return n;if(n===e)break}while(n=$i(n))}return null}var Ii=/\s+/g;function Q(n,t,e){if(n&&t)if(n.classList)n.classList[e?"add":"remove"](t);else{var i=(" "+n.className+" ").replace(Ii," ").replace(" "+t+" "," ");n.className=(i+(e?" "+t:"")).replace(Ii," ")}}function b(n,t,e){var i=n&&n.style;if(i){if(e===void 0)return document.defaultView&&document.defaultView.getComputedStyle?e=document.defaultView.getComputedStyle(n,""):n.currentStyle&&(e=n.currentStyle),t===void 0?e:e[t];!(t in i)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),i[t]=e+(typeof e=="string"?"":"px")}}function Bt(n,t){var e="";if(typeof n=="string")e=n;else do{var i=b(n,"transform");i&&i!=="none"&&(e=i+" "+e)}while(!t&&(n=n.parentNode));var s=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return s&&new s(e)}function Vi(n,t,e){if(n){var i=n.getElementsByTagName(t),s=0,o=i.length;if(e)for(;s<o;s++)e(i[s],s);return i}return[]}function ut(){var n=document.scrollingElement;return n||document.documentElement}function F(n,t,e,i,s){if(!(!n.getBoundingClientRect&&n!==window)){var o,r,a,l,c,h,u;if(n!==window&&n.parentNode&&n!==ut()?(o=n.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)&&n!==window&&(s=s||n.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(i&&n!==window){var p=Bt(s||n),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(n,t,e){for(var i=Et(n,!0),s=F(n)[t];i;){var o=F(i)[e],r=void 0;if(e==="top"||e==="left"?r=s>=o:r=s<=o,!r)return i;if(i===ut())break;i=Et(i,!1)}return!1}function kt(n,t,e,i){for(var s=0,o=0,r=n.children;o<r.length;){if(r[o].style.display!=="none"&&r[o]!==v.ghost&&(i||r[o]!==v.dragged)&&at(r[o],e.draggable,n,!1)){if(s===t)return r[o];s++}o++}return null}function Ue(n,t){for(var e=n.lastElementChild;e&&(e===v.ghost||b(e,"display")==="none"||t&&!we(e,t));)e=e.previousElementSibling;return e||null}function st(n,t){var e=0;if(!n||!n.parentNode)return-1;for(;n=n.previousElementSibling;)n.nodeName.toUpperCase()!=="TEMPLATE"&&n!==v.clone&&(!t||we(n,t))&&e++;return e}function _i(n){var t=0,e=0,i=ut();if(n)do{var s=Bt(n),o=s.a,r=s.d;t+=n.scrollLeft*o,e+=n.scrollTop*r}while(n!==i&&(n=n.parentNode));return[t,e]}function Bn(n,t){for(var e in n)if(n.hasOwnProperty(e)){for(var i in t)if(t.hasOwnProperty(i)&&t[i]===n[e][i])return Number(e)}return-1}function Et(n,t){if(!n||!n.getBoundingClientRect)return ut();var e=n,i=!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 ut();if(i||t)return e;i=!0}}while(e=e.parentNode);return ut()}function kn(n,t){if(n&&t)for(var e in t)t.hasOwnProperty(e)&&(n[e]=t[e]);return n}function Pe(n,t){return Math.round(n.top)===Math.round(t.top)&&Math.round(n.left)===Math.round(t.left)&&Math.round(n.height)===Math.round(t.height)&&Math.round(n.width)===Math.round(t.width)}var Jt;function Wi(n,t){return function(){if(!Jt){var e=arguments,i=this;e.length===1?n.call(i,e[0]):n.apply(i,e),Jt=setTimeout(function(){Jt=void 0},t)}}}function Fn(){clearTimeout(Jt),Jt=void 0}function zi(n,t,e){n.scrollLeft+=t,n.scrollTop+=e}function Xi(n){var t=window.Polymer,e=window.jQuery||window.Zepto;return t&&t.dom?t.dom(n).cloneNode(!0):e?e(n).clone(!0)[0]:n.cloneNode(!0)}function Yi(n,t,e){var i={};return Array.from(n.children).forEach(function(s){var o,r,a,l;if(!(!at(s,t.draggable,n,!1)||s.animated||s===e)){var c=F(s);i.left=Math.min((o=i.left)!==null&&o!==void 0?o:1/0,c.left),i.top=Math.min((r=i.top)!==null&&r!==void 0?r:1/0,c.top),i.right=Math.max((a=i.right)!==null&&a!==void 0?a:-1/0,c.right),i.bottom=Math.max((l=i.bottom)!==null&&l!==void 0?l:-1/0,c.bottom)}}),i.width=i.right-i.left,i.height=i.bottom-i.top,i.x=i.left,i.y=i.top,i}var G="Sortable"+new Date().getTime();function Hn(){var n=[],t;return{captureAnimationState:function(){if(n=[],!!this.options.animation){var i=[].slice.call(this.el.children);i.forEach(function(s){if(!(b(s,"display")==="none"||s===v.ghost)){n.push({target:s,rect:F(s)});var o=ht({},n[n.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(i){n.push(i)},removeAnimationState:function(i){n.splice(Bn(n,{target:i}),1)},animateAll:function(i){var s=this;if(!this.options.animation){clearTimeout(t),typeof i=="function"&&i();return}var o=!1,r=0;n.forEach(function(a){var l=0,c=a.target,h=c.fromRect,u=F(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=Vn(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 i=="function"&&i()},r):typeof i=="function"&&i(),n=[]},animate:function(i,s,o,r){if(r){b(i,"transition",""),b(i,"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);i.animatingX=!!h,i.animatingY=!!u,b(i,"transform","translate3d("+h+"px,"+u+"px,0)"),this.forRepaintDummy=$n(i),b(i,"transition","transform "+r+"ms"+(this.options.easing?" "+this.options.easing:"")),b(i,"transform","translate3d(0,0,0)"),typeof i.animated=="number"&&clearTimeout(i.animated),i.animated=setTimeout(function(){b(i,"transition",""),b(i,"transform",""),i.animated=!1,i.animatingX=!1,i.animatingY=!1},r)}}}}function $n(n){return n.offsetWidth}function Vn(n,t,e,i){return Math.sqrt(Math.pow(t.top-n.top,2)+Math.pow(t.left-n.left,2))/Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))*i.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(i){if(i.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),Mt.push(t)},pluginEvent:function(t,e,i){var s=this;this.eventCanceled=!1,i.cancel=function(){s.eventCanceled=!0};var o=t+"Global";Mt.forEach(function(r){e[r.pluginName]&&(e[r.pluginName][o]&&e[r.pluginName][o](ht({sortable:e},i)),e.options[r.pluginName]&&e[r.pluginName][t]&&e[r.pluginName][t](ht({sortable:e},i)))})},initializePlugins:function(t,e,i,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(i,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 i={};return Mt.forEach(function(s){typeof s.eventProperties=="function"&>(i,s.eventProperties.call(e[s.pluginName],t))}),i},modifyOption:function(t,e,i){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],i))}),s}};function Wn(n){var t=n.sortable,e=n.rootEl,i=n.name,s=n.targetEl,o=n.cloneEl,r=n.toEl,a=n.fromEl,l=n.oldIndex,c=n.newIndex,h=n.oldDraggableIndex,u=n.newDraggableIndex,f=n.originalEvent,p=n.putSortable,m=n.extraEventProperties;if(t=t||e&&e[G],!!t){var g,w=t.options,E="on"+i.charAt(0).toUpperCase()+i.substr(1);window.CustomEvent&&!bt&&!ee?g=new CustomEvent(i,{bubbles:!0,cancelable:!0}):(g=document.createEvent("Event"),g.initEvent(i,!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=ht(ht({},m),ie.getEventProperties(i,t));for(var x in S)g[x]=S[x];e&&e.dispatchEvent(g),w[E]&&w[E].call(t,g)}}var zn=["evt"],U=function(t,e){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=i.evt,o=In(i,zn);ie.pluginEvent.bind(v)(t,e,ht({dragEl:d,parentEl:M,ghostEl:y,rootEl:L,nextEl:Rt,lastDownEl:ge,cloneEl:T,cloneHidden:St,dragStarted:jt,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(n){Wn(ht({putSortable:$,cloneEl:T,targetEl:d,rootEl:L,oldIndex:Nt,oldDraggableIndex:Qt,newIndex:Z,newDraggableIndex:wt},n))}var d,M,y,L,Rt,ge,T,St,Nt,Z,Qt,wt,de,$,Pt=!1,Se=!1,Ee=[],Ct,rt,Be,ke,Pi,Ni,jt,_t,Zt,te=!1,fe=!1,be,X,Fe=[],Xe=!1,Oe=[],xe=typeof document<"u",pe=Ke,Bi=ee||bt?"cssFloat":"float",Xn=xe&&!Fi&&!Ke&&"draggable"in document.createElement("div"),qi=(function(){if(xe){if(bt)return!1;var n=document.createElement("x");return n.style.cssText="pointer-events:auto",n.style.pointerEvents==="auto"}})(),ji=function(t,e){var i=b(t),s=parseInt(i.width)-parseInt(i.paddingLeft)-parseInt(i.paddingRight)-parseInt(i.borderLeftWidth)-parseInt(i.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)+F(o).width,h=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+F(r).width;if(i.display==="flex")return i.flexDirection==="column"||i.flexDirection==="column-reverse"?"vertical":"horizontal";if(i.display==="grid")return i.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&&i[Bi]==="none"||r&&i[Bi]==="none"&&c+h>s)?"vertical":"horizontal"},Yn=function(t,e,i){var s=i?t.left:t.top,o=i?t.right:t.bottom,r=i?t.width:t.height,a=i?e.left:e.top,l=i?e.right:e.bottom,c=i?e.width:e.height;return s===a||o===l||s+r/2===a+c/2},qn=function(t,e){var i;return Ee.some(function(s){var o=s[G].options.emptyInsertThreshold;if(!(!o||Ue(s))){var r=F(s),a=t>=r.left-o&&t<=r.right+o,l=e>=r.top-o&&e<=r.bottom+o;if(a&&l)return i=s}}),i},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 i={},s=t.group;(!s||ze(s)!="object")&&(s={name:s}),i.name=s.name,i.checkPull=e(s.pull,!0),i.checkPut=e(s.put),i.revertClone=s.revertClone,t.group=i},Ui=function(){!qi&&y&&b(y,"display","none")},Gi=function(){!qi&&y&&b(y,"display","")};xe&&!Fi&&document.addEventListener("click",function(n){if(Se)return n.preventDefault(),n.stopPropagation&&n.stopPropagation(),n.stopImmediatePropagation&&n.stopImmediatePropagation(),Se=!1,!1},!0);var Lt=function(t){if(d){t=t.touches?t.touches[0]:t;var e=qn(t.clientX,t.clientY);if(e){var i={};for(var s in t)t.hasOwnProperty(s)&&(i[s]=t[s]);i.target=i.rootEl=e,i.preventDefault=void 0,i.stopPropagation=void 0,e[G]._onDragOver(i)}}},jn=function(t){d&&d.parentNode[G]._isOutsideThisEl(t.target)};function v(n,t){if(!(n&&n.nodeType&&n.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(n));this.el=n,this.options=t=gt({},t),n[G]=this;var e={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(n.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return ji(n,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,n,e);for(var i in e)!(i in t)&&(t[i]=e[i]);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:Xn,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?D(n,"pointerdown",this._onTapStart):(D(n,"mousedown",this._onTapStart),D(n,"touchstart",this._onTapStart)),this.nativeDraggable&&(D(n,"dragover",this),D(n,"dragenter",this)),Ee.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),gt(this,Hn())}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,i=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(es(i),!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,i,!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:i,fromEl:i}),U("filter",e,{evt:t}),o&&t.preventDefault();return}}else if(h&&(h=h.split(",").some(function(u){if(u=at(c,u.trim(),i,!1),u)return j({sortable:e,rootEl:u,name:"filter",targetEl:l,fromEl:i,toEl:i}),U("filter",e,{evt:t}),!0}),h)){o&&t.preventDefault();return}s.handle&&!at(c,s.handle,i,!1)||this._prepareDragStart(t,a,l)}}},_prepareDragStart:function(t,e,i){var s=this,o=s.el,r=s.options,a=o.ownerDocument,l;if(i&&!d&&i.parentNode===o){var c=F(i);if(L=o,d=i,M=d.parentNode,Rt=d.nextSibling,ge=i,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)}),D(a,"dragover",Lt),D(a,"mousemove",Lt),D(a,"touchmove",Lt),r.supportPointer?(D(a,"pointerup",s._onDrop),!this.nativeDraggable&&D(a,"pointercancel",s._onDrop)):(D(a,"mouseup",s._onDrop),D(a,"touchend",s._onDrop),D(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?(D(a,"pointerup",s._disableDelayedDrag),D(a,"pointercancel",s._disableDelayedDrag)):(D(a,"mouseup",s._disableDelayedDrag),D(a,"touchend",s._disableDelayedDrag),D(a,"touchcancel",s._disableDelayedDrag)),D(a,"mousemove",s._delayedDragTouchMoveHandler),D(a,"touchmove",s._delayedDragTouchMoveHandler),r.supportPointer&&D(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;O(t,"mouseup",this._disableDelayedDrag),O(t,"touchend",this._disableDelayedDrag),O(t,"touchcancel",this._disableDelayedDrag),O(t,"pointerup",this._disableDelayedDrag),O(t,"pointercancel",this._disableDelayedDrag),O(t,"mousemove",this._delayedDragTouchMoveHandler),O(t,"touchmove",this._delayedDragTouchMoveHandler),O(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||t.pointerType=="touch"&&t,!this.nativeDraggable||e?this.options.supportPointer?D(document,"pointermove",this._onTouchMove):e?D(document,"touchmove",this._onTouchMove):D(document,"mousemove",this._onTouchMove):(D(d,"dragend",this),D(L,"dragstart",this._onDragStart));try{document.selection?ve(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,e){if(Pt=!1,L&&d){U("dragStarted",this,{evt:e}),this.nativeDraggable&&D(document,"dragover",jn);var i=this.options;!t&&Q(d,i.dragClass,!1),Q(d,i.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 i=void 0;if(i=e[G]._onDragOver({clientX:rt.clientX,clientY:rt.clientY,target:t,rootEl:e}),i&&!this.options.dragoverBubble)break}t=e}while(e=$i(e));Gi()}},_onTouchMove:function(t){if(Ct){var e=this.options,i=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(i&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))<i)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:L,e=F(d,!0,pe,!0,t),i=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=ut()),e.top+=X.scrollTop,e.left+=X.scrollLeft):X=ut(),Fe=_i(X)}y=d.cloneNode(!0),Q(y,i.ghostClass,!1),Q(y,i.fallbackClass,!0),Q(y,i.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 i=this,s=t.dataTransfer,o=i.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),i.cloneId=ve(function(){U("clone",i),!v.eventCanceled&&(i.options.removeCloneOnHide||L.insertBefore(T,d),i._hideClone(),j({sortable:i,name:"clone"}))}),!e&&Q(d,o.dragClass,!0),e?(Se=!0,i._loopId=setInterval(i._emulateDragOver,50)):(O(document,"mouseup",i._onDrop),O(document,"touchend",i._onDrop),O(document,"touchcancel",i._onDrop),s&&(s.effectAllowed="move",o.setData&&o.setData.call(i,s,d)),D(document,"drop",i),b(d,"transform","translateZ(0)")),Pt=!0,i._dragStartId=ve(i._dragStarted.bind(i,e,t)),D(document,"selectstart",i),jt=!0,window.getSelection().removeAllRanges(),Gt&&b(document.body,"user-select","none")},_onDragOver:function(t){var e=this.el,i=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(N,et){U(N,m,ht({evt:t,isOwner:h,axis:p?"vertical":"horizontal",revert:r,dragRect:s,targetRect:o,canSort:u,fromSortable:f,target:i,completed:S,onMove:function(Ft,Ce){return me(L,e,d,s,Ft,F(Ft),t,Ce)},changed:x},et))}function E(){w("dragOverAnimationCapture"),m.captureAnimationState(),m!==f&&f.captureAnimationState()}function S(N){return w("dragOverCompleted",{insertion:N}),N&&(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=i),m.animateAll(function(){w("dragOverAnimationComplete"),m._ignoreWhileAnimating=null}),m!==f&&(f.animateAll(),f._ignoreWhileAnimating=null)),(i===d&&!d.animated||i===e&&!i.animated)&&(_t=null),!a.dragoverBubble&&!t.rootEl&&i!==document&&(d.parentNode[G]._isOutsideThisEl(t.target),!N&&Lt(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),g=!0}function x(){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(),i=at(i,a.draggable,e,!0),w("dragOver"),v.eventCanceled)return g;if(d.contains(t.target)||i.animated&&i.animatingX&&i.animatingY||m._ignoreWhileAnimating===i)return S(!1);if(Se=!1,c&&!a.disabled&&(h?u||(r=M!==L):$===this||(this.lastPutMode=de.checkPull(this,c,d,t))&&l.checkPut(this,c,d,t))){if(p=this._getDirection(t,i)==="vertical",s=F(d),w("dragOverValid"),v.eventCanceled)return g;if(r)return M=L,E(),this._hideClone(),w("revert"),v.eventCanceled||(Rt?L.insertBefore(d,Rt):L.appendChild(d)),S(!0);var A=Ue(e,a.draggable);if(!A||Jn(t,p,this)&&!A.animated){if(A===d)return S(!1);if(A&&e===t.target&&(i=A),i&&(o=F(i)),me(L,e,d,s,i,o,t,!!i)!==!1)return E(),A&&A.nextSibling?e.insertBefore(d,A.nextSibling):e.appendChild(d),M=e,x(),S(!0)}else if(A&&Gn(t,p,this)){var _=kt(e,0,a,!0);if(_===d)return S(!1);if(i=_,o=F(i),me(L,e,d,s,i,o,t,!1)!==!1)return E(),e.insertBefore(d,_),M=e,x(),S(!0)}else if(i.parentNode===e){o=F(i);var C=0,V,J=d.parentNode!==e,I=!Yn(d.animated&&d.toRect||s,i.animated&&i.toRect||o,p),W=p?"top":"left",Y=Mi(i,"top","top")||Mi(d,"top","top"),tt=Y?Y.scrollTop:void 0;_t!==i&&(V=o[W],te=!1,fe=!I&&a.invertSwap||J),C=Qn(t,i,o,p,I?1:a.swapThreshold,a.invertedSwapThreshold==null?a.swapThreshold:a.invertedSwapThreshold,fe,_t===i);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===i)return S(!1);_t=i,Zt=C;var q=i.nextElementSibling,R=!1;R=C===1;var B=me(L,e,d,s,i,o,t,R);if(B!==!1)return(B===1||B===-1)&&(R=B===1),Xe=!0,setTimeout(Un,30),E(),R&&!q?e.appendChild(d):i.parentNode.insertBefore(d,R?q:i),Y&&zi(Y,0,tt-Y.scrollTop),M=d.parentNode,V!==void 0&&!fe&&(be=Math.abs(V-F(i)[W])),x(),S(!0)}if(e.contains(d))return S(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){O(document,"mousemove",this._onTouchMove),O(document,"touchmove",this._onTouchMove),O(document,"pointermove",this._onTouchMove),O(document,"dragover",Lt),O(document,"mousemove",Lt),O(document,"touchmove",Lt)},_offUpEvents:function(){var t=this.el.ownerDocument;O(t,"mouseup",this._onDrop),O(t,"touchend",this._onDrop),O(t,"pointerup",this._onDrop),O(t,"pointercancel",this._onDrop),O(t,"touchcancel",this._onDrop),O(document,"selectstart",this)},_onDrop:function(t){var e=this.el,i=this.options;if(Z=st(d),wt=st(d,i.draggable),U("drop",this,{evt:t}),M=d&&d.parentNode,Z=st(d),wt=st(d,i.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&&(O(document,"drop",this),O(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Gt&&b(document.body,"user-select",""),b(d,"transform",""),t&&(jt&&(t.cancelable&&t.preventDefault(),!i.dropBubble&&t.stopPropagation()),y&&y.parentNode&&y.parentNode.removeChild(y),(L===M||$&&$.lastPutMode!=="clone")&&T&&T.parentNode&&T.parentNode.removeChild(T),d&&(this.nativeDraggable&&O(d,"dragend",this),He(d),d.style["will-change"]="",jt&&!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}),L!==M?(Z>=0&&(j({rootEl:M,name:"add",toEl:M,fromEl:L,originalEvent:t}),j({sortable:this,name:"remove",toEl:M,originalEvent:t}),j({rootEl:M,name:"sort",toEl:M,fromEl:L,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),L=d=M=y=Rt=T=ge=St=Ct=rt=jt=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),Kn(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],e,i=this.el.children,s=0,o=i.length,r=this.options;s<o;s++)e=i[s],at(e,r.draggable,this.el,!1)&&t.push(e.getAttribute(r.dataIdAttr)||ts(e));return t},sort:function(t,e){var i={},s=this.el;this.toArray().forEach(function(o,r){var a=s.children[r];at(a,this.options.draggable,s,!1)&&(i[o]=a)},this),e&&this.captureAnimationState(),t.forEach(function(o){i[o]&&(s.removeChild(i[o]),s.appendChild(i[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 i=this.options;if(e===void 0)return i[t];var s=ie.modifyOption(this,t,e);typeof s<"u"?i[t]=s:i[t]=e,t==="group"&&Ki(i)},destroy:function(){U("destroy",this);var t=this.el;t[G]=null,O(t,"mousedown",this._onTapStart),O(t,"touchstart",this._onTapStart),O(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(O(t,"dragover",this),O(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==L&&!this.options.group.revertClone?L.insertBefore(T,d):Rt?L.insertBefore(T,Rt):L.appendChild(T),this.options.group.revertClone&&this.animate(d,T),b(T,"display",""),St=!1}}};function Kn(n){n.dataTransfer&&(n.dataTransfer.dropEffect="move"),n.cancelable&&n.preventDefault()}function me(n,t,e,i,s,o,r,a){var l,c=n[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=n,l.dragged=e,l.draggedRect=i,l.related=s||t,l.relatedRect=o||F(t),l.willInsertAfter=a,l.originalEvent=r,n.dispatchEvent(l),h&&(u=h.call(c,l,r)),u}function He(n){n.draggable=!1}function Un(){Xe=!1}function Gn(n,t,e){var i=F(kt(e.el,0,e.options,!0)),s=Yi(e.el,e.options,y),o=10;return t?n.clientX<s.left-o||n.clientY<i.top&&n.clientX<i.right:n.clientY<s.top-o||n.clientY<i.bottom&&n.clientX<i.left}function Jn(n,t,e){var i=F(Ue(e.el,e.options.draggable)),s=Yi(e.el,e.options,y),o=10;return t?n.clientX>s.right+o||n.clientY>i.bottom&&n.clientX>i.left:n.clientY>s.bottom+o||n.clientX>i.right&&n.clientY>i.top}function Qn(n,t,e,i,s,o,r,a){var l=i?n.clientY:n.clientX,c=i?e.height:e.width,h=i?e.top:e.left,u=i?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 Zn(t)}return f=f||r,f&&(l<h+c*o/2||l>u-c*o/2)?l>h+c/2?1:-1:0}function Zn(n){return st(d)<st(n)?1:-1}function ts(n){for(var t=n.tagName+n.className+n.src+n.href+n.textContent,e=t.length,i=0;e--;)i+=t.charCodeAt(e);return i.toString(36)}function es(n){Oe.length=0;for(var t=n.getElementsByTagName("input"),e=t.length;e--;){var i=t[e];i.checked&&Oe.push(i)}}function ve(n){return setTimeout(n,0)}function Ye(n){return clearTimeout(n)}xe&&D(document,"touchmove",function(n){(v.active||Pt)&&n.cancelable&&n.preventDefault()});v.utils={on:D,off:O,css:b,find:Vi,is:function(t,e){return!!at(t,e,t,!1)},extend:kn,throttle:Wi,closest:at,toggleClass:Q,clone:Xi,index:st,nextTick:ve,cancelNextTick:Ye,detectDirection:ji,getChild:kt,expando:G};v.get=function(n){return n[G]};v.mount=function(){for(var n=arguments.length,t=new Array(n),e=0;e<n;e++)t[e]=arguments[e];t[0].constructor===Array&&(t=t[0]),t.forEach(function(i){if(!i.prototype||!i.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(i));i.utils&&(v.utils=ht(ht({},v.utils),i.utils)),ie.mount(i)})};v.create=function(n,t){return new v(n,t)};v.version=Nn;var k=[],Kt,qe,je=!1,$e,Ve,De,Ut;function is(){function n(){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 n.prototype={dragStarted:function(e){var i=e.originalEvent;this.sortable.nativeDraggable?D(document,"dragover",this._handleAutoScroll):this.options.supportPointer?D(document,"pointermove",this._handleFallbackAutoScroll):i.touches?D(document,"touchmove",this._handleFallbackAutoScroll):D(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var i=e.originalEvent;!this.options.dragOverBubble&&!i.rootEl&&this._handleAutoScroll(i)},drop:function(){this.sortable.nativeDraggable?O(document,"dragover",this._handleAutoScroll):(O(document,"pointermove",this._handleFallbackAutoScroll),O(document,"touchmove",this._handleFallbackAutoScroll),O(document,"mousemove",this._handleFallbackAutoScroll)),ki(),ye(),Fn()},nulling:function(){De=qe=Kt=je=Ut=$e=Ve=null,k.length=0},_handleFallbackAutoScroll:function(e){this._handleAutoScroll(e,!0)},_handleAutoScroll:function(e,i){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,i||this.options.forceAutoScrollFallback||ee||bt||Gt){We(e,this.options,a,i);var l=Et(a,!0);je&&(!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,i)},10),$e=o,Ve=r)}else{if(!this.options.bubbleScroll||Et(a,!0)===ut()){ye();return}We(e,this.options,Et(a,!1),!1)}}},gt(n,{pluginName:"scroll",initializeByDefault:!0})}function ye(){k.forEach(function(n){clearInterval(n.pid)}),k=[]}function ki(){clearInterval(Ut)}var We=Wi(function(n,t,e,i){if(t.scroll){var s=(n.touches?n.touches[0]:n).clientX,o=(n.touches?n.touches[0]:n).clientY,r=t.scrollSensitivity,a=t.scrollSpeed,l=ut(),c=!1,h;qe!==e&&(qe=e,ye(),Kt=t.scroll,h=t.scrollFn,Kt===!0&&(Kt=Et(e,!0)));var u=0,f=Kt;do{var p=f,m=F(p),g=m.top,w=m.bottom,E=m.left,S=m.right,x=m.width,A=m.height,_=void 0,C=void 0,V=p.scrollWidth,J=p.scrollHeight,I=b(p),W=p.scrollLeft,Y=p.scrollTop;p===l?(_=x<V&&(I.overflowX==="auto"||I.overflowX==="scroll"||I.overflowX==="visible"),C=A<J&&(I.overflowY==="auto"||I.overflowY==="scroll"||I.overflowY==="visible")):(_=x<V&&(I.overflowX==="auto"||I.overflowX==="scroll"),C=A<J&&(I.overflowY==="auto"||I.overflowY==="scroll"));var tt=_&&(Math.abs(S-s)<=r&&W+x<V)-(Math.abs(E-s)<=r&&!!W),z=C&&(Math.abs(w-o)<=r&&Y+A<J)-(Math.abs(g-o)<=r&&!!Y);if(!k[u])for(var P=0;P<=u;P++)k[P]||(k[P]={});(k[u].vx!=tt||k[u].vy!=z||k[u].el!==p)&&(k[u].el=p,k[u].vx=tt,k[u].vy=z,clearInterval(k[u].pid),(tt!=0||z!=0)&&(c=!0,k[u].pid=setInterval(function(){i&&this.layer===0&&v.active._onTouchMove(De);var q=k[this.layer].vy?k[this.layer].vy*a:0,R=k[this.layer].vx?k[this.layer].vx*a:0;typeof h=="function"&&h.call(v.dragged.parentNode[G],R,q,n,De,k[this.layer].el)!=="continue"||zi(k[this.layer].el,R,q)}.bind({layer:u}),24))),u++}while(t.bubbleScroll&&f!==l&&(f=Et(f,!1)));je=c}},30),Ji=function(t){var e=t.originalEvent,i=t.putSortable,s=t.dragEl,o=t.activeSortable,r=t.dispatchSortableEvent,a=t.hideGhostForTarget,l=t.unhideGhostForTarget;if(e){var c=i||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:i}))}};function Ge(){}Ge.prototype={startIndex:null,dragStart:function(t){var e=t.oldDraggableIndex;this.startIndex=e},onSpill:function(t){var e=t.dragEl,i=t.putSortable;this.sortable.captureAnimationState(),i&&i.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(),i&&i.animateAll()},drop:Ji};gt(Ge,{pluginName:"revertOnSpill"});function Je(){}Je.prototype={onSpill:function(t){var e=t.dragEl,i=t.putSortable,s=i||this.sortable;s.captureAnimationState(),e.parentNode&&e.parentNode.removeChild(e),s.animateAll()},drop:Ji};gt(Je,{pluginName:"removeOnSpill"});v.mount(new is);v.mount(Je,Ge);var Qi=v;function dt(n){return n.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase()}function ne(n){return n==null||n===""||typeof n=="string"&&n.trim()===""}function H(n){return!ne(n)}var Ae=class{constructor({accessibilityAttributes:t={},ariaLabel:e=null,canOptionLabelsWrap:i=!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:E=null,initialState:S=null,isAutofocused:x=!1,isDisabled:A=!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:q=()=>{},options:R,optionsLimit:B=null,placeholder:N,position:et=null,removeButtonLabel:se="Remove :label",searchableOptionFields:Ft=["label"],searchDebounce:Ce=1e3,searchingMessage:tn="Searching...",searchLabel:en="Search",searchPrompt:nn="Search...",state:sn,statePath:on=null}){this.accessibilityAttributes=t,this.ariaLabel=e,this.canOptionLabelsWrap=i,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=E,this.initialState=S,this.isAutofocused=x,this.isDisabled=A,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=q,this.options=R,this.optionsLimit=B,this.originalOptions=JSON.parse(JSON.stringify(R)),this.placeholder=N,this.position=et,this.removeButtonLabel=se,this.searchableOptionFields=Array.isArray(Ft)?Ft:["label"],this.searchDebounce=Ce,this.searchingMessage=tn,this.searchLabel=en,this.searchPrompt=nn,this.state=sn,this.statePath=on,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,i=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 i){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 i=document.createElement("li");i.className="fi-select-input-option-group",i.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)}),i.appendChild(s),i.appendChild(o),this.optionsList.appendChild(i)}createOptionElement(t,e){let i=t,s=e,o=!1;typeof e=="object"&&e!==null&&"label"in e&&"value"in e&&(i=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",i),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(i):this.state===i;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(i)}),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.positionDropdown());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 i=await this.getLabelForSingleSelection();t===this.selectedDisplayVersion&&(this.addSingleSelectionDisplay(i,e),t===this.selectedDisplayVersion&&(this.destroyBadgesSortable(),this.commitSelectedDisplay(e)))}commitSelectedDisplay(t){let e=this.selectedDisplay.contains(document.activeElement)?document.activeElement:null,i=e?.closest("[data-value]")?.dataset.value;this.selectedDisplay.replaceChildren(t),this.updateSelectionSummary(),e&&(this.isOpen?this.getFocusOwner():this.selectedDisplay.querySelector(`[data-value="${CSS.escape(i??"")}"] 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(),i=[];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}i.push(o.toString())}}if(i.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&&i.includes(o.value)&&(this.labelRepository[o.value]=o.label)}else if(i.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 i=document.createElement("span");i.className="fi-badge fi-size-md fi-color fi-color-primary fi-text-color-700 dark:fi-text-color-200",H(t)&&i.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),i.appendChild(s);let r=this.createRemoveButton(t,e);return i.appendChild(r),i}createRemoveButton(t,e){let i=document.createElement("button");i.type="button",i.className="fi-badge-delete-btn",i.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"),i.appendChild(s),this.isDisabled&&(i.setAttribute("disabled","disabled"),i.classList.add("fi-disabled")),i.addEventListener("click",o=>{if(o.stopPropagation(),H(t)){let r=Array.from(this.selectedDisplay.querySelectorAll(".fi-badge-delete-btn")),a=r.indexOf(i),l=this.isOpen?this.getFocusOwner():r[a+1]??r[a-1]??this.selectButton;this.selectOption(t),this.isDisabled||l.focus()}}),i.addEventListener("keydown",o=>{(o.key===" "||o.key==="Enter")&&(o.preventDefault(),o.stopPropagation(),i.click())}),i}addBadgesForSelectedOptions(t,e=this.selectedDisplay){let i=document.createElement("div");i.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);i.appendChild(a)}),e.appendChild(i),this.isReorderable&&(i.addEventListener("click",s=>{s.stopPropagation()}),i.addEventListener("mousedown",s=>{s.stopPropagation()}),this.destroyBadgesSortable(),this.badgesSortable=new Qi(i,{animation:150,disabled:this.isDisabled,onEnd:()=>{let s=[];i.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,i=this.labelRepository[this.state];if(ne(i)&&(i=this.getSelectedOptionLabel(this.state)),ne(i)&&H(this.initialOptionLabel)&&this.state===this.initialState)i=this.initialOptionLabel,H(this.state)&&(this.labelRepository[this.state]=i);else if(ne(i)&&this.getOptionLabelUsing)try{if(i=await this.getOptionLabelUsing(),this.isDestroyed||e!==this.selectedDisplayVersion||t!==this.state)return null;H(i)&&H(this.state)&&(this.labelRepository[t]=i)}catch(s){console.error("Error fetching option label:",s),i=this.state}else ne(i)&&(i=this.state);return i}addSingleSelectionDisplay(t,e=this.selectedDisplay){let i=document.createElement("span");if(i.className="fi-select-input-value-label",this.isHtmlAllowed?i.innerHTML=t:i.textContent=t,e.appendChild(i),!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 i of this.options)if(i.options&&Array.isArray(i.options)){for(let s of i.options)if(s.value===t){e=s.label,this.labelRepository[t]=e;break}}else if(i.value===t){e=i.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,i=++this.selectedDisplayVersion;delete this.labelRepository[this.state];let s=await this.getOptionLabelUsing();if(this.isDestroyed||e!==this.state||i!==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 i=this.getVisibleOptions();for(let s of i)if(s.getAttribute("data-value")===String(t)){if(s.innerHTML="",this.isHtmlAllowed){let o=document.createElement("span");o.innerHTML=e,s.appendChild(o)}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){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)return;let e=t.target===this.searchInput,i=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=i.find(o=>o.dataset.value===this.activeValue)??(e?i[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"?i[0]:i.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 i=`${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=i,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",i=[xi(4),Ai({padding:5})];this.position!=="top"&&this.position!=="bottom"&&i.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:i,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`})})}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(i=>i.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(i=>i.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(),i=t.getBoundingClientRect();i.bottom>e.bottom?this.dropdown.scrollTop+=i.bottom-e.bottom:i.top<e.top&&(this.dropdown.scrollTop-=e.top-i.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(i=>i.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 i=[t["aria-describedby"],this.selectionSummary.id].filter(Boolean).join(" ").split(/\s+/);this.selectButton.setAttribute("aria-describedby",[...new Set(i)].join(" "))}getSelectedOptionLabels(){if(!Array.isArray(this.state)||this.state.length===0)return{};let t={};for(let e of this.state){let i=!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,i=!0;break}if(i)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 i=++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||i!==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.positionDropdown(),this.options.length===0&&this.showNoResultsMessage()}catch(s){!this.isDestroyed&&this.isOpen&&i===this.activeSearchId&&(console.error("Error fetching search results:",s),this.showErrorMessage())}finally{i===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.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.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.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.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"),i=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)||i&&dt(String(a.value)).includes(t));r.length>0&&s.push({label:o.label,options:r})}else(e&&dt(o.label).includes(t)||i&&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 i=this.container.contains(document.activeElement);this.state=t,this.updateSelectedDisplay(),this.renderOptions(),this.closeDropdown(),i&&this.selectButton.focus(),this.onStateChange(this.state);return}let e=Array.isArray(this.state)?[...this.state]:[];if(e.includes(t)){this.state=e.filter(i=>i!==t),this.updateSelectedDisplay(),this.hideMaxItemsMessage(),this.renderOptions(),this.isOpen&&this.positionDropdown(),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.positionDropdown(),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 Zi(){let n=!1,t=new Set,e=(i,s,o,r={})=>{let a=[...o,{...r}],l=null,c;return new Promise((h,u)=>{let f=!1,p=(m,g)=>{f||(f=!0,l?.(),l=null,t.delete(c),m(g))};if(c=()=>p(u,new Error("Select option request was cancelled.")),t.add(c),n){c();return}l=Livewire.hook("commit",({component:m,commit:g,fail:w})=>{m.id!==i.$id||!g.calls.some(E=>E.method===s&&E.params.length===a.length&&E.params.every((S,x)=>S===a[x]))||(l?.(),l=null,w(()=>p(u,new Error("Select option request failed."))))});try{Promise.resolve(i[s](...a)).then(m=>p(h,m),m=>p(u,m))}catch(m){p(u,m)}})};return{wrap:i=>typeof i=="function"?(...s)=>i(...s,e):i,destroy(){n=!0;for(let i of t)i()}}}function Qe({name:n,recordKey:t,state:e,messages:i}){let s=o=>o.method==="updateTableColumnState"&&o.params[0]===n&&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.hook("commit",({component:o,commit:r,succeed:a,fail:l})=>{if(o.id!==this.$wire.$id)return;let c=r.calls.some(s),h=this.isRefreshing;(c||h)&&l(()=>this.handleSaveFailure()),a(({effects:u})=>{(c||h)&&(this.hasRenderedState=!!u.html),h&&(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=i?.saving,this.unsubscribeRequestHook=Livewire.hook("request",({payload:r,respond:a})=>{JSON.parse(r).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 this.handleSaveFailure(),h}}})});try{let r=await this.$wire.updateTableColumnState(n,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??i?.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=i?.failure??"The save could not be confirmed. Refresh the page before trying again.",this.status=this.error,this.isRefreshing=!1,this.isLoading=!1)},blockEdit(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&&i?this.$id("table-column-error"):null].filter(Boolean).join(" ")||null}},destroy(){this.isDestroyed=!0,this.unsubscribeLivewireHook?.(),this.unsubscribeRequestHook?.(),this.unsubscribeRequestHook=null}}}function ns({accessibilityAttributes:n,ariaLabel:t,canOptionLabelsWrap:e,canSelectPlaceholder:i,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:E,noSearchResultsMessage:S,options:x,optionsLimit:A,placeholder:_,position:C,recordKey:V,searchableOptionFields:J,searchDebounce:I,searchingMessage:W,searchLabel:Y,searchPrompt:tt,state:z}){let P=Zi(),q=Qe({name:w,recordKey:V,state:z,messages:g});return{...q,select:null,init(){if(!f){this.select=new Ae({accessibilityAttributes:n,ariaLabel:t,canOptionLabelsWrap:e,canSelectPlaceholder:i,clearButtonLabel:s,element:this.$refs.select,errorMessage:o,getOptionLabelUsing:()=>this.$wire.callTableColumnMethod(w,V,"getOptionLabel"),getOptionsUsing:P.wrap(B=>B(this.$wire,"callTableColumnMethod",[w,V,"getOptionsForJs"])),getSearchResultsUsing:P.wrap((B,N)=>N(this.$wire,"callTableColumnMethod",[w,V,"getOptionsSearchResultsForJs"],{search:B})),hasDynamicOptions:r,hasDynamicSearchResults:a,hasInitialNoOptionsMessage:l,initialOptionLabel:c,isDisabled:h,isHtmlAllowed:u,isSearchable:p,loadingMessage:m,noOptionsMessage:E,noSearchResultsMessage:S,onStateChange:B=>{this.clearError(),this.state=B},options:x,optionsLimit:A,placeholder:_,position:C,searchableOptionFields:J,searchDebounce:I,searchingMessage:W,searchLabel:Y,searchPrompt:tt,state:this.state});let R=()=>{this.select.setAccessibilityAttributes(this.getAccessibilityAttributes(n)),this.select.selectButton.setAttribute("aria-disabled",this.isLoading||this.select.isDisabled?"true":"false")};this.$watch("error",R),this.$watch("isLoading",R)}this.initEditableColumn(),this.$watch("state",R=>{!f&&this.select&&this.select.state!==R&&(this.select.state=R,this.select.updateSelectedDisplay(),this.select.renderOptions())})},syncServerState(){q.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(){q.destroy.call(this),this.select&&(this.select.destroy(),this.select=null),P.destroy()}}}export{ns as default};
|
|
/*! Bundled license information:
|
|
|
|
sortablejs/modular/sortable.esm.js:
|
|
(**!
|
|
* Sortable 1.15.7
|
|
* @author RubaXa <trash@rubaxa.org>
|
|
* @author owenm <owen23355@gmail.com>
|
|
* @license MIT
|
|
*)
|
|
*/
|