var W_=Object.defineProperty;var q_=(i,t,e)=>t in i?W_(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var pt=(i,t,e)=>q_(i,typeof t!="symbol"?t+"":t,e);class nm{constructor(t={}){this.state=t}setState(t){Object.entries(t).forEach(([e,n])=>{this.state[e]=n})}getState(){return this.state}}const G_="data-module",Z_=i=>{const t=i;return t!=null&&t.name&&(t!=null&&t.args)?Array.isArray(t==null?void 0:t.args):!1};class Ys{constructor(t){return this.moduleName=t,this.modules=[],this}add(t){return this.modules.push(t),this}remove(t){return this.modules=this.modules.filter(e=>e.name!==t),this}isCurrentModule(){return!!document.querySelector(`[${G_}=${this.moduleName}]`)}run(t,...e){if(this.isCurrentModule())if(typeof t=="string"){const n=this.modules.find(s=>s.name===t);n&&n.handler(...e)}else this.modules.forEach(n=>{var r;let s=[];Z_(t)&&(s=(r=t==null?void 0:t.find(a=>a.name===n.name))==null?void 0:r.args),n.handler(s||[])});return this}}const Y_="data-component-id",K_={id:Y_};class Kt{constructor(t,e={componentName:"",initialState:{}}){return this.element=t,this.events=[],this.abortController=new AbortController,this.componentName=e.componentName,this.store=new nm(e.initialState),this}static findComponentById(t,e){const n=e.components;return n==null?void 0:n.find(s=>{var r;return t===((r=s.getElement())==null?void 0:r.getAttribute(K_.id))})}on(t,e){this.events.push({eventName:t,handler:e}),this.element.addEventListener(t,e,{signal:this.abortController.signal})}off(t){const e=this.events.find(n=>n.eventName===t);e&&this.element.removeEventListener(t,e.handler)}trigger(t,e={}){const n=new CustomEvent(t,{detail:e});this.element.dispatchEvent(n)}getElement(){return this.element}getComponentByNode(t,e){var n;return(n=t.getState().components)==null?void 0:n.find(s=>s.getElement().isSameNode(e))}getOffset(){const t=this.element.getBoundingClientRect();return{left:t.left+window.scrollX,top:t.top+window.scrollY}}destroy(){this.abortController.abort()}reInit(){console.log("reInit not implemented")}setState(t){this.store.setState({...this.store,...t})}getState(){return this.store.getState()}}function pd(i){return i!==null&&typeof i=="object"&&"constructor"in i&&i.constructor===Object}function Ru(i,t){i===void 0&&(i={}),t===void 0&&(t={}),Object.keys(t).forEach(e=>{typeof i[e]>"u"?i[e]=t[e]:pd(t[e])&&pd(i[e])&&Object.keys(t[e]).length>0&&Ru(i[e],t[e])})}const sm={body:{},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector(){return null},querySelectorAll(){return[]},getElementById(){return null},createEvent(){return{initEvent(){}}},createElement(){return{children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName(){return[]}}},createElementNS(){return{}},importNode(){return null},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function ms(){const i=typeof document<"u"?document:{};return Ru(i,sm),i}const X_={document:sm,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState(){},pushState(){},go(){},back(){}},CustomEvent:function(){return this},addEventListener(){},removeEventListener(){},getComputedStyle(){return{getPropertyValue(){return""}}},Image(){},Date(){},screen:{},setTimeout(){},clearTimeout(){},matchMedia(){return{}},requestAnimationFrame(i){return typeof setTimeout>"u"?(i(),null):setTimeout(i,0)},cancelAnimationFrame(i){typeof setTimeout>"u"||clearTimeout(i)}};function ci(){const i=typeof window<"u"?window:{};return Ru(i,X_),i}function J_(i){const t=i;Object.keys(t).forEach(e=>{try{t[e]=null}catch{}try{delete t[e]}catch{}})}function $c(i,t){return t===void 0&&(t=0),setTimeout(i,t)}function Aa(){return Date.now()}function Q_(i){const t=ci();let e;return t.getComputedStyle&&(e=t.getComputedStyle(i,null)),!e&&i.currentStyle&&(e=i.currentStyle),e||(e=i.style),e}function ty(i,t){t===void 0&&(t="x");const e=ci();let n,s,r;const a=Q_(i);return e.WebKitCSSMatrix?(s=a.transform||a.webkitTransform,s.split(",").length>6&&(s=s.split(", ").map(l=>l.replace(",",".")).join(", ")),r=new e.WebKitCSSMatrix(s==="none"?"":s)):(r=a.MozTransform||a.OTransform||a.MsTransform||a.msTransform||a.transform||a.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,"),n=r.toString().split(",")),t==="x"&&(e.WebKitCSSMatrix?s=r.m41:n.length===16?s=parseFloat(n[12]):s=parseFloat(n[4])),t==="y"&&(e.WebKitCSSMatrix?s=r.m42:n.length===16?s=parseFloat(n[13]):s=parseFloat(n[5])),s||0}function Vo(i){return typeof i=="object"&&i!==null&&i.constructor&&Object.prototype.toString.call(i).slice(8,-1)==="Object"}function ey(i){return typeof window<"u"&&typeof window.HTMLElement<"u"?i instanceof HTMLElement:i&&(i.nodeType===1||i.nodeType===11)}function si(){const i=Object(arguments.length<=0?void 0:arguments[0]),t=["__proto__","constructor","prototype"];for(let e=1;et.indexOf(r)<0);for(let r=0,a=s.length;rr?"next":"prev",d=(g,v)=>c==="next"&&g>=v||c==="prev"&&g<=v,p=()=>{l=new Date().getTime(),a===null&&(a=l);const g=Math.max(Math.min((l-a)/h,1),0),v=.5-Math.cos(g*Math.PI)/2;let b=r+v*(e-r);if(d(b,e)&&(b=e),t.wrapperEl.scrollTo({[n]:b}),d(b,e)){t.wrapperEl.style.overflow="hidden",t.wrapperEl.style.scrollSnapType="",setTimeout(()=>{t.wrapperEl.style.overflow="",t.wrapperEl.scrollTo({[n]:b})}),s.cancelAnimationFrame(t.cssModeFrameID);return}t.cssModeFrameID=s.requestAnimationFrame(p)};p()}function zi(i,t){return t===void 0&&(t=""),[...i.children].filter(e=>e.matches(t))}function om(i,t){t===void 0&&(t=[]);const e=document.createElement(i);return e.classList.add(...Array.isArray(t)?t:[t]),e}function iy(i,t){const e=[];for(;i.previousElementSibling;){const n=i.previousElementSibling;t?n.matches(t)&&e.push(n):e.push(n),i=n}return e}function ny(i,t){const e=[];for(;i.nextElementSibling;){const n=i.nextElementSibling;t?n.matches(t)&&e.push(n):e.push(n),i=n}return e}function kn(i,t){return ci().getComputedStyle(i,null).getPropertyValue(t)}function Da(i){let t=i,e;if(t){for(e=0;(t=t.previousSibling)!==null;)t.nodeType===1&&(e+=1);return e}}function am(i,t){const e=[];let n=i.parentElement;for(;n;)t?n.matches(t)&&e.push(n):e.push(n),n=n.parentElement;return e}function Hc(i,t,e){const n=ci();return i[t==="width"?"offsetWidth":"offsetHeight"]+parseFloat(n.getComputedStyle(i,null).getPropertyValue(t==="width"?"margin-right":"margin-top"))+parseFloat(n.getComputedStyle(i,null).getPropertyValue(t==="width"?"margin-left":"margin-bottom"))}let Ul;function sy(){const i=ci(),t=ms();return{smoothScroll:t.documentElement&&t.documentElement.style&&"scrollBehavior"in t.documentElement.style,touch:!!("ontouchstart"in i||i.DocumentTouch&&t instanceof i.DocumentTouch)}}function lm(){return Ul||(Ul=sy()),Ul}let Wl;function ry(i){let{userAgent:t}=i===void 0?{}:i;const e=lm(),n=ci(),s=n.navigator.platform,r=t||n.navigator.userAgent,a={ios:!1,android:!1},l=n.screen.width,h=n.screen.height,c=r.match(/(Android);?[\s\/]+([\d.]+)?/);let d=r.match(/(iPad).*OS\s([\d_]+)/);const p=r.match(/(iPod)(.*OS\s([\d_]+))?/),g=!d&&r.match(/(iPhone\sOS|iOS)\s([\d_]+)/),v=s==="Win32";let b=s==="MacIntel";const _=["1024x1366","1366x1024","834x1194","1194x834","834x1112","1112x834","768x1024","1024x768","820x1180","1180x820","810x1080","1080x810"];return!d&&b&&e.touch&&_.indexOf(`${l}x${h}`)>=0&&(d=r.match(/(Version)\/([\d.]+)/),d||(d=[0,1,"13_0_0"]),b=!1),c&&!v&&(a.os="android",a.android=!0),(d||g||p)&&(a.os="ios",a.ios=!0),a}function oy(i){return i===void 0&&(i={}),Wl||(Wl=ry(i)),Wl}let ql;function ay(){const i=ci();let t=!1;function e(){const n=i.navigator.userAgent.toLowerCase();return n.indexOf("safari")>=0&&n.indexOf("chrome")<0&&n.indexOf("android")<0}if(e()){const n=String(i.navigator.userAgent);if(n.includes("Version/")){const[s,r]=n.split("Version/")[1].split(" ")[0].split(".").map(a=>Number(a));t=s<16||s===16&&r<2}}return{isSafari:t||e(),needPerspectiveFix:t,isWebView:/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(i.navigator.userAgent)}}function ly(){return ql||(ql=ay()),ql}function cy(i){let{swiper:t,on:e,emit:n}=i;const s=ci();let r=null,a=null;const l=()=>{!t||t.destroyed||!t.initialized||(n("beforeResize"),n("resize"))},h=()=>{!t||t.destroyed||!t.initialized||(r=new ResizeObserver(p=>{a=s.requestAnimationFrame(()=>{const{width:g,height:v}=t;let b=g,_=v;p.forEach(w=>{let{contentBoxSize:T,contentRect:S,target:C}=w;C&&C!==t.el||(b=S?S.width:(T[0]||T).inlineSize,_=S?S.height:(T[0]||T).blockSize)}),(b!==g||_!==v)&&l()})}),r.observe(t.el))},c=()=>{a&&s.cancelAnimationFrame(a),r&&r.unobserve&&t.el&&(r.unobserve(t.el),r=null)},d=()=>{!t||t.destroyed||!t.initialized||n("orientationchange")};e("init",()=>{if(t.params.resizeObserver&&typeof s.ResizeObserver<"u"){h();return}s.addEventListener("resize",l),s.addEventListener("orientationchange",d)}),e("destroy",()=>{c(),s.removeEventListener("resize",l),s.removeEventListener("orientationchange",d)})}function uy(i){let{swiper:t,extendParams:e,on:n,emit:s}=i;const r=[],a=ci(),l=function(d,p){p===void 0&&(p={});const g=a.MutationObserver||a.WebkitMutationObserver,v=new g(b=>{if(t.__preventObserver__)return;if(b.length===1){s("observerUpdate",b[0]);return}const _=function(){s("observerUpdate",b[0])};a.requestAnimationFrame?a.requestAnimationFrame(_):a.setTimeout(_,0)});v.observe(d,{attributes:typeof p.attributes>"u"?!0:p.attributes,childList:typeof p.childList>"u"?!0:p.childList,characterData:typeof p.characterData>"u"?!0:p.characterData}),r.push(v)},h=()=>{if(t.params.observer){if(t.params.observeParents){const d=am(t.el);for(let p=0;p{r.forEach(d=>{d.disconnect()}),r.splice(0,r.length)};e({observer:!1,observeParents:!1,observeSlideChildren:!1}),n("init",h),n("destroy",c)}var hy={on(i,t,e){const n=this;if(!n.eventsListeners||n.destroyed||typeof t!="function")return n;const s=e?"unshift":"push";return i.split(" ").forEach(r=>{n.eventsListeners[r]||(n.eventsListeners[r]=[]),n.eventsListeners[r][s](t)}),n},once(i,t,e){const n=this;if(!n.eventsListeners||n.destroyed||typeof t!="function")return n;function s(){n.off(i,s),s.__emitterProxy&&delete s.__emitterProxy;for(var r=arguments.length,a=new Array(r),l=0;l=0&&t.eventsAnyListeners.splice(e,1),t},off(i,t){const e=this;return!e.eventsListeners||e.destroyed||!e.eventsListeners||i.split(" ").forEach(n=>{typeof t>"u"?e.eventsListeners[n]=[]:e.eventsListeners[n]&&e.eventsListeners[n].forEach((s,r)=>{(s===t||s.__emitterProxy&&s.__emitterProxy===t)&&e.eventsListeners[n].splice(r,1)})}),e},emit(){const i=this;if(!i.eventsListeners||i.destroyed||!i.eventsListeners)return i;let t,e,n;for(var s=arguments.length,r=new Array(s),a=0;a{i.eventsAnyListeners&&i.eventsAnyListeners.length&&i.eventsAnyListeners.forEach(c=>{c.apply(n,[h,...e])}),i.eventsListeners&&i.eventsListeners[h]&&i.eventsListeners[h].forEach(c=>{c.apply(n,e)})}),i}};function dy(){const i=this;let t,e;const n=i.el;typeof i.params.width<"u"&&i.params.width!==null?t=i.params.width:t=n.clientWidth,typeof i.params.height<"u"&&i.params.height!==null?e=i.params.height:e=n.clientHeight,!(t===0&&i.isHorizontal()||e===0&&i.isVertical())&&(t=t-parseInt(kn(n,"padding-left")||0,10)-parseInt(kn(n,"padding-right")||0,10),e=e-parseInt(kn(n,"padding-top")||0,10)-parseInt(kn(n,"padding-bottom")||0,10),Number.isNaN(t)&&(t=0),Number.isNaN(e)&&(e=0),Object.assign(i,{width:t,height:e,size:i.isHorizontal()?t:e}))}function fy(){const i=this;function t(z){return i.isHorizontal()?z:{width:"height","margin-top":"margin-left","margin-bottom ":"margin-right","margin-left":"margin-top","margin-right":"margin-bottom","padding-left":"padding-top","padding-right":"padding-bottom",marginRight:"marginBottom"}[z]}function e(z,tt){return parseFloat(z.getPropertyValue(t(tt))||0)}const n=i.params,{wrapperEl:s,slidesEl:r,size:a,rtlTranslate:l,wrongRTL:h}=i,c=i.virtual&&n.virtual.enabled,d=c?i.virtual.slides.length:i.slides.length,p=zi(r,`.${i.params.slideClass}, swiper-slide`),g=c?i.virtual.slides.length:p.length;let v=[];const b=[],_=[];let w=n.slidesOffsetBefore;typeof w=="function"&&(w=n.slidesOffsetBefore.call(i));let T=n.slidesOffsetAfter;typeof T=="function"&&(T=n.slidesOffsetAfter.call(i));const S=i.snapGrid.length,C=i.slidesGrid.length;let x=n.spaceBetween,D=-w,V=0,$=0;if(typeof a>"u")return;typeof x=="string"&&x.indexOf("%")>=0?x=parseFloat(x.replace("%",""))/100*a:typeof x=="string"&&(x=parseFloat(x)),i.virtualSize=-x,p.forEach(z=>{l?z.style.marginLeft="":z.style.marginRight="",z.style.marginBottom="",z.style.marginTop=""}),n.centeredSlides&&n.cssMode&&(No(s,"--swiper-centered-offset-before",""),No(s,"--swiper-centered-offset-after",""));const K=n.grid&&n.grid.rows>1&&i.grid;K&&i.grid.initSlides(g);let q;const rt=n.slidesPerView==="auto"&&n.breakpoints&&Object.keys(n.breakpoints).filter(z=>typeof n.breakpoints[z].slidesPerView<"u").length>0;for(let z=0;z1&&v.push(i.virtualSize-a)}if(c&&n.loop){const z=_[0]+x;if(n.slidesPerGroup>1){const tt=Math.ceil((i.virtual.slidesBefore+i.virtual.slidesAfter)/n.slidesPerGroup),ot=z*n.slidesPerGroup;for(let it=0;it!n.cssMode||n.loop?!0:ot!==p.length-1).forEach(tt=>{tt.style[z]=`${x}px`})}if(n.centeredSlides&&n.centeredSlidesBounds){let z=0;_.forEach(ot=>{z+=ot+(x||0)}),z-=x;const tt=z-a;v=v.map(ot=>ot<=0?-w:ot>tt?tt+T:ot)}if(n.centerInsufficientSlides){let z=0;if(_.forEach(tt=>{z+=tt+(x||0)}),z-=x,z{v[it]=ot-tt}),b.forEach((ot,it)=>{b[it]=ot+tt})}}if(Object.assign(i,{slides:p,snapGrid:v,slidesGrid:b,slidesSizesGrid:_}),n.centeredSlides&&n.cssMode&&!n.centeredSlidesBounds){No(s,"--swiper-centered-offset-before",`${-v[0]}px`),No(s,"--swiper-centered-offset-after",`${i.size/2-_[_.length-1]/2}px`);const z=-i.snapGrid[0],tt=-i.slidesGrid[0];i.snapGrid=i.snapGrid.map(ot=>ot+z),i.slidesGrid=i.slidesGrid.map(ot=>ot+tt)}if(g!==d&&i.emit("slidesLengthChange"),v.length!==S&&(i.params.watchOverflow&&i.checkOverflow(),i.emit("snapGridLengthChange")),b.length!==C&&i.emit("slidesGridLengthChange"),n.watchSlidesProgress&&i.updateSlidesOffset(),!c&&!n.cssMode&&(n.effect==="slide"||n.effect==="fade")){const z=`${n.containerModifierClass}backface-hidden`,tt=i.el.classList.contains(z);g<=n.maxBackfaceHiddenSlides?tt||i.el.classList.add(z):tt&&i.el.classList.remove(z)}}function py(i){const t=this,e=[],n=t.virtual&&t.params.virtual.enabled;let s=0,r;typeof i=="number"?t.setTransition(i):i===!0&&t.setTransition(t.params.speed);const a=l=>n?t.slides[t.getSlideIndexByData(l)]:t.slides[l];if(t.params.slidesPerView!=="auto"&&t.params.slidesPerView>1)if(t.params.centeredSlides)(t.visibleSlides||[]).forEach(l=>{e.push(l)});else for(r=0;rt.slides.length&&!n)break;e.push(a(l))}else e.push(a(t.activeIndex));for(r=0;rs?l:s}(s||s===0)&&(t.wrapperEl.style.height=`${s}px`)}function my(){const i=this,t=i.slides,e=i.isElement?i.isHorizontal()?i.wrapperEl.offsetLeft:i.wrapperEl.offsetTop:0;for(let n=0;n"u"&&t.updateSlidesOffset();let a=-i;s&&(a=i),n.forEach(h=>{h.classList.remove(e.slideVisibleClass)}),t.visibleSlidesIndexes=[],t.visibleSlides=[];let l=e.spaceBetween;typeof l=="string"&&l.indexOf("%")>=0?l=parseFloat(l.replace("%",""))/100*t.size:typeof l=="string"&&(l=parseFloat(l));for(let h=0;h=0&&v1&&b<=t.size||v<=0&&b>=t.size)&&(t.visibleSlides.push(c),t.visibleSlidesIndexes.push(h),n[h].classList.add(e.slideVisibleClass)),c.progress=s?-p:p,c.originalProgress=s?-g:g}}function vy(i){const t=this;if(typeof i>"u"){const d=t.rtlTranslate?-1:1;i=t&&t.translate&&t.translate*d||0}const e=t.params,n=t.maxTranslate()-t.minTranslate();let{progress:s,isBeginning:r,isEnd:a,progressLoop:l}=t;const h=r,c=a;if(n===0)s=0,r=!0,a=!0;else{s=(i-t.minTranslate())/n;const d=Math.abs(i-t.minTranslate())<1,p=Math.abs(i-t.maxTranslate())<1;r=d||s<=0,a=p||s>=1,d&&(s=0),p&&(s=1)}if(e.loop){const d=t.getSlideIndexByData(0),p=t.getSlideIndexByData(t.slides.length-1),g=t.slidesGrid[d],v=t.slidesGrid[p],b=t.slidesGrid[t.slidesGrid.length-1],_=Math.abs(i);_>=g?l=(_-g)/b:l=(_+b-v)/b,l>1&&(l-=1)}Object.assign(t,{progress:s,progressLoop:l,isBeginning:r,isEnd:a}),(e.watchSlidesProgress||e.centeredSlides&&e.autoHeight)&&t.updateSlidesProgress(i),r&&!h&&t.emit("reachBeginning toEdge"),a&&!c&&t.emit("reachEnd toEdge"),(h&&!r||c&&!a)&&t.emit("fromEdge"),t.emit("progress",s)}function _y(){const i=this,{slides:t,params:e,slidesEl:n,activeIndex:s}=i,r=i.virtual&&e.virtual.enabled,a=h=>zi(n,`.${e.slideClass}${h}, swiper-slide${h}`)[0];t.forEach(h=>{h.classList.remove(e.slideActiveClass,e.slideNextClass,e.slidePrevClass)});let l;if(r)if(e.loop){let h=s-i.virtual.slidesBefore;h<0&&(h=i.virtual.slides.length+h),h>=i.virtual.slides.length&&(h-=i.virtual.slides.length),l=a(`[data-swiper-slide-index="${h}"]`)}else l=a(`[data-swiper-slide-index="${s}"]`);else l=t[s];if(l){l.classList.add(e.slideActiveClass);let h=ny(l,`.${e.slideClass}, swiper-slide`)[0];e.loop&&!h&&(h=t[0]),h&&h.classList.add(e.slideNextClass);let c=iy(l,`.${e.slideClass}, swiper-slide`)[0];e.loop&&!c===0&&(c=t[t.length-1]),c&&c.classList.add(e.slidePrevClass)}i.emitSlidesClasses()}const fa=(i,t)=>{if(!i||i.destroyed||!i.params)return;const e=()=>i.isElement?"swiper-slide":`.${i.params.slideClass}`,n=t.closest(e());if(n){const s=n.querySelector(`.${i.params.lazyPreloaderClass}`);s&&s.remove()}},Gl=(i,t)=>{if(!i.slides[t])return;const e=i.slides[t].querySelector('[loading="lazy"]');e&&e.removeAttribute("loading")},jc=i=>{if(!i||i.destroyed||!i.params)return;let t=i.params.lazyPreloadPrevNext;const e=i.slides.length;if(!e||!t||t<0)return;t=Math.min(t,e);const n=i.params.slidesPerView==="auto"?i.slidesPerViewDynamic():Math.ceil(i.params.slidesPerView),s=i.activeIndex;if(i.params.grid&&i.params.grid.rows>1){const a=s,l=[a-t];l.push(...Array.from({length:t}).map((h,c)=>a+n+c)),i.slides.forEach((h,c)=>{l.includes(h.column)&&Gl(i,c)});return}const r=s+n-1;if(i.params.rewind||i.params.loop)for(let a=s-t;a<=r+t;a+=1){const l=(a%e+e)%e;(lr)&&Gl(i,l)}else for(let a=Math.max(s-t,0);a<=Math.min(r+t,e-1);a+=1)a!==s&&(a>r||a=t[r]&&n=t[r]&&n=t[r]&&(s=r);return e.normalizeSlideIndex&&(s<0||typeof s>"u")&&(s=0),s}function by(i){const t=this,e=t.rtlTranslate?t.translate:-t.translate,{snapGrid:n,params:s,activeIndex:r,realIndex:a,snapIndex:l}=t;let h=i,c;const d=g=>{let v=g-t.virtual.slidesBefore;return v<0&&(v=t.virtual.slides.length+v),v>=t.virtual.slides.length&&(v-=t.virtual.slides.length),v};if(typeof h>"u"&&(h=yy(t)),n.indexOf(e)>=0)c=n.indexOf(e);else{const g=Math.min(s.slidesPerGroupSkip,h);c=g+Math.floor((h-g)/s.slidesPerGroup)}if(c>=n.length&&(c=n.length-1),h===r){c!==l&&(t.snapIndex=c,t.emit("snapIndexChange")),t.params.loop&&t.virtual&&t.params.virtual.enabled&&(t.realIndex=d(h));return}let p;t.virtual&&s.virtual.enabled&&s.loop?p=d(h):t.slides[h]?p=parseInt(t.slides[h].getAttribute("data-swiper-slide-index")||h,10):p=h,Object.assign(t,{previousSnapIndex:l,snapIndex:c,previousRealIndex:a,realIndex:p,previousIndex:r,activeIndex:h}),t.initialized&&jc(t),t.emit("activeIndexChange"),t.emit("snapIndexChange"),a!==p&&t.emit("realIndexChange"),(t.initialized||t.params.runCallbacksOnInit)&&t.emit("slideChange")}function wy(i){const t=this,e=t.params,n=i.closest(`.${e.slideClass}, swiper-slide`);let s=!1,r;if(n){for(let a=0;ah?d=h:n&&ia?l="next":r=h.length&&(w=h.length-1);const T=-h[w];if(l.normalizeSlideIndex)for(let C=0;C=D&&x=D&&x=D&&(a=C)}if(r.initialized&&a!==p&&(!r.allowSlideNext&&(g?T>r.translate&&T>r.minTranslate():Tr.translate&&T>r.maxTranslate()&&(p||0)!==a))return!1;a!==(d||0)&&e&&r.emit("beforeSlideChangeStart"),r.updateProgress(T);let S;if(a>p?S="next":a0?(r._cssModeVirtualInitialSet=!0,requestAnimationFrame(()=>{v[C?"scrollLeft":"scrollTop"]=x})):v[C?"scrollLeft":"scrollTop"]=x,D&&requestAnimationFrame(()=>{r.wrapperEl.style.scrollSnapType="",r._immediateVirtual=!1})}else{if(!r.support.smoothScroll)return rm({swiper:r,targetPosition:x,side:C?"left":"top"}),!0;v.scrollTo({[C?"left":"top"]:x,behavior:"smooth"})}return!0}return r.setTransition(t),r.setTranslate(T),r.updateActiveIndex(a),r.updateSlidesClasses(),r.emit("beforeTransitionStart",t,n),r.transitionStart(e,S),t===0?r.transitionEnd(e,S):r.animating||(r.animating=!0,r.onSlideToWrapperTransitionEnd||(r.onSlideToWrapperTransitionEnd=function(x){!r||r.destroyed||x.target===this&&(r.wrapperEl.removeEventListener("transitionend",r.onSlideToWrapperTransitionEnd),r.onSlideToWrapperTransitionEnd=null,delete r.onSlideToWrapperTransitionEnd,r.transitionEnd(e,S))}),r.wrapperEl.addEventListener("transitionend",r.onSlideToWrapperTransitionEnd)),!0}function Iy(i,t,e,n){i===void 0&&(i=0),t===void 0&&(t=this.params.speed),e===void 0&&(e=!0),typeof i=="string"&&(i=parseInt(i,10));const s=this;let r=i;return s.params.loop&&(s.virtual&&s.params.virtual.enabled?r=r+s.virtual.slidesBefore:r=s.getSlideIndexByData(r)),s.slideTo(r,t,e,n)}function Fy(i,t,e){i===void 0&&(i=this.params.speed),t===void 0&&(t=!0);const n=this,{enabled:s,params:r,animating:a}=n;if(!s)return n;let l=r.slidesPerGroup;r.slidesPerView==="auto"&&r.slidesPerGroup===1&&r.slidesPerGroupAuto&&(l=Math.max(n.slidesPerViewDynamic("current",!0),1));const h=n.activeIndexg(T));let _=r[b.indexOf(v)-1];if(typeof _>"u"&&s.cssMode){let T;r.forEach((S,C)=>{v>=S&&(T=C)}),typeof T<"u"&&(_=r[T>0?T-1:T])}let w=0;if(typeof _<"u"&&(w=a.indexOf(_),w<0&&(w=n.activeIndex-1),s.slidesPerView==="auto"&&s.slidesPerGroup===1&&s.slidesPerGroupAuto&&(w=w-n.slidesPerViewDynamic("previous",!0)+1,w=Math.max(w,0))),s.rewind&&n.isBeginning){const T=n.params.virtual&&n.params.virtual.enabled&&n.virtual?n.virtual.slides.length-1:n.slides.length-1;return n.slideTo(T,i,t,e)}return n.slideTo(w,i,t,e)}function By(i,t,e){i===void 0&&(i=this.params.speed),t===void 0&&(t=!0);const n=this;return n.slideTo(n.activeIndex,i,t,e)}function Vy(i,t,e,n){i===void 0&&(i=this.params.speed),t===void 0&&(t=!0),n===void 0&&(n=.5);const s=this;let r=s.activeIndex;const a=Math.min(s.params.slidesPerGroupSkip,r),l=a+Math.floor((r-a)/s.params.slidesPerGroup),h=s.rtlTranslate?s.translate:-s.translate;if(h>=s.snapGrid[l]){const c=s.snapGrid[l],d=s.snapGrid[l+1];h-c>(d-c)*n&&(r+=s.params.slidesPerGroup)}else{const c=s.snapGrid[l-1],d=s.snapGrid[l];h-c<=(d-c)*n&&(r-=s.params.slidesPerGroup)}return r=Math.max(r,0),r=Math.min(r,s.slidesGrid.length-1),s.slideTo(r,i,t,e)}function Ny(){const i=this,{params:t,slidesEl:e}=i,n=t.slidesPerView==="auto"?i.slidesPerViewDynamic():t.slidesPerView;let s=i.clickedIndex,r;const a=i.isElement?"swiper-slide":`.${t.slideClass}`;if(t.loop){if(i.animating)return;r=parseInt(i.clickedSlide.getAttribute("data-swiper-slide-index"),10),t.centeredSlides?si.slides.length-i.loopedSlides+n/2?(i.loopFix(),s=i.getSlideIndex(zi(e,`${a}[data-swiper-slide-index="${r}"]`)[0]),$c(()=>{i.slideTo(s)})):i.slideTo(s):s>i.slides.length-n?(i.loopFix(),s=i.getSlideIndex(zi(e,`${a}[data-swiper-slide-index="${r}"]`)[0]),$c(()=>{i.slideTo(s)})):i.slideTo(s)}else i.slideTo(s)}var zy={slideTo:Oy,slideToLoop:Iy,slideNext:Fy,slidePrev:Ry,slideReset:By,slideToClosest:Vy,slideToClickedSlide:Ny};function $y(i){const t=this,{params:e,slidesEl:n}=t;if(!e.loop||t.virtual&&t.params.virtual.enabled)return;zi(n,`.${e.slideClass}, swiper-slide`).forEach((r,a)=>{r.setAttribute("data-swiper-slide-index",a)}),t.loopFix({slideRealIndex:i,direction:e.centeredSlides?void 0:"next"})}function Hy(i){let{slideRealIndex:t,slideTo:e=!0,direction:n,setTranslate:s,activeSlideIndex:r,byController:a,byMousewheel:l}=i===void 0?{}:i;const h=this;if(!h.params.loop)return;h.emit("beforeLoopFix");const{slides:c,allowSlidePrev:d,allowSlideNext:p,slidesEl:g,params:v}=h;if(h.allowSlidePrev=!0,h.allowSlideNext=!0,h.virtual&&v.virtual.enabled){e&&(!v.centeredSlides&&h.snapIndex===0?h.slideTo(h.virtual.slides.length,0,!1,!0):v.centeredSlides&&h.snapIndex"u"?r=h.getSlideIndex(h.slides.filter($=>$.classList.contains(v.slideActiveClass))[0]):S=r;const C=n==="next"||!n,x=n==="prev"||!n;let D=0,V=0;if(r<_){D=Math.max(_-r,v.slidesPerGroup);for(let $=0;$<_-r;$+=1){const K=$-Math.floor($/c.length)*c.length;w.push(c.length-K-1)}}else if(r>h.slides.length-_*2){V=Math.max(r-(h.slides.length-_*2),v.slidesPerGroup);for(let $=0;${h.slides[$].swiperLoopMoveDOM=!0,g.prepend(h.slides[$]),h.slides[$].swiperLoopMoveDOM=!1}),C&&T.forEach($=>{h.slides[$].swiperLoopMoveDOM=!0,g.append(h.slides[$]),h.slides[$].swiperLoopMoveDOM=!1}),h.recalcSlides(),v.slidesPerView==="auto"&&h.updateSlides(),v.watchSlidesProgress&&h.updateSlidesOffset(),e){if(w.length>0&&x)if(typeof t>"u"){const $=h.slidesGrid[S],q=h.slidesGrid[S+D]-$;l?h.setTranslate(h.translate-q):(h.slideTo(S+D,0,!1,!0),s&&(h.touches[h.isHorizontal()?"startX":"startY"]+=q))}else s&&h.slideToLoop(t,0,!1,!0);else if(T.length>0&&C)if(typeof t>"u"){const $=h.slidesGrid[S],q=h.slidesGrid[S-V]-$;l?h.setTranslate(h.translate-q):(h.slideTo(S-V,0,!1,!0),s&&(h.touches[h.isHorizontal()?"startX":"startY"]+=q))}else h.slideToLoop(t,0,!1,!0)}if(h.allowSlidePrev=d,h.allowSlideNext=p,h.controller&&h.controller.control&&!a){const $={slideRealIndex:t,slideTo:!1,direction:n,setTranslate:s,activeSlideIndex:r,byController:!0};Array.isArray(h.controller.control)?h.controller.control.forEach(K=>{!K.destroyed&&K.params.loop&&K.loopFix($)}):h.controller.control instanceof h.constructor&&h.controller.control.params.loop&&h.controller.control.loopFix($)}h.emit("loopFix")}function jy(){const i=this,{params:t,slidesEl:e}=i;if(!t.loop||i.virtual&&i.params.virtual.enabled)return;i.recalcSlides();const n=[];i.slides.forEach(s=>{const r=typeof s.swiperSlideIndex>"u"?s.getAttribute("data-swiper-slide-index")*1:s.swiperSlideIndex;n[r]=s}),i.slides.forEach(s=>{s.removeAttribute("data-swiper-slide-index")}),n.forEach(s=>{e.append(s)}),i.recalcSlides(),i.slideTo(i.realIndex,0)}var Uy={loopCreate:$y,loopFix:Hy,loopDestroy:jy};function Wy(i){const t=this;if(!t.params.simulateTouch||t.params.watchOverflow&&t.isLocked||t.params.cssMode)return;const e=t.params.touchEventsTarget==="container"?t.el:t.wrapperEl;t.isElement&&(t.__preventObserver__=!0),e.style.cursor="move",e.style.cursor=i?"grabbing":"grab",t.isElement&&requestAnimationFrame(()=>{t.__preventObserver__=!1})}function qy(){const i=this;i.params.watchOverflow&&i.isLocked||i.params.cssMode||(i.isElement&&(i.__preventObserver__=!0),i[i.params.touchEventsTarget==="container"?"el":"wrapperEl"].style.cursor="",i.isElement&&requestAnimationFrame(()=>{i.__preventObserver__=!1}))}var Gy={setGrabCursor:Wy,unsetGrabCursor:qy};function Zy(i,t){t===void 0&&(t=this);function e(n){if(!n||n===ms()||n===ci())return null;n.assignedSlot&&(n=n.assignedSlot);const s=n.closest(i);return!s&&!n.getRootNode?null:s||e(n.getRootNode().host)}return e(t)}function Yy(i){const t=this,e=ms(),n=ci(),s=t.touchEventsData;s.evCache.push(i);const{params:r,touches:a,enabled:l}=t;if(!l||!r.simulateTouch&&i.pointerType==="mouse"||t.animating&&r.preventInteractionOnTransition)return;!t.animating&&r.cssMode&&r.loop&&t.loopFix();let h=i;h.originalEvent&&(h=h.originalEvent);let c=h.target;if(r.touchEventsTarget==="wrapper"&&!t.wrapperEl.contains(c)||"which"in h&&h.which===3||"button"in h&&h.button>0||s.isTouched&&s.isMoved)return;const d=!!r.noSwipingClass&&r.noSwipingClass!=="",p=i.composedPath?i.composedPath():i.path;d&&h.target&&h.target.shadowRoot&&p&&(c=p[0]);const g=r.noSwipingSelector?r.noSwipingSelector:`.${r.noSwipingClass}`,v=!!(h.target&&h.target.shadowRoot);if(r.noSwiping&&(v?Zy(g,c):c.closest(g))){t.allowClick=!0;return}if(r.swipeHandler&&!c.closest(r.swipeHandler))return;a.currentX=h.pageX,a.currentY=h.pageY;const b=a.currentX,_=a.currentY,w=r.edgeSwipeDetection||r.iOSEdgeSwipeDetection,T=r.edgeSwipeThreshold||r.iOSEdgeSwipeThreshold;if(w&&(b<=T||b>=n.innerWidth-T))if(w==="prevent")i.preventDefault();else return;Object.assign(s,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),a.startX=b,a.startY=_,s.touchStartTime=Aa(),t.allowClick=!0,t.updateSize(),t.swipeDirection=void 0,r.threshold>0&&(s.allowThresholdMove=!1);let S=!0;c.matches(s.focusableElements)&&(S=!1,c.nodeName==="SELECT"&&(s.isTouched=!1)),e.activeElement&&e.activeElement.matches(s.focusableElements)&&e.activeElement!==c&&e.activeElement.blur();const C=S&&t.allowTouchMove&&r.touchStartPreventDefault;(r.touchStartForcePreventDefault||C)&&!c.isContentEditable&&h.preventDefault(),r.freeMode&&r.freeMode.enabled&&t.freeMode&&t.animating&&!r.cssMode&&t.freeMode.onTouchStart(),t.emit("touchStart",h)}function Ky(i){const t=ms(),e=this,n=e.touchEventsData,{params:s,touches:r,rtlTranslate:a,enabled:l}=e;if(!l||!s.simulateTouch&&i.pointerType==="mouse")return;let h=i;if(h.originalEvent&&(h=h.originalEvent),!n.isTouched){n.startMoving&&n.isScrolling&&e.emit("touchMoveOpposite",h);return}const c=n.evCache.findIndex(V=>V.pointerId===h.pointerId);c>=0&&(n.evCache[c]=h);const d=n.evCache.length>1?n.evCache[0]:h,p=d.pageX,g=d.pageY;if(h.preventedByNestedSwiper){r.startX=p,r.startY=g;return}if(!e.allowTouchMove){h.target.matches(n.focusableElements)||(e.allowClick=!1),n.isTouched&&(Object.assign(r,{startX:p,startY:g,prevX:e.touches.currentX,prevY:e.touches.currentY,currentX:p,currentY:g}),n.touchStartTime=Aa());return}if(s.touchReleaseOnEdges&&!s.loop){if(e.isVertical()){if(gr.startY&&e.translate>=e.minTranslate()){n.isTouched=!1,n.isMoved=!1;return}}else if(pr.startX&&e.translate>=e.minTranslate())return}if(t.activeElement&&h.target===t.activeElement&&h.target.matches(n.focusableElements)){n.isMoved=!0,e.allowClick=!1;return}if(n.allowTouchCallbacks&&e.emit("touchMove",h),h.targetTouches&&h.targetTouches.length>1)return;r.currentX=p,r.currentY=g;const v=r.currentX-r.startX,b=r.currentY-r.startY;if(e.params.threshold&&Math.sqrt(v**2+b**2)"u"){let V;e.isHorizontal()&&r.currentY===r.startY||e.isVertical()&&r.currentX===r.startX?n.isScrolling=!1:v*v+b*b>=25&&(V=Math.atan2(Math.abs(b),Math.abs(v))*180/Math.PI,n.isScrolling=e.isHorizontal()?V>s.touchAngle:90-V>s.touchAngle)}if(n.isScrolling&&e.emit("touchMoveOpposite",h),typeof n.startMoving>"u"&&(r.currentX!==r.startX||r.currentY!==r.startY)&&(n.startMoving=!0),n.isScrolling||e.zoom&&e.params.zoom&&e.params.zoom.enabled&&n.evCache.length>1){n.isTouched=!1;return}if(!n.startMoving)return;e.allowClick=!1,!s.cssMode&&h.cancelable&&h.preventDefault(),s.touchMoveStopPropagation&&!s.nested&&h.stopPropagation();let _=e.isHorizontal()?v:b,w=e.isHorizontal()?r.currentX-r.previousX:r.currentY-r.previousY;s.oneWayMovement&&(_=Math.abs(_)*(a?1:-1),w=Math.abs(w)*(a?1:-1)),r.diff=_,_*=s.touchRatio,a&&(_=-_,w=-w);const T=e.touchesDirection;e.swipeDirection=_>0?"prev":"next",e.touchesDirection=w>0?"prev":"next";const S=e.params.loop&&!s.cssMode;if(!n.isMoved){if(S&&e.loopFix({direction:e.swipeDirection}),n.startTranslate=e.getTranslate(),e.setTransition(0),e.animating){const V=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0});e.wrapperEl.dispatchEvent(V)}n.allowMomentumBounce=!1,s.grabCursor&&(e.allowSlideNext===!0||e.allowSlidePrev===!0)&&e.setGrabCursor(!0),e.emit("sliderFirstMove",h)}let C;n.isMoved&&T!==e.touchesDirection&&S&&Math.abs(_)>=1&&(e.loopFix({direction:e.swipeDirection,setTranslate:!0}),C=!0),e.emit("sliderMove",h),n.isMoved=!0,n.currentTranslate=_+n.startTranslate;let x=!0,D=s.resistanceRatio;if(s.touchReleaseOnEdges&&(D=0),_>0?(S&&!C&&n.currentTranslate>(s.centeredSlides?e.minTranslate()-e.size/2:e.minTranslate())&&e.loopFix({direction:"prev",setTranslate:!0,activeSlideIndex:0}),n.currentTranslate>e.minTranslate()&&(x=!1,s.resistance&&(n.currentTranslate=e.minTranslate()-1+(-e.minTranslate()+n.startTranslate+_)**D))):_<0&&(S&&!C&&n.currentTranslate<(s.centeredSlides?e.maxTranslate()+e.size/2:e.maxTranslate())&&e.loopFix({direction:"next",setTranslate:!0,activeSlideIndex:e.slides.length-(s.slidesPerView==="auto"?e.slidesPerViewDynamic():Math.ceil(parseFloat(s.slidesPerView,10)))}),n.currentTranslaten.startTranslate&&(n.currentTranslate=n.startTranslate),!e.allowSlidePrev&&!e.allowSlideNext&&(n.currentTranslate=n.startTranslate),s.threshold>0)if(Math.abs(_)>s.threshold||n.allowThresholdMove){if(!n.allowThresholdMove){n.allowThresholdMove=!0,r.startX=r.currentX,r.startY=r.currentY,n.currentTranslate=n.startTranslate,r.diff=e.isHorizontal()?r.currentX-r.startX:r.currentY-r.startY;return}}else{n.currentTranslate=n.startTranslate;return}!s.followFinger||s.cssMode||((s.freeMode&&s.freeMode.enabled&&e.freeMode||s.watchSlidesProgress)&&(e.updateActiveIndex(),e.updateSlidesClasses()),s.freeMode&&s.freeMode.enabled&&e.freeMode&&e.freeMode.onTouchMove(),e.updateProgress(n.currentTranslate),e.setTranslate(n.currentTranslate))}function Xy(i){const t=this,e=t.touchEventsData,n=e.evCache.findIndex(C=>C.pointerId===i.pointerId);if(n>=0&&e.evCache.splice(n,1),["pointercancel","pointerout","pointerleave"].includes(i.type)&&!(i.type==="pointercancel"&&(t.browser.isSafari||t.browser.isWebView)))return;const{params:s,touches:r,rtlTranslate:a,slidesGrid:l,enabled:h}=t;if(!h||!s.simulateTouch&&i.pointerType==="mouse")return;let c=i;if(c.originalEvent&&(c=c.originalEvent),e.allowTouchCallbacks&&t.emit("touchEnd",c),e.allowTouchCallbacks=!1,!e.isTouched){e.isMoved&&s.grabCursor&&t.setGrabCursor(!1),e.isMoved=!1,e.startMoving=!1;return}s.grabCursor&&e.isMoved&&e.isTouched&&(t.allowSlideNext===!0||t.allowSlidePrev===!0)&&t.setGrabCursor(!1);const d=Aa(),p=d-e.touchStartTime;if(t.allowClick){const C=c.path||c.composedPath&&c.composedPath();t.updateClickedSlide(C&&C[0]||c.target),t.emit("tap click",c),p<300&&d-e.lastClickTime<300&&t.emit("doubleTap doubleClick",c)}if(e.lastClickTime=Aa(),$c(()=>{t.destroyed||(t.allowClick=!0)}),!e.isTouched||!e.isMoved||!t.swipeDirection||r.diff===0||e.currentTranslate===e.startTranslate){e.isTouched=!1,e.isMoved=!1,e.startMoving=!1;return}e.isTouched=!1,e.isMoved=!1,e.startMoving=!1;let g;if(s.followFinger?g=a?t.translate:-t.translate:g=-e.currentTranslate,s.cssMode)return;if(s.freeMode&&s.freeMode.enabled){t.freeMode.onTouchEnd({currentPos:g});return}let v=0,b=t.slidesSizesGrid[0];for(let C=0;C=l[C]&&g=l[C]&&(v=C,b=l[l.length-1]-l[l.length-2])}let _=null,w=null;s.rewind&&(t.isBeginning?w=s.virtual&&s.virtual.enabled&&t.virtual?t.virtual.slides.length-1:t.slides.length-1:t.isEnd&&(_=0));const T=(g-l[v])/b,S=vs.longSwipesMs){if(!s.longSwipes){t.slideTo(t.activeIndex);return}t.swipeDirection==="next"&&(T>=s.longSwipesRatio?t.slideTo(s.rewind&&t.isEnd?_:v+S):t.slideTo(v)),t.swipeDirection==="prev"&&(T>1-s.longSwipesRatio?t.slideTo(v+S):w!==null&&T<0&&Math.abs(T)>s.longSwipesRatio?t.slideTo(w):t.slideTo(v))}else{if(!s.shortSwipes){t.slideTo(t.activeIndex);return}t.navigation&&(c.target===t.navigation.nextEl||c.target===t.navigation.prevEl)?c.target===t.navigation.nextEl?t.slideTo(v+S):t.slideTo(v):(t.swipeDirection==="next"&&t.slideTo(_!==null?_:v+S),t.swipeDirection==="prev"&&t.slideTo(w!==null?w:v))}}function md(){const i=this,{params:t,el:e}=i;if(e&&e.offsetWidth===0)return;t.breakpoints&&i.setBreakpoint();const{allowSlideNext:n,allowSlidePrev:s,snapGrid:r}=i,a=i.virtual&&i.params.virtual.enabled;i.allowSlideNext=!0,i.allowSlidePrev=!0,i.updateSize(),i.updateSlides(),i.updateSlidesClasses();const l=a&&t.loop;(t.slidesPerView==="auto"||t.slidesPerView>1)&&i.isEnd&&!i.isBeginning&&!i.params.centeredSlides&&!l?i.slideTo(i.slides.length-1,0,!1,!0):i.params.loop&&!a?i.slideToLoop(i.realIndex,0,!1,!0):i.slideTo(i.activeIndex,0,!1,!0),i.autoplay&&i.autoplay.running&&i.autoplay.paused&&(clearTimeout(i.autoplay.resizeTimeout),i.autoplay.resizeTimeout=setTimeout(()=>{i.autoplay&&i.autoplay.running&&i.autoplay.paused&&i.autoplay.resume()},500)),i.allowSlidePrev=s,i.allowSlideNext=n,i.params.watchOverflow&&r!==i.snapGrid&&i.checkOverflow()}function Jy(i){const t=this;t.enabled&&(t.allowClick||(t.params.preventClicks&&i.preventDefault(),t.params.preventClicksPropagation&&t.animating&&(i.stopPropagation(),i.stopImmediatePropagation())))}function Qy(){const i=this,{wrapperEl:t,rtlTranslate:e,enabled:n}=i;if(!n)return;i.previousTranslate=i.translate,i.isHorizontal()?i.translate=-t.scrollLeft:i.translate=-t.scrollTop,i.translate===0&&(i.translate=0),i.updateActiveIndex(),i.updateSlidesClasses();let s;const r=i.maxTranslate()-i.minTranslate();r===0?s=0:s=(i.translate-i.minTranslate())/r,s!==i.progress&&i.updateProgress(e?-i.translate:i.translate),i.emit("setTranslate",i.translate,!1)}function tb(i){const t=this;fa(t,i.target),!(t.params.cssMode||t.params.slidesPerView!=="auto"&&!t.params.autoHeight)&&t.update()}let gd=!1;function eb(){}const um=(i,t)=>{const e=ms(),{params:n,el:s,wrapperEl:r,device:a}=i,l=!!n.nested,h=t==="on"?"addEventListener":"removeEventListener",c=t;s[h]("pointerdown",i.onTouchStart,{passive:!1}),e[h]("pointermove",i.onTouchMove,{passive:!1,capture:l}),e[h]("pointerup",i.onTouchEnd,{passive:!0}),e[h]("pointercancel",i.onTouchEnd,{passive:!0}),e[h]("pointerout",i.onTouchEnd,{passive:!0}),e[h]("pointerleave",i.onTouchEnd,{passive:!0}),(n.preventClicks||n.preventClicksPropagation)&&s[h]("click",i.onClick,!0),n.cssMode&&r[h]("scroll",i.onScroll),n.updateOnWindowResize?i[c](a.ios||a.android?"resize orientationchange observerUpdate":"resize observerUpdate",md,!0):i[c]("observerUpdate",md,!0),s[h]("load",i.onLoad,{capture:!0})};function ib(){const i=this,t=ms(),{params:e}=i;i.onTouchStart=Yy.bind(i),i.onTouchMove=Ky.bind(i),i.onTouchEnd=Xy.bind(i),e.cssMode&&(i.onScroll=Qy.bind(i)),i.onClick=Jy.bind(i),i.onLoad=tb.bind(i),gd||(t.addEventListener("touchstart",eb),gd=!0),um(i,"on")}function nb(){um(this,"off")}var sb={attachEvents:ib,detachEvents:nb};const vd=(i,t)=>i.grid&&t.grid&&t.grid.rows>1;function rb(){const i=this,{realIndex:t,initialized:e,params:n,el:s}=i,r=n.breakpoints;if(!r||r&&Object.keys(r).length===0)return;const a=i.getBreakpoint(r,i.params.breakpointsBase,i.el);if(!a||i.currentBreakpoint===a)return;const h=(a in r?r[a]:void 0)||i.originalParams,c=vd(i,n),d=vd(i,h),p=n.enabled;c&&!d?(s.classList.remove(`${n.containerModifierClass}grid`,`${n.containerModifierClass}grid-column`),i.emitContainerClasses()):!c&&d&&(s.classList.add(`${n.containerModifierClass}grid`),(h.grid.fill&&h.grid.fill==="column"||!h.grid.fill&&n.grid.fill==="column")&&s.classList.add(`${n.containerModifierClass}grid-column`),i.emitContainerClasses()),["navigation","pagination","scrollbar"].forEach(_=>{if(typeof h[_]>"u")return;const w=n[_]&&n[_].enabled,T=h[_]&&h[_].enabled;w&&!T&&i[_].disable(),!w&&T&&i[_].enable()});const g=h.direction&&h.direction!==n.direction,v=n.loop&&(h.slidesPerView!==n.slidesPerView||g);g&&e&&i.changeDirection(),si(i.params,h);const b=i.params.enabled;Object.assign(i,{allowTouchMove:i.params.allowTouchMove,allowSlideNext:i.params.allowSlideNext,allowSlidePrev:i.params.allowSlidePrev}),p&&!b?i.disable():!p&&b&&i.enable(),i.currentBreakpoint=a,i.emit("_beforeBreakpoint",h),v&&e&&(i.loopDestroy(),i.loopCreate(t),i.updateSlides()),i.emit("breakpoint",h)}function ob(i,t,e){if(t===void 0&&(t="window"),!i||t==="container"&&!e)return;let n=!1;const s=ci(),r=t==="window"?s.innerHeight:e.clientHeight,a=Object.keys(i).map(l=>{if(typeof l=="string"&&l.indexOf("@")===0){const h=parseFloat(l.substr(1));return{value:r*h,point:l}}return{value:l,point:l}});a.sort((l,h)=>parseInt(l.value,10)-parseInt(h.value,10));for(let l=0;l{typeof n=="object"?Object.keys(n).forEach(s=>{n[s]&&e.push(t+s)}):typeof n=="string"&&e.push(t+n)}),e}function cb(){const i=this,{classNames:t,params:e,rtl:n,el:s,device:r}=i,a=lb(["initialized",e.direction,{"free-mode":i.params.freeMode&&e.freeMode.enabled},{autoheight:e.autoHeight},{rtl:n},{grid:e.grid&&e.grid.rows>1},{"grid-column":e.grid&&e.grid.rows>1&&e.grid.fill==="column"},{android:r.android},{ios:r.ios},{"css-mode":e.cssMode},{centered:e.cssMode&&e.centeredSlides},{"watch-progress":e.watchSlidesProgress}],e.containerModifierClass);t.push(...a),s.classList.add(...t),i.emitContainerClasses()}function ub(){const i=this,{el:t,classNames:e}=i;t.classList.remove(...e),i.emitContainerClasses()}var hb={addClasses:cb,removeClasses:ub};function db(){const i=this,{isLocked:t,params:e}=i,{slidesOffsetBefore:n}=e;if(n){const s=i.slides.length-1,r=i.slidesGrid[s]+i.slidesSizesGrid[s]+n*2;i.isLocked=i.size>r}else i.isLocked=i.snapGrid.length===1;e.allowSlideNext===!0&&(i.allowSlideNext=!i.isLocked),e.allowSlidePrev===!0&&(i.allowSlidePrev=!i.isLocked),t&&t!==i.isLocked&&(i.isEnd=!1),t!==i.isLocked&&i.emit(i.isLocked?"lock":"unlock")}var fb={checkOverflow:db},_d={init:!0,direction:"horizontal",oneWayMovement:!1,touchEventsTarget:"wrapper",initialSlide:0,speed:300,cssMode:!1,updateOnWindowResize:!0,resizeObserver:!0,nested:!1,createElements:!1,enabled:!0,focusableElements:"input, select, option, textarea, button, video, label",width:null,height:null,preventInteractionOnTransition:!1,userAgent:null,url:null,edgeSwipeDetection:!1,edgeSwipeThreshold:20,autoHeight:!1,setWrapperSize:!1,virtualTranslate:!1,effect:"slide",breakpoints:void 0,breakpointsBase:"window",spaceBetween:0,slidesPerView:1,slidesPerGroup:1,slidesPerGroupSkip:0,slidesPerGroupAuto:!1,centeredSlides:!1,centeredSlidesBounds:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,normalizeSlideIndex:!0,centerInsufficientSlides:!1,watchOverflow:!0,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,allowTouchMove:!0,threshold:5,touchMoveStopPropagation:!1,touchStartPreventDefault:!0,touchStartForcePreventDefault:!1,touchReleaseOnEdges:!1,uniqueNavElements:!0,resistance:!0,resistanceRatio:.85,watchSlidesProgress:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,loop:!1,loopedSlides:null,loopPreventsSliding:!0,rewind:!1,allowSlidePrev:!0,allowSlideNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:"swiper-no-swiping",noSwipingSelector:null,passiveListeners:!0,maxBackfaceHiddenSlides:10,containerModifierClass:"swiper-",slideClass:"swiper-slide",slideActiveClass:"swiper-slide-active",slideVisibleClass:"swiper-slide-visible",slideNextClass:"swiper-slide-next",slidePrevClass:"swiper-slide-prev",wrapperClass:"swiper-wrapper",lazyPreloaderClass:"swiper-lazy-preloader",lazyPreloadPrevNext:0,runCallbacksOnInit:!0,_emitClasses:!1};function pb(i,t){return function(n){n===void 0&&(n={});const s=Object.keys(n)[0],r=n[s];if(typeof r!="object"||r===null){si(t,n);return}if(["navigation","pagination","scrollbar"].indexOf(s)>=0&&i[s]===!0&&(i[s]={auto:!0}),!(s in i&&"enabled"in r)){si(t,n);return}i[s]===!0&&(i[s]={enabled:!0}),typeof i[s]=="object"&&!("enabled"in i[s])&&(i[s].enabled=!0),i[s]||(i[s]={enabled:!1}),si(t,n)}}const Zl={eventsEmitter:hy,update:xy,translate:My,transition:Py,slide:zy,loop:Uy,grabCursor:Gy,events:sb,breakpoints:ab,checkOverflow:fb,classes:hb},Yl={};class Xe{constructor(){let t,e;for(var n=arguments.length,s=new Array(n),r=0;r1){const d=[];return a.querySelectorAll(e.el).forEach(p=>{const g=si({},e,{el:p});d.push(new Xe(g))}),d}const l=this;l.__swiper__=!0,l.support=lm(),l.device=oy({userAgent:e.userAgent}),l.browser=ly(),l.eventsListeners={},l.eventsAnyListeners=[],l.modules=[...l.__modules__],e.modules&&Array.isArray(e.modules)&&l.modules.push(...e.modules);const h={};l.modules.forEach(d=>{d({params:e,swiper:l,extendParams:pb(e,h),on:l.on.bind(l),once:l.once.bind(l),off:l.off.bind(l),emit:l.emit.bind(l)})});const c=si({},_d,h);return l.params=si({},c,Yl,e),l.originalParams=si({},l.params),l.passedParams=si({},e),l.params&&l.params.on&&Object.keys(l.params.on).forEach(d=>{l.on(d,l.params.on[d])}),l.params&&l.params.onAny&&l.onAny(l.params.onAny),Object.assign(l,{enabled:l.params.enabled,el:t,classNames:[],slides:[],slidesGrid:[],snapGrid:[],slidesSizesGrid:[],isHorizontal(){return l.params.direction==="horizontal"},isVertical(){return l.params.direction==="vertical"},activeIndex:0,realIndex:0,isBeginning:!0,isEnd:!1,translate:0,previousTranslate:0,progress:0,velocity:0,animating:!1,cssOverflowAdjustment(){return Math.trunc(this.translate/2**23)*2**23},allowSlideNext:l.params.allowSlideNext,allowSlidePrev:l.params.allowSlidePrev,touchEventsData:{isTouched:void 0,isMoved:void 0,allowTouchCallbacks:void 0,touchStartTime:void 0,isScrolling:void 0,currentTranslate:void 0,startTranslate:void 0,allowThresholdMove:void 0,focusableElements:l.params.focusableElements,lastClickTime:0,clickTimeout:void 0,velocities:[],allowMomentumBounce:void 0,startMoving:void 0,evCache:[]},allowClick:!0,allowTouchMove:l.params.allowTouchMove,touches:{startX:0,startY:0,currentX:0,currentY:0,diff:0},imagesToLoad:[],imagesLoaded:0}),l.emit("_swiper"),l.params.init&&l.init(),l}getSlideIndex(t){const{slidesEl:e,params:n}=this,s=zi(e,`.${n.slideClass}, swiper-slide`),r=Da(s[0]);return Da(t)-r}getSlideIndexByData(t){return this.getSlideIndex(this.slides.filter(e=>e.getAttribute("data-swiper-slide-index")*1===t)[0])}recalcSlides(){const t=this,{slidesEl:e,params:n}=t;t.slides=zi(e,`.${n.slideClass}, swiper-slide`)}enable(){const t=this;t.enabled||(t.enabled=!0,t.params.grabCursor&&t.setGrabCursor(),t.emit("enable"))}disable(){const t=this;t.enabled&&(t.enabled=!1,t.params.grabCursor&&t.unsetGrabCursor(),t.emit("disable"))}setProgress(t,e){const n=this;t=Math.min(Math.max(t,0),1);const s=n.minTranslate(),a=(n.maxTranslate()-s)*t+s;n.translateTo(a,typeof e>"u"?0:e),n.updateActiveIndex(),n.updateSlidesClasses()}emitContainerClasses(){const t=this;if(!t.params._emitClasses||!t.el)return;const e=t.el.className.split(" ").filter(n=>n.indexOf("swiper")===0||n.indexOf(t.params.containerModifierClass)===0);t.emit("_containerClasses",e.join(" "))}getSlideClasses(t){const e=this;return e.destroyed?"":t.className.split(" ").filter(n=>n.indexOf("swiper-slide")===0||n.indexOf(e.params.slideClass)===0).join(" ")}emitSlidesClasses(){const t=this;if(!t.params._emitClasses||!t.el)return;const e=[];t.slides.forEach(n=>{const s=t.getSlideClasses(n);e.push({slideEl:n,classNames:s}),t.emit("_slideClass",n,s)}),t.emit("_slideClasses",e)}slidesPerViewDynamic(t,e){t===void 0&&(t="current"),e===void 0&&(e=!1);const n=this,{params:s,slides:r,slidesGrid:a,slidesSizesGrid:l,size:h,activeIndex:c}=n;let d=1;if(s.centeredSlides){let p=r[c]?r[c].swiperSlideSize:0,g;for(let v=c+1;vh&&(g=!0));for(let v=c-1;v>=0;v-=1)r[v]&&!g&&(p+=r[v].swiperSlideSize,d+=1,p>h&&(g=!0))}else if(t==="current")for(let p=c+1;p=0;p-=1)a[c]-a[p]{a.complete&&fa(t,a)}),t.updateSize(),t.updateSlides(),t.updateProgress(),t.updateSlidesClasses();function s(){const a=t.rtlTranslate?t.translate*-1:t.translate,l=Math.min(Math.max(a,t.maxTranslate()),t.minTranslate());t.setTranslate(l),t.updateActiveIndex(),t.updateSlidesClasses()}let r;if(n.freeMode&&n.freeMode.enabled&&!n.cssMode)s(),n.autoHeight&&t.updateAutoHeight();else{if((n.slidesPerView==="auto"||n.slidesPerView>1)&&t.isEnd&&!n.centeredSlides){const a=t.virtual&&n.virtual.enabled?t.virtual.slides:t.slides;r=t.slideTo(a.length-1,0,!1,!0)}else r=t.slideTo(t.activeIndex,0,!1,!0);r||s()}n.watchOverflow&&e!==t.snapGrid&&t.checkOverflow(),t.emit("update")}changeDirection(t,e){e===void 0&&(e=!0);const n=this,s=n.params.direction;return t||(t=s==="horizontal"?"vertical":"horizontal"),t===s||t!=="horizontal"&&t!=="vertical"||(n.el.classList.remove(`${n.params.containerModifierClass}${s}`),n.el.classList.add(`${n.params.containerModifierClass}${t}`),n.emitContainerClasses(),n.params.direction=t,n.slides.forEach(r=>{t==="vertical"?r.style.width="":r.style.height=""}),n.emit("changeDirection"),e&&n.update()),n}changeLanguageDirection(t){const e=this;e.rtl&&t==="rtl"||!e.rtl&&t==="ltr"||(e.rtl=t==="rtl",e.rtlTranslate=e.params.direction==="horizontal"&&e.rtl,e.rtl?(e.el.classList.add(`${e.params.containerModifierClass}rtl`),e.el.dir="rtl"):(e.el.classList.remove(`${e.params.containerModifierClass}rtl`),e.el.dir="ltr"),e.update())}mount(t){const e=this;if(e.mounted)return!0;let n=t||e.params.el;if(typeof n=="string"&&(n=document.querySelector(n)),!n)return!1;n.swiper=e,n.parentNode&&n.parentNode.host&&(e.isElement=!0);const s=()=>`.${(e.params.wrapperClass||"").trim().split(" ").join(".")}`;let a=n&&n.shadowRoot&&n.shadowRoot.querySelector?n.shadowRoot.querySelector(s()):zi(n,s())[0];return!a&&e.params.createElements&&(a=om("div",e.params.wrapperClass),n.append(a),zi(n,`.${e.params.slideClass}`).forEach(l=>{a.append(l)})),Object.assign(e,{el:n,wrapperEl:a,slidesEl:e.isElement?n.parentNode.host:a,hostEl:e.isElement?n.parentNode.host:n,mounted:!0,rtl:n.dir.toLowerCase()==="rtl"||kn(n,"direction")==="rtl",rtlTranslate:e.params.direction==="horizontal"&&(n.dir.toLowerCase()==="rtl"||kn(n,"direction")==="rtl"),wrongRTL:kn(a,"display")==="-webkit-box"}),!0}init(t){const e=this;return e.initialized||e.mount(t)===!1||(e.emit("beforeInit"),e.params.breakpoints&&e.setBreakpoint(),e.addClasses(),e.updateSize(),e.updateSlides(),e.params.watchOverflow&&e.checkOverflow(),e.params.grabCursor&&e.enabled&&e.setGrabCursor(),e.params.loop&&e.virtual&&e.params.virtual.enabled?e.slideTo(e.params.initialSlide+e.virtual.slidesBefore,0,e.params.runCallbacksOnInit,!1,!0):e.slideTo(e.params.initialSlide,0,e.params.runCallbacksOnInit,!1,!0),e.params.loop&&e.loopCreate(),e.attachEvents(),[...e.el.querySelectorAll('[loading="lazy"]')].forEach(s=>{s.complete?fa(e,s):s.addEventListener("load",r=>{fa(e,r.target)})}),jc(e),e.initialized=!0,jc(e),e.emit("init"),e.emit("afterInit")),e}destroy(t,e){t===void 0&&(t=!0),e===void 0&&(e=!0);const n=this,{params:s,el:r,wrapperEl:a,slides:l}=n;return typeof n.params>"u"||n.destroyed||(n.emit("beforeDestroy"),n.initialized=!1,n.detachEvents(),s.loop&&n.loopDestroy(),e&&(n.removeClasses(),r.removeAttribute("style"),a.removeAttribute("style"),l&&l.length&&l.forEach(h=>{h.classList.remove(s.slideVisibleClass,s.slideActiveClass,s.slideNextClass,s.slidePrevClass),h.removeAttribute("style"),h.removeAttribute("data-swiper-slide-index")})),n.emit("destroy"),Object.keys(n.eventsListeners).forEach(h=>{n.off(h)}),t!==!1&&(n.el.swiper=null,J_(n)),n.destroyed=!0),null}static extendDefaults(t){si(Yl,t)}static get extendedDefaults(){return Yl}static get defaults(){return _d}static installModule(t){Xe.prototype.__modules__||(Xe.prototype.__modules__=[]);const e=Xe.prototype.__modules__;typeof t=="function"&&e.indexOf(t)<0&&e.push(t)}static use(t){return Array.isArray(t)?(t.forEach(e=>Xe.installModule(e)),Xe):(Xe.installModule(t),Xe)}}Object.keys(Zl).forEach(i=>{Object.keys(Zl[i]).forEach(t=>{Xe.prototype[t]=Zl[i][t]})});Xe.use([cy,uy]);function hm(i,t,e,n){return i.params.createElements&&Object.keys(n).forEach(s=>{if(!e[s]&&e.auto===!0){let r=zi(i.el,`.${n[s]}`)[0];r||(r=om("div",n[s]),r.className=n[s],i.el.append(r)),e[s]=r,t[s]=r}}),e}function mb(i){let{swiper:t,extendParams:e,on:n,emit:s}=i;e({navigation:{nextEl:null,prevEl:null,hideOnClick:!1,disabledClass:"swiper-button-disabled",hiddenClass:"swiper-button-hidden",lockClass:"swiper-button-lock",navigationDisabledClass:"swiper-navigation-disabled"}}),t.navigation={nextEl:null,prevEl:null};const r=_=>(Array.isArray(_)||(_=[_].filter(w=>!!w)),_);function a(_){let w;return _&&typeof _=="string"&&t.isElement&&(w=t.el.querySelector(_),w)?w:(_&&(typeof _=="string"&&(w=[...document.querySelectorAll(_)]),t.params.uniqueNavElements&&typeof _=="string"&&w.length>1&&t.el.querySelectorAll(_).length===1&&(w=t.el.querySelector(_))),_&&!w?_:w)}function l(_,w){const T=t.params.navigation;_=r(_),_.forEach(S=>{S&&(S.classList[w?"add":"remove"](...T.disabledClass.split(" ")),S.tagName==="BUTTON"&&(S.disabled=w),t.params.watchOverflow&&t.enabled&&S.classList[t.isLocked?"add":"remove"](T.lockClass))})}function h(){const{nextEl:_,prevEl:w}=t.navigation;if(t.params.loop){l(w,!1),l(_,!1);return}l(w,t.isBeginning&&!t.params.rewind),l(_,t.isEnd&&!t.params.rewind)}function c(_){_.preventDefault(),!(t.isBeginning&&!t.params.loop&&!t.params.rewind)&&(t.slidePrev(),s("navigationPrev"))}function d(_){_.preventDefault(),!(t.isEnd&&!t.params.loop&&!t.params.rewind)&&(t.slideNext(),s("navigationNext"))}function p(){const _=t.params.navigation;if(t.params.navigation=hm(t,t.originalParams.navigation,t.params.navigation,{nextEl:"swiper-button-next",prevEl:"swiper-button-prev"}),!(_.nextEl||_.prevEl))return;let w=a(_.nextEl),T=a(_.prevEl);Object.assign(t.navigation,{nextEl:w,prevEl:T}),w=r(w),T=r(T);const S=(C,x)=>{C&&C.addEventListener("click",x==="next"?d:c),!t.enabled&&C&&C.classList.add(..._.lockClass.split(" "))};w.forEach(C=>S(C,"next")),T.forEach(C=>S(C,"prev"))}function g(){let{nextEl:_,prevEl:w}=t.navigation;_=r(_),w=r(w);const T=(S,C)=>{S.removeEventListener("click",C==="next"?d:c),S.classList.remove(...t.params.navigation.disabledClass.split(" "))};_.forEach(S=>T(S,"next")),w.forEach(S=>T(S,"prev"))}n("init",()=>{t.params.navigation.enabled===!1?b():(p(),h())}),n("toEdge fromEdge lock unlock",()=>{h()}),n("destroy",()=>{g()}),n("enable disable",()=>{let{nextEl:_,prevEl:w}=t.navigation;_=r(_),w=r(w),[..._,...w].filter(T=>!!T).forEach(T=>T.classList[t.enabled?"remove":"add"](t.params.navigation.lockClass))}),n("click",(_,w)=>{let{nextEl:T,prevEl:S}=t.navigation;T=r(T),S=r(S);const C=w.target;if(t.params.navigation.hideOnClick&&!S.includes(C)&&!T.includes(C)){if(t.pagination&&t.params.pagination&&t.params.pagination.clickable&&(t.pagination.el===C||t.pagination.el.contains(C)))return;let x;T.length?x=T[0].classList.contains(t.params.navigation.hiddenClass):S.length&&(x=S[0].classList.contains(t.params.navigation.hiddenClass)),s(x===!0?"navigationShow":"navigationHide"),[...T,...S].filter(D=>!!D).forEach(D=>D.classList.toggle(t.params.navigation.hiddenClass))}});const v=()=>{t.el.classList.remove(...t.params.navigation.navigationDisabledClass.split(" ")),p(),h()},b=()=>{t.el.classList.add(...t.params.navigation.navigationDisabledClass.split(" ")),g()};Object.assign(t.navigation,{enable:v,disable:b,update:h,init:p,destroy:g})}function pr(i){return i===void 0&&(i=""),`.${i.trim().replace(/([\.:!+\/])/g,"\\$1").replace(/ /g,".")}`}function dm(i){let{swiper:t,extendParams:e,on:n,emit:s}=i;const r="swiper-pagination";e({pagination:{el:null,bulletElement:"span",clickable:!1,hideOnClick:!1,renderBullet:null,renderProgressbar:null,renderFraction:null,renderCustom:null,progressbarOpposite:!1,type:"bullets",dynamicBullets:!1,dynamicMainBullets:1,formatFractionCurrent:S=>S,formatFractionTotal:S=>S,bulletClass:`${r}-bullet`,bulletActiveClass:`${r}-bullet-active`,modifierClass:`${r}-`,currentClass:`${r}-current`,totalClass:`${r}-total`,hiddenClass:`${r}-hidden`,progressbarFillClass:`${r}-progressbar-fill`,progressbarOppositeClass:`${r}-progressbar-opposite`,clickableClass:`${r}-clickable`,lockClass:`${r}-lock`,horizontalClass:`${r}-horizontal`,verticalClass:`${r}-vertical`,paginationDisabledClass:`${r}-disabled`}}),t.pagination={el:null,bullets:[]};let a,l=0;const h=S=>(Array.isArray(S)||(S=[S].filter(C=>!!C)),S);function c(){return!t.params.pagination.el||!t.pagination.el||Array.isArray(t.pagination.el)&&t.pagination.el.length===0}function d(S,C){const{bulletActiveClass:x}=t.params.pagination;S&&(S=S[`${C==="prev"?"previous":"next"}ElementSibling`],S&&(S.classList.add(`${x}-${C}`),S=S[`${C==="prev"?"previous":"next"}ElementSibling`],S&&S.classList.add(`${x}-${C}-${C}`)))}function p(S){const C=S.target.closest(pr(t.params.pagination.bulletClass));if(!C)return;S.preventDefault();const x=Da(C)*t.params.slidesPerGroup;if(t.params.loop){if(t.realIndex===x)return;const D=t.getSlideIndexByData(x),V=t.getSlideIndexByData(t.realIndex);D>t.slides.length-t.loopedSlides&&t.loopFix({direction:D>V?"next":"prev",activeSlideIndex:D,slideTo:!1}),t.slideToLoop(x)}else t.slideTo(x)}function g(){const S=t.rtl,C=t.params.pagination;if(c())return;let x=t.pagination.el;x=h(x);let D,V;const $=t.virtual&&t.params.virtual.enabled?t.virtual.slides.length:t.slides.length,K=t.params.loop?Math.ceil($/t.params.slidesPerGroup):t.snapGrid.length;if(t.params.loop?(V=t.previousRealIndex||0,D=t.params.slidesPerGroup>1?Math.floor(t.realIndex/t.params.slidesPerGroup):t.realIndex):typeof t.snapIndex<"u"?(D=t.snapIndex,V=t.previousSnapIndex):(V=t.previousIndex||0,D=t.activeIndex||0),C.type==="bullets"&&t.pagination.bullets&&t.pagination.bullets.length>0){const q=t.pagination.bullets;let rt,z,tt;if(C.dynamicBullets&&(a=Hc(q[0],t.isHorizontal()?"width":"height"),x.forEach(ot=>{ot.style[t.isHorizontal()?"width":"height"]=`${a*(C.dynamicMainBullets+4)}px`}),C.dynamicMainBullets>1&&V!==void 0&&(l+=D-(V||0),l>C.dynamicMainBullets-1?l=C.dynamicMainBullets-1:l<0&&(l=0)),rt=Math.max(D-l,0),z=rt+(Math.min(q.length,C.dynamicMainBullets)-1),tt=(z+rt)/2),q.forEach(ot=>{const it=[...["","-next","-next-next","-prev","-prev-prev","-main"].map(G=>`${C.bulletActiveClass}${G}`)].map(G=>typeof G=="string"&&G.includes(" ")?G.split(" "):G).flat();ot.classList.remove(...it)}),x.length>1)q.forEach(ot=>{const it=Da(ot);it===D?ot.classList.add(...C.bulletActiveClass.split(" ")):t.isElement&&ot.setAttribute("part","bullet"),C.dynamicBullets&&(it>=rt&&it<=z&&ot.classList.add(...`${C.bulletActiveClass}-main`.split(" ")),it===rt&&d(ot,"prev"),it===z&&d(ot,"next"))});else{const ot=q[D];if(ot&&ot.classList.add(...C.bulletActiveClass.split(" ")),t.isElement&&q.forEach((it,G)=>{it.setAttribute("part",G===D?"bullet-active":"bullet")}),C.dynamicBullets){const it=q[rt],G=q[z];for(let Z=rt;Z<=z;Z+=1)q[Z]&&q[Z].classList.add(...`${C.bulletActiveClass}-main`.split(" "));d(it,"prev"),d(G,"next")}}if(C.dynamicBullets){const ot=Math.min(q.length,C.dynamicMainBullets+4),it=(a*ot-a)/2-tt*a,G=S?"right":"left";q.forEach(Z=>{Z.style[t.isHorizontal()?G:"top"]=`${it}px`})}}x.forEach((q,rt)=>{if(C.type==="fraction"&&(q.querySelectorAll(pr(C.currentClass)).forEach(z=>{z.textContent=C.formatFractionCurrent(D+1)}),q.querySelectorAll(pr(C.totalClass)).forEach(z=>{z.textContent=C.formatFractionTotal(K)})),C.type==="progressbar"){let z;C.progressbarOpposite?z=t.isHorizontal()?"vertical":"horizontal":z=t.isHorizontal()?"horizontal":"vertical";const tt=(D+1)/K;let ot=1,it=1;z==="horizontal"?ot=tt:it=tt,q.querySelectorAll(pr(C.progressbarFillClass)).forEach(G=>{G.style.transform=`translate3d(0,0,0) scaleX(${ot}) scaleY(${it})`,G.style.transitionDuration=`${t.params.speed}ms`})}C.type==="custom"&&C.renderCustom?(q.innerHTML=C.renderCustom(t,D+1,K),rt===0&&s("paginationRender",q)):(rt===0&&s("paginationRender",q),s("paginationUpdate",q)),t.params.watchOverflow&&t.enabled&&q.classList[t.isLocked?"add":"remove"](C.lockClass)})}function v(){const S=t.params.pagination;if(c())return;const C=t.virtual&&t.params.virtual.enabled?t.virtual.slides.length:t.slides.length;let x=t.pagination.el;x=h(x);let D="";if(S.type==="bullets"){let V=t.params.loop?Math.ceil(C/t.params.slidesPerGroup):t.snapGrid.length;t.params.freeMode&&t.params.freeMode.enabled&&V>C&&(V=C);for(let $=0;$`}S.type==="fraction"&&(S.renderFraction?D=S.renderFraction.call(t,S.currentClass,S.totalClass):D=` / `),S.type==="progressbar"&&(S.renderProgressbar?D=S.renderProgressbar.call(t,S.progressbarFillClass):D=``),t.pagination.bullets=[],x.forEach(V=>{S.type!=="custom"&&(V.innerHTML=D||""),S.type==="bullets"&&t.pagination.bullets.push(...V.querySelectorAll(pr(S.bulletClass)))}),S.type!=="custom"&&s("paginationRender",x[0])}function b(){t.params.pagination=hm(t,t.originalParams.pagination,t.params.pagination,{el:"swiper-pagination"});const S=t.params.pagination;if(!S.el)return;let C;typeof S.el=="string"&&t.isElement&&(C=t.el.querySelector(S.el)),!C&&typeof S.el=="string"&&(C=[...document.querySelectorAll(S.el)]),C||(C=S.el),!(!C||C.length===0)&&(t.params.uniqueNavElements&&typeof S.el=="string"&&Array.isArray(C)&&C.length>1&&(C=[...t.el.querySelectorAll(S.el)],C.length>1&&(C=C.filter(x=>am(x,".swiper")[0]===t.el)[0])),Array.isArray(C)&&C.length===1&&(C=C[0]),Object.assign(t.pagination,{el:C}),C=h(C),C.forEach(x=>{S.type==="bullets"&&S.clickable&&x.classList.add(S.clickableClass),x.classList.add(S.modifierClass+S.type),x.classList.add(t.isHorizontal()?S.horizontalClass:S.verticalClass),S.type==="bullets"&&S.dynamicBullets&&(x.classList.add(`${S.modifierClass}${S.type}-dynamic`),l=0,S.dynamicMainBullets<1&&(S.dynamicMainBullets=1)),S.type==="progressbar"&&S.progressbarOpposite&&x.classList.add(S.progressbarOppositeClass),S.clickable&&x.addEventListener("click",p),t.enabled||x.classList.add(S.lockClass)}))}function _(){const S=t.params.pagination;if(c())return;let C=t.pagination.el;C&&(C=h(C),C.forEach(x=>{x.classList.remove(S.hiddenClass),x.classList.remove(S.modifierClass+S.type),x.classList.remove(t.isHorizontal()?S.horizontalClass:S.verticalClass),S.clickable&&x.removeEventListener("click",p)})),t.pagination.bullets&&t.pagination.bullets.forEach(x=>x.classList.remove(...S.bulletActiveClass.split(" ")))}n("changeDirection",()=>{if(!t.pagination||!t.pagination.el)return;const S=t.params.pagination;let{el:C}=t.pagination;C=h(C),C.forEach(x=>{x.classList.remove(S.horizontalClass,S.verticalClass),x.classList.add(t.isHorizontal()?S.horizontalClass:S.verticalClass)})}),n("init",()=>{t.params.pagination.enabled===!1?T():(b(),v(),g())}),n("activeIndexChange",()=>{typeof t.snapIndex>"u"&&g()}),n("snapIndexChange",()=>{g()}),n("snapGridLengthChange",()=>{v(),g()}),n("destroy",()=>{_()}),n("enable disable",()=>{let{el:S}=t.pagination;S&&(S=h(S),S.forEach(C=>C.classList[t.enabled?"remove":"add"](t.params.pagination.lockClass)))}),n("lock unlock",()=>{g()}),n("click",(S,C)=>{const x=C.target,D=h(t.pagination.el);if(t.params.pagination.el&&t.params.pagination.hideOnClick&&D&&D.length>0&&!x.classList.contains(t.params.pagination.bulletClass)){if(t.navigation&&(t.navigation.nextEl&&x===t.navigation.nextEl||t.navigation.prevEl&&x===t.navigation.prevEl))return;const V=D[0].classList.contains(t.params.pagination.hiddenClass);s(V===!0?"paginationShow":"paginationHide"),D.forEach($=>$.classList.toggle(t.params.pagination.hiddenClass))}});const w=()=>{t.el.classList.remove(t.params.pagination.paginationDisabledClass);let{el:S}=t.pagination;S&&(S=h(S),S.forEach(C=>C.classList.remove(t.params.pagination.paginationDisabledClass))),b(),v(),g()},T=()=>{t.el.classList.add(t.params.pagination.paginationDisabledClass);let{el:S}=t.pagination;S&&(S=h(S),S.forEach(C=>C.classList.add(t.params.pagination.paginationDisabledClass))),_()};Object.assign(t.pagination,{enable:w,disable:T,render:v,update:g,init:b,destroy:_})}const gb={sliderContainer:".product-card__slider"};class vb extends Kt{constructor(t){super(t),this.slider=null,this.sliderOptions={modules:[dm],slidesPerView:1,grabCursor:!0,pagination:{el:".swiper-pagination",clickable:!0}},this.sliderContainer=t.querySelector(gb.sliderContainer),this.initSlider()}destroy(){var t;super.destroy(),(t=this.slider)==null||t.destroy()}initSlider(){this.slider=new Xe(this.sliderContainer,{...this.sliderOptions})}}const Kl={slides:".__gallery-slides__",thumbs:".__gallery-thumbs__",slidesPagination:".swiper-pagination"};class _b extends Kt{constructor(t){super(t),this.slidesOptions={modules:[dm],spaceBetween:10,slidesPerView:1,watchOverflow:!0,watchSlidesProgress:!0,pagination:{el:Kl.slidesPagination,clickable:!0}},this.thumbsOptions={modules:[mb],watchOverflow:!0,watchSlidesProgress:!0,spaceBetween:8,slidesPerGroup:4,direction:"vertical",navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"},breakpoints:{940:{height:57},1440:{height:105}}},this.$slides=this.element.querySelector(Kl.slides),this.$thumbs=this.element.querySelector(Kl.thumbs),this.$slides&&this.$thumbs&&(this.thumbs=new Xe(this.$thumbs,this.thumbsOptions),this.slides=new Xe(this.$slides,{...this.slidesOptions,breakpoints:{940:{thumbs:{swiper:this.thumbs}}}}),this.slides.on("slideChangeTransitionStart",()=>{this.slides&&this.thumbs&&(this.thumbs.slideTo(this.slides.activeIndex),this.setActiveSlide(this.slides.activeIndex))}),this.thumbs.on("transitionStart",()=>{this.slides&&this.thumbs&&this.slides.slideTo(this.thumbs.activeIndex)}),this.thumbs.on("click",e=>{this.slides&&this.thumbs&&(this.slides.slideTo(e.clickedIndex),this.thumbs.slideTo(e.clickedIndex),this.setActiveSlide(e.clickedIndex))}))}destroy(){var t,e;super.destroy(),(t=this.slides)==null||t.destroy(),(e=this.thumbs)==null||e.destroy()}setActiveSlide(t){var n;const e=(n=this.thumbs)==null?void 0:n.el.querySelectorAll(".swiper-slide");e==null||e.forEach((s,r)=>{s.classList.remove("swiper-slide-active"),r===t&&s.classList.add("swiper-slide-active")})}}const Un={dialog:".modal",closeButton:".__modal-close__",openModal:".__modal-trigger__",closeModal:".modal-close",header:".__modal-header__",content:".__modal-content__"},Xl={openModal:"data-modal-id",closeModal:"data-close",autofocus:"[autofocus]",open:"data-open"},yd={hide:"modal__dialog_hidden"},zo=200;class yb extends Kt{constructor(t){super(t),this.id=this.element.id,this.closeTriggers=this.element.querySelectorAll(Un.closeModal),this.closeButton=this.element.querySelector(Un.closeButton),this.openTriggers=Array.from(document.querySelectorAll(Un.openModal)).flatMap(e=>e.getAttribute(Xl.openModal)===this.id?e:[]),this.element.getAttribute(Xl.open)&&this.show(),this.addListeners()}show(t){t&&t.preventDefault();const e=this.element;e.showModal(),e.scrollTop=0,setTimeout(this.autofocus.bind(this),zo),setTimeout(()=>{document.dispatchEvent(new CustomEvent("dialog-open",{detail:{element:this.element,instance:this,target:t==null?void 0:t.target}}))},zo)}close(){this.element.classList.add(yd.hide),setTimeout(this.closeAnimation.bind(this),zo),setTimeout(()=>{document.dispatchEvent(new CustomEvent("dialog-close",{detail:{element:this.element,instance:this}}))},zo)}autofocus(){const t=this.element.querySelector(Xl.autofocus);t&&t.focus()}closeAnimation(){const t=this.element;t.classList.remove(yd.hide),t.close()}isOutsideClick(t){var c,d;const e=t.target,n=e.closest(Un.closeButton),s=Array.from(this.closeTriggers).find(p=>{const g=e.closest(Un.closeModal);return p==null?void 0:p.isEqualNode(g)}),r=(c=this.element.querySelector(Un.header))==null?void 0:c.contains(e),a=(d=this.element.querySelector(Un.content))==null?void 0:d.contains(e),l=r||a;return n!=null&&n.isEqualNode(this.closeButton)||s?!0:!l}onClose(t){this.isOutsideClick(t)&&this.close()}addListeners(){this.element.addEventListener("mousedown",this.onClose.bind(this),{signal:this.abortController.signal}),this.openTriggers.forEach(t=>{t.addEventListener("click",this.show.bind(this),{signal:this.abortController.signal})})}}const bd={json:"data-json",type:"data-type"};class fm extends Kt{constructor(t){super(t),this.data=null;try{this.data=JSON.parse(this.element.getAttribute(bd.json))}catch{console.log("data-json is incorrect",this.element.getAttribute(bd.json))}}getData(){return this.data}}function bb(i){return typeof i=="function"}function Bu(i,t){return i.contains(t)&&!i.isSameNode(t)}const wb=(i,t=0)=>{let e;return t===0?i:(...n)=>{clearTimeout(e),e=setTimeout(()=>{i.apply(void 0,n)},t)}};function pm(i,t){return function(){return i.apply(t,arguments)}}const{toString:xb}=Object.prototype,{getPrototypeOf:Vu}=Object,Qa=(i=>t=>{const e=xb.call(t);return i[e]||(i[e]=e.slice(8,-1).toLowerCase())})(Object.create(null)),Li=i=>(i=i.toLowerCase(),t=>Qa(t)===i),tl=i=>t=>typeof t===i,{isArray:Ks}=Array,qr=tl("undefined");function Sb(i){return i!==null&&!qr(i)&&i.constructor!==null&&!qr(i.constructor)&&ai(i.constructor.isBuffer)&&i.constructor.isBuffer(i)}const mm=Li("ArrayBuffer");function kb(i){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(i):t=i&&i.buffer&&mm(i.buffer),t}const Eb=tl("string"),ai=tl("function"),gm=tl("number"),el=i=>i!==null&&typeof i=="object",Cb=i=>i===!0||i===!1,pa=i=>{if(Qa(i)!=="object")return!1;const t=Vu(i);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in i)&&!(Symbol.iterator in i)},Tb=Li("Date"),Mb=Li("File"),Lb=Li("Blob"),Ab=Li("FileList"),Db=i=>el(i)&&ai(i.pipe),Pb=i=>{let t;return i&&(typeof FormData=="function"&&i instanceof FormData||ai(i.append)&&((t=Qa(i))==="formdata"||t==="object"&&ai(i.toString)&&i.toString()==="[object FormData]"))},Ob=Li("URLSearchParams"),[Ib,Fb,Rb,Bb]=["ReadableStream","Request","Response","Headers"].map(Li),Vb=i=>i.trim?i.trim():i.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function co(i,t,{allOwnKeys:e=!1}={}){if(i===null||typeof i>"u")return;let n,s;if(typeof i!="object"&&(i=[i]),Ks(i))for(n=0,s=i.length;n0;)if(s=e[n],t===s.toLowerCase())return s;return null}const ns=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,_m=i=>!qr(i)&&i!==ns;function Uc(){const{caseless:i}=_m(this)&&this||{},t={},e=(n,s)=>{const r=i&&vm(t,s)||s;pa(t[r])&&pa(n)?t[r]=Uc(t[r],n):pa(n)?t[r]=Uc({},n):Ks(n)?t[r]=n.slice():t[r]=n};for(let n=0,s=arguments.length;n(co(t,(s,r)=>{e&&ai(s)?i[r]=pm(s,e):i[r]=s},{allOwnKeys:n}),i),zb=i=>(i.charCodeAt(0)===65279&&(i=i.slice(1)),i),$b=(i,t,e,n)=>{i.prototype=Object.create(t.prototype,n),i.prototype.constructor=i,Object.defineProperty(i,"super",{value:t.prototype}),e&&Object.assign(i.prototype,e)},Hb=(i,t,e,n)=>{let s,r,a;const l={};if(t=t||{},i==null)return t;do{for(s=Object.getOwnPropertyNames(i),r=s.length;r-- >0;)a=s[r],(!n||n(a,i,t))&&!l[a]&&(t[a]=i[a],l[a]=!0);i=e!==!1&&Vu(i)}while(i&&(!e||e(i,t))&&i!==Object.prototype);return t},jb=(i,t,e)=>{i=String(i),(e===void 0||e>i.length)&&(e=i.length),e-=t.length;const n=i.indexOf(t,e);return n!==-1&&n===e},Ub=i=>{if(!i)return null;if(Ks(i))return i;let t=i.length;if(!gm(t))return null;const e=new Array(t);for(;t-- >0;)e[t]=i[t];return e},Wb=(i=>t=>i&&t instanceof i)(typeof Uint8Array<"u"&&Vu(Uint8Array)),qb=(i,t)=>{const n=(i&&i[Symbol.iterator]).call(i);let s;for(;(s=n.next())&&!s.done;){const r=s.value;t.call(i,r[0],r[1])}},Gb=(i,t)=>{let e;const n=[];for(;(e=i.exec(t))!==null;)n.push(e);return n},Zb=Li("HTMLFormElement"),Yb=i=>i.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,n,s){return n.toUpperCase()+s}),wd=(({hasOwnProperty:i})=>(t,e)=>i.call(t,e))(Object.prototype),Kb=Li("RegExp"),ym=(i,t)=>{const e=Object.getOwnPropertyDescriptors(i),n={};co(e,(s,r)=>{let a;(a=t(s,r,i))!==!1&&(n[r]=a||s)}),Object.defineProperties(i,n)},Xb=i=>{ym(i,(t,e)=>{if(ai(i)&&["arguments","caller","callee"].indexOf(e)!==-1)return!1;const n=i[e];if(ai(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+e+"'")})}})},Jb=(i,t)=>{const e={},n=s=>{s.forEach(r=>{e[r]=!0})};return Ks(i)?n(i):n(String(i).split(t)),e},Qb=()=>{},t0=(i,t)=>i!=null&&Number.isFinite(i=+i)?i:t,Jl="abcdefghijklmnopqrstuvwxyz",xd="0123456789",bm={DIGIT:xd,ALPHA:Jl,ALPHA_DIGIT:Jl+Jl.toUpperCase()+xd},e0=(i=16,t=bm.ALPHA_DIGIT)=>{let e="";const{length:n}=t;for(;i--;)e+=t[Math.random()*n|0];return e};function i0(i){return!!(i&&ai(i.append)&&i[Symbol.toStringTag]==="FormData"&&i[Symbol.iterator])}const n0=i=>{const t=new Array(10),e=(n,s)=>{if(el(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[s]=n;const r=Ks(n)?[]:{};return co(n,(a,l)=>{const h=e(a,s+1);!qr(h)&&(r[l]=h)}),t[s]=void 0,r}}return n};return e(i,0)},s0=Li("AsyncFunction"),r0=i=>i&&(el(i)||ai(i))&&ai(i.then)&&ai(i.catch),wm=((i,t)=>i?setImmediate:t?((e,n)=>(ns.addEventListener("message",({source:s,data:r})=>{s===ns&&r===e&&n.length&&n.shift()()},!1),s=>{n.push(s),ns.postMessage(e,"*")}))(`axios@${Math.random()}`,[]):e=>setTimeout(e))(typeof setImmediate=="function",ai(ns.postMessage)),o0=typeof queueMicrotask<"u"?queueMicrotask.bind(ns):typeof process<"u"&&process.nextTick||wm,Q={isArray:Ks,isArrayBuffer:mm,isBuffer:Sb,isFormData:Pb,isArrayBufferView:kb,isString:Eb,isNumber:gm,isBoolean:Cb,isObject:el,isPlainObject:pa,isReadableStream:Ib,isRequest:Fb,isResponse:Rb,isHeaders:Bb,isUndefined:qr,isDate:Tb,isFile:Mb,isBlob:Lb,isRegExp:Kb,isFunction:ai,isStream:Db,isURLSearchParams:Ob,isTypedArray:Wb,isFileList:Ab,forEach:co,merge:Uc,extend:Nb,trim:Vb,stripBOM:zb,inherits:$b,toFlatObject:Hb,kindOf:Qa,kindOfTest:Li,endsWith:jb,toArray:Ub,forEachEntry:qb,matchAll:Gb,isHTMLForm:Zb,hasOwnProperty:wd,hasOwnProp:wd,reduceDescriptors:ym,freezeMethods:Xb,toObjectSet:Jb,toCamelCase:Yb,noop:Qb,toFiniteNumber:t0,findKey:vm,global:ns,isContextDefined:_m,ALPHABET:bm,generateString:e0,isSpecCompliantForm:i0,toJSONObject:n0,isAsyncFn:s0,isThenable:r0,setImmediate:wm,asap:o0};function Ft(i,t,e,n,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=i,this.name="AxiosError",t&&(this.code=t),e&&(this.config=e),n&&(this.request=n),s&&(this.response=s,this.status=s.status?s.status:null)}Q.inherits(Ft,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Q.toJSONObject(this.config),code:this.code,status:this.status}}});const xm=Ft.prototype,Sm={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(i=>{Sm[i]={value:i}});Object.defineProperties(Ft,Sm);Object.defineProperty(xm,"isAxiosError",{value:!0});Ft.from=(i,t,e,n,s,r)=>{const a=Object.create(xm);return Q.toFlatObject(i,a,function(h){return h!==Error.prototype},l=>l!=="isAxiosError"),Ft.call(a,i.message,t,e,n,s),a.cause=i,a.name=i.name,r&&Object.assign(a,r),a};const a0=null;function Wc(i){return Q.isPlainObject(i)||Q.isArray(i)}function km(i){return Q.endsWith(i,"[]")?i.slice(0,-2):i}function Sd(i,t,e){return i?i.concat(t).map(function(s,r){return s=km(s),!e&&r?"["+s+"]":s}).join(e?".":""):t}function l0(i){return Q.isArray(i)&&!i.some(Wc)}const c0=Q.toFlatObject(Q,{},null,function(t){return/^is[A-Z]/.test(t)});function il(i,t,e){if(!Q.isObject(i))throw new TypeError("target must be an object");t=t||new FormData,e=Q.toFlatObject(e,{metaTokens:!0,dots:!1,indexes:!1},!1,function(_,w){return!Q.isUndefined(w[_])});const n=e.metaTokens,s=e.visitor||d,r=e.dots,a=e.indexes,h=(e.Blob||typeof Blob<"u"&&Blob)&&Q.isSpecCompliantForm(t);if(!Q.isFunction(s))throw new TypeError("visitor must be a function");function c(b){if(b===null)return"";if(Q.isDate(b))return b.toISOString();if(!h&&Q.isBlob(b))throw new Ft("Blob is not supported. Use a Buffer instead.");return Q.isArrayBuffer(b)||Q.isTypedArray(b)?h&&typeof Blob=="function"?new Blob([b]):Buffer.from(b):b}function d(b,_,w){let T=b;if(b&&!w&&typeof b=="object"){if(Q.endsWith(_,"{}"))_=n?_:_.slice(0,-2),b=JSON.stringify(b);else if(Q.isArray(b)&&l0(b)||(Q.isFileList(b)||Q.endsWith(_,"[]"))&&(T=Q.toArray(b)))return _=km(_),T.forEach(function(C,x){!(Q.isUndefined(C)||C===null)&&t.append(a===!0?Sd([_],x,r):a===null?_:_+"[]",c(C))}),!1}return Wc(b)?!0:(t.append(Sd(w,_,r),c(b)),!1)}const p=[],g=Object.assign(c0,{defaultVisitor:d,convertValue:c,isVisitable:Wc});function v(b,_){if(!Q.isUndefined(b)){if(p.indexOf(b)!==-1)throw Error("Circular reference detected in "+_.join("."));p.push(b),Q.forEach(b,function(T,S){(!(Q.isUndefined(T)||T===null)&&s.call(t,T,Q.isString(S)?S.trim():S,_,g))===!0&&v(T,_?_.concat(S):[S])}),p.pop()}}if(!Q.isObject(i))throw new TypeError("data must be an object");return v(i),t}function kd(i){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(i).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function Nu(i,t){this._pairs=[],i&&il(i,this,t)}const Em=Nu.prototype;Em.append=function(t,e){this._pairs.push([t,e])};Em.toString=function(t){const e=t?function(n){return t.call(this,n,kd)}:kd;return this._pairs.map(function(s){return e(s[0])+"="+e(s[1])},"").join("&")};function u0(i){return encodeURIComponent(i).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Cm(i,t,e){if(!t)return i;const n=e&&e.encode||u0,s=e&&e.serialize;let r;if(s?r=s(t,e):r=Q.isURLSearchParams(t)?t.toString():new Nu(t,e).toString(n),r){const a=i.indexOf("#");a!==-1&&(i=i.slice(0,a)),i+=(i.indexOf("?")===-1?"?":"&")+r}return i}class Ed{constructor(){this.handlers=[]}use(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Q.forEach(this.handlers,function(n){n!==null&&t(n)})}}const Tm={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},h0=typeof URLSearchParams<"u"?URLSearchParams:Nu,d0=typeof FormData<"u"?FormData:null,f0=typeof Blob<"u"?Blob:null,p0={isBrowser:!0,classes:{URLSearchParams:h0,FormData:d0,Blob:f0},protocols:["http","https","file","blob","url","data"]},zu=typeof window<"u"&&typeof document<"u",qc=typeof navigator=="object"&&navigator||void 0,m0=zu&&(!qc||["ReactNative","NativeScript","NS"].indexOf(qc.product)<0),g0=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",v0=zu&&window.location.href||"http://localhost",_0=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:zu,hasStandardBrowserEnv:m0,hasStandardBrowserWebWorkerEnv:g0,navigator:qc,origin:v0},Symbol.toStringTag,{value:"Module"})),Qe={..._0,...p0};function y0(i,t){return il(i,new Qe.classes.URLSearchParams,Object.assign({visitor:function(e,n,s,r){return Qe.isNode&&Q.isBuffer(e)?(this.append(n,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}function b0(i){return Q.matchAll(/\w+|\[(\w*)]/g,i).map(t=>t[0]==="[]"?"":t[1]||t[0])}function w0(i){const t={},e=Object.keys(i);let n;const s=e.length;let r;for(n=0;n=e.length;return a=!a&&Q.isArray(s)?s.length:a,h?(Q.hasOwnProp(s,a)?s[a]=[s[a],n]:s[a]=n,!l):((!s[a]||!Q.isObject(s[a]))&&(s[a]=[]),t(e,n,s[a],r)&&Q.isArray(s[a])&&(s[a]=w0(s[a])),!l)}if(Q.isFormData(i)&&Q.isFunction(i.entries)){const e={};return Q.forEachEntry(i,(n,s)=>{t(b0(n),s,e,0)}),e}return null}function x0(i,t,e){if(Q.isString(i))try{return(t||JSON.parse)(i),Q.trim(i)}catch(n){if(n.name!=="SyntaxError")throw n}return(0,JSON.stringify)(i)}const uo={transitional:Tm,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const n=e.getContentType()||"",s=n.indexOf("application/json")>-1,r=Q.isObject(t);if(r&&Q.isHTMLForm(t)&&(t=new FormData(t)),Q.isFormData(t))return s?JSON.stringify(Mm(t)):t;if(Q.isArrayBuffer(t)||Q.isBuffer(t)||Q.isStream(t)||Q.isFile(t)||Q.isBlob(t)||Q.isReadableStream(t))return t;if(Q.isArrayBufferView(t))return t.buffer;if(Q.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(r){if(n.indexOf("application/x-www-form-urlencoded")>-1)return y0(t,this.formSerializer).toString();if((l=Q.isFileList(t))||n.indexOf("multipart/form-data")>-1){const h=this.env&&this.env.FormData;return il(l?{"files[]":t}:t,h&&new h,this.formSerializer)}}return r||s?(e.setContentType("application/json",!1),x0(t)):t}],transformResponse:[function(t){const e=this.transitional||uo.transitional,n=e&&e.forcedJSONParsing,s=this.responseType==="json";if(Q.isResponse(t)||Q.isReadableStream(t))return t;if(t&&Q.isString(t)&&(n&&!this.responseType||s)){const a=!(e&&e.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(l){if(a)throw l.name==="SyntaxError"?Ft.from(l,Ft.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Qe.classes.FormData,Blob:Qe.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Q.forEach(["delete","get","head","post","put","patch"],i=>{uo.headers[i]={}});const S0=Q.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),k0=i=>{const t={};let e,n,s;return i&&i.split(` `).forEach(function(a){s=a.indexOf(":"),e=a.substring(0,s).trim().toLowerCase(),n=a.substring(s+1).trim(),!(!e||t[e]&&S0[e])&&(e==="set-cookie"?t[e]?t[e].push(n):t[e]=[n]:t[e]=t[e]?t[e]+", "+n:n)}),t},Cd=Symbol("internals");function mr(i){return i&&String(i).trim().toLowerCase()}function ma(i){return i===!1||i==null?i:Q.isArray(i)?i.map(ma):String(i)}function E0(i){const t=Object.create(null),e=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=e.exec(i);)t[n[1]]=n[2];return t}const C0=i=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(i.trim());function Ql(i,t,e,n,s){if(Q.isFunction(n))return n.call(this,t,e);if(s&&(t=e),!!Q.isString(t)){if(Q.isString(n))return t.indexOf(n)!==-1;if(Q.isRegExp(n))return n.test(t)}}function T0(i){return i.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,e,n)=>e.toUpperCase()+n)}function M0(i,t){const e=Q.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(i,n+e,{value:function(s,r,a){return this[n].call(this,t,s,r,a)},configurable:!0})})}class ti{constructor(t){t&&this.set(t)}set(t,e,n){const s=this;function r(l,h,c){const d=mr(h);if(!d)throw new Error("header name must be a non-empty string");const p=Q.findKey(s,d);(!p||s[p]===void 0||c===!0||c===void 0&&s[p]!==!1)&&(s[p||h]=ma(l))}const a=(l,h)=>Q.forEach(l,(c,d)=>r(c,d,h));if(Q.isPlainObject(t)||t instanceof this.constructor)a(t,e);else if(Q.isString(t)&&(t=t.trim())&&!C0(t))a(k0(t),e);else if(Q.isHeaders(t))for(const[l,h]of t.entries())r(h,l,n);else t!=null&&r(e,t,n);return this}get(t,e){if(t=mr(t),t){const n=Q.findKey(this,t);if(n){const s=this[n];if(!e)return s;if(e===!0)return E0(s);if(Q.isFunction(e))return e.call(this,s,n);if(Q.isRegExp(e))return e.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=mr(t),t){const n=Q.findKey(this,t);return!!(n&&this[n]!==void 0&&(!e||Ql(this,this[n],n,e)))}return!1}delete(t,e){const n=this;let s=!1;function r(a){if(a=mr(a),a){const l=Q.findKey(n,a);l&&(!e||Ql(n,n[l],l,e))&&(delete n[l],s=!0)}}return Q.isArray(t)?t.forEach(r):r(t),s}clear(t){const e=Object.keys(this);let n=e.length,s=!1;for(;n--;){const r=e[n];(!t||Ql(this,this[r],r,t,!0))&&(delete this[r],s=!0)}return s}normalize(t){const e=this,n={};return Q.forEach(this,(s,r)=>{const a=Q.findKey(n,r);if(a){e[a]=ma(s),delete e[r];return}const l=t?T0(r):String(r).trim();l!==r&&delete e[r],e[l]=ma(s),n[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return Q.forEach(this,(n,s)=>{n!=null&&n!==!1&&(e[s]=t&&Q.isArray(n)?n.join(", "):n)}),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,e])=>t+": "+e).join(` `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const n=new this(t);return e.forEach(s=>n.set(s)),n}static accessor(t){const n=(this[Cd]=this[Cd]={accessors:{}}).accessors,s=this.prototype;function r(a){const l=mr(a);n[l]||(M0(s,a),n[l]=!0)}return Q.isArray(t)?t.forEach(r):r(t),this}}ti.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Q.reduceDescriptors(ti.prototype,({value:i},t)=>{let e=t[0].toUpperCase()+t.slice(1);return{get:()=>i,set(n){this[e]=n}}});Q.freezeMethods(ti);function tc(i,t){const e=this||uo,n=t||e,s=ti.from(n.headers);let r=n.data;return Q.forEach(i,function(l){r=l.call(e,r,s.normalize(),t?t.status:void 0)}),s.normalize(),r}function Lm(i){return!!(i&&i.__CANCEL__)}function Xs(i,t,e){Ft.call(this,i??"canceled",Ft.ERR_CANCELED,t,e),this.name="CanceledError"}Q.inherits(Xs,Ft,{__CANCEL__:!0});function Am(i,t,e){const n=e.config.validateStatus;!e.status||!n||n(e.status)?i(e):t(new Ft("Request failed with status code "+e.status,[Ft.ERR_BAD_REQUEST,Ft.ERR_BAD_RESPONSE][Math.floor(e.status/100)-4],e.config,e.request,e))}function L0(i){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(i);return t&&t[1]||""}function A0(i,t){i=i||10;const e=new Array(i),n=new Array(i);let s=0,r=0,a;return t=t!==void 0?t:1e3,function(h){const c=Date.now(),d=n[r];a||(a=c),e[s]=h,n[s]=c;let p=r,g=0;for(;p!==s;)g+=e[p++],p=p%i;if(s=(s+1)%i,s===r&&(r=(r+1)%i),c-a{e=d,s=null,r&&(clearTimeout(r),r=null),i.apply(null,c)};return[(...c)=>{const d=Date.now(),p=d-e;p>=n?a(c,d):(s=c,r||(r=setTimeout(()=>{r=null,a(s)},n-p)))},()=>s&&a(s)]}const Pa=(i,t,e=3)=>{let n=0;const s=A0(50,250);return D0(r=>{const a=r.loaded,l=r.lengthComputable?r.total:void 0,h=a-n,c=s(h),d=a<=l;n=a;const p={loaded:a,total:l,progress:l?a/l:void 0,bytes:h,rate:c||void 0,estimated:c&&l&&d?(l-a)/c:void 0,event:r,lengthComputable:l!=null,[t?"download":"upload"]:!0};i(p)},e)},Td=(i,t)=>{const e=i!=null;return[n=>t[0]({lengthComputable:e,total:i,loaded:n}),t[1]]},Md=i=>(...t)=>Q.asap(()=>i(...t)),P0=Qe.hasStandardBrowserEnv?function(){const t=Qe.navigator&&/(msie|trident)/i.test(Qe.navigator.userAgent),e=document.createElement("a");let n;function s(r){let a=r;return t&&(e.setAttribute("href",a),a=e.href),e.setAttribute("href",a),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:e.pathname.charAt(0)==="/"?e.pathname:"/"+e.pathname}}return n=s(window.location.href),function(a){const l=Q.isString(a)?s(a):a;return l.protocol===n.protocol&&l.host===n.host}}():function(){return function(){return!0}}(),O0=Qe.hasStandardBrowserEnv?{write(i,t,e,n,s,r){const a=[i+"="+encodeURIComponent(t)];Q.isNumber(e)&&a.push("expires="+new Date(e).toGMTString()),Q.isString(n)&&a.push("path="+n),Q.isString(s)&&a.push("domain="+s),r===!0&&a.push("secure"),document.cookie=a.join("; ")},read(i){const t=document.cookie.match(new RegExp("(^|;\\s*)("+i+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(i){this.write(i,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function I0(i){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(i)}function F0(i,t){return t?i.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):i}function Dm(i,t){return i&&!I0(t)?F0(i,t):t}const Ld=i=>i instanceof ti?{...i}:i;function us(i,t){t=t||{};const e={};function n(c,d,p){return Q.isPlainObject(c)&&Q.isPlainObject(d)?Q.merge.call({caseless:p},c,d):Q.isPlainObject(d)?Q.merge({},d):Q.isArray(d)?d.slice():d}function s(c,d,p){if(Q.isUndefined(d)){if(!Q.isUndefined(c))return n(void 0,c,p)}else return n(c,d,p)}function r(c,d){if(!Q.isUndefined(d))return n(void 0,d)}function a(c,d){if(Q.isUndefined(d)){if(!Q.isUndefined(c))return n(void 0,c)}else return n(void 0,d)}function l(c,d,p){if(p in t)return n(c,d);if(p in i)return n(void 0,c)}const h={url:r,method:r,data:r,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:l,headers:(c,d)=>s(Ld(c),Ld(d),!0)};return Q.forEach(Object.keys(Object.assign({},i,t)),function(d){const p=h[d]||s,g=p(i[d],t[d],d);Q.isUndefined(g)&&p!==l||(e[d]=g)}),e}const Pm=i=>{const t=us({},i);let{data:e,withXSRFToken:n,xsrfHeaderName:s,xsrfCookieName:r,headers:a,auth:l}=t;t.headers=a=ti.from(a),t.url=Cm(Dm(t.baseURL,t.url),i.params,i.paramsSerializer),l&&a.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):"")));let h;if(Q.isFormData(e)){if(Qe.hasStandardBrowserEnv||Qe.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((h=a.getContentType())!==!1){const[c,...d]=h?h.split(";").map(p=>p.trim()).filter(Boolean):[];a.setContentType([c||"multipart/form-data",...d].join("; "))}}if(Qe.hasStandardBrowserEnv&&(n&&Q.isFunction(n)&&(n=n(t)),n||n!==!1&&P0(t.url))){const c=s&&r&&O0.read(r);c&&a.set(s,c)}return t},R0=typeof XMLHttpRequest<"u",B0=R0&&function(i){return new Promise(function(e,n){const s=Pm(i);let r=s.data;const a=ti.from(s.headers).normalize();let{responseType:l,onUploadProgress:h,onDownloadProgress:c}=s,d,p,g,v,b;function _(){v&&v(),b&&b(),s.cancelToken&&s.cancelToken.unsubscribe(d),s.signal&&s.signal.removeEventListener("abort",d)}let w=new XMLHttpRequest;w.open(s.method.toUpperCase(),s.url,!0),w.timeout=s.timeout;function T(){if(!w)return;const C=ti.from("getAllResponseHeaders"in w&&w.getAllResponseHeaders()),D={data:!l||l==="text"||l==="json"?w.responseText:w.response,status:w.status,statusText:w.statusText,headers:C,config:i,request:w};Am(function($){e($),_()},function($){n($),_()},D),w=null}"onloadend"in w?w.onloadend=T:w.onreadystatechange=function(){!w||w.readyState!==4||w.status===0&&!(w.responseURL&&w.responseURL.indexOf("file:")===0)||setTimeout(T)},w.onabort=function(){w&&(n(new Ft("Request aborted",Ft.ECONNABORTED,i,w)),w=null)},w.onerror=function(){n(new Ft("Network Error",Ft.ERR_NETWORK,i,w)),w=null},w.ontimeout=function(){let x=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const D=s.transitional||Tm;s.timeoutErrorMessage&&(x=s.timeoutErrorMessage),n(new Ft(x,D.clarifyTimeoutError?Ft.ETIMEDOUT:Ft.ECONNABORTED,i,w)),w=null},r===void 0&&a.setContentType(null),"setRequestHeader"in w&&Q.forEach(a.toJSON(),function(x,D){w.setRequestHeader(D,x)}),Q.isUndefined(s.withCredentials)||(w.withCredentials=!!s.withCredentials),l&&l!=="json"&&(w.responseType=s.responseType),c&&([g,b]=Pa(c,!0),w.addEventListener("progress",g)),h&&w.upload&&([p,v]=Pa(h),w.upload.addEventListener("progress",p),w.upload.addEventListener("loadend",v)),(s.cancelToken||s.signal)&&(d=C=>{w&&(n(!C||C.type?new Xs(null,i,w):C),w.abort(),w=null)},s.cancelToken&&s.cancelToken.subscribe(d),s.signal&&(s.signal.aborted?d():s.signal.addEventListener("abort",d)));const S=L0(s.url);if(S&&Qe.protocols.indexOf(S)===-1){n(new Ft("Unsupported protocol "+S+":",Ft.ERR_BAD_REQUEST,i));return}w.send(r||null)})},V0=(i,t)=>{const{length:e}=i=i?i.filter(Boolean):[];if(t||e){let n=new AbortController,s;const r=function(c){if(!s){s=!0,l();const d=c instanceof Error?c:this.reason;n.abort(d instanceof Ft?d:new Xs(d instanceof Error?d.message:d))}};let a=t&&setTimeout(()=>{a=null,r(new Ft(`timeout ${t} of ms exceeded`,Ft.ETIMEDOUT))},t);const l=()=>{i&&(a&&clearTimeout(a),a=null,i.forEach(c=>{c.unsubscribe?c.unsubscribe(r):c.removeEventListener("abort",r)}),i=null)};i.forEach(c=>c.addEventListener("abort",r));const{signal:h}=n;return h.unsubscribe=()=>Q.asap(l),h}},N0=function*(i,t){let e=i.byteLength;if(e{const s=z0(i,t);let r=0,a,l=h=>{a||(a=!0,n&&n(h))};return new ReadableStream({async pull(h){try{const{done:c,value:d}=await s.next();if(c){l(),h.close();return}let p=d.byteLength;if(e){let g=r+=p;e(g)}h.enqueue(new Uint8Array(d))}catch(c){throw l(c),c}},cancel(h){return l(h),s.return()}},{highWaterMark:2})},nl=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Om=nl&&typeof ReadableStream=="function",H0=nl&&(typeof TextEncoder=="function"?(i=>t=>i.encode(t))(new TextEncoder):async i=>new Uint8Array(await new Response(i).arrayBuffer())),Im=(i,...t)=>{try{return!!i(...t)}catch{return!1}},j0=Om&&Im(()=>{let i=!1;const t=new Request(Qe.origin,{body:new ReadableStream,method:"POST",get duplex(){return i=!0,"half"}}).headers.has("Content-Type");return i&&!t}),Dd=64*1024,Gc=Om&&Im(()=>Q.isReadableStream(new Response("").body)),Oa={stream:Gc&&(i=>i.body)};nl&&(i=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Oa[t]&&(Oa[t]=Q.isFunction(i[t])?e=>e[t]():(e,n)=>{throw new Ft(`Response type '${t}' is not supported`,Ft.ERR_NOT_SUPPORT,n)})})})(new Response);const U0=async i=>{if(i==null)return 0;if(Q.isBlob(i))return i.size;if(Q.isSpecCompliantForm(i))return(await new Request(Qe.origin,{method:"POST",body:i}).arrayBuffer()).byteLength;if(Q.isArrayBufferView(i)||Q.isArrayBuffer(i))return i.byteLength;if(Q.isURLSearchParams(i)&&(i=i+""),Q.isString(i))return(await H0(i)).byteLength},W0=async(i,t)=>{const e=Q.toFiniteNumber(i.getContentLength());return e??U0(t)},q0=nl&&(async i=>{let{url:t,method:e,data:n,signal:s,cancelToken:r,timeout:a,onDownloadProgress:l,onUploadProgress:h,responseType:c,headers:d,withCredentials:p="same-origin",fetchOptions:g}=Pm(i);c=c?(c+"").toLowerCase():"text";let v=V0([s,r&&r.toAbortSignal()],a),b;const _=v&&v.unsubscribe&&(()=>{v.unsubscribe()});let w;try{if(h&&j0&&e!=="get"&&e!=="head"&&(w=await W0(d,n))!==0){let D=new Request(t,{method:"POST",body:n,duplex:"half"}),V;if(Q.isFormData(n)&&(V=D.headers.get("content-type"))&&d.setContentType(V),D.body){const[$,K]=Td(w,Pa(Md(h)));n=Ad(D.body,Dd,$,K)}}Q.isString(p)||(p=p?"include":"omit");const T="credentials"in Request.prototype;b=new Request(t,{...g,signal:v,method:e.toUpperCase(),headers:d.normalize().toJSON(),body:n,duplex:"half",credentials:T?p:void 0});let S=await fetch(b);const C=Gc&&(c==="stream"||c==="response");if(Gc&&(l||C&&_)){const D={};["status","statusText","headers"].forEach(q=>{D[q]=S[q]});const V=Q.toFiniteNumber(S.headers.get("content-length")),[$,K]=l&&Td(V,Pa(Md(l),!0))||[];S=new Response(Ad(S.body,Dd,$,()=>{K&&K(),_&&_()}),D)}c=c||"text";let x=await Oa[Q.findKey(Oa,c)||"text"](S,i);return!C&&_&&_(),await new Promise((D,V)=>{Am(D,V,{data:x,headers:ti.from(S.headers),status:S.status,statusText:S.statusText,config:i,request:b})})}catch(T){throw _&&_(),T&&T.name==="TypeError"&&/fetch/i.test(T.message)?Object.assign(new Ft("Network Error",Ft.ERR_NETWORK,i,b),{cause:T.cause||T}):Ft.from(T,T&&T.code,i,b)}}),Zc={http:a0,xhr:B0,fetch:q0};Q.forEach(Zc,(i,t)=>{if(i){try{Object.defineProperty(i,"name",{value:t})}catch{}Object.defineProperty(i,"adapterName",{value:t})}});const Pd=i=>`- ${i}`,G0=i=>Q.isFunction(i)||i===null||i===!1,Fm={getAdapter:i=>{i=Q.isArray(i)?i:[i];const{length:t}=i;let e,n;const s={};for(let r=0;r`adapter ${l} `+(h===!1?"is not supported by the environment":"is not available in the build"));let a=t?r.length>1?`since : `+r.map(Pd).join(` `):" "+Pd(r[0]):"as no adapter specified";throw new Ft("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return n},adapters:Zc};function ec(i){if(i.cancelToken&&i.cancelToken.throwIfRequested(),i.signal&&i.signal.aborted)throw new Xs(null,i)}function Od(i){return ec(i),i.headers=ti.from(i.headers),i.data=tc.call(i,i.transformRequest),["post","put","patch"].indexOf(i.method)!==-1&&i.headers.setContentType("application/x-www-form-urlencoded",!1),Fm.getAdapter(i.adapter||uo.adapter)(i).then(function(n){return ec(i),n.data=tc.call(i,i.transformResponse,n),n.headers=ti.from(n.headers),n},function(n){return Lm(n)||(ec(i),n&&n.response&&(n.response.data=tc.call(i,i.transformResponse,n.response),n.response.headers=ti.from(n.response.headers))),Promise.reject(n)})}const Rm="1.7.7",$u={};["object","boolean","number","function","string","symbol"].forEach((i,t)=>{$u[i]=function(n){return typeof n===i||"a"+(t<1?"n ":" ")+i}});const Id={};$u.transitional=function(t,e,n){function s(r,a){return"[Axios v"+Rm+"] Transitional option '"+r+"'"+a+(n?". "+n:"")}return(r,a,l)=>{if(t===!1)throw new Ft(s(a," has been removed"+(e?" in "+e:"")),Ft.ERR_DEPRECATED);return e&&!Id[a]&&(Id[a]=!0,console.warn(s(a," has been deprecated since v"+e+" and will be removed in the near future"))),t?t(r,a,l):!0}};function Z0(i,t,e){if(typeof i!="object")throw new Ft("options must be an object",Ft.ERR_BAD_OPTION_VALUE);const n=Object.keys(i);let s=n.length;for(;s-- >0;){const r=n[s],a=t[r];if(a){const l=i[r],h=l===void 0||a(l,r,i);if(h!==!0)throw new Ft("option "+r+" must be "+h,Ft.ERR_BAD_OPTION_VALUE);continue}if(e!==!0)throw new Ft("Unknown option "+r,Ft.ERR_BAD_OPTION)}}const Yc={assertOptions:Z0,validators:$u},vn=Yc.validators;class os{constructor(t){this.defaults=t,this.interceptors={request:new Ed,response:new Ed}}async request(t,e){try{return await this._request(t,e)}catch(n){if(n instanceof Error){let s;Error.captureStackTrace?Error.captureStackTrace(s={}):s=new Error;const r=s.stack?s.stack.replace(/^.+\n/,""):"";try{n.stack?r&&!String(n.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(n.stack+=` `+r):n.stack=r}catch{}}throw n}}_request(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=us(this.defaults,e);const{transitional:n,paramsSerializer:s,headers:r}=e;n!==void 0&&Yc.assertOptions(n,{silentJSONParsing:vn.transitional(vn.boolean),forcedJSONParsing:vn.transitional(vn.boolean),clarifyTimeoutError:vn.transitional(vn.boolean)},!1),s!=null&&(Q.isFunction(s)?e.paramsSerializer={serialize:s}:Yc.assertOptions(s,{encode:vn.function,serialize:vn.function},!0)),e.method=(e.method||this.defaults.method||"get").toLowerCase();let a=r&&Q.merge(r.common,r[e.method]);r&&Q.forEach(["delete","get","head","post","put","patch","common"],b=>{delete r[b]}),e.headers=ti.concat(a,r);const l=[];let h=!0;this.interceptors.request.forEach(function(_){typeof _.runWhen=="function"&&_.runWhen(e)===!1||(h=h&&_.synchronous,l.unshift(_.fulfilled,_.rejected))});const c=[];this.interceptors.response.forEach(function(_){c.push(_.fulfilled,_.rejected)});let d,p=0,g;if(!h){const b=[Od.bind(this),void 0];for(b.unshift.apply(b,l),b.push.apply(b,c),g=b.length,d=Promise.resolve(e);p{if(!n._listeners)return;let r=n._listeners.length;for(;r-- >0;)n._listeners[r](s);n._listeners=null}),this.promise.then=s=>{let r;const a=new Promise(l=>{n.subscribe(l),r=l}).then(s);return a.cancel=function(){n.unsubscribe(r)},a},t(function(r,a,l){n.reason||(n.reason=new Xs(r,a,l),e(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);e!==-1&&this._listeners.splice(e,1)}toAbortSignal(){const t=new AbortController,e=n=>{t.abort(n)};return this.subscribe(e),t.signal.unsubscribe=()=>this.unsubscribe(e),t.signal}static source(){let t;return{token:new Hu(function(s){t=s}),cancel:t}}}function Y0(i){return function(e){return i.apply(null,e)}}function K0(i){return Q.isObject(i)&&i.isAxiosError===!0}const Kc={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Kc).forEach(([i,t])=>{Kc[t]=i});function Bm(i){const t=new os(i),e=pm(os.prototype.request,t);return Q.extend(e,os.prototype,t,{allOwnKeys:!0}),Q.extend(e,t,null,{allOwnKeys:!0}),e.create=function(s){return Bm(us(i,s))},e}const Se=Bm(uo);Se.Axios=os;Se.CanceledError=Xs;Se.CancelToken=Hu;Se.isCancel=Lm;Se.VERSION=Rm;Se.toFormData=il;Se.AxiosError=Ft;Se.Cancel=Se.CanceledError;Se.all=function(t){return Promise.all(t)};Se.spread=Y0;Se.isAxiosError=K0;Se.mergeConfig=us;Se.AxiosHeaders=ti;Se.formToJSON=i=>Mm(Q.isHTMLForm(i)?new FormData(i):i);Se.getAdapter=Fm.getAdapter;Se.HttpStatusCode=Kc;Se.default=Se;const X0="/",J0=i=>{var t;return((t=i.response)==null?void 0:t.status)||0},Q0=i=>{var t,e;return(e=(t=i.response)==null?void 0:t.data)==null?void 0:e.message},Vm=(i={statusIgnore:[]})=>{const{statusIgnore:t}=i,e={baseURL:X0},n=Se.create({...e,...i}),s=l=>l,r=l=>l,a=l=>{const h=J0(l);let p=Q0(l)||l.message;return t!=null&&t.includes(h)&&(p=void 0),p&&console.error(`${h}: ${p}`),Promise.reject(l)};return n.interceptors.request.use(s,a),n.interceptors.response.use(r,a),n},tw=` `,ew=` `,iw=` `,nw=` `,sw=` `,rw=i=>{switch(i){case"success":return ew;case"primary":return nw;case"warning":case"alert":return iw;default:return sw}},Ts={toast:"toast"},Ia={title:".__toast-title__",description:".__toast-description__",close:".__toast-close__"},Fd={dimmed:"toast_dimmed"},ow={status:"data-status"},aw={position:"top-right",stack:[],offsetX:40,offsetY:40,gap:10,numToasts:0,duration:".5s",timing:"ease",dimOld:!0};class lw{constructor(t){this.options=aw,this.options={...this.options,...t}}transformToast(t){switch(this.position){case"top-center":{t.element.style.transform=`translate(calc(50vw - 50%), ${t.offsetY}px)`;break}case"bottom-center":{t.element.style.transform=`translate(calc(50vw - 50%), -${t.offsetY}px)`;break}case"top-right":case"top-left":{t.element.style.transform=`translate(0, ${t.offsetY}px)`;break}case"bottom-right":case"bottom-left":{t.element.style.transform=`translate(0, -${t.offsetY}px)`;break}}}createToast(t){const e=document.createElement(t.link?"a":"div");t.link&&e instanceof HTMLAnchorElement&&(e.href=t.link,e.target=t.linkTarget?t.linkTarget:"_self"),e.classList.add(Ts.toast,`${Ts.toast}_${this.position}`,t.style?`${Ts.toast}_${t.style}`:"");const n=rw(t.style);switch(e.innerHTML=` ${n}
${t.title?``+t.title+"":""} ${t.content?``+t.content+"":""}
${t.closeButton==null||t.closeButton===!0?`${tw}`:""} `,document.body.appendChild(e),e.getBoundingClientRect(),this.position){case"top-center":e.style.top="0",e.style.left="0";break;case"bottom-center":e.style.bottom="0",e.style.left="0";break;case"top-right":e.style.top="0",e.style.right=this.offsetX+"px";break;case"top-left":e.style.top="0",e.style.left=this.offsetX+"px";break;case"bottom-right":e.style.bottom="0",e.style.right=this.offsetX+"px";break;case"bottom-left":e.style.bottom="0",e.style.left=this.offsetX+"px";break}return(t.width||this.width)&&(e.style.width=(t.width||this.width)+"px"),e.dataset.transitionState="queue",e}openToast(t){if(this.isOpening()===!0)return!1;t.element.dataset.transitionState="opening",t.element.style.transition=this.duration+" transform "+this.timing,this.transformToast(t),t.element.addEventListener("transitionend",()=>{if(t.element.dataset.transitionState=="opening"){t.element.dataset.transitionState="complete";for(let e=0;ethis.closeToast(t,e),400),!1;if(t.element.dataset.transitionState=="close")return!0;const n=t.element.querySelector(Ia.close);return n&&(n.onclick=null),t.element.dataset.transitionState="close",t.element.style.transition=".2s opacity ease"+(e?" "+e:""),t.element.style.opacity="0",t.element.addEventListener("transitionend",()=>{if(t.element.dataset.transitionState=="close"){const s=t.element.offsetHeight;t.props.onClose&&t.props.onClose(t),t.element.remove();for(let a=0;a{r.preventDefault(),this.closeToast(this.stack[n-1])}),t.link&&e.addEventListener("click",()=>{this.closeToast(this.stack[n-1])}),this.openToast(this.stack[n-1]),t.onOpen&&t.onOpen(this.stack[n-1]),setTimeout(()=>{this.closeToast(this.stack[n-1])},4e3)}isOpening(){let t=!1;for(let e=0;e{this.init()},300)}init(){var s,r;const t=((s=this.element.querySelector(Ia.title))==null?void 0:s.textContent)||"",e=((r=this.element.querySelector(Ia.description))==null?void 0:r.textContent)||"",n=this.element.getAttribute(ow.status);setTimeout(()=>{Pn.push({title:t,content:e,style:n}),this.element.remove()})}}const uw={value:"value",dataValue:"data-value"};function Nm(i){const{HTMLTrigger:t,HTMLField:e,onSuccess:n,onFailed:s}=i;function r(d){n&&n(),Pn.push({title:"Copied",content:`${d}`,style:"success"})}function a(){s&&s(),Pn.push({title:"Copied",content:"Failed",style:"alert"})}function l(d){const p=document.queryCommandSupported&&document.queryCommandSupported("copy"),g=document.createElement("input");if(g.type="hidden",g.value=d,document.body.appendChild(g),p){g.select();try{return r(d),document.execCommand("copy")}catch(v){return a(),console.log(v),!1}finally{document.body.removeChild(g)}}return!1}async function h(){const d=e==null?void 0:e.getAttribute(uw.dataValue),p=e==null?void 0:e.value,g=d||p;if(g)try{await navigator.clipboard.writeText(g),r(g)}catch{l(g)}}t&&t.addEventListener("click",h);function c(){t&&t.removeEventListener("click",h)}return{destroy:c}}const hw=({name:i,value:t,label:e,shortLabel:n,tag:s,checked:r})=>{const a=` `,l=document.createElement("div");return l.innerHTML=a,l.firstElementChild},cn={open:"SELECT_OPEN",close:"SELECT_CLOSE",change:"SELECT_CHANGE"},Re={inputComponent:".__select-input-field__",inputContainer:".__input-container__",field:".__input-field__",list:".__select-input-list__",radio:".__select-input-radio__",option:".__select-input-option__",value:".__select-input-value__"},le={jsonOptionsKey:"data-json-options-key",options:"data-options",shortSelected:"data-short-selected",label:"data-label",shortLabel:"data-short-label",tag:"data-tag",value:"data-value",category:"data-category-name",categoryId:"data-category-id",badge:"data-with-badge"},Ue={activeItem:"select-input_active-item",open:"select-input_open",openRt:"select-input_open-rt",badge:"input_badge"},Rd=47,Eh=class Eh extends Kt{constructor(t,{scrollListSelector:e}={}){super(t),this.activeOption=null,this.allOptions=JSON.parse(this.element.getAttribute(le.options)||"[]").map(n=>({...n,shortLabel:n.short_label,categoryId:n.category_id,categoryName:n.category_name})),this.fieldElement=this.element.querySelector(Re.field),this.inputComponent=this.element.querySelector(Re.inputComponent),this.inputContainer=this.element.querySelector(Re.inputContainer),this.listElement=this.element.querySelector(Re.list),this.isBadged=!!this.element.getAttribute(le.badge),this.isShortSelected=!!this.element.hasAttribute(le.shortSelected),this.optionsCollections=Array.from(this.element.querySelectorAll(Re.option)),this.listScrollStart=0,this.listScrollEnd=20,this.jsonOptionsKey=this.element.getAttribute(le.jsonOptionsKey),this.jsonOptions=[],this.isVirtualized=!1,this.inputValue=this.element.querySelector(Re.value),this.scrolledList=e?this.element.querySelector(e)||this.listElement:this.listElement,this.onListClick=this.onListClick.bind(this),this.initOptions(),this.addListeners()}getActiveOption(){return this.activeOption}fixDropdownOffset(t=0){const e=this.inputContainer.getBoundingClientRect().height;this.listElement.style.top=`${e+t}px`}open(){this.element.classList.add(Ue.open),this.isRightSidePosition()&&this.element.classList.add(Ue.openRt),this.trigger(cn.open)}close(){this.element.classList.remove(Ue.open),this.element.classList.remove(Ue.openRt),this.trigger(cn.close)}select(t){var e;if(t){const n=this.getComponentByNode(he,this.inputComponent);this.activeOption=t,this.fieldElement.value=this.isShortSelected&&t.shortLabel||t.label,this.setHiddenValue(t.value),this.isBadged&&((e=this.inputComponent)==null||e.classList.add(Ue.badge)),(n==null?void 0:n.size)==="content"&&n.setContentSize(),this.close()}}setHiddenValue(t,{isTriggerDispatch:e}={isTriggerDispatch:!0}){var n;((n=this.inputValue)==null?void 0:n.value)!=t&&this.inputValue&&(this.inputValue.value=t,this.inputValue.setAttribute("value",t),e&&(this.inputValue.dispatchEvent(new Event("change")),this.inputValue.dispatchEvent(new Event("input"))))}onFocusOut(){setTimeout(()=>{this.element.contains(document.activeElement)||this.close()})}onListKeyUp(t){if(t.code=="Enter"){const e=t.target,n={...t};n.target=e,this.onChange(n)}}onListScroll(t){var r,a;const n=t.target.scrollTop,s=((a=(r=this.element.querySelector(Re.option))==null?void 0:r.getBoundingClientRect())==null?void 0:a.height)||Rd;this.listScrollStart=Math.floor(n/s),this.listScrollEnd=this.listScrollStart+20,this.render()}render(){var n;const t=this.allOptions.slice(this.listScrollStart,Math.min(this.listScrollEnd,this.allOptions.length)),e=this.element.querySelectorAll(Re.option);for(let s=0;s`${s.value}`===e.getAttribute(le.value));this.optionsCollections.forEach(s=>{s.classList.remove(Ue.activeItem)}),e.classList.add(Ue.activeItem),this.select(n),this.trigger(cn.change,{option:n})}reset(){var t;this.activeOption=null,this.optionsCollections.forEach(e=>{e.classList.remove(Ue.activeItem)}),this.setHiddenValue(""),(t=this.inputComponent)==null||t.classList.remove(Ue.badge)}isRightSidePosition(){return window.innerWidth/2{var p;const a=r.getAttribute(le.label),l=r.getAttribute(le.shortLabel),h=r.getAttribute(le.tag),c=r.getAttribute(le.value),d={label:a,shortLabel:l,value:c,tag:h};return r.classList.contains(Ue.activeItem)?(t=r,this.isBadged&&((p=this.inputComponent)==null||p.classList.add(Ue.badge))):r.classList.remove(Ue.activeItem),d});const e=(s=(n=he.getState().components)==null?void 0:n.find(r=>r instanceof fm))==null?void 0:s.getData();if(this.isVirtualized&&e&&this.render(),t){const r=t,a={...new Event("change")};a.target=r,this.onChange(a);return}this.setHiddenValue("",{isTriggerDispatch:!1}),this.fieldElement.value="",this.optionsCollections.forEach(r=>{r.classList.remove(Ue.activeItem)})}addListeners(){this.element.addEventListener("focusin",this.open.bind(this),{signal:this.abortController.signal}),this.element.addEventListener("focusout",this.onFocusOut.bind(this),{signal:this.abortController.signal}),this.scrolledList.addEventListener("keyup",this.onListKeyUp.bind(this),{signal:this.abortController.signal}),this.scrolledList.addEventListener("click",this.onListClick.bind(this),{signal:this.abortController.signal}),this.isVirtualized&&this.scrolledList.addEventListener("scroll",this.onListScroll.bind(this),{signal:this.abortController.signal}),document.addEventListener("click",this.onClickOutside.bind(this),{signal:this.abortController.signal})}};Eh.SELECTORS=Re;let Gr=Eh;const dw=()=>{const i=` `,t=document.createElement("div");return t.innerHTML=i,t.firstElementChild},xn={searchInput:".__autocomplete-field__",inputComponent:".__select-input-field__",listContainer:".__select-input-items__",category:".autocomplete-input__category",categoryLabel:".__autocomplete-category-label__",inputLabel:".__input-label__",checkIcon:".__check-icon__"},Bd={emptyText:"data-empty-text",placeholder:"data-placeholder"},ie={loading:"autocomplete-input_loading",empty:"autocomplete-input_empty",emptyList:"select-input__items_none",hiddenItem:"select-input__option_hidden",activeItem:"select-input_active-item",selectedOption:"autocomplete-input__option_selected",hiddenCategory:"autocomplete-input__category_hidden",badge:"input_badge"};class ju extends Gr{constructor(t,e={queryDebounceDelay:0}){var n;super(t,{scrollListSelector:xn.listContainer}),this.options=[],this.isInit=!1,this.queryDebounceDelay=0,this.placeholderLabel="",this.emptyText="",this.countMatches=0,this.queryDebounceDelay=e.queryDebounceDelay,this.searchInput=t.querySelector(xn.searchInput),this.listContainer=t.querySelector(xn.listContainer),this.categoryCollection=t.querySelectorAll(xn.category),this.inputLabel=t.querySelector(xn.inputLabel),this.cacheLabel=((n=this.inputLabel)==null?void 0:n.textContent)||"",this.placeholderLabel=this.element.getAttribute(Bd.placeholder)||"",this.emptyText=this.element.getAttribute(Bd.emptyText)||"",this.initOptions(),this.addAutocompleteListeners()}setSearchLoading(t){this.element.classList[t?"add":"remove"](ie.loading)}onChangeSelect(t){var h,c;const e=(h=t.detail)==null?void 0:h.option;if(!e){console.log("Can`t parse option from event",t);return}const n=e.value,s=this.element.querySelector(`.${ie.selectedOption}`);s&&((c=s==null?void 0:s.querySelector(xn.checkIcon))==null||c.remove(),s.classList.remove(ie.selectedOption));const r=this.element.querySelector(`.autocomplete-input__option[data-value="${n}"]`);r&&(r==null||r.classList.add(ie.selectedOption),r==null||r.prepend(dw())),this.inputLabel&&e.categoryName&&(this.inputLabel.textContent=`${this.placeholderLabel} | ${e.categoryName}`),this.countMatches===1&&(this.searchInput.value="",this.onFilter());const a=this.getComponentByNode(he,this.inputComponent),l=a.getInput();l.value=e.label,this.inputLabel&&e.categoryName&&(l.placeholder=this.inputLabel.textContent),(a==null?void 0:a.size)==="content"&&a.setContentSize()}initOptions(){if(this.isInit===void 0)return;let t=null;if(this.options=this.optionsCollections.map(e=>{var p;const n=e.getAttribute(le.label),s=e.getAttribute(le.shortLabel),r=e.getAttribute(le.tag),a=e.getAttribute(le.value),l=e.getAttribute(le.category),h=e.getAttribute(le.categoryId),c={label:n,shortLabel:s,value:a,tag:r,categoryName:l,categoryId:h},d=e.classList.contains(ie.activeItem);if(d){this.activeOption=c,this.fieldElement.value=this.isShortSelected&&c.shortLabel||c.label,t=e;const g=this.element.querySelector(`.autocomplete-input__option[data-value="${a}"]`);g==null||g.classList.add(ie.selectedOption),this.isBadged&&((p=this.inputComponent)==null||p.classList.add(ie.badge))}else e.classList.remove(ie.selectedOption);return d&&this.inputLabel&&l&&!this.cacheLabel&&(this.inputLabel.textContent=`${this.cacheLabel} | ${l}`),c}),t){const e=t,n={...new Event("change")};n.target=e,this.onChange(n)}else this.setHiddenValue("",{isTriggerDispatch:!1}),this.fieldElement.value="",this.optionsCollections.forEach(e=>{e.classList.remove(ie.selectedOption)});this.isInit=!0}onFilter(){const t=[],e=this.searchInput.value.toLowerCase();this.countMatches=0,this.options.forEach(n=>{var a;const s=this.listContainer.querySelector(`[data-value="${n.value}"]`);if(!s)return;const r=n.label.toLowerCase().includes(e)||n.tag&&n.tag.toLowerCase().includes(e)||((a=n.categoryName)==null?void 0:a.toLowerCase().includes(e));if(r?(this.countMatches+=1,s.classList.remove(ie.hiddenItem)):s.classList.add(ie.hiddenItem),r&&n.categoryId&&!t.includes(n.categoryId)){t.push(n.categoryId);const l=this.listContainer.querySelector(`${xn.category}[data-category-id="${n.categoryId}"]`);l&&l.classList.remove(ie.hiddenCategory)}}),this.categoryCollection.forEach(n=>{const s=n.getAttribute(le.categoryId);Array.from(this.listContainer.querySelectorAll(`label:not(.${ie.hiddenItem})[data-category-id="${s}"]`)).length>0||n.classList.add(ie.hiddenCategory)}),this.element.classList[this.countMatches===0&&this.searchInput.value.length>0?"add":"remove"](ie.empty),this.queryDebounceDelay>0&&this.setSearchLoading(!1)}onFieldFocus(){this.searchInput.focus()}addAutocompleteListeners(){this.searchInput.addEventListener("input",()=>{this.queryDebounceDelay>0&&this.setSearchLoading(!0)},{signal:this.abortController.signal}),this.searchInput.addEventListener("input",wb(this.onFilter.bind(this),this.queryDebounceDelay),{signal:this.abortController.signal}),this.on(cn.change,this.onChangeSelect.bind(this)),this.on(cn.open,this.onFieldFocus.bind(this)),this.element.classList[this.countMatches===0&&this.searchInput.value.length>0?"add":"remove"](ie.empty),this.searchInput.value&&this.onFilter()}}const fw=({categoryId:i,categoryName:t,value:e,label:n})=>` ${n} `,pw={tagsList:".__autocomplete-multiselect-input-tags__",tag:".__autocomplete-multiselect-input-tag__",tagClose:".__autocomplete-multiselect-input-tag-close__"},gr={value:"data-value",categoryId:"data-category-id",mode:"data-mode",modePluralMap:"data-plural",modePluralRules:"data-plural-rules"};class zm extends ju{constructor(t,e={queryDebounceDelay:0}){super(t,{queryDebounceDelay:e.queryDebounceDelay}),this.tags=this.element.querySelector(pw.tagsList),this.selectedOptions=[],this.isInitMultiSelect=!1,this.mode=this.element.getAttribute(gr.mode),this.modePluralRules=this.element.getAttribute(gr.modePluralRules),this.modePluralMap=JSON.parse(this.element.getAttribute(gr.modePluralMap)||"[]"),this.optionsInputCollections=Array.from(this.element.querySelectorAll(Re.radio)),this.pluralSuffixes=this.modePluralMap.length?new Map(this.modePluralMap):null,this.ordinalRules=new Intl.PluralRules(this.modePluralRules||"en-US",{type:"cardinal"}),this.onClickTag=this.onClickTag.bind(this),this.onChange=this.onChange.bind(this),this.initOptions(),this.scrolledList.removeEventListener("click",this.onListClick),this.optionsInputCollections.forEach(n=>n.addEventListener("change",this.onChange,{signal:this.abortController.signal}))}select(t){var e;if(t){const n=this.getComponentByNode(he,this.inputComponent);if(this.activeOption=t,this.selectedOptions=t.checked?[...this.selectedOptions,t]:this.selectedOptions.filter(s=>s.value!==t.value),this.setFieldElementValue(this.selectedOptions),this.isBadged&&((e=this.inputComponent)==null||e.classList.add(ie.badge)),(n==null?void 0:n.size)==="content"&&n.setContentSize(),t.checked){const s=this.createTag({categoryId:t.categoryId,categoryName:t.categoryName,value:t.value,label:this.isShortSelected&&t.shortLabel||t.label});this.tags.appendChild(s)}else{const s=this.tags.querySelector(`[${gr.value}="${t.value}"]`);s==null||s.remove()}this.fixDropdownOffset(-2)}}formatOrdinals(t){if(t===0)return"";if(this.pluralSuffixes){const e=this.ordinalRules.select(t),n=this.pluralSuffixes.get(e);return`${t} ${n}`}return`${t} selected`}destroy(){super.destroy(),this.isInitMultiSelect=void 0}onFilter(){const t=[],e=this.searchInput.value.toLowerCase();this.countMatches=0,this.options.forEach(n=>{var a,l;const s=(a=this.listContainer.querySelector(`[value="${n.value}"]`))==null?void 0:a.parentElement;if(!s)return;const r=n.label.toLowerCase().includes(e)||n.tag&&n.tag.toLowerCase().includes(e)||((l=n.categoryName)==null?void 0:l.toLowerCase().includes(e));if(r?(this.countMatches+=1,s.classList.remove(ie.hiddenItem)):s.classList.add(ie.hiddenItem),r&&n.categoryId&&!t.includes(n.categoryId)){t.push(n.categoryId);const h=this.listContainer.querySelector(`${xn.category}[data-category-id="${n.categoryId}"]`);h&&h.classList.remove(ie.hiddenCategory)}}),this.categoryCollection.forEach(n=>{const s=n.getAttribute(le.categoryId);Array.from(this.listContainer.querySelectorAll(`label:not(.${ie.hiddenItem}) [data-category-id="${s}"]`)).length>0||n.classList.add(ie.hiddenCategory)}),this.element.classList[this.countMatches===0&&this.searchInput.value.length>0?"add":"remove"](ie.empty)}onChange(t){const e=t.target;if(e instanceof HTMLInputElement){const n=this.options.find(r=>`${r.value}`===e.value);!this.selectedOptions.find(r=>r.value===n.value)&&!e.checked&&(n.checked=!0,e.checked=!0),n.checked=e.checked,n.checked?e.setAttribute("checked","checked"):e.removeAttribute("checked"),this.select(n),this.trigger(cn.change,{option:n})}}onChangeSelect(t){var r;const e=t.detail.option,n=e.value,s=this.element.querySelector(`input.select-input__option-radio[value="${n}"]`);s&&((r=s.parentElement)==null||r.classList[e.checked?"add":"remove"](ie.selectedOption)),this.countMatches===1&&(this.searchInput.value="",this.onFilter(),this.close()),this.selectedOptions.length===this.options.length&&this.close()}onClickTag(t){t.preventDefault(),t.stopPropagation();const e=t.currentTarget,n=e.getAttribute(gr.value),s=this.element.querySelector(`input.select-input__option-radio[value="${n}"]`);s.checked=!1;const r=this.selectedOptions.find(a=>a.value===n);r&&(r.checked=!1,e==null||e.remove()),s.dispatchEvent(new Event("change"))}createTag(t){const e=fw(t),n=document.createElement("div");n.innerHTML=e;const s=n.firstElementChild;return s.addEventListener("click",this.onClickTag,{signal:this.abortController.signal}),s}setFieldElementValue(t){switch(this.mode){case"tags":{this.fieldElement.value=t.map(e=>this.isShortSelected&&e.shortLabel||e.label).join(", ");break}case"count":this.fieldElement.value=this.formatOrdinals(t.length)}}initOptions(){if(this.isInitMultiSelect||this.isInitMultiSelect===void 0)return;let t=[];this.tags.replaceChildren(),this.options=this.optionsInputCollections.map(e=>{var p,g;const n=e.getAttribute(le.label),s=e.getAttribute(le.shortLabel),r=e.getAttribute(le.tag),a=e.value,l=e.checked,h=e.getAttribute(le.category),c=e.getAttribute(le.categoryId),d={label:n,shortLabel:s,value:a,tag:r,categoryName:h,categoryId:c,checked:l};if(e.hasAttribute("checked")){this.activeOption=d,t.push(e);const v=this.element.querySelector(`input.select-input__option-radio[value="${a}"]`);(p=v==null?void 0:v.parentElement)==null||p.classList.add(ie.selectedOption),this.isBadged&&((g=this.inputComponent)==null||g.classList.add(ie.badge))}else e.removeAttribute("checked"),e.checked=!1,d.checked=!1;return d}),t.forEach(e=>{const n={...new Event("change")};n.target=e,this.onChange(n)}),this.selectedOptions.length===0?this.fieldElement.value=this.formatOrdinals(0):this.fieldElement.value=this.formatOrdinals(this.selectedOptions.length),this.element.classList[this.countMatches===0&&this.searchInput.value.length>0?"add":"remove"](ie.empty),this.searchInput.value&&this.onFilter(),this.isInitMultiSelect=!0}}const mw=({checked:i,data:t})=>` `,gw=({id:i,name:t})=>` ${t} `,vw={empty:"autocomplete-input_empty"},Vi=class Vi extends ju{constructor(t){if(super(t,{queryDebounceDelay:Vi.DEBOUNCE_DELAY}),this.apiUrl=this.element.getAttribute(Vi.DATA_SET.apiUrl),!this.apiUrl){console.error("AsyncAutocompleteInput: api url must be provided");return}}static createElementFromTemplate(t){const e=document.createElement("div");return e.innerHTML=t,e.firstElementChild}fetch(t){const e=this.apiUrl||this.element.getAttribute(Vi.DATA_SET.apiUrl);return Vm({baseURL:`${e}${t}`}).get("").then(({data:n})=>({data:n.map(({category_id:r,category_name:a,label:l,short_label:h,value:c,tag:d})=>({label:l,value:c,tag:d,shortLabel:h,categoryId:r,categoryName:a}))})).finally(()=>this.setSearchLoading(!1))}clearList(){this.optionsCollections=[],this.listContainer.replaceChildren()}onSuccessResponse({data:t}){this.options=t,this.allOptions=t,this.clearList(),this.element.classList[this.options.length===0&&this.searchInput.value.length>0?"add":"remove"](vw.empty),this.options.forEach(e=>{var a;const n=this.listContainer.querySelector(`[${Vi.DATA_SET.categoryId}="${e.categoryId}"]`);if(e.categoryId&&!n){const l=gw({id:e.categoryId,name:e.categoryName}),h=Vi.createElementFromTemplate(l);this.listContainer.appendChild(h)}const s=mw({checked:((a=this.activeOption)==null?void 0:a.value)===e.value,data:e}),r=Vi.createElementFromTemplate(s);this.listContainer.appendChild(r),this.optionsCollections=[...this.optionsCollections,r],this.countMatches=this.options.length})}onFailedResponse(t){console.log(`AsyncAutocompleteInput: fetch error: ${t}`)}onFilter(){const t=this.searchInput.value.toLowerCase();this.fetch(t).then(this.onSuccessResponse.bind(this)).catch(this.onFailedResponse.bind(this))}addListeners(){super.addListeners()}};Vi.DATA_SET={apiUrl:"data-api-url",categoryId:"data-category-id"},Vi.DEBOUNCE_DELAY=500;let Xc=Vi;const _w=({inputName:i,checked:t,data:e})=>`
${e.label} ${e.tag||""}
`,yw=({id:i,name:t})=>` ${t} `,bw={empty:"autocomplete-input_empty"},mi=class mi extends zm{constructor(t){if(super(t,{queryDebounceDelay:mi.DEBOUNCE_DELAY}),this.inputName=this.element.getAttribute(mi.DATA_SET.name),this.apiUrl=this.element.getAttribute(mi.DATA_SET.apiUrl),!this.apiUrl){console.error("AsyncMultiselectInput: api url must be provided");return}this.onMultiselectListClick=this.onMultiselectListClick.bind(this),this.scrolledList.addEventListener("click",this.onMultiselectListClick,{signal:this.abortController.signal})}static createElementFromTemplate(t){const e=document.createElement("div");return e.innerHTML=t,e.firstElementChild}fetch(t){this.setSearchLoading(!0);const e=this.apiUrl||this.element.getAttribute(mi.DATA_SET.apiUrl);return Vm({baseURL:`${e}${t}`}).get("").then(({data:n})=>({data:n.map(({category_id:r,category_name:a,label:l,short_label:h,value:c,tag:d})=>({label:l,value:c,tag:d,shortLabel:h,categoryId:r,categoryName:a}))})).finally(()=>this.setSearchLoading(!1))}clearList(){this.optionsCollections=[],this.listContainer.replaceChildren()}onMultiselectListClick(t){const e=t.target.closest(Re.option);if(e){const n=e.querySelector(Re.radio);n.checked=!n.checked;const s={...new Event("change")};s.target=n,this.onChange(s)}}onClickTag(t){t.preventDefault(),t.stopPropagation();const e=t.currentTarget,n=e.getAttribute(mi.DATA_SET.value),s=this.element.querySelector(`input.select-input__option-radio[value="${n}"]`);s.checked=!1;const r=this.selectedOptions.find(l=>l.value===n);r&&(r.checked=!1,e==null||e.remove());const a={...new Event("change")};a.target=s,this.onChange(a)}onSuccessResponse({data:t}){this.options=t,this.allOptions=t,this.clearList(),this.element.classList[this.options.length===0&&this.searchInput.value.length>0?"add":"remove"](bw.empty),this.options.forEach(e=>{const n=this.listContainer.querySelector(`[${mi.DATA_SET.categoryId}="${e.categoryId}"]`);if(e.categoryId&&!n){const a=yw({id:e.categoryId,name:e.categoryName}),l=mi.createElementFromTemplate(a);this.listContainer.appendChild(l)}const s=_w({inputName:this.inputName||"",checked:this.selectedOptions.map(a=>a.value).includes(e.value),data:e}),r=mi.createElementFromTemplate(s);this.listContainer.appendChild(r),this.optionsCollections=[...this.optionsCollections,r],this.countMatches=this.options.length})}onFailedResponse(t){console.log(`AsyncAutocompleteInput: fetch error: ${t}`)}onFilter(){const t=this.searchInput.value.toLowerCase();this.fetch(t).then(this.onSuccessResponse.bind(this)).catch(this.onFailedResponse.bind(this))}addListeners(){super.addListeners()}};mi.DATA_SET={name:"data-name",apiUrl:"data-api-url",categoryId:"data-category-id",value:"data-value"},mi.DEBOUNCE_DELAY=500;let Jc=mi;class ww extends Gr{constructor(t){super(t),this.activeOption=null,this.options=[],this.isInit=!1,this.optionsInputCollections=Array.from(this.element.querySelectorAll(Re.radio)),this.selectedOptions=[],this.onPressEnter=this.onPressEnter.bind(this),this.initOptions(),this.addMultiselectListeners()}select(t){var e;if(t){const n=this.getComponentByNode(he,this.inputComponent);this.activeOption=t,this.selectedOptions=t.checked?[...this.selectedOptions,t]:this.selectedOptions.filter(s=>s.value!==t.value),this.fieldElement.value=this.selectedOptions.map(s=>s.label).join(", "),this.isBadged&&((e=this.inputComponent)==null||e.classList.add(Ue.badge)),(n==null?void 0:n.size)==="content"&&n.setContentSize()}}onChange(t){const e=t.target,n=this.options.find(s=>s.value===e.value);n.checked=e.checked,this.select(n),this.trigger(cn.change,{option:n})}initOptions(){this.isInit!==void 0&&(this.options=this.optionsInputCollections.map(t=>{var l;const e=t.getAttribute(le.label),n=t.getAttribute(le.tag),s=t.value,r=t.checked,a={label:e,value:s,tag:n,checked:r};return t.checked&&(this.activeOption=a,this.selectedOptions.push(a),this.isBadged&&((l=this.inputComponent)==null||l.classList.add(Ue.badge))),a}),this.fieldElement.value=this.selectedOptions.map(t=>t.label).join(", "),this.isInit=!0)}onPressEnter(t){var s;if(t.key!=="Enter")return;const e={...new Event("change")},n=(s=document.activeElement)==null?void 0:s.querySelector(Re.radio);n&&(n.checked=!n.checked,e.target=n,this.onChange(e))}addMultiselectListeners(){this.element.addEventListener("keyup",this.onPressEnter),this.scrolledList.removeEventListener("click",this.onListClick),this.optionsInputCollections.forEach(t=>{t.addEventListener("change",this.onChange.bind(this))})}}function An(i){return typeof i=="string"||i instanceof String}function Vd(i){var t;return typeof i=="object"&&i!=null&&(i==null||(t=i.constructor)==null?void 0:t.name)==="Object"}function $m(i,t){return Array.isArray(t)?$m(i,(e,n)=>t.includes(n)):Object.entries(i).reduce((e,n)=>{let[s,r]=n;return t(r,s)&&(e[s]=r),e},{})}const Tt={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function xw(i){switch(i){case Tt.LEFT:return Tt.FORCE_LEFT;case Tt.RIGHT:return Tt.FORCE_RIGHT;default:return i}}function ic(i){return i.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function Fa(i,t){if(t===i)return!0;const e=Array.isArray(t),n=Array.isArray(i);let s;if(e&&n){if(t.length!=i.length)return!1;for(s=0;s!r.startsWith("_")),mask:t.constructor,_mask:n,...e}}}return Vd(i)?{...i}:{mask:i}}function hn(i){if(Ot.Masked&&i instanceof Ot.Masked)return i;const t=Zr(i),e=Hm(t.mask);if(!e)throw new Error("Masked class is not found for provided mask "+t.mask+", appropriate module needs to be imported manually before creating mask.");return t.mask===e&&delete t.mask,t._mask&&(t.mask=t._mask,delete t._mask),new e(t)}Ot.createMask=hn;class Uu{get selectionStart(){let t;try{t=this._unsafeSelectionStart}catch{}return t??this.value.length}get selectionEnd(){let t;try{t=this._unsafeSelectionEnd}catch{}return t??this.value.length}select(t,e){if(!(t==null||e==null||t===this.selectionStart&&e===this.selectionEnd))try{this._unsafeSelect(t,e)}catch{}}get isActive(){return!1}}Ot.MaskElement=Uu;const Nd=90,kw=89;class sl extends Uu{constructor(t){super(),this.input=t,this._onKeydown=this._onKeydown.bind(this),this._onInput=this._onInput.bind(this),this._onBeforeinput=this._onBeforeinput.bind(this),this._onCompositionEnd=this._onCompositionEnd.bind(this)}get rootElement(){var t,e,n;return(t=(e=(n=this.input).getRootNode)==null?void 0:e.call(n))!=null?t:document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(t){this.input.addEventListener("keydown",this._onKeydown),this.input.addEventListener("input",this._onInput),this.input.addEventListener("beforeinput",this._onBeforeinput),this.input.addEventListener("compositionend",this._onCompositionEnd),this.input.addEventListener("drop",t.drop),this.input.addEventListener("click",t.click),this.input.addEventListener("focus",t.focus),this.input.addEventListener("blur",t.commit),this._handlers=t}_onKeydown(t){if(this._handlers.redo&&(t.keyCode===Nd&&t.shiftKey&&(t.metaKey||t.ctrlKey)||t.keyCode===kw&&t.ctrlKey))return t.preventDefault(),this._handlers.redo(t);if(this._handlers.undo&&t.keyCode===Nd&&(t.metaKey||t.ctrlKey))return t.preventDefault(),this._handlers.undo(t);t.isComposing||this._handlers.selectionChange(t)}_onBeforeinput(t){if(t.inputType==="historyUndo"&&this._handlers.undo)return t.preventDefault(),this._handlers.undo(t);if(t.inputType==="historyRedo"&&this._handlers.redo)return t.preventDefault(),this._handlers.redo(t)}_onCompositionEnd(t){this._handlers.input(t)}_onInput(t){t.isComposing||this._handlers.input(t)}unbindEvents(){this.input.removeEventListener("keydown",this._onKeydown),this.input.removeEventListener("input",this._onInput),this.input.removeEventListener("beforeinput",this._onBeforeinput),this.input.removeEventListener("compositionend",this._onCompositionEnd),this.input.removeEventListener("drop",this._handlers.drop),this.input.removeEventListener("click",this._handlers.click),this.input.removeEventListener("focus",this._handlers.focus),this.input.removeEventListener("blur",this._handlers.commit),this._handlers={}}}Ot.HTMLMaskElement=sl;class Ew extends sl{constructor(t){super(t),this.input=t}get _unsafeSelectionStart(){return this.input.selectionStart!=null?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(t,e){this.input.setSelectionRange(t,e)}get value(){return this.input.value}set value(t){this.input.value=t}}Ot.HTMLMaskElement=sl;class jm extends sl{get _unsafeSelectionStart(){const t=this.rootElement,e=t.getSelection&&t.getSelection(),n=e&&e.anchorOffset,s=e&&e.focusOffset;return s==null||n==null||ns?n:s}_unsafeSelect(t,e){if(!this.rootElement.createRange)return;const n=this.rootElement.createRange();n.setStart(this.input.firstChild||this.input,t),n.setEnd(this.input.lastChild||this.input,e);const s=this.rootElement,r=s.getSelection&&s.getSelection();r&&(r.removeAllRanges(),r.addRange(n))}get value(){return this.input.textContent||""}set value(t){this.input.textContent=t}}Ot.HTMLContenteditableMaskElement=jm;class rl{constructor(){this.states=[],this.currentIndex=0}get currentState(){return this.states[this.currentIndex]}get isEmpty(){return this.states.length===0}push(t){this.currentIndexrl.MAX_LENGTH&&this.states.shift(),this.currentIndex=this.states.length-1}go(t){return this.currentIndex=Math.min(Math.max(this.currentIndex+t,0),this.states.length-1),this.currentState}undo(){return this.go(-1)}redo(){return this.go(1)}clear(){this.states.length=0,this.currentIndex=0}}rl.MAX_LENGTH=100;class Cw{constructor(t,e){this.el=t instanceof Uu?t:t.isContentEditable&&t.tagName!=="INPUT"&&t.tagName!=="TEXTAREA"?new jm(t):new Ew(t),this.masked=hn(e),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new rl,this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._onFocus=this._onFocus.bind(this),this._onClick=this._onClick.bind(this),this._onUndo=this._onUndo.bind(this),this._onRedo=this._onRedo.bind(this),this.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this.updateValue(),this._onChange()}maskEquals(t){var e;return t==null||((e=this.masked)==null?void 0:e.maskEquals(t))}get mask(){return this.masked.mask}set mask(t){if(this.maskEquals(t))return;if(!(t instanceof Ot.Masked)&&this.masked.constructor===Hm(t)){this.masked.updateOptions({mask:t});return}const e=t instanceof Ot.Masked?t:hn({mask:t});e.unmaskedValue=this.masked.unmaskedValue,this.masked=e}get value(){return this._value}set value(t){this.value!==t&&(this.masked.value=t,this.updateControl("auto"))}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(t){this.unmaskedValue!==t&&(this.masked.unmaskedValue=t,this.updateControl("auto"))}get rawInputValue(){return this._rawInputValue}set rawInputValue(t){this.rawInputValue!==t&&(this.masked.rawInputValue=t,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(t){this.masked.typedValueEquals(t)||(this.masked.typedValue=t,this.updateControl("auto"))}get displayValue(){return this.masked.displayValue}_bindEvents(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange,undo:this._onUndo,redo:this._onRedo})}_unbindEvents(){this.el&&this.el.unbindEvents()}_fireEvent(t,e){const n=this._listeners[t];n&&n.forEach(s=>s(e))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(t){!this.el||!this.el.isActive||(this.el.select(t,t),this._saveSelection())}_saveSelection(){this.displayValue!==this.el.value&&console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."),this._selection={start:this.selectionStart,end:this.cursorPos}}updateValue(){this.masked.value=this.el.value,this._value=this.masked.value,this._unmaskedValue=this.masked.unmaskedValue,this._rawInputValue=this.masked.rawInputValue}updateControl(t){const e=this.masked.unmaskedValue,n=this.masked.value,s=this.masked.rawInputValue,r=this.displayValue,a=this.unmaskedValue!==e||this.value!==n||this._rawInputValue!==s;this._unmaskedValue=e,this._value=n,this._rawInputValue=s,this.el.value!==r&&(this.el.value=r),t==="auto"?this.alignCursor():t!=null&&(this.cursorPos=t),a&&this._fireChangeEvents(),!this._historyChanging&&(a||this.history.isEmpty)&&this.history.push({unmaskedValue:e,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(t){const{mask:e,...n}=t,s=!this.maskEquals(e),r=this.masked.optionsIsChanged(n);s&&(this.mask=e),r&&this.masked.updateOptions(n),(s||r)&&this.updateControl()}updateCursor(t){t!=null&&(this.cursorPos=t,this._delayUpdateCursor(t))}_delayUpdateCursor(t){this._abortUpdateCursor(),this._changingCursorPos=t,this._cursorChanging=setTimeout(()=>{this.el&&(this.cursorPos=this._changingCursorPos,this._abortUpdateCursor())},10)}_fireChangeEvents(){this._fireEvent("accept",this._inputEvent),this.masked.isComplete&&this._fireEvent("complete",this._inputEvent)}_abortUpdateCursor(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)}alignCursor(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,Tt.LEFT))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(t,e){return this._listeners[t]||(this._listeners[t]=[]),this._listeners[t].push(e),this}off(t,e){if(!this._listeners[t])return this;if(!e)return delete this._listeners[t],this;const n=this._listeners[t].indexOf(e);return n>=0&&this._listeners[t].splice(n,1),this}_onInput(t){this._inputEvent=t,this._abortUpdateCursor();const e=new Sw({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),n=this.masked.rawInputValue,s=this.masked.splice(e.startChangePos,e.removed.length,e.inserted,e.removeDirection,{input:!0,raw:!0}).offset,r=n===this.masked.rawInputValue?e.removeDirection:Tt.NONE;let a=this.masked.nearestInputPos(e.startChangePos+s,r);r!==Tt.NONE&&(a=this.masked.nearestInputPos(a,Tt.NONE)),this.updateControl(a),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(t){t.preventDefault(),t.stopPropagation()}_onFocus(t){this.alignCursorFriendly()}_onClick(t){this.alignCursorFriendly()}_onUndo(){this._applyHistoryState(this.history.undo())}_onRedo(){this._applyHistoryState(this.history.redo())}_applyHistoryState(t){t&&(this._historyChanging=!0,this.unmaskedValue=t.unmaskedValue,this.el.select(t.selection.start,t.selection.end),this._saveSelection(),this._historyChanging=!1)}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}}Ot.InputMask=Cw;class Vt{static normalize(t){return Array.isArray(t)?t:[t,new Vt]}constructor(t){Object.assign(this,{inserted:"",rawInserted:"",tailShift:0,skip:!1},t)}aggregate(t){return this.inserted+=t.inserted,this.rawInserted+=t.rawInserted,this.tailShift+=t.tailShift,this.skip=this.skip||t.skip,this}get offset(){return this.tailShift+this.inserted.length}get consumed(){return!!this.rawInserted||this.skip}equals(t){return this.inserted===t.inserted&&this.tailShift===t.tailShift&&this.rawInserted===t.rawInserted&&this.skip===t.skip}}Ot.ChangeDetails=Vt;class $i{constructor(t,e,n){t===void 0&&(t=""),e===void 0&&(e=0),this.value=t,this.from=e,this.stop=n}toString(){return this.value}extend(t){this.value+=String(t)}appendTo(t){return t.append(this.toString(),{tail:!0}).aggregate(t._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(t){Object.assign(this,t)}unshift(t){if(!this.value.length||t!=null&&this.from>=t)return"";const e=this.value[0];return this.value=this.value.slice(1),e}shift(){if(!this.value.length)return"";const t=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),t}}class Ne{constructor(t){this._value="",this._update({...Ne.DEFAULTS,...t}),this._initialized=!0}updateOptions(t){this.optionsIsChanged(t)&&this.withValueRefresh(this._update.bind(this,t))}_update(t){Object.assign(this,t)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value}reset(){this._value=""}get value(){return this._value}set value(t){this.resolve(t,{input:!0})}resolve(t,e){e===void 0&&(e={input:!0}),this.reset(),this.append(t,e,""),this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(t){this.resolve(t,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(t){this.format?this.value=this.format(t,this):this.unmaskedValue=String(t)}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:!0})}set rawInputValue(t){this.resolve(t,{raw:!0})}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(t,e){return t}totalInputPositions(t,e){return t===void 0&&(t=0),e===void 0&&(e=this.displayValue.length),Math.min(this.displayValue.length,e-t)}extractInput(t,e,n){return t===void 0&&(t=0),e===void 0&&(e=this.displayValue.length),this.displayValue.slice(t,e)}extractTail(t,e){return t===void 0&&(t=0),e===void 0&&(e=this.displayValue.length),new $i(this.extractInput(t,e),t)}appendTail(t){return An(t)&&(t=new $i(String(t))),t.appendTo(this)}_appendCharRaw(t,e){return t?(this._value+=t,new Vt({inserted:t,rawInserted:t})):new Vt}_appendChar(t,e,n){e===void 0&&(e={});const s=this.state;let r;if([t,r]=this.doPrepareChar(t,e),t&&(r=r.aggregate(this._appendCharRaw(t,e)),!r.rawInserted&&this.autofix==="pad")){const a=this.state;this.state=s;let l=this.pad(e);const h=this._appendCharRaw(t,e);l=l.aggregate(h),h.rawInserted||l.equals(r)?r=l:this.state=a}if(r.inserted){let a,l=this.doValidate(e)!==!1;if(l&&n!=null){const h=this.state;if(this.overwrite===!0){a=n.state;for(let d=0;d1&&t!==0&&!h?Tt.NONE:s),p.tailShift=d-t),p.aggregate(this.remove(d)),h&&s!==Tt.NONE&&c===this.rawInputValue)if(s===Tt.FORCE_LEFT){let g;for(;c===this.rawInputValue&&(g=this.displayValue.length);)p.aggregate(new Vt({tailShift:-1})).aggregate(this.remove(g-1))}else s===Tt.FORCE_RIGHT&&l.unshift();return p.aggregate(this.append(n,r,l))}maskEquals(t){return this.mask===t}optionsIsChanged(t){return!Fa(this,t)}typedValueEquals(t){const e=this.typedValue;return t===e||Ne.EMPTY_VALUES.includes(t)&&Ne.EMPTY_VALUES.includes(e)||(this.format?this.format(t,this)===this.format(this.typedValue,this):!1)}pad(t){return new Vt}}Ne.DEFAULTS={skipInvalid:!0};Ne.EMPTY_VALUES=[void 0,null,""];Ot.Masked=Ne;class ss{constructor(t,e){t===void 0&&(t=[]),e===void 0&&(e=0),this.chunks=t,this.from=e}toString(){return this.chunks.map(String).join("")}extend(t){if(!String(t))return;t=An(t)?new $i(String(t)):t;const e=this.chunks[this.chunks.length-1],n=e&&(e.stop===t.stop||t.stop==null)&&t.from===e.from+e.toString().length;if(t instanceof $i)n?e.extend(t.toString()):this.chunks.push(t);else if(t instanceof ss){if(t.stop==null){let s;for(;t.chunks.length&&t.chunks[0].stop==null;)s=t.chunks.shift(),s.from+=t.from,this.extend(s)}t.toString()&&(t.stop=t.blockIndex,this.chunks.push(t))}}appendTo(t){if(!(t instanceof Ot.MaskedPattern))return new $i(this.toString()).appendTo(t);const e=new Vt;for(let n=0;n=0)&&e.aggregate(t._appendPlaceholder(a)),l=s instanceof ss&&t._blocks[a]),l){const h=l.appendTail(s);e.aggregate(h);const c=s.toString().slice(h.rawInserted.length);c&&e.aggregate(t.append(c,{tail:!0}))}else e.aggregate(t.append(s.toString(),{tail:!0}))}return e}get state(){return{chunks:this.chunks.map(t=>t.state),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(t){const{chunks:e,...n}=t;Object.assign(this,n),this.chunks=e.map(s=>{const r="chunks"in s?new ss:new $i;return r.state=s,r})}unshift(t){if(!this.chunks.length||t!=null&&this.from>=t)return"";const e=t!=null?t-this.from:t;let n=0;for(;n=this.masked._blocks.length&&(this.index=this.masked._blocks.length-1,this.offset=this.block.displayValue.length))}_pushLeft(t){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=((e=this.block)==null?void 0:e.displayValue.length)||0){var e;if(t())return this.ok=!0}return this.ok=!1}_pushRight(t){for(this.pushState(),this.bindBlock();this.index{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,Tt.FORCE_LEFT),this.offset!==0))return!0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,Tt.LEFT),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,Tt.LEFT),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,Tt.FORCE_RIGHT),this.offset!==this.block.value.length))return!0})}pushRightBeforeInput(){return this._pushRight(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,Tt.NONE),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,Tt.NONE),!0})}}class Um{constructor(t){Object.assign(this,t),this._value="",this.isFixed=!0}get value(){return this._value}get unmaskedValue(){return this.isUnmasking?this.value:""}get rawInputValue(){return this._isRawInput?this.value:""}get displayValue(){return this.value}reset(){this._isRawInput=!1,this._value=""}remove(t,e){return t===void 0&&(t=0),e===void 0&&(e=this._value.length),this._value=this._value.slice(0,t)+this._value.slice(e),this._value||(this._isRawInput=!1),new Vt}nearestInputPos(t,e){e===void 0&&(e=Tt.NONE);const n=0,s=this._value.length;switch(e){case Tt.LEFT:case Tt.FORCE_LEFT:return n;case Tt.NONE:case Tt.RIGHT:case Tt.FORCE_RIGHT:default:return s}}totalInputPositions(t,e){return t===void 0&&(t=0),e===void 0&&(e=this._value.length),this._isRawInput?e-t:0}extractInput(t,e,n){return t===void 0&&(t=0),e===void 0&&(e=this._value.length),n===void 0&&(n={}),n.raw&&this._isRawInput&&this._value.slice(t,e)||""}get isComplete(){return!0}get isFilled(){return!!this._value}_appendChar(t,e){if(e===void 0&&(e={}),this.isFilled)return new Vt;const n=this.eager===!0||this.eager==="append",r=this.char===t&&(this.isUnmasking||e.input||e.raw)&&(!e.raw||!n)&&!e.tail,a=new Vt({inserted:this.char,rawInserted:r?this.char:""});return this._value=this.char,this._isRawInput=r&&(e.raw||e.input),a}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){const t=new Vt;return this.isFilled||(this._value=t.inserted=this.char),t}extractTail(){return new $i("")}appendTail(t){return An(t)&&(t=new $i(String(t))),t.appendTo(this)}append(t,e,n){const s=this._appendChar(t[0],e);return n!=null&&(s.tailShift+=this.appendTail(n).tailShift),s}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value,this._isRawInput=!!t._rawInputValue}pad(t){return this._appendPlaceholder()}}class Ra{constructor(t){const{parent:e,isOptional:n,placeholderChar:s,displayChar:r,lazy:a,eager:l,...h}=t;this.masked=hn(h),Object.assign(this,{parent:e,isOptional:n,placeholderChar:s,displayChar:r,lazy:a,eager:l})}reset(){this.isFilled=!1,this.masked.reset()}remove(t,e){return t===void 0&&(t=0),e===void 0&&(e=this.value.length),t===0&&e>=1?(this.isFilled=!1,this.masked.remove(t,e)):new Vt}get value(){return this.masked.value||(this.isFilled&&!this.isOptional?this.placeholderChar:"")}get unmaskedValue(){return this.masked.unmaskedValue}get rawInputValue(){return this.masked.rawInputValue}get displayValue(){return this.masked.value&&this.displayChar||this.value}get isComplete(){return!!this.masked.value||this.isOptional}_appendChar(t,e){if(e===void 0&&(e={}),this.isFilled)return new Vt;const n=this.masked.state;let s=this.masked._appendChar(t,this.currentMaskFlags(e));return s.inserted&&this.doValidate(e)===!1&&(s=new Vt,this.masked.state=n),!s.inserted&&!this.isOptional&&!this.lazy&&!e.input&&(s.inserted=this.placeholderChar),s.skip=!s.inserted&&!this.isOptional,this.isFilled=!!s.inserted,s}append(t,e,n){return this.masked.append(t,this.currentMaskFlags(e),n)}_appendPlaceholder(){return this.isFilled||this.isOptional?new Vt:(this.isFilled=!0,new Vt({inserted:this.placeholderChar}))}_appendEager(){return new Vt}extractTail(t,e){return this.masked.extractTail(t,e)}appendTail(t){return this.masked.appendTail(t)}extractInput(t,e,n){return t===void 0&&(t=0),e===void 0&&(e=this.value.length),this.masked.extractInput(t,e,n)}nearestInputPos(t,e){e===void 0&&(e=Tt.NONE);const n=0,s=this.value.length,r=Math.min(Math.max(t,n),s);switch(e){case Tt.LEFT:case Tt.FORCE_LEFT:return this.isComplete?r:n;case Tt.RIGHT:case Tt.FORCE_RIGHT:return this.isComplete?r:s;case Tt.NONE:default:return r}}totalInputPositions(t,e){return t===void 0&&(t=0),e===void 0&&(e=this.value.length),this.value.slice(t,e).length}doValidate(t){return this.masked.doValidate(this.currentMaskFlags(t))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(t)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(t){this.masked.state=t.masked,this.isFilled=t.isFilled}currentMaskFlags(t){var e;return{...t,_beforeTailState:(t==null||(e=t._beforeTailState)==null?void 0:e.masked)||(t==null?void 0:t._beforeTailState)}}pad(t){return new Vt}}Ra.DEFAULT_DEFINITIONS={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./};class Mw extends Ne{updateOptions(t){super.updateOptions(t)}_update(t){const e=t.mask;e&&(t.validate=n=>n.search(e)>=0),super._update(t)}}Ot.MaskedRegExp=Mw;class ze extends Ne{constructor(t){super({...ze.DEFAULTS,...t,definitions:Object.assign({},Ra.DEFAULT_DEFINITIONS,t==null?void 0:t.definitions)})}updateOptions(t){super.updateOptions(t)}_update(t){t.definitions=Object.assign({},this.definitions,t.definitions),super._update(t),this._rebuildMask()}_rebuildMask(){const t=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};const e=this.mask;if(!e||!t)return;let n=!1,s=!1;for(let r=0;rc.indexOf(g)===0);d.sort((g,v)=>v.length-g.length);const p=d[0];if(p){const{expose:g,repeat:v,...b}=Zr(this.blocks[p]),_={lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix,...b,repeat:v,parent:this},w=v!=null?new Ot.RepeatBlock(_):hn(_);w&&(this._blocks.push(w),g&&(this.exposeBlock=w),this._maskedBlocks[p]||(this._maskedBlocks[p]=[]),this._maskedBlocks[p].push(this._blocks.length-1)),r+=p.length-1;continue}}let a=e[r],l=a in t;if(a===ze.STOP_CHAR){this._stops.push(this._blocks.length);continue}if(a==="{"||a==="}"){n=!n;continue}if(a==="["||a==="]"){s=!s;continue}if(a===ze.ESCAPE_CHAR){if(++r,a=e[r],!a)break;l=!1}const h=l?new Ra({isOptional:s,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...Zr(t[a]),parent:this}):new Um({char:a,eager:this.eager,isUnmasking:n});this._blocks.push(h)}}get state(){return{...super.state,_blocks:this._blocks.map(t=>t.state)}}set state(t){if(!t){this.reset();return}const{_blocks:e,...n}=t;this._blocks.forEach((s,r)=>s.state=e[r]),super.state=n}reset(){super.reset(),this._blocks.forEach(t=>t.reset())}get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every(t=>t.isComplete)}get isFilled(){return this._blocks.every(t=>t.isFilled)}get isFixed(){return this._blocks.every(t=>t.isFixed)}get isOptional(){return this._blocks.every(t=>t.isOptional)}doCommit(){this._blocks.forEach(t=>t.doCommit()),super.doCommit()}get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce((t,e)=>t+=e.unmaskedValue,"")}set unmaskedValue(t){if(this.exposeBlock){const e=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=t,this.appendTail(e),this.doCommit()}else super.unmaskedValue=t}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce((t,e)=>t+=e.value,"")}set value(t){if(this.exposeBlock){const e=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=t,this.appendTail(e),this.doCommit()}else super.value=t}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(t){if(this.exposeBlock){const e=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=t,this.appendTail(e),this.doCommit()}else super.typedValue=t}get displayValue(){return this._blocks.reduce((t,e)=>t+=e.displayValue,"")}appendTail(t){return super.appendTail(t).aggregate(this._appendPlaceholder())}_appendEager(){var t;const e=new Vt;let n=(t=this._mapPosToBlock(this.displayValue.length))==null?void 0:t.index;if(n==null)return e;this._blocks[n].isFilled&&++n;for(let s=n;s{const h=s.extractTail(a,l);h.stop=this._findStopBefore(r),h.from=this._blockStartPos(r),h instanceof ss&&(h.blockIndex=r),n.extend(h)}),n}extractInput(t,e,n){if(t===void 0&&(t=0),e===void 0&&(e=this.displayValue.length),n===void 0&&(n={}),t===e)return"";let s="";return this._forEachBlocksInRange(t,e,(r,a,l,h)=>{s+=r.extractInput(l,h,n)}),s}_findStopBefore(t){let e;for(let n=0;n{if(!a.lazy||t!=null){var l;e.aggregate(a._appendPlaceholder((l=a._blocks)==null?void 0:l.length))}}),e}_mapPosToBlock(t){let e="";for(let n=0;ne+=n.displayValue.length,0)}_forEachBlocksInRange(t,e,n){e===void 0&&(e=this.displayValue.length);const s=this._mapPosToBlock(t);if(s){const r=this._mapPosToBlock(e),a=r&&s.index===r.index,l=s.offset,h=r&&a?r.offset:this._blocks[s.index].displayValue.length;if(n(this._blocks[s.index],s.index,l,h),r&&!a){for(let c=s.index+1;c{n.aggregate(s.remove(a,l))}),n}nearestInputPos(t,e){if(e===void 0&&(e=Tt.NONE),!this._blocks.length)return 0;const n=new Tw(this,t);if(e===Tt.NONE)return n.pushRightBeforeInput()||(n.popState(),n.pushLeftBeforeInput())?n.pos:this.displayValue.length;if(e===Tt.LEFT||e===Tt.FORCE_LEFT){if(e===Tt.LEFT){if(n.pushRightBeforeFilled(),n.ok&&n.pos===t)return t;n.popState()}if(n.pushLeftBeforeInput(),n.pushLeftBeforeRequired(),n.pushLeftBeforeFilled(),e===Tt.LEFT){if(n.pushRightBeforeInput(),n.pushRightBeforeRequired(),n.ok&&n.pos<=t||(n.popState(),n.ok&&n.pos<=t))return n.pos;n.popState()}return n.ok?n.pos:e===Tt.FORCE_LEFT?0:(n.popState(),n.ok||(n.popState(),n.ok)?n.pos:0)}return e===Tt.RIGHT||e===Tt.FORCE_RIGHT?(n.pushRightBeforeInput(),n.pushRightBeforeRequired(),n.pushRightBeforeFilled()?n.pos:e===Tt.FORCE_RIGHT?this.displayValue.length:(n.popState(),n.ok||(n.popState(),n.ok)?n.pos:this.nearestInputPos(t,Tt.LEFT))):t}totalInputPositions(t,e){t===void 0&&(t=0),e===void 0&&(e=this.displayValue.length);let n=0;return this._forEachBlocksInRange(t,e,(s,r,a,l)=>{n+=s.totalInputPositions(a,l)}),n}maskedBlock(t){return this.maskedBlocks(t)[0]}maskedBlocks(t){const e=this._maskedBlocks[t];return e?e.map(n=>this._blocks[n]):[]}pad(t){const e=new Vt;return this._forEachBlocksInRange(0,this.displayValue.length,n=>e.aggregate(n.pad(t))),e}}ze.DEFAULTS={...Ne.DEFAULTS,lazy:!0,placeholderChar:"_"};ze.STOP_CHAR="`";ze.ESCAPE_CHAR="\\";ze.InputDefinition=Ra;ze.FixedDefinition=Um;Ot.MaskedPattern=ze;class ga extends ze{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){const{to:e=this.to||0,from:n=this.from||0,maxLength:s=this.maxLength||0,autofix:r=this.autofix,...a}=t;this.to=e,this.from=n,this.maxLength=Math.max(String(e).length,s),this.autofix=r;const l=String(this.from).padStart(this.maxLength,"0"),h=String(this.to).padStart(this.maxLength,"0");let c=0;for(;cthis.maxLength)return super._appendCharRaw(t,e);const n=String(this.from).padStart(this.maxLength,"0"),s=String(this.to).padStart(this.maxLength,"0"),[r,a]=this.boundaries(this.value+t);return Number(a)this.to?!e.tail&&this.autofix==="pad"&&this.value.length+1this._appendCharRaw(r))}return e}}Ot.MaskedRange=ga;const Lw="d{.}`m{.}`Y";class sn extends ze{static extractPatternOptions(t){const{mask:e,pattern:n,...s}=t;return{...s,mask:An(e)?e:n}}constructor(t){super(sn.extractPatternOptions({...sn.DEFAULTS,...t}))}updateOptions(t){super.updateOptions(t)}_update(t){const{mask:e,pattern:n,blocks:s,...r}={...sn.DEFAULTS,...t},a=Object.assign({},sn.GET_DEFAULT_BLOCKS());t.min&&(a.Y.from=t.min.getFullYear()),t.max&&(a.Y.to=t.max.getFullYear()),t.min&&t.max&&a.Y.from===a.Y.to&&(a.m.from=t.min.getMonth()+1,a.m.to=t.max.getMonth()+1,a.m.from===a.m.to&&(a.d.from=t.min.getDate(),a.d.to=t.max.getDate())),Object.assign(a,this.blocks,s),super._update({...r,mask:An(e)?e:n,blocks:a})}doValidate(t){const e=this.date;return super.doValidate(t)&&(!this.isComplete||this.isDateExist(this.value)&&e!=null&&(this.min==null||this.min<=e)&&(this.max==null||e<=this.max))}isDateExist(t){return this.format(this.parse(t,this),this).indexOf(t)>=0}get date(){return this.typedValue}set date(t){this.typedValue=t}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(t){super.typedValue=t}maskEquals(t){return t===Date||super.maskEquals(t)}optionsIsChanged(t){return super.optionsIsChanged(sn.extractPatternOptions(t))}}sn.GET_DEFAULT_BLOCKS=()=>({d:{mask:ga,from:1,to:31,maxLength:2},m:{mask:ga,from:1,to:12,maxLength:2},Y:{mask:ga,from:1900,to:9999}});sn.DEFAULTS={...ze.DEFAULTS,mask:Date,pattern:Lw,format:(i,t)=>{if(!i)return"";const e=String(i.getDate()).padStart(2,"0"),n=String(i.getMonth()+1).padStart(2,"0"),s=i.getFullYear();return[e,n,s].join(".")},parse:(i,t)=>{const[e,n,s]=i.split(".").map(Number);return new Date(s,n-1,e)}};Ot.MaskedDate=sn;class ol extends Ne{constructor(t){super({...ol.DEFAULTS,...t}),this.currentMask=void 0}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),"mask"in t&&(this.exposeMask=void 0,this.compiledMasks=Array.isArray(t.mask)?t.mask.map(e=>{const{expose:n,...s}=Zr(e),r=hn({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...s});return n&&(this.exposeMask=r),r}):[])}_appendCharRaw(t,e){e===void 0&&(e={});const n=this._applyDispatch(t,e);return this.currentMask&&n.aggregate(this.currentMask._appendChar(t,this.currentMaskFlags(e))),n}_applyDispatch(t,e,n){t===void 0&&(t=""),e===void 0&&(e={}),n===void 0&&(n="");const s=e.tail&&e._beforeTailState!=null?e._beforeTailState._value:this.value,r=this.rawInputValue,a=e.tail&&e._beforeTailState!=null?e._beforeTailState._rawInputValue:r,l=r.slice(a.length),h=this.currentMask,c=new Vt,d=h==null?void 0:h.state;return this.currentMask=this.doDispatch(t,{...e},n),this.currentMask&&(this.currentMask!==h?(this.currentMask.reset(),a&&(this.currentMask.append(a,{raw:!0}),c.tailShift=this.currentMask.value.length-s.length),l&&(c.tailShift+=this.currentMask.append(l,{raw:!0,tail:!0}).tailShift)):d&&(this.currentMask.state=d)),c}_appendPlaceholder(){const t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendPlaceholder()),t}_appendEager(){const t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendEager()),t}appendTail(t){const e=new Vt;return t&&e.aggregate(this._applyDispatch("",{},t)),e.aggregate(this.currentMask?this.currentMask.appendTail(t):super.appendTail(t))}currentMaskFlags(t){var e,n;return{...t,_beforeTailState:((e=t._beforeTailState)==null?void 0:e.currentMaskRef)===this.currentMask&&((n=t._beforeTailState)==null?void 0:n.currentMask)||t._beforeTailState}}doDispatch(t,e,n){return e===void 0&&(e={}),n===void 0&&(n=""),this.dispatch(t,this,e,n)}doValidate(t){return super.doValidate(t)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(t)))}doPrepare(t,e){e===void 0&&(e={});let[n,s]=super.doPrepare(t,e);if(this.currentMask){let r;[n,r]=super.doPrepare(n,this.currentMaskFlags(e)),s=s.aggregate(r)}return[n,s]}doPrepareChar(t,e){e===void 0&&(e={});let[n,s]=super.doPrepareChar(t,e);if(this.currentMask){let r;[n,r]=super.doPrepareChar(n,this.currentMaskFlags(e)),s=s.aggregate(r)}return[n,s]}reset(){var t;(t=this.currentMask)==null||t.reset(),this.compiledMasks.forEach(e=>e.reset())}get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""}set value(t){this.exposeMask?(this.exposeMask.value=t,this.currentMask=this.exposeMask,this._applyDispatch()):super.value=t}get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(t){this.exposeMask?(this.exposeMask.unmaskedValue=t,this.currentMask=this.exposeMask,this._applyDispatch()):super.unmaskedValue=t}get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""}set typedValue(t){if(this.exposeMask){this.exposeMask.typedValue=t,this.currentMask=this.exposeMask,this._applyDispatch();return}let e=String(t);this.currentMask&&(this.currentMask.typedValue=t,e=this.currentMask.unmaskedValue),this.unmaskedValue=e}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var t;return!!((t=this.currentMask)!=null&&t.isComplete)}get isFilled(){var t;return!!((t=this.currentMask)!=null&&t.isFilled)}remove(t,e){const n=new Vt;return this.currentMask&&n.aggregate(this.currentMask.remove(t,e)).aggregate(this._applyDispatch()),n}get state(){var t;return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map(e=>e.state),currentMaskRef:this.currentMask,currentMask:(t=this.currentMask)==null?void 0:t.state}}set state(t){const{compiledMasks:e,currentMaskRef:n,currentMask:s,...r}=t;e&&this.compiledMasks.forEach((a,l)=>a.state=e[l]),n!=null&&(this.currentMask=n,this.currentMask.state=s),super.state=r}extractInput(t,e,n){return this.currentMask?this.currentMask.extractInput(t,e,n):""}extractTail(t,e){return this.currentMask?this.currentMask.extractTail(t,e):super.extractTail(t,e)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(t,e){return this.currentMask?this.currentMask.nearestInputPos(t,e):super.nearestInputPos(t,e)}get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite}set overwrite(t){this._overwrite=t}get eager(){return this.currentMask?this.currentMask.eager:this._eager}set eager(t){this._eager=t}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid}set skipInvalid(t){this._skipInvalid=t}get autofix(){return this.currentMask?this.currentMask.autofix:this._autofix}set autofix(t){this._autofix=t}maskEquals(t){return Array.isArray(t)?this.compiledMasks.every((e,n)=>{if(!t[n])return;const{mask:s,...r}=t[n];return Fa(e,r)&&e.maskEquals(s)}):super.maskEquals(t)}typedValueEquals(t){var e;return!!((e=this.currentMask)!=null&&e.typedValueEquals(t))}}ol.DEFAULTS={...Ne.DEFAULTS,dispatch:(i,t,e,n)=>{if(!t.compiledMasks.length)return;const s=t.rawInputValue,r=t.compiledMasks.map((a,l)=>{const h=t.currentMask===a,c=h?a.displayValue.length:a.nearestInputPos(a.displayValue.length,Tt.FORCE_LEFT);return a.rawInputValue!==s?(a.reset(),a.append(s,{raw:!0})):h||a.remove(c),a.append(i,t.currentMaskFlags(e)),a.appendTail(n),{index:l,weight:a.rawInputValue.length,totalInputPositions:a.totalInputPositions(0,Math.max(c,a.nearestInputPos(a.displayValue.length,Tt.FORCE_LEFT)))}});return r.sort((a,l)=>l.weight-a.weight||l.totalInputPositions-a.totalInputPositions),t.compiledMasks[r[0].index]}};Ot.MaskedDynamic=ol;class al extends ze{constructor(t){super({...al.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){const{enum:e,...n}=t;if(e){const s=e.map(l=>l.length),r=Math.min(...s),a=Math.max(...s)-r;n.mask="*".repeat(r),a&&(n.mask+="["+"*".repeat(a)+"]"),this.enum=e}super._update(n)}_appendCharRaw(t,e){e===void 0&&(e={});const n=Math.min(this.nearestInputPos(0,Tt.FORCE_RIGHT),this.value.length),s=this.enum.filter(r=>this.matchValue(r,this.unmaskedValue+t,n));if(s.length){s.length===1&&this._forEachBlocksInRange(0,this.value.length,(a,l)=>{const h=s[0][l];l>=this.value.length||h===a.value||(a.reset(),a._appendChar(h,e))});const r=super._appendCharRaw(s[0][this.value.length],e);return s.length===1&&s[0].slice(this.unmaskedValue.length).split("").forEach(a=>r.aggregate(super._appendCharRaw(a))),r}return new Vt({skip:!this.isComplete})}extractTail(t,e){return t===void 0&&(t=0),e===void 0&&(e=this.displayValue.length),new $i("",t)}remove(t,e){if(t===void 0&&(t=0),e===void 0&&(e=this.displayValue.length),t===e)return new Vt;const n=Math.min(super.nearestInputPos(0,Tt.FORCE_RIGHT),this.value.length);let s;for(s=t;s>=0&&!(this.enum.filter(l=>this.matchValue(l,this.value.slice(n,s),n)).length>1);--s);const r=super.remove(s,e);return r.tailShift+=s-t,r}get isComplete(){return this.enum.indexOf(this.value)>=0}}al.DEFAULTS={...ze.DEFAULTS,matchValue:(i,t,e)=>i.indexOf(t,e)===e};Ot.MaskedEnum=al;class Aw extends Ne{updateOptions(t){super.updateOptions(t)}_update(t){super._update({...t,validate:t.mask})}}Ot.MaskedFunction=Aw;var Wm;class ri extends Ne{constructor(t){super({...ri.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),this._updateRegExps()}_updateRegExps(){const t="^"+(this.allowNegative?"[+|\\-]?":""),e="\\d*",n=(this.scale?"("+ic(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(t+e+n),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(ic).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(ic(this.thousandsSeparator),"g")}_removeThousandsSeparators(t){return t.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(t){const e=t.split(this.radix);return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),e.join(this.radix)}doPrepareChar(t,e){e===void 0&&(e={});const[n,s]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(e.input&&e.raw||!e.input&&!e.raw)?t.replace(this._mapToRadixRegExp,this.radix):t),e);return t&&!n&&(s.skip=!0),n&&!this.allowPositive&&!this.value&&n!=="-"&&s.aggregate(this._appendChar("-")),[n,s]}_separatorsCount(t,e){e===void 0&&(e=!1);let n=0;for(let s=0;s0&&this.number>this.max&&(g=this.max),g!=null&&(this.autofix?(this._value=this.format(g,this).replace(ri.UNMASKED_RADIX,this.radix),h||(h=r===this._value&&!e.tail)):l=!1),l&&(l=!!this._value.match(this._numberRegExp))}let c;l?c=new Vt({inserted:this._value.slice(r.length),rawInserted:h?"":t,skip:h}):(this._value=r,c=new Vt),this._value=this._insertThousandsSeparators(this._value);const d=e.tail&&e._beforeTailState?e._beforeTailState._value:this._value,p=this._separatorsCountFromSlice(d);return c.tailShift+=(p-s)*this.thousandsSeparator.length,c}_findSeparatorAround(t){if(this.thousandsSeparator){const e=t-this.thousandsSeparator.length+1,n=this.value.indexOf(this.thousandsSeparator,e);if(n<=t)return n}return-1}_adjustRangeWithSeparators(t,e){const n=this._findSeparatorAround(t);n>=0&&(t=n);const s=this._findSeparatorAround(e);return s>=0&&(e=s+this.thousandsSeparator.length),[t,e]}remove(t,e){t===void 0&&(t=0),e===void 0&&(e=this.displayValue.length),[t,e]=this._adjustRangeWithSeparators(t,e);const n=this.value.slice(0,t),s=this.value.slice(e),r=this._separatorsCount(n.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(n+s));const a=this._separatorsCountFromSlice(n);return new Vt({tailShift:(a-r)*this.thousandsSeparator.length})}nearestInputPos(t,e){if(!this.thousandsSeparator)return t;switch(e){case Tt.NONE:case Tt.LEFT:case Tt.FORCE_LEFT:{const n=this._findSeparatorAround(t-1);if(n>=0){const s=n+this.thousandsSeparator.length;if(t=0)return n+this.thousandsSeparator.length}}return t}doCommit(){if(this.value){const t=this.number;let e=t;this.min!=null&&(e=Math.max(e,this.min)),this.max!=null&&(e=Math.min(e,this.max)),e!==t&&(this.unmaskedValue=this.format(e,this));let n=this.value;this.normalizeZeros&&(n=this._normalizeZeros(n)),this.padFractionalZeros&&this.scale>0&&(n=this._padFractionalZeros(n)),this._value=n}super.doCommit()}_normalizeZeros(t){const e=this._removeThousandsSeparators(t).split(this.radix);return e[0]=e[0].replace(/^(\D*)(0*)(\d*)/,(n,s,r,a)=>s+a),t.length&&!/\d$/.test(e[0])&&(e[0]=e[0]+"0"),e.length>1&&(e[1]=e[1].replace(/0*$/,""),e[1].length||(e.length=1)),this._insertThousandsSeparators(e.join(this.radix))}_padFractionalZeros(t){if(!t)return t;const e=t.split(this.radix);return e.length<2&&e.push(""),e[1]=e[1].padEnd(this.scale,"0"),e.join(this.radix)}doSkipInvalid(t,e,n){e===void 0&&(e={});const s=this.scale===0&&t!==this.thousandsSeparator&&(t===this.radix||t===ri.UNMASKED_RADIX||this.mapToRadix.includes(t));return super.doSkipInvalid(t,e,n)&&!s}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,ri.UNMASKED_RADIX)}set unmaskedValue(t){super.unmaskedValue=t}get typedValue(){return this.parse(this.unmaskedValue,this)}set typedValue(t){this.rawInputValue=this.format(t,this).replace(ri.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(t){this.typedValue=t}get allowNegative(){return this.min!=null&&this.min<0||this.max!=null&&this.max<0}get allowPositive(){return this.min!=null&&this.min>0||this.max!=null&&this.max>0}typedValueEquals(t){return(super.typedValueEquals(t)||ri.EMPTY_VALUES.includes(t)&&ri.EMPTY_VALUES.includes(this.typedValue))&&!(t===0&&this.value==="")}}Wm=ri;ri.UNMASKED_RADIX=".";ri.EMPTY_VALUES=[...Ne.EMPTY_VALUES,0];ri.DEFAULTS={...Ne.DEFAULTS,mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[Wm.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:i=>i.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20})};Ot.MaskedNumber=ri;const Qc={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function qm(i,t,e){t===void 0&&(t=Qc.MASKED),e===void 0&&(e=Qc.MASKED);const n=hn(i);return s=>n.runIsolated(r=>(r[t]=s,r[e]))}function Dw(i,t,e,n){return qm(t,e,n)(i)}Ot.PIPE_TYPE=Qc;Ot.createPipe=qm;Ot.pipe=Dw;class Pw extends ze{get repeatFrom(){var t;return(t=Array.isArray(this.repeat)?this.repeat[0]:this.repeat===1/0?0:this.repeat)!=null?t:0}get repeatTo(){var t;return(t=Array.isArray(this.repeat)?this.repeat[1]:this.repeat)!=null?t:1/0}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){var e,n,s;const{repeat:r,...a}=Zr(t);this._blockOpts=Object.assign({},this._blockOpts,a);const l=hn(this._blockOpts);this.repeat=(e=(n=r??l.repeat)!=null?n:this.repeat)!=null?e:1/0,super._update({mask:"m".repeat(Math.max(this.repeatTo===1/0&&((s=this._blocks)==null?void 0:s.length)||0,this.repeatFrom)),blocks:{m:l},eager:l.eager,overwrite:l.overwrite,skipInvalid:l.skipInvalid,lazy:l.lazy,placeholderChar:l.placeholderChar,displayChar:l.displayChar})}_allocateBlock(t){if(tn?r?e+1:s?e/1.15:e:n+1)*8.6}px`}this.element.style.width="auto"}setValue(t){this.input.value=t,this.masked&&(this.masked.value=t)}getInput(){return this.input}getMasked(){return this.masked}onPasswordTriggerClick(t){this.input.type==="password"?(this.input.type="text",this.iconHide.classList.toggle(Ms.iconDisabled),this.iconShow.classList.toggle(Ms.iconDisabled)):(this.input.type="password",this.iconHide.classList.toggle(Ms.iconDisabled),this.iconShow.classList.toggle(Ms.iconDisabled)),t.preventDefault()}onInput(t){const e=this.input.value;this.autosize==="true"&&(this.input.style.height="auto",this.input.style.height=`${this.input.scrollHeight}px`),this.trigger(Ow.input,{event:t,value:e})}dispatchInputAndChange(){this.input.dispatchEvent(new Event("input")),this.input.dispatchEvent(new Event("change"))}onNumberControl(t){var c;if(this.mask!=="num")return;const n=t.currentTarget.classList.contains(Iw.numberControlInc),s=((c=this.masked)==null?void 0:c.typedValue)||0,r=n?s+1:s-1,a=parseFloat(this.input.getAttribute(_n.maskMax)||"Infinity"),l=parseFloat(this.input.getAttribute(_n.maskMin)||"0"),h=n?r<=a:r>=l;!n&&s===0&&(this.setValue("0"),this.dispatchInputAndChange()),h&&(this.setValue(`${r}`),this.dispatchInputAndChange())}initMask(){let t,e=this.input.getAttribute(_n.maskMin),n=this.input.getAttribute(_n.maskMax),s=this.input.getAttribute(_n.maskPattern)||void 0;return this.mask==="date"?t={mask:Date,pattern:s||"d{.}m{.}Y",min:e?new Date(e):void 0,max:n?new Date(n):void 0}:t={pattern:s,mask:this.mask,thousandsSeparator:" ",lazy:!1,blocks:{num:{mask:Number,scale:20,radix:".",mapToRadix:["."],thousandsSeparator:" ",min:e?parseFloat(e):void 0,max:n?parseFloat(n):void 0,expose:!0}}},Ot(this.input,t)}destroy(){var t,e;super.destroy(),(t=this.copyTools)==null||t.destroy(),(e=this.masked)==null||e.destroy()}addListeners(){this.passwordTrigger&&this.passwordTrigger.addEventListener("click",this.onPasswordTriggerClick.bind(this),{signal:this.abortController.signal}),this.copyTrigger&&this.copyTrigger.addEventListener("click",t=>t.preventDefault(),{signal:this.abortController.signal}),this.numberControls.length&&this.numberControls.forEach(t=>t.addEventListener("click",this.onNumberControl.bind(this),{signal:this.abortController.signal})),this.input.addEventListener("input",this.onInput.bind(this),{signal:this.abortController.signal})}}const $o={input:".__input-field__",inputComponent:".__input__",dropdown:".__input-apply-dropdown__",button:".__input-apply-button__"},Fw={badge:"data-with-badge"},zd={active:"input-apply_active",badge:"input_badge"};class Rw extends Kt{constructor(t){super(t),this.input=this.element.querySelector($o.input),this.inputComponentNode=this.element.querySelector($o.inputComponent),this.dropdown=this.element.querySelector($o.dropdown),this.button=this.element.querySelector($o.button),this.isBadged=!!this.element.getAttribute(Fw.badge),this.cacheValue=this.input.value,this.addListeners()}setActive(t){const e=t?"add":"remove";this.element.classList[e](zd.active)}onFocus(){this.setActive(!0)}onFocusOut(){setTimeout(()=>{this.element.contains(document.activeElement)||this.setActive(!1)})}onClickApply(){var n,s;const e=this.isBadged&&((n=this.input)==null?void 0:n.value)?"add":"remove";(s=this.inputComponentNode)==null||s.classList[e](zd.badge),this.cacheValue=this.input.value,this.setActive(!1)}onClickOutside(t){const e=t.target;if(!Bu(this.element,e)){const n=this.getComponentByNode(he,this.inputComponentNode);this.setActive(!1),n.setValue(this.cacheValue)}}addListeners(){var t,e,n;(t=this.input)==null||t.addEventListener("focus",this.onFocus.bind(this)),(e=this.element)==null||e.addEventListener("focusout",this.onFocusOut.bind(this)),(n=this.button)==null||n.addEventListener("click",this.onClickApply.bind(this)),document.addEventListener("click",this.onClickOutside.bind(this))}}const ve=class ve extends Kt{constructor(t){super(t),this.cells=Array.from(this.element.querySelectorAll(ve.SELECTORS.cell)),this.inputValue=this.element.querySelector(ve.SELECTORS.value),this.valueStack=["","","","","","","",""],this.onInput=this.onInput.bind(this),this.onFocus=this.onFocus.bind(this),this.onKeydown=this.onKeydown.bind(this),this.onPaste=this.onPaste.bind(this),this.init(),this.addListeners()}focus(t=0){const e=this.cells[t];e&&e.focus()}isComplete(){return this.valueStack.every(t=>!!t)}setValue(t){this.inputValue.value=t,this.inputValue.setAttribute("value",t),this.inputValue.dispatchEvent(new Event("change"))}setValuesFromString(t){Array.from(t).forEach((e,n)=>{if(ve.CHECK_REGEX.test(e)){const r=e.toUpperCase();this.cells[n].value=r,this.valueStack[n]=r}})}parseValue(t){const n=t.split(ve.DIVIDER_SYMBOL).length===2&&t.length===this.valueStack.length+1;this.setValuesFromString(n?t.replace(ve.DIVIDER_SYMBOL,""):t)}stackToString(){if(this.isComplete()){const t=[...this.valueStack];t.splice(4,0,ve.DIVIDER_SYMBOL),this.setValue(t.join(""))}}erase(){this.inputValue.value="",this.inputValue.setAttribute("value",""),this.cells.forEach(t=>t.value="")}onKeydown(t){var a,l;const e=t.key,n=e===ve.KEYBOARD_KEYS.left,s=e===ve.KEYBOARD_KEYS.right,r=e===ve.KEYBOARD_KEYS.delete;if(n||s)try{const h=parseInt((a=document.activeElement)==null?void 0:a.getAttribute(ve.DATA_SET.cellOrder));this.focus(n?h-1:h+1)}catch(h){console.log(h)}if(r)try{const h=parseInt((l=document.activeElement)==null?void 0:l.getAttribute(ve.DATA_SET.cellOrder));if(this.valueStack[h]="",this.setValue(""),this.cells[h].value){this.cells[h].value="";return}this.focus(h-1),this.cells[h-1]&&(this.cells[h-1].value="")}catch(h){console.log(h)}}onPaste(t){var n;t.preventDefault(),t.stopPropagation();const e=(n=t.clipboardData)==null?void 0:n.getData("text");if(e){this.parseValue(e),this.setValue(e);const s=document.activeElement;s==null||s.blur()}}onFocus(t){const e=t.target;setTimeout(()=>e.setSelectionRange(0,1))}onInput(t){var d;const e=t.target,n=parseInt(e.getAttribute(ve.DATA_SET.cellOrder)),s=e.selectionStart,r=e.value.length,a=s===1&&r===2,l=!ve.CHECK_REGEX.test(e.value);if(isNaN(n))throw new Error("InputCode: not passed order");if(l){e.value=this.valueStack[n]||"",this.focus(n);return}const h=(d=e.value.slice(a?0:-1,a?1:void 0))==null?void 0:d.toUpperCase();e.value=h,this.valueStack[n]=h||"";const c=n===this.cells.length-1;if(e.value){if(this.stackToString(),c){e.blur();return}this.focus(n+1)}}init(){if(this.element.hasAttribute(ve.DATA_SET.autoFocus)&&this.focus(),this.inputValue.value){this.parseValue(this.inputValue.value);return}this.erase()}addListeners(){this.element.addEventListener("keydown",this.onKeydown),this.cells.forEach(t=>{t.addEventListener("input",this.onInput),t.addEventListener("focus",this.onFocus),t.addEventListener("paste",this.onPaste)})}removeListeners(){this.element.removeEventListener("keydown",this.onKeydown),this.cells.forEach(t=>{t.removeEventListener("input",this.onInput),t.removeEventListener("focus",this.onFocus),t.removeEventListener("paste",this.onPaste)})}destroy(){super.destroy(),this.removeListeners()}};ve.SELECTORS={value:".__input-code-value__",cell:".__input-code-cell__"},ve.DATA_SET={cellOrder:"data-order",autoFocus:"data-autofocus"},ve.KEYBOARD_KEYS={left:"ArrowLeft",right:"ArrowRight",delete:"Backspace"},ve.CHECK_REGEX=/^[a-zA-Z0-9]+$/,ve.DIVIDER_SYMBOL="-";let tu=ve;var Sn;(function(i){i.Range="range",i.Steps="steps",i.Positions="positions",i.Count="count",i.Values="values"})(Sn||(Sn={}));var We;(function(i){i[i.None=-1]="None",i[i.NoValue=0]="NoValue",i[i.LargeValue=1]="LargeValue",i[i.SmallValue=2]="SmallValue"})(We||(We={}));function Bw(i){return Ba(i)&&typeof i.from=="function"}function Ba(i){return typeof i=="object"&&typeof i.to=="function"}function $d(i){i.parentElement.removeChild(i)}function eu(i){return i!=null}function Hd(i){i.preventDefault()}function Vw(i){return i.filter(function(t){return this[t]?!1:this[t]=!0},{})}function Nw(i,t){return Math.round(i/t)*t}function zw(i,t){var e=i.getBoundingClientRect(),n=i.ownerDocument,s=n.documentElement,r=Zm(n);return/webkit.*Chrome.*Mobile/i.test(navigator.userAgent)&&(r.x=0),t?e.top+r.y-s.clientTop:e.left+r.x-s.clientLeft}function Ti(i){return typeof i=="number"&&!isNaN(i)&&isFinite(i)}function jd(i,t,e){e>0&&(Fe(i,t),setTimeout(function(){va(i,t)},e))}function Ud(i){return Math.max(Math.min(i,100),0)}function ll(i){return Array.isArray(i)?i:[i]}function $w(i){i=String(i);var t=i.split(".");return t.length>1?t[1].length:0}function Fe(i,t){i.classList&&!/\s/.test(t)?i.classList.add(t):i.className+=" "+t}function va(i,t){i.classList&&!/\s/.test(t)?i.classList.remove(t):i.className=i.className.replace(new RegExp("(^|\\b)"+t.split(" ").join("|")+"(\\b|$)","gi")," ")}function Hw(i,t){return i.classList?i.classList.contains(t):new RegExp("\\b"+t+"\\b").test(i.className)}function Zm(i){var t=window.pageXOffset!==void 0,e=(i.compatMode||"")==="CSS1Compat",n=t?window.pageXOffset:e?i.documentElement.scrollLeft:i.body.scrollLeft,s=t?window.pageYOffset:e?i.documentElement.scrollTop:i.body.scrollTop;return{x:n,y:s}}function jw(){return window.navigator.pointerEnabled?{start:"pointerdown",move:"pointermove",end:"pointerup"}:window.navigator.msPointerEnabled?{start:"MSPointerDown",move:"MSPointerMove",end:"MSPointerUp"}:{start:"mousedown touchstart",move:"mousemove touchmove",end:"mouseup touchend"}}function Uw(){var i=!1;try{var t=Object.defineProperty({},"passive",{get:function(){i=!0}});window.addEventListener("test",null,t)}catch{}return i}function Ww(){return window.CSS&&CSS.supports&&CSS.supports("touch-action","none")}function Wu(i,t){return 100/(t-i)}function iu(i,t,e){return t*100/(i[e+1]-i[e])}function qw(i,t){return iu(i,i[0]<0?t+Math.abs(i[0]):t-i[0],0)}function Gw(i,t){return t*(i[1]-i[0])/100+i[0]}function Yr(i,t){for(var e=1;i>=t[e];)e+=1;return e}function Zw(i,t,e){if(e>=i.slice(-1)[0])return 100;var n=Yr(e,i),s=i[n-1],r=i[n],a=t[n-1],l=t[n];return a+qw([s,r],e)/Wu(a,l)}function Yw(i,t,e){if(e>=100)return i.slice(-1)[0];var n=Yr(e,t),s=i[n-1],r=i[n],a=t[n-1],l=t[n];return Gw([s,r],(e-a)*Wu(a,l))}function Kw(i,t,e,n){if(n===100)return n;var s=Yr(n,i),r=i[s-1],a=i[s];return e?n-r>(a-r)/2?a:r:t[s-1]?i[s-1]+Nw(n-i[s-1],t[s-1]):n}var Ym=function(){function i(t,e,n){this.xPct=[],this.xVal=[],this.xSteps=[],this.xNumSteps=[],this.xHighestCompleteStep=[],this.xSteps=[n||!1],this.xNumSteps=[!1],this.snap=e;var s,r=[];for(Object.keys(t).forEach(function(a){r.push([ll(t[a]),a])}),r.sort(function(a,l){return a[0][0]-l[0][0]}),s=0;sthis.xPct[s+1];)s++;else t===this.xPct[this.xPct.length-1]&&(s=this.xPct.length-2);!n&&t===this.xPct[s+1]&&s++,e===null&&(e=[]);var r,a=1,l=e[s],h=0,c=0,d=0,p=0;for(n?r=(t-this.xPct[s])/(this.xPct[s+1]-this.xPct[s]):r=(this.xPct[s+1]-t)/(this.xPct[s+1]-this.xPct[s]);l>0;)h=this.xPct[s+1+p]-this.xPct[s+p],e[s+p]*a+100-r*100>100?(c=h*r,a=(l-100*r)/e[s+p],r=1):(c=e[s+p]*h/100*a,a=0),n?(d=d-c,this.xPct.length+p>=1&&p--):(d=d+c,this.xPct.length-p>=1&&p++),l=e[s+p]*a;return t+d},i.prototype.toStepping=function(t){return t=Zw(this.xVal,this.xPct,t),t},i.prototype.fromStepping=function(t){return Yw(this.xVal,this.xPct,t)},i.prototype.getStep=function(t){return t=Kw(this.xPct,this.xSteps,this.snap,t),t},i.prototype.getDefaultStep=function(t,e,n){var s=Yr(t,this.xPct);return(t===100||e&&t===this.xPct[s-1])&&(s=Math.max(s-1,1)),(this.xVal[s]-this.xVal[s-1])/n},i.prototype.getNearbySteps=function(t){var e=Yr(t,this.xPct);return{stepBefore:{startValue:this.xVal[e-2],step:this.xNumSteps[e-2],highestStep:this.xHighestCompleteStep[e-2]},thisStep:{startValue:this.xVal[e-1],step:this.xNumSteps[e-1],highestStep:this.xHighestCompleteStep[e-1]},stepAfter:{startValue:this.xVal[e],step:this.xNumSteps[e],highestStep:this.xHighestCompleteStep[e]}}},i.prototype.countStepDecimals=function(){var t=this.xNumSteps.map($w);return Math.max.apply(null,t)},i.prototype.hasNoSize=function(){return this.xVal[0]===this.xVal[this.xVal.length-1]},i.prototype.convert=function(t){return this.getStep(this.toStepping(t))},i.prototype.handleEntryPoint=function(t,e){var n;if(t==="min"?n=0:t==="max"?n=100:n=parseFloat(t),!Ti(n)||!Ti(e[0]))throw new Error("noUiSlider: 'range' value isn't numeric.");this.xPct.push(n),this.xVal.push(e[0]);var s=Number(e[1]);n?this.xSteps.push(isNaN(s)?!1:s):isNaN(s)||(this.xSteps[0]=s),this.xHighestCompleteStep.push(0)},i.prototype.handleStepPoint=function(t,e){if(e){if(this.xVal[t]===this.xVal[t+1]){this.xSteps[t]=this.xHighestCompleteStep[t]=this.xVal[t];return}this.xSteps[t]=iu([this.xVal[t],this.xVal[t+1]],e,0)/Wu(this.xPct[t],this.xPct[t+1]);var n=(this.xVal[t+1]-this.xVal[t])/this.xNumSteps[t],s=Math.ceil(Number(n.toFixed(3))-1),r=this.xVal[t]+this.xNumSteps[t]*s;this.xHighestCompleteStep[t]=r}},i}(),Wd={to:function(i){return i===void 0?"":i.toFixed(2)},from:Number},Km={target:"target",base:"base",origin:"origin",handle:"handle",handleLower:"handle-lower",handleUpper:"handle-upper",touchArea:"touch-area",horizontal:"horizontal",vertical:"vertical",background:"background",connect:"connect",connects:"connects",ltr:"ltr",rtl:"rtl",textDirectionLtr:"txt-dir-ltr",textDirectionRtl:"txt-dir-rtl",draggable:"draggable",drag:"state-drag",tap:"state-tap",active:"active",tooltip:"tooltip",pips:"pips",pipsHorizontal:"pips-horizontal",pipsVertical:"pips-vertical",marker:"marker",markerHorizontal:"marker-horizontal",markerVertical:"marker-vertical",markerNormal:"marker-normal",markerLarge:"marker-large",markerSub:"marker-sub",value:"value",valueHorizontal:"value-horizontal",valueVertical:"value-vertical",valueNormal:"value-normal",valueLarge:"value-large",valueSub:"value-sub"},yn={tooltips:".__tooltips",aria:".__aria"};function Xw(i,t){if(!Ti(t))throw new Error("noUiSlider: 'step' is not numeric.");i.singleStep=t}function Jw(i,t){if(!Ti(t))throw new Error("noUiSlider: 'keyboardPageMultiplier' is not numeric.");i.keyboardPageMultiplier=t}function Qw(i,t){if(!Ti(t))throw new Error("noUiSlider: 'keyboardMultiplier' is not numeric.");i.keyboardMultiplier=t}function tx(i,t){if(!Ti(t))throw new Error("noUiSlider: 'keyboardDefaultStep' is not numeric.");i.keyboardDefaultStep=t}function ex(i,t){if(typeof t!="object"||Array.isArray(t))throw new Error("noUiSlider: 'range' is not an object.");if(t.min===void 0||t.max===void 0)throw new Error("noUiSlider: Missing 'min' or 'max' in 'range'.");i.spectrum=new Ym(t,i.snap||!1,i.singleStep)}function ix(i,t){if(t=ll(t),!Array.isArray(t)||!t.length)throw new Error("noUiSlider: 'start' option is incorrect.");i.handles=t.length,i.start=t}function nx(i,t){if(typeof t!="boolean")throw new Error("noUiSlider: 'snap' option must be a boolean.");i.snap=t}function sx(i,t){if(typeof t!="boolean")throw new Error("noUiSlider: 'animate' option must be a boolean.");i.animate=t}function rx(i,t){if(typeof t!="number")throw new Error("noUiSlider: 'animationDuration' option must be a number.");i.animationDuration=t}function Xm(i,t){var e=[!1],n;if(t==="lower"?t=[!0,!1]:t==="upper"&&(t=[!1,!0]),t===!0||t===!1){for(n=1;n1)throw new Error("noUiSlider: 'padding' option must not exceed 100% of the range.")}}function cx(i,t){switch(t){case"ltr":i.dir=0;break;case"rtl":i.dir=1;break;default:throw new Error("noUiSlider: 'direction' option was not recognized.")}}function ux(i,t){if(typeof t!="string")throw new Error("noUiSlider: 'behaviour' must be a string containing options.");var e=t.indexOf("tap")>=0,n=t.indexOf("drag")>=0,s=t.indexOf("fixed")>=0,r=t.indexOf("snap")>=0,a=t.indexOf("hover")>=0,l=t.indexOf("unconstrained")>=0,h=t.indexOf("invert-connects")>=0,c=t.indexOf("drag-all")>=0,d=t.indexOf("smooth-steps")>=0;if(s){if(i.handles!==2)throw new Error("noUiSlider: 'fixed' behaviour must be used with 2 handles");Jm(i,i.start[1]-i.start[0])}if(h&&i.handles!==2)throw new Error("noUiSlider: 'invert-connects' behaviour must be used with 2 handles");if(l&&(i.margin||i.limit))throw new Error("noUiSlider: 'unconstrained' behaviour cannot be used with margin or limit");i.events={tap:e||r,drag:n,dragAll:c,smoothSteps:d,fixed:s,snap:r,hover:a,unconstrained:l,invertConnects:h}}function hx(i,t){if(t!==!1)if(t===!0||Ba(t)){i.tooltips=[];for(var e=0;e= 2) required for mode 'count'.");for(var N=P.values-1,U=100/N,lt=[];N--;)lt[N]=N*U;return lt.push(100),kt(lt,P.stepped)}return P.mode===Sn.Positions?kt(P.values,P.stepped):P.mode===Sn.Values?P.stepped?P.values.map(function(ht){return v.fromStepping(v.getStep(v.toStepping(ht)))}):P.values:[]}function kt(P,N){return P.map(function(U){return v.fromStepping(N?v.getStep(U):U)})}function Mt(P){function N(zt,mt){return Number((zt+mt).toFixed(7))}var U=vt(P),lt={},ht=v.xVal[0],ft=v.xVal[v.xVal.length-1],Lt=!1,xt=!1,Qt=0;return U=Vw(U.slice().sort(function(zt,mt){return zt-mt})),U[0]!==ht&&(U.unshift(ht),Lt=!0),U[U.length-1]!==ft&&(U.push(ft),xt=!0),U.forEach(function(zt,mt){var ne,qt,de,Ee=zt,pe=U[mt+1],be,Di,_s,Qs,_o,tr,yo,er=P.mode===Sn.Steps;for(er&&(ne=v.xNumSteps[mt]),ne||(ne=pe-Ee),pe===void 0&&(pe=Ee),ne=Math.max(ne,1e-7),qt=Ee;qt<=pe;qt=N(qt,ne)){for(be=v.toStepping(qt),Di=be-Qt,_o=Di/(P.density||1),tr=Math.round(_o),yo=Di/tr,de=1;de<=tr;de+=1)_s=Qt+de*yo,lt[_s.toFixed(5)]=[v.fromStepping(_s),0];Qs=U.indexOf(qt)>-1?We.LargeValue:er?We.SmallValue:We.NoValue,!mt&&Lt&&qt!==pe&&(Qs=0),qt===pe&&xt||(lt[be.toFixed(5)]=[qt,Qs]),Qt=be}}),lt}function ct(P,N,U){var lt,ht,ft=x.createElement("div"),Lt=(lt={},lt[We.None]="",lt[We.NoValue]=t.cssClasses.valueNormal,lt[We.LargeValue]=t.cssClasses.valueLarge,lt[We.SmallValue]=t.cssClasses.valueSub,lt),xt=(ht={},ht[We.None]="",ht[We.NoValue]=t.cssClasses.markerNormal,ht[We.LargeValue]=t.cssClasses.markerLarge,ht[We.SmallValue]=t.cssClasses.markerSub,ht),Qt=[t.cssClasses.valueHorizontal,t.cssClasses.valueVertical],zt=[t.cssClasses.markerHorizontal,t.cssClasses.markerVertical];Fe(ft,t.cssClasses.pips),Fe(ft,t.ort===0?t.cssClasses.pipsHorizontal:t.cssClasses.pipsVertical);function mt(qt,de){var Ee=de===t.cssClasses.value,pe=Ee?Qt:zt,be=Ee?Lt:xt;return de+" "+pe[t.ort]+" "+be[qt]}function ne(qt,de,Ee){if(Ee=N?N(de,Ee):Ee,Ee!==We.None){var pe=K(ft,!1);pe.className=mt(Ee,t.cssClasses.marker),pe.style[t.style]=qt+"%",Ee>We.NoValue&&(pe=K(ft,!1),pe.className=mt(Ee,t.cssClasses.value),pe.setAttribute("data-value",String(de)),pe.style[t.style]=qt+"%",pe.innerHTML=String(U.to(de)))}}return Object.keys(P).forEach(function(qt){ne(qt,P[qt][0],P[qt][1])}),ft}function bt(){p&&($d(p),p=null)}function yt(P){bt();var N=Mt(P),U=P.filter,lt=P.format||{to:function(ht){return String(Math.round(ht))}};return p=a.appendChild(ct(N,U,lt)),p}function Wt(){var P=l.getBoundingClientRect(),N="offset"+["Width","Height"][t.ort];return t.ort===0?P.width||l[N]:P.height||l[N]}function Pt(P,N,U,lt){var ht=function(Lt){var xt=J(Lt,lt.pageOffset,lt.target||N);if(!xt||it()&&!lt.doNotReject||Hw(a,t.cssClasses.tap)&&!lt.doNotReject||P===n.start&&xt.buttons!==void 0&&xt.buttons>1||lt.hover&&xt.buttons)return!1;r||xt.preventDefault(),xt.calcPoint=xt.points[t.ort],U(xt,lt)},ft=[];return P.split(" ").forEach(function(Lt){N.addEventListener(Lt,ht,r?{passive:!0}:!1),ft.push([Lt,ht])}),ft}function J(P,N,U){var lt=P.type.indexOf("touch")===0,ht=P.type.indexOf("mouse")===0,ft=P.type.indexOf("pointer")===0,Lt=0,xt=0;if(P.type.indexOf("MSPointer")===0&&(ft=!0),P.type==="mousedown"&&!P.buttons&&!P.touches)return!1;if(lt){var Qt=function(ne){var qt=ne.target;return qt===U||U.contains(qt)||P.composed&&P.composedPath().shift()===U};if(P.type==="touchstart"){var zt=Array.prototype.filter.call(P.touches,Qt);if(zt.length>1)return!1;Lt=zt[0].pageX,xt=zt[0].pageY}else{var mt=Array.prototype.find.call(P.changedTouches,Qt);if(!mt)return!1;Lt=mt.pageX,xt=mt.pageY}}return N=N||Zm(x),(ht||ft)&&(Lt=P.clientX+N.x,xt=P.clientY+N.y),P.pageOffset=N,P.points=[Lt,xt],P.cursor=ht||ft,P}function O(P){var N=P-zw(l,t.ort),U=N*100/Wt();return U=Ud(U),t.dir?100-U:U}function k(P){var N=100,U=!1;return c.forEach(function(lt,ht){if(!G(ht)){var ft=_[ht],Lt=Math.abs(ft-P),xt=Lt===100&&N===100,Qt=Ltft;(Qt||zt||xt)&&(U=ht,N=Lt)}}),U}function A(P,N){P.type==="mouseout"&&P.target.nodeName==="HTML"&&P.relatedTarget===null&&B(P,N)}function M(P,N){if(navigator.appVersion.indexOf("MSIE 9")===-1&&P.buttons===0&&N.buttonsProperty!==0)return B(P,N);var U=(t.dir?-1:1)*(P.calcPoint-N.startCalcPoint),lt=U*100/N.baseSize;Oe(U>0,lt,N.locations,N.handleNumbers,N.connect)}function B(P,N){N.handle&&(va(N.handle,t.cssClasses.active),T-=1),N.listeners.forEach(function(U){D.removeEventListener(U[0],U[1])}),T===0&&(va(a,t.cssClasses.drag),He(),P.cursor&&(V.style.cursor="",V.removeEventListener("selectstart",Hd))),t.events.smoothSteps&&(N.handleNumbers.forEach(function(U){ye(U,_[U],!0,!0,!1,!1)}),N.handleNumbers.forEach(function(U){Ct("update",U)})),N.handleNumbers.forEach(function(U){Ct("change",U),Ct("set",U),Ct("end",U)})}function R(P,N){if(!N.handleNumbers.some(G)){var U;if(N.handleNumbers.length===1){var lt=c[N.handleNumbers[0]];U=lt.children[0],T+=1,Fe(U,t.cssClasses.active)}P.stopPropagation();var ht=[],ft=Pt(n.move,D,M,{target:P.target,handle:U,connect:N.connect,listeners:ht,startCalcPoint:P.calcPoint,baseSize:Wt(),pageOffset:P.pageOffset,handleNumbers:N.handleNumbers,buttonsProperty:P.buttons,locations:_.slice()}),Lt=Pt(n.end,D,B,{target:P.target,handle:U,listeners:ht,doNotReject:!0,handleNumbers:N.handleNumbers}),xt=Pt("mouseout",D,A,{target:P.target,handle:U,listeners:ht,doNotReject:!0,handleNumbers:N.handleNumbers});ht.push.apply(ht,ft.concat(Lt,xt)),P.cursor&&(V.style.cursor=getComputedStyle(P.target).cursor,c.length>1&&Fe(a,t.cssClasses.drag),V.addEventListener("selectstart",Hd,!1)),N.handleNumbers.forEach(function(Qt){Ct("start",Qt)})}}function I(P){P.stopPropagation();var N=O(P.calcPoint),U=k(N);U!==!1&&(t.events.snap||jd(a,t.cssClasses.tap,t.animationDuration),ye(U,N,!0,!0),He(),Ct("slide",U,!0),Ct("update",U,!0),t.events.snap?R(P,{handleNumbers:[U]}):(Ct("change",U,!0),Ct("set",U,!0)))}function H(P){var N=O(P.calcPoint),U=v.getStep(N),lt=v.fromStepping(U);Object.keys(S).forEach(function(ht){ht.split(".")[0]==="hover"&&S[ht].forEach(function(ft){ft.call(Ai,lt)})})}function X(P,N){if(it()||G(N))return!1;var U=["Left","Right"],lt=["Down","Up"],ht=["PageDown","PageUp"],ft=["Home","End"];t.dir&&!t.ort?U.reverse():t.ort&&!t.dir&&(lt.reverse(),ht.reverse());var Lt=P.key.replace("Arrow",""),xt=Lt===ht[0],Qt=Lt===ht[1],zt=Lt===lt[0]||Lt===U[0]||xt,mt=Lt===lt[1]||Lt===U[1]||Qt,ne=Lt===ft[0],qt=Lt===ft[1];if(!zt&&!mt&&!ne&&!qt)return!0;P.preventDefault();var de;if(mt||zt){var Ee=zt?0:1,pe=Nt(N),be=pe[Ee];if(be===null)return!1;be===!1&&(be=v.getDefaultStep(_[N],zt,t.keyboardDefaultStep)),Qt||xt?be*=t.keyboardPageMultiplier:be*=t.keyboardMultiplier,be=Math.max(be,1e-7),be=(zt?-1:1)*be,de=b[N]+be}else qt?de=t.spectrum.xVal[t.spectrum.xVal.length-1]:de=t.spectrum.xVal[0];return ye(N,v.toStepping(de),!0,!0),Ct("slide",N),Ct("update",N),Ct("change",N),Ct("set",N),!1}function ut(P){P.fixed||c.forEach(function(N,U){Pt(n.start,N.children[0],R,{handleNumbers:[U]})}),P.tap&&Pt(n.start,l,I,{}),P.hover&&Pt(n.move,l,H,{hover:!0}),P.drag&&d.forEach(function(N,U){if(!(N===!1||U===0||U===d.length-1)){var lt=c[U-1],ht=c[U],ft=[N],Lt=[lt,ht],xt=[U-1,U];Fe(N,t.cssClasses.draggable),P.fixed&&(ft.push(lt.children[0]),ft.push(ht.children[0])),P.dragAll&&(Lt=c,xt=w),ft.forEach(function(Qt){Pt(n.start,Qt,R,{handles:Lt,handleNumbers:xt,connect:N})})}})}function gt(P,N){S[P]=S[P]||[],S[P].push(N),P.split(".")[0]==="update"&&c.forEach(function(U,lt){Ct("update",lt)})}function _t(P){return P===yn.aria||P===yn.tooltips}function St(P){var N=P&&P.split(".")[0],U=N?P.substring(N.length):P;Object.keys(S).forEach(function(lt){var ht=lt.split(".")[0],ft=lt.substring(ht.length);(!N||N===ht)&&(!U||U===ft)&&(!_t(ft)||U===ft)&&delete S[lt]})}function Ct(P,N,U){Object.keys(S).forEach(function(lt){var ht=lt.split(".")[0];P===ht&&S[lt].forEach(function(ft){ft.call(Ai,b.map(t.format.to),N,b.slice(),U||!1,_.slice(),Ai)})})}function ee(P,N,U,lt,ht,ft,Lt){var xt;return c.length>1&&!t.events.unconstrained&&(lt&&N>0&&(xt=v.getAbsoluteDistance(P[N-1],t.margin,!1),U=Math.max(U,xt)),ht&&N1&&t.limit&&(lt&&N>0&&(xt=v.getAbsoluteDistance(P[N-1],t.limit,!1),U=Math.min(U,xt)),ht&&N1?lt.forEach(function(ne,qt){var de=ee(ft,ne,ft[ne]+N,Qt[qt],zt[qt],!1,xt);de===!1?N=0:(N=de-ft[ne],ft[ne]=de)}):Qt=zt=[!0];var mt=!1;lt.forEach(function(ne,qt){mt=ye(ne,U[ne]+N,Qt[qt],zt[qt],!1,xt)||mt}),mt&&(lt.forEach(function(ne){Ct("update",ne),Ct("slide",ne)}),ht!=null&&Ct("drag",Lt))}function Ie(P,N){return t.dir?100-P-N:P}function Le(P,N){_[P]=N,b[P]=v.fromStepping(N);var U=Ie(N,0)-$,lt="translate("+Jt(U+"%","0")+")";if(c[P].style[t.transformRule]=lt,t.events.invertConnects&&_.length>1){var ht=_.every(function(ft,Lt,xt){return Lt===0||ft>=xt[Lt-1]});if(C!==!ht){Vn();return}}Ge(P),Ge(P+1),C&&(Ge(P-1),Ge(P+2))}function He(){w.forEach(function(P){var N=_[P]>50?-1:1,U=3+(c.length+N*P);c[P].style.zIndex=String(U)})}function ye(P,N,U,lt,ht,ft){return ht||(N=ee(_,P,N,U,lt,!1,ft)),N===!1?!1:(Le(P,N),!0)}function Ge(P){if(d[P]){var N=_.slice();C&&N.sort(function(xt,Qt){return xt-Qt});var U=0,lt=100;P!==0&&(U=N[P-1]),P!==d.length-1&&(lt=N[P]);var ht=lt-U,ft="translate("+Jt(Ie(U,ht)+"%","0")+")",Lt="scale("+Jt(ht/100,"1")+")";d[P].style[t.transformRule]=ft+" "+Lt}}function yi(P,N){return P===null||P===!1||P===void 0||(typeof P=="number"&&(P=String(P)),P=t.format.from(P),P!==!1&&(P=v.toStepping(P)),P===!1||isNaN(P))?_[N]:P}function bi(P,N,U){var lt=ll(P),ht=_[0]===void 0;N=N===void 0?!0:N,t.animate&&!ht&&jd(a,t.cssClasses.tap,t.animationDuration),w.forEach(function(xt){ye(xt,yi(lt[xt],xt),!0,!1,U)});var ft=w.length===1?0:1;if(ht&&v.hasNoSize()&&(U=!0,_[0]=0,w.length>1)){var Lt=100/(w.length-1);w.forEach(function(xt){_[xt]=xt*Lt})}for(;ft=0&&PU.stepAfter.startValue&&(ht=U.stepAfter.startValue-lt),lt>U.thisStep.startValue?ft=U.thisStep.step:U.stepBefore.step===!1?ft=!1:ft=lt-U.stepBefore.highestStep,N===100?ht=null:N===0&&(ft=null);var Lt=v.countStepDecimals();return ht!==null&&ht!==!1&&(ht=Number(ht.toFixed(Lt))),ft!==null&&ft!==!1&&(ft=Number(ft.toFixed(Lt))),[ft,ht]}function ke(){return w.map(Nt)}function Ae(P,N){var U=At(),lt=["margin","limit","padding","range","animate","snap","step","format","pips","tooltips","connect"];lt.forEach(function(ft){P[ft]!==void 0&&(e[ft]=P[ft])});var ht=Qm(e);lt.forEach(function(ft){P[ft]!==void 0&&(t[ft]=ht[ft])}),v=ht.spectrum,t.margin=ht.margin,t.limit=ht.limit,t.padding=ht.padding,t.pips?yt(t.pips):bt(),t.tooltips?dt():W(),_=[],bi(eu(P.start)?P.start:U,N),P.connect&&ui()}function ui(){for(;h.firstChild;)h.removeChild(h.firstChild);for(var P=0;P<=t.handles;P++)d[P]=rt(h,t.connect[P]),Ge(P);ut({drag:t.events.drag,fixed:!0})}function Vn(){C=!C,Xm(t,t.connect.map(function(P){return!P})),ui()}function wi(){l=tt(a),z(t.connect,l),ut(t.events),bi(t.start),t.pips&&yt(t.pips),t.tooltips&&dt(),nt()}wi();var Ai={destroy:Ht,steps:ke,on:gt,off:St,get:At,set:bi,setHandle:Et,reset:et,disable:Z,enable:st,__moveHandles:function(P,N,U){Oe(P,N,_,U)},options:e,updateOptions:Ae,target:a,removePips:bt,removeTooltips:W,getPositions:function(){return _.slice()},getTooltips:function(){return g},getOrigins:function(){return c},pips:yt};return Ai}function bx(i,t){if(!i||!i.nodeName)throw new Error("noUiSlider: create requires a single element, got: "+i);if(i.noUiSlider)throw new Error("noUiSlider: Slider was already initialized.");var e=Qm(t),n=yx(i,e,t);return i.noUiSlider=n,n}const wx={__spectrum:Ym,cssClasses:Km,create:bx},Is={ready:"INPUT_RANGE_SLIDER_READY",apply:"INPUT_RANGE_SLIDER_APPLY",slide:"INPUT_RANGE_SLIDER_SLIDE",input:"INPUT_RANGE_SLIDER_INPUT"},bn={input:".__input-field__",inputFrom:".__input-range-slider-from__",inputTo:".__input-range-slider-to__",slider:".__input-range-slider___",hiddenFrom:".__input-range-slider-value-from__",hiddenTo:".__input-range-slider-value-to__",applyButton:".__input-apply-button__"},vr={mask:"data-mask",maskMin:"data-mask-min",maskMax:"data-mask-max",start:"data-start",prefix:"data-prefix-symbol",suffix:"data-suffix-symbol"};class xx extends Kt{constructor(t){super(t),this.applyButton=this.element.querySelector(bn.applyButton),this.inputFrom=this.element.querySelector(bn.inputFrom),this.inputTo=this.element.querySelector(bn.inputTo),this.prefix=this.element.getAttribute(vr.prefix),this.suffix=this.element.getAttribute(vr.suffix),this.inputFromComponent=null,this.inputToComponent=null,this.min=0,this.max=0,this.initStart=[0,0],this.currentMinMax=[0,0],this.cacheMinMax=[0,0],this.slider=null,this.hiddenInputFrom=this.element.querySelector(bn.hiddenFrom),this.hiddenInputTo=this.element.querySelector(bn.hiddenTo),setTimeout(()=>{this.init(),this.addListeners()},10)}isValid(t){const[e,n]=t;return!(e===0&&n===0||(n||this.max)>this.max||e>n)}update(t){var e,n,s;if(this.isValid(t)){const[r,a]=t;if(r>a)return;this.currentMinMax=t,this.cacheMinMax=this.currentMinMax,(e=this.inputFromComponent)==null||e.setValue(`${r}`),(n=this.inputToComponent)==null||n.setValue(`${a}`),(s=this.slider)==null||s.updateOptions({start:[r,a]},!1)}}getCurrent(){return this.currentMinMax}getCache(){return this.cacheMinMax}getPrefix(){return this.prefix}getSuffix(){return this.suffix}onClickApply(){if(!this.isValid(this.currentMinMax))return;const[t,e]=this.currentMinMax;this.hiddenInputFrom.value=`${this.currentMinMax[0]||this.min}`,this.hiddenInputTo.value=`${this.currentMinMax[1]||this.max}`,this.cacheMinMax=this.currentMinMax;const n=t!==this.min||(e||this.max)!==this.max,s=t==this.min&&(e||this.max)==this.max,r=`${this.currentMinMax[0]} - ${this.currentMinMax[1]}`,a=s?"":r;this.trigger(Is.apply,{max:e||this.max,min:t||this.min,value:a,prefix:this.prefix,suffix:this.suffix,isChanged:n,slider:this})}destroy(){var t;super.destroy(),(t=this.slider)==null||t.destroy(),this.slider=null}onSlide(t){var s,r;const[e,n]=t;this.currentMinMax=[e,n||this.max],(s=this.inputFromComponent)==null||s.setValue(`${e}`),(r=this.inputToComponent)==null||r.setValue(`${n||this.max}`),this.applyButton||(this.hiddenInputFrom.value=`${this.currentMinMax[0]||this.min}`,this.hiddenInputTo.value=`${this.currentMinMax[1]||this.max}`,this.cacheMinMax=this.currentMinMax),this.trigger(Is.slide,{max:n||this.max,min:e,value:`${e} - ${n||this.max}`})}onInput(t){var d,p;const e=t.target,n=(d=this.inputFromComponent)!=null&&d.getInput().isEqualNode(e)?"from":"to",s=n==="from"?this.inputFromComponent:this.inputToComponent,r=s==null?void 0:s.getMasked(),a=r?r.unmaskedValue:e.value,l=parseInt(`${n==="from"?a||this.min:a||this.max}`),h=n==="from"?l:this.currentMinMax[0],c=n==="to"?l:this.currentMinMax[1]||this.max;(p=this.slider)==null||p.updateOptions({start:[h,c]},!1),this.currentMinMax=[h,c],this.trigger(Is.input,{max:c,min:h,value:`${h} - ${c}`})}init(){var s,r,a,l,h,c,d,p,g,v,b,_;this.inputFromComponent=this.getComponentByNode(he,this.inputFrom),this.inputToComponent=this.getComponentByNode(he,this.inputTo),this.min=parseInt(((a=(r=(s=this.inputFromComponent)==null?void 0:s.getElement())==null?void 0:r.querySelector(bn.input))==null?void 0:a.getAttribute(vr.maskMin))||"0"),this.max=parseInt(((c=(h=(l=this.inputFromComponent)==null?void 0:l.getElement())==null?void 0:h.querySelector(bn.input))==null?void 0:c.getAttribute(vr.maskMax))||"0");const t=JSON.parse(this.element.getAttribute(vr.start)||"[]"),e=t.length?t[0]:this.min,n=t.length?t[1]:this.max;this.currentMinMax=[e,n],this.cacheMinMax=this.currentMinMax,(d=this.inputFromComponent)==null||d.setValue(`${e}`),(p=this.inputToComponent)==null||p.setValue(`${n}`);try{this.slider=wx.create(this.element.querySelector(bn.slider),{connect:!0,start:[e,n],range:{min:this.min,max:this.max},format:{to:w=>Math.floor(w),from:w=>parseInt(w)}}),(g=this.inputFromComponent)==null||g.setValue(`${e}`),(v=this.inputToComponent)==null||v.setValue(`${n}`),this.slider.on("slide",this.onSlide.bind(this)),(b=this.inputFromComponent)==null||b.getInput().addEventListener("input",this.onInput.bind(this),{signal:this.abortController.signal}),(_=this.inputToComponent)==null||_.getInput().addEventListener("input",this.onInput.bind(this),{signal:this.abortController.signal}),this.hiddenInputFrom.value=`${e}`,this.hiddenInputTo.value=`${n}`,this.trigger(Is.ready,{start:[e,n],max:this.max,min:this.min,prefix:this.prefix,suffix:this.suffix,value:`${e} - ${n}`})}catch(w){console.log("error init input range slider",w)}}addListeners(){this.applyButton&&this.applyButton.addEventListener("click",this.onClickApply.bind(this),{signal:this.abortController.signal}),this.inputFromComponent=this.getComponentByNode(he,this.inputFrom),this.inputToComponent=this.getComponentByNode(he,this.inputTo)}}const qn={input:".__input-field__",inputPrefix:".__input-prefix__",inputSuffix:".__input-suffix__",selectComponent:".__select-input__",inputComponent:".__input-range-field__",sliderComponent:".__input-range-slider-element__",dropdown:".__input-range-dropdown__"},qd={startValues:"data-start-values",badge:"data-with-badge"},Ye={active:"input-range_active",activeRt:"input-range_active-rt",badge:"input_badge",prefixVisible:"input__prefix_visible",suffixVisible:"input__suffix_visible"};class Sx extends Kt{constructor(t){super(t),this.input=this.element.querySelector(qn.input),this.inputPrefix=this.element.querySelector(qn.inputPrefix),this.inputSuffix=this.element.querySelector(qn.inputSuffix),this.selectComponentNode=this.element.querySelector(qn.selectComponent),this.inputComponentNode=this.element.querySelector(qn.inputComponent),this.sliderComponentNodes=this.element.querySelectorAll(qn.sliderComponent),this.dropdown=this.element.querySelector(qn.dropdown),this.isBadged=!!this.element.getAttribute(qd.badge),this.isSetStartValues=this.element.hasAttribute(qd.startValues),this.cacheValue=this.input.value,this.slider=null,this.sliders=[],this.select=null,this.inputField=null,setTimeout(()=>{this.init(),this.addListeners()})}setActive(t){const e=t?"add":"remove";this.isRightSidePosition()&&this.element.classList.add(Ye.activeRt),t||this.element.classList.remove(Ye.activeRt),this.element.classList[e](Ye.active)}onFocus(){this.setActive(!0)}onFocusOut(){setTimeout(()=>{var e;this.element.contains(document.activeElement)||(e=document.activeElement)!=null&&e.isEqualNode(document.body)||this.setActive(!1)})}onSelect(t){var n,s;const{option:e}=t.detail;e.value||((n=this.inputField)==null||n.setValue(""),this.cacheValue="",(s=this.inputComponentNode)==null||s.classList.remove(Ye.badge),this.setActive(!1)),!e.value&&this.inputPrefix&&(this.inputPrefix.classList.remove(Ye.prefixVisible),this.inputPrefix.textContent="")}onClickApply(t){var v,b;const{value:e,isChanged:n,prefix:s,suffix:r,slider:a}=t.detail,l=this.isBadged&&n,h=e&&(s||""),c=e&&(r||""),d=l?"add":"remove",p=h?"add":"remove",g=c?"add":"remove";(v=this.inputComponentNode)==null||v.classList[d](Ye.badge),this.inputPrefix&&s&&(this.inputPrefix.classList[p](Ye.prefixVisible),this.inputPrefix.textContent=h),this.inputSuffix&&r&&(this.inputSuffix.classList[g](Ye.suffixVisible),this.inputSuffix.textContent=c),(b=this.inputField)==null||b.setValue(e),this.cacheValue=this.input.value,a&&(a.hiddenInputFrom.dispatchEvent(new Event("input")),a.hiddenInputTo.dispatchEvent(new Event("input"))),this.setActive(!1)}onClickOutside(t){var s;const e=t.target,n=this.element.classList.contains(Ye.active);if(!Bu(this.element,e)&&n){const r=this.getComponentByNode(he,this.inputComponentNode);this.setActive(!1),(s=this.slider)==null||s.update(this.slider.getCache()),r.setValue(this.cacheValue)}}isRightSidePosition(){return window.innerWidth/2D.getElement().id===c.value),C=S==null?void 0:S.getPrefix(),x=S==null?void 0:S.getSuffix();C&&((w=this.inputPrefix)==null||w.classList.add(Ye.prefixVisible),this.inputPrefix.textContent=C||""),x&&((T=this.inputSuffix)==null||T.classList.add(Ye.suffixVisible),this.inputSuffix.textContent=x||"")}}init(){var t;this.inputField=this.getComponentByNode(he,this.inputComponentNode),this.sliders=Array.from(this.sliderComponentNodes).map(e=>this.getComponentByNode(he,e)),this.selectComponentNode&&(this.select=this.getComponentByNode(he,this.selectComponentNode),(t=this.select)==null||t.on(cn.change,this.onSelect.bind(this))),this.sliders.length===1&&(this.slider=this.sliders.at(0)||null),this.sliders.forEach(e=>{e==null||e.on(Is.apply,this.onClickApply.bind(this)),e==null||e.on(Is.ready,this.onReadySlider.bind(this))})}addListeners(){var t,e;(t=this.input)==null||t.addEventListener("focus",this.onFocus.bind(this),{signal:this.abortController.signal}),(e=this.element)==null||e.addEventListener("focusout",this.onFocusOut.bind(this),{signal:this.abortController.signal}),document.addEventListener("mousedown",this.onClickOutside.bind(this),{signal:this.abortController.signal})}}const kx={maxButton:".__input-max-button__"},Ex={maxValue:"data-mask-max"};class Cx extends Gm{constructor(t){super(t),this.maxButton=null}onSetMaxValue(t){t.preventDefault();const e=this.input.getAttribute(Ex.maxValue);this.setValue(e)}addListeners(){var t;super.addListeners(),this.maxButton=this.element.querySelector(kx.maxButton),(t=this.maxButton)==null||t.addEventListener("click",this.onSetMaxValue.bind(this))}}const Gd={selectId:"data-select-id",initId:"data-init-id"},wn={containerHidden:"input-group-switcher_hidden",hidden:"hidden"};class Tx extends Kt{constructor(t){super(t),this.selectComponent=null,this.childrenComponents=[],this.activeComponent=null,setTimeout(()=>{this.init()})}onSelectChange(t){var s,r;const e=t.detail.option.value,n=this.childrenComponents.find(a=>a.getElement().id===e);if(!e){this.element.classList.add(wn.containerHidden);return}n?(this.element.classList.remove(wn.containerHidden),this.childrenComponents.forEach(a=>{a.getElement().classList.add("hidden")}),(r=(s=n==null?void 0:n.getElement())==null?void 0:s.classList)==null||r.remove(wn.hidden),this.activeComponent=n):(this.activeComponent=null,this.childrenComponents.forEach(a=>{a.getElement().classList.remove("hidden")}))}init(){var n;const t=this.element.getAttribute(Gd.initId),e=document.getElementById(this.element.getAttribute(Gd.selectId)||"");e&&(this.selectComponent=this.getComponentByNode(he,e),(n=this.selectComponent)==null||n.on(cn.change,this.onSelectChange.bind(this)),Array.from(this.element.children).map(s=>{const r=this.getComponentByNode(he,s);if(r)this.childrenComponents.push(r);else return;t==="all"?(this.element.classList.remove(wn.containerHidden),r.getElement().classList.remove(wn.hidden)):r.getElement().classList.add(wn.hidden),r&&r.getElement().id===t&&(this.activeComponent=r,this.element.classList.remove(wn.containerHidden),r.getElement().classList.remove(wn.hidden))}))}}const Mx=({src:i,name:t,index:e,alt:n})=>{const s=`
${n||
`,r=document.createElement("div");return r.innerHTML=s,r.firstElementChild},Lx=({name:i,index:t})=>{const e=`
${i|| ${i}
`,n=document.createElement("div");return n.innerHTML=e,n.firstElementChild},Pe={dropzone:".__droparea-zone__",input:".__droparea-input__",preview:".__droparea-preview__",imagePreview:".__dropdown-image__",image:".__droparea-image-src__",imageClose:".__droparea-image-close__",imageNav:".__droparea-image-nav__",imageNavLeft:".__droparea-image-nav-left__",imageNavRight:".__droparea-image-nav-right__"},Gn={indexPreviewImage:"data-index"},Ki={hover:"droparea_hover",previewVisible:"droparea__preview_visible",firstImageNav:"droparea__image-nav_first",lastImageNav:"droparea__image-nav_last"},Zd=["dragenter","dragover","dragleave","drop"],Yd=50;class Ax extends Kt{constructor(t){super(t),this.files=[],this.hiddenInputsName="",this.dropzone=this.element.querySelector(Pe.dropzone),this.input=this.element.querySelector(Pe.input),this.eventHandler=this.eventHandler.bind(this),this.onInputChange=this.onInputChange.bind(this),this.init(),this.addListeners()}addHover(){this.element.classList.add(Ki.hover)}removeHover(){this.element.classList.remove(Ki.hover)}isValidFile(t){return t.size/1048576>Yd?(Pn.push({title:"File size exceeds acceptable size",content:`The file "${t.name}" exceeds ${Yd}Mb`,style:"alert"}),!1):!0}addFile(t){this.isValidFile(t)&&(this.files=this.files.filter(n=>n.name!==t.name),this.files=[...this.files,t])}dropHandler(t){const e=this.files.length;Array.from(t).filter(s=>!this.files.find(a=>a.name===s.name)).forEach(this.addFile.bind(this)),this.files.forEach((s,r)=>{r>e-1&&(s.type.includes("image")?this.insertPreviewImage({file:s,index:r}):this.insertPreviewFile({file:s,index:r}))}),this.fixPreviewImageNavArrows()}onInputChange(t){const e=this.files.length,n=t.target.files,s=Array.from(n).filter(r=>!this.files.find(l=>l.name===r.name));Array.from(s).forEach(this.addFile.bind(this)),this.files.forEach((r,a)=>{a>e-1&&(r.type.includes("image")?this.insertPreviewImage({file:r,index:a}):this.insertPreviewFile({file:r,index:a}))}),this.fixPreviewImageNavArrows()}setInputFiles(t){const e=new DataTransfer;t.forEach(n=>{e.items.add(n)}),this.input.files=e.files}eventHandler(t){var s;t.preventDefault();const e=t.type,n=t;(e==="dragenter"||e==="dragover")&&this.addHover(),(e==="dragleave"||e==="drop")&&this.removeHover(),e==="drop"&&this.dropHandler(Array.from((s=n.dataTransfer)==null?void 0:s.files))}insertPreviewFile({file:t,index:e}){var a;const n=Lx({name:t.name,index:e}),s=this.element.querySelector(Pe.preview);!s.classList.contains(Ki.previewVisible)&&s.classList.add(Ki.previewVisible),(a=n.querySelector(Pe.imageClose))==null||a.addEventListener("click",this.removeImage.bind(this)),s.appendChild(n),this.addPreviewCallback(n)}async insertPreviewImage({file:t,index:e}){var l;const n=URL.createObjectURL(t),s=Mx({src:n,index:e,name:this.hiddenInputsName||`${this.input.name||""}[]`,alt:t.name}),r=this.element.querySelector(Pe.preview);!r.classList.contains(Ki.previewVisible)&&r.classList.add(Ki.previewVisible),(l=s.querySelector(Pe.imageClose))==null||l.addEventListener("click",this.removeImage.bind(this)),r.appendChild(s),this.addPreviewCallback(s)}fixPreviewImageNavArrows(){this.element.querySelectorAll(Pe.imagePreview).forEach((t,e,n)=>{const s=e===0,r=e===n.length-1,a=s?"add":"remove",l=r?"add":"remove",h=t.querySelector(Pe.imageNav);h==null||h.classList[a](Ki.firstImageNav),h==null||h.classList[l](Ki.lastImageNav),t.setAttribute(Gn.indexPreviewImage,`${e}`)})}addPreviewCallback(t){const e=t.querySelector(Pe.imageNavLeft),n=t.querySelector(Pe.imageNavRight),s=t.querySelector(Pe.imageClose),r=parseInt(t.getAttribute(Gn.indexPreviewImage)||"");e&&e.addEventListener("click",()=>this.moveImage(t,r-1)),n&&n.addEventListener("click",()=>this.moveImage(t,r+1)),s&&s.addEventListener("click",this.removeImage.bind(this))}moveImage(t,e){const n=parseInt(t.getAttribute(Gn.indexPreviewImage)||""),s=!isNaN(e)&&e>=0&&e(d=[...d,g===e?a:g===n?r:p],d),[]);this.files=l,this.setInputFiles(this.files);const h=this.element.querySelector(`[${Gn.indexPreviewImage}="${e}"]`),c=h.innerHTML;h.setAttribute(Gn.indexPreviewImage,`${e}`),h.innerHTML=t.innerHTML,t.setAttribute(Gn.indexPreviewImage,`${n}`),t.innerHTML=c,this.addPreviewCallback(t),this.addPreviewCallback(h),this.fixPreviewImageNavArrows()}}removeImage(t){const e=t.target.closest(Pe.imagePreview),n=parseInt(e.getAttribute(Gn.indexPreviewImage)||"");if(isNaN(n))return;const r=e.querySelector(Pe.image).getAttribute("alt"),a=Array.from(this.input.files).filter(l=>l.name!==r);this.files=this.files.filter(l=>l.name!==r),this.setInputFiles(a),this.files.length===0&&this.element.querySelector(Pe.preview).classList.remove(Ki.previewVisible),e.remove(),this.fixPreviewImageNavArrows()}async loadFile(t){return fetch(t.getAttribute("src"),{mode:"no-cors"}).then(e=>e.blob()).then(e=>new File([e],t.getAttribute("alt")||"",e))}async init(){const t=Array.from(this.element.querySelectorAll(Pe.image));if(t.length===0)return;const e=t.map(s=>{var l;const r=this.loadFile(s),a=s.closest(Pe.imagePreview);return this.hiddenInputsName||(this.hiddenInputsName=a.querySelector("input").name||""),this.addPreviewCallback(a),(l=a.querySelector(Pe.imageClose))==null||l.addEventListener("click",this.removeImage.bind(this)),r});(await Promise.all(e)).forEach(s=>{this.addFile(s)})}destroy(){super.destroy(),Zd.forEach(t=>{this.dropzone.removeEventListener(t,this.eventHandler)}),this.input.removeEventListener("change",this.onInputChange)}addListeners(){Zd.forEach(t=>{this.dropzone.addEventListener(t,this.eventHandler)}),this.input.addEventListener("change",this.onInputChange)}}const Dx={modalContent:".__modal-content__"},nc={desktop:1439},sc={chatId:"data-chat-id",modalId:"data-modal-id",unread:"data-badge"},_r={ROOM_UPDATE:"chat.room.update",ROOM_JOIN:"chat.room.join",ROOM_LEAVE:"chat.room.leave",TOOLS_CLOSE:"chat.tools.close",DESTROY:"chat.destroy",READY:"chat.ready"};class Px extends Kt{constructor(t){var e;if(super(t),this.chatId=this.element.getAttribute(sc.chatId),this.modalId=this.element.getAttribute(sc.modalId),this.roomId="",this.modalElement=null,this.chatRootContainer=null,this.isJoinedRoom=!0,this.isOpenModal=()=>{var n;return(n=this.modalElement)==null?void 0:n.hasAttribute("open")},this.chatId&&this.modalId){const n=document.getElementById(this.chatId);this.chatRootContainer=n.parentElement,this.modalElement=document.getElementById(this.modalId),this.chatAttributes=n.attributes,this.roomId=(e=Array.from(this.chatAttributes).find(s=>s.name==="room-id"))==null?void 0:e.value,this.addListeners()}}insertChatTo(t){if(t){if(t.querySelector(`#${this.chatId}`))return;this.destroyChat();const n=document.createElement("chat-app");Array.from(this.chatAttributes).forEach(s=>{n.setAttribute(s.name,s.value)}),t.appendChild(n)}}joinRoom(){this.isJoinedRoom||(document.dispatchEvent(new CustomEvent(_r.ROOM_JOIN,{detail:{roomId:this.roomId}})),this.isJoinedRoom=!0)}leaveRoom(){this.isJoinedRoom&&(document.dispatchEvent(new CustomEvent(_r.ROOM_LEAVE)),this.isJoinedRoom=!1)}onChatClose(){const t=this.getComponentByNode(he,this.modalElement);t==null||t.close()}onChatRoomUpdate(t){this.element.setAttribute(sc.unread,t.detail.unread)}onModalClose(){window.innerWidth<=nc.desktop&&this.leaveRoom()}onModalOpen(){this.joinRoom()}handleBreakpoint(){var n;const t=window.innerWidth,e=this.getComponentByNode(he,this.modalElement);if(t<=nc.desktop){const s=(n=this.modalElement)==null?void 0:n.querySelector(Dx.modalContent);this.insertChatTo(s);return}this.isOpenModal()&&e.close(),this.insertChatTo(this.chatRootContainer)}onChatReady(){if(window.innerWidth<=nc.desktop){this.isJoinedRoom&&!this.isOpenModal()&&this.leaveRoom();return}this.joinRoom(),this.isJoinedRoom=!0}destroyChat(){const t=document.getElementById(this.chatId||"");if(t)try{t.destroy()}catch{t.remove()}}addListeners(){window.addEventListener("resize",this.handleBreakpoint.bind(this)),document.addEventListener(_r.TOOLS_CLOSE,this.onChatClose.bind(this)),document.addEventListener(_r.ROOM_UPDATE,t=>this.onChatRoomUpdate(t)),document.addEventListener(_r.READY,this.onChatReady.bind(this)),document.addEventListener("dialog-open",this.onModalOpen.bind(this)),document.addEventListener("dialog-close",this.onModalClose.bind(this)),this.handleBreakpoint()}}function Ho(i){if(typeof i!="string"||!i)throw new Error("expected a non-empty string, got: "+i)}function rc(i){if(typeof i!="number")throw new Error("expected a number, got: "+i)}const Ox=1,Ix=1,gs="emoji",zs="keyvalue",qu="favorites",Fx="tokens",tg="tokens",Rx="unicode",eg="count",Bx="group",Vx="order",ig="group-order",nu="eTag",Va="url",Kd="skinTone",Js="readonly",Gu="readwrite",ng="skinUnicodes",Nx="skinUnicodes",zx="https://cdn.jsdelivr.net/npm/emoji-picker-element-data@^1/en/emojibase/data.json",$x="en";function Hx(i,t){const e=new Set,n=[];for(const s of i){const r=t(s);e.has(r)||(e.add(r),n.push(s))}return n}function Xd(i){return Hx(i,t=>t.unicode)}function jx(i){function t(e,n,s){const r=n?i.createObjectStore(e,{keyPath:n}):i.createObjectStore(e);if(s)for(const[a,[l,h]]of Object.entries(s))r.createIndex(a,l,{multiEntry:h});return r}t(zs),t(gs,Rx,{[tg]:[Fx,!0],[ig]:[[Bx,Vx]],[ng]:[Nx,!0]}),t(qu,void 0,{[eg]:[""]})}const su={},_a={},Na={};function sg(i,t,e){e.onerror=()=>t(e.error),e.onblocked=()=>t(new Error("IDB blocked")),e.onsuccess=()=>i(e.result)}async function Ux(i){const t=await new Promise((e,n)=>{const s=indexedDB.open(i,Ox);su[i]=s,s.onupgradeneeded=r=>{r.oldVersionZu(i),t}function Wx(i){return _a[i]||(_a[i]=Ux(i)),_a[i]}function fn(i,t,e,n){return new Promise((s,r)=>{const a=i.transaction(t,e,{durability:"relaxed"}),l=typeof t=="string"?a.objectStore(t):t.map(c=>a.objectStore(c));let h;n(l,a,c=>{h=c}),a.oncomplete=()=>s(h),a.onerror=()=>r(a.error)})}function Zu(i){const t=su[i],e=t&&t.result;if(e){e.close();const n=Na[i];if(n)for(const s of n)s()}delete su[i],delete _a[i],delete Na[i]}function qx(i){return new Promise((t,e)=>{Zu(i);const n=indexedDB.deleteDatabase(i);sg(t,e,n)})}function Gx(i,t){let e=Na[i];e||(e=Na[i]=[]),e.push(t)}const Zx=new Set([":D","XD",":'D","O:)",":X",":P",";P","XP",":L",":Z",":j","8D","XO","8)",":B",":O",":S",":'o","Dx","X(","D:",":C",">0)",":3","!t.match(/\w/)||Zx.has(t)?t.toLowerCase():t.replace(/[)(:,]/g,"").replace(/’/g,"'").toLowerCase()).filter(Boolean)}const Yx=2;function rg(i){return i.filter(Boolean).map(t=>t.toLowerCase()).filter(t=>t.length>=Yx)}function Kx(i){return i.map(({annotation:e,emoticon:n,group:s,order:r,shortcodes:a,skins:l,tags:h,emoji:c,version:d})=>{const p=[...new Set(rg([...(a||[]).map(Vs).flat(),...(h||[]).map(Vs).flat(),...Vs(e),n]))].sort(),g={annotation:e,group:s,order:r,tags:h,tokens:p,unicode:c,version:d};if(n&&(g.emoticon=n),a&&(g.shortcodes=a),l){g.skinTones=[],g.skinUnicodes=[],g.skinVersions=[];for(const{tone:v,emoji:b,version:_}of l)g.skinTones.push(v),g.skinUnicodes.push(b),g.skinVersions.push(_)}return g})}function og(i,t,e,n){i[t](e).onsuccess=s=>n&&n(s.target.result)}function hs(i,t,e){og(i,"get",t,e)}function ag(i,t,e){og(i,"getAll",t,e)}function Yu(i){i.commit&&i.commit()}function Xx(i,t){let e=i[0];for(let n=1;nt(s)&&(e=s)}return e}function lg(i,t){const e=Xx(i,s=>s.length),n=[];for(const s of e)i.some(r=>r.findIndex(a=>t(a)===t(s))===-1)||n.push(s);return n}async function Jx(i){return!await Ku(i,zs,Va)}async function Qx(i,t,e){const[n,s]=await Promise.all([nu,Va].map(r=>Ku(i,zs,r)));return n===e&&s===t}async function tS(i,t){return fn(i,gs,Js,(n,s,r)=>{let a;const l=()=>{n.getAll(a&&IDBKeyRange.lowerBound(a,!0),50).onsuccess=h=>{const c=h.target.result;for(const d of c)if(a=d.unicode,t(d))return r(d);if(c.length<50)return r();l()}};l()})}async function cg(i,t,e,n){try{const s=Kx(t);await fn(i,[gs,zs],Gu,([r,a],l)=>{let h,c,d=0;function p(){++d===2&&g()}function g(){if(!(h===n&&c===e)){r.clear();for(const v of s)r.put(v);a.put(n,nu),a.put(e,Va),Yu(l)}}hs(a,nu,v=>{h=v,p()}),hs(a,Va,v=>{c=v,p()})})}finally{}}async function eS(i,t){return fn(i,gs,Js,(e,n,s)=>{const r=IDBKeyRange.bound([t,0],[t+1,0],!1,!0);ag(e.index(ig),r,s)})}async function ug(i,t){const e=rg(Vs(t));return e.length?fn(i,gs,Js,(n,s,r)=>{const a=[],l=()=>{a.length===e.length&&h()},h=()=>{const c=lg(a,d=>d.unicode);r(c.sort((d,p)=>d.order{a.push(g),l()})}}):[]}async function iS(i,t){const e=await ug(i,t);return e.length?e.filter(n=>(n.shortcodes||[]).map(r=>r.toLowerCase()).includes(t.toLowerCase()))[0]||null:await tS(i,s=>(s.shortcodes||[]).includes(t.toLowerCase()))||null}async function nS(i,t){return fn(i,gs,Js,(e,n,s)=>hs(e,t,r=>{if(r)return s(r);hs(e.index(ng),t,a=>s(a||null))}))}function Ku(i,t,e){return fn(i,t,Js,(n,s,r)=>hs(n,e,r))}function sS(i,t,e,n){return fn(i,t,Gu,(s,r)=>{s.put(n,e),Yu(r)})}function rS(i,t){return fn(i,qu,Gu,(e,n)=>hs(e,t,s=>{e.put((s||0)+1,t),Yu(n)}))}function oS(i,t,e){return e===0?[]:fn(i,[qu,gs],Js,([n,s],r,a)=>{const l=[];n.index(eg).openCursor(void 0,"prev").onsuccess=h=>{const c=h.target.result;if(!c)return a(l);function d(v){if(l.push(v),l.length===e)return a(l);c.continue()}const p=c.primaryKey,g=t.byName(p);if(g)return d(g);hs(s,p,v=>{if(v)return d(v);c.continue()})}})}const jo="";function aS(i,t){const e=new Map;for(const s of i){const r=t(s);for(const a of r){let l=e;for(let c=0;c{let a=e;for(let c=0;cp[0]!(n in i[0])));if(!t||e)throw new Error("Custom emojis are in the wrong format")}function Jd(i){cS(i);const t=(g,v)=>g.name.toLowerCase(){const v=new Set;if(g.shortcodes)for(const b of g.shortcodes)for(const _ of Vs(b))v.add(_);return v}),r=g=>s(g,!0),a=g=>s(g,!1),l=g=>{const v=Vs(g),b=v.map((_,w)=>(w_.name).sort(t)},h=new Map,c=new Map;for(const g of i){c.set(g.name.toLowerCase(),g);for(const v of g.shortcodes||[])h.set(v.toLowerCase(),g)}return{all:e,search:l,byShortcode:g=>h.get(g.toLowerCase()),byName:g=>c.get(g.toLowerCase())}}const uS=typeof wrappedJSObject<"u";function yr(i){if(!i)return i;if(uS&&(i=structuredClone(i)),delete i.tokens,i.skinTones){const t=i.skinTones.length;i.skins=Array(t);for(let e=0;e!(t in i[0])))throw new Error("Emoji data is in the wrong format")}function dg(i,t){if(Math.floor(i.status/100)!==2)throw new Error("Failed to fetch: "+t+": "+i.status)}async function fS(i){const t=await fetch(i,{method:"HEAD"});dg(t,i);const e=t.headers.get("etag");return hg(e),e}async function ru(i){const t=await fetch(i);dg(t,i);const e=t.headers.get("etag");hg(e);const n=await t.json();return dS(n),[e,n]}function pS(i){for(var t="",e=new Uint8Array(i),n=e.byteLength,s=-1;++s(this._ready||(this._ready=this._init()),this._ready);await t(),this._db||await t()}async getEmojiByGroup(t){return rc(t),await this.ready(),Xd(await eS(this._db,t)).map(yr)}async getEmojiBySearchQuery(t){Ho(t),await this.ready();const e=this._custom.search(t),n=Xd(await ug(this._db,t)).map(yr);return[...e,...n]}async getEmojiByShortcode(t){Ho(t),await this.ready();const e=this._custom.byShortcode(t);return e||yr(await iS(this._db,t))}async getEmojiByUnicodeOrName(t){Ho(t),await this.ready();const e=this._custom.byName(t);return e||yr(await nS(this._db,t))}async getPreferredSkinTone(){return await this.ready(),await Ku(this._db,zs,Kd)||0}async setPreferredSkinTone(t){return rc(t),await this.ready(),sS(this._db,zs,Kd,t)}async incrementFavoriteEmojiCount(t){return Ho(t),await this.ready(),rS(this._db,t)}async getTopFavoriteEmoji(t){return rc(t),await this.ready(),(await oS(this._db,this._custom,t)).map(yr)}set customEmoji(t){this._custom=Jd(t)}get customEmoji(){return this._custom.all}async _shutdown(){await this.ready();try{await this._lazyUpdate}catch{}}_clear(){this._db=this._ready=this._lazyUpdate=void 0}async close(){await this._shutdown(),await Zu(this._dbName)}async delete(){await this._shutdown(),await qx(this._dbName)}}const ou=[[-1,"✨","custom"],[0,"😀","smileys-emotion"],[1,"👋","people-body"],[3,"🐱","animals-nature"],[4,"🍎","food-drink"],[5,"🏠️","travel-places"],[6,"⚽","activities"],[7,"📝","objects"],[8,"⛔️","symbols"],[9,"🏁","flags"]].map(([i,t,e])=>({id:i,emoji:t,name:e})),oc=ou.slice(1),yS=2,Qd=6,pg=typeof requestIdleCallback=="function"?requestIdleCallback:setTimeout;function tf(i){return i.unicode.includes("‍")}const bS={"🫨":15.1,"🫠":14,"🥲":13.1,"🥻":12.1,"🥰":11,"🤩":5,"👱‍♀️":4,"🤣":3,"👁️‍🗨️":2,"😀":1,"😐️":.7,"😃":.6},wS=1e3,xS="🖐️",SS=8,kS=["😊","😒","❤️","👍️","😍","😂","😭","☺️","😔","😩","😏","💕","🙌","😘"],mg='"Twemoji Mozilla","Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji","EmojiOne Color","Android Emoji",sans-serif',ES=(i,t)=>it?1:0,ef=(i,t)=>{const e=document.createElement("canvas");e.width=e.height=1;const n=e.getContext("2d",{willReadFrequently:!0});return n.textBaseline="top",n.font=`100px ${mg}`,n.fillStyle=t,n.scale(.01,.01),n.fillText(i,0,0),n.getImageData(0,0,1,1).data},CS=(i,t)=>{const e=[...i].join(","),n=[...t].join(",");return e===n&&!e.startsWith("0,0,0,")};function TS(i){const t=ef(i,"#000"),e=ef(i,"#fff");return t&&e&&CS(t,e)}function MS(){const i=Object.entries(bS);try{for(const[t,e]of i)if(TS(t))return e}catch{}finally{}return i[0][1]}let ac;const lc=()=>(ac||(ac=new Promise(i=>pg(()=>i(MS())))),ac),au=new Map,LS="️",AS="\uD83C",DS="‍",PS=127995,OS=57339;function IS(i,t){if(t===0)return i;const e=i.indexOf(DS);return e!==-1?i.substring(0,e)+String.fromCodePoint(PS+t-1)+i.substring(e):(i.endsWith(LS)&&(i=i.substring(0,i.length-1)),i+AS+String.fromCodePoint(OS+t-1))}function Fi(i){i.preventDefault(),i.stopPropagation()}function cc(i,t,e){return t+=i?-1:1,t<0?t=e.length-1:t>=e.length&&(t=0),t}function gg(i,t){const e=new Set,n=[];for(const s of i){const r=t(s);e.has(r)||(e.add(r),n.push(s))}return n}function FS(i,t){const e=n=>{const s={};for(const r of n)typeof r.tone=="number"&&r.version<=t&&(s[r.tone]=r.unicode);return s};return i.map(({unicode:n,skins:s,shortcodes:r,url:a,name:l,category:h,annotation:c})=>({unicode:n,name:l,shortcodes:r,url:a,category:h,annotation:c,id:n||l,skins:s&&e(s)}))}const ya=requestAnimationFrame;let RS=typeof ResizeObserver=="function";function BS(i,t,e){let n;RS?(n=new ResizeObserver(e),n.observe(i)):ya(e),t.addEventListener("abort",()=>{n&&n.disconnect()})}function nf(i){{const t=document.createRange();return t.selectNode(i.firstChild),t.getBoundingClientRect().width}}let uc;function VS(i,t,e){let n=!0;for(const s of i){const r=e(s),a=nf(r);typeof uc>"u"&&(uc=nf(t));const l=a/1.8t)}function zS(i){i&&(i.scrollTop=0)}function Fr(i,t,e){let n=i.get(t);return n||(n=e(),i.set(t,n)),n}function sf(i){return""+i}function $S(i){const t=document.createElement("template");return t.innerHTML=i,t}const HS=new WeakMap,jS=new WeakMap,US=Symbol("un-keyed"),WS="replaceChildren"in Element.prototype;function qS(i,t){WS?i.replaceChildren(...t):(i.innerHTML="",i.append(...t))}function GS(i,t){let e=i.firstChild,n=0;for(;e;){if(t[n]!==e)return!0;e=e.nextSibling,n++}return n!==t.length}function ZS(i,t){const{targetNode:e}=t;let{targetParentNode:n}=t,s=!1;n?s=GS(n,i):(s=!0,t.targetNode=void 0,t.targetParentNode=n=e.parentNode),s&&qS(n,i)}function YS(i,t){for(const e of t){const{targetNode:n,currentExpression:s,binding:{expressionIndex:r,attributeName:a,attributeValuePre:l,attributeValuePost:h}}=e,c=i[r];if(s!==c)if(e.currentExpression=c,a)n.setAttribute(a,l+sf(c)+h);else{let d;Array.isArray(c)?ZS(c,e):c instanceof Element?(d=c,n.replaceWith(d)):n.nodeValue=sf(c),d&&(e.targetNode=d)}}}function KS(i){let t="",e=!1,n=!1,s=-1;const r=new Map,a=[];for(let h=0,c=i.length;h":{e=!1,n=!1;break}case"=":{n=!0;break}}const p=a[a.length-1],g=Fr(r,p,()=>[]);let v,b,_;if(n){const T=/(\S+)="?([^"=]*)$/.exec(d);v=T[1],b=T[2],_=/^[^">]*/.exec(i[h+1])[0]}const w={attributeName:v,attributeValuePre:b,attributeValuePost:_,expressionIndex:h};g.push(w),!e&&!n&&(t+=" ")}return{template:$S(t),elementsToBindings:r}}function rf(i,t,e){for(let n=0;nKS(i)),n=t.cloneNode(!0).content.firstElementChild,s=XS(n,e);return function(a){return YS(a,s),n}}function QS(i){const t=Fr(jS,i,()=>new Map);let e=US;function n(r,...a){const l=Fr(t,r,()=>new Map);return Fr(l,e,()=>JS(r))(a)}function s(r,a,l){return r.map((h,c)=>{const d=e;e=l(h);try{return a(h,c)}finally{e=d}})}return{map:s,html:n}}function tk(i,t,e,n,s,r,a,l,h){const{labelWithSkin:c,titleForEmoji:d,unicodeWithSkin:p}=e,{html:g,map:v}=QS(t);function b(S,C,x){return v(S,(D,V)=>g``,D=>`${x}-${D.id}`)}const w=g`
${t.i18n.searchDescription}
${t.i18n.skinToneDescription}
${v(t.skinTones,(S,C)=>g`
${S}
`,S=>S)}
${v(t.currentEmojisWithCategories,(S,C)=>g`
${b(S.emojis,t.searchMode,"emo")}
`,S=>S.category)}
`,T=(S,C)=>{for(const x of i.querySelectorAll(`[${S}]`))C(x,x.getAttribute(S))};if(h){i.appendChild(w);for(const S of["click","focusout","input","keydown","keyup"])T(`data-on-${S}`,(C,x)=>{C.addEventListener(S,n[x])});T("data-ref",(S,C)=>{r[C]=S}),a.addEventListener("abort",()=>{i.removeChild(w)})}T("data-action",(S,C)=>{let x=l.get(C);x||l.set(C,x=new WeakSet),x.has(S)||(x.add(S),s[C](S))})}const za=typeof queueMicrotask=="function"?queueMicrotask:i=>Promise.resolve().then(i);function ek(i){let t=!1,e;const n=new Map,s=new Set;let r;const a=()=>{if(t)return;const c=[...s];s.clear();try{for(const d of c)d()}finally{r=!1,s.size&&(r=!0,za(a))}},l=new Proxy({},{get(c,d){if(e){let p=n.get(d);p||(p=new Set,n.set(d,p)),p.add(e)}return c[d]},set(c,d,p){if(c[d]!==p){c[d]=p;const g=n.get(d);if(g){for(const v of g)s.add(v);r||(r=!0,za(a))}}return!0}}),h=c=>{const d=()=>{const p=e;e=d;try{return c()}finally{e=p}};return d()};return i.addEventListener("abort",()=>{t=!0}),{state:l,createEffect:h}}function hc(i,t,e){if(i.length!==t.length)return!1;for(let n=0;n{s.disconnect()})),s.observe(i)}}const dc=[],{assign:Uo}=Object;function nk(i,t){const e={},n=new AbortController,s=n.signal,{state:r,createEffect:a}=ek(s),l=new Map;Uo(r,{skinToneEmoji:void 0,i18n:void 0,database:void 0,customEmoji:void 0,customCategorySorting:void 0,emojiVersion:void 0}),Uo(r,t),Uo(r,{initialLoad:!0,currentEmojis:[],currentEmojisWithCategories:[],rawSearchText:"",searchText:"",searchMode:!1,activeSearchItem:-1,message:void 0,skinTonePickerExpanded:!1,skinTonePickerExpandedAfterAnimation:!1,currentSkinTone:0,activeSkinTone:0,skinToneButtonText:void 0,pickerStyle:void 0,skinToneButtonLabel:"",skinTones:[],currentFavorites:[],defaultFavoriteEmojis:void 0,numColumns:SS,isRtl:!1,currentGroupIndex:0,groups:oc,databaseLoaded:!1,activeSearchItemId:void 0}),a(()=>{r.currentGroup!==r.groups[r.currentGroupIndex]&&(r.currentGroup=r.groups[r.currentGroupIndex])});const h=J=>{i.getElementById(J).focus()},c=J=>i.getElementById(`emo-${J.id}`),d=(J,O)=>{e.rootElement.dispatchEvent(new CustomEvent(J,{detail:O,bubbles:!0,composed:!0}))},p=(J,O)=>J.id===O.id,g=(J,O)=>{const{category:k,emojis:A}=J,{category:M,emojis:B}=O;return k!==M?!1:hc(A,B,p)},v=J=>{hc(r.currentEmojis,J,p)||(r.currentEmojis=J)},b=J=>{r.searchMode!==J&&(r.searchMode=J)},_=J=>{hc(r.currentEmojisWithCategories,J,g)||(r.currentEmojisWithCategories=J)},w=(J,O)=>O&&J.skins&&J.skins[O]||J.unicode,C={labelWithSkin:(J,O)=>NS([J.name||w(J,O),J.annotation,...J.shortcodes||dc].filter(Boolean)).join(", "),titleForEmoji:J=>J.annotation||(J.shortcodes||dc).join(", "),unicodeWithSkin:w},x={onClickSkinToneButton:ct,onEmojiClick:vt,onNavClick:W,onNavKeydown:dt,onSearchKeydown:st,onSkinToneOptionsClick:Mt,onSkinToneOptionsFocusOut:Wt,onSkinToneOptionsKeydown:bt,onSkinToneOptionsKeyup:yt,onSearchInput:Pt},D={calculateEmojiGridStyle:K,updateOnIntersection:q};let V=!0;a(()=>{tk(i,r,C,x,D,e,s,l,V),V=!1}),r.emojiVersion||lc().then(J=>{J||(r.message=r.i18n.emojiUnsupportedMessage)}),a(()=>{async function J(){let O=!1;const k=setTimeout(()=>{O=!0,r.message=r.i18n.loadingMessage},wS);try{await r.database.ready(),r.databaseLoaded=!0}catch(A){console.error(A),r.message=r.i18n.networkErrorMessage}finally{clearTimeout(k),O&&(O=!1,r.message="")}}r.database&&J()}),a(()=>{r.pickerStyle=` --num-groups: ${r.groups.length}; --indicator-opacity: ${r.searchMode?0:1}; --num-skintones: ${Qd};`}),a(()=>{r.customEmoji&&r.database&&$()}),a(()=>{r.customEmoji&&r.customEmoji.length?r.groups!==ou&&(r.groups=ou):r.groups!==oc&&(r.currentGroupIndex&&r.currentGroupIndex--,r.groups=oc)}),a(()=>{async function J(){r.databaseLoaded&&(r.currentSkinTone=await r.database.getPreferredSkinTone())}J()}),a(()=>{r.skinTones=Array(Qd).fill().map((J,O)=>IS(r.skinToneEmoji,O))}),a(()=>{r.skinToneButtonText=r.skinTones[r.currentSkinTone]}),a(()=>{r.skinToneButtonLabel=r.i18n.skinToneLabel.replace("{skinTone}",r.i18n.skinTones[r.currentSkinTone])}),a(()=>{async function J(){const{database:O}=r,k=(await Promise.all(kS.map(A=>O.getEmojiByUnicodeOrName(A)))).filter(Boolean);r.defaultFavoriteEmojis=k}r.databaseLoaded&&J()});function $(){const{customEmoji:J,database:O}=r,k=J||dc;O.customEmoji!==k&&(O.customEmoji=k)}a(()=>{async function J(){$();const{database:O,defaultFavoriteEmojis:k,numColumns:A}=r,M=await O.getTopFavoriteEmoji(A),B=await it(gg([...M,...k],R=>R.unicode||R.name).slice(0,A));r.currentFavorites=B}r.databaseLoaded&&r.defaultFavoriteEmojis&&J()});function K(J){BS(J,s,()=>{{const O=getComputedStyle(e.rootElement),k=parseInt(O.getPropertyValue("--num-columns"),10),A=O.getPropertyValue("direction")==="rtl";r.numColumns=k,r.isRtl=A}})}function q(J){ik(J,s,O=>{for(const{target:k,isIntersecting:A}of O)k.classList.toggle("onscreen",A)})}a(()=>{async function J(){const{searchText:O,currentGroup:k,databaseLoaded:A,customEmoji:M}=r;if(!A)r.currentEmojis=[],r.searchMode=!1;else if(O.length>=yS){const B=await Z(O);r.searchText===O&&(v(B),b(!0))}else{const{id:B}=k;if(B!==-1||M&&M.length){const R=await G(B);r.currentGroup.id===B&&(v(R),b(!1))}}}J()});const rt=()=>{ya(()=>zS(e.tabpanelElement))};a(()=>{const{currentEmojis:J,emojiVersion:O}=r,k=J.filter(A=>A.unicode).filter(A=>tf(A)&&!au.has(A.unicode));if(!O&&k.length)v(J),ya(()=>z(k));else{const A=O?J:J.filter(tt);v(A),rt()}});function z(J){VS(J,e.baselineEmoji,c)?rt():r.currentEmojis=[...r.currentEmojis]}function tt(J){return!J.unicode||!tf(J)||au.get(J.unicode)}async function ot(J){const O=r.emojiVersion||await lc();return J.filter(({version:k})=>!k||k<=O)}async function it(J){return FS(J,r.emojiVersion||await lc())}async function G(J){const O=J===-1?r.customEmoji:await r.database.getEmojiByGroup(J);return it(await ot(O))}async function Z(J){return it(await ot(await r.database.getEmojiBySearchQuery(J)))}a(()=>{}),a(()=>{function J(){const{searchMode:k,currentEmojis:A}=r;if(k)return[{category:"",emojis:A}];const M=new Map;for(const B of A){const R=B.category||"";let I=M.get(R);I||(I=[],M.set(R,I)),I.push(B)}return[...M.entries()].map(([B,R])=>({category:B,emojis:R})).sort((B,R)=>r.customCategorySorting(B.category,R.category))}const O=J();_(O)}),a(()=>{r.activeSearchItemId=r.activeSearchItem!==-1&&r.currentEmojis[r.activeSearchItem].id}),a(()=>{const{rawSearchText:J}=r;pg(()=>{r.searchText=(J||"").trim(),r.activeSearchItem=-1})});function st(J){if(!r.searchMode||!r.currentEmojis.length)return;const O=k=>{Fi(J),r.activeSearchItem=cc(k,r.activeSearchItem,r.currentEmojis)};switch(J.key){case"ArrowDown":return O(!1);case"ArrowUp":return O(!0);case"Enter":if(r.activeSearchItem===-1)r.activeSearchItem=0;else return Fi(J),nt(r.currentEmojis[r.activeSearchItem].id)}}function W(J){const{target:O}=J,k=O.closest(".nav-button");if(!k)return;const A=parseInt(k.dataset.groupId,10);e.searchElement.value="",r.rawSearchText="",r.searchText="",r.activeSearchItem=-1,r.currentGroupIndex=r.groups.findIndex(M=>M.id===A)}function dt(J){const{target:O,key:k}=J,A=M=>{M&&(Fi(J),M.focus())};switch(k){case"ArrowLeft":return A(O.previousElementSibling);case"ArrowRight":return A(O.nextElementSibling);case"Home":return A(O.parentElement.firstElementChild);case"End":return A(O.parentElement.lastElementChild)}}async function nt(J){const O=await r.database.getEmojiByUnicodeOrName(J),k=[...r.currentEmojis,...r.currentFavorites].find(M=>M.id===J),A=k.unicode&&w(k,r.currentSkinTone);await r.database.incrementFavoriteEmojiCount(J),d("emoji-click",{emoji:O,skinTone:r.currentSkinTone,...A&&{unicode:A},...k.name&&{name:k.name}})}async function vt(J){const{target:O}=J;if(!O.classList.contains("emoji"))return;Fi(J);const k=O.id.substring(4);nt(k)}function kt(J){r.currentSkinTone=J,r.skinTonePickerExpanded=!1,h("skintone-button"),d("skin-tone-change",{skinTone:J}),r.database.setPreferredSkinTone(J)}function Mt(J){const{target:{id:O}}=J,k=O&&O.match(/^skintone-(\d)/);if(!k)return;Fi(J);const A=parseInt(k[1],10);kt(A)}function ct(J){r.skinTonePickerExpanded=!r.skinTonePickerExpanded,r.activeSkinTone=r.currentSkinTone,r.skinTonePickerExpanded&&(Fi(J),ya(()=>h("skintone-list")))}a(()=>{r.skinTonePickerExpanded?e.skinToneDropdown.addEventListener("transitionend",()=>{r.skinTonePickerExpandedAfterAnimation=!0},{once:!0}):r.skinTonePickerExpandedAfterAnimation=!1});function bt(J){if(!r.skinTonePickerExpanded)return;const O=async k=>{Fi(J),r.activeSkinTone=k};switch(J.key){case"ArrowUp":return O(cc(!0,r.activeSkinTone,r.skinTones));case"ArrowDown":return O(cc(!1,r.activeSkinTone,r.skinTones));case"Home":return O(0);case"End":return O(r.skinTones.length-1);case"Enter":return Fi(J),kt(r.activeSkinTone);case"Escape":return Fi(J),r.skinTonePickerExpanded=!1,h("skintone-button")}}function yt(J){if(r.skinTonePickerExpanded)switch(J.key){case" ":return Fi(J),kt(r.activeSkinTone)}}async function Wt(J){const{relatedTarget:O}=J;(!O||O.id!=="skintone-list")&&(r.skinTonePickerExpanded=!1)}function Pt(J){r.rawSearchText=J.target.value}return{$set(J){Uo(r,J)},$destroy(){n.abort()}}}const sk="https://cdn.jsdelivr.net/npm/emoji-picker-element-data@^1/en/emojibase/data.json",rk="en";var ok={categoriesLabel:"Categories",emojiUnsupportedMessage:"Your browser does not support color emoji.",favoritesLabel:"Favorites",loadingMessage:"Loading…",networkErrorMessage:"Could not load emoji.",regionLabel:"Emoji picker",searchDescription:"When search results are available, press up or down to select and enter to choose.",searchLabel:"Search",searchResultsLabel:"Search results",skinToneDescription:"When expanded, press up or down to select and enter to choose.",skinToneLabel:"Choose a skin tone (currently {skinTone})",skinTonesLabel:"Skin tones",skinTones:["Default","Light","Medium-Light","Medium","Medium-Dark","Dark"],categories:{custom:"Custom","smileys-emotion":"Smileys and emoticons","people-body":"People and body","animals-nature":"Animals and nature","food-drink":"Food and drink","travel-places":"Travel and places",activities:"Activities",objects:"Objects",symbols:"Symbols",flags:"Flags"}},ak=':host{--emoji-size:1.375rem;--emoji-padding:0.5rem;--category-emoji-size:var(--emoji-size);--category-emoji-padding:var(--emoji-padding);--indicator-height:3px;--input-border-radius:0.5rem;--input-border-size:1px;--input-font-size:1rem;--input-line-height:1.5;--input-padding:0.25rem;--num-columns:8;--outline-size:2px;--border-size:1px;--border-radius:0;--skintone-border-radius:1rem;--category-font-size:1rem;display:flex;width:min-content;height:400px}:host,:host(.light){color-scheme:light;--background:#fff;--border-color:#e0e0e0;--indicator-color:#385ac1;--input-border-color:#999;--input-font-color:#111;--input-placeholder-color:#999;--outline-color:#999;--category-font-color:#111;--button-active-background:#e6e6e6;--button-hover-background:#d9d9d9}:host(.dark){color-scheme:dark;--background:#222;--border-color:#444;--indicator-color:#5373ec;--input-border-color:#ccc;--input-font-color:#efefef;--input-placeholder-color:#ccc;--outline-color:#fff;--category-font-color:#efefef;--button-active-background:#555555;--button-hover-background:#484848}@media (prefers-color-scheme:dark){:host{color-scheme:dark;--background:#222;--border-color:#444;--indicator-color:#5373ec;--input-border-color:#ccc;--input-font-color:#efefef;--input-placeholder-color:#ccc;--outline-color:#fff;--category-font-color:#efefef;--button-active-background:#555555;--button-hover-background:#484848}}:host([hidden]){display:none}button{margin:0;padding:0;border:0;background:0 0;box-shadow:none;-webkit-tap-highlight-color:transparent}button::-moz-focus-inner{border:0}input{padding:0;margin:0;line-height:1.15;font-family:inherit}input[type=search]{-webkit-appearance:none}:focus{outline:var(--outline-color) solid var(--outline-size);outline-offset:calc(-1*var(--outline-size))}:host([data-js-focus-visible]) :focus:not([data-focus-visible-added]){outline:0}:focus:not(:focus-visible){outline:0}.hide-focus{outline:0}*{box-sizing:border-box}.picker{contain:content;display:flex;flex-direction:column;background:var(--background);border:var(--border-size) solid var(--border-color);border-radius:var(--border-radius);width:100%;height:100%;overflow:hidden;--total-emoji-size:calc(var(--emoji-size) + (2 * var(--emoji-padding)));--total-category-emoji-size:calc(var(--category-emoji-size) + (2 * var(--category-emoji-padding)))}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.hidden{opacity:0;pointer-events:none}.abs-pos{position:absolute;left:0;top:0}.gone{display:none!important}.skintone-button-wrapper,.skintone-list{background:var(--background);z-index:3}.skintone-button-wrapper.expanded{z-index:1}.skintone-list{position:absolute;inset-inline-end:0;top:0;z-index:2;overflow:visible;border-bottom:var(--border-size) solid var(--border-color);border-radius:0 0 var(--skintone-border-radius) var(--skintone-border-radius);will-change:transform;transition:transform .2s ease-in-out;transform-origin:center 0}@media (prefers-reduced-motion:reduce){.skintone-list{transition-duration:.001s}}@supports not (inset-inline-end:0){.skintone-list{right:0}}.skintone-list.no-animate{transition:none}.tabpanel{overflow-y:auto;scrollbar-gutter:stable;-webkit-overflow-scrolling:touch;will-change:transform;min-height:0;flex:1;contain:content}.emoji-menu{display:grid;grid-template-columns:repeat(var(--num-columns),var(--total-emoji-size));justify-content:space-around;align-items:flex-start;width:100%}.emoji-menu.visibility-auto{content-visibility:auto;contain-intrinsic-size:calc(var(--num-columns)*var(--total-emoji-size)) calc(var(--num-rows)*var(--total-emoji-size))}.category{padding:var(--emoji-padding);font-size:var(--category-font-size);color:var(--category-font-color)}.emoji,button.emoji{font-size:var(--emoji-size);display:flex;align-items:center;justify-content:center;border-radius:100%;height:var(--total-emoji-size);width:var(--total-emoji-size);line-height:1;overflow:hidden;font-family:var(--emoji-font-family);cursor:pointer}@media (hover:hover) and (pointer:fine){.emoji:hover,button.emoji:hover{background:var(--button-hover-background)}}.emoji.active,.emoji:active,button.emoji.active,button.emoji:active{background:var(--button-active-background)}.onscreen .custom-emoji::after{content:"";width:var(--emoji-size);height:var(--emoji-size);background-repeat:no-repeat;background-position:center center;background-size:contain;background-image:var(--custom-emoji-background)}.nav,.nav-button{align-items:center}.nav{display:grid;justify-content:space-between;contain:content}.nav-button{display:flex;justify-content:center}.nav-emoji{font-size:var(--category-emoji-size);width:var(--total-category-emoji-size);height:var(--total-category-emoji-size)}.indicator-wrapper{display:flex;border-bottom:1px solid var(--border-color)}.indicator{width:calc(100%/var(--num-groups));height:var(--indicator-height);opacity:var(--indicator-opacity);background-color:var(--indicator-color);will-change:transform,opacity;transition:opacity .1s linear,transform .25s ease-in-out}@media (prefers-reduced-motion:reduce){.indicator{will-change:opacity;transition:opacity .1s linear}}.pad-top,input.search{background:var(--background);width:100%}.pad-top{height:var(--emoji-padding);z-index:3}.search-row{display:flex;align-items:center;position:relative;padding-inline-start:var(--emoji-padding);padding-bottom:var(--emoji-padding)}.search-wrapper{flex:1;min-width:0}input.search{padding:var(--input-padding);border-radius:var(--input-border-radius);border:var(--input-border-size) solid var(--input-border-color);color:var(--input-font-color);font-size:var(--input-font-size);line-height:var(--input-line-height)}input.search::placeholder{color:var(--input-placeholder-color)}.favorites{overflow-y:auto;scrollbar-gutter:stable;display:flex;flex-direction:row;border-top:var(--border-size) solid var(--border-color);contain:content}.message{padding:var(--emoji-padding)}';const vg=["customEmoji","customCategorySorting","database","dataSource","i18n","locale","skinToneEmoji","emojiVersion"],lk=`:host{--emoji-font-family:${mg}}`;class Xu extends HTMLElement{constructor(t){super(),this.attachShadow({mode:"open"});const e=document.createElement("style");e.textContent=ak+lk,this.shadowRoot.appendChild(e),this._ctx={locale:rk,dataSource:sk,skinToneEmoji:xS,customCategorySorting:ES,customEmoji:null,i18n:ok,emojiVersion:null,...t};for(const n of vg)n!=="database"&&Object.prototype.hasOwnProperty.call(this,n)&&(this._ctx[n]=this[n],delete this[n]);this._dbFlush()}connectedCallback(){this._cmp||(this._cmp=nk(this.shadowRoot,this._ctx))}disconnectedCallback(){za(()=>{if(!this.isConnected&&this._cmp){this._cmp.$destroy(),this._cmp=void 0;const{database:t}=this._ctx;t.close().catch(e=>console.error(e))}})}static get observedAttributes(){return["locale","data-source","skin-tone-emoji","emoji-version"]}attributeChangedCallback(t,e,n){this._set(t.replace(/-([a-z])/g,(s,r)=>r.toUpperCase()),t==="emoji-version"?parseFloat(n):n)}_set(t,e){this._ctx[t]=e,this._cmp&&this._cmp.$set({[t]:e}),["locale","dataSource"].includes(t)&&this._dbFlush()}_dbCreate(){const{locale:t,dataSource:e,database:n}=this._ctx;(!n||n.locale!==t||n.dataSource!==e)&&this._set("database",new _S({locale:t,dataSource:e}))}_dbFlush(){za(()=>this._dbCreate())}}const _g={};for(const i of vg)_g[i]={get(){return i==="database"&&this._dbCreate(),this._ctx[i]},set(t){if(i==="database")throw new Error("database is read-only");this._set(i,t)}};Object.defineProperties(Xu.prototype,_g);customElements.get("emoji-picker")||customElements.define("emoji-picker",Xu);const ck=(i,t="")=>{const e=`
${t}
`,n=`
${t} ${t}
`,s=document.createElement("div");return s.innerHTML=i?e:n,s.firstElementChild};var fc;function af(i){if(i.nodeName!=="TEXTAREA")return!1;if(typeof fc>"u"){var t=document.createElement("textarea");t.value=1,fc=!!t.firstChild}return fc}function uk(i,t){if(i.focus(),document.selection){var e=document.selection.createRange();e.text=t,e.collapse(!1),e.select();return}var n=document.execCommand("insertText",!1,t);if(!n){var s=i.selectionStart,r=i.selectionEnd;if(typeof i.setRangeText=="function")i.setRangeText(t);else{var a=document.createRange(),l=document.createTextNode(t);if(af(i)){var h=i.firstChild;if(!h)i.appendChild(l);else{for(var c=0,d=null,p=null;h&&(d===null||p===null);){var g=h.nodeValue.length;s>=c&&s<=c+g&&a.setStart(d=h,s-c),r>=c&&r<=c+g&&a.setEnd(p=h,r-c),c+=g,h=h.nextSibling}s!==r&&a.deleteContents()}}if(af(i)&&a.commonAncestorContainer.nodeName==="#text")a.insertNode(l);else{var v=i.value;i.value=v.slice(0,s)+t+v.slice(r)}}i.setSelectionRange(s+t.length,s+t.length);var b=document.createEvent("UIEvent");b.initEvent("input",!0,!1),i.dispatchEvent(b)}}const Xi={textarea:".__chat-textarea__",fileInput:".__chat-input-file-select__",preview:".__chat-input-preview__",imagePreview:".__thumb__",image:".__thumb-image__",imageClose:".__thumb-close__",emojiContainer:".__chat-input-emoji__"},pc={previewVisible:"chat-input__selected-files_open"},lf=50;class hk extends Kt{constructor(t){super(t),this.files=[],this.fileInput=this.element.querySelector(Xi.fileInput),this.textarea=this.element.querySelector(Xi.textarea),this.emojiContainer=this.element.querySelector(Xi.emojiContainer),this.addListeners(),this.initEmojiPicker()}isValidFile(t){return t.size/1048576>lf?(Pn.push({title:"File size exceeds acceptable size",content:`The file "${t.name}" exceeds ${lf}Mb`,style:"alert"}),!1):!0}addFile(t){this.isValidFile(t)&&(this.files=this.files.filter(n=>n.name!==t.name&&n.size!==t.size),this.files=[...this.files,t])}setInputFiles(t){const e=new DataTransfer;t.forEach(n=>{e.items.add(n)}),this.fileInput.files=e.files}onInputChange(t){const e=t.target.files;Array.from(e).forEach(this.addFile.bind(this)),this.resetPreview(),this.files.forEach(n=>this.insertPreviewImage(n))}insertPreviewImage(t){var a;const e=URL.createObjectURL(t),n=ck(t.type.includes("image")?e:null,t.name),s=this.element.querySelector(Xi.preview);!s.classList.contains(pc.previewVisible)&&s.classList.add(pc.previewVisible),(a=n.querySelector(Xi.imageClose))==null||a.addEventListener("click",this.removeImage.bind(this)),s.appendChild(n)}resetPreview(){this.element.querySelector(Xi.preview).replaceChildren()}removeImage(t){const e=t.target.closest(Xi.imagePreview),s=e.querySelector(Xi.image).getAttribute("alt");this.files=this.files.filter(r=>r.name!==s),this.setInputFiles(this.files),this.files.length===0&&this.element.querySelector(Xi.preview).classList.remove(pc.previewVisible),e.remove()}initEmojiPicker(){const t=new Xu;t.classList.add("light"),this.emojiContainer.appendChild(t),t.addEventListener("emoji-click",this.insertEmoji.bind(this))}insertEmoji(t){uk(this.textarea,t.detail.unicode)}addResizeTextarea(t){const e=t.target,n=this.textarea.offsetHeight-this.textarea.clientHeight;t.target&&(e.style.height="auto",e.style.height=e.scrollHeight+n+"px")}addListeners(){this.fileInput.addEventListener("change",this.onInputChange.bind(this)),this.textarea.addEventListener("input",this.addResizeTextarea.bind(this))}}const mc={chatContent:".__chat-content__",openTrigger:".__chat-trigger__",closeTrigger:".__chat-close-trigger__"},Wo={openChat:"chat_open",scrollDisable:"chat-page_scroll-disable"};class dk extends Kt{constructor(t){super(t),this.chatContent=this.element.querySelector(mc.chatContent),this.closeTrigger=this.element.querySelector(mc.closeTrigger),this.openTriggers=this.element.querySelectorAll(mc.openTrigger),this.addListeners()}openChat(){window.scrollTo({top:0}),document.body.classList.add(Wo.scrollDisable),this.chatContent.classList.add(Wo.openChat)}closeChat(){document.body.classList.remove(Wo.scrollDisable),this.chatContent.classList.remove(Wo.openChat)}addListeners(){this.openTriggers.forEach(t=>{t.addEventListener("click",this.openChat.bind(this))}),this.closeTrigger.addEventListener("click",this.closeChat.bind(this))}}var cl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ul(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var yg={exports:{}};(function(i,t){(function(e,n){i.exports=n()})(cl,function(){return function(){var e={d:function(O,k){for(var A in k)e.o(k,A)&&!e.o(O,A)&&Object.defineProperty(O,A,{enumerable:!0,get:k[A]})},o:function(O,k){return Object.prototype.hasOwnProperty.call(O,k)}},n={};e.d(n,{default:function(){return Pt}});var s={days:"days",months:"months",years:"years",day:"day",month:"month",year:"year",eventChangeViewDate:"changeViewDate",eventChangeCurrentView:"changeCurrentView",eventChangeFocusDate:"changeFocusDate",eventChangeSelectedDate:"changeSelectedDate",eventChangeTime:"changeTime",eventChangeLastSelectedDate:"changeLastSelectedDate",actionSelectDate:"selectDate",actionUnselectDate:"unselectDate",cssClassWeekend:"-weekend-"},r={classes:"",inline:!1,locale:{days:["Воскресенье","Понедельник","Вторник","Среда","Четверг","Пятница","Суббота"],daysShort:["Вос","Пон","Вто","Сре","Чет","Пят","Суб"],daysMin:["Вс","Пн","Вт","Ср","Чт","Пт","Сб"],months:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],monthsShort:["Янв","Фев","Мар","Апр","Май","Июн","Июл","Авг","Сен","Окт","Ноя","Дек"],today:"Сегодня",clear:"Очистить",dateFormat:"dd.MM.yyyy",timeFormat:"HH:mm",firstDay:1},startDate:new Date,firstDay:"",weekends:[6,0],dateFormat:"",altField:"",altFieldDateFormat:"T",toggleSelected:!0,keyboardNav:!0,selectedDates:!1,container:"",isMobile:!1,visible:!1,position:"bottom left",offset:12,view:s.days,minView:s.days,showOtherMonths:!0,selectOtherMonths:!0,moveToOtherMonthsOnSelect:!0,showOtherYears:!0,selectOtherYears:!0,moveToOtherYearsOnSelect:!0,minDate:"",maxDate:"",disableNavWhenOutOfRange:!0,multipleDates:!1,multipleDatesSeparator:", ",range:!1,dynamicRange:!0,buttons:!1,monthsField:"monthsShort",showEvent:"focus",autoClose:!1,fixedHeight:!1,prevHtml:'',nextHtml:'',navTitles:{days:"MMMM, yyyy",months:"yyyy",years:"yyyy1 - yyyy2"},timepicker:!1,onlyTimepicker:!1,dateTimeSeparator:" ",timeFormat:"",minHours:0,maxHours:24,minMinutes:0,maxMinutes:59,hoursStep:1,minutesStep:1,onSelect:!1,onChangeViewDate:!1,onChangeView:!1,onRenderCell:!1,onShow:!1,onHide:!1,onClickDayName:!1};function a(O){let k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:document;return typeof O=="string"?k.querySelector(O):O}function l(){let{tagName:O="div",className:k="",innerHtml:A="",id:M="",attrs:B={}}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},R=document.createElement(O);return k&&R.classList.add(...k.split(" ")),M&&(R.id=M),A&&(R.innerHTML=A),B&&h(R,B),R}function h(O,k){for(let[A,M]of Object.entries(k))M!==void 0&&O.setAttribute(A,M);return O}function c(O){return new Date(O.getFullYear(),O.getMonth()+1,0).getDate()}function d(O){let k=O.getHours(),{hours:A,dayPeriod:M}=p(k);return{year:O.getFullYear(),month:O.getMonth(),fullMonth:O.getMonth()+1<10?"0"+(O.getMonth()+1):O.getMonth()+1,date:O.getDate(),fullDate:O.getDate()<10?"0"+O.getDate():O.getDate(),day:O.getDay(),hours:k,fullHours:g(k),hours12:A,dayPeriod:M,fullHours12:g(A),minutes:O.getMinutes(),fullMinutes:O.getMinutes()<10?"0"+O.getMinutes():O.getMinutes()}}function p(O){return{dayPeriod:O>11?"pm":"am",hours:O%12==0?12:O%12}}function g(O){return O<10?"0"+O:O}function v(O){let k=10*Math.floor(O.getFullYear()/10);return[k,k+9]}function b(){let O=[];for(var k=arguments.length,A=new Array(k),M=0;M{if(typeof B=="object")for(let R in B)B[R]&&O.push(R);else B&&O.push(B)}),O.join(" ")}function _(O,k){let A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:s.days;if(!O||!k)return!1;let M=d(O),B=d(k);return{[s.days]:M.date===B.date&&M.month===B.month&&M.year===B.year,[s.months]:M.month===B.month&&M.year===B.year,[s.years]:M.year===B.year}[A]}function w(O,k,A){let M=S(O,!1).getTime(),B=S(k,!1).getTime();return A?M>=B:M>B}function T(O,k){return!w(O,k,!0)}function S(O){let k=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],A=new Date(O.getTime());return typeof k!="boolean"||k||function(M){M.setHours(0,0,0,0)}(A),A}function C(O,k,A){O.length?O.forEach(M=>{M.addEventListener(k,A)}):O.addEventListener(k,A)}function x(O,k){return!(!O||O===document||O instanceof DocumentFragment)&&(O.matches(k)?O:x(O.parentNode,k))}function D(O,k,A){return O>A?A:O1?k-1:0),M=1;MB).forEach(B=>{for(let[R,I]of Object.entries(B))if(I!==void 0&&I.toString()==="[object Object]"){let H=O[R]!==void 0?O[R].toString():void 0,X=I.toString(),ut=Array.isArray(I)?[]:{};O[R]=O[R]?H!==X?ut:O[R]:ut,V(O[R],I)}else O[R]=I}),O}function $(O){let k=O;return O instanceof Date||(typeof O=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(O)&&(O+="T00:00:00"),k=new Date(O)),isNaN(k.getTime())&&(console.log(`Unable to convert value "${O}" to Date object`),k=!1),k}function K(O){let k="\\s|\\.|-|/|\\\\|,|\\$|\\!|\\?|:|;";return new RegExp("(^|>|"+k+")("+O+")($|<|"+k+")","g")}function q(O,k,A){return(k=function(M){var B=function(R,I){if(typeof R!="object"||R===null)return R;var H=R[Symbol.toPrimitive];if(H!==void 0){var X=H.call(R,"string");if(typeof X!="object")return X;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(R)}(M);return typeof B=="symbol"?B:String(B)}(k))in O?Object.defineProperty(O,k,{value:A,enumerable:!0,configurable:!0,writable:!0}):O[k]=A,O}class rt{constructor(){let{type:k,date:A,dp:M,opts:B,body:R}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};q(this,"focus",()=>{this.$cell.classList.add("-focus-"),this.focused=!0}),q(this,"removeFocus",()=>{this.$cell.classList.remove("-focus-"),this.focused=!1}),q(this,"select",()=>{this.$cell.classList.add("-selected-"),this.selected=!0}),q(this,"removeSelect",()=>{this.$cell.classList.remove("-selected-","-range-from-","-range-to-"),this.selected=!1}),q(this,"onChangeSelectedDate",()=>{this.isDisabled||(this._handleSelectedStatus(),this.opts.range&&this._handleRangeStatus())}),q(this,"onChangeFocusDate",I=>{if(!I)return void(this.focused&&this.removeFocus());let H=_(I,this.date,this.type);H?this.focus():!H&&this.focused&&this.removeFocus(),this.opts.range&&this._handleRangeStatus()}),q(this,"render",()=>(this.$cell.innerHTML=this._getHtml(),this._handleClasses(),this.$cell)),this.type=k,this.singleType=this.type.slice(0,-1),this.date=A,this.dp=M,this.opts=B,this.body=R,this.customData=!1,this.init()}init(){var k;let{onRenderCell:A}=this.opts;A&&(this.customData=A({date:this.date,cellType:this.singleType,datepicker:this.dp})),this._createElement(),this._bindDatepickerEvents(),(k=this.customData)!==null&&k!==void 0&&k.disabled&&this.dp.disableDate(this.date)}_bindDatepickerEvents(){this.dp.on(s.eventChangeSelectedDate,this.onChangeSelectedDate),this.dp.on(s.eventChangeFocusDate,this.onChangeFocusDate)}unbindDatepickerEvents(){this.dp.off(s.eventChangeSelectedDate,this.onChangeSelectedDate),this.dp.off(s.eventChangeFocusDate,this.onChangeFocusDate)}_createElement(){var k;let{year:A,month:M,date:B}=d(this.date),R=((k=this.customData)===null||k===void 0?void 0:k.attrs)||{};this.$cell=l({attrs:{"data-year":A,"data-month":M,"data-date":B,...R}}),this.$cell.adpCell=this}_getClassName(){var k;let A=new Date,{selectOtherMonths:M,selectOtherYears:B}=this.opts,{minDate:R,maxDate:I,isDateDisabled:H}=this.dp,{day:X}=d(this.date),ut=this._isOutOfMinMaxRange(),gt=H(this.date),_t=b("air-datepicker-cell",`-${this.singleType}-`,{"-current-":_(A,this.date,this.type),"-min-date-":R&&_(R,this.date,this.type),"-max-date-":I&&_(I,this.date,this.type)}),St="";switch(this.type){case s.days:St=b({"-weekend-":this.dp.isWeekend(X),"-other-month-":this.isOtherMonth,"-disabled-":this.isOtherMonth&&!M||ut||gt});break;case s.months:St=b({"-disabled-":ut});break;case s.years:St=b({"-other-decade-":this.isOtherDecade,"-disabled-":ut||this.isOtherDecade&&!B})}return b(_t,St,(k=this.customData)===null||k===void 0?void 0:k.classes).split(" ")}_getHtml(){var k;let{year:A,month:M,date:B}=d(this.date),{showOtherMonths:R,showOtherYears:I}=this.opts;if((k=this.customData)!==null&&k!==void 0&&k.html)return this.customData.html;switch(this.type){case s.days:return!R&&this.isOtherMonth?"":B;case s.months:return this.dp.locale[this.opts.monthsField][M];case s.years:return!I&&this.isOtherDecade?"":A}}_isOutOfMinMaxRange(){let{minDate:k,maxDate:A}=this.dp,{type:M,date:B}=this,{month:R,year:I,date:H}=d(B),X=M===s.days,ut=M===s.years,gt=!!k&&new Date(I,ut?k.getMonth():R,X?H:k.getDate()),_t=!!A&&new Date(I,ut?A.getMonth():R,X?H:A.getDate());return k&&A?T(gt,k)||w(_t,A):k?T(gt,k):A?w(_t,A):void 0}destroy(){this.unbindDatepickerEvents()}_handleRangeStatus(){const{selectedDates:k,focusDate:A,rangeDateTo:M,rangeDateFrom:B}=this.dp,R=k.length;if(!R)return;let I=B,H=M;if(R===1&&A){const St=w(A,k[0]);I=St?k[0]:A,H=St?A:k[0]}let X=b({"-in-range-":I&&H&&(ut=this.date,gt=I,_t=H,w(ut,gt)&&T(ut,_t)),"-range-from-":I&&_(this.date,I,this.type),"-range-to-":H&&_(this.date,H,this.type)});var ut,gt,_t;this.$cell.classList.remove("-range-from-","-range-to-","-in-range-"),X&&this.$cell.classList.add(...X.split(" "))}_handleSelectedStatus(){let k=this.dp._checkIfDateIsSelected(this.date,this.type);k?this.select():!k&&this.selected&&this.removeSelect()}_handleInitialFocusStatus(){_(this.dp.focusDate,this.date,this.type)&&this.focus()}_handleClasses(){this.$cell.setAttribute("class",""),this._handleInitialFocusStatus(),this.dp.hasSelectedDates&&(this._handleSelectedStatus(),this.dp.opts.range&&this._handleRangeStatus()),this.$cell.classList.add(...this._getClassName())}get isDisabled(){return this.$cell.matches(".-disabled-")}get isOtherMonth(){return this.dp.isOtherMonth(this.date)}get isOtherDecade(){return this.dp.isOtherDecade(this.date)}}function z(O,k,A){return(k=function(M){var B=function(R,I){if(typeof R!="object"||R===null)return R;var H=R[Symbol.toPrimitive];if(H!==void 0){var X=H.call(R,"string");if(typeof X!="object")return X;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(R)}(M);return typeof B=="symbol"?B:String(B)}(k))in O?Object.defineProperty(O,k,{value:A,enumerable:!0,configurable:!0,writable:!0}):O[k]=A,O}let tt={[s.days]:`
`,[s.months]:`
`,[s.years]:`
`};const ot=".air-datepicker-cell";class it{constructor(k){let{dp:A,type:M,opts:B}=k;z(this,"handleClick",R=>{let I=R.target.closest(ot).adpCell;if(I.isDisabled)return;if(!this.dp.isMinViewReached)return void this.dp.down();let H=this.dp._checkIfDateIsSelected(I.date,I.type);H?this.dp._handleAlreadySelectedDates(H,I.date):this.dp.selectDate(I.date)}),z(this,"handleDayNameClick",R=>{let I=R.target.getAttribute("data-day-index");this.opts.onClickDayName({dayIndex:Number(I),datepicker:this.dp})}),z(this,"onChangeCurrentView",R=>{R!==this.type?this.hide():(this.show(),this.render())}),z(this,"onMouseOverCell",R=>{let I=x(R.target,ot);this.dp.setFocusDate(!!I&&I.adpCell.date)}),z(this,"onMouseOutCell",()=>{this.dp.setFocusDate(!1)}),z(this,"onClickBody",R=>{let{onClickDayName:I}=this.opts,H=R.target;H.closest(ot)&&this.handleClick(R),I&&H.closest(".air-datepicker-body--day-name")&&this.handleDayNameClick(R)}),z(this,"onMouseDown",R=>{this.pressed=!0;let I=x(R.target,ot),H=I&&I.adpCell;_(H.date,this.dp.rangeDateFrom)&&(this.rangeFromFocused=!0),_(H.date,this.dp.rangeDateTo)&&(this.rangeToFocused=!0)}),z(this,"onMouseMove",R=>{if(!this.pressed||!this.dp.isMinViewReached)return;R.preventDefault();let I=x(R.target,ot),H=I&&I.adpCell,{selectedDates:X,rangeDateTo:ut,rangeDateFrom:gt}=this.dp;if(!H||H.isDisabled)return;let{date:_t}=H;if(X.length===2){if(this.rangeFromFocused&&!w(_t,ut)){let{hours:St,minutes:Ct}=d(gt);_t.setHours(St),_t.setMinutes(Ct),this.dp.rangeDateFrom=_t,this.dp.replaceDate(gt,_t)}if(this.rangeToFocused&&!T(_t,gt)){let{hours:St,minutes:Ct}=d(ut);_t.setHours(St),_t.setMinutes(Ct),this.dp.rangeDateTo=_t,this.dp.replaceDate(ut,_t)}}}),z(this,"onMouseUp",()=>{this.pressed=!1,this.rangeFromFocused=!1,this.rangeToFocused=!1}),z(this,"onChangeViewDate",(R,I)=>{if(!this.isVisible)return;let H=v(R),X=v(I);switch(this.dp.currentView){case s.days:if(_(R,I,s.months))return;break;case s.months:if(_(R,I,s.years))return;break;case s.years:if(H[0]===X[0]&&H[1]===X[1])return}this.render()}),z(this,"render",()=>{this.destroyCells(),this._generateCells(),this.cells.forEach(R=>{this.$cells.appendChild(R.render())})}),this.dp=A,this.type=M,this.opts=B,this.cells=[],this.$el="",this.pressed=!1,this.isVisible=!0,this.init()}init(){this._buildBaseHtml(),this.type===s.days&&this.renderDayNames(),this.render(),this._bindEvents(),this._bindDatepickerEvents()}_bindEvents(){let{range:k,dynamicRange:A}=this.opts;C(this.$el,"mouseover",this.onMouseOverCell),C(this.$el,"mouseout",this.onMouseOutCell),C(this.$el,"click",this.onClickBody),k&&A&&(C(this.$el,"mousedown",this.onMouseDown),C(this.$el,"mousemove",this.onMouseMove),C(window.document,"mouseup",this.onMouseUp))}_bindDatepickerEvents(){this.dp.on(s.eventChangeViewDate,this.onChangeViewDate),this.dp.on(s.eventChangeCurrentView,this.onChangeCurrentView)}_buildBaseHtml(){this.$el=l({className:`air-datepicker-body -${this.type}-`,innerHtml:tt[this.type]}),this.$names=a(".air-datepicker-body--day-names",this.$el),this.$cells=a(".air-datepicker-body--cells",this.$el)}_getDayNamesHtml(){let k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.dp.locale.firstDay,A="",M=this.dp.isWeekend,{onClickDayName:B}=this.opts,R=k,I=0;for(;I<7;){let H=R%7;A+=`
${this.dp.locale.daysMin[H]}
`,I++,R++}return A}renderDayNames(){this.$names.innerHTML=this._getDayNamesHtml()}_generateCell(k){let{type:A,dp:M,opts:B}=this;return new rt({type:A,dp:M,opts:B,date:k,body:this})}_generateCells(){it.getDatesFunction(this.type)(this.dp,k=>{this.cells.push(this._generateCell(k))})}show(){this.isVisible=!0,this.$el.classList.remove("-hidden-")}hide(){this.isVisible=!1,this.$el.classList.add("-hidden-")}destroyCells(){this.cells.forEach(k=>k.destroy()),this.cells=[],this.$cells.innerHTML=""}destroy(){this.destroyCells(),this.dp.off(s.eventChangeViewDate,this.onChangeViewDate),this.dp.off(s.eventChangeCurrentView,this.onChangeCurrentView)}static getDaysDates(k,A){let{viewDate:M,opts:{fixedHeight:B},locale:{firstDay:R}}=k,I=c(M),{year:H,month:X}=d(M),ut=new Date(H,X,1),gt=new Date(H,X,I),_t=ut.getDay()-R,St=6-gt.getDay()+R;_t=_t<0?_t+7:_t,St=St>6?St-7:St;let Ct=function(ye,Ge){let{year:yi,month:bi,date:et}=d(ye);return new Date(yi,bi,et-Ge)}(ut,_t),ee=I+_t+St,Jt=Ct.getDate(),{year:Oe,month:Ie}=d(Ct),Le=0;B&&(ee=42);const He=[];for(;Le0&&arguments[0]!==void 0?arguments[0]:s.days;return{[s.days]:it.getDaysDates,[s.months]:it.getMonthsDates,[s.years]:it.getYearsDates}[k]}}function G(O,k,A){return(k=function(M){var B=function(R,I){if(typeof R!="object"||R===null)return R;var H=R[Symbol.toPrimitive];if(H!==void 0){var X=H.call(R,"string");if(typeof X!="object")return X;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(R)}(M);return typeof B=="symbol"?B:String(B)}(k))in O?Object.defineProperty(O,k,{value:A,enumerable:!0,configurable:!0,writable:!0}):O[k]=A,O}class Z{constructor(k){let{dp:A,opts:M}=k;G(this,"onClickNav",B=>{let R=x(B.target,".air-datepicker-nav--action");if(!R)return;let I=R.dataset.action;this.dp[I]()}),G(this,"onChangeViewDate",()=>{this.render(),this._resetNavStatus(),this.handleNavStatus()}),G(this,"onChangeCurrentView",()=>{this.render(),this._resetNavStatus(),this.handleNavStatus()}),G(this,"onClickNavTitle",()=>{this.dp.isFinalView||this.dp.up()}),G(this,"update",()=>{let{prevHtml:B,nextHtml:R}=this.opts;this.$prev.innerHTML=B,this.$next.innerHTML=R,this._resetNavStatus(),this.render(),this.handleNavStatus()}),G(this,"renderDelay",()=>{setTimeout(this.render)}),G(this,"render",()=>{this.$title.innerHTML=this._getTitle(),function(B,R){for(let I in R)R[I]?B.classList.add(I):B.classList.remove(I)}(this.$title,{"-disabled-":this.dp.isFinalView})}),this.dp=A,this.opts=M,this.init()}init(){this._createElement(),this._buildBaseHtml(),this._defineDOM(),this.render(),this.handleNavStatus(),this._bindEvents(),this._bindDatepickerEvents()}_defineDOM(){this.$title=a(".air-datepicker-nav--title",this.$el),this.$prev=a('[data-action="prev"]',this.$el),this.$next=a('[data-action="next"]',this.$el)}_bindEvents(){this.$el.addEventListener("click",this.onClickNav),this.$title.addEventListener("click",this.onClickNavTitle)}_bindDatepickerEvents(){this.dp.on(s.eventChangeViewDate,this.onChangeViewDate),this.dp.on(s.eventChangeCurrentView,this.onChangeCurrentView),this.isNavIsFunction&&(this.dp.on(s.eventChangeSelectedDate,this.renderDelay),this.dp.opts.timepicker&&this.dp.on(s.eventChangeTime,this.render))}destroy(){this.dp.off(s.eventChangeViewDate,this.onChangeViewDate),this.dp.off(s.eventChangeCurrentView,this.onChangeCurrentView),this.isNavIsFunction&&(this.dp.off(s.eventChangeSelectedDate,this.renderDelay),this.dp.opts.timepicker&&this.dp.off(s.eventChangeTime,this.render))}_createElement(){this.$el=l({tagName:"nav",className:"air-datepicker-nav"})}_getTitle(){let{dp:k,opts:A}=this,M=A.navTitles[k.currentView];return typeof M=="function"?M(k):k.formatDate(k.viewDate,M)}handleNavStatus(){let{disableNavWhenOutOfRange:k}=this.opts,{minDate:A,maxDate:M}=this.dp;if(!A&&!M||!k)return;let{year:B,month:R}=this.dp.parsedViewDate,I=!!A&&d(A),H=!!M&&d(M);switch(this.dp.currentView){case s.days:A&&I.month>=R&&I.year>=B&&this._disableNav("prev"),M&&H.month<=R&&H.year<=B&&this._disableNav("next");break;case s.months:A&&I.year>=B&&this._disableNav("prev"),M&&H.year<=B&&this._disableNav("next");break;case s.years:{let X=v(this.dp.viewDate);A&&I.year>=X[0]&&this._disableNav("prev"),M&&H.year<=X[1]&&this._disableNav("next");break}}}_disableNav(k){a('[data-action="'+k+'"]',this.$el).classList.add("-disabled-")}_resetNavStatus(){(function(k){for(var A=arguments.length,M=new Array(A>1?A-1:0),B=1;B{R.classList.remove(...M)}):k.classList.remove(...M)})(this.$el.querySelectorAll(".air-datepicker-nav--action"),"-disabled-")}_buildBaseHtml(){let{prevHtml:k,nextHtml:A}=this.opts;this.$el.innerHTML=`
${k}
${A}
`}get isNavIsFunction(){let{navTitles:k}=this.opts;return Object.keys(k).find(A=>typeof k[A]=="function")}}var st={today:{content:O=>O.locale.today,onClick:O=>O.setViewDate(new Date)},clear:{content:O=>O.locale.clear,onClick:O=>O.clear()}};class W{constructor(k){let{dp:A,opts:M}=k;this.dp=A,this.opts=M,this.init()}init(){this.createElement(),this.render()}createElement(){this.$el=l({className:"air-datepicker-buttons"})}destroy(){this.$el.parentNode.removeChild(this.$el)}clearHtml(){return this.$el.innerHTML="",this}generateButtons(){let{buttons:k}=this.opts;Array.isArray(k)||(k=[k]),k.forEach(A=>{let M=A;typeof A=="string"&&st[A]&&(M=st[A]);let B=this.createButton(M);M.onClick&&this.attachEventToButton(B,M.onClick),this.$el.appendChild(B)})}attachEventToButton(k,A){k.addEventListener("click",()=>{A(this.dp)})}createButton(k){let{content:A,className:M,tagName:B="button",attrs:R={}}=k;return l({tagName:B,innerHtml:`${typeof A=="function"?A(this.dp):A}`,className:b("air-datepicker-button",M),attrs:R})}render(){this.generateButtons()}}function dt(O,k,A){return(k=function(M){var B=function(R,I){if(typeof R!="object"||R===null)return R;var H=R[Symbol.toPrimitive];if(H!==void 0){var X=H.call(R,"string");if(typeof X!="object")return X;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(R)}(M);return typeof B=="symbol"?B:String(B)}(k))in O?Object.defineProperty(O,k,{value:A,enumerable:!0,configurable:!0,writable:!0}):O[k]=A,O}class nt{constructor(){let{opts:k,dp:A}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};dt(this,"toggleTimepickerIsActive",B=>{this.dp.timepickerIsActive=B}),dt(this,"onChangeSelectedDate",B=>{let{date:R,updateTime:I=!1}=B;R&&(this.setMinMaxTime(R),this.setCurrentTime(!!I&&R),this.addTimeToDate(R))}),dt(this,"onChangeLastSelectedDate",B=>{B&&(this.setTime(B),this.render())}),dt(this,"onChangeInputRange",B=>{let R=B.target;this[R.getAttribute("name")]=R.value,this.updateText(),this.dp.trigger(s.eventChangeTime,{hours:this.hours,minutes:this.minutes})}),dt(this,"onMouseEnterLeave",B=>{let R=B.target.getAttribute("name"),I=this.$minutesText;R==="hours"&&(I=this.$hoursText),I.classList.toggle("-focus-")}),dt(this,"onFocus",()=>{this.toggleTimepickerIsActive(!0)}),dt(this,"onBlur",()=>{this.toggleTimepickerIsActive(!1)}),this.opts=k,this.dp=A;let{timeFormat:M}=this.dp.locale;M&&(M.match(K("h"))||M.match(K("hh")))&&(this.ampm=!0),this.init()}init(){this.setTime(this.dp.lastSelectedDate||this.dp.viewDate),this.createElement(),this.buildHtml(),this.defineDOM(),this.render(),this.bindDatepickerEvents(),this.bindDOMEvents()}bindDatepickerEvents(){this.dp.on(s.eventChangeSelectedDate,this.onChangeSelectedDate),this.dp.on(s.eventChangeLastSelectedDate,this.onChangeLastSelectedDate)}bindDOMEvents(){let k="input";navigator.userAgent.match(/trident/gi)&&(k="change"),C(this.$ranges,k,this.onChangeInputRange),C(this.$ranges,"mouseenter",this.onMouseEnterLeave),C(this.$ranges,"mouseleave",this.onMouseEnterLeave),C(this.$ranges,"focus",this.onFocus),C(this.$ranges,"mousedown",this.onFocus),C(this.$ranges,"blur",this.onBlur)}createElement(){this.$el=l({className:b("air-datepicker-time",{"-am-pm-":this.dp.ampm})})}destroy(){this.dp.off(s.eventChangeSelectedDate,this.onChangeSelectedDate),this.dp.off(s.eventChangeLastSelectedDate,this.onChangeLastSelectedDate),this.$el.parentNode.removeChild(this.$el)}buildHtml(){let{ampm:k,hours:A,displayHours:M,minutes:B,minHours:R,minMinutes:I,maxHours:H,maxMinutes:X,dayPeriod:ut,opts:{hoursStep:gt,minutesStep:_t}}=this;this.$el.innerHTML=`
${g(M)} : ${g(B)} `+(k?`${ut}`:"")+`
`}defineDOM(){let k=A=>a(A,this.$el);this.$ranges=this.$el.querySelectorAll('[type="range"]'),this.$hours=k('[name="hours"]'),this.$minutes=k('[name="minutes"]'),this.$hoursText=k(".air-datepicker-time--current-hours"),this.$minutesText=k(".air-datepicker-time--current-minutes"),this.$ampm=k(".air-datepicker-time--current-ampm")}setTime(k){this.setMinMaxTime(k),this.setCurrentTime(k)}addTimeToDate(k){k&&(k.setHours(this.hours),k.setMinutes(this.minutes))}setMinMaxTime(k){if(this.setMinMaxTimeFromOptions(),k){let{minDate:A,maxDate:M}=this.dp;A&&_(k,A)&&this.setMinTimeFromMinDate(A),M&&_(k,M)&&this.setMaxTimeFromMaxDate(M)}}setCurrentTime(k){let{hours:A,minutes:M}=k?d(k):this;this.hours=D(A,this.minHours,this.maxHours),this.minutes=D(M,this.minMinutes,this.maxMinutes)}setMinMaxTimeFromOptions(){let{minHours:k,minMinutes:A,maxHours:M,maxMinutes:B}=this.opts;this.minHours=D(k,0,23),this.minMinutes=D(A,0,59),this.maxHours=D(M,0,23),this.maxMinutes=D(B,0,59)}setMinTimeFromMinDate(k){let{lastSelectedDate:A}=this.dp;this.minHours=k.getHours(),A&&A.getHours()>k.getHours()?this.minMinutes=this.opts.minMinutes:this.minMinutes=k.getMinutes()}setMaxTimeFromMaxDate(k){let{lastSelectedDate:A}=this.dp;this.maxHours=k.getHours(),A&&A.getHours()B.month++],[[["Control","ArrowLeft"],["Control","ArrowDown"]],B=>B.month--],[[["Shift","ArrowRight"],["Shift","ArrowUp"]],B=>B.year++],[[["Shift","ArrowLeft"],["Shift","ArrowDown"]],B=>B.year--],[[["Alt","ArrowRight"],["Alt","ArrowUp"]],B=>B.year+=10],[[["Alt","ArrowLeft"],["Alt","ArrowDown"]],B=>B.year-=10],[["Control","Shift","ArrowUp"],(B,R)=>R.up()]])),vt(this,"handleHotKey",B=>{let R=this.hotKeys.get(B),I=d(this.getInitialFocusDate());R(I,this.dp);let{year:H,month:X,date:ut}=I,gt=c(new Date(H,X));gt{let B=!1,R=this.pressedKeys.size,I=H=>this.pressedKeys.has(H);for(let[H]of this.hotKeys){if(B)break;if(Array.isArray(H[0]))H.forEach(X=>{B||R!==X.length||(B=X.every(I)&&H)});else{if(R!==H.length)continue;B=H.every(I)&&H}}return B}),vt(this,"isArrow",B=>B>=37&&B<=40),vt(this,"onKeyDown",B=>{let{key:R,which:I}=B,{dp:H,dp:{focusDate:X},opts:ut}=this;this.registerKey(R);let gt=this.isHotKeyPressed();if(gt)return B.preventDefault(),void this.handleHotKey(gt);if(this.isArrow(I))return B.preventDefault(),void this.focusNextCell(R);if(R==="Enter"){if(H.currentView!==ut.minView)return void H.down();if(X){let _t=H._checkIfDateIsSelected(X);return void(_t?H._handleAlreadySelectedDates(_t,X):H.selectDate(X))}}R==="Escape"&&this.dp.hide()}),vt(this,"onKeyUp",B=>{this.removeKey(B.key)}),this.dp=A,this.opts=M,this.init()}init(){this.bindKeyboardEvents()}bindKeyboardEvents(){let{$el:k}=this.dp;k.addEventListener("keydown",this.onKeyDown),k.addEventListener("keyup",this.onKeyUp)}destroy(){let{$el:k}=this.dp;k.removeEventListener("keydown",this.onKeyDown),k.removeEventListener("keyup",this.onKeyUp),this.hotKeys=null,this.pressedKeys=null}getInitialFocusDate(){let{focusDate:k,currentView:A,selectedDates:M,parsedViewDate:{year:B,month:R}}=this.dp,I=k||M[M.length-1];if(!I)switch(A){case s.days:I=new Date(B,R,new Date().getDate());break;case s.months:I=new Date(B,R,1);break;case s.years:I=new Date(B,0,1)}return I}focusNextCell(k){let A=this.getInitialFocusDate(),{currentView:M}=this.dp,{days:B,months:R,years:I}=s,H=d(A),X=H.year,ut=H.month,gt=H.date;switch(k){case"ArrowLeft":M===B&&(gt-=1),M===R&&(ut-=1),M===I&&(X-=1);break;case"ArrowUp":M===B&&(gt-=7),M===R&&(ut-=3),M===I&&(X-=4);break;case"ArrowRight":M===B&&(gt+=1),M===R&&(ut+=1),M===I&&(X+=1);break;case"ArrowDown":M===B&&(gt+=7),M===R&&(ut+=3),M===I&&(X+=4)}let _t=this.dp.getClampedDate(new Date(X,ut,gt));this.dp.setFocusDate(_t,{viewDateTransition:!0})}registerKey(k){this.pressedKeys.add(k)}removeKey(k){this.pressedKeys.delete(k)}}let Mt={on(O,k){this.__events||(this.__events={}),this.__events[O]?this.__events[O].push(k):this.__events[O]=[k]},off(O,k){this.__events&&this.__events[O]&&(this.__events[O]=this.__events[O].filter(A=>A!==k))},removeAllEvents(){this.__events={}},trigger(O){for(var k=arguments.length,A=new Array(k>1?k-1:0),M=1;M{B(...A)})}};function ct(O,k,A){return(k=function(M){var B=function(R,I){if(typeof R!="object"||R===null)return R;var H=R[Symbol.toPrimitive];if(H!==void 0){var X=H.call(R,"string");if(typeof X!="object")return X;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(R)}(M);return typeof B=="symbol"?B:String(B)}(k))in O?Object.defineProperty(O,k,{value:A,enumerable:!0,configurable:!0,writable:!0}):O[k]=A,O}let bt="",yt="",Wt=!1;class Pt{static buildGlobalContainer(k){Wt=!0,bt=l({className:k,id:k}),a("body").appendChild(bt)}constructor(k,A){var M=this;if(ct(this,"viewIndexes",[s.days,s.months,s.years]),ct(this,"next",()=>{let{year:I,month:H}=this.parsedViewDate;switch(this.currentView){case s.days:this.setViewDate(new Date(I,H+1,1));break;case s.months:this.setViewDate(new Date(I+1,H,1));break;case s.years:this.setViewDate(new Date(I+10,0,1))}}),ct(this,"prev",()=>{let{year:I,month:H}=this.parsedViewDate;switch(this.currentView){case s.days:this.setViewDate(new Date(I,H-1,1));break;case s.months:this.setViewDate(new Date(I-1,H,1));break;case s.years:this.setViewDate(new Date(I-10,0,1))}}),ct(this,"_finishHide",()=>{this.hideAnimation=!1,this._destroyComponents(),this.$container.removeChild(this.$datepicker)}),ct(this,"setPosition",function(I){let H=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(typeof(I=I||M.opts.position)=="function")return void(M.customHide=I({$datepicker:M.$datepicker,$target:M.$el,$pointer:M.$pointer,isViewChange:H,done:M._finishHide}));let X,ut,{isMobile:gt}=M.opts,_t=M.$el.getBoundingClientRect(),St=M.$el.getBoundingClientRect(),Ct=M.$datepicker.offsetParent,ee=M.$el.offsetParent,Jt=M.$datepicker.getBoundingClientRect(),Oe=I.split(" "),Ie=window.scrollY,Le=window.scrollX,He=M.opts.offset,ye=Oe[0],Ge=Oe[1];if(gt)M.$datepicker.style.cssText="left: 50%; top: 50%";else{if(Ct===ee&&Ct!==document.body&&(St={top:M.$el.offsetTop,left:M.$el.offsetLeft,width:_t.width,height:M.$el.offsetHeight},Ie=0,Le=0),Ct!==ee&&Ct!==document.body){let yi=Ct.getBoundingClientRect();St={top:_t.top-yi.top,left:_t.left-yi.left,width:_t.width,height:_t.height},Ie=0,Le=0}switch(ye){case"top":X=St.top-Jt.height-He;break;case"right":ut=St.left+St.width+He;break;case"bottom":X=St.top+St.height+He;break;case"left":ut=St.left-Jt.width-He}switch(Ge){case"top":X=St.top;break;case"right":ut=St.left+St.width-Jt.width;break;case"bottom":X=St.top+St.height-Jt.height;break;case"left":ut=St.left;break;case"center":/left|right/.test(ye)?X=St.top+St.height/2-Jt.height/2:ut=St.left+St.width/2-Jt.width/2}M.$datepicker.style.cssText=`left: ${ut+Le}px; top: ${X+Ie}px`}}),ct(this,"_setInputValue",()=>{let{opts:I,$altField:H,locale:{dateFormat:X}}=this,{altFieldDateFormat:ut,altField:gt}=I;gt&&H&&(H.value=this._getInputValue(ut)),this.$el.value=this._getInputValue(X)}),ct(this,"_getInputValue",I=>{let{selectedDates:H,opts:X}=this,{multipleDates:ut,multipleDatesSeparator:gt}=X;if(!H.length)return"";let _t=typeof I=="function",St=_t?I(ut?H:H[0]):H.map(Ct=>this.formatDate(Ct,I));return St=_t?St:St.join(gt),St}),ct(this,"_checkIfDateIsSelected",function(I){let H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:s.days,X=!1;return M.selectedDates.some(ut=>{let gt=_(I,ut,H);return X=gt&&ut,gt}),X}),ct(this,"_scheduleCallAfterTransition",I=>{this._cancelScheduledCall(),I&&I(!1),this._onTransitionEnd=()=>{I&&I(!0)},this.$datepicker.addEventListener("transitionend",this._onTransitionEnd,{once:!0})}),ct(this,"_cancelScheduledCall",()=>{this.$datepicker.removeEventListener("transitionend",this._onTransitionEnd)}),ct(this,"setViewDate",I=>{if(!((I=$(I))instanceof Date)||_(I,this.viewDate))return;let H=this.viewDate;this.viewDate=I;let{onChangeViewDate:X}=this.opts;if(X){let{month:ut,year:gt}=this.parsedViewDate;X({month:ut,year:gt,decade:this.curDecade})}this.trigger(s.eventChangeViewDate,I,H)}),ct(this,"setFocusDate",function(I){let H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(!I||(I=$(I))instanceof Date)&&(M.focusDate=I,M.trigger(s.eventChangeFocusDate,I,H))}),ct(this,"setCurrentView",function(I){let H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(M.viewIndexes.includes(I)){if(M.currentView=I,M.elIsInput&&M.visible&&M.setPosition(void 0,!0),M.trigger(s.eventChangeCurrentView,I),!M.views[I]){let X=M.views[I]=new it({dp:M,opts:M.opts,type:I});M.shouldUpdateDOM&&M.$content.appendChild(X.$el)}M.opts.onChangeView&&!H.silent&&M.opts.onChangeView(I)}}),ct(this,"_updateLastSelectedDate",I=>{this.lastSelectedDate=I,this.trigger(s.eventChangeLastSelectedDate,I)}),ct(this,"destroy",()=>{if(this.isDestroyed)return;let{showEvent:I,isMobile:H}=this.opts,X=this.$datepicker.parentNode;X&&X.removeChild(this.$datepicker),this.$el.removeEventListener(I,this._onFocus),this.$el.removeEventListener("blur",this._onBlur),window.removeEventListener("resize",this._onResize),H&&this._removeMobileAttributes(),this.keyboardNav&&this.keyboardNav.destroy(),this.views=null,this.nav=null,this.$datepicker=null,this.opts={},this.$customContainer=null,this.viewDate=null,this.focusDate=null,this.selectedDates=[],this.rangeDateFrom=null,this.rangeDateTo=null,this.isDestroyed=!0}),ct(this,"update",function(){let I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},X=V({},M.opts),{silent:ut}=H;V(M.opts,I);let{timepicker:gt,buttons:_t,range:St,selectedDates:Ct,isMobile:ee}=M.opts,Jt=M.visible||M.treatAsInline;M._createMinMaxDates(),M._limitViewDateByMaxMinDates(),M._handleLocale(),Ct&&(M.selectedDates=[],M.selectDate(Ct,{silent:ut})),I.view&&M.setCurrentView(I.view,{silent:ut}),M._setInputValue(),X.range&&!St?(M.rangeDateTo=!1,M.rangeDateFrom=!1):!X.range&&St&&M.selectedDates.length&&(M.rangeDateFrom=M.selectedDates[0],M.rangeDateTo=M.selectedDates[1]),X.timepicker&&!gt?(Jt&&M.timepicker.destroy(),M.timepicker=!1,M.$timepicker.parentNode.removeChild(M.$timepicker)):!X.timepicker&>&&M._addTimepicker(),!X.buttons&&_t?M._addButtons():X.buttons&&!_t?(M.buttons.destroy(),M.$buttons.parentNode.removeChild(M.$buttons)):Jt&&X.buttons&&_t&&M.buttons.clearHtml().render(),!X.isMobile&&ee?(M.treatAsInline||yt||M._createMobileOverlay(),M._addMobileAttributes(),M.visible&&M._showMobileOverlay()):X.isMobile&&!ee&&(M._removeMobileAttributes(),M.visible&&(yt.classList.remove("-active-"),typeof M.opts.position!="function"&&M.setPosition())),Jt&&(M.nav.update(),M.views[M.currentView].render(),M.currentView===s.days&&M.views[M.currentView].renderDayNames())}),ct(this,"disableDate",(I,H)=>{(Array.isArray(I)?I:[I]).forEach(X=>{let ut=$(X);if(!ut)return;let gt=H?"delete":"add";this.disabledDates[gt](this.formatDate(ut,"yyyy-MM-dd"));let _t=this.getCell(ut,this.currentViewSingular);_t&&_t.adpCell.render()},[])}),ct(this,"enableDate",I=>{this.disableDate(I,!0)}),ct(this,"isDateDisabled",I=>{let H=$(I);return this.disabledDates.has(this.formatDate(H,"yyyy-MM-dd"))}),ct(this,"isOtherMonth",I=>{let{month:H}=d(I);return H!==this.parsedViewDate.month}),ct(this,"isOtherYear",I=>{let{year:H}=d(I);return H!==this.parsedViewDate.year}),ct(this,"isOtherDecade",I=>{let{year:H}=d(I),[X,ut]=v(this.viewDate);return Hut}),ct(this,"_onChangeSelectedDate",I=>{let{silent:H}=I;setTimeout(()=>{this._setInputValue(),this.opts.onSelect&&!H&&this._triggerOnSelect()})}),ct(this,"_onChangeFocusedDate",function(I){let{viewDateTransition:H}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!I)return;let X=!1;H&&(X=M.isOtherMonth(I)||M.isOtherYear(I)||M.isOtherDecade(I)),X&&M.setViewDate(I),M.opts.onFocus&&M.opts.onFocus({datepicker:M,date:I})}),ct(this,"_onChangeTime",I=>{let{hours:H,minutes:X}=I,ut=new Date,{lastSelectedDate:gt,opts:{onSelect:_t}}=this,St=gt;gt||(St=ut);let Ct=this.getCell(St,this.currentViewSingular),ee=Ct&&Ct.adpCell;ee&&ee.isDisabled||(St.setHours(H),St.setMinutes(X),gt?(this._setInputValue(),_t&&this._triggerOnSelect()):this.selectDate(St))}),ct(this,"_onFocus",I=>{this.visible||this.show()}),ct(this,"_onBlur",I=>{this.inFocus||!this.visible||this.opts.isMobile||this.hide()}),ct(this,"_onMouseDown",I=>{this.inFocus=!0}),ct(this,"_onMouseUp",I=>{this.inFocus=!1,this.$el.focus()}),ct(this,"_onResize",()=>{this.visible&&typeof this.opts.position!="function"&&this.setPosition()}),ct(this,"_onClickOverlay",()=>{this.visible&&this.hide()}),ct(this,"getViewDates",function(){let I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:s.days;return it.getDatesFunction(I)(M)}),ct(this,"isWeekend",I=>this.opts.weekends.includes(I)),ct(this,"getClampedDate",I=>{let{minDate:H,maxDate:X}=this,ut=I;return X&&w(I,X)?ut=X:H&&T(I,H)&&(ut=H),ut}),this.$el=a(k),!this.$el)return;this.$datepicker=l({className:"air-datepicker"}),this.opts=V({},r,A),this.$customContainer=!!this.opts.container&&a(this.opts.container),this.$altField=a(this.opts.altField||!1);let{view:B,startDate:R}=this.opts;R||(this.opts.startDate=new Date),this.$el.nodeName==="INPUT"&&(this.elIsInput=!0),this.inited=!1,this.visible=!1,this.viewDate=$(this.opts.startDate),this.focusDate=!1,this.initialReadonly=this.$el.getAttribute("readonly"),this.customHide=!1,this.currentView=B,this.selectedDates=[],this.disabledDates=new Set,this.isDestroyed=!1,this.views={},this.keys=[],this.rangeDateFrom="",this.rangeDateTo="",this.timepickerIsActive=!1,this.treatAsInline=this.opts.inline||!this.elIsInput,this.init()}init(){let{opts:k,treatAsInline:A,opts:{inline:M,isMobile:B,selectedDates:R,keyboardNav:I,onlyTimepicker:H}}=this,X=a("body");(!Wt||Wt&&bt&&!X.contains(bt))&&!M&&this.elIsInput&&!this.$customContainer&&Pt.buildGlobalContainer(Pt.defaultGlobalContainerId),!B||yt||A||this._createMobileOverlay(),this._handleLocale(),this._bindSubEvents(),this._createMinMaxDates(),this._limitViewDateByMaxMinDates(),this.elIsInput&&(M||this._bindEvents(),I&&!H&&(this.keyboardNav=new kt({dp:this,opts:k}))),R&&this.selectDate(R,{silent:!0}),this.opts.visible&&!A&&this.show(),B&&!A&&this.$el.setAttribute("readonly",!0),A&&this._createComponents()}_createMobileOverlay(){yt=l({className:"air-datepicker-overlay"}),bt.appendChild(yt)}_createComponents(){let{opts:k,treatAsInline:A,opts:{inline:M,buttons:B,timepicker:R,position:I,classes:H,onlyTimepicker:X,isMobile:ut}}=this;this._buildBaseHtml(),this.elIsInput&&(M||this._setPositionClasses(I)),!M&&this.elIsInput||this.$datepicker.classList.add("-inline-"),H&&this.$datepicker.classList.add(...H.split(" ")),X&&this.$datepicker.classList.add("-only-timepicker-"),ut&&!A&&this._addMobileAttributes(),this.views[this.currentView]=new it({dp:this,type:this.currentView,opts:k}),this.nav=new Z({dp:this,opts:k}),R&&this._addTimepicker(),B&&this._addButtons(),this.$content.appendChild(this.views[this.currentView].$el),this.$nav.appendChild(this.nav.$el)}_destroyComponents(){for(let k in this.views)this.views[k].destroy();this.views={},this.nav.destroy(),this.timepicker&&this.timepicker.destroy()}_addMobileAttributes(){yt.addEventListener("click",this._onClickOverlay),this.$datepicker.classList.add("-is-mobile-"),this.$el.setAttribute("readonly",!0)}_removeMobileAttributes(){yt.removeEventListener("click",this._onClickOverlay),this.$datepicker.classList.remove("-is-mobile-"),this.initialReadonly||this.initialReadonly===""||this.$el.removeAttribute("readonly")}_createMinMaxDates(){let{minDate:k,maxDate:A}=this.opts;this.minDate=!!k&&$(k),this.maxDate=!!A&&$(A)}_addTimepicker(){this.$timepicker=l({className:"air-datepicker--time"}),this.$datepicker.appendChild(this.$timepicker),this.timepicker=new nt({dp:this,opts:this.opts}),this.$timepicker.appendChild(this.timepicker.$el)}_addButtons(){this.$buttons=l({className:"air-datepicker--buttons"}),this.$datepicker.appendChild(this.$buttons),this.buttons=new W({dp:this,opts:this.opts}),this.$buttons.appendChild(this.buttons.$el)}_bindSubEvents(){this.on(s.eventChangeSelectedDate,this._onChangeSelectedDate),this.on(s.eventChangeFocusDate,this._onChangeFocusedDate),this.on(s.eventChangeTime,this._onChangeTime)}_buildBaseHtml(){let{inline:k}=this.opts;var A,M;this.elIsInput?k?(A=this.$datepicker,(M=this.$el).parentNode.insertBefore(A,M.nextSibling)):this.$container.appendChild(this.$datepicker):this.$el.appendChild(this.$datepicker),this.$datepicker.innerHTML='
',this.$content=a(".air-datepicker--content",this.$datepicker),this.$pointer=a(".air-datepicker--pointer",this.$datepicker),this.$nav=a(".air-datepicker--navigation",this.$datepicker)}_handleLocale(){let{locale:k,dateFormat:A,firstDay:M,timepicker:B,onlyTimepicker:R,timeFormat:I,dateTimeSeparator:H}=this.opts;var X;this.locale=(X=k,JSON.parse(JSON.stringify(X))),A&&(this.locale.dateFormat=A),I!==void 0&&I!==""&&(this.locale.timeFormat=I);let{timeFormat:ut}=this.locale;if(M!==""&&(this.locale.firstDay=M),B&&typeof A!="function"){let gt=ut?H:"";this.locale.dateFormat=[this.locale.dateFormat,ut||""].join(gt)}R&&typeof A!="function"&&(this.locale.dateFormat=this.locale.timeFormat)}_setPositionClasses(k){if(typeof k=="function")return void this.$datepicker.classList.add("-custom-position-");let A=(k=k.split(" "))[0],M=`air-datepicker -${A}-${k[1]}- -from-${A}-`;this.$datepicker.classList.add(...M.split(" "))}_bindEvents(){this.$el.addEventListener(this.opts.showEvent,this._onFocus),this.$el.addEventListener("blur",this._onBlur),this.$datepicker.addEventListener("mousedown",this._onMouseDown),this.$datepicker.addEventListener("mouseup",this._onMouseUp),window.addEventListener("resize",this._onResize)}_limitViewDateByMaxMinDates(){let{viewDate:k,minDate:A,maxDate:M}=this;M&&w(k,M)&&this.setViewDate(M),A&&T(k,A)&&this.setViewDate(A)}formatDate(){let k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.viewDate,A=arguments.length>1?arguments[1]:void 0;if(k=$(k),!(k instanceof Date))return;let M=A,B=this.locale,R=d(k),I=R.dayPeriod,H=v(k),X=Pt.replacer,ut={T:k.getTime(),m:R.minutes,mm:R.fullMinutes,h:R.hours12,hh:R.fullHours12,H:R.hours,HH:R.fullHours,aa:I,AA:I.toUpperCase(),E:B.daysShort[R.day],EEEE:B.days[R.day],d:R.date,dd:R.fullDate,M:R.month+1,MM:R.fullMonth,MMM:B.monthsShort[R.month],MMMM:B.months[R.month],yy:R.year.toString().slice(-2),yyyy:R.year,yyyy1:H[0],yyyy2:H[1]};for(let[gt,_t]of Object.entries(ut))M=X(M,K(gt),_t);return M}down(k){this._handleUpDownActions(k,"down")}up(k){this._handleUpDownActions(k,"up")}selectDate(k){let A,M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{currentView:B,parsedViewDate:R,selectedDates:I}=this,{updateTime:H}=M,{moveToOtherMonthsOnSelect:X,moveToOtherYearsOnSelect:ut,multipleDates:gt,range:_t,autoClose:St,onBeforeSelect:Ct}=this.opts,ee=I.length;if(Array.isArray(k))return k.forEach(Jt=>{this.selectDate(Jt,M)}),new Promise(Jt=>{setTimeout(Jt)});if((k=$(k))instanceof Date){if(Ct&&!Ct({date:k,datepicker:this}))return Promise.resolve();if(B===s.days&&k.getMonth()!==R.month&&X&&(A=new Date(k.getFullYear(),k.getMonth(),1)),B===s.years&&k.getFullYear()!==R.year&&ut&&(A=new Date(k.getFullYear(),0,1)),A&&this.setViewDate(A),gt&&!_t){if(ee===gt)return;this._checkIfDateIsSelected(k)||I.push(k)}else if(_t)switch(ee){case 1:I.push(k),this.rangeDateTo||(this.rangeDateTo=k),w(this.rangeDateFrom,this.rangeDateTo)&&(this.rangeDateTo=this.rangeDateFrom,this.rangeDateFrom=k),this.selectedDates=[this.rangeDateFrom,this.rangeDateTo];break;case 2:this.selectedDates=[k],this.rangeDateFrom=k,this.rangeDateTo="";break;default:this.selectedDates=[k],this.rangeDateFrom=k}else this.selectedDates=[k];return this.trigger(s.eventChangeSelectedDate,{action:s.actionSelectDate,silent:M==null?void 0:M.silent,date:k,updateTime:H}),this._updateLastSelectedDate(k),St&&!this.timepickerIsActive&&this.visible&&(gt||_t?_t&&ee===1&&this.hide():this.hide()),new Promise(Jt=>{setTimeout(Jt)})}}unselectDate(k){let A=this.selectedDates,M=this;if((k=$(k))instanceof Date)return A.some((B,R)=>{if(_(B,k))return A.splice(R,1),M.selectedDates.length?(M.rangeDateTo="",M.rangeDateFrom=A[0],M._updateLastSelectedDate(M.selectedDates[M.selectedDates.length-1])):(M.rangeDateFrom="",M.rangeDateTo="",M._updateLastSelectedDate(!1)),this.trigger(s.eventChangeSelectedDate,{action:s.actionUnselectDate,date:k}),!0})}replaceDate(k,A){let M=this.selectedDates.find(R=>_(R,k,this.currentView)),B=this.selectedDates.indexOf(M);B<0||_(this.selectedDates[B],A,this.currentView)||(this.selectedDates[B]=A,this.trigger(s.eventChangeSelectedDate,{action:s.actionSelectDate,date:A,updateTime:!0}),this._updateLastSelectedDate(A))}clear(){let k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this.selectedDates=[],this.rangeDateFrom=!1,this.rangeDateTo=!1,this.lastSelectedDate=!1,this.trigger(s.eventChangeSelectedDate,{action:s.actionUnselectDate,silent:k.silent}),new Promise(A=>{setTimeout(A)})}show(){let{onShow:k,isMobile:A}=this.opts;this._cancelScheduledCall(),this.visible||this.hideAnimation||this._createComponents(),this.setPosition(this.opts.position),this.$datepicker.classList.add("-active-"),this.visible=!0,k&&this._scheduleCallAfterTransition(k),A&&this._showMobileOverlay()}hide(){let{onHide:k,isMobile:A}=this.opts,M=this._hasTransition();this.visible=!1,this.hideAnimation=!0,this.$datepicker.classList.remove("-active-"),this.customHide&&this.customHide(),this.elIsInput&&this.$el.blur(),this._scheduleCallAfterTransition(B=>{!this.customHide&&(B&&M||!B&&!M)&&this._finishHide(),k&&k(B)}),A&&yt.classList.remove("-active-")}_triggerOnSelect(){let k=[],A=[],{selectedDates:M,locale:B,opts:{onSelect:R,multipleDates:I,range:H}}=this,X=I||H,ut=typeof B.dateFormat=="function";M.length&&(k=M.map(S),A=ut?I?B.dateFormat(k):k.map(gt=>B.dateFormat(gt)):k.map(gt=>this.formatDate(gt,B.dateFormat))),R({date:X?k:k[0],formattedDate:X?A:A[0],datepicker:this})}_handleAlreadySelectedDates(k,A){let{selectedDates:M,rangeDateFrom:B,rangeDateTo:R}=this,{range:I,toggleSelected:H}=this.opts,X=M.length,ut=typeof H=="function"?H({datepicker:this,date:A}):H,gt=!!(I&&X===1&&k),_t=gt?S(A):A;I&&!ut&&(X!==2&&this.selectDate(_t),X===2&&_(B,R))||(ut?this.unselectDate(_t):this._updateLastSelectedDate(gt?_t:k))}_handleUpDownActions(k,A){if(!((k=$(k||this.focusDate||this.viewDate))instanceof Date))return;let M=A==="up"?this.viewIndex+1:this.viewIndex-1;M>2&&(M=2),M<0&&(M=0),this.setViewDate(new Date(k.getFullYear(),k.getMonth(),1)),this.setCurrentView(this.viewIndexes[M])}getCell(k){let A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:s.day;if(!((k=$(k))instanceof Date))return;let{year:M,month:B,date:R}=d(k),I=`[data-year="${M}"]`,H=`[data-month="${B}"]`,X={[s.day]:`${I}${H}[data-date="${R}"]`,[s.month]:`${I}${H}`,[s.year]:`${I}`};return this.views[this.currentView]?this.views[this.currentView].$el.querySelector(X[A]):void 0}_showMobileOverlay(){yt.classList.add("-active-")}_hasTransition(){return window.getComputedStyle(this.$datepicker).getPropertyValue("transition-duration").split(", ").reduce((k,A)=>parseFloat(A)+k,0)>0}get shouldUpdateDOM(){return this.visible||this.treatAsInline}get parsedViewDate(){return d(this.viewDate)}get currentViewSingular(){return this.currentView.slice(0,-1)}get curDecade(){return v(this.viewDate)}get viewIndex(){return this.viewIndexes.indexOf(this.currentView)}get isFinalView(){return this.currentView===s.years}get hasSelectedDates(){return this.selectedDates.length>0}get isMinViewReached(){return this.currentView===this.opts.minView||this.currentView===s.days}get $container(){return this.$customContainer||bt}static replacer(k,A,M){return k.replace(A,function(B,R,I,H){return R+M+H})}}var J;return ct(Pt,"defaults",r),ct(Pt,"version","3.5.3"),ct(Pt,"defaultGlobalContainerId","air-datepicker-global-container"),J=Pt.prototype,Object.assign(J,Mt),n.default}()})})(yg);var fk=yg.exports;const pk=ul(fk);var bg={exports:{}};(function(i,t){(function(e,n){i.exports=n()})(cl,function(){var e=1e3,n=6e4,s=36e5,r="millisecond",a="second",l="minute",h="hour",c="day",d="week",p="month",g="quarter",v="year",b="date",_="Invalid Date",w=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,T=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,S={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(it){var G=["th","st","nd","rd"],Z=it%100;return"["+it+(G[(Z-20)%10]||G[Z]||G[0])+"]"}},C=function(it,G,Z){var st=String(it);return!st||st.length>=G?it:""+Array(G+1-st.length).join(Z)+it},x={s:C,z:function(it){var G=-it.utcOffset(),Z=Math.abs(G),st=Math.floor(Z/60),W=Z%60;return(G<=0?"+":"-")+C(st,2,"0")+":"+C(W,2,"0")},m:function it(G,Z){if(G.date()1)return it(nt[0])}else{var vt=G.name;V[vt]=G,W=vt}return!st&&W&&(D=W),W||!st&&D},rt=function(it,G){if(K(it))return it.clone();var Z=typeof G=="object"?G:{};return Z.date=it,Z.args=arguments,new tt(Z)},z=x;z.l=q,z.i=K,z.w=function(it,G){return rt(it,{locale:G.$L,utc:G.$u,x:G.$x,$offset:G.$offset})};var tt=function(){function it(Z){this.$L=q(Z.locale,null,!0),this.parse(Z),this.$x=this.$x||Z.x||{},this[$]=!0}var G=it.prototype;return G.parse=function(Z){this.$d=function(st){var W=st.date,dt=st.utc;if(W===null)return new Date(NaN);if(z.u(W))return new Date;if(W instanceof Date)return new Date(W);if(typeof W=="string"&&!/Z$/i.test(W)){var nt=W.match(w);if(nt){var vt=nt[2]-1||0,kt=(nt[7]||"0").substring(0,3);return dt?new Date(Date.UTC(nt[1],vt,nt[3]||1,nt[4]||0,nt[5]||0,nt[6]||0,kt)):new Date(nt[1],vt,nt[3]||1,nt[4]||0,nt[5]||0,nt[6]||0,kt)}}return new Date(W)}(Z),this.init()},G.init=function(){var Z=this.$d;this.$y=Z.getFullYear(),this.$M=Z.getMonth(),this.$D=Z.getDate(),this.$W=Z.getDay(),this.$H=Z.getHours(),this.$m=Z.getMinutes(),this.$s=Z.getSeconds(),this.$ms=Z.getMilliseconds()},G.$utils=function(){return z},G.isValid=function(){return this.$d.toString()!==_},G.isSame=function(Z,st){var W=rt(Z);return this.startOf(st)<=W&&W<=this.endOf(st)},G.isAfter=function(Z,st){return rt(Z)',prev:''},br={input:".__input-field__",inputValue:".__date-picker-input-value__",calendar:".__date-picker-calendar__",clearButton:".__date-picker-clear__",defaultIcon:".__date-picker-default__"},Ls={openCalendar:"date-picker__calendar_open",openCalendarRt:"date-picker__calendar_open-rt",visibleClearButton:"date-picker__input-icon_visible"},uf={minDate:"data-min-date",maxDate:"data-max-date"};lu.extend(vk);const yk={inline:!0,position:"left bottom",toggleSelected:!1,prevHtml:cf.prev,nextHtml:cf.next,locale:_k};class bk extends Kt{constructor(t){super(t),this.dropdownSide="default",this.minDate=this.element.getAttribute(uf.minDate),this.maxDate=this.element.getAttribute(uf.maxDate),this.input=this.element.querySelector(br.input),this.inputValue=this.element.querySelector(br.inputValue),this.calendar=this.element.querySelector(br.calendar),this.clearButton=this.element.querySelector(br.clearButton),this.defaultIcon=this.element.querySelector(br.defaultIcon),this.addListeners()}onClearButtonVisibilityChange(t){const e=t?"add":"remove",n=t?"remove":"add";this.clearButton.classList[e](Ls.visibleClearButton),this.defaultIcon.classList[n](Ls.visibleClearButton)}onClickOutside(t){t.target&&(this.element.contains(t.target)||this.onCalendarClose())}isRightSidePosition(){return window.innerWidth/2Math.max(Math.min(i,e),t);function Mr(i){return En(ho(i*2.55),0,255)}function Dn(i){return En(ho(i*255),0,255)}function en(i){return En(ho(i/2.55)/100,0,1)}function hf(i){return En(ho(i*100),0,100)}const pi={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},cu=[..."0123456789ABCDEF"],wk=i=>cu[i&15],xk=i=>cu[(i&240)>>4]+cu[i&15],qo=i=>(i&240)>>4===(i&15),Sk=i=>qo(i.r)&&qo(i.g)&&qo(i.b)&&qo(i.a);function kk(i){var t=i.length,e;return i[0]==="#"&&(t===4||t===5?e={r:255&pi[i[1]]*17,g:255&pi[i[2]]*17,b:255&pi[i[3]]*17,a:t===5?pi[i[4]]*17:255}:(t===7||t===9)&&(e={r:pi[i[1]]<<4|pi[i[2]],g:pi[i[3]]<<4|pi[i[4]],b:pi[i[5]]<<4|pi[i[6]],a:t===9?pi[i[7]]<<4|pi[i[8]]:255})),e}const Ek=(i,t)=>i<255?t(i):"";function Ck(i){var t=Sk(i)?wk:xk;return i?"#"+t(i.r)+t(i.g)+t(i.b)+Ek(i.a,t):void 0}const Tk=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function xg(i,t,e){const n=t*Math.min(e,1-e),s=(r,a=(r+i/30)%12)=>e-n*Math.max(Math.min(a-3,9-a,1),-1);return[s(0),s(8),s(4)]}function Mk(i,t,e){const n=(s,r=(s+i/60)%6)=>e-e*t*Math.max(Math.min(r,4-r,1),0);return[n(5),n(3),n(1)]}function Lk(i,t,e){const n=xg(i,1,.5);let s;for(t+e>1&&(s=1/(t+e),t*=s,e*=s),s=0;s<3;s++)n[s]*=1-t-e,n[s]+=t;return n}function Ak(i,t,e,n,s){return i===s?(t-e)/n+(t.5?d/(2-r-a):d/(r+a),h=Ak(e,n,s,d,r),h=h*60+.5),[h|0,c||0,l]}function Qu(i,t,e,n){return(Array.isArray(t)?i(t[0],t[1],t[2]):i(t,e,n)).map(Dn)}function th(i,t,e){return Qu(xg,i,t,e)}function Dk(i,t,e){return Qu(Lk,i,t,e)}function Pk(i,t,e){return Qu(Mk,i,t,e)}function Sg(i){return(i%360+360)%360}function Ok(i){const t=Tk.exec(i);let e=255,n;if(!t)return;t[5]!==n&&(e=t[6]?Mr(+t[5]):Dn(+t[5]));const s=Sg(+t[2]),r=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?n=Dk(s,r,a):t[1]==="hsv"?n=Pk(s,r,a):n=th(s,r,a),{r:n[0],g:n[1],b:n[2],a:e}}function Ik(i,t){var e=Ju(i);e[0]=Sg(e[0]+t),e=th(e),i.r=e[0],i.g=e[1],i.b=e[2]}function Fk(i){if(!i)return;const t=Ju(i),e=t[0],n=hf(t[1]),s=hf(t[2]);return i.a<255?`hsla(${e}, ${n}%, ${s}%, ${en(i.a)})`:`hsl(${e}, ${n}%, ${s}%)`}const df={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},ff={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function Rk(){const i={},t=Object.keys(ff),e=Object.keys(df);let n,s,r,a,l;for(n=0;n>16&255,r>>8&255,r&255]}return i}let Go;function Bk(i){Go||(Go=Rk(),Go.transparent=[0,0,0,0]);const t=Go[i.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Vk=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Nk(i){const t=Vk.exec(i);let e=255,n,s,r;if(t){if(t[7]!==n){const a=+t[7];e=t[8]?Mr(a):En(a*255,0,255)}return n=+t[1],s=+t[3],r=+t[5],n=255&(t[2]?Mr(n):En(n,0,255)),s=255&(t[4]?Mr(s):En(s,0,255)),r=255&(t[6]?Mr(r):En(r,0,255)),{r:n,g:s,b:r,a:e}}}function zk(i){return i&&(i.a<255?`rgba(${i.r}, ${i.g}, ${i.b}, ${en(i.a)})`:`rgb(${i.r}, ${i.g}, ${i.b})`)}const gc=i=>i<=.0031308?i*12.92:Math.pow(i,1/2.4)*1.055-.055,As=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);function $k(i,t,e){const n=As(en(i.r)),s=As(en(i.g)),r=As(en(i.b));return{r:Dn(gc(n+e*(As(en(t.r))-n))),g:Dn(gc(s+e*(As(en(t.g))-s))),b:Dn(gc(r+e*(As(en(t.b))-r))),a:i.a+e*(t.a-i.a)}}function Zo(i,t,e){if(i){let n=Ju(i);n[t]=Math.max(0,Math.min(n[t]+n[t]*e,t===0?360:1)),n=th(n),i.r=n[0],i.g=n[1],i.b=n[2]}}function kg(i,t){return i&&Object.assign(t||{},i)}function pf(i){var t={r:0,g:0,b:0,a:255};return Array.isArray(i)?i.length>=3&&(t={r:i[0],g:i[1],b:i[2],a:255},i.length>3&&(t.a=Dn(i[3]))):(t=kg(i,{r:0,g:0,b:0,a:1}),t.a=Dn(t.a)),t}function Hk(i){return i.charAt(0)==="r"?Nk(i):Ok(i)}class Kr{constructor(t){if(t instanceof Kr)return t;const e=typeof t;let n;e==="object"?n=pf(t):e==="string"&&(n=kk(t)||Bk(t)||Hk(t)),this._rgb=n,this._valid=!!n}get valid(){return this._valid}get rgb(){var t=kg(this._rgb);return t&&(t.a=en(t.a)),t}set rgb(t){this._rgb=pf(t)}rgbString(){return this._valid?zk(this._rgb):void 0}hexString(){return this._valid?Ck(this._rgb):void 0}hslString(){return this._valid?Fk(this._rgb):void 0}mix(t,e){if(t){const n=this.rgb,s=t.rgb;let r;const a=e===r?.5:e,l=2*a-1,h=n.a-s.a,c=((l*h===-1?l:(l+h)/(1+l*h))+1)/2;r=1-c,n.r=255&c*n.r+r*s.r+.5,n.g=255&c*n.g+r*s.g+.5,n.b=255&c*n.b+r*s.b+.5,n.a=a*n.a+(1-a)*s.a,this.rgb=n}return this}interpolate(t,e){return t&&(this._rgb=$k(this._rgb,t._rgb,e)),this}clone(){return new Kr(this.rgb)}alpha(t){return this._rgb.a=Dn(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=ho(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Zo(this._rgb,2,t),this}darken(t){return Zo(this._rgb,2,-t),this}saturate(t){return Zo(this._rgb,1,t),this}desaturate(t){return Zo(this._rgb,1,-t),this}rotate(t){return Ik(this._rgb,t),this}}/*! * Chart.js v4.4.6 * https://www.chartjs.org * (c) 2024 Chart.js Contributors * Released under the MIT License */function Ji(){}const jk=(()=>{let i=0;return()=>i++})();function Gt(i){return i===null||typeof i>"u"}function ce(i){if(Array.isArray&&Array.isArray(i))return!0;const t=Object.prototype.toString.call(i);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function jt(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}function me(i){return(typeof i=="number"||i instanceof Number)&&isFinite(+i)}function ni(i,t){return me(i)?i:t}function Rt(i,t){return typeof i>"u"?t:i}const Uk=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100:+i/t,Eg=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*t:+i;function re(i,t,e){if(i&&typeof i.call=="function")return i.apply(e,t)}function te(i,t,e,n){let s,r,a;if(ce(i))for(r=i.length,s=0;si,x:i=>i.x,y:i=>i.y};function Gk(i){const t=i.split("."),e=[];let n="";for(const s of t)n+=s,n.endsWith("\\")?n=n.slice(0,-1)+".":(e.push(n),n="");return e}function Zk(i){const t=Gk(i);return e=>{for(const n of t){if(n==="")break;e=e&&e[n]}return e}}function On(i,t){return(mf[t]||(mf[t]=Zk(t)))(i)}function eh(i){return i.charAt(0).toUpperCase()+i.slice(1)}const Jr=i=>typeof i<"u",In=i=>typeof i=="function",gf=(i,t)=>{if(i.size!==t.size)return!1;for(const e of i)if(!t.has(e))return!1;return!0};function Yk(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}const ae=Math.PI,oe=2*ae,Kk=oe+ae,ja=Number.POSITIVE_INFINITY,Xk=ae/180,_e=ae/2,Zn=ae/4,vf=ae*2/3,Cn=Math.log10,Hi=Math.sign;function Br(i,t,e){return Math.abs(i-t)s-r).pop(),t}function $s(i){return!isNaN(parseFloat(i))&&isFinite(i)}function Qk(i,t){const e=Math.round(i);return e-t<=i&&e+t>=i}function Tg(i,t,e){let n,s,r;for(n=0,s=i.length;nh&&c=Math.min(t,e)-n&&i<=Math.max(t,e)+n}function nh(i,t,e){e=e||(a=>i[a]1;)r=s+n>>1,e(r)?s=r:n=r;return{lo:s,hi:n}}const an=(i,t,e,n)=>nh(i,e,n?s=>{const r=i[s][t];return ri[s][t]nh(i,e,n=>i[n][t]>=e);function nE(i,t,e){let n=0,s=i.length;for(;nn&&i[s-1]>e;)s--;return n>0||s{const n="_onData"+eh(e),s=i[e];Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value(...r){const a=s.apply(this,r);return i._chartjs.listeners.forEach(l=>{typeof l[n]=="function"&&l[n](...r)}),a}})})}function bf(i,t){const e=i._chartjs;if(!e)return;const n=e.listeners,s=n.indexOf(t);s!==-1&&n.splice(s,1),!(n.length>0)&&(Lg.forEach(r=>{delete i[r]}),delete i._chartjs)}function Ag(i){const t=new Set(i);return t.size===i.length?i:Array.from(t)}const Dg=function(){return typeof window>"u"?function(i){return i()}:window.requestAnimationFrame}();function Pg(i,t){let e=[],n=!1;return function(...s){e=s,n||(n=!0,Dg.call(window,()=>{n=!1,i.apply(t,e)}))}}function rE(i,t){let e;return function(...n){return t?(clearTimeout(e),e=setTimeout(i,t,n)):i.apply(this,n),t}}const sh=i=>i==="start"?"left":i==="end"?"right":"center",Be=(i,t,e)=>i==="start"?t:i==="end"?e:(t+e)/2,oE=(i,t,e,n)=>i===(n?"left":"right")?e:i==="center"?(t+e)/2:t;function Og(i,t,e){const n=t.length;let s=0,r=n;if(i._sorted){const{iScale:a,_parsed:l}=i,h=a.axis,{min:c,max:d,minDefined:p,maxDefined:g}=a.getUserBounds();p&&(s=Me(Math.min(an(l,h,c).lo,e?n:an(t,h,a.getPixelForValue(c)).lo),0,n-1)),g?r=Me(Math.max(an(l,a.axis,d,!0).hi+1,e?0:an(t,h,a.getPixelForValue(d),!0).hi+1),s,n)-s:r=n-s}return{start:s,count:r}}function Ig(i){const{xScale:t,yScale:e,_scaleRanges:n}=i,s={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!n)return i._scaleRanges=s,!0;const r=n.xmin!==t.min||n.xmax!==t.max||n.ymin!==e.min||n.ymax!==e.max;return Object.assign(n,s),r}const Yo=i=>i===0||i===1,wf=(i,t,e)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-t)*oe/e)),xf=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*oe/e)+1,Vr={linear:i=>i,easeInQuad:i=>i*i,easeOutQuad:i=>-i*(i-2),easeInOutQuad:i=>(i/=.5)<1?.5*i*i:-.5*(--i*(i-2)-1),easeInCubic:i=>i*i*i,easeOutCubic:i=>(i-=1)*i*i+1,easeInOutCubic:i=>(i/=.5)<1?.5*i*i*i:.5*((i-=2)*i*i+2),easeInQuart:i=>i*i*i*i,easeOutQuart:i=>-((i-=1)*i*i*i-1),easeInOutQuart:i=>(i/=.5)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2),easeInQuint:i=>i*i*i*i*i,easeOutQuint:i=>(i-=1)*i*i*i*i+1,easeInOutQuint:i=>(i/=.5)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2),easeInSine:i=>-Math.cos(i*_e)+1,easeOutSine:i=>Math.sin(i*_e),easeInOutSine:i=>-.5*(Math.cos(ae*i)-1),easeInExpo:i=>i===0?0:Math.pow(2,10*(i-1)),easeOutExpo:i=>i===1?1:-Math.pow(2,-10*i)+1,easeInOutExpo:i=>Yo(i)?i:i<.5?.5*Math.pow(2,10*(i*2-1)):.5*(-Math.pow(2,-10*(i*2-1))+2),easeInCirc:i=>i>=1?i:-(Math.sqrt(1-i*i)-1),easeOutCirc:i=>Math.sqrt(1-(i-=1)*i),easeInOutCirc:i=>(i/=.5)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1),easeInElastic:i=>Yo(i)?i:wf(i,.075,.3),easeOutElastic:i=>Yo(i)?i:xf(i,.075,.3),easeInOutElastic(i){return Yo(i)?i:i<.5?.5*wf(i*2,.1125,.45):.5+.5*xf(i*2-1,.1125,.45)},easeInBack(i){return i*i*((1.70158+1)*i-1.70158)},easeOutBack(i){return(i-=1)*i*((1.70158+1)*i+1.70158)+1},easeInOutBack(i){let t=1.70158;return(i/=.5)<1?.5*(i*i*(((t*=1.525)+1)*i-t)):.5*((i-=2)*i*(((t*=1.525)+1)*i+t)+2)},easeInBounce:i=>1-Vr.easeOutBounce(1-i),easeOutBounce(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},easeInOutBounce:i=>i<.5?Vr.easeInBounce(i*2)*.5:Vr.easeOutBounce(i*2-1)*.5+.5};function rh(i){if(i&&typeof i=="object"){const t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Sf(i){return rh(i)?i:new Kr(i)}function vc(i){return rh(i)?i:new Kr(i).saturate(.5).darken(.1).hexString()}const aE=["x","y","borderWidth","radius","tension"],lE=["color","borderColor","backgroundColor"];function cE(i){i.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),i.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),i.set("animations",{colors:{type:"color",properties:lE},numbers:{type:"number",properties:aE}}),i.describe("animations",{_fallback:"animation"}),i.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function uE(i){i.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const kf=new Map;function hE(i,t){t=t||{};const e=i+JSON.stringify(t);let n=kf.get(e);return n||(n=new Intl.NumberFormat(i,t),kf.set(e,n)),n}function fo(i,t,e){return hE(t,e).format(i)}const Fg={values(i){return ce(i)?i:""+i},numeric(i,t,e){if(i===0)return"0";const n=this.chart.options.locale;let s,r=i;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),r=dE(i,e)}const a=Cn(Math.abs(r)),l=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),h={notation:s,minimumFractionDigits:l,maximumFractionDigits:l};return Object.assign(h,this.options.ticks.format),fo(i,n,h)},logarithmic(i,t,e){if(i===0)return"0";const n=e[t].significand||i/Math.pow(10,Math.floor(Cn(i)));return[1,2,3,5,10,15].includes(n)||t>.8*e.length?Fg.numeric.call(this,i,t,e):""}};function dE(i,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&i!==Math.floor(i)&&(e=i-Math.floor(i)),e}var hl={formatters:Fg};function fE(i){i.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:hl.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),i.route("scale.ticks","color","","color"),i.route("scale.grid","color","","borderColor"),i.route("scale.border","color","","borderColor"),i.route("scale.title","color","","color"),i.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),i.describe("scales",{_fallback:"scale"}),i.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const ds=Object.create(null),hu=Object.create(null);function Nr(i,t){if(!t)return i;const e=t.split(".");for(let n=0,s=e.length;nn.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(n,s)=>vc(s.backgroundColor),this.hoverBorderColor=(n,s)=>vc(s.borderColor),this.hoverColor=(n,s)=>vc(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return _c(this,t,e)}get(t){return Nr(this,t)}describe(t,e){return _c(hu,t,e)}override(t,e){return _c(ds,t,e)}route(t,e,n,s){const r=Nr(this,t),a=Nr(this,n),l="_"+e;Object.defineProperties(r,{[l]:{value:r[e],writable:!0},[e]:{enumerable:!0,get(){const h=this[l],c=a[s];return jt(h)?Object.assign({},c,h):Rt(h,c)},set(h){this[l]=h}}})}apply(t){t.forEach(e=>e(this))}}var ue=new pE({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[cE,uE,fE]);function mE(i){return!i||Gt(i.size)||Gt(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function Ua(i,t,e,n,s){let r=t[s];return r||(r=t[s]=i.measureText(s).width,e.push(s)),r>n&&(n=r),n}function gE(i,t,e,n){n=n||{};let s=n.data=n.data||{},r=n.garbageCollect=n.garbageCollect||[];n.font!==t&&(s=n.data={},r=n.garbageCollect=[],n.font=t),i.save(),i.font=t;let a=0;const l=e.length;let h,c,d,p,g;for(h=0;he.length){for(h=0;h0&&i.stroke()}}function ln(i,t,e){return e=e||.5,!t||i&&i.x>t.left-e&&i.xt.top-e&&i.y0&&r.strokeColor!=="";let h,c;for(i.save(),i.font=s.string,yE(i,r),h=0;h+i||0;function oh(i,t){const e={},n=jt(t),s=n?Object.keys(t):t,r=jt(i)?n?a=>Rt(i[a],i[t[a]]):a=>i[a]:()=>i;for(const a of s)e[a]=EE(r(a));return e}function Bg(i){return oh(i,{top:"y",right:"x",bottom:"y",left:"x"})}function as(i){return oh(i,["topLeft","topRight","bottomLeft","bottomRight"])}function $e(i){const t=Bg(i);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Ce(i,t){i=i||{},t=t||ue.font;let e=Rt(i.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let n=Rt(i.style,t.style);n&&!(""+n).match(SE)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);const s={family:Rt(i.family,t.family),lineHeight:kE(Rt(i.lineHeight,t.lineHeight),e),size:e,style:n,weight:Rt(i.weight,t.weight),string:""};return s.string=mE(s),s}function Lr(i,t,e,n){let s,r,a;for(s=0,r=i.length;se&&l===0?0:l+h;return{min:a(n,-Math.abs(r)),max:a(s,r)}}function Rn(i,t){return Object.assign(Object.create(i),t)}function ah(i,t=[""],e,n,s=()=>i[0]){const r=e||i;typeof n>"u"&&(n=$g("_fallback",i));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:r,_fallback:n,_getTarget:s,override:l=>ah([l,...i],t,r,n)};return new Proxy(a,{deleteProperty(l,h){return delete l[h],delete l._keys,delete i[0][h],!0},get(l,h){return Ng(l,h,()=>IE(h,t,i,l))},getOwnPropertyDescriptor(l,h){return Reflect.getOwnPropertyDescriptor(l._scopes[0],h)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(l,h){return Tf(l).includes(h)},ownKeys(l){return Tf(l)},set(l,h,c){const d=l._storage||(l._storage=s());return l[h]=d[h]=c,delete l._keys,!0}})}function Hs(i,t,e,n){const s={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:Vg(i,n),setContext:r=>Hs(i,r,e,n),override:r=>Hs(i.override(r),t,e,n)};return new Proxy(s,{deleteProperty(r,a){return delete r[a],delete i[a],!0},get(r,a,l){return Ng(r,a,()=>ME(r,a,l))},getOwnPropertyDescriptor(r,a){return r._descriptors.allKeys?Reflect.has(i,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,a)},getPrototypeOf(){return Reflect.getPrototypeOf(i)},has(r,a){return Reflect.has(i,a)},ownKeys(){return Reflect.ownKeys(i)},set(r,a,l){return i[a]=l,delete r[a],!0}})}function Vg(i,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:n=t.indexable,_allKeys:s=t.allKeys}=i;return{allKeys:s,scriptable:e,indexable:n,isScriptable:In(e)?e:()=>e,isIndexable:In(n)?n:()=>n}}const TE=(i,t)=>i?i+eh(t):t,lh=(i,t)=>jt(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Ng(i,t,e){if(Object.prototype.hasOwnProperty.call(i,t)||t==="constructor")return i[t];const n=e();return i[t]=n,n}function ME(i,t,e){const{_proxy:n,_context:s,_subProxy:r,_descriptors:a}=i;let l=n[t];return In(l)&&a.isScriptable(t)&&(l=LE(t,l,i,e)),ce(l)&&l.length&&(l=AE(t,l,i,a.isIndexable)),lh(t,l)&&(l=Hs(l,s,r&&r[t],a)),l}function LE(i,t,e,n){const{_proxy:s,_context:r,_subProxy:a,_stack:l}=e;if(l.has(i))throw new Error("Recursion detected: "+Array.from(l).join("->")+"->"+i);l.add(i);let h=t(r,a||n);return l.delete(i),lh(i,h)&&(h=ch(s._scopes,s,i,h)),h}function AE(i,t,e,n){const{_proxy:s,_context:r,_subProxy:a,_descriptors:l}=e;if(typeof r.index<"u"&&n(i))return t[r.index%t.length];if(jt(t[0])){const h=t,c=s._scopes.filter(d=>d!==h);t=[];for(const d of h){const p=ch(c,s,i,d);t.push(Hs(p,r,a&&a[i],l))}}return t}function zg(i,t,e){return In(i)?i(t,e):i}const DE=(i,t)=>i===!0?t:typeof i=="string"?On(t,i):void 0;function PE(i,t,e,n,s){for(const r of t){const a=DE(e,r);if(a){i.add(a);const l=zg(a._fallback,e,s);if(typeof l<"u"&&l!==e&&l!==n)return l}else if(a===!1&&typeof n<"u"&&e!==n)return null}return!1}function ch(i,t,e,n){const s=t._rootScopes,r=zg(t._fallback,e,n),a=[...i,...s],l=new Set;l.add(n);let h=Cf(l,a,e,r||e,n);return h===null||typeof r<"u"&&r!==e&&(h=Cf(l,a,r,h,n),h===null)?!1:ah(Array.from(l),[""],s,r,()=>OE(t,e,n))}function Cf(i,t,e,n,s){for(;e;)e=PE(i,t,e,n,s);return e}function OE(i,t,e){const n=i._getTarget();t in n||(n[t]={});const s=n[t];return ce(s)&&jt(e)?e:s||{}}function IE(i,t,e,n){let s;for(const r of t)if(s=$g(TE(r,i),e),typeof s<"u")return lh(i,s)?ch(e,n,i,s):s}function $g(i,t){for(const e of t){if(!e)continue;const n=e[i];if(typeof n<"u")return n}}function Tf(i){let t=i._keys;return t||(t=i._keys=FE(i._scopes)),t}function FE(i){const t=new Set;for(const e of i)for(const n of Object.keys(e).filter(s=>!s.startsWith("_")))t.add(n);return Array.from(t)}function Hg(i,t,e,n){const{iScale:s}=i,{key:r="r"}=this._parsing,a=new Array(n);let l,h,c,d;for(l=0,h=n;lti==="x"?"y":"x";function BE(i,t,e,n){const s=i.skip?t:i,r=t,a=e.skip?t:e,l=uu(r,s),h=uu(a,r);let c=l/(l+h),d=h/(l+h);c=isNaN(c)?0:c,d=isNaN(d)?0:d;const p=n*c,g=n*d;return{previous:{x:r.x-p*(a.x-s.x),y:r.y-p*(a.y-s.y)},next:{x:r.x+g*(a.x-s.x),y:r.y+g*(a.y-s.y)}}}function VE(i,t,e){const n=i.length;let s,r,a,l,h,c=js(i,0);for(let d=0;d!c.skip)),t.cubicInterpolationMode==="monotone")zE(i,s);else{let c=n?i[i.length-1]:i[0];for(r=0,a=i.length;ri.ownerDocument.defaultView.getComputedStyle(i,null);function jE(i,t){return pl(i).getPropertyValue(t)}const UE=["top","right","bottom","left"];function ls(i,t,e){const n={};e=e?"-"+e:"";for(let s=0;s<4;s++){const r=UE[s];n[r]=parseFloat(i[t+"-"+r+e])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}const WE=(i,t,e)=>(i>0||t>0)&&(!e||!e.shadowRoot);function qE(i,t){const e=i.touches,n=e&&e.length?e[0]:i,{offsetX:s,offsetY:r}=n;let a=!1,l,h;if(WE(s,r,i.target))l=s,h=r;else{const c=t.getBoundingClientRect();l=n.clientX-c.left,h=n.clientY-c.top,a=!0}return{x:l,y:h,box:a}}function ts(i,t){if("native"in i)return i;const{canvas:e,currentDevicePixelRatio:n}=t,s=pl(e),r=s.boxSizing==="border-box",a=ls(s,"padding"),l=ls(s,"border","width"),{x:h,y:c,box:d}=qE(i,e),p=a.left+(d&&l.left),g=a.top+(d&&l.top);let{width:v,height:b}=t;return r&&(v-=a.width+l.width,b-=a.height+l.height),{x:Math.round((h-p)/v*e.width/n),y:Math.round((c-g)/b*e.height/n)}}function GE(i,t,e){let n,s;if(t===void 0||e===void 0){const r=i&&hh(i);if(!r)t=i.clientWidth,e=i.clientHeight;else{const a=r.getBoundingClientRect(),l=pl(r),h=ls(l,"border","width"),c=ls(l,"padding");t=a.width-c.width-h.width,e=a.height-c.height-h.height,n=Wa(l.maxWidth,r,"clientWidth"),s=Wa(l.maxHeight,r,"clientHeight")}}return{width:t,height:e,maxWidth:n||ja,maxHeight:s||ja}}const Xo=i=>Math.round(i*10)/10;function ZE(i,t,e,n){const s=pl(i),r=ls(s,"margin"),a=Wa(s.maxWidth,i,"clientWidth")||ja,l=Wa(s.maxHeight,i,"clientHeight")||ja,h=GE(i,t,e);let{width:c,height:d}=h;if(s.boxSizing==="content-box"){const g=ls(s,"border","width"),v=ls(s,"padding");c-=v.width+g.width,d-=v.height+g.height}return c=Math.max(0,c-r.width),d=Math.max(0,n?c/n:d-r.height),c=Xo(Math.min(c,a,h.maxWidth)),d=Xo(Math.min(d,l,h.maxHeight)),c&&!d&&(d=Xo(c/2)),(t!==void 0||e!==void 0)&&n&&h.height&&d>h.height&&(d=h.height,c=Xo(Math.floor(d*n))),{width:c,height:d}}function Mf(i,t,e){const n=t||1,s=Math.floor(i.height*n),r=Math.floor(i.width*n);i.height=Math.floor(i.height),i.width=Math.floor(i.width);const a=i.canvas;return a.style&&(e||!a.style.height&&!a.style.width)&&(a.style.height=`${i.height}px`,a.style.width=`${i.width}px`),i.currentDevicePixelRatio!==n||a.height!==s||a.width!==r?(i.currentDevicePixelRatio=n,a.height=s,a.width=r,i.ctx.setTransform(n,0,0,n,0,0),!0):!1}const YE=function(){let i=!1;try{const t={get passive(){return i=!0,!1}};uh()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return i}();function Lf(i,t){const e=jE(i,t),n=e&&e.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function es(i,t,e,n){return{x:i.x+e*(t.x-i.x),y:i.y+e*(t.y-i.y)}}function KE(i,t,e,n){return{x:i.x+e*(t.x-i.x),y:n==="middle"?e<.5?i.y:t.y:n==="after"?e<1?i.y:t.y:e>0?t.y:i.y}}function XE(i,t,e,n){const s={x:i.cp2x,y:i.cp2y},r={x:t.cp1x,y:t.cp1y},a=es(i,s,e),l=es(s,r,e),h=es(r,t,e),c=es(a,l,e),d=es(l,h,e);return es(c,d,e)}const JE=function(i,t){return{x(e){return i+i+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,n){return e-n},leftForLtr(e,n){return e-n}}},QE=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,t){return i+t},leftForLtr(i,t){return i}}};function Ns(i,t,e){return i?JE(t,e):QE()}function Ug(i,t){let e,n;(t==="ltr"||t==="rtl")&&(e=i.canvas.style,n=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),i.prevTextDirection=n)}function Wg(i,t){t!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",t[0],t[1]))}function qg(i){return i==="angle"?{between:Qr,compare:tE,normalize:oi}:{between:on,compare:(t,e)=>t-e,normalize:t=>t}}function Af({start:i,end:t,count:e,loop:n,style:s}){return{start:i%e,end:t%e,loop:n&&(t-i+1)%e===0,style:s}}function tC(i,t,e){const{property:n,start:s,end:r}=e,{between:a,normalize:l}=qg(n),h=t.length;let{start:c,end:d,loop:p}=i,g,v;if(p){for(c+=h,d+=h,g=0,v=h;gh(s,C,T)&&l(s,C)!==0,D=()=>l(r,T)===0||h(r,C,T),V=()=>_||x(),$=()=>!_||D();for(let K=d,q=d;K<=p;++K)S=t[K%a],!S.skip&&(T=c(S[n]),T!==C&&(_=h(T,s,r),w===null&&V()&&(w=l(T,s)===0?K:q),w!==null&&$()&&(b.push(Af({start:w,end:K,loop:g,count:a,style:v})),w=null),q=K,C=T));return w!==null&&b.push(Af({start:w,end:p,loop:g,count:a,style:v})),b}function Zg(i,t){const e=[],n=i.segments;for(let s=0;ss&&i[r%t].skip;)r--;return r%=t,{start:s,end:r}}function iC(i,t,e,n){const s=i.length,r=[];let a=t,l=i[t],h;for(h=t+1;h<=e;++h){const c=i[h%s];c.skip||c.stop?l.skip||(n=!1,r.push({start:t%s,end:(h-1)%s,loop:n}),t=a=c.stop?h:null):(a=h,l.skip&&(t=h)),l=c}return a!==null&&r.push({start:t%s,end:a%s,loop:n}),r}function nC(i,t){const e=i.points,n=i.options.spanGaps,s=e.length;if(!s)return[];const r=!!i._loop,{start:a,end:l}=eC(e,s,r,n);if(n===!0)return Df(i,[{start:a,end:l,loop:r}],e,t);const h=ll({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(n-e.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=Dg.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((n,s)=>{if(!n.running||!n.items.length)return;const r=n.items;let a=r.length-1,l=!1,h;for(;a>=0;--a)h=r[a],h._active?(h._total>n.duration&&(n.duration=h._total),h.tick(t),l=!0):(r[a]=r[r.length-1],r.pop());l&&(s.draw(),this._notify(s,n,t,"progress")),r.length||(n.running=!1,this._notify(s,n,t,"complete"),n.initial=!1),e+=r.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let n=e.get(t);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,n)),n}listen(t,e,n){this._getAnims(t).listeners[e].push(n)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((n,s)=>Math.max(n,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const n=e.items;let s=n.length-1;for(;s>=0;--s)n[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Qi=new oC;const Of="transparent",aC={boolean(i,t,e){return e>.5?t:i},color(i,t,e){const n=Sf(i||Of),s=n.valid&&Sf(t||Of);return s&&s.valid?s.mix(n,e).hexString():t},number(i,t,e){return i+(t-i)*e}};class lC{constructor(t,e,n,s){const r=e[n];s=Lr([t.to,s,r,t.from]);const a=Lr([t.from,r,s]);this._active=!0,this._fn=t.fn||aC[t.type||typeof a],this._easing=Vr[t.easing]||Vr.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=n,this._from=a,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,n){if(this._active){this._notify(!1);const s=this._target[this._prop],r=n-this._start,a=this._duration-r;this._start=n,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=Lr([t.to,e,s,t.from]),this._from=Lr([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,n=this._duration,s=this._prop,r=this._from,a=this._loop,l=this._to;let h;if(this._active=r!==l&&(a||e1?2-h:h,h=this._easing(Math.min(1,Math.max(0,h))),this._target[s]=this._fn(r,l,h)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,n)=>{t.push({res:e,rej:n})})}_notify(t){const e=t?"res":"rej",n=this._promises||[];for(let s=0;s{const r=t[s];if(!jt(r))return;const a={};for(const l of e)a[l]=r[l];(ce(r.properties)&&r.properties||[s]).forEach(l=>{(l===s||!n.has(l))&&n.set(l,a)})})}_animateOptions(t,e){const n=e.options,s=uC(t,n);if(!s)return[];const r=this._createAnimations(s,n);return n.$shared&&cC(t.options.$animations,n).then(()=>{t.options=n},()=>{}),r}_createAnimations(t,e){const n=this._properties,s=[],r=t.$animations||(t.$animations={}),a=Object.keys(e),l=Date.now();let h;for(h=a.length-1;h>=0;--h){const c=a[h];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,e));continue}const d=e[c];let p=r[c];const g=n.get(c);if(p)if(g&&p.active()){p.update(g,d,l);continue}else p.cancel();if(!g||!g.duration){t[c]=d;continue}r[c]=p=new lC(g,t,c,d),s.push(p)}return s}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const n=this._createAnimations(t,e);if(n.length)return Qi.add(this._chart,n),!0}}function cC(i,t){const e=[],n=Object.keys(t);for(let s=0;s0||!e&&r<0)return s.index}return null}function Bf(i,t){const{chart:e,_cachedMeta:n}=i,s=e._stacks||(e._stacks={}),{iScale:r,vScale:a,index:l}=n,h=r.axis,c=a.axis,d=pC(r,a,n),p=t.length;let g;for(let v=0;ve[n].axis===t).shift()}function vC(i,t){return Rn(i,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function _C(i,t,e){return Rn(i,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function wr(i,t){const e=i.controller.index,n=i.vScale&&i.vScale.axis;if(n){t=t||i._parsed;for(const s of t){const r=s._stacks;if(!r||r[n]===void 0||r[n][e]===void 0)return;delete r[n][e],r[n]._visualValues!==void 0&&r[n]._visualValues[e]!==void 0&&delete r[n]._visualValues[e]}}}const wc=i=>i==="reset"||i==="none",Vf=(i,t)=>t?i:Object.assign({},i),yC=(i,t,e)=>i&&!t.hidden&&t._stacked&&{keys:Kg(e,!0),values:null};class Mi{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=yc(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&wr(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,n=this.getDataset(),s=(p,g,v,b)=>p==="x"?g:p==="r"?b:v,r=e.xAxisID=Rt(n.xAxisID,bc(t,"x")),a=e.yAxisID=Rt(n.yAxisID,bc(t,"y")),l=e.rAxisID=Rt(n.rAxisID,bc(t,"r")),h=e.indexAxis,c=e.iAxisID=s(h,r,a,l),d=e.vAxisID=s(h,a,r,l);e.xScale=this.getScaleForId(r),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(l),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(d)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&bf(this._data,this),t._stacked&&wr(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),n=this._data;if(jt(e)){const s=this._cachedMeta;this._data=fC(e,s)}else if(n!==e){if(n){bf(n,this);const s=this._cachedMeta;wr(s),s._parsed=[]}e&&Object.isExtensible(e)&&sE(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,n=this.getDataset();let s=!1;this._dataCheck();const r=e._stacked;e._stacked=yc(e.vScale,e),e.stack!==n.stack&&(s=!0,wr(e),e.stack=n.stack),this._resyncElements(t),(s||r!==e._stacked)&&(Bf(this,e._parsed),e._stacked=yc(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),n=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:n,_data:s}=this,{iScale:r,_stacked:a}=n,l=r.axis;let h=t===0&&e===s.length?!0:n._sorted,c=t>0&&n._parsed[t-1],d,p,g;if(this._parsing===!1)n._parsed=s,n._sorted=!0,g=s;else{ce(s[t])?g=this.parseArrayData(n,s,t,e):jt(s[t])?g=this.parseObjectData(n,s,t,e):g=this.parsePrimitiveData(n,s,t,e);const v=()=>p[l]===null||c&&p[l]_||p<_}for(g=0;g=0;--g)if(!b()){this.updateRangeFromParsed(c,t,v,h);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,n=[];let s,r,a;for(s=0,r=e.length;s=0&&tthis.getContext(n,s,e),_=c.resolveNamedOptions(g,v,b,p);return _.$shared&&(_.$shared=h,r[a]=Object.freeze(Vf(_,h))),_}_resolveAnimations(t,e,n){const s=this.chart,r=this._cachedDataOpts,a=`animation-${e}`,l=r[a];if(l)return l;let h;if(s.options.animation!==!1){const d=this.chart.config,p=d.datasetAnimationScopeKeys(this._type,e),g=d.getOptionScopes(this.getDataset(),p);h=d.createResolver(g,this.getContext(t,n,e))}const c=new Yg(s,h&&h.animations);return h&&h._cacheable&&(r[a]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||wc(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const n=this.resolveDataElementOptions(t,e),s=this._sharedOptions,r=this.getSharedOptions(n),a=this.includeOptions(e,r)||r!==s;return this.updateSharedOptions(r,e,n),{sharedOptions:r,includeOptions:a}}updateElement(t,e,n,s){wc(s)?Object.assign(t,n):this._resolveAnimations(e,s).update(t,n)}updateSharedOptions(t,e,n){t&&!wc(e)&&this._resolveAnimations(void 0,e).update(t,n)}_setStyle(t,e,n,s){t.active=s;const r=this.getStyle(e,s);this._resolveAnimations(e,n,s).update(t,{options:!s&&this.getSharedOptions(r)||r})}removeHoverStyle(t,e,n){this._setStyle(t,n,"active",!1)}setHoverStyle(t,e,n){this._setStyle(t,n,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,n=this._cachedMeta.data;for(const[l,h,c]of this._syncList)this[l](h,c);this._syncList=[];const s=n.length,r=e.length,a=Math.min(r,s);a&&this.parse(0,a),r>s?this._insertElements(s,r-s,t):r{for(c.length+=e,l=c.length-1;l>=a;l--)c[l]=c[l-e]};for(h(r),l=t;ls-r))}return i._cache.$bar}function wC(i){const t=i.iScale,e=bC(t,i.type);let n=t._length,s,r,a,l;const h=()=>{a===32767||a===-32768||(Jr(l)&&(n=Math.min(n,Math.abs(a-l)||n)),l=a)};for(s=0,r=e.length;s0?s[i-1]:null,l=iMath.abs(l)&&(h=l,c=a),t[e.axis]=c,t._custom={barStart:h,barEnd:c,start:s,end:r,min:a,max:l}}function Xg(i,t,e,n){return ce(i)?kC(i,t,e,n):t[e.axis]=e.parse(i,n),t}function Nf(i,t,e,n){const s=i.iScale,r=i.vScale,a=s.getLabels(),l=s===r,h=[];let c,d,p,g;for(c=e,d=e+n;c=e?1:-1)}function CC(i){let t,e,n,s,r;return i.horizontal?(t=i.base>i.x,e="left",n="right"):(t=i.based.controller.options.grouped),r=n.options.stacked,a=[],l=this._cachedMeta.controller.getParsed(e),h=l&&l[n.axis],c=d=>{const p=d._parsed.find(v=>v[n.axis]===h),g=p&&p[d.vScale.axis];if(Gt(g)||isNaN(g))return!0};for(const d of s)if(!(e!==void 0&&c(d))&&((r===!1||a.indexOf(d.stack)===-1||r===void 0&&d.stack===void 0)&&a.push(d.stack),d.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,n){const s=this._getStacks(t,n),r=e!==void 0?s.indexOf(e):-1;return r===-1?s.length-1:r}_getRuler(){const t=this.options,e=this._cachedMeta,n=e.iScale,s=[];let r,a;for(r=0,a=e.data.length;r=0;--n)e=Math.max(e,t[n].size(this.resolveDataElementOptions(n))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart.data.labels||[],{xScale:s,yScale:r}=e,a=this.getParsed(t),l=s.getLabelForValue(a.x),h=r.getLabelForValue(a.y),c=a._custom;return{label:n[t]||"",value:"("+l+", "+h+(c?", "+c:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,n,s){const r=s==="reset",{iScale:a,vScale:l}=this._cachedMeta,{sharedOptions:h,includeOptions:c}=this._getSharedOptions(e,s),d=a.axis,p=l.axis;for(let g=e;gQr(C,l,h,!0)?1:Math.max(x,x*e,D,D*e),b=(C,x,D)=>Qr(C,l,h,!0)?-1:Math.min(x,x*e,D,D*e),_=v(0,c,p),w=v(_e,d,g),T=b(ae,c,p),S=b(ae+_e,d,g);n=(_-T)/2,s=(w-S)/2,r=-(_+T)/2,a=-(w+S)/2}return{ratioX:n,ratioY:s,offsetX:r,offsetY:a}}class rs extends Mi{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const n=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=n;else{let r=h=>+n[h];if(jt(n[t])){const{key:h="value"}=this._parsing;r=c=>+On(n[c],h)}let a,l;for(a=t,l=t+e;a0&&!isNaN(t)?oe*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,s=n.data.labels||[],r=fo(e._parsed[t],n.options.locale);return{label:s[t]||"",value:r}}getMaxBorderWidth(t){let e=0;const n=this.chart;let s,r,a,l,h;if(!t){for(s=0,r=n.data.datasets.length;st!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),pt(rs,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:n,color:s}}=t.legend.options;return e.labels.map((r,a)=>{const h=t.getDatasetMeta(0).controller.getStyle(a);return{text:r,fillStyle:h.backgroundColor,strokeStyle:h.borderColor,fontColor:s,lineWidth:h.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.chart.update()}}}});class xa extends Mi{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:n,data:s=[],_dataset:r}=e,a=this.chart._animationsDisabled;let{start:l,count:h}=Og(e,s,a);this._drawStart=l,this._drawCount=h,Ig(e)&&(l=0,h=s.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!r._decimated,n.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(n,void 0,{animated:!a,options:c},t),this.updateElements(s,l,h,t)}updateElements(t,e,n,s){const r=s==="reset",{iScale:a,vScale:l,_stacked:h,_dataset:c}=this._cachedMeta,{sharedOptions:d,includeOptions:p}=this._getSharedOptions(e,s),g=a.axis,v=l.axis,{spanGaps:b,segment:_}=this.options,w=$s(b)?b:Number.POSITIVE_INFINITY,T=this.chart._animationsDisabled||r||s==="none",S=e+n,C=t.length;let x=e>0&&this.getParsed(e-1);for(let D=0;D=S){$.skip=!0;continue}const K=this.getParsed(D),q=Gt(K[v]),rt=$[g]=a.getPixelForValue(K[g],D),z=$[v]=r||q?l.getBasePixel():l.getPixelForValue(h?this.applyStack(l,K,h):K[v],D);$.skip=isNaN(rt)||isNaN(z)||q,$.stop=D>0&&Math.abs(K[g]-x[g])>w,_&&($.parsed=K,$.raw=c.data[D]),p&&($.options=d||this.resolveDataElementOptions(D,V.active?"active":s)),T||this.updateElement(V,D,$,s),x=K}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,n=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return n;const r=s[0].size(this.resolveDataElementOptions(0)),a=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(n,r,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}pt(xa,"id","line"),pt(xa,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),pt(xa,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class zr extends Mi{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,s=n.data.labels||[],r=fo(e._parsed[t].r,n.options.locale);return{label:s[t]||"",value:r}}parseObjectData(t,e,n,s){return Hg.bind(this)(t,e,n,s)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((n,s)=>{const r=this.getParsed(s).r;!isNaN(r)&&this.chart.getDataVisibility(s)&&(re.max&&(e.max=r))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,n=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),r=Math.max(s/2,0),a=Math.max(n.cutoutPercentage?r/100*n.cutoutPercentage:1,0),l=(r-a)/t.getVisibleDatasetCount();this.outerRadius=r-l*this.index,this.innerRadius=this.outerRadius-l}updateElements(t,e,n,s){const r=s==="reset",a=this.chart,h=a.options.animation,c=this._cachedMeta.rScale,d=c.xCenter,p=c.yCenter,g=c.getIndexAngle(0)-.5*ae;let v=g,b;const _=360/this.countVisibleElements();for(b=0;b{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&e++}),e}_computeAngle(t,e,n){return this.chart.getDataVisibility(t)?Ei(this.resolveDataElementOptions(t,e).angle||n):0}}pt(zr,"id","polarArea"),pt(zr,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),pt(zr,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:n,color:s}}=t.legend.options;return e.labels.map((r,a)=>{const h=t.getDatasetMeta(0).controller.getStyle(a);return{text:r,fillStyle:h.backgroundColor,strokeStyle:h.borderColor,fontColor:s,lineWidth:h.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class fu extends rs{}pt(fu,"id","pie"),pt(fu,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Sa extends Mi{getLabelAndValue(t){const e=this._cachedMeta.vScale,n=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(n[e.axis])}}parseObjectData(t,e,n,s){return Hg.bind(this)(t,e,n,s)}update(t){const e=this._cachedMeta,n=e.dataset,s=e.data||[],r=e.iScale.getLabels();if(n.points=s,t!=="resize"){const a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);const l={_loop:!0,_fullLoop:r.length===s.length,options:a};this.updateElement(n,void 0,l,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,n,s){const r=this._cachedMeta.rScale,a=s==="reset";for(let l=e;l0&&this.getParsed(e-1);for(let x=e;x0&&Math.abs(V[v]-C[v])>T,w&&($.parsed=V,$.raw=c.data[x]),g&&($.options=p||this.resolveDataElementOptions(x,D.active?"active":s)),S||this.updateElement(D,x,$,s),C=V}this.updateSharedOptions(p,s,d)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let l=0;for(let h=e.length-1;h>=0;--h)l=Math.max(l,e[h].size(this.resolveDataElementOptions(h))/2);return l>0&&l}const n=t.dataset,s=n.options&&n.options.borderWidth||0;if(!e.length)return s;const r=e[0].size(this.resolveDataElementOptions(0)),a=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,r,a)/2}}pt(ka,"id","scatter"),pt(ka,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),pt(ka,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var DC=Object.freeze({__proto__:null,BarController:ba,BubbleController:wa,DoughnutController:rs,LineController:xa,PieController:fu,PolarAreaController:zr,RadarController:Sa,ScatterController:ka});function Kn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class dh{constructor(t){pt(this,"options");this.options=t||{}}static override(t){Object.assign(dh.prototype,t)}init(){}formats(){return Kn()}parse(){return Kn()}format(){return Kn()}add(){return Kn()}diff(){return Kn()}startOf(){return Kn()}endOf(){return Kn()}}var PC={_date:dh};function OC(i,t,e,n){const{controller:s,data:r,_sorted:a}=i,l=s._cachedMeta.iScale;if(l&&t===l.axis&&t!=="r"&&a&&r.length){const h=l._reversePixels?iE:an;if(n){if(s._sharedOptions){const c=r[0],d=typeof c.getRange=="function"&&c.getRange(t);if(d){const p=h(r,t,e-d),g=h(r,t,e+d);return{lo:p.lo,hi:g.hi}}}}else return h(r,t,e)}return{lo:0,hi:r.length-1}}function po(i,t,e,n,s){const r=i.getSortedVisibleDatasetMetas(),a=e[t];for(let l=0,h=r.length;l{h[a]&&h[a](t[e],s)&&(r.push({element:h,datasetIndex:c,index:d}),l=l||h.inRange(t.x,t.y,s))}),n&&!l?[]:r}var BC={evaluateInteractionItems:po,modes:{index(i,t,e,n){const s=ts(t,i),r=e.axis||"x",a=e.includeInvisible||!1,l=e.intersect?Sc(i,s,r,n,a):kc(i,s,r,!1,n,a),h=[];return l.length?(i.getSortedVisibleDatasetMetas().forEach(c=>{const d=l[0].index,p=c.data[d];p&&!p.skip&&h.push({element:p,datasetIndex:c.index,index:d})}),h):[]},dataset(i,t,e,n){const s=ts(t,i),r=e.axis||"xy",a=e.includeInvisible||!1;let l=e.intersect?Sc(i,s,r,n,a):kc(i,s,r,!1,n,a);if(l.length>0){const h=l[0].datasetIndex,c=i.getDatasetMeta(h).data;l=[];for(let d=0;de.pos===t)}function jf(i,t){return i.filter(e=>Jg.indexOf(e.pos)===-1&&e.box.axis===t)}function Sr(i,t){return i.sort((e,n)=>{const s=t?n:e,r=t?e:n;return s.weight===r.weight?s.index-r.index:s.weight-r.weight})}function VC(i){const t=[];let e,n,s,r,a,l;for(e=0,n=(i||[]).length;ec.box.fullSize),!0),n=Sr(xr(t,"left"),!0),s=Sr(xr(t,"right")),r=Sr(xr(t,"top"),!0),a=Sr(xr(t,"bottom")),l=jf(t,"x"),h=jf(t,"y");return{fullSize:e,leftAndTop:n.concat(r),rightAndBottom:s.concat(h).concat(a).concat(l),chartArea:xr(t,"chartArea"),vertical:n.concat(s).concat(h),horizontal:r.concat(a).concat(l)}}function Uf(i,t,e,n){return Math.max(i[e],t[e])+Math.max(i[n],t[n])}function Qg(i,t){i.top=Math.max(i.top,t.top),i.left=Math.max(i.left,t.left),i.bottom=Math.max(i.bottom,t.bottom),i.right=Math.max(i.right,t.right)}function HC(i,t,e,n){const{pos:s,box:r}=e,a=i.maxPadding;if(!jt(s)){e.size&&(i[s]-=e.size);const p=n[e.stack]||{size:0,count:1};p.size=Math.max(p.size,e.horizontal?r.height:r.width),e.size=p.size/p.count,i[s]+=e.size}r.getPadding&&Qg(a,r.getPadding());const l=Math.max(0,t.outerWidth-Uf(a,i,"left","right")),h=Math.max(0,t.outerHeight-Uf(a,i,"top","bottom")),c=l!==i.w,d=h!==i.h;return i.w=l,i.h=h,e.horizontal?{same:c,other:d}:{same:d,other:c}}function jC(i){const t=i.maxPadding;function e(n){const s=Math.max(t[n]-i[n],0);return i[n]+=s,s}i.y+=e("top"),i.x+=e("left"),e("right"),e("bottom")}function UC(i,t){const e=t.maxPadding;function n(s){const r={left:0,top:0,right:0,bottom:0};return s.forEach(a=>{r[a]=Math.max(t[a],e[a])}),r}return n(i?["left","right"]:["top","bottom"])}function Ar(i,t,e,n){const s=[];let r,a,l,h,c,d;for(r=0,a=i.length,c=0;r{typeof _.beforeLayout=="function"&&_.beforeLayout()});const d=h.reduce((_,w)=>w.box.options&&w.box.options.display===!1?_:_+1,0)||1,p=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:r,availableHeight:a,vBoxMaxWidth:r/2/d,hBoxMaxHeight:a/2}),g=Object.assign({},s);Qg(g,$e(n));const v=Object.assign({maxPadding:g,w:r,h:a,x:s.left,y:s.top},s),b=zC(h.concat(c),p);Ar(l.fullSize,v,p,b),Ar(h,v,p,b),Ar(c,v,p,b)&&Ar(h,v,p,b),jC(v),Wf(l.leftAndTop,v,p,b),v.x+=v.w,v.y+=v.h,Wf(l.rightAndBottom,v,p,b),i.chartArea={left:v.left,top:v.top,right:v.left+v.w,bottom:v.top+v.h,height:v.h,width:v.w},te(l.chartArea,_=>{const w=_.box;Object.assign(w,i.chartArea),w.update(v.w,v.h,{left:0,top:0,right:0,bottom:0})})}};class tv{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,n){}removeEventListener(t,e,n){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,n,s){return e=Math.max(0,e||t.width),n=n||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):n)}}isAttached(t){return!0}updateConfig(t){}}class WC extends tv{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Ea="$chartjs",qC={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},qf=i=>i===null||i==="";function GC(i,t){const e=i.style,n=i.getAttribute("height"),s=i.getAttribute("width");if(i[Ea]={initial:{height:n,width:s,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",qf(s)){const r=Lf(i,"width");r!==void 0&&(i.width=r)}if(qf(n))if(i.style.height==="")i.height=i.width/(t||2);else{const r=Lf(i,"height");r!==void 0&&(i.height=r)}return i}const ev=YE?{passive:!0}:!1;function ZC(i,t,e){i&&i.addEventListener(t,e,ev)}function YC(i,t,e){i&&i.canvas&&i.canvas.removeEventListener(t,e,ev)}function KC(i,t){const e=qC[i.type]||i.type,{x:n,y:s}=ts(i,t);return{type:e,chart:t,native:i,x:n!==void 0?n:null,y:s!==void 0?s:null}}function qa(i,t){for(const e of i)if(e===t||e.contains(t))return!0}function XC(i,t,e){const n=i.canvas,s=new MutationObserver(r=>{let a=!1;for(const l of r)a=a||qa(l.addedNodes,n),a=a&&!qa(l.removedNodes,n);a&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function JC(i,t,e){const n=i.canvas,s=new MutationObserver(r=>{let a=!1;for(const l of r)a=a||qa(l.removedNodes,n),a=a&&!qa(l.addedNodes,n);a&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}const eo=new Map;let Gf=0;function iv(){const i=window.devicePixelRatio;i!==Gf&&(Gf=i,eo.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function QC(i,t){eo.size||window.addEventListener("resize",iv),eo.set(i,t)}function tT(i){eo.delete(i),eo.size||window.removeEventListener("resize",iv)}function eT(i,t,e){const n=i.canvas,s=n&&hh(n);if(!s)return;const r=Pg((l,h)=>{const c=s.clientWidth;e(l,h),c{const h=l[0],c=h.contentRect.width,d=h.contentRect.height;c===0&&d===0||r(c,d)});return a.observe(s),QC(i,r),a}function Ec(i,t,e){e&&e.disconnect(),t==="resize"&&tT(i)}function iT(i,t,e){const n=i.canvas,s=Pg(r=>{i.ctx!==null&&e(KC(r,i))},i);return ZC(n,t,s),s}class nT extends tv{acquireContext(t,e){const n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(GC(t,e),n):null}releaseContext(t){const e=t.canvas;if(!e[Ea])return!1;const n=e[Ea].initial;["height","width"].forEach(r=>{const a=n[r];Gt(a)?e.removeAttribute(r):e.setAttribute(r,a)});const s=n.style||{};return Object.keys(s).forEach(r=>{e.style[r]=s[r]}),e.width=e.width,delete e[Ea],!0}addEventListener(t,e,n){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),a={attach:XC,detach:JC,resize:eT}[e]||iT;s[e]=a(t,e,n)}removeEventListener(t,e){const n=t.$proxies||(t.$proxies={}),s=n[e];if(!s)return;({attach:Ec,detach:Ec,resize:Ec}[e]||YC)(t,e,s),n[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,n,s){return ZE(t,e,n,s)}isAttached(t){const e=t&&hh(t);return!!(e&&e.isConnected)}}function sT(i){return!uh()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?WC:nT}var da;let pn=(da=class{constructor(){pt(this,"x");pt(this,"y");pt(this,"active",!1);pt(this,"options");pt(this,"$animations")}tooltipPosition(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}hasValue(){return $s(this.x)&&$s(this.y)}getProps(t,e){const n=this.$animations;if(!e||!n)return this;const s={};return t.forEach(r=>{s[r]=n[r]&&n[r].active()?n[r]._to:this[r]}),s}},pt(da,"defaults",{}),pt(da,"defaultRoutes"),da);function rT(i,t){const e=i.options.ticks,n=oT(i),s=Math.min(e.maxTicksLimit||n,n),r=e.major.enabled?lT(t):[],a=r.length,l=r[0],h=r[a-1],c=[];if(a>s)return cT(t,c,r,a/s),c;const d=aT(r,t,s);if(a>0){let p,g;const v=a>1?Math.round((h-l)/(a-1)):null;for(Qo(t,c,d,Gt(v)?0:l-v,l),p=0,g=a-1;ps)return h}return Math.max(s,1)}function lT(i){const t=[];let e,n;for(e=0,n=i.length;ei==="left"?"right":i==="right"?"left":i,Zf=(i,t,e)=>t==="top"||t==="left"?i[t]+e:i[t]-e,Yf=(i,t)=>Math.min(t||i,i);function Kf(i,t){const e=[],n=i.length/t,s=i.length;let r=0;for(;ra+l)))return h}function fT(i,t){te(i,e=>{const n=e.gc,s=n.length/2;let r;if(s>t){for(r=0;rn?n:e,n=s&&e>n?e:n,{min:ni(e,ni(n,e)),max:ni(n,ni(e,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){re(this.options.beforeUpdate,[this])}update(t,e,n){const{beginAtZero:s,grace:r,ticks:a}=this.options,l=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=CE(this,r,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const h=l=r||n<=1||!this.isHorizontal()){this.labelRotation=s;return}const d=this._getLabelSizes(),p=d.widest.width,g=d.highest.height,v=Me(this.chart.width-p,0,this.maxWidth);l=t.offset?this.maxWidth/n:v/(n-1),p+6>l&&(l=v/(n-(t.offset?.5:1)),h=this.maxHeight-kr(t.grid)-e.padding-Xf(t.title,this.chart.options.font),c=Math.sqrt(p*p+g*g),a=ih(Math.min(Math.asin(Me((d.highest.height+6)/l,-1,1)),Math.asin(Me(h/c,-1,1))-Math.asin(Me(g/c,-1,1)))),a=Math.max(s,Math.min(r,a))),this.labelRotation=a}afterCalculateLabelRotation(){re(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){re(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:n,title:s,grid:r}}=this,a=this._isVisible(),l=this.isHorizontal();if(a){const h=Xf(s,e.options.font);if(l?(t.width=this.maxWidth,t.height=kr(r)+h):(t.height=this.maxHeight,t.width=kr(r)+h),n.display&&this.ticks.length){const{first:c,last:d,widest:p,highest:g}=this._getLabelSizes(),v=n.padding*2,b=Ei(this.labelRotation),_=Math.cos(b),w=Math.sin(b);if(l){const T=n.mirror?0:w*p.width+_*g.height;t.height=Math.min(this.maxHeight,t.height+T+v)}else{const T=n.mirror?0:_*p.width+w*g.height;t.width=Math.min(this.maxWidth,t.width+T+v)}this._calculatePadding(c,d,w,_)}}this._handleMargins(),l?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,n,s){const{ticks:{align:r,padding:a},position:l}=this.options,h=this.labelRotation!==0,c=l!=="top"&&this.axis==="x";if(this.isHorizontal()){const d=this.getPixelForTick(0)-this.left,p=this.right-this.getPixelForTick(this.ticks.length-1);let g=0,v=0;h?c?(g=s*t.width,v=n*e.height):(g=n*t.height,v=s*e.width):r==="start"?v=e.width:r==="end"?g=t.width:r!=="inner"&&(g=t.width/2,v=e.width/2),this.paddingLeft=Math.max((g-d+a)*this.width/(this.width-d),0),this.paddingRight=Math.max((v-p+a)*this.width/(this.width-p),0)}else{let d=e.height/2,p=t.height/2;r==="start"?(d=0,p=t.height):r==="end"&&(d=e.height,p=0),this.paddingTop=d+a,this.paddingBottom=p+a}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){re(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,n;for(e=0,n=t.length;e({width:a[q]||0,height:l[q]||0});return{first:K(0),last:K(e-1),widest:K(V),highest:K($),widths:a,heights:l}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return eE(this._alignToPixels?Yn(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&tl*s?l/n:h/s:h*s0}_computeGridLineItems(t){const e=this.axis,n=this.chart,s=this.options,{grid:r,position:a,border:l}=s,h=r.offset,c=this.isHorizontal(),p=this.ticks.length+(h?1:0),g=kr(r),v=[],b=l.setContext(this.getContext()),_=b.display?b.width:0,w=_/2,T=function(Z){return Yn(n,Z,_)};let S,C,x,D,V,$,K,q,rt,z,tt,ot;if(a==="top")S=T(this.bottom),$=this.bottom-g,q=S-w,z=T(t.top)+w,ot=t.bottom;else if(a==="bottom")S=T(this.top),z=t.top,ot=T(t.bottom)-w,$=S+w,q=this.top+g;else if(a==="left")S=T(this.right),V=this.right-g,K=S-w,rt=T(t.left)+w,tt=t.right;else if(a==="right")S=T(this.left),rt=t.left,tt=T(t.right)-w,V=S+w,K=this.left+g;else if(e==="x"){if(a==="center")S=T((t.top+t.bottom)/2+.5);else if(jt(a)){const Z=Object.keys(a)[0],st=a[Z];S=T(this.chart.scales[Z].getPixelForValue(st))}z=t.top,ot=t.bottom,$=S+w,q=$+g}else if(e==="y"){if(a==="center")S=T((t.left+t.right)/2);else if(jt(a)){const Z=Object.keys(a)[0],st=a[Z];S=T(this.chart.scales[Z].getPixelForValue(st))}V=S-w,K=V-g,rt=t.left,tt=t.right}const it=Rt(s.ticks.maxTicksLimit,p),G=Math.max(1,Math.ceil(p/it));for(C=0;C0&&(yt-=ct/2);break}vt={left:yt,top:bt,width:ct+kt.width,height:Mt+kt.height,color:G.backdropColor}}w.push({label:x,font:q,textOffset:tt,options:{rotation:_,color:st,strokeColor:W,strokeWidth:dt,textAlign:nt,textBaseline:ot,translation:[D,V],backdrop:vt}})}return w}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Ei(this.labelRotation))return t==="top"?"left":"right";let s="center";return e.align==="start"?s="left":e.align==="end"?s="right":e.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:n,mirror:s,padding:r}}=this.options,a=this._getLabelSizes(),l=t+r,h=a.widest.width;let c,d;return e==="left"?s?(d=this.right+r,n==="near"?c="left":n==="center"?(c="center",d+=h/2):(c="right",d+=h)):(d=this.right-l,n==="near"?c="right":n==="center"?(c="center",d-=h/2):(c="left",d=this.left)):e==="right"?s?(d=this.left+r,n==="near"?c="right":n==="center"?(c="center",d-=h/2):(c="left",d-=h)):(d=this.left+l,n==="near"?c="left":n==="center"?(c="center",d+=h/2):(c="right",d=this.right)):c="right",{textAlign:c,x:d}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:n,top:s,width:r,height:a}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(n,s,r,a),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const s=this.ticks.findIndex(r=>r.value===t);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const e=this.options.grid,n=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let r,a;const l=(h,c,d)=>{!d.width||!d.color||(n.save(),n.lineWidth=d.width,n.strokeStyle=d.color,n.setLineDash(d.borderDash||[]),n.lineDashOffset=d.borderDashOffset,n.beginPath(),n.moveTo(h.x,h.y),n.lineTo(c.x,c.y),n.stroke(),n.restore())};if(e.display)for(r=0,a=s.length;r{this.draw(r)}}]:[{z:n,draw:r=>{this.drawBackground(),this.drawGrid(r),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:r=>{this.drawLabels(r)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",s=[];let r,a;for(r=0,a=e.length;r{const n=e.split("."),s=n.pop(),r=[i].concat(n).join("."),a=t[e].split("."),l=a.pop(),h=a.join(".");ue.route(r,s,h,l)})}function bT(i){return"id"in i&&"defaults"in i}class wT{constructor(){this.controllers=new ta(Mi,"datasets",!0),this.elements=new ta(pn,"elements"),this.plugins=new ta(Object,"plugins"),this.scales=new ta(vs,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,n){[...e].forEach(s=>{const r=n||this._getRegistryForType(s);n||r.isForType(s)||r===this.plugins&&s.id?this._exec(t,r,s):te(s,a=>{const l=n||this._getRegistryForType(a);this._exec(t,l,a)})})}_exec(t,e,n){const s=eh(t);re(n["before"+s],[],n),e[t](n),re(n["after"+s],[],n)}_getRegistryForType(t){for(let e=0;er.filter(l=>!a.some(h=>l.plugin.id===h.plugin.id));this._notify(s(e,n),t,"stop"),this._notify(s(n,e),t,"start")}}function ST(i){const t={},e=[],n=Object.keys(Bi.plugins.items);for(let r=0;r1&&Jf(i[0].toLowerCase());if(n)return n}throw new Error(`Cannot determine type of '${i}' axis. Please provide 'axis' or 'position' option.`)}function Qf(i,t,e){if(e[t+"AxisID"]===i)return{axis:t}}function AT(i,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(n=>n.xAxisID===i||n.yAxisID===i);if(e.length)return Qf(i,"x",e[0])||Qf(i,"y",e[0])}return{}}function DT(i,t){const e=ds[i.type]||{scales:{}},n=t.scales||{},s=pu(i.type,t),r=Object.create(null);return Object.keys(n).forEach(a=>{const l=n[a];if(!jt(l))return console.error(`Invalid scale configuration for scale: ${a}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const h=mu(a,l,AT(a,i),ue.scales[l.type]),c=MT(h,s),d=e.scales||{};r[a]=Rr(Object.create(null),[{axis:h},l,d[h],d[c]])}),i.data.datasets.forEach(a=>{const l=a.type||i.type,h=a.indexAxis||pu(l,t),d=(ds[l]||{}).scales||{};Object.keys(d).forEach(p=>{const g=TT(p,h),v=a[g+"AxisID"]||g;r[v]=r[v]||Object.create(null),Rr(r[v],[{axis:g},n[v],d[p]])})}),Object.keys(r).forEach(a=>{const l=r[a];Rr(l,[ue.scales[l.type],ue.scale])}),r}function nv(i){const t=i.options||(i.options={});t.plugins=Rt(t.plugins,{}),t.scales=DT(i,t)}function sv(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function PT(i){return i=i||{},i.data=sv(i.data),nv(i),i}const tp=new Map,rv=new Set;function ea(i,t){let e=tp.get(i);return e||(e=t(),tp.set(i,e),rv.add(e)),e}const Er=(i,t,e)=>{const n=On(t,e);n!==void 0&&i.add(n)};class OT{constructor(t){this._config=PT(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=sv(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),nv(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return ea(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return ea(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return ea(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,n=this.type;return ea(`${n}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const n=this._scopeCache;let s=n.get(t);return(!s||e)&&(s=new Map,n.set(t,s)),s}getOptionScopes(t,e,n){const{options:s,type:r}=this,a=this._cachedScopes(t,n),l=a.get(e);if(l)return l;const h=new Set;e.forEach(d=>{t&&(h.add(t),d.forEach(p=>Er(h,t,p))),d.forEach(p=>Er(h,s,p)),d.forEach(p=>Er(h,ds[r]||{},p)),d.forEach(p=>Er(h,ue,p)),d.forEach(p=>Er(h,hu,p))});const c=Array.from(h);return c.length===0&&c.push(Object.create(null)),rv.has(e)&&a.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,ds[e]||{},ue.datasets[e]||{},{type:e},ue,hu]}resolveNamedOptions(t,e,n,s=[""]){const r={$shared:!0},{resolver:a,subPrefixes:l}=ep(this._resolverCache,t,s);let h=a;if(FT(a,e)){r.$shared=!1,n=In(n)?n():n;const c=this.createResolver(t,n,l);h=Hs(a,n,c)}for(const c of e)r[c]=h[c];return r}createResolver(t,e,n=[""],s){const{resolver:r}=ep(this._resolverCache,t,n);return jt(e)?Hs(r,e,void 0,s):r}}function ep(i,t,e){let n=i.get(t);n||(n=new Map,i.set(t,n));const s=e.join();let r=n.get(s);return r||(r={resolver:ah(t,e),subPrefixes:e.filter(l=>!l.toLowerCase().includes("hover"))},n.set(s,r)),r}const IT=i=>jt(i)&&Object.getOwnPropertyNames(i).some(t=>In(i[t]));function FT(i,t){const{isScriptable:e,isIndexable:n}=Vg(i);for(const s of t){const r=e(s),a=n(s),l=(a||r)&&i[s];if(r&&(In(l)||IT(l))||a&&ce(l))return!0}return!1}var RT="4.4.6";const BT=["top","bottom","left","right","chartArea"];function ip(i,t){return i==="top"||i==="bottom"||BT.indexOf(i)===-1&&t==="x"}function np(i,t){return function(e,n){return e[i]===n[i]?e[t]-n[t]:e[i]-n[i]}}function sp(i){const t=i.chart,e=t.options.animation;t.notifyPlugins("afterRender"),re(e&&e.onComplete,[i],t)}function VT(i){const t=i.chart,e=t.options.animation;re(e&&e.onProgress,[i],t)}function ov(i){return uh()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}const Ca={},rp=i=>{const t=ov(i);return Object.values(Ca).filter(e=>e.canvas===t).pop()};function NT(i,t,e){const n=Object.keys(i);for(const s of n){const r=+s;if(r>=t){const a=i[s];delete i[s],(e>0||r>t)&&(i[r+e]=a)}}}function zT(i,t,e,n){return!e||i.type==="mouseout"?null:n?t:i}function ia(i,t,e){return i.options.clip?i[e]:t[e]}function $T(i,t){const{xScale:e,yScale:n}=i;return e&&n?{left:ia(e,t,"left"),right:ia(e,t,"right"),top:ia(n,t,"top"),bottom:ia(n,t,"bottom")}:t}class nn{static register(...t){Bi.add(...t),op()}static unregister(...t){Bi.remove(...t),op()}constructor(t,e){const n=this.config=new OT(e),s=ov(t),r=rp(s);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const a=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||sT(s)),this.platform.updateConfig(n);const l=this.platform.acquireContext(s,a.aspectRatio),h=l&&l.canvas,c=h&&h.height,d=h&&h.width;if(this.id=jk(),this.ctx=l,this.canvas=h,this.width=d,this.height=c,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new xT,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=rE(p=>this.update(p),a.resizeDelay||0),this._dataChanges=[],Ca[this.id]=this,!l||!h){console.error("Failed to create chart: can't acquire context from the given item");return}Qi.listen(this,"complete",sp),Qi.listen(this,"progress",VT),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:n,height:s,_aspectRatio:r}=this;return Gt(t)?e&&r?r:s?n/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Bi}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Mf(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Ef(this.canvas,this.ctx),this}stop(){return Qi.stop(this),this}resize(t,e){Qi.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const n=this.options,s=this.canvas,r=n.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(s,t,e,r),l=n.devicePixelRatio||this.platform.getDevicePixelRatio(),h=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,Mf(this,l,!0)&&(this.notifyPlugins("resize",{size:a}),re(n.onResize,[this,a],this),this.attached&&this._doResize(h)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};te(e,(n,s)=>{n.id=s})}buildOrUpdateScales(){const t=this.options,e=t.scales,n=this.scales,s=Object.keys(n).reduce((a,l)=>(a[l]=!1,a),{});let r=[];e&&(r=r.concat(Object.keys(e).map(a=>{const l=e[a],h=mu(a,l),c=h==="r",d=h==="x";return{options:l,dposition:c?"chartArea":d?"bottom":"left",dtype:c?"radialLinear":d?"category":"linear"}}))),te(r,a=>{const l=a.options,h=l.id,c=mu(h,l),d=Rt(l.type,a.dtype);(l.position===void 0||ip(l.position,c)!==ip(a.dposition))&&(l.position=a.dposition),s[h]=!0;let p=null;if(h in n&&n[h].type===d)p=n[h];else{const g=Bi.getScale(d);p=new g({id:h,type:d,ctx:this.ctx,chart:this}),n[p.id]=p}p.init(l,t)}),te(s,(a,l)=>{a||delete n[l]}),te(n,a=>{Ve.configure(this,a,a.options),Ve.addBox(this,a)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,n=t.length;if(t.sort((s,r)=>s.index-r.index),n>e){for(let s=e;se.length&&delete this._stacks,t.forEach((n,s)=>{e.filter(r=>r===n._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let n,s;for(this._removeUnreferencedMetasets(),n=0,s=e.length;n{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const n=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let c=0,d=this.data.datasets.length;c{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(np("z","_idx"));const{_active:l,_lastEvent:h}=this;h?this._eventHandler(h,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){te(this.scales,t=>{Ve.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),n=new Set(t.events);(!gf(e,n)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:n,start:s,count:r}of e){const a=n==="_removeElements"?-r:r;NT(t,s,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,n=r=>new Set(t.filter(a=>a[0]===r).map((a,l)=>l+","+a.splice(1).join(","))),s=n(0);for(let r=1;rr.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Ve.update(this,this.width,this.height,t);const e=this.chartArea,n=e.width<=0||e.height<=0;this._layers=[],te(this.boxes,s=>{n&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,r)=>{s._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,n=this.data.datasets.length;e=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,n=t._clip,s=!n.disabled,r=$T(t,this.chartArea),a={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",a)!==!1&&(s&&dl(e,{left:n.left===!1?0:r.left-n.left,right:n.right===!1?this.width:r.right+n.right,top:n.top===!1?0:r.top-n.top,bottom:n.bottom===!1?this.height:r.bottom+n.bottom}),t.controller.draw(),s&&fl(e),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}isPointInArea(t){return ln(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,n,s){const r=BC.modes[e];return typeof r=="function"?r(this,t,n,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],n=this._metasets;let s=n.filter(r=>r&&r._dataset===e).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},n.push(s)),s}getContext(){return this.$context||(this.$context=Rn(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const n=this.getDatasetMeta(t);return typeof n.hidden=="boolean"?!n.hidden:!e.hidden}setDatasetVisibility(t,e){const n=this.getDatasetMeta(t);n.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,n){const s=n?"show":"hide",r=this.getDatasetMeta(t),a=r.controller._resolveAnimations(void 0,s);Jr(e)?(r.data[e].hidden=!n,this.update()):(this.setDatasetVisibility(t,n),a.update(r,{visible:n}),this.update(l=>l.datasetIndex===t?s:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),Qi.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,r,a),t[r]=a},s=(r,a,l)=>{r.offsetX=a,r.offsetY=l,this._eventHandler(r)};te(this.options.events,r=>n(r,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,n=(h,c)=>{e.addEventListener(this,h,c),t[h]=c},s=(h,c)=>{t[h]&&(e.removeEventListener(this,h,c),delete t[h])},r=(h,c)=>{this.canvas&&this.resize(h,c)};let a;const l=()=>{s("attach",l),this.attached=!0,this.resize(),n("resize",r),n("detach",a)};a=()=>{this.attached=!1,s("resize",r),this._stop(),this._resize(0,0),n("attach",l)},e.isAttached(this.canvas)?l():a()}unbindEvents(){te(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},te(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,n){const s=n?"set":"remove";let r,a,l,h;for(e==="dataset"&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+s+"DatasetHoverStyle"]()),l=0,h=t.length;l{const l=this.getDatasetMeta(r);if(!l)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:l.data[a],index:a}});!$a(n,e)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,e))}notifyPlugins(t,e,n){return this._plugins.notify(this,t,e,n)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,n){const s=this.options.hover,r=(h,c)=>h.filter(d=>!c.some(p=>d.datasetIndex===p.datasetIndex&&d.index===p.index)),a=r(e,t),l=n?t:r(t,e);a.length&&this.updateHoverStyle(a,s.mode,!1),l.length&&s.mode&&this.updateHoverStyle(l,s.mode,!0)}_eventHandler(t,e){const n={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",n,s)===!1)return;const r=this._handleEvent(t,e,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,s),(r||n.changed)&&this.render(),this}_handleEvent(t,e,n){const{_active:s=[],options:r}=this,a=e,l=this._getActiveElements(t,s,n,a),h=Yk(t),c=zT(t,this._lastEvent,n,h);n&&(this._lastEvent=null,re(r.onHover,[t,l,this],this),h&&re(r.onClick,[t,l,this],this));const d=!$a(l,s);return(d||e)&&(this._active=l,this._updateHoverStyles(l,s,e)),this._lastEvent=c,d}_getActiveElements(t,e,n,s){if(t.type==="mouseout")return[];if(!n)return e;const r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,s)}}pt(nn,"defaults",ue),pt(nn,"instances",Ca),pt(nn,"overrides",ds),pt(nn,"registry",Bi),pt(nn,"version",RT),pt(nn,"getChart",rp);function op(){return te(nn.instances,i=>i._plugins.invalidate())}function HT(i,t,e){const{startAngle:n,pixelMargin:s,x:r,y:a,outerRadius:l,innerRadius:h}=t;let c=s/l;i.beginPath(),i.arc(r,a,l,n-c,e+c),h>s?(c=s/h,i.arc(r,a,h,e+c,n-c,!0)):i.arc(r,a,s,e+_e,n-_e),i.closePath(),i.clip()}function jT(i){return oh(i,["outerStart","outerEnd","innerStart","innerEnd"])}function UT(i,t,e,n){const s=jT(i.options.borderRadius),r=(e-t)/2,a=Math.min(r,n*t/2),l=h=>{const c=(e-Math.min(r,h))*n/2;return Me(h,0,Math.min(r,c))};return{outerStart:l(s.outerStart),outerEnd:l(s.outerEnd),innerStart:Me(s.innerStart,0,a),innerEnd:Me(s.innerEnd,0,a)}}function Ds(i,t,e,n){return{x:e+i*Math.cos(t),y:n+i*Math.sin(t)}}function Ga(i,t,e,n,s,r){const{x:a,y:l,startAngle:h,pixelMargin:c,innerRadius:d}=t,p=Math.max(t.outerRadius+n+e-c,0),g=d>0?d+n+e+c:0;let v=0;const b=s-h;if(n){const G=d>0?d-n:0,Z=p>0?p-n:0,st=(G+Z)/2,W=st!==0?b*st/(st+n):b;v=(b-W)/2}const _=Math.max(.001,b*p-e/ae)/p,w=(b-_)/2,T=h+w+v,S=s-w-v,{outerStart:C,outerEnd:x,innerStart:D,innerEnd:V}=UT(t,g,p,S-T),$=p-C,K=p-x,q=T+C/$,rt=S-x/K,z=g+D,tt=g+V,ot=T+D/z,it=S-V/tt;if(i.beginPath(),r){const G=(q+rt)/2;if(i.arc(a,l,p,q,G),i.arc(a,l,p,G,rt),x>0){const dt=Ds(K,rt,a,l);i.arc(dt.x,dt.y,x,rt,S+_e)}const Z=Ds(tt,S,a,l);if(i.lineTo(Z.x,Z.y),V>0){const dt=Ds(tt,it,a,l);i.arc(dt.x,dt.y,V,S+_e,it+Math.PI)}const st=(S-V/g+(T+D/g))/2;if(i.arc(a,l,g,S-V/g,st,!0),i.arc(a,l,g,st,T+D/g,!0),D>0){const dt=Ds(z,ot,a,l);i.arc(dt.x,dt.y,D,ot+Math.PI,T-_e)}const W=Ds($,T,a,l);if(i.lineTo(W.x,W.y),C>0){const dt=Ds($,q,a,l);i.arc(dt.x,dt.y,C,T-_e,q)}}else{i.moveTo(a,l);const G=Math.cos(q)*p+a,Z=Math.sin(q)*p+l;i.lineTo(G,Z);const st=Math.cos(rt)*p+a,W=Math.sin(rt)*p+l;i.lineTo(st,W)}i.closePath()}function WT(i,t,e,n,s){const{fullCircles:r,startAngle:a,circumference:l}=t;let h=t.endAngle;if(r){Ga(i,t,e,n,h,s);for(let c=0;c=oe||_,T=on(l,d+v,p+v);return w&&T}getCenterPoint(e){const{x:n,y:s,startAngle:r,endAngle:a,innerRadius:l,outerRadius:h}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:c,spacing:d}=this.options,p=(r+a)/2,g=(l+h+d+c)/2;return{x:n+Math.cos(p)*g,y:s+Math.sin(p)*g}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:n,circumference:s}=this,r=(n.offset||0)/4,a=(n.spacing||0)/2,l=n.circular;if(this.pixelMargin=n.borderAlign==="inner"?.33:0,this.fullCircles=s>oe?Math.floor(s/oe):0,s===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const h=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(h)*r,Math.sin(h)*r);const c=1-Math.sin(Math.min(ae,s||0)),d=r*c;e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,WT(e,this,d,a,l),qT(e,this,d,a,l),e.restore()}}pt(Dr,"id","arc"),pt(Dr,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),pt(Dr,"defaultRoutes",{backgroundColor:"backgroundColor"}),pt(Dr,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function av(i,t,e=t){i.lineCap=Rt(e.borderCapStyle,t.borderCapStyle),i.setLineDash(Rt(e.borderDash,t.borderDash)),i.lineDashOffset=Rt(e.borderDashOffset,t.borderDashOffset),i.lineJoin=Rt(e.borderJoinStyle,t.borderJoinStyle),i.lineWidth=Rt(e.borderWidth,t.borderWidth),i.strokeStyle=Rt(e.borderColor,t.borderColor)}function GT(i,t,e){i.lineTo(e.x,e.y)}function ZT(i){return i.stepped?vE:i.tension||i.cubicInterpolationMode==="monotone"?_E:GT}function lv(i,t,e={}){const n=i.length,{start:s=0,end:r=n-1}=e,{start:a,end:l}=t,h=Math.max(s,a),c=Math.min(r,l),d=sl&&r>l;return{count:n,start:h,loop:t.loop,ilen:c(a+(c?l-x:x))%r,C=()=>{_!==w&&(i.lineTo(d,w),i.lineTo(d,_),i.lineTo(d,T))};for(h&&(v=s[S(0)],i.moveTo(v.x,v.y)),g=0;g<=l;++g){if(v=s[S(g)],v.skip)continue;const x=v.x,D=v.y,V=x|0;V===b?(D<_?_=D:D>w&&(w=D),d=(p*d+x)/++p):(C(),i.lineTo(x,D),b=V,p=0,_=w=D),T=D}C()}function gu(i){const t=i.options,e=t.borderDash&&t.borderDash.length;return!i._decimated&&!i._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?KT:YT}function XT(i){return i.stepped?KE:i.tension||i.cubicInterpolationMode==="monotone"?XE:es}function JT(i,t,e,n){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,n)&&s.closePath()),av(i,t.options),i.stroke(s)}function QT(i,t,e,n){const{segments:s,options:r}=t,a=gu(t);for(const l of s)av(i,r,l.style),i.beginPath(),a(i,t,l,{start:e,end:e+n-1})&&i.closePath(),i.stroke()}const tM=typeof Path2D=="function";function eM(i,t,e,n){tM&&!t.options.segment?JT(i,t,e,n):QT(i,t,e,n)}class Tn extends pn{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const n=this.options;if((n.tension||n.cubicInterpolationMode==="monotone")&&!n.stepped&&!this._pointsUpdated){const s=n.spanGaps?this._loop:this._fullLoop;HE(this._points,n,t,s,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=nC(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,n=t.length;return n&&e[t[n-1].end]}interpolate(t,e){const n=this.options,s=t[e],r=this.points,a=Zg(this,{property:e,start:s,end:s});if(!a.length)return;const l=[],h=XT(n);let c,d;for(c=0,d=a.length;ct!=="borderDash"&&t!=="fill"});function ap(i,t,e,n){const s=i.options,{[e]:r}=i.getProps([e],n);return Math.abs(t-r)i.replace("rgb(","rgba(").replace(")",", 0.5)"));function uv(i){return vu[i%vu.length]}function hv(i){return lp[i%lp.length]}function lM(i,t){return i.borderColor=uv(t),i.backgroundColor=hv(t),++t}function cM(i,t){return i.backgroundColor=i.data.map(()=>uv(t++)),t}function uM(i,t){return i.backgroundColor=i.data.map(()=>hv(t++)),t}function hM(i){let t=0;return(e,n)=>{const s=i.getDatasetMeta(n).controller;s instanceof rs?t=cM(e,t):s instanceof zr?t=uM(e,t):s&&(t=lM(e,t))}}function cp(i){let t;for(t in i)if(i[t].borderColor||i[t].backgroundColor)return!0;return!1}function dM(i){return i&&(i.borderColor||i.backgroundColor)}function fM(){return ue.borderColor!=="rgba(0,0,0,0.1)"||ue.backgroundColor!=="rgba(0,0,0,0.1)"}var pM={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(i,t,e){if(!e.enabled)return;const{data:{datasets:n},options:s}=i.config,{elements:r}=s,a=cp(n)||dM(s)||r&&cp(r)||fM();if(!e.forceOverride&&a)return;const l=hM(i);n.forEach(l)}};function mM(i,t,e,n,s){const r=s.samples||n;if(r>=e)return i.slice(t,t+e);const a=[],l=(e-2)/(r-2);let h=0;const c=t+e-1;let d=t,p,g,v,b,_;for(a[h++]=i[d],p=0;pv&&(v=b,g=i[S],_=S);a[h++]=g,d=_}return a[h++]=i[c],a}function gM(i,t,e,n){let s=0,r=0,a,l,h,c,d,p,g,v,b,_;const w=[],T=t+e-1,S=i[t].x,x=i[T].x-S;for(a=t;a_&&(_=c,g=a),s=(r*s+l.x)/++r;else{const V=a-1;if(!Gt(p)&&!Gt(g)){const $=Math.min(p,g),K=Math.max(p,g);$!==v&&$!==V&&w.push({...i[$],x:s}),K!==v&&K!==V&&w.push({...i[K],x:s})}a>0&&V!==v&&w.push(i[V]),w.push(l),d=D,r=0,b=_=c,p=g=v=a}}return w}function dv(i){if(i._decimated){const t=i._data;delete i._decimated,delete i._data,Object.defineProperty(i,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function up(i){i.data.datasets.forEach(t=>{dv(t)})}function vM(i,t){const e=t.length;let n=0,s;const{iScale:r}=i,{min:a,max:l,minDefined:h,maxDefined:c}=r.getUserBounds();return h&&(n=Me(an(t,r.axis,a).lo,0,e-1)),c?s=Me(an(t,r.axis,l).hi+1,n,e)-n:s=e-n,{start:n,count:s}}var _M={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(i,t,e)=>{if(!e.enabled){up(i);return}const n=i.width;i.data.datasets.forEach((s,r)=>{const{_data:a,indexAxis:l}=s,h=i.getDatasetMeta(r),c=a||s.data;if(Lr([l,i.options.indexAxis])==="y"||!h.controller.supportsDecimation)return;const d=i.scales[h.xAxisID];if(d.type!=="linear"&&d.type!=="time"||i.options.parsing)return;let{start:p,count:g}=vM(h,c);const v=e.threshold||4*n;if(g<=v){dv(s);return}Gt(a)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(_){this._data=_}}));let b;switch(e.algorithm){case"lttb":b=mM(c,p,g,n,e);break;case"min-max":b=gM(c,p,g,n);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}s._decimated=b})},destroy(i){up(i)}};function yM(i,t,e){const n=i.segments,s=i.points,r=t.points,a=[];for(const l of n){let{start:h,end:c}=l;c=fh(h,c,s);const d=_u(e,s[h],s[c],l.loop);if(!t.segments){a.push({source:l,target:d,start:s[h],end:s[c]});continue}const p=Zg(t,d);for(const g of p){const v=_u(e,r[g.start],r[g.end],g.loop),b=Gg(l,s,v);for(const _ of b)a.push({source:_,target:g,start:{[e]:hp(d,v,"start",Math.max)},end:{[e]:hp(d,v,"end",Math.min)}})}}return a}function _u(i,t,e,n){if(n)return;let s=t[i],r=e[i];return i==="angle"&&(s=oi(s),r=oi(r)),{property:i,start:s,end:r}}function bM(i,t){const{x:e=null,y:n=null}=i||{},s=t.points,r=[];return t.segments.forEach(({start:a,end:l})=>{l=fh(a,l,s);const h=s[a],c=s[l];n!==null?(r.push({x:h.x,y:n}),r.push({x:c.x,y:n})):e!==null&&(r.push({x:e,y:h.y}),r.push({x:e,y:c.y}))}),r}function fh(i,t,e){for(;t>i;t--){const n=e[t];if(!isNaN(n.x)&&!isNaN(n.y))break}return t}function hp(i,t,e,n){return i&&t?n(i[e],t[e]):i?i[e]:t?t[e]:0}function fv(i,t){let e=[],n=!1;return ce(i)?(n=!0,e=i):e=bM(i,t),e.length?new Tn({points:e,options:{tension:0},_loop:n,_fullLoop:n}):null}function dp(i){return i&&i.fill!==!1}function wM(i,t,e){let s=i[t].fill;const r=[t];let a;if(!e)return s;for(;s!==!1&&r.indexOf(s)===-1;){if(!me(s))return s;if(a=i[s],!a)return!1;if(a.visible)return s;r.push(s),s=a.fill}return!1}function xM(i,t,e){const n=CM(i);if(jt(n))return isNaN(n.value)?!1:n;let s=parseFloat(n);return me(s)&&Math.floor(s)===s?SM(n[0],t,s,e):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function SM(i,t,e,n){return(i==="-"||i==="+")&&(e=t+e),e===t||e<0||e>=n?!1:e}function kM(i,t){let e=null;return i==="start"?e=t.bottom:i==="end"?e=t.top:jt(i)?e=t.getPixelForValue(i.value):t.getBasePixel&&(e=t.getBasePixel()),e}function EM(i,t,e){let n;return i==="start"?n=e:i==="end"?n=t.options.reverse?t.min:t.max:jt(i)?n=i.value:n=t.getBaseValue(),n}function CM(i){const t=i.options,e=t.fill;let n=Rt(e&&e.target,e);return n===void 0&&(n=!!t.backgroundColor),n===!1||n===null?!1:n===!0?"origin":n}function TM(i){const{scale:t,index:e,line:n}=i,s=[],r=n.segments,a=n.points,l=MM(t,e);l.push(fv({x:null,y:t.bottom},n));for(let h=0;h=0;--a){const l=s[a].$filler;l&&(l.line.updateControlPoints(r,l.axis),n&&l.fill&&Mc(i.ctx,l,r))}},beforeDatasetsDraw(i,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const n=i.getSortedVisibleDatasetMetas();for(let s=n.length-1;s>=0;--s){const r=n[s].$filler;dp(r)&&Mc(i.ctx,r,i.chartArea)}},beforeDatasetDraw(i,t,e){const n=t.meta.$filler;!dp(n)||e.drawTime!=="beforeDatasetDraw"||Mc(i.ctx,n,i.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const gp=(i,t)=>{let{boxHeight:e=t,boxWidth:n=t}=i;return i.usePointStyle&&(e=Math.min(e,t),n=i.pointStyleWidth||Math.min(n,t)),{boxWidth:n,boxHeight:e,itemHeight:Math.max(t,e)}},NM=(i,t)=>i!==null&&t!==null&&i.datasetIndex===t.datasetIndex&&i.index===t.index;class vp extends pn{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,n){this.maxWidth=t,this.maxHeight=e,this._margins=n,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=re(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(n=>t.filter(n,this.chart.data))),t.sort&&(e=e.sort((n,s)=>t.sort(n,s,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const n=t.labels,s=Ce(n.font),r=s.size,a=this._computeTitleHeight(),{boxWidth:l,itemHeight:h}=gp(n,r);let c,d;e.font=s.string,this.isHorizontal()?(c=this.maxWidth,d=this._fitRows(a,r,l,h)+10):(d=this.maxHeight,c=this._fitCols(a,s,l,h)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(d,t.maxHeight||this.maxHeight)}_fitRows(t,e,n,s){const{ctx:r,maxWidth:a,options:{labels:{padding:l}}}=this,h=this.legendHitBoxes=[],c=this.lineWidths=[0],d=s+l;let p=t;r.textAlign="left",r.textBaseline="middle";let g=-1,v=-d;return this.legendItems.forEach((b,_)=>{const w=n+e/2+r.measureText(b.text).width;(_===0||c[c.length-1]+w+2*l>a)&&(p+=d,c[c.length-(_>0?0:1)]=0,v+=d,g++),h[_]={left:0,top:v,row:g,width:w,height:s},c[c.length-1]+=w+l}),p}_fitCols(t,e,n,s){const{ctx:r,maxHeight:a,options:{labels:{padding:l}}}=this,h=this.legendHitBoxes=[],c=this.columnSizes=[],d=a-t;let p=l,g=0,v=0,b=0,_=0;return this.legendItems.forEach((w,T)=>{const{itemWidth:S,itemHeight:C}=zM(n,e,r,w,s);T>0&&v+C+2*l>d&&(p+=g+l,c.push({width:g,height:v}),b+=g+l,_++,g=v=0),h[T]={left:b,top:v,col:_,width:S,height:C},g=Math.max(g,S),v+=C+l}),p+=g,c.push({width:g,height:v}),p}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:n,labels:{padding:s},rtl:r}}=this,a=Ns(r,this.left,this.width);if(this.isHorizontal()){let l=0,h=Be(n,this.left+s,this.right-this.lineWidths[l]);for(const c of e)l!==c.row&&(l=c.row,h=Be(n,this.left+s,this.right-this.lineWidths[l])),c.top+=this.top+t+s,c.left=a.leftForLtr(a.x(h),c.width),h+=c.width+s}else{let l=0,h=Be(n,this.top+t+s,this.bottom-this.columnSizes[l].height);for(const c of e)c.col!==l&&(l=c.col,h=Be(n,this.top+t+s,this.bottom-this.columnSizes[l].height)),c.top=h,c.left+=this.left+s,c.left=a.leftForLtr(a.x(c.left),c.width),h+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;dl(t,this),this._draw(),fl(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:n,ctx:s}=this,{align:r,labels:a}=t,l=ue.color,h=Ns(t.rtl,this.left,this.width),c=Ce(a.font),{padding:d}=a,p=c.size,g=p/2;let v;this.drawTitle(),s.textAlign=h.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:b,boxHeight:_,itemHeight:w}=gp(a,p),T=function(V,$,K){if(isNaN(b)||b<=0||isNaN(_)||_<0)return;s.save();const q=Rt(K.lineWidth,1);if(s.fillStyle=Rt(K.fillStyle,l),s.lineCap=Rt(K.lineCap,"butt"),s.lineDashOffset=Rt(K.lineDashOffset,0),s.lineJoin=Rt(K.lineJoin,"miter"),s.lineWidth=q,s.strokeStyle=Rt(K.strokeStyle,l),s.setLineDash(Rt(K.lineDash,[])),a.usePointStyle){const rt={radius:_*Math.SQRT2/2,pointStyle:K.pointStyle,rotation:K.rotation,borderWidth:q},z=h.xPlus(V,b/2),tt=$+g;Rg(s,rt,z,tt,a.pointStyleWidth&&b)}else{const rt=$+Math.max((p-_)/2,0),z=h.leftForLtr(V,b),tt=as(K.borderRadius);s.beginPath(),Object.values(tt).some(ot=>ot!==0)?to(s,{x:z,y:rt,w:b,h:_,radius:tt}):s.rect(z,rt,b,_),s.fill(),q!==0&&s.stroke()}s.restore()},S=function(V,$,K){fs(s,K.text,V,$+w/2,c,{strikethrough:K.hidden,textAlign:h.textAlign(K.textAlign)})},C=this.isHorizontal(),x=this._computeTitleHeight();C?v={x:Be(r,this.left+d,this.right-n[0]),y:this.top+d+x,line:0}:v={x:this.left+d,y:Be(r,this.top+x+d,this.bottom-e[0].height),line:0},Ug(this.ctx,t.textDirection);const D=w+d;this.legendItems.forEach((V,$)=>{s.strokeStyle=V.fontColor,s.fillStyle=V.fontColor;const K=s.measureText(V.text).width,q=h.textAlign(V.textAlign||(V.textAlign=a.textAlign)),rt=b+g+K;let z=v.x,tt=v.y;h.setWidth(this.width),C?$>0&&z+rt+d>this.right&&(tt=v.y+=D,v.line++,z=v.x=Be(r,this.left+d,this.right-n[v.line])):$>0&&tt+D>this.bottom&&(z=v.x=z+e[v.line].width+d,v.line++,tt=v.y=Be(r,this.top+x+d,this.bottom-e[v.line].height));const ot=h.x(z);if(T(ot,tt,V),z=oE(q,z+b+g,C?z+rt:this.right,t.rtl),S(h.x(z),tt,V),C)v.x+=rt+d;else if(typeof V.text!="string"){const it=c.lineHeight;v.y+=mv(V,it)+d}else v.y+=D}),Wg(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,n=Ce(e.font),s=$e(e.padding);if(!e.display)return;const r=Ns(t.rtl,this.left,this.width),a=this.ctx,l=e.position,h=n.size/2,c=s.top+h;let d,p=this.left,g=this.width;if(this.isHorizontal())g=Math.max(...this.lineWidths),d=this.top+c,p=Be(t.align,p,this.right-g);else{const b=this.columnSizes.reduce((_,w)=>Math.max(_,w.height),0);d=c+Be(t.align,this.top,this.bottom-b-t.labels.padding-this._computeTitleHeight())}const v=Be(l,p,p+g);a.textAlign=r.textAlign(sh(l)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=n.string,fs(a,e.text,v,d,n)}_computeTitleHeight(){const t=this.options.title,e=Ce(t.font),n=$e(t.padding);return t.display?e.lineHeight+n.height:0}_getLegendItemAt(t,e){let n,s,r;if(on(t,this.left,this.right)&&on(e,this.top,this.bottom)){for(r=this.legendHitBoxes,n=0;nr.length>a.length?r:a)),t+e.size/2+n.measureText(s).width}function HM(i,t,e){let n=i;return typeof t.text!="string"&&(n=mv(t,e)),n}function mv(i,t){const e=i.text?i.text.length:0;return t*e}function jM(i,t){return!!((i==="mousemove"||i==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(i==="click"||i==="mouseup"))}var UM={id:"legend",_element:vp,start(i,t,e){const n=i.legend=new vp({ctx:i.ctx,options:e,chart:i});Ve.configure(i,n,e),Ve.addBox(i,n)},stop(i){Ve.removeBox(i,i.legend),delete i.legend},beforeUpdate(i,t,e){const n=i.legend;Ve.configure(i,n,e),n.options=e},afterUpdate(i){const t=i.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(i,t){t.replay||i.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(i,t,e){const n=t.datasetIndex,s=e.chart;s.isDatasetVisible(n)?(s.hide(n),t.hidden=!0):(s.show(n),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:i=>i.chart.options.color,boxWidth:40,padding:10,generateLabels(i){const t=i.data.datasets,{labels:{usePointStyle:e,pointStyle:n,textAlign:s,color:r,useBorderRadius:a,borderRadius:l}}=i.legend.options;return i._getSortedDatasetMetas().map(h=>{const c=h.controller.getStyle(e?0:void 0),d=$e(c.borderWidth);return{text:t[h.index].label,fillStyle:c.backgroundColor,fontColor:r,hidden:!h.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(d.width+d.height)/4,strokeStyle:c.borderColor,pointStyle:n||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:a&&(l||c.borderRadius),datasetIndex:h.index}},this)}},title:{color:i=>i.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:i=>!i.startsWith("on"),labels:{_scriptable:i=>!["generateLabels","filter","sort"].includes(i)}}};class ph extends pn{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const n=this.options;if(this.left=0,this.top=0,!n.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const s=ce(n.text)?n.text.length:1;this._padding=$e(n.padding);const r=s*Ce(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:n,bottom:s,right:r,options:a}=this,l=a.align;let h=0,c,d,p;return this.isHorizontal()?(d=Be(l,n,r),p=e+t,c=r-n):(a.position==="left"?(d=n+t,p=Be(l,s,e),h=ae*-.5):(d=r-t,p=Be(l,e,s),h=ae*.5),c=s-e),{titleX:d,titleY:p,maxWidth:c,rotation:h}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const n=Ce(e.font),r=n.lineHeight/2+this._padding.top,{titleX:a,titleY:l,maxWidth:h,rotation:c}=this._drawArgs(r);fs(t,e.text,0,0,n,{color:e.color,maxWidth:h,rotation:c,textAlign:sh(e.align),textBaseline:"middle",translation:[a,l]})}}function WM(i,t){const e=new ph({ctx:i.ctx,options:t,chart:i});Ve.configure(i,e,t),Ve.addBox(i,e),i.titleBlock=e}var qM={id:"title",_element:ph,start(i,t,e){WM(i,e)},stop(i){const t=i.titleBlock;Ve.removeBox(i,t),delete i.titleBlock},beforeUpdate(i,t,e){const n=i.titleBlock;Ve.configure(i,n,e),n.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const na=new WeakMap;var GM={id:"subtitle",start(i,t,e){const n=new ph({ctx:i.ctx,options:e,chart:i});Ve.configure(i,n,e),Ve.addBox(i,n),na.set(i,n)},stop(i){Ve.removeBox(i,na.get(i)),na.delete(i)},beforeUpdate(i,t,e){const n=na.get(i);Ve.configure(i,n,e),n.options=e},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Pr={average(i){if(!i.length)return!1;let t,e,n=new Set,s=0,r=0;for(t=0,e=i.length;tl+h)/n.size,y:s/r}},nearest(i,t){if(!i.length)return!1;let e=t.x,n=t.y,s=Number.POSITIVE_INFINITY,r,a,l;for(r=0,a=i.length;r-1?i.split(` `):i}function ZM(i,t){const{element:e,datasetIndex:n,index:s}=t,r=i.getDatasetMeta(n).controller,{label:a,value:l}=r.getLabelAndValue(s);return{chart:i,label:a,parsed:r.getParsed(s),raw:i.data.datasets[n].data[s],formattedValue:l,dataset:r.getDataset(),dataIndex:s,datasetIndex:n,element:e}}function _p(i,t){const e=i.chart.ctx,{body:n,footer:s,title:r}=i,{boxWidth:a,boxHeight:l}=t,h=Ce(t.bodyFont),c=Ce(t.titleFont),d=Ce(t.footerFont),p=r.length,g=s.length,v=n.length,b=$e(t.padding);let _=b.height,w=0,T=n.reduce((x,D)=>x+D.before.length+D.lines.length+D.after.length,0);if(T+=i.beforeBody.length+i.afterBody.length,p&&(_+=p*c.lineHeight+(p-1)*t.titleSpacing+t.titleMarginBottom),T){const x=t.displayColors?Math.max(l,h.lineHeight):h.lineHeight;_+=v*x+(T-v)*h.lineHeight+(T-1)*t.bodySpacing}g&&(_+=t.footerMarginTop+g*d.lineHeight+(g-1)*t.footerSpacing);let S=0;const C=function(x){w=Math.max(w,e.measureText(x).width+S)};return e.save(),e.font=c.string,te(i.title,C),e.font=h.string,te(i.beforeBody.concat(i.afterBody),C),S=t.displayColors?a+2+t.boxPadding:0,te(n,x=>{te(x.before,C),te(x.lines,C),te(x.after,C)}),S=0,e.font=d.string,te(i.footer,C),e.restore(),w+=b.width,{width:w,height:_}}function YM(i,t){const{y:e,height:n}=t;return ei.height-n/2?"bottom":"center"}function KM(i,t,e,n){const{x:s,width:r}=n,a=e.caretSize+e.caretPadding;if(i==="left"&&s+r+a>t.width||i==="right"&&s-r-a<0)return!0}function XM(i,t,e,n){const{x:s,width:r}=e,{width:a,chartArea:{left:l,right:h}}=i;let c="center";return n==="center"?c=s<=(l+h)/2?"left":"right":s<=r/2?c="left":s>=a-r/2&&(c="right"),KM(c,i,t,e)&&(c="center"),c}function yp(i,t,e){const n=e.yAlign||t.yAlign||YM(i,e);return{xAlign:e.xAlign||t.xAlign||XM(i,t,e,n),yAlign:n}}function JM(i,t){let{x:e,width:n}=i;return t==="right"?e-=n:t==="center"&&(e-=n/2),e}function QM(i,t,e){let{y:n,height:s}=i;return t==="top"?n+=e:t==="bottom"?n-=s+e:n-=s/2,n}function bp(i,t,e,n){const{caretSize:s,caretPadding:r,cornerRadius:a}=i,{xAlign:l,yAlign:h}=e,c=s+r,{topLeft:d,topRight:p,bottomLeft:g,bottomRight:v}=as(a);let b=JM(t,l);const _=QM(t,h,c);return h==="center"?l==="left"?b+=c:l==="right"&&(b-=c):l==="left"?b-=Math.max(d,g)+s:l==="right"&&(b+=Math.max(p,v)+s),{x:Me(b,0,n.width-t.width),y:Me(_,0,n.height-t.height)}}function sa(i,t,e){const n=$e(e.padding);return t==="center"?i.x+i.width/2:t==="right"?i.x+i.width-n.right:i.x+n.left}function wp(i){return Ri([],tn(i))}function t1(i,t,e){return Rn(i,{tooltip:t,tooltipItems:e,type:"tooltip"})}function xp(i,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}const gv={beforeTitle:Ji,title(i){if(i.length>0){const t=i[0],e=t.chart.data.labels,n=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(n>0&&t.dataIndex"u"?gv[t].call(e,n):s}var zc;let Sp=(zc=class extends pn{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,n=this.options.setContext(this.getContext()),s=n.enabled&&e.options.animation&&n.animations,r=new Yg(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=t1(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:n}=e,s=Ke(n,"beforeTitle",this,t),r=Ke(n,"title",this,t),a=Ke(n,"afterTitle",this,t);let l=[];return l=Ri(l,tn(s)),l=Ri(l,tn(r)),l=Ri(l,tn(a)),l}getBeforeBody(t,e){return wp(Ke(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:n}=e,s=[];return te(t,r=>{const a={before:[],lines:[],after:[]},l=xp(n,r);Ri(a.before,tn(Ke(l,"beforeLabel",this,r))),Ri(a.lines,Ke(l,"label",this,r)),Ri(a.after,tn(Ke(l,"afterLabel",this,r))),s.push(a)}),s}getAfterBody(t,e){return wp(Ke(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:n}=e,s=Ke(n,"beforeFooter",this,t),r=Ke(n,"footer",this,t),a=Ke(n,"afterFooter",this,t);let l=[];return l=Ri(l,tn(s)),l=Ri(l,tn(r)),l=Ri(l,tn(a)),l}_createItems(t){const e=this._active,n=this.chart.data,s=[],r=[],a=[];let l=[],h,c;for(h=0,c=e.length;ht.filter(d,p,g,n))),t.itemSort&&(l=l.sort((d,p)=>t.itemSort(d,p,n))),te(l,d=>{const p=xp(t.callbacks,d);s.push(Ke(p,"labelColor",this,d)),r.push(Ke(p,"labelPointStyle",this,d)),a.push(Ke(p,"labelTextColor",this,d))}),this.labelColors=s,this.labelPointStyles=r,this.labelTextColors=a,this.dataPoints=l,l}update(t,e){const n=this.options.setContext(this.getContext()),s=this._active;let r,a=[];if(!s.length)this.opacity!==0&&(r={opacity:0});else{const l=Pr[n.position].call(this,s,this._eventPosition);a=this._createItems(n),this.title=this.getTitle(a,n),this.beforeBody=this.getBeforeBody(a,n),this.body=this.getBody(a,n),this.afterBody=this.getAfterBody(a,n),this.footer=this.getFooter(a,n);const h=this._size=_p(this,n),c=Object.assign({},l,h),d=yp(this.chart,n,c),p=bp(n,c,d,this.chart);this.xAlign=d.xAlign,this.yAlign=d.yAlign,r={opacity:1,x:p.x,y:p.y,width:h.width,height:h.height,caretX:l.x,caretY:l.y}}this._tooltipItems=a,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,n,s){const r=this.getCaretPosition(t,n,s);e.lineTo(r.x1,r.y1),e.lineTo(r.x2,r.y2),e.lineTo(r.x3,r.y3)}getCaretPosition(t,e,n){const{xAlign:s,yAlign:r}=this,{caretSize:a,cornerRadius:l}=n,{topLeft:h,topRight:c,bottomLeft:d,bottomRight:p}=as(l),{x:g,y:v}=t,{width:b,height:_}=e;let w,T,S,C,x,D;return r==="center"?(x=v+_/2,s==="left"?(w=g,T=w-a,C=x+a,D=x-a):(w=g+b,T=w+a,C=x-a,D=x+a),S=w):(s==="left"?T=g+Math.max(h,d)+a:s==="right"?T=g+b-Math.max(c,p)-a:T=this.caretX,r==="top"?(C=v,x=C-a,w=T-a,S=T+a):(C=v+_,x=C+a,w=T+a,S=T-a),D=C),{x1:w,x2:T,x3:S,y1:C,y2:x,y3:D}}drawTitle(t,e,n){const s=this.title,r=s.length;let a,l,h;if(r){const c=Ns(n.rtl,this.x,this.width);for(t.x=sa(this,n.titleAlign,n),e.textAlign=c.textAlign(n.titleAlign),e.textBaseline="middle",a=Ce(n.titleFont),l=n.titleSpacing,e.fillStyle=n.titleColor,e.font=a.string,h=0;hS!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,to(t,{x:_,y:b,w:c,h,radius:T}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),to(t,{x:w,y:b+1,w:c-2,h:h-2,radius:T}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(_,b,c,h),t.strokeRect(_,b,c,h),t.fillStyle=a.backgroundColor,t.fillRect(w,b+1,c-2,h-2))}t.fillStyle=this.labelTextColors[n]}drawBody(t,e,n){const{body:s}=this,{bodySpacing:r,bodyAlign:a,displayColors:l,boxHeight:h,boxWidth:c,boxPadding:d}=n,p=Ce(n.bodyFont);let g=p.lineHeight,v=0;const b=Ns(n.rtl,this.x,this.width),_=function(K){e.fillText(K,b.x(t.x+v),t.y+g/2),t.y+=g+r},w=b.textAlign(a);let T,S,C,x,D,V,$;for(e.textAlign=a,e.textBaseline="middle",e.font=p.string,t.x=sa(this,w,n),e.fillStyle=n.bodyColor,te(this.beforeBody,_),v=l&&w!=="right"?a==="center"?c/2+d:c+2+d:0,x=0,V=s.length;x0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,n=this.$animations,s=n&&n.x,r=n&&n.y;if(s||r){const a=Pr[t.position].call(this,this._active,this._eventPosition);if(!a)return;const l=this._size=_p(this,t),h=Object.assign({},a,this._size),c=yp(e,t,h),d=bp(t,h,c,e);(s._to!==d.x||r._to!==d.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=l.width,this.height=l.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,d))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let n=this.opacity;if(!n)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},r={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;const a=$e(e.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&l&&(t.save(),t.globalAlpha=n,this.drawBackground(r,t,s,e),Ug(t,e.textDirection),r.y+=a.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),Wg(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const n=this._active,s=t.map(({datasetIndex:l,index:h})=>{const c=this.chart.getDatasetMeta(l);if(!c)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:c.data[h],index:h}}),r=!$a(n,s),a=this._positionChanged(s,e);(r||a)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,n=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,r=this._active||[],a=this._getActiveElements(t,r,e,n),l=this._positionChanged(a,t),h=e||!$a(a,r)||l;return h&&(this._active=a,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),h}_getActiveElements(t,e,n,s){const r=this.options;if(t.type==="mouseout")return[];if(!s)return e.filter(l=>this.chart.data.datasets[l.datasetIndex]&&this.chart.getDatasetMeta(l.datasetIndex).controller.getParsed(l.index)!==void 0);const a=this.chart.getElementsAtEventForMode(t,r.mode,r,n);return r.reverse&&a.reverse(),a}_positionChanged(t,e){const{caretX:n,caretY:s,options:r}=this,a=Pr[r.position].call(this,t,e);return a!==!1&&(n!==a.x||s!==a.y)}},pt(zc,"positioners",Pr),zc);var e1={id:"tooltip",_element:Sp,positioners:Pr,afterInit(i,t,e){e&&(i.tooltip=new Sp({chart:i,options:e}))},beforeUpdate(i,t,e){i.tooltip&&i.tooltip.initialize(e)},reset(i,t,e){i.tooltip&&i.tooltip.initialize(e)},afterDraw(i){const t=i.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(i.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(i.ctx),i.notifyPlugins("afterTooltipDraw",e)}},afterEvent(i,t){if(i.tooltip){const e=t.replay;i.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(i,t)=>t.bodyFont.size,boxWidth:(i,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:gv},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:i=>i!=="filter"&&i!=="itemSort"&&i!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},i1=Object.freeze({__proto__:null,Colors:pM,Decimation:_M,Filler:VM,Legend:UM,SubTitle:GM,Title:qM,Tooltip:e1});const n1=(i,t,e,n)=>(typeof t=="string"?(e=i.push(t)-1,n.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function s1(i,t,e,n){const s=i.indexOf(t);if(s===-1)return n1(i,t,e,n);const r=i.lastIndexOf(t);return s!==r?e:s}const r1=(i,t)=>i===null?null:Me(Math.round(i),0,t);function kp(i){const t=this.getLabels();return i>=0&&ie.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}pt(yu,"id","category"),pt(yu,"defaults",{ticks:{callback:kp}});function o1(i,t){const e=[],{bounds:s,step:r,min:a,max:l,precision:h,count:c,maxTicks:d,maxDigits:p,includeBounds:g}=i,v=r||1,b=d-1,{min:_,max:w}=t,T=!Gt(a),S=!Gt(l),C=!Gt(c),x=(w-_)/(p+1);let D=_f((w-_)/b/v)*v,V,$,K,q;if(D<1e-14&&!T&&!S)return[{value:_},{value:w}];q=Math.ceil(w/D)-Math.floor(_/D),q>b&&(D=_f(q*D/b/v)*v),Gt(h)||(V=Math.pow(10,h),D=Math.ceil(D*V)/V),s==="ticks"?($=Math.floor(_/D)*D,K=Math.ceil(w/D)*D):($=_,K=w),T&&S&&r&&Qk((l-a)/r,D/1e3)?(q=Math.round(Math.min((l-a)/D,d)),D=(l-a)/q,$=a,K=l):C?($=T?a:$,K=S?l:K,q=c-1,D=(K-$)/q):(q=(K-$)/D,Br(q,Math.round(q),D/1e3)?q=Math.round(q):q=Math.ceil(q));const rt=Math.max(yf(D),yf($));V=Math.pow(10,Gt(h)?rt:h),$=Math.round($*V)/V,K=Math.round(K*V)/V;let z=0;for(T&&(g&&$!==a?(e.push({value:a}),$l)break;e.push({value:tt})}return S&&g&&K!==l?e.length&&Br(e[e.length-1].value,l,Ep(l,x,i))?e[e.length-1].value=l:e.push({value:l}):(!S||K===l)&&e.push({value:K}),e}function Ep(i,t,{horizontal:e,minRotation:n}){const s=Ei(n),r=(e?Math.sin(s):Math.cos(s))||.001,a=.75*t*(""+i).length;return Math.min(t/r,a)}class Za extends vs{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return Gt(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:s,max:r}=this;const a=h=>s=e?s:h,l=h=>r=n?r:h;if(t){const h=Hi(s),c=Hi(r);h<0&&c<0?l(0):h>0&&c>0&&a(0)}if(s===r){let h=r===0?1:Math.abs(r*.05);l(r+h),t||a(s-h)}this.min=s,this.max=r}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:n}=t,s;return n?(s=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),e=e||11),e&&(s=Math.min(e,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let n=this.getTickLimit();n=Math.max(2,n);const s={maxTicks:n,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},r=this._range||this,a=o1(s,r);return t.bounds==="ticks"&&Tg(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let e=this.min,n=this.max;if(super.configure(),this.options.offset&&t.length){const s=(n-e)/Math.max(t.length-1,1)/2;e-=s,n+=s}this._startValue=e,this._endValue=n,this._valueRange=n-e}getLabelForValue(t){return fo(t,this.chart.options.locale,this.options.ticks.format)}}class bu extends Za{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=me(t)?t:0,this.max=me(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,n=Ei(this.options.ticks.minRotation),s=(t?Math.sin(n):Math.cos(n))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,r.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}pt(bu,"id","linear"),pt(bu,"defaults",{ticks:{callback:hl.formatters.numeric}});const io=i=>Math.floor(Cn(i)),Xn=(i,t)=>Math.pow(10,io(i)+t);function Cp(i){return i/Math.pow(10,io(i))===1}function Tp(i,t,e){const n=Math.pow(10,e),s=Math.floor(i/n);return Math.ceil(t/n)-s}function a1(i,t){const e=t-i;let n=io(e);for(;Tp(i,t,n)>10;)n++;for(;Tp(i,t,n)<10;)n--;return Math.min(n,io(i))}function l1(i,{min:t,max:e}){t=ni(i.min,t);const n=[],s=io(t);let r=a1(t,e),a=r<0?Math.pow(10,Math.abs(r)):1;const l=Math.pow(10,r),h=s>r?Math.pow(10,s):0,c=Math.round((t-h)*a)/a,d=Math.floor((t-h)/l/10)*l*10;let p=Math.floor((c-d)/Math.pow(10,r)),g=ni(i.min,Math.round((h+d+p*Math.pow(10,r))*a)/a);for(;g=10?p=p<15?15:20:p++,p>=20&&(r++,p=2,a=r>=0?1:a),g=Math.round((h+d+p*Math.pow(10,r))*a)/a;const v=ni(i.max,g);return n.push({value:v,major:Cp(v),significand:p}),n}class wu extends vs{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const n=Za.prototype.parse.apply(this,[t,e]);if(n===0){this._zero=!0;return}return me(n)&&n>0?n:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=me(t)?Math.max(0,t):null,this.max=me(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!me(this._userMin)&&(this.min=t===Xn(this.min,0)?Xn(this.min,-1):Xn(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let n=this.min,s=this.max;const r=l=>n=t?n:l,a=l=>s=e?s:l;n===s&&(n<=0?(r(1),a(10)):(r(Xn(n,-1)),a(Xn(s,1)))),n<=0&&r(Xn(s,-1)),s<=0&&a(Xn(n,1)),this.min=n,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},n=l1(e,this);return t.bounds==="ticks"&&Tg(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}getLabelForValue(t){return t===void 0?"0":fo(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Cn(t),this._valueRange=Cn(this.max)-Cn(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Cn(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}pt(wu,"id","logarithmic"),pt(wu,"defaults",{ticks:{callback:hl.formatters.logarithmic,major:{enabled:!0}}});function xu(i){const t=i.ticks;if(t.display&&i.display){const e=$e(t.backdropPadding);return Rt(t.font&&t.font.size,ue.font.size)+e.height}return 0}function c1(i,t,e){return e=ce(e)?e:[e],{w:gE(i,t.string,e),h:e.length*t.lineHeight}}function Mp(i,t,e,n,s){return i===n||i===s?{start:t-e/2,end:t+e/2}:is?{start:t-e,end:t}:{start:t,end:t+e}}function u1(i){const t={l:i.left+i._padding.left,r:i.right-i._padding.right,t:i.top+i._padding.top,b:i.bottom-i._padding.bottom},e=Object.assign({},t),n=[],s=[],r=i._pointLabels.length,a=i.options.pointLabels,l=a.centerPointLabels?ae/r:0;for(let h=0;ht.r&&(l=(n.end-t.r)/r,i.r=Math.max(i.r,t.r+l)),s.startt.b&&(h=(s.end-t.b)/a,i.b=Math.max(i.b,t.b+h))}function d1(i,t,e){const n=i.drawingArea,{extra:s,additionalAngle:r,padding:a,size:l}=e,h=i.getPointPosition(t,n+s+a,r),c=Math.round(ih(oi(h.angle+_e))),d=v1(h.y,l.h,c),p=m1(c),g=g1(h.x,l.w,p);return{visible:!0,x:h.x,y:d,textAlign:p,left:g,top:d,right:g+l.w,bottom:d+l.h}}function f1(i,t){if(!t)return!0;const{left:e,top:n,right:s,bottom:r}=i;return!(ln({x:e,y:n},t)||ln({x:e,y:r},t)||ln({x:s,y:n},t)||ln({x:s,y:r},t))}function p1(i,t,e){const n=[],s=i._pointLabels.length,r=i.options,{centerPointLabels:a,display:l}=r.pointLabels,h={extra:xu(r)/2,additionalAngle:a?ae/s:0};let c;for(let d=0;d270||e<90)&&(i-=t),i}function _1(i,t,e){const{left:n,top:s,right:r,bottom:a}=e,{backdropColor:l}=t;if(!Gt(l)){const h=as(t.borderRadius),c=$e(t.backdropPadding);i.fillStyle=l;const d=n-c.left,p=s-c.top,g=r-n+c.width,v=a-s+c.height;Object.values(h).some(b=>b!==0)?(i.beginPath(),to(i,{x:d,y:p,w:g,h:v,radius:h}),i.fill()):i.fillRect(d,p,g,v)}}function y1(i,t){const{ctx:e,options:{pointLabels:n}}=i;for(let s=t-1;s>=0;s--){const r=i._pointLabelItems[s];if(!r.visible)continue;const a=n.setContext(i.getPointLabelContext(s));_1(e,a,r);const l=Ce(a.font),{x:h,y:c,textAlign:d}=r;fs(e,i._pointLabels[s],h,c+l.lineHeight/2,l,{color:a.color,textAlign:d,textBaseline:"middle"})}}function vv(i,t,e,n){const{ctx:s}=i;if(e)s.arc(i.xCenter,i.yCenter,t,0,oe);else{let r=i.getPointPosition(0,t);s.moveTo(r.x,r.y);for(let a=1;a{const s=re(this.options.pointLabels.callback,[e,n],this);return s||s===0?s:""}).filter((e,n)=>this.chart.getDataVisibility(n))}fit(){const t=this.options;t.display&&t.pointLabels.display?u1(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,n,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((n-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,n,s))}getIndexAngle(t){const e=oe/(this._pointLabels.length||1),n=this.options.startAngle||0;return oi(t*e+Ei(n))}getDistanceFromCenterForValue(t){if(Gt(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(Gt(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t{if(p!==0||p===0&&this.min<0){h=this.getDistanceFromCenterForValue(d.value);const g=this.getContext(p),v=s.setContext(g),b=r.setContext(g);b1(this,v,h,a,b)}}),n.display){for(t.save(),l=a-1;l>=0;l--){const d=n.setContext(this.getPointLabelContext(l)),{color:p,lineWidth:g}=d;!g||!p||(t.lineWidth=g,t.strokeStyle=p,t.setLineDash(d.borderDash),t.lineDashOffset=d.borderDashOffset,h=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),c=this.getPointPosition(l,h),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,n=e.ticks;if(!n.display)return;const s=this.getIndexAngle(0);let r,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((l,h)=>{if(h===0&&this.min>=0&&!e.reverse)return;const c=n.setContext(this.getContext(h)),d=Ce(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[h].value),c.showLabelBackdrop){t.font=d.string,a=t.measureText(l.label).width,t.fillStyle=c.backdropColor;const p=$e(c.backdropPadding);t.fillRect(-a/2-p.left,-r-d.size/2-p.top,a+p.width,d.size+p.height)}fs(t,l.label,0,-r,d,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}pt(Or,"id","radialLinear"),pt(Or,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:hl.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),pt(Or,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),pt(Or,"descriptors",{angleLines:{_fallback:"grid"}});const ml={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Je=Object.keys(ml);function Lp(i,t){return i-t}function Ap(i,t){if(Gt(t))return null;const e=i._adapter,{parser:n,round:s,isoWeekday:r}=i._parseOpts;let a=t;return typeof n=="function"&&(a=n(a)),me(a)||(a=typeof n=="string"?e.parse(a,n):e.parse(a)),a===null?null:(s&&(a=s==="week"&&($s(r)||r===!0)?e.startOf(a,"isoWeek",r):e.startOf(a,s)),+a)}function Dp(i,t,e,n){const s=Je.length;for(let r=Je.indexOf(i);r=Je.indexOf(e);r--){const a=Je[r];if(ml[a].common&&i._adapter.diff(s,n,a)>=t-1)return a}return Je[e?Je.indexOf(e):0]}function S1(i){for(let t=Je.indexOf(i)+1,e=Je.length;t=t?e[n]:e[s];i[r]=!0}}function k1(i,t,e,n){const s=i._adapter,r=+s.startOf(t[0].value,n),a=t[t.length-1].value;let l,h;for(l=r;l<=a;l=+s.add(l,1,n))h=e[l],h>=0&&(t[h].major=!0);return t}function Op(i,t,e){const n=[],s={},r=t.length;let a,l;for(a=0;a+t.value))}initOffsets(t=[]){let e=0,n=0,s,r;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?e=1-s:e=(this.getDecimalForValue(t[1])-s)/2,r=this.getDecimalForValue(t[t.length-1]),t.length===1?n=r:n=(r-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;e=Me(e,0,a),n=Me(n,0,a),this._offsets={start:e,end:n,factor:1/(e+1+n)}}_generate(){const t=this._adapter,e=this.min,n=this.max,s=this.options,r=s.time,a=r.unit||Dp(r.minUnit,e,n,this._getLabelCapacity(e)),l=Rt(s.ticks.stepSize,1),h=a==="week"?r.isoWeekday:!1,c=$s(h)||h===!0,d={};let p=e,g,v;if(c&&(p=+t.startOf(p,"isoWeek",h)),p=+t.startOf(p,c?"day":a),t.diff(n,e,a)>1e5*l)throw new Error(e+" and "+n+" are too far apart with stepSize of "+l+" "+a);const b=s.ticks.source==="data"&&this.getDataTimestamps();for(g=p,v=0;g+_)}getLabelForValue(t){const e=this._adapter,n=this.options.time;return n.tooltipFormat?e.format(t,n.tooltipFormat):e.format(t,n.displayFormats.datetime)}format(t,e){const s=this.options.time.displayFormats,r=this._unit,a=e||s[r];return this._adapter.format(t,a)}_tickFormatFunction(t,e,n,s){const r=this.options,a=r.ticks.callback;if(a)return re(a,[t,e,n],this);const l=r.time.displayFormats,h=this._unit,c=this._majorUnit,d=h&&l[h],p=c&&l[c],g=n[e],v=c&&p&&g&&g.major;return this._adapter.format(t,s||(v?p:d))}generateTickLabels(t){let e,n,s;for(e=0,n=t.length;e0?l:1}getDataTimestamps(){let t=this._cache.data||[],e,n;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(e=0,n=s.length;e=i[n].pos&&t<=i[s].pos&&({lo:n,hi:s}=an(i,"pos",t)),{pos:r,time:l}=i[n],{pos:a,time:h}=i[s]):(t>=i[n].time&&t<=i[s].time&&({lo:n,hi:s}=an(i,"time",t)),{time:r,pos:l}=i[n],{time:a,pos:h}=i[s]);const c=a-r;return c?l+(h-l)*(t-r)/c:l}class Su extends no{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=ra(e,this.min),this._tableRange=ra(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:n}=this,s=[],r=[];let a,l,h,c,d;for(a=0,l=t.length;a=e&&c<=n&&s.push(c);if(s.length<2)return[{time:e,pos:0},{time:n,pos:1}];for(a=0,l=s.length;as-r)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),n=this.getLabelTimestamps();return e.length&&n.length?t=this.normalize(e.concat(n)):t=e.length?e:n,t=this._cache.all=t,t}getDecimalForValue(t){return(ra(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,n=this.getDecimalForPixel(t)/e.factor-e.end;return ra(this._table,n*this._tableRange+this._minPos,!0)}}pt(Su,"id","timeseries"),pt(Su,"defaults",no.defaults);var E1=Object.freeze({__proto__:null,CategoryScale:yu,LinearScale:bu,LogarithmicScale:wu,RadialLinearScale:Or,TimeScale:no,TimeSeriesScale:Su});const C1=[DC,aM,i1,E1],rn={borderColor:"#D9E3F0",primaryChartColor:"#195BA9",redGradientStart:"rgba(66, 133, 244, 0)",redGradientEnd:"rgba(66, 133, 244, 0.2)",blueGradientStart:"rgba(244, 66, 151, 0)",blueGradientEnd:"rgba(244, 66, 98, 0.2)",white:"rgba(255, 255, 255, 1)",dark:"rgba(12, 27, 46, 1)"},Ip={labels:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],datasets:[{label:"Revenue",data:[1e4,19e3,21e3,22e3,21e3,12e3,13748,13e3,12e3,13e3,12e3,21e3],pointBackgroundColor:"rgba(255,255,255)",fill:!0},{label:"Products sales",data:[15e3,16e3,14e3,18e3,16e3,17e3,3458,16e3,15e3,16e3,14e3,15e3],fill:!0,pointBackgroundColor:"rgba(255,255,255, 1)"}]},Lc={elements:{point:{radius:0,borderWidth:3,hitRadius:6,hoverRadius:6,hoverBorderWidth:3}},interaction:{mode:"nearest"},responsive:!0,aspectRatio:2,maintainAspectRatio:!1,plugins:{legend:{align:"end",labels:{usePointStyle:!0,useBorderRadius:!0}},tooltip:{enabled:!0,mode:"nearest",xAlign:"center",yAlign:"top",caretPadding:15,callbacks:{title:function(){return""},label:function(i){return`$ ${i.formattedValue}`}},backgroundColor:rn.white,bodyColor:rn.dark,bodyFont:{size:14,lineHeight:"20px",weight:"bold"},padding:16,boxPadding:16,cornerRadius:5,displayColors:!1}},scales:{x:{grid:{display:!1},ticks:{font:{size:12}}},y:{border:{display:!1,color:rn.borderColor,dash:[6,6]},grid:{display:!0,color:rn.borderColor,tickBorderDash:[5,5]}}}},T1={canvasEl:".__charts-canvas__"};class M1 extends Kt{constructor(t){super(t),this.instance=null,this.canvasEl=this.element.querySelector(T1.canvasEl),this.canvasContext=this.canvasEl.getContext("2d"),nn.register(...C1),this.init(),this.addListeners()}init(){var n;const t=this.canvasContext.createLinearGradient(0,0,0,this.canvasEl.height),e=this.canvasContext.createLinearGradient(0,0,0,this.canvasEl.height);t.addColorStop(0,rn.redGradientStart),t.addColorStop(1,rn.redGradientEnd),e.addColorStop(0,rn.blueGradientStart),e.addColorStop(1,rn.blueGradientEnd),(n=Lc.plugins)!=null&&n.legend&&(Lc.plugins.legend.display=!1),this.instance=new nn(this.canvasContext,{type:"line",data:{...Ip,datasets:Ip.datasets.map((s,r)=>({...s,backgroundColor:r===0?t:e,borderColor:r===0?rn.primaryChartColor:"rgba(244, 66, 98)"}))},options:Lc})}addListeners(){}}const Ps={field:".__field-cloner-item__",addButton:".__field-cloner-add__",removeButton:".__field-cloner-remove__",inputField:".__input-field__",hiddenInputs:'input[type="hidden"]'},Ac={component:"data-component",hydrated:"data-hydrated",withSaveValues:"data-with-save-values"},oa={fieldHidden:"field-cloner__item_hidden"},_v=/\[(\d+)\]/,L1=new RegExp(_v);class A1 extends Kt{constructor(t){super(t),this.addButton=this.element.querySelector(Ps.addButton),this.fieldSets=Array.from(this.element.querySelectorAll(Ps.field)),this.withSaveValues=!!JSON.parse(this.element.getAttribute(Ac.withSaveValues)||"false"),this.onRemoveFieldSet=this.onRemoveFieldSet.bind(this),this.onAddFieldset=this.onAddFieldset.bind(this),this.init(),this.addListeners()}destroy(){super.destroy(),this.element.removeEventListener("click",this.onRemoveFieldSet),this.addButton.removeEventListener("click",this.onAddFieldset)}handleEnumeratedFields(){this.fieldSets.forEach((t,e)=>{Array.from(t.querySelectorAll("input")).forEach(n=>{const s=n.getAttribute("name"),r=s==null?void 0:s.match(L1);if(s&&r){const a=s==null?void 0:s.replace(_v,`[${e}]`);n.setAttribute("name",a)}})})}onAddFieldset(t){t.preventDefault();const e=this.fieldSets.at(0),n=this.fieldSets.at(-1);if(e==null?void 0:e.classList.contains(oa.fieldHidden)){e==null||e.classList.remove(oa.fieldHidden);return}if(n){const r=n.cloneNode(!0);Array.from(r.querySelectorAll(Ps.hiddenInputs)).forEach(l=>l.remove()),this.fieldSets=[...this.fieldSets,r],this.handleEnumeratedFields();const a=r.querySelectorAll(Ps.inputField);this.withSaveValues||a.forEach(l=>{l.value=""}),n.after(r),r.querySelectorAll("*").forEach(l=>{l.hasAttribute(Ac.component)&&l.removeAttribute(Ac.hydrated)})}}onRemoveFieldSet(t){var r;const n=t.target.closest(Ps.removeButton);if(!n)return;const s=n.closest(Ps.field);if(this.fieldSets.length>1){const a=this.fieldSets.indexOf(s);s==null||s.remove(),this.fieldSets=this.fieldSets.filter((l,h)=>h!==a)}else(r=this.fieldSets.at(0))==null||r.classList.add(oa.fieldHidden);this.handleEnumeratedFields()}addListeners(){this.element.addEventListener("click",this.onRemoveFieldSet),this.addButton.addEventListener("click",this.onAddFieldset)}init(){var t;if(this.fieldSets.length>=1){(t=this.fieldSets.at(0))==null||t.classList.remove(oa.fieldHidden);return}throw new Error("Fields not found")}}const Dc={row:".table__row",cell:".table-cell"},Pc={columns:"data-columns",columnsMap:"data-columns-map",mobileColumnsMap:"data-mobile-columns-map"},D1={rowHead:"table__row_head"},P1=939;class O1 extends Kt{constructor(t){var n;super(t),this.rows=this.element.querySelectorAll(Dc.row),this.columns=JSON.parse(this.element.getAttribute(Pc.columns)||"0"),this.columnsMap=JSON.parse(this.element.getAttribute(Pc.columnsMap)||"{}"),this.mobileColumnsMap=JSON.parse(this.element.getAttribute(Pc.mobileColumnsMap)||"{}"),this.gridTemplateColumnsValue="",this.gridTemplateColumnsMobileValue="";const e=this.element.querySelectorAll(Dc.row);e.forEach(s=>{!s.classList.contains(D1.rowHead)&&this.columns===0&&(this.columns=s.querySelectorAll(Dc.cell).length)}),this.columns===0&&(this.columns=((n=e[0])==null?void 0:n.children.length)||0)}resize(){const e=window.innerWidth{n.style.gridTemplateColumns=e})}init(){const t=this.columns&&!isNaN(this.columns),e=Object.keys(this.columnsMap).length>0,n=Object.keys(this.mobileColumnsMap).length>0;t&&e&&(this.gridTemplateColumnsValue=Array.from({length:this.columns}).reduce((s,r,a)=>{const l=this.columnsMap[a+1]??"1fr";return s+=` ${l}`},""),this.resize()),n&&(this.gridTemplateColumnsMobileValue=Array.from({length:this.mobileColumnsMap.columns}).reduce((s,r)=>s+=" 1fr",""),this.resize())}addEventListener(){window.addEventListener("resize",this.resize.bind(this))}}class I1 extends Kt{}const F1={bottomNavbar:".__bottom-navbar__"},aa={menuContainer:"burger-button-menu-container",menuContainerInner:"burger-button-menu-container-inner",overlay:"burger-button-overlay",closeButton:"burger-button-menu-container__close"},Oc={menuId:"data-menu-id"},Cr={visibleContainer:"burger-button-menu-container_visible",visibleOverlay:"burger-button-overlay_visible"},R1=` `;class $r extends Kt{constructor(t){super(t),this.containerId=null,this.overlay=null,this.bottomNavbar=null,this.init(),this.addListeners()}static createOverlay(){const t=document.createElement("div");return t.classList.add(aa.overlay),t}static createMenuContainer(t){const e=document.createElement("div"),n=document.createElement("div");return e.classList.add(aa.menuContainer),n.classList.add(aa.menuContainerInner),e.appendChild(n),t&&n.appendChild(t),e}static createCloseButton(){const t=document.createElement("button");return t.classList.add(aa.closeButton),t.innerHTML=R1,t}closeMenu(){var t,e;(t=this.overlay)==null||t.classList.remove(Cr.visibleOverlay),(e=this.menuContainer)==null||e.classList.remove(Cr.visibleContainer)}openMenu(){var t,e;(t=this.overlay)==null||t.classList.add(Cr.visibleOverlay),(e=this.menuContainer)==null||e.classList.add(Cr.visibleContainer)}visibleMenu(t){t?this.openMenu():this.closeMenu()}onClick(){var e;const t=(e=this.overlay)==null?void 0:e.classList.contains(Cr.visibleOverlay);this.visibleMenu(!t)}getMenuByElement(t){return!this.element.isEqualNode(t)&&this.containerId===t.getAttribute(Oc.menuId)}init(){var t;this.containerId=this.element.getAttribute(Oc.menuId),this.bottomNavbar=document.querySelector(F1.bottomNavbar),this.overlay=$r.createOverlay(),this.navMenuContainer=Array.from(document.querySelectorAll(`[${Oc.menuId}=${this.containerId}]`)).find(this.getMenuByElement.bind(this)),this.navMenuCloneContainer=(t=this.navMenuContainer)==null?void 0:t.cloneNode(!0),this.menuContainer=$r.createMenuContainer(this.navMenuCloneContainer),this.closeButton=$r.createCloseButton(),document.body.appendChild(this.overlay),document.body.appendChild(this.menuContainer),this.menuContainer.appendChild(this.closeButton)}addListeners(){var t,e;this.element.addEventListener("click",this.onClick.bind(this)),(t=this.overlay)==null||t.addEventListener("click",this.closeMenu.bind(this)),(e=this.closeButton)==null||e.addEventListener("click",this.closeMenu.bind(this))}}const qe=class qe extends Kt{constructor(t){super(t),this.isSubmit=this.element.getAttribute("type")==="submit",this.handleSubmit=this.element.getAttribute(qe.DATA_SET.handleSubmit),this.toastTitle=this.element.getAttribute(qe.DATA_SET.toastTitle),this.toastText=this.element.getAttribute(qe.DATA_SET.toastText),this.toastStyle=this.element.getAttribute(qe.DATA_SET.toastStyle),this.addListeners()}onClick(){(this.toastTitle||this.toastText)&&Pn.push({title:this.toastTitle,content:this.toastText,style:this.toastStyle||"primary"})}onSubmit(t){t.target.classList.add(qe.MODS.formDisabled),this.handleSubmit==="prevent"&&t.preventDefault();const n=this.element;n.setAttribute(qe.DATA_SET.disabled,qe.DATA_SET.disabled),setTimeout(()=>{n.setAttribute(qe.DATA_SET.loading,qe.DATA_SET.loading)},qe.TRANSITION_DURATION)}addListeners(){if(this.isSubmit&&this.handleSubmit){const t=this.element.closest("form");t==null||t.addEventListener("submit",this.onSubmit.bind(this))}this.element.addEventListener("click",this.onClick.bind(this))}};qe.TRANSITION_DURATION=300,qe.DATA_SET={loading:"loading",disabled:"disabled",toastTitle:"data-toast-title",toastText:"data-toast-text",toastStyle:"data-toast-style",handleSubmit:"data-handle-submit"},qe.MODS={formDisabled:"form_disabled"};let ku=qe;const B1=i=>`Avatar`,V1=()=>`
`,Jn={fileInput:".__avatar-loader-input__",avatarImage:".__avatar-image__",avatarContent:".__avatar-content__",buttonChange:".__avatar-loader-button-change__",buttonRemove:".__avatar-loader-button-remove__",buttonLabel:".__avatar-loader-button-label__"},Qn={mode:"data-mode",ext:"data-ext",sizeLimit:"data-size-limit",avatarLabel:"data-avatar-label",buttonLabelDefault:"data-button-label-default",buttonLabelChange:"data-button-label-change",buttonLabelRemove:"data-button-label-remove"},la={buttonVisible:"avatar-loader__button_visible"},N1=15;class Hr extends Kt{constructor(t){var e;super(t),this.cacheMode=(e=this.element.getAttribute(Qn.mode))==null?void 0:e.toUpperCase(),this.mode=this.cacheMode,this.fileInput=this.element.querySelector(Jn.fileInput),this.avatarContent=this.element.querySelector(Jn.avatarContent),this.buttonChange=this.element.querySelector(Jn.buttonChange),this.buttonRemove=this.element.querySelector(Jn.buttonRemove),this.avatarLabel=this.element.getAttribute(Qn.avatarLabel),this.buttonLabelDefault=this.element.getAttribute(Qn.buttonLabelDefault),this.buttonLabelChange=this.element.getAttribute(Qn.buttonLabelChange),this.buttonLabelRemove=this.element.getAttribute(Qn.buttonLabelRemove),this.ext=JSON.parse(this.element.getAttribute(Qn.ext)||"[]"),this.sizeLimit=parseInt(this.element.getAttribute(Qn.sizeLimit)||`${N1}`),this.hiddenInput=null,this.addListeners()}static visibleButtonWithText(t,e){t.classList.add(la.buttonVisible);const n=t.querySelector(Jn.buttonLabel);n.textContent=e}changeMode(t){switch(this.mode=t,this.mode){case"CHANGE":{this.buttonRemove.classList.remove(la.buttonVisible),Hr.visibleButtonWithText(this.buttonChange,this.buttonLabelChange);break}case"REMOVE":{this.buttonChange.classList.remove(la.buttonVisible),Hr.visibleButtonWithText(this.buttonRemove,this.buttonLabelRemove);break}default:this.buttonRemove.classList.remove(la.buttonVisible),Hr.visibleButtonWithText(this.buttonChange,this.buttonLabelDefault);break}}onChange(){var r;const t=this.element.querySelector(Jn.avatarImage),[e]=Array.from(this.fileInput.files||[]),n=URL.createObjectURL(e);if(!this.isValidFile(e))return;if(this.changeMode(this.cacheMode),(r=this.hiddenInput)==null||r.remove(),this.hiddenInput=null,t){t.src=n;return}const s=document.createElement("div");s.innerHTML=B1(n),this.avatarContent.replaceChildren(),this.avatarContent.appendChild(s.firstElementChild)}onRemove(){this.changeMode("CHOOSE"),this.setInputFile(null);const t=document.createElement("div");t.innerHTML=V1(),this.avatarContent.replaceChildren(),this.avatarContent.appendChild(t.firstElementChild),this.hiddenInput=document.createElement("input"),this.hiddenInput.setAttribute("name",`${this.fileInput.name}_remove`),this.hiddenInput.setAttribute("type","hidden"),this.hiddenInput.setAttribute("value","1"),this.element.appendChild(this.hiddenInput)}isValidFile(t){const e=t.size/1048576,n=t.name.slice((Math.max(0,t.name.lastIndexOf("."))||1/0)+1);return e>this.sizeLimit?(Pn.push({title:"File size exceeds acceptable size",content:`The file "${t.name}" exceeds ${this.sizeLimit}Mb`,style:"alert"}),!1):this.ext.length&&!this.ext.includes(n)?(Pn.push({title:`Incorrect file extension "${n}"`,content:`Allowed file extensions are ${this.ext.join(", ")}`,style:"alert"}),!1):!0}setInputFile(t){const e=new DataTransfer;t&&e.items.add(t),this.fileInput.files=e.files}async loadFile(t){return fetch(t.getAttribute("src"),{mode:"no-cors"}).then(e=>e.blob()).then(e=>new File([e],t.getAttribute("alt")||"",e))}async init(){const t=this.element.querySelector(Jn.avatarImage);if(t){const e=await this.loadFile(t);this.setInputFile(e)}}addListeners(){this.fileInput.addEventListener("change",this.onChange.bind(this)),this.buttonRemove.addEventListener("click",this.onRemove.bind(this))}}var ei="top",vi="bottom",_i="right",ii="left",mh="auto",mo=[ei,vi,_i,ii],Us="start",so="end",z1="clippingParents",yv="viewport",Tr="popper",$1="reference",Fp=mo.reduce(function(i,t){return i.concat([t+"-"+Us,t+"-"+so])},[]),bv=[].concat(mo,[mh]).reduce(function(i,t){return i.concat([t,t+"-"+Us,t+"-"+so])},[]),H1="beforeRead",j1="read",U1="afterRead",W1="beforeMain",q1="main",G1="afterMain",Z1="beforeWrite",Y1="write",K1="afterWrite",X1=[H1,j1,U1,W1,q1,G1,Z1,Y1,K1];function Ui(i){return i?(i.nodeName||"").toLowerCase():null}function li(i){if(i==null)return window;if(i.toString()!=="[object Window]"){var t=i.ownerDocument;return t&&t.defaultView||window}return i}function ps(i){var t=li(i).Element;return i instanceof t||i instanceof Element}function gi(i){var t=li(i).HTMLElement;return i instanceof t||i instanceof HTMLElement}function gh(i){if(typeof ShadowRoot>"u")return!1;var t=li(i).ShadowRoot;return i instanceof t||i instanceof ShadowRoot}function J1(i){var t=i.state;Object.keys(t.elements).forEach(function(e){var n=t.styles[e]||{},s=t.attributes[e]||{},r=t.elements[e];!gi(r)||!Ui(r)||(Object.assign(r.style,n),Object.keys(s).forEach(function(a){var l=s[a];l===!1?r.removeAttribute(a):r.setAttribute(a,l===!0?"":l)}))})}function Q1(i){var t=i.state,e={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,e.popper),t.styles=e,t.elements.arrow&&Object.assign(t.elements.arrow.style,e.arrow),function(){Object.keys(t.elements).forEach(function(n){var s=t.elements[n],r=t.attributes[n]||{},a=Object.keys(t.styles.hasOwnProperty(n)?t.styles[n]:e[n]),l=a.reduce(function(h,c){return h[c]="",h},{});!gi(s)||!Ui(s)||(Object.assign(s.style,l),Object.keys(r).forEach(function(h){s.removeAttribute(h)}))})}}const wv={name:"applyStyles",enabled:!0,phase:"write",fn:J1,effect:Q1,requires:["computeStyles"]};function ji(i){return i.split("-")[0]}var cs=Math.max,Ya=Math.min,Ws=Math.round;function Eu(){var i=navigator.userAgentData;return i!=null&&i.brands&&Array.isArray(i.brands)?i.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function xv(){return!/^((?!chrome|android).)*safari/i.test(Eu())}function qs(i,t,e){t===void 0&&(t=!1),e===void 0&&(e=!1);var n=i.getBoundingClientRect(),s=1,r=1;t&&gi(i)&&(s=i.offsetWidth>0&&Ws(n.width)/i.offsetWidth||1,r=i.offsetHeight>0&&Ws(n.height)/i.offsetHeight||1);var a=ps(i)?li(i):window,l=a.visualViewport,h=!xv()&&e,c=(n.left+(h&&l?l.offsetLeft:0))/s,d=(n.top+(h&&l?l.offsetTop:0))/r,p=n.width/s,g=n.height/r;return{width:p,height:g,top:d,right:c+p,bottom:d+g,left:c,x:c,y:d}}function vh(i){var t=qs(i),e=i.offsetWidth,n=i.offsetHeight;return Math.abs(t.width-e)<=1&&(e=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:i.offsetLeft,y:i.offsetTop,width:e,height:n}}function Sv(i,t){var e=t.getRootNode&&t.getRootNode();if(i.contains(t))return!0;if(e&&gh(e)){var n=t;do{if(n&&i.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function dn(i){return li(i).getComputedStyle(i)}function tL(i){return["table","td","th"].indexOf(Ui(i))>=0}function Bn(i){return((ps(i)?i.ownerDocument:i.document)||window.document).documentElement}function gl(i){return Ui(i)==="html"?i:i.assignedSlot||i.parentNode||(gh(i)?i.host:null)||Bn(i)}function Rp(i){return!gi(i)||dn(i).position==="fixed"?null:i.offsetParent}function eL(i){var t=/firefox/i.test(Eu()),e=/Trident/i.test(Eu());if(e&&gi(i)){var n=dn(i);if(n.position==="fixed")return null}var s=gl(i);for(gh(s)&&(s=s.host);gi(s)&&["html","body"].indexOf(Ui(s))<0;){var r=dn(s);if(r.transform!=="none"||r.perspective!=="none"||r.contain==="paint"||["transform","perspective"].indexOf(r.willChange)!==-1||t&&r.willChange==="filter"||t&&r.filter&&r.filter!=="none")return s;s=s.parentNode}return null}function go(i){for(var t=li(i),e=Rp(i);e&&tL(e)&&dn(e).position==="static";)e=Rp(e);return e&&(Ui(e)==="html"||Ui(e)==="body"&&dn(e).position==="static")?t:e||eL(i)||t}function _h(i){return["top","bottom"].indexOf(i)>=0?"x":"y"}function jr(i,t,e){return cs(i,Ya(t,e))}function iL(i,t,e){var n=jr(i,t,e);return n>e?e:n}function kv(){return{top:0,right:0,bottom:0,left:0}}function Ev(i){return Object.assign({},kv(),i)}function Cv(i,t){return t.reduce(function(e,n){return e[n]=i,e},{})}var nL=function(t,e){return t=typeof t=="function"?t(Object.assign({},e.rects,{placement:e.placement})):t,Ev(typeof t!="number"?t:Cv(t,mo))};function sL(i){var t,e=i.state,n=i.name,s=i.options,r=e.elements.arrow,a=e.modifiersData.popperOffsets,l=ji(e.placement),h=_h(l),c=[ii,_i].indexOf(l)>=0,d=c?"height":"width";if(!(!r||!a)){var p=nL(s.padding,e),g=vh(r),v=h==="y"?ei:ii,b=h==="y"?vi:_i,_=e.rects.reference[d]+e.rects.reference[h]-a[h]-e.rects.popper[d],w=a[h]-e.rects.reference[h],T=go(r),S=T?h==="y"?T.clientHeight||0:T.clientWidth||0:0,C=_/2-w/2,x=p[v],D=S-g[d]-p[b],V=S/2-g[d]/2+C,$=jr(x,V,D),K=h;e.modifiersData[n]=(t={},t[K]=$,t.centerOffset=$-V,t)}}function rL(i){var t=i.state,e=i.options,n=e.element,s=n===void 0?"[data-popper-arrow]":n;s!=null&&(typeof s=="string"&&(s=t.elements.popper.querySelector(s),!s)||Sv(t.elements.popper,s)&&(t.elements.arrow=s))}const oL={name:"arrow",enabled:!0,phase:"main",fn:sL,effect:rL,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Gs(i){return i.split("-")[1]}var aL={top:"auto",right:"auto",bottom:"auto",left:"auto"};function lL(i,t){var e=i.x,n=i.y,s=t.devicePixelRatio||1;return{x:Ws(e*s)/s||0,y:Ws(n*s)/s||0}}function Bp(i){var t,e=i.popper,n=i.popperRect,s=i.placement,r=i.variation,a=i.offsets,l=i.position,h=i.gpuAcceleration,c=i.adaptive,d=i.roundOffsets,p=i.isFixed,g=a.x,v=g===void 0?0:g,b=a.y,_=b===void 0?0:b,w=typeof d=="function"?d({x:v,y:_}):{x:v,y:_};v=w.x,_=w.y;var T=a.hasOwnProperty("x"),S=a.hasOwnProperty("y"),C=ii,x=ei,D=window;if(c){var V=go(e),$="clientHeight",K="clientWidth";if(V===li(e)&&(V=Bn(e),dn(V).position!=="static"&&l==="absolute"&&($="scrollHeight",K="scrollWidth")),V=V,s===ei||(s===ii||s===_i)&&r===so){x=vi;var q=p&&V===D&&D.visualViewport?D.visualViewport.height:V[$];_-=q-n.height,_*=h?1:-1}if(s===ii||(s===ei||s===vi)&&r===so){C=_i;var rt=p&&V===D&&D.visualViewport?D.visualViewport.width:V[K];v-=rt-n.width,v*=h?1:-1}}var z=Object.assign({position:l},c&&aL),tt=d===!0?lL({x:v,y:_},li(e)):{x:v,y:_};if(v=tt.x,_=tt.y,h){var ot;return Object.assign({},z,(ot={},ot[x]=S?"0":"",ot[C]=T?"0":"",ot.transform=(D.devicePixelRatio||1)<=1?"translate("+v+"px, "+_+"px)":"translate3d("+v+"px, "+_+"px, 0)",ot))}return Object.assign({},z,(t={},t[x]=S?_+"px":"",t[C]=T?v+"px":"",t.transform="",t))}function cL(i){var t=i.state,e=i.options,n=e.gpuAcceleration,s=n===void 0?!0:n,r=e.adaptive,a=r===void 0?!0:r,l=e.roundOffsets,h=l===void 0?!0:l,c={placement:ji(t.placement),variation:Gs(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:s,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Bp(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:h})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Bp(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:h})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const uL={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:cL,data:{}};var ca={passive:!0};function hL(i){var t=i.state,e=i.instance,n=i.options,s=n.scroll,r=s===void 0?!0:s,a=n.resize,l=a===void 0?!0:a,h=li(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return r&&c.forEach(function(d){d.addEventListener("scroll",e.update,ca)}),l&&h.addEventListener("resize",e.update,ca),function(){r&&c.forEach(function(d){d.removeEventListener("scroll",e.update,ca)}),l&&h.removeEventListener("resize",e.update,ca)}}const dL={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:hL,data:{}};var fL={left:"right",right:"left",bottom:"top",top:"bottom"};function La(i){return i.replace(/left|right|bottom|top/g,function(t){return fL[t]})}var pL={start:"end",end:"start"};function Vp(i){return i.replace(/start|end/g,function(t){return pL[t]})}function yh(i){var t=li(i),e=t.pageXOffset,n=t.pageYOffset;return{scrollLeft:e,scrollTop:n}}function bh(i){return qs(Bn(i)).left+yh(i).scrollLeft}function mL(i,t){var e=li(i),n=Bn(i),s=e.visualViewport,r=n.clientWidth,a=n.clientHeight,l=0,h=0;if(s){r=s.width,a=s.height;var c=xv();(c||!c&&t==="fixed")&&(l=s.offsetLeft,h=s.offsetTop)}return{width:r,height:a,x:l+bh(i),y:h}}function gL(i){var t,e=Bn(i),n=yh(i),s=(t=i.ownerDocument)==null?void 0:t.body,r=cs(e.scrollWidth,e.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),a=cs(e.scrollHeight,e.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),l=-n.scrollLeft+bh(i),h=-n.scrollTop;return dn(s||e).direction==="rtl"&&(l+=cs(e.clientWidth,s?s.clientWidth:0)-r),{width:r,height:a,x:l,y:h}}function wh(i){var t=dn(i),e=t.overflow,n=t.overflowX,s=t.overflowY;return/auto|scroll|overlay|hidden/.test(e+s+n)}function Tv(i){return["html","body","#document"].indexOf(Ui(i))>=0?i.ownerDocument.body:gi(i)&&wh(i)?i:Tv(gl(i))}function Ur(i,t){var e;t===void 0&&(t=[]);var n=Tv(i),s=n===((e=i.ownerDocument)==null?void 0:e.body),r=li(n),a=s?[r].concat(r.visualViewport||[],wh(n)?n:[]):n,l=t.concat(a);return s?l:l.concat(Ur(gl(a)))}function Cu(i){return Object.assign({},i,{left:i.x,top:i.y,right:i.x+i.width,bottom:i.y+i.height})}function vL(i,t){var e=qs(i,!1,t==="fixed");return e.top=e.top+i.clientTop,e.left=e.left+i.clientLeft,e.bottom=e.top+i.clientHeight,e.right=e.left+i.clientWidth,e.width=i.clientWidth,e.height=i.clientHeight,e.x=e.left,e.y=e.top,e}function Np(i,t,e){return t===yv?Cu(mL(i,e)):ps(t)?vL(t,e):Cu(gL(Bn(i)))}function _L(i){var t=Ur(gl(i)),e=["absolute","fixed"].indexOf(dn(i).position)>=0,n=e&&gi(i)?go(i):i;return ps(n)?t.filter(function(s){return ps(s)&&Sv(s,n)&&Ui(s)!=="body"}):[]}function yL(i,t,e,n){var s=t==="clippingParents"?_L(i):[].concat(t),r=[].concat(s,[e]),a=r[0],l=r.reduce(function(h,c){var d=Np(i,c,n);return h.top=cs(d.top,h.top),h.right=Ya(d.right,h.right),h.bottom=Ya(d.bottom,h.bottom),h.left=cs(d.left,h.left),h},Np(i,a,n));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function Mv(i){var t=i.reference,e=i.element,n=i.placement,s=n?ji(n):null,r=n?Gs(n):null,a=t.x+t.width/2-e.width/2,l=t.y+t.height/2-e.height/2,h;switch(s){case ei:h={x:a,y:t.y-e.height};break;case vi:h={x:a,y:t.y+t.height};break;case _i:h={x:t.x+t.width,y:l};break;case ii:h={x:t.x-e.width,y:l};break;default:h={x:t.x,y:t.y}}var c=s?_h(s):null;if(c!=null){var d=c==="y"?"height":"width";switch(r){case Us:h[c]=h[c]-(t[d]/2-e[d]/2);break;case so:h[c]=h[c]+(t[d]/2-e[d]/2);break}}return h}function ro(i,t){t===void 0&&(t={});var e=t,n=e.placement,s=n===void 0?i.placement:n,r=e.strategy,a=r===void 0?i.strategy:r,l=e.boundary,h=l===void 0?z1:l,c=e.rootBoundary,d=c===void 0?yv:c,p=e.elementContext,g=p===void 0?Tr:p,v=e.altBoundary,b=v===void 0?!1:v,_=e.padding,w=_===void 0?0:_,T=Ev(typeof w!="number"?w:Cv(w,mo)),S=g===Tr?$1:Tr,C=i.rects.popper,x=i.elements[b?S:g],D=yL(ps(x)?x:x.contextElement||Bn(i.elements.popper),h,d,a),V=qs(i.elements.reference),$=Mv({reference:V,element:C,strategy:"absolute",placement:s}),K=Cu(Object.assign({},C,$)),q=g===Tr?K:V,rt={top:D.top-q.top+T.top,bottom:q.bottom-D.bottom+T.bottom,left:D.left-q.left+T.left,right:q.right-D.right+T.right},z=i.modifiersData.offset;if(g===Tr&&z){var tt=z[s];Object.keys(rt).forEach(function(ot){var it=[_i,vi].indexOf(ot)>=0?1:-1,G=[ei,vi].indexOf(ot)>=0?"y":"x";rt[ot]+=tt[G]*it})}return rt}function bL(i,t){t===void 0&&(t={});var e=t,n=e.placement,s=e.boundary,r=e.rootBoundary,a=e.padding,l=e.flipVariations,h=e.allowedAutoPlacements,c=h===void 0?bv:h,d=Gs(n),p=d?l?Fp:Fp.filter(function(b){return Gs(b)===d}):mo,g=p.filter(function(b){return c.indexOf(b)>=0});g.length===0&&(g=p);var v=g.reduce(function(b,_){return b[_]=ro(i,{placement:_,boundary:s,rootBoundary:r,padding:a})[ji(_)],b},{});return Object.keys(v).sort(function(b,_){return v[b]-v[_]})}function wL(i){if(ji(i)===mh)return[];var t=La(i);return[Vp(i),t,Vp(t)]}function xL(i){var t=i.state,e=i.options,n=i.name;if(!t.modifiersData[n]._skip){for(var s=e.mainAxis,r=s===void 0?!0:s,a=e.altAxis,l=a===void 0?!0:a,h=e.fallbackPlacements,c=e.padding,d=e.boundary,p=e.rootBoundary,g=e.altBoundary,v=e.flipVariations,b=v===void 0?!0:v,_=e.allowedAutoPlacements,w=t.options.placement,T=ji(w),S=T===w,C=h||(S||!b?[La(w)]:wL(w)),x=[w].concat(C).reduce(function(ct,bt){return ct.concat(ji(bt)===mh?bL(t,{placement:bt,boundary:d,rootBoundary:p,padding:c,flipVariations:b,allowedAutoPlacements:_}):bt)},[]),D=t.rects.reference,V=t.rects.popper,$=new Map,K=!0,q=x[0],rt=0;rt=0,G=it?"width":"height",Z=ro(t,{placement:z,boundary:d,rootBoundary:p,altBoundary:g,padding:c}),st=it?ot?_i:ii:ot?vi:ei;D[G]>V[G]&&(st=La(st));var W=La(st),dt=[];if(r&&dt.push(Z[tt]<=0),l&&dt.push(Z[st]<=0,Z[W]<=0),dt.every(function(ct){return ct})){q=z,K=!1;break}$.set(z,dt)}if(K)for(var nt=b?3:1,vt=function(bt){var yt=x.find(function(Wt){var Pt=$.get(Wt);if(Pt)return Pt.slice(0,bt).every(function(J){return J})});if(yt)return q=yt,"break"},kt=nt;kt>0;kt--){var Mt=vt(kt);if(Mt==="break")break}t.placement!==q&&(t.modifiersData[n]._skip=!0,t.placement=q,t.reset=!0)}}const SL={name:"flip",enabled:!0,phase:"main",fn:xL,requiresIfExists:["offset"],data:{_skip:!1}};function zp(i,t,e){return e===void 0&&(e={x:0,y:0}),{top:i.top-t.height-e.y,right:i.right-t.width+e.x,bottom:i.bottom-t.height+e.y,left:i.left-t.width-e.x}}function $p(i){return[ei,_i,vi,ii].some(function(t){return i[t]>=0})}function kL(i){var t=i.state,e=i.name,n=t.rects.reference,s=t.rects.popper,r=t.modifiersData.preventOverflow,a=ro(t,{elementContext:"reference"}),l=ro(t,{altBoundary:!0}),h=zp(a,n),c=zp(l,s,r),d=$p(h),p=$p(c);t.modifiersData[e]={referenceClippingOffsets:h,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":p})}const EL={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:kL};function CL(i,t,e){var n=ji(i),s=[ii,ei].indexOf(n)>=0?-1:1,r=typeof e=="function"?e(Object.assign({},t,{placement:i})):e,a=r[0],l=r[1];return a=a||0,l=(l||0)*s,[ii,_i].indexOf(n)>=0?{x:l,y:a}:{x:a,y:l}}function TL(i){var t=i.state,e=i.options,n=i.name,s=e.offset,r=s===void 0?[0,0]:s,a=bv.reduce(function(d,p){return d[p]=CL(p,t.rects,r),d},{}),l=a[t.placement],h=l.x,c=l.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=h,t.modifiersData.popperOffsets.y+=c),t.modifiersData[n]=a}const ML={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:TL};function LL(i){var t=i.state,e=i.name;t.modifiersData[e]=Mv({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const AL={name:"popperOffsets",enabled:!0,phase:"read",fn:LL,data:{}};function DL(i){return i==="x"?"y":"x"}function PL(i){var t=i.state,e=i.options,n=i.name,s=e.mainAxis,r=s===void 0?!0:s,a=e.altAxis,l=a===void 0?!1:a,h=e.boundary,c=e.rootBoundary,d=e.altBoundary,p=e.padding,g=e.tether,v=g===void 0?!0:g,b=e.tetherOffset,_=b===void 0?0:b,w=ro(t,{boundary:h,rootBoundary:c,padding:p,altBoundary:d}),T=ji(t.placement),S=Gs(t.placement),C=!S,x=_h(T),D=DL(x),V=t.modifiersData.popperOffsets,$=t.rects.reference,K=t.rects.popper,q=typeof _=="function"?_(Object.assign({},t.rects,{placement:t.placement})):_,rt=typeof q=="number"?{mainAxis:q,altAxis:q}:Object.assign({mainAxis:0,altAxis:0},q),z=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,tt={x:0,y:0};if(V){if(r){var ot,it=x==="y"?ei:ii,G=x==="y"?vi:_i,Z=x==="y"?"height":"width",st=V[x],W=st+w[it],dt=st-w[G],nt=v?-K[Z]/2:0,vt=S===Us?$[Z]:K[Z],kt=S===Us?-K[Z]:-$[Z],Mt=t.elements.arrow,ct=v&&Mt?vh(Mt):{width:0,height:0},bt=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:kv(),yt=bt[it],Wt=bt[G],Pt=jr(0,$[Z],ct[Z]),J=C?$[Z]/2-nt-Pt-yt-rt.mainAxis:vt-Pt-yt-rt.mainAxis,O=C?-$[Z]/2+nt+Pt+Wt+rt.mainAxis:kt+Pt+Wt+rt.mainAxis,k=t.elements.arrow&&go(t.elements.arrow),A=k?x==="y"?k.clientTop||0:k.clientLeft||0:0,M=(ot=z==null?void 0:z[x])!=null?ot:0,B=st+J-M-A,R=st+O-M,I=jr(v?Ya(W,B):W,st,v?cs(dt,R):dt);V[x]=I,tt[x]=I-st}if(l){var H,X=x==="x"?ei:ii,ut=x==="x"?vi:_i,gt=V[D],_t=D==="y"?"height":"width",St=gt+w[X],Ct=gt-w[ut],ee=[ei,ii].indexOf(T)!==-1,Jt=(H=z==null?void 0:z[D])!=null?H:0,Oe=ee?St:gt-$[_t]-K[_t]-Jt+rt.altAxis,Ie=ee?gt+$[_t]+K[_t]-Jt-rt.altAxis:Ct,Le=v&&ee?iL(Oe,gt,Ie):jr(v?Oe:St,gt,v?Ie:Ct);V[D]=Le,tt[D]=Le-gt}t.modifiersData[n]=tt}}const OL={name:"preventOverflow",enabled:!0,phase:"main",fn:PL,requiresIfExists:["offset"]};function IL(i){return{scrollLeft:i.scrollLeft,scrollTop:i.scrollTop}}function FL(i){return i===li(i)||!gi(i)?yh(i):IL(i)}function RL(i){var t=i.getBoundingClientRect(),e=Ws(t.width)/i.offsetWidth||1,n=Ws(t.height)/i.offsetHeight||1;return e!==1||n!==1}function BL(i,t,e){e===void 0&&(e=!1);var n=gi(t),s=gi(t)&&RL(t),r=Bn(t),a=qs(i,s,e),l={scrollLeft:0,scrollTop:0},h={x:0,y:0};return(n||!n&&!e)&&((Ui(t)!=="body"||wh(r))&&(l=FL(t)),gi(t)?(h=qs(t,!0),h.x+=t.clientLeft,h.y+=t.clientTop):r&&(h.x=bh(r))),{x:a.left+l.scrollLeft-h.x,y:a.top+l.scrollTop-h.y,width:a.width,height:a.height}}function VL(i){var t=new Map,e=new Set,n=[];i.forEach(function(r){t.set(r.name,r)});function s(r){e.add(r.name);var a=[].concat(r.requires||[],r.requiresIfExists||[]);a.forEach(function(l){if(!e.has(l)){var h=t.get(l);h&&s(h)}}),n.push(r)}return i.forEach(function(r){e.has(r.name)||s(r)}),n}function NL(i){var t=VL(i);return X1.reduce(function(e,n){return e.concat(t.filter(function(s){return s.phase===n}))},[])}function zL(i){var t;return function(){return t||(t=new Promise(function(e){Promise.resolve().then(function(){t=void 0,e(i())})})),t}}function $L(i){var t=i.reduce(function(e,n){var s=e[n.name];return e[n.name]=s?Object.assign({},s,n,{options:Object.assign({},s.options,n.options),data:Object.assign({},s.data,n.data)}):n,e},{});return Object.keys(t).map(function(e){return t[e]})}var Hp={placement:"bottom",modifiers:[],strategy:"absolute"};function jp(){for(var i=arguments.length,t=new Array(i),e=0;e-1}function Ov(i,t){return typeof i=="function"?i.apply(void 0,t):i}function Up(i,t){if(t===0)return i;var e;return function(n){clearTimeout(e),e=setTimeout(function(){i(n)},t)}}function GL(i){return i.split(/\s+/).filter(Boolean)}function Os(i){return[].concat(i)}function Wp(i,t){i.indexOf(t)===-1&&i.push(t)}function ZL(i){return i.filter(function(t,e){return i.indexOf(t)===e})}function YL(i){return i.split("-")[0]}function Ka(i){return[].slice.call(i)}function qp(i){return Object.keys(i).reduce(function(t,e){return i[e]!==void 0&&(t[e]=i[e]),t},{})}function Wr(){return document.createElement("div")}function vl(i){return["Element","Fragment"].some(function(t){return xh(i,t)})}function KL(i){return xh(i,"NodeList")}function XL(i){return xh(i,"MouseEvent")}function JL(i){return!!(i&&i._tippy&&i._tippy.reference===i)}function QL(i){return vl(i)?[i]:KL(i)?Ka(i):Array.isArray(i)?i:Ka(document.querySelectorAll(i))}function Fc(i,t){i.forEach(function(e){e&&(e.style.transitionDuration=t+"ms")})}function Gp(i,t){i.forEach(function(e){e&&e.setAttribute("data-state",t)})}function tA(i){var t,e=Os(i),n=e[0];return n!=null&&(t=n.ownerDocument)!=null&&t.body?n.ownerDocument:document}function eA(i,t){var e=t.clientX,n=t.clientY;return i.every(function(s){var r=s.popperRect,a=s.popperState,l=s.props,h=l.interactiveBorder,c=YL(a.placement),d=a.modifiersData.offset;if(!d)return!0;var p=c==="bottom"?d.top.y:0,g=c==="top"?d.bottom.y:0,v=c==="right"?d.left.x:0,b=c==="left"?d.right.x:0,_=r.top-n+p>h,w=n-r.bottom-g>h,T=r.left-e+v>h,S=e-r.right-b>h;return _||w||T||S})}function Rc(i,t,e){var n=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(s){i[n](s,e)})}function Zp(i,t){for(var e=t;e;){var n;if(i.contains(e))return!0;e=e.getRootNode==null||(n=e.getRootNode())==null?void 0:n.host}return!1}var Ni={isTouch:!1},Yp=0;function iA(){Ni.isTouch||(Ni.isTouch=!0,window.performance&&document.addEventListener("mousemove",Iv))}function Iv(){var i=performance.now();i-Yp<20&&(Ni.isTouch=!1,document.removeEventListener("mousemove",Iv)),Yp=i}function nA(){var i=document.activeElement;if(JL(i)){var t=i._tippy;i.blur&&!t.state.isVisible&&i.blur()}}function sA(){document.addEventListener("touchstart",iA,is),window.addEventListener("blur",nA)}var rA=typeof window<"u"&&typeof document<"u",oA=rA?!!window.msCrypto:!1,aA={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},lA={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Ci=Object.assign({appendTo:Pv,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},aA,lA),cA=Object.keys(Ci),uA=function(t){var e=Object.keys(t);e.forEach(function(n){Ci[n]=t[n]})};function Fv(i){var t=i.plugins||[],e=t.reduce(function(n,s){var r=s.name,a=s.defaultValue;if(r){var l;n[r]=i[r]!==void 0?i[r]:(l=Ci[r])!=null?l:a}return n},{});return Object.assign({},i,e)}function hA(i,t){var e=t?Object.keys(Fv(Object.assign({},Ci,{plugins:t}))):cA,n=e.reduce(function(s,r){var a=(i.getAttribute("data-tippy-"+r)||"").trim();if(!a)return s;if(r==="content")s[r]=a;else try{s[r]=JSON.parse(a)}catch{s[r]=a}return s},{});return n}function Kp(i,t){var e=Object.assign({},t,{content:Ov(t.content,[i])},t.ignoreAttributes?{}:hA(i,t.plugins));return e.aria=Object.assign({},Ci.aria,e.aria),e.aria={expanded:e.aria.expanded==="auto"?t.interactive:e.aria.expanded,content:e.aria.content==="auto"?t.interactive?null:"describedby":e.aria.content},e}var dA=function(){return"innerHTML"};function Tu(i,t){i[dA()]=t}function Xp(i){var t=Wr();return i===!0?t.className=Av:(t.className=Dv,vl(i)?t.appendChild(i):Tu(t,i)),t}function Jp(i,t){vl(t.content)?(Tu(i,""),i.appendChild(t.content)):typeof t.content!="function"&&(t.allowHTML?Tu(i,t.content):i.textContent=t.content)}function Mu(i){var t=i.firstElementChild,e=Ka(t.children);return{box:t,content:e.find(function(n){return n.classList.contains(Lv)}),arrow:e.find(function(n){return n.classList.contains(Av)||n.classList.contains(Dv)}),backdrop:e.find(function(n){return n.classList.contains(qL)})}}function Rv(i){var t=Wr(),e=Wr();e.className=WL,e.setAttribute("data-state","hidden"),e.setAttribute("tabindex","-1");var n=Wr();n.className=Lv,n.setAttribute("data-state","hidden"),Jp(n,i.props),t.appendChild(e),e.appendChild(n),s(i.props,i.props);function s(r,a){var l=Mu(t),h=l.box,c=l.content,d=l.arrow;a.theme?h.setAttribute("data-theme",a.theme):h.removeAttribute("data-theme"),typeof a.animation=="string"?h.setAttribute("data-animation",a.animation):h.removeAttribute("data-animation"),a.inertia?h.setAttribute("data-inertia",""):h.removeAttribute("data-inertia"),h.style.maxWidth=typeof a.maxWidth=="number"?a.maxWidth+"px":a.maxWidth,a.role?h.setAttribute("role",a.role):h.removeAttribute("role"),(r.content!==a.content||r.allowHTML!==a.allowHTML)&&Jp(c,i.props),a.arrow?d?r.arrow!==a.arrow&&(h.removeChild(d),h.appendChild(Xp(a.arrow))):h.appendChild(Xp(a.arrow)):d&&h.removeChild(d)}return{popper:t,onUpdate:s}}Rv.$$tippy=!0;var fA=1,ua=[],Bc=[];function pA(i,t){var e=Kp(i,Object.assign({},Ci,Fv(qp(t)))),n,s,r,a=!1,l=!1,h=!1,c=!1,d,p,g,v=[],b=Up(B,e.interactiveDebounce),_,w=fA++,T=null,S=ZL(e.plugins),C={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},x={id:w,reference:i,popper:Wr(),popperInstance:T,props:e,state:C,plugins:S,clearDelayTimeouts:Oe,setProps:Ie,setContent:Le,show:He,hide:ye,hideWithInteractivity:Ge,enable:ee,disable:Jt,unmount:yi,destroy:bi};if(!e.render)return x;var D=e.render(x),V=D.popper,$=D.onUpdate;V.setAttribute("data-tippy-root",""),V.id="tippy-"+x.id,x.popper=V,i._tippy=x,V._tippy=x;var K=S.map(function(et){return et.fn(x)}),q=i.hasAttribute("aria-expanded");return k(),nt(),st(),W("onCreate",[x]),e.showOnCreate&&St(),V.addEventListener("mouseenter",function(){x.props.interactive&&x.state.isVisible&&x.clearDelayTimeouts()}),V.addEventListener("mouseleave",function(){x.props.interactive&&x.props.trigger.indexOf("mouseenter")>=0&&it().addEventListener("mousemove",b)}),x;function rt(){var et=x.props.touch;return Array.isArray(et)?et:[et,0]}function z(){return rt()[0]==="hold"}function tt(){var et;return!!((et=x.props.render)!=null&&et.$$tippy)}function ot(){return _||i}function it(){var et=ot().parentNode;return et?tA(et):document}function G(){return Mu(V)}function Z(et){return x.state.isMounted&&!x.state.isVisible||Ni.isTouch||d&&d.type==="focus"?0:Ic(x.props.delay,et?0:1,Ci.delay)}function st(et){et===void 0&&(et=!1),V.style.pointerEvents=x.props.interactive&&!et?"":"none",V.style.zIndex=""+x.props.zIndex}function W(et,Et,At){if(At===void 0&&(At=!0),K.forEach(function(Nt){Nt[et]&&Nt[et].apply(Nt,Et)}),At){var Ht;(Ht=x.props)[et].apply(Ht,Et)}}function dt(){var et=x.props.aria;if(et.content){var Et="aria-"+et.content,At=V.id,Ht=Os(x.props.triggerTarget||i);Ht.forEach(function(Nt){var ke=Nt.getAttribute(Et);if(x.state.isVisible)Nt.setAttribute(Et,ke?ke+" "+At:At);else{var Ae=ke&&ke.replace(At,"").trim();Ae?Nt.setAttribute(Et,Ae):Nt.removeAttribute(Et)}})}}function nt(){if(!(q||!x.props.aria.expanded)){var et=Os(x.props.triggerTarget||i);et.forEach(function(Et){x.props.interactive?Et.setAttribute("aria-expanded",x.state.isVisible&&Et===ot()?"true":"false"):Et.removeAttribute("aria-expanded")})}}function vt(){it().removeEventListener("mousemove",b),ua=ua.filter(function(et){return et!==b})}function kt(et){if(!(Ni.isTouch&&(h||et.type==="mousedown"))){var Et=et.composedPath&&et.composedPath()[0]||et.target;if(!(x.props.interactive&&Zp(V,Et))){if(Os(x.props.triggerTarget||i).some(function(At){return Zp(At,Et)})){if(Ni.isTouch||x.state.isVisible&&x.props.trigger.indexOf("click")>=0)return}else W("onClickOutside",[x,et]);x.props.hideOnClick===!0&&(x.clearDelayTimeouts(),x.hide(),l=!0,setTimeout(function(){l=!1}),x.state.isMounted||yt())}}}function Mt(){h=!0}function ct(){h=!1}function bt(){var et=it();et.addEventListener("mousedown",kt,!0),et.addEventListener("touchend",kt,is),et.addEventListener("touchstart",ct,is),et.addEventListener("touchmove",Mt,is)}function yt(){var et=it();et.removeEventListener("mousedown",kt,!0),et.removeEventListener("touchend",kt,is),et.removeEventListener("touchstart",ct,is),et.removeEventListener("touchmove",Mt,is)}function Wt(et,Et){J(et,function(){!x.state.isVisible&&V.parentNode&&V.parentNode.contains(V)&&Et()})}function Pt(et,Et){J(et,Et)}function J(et,Et){var At=G().box;function Ht(Nt){Nt.target===At&&(Rc(At,"remove",Ht),Et())}if(et===0)return Et();Rc(At,"remove",p),Rc(At,"add",Ht),p=Ht}function O(et,Et,At){At===void 0&&(At=!1);var Ht=Os(x.props.triggerTarget||i);Ht.forEach(function(Nt){Nt.addEventListener(et,Et,At),v.push({node:Nt,eventType:et,handler:Et,options:At})})}function k(){z()&&(O("touchstart",M,{passive:!0}),O("touchend",R,{passive:!0})),GL(x.props.trigger).forEach(function(et){if(et!=="manual")switch(O(et,M),et){case"mouseenter":O("mouseleave",R);break;case"focus":O(oA?"focusout":"blur",I);break;case"focusin":O("focusout",I);break}})}function A(){v.forEach(function(et){var Et=et.node,At=et.eventType,Ht=et.handler,Nt=et.options;Et.removeEventListener(At,Ht,Nt)}),v=[]}function M(et){var Et,At=!1;if(!(!x.state.isEnabled||H(et)||l)){var Ht=((Et=d)==null?void 0:Et.type)==="focus";d=et,_=et.currentTarget,nt(),!x.state.isVisible&&XL(et)&&ua.forEach(function(Nt){return Nt(et)}),et.type==="click"&&(x.props.trigger.indexOf("mouseenter")<0||a)&&x.props.hideOnClick!==!1&&x.state.isVisible?At=!0:St(et),et.type==="click"&&(a=!At),At&&!Ht&&Ct(et)}}function B(et){var Et=et.target,At=ot().contains(Et)||V.contains(Et);if(!(et.type==="mousemove"&&At)){var Ht=_t().concat(V).map(function(Nt){var ke,Ae=Nt._tippy,ui=(ke=Ae.popperInstance)==null?void 0:ke.state;return ui?{popperRect:Nt.getBoundingClientRect(),popperState:ui,props:e}:null}).filter(Boolean);eA(Ht,et)&&(vt(),Ct(et))}}function R(et){var Et=H(et)||x.props.trigger.indexOf("click")>=0&&a;if(!Et){if(x.props.interactive){x.hideWithInteractivity(et);return}Ct(et)}}function I(et){x.props.trigger.indexOf("focusin")<0&&et.target!==ot()||x.props.interactive&&et.relatedTarget&&V.contains(et.relatedTarget)||Ct(et)}function H(et){return Ni.isTouch?z()!==et.type.indexOf("touch")>=0:!1}function X(){ut();var et=x.props,Et=et.popperOptions,At=et.placement,Ht=et.offset,Nt=et.getReferenceClientRect,ke=et.moveTransition,Ae=tt()?Mu(V).arrow:null,ui=Nt?{getBoundingClientRect:Nt,contextElement:Nt.contextElement||ot()}:i,Vn={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(P){var N=P.state;if(tt()){var U=G(),lt=U.box;["placement","reference-hidden","escaped"].forEach(function(ht){ht==="placement"?lt.setAttribute("data-placement",N.placement):N.attributes.popper["data-popper-"+ht]?lt.setAttribute("data-"+ht,""):lt.removeAttribute("data-"+ht)}),N.attributes.popper={}}}},wi=[{name:"offset",options:{offset:Ht}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!ke}},Vn];tt()&&Ae&&wi.push({name:"arrow",options:{element:Ae,padding:3}}),wi.push.apply(wi,(Et==null?void 0:Et.modifiers)||[]),x.popperInstance=UL(ui,V,Object.assign({},Et,{placement:At,onFirstUpdate:g,modifiers:wi}))}function ut(){x.popperInstance&&(x.popperInstance.destroy(),x.popperInstance=null)}function gt(){var et=x.props.appendTo,Et,At=ot();x.props.interactive&&et===Pv||et==="parent"?Et=At.parentNode:Et=Ov(et,[At]),Et.contains(V)||Et.appendChild(V),x.state.isMounted=!0,X()}function _t(){return Ka(V.querySelectorAll("[data-tippy-root]"))}function St(et){x.clearDelayTimeouts(),et&&W("onTrigger",[x,et]),bt();var Et=Z(!0),At=rt(),Ht=At[0],Nt=At[1];Ni.isTouch&&Ht==="hold"&&Nt&&(Et=Nt),Et?n=setTimeout(function(){x.show()},Et):x.show()}function Ct(et){if(x.clearDelayTimeouts(),W("onUntrigger",[x,et]),!x.state.isVisible){yt();return}if(!(x.props.trigger.indexOf("mouseenter")>=0&&x.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(et.type)>=0&&a)){var Et=Z(!1);Et?s=setTimeout(function(){x.state.isVisible&&x.hide()},Et):r=requestAnimationFrame(function(){x.hide()})}}function ee(){x.state.isEnabled=!0}function Jt(){x.hide(),x.state.isEnabled=!1}function Oe(){clearTimeout(n),clearTimeout(s),cancelAnimationFrame(r)}function Ie(et){if(!x.state.isDestroyed){W("onBeforeUpdate",[x,et]),A();var Et=x.props,At=Kp(i,Object.assign({},Et,qp(et),{ignoreAttributes:!0}));x.props=At,k(),Et.interactiveDebounce!==At.interactiveDebounce&&(vt(),b=Up(B,At.interactiveDebounce)),Et.triggerTarget&&!At.triggerTarget?Os(Et.triggerTarget).forEach(function(Ht){Ht.removeAttribute("aria-expanded")}):At.triggerTarget&&i.removeAttribute("aria-expanded"),nt(),st(),$&&$(Et,At),x.popperInstance&&(X(),_t().forEach(function(Ht){requestAnimationFrame(Ht._tippy.popperInstance.forceUpdate)})),W("onAfterUpdate",[x,et])}}function Le(et){x.setProps({content:et})}function He(){var et=x.state.isVisible,Et=x.state.isDestroyed,At=!x.state.isEnabled,Ht=Ni.isTouch&&!x.props.touch,Nt=Ic(x.props.duration,0,Ci.duration);if(!(et||Et||At||Ht)&&!ot().hasAttribute("disabled")&&(W("onShow",[x],!1),x.props.onShow(x)!==!1)){if(x.state.isVisible=!0,tt()&&(V.style.visibility="visible"),st(),bt(),x.state.isMounted||(V.style.transition="none"),tt()){var ke=G(),Ae=ke.box,ui=ke.content;Fc([Ae,ui],0)}g=function(){var wi;if(!(!x.state.isVisible||c)){if(c=!0,V.offsetHeight,V.style.transition=x.props.moveTransition,tt()&&x.props.animation){var Ai=G(),P=Ai.box,N=Ai.content;Fc([P,N],Nt),Gp([P,N],"visible")}dt(),nt(),Wp(Bc,x),(wi=x.popperInstance)==null||wi.forceUpdate(),W("onMount",[x]),x.props.animation&&tt()&&Pt(Nt,function(){x.state.isShown=!0,W("onShown",[x])})}},gt()}}function ye(){var et=!x.state.isVisible,Et=x.state.isDestroyed,At=!x.state.isEnabled,Ht=Ic(x.props.duration,1,Ci.duration);if(!(et||Et||At)&&(W("onHide",[x],!1),x.props.onHide(x)!==!1)){if(x.state.isVisible=!1,x.state.isShown=!1,c=!1,a=!1,tt()&&(V.style.visibility="hidden"),vt(),yt(),st(!0),tt()){var Nt=G(),ke=Nt.box,Ae=Nt.content;x.props.animation&&(Fc([ke,Ae],Ht),Gp([ke,Ae],"hidden"))}dt(),nt(),x.props.animation?tt()&&Wt(Ht,x.unmount):x.unmount()}}function Ge(et){it().addEventListener("mousemove",b),Wp(ua,b),b(et)}function yi(){x.state.isVisible&&x.hide(),x.state.isMounted&&(ut(),_t().forEach(function(et){et._tippy.unmount()}),V.parentNode&&V.parentNode.removeChild(V),Bc=Bc.filter(function(et){return et!==x}),x.state.isMounted=!1,W("onHidden",[x]))}function bi(){x.state.isDestroyed||(x.clearDelayTimeouts(),x.unmount(),A(),delete i._tippy,x.state.isDestroyed=!0,W("onDestroy",[x]))}}function vo(i,t){t===void 0&&(t={});var e=Ci.plugins.concat(t.plugins||[]);sA();var n=Object.assign({},t,{plugins:e}),s=QL(i),r=s.reduce(function(a,l){var h=l&&pA(l,n);return h&&a.push(h),a},[]);return vl(i)?r[0]:r}vo.defaultProps=Ci;vo.setDefaultProps=uA;vo.currentInput=Ni;Object.assign({},wv,{effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow)}});vo.setDefaultProps({render:Rv});const Fs=class Fs extends Kt{constructor(t){super(t);const e=this.element.getAttribute(Fs.DATA_SET.content)||"",n=this.element.getAttribute(Fs.DATA_SET.position)||"top",s=!!this.element.getAttribute(Fs.DATA_SET.arrow);e&&(this.tippy=vo(this.element,{content:e,placement:n,arrow:!s,animation:"fade",theme:"light"}))}getInstance(){return this.tippy}};Fs.DATA_SET={content:"data-tooltip",position:"data-tooltip-position",arrow:"data-tooltip-disable-arrow"};let Lu=Fs;const Yt=class Yt extends Kt{constructor(t){super(t),this.lineBack=this.element.querySelector(Yt.SELECTORS.lineBack),this.lineFront=this.element.querySelector(Yt.SELECTORS.lineFront),this.valueBack=this.element.querySelector(Yt.SELECTORS.valueBack),this.valueFront=this.element.querySelector(Yt.SELECTORS.valueFront),this.content=this.element.getAttribute(Yt.DATA_SET.content),this.timeout=this.element.getAttribute(Yt.DATA_SET.timeout),this.currentTime=null,this.startValue=parseInt(this.element.getAttribute(Yt.DATA_SET.value)||"0"),this.value=this.startValue,this.startTime=0,this.endTime=0,this.animationId=0,this.intervalId=0,this.timeLeft=0,this.init(),this.addListeners()}static fixedTimePart(t){return`${t<10?`0${t.toFixed(0)}`:t.toFixed(0)}`}static convertMillisecondsToString(t){const e=Math.floor(t/Yt.TIMER_STEP/60),n=Math.floor(t/Yt.TIMER_STEP%60);return{minutes:e,seconds:n,out:`${Yt.fixedTimePart(e)}:${Yt.fixedTimePart(n)}`}}setParams(t){const{progress:e,timeout:n}=t,s=e>=0&&e<=100;if(!!this.timeout&&!n){console.error(`ProgressBar: Timeout must be provided. Expected "${n}"`);return}if(!s){console.error(`ProgressBar: Progress must be in range 0 - 100, but expected "${e}"`);return}this.value=e;const a=n||this.value;this.content?(this.valueBack.setAttribute(Yt.DATA_SET.value,`${this.content}`),this.valueFront.setAttribute(Yt.DATA_SET.value,`${this.content}`)):(this.valueBack.setAttribute(Yt.DATA_SET.value,`${a}`),this.valueFront.setAttribute(Yt.DATA_SET.value,`${a}`)),this.lineFront.style.width=`${this.value}%`}startTimer(){var t,e;this.currentTime&&(this.timeLeft=((t=this.currentTime)==null?void 0:t.minutes)*60*Yt.TIMER_STEP+((e=this.currentTime)==null?void 0:e.seconds)*Yt.TIMER_STEP,this.startTime=new Date().getTime(),this.endTime=new Date(this.startTime+this.timeLeft).getTime(),this.intervalId=setInterval(()=>{if(this.timeLeft===0){this.stopTimer();return}this.timeLeft-=Yt.TIMER_STEP;const n=new Date().getTime(),s=this.endTime-this.startTime,r=n-this.startTime,a=this.startValue-r/s*100/(100/this.startValue),l=Yt.convertMillisecondsToString(this.timeLeft).out,h=a<=0?0:a;this.setParams({progress:h,timeout:l})},Yt.TIMER_STEP))}stopTimer(){clearTimeout(this.intervalId)}fixValueWidthByContainer(){const t=this.element.getBoundingClientRect().width;this.valueBack.style.width=`${t}px`,this.valueFront.style.width=`${t}px`}init(){this.fixValueWidthByContainer(),this.timeout?(this.currentTime=Yt.convertMillisecondsToString(parseInt(this.timeout)*Yt.TIMER_STEP),this.setParams({progress:this.startValue,timeout:this.currentTime.out}),this.element.classList.remove(Yt.MODS.hiddenValue),this.startTimer()):this.content&&(this.valueBack.setAttribute(Yt.DATA_SET.value,`${this.content}`),this.valueFront.setAttribute(Yt.DATA_SET.value,`${this.content}`))}addListeners(){window.addEventListener("resize",this.fixValueWidthByContainer.bind(this)),document.addEventListener("dialog-open",this.fixValueWidthByContainer.bind(this))}};Yt.SELECTORS={lineBack:".__progress-bar-back-line__",lineFront:".__progress-bar-front-line__",valueBack:".__progress-bar-back-value__",valueFront:".__progress-bar-front-value__"},Yt.DATA_SET={timeout:"data-timeout",value:"data-value",content:"data-content"},Yt.MODS={hiddenValue:"progress-bar_hidden_value"},Yt.TIMER_STEP=1e3,Yt.FPS=60;let Au=Yt;const Rs=class Rs extends Kt{constructor(t){super(t),this.image=this.element.querySelector(Rs.SELECTORS.image),this.inputField=this.element.querySelector(Rs.SELECTORS.inputField),this.refreshIcon=this.element.querySelector(Rs.SELECTORS.refreshIcon),this.cacheImageSrc=this.image.getAttribute("src"),this.addListeners()}onRefresh(){const t=this.cacheImageSrc.indexOf("?")!==-1?"&":"?",e=(Math.random()+1).toString(36).substring(7);setTimeout(()=>this.inputField.blur()),this.image.setAttribute("src",`${this.cacheImageSrc}${t}rand=${e}`)}addListeners(){this.refreshIcon.addEventListener("click",this.onRefresh.bind(this))}};Rs.SELECTORS={image:".__captcha-input-image__",refreshIcon:".__input-suffix-icon__",inputField:".__input-field__"};let Du=Rs;const Ja=class Ja extends Kt{constructor(t){super(t),this.closeIcon=this.element.querySelector(Ja.SELECTORS.closeIcon),this.addListeners()}onClose(){this.element.remove()}addListeners(){var t;(t=this.closeIcon)==null||t.addEventListener("click",this.onClose.bind(this))}};Ja.SELECTORS={closeIcon:".__alert-icon-close__"};let Pu=Ja;class mA extends Kt{}const gA=Object.freeze(Object.defineProperty({__proto__:null,Alert:Pu,AsyncAutocompleteInput:Xc,AsyncMultiselectInput:Jc,AutocompleteInput:ju,AutocompleteMultiselectInput:zm,AvatarLoader:Hr,BurgerButton:$r,Button:ku,CaptchaInput:Du,Charts:M1,Chat:dk,ChatInput:hk,ChatTrigger:Px,Datepicker:bk,Droparea:Ax,FieldCloner:A1,FiltersForm:mA,Gallery:_b,Input:Gm,InputApply:Rw,InputCode:tu,InputGroupSwitcher:Tx,InputMax:Cx,InputRange:Sx,InputRangeSlider:xx,JSONStore:fm,Modal:yb,MultiselectInput:ww,ProductCard:vb,ProgressBar:Au,SelectInput:Gr,Table:O1,TableNative:I1,Toast:cw,Tooltip:Lu},Symbol.toStringTag,{value:"Module"})),Bs=class Bs extends Kt{constructor(t){super(t),this.categorySelectElements=this.element.querySelectorAll(Bs.SELECTORS.categoryForm),this.formCreateButtonElement=this.element.querySelector(Bs.SELECTORS.formCreateButton),this.formPaymentGroupElements=this.element.querySelectorAll(Bs.SELECTORS.formPaymentGroup),this.addListeners()}onChange(t){const n=t.target.value,s=`#listing-pay-group-${n}`,r=this.element.querySelector(s);console.log(this.formPaymentGroupElements.length,r,n,this.formCreateButtonElement),this.formPaymentGroupElements.forEach(a=>{a.style.display="none"}),r?(this.formCreateButtonElement.style.display="none",r.style.display="contents"):this.formCreateButtonElement.style.display="block"}addListeners(){this.categorySelectElements.forEach(t=>{if(t.addEventListener("change",this.onChange.bind(this)),t.checked){const e=new Event("change",{bubbles:!0});t.dispatchEvent(e)}})}};Bs.SELECTORS={categoryForm:'input[name="category_id"]',formCreateButton:"#product-create-button",formPaymentGroup:".listing-pay-group"};let Ou=Bs;const ki=class ki extends Kt{constructor(t){super(t),ki.initialized||(this.addListeners(),ki.initialized=!0)}getComponentImport(){return Livewire.all().filter(t=>t.name===ki.OPTIONS.componentImport)[0]}getComponentTable(){return Livewire.all().filter(t=>t.name===ki.OPTIONS.componentTable)[0]}addListeners(){Livewire.on(`${ki.OPTIONS.componentImport}.do-check`,t=>{this.getComponentTable().$wire.reloadData(),setTimeout(()=>this.getComponentImport().$wire.check(),ki.OPTIONS.checkInterval)}),Livewire.on(`${ki.OPTIONS.componentImport}.reload-table`,t=>{this.getComponentTable().$wire.reloadData()})}};ki.OPTIONS={componentImport:"store-import-ad-pickup-addresses",componentTable:"store-ad-pickup-addresses",checkInterval:5e3},ki.initialized=!1;let Iu=ki;const vA=Object.freeze(Object.defineProperty({__proto__:null,PickupImportForm:Iu,ProductCreateForm:Ou},Symbol.toStringTag,{value:"Module"})),Qp={init(){const i=document.getElementById("all-filters");i&&window.Livewire.hook("commit.prepare",({component:t})=>{i.close()}),this.filterPriceListener(),this.filterNumericListener(),this.filterQuantityListener()},filterPriceListener(){document.querySelectorAll('[id^="catalog-filter-price_"] .__input-apply-button__').forEach(t=>{t.addEventListener("click",e=>{setTimeout(()=>{const n=e.target.closest('[id^="catalog-filter-price_"]').querySelector(".__input-range-slider-value-from__"),s=e.target.closest('[id^="catalog-filter-price_"]').querySelector(".__input-range-slider-value-to__");this._getComponent().$wire.setFilterRangeValue(n.getAttribute("name"),s.getAttribute("name"),n.value,s.value)},100)})})},filterNumericListener(){const i=document.querySelector("#catalog-filter-numeric .__input-apply-button__");i&&i.addEventListener("click",()=>{setTimeout(()=>{const t=document.querySelector("#catalog-filter-numeric .__input-range-slider-value-from__"),e=document.querySelector("#catalog-filter-numeric .__input-range-slider-value-to__");this._getComponent().$wire.setFilterRangeValue(t.getAttribute("name"),e.getAttribute("name"),t.value,e.value)},100)})},filterQuantityListener(){document.querySelectorAll('[id^="catalog-filter-quantity_"] .__input-apply-button__').forEach(i=>{i.addEventListener("click",()=>{setTimeout(()=>{const t=i.closest('[id^="catalog-filter-quantity_"]').querySelector(".input-range-slider:not(.hidden)"),e=i.closest('[id^="catalog-filter-quantity_"]').querySelector(".select-input__value"),n=t.querySelector(".__input-range-slider-value-from__"),s=t.querySelector(".__input-range-slider-value-to__");this._getComponent().$wire.setFilterQuantityValue(e.getAttribute("name"),n.getAttribute("name"),s.getAttribute("name"),e.value,n.value,s.value)},100)})})},_getComponent(){const i=["catalog-offers-livewire","product-offers-livewire"];return Livewire.all().filter(t=>i.includes(t.name))[0]}},Bv={init(){document.querySelectorAll('.wallet-pay-form input[name="wallet"]').forEach(i=>{i.addEventListener("change",t=>{const e=t.target.closest(".wallet-pay-form");e.querySelectorAll(".wallet-pay-total").forEach(function(r){r.style.display="none"});const n=e.querySelector(`.wallet-pay-total[data-wallet="${t.target.value}"]`);n.style.display="grid";const s=t.target.closest("form").querySelector('button[type="submit"]');s.disabled=n.getAttribute("data-pay-allow")==="off"})})}};var Fu={exports:{}};/* @preserve * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade */(function(i,t){(function(e,n){n(t)})(cl,function(e){var n="1.9.4";function s(o){var u,f,m,y;for(f=1,m=arguments.length;f"u"||!L||!L.Mixin)){o=C(o)?o:[o];for(var u=0;u0?Math.floor(o):Math.ceil(o)};W.prototype={clone:function(){return new W(this.x,this.y)},add:function(o){return this.clone()._add(nt(o))},_add:function(o){return this.x+=o.x,this.y+=o.y,this},subtract:function(o){return this.clone()._subtract(nt(o))},_subtract:function(o){return this.x-=o.x,this.y-=o.y,this},divideBy:function(o){return this.clone()._divideBy(o)},_divideBy:function(o){return this.x/=o,this.y/=o,this},multiplyBy:function(o){return this.clone()._multiplyBy(o)},_multiplyBy:function(o){return this.x*=o,this.y*=o,this},scaleBy:function(o){return new W(this.x*o.x,this.y*o.y)},unscaleBy:function(o){return new W(this.x/o.x,this.y/o.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=dt(this.x),this.y=dt(this.y),this},distanceTo:function(o){o=nt(o);var u=o.x-this.x,f=o.y-this.y;return Math.sqrt(u*u+f*f)},equals:function(o){return o=nt(o),o.x===this.x&&o.y===this.y},contains:function(o){return o=nt(o),Math.abs(o.x)<=Math.abs(this.x)&&Math.abs(o.y)<=Math.abs(this.y)},toString:function(){return"Point("+g(this.x)+", "+g(this.y)+")"}};function nt(o,u,f){return o instanceof W?o:C(o)?new W(o[0],o[1]):o==null?o:typeof o=="object"&&"x"in o&&"y"in o?new W(o.x,o.y):new W(o,u,f)}function vt(o,u){if(o)for(var f=u?[o,u]:o,m=0,y=f.length;m=this.min.x&&f.x<=this.max.x&&u.y>=this.min.y&&f.y<=this.max.y},intersects:function(o){o=kt(o);var u=this.min,f=this.max,m=o.min,y=o.max,E=y.x>=u.x&&m.x<=f.x,F=y.y>=u.y&&m.y<=f.y;return E&&F},overlaps:function(o){o=kt(o);var u=this.min,f=this.max,m=o.min,y=o.max,E=y.x>u.x&&m.xu.y&&m.y=u.lat&&y.lat<=f.lat&&m.lng>=u.lng&&y.lng<=f.lng},intersects:function(o){o=ct(o);var u=this._southWest,f=this._northEast,m=o.getSouthWest(),y=o.getNorthEast(),E=y.lat>=u.lat&&m.lat<=f.lat,F=y.lng>=u.lng&&m.lng<=f.lng;return E&&F},overlaps:function(o){o=ct(o);var u=this._southWest,f=this._northEast,m=o.getSouthWest(),y=o.getNorthEast(),E=y.lat>u.lat&&m.latu.lng&&m.lng1,U=function(){var o=!1;try{var u=Object.defineProperty({},"passive",{get:function(){o=!0}});window.addEventListener("testPassiveEventSupport",p,u),window.removeEventListener("testPassiveEventSupport",p,u)}catch{}return o}(),lt=function(){return!!document.createElement("canvas").getContext}(),ht=!!(document.createElementNS&&R("svg").createSVGRect),ft=!!ht&&function(){var o=document.createElement("div");return o.innerHTML="",(o.firstChild&&o.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),Lt=!ht&&function(){try{var o=document.createElement("div");o.innerHTML='';var u=o.firstChild;return u.style.behavior="url(#default#VML)",u&&typeof u.adj=="object"}catch{return!1}}(),xt=navigator.platform.indexOf("Mac")===0,Qt=navigator.platform.indexOf("Linux")===0;function zt(o){return navigator.userAgent.toLowerCase().indexOf(o)>=0}var mt={ie:X,ielt9:ut,edge:gt,webkit:_t,android:St,android23:Ct,androidStock:Jt,opera:Oe,chrome:Ie,gecko:Le,safari:He,phantom:ye,opera12:Ge,win:yi,ie3d:bi,webkit3d:et,gecko3d:Et,any3d:At,mobile:Ht,mobileWebkit:Nt,mobileWebkit3d:ke,msPointer:Ae,pointer:ui,touch:wi,touchNative:Vn,mobileOpera:Ai,mobileGecko:P,retina:N,passiveEvents:U,canvas:lt,svg:ht,vml:Lt,inlineSvg:ft,mac:xt,linux:Qt},ne=mt.msPointer?"MSPointerDown":"pointerdown",qt=mt.msPointer?"MSPointerMove":"pointermove",de=mt.msPointer?"MSPointerUp":"pointerup",Ee=mt.msPointer?"MSPointerCancel":"pointercancel",pe={touchstart:ne,touchmove:qt,touchend:de,touchcancel:Ee},be={touchstart:Wv,touchmove:bo,touchend:bo,touchcancel:bo},Di={},_s=!1;function Qs(o,u,f){return u==="touchstart"&&Uv(),be[u]?(f=be[u].bind(this,f),o.addEventListener(pe[u],f,!1),f):(console.warn("wrong event specified:",u),p)}function _o(o,u,f){if(!pe[u]){console.warn("wrong event specified:",u);return}o.removeEventListener(pe[u],f,!1)}function tr(o){Di[o.pointerId]=o}function yo(o){Di[o.pointerId]&&(Di[o.pointerId]=o)}function er(o){delete Di[o.pointerId]}function Uv(){_s||(document.addEventListener(ne,tr,!0),document.addEventListener(qt,yo,!0),document.addEventListener(de,er,!0),document.addEventListener(Ee,er,!0),_s=!0)}function bo(o,u){if(u.pointerType!==(u.MSPOINTER_TYPE_MOUSE||"mouse")){u.touches=[];for(var f in Di)u.touches.push(Di[f]);u.changedTouches=[u],o(u)}}function Wv(o,u){u.MSPOINTER_TYPE_TOUCH&&u.pointerType===u.MSPOINTER_TYPE_TOUCH&&De(u),bo(o,u)}function qv(o){var u={},f,m;for(m in o)f=o[m],u[m]=f&&f.bind?f.bind(o):f;return o=u,u.type="dblclick",u.detail=2,u.isTrusted=!1,u._simulated=!0,u}var Gv=200;function Zv(o,u){o.addEventListener("dblclick",u);var f=0,m;function y(E){if(E.detail!==1){m=E.detail;return}if(!(E.pointerType==="mouse"||E.sourceCapabilities&&!E.sourceCapabilities.firesTouchEvents)){var F=Ah(E);if(!(F.some(function(Y){return Y instanceof HTMLLabelElement&&Y.attributes.for})&&!F.some(function(Y){return Y instanceof HTMLInputElement||Y instanceof HTMLSelectElement}))){var j=Date.now();j-f<=Gv?(m++,m===2&&u(qv(E))):m=1,f=j}}}return o.addEventListener("click",y),{dblclick:u,simDblclick:y}}function Yv(o,u){o.removeEventListener("dblclick",u.dblclick),o.removeEventListener("click",u.simDblclick)}var yl=So(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),ir=So(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),Ch=ir==="webkitTransition"||ir==="OTransition"?ir+"End":"transitionend";function Th(o){return typeof o=="string"?document.getElementById(o):o}function nr(o,u){var f=o.style[u]||o.currentStyle&&o.currentStyle[u];if((!f||f==="auto")&&document.defaultView){var m=document.defaultView.getComputedStyle(o,null);f=m?m[u]:null}return f==="auto"?null:f}function Zt(o,u,f){var m=document.createElement(o);return m.className=u||"",f&&f.appendChild(m),m}function fe(o){var u=o.parentNode;u&&u.removeChild(o)}function wo(o){for(;o.firstChild;)o.removeChild(o.firstChild)}function ys(o){var u=o.parentNode;u&&u.lastChild!==o&&u.appendChild(o)}function bs(o){var u=o.parentNode;u&&u.firstChild!==o&&u.insertBefore(o,u.firstChild)}function bl(o,u){if(o.classList!==void 0)return o.classList.contains(u);var f=xo(o);return f.length>0&&new RegExp("(^|\\s)"+u+"(\\s|$)").test(f)}function Bt(o,u){if(o.classList!==void 0)for(var f=b(u),m=0,y=f.length;m0?2*window.devicePixelRatio:1;function Ph(o){return mt.edge?o.wheelDeltaY/2:o.deltaY&&o.deltaMode===0?-o.deltaY/Jv:o.deltaY&&o.deltaMode===1?-o.deltaY*20:o.deltaY&&o.deltaMode===2?-o.deltaY*60:o.deltaX||o.deltaZ?0:o.wheelDelta?(o.wheelDeltaY||o.wheelDelta)/2:o.detail&&Math.abs(o.detail)<32765?-o.detail*20:o.detail?o.detail/-32765*60:0}function Pl(o,u){var f=u.relatedTarget;if(!f)return!0;try{for(;f&&f!==o;)f=f.parentNode}catch{return!1}return f!==o}var Qv={__proto__:null,on:It,off:se,stopPropagation:$n,disableScrollPropagation:Dl,disableClickPropagation:ar,preventDefault:De,stop:Hn,getPropagationPath:Ah,getMousePosition:Dh,getWheelDelta:Ph,isExternalTarget:Pl,addListener:It,removeListener:se},Oh=st.extend({run:function(o,u,f,m){this.stop(),this._el=o,this._inProgress=!0,this._duration=f||.25,this._easeOutPower=1/Math.max(m||.5,.2),this._startPos=zn(o),this._offset=u.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=z(this._animate,this),this._step()},_step:function(o){var u=+new Date-this._startTime,f=this._duration*1e3;uthis.options.maxZoom)?this.setZoom(o):this},panInsideBounds:function(o,u){this._enforcingBounds=!0;var f=this.getCenter(),m=this._limitCenter(f,this._zoom,ct(o));return f.equals(m)||this.panTo(m,u),this._enforcingBounds=!1,this},panInside:function(o,u){u=u||{};var f=nt(u.paddingTopLeft||u.padding||[0,0]),m=nt(u.paddingBottomRight||u.padding||[0,0]),y=this.project(this.getCenter()),E=this.project(o),F=this.getPixelBounds(),j=kt([F.min.add(f),F.max.subtract(m)]),Y=j.getSize();if(!j.contains(E)){this._enforcingBounds=!0;var at=E.subtract(j.getCenter()),wt=j.extend(E).getSize().subtract(Y);y.x+=at.x<0?-wt.x:wt.x,y.y+=at.y<0?-wt.y:wt.y,this.panTo(this.unproject(y),u),this._enforcingBounds=!1}return this},invalidateSize:function(o){if(!this._loaded)return this;o=s({animate:!1,pan:!0},o===!0?{animate:!0}:o);var u=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var f=this.getSize(),m=u.divideBy(2).round(),y=f.divideBy(2).round(),E=m.subtract(y);return!E.x&&!E.y?this:(o.animate&&o.pan?this.panBy(E):(o.pan&&this._rawPanBy(E),this.fire("move"),o.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(a(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:u,newSize:f}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(o){if(o=this._locateOptions=s({timeout:1e4,watch:!1},o),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var u=a(this._handleGeolocationResponse,this),f=a(this._handleGeolocationError,this);return o.watch?this._locationWatchId=navigator.geolocation.watchPosition(u,f,o):navigator.geolocation.getCurrentPosition(u,f,o),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(o){if(this._container._leaflet_id){var u=o.code,f=o.message||(u===1?"permission denied":u===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:u,message:"Geolocation error: "+f+"."})}},_handleGeolocationResponse:function(o){if(this._container._leaflet_id){var u=o.coords.latitude,f=o.coords.longitude,m=new bt(u,f),y=m.toBounds(o.coords.accuracy*2),E=this._locateOptions;if(E.setView){var F=this.getBoundsZoom(y);this.setView(m,E.maxZoom?Math.min(F,E.maxZoom):F)}var j={latlng:m,bounds:y,timestamp:o.timestamp};for(var Y in o.coords)typeof o.coords[Y]=="number"&&(j[Y]=o.coords[Y]);this.fire("locationfound",j)}},addHandler:function(o,u){if(!u)return this;var f=this[o]=new u(this);return this._handlers.push(f),this.options[o]&&f.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),fe(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(tt(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var o;for(o in this._layers)this._layers[o].remove();for(o in this._panes)fe(this._panes[o]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(o,u){var f="leaflet-pane"+(o?" leaflet-"+o.replace("Pane","")+"-pane":""),m=Zt("div",f,u||this._mapPane);return o&&(this._panes[o]=m),m},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var o=this.getPixelBounds(),u=this.unproject(o.getBottomLeft()),f=this.unproject(o.getTopRight());return new Mt(u,f)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(o,u,f){o=ct(o),f=nt(f||[0,0]);var m=this.getZoom()||0,y=this.getMinZoom(),E=this.getMaxZoom(),F=o.getNorthWest(),j=o.getSouthEast(),Y=this.getSize().subtract(f),at=kt(this.project(j,m),this.project(F,m)).getSize(),wt=mt.any3d?this.options.zoomSnap:1,Dt=Y.x/at.x,$t=Y.y/at.y,je=u?Math.max(Dt,$t):Math.min(Dt,$t);return m=this.getScaleZoom(je,m),wt&&(m=Math.round(m/(wt/100))*(wt/100),m=u?Math.ceil(m/wt)*wt:Math.floor(m/wt)*wt),Math.max(y,Math.min(E,m))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new W(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(o,u){var f=this._getTopLeftPoint(o,u);return new vt(f,f.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(o){return this.options.crs.getProjectedBounds(o===void 0?this.getZoom():o)},getPane:function(o){return typeof o=="string"?this._panes[o]:o},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(o,u){var f=this.options.crs;return u=u===void 0?this._zoom:u,f.scale(o)/f.scale(u)},getScaleZoom:function(o,u){var f=this.options.crs;u=u===void 0?this._zoom:u;var m=f.zoom(o*f.scale(u));return isNaN(m)?1/0:m},project:function(o,u){return u=u===void 0?this._zoom:u,this.options.crs.latLngToPoint(yt(o),u)},unproject:function(o,u){return u=u===void 0?this._zoom:u,this.options.crs.pointToLatLng(nt(o),u)},layerPointToLatLng:function(o){var u=nt(o).add(this.getPixelOrigin());return this.unproject(u)},latLngToLayerPoint:function(o){var u=this.project(yt(o))._round();return u._subtract(this.getPixelOrigin())},wrapLatLng:function(o){return this.options.crs.wrapLatLng(yt(o))},wrapLatLngBounds:function(o){return this.options.crs.wrapLatLngBounds(ct(o))},distance:function(o,u){return this.options.crs.distance(yt(o),yt(u))},containerPointToLayerPoint:function(o){return nt(o).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(o){return nt(o).add(this._getMapPanePos())},containerPointToLatLng:function(o){var u=this.containerPointToLayerPoint(nt(o));return this.layerPointToLatLng(u)},latLngToContainerPoint:function(o){return this.layerPointToContainerPoint(this.latLngToLayerPoint(yt(o)))},mouseEventToContainerPoint:function(o){return Dh(o,this._container)},mouseEventToLayerPoint:function(o){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(o))},mouseEventToLatLng:function(o){return this.layerPointToLatLng(this.mouseEventToLayerPoint(o))},_initContainer:function(o){var u=this._container=Th(o);if(u){if(u._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");It(u,"scroll",this._onScroll,this),this._containerId=h(u)},_initLayout:function(){var o=this._container;this._fadeAnimated=this.options.fadeAnimation&&mt.any3d,Bt(o,"leaflet-container"+(mt.touch?" leaflet-touch":"")+(mt.retina?" leaflet-retina":"")+(mt.ielt9?" leaflet-oldie":"")+(mt.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var u=nr(o,"position");u!=="absolute"&&u!=="relative"&&u!=="fixed"&&u!=="sticky"&&(o.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var o=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),we(this._mapPane,new W(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(Bt(o.markerPane,"leaflet-zoom-hide"),Bt(o.shadowPane,"leaflet-zoom-hide"))},_resetView:function(o,u,f){we(this._mapPane,new W(0,0));var m=!this._loaded;this._loaded=!0,u=this._limitZoom(u),this.fire("viewprereset");var y=this._zoom!==u;this._moveStart(y,f)._move(o,u)._moveEnd(y),this.fire("viewreset"),m&&this.fire("load")},_moveStart:function(o,u){return o&&this.fire("zoomstart"),u||this.fire("movestart"),this},_move:function(o,u,f,m){u===void 0&&(u=this._zoom);var y=this._zoom!==u;return this._zoom=u,this._lastCenter=o,this._pixelOrigin=this._getNewPixelOrigin(o),m?f&&f.pinch&&this.fire("zoom",f):((y||f&&f.pinch)&&this.fire("zoom",f),this.fire("move",f)),this},_moveEnd:function(o){return o&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return tt(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(o){we(this._mapPane,this._getMapPanePos().subtract(o))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(o){this._targets={},this._targets[h(this._container)]=this;var u=o?se:It;u(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&u(window,"resize",this._onResize,this),mt.any3d&&this.options.transform3DLimit&&(o?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){tt(this._resizeRequest),this._resizeRequest=z(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var o=this._getMapPanePos();Math.max(Math.abs(o.x),Math.abs(o.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(o,u){for(var f=[],m,y=u==="mouseout"||u==="mouseover",E=o.target||o.srcElement,F=!1;E;){if(m=this._targets[h(E)],m&&(u==="click"||u==="preclick")&&this._draggableMoved(m)){F=!0;break}if(m&&m.listens(u,!0)&&(y&&!Pl(E,o)||(f.push(m),y))||E===this._container)break;E=E.parentNode}return!f.length&&!F&&!y&&this.listens(u,!0)&&(f=[this]),f},_isClickDisabled:function(o){for(;o&&o!==this._container;){if(o._leaflet_disable_click)return!0;o=o.parentNode}},_handleDOMEvent:function(o){var u=o.target||o.srcElement;if(!(!this._loaded||u._leaflet_disable_events||o.type==="click"&&this._isClickDisabled(u))){var f=o.type;f==="mousedown"&&Cl(u),this._fireDOMEvent(o,f)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(o,u,f){if(o.type==="click"){var m=s({},o);m.type="preclick",this._fireDOMEvent(m,m.type,f)}var y=this._findEventTargets(o,u);if(f){for(var E=[],F=0;F0?Math.round(o-u)/2:Math.max(0,Math.ceil(o))-Math.max(0,Math.floor(u))},_limitZoom:function(o){var u=this.getMinZoom(),f=this.getMaxZoom(),m=mt.any3d?this.options.zoomSnap:1;return m&&(o=Math.round(o/m)*m),Math.max(u,Math.min(f,o))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){ge(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(o,u){var f=this._getCenterOffset(o)._trunc();return(u&&u.animate)!==!0&&!this.getSize().contains(f)?!1:(this.panBy(f,u),!0)},_createAnimProxy:function(){var o=this._proxy=Zt("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(o),this.on("zoomanim",function(u){var f=yl,m=this._proxy.style[f];Nn(this._proxy,this.project(u.center,u.zoom),this.getZoomScale(u.zoom,1)),m===this._proxy.style[f]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){fe(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var o=this.getCenter(),u=this.getZoom();Nn(this._proxy,this.project(o,u),this.getZoomScale(u,1))},_catchTransitionEnd:function(o){this._animatingZoom&&o.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(o,u,f){if(this._animatingZoom)return!0;if(f=f||{},!this._zoomAnimated||f.animate===!1||this._nothingToAnimate()||Math.abs(u-this._zoom)>this.options.zoomAnimationThreshold)return!1;var m=this.getZoomScale(u),y=this._getCenterOffset(o)._divideBy(1-1/m);return f.animate!==!0&&!this.getSize().contains(y)?!1:(z(function(){this._moveStart(!0,f.noMoveStart||!1)._animateZoom(o,u,!0)},this),!0)},_animateZoom:function(o,u,f,m){this._mapPane&&(f&&(this._animatingZoom=!0,this._animateToCenter=o,this._animateToZoom=u,Bt(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:o,zoom:u,noUpdate:m}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(a(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&ge(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function t_(o,u){return new Ut(o,u)}var xi=it.extend({options:{position:"topright"},initialize:function(o){_(this,o)},getPosition:function(){return this.options.position},setPosition:function(o){var u=this._map;return u&&u.removeControl(this),this.options.position=o,u&&u.addControl(this),this},getContainer:function(){return this._container},addTo:function(o){this.remove(),this._map=o;var u=this._container=this.onAdd(o),f=this.getPosition(),m=o._controlCorners[f];return Bt(u,"leaflet-control"),f.indexOf("bottom")!==-1?m.insertBefore(u,m.firstChild):m.appendChild(u),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(fe(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(o){this._map&&o&&o.screenX>0&&o.screenY>0&&this._map.getContainer().focus()}}),lr=function(o){return new xi(o)};Ut.include({addControl:function(o){return o.addTo(this),this},removeControl:function(o){return o.remove(),this},_initControlPos:function(){var o=this._controlCorners={},u="leaflet-",f=this._controlContainer=Zt("div",u+"control-container",this._container);function m(y,E){var F=u+y+" "+u+E;o[y+E]=Zt("div",F,f)}m("top","left"),m("top","right"),m("bottom","left"),m("bottom","right")},_clearControlPos:function(){for(var o in this._controlCorners)fe(this._controlCorners[o]);fe(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Ih=xi.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(o,u,f,m){return f1,this._baseLayersList.style.display=o?"":"none"),this._separator.style.display=u&&o?"":"none",this},_onLayerChange:function(o){this._handlingClick||this._update();var u=this._getLayer(h(o.target)),f=u.overlay?o.type==="add"?"overlayadd":"overlayremove":o.type==="add"?"baselayerchange":null;f&&this._map.fire(f,u)},_createRadioElement:function(o,u){var f='",m=document.createElement("div");return m.innerHTML=f,m.firstChild},_addItem:function(o){var u=document.createElement("label"),f=this._map.hasLayer(o.layer),m;o.overlay?(m=document.createElement("input"),m.type="checkbox",m.className="leaflet-control-layers-selector",m.defaultChecked=f):m=this._createRadioElement("leaflet-base-layers_"+h(this),f),this._layerControlInputs.push(m),m.layerId=h(o.layer),It(m,"click",this._onInputClick,this);var y=document.createElement("span");y.innerHTML=" "+o.name;var E=document.createElement("span");u.appendChild(E),E.appendChild(m),E.appendChild(y);var F=o.overlay?this._overlaysList:this._baseLayersList;return F.appendChild(u),this._checkDisabledLayers(),u},_onInputClick:function(){if(!this._preventClick){var o=this._layerControlInputs,u,f,m=[],y=[];this._handlingClick=!0;for(var E=o.length-1;E>=0;E--)u=o[E],f=this._getLayer(u.layerId).layer,u.checked?m.push(f):u.checked||y.push(f);for(E=0;E=0;y--)u=o[y],f=this._getLayer(u.layerId).layer,u.disabled=f.options.minZoom!==void 0&&mf.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var o=this._section;this._preventClick=!0,It(o,"click",De),this.expand();var u=this;setTimeout(function(){se(o,"click",De),u._preventClick=!1})}}),e_=function(o,u,f){return new Ih(o,u,f)},Ol=xi.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(o){var u="leaflet-control-zoom",f=Zt("div",u+" leaflet-bar"),m=this.options;return this._zoomInButton=this._createButton(m.zoomInText,m.zoomInTitle,u+"-in",f,this._zoomIn),this._zoomOutButton=this._createButton(m.zoomOutText,m.zoomOutTitle,u+"-out",f,this._zoomOut),this._updateDisabled(),o.on("zoomend zoomlevelschange",this._updateDisabled,this),f},onRemove:function(o){o.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(o){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(o.shiftKey?3:1))},_createButton:function(o,u,f,m,y){var E=Zt("a",f,m);return E.innerHTML=o,E.href="#",E.title=u,E.setAttribute("role","button"),E.setAttribute("aria-label",u),ar(E),It(E,"click",Hn),It(E,"click",y,this),It(E,"click",this._refocusOnMap,this),E},_updateDisabled:function(){var o=this._map,u="leaflet-disabled";ge(this._zoomInButton,u),ge(this._zoomOutButton,u),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||o._zoom===o.getMinZoom())&&(Bt(this._zoomOutButton,u),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||o._zoom===o.getMaxZoom())&&(Bt(this._zoomInButton,u),this._zoomInButton.setAttribute("aria-disabled","true"))}});Ut.mergeOptions({zoomControl:!0}),Ut.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Ol,this.addControl(this.zoomControl))});var i_=function(o){return new Ol(o)},Fh=xi.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(o){var u="leaflet-control-scale",f=Zt("div",u),m=this.options;return this._addScales(m,u+"-line",f),o.on(m.updateWhenIdle?"moveend":"move",this._update,this),o.whenReady(this._update,this),f},onRemove:function(o){o.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(o,u,f){o.metric&&(this._mScale=Zt("div",u,f)),o.imperial&&(this._iScale=Zt("div",u,f))},_update:function(){var o=this._map,u=o.getSize().y/2,f=o.distance(o.containerPointToLatLng([0,u]),o.containerPointToLatLng([this.options.maxWidth,u]));this._updateScales(f)},_updateScales:function(o){this.options.metric&&o&&this._updateMetric(o),this.options.imperial&&o&&this._updateImperial(o)},_updateMetric:function(o){var u=this._getRoundNum(o),f=u<1e3?u+" m":u/1e3+" km";this._updateScale(this._mScale,f,u/o)},_updateImperial:function(o){var u=o*3.2808399,f,m,y;u>5280?(f=u/5280,m=this._getRoundNum(f),this._updateScale(this._iScale,m+" mi",m/f)):(y=this._getRoundNum(u),this._updateScale(this._iScale,y+" ft",y/u))},_updateScale:function(o,u,f){o.style.width=Math.round(this.options.maxWidth*f)+"px",o.innerHTML=u},_getRoundNum:function(o){var u=Math.pow(10,(Math.floor(o)+"").length-1),f=o/u;return f=f>=10?10:f>=5?5:f>=3?3:f>=2?2:1,u*f}}),n_=function(o){return new Fh(o)},s_='',Il=xi.extend({options:{position:"bottomright",prefix:''+(mt.inlineSvg?s_+" ":"")+"Leaflet"},initialize:function(o){_(this,o),this._attributions={}},onAdd:function(o){o.attributionControl=this,this._container=Zt("div","leaflet-control-attribution"),ar(this._container);for(var u in o._layers)o._layers[u].getAttribution&&this.addAttribution(o._layers[u].getAttribution());return this._update(),o.on("layeradd",this._addAttribution,this),this._container},onRemove:function(o){o.off("layeradd",this._addAttribution,this)},_addAttribution:function(o){o.layer.getAttribution&&(this.addAttribution(o.layer.getAttribution()),o.layer.once("remove",function(){this.removeAttribution(o.layer.getAttribution())},this))},setPrefix:function(o){return this.options.prefix=o,this._update(),this},addAttribution:function(o){return o?(this._attributions[o]||(this._attributions[o]=0),this._attributions[o]++,this._update(),this):this},removeAttribution:function(o){return o?(this._attributions[o]&&(this._attributions[o]--,this._update()),this):this},_update:function(){if(this._map){var o=[];for(var u in this._attributions)this._attributions[u]&&o.push(u);var f=[];this.options.prefix&&f.push(this.options.prefix),o.length&&f.push(o.join(", ")),this._container.innerHTML=f.join(' ')}}});Ut.mergeOptions({attributionControl:!0}),Ut.addInitHook(function(){this.options.attributionControl&&new Il().addTo(this)});var r_=function(o){return new Il(o)};xi.Layers=Ih,xi.Zoom=Ol,xi.Scale=Fh,xi.Attribution=Il,lr.layers=e_,lr.zoom=i_,lr.scale=n_,lr.attribution=r_;var Oi=it.extend({initialize:function(o){this._map=o},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});Oi.addTo=function(o,u){return o.addHandler(u,this),this};var o_={Events:Z},Rh=mt.touch?"touchstart mousedown":"mousedown",mn=st.extend({options:{clickTolerance:3},initialize:function(o,u,f,m){_(this,m),this._element=o,this._dragStartTarget=u||o,this._preventOutline=f},enable:function(){this._enabled||(It(this._dragStartTarget,Rh,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(mn._dragging===this&&this.finishDrag(!0),se(this._dragStartTarget,Rh,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(o){if(this._enabled&&(this._moved=!1,!bl(this._element,"leaflet-zoom-anim"))){if(o.touches&&o.touches.length!==1){mn._dragging===this&&this.finishDrag();return}if(!(mn._dragging||o.shiftKey||o.which!==1&&o.button!==1&&!o.touches)&&(mn._dragging=this,this._preventOutline&&Cl(this._element),Sl(),sr(),!this._moving)){this.fire("down");var u=o.touches?o.touches[0]:o,f=Mh(this._element);this._startPoint=new W(u.clientX,u.clientY),this._startPos=zn(this._element),this._parentScale=Tl(f);var m=o.type==="mousedown";It(document,m?"mousemove":"touchmove",this._onMove,this),It(document,m?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(o){if(this._enabled){if(o.touches&&o.touches.length>1){this._moved=!0;return}var u=o.touches&&o.touches.length===1?o.touches[0]:o,f=new W(u.clientX,u.clientY)._subtract(this._startPoint);!f.x&&!f.y||Math.abs(f.x)+Math.abs(f.y)E&&(F=j,E=Y);E>f&&(u[F]=1,Rl(o,u,f,m,F),Rl(o,u,f,F,y))}function u_(o,u){for(var f=[o[0]],m=1,y=0,E=o.length;mu&&(f.push(o[m]),y=m);return yu.max.x&&(f|=2),o.yu.max.y&&(f|=8),f}function h_(o,u){var f=u.x-o.x,m=u.y-o.y;return f*f+m*m}function cr(o,u,f,m){var y=u.x,E=u.y,F=f.x-y,j=f.y-E,Y=F*F+j*j,at;return Y>0&&(at=((o.x-y)*F+(o.y-E)*j)/Y,at>1?(y=f.x,E=f.y):at>0&&(y+=F*at,E+=j*at)),F=o.x-y,j=o.y-E,m?F*F+j*j:new W(y,E)}function di(o){return!C(o[0])||typeof o[0][0]!="object"&&typeof o[0][0]<"u"}function jh(o){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),di(o)}function Uh(o,u){var f,m,y,E,F,j,Y,at;if(!o||o.length===0)throw new Error("latlngs not passed");di(o)||(console.warn("latlngs are not flat! Only the first ring will be used"),o=o[0]);var wt=yt([0,0]),Dt=ct(o),$t=Dt.getNorthWest().distanceTo(Dt.getSouthWest())*Dt.getNorthEast().distanceTo(Dt.getNorthWest());$t<1700&&(wt=Fl(o));var je=o.length,Te=[];for(f=0;fm){Y=(E-m)/y,at=[j.x-Y*(j.x-F.x),j.y-Y*(j.y-F.y)];break}var Ze=u.unproject(nt(at));return yt([Ze.lat+wt.lat,Ze.lng+wt.lng])}var d_={__proto__:null,simplify:Nh,pointToSegmentDistance:zh,closestPointOnSegment:l_,clipSegment:Hh,_getEdgeIntersection:Co,_getBitCode:jn,_sqClosestPointOnSegment:cr,isFlat:di,_flat:jh,polylineCenter:Uh},Bl={project:function(o){return new W(o.lng,o.lat)},unproject:function(o){return new bt(o.y,o.x)},bounds:new vt([-180,-90],[180,90])},Vl={R:6378137,R_MINOR:6356752314245179e-9,bounds:new vt([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(o){var u=Math.PI/180,f=this.R,m=o.lat*u,y=this.R_MINOR/f,E=Math.sqrt(1-y*y),F=E*Math.sin(m),j=Math.tan(Math.PI/4-m/2)/Math.pow((1-F)/(1+F),E/2);return m=-f*Math.log(Math.max(j,1e-10)),new W(o.lng*u*f,m)},unproject:function(o){for(var u=180/Math.PI,f=this.R,m=this.R_MINOR/f,y=Math.sqrt(1-m*m),E=Math.exp(-o.y/f),F=Math.PI/2-2*Math.atan(E),j=0,Y=.1,at;j<15&&Math.abs(Y)>1e-7;j++)at=y*Math.sin(F),at=Math.pow((1-at)/(1+at),y/2),Y=Math.PI/2-2*Math.atan(E*at)-F,F+=Y;return new bt(F*u,o.x*u/f)}},f_={__proto__:null,LonLat:Bl,Mercator:Vl,SphericalMercator:O},p_=s({},Pt,{code:"EPSG:3395",projection:Vl,transformation:function(){var o=.5/(Math.PI*Vl.R);return A(o,.5,-o,.5)}()}),Wh=s({},Pt,{code:"EPSG:4326",projection:Bl,transformation:A(1/180,1,-1/180,.5)}),m_=s({},Wt,{projection:Bl,transformation:A(1,0,-1,0),scale:function(o){return Math.pow(2,o)},zoom:function(o){return Math.log(o)/Math.LN2},distance:function(o,u){var f=u.lng-o.lng,m=u.lat-o.lat;return Math.sqrt(f*f+m*m)},infinite:!0});Wt.Earth=Pt,Wt.EPSG3395=p_,Wt.EPSG3857=M,Wt.EPSG900913=B,Wt.EPSG4326=Wh,Wt.Simple=m_;var Si=st.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(o){return o.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(o){return o&&o.removeLayer(this),this},getPane:function(o){return this._map.getPane(o?this.options[o]||o:this.options.pane)},addInteractiveTarget:function(o){return this._map._targets[h(o)]=this,this},removeInteractiveTarget:function(o){return delete this._map._targets[h(o)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(o){var u=o.target;if(u.hasLayer(this)){if(this._map=u,this._zoomAnimated=u._zoomAnimated,this.getEvents){var f=this.getEvents();u.on(f,this),this.once("remove",function(){u.off(f,this)},this)}this.onAdd(u),this.fire("add"),u.fire("layeradd",{layer:this})}}});Ut.include({addLayer:function(o){if(!o._layerAdd)throw new Error("The provided object is not a Layer.");var u=h(o);return this._layers[u]?this:(this._layers[u]=o,o._mapToAdd=this,o.beforeAdd&&o.beforeAdd(this),this.whenReady(o._layerAdd,o),this)},removeLayer:function(o){var u=h(o);return this._layers[u]?(this._loaded&&o.onRemove(this),delete this._layers[u],this._loaded&&(this.fire("layerremove",{layer:o}),o.fire("remove")),o._map=o._mapToAdd=null,this):this},hasLayer:function(o){return h(o)in this._layers},eachLayer:function(o,u){for(var f in this._layers)o.call(u,this._layers[f]);return this},_addLayers:function(o){o=o?C(o)?o:[o]:[];for(var u=0,f=o.length;uthis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()=2&&u[0]instanceof bt&&u[0].equals(u[f-1])&&u.pop(),u},_setLatLngs:function(o){Gi.prototype._setLatLngs.call(this,o),di(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return di(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var o=this._renderer._bounds,u=this.options.weight,f=new W(u,u);if(o=new vt(o.min.subtract(f),o.max.add(f)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(o))){if(this.options.noClip){this._parts=this._rings;return}for(var m=0,y=this._rings.length,E;mo.y!=y.y>o.y&&o.x<(y.x-m.x)*(o.y-m.y)/(y.y-m.y)+m.x&&(u=!u);return u||Gi.prototype._containsPoint.call(this,o,!0)}});function S_(o,u){return new Ss(o,u)}var Zi=qi.extend({initialize:function(o,u){_(this,u),this._layers={},o&&this.addData(o)},addData:function(o){var u=C(o)?o:o.features,f,m,y;if(u){for(f=0,m=u.length;f0&&y.push(y[0].slice()),y}function ks(o,u){return o.feature?s({},o.feature,{geometry:u}):Po(u)}function Po(o){return o.type==="Feature"||o.type==="FeatureCollection"?o:{type:"Feature",properties:{},geometry:o}}var Hl={toGeoJSON:function(o){return ks(this,{type:"Point",coordinates:$l(this.getLatLng(),o)})}};To.include(Hl),Nl.include(Hl),Mo.include(Hl),Gi.include({toGeoJSON:function(o){var u=!di(this._latlngs),f=Do(this._latlngs,u?1:0,!1,o);return ks(this,{type:(u?"Multi":"")+"LineString",coordinates:f})}}),Ss.include({toGeoJSON:function(o){var u=!di(this._latlngs),f=u&&!di(this._latlngs[0]),m=Do(this._latlngs,f?2:u?1:0,!0,o);return u||(m=[m]),ks(this,{type:(f?"Multi":"")+"Polygon",coordinates:m})}}),ws.include({toMultiPoint:function(o){var u=[];return this.eachLayer(function(f){u.push(f.toGeoJSON(o).geometry.coordinates)}),ks(this,{type:"MultiPoint",coordinates:u})},toGeoJSON:function(o){var u=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(u==="MultiPoint")return this.toMultiPoint(o);var f=u==="GeometryCollection",m=[];return this.eachLayer(function(y){if(y.toGeoJSON){var E=y.toGeoJSON(o);if(f)m.push(E.geometry);else{var F=Po(E);F.type==="FeatureCollection"?m.push.apply(m,F.features):m.push(F)}}}),f?ks(this,{geometries:m,type:"GeometryCollection"}):{type:"FeatureCollection",features:m}}});function Zh(o,u){return new Zi(o,u)}var k_=Zh,Oo=Si.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(o,u,f){this._url=o,this._bounds=ct(u),_(this,f)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(Bt(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){fe(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(o){return this.options.opacity=o,this._image&&this._updateOpacity(),this},setStyle:function(o){return o.opacity&&this.setOpacity(o.opacity),this},bringToFront:function(){return this._map&&ys(this._image),this},bringToBack:function(){return this._map&&bs(this._image),this},setUrl:function(o){return this._url=o,this._image&&(this._image.src=o),this},setBounds:function(o){return this._bounds=ct(o),this._map&&this._reset(),this},getEvents:function(){var o={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(o.zoomanim=this._animateZoom),o},setZIndex:function(o){return this.options.zIndex=o,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var o=this._url.tagName==="IMG",u=this._image=o?this._url:Zt("img");if(Bt(u,"leaflet-image-layer"),this._zoomAnimated&&Bt(u,"leaflet-zoom-animated"),this.options.className&&Bt(u,this.options.className),u.onselectstart=p,u.onmousemove=p,u.onload=a(this.fire,this,"load"),u.onerror=a(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(u.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),o){this._url=u.src;return}u.src=this._url,u.alt=this.options.alt},_animateZoom:function(o){var u=this._map.getZoomScale(o.zoom),f=this._map._latLngBoundsToNewLayerBounds(this._bounds,o.zoom,o.center).min;Nn(this._image,f,u)},_reset:function(){var o=this._image,u=new vt(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),f=u.getSize();we(o,u.min),o.style.width=f.x+"px",o.style.height=f.y+"px"},_updateOpacity:function(){hi(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var o=this.options.errorOverlayUrl;o&&this._url!==o&&(this._url=o,this._image.src=o)},getCenter:function(){return this._bounds.getCenter()}}),E_=function(o,u,f){return new Oo(o,u,f)},Yh=Oo.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var o=this._url.tagName==="VIDEO",u=this._image=o?this._url:Zt("video");if(Bt(u,"leaflet-image-layer"),this._zoomAnimated&&Bt(u,"leaflet-zoom-animated"),this.options.className&&Bt(u,this.options.className),u.onselectstart=p,u.onmousemove=p,u.onloadeddata=a(this.fire,this,"load"),o){for(var f=u.getElementsByTagName("source"),m=[],y=0;y0?m:[u.src];return}C(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(u.style,"objectFit")&&(u.style.objectFit="fill"),u.autoplay=!!this.options.autoplay,u.loop=!!this.options.loop,u.muted=!!this.options.muted,u.playsInline=!!this.options.playsInline;for(var E=0;Ey?(u.height=y+"px",Bt(o,E)):ge(o,E),this._containerWidth=this._container.offsetWidth},_animateZoom:function(o){var u=this._map._latLngToNewLayerPoint(this._latlng,o.zoom,o.center),f=this._getAnchor();we(this._container,u.add(f))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var o=this._map,u=parseInt(nr(this._container,"marginBottom"),10)||0,f=this._container.offsetHeight+u,m=this._containerWidth,y=new W(this._containerLeft,-f-this._containerBottom);y._add(zn(this._container));var E=o.layerPointToContainerPoint(y),F=nt(this.options.autoPanPadding),j=nt(this.options.autoPanPaddingTopLeft||F),Y=nt(this.options.autoPanPaddingBottomRight||F),at=o.getSize(),wt=0,Dt=0;E.x+m+Y.x>at.x&&(wt=E.x+m-at.x+Y.x),E.x-wt-j.x<0&&(wt=E.x-j.x),E.y+f+Y.y>at.y&&(Dt=E.y+f-at.y+Y.y),E.y-Dt-j.y<0&&(Dt=E.y-j.y),(wt||Dt)&&(this.options.keepInView&&(this._autopanning=!0),o.fire("autopanstart").panBy([wt,Dt]))}},_getAnchor:function(){return nt(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),M_=function(o,u){return new Io(o,u)};Ut.mergeOptions({closePopupOnClick:!0}),Ut.include({openPopup:function(o,u,f){return this._initOverlay(Io,o,u,f).openOn(this),this},closePopup:function(o){return o=arguments.length?o:this._popup,o&&o.close(),this}}),Si.include({bindPopup:function(o,u){return this._popup=this._initOverlay(Io,this._popup,o,u),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(o){return this._popup&&(this instanceof qi||(this._popup._source=this),this._popup._prepareOpen(o||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(o){return this._popup&&this._popup.setContent(o),this},getPopup:function(){return this._popup},_openPopup:function(o){if(!(!this._popup||!this._map)){Hn(o);var u=o.layer||o.target;if(this._popup._source===u&&!(u instanceof gn)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(o.latlng);return}this._popup._source=u,this.openPopup(o.latlng)}},_movePopup:function(o){this._popup.setLatLng(o.latlng)},_onKeyPress:function(o){o.originalEvent.keyCode===13&&this._openPopup(o)}});var Fo=Ii.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(o){Ii.prototype.onAdd.call(this,o),this.setOpacity(this.options.opacity),o.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(o){Ii.prototype.onRemove.call(this,o),o.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var o=Ii.prototype.getEvents.call(this);return this.options.permanent||(o.preclick=this.close),o},_initLayout:function(){var o="leaflet-tooltip",u=o+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=Zt("div",u),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+h(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(o){var u,f,m=this._map,y=this._container,E=m.latLngToContainerPoint(m.getCenter()),F=m.layerPointToContainerPoint(o),j=this.options.direction,Y=y.offsetWidth,at=y.offsetHeight,wt=nt(this.options.offset),Dt=this._getAnchor();j==="top"?(u=Y/2,f=at):j==="bottom"?(u=Y/2,f=0):j==="center"?(u=Y/2,f=at/2):j==="right"?(u=0,f=at/2):j==="left"?(u=Y,f=at/2):F.xthis.options.maxZoom||fm?this._retainParent(y,E,F,m):!1)},_retainChildren:function(o,u,f,m){for(var y=2*o;y<2*o+2;y++)for(var E=2*u;E<2*u+2;E++){var F=new W(y,E);F.z=f+1;var j=this._tileCoordsToKey(F),Y=this._tiles[j];if(Y&&Y.active){Y.retain=!0;continue}else Y&&Y.loaded&&(Y.retain=!0);f+1this.options.maxZoom||this.options.minZoom!==void 0&&y1){this._setView(o,f);return}for(var Dt=y.min.y;Dt<=y.max.y;Dt++)for(var $t=y.min.x;$t<=y.max.x;$t++){var je=new W($t,Dt);if(je.z=this._tileZoom,!!this._isValidTile(je)){var Te=this._tiles[this._tileCoordsToKey(je)];Te?Te.current=!0:F.push(je)}}if(F.sort(function(Ze,Cs){return Ze.distanceTo(E)-Cs.distanceTo(E)}),F.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var fi=document.createDocumentFragment();for($t=0;$tf.max.x)||!u.wrapLat&&(o.yf.max.y))return!1}if(!this.options.bounds)return!0;var m=this._tileCoordsToBounds(o);return ct(this.options.bounds).overlaps(m)},_keyToBounds:function(o){return this._tileCoordsToBounds(this._keyToTileCoords(o))},_tileCoordsToNwSe:function(o){var u=this._map,f=this.getTileSize(),m=o.scaleBy(f),y=m.add(f),E=u.unproject(m,o.z),F=u.unproject(y,o.z);return[E,F]},_tileCoordsToBounds:function(o){var u=this._tileCoordsToNwSe(o),f=new Mt(u[0],u[1]);return this.options.noWrap||(f=this._map.wrapLatLngBounds(f)),f},_tileCoordsToKey:function(o){return o.x+":"+o.y+":"+o.z},_keyToTileCoords:function(o){var u=o.split(":"),f=new W(+u[0],+u[1]);return f.z=+u[2],f},_removeTile:function(o){var u=this._tiles[o];u&&(fe(u.el),delete this._tiles[o],this.fire("tileunload",{tile:u.el,coords:this._keyToTileCoords(o)}))},_initTile:function(o){Bt(o,"leaflet-tile");var u=this.getTileSize();o.style.width=u.x+"px",o.style.height=u.y+"px",o.onselectstart=p,o.onmousemove=p,mt.ielt9&&this.options.opacity<1&&hi(o,this.options.opacity)},_addTile:function(o,u){var f=this._getTilePos(o),m=this._tileCoordsToKey(o),y=this.createTile(this._wrapCoords(o),a(this._tileReady,this,o));this._initTile(y),this.createTile.length<2&&z(a(this._tileReady,this,o,null,y)),we(y,f),this._tiles[m]={el:y,coords:o,current:!0},u.appendChild(y),this.fire("tileloadstart",{tile:y,coords:o})},_tileReady:function(o,u,f){u&&this.fire("tileerror",{error:u,tile:f,coords:o});var m=this._tileCoordsToKey(o);f=this._tiles[m],f&&(f.loaded=+new Date,this._map._fadeAnimated?(hi(f.el,0),tt(this._fadeFrame),this._fadeFrame=z(this._updateOpacity,this)):(f.active=!0,this._pruneTiles()),u||(Bt(f.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:f.el,coords:o})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),mt.ielt9||!this._map._fadeAnimated?z(this._pruneTiles,this):setTimeout(a(this._pruneTiles,this),250)))},_getTilePos:function(o){return o.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(o){var u=new W(this._wrapX?d(o.x,this._wrapX):o.x,this._wrapY?d(o.y,this._wrapY):o.y);return u.z=o.z,u},_pxBoundsToTileRange:function(o){var u=this.getTileSize();return new vt(o.min.unscaleBy(u).floor(),o.max.unscaleBy(u).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var o in this._tiles)if(!this._tiles[o].loaded)return!1;return!0}});function D_(o){return new hr(o)}var Es=hr.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(o,u){this._url=o,u=_(this,u),u.detectRetina&&mt.retina&&u.maxZoom>0?(u.tileSize=Math.floor(u.tileSize/2),u.zoomReverse?(u.zoomOffset--,u.minZoom=Math.min(u.maxZoom,u.minZoom+1)):(u.zoomOffset++,u.maxZoom=Math.max(u.minZoom,u.maxZoom-1)),u.minZoom=Math.max(0,u.minZoom)):u.zoomReverse?u.minZoom=Math.min(u.maxZoom,u.minZoom):u.maxZoom=Math.max(u.minZoom,u.maxZoom),typeof u.subdomains=="string"&&(u.subdomains=u.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(o,u){return this._url===o&&u===void 0&&(u=!0),this._url=o,u||this.redraw(),this},createTile:function(o,u){var f=document.createElement("img");return It(f,"load",a(this._tileOnLoad,this,u,f)),It(f,"error",a(this._tileOnError,this,u,f)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(f.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(f.referrerPolicy=this.options.referrerPolicy),f.alt="",f.src=this.getTileUrl(o),f},getTileUrl:function(o){var u={r:mt.retina?"@2x":"",s:this._getSubdomain(o),x:o.x,y:o.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var f=this._globalTileRange.max.y-o.y;this.options.tms&&(u.y=f),u["-y"]=f}return S(this._url,s(u,this.options))},_tileOnLoad:function(o,u){mt.ielt9?setTimeout(a(o,this,null,u),0):o(null,u)},_tileOnError:function(o,u,f){var m=this.options.errorTileUrl;m&&u.getAttribute("src")!==m&&(u.src=m),o(f,u)},_onTileRemove:function(o){o.tile.onload=null},_getZoomForUrl:function(){var o=this._tileZoom,u=this.options.maxZoom,f=this.options.zoomReverse,m=this.options.zoomOffset;return f&&(o=u-o),o+m},_getSubdomain:function(o){var u=Math.abs(o.x+o.y)%this.options.subdomains.length;return this.options.subdomains[u]},_abortLoading:function(){var o,u;for(o in this._tiles)if(this._tiles[o].coords.z!==this._tileZoom&&(u=this._tiles[o].el,u.onload=p,u.onerror=p,!u.complete)){u.src=D;var f=this._tiles[o].coords;fe(u),delete this._tiles[o],this.fire("tileabort",{tile:u,coords:f})}},_removeTile:function(o){var u=this._tiles[o];if(u)return u.el.setAttribute("src",D),hr.prototype._removeTile.call(this,o)},_tileReady:function(o,u,f){if(!(!this._map||f&&f.getAttribute("src")===D))return hr.prototype._tileReady.call(this,o,u,f)}});function Jh(o,u){return new Es(o,u)}var Qh=Es.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(o,u){this._url=o;var f=s({},this.defaultWmsParams);for(var m in u)m in this.options||(f[m]=u[m]);u=_(this,u);var y=u.detectRetina&&mt.retina?2:1,E=this.getTileSize();f.width=E.x*y,f.height=E.y*y,this.wmsParams=f},onAdd:function(o){this._crs=this.options.crs||o.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var u=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[u]=this._crs.code,Es.prototype.onAdd.call(this,o)},getTileUrl:function(o){var u=this._tileCoordsToNwSe(o),f=this._crs,m=kt(f.project(u[0]),f.project(u[1])),y=m.min,E=m.max,F=(this._wmsVersion>=1.3&&this._crs===Wh?[y.y,y.x,E.y,E.x]:[y.x,y.y,E.x,E.y]).join(","),j=Es.prototype.getTileUrl.call(this,o);return j+w(this.wmsParams,j,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+F},setParams:function(o,u){return s(this.wmsParams,o),u||this.redraw(),this}});function P_(o,u){return new Qh(o,u)}Es.WMS=Qh,Jh.wms=P_;var Yi=Si.extend({options:{padding:.1},initialize:function(o){_(this,o),h(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),Bt(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var o={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(o.zoomanim=this._onAnimZoom),o},_onAnimZoom:function(o){this._updateTransform(o.center,o.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(o,u){var f=this._map.getZoomScale(u,this._zoom),m=this._map.getSize().multiplyBy(.5+this.options.padding),y=this._map.project(this._center,u),E=m.multiplyBy(-f).add(y).subtract(this._map._getNewPixelOrigin(o,u));mt.any3d?Nn(this._container,E,f):we(this._container,E)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var o in this._layers)this._layers[o]._reset()},_onZoomEnd:function(){for(var o in this._layers)this._layers[o]._project()},_updatePaths:function(){for(var o in this._layers)this._layers[o]._update()},_update:function(){var o=this.options.padding,u=this._map.getSize(),f=this._map.containerPointToLayerPoint(u.multiplyBy(-o)).round();this._bounds=new vt(f,f.add(u.multiplyBy(1+o*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),td=Yi.extend({options:{tolerance:0},getEvents:function(){var o=Yi.prototype.getEvents.call(this);return o.viewprereset=this._onViewPreReset,o},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Yi.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var o=this._container=document.createElement("canvas");It(o,"mousemove",this._onMouseMove,this),It(o,"click dblclick mousedown mouseup contextmenu",this._onClick,this),It(o,"mouseout",this._handleMouseOut,this),o._leaflet_disable_events=!0,this._ctx=o.getContext("2d")},_destroyContainer:function(){tt(this._redrawRequest),delete this._ctx,fe(this._container),se(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var o;this._redrawBounds=null;for(var u in this._layers)o=this._layers[u],o._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Yi.prototype._update.call(this);var o=this._bounds,u=this._container,f=o.getSize(),m=mt.retina?2:1;we(u,o.min),u.width=m*f.x,u.height=m*f.y,u.style.width=f.x+"px",u.style.height=f.y+"px",mt.retina&&this._ctx.scale(2,2),this._ctx.translate(-o.min.x,-o.min.y),this.fire("update")}},_reset:function(){Yi.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(o){this._updateDashArray(o),this._layers[h(o)]=o;var u=o._order={layer:o,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=u),this._drawLast=u,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(o){this._requestRedraw(o)},_removePath:function(o){var u=o._order,f=u.next,m=u.prev;f?f.prev=m:this._drawLast=m,m?m.next=f:this._drawFirst=f,delete o._order,delete this._layers[h(o)],this._requestRedraw(o)},_updatePath:function(o){this._extendRedrawBounds(o),o._project(),o._update(),this._requestRedraw(o)},_updateStyle:function(o){this._updateDashArray(o),this._requestRedraw(o)},_updateDashArray:function(o){if(typeof o.options.dashArray=="string"){var u=o.options.dashArray.split(/[, ]+/),f=[],m,y;for(y=0;y')}}catch{}return function(o){return document.createElement("<"+o+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),O_={_initContainer:function(){this._container=Zt("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Yi.prototype._update.call(this),this.fire("update"))},_initPath:function(o){var u=o._container=dr("shape");Bt(u,"leaflet-vml-shape "+(this.options.className||"")),u.coordsize="1 1",o._path=dr("path"),u.appendChild(o._path),this._updateStyle(o),this._layers[h(o)]=o},_addPath:function(o){var u=o._container;this._container.appendChild(u),o.options.interactive&&o.addInteractiveTarget(u)},_removePath:function(o){var u=o._container;fe(u),o.removeInteractiveTarget(u),delete this._layers[h(o)]},_updateStyle:function(o){var u=o._stroke,f=o._fill,m=o.options,y=o._container;y.stroked=!!m.stroke,y.filled=!!m.fill,m.stroke?(u||(u=o._stroke=dr("stroke")),y.appendChild(u),u.weight=m.weight+"px",u.color=m.color,u.opacity=m.opacity,m.dashArray?u.dashStyle=C(m.dashArray)?m.dashArray.join(" "):m.dashArray.replace(/( *, *)/g," "):u.dashStyle="",u.endcap=m.lineCap.replace("butt","flat"),u.joinstyle=m.lineJoin):u&&(y.removeChild(u),o._stroke=null),m.fill?(f||(f=o._fill=dr("fill")),y.appendChild(f),f.color=m.fillColor||m.color,f.opacity=m.fillOpacity):f&&(y.removeChild(f),o._fill=null)},_updateCircle:function(o){var u=o._point.round(),f=Math.round(o._radius),m=Math.round(o._radiusY||f);this._setPath(o,o._empty()?"M0 0":"AL "+u.x+","+u.y+" "+f+","+m+" 0,"+65535*360)},_setPath:function(o,u){o._path.v=u},_bringToFront:function(o){ys(o._container)},_bringToBack:function(o){bs(o._container)}},Ro=mt.vml?dr:R,fr=Yi.extend({_initContainer:function(){this._container=Ro("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Ro("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){fe(this._container),se(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Yi.prototype._update.call(this);var o=this._bounds,u=o.getSize(),f=this._container;(!this._svgSize||!this._svgSize.equals(u))&&(this._svgSize=u,f.setAttribute("width",u.x),f.setAttribute("height",u.y)),we(f,o.min),f.setAttribute("viewBox",[o.min.x,o.min.y,u.x,u.y].join(" ")),this.fire("update")}},_initPath:function(o){var u=o._path=Ro("path");o.options.className&&Bt(u,o.options.className),o.options.interactive&&Bt(u,"leaflet-interactive"),this._updateStyle(o),this._layers[h(o)]=o},_addPath:function(o){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(o._path),o.addInteractiveTarget(o._path)},_removePath:function(o){fe(o._path),o.removeInteractiveTarget(o._path),delete this._layers[h(o)]},_updatePath:function(o){o._project(),o._update()},_updateStyle:function(o){var u=o._path,f=o.options;u&&(f.stroke?(u.setAttribute("stroke",f.color),u.setAttribute("stroke-opacity",f.opacity),u.setAttribute("stroke-width",f.weight),u.setAttribute("stroke-linecap",f.lineCap),u.setAttribute("stroke-linejoin",f.lineJoin),f.dashArray?u.setAttribute("stroke-dasharray",f.dashArray):u.removeAttribute("stroke-dasharray"),f.dashOffset?u.setAttribute("stroke-dashoffset",f.dashOffset):u.removeAttribute("stroke-dashoffset")):u.setAttribute("stroke","none"),f.fill?(u.setAttribute("fill",f.fillColor||f.color),u.setAttribute("fill-opacity",f.fillOpacity),u.setAttribute("fill-rule",f.fillRule||"evenodd")):u.setAttribute("fill","none"))},_updatePoly:function(o,u){this._setPath(o,I(o._parts,u))},_updateCircle:function(o){var u=o._point,f=Math.max(Math.round(o._radius),1),m=Math.max(Math.round(o._radiusY),1)||f,y="a"+f+","+m+" 0 1,0 ",E=o._empty()?"M0 0":"M"+(u.x-f)+","+u.y+y+f*2+",0 "+y+-f*2+",0 ";this._setPath(o,E)},_setPath:function(o,u){o._path.setAttribute("d",u)},_bringToFront:function(o){ys(o._path)},_bringToBack:function(o){bs(o._path)}});mt.vml&&fr.include(O_);function id(o){return mt.svg||mt.vml?new fr(o):null}Ut.include({getRenderer:function(o){var u=o.options.renderer||this._getPaneRenderer(o.options.pane)||this.options.renderer||this._renderer;return u||(u=this._renderer=this._createRenderer()),this.hasLayer(u)||this.addLayer(u),u},_getPaneRenderer:function(o){if(o==="overlayPane"||o===void 0)return!1;var u=this._paneRenderers[o];return u===void 0&&(u=this._createRenderer({pane:o}),this._paneRenderers[o]=u),u},_createRenderer:function(o){return this.options.preferCanvas&&ed(o)||id(o)}});var nd=Ss.extend({initialize:function(o,u){Ss.prototype.initialize.call(this,this._boundsToLatLngs(o),u)},setBounds:function(o){return this.setLatLngs(this._boundsToLatLngs(o))},_boundsToLatLngs:function(o){return o=ct(o),[o.getSouthWest(),o.getNorthWest(),o.getNorthEast(),o.getSouthEast()]}});function I_(o,u){return new nd(o,u)}fr.create=Ro,fr.pointsToPath=I,Zi.geometryToLayer=Lo,Zi.coordsToLatLng=zl,Zi.coordsToLatLngs=Ao,Zi.latLngToCoords=$l,Zi.latLngsToCoords=Do,Zi.getFeature=ks,Zi.asFeature=Po,Ut.mergeOptions({boxZoom:!0});var sd=Oi.extend({initialize:function(o){this._map=o,this._container=o._container,this._pane=o._panes.overlayPane,this._resetStateTimeout=0,o.on("unload",this._destroy,this)},addHooks:function(){It(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){se(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){fe(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(o){if(!o.shiftKey||o.which!==1&&o.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),sr(),Sl(),this._startPoint=this._map.mouseEventToContainerPoint(o),It(document,{contextmenu:Hn,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(o){this._moved||(this._moved=!0,this._box=Zt("div","leaflet-zoom-box",this._container),Bt(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(o);var u=new vt(this._point,this._startPoint),f=u.getSize();we(this._box,u.min),this._box.style.width=f.x+"px",this._box.style.height=f.y+"px"},_finish:function(){this._moved&&(fe(this._box),ge(this._container,"leaflet-crosshair")),rr(),kl(),se(document,{contextmenu:Hn,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(o){if(!(o.which!==1&&o.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(a(this._resetState,this),0);var u=new Mt(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(u).fire("boxzoomend",{boxZoomBounds:u})}},_onKeyDown:function(o){o.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});Ut.addInitHook("addHandler","boxZoom",sd),Ut.mergeOptions({doubleClickZoom:!0});var rd=Oi.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(o){var u=this._map,f=u.getZoom(),m=u.options.zoomDelta,y=o.originalEvent.shiftKey?f-m:f+m;u.options.doubleClickZoom==="center"?u.setZoom(y):u.setZoomAround(o.containerPoint,y)}});Ut.addInitHook("addHandler","doubleClickZoom",rd),Ut.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var od=Oi.extend({addHooks:function(){if(!this._draggable){var o=this._map;this._draggable=new mn(o._mapPane,o._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),o.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),o.on("zoomend",this._onZoomEnd,this),o.whenReady(this._onZoomEnd,this))}Bt(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){ge(this._map._container,"leaflet-grab"),ge(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var o=this._map;if(o._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var u=ct(this._map.options.maxBounds);this._offsetLimit=kt(this._map.latLngToContainerPoint(u.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(u.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;o.fire("movestart").fire("dragstart"),o.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(o){if(this._map.options.inertia){var u=this._lastTime=+new Date,f=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(f),this._times.push(u),this._prunePositions(u)}this._map.fire("move",o).fire("drag",o)},_prunePositions:function(o){for(;this._positions.length>1&&o-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var o=this._map.getSize().divideBy(2),u=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=u.subtract(o).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(o,u){return o-(o-u)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var o=this._draggable._newPos.subtract(this._draggable._startPos),u=this._offsetLimit;o.xu.max.x&&(o.x=this._viscousLimit(o.x,u.max.x)),o.y>u.max.y&&(o.y=this._viscousLimit(o.y,u.max.y)),this._draggable._newPos=this._draggable._startPos.add(o)}},_onPreDragWrap:function(){var o=this._worldWidth,u=Math.round(o/2),f=this._initialWorldOffset,m=this._draggable._newPos.x,y=(m-u+f)%o+u-f,E=(m+u+f)%o-u-f,F=Math.abs(y+f)0?E:-E))-u;this._delta=0,this._startTime=null,F&&(o.options.scrollWheelZoom==="center"?o.setZoom(u+F):o.setZoomAround(this._lastMousePos,u+F))}});Ut.addInitHook("addHandler","scrollWheelZoom",ld);var F_=600;Ut.mergeOptions({tapHold:mt.touchNative&&mt.safari&&mt.mobile,tapTolerance:15});var cd=Oi.extend({addHooks:function(){It(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){se(this._map._container,"touchstart",this._onDown,this)},_onDown:function(o){if(clearTimeout(this._holdTimeout),o.touches.length===1){var u=o.touches[0];this._startPos=this._newPos=new W(u.clientX,u.clientY),this._holdTimeout=setTimeout(a(function(){this._cancel(),this._isTapValid()&&(It(document,"touchend",De),It(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",u))},this),F_),It(document,"touchend touchcancel contextmenu",this._cancel,this),It(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function o(){se(document,"touchend",De),se(document,"touchend touchcancel",o)},_cancel:function(){clearTimeout(this._holdTimeout),se(document,"touchend touchcancel contextmenu",this._cancel,this),se(document,"touchmove",this._onMove,this)},_onMove:function(o){var u=o.touches[0];this._newPos=new W(u.clientX,u.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(o,u){var f=new MouseEvent(o,{bubbles:!0,cancelable:!0,view:window,screenX:u.screenX,screenY:u.screenY,clientX:u.clientX,clientY:u.clientY});f._simulated=!0,u.target.dispatchEvent(f)}});Ut.addInitHook("addHandler","tapHold",cd),Ut.mergeOptions({touchZoom:mt.touch,bounceAtZoomLimits:!0});var ud=Oi.extend({addHooks:function(){Bt(this._map._container,"leaflet-touch-zoom"),It(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){ge(this._map._container,"leaflet-touch-zoom"),se(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(o){var u=this._map;if(!(!o.touches||o.touches.length!==2||u._animatingZoom||this._zooming)){var f=u.mouseEventToContainerPoint(o.touches[0]),m=u.mouseEventToContainerPoint(o.touches[1]);this._centerPoint=u.getSize()._divideBy(2),this._startLatLng=u.containerPointToLatLng(this._centerPoint),u.options.touchZoom!=="center"&&(this._pinchStartLatLng=u.containerPointToLatLng(f.add(m)._divideBy(2))),this._startDist=f.distanceTo(m),this._startZoom=u.getZoom(),this._moved=!1,this._zooming=!0,u._stop(),It(document,"touchmove",this._onTouchMove,this),It(document,"touchend touchcancel",this._onTouchEnd,this),De(o)}},_onTouchMove:function(o){if(!(!o.touches||o.touches.length!==2||!this._zooming)){var u=this._map,f=u.mouseEventToContainerPoint(o.touches[0]),m=u.mouseEventToContainerPoint(o.touches[1]),y=f.distanceTo(m)/this._startDist;if(this._zoom=u.getScaleZoom(y,this._startZoom),!u.options.bounceAtZoomLimits&&(this._zoomu.getMaxZoom()&&y>1)&&(this._zoom=u._limitZoom(this._zoom)),u.options.touchZoom==="center"){if(this._center=this._startLatLng,y===1)return}else{var E=f._add(m)._divideBy(2)._subtract(this._centerPoint);if(y===1&&E.x===0&&E.y===0)return;this._center=u.unproject(u.project(this._pinchStartLatLng,this._zoom).subtract(E),this._zoom)}this._moved||(u._moveStart(!0,!1),this._moved=!0),tt(this._animRequest);var F=a(u._move,u,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=z(F,this,!0),De(o)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,tt(this._animRequest),se(document,"touchmove",this._onTouchMove,this),se(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});Ut.addInitHook("addHandler","touchZoom",ud),Ut.BoxZoom=sd,Ut.DoubleClickZoom=rd,Ut.Drag=od,Ut.Keyboard=ad,Ut.ScrollWheelZoom=ld,Ut.TapHold=cd,Ut.TouchZoom=ud,e.Bounds=vt,e.Browser=mt,e.CRS=Wt,e.Canvas=td,e.Circle=Nl,e.CircleMarker=Mo,e.Class=it,e.Control=xi,e.DivIcon=Xh,e.DivOverlay=Ii,e.DomEvent=Qv,e.DomUtil=Xv,e.Draggable=mn,e.Evented=st,e.FeatureGroup=qi,e.GeoJSON=Zi,e.GridLayer=hr,e.Handler=Oi,e.Icon=xs,e.ImageOverlay=Oo,e.LatLng=bt,e.LatLngBounds=Mt,e.Layer=Si,e.LayerGroup=ws,e.LineUtil=d_,e.Map=Ut,e.Marker=To,e.Mixin=o_,e.Path=gn,e.Point=W,e.PolyUtil=a_,e.Polygon=Ss,e.Polyline=Gi,e.Popup=Io,e.PosAnimation=Oh,e.Projection=f_,e.Rectangle=nd,e.Renderer=Yi,e.SVG=fr,e.SVGOverlay=Kh,e.TileLayer=Es,e.Tooltip=Fo,e.Transformation=k,e.Util=ot,e.VideoOverlay=Yh,e.bind=a,e.bounds=kt,e.canvas=ed,e.circle=w_,e.circleMarker=b_,e.control=lr,e.divIcon=A_,e.extend=s,e.featureGroup=v_,e.geoJSON=Zh,e.geoJson=k_,e.gridLayer=D_,e.icon=__,e.imageOverlay=E_,e.latLng=yt,e.latLngBounds=ct,e.layerGroup=g_,e.map=t_,e.marker=y_,e.point=nt,e.polygon=S_,e.polyline=x_,e.popup=M_,e.rectangle=I_,e.setOptions=_,e.stamp=h,e.svg=id,e.svgOverlay=T_,e.tileLayer=Jh,e.tooltip=L_,e.transformation=A,e.version=n,e.videoOverlay=C_;var R_=window.L;e.noConflict=function(){return window.L=R_,this},window.L=e})})(Fu,Fu.exports);var Xt=Fu.exports;const Ln=ul(Xt),_A={init(){const i=(n,s)=>{n.forEach(r=>{if(r.isIntersecting){console.log("init map");const a=r.target;a.style.width="100%",a.style.height=a.getAttribute("data-height")||"500px";const l=a.getAttribute("data-lat"),h=a.getAttribute("data-lon"),c=Ln.map(a.id,{attributionControl:!1,editable:!0}).setView([l,h],16);Ln.tileLayer(a.getAttribute("data-source"),{attribution:""}).addTo(c);const d=Ln.icon({iconUrl:"/static/images/marker-icon.png",iconSize:[25,41],iconAnchor:[12,20]});Ln.marker([l,h],{icon:d}).addTo(c),s.unobserve(a)}})},t=new IntersectionObserver(i);document.querySelectorAll(".map-point").forEach(n=>t.observe(n))}},yA={init(){document.addEventListener("livewire:initialized",()=>{window.Livewire.hook("commit",({component:i,commit:t,respond:e,succeed:n,fail:s})=>{e(r=>{document.querySelectorAll("dialog").forEach(a=>{a.hasAttribute("auto-close-off")||a.close()})})})})}};(function(i,t){i(Ln)})(function(i){i.Editable=i.Evented.extend({statics:{FORWARD:1,BACKWARD:-1},options:{zIndex:1e3,polygonClass:i.Polygon,polylineClass:i.Polyline,markerClass:i.Marker,rectangleClass:i.Rectangle,circleClass:i.Circle,drawingCSSClass:"leaflet-editable-drawing",drawingCursor:"crosshair",editLayer:void 0,featuresLayer:void 0,polylineEditorClass:void 0,polygonEditorClass:void 0,markerEditorClass:void 0,rectangleEditorClass:void 0,circleEditorClass:void 0,lineGuideOptions:{},skipMiddleMarkers:!1},initialize:function(c,d){i.setOptions(this,d),this._lastZIndex=this.options.zIndex,this.map=c,this.editLayer=this.createEditLayer(),this.featuresLayer=this.createFeaturesLayer(),this.forwardLineGuide=this.createLineGuide(),this.backwardLineGuide=this.createLineGuide()},fireAndForward:function(c,d){d=d||{},d.editTools=this,this.fire(c,d),this.map.fire(c,d)},createLineGuide:function(){var c=i.extend({dashArray:"5,10",weight:1,interactive:!1},this.options.lineGuideOptions);return i.polyline([],c)},createVertexIcon:function(c){return i.Browser.mobile&&i.Browser.touch?new i.Editable.TouchVertexIcon(c):new i.Editable.VertexIcon(c)},createEditLayer:function(){return this.options.editLayer||new i.LayerGroup().addTo(this.map)},createFeaturesLayer:function(){return this.options.featuresLayer||new i.LayerGroup().addTo(this.map)},moveForwardLineGuide:function(c){this.forwardLineGuide._latlngs.length&&(this.forwardLineGuide._latlngs[1]=c,this.forwardLineGuide._bounds.extend(c),this.forwardLineGuide.redraw())},moveBackwardLineGuide:function(c){this.backwardLineGuide._latlngs.length&&(this.backwardLineGuide._latlngs[1]=c,this.backwardLineGuide._bounds.extend(c),this.backwardLineGuide.redraw())},anchorForwardLineGuide:function(c){this.forwardLineGuide._latlngs[0]=c,this.forwardLineGuide._bounds.extend(c),this.forwardLineGuide.redraw()},anchorBackwardLineGuide:function(c){this.backwardLineGuide._latlngs[0]=c,this.backwardLineGuide._bounds.extend(c),this.backwardLineGuide.redraw()},attachForwardLineGuide:function(){this.editLayer.addLayer(this.forwardLineGuide)},attachBackwardLineGuide:function(){this.editLayer.addLayer(this.backwardLineGuide)},detachForwardLineGuide:function(){this.forwardLineGuide.setLatLngs([]),this.editLayer.removeLayer(this.forwardLineGuide)},detachBackwardLineGuide:function(){this.backwardLineGuide.setLatLngs([]),this.editLayer.removeLayer(this.backwardLineGuide)},blockEvents:function(){this._oldTargets||(this._oldTargets=this.map._targets,this.map._targets={})},unblockEvents:function(){this._oldTargets&&(this.map._targets=i.extend(this.map._targets,this._oldTargets),delete this._oldTargets)},registerForDrawing:function(c){this._drawingEditor&&this.unregisterForDrawing(this._drawingEditor),this.blockEvents(),c.reset(),this._drawingEditor=c,this.map.on("mousemove touchmove",c.onDrawingMouseMove,c),this.map.on("mousedown",this.onMousedown,this),this.map.on("mouseup",this.onMouseup,this),i.DomUtil.addClass(this.map._container,this.options.drawingCSSClass),this.defaultMapCursor=this.map._container.style.cursor,this.map._container.style.cursor=this.options.drawingCursor},unregisterForDrawing:function(c){this.unblockEvents(),i.DomUtil.removeClass(this.map._container,this.options.drawingCSSClass),this.map._container.style.cursor=this.defaultMapCursor,c=c||this._drawingEditor,c&&(this.map.off("mousemove touchmove",c.onDrawingMouseMove,c),this.map.off("mousedown",this.onMousedown,this),this.map.off("mouseup",this.onMouseup,this),c===this._drawingEditor&&(delete this._drawingEditor,c._drawing&&c.cancelDrawing()))},onMousedown:function(c){c.originalEvent.which==1&&(this._mouseDown=c,this._drawingEditor.onDrawingMouseDown(c))},onMouseup:function(c){if(this._mouseDown){var d=this._drawingEditor,p=this._mouseDown;if(this._mouseDown=null,d.onDrawingMouseUp(c),this._drawingEditor!==d)return;var g=i.point(p.originalEvent.clientX,p.originalEvent.clientY),v=i.point(c.originalEvent.clientX,c.originalEvent.clientY).distanceTo(g);Math.abs(v)<9*(window.devicePixelRatio||1)&&this._drawingEditor.onDrawingClick(c)}},drawing:function(){return this._drawingEditor&&this._drawingEditor.drawing()},stopDrawing:function(){this.unregisterForDrawing()},commitDrawing:function(c){this._drawingEditor&&this._drawingEditor.commitDrawing(c)},connectCreatedToMap:function(c){return this.featuresLayer.addLayer(c)},startPolyline:function(c,d){var p=this.createPolyline([],d);return p.enableEdit(this.map).newShape(c),p},startPolygon:function(c,d){var p=this.createPolygon([],d);return p.enableEdit(this.map).newShape(c),p},startMarker:function(c,d){c=c||this.map.getCenter().clone();var p=this.createMarker(c,d);return p.enableEdit(this.map).startDrawing(),p},startRectangle:function(c,d){var p=c||i.latLng([0,0]),g=new i.LatLngBounds(p,p),v=this.createRectangle(g,d);return v.enableEdit(this.map).startDrawing(),v},startCircle:function(c,d){c=c||this.map.getCenter().clone();var p=this.createCircle(c,d);return p.enableEdit(this.map).startDrawing(),p},startHole:function(c,d){c.newHole(d)},createLayer:function(c,d,p){p=i.Util.extend({editOptions:{editTools:this}},p);var g=new c(d,p);return this.fireAndForward("editable:created",{layer:g}),g},createPolyline:function(c,d){return this.createLayer(d&&d.polylineClass||this.options.polylineClass,c,d)},createPolygon:function(c,d){return this.createLayer(d&&d.polygonClass||this.options.polygonClass,c,d)},createMarker:function(c,d){return this.createLayer(d&&d.markerClass||this.options.markerClass,c,d)},createRectangle:function(c,d){return this.createLayer(d&&d.rectangleClass||this.options.rectangleClass,c,d)},createCircle:function(c,d){return this.createLayer(d&&d.circleClass||this.options.circleClass,c,d)}}),i.extend(i.Editable,{makeCancellable:function(c){c.cancel=function(){c._cancelled=!0}}}),i.Map.mergeOptions({editToolsClass:i.Editable,editable:!1,editOptions:{}}),i.Map.addInitHook(function(){this.whenReady(function(){this.options.editable&&(this.editTools=new this.options.editToolsClass(this,this.options.editOptions))})}),i.Editable.VertexIcon=i.DivIcon.extend({options:{iconSize:new i.Point(8,8)}}),i.Editable.TouchVertexIcon=i.Editable.VertexIcon.extend({options:{iconSize:new i.Point(20,20)}}),i.Editable.VertexMarker=i.Marker.extend({options:{draggable:!0,className:"leaflet-div-icon leaflet-vertex-icon"},initialize:function(c,d,p,g){this.latlng=c,this.latlngs=d,this.editor=p,i.Marker.prototype.initialize.call(this,c,g),this.options.icon=this.editor.tools.createVertexIcon({className:this.options.className}),this.latlng.__vertex=this,this.editor.editLayer.addLayer(this),this.setZIndexOffset(p.tools._lastZIndex+1)},onAdd:function(c){i.Marker.prototype.onAdd.call(this,c),this.on("drag",this.onDrag),this.on("dragstart",this.onDragStart),this.on("dragend",this.onDragEnd),this.on("mouseup",this.onMouseup),this.on("click",this.onClick),this.on("contextmenu",this.onContextMenu),this.on("mousedown touchstart",this.onMouseDown),this.on("mouseover",this.onMouseOver),this.on("mouseout",this.onMouseOut),this.addMiddleMarkers()},onRemove:function(c){this.middleMarker&&this.middleMarker.delete(),delete this.latlng.__vertex,this.off("drag",this.onDrag),this.off("dragstart",this.onDragStart),this.off("dragend",this.onDragEnd),this.off("mouseup",this.onMouseup),this.off("click",this.onClick),this.off("contextmenu",this.onContextMenu),this.off("mousedown touchstart",this.onMouseDown),this.off("mouseover",this.onMouseOver),this.off("mouseout",this.onMouseOut),i.Marker.prototype.onRemove.call(this,c)},onDrag:function(c){c.vertex=this,this.editor.onVertexMarkerDrag(c);var d=i.DomUtil.getPosition(this._icon),p=this._map.layerPointToLatLng(d);this.latlng.update(p),this._latlng=this.latlng,this.editor.refresh(),this.middleMarker&&this.middleMarker.updateLatLng();var g=this.getNext();g&&g.middleMarker&&g.middleMarker.updateLatLng()},onDragStart:function(c){c.vertex=this,this.editor.onVertexMarkerDragStart(c)},onDragEnd:function(c){c.vertex=this,this.editor.onVertexMarkerDragEnd(c)},onClick:function(c){c.vertex=this,this.editor.onVertexMarkerClick(c)},onMouseup:function(c){i.DomEvent.stop(c),c.vertex=this,this.editor.map.fire("mouseup",c)},onContextMenu:function(c){c.vertex=this,this.editor.onVertexMarkerContextMenu(c)},onMouseDown:function(c){c.vertex=this,this.editor.onVertexMarkerMouseDown(c)},onMouseOver:function(c){c.vertex=this,this.editor.onVertexMarkerMouseOver(c)},onMouseOut:function(c){c.vertex=this,this.editor.onVertexMarkerMouseOut(c)},delete:function(){var c=this.getNext();this.latlngs.splice(this.getIndex(),1),this.editor.editLayer.removeLayer(this),this.editor.onVertexDeleted({latlng:this.latlng,vertex:this}),this.latlngs.length||this.editor.deleteShape(this.latlngs),c&&c.resetMiddleMarker(),this.editor.refresh()},getIndex:function(){return this.latlngs.indexOf(this.latlng)},getLastIndex:function(){return this.latlngs.length-1},getPrevious:function(){if(!(this.latlngs.length<2)){var c=this.getIndex(),d=c-1;c===0&&this.editor.CLOSED&&(d=this.getLastIndex());var p=this.latlngs[d];if(p)return p.__vertex}},getNext:function(){if(!(this.latlngs.length<2)){var c=this.getIndex(),d=c+1;c===this.getLastIndex()&&this.editor.CLOSED&&(d=0);var p=this.latlngs[d];if(p)return p.__vertex}},addMiddleMarker:function(c){this.editor.hasMiddleMarkers()&&(c=c||this.getPrevious(),c&&!this.middleMarker&&(this.middleMarker=this.editor.addMiddleMarker(c,this,this.latlngs,this.editor)))},addMiddleMarkers:function(){if(this.editor.hasMiddleMarkers()){var c=this.getPrevious();c&&this.addMiddleMarker(c);var d=this.getNext();d&&d.resetMiddleMarker()}},resetMiddleMarker:function(){this.middleMarker&&this.middleMarker.delete(),this.addMiddleMarker()},split:function(){this.editor.splitShape&&this.editor.splitShape(this.latlngs,this.getIndex())},continue:function(){if(this.editor.continueBackward){var c=this.getIndex();c===0?this.editor.continueBackward(this.latlngs):c===this.getLastIndex()&&this.editor.continueForward(this.latlngs)}}}),i.Editable.mergeOptions({vertexMarkerClass:i.Editable.VertexMarker}),i.Editable.MiddleMarker=i.Marker.extend({options:{opacity:.5,className:"leaflet-div-icon leaflet-middle-icon",draggable:!0},initialize:function(c,d,p,g,v){this.left=c,this.right=d,this.editor=g,this.latlngs=p,i.Marker.prototype.initialize.call(this,this.computeLatLng(),v),this._opacity=this.options.opacity,this.options.icon=this.editor.tools.createVertexIcon({className:this.options.className}),this.editor.editLayer.addLayer(this),this.setVisibility()},setVisibility:function(){var c=this._map.latLngToContainerPoint(this.left.latlng),d=this._map.latLngToContainerPoint(this.right.latlng),p=i.point(this.options.icon.options.iconSize);c.distanceTo(d)=this.MIN_VERTEX-1&&(p=!0):d===0&&this._drawing===i.Editable.BACKWARD&&this._drawnLatLngs.length>=this.MIN_VERTEX||d===0&&this._drawing===i.Editable.FORWARD&&this._drawnLatLngs.length>=this.MIN_VERTEX&&this.CLOSED?p=!0:this.onVertexRawMarkerClick(c),this.fireAndForward("editable:vertex:clicked",c),p&&this.commitDrawing(c)}},onVertexRawMarkerClick:function(c){this.fireAndForward("editable:vertex:rawclick",c),!c._cancelled&&this.vertexCanBeDeleted(c.vertex)&&c.vertex.delete()},vertexCanBeDeleted:function(c){return c.latlngs.length>this.MIN_VERTEX},onVertexDeleted:function(c){this.fireAndForward("editable:vertex:deleted",c)},onVertexMarkerCtrlClick:function(c){this.fireAndForward("editable:vertex:ctrlclick",c)},onVertexMarkerShiftClick:function(c){this.fireAndForward("editable:vertex:shiftclick",c)},onVertexMarkerMetaKeyClick:function(c){this.fireAndForward("editable:vertex:metakeyclick",c)},onVertexMarkerAltClick:function(c){this.fireAndForward("editable:vertex:altclick",c)},onVertexMarkerContextMenu:function(c){this.fireAndForward("editable:vertex:contextmenu",c)},onVertexMarkerMouseDown:function(c){this.fireAndForward("editable:vertex:mousedown",c)},onVertexMarkerMouseOver:function(c){this.fireAndForward("editable:vertex:mouseover",c)},onVertexMarkerMouseOut:function(c){this.fireAndForward("editable:vertex:mouseout",c)},onMiddleMarkerMouseDown:function(c){this.fireAndForward("editable:middlemarker:mousedown",c)},onVertexMarkerDrag:function(c){this.onMove(c),this.feature._bounds&&this.extendBounds(c),this.fireAndForward("editable:vertex:drag",c)},onVertexMarkerDragStart:function(c){this.fireAndForward("editable:vertex:dragstart",c)},onVertexMarkerDragEnd:function(c){this.fireAndForward("editable:vertex:dragend",c)},setDrawnLatLngs:function(c){this._drawnLatLngs=c||this.getDefaultLatLngs()},startDrawing:function(){this._drawnLatLngs||this.setDrawnLatLngs(),i.Editable.BaseEditor.prototype.startDrawing.call(this)},startDrawingForward:function(){this.startDrawing()},endDrawing:function(){this.tools.detachForwardLineGuide(),this.tools.detachBackwardLineGuide(),this._drawnLatLngs&&this._drawnLatLngs.length"u"&&(d=this.feature._latlngs.length),this.feature._latlngs.splice(d,0,c),this.feature.redraw(),this._enabled&&this.reset()},extendBounds:function(c){this.feature._bounds.extend(c.vertex.latlng)},onDragStart:function(c){this.editLayer.clearLayers(),i.Editable.BaseEditor.prototype.onDragStart.call(this,c)},onDragEnd:function(c){this.initVertexMarkers(),i.Editable.BaseEditor.prototype.onDragEnd.call(this,c)}}),i.Editable.PolylineEditor=i.Editable.PathEditor.extend({startDrawingBackward:function(){this._drawing=i.Editable.BACKWARD,this.startDrawing()},continueBackward:function(c){this.drawing()||(c=c||this.getDefaultLatLngs(),this.setDrawnLatLngs(c),c.length>0&&(this.tools.attachBackwardLineGuide(),this.tools.anchorBackwardLineGuide(c[0])),this.startDrawingBackward())},continueForward:function(c){this.drawing()||(c=c||this.getDefaultLatLngs(),this.setDrawnLatLngs(c),c.length>0&&(this.tools.attachForwardLineGuide(),this.tools.anchorForwardLineGuide(c[c.length-1])),this.startDrawingForward())},getDefaultLatLngs:function(c){return c=c||this.feature._latlngs,!c.length||c[0]instanceof i.LatLng?c:this.getDefaultLatLngs(c[0])},ensureMulti:function(){this.feature._latlngs.length&&h(this.feature._latlngs)&&(this.feature._latlngs=[this.feature._latlngs])},addNewEmptyShape:function(){if(this.feature._latlngs.length){var c=[];return this.appendShape(c),c}else return this.feature._latlngs},formatShape:function(c){if(h(c))return c;if(c[0])return this.formatShape(c[0])},splitShape:function(c,d){if(!(!d||d>=c.length-1)){this.ensureMulti();var p=this.feature._latlngs.indexOf(c);if(p!==-1){var g=c.slice(0,d+1),v=c.slice(d);v[0]=i.latLng(v[0].lat,v[0].lng,v[0].alt),this.feature._latlngs.splice(p,1,g,v),this.refresh(),this.reset()}}}}),i.Editable.PolygonEditor=i.Editable.PathEditor.extend({CLOSED:!0,MIN_VERTEX:3,newPointForward:function(c){i.Editable.PathEditor.prototype.newPointForward.call(this,c),this.tools.backwardLineGuide._latlngs.length||this.tools.anchorBackwardLineGuide(c),this._drawnLatLngs.length===2&&this.tools.attachBackwardLineGuide()},addNewEmptyHole:function(c){this.ensureNotFlat();var d=this.feature.shapeAt(c);if(d){var p=[];return d.push(p),p}},newHole:function(c){var d=this.addNewEmptyHole(c);d&&(this.setDrawnLatLngs(d),this.startDrawingForward(),c&&this.newPointForward(c))},addNewEmptyShape:function(){if(this.feature._latlngs.length&&this.feature._latlngs[0].length){var c=[];return this.appendShape(c),c}else return this.feature._latlngs},ensureMulti:function(){this.feature._latlngs.length&&h(this.feature._latlngs[0])&&(this.feature._latlngs=[this.feature._latlngs])},ensureNotFlat:function(){(!this.feature._latlngs.length||h(this.feature._latlngs))&&(this.feature._latlngs=[this.feature._latlngs])},vertexCanBeDeleted:function(c){var d=this.feature.parentShape(c.latlngs),p=i.Util.indexOf(d,c.latlngs);return p>0?!0:i.Editable.PathEditor.prototype.vertexCanBeDeleted.call(this,c)},getDefaultLatLngs:function(){return this.feature._latlngs.length||this.feature._latlngs.push([]),this.feature._latlngs[0]},formatShape:function(c){return h(c)&&(!c[0]||c[0].length!==0)?[c]:c}}),i.Editable.RectangleEditor=i.Editable.PathEditor.extend({CLOSED:!0,MIN_VERTEX:4,options:{skipMiddleMarkers:!0},extendBounds:function(c){var d=c.vertex.getIndex(),p=c.vertex.getNext(),g=c.vertex.getPrevious(),v=(d+2)%4,b=c.vertex.latlngs[v],_=new i.LatLngBounds(c.latlng,b);g.latlng.update([c.latlng.lat,b.lng]),p.latlng.update([b.lat,c.latlng.lng]),this.updateBounds(_),this.refreshVertexMarkers()},onDrawingMouseDown:function(c){i.Editable.PathEditor.prototype.onDrawingMouseDown.call(this,c),this.connect();var d=this.getDefaultLatLngs();d.length===3&&d.push(c.latlng);var p=new i.LatLngBounds(c.latlng,c.latlng);this.updateBounds(p),this.updateLatLngs(p),this.refresh(),this.reset(),c.originalEvent._simulated=!1,this.map.dragging._draggable._onUp(c.originalEvent),d[3].__vertex.dragging._draggable._onDown(c.originalEvent)},onDrawingMouseUp:function(c){this.commitDrawing(c),c.originalEvent._simulated=!1,i.Editable.PathEditor.prototype.onDrawingMouseUp.call(this,c)},onDrawingMouseMove:function(c){c.originalEvent._simulated=!1,i.Editable.PathEditor.prototype.onDrawingMouseMove.call(this,c)},getDefaultLatLngs:function(c){return c||this.feature._latlngs[0]},updateBounds:function(c){this.feature._bounds=c},updateLatLngs:function(c){for(var d=this.getDefaultLatLngs(),p=this.feature._boundsToLatLngs(c),g=0;gc.lat!=v.lat>c.lat&&c.lng<(v.lng-g.lng)*(c.lat-g.lat)/(v.lat-g.lat)+g.lng&&(p=!p);return p},parentShape:function(c,d){if(d=d||this._latlngs,!!d){var p=i.Util.indexOf(d,c);if(p!==-1)return d;for(var g=0;g=0)&&(e[s]=i[s]);return e}function ao(i){i.originalEvent.preventDefault(),i.originalEvent.stopPropagation()}function Ir(i){var t=this;if(!this.mapMoving){var e=this.getMap(),n=i.clientX,s=i.clientY;if(n===void 0&&s===void 0){var r=i.changedTouches[0];n=r.clientX,s=r.clientY}if(this.rectDrawing&&this.rectDrawEnd!==null){e.fire("as:dragging-rect-end");return}var a=i.index,l=a===void 0?null:a,h=e.getContainer(),c=h.getBoundingClientRect(),d=n-c.left,p=s-c.top;this.markers.length===0&&kA(this,[d,p]);var g=new Xt.Point(d,p),v=new Xt.DivIcon({className:Fn("area-select-marker"),iconSize:[16,16]}),b=new Xt.Marker(e.containerPointToLatLng(g),{icon:v,draggable:!0}),_=zv.bind(this);b.on("drag",_(l===null?this.markers.length:l)),b.on("dragstart",function(C){C.target.getElement().classList.add("active")}),b.on("dragend",function(C){C.target.getElement().classList.remove("active"),requestAnimationFrame(function(){t.onPolygonReady()})});var w={marker:b,index:l};if(b.on("dblclick",function(C){return function(x){x.originalEvent.stopPropagation(),e.fire("as:marker-remove",Zs({},w,{index:l===null?C:l}))}}(this.markers.length)),b.on(un,ao),b.addTo(e),e.fire("as:marker-add",w),l!==null)for(var T=function(x){t.markers[x].marker.off("drag"),t.markers[x].marker.on("drag",_(x)),t.markers[x].marker.off(un),t.markers[x].marker.on(un,ao),t.markers[x].marker.off("dblclick"),t.markers[x].marker.on("dblclick",function(D){e.fire("as:marker-remove",Zs({},t.markers[x],{index:x}))})},S=l+1;S=3;this.phase==="draw"&&(l?a.length===3&&a.forEach(function(h,c){var d=h.marker,p=d.getIcon();p.options.className=Fn("area-select-marker",c===0?"start-marker":null),d.setIcon(p)}):a.forEach(function(h){var c=h.marker,d=c.getIcon();d.options.className=Fn("area-select-marker","invalid"),c.setIcon(d)})),s.fire("as:update-polygon"),this.phase==="adjust"&&(s.fire("as:update-ghost-points"),this.onPolygonReady()),this.phase==="draw"&&(this.closeLine&&s.removeLayer(this.closeLine),l&&(this.closeLine=new Xt.Polyline([a[0].marker.getLatLng(),a[a.length-1].marker.getLatLng()],{weight:3,color:"#c0c0c0",className:"areaCloseLine"}),s.addLayer(this.closeLine)))}function TA(i){var t=this,e=i.index,n=e===void 0?0:e,s=this.getMap(),r=this.markers,a=r.length>3;if(a){var l=this.markers.splice(n||0,1);l[0].marker.removeFrom(s),s.fire("as:update-polygon"),this.phase==="adjust"&&s.fire("as:update-ghost-points");for(var h=function(p){t.markers[p].marker.off("drag"),t.markers[p].marker.on("drag",zv.bind(t)(p)),t.markers[p].marker.off(un),t.markers[p].marker.on(un,ao),t.markers[p].marker.off("dblclick"),t.markers[p].marker.on("dblclick",function(g){g.originalEvent.stopPropagation(),s.fire("as:marker-remove",Zs({},t.markers[p],{index:p}))})},c=n;c=3,s=new Xt.Polygon(e.map(function(r){var a=r.marker;return a.getLatLng()}),Zs({color:n?"rgb(45, 123, 200)":"rgba(220, 53, 69, 0.7)",weight:2},!n&&{dashArray:"5, 10"},{className:"drawing-area-poligon"}));s.on(un,function(r){Xt.DomEvent.stopPropagation(r)}),s.on("dblclick",function(r){return Xt.DomEvent.stopPropagation(r),i.onPolygonDblClick(r),!1}),this.polygon&&t.removeLayer(this.polygon),this.polygon=s,t.addLayer(this.polygon)}function LA(){var i=this,t=this.getMap();requestAnimationFrame(function(){i.clearGhostMarkers();var e=i.markers,n=i.ghostMarkers;e.forEach(function(s,r){var a=e[r+1]?e[r+1]:e[0],l=s.marker.getLatLng(),h=a.marker.getLatLng(),c=t.latLngToContainerPoint([(l.lat+h.lat)/2,(l.lng+h.lng)/2]),d=new Xt.DivIcon({className:Fn("area-select-ghost-marker"),iconSize:[16,16]}),p=new Xt.Marker(t.containerPointToLatLng(c),{icon:d,draggable:!0}),g={marker:p};p.on(un,ao),p.on("dblclick",ao),p.on("dragstart",OA.bind(i)()),p.on("drag",PA.bind(i)(n.length)),p.on("dragend",IA.bind(i)(n.length)),n.push(g),p.addTo(t)})})}function AA(){var i=this.getMap();i.dragging.enable(),i.removeLayer(this.closeLine),this.closeLine=null,this.markers[0].marker.getElement().classList.remove("start-marker"),this.setPhase("adjust"),i.fire("as:update-ghost-points"),this.onPolygonReady(),Nv(this)}function DA(i){if(Sh(i)){var t=this.getMap();this._dragStatus=t.dragging._enabled,i.stopPropagation(),i.target.blur();var e=this.options.active||this.phase==="adjust";e?(this._dragStatus||t.dragging.disable(),this.options.onButtonDeactivate(this.polygon,this,i),i.defaultPrevented||this.deactivate()):(this.options.onButtonActivate(this,i),i.defaultPrevented||this.activate())}}function zv(i){var t=this.getMap();return function(e){requestAnimationFrame(function(){t.fire("as:update-polygon"),t.fire("as:update-ghost-points")})}}function PA(i){var t=this,e=this.getMap();return function(n){var s=n.latlng;requestAnimationFrame(function(){var r=t.markers[i],a=t.markers[i+1]?t.markers[i+1]:t.markers[0];t.ghostPolygon&&e.removeLayer(t.ghostPolygon),t.ghostPolygon=new Xt.Polygon([r.marker.getLatLng(),s,a.marker.getLatLng()],{color:"rgb(45, 123, 200)",weight:2,opacity:.5,fillOpacity:.1,dashArray:"5, 10"}),e.addLayer(t.ghostPolygon),e.fire("as:update-polygon")})}}function OA(){return function(i){i.target.getElement().classList.add("active")}}function IA(i){var t=this,e=this.getMap();return function(n){var s=n.target;s.getElement().classList.remove("active"),s.removeFrom(e),t.ghostPolygon&&e.removeLayer(t.ghostPolygon);var r=e.latLngToContainerPoint(s.getLatLng()),a=e.getContainer(),l=a.getBoundingClientRect(),h={clientX:r.x+l.left,clientY:r.y+l.top,index:i+1};e.fire("as:point-add",h)}}function FA(i){if(!this.mapMoving&&this.markers.length===0&&i.which!==0&&i.buttons===1){var t=this.getMap();if(!this.rectDrawing){this.rectDrawStart=[i.clientX,i.clientY];var e={weight:2,color:"#8B4513",className:"rect-progress-line",opacity:.6};this.draggingRect=new Xt.LayerGroup().addLayer(new Xt.Polyline([],e)).addLayer(new Xt.Polyline([],e)).addTo(t),this.rectDrawing=!0;return}this.rectDrawEnd=[i.clientX,i.clientY];var n=[this.rectDrawStart[0],i.clientY],s=[i.clientX,this.rectDrawStart[1]],r=this.draggingRect.getLayers();r[0].setLatLngs([t.mouseEventToLatLng({clientX:this.rectDrawEnd[0],clientY:this.rectDrawEnd[1]}),t.mouseEventToLatLng({clientX:n[0],clientY:n[1]}),t.mouseEventToLatLng({clientX:this.rectDrawStart[0],clientY:this.rectDrawStart[1]})]),r[1].setLatLngs([t.mouseEventToLatLng({clientX:this.rectDrawEnd[0],clientY:this.rectDrawEnd[1]}),t.mouseEventToLatLng({clientX:s[0],clientY:s[1]}),t.mouseEventToLatLng({clientX:this.rectDrawStart[0],clientY:this.rectDrawStart[1]})])}}function RA(){this.rectDrawing=!1;var i={clientX:this.rectDrawStart[0],clientY:this.rectDrawStart[1]},t={clientX:this.rectDrawEnd[0],clientY:this.rectDrawStart[1]},e={clientX:this.rectDrawEnd[0],clientY:this.rectDrawEnd[1]},n={clientX:this.rectDrawStart[0],clientY:this.rectDrawEnd[1]};Ir.bind(this)(i),Ir.bind(this)(t),Ir.bind(this)(e),Ir.bind(this)(n),this._map.fire("as:creation-end"),this.rectDrawStart=null,this.rectDrawEnd=null,this.draggingRect.removeFrom(this._map)}var kh=Xt.Control.extend({options:{active:!1,fadeOnActivation:!0,onPolygonReady:function(t,e){},onPolygonDblClick:function(t,e,n){},onButtonActivate:function(t,e){},onButtonDeactivate:function(t,e,n){}},initialize:function(t){t===void 0&&(t={}),Xt.Util.setOptions(this,t),this._map=null,this.phase=t.active?"draw":"inactive",this.mapMoving=!1,this.rectDrawing=!1,this.rectDrawStart=null,this.rectDrawEnd=null,this.draggingRect=null,this.markers=[],this.ghostMarkers=[],this.polygon=null,this.closeLine=null,this._mapMoveStart=this._mapMoveStart.bind(this),this._mapMoveEnd=this._mapMoveEnd.bind(this),this._handleMouseMove=this._handleMouseMove.bind(this)},onAdd:function(t){this._container=Xt.DomUtil.create("div",Fn("leaflet-area-selector-control")),this.activateButton=Xt.DomUtil.create("button","",this._container),this.activateButton.setAttribute("aria-label","Draw shape"),this.activateButton.setAttribute("aria-describedby","draw-panel-help"),this.activateButton.addEventListener("click",DA.bind(this)),this.activateButton.addEventListener("dblclick",function(n){n.stopPropagation()}),this.options.active?this.activateButton.classList.add("active"):this.activateButton.classList.remove("active"),this._map=t;var e=SA(t,this.options);return this.addUserHelpPanel(e),t.getContainer().addEventListener("mousemove",this._handleMouseMove),t.on("movestart",this._mapMoveStart),t.on("moveend",this._mapMoveEnd),t.on("as:point-add",Ir.bind(this)),t.on("as:marker-add",CA.bind(this)),t.on("as:marker-remove",TA.bind(this)),t.on("as:creation-end",AA.bind(this)),t.on("as:update-polygon",MA.bind(this)),t.on("as:update-ghost-points",LA.bind(this)),t.on("as:dragging-rect-end",RA.bind(this)),this._container},onRemove:function(t){t.getContainer().removeEventListener("mousemove",this._handleMouseMove),t.off("movestart",this._mapMoveStart),t.off("moveend",this._mapMoveEnd),t.off("as:point-add"),t.off("as:marker-add"),t.off("as:marker-remove"),t.off("as:creation-end"),t.off("as:update-polygon"),t.off("as:update-ghost-points"),t.off("as:dragging-rect-end")},getMap:function(){return this._map},onPolygonReady:function(){this.options.onPolygonReady(this.polygon,this)},onPolygonDblClick:function(t){this.options.onPolygonDblClick(this.polygon,this,t)},addUserHelpPanel:function(t){var e=Xt.DomUtil.create("div",Fn("draw-pane-help"));e.setAttribute("id","draw-panel-help"),e.setAttribute("role","tooltip");var n="Define a polygon by clicking of the map to define vertexes"+(Xt.Browser.mobile?".":" or click-and-drag to obtain a rectangular shape.");e.textContent=n,t.appendChild(e)},setPhase:function(t,e){e===void 0&&(e=!1),this.phase=t,this.options.active=t==="draw",(e||this.phase==="draw")&&(this.clearGhostMarkers(),this.clearMarkers(),this.clearPolygon());var n=this._map.getPane(oo),s=n.parentNode;this.options.active?s.classList.remove("inactive"):s.classList.add("inactive")},_mapMoveStart:function(){this.options.active&&(this.mapMoving=!0)},_mapMoveEnd:function(){var t=this;if(this.options.active){var e=this._map;requestAnimationFrame(function(){t.mapMoving=!1});var n=e.getPane(oo),s=n.querySelector(".end-selection-area");if(s){var r=this.markers[0].marker,a=s.getBoundingClientRect(),l=e.latLngToContainerPoint(r.getLatLng());Vv(s,l,new Xt.Point(-a.width/2,-a.height/2))}}},hoverClosePoint:function(t){this.markers.length>2&&this.closeLine&&this.closeLine.removeFrom(this._map)},outClosePoint:function(t){this.closeLine&&this.closeLine.addTo(this._map)},clearMarkers:function(){var t=this;this.markers.forEach(function(e){var n=e.marker;n.removeFrom(t._map)}),this.markers=[]},clearGhostMarkers:function(){var t=this;this.ghostMarkers.forEach(function(e){var n=e.marker;n.removeFrom(t._map)}),this.ghostMarkers=[]},clearPolygon:function(){this.polygon&&this.polygon.removeFrom(this._map),this.polygon=null,this.closeLine&&this.closeLine.removeFrom(this._map),this.closeLine=null},deactivate:function(){Nv(this),this.activateButton.classList.remove("active"),this._map.getContainer().classList.remove("drawing-area"),this.setPhase("inactive",!0)},activate:function(){this._map.dragging.disable(),this.activateButton.classList.add("active"),this._map.getContainer().classList.add("drawing-area"),this.setPhase("draw",!0)},_handleMouseMove:function(t){this.options.active&&FA.bind(this)(t)}}),BA=function(t){return t===void 0&&(t={}),new kh(t)};Xt.Util.extend(Xt.Control,{DrawAreaSelection:kh,drawAreaSelection:BA});const VA=()=>{let i=document.getElementById("map-edit");if(!i||document.querySelectorAll("#map-edit.leaflet-touch").length>0)return;let t=!1;const e=document.querySelector(".map-button"),n=document.getElementById("map-data"),s="map-button-active",r=Ln.map("map-edit",{attributionControl:!1,editable:!0}).setView([50.378472,14.970598],5);Ln.tileLayer(i.dataset.source,{attribution:""}).addTo(r);let a;if(n.value.length>0){const p=JSON.parse(n.value).geometry.coordinates.map(g=>g.map(v=>v.reverse()));a=Ln.polygon(p).addTo(r),a.enableEdit(),r.fitBounds(a.getBounds())}r.on("as:point-add",()=>{const c=document.querySelectorAll(".invalid");l.markers.length>=2&&(l.setPhase("adjust"),l.getMap().dragging.enable(),l.getMap().fire("as:update-ghost-points"),c.forEach(d=>{d.classList.remove("invalid")}))});const l=new kh({onPolygonReady:c=>{n.value=JSON.stringify(c.toGeoJSON())}});r.on("editable:vertex:dragend",()=>{a&&(n.value=JSON.stringify(a.toGeoJSON()))}),r.addControl(l);const h=()=>{t=!t,t?(()=>{l.activate(),e.classList.add(s)})():(()=>{l.deactivate(),e.classList.remove(s)})()};e&&e.addEventListener("click",()=>h())};VA();document.addEventListener("livewire:initialized",()=>{Qp.init(),Livewire.on("catalog-filters.render",i=>{setTimeout(()=>{Qp.init(),Bv.init()},100)})});yA.init();Bv.init();_A.init();const lo={...gA,...vA},NA=i=>bb(i),_l="data-component",Wi={componentName:_l,hydrated:"data-hydrated",tooltip:"data-tooltip"},zA={component:`[${Wi.componentName}]`},tm={transitionDisabled:"transition-disabled",normalizeSvg:"normalize-svg"},$A=document.querySelectorAll(zA.component),he=new nm({isInit:!1,components:[]}),$v=i=>{const t=i.getAttribute(_l);if(i instanceof HTMLElement&&t in lo){const e=lo[t],n=i.getAttribute(Wi.hydrated);if(NA(e)&&!n)return i.setAttribute(Wi.hydrated,"true"),new e(i,{componentName:t})}return null},Xa=(i,t=!1)=>{i.forEach(e=>{if(!e.querySelectorAll)return;t&&Xa(e.querySelectorAll(`[${_l}]`),!0);const n=$v(e);n&&he.setState({components:[...he.getState().components,n]})}),he.setState({isInit:!0})},Hv=i=>{if(i)try{const t=i.getAttribute(Wi.tooltip);t&&new lo.Tooltip(i),!t&&i.children.length&&Array.from(i.children).forEach(e=>{Hv(e)})}catch{}};Xa($A);const HA=new MutationObserver(i=>{i.forEach(t=>{var e;if(t.type==="childList"){const n=[];Hv(t.addedNodes[0]);const s=Array.from(t.addedNodes).filter(r=>{const a=r.getAttribute&&r.getAttribute(Wi.componentName);return a||n.push(r),a});n.length&&n.forEach(r=>{if(r!=null&&r.querySelectorAll){const a=r.querySelectorAll(`[${_l}]`);Xa(a,!0)}}),Xa(s,!0)}if(t.type==="attributes"&&!t.target.getAttribute(Wi.hydrated)){const s=(e=he.getState().components)==null?void 0:e.filter(a=>{const l=a.getElement().isEqualNode(t.target);return l&&a.destroy(),!l}),r=$v(t.target);r&&(s==null||s.push(r),he.setState({components:s}))}})});HA.observe(document,{attributeFilter:[Wi.hydrated,Wi.tooltip],attributes:!0,subtree:!0,childList:!0,characterData:!0});document.addEventListener("DOMContentLoaded",()=>{setTimeout(()=>{document.body.classList.remove(tm.transitionDisabled),document.body.classList.remove(tm.normalizeSvg)},200),document.querySelectorAll(`[${lo.Tooltip.DATA_SET.content}]`).forEach(i=>{new lo.Tooltip(i)})});document.addEventListener("livewire:initialized",()=>{window.Livewire.hook("morphed",({el:i})=>{i.querySelectorAll(`[${Wi.componentName}]`).forEach(t=>{t.removeAttribute(Wi.hydrated)})})});function jA(){}const em={triggerInput:".__header-mobile-trigger__",searchInput:".__header-mobile-search-input__"};class UA extends Kt{constructor(t){super(t),this.triggerInput=this.element.querySelector(em.triggerInput),this.searchInput=this.element.querySelector(em.searchInput),this.addListeners()}onChangeTrigger(){setTimeout(()=>{this.searchInput.focus()})}addListeners(){this.triggerInput.addEventListener("change",this.onChangeTrigger.bind(this))}}const WA="Header",qA={headerMobile:".__header-mobile__"},im=document.querySelector(qA.headerMobile),GA=new Ys(WA);GA.add({name:"headerMenu",handler:jA}).run();im&&new UA(im);const ZA="Main",YA=new Ys(ZA);YA.run();const KA="Footer",XA=new Ys(KA);XA.run();const JA="Product-Details",jv={copyButton:".__copy-to-clipboard__",reviewInputId:".__review-input-id__"},QA={id:"data-id"};function tD(){const i=document.querySelector(jv.copyButton);Nm({HTMLTrigger:i,HTMLField:i})}function eD(){const i=document.querySelector(".product-details__description-trigger"),t=document.querySelector(".product-details__description-more");if(!t)return;const e=t.getAttribute("data-visible-text")||"Read more",n=t.getAttribute("data-hide-text")||"Hide",s=i.checked?e:n;t.textContent=s,i.addEventListener("change",()=>{const r=i.checked?e:n;t.textContent=r})}function iD(){const i=document.querySelector(jv.reviewInputId);i&&document.addEventListener("dialog-open",t=>{const e=t;if(e.detail.element.classList.contains("__review-reply-modal__")&&e.detail.target){const r=e.detail.target.getAttribute(QA.id);i.value=r,i.setAttribute("value",r)}})}const nD=new Ys(JA);nD.add({name:"initCopyListeners",handler:tD}).add({name:"checkDescriptionLines",handler:eD}).add({name:"passReviewId",handler:iD}).run();const sD="WalletPage",rD=new Ys(sD);rD.run();const ha={form:".__security-form__",switcher:".__security-switcher__",switcherInput:"#__security-switcher-input__",verifyButton:".__security-form-button__",modalClose:".__modal-close__"},Nc={modal:"__modal-trigger__",formDisable:"security__form_muted"},oD={modal:"security-disable"};function aD(){var l,h;const i=document.querySelector(ha.form),t=document.querySelector(ha.switcherInput),e=document.querySelector(ha.verifyButton),n=(l=he.getState().components)==null?void 0:l.find(c=>c.getElement().id===oD.modal),s=(h=n==null?void 0:n.getElement())==null?void 0:h.querySelectorAll(ha.modalClose),r=c=>{const d=c.target,p=d.checked,g=d.value;e.disabled=!p,!p&&g!=="on"&&(n==null||n.show()),e.disabled=!d.checked,i.classList[p?"remove":"add"](Nc.formDisable)},a=()=>{t.checked=!0,e.disabled=!1,i.classList.remove(Nc.formDisable)};i.classList[t.checked?"remove":"add"](Nc.formDisable),e.disabled=!t.checked,t.addEventListener("change",r),s==null||s.forEach(c=>{c.addEventListener("click",a)})}const lD="SecurityPage",cD=new Ys(lD);cD.add({name:"securityInit",handler:aD}).run();