preline
Version:
Preline UI is an open-source set of prebuilt UI components based on the utility-first Tailwind CSS framework.
16 lines • 34.5 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={223:(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}},292:function(t,e){
/*
* @version: 3.2.3
* @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,u=t.clientHeight+o;return"bottom"===n?c>=u:"top"===n?a>=u:a>=u||c>=u};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},949:(t,e,n)=>{n.r(e),n.d(e,{arrow:()=>bt,autoPlacement:()=>mt,autoUpdate:()=>dt,computePosition:()=>Lt,detectOverflow:()=>gt,flip:()=>wt,getOverflowAncestors:()=>X,hide:()=>xt,inline:()=>Tt,limitShift:()=>Et,offset:()=>pt,platform:()=>ft,shift:()=>yt,size:()=>vt});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,u=t=>({x:t,y:t}),f={left:"right",right:"left",bottom:"top",top:"bottom"},h={start:"end",end:"start"};function d(t,e,n){return l(t,s(e,n))}function g(t,e){return"function"==typeof t?t(e):t}function p(t){return t.split("-")[0]}function m(t){return t.split("-")[1]}function y(t){return"x"===t?"y":"x"}function w(t){return"y"===t?"height":"width"}function v(t){return["top","bottom"].includes(p(t))?"y":"x"}function x(t){return y(v(t))}function b(t,e,n){void 0===n&&(n=!1);const o=m(t),i=x(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=E(s)),[s,E(s)]}function T(t){return t.replace(/start|end/g,(t=>h[t]))}function E(t){return t.replace(/left|right|bottom|top/g,(t=>f[t]))}function L(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 C(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 S(t,e,n){let{reference:o,floating:i}=t;const r=v(e),s=x(e),l=w(s),a=p(e),c="y"===r,u=o.x+o.width/2-i.width/2,f=o.y+o.height/2-i.height/2,h=o[l]/2-i[l]/2;let d;switch(a){case"top":d={x:u,y:o.y-i.height};break;case"bottom":d={x:u,y:o.y+o.height};break;case"right":d={x:o.x+o.width,y:f};break;case"left":d={x:o.x-i.width,y:f};break;default:d={x:o.x,y:o.y}}switch(m(e)){case"start":d[s]-=h*(n&&c?-1:1);break;case"end":d[s]+=h*(n&&c?-1:1)}return d}async function A(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:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:d=0}=g(e,t),p=L(d),m=l[h?"floating"===f?"reference":"floating":f],y=C(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:u,strategy:a})),w="floating"===f?{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=C(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:w,offsetParent:v,strategy:a}):w);return{top:(y.top-b.top+p.top)/x.y,bottom:(b.bottom-y.bottom+p.bottom)/x.y,left:(y.left-b.left+p.left)/x.x,right:(b.right-y.right+p.right)/x.x}}function I(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function P(t){return o.some((e=>t[e]>=0))}function O(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}}function R(){return"undefined"!=typeof window}function _(t){return B(t)?(t.nodeName||"").toLowerCase():"#document"}function H(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function M(t){var e;return null==(e=(B(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function B(t){return!!R()&&(t instanceof Node||t instanceof H(t).Node)}function D(t){return!!R()&&(t instanceof Element||t instanceof H(t).Element)}function F(t){return!!R()&&(t instanceof HTMLElement||t instanceof H(t).HTMLElement)}function k(t){return!(!R()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof H(t).ShadowRoot)}function Y(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=j(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(i)}function U(t){return["table","td","th"].includes(_(t))}function N(t){return[":popover-open",":modal"].some((e=>{try{return t.matches(e)}catch(t){return!1}}))}function W(t){const e=$(),n=D(t)?j(t):t;return["transform","translate","scale","rotate","perspective"].some((t=>!!n[t]&&"none"!==n[t]))||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||["transform","translate","scale","rotate","perspective","filter"].some((t=>(n.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(n.contain||"").includes(t)))}function $(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function V(t){return["html","body","#document"].includes(_(t))}function j(t){return H(t).getComputedStyle(t)}function K(t){return D(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function z(t){if("html"===_(t))return t;const e=t.assignedSlot||t.parentNode||k(t)&&t.host||M(t);return k(e)?e.host:e}function q(t){const e=z(t);return V(e)?t.ownerDocument?t.ownerDocument.body:t.body:F(e)&&Y(e)?e:q(e)}function X(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const i=q(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),s=H(i);if(r){const t=Z(s);return e.concat(s,s.visualViewport||[],Y(i)?i:[],t&&n?X(t):[])}return e.concat(i,X(i,[],n))}function Z(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function J(t){const e=j(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=F(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 G(t){return D(t)?t:t.contextElement}function Q(t){const e=G(t);if(!F(e))return u(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=J(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 tt=u(0);function et(t){const e=H(t);return $()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:tt}function nt(t,e,n,o){void 0===e&&(e=!1),void 0===n&&(n=!1);const i=t.getBoundingClientRect(),r=G(t);let s=u(1);e&&(o?D(o)&&(s=Q(o)):s=Q(t));const l=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==H(t))&&e}(r,n,o)?et(r):u(0);let a=(i.left+l.x)/s.x,c=(i.top+l.y)/s.y,f=i.width/s.x,h=i.height/s.y;if(r){const t=H(r),e=o&&D(o)?H(o):o;let n=t,i=Z(n);for(;i&&o&&e!==n;){const t=Q(i),e=i.getBoundingClientRect(),o=j(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,f*=t.x,h*=t.y,a+=r,c+=s,n=H(i),i=Z(n)}}return C({width:f,height:h,x:a,y:c})}function ot(t,e){const n=K(t).scrollLeft;return e?e.left+n:nt(M(t)).left+n}function it(t,e,n){void 0===n&&(n=!1);const o=t.getBoundingClientRect();return{x:o.left+e.scrollLeft-(n?0:ot(t,o)),y:o.top+e.scrollTop}}function rt(t,e,n){let o;if("viewport"===e)o=function(t,e){const n=H(t),o=M(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=$();(!t||t&&"fixed"===e)&&(l=i.offsetLeft,a=i.offsetTop)}return{width:r,height:s,x:l,y:a}}(t,n);else if("document"===e)o=function(t){const e=M(t),n=K(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+ot(t);const a=-n.scrollTop;return"rtl"===j(o).direction&&(s+=l(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:s,y:a}}(M(t));else if(D(e))o=function(t,e){const n=nt(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=F(t)?Q(t):u(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=et(t);o={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return C(o)}function st(t,e){const n=z(t);return!(n===e||!D(n)||V(n))&&("fixed"===j(n).position||st(n,e))}function lt(t,e,n){const o=F(e),i=M(e),r="fixed"===n,s=nt(t,!0,r,e);let l={scrollLeft:0,scrollTop:0};const a=u(0);if(o||!o&&!r)if(("body"!==_(e)||Y(i))&&(l=K(e)),o){const t=nt(e,!0,r,e);a.x=t.x+e.clientLeft,a.y=t.y+e.clientTop}else i&&(a.x=ot(i));const c=!i||o||r?u(0):it(i,l);return{x:s.left+l.scrollLeft-a.x-c.x,y:s.top+l.scrollTop-a.y-c.y,width:s.width,height:s.height}}function at(t){return"static"===j(t).position}function ct(t,e){if(!F(t)||"fixed"===j(t).position)return null;if(e)return e(t);let n=t.offsetParent;return M(t)===n&&(n=n.ownerDocument.body),n}function ut(t,e){const n=H(t);if(N(t))return n;if(!F(t)){let e=z(t);for(;e&&!V(e);){if(D(e)&&!at(e))return e;e=z(e)}return n}let o=ct(t,e);for(;o&&U(o)&&at(o);)o=ct(o,e);return o&&V(o)&&at(o)&&!W(o)?n:o||function(t){let e=z(t);for(;F(e)&&!V(e);){if(W(e))return e;if(N(e))return null;e=z(e)}return null}(t)||n}const ft={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const r="fixed"===i,s=M(o),l=!!e&&N(e.floating);if(o===s||l&&r)return n;let a={scrollLeft:0,scrollTop:0},c=u(1);const f=u(0),h=F(o);if((h||!h&&!r)&&(("body"!==_(o)||Y(s))&&(a=K(o)),F(o))){const t=nt(o);c=Q(o),f.x=t.x+o.clientLeft,f.y=t.y+o.clientTop}const d=!s||h||r?u(0):it(s,a,!0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-a.scrollLeft*c.x+f.x+d.x,y:n.y*c.y-a.scrollTop*c.y+f.y+d.y}},getDocumentElement:M,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const r=[..."clippingAncestors"===n?N(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let o=X(t,[],!1).filter((t=>D(t)&&"body"!==_(t))),i=null;const r="fixed"===j(t).position;let s=r?z(t):t;for(;D(s)&&!V(s);){const e=j(s),n=W(s);n||"fixed"!==e.position||(i=null),(r?!n&&!i:!n&&"static"===e.position&&i&&["absolute","fixed"].includes(i.position)||Y(s)&&!n&&st(t,s))?o=o.filter((t=>t!==s)):i=e,s=z(s)}return e.set(t,o),o}(e,this._c):[].concat(n),o],a=r[0],c=r.reduce(((t,n)=>{const o=rt(e,n,i);return t.top=l(o.top,t.top),t.right=s(o.right,t.right),t.bottom=s(o.bottom,t.bottom),t.left=l(o.left,t.left),t}),rt(e,a,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},getOffsetParent:ut,getElementRects:async function(t){const e=this.getOffsetParent||ut,n=this.getDimensions,o=await n(t.floating);return{reference:lt(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}=J(t);return{width:e,height:n}},getScale:Q,isElement:D,isRTL:function(t){return"rtl"===j(t).direction}};function ht(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function dt(t,e,n,o){void 0===o&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:u="function"==typeof IntersectionObserver,animationFrame:f=!1}=o,h=G(t),d=i||r?[...h?X(h):[],...X(e)]:[];d.forEach((t=>{i&&t.addEventListener("scroll",n,{passive:!0}),r&&t.addEventListener("resize",n)}));const g=h&&u?function(t,e){let n,o=null;const i=M(t);function r(){var t;clearTimeout(n),null==(t=o)||t.disconnect(),o=null}return function a(u,f){void 0===u&&(u=!1),void 0===f&&(f=1),r();const h=t.getBoundingClientRect(),{left:d,top:g,width:p,height:m}=h;if(u||e(),!p||!m)return;const y={rootMargin:-c(g)+"px "+-c(i.clientWidth-(d+p))+"px "+-c(i.clientHeight-(g+m))+"px "+-c(d)+"px",threshold:l(0,s(1,f))||1};let w=!0;function v(e){const o=e[0].intersectionRatio;if(o!==f){if(!w)return a();o?a(!1,o):n=setTimeout((()=>{a(!1,1e-7)}),1e3)}1!==o||ht(h,t.getBoundingClientRect())||a(),w=!1}try{o=new IntersectionObserver(v,{...y,root:i.ownerDocument})}catch(t){o=new IntersectionObserver(v,y)}o.observe(t)}(!0),r}(h,n):null;let p,m=-1,y=null;a&&(y=new ResizeObserver((t=>{let[o]=t;o&&o.target===h&&y&&(y.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame((()=>{var t;null==(t=y)||t.observe(e)}))),n()})),h&&!f&&y.observe(h),y.observe(e));let w=f?nt(t):null;return f&&function e(){const o=nt(t);w&&!ht(w,o)&&n();w=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=y)||t.disconnect(),y=null,f&&cancelAnimationFrame(p)}}const gt=A,pt=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=p(n),l=m(n),a="y"===v(n),c=["left","top"].includes(s)?-1:1,u=r&&a?-1:1,f=g(e,t);let{mainAxis:h,crossAxis:d,alignmentAxis:y}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&"number"==typeof y&&(d="end"===l?-1*y:y),a?{x:d*u,y:h*c}:{x:h*c,y:d*u}}(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}}}}},mt=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:u}=e,{crossAxis:f=!1,alignment:h,allowedPlacements:d=r,autoAlignment:y=!0,...w}=g(t,e),v=void 0!==h||d===r?function(t,e,n){return(t?[...n.filter((e=>m(e)===t)),...n.filter((e=>m(e)!==t))]:n.filter((t=>p(t)===t))).filter((n=>!t||m(n)===t||!!e&&T(n)!==n))}(h||null,y,d):d,x=await A(e,w),E=(null==(n=l.autoPlacement)?void 0:n.index)||0,L=v[E];if(null==L)return{};const C=b(L,s,await(null==c.isRTL?void 0:c.isRTL(u.floating)));if(a!==L)return{reset:{placement:v[0]}};const S=[x[p(L)],x[C[0]],x[C[1]]],I=[...(null==(o=l.autoPlacement)?void 0:o.overflows)||[],{placement:L,overflows:S}],P=v[E+1];if(P)return{data:{index:E+1,overflows:I},reset:{placement:P}};const O=I.map((t=>{const e=m(t.placement);return[t.placement,e&&f?t.overflows.slice(0,2).reduce(((t,e)=>t+e),0):t.overflows[0],t.overflows]})).sort(((t,e)=>t[1]-e[1])),R=(null==(i=O.filter((t=>t[2].slice(0,m(t[0])?2:3).every((t=>t<=0))))[0])?void 0:i[0])||O[0][0];return R!==a?{data:{index:E+1,overflows:I},reset:{placement:R}}:{}}}},yt=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i}=e,{mainAxis:r=!0,crossAxis:s=!1,limiter:l={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...a}=g(t,e),c={x:n,y:o},u=await A(e,a),f=v(p(i)),h=y(f);let m=c[h],w=c[f];if(r){const t="y"===h?"bottom":"right";m=d(m+u["y"===h?"top":"left"],m,m-u[t])}if(s){const t="y"===f?"bottom":"right";w=d(w+u["y"===f?"top":"left"],w,w-u[t])}const x=l.fn({...e,[h]:m,[f]:w});return{...x,data:{x:x.x-n,y:x.y-o,enabled:{[h]:r,[f]:s}}}}}},wt=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:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:w=!0,...x}=g(t,e);if(null!=(n=r.arrow)&&n.alignmentOffset)return{};const L=p(i),C=v(l),S=p(l)===l,I=await(null==a.isRTL?void 0:a.isRTL(c.floating)),P=h||(S||!w?[E(l)]:function(t){const e=E(t);return[T(t),e,T(e)]}(l)),O="none"!==y;!h&&O&&P.push(...function(t,e,n,o){const i=m(t);let r=function(t,e,n){const o=["left","right"],i=["right","left"],r=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:o:e?o:i;case"left":case"right":return e?r:s;default:return[]}}(p(t),"start"===n,o);return i&&(r=r.map((t=>t+"-"+i)),e&&(r=r.concat(r.map(T)))),r}(l,w,y,I));const R=[l,...P],_=await A(e,x),H=[];let M=(null==(o=r.flip)?void 0:o.overflows)||[];if(u&&H.push(_[L]),f){const t=b(i,s,I);H.push(_[t[0]],_[t[1]])}if(M=[...M,{placement:i,overflows:H}],!H.every((t=>t<=0))){var B,D;const t=((null==(B=r.flip)?void 0:B.index)||0)+1,e=R[t];if(e)return{data:{index:t,overflows:M},reset:{placement:e}};let n=null==(D=M.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:D.placement;if(!n)switch(d){case"bestFit":{var F;const t=null==(F=M.filter((t=>{if(O){const e=v(t.placement);return e===C||"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:F[0];t&&(n=t);break}case"initialPlacement":n=l}if(i!==n)return{reset:{placement:n}}}return{}}}},vt=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:u=()=>{},...f}=g(t,e),h=await A(e,f),d=p(i),y=m(i),w="y"===v(i),{width:x,height:b}=r.floating;let T,E;"top"===d||"bottom"===d?(T=d,E=y===(await(null==a.isRTL?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(E=d,T="end"===y?"top":"bottom");const L=b-h.top-h.bottom,C=x-h.left-h.right,S=s(b-h[T],L),I=s(x-h[E],C),P=!e.middlewareData.shift;let O=S,R=I;if(null!=(n=e.middlewareData.shift)&&n.enabled.x&&(R=C),null!=(o=e.middlewareData.shift)&&o.enabled.y&&(O=L),P&&!y){const t=l(h.left,0),e=l(h.right,0),n=l(h.top,0),o=l(h.bottom,0);w?R=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 u({...e,availableWidth:R,availableHeight:O});const _=await a.getDimensions(c.floating);return x!==_.width||b!==_.height?{reset:{rects:!0}}:{}}}},xt=function(t){return void 0===t&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:o="referenceHidden",...i}=g(t,e);switch(o){case"referenceHidden":{const t=I(await A(e,{...i,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:t,referenceHidden:P(t)}}}case"escaped":{const t=I(await A(e,{...i,altBoundary:!0}),n.floating);return{data:{escapedOffsets:t,escaped:P(t)}}}default:return{}}}}},bt=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:u,padding:f=0}=g(t,e)||{};if(null==u)return{};const h=L(f),p={x:n,y:o},y=x(i),v=w(y),b=await l.getDimensions(u),T="y"===y,E=T?"top":"left",C=T?"bottom":"right",S=T?"clientHeight":"clientWidth",A=r.reference[v]+r.reference[y]-p[y]-r.floating[v],I=p[y]-r.reference[y],P=await(null==l.getOffsetParent?void 0:l.getOffsetParent(u));let O=P?P[S]:0;O&&await(null==l.isElement?void 0:l.isElement(P))||(O=a.floating[S]||r.floating[v]);const R=A/2-I/2,_=O/2-b[v]/2-1,H=s(h[E],_),M=s(h[C],_),B=H,D=O-b[v]-M,F=O/2-b[v]/2+R,k=d(B,F,D),Y=!c.arrow&&null!=m(i)&&F!==k&&r.reference[v]/2-(F<B?H:M)-b[v]/2<0,U=Y?F<B?F-B:F-D:0;return{[y]:p[y]+U,data:{[y]:k,centerOffset:F-k-U,...Y&&{alignmentOffset:U}},reset:Y}}}),Tt=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:u,y:f}=g(t,e),h=Array.from(await(null==r.getClientRects?void 0:r.getClientRects(o.reference))||[]),d=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=>C(O(t))))}(h),m=C(O(h)),y=L(c);const w=await r.getElementRects({reference:{getBoundingClientRect:function(){if(2===d.length&&d[0].left>d[1].right&&null!=u&&null!=f)return d.find((t=>u>t.left-y.left&&u<t.right+y.right&&f>t.top-y.top&&f<t.bottom+y.bottom))||m;if(d.length>=2){if("y"===v(n)){const t=d[0],e=d[d.length-1],o="top"===p(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"===p(n),e=l(...d.map((t=>t.right))),o=s(...d.map((t=>t.left))),i=d.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!==w.reference.x||i.reference.y!==w.reference.y||i.reference.width!==w.reference.width||i.reference.height!==w.reference.height?{reset:{rects:w}}:{}}}},Et=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}=g(t,e),u={x:n,y:o},f=v(i),h=y(f);let d=u[h],m=u[f];const w=g(l,e),x="number"==typeof w?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};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;d<e?d=e:d>n&&(d=n)}if(c){var b,T;const t="y"===h?"width":"height",e=["top","left"].includes(p(i)),n=r.reference[f]-r.floating[t]+(e&&(null==(b=s.offset)?void 0:b[f])||0)+(e?0:x.crossAxis),o=r.reference[f]+r.reference[t]+(e?0:(null==(T=s.offset)?void 0:T[f])||0)-(e?x.crossAxis:0);m<n?m=n:m>o&&(m=o)}return{[h]:d,[f]:m}}}},Lt=(t,e,n)=>{const o=new Map,i={platform:ft,...n},r={...i.platform,_c:o};return(async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:s}=n,l=r.filter(Boolean),a=await(null==s.isRTL?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:f}=S(c,o,a),h=o,d={},g=0;for(let n=0;n<l.length;n++){const{name:r,fn:p}=l[n],{x:m,y,data:w,reset:v}=await p({x:u,y:f,initialPlacement:o,placement:h,strategy:i,middlewareData:d,rects:c,platform:s,elements:{reference:t,floating:e}});u=null!=m?m:u,f=null!=y?y:f,d={...d,[r]:{...d[r],...w}},v&&g<=50&&(g++,"object"==typeof v&&(v.placement&&(h=v.placement),v.rects&&(c=!0===v.rects?await s.getElementRects({reference:t,floating:e,strategy:i}):v.rects),({x:u,y:f}=S(c,h,a))),n=-1)}return{x:u,y:f,placement:h,strategy:i,middlewareData:d}})(t,e,{...i,platform:r})}},961:(t,e)=>{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;t.push({id:(null===(n=null==e?void 0:e.el)||void 0===n?void 0:n.id)||t.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}}},969:function(t,e,n){
/*
* HSTooltip
* @version: 3.2.3
* @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(961)),a=n(223);class c extends l.default{constructor(t,e,n){super(t,e,n),this.cleanupAutoUpdate=null,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)}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)),"false"===this.preventFloatingUI&&this.buildFloatingUI()}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(){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)}}window.addEventListener("load",(()=>{c.autoInit()})),"undefined"!=typeof window&&(window.HSTooltip=c),e.default=c}},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(969)})()));