maz-ui 3.29.0 → 3.29.2
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/components/MazAvatar.d.ts +11 -0
- package/components/MazAvatar.mjs +1 -1
- package/components/MazBadge.d.ts +3 -3
- package/components/MazBadge.mjs +1 -1
- package/components/MazDropdown.mjs +59 -55
- package/components/MazFullscreenLoader.mjs +19 -10
- package/components/MazPullToRefresh.d.ts +88 -0
- package/components/MazPullToRefresh.mjs +4 -0
- package/components/assets/MazAccordion.css +1 -1
- package/components/assets/MazAvatar.css +1 -1
- package/components/assets/MazBadge.css +1 -1
- package/components/assets/MazFullscreenLoader.css +1 -0
- package/components/assets/MazPullToRefresh.css +1 -0
- package/components/chunks/MazAvatar-0JzIvOc4.mjs +134 -0
- package/components/chunks/{MazLazyImg-65QIsZ1B.mjs → MazLazyImg-evGMN9Pe.mjs} +2 -2
- package/components/chunks/MazPullToRefresh-l6zWVzfv.mjs +183 -0
- package/components/chunks/{MazSpinner-W3TVtT8l.mjs → MazSpinner-J65FS2NQ.mjs} +1 -1
- package/components/chunks/MazSpinner-f5zcetJO.mjs +38 -0
- package/components/index.d.ts +1 -0
- package/components/index.mjs +1 -0
- package/modules/chunks/{MazBtn-OU9ti0GG.mjs → MazBtn-23G6MO1u.mjs} +2 -2
- package/modules/chunks/{MazBtn-5jYVOHi5.cjs → MazBtn-BVge7L6B.cjs} +1 -1
- package/modules/chunks/{MazIcon-mIVA-wm3.mjs → MazIcon-3ecUGYyh.mjs} +1 -1
- package/modules/chunks/{MazIcon-O-Sd2-b9.cjs → MazIcon-tK6rWxmD.cjs} +1 -1
- package/modules/chunks/{MazSpinner-Me_ta933.mjs → MazSpinner-CKpey7-9.mjs} +1 -1
- package/modules/chunks/{MazSpinner-ElCcZG5D.cjs → MazSpinner-Yp72xl7m.cjs} +1 -1
- package/modules/chunks/index-t7LFFnFX.cjs +124 -0
- package/modules/chunks/{index-AC4Cl2MH.mjs → index-w7bAz52b.mjs} +395 -347
- package/modules/index.cjs +1 -1
- package/modules/index.mjs +24 -22
- package/nuxt/index.d.mts +10 -0
- package/nuxt/index.d.ts +10 -0
- package/nuxt/index.json +1 -1
- package/nuxt/index.mjs +14 -0
- package/package.json +1 -1
- package/tailwindcss/tailwind.config.ts +3 -1
- package/tailwindcss/utils/colors.ts +2 -1
- package/tailwindcss/variables/breakpoints.ts +14 -0
- package/tailwindcss/variables/utilities.ts +3 -1
- package/tailwindcss/variables/z-indexes.ts +2 -1
- package/types/components/MazAvatar.vue.d.ts +11 -0
- package/types/components/MazBadge.vue.d.ts +3 -3
- package/types/components/MazPullToRefresh.vue.d.ts +88 -0
- package/types/components/index.d.ts +1 -0
- package/types/modules/composables/index.d.ts +2 -0
- package/types/modules/composables/use-breakpoints.d.ts +38 -0
- package/types/modules/composables/use-window-size.d.ts +32 -0
- package/types/modules/helpers/is-standalone-mode.d.ts +1 -0
- package/types/tailwindcss/tailwind.config.d.ts +2 -0
- package/types/tailwindcss/variables/breakpoints.d.ts +1 -0
- package/components/chunks/MazAvatar-HJMP2asX.mjs +0 -127
- package/modules/chunks/index-f0w7PwtX.cjs +0 -124
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
var je=Object.create;var ie=Object.defineProperty;var We=Object.getOwnPropertyDescriptor;var Re=Object.getOwnPropertyNames;var Ye=Object.getPrototypeOf,Ke=Object.prototype.hasOwnProperty;var Xe=(s,e,t)=>e in s?ie(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var Ze=(s,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Re(e))!Ke.call(s,o)&&o!==t&&ie(s,o,{get:()=>e[o],enumerable:!(n=We(e,o))||n.enumerable});return s};var Qe=(s,e,t)=>(t=s!=null?je(Ye(s)):{},Ze(e||!s||!s.__esModule?ie(t,"default",{value:s,enumerable:!0}):t,s));var c=(s,e,t)=>(Xe(s,typeof e!="symbol"?e+"":e,t),t);var is=require("../assets/index.css");const i=require("vue");function K(s,e){const t=i.inject(s,e);if(!t)throw new TypeError(`[maz-ui](injectStrict) Could not resolve ${s}`);return t}function Ge(s,e){let t;return function(...n){clearTimeout(t),t=setTimeout(()=>{s.apply(this,n)},e)}}function ze(s){return!!s}function ae(s,e){let t=e==null?void 0:e.element;function n(){t&&i.render(null,t)}const o=i.createVNode(s,{...e==null?void 0:e.props,...e!=null&&e.addDestroyInProps?{destroy:n}:{}},e==null?void 0:e.children);return e!=null&&e.app?(o.appContext=e.app._context,t?i.render(o,t):typeof document<"u"&&(t=document.createElement("div"),i.render(o,t))):(t=t??document.body,i.render(o,t)),{vNode:o,destroy:n,el:t}}function z(){return typeof document<"u"}class Ee{constructor(e,t){c(this,"defaultOptions",{element:void 0,timeout:60*1e3*5,once:!1,immediate:!0});c(this,"options");c(this,"timeoutHandler");c(this,"isIdle",!1);c(this,"isDestroy",!1);c(this,"startTime",0);c(this,"remainingTime",0);c(this,"lastClientX",-1);c(this,"lastClientY",-1);c(this,"eventNames",["DOMMouseScroll","mousedown","mousemove","mousewheel","MSPointerDown","MSPointerMove","keydown","touchmove","touchstart","wheel","click"]);c(this,"handleEvent",e=>{try{if(this.remainingTime>0)return;if(e.type==="mousemove"){const{clientX:t,clientY:n}=e;if(t===void 0&&n===void 0||t===this.lastClientX&&n===this.lastClientY)return;this.lastClientX=t,this.lastClientY=n}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},z()&&this.start()}get element(){return this.options.element??document.body}start(){if(!z()){console.warn("[IdleTimeout](start) you should run this method on client side");return}for(const e of this.eventNames)this.element.addEventListener(e,this.handleEvent);this.resetTimeout(),this.options.immediate&&this.callback({isIdle:!1})}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(!z()){console.warn("[IdleTimeout](destroy) you should run this method on client side");return}this.isDestroy=!0;for(const e of this.eventNames)this.element.removeEventListener(e,this.handleEvent);this.timeoutHandler&&clearTimeout(this.timeoutHandler)}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 Le{constructor(e,t){c(this,"eventHandlerFunction");c(this,"event","visibilitychange");c(this,"timeoutHandler");c(this,"options");c(this,"defaultOptions",{timeout:5e3,once:!1,immediate:!0});c(this,"isVisible",!1);this.callback=e,this.options={...this.defaultOptions,...t},this.eventHandlerFunction=this.eventHandler.bind(this),z()&&this.start()}start(){if(!z()){console.warn("[UserVisibility](start) you should run this method on client side");return}this.options.immediate&&this.emitCallback(),this.addEventListener()}emitCallback(){this.isVisible=document.visibilityState==="visible",this.callback({isVisible:this.isVisible}),this.options.once&&this.destroy()}eventHandler(){document.visibilityState==="visible"&&!this.isVisible?(this.clearTimeout(),this.emitCallback()):document.visibilityState==="hidden"&&this.initTimeout()}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 $=s=>new Promise(e=>{setTimeout(e,s)});class Je{constructor({src:e,identifier:t,once:n=!0,async:o=!0,defer:u=!0}){c(this,"src");c(this,"script");c(this,"once");c(this,"async");c(this,"defer");c(this,"identifier");if(typeof window>"u")throw new TypeError("[ScriptLoader]: Is supported only on browser side");if(!e)throw new Error('[ScriptLoader]: You should provide the attribut "src"');if(!t)throw new Error('[ScriptLoader]: You should provide the attribut "identifier"');this.src=e,this.identifier=t,this.once=n,this.async=o,this.defer=u}removeTag(e){var t;typeof e=="string"?(t=document.head.querySelector(`[data-identifier="${e}"]`))==null||t.remove():e.remove()}load(){const e=window,t=document.head.querySelectorAll(`[data-identifier="${this.identifier}"]`);if(this.once&&e[this.identifier]&&t.length>0)return this.script=e[this.identifier],Promise.resolve(this.script);if(!this.once&&t.length>0)for(const n of t)this.removeTag(n);return this.injectScript()}injectScript(){const e=window;return new Promise((t,n)=>{try{const o=document.createElement("script");o.src=this.src,o.async=this.async,o.defer=this.defer,o.dataset.identifier=this.identifier,o.addEventListener("error",u=>n(new Error(`[ScriptLoader](injectScript) ${u.message}`))),o.addEventListener("load",u=>(this.script=u,e[this.identifier]=u,t(u))),document.head.append(o)}catch(o){throw new Error(`[ScriptLoader](init) ${o}`)}})}}function et(s){return[...s].map(e=>{const t=e.codePointAt(0);return t?t%32+127461:void 0}).filter(ze).map(e=>String.fromCodePoint(e)).join("")}const Y="__vue_click_away__",Ie=()=>document.ontouchstart===null?"touchstart":"click",Te=async(s,e)=>{ke(s);const t=e.instance,n=e.value,o=typeof n=="function";if(!o)throw new Error("[maz-ui](vClickOutside) the callback should be a function");await i.nextTick(),s[Y]=h=>{if((!s||!s.contains(h.target))&&n&&o)return n.call(t,h)};const u=Ie();document.addEventListener(u,s[Y],!1)},ke=s=>{const e=Ie();document.removeEventListener(e,s[Y],!1),delete s[Y]},tt=(s,e)=>{e.value!==e.oldValue&&Te(s,e)},le={mounted:Te,updated:tt,unmounted:ke},st={install:s=>{s.directive("click-outside",le)}},Ae=(s,e,t,n)=>{s.stopPropagation();const{handler:o,exclude:u}=t.value;let h=!1;if(u&&u.length>0)for(const l of u)h||(h=n.context.$refs[l].contains(s.target));!e.contains(s.target)&&!h&&n.context[o]()},Ce=()=>document.ontouchstart===null?"touchstart":"click",nt=(s,e,t)=>{const n=Ce();document.removeEventListener(n,o=>Ae(o,s,e,t))},it=(s,e,t)=>{const n=Ce();document.addEventListener(n,o=>Ae(o,s,e,t))},ce={mounted:it,unmounted:nt},ot={install:s=>{s.directive("closable",ce)}},rt=`
|
|
2
|
+
.maz-zoom-img {
|
|
3
|
+
position: fixed;
|
|
4
|
+
top: 0;
|
|
5
|
+
bottom: 0;
|
|
6
|
+
left: 0;
|
|
7
|
+
right: 0;
|
|
8
|
+
padding: 1rem;
|
|
9
|
+
z-index: 1050;
|
|
10
|
+
background-color: hsla(238, 15%, 40%, 0.7);
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
justify-content: center;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.maz-zoom-img,
|
|
18
|
+
.maz-zoom-img * {
|
|
19
|
+
box-sizing: border-box;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.maz-zoom-img .maz-zoom-img__wrapper {
|
|
23
|
+
position: relative;
|
|
24
|
+
display: flex;
|
|
25
|
+
justify-content: center;
|
|
26
|
+
align-items: center;
|
|
27
|
+
min-width: 0;
|
|
28
|
+
min-height: 0;
|
|
29
|
+
max-width: 100%;
|
|
30
|
+
max-height: 100%;
|
|
31
|
+
transition: all 300ms ease-in-out;
|
|
32
|
+
opacity: 0;
|
|
33
|
+
transform: scale(0.5);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.maz-zoom-img.maz-animate .maz-zoom-img__wrapper {
|
|
37
|
+
opacity: 1;
|
|
38
|
+
transform: scale(1);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.maz-zoom-img.maz-animate .maz-zoom-img__loader {
|
|
42
|
+
position: absolute;
|
|
43
|
+
top: 0;
|
|
44
|
+
bottom: 0;
|
|
45
|
+
left: 0;
|
|
46
|
+
right: 0;
|
|
47
|
+
display: flex;
|
|
48
|
+
align-items: center;
|
|
49
|
+
justify-content: center;
|
|
50
|
+
background-color: hsla(238, 15%, 40%, 0.7);
|
|
51
|
+
border-radius: 1rem;
|
|
52
|
+
z-index: 2;
|
|
53
|
+
min-width: 60px;
|
|
54
|
+
min-height: 60px;
|
|
55
|
+
}
|
|
56
|
+
.maz-zoom-img.maz-animate .maz-zoom-img__loader[hidden] {
|
|
57
|
+
display: none;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@-webkit-keyframes spin {
|
|
61
|
+
0% { transform: rotate(0deg); }
|
|
62
|
+
100% { transform: rotate(360deg); }
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
@keyframes spin {
|
|
66
|
+
0% { transform: rotate(0deg); }
|
|
67
|
+
100% { transform: rotate(360deg); }
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.maz-zoom-img.maz-animate .maz-zoom-img__loader__svg {
|
|
71
|
+
animation: spin .6s linear infinite;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.maz-zoom-img img {
|
|
75
|
+
max-width: 100%;
|
|
76
|
+
max-height: 100%;
|
|
77
|
+
min-width: 0;
|
|
78
|
+
border-radius: 1rem;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.maz-zoom-img .maz-zoom-btn {
|
|
82
|
+
margin: 0 auto;
|
|
83
|
+
border: none;
|
|
84
|
+
background-color: hsla(0, 0%, 7%, 0.5);
|
|
85
|
+
box-shadow: 0 0 0.5rem 0 hsla(0, 0%, 0%, 0.2);
|
|
86
|
+
height: 2.2rem;
|
|
87
|
+
min-height: 2.2rem;
|
|
88
|
+
width: 2.2rem;
|
|
89
|
+
min-width: 2.2rem;
|
|
90
|
+
display: flex;
|
|
91
|
+
align-items: center;
|
|
92
|
+
justify-content: center;
|
|
93
|
+
border-radius: 2.2rem;
|
|
94
|
+
cursor: pointer;
|
|
95
|
+
flex: 0 0 auto;
|
|
96
|
+
outline: none;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.maz-zoom-img .maz-zoom-btn svg {
|
|
100
|
+
fill: white;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.maz-zoom-img .maz-zoom-btn.maz-zoom-btn--close {
|
|
104
|
+
position: absolute;
|
|
105
|
+
top: 0.5rem;
|
|
106
|
+
right: 0.5rem;
|
|
107
|
+
z-index: 1;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.maz-zoom-img .maz-zoom-btn.maz-zoom-btn--previous {
|
|
111
|
+
position: absolute;
|
|
112
|
+
left: 0.5rem;
|
|
113
|
+
z-index: 1;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.maz-zoom-img .maz-zoom-btn.maz-zoom-btn--next {
|
|
117
|
+
position: absolute;
|
|
118
|
+
right: 0.5rem;
|
|
119
|
+
z-index: 1;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.maz-zoom-img .maz-zoom-btn:hover {
|
|
123
|
+
background-color: hsl(0, 0%, 0%);
|
|
124
|
+
}`,ve={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 at{constructor(e){c(this,"options");c(this,"loader");c(this,"wrapper");c(this,"img");c(this,"keydownHandler");c(this,"onImgLoadedCallback");c(this,"buttonsAdded");c(this,"defaultOptions",{scale:!0,blur:!0,disabled:!1});c(this,"mouseEnterListener");c(this,"mouseLeaveListener");c(this,"renderPreviewListener");if(!e.value)throw new Error('[MazUI](zoom-img) Image path must be defined. Ex: `v-zoom-img="<PATH_TO_IMAGE>"`');if(typeof e.value=="object"&&!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,...typeof e.value=="object"?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-zoom-src",this.options.src),this.options.alt&&e.setAttribute("data-zoom-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-zoom-src"),e.removeAttribute("data-zoom-alt"),e.style.cursor=""}renderPreview(e,t){e.classList.add("maz-is-open"),this.addStyle(rt);const n=document.createElement("div");n.classList.add("maz-zoom-img"),n.setAttribute("id","MazImgPreviewFullsize"),n.addEventListener("click",o=>{n.isEqualNode(o.target)&&this.closePreview()}),typeof t=="object"&&(this.img.setAttribute("src",t.src),t.alt&&this.img.setAttribute("alt",t.alt),this.img.id="MazImgElement"),this.wrapper.append(this.img),n.append(this.wrapper),document.body.append(n),this.keyboardEventHandler(!0),setTimeout(()=>{n&&n.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=[],n=this.allInstances.length>1;if(!this.buttonsAdded){if(this.buttonsAdded=!0,n){const o=this.getButton("previous"),u=this.getButton("next");t.push(o,u)}this.wrapper.append(e),n&&(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=ve.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(),(e.key==="Escape"||e.key===" ")&&this.closePreview(),(e.key==="ArrowLeft"||e.key==="ArrowRight")&&this.nextPreviousImage(e.key==="ArrowRight")}getButton(e="close"){const t=document.createElement("button");return t.innerHTML=ve[e],t.addEventListener("click",()=>{e==="close"?this.closePreview():this.allInstances&&this.nextPreviousImage(e==="next")}),t.classList.add("maz-zoom-btn"),t.classList.add(`maz-zoom-btn--${e}`),t}closePreview(){const e=document.querySelector("#MazImgPreviewFullsize"),t=document.querySelector("#MazPreviewStyle"),n=document.querySelector(".maz-zoom-img-instance.maz-is-open");n&&n.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,n=document.querySelector(".maz-zoom-img-instance.maz-is-open");if(n){const o=this.allInstances.indexOf(n),u=t?o+1:o-1,h=this.allInstances[this.getNewInstanceIndex(u)];h&&this.useNextInstance(n,h)}}useNextInstance(e,t){e.classList.remove("maz-is-open"),t.classList.add("maz-is-open");const n=t.getAttribute("data-zoom-src"),o=t.getAttribute("data-zoom-alt");this.wrapper.style.width="",this.loader.hidden=!1,n&&this.img.setAttribute("src",n),o&&this.img.setAttribute("alt",o)}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 j;const ue={created(s,e){j=new at(e),j.create(s)},updated(s,e){j.update(e)},unmounted(s){j.remove(s)}},lt={install(s){s.directive("zoom-img",ue)}},ct="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",re={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 xe{constructor(e={}){c(this,"observers",[]);c(this,"defaultOptions",re);c(this,"options");c(this,"onImgLoadedCallback");c(this,"onImgErrorCallback");c(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(()=>require("./no-photography-AVNubSve.cjs"));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,n;this.addClass(e,this.options.loadingClass),(n=(t=this.options).onLoading)==null||n.call(t,e)}imageHasNoPhoto(e){this.removeClass(e,this.options.loadingClass),this.addClass(e,this.options.noPhotoClass),this.setDefaultPhoto(e)}imageIsLoaded(e){var t,n;this.hasImgLoaded=!0,this.removeClass(e,this.options.loadingClass),this.addClass(e,this.options.loadedClass),(n=(t=this.options).onLoaded)==null||n.call(t,e)}imageHasError(e,t){var n,o;console.warn("[maz-ui][MazLazyImg] Error while loading image",t),this.removeClass(e,this.options.loadingClass),this.addClass(e,this.options.errorClass),(o=(n=this.options).onError)==null||o.call(n,e),this.setDefaultPhoto(e)}getImageUrl(e,t){const n=this.getImgElement(e).getAttribute("data-lazy-src");if(n)return n;t.value;const o=typeof t.value=="object"?t.value.src:t.value;return o||console.warn("[maz-ui][MazLazyImg] src url is not defined"),o}async setPictureSourceUrls(e){const t=e.querySelectorAll("source");if(t.length>0)for await(const n of t){const o=n.getAttribute("data-lazy-srcset");o?n.srcset=o:console.warn('[maz-ui][MazLazyImg] the "[data-lazy-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 e.arg==="bg-image"}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(),n=e.querySelectorAll("source");if(n.length>0)for await(const o of n)o.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",n=>this.onImgErrorCallback(e,n),{once:!0})}async loadImage(e,t){if(this.imageIsLoading(e),this.isPictureElement(e))this.addEventListenerToImg(e),await this.setPictureSourceUrls(e);else{const n=this.getImageUrl(e,t);if(!n)return this.imageHasError(e);this.hasBgImgMode(t)?(e.style.backgroundImage=`url('${n}')`,this.imageIsLoaded(e)):(this.addEventListenerToImg(e),this.setImgSrc(e,n))}}setImgSrc(e,t){const n=this.getImgElement(e);n.src=t}handleIntersectionObserver(e,t,n,o){var u,h;this.observers.push(o);for(const l of n)if(l.isIntersecting){if((h=(u=this.options).onIntersecting)==null||h.call(u,l.target),this.options.observerOnce&&o.unobserve(e),this.options.loadOnce&&this.hasImgLoaded)return;this.loadImage(e,t)}}createObserver(e,t){const n=(h,l)=>{this.handleIntersectionObserver(e,t,h,l)},o=this.options.observerOptions;new IntersectionObserver(n,o).observe(e)}async imageHandler(e,t,n){if(n==="update")for await(const o of this.observers)o.unobserve(e);window.IntersectionObserver?this.createObserver(e,t):this.loadImage(e,t)}async bindUpdateHandler(e,t,n){if(this.options.noPhoto)return this.imageHasNoPhoto(e);await this.imageHandler(e,t,n)}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,ct),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 n of this.observers)n.unobserve(e);this.observers=[]}}let W;const Se={created(s,e){const t=typeof e.value=="object"?e.value:{};W=new xe(t),W.add(s,e)},updated(s,e){W.update(s,e)},unmounted(s,e){W.remove(s,e)}},ut="lazy-img",mt={install(s,e={}){const t={...re,...e,observerOptions:{...re.observerOptions,...e.observerOptions}},n=new xe(t);s.directive(ut,{created:n.add.bind(n),updated:n.update.bind(n),unmounted:n.remove.bind(n)})}},dt=["onClick","onKeypress"],ht={class:"m-fullscreen-img-scroller"},ft=["src","alt"],vt=i.defineComponent({__name:"MazFullscreenImg",props:{destroy:{type:Function,default:void 0},src:{},alt:{default:void 0},openInstanceClass:{},zoom:{type:Boolean,default:!0},disabled:{type:Boolean},clickedElementBounds:{},clickedElement:{},animated:{type:Boolean,default:!0},scaleAnimation:{type:Boolean}},emits:["close","previous","next","before-close"],setup(s,{emit:e}){const t=e,n=i.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./MazSpinner-Yp72xl7m.cjs"))),o=i.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./x-mark-SZLMLvjQ.cjs"))),u=i.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./chevron-left-8yB0sLIf.cjs")));let h;i.onBeforeMount(async()=>{h=await import("vue-scrollto")});const l=s,f=i.ref(!1),g=i.ref(!1),p=i.ref(!1),v=i.ref(!1),y=i.ref(!1),w=i.ref(!1),E=i.ref(!1),k=i.ref(l.clickedElement instanceof HTMLImageElement),q=i.ref(l.src),x=i.ref(l.alt),S=i.ref(),m=i.ref(),L=i.computed(()=>k.value&&l.animated&&!l.scaleAnimation),P=i.computed(()=>(k.value||!l.animated)&&!l.scaleAnimation),O=i.ref(!1),X=i.computed(()=>w.value?`--is-zoomed maz-cursor-zoom-in maz-max-w-[none] ${O.value?"maz-h-screen maz-w-auto":"maz-h-auto maz-w-screen"}`:`cursor-zoom-out ${O.value?"maz-w-screen maz-h-screen --is-landscape":"maz-h-screen maz-w-auto"}`);function Z(){g.value=!0,p.value=!1,v.value=!0}function H(){t("before-close"),f.value=!1}function _(a){a.key==="Escape"&&(a.preventDefault(),H()),(a.key==="ArrowLeft"||a.key==="ArrowRight")&&(a.preventDefault(),A(a.key==="ArrowRight"))}function Q(){document.documentElement.classList.add("--m-fullscreen-open")}function G(){document.documentElement.classList.remove("--m-fullscreen-open")}function D(){return[...document.querySelectorAll(".m-fullscreen-img-instance")]}function U(a,r){return r<0?a.length-1:r>=a.length?0:r}async function J(a,r){a.classList.remove(l.openInstanceClass),r.classList.add(l.openInstanceClass);const d=r.getAttribute("data-src"),b=r.getAttribute("data-alt");x.value=b??void 0,d&&(q.value=d),g.value=!1,await $(300),g.value||(p.value=!0)}function A(a){const r=document.querySelector(`.m-fullscreen-img-instance.${l.openInstanceClass}`);if(r){const d=D(),b=d.indexOf(r),C=a?b+1:b-1,I=d[U(d,C)];I&&J(r,I),t(a?"next":"previous")}}async function ee(a){const r=a.target;r.style.width=`${r.clientWidth}px`,r.style.height=`${r.clientHeight}px`,await $(0),w.value=!w.value,r.style.removeProperty("width"),r.style.removeProperty("height"),await $(0);const d=r.clientWidth/a.clientY,C=window.innerWidth/d-window.innerHeight/2;h.scrollTo(r,200,{container:r.parentElement,easing:"linear",offset:w.value?C:0})}i.onMounted(async()=>{await i.nextTick(),document.addEventListener("keydown",_),f.value=!0,p.value=!0,Q(),y.value=D().length>1,m.value&&(O.value=l.clickedElementBounds.height<l.clickedElementBounds.width)});function F(){m.value&&(E.value=!0,m.value.style.removeProperty("margin-left"),m.value.style.removeProperty("margin-right"),m.value.style.opacity="0.5",m.value.style.width=`${l.clickedElementBounds.width}px`,m.value.style.height=`${l.clickedElementBounds.height}px`,m.value.style.top=`${l.clickedElementBounds.top}px`,m.value.style.left=`${l.clickedElementBounds.left}px`)}async function te(){if(await $(0),m.value){m.value.style.opacity="1",m.value.style.removeProperty("height"),m.value.style.removeProperty("width"),m.value.style.removeProperty("transform");const a=window.innerWidth,r=window.innerHeight,d=l.clickedElementBounds.height,b=l.clickedElementBounds.width;if(O.value){m.value.style.left="0px";const C=d*a/b,I=(r-C)/2;m.value.style.top=`${I<=0?0:I}px`}else{m.value.style.top="0px";const C=b*r/d,I=(a-C)/2;m.value.style.left=`${I<=0?0:I}px`}}}function V(){m.value&&(m.value.style.removeProperty("top"),m.value.style.removeProperty("left"),m.value.style.marginLeft="auto",m.value.style.marginRight="auto",m.value.style.removeProperty("opacity")),E.value=!1}function se(){if(m.value){const{left:a,top:r}=m.value.getBoundingClientRect();m.value.style.left=`${a}px`,m.value.style.top=`${r}px`,m.value.style.width=`${m.value.width}px`,m.value.style.height=`${m.value.height}px`,E.value=!0}}function ne(){var a,r;t("close"),(a=S.value)==null||a.remove(),(r=l.destroy)==null||r.call(l)}return i.onBeforeUnmount(()=>{document.removeEventListener("keydown",_),G()}),(a,r)=>(i.openBlock(),i.createElementBlock("div",{ref_key:"FullscreenImgElement",ref:S,role:"button",class:i.normalizeClass(["m-fullscreen-img",{"--animation-active":E.value}]),tabindex:"0",onClick:i.withModifiers(H,["self"]),onKeypress:i.withKeys(i.withModifiers(H,["prevent"]),["esc"])},[i.withDirectives(i.createVNode(i.unref(n),{class:"m-fullscreen-img-loader maz-h-16"},null,512),[[i.vShow,p.value]]),v.value&&y.value?(i.openBlock(),i.createElementBlock("button",{key:0,type:"button",class:"m-fullscreen-btn --next",onClick:r[0]||(r[0]=i.withModifiers(d=>A(!0),["stop"]))},[i.createVNode(i.unref(u),{class:"maz-rotate-90 maz-text-2xl"})])):i.createCommentVNode("v-if",!0),f.value&&v.value&&y.value?(i.openBlock(),i.createElementBlock("button",{key:1,type:"button",class:"m-fullscreen-btn --previous",onClick:r[1]||(r[1]=i.withModifiers(d=>A(!1),["stop"]))},[i.createVNode(i.unref(u),{class:"maz-text-2xl"})])):i.createCommentVNode("v-if",!0),i.createElementVNode("button",{type:"button",class:"m-fullscreen-btn --close",onClick:H},[i.createVNode(i.unref(o),{class:"maz-text-2xl"})]),i.createElementVNode("div",ht,[i.createVNode(i.Transition,{name:P.value?void 0:"maz-scale-fade",onBeforeEnter:r[3]||(r[3]=d=>L.value&&F()),onEnter:r[4]||(r[4]=d=>L.value&&te()),onAfterEnter:r[5]||(r[5]=d=>L.value&&V()),onBeforeLeave:r[6]||(r[6]=d=>L.value&&se()),onLeave:r[7]||(r[7]=d=>L.value&&F()),onAfterLeave:ne,persisted:""},{default:i.withCtx(()=>[i.withDirectives(i.createElementVNode("img",{id:"ZvImgElement",ref_key:"ImgElement",ref:m,src:q.value,alt:x.value,tabindex:"0",class:i.normalizeClass([{zoomable:a.zoom},X.value]),onLoad:Z,onClick:r[2]||(r[2]=d=>a.zoom?ee(d):void 0)},null,42,ft),[[i.vShow,f.value]])]),_:1},8,["name"])])],42,dt))}}),me=(s,e)=>{const t=s.__vccOpts||s;for(const[n,o]of e)t[n]=o;return t},gt=me(vt,[["__scopeId","data-v-d0c959c7"]]),ge="m-fullscreen-is-open";class pt{constructor(){c(this,"options");c(this,"defaultOptions",{scaleOnHover:!1,blurOnHover:!1,disabled:!1,animated:!0,zoom:!0,scaleAnimation:!1});c(this,"mouseEnterListener");c(this,"mouseLeaveListener");c(this,"renderPreviewListener")}buildOptions(e,t){const n=typeof t.value=="object"?t.value:{src:t.value,alt:void 0},o=(n==null?void 0:n.src)??this.getImgSrc(e),u=(n==null?void 0:n.alt)??this.getImgAlt(e);return{...this.defaultOptions,...n,src:o,alt:u}}get allInstances(){return[...document.querySelectorAll(".m-fullscreen-img-instance")]}getImgSrc(e){var n;const t=((n=this.options)==null?void 0:n.src)||e.getAttribute("src")||e.getAttribute("data-src");if(!t)throw new Error('[maz-ui](fullscreen-img) src of image must be provided by `v-fullscreen=""`, `v-fullscreen="{ src: "" }"`, `src=""` or `data-src=""` atributes');return t}getImgAlt(e){var t;return((t=this.options)==null?void 0:t.alt)||e.getAttribute("alt")||e.getAttribute("data-alt")}create(e,t){if(this.options=this.buildOptions(e,t),this.options.disabled)return;e.style.cursor="move",(this.options.scaleOnHover||this.options.blurOnHover)&&(e.style.transition="all 300ms ease-in-out"),e.classList.add("m-fullscreen-img-instance"),e.setAttribute("data-src",this.getImgSrc(e));const n=this.getImgAlt(e);n&&e.setAttribute("data-alt",n),this.mouseEnterListener=()=>this.mouseEnter(e),this.mouseLeaveListener=()=>this.mouseLeave(e),this.renderPreviewListener=()=>this.renderPreview(e),e.addEventListener("mouseenter",this.mouseEnterListener),e.addEventListener("mouseleave",this.mouseLeaveListener),e.addEventListener("click",this.renderPreviewListener)}update(e,t){this.options=this.buildOptions(e,t)}remove(e){e.removeEventListener("mouseenter",this.mouseEnterListener),e.removeEventListener("mouseleave",this.mouseLeaveListener),e.removeEventListener("click",this.renderPreviewListener),e.classList.remove("m-fullscreen-img-instance"),e.style.cursor=""}renderPreview(e){return e.classList.add(ge),ae(gt,{props:{...this.options,openInstanceClass:ge,clickedElement:e,clickedElementBounds:e.getBoundingClientRect()},addDestroyInProps:!0})}mouseLeave(e){this.options.scaleOnHover&&(e.style.transform=""),this.options.blurOnHover&&(e.style.filter=""),e.style.zIndex=""}mouseEnter(e){e.style.zIndex="1",this.options.scaleOnHover&&(e.style.transform="scale(1.05)"),this.options.blurOnHover&&(e.style.filter="blur(3px)")}}let R;const de={mounted(s,e){return R=new pt,R.create(s,e)},updated(s,e){return R.update(s,e)},unmounted(s){return R.remove(s)}},yt={install(s){s.directive("fullscreen-img",de)}},wt=[{name:"click-outside",directive:le},{name:"closable",directive:ce},{name:"zoom-img",directive:ue},{name:"lazy-img",directive:Se},{name:"fullscreen-img",directive:de}],bt={install(s){for(const{name:e,directive:t}of wt)s.directive(e,t)}},Pe=s=>s?(s=s.toString(),s.charAt(0).toUpperCase()+s.slice(1)):"",zt={style:"currency",minimumFractionDigits:2,round:!1},Et=(s,e,t)=>{let n=Number(s);return t.round&&(n=Math.floor(n),t.minimumFractionDigits=0),new Intl.NumberFormat(e,t).format(n)},Lt=(s,e,t)=>{if(s===void 0)throw new TypeError("[maz-ui](FilterCurrency) The `number` attribute is required.");if(e===void 0)throw new TypeError("[maz-ui](FilterCurrency) The `locale` attribute is required.");if(typeof e!="string")throw new TypeError("[maz-ui](FilterCurrency) The `locale` attribute must be a string.");if(t.currency===void 0)throw new TypeError("[maz-ui](FilterCurrency) The `options.currency` attribute is required.")},Oe=(s,e,t)=>{const n={...zt,...t};Lt(s,e,n);try{return Et(s,e,n)}catch(o){throw new Error(`[maz-ui](FilterCurrency) ${o}`)}},It={month:"short",day:"numeric",year:"numeric"},He=(s,e,t)=>{if(e===void 0)throw new TypeError("[maz-ui](FilterDate) The `locale` attribute is required.");if(typeof e!="string")throw new TypeError("[maz-ui](FilterDate) The `locale` attribute must be a string.");const n=t??It;try{const o=s instanceof Date?s:new Date(s);return new Intl.DateTimeFormat(e,n).format(o)}catch(o){throw new Error(`[maz-ui](FilterDate) ${o}`)}},Tt={minimumFractionDigits:2},$e=(s,e,t)=>{const n={...Tt,...t};if(s===void 0)throw new TypeError("[maz-ui](FilterNumber) The `number` attribute is required.");if(e===void 0)throw new TypeError("[maz-ui](FilterNumber) The `locale` attribute is required.");if(typeof e!="string")throw new TypeError("[maz-ui](FilterNumber) The `locale` attribute must be a string.");try{return new Intl.NumberFormat(e,n).format(Number(s))}catch(o){throw new Error(`[maz-ui](FilterNumber) ${o}`)}},kt={capitalize:Pe,currency:Oe,date:He,number:$e},At={install(s){s.provide("filters",kt)}},Be=({timeout:s,callback:e,remainingTimeUpdate:t=200})=>{const n=i.ref(s);let o;function u(){n.value=s,h()}function h(){o||(o=setInterval(()=>{n.value-=t,n.value<=0&&(g(),e==null||e())},t))}function l(){o&&(clearInterval(o),o=void 0)}function f(){!o&&n.value>0&&h()}function g(){n.value=s,l()}return{remainingTime:n,start:u,pause:l,resume:f,stop:g}},Ct={class:"m-toast__message-wrapper"},xt={class:"m-toast__message"},St={class:"maz-flex maz-items-center maz-gap-2"},Pt={key:0},Ot={class:"progress-bar maz-absolute maz-inset-x-0 maz-bottom-0 maz-h-1"},Ht=i.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"},message:{type:String,required:!0},link:{type:Object,default:void 0},action:{type:Object,default:void 0},persistent:{type:Boolean,default:!1}},emits:["close","click","open"],setup(s,{emit:e}){const t=i.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./MazBtn-BVge7L6B.cjs"))),n=i.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./x-mark-SZLMLvjQ.cjs"))),o=i.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./arrow-top-right-on-square-jZfbSH7Z.cjs"))),u=i.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./exclamation-triangle-Kk2Ygepb.cjs"))),h=i.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./exclamation-circle-kdNsgBlF.cjs"))),l=i.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./information-circle-x2Q9nLP2.cjs"))),f=i.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./check-circle-i22ikksA.cjs"))),g=i.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./link-3xy7UuBg.cjs"))),p=i.ref(),v=s,y=i.computed(()=>{switch(v.type){case"danger":return u;case"info":return l;case"success":return f;case"warning":return h;default:return}}),w=e,E=i.computed(()=>v.position.includes("top")?"top":"bottom"),k=i.computed(()=>v.position.includes("left")?"left":v.position.includes("right")?"right":"center"),q=i.computed(()=>k.value!=="center"?k.value==="right"?"m-slide-right":"m-slide-left":E.value==="top"?"m-slide-top":"m-slide-bottom"),x=i.ref(!1),S=i.ref(!1),m=i.ref(),L=`m-toast-container --${E.value} --${k.value}`,P=`.${L.replaceAll(" ",".")}`,{start:O,stop:X,pause:Z,resume:H,remainingTime:_}=Be({callback:V,timeout:v.timeout});function Q(){const a=document.querySelector(P);if(!a&&!a){const r=document.body,d=document.createElement("div");d.className=L,r.append(d)}}function G(){const a=document.querySelector(P);return!v.queue&&v.maxToasts===!1?!1:typeof v.maxToasts=="number"&&a?v.maxToasts<=a.childElementCount:a&&a.childElementCount>0}function D(){if(G()){m.value=setTimeout(D,250);return}const a=document.querySelector(P);p.value&&a&&a.prepend(p.value),S.value=!0,O()}const U=i.ref("100%");function J(){switch(v.type){case"danger":return"maz-bg-danger-700";case"info":return"maz-bg-info-700";case"success":return"maz-bg-success-700";case"warning":return"maz-bg-warning-700";default:return"maz-bg-secondary"}}i.watch(()=>_.value,a=>{if(typeof a=="number"){const r=100*a/v.timeout;U.value=`${r}%`,a<=0&&V()}});function A(a){w("click",a),v.persistent||V()}async function ee(a,r){var d;x.value=!0,await a(),x.value=!1,(d=v.action)!=null&&d.closeToast&&A(r)}function F(a){v.noPauseOnHover||(a?Z():H())}function te(){X(),m.value&&clearTimeout(m.value)}function V(){te(),S.value=!1}function se(){w("open")}function ne(){var r;w("close"),(r=p.value)==null||r.remove();const a=document.querySelector(P);a&&!(a!=null&&a.hasChildNodes())&&a.remove()}return i.onMounted(()=>{Q(),D()}),(a,r)=>(i.openBlock(),i.createBlock(i.Transition,{name:q.value,onAfterLeave:ne,onAfterEnter:se,persisted:""},{default:i.withCtx(()=>[i.withDirectives(i.createElementVNode("button",{ref_key:"Toaster",ref:p,class:i.normalizeClass(["m-toast",[`--${s.type}`,`--${E.value}`,`--${k.value}`,{"maz-pb-1":s.timeout}]]),role:"alert",onMouseover:r[2]||(r[2]=d=>F(!0)),onMouseleave:r[3]||(r[3]=d=>F(!1)),onClick:r[4]||(r[4]=i.withModifiers(d=>{var b;return s.link&&!((b=s.link)!=null&&b.closeToast)?void 0:A(d)},["stop"]))},[y.value?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(y.value),{key:0,class:"maz-text-2xl"})):i.createCommentVNode("v-if",!0),i.createElementVNode("div",Ct,[i.createElementVNode("p",xt,i.toDisplayString(s.message),1)]),s.action?(i.openBlock(),i.createBlock(i.unref(t),{key:1,"data-test":"action-btn",color:s.type,pastel:"",loading:x.value,size:"sm",onClick:r[0]||(r[0]=i.withModifiers(d=>ee(s.action.func,d),["stop"]))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(s.action.text),1)]),_:1},8,["color","loading"])):i.createCommentVNode("v-if",!0),s.link?(i.openBlock(),i.createBlock(i.unref(t),{key:2,"data-test":"link-btn",color:s.type,pastel:"",size:"xs",href:s.link.href,target:s.link.target??"_self"},{default:i.withCtx(()=>{var d;return[i.createElementVNode("div",St,[s.link.text?(i.openBlock(),i.createElementBlock("span",Pt,i.toDisplayString(s.link.text),1)):i.createCommentVNode("v-if",!0),((d=s.link)==null?void 0:d.target)=="_blank"?(i.openBlock(),i.createBlock(i.unref(o),{key:1,class:"maz-text-xl"})):(i.openBlock(),i.createBlock(i.unref(g),{key:2,class:"maz-text-xl"}))])]}),_:1},8,["color","href","target"])):i.createCommentVNode("v-if",!0),s.persistent?i.createCommentVNode("v-if",!0):(i.openBlock(),i.createElementBlock("button",{key:3,class:"--close",onClick:r[1]||(r[1]=i.withModifiers(d=>A(d),["stop"]))},[i.createVNode(i.unref(n),{class:"--icon maz-text-xl"})])),i.createElementVNode("div",Ot,[i.createElementVNode("div",{style:i.normalizeStyle({width:U.value}),class:i.normalizeClass(["maz-h-full maz-transition-all maz-duration-200 maz-ease-linear",J()])},null,6)])],34),[[i.vShow,S.value]])]),_:1},8,["name"]))}}),$t=me(Ht,[["__scopeId","data-v-ee210f61"]]),Bt={position:"bottom-right",timeout:1e4,persistent:!1};class Ne{constructor(e,t){this.app=e,this.globalOptions=t}show(e,t){const n={message:e,...t},o={...Bt,...n,...this.globalOptions,...t};ae($t,{props:o,app:this.app})}getLocalOptions(e,t){return{type:e,...t}}message(e,t){return this.show(e,this.getLocalOptions("theme",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))}}exports.toastInstance=void 0;const Nt={install(s,e){exports.toastInstance=new Ne(s,e),s.provide("toast",exports.toastInstance)}},B="",Mt=s=>s.filter((e,t,n)=>t===n.indexOf(e)),Dt=s=>(e=B)=>typeof e=="function"?s.findIndex((...t)=>e(...t))>-1:s.includes(e),Ft=s=>s.length>0,Vt=s=>(e=B)=>Mt([...s,e]),qt=s=>(e=B)=>s.filter(t=>t!==e);class Me{constructor(){c(this,"_loaders",i.ref([]))}get loaders(){return i.computed(()=>this._loaders.value)}stop(e=B){this._loaders.value=qt(this._loaders.value)(e)}start(e=B){return this._loaders.value=Vt(this._loaders.value)(e),()=>this.stop(e)}get anyLoading(){return i.computed(()=>Ft(this._loaders.value))}isLoading(e=B){return i.computed(()=>Dt(this._loaders.value)(e)).value}}const De=new Me,_t={install:s=>{s.provide("wait",De)}},oe={delay:100,observer:{root:void 0,rootMargin:"0px",threshold:.2},animation:{once:!0,duration:300,delay:0}};class Fe{constructor(e){c(this,"options");this.options={delay:(e==null?void 0:e.delay)??oe.delay,observer:{...oe.observer,...e==null?void 0:e.observer},animation:{...oe.animation,...e==null?void 0:e.animation}}}handleIntersect(e,t){for(const n of e){const u=n.target.getAttribute("data-maz-aos-children")==="true",h=n.target.getAttribute("data-maz-aos")?[n.target]:[];if(u){const l=[...document.querySelectorAll("[data-maz-aos-anchor]")].map(f=>f.getAttribute("data-maz-aos-anchor")===`#${n.target.id}`?f:void 0);for(const f of l)f&&h.push(f)}for(const l of h){const f=l.getAttribute("data-maz-aos-once"),g=typeof f=="string"?f==="true":this.options.animation.once;if(typeof this.options.observer.threshold=="number"&&n.intersectionRatio>this.options.observer.threshold){const p=l.getAttribute("data-maz-aos-duration"),v=l.getAttribute("data-maz-aos-delay");if(p||(l.style.transitionDuration=`${this.options.animation.duration}ms`,setTimeout(()=>{l.style.transitionDuration="0"},1e3)),v||(l.style.transitionDelay=`${this.options.animation.delay}ms`,setTimeout(()=>{l.style.transitionDelay="0"},1e3)),l.classList.add("maz-aos-animate"),g){const y=l.getAttribute("data-maz-aos-anchor");if(y){const w=document.querySelector(y);w&&t.unobserve(w)}t.unobserve(l)}}else l.classList.remove("maz-aos-animate")}}}async handleObserver(){await $(this.options.delay);const e=new IntersectionObserver(this.handleIntersect.bind(this),{...this.options.observer});for(const t of document.querySelectorAll("[data-maz-aos]")){const n=t.getAttribute("data-maz-aos-anchor");if(n){const o=document.querySelector(n);o?(o.setAttribute("data-maz-aos-children","true"),e.observe(o)):console.warn(`[maz-ui](aos) no element found with selector "${n}"`)}else e.observe(t)}}runAnimations(){if(z())return this.handleObserver();console.warn("[MazAos](runAnimations) should be executed on client side")}}exports.instance$1=void 0;const Ut={install:(s,e)=>{exports.instance$1=new Fe(e),s.provide("aos",exports.instance$1),z()&&(e!=null&&e.router?e.router.afterEach(async()=>{exports.instance$1.runAnimations()}):exports.instance$1.runAnimations())}},pe={darkClass:"dark",lightClass:"light",storageThemeKey:"theme",storageThemeValueDark:"dark",storageThemeValueLight:"light",storageThemeValueSystem:"system"},M=i.ref("system"),T=i.ref("system");function he({darkClass:s,lightClass:e,storageThemeKey:t,storageThemeValueDark:n,setLocalStorageValue:o=!0,setSelectedTheme:u=!0}){document.documentElement.classList.remove(e),document.documentElement.classList.add(s),M.value=n,u&&(T.value=n),o&&(localStorage[t]=n)}function fe({darkClass:s,lightClass:e,storageThemeKey:t,storageThemeValueLight:n,setLocalStorageValue:o=!0,setSelectedTheme:u=!0}){document.documentElement.classList.remove(s),document.documentElement.classList.add(e),M.value=n,u&&(T.value=n),o&&(localStorage[t]=n)}function Ve(s){document.documentElement.classList.remove(s.darkClass),document.documentElement.classList.remove(s.lightClass),M.value=s.storageThemeValueSystem,T.value=s.storageThemeValueSystem,s.setLocalStorageValue&&(localStorage[s.storageThemeKey]=s.storageThemeValueSystem),qe({...s,setSelectedTheme:!1})}function ye(){return window.matchMedia("(prefers-color-scheme: dark)").matches}function qe(s){localStorage[s.storageThemeKey]===s.storageThemeValueDark||!(s.storageThemeKey in localStorage)&&ye()||localStorage[s.storageThemeKey]===s.storageThemeValueSystem&&ye()?he({...s,setLocalStorageValue:!1,setSelectedTheme:!1}):fe({...s,setLocalStorageValue:!1,setSelectedTheme:!1})}function we({shouldSetDarkMode:s,...e}){return typeof s!="boolean"?Ve(e):s?he(e):fe(e)}function jt(s){return M.value===s.storageThemeValueDark?fe(s):he(s)}function Wt(s=pe){const e={...pe,...s},t=i.computed(()=>T.value===e.storageThemeValueDark),n=i.computed(()=>T.value===e.storageThemeValueLight),o=i.computed(()=>T.value===e.storageThemeValueSystem);return i.onMounted(()=>{localStorage[e.storageThemeKey]&&(M.value=localStorage[e.storageThemeKey],T.value=localStorage[e.storageThemeKey])}),{autoSetTheme:()=>qe(e),toggleTheme:()=>jt(e),setSystemTheme:()=>Ve({...e,setLocalStorageValue:!0}),setDarkTheme:()=>we({...e,shouldSetDarkMode:!0}),setLightTheme:()=>we({...e,shouldSetDarkMode:!1}),hasDarkTheme:t,hasLightTheme:n,hasSystemTheme:o,theme:M,selectedTheme:T}}const Rt=({componentName:s,instance:e,providedId:t})=>i.computed(()=>t??`${s}-${e==null?void 0:e.uid}`),Yt=()=>K("aos"),Kt=()=>K("wait"),Xt=()=>K("toast"),Zt=({callback:s,options:e})=>new Ee(s,e),Qt=({callback:s,options:e})=>new Le(s,e),Gt=i.ref(),N=i.ref([]),Jt=(s,e)=>new Promise((t,n)=>{N.value=[...N.value,{id:s,isActive:!0,resolve:async()=>{await(e==null?void 0:e()),t(!0)},reject:n}]}),_e=s=>(N.value=N.value.filter(({id:e})=>e!==s),N.value),be=(s,e,t=!1)=>{var n;e&&((n=e[s])==null||n.call(e,t),e.isActive=!1,setTimeout(()=>{_e(e.id)},500))},es=()=>({confirmDialogData:Gt,dialogState:N,showDialogAndWaitChoice:Jt,removeDialogFromState:_e,rejectDialog:(s,e=!1)=>be("reject",s,e),resolveDialog:(s,e=!1)=>be("resolve",s,e)});function Ue(s={}){const{internalWindow:e=z()?window:void 0,initialWidth:t=Number.POSITIVE_INFINITY,initialHeight:n=Number.POSITIVE_INFINITY,includeScrollbar:o=!0}=s,u=i.ref(t),h=i.ref(n),l=()=>{e&&(o?(u.value=e.innerWidth,h.value=e.innerHeight):(u.value=e.document.documentElement.clientWidth,h.value=e.document.documentElement.clientHeight))};return l(),e&&window.addEventListener("resize",l,{passive:!0}),{width:u,height:h}}function ts(s){const e={};for(const[t,n]of Object.entries(s))e[t]=Number.parseInt(n,10);return e}function ss({initialWidth:s=0,initialHeight:e,includeScrollbar:t,internalWindow:n,listenOrientation:o,breakpoints:u,mediumBreakPoint:h="md",largeBreakPoint:l="lg"}){const{width:f}=Ue({initialWidth:s,initialHeight:e,includeScrollbar:t,internalWindow:n,listenOrientation:o}),g=ts(u),p=i.computed(()=>f.value>=g[l]),v=i.computed(()=>f.value>=g[h]&&f.value<g[l]),y=i.computed(()=>f.value>=0&&f.value<g[h]);return{width:f,numericBreakpoints:g,isSmallScreen:y,isLargeScreen:p,isMediumScreen:v,breakpoints:u}}exports.AosHandler=Fe;exports.IdleTimeout=Ee;exports.ScriptLoader=Je;exports.ToasterHandler=Ne;exports.UserVisibility=Le;exports.WaitHandler=Me;exports._export_sfc=me;exports.capitalize=Pe;exports.countryCodeToUnicodeFlag=et;exports.currency=Oe;exports.date=He;exports.debounce=Ge;exports.directive=le;exports.directive$1=ce;exports.injectStrict=K;exports.installDirectives=bt;exports.installFilters=At;exports.installToaster=Nt;exports.instance=De;exports.isClient=z;exports.mount=ae;exports.number=$e;exports.plugin=st;exports.plugin$1=mt;exports.plugin$2=lt;exports.plugin$3=ot;exports.plugin$4=_t;exports.plugin$5=Ut;exports.sleep=$;exports.truthyFilter=ze;exports.useAos=Yt;exports.useBreakpoints=ss;exports.useIdleTimeout=Zt;exports.useInstanceUniqId=Rt;exports.useMazDialogPromise=es;exports.useThemeHandler=Wt;exports.useTimer=Be;exports.useToast=Xt;exports.useUserVisibility=Qt;exports.useWait=Kt;exports.useWindowSize=Ue;exports.vFullscreenImg=de;exports.vFullscreenImgInstall=yt;exports.vLazyImg=Se;exports.vZoomImg=ue;
|