preline
Version:
Preline UI is an open-source set of prebuilt UI components based on the utility-first Tailwind CSS framework.
24 lines • 51 kB
JavaScript
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}(self,()=>(()=>{"use strict";var e={949(e,t,n){n.r(t),n.d(t,{arrow:()=>Ie,autoPlacement:()=>Ae,autoUpdate:()=>xe,computePosition:()=>De,detectOverflow:()=>Ce,flip:()=>Te,getOverflowAncestors:()=>ie,hide:()=>Pe,inline:()=>ke,limitShift:()=>Re,offset:()=>Le,platform:()=>be,shift:()=>Se,size:()=>Oe});const o=["top","right","bottom","left"],i=["start","end"],s=o.reduce((e,t)=>e.concat(t,t+"-"+i[0],t+"-"+i[1]),[]),r=Math.min,l=Math.max,a=Math.round,c=Math.floor,d=e=>({x:e,y:e}),u={left:"right",right:"left",bottom:"top",top:"bottom"};function h(e,t,n){return l(e,r(t,n))}function f(e,t){return"function"==typeof e?e(t):e}function p(e){return e.split("-")[0]}function m(e){return e.split("-")[1]}function g(e){return"x"===e?"y":"x"}function y(e){return"y"===e?"height":"width"}function w(e){const t=e[0];return"t"===t||"b"===t?"y":"x"}function v(e){return g(w(e))}function b(e,t,n){void 0===n&&(n=!1);const o=m(e),i=v(e),s=y(i);let r="x"===i?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return t.reference[s]>t.floating[s]&&(r=T(r)),[r,T(r)]}function E(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const x=["left","right"],C=["right","left"],L=["top","bottom"],A=["bottom","top"];function S(e,t,n,o){const i=m(e);let s=function(e,t,n){switch(e){case"top":case"bottom":return n?t?C:x:t?x:C;case"left":case"right":return t?L:A;default:return[]}}(p(e),"start"===n,o);return i&&(s=s.map(e=>e+"-"+i),t&&(s=s.concat(s.map(E)))),s}function T(e){const t=p(e);return u[t]+e.slice(t.length)}function O(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function P(e){const{x:t,y:n,width:o,height:i}=e;return{width:o,height:i,top:n,left:t,right:t+o,bottom:n+i,x:t,y:n}}function I(e,t,n){let{reference:o,floating:i}=e;const s=w(t),r=v(t),l=y(r),a=p(t),c="y"===s,d=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,h=o[l]/2-i[l]/2;let f;switch(a){case"top":f={x:d,y:o.y-i.height};break;case"bottom":f={x:d,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:u};break;case"left":f={x:o.x-i.width,y:u};break;default:f={x:o.x,y:o.y}}switch(m(t)){case"start":f[r]-=h*(n&&c?-1:1);break;case"end":f[r]+=h*(n&&c?-1:1)}return f}async function k(e,t){var n;void 0===t&&(t={});const{x:o,y:i,platform:s,rects:r,elements:l,strategy:a}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:h=!1,padding:p=0}=f(t,e),m=O(p),g=l[h?"floating"===u?"reference":"floating":u],y=P(await s.getClippingRect({element:null==(n=await(null==s.isElement?void 0:s.isElement(g)))||n?g:g.contextElement||await(null==s.getDocumentElement?void 0:s.getDocumentElement(l.floating)),boundary:c,rootBoundary:d,strategy:a})),w="floating"===u?{x:o,y:i,width:r.floating.width,height:r.floating.height}:r.reference,v=await(null==s.getOffsetParent?void 0:s.getOffsetParent(l.floating)),b=await(null==s.isElement?void 0:s.isElement(v))&&await(null==s.getScale?void 0:s.getScale(v))||{x:1,y:1},E=P(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:w,offsetParent:v,strategy:a}):w);return{top:(y.top-E.top+m.top)/b.y,bottom:(E.bottom-y.bottom+m.bottom)/b.y,left:(y.left-E.left+m.left)/b.x,right:(E.right-y.right+m.right)/b.x}}function R(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function D(e){return o.some(t=>e[t]>=0)}function M(e){const t=r(...e.map(e=>e.left)),n=r(...e.map(e=>e.top));return{x:t,y:n,width:l(...e.map(e=>e.right))-t,height:l(...e.map(e=>e.bottom))-n}}const H=new Set(["left","top"]);function _(){return"undefined"!=typeof window}function F(e){return N(e)?(e.nodeName||"").toLowerCase():"#document"}function K(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function B(e){var t;return null==(t=(N(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function N(e){return!!_()&&(e instanceof Node||e instanceof K(e).Node)}function V(e){return!!_()&&(e instanceof Element||e instanceof K(e).Element)}function Y(e){return!!_()&&(e instanceof HTMLElement||e instanceof K(e).HTMLElement)}function $(e){return!(!_()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof K(e).ShadowRoot)}function W(e){const{overflow:t,overflowX:n,overflowY:o,display:i}=ee(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&"inline"!==i&&"contents"!==i}function U(e){return/^(table|td|th)$/.test(F(e))}function q(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}const j=/transform|translate|scale|rotate|perspective|filter/,z=/paint|layout|strict|content/,X=e=>!!e&&"none"!==e;let G;function Z(e){const t=V(e)?ee(e):e;return X(t.transform)||X(t.translate)||X(t.scale)||X(t.rotate)||X(t.perspective)||!J()&&(X(t.backdropFilter)||X(t.filter))||j.test(t.willChange||"")||z.test(t.contain||"")}function J(){return null==G&&(G="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),G}function Q(e){return/^(html|body|#document)$/.test(F(e))}function ee(e){return K(e).getComputedStyle(e)}function te(e){return V(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ne(e){if("html"===F(e))return e;const t=e.assignedSlot||e.parentNode||$(e)&&e.host||B(e);return $(t)?t.host:t}function oe(e){const t=ne(e);return Q(t)?e.ownerDocument?e.ownerDocument.body:e.body:Y(t)&&W(t)?t:oe(t)}function ie(e,t,n){var o;void 0===t&&(t=[]),void 0===n&&(n=!0);const i=oe(e),s=i===(null==(o=e.ownerDocument)?void 0:o.body),r=K(i);if(s){const e=se(r);return t.concat(r,r.visualViewport||[],W(i)?i:[],e&&n?ie(e):[])}return t.concat(i,ie(i,[],n))}function se(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function re(e){const t=ee(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const i=Y(e),s=i?e.offsetWidth:n,r=i?e.offsetHeight:o,l=a(n)!==s||a(o)!==r;return l&&(n=s,o=r),{width:n,height:o,$:l}}function le(e){return V(e)?e:e.contextElement}function ae(e){const t=le(e);if(!Y(t))return d(1);const n=t.getBoundingClientRect(),{width:o,height:i,$:s}=re(t);let r=(s?a(n.width):n.width)/o,l=(s?a(n.height):n.height)/i;return r&&Number.isFinite(r)||(r=1),l&&Number.isFinite(l)||(l=1),{x:r,y:l}}const ce=d(0);function de(e){const t=K(e);return J()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:ce}function ue(e,t,n,o){void 0===t&&(t=!1),void 0===n&&(n=!1);const i=e.getBoundingClientRect(),s=le(e);let r=d(1);t&&(o?V(o)&&(r=ae(o)):r=ae(e));const l=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==K(e))&&t}(s,n,o)?de(s):d(0);let a=(i.left+l.x)/r.x,c=(i.top+l.y)/r.y,u=i.width/r.x,h=i.height/r.y;if(s){const e=K(s),t=o&&V(o)?K(o):o;let n=e,i=se(n);for(;i&&o&&t!==n;){const e=ae(i),t=i.getBoundingClientRect(),o=ee(i),s=t.left+(i.clientLeft+parseFloat(o.paddingLeft))*e.x,r=t.top+(i.clientTop+parseFloat(o.paddingTop))*e.y;a*=e.x,c*=e.y,u*=e.x,h*=e.y,a+=s,c+=r,n=K(i),i=se(n)}}return P({width:u,height:h,x:a,y:c})}function he(e,t){const n=te(e).scrollLeft;return t?t.left+n:ue(B(e)).left+n}function fe(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-he(e,n),y:n.top+t.scrollTop}}function pe(e,t,n){let o;if("viewport"===t)o=function(e,t){const n=K(e),o=B(e),i=n.visualViewport;let s=o.clientWidth,r=o.clientHeight,l=0,a=0;if(i){s=i.width,r=i.height;const e=J();(!e||e&&"fixed"===t)&&(l=i.offsetLeft,a=i.offsetTop)}const c=he(o);if(c<=0){const e=o.ownerDocument,t=e.body,n=getComputedStyle(t),i="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,r=Math.abs(o.clientWidth-t.clientWidth-i);r<=25&&(s-=r)}else c<=25&&(s+=c);return{width:s,height:r,x:l,y:a}}(e,n);else if("document"===t)o=function(e){const t=B(e),n=te(e),o=e.ownerDocument.body,i=l(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),s=l(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let r=-n.scrollLeft+he(e);const a=-n.scrollTop;return"rtl"===ee(o).direction&&(r+=l(t.clientWidth,o.clientWidth)-i),{width:i,height:s,x:r,y:a}}(B(e));else if(V(t))o=function(e,t){const n=ue(e,!0,"fixed"===t),o=n.top+e.clientTop,i=n.left+e.clientLeft,s=Y(e)?ae(e):d(1);return{width:e.clientWidth*s.x,height:e.clientHeight*s.y,x:i*s.x,y:o*s.y}}(t,n);else{const n=de(e);o={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return P(o)}function me(e,t){const n=ne(e);return!(n===t||!V(n)||Q(n))&&("fixed"===ee(n).position||me(n,t))}function ge(e,t,n){const o=Y(t),i=B(t),s="fixed"===n,r=ue(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const a=d(0);function c(){a.x=he(i)}if(o||!o&&!s)if(("body"!==F(t)||W(i))&&(l=te(t)),o){const e=ue(t,!0,s,t);a.x=e.x+t.clientLeft,a.y=e.y+t.clientTop}else i&&c();s&&!o&&i&&c();const u=!i||o||s?d(0):fe(i,l);return{x:r.left+l.scrollLeft-a.x-u.x,y:r.top+l.scrollTop-a.y-u.y,width:r.width,height:r.height}}function ye(e){return"static"===ee(e).position}function we(e,t){if(!Y(e)||"fixed"===ee(e).position)return null;if(t)return t(e);let n=e.offsetParent;return B(e)===n&&(n=n.ownerDocument.body),n}function ve(e,t){const n=K(e);if(q(e))return n;if(!Y(e)){let t=ne(e);for(;t&&!Q(t);){if(V(t)&&!ye(t))return t;t=ne(t)}return n}let o=we(e,t);for(;o&&U(o)&&ye(o);)o=we(o,t);return o&&Q(o)&&ye(o)&&!Z(o)?n:o||function(e){let t=ne(e);for(;Y(t)&&!Q(t);){if(Z(t))return t;if(q(t))return null;t=ne(t)}return null}(e)||n}const be={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:o,strategy:i}=e;const s="fixed"===i,r=B(o),l=!!t&&q(t.floating);if(o===r||l&&s)return n;let a={scrollLeft:0,scrollTop:0},c=d(1);const u=d(0),h=Y(o);if((h||!h&&!s)&&(("body"!==F(o)||W(r))&&(a=te(o)),h)){const e=ue(o);c=ae(o),u.x=e.x+o.clientLeft,u.y=e.y+o.clientTop}const f=!r||h||s?d(0):fe(r,a);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-a.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-a.scrollTop*c.y+u.y+f.y}},getDocumentElement:B,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:o,strategy:i}=e;const s=[..."clippingAncestors"===n?q(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let o=ie(e,[],!1).filter(e=>V(e)&&"body"!==F(e)),i=null;const s="fixed"===ee(e).position;let r=s?ne(e):e;for(;V(r)&&!Q(r);){const t=ee(r),n=Z(r);n||"fixed"!==t.position||(i=null),(s?!n&&!i:!n&&"static"===t.position&&i&&("absolute"===i.position||"fixed"===i.position)||W(r)&&!n&&me(e,r))?o=o.filter(e=>e!==r):i=t,r=ne(r)}return t.set(e,o),o}(t,this._c):[].concat(n),o],a=pe(t,s[0],i);let c=a.top,d=a.right,u=a.bottom,h=a.left;for(let e=1;e<s.length;e++){const n=pe(t,s[e],i);c=l(n.top,c),d=r(n.right,d),u=r(n.bottom,u),h=l(n.left,h)}return{width:d-h,height:u-c,x:h,y:c}},getOffsetParent:ve,getElementRects:async function(e){const t=this.getOffsetParent||ve,n=this.getDimensions,o=await n(e.floating);return{reference:ge(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=re(e);return{width:t,height:n}},getScale:ae,isElement:V,isRTL:function(e){return"rtl"===ee(e).direction}};function Ee(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function xe(e,t,n,o){void 0===o&&(o={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:d="function"==typeof IntersectionObserver,animationFrame:u=!1}=o,h=le(e),f=i||s?[...h?ie(h):[],...t?ie(t):[]]:[];f.forEach(e=>{i&&e.addEventListener("scroll",n,{passive:!0}),s&&e.addEventListener("resize",n)});const p=h&&d?function(e,t){let n,o=null;const i=B(e);function s(){var e;clearTimeout(n),null==(e=o)||e.disconnect(),o=null}return function a(d,u){void 0===d&&(d=!1),void 0===u&&(u=1),s();const h=e.getBoundingClientRect(),{left:f,top:p,width:m,height:g}=h;if(d||t(),!m||!g)return;const y={rootMargin:-c(p)+"px "+-c(i.clientWidth-(f+m))+"px "+-c(i.clientHeight-(p+g))+"px "+-c(f)+"px",threshold:l(0,r(1,u))||1};let w=!0;function v(t){const o=t[0].intersectionRatio;if(o!==u){if(!w)return a();o?a(!1,o):n=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==o||Ee(h,e.getBoundingClientRect())||a(),w=!1}try{o=new IntersectionObserver(v,{...y,root:i.ownerDocument})}catch(e){o=new IntersectionObserver(v,y)}o.observe(e)}(!0),s}(h,n):null;let m,g=-1,y=null;a&&(y=new ResizeObserver(e=>{let[o]=e;o&&o.target===h&&y&&t&&(y.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var e;null==(e=y)||e.observe(t)})),n()}),h&&!u&&y.observe(h),t&&y.observe(t));let w=u?ue(e):null;return u&&function t(){const o=ue(e);w&&!Ee(w,o)&&n();w=o,m=requestAnimationFrame(t)}(),n(),()=>{var e;f.forEach(e=>{i&&e.removeEventListener("scroll",n),s&&e.removeEventListener("resize",n)}),null==p||p(),null==(e=y)||e.disconnect(),y=null,u&&cancelAnimationFrame(m)}}const Ce=k,Le=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:i,y:s,placement:r,middlewareData:l}=t,a=await async function(e,t){const{placement:n,platform:o,elements:i}=e,s=await(null==o.isRTL?void 0:o.isRTL(i.floating)),r=p(n),l=m(n),a="y"===w(n),c=H.has(r)?-1:1,d=s&&a?-1:1,u=f(t,e);let{mainAxis:h,crossAxis:g,alignmentAxis:y}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return l&&"number"==typeof y&&(g="end"===l?-1*y:y),a?{x:g*d,y:h*c}:{x:h*c,y:g*d}}(t,e);return r===(null==(n=l.offset)?void 0:n.placement)&&null!=(o=l.arrow)&&o.alignmentOffset?{}:{x:i+a.x,y:s+a.y,data:{...a,placement:r}}}}},Ae=function(e){return void 0===e&&(e={}),{name:"autoPlacement",options:e,async fn(t){var n,o,i;const{rects:r,middlewareData:l,placement:a,platform:c,elements:d}=t,{crossAxis:u=!1,alignment:h,allowedPlacements:g=s,autoAlignment:y=!0,...w}=f(e,t),v=void 0!==h||g===s?function(e,t,n){return(e?[...n.filter(t=>m(t)===e),...n.filter(t=>m(t)!==e)]:n.filter(e=>p(e)===e)).filter(n=>!e||m(n)===e||!!t&&E(n)!==n)}(h||null,y,g):g,x=await c.detectOverflow(t,w),C=(null==(n=l.autoPlacement)?void 0:n.index)||0,L=v[C];if(null==L)return{};const A=b(L,r,await(null==c.isRTL?void 0:c.isRTL(d.floating)));if(a!==L)return{reset:{placement:v[0]}};const S=[x[p(L)],x[A[0]],x[A[1]]],T=[...(null==(o=l.autoPlacement)?void 0:o.overflows)||[],{placement:L,overflows:S}],O=v[C+1];if(O)return{data:{index:C+1,overflows:T},reset:{placement:O}};const P=T.map(e=>{const t=m(e.placement);return[e.placement,t&&u?e.overflows.slice(0,2).reduce((e,t)=>e+t,0):e.overflows[0],e.overflows]}).sort((e,t)=>e[1]-t[1]),I=(null==(i=P.filter(e=>e[2].slice(0,m(e[0])?2:3).every(e=>e<=0))[0])?void 0:i[0])||P[0][0];return I!==a?{data:{index:C+1,overflows:T},reset:{placement:I}}:{}}}},Se=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:i,platform:s}=t,{mainAxis:r=!0,crossAxis:l=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=f(e,t),d={x:n,y:o},u=await s.detectOverflow(t,c),m=w(p(i)),y=g(m);let v=d[y],b=d[m];if(r){const e="y"===y?"bottom":"right";v=h(v+u["y"===y?"top":"left"],v,v-u[e])}if(l){const e="y"===m?"bottom":"right";b=h(b+u["y"===m?"top":"left"],b,b-u[e])}const E=a.fn({...t,[y]:v,[m]:b});return{...E,data:{x:E.x-n,y:E.y-o,enabled:{[y]:r,[m]:l}}}}}},Te=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:i,middlewareData:s,rects:r,initialPlacement:l,platform:a,elements:c}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:y=!0,...v}=f(e,t);if(null!=(n=s.arrow)&&n.alignmentOffset)return{};const x=p(i),C=w(l),L=p(l)===l,A=await(null==a.isRTL?void 0:a.isRTL(c.floating)),O=h||(L||!y?[T(l)]:function(e){const t=T(e);return[E(e),t,E(t)]}(l)),P="none"!==g;!h&&P&&O.push(...S(l,y,g,A));const I=[l,...O],k=await a.detectOverflow(t,v),R=[];let D=(null==(o=s.flip)?void 0:o.overflows)||[];if(d&&R.push(k[x]),u){const e=b(i,r,A);R.push(k[e[0]],k[e[1]])}if(D=[...D,{placement:i,overflows:R}],!R.every(e=>e<=0)){var M,H;const e=((null==(M=s.flip)?void 0:M.index)||0)+1,t=I[e];if(t){if(!("alignment"===u&&C!==w(t))||D.every(e=>w(e.placement)!==C||e.overflows[0]>0))return{data:{index:e,overflows:D},reset:{placement:t}}}let n=null==(H=D.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:H.placement;if(!n)switch(m){case"bestFit":{var _;const e=null==(_=D.filter(e=>{if(P){const t=w(e.placement);return t===C||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:_[0];e&&(n=e);break}case"initialPlacement":n=l}if(i!==n)return{reset:{placement:n}}}return{}}}},Oe=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:i,rects:s,platform:a,elements:c}=t,{apply:d=()=>{},...u}=f(e,t),h=await a.detectOverflow(t,u),g=p(i),y=m(i),v="y"===w(i),{width:b,height:E}=s.floating;let x,C;"top"===g||"bottom"===g?(x=g,C=y===(await(null==a.isRTL?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(C=g,x="end"===y?"top":"bottom");const L=E-h.top-h.bottom,A=b-h.left-h.right,S=r(E-h[x],L),T=r(b-h[C],A),O=!t.middlewareData.shift;let P=S,I=T;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(I=A),null!=(o=t.middlewareData.shift)&&o.enabled.y&&(P=L),O&&!y){const e=l(h.left,0),t=l(h.right,0),n=l(h.top,0),o=l(h.bottom,0);v?I=b-2*(0!==e||0!==t?e+t:l(h.left,h.right)):P=E-2*(0!==n||0!==o?n+o:l(h.top,h.bottom))}await d({...t,availableWidth:I,availableHeight:P});const k=await a.getDimensions(c.floating);return b!==k.width||E!==k.height?{reset:{rects:!0}}:{}}}},Pe=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:o}=t,{strategy:i="referenceHidden",...s}=f(e,t);switch(i){case"referenceHidden":{const e=R(await o.detectOverflow(t,{...s,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:D(e)}}}case"escaped":{const e=R(await o.detectOverflow(t,{...s,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:D(e)}}}default:return{}}}}},Ie=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:i,rects:s,platform:l,elements:a,middlewareData:c}=t,{element:d,padding:u=0}=f(e,t)||{};if(null==d)return{};const p=O(u),g={x:n,y:o},w=v(i),b=y(w),E=await l.getDimensions(d),x="y"===w,C=x?"top":"left",L=x?"bottom":"right",A=x?"clientHeight":"clientWidth",S=s.reference[b]+s.reference[w]-g[w]-s.floating[b],T=g[w]-s.reference[w],P=await(null==l.getOffsetParent?void 0:l.getOffsetParent(d));let I=P?P[A]:0;I&&await(null==l.isElement?void 0:l.isElement(P))||(I=a.floating[A]||s.floating[b]);const k=S/2-T/2,R=I/2-E[b]/2-1,D=r(p[C],R),M=r(p[L],R),H=D,_=I-E[b]-M,F=I/2-E[b]/2+k,K=h(H,F,_),B=!c.arrow&&null!=m(i)&&F!==K&&s.reference[b]/2-(F<H?D:M)-E[b]/2<0,N=B?F<H?F-H:F-_:0;return{[w]:g[w]+N,data:{[w]:K,centerOffset:F-K-N,...B&&{alignmentOffset:N}},reset:B}}}),ke=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:o,rects:i,platform:s,strategy:a}=t,{padding:c=2,x:d,y:u}=f(e,t),h=Array.from(await(null==s.getClientRects?void 0:s.getClientRects(o.reference))||[]),m=function(e){const t=e.slice().sort((e,t)=>e.y-t.y),n=[];let o=null;for(let e=0;e<t.length;e++){const i=t[e];!o||i.y-o.y>o.height/2?n.push([i]):n[n.length-1].push(i),o=i}return n.map(e=>P(M(e)))}(h),g=P(M(h)),y=O(c);const v=await s.getElementRects({reference:{getBoundingClientRect:function(){if(2===m.length&&m[0].left>m[1].right&&null!=d&&null!=u)return m.find(e=>d>e.left-y.left&&d<e.right+y.right&&u>e.top-y.top&&u<e.bottom+y.bottom)||g;if(m.length>=2){if("y"===w(n)){const e=m[0],t=m[m.length-1],o="top"===p(n),i=e.top,s=t.bottom,r=o?e.left:t.left,l=o?e.right:t.right;return{top:i,bottom:s,left:r,right:l,width:l-r,height:s-i,x:r,y:i}}const e="left"===p(n),t=l(...m.map(e=>e.right)),o=r(...m.map(e=>e.left)),i=m.filter(n=>e?n.left===o:n.right===t),s=i[0].top,a=i[i.length-1].bottom;return{top:s,bottom:a,left:o,right:t,width:t-o,height:a-s,x:o,y:s}}return g}},floating:o.floating,strategy:a});return i.reference.x!==v.reference.x||i.reference.y!==v.reference.y||i.reference.width!==v.reference.width||i.reference.height!==v.reference.height?{reset:{rects:v}}:{}}}},Re=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:i,rects:s,middlewareData:r}=t,{offset:l=0,mainAxis:a=!0,crossAxis:c=!0}=f(e,t),d={x:n,y:o},u=w(i),h=g(u);let m=d[h],y=d[u];const v=f(l,t),b="number"==typeof v?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(a){const e="y"===h?"height":"width",t=s.reference[h]-s.floating[e]+b.mainAxis,n=s.reference[h]+s.reference[e]-b.mainAxis;m<t?m=t:m>n&&(m=n)}if(c){var E,x;const e="y"===h?"width":"height",t=H.has(p(i)),n=s.reference[u]-s.floating[e]+(t&&(null==(E=r.offset)?void 0:E[u])||0)+(t?0:b.crossAxis),o=s.reference[u]+s.reference[e]+(t?0:(null==(x=r.offset)?void 0:x[u])||0)-(t?b.crossAxis:0);y<n?y=n:y>o&&(y=o)}return{[h]:m,[u]:y}}}},De=(e,t,n)=>{const o=new Map,i={platform:be,...n},s={...i.platform,_c:o};return(async(e,t,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:s=[],platform:r}=n,l=r.detectOverflow?r:{...r,detectOverflow:k},a=await(null==r.isRTL?void 0:r.isRTL(t));let c=await r.getElementRects({reference:e,floating:t,strategy:i}),{x:d,y:u}=I(c,o,a),h=o,f=0;const p={};for(let n=0;n<s.length;n++){const m=s[n];if(!m)continue;const{name:g,fn:y}=m,{x:w,y:v,data:b,reset:E}=await y({x:d,y:u,initialPlacement:o,placement:h,strategy:i,middlewareData:p,rects:c,platform:l,elements:{reference:e,floating:t}});d=null!=w?w:d,u=null!=v?v:u,p[g]={...p[g],...b},E&&f<50&&(f++,"object"==typeof E&&(E.placement&&(h=E.placement),E.rects&&(c=!0===E.rects?await r.getElementRects({reference:e,floating:t,strategy:i}):E.rects),({x:d,y:u}=I(c,h,a))),n=-1)}return{x:d,y:u,placement:h,strategy:i,middlewareData:p}})(e,t,{...i,platform:s})}},8223(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.BREAKPOINTS=t.COMBO_BOX_ACCESSIBILITY_KEY_SET=t.SELECT_ACCESSIBILITY_KEY_SET=t.TABS_ACCESSIBILITY_KEY_SET=t.OVERLAY_ACCESSIBILITY_KEY_SET=t.DROPDOWN_ACCESSIBILITY_KEY_SET=t.POSITIONS=void 0,t.POSITIONS={auto:"auto","auto-start":"auto-start","auto-end":"auto-end",top:"top","top-left":"top-start","top-right":"top-end",bottom:"bottom","bottom-left":"bottom-start","bottom-right":"bottom-end",right:"right","right-start":"right-start","right-end":"right-end",left:"left","left-start":"left-start","left-end":"left-end"},t.DROPDOWN_ACCESSIBILITY_KEY_SET=["Escape","ArrowUp","ArrowDown","ArrowRight","ArrowLeft","Home","End","Enter"],t.OVERLAY_ACCESSIBILITY_KEY_SET=["Escape","Tab"],t.TABS_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End"],t.SELECT_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter","Space","Tab"],t.COMBO_BOX_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter"],t.BREAKPOINTS={xs:0,sm:640,md:768,lg:1024,xl:1280,"2xl":1536}},248(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});const o=n(292);t.default=class{constructor(){this.components=[],this.currentlyOpenedComponents=[],this.activeComponent=null,this.allowedKeybindings=new Set(["Escape","Enter"," ","Space","ArrowDown","ArrowUp","ArrowLeft","ArrowRight","Tab","Home","End"]),this.initGlobalListeners()}initGlobalListeners(){document.addEventListener("keydown",e=>this.handleGlobalKeydown(e)),document.addEventListener("focusin",e=>this.handleGlobalFocusin(e))}isAllowedKeybinding(e){return!!this.allowedKeybindings.has(e.key)||!(1!==e.key.length||!/^[a-zA-Z]$/.test(e.key)||e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)}getActiveComponent(e){if(!e)return null;const t=this.components.filter(t=>t.wrapper.contains(e)||t.context&&t.context.contains(e));if(0===t.length)return null;if(1===t.length)return t[0];let n=null,o=Number.MAX_SAFE_INTEGER;for(const i of t){let t=0,s=e;for(;s&&s!==i.wrapper&&s!==i.context;)t++,s=s.parentElement;t<o&&(o=t,n=i)}return n}getActiveComponentForKey(e,t){if(!e)return null;const n=this.components.filter(t=>t.wrapper.contains(e)||t.context&&t.context.contains(e));if(0===n.length)return null;const o=n.filter(e=>{const n=e.handlers;switch(t){case"Escape":return!!n.onEsc;case"Enter":return!!n.onEnter;case" ":case"Space":return!!n.onSpace;case"ArrowDown":case"ArrowUp":case"ArrowLeft":case"ArrowRight":return!!n.onArrow;case"Tab":return!!n.onTab||!!n.onShiftTab;case"Home":return!!n.onHome;case"End":return!!n.onEnd;default:return!!n.onFirstLetter}});if(0===o.length)return this.getActiveComponent(e);if(1===o.length)return o[0];let i=null,s=Number.MAX_SAFE_INTEGER;for(const t of o){let n=0,o=e;for(;o&&o!==t.wrapper&&o!==t.context;)n++,o=o.parentElement;n<s&&(s=n,i=t)}return i}getDistanceToComponent(e,t){let n=0,o=e;for(;o&&o!==t.wrapper&&o!==t.context;)n++,o=o.parentElement;return n}getComponentsByNesting(e){if(!e)return[];const t=this.components.filter(t=>t.wrapper.contains(e)||t.context&&t.context.contains(e));return t.length<=1?t:[...t].sort((t,n)=>this.getDistanceToComponent(e,n)-this.getDistanceToComponent(e,t))}getSequentialHandlersForKey(e,t){const n=this.getComponentsByNesting(e);return 0===n.length?[]:n.map(e=>"Enter"===t?e.handlers.onEnter:e.handlers.onSpace).filter(e=>"function"==typeof e)}executeSequentialHandlers(e,t){let n=!1,o=!1;for(const i of e){n=!0;if(!1===i(t)){o=!0;break}}return{called:n,stopped:o}}handleGlobalFocusin(e){const t=e.target;this.activeComponent=this.getActiveComponent(t)}handleGlobalKeydown(e){var t;const n=e.target;this.activeComponent=this.getActiveComponentForKey(n,e.key);const i=this.activeComponent,s="Enter"===e.key||" "===e.key||"Space"===e.key;if((i||s)&&this.isAllowedKeybinding(e))switch(e.key){case"Escape":if(!i)break;if(i.isOpened){if(i.handlers.onEsc){const t=i.handlers.onEsc();if(e.preventDefault(),e.stopPropagation(),!1===t){const e=this.findClosestOpenParent(n);(null==e?void 0:e.handlers.onEsc)&&e.handlers.onEsc()}}}else{const t=this.findClosestOpenParent(n);(null==t?void 0:t.handlers.onEsc)&&(t.handlers.onEsc(),e.preventDefault(),e.stopPropagation())}break;case"Enter":{const t=this.getSequentialHandlersForKey(n,"Enter");if(0===t.length)break;const{called:i,stopped:s}=this.executeSequentialHandlers(t,e);if(i&&!(0,o.isFormElement)(n)&&(e.stopPropagation(),e.preventDefault()),s)break;break}case" ":case"Space":{if("INPUT"===n.tagName||"TEXTAREA"===n.tagName)return;const t=this.getActiveComponent(n),o=this.getSequentialHandlersForKey(n,"Space");if(0===o.length)break;const{stopped:i}=this.executeSequentialHandlers(o);(i||(null==t?void 0:t.handlers.onSpace))&&(e.preventDefault(),e.stopPropagation());break}case"ArrowDown":case"ArrowUp":case"ArrowLeft":case"ArrowRight":if(!i)break;if(i.handlers.onArrow){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;i.handlers.onArrow(e),e.preventDefault(),e.stopPropagation()}break;case"Tab":if(!i)break;if(!i.handlers.onTab)break;const s=e.shiftKey?i.handlers.onShiftTab:i.handlers.onTab;s&&s(e);break;case"Home":if(!i)break;i.handlers.onHome&&(i.handlers.onHome(),e.preventDefault(),e.stopPropagation());break;case"End":if(!i)break;i.handlers.onEnd&&(i.handlers.onEnd(),e.preventDefault(),e.stopPropagation());break;default:if(!i)break;if(i.handlers.onFirstLetter&&1===e.key.length&&/^[a-zA-Z]$/.test(e.key)){if(i.handlers.onFirstLetter(e.key),!(null===(t=i.stopPropagation)||void 0===t?void 0:t.onFirstLetter))return;e.preventDefault(),e.stopPropagation()}}}findClosestOpenParent(e){let t=e.parentElement;for(;t;){const e=this.currentlyOpenedComponents.find(e=>e.wrapper===t&&e!==this.activeComponent);if(e)return e;t=t.parentElement}return null}registerComponent(e,t,n=!0,o="",i="",s,r){const l={wrapper:e,handlers:t,isOpened:n,name:o,selector:i,context:s,isRegistered:!0,stopPropagation:r};return this.components.push(l),l}updateComponentState(e,t){e.isOpened=t,t?this.currentlyOpenedComponents.includes(e)||this.currentlyOpenedComponents.push(e):this.currentlyOpenedComponents=this.currentlyOpenedComponents.filter(t=>t!==e)}unregisterComponent(e){this.components=this.components.filter(t=>t!==e),this.currentlyOpenedComponents=this.currentlyOpenedComponents.filter(t=>t!==e)}addAllowedKeybinding(e){this.allowedKeybindings.add(e)}removeAllowedKeybinding(e){this.allowedKeybindings.delete(e)}getAllowedKeybindings(){return Array.from(this.allowedKeybindings)}}},2961(e,t){
/*
* HSBasePlugin
* @version: 4.2.0
* @author: Preline Labs Ltd.
* @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
* Copyright 2024 Preline Labs Ltd.
*/
Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(e,t,n){this.el=e,this.options=t,this.events=n,this.el=e,this.options=t,this.events={}}createCollection(e,t){var n,o;let i=e;if(!Array.isArray(i)&&"undefined"!=typeof window){const e=null===(n=this.constructor)||void 0===n?void 0:n.name,t="string"==typeof e&&e.startsWith("HS")?`$hs${e.slice(2)}Collection`:null;t&&(Array.isArray(window[t])||(window[t]=[]),i=window[t])}Array.isArray(i)&&i.push({id:(null===(o=null==t?void 0:t.el)||void 0===o?void 0:o.id)||i.length+1,element:t})}fireEvent(e,t=null){if(this.events.hasOwnProperty(e))return this.events[e](t)}on(e,t){this.events[e]=t}}},9608(e,t,n){
/*
* HSDropdown
* @version: 4.2.0
* @author: Preline Labs Ltd.
* @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
* Copyright 2024 Preline Labs Ltd.
*/
var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(292),s=n(949),r=o(n(2961)),l=o(n(248)),a=n(8223);class c extends r.default{constructor(e,t,n){super(e,t,n),this.longPressTimer=null,this.openedViaKeyboard=!1,this.onTouchStartListener=null,this.onTouchEndListener=null,this.toggle=this.el.querySelector(":scope > .hs-dropdown-toggle")||this.el.querySelector(":scope > .hs-dropdown-toggle-wrapper > .hs-dropdown-toggle")||this.el.children[0],this.closers=Array.from(this.el.querySelectorAll(":scope .hs-dropdown-close"))||null,this.menu=this.el.querySelector(":scope > .hs-dropdown-menu"),this.eventMode=(0,i.getClassProperty)(this.el,"--trigger","click"),this.closeMode=(0,i.getClassProperty)(this.el,"--auto-close","true"),this.hasAutofocus=(0,i.stringToBoolean)((0,i.getClassProperty)(this.el,"--has-autofocus","true")||"true"),this.autofocusOnKeyboardOnly=(0,i.stringToBoolean)((0,i.getClassProperty)(this.el,"--autofocus-on-keyboard-only","true")||"true"),this.animationInProcess=!1,this.onCloserClickListener=[],this.toggle&&this.menu&&this.init()}elementMouseEnter(){this.onMouseEnterHandler()}elementMouseLeave(){this.onMouseLeaveHandler()}toggleClick(e){this.onClickHandler(e)}toggleContextMenu(e){e.preventDefault(),this.onContextMenuHandler(e)}handleTouchStart(e){this.longPressTimer=window.setTimeout(()=>{e.preventDefault();const t=e.touches[0],n=new MouseEvent("contextmenu",{bubbles:!0,cancelable:!0,view:window,clientX:t.clientX,clientY:t.clientY});this.toggle&&this.toggle.dispatchEvent(n)},400)}handleTouchEnd(e){this.longPressTimer&&(clearTimeout(this.longPressTimer),this.longPressTimer=null)}closerClick(){this.close()}init(){if(c.ensureGlobalHandlers(),this.createCollection(window.$hsDropdownCollection,this),this.toggle.disabled)return!1;this.toggle&&this.buildToggle(),this.menu&&this.buildMenu(),this.closers&&this.buildClosers(),(0,i.isIOS)()||(0,i.isIpadOS)()||(this.onElementMouseEnterListener=()=>this.elementMouseEnter(),this.onElementMouseLeaveListener=()=>this.elementMouseLeave(),this.el.addEventListener("mouseenter",this.onElementMouseEnterListener),this.el.addEventListener("mouseleave",this.onElementMouseLeaveListener)),"undefined"!=typeof window&&(window.HSAccessibilityObserver||(window.HSAccessibilityObserver=new l.default),this.setupAccessibility())}resizeHandler(){this.eventMode=(0,i.getClassProperty)(this.el,"--trigger","click"),this.closeMode=(0,i.getClassProperty)(this.el,"--auto-close","true"),this.hasAutofocus=(0,i.stringToBoolean)((0,i.getClassProperty)(this.el,"--has-autofocus","true")||"true"),this.autofocusOnKeyboardOnly=(0,i.stringToBoolean)((0,i.getClassProperty)(this.el,"--autofocus-on-keyboard-only","true")||"true")}isOpen(){return this.el.classList.contains("open")&&!this.menu.classList.contains("hidden")}buildToggle(){var e;(null===(e=null==this?void 0:this.toggle)||void 0===e?void 0:e.ariaExpanded)&&(this.el.classList.contains("open")?this.toggle.ariaExpanded="true":this.toggle.ariaExpanded="false"),"contextmenu"===this.eventMode?(this.onToggleContextMenuListener=e=>this.toggleContextMenu(e),this.onTouchStartListener=this.handleTouchStart.bind(this),this.onTouchEndListener=this.handleTouchEnd.bind(this),this.toggle.addEventListener("contextmenu",this.onToggleContextMenuListener),this.toggle.addEventListener("touchstart",this.onTouchStartListener,{passive:!1}),this.toggle.addEventListener("touchend",this.onTouchEndListener),this.toggle.addEventListener("touchmove",this.onTouchEndListener)):(this.onToggleClickListener=e=>this.toggleClick(e),this.toggle.addEventListener("click",this.onToggleClickListener))}buildMenu(){this.menu.role=this.menu.getAttribute("role")||"menu",this.menu.tabIndex=-1;const e=this.menu.querySelectorAll('[role="menuitemcheckbox"]'),t=this.menu.querySelectorAll('[role="menuitemradio"]');e.forEach(e=>e.addEventListener("click",()=>this.selectCheckbox(e))),t.forEach(e=>e.addEventListener("click",()=>this.selectRadio(e))),this.menu.addEventListener("click",e=>{const t=e.target;"INPUT"===t.tagName||"TEXTAREA"===t.tagName||"SELECT"===t.tagName||"BUTTON"===t.tagName||"A"===t.tagName||t.closest("button")||t.closest("a")||t.closest("input")||t.closest("textarea")||t.closest("select")||this.menu.focus()})}buildClosers(){this.closers.forEach(e=>{this.onCloserClickListener.push({el:e,fn:()=>this.closerClick()}),e.addEventListener("click",this.onCloserClickListener.find(t=>t.el===e).fn)})}getScrollbarSize(){let e=document.createElement("div");e.style.overflow="scroll",e.style.width="100px",e.style.height="100px",document.body.appendChild(e);let t=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),t}onContextMenuHandler(e){const t={getBoundingClientRect:(()=>new DOMRect,()=>new DOMRect(e.clientX,e.clientY,0,0))};c.closeCurrentlyOpened(),this.el.classList.contains("open")&&!this.menu.classList.contains("hidden")?(this.close(),document.body.style.overflow="",document.body.style.paddingRight=""):(document.body.style.overflow="hidden",document.body.style.paddingRight=`${this.getScrollbarSize()}px`,this.open(t))}onClickHandler(e){var t;if("hover"===this.eventMode&&window.matchMedia("(hover: hover)").matches&&"mouse"===e.pointerType){const n=e.currentTarget;return"A"===n.tagName&&n.hasAttribute("href")&&"#"!==n.getAttribute("href")||(e.preventDefault(),e.stopPropagation(),null===(t=e.stopImmediatePropagation)||void 0===t||t.call(e)),!1}this.el.classList.contains("open")&&!this.menu.classList.contains("hidden")?this.close():this.open()}onMouseEnterHandler(){if("hover"!==this.eventMode)return!1;(!this.el._floatingUI||this.el._floatingUI&&!this.el.classList.contains("open"))&&this.forceClearState(),!this.el.classList.contains("open")&&this.menu.classList.contains("hidden")&&this.open()}onMouseLeaveHandler(){if("hover"!==this.eventMode)return!1;this.el.classList.contains("open")&&!this.menu.classList.contains("hidden")&&this.close()}destroyFloatingUI(){const e=(window.getComputedStyle(this.el).getPropertyValue("--scope")||"").trim();this.menu.classList.remove("block"),this.menu.classList.add("hidden"),this.menu.style.inset=null,this.menu.style.position=null,this.el&&this.el._floatingUI&&(this.el._floatingUI.destroy(),this.el._floatingUI=null),"window"===e&&this.el.appendChild(this.menu),this.animationInProcess=!1}focusElement(){const e=this.menu.querySelector("[autofocus]");if(e)return e.focus(),!0;const t=this.menu.querySelectorAll('a:not([hidden]), button:not([hidden]), [role="menuitem"]:not([hidden])');if(t.length>0){return t[0].focus(),!0}return!1}setupFloatingUI(e){const t=e||this.el,n=window.getComputedStyle(this.el),o=(n.getPropertyValue("--placement")||"").trim(),i=(n.getPropertyValue("--flip")||"true").trim(),r=(n.getPropertyValue("--strategy")||"fixed").trim(),l=(n.getPropertyValue("--offset")||"10").trim(),c=(n.getPropertyValue("--gpu-acceleration")||"true").trim(),d=(window.getComputedStyle(this.el).getPropertyValue("--adaptive")||"adaptive").replace(" ",""),u=r,h=parseInt(l,10),f=a.POSITIONS[o]||"bottom-start",p=[..."true"===i?[(0,s.flip)()]:[],(0,s.offset)(h)],m={placement:f,strategy:u,middleware:p};"fixed"===u&&Object.assign(this.menu.style,{position:u});const g=e=>{const t=this.menu.getBoundingClientRect(),n=window.innerWidth-(window.innerWidth-document.documentElement.clientWidth);return e+t.width>n&&(e=n-t.width),e<0&&(e=0),e},y=()=>{(0,s.computePosition)(t,this.menu,m).then(({x:e,y:t,placement:n})=>{const o=g(e);"absolute"===u&&"none"===d?Object.assign(this.menu.style,{position:u,margin:"0"}):"absolute"===u?Object.assign(this.menu.style,{position:u,transform:`translate3d(${e}px, ${t}px, 0px)`,margin:"0"}):"true"===c?Object.assign(this.menu.style,{position:u,left:"",top:"",inset:"0px auto auto 0px",margin:"0",transform:`translate3d(${"adaptive"===d?o:0}px, ${t}px, 0)`}):Object.assign(this.menu.style,{position:u,left:`${e}px`,top:`${t}px`,transform:""}),this.menu.setAttribute("data-placement",n)})};y();return{update:y,destroy:(0,s.autoUpdate)(t,this.menu,y)}}selectCheckbox(e){e.ariaChecked="true"===e.ariaChecked?"false":"true"}selectRadio(e){if("true"===e.ariaChecked)return!1;const t=e.closest(".group").querySelectorAll('[role="menuitemradio"]');Array.from(t).filter(t=>t!==e).forEach(e=>{e.ariaChecked="false"}),e.ariaChecked="true"}calculatePopperPosition(e){const t=this.setupFloatingUI(e),n=this.menu.getAttribute("data-placement");return t.update(),t.destroy(),n}open(e,t=!1){if(this.el.classList.contains("open")||this.animationInProcess)return!1;this.openedViaKeyboard=t,this.animationInProcess=!0,this.menu.style.cssText="";const n=e||this.el,o=window.getComputedStyle(this.el),s=(o.getPropertyValue("--scope")||"").trim(),r=(o.getPropertyValue("--strategy")||"fixed").trim();"window"===s&&document.body.appendChild(this.menu),"static"!==r&&(this.el._floatingUI=this.setupFloatingUI(n)),this.menu.style.margin=null,this.menu.classList.remove("hidden"),this.menu.classList.add("block"),setTimeout(()=>{var e;(null===(e=null==this?void 0:this.toggle)||void 0===e?void 0:e.ariaExpanded)&&(this.toggle.ariaExpanded="true"),this.el.classList.add("open"),window.HSAccessibilityObserver&&this.accessibilityComponent&&window.HSAccessibilityObserver.updateComponentState(this.accessibilityComponent,!0),"window"===s&&this.menu.classList.add("open"),this.animationInProcess=!1,!this.hasAutofocus||this.autofocusOnKeyboardOnly&&!this.openedViaKeyboard||this.focusElement(),this.fireEvent("open",this.el),(0,i.dispatch)("open.hs.dropdown",this.el,this.el)})}close(e=!0){if(this.animationInProcess||!this.el.classList.contains("open"))return!1;const t=(window.getComputedStyle(this.el).getPropertyValue("--scope")||"").trim();if(this.animationInProcess=!0,"window"===t&&this.menu.classList.remove("open"),window.HSAccessibilityObserver&&this.accessibilityComponent&&window.HSAccessibilityObserver.updateComponentState(this.accessibilityComponent,!1),e){const e=this.el.querySelector("[data-hs-dropdown-transition]")||this.menu;let t=!1;const n=()=>{t||(t=!0,this.destroyFloatingUI())};(0,i.afterTransition)(e,n);const o=window.getComputedStyle(e).getPropertyValue("transition-duration"),s=1e3*parseFloat(o)||150;setTimeout(n,s+50)}else this.destroyFloatingUI();(()=>{var e;this.menu.style.margin=null,(null===(e=null==this?void 0:this.toggle)||void 0===e?void 0:e.ariaExpanded)&&(this.toggle.ariaExpanded="false"),this.el.classList.remove("open"),this.openedViaKeyboard=!1,this.fireEvent("close",this.el),(0,i.dispatch)("close.hs.dropdown",this.el,this.el)})()}forceClearState(){this.destroyFloatingUI(),this.menu.style.margin=null,this.el.classList.remove("open"),this.menu.classList.add("hidden"),this.openedViaKeyboard=!1}destroy(){(0,i.isIOS)()||(0,i.isIpadOS)()||(this.el.removeEventListener("mouseenter",this.onElementMouseEnterListener),this.el.removeEventListener("mouseleave",()=>this.onElementMouseLeaveListener),this.onElementMouseEnterListener=null,this.onElementMouseLeaveListener=null),"contextmenu"===this.eventMode?(this.toggle&&(this.toggle.removeEventListener("contextmenu",this.onToggleContextMenuListener),this.toggle.removeEventListener("touchstart",this.onTouchStartListener),this.toggle.removeEventListener("touchend",this.onTouchEndListener),this.toggle.removeEventListener("touchmove",this.onTouchEndListener)),this.onToggleContextMenuListener=null,this.onTouchStartListener=null,this.onTouchEndListener=null):(this.toggle&&this.toggle.removeEventListener("click",this.onToggleClickListener),this.onToggleClickListener=null),this.closers.length&&(this.closers.forEach(e=>{e.removeEventListener("click",this.onCloserClickListener.find(t=>t.el===e).fn)}),this.onCloserClickListener=null),this.el.classList.remove("open"),this.destroyFloatingUI(),window.$hsDropdownCollection=window.$hsDropdownCollection.filter(({element:e})=>e.el!==this.el)}static findInCollection(e){return window.$hsDropdownCollection.find(t=>e instanceof c?t.element.el===e.el:"string"==typeof e?t.element.el===document.querySelector(e):t.element.el===e)||null}static getInstance(e,t){const n=window.$hsDropdownCollection.find(t=>t.element.el===("string"==typeof e?document.querySelector(e):e));return n?t?n:n.element:null}static autoInit(){c.ensureGlobalHandlers(),window.$hsDropdownCollection&&(window.$hsDropdownCollection=window.$hsDropdownCollection.filter(({element:e})=>document.contains(e.el))),document.querySelectorAll(".hs-dropdown:not(.--prevent-on-load-init)").forEach(e=>{window.$hsDropdownCollection.find(t=>{var n;return(null===(n=null==t?void 0:t.element)||void 0===n?void 0:n.el)===e})||new c(e)})}static ensureGlobalHandlers(){if("undefined"==typeof window)return;if(window.$hsDropdownCollection||(window.$hsDropdownCollection=[]),c.globalListenersInitialized)return;c.globalListenersInitialized=!0,window.addEventListener("click",e=>{const t=e.target;c.closeCurrentlyOpened(t)});let e=window.innerWidth;window.addEventListener("resize",()=>{window.innerWidth!==e&&(e=innerWidth,c.closeCurrentlyOpened(null,!1))})}static open(e,t=!1){const n=c.findInCollection(e);n&&n.element.menu.classList.contains("hidden")&&n.element.open(void 0,t)}static close(e){const t=c.findInCollection(e);t&&!t.element.menu.classList.contains("hidden")&&t.element.close()}static closeCurrentlyOpened(e=null,t=!0){const n=e&&e.closest(".hs-dropdown")&&e.closest(".hs-dropdown").parentElement.closest(".hs-dropdown")?e.closest(".hs-dropdown").parentElement.closest(".hs-dropdown"):null;let o=n?window.$hsDropdownCollection.filter(e=>e.element.el.classList.contains("open")&&e.element.menu.closest(".hs-dropdown").parentElement.closest(".hs-dropdown")===n):window.$hsDropdownCollection.filter(e=>e.element.el.classList.contains("open"));if(e){const t=e.closest(".hs-dropdown");if(t)"inside"===(0,i.getClassPropertyAlt)(t,"--auto-close")&&(o=o.filter(e=>e.element.el!==t));else{const t=e.closest(".hs-dropdown-menu");if(t){const e=window.$hsDropdownCollection.find(e=>e.element.menu===t);e&&"inside"===(0,i.getClassPropertyAlt)(e.element.el,"--auto-close")&&(o=o.filter(t=>t.element.el!==e.element.el))}}}o&&o.forEach(e=>{if("false"===e.element.closeMode||"outside"===e.element.closeMode)return!1;e.element.close(t)}),o&&o.forEach(e=>{if("contextmenu"!==(0,i.getClassPropertyAlt)(e.element.el,"--trigger"))return!1;document.body.style.overflow="",document.body.style.paddingRight=""})}setupAccessibility(){this.accessibilityComponent=window.HSAccessibilityObserver.registerComponent(this.el,{onEnter:()=>{var e;const t=document.activeElement;if(!t)return;if(t.closest(".hs-dropdown-menu")){const n=t.closest(".hs-dropdown-toggle, [data-hs-dropdown-toggle]");if(n)return void n.click();const o=t.closest('[role="menuitem"], a, button, [data-hs-dropdown-item]');if((null===(e=null==o?void 0:o.children)||void 0===e?void 0:e.length)>0)return Array.from(o.children).forEach(e=>{e.matches("input[type='checkbox']:not([hidden]), input[type='radio']:not([hidden])")&&e.click()}),void o.focus();if(o){if(t.matches("input, textarea, select"))return;o.click()}return}this.isOpened()?this.close():this.open(void 0,!0)},onSpace:()=>{this.isOpened()||this.open(void 0,!0)},onEsc:()=>{this.isOpened()&&(this.close(),this.toggle&&this.toggle.focus())},onArrow:e=>{if(!e.metaKey)switch(e.key){case"ArrowDown":this.isOpened()?this.focusMenuItem("next"):this.open(void 0,!0);break;case"ArrowUp":this.isOpened()&&this.focusMenuItem("prev");break;case"ArrowRight":this.onArrowX(e,"right");break;case"ArrowLeft":this.onArrowX(e,"left")}},onHome:()=>{this.isOpened()&&this.onStartEnd(!0)},onEnd:()=>{this.isOpened()&&this.onStartEnd(!1)},onTab:()=>{setTimeout(()=>{const e=document.activeElement,t=e.closest(".hs-dropdown-menu");if(e&&t){const t=e.closest(".hs-dropdown-toggle, [data-hs-dropdown-toggle]");return t?void t.click():void e.focus()}this.isOpened()&&this.close()},100)},onFirstLetter:e=>{const t=document.activeElement;!(null==t?void 0:t.matches("input, textarea"))&&this.isOpened()&&this.onFirstLetter(e)}},this.isOpened(),"Dropdown",".hs-dropdown",this.menu,{onFirstLetter:!1})}onFirstLetter(e){var t;if(!this.isOpened()||!this.menu)return;const n=this.menu.querySelectorAll('a:not([hidden]), button:not([hidden]), [role="menuitem"]:not([hidden])');if(0===n.length)return;const o=Array.from(n).indexOf(document.activeElement);for(let i=1;i<=n.length;i++){const s=(o+i)%n.length;if(((null===(t=n[s].textContent)||void 0===t?void 0:t.trim().toLowerCase())||"").startsWith(e.toLowerCase()))return void n[s].focus()}n[0].focus()}onArrowX(e,t){if(!this.isOpened())return;e.preventDefault(),e.stopImmediatePropagation();const n=this.menu.querySelectorAll('a:not([hidden]), button:not([hidden]), [role="menuitem"]:not([hidden])');if(!n.length)return;const o=Array.from(n).indexOf(document.activeElement);let i=-1;i="right"===t?(o+1)%n.length:o>0?o-1:n.length-1,n[i].focus()}onStartEnd(e=!0){if(!this.isOpened())return;const t=this.menu.querySelectorAll('a:not([hidden]), button:not([hidden]), [role="menuitem"]:not([hidden])');if(!t.length)return;t[e?0:t.length-1].focus()}focusMenuItem(e){const t=this.menu.querySelectorAll('a:not([hidden]), button:not([hidden]), [role="menuitem"]:not([hidden])');if(!t.length)return;const n=Array.from(t).indexOf(document.activeElement);t["next"===e?(n+1)%t.length:(n-1+t.length)%t.length].focus()}static on(e,t,n){const o=c.findInCollection(t);o&&(o.element.events[e]=n)}isOpened(){return this.isOpen()}containsElement(e){return this.el.contains(e)}}c.globalListenersInitialized=!1,t.default=c},292(e,t){
/*
* @version: 4.2.0
* @author: Preline Labs Ltd.
* @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
* Copyright 2024 Preline Labs Ltd.
*/
Object.defineProperty(t,"__esModule",{value:!0}),t.stringToBoolean=t.menuSearchHistory=t.isScrollable=t.isParentOrElementHidden=t.isJson=t.isIpadOS=t.isIOS=t.isFormElement=t.isFocused=t.isEnoughSpace=t.isDirectChild=t.htmlToElement=t.getZIndex=t.getHighestZIndex=t.getClassPropertyAlt=t.getClassProperty=t.dispatch=t.debounce=t.classToClassList=t.afterTransition=void 0;t.stringToBoolean=e=>"true"===e;t.getClassProperty=(e,t,n="")=>(window.getComputedStyle(e).getPropertyValue(t)||n).replace(" ","");t.getClassPropertyAlt=(e,t,n="")=>{let o="";return e.classList.forEach(e=>{e.includes(t)&&(o=e)}),o.match(/:(.*)]/)?o.match(/:(.*)]/)[1]:n};const n=e=>window.getComputedStyle(e).getPropertyValue("z-index");t.getZIndex=n;t.getHighestZIndex=e=>{let t=Number.NEGATIVE_INFINITY;return e.forEach(e=>{let o=n(e);"auto"!==o&&(o=parseInt(o,10),o>t&&(t=o))}),t};t.isDirectChild=(e,t)=>{const n=e.children;for(let e=0;e<n.length;e++)if(n[e]===t)return!0;return!1};t.isEnoughSpace=(e,t,n="auto",o=10,i=null)=>{const s=t.getBoundingClientRect(),r=i?i.getBoundingClientRect():null,l=window.innerHeight,a=r?s.top-r.top:s.top,c=(i?r.bottom:l)-s.bottom,d=e.clientHeight+o;return"bottom"===n?c>=d:"top"===n?a>=d:a>=d||c>=d};t.isFocused=e=>document.activeElement===e;t.isFormElement=e=>e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement;t.isIOS=()=>!!/iPad|iPhone|iPod/.test(navigator.platform)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform);t.isIpadOS=()=>navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform);t.isJson=e=>{if("string"!=typeof e)return!1;const t=e.trim()[0],n=e.trim().slice(-1);if("{"===t&&"}"===n||"["===t&&"]"===n)try{return JSON.parse(e),!0}catch(e){return!1}return!1};const o=e=>{if(!e)return!1;return"none"===window.getComputedStyle(e).display||o(e.parentElement)};t.isParentOrElementHidden=o;t.isScrollable=e=>{const t=window.getComputedStyle(e),n=t.overflowY,o=t.overflowX,i=("scroll"===n||"auto"===n)&&e.scrollHeight>e.clientHeight,s=("scroll"===o||"auto"===o)&&e.scrollWidth>e.clientWidth;return i||s};t.debounce=(e,t=200)=>{let n;return(...o)=>{clearTimeout(n),n=setTimeout(()=>{e.apply(this,o)},t)}};t.dispatch=(e,t,n=null)=>{const o=new CustomEvent(e,{detail:{payload:n},bubbles:!0,cancelable:!0,composed:!1});t.dispatchEvent(o)};t.afterTransition=(e,t)=>{const n=()=>{t(),e.removeEventListener("transitionend",n,!0)},o=window.getComputedStyle(e),i=o.getPropertyValue("transition-duration");"none"!==o.getProp