maz-ui 3.6.6 → 3.6.7

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/maz-ui.d.ts CHANGED
@@ -264,10 +264,13 @@ declare const DEFAULT_OPTIONS: {
264
264
  storageThemeValueLight: string;
265
265
  };
266
266
  declare const theme: vue.Ref<string | undefined>;
267
- type ThemeHandlerOptions = Partial<typeof DEFAULT_OPTIONS>;
267
+ type StrictThemeHandlerOptions = typeof DEFAULT_OPTIONS;
268
+ type ThemeHandlerOptions = Partial<StrictThemeHandlerOptions>;
268
269
  declare const useThemeHandler: (opts?: ThemeHandlerOptions) => {
269
270
  autoSetTheme: () => void;
270
271
  toggleTheme: () => void;
272
+ setDarkTheme: () => void;
273
+ setLightTheme: () => void;
271
274
  hasDarkTheme: vue.ComputedRef<boolean>;
272
275
  hasLightTheme: vue.ComputedRef<boolean>;
273
276
  theme: vue.Ref<string | undefined>;
@@ -307,4 +310,4 @@ declare const useUserVisibility: ({ callback, options, }: {
307
310
  visibility: Ref<UserVisibility>;
308
311
  };
309
312
 
310
- export { AosHandler, AosOptions, FilterCurrencyOptions, Filters, IdleTimeout, IdleTimeoutCallback, IdleTimeoutOptions, ThemeHandlerOptions, ToasterHandler, ToasterOptions, ToasterPositions, Truthy, UserVisibility, UserVisibilyCallback, UserVisibilyOptions, WaitHandler, instance as aosInstance, capitalize, currency, date, debounce, injectStrict, plugin as installAos, installDirectives, installFilters, plugin$2 as installToaster, plugin$1 as installWait, isClient, mount, number, sleep, theme, instance$2 as toastInstance, truthyFilter, useAos, useIdleTimeout, useInstanceUniqId, useThemeHandler, useToast, useUserVisibility, useWait, directive$1 as vClickOutside, plugin$6 as vClickOutsideInstall, directive as vClosable, plugin$3 as vClosableInstall, vLazyImg, vLazyImgBinding, plugin$5 as vLazyImgInstall, vLazyImgOptions, vZoomImg, vZoomImgBinding, plugin$4 as vZoomImgInstall, vZoomImgOptions, instance$1 as waitInstance };
313
+ export { AosHandler, AosOptions, FilterCurrencyOptions, Filters, IdleTimeout, IdleTimeoutCallback, IdleTimeoutOptions, StrictThemeHandlerOptions, ThemeHandlerOptions, ToasterHandler, ToasterOptions, ToasterPositions, Truthy, UserVisibility, UserVisibilyCallback, UserVisibilyOptions, WaitHandler, instance as aosInstance, capitalize, currency, date, debounce, injectStrict, plugin as installAos, installDirectives, installFilters, plugin$2 as installToaster, plugin$1 as installWait, isClient, mount, number, sleep, theme, instance$2 as toastInstance, truthyFilter, useAos, useIdleTimeout, useInstanceUniqId, useThemeHandler, useToast, useUserVisibility, useWait, directive$1 as vClickOutside, plugin$6 as vClickOutsideInstall, directive as vClosable, plugin$3 as vClosableInstall, vLazyImg, vLazyImgBinding, plugin$5 as vLazyImgInstall, vLazyImgOptions, vZoomImg, vZoomImgBinding, plugin$4 as vZoomImgInstall, vZoomImgOptions, instance$1 as waitInstance };
@@ -1686,38 +1686,40 @@ const DEFAULT_OPTIONS = {
1686
1686
  storageThemeValueLight: "light"
1687
1687
  };
1688
1688
  const theme = ref();
1689
- const autoSetTheme = ({
1690
- storageThemeKey,
1691
- storageThemeValueDark,
1689
+ const setDarkTheme = ({
1692
1690
  darkClass,
1693
- storageThemeValueLight
1691
+ storageThemeKey,
1692
+ storageThemeValueDark
1694
1693
  }) => {
1695
- if (localStorage[storageThemeKey] === storageThemeValueDark || !(storageThemeKey in localStorage) && window.matchMedia("(prefers-color-scheme: dark)").matches) {
1696
- document.documentElement.classList.add(darkClass);
1697
- localStorage[storageThemeKey] = storageThemeValueDark;
1698
- theme.value = storageThemeValueDark;
1699
- } else {
1700
- document.documentElement.classList.remove(darkClass);
1701
- localStorage[storageThemeKey] = storageThemeValueLight;
1702
- theme.value = storageThemeValueLight;
1703
- }
1694
+ document.documentElement.classList.add(darkClass);
1695
+ localStorage[storageThemeKey] = storageThemeValueDark;
1696
+ theme.value = storageThemeValueDark;
1704
1697
  };
1705
- const toggleTheme = ({
1706
- storageThemeKey,
1707
- storageThemeValueDark,
1698
+ const removeDarkTheme = ({
1708
1699
  darkClass,
1700
+ storageThemeKey,
1709
1701
  storageThemeValueLight
1710
1702
  }) => {
1711
- if (localStorage[storageThemeKey] === storageThemeValueDark) {
1712
- document.documentElement.classList.remove(darkClass);
1713
- localStorage[storageThemeKey] = storageThemeValueLight;
1714
- theme.value = storageThemeValueLight;
1703
+ document.documentElement.classList.remove(darkClass);
1704
+ localStorage[storageThemeKey] = storageThemeValueLight;
1705
+ theme.value = storageThemeValueLight;
1706
+ };
1707
+ const autoSetTheme = (options) => {
1708
+ if (localStorage[options.storageThemeKey] === options.storageThemeValueDark || !(options.storageThemeKey in localStorage) && window.matchMedia("(prefers-color-scheme: dark)").matches) {
1709
+ setDarkTheme(options);
1715
1710
  } else {
1716
- document.documentElement.classList.add(darkClass);
1717
- localStorage[storageThemeKey] = storageThemeValueDark;
1718
- theme.value = storageThemeValueDark;
1711
+ removeDarkTheme(options);
1719
1712
  }
1720
1713
  };
1714
+ const setTheme = ({
1715
+ shouldSetDarkMode,
1716
+ ...rest
1717
+ }) => {
1718
+ return shouldSetDarkMode ? setDarkTheme(rest) : removeDarkTheme(rest);
1719
+ };
1720
+ const toggleTheme = (options) => {
1721
+ return localStorage[options.storageThemeKey] === options.storageThemeValueDark ? removeDarkTheme(options) : setDarkTheme(options);
1722
+ };
1721
1723
  const useThemeHandler = (opts = DEFAULT_OPTIONS) => {
1722
1724
  const options = {
1723
1725
  ...DEFAULT_OPTIONS,
@@ -1728,6 +1730,8 @@ const useThemeHandler = (opts = DEFAULT_OPTIONS) => {
1728
1730
  return {
1729
1731
  autoSetTheme: () => autoSetTheme(options),
1730
1732
  toggleTheme: () => toggleTheme(options),
1733
+ setDarkTheme: () => setTheme({ ...options, shouldSetDarkMode: true }),
1734
+ setLightTheme: () => setTheme({ ...options, shouldSetDarkMode: false }),
1731
1735
  hasDarkTheme,
1732
1736
  hasLightTheme,
1733
1737
  theme
@@ -1,2 +1,2 @@
1
1
  (function(){"use strict";try{if(typeof document!="undefined"){var t=document.createElement("style");t.appendChild(document.createTextNode(".m-toast-container{-webkit-box-sizing:border-box;box-sizing:border-box;position:fixed;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.m-toast-container>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.m-toast-container{padding:1rem;z-index:1051}.m-toast-container.--top{top:0px;display:-webkit-box;display:-ms-flexbox;display:flex}.m-toast-container.--center{width:100%}@media (min-width: 768px){.m-toast-container.--center{position:fixed;left:50%;width:auto;-webkit-transform:translate(-50%,0);transform:translate(-50%)}}.m-toast-container.--bottom{bottom:0px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse}.m-toast-container.--bottom>:not([hidden])~:not([hidden]){margin-bottom:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-top:calc(.5rem * var(--tw-space-y-reverse))}.m-toast-container.--right{right:0px;width:100%}@media (min-width: 768px){.m-toast-container.--right{width:auto}}.m-toast-container.--left{left:0px;width:100%}@media (min-width: 768px){.m-toast-container.--left{width:auto}}.m-toast[data-v-f511285d],.m-toast *[data-v-f511285d]{-webkit-box-sizing:border-box;box-sizing:border-box}.m-toast[data-v-f511285d]{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;width:100%;cursor:pointer;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-flex-item-align:center;align-self:center;border-radius:var(--maz-border-radius);padding-left:.5rem;padding-right:.5rem;color:var(--maz-color-white);-webkit-transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,-webkit-box-shadow,-webkit-transform,-webkit-filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,-webkit-box-shadow,-webkit-transform,-webkit-filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-box-shadow,-webkit-transform,-webkit-filter,-webkit-backdrop-filter;-webkit-transition-duration:.3s;transition-duration:.3s;-webkit-transition-timing-function:cubic-bezier(.4,0,.2,1);transition-timing-function:cubic-bezier(.4,0,.2,1)}@media (min-width: 768px){.m-toast.--left[data-v-f511285d],.m-toast.--right[data-v-f511285d]{width:20rem}.m-toast.--center[data-v-f511285d]{width:20rem;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}}.m-toast__message-wrapper[data-v-f511285d]{-webkit-box-flex:1;-ms-flex:1 1 0%;flex:1 1 0%;padding-top:.75rem;padding-bottom:.75rem}.m-toast__message[data-v-f511285d]{margin:0;font-weight:500}.m-toast .--close[data-v-f511285d]{margin-left:.25rem;display:-webkit-box;display:-ms-flexbox;display:flex;height:1.75rem;width:1.75rem;border-radius:var(--maz-border-radius);background-color:transparent;padding:0;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.m-toast .--close[data-v-f511285d]:hover{background-color:#11182733}.m-toast .--close .--icon[data-v-f511285d]{height:1.25rem;width:1.25rem;cursor:pointer}.m-toast.--info[data-v-f511285d]{background-color:var(--maz-color-info);color:var(--maz-color-info-contrast)}.m-toast.--info[data-v-f511285d]:hover{background-color:var(--maz-color-info-600)}.m-toast.--info .--close[data-v-f511285d]{color:var(--maz-color-info-contrast)}.m-toast.--success[data-v-f511285d]{background-color:var(--maz-color-success);color:var(--maz-color-success-contrast)}.m-toast.--success[data-v-f511285d]:hover{background-color:var(--maz-color-success-600)}.m-toast.--success .--close[data-v-f511285d]{color:var(--maz-color-success-contrast)}.m-toast.--warning[data-v-f511285d]{background-color:var(--maz-color-warning);color:var(--maz-color-warning-contrast)}.m-toast.--warning[data-v-f511285d]:hover{background-color:var(--maz-color-warning-600)}.m-toast.--warning .--close[data-v-f511285d]{color:var(--maz-color-warning-contrast)}.m-toast.--danger[data-v-f511285d]{background-color:var(--maz-color-danger);color:var(--maz-color-danger-contrast)}.m-toast.--danger[data-v-f511285d]:hover{background-color:var(--maz-color-danger-600)}.m-toast.--danger .--close[data-v-f511285d]{color:var(--maz-color-danger-contrast)}.m-slide-top-enter-active[data-v-f511285d],.m-slide-top-leave-active[data-v-f511285d]{opacity:1;-webkit-transition:all .3s;transition:all .3s;-webkit-transform:translateY(0);transform:translateY(0)}.m-slide-top-enter-from[data-v-f511285d],.m-slide-top-leave-to[data-v-f511285d]{opacity:0;-webkit-transform:translateY(-100%);transform:translateY(-100%)}.m-slide-bottom-enter-active[data-v-f511285d],.m-slide-bottom-leave-active[data-v-f511285d]{opacity:1;-webkit-transition:all .3s;transition:all .3s;-webkit-transform:translateY(0);transform:translateY(0)}.m-slide-bottom-enter-from[data-v-f511285d],.m-slide-bottom-leave-to[data-v-f511285d]{opacity:0;-webkit-transform:translateY(100%);transform:translateY(100%)}.m-slide-right-enter-active[data-v-f511285d],.m-slide-right-leave-active[data-v-f511285d]{opacity:1;-webkit-transition:all .3s;transition:all .3s;-webkit-transform:translateX(0);transform:translate(0)}.m-slide-right-enter-from[data-v-f511285d],.m-slide-right-leave-to[data-v-f511285d]{opacity:0;-webkit-transform:translateX(100%);transform:translate(100%)}.m-slide-left-enter-active[data-v-f511285d],.m-slide-left-leave-active[data-v-f511285d]{opacity:1;-webkit-transition:all .3s;transition:all .3s;-webkit-transform:translateX(0);transform:translate(0)}.m-slide-left-enter-from[data-v-f511285d],.m-slide-left-leave-to[data-v-f511285d]{opacity:0;-webkit-transform:translateX(-100%);transform:translate(-100%)}")),document.head.appendChild(t)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
2
- var __defProp=Object.defineProperty,__defNormalProp=(e,t,i)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,__publicField=(e,t,i)=>(__defNormalProp(e,"symbol"!=typeof t?t+"":t,i),i);!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["maz-ui"]={},e.Vue)}(this,(function(e,t){"use strict";function i(e,i){const s=t.inject(e,i);if(!s)throw new Error(`[maz-ui](injectStrict) Could not resolve ${e}`);return s}function s(e,{props:i,children:s,element:o,app:n}={}){let r=o;const a=t.createVNode(e,i,s);n&&n._context&&(a.appContext=n._context),r?t.render(a,r):"undefined"!=typeof document&&t.render(a,r=document.createElement("div"));return{vNode:a,destroy:()=>{r&&t.render(null,r)},el:r}}function o(){return"undefined"!=typeof document}class n{constructor(e,t){__publicField(this,"defaultOptions",{element:void 0,timeout:3e5,once:!1,immediate:!0,ssr:!1}),__publicField(this,"options"),__publicField(this,"timeoutHandler"),__publicField(this,"isIdle",!1),__publicField(this,"isDestroy",!1),__publicField(this,"startTime",0),__publicField(this,"remainingTime",0),__publicField(this,"lastClientX",-1),__publicField(this,"lastClientY",-1),__publicField(this,"eventNames",["DOMMouseScroll","mousedown","mousemove","mousewheel","MSPointerDown","MSPointerMove","keydown","touchmove","touchstart","wheel","click"]),__publicField(this,"handleEvent",(e=>{try{if(this.remainingTime>0)return;if("mousemove"===e.type){const{clientX:t,clientY:i}=e;if(void 0===t&&void 0===i||t===this.lastClientX&&i===this.lastClientY)return;this.lastClientX=t,this.lastClientY=i}this.resetTimeout(),this.callback({isIdle:this.isIdle,eventType:e.type})}catch(t){throw new Error(`[IdleTimeout](handleEvent) ${t}`)}})),this.callback=e,this.options={...this.defaultOptions,...t},!this.options.ssr&&o()?this.start():this.options.ssr||o()||console.warn('[IdleTimeout](constructor) executed on server side - set immediate option to "false"')}get element(){return this.options.element??document.body}start(){if(o()){for(const e of this.eventNames)this.element.addEventListener(e,this.handleEvent);this.resetTimeout(),this.options.immediate&&this.callback({isIdle:!1})}else console.warn("[IdleTimeout](start) you should run this method on client side")}pause(){const e=this.startTime+this.options.timeout-Date.now();e<=0||(this.remainingTime=e,this.timeoutHandler&&(clearTimeout(this.timeoutHandler),this.timeoutHandler=void 0))}resume(){this.remainingTime<=0||(this.resetTimeout(),this.callback({isIdle:this.isIdle}),this.remainingTime=0)}reset(){this.isDestroy=!1,this.isIdle=!1,this.remainingTime=0,this.resetTimeout(),this.callback({isIdle:this.isIdle})}destroy(){if(o()){this.isDestroy=!0;for(const e of this.eventNames)this.element.removeEventListener(e,this.handleEvent);this.timeoutHandler&&clearTimeout(this.timeoutHandler)}else console.warn("[IdleTimeout](destroy) you should run this method on client side")}resetTimeout(){this.isIdle=!1,this.timeoutHandler&&(clearTimeout(this.timeoutHandler),this.timeoutHandler=void 0),this.timeoutHandler=setTimeout(this.handleTimeout.bind(this),this.remainingTime||this.options.timeout),this.startTime=Date.now()}handleTimeout(){this.isIdle=!0,this.callback({isIdle:this.isIdle}),this.options.once&&this.destroy()}get destroyed(){return this.isDestroy}get timeout(){return this.options.timeout}set timeout(e){this.options.timeout=e}get idle(){return this.isIdle}set idle(e){e?this.handleTimeout():this.reset(),this.callback({isIdle:this.isIdle})}}class r{constructor(e,t){__publicField(this,"eventHandlerFunction"),__publicField(this,"event","visibilitychange"),__publicField(this,"timeoutHandler"),__publicField(this,"options"),__publicField(this,"defaultOptions",{timeout:5e3,once:!1,immediate:!0,ssr:!1}),__publicField(this,"isVisible",!1),this.callback=e,this.options={...this.defaultOptions,...t},this.eventHandlerFunction=this.eventHandler.bind(this),!this.options.ssr&&o()?this.start():this.options.ssr||o()||console.warn('[UserVisibility](constructor) executed on server side - set "ssr" option to "false"')}start(){o()?(this.options.immediate&&this.emitCallback(),this.addEventListener()):console.warn("[UserVisibility](start) you should run this method on client side")}emitCallback(){this.isVisible="visible"===document.visibilityState,this.callback({isVisible:this.isVisible}),this.options.once&&this.destroy()}eventHandler(){"visible"!==document.visibilityState||this.isVisible?"hidden"===document.visibilityState&&this.initTimeout():(this.clearTimeout(),this.emitCallback())}clearTimeout(){this.timeoutHandler&&(clearTimeout(this.timeoutHandler),this.timeoutHandler=void 0)}initTimeout(){this.clearTimeout(),this.timeoutHandler=setTimeout(this.emitCallback.bind(this),this.options.timeout)}addEventListener(){document.addEventListener(this.event,this.eventHandlerFunction)}removeEventListener(){document.removeEventListener(this.event,this.eventHandlerFunction)}destroy(){this.removeEventListener(),this.timeoutHandler&&clearTimeout(this.timeoutHandler)}}const a="__vue_click_away__",l=()=>null===document.ontouchstart?"touchstart":"click",d=async(e,i)=>{c(e);const s=i.instance,o=i.value,n="function"==typeof o;if(!n)throw new Error("[maz-ui](vClickOutside) the callback should be a function");await t.nextTick(),e[a]=t=>{if((!e||!e.contains(t.target))&&o&&n)return o.call(s,t)};const r=l();document.addEventListener(r,e[a],!1)},c=e=>{const t=l();document.removeEventListener(t,e[a],!1),delete e[a]},u={mounted:d,updated:(e,t)=>{t.value!==t.oldValue&&d(e,t)},unmounted:c},m={install:e=>{e.directive("click-outside",u)}},h=(e,t,i,s)=>{e.stopPropagation();const{handler:o,exclude:n}=i.value;let r=!1;if(n&&n.length>0)for(const a of n)if(!r){r=s.context.$refs[a].contains(e.target)}t.contains(e.target)||r||s.context[o]()},p=()=>null===document.ontouchstart?"touchstart":"click",g={mounted:(e,t,i)=>{const s=p();document.addEventListener(s,(s=>h(s,e,t,i)))},unmounted:(e,t,i)=>{const s=p();document.removeEventListener(s,(s=>h(s,e,t,i)))}},v={install:e=>{e.directive("closable",g)}},b={close:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>',next:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"/></svg>',previous:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"/></svg>',spinner:'<svg width="40px" height="40px" version="1.1" xmlns="http://www.w3.org/2000/svg" fill="currentColor" x="0px" y="0px" viewBox="0 0 50 50" xml:space="preserve" class="maz-zoom-img__loader__svg" data-v-6d1cb50c=""><path d="M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z"></path></svg>'};class y{constructor(e){if(__publicField(this,"options"),__publicField(this,"loader"),__publicField(this,"wrapper"),__publicField(this,"img"),__publicField(this,"keydownHandler"),__publicField(this,"onImgLoadedCallback"),__publicField(this,"buttonsAdded"),__publicField(this,"defaultOptions",{scale:!0,blur:!0,disabled:!1}),__publicField(this,"mouseEnterListener"),__publicField(this,"mouseLeaveListener"),__publicField(this,"renderPreviewListener"),!e.value)throw new Error('[MazUI](zoom-img) Image path must be defined. Ex: `v-zoom-img="<PATH_TO_IMAGE>"`');if("object"==typeof e.value&&!e.value.src)throw new Error("[maz-ui](zoom-img) src of image must be provided");this.buttonsAdded=!1,this.options=this.buildOptions(e),this.keydownHandler=this.keydownLister.bind(this),this.loader=this.getLoader(),this.wrapper=document.createElement("div"),this.wrapper.classList.add("maz-zoom-img__wrapper"),this.wrapper.prepend(this.loader),this.img=document.createElement("img"),this.onImgLoadedCallback=this.onImgLoaded.bind(this),this.imgEventHandler(!0)}buildOptions(e){return{...this.defaultOptions,..."object"==typeof e.value?e.value:{src:e.value}}}get allInstances(){return[...document.querySelectorAll(".maz-zoom-img-instance")]}create(e){this.options.disabled||(e.style.cursor="pointer",setTimeout((()=>e.classList.add("maz-zoom-img-instance"))),e.setAttribute("data-src",this.options.src),this.options.alt&&e.setAttribute("data-alt",this.options.alt),e.style.transition="all 300ms ease-in-out",this.mouseEnterListener=()=>this.mouseEnter(e),this.mouseLeaveListener=()=>this.mouseLeave(e),this.renderPreviewListener=()=>this.renderPreview(e,this.options),e.addEventListener("mouseenter",this.mouseEnterListener),e.addEventListener("mouseleave",this.mouseLeaveListener),e.addEventListener("click",this.renderPreviewListener))}update(e){this.options=this.buildOptions(e)}remove(e){this.imgEventHandler(!1),e.removeEventListener("mouseenter",this.mouseEnterListener),e.removeEventListener("mouseleave",this.mouseLeaveListener),e.removeEventListener("click",this.renderPreviewListener),e.classList.remove("maz-zoom-img-instance"),e.removeAttribute("data-src"),e.removeAttribute("data-alt"),e.style.cursor=""}renderPreview(e,t){e.classList.add("maz-is-open"),this.addStyle("\n.maz-zoom-img {\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n padding: 2.5rem;\n z-index: 1050;\n background-color: hsla(238, 15%, 40%, 0.7);\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n}\n\n.maz-zoom-img,\n.maz-zoom-img * {\n box-sizing: border-box;\n}\n\n.maz-zoom-img .maz-zoom-img__wrapper {\n position: relative;\n display: flex;\n justify-content: center;\n align-items: center;\n min-width: 0;\n min-height: 0;\n max-width: 100%;\n max-height: 100%;\n transition: all 300ms ease-in-out;\n opacity: 0;\n transform: scale(0.5);\n}\n\n.maz-zoom-img.maz-animate .maz-zoom-img__wrapper {\n opacity: 1;\n transform: scale(1);\n}\n\n.maz-zoom-img.maz-animate .maz-zoom-img__loader {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: hsla(238, 15%, 40%, 0.7);\n border-radius: 1rem;\n z-index: 2;\n min-width: 60px;\n min-height: 60px;\n}\n.maz-zoom-img.maz-animate .maz-zoom-img__loader[hidden] {\n display: none;\n}\n\n@-webkit-keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n}\n\n@keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n}\n\n.maz-zoom-img.maz-animate .maz-zoom-img__loader__svg {\n animation: spin .6s linear infinite;\n}\n\n.maz-zoom-img img {\n max-width: 100%;\n max-height: 100%;\n min-width: 0;\n border-radius: 1rem;\n}\n\n.maz-zoom-img .maz-zoom-btn {\n margin: 0 auto;\n border: none;\n background-color: hsla(0, 0%, 7%, 0.5);\n box-shadow: 0 0 0.5rem 0 hsla(0, 0%, 0%, 0.2);\n height: 2.2rem;\n min-height: 2.2rem;\n width: 2.2rem;\n min-width: 2.2rem;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 2.2rem;\n cursor: pointer;\n flex: 0 0 auto;\n outline: none;\n}\n\n.maz-zoom-img .maz-zoom-btn svg {\n fill: white;\n}\n\n.maz-zoom-img .maz-zoom-btn.maz-zoom-btn--close {\n position: absolute;\n top: 0.5rem;\n right: 0.5rem;\n z-index: 1;\n}\n\n.maz-zoom-img .maz-zoom-btn.maz-zoom-btn--previous {\n position: absolute;\n left: 0.5rem;\n z-index: 1;\n}\n\n.maz-zoom-img .maz-zoom-btn.maz-zoom-btn--next {\n position: absolute;\n right: 0.5rem;\n z-index: 1;\n}\n\n.maz-zoom-img .maz-zoom-btn:hover {\n background-color: hsl(0, 0%, 0%);\n}");const i=document.createElement("div");i.classList.add("maz-zoom-img"),i.setAttribute("id","MazImgPreviewFullsize"),i.addEventListener("click",(e=>{i.isEqualNode(e.target)&&this.closePreview()})),"object"==typeof t&&(this.img.setAttribute("src",t.src),t.alt&&this.img.setAttribute("alt",t.alt),this.img.id="MazImgElement"),this.wrapper.append(this.img),i.append(this.wrapper),document.body.append(i),this.keyboardEventHandler(!0),setTimeout((()=>{i&&i.classList.add("maz-animate")}),100)}onImgLoaded(){this.wrapper.style.width=`${this.img.width}px`,this.wrapper.style.minWidth="200px",this.loader.hidden=!0;const e=this.getButton(),t=[],i=this.allInstances.length>1;if(!this.buttonsAdded){if(this.buttonsAdded=!0,i){const e=this.getButton("previous"),i=this.getButton("next");t.push(e,i)}this.wrapper.append(e),i&&(this.wrapper.prepend(t[0]),this.wrapper.append(t[1]))}}getLoader(){const e=document.createElement("div");return e.classList.add("maz-zoom-img__loader"),e.innerHTML=b.spinner,e}mouseLeave(e){this.options.scale&&(e.style.transform=""),this.options.blur&&(e.style.filter=""),e.style.zIndex=""}mouseEnter(e){e.style.zIndex="1",this.options.scale&&(e.style.transform="scale(1.1)"),this.options.blur&&(e.style.filter="blur(2px)")}keydownLister(e){e.preventDefault(),"Escape"!==e.key&&" "!==e.key||this.closePreview(),"ArrowLeft"!==e.key&&"ArrowRight"!==e.key||this.nextPreviousImage("ArrowRight"===e.key)}getButton(e="close"){const t=document.createElement("button");return t.innerHTML=b[e],t.addEventListener("click",(()=>{"close"===e?this.closePreview():this.allInstances&&this.nextPreviousImage("next"===e)})),t.classList.add("maz-zoom-btn"),t.classList.add(`maz-zoom-btn--${e}`),t}closePreview(){const e=document.querySelector("#MazImgPreviewFullsize"),t=document.querySelector("#MazPreviewStyle"),i=document.querySelector(".maz-zoom-img-instance.maz-is-open");i&&i.classList.remove("maz-is-open"),e&&e.classList.remove("maz-animate"),this.keyboardEventHandler(!1),setTimeout((()=>{e&&e.remove(),t&&t.remove()}),300)}getNewInstanceIndex(e){return e<0?this.allInstances.length-1:e>=this.allInstances.length?0:e}nextPreviousImage(e){const t=e,i=document.querySelector(".maz-zoom-img-instance.maz-is-open");if(i){const e=this.allInstances.indexOf(i),s=t?e+1:e-1,o=this.allInstances[this.getNewInstanceIndex(s)];o&&this.useNextInstance(i,o)}}useNextInstance(e,t){e.classList.remove("maz-is-open"),t.classList.add("maz-is-open");const i=t.getAttribute("data-src"),s=t.getAttribute("data-alt");this.wrapper.style.width="",this.loader.hidden=!1,i&&this.img.setAttribute("src",i),s&&this.img.setAttribute("alt",s)}addStyle(e){const t=document.createElement("style");t.id="MazPreviewStyle",t.textContent=e,document.head.append(t)}keyboardEventHandler(e){if(e)return document.addEventListener("keydown",this.keydownHandler);document.removeEventListener("keydown",this.keydownHandler)}imgEventHandler(e){if(e)return this.img.addEventListener("load",this.onImgLoadedCallback);this.img.removeEventListener("load",this.onImgLoadedCallback)}}let w;const f={created(e,t){w=new y(t),w.create(e)},updated(e,t){w.update(t)},unmounted(e){w.remove(e)}},z={install(e){e.directive("zoom-img",f)}},L={baseClass:"m-lazy-img",loadedClass:"m-lazy-loaded",loadingClass:"m-lazy-loading",errorClass:"m-lazy-error",noPhotoClass:"m-lazy-no-photo",noPhoto:!1,observerOnce:!0,loadOnce:!1,noUseErrorPhoto:!1,observerOptions:{threshold:.1}};class I{constructor(e={}){__publicField(this,"observers",[]),__publicField(this,"defaultOptions",L),__publicField(this,"options"),__publicField(this,"onImgLoadedCallback"),__publicField(this,"onImgErrorCallback"),__publicField(this,"hasImgLoaded",!1),this.options=this.buildOptions(e),this.onImgLoadedCallback=this.imageIsLoaded.bind(this),this.onImgErrorCallback=this.imageHasError.bind(this)}async loadErrorPhoto(){const{default:e}=await Promise.resolve().then((()=>re));return e}buildOptions(e){return{...this.defaultOptions,...e,observerOptions:{...this.defaultOptions.observerOptions,...e.observerOptions}}}removeClass(e,t){e.classList.remove(t)}addClass(e,t){e.classList.add(t)}removeAllStateClasses(e){this.removeClass(e,this.options.loadedClass),this.removeClass(e,this.options.loadingClass),this.removeClass(e,this.options.errorClass),this.removeClass(e,this.options.noPhotoClass)}setBaseClass(e){this.addClass(e,this.options.baseClass)}imageIsLoading(e){var t,i;this.addClass(e,this.options.loadingClass),null==(i=(t=this.options).onLoading)||i.call(t,e)}imageHasNoPhoto(e){this.removeClass(e,this.options.loadingClass),this.addClass(e,this.options.noPhotoClass),this.setDefaultPhoto(e)}imageIsLoaded(e){var t,i;this.hasImgLoaded=!0,this.removeClass(e,this.options.loadingClass),this.addClass(e,this.options.loadedClass),null==(i=(t=this.options).onLoaded)||i.call(t,e)}imageHasError(e,t){var i,s;console.warn("[maz-ui][MazLazyImg] Error while loading image",t),this.removeClass(e,this.options.loadingClass),this.addClass(e,this.options.errorClass),null==(s=(i=this.options).onError)||s.call(i,e),this.setDefaultPhoto(e)}getImageUrl(e,t){const i=this.getImgElement(e).getAttribute("data-src");if(i)return i;const s="object"==typeof t.value?t.value.src:t.value;return s||console.warn("[maz-ui][MazLazyImg] src url is not defined"),s}async setPictureSourceUrls(e){const t=e.querySelectorAll("source");if(t.length>0)for await(const i of t){const e=i.getAttribute("data-srcset");e?i.srcset=e:console.warn('[maz-ui][MazLazyImg] the "[data-srcset]" attribute is not provided on "<source />"')}else console.warn('[maz-ui][MazLazyImg] No "<source />" elements provided into the "<picture />" element'),this.imageHasError(e)}hasBgImgMode(e){return"bg-image"===e.arg}isPictureElement(e){return e instanceof HTMLPictureElement}getImgElement(e){return this.isPictureElement(e)?e.querySelector("img"):e}async setDefaultPhoto(e){if(this.options.noUseErrorPhoto)return;const t=this.options.errorPhoto??await this.loadErrorPhoto(),i=e.querySelectorAll("source");if(i.length>0)for await(const s of i)s.srcset=t;else this.setImgSrc(e,t)}addEventListenerToImg(e){const t=this.getImgElement(e);t.addEventListener("load",(()=>this.onImgLoadedCallback(e)),{once:!0}),t.addEventListener("error",(t=>this.onImgErrorCallback(e,t)),{once:!0})}async loadImage(e,t){if(this.imageIsLoading(e),this.isPictureElement(e))this.addEventListenerToImg(e),await this.setPictureSourceUrls(e);else{const i=this.getImageUrl(e,t);if(!i)return this.imageHasError(e);this.hasBgImgMode(t)?(e.style.backgroundImage=`url('${i}')`,this.imageIsLoaded(e)):(this.addEventListenerToImg(e),this.setImgSrc(e,i))}}setImgSrc(e,t){this.getImgElement(e).src=t}handleIntersectionObserver(e,t,i,s){var o,n;this.observers.push(s);for(const r of i)if(r.isIntersecting){if(null==(n=(o=this.options).onIntersecting)||n.call(o,r.target),this.options.observerOnce&&s.unobserve(e),this.options.loadOnce&&this.hasImgLoaded)return;this.loadImage(e,t)}}createObserver(e,t){const i=this.options.observerOptions;new IntersectionObserver(((i,s)=>{this.handleIntersectionObserver(e,t,i,s)}),i).observe(e)}async imageHandler(e,t,i){if("update"===i)for await(const s of this.observers)s.unobserve(e);window.IntersectionObserver?this.createObserver(e,t):this.loadImage(e,t)}async bindUpdateHandler(e,t,i){if(this.options.noPhoto)return this.imageHasNoPhoto(e);await this.imageHandler(e,t,i)}async add(e,t){if(this.hasBgImgMode(t)&&this.isPictureElement(e))throw new Error('[MazLazyImg] You can\'t use the "bg-image" mode with "<picture />" element');setTimeout((()=>this.setBaseClass(e)),0),e.getAttribute("src")||this.setImgSrc(e,"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"),await this.bindUpdateHandler(e,t,"bind")}async update(e,t){t.value!==t.oldValue&&(this.hasImgLoaded=!1,this.removeAllStateClasses(e),await this.bindUpdateHandler(e,t,"update"))}remove(e,t){this.hasImgLoaded=!1,this.hasBgImgMode(t)&&(e.style.backgroundImage=""),this.removeAllStateClasses(e);for(const i of this.observers)i.unobserve(e);this.observers=[]}}let T;const _={created(e,t){const i="object"==typeof t.value?t.value:{};T=new I(i),T.add(e,t)},updated(e,t){T.update(e,t)},unmounted(e,t){T.remove(e,t)}},E={install(e,t={}){const i={...L,...t,observerOptions:{...L.observerOptions,...t.observerOptions}},s=new I(i);e.directive("lazy-img",{created:s.add.bind(s),updated:s.update.bind(s),unmounted:s.remove.bind(s)})}},M=[{name:"click-outside",directive:u},{name:"closable",directive:g},{name:"zoom-img",directive:f},{name:"lazy-img",directive:_}],C={install(e){for(const{name:t,directive:i}of M)e.directive(t,i)}},A=e=>e?(e=e.toString()).charAt(0).toUpperCase()+e.slice(1):"",k={style:"currency",minimumFractionDigits:2,round:!1},x=(e,t,i)=>{const s={...k,...i};((e,t,i)=>{if(void 0===e)throw new TypeError("[maz-ui](FilterCurrency) The `number` attribute is required.");if(void 0===t)throw new TypeError("[maz-ui](FilterCurrency) The `locale` attribute is required.");if("string"!=typeof t)throw new TypeError("[maz-ui](FilterCurrency) The `locale` attribute must be a string.");if(void 0===i.currency)throw new TypeError("[maz-ui](FilterCurrency) The `options.currency` attribute is required.")})(e,t,s);try{return((e,t,i)=>{let s=Number(e);return i.round&&(s=Math.floor(s),i.minimumFractionDigits=0),new Intl.NumberFormat(t,i).format(s)})(e,t,s)}catch(o){throw new Error(`[maz-ui](FilterCurrency) ${o}`)}},S={month:"short",day:"numeric",year:"numeric"},D=(e,t,i)=>{if(void 0===t)throw new TypeError("[maz-ui](FilterDate) The `locale` attribute is required.");if("string"!=typeof t)throw new TypeError("[maz-ui](FilterDate) The `locale` attribute must be a string.");const s=i??S;try{const i=e instanceof Date?e:new Date(e);return new Intl.DateTimeFormat(t,s).format(i)}catch(o){throw new Error(`[maz-ui](FilterDate) ${o}`)}},N={minimumFractionDigits:2},H=(e,t,i)=>{if(i={...N,...i},void 0===e)throw new TypeError("[maz-ui](FilterNumber) The `number` attribute is required.");if(void 0===t)throw new TypeError("[maz-ui](FilterNumber) The `locale` attribute is required.");if("string"!=typeof t)throw new TypeError("[maz-ui](FilterNumber) The `locale` attribute must be a string.");try{return new Intl.NumberFormat(t,i).format(Number(e))}catch(s){throw new Error(`[maz-ui](FilterNumber) ${s}`)}},j={capitalize:A,currency:x,date:D,number:H},O={install(e){e.provide("filters",j)}};class F{constructor(e,t){__publicField(this,"callback"),__publicField(this,"delay"),__publicField(this,"timer"),__publicField(this,"startedAt"),this.startedAt=Date.now(),this.callback=e,this.delay=t,this.start()}pause(){this.stop(),this.delay-=Date.now()-this.startedAt}resume(){this.startedAt=Date.now(),this.start()}start(){this.timer=setTimeout(this.callback,this.delay)}stop(){clearTimeout(this.timer)}}const P=["innerHTML"],B=t.defineComponent({__name:"MazIcon",props:{src:{type:String,default:void 0},path:{type:String,default:void 0},name:{type:String,default:void 0},size:{type:String,default:"1.5rem"},title:{type:String,default:void 0},transformSource:{type:Function,default:e=>e}},emits:["loaded","unloaded","error"],setup(e,{emit:s}){const o=e,n={},r=t.ref(),a=t.ref(),l=t.computed((()=>o.path??(()=>{try{return i("mazIconPath")}catch{return}})())),d=t.computed((()=>o.src?o.src:l.value?`${l.value}/${o.name}.svg`:`/${o.name}.svg`));t.onMounted((()=>{o.name||o.src||console.error('[maz-ui](MazIcon) you should provide "name" or "src" as prop')}));const c=e=>{const t={},i=e.attributes;if(!i)return t;for(let s=i.length-1;s>=0;s--)t[i[s].name]=i[s].value;return t},u=e=>{let t=e.cloneNode(!0);return t=o.transformSource(e),o.title&&((e,t)=>{const i=e.querySelectorAll("title");if(i.length>0)i[0].textContent=t;else{const i=document.createElementNS("http://www.w3.org/2000/svg","title");i.textContent=t,e.append(i)}})(t,o.title),e.innerHTML},m=e=>new Promise(((t,i)=>{const s=new XMLHttpRequest;s.open("GET",e,!0),s.addEventListener("load",(()=>{if(s.status>=200&&s.status<400)try{const e=new DOMParser;let n=e.parseFromString(s.responseText,"text/xml").querySelectorAll("svg")[0];n?(n=o.transformSource(n),t(n)):i(new Error('Loaded file is not valid SVG"'))}catch(e){i(e)}else i(new Error("Error loading SVG"))})),s.addEventListener("error",(()=>i())),s.send()}));return t.watchEffect((()=>(async e=>{n[e]||(n[e]=m(e));try{r.value=await n[e],await t.nextTick(),s("loaded",a.value)}catch(i){r.value&&(r.value=void 0,s("unloaded")),delete n[e],s("error",i)}})(d.value))),(i,s)=>{return r.value?(t.openBlock(),t.createElementBlock("svg",t.mergeProps({key:0,ref_key:"svgElem",ref:a,width:"1em",height:"1em"},{...c(r.value),...(o=i.$attrs,Object.keys(o).reduce(((e,t)=>(!1!==o[t]&&null!==o[t]&&void 0!==o[t]&&(e[t]=o[t]),e)),{}))},{style:`font-size: ${e.size}`,innerHTML:u(r.value)}),null,16,P)):t.createCommentVNode("",!0);var o}}}),V={class:"m-toast__message-wrapper"},q={class:"m-toast__message"},Z={key:0,class:"--close"},$=((e,t)=>{const i=e.__vccOpts||e;for(const[s,o]of t)i[s]=o;return i})(t.defineComponent({__name:"MazToast",props:{position:{type:String,default:"bottom-right"},maxToasts:{type:[Number,Boolean],default:!1},timeout:{type:Number,default:1e4},queue:{type:Boolean,default:!1},noPauseOnHover:{type:Boolean,default:!1},type:{type:String,default:"info",validator:e=>["info","success","warning","danger"].includes(e)},message:{type:String,required:!0},persistent:{type:Boolean,default:!1}},emits:["close","click"],setup(e,{emit:i}){const s=e,o=t.ref(),n=t.computed((()=>s.position.includes("top")?"top":"bottom")),r=t.computed((()=>s.position.includes("left")?"left":s.position.includes("right")?"right":"center")),a=t.computed((()=>"center"!==r.value?"right"===r.value?"m-slide-right":"m-slide-left":"top"===n.value?"m-slide-top":"m-slide-bottom")),l=t.ref(!1),d=t.ref(),c=t.ref(),u=`m-toast-container --${n.value} --${r.value}`,m=`.${u.replaceAll(" ",".")}`,h=()=>{if((()=>{const e=document.querySelector(m);return!(!s.queue&&!1===s.maxToasts)&&(!1!==s.maxToasts&&e?s.maxToasts<=e.childElementCount:e&&e.childElementCount>0)})())return void(c.value=setTimeout(h,250));const e=document.querySelector(m);o.value&&e&&e.prepend(o.value),l.value=!0,d.value=s.timeout?new F(g,s.timeout):void 0};const p=e=>{d.value&&!s.noPauseOnHover&&(e?d.value.pause():d.value.resume())},g=()=>{d.value&&d.value.stop(),c.value&&clearTimeout(c.value),l.value=!1,setTimeout((()=>{var e;i("close"),null==(e=o.value)||e.remove();const t=document.querySelector(m);t&&!(null==t?void 0:t.hasChildNodes())&&t.remove()}),300)};return t.onMounted((()=>{(()=>{const e=document.querySelector(m);if(!e&&!e){const e=document.body,t=document.createElement("div");t.className=u,e.append(t)}})(),h()})),(d,c)=>(t.openBlock(),t.createBlock(t.Transition,{name:t.unref(a)},{default:t.withCtx((()=>[t.withDirectives(t.createElementVNode("div",{ref_key:"Toaster",ref:o,class:t.normalizeClass(["m-toast",[`--${e.type}`,`--${t.unref(n)}`,`--${t.unref(r)}`]]),role:"alert",onMouseover:c[0]||(c[0]=e=>p(!0)),onMouseleave:c[1]||(c[1]=e=>p(!1)),onClick:c[2]||(c[2]=e=>(i("click",e),void(s.persistent||g())))},[t.createElementVNode("div",V,[t.createElementVNode("p",q,t.toDisplayString(e.message),1)]),e.persistent?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("button",Z,[t.createVNode(B,{src:t.unref("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAyNCAyNCIgc3Ryb2tlPSJjdXJyZW50Q29sb3IiIGFyaWEtaGlkZGVuPSJ0cnVlIj4KICA8cGF0aCBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iMiIgZD0iTTYgMThMMTggNk02IDZsMTIgMTIiLz4KPC9zdmc+Cg=="),class:"--icon"},null,8,["src"])]))],34),[[t.vShow,l.value]])])),_:1},8,["name"]))}}),[["__scopeId","data-v-f511285d"]]);class G{constructor(e,t){this.app=e,this.globalOptions=t}show(e,t){const i={...{message:e,...t},...this.globalOptions,...t};s($,{props:i,app:this.app})}getLocalOptions(e,t){return{type:e,...t}}success(e,t){return this.show(e,this.getLocalOptions("success",t))}error(e,t){return this.show(e,this.getLocalOptions("danger",t))}info(e,t){return this.show(e,this.getLocalOptions("info",t))}warning(e,t){return this.show(e,this.getLocalOptions("warning",t))}}const U={position:"bottom-right",timeout:1e4,persistent:!0};e.toastInstance=void 0;const Y={install(t,i){e.toastInstance=new G(t,{...U,...i}),t.provide("toast",e.toastInstance)}};class W{constructor(){__publicField(this,"_loaders",t.ref([]))}get loaders(){return t.computed((()=>this._loaders.value))}stop(e=""){var t;this._loaders.value=(t=this._loaders.value,(e="")=>t.filter((t=>t!==e)))(e)}start(e=""){var t;return this._loaders.value=(t=this._loaders.value,(e="")=>(e=>e.filter(((e,t,i)=>t===i.indexOf(e))))([...t,e]))(e),()=>this.stop(e)}get anyLoading(){return t.computed((()=>this._loaders.value.length>0))}isLoading(e=""){return t.computed((()=>{return(t=this._loaders.value,(e="")=>"function"==typeof e?t.findIndex(((...t)=>e(...t)))>-1:t.includes(e))(e);var t})).value}}const Q=new W,J={install:e=>{e.provide("wait",Q)}},R=100,X={root:void 0,rootMargin:"0px",threshold:.2},K={once:!0,duration:300};class ee{constructor(e){__publicField(this,"options"),this.options={delay:(null==e?void 0:e.delay)??R,observer:{...X,...null==e?void 0:e.observer},animation:{...K,...null==e?void 0:e.animation}}}runAnimations(){if(o())return this.handleObserver();console.warn("[MazAos](runAnimations) should be executed on client side")}async handleObserver(){var e;await(e=this.options.delay,new Promise((t=>setTimeout(t,e))));const t=new IntersectionObserver(this.handleIntersect.bind(this),{...this.options.observer});for(const i of document.querySelectorAll("[data-maz-aos]")){const e=i.getAttribute("data-maz-aos-anchor");if(e){const i=document.querySelector(e);i?(i.setAttribute("data-maz-aos-children","true"),t.observe(i)):console.warn(`[maz-ui](aos) no element found with selector "${e}"`)}else t.observe(i)}}handleIntersect(e,t){for(const i of e){const e="true"===i.target.getAttribute("data-maz-aos-children"),s=i.target.getAttribute("data-maz-aos")?[i.target]:[];if(e){const e=[...document.querySelectorAll("[data-maz-aos-anchor]")].map((e=>e.getAttribute("data-maz-aos-anchor")===`#${i.target.id}`?e:void 0));for(const t of e)t&&s.push(t)}for(const o of s){const e=o.getAttribute("data-maz-aos-once"),s="string"==typeof e?"true"===e:this.options.animation.once;if(i.intersectionRatio>this.options.observer.threshold){o.getAttribute("data-maz-aos-duration")||(o.style.transitionDuration=`${this.options.animation.duration}ms`,setTimeout((()=>{o.style.transitionDuration="0"}),1e3)),o.classList.add("maz-aos-animate"),s&&t.unobserve(o)}else o.classList.remove("maz-aos-animate")}}}}e.aosInstance=void 0;const te={install:(t,i)=>{e.aosInstance=new ee(i),t.provide("aos",e.aosInstance),o()&&((null==i?void 0:i.router)?i.router.afterEach((async()=>{e.aosInstance.runAnimations()})):e.aosInstance.runAnimations())}},ie={darkClass:"dark",storageThemeKey:"theme",storageThemeValueDark:"dark",storageThemeValueLight:"light"},se=t.ref(),oe=t.ref(),ne=t.ref(),re=Object.freeze(Object.defineProperty({__proto__:null,default:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDI0IDI0IiBoZWlnaHQ9IjQ4cHgiIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjQ4cHgiIGZpbGw9IiNjZGNkY2QiPgogIDxnPgogICAgPHJlY3QgZmlsbD0ibm9uZSIgaGVpZ2h0PSIyNCIgd2lkdGg9IjI0Ii8+CiAgICA8Zz4KICAgICAgPHBhdGggZD0iTTguOSw2LjA3TDcuNDgsNC42Nkw5LDNoNmwxLjgzLDJIMjBjMS4xLDAsMiwwLjksMiwydjEyYzAsMC4wNS0wLjAxLDAuMS0wLjAyLDAuMTZMMjAsMTcuMTdWN2gtNC4wNWwtMS44My0ySDkuODggTDguOSw2LjA3eiBNMjAuNDksMjMuMzFMMTguMTcsMjFINGMtMS4xLDAtMi0wLjktMi0yVjdjMC0wLjU5LDAuMjctMS4xMiwwLjY4LTEuNDlsLTItMkwyLjEsMi4xbDE5LjgsMTkuOEwyMC40OSwyMy4zMXogTTkuMTksMTIuMDJDOS4wOCwxMi4zMyw5LDEyLjY1LDksMTNjMCwxLjY2LDEuMzQsMywzLDNjMC4zNSwwLDAuNjctMC4wOCwwLjk4LTAuMTlMOS4xOSwxMi4wMnogTTE2LjE3LDE5bC0xLjY4LTEuNjggQzEzLjc2LDE3Ljc1LDEyLjkxLDE4LDEyLDE4Yy0yLjc2LDAtNS0yLjI0LTUtNWMwLTAuOTEsMC4yNS0xLjc2LDAuNjgtMi40OUw0LjE3LDdINHYxMkgxNi4xN3ogTTE0LjgxLDExLjk4bDIuMDcsMi4wNyBDMTYuOTYsMTMuNzEsMTcsMTMuMzYsMTcsMTNjMC0yLjc2LTIuMjQtNS01LTVjLTAuMzYsMC0wLjcxLDAuMDQtMS4wNiwwLjEybDIuMDcsMi4wN0MxMy44NSwxMC40OSwxNC41MSwxMS4xNSwxNC44MSwxMS45OHoiLz4KICAgIDwvZz4KICA8L2c+Cjwvc3ZnPg=="},Symbol.toStringTag,{value:"Module"}));e.AosHandler=ee,e.IdleTimeout=n,e.ToasterHandler=G,e.UserVisibility=r,e.WaitHandler=W,e.capitalize=A,e.currency=x,e.date=D,e.debounce=function(e,t=0,i=!1){let s,o;const n=function(){s&&(clearTimeout(s),o=void 0,s=void 0)},r=function(...r){if(!t)return e.apply(this,r);const a=this,l=i&&!s;return n(),o=function(){e.apply(a,r)},s=setTimeout((function(){if(s=void 0,!l){const e=o;if(o=void 0,void 0!==e)return e()}}),t),l?o():void 0};return r.cancel=n,r.flush=function(){const e=o;n(),e&&e()},r},e.injectStrict=i,e.installAos=te,e.installDirectives=C,e.installFilters=O,e.installToaster=Y,e.installWait=J,e.isClient=o,e.mount=s,e.number=H,e.sleep=e=>new Promise((t=>{setTimeout(t,e)})),e.theme=se,e.truthyFilter=function(e){return!!e},e.useAos=()=>({aos:i("aos")}),e.useIdleTimeout=({callback:e,options:t})=>{const i=new n(e,t);oe.value=i;return{idle:oe}},e.useInstanceUniqId=({componentName:e,instance:i,providedId:s})=>({instanceId:t.computed((()=>s??`${e}-${null==i?void 0:i.uid}`))}),e.useThemeHandler=(e=ie)=>{const i={...ie,...e};return{autoSetTheme:()=>(({storageThemeKey:e,storageThemeValueDark:t,darkClass:i,storageThemeValueLight:s})=>{localStorage[e]===t||!(e in localStorage)&&window.matchMedia("(prefers-color-scheme: dark)").matches?(document.documentElement.classList.add(i),localStorage[e]=t,se.value=t):(document.documentElement.classList.remove(i),localStorage[e]=s,se.value=s)})(i),toggleTheme:()=>(({storageThemeKey:e,storageThemeValueDark:t,darkClass:i,storageThemeValueLight:s})=>{localStorage[e]===t?(document.documentElement.classList.remove(i),localStorage[e]=s,se.value=s):(document.documentElement.classList.add(i),localStorage[e]=t,se.value=t)})(i),hasDarkTheme:t.computed((()=>se.value===i.storageThemeValueDark)),hasLightTheme:t.computed((()=>se.value===i.storageThemeValueLight)),theme:se}},e.useToast=()=>({toast:i("toast")}),e.useUserVisibility=({callback:e,options:t})=>{const i=new r(e,t);ne.value=i;return{visibility:ne}},e.useWait=()=>({wait:i("wait")}),e.vClickOutside=u,e.vClickOutsideInstall=m,e.vClosable=g,e.vClosableInstall=v,e.vLazyImg=_,e.vLazyImgInstall=E,e.vZoomImg=f,e.vZoomImgInstall=z,e.waitInstance=Q,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));
2
+ var __defProp=Object.defineProperty,__defNormalProp=(e,t,i)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,__publicField=(e,t,i)=>(__defNormalProp(e,"symbol"!=typeof t?t+"":t,i),i);!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["maz-ui"]={},e.Vue)}(this,(function(e,t){"use strict";function i(e,i){const s=t.inject(e,i);if(!s)throw new Error(`[maz-ui](injectStrict) Could not resolve ${e}`);return s}function s(e,{props:i,children:s,element:o,app:n}={}){let r=o;const a=t.createVNode(e,i,s);n&&n._context&&(a.appContext=n._context),r?t.render(a,r):"undefined"!=typeof document&&t.render(a,r=document.createElement("div"));return{vNode:a,destroy:()=>{r&&t.render(null,r)},el:r}}function o(){return"undefined"!=typeof document}class n{constructor(e,t){__publicField(this,"defaultOptions",{element:void 0,timeout:3e5,once:!1,immediate:!0,ssr:!1}),__publicField(this,"options"),__publicField(this,"timeoutHandler"),__publicField(this,"isIdle",!1),__publicField(this,"isDestroy",!1),__publicField(this,"startTime",0),__publicField(this,"remainingTime",0),__publicField(this,"lastClientX",-1),__publicField(this,"lastClientY",-1),__publicField(this,"eventNames",["DOMMouseScroll","mousedown","mousemove","mousewheel","MSPointerDown","MSPointerMove","keydown","touchmove","touchstart","wheel","click"]),__publicField(this,"handleEvent",(e=>{try{if(this.remainingTime>0)return;if("mousemove"===e.type){const{clientX:t,clientY:i}=e;if(void 0===t&&void 0===i||t===this.lastClientX&&i===this.lastClientY)return;this.lastClientX=t,this.lastClientY=i}this.resetTimeout(),this.callback({isIdle:this.isIdle,eventType:e.type})}catch(t){throw new Error(`[IdleTimeout](handleEvent) ${t}`)}})),this.callback=e,this.options={...this.defaultOptions,...t},!this.options.ssr&&o()?this.start():this.options.ssr||o()||console.warn('[IdleTimeout](constructor) executed on server side - set immediate option to "false"')}get element(){return this.options.element??document.body}start(){if(o()){for(const e of this.eventNames)this.element.addEventListener(e,this.handleEvent);this.resetTimeout(),this.options.immediate&&this.callback({isIdle:!1})}else console.warn("[IdleTimeout](start) you should run this method on client side")}pause(){const e=this.startTime+this.options.timeout-Date.now();e<=0||(this.remainingTime=e,this.timeoutHandler&&(clearTimeout(this.timeoutHandler),this.timeoutHandler=void 0))}resume(){this.remainingTime<=0||(this.resetTimeout(),this.callback({isIdle:this.isIdle}),this.remainingTime=0)}reset(){this.isDestroy=!1,this.isIdle=!1,this.remainingTime=0,this.resetTimeout(),this.callback({isIdle:this.isIdle})}destroy(){if(o()){this.isDestroy=!0;for(const e of this.eventNames)this.element.removeEventListener(e,this.handleEvent);this.timeoutHandler&&clearTimeout(this.timeoutHandler)}else console.warn("[IdleTimeout](destroy) you should run this method on client side")}resetTimeout(){this.isIdle=!1,this.timeoutHandler&&(clearTimeout(this.timeoutHandler),this.timeoutHandler=void 0),this.timeoutHandler=setTimeout(this.handleTimeout.bind(this),this.remainingTime||this.options.timeout),this.startTime=Date.now()}handleTimeout(){this.isIdle=!0,this.callback({isIdle:this.isIdle}),this.options.once&&this.destroy()}get destroyed(){return this.isDestroy}get timeout(){return this.options.timeout}set timeout(e){this.options.timeout=e}get idle(){return this.isIdle}set idle(e){e?this.handleTimeout():this.reset(),this.callback({isIdle:this.isIdle})}}class r{constructor(e,t){__publicField(this,"eventHandlerFunction"),__publicField(this,"event","visibilitychange"),__publicField(this,"timeoutHandler"),__publicField(this,"options"),__publicField(this,"defaultOptions",{timeout:5e3,once:!1,immediate:!0,ssr:!1}),__publicField(this,"isVisible",!1),this.callback=e,this.options={...this.defaultOptions,...t},this.eventHandlerFunction=this.eventHandler.bind(this),!this.options.ssr&&o()?this.start():this.options.ssr||o()||console.warn('[UserVisibility](constructor) executed on server side - set "ssr" option to "false"')}start(){o()?(this.options.immediate&&this.emitCallback(),this.addEventListener()):console.warn("[UserVisibility](start) you should run this method on client side")}emitCallback(){this.isVisible="visible"===document.visibilityState,this.callback({isVisible:this.isVisible}),this.options.once&&this.destroy()}eventHandler(){"visible"!==document.visibilityState||this.isVisible?"hidden"===document.visibilityState&&this.initTimeout():(this.clearTimeout(),this.emitCallback())}clearTimeout(){this.timeoutHandler&&(clearTimeout(this.timeoutHandler),this.timeoutHandler=void 0)}initTimeout(){this.clearTimeout(),this.timeoutHandler=setTimeout(this.emitCallback.bind(this),this.options.timeout)}addEventListener(){document.addEventListener(this.event,this.eventHandlerFunction)}removeEventListener(){document.removeEventListener(this.event,this.eventHandlerFunction)}destroy(){this.removeEventListener(),this.timeoutHandler&&clearTimeout(this.timeoutHandler)}}const a="__vue_click_away__",l=()=>null===document.ontouchstart?"touchstart":"click",d=async(e,i)=>{u(e);const s=i.instance,o=i.value,n="function"==typeof o;if(!n)throw new Error("[maz-ui](vClickOutside) the callback should be a function");await t.nextTick(),e[a]=t=>{if((!e||!e.contains(t.target))&&o&&n)return o.call(s,t)};const r=l();document.addEventListener(r,e[a],!1)},u=e=>{const t=l();document.removeEventListener(t,e[a],!1),delete e[a]},c={mounted:d,updated:(e,t)=>{t.value!==t.oldValue&&d(e,t)},unmounted:u},m={install:e=>{e.directive("click-outside",c)}},h=(e,t,i,s)=>{e.stopPropagation();const{handler:o,exclude:n}=i.value;let r=!1;if(n&&n.length>0)for(const a of n)if(!r){r=s.context.$refs[a].contains(e.target)}t.contains(e.target)||r||s.context[o]()},p=()=>null===document.ontouchstart?"touchstart":"click",g={mounted:(e,t,i)=>{const s=p();document.addEventListener(s,(s=>h(s,e,t,i)))},unmounted:(e,t,i)=>{const s=p();document.removeEventListener(s,(s=>h(s,e,t,i)))}},v={install:e=>{e.directive("closable",g)}},b={close:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>',next:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"/></svg>',previous:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"/></svg>',spinner:'<svg width="40px" height="40px" version="1.1" xmlns="http://www.w3.org/2000/svg" fill="currentColor" x="0px" y="0px" viewBox="0 0 50 50" xml:space="preserve" class="maz-zoom-img__loader__svg" data-v-6d1cb50c=""><path d="M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z"></path></svg>'};class y{constructor(e){if(__publicField(this,"options"),__publicField(this,"loader"),__publicField(this,"wrapper"),__publicField(this,"img"),__publicField(this,"keydownHandler"),__publicField(this,"onImgLoadedCallback"),__publicField(this,"buttonsAdded"),__publicField(this,"defaultOptions",{scale:!0,blur:!0,disabled:!1}),__publicField(this,"mouseEnterListener"),__publicField(this,"mouseLeaveListener"),__publicField(this,"renderPreviewListener"),!e.value)throw new Error('[MazUI](zoom-img) Image path must be defined. Ex: `v-zoom-img="<PATH_TO_IMAGE>"`');if("object"==typeof e.value&&!e.value.src)throw new Error("[maz-ui](zoom-img) src of image must be provided");this.buttonsAdded=!1,this.options=this.buildOptions(e),this.keydownHandler=this.keydownLister.bind(this),this.loader=this.getLoader(),this.wrapper=document.createElement("div"),this.wrapper.classList.add("maz-zoom-img__wrapper"),this.wrapper.prepend(this.loader),this.img=document.createElement("img"),this.onImgLoadedCallback=this.onImgLoaded.bind(this),this.imgEventHandler(!0)}buildOptions(e){return{...this.defaultOptions,..."object"==typeof e.value?e.value:{src:e.value}}}get allInstances(){return[...document.querySelectorAll(".maz-zoom-img-instance")]}create(e){this.options.disabled||(e.style.cursor="pointer",setTimeout((()=>e.classList.add("maz-zoom-img-instance"))),e.setAttribute("data-src",this.options.src),this.options.alt&&e.setAttribute("data-alt",this.options.alt),e.style.transition="all 300ms ease-in-out",this.mouseEnterListener=()=>this.mouseEnter(e),this.mouseLeaveListener=()=>this.mouseLeave(e),this.renderPreviewListener=()=>this.renderPreview(e,this.options),e.addEventListener("mouseenter",this.mouseEnterListener),e.addEventListener("mouseleave",this.mouseLeaveListener),e.addEventListener("click",this.renderPreviewListener))}update(e){this.options=this.buildOptions(e)}remove(e){this.imgEventHandler(!1),e.removeEventListener("mouseenter",this.mouseEnterListener),e.removeEventListener("mouseleave",this.mouseLeaveListener),e.removeEventListener("click",this.renderPreviewListener),e.classList.remove("maz-zoom-img-instance"),e.removeAttribute("data-src"),e.removeAttribute("data-alt"),e.style.cursor=""}renderPreview(e,t){e.classList.add("maz-is-open"),this.addStyle("\n.maz-zoom-img {\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n padding: 2.5rem;\n z-index: 1050;\n background-color: hsla(238, 15%, 40%, 0.7);\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n}\n\n.maz-zoom-img,\n.maz-zoom-img * {\n box-sizing: border-box;\n}\n\n.maz-zoom-img .maz-zoom-img__wrapper {\n position: relative;\n display: flex;\n justify-content: center;\n align-items: center;\n min-width: 0;\n min-height: 0;\n max-width: 100%;\n max-height: 100%;\n transition: all 300ms ease-in-out;\n opacity: 0;\n transform: scale(0.5);\n}\n\n.maz-zoom-img.maz-animate .maz-zoom-img__wrapper {\n opacity: 1;\n transform: scale(1);\n}\n\n.maz-zoom-img.maz-animate .maz-zoom-img__loader {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: hsla(238, 15%, 40%, 0.7);\n border-radius: 1rem;\n z-index: 2;\n min-width: 60px;\n min-height: 60px;\n}\n.maz-zoom-img.maz-animate .maz-zoom-img__loader[hidden] {\n display: none;\n}\n\n@-webkit-keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n}\n\n@keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n}\n\n.maz-zoom-img.maz-animate .maz-zoom-img__loader__svg {\n animation: spin .6s linear infinite;\n}\n\n.maz-zoom-img img {\n max-width: 100%;\n max-height: 100%;\n min-width: 0;\n border-radius: 1rem;\n}\n\n.maz-zoom-img .maz-zoom-btn {\n margin: 0 auto;\n border: none;\n background-color: hsla(0, 0%, 7%, 0.5);\n box-shadow: 0 0 0.5rem 0 hsla(0, 0%, 0%, 0.2);\n height: 2.2rem;\n min-height: 2.2rem;\n width: 2.2rem;\n min-width: 2.2rem;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 2.2rem;\n cursor: pointer;\n flex: 0 0 auto;\n outline: none;\n}\n\n.maz-zoom-img .maz-zoom-btn svg {\n fill: white;\n}\n\n.maz-zoom-img .maz-zoom-btn.maz-zoom-btn--close {\n position: absolute;\n top: 0.5rem;\n right: 0.5rem;\n z-index: 1;\n}\n\n.maz-zoom-img .maz-zoom-btn.maz-zoom-btn--previous {\n position: absolute;\n left: 0.5rem;\n z-index: 1;\n}\n\n.maz-zoom-img .maz-zoom-btn.maz-zoom-btn--next {\n position: absolute;\n right: 0.5rem;\n z-index: 1;\n}\n\n.maz-zoom-img .maz-zoom-btn:hover {\n background-color: hsl(0, 0%, 0%);\n}");const i=document.createElement("div");i.classList.add("maz-zoom-img"),i.setAttribute("id","MazImgPreviewFullsize"),i.addEventListener("click",(e=>{i.isEqualNode(e.target)&&this.closePreview()})),"object"==typeof t&&(this.img.setAttribute("src",t.src),t.alt&&this.img.setAttribute("alt",t.alt),this.img.id="MazImgElement"),this.wrapper.append(this.img),i.append(this.wrapper),document.body.append(i),this.keyboardEventHandler(!0),setTimeout((()=>{i&&i.classList.add("maz-animate")}),100)}onImgLoaded(){this.wrapper.style.width=`${this.img.width}px`,this.wrapper.style.minWidth="200px",this.loader.hidden=!0;const e=this.getButton(),t=[],i=this.allInstances.length>1;if(!this.buttonsAdded){if(this.buttonsAdded=!0,i){const e=this.getButton("previous"),i=this.getButton("next");t.push(e,i)}this.wrapper.append(e),i&&(this.wrapper.prepend(t[0]),this.wrapper.append(t[1]))}}getLoader(){const e=document.createElement("div");return e.classList.add("maz-zoom-img__loader"),e.innerHTML=b.spinner,e}mouseLeave(e){this.options.scale&&(e.style.transform=""),this.options.blur&&(e.style.filter=""),e.style.zIndex=""}mouseEnter(e){e.style.zIndex="1",this.options.scale&&(e.style.transform="scale(1.1)"),this.options.blur&&(e.style.filter="blur(2px)")}keydownLister(e){e.preventDefault(),"Escape"!==e.key&&" "!==e.key||this.closePreview(),"ArrowLeft"!==e.key&&"ArrowRight"!==e.key||this.nextPreviousImage("ArrowRight"===e.key)}getButton(e="close"){const t=document.createElement("button");return t.innerHTML=b[e],t.addEventListener("click",(()=>{"close"===e?this.closePreview():this.allInstances&&this.nextPreviousImage("next"===e)})),t.classList.add("maz-zoom-btn"),t.classList.add(`maz-zoom-btn--${e}`),t}closePreview(){const e=document.querySelector("#MazImgPreviewFullsize"),t=document.querySelector("#MazPreviewStyle"),i=document.querySelector(".maz-zoom-img-instance.maz-is-open");i&&i.classList.remove("maz-is-open"),e&&e.classList.remove("maz-animate"),this.keyboardEventHandler(!1),setTimeout((()=>{e&&e.remove(),t&&t.remove()}),300)}getNewInstanceIndex(e){return e<0?this.allInstances.length-1:e>=this.allInstances.length?0:e}nextPreviousImage(e){const t=e,i=document.querySelector(".maz-zoom-img-instance.maz-is-open");if(i){const e=this.allInstances.indexOf(i),s=t?e+1:e-1,o=this.allInstances[this.getNewInstanceIndex(s)];o&&this.useNextInstance(i,o)}}useNextInstance(e,t){e.classList.remove("maz-is-open"),t.classList.add("maz-is-open");const i=t.getAttribute("data-src"),s=t.getAttribute("data-alt");this.wrapper.style.width="",this.loader.hidden=!1,i&&this.img.setAttribute("src",i),s&&this.img.setAttribute("alt",s)}addStyle(e){const t=document.createElement("style");t.id="MazPreviewStyle",t.textContent=e,document.head.append(t)}keyboardEventHandler(e){if(e)return document.addEventListener("keydown",this.keydownHandler);document.removeEventListener("keydown",this.keydownHandler)}imgEventHandler(e){if(e)return this.img.addEventListener("load",this.onImgLoadedCallback);this.img.removeEventListener("load",this.onImgLoadedCallback)}}let w;const f={created(e,t){w=new y(t),w.create(e)},updated(e,t){w.update(t)},unmounted(e){w.remove(e)}},z={install(e){e.directive("zoom-img",f)}},L={baseClass:"m-lazy-img",loadedClass:"m-lazy-loaded",loadingClass:"m-lazy-loading",errorClass:"m-lazy-error",noPhotoClass:"m-lazy-no-photo",noPhoto:!1,observerOnce:!0,loadOnce:!1,noUseErrorPhoto:!1,observerOptions:{threshold:.1}};class I{constructor(e={}){__publicField(this,"observers",[]),__publicField(this,"defaultOptions",L),__publicField(this,"options"),__publicField(this,"onImgLoadedCallback"),__publicField(this,"onImgErrorCallback"),__publicField(this,"hasImgLoaded",!1),this.options=this.buildOptions(e),this.onImgLoadedCallback=this.imageIsLoaded.bind(this),this.onImgErrorCallback=this.imageHasError.bind(this)}async loadErrorPhoto(){const{default:e}=await Promise.resolve().then((()=>de));return e}buildOptions(e){return{...this.defaultOptions,...e,observerOptions:{...this.defaultOptions.observerOptions,...e.observerOptions}}}removeClass(e,t){e.classList.remove(t)}addClass(e,t){e.classList.add(t)}removeAllStateClasses(e){this.removeClass(e,this.options.loadedClass),this.removeClass(e,this.options.loadingClass),this.removeClass(e,this.options.errorClass),this.removeClass(e,this.options.noPhotoClass)}setBaseClass(e){this.addClass(e,this.options.baseClass)}imageIsLoading(e){var t,i;this.addClass(e,this.options.loadingClass),null==(i=(t=this.options).onLoading)||i.call(t,e)}imageHasNoPhoto(e){this.removeClass(e,this.options.loadingClass),this.addClass(e,this.options.noPhotoClass),this.setDefaultPhoto(e)}imageIsLoaded(e){var t,i;this.hasImgLoaded=!0,this.removeClass(e,this.options.loadingClass),this.addClass(e,this.options.loadedClass),null==(i=(t=this.options).onLoaded)||i.call(t,e)}imageHasError(e,t){var i,s;console.warn("[maz-ui][MazLazyImg] Error while loading image",t),this.removeClass(e,this.options.loadingClass),this.addClass(e,this.options.errorClass),null==(s=(i=this.options).onError)||s.call(i,e),this.setDefaultPhoto(e)}getImageUrl(e,t){const i=this.getImgElement(e).getAttribute("data-src");if(i)return i;const s="object"==typeof t.value?t.value.src:t.value;return s||console.warn("[maz-ui][MazLazyImg] src url is not defined"),s}async setPictureSourceUrls(e){const t=e.querySelectorAll("source");if(t.length>0)for await(const i of t){const e=i.getAttribute("data-srcset");e?i.srcset=e:console.warn('[maz-ui][MazLazyImg] the "[data-srcset]" attribute is not provided on "<source />"')}else console.warn('[maz-ui][MazLazyImg] No "<source />" elements provided into the "<picture />" element'),this.imageHasError(e)}hasBgImgMode(e){return"bg-image"===e.arg}isPictureElement(e){return e instanceof HTMLPictureElement}getImgElement(e){return this.isPictureElement(e)?e.querySelector("img"):e}async setDefaultPhoto(e){if(this.options.noUseErrorPhoto)return;const t=this.options.errorPhoto??await this.loadErrorPhoto(),i=e.querySelectorAll("source");if(i.length>0)for await(const s of i)s.srcset=t;else this.setImgSrc(e,t)}addEventListenerToImg(e){const t=this.getImgElement(e);t.addEventListener("load",(()=>this.onImgLoadedCallback(e)),{once:!0}),t.addEventListener("error",(t=>this.onImgErrorCallback(e,t)),{once:!0})}async loadImage(e,t){if(this.imageIsLoading(e),this.isPictureElement(e))this.addEventListenerToImg(e),await this.setPictureSourceUrls(e);else{const i=this.getImageUrl(e,t);if(!i)return this.imageHasError(e);this.hasBgImgMode(t)?(e.style.backgroundImage=`url('${i}')`,this.imageIsLoaded(e)):(this.addEventListenerToImg(e),this.setImgSrc(e,i))}}setImgSrc(e,t){this.getImgElement(e).src=t}handleIntersectionObserver(e,t,i,s){var o,n;this.observers.push(s);for(const r of i)if(r.isIntersecting){if(null==(n=(o=this.options).onIntersecting)||n.call(o,r.target),this.options.observerOnce&&s.unobserve(e),this.options.loadOnce&&this.hasImgLoaded)return;this.loadImage(e,t)}}createObserver(e,t){const i=this.options.observerOptions;new IntersectionObserver(((i,s)=>{this.handleIntersectionObserver(e,t,i,s)}),i).observe(e)}async imageHandler(e,t,i){if("update"===i)for await(const s of this.observers)s.unobserve(e);window.IntersectionObserver?this.createObserver(e,t):this.loadImage(e,t)}async bindUpdateHandler(e,t,i){if(this.options.noPhoto)return this.imageHasNoPhoto(e);await this.imageHandler(e,t,i)}async add(e,t){if(this.hasBgImgMode(t)&&this.isPictureElement(e))throw new Error('[MazLazyImg] You can\'t use the "bg-image" mode with "<picture />" element');setTimeout((()=>this.setBaseClass(e)),0),e.getAttribute("src")||this.setImgSrc(e,"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"),await this.bindUpdateHandler(e,t,"bind")}async update(e,t){t.value!==t.oldValue&&(this.hasImgLoaded=!1,this.removeAllStateClasses(e),await this.bindUpdateHandler(e,t,"update"))}remove(e,t){this.hasImgLoaded=!1,this.hasBgImgMode(t)&&(e.style.backgroundImage=""),this.removeAllStateClasses(e);for(const i of this.observers)i.unobserve(e);this.observers=[]}}let T;const M={created(e,t){const i="object"==typeof t.value?t.value:{};T=new I(i),T.add(e,t)},updated(e,t){T.update(e,t)},unmounted(e,t){T.remove(e,t)}},_={install(e,t={}){const i={...L,...t,observerOptions:{...L.observerOptions,...t.observerOptions}},s=new I(i);e.directive("lazy-img",{created:s.add.bind(s),updated:s.update.bind(s),unmounted:s.remove.bind(s)})}},E=[{name:"click-outside",directive:c},{name:"closable",directive:g},{name:"zoom-img",directive:f},{name:"lazy-img",directive:M}],C={install(e){for(const{name:t,directive:i}of E)e.directive(t,i)}},k=e=>e?(e=e.toString()).charAt(0).toUpperCase()+e.slice(1):"",A={style:"currency",minimumFractionDigits:2,round:!1},x=(e,t,i)=>{const s={...A,...i};((e,t,i)=>{if(void 0===e)throw new TypeError("[maz-ui](FilterCurrency) The `number` attribute is required.");if(void 0===t)throw new TypeError("[maz-ui](FilterCurrency) The `locale` attribute is required.");if("string"!=typeof t)throw new TypeError("[maz-ui](FilterCurrency) The `locale` attribute must be a string.");if(void 0===i.currency)throw new TypeError("[maz-ui](FilterCurrency) The `options.currency` attribute is required.")})(e,t,s);try{return((e,t,i)=>{let s=Number(e);return i.round&&(s=Math.floor(s),i.minimumFractionDigits=0),new Intl.NumberFormat(t,i).format(s)})(e,t,s)}catch(o){throw new Error(`[maz-ui](FilterCurrency) ${o}`)}},S={month:"short",day:"numeric",year:"numeric"},D=(e,t,i)=>{if(void 0===t)throw new TypeError("[maz-ui](FilterDate) The `locale` attribute is required.");if("string"!=typeof t)throw new TypeError("[maz-ui](FilterDate) The `locale` attribute must be a string.");const s=i??S;try{const i=e instanceof Date?e:new Date(e);return new Intl.DateTimeFormat(t,s).format(i)}catch(o){throw new Error(`[maz-ui](FilterDate) ${o}`)}},N={minimumFractionDigits:2},H=(e,t,i)=>{if(i={...N,...i},void 0===e)throw new TypeError("[maz-ui](FilterNumber) The `number` attribute is required.");if(void 0===t)throw new TypeError("[maz-ui](FilterNumber) The `locale` attribute is required.");if("string"!=typeof t)throw new TypeError("[maz-ui](FilterNumber) The `locale` attribute must be a string.");try{return new Intl.NumberFormat(t,i).format(Number(e))}catch(s){throw new Error(`[maz-ui](FilterNumber) ${s}`)}},j={capitalize:k,currency:x,date:D,number:H},O={install(e){e.provide("filters",j)}};class F{constructor(e,t){__publicField(this,"callback"),__publicField(this,"delay"),__publicField(this,"timer"),__publicField(this,"startedAt"),this.startedAt=Date.now(),this.callback=e,this.delay=t,this.start()}pause(){this.stop(),this.delay-=Date.now()-this.startedAt}resume(){this.startedAt=Date.now(),this.start()}start(){this.timer=setTimeout(this.callback,this.delay)}stop(){clearTimeout(this.timer)}}const P=["innerHTML"],B=t.defineComponent({__name:"MazIcon",props:{src:{type:String,default:void 0},path:{type:String,default:void 0},name:{type:String,default:void 0},size:{type:String,default:"1.5rem"},title:{type:String,default:void 0},transformSource:{type:Function,default:e=>e}},emits:["loaded","unloaded","error"],setup(e,{emit:s}){const o=e,n={},r=t.ref(),a=t.ref(),l=t.computed((()=>o.path??(()=>{try{return i("mazIconPath")}catch{return}})())),d=t.computed((()=>o.src?o.src:l.value?`${l.value}/${o.name}.svg`:`/${o.name}.svg`));t.onMounted((()=>{o.name||o.src||console.error('[maz-ui](MazIcon) you should provide "name" or "src" as prop')}));const u=e=>{const t={},i=e.attributes;if(!i)return t;for(let s=i.length-1;s>=0;s--)t[i[s].name]=i[s].value;return t},c=e=>{let t=e.cloneNode(!0);return t=o.transformSource(e),o.title&&((e,t)=>{const i=e.querySelectorAll("title");if(i.length>0)i[0].textContent=t;else{const i=document.createElementNS("http://www.w3.org/2000/svg","title");i.textContent=t,e.append(i)}})(t,o.title),e.innerHTML},m=e=>new Promise(((t,i)=>{const s=new XMLHttpRequest;s.open("GET",e,!0),s.addEventListener("load",(()=>{if(s.status>=200&&s.status<400)try{const e=new DOMParser;let n=e.parseFromString(s.responseText,"text/xml").querySelectorAll("svg")[0];n?(n=o.transformSource(n),t(n)):i(new Error('Loaded file is not valid SVG"'))}catch(e){i(e)}else i(new Error("Error loading SVG"))})),s.addEventListener("error",(()=>i())),s.send()}));return t.watchEffect((()=>(async e=>{n[e]||(n[e]=m(e));try{r.value=await n[e],await t.nextTick(),s("loaded",a.value)}catch(i){r.value&&(r.value=void 0,s("unloaded")),delete n[e],s("error",i)}})(d.value))),(i,s)=>{return r.value?(t.openBlock(),t.createElementBlock("svg",t.mergeProps({key:0,ref_key:"svgElem",ref:a,width:"1em",height:"1em"},{...u(r.value),...(o=i.$attrs,Object.keys(o).reduce(((e,t)=>(!1!==o[t]&&null!==o[t]&&void 0!==o[t]&&(e[t]=o[t]),e)),{}))},{style:`font-size: ${e.size}`,innerHTML:c(r.value)}),null,16,P)):t.createCommentVNode("",!0);var o}}}),V={class:"m-toast__message-wrapper"},q={class:"m-toast__message"},Z={key:0,class:"--close"},$=((e,t)=>{const i=e.__vccOpts||e;for(const[s,o]of t)i[s]=o;return i})(t.defineComponent({__name:"MazToast",props:{position:{type:String,default:"bottom-right"},maxToasts:{type:[Number,Boolean],default:!1},timeout:{type:Number,default:1e4},queue:{type:Boolean,default:!1},noPauseOnHover:{type:Boolean,default:!1},type:{type:String,default:"info",validator:e=>["info","success","warning","danger"].includes(e)},message:{type:String,required:!0},persistent:{type:Boolean,default:!1}},emits:["close","click"],setup(e,{emit:i}){const s=e,o=t.ref(),n=t.computed((()=>s.position.includes("top")?"top":"bottom")),r=t.computed((()=>s.position.includes("left")?"left":s.position.includes("right")?"right":"center")),a=t.computed((()=>"center"!==r.value?"right"===r.value?"m-slide-right":"m-slide-left":"top"===n.value?"m-slide-top":"m-slide-bottom")),l=t.ref(!1),d=t.ref(),u=t.ref(),c=`m-toast-container --${n.value} --${r.value}`,m=`.${c.replaceAll(" ",".")}`,h=()=>{if((()=>{const e=document.querySelector(m);return!(!s.queue&&!1===s.maxToasts)&&(!1!==s.maxToasts&&e?s.maxToasts<=e.childElementCount:e&&e.childElementCount>0)})())return void(u.value=setTimeout(h,250));const e=document.querySelector(m);o.value&&e&&e.prepend(o.value),l.value=!0,d.value=s.timeout?new F(g,s.timeout):void 0};const p=e=>{d.value&&!s.noPauseOnHover&&(e?d.value.pause():d.value.resume())},g=()=>{d.value&&d.value.stop(),u.value&&clearTimeout(u.value),l.value=!1,setTimeout((()=>{var e;i("close"),null==(e=o.value)||e.remove();const t=document.querySelector(m);t&&!(null==t?void 0:t.hasChildNodes())&&t.remove()}),300)};return t.onMounted((()=>{(()=>{const e=document.querySelector(m);if(!e&&!e){const e=document.body,t=document.createElement("div");t.className=c,e.append(t)}})(),h()})),(d,u)=>(t.openBlock(),t.createBlock(t.Transition,{name:t.unref(a)},{default:t.withCtx((()=>[t.withDirectives(t.createElementVNode("div",{ref_key:"Toaster",ref:o,class:t.normalizeClass(["m-toast",[`--${e.type}`,`--${t.unref(n)}`,`--${t.unref(r)}`]]),role:"alert",onMouseover:u[0]||(u[0]=e=>p(!0)),onMouseleave:u[1]||(u[1]=e=>p(!1)),onClick:u[2]||(u[2]=e=>(i("click",e),void(s.persistent||g())))},[t.createElementVNode("div",V,[t.createElementVNode("p",q,t.toDisplayString(e.message),1)]),e.persistent?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("button",Z,[t.createVNode(B,{src:t.unref("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAyNCAyNCIgc3Ryb2tlPSJjdXJyZW50Q29sb3IiIGFyaWEtaGlkZGVuPSJ0cnVlIj4KICA8cGF0aCBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iMiIgZD0iTTYgMThMMTggNk02IDZsMTIgMTIiLz4KPC9zdmc+Cg=="),class:"--icon"},null,8,["src"])]))],34),[[t.vShow,l.value]])])),_:1},8,["name"]))}}),[["__scopeId","data-v-f511285d"]]);class G{constructor(e,t){this.app=e,this.globalOptions=t}show(e,t){const i={...{message:e,...t},...this.globalOptions,...t};s($,{props:i,app:this.app})}getLocalOptions(e,t){return{type:e,...t}}success(e,t){return this.show(e,this.getLocalOptions("success",t))}error(e,t){return this.show(e,this.getLocalOptions("danger",t))}info(e,t){return this.show(e,this.getLocalOptions("info",t))}warning(e,t){return this.show(e,this.getLocalOptions("warning",t))}}const U={position:"bottom-right",timeout:1e4,persistent:!0};e.toastInstance=void 0;const Y={install(t,i){e.toastInstance=new G(t,{...U,...i}),t.provide("toast",e.toastInstance)}};class W{constructor(){__publicField(this,"_loaders",t.ref([]))}get loaders(){return t.computed((()=>this._loaders.value))}stop(e=""){var t;this._loaders.value=(t=this._loaders.value,(e="")=>t.filter((t=>t!==e)))(e)}start(e=""){var t;return this._loaders.value=(t=this._loaders.value,(e="")=>(e=>e.filter(((e,t,i)=>t===i.indexOf(e))))([...t,e]))(e),()=>this.stop(e)}get anyLoading(){return t.computed((()=>this._loaders.value.length>0))}isLoading(e=""){return t.computed((()=>{return(t=this._loaders.value,(e="")=>"function"==typeof e?t.findIndex(((...t)=>e(...t)))>-1:t.includes(e))(e);var t})).value}}const Q=new W,K={install:e=>{e.provide("wait",Q)}},J=100,R={root:void 0,rootMargin:"0px",threshold:.2},X={once:!0,duration:300};class ee{constructor(e){__publicField(this,"options"),this.options={delay:(null==e?void 0:e.delay)??J,observer:{...R,...null==e?void 0:e.observer},animation:{...X,...null==e?void 0:e.animation}}}runAnimations(){if(o())return this.handleObserver();console.warn("[MazAos](runAnimations) should be executed on client side")}async handleObserver(){var e;await(e=this.options.delay,new Promise((t=>setTimeout(t,e))));const t=new IntersectionObserver(this.handleIntersect.bind(this),{...this.options.observer});for(const i of document.querySelectorAll("[data-maz-aos]")){const e=i.getAttribute("data-maz-aos-anchor");if(e){const i=document.querySelector(e);i?(i.setAttribute("data-maz-aos-children","true"),t.observe(i)):console.warn(`[maz-ui](aos) no element found with selector "${e}"`)}else t.observe(i)}}handleIntersect(e,t){for(const i of e){const e="true"===i.target.getAttribute("data-maz-aos-children"),s=i.target.getAttribute("data-maz-aos")?[i.target]:[];if(e){const e=[...document.querySelectorAll("[data-maz-aos-anchor]")].map((e=>e.getAttribute("data-maz-aos-anchor")===`#${i.target.id}`?e:void 0));for(const t of e)t&&s.push(t)}for(const o of s){const e=o.getAttribute("data-maz-aos-once"),s="string"==typeof e?"true"===e:this.options.animation.once;if(i.intersectionRatio>this.options.observer.threshold){o.getAttribute("data-maz-aos-duration")||(o.style.transitionDuration=`${this.options.animation.duration}ms`,setTimeout((()=>{o.style.transitionDuration="0"}),1e3)),o.classList.add("maz-aos-animate"),s&&t.unobserve(o)}else o.classList.remove("maz-aos-animate")}}}}e.aosInstance=void 0;const te={install:(t,i)=>{e.aosInstance=new ee(i),t.provide("aos",e.aosInstance),o()&&((null==i?void 0:i.router)?i.router.afterEach((async()=>{e.aosInstance.runAnimations()})):e.aosInstance.runAnimations())}},ie={darkClass:"dark",storageThemeKey:"theme",storageThemeValueDark:"dark",storageThemeValueLight:"light"},se=t.ref(),oe=({darkClass:e,storageThemeKey:t,storageThemeValueDark:i})=>{document.documentElement.classList.add(e),localStorage[t]=i,se.value=i},ne=({darkClass:e,storageThemeKey:t,storageThemeValueLight:i})=>{document.documentElement.classList.remove(e),localStorage[t]=i,se.value=i},re=({shouldSetDarkMode:e,...t})=>e?oe(t):ne(t),ae=t.ref(),le=t.ref(),de=Object.freeze(Object.defineProperty({__proto__:null,default:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDI0IDI0IiBoZWlnaHQ9IjQ4cHgiIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjQ4cHgiIGZpbGw9IiNjZGNkY2QiPgogIDxnPgogICAgPHJlY3QgZmlsbD0ibm9uZSIgaGVpZ2h0PSIyNCIgd2lkdGg9IjI0Ii8+CiAgICA8Zz4KICAgICAgPHBhdGggZD0iTTguOSw2LjA3TDcuNDgsNC42Nkw5LDNoNmwxLjgzLDJIMjBjMS4xLDAsMiwwLjksMiwydjEyYzAsMC4wNS0wLjAxLDAuMS0wLjAyLDAuMTZMMjAsMTcuMTdWN2gtNC4wNWwtMS44My0ySDkuODggTDguOSw2LjA3eiBNMjAuNDksMjMuMzFMMTguMTcsMjFINGMtMS4xLDAtMi0wLjktMi0yVjdjMC0wLjU5LDAuMjctMS4xMiwwLjY4LTEuNDlsLTItMkwyLjEsMi4xbDE5LjgsMTkuOEwyMC40OSwyMy4zMXogTTkuMTksMTIuMDJDOS4wOCwxMi4zMyw5LDEyLjY1LDksMTNjMCwxLjY2LDEuMzQsMywzLDNjMC4zNSwwLDAuNjctMC4wOCwwLjk4LTAuMTlMOS4xOSwxMi4wMnogTTE2LjE3LDE5bC0xLjY4LTEuNjggQzEzLjc2LDE3Ljc1LDEyLjkxLDE4LDEyLDE4Yy0yLjc2LDAtNS0yLjI0LTUtNWMwLTAuOTEsMC4yNS0xLjc2LDAuNjgtMi40OUw0LjE3LDdINHYxMkgxNi4xN3ogTTE0LjgxLDExLjk4bDIuMDcsMi4wNyBDMTYuOTYsMTMuNzEsMTcsMTMuMzYsMTcsMTNjMC0yLjc2LTIuMjQtNS01LTVjLTAuMzYsMC0wLjcxLDAuMDQtMS4wNiwwLjEybDIuMDcsMi4wN0MxMy44NSwxMC40OSwxNC41MSwxMS4xNSwxNC44MSwxMS45OHoiLz4KICAgIDwvZz4KICA8L2c+Cjwvc3ZnPg=="},Symbol.toStringTag,{value:"Module"}));e.AosHandler=ee,e.IdleTimeout=n,e.ToasterHandler=G,e.UserVisibility=r,e.WaitHandler=W,e.capitalize=k,e.currency=x,e.date=D,e.debounce=function(e,t=0,i=!1){let s,o;const n=function(){s&&(clearTimeout(s),o=void 0,s=void 0)},r=function(...r){if(!t)return e.apply(this,r);const a=this,l=i&&!s;return n(),o=function(){e.apply(a,r)},s=setTimeout((function(){if(s=void 0,!l){const e=o;if(o=void 0,void 0!==e)return e()}}),t),l?o():void 0};return r.cancel=n,r.flush=function(){const e=o;n(),e&&e()},r},e.injectStrict=i,e.installAos=te,e.installDirectives=C,e.installFilters=O,e.installToaster=Y,e.installWait=K,e.isClient=o,e.mount=s,e.number=H,e.sleep=e=>new Promise((t=>{setTimeout(t,e)})),e.theme=se,e.truthyFilter=function(e){return!!e},e.useAos=()=>({aos:i("aos")}),e.useIdleTimeout=({callback:e,options:t})=>{const i=new n(e,t);ae.value=i;return{idle:ae}},e.useInstanceUniqId=({componentName:e,instance:i,providedId:s})=>({instanceId:t.computed((()=>s??`${e}-${null==i?void 0:i.uid}`))}),e.useThemeHandler=(e=ie)=>{const i={...ie,...e};return{autoSetTheme:()=>(e=>{localStorage[e.storageThemeKey]===e.storageThemeValueDark||!(e.storageThemeKey in localStorage)&&window.matchMedia("(prefers-color-scheme: dark)").matches?oe(e):ne(e)})(i),toggleTheme:()=>(e=>localStorage[e.storageThemeKey]===e.storageThemeValueDark?ne(e):oe(e))(i),setDarkTheme:()=>re({...i,shouldSetDarkMode:!0}),setLightTheme:()=>re({...i,shouldSetDarkMode:!1}),hasDarkTheme:t.computed((()=>se.value===i.storageThemeValueDark)),hasLightTheme:t.computed((()=>se.value===i.storageThemeValueLight)),theme:se}},e.useToast=()=>({toast:i("toast")}),e.useUserVisibility=({callback:e,options:t})=>{const i=new r(e,t);le.value=i;return{visibility:le}},e.useWait=()=>({wait:i("wait")}),e.vClickOutside=c,e.vClickOutsideInstall=m,e.vClosable=g,e.vClosableInstall=v,e.vLazyImg=M,e.vLazyImgInstall=_,e.vZoomImg=f,e.vZoomImgInstall=z,e.waitInstance=Q,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "maz-ui",
3
- "version": "3.6.6",
3
+ "version": "3.6.7",
4
4
  "description": "A standalone components library for Vue.Js 3 & Nuxt.Js 3",
5
5
  "author": "Louis Mazel <me@loicmazuel.com>",
6
6
  "main": "modules/maz-ui.umd.js",