@preline/tooltip 4.1.3 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.mjs CHANGED
@@ -1,16 +1,16 @@
1
- var t={189:(t,e,n)=>{n.d(e,{lP:()=>o});const o={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"}},615:(t,e,n)=>{n.d(e,{A:()=>o});
1
+ var t={189(t,e,n){n.d(e,{lP:()=>o});const o={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"}},7615(t,e,n){n.d(e,{A:()=>o});
2
2
  /*
3
3
  * HSBasePlugin
4
- * @version: 4.1.3
4
+ * @version: 5.0.0
5
5
  * @author: Preline Labs Ltd.
6
6
  * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
7
7
  * Copyright 2024 Preline Labs Ltd.
8
8
  */
9
- class o{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}}},663:(t,e,n)=>{n.d(e,{ll:()=>ot,rD:()=>lt,UU:()=>st,cY:()=>it});const o=Math.min,i=Math.max,s=Math.round,l=Math.floor,r=t=>({x:t,y:t}),c={left:"right",right:"left",bottom:"top",top:"bottom"},a={start:"end",end:"start"};function u(t,e){return"function"==typeof t?t(e):t}function h(t){return t.split("-")[0]}function f(t){return t.split("-")[1]}function d(t){return"y"===t?"height":"width"}function g(t){return["top","bottom"].includes(h(t))?"y":"x"}function p(t){return"x"===g(t)?"y":"x"}function m(t){return t.replace(/start|end/g,(t=>a[t]))}function v(t){return t.replace(/left|right|bottom|top/g,(t=>c[t]))}function w(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 y(t,e,n){let{reference:o,floating:i}=t;const s=g(e),l=p(e),r=d(l),c=h(e),a="y"===s,u=o.x+o.width/2-i.width/2,m=o.y+o.height/2-i.height/2,v=o[r]/2-i[r]/2;let w;switch(c){case"top":w={x:u,y:o.y-i.height};break;case"bottom":w={x:u,y:o.y+o.height};break;case"right":w={x:o.x+o.width,y:m};break;case"left":w={x:o.x-i.width,y:m};break;default:w={x:o.x,y:o.y}}switch(f(e)){case"start":w[l]-=v*(n&&a?-1:1);break;case"end":w[l]+=v*(n&&a?-1:1)}return w}async function x(t,e){var n;void 0===e&&(e={});const{x:o,y:i,platform:s,rects:l,elements:r,strategy:c}=t,{boundary:a="clippingAncestors",rootBoundary:h="viewport",elementContext:f="floating",altBoundary:d=!1,padding:g=0}=u(e,t),p=function(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}}(g),m=r[d?"floating"===f?"reference":"floating":f],v=w(await s.getClippingRect({element:null==(n=await(null==s.isElement?void 0:s.isElement(m)))||n?m:m.contextElement||await(null==s.getDocumentElement?void 0:s.getDocumentElement(r.floating)),boundary:a,rootBoundary:h,strategy:c})),y="floating"===f?{x:o,y:i,width:l.floating.width,height:l.floating.height}:l.reference,x=await(null==s.getOffsetParent?void 0:s.getOffsetParent(r.floating)),b=await(null==s.isElement?void 0:s.isElement(x))&&await(null==s.getScale?void 0:s.getScale(x))||{x:1,y:1},L=w(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:r,rect:y,offsetParent:x,strategy:c}):y);return{top:(v.top-L.top+p.top)/b.y,bottom:(L.bottom-v.bottom+p.bottom)/b.y,left:(v.left-L.left+p.left)/b.x,right:(L.right-v.right+p.right)/b.x}}function b(){return"undefined"!=typeof window}function L(t){return A(t)?(t.nodeName||"").toLowerCase():"#document"}function T(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function E(t){var e;return null==(e=(A(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function A(t){return!!b()&&(t instanceof Node||t instanceof T(t).Node)}function C(t){return!!b()&&(t instanceof Element||t instanceof T(t).Element)}function R(t){return!!b()&&(t instanceof HTMLElement||t instanceof T(t).HTMLElement)}function k(t){return!(!b()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof T(t).ShadowRoot)}function P(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=H(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(i)}function F(t){return["table","td","th"].includes(L(t))}function S(t){return[":popover-open",":modal"].some((e=>{try{return t.matches(e)}catch(t){return!1}}))}function M(t){const e=O(),n=C(t)?H(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 O(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function D(t){return["html","body","#document"].includes(L(t))}function H(t){return T(t).getComputedStyle(t)}function $(t){return C(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function U(t){if("html"===L(t))return t;const e=t.assignedSlot||t.parentNode||k(t)&&t.host||E(t);return k(e)?e.host:e}function B(t){const e=U(t);return D(e)?t.ownerDocument?t.ownerDocument.body:t.body:R(e)&&P(e)?e:B(e)}function I(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const i=B(t),s=i===(null==(o=t.ownerDocument)?void 0:o.body),l=T(i);if(s){const t=j(l);return e.concat(l,l.visualViewport||[],P(i)?i:[],t&&n?I(t):[])}return e.concat(i,I(i,[],n))}function j(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function V(t){const e=H(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=R(t),l=i?t.offsetWidth:n,r=i?t.offsetHeight:o,c=s(n)!==l||s(o)!==r;return c&&(n=l,o=r),{width:n,height:o,$:c}}function W(t){return C(t)?t:t.contextElement}function q(t){const e=W(t);if(!R(e))return r(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:l}=V(e);let c=(l?s(n.width):n.width)/o,a=(l?s(n.height):n.height)/i;return c&&Number.isFinite(c)||(c=1),a&&Number.isFinite(a)||(a=1),{x:c,y:a}}const z=r(0);function N(t){const e=T(t);return O()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:z}function _(t,e,n,o){void 0===e&&(e=!1),void 0===n&&(n=!1);const i=t.getBoundingClientRect(),s=W(t);let l=r(1);e&&(o?C(o)&&(l=q(o)):l=q(t));const c=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==T(t))&&e}(s,n,o)?N(s):r(0);let a=(i.left+c.x)/l.x,u=(i.top+c.y)/l.y,h=i.width/l.x,f=i.height/l.y;if(s){const t=T(s),e=o&&C(o)?T(o):o;let n=t,i=j(n);for(;i&&o&&e!==n;){const t=q(i),e=i.getBoundingClientRect(),o=H(i),s=e.left+(i.clientLeft+parseFloat(o.paddingLeft))*t.x,l=e.top+(i.clientTop+parseFloat(o.paddingTop))*t.y;a*=t.x,u*=t.y,h*=t.x,f*=t.y,a+=s,u+=l,n=T(i),i=j(n)}}return w({width:h,height:f,x:a,y:u})}function Y(t,e){const n=$(t).scrollLeft;return e?e.left+n:_(E(t)).left+n}function J(t,e,n){void 0===n&&(n=!1);const o=t.getBoundingClientRect();return{x:o.left+e.scrollLeft-(n?0:Y(t,o)),y:o.top+e.scrollTop}}function X(t,e,n){let o;if("viewport"===e)o=function(t,e){const n=T(t),o=E(t),i=n.visualViewport;let s=o.clientWidth,l=o.clientHeight,r=0,c=0;if(i){s=i.width,l=i.height;const t=O();(!t||t&&"fixed"===e)&&(r=i.offsetLeft,c=i.offsetTop)}return{width:s,height:l,x:r,y:c}}(t,n);else if("document"===e)o=function(t){const e=E(t),n=$(t),o=t.ownerDocument.body,s=i(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),l=i(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let r=-n.scrollLeft+Y(t);const c=-n.scrollTop;return"rtl"===H(o).direction&&(r+=i(e.clientWidth,o.clientWidth)-s),{width:s,height:l,x:r,y:c}}(E(t));else if(C(e))o=function(t,e){const n=_(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,s=R(t)?q(t):r(1);return{width:t.clientWidth*s.x,height:t.clientHeight*s.y,x:i*s.x,y:o*s.y}}(e,n);else{const n=N(t);o={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return w(o)}function G(t,e){const n=U(t);return!(n===e||!C(n)||D(n))&&("fixed"===H(n).position||G(n,e))}function K(t,e,n){const o=R(e),i=E(e),s="fixed"===n,l=_(t,!0,s,e);let c={scrollLeft:0,scrollTop:0};const a=r(0);if(o||!o&&!s)if(("body"!==L(e)||P(i))&&(c=$(e)),o){const t=_(e,!0,s,e);a.x=t.x+e.clientLeft,a.y=t.y+e.clientTop}else i&&(a.x=Y(i));const u=!i||o||s?r(0):J(i,c);return{x:l.left+c.scrollLeft-a.x-u.x,y:l.top+c.scrollTop-a.y-u.y,width:l.width,height:l.height}}function Q(t){return"static"===H(t).position}function Z(t,e){if(!R(t)||"fixed"===H(t).position)return null;if(e)return e(t);let n=t.offsetParent;return E(t)===n&&(n=n.ownerDocument.body),n}function tt(t,e){const n=T(t);if(S(t))return n;if(!R(t)){let e=U(t);for(;e&&!D(e);){if(C(e)&&!Q(e))return e;e=U(e)}return n}let o=Z(t,e);for(;o&&F(o)&&Q(o);)o=Z(o,e);return o&&D(o)&&Q(o)&&!M(o)?n:o||function(t){let e=U(t);for(;R(e)&&!D(e);){if(M(e))return e;if(S(e))return null;e=U(e)}return null}(t)||n}const et={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const s="fixed"===i,l=E(o),c=!!e&&S(e.floating);if(o===l||c&&s)return n;let a={scrollLeft:0,scrollTop:0},u=r(1);const h=r(0),f=R(o);if((f||!f&&!s)&&(("body"!==L(o)||P(l))&&(a=$(o)),R(o))){const t=_(o);u=q(o),h.x=t.x+o.clientLeft,h.y=t.y+o.clientTop}const d=!l||f||s?r(0):J(l,a,!0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-a.scrollLeft*u.x+h.x+d.x,y:n.y*u.y-a.scrollTop*u.y+h.y+d.y}},getDocumentElement:E,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:s,strategy:l}=t;const r=[..."clippingAncestors"===n?S(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let o=I(t,[],!1).filter((t=>C(t)&&"body"!==L(t))),i=null;const s="fixed"===H(t).position;let l=s?U(t):t;for(;C(l)&&!D(l);){const e=H(l),n=M(l);n||"fixed"!==e.position||(i=null),(s?!n&&!i:!n&&"static"===e.position&&i&&["absolute","fixed"].includes(i.position)||P(l)&&!n&&G(t,l))?o=o.filter((t=>t!==l)):i=e,l=U(l)}return e.set(t,o),o}(e,this._c):[].concat(n),s],c=r[0],a=r.reduce(((t,n)=>{const s=X(e,n,l);return t.top=i(s.top,t.top),t.right=o(s.right,t.right),t.bottom=o(s.bottom,t.bottom),t.left=i(s.left,t.left),t}),X(e,c,l));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:tt,getElementRects:async function(t){const e=this.getOffsetParent||tt,n=this.getDimensions,o=await n(t.floating);return{reference:K(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}=V(t);return{width:e,height:n}},getScale:q,isElement:C,isRTL:function(t){return"rtl"===H(t).direction}};function nt(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function ot(t,e,n,s){void 0===s&&(s={});const{ancestorScroll:r=!0,ancestorResize:c=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:u="function"==typeof IntersectionObserver,animationFrame:h=!1}=s,f=W(t),d=r||c?[...f?I(f):[],...I(e)]:[];d.forEach((t=>{r&&t.addEventListener("scroll",n,{passive:!0}),c&&t.addEventListener("resize",n)}));const g=f&&u?function(t,e){let n,s=null;const r=E(t);function c(){var t;clearTimeout(n),null==(t=s)||t.disconnect(),s=null}return function a(u,h){void 0===u&&(u=!1),void 0===h&&(h=1),c();const f=t.getBoundingClientRect(),{left:d,top:g,width:p,height:m}=f;if(u||e(),!p||!m)return;const v={rootMargin:-l(g)+"px "+-l(r.clientWidth-(d+p))+"px "+-l(r.clientHeight-(g+m))+"px "+-l(d)+"px",threshold:i(0,o(1,h))||1};let w=!0;function y(e){const o=e[0].intersectionRatio;if(o!==h){if(!w)return a();o?a(!1,o):n=setTimeout((()=>{a(!1,1e-7)}),1e3)}1!==o||nt(f,t.getBoundingClientRect())||a(),w=!1}try{s=new IntersectionObserver(y,{...v,root:r.ownerDocument})}catch(t){s=new IntersectionObserver(y,v)}s.observe(t)}(!0),c}(f,n):null;let p,m=-1,v=null;a&&(v=new ResizeObserver((t=>{let[o]=t;o&&o.target===f&&v&&(v.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame((()=>{var t;null==(t=v)||t.observe(e)}))),n()})),f&&!h&&v.observe(f),v.observe(e));let w=h?_(t):null;return h&&function e(){const o=_(t);w&&!nt(w,o)&&n();w=o,p=requestAnimationFrame(e)}(),n(),()=>{var t;d.forEach((t=>{r&&t.removeEventListener("scroll",n),c&&t.removeEventListener("resize",n)})),null==g||g(),null==(t=v)||t.disconnect(),v=null,h&&cancelAnimationFrame(p)}}const it=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:s,placement:l,middlewareData:r}=e,c=await async function(t,e){const{placement:n,platform:o,elements:i}=t,s=await(null==o.isRTL?void 0:o.isRTL(i.floating)),l=h(n),r=f(n),c="y"===g(n),a=["left","top"].includes(l)?-1:1,d=s&&c?-1:1,p=u(e,t);let{mainAxis:m,crossAxis:v,alignmentAxis:w}="number"==typeof p?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return r&&"number"==typeof w&&(v="end"===r?-1*w:w),c?{x:v*d,y:m*a}:{x:m*a,y:v*d}}(e,t);return l===(null==(n=r.offset)?void 0:n.placement)&&null!=(o=r.arrow)&&o.alignmentOffset?{}:{x:i+c.x,y:s+c.y,data:{...c,placement:l}}}}},st=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:s,rects:l,initialPlacement:r,platform:c,elements:a}=e,{mainAxis:w=!0,crossAxis:y=!0,fallbackPlacements:b,fallbackStrategy:L="bestFit",fallbackAxisSideDirection:T="none",flipAlignment:E=!0,...A}=u(t,e);if(null!=(n=s.arrow)&&n.alignmentOffset)return{};const C=h(i),R=g(r),k=h(r)===r,P=await(null==c.isRTL?void 0:c.isRTL(a.floating)),F=b||(k||!E?[v(r)]:function(t){const e=v(t);return[m(t),e,m(e)]}(r)),S="none"!==T;!b&&S&&F.push(...function(t,e,n,o){const i=f(t);let s=function(t,e,n){const o=["left","right"],i=["right","left"],s=["top","bottom"],l=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:o:e?o:i;case"left":case"right":return e?s:l;default:return[]}}(h(t),"start"===n,o);return i&&(s=s.map((t=>t+"-"+i)),e&&(s=s.concat(s.map(m)))),s}(r,E,T,P));const M=[r,...F],O=await x(e,A),D=[];let H=(null==(o=s.flip)?void 0:o.overflows)||[];if(w&&D.push(O[C]),y){const t=function(t,e,n){void 0===n&&(n=!1);const o=f(t),i=p(t),s=d(i);let l="x"===i?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return e.reference[s]>e.floating[s]&&(l=v(l)),[l,v(l)]}(i,l,P);D.push(O[t[0]],O[t[1]])}if(H=[...H,{placement:i,overflows:D}],!D.every((t=>t<=0))){var $,U;const t=((null==($=s.flip)?void 0:$.index)||0)+1,e=M[t];if(e)return{data:{index:t,overflows:H},reset:{placement:e}};let n=null==(U=H.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:U.placement;if(!n)switch(L){case"bestFit":{var B;const t=null==(B=H.filter((t=>{if(S){const e=g(t.placement);return e===R||"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=r}if(i!==n)return{reset:{placement:n}}}return{}}}},lt=(t,e,n)=>{const o=new Map,i={platform:et,...n},s={...i.platform,_c:o};return(async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:s=[],platform:l}=n,r=s.filter(Boolean),c=await(null==l.isRTL?void 0:l.isRTL(e));let a=await l.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:h}=y(a,o,c),f=o,d={},g=0;for(let n=0;n<r.length;n++){const{name:s,fn:p}=r[n],{x:m,y:v,data:w,reset:x}=await p({x:u,y:h,initialPlacement:o,placement:f,strategy:i,middlewareData:d,rects:a,platform:l,elements:{reference:t,floating:e}});u=null!=m?m:u,h=null!=v?v:h,d={...d,[s]:{...d[s],...w}},x&&g<=50&&(g++,"object"==typeof x&&(x.placement&&(f=x.placement),x.rects&&(a=!0===x.rects?await l.getElementRects({reference:t,floating:e,strategy:i}):x.rects),({x:u,y:h}=y(a,f,c))),n=-1)}return{x:u,y:h,placement:f,strategy:i,middlewareData:d}})(t,e,{...i,platform:s})}},926:(t,e,n)=>{n.d(e,{JD:()=>i,gj:()=>o,yd:()=>s});
9
+ class o{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}}},9060(t,e,n){n.d(e,{A:()=>a});var o=n(7663),i=n(1926),s=n(7615),l=n(189),r=function(t,e,n,o){return new(n||(n=Promise))(function(i,s){function l(t){try{c(o.next(t))}catch(t){s(t)}}function r(t){try{c(o.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(l,r)}c((o=o.apply(t,e||[])).next())})};class c extends s.A{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,i.gj)(this.el,"--trigger")||"hover",this.preventFloatingUI=(0,i.gj)(this.el,"--prevent-popper","false"),this.placement=(0,i.gj)(this.el,"--placement")||"top",this.strategy=(0,i.gj)(this.el,"--strategy"),this.scope=(0,i.gj)(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),"focus"===this.eventMode?(this.onToggleTouchListener=t=>{"touch"===t.pointerType&&this.enter()},this.toggle.addEventListener("pointerdown",this.onToggleTouchListener),this.onDocumentTouchListener=t=>{"touch"===t.pointerType&&(this.el.contains(t.target)||this.leave())},document.addEventListener("pointerdown",this.onDocumentTouchListener)):"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 r(this,void 0,void 0,function*(){const e="auto"===t?"top":t,n="auto"===t?["bottom","left","right"]:this.getFallbackPlacements(e),i=[(0,o.cY)(5),(0,o.UU)({fallbackPlacements:n})];return yield(0,o.rD)(this.toggle,this.content,{placement:e,strategy:this.strategy||"fixed",middleware:i})})}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,i.gj)(this.el,"--placement"),n=t||(!e||""===e)?"auto":l.lP[this.placement]||this.placement;this.positionTooltip(n).then(t=>{this.applyTooltipPosition(t.x,t.y,t.placement)}),this.cleanupAutoUpdate=(0,o.ll)(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,i.JD)("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,i.JD)("hide.hs.tooltip",this.el,this.el),(0,i.yd)(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),"focus"===this.eventMode?(this.onToggleTouchListener&&this.toggle.removeEventListener("pointerdown",this.onToggleTouchListener),this.onDocumentTouchListener&&document.removeEventListener("pointerdown",this.onDocumentTouchListener)):"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)}}const a=c},1926(t,e,n){n.d(e,{JD:()=>i,gj:()=>o,yd:()=>s});
10
10
  /*
11
- * @version: 4.1.3
11
+ * @version: 5.0.0
12
12
  * @author: Preline Labs Ltd.
13
13
  * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
14
14
  * Copyright 2024 Preline Labs Ltd.
15
15
  */
16
- const o=(t,e,n="")=>(window.getComputedStyle(t).getPropertyValue(e)||n).replace(" ",""),i=(t,e,n=null)=>{const o=new CustomEvent(t,{detail:{payload:n},bubbles:!0,cancelable:!0,composed:!1});e.dispatchEvent(o)},s=(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={};function n(o){var i=e[o];if(void 0!==i)return i.exports;var s=e[o]={exports:{}};return t[o](s,s.exports,n),s.exports}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);var o={};n.d(o,{A:()=>u});var i=n(663),s=n(926),l=n(615),r=n(189),c=function(t,e,n,o){return new(n||(n=Promise))((function(i,s){function l(t){try{c(o.next(t))}catch(t){s(t)}}function r(t){try{c(o.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(l,r)}c((o=o.apply(t,e||[])).next())}))};class a extends l.A{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.gj)(this.el,"--trigger")||"hover",this.preventFloatingUI=(0,s.gj)(this.el,"--prevent-popper","false"),this.placement=(0,s.gj)(this.el,"--placement")||"top",this.strategy=(0,s.gj)(this.el,"--strategy"),this.scope=(0,s.gj)(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.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 c(this,void 0,void 0,(function*(){const e="auto"===t?"top":t,n="auto"===t?["bottom","left","right"]:this.getFallbackPlacements(e),o=[(0,i.cY)(5),(0,i.UU)({fallbackPlacements:n})];return yield(0,i.rD)(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.gj)(this.el,"--placement"),n=t||(!e||""===e)?"auto":r.lP[this.placement]||this.placement;this.positionTooltip(n).then((t=>{this.applyTooltipPosition(t.x,t.y,t.placement)})),this.cleanupAutoUpdate=(0,i.ll)(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.JD)("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.JD)("hide.hs.tooltip",this.el,this.el),(0,s.yd)(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 a?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 a(t)}))}static show(t){const e=a.findInCollection(t);e&&e.element.show()}static hide(t){const e=a.findInCollection(t);e&&e.element.hide()}static on(t,e,n){const o=a.findInCollection(e);o&&(o.element.events[t]=n)}}const u=a;var h=o.A;export{h as default};
16
+ const o=(t,e,n="")=>(window.getComputedStyle(t).getPropertyValue(e)||n).replace(" ",""),i=(t,e,n=null)=>{const o=new CustomEvent(t,{detail:{payload:n},bubbles:!0,cancelable:!0,composed:!1});e.dispatchEvent(o)},s=(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()}},7663(t,e,n){n.d(e,{ll:()=>ft,rD:()=>pt,UU:()=>gt,cY:()=>dt});const o=Math.min,i=Math.max,s=Math.round,l=Math.floor,r=t=>({x:t,y:t}),c={left:"right",right:"left",bottom:"top",top:"bottom"};function a(t,e){return"function"==typeof t?t(e):t}function h(t){return t.split("-")[0]}function u(t){return t.split("-")[1]}function f(t){return"y"===t?"height":"width"}function d(t){const e=t[0];return"t"===e||"b"===e?"y":"x"}function g(t){return"x"===d(t)?"y":"x"}function p(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const m=["left","right"],w=["right","left"],v=["top","bottom"],y=["bottom","top"];function x(t,e,n,o){const i=u(t);let s=function(t,e,n){switch(t){case"top":case"bottom":return n?e?w:m:e?m:w;case"left":case"right":return e?v:y;default:return[]}}(h(t),"start"===n,o);return i&&(s=s.map(t=>t+"-"+i),e&&(s=s.concat(s.map(p)))),s}function b(t){const e=h(t);return c[e]+t.slice(e.length)}function L(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 T(t,e,n){let{reference:o,floating:i}=t;const s=d(e),l=g(e),r=f(l),c=h(e),a="y"===s,p=o.x+o.width/2-i.width/2,m=o.y+o.height/2-i.height/2,w=o[r]/2-i[r]/2;let v;switch(c){case"top":v={x:p,y:o.y-i.height};break;case"bottom":v={x:p,y:o.y+o.height};break;case"right":v={x:o.x+o.width,y:m};break;case"left":v={x:o.x-i.width,y:m};break;default:v={x:o.x,y:o.y}}switch(u(e)){case"start":v[l]-=w*(n&&a?-1:1);break;case"end":v[l]+=w*(n&&a?-1:1)}return v}async function E(t,e){var n;void 0===e&&(e={});const{x:o,y:i,platform:s,rects:l,elements:r,strategy:c}=t,{boundary:h="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:d=!1,padding:g=0}=a(e,t),p=function(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}}(g),m=r[d?"floating"===f?"reference":"floating":f],w=L(await s.getClippingRect({element:null==(n=await(null==s.isElement?void 0:s.isElement(m)))||n?m:m.contextElement||await(null==s.getDocumentElement?void 0:s.getDocumentElement(r.floating)),boundary:h,rootBoundary:u,strategy:c})),v="floating"===f?{x:o,y:i,width:l.floating.width,height:l.floating.height}:l.reference,y=await(null==s.getOffsetParent?void 0:s.getOffsetParent(r.floating)),x=await(null==s.isElement?void 0:s.isElement(y))&&await(null==s.getScale?void 0:s.getScale(y))||{x:1,y:1},b=L(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:r,rect:v,offsetParent:y,strategy:c}):v);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}}const C=new Set(["left","top"]);function A(){return"undefined"!=typeof window}function R(t){return P(t)?(t.nodeName||"").toLowerCase():"#document"}function k(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function S(t){var e;return null==(e=(P(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function P(t){return!!A()&&(t instanceof Node||t instanceof k(t).Node)}function D(t){return!!A()&&(t instanceof Element||t instanceof k(t).Element)}function F(t){return!!A()&&(t instanceof HTMLElement||t instanceof k(t).HTMLElement)}function M(t){return!(!A()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof k(t).ShadowRoot)}function O(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=z(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&"inline"!==i&&"contents"!==i}function $(t){return/^(table|td|th)$/.test(R(t))}function H(t){try{if(t.matches(":popover-open"))return!0}catch(t){}try{return t.matches(":modal")}catch(t){return!1}}const U=/transform|translate|scale|rotate|perspective|filter/,I=/paint|layout|strict|content/,W=t=>!!t&&"none"!==t;let j;function B(t){const e=D(t)?z(t):t;return W(e.transform)||W(e.translate)||W(e.scale)||W(e.rotate)||W(e.perspective)||!V()&&(W(e.backdropFilter)||W(e.filter))||U.test(e.willChange||"")||I.test(e.contain||"")}function V(){return null==j&&(j="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),j}function q(t){return/^(html|body|#document)$/.test(R(t))}function z(t){return k(t).getComputedStyle(t)}function N(t){return D(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function _(t){if("html"===R(t))return t;const e=t.assignedSlot||t.parentNode||M(t)&&t.host||S(t);return M(e)?e.host:e}function Y(t){const e=_(t);return q(e)?t.ownerDocument?t.ownerDocument.body:t.body:F(e)&&O(e)?e:Y(e)}function J(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const i=Y(t),s=i===(null==(o=t.ownerDocument)?void 0:o.body),l=k(i);if(s){const t=X(l);return e.concat(l,l.visualViewport||[],O(i)?i:[],t&&n?J(t):[])}return e.concat(i,J(i,[],n))}function X(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function G(t){const e=z(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=F(t),l=i?t.offsetWidth:n,r=i?t.offsetHeight:o,c=s(n)!==l||s(o)!==r;return c&&(n=l,o=r),{width:n,height:o,$:c}}function K(t){return D(t)?t:t.contextElement}function Q(t){const e=K(t);if(!F(e))return r(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:l}=G(e);let c=(l?s(n.width):n.width)/o,a=(l?s(n.height):n.height)/i;return c&&Number.isFinite(c)||(c=1),a&&Number.isFinite(a)||(a=1),{x:c,y:a}}const Z=r(0);function tt(t){const e=k(t);return V()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:Z}function et(t,e,n,o){void 0===e&&(e=!1),void 0===n&&(n=!1);const i=t.getBoundingClientRect(),s=K(t);let l=r(1);e&&(o?D(o)&&(l=Q(o)):l=Q(t));const c=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==k(t))&&e}(s,n,o)?tt(s):r(0);let a=(i.left+c.x)/l.x,h=(i.top+c.y)/l.y,u=i.width/l.x,f=i.height/l.y;if(s){const t=k(s),e=o&&D(o)?k(o):o;let n=t,i=X(n);for(;i&&o&&e!==n;){const t=Q(i),e=i.getBoundingClientRect(),o=z(i),s=e.left+(i.clientLeft+parseFloat(o.paddingLeft))*t.x,l=e.top+(i.clientTop+parseFloat(o.paddingTop))*t.y;a*=t.x,h*=t.y,u*=t.x,f*=t.y,a+=s,h+=l,n=k(i),i=X(n)}}return L({width:u,height:f,x:a,y:h})}function nt(t,e){const n=N(t).scrollLeft;return e?e.left+n:et(S(t)).left+n}function ot(t,e){const n=t.getBoundingClientRect();return{x:n.left+e.scrollLeft-nt(t,n),y:n.top+e.scrollTop}}function it(t,e,n){let o;if("viewport"===e)o=function(t,e){const n=k(t),o=S(t),i=n.visualViewport;let s=o.clientWidth,l=o.clientHeight,r=0,c=0;if(i){s=i.width,l=i.height;const t=V();(!t||t&&"fixed"===e)&&(r=i.offsetLeft,c=i.offsetTop)}const a=nt(o);if(a<=0){const t=o.ownerDocument,e=t.body,n=getComputedStyle(e),i="CSS1Compat"===t.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,l=Math.abs(o.clientWidth-e.clientWidth-i);l<=25&&(s-=l)}else a<=25&&(s+=a);return{width:s,height:l,x:r,y:c}}(t,n);else if("document"===e)o=function(t){const e=S(t),n=N(t),o=t.ownerDocument.body,s=i(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),l=i(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let r=-n.scrollLeft+nt(t);const c=-n.scrollTop;return"rtl"===z(o).direction&&(r+=i(e.clientWidth,o.clientWidth)-s),{width:s,height:l,x:r,y:c}}(S(t));else if(D(e))o=function(t,e){const n=et(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,s=F(t)?Q(t):r(1);return{width:t.clientWidth*s.x,height:t.clientHeight*s.y,x:i*s.x,y:o*s.y}}(e,n);else{const n=tt(t);o={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return L(o)}function st(t,e){const n=_(t);return!(n===e||!D(n)||q(n))&&("fixed"===z(n).position||st(n,e))}function lt(t,e,n){const o=F(e),i=S(e),s="fixed"===n,l=et(t,!0,s,e);let c={scrollLeft:0,scrollTop:0};const a=r(0);function h(){a.x=nt(i)}if(o||!o&&!s)if(("body"!==R(e)||O(i))&&(c=N(e)),o){const t=et(e,!0,s,e);a.x=t.x+e.clientLeft,a.y=t.y+e.clientTop}else i&&h();s&&!o&&i&&h();const u=!i||o||s?r(0):ot(i,c);return{x:l.left+c.scrollLeft-a.x-u.x,y:l.top+c.scrollTop-a.y-u.y,width:l.width,height:l.height}}function rt(t){return"static"===z(t).position}function ct(t,e){if(!F(t)||"fixed"===z(t).position)return null;if(e)return e(t);let n=t.offsetParent;return S(t)===n&&(n=n.ownerDocument.body),n}function at(t,e){const n=k(t);if(H(t))return n;if(!F(t)){let e=_(t);for(;e&&!q(e);){if(D(e)&&!rt(e))return e;e=_(e)}return n}let o=ct(t,e);for(;o&&$(o)&&rt(o);)o=ct(o,e);return o&&q(o)&&rt(o)&&!B(o)?n:o||function(t){let e=_(t);for(;F(e)&&!q(e);){if(B(e))return e;if(H(e))return null;e=_(e)}return null}(t)||n}const ht={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const s="fixed"===i,l=S(o),c=!!e&&H(e.floating);if(o===l||c&&s)return n;let a={scrollLeft:0,scrollTop:0},h=r(1);const u=r(0),f=F(o);if((f||!f&&!s)&&(("body"!==R(o)||O(l))&&(a=N(o)),f)){const t=et(o);h=Q(o),u.x=t.x+o.clientLeft,u.y=t.y+o.clientTop}const d=!l||f||s?r(0):ot(l,a);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-a.scrollLeft*h.x+u.x+d.x,y:n.y*h.y-a.scrollTop*h.y+u.y+d.y}},getDocumentElement:S,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:s,strategy:l}=t;const r=[..."clippingAncestors"===n?H(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let o=J(t,[],!1).filter(t=>D(t)&&"body"!==R(t)),i=null;const s="fixed"===z(t).position;let l=s?_(t):t;for(;D(l)&&!q(l);){const e=z(l),n=B(l);n||"fixed"!==e.position||(i=null),(s?!n&&!i:!n&&"static"===e.position&&i&&("absolute"===i.position||"fixed"===i.position)||O(l)&&!n&&st(t,l))?o=o.filter(t=>t!==l):i=e,l=_(l)}return e.set(t,o),o}(e,this._c):[].concat(n),s],c=it(e,r[0],l);let a=c.top,h=c.right,u=c.bottom,f=c.left;for(let t=1;t<r.length;t++){const n=it(e,r[t],l);a=i(n.top,a),h=o(n.right,h),u=o(n.bottom,u),f=i(n.left,f)}return{width:h-f,height:u-a,x:f,y:a}},getOffsetParent:at,getElementRects:async function(t){const e=this.getOffsetParent||at,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}=G(t);return{width:e,height:n}},getScale:Q,isElement:D,isRTL:function(t){return"rtl"===z(t).direction}};function ut(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function ft(t,e,n,s){void 0===s&&(s={});const{ancestorScroll:r=!0,ancestorResize:c=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:h="function"==typeof IntersectionObserver,animationFrame:u=!1}=s,f=K(t),d=r||c?[...f?J(f):[],...e?J(e):[]]:[];d.forEach(t=>{r&&t.addEventListener("scroll",n,{passive:!0}),c&&t.addEventListener("resize",n)});const g=f&&h?function(t,e){let n,s=null;const r=S(t);function c(){var t;clearTimeout(n),null==(t=s)||t.disconnect(),s=null}return function a(h,u){void 0===h&&(h=!1),void 0===u&&(u=1),c();const f=t.getBoundingClientRect(),{left:d,top:g,width:p,height:m}=f;if(h||e(),!p||!m)return;const w={rootMargin:-l(g)+"px "+-l(r.clientWidth-(d+p))+"px "+-l(r.clientHeight-(g+m))+"px "+-l(d)+"px",threshold:i(0,o(1,u))||1};let v=!0;function y(e){const o=e[0].intersectionRatio;if(o!==u){if(!v)return a();o?a(!1,o):n=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==o||ut(f,t.getBoundingClientRect())||a(),v=!1}try{s=new IntersectionObserver(y,{...w,root:r.ownerDocument})}catch(t){s=new IntersectionObserver(y,w)}s.observe(t)}(!0),c}(f,n):null;let p,m=-1,w=null;a&&(w=new ResizeObserver(t=>{let[o]=t;o&&o.target===f&&w&&e&&(w.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var t;null==(t=w)||t.observe(e)})),n()}),f&&!u&&w.observe(f),e&&w.observe(e));let v=u?et(t):null;return u&&function e(){const o=et(t);v&&!ut(v,o)&&n();v=o,p=requestAnimationFrame(e)}(),n(),()=>{var t;d.forEach(t=>{r&&t.removeEventListener("scroll",n),c&&t.removeEventListener("resize",n)}),null==g||g(),null==(t=w)||t.disconnect(),w=null,u&&cancelAnimationFrame(p)}}const dt=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:s,placement:l,middlewareData:r}=e,c=await async function(t,e){const{placement:n,platform:o,elements:i}=t,s=await(null==o.isRTL?void 0:o.isRTL(i.floating)),l=h(n),r=u(n),c="y"===d(n),f=C.has(l)?-1:1,g=s&&c?-1:1,p=a(e,t);let{mainAxis:m,crossAxis:w,alignmentAxis:v}="number"==typeof p?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return r&&"number"==typeof v&&(w="end"===r?-1*v:v),c?{x:w*g,y:m*f}:{x:m*f,y:w*g}}(e,t);return l===(null==(n=r.offset)?void 0:n.placement)&&null!=(o=r.arrow)&&o.alignmentOffset?{}:{x:i+c.x,y:s+c.y,data:{...c,placement:l}}}}},gt=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:s,rects:l,initialPlacement:r,platform:c,elements:m}=e,{mainAxis:w=!0,crossAxis:v=!0,fallbackPlacements:y,fallbackStrategy:L="bestFit",fallbackAxisSideDirection:T="none",flipAlignment:E=!0,...C}=a(t,e);if(null!=(n=s.arrow)&&n.alignmentOffset)return{};const A=h(i),R=d(r),k=h(r)===r,S=await(null==c.isRTL?void 0:c.isRTL(m.floating)),P=y||(k||!E?[b(r)]:function(t){const e=b(t);return[p(t),e,p(e)]}(r)),D="none"!==T;!y&&D&&P.push(...x(r,E,T,S));const F=[r,...P],M=await c.detectOverflow(e,C),O=[];let $=(null==(o=s.flip)?void 0:o.overflows)||[];if(w&&O.push(M[A]),v){const t=function(t,e,n){void 0===n&&(n=!1);const o=u(t),i=g(t),s=f(i);let l="x"===i?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return e.reference[s]>e.floating[s]&&(l=b(l)),[l,b(l)]}(i,l,S);O.push(M[t[0]],M[t[1]])}if($=[...$,{placement:i,overflows:O}],!O.every(t=>t<=0)){var H,U;const t=((null==(H=s.flip)?void 0:H.index)||0)+1,e=F[t];if(e){if(!("alignment"===v&&R!==d(e))||$.every(t=>d(t.placement)!==R||t.overflows[0]>0))return{data:{index:t,overflows:$},reset:{placement:e}}}let n=null==(U=$.filter(t=>t.overflows[0]<=0).sort((t,e)=>t.overflows[1]-e.overflows[1])[0])?void 0:U.placement;if(!n)switch(L){case"bestFit":{var I;const t=null==(I=$.filter(t=>{if(D){const e=d(t.placement);return e===R||"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:I[0];t&&(n=t);break}case"initialPlacement":n=r}if(i!==n)return{reset:{placement:n}}}return{}}}},pt=(t,e,n)=>{const o=new Map,i={platform:ht,...n},s={...i.platform,_c:o};return(async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:s=[],platform:l}=n,r=l.detectOverflow?l:{...l,detectOverflow:E},c=await(null==l.isRTL?void 0:l.isRTL(e));let a=await l.getElementRects({reference:t,floating:e,strategy:i}),{x:h,y:u}=T(a,o,c),f=o,d=0;const g={};for(let n=0;n<s.length;n++){const p=s[n];if(!p)continue;const{name:m,fn:w}=p,{x:v,y,data:x,reset:b}=await w({x:h,y:u,initialPlacement:o,placement:f,strategy:i,middlewareData:g,rects:a,platform:r,elements:{reference:t,floating:e}});h=null!=v?v:h,u=null!=y?y:u,g[m]={...g[m],...x},b&&d<50&&(d++,"object"==typeof b&&(b.placement&&(f=b.placement),b.rects&&(a=!0===b.rects?await l.getElementRects({reference:t,floating:e,strategy:i}):b.rects),({x:h,y:u}=T(a,f,c))),n=-1)}return{x:h,y:u,placement:f,strategy:i,middlewareData:g}})(t,e,{...i,platform:s})}}},e={};function n(o){var i=e[o];if(void 0!==i)return i.exports;var s=e[o]={exports:{}};return t[o](s,s.exports,n),s.exports}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);var o=n(9060);window.addEventListener("load",()=>{o.A.autoInit()}),"undefined"!=typeof window&&(window.HSTooltip=o.A);
package/non-auto.js ADDED
@@ -0,0 +1,24 @@
1
+ !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:()=>Lt,flip:()=>At,getOverflowAncestors:()=>it,hide:()=>Ot,inline:()=>Rt,limitShift:()=>_t,offset:()=>Et,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,u=t=>({x:t,y:t}),f={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"],L=["right","left"],E=["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?L:T:e?T:L;case"left":case"right":return e?E: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 f[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,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(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:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:g=0}=d(e,t),p=I(g),m=l[h?"floating"===f?"reference":"floating":f],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:u,strategy:a})),y="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=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 u(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=u(0);function ut(t){const e=k(t);return G()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:ct}function ft(t,e,n,o){void 0===e&&(e=!1),void 0===n&&(n=!1);const i=t.getBoundingClientRect(),r=lt(t);let s=u(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)?ut(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=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,f*=t.x,h*=t.y,a+=r,c+=s,n=k(i),i=rt(n)}}return O({width:f,height:h,x:a,y:c})}function ht(t,e){const n=et(t).scrollLeft;return e?e.left+n:ft(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=ft(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=W(t)?at(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=ut(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=ft(t,!0,r,e);let l={scrollLeft:0,scrollTop:0};const a=u(0);function c(){a.x=ht(i)}if(o||!o&&!r)if(("body"!==F(e)||V(i))&&(l=et(e)),o){const t=ft(e,!0,r,e);a.x=t.x+e.clientLeft,a.y=t.y+e.clientTop}else i&&c();r&&!o&&i&&c();const f=!i||o||r?u(0):dt(i,l);return{x:s.left+l.scrollLeft-a.x-f.x,y:s.top+l.scrollTop-a.y-f.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=u(1);const f=u(0),h=W(o);if((h||!h&&!r)&&(("body"!==F(o)||V(s))&&(a=et(o)),h)){const t=ft(o);c=at(o),f.x=t.x+o.clientLeft,f.y=t.y+o.clientTop}const d=!s||h||r?u(0):dt(s,a);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: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,u=a.right,f=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),u=s(n.right,u),f=s(n.bottom,f),h=l(n.left,h)}return{width:u-h,height:f-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:u="function"==typeof IntersectionObserver,animationFrame:f=!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&&u?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(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 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,f))||1};let y=!0;function v(e){const o=e[0].intersectionRatio;if(o!==f){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&&!f&&w.observe(h),e&&w.observe(e));let y=f?ft(t):null;return f&&function e(){const o=ft(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,f&&cancelAnimationFrame(p)}}const Lt=R,Et=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,u=r&&a?-1:1,f=d(e,t);let{mainAxis:h,crossAxis:m,alignmentAxis:w}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&"number"==typeof w&&(m="end"===l?-1*w:w),a?{x:m*u,y:h*c}:{x:h*c,y:m*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}}}}},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:u}=e,{crossAxis:f=!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),L=(null==(n=l.autoPlacement)?void 0:n.index)||0,E=v[L];if(null==E)return{};const C=x(E,s,await(null==c.isRTL?void 0:c.isRTL(u.floating)));if(a!==E)return{reset:{placement:v[0]}};const S=[T[g(E)],T[C[0]],T[C[1]]],A=[...(null==(o=l.autoPlacement)?void 0:o.overflows)||[],{placement:E,overflows:S}],I=v[L+1];if(I)return{data:{index:L+1,overflows:A},reset:{placement:I}};const O=A.map(t=>{const e=p(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]),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:L+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),u={x:n,y:o},f=await r.detectOverflow(e,c),p=y(g(i)),w=m(p);let v=u[w],x=u[p];if(s){const t="y"===w?"bottom":"right";v=h(v+f["y"===w?"top":"left"],v,v-f[t])}if(l){const t="y"===p?"bottom":"right";x=h(x+f["y"===p?"top":"left"],x,x-f[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:u=!0,crossAxis:f=!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),L=y(l),E=g(l)===l,C=await(null==a.isRTL?void 0:a.isRTL(c.floating)),I=h||(E||!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(u&&_.push(R[T]),f){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"===f&&L!==y(e))||H.every(t=>y(t.placement)!==L||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===L||"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:u=()=>{},...f}=d(t,e),h=await a.detectOverflow(e,f),m=g(i),w=p(i),v="y"===y(i),{width:x,height:b}=r.floating;let T,L;"top"===m||"bottom"===m?(T=m,L=w===(await(null==a.isRTL?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(L=m,T="end"===w?"top":"bottom");const E=b-h.top-h.bottom,C=x-h.left-h.right,S=s(b-h[T],E),A=s(x-h[L],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=E),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 u({...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:u,padding:f=0}=d(t,e)||{};if(null==u)return{};const g=I(f),m={x:n,y:o},y=v(i),x=w(y),b=await l.getDimensions(u),T="y"===y,L=T?"top":"left",E=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(u));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[L],_),M=s(g[E],_),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:u,y:f}=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!=u&&null!=f)return p.find(t=>u>t.left-w.left&&u<t.right+w.right&&f>t.top-w.top&&f<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),u={x:n,y:o},f=y(i),h=m(f);let p=u[h],w=u[f];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[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);w<n?w=n:w>o&&(w=o)}return{[h]:p,[f]: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:u,y:f}=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:u,y:f,initialPlacement:o,placement:h,strategy:i,middlewareData:g,rects:c,platform:l,elements:{reference:t,floating:e}});u=null!=y?y:u,f=null!=v?v:f,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:u,y:f}=P(c,h,a))),n=-1)}return{x:u,y:f,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){
2
+ /*
3
+ * HSBasePlugin
4
+ * @version: 5.0.0
5
+ * @author: Preline Labs Ltd.
6
+ * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
7
+ * Copyright 2024 Preline Labs Ltd.
8
+ */
9
+ 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){
10
+ /*
11
+ * HSTooltip
12
+ * @version: 5.0.0
13
+ * @author: Preline Labs Ltd.
14
+ * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
15
+ * Copyright 2024 Preline Labs Ltd.
16
+ */
17
+ 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),"focus"===this.eventMode?(this.onToggleTouchListener=t=>{"touch"===t.pointerType&&this.enter()},this.toggle.addEventListener("pointerdown",this.onToggleTouchListener),this.onDocumentTouchListener=t=>{"touch"===t.pointerType&&(this.el.contains(t.target)||this.leave())},document.addEventListener("pointerdown",this.onDocumentTouchListener)):"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),"focus"===this.eventMode?(this.onToggleTouchListener&&this.toggle.removeEventListener("pointerdown",this.onToggleTouchListener),this.onDocumentTouchListener&&document.removeEventListener("pointerdown",this.onDocumentTouchListener)):"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){
18
+ /*
19
+ * @version: 5.0.0
20
+ * @author: Preline Labs Ltd.
21
+ * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
22
+ * Copyright 2024 Preline Labs Ltd.
23
+ */
24
+ 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}},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)})());
package/non-auto.mjs ADDED
@@ -0,0 +1,16 @@
1
+ var t={189(t,e,n){n.d(e,{lP:()=>o});const o={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"}},7615(t,e,n){n.d(e,{A:()=>o});
2
+ /*
3
+ * HSBasePlugin
4
+ * @version: 5.0.0
5
+ * @author: Preline Labs Ltd.
6
+ * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
7
+ * Copyright 2024 Preline Labs Ltd.
8
+ */
9
+ class o{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}}},1926(t,e,n){n.d(e,{JD:()=>i,gj:()=>o,yd:()=>s});
10
+ /*
11
+ * @version: 5.0.0
12
+ * @author: Preline Labs Ltd.
13
+ * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
14
+ * Copyright 2024 Preline Labs Ltd.
15
+ */
16
+ const o=(t,e,n="")=>(window.getComputedStyle(t).getPropertyValue(e)||n).replace(" ",""),i=(t,e,n=null)=>{const o=new CustomEvent(t,{detail:{payload:n},bubbles:!0,cancelable:!0,composed:!1});e.dispatchEvent(o)},s=(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()}},7663(t,e,n){n.d(e,{ll:()=>ft,rD:()=>pt,UU:()=>gt,cY:()=>dt});const o=Math.min,i=Math.max,s=Math.round,l=Math.floor,r=t=>({x:t,y:t}),c={left:"right",right:"left",bottom:"top",top:"bottom"};function a(t,e){return"function"==typeof t?t(e):t}function h(t){return t.split("-")[0]}function u(t){return t.split("-")[1]}function f(t){return"y"===t?"height":"width"}function d(t){const e=t[0];return"t"===e||"b"===e?"y":"x"}function g(t){return"x"===d(t)?"y":"x"}function p(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const m=["left","right"],w=["right","left"],v=["top","bottom"],y=["bottom","top"];function x(t,e,n,o){const i=u(t);let s=function(t,e,n){switch(t){case"top":case"bottom":return n?e?w:m:e?m:w;case"left":case"right":return e?v:y;default:return[]}}(h(t),"start"===n,o);return i&&(s=s.map(t=>t+"-"+i),e&&(s=s.concat(s.map(p)))),s}function b(t){const e=h(t);return c[e]+t.slice(e.length)}function L(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 T(t,e,n){let{reference:o,floating:i}=t;const s=d(e),l=g(e),r=f(l),c=h(e),a="y"===s,p=o.x+o.width/2-i.width/2,m=o.y+o.height/2-i.height/2,w=o[r]/2-i[r]/2;let v;switch(c){case"top":v={x:p,y:o.y-i.height};break;case"bottom":v={x:p,y:o.y+o.height};break;case"right":v={x:o.x+o.width,y:m};break;case"left":v={x:o.x-i.width,y:m};break;default:v={x:o.x,y:o.y}}switch(u(e)){case"start":v[l]-=w*(n&&a?-1:1);break;case"end":v[l]+=w*(n&&a?-1:1)}return v}async function E(t,e){var n;void 0===e&&(e={});const{x:o,y:i,platform:s,rects:l,elements:r,strategy:c}=t,{boundary:h="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:d=!1,padding:g=0}=a(e,t),p=function(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}}(g),m=r[d?"floating"===f?"reference":"floating":f],w=L(await s.getClippingRect({element:null==(n=await(null==s.isElement?void 0:s.isElement(m)))||n?m:m.contextElement||await(null==s.getDocumentElement?void 0:s.getDocumentElement(r.floating)),boundary:h,rootBoundary:u,strategy:c})),v="floating"===f?{x:o,y:i,width:l.floating.width,height:l.floating.height}:l.reference,y=await(null==s.getOffsetParent?void 0:s.getOffsetParent(r.floating)),x=await(null==s.isElement?void 0:s.isElement(y))&&await(null==s.getScale?void 0:s.getScale(y))||{x:1,y:1},b=L(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:r,rect:v,offsetParent:y,strategy:c}):v);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}}const C=new Set(["left","top"]);function A(){return"undefined"!=typeof window}function R(t){return P(t)?(t.nodeName||"").toLowerCase():"#document"}function k(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function S(t){var e;return null==(e=(P(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function P(t){return!!A()&&(t instanceof Node||t instanceof k(t).Node)}function D(t){return!!A()&&(t instanceof Element||t instanceof k(t).Element)}function F(t){return!!A()&&(t instanceof HTMLElement||t instanceof k(t).HTMLElement)}function M(t){return!(!A()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof k(t).ShadowRoot)}function O(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=z(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&"inline"!==i&&"contents"!==i}function $(t){return/^(table|td|th)$/.test(R(t))}function H(t){try{if(t.matches(":popover-open"))return!0}catch(t){}try{return t.matches(":modal")}catch(t){return!1}}const U=/transform|translate|scale|rotate|perspective|filter/,I=/paint|layout|strict|content/,W=t=>!!t&&"none"!==t;let j;function B(t){const e=D(t)?z(t):t;return W(e.transform)||W(e.translate)||W(e.scale)||W(e.rotate)||W(e.perspective)||!V()&&(W(e.backdropFilter)||W(e.filter))||U.test(e.willChange||"")||I.test(e.contain||"")}function V(){return null==j&&(j="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),j}function q(t){return/^(html|body|#document)$/.test(R(t))}function z(t){return k(t).getComputedStyle(t)}function N(t){return D(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function _(t){if("html"===R(t))return t;const e=t.assignedSlot||t.parentNode||M(t)&&t.host||S(t);return M(e)?e.host:e}function Y(t){const e=_(t);return q(e)?t.ownerDocument?t.ownerDocument.body:t.body:F(e)&&O(e)?e:Y(e)}function J(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const i=Y(t),s=i===(null==(o=t.ownerDocument)?void 0:o.body),l=k(i);if(s){const t=X(l);return e.concat(l,l.visualViewport||[],O(i)?i:[],t&&n?J(t):[])}return e.concat(i,J(i,[],n))}function X(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function G(t){const e=z(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=F(t),l=i?t.offsetWidth:n,r=i?t.offsetHeight:o,c=s(n)!==l||s(o)!==r;return c&&(n=l,o=r),{width:n,height:o,$:c}}function K(t){return D(t)?t:t.contextElement}function Q(t){const e=K(t);if(!F(e))return r(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:l}=G(e);let c=(l?s(n.width):n.width)/o,a=(l?s(n.height):n.height)/i;return c&&Number.isFinite(c)||(c=1),a&&Number.isFinite(a)||(a=1),{x:c,y:a}}const Z=r(0);function tt(t){const e=k(t);return V()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:Z}function et(t,e,n,o){void 0===e&&(e=!1),void 0===n&&(n=!1);const i=t.getBoundingClientRect(),s=K(t);let l=r(1);e&&(o?D(o)&&(l=Q(o)):l=Q(t));const c=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==k(t))&&e}(s,n,o)?tt(s):r(0);let a=(i.left+c.x)/l.x,h=(i.top+c.y)/l.y,u=i.width/l.x,f=i.height/l.y;if(s){const t=k(s),e=o&&D(o)?k(o):o;let n=t,i=X(n);for(;i&&o&&e!==n;){const t=Q(i),e=i.getBoundingClientRect(),o=z(i),s=e.left+(i.clientLeft+parseFloat(o.paddingLeft))*t.x,l=e.top+(i.clientTop+parseFloat(o.paddingTop))*t.y;a*=t.x,h*=t.y,u*=t.x,f*=t.y,a+=s,h+=l,n=k(i),i=X(n)}}return L({width:u,height:f,x:a,y:h})}function nt(t,e){const n=N(t).scrollLeft;return e?e.left+n:et(S(t)).left+n}function ot(t,e){const n=t.getBoundingClientRect();return{x:n.left+e.scrollLeft-nt(t,n),y:n.top+e.scrollTop}}function it(t,e,n){let o;if("viewport"===e)o=function(t,e){const n=k(t),o=S(t),i=n.visualViewport;let s=o.clientWidth,l=o.clientHeight,r=0,c=0;if(i){s=i.width,l=i.height;const t=V();(!t||t&&"fixed"===e)&&(r=i.offsetLeft,c=i.offsetTop)}const a=nt(o);if(a<=0){const t=o.ownerDocument,e=t.body,n=getComputedStyle(e),i="CSS1Compat"===t.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,l=Math.abs(o.clientWidth-e.clientWidth-i);l<=25&&(s-=l)}else a<=25&&(s+=a);return{width:s,height:l,x:r,y:c}}(t,n);else if("document"===e)o=function(t){const e=S(t),n=N(t),o=t.ownerDocument.body,s=i(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),l=i(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let r=-n.scrollLeft+nt(t);const c=-n.scrollTop;return"rtl"===z(o).direction&&(r+=i(e.clientWidth,o.clientWidth)-s),{width:s,height:l,x:r,y:c}}(S(t));else if(D(e))o=function(t,e){const n=et(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,s=F(t)?Q(t):r(1);return{width:t.clientWidth*s.x,height:t.clientHeight*s.y,x:i*s.x,y:o*s.y}}(e,n);else{const n=tt(t);o={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return L(o)}function st(t,e){const n=_(t);return!(n===e||!D(n)||q(n))&&("fixed"===z(n).position||st(n,e))}function lt(t,e,n){const o=F(e),i=S(e),s="fixed"===n,l=et(t,!0,s,e);let c={scrollLeft:0,scrollTop:0};const a=r(0);function h(){a.x=nt(i)}if(o||!o&&!s)if(("body"!==R(e)||O(i))&&(c=N(e)),o){const t=et(e,!0,s,e);a.x=t.x+e.clientLeft,a.y=t.y+e.clientTop}else i&&h();s&&!o&&i&&h();const u=!i||o||s?r(0):ot(i,c);return{x:l.left+c.scrollLeft-a.x-u.x,y:l.top+c.scrollTop-a.y-u.y,width:l.width,height:l.height}}function rt(t){return"static"===z(t).position}function ct(t,e){if(!F(t)||"fixed"===z(t).position)return null;if(e)return e(t);let n=t.offsetParent;return S(t)===n&&(n=n.ownerDocument.body),n}function at(t,e){const n=k(t);if(H(t))return n;if(!F(t)){let e=_(t);for(;e&&!q(e);){if(D(e)&&!rt(e))return e;e=_(e)}return n}let o=ct(t,e);for(;o&&$(o)&&rt(o);)o=ct(o,e);return o&&q(o)&&rt(o)&&!B(o)?n:o||function(t){let e=_(t);for(;F(e)&&!q(e);){if(B(e))return e;if(H(e))return null;e=_(e)}return null}(t)||n}const ht={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const s="fixed"===i,l=S(o),c=!!e&&H(e.floating);if(o===l||c&&s)return n;let a={scrollLeft:0,scrollTop:0},h=r(1);const u=r(0),f=F(o);if((f||!f&&!s)&&(("body"!==R(o)||O(l))&&(a=N(o)),f)){const t=et(o);h=Q(o),u.x=t.x+o.clientLeft,u.y=t.y+o.clientTop}const d=!l||f||s?r(0):ot(l,a);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-a.scrollLeft*h.x+u.x+d.x,y:n.y*h.y-a.scrollTop*h.y+u.y+d.y}},getDocumentElement:S,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:s,strategy:l}=t;const r=[..."clippingAncestors"===n?H(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let o=J(t,[],!1).filter(t=>D(t)&&"body"!==R(t)),i=null;const s="fixed"===z(t).position;let l=s?_(t):t;for(;D(l)&&!q(l);){const e=z(l),n=B(l);n||"fixed"!==e.position||(i=null),(s?!n&&!i:!n&&"static"===e.position&&i&&("absolute"===i.position||"fixed"===i.position)||O(l)&&!n&&st(t,l))?o=o.filter(t=>t!==l):i=e,l=_(l)}return e.set(t,o),o}(e,this._c):[].concat(n),s],c=it(e,r[0],l);let a=c.top,h=c.right,u=c.bottom,f=c.left;for(let t=1;t<r.length;t++){const n=it(e,r[t],l);a=i(n.top,a),h=o(n.right,h),u=o(n.bottom,u),f=i(n.left,f)}return{width:h-f,height:u-a,x:f,y:a}},getOffsetParent:at,getElementRects:async function(t){const e=this.getOffsetParent||at,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}=G(t);return{width:e,height:n}},getScale:Q,isElement:D,isRTL:function(t){return"rtl"===z(t).direction}};function ut(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function ft(t,e,n,s){void 0===s&&(s={});const{ancestorScroll:r=!0,ancestorResize:c=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:h="function"==typeof IntersectionObserver,animationFrame:u=!1}=s,f=K(t),d=r||c?[...f?J(f):[],...e?J(e):[]]:[];d.forEach(t=>{r&&t.addEventListener("scroll",n,{passive:!0}),c&&t.addEventListener("resize",n)});const g=f&&h?function(t,e){let n,s=null;const r=S(t);function c(){var t;clearTimeout(n),null==(t=s)||t.disconnect(),s=null}return function a(h,u){void 0===h&&(h=!1),void 0===u&&(u=1),c();const f=t.getBoundingClientRect(),{left:d,top:g,width:p,height:m}=f;if(h||e(),!p||!m)return;const w={rootMargin:-l(g)+"px "+-l(r.clientWidth-(d+p))+"px "+-l(r.clientHeight-(g+m))+"px "+-l(d)+"px",threshold:i(0,o(1,u))||1};let v=!0;function y(e){const o=e[0].intersectionRatio;if(o!==u){if(!v)return a();o?a(!1,o):n=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==o||ut(f,t.getBoundingClientRect())||a(),v=!1}try{s=new IntersectionObserver(y,{...w,root:r.ownerDocument})}catch(t){s=new IntersectionObserver(y,w)}s.observe(t)}(!0),c}(f,n):null;let p,m=-1,w=null;a&&(w=new ResizeObserver(t=>{let[o]=t;o&&o.target===f&&w&&e&&(w.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var t;null==(t=w)||t.observe(e)})),n()}),f&&!u&&w.observe(f),e&&w.observe(e));let v=u?et(t):null;return u&&function e(){const o=et(t);v&&!ut(v,o)&&n();v=o,p=requestAnimationFrame(e)}(),n(),()=>{var t;d.forEach(t=>{r&&t.removeEventListener("scroll",n),c&&t.removeEventListener("resize",n)}),null==g||g(),null==(t=w)||t.disconnect(),w=null,u&&cancelAnimationFrame(p)}}const dt=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:s,placement:l,middlewareData:r}=e,c=await async function(t,e){const{placement:n,platform:o,elements:i}=t,s=await(null==o.isRTL?void 0:o.isRTL(i.floating)),l=h(n),r=u(n),c="y"===d(n),f=C.has(l)?-1:1,g=s&&c?-1:1,p=a(e,t);let{mainAxis:m,crossAxis:w,alignmentAxis:v}="number"==typeof p?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return r&&"number"==typeof v&&(w="end"===r?-1*v:v),c?{x:w*g,y:m*f}:{x:m*f,y:w*g}}(e,t);return l===(null==(n=r.offset)?void 0:n.placement)&&null!=(o=r.arrow)&&o.alignmentOffset?{}:{x:i+c.x,y:s+c.y,data:{...c,placement:l}}}}},gt=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:s,rects:l,initialPlacement:r,platform:c,elements:m}=e,{mainAxis:w=!0,crossAxis:v=!0,fallbackPlacements:y,fallbackStrategy:L="bestFit",fallbackAxisSideDirection:T="none",flipAlignment:E=!0,...C}=a(t,e);if(null!=(n=s.arrow)&&n.alignmentOffset)return{};const A=h(i),R=d(r),k=h(r)===r,S=await(null==c.isRTL?void 0:c.isRTL(m.floating)),P=y||(k||!E?[b(r)]:function(t){const e=b(t);return[p(t),e,p(e)]}(r)),D="none"!==T;!y&&D&&P.push(...x(r,E,T,S));const F=[r,...P],M=await c.detectOverflow(e,C),O=[];let $=(null==(o=s.flip)?void 0:o.overflows)||[];if(w&&O.push(M[A]),v){const t=function(t,e,n){void 0===n&&(n=!1);const o=u(t),i=g(t),s=f(i);let l="x"===i?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return e.reference[s]>e.floating[s]&&(l=b(l)),[l,b(l)]}(i,l,S);O.push(M[t[0]],M[t[1]])}if($=[...$,{placement:i,overflows:O}],!O.every(t=>t<=0)){var H,U;const t=((null==(H=s.flip)?void 0:H.index)||0)+1,e=F[t];if(e){if(!("alignment"===v&&R!==d(e))||$.every(t=>d(t.placement)!==R||t.overflows[0]>0))return{data:{index:t,overflows:$},reset:{placement:e}}}let n=null==(U=$.filter(t=>t.overflows[0]<=0).sort((t,e)=>t.overflows[1]-e.overflows[1])[0])?void 0:U.placement;if(!n)switch(L){case"bestFit":{var I;const t=null==(I=$.filter(t=>{if(D){const e=d(t.placement);return e===R||"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:I[0];t&&(n=t);break}case"initialPlacement":n=r}if(i!==n)return{reset:{placement:n}}}return{}}}},pt=(t,e,n)=>{const o=new Map,i={platform:ht,...n},s={...i.platform,_c:o};return(async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:s=[],platform:l}=n,r=l.detectOverflow?l:{...l,detectOverflow:E},c=await(null==l.isRTL?void 0:l.isRTL(e));let a=await l.getElementRects({reference:t,floating:e,strategy:i}),{x:h,y:u}=T(a,o,c),f=o,d=0;const g={};for(let n=0;n<s.length;n++){const p=s[n];if(!p)continue;const{name:m,fn:w}=p,{x:v,y,data:x,reset:b}=await w({x:h,y:u,initialPlacement:o,placement:f,strategy:i,middlewareData:g,rects:a,platform:r,elements:{reference:t,floating:e}});h=null!=v?v:h,u=null!=y?y:u,g[m]={...g[m],...x},b&&d<50&&(d++,"object"==typeof b&&(b.placement&&(f=b.placement),b.rects&&(a=!0===b.rects?await l.getElementRects({reference:t,floating:e,strategy:i}):b.rects),({x:h,y:u}=T(a,f,c))),n=-1)}return{x:h,y:u,placement:f,strategy:i,middlewareData:g}})(t,e,{...i,platform:s})}}},e={};function n(o){var i=e[o];if(void 0!==i)return i.exports;var s=e[o]={exports:{}};return t[o](s,s.exports,n),s.exports}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);var o={};n.d(o,{A:()=>h});var i=n(7663),s=n(1926),l=n(7615),r=n(189),c=function(t,e,n,o){return new(n||(n=Promise))(function(i,s){function l(t){try{c(o.next(t))}catch(t){s(t)}}function r(t){try{c(o.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(l,r)}c((o=o.apply(t,e||[])).next())})};class a extends l.A{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.gj)(this.el,"--trigger")||"hover",this.preventFloatingUI=(0,s.gj)(this.el,"--prevent-popper","false"),this.placement=(0,s.gj)(this.el,"--placement")||"top",this.strategy=(0,s.gj)(this.el,"--strategy"),this.scope=(0,s.gj)(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),"focus"===this.eventMode?(this.onToggleTouchListener=t=>{"touch"===t.pointerType&&this.enter()},this.toggle.addEventListener("pointerdown",this.onToggleTouchListener),this.onDocumentTouchListener=t=>{"touch"===t.pointerType&&(this.el.contains(t.target)||this.leave())},document.addEventListener("pointerdown",this.onDocumentTouchListener)):"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 c(this,void 0,void 0,function*(){const e="auto"===t?"top":t,n="auto"===t?["bottom","left","right"]:this.getFallbackPlacements(e),o=[(0,i.cY)(5),(0,i.UU)({fallbackPlacements:n})];return yield(0,i.rD)(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.gj)(this.el,"--placement"),n=t||(!e||""===e)?"auto":r.lP[this.placement]||this.placement;this.positionTooltip(n).then(t=>{this.applyTooltipPosition(t.x,t.y,t.placement)}),this.cleanupAutoUpdate=(0,i.ll)(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.JD)("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.JD)("hide.hs.tooltip",this.el,this.el),(0,s.yd)(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),"focus"===this.eventMode?(this.onToggleTouchListener&&this.toggle.removeEventListener("pointerdown",this.onToggleTouchListener),this.onDocumentTouchListener&&document.removeEventListener("pointerdown",this.onDocumentTouchListener)):"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 a?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 a(t)})}static show(t){const e=a.findInCollection(t);e&&e.element.show()}static hide(t){const e=a.findInCollection(t);e&&e.element.hide()}static on(t,e,n){const o=a.findInCollection(e);o&&(o.element.events[t]=n)}}const h=a,u=o.A;export{u as default};
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@preline/tooltip",
3
- "version": "4.1.3",
3
+ "version": "5.0.0",
4
4
  "description": "Preline UI is an open-source set of prebuilt UI components based on the utility-first Tailwind CSS framework.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
7
7
  "repository": "https://github.com/htmlstreamofficial/preline.git",
8
- "homepage": "https://preline.co/plugins.html",
9
- "keywords": ["preline", "html", "css", "next", "nuxt", "vue", "react", "angular", "javascript", "typescript", "tailwind", "tailwind components", "tailwind elements", "tailwind library", "tailwind sections", "tailwind css", "tailwind ui", "tailwind css react", "tailwind css vue", "tailwind css angular", "tailwind css laravel", "tailwindcss plugin", "tailwindcss plugins", "accordion"],
8
+ "homepage": "https://preline.co/plugins/tooltip.html",
9
+ "keywords": ["preline", "html", "css", "next", "nuxt", "vue", "react", "angular", "javascript", "typescript", "tailwind", "tailwind components", "tailwind elements", "tailwind library", "tailwind sections", "tailwind css", "tailwind ui", "tailwind css react", "tailwind css vue", "tailwind css angular", "tailwind css laravel", "tailwindcss plugin", "tailwindcss plugins", "tooltip"],
10
10
  "author": "Preline Labs Ltd.",
11
11
  "license": "Licensed under MIT and Preline UI Fair Use License",
12
12
  "publishConfig": {