preline
Version:
Preline UI is an open-source set of prebuilt UI components based on the utility-first Tailwind CSS framework.
24 lines • 35.4 kB
JavaScript
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var o in n)("object"==typeof exports?exports:t)[o]=n[o]}}(self,()=>(()=>{"use strict";var t={949(t,e,n){n.r(e),n.d(e,{arrow:()=>Pt,autoPlacement:()=>Ct,autoUpdate:()=>Tt,computePosition:()=>Ht,detectOverflow:()=>Et,flip:()=>At,getOverflowAncestors:()=>it,hide:()=>Ot,inline:()=>Rt,limitShift:()=>_t,offset:()=>Lt,platform:()=>xt,shift:()=>St,size:()=>It});const o=["top","right","bottom","left"],i=["start","end"],r=o.reduce((t,e)=>t.concat(e,e+"-"+i[0],e+"-"+i[1]),[]),s=Math.min,l=Math.max,a=Math.round,c=Math.floor,f=t=>({x:t,y:t}),u={left:"right",right:"left",bottom:"top",top:"bottom"};function h(t,e,n){return l(t,s(e,n))}function d(t,e){return"function"==typeof t?t(e):t}function g(t){return t.split("-")[0]}function p(t){return t.split("-")[1]}function m(t){return"x"===t?"y":"x"}function w(t){return"y"===t?"height":"width"}function y(t){const e=t[0];return"t"===e||"b"===e?"y":"x"}function v(t){return m(y(t))}function x(t,e,n){void 0===n&&(n=!1);const o=p(t),i=v(t),r=w(i);let s="x"===i?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=A(s)),[s,A(s)]}function b(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const T=["left","right"],E=["right","left"],L=["top","bottom"],C=["bottom","top"];function S(t,e,n,o){const i=p(t);let r=function(t,e,n){switch(t){case"top":case"bottom":return n?e?E:T:e?T:E;case"left":case"right":return e?L:C;default:return[]}}(g(t),"start"===n,o);return i&&(r=r.map(t=>t+"-"+i),e&&(r=r.concat(r.map(b)))),r}function A(t){const e=g(t);return u[e]+t.slice(e.length)}function I(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function O(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function P(t,e,n){let{reference:o,floating:i}=t;const r=y(e),s=v(e),l=w(s),a=g(e),c="y"===r,f=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 d;switch(a){case"top":d={x:f,y:o.y-i.height};break;case"bottom":d={x:f,y:o.y+o.height};break;case"right":d={x:o.x+o.width,y:u};break;case"left":d={x:o.x-i.width,y:u};break;default:d={x:o.x,y:o.y}}switch(p(e)){case"start":d[s]-=h*(n&&c?-1:1);break;case"end":d[s]+=h*(n&&c?-1:1)}return d}async function R(t,e){var n;void 0===e&&(e={});const{x:o,y:i,platform:r,rects:s,elements:l,strategy:a}=t,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:u="floating",altBoundary:h=!1,padding:g=0}=d(e,t),p=I(g),m=l[h?"floating"===u?"reference":"floating":u],w=O(await r.getClippingRect({element:null==(n=await(null==r.isElement?void 0:r.isElement(m)))||n?m:m.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(l.floating)),boundary:c,rootBoundary:f,strategy:a})),y="floating"===u?{x:o,y:i,width:s.floating.width,height:s.floating.height}:s.reference,v=await(null==r.getOffsetParent?void 0:r.getOffsetParent(l.floating)),x=await(null==r.isElement?void 0:r.isElement(v))&&await(null==r.getScale?void 0:r.getScale(v))||{x:1,y:1},b=O(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:v,strategy:a}):y);return{top:(w.top-b.top+p.top)/x.y,bottom:(b.bottom-w.bottom+p.bottom)/x.y,left:(w.left-b.left+p.left)/x.x,right:(b.right-w.right+p.right)/x.x}}function _(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function H(t){return o.some(e=>t[e]>=0)}function M(t){const e=s(...t.map(t=>t.left)),n=s(...t.map(t=>t.top));return{x:e,y:n,width:l(...t.map(t=>t.right))-e,height:l(...t.map(t=>t.bottom))-n}}const D=new Set(["left","top"]);function B(){return"undefined"!=typeof window}function F(t){return $(t)?(t.nodeName||"").toLowerCase():"#document"}function k(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function Y(t){var e;return null==(e=($(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function $(t){return!!B()&&(t instanceof Node||t instanceof k(t).Node)}function U(t){return!!B()&&(t instanceof Element||t instanceof k(t).Element)}function W(t){return!!B()&&(t instanceof HTMLElement||t instanceof k(t).HTMLElement)}function N(t){return!(!B()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof k(t).ShadowRoot)}function V(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=tt(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&"inline"!==i&&"contents"!==i}function j(t){return/^(table|td|th)$/.test(F(t))}function K(t){try{if(t.matches(":popover-open"))return!0}catch(t){}try{return t.matches(":modal")}catch(t){return!1}}const z=/transform|translate|scale|rotate|perspective|filter/,q=/paint|layout|strict|content/,X=t=>!!t&&"none"!==t;let Z;function J(t){const e=U(t)?tt(t):t;return X(e.transform)||X(e.translate)||X(e.scale)||X(e.rotate)||X(e.perspective)||!G()&&(X(e.backdropFilter)||X(e.filter))||z.test(e.willChange||"")||q.test(e.contain||"")}function G(){return null==Z&&(Z="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Z}function Q(t){return/^(html|body|#document)$/.test(F(t))}function tt(t){return k(t).getComputedStyle(t)}function et(t){return U(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function nt(t){if("html"===F(t))return t;const e=t.assignedSlot||t.parentNode||N(t)&&t.host||Y(t);return N(e)?e.host:e}function ot(t){const e=nt(t);return Q(e)?t.ownerDocument?t.ownerDocument.body:t.body:W(e)&&V(e)?e:ot(e)}function it(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const i=ot(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),s=k(i);if(r){const t=rt(s);return e.concat(s,s.visualViewport||[],V(i)?i:[],t&&n?it(t):[])}return e.concat(i,it(i,[],n))}function rt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function st(t){const e=tt(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=W(t),r=i?t.offsetWidth:n,s=i?t.offsetHeight:o,l=a(n)!==r||a(o)!==s;return l&&(n=r,o=s),{width:n,height:o,$:l}}function lt(t){return U(t)?t:t.contextElement}function at(t){const e=lt(t);if(!W(e))return f(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=st(e);let s=(r?a(n.width):n.width)/o,l=(r?a(n.height):n.height)/i;return s&&Number.isFinite(s)||(s=1),l&&Number.isFinite(l)||(l=1),{x:s,y:l}}const ct=f(0);function ft(t){const e=k(t);return G()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:ct}function ut(t,e,n,o){void 0===e&&(e=!1),void 0===n&&(n=!1);const i=t.getBoundingClientRect(),r=lt(t);let s=f(1);e&&(o?U(o)&&(s=at(o)):s=at(t));const l=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==k(t))&&e}(r,n,o)?ft(r):f(0);let a=(i.left+l.x)/s.x,c=(i.top+l.y)/s.y,u=i.width/s.x,h=i.height/s.y;if(r){const t=k(r),e=o&&U(o)?k(o):o;let n=t,i=rt(n);for(;i&&o&&e!==n;){const t=at(i),e=i.getBoundingClientRect(),o=tt(i),r=e.left+(i.clientLeft+parseFloat(o.paddingLeft))*t.x,s=e.top+(i.clientTop+parseFloat(o.paddingTop))*t.y;a*=t.x,c*=t.y,u*=t.x,h*=t.y,a+=r,c+=s,n=k(i),i=rt(n)}}return O({width:u,height:h,x:a,y:c})}function ht(t,e){const n=et(t).scrollLeft;return e?e.left+n:ut(Y(t)).left+n}function dt(t,e){const n=t.getBoundingClientRect();return{x:n.left+e.scrollLeft-ht(t,n),y:n.top+e.scrollTop}}function gt(t,e,n){let o;if("viewport"===e)o=function(t,e){const n=k(t),o=Y(t),i=n.visualViewport;let r=o.clientWidth,s=o.clientHeight,l=0,a=0;if(i){r=i.width,s=i.height;const t=G();(!t||t&&"fixed"===e)&&(l=i.offsetLeft,a=i.offsetTop)}const c=ht(o);if(c<=0){const t=o.ownerDocument,e=t.body,n=getComputedStyle(e),i="CSS1Compat"===t.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,s=Math.abs(o.clientWidth-e.clientWidth-i);s<=25&&(r-=s)}else c<=25&&(r+=c);return{width:r,height:s,x:l,y:a}}(t,n);else if("document"===e)o=function(t){const e=Y(t),n=et(t),o=t.ownerDocument.body,i=l(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=l(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+ht(t);const a=-n.scrollTop;return"rtl"===tt(o).direction&&(s+=l(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:s,y:a}}(Y(t));else if(U(e))o=function(t,e){const n=ut(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=W(t)?at(t):f(1);return{width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:i*r.x,y:o*r.y}}(e,n);else{const n=ft(t);o={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return O(o)}function pt(t,e){const n=nt(t);return!(n===e||!U(n)||Q(n))&&("fixed"===tt(n).position||pt(n,e))}function mt(t,e,n){const o=W(e),i=Y(e),r="fixed"===n,s=ut(t,!0,r,e);let l={scrollLeft:0,scrollTop:0};const a=f(0);function c(){a.x=ht(i)}if(o||!o&&!r)if(("body"!==F(e)||V(i))&&(l=et(e)),o){const t=ut(e,!0,r,e);a.x=t.x+e.clientLeft,a.y=t.y+e.clientTop}else i&&c();r&&!o&&i&&c();const u=!i||o||r?f(0):dt(i,l);return{x:s.left+l.scrollLeft-a.x-u.x,y:s.top+l.scrollTop-a.y-u.y,width:s.width,height:s.height}}function wt(t){return"static"===tt(t).position}function yt(t,e){if(!W(t)||"fixed"===tt(t).position)return null;if(e)return e(t);let n=t.offsetParent;return Y(t)===n&&(n=n.ownerDocument.body),n}function vt(t,e){const n=k(t);if(K(t))return n;if(!W(t)){let e=nt(t);for(;e&&!Q(e);){if(U(e)&&!wt(e))return e;e=nt(e)}return n}let o=yt(t,e);for(;o&&j(o)&&wt(o);)o=yt(o,e);return o&&Q(o)&&wt(o)&&!J(o)?n:o||function(t){let e=nt(t);for(;W(e)&&!Q(e);){if(J(e))return e;if(K(e))return null;e=nt(e)}return null}(t)||n}const xt={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const r="fixed"===i,s=Y(o),l=!!e&&K(e.floating);if(o===s||l&&r)return n;let a={scrollLeft:0,scrollTop:0},c=f(1);const u=f(0),h=W(o);if((h||!h&&!r)&&(("body"!==F(o)||V(s))&&(a=et(o)),h)){const t=ut(o);c=at(o),u.x=t.x+o.clientLeft,u.y=t.y+o.clientTop}const d=!s||h||r?f(0):dt(s,a);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-a.scrollLeft*c.x+u.x+d.x,y:n.y*c.y-a.scrollTop*c.y+u.y+d.y}},getDocumentElement:Y,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const r=[..."clippingAncestors"===n?K(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let o=it(t,[],!1).filter(t=>U(t)&&"body"!==F(t)),i=null;const r="fixed"===tt(t).position;let s=r?nt(t):t;for(;U(s)&&!Q(s);){const e=tt(s),n=J(s);n||"fixed"!==e.position||(i=null),(r?!n&&!i:!n&&"static"===e.position&&i&&("absolute"===i.position||"fixed"===i.position)||V(s)&&!n&&pt(t,s))?o=o.filter(t=>t!==s):i=e,s=nt(s)}return e.set(t,o),o}(e,this._c):[].concat(n),o],a=gt(e,r[0],i);let c=a.top,f=a.right,u=a.bottom,h=a.left;for(let t=1;t<r.length;t++){const n=gt(e,r[t],i);c=l(n.top,c),f=s(n.right,f),u=s(n.bottom,u),h=l(n.left,h)}return{width:f-h,height:u-c,x:h,y:c}},getOffsetParent:vt,getElementRects:async function(t){const e=this.getOffsetParent||vt,n=this.getDimensions,o=await n(t.floating);return{reference:mt(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:n}=st(t);return{width:e,height:n}},getScale:at,isElement:U,isRTL:function(t){return"rtl"===tt(t).direction}};function bt(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Tt(t,e,n,o){void 0===o&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:f="function"==typeof IntersectionObserver,animationFrame:u=!1}=o,h=lt(t),d=i||r?[...h?it(h):[],...e?it(e):[]]:[];d.forEach(t=>{i&&t.addEventListener("scroll",n,{passive:!0}),r&&t.addEventListener("resize",n)});const g=h&&f?function(t,e){let n,o=null;const i=Y(t);function r(){var t;clearTimeout(n),null==(t=o)||t.disconnect(),o=null}return function a(f,u){void 0===f&&(f=!1),void 0===u&&(u=1),r();const h=t.getBoundingClientRect(),{left:d,top:g,width:p,height:m}=h;if(f||e(),!p||!m)return;const w={rootMargin:-c(g)+"px "+-c(i.clientWidth-(d+p))+"px "+-c(i.clientHeight-(g+m))+"px "+-c(d)+"px",threshold:l(0,s(1,u))||1};let y=!0;function v(e){const o=e[0].intersectionRatio;if(o!==u){if(!y)return a();o?a(!1,o):n=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==o||bt(h,t.getBoundingClientRect())||a(),y=!1}try{o=new IntersectionObserver(v,{...w,root:i.ownerDocument})}catch(t){o=new IntersectionObserver(v,w)}o.observe(t)}(!0),r}(h,n):null;let p,m=-1,w=null;a&&(w=new ResizeObserver(t=>{let[o]=t;o&&o.target===h&&w&&e&&(w.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var t;null==(t=w)||t.observe(e)})),n()}),h&&!u&&w.observe(h),e&&w.observe(e));let y=u?ut(t):null;return u&&function e(){const o=ut(t);y&&!bt(y,o)&&n();y=o,p=requestAnimationFrame(e)}(),n(),()=>{var t;d.forEach(t=>{i&&t.removeEventListener("scroll",n),r&&t.removeEventListener("resize",n)}),null==g||g(),null==(t=w)||t.disconnect(),w=null,u&&cancelAnimationFrame(p)}}const Et=R,Lt=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:r,placement:s,middlewareData:l}=e,a=await async function(t,e){const{placement:n,platform:o,elements:i}=t,r=await(null==o.isRTL?void 0:o.isRTL(i.floating)),s=g(n),l=p(n),a="y"===y(n),c=D.has(s)?-1:1,f=r&&a?-1:1,u=d(e,t);let{mainAxis:h,crossAxis:m,alignmentAxis:w}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return l&&"number"==typeof w&&(m="end"===l?-1*w:w),a?{x:m*f,y:h*c}:{x:h*c,y:m*f}}(e,t);return s===(null==(n=l.offset)?void 0:n.placement)&&null!=(o=l.arrow)&&o.alignmentOffset?{}:{x:i+a.x,y:r+a.y,data:{...a,placement:s}}}}},Ct=function(t){return void 0===t&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,o,i;const{rects:s,middlewareData:l,placement:a,platform:c,elements:f}=e,{crossAxis:u=!1,alignment:h,allowedPlacements:m=r,autoAlignment:w=!0,...y}=d(t,e),v=void 0!==h||m===r?function(t,e,n){return(t?[...n.filter(e=>p(e)===t),...n.filter(e=>p(e)!==t)]:n.filter(t=>g(t)===t)).filter(n=>!t||p(n)===t||!!e&&b(n)!==n)}(h||null,w,m):m,T=await c.detectOverflow(e,y),E=(null==(n=l.autoPlacement)?void 0:n.index)||0,L=v[E];if(null==L)return{};const C=x(L,s,await(null==c.isRTL?void 0:c.isRTL(f.floating)));if(a!==L)return{reset:{placement:v[0]}};const S=[T[g(L)],T[C[0]],T[C[1]]],A=[...(null==(o=l.autoPlacement)?void 0:o.overflows)||[],{placement:L,overflows:S}],I=v[E+1];if(I)return{data:{index:E+1,overflows:A},reset:{placement:I}};const O=A.map(t=>{const e=p(t.placement);return[t.placement,e&&u?t.overflows.slice(0,2).reduce((t,e)=>t+e,0):t.overflows[0],t.overflows]}).sort((t,e)=>t[1]-e[1]),P=(null==(i=O.filter(t=>t[2].slice(0,p(t[0])?2:3).every(t=>t<=0))[0])?void 0:i[0])||O[0][0];return P!==a?{data:{index:E+1,overflows:A},reset:{placement:P}}:{}}}},St=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i,platform:r}=e,{mainAxis:s=!0,crossAxis:l=!1,limiter:a={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...c}=d(t,e),f={x:n,y:o},u=await r.detectOverflow(e,c),p=y(g(i)),w=m(p);let v=f[w],x=f[p];if(s){const t="y"===w?"bottom":"right";v=h(v+u["y"===w?"top":"left"],v,v-u[t])}if(l){const t="y"===p?"bottom":"right";x=h(x+u["y"===p?"top":"left"],x,x-u[t])}const b=a.fn({...e,[w]:v,[p]:x});return{...b,data:{x:b.x-n,y:b.y-o,enabled:{[w]:s,[p]:l}}}}}},At=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:r,rects:s,initialPlacement:l,platform:a,elements:c}=e,{mainAxis:f=!0,crossAxis:u=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:w=!0,...v}=d(t,e);if(null!=(n=r.arrow)&&n.alignmentOffset)return{};const T=g(i),E=y(l),L=g(l)===l,C=await(null==a.isRTL?void 0:a.isRTL(c.floating)),I=h||(L||!w?[A(l)]:function(t){const e=A(t);return[b(t),e,b(e)]}(l)),O="none"!==m;!h&&O&&I.push(...S(l,w,m,C));const P=[l,...I],R=await a.detectOverflow(e,v),_=[];let H=(null==(o=r.flip)?void 0:o.overflows)||[];if(f&&_.push(R[T]),u){const t=x(i,s,C);_.push(R[t[0]],R[t[1]])}if(H=[...H,{placement:i,overflows:_}],!_.every(t=>t<=0)){var M,D;const t=((null==(M=r.flip)?void 0:M.index)||0)+1,e=P[t];if(e){if(!("alignment"===u&&E!==y(e))||H.every(t=>y(t.placement)!==E||t.overflows[0]>0))return{data:{index:t,overflows:H},reset:{placement:e}}}let n=null==(D=H.filter(t=>t.overflows[0]<=0).sort((t,e)=>t.overflows[1]-e.overflows[1])[0])?void 0:D.placement;if(!n)switch(p){case"bestFit":{var B;const t=null==(B=H.filter(t=>{if(O){const e=y(t.placement);return e===E||"y"===e}return!0}).map(t=>[t.placement,t.overflows.filter(t=>t>0).reduce((t,e)=>t+e,0)]).sort((t,e)=>t[1]-e[1])[0])?void 0:B[0];t&&(n=t);break}case"initialPlacement":n=l}if(i!==n)return{reset:{placement:n}}}return{}}}},It=function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(e){var n,o;const{placement:i,rects:r,platform:a,elements:c}=e,{apply:f=()=>{},...u}=d(t,e),h=await a.detectOverflow(e,u),m=g(i),w=p(i),v="y"===y(i),{width:x,height:b}=r.floating;let T,E;"top"===m||"bottom"===m?(T=m,E=w===(await(null==a.isRTL?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(E=m,T="end"===w?"top":"bottom");const L=b-h.top-h.bottom,C=x-h.left-h.right,S=s(b-h[T],L),A=s(x-h[E],C),I=!e.middlewareData.shift;let O=S,P=A;if(null!=(n=e.middlewareData.shift)&&n.enabled.x&&(P=C),null!=(o=e.middlewareData.shift)&&o.enabled.y&&(O=L),I&&!w){const t=l(h.left,0),e=l(h.right,0),n=l(h.top,0),o=l(h.bottom,0);v?P=x-2*(0!==t||0!==e?t+e:l(h.left,h.right)):O=b-2*(0!==n||0!==o?n+o:l(h.top,h.bottom))}await f({...e,availableWidth:P,availableHeight:O});const R=await a.getDimensions(c.floating);return x!==R.width||b!==R.height?{reset:{rects:!0}}:{}}}},Ot=function(t){return void 0===t&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:o}=e,{strategy:i="referenceHidden",...r}=d(t,e);switch(i){case"referenceHidden":{const t=_(await o.detectOverflow(e,{...r,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:t,referenceHidden:H(t)}}}case"escaped":{const t=_(await o.detectOverflow(e,{...r,altBoundary:!0}),n.floating);return{data:{escapedOffsets:t,escaped:H(t)}}}default:return{}}}}},Pt=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:i,rects:r,platform:l,elements:a,middlewareData:c}=e,{element:f,padding:u=0}=d(t,e)||{};if(null==f)return{};const g=I(u),m={x:n,y:o},y=v(i),x=w(y),b=await l.getDimensions(f),T="y"===y,E=T?"top":"left",L=T?"bottom":"right",C=T?"clientHeight":"clientWidth",S=r.reference[x]+r.reference[y]-m[y]-r.floating[x],A=m[y]-r.reference[y],O=await(null==l.getOffsetParent?void 0:l.getOffsetParent(f));let P=O?O[C]:0;P&&await(null==l.isElement?void 0:l.isElement(O))||(P=a.floating[C]||r.floating[x]);const R=S/2-A/2,_=P/2-b[x]/2-1,H=s(g[E],_),M=s(g[L],_),D=H,B=P-b[x]-M,F=P/2-b[x]/2+R,k=h(D,F,B),Y=!c.arrow&&null!=p(i)&&F!==k&&r.reference[x]/2-(F<D?H:M)-b[x]/2<0,$=Y?F<D?F-D:F-B:0;return{[y]:m[y]+$,data:{[y]:k,centerOffset:F-k-$,...Y&&{alignmentOffset:$}},reset:Y}}}),Rt=function(t){return void 0===t&&(t={}),{name:"inline",options:t,async fn(e){const{placement:n,elements:o,rects:i,platform:r,strategy:a}=e,{padding:c=2,x:f,y:u}=d(t,e),h=Array.from(await(null==r.getClientRects?void 0:r.getClientRects(o.reference))||[]),p=function(t){const e=t.slice().sort((t,e)=>t.y-e.y),n=[];let o=null;for(let t=0;t<e.length;t++){const i=e[t];!o||i.y-o.y>o.height/2?n.push([i]):n[n.length-1].push(i),o=i}return n.map(t=>O(M(t)))}(h),m=O(M(h)),w=I(c);const v=await r.getElementRects({reference:{getBoundingClientRect:function(){if(2===p.length&&p[0].left>p[1].right&&null!=f&&null!=u)return p.find(t=>f>t.left-w.left&&f<t.right+w.right&&u>t.top-w.top&&u<t.bottom+w.bottom)||m;if(p.length>=2){if("y"===y(n)){const t=p[0],e=p[p.length-1],o="top"===g(n),i=t.top,r=e.bottom,s=o?t.left:e.left,l=o?t.right:e.right;return{top:i,bottom:r,left:s,right:l,width:l-s,height:r-i,x:s,y:i}}const t="left"===g(n),e=l(...p.map(t=>t.right)),o=s(...p.map(t=>t.left)),i=p.filter(n=>t?n.left===o:n.right===e),r=i[0].top,a=i[i.length-1].bottom;return{top:r,bottom:a,left:o,right:e,width:e-o,height:a-r,x:o,y:r}}return m}},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}}:{}}}},_t=function(t){return void 0===t&&(t={}),{options:t,fn(e){const{x:n,y:o,placement:i,rects:r,middlewareData:s}=e,{offset:l=0,mainAxis:a=!0,crossAxis:c=!0}=d(t,e),f={x:n,y:o},u=y(i),h=m(u);let p=f[h],w=f[u];const v=d(l,e),x="number"==typeof v?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(a){const t="y"===h?"height":"width",e=r.reference[h]-r.floating[t]+x.mainAxis,n=r.reference[h]+r.reference[t]-x.mainAxis;p<e?p=e:p>n&&(p=n)}if(c){var b,T;const t="y"===h?"width":"height",e=D.has(g(i)),n=r.reference[u]-r.floating[t]+(e&&(null==(b=s.offset)?void 0:b[u])||0)+(e?0:x.crossAxis),o=r.reference[u]+r.reference[t]+(e?0:(null==(T=s.offset)?void 0:T[u])||0)-(e?x.crossAxis:0);w<n?w=n:w>o&&(w=o)}return{[h]:p,[u]:w}}}},Ht=(t,e,n)=>{const o=new Map,i={platform:xt,...n},r={...i.platform,_c:o};return(async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:s}=n,l=s.detectOverflow?s:{...s,detectOverflow:R},a=await(null==s.isRTL?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:u}=P(c,o,a),h=o,d=0;const g={};for(let n=0;n<r.length;n++){const p=r[n];if(!p)continue;const{name:m,fn:w}=p,{x:y,y:v,data:x,reset:b}=await w({x:f,y:u,initialPlacement:o,placement:h,strategy:i,middlewareData:g,rects:c,platform:l,elements:{reference:t,floating:e}});f=null!=y?y:f,u=null!=v?v:u,g[m]={...g[m],...x},b&&d<50&&(d++,"object"==typeof b&&(b.placement&&(h=b.placement),b.rects&&(c=!0===b.rects?await s.getElementRects({reference:t,floating:e,strategy:i}):b.rects),({x:f,y:u}=P(c,h,a))),n=-1)}return{x:f,y:u,placement:h,strategy:i,middlewareData:g}})(t,e,{...i,platform:r})}},8223(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BREAKPOINTS=e.COMBO_BOX_ACCESSIBILITY_KEY_SET=e.SELECT_ACCESSIBILITY_KEY_SET=e.TABS_ACCESSIBILITY_KEY_SET=e.OVERLAY_ACCESSIBILITY_KEY_SET=e.DROPDOWN_ACCESSIBILITY_KEY_SET=e.POSITIONS=void 0,e.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"},e.DROPDOWN_ACCESSIBILITY_KEY_SET=["Escape","ArrowUp","ArrowDown","ArrowRight","ArrowLeft","Home","End","Enter"],e.OVERLAY_ACCESSIBILITY_KEY_SET=["Escape","Tab"],e.TABS_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End"],e.SELECT_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter","Space","Tab"],e.COMBO_BOX_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter"],e.BREAKPOINTS={xs:0,sm:640,md:768,lg:1024,xl:1280,"2xl":1536}},2961(t,e){
/*
* 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(e,"__esModule",{value:!0});e.default=class{constructor(t,e,n){this.el=t,this.options=e,this.events=n,this.el=t,this.options=e,this.events={}}createCollection(t,e){var n,o;let i=t;if(!Array.isArray(i)&&"undefined"!=typeof window){const t=null===(n=this.constructor)||void 0===n?void 0:n.name,e="string"==typeof t&&t.startsWith("HS")?`$hs${t.slice(2)}Collection`:null;e&&(Array.isArray(window[e])||(window[e]=[]),i=window[e])}Array.isArray(i)&&i.push({id:(null===(o=null==e?void 0:e.el)||void 0===o?void 0:o.id)||i.length+1,element:e})}fireEvent(t,e=null){if(this.events.hasOwnProperty(t))return this.events[t](e)}on(t,e){this.events[t]=e}}},4986(t,e,n){
/*
* HSTooltip
* @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.__awaiter||function(t,e,n,o){return new(n||(n=Promise))(function(i,r){function s(t){try{a(o.next(t))}catch(t){r(t)}}function l(t){try{a(o.throw(t))}catch(t){r(t)}}function a(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(s,l)}a((o=o.apply(t,e||[])).next())})},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const r=n(949),s=n(292),l=i(n(2961)),a=n(8223);class c extends l.default{constructor(t,e,n){super(t,e,n),this.cleanupAutoUpdate=null,window.$hsTooltipCollection||(window.$hsTooltipCollection=[]),this.el&&(this.toggle=this.el.querySelector(".hs-tooltip-toggle")||this.el,this.content=this.el.querySelector(".hs-tooltip-content"),this.eventMode=(0,s.getClassProperty)(this.el,"--trigger")||"hover",this.preventFloatingUI=(0,s.getClassProperty)(this.el,"--prevent-popper","false"),this.placement=(0,s.getClassProperty)(this.el,"--placement")||"top",this.strategy=(0,s.getClassProperty)(this.el,"--strategy"),this.scope=(0,s.getClassProperty)(this.el,"--scope")||"parent"),this.el&&this.toggle&&this.content&&this.init()}toggleClick(){this.click()}toggleFocus(){this.focus()}toggleMouseEnter(){this.enter()}toggleMouseLeave(){this.leave()}toggleHandle(){this.hide(),this.toggle.removeEventListener("click",this.onToggleHandleListener,!0),this.toggle.removeEventListener("blur",this.onToggleHandleListener,!0)}hideOtherTooltips(){window.$hsTooltipCollection&&window.$hsTooltipCollection.forEach(({element:t})=>t.el!==this.el&&(!!t.el.classList.contains("show")&&void t.hide()))}init(){this.createCollection(window.$hsTooltipCollection,this),this.onToggleFocusListener=()=>this.enter(),this.onToggleBlurListener=()=>this.hide(),this.toggle.addEventListener("focus",this.onToggleFocusListener),this.toggle.addEventListener("blur",this.onToggleBlurListener),"click"===this.eventMode?(this.onToggleClickListener=()=>this.toggleClick(),this.toggle.addEventListener("click",this.onToggleClickListener)):"hover"===this.eventMode&&(this.onToggleMouseEnterListener=()=>this.toggleMouseEnter(),this.onToggleMouseLeaveListener=()=>this.toggleMouseLeave(),this.toggle.addEventListener("mouseenter",this.onToggleMouseEnterListener),this.toggle.addEventListener("mouseleave",this.onToggleMouseLeaveListener))}enter(){this._show()}leave(){this.hide()}click(){if(this.el.classList.contains("show"))return!1;this._show(),this.onToggleHandleListener=()=>{setTimeout(()=>this.toggleHandle())},this.toggle.addEventListener("click",this.onToggleHandleListener,!0),this.toggle.addEventListener("blur",this.onToggleHandleListener,!0)}focus(){this._show()}positionTooltip(t){return o(this,void 0,void 0,function*(){const e="auto"===t?"top":t,n="auto"===t?["bottom","left","right"]:this.getFallbackPlacements(e),o=[(0,r.offset)(5),(0,r.flip)({fallbackPlacements:n})];return yield(0,r.computePosition)(this.toggle,this.content,{placement:e,strategy:this.strategy||"fixed",middleware:o})})}getFallbackPlacements(t){switch(t){case"top":return["bottom","left","right"];case"bottom":return["top","left","right"];case"left":return["right","top","bottom"];case"right":return["left","top","bottom"];case"top-start":return["bottom-start","top-end","bottom-end"];case"top-end":return["bottom-end","top-start","bottom-start"];case"bottom-start":return["top-start","bottom-end","top-end"];case"bottom-end":return["top-end","bottom-start","top-start"];case"left-start":return["right-start","left-end","right-end"];case"left-end":return["right-end","left-start","right-start"];case"right-start":return["left-start","right-end","left-end"];case"right-end":return["left-end","right-start","left-start"];default:return["top","bottom","left","right"]}}applyTooltipPosition(t,e,n){Object.assign(this.content.style,{position:this.strategy||"fixed",left:`${t}px`,top:`${e}px`}),this.content.setAttribute("data-placement",n)}buildFloatingUI(){"window"===this.scope&&document.body.appendChild(this.content);const t=this.placement.startsWith("auto"),e=(0,s.getClassProperty)(this.el,"--placement"),n=t||(!e||""===e)?"auto":a.POSITIONS[this.placement]||this.placement;this.positionTooltip(n).then(t=>{this.applyTooltipPosition(t.x,t.y,t.placement)}),this.cleanupAutoUpdate=(0,r.autoUpdate)(this.toggle,this.content,()=>{this.positionTooltip(n).then(t=>{Object.assign(this.content.style,{position:this.strategy||"fixed",left:`${t.x}px`,top:`${t.y}px`}),this.content.setAttribute("data-placement",t.placement)})})}_show(){if(this.el.classList.contains("show"))return!1;this.hideOtherTooltips(),this.content.classList.remove("hidden"),"window"===this.scope&&this.content.classList.add("show"),"false"!==this.preventFloatingUI||this.cleanupAutoUpdate||this.buildFloatingUI(),setTimeout(()=>{this.el.classList.add("show"),this.fireEvent("show",this.el),(0,s.dispatch)("show.hs.tooltip",this.el,this.el)})}show(){"click"===this.eventMode?this.click():this.enter(),this.toggle.focus(),this.toggle.style.outline="none"}hide(){this.el.classList.remove("show"),"window"===this.scope&&this.content.classList.remove("show"),"false"===this.preventFloatingUI&&this.cleanupAutoUpdate&&(this.cleanupAutoUpdate(),this.cleanupAutoUpdate=null),this.fireEvent("hide",this.el),(0,s.dispatch)("hide.hs.tooltip",this.el,this.el),(0,s.afterTransition)(this.content,()=>{if(this.el.classList.contains("show"))return!1;this.content.classList.add("hidden"),this.toggle.style.outline=""})}destroy(){this.el.classList.remove("show"),this.content.classList.add("hidden"),this.toggle.removeEventListener("focus",this.onToggleFocusListener),this.toggle.removeEventListener("blur",this.onToggleBlurListener),"click"===this.eventMode?this.toggle.removeEventListener("click",this.onToggleClickListener):"hover"===this.eventMode&&(this.toggle.removeEventListener("mouseenter",this.onToggleMouseEnterListener),this.toggle.removeEventListener("mouseleave",this.onToggleMouseLeaveListener)),this.toggle.removeEventListener("click",this.onToggleHandleListener,!0),this.toggle.removeEventListener("blur",this.onToggleHandleListener,!0),this.cleanupAutoUpdate&&(this.cleanupAutoUpdate(),this.cleanupAutoUpdate=null),window.$hsTooltipCollection=window.$hsTooltipCollection.filter(({element:t})=>t.el!==this.el)}static findInCollection(t){return window.$hsTooltipCollection.find(e=>t instanceof c?e.element.el===t.el:"string"==typeof t?e.element.el===document.querySelector(t):e.element.el===t)||null}static getInstance(t,e=!1){const n=window.$hsTooltipCollection.find(e=>e.element.el===("string"==typeof t?document.querySelector(t):t));return n?e?n:n.element.el:null}static autoInit(){window.$hsTooltipCollection||(window.$hsTooltipCollection=[]),window.$hsTooltipCollection&&(window.$hsTooltipCollection=window.$hsTooltipCollection.filter(({element:t})=>document.contains(t.el))),document.querySelectorAll(".hs-tooltip:not(.--prevent-on-load-init)").forEach(t=>{window.$hsTooltipCollection.find(e=>{var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t})||new c(t)})}static show(t){const e=c.findInCollection(t);e&&e.element.show()}static hide(t){const e=c.findInCollection(t);e&&e.element.hide()}static on(t,e,n){const o=c.findInCollection(e);o&&(o.element.events[t]=n)}}e.default=c},292(t,e){
/*
* @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(e,"__esModule",{value:!0}),e.stringToBoolean=e.menuSearchHistory=e.isScrollable=e.isParentOrElementHidden=e.isJson=e.isIpadOS=e.isIOS=e.isFormElement=e.isFocused=e.isEnoughSpace=e.isDirectChild=e.htmlToElement=e.getZIndex=e.getHighestZIndex=e.getClassPropertyAlt=e.getClassProperty=e.dispatch=e.debounce=e.classToClassList=e.afterTransition=void 0;e.stringToBoolean=t=>"true"===t;e.getClassProperty=(t,e,n="")=>(window.getComputedStyle(t).getPropertyValue(e)||n).replace(" ","");e.getClassPropertyAlt=(t,e,n="")=>{let o="";return t.classList.forEach(t=>{t.includes(e)&&(o=t)}),o.match(/:(.*)]/)?o.match(/:(.*)]/)[1]:n};const n=t=>window.getComputedStyle(t).getPropertyValue("z-index");e.getZIndex=n;e.getHighestZIndex=t=>{let e=Number.NEGATIVE_INFINITY;return t.forEach(t=>{let o=n(t);"auto"!==o&&(o=parseInt(o,10),o>e&&(e=o))}),e};e.isDirectChild=(t,e)=>{const n=t.children;for(let t=0;t<n.length;t++)if(n[t]===e)return!0;return!1};e.isEnoughSpace=(t,e,n="auto",o=10,i=null)=>{const r=e.getBoundingClientRect(),s=i?i.getBoundingClientRect():null,l=window.innerHeight,a=s?r.top-s.top:r.top,c=(i?s.bottom:l)-r.bottom,f=t.clientHeight+o;return"bottom"===n?c>=f:"top"===n?a>=f:a>=f||c>=f};e.isFocused=t=>document.activeElement===t;e.isFormElement=t=>t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement;e.isIOS=()=>!!/iPad|iPhone|iPod/.test(navigator.platform)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform);e.isIpadOS=()=>navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform);e.isJson=t=>{if("string"!=typeof t)return!1;const e=t.trim()[0],n=t.trim().slice(-1);if("{"===e&&"}"===n||"["===e&&"]"===n)try{return JSON.parse(t),!0}catch(t){return!1}return!1};const o=t=>{if(!t)return!1;return"none"===window.getComputedStyle(t).display||o(t.parentElement)};e.isParentOrElementHidden=o;e.isScrollable=t=>{const e=window.getComputedStyle(t),n=e.overflowY,o=e.overflowX,i=("scroll"===n||"auto"===n)&&t.scrollHeight>t.clientHeight,r=("scroll"===o||"auto"===o)&&t.scrollWidth>t.clientWidth;return i||r};e.debounce=(t,e=200)=>{let n;return(...o)=>{clearTimeout(n),n=setTimeout(()=>{t.apply(this,o)},e)}};e.dispatch=(t,e,n=null)=>{const o=new CustomEvent(t,{detail:{payload:n},bubbles:!0,cancelable:!0,composed:!1});e.dispatchEvent(o)};e.afterTransition=(t,e)=>{const n=()=>{e(),t.removeEventListener("transitionend",n,!0)},o=window.getComputedStyle(t),i=o.getPropertyValue("transition-duration");"none"!==o.getPropertyValue("transition-property")&&parseFloat(i)>0?t.addEventListener("transitionend",n,!0):e()};e.htmlToElement=t=>{const e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild};e.classToClassList=(t,e,n=" ",o="add")=>{t.split(n).forEach(t=>{t.trim()&&("add"===o?e.classList.add(t):e.classList.remove(t))})};const i={historyIndex:-1,addHistory(t){this.historyIndex=t},existsInHistory(t){return t>this.historyIndex},clearHistory(){this.historyIndex=-1}};e.menuSearchHistory=i}},e={};function n(o){var i=e[o];if(void 0!==i)return i.exports;var r=e[o]={exports:{}};return t[o].call(r.exports,r,r.exports,n),r.exports}return n.d=(t,e)=>{for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n(4986)})());