UNPKG

@asicupv/paella-extra-plugins

Version:
2 lines 41 kB
var e=require(`./paella-extra-plugins-rolldown-runtime.cjs.js`).t({ShepherdBase:()=>mt,default:()=>$});function t(e){return e instanceof HTMLElement}function n(e){return typeof e==`function`}function r(e){return typeof e==`string`}function i(e){return e===void 0}var a=class{on(e,t,n,r=!1){var a;return i(this.bindings)&&(this.bindings={}),i(this.bindings[e])&&(this.bindings[e]=[]),(a=this.bindings[e])==null||a.push({handler:t,ctx:n,once:r}),this}once(e,t,n){return this.on(e,t,n,!0)}off(e,t){if(i(this.bindings)||i(this.bindings[e]))return this;var n;return i(t)?delete this.bindings[e]:(n=this.bindings[e])==null||n.forEach((n,r)=>{var i;n.handler===t&&((i=this.bindings[e])==null||i.splice(r,1))}),this}trigger(e,...t){var n;return!i(this.bindings)&&this.bindings[e]&&((n=this.bindings[e])==null||n.forEach((n,r)=>{let{ctx:i,handler:a,once:o}=n,s=i||this;var c;(a.apply(s,t),o)&&((c=this.bindings[e])==null||c.splice(r,1))})),this}};function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o.apply(null,arguments)}function s(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var c={defaultMerge:Symbol(`deepmerge-ts: default merge`),skip:Symbol(`deepmerge-ts: skip`)};function l(e,t){return t}function u(e,t){return e.filter(e=>e!==void 0)}var d;function f(e){return typeof e!=`object`||!e?0:Array.isArray(e)?2:function(e){if(!h.includes(Object.prototype.toString.call(e)))return!1;let{constructor:t}=e;if(t===void 0)return!0;let n=t.prototype;return!(typeof n!=`object`||!n||!h.includes(Object.prototype.toString.call(n))||!n.hasOwnProperty(`isPrototypeOf`))}(e)?1:e instanceof Set?3:e instanceof Map?4:5}function p(e,t){return typeof e==`object`&&Object.prototype.propertyIsEnumerable.call(e,t)}function m(e){let t=0,n=e[0]?.[Symbol.iterator]();return{[Symbol.iterator]:()=>({next(){for(;;){if(n===void 0)return{done:!0,value:void 0};let r=n.next();if(!0!==r.done)return{done:!1,value:r.value};t+=1,n=e[t]?.[Symbol.iterator]()}}})}}(function(e){e[e.NOT=0]=`NOT`,e[e.RECORD=1]=`RECORD`,e[e.ARRAY=2]=`ARRAY`,e[e.SET=3]=`SET`,e[e.MAP=4]=`MAP`,e[e.OTHER=5]=`OTHER`})(d||={});var h=[`[object Object]`,`[object Module]`],g={mergeRecords:function(e,t,n){let r={};for(let i of function(e){let t=new Set;for(let n of e)for(let e of[...Object.keys(n),...Object.getOwnPropertySymbols(n)])t.add(e);return t}(e)){let a=[];for(let t of e)p(t,i)&&a.push(t[i]);if(a.length===0)continue;let o=v(a,t,t.metaDataUpdater(n,{key:i,parents:e}));o!==c.skip&&(i===`__proto__`?Object.defineProperty(r,i,{value:o,configurable:!0,enumerable:!0,writable:!0}):r[i]=o)}return r},mergeArrays:function(e){return e.flat()},mergeSets:function(e){return new Set(m(e))},mergeMaps:function(e){return new Map(m(e))},mergeOthers:function(e){return e.at(-1)}};function _(...e){return function(e,t){let n=function(e,t){var n;return{defaultMergeFunctions:g,mergeFunctions:o({},g,Object.fromEntries(Object.entries(e).filter(([e,t])=>Object.hasOwn(g,e)).map(([e,t])=>!1===t?[e,g.mergeOthers]:[e,t]))),metaDataUpdater:e.metaDataUpdater??l,deepmerge:t,useImplicitDefaultMerging:(n=e.enableImplicitDefaultMerging)!=null&&n,filterValues:!1===e.filterValues?void 0:e.filterValues??u,actions:c}}(e,r);function r(...e){return v(e,n,t)}return r}({})(...e)}function v(e,t,n){let r=(t.filterValues==null?void 0:t.filterValues(e,n))??e;if(r.length===0)return;if(r.length===1)return y(r,t,n);let i=f(r[0]);if(i!==0&&i!==5){for(let e=1;e<r.length;e++)if(f(r[e])!==i)return y(r,t,n)}switch(i){case 1:return function(e,t,n){let r=t.mergeFunctions.mergeRecords(e,t,n);return r===c.defaultMerge||t.useImplicitDefaultMerging&&r===void 0&&t.mergeFunctions.mergeRecords!==t.defaultMergeFunctions.mergeRecords?t.defaultMergeFunctions.mergeRecords(e,t,n):r}(r,t,n);case 2:return function(e,t,n){let r=t.mergeFunctions.mergeArrays(e,t,n);return r===c.defaultMerge||t.useImplicitDefaultMerging&&r===void 0&&t.mergeFunctions.mergeArrays!==t.defaultMergeFunctions.mergeArrays?t.defaultMergeFunctions.mergeArrays(e):r}(r,t,n);case 3:return function(e,t,n){let r=t.mergeFunctions.mergeSets(e,t,n);return r===c.defaultMerge||t.useImplicitDefaultMerging&&r===void 0&&t.mergeFunctions.mergeSets!==t.defaultMergeFunctions.mergeSets?t.defaultMergeFunctions.mergeSets(e):r}(r,t,n);case 4:return function(e,t,n){let r=t.mergeFunctions.mergeMaps(e,t,n);return r===c.defaultMerge||t.useImplicitDefaultMerging&&r===void 0&&t.mergeFunctions.mergeMaps!==t.defaultMergeFunctions.mergeMaps?t.defaultMergeFunctions.mergeMaps(e):r}(r,t,n);default:return y(r,t,n)}}function y(e,t,n){let r=t.mergeFunctions.mergeOthers(e,t,n);return r===c.defaultMerge||t.useImplicitDefaultMerging&&r===void 0&&t.mergeFunctions.mergeOthers!==t.defaultMergeFunctions.mergeOthers?t.defaultMergeFunctions.mergeOthers(e):r}function b(e){let t=Object.getOwnPropertyNames(e.constructor.prototype);for(let n=0;n<t.length;n++){let r=t[n],i=e[r];r!==`constructor`&&typeof i==`function`&&(e[r]=i.bind(e))}return e}function x(e){let{event:t,selector:n}=e.options.advanceOn||{};if(t){let r=function(e,t){return n=>{if(e.isOpen()){let r=e.el&&n.currentTarget===e.el;(!i(t)&&n.currentTarget.matches(t)||r)&&e.tour.next()}}}(e,n),a=null;if(!i(n)&&(a=document.querySelector(n),!a))return;a?(a.addEventListener(t,r),e.on(`destroy`,()=>a.removeEventListener(t,r))):(document.body.addEventListener(t,r,!0),e.on(`destroy`,()=>document.body.removeEventListener(t,r,!0)))}}function S(e){return r(e)&&e!==``?e.charAt(e.length-1)===`-`?e:`${e}-`:``}function C(e){return e==null||!e.element||!e.on}function w(){let e=Date.now();return`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,t=>{let n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),(t==`x`?n:3&n|8).toString(16)})}var T=[`start`,`end`],E=[`top`,`right`,`bottom`,`left`].reduce((e,t)=>e.concat(t,t+`-`+T[0],t+`-`+T[1]),[]),D=Math.min,O=Math.max,k=Math.round,A=Math.floor,j=e=>({x:e,y:e}),M={left:`right`,right:`left`,bottom:`top`,top:`bottom`},ee={start:`end`,end:`start`};function te(e,t,n){return O(e,D(t,n))}function N(e,t){return typeof e==`function`?e(t):e}function P(e){return e.split(`-`)[0]}function F(e){return e.split(`-`)[1]}function I(e){return e===`x`?`y`:`x`}function ne(e){return e===`y`?`height`:`width`}var re=new Set([`top`,`bottom`]);function L(e){return re.has(P(e))?`y`:`x`}function ie(e){return I(L(e))}function ae(e,t,n){n===void 0&&(n=!1);let r=F(e),i=ie(e),a=ne(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=z(o)),[o,z(o)]}function R(e){return e.replace(/start|end/g,e=>ee[e])}var oe=[`left`,`right`],se=[`right`,`left`],ce=[`top`,`bottom`],le=[`bottom`,`top`];function ue(e,t,n,r){let i=F(e),a=function(e,t,n){switch(e){case`top`:case`bottom`:return n?t?se:oe:t?oe:se;case`left`:case`right`:return t?ce:le;default:return[]}}(P(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(R)))),a}function z(e){return e.replace(/left|right|bottom|top/g,e=>M[e])}function de(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:function(e){return o({top:0,right:0,bottom:0,left:0},e)}(e)}function fe(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}var pe=[`crossAxis`,`alignment`,`allowedPlacements`,`autoAlignment`],me=[`mainAxis`,`crossAxis`,`fallbackPlacements`,`fallbackStrategy`,`fallbackAxisSideDirection`,`flipAlignment`],he=[`mainAxis`,`crossAxis`,`limiter`];function ge(e,t,n){let{reference:r,floating:i}=e,a=L(t),o=ie(t),s=ne(o),c=P(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(F(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1)}return p}async function _e(e,t){var n;t===void 0&&(t={});let{x:r,y:i,platform:a,rects:o,elements:s,strategy:c}=e,{boundary:l=`clippingAncestors`,rootBoundary:u=`viewport`,elementContext:d=`floating`,altBoundary:f=!1,padding:p=0}=N(t,e),m=de(p),h=s[f?d===`floating`?`reference`:`floating`:d],g=fe(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(h)))==null||n?h:h.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:l,rootBoundary:u,strategy:c})),_=d===`floating`?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,v=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),y=await(a.isElement==null?void 0:a.isElement(v))&&await(a.getScale==null?void 0:a.getScale(v))||{x:1,y:1},b=fe(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:_,offsetParent:v,strategy:c}):_);return{top:(g.top-b.top+m.top)/y.y,bottom:(b.bottom-g.bottom+m.bottom)/y.y,left:(g.left-b.left+m.left)/y.x,right:(b.right-g.right+m.right)/y.x}}var ve=new Set([`left`,`top`]);function ye(){return typeof window<`u`}function B(e){return be(e)?(e.nodeName||``).toLowerCase():`#document`}function V(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function H(e){return((be(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function be(e){return!!ye()&&(e instanceof Node||e instanceof V(e).Node)}function U(e){return!!ye()&&(e instanceof Element||e instanceof V(e).Element)}function W(e){return!!ye()&&(e instanceof HTMLElement||e instanceof V(e).HTMLElement)}function xe(e){return!(!ye()||typeof ShadowRoot>`u`)&&(e instanceof ShadowRoot||e instanceof V(e).ShadowRoot)}var Se=new Set([`inline`,`contents`]);function G(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=q(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Se.has(i)}var Ce=new Set([`table`,`td`,`th`]);function we(e){return Ce.has(B(e))}var Te=[`:popover-open`,`:modal`];function Ee(e){return Te.some(t=>{try{return e.matches(t)}catch{return!1}})}var De=[`transform`,`translate`,`scale`,`rotate`,`perspective`],Oe=[`transform`,`translate`,`scale`,`rotate`,`perspective`,`filter`],ke=[`paint`,`layout`,`strict`,`content`];function Ae(e){let t=je(),n=U(e)?q(e):e;return De.some(e=>!!n[e]&&n[e]!==`none`)||!!n.containerType&&n.containerType!==`normal`||!t&&!!n.backdropFilter&&n.backdropFilter!==`none`||!t&&!!n.filter&&n.filter!==`none`||Oe.some(e=>(n.willChange||``).includes(e))||ke.some(e=>(n.contain||``).includes(e))}function je(){return!(typeof CSS>`u`||!CSS.supports)&&CSS.supports(`-webkit-backdrop-filter`,`none`)}var Me=new Set([`html`,`body`,`#document`]);function K(e){return Me.has(B(e))}function q(e){return V(e).getComputedStyle(e)}function Ne(e){return U(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function J(e){if(B(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||xe(e)&&e.host||H(e);return xe(t)?t.host:t}function Pe(e){let t=J(e);return K(t)?e.ownerDocument?e.ownerDocument.body:e.body:W(t)&&G(t)?t:Pe(t)}function Y(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Pe(e),i=r===e.ownerDocument?.body,a=V(r);if(i){let e=Fe(a);return t.concat(a,a.visualViewport||[],G(r)?r:[],e&&n?Y(e):[])}return t.concat(r,Y(r,[],n))}function Fe(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ie(e){let t=q(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=W(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=k(n)!==a||k(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Le(e){return U(e)?e:e.contextElement}function X(e){let t=Le(e);if(!W(t))return j(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Ie(t),o=(a?k(n.width):n.width)/r,s=(a?k(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}var Re=j(0);function ze(e){let t=V(e);return je()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Re}function Z(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Le(e),o=j(1);t&&(r?U(r)&&(o=X(r)):o=X(e));let s=function(e,t,n){return t===void 0&&(t=!1),!(!n||t&&n!==V(e))&&t}(a,n,r)?ze(a):j(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=V(a),t=r&&U(r)?V(r):r,n=e,i=Fe(n);for(;i&&r&&t!==n;){let e=X(i),t=i.getBoundingClientRect(),r=q(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=V(i),i=Fe(n)}}return fe({width:u,height:d,x:c,y:l})}function Be(e,t){let n=Ne(e).scrollLeft;return t?t.left+n:Z(H(e)).left+n}function Ve(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Be(e,n),y:n.top+t.scrollTop}}var He=new Set([`absolute`,`fixed`]);function Ue(e,t,n){let r;if(t===`viewport`)r=function(e,t){let n=V(e),r=H(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=je();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Be(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=25&&(a-=o)}else l<=25&&(a+=l);return{width:a,height:o,x:s,y:c}}(e,n);else if(t===`document`)r=function(e){let t=H(e),n=Ne(e),r=e.ownerDocument.body,i=O(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=O(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Be(e),s=-n.scrollTop;return q(r).direction===`rtl`&&(o+=O(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}(H(e));else if(U(t))r=function(e,t){let n=Z(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=W(e)?X(e):j(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}(t,n);else{let n=ze(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return fe(r)}function We(e,t){let n=J(e);return!(n===t||!U(n)||K(n))&&(q(n).position===`fixed`||We(n,t))}function Ge(e,t,n){let r=W(t),i=H(t),a=n===`fixed`,o=Z(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=j(0);function l(){c.x=Be(i)}if(r||!r&&!a)if((B(t)!==`body`||G(i))&&(s=Ne(t)),r){let e=Z(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=!i||r||a?j(0):Ve(i,s);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Ke(e){return q(e).position===`static`}function qe(e,t){if(!W(e)||q(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return H(e)===n&&(n=n.ownerDocument.body),n}function Je(e,t){let n=V(e);if(Ee(e))return n;if(!W(e)){let t=J(e);for(;t&&!K(t);){if(U(t)&&!Ke(t))return t;t=J(t)}return n}let r=qe(e,t);for(;r&&we(r)&&Ke(r);)r=qe(r,t);return r&&K(r)&&Ke(r)&&!Ae(r)?n:r||function(e){let t=J(e);for(;W(t)&&!K(t);){if(Ae(t))return t;if(Ee(t))return null;t=J(t)}return null}(e)||n}var Ye={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=H(r),s=!!t&&Ee(t.floating);if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=j(1),u=j(0),d=W(r);if((d||!d&&!a)&&((B(r)!==`body`||G(o))&&(c=Ne(r)),W(r))){let e=Z(r);l=X(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=!o||d||a?j(0):Ve(o,c);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}},getDocumentElement:H,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Ee(t)?[]:function(e,t){let n=t.get(e);if(n)return n;let r=Y(e,[],!1).filter(e=>U(e)&&B(e)!==`body`),i=null,a=q(e).position===`fixed`,o=a?J(e):e;for(;U(o)&&!K(o);){let t=q(o),n=Ae(o);n||t.position!==`fixed`||(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&He.has(i.position)||G(o)&&!n&&We(e,o))?r=r.filter(e=>e!==o):i=t,o=J(o)}return t.set(e,r),r}(t,this._c):[].concat(n),r],o=a[0],s=a.reduce((e,n)=>{let r=Ue(t,n,i);return e.top=O(r.top,e.top),e.right=D(r.right,e.right),e.bottom=D(r.bottom,e.bottom),e.left=O(r.left,e.left),e},Ue(t,o,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:Je,getElementRects:async function(e){let t=this.getOffsetParent||Je,n=this.getDimensions,r=await n(e.floating);return{reference:Ge(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){let{width:t,height:n}=Ie(e);return{width:t,height:n}},getScale:X,isElement:U,isRTL:function(e){return q(e).direction===`rtl`}};function Xe(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ze(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:s=typeof ResizeObserver==`function`,layoutShift:c=typeof IntersectionObserver==`function`,animationFrame:l=!1}=r,u=Le(e),d=i||a?[...u?Y(u):[],...Y(t)]:[];d.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let f=u&&c?function(e,t){let n,r=null,i=H(e);function a(){var e;clearTimeout(n),(e=r)==null||e.disconnect(),r=null}return function s(c,l){c===void 0&&(c=!1),l===void 0&&(l=1),a();let u=e.getBoundingClientRect(),{left:d,top:f,width:p,height:m}=u;if(c||t(),!p||!m)return;let h={rootMargin:-A(f)+`px `+-A(i.clientWidth-(d+p))+`px `+-A(i.clientHeight-(f+m))+`px `+-A(d)+`px`,threshold:O(0,D(1,l))||1},g=!0;function _(t){let r=t[0].intersectionRatio;if(r!==l){if(!g)return s();r?s(!1,r):n=setTimeout(()=>{s(!1,1e-7)},1e3)}r!==1||Xe(u,e.getBoundingClientRect())||s(),g=!1}try{r=new IntersectionObserver(_,o({},h,{root:i.ownerDocument}))}catch{r=new IntersectionObserver(_,h)}r.observe(e)}(!0),a}(u,n):null,p,m=-1,h=null;s&&(h=new ResizeObserver(e=>{let[r]=e;r&&r.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var e;(e=h)==null||e.observe(t)})),n()}),u&&!l&&h.observe(u),h.observe(t));let g=l?Z(e):null;return l&&function t(){let r=Z(e);g&&!Xe(g,r)&&n(),g=r,p=requestAnimationFrame(t)}(),n(),()=>{var e;d.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),f?.(),(e=h)==null||e.disconnect(),h=null,l&&cancelAnimationFrame(p)}}var Qe=function(e){return e===void 0&&(e={}),{name:`autoPlacement`,options:e,async fn(t){let{rects:n,middlewareData:r,placement:i,platform:a,elements:o}=t,c=N(e,t),{crossAxis:l=!1,alignment:u,allowedPlacements:d=E,autoAlignment:f=!0}=c,p=s(c,pe),m=u!==void 0||d===E?function(e,t,n){return(e?[...n.filter(t=>F(t)===e),...n.filter(t=>F(t)!==e)]:n.filter(e=>P(e)===e)).filter(n=>!e||F(n)===e||!!t&&R(n)!==n)}(u||null,f,d):d,h=await a.detectOverflow(t,p),g=r.autoPlacement?.index||0,_=m[g];if(_==null)return{};let v=ae(_,n,await(a.isRTL==null?void 0:a.isRTL(o.floating)));if(i!==_)return{reset:{placement:m[0]}};let y=[h[P(_)],h[v[0]],h[v[1]]],b=[...r.autoPlacement?.overflows||[],{placement:_,overflows:y}],x=m[g+1];if(x)return{data:{index:g+1,overflows:b},reset:{placement:x}};let S=b.map(e=>{let t=F(e.placement);return[e.placement,t&&l?e.overflows.slice(0,2).reduce((e,t)=>e+t,0):e.overflows[0],e.overflows]}).sort((e,t)=>e[1]-t[1]),C=S.filter(e=>e[2].slice(0,F(e[0])?2:3).every(e=>e<=0))[0]?.[0]||S[0][0];return C===i?{}:{data:{index:g+1,overflows:b},reset:{placement:C}}}}},$e=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,c=N(e,t),{mainAxis:l=!0,crossAxis:u=!1,limiter:d={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}}}=c,f=s(c,he),p={x:n,y:r},m=await a.detectOverflow(t,f),h=L(P(i)),g=I(h),_=p[g],v=p[h];if(l){let e=g===`y`?`bottom`:`right`;_=te(_+m[g===`y`?`top`:`left`],_,_-m[e])}if(u){let e=h===`y`?`bottom`:`right`;v=te(v+m[h===`y`?`top`:`left`],v,v-m[e])}let y=d.fn(o({},t,{[g]:_,[h]:v}));return o({},y,{data:{x:y.x-n,y:y.y-r,enabled:{[g]:l,[h]:u}}})}}},et=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:c,elements:l}=t,u=N(e,t),{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:m=`bestFit`,fallbackAxisSideDirection:h=`none`,flipAlignment:g=!0}=u,_=s(u,me);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let v=P(r),y=L(o),b=P(o)===o,x=await(c.isRTL==null?void 0:c.isRTL(l.floating)),S=p||(b||!g?[z(o)]:function(e){let t=z(e);return[R(e),t,R(t)]}(o)),C=h!==`none`;!p&&C&&S.push(...ue(o,g,h,x));let w=[o,...S],T=await c.detectOverflow(t,_),E=[],D=i.flip?.overflows||[];if(d&&E.push(T[v]),f){let e=ae(r,a,x);E.push(T[e[0]],T[e[1]])}if(D=[...D,{placement:r,overflows:E}],!E.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=w[e];if(t&&(!(f===`alignment`&&y!==L(t))||D.every(e=>L(e.placement)!==y||e.overflows[0]>0)))return{data:{index:e,overflows:D},reset:{placement:t}};let n=D.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(m){case`bestFit`:{let e=D.filter(e=>{if(C){let t=L(e.placement);return t===y||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},tt=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:s,elements:c,middlewareData:l}=t,{element:u,padding:d=0}=N(e,t)||{};if(u==null)return{};let f=de(d),p={x:n,y:r},m=ie(i),h=ne(m),g=await s.getDimensions(u),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u)),w=C?C[b]:0;w&&await(s.isElement==null?void 0:s.isElement(C))||(w=c.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,O=D(f[v],E),k=D(f[y],E),A=O,j=w-g[h]-k,M=w/2-g[h]/2+T,ee=te(A,M,j),P=!l.arrow&&F(i)!=null&&M!==ee&&a.reference[h]/2-(M<A?O:k)-g[h]/2<0,I=P?M<A?M-A:M-j:0;return{[m]:p[m]+I,data:o({[m]:ee,centerOffset:M-ee-I},P&&{alignmentOffset:I}),reset:P}}}),nt=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:s}=t,{offset:c=0,mainAxis:l=!0,crossAxis:u=!0}=N(e,t),d={x:n,y:r},f=L(i),p=I(f),m=d[p],h=d[f],g=N(c,t),_=typeof g==`number`?{mainAxis:g,crossAxis:0}:o({mainAxis:0,crossAxis:0},g);if(l){let e=p===`y`?`height`:`width`,t=a.reference[p]-a.floating[e]+_.mainAxis,n=a.reference[p]+a.reference[e]-_.mainAxis;m<t?m=t:m>n&&(m=n)}if(u){let e=p===`y`?`width`:`height`,t=ve.has(P(i)),n=a.reference[f]-a.floating[e]+(t&&s.offset?.[f]||0)+(t?0:_.crossAxis),r=a.reference[f]+a.reference[e]+(t?0:s.offset?.[f]||0)-(t?_.crossAxis:0);h<n?h=n:h>r&&(h=r)}return{[p]:m,[f]:h}}}},rt=(e,t,n)=>{let r=new Map,i=o({platform:Ye},n),a=o({},i.platform,{_c:r});return(async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:s}=n,c=a.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t)),u=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:d,y:f}=ge(u,r,l),p=r,m={},h=0;for(let n=0;n<c.length;n++){let{name:a,fn:g}=c[n],{x:_,y:v,data:y,reset:b}=await g({x:d,y:f,initialPlacement:r,placement:p,strategy:i,middlewareData:m,rects:u,platform:o({},s,{detectOverflow:s.detectOverflow??_e}),elements:{reference:e,floating:t}});d=_??d,f=v??f,m=o({},m,{[a]:o({},m[a],y)}),b&&h<=50&&(h++,typeof b==`object`&&(b.placement&&(p=b.placement),b.rects&&(u=!0===b.rects?await s.getElementRects({reference:e,floating:t,strategy:i}):b.rects),{x:d,y:f}=ge(u,p,l)),n=-1)}return{x:d,y:f,placement:p,strategy:i,middlewareData:m}})(e,t,o({},i,{platform:a}))};function it(e){e.cleanup&&e.cleanup();let n=e._getResolvedAttachToOptions(),r=n.element,i=function(e,t){var n,r;let i={strategy:`absolute`,middleware:[]},a=function(e){return e.options.arrow&&e.el?e.el.querySelector(`.shepherd-arrow`):!1}(t),o=C(e),s=e.on?.includes(`auto`),c=(e==null||(n=e.on)==null?void 0:n.includes(`-start`))||(e==null||(r=e.on)==null?void 0:r.includes(`-end`));if(!o){var l;if(s?i.middleware.push(Qe({crossAxis:!0,alignment:c?e==null||(l=e.on)==null?void 0:l.split(`-`).pop():null})):i.middleware.push(et()),i.middleware.push($e({limiter:nt(),crossAxis:!0})),a){let e=typeof t.options.arrow==`object`?t.options.arrow:{padding:4};i.middleware.push(tt({element:a,padding:c?e.padding:0}))}s||(i.placement=e.on)}return _(i,t.options.floatingUIOptions||{})}(n,e),a=C(n);return a&&(r=document.body,(e.shepherdElementComponent?.element)?.classList.add(`shepherd-centered`)),e.cleanup=Ze(r,e.el,()=>{e.el?function(e,n,r,i){rt(e,n.el,r).then(function(e,n){return({x:r,y:i,placement:a,middlewareData:o})=>e.el?(n?Object.assign(e.el.style,{position:`fixed`,left:`50%`,top:`50%`,transform:`translate(-50%, -50%)`}):Object.assign(e.el.style,{position:`absolute`,left:`${r}px`,top:`${i}px`}),e.el.dataset.popperPlacement=a,function(e,n){let r=e.querySelector(`.shepherd-arrow`);if(t(r)&&n.arrow){let{x:e,y:t}=n.arrow;Object.assign(r.style,{left:e==null?``:`${e}px`,top:t==null?``:`${t}px`})}}(e.el,o),e):e}(n,i)).then(e=>new Promise(t=>{setTimeout(()=>t(e),300)})).then(e=>{e!=null&&e.el&&(e.el.tabIndex=0,e.el.focus({preventScroll:!0}))})}(r,e,i,a):e.cleanup==null||e.cleanup()}),e.target=n.element,i}function Q(e,t,...n){let r=document.createElement(e);return ot(r,t),st(r,n),r}function at(e,t,...n){let r=document.createElementNS(`http://www.w3.org/2000/svg`,e);return ot(r,t),st(r,n),r}function ot(e,t){if(t)for(let[n,r]of Object.entries(t))r!=null&&!1!==r&&(n.startsWith(`on`)&&typeof r==`function`?e.addEventListener(n.slice(2).toLowerCase(),r):n===`disabled`&&!0===r?e.disabled=!0:e.setAttribute(n,String(r)))}function st(e,t){for(let n of t)n!=null&&!1!==n&&e.append(typeof n==`string`?document.createTextNode(n):n)}function ct(e,t){return n(e)?e.call(t):e}function lt(e,t){let n=e.action?e.action.bind(t.tour):null,r=!!e.disabled&&ct(e.disabled,t),i=e.label?ct(e.label,t):null,a=e.text?ct(e.text,t):null,s=Q(`button`,o({},e.attrs||{},{"aria-label":i||null,class:`${e.classes||``} shepherd-button ${e.secondary?`shepherd-button-secondary`:``}`,disabled:r||null,onclick:n,tabindex:`0`,type:`button`}));return a&&(s.innerHTML=a),s}function ut(e,t){let r=Q(`header`,{class:`shepherd-header`});return t.options.title&&r.append(function(e,t){let r=Q(`h3`,{id:e,class:`shepherd-title`});return r.innerHTML=n(t)?t():t,r}(e,t.options.title)),t.options.cancelIcon&&t.options.cancelIcon.enabled&&r.append(function(e,t){return Q(`button`,o({},e.attrs||{},{"aria-label":e.label?e.label:`Close Tour`,class:`shepherd-cancel-icon`,onclick:e=>{e.preventDefault(),t.cancel()},type:`button`}),Q(`span`,{"aria-hidden":`true`},`×`))}(t.options.cancelIcon,t)),r}function dt(e,r,a){let o=Q(`div`,{class:`shepherd-content`});return(!i(a.options.title)||a.options.cancelIcon&&a.options.cancelIcon.enabled)&&o.append(ut(r,a)),i(a.options.text)||o.append(function(e,r){let i=Q(`div`,{class:`shepherd-text`,id:e}),a=r.options.text;return n(a)&&(a=a.call(r)),t(a)?i.appendChild(a):i.innerHTML=a,i}(e,a)),Array.isArray(a.options.buttons)&&a.options.buttons.length&&o.append(function(e){let t=Q(`footer`,{class:`shepherd-footer`});if(e.options.buttons)for(let n of e.options.buttons)t.append(lt(n,e));return t}(a)),o}var ft=class extends a{constructor(e,t={}){return super(),this._resolvedAttachTo=void 0,this._resolvedExtraHighlightElements=void 0,this._originalTabIndexes=void 0,this.classPrefix=void 0,this.el=void 0,this.shepherdElementComponent=void 0,this.target=void 0,this.tour=void 0,this.tour=e,this.classPrefix=this.tour.options?S(this.tour.options.classPrefix):``,this.styles=e.styles,this._resolvedAttachTo=null,this._originalTabIndexes=new Map,b(this),this._setOptions(t),this}cancel(){this.tour.cancel(),this.trigger(`cancel`)}complete(){this.tour.complete(),this.trigger(`complete`)}destroy(){this._teardownElements(),this.trigger(`destroy`)}_teardownElements(){var e;(e=this).cleanup&&e.cleanup(),e.cleanup=null,this.shepherdElementComponent&&=(this.shepherdElementComponent.cleanup(),void 0),t(this.el)&&(this.el.remove(),this.el=null),this._updateStepTargetOnHide(),this._originalTabIndexes.clear()}getTour(){return this.tour}hide(){var e;(e=this.tour.modal)==null||e.hide(),this.trigger(`before-hide`),this.el&&(this.el.hidden=!0),this._updateStepTargetOnHide(),this.trigger(`hide`)}_resolveExtraHiglightElements(){var e;return this._resolvedExtraHighlightElements=(e=this).options.extraHighlights?e.options.extraHighlights.flatMap(e=>Array.from(document.querySelectorAll(e))):[],this._resolvedExtraHighlightElements}_resolveAttachToOptions(){return this._resolvedAttachTo=function(e){let t=e.options.attachTo||{},i=Object.assign({},t);if(n(i.element)&&(i.element=i.element.call(e)),r(i.element)){try{i.element=document.querySelector(i.element)}catch{}i.element}return i}(this),this._resolvedAttachTo}_getResolvedAttachToOptions(){return this._resolvedAttachTo===null?this._resolveAttachToOptions():this._resolvedAttachTo}isOpen(){return!!(this.el&&!this.el.hidden)}show(){return n(this.options.beforeShowPromise)?Promise.resolve(this.options.beforeShowPromise()).then(()=>this._show()):Promise.resolve(this._show())}updateStepOptions(e){Object.assign(this.options,e),this.shepherdElementComponent&&this.el&&(this._teardownElements(),this._setupElements())}getElement(){return this.el}getTarget(){return this.target}_storeOriginalTabIndex(e){let t=e.getAttribute(`tabindex`);t!==null&&this._originalTabIndexes.set(e,t)}_restoreOriginalTabIndexes(){let e=this.target;e&&(this._originalTabIndexes.has(e)?e.setAttribute(`tabindex`,this._originalTabIndexes.get(e)):e.removeAttribute(`tabindex`))}_createTooltipContent(){let e=`${this.id}-description`,t=`${this.id}-label`;return this.shepherdElementComponent=function(e){var t,n,a;let{classPrefix:o,descriptionId:s,labelId:c,step:l}=e,u,d,f,p,m,h,g,_=(t=(n=l.options)==null||(n=n.cancelIcon)==null?void 0:n.enabled)!=null&&t,v=(a=l.options?.title)!=null&&a,y=e=>{let{tour:t}=l;switch(e.keyCode){case 9:if((!d||d.length===0)&&h&&h.length===0){e.preventDefault();break}var n,r,i;if(e.shiftKey){if(document.activeElement===m||(n=document.activeElement)!=null&&n.classList.contains(`shepherd-element`))e.preventDefault(),(r=p??g)==null||r.focus();else if(document.activeElement===f){var a;e.preventDefault(),(a=g)==null||a.focus()}}else if(document.activeElement===g)e.preventDefault(),(i=f??m)==null||i.focus();else if(document.activeElement===p){var o;e.preventDefault(),(o=m)==null||o.focus()}break;case 27:t.options.exitOnEsc&&(e.preventDefault(),e.stopPropagation(),l.cancel());break;case 37:t.options.keyboardNavigation&&(e.preventDefault(),e.stopPropagation(),t.back());break;case 39:t.options.keyboardNavigation&&(e.preventDefault(),e.stopPropagation(),t.next())}},b=Q(`dialog`,{"aria-describedby":i(l.options.text)?null:s,"aria-labelledby":l.options.title?c:null,class:[`shepherd-element`,_?`shepherd-has-cancel-icon`:``,v?`shepherd-has-title`:``].filter(Boolean).join(` `),[`data-${o}shepherd-step-id`]:l.id,onkeydown:y,open:`true`});if(l.options.arrow&&l.options.attachTo&&l.options.attachTo.element&&l.options.attachTo.on&&b.append(Q(`div`,{class:`shepherd-arrow`,"data-popper-arrow":``})),b.append(dt(s,c,l)),r(l.options.classes)){let e=l.options.classes.split(` `).filter(e=>!!e.length);e.length&&b.classList.add(...e)}let x=`a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]`;h=[...b.querySelectorAll(x)],m=h[0],g=h[h.length-1];let S=l._getResolvedAttachToOptions();return S!=null&&S.element&&(u=S.element,l._storeOriginalTabIndex(u),u.tabIndex=0,d=[u,...u.querySelectorAll(x)],f=d[0],p=d[d.length-1],u.addEventListener(`keydown`,y)),{element:b,cleanup:()=>{var e;(e=u)==null||e.removeEventListener(`keydown`,y)}}}({classPrefix:this.classPrefix,descriptionId:e,labelId:t,step:this}),(this.tour.options.stepsContainer||document.body).append(this.shepherdElementComponent.element),this.shepherdElementComponent.element}_scrollTo(e){let{element:t}=this._getResolvedAttachToOptions();n(this.options.scrollToHandler)?this.options.scrollToHandler(t):t instanceof Element&&typeof t.scrollIntoView==`function`&&t.scrollIntoView(e)}_getClassOptions(e){let t=this.tour&&this.tour.options&&this.tour.options.defaultStepOptions,n=e.classes?e.classes:``,r=t&&t.classes?t.classes:``,i=[...n.split(` `),...r.split(` `)],a=new Set(i);return Array.from(a).join(` `).trim()}_setOptions(e={}){let t=this.tour&&this.tour.options&&this.tour.options.defaultStepOptions;t=_({},t||{}),this.options=Object.assign({arrow:!0},t,e,function(e,t){return{floatingUIOptions:_(e.floatingUIOptions||{},t.floatingUIOptions||{})}}(t,e));let{when:n}=this.options;this.options.classes=this._getClassOptions(e),this.destroy(),this.id=this.options.id||`step-${w()}`,n&&Object.keys(n).forEach(e=>{this.on(e,n[e],this)})}_setupElements(){i(this.el)||this.destroy(),this.el=this._createTooltipContent(),this.options.advanceOn&&x(this),it(this)}_show(){var e;this.trigger(`before-show`),this._resolveAttachToOptions(),this._resolveExtraHiglightElements(),this._setupElements(),this.tour.modal||this.tour.setupModal(),(e=this.tour.modal)==null||e.setupForStep(this),this._styleTargetElementForStep(this),this.el&&(this.el.hidden=!1),this.options.scrollTo&&setTimeout(()=>{this._scrollTo(this.options.scrollTo)}),this.el&&(this.el.hidden=!1);let t=this.shepherdElementComponent.element,n=this.target||document.body,r=this._resolvedExtraHighlightElements;n.classList.add(`${this.classPrefix}shepherd-enabled`),n.classList.add(`${this.classPrefix}shepherd-target`),t.classList.add(`shepherd-enabled`),r?.forEach(e=>{e.classList.add(`${this.classPrefix}shepherd-enabled`),e.classList.add(`${this.classPrefix}shepherd-target`)}),this.trigger(`show`)}_styleTargetElementForStep(e){let t=e.target,n=e._resolvedExtraHighlightElements;if(!t)return;let r=e.options.highlightClass;r&&(t.classList.add(r),n?.forEach(e=>e.classList.add(r))),t.classList.remove(`shepherd-target-click-disabled`),n?.forEach(e=>e.classList.remove(`shepherd-target-click-disabled`)),!1===e.options.canClickTarget&&(t.classList.add(`shepherd-target-click-disabled`),n?.forEach(e=>e.classList.add(`shepherd-target-click-disabled`)))}_updateStepTargetOnHide(){let e=this.target||document.body,t=this._resolvedExtraHighlightElements,n=this.options.highlightClass;n&&(e.classList.remove(n),t?.forEach(e=>e.classList.remove(n))),e.classList.remove(`shepherd-target-click-disabled`,`${this.classPrefix}shepherd-enabled`,`${this.classPrefix}shepherd-target`),t?.forEach(e=>{e.classList.remove(`shepherd-target-click-disabled`,`${this.classPrefix}shepherd-enabled`,`${this.classPrefix}shepherd-target`)}),this._restoreOriginalTabIndexes()}};function pt(e){let t,n=[{width:0,height:0,x:0,y:0,r:0}],r=at(`path`),i=at(`svg`,{class:`shepherd-modal-overlay-container`},r);function a(){r.setAttribute(`d`,function(e){let t=``,{innerWidth:n,innerHeight:r}=window;return e.forEach(e=>{let{width:n,height:r,x:i=0,y:a=0,r:o=0}=e,{topLeft:s=0,topRight:c=0,bottomRight:l=0,bottomLeft:u=0}=typeof o==`number`?{topLeft:o,topRight:o,bottomRight:o,bottomLeft:o}:o;t+=`M${i+s},${a}a${s},${s},0,0,0-${s},${s}V`+(r+a-u)+`a${u},${u},0,0,0,${u},${u}H`+(n+i-l)+`a${l},${l},0,0,0,${l}-${l}V${a+c}a${c},${c},0,0,0-${c}-${c}Z`}),`M${n},${r}H0V0H${n}V${r}Z${t}`.replace(/\s/g,``)}(n))}function o(){n=[{width:0,height:0,x:0,y:0,r:0}],a()}function s(){i.classList.remove(`shepherd-modal-is-visible`),f()}function c(){i.classList.add(`shepherd-modal-is-visible`)}function l(e=0,t=0,r=0,i=0,s,c,l){if(c){{let a=[c,...l||[]],o=[];for(let n of a){if(!n||a.indexOf(n)!==a.lastIndexOf(n))continue;let{y:c,height:l}=m(n,s),{x:u,width:d,left:f}=n.getBoundingClientRect();a.some(e=>{if(e===n)return!1;let t=e.getBoundingClientRect(),{y:r,height:i}=m(e,s);return u>=t.left&&u+d<=t.left+t.width&&c>=r&&c+l<=r+i})||o.push({width:d+2*e,height:l+2*e,x:(u||f)+r-e,y:c+i-e,r:t})}n=o}a()}else o()}function u(e){e.stopPropagation()}i.addEventListener(`touchmove`,u),a(),e.append(i);let d=e=>{e.preventDefault()};function f(){t&&=(cancelAnimationFrame(t),void 0),window.removeEventListener(`touchmove`,d,{passive:!1})}function p(e){if(!e)return null;let t=e instanceof HTMLElement&&window.getComputedStyle(e).overflowY;return t!==`hidden`&&t!==`visible`&&e.scrollHeight>=e.clientHeight?e:p(e.parentElement)}function m(e,t){let n=e.getBoundingClientRect(),r=n.y||n.top,i=n.bottom||r+n.height;if(t){let e=t.getBoundingClientRect(),n=e.y||e.top,a=e.bottom||n+e.height;r=Math.max(r,n),i=Math.min(i,a)}return{y:r,height:Math.max(i-r,0)}}return{closeModalOpening:o,destroy:function(){f(),i.removeEventListener(`touchmove`,u),i.remove()},hide:s,positionModal:l,setupForStep:function(e){f(),e.tour.options.useModalOverlay?(function(e){let{modalOverlayOpeningPadding:n,modalOverlayOpeningRadius:r,modalOverlayOpeningXOffset:i=0,modalOverlayOpeningYOffset:a=0}=e.options,o=function(e){let t={top:0,left:0};if(!e)return t;let n=e.ownerDocument.defaultView;try{for(;n&&n!==window.top;){let e=n?.frameElement;if(e){let n=e.getBoundingClientRect();t.top+=n.top+e.scrollTop,t.left+=n.left+e.scrollLeft}n=n.parent}}catch{}return t}(e.target),s=p(e.target),c=()=>{t=void 0,l(n,r,i+o.left,a+o.top,s,e.target,e._resolvedExtraHighlightElements),t=requestAnimationFrame(c)};c(),window.addEventListener(`touchmove`,d,{passive:!1})}(e),c()):s()},show:c,getElement:function(){return i}}}var mt=class extends a{constructor(){super(),this.activeTour=void 0,b(this)}},$=new mt,ht=typeof window>`u`;$.Step=ht?class{constructor(e){}}:ft,$.Tour=ht?class{constructor(e,t){}}:class extends a{constructor(e={}){return super(),this.trackedEvents=[`active`,`cancel`,`complete`,`show`],this.classPrefix=void 0,this.currentStep=void 0,this.focusedElBeforeOpen=void 0,this.id=void 0,this.modal=void 0,this.options=void 0,this.steps=void 0,b(this),this.options=Object.assign({},{exitOnEsc:!0,keyboardNavigation:!0},e),this.classPrefix=S(this.options.classPrefix),this.steps=[],this.addSteps(this.options.steps),[`active`,`cancel`,`complete`,`inactive`,`show`,`start`].map(e=>{(e=>{this.on(e,t=>{(t||={}).tour=this,$.trigger(e,t)})})(e)}),this._setTourID(e.id),this}addStep(e,t){let n=e;return n instanceof ft?n.tour=this:n=new ft(this,n),i(t)?this.steps.push(n):this.steps.splice(t,0,n),n}addSteps(e){return Array.isArray(e)&&e.forEach(e=>{this.addStep(e)}),this}back(){let e=this.steps.indexOf(this.currentStep);this.show(e-1,!1)}async cancel(){if(this.options.confirmCancel){let e=this.options.confirmCancelMessage||`Are you sure you want to stop the tour?`,t;t=n(this.options.confirmCancel)?await this.options.confirmCancel():window.confirm(e),t&&this._done(`cancel`)}else this._done(`cancel`)}complete(){this._done(`complete`)}getById(e){return this.steps.find(t=>t.id===e)}getCurrentStep(){return this.currentStep}hide(){let e=this.getCurrentStep();if(e)return e.hide()}isActive(){return $.activeTour===this}next(){let e=this.steps.indexOf(this.currentStep);e===this.steps.length-1?this.complete():this.show(e+1,!0)}removeStep(e){let t=this.getCurrentStep();this.steps.some((t,n)=>{if(t.id===e)return t.isOpen()&&t.hide(),t.destroy(),this.steps.splice(n,1),!0}),t&&t.id===e&&(this.currentStep=void 0,this.steps.length?this.show(0):this.cancel())}show(e=0,t=!0){let i=r(e)?this.getById(e):this.steps[e];i&&(this._updateStateBeforeShow(),n(i.options.showOn)&&!i.options.showOn()?this._skipStep(i,t):(this.currentStep=i,this.trigger(`show`,{step:i,previous:this.currentStep}),i.show()))}async start(){this.trigger(`start`),this.focusedElBeforeOpen=document.activeElement,this.currentStep=null,this.setupModal(),this._setupActiveTour(),this.next()}_done(e){let n=this.steps.indexOf(this.currentStep);Array.isArray(this.steps)&&this.steps.forEach(e=>e.destroy()),function(e){if(e){let{steps:n}=e;n.forEach(e=>{e.options&&!1===e.options.canClickTarget&&e.options.attachTo&&(t(e.target)&&e.target.classList.remove(`shepherd-target-click-disabled`),e._resolvedExtraHighlightElements&&e._resolvedExtraHighlightElements.forEach(e=>{t(e)&&e.classList.remove(`shepherd-target-click-disabled`)}))})}}(this),this.trigger(e,{index:n}),$.activeTour=null,this.trigger(`inactive`,{tour:this}),this.modal&&this.modal.hide(),e!==`cancel`&&e!==`complete`||(this.modal&&=(this.modal.destroy(),null)),t(this.focusedElBeforeOpen)&&this.focusedElBeforeOpen.focus()}_setupActiveTour(){this.trigger(`active`,{tour:this}),$.activeTour=this}setupModal(){let e=this.options.modalContainer||document.body;this.modal=pt(e)}_skipStep(e,t){let n=this.steps.indexOf(e),r=t?n+1:n-1;r<0?this.cancel():r>=this.steps.length?this.complete():this.show(r,t)}_updateStateBeforeShow(){this.currentStep&&this.currentStep.hide(),this.isActive()||this._setupActiveTour()}_setTourID(e){let t=this.options.tourName||`tour`,n=e||w();this.id=`${t}--${n}`}},Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return e}}); //# sourceMappingURL=paella-extra-plugins-shepherdjs.cjs.js.map