From 6342f9b50b9ee973d3b39d1582735743d141669a Mon Sep 17 00:00:00 2001 From: Ben Thomson Date: Thu, 31 Aug 2023 14:24:50 +0800 Subject: [PATCH 1/6] Convert Snowboard in Winter to using standalone Snowboard --- .../system/assets/js/build/system.debug.js | 2 +- modules/system/assets/js/build/system.js | 2 +- .../js/snowboard/abstracts/PluginBase.js | 68 -- .../js/snowboard/abstracts/Singleton.js | 15 - .../assets/js/snowboard/ajax/Request.js | 2 +- .../ajax/handlers/AttributeRequest.js | 4 +- .../snowboard/build/snowboard.base.debug.js | 2 +- .../js/snowboard/build/snowboard.base.js | 2 +- .../js/snowboard/build/snowboard.data-attr.js | 2 +- .../js/snowboard/build/snowboard.extras.js | 2 +- .../js/snowboard/build/snowboard.request.js | 2 +- .../js/snowboard/build/snowboard.vendor.js | 5 +- .../assets/js/snowboard/extras/AssetLoader.js | 196 ------ .../js/snowboard/extras/AttachLoading.js | 2 +- .../assets/js/snowboard/extras/DataConfig.js | 222 ------- .../assets/js/snowboard/extras/Flash.js | 2 +- .../js/snowboard/extras/FlashListener.js | 2 +- .../js/snowboard/extras/FormValidation.js | 2 +- .../js/snowboard/extras/StripeLoader.js | 2 +- .../js/snowboard/extras/StylesheetLoader.js | 2 +- .../assets/js/snowboard/extras/Transition.js | 2 +- .../js/snowboard/main/InnerProxyHandler.js | 43 -- .../assets/js/snowboard/main/PluginLoader.js | 293 --------- .../assets/js/snowboard/main/ProxyHandler.js | 25 - .../assets/js/snowboard/main/Snowboard.js | 597 ----------------- .../js/snowboard/snowboard.backend.extras.js | 4 - .../js/snowboard/snowboard.base.debug.js | 14 +- .../assets/js/snowboard/snowboard.base.js | 14 +- .../assets/js/snowboard/snowboard.extras.js | 4 - .../assets/js/snowboard/utilities/Cookie.js | 134 ---- .../js/snowboard/utilities/JsonParser.js | 395 ----------- .../js/snowboard/utilities/Sanitizer.js | 64 -- .../assets/js/snowboard/utilities/Url.js | 165 ----- modules/system/package.json | 1 + .../cases/snowboard/extras/DataConfig.test.js | 316 --------- .../cases/snowboard/main/PluginLoader.test.js | 134 ---- .../js/cases/snowboard/main/Snowboard.test.js | 620 ------------------ modules/system/winter.mix.js | 2 +- 38 files changed, 31 insertions(+), 3334 deletions(-) delete mode 100644 modules/system/assets/js/snowboard/abstracts/PluginBase.js delete mode 100644 modules/system/assets/js/snowboard/abstracts/Singleton.js delete mode 100644 modules/system/assets/js/snowboard/extras/AssetLoader.js delete mode 100644 modules/system/assets/js/snowboard/extras/DataConfig.js delete mode 100644 modules/system/assets/js/snowboard/main/InnerProxyHandler.js delete mode 100644 modules/system/assets/js/snowboard/main/PluginLoader.js delete mode 100644 modules/system/assets/js/snowboard/main/ProxyHandler.js delete mode 100644 modules/system/assets/js/snowboard/main/Snowboard.js delete mode 100644 modules/system/assets/js/snowboard/utilities/Cookie.js delete mode 100644 modules/system/assets/js/snowboard/utilities/JsonParser.js delete mode 100644 modules/system/assets/js/snowboard/utilities/Sanitizer.js delete mode 100644 modules/system/assets/js/snowboard/utilities/Url.js delete mode 100644 modules/system/tests/js/cases/snowboard/extras/DataConfig.test.js delete mode 100644 modules/system/tests/js/cases/snowboard/main/PluginLoader.test.js delete mode 100644 modules/system/tests/js/cases/snowboard/main/Snowboard.test.js diff --git a/modules/system/assets/js/build/system.debug.js b/modules/system/assets/js/build/system.debug.js index 00e4106c9..a33c541d3 100644 --- a/modules/system/assets/js/build/system.debug.js +++ b/modules/system/assets/js/build/system.debug.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[]).push([[714,450,988],{579:function(e,t,s){s.d(t,{Z:function(){return n}});class n{constructor(e){this.snowboard=e}construct(){}dependencies(){return[]}listens(){return{}}destruct(){this.detach(),delete this.snowboard}destructor(){this.destruct()}}},281:function(e,t,s){s.d(t,{Z:function(){return i}});var n=s(579);class i extends n.Z{}},809:function(e,t,s){s.d(t,{Z:function(){return i}});var n=s(281);class i extends n.Z{listens(){return{ajaxLoadAssets:"load"}}dependencies(){return["url"]}async load(e){if(e.js&&e.js.length>0)for(const t of e.js)try{await this.loadScript(t)}catch(e){return Promise.reject(e)}if(e.css&&e.css.length>0)for(const t of e.css)try{await this.loadStyle(t)}catch(e){return Promise.reject(e)}if(e.img&&e.img.length>0)for(const t of e.img)try{await this.loadImage(t)}catch(e){return Promise.reject(e)}return Promise.resolve()}loadScript(e){return new Promise(((t,s)=>{e=this.snowboard.url().asset(e);if(document.querySelector(`script[src="${e}"]`))return void t();const n=document.createElement("script");n.setAttribute("type","text/javascript"),n.setAttribute("src",e),n.addEventListener("load",(()=>{this.snowboard.globalEvent("assetLoader.loaded","script",e,n),t()})),n.addEventListener("error",(()=>{this.snowboard.globalEvent("assetLoader.error","script",e,n),s(new Error(`Unable to load script file: "${e}"`))})),document.body.append(n)}))}loadStyle(e){return new Promise(((t,s)=>{e=this.snowboard.url().asset(e);if(document.querySelector(`link[rel="stylesheet"][href="${e}"]`))return void t();const n=document.createElement("link");n.setAttribute("rel","stylesheet"),n.setAttribute("href",e),n.addEventListener("load",(()=>{this.snowboard.globalEvent("assetLoader.loaded","style",e,n),t()})),n.addEventListener("error",(()=>{this.snowboard.globalEvent("assetLoader.error","style",e,n),s(new Error(`Unable to load stylesheet file: "${e}"`))})),document.head.append(n)}))}loadImage(e){return new Promise(((t,s)=>{e=this.snowboard.url().asset(e);const n=new Image;n.addEventListener("load",(()=>{this.snowboard.globalEvent("assetLoader.loaded","image",e,n),t()})),n.addEventListener("error",(()=>{this.snowboard.globalEvent("assetLoader.error","image",e,n),s(new Error(`Unable to load image file: "${e}"`))})),n.src=e}))}}},553:function(e,t,s){s.d(t,{Z:function(){return i}});var n=s(281);class i extends n.Z{dependencies(){return["request"]}listens(){return{ajaxStart:"ajaxStart",ajaxDone:"ajaxDone"}}ajaxStart(e,t){if(t.element)if("FORM"===t.element.tagName){const e=t.element.querySelectorAll("[data-attach-loading]");e.length>0&&e.forEach((e=>{e.classList.add(this.getLoadingClass(e))}))}else void 0!==t.element.dataset.attachLoading&&t.element.classList.add(this.getLoadingClass(t.element))}ajaxDone(e,t){if(t.element)if("FORM"===t.element.tagName){const e=t.element.querySelectorAll("[data-attach-loading]");e.length>0&&e.forEach((e=>{e.classList.remove(this.getLoadingClass(e))}))}else void 0!==t.element.dataset.attachLoading&&t.element.classList.remove(this.getLoadingClass(t.element))}getLoadingClass(e){return void 0!==e.dataset.attachLoading&&""!==e.dataset.attachLoading?e.dataset.attachLoading:"wn-loading"}}},763:function(e,t,s){s.d(t,{Z:function(){return i}});var n=s(579);class i extends n.Z{construct(e,t,s){if(e instanceof n.Z==!1)throw new Error("You must provide a Snowboard plugin to enable data configuration");if(t instanceof HTMLElement==!1)throw new Error("Data configuration can only be extracted from HTML elements");this.instance=e,this.element=t,this.localConfig=s||{},this.instanceConfig={},this.acceptedConfigs={},this.refresh()}get(e){return void 0===e?this.instanceConfig:void 0!==this.instanceConfig[e]?this.instanceConfig[e]:void 0}set(e,t,s){if(void 0===e)throw new Error("You must provide a configuration key to set");this.instanceConfig[e]=t,!0===s&&(this.element.dataset[e]=t,this.localConfig[e]=t)}refresh(){this.acceptedConfigs=this.getAcceptedConfigs(),this.instanceConfig=this.processConfig()}getAcceptedConfigs(){return void 0!==this.instance.acceptAllDataConfigs&&!0===this.instance.acceptAllDataConfigs||void 0!==this.instance.defaults&&"function"==typeof this.instance.defaults&&"object"==typeof this.instance.defaults()&&Object.keys(this.instance.defaults())}getDefaults(){return void 0!==this.instance.defaults&&"function"==typeof this.instance.defaults&&"object"==typeof this.instance.defaults()?this.instance.defaults():{}}processConfig(){const e=this.getDefaults();if(!1===this.acceptedConfigs)return e;for(const t in this.element.dataset)(!0===this.acceptedConfigs||this.acceptedConfigs.includes(t))&&(e[t]=this.coerceValue(this.element.dataset[t]));for(const t in this.localConfig)(!0===this.acceptedConfigs||this.acceptedConfigs.includes(t))&&(e[t]=this.localConfig[t]);return e}coerceValue(e){const t=String(e);if("null"===t)return null;if("undefined"!==t){if(t.startsWith("base64:")){const e=t.replace(/^base64:/,""),s=atob(e);return this.coerceValue(s)}if(["true","yes"].includes(t.toLowerCase()))return!0;if(["false","no"].includes(t.toLowerCase()))return!1;if(/^[-+]?[0-9]+(\.[0-9]+)?$/.test(t))return Number(t);try{return this.snowboard.jsonParser().parse(t)}catch(e){return""===t||t}}}}},270:function(e,t,s){s.d(t,{Z:function(){return i}});var n=s(579);class i extends n.Z{construct(e,t,s){if(this.message=e,this.type=t||"default",this.duration=Number(s||7),this.duration<0)throw new Error("Flash duration must be a positive number, or zero");this.clear(),this.timer=null,this.flashTimer=null,this.create()}dependencies(){return["transition"]}destruct(){null!==this.timer&&window.clearTimeout(this.timer),this.flashTimer&&this.flashTimer.remove(),this.flash&&(this.flash.remove(),this.flash=null,this.flashTimer=null),super.destruct()}create(){this.snowboard.globalEvent("flash.create",this),this.flash=document.createElement("DIV"),this.flash.innerHTML=this.message,this.flash.classList.add("flash-message",this.type),this.flash.removeAttribute("data-control"),this.flash.addEventListener("click",(()=>this.remove())),this.flash.addEventListener("mouseover",(()=>this.stopTimer())),this.flash.addEventListener("mouseout",(()=>this.startTimer())),this.duration>0?(this.flashTimer=document.createElement("DIV"),this.flashTimer.classList.add("flash-timer"),this.flash.appendChild(this.flashTimer)):this.flash.classList.add("no-timer"),document.body.appendChild(this.flash),this.snowboard.transition(this.flash,"show",(()=>{this.startTimer()}))}remove(){this.snowboard.globalEvent("flash.remove",this),this.stopTimer(),this.snowboard.transition(this.flash,"hide",(()=>{this.flash.remove(),this.flash=null,this.destruct()}))}clear(){document.querySelectorAll("body > div.flash-message").forEach((e=>e.remove()))}startTimer(){0!==this.duration&&(this.timerTrans=this.snowboard.transition(this.flashTimer,"timeout",null,`${this.duration}.0s`,!0),this.timer=window.setTimeout((()=>this.remove()),1e3*this.duration))}stopTimer(){this.timerTrans&&this.timerTrans.cancel(),this.timer&&window.clearTimeout(this.timer)}}},277:function(e,t,s){s.d(t,{Z:function(){return i}});var n=s(281);class i extends n.Z{dependencies(){return["request"]}listens(){return{ready:"ready",ajaxStart:"ajaxStart"}}ready(){this.counter=0,this.createStripe()}ajaxStart(e,t){!1!==t.options.stripe&&(this.show(),e.then((()=>{this.hide()})).catch((()=>{this.hide()})))}createStripe(){this.indicator=document.createElement("DIV"),this.stripe=document.createElement("DIV"),this.stripeLoaded=document.createElement("DIV"),this.indicator.classList.add("stripe-loading-indicator","loaded"),this.stripe.classList.add("stripe"),this.stripeLoaded.classList.add("stripe-loaded"),this.indicator.appendChild(this.stripe),this.indicator.appendChild(this.stripeLoaded),document.body.appendChild(this.indicator)}show(){this.counter+=1;const e=this.stripe.cloneNode(!0);this.indicator.appendChild(e),this.stripe.remove(),this.stripe=e,this.counter>1||(this.indicator.classList.remove("loaded"),document.body.classList.add("wn-loading"))}hide(e){this.counter-=1,!0===e&&(this.counter=0),this.counter<=0&&(this.indicator.classList.add("loaded"),document.body.classList.remove("wn-loading"))}}},32:function(e,t,s){s.d(t,{Z:function(){return i}});var n=s(281);class i extends n.Z{listens(){return{ready:"ready"}}ready(){let e=!1;if(document.querySelectorAll('link[rel="stylesheet"]').forEach((t=>{t.href.endsWith("/modules/system/assets/css/snowboard.extras.css")&&(e=!0)})),!e){const e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("href",this.snowboard.url().asset("/modules/system/assets/css/snowboard.extras.css")),document.head.appendChild(e)}}}},269:function(e,t,s){s.d(t,{Z:function(){return i}});var n=s(579);class i extends n.Z{construct(e,t,s,n,i){if(e instanceof HTMLElement==!1)throw new Error("A HTMLElement must be provided for transitioning");if(this.element=e,"string"!=typeof t)throw new Error("Transition name must be specified as a string");if(this.transition=t,s&&"function"!=typeof s)throw new Error("Callback must be a valid function");this.callback=s,this.duration=n?this.parseDuration(n):null,this.trailTo=!0===i,this.doTransition()}eventClasses(){for(var e=arguments.length,t=new Array(e),s=0;s{const[s,n]=e;-1!==t.indexOf(s)&&i.push(n)})),i}doTransition(){null!==this.duration&&(this.element.style.transitionDuration=this.duration),this.resetClasses(),this.eventClasses("in","active").forEach((e=>{this.element.classList.add(e)})),window.requestAnimationFrame((()=>{"0s"!==window.getComputedStyle(this.element)["transition-duration"]?(this.element.addEventListener("transitionend",(()=>this.onTransitionEnd()),{once:!0}),window.requestAnimationFrame((()=>{this.element.classList.remove(this.eventClasses("in")[0]),this.element.classList.add(this.eventClasses("out")[0])}))):(this.resetClasses(),this.callback&&this.callback.apply(this.element),this.destruct())}))}onTransitionEnd(){this.eventClasses("active",this.trailTo?"":"out").forEach((e=>{this.element.classList.remove(e)})),this.callback&&this.callback.apply(this.element),null!==this.duration&&(this.element.style.transitionDuration=null),this.destruct()}cancel(){this.element.removeEventListener("transitionend",(()=>this.onTransitionEnd),{once:!0}),this.resetClasses(),null!==this.duration&&(this.element.style.transitionDuration=null),this.destruct()}resetClasses(){this.eventClasses().forEach((e=>{this.element.classList.remove(e)}))}parseDuration(e){const t=/^([0-9]+(\.[0-9]+)?)(m?s)?$/.exec(e),s=Number(t[1]);return"sec"===("s"===t[3]?"sec":"msec")?1e3*s+"ms":`${Math.floor(s)}ms`}}},662:function(e,t){t.Z={get(e,t,s){if("string"==typeof t){const s=t.toLowerCase();if(e.hasPlugin(s))return function(){return Reflect.get(e,"plugins")[s].getInstance(...arguments)}}return Reflect.get(e,t,s)},has(e,t){if("string"==typeof t){const s=t.toLowerCase();if(e.hasPlugin(s))return!0}return Reflect.has(e,t)}}},286:function(e,t,s){s.d(t,{Z:function(){return g}});var n=s(579),i=s(281),r={get(e,t,s){if("string"==typeof t){const s=t.toLowerCase();if(["attachAbstracts","loadUtilities","initialise","initialiseSingletons"].includes(t))throw new Error(`You cannot use the "${t}" Snowboard method within a plugin.`);if(e.hasPlugin(s))return function(){return Reflect.get(e,"plugins")[s].getInstance(...arguments)}}return Reflect.get(e,t,s)},has(e,t){if("string"==typeof t){const s=t.toLowerCase();if(["attachAbstracts","loadUtilities","initialise","initialiseSingletons"].includes(t))return!1;if(e.hasPlugin(s))return!0}return Reflect.has(e,t)}};class o{constructor(e,t,s){this.name=e,this.snowboard=new Proxy(t,r),this.instance=s,Object.freeze(this.instance),this.instances=[],this.singleton={initialised:!1},Object.seal(this.singleton),this.mocks={},this.originalFunctions={},Object.freeze(o.prototype),Object.freeze(this)}hasMethod(e){return!this.isFunction()&&"function"==typeof this.instance.prototype[e]}callMethod(){if(this.isFunction())return null;for(var e=arguments.length,t=new Array(e),s=0;s!this.snowboard.getPluginNames().includes(e)));throw new Error(`The "${this.name}" plugin requires the following plugins: ${e.join(", ")}`)}if(this.isSingleton())return 0===this.instances.length&&this.initialiseSingleton(...s),Object.keys(this.mocks).length>0&&(Object.entries(this.originalFunctions).forEach((e=>{const[t,s]=e;this.instances[0][t]=s})),Object.entries(this.mocks).forEach((t=>{const[s,n]=t;this.instances[0][s]=function(){for(var t=arguments.length,s=new Array(t),i=0;i0&&(Object.entries(this.originalFunctions).forEach((e=>{const[t,s]=e;this.instance.prototype[t]=s})),Object.entries(this.mocks).forEach((t=>{const[s,n]=t;this.instance.prototype[s]=function(){for(var t=arguments.length,s=new Array(t),i=0;ithis.instances.splice(this.instances.indexOf(i),1),i.construct(...s),this.instances.push(i),i}getInstances(){return this.isFunction()?[]:this.instances}isFunction(){return"function"==typeof this.instance&&this.instance.prototype instanceof n.Z==!1}isSingleton(){return this.instance.prototype instanceof i.Z==!0}isInitialised(){return!this.isSingleton()||this.singleton.initialised}initialiseSingleton(){if(!this.isSingleton())return;for(var e=arguments.length,t=new Array(e),s=0;sthis.instances.splice(this.instances.indexOf(n),1),n.construct(...t),this.instances.push(n),this.singleton.initialised=!0}getDependencies(){return this.isFunction()||"function"!=typeof this.instance.prototype.dependencies?[]:this.instance.prototype.dependencies().map((e=>e.toLowerCase()))}dependenciesFulfilled(){const e=this.getDependencies();let t=!0;return e.forEach((e=>{this.snowboard.hasPlugin(e)||(t=!1)})),t}mock(e,t){var s=this;if(!this.isFunction()){if(!this.instance.prototype[e])throw new Error(`Function "${e}" does not exist and cannot be mocked`);this.mocks[e]=t,this.originalFunctions[e]=this.instance.prototype[e],this.isSingleton()&&0===this.instances.length&&(this.initialiseSingleton(),this.instances[0][e]=function(){for(var e=arguments.length,n=new Array(e),i=0;i{const[t,s]=e;void 0!==this.defaults[t]&&(this.defaults[t]=s)}))}getDefaults(){const e={};return Object.entries(this.defaults).forEach((t=>{const[s,n]=t;null!==this.defaults[s]&&(e[s]=n)})),e}get(e){if(void 0===e){const e=a.Z.get();return Object.entries(e).forEach((t=>{const[s,n]=t;this.snowboard.globalEvent("cookie.get",s,n,(t=>{e[s]=t}))})),e}let t=a.Z.get(e);return this.snowboard.globalEvent("cookie.get",e,t,(e=>{t=e})),t}set(e,t,s){let n=t;return this.snowboard.globalEvent("cookie.set",e,t,(e=>{n=e})),a.Z.set(e,n,h(h({},this.getDefaults()),s))}remove(e,t){a.Z.remove(e,h(h({},this.getDefaults()),t))}}class u extends i.Z{construct(){window.wnJSON=e=>this.parse(e),window.ocJSON=window.wnJSON}parse(e){const t=this.parseString(e);return JSON.parse(t)}parseString(e){let t=e.trim();if(!t.length)throw new Error("Broken JSON object.");let s="",n=null,i=null,r="";for(;t&&","===t[0];)t=t.substr(1);if('"'===t[0]||"'"===t[0]){if(t[t.length-1]!==t[0])throw new Error("Invalid string JSON object.");r='"';for(let e=1;e="0"&&e[t]<="9"){s="";for(let n=t;n="0"&&e[n]<="9"))return{originLength:s.length,body:s};s+=e[n]}throw new Error(`Broken JSON number body near ${s}`)}if("{"===e[t]||"["===e[t]){const n=[e[t]];s=e[t];for(let i=t+1;i=0?t-5:0,50)}`)}parseKey(e,t,s){let n="";for(let i=t;i="a"&&e[0]<="z"||e[0]>="A"&&e[0]<="Z"||"_"===e[0]||(e[0]>="0"&&e[0]<="9"||("$"===e[0]||e.charCodeAt(0)>255)))}isBlankChar(e){return" "===e||"\n"===e||"\t"===e}}class f extends i.Z{construct(){window.wnSanitize=e=>this.sanitize(e),window.ocSanitize=window.wnSanitize}sanitize(e,t){const s=(new DOMParser).parseFromString(e,"text/html"),n=void 0===t||"boolean"!=typeof t||t;return this.sanitizeNode(s.getRootNode()),n?s.body.innerHTML:s.innerHTML}sanitizeNode(e){if("SCRIPT"===e.tagName)return void e.remove();this.trimAttributes(e);Array.from(e.children).forEach((e=>{this.sanitizeNode(e)}))}trimAttributes(e){if(e.attributes)for(let t=0;t{this.autoInitSingletons&&this.initialiseSingletons(),this.globalEvent("ready"),this.readiness.dom=!0}))}initialiseSingletons(){Object.values(this.plugins).forEach((e=>{e.isSingleton()&&e.dependenciesFulfilled()&&e.initialiseSingleton()}))}addPlugin(e,t){const s=e.toLowerCase();if(this.hasPlugin(s))throw new Error(`A plugin called "${e}" is already registered.`);if("function"!=typeof t&&t instanceof n.Z==!1)throw new Error("The provided plugin must extend the PluginBase class, or must be a callback function.");if(void 0!==this[e]||void 0!==this[s])throw new Error("The given name is already in use for a property or method of the Snowboard class.");this.plugins[s]=new o(s,this,t),this.debug(`Plugin "${e}" registered`),Object.values(this.getPlugins()).forEach((e=>{if(e.isSingleton()&&!e.isInitialised()&&e.dependenciesFulfilled()&&e.hasMethod("listens")&&Object.keys(e.callMethod("listens")).includes("ready")&&this.readiness.dom){const t=e.callMethod("listens").ready;e.callMethod(t)}}))}removePlugin(e){const t=e.toLowerCase();this.hasPlugin(t)?(this.plugins[t].getInstances().forEach((e=>{e.destruct()})),delete this.plugins[t],delete this[t],delete this[e],this.debug(`Plugin "${e}" removed`)):this.debug(`Plugin "${e}" already removed`)}hasPlugin(e){const t=e.toLowerCase();return void 0!==this.plugins[t]}getPlugins(){return this.plugins}getPluginNames(){return Object.keys(this.plugins)}getPlugin(e){const t=e.toLowerCase();if(!this.hasPlugin(t))throw new Error(`No plugin called "${t}" has been registered.`);return this.plugins[t]}listensToEvent(e){const t=[];return Object.entries(this.plugins).forEach((s=>{const[n,i]=s;if(i.isFunction())return;if(!i.dependenciesFulfilled())return;if(!i.hasMethod("listens"))return;const r=i.callMethod("listens");"string"!=typeof r[e]&&"function"!=typeof r[e]||t.push(n)})),t}ready(e){this.readiness.dom&&e(),this.on("ready",e)}on(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].includes(t)||this.listeners[e].push(t)}off(e,t){if(!this.listeners[e])return;const s=this.listeners[e].indexOf(t);-1!==s&&this.listeners[e].splice(s,1)}globalEvent(e){for(var t=arguments.length,s=new Array(t>1?t-1:0),n=1;n{const n=this.getPlugin(t);if(n.isFunction())return;n.isSingleton()&&0===n.getInstances().length&&n.initialiseSingleton();const i=n.callMethod("listens")[e];n.getInstances().forEach((n=>{if(!r)if("function"==typeof i)try{!1===i.apply(n,s)&&(r=!0)}catch(s){this.error(`Error thrown in "${e}" event by "${t}" plugin.`,s)}else if("string"==typeof i){if(!n[i])throw new Error(`Missing "${i}" method in "${t}" plugin`);try{!1===n[i](...s)&&(r=!0,this.debug(`Global event "${e}" cancelled by "${t}" plugin`))}catch(s){this.error(`Error thrown in "${e}" event by "${t}" plugin.`,s)}}else this.error(`Listen method for "${e}" event in "${t}" plugin is not a function or string.`)}))})),!r&&this.listeners[e]&&this.listeners[e].length>0&&(this.debug(`Found ${this.listeners[e].length} ad-hoc listener(s) for global event "${e}"`),this.listeners[e].forEach((t=>{if(!r)try{!1===t(...s)&&(r=!0,this.debug(`Global event "${e} cancelled by an ad-hoc listener.`))}catch(t){this.error(`Error thrown in "${e}" event by an ad-hoc listener.`,t)}}))),!r}globalPromiseEvent(e){for(var t=arguments.length,s=new Array(t>1?t-1:0),n=1;n{const n=this.getPlugin(t);if(n.isFunction())return;n.isSingleton()&&0===n.getInstances().length&&n.initialiseSingleton();const i=n.callMethod("listens")[e];n.getInstances().forEach((n=>{if("function"==typeof i)try{const e=i.apply(n,s);if(e instanceof Promise==!1)return;r.push(e)}catch(s){this.error(`Error thrown in "${e}" event by "${t}" plugin.`,s)}else if("string"==typeof i){if(!n[i])throw new Error(`Missing "${i}" method in "${t}" plugin`);try{const e=n[i](...s);if(e instanceof Promise==!1)return;r.push(e)}catch(s){this.error(`Error thrown in "${e}" promise event by "${t}" plugin.`,s)}}else this.error(`Listen method for "${e}" event in "${t}" plugin is not a function or string.`)}))})),this.listeners[e]&&this.listeners[e].length>0&&(this.debug(`Found ${this.listeners[e].length} ad-hoc listener(s) for global promise event "${e}"`),this.listeners[e].forEach((t=>{try{const e=t(...s);if(e instanceof Promise==!1)return;r.push(e)}catch(t){this.error(`Error thrown in "${e}" promise event by an ad-hoc listener.`,t)}}))),0===r.length?Promise.resolve():Promise.all(r)}logMessage(e,t,s){console.groupCollapsed("%c[Snowboard]",`color: ${e}; font-weight: ${t?"bold":"normal"};`,s);for(var n=arguments.length,i=new Array(n>3?n-3:0),r=3;r{e+=1,console.log(`%c${e}:`,"color: rgb(88, 88, 88); font-weight: normal;",t)})),console.groupEnd(),console.groupCollapsed("%cTrace","color: rgb(45, 167, 199); font-weight: bold;"),console.trace(),console.groupEnd()}else console.trace();console.groupEnd()}log(e){for(var t=arguments.length,s=new Array(t>1?t-1:0),n=1;n1?t-1:0),n=1;n1?t-1:0),n=1;n{const t=new Proxy(new n.Z(!0,!0),i.Z);e.snowboard=t,e.Snowboard=t,e.SnowBoard=t})(window)},640:function(e,t,s){var n=s(579);function i(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function r(e){for(var t=1;t{e&&this.doAjax().then((e=>{if(e.cancelled)return this.cancelled=!0,void this.complete();this.responseData=e,this.processUpdate(e).then((()=>{!1===e.X_WINTER_SUCCESS?this.processError(e):this.processResponse(e)}))}),(e=>{this.responseError=e,this.processError(e)}))})):this.doAjax().then((e=>{if(e.cancelled)return this.cancelled=!0,void this.complete();this.responseData=e,this.processUpdate(e).then((()=>{!1===e.X_WINTER_SUCCESS?this.processError(e):this.processResponse(e)}))}),(e=>{this.responseError=e,this.processError(e)})):this.cancelled=!0}else this.cancelled=!0}dependencies(){return["cookie","jsonParser"]}checkRequest(){if(this.element&&this.element instanceof Element==!1)throw new Error("The element provided must be an Element instance");if(void 0===this.handler)throw new Error("The AJAX handler name is not specified.");if(!this.isHandlerName(this.handler))throw new Error('Invalid AJAX handler name. The correct handler name format is: "onEvent".')}getFetch(){return this.fetchOptions=void 0!==this.options.fetchOptions&&"object"==typeof this.options.fetchOptions?this.options.fetchOptions:{method:"POST",headers:this.headers,body:this.data,redirect:"follow",mode:"same-origin"},this.snowboard.globalEvent("ajaxFetchOptions",this.fetchOptions,this),fetch(this.url,this.fetchOptions)}doClientValidation(){return!0!==this.options.browserValidate||!this.form||!1!==this.form.checkValidity()||(this.form.reportValidity(),!1)}doAjax(){if(!1===this.snowboard.globalEvent("ajaxBeforeSend",this))return Promise.resolve({cancelled:!0});const e=new Promise(((e,t)=>{this.getFetch().then((s=>{s.ok||406===s.status?s.headers.has("Content-Type")&&s.headers.get("Content-Type").includes("/json")?s.json().then((t=>{e(r(r({},t),{},{X_WINTER_SUCCESS:406!==s.status,X_WINTER_RESPONSE_CODE:s.status}))}),(e=>{t(this.renderError(`Unable to parse JSON response: ${e}`))})):s.text().then((t=>{e(t)}),(e=>{t(this.renderError(`Unable to process response: ${e}`))})):s.headers.has("Content-Type")&&s.headers.get("Content-Type").includes("/json")?s.json().then((e=>{e.message&&e.exception?t(this.renderError(e.message,e.exception,e.file,e.line,e.trace)):t(e)}),(e=>{t(this.renderError(`Unable to parse JSON response: ${e}`))})):s.text().then((e=>{t(this.renderError(e))}),(e=>{t(this.renderError(`Unable to process response: ${e}`))}))}),(e=>{t(this.renderError(`Unable to retrieve a response from the server: ${e}`))}))}));if(this.snowboard.globalEvent("ajaxStart",e,this),this.element){const t=new Event("ajaxPromise");t.promise=e,this.element.dispatchEvent(t)}return e}processUpdate(e){return new Promise(((t,s)=>{if("function"==typeof this.options.beforeUpdate&&!1===this.options.beforeUpdate.apply(this,[e]))return void t();const n={};if(Object.entries(e).forEach((e=>{const[t,s]=e;"X_WINTER"!==t.substr(0,8)&&(n[t]=s)})),0===Object.keys(n).length)return void(e.X_WINTER_ASSETS?this.processAssets(e.X_WINTER_ASSETS).then((()=>{t()}),(()=>{s()})):t());this.snowboard.globalPromiseEvent("ajaxBeforeUpdate",e,this).then((async()=>{e.X_WINTER_ASSETS&&await this.processAssets(e.X_WINTER_ASSETS),this.doUpdate(n).then((()=>{window.requestAnimationFrame((()=>t()))}),(()=>{s()}))}),(()=>{t()}))}))}doUpdate(e){return new Promise((t=>{const s=[];Object.entries(e).forEach((e=>{const[t,n]=e;let i=this.options.update&&this.options.update[t]?this.options.update[t]:t,r="replace";"@"===i.substr(0,1)?(r="append",i=i.substr(1)):"^"===i.substr(0,1)?(r="prepend",i=i.substr(1)):"#"!==i.substr(0,1)&&"."!==i.substr(0,1)&&(r="noop");const o=document.querySelectorAll(i);o.length>0&&o.forEach((e=>{switch(r){case"append":e.innerHTML+=n;break;case"prepend":e.innerHTML=n+e.innerHTML;break;case"noop":break;default:e.innerHTML=n}s.push(e),this.snowboard.globalEvent("ajaxUpdate",e,n,this);const t=new Event("ajaxUpdate");t.content=n,e.dispatchEvent(t)}))})),this.snowboard.globalEvent("ajaxUpdateComplete",s,this),t()}))}processResponse(e){if((!this.options.success||"function"!=typeof this.options.success||!1!==this.options.success(this.responseData,this))&&!1!==this.snowboard.globalEvent("ajaxSuccess",this.responseData,this)){if(this.element){const e=new Event("ajaxDone",{cancelable:!0});if(e.responseData=this.responseData,e.request=this,this.element.dispatchEvent(e),e.defaultPrevented)return}this.flash&&e.X_WINTER_FLASH_MESSAGES&&this.processFlashMessages(e.X_WINTER_FLASH_MESSAGES),this.redirect||e.X_WINTER_REDIRECT?this.processRedirect(this.redirect||e.X_WINTER_REDIRECT):this.complete()}}processError(e){if((!this.options.error||"function"!=typeof this.options.error||!1!==this.options.error(this.responseError,this))&&!1!==this.snowboard.globalEvent("ajaxError",this.responseError,this)){if(this.element){const e=new Event("ajaxFail",{cancelable:!0});if(e.responseError=this.responseError,e.request=this,this.element.dispatchEvent(e),e.defaultPrevented)return}if(e instanceof Error)this.processErrorMessage(e.message);else{let t=!1;e.X_WINTER_ERROR_FIELDS&&(t=this.processValidationErrors(e.X_WINTER_ERROR_FIELDS)),e.X_WINTER_ERROR_MESSAGE&&!t&&this.processErrorMessage(e.X_WINTER_ERROR_MESSAGE)}this.complete()}}processRedirect(e){"function"==typeof this.options.handleRedirectResponse&&!1===this.options.handleRedirectResponse.apply(this,[e])||!1!==this.snowboard.globalEvent("ajaxRedirect",e,this)&&(window.addEventListener("popstate",(()=>{if(this.element){const e=document.createEvent("CustomEvent");e.eventName="ajaxRedirected",this.element.dispatchEvent(e)}}),{once:!0}),window.location.assign(e))}processErrorMessage(e){"function"==typeof this.options.handleErrorMessage&&!1===this.options.handleErrorMessage.apply(this,[e])||!1!==this.snowboard.globalEvent("ajaxErrorMessage",e,this)&&window.alert(e)}processFlashMessages(e){"function"==typeof this.options.handleFlashMessages&&!1===this.options.handleFlashMessages.apply(this,[e])||this.snowboard.globalEvent("ajaxFlashMessages",e,this)}processValidationErrors(e){return"function"==typeof this.options.handleValidationErrors&&!1===this.options.handleValidationErrors.apply(this,[this.form,e])||!1===this.snowboard.globalEvent("ajaxValidationErrors",this.form,e,this)}processAssets(e){return this.snowboard.globalPromiseEvent("ajaxLoadAssets",e)}async doConfirm(){if("function"==typeof this.options.handleConfirmMessage)return!1!==this.options.handleConfirmMessage.apply(this,[this.confirm]);if(0===this.snowboard.listensToEvent("ajaxConfirmMessage").length)return window.confirm(this.confirm);const e=this.snowboard.globalPromiseEvent("ajaxConfirmMessage",this.confirm,this);try{if(await e)return!0}catch(e){return!1}return!1}complete(){if(this.options.complete&&"function"==typeof this.options.complete&&this.options.complete(this.responseData,this),this.snowboard.globalEvent("ajaxDone",this.responseData,this),this.element){const e=new Event("ajaxAlways");e.request=this,e.responseData=this.responseData,e.responseError=this.responseError,this.element.dispatchEvent(e)}this.destruct()}get form(){return this.options.form?"string"==typeof this.options.form?document.querySelector(this.options.form):this.options.form:this.element?"FORM"===this.element.tagName?this.element:this.element.closest("form"):null}get context(){return{handler:this.handler,options:this.options}}get headers(){const e={"X-Requested-With":"XMLHttpRequest","X-WINTER-REQUEST-HANDLER":this.handler,"X-WINTER-REQUEST-PARTIALS":this.extractPartials(this.options.update||[])};return this.flash&&(e["X-WINTER-REQUEST-FLASH"]=1),this.xsrfToken&&(e["X-XSRF-TOKEN"]=this.xsrfToken),e}get loading(){return this.options.loading||!1}get url(){return this.options.url||window.location.href}get redirect(){return this.options.redirect&&this.options.redirect.length?this.options.redirect:null}get flash(){return this.options.flash||!1}get files(){return!0===this.options.files&&(void 0!==FormData||(this.snowboard.debug("This browser does not support file uploads"),!1))}get xsrfToken(){return this.snowboard.cookie().get("XSRF-TOKEN")}get data(){const e="object"==typeof this.options.data?this.options.data:{},t=new FormData(this.form||void 0);return Object.keys(e).length>0&&Object.entries(e).forEach((e=>{const[s,n]=e;t.append(s,n)})),t}get confirm(){return this.options.confirm||!1}extractPartials(e){return Object.keys(e).join("&")}renderError(e,t,s,n,i){const r=new Error(e);return r.exception=t||null,r.file=s||null,r.line=n||null,r.trace=i||[],r}isHandlerName(e){return/^(?:\w+:{2})?on[A-Z0-9]/.test(e)}}if(void 0===window.Snowboard)throw new Error("Snowboard must be loaded in order to use the Javascript AJAX request feature.");window.Snowboard.addPlugin("request",a)}},function(e){var t=function(t){return e(e.s=t)};e.O(0,[109],(function(){return t(165),t(640),t(136)}));e.O()}]); \ No newline at end of file +"use strict";(self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[]).push([[714,450,988],{553:function(e,t,s){s.d(t,{Z:function(){return n}});var i=s(579);class n extends i.eG{dependencies(){return["request"]}listens(){return{ajaxStart:"ajaxStart",ajaxDone:"ajaxDone"}}ajaxStart(e,t){if(t.element)if("FORM"===t.element.tagName){const e=t.element.querySelectorAll("[data-attach-loading]");e.length>0&&e.forEach((e=>{e.classList.add(this.getLoadingClass(e))}))}else void 0!==t.element.dataset.attachLoading&&t.element.classList.add(this.getLoadingClass(t.element))}ajaxDone(e,t){if(t.element)if("FORM"===t.element.tagName){const e=t.element.querySelectorAll("[data-attach-loading]");e.length>0&&e.forEach((e=>{e.classList.remove(this.getLoadingClass(e))}))}else void 0!==t.element.dataset.attachLoading&&t.element.classList.remove(this.getLoadingClass(t.element))}getLoadingClass(e){return void 0!==e.dataset.attachLoading&&""!==e.dataset.attachLoading?e.dataset.attachLoading:"wn-loading"}}},270:function(e,t,s){s.d(t,{Z:function(){return n}});var i=s(579);class n extends i.NG{construct(e,t,s){if(this.message=e,this.type=t||"default",this.duration=Number(s||7),this.duration<0)throw new Error("Flash duration must be a positive number, or zero");this.clear(),this.timer=null,this.flashTimer=null,this.create()}dependencies(){return["transition"]}destruct(){null!==this.timer&&window.clearTimeout(this.timer),this.flashTimer&&this.flashTimer.remove(),this.flash&&(this.flash.remove(),this.flash=null,this.flashTimer=null),super.destruct()}create(){this.snowboard.globalEvent("flash.create",this),this.flash=document.createElement("DIV"),this.flash.innerHTML=this.message,this.flash.classList.add("flash-message",this.type),this.flash.removeAttribute("data-control"),this.flash.addEventListener("click",(()=>this.remove())),this.flash.addEventListener("mouseover",(()=>this.stopTimer())),this.flash.addEventListener("mouseout",(()=>this.startTimer())),this.duration>0?(this.flashTimer=document.createElement("DIV"),this.flashTimer.classList.add("flash-timer"),this.flash.appendChild(this.flashTimer)):this.flash.classList.add("no-timer"),document.body.appendChild(this.flash),this.snowboard.transition(this.flash,"show",(()=>{this.startTimer()}))}remove(){this.snowboard.globalEvent("flash.remove",this),this.stopTimer(),this.snowboard.transition(this.flash,"hide",(()=>{this.flash.remove(),this.flash=null,this.destruct()}))}clear(){document.querySelectorAll("body > div.flash-message").forEach((e=>e.remove()))}startTimer(){0!==this.duration&&(this.timerTrans=this.snowboard.transition(this.flashTimer,"timeout",null,`${this.duration}.0s`,!0),this.timer=window.setTimeout((()=>this.remove()),1e3*this.duration))}stopTimer(){this.timerTrans&&this.timerTrans.cancel(),this.timer&&window.clearTimeout(this.timer)}}},277:function(e,t,s){s.d(t,{Z:function(){return n}});var i=s(579);class n extends i.eG{dependencies(){return["request"]}listens(){return{ready:"ready",ajaxStart:"ajaxStart"}}ready(){this.counter=0,this.createStripe()}ajaxStart(e,t){!1!==t.options.stripe&&(this.show(),e.then((()=>{this.hide()})).catch((()=>{this.hide()})))}createStripe(){this.indicator=document.createElement("DIV"),this.stripe=document.createElement("DIV"),this.stripeLoaded=document.createElement("DIV"),this.indicator.classList.add("stripe-loading-indicator","loaded"),this.stripe.classList.add("stripe"),this.stripeLoaded.classList.add("stripe-loaded"),this.indicator.appendChild(this.stripe),this.indicator.appendChild(this.stripeLoaded),document.body.appendChild(this.indicator)}show(){this.counter+=1;const e=this.stripe.cloneNode(!0);this.indicator.appendChild(e),this.stripe.remove(),this.stripe=e,this.counter>1||(this.indicator.classList.remove("loaded"),document.body.classList.add("wn-loading"))}hide(e){this.counter-=1,!0===e&&(this.counter=0),this.counter<=0&&(this.indicator.classList.add("loaded"),document.body.classList.remove("wn-loading"))}}},32:function(e,t,s){s.d(t,{Z:function(){return n}});var i=s(579);class n extends i.eG{listens(){return{ready:"ready"}}ready(){let e=!1;if(document.querySelectorAll('link[rel="stylesheet"]').forEach((t=>{t.href.endsWith("/modules/system/assets/css/snowboard.extras.css")&&(e=!0)})),!e){const e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("href",this.snowboard.url().asset("/modules/system/assets/css/snowboard.extras.css")),document.head.appendChild(e)}}}},269:function(e,t,s){s.d(t,{Z:function(){return n}});var i=s(579);class n extends i.NG{construct(e,t,s,i,n){if(e instanceof HTMLElement==!1)throw new Error("A HTMLElement must be provided for transitioning");if(this.element=e,"string"!=typeof t)throw new Error("Transition name must be specified as a string");if(this.transition=t,s&&"function"!=typeof s)throw new Error("Callback must be a valid function");this.callback=s,this.duration=i?this.parseDuration(i):null,this.trailTo=!0===n,this.doTransition()}eventClasses(){for(var e=arguments.length,t=new Array(e),s=0;s{const[s,i]=e;-1!==t.indexOf(s)&&n.push(i)})),n}doTransition(){null!==this.duration&&(this.element.style.transitionDuration=this.duration),this.resetClasses(),this.eventClasses("in","active").forEach((e=>{this.element.classList.add(e)})),window.requestAnimationFrame((()=>{"0s"!==window.getComputedStyle(this.element)["transition-duration"]?(this.element.addEventListener("transitionend",(()=>this.onTransitionEnd()),{once:!0}),window.requestAnimationFrame((()=>{this.element.classList.remove(this.eventClasses("in")[0]),this.element.classList.add(this.eventClasses("out")[0])}))):(this.resetClasses(),this.callback&&this.callback.apply(this.element),this.destruct())}))}onTransitionEnd(){this.eventClasses("active",this.trailTo?"":"out").forEach((e=>{this.element.classList.remove(e)})),this.callback&&this.callback.apply(this.element),null!==this.duration&&(this.element.style.transitionDuration=null),this.destruct()}cancel(){this.element.removeEventListener("transitionend",(()=>this.onTransitionEnd),{once:!0}),this.resetClasses(),null!==this.duration&&(this.element.style.transitionDuration=null),this.destruct()}resetClasses(){this.eventClasses().forEach((e=>{this.element.classList.remove(e)}))}parseDuration(e){const t=/^([0-9]+(\.[0-9]+)?)(m?s)?$/.exec(e),s=Number(t[1]);return"sec"===("s"===t[3]?"sec":"msec")?1e3*s+"ms":`${Math.floor(s)}ms`}}},136:function(e,t,s){var i,n=s(270),r=s(269),o=s(553),a=s(277),h=s(32);if(void 0===window.Snowboard)throw new Error("Snowboard must be loaded in order to use the extra plugins.");(i=window.Snowboard).addPlugin("extrasStyles",h.Z),i.addPlugin("transition",r.Z),i.addPlugin("flash",n.Z),i.addPlugin("attachLoading",o.Z),i.addPlugin("stripeLoader",a.Z)},165:function(e,t,s){var i=s(579);(e=>{const t=new i.Jc(!0);e.snowboard=t,e.Snowboard=t,e.SnowBoard=t})(window)},640:function(e,t,s){var i=s(579);function n(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,i)}return s}function r(e){for(var t=1;t{e&&this.doAjax().then((e=>{if(e.cancelled)return this.cancelled=!0,void this.complete();this.responseData=e,this.processUpdate(e).then((()=>{!1===e.X_WINTER_SUCCESS?this.processError(e):this.processResponse(e)}))}),(e=>{this.responseError=e,this.processError(e)}))})):this.doAjax().then((e=>{if(e.cancelled)return this.cancelled=!0,void this.complete();this.responseData=e,this.processUpdate(e).then((()=>{!1===e.X_WINTER_SUCCESS?this.processError(e):this.processResponse(e)}))}),(e=>{this.responseError=e,this.processError(e)})):this.cancelled=!0}else this.cancelled=!0}dependencies(){return["cookie","jsonParser"]}checkRequest(){if(this.element&&this.element instanceof Element==!1)throw new Error("The element provided must be an Element instance");if(void 0===this.handler)throw new Error("The AJAX handler name is not specified.");if(!this.isHandlerName(this.handler))throw new Error('Invalid AJAX handler name. The correct handler name format is: "onEvent".')}getFetch(){return this.fetchOptions=void 0!==this.options.fetchOptions&&"object"==typeof this.options.fetchOptions?this.options.fetchOptions:{method:"POST",headers:this.headers,body:this.data,redirect:"follow",mode:"same-origin"},this.snowboard.globalEvent("ajaxFetchOptions",this.fetchOptions,this),fetch(this.url,this.fetchOptions)}doClientValidation(){return!0!==this.options.browserValidate||!this.form||!1!==this.form.checkValidity()||(this.form.reportValidity(),!1)}doAjax(){if(!1===this.snowboard.globalEvent("ajaxBeforeSend",this))return Promise.resolve({cancelled:!0});const e=new Promise(((e,t)=>{this.getFetch().then((s=>{s.ok||406===s.status?s.headers.has("Content-Type")&&s.headers.get("Content-Type").includes("/json")?s.json().then((t=>{e(r(r({},t),{},{X_WINTER_SUCCESS:406!==s.status,X_WINTER_RESPONSE_CODE:s.status}))}),(e=>{t(this.renderError(`Unable to parse JSON response: ${e}`))})):s.text().then((t=>{e(t)}),(e=>{t(this.renderError(`Unable to process response: ${e}`))})):s.headers.has("Content-Type")&&s.headers.get("Content-Type").includes("/json")?s.json().then((e=>{e.message&&e.exception?t(this.renderError(e.message,e.exception,e.file,e.line,e.trace)):t(e)}),(e=>{t(this.renderError(`Unable to parse JSON response: ${e}`))})):s.text().then((e=>{t(this.renderError(e))}),(e=>{t(this.renderError(`Unable to process response: ${e}`))}))}),(e=>{t(this.renderError(`Unable to retrieve a response from the server: ${e}`))}))}));if(this.snowboard.globalEvent("ajaxStart",e,this),this.element){const t=new Event("ajaxPromise");t.promise=e,this.element.dispatchEvent(t)}return e}processUpdate(e){return new Promise(((t,s)=>{if("function"==typeof this.options.beforeUpdate&&!1===this.options.beforeUpdate.apply(this,[e]))return void t();const i={};if(Object.entries(e).forEach((e=>{const[t,s]=e;"X_WINTER"!==t.substr(0,8)&&(i[t]=s)})),0===Object.keys(i).length)return void(e.X_WINTER_ASSETS?this.processAssets(e.X_WINTER_ASSETS).then((()=>{t()}),(()=>{s()})):t());this.snowboard.globalPromiseEvent("ajaxBeforeUpdate",e,this).then((async()=>{e.X_WINTER_ASSETS&&await this.processAssets(e.X_WINTER_ASSETS),this.doUpdate(i).then((()=>{window.requestAnimationFrame((()=>t()))}),(()=>{s()}))}),(()=>{t()}))}))}doUpdate(e){return new Promise((t=>{const s=[];Object.entries(e).forEach((e=>{const[t,i]=e;let n=this.options.update&&this.options.update[t]?this.options.update[t]:t,r="replace";"@"===n.substr(0,1)?(r="append",n=n.substr(1)):"^"===n.substr(0,1)?(r="prepend",n=n.substr(1)):"#"!==n.substr(0,1)&&"."!==n.substr(0,1)&&(r="noop");const o=document.querySelectorAll(n);o.length>0&&o.forEach((e=>{switch(r){case"append":e.innerHTML+=i;break;case"prepend":e.innerHTML=i+e.innerHTML;break;case"noop":break;default:e.innerHTML=i}s.push(e),this.snowboard.globalEvent("ajaxUpdate",e,i,this);const t=new Event("ajaxUpdate");t.content=i,e.dispatchEvent(t)}))})),this.snowboard.globalEvent("ajaxUpdateComplete",s,this),t()}))}processResponse(e){if((!this.options.success||"function"!=typeof this.options.success||!1!==this.options.success(this.responseData,this))&&!1!==this.snowboard.globalEvent("ajaxSuccess",this.responseData,this)){if(this.element){const e=new Event("ajaxDone",{cancelable:!0});if(e.responseData=this.responseData,e.request=this,this.element.dispatchEvent(e),e.defaultPrevented)return}this.flash&&e.X_WINTER_FLASH_MESSAGES&&this.processFlashMessages(e.X_WINTER_FLASH_MESSAGES),this.redirect||e.X_WINTER_REDIRECT?this.processRedirect(this.redirect||e.X_WINTER_REDIRECT):this.complete()}}processError(e){if((!this.options.error||"function"!=typeof this.options.error||!1!==this.options.error(this.responseError,this))&&!1!==this.snowboard.globalEvent("ajaxError",this.responseError,this)){if(this.element){const e=new Event("ajaxFail",{cancelable:!0});if(e.responseError=this.responseError,e.request=this,this.element.dispatchEvent(e),e.defaultPrevented)return}if(e instanceof Error)this.processErrorMessage(e.message);else{let t=!1;e.X_WINTER_ERROR_FIELDS&&(t=this.processValidationErrors(e.X_WINTER_ERROR_FIELDS)),e.X_WINTER_ERROR_MESSAGE&&!t&&this.processErrorMessage(e.X_WINTER_ERROR_MESSAGE)}this.complete()}}processRedirect(e){"function"==typeof this.options.handleRedirectResponse&&!1===this.options.handleRedirectResponse.apply(this,[e])||!1!==this.snowboard.globalEvent("ajaxRedirect",e,this)&&(window.addEventListener("popstate",(()=>{if(this.element){const e=document.createEvent("CustomEvent");e.eventName="ajaxRedirected",this.element.dispatchEvent(e)}}),{once:!0}),window.location.assign(e))}processErrorMessage(e){"function"==typeof this.options.handleErrorMessage&&!1===this.options.handleErrorMessage.apply(this,[e])||!1!==this.snowboard.globalEvent("ajaxErrorMessage",e,this)&&window.alert(e)}processFlashMessages(e){"function"==typeof this.options.handleFlashMessages&&!1===this.options.handleFlashMessages.apply(this,[e])||this.snowboard.globalEvent("ajaxFlashMessages",e,this)}processValidationErrors(e){return"function"==typeof this.options.handleValidationErrors&&!1===this.options.handleValidationErrors.apply(this,[this.form,e])||!1===this.snowboard.globalEvent("ajaxValidationErrors",this.form,e,this)}processAssets(e){return this.snowboard.globalPromiseEvent("ajaxLoadAssets",e)}async doConfirm(){if("function"==typeof this.options.handleConfirmMessage)return!1!==this.options.handleConfirmMessage.apply(this,[this.confirm]);if(0===this.snowboard.listensToEvent("ajaxConfirmMessage").length)return window.confirm(this.confirm);const e=this.snowboard.globalPromiseEvent("ajaxConfirmMessage",this.confirm,this);try{if(await e)return!0}catch(e){return!1}return!1}complete(){if(this.options.complete&&"function"==typeof this.options.complete&&this.options.complete(this.responseData,this),this.snowboard.globalEvent("ajaxDone",this.responseData,this),this.element){const e=new Event("ajaxAlways");e.request=this,e.responseData=this.responseData,e.responseError=this.responseError,this.element.dispatchEvent(e)}this.destruct()}get form(){return this.options.form?"string"==typeof this.options.form?document.querySelector(this.options.form):this.options.form:this.element?"FORM"===this.element.tagName?this.element:this.element.closest("form"):null}get context(){return{handler:this.handler,options:this.options}}get headers(){const e={"X-Requested-With":"XMLHttpRequest","X-WINTER-REQUEST-HANDLER":this.handler,"X-WINTER-REQUEST-PARTIALS":this.extractPartials(this.options.update||[])};return this.flash&&(e["X-WINTER-REQUEST-FLASH"]=1),this.xsrfToken&&(e["X-XSRF-TOKEN"]=this.xsrfToken),e}get loading(){return this.options.loading||!1}get url(){return this.options.url||window.location.href}get redirect(){return this.options.redirect&&this.options.redirect.length?this.options.redirect:null}get flash(){return this.options.flash||!1}get files(){return!0===this.options.files&&(void 0!==FormData||(this.snowboard.debug("This browser does not support file uploads"),!1))}get xsrfToken(){return this.snowboard.cookie().get("XSRF-TOKEN")}get data(){const e="object"==typeof this.options.data?this.options.data:{},t=new FormData(this.form||void 0);return Object.keys(e).length>0&&Object.entries(e).forEach((e=>{const[s,i]=e;t.append(s,i)})),t}get confirm(){return this.options.confirm||!1}extractPartials(e){return Object.keys(e).join("&")}renderError(e,t,s,i,n){const r=new Error(e);return r.exception=t||null,r.file=s||null,r.line=i||null,r.trace=n||[],r}isHandlerName(e){return/^(?:\w+:{2})?on[A-Z0-9]/.test(e)}}if(void 0===window.Snowboard)throw new Error("Snowboard must be loaded in order to use the Javascript AJAX request feature.");window.Snowboard.addPlugin("request",a)}},function(e){var t=function(t){return e(e.s=t)};e.O(0,[109],(function(){return t(165),t(640),t(136)}));e.O()}]); \ No newline at end of file diff --git a/modules/system/assets/js/build/system.js b/modules/system/assets/js/build/system.js index a60492e24..1fd585bfa 100644 --- a/modules/system/assets/js/build/system.js +++ b/modules/system/assets/js/build/system.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[]).push([[290,243,988],{579:function(e,t,s){s.d(t,{Z:function(){return n}});class n{constructor(e){this.snowboard=e}construct(){}dependencies(){return[]}listens(){return{}}destruct(){this.detach(),delete this.snowboard}destructor(){this.destruct()}}},281:function(e,t,s){s.d(t,{Z:function(){return i}});var n=s(579);class i extends n.Z{}},809:function(e,t,s){s.d(t,{Z:function(){return i}});var n=s(281);class i extends n.Z{listens(){return{ajaxLoadAssets:"load"}}dependencies(){return["url"]}async load(e){if(e.js&&e.js.length>0)for(const t of e.js)try{await this.loadScript(t)}catch(e){return Promise.reject(e)}if(e.css&&e.css.length>0)for(const t of e.css)try{await this.loadStyle(t)}catch(e){return Promise.reject(e)}if(e.img&&e.img.length>0)for(const t of e.img)try{await this.loadImage(t)}catch(e){return Promise.reject(e)}return Promise.resolve()}loadScript(e){return new Promise(((t,s)=>{e=this.snowboard.url().asset(e);if(document.querySelector(`script[src="${e}"]`))return void t();const n=document.createElement("script");n.setAttribute("type","text/javascript"),n.setAttribute("src",e),n.addEventListener("load",(()=>{this.snowboard.globalEvent("assetLoader.loaded","script",e,n),t()})),n.addEventListener("error",(()=>{this.snowboard.globalEvent("assetLoader.error","script",e,n),s(new Error(`Unable to load script file: "${e}"`))})),document.body.append(n)}))}loadStyle(e){return new Promise(((t,s)=>{e=this.snowboard.url().asset(e);if(document.querySelector(`link[rel="stylesheet"][href="${e}"]`))return void t();const n=document.createElement("link");n.setAttribute("rel","stylesheet"),n.setAttribute("href",e),n.addEventListener("load",(()=>{this.snowboard.globalEvent("assetLoader.loaded","style",e,n),t()})),n.addEventListener("error",(()=>{this.snowboard.globalEvent("assetLoader.error","style",e,n),s(new Error(`Unable to load stylesheet file: "${e}"`))})),document.head.append(n)}))}loadImage(e){return new Promise(((t,s)=>{e=this.snowboard.url().asset(e);const n=new Image;n.addEventListener("load",(()=>{this.snowboard.globalEvent("assetLoader.loaded","image",e,n),t()})),n.addEventListener("error",(()=>{this.snowboard.globalEvent("assetLoader.error","image",e,n),s(new Error(`Unable to load image file: "${e}"`))})),n.src=e}))}}},553:function(e,t,s){s.d(t,{Z:function(){return i}});var n=s(281);class i extends n.Z{dependencies(){return["request"]}listens(){return{ajaxStart:"ajaxStart",ajaxDone:"ajaxDone"}}ajaxStart(e,t){if(t.element)if("FORM"===t.element.tagName){const e=t.element.querySelectorAll("[data-attach-loading]");e.length>0&&e.forEach((e=>{e.classList.add(this.getLoadingClass(e))}))}else void 0!==t.element.dataset.attachLoading&&t.element.classList.add(this.getLoadingClass(t.element))}ajaxDone(e,t){if(t.element)if("FORM"===t.element.tagName){const e=t.element.querySelectorAll("[data-attach-loading]");e.length>0&&e.forEach((e=>{e.classList.remove(this.getLoadingClass(e))}))}else void 0!==t.element.dataset.attachLoading&&t.element.classList.remove(this.getLoadingClass(t.element))}getLoadingClass(e){return void 0!==e.dataset.attachLoading&&""!==e.dataset.attachLoading?e.dataset.attachLoading:"wn-loading"}}},763:function(e,t,s){s.d(t,{Z:function(){return i}});var n=s(579);class i extends n.Z{construct(e,t,s){if(e instanceof n.Z==!1)throw new Error("You must provide a Snowboard plugin to enable data configuration");if(t instanceof HTMLElement==!1)throw new Error("Data configuration can only be extracted from HTML elements");this.instance=e,this.element=t,this.localConfig=s||{},this.instanceConfig={},this.acceptedConfigs={},this.refresh()}get(e){return void 0===e?this.instanceConfig:void 0!==this.instanceConfig[e]?this.instanceConfig[e]:void 0}set(e,t,s){if(void 0===e)throw new Error("You must provide a configuration key to set");this.instanceConfig[e]=t,!0===s&&(this.element.dataset[e]=t,this.localConfig[e]=t)}refresh(){this.acceptedConfigs=this.getAcceptedConfigs(),this.instanceConfig=this.processConfig()}getAcceptedConfigs(){return void 0!==this.instance.acceptAllDataConfigs&&!0===this.instance.acceptAllDataConfigs||void 0!==this.instance.defaults&&"function"==typeof this.instance.defaults&&"object"==typeof this.instance.defaults()&&Object.keys(this.instance.defaults())}getDefaults(){return void 0!==this.instance.defaults&&"function"==typeof this.instance.defaults&&"object"==typeof this.instance.defaults()?this.instance.defaults():{}}processConfig(){const e=this.getDefaults();if(!1===this.acceptedConfigs)return e;for(const t in this.element.dataset)(!0===this.acceptedConfigs||this.acceptedConfigs.includes(t))&&(e[t]=this.coerceValue(this.element.dataset[t]));for(const t in this.localConfig)(!0===this.acceptedConfigs||this.acceptedConfigs.includes(t))&&(e[t]=this.localConfig[t]);return e}coerceValue(e){const t=String(e);if("null"===t)return null;if("undefined"!==t){if(t.startsWith("base64:")){const e=t.replace(/^base64:/,""),s=atob(e);return this.coerceValue(s)}if(["true","yes"].includes(t.toLowerCase()))return!0;if(["false","no"].includes(t.toLowerCase()))return!1;if(/^[-+]?[0-9]+(\.[0-9]+)?$/.test(t))return Number(t);try{return this.snowboard.jsonParser().parse(t)}catch(e){return""===t||t}}}}},270:function(e,t,s){s.d(t,{Z:function(){return i}});var n=s(579);class i extends n.Z{construct(e,t,s){if(this.message=e,this.type=t||"default",this.duration=Number(s||7),this.duration<0)throw new Error("Flash duration must be a positive number, or zero");this.clear(),this.timer=null,this.flashTimer=null,this.create()}dependencies(){return["transition"]}destruct(){null!==this.timer&&window.clearTimeout(this.timer),this.flashTimer&&this.flashTimer.remove(),this.flash&&(this.flash.remove(),this.flash=null,this.flashTimer=null),super.destruct()}create(){this.snowboard.globalEvent("flash.create",this),this.flash=document.createElement("DIV"),this.flash.innerHTML=this.message,this.flash.classList.add("flash-message",this.type),this.flash.removeAttribute("data-control"),this.flash.addEventListener("click",(()=>this.remove())),this.flash.addEventListener("mouseover",(()=>this.stopTimer())),this.flash.addEventListener("mouseout",(()=>this.startTimer())),this.duration>0?(this.flashTimer=document.createElement("DIV"),this.flashTimer.classList.add("flash-timer"),this.flash.appendChild(this.flashTimer)):this.flash.classList.add("no-timer"),document.body.appendChild(this.flash),this.snowboard.transition(this.flash,"show",(()=>{this.startTimer()}))}remove(){this.snowboard.globalEvent("flash.remove",this),this.stopTimer(),this.snowboard.transition(this.flash,"hide",(()=>{this.flash.remove(),this.flash=null,this.destruct()}))}clear(){document.querySelectorAll("body > div.flash-message").forEach((e=>e.remove()))}startTimer(){0!==this.duration&&(this.timerTrans=this.snowboard.transition(this.flashTimer,"timeout",null,`${this.duration}.0s`,!0),this.timer=window.setTimeout((()=>this.remove()),1e3*this.duration))}stopTimer(){this.timerTrans&&this.timerTrans.cancel(),this.timer&&window.clearTimeout(this.timer)}}},277:function(e,t,s){s.d(t,{Z:function(){return i}});var n=s(281);class i extends n.Z{dependencies(){return["request"]}listens(){return{ready:"ready",ajaxStart:"ajaxStart"}}ready(){this.counter=0,this.createStripe()}ajaxStart(e,t){!1!==t.options.stripe&&(this.show(),e.then((()=>{this.hide()})).catch((()=>{this.hide()})))}createStripe(){this.indicator=document.createElement("DIV"),this.stripe=document.createElement("DIV"),this.stripeLoaded=document.createElement("DIV"),this.indicator.classList.add("stripe-loading-indicator","loaded"),this.stripe.classList.add("stripe"),this.stripeLoaded.classList.add("stripe-loaded"),this.indicator.appendChild(this.stripe),this.indicator.appendChild(this.stripeLoaded),document.body.appendChild(this.indicator)}show(){this.counter+=1;const e=this.stripe.cloneNode(!0);this.indicator.appendChild(e),this.stripe.remove(),this.stripe=e,this.counter>1||(this.indicator.classList.remove("loaded"),document.body.classList.add("wn-loading"))}hide(e){this.counter-=1,!0===e&&(this.counter=0),this.counter<=0&&(this.indicator.classList.add("loaded"),document.body.classList.remove("wn-loading"))}}},32:function(e,t,s){s.d(t,{Z:function(){return i}});var n=s(281);class i extends n.Z{listens(){return{ready:"ready"}}ready(){let e=!1;if(document.querySelectorAll('link[rel="stylesheet"]').forEach((t=>{t.href.endsWith("/modules/system/assets/css/snowboard.extras.css")&&(e=!0)})),!e){const e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("href",this.snowboard.url().asset("/modules/system/assets/css/snowboard.extras.css")),document.head.appendChild(e)}}}},269:function(e,t,s){s.d(t,{Z:function(){return i}});var n=s(579);class i extends n.Z{construct(e,t,s,n,i){if(e instanceof HTMLElement==!1)throw new Error("A HTMLElement must be provided for transitioning");if(this.element=e,"string"!=typeof t)throw new Error("Transition name must be specified as a string");if(this.transition=t,s&&"function"!=typeof s)throw new Error("Callback must be a valid function");this.callback=s,this.duration=n?this.parseDuration(n):null,this.trailTo=!0===i,this.doTransition()}eventClasses(){for(var e=arguments.length,t=new Array(e),s=0;s{const[s,n]=e;-1!==t.indexOf(s)&&i.push(n)})),i}doTransition(){null!==this.duration&&(this.element.style.transitionDuration=this.duration),this.resetClasses(),this.eventClasses("in","active").forEach((e=>{this.element.classList.add(e)})),window.requestAnimationFrame((()=>{"0s"!==window.getComputedStyle(this.element)["transition-duration"]?(this.element.addEventListener("transitionend",(()=>this.onTransitionEnd()),{once:!0}),window.requestAnimationFrame((()=>{this.element.classList.remove(this.eventClasses("in")[0]),this.element.classList.add(this.eventClasses("out")[0])}))):(this.resetClasses(),this.callback&&this.callback.apply(this.element),this.destruct())}))}onTransitionEnd(){this.eventClasses("active",this.trailTo?"":"out").forEach((e=>{this.element.classList.remove(e)})),this.callback&&this.callback.apply(this.element),null!==this.duration&&(this.element.style.transitionDuration=null),this.destruct()}cancel(){this.element.removeEventListener("transitionend",(()=>this.onTransitionEnd),{once:!0}),this.resetClasses(),null!==this.duration&&(this.element.style.transitionDuration=null),this.destruct()}resetClasses(){this.eventClasses().forEach((e=>{this.element.classList.remove(e)}))}parseDuration(e){const t=/^([0-9]+(\.[0-9]+)?)(m?s)?$/.exec(e),s=Number(t[1]);return"sec"===("s"===t[3]?"sec":"msec")?1e3*s+"ms":`${Math.floor(s)}ms`}}},662:function(e,t){t.Z={get(e,t,s){if("string"==typeof t){const s=t.toLowerCase();if(e.hasPlugin(s))return function(){return Reflect.get(e,"plugins")[s].getInstance(...arguments)}}return Reflect.get(e,t,s)},has(e,t){if("string"==typeof t){const s=t.toLowerCase();if(e.hasPlugin(s))return!0}return Reflect.has(e,t)}}},286:function(e,t,s){s.d(t,{Z:function(){return g}});var n=s(579),i=s(281),r={get(e,t,s){if("string"==typeof t){const s=t.toLowerCase();if(["attachAbstracts","loadUtilities","initialise","initialiseSingletons"].includes(t))throw new Error(`You cannot use the "${t}" Snowboard method within a plugin.`);if(e.hasPlugin(s))return function(){return Reflect.get(e,"plugins")[s].getInstance(...arguments)}}return Reflect.get(e,t,s)},has(e,t){if("string"==typeof t){const s=t.toLowerCase();if(["attachAbstracts","loadUtilities","initialise","initialiseSingletons"].includes(t))return!1;if(e.hasPlugin(s))return!0}return Reflect.has(e,t)}};class o{constructor(e,t,s){this.name=e,this.snowboard=new Proxy(t,r),this.instance=s,Object.freeze(this.instance),this.instances=[],this.singleton={initialised:!1},Object.seal(this.singleton),this.mocks={},this.originalFunctions={},Object.freeze(o.prototype),Object.freeze(this)}hasMethod(e){return!this.isFunction()&&"function"==typeof this.instance.prototype[e]}callMethod(){if(this.isFunction())return null;for(var e=arguments.length,t=new Array(e),s=0;s!this.snowboard.getPluginNames().includes(e)));throw new Error(`The "${this.name}" plugin requires the following plugins: ${e.join(", ")}`)}if(this.isSingleton())return 0===this.instances.length&&this.initialiseSingleton(...s),Object.keys(this.mocks).length>0&&(Object.entries(this.originalFunctions).forEach((e=>{const[t,s]=e;this.instances[0][t]=s})),Object.entries(this.mocks).forEach((t=>{const[s,n]=t;this.instances[0][s]=function(){for(var t=arguments.length,s=new Array(t),i=0;i0&&(Object.entries(this.originalFunctions).forEach((e=>{const[t,s]=e;this.instance.prototype[t]=s})),Object.entries(this.mocks).forEach((t=>{const[s,n]=t;this.instance.prototype[s]=function(){for(var t=arguments.length,s=new Array(t),i=0;ithis.instances.splice(this.instances.indexOf(i),1),i.construct(...s),this.instances.push(i),i}getInstances(){return this.isFunction()?[]:this.instances}isFunction(){return"function"==typeof this.instance&&this.instance.prototype instanceof n.Z==!1}isSingleton(){return this.instance.prototype instanceof i.Z==!0}isInitialised(){return!this.isSingleton()||this.singleton.initialised}initialiseSingleton(){if(!this.isSingleton())return;for(var e=arguments.length,t=new Array(e),s=0;sthis.instances.splice(this.instances.indexOf(n),1),n.construct(...t),this.instances.push(n),this.singleton.initialised=!0}getDependencies(){return this.isFunction()||"function"!=typeof this.instance.prototype.dependencies?[]:this.instance.prototype.dependencies().map((e=>e.toLowerCase()))}dependenciesFulfilled(){const e=this.getDependencies();let t=!0;return e.forEach((e=>{this.snowboard.hasPlugin(e)||(t=!1)})),t}mock(e,t){var s=this;if(!this.isFunction()){if(!this.instance.prototype[e])throw new Error(`Function "${e}" does not exist and cannot be mocked`);this.mocks[e]=t,this.originalFunctions[e]=this.instance.prototype[e],this.isSingleton()&&0===this.instances.length&&(this.initialiseSingleton(),this.instances[0][e]=function(){for(var e=arguments.length,n=new Array(e),i=0;i{const[t,s]=e;void 0!==this.defaults[t]&&(this.defaults[t]=s)}))}getDefaults(){const e={};return Object.entries(this.defaults).forEach((t=>{const[s,n]=t;null!==this.defaults[s]&&(e[s]=n)})),e}get(e){if(void 0===e){const e=a.Z.get();return Object.entries(e).forEach((t=>{const[s,n]=t;this.snowboard.globalEvent("cookie.get",s,n,(t=>{e[s]=t}))})),e}let t=a.Z.get(e);return this.snowboard.globalEvent("cookie.get",e,t,(e=>{t=e})),t}set(e,t,s){let n=t;return this.snowboard.globalEvent("cookie.set",e,t,(e=>{n=e})),a.Z.set(e,n,h(h({},this.getDefaults()),s))}remove(e,t){a.Z.remove(e,h(h({},this.getDefaults()),t))}}class u extends i.Z{construct(){window.wnJSON=e=>this.parse(e),window.ocJSON=window.wnJSON}parse(e){const t=this.parseString(e);return JSON.parse(t)}parseString(e){let t=e.trim();if(!t.length)throw new Error("Broken JSON object.");let s="",n=null,i=null,r="";for(;t&&","===t[0];)t=t.substr(1);if('"'===t[0]||"'"===t[0]){if(t[t.length-1]!==t[0])throw new Error("Invalid string JSON object.");r='"';for(let e=1;e="0"&&e[t]<="9"){s="";for(let n=t;n="0"&&e[n]<="9"))return{originLength:s.length,body:s};s+=e[n]}throw new Error(`Broken JSON number body near ${s}`)}if("{"===e[t]||"["===e[t]){const n=[e[t]];s=e[t];for(let i=t+1;i=0?t-5:0,50)}`)}parseKey(e,t,s){let n="";for(let i=t;i="a"&&e[0]<="z"||e[0]>="A"&&e[0]<="Z"||"_"===e[0]||(e[0]>="0"&&e[0]<="9"||("$"===e[0]||e.charCodeAt(0)>255)))}isBlankChar(e){return" "===e||"\n"===e||"\t"===e}}class f extends i.Z{construct(){window.wnSanitize=e=>this.sanitize(e),window.ocSanitize=window.wnSanitize}sanitize(e,t){const s=(new DOMParser).parseFromString(e,"text/html"),n=void 0===t||"boolean"!=typeof t||t;return this.sanitizeNode(s.getRootNode()),n?s.body.innerHTML:s.innerHTML}sanitizeNode(e){if("SCRIPT"===e.tagName)return void e.remove();this.trimAttributes(e);Array.from(e.children).forEach((e=>{this.sanitizeNode(e)}))}trimAttributes(e){if(e.attributes)for(let t=0;t{this.autoInitSingletons&&this.initialiseSingletons(),this.globalEvent("ready"),this.readiness.dom=!0}))}initialiseSingletons(){Object.values(this.plugins).forEach((e=>{e.isSingleton()&&e.dependenciesFulfilled()&&e.initialiseSingleton()}))}addPlugin(e,t){const s=e.toLowerCase();if(this.hasPlugin(s))throw new Error(`A plugin called "${e}" is already registered.`);if("function"!=typeof t&&t instanceof n.Z==!1)throw new Error("The provided plugin must extend the PluginBase class, or must be a callback function.");if(void 0!==this[e]||void 0!==this[s])throw new Error("The given name is already in use for a property or method of the Snowboard class.");this.plugins[s]=new o(s,this,t),this.debug(`Plugin "${e}" registered`),Object.values(this.getPlugins()).forEach((e=>{if(e.isSingleton()&&!e.isInitialised()&&e.dependenciesFulfilled()&&e.hasMethod("listens")&&Object.keys(e.callMethod("listens")).includes("ready")&&this.readiness.dom){const t=e.callMethod("listens").ready;e.callMethod(t)}}))}removePlugin(e){const t=e.toLowerCase();this.hasPlugin(t)?(this.plugins[t].getInstances().forEach((e=>{e.destruct()})),delete this.plugins[t],delete this[t],delete this[e],this.debug(`Plugin "${e}" removed`)):this.debug(`Plugin "${e}" already removed`)}hasPlugin(e){const t=e.toLowerCase();return void 0!==this.plugins[t]}getPlugins(){return this.plugins}getPluginNames(){return Object.keys(this.plugins)}getPlugin(e){const t=e.toLowerCase();if(!this.hasPlugin(t))throw new Error(`No plugin called "${t}" has been registered.`);return this.plugins[t]}listensToEvent(e){const t=[];return Object.entries(this.plugins).forEach((s=>{const[n,i]=s;if(i.isFunction())return;if(!i.dependenciesFulfilled())return;if(!i.hasMethod("listens"))return;const r=i.callMethod("listens");"string"!=typeof r[e]&&"function"!=typeof r[e]||t.push(n)})),t}ready(e){this.readiness.dom&&e(),this.on("ready",e)}on(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].includes(t)||this.listeners[e].push(t)}off(e,t){if(!this.listeners[e])return;const s=this.listeners[e].indexOf(t);-1!==s&&this.listeners[e].splice(s,1)}globalEvent(e){for(var t=arguments.length,s=new Array(t>1?t-1:0),n=1;n{const n=this.getPlugin(t);if(n.isFunction())return;n.isSingleton()&&0===n.getInstances().length&&n.initialiseSingleton();const i=n.callMethod("listens")[e];n.getInstances().forEach((n=>{if(!r)if("function"==typeof i)try{!1===i.apply(n,s)&&(r=!0)}catch(s){this.error(`Error thrown in "${e}" event by "${t}" plugin.`,s)}else if("string"==typeof i){if(!n[i])throw new Error(`Missing "${i}" method in "${t}" plugin`);try{!1===n[i](...s)&&(r=!0,this.debug(`Global event "${e}" cancelled by "${t}" plugin`))}catch(s){this.error(`Error thrown in "${e}" event by "${t}" plugin.`,s)}}else this.error(`Listen method for "${e}" event in "${t}" plugin is not a function or string.`)}))})),!r&&this.listeners[e]&&this.listeners[e].length>0&&(this.debug(`Found ${this.listeners[e].length} ad-hoc listener(s) for global event "${e}"`),this.listeners[e].forEach((t=>{if(!r)try{!1===t(...s)&&(r=!0,this.debug(`Global event "${e} cancelled by an ad-hoc listener.`))}catch(t){this.error(`Error thrown in "${e}" event by an ad-hoc listener.`,t)}}))),!r}globalPromiseEvent(e){for(var t=arguments.length,s=new Array(t>1?t-1:0),n=1;n{const n=this.getPlugin(t);if(n.isFunction())return;n.isSingleton()&&0===n.getInstances().length&&n.initialiseSingleton();const i=n.callMethod("listens")[e];n.getInstances().forEach((n=>{if("function"==typeof i)try{const e=i.apply(n,s);if(e instanceof Promise==!1)return;r.push(e)}catch(s){this.error(`Error thrown in "${e}" event by "${t}" plugin.`,s)}else if("string"==typeof i){if(!n[i])throw new Error(`Missing "${i}" method in "${t}" plugin`);try{const e=n[i](...s);if(e instanceof Promise==!1)return;r.push(e)}catch(s){this.error(`Error thrown in "${e}" promise event by "${t}" plugin.`,s)}}else this.error(`Listen method for "${e}" event in "${t}" plugin is not a function or string.`)}))})),this.listeners[e]&&this.listeners[e].length>0&&(this.debug(`Found ${this.listeners[e].length} ad-hoc listener(s) for global promise event "${e}"`),this.listeners[e].forEach((t=>{try{const e=t(...s);if(e instanceof Promise==!1)return;r.push(e)}catch(t){this.error(`Error thrown in "${e}" promise event by an ad-hoc listener.`,t)}}))),0===r.length?Promise.resolve():Promise.all(r)}logMessage(e,t,s){console.groupCollapsed("%c[Snowboard]",`color: ${e}; font-weight: ${t?"bold":"normal"};`,s);for(var n=arguments.length,i=new Array(n>3?n-3:0),r=3;r{e+=1,console.log(`%c${e}:`,"color: rgb(88, 88, 88); font-weight: normal;",t)})),console.groupEnd(),console.groupCollapsed("%cTrace","color: rgb(45, 167, 199); font-weight: bold;"),console.trace(),console.groupEnd()}else console.trace();console.groupEnd()}log(e){for(var t=arguments.length,s=new Array(t>1?t-1:0),n=1;n1?t-1:0),n=1;n1?t-1:0),n=1;n{const t=new Proxy(new n.Z,i.Z);e.snowboard=t,e.Snowboard=t,e.SnowBoard=t})(window)},640:function(e,t,s){var n=s(579);function i(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function r(e){for(var t=1;t{e&&this.doAjax().then((e=>{if(e.cancelled)return this.cancelled=!0,void this.complete();this.responseData=e,this.processUpdate(e).then((()=>{!1===e.X_WINTER_SUCCESS?this.processError(e):this.processResponse(e)}))}),(e=>{this.responseError=e,this.processError(e)}))})):this.doAjax().then((e=>{if(e.cancelled)return this.cancelled=!0,void this.complete();this.responseData=e,this.processUpdate(e).then((()=>{!1===e.X_WINTER_SUCCESS?this.processError(e):this.processResponse(e)}))}),(e=>{this.responseError=e,this.processError(e)})):this.cancelled=!0}else this.cancelled=!0}dependencies(){return["cookie","jsonParser"]}checkRequest(){if(this.element&&this.element instanceof Element==!1)throw new Error("The element provided must be an Element instance");if(void 0===this.handler)throw new Error("The AJAX handler name is not specified.");if(!this.isHandlerName(this.handler))throw new Error('Invalid AJAX handler name. The correct handler name format is: "onEvent".')}getFetch(){return this.fetchOptions=void 0!==this.options.fetchOptions&&"object"==typeof this.options.fetchOptions?this.options.fetchOptions:{method:"POST",headers:this.headers,body:this.data,redirect:"follow",mode:"same-origin"},this.snowboard.globalEvent("ajaxFetchOptions",this.fetchOptions,this),fetch(this.url,this.fetchOptions)}doClientValidation(){return!0!==this.options.browserValidate||!this.form||!1!==this.form.checkValidity()||(this.form.reportValidity(),!1)}doAjax(){if(!1===this.snowboard.globalEvent("ajaxBeforeSend",this))return Promise.resolve({cancelled:!0});const e=new Promise(((e,t)=>{this.getFetch().then((s=>{s.ok||406===s.status?s.headers.has("Content-Type")&&s.headers.get("Content-Type").includes("/json")?s.json().then((t=>{e(r(r({},t),{},{X_WINTER_SUCCESS:406!==s.status,X_WINTER_RESPONSE_CODE:s.status}))}),(e=>{t(this.renderError(`Unable to parse JSON response: ${e}`))})):s.text().then((t=>{e(t)}),(e=>{t(this.renderError(`Unable to process response: ${e}`))})):s.headers.has("Content-Type")&&s.headers.get("Content-Type").includes("/json")?s.json().then((e=>{e.message&&e.exception?t(this.renderError(e.message,e.exception,e.file,e.line,e.trace)):t(e)}),(e=>{t(this.renderError(`Unable to parse JSON response: ${e}`))})):s.text().then((e=>{t(this.renderError(e))}),(e=>{t(this.renderError(`Unable to process response: ${e}`))}))}),(e=>{t(this.renderError(`Unable to retrieve a response from the server: ${e}`))}))}));if(this.snowboard.globalEvent("ajaxStart",e,this),this.element){const t=new Event("ajaxPromise");t.promise=e,this.element.dispatchEvent(t)}return e}processUpdate(e){return new Promise(((t,s)=>{if("function"==typeof this.options.beforeUpdate&&!1===this.options.beforeUpdate.apply(this,[e]))return void t();const n={};if(Object.entries(e).forEach((e=>{const[t,s]=e;"X_WINTER"!==t.substr(0,8)&&(n[t]=s)})),0===Object.keys(n).length)return void(e.X_WINTER_ASSETS?this.processAssets(e.X_WINTER_ASSETS).then((()=>{t()}),(()=>{s()})):t());this.snowboard.globalPromiseEvent("ajaxBeforeUpdate",e,this).then((async()=>{e.X_WINTER_ASSETS&&await this.processAssets(e.X_WINTER_ASSETS),this.doUpdate(n).then((()=>{window.requestAnimationFrame((()=>t()))}),(()=>{s()}))}),(()=>{t()}))}))}doUpdate(e){return new Promise((t=>{const s=[];Object.entries(e).forEach((e=>{const[t,n]=e;let i=this.options.update&&this.options.update[t]?this.options.update[t]:t,r="replace";"@"===i.substr(0,1)?(r="append",i=i.substr(1)):"^"===i.substr(0,1)?(r="prepend",i=i.substr(1)):"#"!==i.substr(0,1)&&"."!==i.substr(0,1)&&(r="noop");const o=document.querySelectorAll(i);o.length>0&&o.forEach((e=>{switch(r){case"append":e.innerHTML+=n;break;case"prepend":e.innerHTML=n+e.innerHTML;break;case"noop":break;default:e.innerHTML=n}s.push(e),this.snowboard.globalEvent("ajaxUpdate",e,n,this);const t=new Event("ajaxUpdate");t.content=n,e.dispatchEvent(t)}))})),this.snowboard.globalEvent("ajaxUpdateComplete",s,this),t()}))}processResponse(e){if((!this.options.success||"function"!=typeof this.options.success||!1!==this.options.success(this.responseData,this))&&!1!==this.snowboard.globalEvent("ajaxSuccess",this.responseData,this)){if(this.element){const e=new Event("ajaxDone",{cancelable:!0});if(e.responseData=this.responseData,e.request=this,this.element.dispatchEvent(e),e.defaultPrevented)return}this.flash&&e.X_WINTER_FLASH_MESSAGES&&this.processFlashMessages(e.X_WINTER_FLASH_MESSAGES),this.redirect||e.X_WINTER_REDIRECT?this.processRedirect(this.redirect||e.X_WINTER_REDIRECT):this.complete()}}processError(e){if((!this.options.error||"function"!=typeof this.options.error||!1!==this.options.error(this.responseError,this))&&!1!==this.snowboard.globalEvent("ajaxError",this.responseError,this)){if(this.element){const e=new Event("ajaxFail",{cancelable:!0});if(e.responseError=this.responseError,e.request=this,this.element.dispatchEvent(e),e.defaultPrevented)return}if(e instanceof Error)this.processErrorMessage(e.message);else{let t=!1;e.X_WINTER_ERROR_FIELDS&&(t=this.processValidationErrors(e.X_WINTER_ERROR_FIELDS)),e.X_WINTER_ERROR_MESSAGE&&!t&&this.processErrorMessage(e.X_WINTER_ERROR_MESSAGE)}this.complete()}}processRedirect(e){"function"==typeof this.options.handleRedirectResponse&&!1===this.options.handleRedirectResponse.apply(this,[e])||!1!==this.snowboard.globalEvent("ajaxRedirect",e,this)&&(window.addEventListener("popstate",(()=>{if(this.element){const e=document.createEvent("CustomEvent");e.eventName="ajaxRedirected",this.element.dispatchEvent(e)}}),{once:!0}),window.location.assign(e))}processErrorMessage(e){"function"==typeof this.options.handleErrorMessage&&!1===this.options.handleErrorMessage.apply(this,[e])||!1!==this.snowboard.globalEvent("ajaxErrorMessage",e,this)&&window.alert(e)}processFlashMessages(e){"function"==typeof this.options.handleFlashMessages&&!1===this.options.handleFlashMessages.apply(this,[e])||this.snowboard.globalEvent("ajaxFlashMessages",e,this)}processValidationErrors(e){return"function"==typeof this.options.handleValidationErrors&&!1===this.options.handleValidationErrors.apply(this,[this.form,e])||!1===this.snowboard.globalEvent("ajaxValidationErrors",this.form,e,this)}processAssets(e){return this.snowboard.globalPromiseEvent("ajaxLoadAssets",e)}async doConfirm(){if("function"==typeof this.options.handleConfirmMessage)return!1!==this.options.handleConfirmMessage.apply(this,[this.confirm]);if(0===this.snowboard.listensToEvent("ajaxConfirmMessage").length)return window.confirm(this.confirm);const e=this.snowboard.globalPromiseEvent("ajaxConfirmMessage",this.confirm,this);try{if(await e)return!0}catch(e){return!1}return!1}complete(){if(this.options.complete&&"function"==typeof this.options.complete&&this.options.complete(this.responseData,this),this.snowboard.globalEvent("ajaxDone",this.responseData,this),this.element){const e=new Event("ajaxAlways");e.request=this,e.responseData=this.responseData,e.responseError=this.responseError,this.element.dispatchEvent(e)}this.destruct()}get form(){return this.options.form?"string"==typeof this.options.form?document.querySelector(this.options.form):this.options.form:this.element?"FORM"===this.element.tagName?this.element:this.element.closest("form"):null}get context(){return{handler:this.handler,options:this.options}}get headers(){const e={"X-Requested-With":"XMLHttpRequest","X-WINTER-REQUEST-HANDLER":this.handler,"X-WINTER-REQUEST-PARTIALS":this.extractPartials(this.options.update||[])};return this.flash&&(e["X-WINTER-REQUEST-FLASH"]=1),this.xsrfToken&&(e["X-XSRF-TOKEN"]=this.xsrfToken),e}get loading(){return this.options.loading||!1}get url(){return this.options.url||window.location.href}get redirect(){return this.options.redirect&&this.options.redirect.length?this.options.redirect:null}get flash(){return this.options.flash||!1}get files(){return!0===this.options.files&&(void 0!==FormData||(this.snowboard.debug("This browser does not support file uploads"),!1))}get xsrfToken(){return this.snowboard.cookie().get("XSRF-TOKEN")}get data(){const e="object"==typeof this.options.data?this.options.data:{},t=new FormData(this.form||void 0);return Object.keys(e).length>0&&Object.entries(e).forEach((e=>{const[s,n]=e;t.append(s,n)})),t}get confirm(){return this.options.confirm||!1}extractPartials(e){return Object.keys(e).join("&")}renderError(e,t,s,n,i){const r=new Error(e);return r.exception=t||null,r.file=s||null,r.line=n||null,r.trace=i||[],r}isHandlerName(e){return/^(?:\w+:{2})?on[A-Z0-9]/.test(e)}}if(void 0===window.Snowboard)throw new Error("Snowboard must be loaded in order to use the Javascript AJAX request feature.");window.Snowboard.addPlugin("request",a)}},function(e){var t=function(t){return e(e.s=t)};e.O(0,[109],(function(){return t(236),t(640),t(136)}));e.O()}]); \ No newline at end of file +"use strict";(self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[]).push([[290,243,988],{553:function(e,t,s){s.d(t,{Z:function(){return n}});var i=s(579);class n extends i.eG{dependencies(){return["request"]}listens(){return{ajaxStart:"ajaxStart",ajaxDone:"ajaxDone"}}ajaxStart(e,t){if(t.element)if("FORM"===t.element.tagName){const e=t.element.querySelectorAll("[data-attach-loading]");e.length>0&&e.forEach((e=>{e.classList.add(this.getLoadingClass(e))}))}else void 0!==t.element.dataset.attachLoading&&t.element.classList.add(this.getLoadingClass(t.element))}ajaxDone(e,t){if(t.element)if("FORM"===t.element.tagName){const e=t.element.querySelectorAll("[data-attach-loading]");e.length>0&&e.forEach((e=>{e.classList.remove(this.getLoadingClass(e))}))}else void 0!==t.element.dataset.attachLoading&&t.element.classList.remove(this.getLoadingClass(t.element))}getLoadingClass(e){return void 0!==e.dataset.attachLoading&&""!==e.dataset.attachLoading?e.dataset.attachLoading:"wn-loading"}}},270:function(e,t,s){s.d(t,{Z:function(){return n}});var i=s(579);class n extends i.NG{construct(e,t,s){if(this.message=e,this.type=t||"default",this.duration=Number(s||7),this.duration<0)throw new Error("Flash duration must be a positive number, or zero");this.clear(),this.timer=null,this.flashTimer=null,this.create()}dependencies(){return["transition"]}destruct(){null!==this.timer&&window.clearTimeout(this.timer),this.flashTimer&&this.flashTimer.remove(),this.flash&&(this.flash.remove(),this.flash=null,this.flashTimer=null),super.destruct()}create(){this.snowboard.globalEvent("flash.create",this),this.flash=document.createElement("DIV"),this.flash.innerHTML=this.message,this.flash.classList.add("flash-message",this.type),this.flash.removeAttribute("data-control"),this.flash.addEventListener("click",(()=>this.remove())),this.flash.addEventListener("mouseover",(()=>this.stopTimer())),this.flash.addEventListener("mouseout",(()=>this.startTimer())),this.duration>0?(this.flashTimer=document.createElement("DIV"),this.flashTimer.classList.add("flash-timer"),this.flash.appendChild(this.flashTimer)):this.flash.classList.add("no-timer"),document.body.appendChild(this.flash),this.snowboard.transition(this.flash,"show",(()=>{this.startTimer()}))}remove(){this.snowboard.globalEvent("flash.remove",this),this.stopTimer(),this.snowboard.transition(this.flash,"hide",(()=>{this.flash.remove(),this.flash=null,this.destruct()}))}clear(){document.querySelectorAll("body > div.flash-message").forEach((e=>e.remove()))}startTimer(){0!==this.duration&&(this.timerTrans=this.snowboard.transition(this.flashTimer,"timeout",null,`${this.duration}.0s`,!0),this.timer=window.setTimeout((()=>this.remove()),1e3*this.duration))}stopTimer(){this.timerTrans&&this.timerTrans.cancel(),this.timer&&window.clearTimeout(this.timer)}}},277:function(e,t,s){s.d(t,{Z:function(){return n}});var i=s(579);class n extends i.eG{dependencies(){return["request"]}listens(){return{ready:"ready",ajaxStart:"ajaxStart"}}ready(){this.counter=0,this.createStripe()}ajaxStart(e,t){!1!==t.options.stripe&&(this.show(),e.then((()=>{this.hide()})).catch((()=>{this.hide()})))}createStripe(){this.indicator=document.createElement("DIV"),this.stripe=document.createElement("DIV"),this.stripeLoaded=document.createElement("DIV"),this.indicator.classList.add("stripe-loading-indicator","loaded"),this.stripe.classList.add("stripe"),this.stripeLoaded.classList.add("stripe-loaded"),this.indicator.appendChild(this.stripe),this.indicator.appendChild(this.stripeLoaded),document.body.appendChild(this.indicator)}show(){this.counter+=1;const e=this.stripe.cloneNode(!0);this.indicator.appendChild(e),this.stripe.remove(),this.stripe=e,this.counter>1||(this.indicator.classList.remove("loaded"),document.body.classList.add("wn-loading"))}hide(e){this.counter-=1,!0===e&&(this.counter=0),this.counter<=0&&(this.indicator.classList.add("loaded"),document.body.classList.remove("wn-loading"))}}},32:function(e,t,s){s.d(t,{Z:function(){return n}});var i=s(579);class n extends i.eG{listens(){return{ready:"ready"}}ready(){let e=!1;if(document.querySelectorAll('link[rel="stylesheet"]').forEach((t=>{t.href.endsWith("/modules/system/assets/css/snowboard.extras.css")&&(e=!0)})),!e){const e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("href",this.snowboard.url().asset("/modules/system/assets/css/snowboard.extras.css")),document.head.appendChild(e)}}}},269:function(e,t,s){s.d(t,{Z:function(){return n}});var i=s(579);class n extends i.NG{construct(e,t,s,i,n){if(e instanceof HTMLElement==!1)throw new Error("A HTMLElement must be provided for transitioning");if(this.element=e,"string"!=typeof t)throw new Error("Transition name must be specified as a string");if(this.transition=t,s&&"function"!=typeof s)throw new Error("Callback must be a valid function");this.callback=s,this.duration=i?this.parseDuration(i):null,this.trailTo=!0===n,this.doTransition()}eventClasses(){for(var e=arguments.length,t=new Array(e),s=0;s{const[s,i]=e;-1!==t.indexOf(s)&&n.push(i)})),n}doTransition(){null!==this.duration&&(this.element.style.transitionDuration=this.duration),this.resetClasses(),this.eventClasses("in","active").forEach((e=>{this.element.classList.add(e)})),window.requestAnimationFrame((()=>{"0s"!==window.getComputedStyle(this.element)["transition-duration"]?(this.element.addEventListener("transitionend",(()=>this.onTransitionEnd()),{once:!0}),window.requestAnimationFrame((()=>{this.element.classList.remove(this.eventClasses("in")[0]),this.element.classList.add(this.eventClasses("out")[0])}))):(this.resetClasses(),this.callback&&this.callback.apply(this.element),this.destruct())}))}onTransitionEnd(){this.eventClasses("active",this.trailTo?"":"out").forEach((e=>{this.element.classList.remove(e)})),this.callback&&this.callback.apply(this.element),null!==this.duration&&(this.element.style.transitionDuration=null),this.destruct()}cancel(){this.element.removeEventListener("transitionend",(()=>this.onTransitionEnd),{once:!0}),this.resetClasses(),null!==this.duration&&(this.element.style.transitionDuration=null),this.destruct()}resetClasses(){this.eventClasses().forEach((e=>{this.element.classList.remove(e)}))}parseDuration(e){const t=/^([0-9]+(\.[0-9]+)?)(m?s)?$/.exec(e),s=Number(t[1]);return"sec"===("s"===t[3]?"sec":"msec")?1e3*s+"ms":`${Math.floor(s)}ms`}}},136:function(e,t,s){var i,n=s(270),r=s(269),o=s(553),a=s(277),h=s(32);if(void 0===window.Snowboard)throw new Error("Snowboard must be loaded in order to use the extra plugins.");(i=window.Snowboard).addPlugin("extrasStyles",h.Z),i.addPlugin("transition",r.Z),i.addPlugin("flash",n.Z),i.addPlugin("attachLoading",o.Z),i.addPlugin("stripeLoader",a.Z)},236:function(e,t,s){var i=s(579);(e=>{const t=new i.Jc;e.snowboard=t,e.Snowboard=t,e.SnowBoard=t})(window)},640:function(e,t,s){var i=s(579);function n(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,i)}return s}function r(e){for(var t=1;t{e&&this.doAjax().then((e=>{if(e.cancelled)return this.cancelled=!0,void this.complete();this.responseData=e,this.processUpdate(e).then((()=>{!1===e.X_WINTER_SUCCESS?this.processError(e):this.processResponse(e)}))}),(e=>{this.responseError=e,this.processError(e)}))})):this.doAjax().then((e=>{if(e.cancelled)return this.cancelled=!0,void this.complete();this.responseData=e,this.processUpdate(e).then((()=>{!1===e.X_WINTER_SUCCESS?this.processError(e):this.processResponse(e)}))}),(e=>{this.responseError=e,this.processError(e)})):this.cancelled=!0}else this.cancelled=!0}dependencies(){return["cookie","jsonParser"]}checkRequest(){if(this.element&&this.element instanceof Element==!1)throw new Error("The element provided must be an Element instance");if(void 0===this.handler)throw new Error("The AJAX handler name is not specified.");if(!this.isHandlerName(this.handler))throw new Error('Invalid AJAX handler name. The correct handler name format is: "onEvent".')}getFetch(){return this.fetchOptions=void 0!==this.options.fetchOptions&&"object"==typeof this.options.fetchOptions?this.options.fetchOptions:{method:"POST",headers:this.headers,body:this.data,redirect:"follow",mode:"same-origin"},this.snowboard.globalEvent("ajaxFetchOptions",this.fetchOptions,this),fetch(this.url,this.fetchOptions)}doClientValidation(){return!0!==this.options.browserValidate||!this.form||!1!==this.form.checkValidity()||(this.form.reportValidity(),!1)}doAjax(){if(!1===this.snowboard.globalEvent("ajaxBeforeSend",this))return Promise.resolve({cancelled:!0});const e=new Promise(((e,t)=>{this.getFetch().then((s=>{s.ok||406===s.status?s.headers.has("Content-Type")&&s.headers.get("Content-Type").includes("/json")?s.json().then((t=>{e(r(r({},t),{},{X_WINTER_SUCCESS:406!==s.status,X_WINTER_RESPONSE_CODE:s.status}))}),(e=>{t(this.renderError(`Unable to parse JSON response: ${e}`))})):s.text().then((t=>{e(t)}),(e=>{t(this.renderError(`Unable to process response: ${e}`))})):s.headers.has("Content-Type")&&s.headers.get("Content-Type").includes("/json")?s.json().then((e=>{e.message&&e.exception?t(this.renderError(e.message,e.exception,e.file,e.line,e.trace)):t(e)}),(e=>{t(this.renderError(`Unable to parse JSON response: ${e}`))})):s.text().then((e=>{t(this.renderError(e))}),(e=>{t(this.renderError(`Unable to process response: ${e}`))}))}),(e=>{t(this.renderError(`Unable to retrieve a response from the server: ${e}`))}))}));if(this.snowboard.globalEvent("ajaxStart",e,this),this.element){const t=new Event("ajaxPromise");t.promise=e,this.element.dispatchEvent(t)}return e}processUpdate(e){return new Promise(((t,s)=>{if("function"==typeof this.options.beforeUpdate&&!1===this.options.beforeUpdate.apply(this,[e]))return void t();const i={};if(Object.entries(e).forEach((e=>{const[t,s]=e;"X_WINTER"!==t.substr(0,8)&&(i[t]=s)})),0===Object.keys(i).length)return void(e.X_WINTER_ASSETS?this.processAssets(e.X_WINTER_ASSETS).then((()=>{t()}),(()=>{s()})):t());this.snowboard.globalPromiseEvent("ajaxBeforeUpdate",e,this).then((async()=>{e.X_WINTER_ASSETS&&await this.processAssets(e.X_WINTER_ASSETS),this.doUpdate(i).then((()=>{window.requestAnimationFrame((()=>t()))}),(()=>{s()}))}),(()=>{t()}))}))}doUpdate(e){return new Promise((t=>{const s=[];Object.entries(e).forEach((e=>{const[t,i]=e;let n=this.options.update&&this.options.update[t]?this.options.update[t]:t,r="replace";"@"===n.substr(0,1)?(r="append",n=n.substr(1)):"^"===n.substr(0,1)?(r="prepend",n=n.substr(1)):"#"!==n.substr(0,1)&&"."!==n.substr(0,1)&&(r="noop");const o=document.querySelectorAll(n);o.length>0&&o.forEach((e=>{switch(r){case"append":e.innerHTML+=i;break;case"prepend":e.innerHTML=i+e.innerHTML;break;case"noop":break;default:e.innerHTML=i}s.push(e),this.snowboard.globalEvent("ajaxUpdate",e,i,this);const t=new Event("ajaxUpdate");t.content=i,e.dispatchEvent(t)}))})),this.snowboard.globalEvent("ajaxUpdateComplete",s,this),t()}))}processResponse(e){if((!this.options.success||"function"!=typeof this.options.success||!1!==this.options.success(this.responseData,this))&&!1!==this.snowboard.globalEvent("ajaxSuccess",this.responseData,this)){if(this.element){const e=new Event("ajaxDone",{cancelable:!0});if(e.responseData=this.responseData,e.request=this,this.element.dispatchEvent(e),e.defaultPrevented)return}this.flash&&e.X_WINTER_FLASH_MESSAGES&&this.processFlashMessages(e.X_WINTER_FLASH_MESSAGES),this.redirect||e.X_WINTER_REDIRECT?this.processRedirect(this.redirect||e.X_WINTER_REDIRECT):this.complete()}}processError(e){if((!this.options.error||"function"!=typeof this.options.error||!1!==this.options.error(this.responseError,this))&&!1!==this.snowboard.globalEvent("ajaxError",this.responseError,this)){if(this.element){const e=new Event("ajaxFail",{cancelable:!0});if(e.responseError=this.responseError,e.request=this,this.element.dispatchEvent(e),e.defaultPrevented)return}if(e instanceof Error)this.processErrorMessage(e.message);else{let t=!1;e.X_WINTER_ERROR_FIELDS&&(t=this.processValidationErrors(e.X_WINTER_ERROR_FIELDS)),e.X_WINTER_ERROR_MESSAGE&&!t&&this.processErrorMessage(e.X_WINTER_ERROR_MESSAGE)}this.complete()}}processRedirect(e){"function"==typeof this.options.handleRedirectResponse&&!1===this.options.handleRedirectResponse.apply(this,[e])||!1!==this.snowboard.globalEvent("ajaxRedirect",e,this)&&(window.addEventListener("popstate",(()=>{if(this.element){const e=document.createEvent("CustomEvent");e.eventName="ajaxRedirected",this.element.dispatchEvent(e)}}),{once:!0}),window.location.assign(e))}processErrorMessage(e){"function"==typeof this.options.handleErrorMessage&&!1===this.options.handleErrorMessage.apply(this,[e])||!1!==this.snowboard.globalEvent("ajaxErrorMessage",e,this)&&window.alert(e)}processFlashMessages(e){"function"==typeof this.options.handleFlashMessages&&!1===this.options.handleFlashMessages.apply(this,[e])||this.snowboard.globalEvent("ajaxFlashMessages",e,this)}processValidationErrors(e){return"function"==typeof this.options.handleValidationErrors&&!1===this.options.handleValidationErrors.apply(this,[this.form,e])||!1===this.snowboard.globalEvent("ajaxValidationErrors",this.form,e,this)}processAssets(e){return this.snowboard.globalPromiseEvent("ajaxLoadAssets",e)}async doConfirm(){if("function"==typeof this.options.handleConfirmMessage)return!1!==this.options.handleConfirmMessage.apply(this,[this.confirm]);if(0===this.snowboard.listensToEvent("ajaxConfirmMessage").length)return window.confirm(this.confirm);const e=this.snowboard.globalPromiseEvent("ajaxConfirmMessage",this.confirm,this);try{if(await e)return!0}catch(e){return!1}return!1}complete(){if(this.options.complete&&"function"==typeof this.options.complete&&this.options.complete(this.responseData,this),this.snowboard.globalEvent("ajaxDone",this.responseData,this),this.element){const e=new Event("ajaxAlways");e.request=this,e.responseData=this.responseData,e.responseError=this.responseError,this.element.dispatchEvent(e)}this.destruct()}get form(){return this.options.form?"string"==typeof this.options.form?document.querySelector(this.options.form):this.options.form:this.element?"FORM"===this.element.tagName?this.element:this.element.closest("form"):null}get context(){return{handler:this.handler,options:this.options}}get headers(){const e={"X-Requested-With":"XMLHttpRequest","X-WINTER-REQUEST-HANDLER":this.handler,"X-WINTER-REQUEST-PARTIALS":this.extractPartials(this.options.update||[])};return this.flash&&(e["X-WINTER-REQUEST-FLASH"]=1),this.xsrfToken&&(e["X-XSRF-TOKEN"]=this.xsrfToken),e}get loading(){return this.options.loading||!1}get url(){return this.options.url||window.location.href}get redirect(){return this.options.redirect&&this.options.redirect.length?this.options.redirect:null}get flash(){return this.options.flash||!1}get files(){return!0===this.options.files&&(void 0!==FormData||(this.snowboard.debug("This browser does not support file uploads"),!1))}get xsrfToken(){return this.snowboard.cookie().get("XSRF-TOKEN")}get data(){const e="object"==typeof this.options.data?this.options.data:{},t=new FormData(this.form||void 0);return Object.keys(e).length>0&&Object.entries(e).forEach((e=>{const[s,i]=e;t.append(s,i)})),t}get confirm(){return this.options.confirm||!1}extractPartials(e){return Object.keys(e).join("&")}renderError(e,t,s,i,n){const r=new Error(e);return r.exception=t||null,r.file=s||null,r.line=i||null,r.trace=n||[],r}isHandlerName(e){return/^(?:\w+:{2})?on[A-Z0-9]/.test(e)}}if(void 0===window.Snowboard)throw new Error("Snowboard must be loaded in order to use the Javascript AJAX request feature.");window.Snowboard.addPlugin("request",a)}},function(e){var t=function(t){return e(e.s=t)};e.O(0,[109],(function(){return t(236),t(640),t(136)}));e.O()}]); \ No newline at end of file diff --git a/modules/system/assets/js/snowboard/abstracts/PluginBase.js b/modules/system/assets/js/snowboard/abstracts/PluginBase.js deleted file mode 100644 index 613ee1724..000000000 --- a/modules/system/assets/js/snowboard/abstracts/PluginBase.js +++ /dev/null @@ -1,68 +0,0 @@ -/** - * Plugin base abstract. - * - * This class provides the base functionality for all plugins. - * - * @copyright 2021 Winter. - * @author Ben Thomson - */ -export default class PluginBase { - /** - * Constructor. - * - * The constructor is provided the Snowboard framework instance, and should not be overwritten - * unless you absolutely know what you're doing. - * - * @param {Snowboard} snowboard - */ - constructor(snowboard) { - this.snowboard = snowboard; - } - - /** - * Plugin constructor. - * - * This method should be treated as the true constructor of a plugin, and can be overwritten. - * It will be called straight after construction. - */ - construct() { - } - - /** - * Defines the required plugins for this specific module to work. - * - * @returns {string[]} An array of plugins required for this module to work, as strings. - */ - dependencies() { - return []; - } - - /** - * Defines the listener methods for global events. - * - * @returns {Object} - */ - listens() { - return {}; - } - - /** - * Plugin destructor. - * - * Fired when this plugin is removed. Can be manually called if you have another scenario for - * destruction, ie. the element attached to the plugin is removed or changed. - */ - destruct() { - this.detach(); - delete this.snowboard; - } - - /** - * Plugin destructor (old method name). - * - * Allows previous usage of the "destructor" method to still work. - */ - destructor() { - this.destruct(); - } -} diff --git a/modules/system/assets/js/snowboard/abstracts/Singleton.js b/modules/system/assets/js/snowboard/abstracts/Singleton.js deleted file mode 100644 index 557e09c3d..000000000 --- a/modules/system/assets/js/snowboard/abstracts/Singleton.js +++ /dev/null @@ -1,15 +0,0 @@ -import PluginBase from './PluginBase'; - -/** - * Singleton plugin abstract. - * - * This is a special definition class that the Snowboard framework will use to interpret the current plugin as a - * "singleton". This will ensure that only one instance of the plugin class is used across the board. - * - * Singletons are initialised on the "domReady" event by default. - * - * @copyright 2021 Winter. - * @author Ben Thomson - */ -export default class Singleton extends PluginBase { -} diff --git a/modules/system/assets/js/snowboard/ajax/Request.js b/modules/system/assets/js/snowboard/ajax/Request.js index b09871904..5dba0cb30 100644 --- a/modules/system/assets/js/snowboard/ajax/Request.js +++ b/modules/system/assets/js/snowboard/ajax/Request.js @@ -1,4 +1,4 @@ -import PluginBase from '../abstracts/PluginBase'; +import { PluginBase } from "@wintercms/snowboard"; /** * Request plugin. diff --git a/modules/system/assets/js/snowboard/ajax/handlers/AttributeRequest.js b/modules/system/assets/js/snowboard/ajax/handlers/AttributeRequest.js index eebe1a258..d90073d7a 100644 --- a/modules/system/assets/js/snowboard/ajax/handlers/AttributeRequest.js +++ b/modules/system/assets/js/snowboard/ajax/handlers/AttributeRequest.js @@ -1,4 +1,4 @@ -import Singleton from '../../abstracts/Singleton'; +import { Singleton } from "@wintercms/snowboard"; /** * Enable Data Attributes API for AJAX requests. @@ -39,7 +39,7 @@ export default class AttributeRequest extends Singleton { * @returns {string[]} */ dependencies() { - return ['request', 'jsonParser']; + return ['request', 'cookie', 'jsonParser']; } /** diff --git a/modules/system/assets/js/snowboard/build/snowboard.base.debug.js b/modules/system/assets/js/snowboard/build/snowboard.base.debug.js index 513538bfd..468f6cb15 100644 --- a/modules/system/assets/js/snowboard/build/snowboard.base.debug.js +++ b/modules/system/assets/js/snowboard/build/snowboard.base.debug.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[]).push([[450],{579:function(e,t,n){n.d(t,{Z:function(){return i}});class i{constructor(e){this.snowboard=e}construct(){}dependencies(){return[]}listens(){return{}}destruct(){this.detach(),delete this.snowboard}destructor(){this.destruct()}}},281:function(e,t,n){n.d(t,{Z:function(){return s}});var i=n(579);class s extends i.Z{}},662:function(e,t){t.Z={get(e,t,n){if("string"==typeof t){const n=t.toLowerCase();if(e.hasPlugin(n))return function(){return Reflect.get(e,"plugins")[n].getInstance(...arguments)}}return Reflect.get(e,t,n)},has(e,t){if("string"==typeof t){const n=t.toLowerCase();if(e.hasPlugin(n))return!0}return Reflect.has(e,t)}}},286:function(e,t,n){n.d(t,{Z:function(){return b}});var i=n(579),s=n(281),r={get(e,t,n){if("string"==typeof t){const n=t.toLowerCase();if(["attachAbstracts","loadUtilities","initialise","initialiseSingletons"].includes(t))throw new Error(`You cannot use the "${t}" Snowboard method within a plugin.`);if(e.hasPlugin(n))return function(){return Reflect.get(e,"plugins")[n].getInstance(...arguments)}}return Reflect.get(e,t,n)},has(e,t){if("string"==typeof t){const n=t.toLowerCase();if(["attachAbstracts","loadUtilities","initialise","initialiseSingletons"].includes(t))return!1;if(e.hasPlugin(n))return!0}return Reflect.has(e,t)}};class o{constructor(e,t,n){this.name=e,this.snowboard=new Proxy(t,r),this.instance=n,Object.freeze(this.instance),this.instances=[],this.singleton={initialised:!1},Object.seal(this.singleton),this.mocks={},this.originalFunctions={},Object.freeze(o.prototype),Object.freeze(this)}hasMethod(e){return!this.isFunction()&&"function"==typeof this.instance.prototype[e]}callMethod(){if(this.isFunction())return null;for(var e=arguments.length,t=new Array(e),n=0;n!this.snowboard.getPluginNames().includes(e)));throw new Error(`The "${this.name}" plugin requires the following plugins: ${e.join(", ")}`)}if(this.isSingleton())return 0===this.instances.length&&this.initialiseSingleton(...n),Object.keys(this.mocks).length>0&&(Object.entries(this.originalFunctions).forEach((e=>{const[t,n]=e;this.instances[0][t]=n})),Object.entries(this.mocks).forEach((t=>{const[n,i]=t;this.instances[0][n]=function(){for(var t=arguments.length,n=new Array(t),s=0;s0&&(Object.entries(this.originalFunctions).forEach((e=>{const[t,n]=e;this.instance.prototype[t]=n})),Object.entries(this.mocks).forEach((t=>{const[n,i]=t;this.instance.prototype[n]=function(){for(var t=arguments.length,n=new Array(t),s=0;sthis.instances.splice(this.instances.indexOf(s),1),s.construct(...n),this.instances.push(s),s}getInstances(){return this.isFunction()?[]:this.instances}isFunction(){return"function"==typeof this.instance&&this.instance.prototype instanceof i.Z==!1}isSingleton(){return this.instance.prototype instanceof s.Z==!0}isInitialised(){return!this.isSingleton()||this.singleton.initialised}initialiseSingleton(){if(!this.isSingleton())return;for(var e=arguments.length,t=new Array(e),n=0;nthis.instances.splice(this.instances.indexOf(i),1),i.construct(...t),this.instances.push(i),this.singleton.initialised=!0}getDependencies(){return this.isFunction()||"function"!=typeof this.instance.prototype.dependencies?[]:this.instance.prototype.dependencies().map((e=>e.toLowerCase()))}dependenciesFulfilled(){const e=this.getDependencies();let t=!0;return e.forEach((e=>{this.snowboard.hasPlugin(e)||(t=!1)})),t}mock(e,t){var n=this;if(!this.isFunction()){if(!this.instance.prototype[e])throw new Error(`Function "${e}" does not exist and cannot be mocked`);this.mocks[e]=t,this.originalFunctions[e]=this.instance.prototype[e],this.isSingleton()&&0===this.instances.length&&(this.initialiseSingleton(),this.instances[0][e]=function(){for(var e=arguments.length,i=new Array(e),s=0;s{const[t,n]=e;void 0!==this.defaults[t]&&(this.defaults[t]=n)}))}getDefaults(){const e={};return Object.entries(this.defaults).forEach((t=>{const[n,i]=t;null!==this.defaults[n]&&(e[n]=i)})),e}get(e){if(void 0===e){const e=l.Z.get();return Object.entries(e).forEach((t=>{const[n,i]=t;this.snowboard.globalEvent("cookie.get",n,i,(t=>{e[n]=t}))})),e}let t=l.Z.get(e);return this.snowboard.globalEvent("cookie.get",e,t,(e=>{t=e})),t}set(e,t,n){let i=t;return this.snowboard.globalEvent("cookie.set",e,t,(e=>{i=e})),l.Z.set(e,i,h(h({},this.getDefaults()),n))}remove(e,t){l.Z.remove(e,h(h({},this.getDefaults()),t))}}class f extends s.Z{construct(){window.wnJSON=e=>this.parse(e),window.ocJSON=window.wnJSON}parse(e){const t=this.parseString(e);return JSON.parse(t)}parseString(e){let t=e.trim();if(!t.length)throw new Error("Broken JSON object.");let n="",i=null,s=null,r="";for(;t&&","===t[0];)t=t.substr(1);if('"'===t[0]||"'"===t[0]){if(t[t.length-1]!==t[0])throw new Error("Invalid string JSON object.");r='"';for(let e=1;e="0"&&e[t]<="9"){n="";for(let i=t;i="0"&&e[i]<="9"))return{originLength:n.length,body:n};n+=e[i]}throw new Error(`Broken JSON number body near ${n}`)}if("{"===e[t]||"["===e[t]){const i=[e[t]];n=e[t];for(let s=t+1;s=0?t-5:0,50)}`)}parseKey(e,t,n){let i="";for(let s=t;s="a"&&e[0]<="z"||e[0]>="A"&&e[0]<="Z"||"_"===e[0]||(e[0]>="0"&&e[0]<="9"||("$"===e[0]||e.charCodeAt(0)>255)))}isBlankChar(e){return" "===e||"\n"===e||"\t"===e}}class d extends s.Z{construct(){window.wnSanitize=e=>this.sanitize(e),window.ocSanitize=window.wnSanitize}sanitize(e,t){const n=(new DOMParser).parseFromString(e,"text/html"),i=void 0===t||"boolean"!=typeof t||t;return this.sanitizeNode(n.getRootNode()),i?n.body.innerHTML:n.innerHTML}sanitizeNode(e){if("SCRIPT"===e.tagName)return void e.remove();this.trimAttributes(e);Array.from(e.children).forEach((e=>{this.sanitizeNode(e)}))}trimAttributes(e){if(e.attributes)for(let t=0;t{this.autoInitSingletons&&this.initialiseSingletons(),this.globalEvent("ready"),this.readiness.dom=!0}))}initialiseSingletons(){Object.values(this.plugins).forEach((e=>{e.isSingleton()&&e.dependenciesFulfilled()&&e.initialiseSingleton()}))}addPlugin(e,t){const n=e.toLowerCase();if(this.hasPlugin(n))throw new Error(`A plugin called "${e}" is already registered.`);if("function"!=typeof t&&t instanceof i.Z==!1)throw new Error("The provided plugin must extend the PluginBase class, or must be a callback function.");if(void 0!==this[e]||void 0!==this[n])throw new Error("The given name is already in use for a property or method of the Snowboard class.");this.plugins[n]=new o(n,this,t),this.debug(`Plugin "${e}" registered`),Object.values(this.getPlugins()).forEach((e=>{if(e.isSingleton()&&!e.isInitialised()&&e.dependenciesFulfilled()&&e.hasMethod("listens")&&Object.keys(e.callMethod("listens")).includes("ready")&&this.readiness.dom){const t=e.callMethod("listens").ready;e.callMethod(t)}}))}removePlugin(e){const t=e.toLowerCase();this.hasPlugin(t)?(this.plugins[t].getInstances().forEach((e=>{e.destruct()})),delete this.plugins[t],delete this[t],delete this[e],this.debug(`Plugin "${e}" removed`)):this.debug(`Plugin "${e}" already removed`)}hasPlugin(e){const t=e.toLowerCase();return void 0!==this.plugins[t]}getPlugins(){return this.plugins}getPluginNames(){return Object.keys(this.plugins)}getPlugin(e){const t=e.toLowerCase();if(!this.hasPlugin(t))throw new Error(`No plugin called "${t}" has been registered.`);return this.plugins[t]}listensToEvent(e){const t=[];return Object.entries(this.plugins).forEach((n=>{const[i,s]=n;if(s.isFunction())return;if(!s.dependenciesFulfilled())return;if(!s.hasMethod("listens"))return;const r=s.callMethod("listens");"string"!=typeof r[e]&&"function"!=typeof r[e]||t.push(i)})),t}ready(e){this.readiness.dom&&e(),this.on("ready",e)}on(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].includes(t)||this.listeners[e].push(t)}off(e,t){if(!this.listeners[e])return;const n=this.listeners[e].indexOf(t);-1!==n&&this.listeners[e].splice(n,1)}globalEvent(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i{const i=this.getPlugin(t);if(i.isFunction())return;i.isSingleton()&&0===i.getInstances().length&&i.initialiseSingleton();const s=i.callMethod("listens")[e];i.getInstances().forEach((i=>{if(!r)if("function"==typeof s)try{!1===s.apply(i,n)&&(r=!0)}catch(n){this.error(`Error thrown in "${e}" event by "${t}" plugin.`,n)}else if("string"==typeof s){if(!i[s])throw new Error(`Missing "${s}" method in "${t}" plugin`);try{!1===i[s](...n)&&(r=!0,this.debug(`Global event "${e}" cancelled by "${t}" plugin`))}catch(n){this.error(`Error thrown in "${e}" event by "${t}" plugin.`,n)}}else this.error(`Listen method for "${e}" event in "${t}" plugin is not a function or string.`)}))})),!r&&this.listeners[e]&&this.listeners[e].length>0&&(this.debug(`Found ${this.listeners[e].length} ad-hoc listener(s) for global event "${e}"`),this.listeners[e].forEach((t=>{if(!r)try{!1===t(...n)&&(r=!0,this.debug(`Global event "${e} cancelled by an ad-hoc listener.`))}catch(t){this.error(`Error thrown in "${e}" event by an ad-hoc listener.`,t)}}))),!r}globalPromiseEvent(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i{const i=this.getPlugin(t);if(i.isFunction())return;i.isSingleton()&&0===i.getInstances().length&&i.initialiseSingleton();const s=i.callMethod("listens")[e];i.getInstances().forEach((i=>{if("function"==typeof s)try{const e=s.apply(i,n);if(e instanceof Promise==!1)return;r.push(e)}catch(n){this.error(`Error thrown in "${e}" event by "${t}" plugin.`,n)}else if("string"==typeof s){if(!i[s])throw new Error(`Missing "${s}" method in "${t}" plugin`);try{const e=i[s](...n);if(e instanceof Promise==!1)return;r.push(e)}catch(n){this.error(`Error thrown in "${e}" promise event by "${t}" plugin.`,n)}}else this.error(`Listen method for "${e}" event in "${t}" plugin is not a function or string.`)}))})),this.listeners[e]&&this.listeners[e].length>0&&(this.debug(`Found ${this.listeners[e].length} ad-hoc listener(s) for global promise event "${e}"`),this.listeners[e].forEach((t=>{try{const e=t(...n);if(e instanceof Promise==!1)return;r.push(e)}catch(t){this.error(`Error thrown in "${e}" promise event by an ad-hoc listener.`,t)}}))),0===r.length?Promise.resolve():Promise.all(r)}logMessage(e,t,n){console.groupCollapsed("%c[Snowboard]",`color: ${e}; font-weight: ${t?"bold":"normal"};`,n);for(var i=arguments.length,s=new Array(i>3?i-3:0),r=3;r{e+=1,console.log(`%c${e}:`,"color: rgb(88, 88, 88); font-weight: normal;",t)})),console.groupEnd(),console.groupCollapsed("%cTrace","color: rgb(45, 167, 199); font-weight: bold;"),console.trace(),console.groupEnd()}else console.trace();console.groupEnd()}log(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i1?t-1:0),i=1;i1?t-1:0),i=1;i{const t=new Proxy(new i.Z(!0,!0),s.Z);e.snowboard=t,e.Snowboard=t,e.SnowBoard=t})(window)}},function(e){e.O(0,[109],(function(){return t=165,e(e.s=t);var t}));e.O()}]); \ No newline at end of file +"use strict";(self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[]).push([[450],{165:function(n,s,e){var o=e(579);(n=>{const s=new o.Jc(!0);n.snowboard=s,n.Snowboard=s,n.SnowBoard=s})(window)}},function(n){n.O(0,[109],(function(){return s=165,n(n.s=s);var s}));n.O()}]); \ No newline at end of file diff --git a/modules/system/assets/js/snowboard/build/snowboard.base.js b/modules/system/assets/js/snowboard/build/snowboard.base.js index e92fb327a..3cbe0d689 100644 --- a/modules/system/assets/js/snowboard/build/snowboard.base.js +++ b/modules/system/assets/js/snowboard/build/snowboard.base.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[]).push([[243],{579:function(e,t,n){n.d(t,{Z:function(){return i}});class i{constructor(e){this.snowboard=e}construct(){}dependencies(){return[]}listens(){return{}}destruct(){this.detach(),delete this.snowboard}destructor(){this.destruct()}}},281:function(e,t,n){n.d(t,{Z:function(){return s}});var i=n(579);class s extends i.Z{}},662:function(e,t){t.Z={get(e,t,n){if("string"==typeof t){const n=t.toLowerCase();if(e.hasPlugin(n))return function(){return Reflect.get(e,"plugins")[n].getInstance(...arguments)}}return Reflect.get(e,t,n)},has(e,t){if("string"==typeof t){const n=t.toLowerCase();if(e.hasPlugin(n))return!0}return Reflect.has(e,t)}}},286:function(e,t,n){n.d(t,{Z:function(){return b}});var i=n(579),s=n(281),r={get(e,t,n){if("string"==typeof t){const n=t.toLowerCase();if(["attachAbstracts","loadUtilities","initialise","initialiseSingletons"].includes(t))throw new Error(`You cannot use the "${t}" Snowboard method within a plugin.`);if(e.hasPlugin(n))return function(){return Reflect.get(e,"plugins")[n].getInstance(...arguments)}}return Reflect.get(e,t,n)},has(e,t){if("string"==typeof t){const n=t.toLowerCase();if(["attachAbstracts","loadUtilities","initialise","initialiseSingletons"].includes(t))return!1;if(e.hasPlugin(n))return!0}return Reflect.has(e,t)}};class o{constructor(e,t,n){this.name=e,this.snowboard=new Proxy(t,r),this.instance=n,Object.freeze(this.instance),this.instances=[],this.singleton={initialised:!1},Object.seal(this.singleton),this.mocks={},this.originalFunctions={},Object.freeze(o.prototype),Object.freeze(this)}hasMethod(e){return!this.isFunction()&&"function"==typeof this.instance.prototype[e]}callMethod(){if(this.isFunction())return null;for(var e=arguments.length,t=new Array(e),n=0;n!this.snowboard.getPluginNames().includes(e)));throw new Error(`The "${this.name}" plugin requires the following plugins: ${e.join(", ")}`)}if(this.isSingleton())return 0===this.instances.length&&this.initialiseSingleton(...n),Object.keys(this.mocks).length>0&&(Object.entries(this.originalFunctions).forEach((e=>{const[t,n]=e;this.instances[0][t]=n})),Object.entries(this.mocks).forEach((t=>{const[n,i]=t;this.instances[0][n]=function(){for(var t=arguments.length,n=new Array(t),s=0;s0&&(Object.entries(this.originalFunctions).forEach((e=>{const[t,n]=e;this.instance.prototype[t]=n})),Object.entries(this.mocks).forEach((t=>{const[n,i]=t;this.instance.prototype[n]=function(){for(var t=arguments.length,n=new Array(t),s=0;sthis.instances.splice(this.instances.indexOf(s),1),s.construct(...n),this.instances.push(s),s}getInstances(){return this.isFunction()?[]:this.instances}isFunction(){return"function"==typeof this.instance&&this.instance.prototype instanceof i.Z==!1}isSingleton(){return this.instance.prototype instanceof s.Z==!0}isInitialised(){return!this.isSingleton()||this.singleton.initialised}initialiseSingleton(){if(!this.isSingleton())return;for(var e=arguments.length,t=new Array(e),n=0;nthis.instances.splice(this.instances.indexOf(i),1),i.construct(...t),this.instances.push(i),this.singleton.initialised=!0}getDependencies(){return this.isFunction()||"function"!=typeof this.instance.prototype.dependencies?[]:this.instance.prototype.dependencies().map((e=>e.toLowerCase()))}dependenciesFulfilled(){const e=this.getDependencies();let t=!0;return e.forEach((e=>{this.snowboard.hasPlugin(e)||(t=!1)})),t}mock(e,t){var n=this;if(!this.isFunction()){if(!this.instance.prototype[e])throw new Error(`Function "${e}" does not exist and cannot be mocked`);this.mocks[e]=t,this.originalFunctions[e]=this.instance.prototype[e],this.isSingleton()&&0===this.instances.length&&(this.initialiseSingleton(),this.instances[0][e]=function(){for(var e=arguments.length,i=new Array(e),s=0;s{const[t,n]=e;void 0!==this.defaults[t]&&(this.defaults[t]=n)}))}getDefaults(){const e={};return Object.entries(this.defaults).forEach((t=>{const[n,i]=t;null!==this.defaults[n]&&(e[n]=i)})),e}get(e){if(void 0===e){const e=l.Z.get();return Object.entries(e).forEach((t=>{const[n,i]=t;this.snowboard.globalEvent("cookie.get",n,i,(t=>{e[n]=t}))})),e}let t=l.Z.get(e);return this.snowboard.globalEvent("cookie.get",e,t,(e=>{t=e})),t}set(e,t,n){let i=t;return this.snowboard.globalEvent("cookie.set",e,t,(e=>{i=e})),l.Z.set(e,i,h(h({},this.getDefaults()),n))}remove(e,t){l.Z.remove(e,h(h({},this.getDefaults()),t))}}class f extends s.Z{construct(){window.wnJSON=e=>this.parse(e),window.ocJSON=window.wnJSON}parse(e){const t=this.parseString(e);return JSON.parse(t)}parseString(e){let t=e.trim();if(!t.length)throw new Error("Broken JSON object.");let n="",i=null,s=null,r="";for(;t&&","===t[0];)t=t.substr(1);if('"'===t[0]||"'"===t[0]){if(t[t.length-1]!==t[0])throw new Error("Invalid string JSON object.");r='"';for(let e=1;e="0"&&e[t]<="9"){n="";for(let i=t;i="0"&&e[i]<="9"))return{originLength:n.length,body:n};n+=e[i]}throw new Error(`Broken JSON number body near ${n}`)}if("{"===e[t]||"["===e[t]){const i=[e[t]];n=e[t];for(let s=t+1;s=0?t-5:0,50)}`)}parseKey(e,t,n){let i="";for(let s=t;s="a"&&e[0]<="z"||e[0]>="A"&&e[0]<="Z"||"_"===e[0]||(e[0]>="0"&&e[0]<="9"||("$"===e[0]||e.charCodeAt(0)>255)))}isBlankChar(e){return" "===e||"\n"===e||"\t"===e}}class d extends s.Z{construct(){window.wnSanitize=e=>this.sanitize(e),window.ocSanitize=window.wnSanitize}sanitize(e,t){const n=(new DOMParser).parseFromString(e,"text/html"),i=void 0===t||"boolean"!=typeof t||t;return this.sanitizeNode(n.getRootNode()),i?n.body.innerHTML:n.innerHTML}sanitizeNode(e){if("SCRIPT"===e.tagName)return void e.remove();this.trimAttributes(e);Array.from(e.children).forEach((e=>{this.sanitizeNode(e)}))}trimAttributes(e){if(e.attributes)for(let t=0;t{this.autoInitSingletons&&this.initialiseSingletons(),this.globalEvent("ready"),this.readiness.dom=!0}))}initialiseSingletons(){Object.values(this.plugins).forEach((e=>{e.isSingleton()&&e.dependenciesFulfilled()&&e.initialiseSingleton()}))}addPlugin(e,t){const n=e.toLowerCase();if(this.hasPlugin(n))throw new Error(`A plugin called "${e}" is already registered.`);if("function"!=typeof t&&t instanceof i.Z==!1)throw new Error("The provided plugin must extend the PluginBase class, or must be a callback function.");if(void 0!==this[e]||void 0!==this[n])throw new Error("The given name is already in use for a property or method of the Snowboard class.");this.plugins[n]=new o(n,this,t),this.debug(`Plugin "${e}" registered`),Object.values(this.getPlugins()).forEach((e=>{if(e.isSingleton()&&!e.isInitialised()&&e.dependenciesFulfilled()&&e.hasMethod("listens")&&Object.keys(e.callMethod("listens")).includes("ready")&&this.readiness.dom){const t=e.callMethod("listens").ready;e.callMethod(t)}}))}removePlugin(e){const t=e.toLowerCase();this.hasPlugin(t)?(this.plugins[t].getInstances().forEach((e=>{e.destruct()})),delete this.plugins[t],delete this[t],delete this[e],this.debug(`Plugin "${e}" removed`)):this.debug(`Plugin "${e}" already removed`)}hasPlugin(e){const t=e.toLowerCase();return void 0!==this.plugins[t]}getPlugins(){return this.plugins}getPluginNames(){return Object.keys(this.plugins)}getPlugin(e){const t=e.toLowerCase();if(!this.hasPlugin(t))throw new Error(`No plugin called "${t}" has been registered.`);return this.plugins[t]}listensToEvent(e){const t=[];return Object.entries(this.plugins).forEach((n=>{const[i,s]=n;if(s.isFunction())return;if(!s.dependenciesFulfilled())return;if(!s.hasMethod("listens"))return;const r=s.callMethod("listens");"string"!=typeof r[e]&&"function"!=typeof r[e]||t.push(i)})),t}ready(e){this.readiness.dom&&e(),this.on("ready",e)}on(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].includes(t)||this.listeners[e].push(t)}off(e,t){if(!this.listeners[e])return;const n=this.listeners[e].indexOf(t);-1!==n&&this.listeners[e].splice(n,1)}globalEvent(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i{const i=this.getPlugin(t);if(i.isFunction())return;i.isSingleton()&&0===i.getInstances().length&&i.initialiseSingleton();const s=i.callMethod("listens")[e];i.getInstances().forEach((i=>{if(!r)if("function"==typeof s)try{!1===s.apply(i,n)&&(r=!0)}catch(n){this.error(`Error thrown in "${e}" event by "${t}" plugin.`,n)}else if("string"==typeof s){if(!i[s])throw new Error(`Missing "${s}" method in "${t}" plugin`);try{!1===i[s](...n)&&(r=!0,this.debug(`Global event "${e}" cancelled by "${t}" plugin`))}catch(n){this.error(`Error thrown in "${e}" event by "${t}" plugin.`,n)}}else this.error(`Listen method for "${e}" event in "${t}" plugin is not a function or string.`)}))})),!r&&this.listeners[e]&&this.listeners[e].length>0&&(this.debug(`Found ${this.listeners[e].length} ad-hoc listener(s) for global event "${e}"`),this.listeners[e].forEach((t=>{if(!r)try{!1===t(...n)&&(r=!0,this.debug(`Global event "${e} cancelled by an ad-hoc listener.`))}catch(t){this.error(`Error thrown in "${e}" event by an ad-hoc listener.`,t)}}))),!r}globalPromiseEvent(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i{const i=this.getPlugin(t);if(i.isFunction())return;i.isSingleton()&&0===i.getInstances().length&&i.initialiseSingleton();const s=i.callMethod("listens")[e];i.getInstances().forEach((i=>{if("function"==typeof s)try{const e=s.apply(i,n);if(e instanceof Promise==!1)return;r.push(e)}catch(n){this.error(`Error thrown in "${e}" event by "${t}" plugin.`,n)}else if("string"==typeof s){if(!i[s])throw new Error(`Missing "${s}" method in "${t}" plugin`);try{const e=i[s](...n);if(e instanceof Promise==!1)return;r.push(e)}catch(n){this.error(`Error thrown in "${e}" promise event by "${t}" plugin.`,n)}}else this.error(`Listen method for "${e}" event in "${t}" plugin is not a function or string.`)}))})),this.listeners[e]&&this.listeners[e].length>0&&(this.debug(`Found ${this.listeners[e].length} ad-hoc listener(s) for global promise event "${e}"`),this.listeners[e].forEach((t=>{try{const e=t(...n);if(e instanceof Promise==!1)return;r.push(e)}catch(t){this.error(`Error thrown in "${e}" promise event by an ad-hoc listener.`,t)}}))),0===r.length?Promise.resolve():Promise.all(r)}logMessage(e,t,n){console.groupCollapsed("%c[Snowboard]",`color: ${e}; font-weight: ${t?"bold":"normal"};`,n);for(var i=arguments.length,s=new Array(i>3?i-3:0),r=3;r{e+=1,console.log(`%c${e}:`,"color: rgb(88, 88, 88); font-weight: normal;",t)})),console.groupEnd(),console.groupCollapsed("%cTrace","color: rgb(45, 167, 199); font-weight: bold;"),console.trace(),console.groupEnd()}else console.trace();console.groupEnd()}log(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i1?t-1:0),i=1;i1?t-1:0),i=1;i{const t=new Proxy(new i.Z,s.Z);e.snowboard=t,e.Snowboard=t,e.SnowBoard=t})(window)}},function(e){e.O(0,[109],(function(){return t=236,e(e.s=t);var t}));e.O()}]); \ No newline at end of file +"use strict";(self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[]).push([[243],{236:function(n,s,e){var o=e(579);(n=>{const s=new o.Jc;n.snowboard=s,n.Snowboard=s,n.SnowBoard=s})(window)}},function(n){n.O(0,[109],(function(){return s=236,n(n.s=s);var s}));n.O()}]); \ No newline at end of file diff --git a/modules/system/assets/js/snowboard/build/snowboard.data-attr.js b/modules/system/assets/js/snowboard/build/snowboard.data-attr.js index 39059da80..35bc67abf 100644 --- a/modules/system/assets/js/snowboard/build/snowboard.data-attr.js +++ b/modules/system/assets/js/snowboard/build/snowboard.data-attr.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[]).push([[806],{579:function(e,t,r){r.d(t,{Z:function(){return n}});class n{constructor(e){this.snowboard=e}construct(){}dependencies(){return[]}listens(){return{}}destruct(){this.detach(),delete this.snowboard}destructor(){this.destruct()}}},281:function(e,t,r){r.d(t,{Z:function(){return a}});var n=r(579);class a extends n.Z{}},974:function(e,t,r){var n=r(281);function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;tthis.changeHandler(e))),window.addEventListener("click",(e=>this.clickHandler(e))),window.addEventListener("keydown",(e=>this.keyDownHandler(e))),window.addEventListener("submit",(e=>this.submitHandler(e)))}disableDefaultFormValidation(){document.querySelectorAll("form[data-request]:not([data-browser-validate])").forEach((e=>{e.setAttribute("novalidate",!0)}))}detachHandlers(){window.removeEventListener("change",(e=>this.changeHandler(e))),window.removeEventListener("click",(e=>this.clickHandler(e))),window.removeEventListener("keydown",(e=>this.keyDownHandler(e))),window.removeEventListener("submit",(e=>this.submitHandler(e)))}changeHandler(e){e.target.matches("select[data-request], input[type=radio][data-request], input[type=checkbox][data-request], input[type=file][data-request]")&&this.processRequestOnElement(e.target)}clickHandler(e){let t=e.target;for(;t&&"HTML"!==t.tagName;){if(t.matches("a[data-request], button[data-request], input[type=button][data-request], input[type=submit][data-request]")){e.preventDefault(),this.processRequestOnElement(t);break}t=t.parentElement}}keyDownHandler(e){if(!e.target.matches("input"))return;-1!==["checkbox","color","date","datetime","datetime-local","email","image","month","number","password","radio","range","search","tel","text","time","url","week"].indexOf(e.target.getAttribute("type"))&&("Enter"===e.key&&e.target.matches("*[data-request]")?(this.processRequestOnElement(e.target),e.preventDefault(),e.stopImmediatePropagation()):e.target.matches("*[data-track-input]")&&this.trackInput(e.target))}submitHandler(e){e.target.matches("form[data-request]")&&(e.preventDefault(),this.processRequestOnElement(e.target))}processRequestOnElement(e){const t=e.dataset,r=String(t.request),n={confirm:"requestConfirm"in t?String(t.requestConfirm):null,redirect:"requestRedirect"in t?String(t.requestRedirect):null,loading:"requestLoading"in t?String(t.requestLoading):null,flash:"requestFlash"in t,files:"requestFiles"in t,browserValidate:"requestBrowserValidate"in t,form:"requestForm"in t?String(t.requestForm):null,url:"requestUrl"in t?String(t.requestUrl):null,update:"requestUpdate"in t?this.parseData(String(t.requestUpdate)):[],data:"requestData"in t?this.parseData(String(t.requestData)):[]};this.snowboard.request(e,r,n)}onAjaxSetup(e){if(!e.element)return;const t=e.element.getAttribute("name"),r=s(s({},this.getParentRequestData(e.element)),e.options.data);e.element&&e.element.matches("input, textarea, select, button")&&!e.form&&t&&!e.options.data[t]&&(r[t]=e.element.value),e.options.data=r}getParentRequestData(e){const t=[];let r={},n=e;for(;n.parentElement&&"HTML"!==n.parentElement.tagName;)t.push(n.parentElement),n=n.parentElement;return t.reverse(),t.forEach((e=>{const t=e.dataset;"requestData"in t&&(r=s(s({},r),this.parseData(t.requestData)))})),r}parseData(e){let t;if(void 0===e&&(t=""),"object"==typeof t)return t;try{return this.snowboard.jsonparser().parse(`{${e}}`)}catch(e){throw new Error(`Error parsing the data attribute on element: ${e.message}`)}}trackInput(e){const{lastValue:t}=e.dataset,r=e.dataset.trackInput||300;void 0!==t&&t===e.value||(this.resetTrackInputTimer(e),e.dataset.inputTimer=window.setTimeout((()=>{if(e.dataset.request)return void this.processRequestOnElement(e);let t=e;for(;t.parentElement&&"HTML"!==t.parentElement.tagName;)if(t=t.parentElement,"FORM"===t.tagName&&t.dataset.request){this.processRequestOnElement(t);break}}),r))}resetTrackInputTimer(e){e.dataset.inputTimer&&(window.clearTimeout(e.dataset.inputTimer),e.dataset.inputTimer=null)}}if(void 0===window.Snowboard)throw new Error("Snowboard must be loaded in order to use the HTML data attribute AJAX request feature.");window.Snowboard.addPlugin("attributeRequest",o)}},function(e){var t;t=974,e(e.s=t)}]); \ No newline at end of file +"use strict";(self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[]).push([[806],{974:function(e,t,r){var a=r(579);function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function s(e){for(var t=1;tthis.changeHandler(e))),window.addEventListener("click",(e=>this.clickHandler(e))),window.addEventListener("keydown",(e=>this.keyDownHandler(e))),window.addEventListener("submit",(e=>this.submitHandler(e)))}disableDefaultFormValidation(){document.querySelectorAll("form[data-request]:not([data-browser-validate])").forEach((e=>{e.setAttribute("novalidate",!0)}))}detachHandlers(){window.removeEventListener("change",(e=>this.changeHandler(e))),window.removeEventListener("click",(e=>this.clickHandler(e))),window.removeEventListener("keydown",(e=>this.keyDownHandler(e))),window.removeEventListener("submit",(e=>this.submitHandler(e)))}changeHandler(e){e.target.matches("select[data-request], input[type=radio][data-request], input[type=checkbox][data-request], input[type=file][data-request]")&&this.processRequestOnElement(e.target)}clickHandler(e){let t=e.target;for(;t&&"HTML"!==t.tagName;){if(t.matches("a[data-request], button[data-request], input[type=button][data-request], input[type=submit][data-request]")){e.preventDefault(),this.processRequestOnElement(t);break}t=t.parentElement}}keyDownHandler(e){if(!e.target.matches("input"))return;-1!==["checkbox","color","date","datetime","datetime-local","email","image","month","number","password","radio","range","search","tel","text","time","url","week"].indexOf(e.target.getAttribute("type"))&&("Enter"===e.key&&e.target.matches("*[data-request]")?(this.processRequestOnElement(e.target),e.preventDefault(),e.stopImmediatePropagation()):e.target.matches("*[data-track-input]")&&this.trackInput(e.target))}submitHandler(e){e.target.matches("form[data-request]")&&(e.preventDefault(),this.processRequestOnElement(e.target))}processRequestOnElement(e){const t=e.dataset,r=String(t.request),a={confirm:"requestConfirm"in t?String(t.requestConfirm):null,redirect:"requestRedirect"in t?String(t.requestRedirect):null,loading:"requestLoading"in t?String(t.requestLoading):null,flash:"requestFlash"in t,files:"requestFiles"in t,browserValidate:"requestBrowserValidate"in t,form:"requestForm"in t?String(t.requestForm):null,url:"requestUrl"in t?String(t.requestUrl):null,update:"requestUpdate"in t?this.parseData(String(t.requestUpdate)):[],data:"requestData"in t?this.parseData(String(t.requestData)):[]};this.snowboard.request(e,r,a)}onAjaxSetup(e){if(!e.element)return;const t=e.element.getAttribute("name"),r=s(s({},this.getParentRequestData(e.element)),e.options.data);e.element&&e.element.matches("input, textarea, select, button")&&!e.form&&t&&!e.options.data[t]&&(r[t]=e.element.value),e.options.data=r}getParentRequestData(e){const t=[];let r={},a=e;for(;a.parentElement&&"HTML"!==a.parentElement.tagName;)t.push(a.parentElement),a=a.parentElement;return t.reverse(),t.forEach((e=>{const t=e.dataset;"requestData"in t&&(r=s(s({},r),this.parseData(t.requestData)))})),r}parseData(e){let t;if(void 0===e&&(t=""),"object"==typeof t)return t;try{return this.snowboard.jsonparser().parse(`{${e}}`)}catch(e){throw new Error(`Error parsing the data attribute on element: ${e.message}`)}}trackInput(e){const{lastValue:t}=e.dataset,r=e.dataset.trackInput||300;void 0!==t&&t===e.value||(this.resetTrackInputTimer(e),e.dataset.inputTimer=window.setTimeout((()=>{if(e.dataset.request)return void this.processRequestOnElement(e);let t=e;for(;t.parentElement&&"HTML"!==t.parentElement.tagName;)if(t=t.parentElement,"FORM"===t.tagName&&t.dataset.request){this.processRequestOnElement(t);break}}),r))}resetTrackInputTimer(e){e.dataset.inputTimer&&(window.clearTimeout(e.dataset.inputTimer),e.dataset.inputTimer=null)}}if(void 0===window.Snowboard)throw new Error("Snowboard must be loaded in order to use the HTML data attribute AJAX request feature.");window.Snowboard.addPlugin("attributeRequest",o)}},function(e){e.O(0,[109],(function(){return t=974,e(e.s=t);var t}));e.O()}]); \ No newline at end of file diff --git a/modules/system/assets/js/snowboard/build/snowboard.extras.js b/modules/system/assets/js/snowboard/build/snowboard.extras.js index 5a447a911..6b35892c6 100644 --- a/modules/system/assets/js/snowboard/build/snowboard.extras.js +++ b/modules/system/assets/js/snowboard/build/snowboard.extras.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[]).push([[459],{579:function(e,t,s){s.d(t,{Z:function(){return a}});class a{constructor(e){this.snowboard=e}construct(){}dependencies(){return[]}listens(){return{}}destruct(){this.detach(),delete this.snowboard}destructor(){this.destruct()}}},281:function(e,t,s){s.d(t,{Z:function(){return i}});var a=s(579);class i extends a.Z{}},809:function(e,t,s){s.d(t,{Z:function(){return i}});var a=s(281);class i extends a.Z{listens(){return{ajaxLoadAssets:"load"}}dependencies(){return["url"]}async load(e){if(e.js&&e.js.length>0)for(const t of e.js)try{await this.loadScript(t)}catch(e){return Promise.reject(e)}if(e.css&&e.css.length>0)for(const t of e.css)try{await this.loadStyle(t)}catch(e){return Promise.reject(e)}if(e.img&&e.img.length>0)for(const t of e.img)try{await this.loadImage(t)}catch(e){return Promise.reject(e)}return Promise.resolve()}loadScript(e){return new Promise(((t,s)=>{e=this.snowboard.url().asset(e);if(document.querySelector(`script[src="${e}"]`))return void t();const a=document.createElement("script");a.setAttribute("type","text/javascript"),a.setAttribute("src",e),a.addEventListener("load",(()=>{this.snowboard.globalEvent("assetLoader.loaded","script",e,a),t()})),a.addEventListener("error",(()=>{this.snowboard.globalEvent("assetLoader.error","script",e,a),s(new Error(`Unable to load script file: "${e}"`))})),document.body.append(a)}))}loadStyle(e){return new Promise(((t,s)=>{e=this.snowboard.url().asset(e);if(document.querySelector(`link[rel="stylesheet"][href="${e}"]`))return void t();const a=document.createElement("link");a.setAttribute("rel","stylesheet"),a.setAttribute("href",e),a.addEventListener("load",(()=>{this.snowboard.globalEvent("assetLoader.loaded","style",e,a),t()})),a.addEventListener("error",(()=>{this.snowboard.globalEvent("assetLoader.error","style",e,a),s(new Error(`Unable to load stylesheet file: "${e}"`))})),document.head.append(a)}))}loadImage(e){return new Promise(((t,s)=>{e=this.snowboard.url().asset(e);const a=new Image;a.addEventListener("load",(()=>{this.snowboard.globalEvent("assetLoader.loaded","image",e,a),t()})),a.addEventListener("error",(()=>{this.snowboard.globalEvent("assetLoader.error","image",e,a),s(new Error(`Unable to load image file: "${e}"`))})),a.src=e}))}}},553:function(e,t,s){s.d(t,{Z:function(){return i}});var a=s(281);class i extends a.Z{dependencies(){return["request"]}listens(){return{ajaxStart:"ajaxStart",ajaxDone:"ajaxDone"}}ajaxStart(e,t){if(t.element)if("FORM"===t.element.tagName){const e=t.element.querySelectorAll("[data-attach-loading]");e.length>0&&e.forEach((e=>{e.classList.add(this.getLoadingClass(e))}))}else void 0!==t.element.dataset.attachLoading&&t.element.classList.add(this.getLoadingClass(t.element))}ajaxDone(e,t){if(t.element)if("FORM"===t.element.tagName){const e=t.element.querySelectorAll("[data-attach-loading]");e.length>0&&e.forEach((e=>{e.classList.remove(this.getLoadingClass(e))}))}else void 0!==t.element.dataset.attachLoading&&t.element.classList.remove(this.getLoadingClass(t.element))}getLoadingClass(e){return void 0!==e.dataset.attachLoading&&""!==e.dataset.attachLoading?e.dataset.attachLoading:"wn-loading"}}},763:function(e,t,s){s.d(t,{Z:function(){return i}});var a=s(579);class i extends a.Z{construct(e,t,s){if(e instanceof a.Z==!1)throw new Error("You must provide a Snowboard plugin to enable data configuration");if(t instanceof HTMLElement==!1)throw new Error("Data configuration can only be extracted from HTML elements");this.instance=e,this.element=t,this.localConfig=s||{},this.instanceConfig={},this.acceptedConfigs={},this.refresh()}get(e){return void 0===e?this.instanceConfig:void 0!==this.instanceConfig[e]?this.instanceConfig[e]:void 0}set(e,t,s){if(void 0===e)throw new Error("You must provide a configuration key to set");this.instanceConfig[e]=t,!0===s&&(this.element.dataset[e]=t,this.localConfig[e]=t)}refresh(){this.acceptedConfigs=this.getAcceptedConfigs(),this.instanceConfig=this.processConfig()}getAcceptedConfigs(){return void 0!==this.instance.acceptAllDataConfigs&&!0===this.instance.acceptAllDataConfigs||void 0!==this.instance.defaults&&"function"==typeof this.instance.defaults&&"object"==typeof this.instance.defaults()&&Object.keys(this.instance.defaults())}getDefaults(){return void 0!==this.instance.defaults&&"function"==typeof this.instance.defaults&&"object"==typeof this.instance.defaults()?this.instance.defaults():{}}processConfig(){const e=this.getDefaults();if(!1===this.acceptedConfigs)return e;for(const t in this.element.dataset)(!0===this.acceptedConfigs||this.acceptedConfigs.includes(t))&&(e[t]=this.coerceValue(this.element.dataset[t]));for(const t in this.localConfig)(!0===this.acceptedConfigs||this.acceptedConfigs.includes(t))&&(e[t]=this.localConfig[t]);return e}coerceValue(e){const t=String(e);if("null"===t)return null;if("undefined"!==t){if(t.startsWith("base64:")){const e=t.replace(/^base64:/,""),s=atob(e);return this.coerceValue(s)}if(["true","yes"].includes(t.toLowerCase()))return!0;if(["false","no"].includes(t.toLowerCase()))return!1;if(/^[-+]?[0-9]+(\.[0-9]+)?$/.test(t))return Number(t);try{return this.snowboard.jsonParser().parse(t)}catch(e){return""===t||t}}}}},270:function(e,t,s){s.d(t,{Z:function(){return i}});var a=s(579);class i extends a.Z{construct(e,t,s){if(this.message=e,this.type=t||"default",this.duration=Number(s||7),this.duration<0)throw new Error("Flash duration must be a positive number, or zero");this.clear(),this.timer=null,this.flashTimer=null,this.create()}dependencies(){return["transition"]}destruct(){null!==this.timer&&window.clearTimeout(this.timer),this.flashTimer&&this.flashTimer.remove(),this.flash&&(this.flash.remove(),this.flash=null,this.flashTimer=null),super.destruct()}create(){this.snowboard.globalEvent("flash.create",this),this.flash=document.createElement("DIV"),this.flash.innerHTML=this.message,this.flash.classList.add("flash-message",this.type),this.flash.removeAttribute("data-control"),this.flash.addEventListener("click",(()=>this.remove())),this.flash.addEventListener("mouseover",(()=>this.stopTimer())),this.flash.addEventListener("mouseout",(()=>this.startTimer())),this.duration>0?(this.flashTimer=document.createElement("DIV"),this.flashTimer.classList.add("flash-timer"),this.flash.appendChild(this.flashTimer)):this.flash.classList.add("no-timer"),document.body.appendChild(this.flash),this.snowboard.transition(this.flash,"show",(()=>{this.startTimer()}))}remove(){this.snowboard.globalEvent("flash.remove",this),this.stopTimer(),this.snowboard.transition(this.flash,"hide",(()=>{this.flash.remove(),this.flash=null,this.destruct()}))}clear(){document.querySelectorAll("body > div.flash-message").forEach((e=>e.remove()))}startTimer(){0!==this.duration&&(this.timerTrans=this.snowboard.transition(this.flashTimer,"timeout",null,`${this.duration}.0s`,!0),this.timer=window.setTimeout((()=>this.remove()),1e3*this.duration))}stopTimer(){this.timerTrans&&this.timerTrans.cancel(),this.timer&&window.clearTimeout(this.timer)}}},277:function(e,t,s){s.d(t,{Z:function(){return i}});var a=s(281);class i extends a.Z{dependencies(){return["request"]}listens(){return{ready:"ready",ajaxStart:"ajaxStart"}}ready(){this.counter=0,this.createStripe()}ajaxStart(e,t){!1!==t.options.stripe&&(this.show(),e.then((()=>{this.hide()})).catch((()=>{this.hide()})))}createStripe(){this.indicator=document.createElement("DIV"),this.stripe=document.createElement("DIV"),this.stripeLoaded=document.createElement("DIV"),this.indicator.classList.add("stripe-loading-indicator","loaded"),this.stripe.classList.add("stripe"),this.stripeLoaded.classList.add("stripe-loaded"),this.indicator.appendChild(this.stripe),this.indicator.appendChild(this.stripeLoaded),document.body.appendChild(this.indicator)}show(){this.counter+=1;const e=this.stripe.cloneNode(!0);this.indicator.appendChild(e),this.stripe.remove(),this.stripe=e,this.counter>1||(this.indicator.classList.remove("loaded"),document.body.classList.add("wn-loading"))}hide(e){this.counter-=1,!0===e&&(this.counter=0),this.counter<=0&&(this.indicator.classList.add("loaded"),document.body.classList.remove("wn-loading"))}}},32:function(e,t,s){s.d(t,{Z:function(){return i}});var a=s(281);class i extends a.Z{listens(){return{ready:"ready"}}ready(){let e=!1;if(document.querySelectorAll('link[rel="stylesheet"]').forEach((t=>{t.href.endsWith("/modules/system/assets/css/snowboard.extras.css")&&(e=!0)})),!e){const e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("href",this.snowboard.url().asset("/modules/system/assets/css/snowboard.extras.css")),document.head.appendChild(e)}}}},269:function(e,t,s){s.d(t,{Z:function(){return i}});var a=s(579);class i extends a.Z{construct(e,t,s,a,i){if(e instanceof HTMLElement==!1)throw new Error("A HTMLElement must be provided for transitioning");if(this.element=e,"string"!=typeof t)throw new Error("Transition name must be specified as a string");if(this.transition=t,s&&"function"!=typeof s)throw new Error("Callback must be a valid function");this.callback=s,this.duration=a?this.parseDuration(a):null,this.trailTo=!0===i,this.doTransition()}eventClasses(){for(var e=arguments.length,t=new Array(e),s=0;s{const[s,a]=e;-1!==t.indexOf(s)&&i.push(a)})),i}doTransition(){null!==this.duration&&(this.element.style.transitionDuration=this.duration),this.resetClasses(),this.eventClasses("in","active").forEach((e=>{this.element.classList.add(e)})),window.requestAnimationFrame((()=>{"0s"!==window.getComputedStyle(this.element)["transition-duration"]?(this.element.addEventListener("transitionend",(()=>this.onTransitionEnd()),{once:!0}),window.requestAnimationFrame((()=>{this.element.classList.remove(this.eventClasses("in")[0]),this.element.classList.add(this.eventClasses("out")[0])}))):(this.resetClasses(),this.callback&&this.callback.apply(this.element),this.destruct())}))}onTransitionEnd(){this.eventClasses("active",this.trailTo?"":"out").forEach((e=>{this.element.classList.remove(e)})),this.callback&&this.callback.apply(this.element),null!==this.duration&&(this.element.style.transitionDuration=null),this.destruct()}cancel(){this.element.removeEventListener("transitionend",(()=>this.onTransitionEnd),{once:!0}),this.resetClasses(),null!==this.duration&&(this.element.style.transitionDuration=null),this.destruct()}resetClasses(){this.eventClasses().forEach((e=>{this.element.classList.remove(e)}))}parseDuration(e){const t=/^([0-9]+(\.[0-9]+)?)(m?s)?$/.exec(e),s=Number(t[1]);return"sec"===("s"===t[3]?"sec":"msec")?1e3*s+"ms":`${Math.floor(s)}ms`}}},820:function(e,t,s){var a=s(270),i=s(281);class r extends i.Z{dependencies(){return["flash"]}listens(){return{ready:"ready",ajaxErrorMessage:"ajaxErrorMessage",ajaxFlashMessages:"ajaxFlashMessages"}}ready(){document.querySelectorAll('[data-control="flash-message"]').forEach((e=>{this.snowboard.flash(e.innerHTML,e.dataset.flashType,e.dataset.flashDuration),e.remove()}))}ajaxErrorMessage(e){return this.snowboard.flash(e,"error"),!1}ajaxFlashMessages(e){return Object.entries(e).forEach((e=>{const[t,s]=e;this.snowboard.flash(s,t)})),!1}}class n extends i.Z{construct(){this.errorBags=[]}listens(){return{ready:"ready",ajaxStart:"clearValidation",ajaxValidationErrors:"doValidation"}}ready(){this.collectErrorBags(document)}doValidation(e,t,s){if(s.element&&void 0===s.element.dataset.requestValidate)return null;if(!e)return null;return this.errorBags.filter((t=>t.form===e)).forEach((e=>{this.showErrorBag(e,t)})),!1}clearValidation(e,t){if(t.element&&void 0===t.element.dataset.requestValidate)return;if(!t.form)return;this.errorBags.filter((e=>e.form===t.form)).forEach((e=>{this.hideErrorBag(e)}))}collectErrorBags(e){e.querySelectorAll("[data-validate-error], [data-validate-for]").forEach((e=>{const t=e.closest("form[data-request-validate]");if(!t)return void e.parentNode.removeChild(e);let s=null;e.matches("[data-validate-error]")&&(s=e.querySelector("[data-message]"));const a=document.createComment(""),i={element:e,form:t,validateFor:e.dataset.validateFor?e.dataset.validateFor.split(/\s*,\s*/):"*",placeholder:a,messageListElement:s?s.cloneNode(!0):null,messageListAnchor:null,customMessage:!!e.dataset.validateFor&&(""!==e.textContent||e.childNodes.length>0)};if(s){const e=document.createComment("");s.parentNode.replaceChild(e,s),i.messageListAnchor=e}e.parentNode.replaceChild(a,e),this.errorBags.push(i)}))}hideErrorBag(e){e.element.isConnected&&e.element.parentNode.replaceChild(e.placeholder,e.element)}showErrorBag(e,t){if(this.errorBagValidatesField(e,t))if(e.element.isConnected||e.placeholder.parentNode.replaceChild(e.element,e.placeholder),"*"!==e.validateFor){if(!e.customMessage){const s=Object.keys(t).filter((t=>e.validateFor.includes(t))).shift();[e.element.innerHTML]=t[s]}}else e.messageListElement?(e.element.querySelectorAll("[data-validation-message]").forEach((e=>{e.parentNode.removeChild(e)})),Object.entries(t).forEach((t=>{const[,s]=t;s.forEach((t=>{const s=e.messageListElement.cloneNode(!0);s.dataset.validationMessage="",s.innerHTML=t,e.messageListAnchor.after(s)}))}))):[e.element.innerHTML]=t[Object.keys(t).shift()]}errorBagValidatesField(e,t){return"*"===e.validateFor||Object.keys(t).filter((t=>e.validateFor.includes(t))).length>0}}var o,l=s(269),d=s(553),c=s(277),h=s(32),u=s(809),m=s(763);if(void 0===window.Snowboard)throw new Error("Snowboard must be loaded in order to use the extra plugins.");(o=window.Snowboard).addPlugin("assetLoader",u.Z),o.addPlugin("dataConfig",m.Z),o.addPlugin("extrasStyles",h.Z),o.addPlugin("transition",l.Z),o.addPlugin("flash",a.Z),o.addPlugin("flashListener",r),o.addPlugin("formValidation",n),o.addPlugin("attachLoading",d.Z),o.addPlugin("stripeLoader",c.Z)}},function(e){var t;t=820,e(e.s=t)}]); \ No newline at end of file +"use strict";(self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[]).push([[459],{553:function(e,t,s){s.d(t,{Z:function(){return i}});var a=s(579);class i extends a.eG{dependencies(){return["request"]}listens(){return{ajaxStart:"ajaxStart",ajaxDone:"ajaxDone"}}ajaxStart(e,t){if(t.element)if("FORM"===t.element.tagName){const e=t.element.querySelectorAll("[data-attach-loading]");e.length>0&&e.forEach((e=>{e.classList.add(this.getLoadingClass(e))}))}else void 0!==t.element.dataset.attachLoading&&t.element.classList.add(this.getLoadingClass(t.element))}ajaxDone(e,t){if(t.element)if("FORM"===t.element.tagName){const e=t.element.querySelectorAll("[data-attach-loading]");e.length>0&&e.forEach((e=>{e.classList.remove(this.getLoadingClass(e))}))}else void 0!==t.element.dataset.attachLoading&&t.element.classList.remove(this.getLoadingClass(t.element))}getLoadingClass(e){return void 0!==e.dataset.attachLoading&&""!==e.dataset.attachLoading?e.dataset.attachLoading:"wn-loading"}}},270:function(e,t,s){s.d(t,{Z:function(){return i}});var a=s(579);class i extends a.NG{construct(e,t,s){if(this.message=e,this.type=t||"default",this.duration=Number(s||7),this.duration<0)throw new Error("Flash duration must be a positive number, or zero");this.clear(),this.timer=null,this.flashTimer=null,this.create()}dependencies(){return["transition"]}destruct(){null!==this.timer&&window.clearTimeout(this.timer),this.flashTimer&&this.flashTimer.remove(),this.flash&&(this.flash.remove(),this.flash=null,this.flashTimer=null),super.destruct()}create(){this.snowboard.globalEvent("flash.create",this),this.flash=document.createElement("DIV"),this.flash.innerHTML=this.message,this.flash.classList.add("flash-message",this.type),this.flash.removeAttribute("data-control"),this.flash.addEventListener("click",(()=>this.remove())),this.flash.addEventListener("mouseover",(()=>this.stopTimer())),this.flash.addEventListener("mouseout",(()=>this.startTimer())),this.duration>0?(this.flashTimer=document.createElement("DIV"),this.flashTimer.classList.add("flash-timer"),this.flash.appendChild(this.flashTimer)):this.flash.classList.add("no-timer"),document.body.appendChild(this.flash),this.snowboard.transition(this.flash,"show",(()=>{this.startTimer()}))}remove(){this.snowboard.globalEvent("flash.remove",this),this.stopTimer(),this.snowboard.transition(this.flash,"hide",(()=>{this.flash.remove(),this.flash=null,this.destruct()}))}clear(){document.querySelectorAll("body > div.flash-message").forEach((e=>e.remove()))}startTimer(){0!==this.duration&&(this.timerTrans=this.snowboard.transition(this.flashTimer,"timeout",null,`${this.duration}.0s`,!0),this.timer=window.setTimeout((()=>this.remove()),1e3*this.duration))}stopTimer(){this.timerTrans&&this.timerTrans.cancel(),this.timer&&window.clearTimeout(this.timer)}}},277:function(e,t,s){s.d(t,{Z:function(){return i}});var a=s(579);class i extends a.eG{dependencies(){return["request"]}listens(){return{ready:"ready",ajaxStart:"ajaxStart"}}ready(){this.counter=0,this.createStripe()}ajaxStart(e,t){!1!==t.options.stripe&&(this.show(),e.then((()=>{this.hide()})).catch((()=>{this.hide()})))}createStripe(){this.indicator=document.createElement("DIV"),this.stripe=document.createElement("DIV"),this.stripeLoaded=document.createElement("DIV"),this.indicator.classList.add("stripe-loading-indicator","loaded"),this.stripe.classList.add("stripe"),this.stripeLoaded.classList.add("stripe-loaded"),this.indicator.appendChild(this.stripe),this.indicator.appendChild(this.stripeLoaded),document.body.appendChild(this.indicator)}show(){this.counter+=1;const e=this.stripe.cloneNode(!0);this.indicator.appendChild(e),this.stripe.remove(),this.stripe=e,this.counter>1||(this.indicator.classList.remove("loaded"),document.body.classList.add("wn-loading"))}hide(e){this.counter-=1,!0===e&&(this.counter=0),this.counter<=0&&(this.indicator.classList.add("loaded"),document.body.classList.remove("wn-loading"))}}},32:function(e,t,s){s.d(t,{Z:function(){return i}});var a=s(579);class i extends a.eG{listens(){return{ready:"ready"}}ready(){let e=!1;if(document.querySelectorAll('link[rel="stylesheet"]').forEach((t=>{t.href.endsWith("/modules/system/assets/css/snowboard.extras.css")&&(e=!0)})),!e){const e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("href",this.snowboard.url().asset("/modules/system/assets/css/snowboard.extras.css")),document.head.appendChild(e)}}}},269:function(e,t,s){s.d(t,{Z:function(){return i}});var a=s(579);class i extends a.NG{construct(e,t,s,a,i){if(e instanceof HTMLElement==!1)throw new Error("A HTMLElement must be provided for transitioning");if(this.element=e,"string"!=typeof t)throw new Error("Transition name must be specified as a string");if(this.transition=t,s&&"function"!=typeof s)throw new Error("Callback must be a valid function");this.callback=s,this.duration=a?this.parseDuration(a):null,this.trailTo=!0===i,this.doTransition()}eventClasses(){for(var e=arguments.length,t=new Array(e),s=0;s{const[s,a]=e;-1!==t.indexOf(s)&&i.push(a)})),i}doTransition(){null!==this.duration&&(this.element.style.transitionDuration=this.duration),this.resetClasses(),this.eventClasses("in","active").forEach((e=>{this.element.classList.add(e)})),window.requestAnimationFrame((()=>{"0s"!==window.getComputedStyle(this.element)["transition-duration"]?(this.element.addEventListener("transitionend",(()=>this.onTransitionEnd()),{once:!0}),window.requestAnimationFrame((()=>{this.element.classList.remove(this.eventClasses("in")[0]),this.element.classList.add(this.eventClasses("out")[0])}))):(this.resetClasses(),this.callback&&this.callback.apply(this.element),this.destruct())}))}onTransitionEnd(){this.eventClasses("active",this.trailTo?"":"out").forEach((e=>{this.element.classList.remove(e)})),this.callback&&this.callback.apply(this.element),null!==this.duration&&(this.element.style.transitionDuration=null),this.destruct()}cancel(){this.element.removeEventListener("transitionend",(()=>this.onTransitionEnd),{once:!0}),this.resetClasses(),null!==this.duration&&(this.element.style.transitionDuration=null),this.destruct()}resetClasses(){this.eventClasses().forEach((e=>{this.element.classList.remove(e)}))}parseDuration(e){const t=/^([0-9]+(\.[0-9]+)?)(m?s)?$/.exec(e),s=Number(t[1]);return"sec"===("s"===t[3]?"sec":"msec")?1e3*s+"ms":`${Math.floor(s)}ms`}}},820:function(e,t,s){var a=s(270),i=s(579);class r extends i.eG{dependencies(){return["flash"]}listens(){return{ready:"ready",ajaxErrorMessage:"ajaxErrorMessage",ajaxFlashMessages:"ajaxFlashMessages"}}ready(){document.querySelectorAll('[data-control="flash-message"]').forEach((e=>{this.snowboard.flash(e.innerHTML,e.dataset.flashType,e.dataset.flashDuration),e.remove()}))}ajaxErrorMessage(e){return this.snowboard.flash(e,"error"),!1}ajaxFlashMessages(e){return Object.entries(e).forEach((e=>{const[t,s]=e;this.snowboard.flash(s,t)})),!1}}class n extends i.eG{construct(){this.errorBags=[]}listens(){return{ready:"ready",ajaxStart:"clearValidation",ajaxValidationErrors:"doValidation"}}ready(){this.collectErrorBags(document)}doValidation(e,t,s){if(s.element&&void 0===s.element.dataset.requestValidate)return null;if(!e)return null;return this.errorBags.filter((t=>t.form===e)).forEach((e=>{this.showErrorBag(e,t)})),!1}clearValidation(e,t){if(t.element&&void 0===t.element.dataset.requestValidate)return;if(!t.form)return;this.errorBags.filter((e=>e.form===t.form)).forEach((e=>{this.hideErrorBag(e)}))}collectErrorBags(e){e.querySelectorAll("[data-validate-error], [data-validate-for]").forEach((e=>{const t=e.closest("form[data-request-validate]");if(!t)return void e.parentNode.removeChild(e);let s=null;e.matches("[data-validate-error]")&&(s=e.querySelector("[data-message]"));const a=document.createComment(""),i={element:e,form:t,validateFor:e.dataset.validateFor?e.dataset.validateFor.split(/\s*,\s*/):"*",placeholder:a,messageListElement:s?s.cloneNode(!0):null,messageListAnchor:null,customMessage:!!e.dataset.validateFor&&(""!==e.textContent||e.childNodes.length>0)};if(s){const e=document.createComment("");s.parentNode.replaceChild(e,s),i.messageListAnchor=e}e.parentNode.replaceChild(a,e),this.errorBags.push(i)}))}hideErrorBag(e){e.element.isConnected&&e.element.parentNode.replaceChild(e.placeholder,e.element)}showErrorBag(e,t){if(this.errorBagValidatesField(e,t))if(e.element.isConnected||e.placeholder.parentNode.replaceChild(e.element,e.placeholder),"*"!==e.validateFor){if(!e.customMessage){const s=Object.keys(t).filter((t=>e.validateFor.includes(t))).shift();[e.element.innerHTML]=t[s]}}else e.messageListElement?(e.element.querySelectorAll("[data-validation-message]").forEach((e=>{e.parentNode.removeChild(e)})),Object.entries(t).forEach((t=>{const[,s]=t;s.forEach((t=>{const s=e.messageListElement.cloneNode(!0);s.dataset.validationMessage="",s.innerHTML=t,e.messageListAnchor.after(s)}))}))):[e.element.innerHTML]=t[Object.keys(t).shift()]}errorBagValidatesField(e,t){return"*"===e.validateFor||Object.keys(t).filter((t=>e.validateFor.includes(t))).length>0}}var o,l=s(269),d=s(553),h=s(277),c=s(32);if(void 0===window.Snowboard)throw new Error("Snowboard must be loaded in order to use the extra plugins.");(o=window.Snowboard).addPlugin("extrasStyles",c.Z),o.addPlugin("transition",l.Z),o.addPlugin("flash",a.Z),o.addPlugin("flashListener",r),o.addPlugin("formValidation",n),o.addPlugin("attachLoading",d.Z),o.addPlugin("stripeLoader",h.Z)}},function(e){e.O(0,[109],(function(){return t=820,e(e.s=t);var t}));e.O()}]); \ No newline at end of file diff --git a/modules/system/assets/js/snowboard/build/snowboard.request.js b/modules/system/assets/js/snowboard/build/snowboard.request.js index 8522d2a05..0f62731ad 100644 --- a/modules/system/assets/js/snowboard/build/snowboard.request.js +++ b/modules/system/assets/js/snowboard/build/snowboard.request.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[]).push([[988],{579:function(e,t,s){s.d(t,{Z:function(){return r}});class r{constructor(e){this.snowboard=e}construct(){}dependencies(){return[]}listens(){return{}}destruct(){this.detach(),delete this.snowboard}destructor(){this.destruct()}}},640:function(e,t,s){var r=s(579);function o(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,r)}return s}function n(e){for(var t=1;t{e&&this.doAjax().then((e=>{if(e.cancelled)return this.cancelled=!0,void this.complete();this.responseData=e,this.processUpdate(e).then((()=>{!1===e.X_WINTER_SUCCESS?this.processError(e):this.processResponse(e)}))}),(e=>{this.responseError=e,this.processError(e)}))})):this.doAjax().then((e=>{if(e.cancelled)return this.cancelled=!0,void this.complete();this.responseData=e,this.processUpdate(e).then((()=>{!1===e.X_WINTER_SUCCESS?this.processError(e):this.processResponse(e)}))}),(e=>{this.responseError=e,this.processError(e)})):this.cancelled=!0}else this.cancelled=!0}dependencies(){return["cookie","jsonParser"]}checkRequest(){if(this.element&&this.element instanceof Element==!1)throw new Error("The element provided must be an Element instance");if(void 0===this.handler)throw new Error("The AJAX handler name is not specified.");if(!this.isHandlerName(this.handler))throw new Error('Invalid AJAX handler name. The correct handler name format is: "onEvent".')}getFetch(){return this.fetchOptions=void 0!==this.options.fetchOptions&&"object"==typeof this.options.fetchOptions?this.options.fetchOptions:{method:"POST",headers:this.headers,body:this.data,redirect:"follow",mode:"same-origin"},this.snowboard.globalEvent("ajaxFetchOptions",this.fetchOptions,this),fetch(this.url,this.fetchOptions)}doClientValidation(){return!0!==this.options.browserValidate||!this.form||!1!==this.form.checkValidity()||(this.form.reportValidity(),!1)}doAjax(){if(!1===this.snowboard.globalEvent("ajaxBeforeSend",this))return Promise.resolve({cancelled:!0});const e=new Promise(((e,t)=>{this.getFetch().then((s=>{s.ok||406===s.status?s.headers.has("Content-Type")&&s.headers.get("Content-Type").includes("/json")?s.json().then((t=>{e(n(n({},t),{},{X_WINTER_SUCCESS:406!==s.status,X_WINTER_RESPONSE_CODE:s.status}))}),(e=>{t(this.renderError(`Unable to parse JSON response: ${e}`))})):s.text().then((t=>{e(t)}),(e=>{t(this.renderError(`Unable to process response: ${e}`))})):s.headers.has("Content-Type")&&s.headers.get("Content-Type").includes("/json")?s.json().then((e=>{e.message&&e.exception?t(this.renderError(e.message,e.exception,e.file,e.line,e.trace)):t(e)}),(e=>{t(this.renderError(`Unable to parse JSON response: ${e}`))})):s.text().then((e=>{t(this.renderError(e))}),(e=>{t(this.renderError(`Unable to process response: ${e}`))}))}),(e=>{t(this.renderError(`Unable to retrieve a response from the server: ${e}`))}))}));if(this.snowboard.globalEvent("ajaxStart",e,this),this.element){const t=new Event("ajaxPromise");t.promise=e,this.element.dispatchEvent(t)}return e}processUpdate(e){return new Promise(((t,s)=>{if("function"==typeof this.options.beforeUpdate&&!1===this.options.beforeUpdate.apply(this,[e]))return void t();const r={};if(Object.entries(e).forEach((e=>{const[t,s]=e;"X_WINTER"!==t.substr(0,8)&&(r[t]=s)})),0===Object.keys(r).length)return void(e.X_WINTER_ASSETS?this.processAssets(e.X_WINTER_ASSETS).then((()=>{t()}),(()=>{s()})):t());this.snowboard.globalPromiseEvent("ajaxBeforeUpdate",e,this).then((async()=>{e.X_WINTER_ASSETS&&await this.processAssets(e.X_WINTER_ASSETS),this.doUpdate(r).then((()=>{window.requestAnimationFrame((()=>t()))}),(()=>{s()}))}),(()=>{t()}))}))}doUpdate(e){return new Promise((t=>{const s=[];Object.entries(e).forEach((e=>{const[t,r]=e;let o=this.options.update&&this.options.update[t]?this.options.update[t]:t,n="replace";"@"===o.substr(0,1)?(n="append",o=o.substr(1)):"^"===o.substr(0,1)?(n="prepend",o=o.substr(1)):"#"!==o.substr(0,1)&&"."!==o.substr(0,1)&&(n="noop");const i=document.querySelectorAll(o);i.length>0&&i.forEach((e=>{switch(n){case"append":e.innerHTML+=r;break;case"prepend":e.innerHTML=r+e.innerHTML;break;case"noop":break;default:e.innerHTML=r}s.push(e),this.snowboard.globalEvent("ajaxUpdate",e,r,this);const t=new Event("ajaxUpdate");t.content=r,e.dispatchEvent(t)}))})),this.snowboard.globalEvent("ajaxUpdateComplete",s,this),t()}))}processResponse(e){if((!this.options.success||"function"!=typeof this.options.success||!1!==this.options.success(this.responseData,this))&&!1!==this.snowboard.globalEvent("ajaxSuccess",this.responseData,this)){if(this.element){const e=new Event("ajaxDone",{cancelable:!0});if(e.responseData=this.responseData,e.request=this,this.element.dispatchEvent(e),e.defaultPrevented)return}this.flash&&e.X_WINTER_FLASH_MESSAGES&&this.processFlashMessages(e.X_WINTER_FLASH_MESSAGES),this.redirect||e.X_WINTER_REDIRECT?this.processRedirect(this.redirect||e.X_WINTER_REDIRECT):this.complete()}}processError(e){if((!this.options.error||"function"!=typeof this.options.error||!1!==this.options.error(this.responseError,this))&&!1!==this.snowboard.globalEvent("ajaxError",this.responseError,this)){if(this.element){const e=new Event("ajaxFail",{cancelable:!0});if(e.responseError=this.responseError,e.request=this,this.element.dispatchEvent(e),e.defaultPrevented)return}if(e instanceof Error)this.processErrorMessage(e.message);else{let t=!1;e.X_WINTER_ERROR_FIELDS&&(t=this.processValidationErrors(e.X_WINTER_ERROR_FIELDS)),e.X_WINTER_ERROR_MESSAGE&&!t&&this.processErrorMessage(e.X_WINTER_ERROR_MESSAGE)}this.complete()}}processRedirect(e){"function"==typeof this.options.handleRedirectResponse&&!1===this.options.handleRedirectResponse.apply(this,[e])||!1!==this.snowboard.globalEvent("ajaxRedirect",e,this)&&(window.addEventListener("popstate",(()=>{if(this.element){const e=document.createEvent("CustomEvent");e.eventName="ajaxRedirected",this.element.dispatchEvent(e)}}),{once:!0}),window.location.assign(e))}processErrorMessage(e){"function"==typeof this.options.handleErrorMessage&&!1===this.options.handleErrorMessage.apply(this,[e])||!1!==this.snowboard.globalEvent("ajaxErrorMessage",e,this)&&window.alert(e)}processFlashMessages(e){"function"==typeof this.options.handleFlashMessages&&!1===this.options.handleFlashMessages.apply(this,[e])||this.snowboard.globalEvent("ajaxFlashMessages",e,this)}processValidationErrors(e){return"function"==typeof this.options.handleValidationErrors&&!1===this.options.handleValidationErrors.apply(this,[this.form,e])||!1===this.snowboard.globalEvent("ajaxValidationErrors",this.form,e,this)}processAssets(e){return this.snowboard.globalPromiseEvent("ajaxLoadAssets",e)}async doConfirm(){if("function"==typeof this.options.handleConfirmMessage)return!1!==this.options.handleConfirmMessage.apply(this,[this.confirm]);if(0===this.snowboard.listensToEvent("ajaxConfirmMessage").length)return window.confirm(this.confirm);const e=this.snowboard.globalPromiseEvent("ajaxConfirmMessage",this.confirm,this);try{if(await e)return!0}catch(e){return!1}return!1}complete(){if(this.options.complete&&"function"==typeof this.options.complete&&this.options.complete(this.responseData,this),this.snowboard.globalEvent("ajaxDone",this.responseData,this),this.element){const e=new Event("ajaxAlways");e.request=this,e.responseData=this.responseData,e.responseError=this.responseError,this.element.dispatchEvent(e)}this.destruct()}get form(){return this.options.form?"string"==typeof this.options.form?document.querySelector(this.options.form):this.options.form:this.element?"FORM"===this.element.tagName?this.element:this.element.closest("form"):null}get context(){return{handler:this.handler,options:this.options}}get headers(){const e={"X-Requested-With":"XMLHttpRequest","X-WINTER-REQUEST-HANDLER":this.handler,"X-WINTER-REQUEST-PARTIALS":this.extractPartials(this.options.update||[])};return this.flash&&(e["X-WINTER-REQUEST-FLASH"]=1),this.xsrfToken&&(e["X-XSRF-TOKEN"]=this.xsrfToken),e}get loading(){return this.options.loading||!1}get url(){return this.options.url||window.location.href}get redirect(){return this.options.redirect&&this.options.redirect.length?this.options.redirect:null}get flash(){return this.options.flash||!1}get files(){return!0===this.options.files&&(void 0!==FormData||(this.snowboard.debug("This browser does not support file uploads"),!1))}get xsrfToken(){return this.snowboard.cookie().get("XSRF-TOKEN")}get data(){const e="object"==typeof this.options.data?this.options.data:{},t=new FormData(this.form||void 0);return Object.keys(e).length>0&&Object.entries(e).forEach((e=>{const[s,r]=e;t.append(s,r)})),t}get confirm(){return this.options.confirm||!1}extractPartials(e){return Object.keys(e).join("&")}renderError(e,t,s,r,o){const n=new Error(e);return n.exception=t||null,n.file=s||null,n.line=r||null,n.trace=o||[],n}isHandlerName(e){return/^(?:\w+:{2})?on[A-Z0-9]/.test(e)}}if(void 0===window.Snowboard)throw new Error("Snowboard must be loaded in order to use the Javascript AJAX request feature.");window.Snowboard.addPlugin("request",a)}},function(e){var t;t=640,e(e.s=t)}]); \ No newline at end of file +"use strict";(self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[]).push([[988],{640:function(e,t,s){var r=s(579);function o(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,r)}return s}function n(e){for(var t=1;t{e&&this.doAjax().then((e=>{if(e.cancelled)return this.cancelled=!0,void this.complete();this.responseData=e,this.processUpdate(e).then((()=>{!1===e.X_WINTER_SUCCESS?this.processError(e):this.processResponse(e)}))}),(e=>{this.responseError=e,this.processError(e)}))})):this.doAjax().then((e=>{if(e.cancelled)return this.cancelled=!0,void this.complete();this.responseData=e,this.processUpdate(e).then((()=>{!1===e.X_WINTER_SUCCESS?this.processError(e):this.processResponse(e)}))}),(e=>{this.responseError=e,this.processError(e)})):this.cancelled=!0}else this.cancelled=!0}dependencies(){return["cookie","jsonParser"]}checkRequest(){if(this.element&&this.element instanceof Element==!1)throw new Error("The element provided must be an Element instance");if(void 0===this.handler)throw new Error("The AJAX handler name is not specified.");if(!this.isHandlerName(this.handler))throw new Error('Invalid AJAX handler name. The correct handler name format is: "onEvent".')}getFetch(){return this.fetchOptions=void 0!==this.options.fetchOptions&&"object"==typeof this.options.fetchOptions?this.options.fetchOptions:{method:"POST",headers:this.headers,body:this.data,redirect:"follow",mode:"same-origin"},this.snowboard.globalEvent("ajaxFetchOptions",this.fetchOptions,this),fetch(this.url,this.fetchOptions)}doClientValidation(){return!0!==this.options.browserValidate||!this.form||!1!==this.form.checkValidity()||(this.form.reportValidity(),!1)}doAjax(){if(!1===this.snowboard.globalEvent("ajaxBeforeSend",this))return Promise.resolve({cancelled:!0});const e=new Promise(((e,t)=>{this.getFetch().then((s=>{s.ok||406===s.status?s.headers.has("Content-Type")&&s.headers.get("Content-Type").includes("/json")?s.json().then((t=>{e(n(n({},t),{},{X_WINTER_SUCCESS:406!==s.status,X_WINTER_RESPONSE_CODE:s.status}))}),(e=>{t(this.renderError(`Unable to parse JSON response: ${e}`))})):s.text().then((t=>{e(t)}),(e=>{t(this.renderError(`Unable to process response: ${e}`))})):s.headers.has("Content-Type")&&s.headers.get("Content-Type").includes("/json")?s.json().then((e=>{e.message&&e.exception?t(this.renderError(e.message,e.exception,e.file,e.line,e.trace)):t(e)}),(e=>{t(this.renderError(`Unable to parse JSON response: ${e}`))})):s.text().then((e=>{t(this.renderError(e))}),(e=>{t(this.renderError(`Unable to process response: ${e}`))}))}),(e=>{t(this.renderError(`Unable to retrieve a response from the server: ${e}`))}))}));if(this.snowboard.globalEvent("ajaxStart",e,this),this.element){const t=new Event("ajaxPromise");t.promise=e,this.element.dispatchEvent(t)}return e}processUpdate(e){return new Promise(((t,s)=>{if("function"==typeof this.options.beforeUpdate&&!1===this.options.beforeUpdate.apply(this,[e]))return void t();const r={};if(Object.entries(e).forEach((e=>{const[t,s]=e;"X_WINTER"!==t.substr(0,8)&&(r[t]=s)})),0===Object.keys(r).length)return void(e.X_WINTER_ASSETS?this.processAssets(e.X_WINTER_ASSETS).then((()=>{t()}),(()=>{s()})):t());this.snowboard.globalPromiseEvent("ajaxBeforeUpdate",e,this).then((async()=>{e.X_WINTER_ASSETS&&await this.processAssets(e.X_WINTER_ASSETS),this.doUpdate(r).then((()=>{window.requestAnimationFrame((()=>t()))}),(()=>{s()}))}),(()=>{t()}))}))}doUpdate(e){return new Promise((t=>{const s=[];Object.entries(e).forEach((e=>{const[t,r]=e;let o=this.options.update&&this.options.update[t]?this.options.update[t]:t,n="replace";"@"===o.substr(0,1)?(n="append",o=o.substr(1)):"^"===o.substr(0,1)?(n="prepend",o=o.substr(1)):"#"!==o.substr(0,1)&&"."!==o.substr(0,1)&&(n="noop");const i=document.querySelectorAll(o);i.length>0&&i.forEach((e=>{switch(n){case"append":e.innerHTML+=r;break;case"prepend":e.innerHTML=r+e.innerHTML;break;case"noop":break;default:e.innerHTML=r}s.push(e),this.snowboard.globalEvent("ajaxUpdate",e,r,this);const t=new Event("ajaxUpdate");t.content=r,e.dispatchEvent(t)}))})),this.snowboard.globalEvent("ajaxUpdateComplete",s,this),t()}))}processResponse(e){if((!this.options.success||"function"!=typeof this.options.success||!1!==this.options.success(this.responseData,this))&&!1!==this.snowboard.globalEvent("ajaxSuccess",this.responseData,this)){if(this.element){const e=new Event("ajaxDone",{cancelable:!0});if(e.responseData=this.responseData,e.request=this,this.element.dispatchEvent(e),e.defaultPrevented)return}this.flash&&e.X_WINTER_FLASH_MESSAGES&&this.processFlashMessages(e.X_WINTER_FLASH_MESSAGES),this.redirect||e.X_WINTER_REDIRECT?this.processRedirect(this.redirect||e.X_WINTER_REDIRECT):this.complete()}}processError(e){if((!this.options.error||"function"!=typeof this.options.error||!1!==this.options.error(this.responseError,this))&&!1!==this.snowboard.globalEvent("ajaxError",this.responseError,this)){if(this.element){const e=new Event("ajaxFail",{cancelable:!0});if(e.responseError=this.responseError,e.request=this,this.element.dispatchEvent(e),e.defaultPrevented)return}if(e instanceof Error)this.processErrorMessage(e.message);else{let t=!1;e.X_WINTER_ERROR_FIELDS&&(t=this.processValidationErrors(e.X_WINTER_ERROR_FIELDS)),e.X_WINTER_ERROR_MESSAGE&&!t&&this.processErrorMessage(e.X_WINTER_ERROR_MESSAGE)}this.complete()}}processRedirect(e){"function"==typeof this.options.handleRedirectResponse&&!1===this.options.handleRedirectResponse.apply(this,[e])||!1!==this.snowboard.globalEvent("ajaxRedirect",e,this)&&(window.addEventListener("popstate",(()=>{if(this.element){const e=document.createEvent("CustomEvent");e.eventName="ajaxRedirected",this.element.dispatchEvent(e)}}),{once:!0}),window.location.assign(e))}processErrorMessage(e){"function"==typeof this.options.handleErrorMessage&&!1===this.options.handleErrorMessage.apply(this,[e])||!1!==this.snowboard.globalEvent("ajaxErrorMessage",e,this)&&window.alert(e)}processFlashMessages(e){"function"==typeof this.options.handleFlashMessages&&!1===this.options.handleFlashMessages.apply(this,[e])||this.snowboard.globalEvent("ajaxFlashMessages",e,this)}processValidationErrors(e){return"function"==typeof this.options.handleValidationErrors&&!1===this.options.handleValidationErrors.apply(this,[this.form,e])||!1===this.snowboard.globalEvent("ajaxValidationErrors",this.form,e,this)}processAssets(e){return this.snowboard.globalPromiseEvent("ajaxLoadAssets",e)}async doConfirm(){if("function"==typeof this.options.handleConfirmMessage)return!1!==this.options.handleConfirmMessage.apply(this,[this.confirm]);if(0===this.snowboard.listensToEvent("ajaxConfirmMessage").length)return window.confirm(this.confirm);const e=this.snowboard.globalPromiseEvent("ajaxConfirmMessage",this.confirm,this);try{if(await e)return!0}catch(e){return!1}return!1}complete(){if(this.options.complete&&"function"==typeof this.options.complete&&this.options.complete(this.responseData,this),this.snowboard.globalEvent("ajaxDone",this.responseData,this),this.element){const e=new Event("ajaxAlways");e.request=this,e.responseData=this.responseData,e.responseError=this.responseError,this.element.dispatchEvent(e)}this.destruct()}get form(){return this.options.form?"string"==typeof this.options.form?document.querySelector(this.options.form):this.options.form:this.element?"FORM"===this.element.tagName?this.element:this.element.closest("form"):null}get context(){return{handler:this.handler,options:this.options}}get headers(){const e={"X-Requested-With":"XMLHttpRequest","X-WINTER-REQUEST-HANDLER":this.handler,"X-WINTER-REQUEST-PARTIALS":this.extractPartials(this.options.update||[])};return this.flash&&(e["X-WINTER-REQUEST-FLASH"]=1),this.xsrfToken&&(e["X-XSRF-TOKEN"]=this.xsrfToken),e}get loading(){return this.options.loading||!1}get url(){return this.options.url||window.location.href}get redirect(){return this.options.redirect&&this.options.redirect.length?this.options.redirect:null}get flash(){return this.options.flash||!1}get files(){return!0===this.options.files&&(void 0!==FormData||(this.snowboard.debug("This browser does not support file uploads"),!1))}get xsrfToken(){return this.snowboard.cookie().get("XSRF-TOKEN")}get data(){const e="object"==typeof this.options.data?this.options.data:{},t=new FormData(this.form||void 0);return Object.keys(e).length>0&&Object.entries(e).forEach((e=>{const[s,r]=e;t.append(s,r)})),t}get confirm(){return this.options.confirm||!1}extractPartials(e){return Object.keys(e).join("&")}renderError(e,t,s,r,o){const n=new Error(e);return n.exception=t||null,n.file=s||null,n.line=r||null,n.trace=o||[],n}isHandlerName(e){return/^(?:\w+:{2})?on[A-Z0-9]/.test(e)}}if(void 0===window.Snowboard)throw new Error("Snowboard must be loaded in order to use the Javascript AJAX request feature.");window.Snowboard.addPlugin("request",a)}},function(e){e.O(0,[109],(function(){return t=640,e(e.s=t);var t}));e.O()}]); \ No newline at end of file diff --git a/modules/system/assets/js/snowboard/build/snowboard.vendor.js b/modules/system/assets/js/snowboard/build/snowboard.vendor.js index 7038746c3..4724dc97c 100644 --- a/modules/system/assets/js/snowboard/build/snowboard.vendor.js +++ b/modules/system/assets/js/snowboard/build/snowboard.vendor.js @@ -1,3 +1,2 @@ -"use strict";(self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[]).push([[109],{805:function(e,t,n){ -/*! js-cookie v3.0.5 | MIT */ -function r(e){for(var t=1;tReflect.get(u,"plugins")[t].getInstance(...e)}return Reflect.get(u,e,t)},has(u,e){if("string"==typeof e){const t=e.toLowerCase();if(u.hasPlugin(t))return!0}return Reflect.has(u,e)}};class D{constructor(u){this.snowboard=u}construct(){}dependencies(){return[]}listens(){return{}}destruct(){}destructor(){this.destruct(),this.detach(),delete this.snowboard}}class n extends D{}var i={get(u,e,t){if("string"==typeof e){const t=e.toLowerCase();if(["attachAbstracts","loadUtilities","initialise","initialiseSingletons"].includes(e))throw new Error(`You cannot use the "${e}" Snowboard method within a plugin.`);if(u.hasPlugin(t))return(...e)=>Reflect.get(u,"plugins")[t].getInstance(...e)}return Reflect.get(u,e,t)},has(u,e){if("string"==typeof e){const t=e.toLowerCase();if(["attachAbstracts","loadUtilities","initialise","initialiseSingletons"].includes(e))return!1;if(u.hasPlugin(t))return!0}return Reflect.has(u,e)}};class s{constructor(u,e,t){this.name=u,this.snowboard=new Proxy(e,i),this.instance=t,Object.freeze(this.instance),this.instances=[],this.singleton={initialised:!1},Object.seal(this.singleton),this.mocks={},this.originalFunctions={},Object.freeze(s.prototype),Object.freeze(this)}hasMethod(u){return"function"==typeof this.instance.prototype[u]}callMethod(...u){const e=u,t=e.shift();return this.instance.prototype[t](e)}getInstance(...u){if(!this.dependenciesFulfilled()){const u=this.getDependencies().filter((u=>!this.snowboard.getPluginNames().includes(u)));throw new Error(`The "${this.name}" plugin requires the following plugins: ${u.join(", ")}`)}if(this.isSingleton())return 0===this.instances.length&&this.initialiseSingleton(...u),Object.keys(this.mocks).length>0&&(Object.entries(this.originalFunctions).forEach((u=>{const[e,t]=u;this.instances[0][e]=t})),Object.entries(this.mocks).forEach((u=>{const[e,t]=u;this.instances[0][e]=(...u)=>t(this.instances[0],...u)}))),this.instances[0];const e=new this.instance(this.snowboard,...u);return Object.keys(this.mocks).length>0&&(Object.entries(this.originalFunctions).forEach((u=>{const[t,r]=u;e[t]=r})),Object.entries(this.mocks).forEach((u=>{const[t,r]=u;e[t]=(...u)=>r(e,...u)}))),e.detach=()=>this.instances.splice(this.instances.indexOf(e),1),e.construct(...u),this.loadTraits(e),this.instances.push(e),e}getInstances(){return this.instances}isSingleton(){return this.instance.prototype instanceof n==!0}isInitialised(){return!this.isSingleton()||this.singleton.initialised}initialiseSingleton(...u){if(!this.isSingleton())return;const e=new this.instance(this.snowboard,...u);e.detach=()=>this.instances.splice(this.instances.indexOf(e),1),e.construct(...u),this.loadTraits(e),this.instances.push(e),this.singleton.initialised=!0}getDependencies(){return this.instance.prototype.dependencies().map((u=>u.toLowerCase()))}dependenciesFulfilled(){const u=this.getDependencies();let e=!0;return u.forEach((u=>{this.snowboard.hasPlugin(u)||(e=!1)})),e}mock(u,e){if(!this.instance.prototype[u])throw new Error(`Function "${u}" does not exist and cannot be mocked`);this.mocks[u]=e,this.originalFunctions[u]=this.instance.prototype[u],this.isSingleton()&&0===this.instances.length&&(this.initialiseSingleton(),this.instances[0][u]=(...u)=>e(this,...u))}unmock(u){this.mocks[u]&&(this.isSingleton()&&(this.instances[0][u]=this.originalFunctions[u]),delete this.mocks[u],delete this.originalFunctions[u])}loadTraits(u){const e=[];let t=u;for(;"Object"!==t.constructor.name;){if(t.traits&&"function"==typeof t.traits){const u=t.traits();Array.isArray(u)?u.forEach((u=>{e.includes(u)||e.push({trait:u,config:{}})})):"object"==typeof u&&Object.entries(u).forEach((([u,t])=>{e.includes(u)||e.push({trait:u,config:t})}))}t=Object.getPrototypeOf(t)}e.forEach((e=>{if(!1===this.snowboard.hasTrait(e.trait))return void this.warning(`Trait "${e.trait}" does not exist and cannot be applied to "${this.name}"`);const t=this.snowboard.getTrait(e.trait),r=new t,D=Object.keys(r).reduce(((u,e)=>(u[e]=Object.getOwnPropertyDescriptor(r,e),u)),{});Object.getOwnPropertyNames(t.prototype).forEach((u=>{if(["constructor","construct","destruct","destructor"].includes(u))return;const e=Object.getOwnPropertyDescriptor(t.prototype,u);D[u]=e}));const n=Object.keys(D).filter((e=>void 0===u[e])).reduce(((u,e)=>(u[e]=D[e],u)),{});Object.defineProperties(u,n),r.construct&&r.construct.call(u,e.config)}))}}class o{constructor(){this.instanceConfig={},this.acceptedConfigs={}}construct(u){if(this.element instanceof HTMLElement==!1)throw new Error("Data configuration can only be extracted from HTML elements");Object.defineProperty(this,"acceptAllDataConfigs",{enumerable:!0,writable:!1,configurable:!1,value:u.acceptAllDataConfigs||!1}),this.refreshConfig()}defaults(){return{}}getConfig(u){return void 0===u?this.instanceConfig:void 0!==this.instanceConfig[u]?this.instanceConfig[u]:void 0}setConfig(u,e,t){if(void 0===u)throw new Error("You must provide a configuration key to set");this.instanceConfig[u]=e,!0===t&&(this.element.dataset[u]=e)}refreshConfig(){this.acceptedConfigs=this.getAcceptedConfigs(),this.instanceConfig=this.processConfig()}getAcceptedConfigs(){return void 0!==this.acceptAllDataConfigs&&!0===this.acceptAllDataConfigs||"object"==typeof this.defaults()&&Object.keys(this.defaults())}getDefaultConfig(){return"object"==typeof this.defaults()?this.defaults():{}}processConfig(){const u=this.getDefaultConfig();if(!1===this.acceptedConfigs)return u;for(const e in this.element.dataset)(!0===this.acceptedConfigs||this.acceptedConfigs.includes(e))&&(u[e]=this.coerceConfigValue(this.element.dataset[e],u[e]));return u}coerceConfigValue(u,e){const t=String(u);if("null"===t)return null;if("undefined"!==t){if(t.startsWith("base64:")){const u=t.replace(/^base64:/,""),e=atob(u);return this.coerceConfigValue(e)}if(["true","yes"].includes(t.toLowerCase()))return!0;if(["false","no"].includes(t.toLowerCase()))return!1;if(/^[-+]?[0-9]+(\.[0-9]+)?$/.test(t))return void 0!==e&&"boolean"==typeof e&&["0","1"].includes(t)?1===Number(t):Number(t);try{return this.snowboard.jsonParser().parse(t,!0)}catch(u){return""===t||t}}}}class a{constructor(){this.events=[],this.localEventsOnly=!1}construct(){if(!this.localEventsOnly&&!this.eventPrefix)throw new Error("Event prefix is required if global events are enabled.")}on(u,e){this.events.push({event:u,callback:e})}off(u,e){this.events=this.events.filter((t=>t.event!==u||t.callback!==e))}once(u,e){const t=this.events.push({event:u,callback:(...u)=>{e(...u),this.events.splice(t-1,1)}})}triggerEvent(u,...e){const t=this.events.filter((e=>e.event===u));if(0===t.length)return;let r=!1;t.forEach((u=>{r||!1===u.callback(...e)&&(r=!0)})),r||this.localEventsOnly||this.snowboard.globalEvent(`${this.eventPrefix}.${u}`,...e)}triggerPromiseEvent(u,...e){const t=this.events.filter((e=>e.event===u));if(0===t.length)return;const r=t.filter((u=>null!==u),t.map((u=>u.callback(...e))));Promise.all(r).then((()=>{this.localEventsOnly||this.snowboard.globalPromiseEvent(`${this.eventPrefix}.${u}`,...e)}),(()=>{}))}}class c extends n{listens(){return{ajaxLoadAssets:"load"}}dependencies(){return["url"]}load(u){const e=[];return u.js&&("string"==typeof u.js?e.push(this.loadScript(u.js)):Array.isArray(u.js)&&u.js.length>0&&u.js.forEach((u=>{e.push(this.loadScript(u))}))),u.css&&("string"==typeof u.css?e.push(this.loadStyle(u.css)):Array.isArray(u.css)&&u.css.length>0&&u.css.forEach((u=>{e.push(this.loadStyle(u))}))),u.img&&("string"==typeof u.img?e.push(this.loadImage(u.img)):Array.isArray(u.img)&&u.img.length>0&&u.img.forEach((u=>{e.push(this.loadImage(u))}))),Promise.all(e)}loadScript(u){return new Promise(((e,t)=>{const r=this.snowboard.url().asset(u);if(document.querySelector(`script[src="${r}"]`))return void e();const D=document.createElement("script");D.setAttribute("type","text/javascript"),D.setAttribute("src",r),D.addEventListener("load",(()=>{this.snowboard.globalEvent("assetLoader.loaded","script",u,D),e()})),D.addEventListener("error",(()=>{this.snowboard.globalEvent("assetLoader.error","script",u,D),t(new Error(`Unable to load script file: "${u}"`))})),document.body.append(D)}))}loadStyle(u){return new Promise(((e,t)=>{const r=this.snowboard.url().asset(u);if(document.querySelector(`link[rel="stylesheet"][href="${r}"]`))return void e();const D=document.createElement("link");D.setAttribute("rel","stylesheet"),D.setAttribute("href",r),D.addEventListener("load",(()=>{this.snowboard.globalEvent("assetLoader.loaded","style",u,D),e()})),D.addEventListener("error",(()=>{this.snowboard.globalEvent("assetLoader.error","style",u,D),t(new Error(`Unable to load stylesheet file: "${u}"`))})),document.head.append(D)}))}loadImage(u){return new Promise(((e,t)=>{const r=this.snowboard.url().asset(u),D=new Image;D.addEventListener("load",(()=>{this.snowboard.globalEvent("assetLoader.loaded","image",u,D),e()})),D.addEventListener("error",(()=>{this.snowboard.globalEvent("assetLoader.error","image",u,D),t(new Error(`Unable to load image file: "${u}"`))})),D.src=r}))}} +/*! js-cookie v3.0.5 | MIT */function l(u){for(var e=1;e{const[e,t]=u;void 0!==this.defaults[e]&&(this.defaults[e]=t)}))}getDefaults(){const u={};return Object.entries(this.defaults).forEach((e=>{const[t,r]=e;null!==this.defaults[t]&&(u[t]=r)})),u}get(u){if(void 0===u){const u=C.get();return Object.entries(u).forEach((e=>{const[t,r]=e;this.snowboard.globalEvent("cookie.get",t,r,(e=>{u[t]=e}))})),u}let e=C.get(u);return this.snowboard.globalEvent("cookie.get",u,e,(u=>{e=u})),e}set(u,e,t){let r=e;return this.snowboard.globalEvent("cookie.set",u,e,(u=>{r=u})),C.set(u,r,{...this.getDefaults(),...t})}remove(u,e){C.remove(u,{...this.getDefaults(),...e})}}var A={Space_Separator:/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,ID_Start:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\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\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\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\u0AF9\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-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\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-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\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\u2160-\u2188\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-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\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]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,ID_Continue:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\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\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/},E={isSpaceSeparator(u){return"string"==typeof u&&A.Space_Separator.test(u)},isIdStartChar(u){return"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||"$"===u||"_"===u||A.ID_Start.test(u))},isIdContinueChar(u){return"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||u>="0"&&u<="9"||"$"===u||"_"===u||"‌"===u||"‍"===u||A.ID_Continue.test(u))},isDigit(u){return"string"==typeof u&&/[0-9]/.test(u)},isHexDigit(u){return"string"==typeof u&&/[0-9A-Fa-f]/.test(u)}};let h,d,f,B,g,p,b,m,v;function y(u,e,t){const r=u[e];if(null!=r&&"object"==typeof r)if(Array.isArray(r))for(let u=0;u0;){const e=O();if(!E.isHexDigit(e))throw M(_());u+=_()}return String.fromCodePoint(parseInt(u,16))}const I={start(){if("eof"===b.type)throw R();z()},beforePropertyName(){switch(b.type){case"identifier":case"string":return m=b.value,void(d="afterPropertyName");case"punctuator":return void T();case"eof":throw R()}},afterPropertyName(){if("eof"===b.type)throw R();d="beforePropertyValue"},beforePropertyValue(){if("eof"===b.type)throw R();z()},beforeArrayValue(){if("eof"===b.type)throw R();"punctuator"!==b.type||"]"!==b.value?z():T()},afterPropertyValue(){if("eof"===b.type)throw R();switch(b.value){case",":return void(d="beforePropertyName");case"}":T()}},afterArrayValue(){if("eof"===b.type)throw R();switch(b.value){case",":return void(d="beforeArrayValue");case"]":T()}},end(){}};function z(){let u;switch(b.type){case"punctuator":switch(b.value){case"{":u={};break;case"[":u=[]}break;case"null":case"boolean":case"numeric":case"string":u=b.value}if(void 0===v)v=u;else{const e=f[f.length-1];Array.isArray(e)?e.push(u):Object.defineProperty(e,m,{value:u,writable:!0,enumerable:!0,configurable:!0})}if(null!==u&&"object"==typeof u)f.push(u),d=Array.isArray(u)?"beforeArrayValue":"beforePropertyName";else{const u=f[f.length-1];d=null==u?"end":Array.isArray(u)?"afterArrayValue":"afterPropertyValue"}}function T(){f.pop();const u=f[f.length-1];d=null==u?"end":Array.isArray(u)?"afterArrayValue":"afterPropertyValue"}function M(u){return H(void 0===u?`JSON5: invalid end of input at ${g}:${p}`:`JSON5: invalid character '${J(u)}' at ${g}:${p}`)}function R(){return H(`JSON5: invalid end of input at ${g}:${p}`)}function V(){return p-=5,H(`JSON5: invalid identifier character at ${g}:${p}`)}function J(u){const e={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(e[u])return e[u];if(u<" "){const e=u.charCodeAt(0).toString(16);return"\\x"+("00"+e).substring(e.length)}return u}function H(u){const e=new SyntaxError(u);return e.lineNumber=g,e.columnNumber=p,e}const q={parse:function(u,e){h=String(u),d="start",f=[],B=0,g=1,p=0,b=void 0,m=void 0,v=void 0;do{b=j(),I[d]()}while("eof"!==b.type);return"function"==typeof e?y({"":v},"",e):v},stringify:function(u,e,t){const r=[];let D,n,i,s="",o="";if(null==e||"object"!=typeof e||Array.isArray(e)||(t=e.space,i=e.quote,e=e.replacer),"function"==typeof e)n=e;else if(Array.isArray(e)){D=[];for(const u of e){let e;"string"==typeof u?e=u:("number"==typeof u||u instanceof String||u instanceof Number)&&(e=String(u)),void 0!==e&&D.indexOf(e)<0&&D.push(e)}}return t instanceof Number?t=Number(t):t instanceof String&&(t=String(t)),"number"==typeof t?t>0&&(t=Math.min(10,Math.floor(t)),o=" ".substr(0,t)):"string"==typeof t&&(o=t.substr(0,10)),a("",{"":u});function a(u,e){let t=e[u];switch(null!=t&&("function"==typeof t.toJSON5?t=t.toJSON5(u):"function"==typeof t.toJSON&&(t=t.toJSON(u))),n&&(t=n.call(e,u,t)),t instanceof Number?t=Number(t):t instanceof String?t=String(t):t instanceof Boolean&&(t=t.valueOf()),t){case null:return"null";case!0:return"true";case!1:return"false"}return"string"==typeof t?c(t):"number"==typeof t?String(t):"object"==typeof t?Array.isArray(t)?function(u){if(r.indexOf(u)>=0)throw TypeError("Converting circular structure to JSON5");r.push(u);let e=s;s+=o;let t,D=[];for(let e=0;e=0)throw TypeError("Converting circular structure to JSON5");r.push(u);let e=s;s+=o;let t,n=D||Object.keys(u),i=[];for(const e of n){const t=a(e,u);if(void 0!==t){let u=l(e)+":";""!==o&&(u+=" "),u+=t,i.push(u)}}if(0===i.length)t="{}";else{let u;if(""===o)u=i.join(","),t="{"+u+"}";else{let r=",\n"+s;u=i.join(r),t="{\n"+s+u+",\n"+e+"}"}}return r.pop(),s=e,t}(t):void 0}function c(u){const e={"'":.1,'"':.2},t={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};let r="";for(let D=0;De[u]{const t=u.trim();if("'"===t.substring(0,1)||'"'===t.substring(0,1))return e.strings.push(t),`__STR$(${e.strings.length-1})__`;if("{"===t.substring(0,1)){const u=this.tokenize(t.substring(1,t.length-1),e);return e.objects.push(u),`__OBJ$(${e.objects.length-1})__`}const r=this.tokenize(t.substring(1,t.length-1),e);return e.arrays.push(r),`__ARR$(${e.arrays.length-1})__`}));let r=[];if(t.includes(","))r=t.split(",");else{if(!t.includes(":"))return t;r=[t]}return r.map((u=>{let t="";if(u.includes(":")){const[r,D]=u.split(":");r.trim().match(/^__[A-Z]{3}\$\(\d+\)__$/)?t=r.trim():(e.keys.push(r.trim()),t=`__KEY$(${e.keys.length-1})__`),D.trim().match(/^__[A-Z]{3}\$\(\d+\)__$/)?t=`${t}: ${D.trim()}`:(e.values.push(D.trim()),t=`${t}: __VAL$(${e.values.length-1})__`)}else u.trim().match(/^__[A-Z]{3}\$\(\d+\)__$/)?t=u.trim():(e.values.push(u.trim()),t=`${t}__VAL$(${e.values.length-1})__`);return t})).join(", ")}detokenize(u,e){return u.replace(/__([A-Z]{3})\$\((\d+)\)__/g,((u,t,r)=>{switch(t){case"STR":return e.strings[r].replace(/\n/g,"\\n");case"KEY":return`"${e.keys[r]}"`;case"VAL":try{return Z.parse(e.values[r].replace(/\n/g,"\\n"))}catch(u){return`"${e.values[r].replace(/\n/g,"\\n")}"`}case"ARR":return`[ ${this.detokenize(e.arrays[r],e)} ]`;default:return`{ ${this.detokenize(e.objects[r],e)} }`}}))}}class Y extends n{sanitize(u,e=!0){const t=(new DOMParser).parseFromString(u,"text/html");return this.sanitizeNode(t.getRootNode()),e?t.body.innerHTML:t.documentElement.outerHTML}sanitizeNode(u){if(["SCRIPT","IFRAME","OBJECT"].includes(u.tagName))return void u.remove();this.trimAttributes(u);Array.from(u.children).forEach((u=>{this.sanitizeNode(u)}))}trimAttributes(u){if(u.attributes)for(let e=0;e{this.initialiseSingletons(),this.globalEvent("ready"),this.readiness.dom=!0}))}initialiseSingletons(){Object.values(this.plugins).forEach((u=>{u.isSingleton()&&u.dependenciesFulfilled()&&u.initialiseSingleton()}))}addPlugin(u,e){const t=u.toLowerCase();if(this.hasPlugin(t))throw new Error(`A plugin called "${u}" is already registered.`);if(e.prototype instanceof D==!1)throw new Error("The provided plugin must extend the PluginBase class");if(void 0!==this[u]||void 0!==this[t])throw new Error("The given name is already in use for a property or method of the Snowboard class.");this.plugins[t]=new s(t,this,e),this.debug(`Plugin "${u}" registered`),Object.values(this.getPlugins()).forEach((u=>{if(u.isSingleton()&&!u.isInitialised()&&u.dependenciesFulfilled()&&u.hasMethod("listens")&&Object.keys(u.callMethod("listens")).includes("ready")&&this.readiness.dom){const e=u.callMethod("listens").ready;u.callMethod(e)}}))}removePlugin(u){const e=u.toLowerCase();this.hasPlugin(e)?(this.plugins[e].getInstances().forEach((u=>{u.destructor()})),delete this.plugins[e],delete this[e],delete this[u],this.debug(`Plugin "${u}" removed`)):this.debug(`Plugin "${u}" already removed`)}hasPlugin(u){const e=u.toLowerCase();return void 0!==this.plugins[e]}getPlugins(){return this.plugins}getPluginNames(){return Object.keys(this.plugins)}getPlugin(u){const e=u.toLowerCase();if(!this.hasPlugin(e))throw new Error(`No plugin called "${e}" has been registered.`);return this.plugins[e]}registerTrait(u,e){const t=u.toLowerCase();if(this.hasTrait(t))throw new Error(`A trait called "${u}" is already registered.`);if("function"!=typeof e)throw new Error("The provided trait must be a class.");if(void 0!==this[u]||void 0!==this[t])throw new Error("The given name is already in use for a property or method of the Snowboard class.");this.traits[t]=e,this.debug(`Trait "${u}" registered`)}hasTrait(u){const e=u.toLowerCase();return void 0!==this.traits[e]}getTraits(){return this.traits}getTrait(u){if(!this.hasTrait(u))throw new Error(`No trait called "${u}" has been registered.`);const e=u.toLowerCase();return this.traits[e]}listensToEvent(u){const e=[];return Object.entries(this.plugins).forEach((t=>{const[r,D]=t;if(!D.dependenciesFulfilled())return;const n=D.callMethod("listens");"string"!=typeof n[u]&&"function"!=typeof n[u]||e.push(r)})),e}ready(u){this.readiness.dom&&u(),this.on("ready",u)}on(u,e){this.listeners[u]||(this.listeners[u]=[]),this.listeners[u].includes(e)||this.listeners[u].push(e)}off(u,e){if(!this.listeners[u])return;const t=this.listeners[u].indexOf(e);-1!==t&&this.listeners[u].splice(t,1)}globalEvent(u,...e){this.debug(`Calling global event "${u}"`,...e);let t=!1;const r=this.listensToEvent(u);return 0===r.length?this.debug(`No listeners found for global event "${u}"`):(this.debug(`Listeners found for global event "${u}": ${r.join(", ")}`),r.forEach((r=>{const D=this.getPlugin(r);D.isSingleton()&&0===D.getInstances().length&&D.initialiseSingleton();const n=D.callMethod("listens")[u];D.getInstances().forEach((D=>{if(!t)if("function"==typeof n)try{!1===n.apply(D,e)&&(t=!0)}catch(e){this.error(`Error thrown in "${u}" event by "${r}" plugin.`,e)}else if("string"==typeof n){if(!D[n])throw new Error(`Missing "${n}" method in "${r}" plugin`);try{!1===D[n](...e)&&(t=!0,this.debug(`Global event "${u}" cancelled by "${r}" plugin`))}catch(e){this.error(`Error thrown in "${u}" event by "${r}" plugin.`,e)}}else this.error(`Listen method for "${u}" event in "${r}" plugin is not a function or string.`)}))}))),!t&&this.listeners[u]&&this.listeners[u].length>0&&(this.debug(`Found ${this.listeners[u].length} ad-hoc listener(s) for global event "${u}"`),this.listeners[u].forEach((r=>{if(!t)try{!1===r(...e)&&(t=!0,this.debug(`Global event "${u} cancelled by an ad-hoc listener.`))}catch(e){this.error(`Error thrown in "${u}" event by an ad-hoc listener.`,e)}}))),!t}globalPromiseEvent(u,...e){this.debug(`Calling global promise event "${u}"`);const t=[],r=this.listensToEvent(u);return 0===r.length?this.debug(`No listeners found for global promise event "${u}"`):(this.debug(`Listeners found for global promise event "${u}": ${r.join(", ")}`),r.forEach((r=>{const D=this.getPlugin(r);D.isSingleton()&&0===D.getInstances().length&&D.initialiseSingleton();const n=D.callMethod("listens")[u];D.getInstances().forEach((D=>{if("function"==typeof n)try{const u=n.apply(D,e);if(u instanceof Promise==!1)return;t.push(u)}catch(e){this.error(`Error thrown in "${u}" event by "${r}" plugin.`,e)}else if("string"==typeof n){if(!D[n])throw new Error(`Missing "${n}" method in "${r}" plugin`);try{const u=D[n](...e);if(u instanceof Promise==!1)return;t.push(u)}catch(e){this.error(`Error thrown in "${u}" promise event by "${r}" plugin.`,e)}}else this.error(`Listen method for "${u}" event in "${r}" plugin is not a function or string.`)}))}))),this.listeners[u]&&this.listeners[u].length>0&&(this.debug(`Found ${this.listeners[u].length} ad-hoc listener(s) for global promise event "${u}"`),this.listeners[u].forEach((r=>{try{const u=r(...e);if(u instanceof Promise==!1)return;t.push(u)}catch(e){this.error(`Error thrown in "${u}" promise event by an ad-hoc listener.`,e)}}))),0===t.length?Promise.resolve():Promise.all(t)}logMessage(u,e,t,...r){if(console.groupCollapsed("%c[Snowboard]",`color: ${u}; font-weight: ${e?"bold":"normal"};`,t),r.length){console.groupCollapsed(`%cParameters %c(${r.length})`,"color: rgb(45, 167, 199); font-weight: bold;","color: rgb(88, 88, 88); font-weight: normal;");let u=0;r.forEach((e=>{u+=1,console.log(`%c${u}:`,"color: rgb(88, 88, 88); font-weight: normal;",e)})),console.groupEnd(),console.groupCollapsed("%cTrace","color: rgb(45, 167, 199); font-weight: bold;"),console.trace(),console.groupEnd()}else console.trace();console.groupEnd()}log(u,...e){this.logMessage("rgb(45, 167, 199)",!1,u,...e)}debug(u,...e){this.debugEnabled&&this.logMessage("rgb(45, 167, 199)",!1,u,...e)}warning(u,...e){this.debugEnabled&&this.logMessage("rgb(229, 179, 71)",!0,u,...e)}error(u,...e){this.logMessage("rgb(211, 71, 71)",!0,u,...e)}}}}]); \ No newline at end of file diff --git a/modules/system/assets/js/snowboard/extras/AssetLoader.js b/modules/system/assets/js/snowboard/extras/AssetLoader.js deleted file mode 100644 index d70522204..000000000 --- a/modules/system/assets/js/snowboard/extras/AssetLoader.js +++ /dev/null @@ -1,196 +0,0 @@ -import Singleton from '../abstracts/Singleton'; - -/** - * Asset Loader. - * - * Provides simple asset loading functionality for Snowboard, making it easy to pre-load images or - * include JavaScript or CSS assets on the fly. - * - * By default, this loader will listen to any assets that have been requested to load in an AJAX - * response, such as responses from a component. - * - * You can also load assets manually by calling the following: - * - * ```js - * Snowboard.addPlugin('assetLoader', AssetLoader); - * Snowboard.assetLoader().processAssets(assets); - * ``` - * - * @copyright 2021 Winter. - * @author Ben Thomson - */ -export default class AssetLoader extends Singleton { - /** - * Event listeners. - * - * @returns {Object} - */ - listens() { - return { - ajaxLoadAssets: 'load', - }; - } - - /** - * Dependencies. - * - * @returns {Array} - */ - dependencies() { - return [ - 'url', - ]; - } - - /** - * Process and load assets. - * - * The `assets` property of this method requires an object with any of the following keys and an - * array of paths: - * - * - `js`: An array of JavaScript URLs to load - * - `css`: An array of CSS stylesheet URLs to load - * - `img`: An array of image URLs to pre-load - * - * Both `js` and `css` files will be automatically injected, however `img` files will not. - * - * This method will return a Promise that resolves when all required assets are loaded. If an - * asset fails to load, this Promise will be rejected. - * - * ESLint *REALLY* doesn't like this code, but ignore it. It's the only way it works. - * - * @param {Object} assets - * @returns {Promise} - */ - async load(assets) { - if (assets.js && assets.js.length > 0) { - for (const script of assets.js) { - try { - await this.loadScript(script); - } catch (error) { - return Promise.reject(error); - } - } - } - - if (assets.css && assets.css.length > 0) { - for (const style of assets.css) { - try { - await this.loadStyle(style); - } catch (error) { - return Promise.reject(error); - } - } - } - - if (assets.img && assets.img.length > 0) { - for (const image of assets.img) { - try { - await this.loadImage(image); - } catch (error) { - return Promise.reject(error); - } - } - } - - return Promise.resolve(); - } - - /** - * Injects and loads a JavaScript URL into the DOM. - * - * The script will be appended before the closing `` tag. - * - * @param {String} script - * @returns {Promise} - */ - loadScript(script) { - return new Promise((resolve, reject) => { - // Resolve script URL - script = this.snowboard.url().asset(script); - - // Check that script is not already loaded - const loaded = document.querySelector(`script[src="${script}"]`); - if (loaded) { - resolve(); - return; - } - - // Create script - const domScript = document.createElement('script'); - domScript.setAttribute('type', 'text/javascript'); - domScript.setAttribute('src', script); - domScript.addEventListener('load', () => { - this.snowboard.globalEvent('assetLoader.loaded', 'script', script, domScript); - resolve(); - }); - domScript.addEventListener('error', () => { - this.snowboard.globalEvent('assetLoader.error', 'script', script, domScript); - reject(new Error(`Unable to load script file: "${script}"`)); - }); - document.body.append(domScript); - }); - } - - /** - * Injects and loads a CSS stylesheet into the DOM. - * - * The stylesheet will be appended before the closing `` tag. - * - * @param {String} style - * @returns {Promise} - */ - loadStyle(style) { - return new Promise((resolve, reject) => { - // Resolve style URL - style = this.snowboard.url().asset(style); - - // Check that stylesheet is not already loaded - const loaded = document.querySelector(`link[rel="stylesheet"][href="${style}"]`); - if (loaded) { - resolve(); - return; - } - - // Create stylesheet - const domCss = document.createElement('link'); - domCss.setAttribute('rel', 'stylesheet'); - domCss.setAttribute('href', style); - domCss.addEventListener('load', () => { - this.snowboard.globalEvent('assetLoader.loaded', 'style', style, domCss); - resolve(); - }); - domCss.addEventListener('error', () => { - this.snowboard.globalEvent('assetLoader.error', 'style', style, domCss); - reject(new Error(`Unable to load stylesheet file: "${style}"`)); - }); - document.head.append(domCss); - }); - } - - /** - * Pre-loads an image. - * - * The image will not be injected into the DOM. - * - * @param {String} image - * @returns {Promise} - */ - loadImage(image) { - return new Promise((resolve, reject) => { - // Resolve script URL - image = this.snowboard.url().asset(image); - - const img = new Image(); - img.addEventListener('load', () => { - this.snowboard.globalEvent('assetLoader.loaded', 'image', image, img); - resolve(); - }); - img.addEventListener('error', () => { - this.snowboard.globalEvent('assetLoader.error', 'image', image, img); - reject(new Error(`Unable to load image file: "${image}"`)); - }); - img.src = image; - }); - } -} diff --git a/modules/system/assets/js/snowboard/extras/AttachLoading.js b/modules/system/assets/js/snowboard/extras/AttachLoading.js index 248abc1f9..4b082b097 100644 --- a/modules/system/assets/js/snowboard/extras/AttachLoading.js +++ b/modules/system/assets/js/snowboard/extras/AttachLoading.js @@ -1,4 +1,4 @@ -import Singleton from '../abstracts/Singleton'; +import { Singleton } from "@wintercms/snowboard"; /** * Allows attaching a loading class on elements that an AJAX request is targeting. diff --git a/modules/system/assets/js/snowboard/extras/DataConfig.js b/modules/system/assets/js/snowboard/extras/DataConfig.js deleted file mode 100644 index c97b351cd..000000000 --- a/modules/system/assets/js/snowboard/extras/DataConfig.js +++ /dev/null @@ -1,222 +0,0 @@ -import PluginBase from '../abstracts/PluginBase'; - -/** - * Data configuration provider. - * - * Provides a mechanism for passing configuration data through an element's data attributes. This - * is generally used for widgets or UI interactions to configure them. - * - * @copyright 2022 Winter. - * @author Ben Thomson - */ -export default class DataConfig extends PluginBase { - /** - * Constructor. - * - * @param {PluginBase} instance - * @param {HTMLElement} element - * @param {Object} localConfig - */ - construct(instance, element, localConfig) { - if (instance instanceof PluginBase === false) { - throw new Error('You must provide a Snowboard plugin to enable data configuration'); - } - if (element instanceof HTMLElement === false) { - throw new Error('Data configuration can only be extracted from HTML elements'); - } - - this.instance = instance; - this.element = element; - this.localConfig = localConfig || {}; - this.instanceConfig = {}; - this.acceptedConfigs = {}; - this.refresh(); - } - - /** - * Gets the config for this instance. - * - * If the `config` parameter is unspecified, returns the entire configuration. - * - * @param {string} config - */ - get(config) { - if (config === undefined) { - return this.instanceConfig; - } - - if (this.instanceConfig[config] !== undefined) { - return this.instanceConfig[config]; - } - - return undefined; - } - - /** - * Sets the config for this instance. - * - * This allows you to override, at runtime, any configuration value as necessary. - * - * @param {string} config - * @param {any} value - * @param {boolean} persist - */ - set(config, value, persist) { - if (config === undefined) { - throw new Error('You must provide a configuration key to set'); - } - - this.instanceConfig[config] = value; - - if (persist === true) { - this.element.dataset[config] = value; - this.localConfig[config] = value; - } - } - - /** - * Refreshes the configuration from the element. - * - * This will allow you to make changes to the data config on a DOM level and re-apply them - * to the config on the JavaScript side. - */ - refresh() { - this.acceptedConfigs = this.getAcceptedConfigs(); - this.instanceConfig = this.processConfig(); - } - - /** - * Determines the available configurations that can be set through the data config. - * - * If an instance has an `acceptAllDataConfigs` property, set to `true`, then all data - * attributes will be available as configuration values. This can be a security concern, so - * tread carefully. - * - * Otherwise, available configurations will be determined by the keys available in an object - * returned by a `defaults()` method in the instance. - * - * @returns {string[]|boolean} - */ - getAcceptedConfigs() { - if ( - this.instance.acceptAllDataConfigs !== undefined - && this.instance.acceptAllDataConfigs === true - ) { - return true; - } - - if ( - this.instance.defaults !== undefined - && typeof this.instance.defaults === 'function' - && typeof this.instance.defaults() === 'object' - ) { - return Object.keys(this.instance.defaults()); - } - - return false; - } - - /** - * Returns the default values for the instance. - * - * This will be an empty object if the instance either does not have a `defaults()` method, or - * the method itself does not return an object. - * - * @returns {object} - */ - getDefaults() { - if ( - this.instance.defaults !== undefined - && typeof this.instance.defaults === 'function' - && typeof this.instance.defaults() === 'object' - ) { - return this.instance.defaults(); - } - - return {}; - } - - /** - * Processes the configuration. - * - * Loads up the defaults, then populates it with any configuration values provided by the data - * attributes, based on the rules of the accepted configurations. - * - * This configuration object is then cached and available through `config.get()` calls. - * - * @returns {object} - */ - processConfig() { - const config = this.getDefaults(); - - if (this.acceptedConfigs === false) { - return config; - } - - /* eslint-disable */ - for (const key in this.element.dataset) { - if (this.acceptedConfigs === true || this.acceptedConfigs.includes(key)) { - config[key] = this.coerceValue(this.element.dataset[key]); - } - } - - for (const key in this.localConfig) { - if (this.acceptedConfigs === true || this.acceptedConfigs.includes(key)) { - config[key] = this.localConfig[key]; - } - } - /* eslint-enable */ - - return config; - } - - /** - * Coerces configuration values for JavaScript. - * - * Takes the string value returned from the data attribute and coerces it into a more suitable - * type for JavaScript processing. - * - * @param {*} value - * @returns {*} - */ - coerceValue(value) { - const stringValue = String(value); - - // Null value - if (stringValue === 'null') { - return null; - } - - // Undefined value - if (stringValue === 'undefined') { - return undefined; - } - - // Base64 value - if (stringValue.startsWith('base64:')) { - const base64str = stringValue.replace(/^base64:/, ''); - const decoded = atob(base64str); - return this.coerceValue(decoded); - } - - // Boolean value - if (['true', 'yes'].includes(stringValue.toLowerCase())) { - return true; - } - if (['false', 'no'].includes(stringValue.toLowerCase())) { - return false; - } - - // Numeric value - if (/^[-+]?[0-9]+(\.[0-9]+)?$/.test(stringValue)) { - return Number(stringValue); - } - - // JSON value - try { - return this.snowboard.jsonParser().parse(stringValue); - } catch (e) { - return (stringValue === '') ? true : stringValue; - } - } -} diff --git a/modules/system/assets/js/snowboard/extras/Flash.js b/modules/system/assets/js/snowboard/extras/Flash.js index 9f2ac9306..14fc69a78 100644 --- a/modules/system/assets/js/snowboard/extras/Flash.js +++ b/modules/system/assets/js/snowboard/extras/Flash.js @@ -1,4 +1,4 @@ -import PluginBase from '../abstracts/PluginBase'; +import { PluginBase } from "@wintercms/snowboard"; /** * Provides flash messages for the CMS. diff --git a/modules/system/assets/js/snowboard/extras/FlashListener.js b/modules/system/assets/js/snowboard/extras/FlashListener.js index ea2214f8f..500e95187 100644 --- a/modules/system/assets/js/snowboard/extras/FlashListener.js +++ b/modules/system/assets/js/snowboard/extras/FlashListener.js @@ -1,4 +1,4 @@ -import Singleton from '../abstracts/Singleton'; +import { Singleton } from "@wintercms/snowboard"; /** * Defines a default listener for flash events. diff --git a/modules/system/assets/js/snowboard/extras/FormValidation.js b/modules/system/assets/js/snowboard/extras/FormValidation.js index 52f424a35..ea6489ece 100644 --- a/modules/system/assets/js/snowboard/extras/FormValidation.js +++ b/modules/system/assets/js/snowboard/extras/FormValidation.js @@ -1,4 +1,4 @@ -import Singleton from '../abstracts/Singleton'; +import { Singleton } from "@wintercms/snowboard"; /** * Adds AJAX-driven form validation to Snowboard requests. diff --git a/modules/system/assets/js/snowboard/extras/StripeLoader.js b/modules/system/assets/js/snowboard/extras/StripeLoader.js index e6d2d9106..d66dcb980 100644 --- a/modules/system/assets/js/snowboard/extras/StripeLoader.js +++ b/modules/system/assets/js/snowboard/extras/StripeLoader.js @@ -1,4 +1,4 @@ -import Singleton from '../abstracts/Singleton'; +import { Singleton } from "@wintercms/snowboard"; /** * Displays a stripe at the top of the page that indicates loading. diff --git a/modules/system/assets/js/snowboard/extras/StylesheetLoader.js b/modules/system/assets/js/snowboard/extras/StylesheetLoader.js index ffe14c446..8ec36580c 100644 --- a/modules/system/assets/js/snowboard/extras/StylesheetLoader.js +++ b/modules/system/assets/js/snowboard/extras/StylesheetLoader.js @@ -1,4 +1,4 @@ -import Singleton from '../abstracts/Singleton'; +import { Singleton } from "@wintercms/snowboard"; /** * Embeds the "extras" stylesheet into the page, if it is not loaded through the theme. diff --git a/modules/system/assets/js/snowboard/extras/Transition.js b/modules/system/assets/js/snowboard/extras/Transition.js index b19f1c9ee..b7d16492b 100644 --- a/modules/system/assets/js/snowboard/extras/Transition.js +++ b/modules/system/assets/js/snowboard/extras/Transition.js @@ -1,4 +1,4 @@ -import PluginBase from '../abstracts/PluginBase'; +import { PluginBase } from "@wintercms/snowboard"; /** * Provides transition support for elements. diff --git a/modules/system/assets/js/snowboard/main/InnerProxyHandler.js b/modules/system/assets/js/snowboard/main/InnerProxyHandler.js deleted file mode 100644 index 659ca5af2..000000000 --- a/modules/system/assets/js/snowboard/main/InnerProxyHandler.js +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Internal proxy for Snowboard. - * - * This handler wraps the Snowboard instance that is passed to the constructor of plugin instances. - * It prevents access to the following methods: - * - `attachAbstracts`: No need to attach abstracts again. - * - `loadUtilties`: No need to load utilities again. - * - `initialise`: Snowboard is already initialised. - * - `initialiseSingletons`: Singletons are already initialised. - */ -export default { - get(target, prop, receiver) { - if (typeof prop === 'string') { - const propLower = prop.toLowerCase(); - - if (['attachAbstracts', 'loadUtilities', 'initialise', 'initialiseSingletons'].includes(prop)) { - throw new Error(`You cannot use the "${prop}" Snowboard method within a plugin.`); - } - - if (target.hasPlugin(propLower)) { - return (...params) => Reflect.get(target, 'plugins')[propLower].getInstance(...params); - } - } - - return Reflect.get(target, prop, receiver); - }, - - has(target, prop) { - if (typeof prop === 'string') { - const propLower = prop.toLowerCase(); - - if (['attachAbstracts', 'loadUtilities', 'initialise', 'initialiseSingletons'].includes(prop)) { - return false; - } - - if (target.hasPlugin(propLower)) { - return true; - } - } - - return Reflect.has(target, prop); - }, -}; diff --git a/modules/system/assets/js/snowboard/main/PluginLoader.js b/modules/system/assets/js/snowboard/main/PluginLoader.js deleted file mode 100644 index 77ca20af7..000000000 --- a/modules/system/assets/js/snowboard/main/PluginLoader.js +++ /dev/null @@ -1,293 +0,0 @@ -import PluginBase from '../abstracts/PluginBase'; -import Singleton from '../abstracts/Singleton'; -import InnerProxyHandler from './InnerProxyHandler'; - -/** - * Plugin loader class. - * - * This is a provider (factory) class for a single plugin and provides the link between Snowboard framework functionality - * and the underlying plugin instances. It also provides some basic mocking of plugin methods for testing. - * - * @copyright 2021 Winter. - * @author Ben Thomson - */ -export default class PluginLoader { - /** - * Constructor. - * - * Binds the Winter framework to the instance. - * - * @param {string} name - * @param {Snowboard} snowboard - * @param {PluginBase} instance - */ - constructor(name, snowboard, instance) { - this.name = name; - this.snowboard = new Proxy( - snowboard, - InnerProxyHandler, - ); - this.instance = instance; - - // Freeze instance that has been inserted into this loader - Object.freeze(this.instance); - - this.instances = []; - this.singleton = { - initialised: false, - }; - // Prevent further extension of the singleton status object - Object.seal(this.singleton); - - this.mocks = {}; - this.originalFunctions = {}; - - // Freeze loader itself - Object.freeze(PluginLoader.prototype); - Object.freeze(this); - } - - /** - * Determines if the current plugin has a specific method available. - * - * Returns false if the current plugin is a callback function. - * - * @param {string} methodName - * @returns {boolean} - */ - hasMethod(methodName) { - if (this.isFunction()) { - return false; - } - - return (typeof this.instance.prototype[methodName] === 'function'); - } - - /** - * Calls a prototype method for a plugin. This should generally be used for "static" calls. - * - * @param {string} methodName - * @param {...} args - * @returns {any} - */ - callMethod(...parameters) { - if (this.isFunction()) { - return null; - } - - const args = parameters; - const methodName = args.shift(); - - return this.instance.prototype[methodName](args); - } - - /** - * Returns an instance of the current plugin. - * - * - If this is a callback function plugin, the function will be returned. - * - If this is a singleton, the single instance of the plugin will be returned. - * - * @returns {PluginBase|Function} - */ - getInstance(...parameters) { - if (this.isFunction()) { - return this.instance(...parameters); - } - if (!this.dependenciesFulfilled()) { - const unmet = this.getDependencies().filter((item) => !this.snowboard.getPluginNames().includes(item)); - throw new Error(`The "${this.name}" plugin requires the following plugins: ${unmet.join(', ')}`); - } - if (this.isSingleton()) { - if (this.instances.length === 0) { - this.initialiseSingleton(...parameters); - } - - // Apply mocked methods - if (Object.keys(this.mocks).length > 0) { - Object.entries(this.originalFunctions).forEach((entry) => { - const [methodName, callback] = entry; - this.instances[0][methodName] = callback; - }); - Object.entries(this.mocks).forEach((entry) => { - const [methodName, callback] = entry; - this.instances[0][methodName] = (...params) => callback(this, ...params); - }); - } - - return this.instances[0]; - } - - // Apply mocked methods to prototype - if (Object.keys(this.mocks).length > 0) { - Object.entries(this.originalFunctions).forEach((entry) => { - const [methodName, callback] = entry; - this.instance.prototype[methodName] = callback; - }); - Object.entries(this.mocks).forEach((entry) => { - const [methodName, callback] = entry; - this.instance.prototype[methodName] = (...params) => callback(this, ...params); - }); - } - - const newInstance = new this.instance(this.snowboard, ...parameters); - newInstance.detach = () => this.instances.splice(this.instances.indexOf(newInstance), 1); - newInstance.construct(...parameters); - this.instances.push(newInstance); - - return newInstance; - } - - /** - * Gets all instances of the current plugin. - * - * If this plugin is a callback function plugin, an empty array will be returned. - * - * @returns {PluginBase[]} - */ - getInstances() { - if (this.isFunction()) { - return []; - } - - return this.instances; - } - - /** - * Determines if the current plugin is a simple callback function. - * - * @returns {boolean} - */ - isFunction() { - return (typeof this.instance === 'function' && this.instance.prototype instanceof PluginBase === false); - } - - /** - * Determines if the current plugin is a singleton. - * - * @returns {boolean} - */ - isSingleton() { - return this.instance.prototype instanceof Singleton === true; - } - - /** - * Determines if a singleton has been initialised. - * - * Normal plugins will always return true. - * - * @returns {boolean} - */ - isInitialised() { - if (!this.isSingleton()) { - return true; - } - - return this.singleton.initialised; - } - - /** - * Initialises the singleton instance. - * - * @returns {void} - */ - initialiseSingleton(...parameters) { - if (!this.isSingleton()) { - return; - } - - const newInstance = new this.instance(this.snowboard, ...parameters); - newInstance.detach = () => this.instances.splice(this.instances.indexOf(newInstance), 1); - newInstance.construct(...parameters); - this.instances.push(newInstance); - this.singleton.initialised = true; - } - - /** - * Gets the dependencies of the current plugin. - * - * @returns {string[]} - */ - getDependencies() { - // Callback functions cannot have dependencies. - if (this.isFunction()) { - return []; - } - - // No dependency method specified. - if (typeof this.instance.prototype.dependencies !== 'function') { - return []; - } - - return this.instance.prototype.dependencies().map((item) => item.toLowerCase()); - } - - /** - * Determines if the current plugin has all its dependencies fulfilled. - * - * @returns {boolean} - */ - dependenciesFulfilled() { - const dependencies = this.getDependencies(); - - let fulfilled = true; - dependencies.forEach((plugin) => { - if (!this.snowboard.hasPlugin(plugin)) { - fulfilled = false; - } - }); - - return fulfilled; - } - - /** - * Allows a method of an instance to be mocked for testing. - * - * This mock will be applied for the life of an instance. For singletons, the mock will be applied for the life - * of the page. - * - * Mocks cannot be applied to callback function plugins. - * - * @param {string} methodName - * @param {Function} callback - */ - mock(methodName, callback) { - if (this.isFunction()) { - return; - } - - if (!this.instance.prototype[methodName]) { - throw new Error(`Function "${methodName}" does not exist and cannot be mocked`); - } - - this.mocks[methodName] = callback; - this.originalFunctions[methodName] = this.instance.prototype[methodName]; - - if (this.isSingleton() && this.instances.length === 0) { - this.initialiseSingleton(); - - // Apply mocked method - this.instances[0][methodName] = (...parameters) => callback(this, ...parameters); - } - } - - /** - * Removes a mock callback from future instances. - * - * @param {string} methodName - */ - unmock(methodName) { - if (this.isFunction()) { - return; - } - if (!this.mocks[methodName]) { - return; - } - - if (this.isSingleton()) { - this.instances[0][methodName] = this.originalFunctions[methodName]; - } - - delete this.mocks[methodName]; - delete this.originalFunctions[methodName]; - } -} diff --git a/modules/system/assets/js/snowboard/main/ProxyHandler.js b/modules/system/assets/js/snowboard/main/ProxyHandler.js deleted file mode 100644 index ce59fd7c3..000000000 --- a/modules/system/assets/js/snowboard/main/ProxyHandler.js +++ /dev/null @@ -1,25 +0,0 @@ -export default { - get(target, prop, receiver) { - if (typeof prop === 'string') { - const propLower = prop.toLowerCase(); - - if (target.hasPlugin(propLower)) { - return (...params) => Reflect.get(target, 'plugins')[propLower].getInstance(...params); - } - } - - return Reflect.get(target, prop, receiver); - }, - - has(target, prop) { - if (typeof prop === 'string') { - const propLower = prop.toLowerCase(); - - if (target.hasPlugin(propLower)) { - return true; - } - } - - return Reflect.has(target, prop); - }, -}; diff --git a/modules/system/assets/js/snowboard/main/Snowboard.js b/modules/system/assets/js/snowboard/main/Snowboard.js deleted file mode 100644 index 288e6116a..000000000 --- a/modules/system/assets/js/snowboard/main/Snowboard.js +++ /dev/null @@ -1,597 +0,0 @@ -import PluginBase from '../abstracts/PluginBase'; -import Singleton from '../abstracts/Singleton'; -import PluginLoader from './PluginLoader'; - -import Cookie from '../utilities/Cookie'; -import JsonParser from '../utilities/JsonParser'; -import Sanitizer from '../utilities/Sanitizer'; -import Url from '../utilities/Url'; - -/** - * Snowboard - the Winter JavaScript framework. - * - * This class represents the base of a modern take on the Winter JS framework, being fully extensible and taking advantage - * of modern JavaScript features by leveraging the Laravel Mix compilation framework. It also is coded up to remove the - * dependency of jQuery. - * - * @copyright 2021 Winter. - * @author Ben Thomson - * @link https://wintercms.com/docs/snowboard/introduction - */ -export default class Snowboard { - /** - * Constructor. - * - * @param {boolean} autoSingletons Automatically load singletons when DOM is ready. Default: `true`. - * @param {boolean} debug Whether debugging logs should be shown. Default: `false`. - */ - constructor(autoSingletons, debug) { - this.debugEnabled = (typeof debug === 'boolean' && debug === true); - this.autoInitSingletons = (typeof autoSingletons === 'boolean' && autoSingletons === false); - this.plugins = {}; - this.listeners = {}; - this.foundBaseUrl = null; - this.readiness = { - dom: false, - }; - // Seal readiness from being added to further, but allow the properties to be modified. - Object.seal(this.readiness); - this.attachAbstracts(); - - // Freeze the Snowboard class to prevent further modifications. - Object.freeze(Snowboard.prototype); - Object.freeze(this); - - this.loadUtilities(); - this.initialise(); - - this.debug('Snowboard framework initialised'); - } - - /** - * Attaches abstract classes as properties of the Snowboard class. - * - * This will allow Javascript functionality with no build process to still extend these abstracts by prefixing - * them with "Snowboard". - * - * ``` - * class MyClass extends Snowboard.PluginBase { - * ... - * } - * ``` - */ - attachAbstracts() { - this.PluginBase = PluginBase; - this.Singleton = Singleton; - - Object.freeze(this.PluginBase.prototype); - Object.freeze(this.PluginBase); - Object.freeze(this.Singleton.prototype); - Object.freeze(this.Singleton); - } - - /** - * Loads the default utilities. - */ - loadUtilities() { - this.addPlugin('cookie', Cookie); - this.addPlugin('jsonParser', JsonParser); - this.addPlugin('sanitizer', Sanitizer); - this.addPlugin('url', Url); - } - - /** - * Initialises the framework. - * - * Attaches a listener for the DOM being ready and triggers a global "ready" event for plugins to begin attaching - * themselves to the DOM. - */ - initialise() { - window.addEventListener('DOMContentLoaded', () => { - if (this.autoInitSingletons) { - this.initialiseSingletons(); - } - this.globalEvent('ready'); - this.readiness.dom = true; - }); - } - - /** - * Initialises an instance of every singleton. - */ - initialiseSingletons() { - Object.values(this.plugins).forEach((plugin) => { - if (plugin.isSingleton() && plugin.dependenciesFulfilled()) { - plugin.initialiseSingleton(); - } - }); - } - - /** - * Adds a plugin to the framework. - * - * Plugins are the cornerstone for additional functionality for Snowboard. A plugin must either be an ES2015 class - * that extends the PluginBase or Singleton abstract classes, or a simple callback function. - * - * When a plugin is added, it is automatically assigned as a new magic method in the Snowboard class using the name - * parameter, and can be called via this method. This method will always be the "lowercase" version of this name. - * - * For example, if a plugin is assigned to the name "myPlugin", it can be called via `Snowboard.myplugin()`. - * - * @param {string} name - * @param {PluginBase|Function} instance - */ - addPlugin(name, instance) { - const lowerName = name.toLowerCase(); - - if (this.hasPlugin(lowerName)) { - throw new Error(`A plugin called "${name}" is already registered.`); - } - - if (typeof instance !== 'function' && instance instanceof PluginBase === false) { - throw new Error('The provided plugin must extend the PluginBase class, or must be a callback function.'); - } - - if (this[name] !== undefined || this[lowerName] !== undefined) { - throw new Error('The given name is already in use for a property or method of the Snowboard class.'); - } - - this.plugins[lowerName] = new PluginLoader(lowerName, this, instance); - - this.debug(`Plugin "${name}" registered`); - - // Check if any singletons now have their dependencies fulfilled, and fire their "ready" handler if we're - // in a ready state. - Object.values(this.getPlugins()).forEach((plugin) => { - if ( - plugin.isSingleton() - && !plugin.isInitialised() - && plugin.dependenciesFulfilled() - && plugin.hasMethod('listens') - && Object.keys(plugin.callMethod('listens')).includes('ready') - && this.readiness.dom - ) { - const readyMethod = plugin.callMethod('listens').ready; - plugin.callMethod(readyMethod); - } - }); - } - - /** - * Removes a plugin. - * - * Removes a plugin from Snowboard, calling the destructor method for all active instances of the plugin. - * - * @param {string} name - * @returns {void} - */ - removePlugin(name) { - const lowerName = name.toLowerCase(); - - if (!this.hasPlugin(lowerName)) { - this.debug(`Plugin "${name}" already removed`); - return; - } - - // Call destructors for all instances - this.plugins[lowerName].getInstances().forEach((instance) => { - instance.destruct(); - }); - - delete this.plugins[lowerName]; - delete this[lowerName]; - delete this[name]; - - this.debug(`Plugin "${name}" removed`); - } - - /** - * Determines if a plugin has been registered and is active. - * - * A plugin that is still waiting for dependencies to be registered will not be active. - * - * @param {string} name - * @returns {boolean} - */ - hasPlugin(name) { - const lowerName = name.toLowerCase(); - - return (this.plugins[lowerName] !== undefined); - } - - /** - * Returns an array of registered plugins as PluginLoader objects. - * - * @returns {PluginLoader[]} - */ - getPlugins() { - return this.plugins; - } - - /** - * Returns an array of registered plugins, by name. - * - * @returns {string[]} - */ - getPluginNames() { - return Object.keys(this.plugins); - } - - /** - * Returns a PluginLoader object of a given plugin. - * - * @returns {PluginLoader} - */ - getPlugin(name) { - const lowerName = name.toLowerCase(); - - if (!this.hasPlugin(lowerName)) { - throw new Error(`No plugin called "${lowerName}" has been registered.`); - } - - return this.plugins[lowerName]; - } - - /** - * Finds all plugins that listen to the given event. - * - * This works for both normal and promise events. It does NOT check that the plugin's listener actually exists. - * - * @param {string} eventName - * @returns {string[]} The name of the plugins that are listening to this event. - */ - listensToEvent(eventName) { - const plugins = []; - - Object.entries(this.plugins).forEach((entry) => { - const [name, plugin] = entry; - - if (plugin.isFunction()) { - return; - } - if (!plugin.dependenciesFulfilled()) { - return; - } - if (!plugin.hasMethod('listens')) { - return; - } - - const listeners = plugin.callMethod('listens'); - - if (typeof listeners[eventName] === 'string' || typeof listeners[eventName] === 'function') { - plugins.push(name); - } - }); - - return plugins; - } - - /** - * Add a simple ready listener. - * - * Synonymous with jQuery's "$(document).ready()" functionality, this allows inline scripts to - * attach themselves to Snowboard immediately but only fire when the DOM is ready. - * - * @param {Function} callback - */ - ready(callback) { - if (this.readiness.dom) { - callback(); - } - - this.on('ready', callback); - } - - /** - * Adds a simple listener for an event. - * - * This can be used for ad-hoc scripts that don't need a full plugin. The given callback will be - * called when the event name provided fires. This works for both normal and Promise events. For - * a Promise event, your callback must return a Promise. - * - * @param {String} eventName - * @param {Function} callback - */ - on(eventName, callback) { - if (!this.listeners[eventName]) { - this.listeners[eventName] = []; - } - - if (!this.listeners[eventName].includes(callback)) { - this.listeners[eventName].push(callback); - } - } - - /** - * Removes a simple listener for an event. - * - * @param {String} eventName - * @param {Function} callback - */ - off(eventName, callback) { - if (!this.listeners[eventName]) { - return; - } - - const index = this.listeners[eventName].indexOf(callback); - if (index === -1) { - return; - } - - this.listeners[eventName].splice(index, 1); - } - - /** - * Calls a global event to all registered plugins. - * - * If any plugin returns a `false`, the event is considered cancelled. - * - * @param {string} eventName - * @returns {boolean} If event was not cancelled - */ - globalEvent(eventName, ...parameters) { - this.debug(`Calling global event "${eventName}"`, ...parameters); - - // Find plugins listening to the event. - const listeners = this.listensToEvent(eventName); - if (listeners.length === 0) { - this.debug(`No listeners found for global event "${eventName}"`); - return true; - } - this.debug(`Listeners found for global event "${eventName}": ${listeners.join(', ')}`); - - let cancelled = false; - - listeners.forEach((name) => { - const plugin = this.getPlugin(name); - - if (plugin.isFunction()) { - return; - } - if (plugin.isSingleton() && plugin.getInstances().length === 0) { - plugin.initialiseSingleton(); - } - - const listenMethod = plugin.callMethod('listens')[eventName]; - - // Call event handler methods for all plugins, if they have a method specified for the event. - plugin.getInstances().forEach((instance) => { - // If a plugin has cancelled the event, no further plugins are considered. - if (cancelled) { - return; - } - - if (typeof listenMethod === 'function') { - try { - const result = listenMethod.apply(instance, parameters); - if (result === false) { - cancelled = true; - } - } catch (error) { - this.error( - `Error thrown in "${eventName}" event by "${name}" plugin.`, - error, - ); - } - } else if (typeof listenMethod === 'string') { - if (!instance[listenMethod]) { - throw new Error(`Missing "${listenMethod}" method in "${name}" plugin`); - } - - try { - if (instance[listenMethod](...parameters) === false) { - cancelled = true; - this.debug(`Global event "${eventName}" cancelled by "${name}" plugin`); - } - } catch (error) { - this.error( - `Error thrown in "${eventName}" event by "${name}" plugin.`, - error, - ); - } - } else { - this.error(`Listen method for "${eventName}" event in "${name}" plugin is not a function or string.`); - } - }); - }); - - // Find ad-hoc listeners for this event. - if (!cancelled && this.listeners[eventName] && this.listeners[eventName].length > 0) { - this.debug(`Found ${this.listeners[eventName].length} ad-hoc listener(s) for global event "${eventName}"`); - - this.listeners[eventName].forEach((listener) => { - // If a listener has cancelled the event, no further listeners are considered. - if (cancelled) { - return; - } - - try { - if (listener(...parameters) === false) { - cancelled = true; - this.debug(`Global event "${eventName} cancelled by an ad-hoc listener.`); - } - } catch (error) { - this.error( - `Error thrown in "${eventName}" event by an ad-hoc listener.`, - error, - ); - } - }); - } - - return !cancelled; - } - - /** - * Calls a global event to all registered plugins, expecting a Promise to be returned by all. - * - * This collates all plugins responses into one large Promise that either expects all to be resolved, or one to reject. - * If no listeners are found, a resolved Promise is returned. - * - * @param {string} eventName - */ - globalPromiseEvent(eventName, ...parameters) { - this.debug(`Calling global promise event "${eventName}"`); - - // Find plugins listening to this event. - const listeners = this.listensToEvent(eventName); - if (listeners.length === 0) { - this.debug(`No listeners found for global promise event "${eventName}"`); - return Promise.resolve(); - } - this.debug(`Listeners found for global promise event "${eventName}": ${listeners.join(', ')}`); - - const promises = []; - - listeners.forEach((name) => { - const plugin = this.getPlugin(name); - - if (plugin.isFunction()) { - return; - } - if (plugin.isSingleton() && plugin.getInstances().length === 0) { - plugin.initialiseSingleton(); - } - - const listenMethod = plugin.callMethod('listens')[eventName]; - - // Call event handler methods for all plugins, if they have a method specified for the event. - plugin.getInstances().forEach((instance) => { - if (typeof listenMethod === 'function') { - try { - const instancePromise = listenMethod.apply(instance, parameters); - - if (instancePromise instanceof Promise === false) { - return; - } - - promises.push(instancePromise); - } catch (error) { - this.error( - `Error thrown in "${eventName}" event by "${name}" plugin.`, - error, - ); - } - } else if (typeof listenMethod === 'string') { - if (!instance[listenMethod]) { - throw new Error(`Missing "${listenMethod}" method in "${name}" plugin`); - } - - try { - const instancePromise = instance[listenMethod](...parameters); - - if (instancePromise instanceof Promise === false) { - return; - } - - promises.push(instancePromise); - } catch (error) { - this.error( - `Error thrown in "${eventName}" promise event by "${name}" plugin.`, - error, - ); - } - } else { - this.error(`Listen method for "${eventName}" event in "${name}" plugin is not a function or string.`); - } - }); - }); - - // Find ad-hoc listeners listening to this event. - if (this.listeners[eventName] && this.listeners[eventName].length > 0) { - this.debug(`Found ${this.listeners[eventName].length} ad-hoc listener(s) for global promise event "${eventName}"`); - - this.listeners[eventName].forEach((listener) => { - try { - const listenerPromise = listener(...parameters); - if (listenerPromise instanceof Promise === false) { - return; - } - - promises.push(listenerPromise); - } catch (error) { - this.error( - `Error thrown in "${eventName}" promise event by an ad-hoc listener.`, - error, - ); - } - }); - } - - if (promises.length === 0) { - return Promise.resolve(); - } - - return Promise.all(promises); - } - - /** - * Log a styled message in the console. - * - * Includes parameters and a stack trace. - * - * @returns {void} - */ - logMessage(color, bold, message, ...parameters) { - /* eslint-disable */ - console.groupCollapsed( - '%c[Snowboard]', - `color: ${color}; font-weight: ${(bold) ? 'bold' : 'normal'};`, - message - ); - if (parameters.length) { - console.groupCollapsed( - `%cParameters %c(${parameters.length})`, - 'color: rgb(45, 167, 199); font-weight: bold;', - 'color: rgb(88, 88, 88); font-weight: normal;' - ); - let index = 0; - parameters.forEach((param) => { - index += 1; - console.log(`%c${index}:`, 'color: rgb(88, 88, 88); font-weight: normal;', param); - }); - console.groupEnd(); - - console.groupCollapsed('%cTrace', 'color: rgb(45, 167, 199); font-weight: bold;'); - console.trace(); - console.groupEnd(); - } else { - console.trace(); - } - console.groupEnd(); - /* eslint-enable */ - } - - /** - * Log a message. - * - * @returns {void} - */ - log(message, ...parameters) { - this.logMessage('rgb(45, 167, 199)', false, message, ...parameters); - } - - /** - * Log a debug message. - * - * These messages are only shown when debugging is enabled. - * - * @returns {void} - */ - debug(message, ...parameters) { - if (!this.debugEnabled) { - return; - } - - this.logMessage('rgb(45, 167, 199)', false, message, ...parameters); - } - - /** - * Logs an error message. - * - * @returns {void} - */ - error(message, ...parameters) { - this.logMessage('rgb(229, 35, 35)', true, message, ...parameters); - } -} diff --git a/modules/system/assets/js/snowboard/snowboard.backend.extras.js b/modules/system/assets/js/snowboard/snowboard.backend.extras.js index 6d4119137..421d1b13e 100644 --- a/modules/system/assets/js/snowboard/snowboard.backend.extras.js +++ b/modules/system/assets/js/snowboard/snowboard.backend.extras.js @@ -3,16 +3,12 @@ import Transition from './extras/Transition'; import AttachLoading from './extras/AttachLoading'; import StripeLoader from './extras/StripeLoader'; import StylesheetLoader from './extras/StylesheetLoader'; -import AssetLoader from './extras/AssetLoader'; -import DataConfig from './extras/DataConfig'; if (window.Snowboard === undefined) { throw new Error('Snowboard must be loaded in order to use the extra plugins.'); } ((Snowboard) => { - Snowboard.addPlugin('assetLoader', AssetLoader); - Snowboard.addPlugin('dataConfig', DataConfig); Snowboard.addPlugin('extrasStyles', StylesheetLoader); Snowboard.addPlugin('transition', Transition); Snowboard.addPlugin('flash', Flash); diff --git a/modules/system/assets/js/snowboard/snowboard.base.debug.js b/modules/system/assets/js/snowboard/snowboard.base.debug.js index 35b9827c1..01b8f9623 100644 --- a/modules/system/assets/js/snowboard/snowboard.base.debug.js +++ b/modules/system/assets/js/snowboard/snowboard.base.debug.js @@ -1,14 +1,10 @@ -import Snowboard from './main/Snowboard'; -import ProxyHandler from './main/ProxyHandler'; +import { Snowboard } from '@wintercms/snowboard'; ((window) => { - const snowboard = new Proxy( - new Snowboard(true, true), - ProxyHandler, - ); + const instance = new Snowboard(true); // Cover all aliases - window.snowboard = snowboard; - window.Snowboard = snowboard; - window.SnowBoard = snowboard; + window.snowboard = instance; + window.Snowboard = instance; + window.SnowBoard = instance; })(window); diff --git a/modules/system/assets/js/snowboard/snowboard.base.js b/modules/system/assets/js/snowboard/snowboard.base.js index 79249df2e..fde8d2e52 100644 --- a/modules/system/assets/js/snowboard/snowboard.base.js +++ b/modules/system/assets/js/snowboard/snowboard.base.js @@ -1,14 +1,10 @@ -import Snowboard from './main/Snowboard'; -import ProxyHandler from './main/ProxyHandler'; +import { Snowboard } from '@wintercms/snowboard'; ((window) => { - const snowboard = new Proxy( - new Snowboard(), - ProxyHandler, - ); + const instance = new Snowboard(); // Cover all aliases - window.snowboard = snowboard; - window.Snowboard = snowboard; - window.SnowBoard = snowboard; + window.snowboard = instance; + window.Snowboard = instance; + window.SnowBoard = instance; })(window); diff --git a/modules/system/assets/js/snowboard/snowboard.extras.js b/modules/system/assets/js/snowboard/snowboard.extras.js index 3276da004..298ce711e 100644 --- a/modules/system/assets/js/snowboard/snowboard.extras.js +++ b/modules/system/assets/js/snowboard/snowboard.extras.js @@ -5,16 +5,12 @@ import Transition from './extras/Transition'; import AttachLoading from './extras/AttachLoading'; import StripeLoader from './extras/StripeLoader'; import StylesheetLoader from './extras/StylesheetLoader'; -import AssetLoader from './extras/AssetLoader'; -import DataConfig from './extras/DataConfig'; if (window.Snowboard === undefined) { throw new Error('Snowboard must be loaded in order to use the extra plugins.'); } ((Snowboard) => { - Snowboard.addPlugin('assetLoader', AssetLoader); - Snowboard.addPlugin('dataConfig', DataConfig); Snowboard.addPlugin('extrasStyles', StylesheetLoader); Snowboard.addPlugin('transition', Transition); Snowboard.addPlugin('flash', Flash); diff --git a/modules/system/assets/js/snowboard/utilities/Cookie.js b/modules/system/assets/js/snowboard/utilities/Cookie.js deleted file mode 100644 index d5353e2da..000000000 --- a/modules/system/assets/js/snowboard/utilities/Cookie.js +++ /dev/null @@ -1,134 +0,0 @@ -import BaseCookie from 'js-cookie'; -import Singleton from '../abstracts/Singleton'; - -/** - * Cookie utility. - * - * This utility is a thin wrapper around the "js-cookie" library. - * - * @see https://github.com/js-cookie/js-cookie - * @copyright 2021 Winter. - * @author Ben Thomson - */ -export default class Cookie extends Singleton { - construct() { - this.defaults = { - expires: null, - path: '/', - domain: null, - secure: false, - sameSite: 'Lax', - }; - } - - /** - * Set the default cookie parameters for all subsequent "set" and "remove" calls. - * - * @param {Object} options - */ - setDefaults(options) { - if (typeof options !== 'object') { - throw new Error('Cookie defaults must be provided as an object'); - } - - Object.entries(options).forEach((entry) => { - const [key, value] = entry; - - if (this.defaults[key] !== undefined) { - this.defaults[key] = value; - } - }); - } - - /** - * Get the current default cookie parameters. - * - * @returns {Object} - */ - getDefaults() { - const defaults = {}; - - Object.entries(this.defaults).forEach((entry) => { - const [key, value] = entry; - - if (this.defaults[key] !== null) { - defaults[key] = value; - } - }); - - return defaults; - } - - /** - * Get a cookie by name. - * - * If `name` is undefined, returns all cookies as an Object. - * - * @param {String} name - * @returns {Object|String} - */ - get(name) { - if (name === undefined) { - const cookies = BaseCookie.get(); - - Object.entries(cookies).forEach((entry) => { - const [cookieName, cookieValue] = entry; - - this.snowboard.globalEvent('cookie.get', cookieName, cookieValue, (newValue) => { - cookies[cookieName] = newValue; - }); - }); - - return cookies; - } - - let value = BaseCookie.get(name); - - // Allow plugins to override the gotten value - this.snowboard.globalEvent('cookie.get', name, value, (newValue) => { - value = newValue; - }); - - return value; - } - - /** - * Set a cookie by name. - * - * You can specify additional cookie parameters through the "options" parameter. - * - * @param {String} name - * @param {String} value - * @param {Object} options - * @returns {String} - */ - set(name, value, options) { - let saveValue = value; - - // Allow plugins to override the value to save - this.snowboard.globalEvent('cookie.set', name, value, (newValue) => { - saveValue = newValue; - }); - - return BaseCookie.set(name, saveValue, { - ...this.getDefaults(), - ...options, - }); - } - - /** - * Remove a cookie by name. - * - * You can specify the additional cookie parameters via the "options" parameter. - * - * @param {String} name - * @param {Object} options - * @returns {void} - */ - remove(name, options) { - BaseCookie.remove(name, { - ...this.getDefaults(), - ...options, - }); - } -} diff --git a/modules/system/assets/js/snowboard/utilities/JsonParser.js b/modules/system/assets/js/snowboard/utilities/JsonParser.js deleted file mode 100644 index a1e79fbac..000000000 --- a/modules/system/assets/js/snowboard/utilities/JsonParser.js +++ /dev/null @@ -1,395 +0,0 @@ -import Singleton from '../abstracts/Singleton'; - -/** - * JSON Parser utility. - * - * This utility parses JSON-like data that does not strictly meet the JSON specifications in order to simplify development. - * It is a safe replacement for JSON.parse(JSON.stringify(eval("({" + value + "})"))) that does not require the use of eval() - * - * @author Ayumi Hamasaki - * @author Ben Thomson - * @see https://github.com/octobercms/october/pull/4527 - */ -export default class JsonParser extends Singleton { - construct() { - // Add to global function for backwards compatibility - window.wnJSON = (json) => this.parse(json); - window.ocJSON = window.wnJSON; - } - - parse(str) { - const jsonString = this.parseString(str); - return JSON.parse(jsonString); - } - - parseString(value) { - let str = value.trim(); - - if (!str.length) { - throw new Error('Broken JSON object.'); - } - - let result = ''; - let type = null; - let key = null; - let body = ''; - - /* - * the mistake ',' - */ - while (str && str[0] === ',') { - str = str.substr(1); - } - - /* - * string - */ - if (str[0] === '"' || str[0] === '\'') { - if (str[str.length - 1] !== str[0]) { - throw new Error('Invalid string JSON object.'); - } - - body = '"'; - for (let i = 1; i < str.length; i += 1) { - if (str[i] === '\\') { - if (str[i + 1] === '\'') { - body += str[i + 1]; - } else { - body += str[i]; - body += str[i + 1]; - } - i += 1; - } else if (str[i] === str[0]) { - body += '"'; - return body; - } else if (str[i] === '"') { - body += '\\"'; - } else { - body += str[i]; - } - } - - throw new Error('Invalid string JSON object.'); - } - - /* - * boolean - */ - if (str === 'true' || str === 'false') { - return str; - } - - /* - * null - */ - if (str === 'null') { - return 'null'; - } - - /* - * number - */ - const num = Number(str); - if (!Number.isNaN(num)) { - return num.toString(); - } - - /* - * object - */ - if (str[0] === '{') { - type = 'needKey'; - key = null; - result = '{'; - - for (let i = 1; i < str.length; i += 1) { - if (this.isBlankChar(str[i])) { - /* eslint-disable-next-line */ - continue; - } - if (type === 'needKey' && (str[i] === '"' || str[i] === '\'')) { - key = this.parseKey(str, i + 1, str[i]); - result += `"${key}"`; - i += key.length; - i += 1; - type = 'afterKey'; - } else if (type === 'needKey' && this.canBeKeyHead(str[i])) { - key = this.parseKey(str, i); - result += '"'; - result += key; - result += '"'; - i += key.length - 1; - type = 'afterKey'; - } else if (type === 'afterKey' && str[i] === ':') { - result += ':'; - type = ':'; - } else if (type === ':') { - body = this.getBody(str, i); - - i = i + body.originLength - 1; - result += this.parseString(body.body); - - type = 'afterBody'; - } else if (type === 'afterBody' || type === 'needKey') { - let last = i; - while (str[last] === ',' || this.isBlankChar(str[last])) { - last += 1; - } - if (str[last] === '}' && last === str.length - 1) { - while (result[result.length - 1] === ',') { - result = result.substr(0, result.length - 1); - } - result += '}'; - return result; - } - if (last !== i && result !== '{') { - result += ','; - type = 'needKey'; - i = last - 1; - } - } - } - - throw new Error(`Broken JSON object near ${result}`); - } - - /* - * array - */ - if (str[0] === '[') { - result = '['; - type = 'needBody'; - for (let i = 1; i < str.length; i += 1) { - if (str[i] === ' ' || str[i] === '\n' || str[i] === '\t') { - /* eslint-disable-next-line */ - continue; - } else if (type === 'needBody') { - if (str[i] === ',') { - result += 'null,'; - /* eslint-disable-next-line */ - continue; - } - if (str[i] === ']' && i === str.length - 1) { - if (result[result.length - 1] === ',') { - result = result.substr(0, result.length - 1); - } - result += ']'; - return result; - } - - body = this.getBody(str, i); - - i = i + body.originLength - 1; - result += this.parseString(body.body); - - type = 'afterBody'; - } else if (type === 'afterBody') { - if (str[i] === ',') { - result += ','; - type = 'needBody'; - - // deal with mistake "," - while (str[i + 1] === ',' || this.isBlankChar(str[i + 1])) { - if (str[i + 1] === ',') { - result += 'null,'; - } - i += 1; - } - } else if (str[i] === ']' && i === str.length - 1) { - result += ']'; - return result; - } - } - } - - throw new Error(`Broken JSON array near ${result}`); - } - - return ''; - } - - getBody(str, pos) { - let body = ''; - - // parse string body - if (str[pos] === '"' || str[pos] === '\'') { - body = str[pos]; - - for (let i = pos + 1; i < str.length; i += 1) { - if (str[i] === '\\') { - body += str[i]; - if (i + 1 < str.length) { - body += str[i + 1]; - } - i += 1; - } else if (str[i] === str[pos]) { - body += str[pos]; - return { - originLength: body.length, - body, - }; - } else { - body += str[i]; - } - } - - throw new Error(`Broken JSON string body near ${body}`); - } - - // parse true / false - if (str[pos] === 't') { - if (str.indexOf('true', pos) === pos) { - return { - originLength: 'true'.length, - body: 'true', - }; - } - - throw new Error(`Broken JSON boolean body near ${str.substr(0, pos + 10)}`); - } - if (str[pos] === 'f') { - if (str.indexOf('f', pos) === pos) { - return { - originLength: 'false'.length, - body: 'false', - }; - } - - throw new Error(`Broken JSON boolean body near ${str.substr(0, pos + 10)}`); - } - - // parse null - if (str[pos] === 'n') { - if (str.indexOf('null', pos) === pos) { - return { - originLength: 'null'.length, - body: 'null', - }; - } - - throw new Error(`Broken JSON boolean body near ${str.substr(0, pos + 10)}`); - } - - // parse number - if (str[pos] === '-' || str[pos] === '+' || str[pos] === '.' || (str[pos] >= '0' && str[pos] <= '9')) { - body = ''; - - for (let i = pos; i < str.length; i += 1) { - if (str[i] === '-' || str[i] === '+' || str[i] === '.' || (str[i] >= '0' && str[i] <= '9')) { - body += str[i]; - } else { - return { - originLength: body.length, - body, - }; - } - } - - throw new Error(`Broken JSON number body near ${body}`); - } - - // parse object - if (str[pos] === '{' || str[pos] === '[') { - const stack = [ - str[pos], - ]; - body = str[pos]; - - for (let i = pos + 1; i < str.length; i += 1) { - body += str[i]; - if (str[i] === '\\') { - if (i + 1 < str.length) { - body += str[i + 1]; - } - i += 1; - } else if (str[i] === '"') { - if (stack[stack.length - 1] === '"') { - stack.pop(); - } else if (stack[stack.length - 1] !== '\'') { - stack.push(str[i]); - } - } else if (str[i] === '\'') { - if (stack[stack.length - 1] === '\'') { - stack.pop(); - } else if (stack[stack.length - 1] !== '"') { - stack.push(str[i]); - } - } else if (stack[stack.length - 1] !== '"' && stack[stack.length - 1] !== '\'') { - if (str[i] === '{') { - stack.push('{'); - } else if (str[i] === '}') { - if (stack[stack.length - 1] === '{') { - stack.pop(); - } else { - throw new Error(`Broken JSON ${(str[pos] === '{' ? 'object' : 'array')} body near ${body}`); - } - } else if (str[i] === '[') { - stack.push('['); - } else if (str[i] === ']') { - if (stack[stack.length - 1] === '[') { - stack.pop(); - } else { - throw new Error(`Broken JSON ${(str[pos] === '{' ? 'object' : 'array')} body near ${body}`); - } - } - } - if (!stack.length) { - return { - originLength: i - pos, - body, - }; - } - } - - throw new Error(`Broken JSON ${(str[pos] === '{' ? 'object' : 'array')} body near ${body}`); - } - - throw new Error(`Broken JSON body near ${str.substr((pos - 5 >= 0) ? pos - 5 : 0, 50)}`); - } - - parseKey(str, pos, quote) { - let key = ''; - - for (let i = pos; i < str.length; i += 1) { - if (quote && quote === str[i]) { - return key; - } - if (!quote && (str[i] === ' ' || str[i] === ':')) { - return key; - } - - key += str[i]; - - if (str[i] === '\\' && i + 1 < str.length) { - key += str[i + 1]; - i += 1; - } - } - - throw new Error(`Broken JSON syntax near ${key}`); - } - - canBeKeyHead(ch) { - if (ch[0] === '\\') { - return false; - } - if ((ch[0] >= 'a' && ch[0] <= 'z') || (ch[0] >= 'A' && ch[0] <= 'Z') || ch[0] === '_') { - return true; - } - if (ch[0] >= '0' && ch[0] <= '9') { - return true; - } - if (ch[0] === '$') { - return true; - } - if (ch.charCodeAt(0) > 255) { - return true; - } - - return false; - } - - isBlankChar(ch) { - return ch === ' ' || ch === '\n' || ch === '\t'; - } -} diff --git a/modules/system/assets/js/snowboard/utilities/Sanitizer.js b/modules/system/assets/js/snowboard/utilities/Sanitizer.js deleted file mode 100644 index 32ca06339..000000000 --- a/modules/system/assets/js/snowboard/utilities/Sanitizer.js +++ /dev/null @@ -1,64 +0,0 @@ -import Singleton from '../abstracts/Singleton'; - -/** - * Sanitizer utility. - * - * Client-side HTML sanitizer designed mostly to prevent self-XSS attacks. - * The sanitizer utility will strip all attributes that start with `on` (usually JS event handlers as attributes, i.e. `onload` or `onerror`) or contain the `javascript:` pseudo protocol in their values. - * - * @author Ben Thomson - */ -export default class Sanitizer extends Singleton { - construct() { - // Add to global function for backwards compatibility - window.wnSanitize = (html) => this.sanitize(html); - window.ocSanitize = window.wnSanitize; - } - - sanitize(html, bodyOnly) { - const parser = new DOMParser(); - const dom = parser.parseFromString(html, 'text/html'); - const returnBodyOnly = (bodyOnly !== undefined && typeof bodyOnly === 'boolean') - ? bodyOnly - : true; - - this.sanitizeNode(dom.getRootNode()); - - return (returnBodyOnly) ? dom.body.innerHTML : dom.innerHTML; - } - - sanitizeNode(node) { - if (node.tagName === 'SCRIPT') { - node.remove(); - return; - } - - this.trimAttributes(node); - - const children = Array.from(node.children); - - children.forEach((child) => { - this.sanitizeNode(child); - }); - } - - trimAttributes(node) { - if (!node.attributes) { - return; - } - - for (let i = 0; i < node.attributes.length; i += 1) { - const attrName = node.attributes.item(i).name; - const attrValue = node.attributes.item(i).value; - - /* - * remove attributes where the names start with "on" (for example: onload, onerror...) - * remove attributes where the value starts with the "javascript:" pseudo protocol (for example href="javascript:alert(1)") - */ - /* eslint-disable-next-line */ - if (attrName.indexOf('on') === 0 || attrValue.indexOf('javascript:') === 0) { - node.removeAttribute(attrName); - } - } - } -} diff --git a/modules/system/assets/js/snowboard/utilities/Url.js b/modules/system/assets/js/snowboard/utilities/Url.js deleted file mode 100644 index 76f6331b3..000000000 --- a/modules/system/assets/js/snowboard/utilities/Url.js +++ /dev/null @@ -1,165 +0,0 @@ -import Singleton from '../abstracts/Singleton'; - -/** - * URL utility. - * - * This utility provides URL functions. - * - * @copyright 2022 Winter. - * @author Ben Thomson - */ -export default class Url extends Singleton { - construct() { - this.foundBaseUrl = null; - this.foundAssetUrl = null; - this.baseUrl(); - this.assetUrl(); - } - - /** - * Gets a URL based on a relative path. - * - * If an absolute URL is provided, it will be returned unchanged. - * - * @param {string} url - * @returns {string} - */ - to(url) { - const urlRegex = /^(?:[^:]+:\/\/)[-a-z0-9@:%._+~#=]{1,256}\b([-a-z0-9()@:%_+.~#?&//=]*)/i; - - if (url.match(urlRegex)) { - return url; - } - - const theUrl = url.replace(/^\/+/, ''); - - return `${this.baseUrl()}${theUrl}`; - } - - /** - * Gets an Asset URL based on a relative path. - * - * If an absolute URL is provided, it will be returned unchanged. - * - * @param {string} url - * @returns {string} - */ - asset(url) { - const urlRegex = /^(?:[^:]+:\/\/)[-a-z0-9@:%._+~#=]{1,256}\b([-a-z0-9()@:%_+.~#?&//=]*)/i; - - if (url.match(urlRegex)) { - return url; - } - - const theUrl = url.replace(/^\/+/, ''); - - return `${this.assetUrl()}${theUrl}`; - } - - /** - * Helper method to get the base URL of this install. - * - * This determines the base URL from three sources, in order: - * - If Snowboard is loaded via the `{% snowboard %}` tag, it will retrieve the base URL that - * is automatically included there. - * - If a `` tag is available, it will use the URL specified in the base tag. - * - Finally, it will take a guess from the current location. This will likely not work for sites - * that reside in subdirectories. - * - * The base URL will always contain a trailing backslash. - * - * @returns {string} - */ - baseUrl() { - if (this.foundBaseUrl !== null) { - return this.foundBaseUrl; - } - - if (document.querySelector('script[data-module="snowboard-base"]') !== null) { - this.foundBaseUrl = this.validateBaseUrl(document.querySelector('script[data-module="snowboard-base"]').dataset.baseUrl); - return this.foundBaseUrl; - } - - if (document.querySelector('base') !== null) { - this.foundBaseUrl = this.validateBaseUrl(document.querySelector('base').getAttribute('href')); - return this.foundBaseUrl; - } - - const urlParts = [ - window.location.protocol, - '//', - window.location.host, - '/', - ]; - this.foundBaseUrl = urlParts.join(''); - - return this.foundBaseUrl; - } - - /** - * Helper method to get the asset URL of this install. - * - * This determines the base URL from three sources, in order: - * - If Snowboard is loaded via the `{% snowboard %}` tag, it will retrieve the asset URL that - * is automatically included there. - * - If a `` tag is available, it will use the URL specified in the link tag. - * - Finally, it will take a guess from the current location. This will likely not work for sites - * that reside in subdirectories. - * - * The asset URL will always contain a trailing backslash. - * - * @returns {string} - */ - assetUrl() { - if (this.foundAssetUrl !== null) { - return this.foundAssetUrl; - } - - if (document.querySelector('script[data-module="snowboard-base"]') !== null) { - this.foundAssetUrl = this.validateBaseUrl(document.querySelector('script[data-module="snowboard-base"]').dataset.assetUrl); - return this.foundAssetUrl; - } - - if (document.querySelector('link[rel="asset_url"]') !== null) { - this.foundAssetUrl = this.validateBaseUrl(document.querySelector('link[rel="asset_url"]').getAttribute('href')); - return this.foundAssetUrl; - } - - const urlParts = [ - window.location.protocol, - '//', - window.location.host, - '/', - ]; - this.foundAssetUrl = urlParts.join(''); - - return this.foundAssetUrl; - } - - /** - * Validates the base URL, ensuring it is a HTTP/HTTPs URL. - * - * If the Snowboard script or tag on the page use a different type of URL, this will fail with - * an error. - * - * @param {string} url - * @returns {string} - */ - validateBaseUrl(url) { - const urlRegex = /^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/i; - const urlParts = urlRegex.exec(url); - const protocol = urlParts[2]; - const domain = urlParts[4]; - - if (protocol && ['http', 'https'].indexOf(protocol.toLowerCase()) === -1) { - throw new Error('Invalid base URL detected'); - } - if (!domain) { - throw new Error('Invalid base URL detected'); - } - - return (url.substr(-1) === '/') - ? url - : `${url}/`; - } -} diff --git a/modules/system/package.json b/modules/system/package.json index 23bdf3fcf..095a8813d 100644 --- a/modules/system/package.json +++ b/modules/system/package.json @@ -27,6 +27,7 @@ "test": "jest --config tests/js/jest.config.js tests/js/cases" }, "dependencies": { + "@wintercms/snowboard": "^0.2.1", "js-cookie": "^3.0.1" }, "devDependencies": { diff --git a/modules/system/tests/js/cases/snowboard/extras/DataConfig.test.js b/modules/system/tests/js/cases/snowboard/extras/DataConfig.test.js deleted file mode 100644 index 7f6a64224..000000000 --- a/modules/system/tests/js/cases/snowboard/extras/DataConfig.test.js +++ /dev/null @@ -1,316 +0,0 @@ -import FakeDom from '../../../helpers/FakeDom'; - -jest.setTimeout(2000); - -describe('The Data Config extra functionality', function () { - it('can read the config from an element\'s data attributes', function (done) { - FakeDom - .new() - .addCss([ - 'modules/system/assets/css/snowboard.extras.css', - ]) - .addScript([ - 'modules/system/assets/js/build/manifest.js', - 'modules/system/assets/js/snowboard/build/snowboard.vendor.js', - 'modules/system/assets/js/snowboard/build/snowboard.base.js', - 'modules/system/assets/js/snowboard/build/snowboard.extras.js', - 'modules/system/tests/js/fixtures/dataConfig/DataConfigFixture.js', - ]) - .render( - `
- -
` - ) - .then( - (dom) => { - const instance = dom.window.Snowboard.dataConfigFixture( - dom.window.document.querySelector('#testElement') - ); - - try { - expect(instance.config.get('id')).toEqual(389); - // Name should be null as it's the default value and not specified above - expect(instance.config.get('name')).toBeNull(); - expect(instance.config.get('stringValue')).toBe('Hi there'); - // Missing should be undefined as it's neither defined nor part of the default data - expect(instance.config.get('missing')).toBeUndefined(); - expect(instance.config.get('boolean')).toBe(true); - - expect(instance.config.get()).toMatchObject({ - id: 389, - name: null, - stringValue: 'Hi there', - boolean: true, - base64: null, - }); - } catch (error) { - done(error); - return; - } - - const instanceTwo = dom.window.Snowboard.dataConfigFixture( - dom.window.document.querySelector('#testElementTwo') - ); - - try { - // ID is null as it's the default value and not specified above - expect(instanceTwo.config.get('id')).toBeNull(); - expect(instanceTwo.config.get('name')).toBe('Ben'); - expect(instanceTwo.config.get('stringValue')).toBe('Hi there again'); - expect(instanceTwo.config.get('missing')).toBeUndefined(); - expect(instanceTwo.config.get('boolean')).toBe(false); - // Extra attr is specified above, but it should not be available as a config value - // because it's not part of the `defaults()` in the fixture - expect(instanceTwo.config.get('extraAttr')).toBeUndefined(); - // Base-64 decoded string - expect(instanceTwo.config.get('base64')).toBe('I\'m a Base64-decoded string'); - - done(); - } catch (error) { - done(error); - } - } - ); - }); - - it('can read the config from every data attribute of an element with "acceptAllDataConfigs" enabled', function (done) { - FakeDom - .new() - .addCss([ - 'modules/system/assets/css/snowboard.extras.css', - ]) - .addScript([ - 'modules/system/assets/js/build/manifest.js', - 'modules/system/assets/js/snowboard/build/snowboard.vendor.js', - 'modules/system/assets/js/snowboard/build/snowboard.base.js', - 'modules/system/assets/js/snowboard/build/snowboard.extras.js', - 'modules/system/tests/js/fixtures/dataConfig/DataConfigFixture.js', - ]) - .render( - `
` - ) - .then( - (dom) => { - const instance = dom.window.Snowboard.dataConfigFixture( - dom.window.document.querySelector('#testElementTwo') - ); - instance.acceptAllDataConfigs = true; - instance.config.refresh(); - - try { - // ID is null as it's the default value and not specified above - expect(instance.config.get('id')).toBeNull(); - expect(instance.config.get('name')).toBe('Ben'); - expect(instance.config.get('stringValue')).toBe('Hi there again'); - expect(instance.config.get('missing')).toBeUndefined(); - expect(instance.config.get('boolean')).toBe(false); - // These attributes below are specified above, and although they're not part of the - // defaults, they should be available because "acceptAllDataConfigs" is true - expect(instance.config.get('extraAttr')).toBe('This should now be available'); - expect(instance.config.get('json')).toMatchObject({ - name: 'Ben' - }); - expect(instance.config.get('anotherBase64')).toBe(true); - expect(instance.config.get('jsonBase64')).toMatchObject({ - id: 1, - title: 'Some title', - }); - - expect(instance.config.get()).toMatchObject({ - id: null, - name: 'Ben', - stringValue: 'Hi there again', - boolean: false, - extraAttr: 'This should now be available', - json: { - name: 'Ben', - }, - anotherBase64: true, - jsonBase64: { - id: 1, - title: 'Some title', - }, - }); - - done(); - } catch (error) { - done(error); - } - } - ); - }); - - it('can refresh the config from the data attributes on the fly', function (done) { - FakeDom - .new() - .addCss([ - 'modules/system/assets/css/snowboard.extras.css', - ]) - .addScript([ - 'modules/system/assets/js/build/manifest.js', - 'modules/system/assets/js/snowboard/build/snowboard.vendor.js', - 'modules/system/assets/js/snowboard/build/snowboard.base.js', - 'modules/system/assets/js/snowboard/build/snowboard.extras.js', - 'modules/system/tests/js/fixtures/dataConfig/DataConfigFixture.js', - ]) - .render( - `
` - ) - .then( - (dom) => { - const instance = dom.window.Snowboard.dataConfigFixture( - dom.window.document.querySelector('#testElement') - ); - - try { - expect(instance.config.get('id')).toBeNull(); - expect(instance.config.get('name')).toBe('Ben'); - expect(instance.config.get('stringValue')).toBe('Hi there again'); - expect(instance.config.get('boolean')).toBe(false); - - expect(instance.config.get()).toMatchObject({ - id: null, - name: 'Ben', - stringValue: 'Hi there again', - boolean: false, - }); - - dom.window.document.querySelector('#testElement').setAttribute('data-id', '456'); - dom.window.document.querySelector('#testElement').setAttribute('data-string-value', 'Changed'); - dom.window.document.querySelector('#testElement').removeAttribute('data-boolean'); - - // Refresh config - instance.config.refresh(); - - expect(instance.config.get('id')).toBe(456); - expect(instance.config.get('name')).toBe('Ben'); - expect(instance.config.get('stringValue')).toBe('Changed'); - expect(instance.config.get('boolean')).toBeNull(); - - expect(instance.config.get()).toMatchObject({ - id: 456, - name: 'Ben', - stringValue: 'Changed', - boolean: null, - }); - - done(); - } catch (error) { - done(error); - } - } - ); - }); - - it('can set config values at runtime', function (done) { - FakeDom - .new() - .addCss([ - 'modules/system/assets/css/snowboard.extras.css', - ]) - .addScript([ - 'modules/system/assets/js/build/manifest.js', - 'modules/system/assets/js/snowboard/build/snowboard.vendor.js', - 'modules/system/assets/js/snowboard/build/snowboard.base.js', - 'modules/system/assets/js/snowboard/build/snowboard.extras.js', - 'modules/system/tests/js/fixtures/dataConfig/DataConfigFixture.js', - ]) - .render( - `
` - ) - .then( - (dom) => { - const instance = dom.window.Snowboard.dataConfigFixture( - dom.window.document.querySelector('#testElement') - ); - - try { - expect(instance.config.get('name')).toBe('Ben'); - // Set config - instance.config.set('name', 'Luke'); - expect(instance.config.get('name')).toBe('Luke'); - // Refresh config - instance.config.refresh(); - expect(instance.config.get('name')).toBe('Ben'); - done(); - } catch (error) { - done(error); - } - } - ); - }); - - it('can set config values at runtime that persist through a reset', function (done) { - FakeDom - .new() - .addCss([ - 'modules/system/assets/css/snowboard.extras.css', - ]) - .addScript([ - 'modules/system/assets/js/build/manifest.js', - 'modules/system/assets/js/snowboard/build/snowboard.vendor.js', - 'modules/system/assets/js/snowboard/build/snowboard.base.js', - 'modules/system/assets/js/snowboard/build/snowboard.extras.js', - 'modules/system/tests/js/fixtures/dataConfig/DataConfigFixture.js', - ]) - .render( - `
` - ) - .then( - (dom) => { - const instance = dom.window.Snowboard.dataConfigFixture( - dom.window.document.querySelector('#testElement') - ); - - try { - expect(instance.config.get('name')).toBe('Ben'); - // Set config - instance.config.set('name', 'Luke', true); - expect(instance.config.get('name')).toBe('Luke'); - // Refresh config - instance.config.refresh(); - expect(instance.config.get('name')).toBe('Luke'); - done(); - } catch (error) { - done(error); - } - } - ); - }); -}); diff --git a/modules/system/tests/js/cases/snowboard/main/PluginLoader.test.js b/modules/system/tests/js/cases/snowboard/main/PluginLoader.test.js deleted file mode 100644 index b4ff49389..000000000 --- a/modules/system/tests/js/cases/snowboard/main/PluginLoader.test.js +++ /dev/null @@ -1,134 +0,0 @@ -import FakeDom from '../../../helpers/FakeDom'; - -describe('PluginLoader class', function () { - it('can mock plugin methods', function (done) { - FakeDom - .new() - .addScript([ - 'modules/system/assets/js/build/manifest.js', - 'modules/system/assets/js/snowboard/build/snowboard.vendor.js', - 'modules/system/assets/js/snowboard/build/snowboard.base.js' - ]) - .render() - .then( - (dom) => { - dom.window.Snowboard.getPlugin('sanitizer').mock('sanitize', () => { - return 'all good'; - }); - - expect( - dom.window.Snowboard.sanitizer().sanitize('

') - ).toEqual('all good'); - - // Test unmock - dom.window.Snowboard.getPlugin('sanitizer').unmock('sanitize'); - - expect( - dom.window.Snowboard.sanitizer().sanitize('

') - ).toEqual('

'); - - done(); - }, - (error) => { - done(error); - } - ); - }); - - it('is frozen on construction and doesn\'t allow prototype pollution', function () { - FakeDom - .new() - .addScript([ - 'modules/system/assets/js/build/manifest.js', - 'modules/system/assets/js/snowboard/build/snowboard.vendor.js', - 'modules/system/assets/js/snowboard/build/snowboard.base.js', - ]) - .render() - .then( - (dom) => { - const loader = dom.window.Snowboard.getPlugin('sanitizer'); - - expect(() => { - loader.newMethod = () => { - return true; - }; - }).toThrow(TypeError); - - expect(() => { - loader.newProperty = 'test'; - }).toThrow(TypeError); - - expect(() => { - loader.singleton.test = 'test'; - }).toThrow(TypeError); - - expect(loader.newMethod).toBeUndefined(); - expect(loader.newProperty).toBeUndefined(); - }, - (error) => { - throw error; - } - ); - }); - - it('should prevent modification of root instances', function () { - FakeDom - .new() - .addScript([ - 'modules/system/assets/js/build/manifest.js', - 'modules/system/assets/js/snowboard/build/snowboard.vendor.js', - 'modules/system/assets/js/snowboard/build/snowboard.base.js', - 'modules/system/tests/js/fixtures/framework/TestPlugin.js', - 'modules/system/tests/js/fixtures/framework/TestSingleton.js', - ]) - .render() - .then( - (dom) => { - const rootInstance = dom.window.Snowboard.getPlugin('testPlugin').instance; - - expect(() => { - rootInstance.newMethod = () => { - return true; - } - }).toThrow(TypeError); - - expect(rootInstance.newMethod).toBeUndefined(); - - // Modifications can however be made to instances retrieved from the loader - const loadedInstance = dom.window.Snowboard.getPlugin('testPlugin').getInstance(); - - loadedInstance.newMethod = () => { - return true; - }; - expect(loadedInstance.newMethod).toEqual(expect.any(Function)); - expect(loadedInstance.newMethod()).toBe(true); - - // But shouldn't follow through to new instances - const loadedInstanceTwo = dom.window.Snowboard.getPlugin('testPlugin').getInstance(); - expect(loadedInstanceTwo.newMethod).toBeUndefined(); - - // The same rules apply for singletons, except that modifications will follow through to other uses - // of the singleton, since it's only one global instance. - const rootSingleton = dom.window.Snowboard.getPlugin('testSingleton').instance; - - expect(() => { - rootSingleton.newMethod = () => { - return true; - } - }).toThrow(TypeError); - - const loadedSingleton = dom.window.Snowboard.getPlugin('testSingleton').getInstance(); - - loadedSingleton.newMethod = () => { - return true; - }; - expect(loadedSingleton.newMethod).toEqual(expect.any(Function)); - expect(loadedSingleton.newMethod()).toBe(true); - - const loadedSingletonTwo = dom.window.Snowboard.getPlugin('testSingleton').getInstance(); - expect(loadedSingletonTwo.newMethod).toEqual(expect.any(Function)); - expect(loadedSingletonTwo.newMethod()).toBe(true); - } - ); - }); -}); diff --git a/modules/system/tests/js/cases/snowboard/main/Snowboard.test.js b/modules/system/tests/js/cases/snowboard/main/Snowboard.test.js deleted file mode 100644 index e40a6aef3..000000000 --- a/modules/system/tests/js/cases/snowboard/main/Snowboard.test.js +++ /dev/null @@ -1,620 +0,0 @@ -import FakeDom from '../../../helpers/FakeDom'; - -describe('Snowboard framework', function () { - it('initialises correctly', function (done) { - FakeDom - .new() - .addScript([ - 'modules/system/assets/js/build/manifest.js', - 'modules/system/assets/js/snowboard/build/snowboard.vendor.js', - 'modules/system/assets/js/snowboard/build/snowboard.base.js', - ]) - .render() - .then( - (dom) => { - // Run assertions - try { - expect(dom.window.Snowboard).toBeDefined(); - expect(dom.window.Snowboard.addPlugin).toBeDefined(); - expect(dom.window.Snowboard.addPlugin).toEqual(expect.any(Function)); - - // Check PluginBase and Singleton abstracts exist - expect(dom.window.Snowboard.PluginBase).toBeDefined(); - expect(dom.window.Snowboard.Singleton).toBeDefined(); - - // Check in-built plugins - expect(dom.window.Snowboard.getPluginNames()).toEqual( - expect.arrayContaining(['jsonparser', 'sanitizer']) - ); - expect(dom.window.Snowboard.getPlugin('jsonparser').isFunction()).toEqual(false); - expect(dom.window.Snowboard.getPlugin('jsonparser').isSingleton()).toEqual(true); - expect(dom.window.Snowboard.getPlugin('sanitizer').isFunction()).toEqual(false); - expect(dom.window.Snowboard.getPlugin('sanitizer').isSingleton()).toEqual(true); - - done(); - } catch (error) { - done(error); - } - }, - (error) => { - throw error; - } - ); - }); - - it('is frozen on construction and doesn\'t allow prototype pollution', function () { - FakeDom - .new() - .addScript([ - 'modules/system/assets/js/build/manifest.js', - 'modules/system/assets/js/snowboard/build/snowboard.vendor.js', - 'modules/system/assets/js/snowboard/build/snowboard.base.js', - 'modules/system/tests/js/fixtures/framework/TestPlugin.js', - ]) - .render() - .then( - (dom) => { - expect(() => { - dom.window.Snowboard.newMethod = () => { - return true; - }; - }).toThrow(TypeError); - - expect(() => { - dom.window.Snowboard.newProperty = 'test'; - }).toThrow(TypeError); - - expect(() => { - dom.window.Snowboard.readiness.test = 'test'; - }).toThrow(TypeError); - - expect(dom.window.Snowboard.newMethod).toBeUndefined(); - expect(dom.window.Snowboard.newProperty).toBeUndefined(); - - // You should not be able to modify the Snowboard object fed to plugins either - const instance = dom.window.Snowboard.testPlugin(); - expect(() => { - instance.snowboard.newMethod = () => { - return true; - }; - }).toThrow(TypeError); - }, - (error) => { - throw error; - } - ); - }); - - it('can add and remove a plugin', function (done) { - FakeDom - .new() - .addScript([ - 'modules/system/assets/js/build/manifest.js', - 'modules/system/assets/js/snowboard/build/snowboard.vendor.js', - 'modules/system/assets/js/snowboard/build/snowboard.base.js', - 'modules/system/tests/js/fixtures/framework/TestPlugin.js', - ]) - .render() - .then( - (dom) => { - // Run assertions - const Snowboard = dom.window.Snowboard; - - try { - // Check plugin caller - expect('testPlugin' in Snowboard).toEqual(true); - expect('testSingleton' in Snowboard).toEqual(false); - - expect(Snowboard.hasPlugin('testPlugin')).toBe(true); - expect(Snowboard.getPluginNames()).toEqual( - expect.arrayContaining(['jsonparser', 'sanitizer', 'testplugin']) - ); - - const instance = Snowboard.testPlugin(); - - // Check plugin injected methods - expect(instance.snowboard).toBeDefined(); - expect(instance.snowboard.getPlugin).toEqual(expect.any(Function)); - expect(() => { - const method = instance.snowboard.initialise; - }).toThrow('cannot use'); - expect(instance.destructor).toEqual(expect.any(Function)); - - // Check plugin method - expect(instance.testMethod).toBeDefined(); - expect(instance.testMethod).toEqual(expect.any(Function)); - expect(instance.testMethod()).toEqual('Tested'); - - // Check multiple instances - const instanceOne = Snowboard.testPlugin(); - instanceOne.changed = true; - const instanceTwo = Snowboard.testPlugin(); - expect(instanceOne).not.toEqual(instanceTwo); - const factory = Snowboard.getPlugin('testPlugin'); - expect(factory.getInstances()).toEqual([instance, instanceOne, instanceTwo]); - - // Remove plugin - Snowboard.removePlugin('testPlugin'); - expect(Snowboard.hasPlugin('testPlugin')).toEqual(false); - expect(dom.window.Snowboard.getPluginNames()).toEqual( - expect.arrayContaining(['jsonparser', 'sanitizer']) - ); - expect(Snowboard.testPlugin).not.toBeDefined(); - - done(); - } catch (error) { - done(error); - } - }, - (error) => { - throw error; - } - ); - }); - - it('can add and remove a singleton', function (done) { - FakeDom - .new() - .addScript([ - 'modules/system/assets/js/build/manifest.js', - 'modules/system/assets/js/snowboard/build/snowboard.vendor.js', - 'modules/system/assets/js/snowboard/build/snowboard.base.js', - 'modules/system/tests/js/fixtures/framework/TestSingleton.js', - ]) - .render() - .then( - (dom) => { - // Run assertions - const Snowboard = dom.window.Snowboard; - - try { - expect('testPlugin' in Snowboard).toEqual(false); - expect('testSingleton' in Snowboard).toEqual(true); - - // Check plugin caller - expect(Snowboard.hasPlugin('testSingleton')).toBe(true); - expect(Snowboard.getPluginNames()).toEqual( - expect.arrayContaining(['jsonparser', 'sanitizer', 'testsingleton']) - ); - expect(Snowboard.testSingleton).toEqual(expect.any(Function)); - - const instance = Snowboard.testSingleton(); - - // Check plugin injected methods - expect(instance.snowboard).toBeDefined(); - expect(instance.snowboard.getPlugin).toEqual(expect.any(Function)); - expect(() => { - const method = instance.snowboard.initialise; - }).toThrow('cannot use'); - expect(instance.destructor).toEqual(expect.any(Function)); - - // Check plugin method - expect(instance.testMethod).toBeDefined(); - expect(instance.testMethod).toEqual(expect.any(Function)); - expect(instance.testMethod()).toEqual('Tested'); - - // Check multiple instances (these should all be the same as this instance is a singleton) - const instanceOne = Snowboard.testSingleton(); - instanceOne.changed = true; - const instanceTwo = Snowboard.testSingleton(); - expect(instanceOne).toEqual(instanceTwo); - const factory = Snowboard.getPlugin('testSingleton'); - expect(factory.getInstances()).toEqual([instance]); - - // Remove plugin - Snowboard.removePlugin('testSingleton'); - expect(Snowboard.hasPlugin('testSingleton')).toEqual(false); - expect(dom.window.Snowboard.getPluginNames()).toEqual( - expect.arrayContaining([ 'jsonparser', 'sanitizer']) - ); - expect(Snowboard.testSingleton).not.toBeDefined(); - - done(); - } catch (error) { - done(error); - } - }, - (error) => { - throw error; - } - ); - }); - - it('can listen and call global events', function (done) { - FakeDom - .new() - .addScript([ - 'modules/system/assets/js/build/manifest.js', - 'modules/system/assets/js/snowboard/build/snowboard.vendor.js', - 'modules/system/assets/js/snowboard/build/snowboard.base.js', - 'modules/system/tests/js/fixtures/framework/TestListener.js', - ]) - .render() - .then( - (dom) => { - // Run assertions - const Snowboard = dom.window.Snowboard; - - try { - expect(Snowboard.listensToEvent('eventOne')).toEqual(['test']); - expect(Snowboard.listensToEvent('eventTwo')).toEqual(['test']); - expect(Snowboard.listensToEvent('eventThree')).toEqual([]); - - // Call global event one - const testClass = Snowboard.test(); - Snowboard.globalEvent('eventOne', 42); - expect(testClass.eventResult).toEqual('Event called with arg 42'); - - // Call global event two - should fail as the test plugin doesn't have that method - expect(() => { - Snowboard.globalEvent('eventTwo'); - }).toThrow('Missing "notExists" method in "test" plugin'); - - // Call global event three - nothing should happen - expect(() => { - Snowboard.globalEvent('eventThree'); - }).not.toThrow(); - - done(); - } catch (error) { - done(error); - } - }, - (error) => { - throw error; - } - ); - }); - - it('can listen and call global events that are simple closures', function (done) { - FakeDom - .new() - .addScript([ - 'modules/system/assets/js/build/manifest.js', - 'modules/system/assets/js/snowboard/build/snowboard.vendor.js', - 'modules/system/assets/js/snowboard/build/snowboard.base.js', - 'modules/system/tests/js/fixtures/framework/TestClosureListener.js', - ]) - .render() - .then( - (dom) => { - // Run assertions - const Snowboard = dom.window.Snowboard; - - try { - expect(Snowboard.listensToEvent('eventOne')).toEqual(['testclosure']); - expect(Snowboard.listensToEvent('eventTwo')).toEqual(['testclosure']); - expect(Snowboard.listensToEvent('eventThree')).toEqual([]); - - // Call global event one - const testClass = Snowboard.testClosure(); - Snowboard.globalEvent('eventOne'); - expect(testClass.eventResult).toEqual('Closure eventOne called'); - - // Call global event two - should fail as the test plugin doesn't have that method - Snowboard.globalEvent('eventTwo', 42); - expect(testClass.eventResult).toEqual('Closure eventTwo called with arg \'42\''); - - // Call global event three - nothing should happen - expect(() => { - Snowboard.globalEvent('eventThree'); - }).not.toThrow(); - - done(); - } catch (error) { - done(error); - } - }, - (error) => { - throw error; - } - ); - }); - - it('can listen and call global promise events', function (done) { - FakeDom - .new() - .addScript([ - 'modules/system/assets/js/build/manifest.js', - 'modules/system/assets/js/snowboard/build/snowboard.vendor.js', - 'modules/system/assets/js/snowboard/build/snowboard.base.js', - 'modules/system/tests/js/fixtures/framework/TestPromiseListener.js', - ]) - .render() - .then( - (dom) => { - // Run assertions - const Snowboard = dom.window.Snowboard; - - try { - expect(Snowboard.listensToEvent('promiseOne')).toEqual(['test']); - expect(Snowboard.listensToEvent('promiseTwo')).toEqual(['test']); - expect(Snowboard.listensToEvent('promiseThree')).toEqual([]); - - // Call global event one - const testClass = Snowboard.test(); - Snowboard.globalPromiseEvent('promiseOne', 'promise').then( - () => { - expect(testClass.eventResult).toEqual('Event called with arg promise'); - - // Call global event two - it should still work, even though it doesn't return a promise - Snowboard.globalPromiseEvent('promiseTwo', 'promise 2').then( - () => { - expect(testClass.eventResult).toEqual('Promise two called with arg promise 2'); - - // Call global event three - it should still work - Snowboard.globalPromiseEvent('promiseThree', 'promise 3').then( - () => { - done(); - }, - (error) => { - done(error); - } - ); - }, - (error) => { - done(error); - } - ); - }, - (error) => { - done(error); - } - ); - } catch (error) { - done(error); - } - }, - (error) => { - throw error; - } - ); - }); - - it('can listen and call global promise events that are simple closures', function (done) { - FakeDom - .new() - .addScript([ - 'modules/system/assets/js/build/manifest.js', - 'modules/system/assets/js/snowboard/build/snowboard.vendor.js', - 'modules/system/assets/js/snowboard/build/snowboard.base.js', - 'modules/system/tests/js/fixtures/framework/TestPromiseClosureListener.js', - ]) - .render() - .then( - (dom) => { - // Run assertions - const Snowboard = dom.window.Snowboard; - - try { - expect(Snowboard.listensToEvent('promiseOne')).toEqual(['testclosure']); - expect(Snowboard.listensToEvent('promiseTwo')).toEqual(['testclosure']); - expect(Snowboard.listensToEvent('promiseThree')).toEqual([]); - - // Call global event one - const testClass = Snowboard.testClosure(); - Snowboard.globalPromiseEvent('promiseOne', 'promise').then( - () => { - expect(testClass.eventResult).toEqual('Event called with arg promise'); - - // Call global event two - it should still work, even though it doesn't return a promise - Snowboard.globalPromiseEvent('promiseTwo', 'promise 2').then( - () => { - expect(testClass.eventResult).toEqual('Promise two called with arg promise 2'); - - // Call global event three - it should still work - Snowboard.globalPromiseEvent('promiseThree', 'promise 3').then( - () => { - done(); - }, - (error) => { - done(error); - } - ); - }, - (error) => { - done(error); - } - ); - }, - (error) => { - done(error); - } - ); - } catch (error) { - done(error); - } - }, - (error) => { - throw error; - } - ); - }); - - - it('will throw an error when using a plugin that has unfulfilled dependencies', function () { - FakeDom - .new() - .addScript([ - 'modules/system/assets/js/build/manifest.js', - 'modules/system/assets/js/snowboard/build/snowboard.vendor.js', - 'modules/system/assets/js/snowboard/build/snowboard.base.js', - 'modules/system/tests/js/fixtures/framework/TestHasDependencies.js', - ]) - .render() - .then( - (dom) => { - // Run assertions - const Snowboard = dom.window.Snowboard; - - expect(() => { - Snowboard.testHasDependencies(); - }).toThrow('The "testhasdependencies" plugin requires the following plugins: testdependencyone, testdependencytwo'); - }, - (error) => { - throw error; - } - ); - }); - - it('will throw an error when using a plugin that has some unfulfilled dependencies', function () { - FakeDom - .new() - .addScript([ - 'modules/system/assets/js/build/manifest.js', - 'modules/system/assets/js/snowboard/build/snowboard.vendor.js', - 'modules/system/assets/js/snowboard/build/snowboard.base.js', - 'modules/system/tests/js/fixtures/framework/TestHasDependencies.js', - 'modules/system/tests/js/fixtures/framework/TestDependencyOne.js', - ]) - .render() - .then( - (dom) => { - // Run assertions - const Snowboard = dom.window.Snowboard; - - expect(() => { - Snowboard.testHasDependencies(); - }).toThrow('The "testhasdependencies" plugin requires the following plugins: testdependencytwo'); - }, - (error) => { - throw error; - } - ); - }); - - it('will not throw an error when using a plugin that has fulfilled dependencies', function () { - FakeDom - .new() - .addScript([ - 'modules/system/assets/js/build/manifest.js', - 'modules/system/assets/js/snowboard/build/snowboard.vendor.js', - 'modules/system/assets/js/snowboard/build/snowboard.base.js', - 'modules/system/tests/js/fixtures/framework/TestDependencyTwo.js', - 'modules/system/tests/js/fixtures/framework/TestHasDependencies.js', - 'modules/system/tests/js/fixtures/framework/TestDependencyOne.js', - ]) - .render() - .then( - (dom) => { - // Run assertions - const Snowboard = dom.window.Snowboard; - - expect(() => { - Snowboard.testHasDependencies(); - }).not.toThrow(); - - expect(Snowboard.testHasDependencies().testMethod()).toEqual('Tested'); - }, - (error) => { - throw error; - } - ); - }); - - it('will not initialise a singleton that has unfulfilled dependencies', function () { - FakeDom - .new() - .addScript([ - 'modules/system/assets/js/build/manifest.js', - 'modules/system/assets/js/snowboard/build/snowboard.vendor.js', - 'modules/system/assets/js/snowboard/build/snowboard.base.js', - 'modules/system/tests/js/fixtures/framework/TestSingletonWithDependency.js', - ]) - .render() - .then( - (dom) => { - // Run assertions - const Snowboard = dom.window.Snowboard; - - expect(() => { - Snowboard.testSingleton(); - }).toThrow('The "testsingleton" plugin requires the following plugins: testdependencyone'); - - expect(Snowboard.listensToEvent('ready')).not.toContain('testsingleton'); - - expect(() => { - Snowboard.globalEvent('ready'); - }).not.toThrow(); - }, - (error) => { - throw error; - } - ); - }); - - it('will allow plugins to call other plugin methods', function () { - FakeDom - .new() - .addScript([ - 'modules/system/assets/js/build/manifest.js', - 'modules/system/assets/js/snowboard/build/snowboard.vendor.js', - 'modules/system/assets/js/snowboard/build/snowboard.base.js', - 'modules/system/tests/js/fixtures/framework/TestDependencyOne.js', - 'modules/system/tests/js/fixtures/framework/TestSingletonWithDependency.js', - ]) - .render() - .then( - (dom) => { - // Run assertions - const Snowboard = dom.window.Snowboard; - const instance = Snowboard.testSingleton(); - - expect(instance.dependencyTest()).toEqual('Tested'); - }, - (error) => { - throw error; - } - ); - }); - - it('doesn\'t allow PluginBase or Singleton abstracts to be modified', function () { - FakeDom - .new() - .addScript([ - 'modules/system/assets/js/build/manifest.js', - 'modules/system/assets/js/snowboard/build/snowboard.vendor.js', - 'modules/system/assets/js/snowboard/build/snowboard.base.js', - ]) - .render() - .then( - (dom) => { - expect(() => { - dom.window.Snowboard.PluginBase.newMethod = () => { - return true; - }; - }).toThrow(TypeError); - - expect(() => { - dom.window.Snowboard.PluginBase.destruct = () => { - return true; - }; - }).toThrow(TypeError); - - expect(() => { - dom.window.Snowboard.PluginBase.prototype.newMethod = () => { - return true; - }; - }).toThrow(TypeError); - - expect(() => { - dom.window.Snowboard.Singleton.newMethod = () => { - return true; - }; - }).toThrow(TypeError); - - expect(() => { - dom.window.Snowboard.Singleton.destruct = () => { - return true; - }; - }).toThrow(TypeError); - - expect(() => { - dom.window.Snowboard.Singleton.prototype.newMethod = () => { - return true; - }; - }).toThrow(TypeError); - }, - ); - }); -}); diff --git a/modules/system/winter.mix.js b/modules/system/winter.mix.js index afd0ec4c4..0066ad755 100644 --- a/modules/system/winter.mix.js +++ b/modules/system/winter.mix.js @@ -15,7 +15,7 @@ mix // Extract imported libraries .extract({ - libraries: ['js-cookie'], + libraries: ['js-cookie', '@wintercms/snowboard'], to: './assets/js/snowboard/build/snowboard.vendor.js', }) From f8ee466d8d16699ad2f8a9ed3aa51b82c6d7df12 Mon Sep 17 00:00:00 2001 From: Ben Thomson Date: Wed, 6 Sep 2023 15:10:06 +0800 Subject: [PATCH 2/6] Update to Snowboard.js v0.4.0 --- modules/backend/assets/ui/js/build/vendor.js | 2 +- modules/system/assets/js/build/manifest.js | 2 +- modules/system/assets/js/build/system.debug.js | 2 +- modules/system/assets/js/build/system.js | 2 +- .../system/assets/js/snowboard/build/snowboard.base.debug.js | 2 +- modules/system/assets/js/snowboard/build/snowboard.base.js | 2 +- .../system/assets/js/snowboard/build/snowboard.data-attr.js | 2 +- modules/system/assets/js/snowboard/build/snowboard.extras.js | 2 +- .../system/assets/js/snowboard/build/snowboard.request.js | 2 +- modules/system/assets/js/snowboard/build/snowboard.vendor.js | 5 +++-- modules/system/package.json | 2 +- modules/system/winter.mix.js | 2 +- 12 files changed, 14 insertions(+), 13 deletions(-) diff --git a/modules/backend/assets/ui/js/build/vendor.js b/modules/backend/assets/ui/js/build/vendor.js index 329e26065..99e5e74f2 100644 --- a/modules/backend/assets/ui/js/build/vendor.js +++ b/modules/backend/assets/ui/js/build/vendor.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_wintercms_wn_backend_module=self.webpackChunk_wintercms_wn_backend_module||[]).push([[101],{609:function(e){e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(r)for(var s=0;s{const n=e.__vccOpts||e;for(const[e,r]of t)n[e]=r;return n}},471:function(e,t,n){n.r(t),n.d(t,{BaseTransition:function(){return hr},Comment:function(){return is},EffectScope:function(){return pe},Fragment:function(){return os},KeepAlive:function(){return Er},ReactiveEffect:function(){return Te},Static:function(){return cs},Suspense:function(){return Jn},Teleport:function(){return ns},Text:function(){return ss},Transition:function(){return Ji},TransitionGroup:function(){return hc},VueElement:function(){return Ui},assertNumber:function(){return sn},callWithAsyncErrorHandling:function(){return ln},callWithErrorHandling:function(){return cn},camelize:function(){return Q},capitalize:function(){return ne},cloneVNode:function(){return Ns},compatUtils:function(){return Ci},compile:function(){return Bf},computed:function(){return ri},createApp:function(){return Kc},createBlock:function(){return vs},createCommentVNode:function(){return Ms},createElementBlock:function(){return gs},createElementVNode:function(){return ws},createHydrationRenderer:function(){return qo},createPropsRestProxy:function(){return pi},createRenderer:function(){return Go},createSSRApp:function(){return Gc},createSlots:function(){return ro},createStaticVNode:function(){return Os},createTextVNode:function(){return Rs},createVNode:function(){return ks},customRef:function(){return Xt},defineAsyncComponent:function(){return Cr},defineComponent:function(){return Sr},defineCustomElement:function(){return Bi},defineEmits:function(){return si},defineExpose:function(){return ii},defineProps:function(){return oi},defineSSRCustomElement:function(){return ji},devtools:function(){return Nn},effect:function(){return Re},effectScope:function(){return de},getCurrentInstance:function(){return Ds},getCurrentScope:function(){return me},getTransitionRawChildren:function(){return br},guardReactiveProps:function(){return Ts},h:function(){return hi},handleError:function(){return un},hydrate:function(){return zc},initCustomFormatter:function(){return vi},initDirectivesForSSR:function(){return Yc},inject:function(){return nr},isMemoSame:function(){return _i},isProxy:function(){return Ft},isReactive:function(){return Pt},isReadonly:function(){return At},isRef:function(){return Ut},isRuntimeOnly:function(){return Zs},isShallow:function(){return It},isVNode:function(){return ys},markRaw:function(){return Lt},mergeDefaults:function(){return fi},mergeProps:function(){return Fs},nextTick:function(){return _n},normalizeClass:function(){return p},normalizeProps:function(){return d},normalizeStyle:function(){return c},onActivated:function(){return Nr},onBeforeMount:function(){return $r},onBeforeUnmount:function(){return jr},onBeforeUpdate:function(){return Vr},onDeactivated:function(){return Rr},onErrorCaptured:function(){return zr},onMounted:function(){return Lr},onRenderTracked:function(){return Wr},onRenderTriggered:function(){return Hr},onScopeDispose:function(){return ge},onServerPrefetch:function(){return Ur},onUnmounted:function(){return Dr},onUpdated:function(){return Br},openBlock:function(){return as},popScopeId:function(){return Bn},provide:function(){return tr},proxyRefs:function(){return Yt},pushScopeId:function(){return Vn},queuePostFlushCb:function(){return xn},reactive:function(){return Tt},readonly:function(){return Rt},ref:function(){return Ht},registerRuntimeCompiler:function(){return Ys},render:function(){return Wc},renderList:function(){return no},renderSlot:function(){return oo},resolveComponent:function(){return Yr},resolveDirective:function(){return Qr},resolveDynamicComponent:function(){return Xr},resolveFilter:function(){return xi},resolveTransitionHooks:function(){return gr},setBlockTracking:function(){return hs},setDevtoolsHook:function(){return Mn},setTransitionHooks:function(){return _r},shallowReactive:function(){return Nt},shallowReadonly:function(){return Ot},shallowRef:function(){return Wt},ssrContextKey:function(){return mi},ssrUtils:function(){return Si},stop:function(){return Oe},toDisplayString:function(){return x},toHandlerKey:function(){return re},toHandlers:function(){return io},toRaw:function(){return $t},toRef:function(){return tn},toRefs:function(){return Qt},transformVNodeArgs:function(){return bs},triggerRef:function(){return Gt},unref:function(){return qt},useAttrs:function(){return ui},useCssModule:function(){return Hi},useCssVars:function(){return Wi},useSSRContext:function(){return gi},useSlots:function(){return li},useTransitionState:function(){return pr},vModelCheckbox:function(){return xc},vModelDynamic:function(){return Rc},vModelRadio:function(){return wc},vModelSelect:function(){return kc},vModelText:function(){return Sc},vShow:function(){return Lc},version:function(){return bi},warn:function(){return on},watch:function(){return cr},watchEffect:function(){return rr},watchPostEffect:function(){return or},watchSyncEffect:function(){return sr},withAsyncContext:function(){return di},withCtx:function(){return Dn},withDefaults:function(){return ci},withDirectives:function(){return Kr},withKeys:function(){return $c},withMemo:function(){return yi},withModifiers:function(){return Ic},withScopeId:function(){return jn}});var r={};function o(e,t){const n=Object.create(null),r=e.split(",");for(let e=0;e!!n[e.toLowerCase()]:e=>!!n[e]}n.r(r),n.d(r,{BaseTransition:function(){return hr},Comment:function(){return is},EffectScope:function(){return pe},Fragment:function(){return os},KeepAlive:function(){return Er},ReactiveEffect:function(){return Te},Static:function(){return cs},Suspense:function(){return Jn},Teleport:function(){return ns},Text:function(){return ss},Transition:function(){return Ji},TransitionGroup:function(){return hc},VueElement:function(){return Ui},assertNumber:function(){return sn},callWithAsyncErrorHandling:function(){return ln},callWithErrorHandling:function(){return cn},camelize:function(){return Q},capitalize:function(){return ne},cloneVNode:function(){return Ns},compatUtils:function(){return Ci},computed:function(){return ri},createApp:function(){return Kc},createBlock:function(){return vs},createCommentVNode:function(){return Ms},createElementBlock:function(){return gs},createElementVNode:function(){return ws},createHydrationRenderer:function(){return qo},createPropsRestProxy:function(){return pi},createRenderer:function(){return Go},createSSRApp:function(){return Gc},createSlots:function(){return ro},createStaticVNode:function(){return Os},createTextVNode:function(){return Rs},createVNode:function(){return ks},customRef:function(){return Xt},defineAsyncComponent:function(){return Cr},defineComponent:function(){return Sr},defineCustomElement:function(){return Bi},defineEmits:function(){return si},defineExpose:function(){return ii},defineProps:function(){return oi},defineSSRCustomElement:function(){return ji},devtools:function(){return Nn},effect:function(){return Re},effectScope:function(){return de},getCurrentInstance:function(){return Ds},getCurrentScope:function(){return me},getTransitionRawChildren:function(){return br},guardReactiveProps:function(){return Ts},h:function(){return hi},handleError:function(){return un},hydrate:function(){return zc},initCustomFormatter:function(){return vi},initDirectivesForSSR:function(){return Yc},inject:function(){return nr},isMemoSame:function(){return _i},isProxy:function(){return Ft},isReactive:function(){return Pt},isReadonly:function(){return At},isRef:function(){return Ut},isRuntimeOnly:function(){return Zs},isShallow:function(){return It},isVNode:function(){return ys},markRaw:function(){return Lt},mergeDefaults:function(){return fi},mergeProps:function(){return Fs},nextTick:function(){return _n},normalizeClass:function(){return p},normalizeProps:function(){return d},normalizeStyle:function(){return c},onActivated:function(){return Nr},onBeforeMount:function(){return $r},onBeforeUnmount:function(){return jr},onBeforeUpdate:function(){return Vr},onDeactivated:function(){return Rr},onErrorCaptured:function(){return zr},onMounted:function(){return Lr},onRenderTracked:function(){return Wr},onRenderTriggered:function(){return Hr},onScopeDispose:function(){return ge},onServerPrefetch:function(){return Ur},onUnmounted:function(){return Dr},onUpdated:function(){return Br},openBlock:function(){return as},popScopeId:function(){return Bn},provide:function(){return tr},proxyRefs:function(){return Yt},pushScopeId:function(){return Vn},queuePostFlushCb:function(){return xn},reactive:function(){return Tt},readonly:function(){return Rt},ref:function(){return Ht},registerRuntimeCompiler:function(){return Ys},render:function(){return Wc},renderList:function(){return no},renderSlot:function(){return oo},resolveComponent:function(){return Yr},resolveDirective:function(){return Qr},resolveDynamicComponent:function(){return Xr},resolveFilter:function(){return xi},resolveTransitionHooks:function(){return gr},setBlockTracking:function(){return hs},setDevtoolsHook:function(){return Mn},setTransitionHooks:function(){return _r},shallowReactive:function(){return Nt},shallowReadonly:function(){return Ot},shallowRef:function(){return Wt},ssrContextKey:function(){return mi},ssrUtils:function(){return Si},stop:function(){return Oe},toDisplayString:function(){return x},toHandlerKey:function(){return re},toHandlers:function(){return io},toRaw:function(){return $t},toRef:function(){return tn},toRefs:function(){return Qt},transformVNodeArgs:function(){return bs},triggerRef:function(){return Gt},unref:function(){return qt},useAttrs:function(){return ui},useCssModule:function(){return Hi},useCssVars:function(){return Wi},useSSRContext:function(){return gi},useSlots:function(){return li},useTransitionState:function(){return pr},vModelCheckbox:function(){return xc},vModelDynamic:function(){return Rc},vModelRadio:function(){return wc},vModelSelect:function(){return kc},vModelText:function(){return Sc},vShow:function(){return Lc},version:function(){return bi},warn:function(){return on},watch:function(){return cr},watchEffect:function(){return rr},watchPostEffect:function(){return or},watchSyncEffect:function(){return sr},withAsyncContext:function(){return di},withCtx:function(){return Dn},withDefaults:function(){return ci},withDirectives:function(){return Kr},withKeys:function(){return $c},withMemo:function(){return yi},withModifiers:function(){return Ic},withScopeId:function(){return jn}});const s={1:"TEXT",2:"CLASS",4:"STYLE",8:"PROPS",16:"FULL_PROPS",32:"HYDRATE_EVENTS",64:"STABLE_FRAGMENT",128:"KEYED_FRAGMENT",256:"UNKEYED_FRAGMENT",512:"NEED_PATCH",1024:"DYNAMIC_SLOTS",2048:"DEV_ROOT_FRAGMENT",[-1]:"HOISTED",[-2]:"BAIL"},i=o("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt");function c(e){if(F(e)){const t={};for(let n=0;n{if(e){const n=e.split(u);n.length>1&&(t[n[0].trim()]=n[1].trim())}})),t}function p(e){let t="";if(j(e))t=e;else if(F(e))for(let n=0;nb(e,t)))}const x=e=>j(e)?e:null==e?"":F(e)||U(e)&&(e.toString===W||!B(e.toString))?JSON.stringify(e,C,2):String(e),C=(e,t)=>t&&t.__v_isRef?C(e,t.value):$(t)?{[`Map(${t.size})`]:[...t.entries()].reduce(((e,[t,n])=>(e[`${t} =>`]=n,e)),{})}:L(t)?{[`Set(${t.size})`]:[...t.values()]}:!U(t)||F(t)||G(t)?t:String(t),w={},k=[],E=()=>{},T=()=>!1,N=/^on[^a-z]/,R=e=>N.test(e),O=e=>e.startsWith("onUpdate:"),M=Object.assign,P=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},A=Object.prototype.hasOwnProperty,I=(e,t)=>A.call(e,t),F=Array.isArray,$=e=>"[object Map]"===z(e),L=e=>"[object Set]"===z(e),V=e=>"[object Date]"===z(e),B=e=>"function"==typeof e,j=e=>"string"==typeof e,D=e=>"symbol"==typeof e,U=e=>null!==e&&"object"==typeof e,H=e=>U(e)&&B(e.then)&&B(e.catch),W=Object.prototype.toString,z=e=>W.call(e),K=e=>z(e).slice(8,-1),G=e=>"[object Object]"===z(e),q=e=>j(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,J=o(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Y=o("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),Z=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},X=/-(\w)/g,Q=Z((e=>e.replace(X,((e,t)=>t?t.toUpperCase():"")))),ee=/\B([A-Z])/g,te=Z((e=>e.replace(ee,"-$1").toLowerCase())),ne=Z((e=>e.charAt(0).toUpperCase()+e.slice(1))),re=Z((e=>e?`on${ne(e)}`:"")),oe=(e,t)=>!Object.is(e,t),se=(e,t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})},ce=e=>{const t=parseFloat(e);return isNaN(t)?e:t},le=e=>{const t=j(e)?Number(e):NaN;return isNaN(t)?e:t};let ue;const ae=()=>ue||(ue="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:{});let fe;class pe{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this.parent=fe,!e&&fe&&(this.index=(fe.scopes||(fe.scopes=[])).push(this)-1)}get active(){return this._active}run(e){if(this._active){const t=fe;try{return fe=this,e()}finally{fe=t}}else 0}on(){fe=this}off(){fe=this.parent}stop(e){if(this._active){let t,n;for(t=0,n=this.effects.length;t{const t=new Set(e);return t.w=0,t.n=0,t},ye=e=>(e.w&xe)>0,_e=e=>(e.n&xe)>0,be=new WeakMap;let Se=0,xe=1;const Ce=30;let we;const ke=Symbol(""),Ee=Symbol("");class Te{constructor(e,t=null,n){this.fn=e,this.scheduler=t,this.active=!0,this.deps=[],this.parent=void 0,he(this,n)}run(){if(!this.active)return this.fn();let e=we,t=Me;for(;e;){if(e===this)return;e=e.parent}try{return this.parent=we,we=this,Me=!0,xe=1<<++Se,Se<=Ce?(({deps:e})=>{if(e.length)for(let t=0;t{const{deps:t}=e;if(t.length){let n=0;for(let r=0;r{("length"===n||n>=e)&&c.push(t)}))}else switch(void 0!==n&&c.push(i.get(n)),t){case"add":F(e)?q(n)&&c.push(i.get("length")):(c.push(i.get(ke)),$(e)&&c.push(i.get(Ee)));break;case"delete":F(e)||(c.push(i.get(ke)),$(e)&&c.push(i.get(Ee)));break;case"set":$(e)&&c.push(i.get(ke))}if(1===c.length)c[0]&&Ve(c[0]);else{const e=[];for(const t of c)t&&e.push(...t);Ve(ve(e))}}function Ve(e,t){const n=F(e)?e:[...e];for(const e of n)e.computed&&Be(e,t);for(const e of n)e.computed||Be(e,t)}function Be(e,t){(e!==we||e.allowRecurse)&&(e.scheduler?e.scheduler():e.run())}const je=o("__proto__,__v_isRef,__isVue"),De=new Set(Object.getOwnPropertyNames(Symbol).filter((e=>"arguments"!==e&&"caller"!==e)).map((e=>Symbol[e])).filter(D)),Ue=Je(),He=Je(!1,!0),We=Je(!0),ze=Je(!0,!0),Ke=Ge();function Ge(){const e={};return["includes","indexOf","lastIndexOf"].forEach((t=>{e[t]=function(...e){const n=$t(this);for(let e=0,t=this.length;e{e[t]=function(...e){Ae();const n=$t(this)[t].apply(this,e);return Ie(),n}})),e}function qe(e){const t=$t(this);return Fe(t,0,e),t.hasOwnProperty(e)}function Je(e=!1,t=!1){return function(n,r,o){if("__v_isReactive"===r)return!e;if("__v_isReadonly"===r)return e;if("__v_isShallow"===r)return t;if("__v_raw"===r&&o===(e?t?Et:kt:t?wt:Ct).get(n))return n;const s=F(n);if(!e){if(s&&I(Ke,r))return Reflect.get(Ke,r,o);if("hasOwnProperty"===r)return qe}const i=Reflect.get(n,r,o);return(D(r)?De.has(r):je(r))?i:(e||Fe(n,0,r),t?i:Ut(i)?s&&q(r)?i:i.value:U(i)?e?Rt(i):Tt(i):i)}}function Ye(e=!1){return function(t,n,r,o){let s=t[n];if(At(s)&&Ut(s)&&!Ut(r))return!1;if(!e&&(It(r)||At(r)||(s=$t(s),r=$t(r)),!F(t)&&Ut(s)&&!Ut(r)))return s.value=r,!0;const i=F(t)&&q(n)?Number(n)e,nt=e=>Reflect.getPrototypeOf(e);function rt(e,t,n=!1,r=!1){const o=$t(e=e.__v_raw),s=$t(t);n||(t!==s&&Fe(o,0,t),Fe(o,0,s));const{has:i}=nt(o),c=r?tt:n?Bt:Vt;return i.call(o,t)?c(e.get(t)):i.call(o,s)?c(e.get(s)):void(e!==o&&e.get(t))}function ot(e,t=!1){const n=this.__v_raw,r=$t(n),o=$t(e);return t||(e!==o&&Fe(r,0,e),Fe(r,0,o)),e===o?n.has(e):n.has(e)||n.has(o)}function st(e,t=!1){return e=e.__v_raw,!t&&Fe($t(e),0,ke),Reflect.get(e,"size",e)}function it(e){e=$t(e);const t=$t(this);return nt(t).has.call(t,e)||(t.add(e),Le(t,"add",e,e)),this}function ct(e,t){t=$t(t);const n=$t(this),{has:r,get:o}=nt(n);let s=r.call(n,e);s||(e=$t(e),s=r.call(n,e));const i=o.call(n,e);return n.set(e,t),s?oe(t,i)&&Le(n,"set",e,t):Le(n,"add",e,t),this}function lt(e){const t=$t(this),{has:n,get:r}=nt(t);let o=n.call(t,e);o||(e=$t(e),o=n.call(t,e));r&&r.call(t,e);const s=t.delete(e);return o&&Le(t,"delete",e,void 0),s}function ut(){const e=$t(this),t=0!==e.size,n=e.clear();return t&&Le(e,"clear",void 0,void 0),n}function at(e,t){return function(n,r){const o=this,s=o.__v_raw,i=$t(s),c=t?tt:e?Bt:Vt;return!e&&Fe(i,0,ke),s.forEach(((e,t)=>n.call(r,c(e),c(t),o)))}}function ft(e,t,n){return function(...r){const o=this.__v_raw,s=$t(o),i=$(s),c="entries"===e||e===Symbol.iterator&&i,l="keys"===e&&i,u=o[e](...r),a=n?tt:t?Bt:Vt;return!t&&Fe(s,0,l?Ee:ke),{next(){const{value:e,done:t}=u.next();return t?{value:e,done:t}:{value:c?[a(e[0]),a(e[1])]:a(e),done:t}},[Symbol.iterator](){return this}}}}function pt(e){return function(...t){return"delete"!==e&&this}}function dt(){const e={get(e){return rt(this,e)},get size(){return st(this)},has:ot,add:it,set:ct,delete:lt,clear:ut,forEach:at(!1,!1)},t={get(e){return rt(this,e,!1,!0)},get size(){return st(this)},has:ot,add:it,set:ct,delete:lt,clear:ut,forEach:at(!1,!0)},n={get(e){return rt(this,e,!0)},get size(){return st(this,!0)},has(e){return ot.call(this,e,!0)},add:pt("add"),set:pt("set"),delete:pt("delete"),clear:pt("clear"),forEach:at(!0,!1)},r={get(e){return rt(this,e,!0,!0)},get size(){return st(this,!0)},has(e){return ot.call(this,e,!0)},add:pt("add"),set:pt("set"),delete:pt("delete"),clear:pt("clear"),forEach:at(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach((o=>{e[o]=ft(o,!1,!1),n[o]=ft(o,!0,!1),t[o]=ft(o,!1,!0),r[o]=ft(o,!0,!0)})),[e,n,t,r]}const[ht,mt,gt,vt]=dt();function yt(e,t){const n=t?e?vt:gt:e?mt:ht;return(t,r,o)=>"__v_isReactive"===r?!e:"__v_isReadonly"===r?e:"__v_raw"===r?t:Reflect.get(I(n,r)&&r in t?n:t,r,o)}const _t={get:yt(!1,!1)},bt={get:yt(!1,!0)},St={get:yt(!0,!1)},xt={get:yt(!0,!0)};const Ct=new WeakMap,wt=new WeakMap,kt=new WeakMap,Et=new WeakMap;function Tt(e){return At(e)?e:Mt(e,!1,Ze,_t,Ct)}function Nt(e){return Mt(e,!1,Qe,bt,wt)}function Rt(e){return Mt(e,!0,Xe,St,kt)}function Ot(e){return Mt(e,!0,et,xt,Et)}function Mt(e,t,n,r,o){if(!U(e))return e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const s=o.get(e);if(s)return s;const i=(c=e).__v_skip||!Object.isExtensible(c)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}(K(c));var c;if(0===i)return e;const l=new Proxy(e,2===i?r:n);return o.set(e,l),l}function Pt(e){return At(e)?Pt(e.__v_raw):!(!e||!e.__v_isReactive)}function At(e){return!(!e||!e.__v_isReadonly)}function It(e){return!(!e||!e.__v_isShallow)}function Ft(e){return Pt(e)||At(e)}function $t(e){const t=e&&e.__v_raw;return t?$t(t):e}function Lt(e){return ie(e,"__v_skip",!0),e}const Vt=e=>U(e)?Tt(e):e,Bt=e=>U(e)?Rt(e):e;function jt(e){Me&&we&&$e((e=$t(e)).dep||(e.dep=ve()))}function Dt(e,t){const n=(e=$t(e)).dep;n&&Ve(n)}function Ut(e){return!(!e||!0!==e.__v_isRef)}function Ht(e){return zt(e,!1)}function Wt(e){return zt(e,!0)}function zt(e,t){return Ut(e)?e:new Kt(e,t)}class Kt{constructor(e,t){this.__v_isShallow=t,this.dep=void 0,this.__v_isRef=!0,this._rawValue=t?e:$t(e),this._value=t?e:Vt(e)}get value(){return jt(this),this._value}set value(e){const t=this.__v_isShallow||It(e)||At(e);e=t?e:$t(e),oe(e,this._rawValue)&&(this._rawValue=e,this._value=t?e:Vt(e),Dt(this))}}function Gt(e){Dt(e)}function qt(e){return Ut(e)?e.value:e}const Jt={get:(e,t,n)=>qt(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const o=e[t];return Ut(o)&&!Ut(n)?(o.value=n,!0):Reflect.set(e,t,n,r)}};function Yt(e){return Pt(e)?e:new Proxy(e,Jt)}class Zt{constructor(e){this.dep=void 0,this.__v_isRef=!0;const{get:t,set:n}=e((()=>jt(this)),(()=>Dt(this)));this._get=t,this._set=n}get value(){return this._get()}set value(e){this._set(e)}}function Xt(e){return new Zt(e)}function Qt(e){const t=F(e)?new Array(e.length):{};for(const n in e)t[n]=tn(e,n);return t}class en{constructor(e,t,n){this._object=e,this._key=t,this._defaultValue=n,this.__v_isRef=!0}get value(){const e=this._object[this._key];return void 0===e?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return function(e,t){var n;return null===(n=be.get(e))||void 0===n?void 0:n.get(t)}($t(this._object),this._key)}}function tn(e,t,n){const r=e[t];return Ut(r)?r:new en(e,t,n)}var nn;class rn{constructor(e,t,n,r){this._setter=t,this.dep=void 0,this.__v_isRef=!0,this[nn]=!1,this._dirty=!0,this.effect=new Te(e,(()=>{this._dirty||(this._dirty=!0,Dt(this))})),this.effect.computed=this,this.effect.active=this._cacheable=!r,this.__v_isReadonly=n}get value(){const e=$t(this);return jt(e),!e._dirty&&e._cacheable||(e._dirty=!1,e._value=e.effect.run()),e._value}set value(e){this._setter(e)}}nn="__v_isReadonly";function on(e,...t){}function sn(e,t){}function cn(e,t,n,r){let o;try{o=r?e(...r):e()}catch(e){un(e,t,n)}return o}function ln(e,t,n,r){if(B(e)){const o=cn(e,t,n,r);return o&&H(o)&&o.catch((e=>{un(e,t,n)})),o}const o=[];for(let s=0;s>>1;kn(pn[r])kn(e)-kn(t))),gn=0;gnnull==e.id?1/0:e.id,En=(e,t)=>{const n=kn(e)-kn(t);if(0===n){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return n};function Tn(e){fn=!1,an=!0,pn.sort(En);try{for(dn=0;dnNn.emit(e,...t))),Rn=[];else if("undefined"!=typeof window&&window.HTMLElement&&!(null===(r=null===(n=window.navigator)||void 0===n?void 0:n.userAgent)||void 0===r?void 0:r.includes("jsdom"))){(t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push((e=>{Mn(e,t)})),setTimeout((()=>{Nn||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,On=!0,Rn=[])}),3e3)}else On=!0,Rn=[]}function Pn(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||w;let o=n;const s=t.startsWith("update:"),i=s&&t.slice(7);if(i&&i in r){const e=`${"modelValue"===i?"model":i}Modifiers`,{number:t,trim:s}=r[e]||w;s&&(o=n.map((e=>j(e)?e.trim():e))),t&&(o=n.map(ce))}let c;let l=r[c=re(t)]||r[c=re(Q(t))];!l&&s&&(l=r[c=re(te(t))]),l&&ln(l,e,6,o);const u=r[c+"Once"];if(u){if(e.emitted){if(e.emitted[c])return}else e.emitted={};e.emitted[c]=!0,ln(u,e,6,o)}}function An(e,t,n=!1){const r=t.emitsCache,o=r.get(e);if(void 0!==o)return o;const s=e.emits;let i={},c=!1;if(!B(e)){const r=e=>{const n=An(e,t,!0);n&&(c=!0,M(i,n))};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}return s||c?(F(s)?s.forEach((e=>i[e]=null)):M(i,s),U(e)&&r.set(e,i),i):(U(e)&&r.set(e,null),null)}function In(e,t){return!(!e||!R(t))&&(t=t.slice(2).replace(/Once$/,""),I(e,t[0].toLowerCase()+t.slice(1))||I(e,te(t))||I(e,t))}let Fn=null,$n=null;function Ln(e){const t=Fn;return Fn=e,$n=e&&e.type.__scopeId||null,t}function Vn(e){$n=e}function Bn(){$n=null}const jn=e=>Dn;function Dn(e,t=Fn,n){if(!t)return e;if(e._n)return e;const r=(...n)=>{r._d&&hs(-1);const o=Ln(t);let s;try{s=e(...n)}finally{Ln(o),r._d&&hs(1)}return s};return r._n=!0,r._c=!0,r._d=!0,r}function Un(e){const{type:t,vnode:n,proxy:r,withProxy:o,props:s,propsOptions:[i],slots:c,attrs:l,emit:u,render:a,renderCache:f,data:p,setupState:d,ctx:h,inheritAttrs:m}=e;let g,v;const y=Ln(e);try{if(4&n.shapeFlag){const e=o||r;g=Ps(a.call(e,e,f,s,d,p,h)),v=l}else{const e=t;0,g=Ps(e.length>1?e(s,{attrs:l,slots:c,emit:u}):e(s,null)),v=t.props?l:Wn(l)}}catch(t){ls.length=0,un(t,e,1),g=ks(is)}let _=g;if(v&&!1!==m){const e=Object.keys(v),{shapeFlag:t}=_;e.length&&7&t&&(i&&e.some(O)&&(v=zn(v,i)),_=Ns(_,v))}return n.dirs&&(_=Ns(_),_.dirs=_.dirs?_.dirs.concat(n.dirs):n.dirs),n.transition&&(_.transition=n.transition),g=_,Ln(y),g}function Hn(e){let t;for(let n=0;n{let t;for(const n in e)("class"===n||"style"===n||R(n))&&((t||(t={}))[n]=e[n]);return t},zn=(e,t)=>{const n={};for(const r in e)O(r)&&r.slice(9)in t||(n[r]=e[r]);return n};function Kn(e,t,n){const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let o=0;oe.__isSuspense,Jn={name:"Suspense",__isSuspense:!0,process(e,t,n,r,o,s,i,c,l,u){null==e?function(e,t,n,r,o,s,i,c,l){const{p:u,o:{createElement:a}}=l,f=a("div"),p=e.suspense=Zn(e,o,r,t,f,n,s,i,c,l);u(null,p.pendingBranch=e.ssContent,f,null,r,p,s,i),p.deps>0?(Yn(e,"onPending"),Yn(e,"onFallback"),u(null,e.ssFallback,t,n,r,null,s,i),er(p,e.ssFallback)):p.resolve()}(t,n,r,o,s,i,c,l,u):function(e,t,n,r,o,s,i,c,{p:l,um:u,o:{createElement:a}}){const f=t.suspense=e.suspense;f.vnode=t,t.el=e.el;const p=t.ssContent,d=t.ssFallback,{activeBranch:h,pendingBranch:m,isInFallback:g,isHydrating:v}=f;if(m)f.pendingBranch=p,_s(p,m)?(l(m,p,f.hiddenContainer,null,o,f,s,i,c),f.deps<=0?f.resolve():g&&(l(h,d,n,r,o,null,s,i,c),er(f,d))):(f.pendingId++,v?(f.isHydrating=!1,f.activeBranch=m):u(m,o,f),f.deps=0,f.effects.length=0,f.hiddenContainer=a("div"),g?(l(null,p,f.hiddenContainer,null,o,f,s,i,c),f.deps<=0?f.resolve():(l(h,d,n,r,o,null,s,i,c),er(f,d))):h&&_s(p,h)?(l(h,p,n,r,o,f,s,i,c),f.resolve(!0)):(l(null,p,f.hiddenContainer,null,o,f,s,i,c),f.deps<=0&&f.resolve()));else if(h&&_s(p,h))l(h,p,n,r,o,f,s,i,c),er(f,p);else if(Yn(t,"onPending"),f.pendingBranch=p,f.pendingId++,l(null,p,f.hiddenContainer,null,o,f,s,i,c),f.deps<=0)f.resolve();else{const{timeout:e,pendingId:t}=f;e>0?setTimeout((()=>{f.pendingId===t&&f.fallback(d)}),e):0===e&&f.fallback(d)}}(e,t,n,r,o,i,c,l,u)},hydrate:function(e,t,n,r,o,s,i,c,l){const u=t.suspense=Zn(t,r,n,e.parentNode,document.createElement("div"),null,o,s,i,c,!0),a=l(e,u.pendingBranch=t.ssContent,n,u,s,i);0===u.deps&&u.resolve();return a},create:Zn,normalize:function(e){const{shapeFlag:t,children:n}=e,r=32&t;e.ssContent=Xn(r?n.default:n),e.ssFallback=r?Xn(n.fallback):ks(is)}};function Yn(e,t){const n=e.props&&e.props[t];B(n)&&n()}function Zn(e,t,n,r,o,s,i,c,l,u,a=!1){const{p:f,m:p,um:d,n:h,o:{parentNode:m,remove:g}}=u,v=e.props?le(e.props.timeout):void 0;const y={vnode:e,parent:t,parentComponent:n,isSVG:i,container:r,hiddenContainer:o,anchor:s,deps:0,pendingId:0,timeout:"number"==typeof v?v:-1,activeBranch:null,pendingBranch:null,isInFallback:!0,isHydrating:a,isUnmounted:!1,effects:[],resolve(e=!1){const{vnode:t,activeBranch:n,pendingBranch:r,pendingId:o,effects:s,parentComponent:i,container:c}=y;if(y.isHydrating)y.isHydrating=!1;else if(!e){const e=n&&r.transition&&"out-in"===r.transition.mode;e&&(n.transition.afterLeave=()=>{o===y.pendingId&&p(r,c,t,0)});let{anchor:t}=y;n&&(t=h(n),d(n,i,y,!0)),e||p(r,c,t,0)}er(y,r),y.pendingBranch=null,y.isInFallback=!1;let l=y.parent,u=!1;for(;l;){if(l.pendingBranch){l.effects.push(...s),u=!0;break}l=l.parent}u||xn(s),y.effects=[],Yn(t,"onResolve")},fallback(e){if(!y.pendingBranch)return;const{vnode:t,activeBranch:n,parentComponent:r,container:o,isSVG:s}=y;Yn(t,"onFallback");const i=h(n),u=()=>{y.isInFallback&&(f(null,e,o,i,r,null,s,c,l),er(y,e))},a=e.transition&&"out-in"===e.transition.mode;a&&(n.transition.afterLeave=u),y.isInFallback=!0,d(n,r,null,!0),a||u()},move(e,t,n){y.activeBranch&&p(y.activeBranch,e,t,n),y.container=e},next(){return y.activeBranch&&h(y.activeBranch)},registerDep(e,t){const n=!!y.pendingBranch;n&&y.deps++;const r=e.vnode.el;e.asyncDep.catch((t=>{un(t,e,0)})).then((o=>{if(e.isUnmounted||y.isUnmounted||y.pendingId!==e.suspenseId)return;e.asyncResolved=!0;const{vnode:s}=e;Js(e,o,!1),r&&(s.el=r);const c=!r&&e.subTree.el;t(e,s,m(r||e.subTree.el),r?null:h(e.subTree),y,i,l),c&&g(c),Gn(e,s.el),n&&0==--y.deps&&y.resolve()}))},unmount(e,t){y.isUnmounted=!0,y.activeBranch&&d(y.activeBranch,n,e,t),y.pendingBranch&&d(y.pendingBranch,n,e,t)}};return y}function Xn(e){let t;if(B(e)){const n=ds&&e._c;n&&(e._d=!1,as()),e=e(),n&&(e._d=!0,t=us,fs())}if(F(e)){const t=Hn(e);0,e=t}return e=Ps(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter((t=>t!==e))),e}function Qn(e,t){t&&t.pendingBranch?F(e)?t.effects.push(...e):t.effects.push(e):xn(e)}function er(e,t){e.activeBranch=t;const{vnode:n,parentComponent:r}=e,o=n.el=t.el;r&&r.subTree===n&&(r.vnode.el=o,Gn(r,o))}function tr(e,t){if(js){let n=js.provides;const r=js.parent&&js.parent.provides;r===n&&(n=js.provides=Object.create(r)),n[e]=t}else 0}function nr(e,t,n=!1){const r=js||Fn;if(r){const o=null==r.parent?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides;if(o&&e in o)return o[e];if(arguments.length>1)return n&&B(t)?t.call(r.proxy):t}else 0}function rr(e,t){return lr(e,null,t)}function or(e,t){return lr(e,null,{flush:"post"})}function sr(e,t){return lr(e,null,{flush:"sync"})}const ir={};function cr(e,t,n){return lr(e,t,n)}function lr(e,t,{immediate:n,deep:r,flush:o,onTrack:s,onTrigger:i}=w){const c=me()===(null==js?void 0:js.scope)?js:null;let l,u,a=!1,f=!1;if(Ut(e)?(l=()=>e.value,a=It(e)):Pt(e)?(l=()=>e,r=!0):F(e)?(f=!0,a=e.some((e=>Pt(e)||It(e))),l=()=>e.map((e=>Ut(e)?e.value:Pt(e)?fr(e):B(e)?cn(e,c,2):void 0))):l=B(e)?t?()=>cn(e,c,2):()=>{if(!c||!c.isUnmounted)return u&&u(),ln(e,c,3,[d])}:E,t&&r){const e=l;l=()=>fr(e())}let p,d=e=>{u=v.onStop=()=>{cn(e,c,4)}};if(Gs){if(d=E,t?n&&ln(t,c,3,[l(),f?[]:void 0,d]):l(),"sync"!==o)return E;{const e=gi();p=e.__watcherHandles||(e.__watcherHandles=[])}}let h=f?new Array(e.length).fill(ir):ir;const m=()=>{if(v.active)if(t){const e=v.run();(r||a||(f?e.some(((e,t)=>oe(e,h[t]))):oe(e,h)))&&(u&&u(),ln(t,c,3,[e,h===ir?void 0:f&&h[0]===ir?[]:h,d]),h=e)}else v.run()};let g;m.allowRecurse=!!t,"sync"===o?g=m:"post"===o?g=()=>Ko(m,c&&c.suspense):(m.pre=!0,c&&(m.id=c.uid),g=()=>bn(m));const v=new Te(l,g);t?n?m():h=v.run():"post"===o?Ko(v.run.bind(v),c&&c.suspense):v.run();const y=()=>{v.stop(),c&&c.scope&&P(c.scope.effects,v)};return p&&p.push(y),y}function ur(e,t,n){const r=this.proxy,o=j(e)?e.includes(".")?ar(r,e):()=>r[e]:e.bind(r,r);let s;B(t)?s=t:(s=t.handler,n=t);const i=js;Us(this);const c=lr(o,s.bind(r),n);return i?Us(i):Hs(),c}function ar(e,t){const n=t.split(".");return()=>{let t=e;for(let e=0;e{fr(e,t)}));else if(G(e))for(const n in e)fr(e[n],t);return e}function pr(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Lr((()=>{e.isMounted=!0})),jr((()=>{e.isUnmounting=!0})),e}const dr=[Function,Array],hr={name:"BaseTransition",props:{mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:dr,onEnter:dr,onAfterEnter:dr,onEnterCancelled:dr,onBeforeLeave:dr,onLeave:dr,onAfterLeave:dr,onLeaveCancelled:dr,onBeforeAppear:dr,onAppear:dr,onAfterAppear:dr,onAppearCancelled:dr},setup(e,{slots:t}){const n=Ds(),r=pr();let o;return()=>{const s=t.default&&br(t.default(),!0);if(!s||!s.length)return;let i=s[0];if(s.length>1){let e=!1;for(const t of s)if(t.type!==is){0,i=t,e=!0;break}}const c=$t(e),{mode:l}=c;if(r.isLeaving)return vr(i);const u=yr(i);if(!u)return vr(i);const a=gr(u,c,r,n);_r(u,a);const f=n.subTree,p=f&&yr(f);let d=!1;const{getTransitionKey:h}=u.type;if(h){const e=h();void 0===o?o=e:e!==o&&(o=e,d=!0)}if(p&&p.type!==is&&(!_s(u,p)||d)){const e=gr(p,c,r,n);if(_r(p,e),"out-in"===l)return r.isLeaving=!0,e.afterLeave=()=>{r.isLeaving=!1,!1!==n.update.active&&n.update()},vr(i);"in-out"===l&&u.type!==is&&(e.delayLeave=(e,t,n)=>{mr(r,p)[String(p.key)]=p,e._leaveCb=()=>{t(),e._leaveCb=void 0,delete a.delayedLeave},a.delayedLeave=n})}return i}}};function mr(e,t){const{leavingVNodes:n}=e;let r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function gr(e,t,n,r){const{appear:o,mode:s,persisted:i=!1,onBeforeEnter:c,onEnter:l,onAfterEnter:u,onEnterCancelled:a,onBeforeLeave:f,onLeave:p,onAfterLeave:d,onLeaveCancelled:h,onBeforeAppear:m,onAppear:g,onAfterAppear:v,onAppearCancelled:y}=t,_=String(e.key),b=mr(n,e),S=(e,t)=>{e&&ln(e,r,9,t)},x=(e,t)=>{const n=t[1];S(e,t),F(e)?e.every((e=>e.length<=1))&&n():e.length<=1&&n()},C={mode:s,persisted:i,beforeEnter(t){let r=c;if(!n.isMounted){if(!o)return;r=m||c}t._leaveCb&&t._leaveCb(!0);const s=b[_];s&&_s(e,s)&&s.el._leaveCb&&s.el._leaveCb(),S(r,[t])},enter(e){let t=l,r=u,s=a;if(!n.isMounted){if(!o)return;t=g||l,r=v||u,s=y||a}let i=!1;const c=e._enterCb=t=>{i||(i=!0,S(t?s:r,[e]),C.delayedLeave&&C.delayedLeave(),e._enterCb=void 0)};t?x(t,[e,c]):c()},leave(t,r){const o=String(e.key);if(t._enterCb&&t._enterCb(!0),n.isUnmounting)return r();S(f,[t]);let s=!1;const i=t._leaveCb=n=>{s||(s=!0,r(),S(n?h:d,[t]),t._leaveCb=void 0,b[o]===e&&delete b[o])};b[o]=e,p?x(p,[t,i]):i()},clone(e){return gr(e,t,n,r)}};return C}function vr(e){if(kr(e))return(e=Ns(e)).children=null,e}function yr(e){return kr(e)?e.children?e.children[0]:void 0:e}function _r(e,t){6&e.shapeFlag&&e.component?_r(e.component.subTree,t):128&e.shapeFlag?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function br(e,t=!1,n){let r=[],o=0;for(let s=0;s1)for(let e=0;e!!e.type.__asyncLoader;function Cr(e){B(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:r,delay:o=200,timeout:s,suspensible:i=!0,onError:c}=e;let l,u=null,a=0;const f=()=>{let e;return u||(e=u=t().catch((e=>{if(e=e instanceof Error?e:new Error(String(e)),c)return new Promise(((t,n)=>{c(e,(()=>t((a++,u=null,f()))),(()=>n(e)),a+1)}));throw e})).then((t=>e!==u&&u?u:(t&&(t.__esModule||"Module"===t[Symbol.toStringTag])&&(t=t.default),l=t,t))))};return Sr({name:"AsyncComponentWrapper",__asyncLoader:f,get __asyncResolved(){return l},setup(){const e=js;if(l)return()=>wr(l,e);const t=t=>{u=null,un(t,e,13,!r)};if(i&&e.suspense||Gs)return f().then((t=>()=>wr(t,e))).catch((e=>(t(e),()=>r?ks(r,{error:e}):null)));const c=Ht(!1),a=Ht(),p=Ht(!!o);return o&&setTimeout((()=>{p.value=!1}),o),null!=s&&setTimeout((()=>{if(!c.value&&!a.value){const e=new Error(`Async component timed out after ${s}ms.`);t(e),a.value=e}}),s),f().then((()=>{c.value=!0,e.parent&&kr(e.parent.vnode)&&bn(e.parent.update)})).catch((e=>{t(e),a.value=e})),()=>c.value&&l?wr(l,e):a.value&&r?ks(r,{error:a.value}):n&&!p.value?ks(n):void 0}})}function wr(e,t){const{ref:n,props:r,children:o,ce:s}=t.vnode,i=ks(e,r,o);return i.ref=n,i.ce=s,delete t.vnode.ce,i}const kr=e=>e.type.__isKeepAlive,Er={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=Ds(),r=n.ctx;if(!r.renderer)return()=>{const e=t.default&&t.default();return e&&1===e.length?e[0]:e};const o=new Map,s=new Set;let i=null;const c=n.suspense,{renderer:{p:l,m:u,um:a,o:{createElement:f}}}=r,p=f("div");function d(e){Pr(e),a(e,n,c,!0)}function h(e){o.forEach(((t,n)=>{const r=ti(t.type);!r||e&&e(r)||m(n)}))}function m(e){const t=o.get(e);i&&_s(t,i)?i&&Pr(i):d(t),o.delete(e),s.delete(e)}r.activate=(e,t,n,r,o)=>{const s=e.component;u(e,t,n,0,c),l(s.vnode,e,t,n,s,c,r,e.slotScopeIds,o),Ko((()=>{s.isDeactivated=!1,s.a&&se(s.a);const t=e.props&&e.props.onVnodeMounted;t&&$s(t,s.parent,e)}),c)},r.deactivate=e=>{const t=e.component;u(e,p,null,1,c),Ko((()=>{t.da&&se(t.da);const n=e.props&&e.props.onVnodeUnmounted;n&&$s(n,t.parent,e),t.isDeactivated=!0}),c)},cr((()=>[e.include,e.exclude]),(([e,t])=>{e&&h((t=>Tr(e,t))),t&&h((e=>!Tr(t,e)))}),{flush:"post",deep:!0});let g=null;const v=()=>{null!=g&&o.set(g,Ar(n.subTree))};return Lr(v),Br(v),jr((()=>{o.forEach((e=>{const{subTree:t,suspense:r}=n,o=Ar(t);if(e.type!==o.type||e.key!==o.key)d(e);else{Pr(o);const e=o.component.da;e&&Ko(e,r)}}))})),()=>{if(g=null,!t.default)return null;const n=t.default(),r=n[0];if(n.length>1)return i=null,n;if(!(ys(r)&&(4&r.shapeFlag||128&r.shapeFlag)))return i=null,r;let c=Ar(r);const l=c.type,u=ti(xr(c)?c.type.__asyncResolved||{}:l),{include:a,exclude:f,max:p}=e;if(a&&(!u||!Tr(a,u))||f&&u&&Tr(f,u))return i=c,r;const d=null==c.key?l:c.key,h=o.get(d);return c.el&&(c=Ns(c),128&r.shapeFlag&&(r.ssContent=c)),g=d,h?(c.el=h.el,c.component=h.component,c.transition&&_r(c,c.transition),c.shapeFlag|=512,s.delete(d),s.add(d)):(s.add(d),p&&s.size>parseInt(p,10)&&m(s.values().next().value)),c.shapeFlag|=256,i=c,qn(r.type)?r:c}}};function Tr(e,t){return F(e)?e.some((e=>Tr(e,t))):j(e)?e.split(",").includes(t):"[object RegExp]"===z(e)&&e.test(t)}function Nr(e,t){Or(e,"a",t)}function Rr(e,t){Or(e,"da",t)}function Or(e,t,n=js){const r=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()});if(Ir(t,r,n),n){let e=n.parent;for(;e&&e.parent;)kr(e.parent.vnode)&&Mr(r,t,n,e),e=e.parent}}function Mr(e,t,n,r){const o=Ir(t,e,r,!0);Dr((()=>{P(r[t],o)}),n)}function Pr(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function Ar(e){return 128&e.shapeFlag?e.ssContent:e}function Ir(e,t,n=js,r=!1){if(n){const o=n[e]||(n[e]=[]),s=t.__weh||(t.__weh=(...r)=>{if(n.isUnmounted)return;Ae(),Us(n);const o=ln(t,n,e,r);return Hs(),Ie(),o});return r?o.unshift(s):o.push(s),s}}const Fr=e=>(t,n=js)=>(!Gs||"sp"===e)&&Ir(e,((...e)=>t(...e)),n),$r=Fr("bm"),Lr=Fr("m"),Vr=Fr("bu"),Br=Fr("u"),jr=Fr("bum"),Dr=Fr("um"),Ur=Fr("sp"),Hr=Fr("rtg"),Wr=Fr("rtc");function zr(e,t=js){Ir("ec",e,t)}function Kr(e,t){const n=Fn;if(null===n)return e;const r=ei(n)||n.proxy,o=e.dirs||(e.dirs=[]);for(let e=0;et(e,n,void 0,s&&s[n])));else{const n=Object.keys(e);o=new Array(n.length);for(let r=0,i=n.length;r{const t=r.fn(...e);return t&&(t.key=r.key),t}:r.fn)}return e}function oo(e,t,n={},r,o){if(Fn.isCE||Fn.parent&&xr(Fn.parent)&&Fn.parent.isCE)return"default"!==t&&(n.name=t),ks("slot",n,r&&r());let s=e[t];s&&s._c&&(s._d=!1),as();const i=s&&so(s(n)),c=vs(os,{key:n.key||i&&i.key||`_${t}`},i||(r?r():[]),i&&1===e._?64:-2);return!o&&c.scopeId&&(c.slotScopeIds=[c.scopeId+"-s"]),s&&s._c&&(s._d=!0),c}function so(e){return e.some((e=>!ys(e)||e.type!==is&&!(e.type===os&&!so(e.children))))?e:null}function io(e,t){const n={};for(const r in e)n[t&&/[A-Z]/.test(r)?`on:${r}`:re(r)]=e[r];return n}const co=e=>e?Ws(e)?ei(e)||e.proxy:co(e.parent):null,lo=M(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>co(e.parent),$root:e=>co(e.root),$emit:e=>e.emit,$options:e=>vo(e),$forceUpdate:e=>e.f||(e.f=()=>bn(e.update)),$nextTick:e=>e.n||(e.n=_n.bind(e.proxy)),$watch:e=>ur.bind(e)}),uo=(e,t)=>e!==w&&!e.__isScriptSetup&&I(e,t),ao={get({_:e},t){const{ctx:n,setupState:r,data:o,props:s,accessCache:i,type:c,appContext:l}=e;let u;if("$"!==t[0]){const c=i[t];if(void 0!==c)switch(c){case 1:return r[t];case 2:return o[t];case 4:return n[t];case 3:return s[t]}else{if(uo(r,t))return i[t]=1,r[t];if(o!==w&&I(o,t))return i[t]=2,o[t];if((u=e.propsOptions[0])&&I(u,t))return i[t]=3,s[t];if(n!==w&&I(n,t))return i[t]=4,n[t];po&&(i[t]=0)}}const a=lo[t];let f,p;return a?("$attrs"===t&&Fe(e,0,t),a(e)):(f=c.__cssModules)&&(f=f[t])?f:n!==w&&I(n,t)?(i[t]=4,n[t]):(p=l.config.globalProperties,I(p,t)?p[t]:void 0)},set({_:e},t,n){const{data:r,setupState:o,ctx:s}=e;return uo(o,t)?(o[t]=n,!0):r!==w&&I(r,t)?(r[t]=n,!0):!I(e.props,t)&&(("$"!==t[0]||!(t.slice(1)in e))&&(s[t]=n,!0))},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:o,propsOptions:s}},i){let c;return!!n[i]||e!==w&&I(e,i)||uo(t,i)||(c=s[0])&&I(c,i)||I(r,i)||I(lo,i)||I(o.config.globalProperties,i)},defineProperty(e,t,n){return null!=n.get?e._.accessCache[t]=0:I(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};const fo=M({},ao,{get(e,t){if(t!==Symbol.unscopables)return ao.get(e,t,e)},has(e,t){return"_"!==t[0]&&!i(t)}});let po=!0;function ho(e){const t=vo(e),n=e.proxy,r=e.ctx;po=!1,t.beforeCreate&&mo(t.beforeCreate,e,"bc");const{data:o,computed:s,methods:i,watch:c,provide:l,inject:u,created:a,beforeMount:f,mounted:p,beforeUpdate:d,updated:h,activated:m,deactivated:g,beforeDestroy:v,beforeUnmount:y,destroyed:_,unmounted:b,render:S,renderTracked:x,renderTriggered:C,errorCaptured:w,serverPrefetch:k,expose:T,inheritAttrs:N,components:R,directives:O,filters:M}=t;if(u&&function(e,t,n=E,r=!1){F(e)&&(e=So(e));for(const n in e){const o=e[n];let s;s=U(o)?"default"in o?nr(o.from||n,o.default,!0):nr(o.from||n):nr(o),Ut(s)&&r?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>s.value,set:e=>s.value=e}):t[n]=s}}(u,r,null,e.appContext.config.unwrapInjectedRef),i)for(const e in i){const t=i[e];B(t)&&(r[e]=t.bind(n))}if(o){0;const t=o.call(n,n);0,U(t)&&(e.data=Tt(t))}if(po=!0,s)for(const e in s){const t=s[e],o=B(t)?t.bind(n,n):B(t.get)?t.get.bind(n,n):E;0;const i=!B(t)&&B(t.set)?t.set.bind(n):E,c=ri({get:o,set:i});Object.defineProperty(r,e,{enumerable:!0,configurable:!0,get:()=>c.value,set:e=>c.value=e})}if(c)for(const e in c)go(c[e],r,n,e);if(l){const e=B(l)?l.call(n):l;Reflect.ownKeys(e).forEach((t=>{tr(t,e[t])}))}function P(e,t){F(t)?t.forEach((t=>e(t.bind(n)))):t&&e(t.bind(n))}if(a&&mo(a,e,"c"),P($r,f),P(Lr,p),P(Vr,d),P(Br,h),P(Nr,m),P(Rr,g),P(zr,w),P(Wr,x),P(Hr,C),P(jr,y),P(Dr,b),P(Ur,k),F(T))if(T.length){const t=e.exposed||(e.exposed={});T.forEach((e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t})}))}else e.exposed||(e.exposed={});S&&e.render===E&&(e.render=S),null!=N&&(e.inheritAttrs=N),R&&(e.components=R),O&&(e.directives=O)}function mo(e,t,n){ln(F(e)?e.map((e=>e.bind(t.proxy))):e.bind(t.proxy),t,n)}function go(e,t,n,r){const o=r.includes(".")?ar(n,r):()=>n[r];if(j(e)){const n=t[e];B(n)&&cr(o,n)}else if(B(e))cr(o,e.bind(n));else if(U(e))if(F(e))e.forEach((e=>go(e,t,n,r)));else{const r=B(e.handler)?e.handler.bind(n):t[e.handler];B(r)&&cr(o,r,e)}else 0}function vo(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:o,optionsCache:s,config:{optionMergeStrategies:i}}=e.appContext,c=s.get(t);let l;return c?l=c:o.length||n||r?(l={},o.length&&o.forEach((e=>yo(l,e,i,!0))),yo(l,t,i)):l=t,U(t)&&s.set(t,l),l}function yo(e,t,n,r=!1){const{mixins:o,extends:s}=t;s&&yo(e,s,n,!0),o&&o.forEach((t=>yo(e,t,n,!0)));for(const o in t)if(r&&"expose"===o);else{const r=_o[o]||n&&n[o];e[o]=r?r(e[o],t[o]):t[o]}return e}const _o={data:bo,props:Co,emits:Co,methods:Co,computed:Co,beforeCreate:xo,created:xo,beforeMount:xo,mounted:xo,beforeUpdate:xo,updated:xo,beforeDestroy:xo,beforeUnmount:xo,destroyed:xo,unmounted:xo,activated:xo,deactivated:xo,errorCaptured:xo,serverPrefetch:xo,components:Co,directives:Co,watch:function(e,t){if(!e)return t;if(!t)return e;const n=M(Object.create(null),e);for(const r in t)n[r]=xo(e[r],t[r]);return n},provide:bo,inject:function(e,t){return Co(So(e),So(t))}};function bo(e,t){return t?e?function(){return M(B(e)?e.call(this,this):e,B(t)?t.call(this,this):t)}:t:e}function So(e){if(F(e)){const t={};for(let n=0;n{l=!0;const[n,r]=Eo(e,t,!0);M(i,n),r&&c.push(...r)};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}if(!s&&!l)return U(e)&&r.set(e,k),k;if(F(s))for(let e=0;e-1,r[1]=n<0||e-1||I(r,"default"))&&c.push(t)}}}}const u=[i,c];return U(e)&&r.set(e,u),u}function To(e){return"$"!==e[0]}function No(e){const t=e&&e.toString().match(/^\s*(function|class) (\w+)/);return t?t[2]:null===e?"null":""}function Ro(e,t){return No(e)===No(t)}function Oo(e,t){return F(t)?t.findIndex((t=>Ro(t,e))):B(t)&&Ro(t,e)?0:-1}const Mo=e=>"_"===e[0]||"$stable"===e,Po=e=>F(e)?e.map(Ps):[Ps(e)],Ao=(e,t,n)=>{if(t._n)return t;const r=Dn(((...e)=>Po(t(...e))),n);return r._c=!1,r},Io=(e,t,n)=>{const r=e._ctx;for(const n in e){if(Mo(n))continue;const o=e[n];if(B(o))t[n]=Ao(0,o,r);else if(null!=o){0;const e=Po(o);t[n]=()=>e}}},Fo=(e,t)=>{const n=Po(t);e.slots.default=()=>n},$o=(e,t)=>{if(32&e.vnode.shapeFlag){const n=t._;n?(e.slots=$t(t),ie(t,"_",n)):Io(t,e.slots={})}else e.slots={},t&&Fo(e,t);ie(e.slots,Ss,1)},Lo=(e,t,n)=>{const{vnode:r,slots:o}=e;let s=!0,i=w;if(32&r.shapeFlag){const e=t._;e?n&&1===e?s=!1:(M(o,t),n||1!==e||delete o._):(s=!t.$stable,Io(t,o)),i=t}else t&&(Fo(e,t),i={default:1});if(s)for(const e in o)Mo(e)||e in i||delete o[e]};function Vo(){return{app:null,config:{isNativeTag:T,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let Bo=0;function jo(e,t){return function(n,r=null){B(n)||(n=Object.assign({},n)),null==r||U(r)||(r=null);const o=Vo(),s=new Set;let i=!1;const c=o.app={_uid:Bo++,_component:n,_props:r,_container:null,_context:o,_instance:null,version:bi,get config(){return o.config},set config(e){0},use(e,...t){return s.has(e)||(e&&B(e.install)?(s.add(e),e.install(c,...t)):B(e)&&(s.add(e),e(c,...t))),c},mixin(e){return o.mixins.includes(e)||o.mixins.push(e),c},component(e,t){return t?(o.components[e]=t,c):o.components[e]},directive(e,t){return t?(o.directives[e]=t,c):o.directives[e]},mount(s,l,u){if(!i){0;const a=ks(n,r);return a.appContext=o,l&&t?t(a,s):e(a,s,u),i=!0,c._container=s,s.__vue_app__=c,ei(a.component)||a.component.proxy}},unmount(){i&&(e(null,c._container),delete c._container.__vue_app__)},provide(e,t){return o.provides[e]=t,c}};return c}}function Do(e,t,n,r,o=!1){if(F(e))return void e.forEach(((e,s)=>Do(e,t&&(F(t)?t[s]:t),n,r,o)));if(xr(r)&&!o)return;const s=4&r.shapeFlag?ei(r.component)||r.component.proxy:r.el,i=o?null:s,{i:c,r:l}=e;const u=t&&t.r,a=c.refs===w?c.refs={}:c.refs,f=c.setupState;if(null!=u&&u!==l&&(j(u)?(a[u]=null,I(f,u)&&(f[u]=null)):Ut(u)&&(u.value=null)),B(l))cn(l,c,12,[i,a]);else{const t=j(l),r=Ut(l);if(t||r){const c=()=>{if(e.f){const n=t?I(f,l)?f[l]:a[l]:l.value;o?F(n)&&P(n,s):F(n)?n.includes(s)||n.push(s):t?(a[l]=[s],I(f,l)&&(f[l]=a[l])):(l.value=[s],e.k&&(a[e.k]=l.value))}else t?(a[l]=i,I(f,l)&&(f[l]=i)):r&&(l.value=i,e.k&&(a[e.k]=i))};i?(c.id=-1,Ko(c,n)):c()}else 0}}let Uo=!1;const Ho=e=>/svg/.test(e.namespaceURI)&&"foreignObject"!==e.tagName,Wo=e=>8===e.nodeType;function zo(e){const{mt:t,p:n,o:{patchProp:r,createText:o,nextSibling:s,parentNode:i,remove:c,insert:l,createComment:u}}=e,a=(n,r,c,u,g,v=!1)=>{const y=Wo(n)&&"["===n.data,_=()=>h(n,r,c,u,g,y),{type:b,ref:S,shapeFlag:x,patchFlag:C}=r;let w=n.nodeType;r.el=n,-2===C&&(v=!1,r.dynamicChildren=null);let k=null;switch(b){case ss:3!==w?""===r.children?(l(r.el=o(""),i(n),n),k=n):k=_():(n.data!==r.children&&(Uo=!0,n.data=r.children),k=s(n));break;case is:k=8!==w||y?_():s(n);break;case cs:if(y&&(w=(n=s(n)).nodeType),1===w||3===w){k=n;const e=!r.children.length;for(let t=0;t{i=i||!!t.dynamicChildren;const{type:l,props:u,patchFlag:a,shapeFlag:f,dirs:d}=t,h="input"===l&&d||"option"===l;if(h||-1!==a){if(d&&Gr(t,null,n,"created"),u)if(h||!i||48&a)for(const t in u)(h&&t.endsWith("value")||R(t)&&!J(t))&&r(e,t,null,u[t],!1,void 0,n);else u.onClick&&r(e,"onClick",null,u.onClick,!1,void 0,n);let l;if((l=u&&u.onVnodeBeforeMount)&&$s(l,n,t),d&&Gr(t,null,n,"beforeMount"),((l=u&&u.onVnodeMounted)||d)&&Qn((()=>{l&&$s(l,n,t),d&&Gr(t,null,n,"mounted")}),o),16&f&&(!u||!u.innerHTML&&!u.textContent)){let r=p(e.firstChild,t,e,n,o,s,i);for(;r;){Uo=!0;const e=r;r=r.nextSibling,c(e)}}else 8&f&&e.textContent!==t.children&&(Uo=!0,e.textContent=t.children)}return e.nextSibling},p=(e,t,r,o,s,i,c)=>{c=c||!!t.dynamicChildren;const l=t.children,u=l.length;for(let t=0;t{const{slotScopeIds:a}=t;a&&(o=o?o.concat(a):a);const f=i(e),d=p(s(e),t,f,n,r,o,c);return d&&Wo(d)&&"]"===d.data?s(t.anchor=d):(Uo=!0,l(t.anchor=u("]"),f,d),d)},h=(e,t,r,o,l,u)=>{if(Uo=!0,t.el=null,u){const t=m(e);for(;;){const n=s(e);if(!n||n===t)break;c(n)}}const a=s(e),f=i(e);return c(e),n(null,t,f,a,r,o,Ho(f),l),a},m=e=>{let t=0;for(;e;)if((e=s(e))&&Wo(e)&&("["===e.data&&t++,"]"===e.data)){if(0===t)return s(e);t--}return e};return[(e,t)=>{if(!t.hasChildNodes())return n(null,e,t),wn(),void(t._vnode=e);Uo=!1,a(t.firstChild,e,null,null,null),wn(),t._vnode=e,Uo&&console.error("Hydration completed but contains mismatches.")},a]}const Ko=Qn;function Go(e){return Jo(e)}function qo(e){return Jo(e,zo)}function Jo(e,t){ae().__VUE__=!0;const{insert:n,remove:r,patchProp:o,createElement:s,createText:i,createComment:c,setText:l,setElementText:u,parentNode:a,nextSibling:f,setScopeId:p=E,insertStaticContent:d}=e,h=(e,t,n,r=null,o=null,s=null,i=!1,c=null,l=!!t.dynamicChildren)=>{if(e===t)return;e&&!_s(e,t)&&(r=z(e),j(e,o,s,!0),e=null),-2===t.patchFlag&&(l=!1,t.dynamicChildren=null);const{type:u,ref:a,shapeFlag:f}=t;switch(u){case ss:m(e,t,n,r);break;case is:g(e,t,n,r);break;case cs:null==e&&v(t,n,r,i);break;case os:R(e,t,n,r,o,s,i,c,l);break;default:1&f?_(e,t,n,r,o,s,i,c,l):6&f?O(e,t,n,r,o,s,i,c,l):(64&f||128&f)&&u.process(e,t,n,r,o,s,i,c,l,G)}null!=a&&o&&Do(a,e&&e.ref,s,t||e,!t)},m=(e,t,r,o)=>{if(null==e)n(t.el=i(t.children),r,o);else{const n=t.el=e.el;t.children!==e.children&&l(n,t.children)}},g=(e,t,r,o)=>{null==e?n(t.el=c(t.children||""),r,o):t.el=e.el},v=(e,t,n,r)=>{[e.el,e.anchor]=d(e.children,t,n,r,e.el,e.anchor)},y=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=f(e),r(e),e=n;r(t)},_=(e,t,n,r,o,s,i,c,l)=>{i=i||"svg"===t.type,null==e?b(t,n,r,o,s,i,c,l):C(e,t,o,s,i,c,l)},b=(e,t,r,i,c,l,a,f)=>{let p,d;const{type:h,props:m,shapeFlag:g,transition:v,dirs:y}=e;if(p=e.el=s(e.type,l,m&&m.is,m),8&g?u(p,e.children):16&g&&x(e.children,p,null,i,c,l&&"foreignObject"!==h,a,f),y&&Gr(e,null,i,"created"),S(p,e,e.scopeId,a,i),m){for(const t in m)"value"===t||J(t)||o(p,t,null,m[t],l,e.children,i,c,W);"value"in m&&o(p,"value",null,m.value),(d=m.onVnodeBeforeMount)&&$s(d,i,e)}y&&Gr(e,null,i,"beforeMount");const _=(!c||c&&!c.pendingBranch)&&v&&!v.persisted;_&&v.beforeEnter(p),n(p,t,r),((d=m&&m.onVnodeMounted)||_||y)&&Ko((()=>{d&&$s(d,i,e),_&&v.enter(p),y&&Gr(e,null,i,"mounted")}),c)},S=(e,t,n,r,o)=>{if(n&&p(e,n),r)for(let t=0;t{for(let u=l;u{const l=t.el=e.el;let{patchFlag:a,dynamicChildren:f,dirs:p}=t;a|=16&e.patchFlag;const d=e.props||w,h=t.props||w;let m;n&&Yo(n,!1),(m=h.onVnodeBeforeUpdate)&&$s(m,n,t,e),p&&Gr(t,e,n,"beforeUpdate"),n&&Yo(n,!0);const g=s&&"foreignObject"!==t.type;if(f?T(e.dynamicChildren,f,l,n,r,g,i):c||$(e,t,l,null,n,r,g,i,!1),a>0){if(16&a)N(l,t,d,h,n,r,s);else if(2&a&&d.class!==h.class&&o(l,"class",null,h.class,s),4&a&&o(l,"style",d.style,h.style,s),8&a){const i=t.dynamicProps;for(let t=0;t{m&&$s(m,n,t,e),p&&Gr(t,e,n,"updated")}),r)},T=(e,t,n,r,o,s,i)=>{for(let c=0;c{if(n!==r){if(n!==w)for(const l in n)J(l)||l in r||o(e,l,n[l],null,c,t.children,s,i,W);for(const l in r){if(J(l))continue;const u=r[l],a=n[l];u!==a&&"value"!==l&&o(e,l,a,u,c,t.children,s,i,W)}"value"in r&&o(e,"value",n.value,r.value)}},R=(e,t,r,o,s,c,l,u,a)=>{const f=t.el=e?e.el:i(""),p=t.anchor=e?e.anchor:i("");let{patchFlag:d,dynamicChildren:h,slotScopeIds:m}=t;m&&(u=u?u.concat(m):m),null==e?(n(f,r,o),n(p,r,o),x(t.children,r,p,s,c,l,u,a)):d>0&&64&d&&h&&e.dynamicChildren?(T(e.dynamicChildren,h,r,s,c,l,u),(null!=t.key||s&&t===s.subTree)&&Zo(e,t,!0)):$(e,t,r,p,s,c,l,u,a)},O=(e,t,n,r,o,s,i,c,l)=>{t.slotScopeIds=c,null==e?512&t.shapeFlag?o.ctx.activate(t,n,r,i,l):M(t,n,r,o,s,i,l):P(e,t,l)},M=(e,t,n,r,o,s,i)=>{const c=e.component=Bs(e,r,o);if(kr(e)&&(c.ctx.renderer=G),qs(c),c.asyncDep){if(o&&o.registerDep(c,A),!e.el){const e=c.subTree=ks(is);g(null,e,t,n)}}else A(c,e,t,n,o,s,i)},P=(e,t,n)=>{const r=t.component=e.component;if(function(e,t,n){const{props:r,children:o,component:s}=e,{props:i,children:c,patchFlag:l}=t,u=s.emitsOptions;if(t.dirs||t.transition)return!0;if(!(n&&l>=0))return!(!o&&!c||c&&c.$stable)||r!==i&&(r?!i||Kn(r,i,u):!!i);if(1024&l)return!0;if(16&l)return r?Kn(r,i,u):!!i;if(8&l){const e=t.dynamicProps;for(let t=0;tdn&&pn.splice(t,1)}(r.update),r.update()}else t.el=e.el,r.vnode=t},A=(e,t,n,r,o,s,i)=>{const c=e.effect=new Te((()=>{if(e.isMounted){let t,{next:n,bu:r,u:c,parent:l,vnode:u}=e,f=n;0,Yo(e,!1),n?(n.el=u.el,F(e,n,i)):n=u,r&&se(r),(t=n.props&&n.props.onVnodeBeforeUpdate)&&$s(t,l,n,u),Yo(e,!0);const p=Un(e);0;const d=e.subTree;e.subTree=p,h(d,p,a(d.el),z(d),e,o,s),n.el=p.el,null===f&&Gn(e,p.el),c&&Ko(c,o),(t=n.props&&n.props.onVnodeUpdated)&&Ko((()=>$s(t,l,n,u)),o)}else{let i;const{el:c,props:l}=t,{bm:u,m:a,parent:f}=e,p=xr(t);if(Yo(e,!1),u&&se(u),!p&&(i=l&&l.onVnodeBeforeMount)&&$s(i,f,t),Yo(e,!0),c&&Y){const n=()=>{e.subTree=Un(e),Y(c,e.subTree,e,o,null)};p?t.type.__asyncLoader().then((()=>!e.isUnmounted&&n())):n()}else{0;const i=e.subTree=Un(e);0,h(null,i,n,r,e,o,s),t.el=i.el}if(a&&Ko(a,o),!p&&(i=l&&l.onVnodeMounted)){const e=t;Ko((()=>$s(i,f,e)),o)}(256&t.shapeFlag||f&&xr(f.vnode)&&256&f.vnode.shapeFlag)&&e.a&&Ko(e.a,o),e.isMounted=!0,t=n=r=null}}),(()=>bn(l)),e.scope),l=e.update=()=>c.run();l.id=e.uid,Yo(e,!0),l()},F=(e,t,n)=>{t.component=e;const r=e.vnode.props;e.vnode=t,e.next=null,function(e,t,n,r){const{props:o,attrs:s,vnode:{patchFlag:i}}=e,c=$t(o),[l]=e.propsOptions;let u=!1;if(!(r||i>0)||16&i){let r;wo(e,t,o,s)&&(u=!0);for(const s in c)t&&(I(t,s)||(r=te(s))!==s&&I(t,r))||(l?!n||void 0===n[s]&&void 0===n[r]||(o[s]=ko(l,c,s,void 0,e,!0)):delete o[s]);if(s!==c)for(const e in s)t&&I(t,e)||(delete s[e],u=!0)}else if(8&i){const n=e.vnode.dynamicProps;for(let r=0;r{const a=e&&e.children,f=e?e.shapeFlag:0,p=t.children,{patchFlag:d,shapeFlag:h}=t;if(d>0){if(128&d)return void V(a,p,n,r,o,s,i,c,l);if(256&d)return void L(a,p,n,r,o,s,i,c,l)}8&h?(16&f&&W(a,o,s),p!==a&&u(n,p)):16&f?16&h?V(a,p,n,r,o,s,i,c,l):W(a,o,s,!0):(8&f&&u(n,""),16&h&&x(p,n,r,o,s,i,c,l))},L=(e,t,n,r,o,s,i,c,l)=>{t=t||k;const u=(e=e||k).length,a=t.length,f=Math.min(u,a);let p;for(p=0;pa?W(e,o,s,!0,!1,f):x(t,n,r,o,s,i,c,l,f)},V=(e,t,n,r,o,s,i,c,l)=>{let u=0;const a=t.length;let f=e.length-1,p=a-1;for(;u<=f&&u<=p;){const r=e[u],a=t[u]=l?As(t[u]):Ps(t[u]);if(!_s(r,a))break;h(r,a,n,null,o,s,i,c,l),u++}for(;u<=f&&u<=p;){const r=e[f],u=t[p]=l?As(t[p]):Ps(t[p]);if(!_s(r,u))break;h(r,u,n,null,o,s,i,c,l),f--,p--}if(u>f){if(u<=p){const e=p+1,f=ep)for(;u<=f;)j(e[u],o,s,!0),u++;else{const d=u,m=u,g=new Map;for(u=m;u<=p;u++){const e=t[u]=l?As(t[u]):Ps(t[u]);null!=e.key&&g.set(e.key,u)}let v,y=0;const _=p-m+1;let b=!1,S=0;const x=new Array(_);for(u=0;u<_;u++)x[u]=0;for(u=d;u<=f;u++){const r=e[u];if(y>=_){j(r,o,s,!0);continue}let a;if(null!=r.key)a=g.get(r.key);else for(v=m;v<=p;v++)if(0===x[v-m]&&_s(r,t[v])){a=v;break}void 0===a?j(r,o,s,!0):(x[a-m]=u+1,a>=S?S=a:b=!0,h(r,t[a],n,null,o,s,i,c,l),y++)}const C=b?function(e){const t=e.slice(),n=[0];let r,o,s,i,c;const l=e.length;for(r=0;r>1,e[n[c]]0&&(t[r]=n[s-1]),n[s]=r)}}s=n.length,i=n[s-1];for(;s-- >0;)n[s]=i,i=t[i];return n}(x):k;for(v=C.length-1,u=_-1;u>=0;u--){const e=m+u,f=t[e],p=e+1{const{el:i,type:c,transition:l,children:u,shapeFlag:a}=e;if(6&a)return void B(e.component.subTree,t,r,o);if(128&a)return void e.suspense.move(t,r,o);if(64&a)return void c.move(e,t,r,G);if(c===os){n(i,t,r);for(let e=0;e{let s;for(;e&&e!==t;)s=f(e),n(e,r,o),e=s;n(t,r,o)})(e,t,r);if(2!==o&&1&a&&l)if(0===o)l.beforeEnter(i),n(i,t,r),Ko((()=>l.enter(i)),s);else{const{leave:e,delayLeave:o,afterLeave:s}=l,c=()=>n(i,t,r),u=()=>{e(i,(()=>{c(),s&&s()}))};o?o(i,c,u):u()}else n(i,t,r)},j=(e,t,n,r=!1,o=!1)=>{const{type:s,props:i,ref:c,children:l,dynamicChildren:u,shapeFlag:a,patchFlag:f,dirs:p}=e;if(null!=c&&Do(c,null,n,e,!0),256&a)return void t.ctx.deactivate(e);const d=1&a&&p,h=!xr(e);let m;if(h&&(m=i&&i.onVnodeBeforeUnmount)&&$s(m,t,e),6&a)H(e.component,n,r);else{if(128&a)return void e.suspense.unmount(n,r);d&&Gr(e,null,t,"beforeUnmount"),64&a?e.type.remove(e,t,n,o,G,r):u&&(s!==os||f>0&&64&f)?W(u,t,n,!1,!0):(s===os&&384&f||!o&&16&a)&&W(l,t,n),r&&D(e)}(h&&(m=i&&i.onVnodeUnmounted)||d)&&Ko((()=>{m&&$s(m,t,e),d&&Gr(e,null,t,"unmounted")}),n)},D=e=>{const{type:t,el:n,anchor:o,transition:s}=e;if(t===os)return void U(n,o);if(t===cs)return void y(e);const i=()=>{r(n),s&&!s.persisted&&s.afterLeave&&s.afterLeave()};if(1&e.shapeFlag&&s&&!s.persisted){const{leave:t,delayLeave:r}=s,o=()=>t(n,i);r?r(e.el,i,o):o()}else i()},U=(e,t)=>{let n;for(;e!==t;)n=f(e),r(e),e=n;r(t)},H=(e,t,n)=>{const{bum:r,scope:o,update:s,subTree:i,um:c}=e;r&&se(r),o.stop(),s&&(s.active=!1,j(i,e,t,n)),c&&Ko(c,t),Ko((()=>{e.isUnmounted=!0}),t),t&&t.pendingBranch&&!t.isUnmounted&&e.asyncDep&&!e.asyncResolved&&e.suspenseId===t.pendingId&&(t.deps--,0===t.deps&&t.resolve())},W=(e,t,n,r=!1,o=!1,s=0)=>{for(let i=s;i6&e.shapeFlag?z(e.component.subTree):128&e.shapeFlag?e.suspense.next():f(e.anchor||e.el),K=(e,t,n)=>{null==e?t._vnode&&j(t._vnode,null,null,!0):h(t._vnode||null,e,t,null,null,null,n),Cn(),wn(),t._vnode=e},G={p:h,um:j,m:B,r:D,mt:M,mc:x,pc:$,pbc:T,n:z,o:e};let q,Y;return t&&([q,Y]=t(G)),{render:K,hydrate:q,createApp:jo(K,q)}}function Yo({effect:e,update:t},n){e.allowRecurse=t.allowRecurse=n}function Zo(e,t,n=!1){const r=e.children,o=t.children;if(F(r)&&F(o))for(let e=0;ee&&(e.disabled||""===e.disabled),Qo=e=>"undefined"!=typeof SVGElement&&e instanceof SVGElement,es=(e,t)=>{const n=e&&e.to;if(j(n)){if(t){const e=t(n);return e}return null}return n};function ts(e,t,n,{o:{insert:r},m:o},s=2){0===s&&r(e.targetAnchor,t,n);const{el:i,anchor:c,shapeFlag:l,children:u,props:a}=e,f=2===s;if(f&&r(i,t,n),(!f||Xo(a))&&16&l)for(let e=0;e{16&y&&a(_,e,t,o,s,i,c,l)};v?g(n,u):f&&g(f,p)}else{t.el=e.el;const r=t.anchor=e.anchor,a=t.target=e.target,d=t.targetAnchor=e.targetAnchor,m=Xo(e.props),g=m?n:a,y=m?r:d;if(i=i||Qo(a),b?(p(e.dynamicChildren,b,g,o,s,i,c),Zo(e,t,!0)):l||f(e,t,g,y,o,s,i,c,!1),v)m||ts(t,n,r,u,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const e=t.target=es(t.props,h);e&&ts(t,e,null,u,0)}else m&&ts(t,a,d,u,1)}rs(t)},remove(e,t,n,r,{um:o,o:{remove:s}},i){const{shapeFlag:c,children:l,anchor:u,targetAnchor:a,target:f,props:p}=e;if(f&&s(a),(i||!Xo(p))&&(s(u),16&c))for(let e=0;e0?us||k:null,fs(),ds>0&&us&&us.push(e),e}function gs(e,t,n,r,o,s){return ms(ws(e,t,n,r,o,s,!0))}function vs(e,t,n,r,o){return ms(ks(e,t,n,r,o,!0))}function ys(e){return!!e&&!0===e.__v_isVNode}function _s(e,t){return e.type===t.type&&e.key===t.key}function bs(e){ps=e}const Ss="__vInternal",xs=({key:e})=>null!=e?e:null,Cs=({ref:e,ref_key:t,ref_for:n})=>null!=e?j(e)||Ut(e)||B(e)?{i:Fn,r:e,k:t,f:!!n}:e:null;function ws(e,t=null,n=null,r=0,o=null,s=(e===os?0:1),i=!1,c=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&xs(t),ref:t&&Cs(t),scopeId:$n,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:r,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:Fn};return c?(Is(l,n),128&s&&e.normalize(l)):n&&(l.shapeFlag|=j(n)?8:16),ds>0&&!i&&us&&(l.patchFlag>0||6&s)&&32!==l.patchFlag&&us.push(l),l}const ks=Es;function Es(e,t=null,n=null,r=0,o=null,s=!1){if(e&&e!==Zr||(e=is),ys(e)){const r=Ns(e,t,!0);return n&&Is(r,n),ds>0&&!s&&us&&(6&r.shapeFlag?us[us.indexOf(e)]=r:us.push(r)),r.patchFlag|=-2,r}if(ni(e)&&(e=e.__vccOpts),t){t=Ts(t);let{class:e,style:n}=t;e&&!j(e)&&(t.class=p(e)),U(n)&&(Ft(n)&&!F(n)&&(n=M({},n)),t.style=c(n))}return ws(e,t,n,r,o,j(e)?1:qn(e)?128:(e=>e.__isTeleport)(e)?64:U(e)?4:B(e)?2:0,s,!0)}function Ts(e){return e?Ft(e)||Ss in e?M({},e):e:null}function Ns(e,t,n=!1){const{props:r,ref:o,patchFlag:s,children:i}=e,c=t?Fs(r||{},t):r;return{__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&xs(c),ref:t&&t.ref?n&&o?F(o)?o.concat(Cs(t)):[o,Cs(t)]:Cs(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:i,target:e.target,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==os?-1===s?16:16|s:s,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:e.transition,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Ns(e.ssContent),ssFallback:e.ssFallback&&Ns(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce}}function Rs(e=" ",t=0){return ks(ss,null,e,t)}function Os(e,t){const n=ks(cs,null,e);return n.staticCount=t,n}function Ms(e="",t=!1){return t?(as(),vs(is,null,e)):ks(is,null,e)}function Ps(e){return null==e||"boolean"==typeof e?ks(is):F(e)?ks(os,null,e.slice()):"object"==typeof e?As(e):ks(ss,null,String(e))}function As(e){return null===e.el&&-1!==e.patchFlag||e.memo?e:Ns(e)}function Is(e,t){let n=0;const{shapeFlag:r}=e;if(null==t)t=null;else if(F(t))n=16;else if("object"==typeof t){if(65&r){const n=t.default;return void(n&&(n._c&&(n._d=!1),Is(e,n()),n._c&&(n._d=!0)))}{n=32;const r=t._;r||Ss in t?3===r&&Fn&&(1===Fn.slots._?t._=1:(t._=2,e.patchFlag|=1024)):t._ctx=Fn}}else B(t)?(t={default:t,_ctx:Fn},n=32):(t=String(t),64&r?(n=16,t=[Rs(t)]):n=8);e.children=t,e.shapeFlag|=n}function Fs(...e){const t={};for(let n=0;njs||Fn,Us=e=>{js=e,e.scope.on()},Hs=()=>{js&&js.scope.off(),js=null};function Ws(e){return 4&e.vnode.shapeFlag}let zs,Ks,Gs=!1;function qs(e,t=!1){Gs=t;const{props:n,children:r}=e.vnode,o=Ws(e);!function(e,t,n,r=!1){const o={},s={};ie(s,Ss,1),e.propsDefaults=Object.create(null),wo(e,t,o,s);for(const t in e.propsOptions[0])t in o||(o[t]=void 0);n?e.props=r?o:Nt(o):e.type.props?e.props=o:e.props=s,e.attrs=s}(e,n,o,t),$o(e,r);const s=o?function(e,t){const n=e.type;0;e.accessCache=Object.create(null),e.proxy=Lt(new Proxy(e.ctx,ao)),!1;const{setup:r}=n;if(r){const n=e.setupContext=r.length>1?Qs(e):null;Us(e),Ae();const o=cn(r,e,0,[e.props,n]);if(Ie(),Hs(),H(o)){if(o.then(Hs,Hs),t)return o.then((n=>{Js(e,n,t)})).catch((t=>{un(t,e,0)}));e.asyncDep=o}else Js(e,o,t)}else Xs(e,t)}(e,t):void 0;return Gs=!1,s}function Js(e,t,n){B(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:U(t)&&(e.setupState=Yt(t)),Xs(e,n)}function Ys(e){zs=e,Ks=e=>{e.render._rc&&(e.withProxy=new Proxy(e.ctx,fo))}}const Zs=()=>!zs;function Xs(e,t,n){const r=e.type;if(!e.render){if(!t&&zs&&!r.render){const t=r.template||vo(e).template;if(t){0;const{isCustomElement:n,compilerOptions:o}=e.appContext.config,{delimiters:s,compilerOptions:i}=r,c=M(M({isCustomElement:n,delimiters:s},o),i);r.render=zs(t,c)}}e.render=r.render||E,Ks&&Ks(e)}Us(e),Ae(),ho(e),Ie(),Hs()}function Qs(e){const t=t=>{e.exposed=t||{}};let n;return{get attrs(){return n||(n=function(e){return new Proxy(e.attrs,{get(t,n){return Fe(e,0,"$attrs"),t[n]}})}(e))},slots:e.slots,emit:e.emit,expose:t}}function ei(e){if(e.exposed)return e.exposeProxy||(e.exposeProxy=new Proxy(Yt(Lt(e.exposed)),{get(t,n){return n in t?t[n]:n in lo?lo[n](e):void 0},has(e,t){return t in e||t in lo}}))}function ti(e,t=!0){return B(e)?e.displayName||e.name:e.name||t&&e.__name}function ni(e){return B(e)&&"__vccOpts"in e}const ri=(e,t)=>function(e,t,n=!1){let r,o;const s=B(e);return s?(r=e,o=E):(r=e.get,o=e.set),new rn(r,o,s||!o,n)}(e,0,Gs);function oi(){return null}function si(){return null}function ii(e){0}function ci(e,t){return null}function li(){return ai().slots}function ui(){return ai().attrs}function ai(){const e=Ds();return e.setupContext||(e.setupContext=Qs(e))}function fi(e,t){const n=F(e)?e.reduce(((e,t)=>(e[t]={},e)),{}):e;for(const e in t){const r=n[e];r?F(r)||B(r)?n[e]={type:r,default:t[e]}:r.default=t[e]:null===r&&(n[e]={default:t[e]})}return n}function pi(e,t){const n={};for(const r in e)t.includes(r)||Object.defineProperty(n,r,{enumerable:!0,get:()=>e[r]});return n}function di(e){const t=Ds();let n=e();return Hs(),H(n)&&(n=n.catch((e=>{throw Us(t),e}))),[n,()=>Us(t)]}function hi(e,t,n){const r=arguments.length;return 2===r?U(t)&&!F(t)?ys(t)?ks(e,null,[t]):ks(e,t):ks(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):3===r&&ys(n)&&(n=[n]),ks(e,t,n))}const mi=Symbol(""),gi=()=>{{const e=nr(mi);return e}};function vi(){return void 0}function yi(e,t,n,r){const o=n[r];if(o&&_i(o,e))return o;const s=t();return s.memo=e.slice(),n[r]=s}function _i(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let e=0;e0&&us&&us.push(e),!0}const bi="3.2.47",Si={createComponentInstance:Bs,setupComponent:qs,renderComponentRoot:Un,setCurrentRenderingInstance:Ln,isVNode:ys,normalizeVNode:Ps},xi=null,Ci=null,wi="undefined"!=typeof document?document:null,ki=wi&&wi.createElement("template"),Ei={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const o=t?wi.createElementNS("http://www.w3.org/2000/svg",e):wi.createElement(e,n?{is:n}:void 0);return"select"===e&&r&&null!=r.multiple&&o.setAttribute("multiple",r.multiple),o},createText:e=>wi.createTextNode(e),createComment:e=>wi.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>wi.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,o,s){const i=n?n.previousSibling:t.lastChild;if(o&&(o===s||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),o!==s&&(o=o.nextSibling););else{ki.innerHTML=r?`${e}`:e;const o=ki.content;if(r){const e=o.firstChild;for(;e.firstChild;)o.appendChild(e.firstChild);o.removeChild(e)}t.insertBefore(o,n)}return[i?i.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}};const Ti=/\s*!important$/;function Ni(e,t,n){if(F(n))n.forEach((n=>Ni(e,t,n)));else if(null==n&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=function(e,t){const n=Oi[t];if(n)return n;let r=Q(t);if("filter"!==r&&r in e)return Oi[t]=r;r=ne(r);for(let n=0;n{if(e._vts){if(e._vts<=n.attached)return}else e._vts=Date.now();ln(function(e,t){if(F(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map((e=>t=>!t._stopped&&e&&e(t)))}return t}(e,n.value),t,5,[e])};return n.value=e,n.attached=Li(),n}(r,o);Pi(e,n,i,c)}else i&&(!function(e,t,n,r){e.removeEventListener(t,n,r)}(e,n,i,c),s[t]=void 0)}}const Ii=/(?:Once|Passive|Capture)$/;let Fi=0;const $i=Promise.resolve(),Li=()=>Fi||($i.then((()=>Fi=0)),Fi=Date.now());const Vi=/^on[a-z]/;function Bi(e,t){const n=Sr(e);class r extends Ui{constructor(e){super(n,e,t)}}return r.def=n,r}const ji=e=>Bi(e,zc),Di="undefined"!=typeof HTMLElement?HTMLElement:class{};class Ui extends Di{constructor(e,t={},n){super(),this._def=e,this._props=t,this._instance=null,this._connected=!1,this._resolved=!1,this._numberProps=null,this.shadowRoot&&n?n(this._createVNode(),this.shadowRoot):(this.attachShadow({mode:"open"}),this._def.__asyncLoader||this._resolveProps(this._def))}connectedCallback(){this._connected=!0,this._instance||(this._resolved?this._update():this._resolveDef())}disconnectedCallback(){this._connected=!1,_n((()=>{this._connected||(Wc(null,this.shadowRoot),this._instance=null)}))}_resolveDef(){this._resolved=!0;for(let e=0;e{for(const t of e)this._setAttr(t.attributeName)})).observe(this,{attributes:!0});const e=(e,t=!1)=>{const{props:n,styles:r}=e;let o;if(n&&!F(n))for(const e in n){const t=n[e];(t===Number||t&&t.type===Number)&&(e in this._props&&(this._props[e]=le(this._props[e])),(o||(o=Object.create(null)))[Q(e)]=!0)}this._numberProps=o,t&&this._resolveProps(e),this._applyStyles(r),this._update()},t=this._def.__asyncLoader;t?t().then((t=>e(t,!0))):e(this._def)}_resolveProps(e){const{props:t}=e,n=F(t)?t:Object.keys(t||{});for(const e of Object.keys(this))"_"!==e[0]&&n.includes(e)&&this._setProp(e,this[e],!0,!1);for(const e of n.map(Q))Object.defineProperty(this,e,{get(){return this._getProp(e)},set(t){this._setProp(e,t)}})}_setAttr(e){let t=this.getAttribute(e);const n=Q(e);this._numberProps&&this._numberProps[n]&&(t=le(t)),this._setProp(n,t,!1)}_getProp(e){return this._props[e]}_setProp(e,t,n=!0,r=!0){t!==this._props[e]&&(this._props[e]=t,r&&this._instance&&this._update(),n&&(!0===t?this.setAttribute(te(e),""):"string"==typeof t||"number"==typeof t?this.setAttribute(te(e),t+""):t||this.removeAttribute(te(e))))}_update(){Wc(this._createVNode(),this.shadowRoot)}_createVNode(){const e=ks(this._def,M({},this._props));return this._instance||(e.ce=e=>{this._instance=e,e.isCE=!0;const t=(e,t)=>{this.dispatchEvent(new CustomEvent(e,{detail:t}))};e.emit=(e,...n)=>{t(e,n),te(e)!==e&&t(te(e),n)};let n=this;for(;n=n&&(n.parentNode||n.host);)if(n instanceof Ui){e.parent=n._instance,e.provides=n._instance.provides;break}}),e}_applyStyles(e){e&&e.forEach((e=>{const t=document.createElement("style");t.textContent=e,this.shadowRoot.appendChild(t)}))}}function Hi(e="$style"){{const t=Ds();if(!t)return w;const n=t.type.__cssModules;if(!n)return w;const r=n[e];return r||w}}function Wi(e){const t=Ds();if(!t)return;const n=t.ut=(n=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach((e=>Ki(e,n)))},r=()=>{const r=e(t.proxy);zi(t.subTree,r),n(r)};or(r),Lr((()=>{const e=new MutationObserver(r);e.observe(t.subTree.el.parentNode,{childList:!0}),Dr((()=>e.disconnect()))}))}function zi(e,t){if(128&e.shapeFlag){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push((()=>{zi(n.activeBranch,t)}))}for(;e.component;)e=e.component.subTree;if(1&e.shapeFlag&&e.el)Ki(e.el,t);else if(e.type===os)e.children.forEach((e=>zi(e,t)));else if(e.type===cs){let{el:n,anchor:r}=e;for(;n&&(Ki(n,t),n!==r);)n=n.nextSibling}}function Ki(e,t){if(1===e.nodeType){const n=e.style;for(const e in t)n.setProperty(`--${e}`,t[e])}}const Gi="transition",qi="animation",Ji=(e,{slots:t})=>hi(hr,ec(e),t);Ji.displayName="Transition";const Yi={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},Zi=Ji.props=M({},hr.props,Yi),Xi=(e,t=[])=>{F(e)?e.forEach((e=>e(...t))):e&&e(...t)},Qi=e=>!!e&&(F(e)?e.some((e=>e.length>1)):e.length>1);function ec(e){const t={};for(const n in e)n in Yi||(t[n]=e[n]);if(!1===e.css)return t;const{name:n="v",type:r,duration:o,enterFromClass:s=`${n}-enter-from`,enterActiveClass:i=`${n}-enter-active`,enterToClass:c=`${n}-enter-to`,appearFromClass:l=s,appearActiveClass:u=i,appearToClass:a=c,leaveFromClass:f=`${n}-leave-from`,leaveActiveClass:p=`${n}-leave-active`,leaveToClass:d=`${n}-leave-to`}=e,h=function(e){if(null==e)return null;if(U(e))return[tc(e.enter),tc(e.leave)];{const t=tc(e);return[t,t]}}(o),m=h&&h[0],g=h&&h[1],{onBeforeEnter:v,onEnter:y,onEnterCancelled:_,onLeave:b,onLeaveCancelled:S,onBeforeAppear:x=v,onAppear:C=y,onAppearCancelled:w=_}=t,k=(e,t,n)=>{rc(e,t?a:c),rc(e,t?u:i),n&&n()},E=(e,t)=>{e._isLeaving=!1,rc(e,f),rc(e,d),rc(e,p),t&&t()},T=e=>(t,n)=>{const o=e?C:y,i=()=>k(t,e,n);Xi(o,[t,i]),oc((()=>{rc(t,e?l:s),nc(t,e?a:c),Qi(o)||ic(t,r,m,i)}))};return M(t,{onBeforeEnter(e){Xi(v,[e]),nc(e,s),nc(e,i)},onBeforeAppear(e){Xi(x,[e]),nc(e,l),nc(e,u)},onEnter:T(!1),onAppear:T(!0),onLeave(e,t){e._isLeaving=!0;const n=()=>E(e,t);nc(e,f),ac(),nc(e,p),oc((()=>{e._isLeaving&&(rc(e,f),nc(e,d),Qi(b)||ic(e,r,g,n))})),Xi(b,[e,n])},onEnterCancelled(e){k(e,!1),Xi(_,[e])},onAppearCancelled(e){k(e,!0),Xi(w,[e])},onLeaveCancelled(e){E(e),Xi(S,[e])}})}function tc(e){return le(e)}function nc(e,t){t.split(/\s+/).forEach((t=>t&&e.classList.add(t))),(e._vtc||(e._vtc=new Set)).add(t)}function rc(e,t){t.split(/\s+/).forEach((t=>t&&e.classList.remove(t)));const{_vtc:n}=e;n&&(n.delete(t),n.size||(e._vtc=void 0))}function oc(e){requestAnimationFrame((()=>{requestAnimationFrame(e)}))}let sc=0;function ic(e,t,n,r){const o=e._endId=++sc,s=()=>{o===e._endId&&r()};if(n)return setTimeout(s,n);const{type:i,timeout:c,propCount:l}=cc(e,t);if(!i)return r();const u=i+"end";let a=0;const f=()=>{e.removeEventListener(u,p),s()},p=t=>{t.target===e&&++a>=l&&f()};setTimeout((()=>{a(n[e]||"").split(", "),o=r(`${Gi}Delay`),s=r(`${Gi}Duration`),i=lc(o,s),c=r(`${qi}Delay`),l=r(`${qi}Duration`),u=lc(c,l);let a=null,f=0,p=0;t===Gi?i>0&&(a=Gi,f=i,p=s.length):t===qi?u>0&&(a=qi,f=u,p=l.length):(f=Math.max(i,u),a=f>0?i>u?Gi:qi:null,p=a?a===Gi?s.length:l.length:0);return{type:a,timeout:f,propCount:p,hasTransform:a===Gi&&/\b(transform|all)(,|$)/.test(r(`${Gi}Property`).toString())}}function lc(e,t){for(;e.lengthuc(t)+uc(e[n]))))}function uc(e){return 1e3*Number(e.slice(0,-1).replace(",","."))}function ac(){return document.body.offsetHeight}const fc=new WeakMap,pc=new WeakMap,dc={name:"TransitionGroup",props:M({},Zi,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=Ds(),r=pr();let o,s;return Br((()=>{if(!o.length)return;const t=e.moveClass||`${e.name||"v"}-move`;if(!function(e,t,n){const r=e.cloneNode();e._vtc&&e._vtc.forEach((e=>{e.split(/\s+/).forEach((e=>e&&r.classList.remove(e)))}));n.split(/\s+/).forEach((e=>e&&r.classList.add(e))),r.style.display="none";const o=1===t.nodeType?t:t.parentNode;o.appendChild(r);const{hasTransform:s}=cc(r);return o.removeChild(r),s}(o[0].el,n.vnode.el,t))return;o.forEach(mc),o.forEach(gc);const r=o.filter(vc);ac(),r.forEach((e=>{const n=e.el,r=n.style;nc(n,t),r.transform=r.webkitTransform=r.transitionDuration="";const o=n._moveCb=e=>{e&&e.target!==n||e&&!/transform$/.test(e.propertyName)||(n.removeEventListener("transitionend",o),n._moveCb=null,rc(n,t))};n.addEventListener("transitionend",o)}))})),()=>{const i=$t(e),c=ec(i);let l=i.tag||os;o=s,s=t.default?br(t.default()):[];for(let e=0;e{const t=e.props["onUpdate:modelValue"]||!1;return F(t)?e=>se(t,e):t};function _c(e){e.target.composing=!0}function bc(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Sc={created(e,{modifiers:{lazy:t,trim:n,number:r}},o){e._assign=yc(o);const s=r||o.props&&"number"===o.props.type;Pi(e,t?"change":"input",(t=>{if(t.target.composing)return;let r=e.value;n&&(r=r.trim()),s&&(r=ce(r)),e._assign(r)})),n&&Pi(e,"change",(()=>{e.value=e.value.trim()})),t||(Pi(e,"compositionstart",_c),Pi(e,"compositionend",bc),Pi(e,"change",bc))},mounted(e,{value:t}){e.value=null==t?"":t},beforeUpdate(e,{value:t,modifiers:{lazy:n,trim:r,number:o}},s){if(e._assign=yc(s),e.composing)return;if(document.activeElement===e&&"range"!==e.type){if(n)return;if(r&&e.value.trim()===t)return;if((o||"number"===e.type)&&ce(e.value)===t)return}const i=null==t?"":t;e.value!==i&&(e.value=i)}},xc={deep:!0,created(e,t,n){e._assign=yc(n),Pi(e,"change",(()=>{const t=e._modelValue,n=Tc(e),r=e.checked,o=e._assign;if(F(t)){const e=S(t,n),s=-1!==e;if(r&&!s)o(t.concat(n));else if(!r&&s){const n=[...t];n.splice(e,1),o(n)}}else if(L(t)){const e=new Set(t);r?e.add(n):e.delete(n),o(e)}else o(Nc(e,r))}))},mounted:Cc,beforeUpdate(e,t,n){e._assign=yc(n),Cc(e,t,n)}};function Cc(e,{value:t,oldValue:n},r){e._modelValue=t,F(t)?e.checked=S(t,r.props.value)>-1:L(t)?e.checked=t.has(r.props.value):t!==n&&(e.checked=b(t,Nc(e,!0)))}const wc={created(e,{value:t},n){e.checked=b(t,n.props.value),e._assign=yc(n),Pi(e,"change",(()=>{e._assign(Tc(e))}))},beforeUpdate(e,{value:t,oldValue:n},r){e._assign=yc(r),t!==n&&(e.checked=b(t,r.props.value))}},kc={deep:!0,created(e,{value:t,modifiers:{number:n}},r){const o=L(t);Pi(e,"change",(()=>{const t=Array.prototype.filter.call(e.options,(e=>e.selected)).map((e=>n?ce(Tc(e)):Tc(e)));e._assign(e.multiple?o?new Set(t):t:t[0])})),e._assign=yc(r)},mounted(e,{value:t}){Ec(e,t)},beforeUpdate(e,t,n){e._assign=yc(n)},updated(e,{value:t}){Ec(e,t)}};function Ec(e,t){const n=e.multiple;if(!n||F(t)||L(t)){for(let r=0,o=e.options.length;r-1:o.selected=t.has(s);else if(b(Tc(o),t))return void(e.selectedIndex!==r&&(e.selectedIndex=r))}n||-1===e.selectedIndex||(e.selectedIndex=-1)}}function Tc(e){return"_value"in e?e._value:e.value}function Nc(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const Rc={created(e,t,n){Mc(e,t,n,null,"created")},mounted(e,t,n){Mc(e,t,n,null,"mounted")},beforeUpdate(e,t,n,r){Mc(e,t,n,r,"beforeUpdate")},updated(e,t,n,r){Mc(e,t,n,r,"updated")}};function Oc(e,t){switch(e){case"SELECT":return kc;case"TEXTAREA":return Sc;default:switch(t){case"checkbox":return xc;case"radio":return wc;default:return Sc}}}function Mc(e,t,n,r,o){const s=Oc(e.tagName,n.props&&n.props.type)[o];s&&s(e,t,n,r)}const Pc=["ctrl","shift","alt","meta"],Ac={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&0!==e.button,middle:e=>"button"in e&&1!==e.button,right:e=>"button"in e&&2!==e.button,exact:(e,t)=>Pc.some((n=>e[`${n}Key`]&&!t.includes(n)))},Ic=(e,t)=>(n,...r)=>{for(let e=0;en=>{if(!("key"in n))return;const r=te(n.key);return t.some((e=>e===r||Fc[e]===r))?e(n):void 0},Lc={beforeMount(e,{value:t},{transition:n}){e._vod="none"===e.style.display?"":e.style.display,n&&t?n.beforeEnter(e):Vc(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:r}){!t!=!n&&(r?t?(r.beforeEnter(e),Vc(e,!0),r.enter(e)):r.leave(e,(()=>{Vc(e,!1)})):Vc(e,t))},beforeUnmount(e,{value:t}){Vc(e,t)}};function Vc(e,t){e.style.display=t?e._vod:"none"}const Bc=M({patchProp:(e,t,n,r,o=!1,s,i,c,l)=>{"class"===t?function(e,t,n){const r=e._vtc;r&&(t=(t?[t,...r]:[...r]).join(" ")),null==t?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}(e,r,o):"style"===t?function(e,t,n){const r=e.style,o=j(n);if(n&&!o){if(t&&!j(t))for(const e in t)null==n[e]&&Ni(r,e,"");for(const e in n)Ni(r,e,n[e])}else{const s=r.display;o?t!==n&&(r.cssText=n):t&&e.removeAttribute("style"),"_vod"in e&&(r.display=s)}}(e,n,r):R(t)?O(t)||Ai(e,t,0,r,i):("."===t[0]?(t=t.slice(1),1):"^"===t[0]?(t=t.slice(1),0):function(e,t,n,r){if(r)return"innerHTML"===t||"textContent"===t||!!(t in e&&Vi.test(t)&&B(n));if("spellcheck"===t||"draggable"===t||"translate"===t)return!1;if("form"===t)return!1;if("list"===t&&"INPUT"===e.tagName)return!1;if("type"===t&&"TEXTAREA"===e.tagName)return!1;if(Vi.test(t)&&j(n))return!1;return t in e}(e,t,r,o))?function(e,t,n,r,o,s,i){if("innerHTML"===t||"textContent"===t)return r&&i(r,o,s),void(e[t]=null==n?"":n);if("value"===t&&"PROGRESS"!==e.tagName&&!e.tagName.includes("-")){e._value=n;const r=null==n?"":n;return e.value===r&&"OPTION"!==e.tagName||(e.value=r),void(null==n&&e.removeAttribute(t))}let c=!1;if(""===n||null==n){const r=typeof e[t];"boolean"===r?n=_(n):null==n&&"string"===r?(n="",c=!0):"number"===r&&(n=0,c=!0)}try{e[t]=n}catch(e){}c&&e.removeAttribute(t)}(e,t,r,s,i,c,l):("true-value"===t?e._trueValue=r:"false-value"===t&&(e._falseValue=r),function(e,t,n,r,o){if(r&&t.startsWith("xlink:"))null==n?e.removeAttributeNS(Mi,t.slice(6,t.length)):e.setAttributeNS(Mi,t,n);else{const r=y(t);null==n||r&&!_(n)?e.removeAttribute(t):e.setAttribute(t,r?"":n)}}(e,t,r,o))}},Ei);let jc,Dc=!1;function Uc(){return jc||(jc=Go(Bc))}function Hc(){return jc=Dc?jc:qo(Bc),Dc=!0,jc}const Wc=(...e)=>{Uc().render(...e)},zc=(...e)=>{Hc().hydrate(...e)},Kc=(...e)=>{const t=Uc().createApp(...e);const{mount:n}=t;return t.mount=e=>{const r=qc(e);if(!r)return;const o=t._component;B(o)||o.render||o.template||(o.template=r.innerHTML),r.innerHTML="";const s=n(r,!1,r instanceof SVGElement);return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),s},t},Gc=(...e)=>{const t=Hc().createApp(...e);const{mount:n}=t;return t.mount=e=>{const t=qc(e);if(t)return n(t,!0,t instanceof SVGElement)},t};function qc(e){if(j(e)){return document.querySelector(e)}return e}let Jc=!1;const Yc=()=>{Jc||(Jc=!0,Sc.getSSRProps=({value:e})=>({value:e}),wc.getSSRProps=({value:e},t)=>{if(t.props&&b(t.props.value,e))return{checked:!0}},xc.getSSRProps=({value:e},t)=>{if(F(e)){if(t.props&&S(e,t.props.value)>-1)return{checked:!0}}else if(L(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},Rc.getSSRProps=(e,t)=>{if("string"!=typeof t.type)return;const n=Oc(t.type.toUpperCase(),t.props&&t.props.type);return n.getSSRProps?n.getSSRProps(e,t):void 0},Lc.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}})};function Zc(e){throw e}function Xc(e){}function Qc(e,t,n,r){const o=new SyntaxError(String(e));return o.code=e,o.loc=t,o}const el=Symbol(""),tl=Symbol(""),nl=Symbol(""),rl=Symbol(""),ol=Symbol(""),sl=Symbol(""),il=Symbol(""),cl=Symbol(""),ll=Symbol(""),ul=Symbol(""),al=Symbol(""),fl=Symbol(""),pl=Symbol(""),dl=Symbol(""),hl=Symbol(""),ml=Symbol(""),gl=Symbol(""),vl=Symbol(""),yl=Symbol(""),_l=Symbol(""),bl=Symbol(""),Sl=Symbol(""),xl=Symbol(""),Cl=Symbol(""),wl=Symbol(""),kl=Symbol(""),El=Symbol(""),Tl=Symbol(""),Nl=Symbol(""),Rl=Symbol(""),Ol=Symbol(""),Ml=Symbol(""),Pl=Symbol(""),Al=Symbol(""),Il=Symbol(""),Fl=Symbol(""),$l=Symbol(""),Ll=Symbol(""),Vl=Symbol(""),Bl={[el]:"Fragment",[tl]:"Teleport",[nl]:"Suspense",[rl]:"KeepAlive",[ol]:"BaseTransition",[sl]:"openBlock",[il]:"createBlock",[cl]:"createElementBlock",[ll]:"createVNode",[ul]:"createElementVNode",[al]:"createCommentVNode",[fl]:"createTextVNode",[pl]:"createStaticVNode",[dl]:"resolveComponent",[hl]:"resolveDynamicComponent",[ml]:"resolveDirective",[gl]:"resolveFilter",[vl]:"withDirectives",[yl]:"renderList",[_l]:"renderSlot",[bl]:"createSlots",[Sl]:"toDisplayString",[xl]:"mergeProps",[Cl]:"normalizeClass",[wl]:"normalizeStyle",[kl]:"normalizeProps",[El]:"guardReactiveProps",[Tl]:"toHandlers",[Nl]:"camelize",[Rl]:"capitalize",[Ol]:"toHandlerKey",[Ml]:"setBlockTracking",[Pl]:"pushScopeId",[Al]:"popScopeId",[Il]:"withCtx",[Fl]:"unref",[$l]:"isRef",[Ll]:"withMemo",[Vl]:"isMemoSame"};const jl={source:"",start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0}};function Dl(e,t,n,r,o,s,i,c=!1,l=!1,u=!1,a=jl){return e&&(c?(e.helper(sl),e.helper(gu(e.inSSR,u))):e.helper(mu(e.inSSR,u)),i&&e.helper(vl)),{type:13,tag:t,props:n,children:r,patchFlag:o,dynamicProps:s,directives:i,isBlock:c,disableTracking:l,isComponent:u,loc:a}}function Ul(e,t=jl){return{type:17,loc:t,elements:e}}function Hl(e,t=jl){return{type:15,loc:t,properties:e}}function Wl(e,t){return{type:16,loc:jl,key:j(e)?zl(e,!0):e,value:t}}function zl(e,t=!1,n=jl,r=0){return{type:4,loc:n,content:e,isStatic:t,constType:t?3:r}}function Kl(e,t=jl){return{type:8,loc:t,children:e}}function Gl(e,t=[],n=jl){return{type:14,loc:n,callee:e,arguments:t}}function ql(e,t=void 0,n=!1,r=!1,o=jl){return{type:18,params:e,returns:t,newline:n,isSlot:r,loc:o}}function Jl(e,t,n,r=!0){return{type:19,test:e,consequent:t,alternate:n,newline:r,loc:jl}}const Yl=e=>4===e.type&&e.isStatic,Zl=(e,t)=>e===t||e===te(t);function Xl(e){return Zl(e,"Teleport")?tl:Zl(e,"Suspense")?nl:Zl(e,"KeepAlive")?rl:Zl(e,"BaseTransition")?ol:void 0}const Ql=/^\d|[^\$\w]/,eu=e=>!Ql.test(e),tu=/[A-Za-z_$\xA0-\uFFFF]/,nu=/[\.\?\w$\xA0-\uFFFF]/,ru=/\s+[.[]\s*|\s*[.[]\s+/g,ou=e=>{e=e.trim().replace(ru,(e=>e.trim()));let t=0,n=[],r=0,o=0,s=null;for(let i=0;i4===e.key.type&&e.key.content===r))}return n}function Su(e,t){return`_${t}_${e.replace(/[^\w]/g,((t,n)=>"-"===t?"_":e.charCodeAt(n).toString()))}`}function xu(e,{helper:t,removeHelper:n,inSSR:r}){e.isBlock||(e.isBlock=!0,n(mu(r,e.isComponent)),t(sl),t(gu(r,e.isComponent)))}function Cu(e,t){const n=t.options?t.options.compatConfig:t.compatConfig,r=n&&n[e];return"MODE"===e?r||3:r}function wu(e,t){const n=Cu("MODE",t),r=Cu(e,t);return 3===n?!0===r:!1!==r}function ku(e,t,n,...r){return wu(e,t)}const Eu=/&(gt|lt|amp|apos|quot);/g,Tu={gt:">",lt:"<",amp:"&",apos:"'",quot:'"'},Nu={delimiters:["{{","}}"],getNamespace:()=>0,getTextMode:()=>0,isVoidTag:T,isPreTag:T,isCustomElement:T,decodeEntities:e=>e.replace(Eu,((e,t)=>Tu[t])),onError:Zc,onWarn:Xc,comments:!1};function Ru(e,t={}){const n=function(e,t){const n=M({},Nu);let r;for(r in t)n[r]=void 0===t[r]?Nu[r]:t[r];return{options:n,column:1,line:1,offset:0,originalSource:e,source:e,inPre:!1,inVPre:!1,onWarn:n.onWarn}}(e,t),r=Hu(n);return function(e,t=jl){return{type:0,children:e,helpers:new Set,components:[],directives:[],hoists:[],imports:[],cached:0,temps:0,codegenNode:void 0,loc:t}}(Ou(n,0,[]),Wu(n,r))}function Ou(e,t,n){const r=zu(n),o=r?r.ns:0,s=[];for(;!Zu(e,t,n);){const i=e.source;let c;if(0===t||1===t)if(!e.inVPre&&Ku(i,e.options.delimiters[0]))c=ju(e,t);else if(0===t&&"<"===i[0])if(1===i.length)Yu(e,5,1);else if("!"===i[1])Ku(i,"\x3c!--")?c=Au(e):Ku(i,""===i[2]){Yu(e,14,2),Gu(e,3);continue}if(/[a-z]/i.test(i[2])){Yu(e,23),Lu(e,1,r);continue}Yu(e,12,2),c=Iu(e)}else/[a-z]/i.test(i[1])?(c=Fu(e,n),wu("COMPILER_NATIVE_TEMPLATE",e)&&c&&"template"===c.tag&&!c.props.some((e=>7===e.type&&$u(e.name)))&&(c=c.children)):"?"===i[1]?(Yu(e,21,1),c=Iu(e)):Yu(e,12,1);if(c||(c=Du(e,t)),F(c))for(let e=0;e/.exec(e.source);if(r){r.index<=3&&Yu(e,0),r[1]&&Yu(e,10),n=e.source.slice(4,r.index);const t=e.source.slice(0,r.index);let o=1,s=0;for(;-1!==(s=t.indexOf("\x3c!--",o));)Gu(e,s-o+1),s+4");return-1===o?(r=e.source.slice(n),Gu(e,e.source.length)):(r=e.source.slice(n,o),Gu(e,o+1)),{type:3,content:r,loc:Wu(e,t)}}function Fu(e,t){const n=e.inPre,r=e.inVPre,o=zu(t),s=Lu(e,0,o),i=e.inPre&&!n,c=e.inVPre&&!r;if(s.isSelfClosing||e.options.isVoidTag(s.tag))return i&&(e.inPre=!1),c&&(e.inVPre=!1),s;t.push(s);const l=e.options.getTextMode(s,o),u=Ou(e,l,t);t.pop();{const t=s.props.find((e=>6===e.type&&"inline-template"===e.name));if(t&&ku("COMPILER_INLINE_TEMPLATE",e,t.loc)){const n=Wu(e,s.loc.end);t.value={type:2,content:n.source,loc:n}}}if(s.children=u,Xu(e.source,s.tag))Lu(e,1,o);else if(Yu(e,24,0,s.loc.start),0===e.source.length&&"script"===s.tag.toLowerCase()){const t=u[0];t&&Ku(t.loc.source,"\x3c!--")&&Yu(e,8)}return s.loc=Wu(e,s.loc.start),i&&(e.inPre=!1),c&&(e.inVPre=!1),s}const $u=o("if,else,else-if,for,slot");function Lu(e,t,n){const r=Hu(e),o=/^<\/?([a-z][^\t\r\n\f />]*)/i.exec(e.source),s=o[1],i=e.options.getNamespace(s,n);Gu(e,o[0].length),qu(e);const c=Hu(e),l=e.source;e.options.isPreTag(s)&&(e.inPre=!0);let u=Vu(e,t);0===t&&!e.inVPre&&u.some((e=>7===e.type&&"pre"===e.name))&&(e.inVPre=!0,M(e,c),e.source=l,u=Vu(e,t).filter((e=>"v-pre"!==e.name)));let a=!1;if(0===e.source.length?Yu(e,9):(a=Ku(e.source,"/>"),1===t&&a&&Yu(e,4),Gu(e,a?2:1)),1===t)return;let f=0;return e.inVPre||("slot"===s?f=2:"template"===s?u.some((e=>7===e.type&&$u(e.name)))&&(f=3):function(e,t,n){const r=n.options;if(r.isCustomElement(e))return!1;if("component"===e||/^[A-Z]/.test(e)||Xl(e)||r.isBuiltInComponent&&r.isBuiltInComponent(e)||r.isNativeTag&&!r.isNativeTag(e))return!0;for(let e=0;e0&&!Ku(e.source,">")&&!Ku(e.source,"/>");){if(Ku(e.source,"/")){Yu(e,22),Gu(e,1),qu(e);continue}1===t&&Yu(e,3);const o=Bu(e,r);6===o.type&&o.value&&"class"===o.name&&(o.value.content=o.value.content.replace(/\s+/g," ").trim()),0===t&&n.push(o),/^[^\t\r\n\f />]/.test(e.source)&&Yu(e,15),qu(e)}return n}function Bu(e,t){const n=Hu(e),r=/^[^\t\r\n\f />][^\t\r\n\f />=]*/.exec(e.source)[0];t.has(r)&&Yu(e,2),t.add(r),"="===r[0]&&Yu(e,19);{const t=/["'<]/g;let n;for(;n=t.exec(r);)Yu(e,17,n.index)}let o;Gu(e,r.length),/^[\t\r\n\f ]*=/.test(e.source)&&(qu(e),Gu(e,1),qu(e),o=function(e){const t=Hu(e);let n;const r=e.source[0],o='"'===r||"'"===r;if(o){Gu(e,1);const t=e.source.indexOf(r);-1===t?n=Uu(e,e.source.length,4):(n=Uu(e,t,4),Gu(e,1))}else{const t=/^[^\t\r\n\f >]+/.exec(e.source);if(!t)return;const r=/["'<=`]/g;let o;for(;o=r.exec(t[0]);)Yu(e,18,o.index);n=Uu(e,t[0].length,4)}return{content:n,isQuoted:o,loc:Wu(e,t)}}(e),o||Yu(e,13));const s=Wu(e,n);if(!e.inVPre&&/^(v-[A-Za-z0-9-]|:|\.|@|#)/.test(r)){const t=/(?:^v-([a-z0-9-]+))?(?:(?::|^\.|^@|^#)(\[[^\]]+\]|[^\.]+))?(.+)?$/i.exec(r);let i,c=Ku(r,"."),l=t[1]||(c||Ku(r,":")?"bind":Ku(r,"@")?"on":"slot");if(t[2]){const o="slot"===l,s=r.lastIndexOf(t[2]),c=Wu(e,Ju(e,n,s),Ju(e,n,s+t[2].length+(o&&t[3]||"").length));let u=t[2],a=!0;u.startsWith("[")?(a=!1,u.endsWith("]")?u=u.slice(1,u.length-1):(Yu(e,27),u=u.slice(1))):o&&(u+=t[3]||""),i={type:4,content:u,isStatic:a,constType:a?3:0,loc:c}}if(o&&o.isQuoted){const e=o.loc;e.start.offset++,e.start.column++,e.end=iu(e.start,o.content),e.source=e.source.slice(1,-1)}const u=t[3]?t[3].slice(1).split("."):[];return c&&u.push("prop"),"bind"===l&&i&&u.includes("sync")&&ku("COMPILER_V_BIND_SYNC",e,0,i.loc.source)&&(l="model",u.splice(u.indexOf("sync"),1)),{type:7,name:l,exp:o&&{type:4,content:o.content,isStatic:!1,constType:0,loc:o.loc},arg:i,modifiers:u,loc:s}}return!e.inVPre&&Ku(r,"v-")&&Yu(e,26),{type:6,name:r,value:o&&{type:2,content:o.content,loc:o.loc},loc:s}}function ju(e,t){const[n,r]=e.options.delimiters,o=e.source.indexOf(r,n.length);if(-1===o)return void Yu(e,25);const s=Hu(e);Gu(e,n.length);const i=Hu(e),c=Hu(e),l=o-n.length,u=e.source.slice(0,l),a=Uu(e,l,t),f=a.trim(),p=a.indexOf(f);p>0&&cu(i,u,p);return cu(c,u,l-(a.length-f.length-p)),Gu(e,r.length),{type:5,content:{type:4,isStatic:!1,constType:0,content:f,loc:Wu(e,i,c)},loc:Wu(e,s)}}function Du(e,t){const n=3===t?["]]>"]:["<",e.options.delimiters[0]];let r=e.source.length;for(let t=0;to&&(r=o)}const o=Hu(e);return{type:2,content:Uu(e,r,t),loc:Wu(e,o)}}function Uu(e,t,n){const r=e.source.slice(0,t);return Gu(e,t),2!==n&&3!==n&&r.includes("&")?e.options.decodeEntities(r,4===n):r}function Hu(e){const{column:t,line:n,offset:r}=e;return{column:t,line:n,offset:r}}function Wu(e,t,n){return{start:t,end:n=n||Hu(e),source:e.originalSource.slice(t.offset,n.offset)}}function zu(e){return e[e.length-1]}function Ku(e,t){return e.startsWith(t)}function Gu(e,t){const{source:n}=e;cu(e,n,t),e.source=n.slice(t)}function qu(e){const t=/^[\t\r\n\f ]+/.exec(e.source);t&&Gu(e,t[0].length)}function Ju(e,t,n){return iu(t,e.originalSource.slice(t.offset,n),n)}function Yu(e,t,n,r=Hu(e)){n&&(r.offset+=n,r.column+=n),e.options.onError(Qc(t,{start:r,end:r,source:""}))}function Zu(e,t,n){const r=e.source;switch(t){case 0:if(Ku(r,"=0;--e)if(Xu(r,n[e].tag))return!0;break;case 1:case 2:{const e=zu(n);if(e&&Xu(r,e.tag))return!0;break}case 3:if(Ku(r,"]]>"))return!0}return!r}function Xu(e,t){return Ku(e,"]/.test(e[2+t.length]||">")}function Qu(e,t){ta(e,t,ea(e,e.children[0]))}function ea(e,t){const{children:n}=e;return 1===n.length&&1===t.type&&!hu(t)}function ta(e,t,n=!1){const{children:r}=e,o=r.length;let s=0;for(let e=0;e0){if(e>=2){o.codegenNode.patchFlag="-1",o.codegenNode=t.hoist(o.codegenNode),s++;continue}}else{const e=o.codegenNode;if(13===e.type){const n=ca(e);if((!n||512===n||1===n)&&sa(o,t)>=2){const n=ia(o);n&&(e.props=t.hoist(n))}e.dynamicProps&&(e.dynamicProps=t.hoist(e.dynamicProps))}}}if(1===o.type){const e=1===o.tagType;e&&t.scopes.vSlot++,ta(o,t),e&&t.scopes.vSlot--}else if(11===o.type)ta(o,t,1===o.children.length);else if(9===o.type)for(let e=0;e1)for(let o=0;on&&(C.childIndex--,C.onNodeRemoved()):(C.currentNode=null,C.onNodeRemoved()),C.parent.children.splice(n,1)},onNodeRemoved:()=>{},addIdentifiers(e){},removeIdentifiers(e){},hoist(e){j(e)&&(e=zl(e)),C.hoists.push(e);const t=zl(`_hoisted_${C.hoists.length}`,!1,e.loc,2);return t.hoisted=e,t},cache(e,t=!1){return function(e,t,n=!1){return{type:20,index:e,value:t,isVNode:n,loc:jl}}(C.cached++,e,t)}};return C.filters=new Set,C}function ua(e,t){const n=la(e,t);aa(e,n),t.hoistStatic&&Qu(e,n),t.ssr||function(e,t){const{helper:n}=t,{children:r}=e;if(1===r.length){const n=r[0];if(ea(e,n)&&n.codegenNode){const r=n.codegenNode;13===r.type&&xu(r,t),e.codegenNode=r}else e.codegenNode=n}else if(r.length>1){let r=64;s[64];0,e.codegenNode=Dl(t,n(el),void 0,e.children,r+"",void 0,void 0,!0,void 0,!1)}}(e,n),e.helpers=new Set([...n.helpers.keys()]),e.components=[...n.components],e.directives=[...n.directives],e.imports=n.imports,e.hoists=n.hoists,e.temps=n.temps,e.cached=n.cached,e.filters=[...n.filters]}function aa(e,t){t.currentNode=e;const{nodeTransforms:n}=t,r=[];for(let o=0;o{n--};for(;nt===e:t=>e.test(t);return(e,r)=>{if(1===e.type){const{props:o}=e;if(3===e.tagType&&o.some(pu))return;const s=[];for(let i=0;i`${Bl[e]}: _${Bl[e]}`;function ha(e,{mode:t="function",prefixIdentifiers:n="module"===t,sourceMap:r=!1,filename:o="template.vue.html",scopeId:s=null,optimizeImports:i=!1,runtimeGlobalName:c="Vue",runtimeModuleName:l="vue",ssrRuntimeModuleName:u="vue/server-renderer",ssr:a=!1,isTS:f=!1,inSSR:p=!1}){const d={mode:t,prefixIdentifiers:n,sourceMap:r,filename:o,scopeId:s,optimizeImports:i,runtimeGlobalName:c,runtimeModuleName:l,ssrRuntimeModuleName:u,ssr:a,isTS:f,inSSR:p,source:e.loc.source,code:"",column:1,line:1,offset:0,indentLevel:0,pure:!1,map:void 0,helper(e){return`_${Bl[e]}`},push(e,t){d.code+=e},indent(){h(++d.indentLevel)},deindent(e=!1){e?--d.indentLevel:h(--d.indentLevel)},newline(){h(d.indentLevel)}};function h(e){d.push("\n"+" ".repeat(e))}return d}function ma(e,t={}){const n=ha(e,t);t.onContextCreated&&t.onContextCreated(n);const{mode:r,push:o,prefixIdentifiers:s,indent:i,deindent:c,newline:l,scopeId:u,ssr:a}=n,f=Array.from(e.helpers),p=f.length>0,d=!s&&"module"!==r,h=n;!function(e,t){const{ssr:n,prefixIdentifiers:r,push:o,newline:s,runtimeModuleName:i,runtimeGlobalName:c,ssrRuntimeModuleName:l}=t,u=c,a=Array.from(e.helpers);if(a.length>0&&(o(`const _Vue = ${u}\n`),e.hoists.length)){o(`const { ${[ll,ul,al,fl,pl].filter((e=>a.includes(e))).map(da).join(", ")} } = _Vue\n`)}(function(e,t){if(!e.length)return;t.pure=!0;const{push:n,newline:r,helper:o,scopeId:s,mode:i}=t;r();for(let o=0;o0)&&l()),e.directives.length&&(ga(e.directives,"directive",n),e.temps>0&&l()),e.filters&&e.filters.length&&(l(),ga(e.filters,"filter",n),l()),e.temps>0){o("let ");for(let t=0;t0?", ":""}_temp${t}`)}return(e.components.length||e.directives.length||e.temps)&&(o("\n"),l()),a||o("return "),e.codegenNode?_a(e.codegenNode,n):o("null"),d&&(c(),o("}")),c(),o("}"),{ast:e,code:n.code,preamble:"",map:n.map?n.map.toJSON():void 0}}function ga(e,t,{helper:n,push:r,newline:o,isTS:s}){const i=n("filter"===t?gl:"component"===t?dl:ml);for(let n=0;n3||!1;t.push("["),n&&t.indent(),ya(e,t,n),n&&t.deindent(),t.push("]")}function ya(e,t,n=!1,r=!0){const{push:o,newline:s}=t;for(let i=0;ie||"null"))}([s,i,c,l,u]),t),n(")"),f&&n(")");a&&(n(", "),_a(a,t),n(")"))}(e,t);break;case 14:!function(e,t){const{push:n,helper:r,pure:o}=t,s=j(e.callee)?e.callee:r(e.callee);o&&n(pa);n(s+"(",e),ya(e.arguments,t),n(")")}(e,t);break;case 15:!function(e,t){const{push:n,indent:r,deindent:o,newline:s}=t,{properties:i}=e;if(!i.length)return void n("{}",e);const c=i.length>1||!1;n(c?"{":"{ "),c&&r();for(let e=0;e "),(l||c)&&(n("{"),r());i?(l&&n("return "),F(i)?va(i,t):_a(i,t)):c&&_a(c,t);(l||c)&&(o(),n("}"));u&&(e.isNonScopedSlot&&n(", undefined, true"),n(")"))}(e,t);break;case 19:!function(e,t){const{test:n,consequent:r,alternate:o,newline:s}=e,{push:i,indent:c,deindent:l,newline:u}=t;if(4===n.type){const e=!eu(n.content);e&&i("("),ba(n,t),e&&i(")")}else i("("),_a(n,t),i(")");s&&c(),t.indentLevel++,s||i(" "),i("? "),_a(r,t),t.indentLevel--,s&&u(),s||i(" "),i(": ");const a=19===o.type;a||t.indentLevel++;_a(o,t),a||t.indentLevel--;s&&l(!0)}(e,t);break;case 20:!function(e,t){const{push:n,helper:r,indent:o,deindent:s,newline:i}=t;n(`_cache[${e.index}] || (`),e.isVNode&&(o(),n(`${r(Ml)}(-1),`),i());n(`_cache[${e.index}] = `),_a(e.value,t),e.isVNode&&(n(","),i(),n(`${r(Ml)}(1),`),i(),n(`_cache[${e.index}]`),s());n(")")}(e,t);break;case 21:ya(e.body,t,!0,!1)}}function ba(e,t){const{content:n,isStatic:r}=e;t.push(r?JSON.stringify(n):n,e)}function Sa(e,t){for(let n=0;nfunction(e,t,n,r){if(!("else"===t.name||t.exp&&t.exp.content.trim())){const r=t.exp?t.exp.loc:e.loc;n.onError(Qc(28,t.loc)),t.exp=zl("true",!1,r)}0;if("if"===t.name){const o=wa(e,t),s={type:9,loc:e.loc,branches:[o]};if(n.replaceNode(s),r)return r(s,o,!0)}else{const o=n.parent.children;let s=o.indexOf(e);for(;s-- >=-1;){const i=o[s];if(i&&3===i.type)n.removeNode(i);else{if(!i||2!==i.type||i.content.trim().length){if(i&&9===i.type){"else-if"===t.name&&void 0===i.branches[i.branches.length-1].condition&&n.onError(Qc(30,e.loc)),n.removeNode();const o=wa(e,t);0,i.branches.push(o);const s=r&&r(i,o,!1);aa(o,n),s&&s(),n.currentNode=null}else n.onError(Qc(30,e.loc));break}n.removeNode(i)}}}}(e,t,n,((e,t,r)=>{const o=n.parent.children;let s=o.indexOf(e),i=0;for(;s-- >=0;){const e=o[s];e&&9===e.type&&(i+=e.branches.length)}return()=>{if(r)e.codegenNode=ka(t,i,n);else{const r=function(e){for(;;)if(19===e.type){if(19!==e.alternate.type)return e;e=e.alternate}else 20===e.type&&(e=e.value)}(e.codegenNode);r.alternate=ka(t,i+e.branches.length-1,n)}}}))));function wa(e,t){const n=3===e.tagType;return{type:10,loc:e.loc,condition:"else"===t.name?void 0:t.exp,children:n&&!lu(e,"for")?e.children:[e],userKey:uu(e,"key"),isTemplateIf:n}}function ka(e,t,n){return e.condition?Jl(e.condition,Ea(e,t,n),Gl(n.helper(al),['""',"true"])):Ea(e,t,n)}function Ea(e,t,n){const{helper:r}=n,o=Wl("key",zl(`${t}`,!1,jl,2)),{children:i}=e,c=i[0];if(1!==i.length||1!==c.type){if(1===i.length&&11===c.type){const e=c.codegenNode;return _u(e,o,n),e}{let t=64;s[64];return Dl(n,r(el),Hl([o]),i,t+"",void 0,void 0,!0,!1,!1,e.loc)}}{const e=c.codegenNode,t=14===(l=e).type&&l.callee===Ll?l.arguments[1].returns:l;return 13===t.type&&xu(t,n),_u(t,o,n),e}var l}const Ta=fa("for",((e,t,n)=>{const{helper:r,removeHelper:o}=n;return function(e,t,n,r){if(!t.exp)return void n.onError(Qc(31,t.loc));const o=Ma(t.exp,n);if(!o)return void n.onError(Qc(32,t.loc));const{addIdentifiers:s,removeIdentifiers:i,scopes:c}=n,{source:l,value:u,key:a,index:f}=o,p={type:11,loc:t.loc,source:l,valueAlias:u,keyAlias:a,objectIndexAlias:f,parseResult:o,children:du(e)?e.children:[e]};n.replaceNode(p),c.vFor++;const d=r&&r(p);return()=>{c.vFor--,d&&d()}}(e,t,n,(t=>{const s=Gl(r(yl),[t.source]),i=du(e),c=lu(e,"memo"),l=uu(e,"key"),u=l&&(6===l.type?zl(l.value.content,!0):l.exp),a=l?Wl("key",u):null,f=4===t.source.type&&t.source.constType>0,p=f?64:l?128:256;return t.codegenNode=Dl(n,r(el),void 0,s,p+"",void 0,void 0,!0,!f,!1,e.loc),()=>{let l;const{children:p}=t;const d=1!==p.length||1!==p[0].type,h=hu(e)?e:i&&1===e.children.length&&hu(e.children[0])?e.children[0]:null;if(h?(l=h.codegenNode,i&&a&&_u(l,a,n)):d?l=Dl(n,r(el),a?Hl([a]):void 0,e.children,"64",void 0,void 0,!0,void 0,!1):(l=p[0].codegenNode,i&&a&&_u(l,a,n),l.isBlock!==!f&&(l.isBlock?(o(sl),o(gu(n.inSSR,l.isComponent))):o(mu(n.inSSR,l.isComponent))),l.isBlock=!f,l.isBlock?(r(sl),r(gu(n.inSSR,l.isComponent))):r(mu(n.inSSR,l.isComponent))),c){const e=ql(Aa(t.parseResult,[zl("_cached")]));e.body={type:21,body:[Kl(["const _memo = (",c.exp,")"]),Kl(["if (_cached",...u?[" && _cached.key === ",u]:[],` && ${n.helperString(Vl)}(_cached, _memo)) return _cached`]),Kl(["const _item = ",l]),zl("_item.memo = _memo"),zl("return _item")],loc:jl},s.arguments.push(e,zl("_cache"),zl(String(n.cached++)))}else s.arguments.push(ql(Aa(t.parseResult),l,!0))}}))}));const Na=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,Ra=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,Oa=/^\(|\)$/g;function Ma(e,t){const n=e.loc,r=e.content,o=r.match(Na);if(!o)return;const[,s,i]=o,c={source:Pa(n,i.trim(),r.indexOf(i,s.length)),value:void 0,key:void 0,index:void 0};let l=s.trim().replace(Oa,"").trim();const u=s.indexOf(l),a=l.match(Ra);if(a){l=l.replace(Ra,"").trim();const e=a[1].trim();let t;if(e&&(t=r.indexOf(e,u+l.length),c.key=Pa(n,e,t)),a[2]){const o=a[2].trim();o&&(c.index=Pa(n,o,r.indexOf(o,c.key?t+e.length:u+l.length)))}}return l&&(c.value=Pa(n,l,u)),c}function Pa(e,t,n){return zl(t,!1,su(e,n,t.length))}function Aa({value:e,key:t,index:n},r=[]){return function(e){let t=e.length;for(;t--&&!e[t];);return e.slice(0,t+1).map(((e,t)=>e||zl("_".repeat(t+1),!1)))}([e,t,n,...r])}const Ia=zl("undefined",!1),Fa=(e,t)=>{if(1===e.type&&(1===e.tagType||3===e.tagType)){const n=lu(e,"slot");if(n)return n.exp,t.scopes.vSlot++,()=>{t.scopes.vSlot--}}},$a=(e,t,n)=>ql(e,t,!1,!0,t.length?t[0].loc:n);function La(e,t,n=$a){t.helper(Il);const{children:r,loc:o}=e,s=[],i=[];let c=t.scopes.vSlot>0||t.scopes.vFor>0;const l=lu(e,"slot",!0);if(l){const{arg:e,exp:t}=l;e&&!Yl(e)&&(c=!0),s.push(Wl(e||zl("default",!0),n(t,r,o)))}let u=!1,a=!1;const f=[],p=new Set;let d=0;for(let e=0;e{const s=n(e,r,o);return t.compatConfig&&(s.isNonScopedSlot=!0),Wl("default",s)};u?f.length&&f.some((e=>ja(e)))&&(a?t.onError(Qc(39,f[0].loc)):s.push(e(void 0,f))):s.push(e(void 0,r))}const h=c?2:Ba(e.children)?3:1;let m=Hl(s.concat(Wl("_",zl(h+"",!1))),o);return i.length&&(m=Gl(t.helper(bl),[m,Ul(i)])),{slots:m,hasDynamicSlots:c}}function Va(e,t,n){const r=[Wl("name",e),Wl("fn",t)];return null!=n&&r.push(Wl("key",zl(String(n),!0))),Hl(r)}function Ba(e){for(let t=0;tfunction(){if(1!==(e=t.currentNode).type||0!==e.tagType&&1!==e.tagType)return;const{tag:n,props:r}=e,o=1===e.tagType;let s=o?function(e,t,n=!1){let{tag:r}=e;const o=Ka(r),s=uu(e,"is");if(s)if(o||wu("COMPILER_IS_ON_ELEMENT",t)){const e=6===s.type?s.value&&zl(s.value.content,!0):s.exp;if(e)return Gl(t.helper(hl),[e])}else 6===s.type&&s.value.content.startsWith("vue:")&&(r=s.value.content.slice(4));const i=!o&&lu(e,"is");if(i&&i.exp)return Gl(t.helper(hl),[i.exp]);const c=Xl(r)||t.isBuiltInComponent(r);if(c)return n||t.helper(c),c;return t.helper(dl),t.components.add(r),Su(r,"component")}(e,t):`"${n}"`;const i=U(s)&&s.callee===hl;let c,l,u,a,f,p,d=0,h=i||s===tl||s===nl||!o&&("svg"===n||"foreignObject"===n);if(r.length>0){const n=Ha(e,t,void 0,o,i);c=n.props,d=n.patchFlag,f=n.dynamicPropNames;const r=n.directives;p=r&&r.length?Ul(r.map((e=>function(e,t){const n=[],r=Da.get(e);r?n.push(t.helperString(r)):(t.helper(ml),t.directives.add(e.name),n.push(Su(e.name,"directive")));const{loc:o}=e;e.exp&&n.push(e.exp);e.arg&&(e.exp||n.push("void 0"),n.push(e.arg));if(Object.keys(e.modifiers).length){e.arg||(e.exp||n.push("void 0"),n.push("void 0"));const t=zl("true",!1,o);n.push(Hl(e.modifiers.map((e=>Wl(e,t))),o))}return Ul(n,e.loc)}(e,t)))):void 0,n.shouldUseBlock&&(h=!0)}if(e.children.length>0){s===rl&&(h=!0,d|=1024);if(o&&s!==tl&&s!==rl){const{slots:n,hasDynamicSlots:r}=La(e,t);l=n,r&&(d|=1024)}else if(1===e.children.length&&s!==tl){const n=e.children[0],r=n.type,o=5===r||8===r;o&&0===na(n,t)&&(d|=1),l=o||2===r?n:e.children}else l=e.children}0!==d&&(u=String(d),f&&f.length&&(a=function(e){let t="[";for(let n=0,r=e.length;n0;let d=!1,h=0,m=!1,g=!1,v=!1,y=!1,_=!1,b=!1;const S=[],x=e=>{u.length&&(a.push(Hl(Wa(u),c)),u=[]),e&&a.push(e)},C=({key:e,value:n})=>{if(Yl(e)){const s=e.content,i=R(s);if(!i||r&&!o||"onclick"===s.toLowerCase()||"onUpdate:modelValue"===s||J(s)||(y=!0),i&&J(s)&&(b=!0),20===n.type||(4===n.type||8===n.type)&&na(n,t)>0)return;"ref"===s?m=!0:"class"===s?g=!0:"style"===s?v=!0:"key"===s||S.includes(s)||S.push(s),!r||"class"!==s&&"style"!==s||S.includes(s)||S.push(s)}else _=!0};for(let o=0;o0&&u.push(Wl(zl("ref_for",!0),zl("true")))),"is"===n&&(Ka(i)||r&&r.content.startsWith("vue:")||wu("COMPILER_IS_ON_ELEMENT",t)))continue;u.push(Wl(zl(n,!0,su(e,0,n.length)),zl(r?r.content:"",o,r?r.loc:e)))}else{const{name:n,arg:o,exp:h,loc:m}=l,g="bind"===n,v="on"===n;if("slot"===n){r||t.onError(Qc(40,m));continue}if("once"===n||"memo"===n)continue;if("is"===n||g&&au(o,"is")&&(Ka(i)||wu("COMPILER_IS_ON_ELEMENT",t)))continue;if(v&&s)continue;if((g&&au(o,"key")||v&&p&&au(o,"vue:before-update"))&&(d=!0),g&&au(o,"ref")&&t.scopes.vFor>0&&u.push(Wl(zl("ref_for",!0),zl("true"))),!o&&(g||v)){if(_=!0,h)if(g){if(x(),wu("COMPILER_V_BIND_OBJECT_ORDER",t)){a.unshift(h);continue}a.push(h)}else x({type:14,loc:m,callee:t.helper(Tl),arguments:r?[h]:[h,"true"]});else t.onError(Qc(g?34:35,m));continue}const y=t.directiveTransforms[n];if(y){const{props:n,needRuntime:r}=y(l,e,t);!s&&n.forEach(C),v&&o&&!Yl(o)?x(Hl(n,c)):u.push(...n),r&&(f.push(l),D(r)&&Da.set(l,r))}else Y(n)||(f.push(l),p&&(d=!0))}}let w;if(a.length?(x(),w=a.length>1?Gl(t.helper(xl),a,c):a[0]):u.length&&(w=Hl(Wa(u),c)),_?h|=16:(g&&!r&&(h|=2),v&&!r&&(h|=4),S.length&&(h|=8),y&&(h|=32)),d||0!==h&&32!==h||!(m||b||f.length>0)||(h|=512),!t.inSSR&&w)switch(w.type){case 15:let e=-1,n=-1,r=!1;for(let t=0;t{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))})((e=>e.replace(Ga,((e,t)=>t?t.toUpperCase():"")))),Ja=(e,t)=>{if(hu(e)){const{children:n,loc:r}=e,{slotName:o,slotProps:s}=function(e,t){let n,r='"default"';const o=[];for(let t=0;t0){const{props:r,directives:s}=Ha(e,t,o,!1,!1);n=r,s.length&&t.onError(Qc(36,s[0].loc))}return{slotName:r,slotProps:n}}(e,t),i=[t.prefixIdentifiers?"_ctx.$slots":"$slots",o,"{}","undefined","true"];let c=2;s&&(i[2]=s,c=3),n.length&&(i[3]=ql([],n,!1,!1,r),c=4),t.scopeId&&!t.slotted&&(c=5),i.splice(c),e.codegenNode=Gl(t.helper(_l),i,r)}};const Ya=/^\s*([\w$_]+|(async\s*)?\([^)]*?\))\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/,Za=(e,t,n,r)=>{const{loc:o,modifiers:s,arg:i}=e;let c;if(e.exp||s.length||n.onError(Qc(35,o)),4===i.type)if(i.isStatic){let e=i.content;e.startsWith("vue:")&&(e=`vnode-${e.slice(4)}`);c=zl(0!==t.tagType||e.startsWith("vnode")||!/[A-Z]/.test(e)?re(Q(e)):`on:${e}`,!0,i.loc)}else c=Kl([`${n.helperString(Ol)}(`,i,")"]);else c=i,c.children.unshift(`${n.helperString(Ol)}(`),c.children.push(")");let l=e.exp;l&&!l.content.trim()&&(l=void 0);let u=n.cacheHandlers&&!l&&!n.inVOnce;if(l){const e=ou(l.content),t=!(e||Ya.test(l.content)),n=l.content.includes(";");0,(t||u&&e)&&(l=Kl([`${t?"$event":"(...args)"} => ${n?"{":"("}`,l,n?"}":")"]))}let a={props:[Wl(c,l||zl("() => {}",!1,o))]};return r&&(a=r(a)),u&&(a.props[0].value=n.cache(a.props[0].value)),a.props.forEach((e=>e.key.isHandlerKey=!0)),a},Xa=(e,t,n)=>{const{exp:r,modifiers:o,loc:s}=e,i=e.arg;return 4!==i.type?(i.children.unshift("("),i.children.push(') || ""')):i.isStatic||(i.content=`${i.content} || ""`),o.includes("camel")&&(4===i.type?i.isStatic?i.content=Q(i.content):i.content=`${n.helperString(Nl)}(${i.content})`:(i.children.unshift(`${n.helperString(Nl)}(`),i.children.push(")"))),n.inSSR||(o.includes("prop")&&Qa(i,"."),o.includes("attr")&&Qa(i,"^")),!r||4===r.type&&!r.content.trim()?(n.onError(Qc(34,s)),{props:[Wl(i,zl("",!0,s))]}):{props:[Wl(i,r)]}},Qa=(e,t)=>{4===e.type?e.isStatic?e.content=t+e.content:e.content=`\`${t}\${${e.content}}\``:(e.children.unshift(`'${t}' + (`),e.children.push(")"))},ef=(e,t)=>{if(0===e.type||1===e.type||11===e.type||10===e.type)return()=>{const n=e.children;let r,o=!1;for(let e=0;e7===e.type&&!t.directiveTransforms[e.name]))||"template"===e.tag)))for(let e=0;e{if(1===e.type&&lu(e,"once",!0)){if(tf.has(e)||t.inVOnce)return;return tf.add(e),t.inVOnce=!0,t.helper(Ml),()=>{t.inVOnce=!1;const e=t.currentNode;e.codegenNode&&(e.codegenNode=t.cache(e.codegenNode,!0))}}},rf=(e,t,n)=>{const{exp:r,arg:o}=e;if(!r)return n.onError(Qc(41,e.loc)),of();const s=r.loc.source,i=4===r.type?r.content:s,c=n.bindingMetadata[s];if("props"===c||"props-aliased"===c)return n.onError(Qc(44,r.loc)),of();if(!i.trim()||!ou(i))return n.onError(Qc(42,r.loc)),of();const l=o||zl("modelValue",!0),u=o?Yl(o)?`onUpdate:${Q(o.content)}`:Kl(['"onUpdate:" + ',o]):"onUpdate:modelValue";let a;a=Kl([`${n.isTS?"($event: any)":"$event"} => ((`,r,") = $event)"]);const f=[Wl(l,e.exp),Wl(u,a)];if(e.modifiers.length&&1===t.tagType){const t=e.modifiers.map((e=>(eu(e)?e:JSON.stringify(e))+": true")).join(", "),n=o?Yl(o)?`${o.content}Modifiers`:Kl([o,' + "Modifiers"']):"modelModifiers";f.push(Wl(n,zl(`{ ${t} }`,!1,e.loc,2)))}return of(f)};function of(e=[]){return{props:e}}const sf=/[\w).+\-_$\]]/,cf=(e,t)=>{wu("COMPILER_FILTER",t)&&(5===e.type&&lf(e.content,t),1===e.type&&e.props.forEach((e=>{7===e.type&&"for"!==e.name&&e.exp&&lf(e.exp,t)})))};function lf(e,t){if(4===e.type)uf(e,t);else for(let n=0;n=0&&(e=n.charAt(t)," "===e);t--);e&&sf.test(e)||(a=!0)}}else void 0===i?(h=s+1,i=n.slice(0,s).trim()):g();function g(){m.push(n.slice(h,s).trim()),h=s+1}if(void 0===i?i=n.slice(0,s).trim():0!==h&&g(),m.length){for(s=0;s{if(1===e.type){const n=lu(e,"memo");if(!n||ff.has(e))return;return ff.add(e),()=>{const r=e.codegenNode||t.currentNode.codegenNode;r&&13===r.type&&(1!==e.tagType&&xu(r,t),e.codegenNode=Gl(t.helper(Ll),[n.exp,ql(void 0,r),"_cache",String(t.cached++)]))}}};function df(e,t={}){const n=t.onError||Zc,r="module"===t.mode;!0===t.prefixIdentifiers?n(Qc(47)):r&&n(Qc(48));t.cacheHandlers&&n(Qc(49)),t.scopeId&&!r&&n(Qc(50));const o=j(e)?Ru(e,t):e,[s,i]=[[nf,Ca,pf,Ta,cf,Ja,Ua,Fa,ef],{on:Za,bind:Xa,model:rf}];return ua(o,M({},t,{prefixIdentifiers:false,nodeTransforms:[...s,...t.nodeTransforms||[]],directiveTransforms:M({},i,t.directiveTransforms||{})})),ma(o,M({},t,{prefixIdentifiers:false}))}const hf=Symbol(""),mf=Symbol(""),gf=Symbol(""),vf=Symbol(""),yf=Symbol(""),_f=Symbol(""),bf=Symbol(""),Sf=Symbol(""),xf=Symbol(""),Cf=Symbol("");var wf;let kf;wf={[hf]:"vModelRadio",[mf]:"vModelCheckbox",[gf]:"vModelText",[vf]:"vModelSelect",[yf]:"vModelDynamic",[_f]:"withModifiers",[bf]:"withKeys",[Sf]:"vShow",[xf]:"Transition",[Cf]:"TransitionGroup"},Object.getOwnPropertySymbols(wf).forEach((e=>{Bl[e]=wf[e]}));const Ef=o("style,iframe,script,noscript",!0),Tf={isVoidTag:g,isNativeTag:e=>h(e)||m(e),isPreTag:e=>"pre"===e,decodeEntities:function(e,t=!1){return kf||(kf=document.createElement("div")),t?(kf.innerHTML=`
`,kf.children[0].getAttribute("foo")):(kf.innerHTML=e,kf.textContent)},isBuiltInComponent:e=>Zl(e,"Transition")?xf:Zl(e,"TransitionGroup")?Cf:void 0,getNamespace(e,t){let n=t?t.ns:0;if(t&&2===n)if("annotation-xml"===t.tag){if("svg"===e)return 1;t.props.some((e=>6===e.type&&"encoding"===e.name&&null!=e.value&&("text/html"===e.value.content||"application/xhtml+xml"===e.value.content)))&&(n=0)}else/^m(?:[ions]|text)$/.test(t.tag)&&"mglyph"!==e&&"malignmark"!==e&&(n=0);else t&&1===n&&("foreignObject"!==t.tag&&"desc"!==t.tag&&"title"!==t.tag||(n=0));if(0===n){if("svg"===e)return 1;if("math"===e)return 2}return n},getTextMode({tag:e,ns:t}){if(0===t){if("textarea"===e||"title"===e)return 1;if(Ef(e))return 2}return 0}},Nf=(e,t)=>{const n=f(e);return zl(JSON.stringify(n),!1,t,3)};function Rf(e,t){return Qc(e,t)}const Of=o("passive,once,capture"),Mf=o("stop,prevent,self,ctrl,shift,alt,meta,exact,middle"),Pf=o("left,right"),Af=o("onkeyup,onkeydown,onkeypress",!0),If=(e,t)=>Yl(e)&&"onclick"===e.content.toLowerCase()?zl(t,!0):4!==e.type?Kl(["(",e,`) === "onClick" ? "${t}" : (`,e,")"]):e;const Ff=(e,t)=>{1!==e.type||0!==e.tagType||"script"!==e.tag&&"style"!==e.tag||(t.onError(Rf(61,e.loc)),t.removeNode())},$f=[e=>{1===e.type&&e.props.forEach(((t,n)=>{6===t.type&&"style"===t.name&&t.value&&(e.props[n]={type:7,name:"bind",arg:zl("style",!0,t.loc),exp:Nf(t.value.content,t.loc),modifiers:[],loc:t.loc})}))}],Lf={cloak:()=>({props:[]}),html:(e,t,n)=>{const{exp:r,loc:o}=e;return r||n.onError(Rf(51,o)),t.children.length&&(n.onError(Rf(52,o)),t.children.length=0),{props:[Wl(zl("innerHTML",!0,o),r||zl("",!0))]}},text:(e,t,n)=>{const{exp:r,loc:o}=e;return r||n.onError(Rf(53,o)),t.children.length&&(n.onError(Rf(54,o)),t.children.length=0),{props:[Wl(zl("textContent",!0),r?na(r,n)>0?r:Gl(n.helperString(Sl),[r],o):zl("",!0))]}},model:(e,t,n)=>{const r=rf(e,t,n);if(!r.props.length||1===t.tagType)return r;e.arg&&n.onError(Rf(56,e.arg.loc));const{tag:o}=t,s=n.isCustomElement(o);if("input"===o||"textarea"===o||"select"===o||s){let i=gf,c=!1;if("input"===o||s){const r=uu(t,"type");if(r){if(7===r.type)i=yf;else if(r.value)switch(r.value.content){case"radio":i=hf;break;case"checkbox":i=mf;break;case"file":c=!0,n.onError(Rf(57,e.loc))}}else(function(e){return e.props.some((e=>!(7!==e.type||"bind"!==e.name||e.arg&&4===e.arg.type&&e.arg.isStatic)))})(t)&&(i=yf)}else"select"===o&&(i=vf);c||(r.needRuntime=n.helper(i))}else n.onError(Rf(55,e.loc));return r.props=r.props.filter((e=>!(4===e.key.type&&"modelValue"===e.key.content))),r},on:(e,t,n)=>Za(e,t,n,(t=>{const{modifiers:r}=e;if(!r.length)return t;let{key:o,value:s}=t.props[0];const{keyModifiers:i,nonKeyModifiers:c,eventOptionModifiers:l}=((e,t,n,r)=>{const o=[],s=[],i=[];for(let r=0;r{const{exp:r,loc:o}=e;return r||n.onError(Rf(59,o)),{props:[],needRuntime:n.helper(Sf)}}};const Vf=Object.create(null);function Bf(e,t){if(!j(e)){if(!e.nodeType)return E;e=e.innerHTML}const n=e,o=Vf[n];if(o)return o;if("#"===e[0]){const t=document.querySelector(e);0,e=t?t.innerHTML:""}const s=M({hoistStatic:!0,onError:void 0,onWarn:E},t);s.isCustomElement||"undefined"==typeof customElements||(s.isCustomElement=e=>!!customElements.get(e));const{code:i}=function(e,t={}){return df(e,M({},Tf,t,{nodeTransforms:[Ff,...$f,...t.nodeTransforms||[]],directiveTransforms:M({},Lf,t.directiveTransforms||{}),transformHoist:null}))}(e,s);const c=new Function("Vue",i)(r);return c._rc=!0,Vf[n]=c}Ys(Bf)}}]); \ No newline at end of file +"use strict";(self.webpackChunk_wintercms_wn_backend_module=self.webpackChunk_wintercms_wn_backend_module||[]).push([[101],{609:function(e){e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(r)for(var s=0;s{const n=e.__vccOpts||e;for(const[e,r]of t)n[e]=r;return n}},471:function(e,t,n){n.r(t),n.d(t,{BaseTransition:function(){return vr},BaseTransitionPropsValidators:function(){return gr},Comment:function(){return Ns},EffectScope:function(){return pe},Fragment:function(){return Es},KeepAlive:function(){return Rr},ReactiveEffect:function(){return Te},Static:function(){return Rs},Suspense:function(){return Zn},Teleport:function(){return ws},Text:function(){return Ts},Transition:function(){return ac},TransitionGroup:function(){return Rc},VueElement:function(){return rc},assertNumber:function(){return ln},callWithAsyncErrorHandling:function(){return an},callWithErrorHandling:function(){return un},camelize:function(){return I},capitalize:function(){return V},cloneVNode:function(){return Ys},compatUtils:function(){return Li},compile:function(){return Qf},computed:function(){return Ni},createApp:function(){return cl},createBlock:function(){return Bs},createCommentVNode:function(){return Qs},createElementBlock:function(){return Ls},createElementVNode:function(){return Ks},createHydrationRenderer:function(){return gs},createPropsRestProxy:function(){return No},createRenderer:function(){return ms},createSSRApp:function(){return ll},createSlots:function(){return oo},createStaticVNode:function(){return Xs},createTextVNode:function(){return Zs},createVNode:function(){return Gs},customRef:function(){return Qt},defineAsyncComponent:function(){return Er},defineComponent:function(){return wr},defineCustomElement:function(){return ec},defineEmits:function(){return mo},defineExpose:function(){return go},defineModel:function(){return _o},defineOptions:function(){return vo},defineProps:function(){return ho},defineSSRCustomElement:function(){return tc},defineSlots:function(){return yo},devtools:function(){return Mn},effect:function(){return Re},effectScope:function(){return de},getCurrentInstance:function(){return ui},getCurrentScope:function(){return me},getTransitionRawChildren:function(){return Cr},guardReactiveProps:function(){return Js},h:function(){return Ri},handleError:function(){return fn},hasInjectionContext:function(){return qo},hydrate:function(){return il},initCustomFormatter:function(){return Pi},initDirectivesForSSR:function(){return fl},inject:function(){return Go},isMemoSame:function(){return Ii},isProxy:function(){return $t},isReactive:function(){return Pt},isReadonly:function(){return At},isRef:function(){return Ut},isRuntimeOnly:function(){return xi},isShallow:function(){return It},isVNode:function(){return js},markRaw:function(){return Vt},mergeDefaults:function(){return Eo},mergeModels:function(){return To},mergeProps:function(){return ri},nextTick:function(){return Sn},normalizeClass:function(){return Q},normalizeProps:function(){return ee},normalizeStyle:function(){return q},onActivated:function(){return Or},onBeforeMount:function(){return Br},onBeforeUnmount:function(){return Hr},onBeforeUpdate:function(){return Dr},onDeactivated:function(){return Pr},onErrorCaptured:function(){return qr},onMounted:function(){return jr},onRenderTracked:function(){return Gr},onRenderTriggered:function(){return Kr},onScopeDispose:function(){return ge},onServerPrefetch:function(){return zr},onUnmounted:function(){return Wr},onUpdated:function(){return Ur},openBlock:function(){return Ps},popScopeId:function(){return Dn},provide:function(){return Ko},proxyRefs:function(){return Zt},pushScopeId:function(){return jn},queuePostFlushCb:function(){return wn},reactive:function(){return Tt},readonly:function(){return Rt},ref:function(){return Ht},registerRuntimeCompiler:function(){return Si},render:function(){return sl},renderList:function(){return ro},renderSlot:function(){return so},resolveComponent:function(){return Zr},resolveDirective:function(){return eo},resolveDynamicComponent:function(){return Qr},resolveFilter:function(){return Vi},resolveTransitionHooks:function(){return _r},setBlockTracking:function(){return Fs},setDevtoolsHook:function(){return An},setTransitionHooks:function(){return xr},shallowReactive:function(){return Nt},shallowReadonly:function(){return Mt},shallowRef:function(){return Wt},ssrContextKey:function(){return Mi},ssrUtils:function(){return Fi},stop:function(){return Me},toDisplayString:function(){return ue},toHandlerKey:function(){return L},toHandlers:function(){return co},toRaw:function(){return Ft},toRef:function(){return rn},toRefs:function(){return en},toValue:function(){return Jt},transformVNodeArgs:function(){return Us},triggerRef:function(){return Gt},unref:function(){return qt},useAttrs:function(){return xo},useCssModule:function(){return oc},useCssVars:function(){return sc},useModel:function(){return Co},useSSRContext:function(){return Oi},useSlots:function(){return So},useTransitionState:function(){return hr},vModelCheckbox:function(){return Vc},vModelDynamic:function(){return Wc},vModelRadio:function(){return Bc},vModelSelect:function(){return jc},vModelText:function(){return Fc},vShow:function(){return Xc},version:function(){return $i},warn:function(){return cn},watch:function(){return cr},watchEffect:function(){return rr},watchPostEffect:function(){return or},watchSyncEffect:function(){return sr},withAsyncContext:function(){return Ro},withCtx:function(){return Hn},withDefaults:function(){return bo},withDirectives:function(){return pr},withKeys:function(){return Zc},withMemo:function(){return Ai},withModifiers:function(){return Jc},withScopeId:function(){return Un}});var r={};function o(e,t){const n=Object.create(null),r=e.split(",");for(let e=0;e!!n[e.toLowerCase()]:e=>!!n[e]}n.r(r),n.d(r,{BaseTransition:function(){return vr},BaseTransitionPropsValidators:function(){return gr},Comment:function(){return Ns},EffectScope:function(){return pe},Fragment:function(){return Es},KeepAlive:function(){return Rr},ReactiveEffect:function(){return Te},Static:function(){return Rs},Suspense:function(){return Zn},Teleport:function(){return ws},Text:function(){return Ts},Transition:function(){return ac},TransitionGroup:function(){return Rc},VueElement:function(){return rc},assertNumber:function(){return ln},callWithAsyncErrorHandling:function(){return an},callWithErrorHandling:function(){return un},camelize:function(){return I},capitalize:function(){return V},cloneVNode:function(){return Ys},compatUtils:function(){return Li},computed:function(){return Ni},createApp:function(){return cl},createBlock:function(){return Bs},createCommentVNode:function(){return Qs},createElementBlock:function(){return Ls},createElementVNode:function(){return Ks},createHydrationRenderer:function(){return gs},createPropsRestProxy:function(){return No},createRenderer:function(){return ms},createSSRApp:function(){return ll},createSlots:function(){return oo},createStaticVNode:function(){return Xs},createTextVNode:function(){return Zs},createVNode:function(){return Gs},customRef:function(){return Qt},defineAsyncComponent:function(){return Er},defineComponent:function(){return wr},defineCustomElement:function(){return ec},defineEmits:function(){return mo},defineExpose:function(){return go},defineModel:function(){return _o},defineOptions:function(){return vo},defineProps:function(){return ho},defineSSRCustomElement:function(){return tc},defineSlots:function(){return yo},devtools:function(){return Mn},effect:function(){return Re},effectScope:function(){return de},getCurrentInstance:function(){return ui},getCurrentScope:function(){return me},getTransitionRawChildren:function(){return Cr},guardReactiveProps:function(){return Js},h:function(){return Ri},handleError:function(){return fn},hasInjectionContext:function(){return qo},hydrate:function(){return il},initCustomFormatter:function(){return Pi},initDirectivesForSSR:function(){return fl},inject:function(){return Go},isMemoSame:function(){return Ii},isProxy:function(){return $t},isReactive:function(){return Pt},isReadonly:function(){return At},isRef:function(){return Ut},isRuntimeOnly:function(){return xi},isShallow:function(){return It},isVNode:function(){return js},markRaw:function(){return Vt},mergeDefaults:function(){return Eo},mergeModels:function(){return To},mergeProps:function(){return ri},nextTick:function(){return Sn},normalizeClass:function(){return Q},normalizeProps:function(){return ee},normalizeStyle:function(){return q},onActivated:function(){return Or},onBeforeMount:function(){return Br},onBeforeUnmount:function(){return Hr},onBeforeUpdate:function(){return Dr},onDeactivated:function(){return Pr},onErrorCaptured:function(){return qr},onMounted:function(){return jr},onRenderTracked:function(){return Gr},onRenderTriggered:function(){return Kr},onScopeDispose:function(){return ge},onServerPrefetch:function(){return zr},onUnmounted:function(){return Wr},onUpdated:function(){return Ur},openBlock:function(){return Ps},popScopeId:function(){return Dn},provide:function(){return Ko},proxyRefs:function(){return Zt},pushScopeId:function(){return jn},queuePostFlushCb:function(){return wn},reactive:function(){return Tt},readonly:function(){return Rt},ref:function(){return Ht},registerRuntimeCompiler:function(){return Si},render:function(){return sl},renderList:function(){return ro},renderSlot:function(){return so},resolveComponent:function(){return Zr},resolveDirective:function(){return eo},resolveDynamicComponent:function(){return Qr},resolveFilter:function(){return Vi},resolveTransitionHooks:function(){return _r},setBlockTracking:function(){return Fs},setDevtoolsHook:function(){return An},setTransitionHooks:function(){return xr},shallowReactive:function(){return Nt},shallowReadonly:function(){return Mt},shallowRef:function(){return Wt},ssrContextKey:function(){return Mi},ssrUtils:function(){return Fi},stop:function(){return Me},toDisplayString:function(){return ue},toHandlerKey:function(){return L},toHandlers:function(){return co},toRaw:function(){return Ft},toRef:function(){return rn},toRefs:function(){return en},toValue:function(){return Jt},transformVNodeArgs:function(){return Us},triggerRef:function(){return Gt},unref:function(){return qt},useAttrs:function(){return xo},useCssModule:function(){return oc},useCssVars:function(){return sc},useModel:function(){return Co},useSSRContext:function(){return Oi},useSlots:function(){return So},useTransitionState:function(){return hr},vModelCheckbox:function(){return Vc},vModelDynamic:function(){return Wc},vModelRadio:function(){return Bc},vModelSelect:function(){return jc},vModelText:function(){return Fc},vShow:function(){return Xc},version:function(){return $i},warn:function(){return cn},watch:function(){return cr},watchEffect:function(){return rr},watchPostEffect:function(){return or},watchSyncEffect:function(){return sr},withAsyncContext:function(){return Ro},withCtx:function(){return Hn},withDefaults:function(){return bo},withDirectives:function(){return pr},withKeys:function(){return Zc},withMemo:function(){return Ai},withModifiers:function(){return Jc},withScopeId:function(){return Un}});const s={},i=[],c=()=>{},l=()=>!1,u=/^on[^a-z]/,a=e=>u.test(e),f=e=>e.startsWith("onUpdate:"),p=Object.assign,d=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},h=Object.prototype.hasOwnProperty,m=(e,t)=>h.call(e,t),g=Array.isArray,v=e=>"[object Map]"===E(e),y=e=>"[object Set]"===E(e),_=e=>"[object Date]"===E(e),b=e=>"function"==typeof e,S=e=>"string"==typeof e,x=e=>"symbol"==typeof e,C=e=>null!==e&&"object"==typeof e,w=e=>C(e)&&b(e.then)&&b(e.catch),k=Object.prototype.toString,E=e=>k.call(e),T=e=>E(e).slice(8,-1),N=e=>"[object Object]"===E(e),R=e=>S(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,M=o(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),O=o("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),P=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},A=/-(\w)/g,I=P((e=>e.replace(A,((e,t)=>t?t.toUpperCase():"")))),$=/\B([A-Z])/g,F=P((e=>e.replace($,"-$1").toLowerCase())),V=P((e=>e.charAt(0).toUpperCase()+e.slice(1))),L=P((e=>e?`on${V(e)}`:"")),B=(e,t)=>!Object.is(e,t),j=(e,t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})},U=e=>{const t=parseFloat(e);return isNaN(t)?e:t},H=e=>{const t=S(e)?Number(e):NaN;return isNaN(t)?e:t};let W;const z=()=>W||(W="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:{});const K={1:"TEXT",2:"CLASS",4:"STYLE",8:"PROPS",16:"FULL_PROPS",32:"HYDRATE_EVENTS",64:"STABLE_FRAGMENT",128:"KEYED_FRAGMENT",256:"UNKEYED_FRAGMENT",512:"NEED_PATCH",1024:"DYNAMIC_SLOTS",2048:"DEV_ROOT_FRAGMENT",[-1]:"HOISTED",[-2]:"BAIL"},G=o("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console");function q(e){if(g(e)){const t={};for(let n=0;n{if(e){const n=e.split(Y);n.length>1&&(t[n[0].trim()]=n[1].trim())}})),t}function Q(e){let t="";if(S(e))t=e;else if(g(e))for(let n=0;nce(e,t)))}const ue=e=>S(e)?e:null==e?"":g(e)||C(e)&&(e.toString===k||!b(e.toString))?JSON.stringify(e,ae,2):String(e),ae=(e,t)=>t&&t.__v_isRef?ae(e,t.value):v(t)?{[`Map(${t.size})`]:[...t.entries()].reduce(((e,[t,n])=>(e[`${t} =>`]=n,e)),{})}:y(t)?{[`Set(${t.size})`]:[...t.values()]}:!C(t)||g(t)||N(t)?t:String(t);let fe;class pe{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this.parent=fe,!e&&fe&&(this.index=(fe.scopes||(fe.scopes=[])).push(this)-1)}get active(){return this._active}run(e){if(this._active){const t=fe;try{return fe=this,e()}finally{fe=t}}else 0}on(){fe=this}off(){fe=this.parent}stop(e){if(this._active){let t,n;for(t=0,n=this.effects.length;t{const t=new Set(e);return t.w=0,t.n=0,t},ye=e=>(e.w&xe)>0,_e=e=>(e.n&xe)>0,be=new WeakMap;let Se=0,xe=1;const Ce=30;let we;const ke=Symbol(""),Ee=Symbol("");class Te{constructor(e,t=null,n){this.fn=e,this.scheduler=t,this.active=!0,this.deps=[],this.parent=void 0,he(this,n)}run(){if(!this.active)return this.fn();let e=we,t=Oe;for(;e;){if(e===this)return;e=e.parent}try{return this.parent=we,we=this,Oe=!0,xe=1<<++Se,Se<=Ce?(({deps:e})=>{if(e.length)for(let t=0;t{const{deps:t}=e;if(t.length){let n=0;for(let r=0;r{("length"===n||n>=e)&&c.push(t)}))}else switch(void 0!==n&&c.push(i.get(n)),t){case"add":g(e)?R(n)&&c.push(i.get("length")):(c.push(i.get(ke)),v(e)&&c.push(i.get(Ee)));break;case"delete":g(e)||(c.push(i.get(ke)),v(e)&&c.push(i.get(Ee)));break;case"set":v(e)&&c.push(i.get(ke))}if(1===c.length)c[0]&&Le(c[0]);else{const e=[];for(const t of c)t&&e.push(...t);Le(ve(e))}}function Le(e,t){const n=g(e)?e:[...e];for(const e of n)e.computed&&Be(e,t);for(const e of n)e.computed||Be(e,t)}function Be(e,t){(e!==we||e.allowRecurse)&&(e.scheduler?e.scheduler():e.run())}const je=o("__proto__,__v_isRef,__isVue"),De=new Set(Object.getOwnPropertyNames(Symbol).filter((e=>"arguments"!==e&&"caller"!==e)).map((e=>Symbol[e])).filter(x)),Ue=Je(),He=Je(!1,!0),We=Je(!0),ze=Je(!0,!0),Ke=Ge();function Ge(){const e={};return["includes","indexOf","lastIndexOf"].forEach((t=>{e[t]=function(...e){const n=Ft(this);for(let e=0,t=this.length;e{e[t]=function(...e){Ae();const n=Ft(this)[t].apply(this,e);return Ie(),n}})),e}function qe(e){const t=Ft(this);return $e(t,0,e),t.hasOwnProperty(e)}function Je(e=!1,t=!1){return function(n,r,o){if("__v_isReactive"===r)return!e;if("__v_isReadonly"===r)return e;if("__v_isShallow"===r)return t;if("__v_raw"===r&&o===(e?t?Et:kt:t?wt:Ct).get(n))return n;const s=g(n);if(!e){if(s&&m(Ke,r))return Reflect.get(Ke,r,o);if("hasOwnProperty"===r)return qe}const i=Reflect.get(n,r,o);return(x(r)?De.has(r):je(r))?i:(e||$e(n,0,r),t?i:Ut(i)?s&&R(r)?i:i.value:C(i)?e?Rt(i):Tt(i):i)}}function Ye(e=!1){return function(t,n,r,o){let s=t[n];if(At(s)&&Ut(s)&&!Ut(r))return!1;if(!e&&(It(r)||At(r)||(s=Ft(s),r=Ft(r)),!g(t)&&Ut(s)&&!Ut(r)))return s.value=r,!0;const i=g(t)&&R(n)?Number(n)e,nt=e=>Reflect.getPrototypeOf(e);function rt(e,t,n=!1,r=!1){const o=Ft(e=e.__v_raw),s=Ft(t);n||(t!==s&&$e(o,0,t),$e(o,0,s));const{has:i}=nt(o),c=r?tt:n?Bt:Lt;return i.call(o,t)?c(e.get(t)):i.call(o,s)?c(e.get(s)):void(e!==o&&e.get(t))}function ot(e,t=!1){const n=this.__v_raw,r=Ft(n),o=Ft(e);return t||(e!==o&&$e(r,0,e),$e(r,0,o)),e===o?n.has(e):n.has(e)||n.has(o)}function st(e,t=!1){return e=e.__v_raw,!t&&$e(Ft(e),0,ke),Reflect.get(e,"size",e)}function it(e){e=Ft(e);const t=Ft(this);return nt(t).has.call(t,e)||(t.add(e),Ve(t,"add",e,e)),this}function ct(e,t){t=Ft(t);const n=Ft(this),{has:r,get:o}=nt(n);let s=r.call(n,e);s||(e=Ft(e),s=r.call(n,e));const i=o.call(n,e);return n.set(e,t),s?B(t,i)&&Ve(n,"set",e,t):Ve(n,"add",e,t),this}function lt(e){const t=Ft(this),{has:n,get:r}=nt(t);let o=n.call(t,e);o||(e=Ft(e),o=n.call(t,e));r&&r.call(t,e);const s=t.delete(e);return o&&Ve(t,"delete",e,void 0),s}function ut(){const e=Ft(this),t=0!==e.size,n=e.clear();return t&&Ve(e,"clear",void 0,void 0),n}function at(e,t){return function(n,r){const o=this,s=o.__v_raw,i=Ft(s),c=t?tt:e?Bt:Lt;return!e&&$e(i,0,ke),s.forEach(((e,t)=>n.call(r,c(e),c(t),o)))}}function ft(e,t,n){return function(...r){const o=this.__v_raw,s=Ft(o),i=v(s),c="entries"===e||e===Symbol.iterator&&i,l="keys"===e&&i,u=o[e](...r),a=n?tt:t?Bt:Lt;return!t&&$e(s,0,l?Ee:ke),{next(){const{value:e,done:t}=u.next();return t?{value:e,done:t}:{value:c?[a(e[0]),a(e[1])]:a(e),done:t}},[Symbol.iterator](){return this}}}}function pt(e){return function(...t){return"delete"!==e&&this}}function dt(){const e={get(e){return rt(this,e)},get size(){return st(this)},has:ot,add:it,set:ct,delete:lt,clear:ut,forEach:at(!1,!1)},t={get(e){return rt(this,e,!1,!0)},get size(){return st(this)},has:ot,add:it,set:ct,delete:lt,clear:ut,forEach:at(!1,!0)},n={get(e){return rt(this,e,!0)},get size(){return st(this,!0)},has(e){return ot.call(this,e,!0)},add:pt("add"),set:pt("set"),delete:pt("delete"),clear:pt("clear"),forEach:at(!0,!1)},r={get(e){return rt(this,e,!0,!0)},get size(){return st(this,!0)},has(e){return ot.call(this,e,!0)},add:pt("add"),set:pt("set"),delete:pt("delete"),clear:pt("clear"),forEach:at(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach((o=>{e[o]=ft(o,!1,!1),n[o]=ft(o,!0,!1),t[o]=ft(o,!1,!0),r[o]=ft(o,!0,!0)})),[e,n,t,r]}const[ht,mt,gt,vt]=dt();function yt(e,t){const n=t?e?vt:gt:e?mt:ht;return(t,r,o)=>"__v_isReactive"===r?!e:"__v_isReadonly"===r?e:"__v_raw"===r?t:Reflect.get(m(n,r)&&r in t?n:t,r,o)}const _t={get:yt(!1,!1)},bt={get:yt(!1,!0)},St={get:yt(!0,!1)},xt={get:yt(!0,!0)};const Ct=new WeakMap,wt=new WeakMap,kt=new WeakMap,Et=new WeakMap;function Tt(e){return At(e)?e:Ot(e,!1,Ze,_t,Ct)}function Nt(e){return Ot(e,!1,Qe,bt,wt)}function Rt(e){return Ot(e,!0,Xe,St,kt)}function Mt(e){return Ot(e,!0,et,xt,Et)}function Ot(e,t,n,r,o){if(!C(e))return e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const s=o.get(e);if(s)return s;const i=(c=e).__v_skip||!Object.isExtensible(c)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}(T(c));var c;if(0===i)return e;const l=new Proxy(e,2===i?r:n);return o.set(e,l),l}function Pt(e){return At(e)?Pt(e.__v_raw):!(!e||!e.__v_isReactive)}function At(e){return!(!e||!e.__v_isReadonly)}function It(e){return!(!e||!e.__v_isShallow)}function $t(e){return Pt(e)||At(e)}function Ft(e){const t=e&&e.__v_raw;return t?Ft(t):e}function Vt(e){return D(e,"__v_skip",!0),e}const Lt=e=>C(e)?Tt(e):e,Bt=e=>C(e)?Rt(e):e;function jt(e){Oe&&we&&Fe((e=Ft(e)).dep||(e.dep=ve()))}function Dt(e,t){const n=(e=Ft(e)).dep;n&&Le(n)}function Ut(e){return!(!e||!0!==e.__v_isRef)}function Ht(e){return zt(e,!1)}function Wt(e){return zt(e,!0)}function zt(e,t){return Ut(e)?e:new Kt(e,t)}class Kt{constructor(e,t){this.__v_isShallow=t,this.dep=void 0,this.__v_isRef=!0,this._rawValue=t?e:Ft(e),this._value=t?e:Lt(e)}get value(){return jt(this),this._value}set value(e){const t=this.__v_isShallow||It(e)||At(e);e=t?e:Ft(e),B(e,this._rawValue)&&(this._rawValue=e,this._value=t?e:Lt(e),Dt(this))}}function Gt(e){Dt(e)}function qt(e){return Ut(e)?e.value:e}function Jt(e){return b(e)?e():qt(e)}const Yt={get:(e,t,n)=>qt(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const o=e[t];return Ut(o)&&!Ut(n)?(o.value=n,!0):Reflect.set(e,t,n,r)}};function Zt(e){return Pt(e)?e:new Proxy(e,Yt)}class Xt{constructor(e){this.dep=void 0,this.__v_isRef=!0;const{get:t,set:n}=e((()=>jt(this)),(()=>Dt(this)));this._get=t,this._set=n}get value(){return this._get()}set value(e){this._set(e)}}function Qt(e){return new Xt(e)}function en(e){const t=g(e)?new Array(e.length):{};for(const n in e)t[n]=on(e,n);return t}class tn{constructor(e,t,n){this._object=e,this._key=t,this._defaultValue=n,this.__v_isRef=!0}get value(){const e=this._object[this._key];return void 0===e?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return e=Ft(this._object),t=this._key,null==(n=be.get(e))?void 0:n.get(t);var e,t,n}}class nn{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0}get value(){return this._getter()}}function rn(e,t,n){return Ut(e)?e:b(e)?new nn(e):C(e)&&arguments.length>1?on(e,t,n):Ht(e)}function on(e,t,n){const r=e[t];return Ut(r)?r:new tn(e,t,n)}class sn{constructor(e,t,n,r){this._setter=t,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this._dirty=!0,this.effect=new Te(e,(()=>{this._dirty||(this._dirty=!0,Dt(this))})),this.effect.computed=this,this.effect.active=this._cacheable=!r,this.__v_isReadonly=n}get value(){const e=Ft(this);return jt(e),!e._dirty&&e._cacheable||(e._dirty=!1,e._value=e.effect.run()),e._value}set value(e){this._setter(e)}}function cn(e,...t){}function ln(e,t){}function un(e,t,n,r){let o;try{o=r?e(...r):e()}catch(e){fn(e,t,n)}return o}function an(e,t,n,r){if(b(e)){const o=un(e,t,n,r);return o&&w(o)&&o.catch((e=>{fn(e,t,n)})),o}const o=[];for(let s=0;s>>1;Tn(hn[r])Tn(e)-Tn(t))),yn=0;ynnull==e.id?1/0:e.id,Nn=(e,t)=>{const n=Tn(e)-Tn(t);if(0===n){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return n};function Rn(e){dn=!1,pn=!0,hn.sort(Nn);try{for(mn=0;mnMn.emit(e,...t))),On=[];else if("undefined"!=typeof window&&window.HTMLElement&&!(null==(r=null==(n=window.navigator)?void 0:n.userAgent)?void 0:r.includes("jsdom"))){(t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push((e=>{An(e,t)})),setTimeout((()=>{Mn||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Pn=!0,On=[])}),3e3)}else Pn=!0,On=[]}function In(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||s;let o=n;const i=t.startsWith("update:"),c=i&&t.slice(7);if(c&&c in r){const e=`${"modelValue"===c?"model":c}Modifiers`,{number:t,trim:i}=r[e]||s;i&&(o=n.map((e=>S(e)?e.trim():e))),t&&(o=n.map(U))}let l;let u=r[l=L(t)]||r[l=L(I(t))];!u&&i&&(u=r[l=L(F(t))]),u&&an(u,e,6,o);const a=r[l+"Once"];if(a){if(e.emitted){if(e.emitted[l])return}else e.emitted={};e.emitted[l]=!0,an(a,e,6,o)}}function $n(e,t,n=!1){const r=t.emitsCache,o=r.get(e);if(void 0!==o)return o;const s=e.emits;let i={},c=!1;if(!b(e)){const r=e=>{const n=$n(e,t,!0);n&&(c=!0,p(i,n))};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}return s||c?(g(s)?s.forEach((e=>i[e]=null)):p(i,s),C(e)&&r.set(e,i),i):(C(e)&&r.set(e,null),null)}function Fn(e,t){return!(!e||!a(t))&&(t=t.slice(2).replace(/Once$/,""),m(e,t[0].toLowerCase()+t.slice(1))||m(e,F(t))||m(e,t))}let Vn=null,Ln=null;function Bn(e){const t=Vn;return Vn=e,Ln=e&&e.type.__scopeId||null,t}function jn(e){Ln=e}function Dn(){Ln=null}const Un=e=>Hn;function Hn(e,t=Vn,n){if(!t)return e;if(e._n)return e;const r=(...n)=>{r._d&&Fs(-1);const o=Bn(t);let s;try{s=e(...n)}finally{Bn(o),r._d&&Fs(1)}return s};return r._n=!0,r._c=!0,r._d=!0,r}function Wn(e){const{type:t,vnode:n,proxy:r,withProxy:o,props:s,propsOptions:[i],slots:c,attrs:l,emit:u,render:a,renderCache:p,data:d,setupState:h,ctx:m,inheritAttrs:g}=e;let v,y;const _=Bn(e);try{if(4&n.shapeFlag){const e=o||r;v=ei(a.call(e,e,p,s,h,d,m)),y=l}else{const e=t;0,v=ei(e.length>1?e(s,{attrs:l,slots:c,emit:u}):e(s,null)),y=t.props?l:Kn(l)}}catch(t){Ms.length=0,fn(t,e,1),v=Gs(Ns)}let b=v;if(y&&!1!==g){const e=Object.keys(y),{shapeFlag:t}=b;e.length&&7&t&&(i&&e.some(f)&&(y=Gn(y,i)),b=Ys(b,y))}return n.dirs&&(b=Ys(b),b.dirs=b.dirs?b.dirs.concat(n.dirs):n.dirs),n.transition&&(b.transition=n.transition),v=b,Bn(_),v}function zn(e){let t;for(let n=0;n{let t;for(const n in e)("class"===n||"style"===n||a(n))&&((t||(t={}))[n]=e[n]);return t},Gn=(e,t)=>{const n={};for(const r in e)f(r)&&r.slice(9)in t||(n[r]=e[r]);return n};function qn(e,t,n){const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let o=0;oe.__isSuspense,Zn={name:"Suspense",__isSuspense:!0,process(e,t,n,r,o,s,i,c,l,u){null==e?function(e,t,n,r,o,s,i,c,l){const{p:u,o:{createElement:a}}=l,f=a("div"),p=e.suspense=Qn(e,o,r,t,f,n,s,i,c,l);u(null,p.pendingBranch=e.ssContent,f,null,r,p,s,i),p.deps>0?(Xn(e,"onPending"),Xn(e,"onFallback"),u(null,e.ssFallback,t,n,r,null,s,i),nr(p,e.ssFallback)):p.resolve(!1,!0)}(t,n,r,o,s,i,c,l,u):function(e,t,n,r,o,s,i,c,{p:l,um:u,o:{createElement:a}}){const f=t.suspense=e.suspense;f.vnode=t,t.el=e.el;const p=t.ssContent,d=t.ssFallback,{activeBranch:h,pendingBranch:m,isInFallback:g,isHydrating:v}=f;if(m)f.pendingBranch=p,Ds(p,m)?(l(m,p,f.hiddenContainer,null,o,f,s,i,c),f.deps<=0?f.resolve():g&&(l(h,d,n,r,o,null,s,i,c),nr(f,d))):(f.pendingId++,v?(f.isHydrating=!1,f.activeBranch=m):u(m,o,f),f.deps=0,f.effects.length=0,f.hiddenContainer=a("div"),g?(l(null,p,f.hiddenContainer,null,o,f,s,i,c),f.deps<=0?f.resolve():(l(h,d,n,r,o,null,s,i,c),nr(f,d))):h&&Ds(p,h)?(l(h,p,n,r,o,f,s,i,c),f.resolve(!0)):(l(null,p,f.hiddenContainer,null,o,f,s,i,c),f.deps<=0&&f.resolve()));else if(h&&Ds(p,h))l(h,p,n,r,o,f,s,i,c),nr(f,p);else if(Xn(t,"onPending"),f.pendingBranch=p,f.pendingId++,l(null,p,f.hiddenContainer,null,o,f,s,i,c),f.deps<=0)f.resolve();else{const{timeout:e,pendingId:t}=f;e>0?setTimeout((()=>{f.pendingId===t&&f.fallback(d)}),e):0===e&&f.fallback(d)}}(e,t,n,r,o,i,c,l,u)},hydrate:function(e,t,n,r,o,s,i,c,l){const u=t.suspense=Qn(t,r,n,e.parentNode,document.createElement("div"),null,o,s,i,c,!0),a=l(e,u.pendingBranch=t.ssContent,n,u,s,i);0===u.deps&&u.resolve(!1,!0);return a},create:Qn,normalize:function(e){const{shapeFlag:t,children:n}=e,r=32&t;e.ssContent=er(r?n.default:n),e.ssFallback=r?er(n.fallback):Gs(Ns)}};function Xn(e,t){const n=e.props&&e.props[t];b(n)&&n()}function Qn(e,t,n,r,o,s,i,c,l,u,a=!1){const{p:f,m:p,um:d,n:h,o:{parentNode:m,remove:g}}=u;let v;const y=function(e){var t;return null!=(null==(t=e.props)?void 0:t.suspensible)&&!1!==e.props.suspensible}(e);y&&(null==t?void 0:t.pendingBranch)&&(v=t.pendingId,t.deps++);const _=e.props?H(e.props.timeout):void 0;const b={vnode:e,parent:t,parentComponent:n,isSVG:i,container:r,hiddenContainer:o,anchor:s,deps:0,pendingId:0,timeout:"number"==typeof _?_:-1,activeBranch:null,pendingBranch:null,isInFallback:!0,isHydrating:a,isUnmounted:!1,effects:[],resolve(e=!1,n=!1){const{vnode:r,activeBranch:o,pendingBranch:s,pendingId:i,effects:c,parentComponent:l,container:u}=b;if(b.isHydrating)b.isHydrating=!1;else if(!e){const e=o&&s.transition&&"out-in"===s.transition.mode;e&&(o.transition.afterLeave=()=>{i===b.pendingId&&p(s,u,t,0)});let{anchor:t}=b;o&&(t=h(o),d(o,l,b,!0)),e||p(s,u,t,0)}nr(b,s),b.pendingBranch=null,b.isInFallback=!1;let a=b.parent,f=!1;for(;a;){if(a.pendingBranch){a.effects.push(...c),f=!0;break}a=a.parent}f||wn(c),b.effects=[],y&&t&&t.pendingBranch&&v===t.pendingId&&(t.deps--,0!==t.deps||n||t.resolve()),Xn(r,"onResolve")},fallback(e){if(!b.pendingBranch)return;const{vnode:t,activeBranch:n,parentComponent:r,container:o,isSVG:s}=b;Xn(t,"onFallback");const i=h(n),u=()=>{b.isInFallback&&(f(null,e,o,i,r,null,s,c,l),nr(b,e))},a=e.transition&&"out-in"===e.transition.mode;a&&(n.transition.afterLeave=u),b.isInFallback=!0,d(n,r,null,!0),a||u()},move(e,t,n){b.activeBranch&&p(b.activeBranch,e,t,n),b.container=e},next(){return b.activeBranch&&h(b.activeBranch)},registerDep(e,t){const n=!!b.pendingBranch;n&&b.deps++;const r=e.vnode.el;e.asyncDep.catch((t=>{fn(t,e,0)})).then((o=>{if(e.isUnmounted||b.isUnmounted||b.pendingId!==e.suspenseId)return;e.asyncResolved=!0;const{vnode:s}=e;bi(e,o,!1),r&&(s.el=r);const c=!r&&e.subTree.el;t(e,s,m(r||e.subTree.el),r?null:h(e.subTree),b,i,l),c&&g(c),Jn(e,s.el),n&&0==--b.deps&&b.resolve()}))},unmount(e,t){b.isUnmounted=!0,b.activeBranch&&d(b.activeBranch,n,e,t),b.pendingBranch&&d(b.pendingBranch,n,e,t)}};return b}function er(e){let t;if(b(e)){const n=$s&&e._c;n&&(e._d=!1,Ps()),e=e(),n&&(e._d=!0,t=Os,As())}if(g(e)){const t=zn(e);0,e=t}return e=ei(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter((t=>t!==e))),e}function tr(e,t){t&&t.pendingBranch?g(e)?t.effects.push(...e):t.effects.push(e):wn(e)}function nr(e,t){e.activeBranch=t;const{vnode:n,parentComponent:r}=e,o=n.el=t.el;r&&r.subTree===n&&(r.vnode.el=o,Jn(r,o))}function rr(e,t){return lr(e,null,t)}function or(e,t){return lr(e,null,{flush:"post"})}function sr(e,t){return lr(e,null,{flush:"sync"})}const ir={};function cr(e,t,n){return lr(e,t,n)}function lr(e,t,{immediate:n,deep:r,flush:o,onTrack:i,onTrigger:l}=s){var u;const a=me()===(null==(u=li)?void 0:u.scope)?li:null;let f,p,h=!1,m=!1;if(Ut(e)?(f=()=>e.value,h=It(e)):Pt(e)?(f=()=>e,r=!0):g(e)?(m=!0,h=e.some((e=>Pt(e)||It(e))),f=()=>e.map((e=>Ut(e)?e.value:Pt(e)?fr(e):b(e)?un(e,a,2):void 0))):f=b(e)?t?()=>un(e,a,2):()=>{if(!a||!a.isUnmounted)return p&&p(),an(e,a,3,[y])}:c,t&&r){const e=f;f=()=>fr(e())}let v,y=e=>{p=C.onStop=()=>{un(e,a,4)}};if(yi){if(y=c,t?n&&an(t,a,3,[f(),m?[]:void 0,y]):f(),"sync"!==o)return c;{const e=Oi();v=e.__watcherHandles||(e.__watcherHandles=[])}}let _=m?new Array(e.length).fill(ir):ir;const S=()=>{if(C.active)if(t){const e=C.run();(r||h||(m?e.some(((e,t)=>B(e,_[t]))):B(e,_)))&&(p&&p(),an(t,a,3,[e,_===ir?void 0:m&&_[0]===ir?[]:_,y]),_=e)}else C.run()};let x;S.allowRecurse=!!t,"sync"===o?x=S:"post"===o?x=()=>hs(S,a&&a.suspense):(S.pre=!0,a&&(S.id=a.uid),x=()=>xn(S));const C=new Te(f,x);t?n?S():_=C.run():"post"===o?hs(C.run.bind(C),a&&a.suspense):C.run();const w=()=>{C.stop(),a&&a.scope&&d(a.scope.effects,C)};return v&&v.push(w),w}function ur(e,t,n){const r=this.proxy,o=S(e)?e.includes(".")?ar(r,e):()=>r[e]:e.bind(r,r);let s;b(t)?s=t:(s=t.handler,n=t);const i=li;di(this);const c=lr(o,s.bind(r),n);return i?di(i):hi(),c}function ar(e,t){const n=t.split(".");return()=>{let t=e;for(let e=0;e{fr(e,t)}));else if(N(e))for(const n in e)fr(e[n],t);return e}function pr(e,t){const n=Vn;if(null===n)return e;const r=ki(n)||n.proxy,o=e.dirs||(e.dirs=[]);for(let e=0;e{e.isMounted=!0})),Hr((()=>{e.isUnmounting=!0})),e}const mr=[Function,Array],gr={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:mr,onEnter:mr,onAfterEnter:mr,onEnterCancelled:mr,onBeforeLeave:mr,onLeave:mr,onAfterLeave:mr,onLeaveCancelled:mr,onBeforeAppear:mr,onAppear:mr,onAfterAppear:mr,onAppearCancelled:mr},vr={name:"BaseTransition",props:gr,setup(e,{slots:t}){const n=ui(),r=hr();let o;return()=>{const s=t.default&&Cr(t.default(),!0);if(!s||!s.length)return;let i=s[0];if(s.length>1){let e=!1;for(const t of s)if(t.type!==Ns){0,i=t,e=!0;break}}const c=Ft(e),{mode:l}=c;if(r.isLeaving)return br(i);const u=Sr(i);if(!u)return br(i);const a=_r(u,c,r,n);xr(u,a);const f=n.subTree,p=f&&Sr(f);let d=!1;const{getTransitionKey:h}=u.type;if(h){const e=h();void 0===o?o=e:e!==o&&(o=e,d=!0)}if(p&&p.type!==Ns&&(!Ds(u,p)||d)){const e=_r(p,c,r,n);if(xr(p,e),"out-in"===l)return r.isLeaving=!0,e.afterLeave=()=>{r.isLeaving=!1,!1!==n.update.active&&n.update()},br(i);"in-out"===l&&u.type!==Ns&&(e.delayLeave=(e,t,n)=>{yr(r,p)[String(p.key)]=p,e._leaveCb=()=>{t(),e._leaveCb=void 0,delete a.delayedLeave},a.delayedLeave=n})}return i}}};function yr(e,t){const{leavingVNodes:n}=e;let r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function _r(e,t,n,r){const{appear:o,mode:s,persisted:i=!1,onBeforeEnter:c,onEnter:l,onAfterEnter:u,onEnterCancelled:a,onBeforeLeave:f,onLeave:p,onAfterLeave:d,onLeaveCancelled:h,onBeforeAppear:m,onAppear:v,onAfterAppear:y,onAppearCancelled:_}=t,b=String(e.key),S=yr(n,e),x=(e,t)=>{e&&an(e,r,9,t)},C=(e,t)=>{const n=t[1];x(e,t),g(e)?e.every((e=>e.length<=1))&&n():e.length<=1&&n()},w={mode:s,persisted:i,beforeEnter(t){let r=c;if(!n.isMounted){if(!o)return;r=m||c}t._leaveCb&&t._leaveCb(!0);const s=S[b];s&&Ds(e,s)&&s.el._leaveCb&&s.el._leaveCb(),x(r,[t])},enter(e){let t=l,r=u,s=a;if(!n.isMounted){if(!o)return;t=v||l,r=y||u,s=_||a}let i=!1;const c=e._enterCb=t=>{i||(i=!0,x(t?s:r,[e]),w.delayedLeave&&w.delayedLeave(),e._enterCb=void 0)};t?C(t,[e,c]):c()},leave(t,r){const o=String(e.key);if(t._enterCb&&t._enterCb(!0),n.isUnmounting)return r();x(f,[t]);let s=!1;const i=t._leaveCb=n=>{s||(s=!0,r(),x(n?h:d,[t]),t._leaveCb=void 0,S[o]===e&&delete S[o])};S[o]=e,p?C(p,[t,i]):i()},clone(e){return _r(e,t,n,r)}};return w}function br(e){if(Nr(e))return(e=Ys(e)).children=null,e}function Sr(e){return Nr(e)?e.children?e.children[0]:void 0:e}function xr(e,t){6&e.shapeFlag&&e.component?xr(e.component.subTree,t):128&e.shapeFlag?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Cr(e,t=!1,n){let r=[],o=0;for(let s=0;s1)for(let e=0;ep({name:e.name},t,{setup:e}))():e}const kr=e=>!!e.type.__asyncLoader;function Er(e){b(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:r,delay:o=200,timeout:s,suspensible:i=!0,onError:c}=e;let l,u=null,a=0;const f=()=>{let e;return u||(e=u=t().catch((e=>{if(e=e instanceof Error?e:new Error(String(e)),c)return new Promise(((t,n)=>{c(e,(()=>t((a++,u=null,f()))),(()=>n(e)),a+1)}));throw e})).then((t=>e!==u&&u?u:(t&&(t.__esModule||"Module"===t[Symbol.toStringTag])&&(t=t.default),l=t,t))))};return wr({name:"AsyncComponentWrapper",__asyncLoader:f,get __asyncResolved(){return l},setup(){const e=li;if(l)return()=>Tr(l,e);const t=t=>{u=null,fn(t,e,13,!r)};if(i&&e.suspense||yi)return f().then((t=>()=>Tr(t,e))).catch((e=>(t(e),()=>r?Gs(r,{error:e}):null)));const c=Ht(!1),a=Ht(),p=Ht(!!o);return o&&setTimeout((()=>{p.value=!1}),o),null!=s&&setTimeout((()=>{if(!c.value&&!a.value){const e=new Error(`Async component timed out after ${s}ms.`);t(e),a.value=e}}),s),f().then((()=>{c.value=!0,e.parent&&Nr(e.parent.vnode)&&xn(e.parent.update)})).catch((e=>{t(e),a.value=e})),()=>c.value&&l?Tr(l,e):a.value&&r?Gs(r,{error:a.value}):n&&!p.value?Gs(n):void 0}})}function Tr(e,t){const{ref:n,props:r,children:o,ce:s}=t.vnode,i=Gs(e,r,o);return i.ref=n,i.ce=s,delete t.vnode.ce,i}const Nr=e=>e.type.__isKeepAlive,Rr={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=ui(),r=n.ctx;if(!r.renderer)return()=>{const e=t.default&&t.default();return e&&1===e.length?e[0]:e};const o=new Map,s=new Set;let i=null;const c=n.suspense,{renderer:{p:l,m:u,um:a,o:{createElement:f}}}=r,p=f("div");function d(e){$r(e),a(e,n,c,!0)}function h(e){o.forEach(((t,n)=>{const r=Ei(t.type);!r||e&&e(r)||m(n)}))}function m(e){const t=o.get(e);i&&Ds(t,i)?i&&$r(i):d(t),o.delete(e),s.delete(e)}r.activate=(e,t,n,r,o)=>{const s=e.component;u(e,t,n,0,c),l(s.vnode,e,t,n,s,c,r,e.slotScopeIds,o),hs((()=>{s.isDeactivated=!1,s.a&&j(s.a);const t=e.props&&e.props.onVnodeMounted;t&&oi(t,s.parent,e)}),c)},r.deactivate=e=>{const t=e.component;u(e,p,null,1,c),hs((()=>{t.da&&j(t.da);const n=e.props&&e.props.onVnodeUnmounted;n&&oi(n,t.parent,e),t.isDeactivated=!0}),c)},cr((()=>[e.include,e.exclude]),(([e,t])=>{e&&h((t=>Mr(e,t))),t&&h((e=>!Mr(t,e)))}),{flush:"post",deep:!0});let g=null;const v=()=>{null!=g&&o.set(g,Fr(n.subTree))};return jr(v),Ur(v),Hr((()=>{o.forEach((e=>{const{subTree:t,suspense:r}=n,o=Fr(t);if(e.type!==o.type||e.key!==o.key)d(e);else{$r(o);const e=o.component.da;e&&hs(e,r)}}))})),()=>{if(g=null,!t.default)return null;const n=t.default(),r=n[0];if(n.length>1)return i=null,n;if(!(js(r)&&(4&r.shapeFlag||128&r.shapeFlag)))return i=null,r;let c=Fr(r);const l=c.type,u=Ei(kr(c)?c.type.__asyncResolved||{}:l),{include:a,exclude:f,max:p}=e;if(a&&(!u||!Mr(a,u))||f&&u&&Mr(f,u))return i=c,r;const d=null==c.key?l:c.key,h=o.get(d);return c.el&&(c=Ys(c),128&r.shapeFlag&&(r.ssContent=c)),g=d,h?(c.el=h.el,c.component=h.component,c.transition&&xr(c,c.transition),c.shapeFlag|=512,s.delete(d),s.add(d)):(s.add(d),p&&s.size>parseInt(p,10)&&m(s.values().next().value)),c.shapeFlag|=256,i=c,Yn(r.type)?r:c}}};function Mr(e,t){return g(e)?e.some((e=>Mr(e,t))):S(e)?e.split(",").includes(t):"[object RegExp]"===E(e)&&e.test(t)}function Or(e,t){Ar(e,"a",t)}function Pr(e,t){Ar(e,"da",t)}function Ar(e,t,n=li){const r=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()});if(Vr(t,r,n),n){let e=n.parent;for(;e&&e.parent;)Nr(e.parent.vnode)&&Ir(r,t,n,e),e=e.parent}}function Ir(e,t,n,r){const o=Vr(t,e,r,!0);Wr((()=>{d(r[t],o)}),n)}function $r(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function Fr(e){return 128&e.shapeFlag?e.ssContent:e}function Vr(e,t,n=li,r=!1){if(n){const o=n[e]||(n[e]=[]),s=t.__weh||(t.__weh=(...r)=>{if(n.isUnmounted)return;Ae(),di(n);const o=an(t,n,e,r);return hi(),Ie(),o});return r?o.unshift(s):o.push(s),s}}const Lr=e=>(t,n=li)=>(!yi||"sp"===e)&&Vr(e,((...e)=>t(...e)),n),Br=Lr("bm"),jr=Lr("m"),Dr=Lr("bu"),Ur=Lr("u"),Hr=Lr("bum"),Wr=Lr("um"),zr=Lr("sp"),Kr=Lr("rtg"),Gr=Lr("rtc");function qr(e,t=li){Vr("ec",e,t)}const Jr="components",Yr="directives";function Zr(e,t){return to(Jr,e,!0,t)||e}const Xr=Symbol.for("v-ndc");function Qr(e){return S(e)?to(Jr,e,!1)||e:e||Xr}function eo(e){return to(Yr,e)}function to(e,t,n=!0,r=!1){const o=Vn||li;if(o){const n=o.type;if(e===Jr){const e=Ei(n,!1);if(e&&(e===t||e===I(t)||e===V(I(t))))return n}const s=no(o[e]||n[e],t)||no(o.appContext[e],t);return!s&&r?n:s}}function no(e,t){return e&&(e[t]||e[I(t)]||e[V(I(t))])}function ro(e,t,n,r){let o;const s=n&&n[r];if(g(e)||S(e)){o=new Array(e.length);for(let n=0,r=e.length;nt(e,n,void 0,s&&s[n])));else{const n=Object.keys(e);o=new Array(n.length);for(let r=0,i=n.length;r{const t=r.fn(...e);return t&&(t.key=r.key),t}:r.fn)}return e}function so(e,t,n={},r,o){if(Vn.isCE||Vn.parent&&kr(Vn.parent)&&Vn.parent.isCE)return"default"!==t&&(n.name=t),Gs("slot",n,r&&r());let s=e[t];s&&s._c&&(s._d=!1),Ps();const i=s&&io(s(n)),c=Bs(Es,{key:n.key||i&&i.key||`_${t}`},i||(r?r():[]),i&&1===e._?64:-2);return!o&&c.scopeId&&(c.slotScopeIds=[c.scopeId+"-s"]),s&&s._c&&(s._d=!0),c}function io(e){return e.some((e=>!js(e)||e.type!==Ns&&!(e.type===Es&&!io(e.children))))?e:null}function co(e,t){const n={};for(const r in e)n[t&&/[A-Z]/.test(r)?`on:${r}`:L(r)]=e[r];return n}const lo=e=>e?mi(e)?ki(e)||e.proxy:lo(e.parent):null,uo=p(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>lo(e.parent),$root:e=>lo(e.root),$emit:e=>e.emit,$options:e=>Io(e),$forceUpdate:e=>e.f||(e.f=()=>xn(e.update)),$nextTick:e=>e.n||(e.n=Sn.bind(e.proxy)),$watch:e=>ur.bind(e)}),ao=(e,t)=>e!==s&&!e.__isScriptSetup&&m(e,t),fo={get({_:e},t){const{ctx:n,setupState:r,data:o,props:i,accessCache:c,type:l,appContext:u}=e;let a;if("$"!==t[0]){const l=c[t];if(void 0!==l)switch(l){case 1:return r[t];case 2:return o[t];case 4:return n[t];case 3:return i[t]}else{if(ao(r,t))return c[t]=1,r[t];if(o!==s&&m(o,t))return c[t]=2,o[t];if((a=e.propsOptions[0])&&m(a,t))return c[t]=3,i[t];if(n!==s&&m(n,t))return c[t]=4,n[t];Mo&&(c[t]=0)}}const f=uo[t];let p,d;return f?("$attrs"===t&&$e(e,0,t),f(e)):(p=l.__cssModules)&&(p=p[t])?p:n!==s&&m(n,t)?(c[t]=4,n[t]):(d=u.config.globalProperties,m(d,t)?d[t]:void 0)},set({_:e},t,n){const{data:r,setupState:o,ctx:i}=e;return ao(o,t)?(o[t]=n,!0):r!==s&&m(r,t)?(r[t]=n,!0):!m(e.props,t)&&(("$"!==t[0]||!(t.slice(1)in e))&&(i[t]=n,!0))},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:o,propsOptions:i}},c){let l;return!!n[c]||e!==s&&m(e,c)||ao(t,c)||(l=i[0])&&m(l,c)||m(r,c)||m(uo,c)||m(o.config.globalProperties,c)},defineProperty(e,t,n){return null!=n.get?e._.accessCache[t]=0:m(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};const po=p({},fo,{get(e,t){if(t!==Symbol.unscopables)return fo.get(e,t,e)},has(e,t){return"_"!==t[0]&&!G(t)}});function ho(){return null}function mo(){return null}function go(e){0}function vo(e){0}function yo(){return null}function _o(){0}function bo(e,t){return null}function So(){return wo().slots}function xo(){return wo().attrs}function Co(e,t,n){const r=ui();if(n&&n.local){const n=Ht(e[t]);return cr((()=>e[t]),(e=>n.value=e)),cr(n,(n=>{n!==e[t]&&r.emit(`update:${t}`,n)})),n}return{__v_isRef:!0,get value(){return e[t]},set value(e){r.emit(`update:${t}`,e)}}}function wo(){const e=ui();return e.setupContext||(e.setupContext=wi(e))}function ko(e){return g(e)?e.reduce(((e,t)=>(e[t]=null,e)),{}):e}function Eo(e,t){const n=ko(e);for(const e in t){if(e.startsWith("__skip"))continue;let r=n[e];r?g(r)||b(r)?r=n[e]={type:r,default:t[e]}:r.default=t[e]:null===r&&(r=n[e]={default:t[e]}),r&&t[`__skip_${e}`]&&(r.skipFactory=!0)}return n}function To(e,t){return e&&t?g(e)&&g(t)?e.concat(t):p({},ko(e),ko(t)):e||t}function No(e,t){const n={};for(const r in e)t.includes(r)||Object.defineProperty(n,r,{enumerable:!0,get:()=>e[r]});return n}function Ro(e){const t=ui();let n=e();return hi(),w(n)&&(n=n.catch((e=>{throw di(t),e}))),[n,()=>di(t)]}let Mo=!0;function Oo(e){const t=Io(e),n=e.proxy,r=e.ctx;Mo=!1,t.beforeCreate&&Po(t.beforeCreate,e,"bc");const{data:o,computed:s,methods:i,watch:l,provide:u,inject:a,created:f,beforeMount:p,mounted:d,beforeUpdate:h,updated:m,activated:v,deactivated:y,beforeDestroy:_,beforeUnmount:S,destroyed:x,unmounted:w,render:k,renderTracked:E,renderTriggered:T,errorCaptured:N,serverPrefetch:R,expose:M,inheritAttrs:O,components:P,directives:A,filters:I}=t;if(a&&function(e,t,n=c){g(e)&&(e=Lo(e));for(const n in e){const r=e[n];let o;o=C(r)?"default"in r?Go(r.from||n,r.default,!0):Go(r.from||n):Go(r),Ut(o)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>o.value,set:e=>o.value=e}):t[n]=o}}(a,r,null),i)for(const e in i){const t=i[e];b(t)&&(r[e]=t.bind(n))}if(o){0;const t=o.call(n,n);0,C(t)&&(e.data=Tt(t))}if(Mo=!0,s)for(const e in s){const t=s[e],o=b(t)?t.bind(n,n):b(t.get)?t.get.bind(n,n):c;0;const i=!b(t)&&b(t.set)?t.set.bind(n):c,l=Ni({get:o,set:i});Object.defineProperty(r,e,{enumerable:!0,configurable:!0,get:()=>l.value,set:e=>l.value=e})}if(l)for(const e in l)Ao(l[e],r,n,e);if(u){const e=b(u)?u.call(n):u;Reflect.ownKeys(e).forEach((t=>{Ko(t,e[t])}))}function $(e,t){g(t)?t.forEach((t=>e(t.bind(n)))):t&&e(t.bind(n))}if(f&&Po(f,e,"c"),$(Br,p),$(jr,d),$(Dr,h),$(Ur,m),$(Or,v),$(Pr,y),$(qr,N),$(Gr,E),$(Kr,T),$(Hr,S),$(Wr,w),$(zr,R),g(M))if(M.length){const t=e.exposed||(e.exposed={});M.forEach((e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t})}))}else e.exposed||(e.exposed={});k&&e.render===c&&(e.render=k),null!=O&&(e.inheritAttrs=O),P&&(e.components=P),A&&(e.directives=A)}function Po(e,t,n){an(g(e)?e.map((e=>e.bind(t.proxy))):e.bind(t.proxy),t,n)}function Ao(e,t,n,r){const o=r.includes(".")?ar(n,r):()=>n[r];if(S(e)){const n=t[e];b(n)&&cr(o,n)}else if(b(e))cr(o,e.bind(n));else if(C(e))if(g(e))e.forEach((e=>Ao(e,t,n,r)));else{const r=b(e.handler)?e.handler.bind(n):t[e.handler];b(r)&&cr(o,r,e)}else 0}function Io(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:o,optionsCache:s,config:{optionMergeStrategies:i}}=e.appContext,c=s.get(t);let l;return c?l=c:o.length||n||r?(l={},o.length&&o.forEach((e=>$o(l,e,i,!0))),$o(l,t,i)):l=t,C(t)&&s.set(t,l),l}function $o(e,t,n,r=!1){const{mixins:o,extends:s}=t;s&&$o(e,s,n,!0),o&&o.forEach((t=>$o(e,t,n,!0)));for(const o in t)if(r&&"expose"===o);else{const r=Fo[o]||n&&n[o];e[o]=r?r(e[o],t[o]):t[o]}return e}const Fo={data:Vo,props:Do,emits:Do,methods:jo,computed:jo,beforeCreate:Bo,created:Bo,beforeMount:Bo,mounted:Bo,beforeUpdate:Bo,updated:Bo,beforeDestroy:Bo,beforeUnmount:Bo,destroyed:Bo,unmounted:Bo,activated:Bo,deactivated:Bo,errorCaptured:Bo,serverPrefetch:Bo,components:jo,directives:jo,watch:function(e,t){if(!e)return t;if(!t)return e;const n=p(Object.create(null),e);for(const r in t)n[r]=Bo(e[r],t[r]);return n},provide:Vo,inject:function(e,t){return jo(Lo(e),Lo(t))}};function Vo(e,t){return t?e?function(){return p(b(e)?e.call(this,this):e,b(t)?t.call(this,this):t)}:t:e}function Lo(e){if(g(e)){const t={};for(let n=0;n1)return n&&b(t)?t.call(r&&r.proxy):t}else 0}function qo(){return!!(li||Vn||zo)}function Jo(e,t,n,r){const[o,i]=e.propsOptions;let c,l=!1;if(t)for(let s in t){if(M(s))continue;const u=t[s];let a;o&&m(o,a=I(s))?i&&i.includes(a)?(c||(c={}))[a]=u:n[a]=u:Fn(e.emitsOptions,s)||s in r&&u===r[s]||(r[s]=u,l=!0)}if(i){const t=Ft(n),r=c||s;for(let s=0;s{a=!0;const[n,r]=Zo(e,t,!0);p(l,n),r&&u.push(...r)};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}if(!c&&!a)return C(e)&&r.set(e,i),i;if(g(c))for(let e=0;e-1,r[1]=n<0||e-1||m(r,"default"))&&u.push(t)}}}}const f=[l,u];return C(e)&&r.set(e,f),f}function Xo(e){return"$"!==e[0]}function Qo(e){const t=e&&e.toString().match(/^\s*(function|class) (\w+)/);return t?t[2]:null===e?"null":""}function es(e,t){return Qo(e)===Qo(t)}function ts(e,t){return g(t)?t.findIndex((t=>es(t,e))):b(t)&&es(t,e)?0:-1}const ns=e=>"_"===e[0]||"$stable"===e,rs=e=>g(e)?e.map(ei):[ei(e)],os=(e,t,n)=>{if(t._n)return t;const r=Hn(((...e)=>rs(t(...e))),n);return r._c=!1,r},ss=(e,t,n)=>{const r=e._ctx;for(const n in e){if(ns(n))continue;const o=e[n];if(b(o))t[n]=os(0,o,r);else if(null!=o){0;const e=rs(o);t[n]=()=>e}}},is=(e,t)=>{const n=rs(t);e.slots.default=()=>n},cs=(e,t)=>{if(32&e.vnode.shapeFlag){const n=t._;n?(e.slots=Ft(t),D(t,"_",n)):ss(t,e.slots={})}else e.slots={},t&&is(e,t);D(e.slots,Hs,1)},ls=(e,t,n)=>{const{vnode:r,slots:o}=e;let i=!0,c=s;if(32&r.shapeFlag){const e=t._;e?n&&1===e?i=!1:(p(o,t),n||1!==e||delete o._):(i=!t.$stable,ss(t,o)),c=t}else t&&(is(e,t),c={default:1});if(i)for(const e in o)ns(e)||e in c||delete o[e]};function us(e,t,n,r,o=!1){if(g(e))return void e.forEach(((e,s)=>us(e,t&&(g(t)?t[s]:t),n,r,o)));if(kr(r)&&!o)return;const i=4&r.shapeFlag?ki(r.component)||r.component.proxy:r.el,c=o?null:i,{i:l,r:u}=e;const a=t&&t.r,f=l.refs===s?l.refs={}:l.refs,p=l.setupState;if(null!=a&&a!==u&&(S(a)?(f[a]=null,m(p,a)&&(p[a]=null)):Ut(a)&&(a.value=null)),b(u))un(u,l,12,[c,f]);else{const t=S(u),r=Ut(u);if(t||r){const s=()=>{if(e.f){const n=t?m(p,u)?p[u]:f[u]:u.value;o?g(n)&&d(n,i):g(n)?n.includes(i)||n.push(i):t?(f[u]=[i],m(p,u)&&(p[u]=f[u])):(u.value=[i],e.k&&(f[e.k]=u.value))}else t?(f[u]=c,m(p,u)&&(p[u]=c)):r&&(u.value=c,e.k&&(f[e.k]=c))};c?(s.id=-1,hs(s,n)):s()}else 0}}let as=!1;const fs=e=>/svg/.test(e.namespaceURI)&&"foreignObject"!==e.tagName,ps=e=>8===e.nodeType;function ds(e){const{mt:t,p:n,o:{patchProp:r,createText:o,nextSibling:s,parentNode:i,remove:c,insert:l,createComment:u}}=e,f=(n,r,c,u,a,v=!1)=>{const y=ps(n)&&"["===n.data,_=()=>m(n,r,c,u,a,y),{type:b,ref:S,shapeFlag:x,patchFlag:C}=r;let w=n.nodeType;r.el=n,-2===C&&(v=!1,r.dynamicChildren=null);let k=null;switch(b){case Ts:3!==w?""===r.children?(l(r.el=o(""),i(n),n),k=n):k=_():(n.data!==r.children&&(as=!0,n.data=r.children),k=s(n));break;case Ns:k=8!==w||y?_():s(n);break;case Rs:if(y&&(w=(n=s(n)).nodeType),1===w||3===w){k=n;const e=!r.children.length;for(let t=0;t{i=i||!!t.dynamicChildren;const{type:l,props:u,patchFlag:f,shapeFlag:p,dirs:h}=t,m="input"===l&&h||"option"===l;if(m||-1!==f){if(h&&dr(t,null,n,"created"),u)if(m||!i||48&f)for(const t in u)(m&&t.endsWith("value")||a(t)&&!M(t))&&r(e,t,null,u[t],!1,void 0,n);else u.onClick&&r(e,"onClick",null,u.onClick,!1,void 0,n);let l;if((l=u&&u.onVnodeBeforeMount)&&oi(l,n,t),h&&dr(t,null,n,"beforeMount"),((l=u&&u.onVnodeMounted)||h)&&tr((()=>{l&&oi(l,n,t),h&&dr(t,null,n,"mounted")}),o),16&p&&(!u||!u.innerHTML&&!u.textContent)){let r=d(e.firstChild,t,e,n,o,s,i);for(;r;){as=!0;const e=r;r=r.nextSibling,c(e)}}else 8&p&&e.textContent!==t.children&&(as=!0,e.textContent=t.children)}return e.nextSibling},d=(e,t,r,o,s,i,c)=>{c=c||!!t.dynamicChildren;const l=t.children,u=l.length;for(let t=0;t{const{slotScopeIds:a}=t;a&&(o=o?o.concat(a):a);const f=i(e),p=d(s(e),t,f,n,r,o,c);return p&&ps(p)&&"]"===p.data?s(t.anchor=p):(as=!0,l(t.anchor=u("]"),f,p),p)},m=(e,t,r,o,l,u)=>{if(as=!0,t.el=null,u){const t=g(e);for(;;){const n=s(e);if(!n||n===t)break;c(n)}}const a=s(e),f=i(e);return c(e),n(null,t,f,a,r,o,fs(f),l),a},g=e=>{let t=0;for(;e;)if((e=s(e))&&ps(e)&&("["===e.data&&t++,"]"===e.data)){if(0===t)return s(e);t--}return e};return[(e,t)=>{if(!t.hasChildNodes())return n(null,e,t),En(),void(t._vnode=e);as=!1,f(t.firstChild,e,null,null,null),En(),t._vnode=e,as&&console.error("Hydration completed but contains mismatches.")},f]}const hs=tr;function ms(e){return vs(e)}function gs(e){return vs(e,ds)}function vs(e,t){z().__VUE__=!0;const{insert:n,remove:r,patchProp:o,createElement:l,createText:u,createComment:a,setText:f,setElementText:p,parentNode:d,nextSibling:h,setScopeId:g=c,insertStaticContent:v}=e,y=(e,t,n,r=null,o=null,s=null,i=!1,c=null,l=!!t.dynamicChildren)=>{if(e===t)return;e&&!Ds(e,t)&&(r=Y(e),W(e,o,s,!0),e=null),-2===t.patchFlag&&(l=!1,t.dynamicChildren=null);const{type:u,ref:a,shapeFlag:f}=t;switch(u){case Ts:_(e,t,n,r);break;case Ns:b(e,t,n,r);break;case Rs:null==e&&S(t,n,r,i);break;case Es:O(e,t,n,r,o,s,i,c,l);break;default:1&f?C(e,t,n,r,o,s,i,c,l):6&f?P(e,t,n,r,o,s,i,c,l):(64&f||128&f)&&u.process(e,t,n,r,o,s,i,c,l,X)}null!=a&&o&&us(a,e&&e.ref,s,t||e,!t)},_=(e,t,r,o)=>{if(null==e)n(t.el=u(t.children),r,o);else{const n=t.el=e.el;t.children!==e.children&&f(n,t.children)}},b=(e,t,r,o)=>{null==e?n(t.el=a(t.children||""),r,o):t.el=e.el},S=(e,t,n,r)=>{[e.el,e.anchor]=v(e.children,t,n,r,e.el,e.anchor)},x=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=h(e),r(e),e=n;r(t)},C=(e,t,n,r,o,s,i,c,l)=>{i=i||"svg"===t.type,null==e?w(t,n,r,o,s,i,c,l):T(e,t,o,s,i,c,l)},w=(e,t,r,s,i,c,u,a)=>{let f,d;const{type:h,props:m,shapeFlag:g,transition:v,dirs:y}=e;if(f=e.el=l(e.type,c,m&&m.is,m),8&g?p(f,e.children):16&g&&E(e.children,f,null,s,i,c&&"foreignObject"!==h,u,a),y&&dr(e,null,s,"created"),k(f,e,e.scopeId,u,s),m){for(const t in m)"value"===t||M(t)||o(f,t,null,m[t],c,e.children,s,i,J);"value"in m&&o(f,"value",null,m.value),(d=m.onVnodeBeforeMount)&&oi(d,s,e)}y&&dr(e,null,s,"beforeMount");const _=(!i||i&&!i.pendingBranch)&&v&&!v.persisted;_&&v.beforeEnter(f),n(f,t,r),((d=m&&m.onVnodeMounted)||_||y)&&hs((()=>{d&&oi(d,s,e),_&&v.enter(f),y&&dr(e,null,s,"mounted")}),i)},k=(e,t,n,r,o)=>{if(n&&g(e,n),r)for(let t=0;t{for(let u=l;u{const u=t.el=e.el;let{patchFlag:a,dynamicChildren:f,dirs:d}=t;a|=16&e.patchFlag;const h=e.props||s,m=t.props||s;let g;n&&ys(n,!1),(g=m.onVnodeBeforeUpdate)&&oi(g,n,t,e),d&&dr(t,e,n,"beforeUpdate"),n&&ys(n,!0);const v=i&&"foreignObject"!==t.type;if(f?N(e.dynamicChildren,f,u,n,r,v,c):l||B(e,t,u,null,n,r,v,c,!1),a>0){if(16&a)R(u,t,h,m,n,r,i);else if(2&a&&h.class!==m.class&&o(u,"class",null,m.class,i),4&a&&o(u,"style",h.style,m.style,i),8&a){const s=t.dynamicProps;for(let t=0;t{g&&oi(g,n,t,e),d&&dr(t,e,n,"updated")}),r)},N=(e,t,n,r,o,s,i)=>{for(let c=0;c{if(n!==r){if(n!==s)for(const s in n)M(s)||s in r||o(e,s,n[s],null,l,t.children,i,c,J);for(const s in r){if(M(s))continue;const u=r[s],a=n[s];u!==a&&"value"!==s&&o(e,s,a,u,l,t.children,i,c,J)}"value"in r&&o(e,"value",n.value,r.value)}},O=(e,t,r,o,s,i,c,l,a)=>{const f=t.el=e?e.el:u(""),p=t.anchor=e?e.anchor:u("");let{patchFlag:d,dynamicChildren:h,slotScopeIds:m}=t;m&&(l=l?l.concat(m):m),null==e?(n(f,r,o),n(p,r,o),E(t.children,r,p,s,i,c,l,a)):d>0&&64&d&&h&&e.dynamicChildren?(N(e.dynamicChildren,h,r,s,i,c,l),(null!=t.key||s&&t===s.subTree)&&_s(e,t,!0)):B(e,t,r,p,s,i,c,l,a)},P=(e,t,n,r,o,s,i,c,l)=>{t.slotScopeIds=c,null==e?512&t.shapeFlag?o.ctx.activate(t,n,r,i,l):A(t,n,r,o,s,i,l):$(e,t,l)},A=(e,t,n,r,o,s,i)=>{const c=e.component=ci(e,r,o);if(Nr(e)&&(c.ctx.renderer=X),_i(c),c.asyncDep){if(o&&o.registerDep(c,V),!e.el){const e=c.subTree=Gs(Ns);b(null,e,t,n)}}else V(c,e,t,n,o,s,i)},$=(e,t,n)=>{const r=t.component=e.component;if(function(e,t,n){const{props:r,children:o,component:s}=e,{props:i,children:c,patchFlag:l}=t,u=s.emitsOptions;if(t.dirs||t.transition)return!0;if(!(n&&l>=0))return!(!o&&!c||c&&c.$stable)||r!==i&&(r?!i||qn(r,i,u):!!i);if(1024&l)return!0;if(16&l)return r?qn(r,i,u):!!i;if(8&l){const e=t.dynamicProps;for(let t=0;tmn&&hn.splice(t,1)}(r.update),r.update()}else t.el=e.el,r.vnode=t},V=(e,t,n,r,o,s,i)=>{const c=e.effect=new Te((()=>{if(e.isMounted){let t,{next:n,bu:r,u:c,parent:l,vnode:u}=e,a=n;0,ys(e,!1),n?(n.el=u.el,L(e,n,i)):n=u,r&&j(r),(t=n.props&&n.props.onVnodeBeforeUpdate)&&oi(t,l,n,u),ys(e,!0);const f=Wn(e);0;const p=e.subTree;e.subTree=f,y(p,f,d(p.el),Y(p),e,o,s),n.el=f.el,null===a&&Jn(e,f.el),c&&hs(c,o),(t=n.props&&n.props.onVnodeUpdated)&&hs((()=>oi(t,l,n,u)),o)}else{let i;const{el:c,props:l}=t,{bm:u,m:a,parent:f}=e,p=kr(t);if(ys(e,!1),u&&j(u),!p&&(i=l&&l.onVnodeBeforeMount)&&oi(i,f,t),ys(e,!0),c&&ee){const n=()=>{e.subTree=Wn(e),ee(c,e.subTree,e,o,null)};p?t.type.__asyncLoader().then((()=>!e.isUnmounted&&n())):n()}else{0;const i=e.subTree=Wn(e);0,y(null,i,n,r,e,o,s),t.el=i.el}if(a&&hs(a,o),!p&&(i=l&&l.onVnodeMounted)){const e=t;hs((()=>oi(i,f,e)),o)}(256&t.shapeFlag||f&&kr(f.vnode)&&256&f.vnode.shapeFlag)&&e.a&&hs(e.a,o),e.isMounted=!0,t=n=r=null}}),(()=>xn(l)),e.scope),l=e.update=()=>c.run();l.id=e.uid,ys(e,!0),l()},L=(e,t,n)=>{t.component=e;const r=e.vnode.props;e.vnode=t,e.next=null,function(e,t,n,r){const{props:o,attrs:s,vnode:{patchFlag:i}}=e,c=Ft(o),[l]=e.propsOptions;let u=!1;if(!(r||i>0)||16&i){let r;Jo(e,t,o,s)&&(u=!0);for(const s in c)t&&(m(t,s)||(r=F(s))!==s&&m(t,r))||(l?!n||void 0===n[s]&&void 0===n[r]||(o[s]=Yo(l,c,s,void 0,e,!0)):delete o[s]);if(s!==c)for(const e in s)t&&m(t,e)||(delete s[e],u=!0)}else if(8&i){const n=e.vnode.dynamicProps;for(let r=0;r{const u=e&&e.children,a=e?e.shapeFlag:0,f=t.children,{patchFlag:d,shapeFlag:h}=t;if(d>0){if(128&d)return void U(u,f,n,r,o,s,i,c,l);if(256&d)return void D(u,f,n,r,o,s,i,c,l)}8&h?(16&a&&J(u,o,s),f!==u&&p(n,f)):16&a?16&h?U(u,f,n,r,o,s,i,c,l):J(u,o,s,!0):(8&a&&p(n,""),16&h&&E(f,n,r,o,s,i,c,l))},D=(e,t,n,r,o,s,c,l,u)=>{t=t||i;const a=(e=e||i).length,f=t.length,p=Math.min(a,f);let d;for(d=0;df?J(e,o,s,!0,!1,p):E(t,n,r,o,s,c,l,u,p)},U=(e,t,n,r,o,s,c,l,u)=>{let a=0;const f=t.length;let p=e.length-1,d=f-1;for(;a<=p&&a<=d;){const r=e[a],i=t[a]=u?ti(t[a]):ei(t[a]);if(!Ds(r,i))break;y(r,i,n,null,o,s,c,l,u),a++}for(;a<=p&&a<=d;){const r=e[p],i=t[d]=u?ti(t[d]):ei(t[d]);if(!Ds(r,i))break;y(r,i,n,null,o,s,c,l,u),p--,d--}if(a>p){if(a<=d){const e=d+1,i=ed)for(;a<=p;)W(e[a],o,s,!0),a++;else{const h=a,m=a,g=new Map;for(a=m;a<=d;a++){const e=t[a]=u?ti(t[a]):ei(t[a]);null!=e.key&&g.set(e.key,a)}let v,_=0;const b=d-m+1;let S=!1,x=0;const C=new Array(b);for(a=0;a=b){W(r,o,s,!0);continue}let i;if(null!=r.key)i=g.get(r.key);else for(v=m;v<=d;v++)if(0===C[v-m]&&Ds(r,t[v])){i=v;break}void 0===i?W(r,o,s,!0):(C[i-m]=a+1,i>=x?x=i:S=!0,y(r,t[i],n,null,o,s,c,l,u),_++)}const w=S?function(e){const t=e.slice(),n=[0];let r,o,s,i,c;const l=e.length;for(r=0;r>1,e[n[c]]0&&(t[r]=n[s-1]),n[s]=r)}}s=n.length,i=n[s-1];for(;s-- >0;)n[s]=i,i=t[i];return n}(C):i;for(v=w.length-1,a=b-1;a>=0;a--){const e=m+a,i=t[e],p=e+1{const{el:i,type:c,transition:l,children:u,shapeFlag:a}=e;if(6&a)return void H(e.component.subTree,t,r,o);if(128&a)return void e.suspense.move(t,r,o);if(64&a)return void c.move(e,t,r,X);if(c===Es){n(i,t,r);for(let e=0;e{let s;for(;e&&e!==t;)s=h(e),n(e,r,o),e=s;n(t,r,o)})(e,t,r);if(2!==o&&1&a&&l)if(0===o)l.beforeEnter(i),n(i,t,r),hs((()=>l.enter(i)),s);else{const{leave:e,delayLeave:o,afterLeave:s}=l,c=()=>n(i,t,r),u=()=>{e(i,(()=>{c(),s&&s()}))};o?o(i,c,u):u()}else n(i,t,r)},W=(e,t,n,r=!1,o=!1)=>{const{type:s,props:i,ref:c,children:l,dynamicChildren:u,shapeFlag:a,patchFlag:f,dirs:p}=e;if(null!=c&&us(c,null,n,e,!0),256&a)return void t.ctx.deactivate(e);const d=1&a&&p,h=!kr(e);let m;if(h&&(m=i&&i.onVnodeBeforeUnmount)&&oi(m,t,e),6&a)q(e.component,n,r);else{if(128&a)return void e.suspense.unmount(n,r);d&&dr(e,null,t,"beforeUnmount"),64&a?e.type.remove(e,t,n,o,X,r):u&&(s!==Es||f>0&&64&f)?J(u,t,n,!1,!0):(s===Es&&384&f||!o&&16&a)&&J(l,t,n),r&&K(e)}(h&&(m=i&&i.onVnodeUnmounted)||d)&&hs((()=>{m&&oi(m,t,e),d&&dr(e,null,t,"unmounted")}),n)},K=e=>{const{type:t,el:n,anchor:o,transition:s}=e;if(t===Es)return void G(n,o);if(t===Rs)return void x(e);const i=()=>{r(n),s&&!s.persisted&&s.afterLeave&&s.afterLeave()};if(1&e.shapeFlag&&s&&!s.persisted){const{leave:t,delayLeave:r}=s,o=()=>t(n,i);r?r(e.el,i,o):o()}else i()},G=(e,t)=>{let n;for(;e!==t;)n=h(e),r(e),e=n;r(t)},q=(e,t,n)=>{const{bum:r,scope:o,update:s,subTree:i,um:c}=e;r&&j(r),o.stop(),s&&(s.active=!1,W(i,e,t,n)),c&&hs(c,t),hs((()=>{e.isUnmounted=!0}),t),t&&t.pendingBranch&&!t.isUnmounted&&e.asyncDep&&!e.asyncResolved&&e.suspenseId===t.pendingId&&(t.deps--,0===t.deps&&t.resolve())},J=(e,t,n,r=!1,o=!1,s=0)=>{for(let i=s;i6&e.shapeFlag?Y(e.component.subTree):128&e.shapeFlag?e.suspense.next():h(e.anchor||e.el),Z=(e,t,n)=>{null==e?t._vnode&&W(t._vnode,null,null,!0):y(t._vnode||null,e,t,null,null,null,n),kn(),En(),t._vnode=e},X={p:y,um:W,m:H,r:K,mt:A,mc:E,pc:B,pbc:N,n:Y,o:e};let Q,ee;return t&&([Q,ee]=t(X)),{render:Z,hydrate:Q,createApp:Wo(Z,Q)}}function ys({effect:e,update:t},n){e.allowRecurse=t.allowRecurse=n}function _s(e,t,n=!1){const r=e.children,o=t.children;if(g(r)&&g(o))for(let e=0;ee&&(e.disabled||""===e.disabled),Ss=e=>"undefined"!=typeof SVGElement&&e instanceof SVGElement,xs=(e,t)=>{const n=e&&e.to;if(S(n)){if(t){const e=t(n);return e}return null}return n};function Cs(e,t,n,{o:{insert:r},m:o},s=2){0===s&&r(e.targetAnchor,t,n);const{el:i,anchor:c,shapeFlag:l,children:u,props:a}=e,f=2===s;if(f&&r(i,t,n),(!f||bs(a))&&16&l)for(let e=0;e{16&y&&a(_,e,t,o,s,i,c,l)};v?g(n,u):f&&g(f,p)}else{t.el=e.el;const r=t.anchor=e.anchor,a=t.target=e.target,d=t.targetAnchor=e.targetAnchor,m=bs(e.props),g=m?n:a,y=m?r:d;if(i=i||Ss(a),b?(p(e.dynamicChildren,b,g,o,s,i,c),_s(e,t,!0)):l||f(e,t,g,y,o,s,i,c,!1),v)m||Cs(t,n,r,u,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const e=t.target=xs(t.props,h);e&&Cs(t,e,null,u,0)}else m&&Cs(t,a,d,u,1)}ks(t)},remove(e,t,n,r,{um:o,o:{remove:s}},i){const{shapeFlag:c,children:l,anchor:u,targetAnchor:a,target:f,props:p}=e;if(f&&s(a),(i||!bs(p))&&(s(u),16&c))for(let e=0;e0?Os||i:null,As(),$s>0&&Os&&Os.push(e),e}function Ls(e,t,n,r,o,s){return Vs(Ks(e,t,n,r,o,s,!0))}function Bs(e,t,n,r,o){return Vs(Gs(e,t,n,r,o,!0))}function js(e){return!!e&&!0===e.__v_isVNode}function Ds(e,t){return e.type===t.type&&e.key===t.key}function Us(e){Is=e}const Hs="__vInternal",Ws=({key:e})=>null!=e?e:null,zs=({ref:e,ref_key:t,ref_for:n})=>("number"==typeof e&&(e=""+e),null!=e?S(e)||Ut(e)||b(e)?{i:Vn,r:e,k:t,f:!!n}:e:null);function Ks(e,t=null,n=null,r=0,o=null,s=(e===Es?0:1),i=!1,c=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Ws(t),ref:t&&zs(t),scopeId:Ln,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:r,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:Vn};return c?(ni(l,n),128&s&&e.normalize(l)):n&&(l.shapeFlag|=S(n)?8:16),$s>0&&!i&&Os&&(l.patchFlag>0||6&s)&&32!==l.patchFlag&&Os.push(l),l}const Gs=qs;function qs(e,t=null,n=null,r=0,o=null,s=!1){if(e&&e!==Xr||(e=Ns),js(e)){const r=Ys(e,t,!0);return n&&ni(r,n),$s>0&&!s&&Os&&(6&r.shapeFlag?Os[Os.indexOf(e)]=r:Os.push(r)),r.patchFlag|=-2,r}if(Ti(e)&&(e=e.__vccOpts),t){t=Js(t);let{class:e,style:n}=t;e&&!S(e)&&(t.class=Q(e)),C(n)&&($t(n)&&!g(n)&&(n=p({},n)),t.style=q(n))}return Ks(e,t,n,r,o,S(e)?1:Yn(e)?128:(e=>e.__isTeleport)(e)?64:C(e)?4:b(e)?2:0,s,!0)}function Js(e){return e?$t(e)||Hs in e?p({},e):e:null}function Ys(e,t,n=!1){const{props:r,ref:o,patchFlag:s,children:i}=e,c=t?ri(r||{},t):r;return{__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&Ws(c),ref:t&&t.ref?n&&o?g(o)?o.concat(zs(t)):[o,zs(t)]:zs(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:i,target:e.target,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Es?-1===s?16:16|s:s,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:e.transition,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Ys(e.ssContent),ssFallback:e.ssFallback&&Ys(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce}}function Zs(e=" ",t=0){return Gs(Ts,null,e,t)}function Xs(e,t){const n=Gs(Rs,null,e);return n.staticCount=t,n}function Qs(e="",t=!1){return t?(Ps(),Bs(Ns,null,e)):Gs(Ns,null,e)}function ei(e){return null==e||"boolean"==typeof e?Gs(Ns):g(e)?Gs(Es,null,e.slice()):"object"==typeof e?ti(e):Gs(Ts,null,String(e))}function ti(e){return null===e.el&&-1!==e.patchFlag||e.memo?e:Ys(e)}function ni(e,t){let n=0;const{shapeFlag:r}=e;if(null==t)t=null;else if(g(t))n=16;else if("object"==typeof t){if(65&r){const n=t.default;return void(n&&(n._c&&(n._d=!1),ni(e,n()),n._c&&(n._d=!0)))}{n=32;const r=t._;r||Hs in t?3===r&&Vn&&(1===Vn.slots._?t._=1:(t._=2,e.patchFlag|=1024)):t._ctx=Vn}}else b(t)?(t={default:t,_ctx:Vn},n=32):(t=String(t),64&r?(n=16,t=[Zs(t)]):n=8);e.children=t,e.shapeFlag|=n}function ri(...e){const t={};for(let n=0;nli||Vn;let ai,fi,pi="__VUE_INSTANCE_SETTERS__";(fi=z()[pi])||(fi=z()[pi]=[]),fi.push((e=>li=e)),ai=e=>{fi.length>1?fi.forEach((t=>t(e))):fi[0](e)};const di=e=>{ai(e),e.scope.on()},hi=()=>{li&&li.scope.off(),ai(null)};function mi(e){return 4&e.vnode.shapeFlag}let gi,vi,yi=!1;function _i(e,t=!1){yi=t;const{props:n,children:r}=e.vnode,o=mi(e);!function(e,t,n,r=!1){const o={},s={};D(s,Hs,1),e.propsDefaults=Object.create(null),Jo(e,t,o,s);for(const t in e.propsOptions[0])t in o||(o[t]=void 0);n?e.props=r?o:Nt(o):e.type.props?e.props=o:e.props=s,e.attrs=s}(e,n,o,t),cs(e,r);const s=o?function(e,t){const n=e.type;0;e.accessCache=Object.create(null),e.proxy=Vt(new Proxy(e.ctx,fo)),!1;const{setup:r}=n;if(r){const n=e.setupContext=r.length>1?wi(e):null;di(e),Ae();const o=un(r,e,0,[e.props,n]);if(Ie(),hi(),w(o)){if(o.then(hi,hi),t)return o.then((n=>{bi(e,n,t)})).catch((t=>{fn(t,e,0)}));e.asyncDep=o}else bi(e,o,t)}else Ci(e,t)}(e,t):void 0;return yi=!1,s}function bi(e,t,n){b(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:C(t)&&(e.setupState=Zt(t)),Ci(e,n)}function Si(e){gi=e,vi=e=>{e.render._rc&&(e.withProxy=new Proxy(e.ctx,po))}}const xi=()=>!gi;function Ci(e,t,n){const r=e.type;if(!e.render){if(!t&&gi&&!r.render){const t=r.template||Io(e).template;if(t){0;const{isCustomElement:n,compilerOptions:o}=e.appContext.config,{delimiters:s,compilerOptions:i}=r,c=p(p({isCustomElement:n,delimiters:s},o),i);r.render=gi(t,c)}}e.render=r.render||c,vi&&vi(e)}di(e),Ae(),Oo(e),Ie(),hi()}function wi(e){const t=t=>{e.exposed=t||{}};return{get attrs(){return function(e){return e.attrsProxy||(e.attrsProxy=new Proxy(e.attrs,{get(t,n){return $e(e,0,"$attrs"),t[n]}}))}(e)},slots:e.slots,emit:e.emit,expose:t}}function ki(e){if(e.exposed)return e.exposeProxy||(e.exposeProxy=new Proxy(Zt(Vt(e.exposed)),{get(t,n){return n in t?t[n]:n in uo?uo[n](e):void 0},has(e,t){return t in e||t in uo}}))}function Ei(e,t=!0){return b(e)?e.displayName||e.name:e.name||t&&e.__name}function Ti(e){return b(e)&&"__vccOpts"in e}const Ni=(e,t)=>function(e,t,n=!1){let r,o;const s=b(e);return s?(r=e,o=c):(r=e.get,o=e.set),new sn(r,o,s||!o,n)}(e,0,yi);function Ri(e,t,n){const r=arguments.length;return 2===r?C(t)&&!g(t)?js(t)?Gs(e,null,[t]):Gs(e,t):Gs(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):3===r&&js(n)&&(n=[n]),Gs(e,t,n))}const Mi=Symbol.for("v-scx"),Oi=()=>{{const e=Go(Mi);return e}};function Pi(){return void 0}function Ai(e,t,n,r){const o=n[r];if(o&&Ii(o,e))return o;const s=t();return s.memo=e.slice(),n[r]=s}function Ii(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let e=0;e0&&Os&&Os.push(e),!0}const $i="3.3.4",Fi={createComponentInstance:ci,setupComponent:_i,renderComponentRoot:Wn,setCurrentRenderingInstance:Bn,isVNode:js,normalizeVNode:ei},Vi=null,Li=null,Bi="undefined"!=typeof document?document:null,ji=Bi&&Bi.createElement("template"),Di={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const o=t?Bi.createElementNS("http://www.w3.org/2000/svg",e):Bi.createElement(e,n?{is:n}:void 0);return"select"===e&&r&&null!=r.multiple&&o.setAttribute("multiple",r.multiple),o},createText:e=>Bi.createTextNode(e),createComment:e=>Bi.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Bi.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,o,s){const i=n?n.previousSibling:t.lastChild;if(o&&(o===s||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),o!==s&&(o=o.nextSibling););else{ji.innerHTML=r?`${e}`:e;const o=ji.content;if(r){const e=o.firstChild;for(;e.firstChild;)o.appendChild(e.firstChild);o.removeChild(e)}t.insertBefore(o,n)}return[i?i.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}};const Ui=/\s*!important$/;function Hi(e,t,n){if(g(n))n.forEach((n=>Hi(e,t,n)));else if(null==n&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=function(e,t){const n=zi[t];if(n)return n;let r=I(t);if("filter"!==r&&r in e)return zi[t]=r;r=V(r);for(let n=0;n{if(e._vts){if(e._vts<=n.attached)return}else e._vts=Date.now();an(function(e,t){if(g(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map((e=>t=>!t._stopped&&e&&e(t)))}return t}(e,n.value),t,5,[e])};return n.value=e,n.attached=Xi(),n}(r,o);Gi(e,n,i,c)}else i&&(!function(e,t,n,r){e.removeEventListener(t,n,r)}(e,n,i,c),s[t]=void 0)}}const Ji=/(?:Once|Passive|Capture)$/;let Yi=0;const Zi=Promise.resolve(),Xi=()=>Yi||(Zi.then((()=>Yi=0)),Yi=Date.now());const Qi=/^on[a-z]/;function ec(e,t){const n=wr(e);class r extends rc{constructor(e){super(n,e,t)}}return r.def=n,r}const tc=e=>ec(e,il),nc="undefined"!=typeof HTMLElement?HTMLElement:class{};class rc extends nc{constructor(e,t={},n){super(),this._def=e,this._props=t,this._instance=null,this._connected=!1,this._resolved=!1,this._numberProps=null,this.shadowRoot&&n?n(this._createVNode(),this.shadowRoot):(this.attachShadow({mode:"open"}),this._def.__asyncLoader||this._resolveProps(this._def))}connectedCallback(){this._connected=!0,this._instance||(this._resolved?this._update():this._resolveDef())}disconnectedCallback(){this._connected=!1,Sn((()=>{this._connected||(sl(null,this.shadowRoot),this._instance=null)}))}_resolveDef(){this._resolved=!0;for(let e=0;e{for(const t of e)this._setAttr(t.attributeName)})).observe(this,{attributes:!0});const e=(e,t=!1)=>{const{props:n,styles:r}=e;let o;if(n&&!g(n))for(const e in n){const t=n[e];(t===Number||t&&t.type===Number)&&(e in this._props&&(this._props[e]=H(this._props[e])),(o||(o=Object.create(null)))[I(e)]=!0)}this._numberProps=o,t&&this._resolveProps(e),this._applyStyles(r),this._update()},t=this._def.__asyncLoader;t?t().then((t=>e(t,!0))):e(this._def)}_resolveProps(e){const{props:t}=e,n=g(t)?t:Object.keys(t||{});for(const e of Object.keys(this))"_"!==e[0]&&n.includes(e)&&this._setProp(e,this[e],!0,!1);for(const e of n.map(I))Object.defineProperty(this,e,{get(){return this._getProp(e)},set(t){this._setProp(e,t)}})}_setAttr(e){let t=this.getAttribute(e);const n=I(e);this._numberProps&&this._numberProps[n]&&(t=H(t)),this._setProp(n,t,!1)}_getProp(e){return this._props[e]}_setProp(e,t,n=!0,r=!0){t!==this._props[e]&&(this._props[e]=t,r&&this._instance&&this._update(),n&&(!0===t?this.setAttribute(F(e),""):"string"==typeof t||"number"==typeof t?this.setAttribute(F(e),t+""):t||this.removeAttribute(F(e))))}_update(){sl(this._createVNode(),this.shadowRoot)}_createVNode(){const e=Gs(this._def,p({},this._props));return this._instance||(e.ce=e=>{this._instance=e,e.isCE=!0;const t=(e,t)=>{this.dispatchEvent(new CustomEvent(e,{detail:t}))};e.emit=(e,...n)=>{t(e,n),F(e)!==e&&t(F(e),n)};let n=this;for(;n=n&&(n.parentNode||n.host);)if(n instanceof rc){e.parent=n._instance,e.provides=n._instance.provides;break}}),e}_applyStyles(e){e&&e.forEach((e=>{const t=document.createElement("style");t.textContent=e,this.shadowRoot.appendChild(t)}))}}function oc(e="$style"){{const t=ui();if(!t)return s;const n=t.type.__cssModules;if(!n)return s;const r=n[e];return r||s}}function sc(e){const t=ui();if(!t)return;const n=t.ut=(n=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach((e=>cc(e,n)))},r=()=>{const r=e(t.proxy);ic(t.subTree,r),n(r)};or(r),jr((()=>{const e=new MutationObserver(r);e.observe(t.subTree.el.parentNode,{childList:!0}),Wr((()=>e.disconnect()))}))}function ic(e,t){if(128&e.shapeFlag){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push((()=>{ic(n.activeBranch,t)}))}for(;e.component;)e=e.component.subTree;if(1&e.shapeFlag&&e.el)cc(e.el,t);else if(e.type===Es)e.children.forEach((e=>ic(e,t)));else if(e.type===Rs){let{el:n,anchor:r}=e;for(;n&&(cc(n,t),n!==r);)n=n.nextSibling}}function cc(e,t){if(1===e.nodeType){const n=e.style;for(const e in t)n.setProperty(`--${e}`,t[e])}}const lc="transition",uc="animation",ac=(e,{slots:t})=>Ri(vr,mc(e),t);ac.displayName="Transition";const fc={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},pc=ac.props=p({},gr,fc),dc=(e,t=[])=>{g(e)?e.forEach((e=>e(...t))):e&&e(...t)},hc=e=>!!e&&(g(e)?e.some((e=>e.length>1)):e.length>1);function mc(e){const t={};for(const n in e)n in fc||(t[n]=e[n]);if(!1===e.css)return t;const{name:n="v",type:r,duration:o,enterFromClass:s=`${n}-enter-from`,enterActiveClass:i=`${n}-enter-active`,enterToClass:c=`${n}-enter-to`,appearFromClass:l=s,appearActiveClass:u=i,appearToClass:a=c,leaveFromClass:f=`${n}-leave-from`,leaveActiveClass:d=`${n}-leave-active`,leaveToClass:h=`${n}-leave-to`}=e,m=function(e){if(null==e)return null;if(C(e))return[gc(e.enter),gc(e.leave)];{const t=gc(e);return[t,t]}}(o),g=m&&m[0],v=m&&m[1],{onBeforeEnter:y,onEnter:_,onEnterCancelled:b,onLeave:S,onLeaveCancelled:x,onBeforeAppear:w=y,onAppear:k=_,onAppearCancelled:E=b}=t,T=(e,t,n)=>{yc(e,t?a:c),yc(e,t?u:i),n&&n()},N=(e,t)=>{e._isLeaving=!1,yc(e,f),yc(e,h),yc(e,d),t&&t()},R=e=>(t,n)=>{const o=e?k:_,i=()=>T(t,e,n);dc(o,[t,i]),_c((()=>{yc(t,e?l:s),vc(t,e?a:c),hc(o)||Sc(t,r,g,i)}))};return p(t,{onBeforeEnter(e){dc(y,[e]),vc(e,s),vc(e,i)},onBeforeAppear(e){dc(w,[e]),vc(e,l),vc(e,u)},onEnter:R(!1),onAppear:R(!0),onLeave(e,t){e._isLeaving=!0;const n=()=>N(e,t);vc(e,f),kc(),vc(e,d),_c((()=>{e._isLeaving&&(yc(e,f),vc(e,h),hc(S)||Sc(e,r,v,n))})),dc(S,[e,n])},onEnterCancelled(e){T(e,!1),dc(b,[e])},onAppearCancelled(e){T(e,!0),dc(E,[e])},onLeaveCancelled(e){N(e),dc(x,[e])}})}function gc(e){return H(e)}function vc(e,t){t.split(/\s+/).forEach((t=>t&&e.classList.add(t))),(e._vtc||(e._vtc=new Set)).add(t)}function yc(e,t){t.split(/\s+/).forEach((t=>t&&e.classList.remove(t)));const{_vtc:n}=e;n&&(n.delete(t),n.size||(e._vtc=void 0))}function _c(e){requestAnimationFrame((()=>{requestAnimationFrame(e)}))}let bc=0;function Sc(e,t,n,r){const o=e._endId=++bc,s=()=>{o===e._endId&&r()};if(n)return setTimeout(s,n);const{type:i,timeout:c,propCount:l}=xc(e,t);if(!i)return r();const u=i+"end";let a=0;const f=()=>{e.removeEventListener(u,p),s()},p=t=>{t.target===e&&++a>=l&&f()};setTimeout((()=>{a(n[e]||"").split(", "),o=r(`${lc}Delay`),s=r(`${lc}Duration`),i=Cc(o,s),c=r(`${uc}Delay`),l=r(`${uc}Duration`),u=Cc(c,l);let a=null,f=0,p=0;t===lc?i>0&&(a=lc,f=i,p=s.length):t===uc?u>0&&(a=uc,f=u,p=l.length):(f=Math.max(i,u),a=f>0?i>u?lc:uc:null,p=a?a===lc?s.length:l.length:0);return{type:a,timeout:f,propCount:p,hasTransform:a===lc&&/\b(transform|all)(,|$)/.test(r(`${lc}Property`).toString())}}function Cc(e,t){for(;e.lengthwc(t)+wc(e[n]))))}function wc(e){return 1e3*Number(e.slice(0,-1).replace(",","."))}function kc(){return document.body.offsetHeight}const Ec=new WeakMap,Tc=new WeakMap,Nc={name:"TransitionGroup",props:p({},pc,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=ui(),r=hr();let o,s;return Ur((()=>{if(!o.length)return;const t=e.moveClass||`${e.name||"v"}-move`;if(!function(e,t,n){const r=e.cloneNode();e._vtc&&e._vtc.forEach((e=>{e.split(/\s+/).forEach((e=>e&&r.classList.remove(e)))}));n.split(/\s+/).forEach((e=>e&&r.classList.add(e))),r.style.display="none";const o=1===t.nodeType?t:t.parentNode;o.appendChild(r);const{hasTransform:s}=xc(r);return o.removeChild(r),s}(o[0].el,n.vnode.el,t))return;o.forEach(Mc),o.forEach(Oc);const r=o.filter(Pc);kc(),r.forEach((e=>{const n=e.el,r=n.style;vc(n,t),r.transform=r.webkitTransform=r.transitionDuration="";const o=n._moveCb=e=>{e&&e.target!==n||e&&!/transform$/.test(e.propertyName)||(n.removeEventListener("transitionend",o),n._moveCb=null,yc(n,t))};n.addEventListener("transitionend",o)}))})),()=>{const i=Ft(e),c=mc(i);let l=i.tag||Es;o=s,s=t.default?Cr(t.default()):[];for(let e=0;e{const t=e.props["onUpdate:modelValue"]||!1;return g(t)?e=>j(t,e):t};function Ic(e){e.target.composing=!0}function $c(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Fc={created(e,{modifiers:{lazy:t,trim:n,number:r}},o){e._assign=Ac(o);const s=r||o.props&&"number"===o.props.type;Gi(e,t?"change":"input",(t=>{if(t.target.composing)return;let r=e.value;n&&(r=r.trim()),s&&(r=U(r)),e._assign(r)})),n&&Gi(e,"change",(()=>{e.value=e.value.trim()})),t||(Gi(e,"compositionstart",Ic),Gi(e,"compositionend",$c),Gi(e,"change",$c))},mounted(e,{value:t}){e.value=null==t?"":t},beforeUpdate(e,{value:t,modifiers:{lazy:n,trim:r,number:o}},s){if(e._assign=Ac(s),e.composing)return;if(document.activeElement===e&&"range"!==e.type){if(n)return;if(r&&e.value.trim()===t)return;if((o||"number"===e.type)&&U(e.value)===t)return}const i=null==t?"":t;e.value!==i&&(e.value=i)}},Vc={deep:!0,created(e,t,n){e._assign=Ac(n),Gi(e,"change",(()=>{const t=e._modelValue,n=Uc(e),r=e.checked,o=e._assign;if(g(t)){const e=le(t,n),s=-1!==e;if(r&&!s)o(t.concat(n));else if(!r&&s){const n=[...t];n.splice(e,1),o(n)}}else if(y(t)){const e=new Set(t);r?e.add(n):e.delete(n),o(e)}else o(Hc(e,r))}))},mounted:Lc,beforeUpdate(e,t,n){e._assign=Ac(n),Lc(e,t,n)}};function Lc(e,{value:t,oldValue:n},r){e._modelValue=t,g(t)?e.checked=le(t,r.props.value)>-1:y(t)?e.checked=t.has(r.props.value):t!==n&&(e.checked=ce(t,Hc(e,!0)))}const Bc={created(e,{value:t},n){e.checked=ce(t,n.props.value),e._assign=Ac(n),Gi(e,"change",(()=>{e._assign(Uc(e))}))},beforeUpdate(e,{value:t,oldValue:n},r){e._assign=Ac(r),t!==n&&(e.checked=ce(t,r.props.value))}},jc={deep:!0,created(e,{value:t,modifiers:{number:n}},r){const o=y(t);Gi(e,"change",(()=>{const t=Array.prototype.filter.call(e.options,(e=>e.selected)).map((e=>n?U(Uc(e)):Uc(e)));e._assign(e.multiple?o?new Set(t):t:t[0])})),e._assign=Ac(r)},mounted(e,{value:t}){Dc(e,t)},beforeUpdate(e,t,n){e._assign=Ac(n)},updated(e,{value:t}){Dc(e,t)}};function Dc(e,t){const n=e.multiple;if(!n||g(t)||y(t)){for(let r=0,o=e.options.length;r-1:o.selected=t.has(s);else if(ce(Uc(o),t))return void(e.selectedIndex!==r&&(e.selectedIndex=r))}n||-1===e.selectedIndex||(e.selectedIndex=-1)}}function Uc(e){return"_value"in e?e._value:e.value}function Hc(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const Wc={created(e,t,n){Kc(e,t,n,null,"created")},mounted(e,t,n){Kc(e,t,n,null,"mounted")},beforeUpdate(e,t,n,r){Kc(e,t,n,r,"beforeUpdate")},updated(e,t,n,r){Kc(e,t,n,r,"updated")}};function zc(e,t){switch(e){case"SELECT":return jc;case"TEXTAREA":return Fc;default:switch(t){case"checkbox":return Vc;case"radio":return Bc;default:return Fc}}}function Kc(e,t,n,r,o){const s=zc(e.tagName,n.props&&n.props.type)[o];s&&s(e,t,n,r)}const Gc=["ctrl","shift","alt","meta"],qc={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&0!==e.button,middle:e=>"button"in e&&1!==e.button,right:e=>"button"in e&&2!==e.button,exact:(e,t)=>Gc.some((n=>e[`${n}Key`]&&!t.includes(n)))},Jc=(e,t)=>(n,...r)=>{for(let e=0;en=>{if(!("key"in n))return;const r=F(n.key);return t.some((e=>e===r||Yc[e]===r))?e(n):void 0},Xc={beforeMount(e,{value:t},{transition:n}){e._vod="none"===e.style.display?"":e.style.display,n&&t?n.beforeEnter(e):Qc(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:r}){!t!=!n&&(r?t?(r.beforeEnter(e),Qc(e,!0),r.enter(e)):r.leave(e,(()=>{Qc(e,!1)})):Qc(e,t))},beforeUnmount(e,{value:t}){Qc(e,t)}};function Qc(e,t){e.style.display=t?e._vod:"none"}const el=p({patchProp:(e,t,n,r,o=!1,s,i,c,l)=>{"class"===t?function(e,t,n){const r=e._vtc;r&&(t=(t?[t,...r]:[...r]).join(" ")),null==t?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}(e,r,o):"style"===t?function(e,t,n){const r=e.style,o=S(n);if(n&&!o){if(t&&!S(t))for(const e in t)null==n[e]&&Hi(r,e,"");for(const e in n)Hi(r,e,n[e])}else{const s=r.display;o?t!==n&&(r.cssText=n):t&&e.removeAttribute("style"),"_vod"in e&&(r.display=s)}}(e,n,r):a(t)?f(t)||qi(e,t,0,r,i):("."===t[0]?(t=t.slice(1),1):"^"===t[0]?(t=t.slice(1),0):function(e,t,n,r){if(r)return"innerHTML"===t||"textContent"===t||!!(t in e&&Qi.test(t)&&b(n));if("spellcheck"===t||"draggable"===t||"translate"===t)return!1;if("form"===t)return!1;if("list"===t&&"INPUT"===e.tagName)return!1;if("type"===t&&"TEXTAREA"===e.tagName)return!1;if(Qi.test(t)&&S(n))return!1;return t in e}(e,t,r,o))?function(e,t,n,r,o,s,i){if("innerHTML"===t||"textContent"===t)return r&&i(r,o,s),void(e[t]=null==n?"":n);const c=e.tagName;if("value"===t&&"PROGRESS"!==c&&!c.includes("-")){e._value=n;const r=null==n?"":n;return("OPTION"===c?e.getAttribute("value"):e.value)!==r&&(e.value=r),void(null==n&&e.removeAttribute(t))}let l=!1;if(""===n||null==n){const r=typeof e[t];"boolean"===r?n=ie(n):null==n&&"string"===r?(n="",l=!0):"number"===r&&(n=0,l=!0)}try{e[t]=n}catch(e){}l&&e.removeAttribute(t)}(e,t,r,s,i,c,l):("true-value"===t?e._trueValue=r:"false-value"===t&&(e._falseValue=r),function(e,t,n,r,o){if(r&&t.startsWith("xlink:"))null==n?e.removeAttributeNS(Ki,t.slice(6,t.length)):e.setAttributeNS(Ki,t,n);else{const r=se(t);null==n||r&&!ie(n)?e.removeAttribute(t):e.setAttribute(t,r?"":n)}}(e,t,r,o))}},Di);let tl,nl=!1;function rl(){return tl||(tl=ms(el))}function ol(){return tl=nl?tl:gs(el),nl=!0,tl}const sl=(...e)=>{rl().render(...e)},il=(...e)=>{ol().hydrate(...e)},cl=(...e)=>{const t=rl().createApp(...e);const{mount:n}=t;return t.mount=e=>{const r=ul(e);if(!r)return;const o=t._component;b(o)||o.render||o.template||(o.template=r.innerHTML),r.innerHTML="";const s=n(r,!1,r instanceof SVGElement);return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),s},t},ll=(...e)=>{const t=ol().createApp(...e);const{mount:n}=t;return t.mount=e=>{const t=ul(e);if(t)return n(t,!0,t instanceof SVGElement)},t};function ul(e){if(S(e)){return document.querySelector(e)}return e}let al=!1;const fl=()=>{al||(al=!0,Fc.getSSRProps=({value:e})=>({value:e}),Bc.getSSRProps=({value:e},t)=>{if(t.props&&ce(t.props.value,e))return{checked:!0}},Vc.getSSRProps=({value:e},t)=>{if(g(e)){if(t.props&&le(e,t.props.value)>-1)return{checked:!0}}else if(y(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},Wc.getSSRProps=(e,t)=>{if("string"!=typeof t.type)return;const n=zc(t.type.toUpperCase(),t.props&&t.props.type);return n.getSSRProps?n.getSSRProps(e,t):void 0},Xc.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}})};function pl(e){throw e}function dl(e){}function hl(e,t,n,r){const o=new SyntaxError(String(e));return o.code=e,o.loc=t,o}const ml=Symbol(""),gl=Symbol(""),vl=Symbol(""),yl=Symbol(""),_l=Symbol(""),bl=Symbol(""),Sl=Symbol(""),xl=Symbol(""),Cl=Symbol(""),wl=Symbol(""),kl=Symbol(""),El=Symbol(""),Tl=Symbol(""),Nl=Symbol(""),Rl=Symbol(""),Ml=Symbol(""),Ol=Symbol(""),Pl=Symbol(""),Al=Symbol(""),Il=Symbol(""),$l=Symbol(""),Fl=Symbol(""),Vl=Symbol(""),Ll=Symbol(""),Bl=Symbol(""),jl=Symbol(""),Dl=Symbol(""),Ul=Symbol(""),Hl=Symbol(""),Wl=Symbol(""),zl=Symbol(""),Kl=Symbol(""),Gl=Symbol(""),ql=Symbol(""),Jl=Symbol(""),Yl=Symbol(""),Zl=Symbol(""),Xl=Symbol(""),Ql=Symbol(""),eu={[ml]:"Fragment",[gl]:"Teleport",[vl]:"Suspense",[yl]:"KeepAlive",[_l]:"BaseTransition",[bl]:"openBlock",[Sl]:"createBlock",[xl]:"createElementBlock",[Cl]:"createVNode",[wl]:"createElementVNode",[kl]:"createCommentVNode",[El]:"createTextVNode",[Tl]:"createStaticVNode",[Nl]:"resolveComponent",[Rl]:"resolveDynamicComponent",[Ml]:"resolveDirective",[Ol]:"resolveFilter",[Pl]:"withDirectives",[Al]:"renderList",[Il]:"renderSlot",[$l]:"createSlots",[Fl]:"toDisplayString",[Vl]:"mergeProps",[Ll]:"normalizeClass",[Bl]:"normalizeStyle",[jl]:"normalizeProps",[Dl]:"guardReactiveProps",[Ul]:"toHandlers",[Hl]:"camelize",[Wl]:"capitalize",[zl]:"toHandlerKey",[Kl]:"setBlockTracking",[Gl]:"pushScopeId",[ql]:"popScopeId",[Jl]:"withCtx",[Yl]:"unref",[Zl]:"isRef",[Xl]:"withMemo",[Ql]:"isMemoSame"};const tu={source:"",start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0}};function nu(e,t,n,r,o,s,i,c=!1,l=!1,u=!1,a=tu){return e&&(c?(e.helper(bl),e.helper(pu(e.inSSR,u))):e.helper(fu(e.inSSR,u)),i&&e.helper(Pl)),{type:13,tag:t,props:n,children:r,patchFlag:o,dynamicProps:s,directives:i,isBlock:c,disableTracking:l,isComponent:u,loc:a}}function ru(e,t=tu){return{type:17,loc:t,elements:e}}function ou(e,t=tu){return{type:15,loc:t,properties:e}}function su(e,t){return{type:16,loc:tu,key:S(e)?iu(e,!0):e,value:t}}function iu(e,t=!1,n=tu,r=0){return{type:4,loc:n,content:e,isStatic:t,constType:t?3:r}}function cu(e,t=tu){return{type:8,loc:t,children:e}}function lu(e,t=[],n=tu){return{type:14,loc:n,callee:e,arguments:t}}function uu(e,t=void 0,n=!1,r=!1,o=tu){return{type:18,params:e,returns:t,newline:n,isSlot:r,loc:o}}function au(e,t,n,r=!0){return{type:19,test:e,consequent:t,alternate:n,newline:r,loc:tu}}function fu(e,t){return e||t?Cl:wl}function pu(e,t){return e||t?Sl:xl}function du(e,{helper:t,removeHelper:n,inSSR:r}){e.isBlock||(e.isBlock=!0,n(fu(r,e.isComponent)),t(bl),t(pu(r,e.isComponent)))}const hu=e=>4===e.type&&e.isStatic,mu=(e,t)=>e===t||e===F(t);function gu(e){return mu(e,"Teleport")?gl:mu(e,"Suspense")?vl:mu(e,"KeepAlive")?yl:mu(e,"BaseTransition")?_l:void 0}const vu=/^\d|[^\$\w]/,yu=e=>!vu.test(e),_u=/[A-Za-z_$\xA0-\uFFFF]/,bu=/[\.\?\w$\xA0-\uFFFF]/,Su=/\s+[.[]\s*|\s*[.[]\s+/g,xu=e=>{e=e.trim().replace(Su,(e=>e.trim()));let t=0,n=[],r=0,o=0,s=null;for(let i=0;i4===e.key.type&&e.key.content===r))}return n}function Vu(e,t){return`_${t}_${e.replace(/[^\w]/g,((t,n)=>"-"===t?"_":e.charCodeAt(n).toString()))}`}function Lu(e,t){const n=t.options?t.options.compatConfig:t.compatConfig,r=n&&n[e];return"MODE"===e?r||3:r}function Bu(e,t){const n=Lu("MODE",t),r=Lu(e,t);return 3===n?!0===r:!1!==r}function ju(e,t,n,...r){return Bu(e,t)}const Du=/&(gt|lt|amp|apos|quot);/g,Uu={gt:">",lt:"<",amp:"&",apos:"'",quot:'"'},Hu={delimiters:["{{","}}"],getNamespace:()=>0,getTextMode:()=>0,isVoidTag:l,isPreTag:l,isCustomElement:l,decodeEntities:e=>e.replace(Du,((e,t)=>Uu[t])),onError:pl,onWarn:dl,comments:!1};function Wu(e,t={}){const n=function(e,t){const n=p({},Hu);let r;for(r in t)n[r]=void 0===t[r]?Hu[r]:t[r];return{options:n,column:1,line:1,offset:0,originalSource:e,source:e,inPre:!1,inVPre:!1,onWarn:n.onWarn}}(e,t),r=sa(n);return function(e,t=tu){return{type:0,children:e,helpers:new Set,components:[],directives:[],hoists:[],imports:[],cached:0,temps:0,codegenNode:void 0,loc:t}}(zu(n,0,[]),ia(n,r))}function zu(e,t,n){const r=ca(n),o=r?r.ns:0,s=[];for(;!da(e,t,n);){const i=e.source;let c;if(0===t||1===t)if(!e.inVPre&&la(i,e.options.delimiters[0]))c=na(e,t);else if(0===t&&"<"===i[0])if(1===i.length)pa(e,5,1);else if("!"===i[1])la(i,"\x3c!--")?c=qu(e):la(i,""===i[2]){pa(e,14,2),ua(e,3);continue}if(/[a-z]/i.test(i[2])){pa(e,23),Qu(e,Zu.End,r);continue}pa(e,12,2),c=Ju(e)}else/[a-z]/i.test(i[1])?(c=Yu(e,n),Bu("COMPILER_NATIVE_TEMPLATE",e)&&c&&"template"===c.tag&&!c.props.some((e=>7===e.type&&Xu(e.name)))&&(c=c.children)):"?"===i[1]?(pa(e,21,1),c=Ju(e)):pa(e,12,1);if(c||(c=ra(e,t)),g(c))for(let e=0;e/.exec(e.source);if(r){r.index<=3&&pa(e,0),r[1]&&pa(e,10),n=e.source.slice(4,r.index);const t=e.source.slice(0,r.index);let o=1,s=0;for(;-1!==(s=t.indexOf("\x3c!--",o));)ua(e,s-o+1),s+4");return-1===o?(r=e.source.slice(n),ua(e,e.source.length)):(r=e.source.slice(n,o),ua(e,o+1)),{type:3,content:r,loc:ia(e,t)}}function Yu(e,t){const n=e.inPre,r=e.inVPre,o=ca(t),s=Qu(e,Zu.Start,o),i=e.inPre&&!n,c=e.inVPre&&!r;if(s.isSelfClosing||e.options.isVoidTag(s.tag))return i&&(e.inPre=!1),c&&(e.inVPre=!1),s;t.push(s);const l=e.options.getTextMode(s,o),u=zu(e,l,t);t.pop();{const t=s.props.find((e=>6===e.type&&"inline-template"===e.name));if(t&&ju("COMPILER_INLINE_TEMPLATE",e,t.loc)){const n=ia(e,s.loc.end);t.value={type:2,content:n.source,loc:n}}}if(s.children=u,ha(e.source,s.tag))Qu(e,Zu.End,o);else if(pa(e,24,0,s.loc.start),0===e.source.length&&"script"===s.tag.toLowerCase()){const t=u[0];t&&la(t.loc.source,"\x3c!--")&&pa(e,8)}return s.loc=ia(e,s.loc.start),i&&(e.inPre=!1),c&&(e.inVPre=!1),s}var Zu=(e=>(e[e.Start=0]="Start",e[e.End=1]="End",e))(Zu||{});const Xu=o("if,else,else-if,for,slot");function Qu(e,t,n){const r=sa(e),o=/^<\/?([a-z][^\t\r\n\f />]*)/i.exec(e.source),s=o[1],i=e.options.getNamespace(s,n);ua(e,o[0].length),aa(e);const c=sa(e),l=e.source;e.options.isPreTag(s)&&(e.inPre=!0);let u=ea(e,t);0===t&&!e.inVPre&&u.some((e=>7===e.type&&"pre"===e.name))&&(e.inVPre=!0,p(e,c),e.source=l,u=ea(e,t).filter((e=>"v-pre"!==e.name)));let a=!1;if(0===e.source.length?pa(e,9):(a=la(e.source,"/>"),1===t&&a&&pa(e,4),ua(e,a?2:1)),1===t)return;let f=0;return e.inVPre||("slot"===s?f=2:"template"===s?u.some((e=>7===e.type&&Xu(e.name)))&&(f=3):function(e,t,n){const r=n.options;if(r.isCustomElement(e))return!1;if("component"===e||/^[A-Z]/.test(e)||gu(e)||r.isBuiltInComponent&&r.isBuiltInComponent(e)||r.isNativeTag&&!r.isNativeTag(e))return!0;for(let e=0;e0&&!la(e.source,">")&&!la(e.source,"/>");){if(la(e.source,"/")){pa(e,22),ua(e,1),aa(e);continue}1===t&&pa(e,3);const o=ta(e,r);6===o.type&&o.value&&"class"===o.name&&(o.value.content=o.value.content.replace(/\s+/g," ").trim()),0===t&&n.push(o),/^[^\t\r\n\f />]/.test(e.source)&&pa(e,15),aa(e)}return n}function ta(e,t){var n;const r=sa(e),o=/^[^\t\r\n\f />][^\t\r\n\f />=]*/.exec(e.source)[0];t.has(o)&&pa(e,2),t.add(o),"="===o[0]&&pa(e,19);{const t=/["'<]/g;let n;for(;n=t.exec(o);)pa(e,17,n.index)}let s;ua(e,o.length),/^[\t\r\n\f ]*=/.test(e.source)&&(aa(e),ua(e,1),aa(e),s=function(e){const t=sa(e);let n;const r=e.source[0],o='"'===r||"'"===r;if(o){ua(e,1);const t=e.source.indexOf(r);-1===t?n=oa(e,e.source.length,4):(n=oa(e,t,4),ua(e,1))}else{const t=/^[^\t\r\n\f >]+/.exec(e.source);if(!t)return;const r=/["'<=`]/g;let o;for(;o=r.exec(t[0]);)pa(e,18,o.index);n=oa(e,t[0].length,4)}return{content:n,isQuoted:o,loc:ia(e,t)}}(e),s||pa(e,13));const i=ia(e,r);if(!e.inVPre&&/^(v-[A-Za-z0-9-]|:|\.|@|#)/.test(o)){const t=/(?:^v-([a-z0-9-]+))?(?:(?::|^\.|^@|^#)(\[[^\]]+\]|[^\.]+))?(.+)?$/i.exec(o);let c,l=la(o,"."),u=t[1]||(l||la(o,":")?"bind":la(o,"@")?"on":"slot");if(t[2]){const s="slot"===u,i=o.lastIndexOf(t[2],o.length-((null==(n=t[3])?void 0:n.length)||0)),l=ia(e,fa(e,r,i),fa(e,r,i+t[2].length+(s&&t[3]||"").length));let a=t[2],f=!0;a.startsWith("[")?(f=!1,a.endsWith("]")?a=a.slice(1,a.length-1):(pa(e,27),a=a.slice(1))):s&&(a+=t[3]||""),c={type:4,content:a,isStatic:f,constType:f?3:0,loc:l}}if(s&&s.isQuoted){const e=s.loc;e.start.offset++,e.start.column++,e.end=wu(e.start,s.content),e.source=e.source.slice(1,-1)}const a=t[3]?t[3].slice(1).split("."):[];return l&&a.push("prop"),"bind"===u&&c&&a.includes("sync")&&ju("COMPILER_V_BIND_SYNC",e,0,c.loc.source)&&(u="model",a.splice(a.indexOf("sync"),1)),{type:7,name:u,exp:s&&{type:4,content:s.content,isStatic:!1,constType:0,loc:s.loc},arg:c,modifiers:a,loc:i}}return!e.inVPre&&la(o,"v-")&&pa(e,26),{type:6,name:o,value:s&&{type:2,content:s.content,loc:s.loc},loc:i}}function na(e,t){const[n,r]=e.options.delimiters,o=e.source.indexOf(r,n.length);if(-1===o)return void pa(e,25);const s=sa(e);ua(e,n.length);const i=sa(e),c=sa(e),l=o-n.length,u=e.source.slice(0,l),a=oa(e,l,t),f=a.trim(),p=a.indexOf(f);p>0&&ku(i,u,p);return ku(c,u,l-(a.length-f.length-p)),ua(e,r.length),{type:5,content:{type:4,isStatic:!1,constType:0,content:f,loc:ia(e,i,c)},loc:ia(e,s)}}function ra(e,t){const n=3===t?["]]>"]:["<",e.options.delimiters[0]];let r=e.source.length;for(let t=0;to&&(r=o)}const o=sa(e);return{type:2,content:oa(e,r,t),loc:ia(e,o)}}function oa(e,t,n){const r=e.source.slice(0,t);return ua(e,t),2!==n&&3!==n&&r.includes("&")?e.options.decodeEntities(r,4===n):r}function sa(e){const{column:t,line:n,offset:r}=e;return{column:t,line:n,offset:r}}function ia(e,t,n){return{start:t,end:n=n||sa(e),source:e.originalSource.slice(t.offset,n.offset)}}function ca(e){return e[e.length-1]}function la(e,t){return e.startsWith(t)}function ua(e,t){const{source:n}=e;ku(e,n,t),e.source=n.slice(t)}function aa(e){const t=/^[\t\r\n\f ]+/.exec(e.source);t&&ua(e,t[0].length)}function fa(e,t,n){return wu(t,e.originalSource.slice(t.offset,n),n)}function pa(e,t,n,r=sa(e)){n&&(r.offset+=n,r.column+=n),e.options.onError(hl(t,{start:r,end:r,source:""}))}function da(e,t,n){const r=e.source;switch(t){case 0:if(la(r,"=0;--e)if(ha(r,n[e].tag))return!0;break;case 1:case 2:{const e=ca(n);if(e&&ha(r,e.tag))return!0;break}case 3:if(la(r,"]]>"))return!0}return!r}function ha(e,t){return la(e,"]/.test(e[2+t.length]||">")}function ma(e,t){va(e,t,ga(e,e.children[0]))}function ga(e,t){const{children:n}=e;return 1===n.length&&1===t.type&&!Pu(t)}function va(e,t,n=!1){const{children:r}=e,o=r.length;let s=0;for(let e=0;e0){if(e>=2){o.codegenNode.patchFlag="-1",o.codegenNode=t.hoist(o.codegenNode),s++;continue}}else{const e=o.codegenNode;if(13===e.type){const n=Ca(e);if((!n||512===n||1===n)&&Sa(o,t)>=2){const n=xa(o);n&&(e.props=t.hoist(n))}e.dynamicProps&&(e.dynamicProps=t.hoist(e.dynamicProps))}}}if(1===o.type){const e=1===o.tagType;e&&t.scopes.vSlot++,va(o,t),e&&t.scopes.vSlot--}else if(11===o.type)va(o,t,1===o.children.length);else if(9===o.type)for(let e=0;e1)for(let o=0;on&&(E.childIndex--,E.onNodeRemoved()):(E.currentNode=null,E.onNodeRemoved()),E.parent.children.splice(n,1)},onNodeRemoved:()=>{},addIdentifiers(e){},removeIdentifiers(e){},hoist(e){S(e)&&(e=iu(e)),E.hoists.push(e);const t=iu(`_hoisted_${E.hoists.length}`,!1,e.loc,2);return t.hoisted=e,t},cache(e,t=!1){return function(e,t,n=!1){return{type:20,index:e,value:t,isVNode:n,loc:tu}}(E.cached++,e,t)}};return E.filters=new Set,E}function ka(e,t){const n=wa(e,t);Ea(e,n),t.hoistStatic&&ma(e,n),t.ssr||function(e,t){const{helper:n}=t,{children:r}=e;if(1===r.length){const n=r[0];if(ga(e,n)&&n.codegenNode){const r=n.codegenNode;13===r.type&&du(r,t),e.codegenNode=r}else e.codegenNode=n}else if(r.length>1){let r=64;K[64];0,e.codegenNode=nu(t,n(ml),void 0,e.children,r+"",void 0,void 0,!0,void 0,!1)}}(e,n),e.helpers=new Set([...n.helpers.keys()]),e.components=[...n.components],e.directives=[...n.directives],e.imports=n.imports,e.hoists=n.hoists,e.temps=n.temps,e.cached=n.cached,e.filters=[...n.filters]}function Ea(e,t){t.currentNode=e;const{nodeTransforms:n}=t,r=[];for(let o=0;o{n--};for(;nt===e:t=>e.test(t);return(e,r)=>{if(1===e.type){const{props:o}=e;if(3===e.tagType&&o.some(Mu))return;const s=[];for(let i=0;i`${eu[e]}: _${eu[e]}`;function Ma(e,{mode:t="function",prefixIdentifiers:n="module"===t,sourceMap:r=!1,filename:o="template.vue.html",scopeId:s=null,optimizeImports:i=!1,runtimeGlobalName:c="Vue",runtimeModuleName:l="vue",ssrRuntimeModuleName:u="vue/server-renderer",ssr:a=!1,isTS:f=!1,inSSR:p=!1}){const d={mode:t,prefixIdentifiers:n,sourceMap:r,filename:o,scopeId:s,optimizeImports:i,runtimeGlobalName:c,runtimeModuleName:l,ssrRuntimeModuleName:u,ssr:a,isTS:f,inSSR:p,source:e.loc.source,code:"",column:1,line:1,offset:0,indentLevel:0,pure:!1,map:void 0,helper(e){return`_${eu[e]}`},push(e,t){d.code+=e},indent(){h(++d.indentLevel)},deindent(e=!1){e?--d.indentLevel:h(--d.indentLevel)},newline(){h(d.indentLevel)}};function h(e){d.push("\n"+" ".repeat(e))}return d}function Oa(e,t={}){const n=Ma(e,t);t.onContextCreated&&t.onContextCreated(n);const{mode:r,push:o,prefixIdentifiers:s,indent:i,deindent:c,newline:l,scopeId:u,ssr:a}=n,f=Array.from(e.helpers),p=f.length>0,d=!s&&"module"!==r,h=n;!function(e,t){const{ssr:n,prefixIdentifiers:r,push:o,newline:s,runtimeModuleName:i,runtimeGlobalName:c,ssrRuntimeModuleName:l}=t,u=c,a=Array.from(e.helpers);if(a.length>0&&(o(`const _Vue = ${u}\n`),e.hoists.length)){o(`const { ${[Cl,wl,kl,El,Tl].filter((e=>a.includes(e))).map(Ra).join(", ")} } = _Vue\n`)}(function(e,t){if(!e.length)return;t.pure=!0;const{push:n,newline:r,helper:o,scopeId:s,mode:i}=t;r();for(let o=0;o0)&&l()),e.directives.length&&(Pa(e.directives,"directive",n),e.temps>0&&l()),e.filters&&e.filters.length&&(l(),Pa(e.filters,"filter",n),l()),e.temps>0){o("let ");for(let t=0;t0?", ":""}_temp${t}`)}return(e.components.length||e.directives.length||e.temps)&&(o("\n"),l()),a||o("return "),e.codegenNode?$a(e.codegenNode,n):o("null"),d&&(c(),o("}")),c(),o("}"),{ast:e,code:n.code,preamble:"",map:n.map?n.map.toJSON():void 0}}function Pa(e,t,{helper:n,push:r,newline:o,isTS:s}){const i=n("filter"===t?Ol:"component"===t?Nl:Ml);for(let n=0;n3||!1;t.push("["),n&&t.indent(),Ia(e,t,n),n&&t.deindent(),t.push("]")}function Ia(e,t,n=!1,r=!0){const{push:o,newline:s}=t;for(let i=0;ie||"null"))}([s,i,c,l,u]),t),n(")"),f&&n(")");a&&(n(", "),$a(a,t),n(")"))}(e,t);break;case 14:!function(e,t){const{push:n,helper:r,pure:o}=t,s=S(e.callee)?e.callee:r(e.callee);o&&n(Na);n(s+"(",e),Ia(e.arguments,t),n(")")}(e,t);break;case 15:!function(e,t){const{push:n,indent:r,deindent:o,newline:s}=t,{properties:i}=e;if(!i.length)return void n("{}",e);const c=i.length>1||!1;n(c?"{":"{ "),c&&r();for(let e=0;e "),(l||c)&&(n("{"),r());i?(l&&n("return "),g(i)?Aa(i,t):$a(i,t)):c&&$a(c,t);(l||c)&&(o(),n("}"));u&&(e.isNonScopedSlot&&n(", undefined, true"),n(")"))}(e,t);break;case 19:!function(e,t){const{test:n,consequent:r,alternate:o,newline:s}=e,{push:i,indent:c,deindent:l,newline:u}=t;if(4===n.type){const e=!yu(n.content);e&&i("("),Fa(n,t),e&&i(")")}else i("("),$a(n,t),i(")");s&&c(),t.indentLevel++,s||i(" "),i("? "),$a(r,t),t.indentLevel--,s&&u(),s||i(" "),i(": ");const a=19===o.type;a||t.indentLevel++;$a(o,t),a||t.indentLevel--;s&&l(!0)}(e,t);break;case 20:!function(e,t){const{push:n,helper:r,indent:o,deindent:s,newline:i}=t;n(`_cache[${e.index}] || (`),e.isVNode&&(o(),n(`${r(Kl)}(-1),`),i());n(`_cache[${e.index}] = `),$a(e.value,t),e.isVNode&&(n(","),i(),n(`${r(Kl)}(1),`),i(),n(`_cache[${e.index}]`),s());n(")")}(e,t);break;case 21:Ia(e.body,t,!0,!1)}}function Fa(e,t){const{content:n,isStatic:r}=e;t.push(r?JSON.stringify(n):n,e)}function Va(e,t){for(let n=0;nfunction(e,t,n,r){if(!("else"===t.name||t.exp&&t.exp.content.trim())){const r=t.exp?t.exp.loc:e.loc;n.onError(hl(28,t.loc)),t.exp=iu("true",!1,r)}0;if("if"===t.name){const o=ja(e,t),s={type:9,loc:e.loc,branches:[o]};if(n.replaceNode(s),r)return r(s,o,!0)}else{const o=n.parent.children;let s=o.indexOf(e);for(;s-- >=-1;){const i=o[s];if(i&&3===i.type)n.removeNode(i);else{if(!i||2!==i.type||i.content.trim().length){if(i&&9===i.type){"else-if"===t.name&&void 0===i.branches[i.branches.length-1].condition&&n.onError(hl(30,e.loc)),n.removeNode();const o=ja(e,t);0,i.branches.push(o);const s=r&&r(i,o,!1);Ea(o,n),s&&s(),n.currentNode=null}else n.onError(hl(30,e.loc));break}n.removeNode(i)}}}}(e,t,n,((e,t,r)=>{const o=n.parent.children;let s=o.indexOf(e),i=0;for(;s-- >=0;){const e=o[s];e&&9===e.type&&(i+=e.branches.length)}return()=>{if(r)e.codegenNode=Da(t,i,n);else{const r=function(e){for(;;)if(19===e.type){if(19!==e.alternate.type)return e;e=e.alternate}else 20===e.type&&(e=e.value)}(e.codegenNode);r.alternate=Da(t,i+e.branches.length-1,n)}}}))));function ja(e,t){const n=3===e.tagType;return{type:10,loc:e.loc,condition:"else"===t.name?void 0:t.exp,children:n&&!Eu(e,"for")?e.children:[e],userKey:Tu(e,"key"),isTemplateIf:n}}function Da(e,t,n){return e.condition?au(e.condition,Ua(e,t,n),lu(n.helper(kl),['""',"true"])):Ua(e,t,n)}function Ua(e,t,n){const{helper:r}=n,o=su("key",iu(`${t}`,!1,tu,2)),{children:s}=e,i=s[0];if(1!==s.length||1!==i.type){if(1===s.length&&11===i.type){const e=i.codegenNode;return $u(e,o,n),e}{let t=64;K[64];return nu(n,r(ml),ou([o]),s,t+"",void 0,void 0,!0,!1,!1,e.loc)}}{const e=i.codegenNode,t=14===(c=e).type&&c.callee===Xl?c.arguments[1].returns:c;return 13===t.type&&du(t,n),$u(t,o,n),e}var c}const Ha=Ta("for",((e,t,n)=>{const{helper:r,removeHelper:o}=n;return function(e,t,n,r){if(!t.exp)return void n.onError(hl(31,t.loc));const o=Ga(t.exp,n);if(!o)return void n.onError(hl(32,t.loc));const{addIdentifiers:s,removeIdentifiers:i,scopes:c}=n,{source:l,value:u,key:a,index:f}=o,p={type:11,loc:t.loc,source:l,valueAlias:u,keyAlias:a,objectIndexAlias:f,parseResult:o,children:Ou(e)?e.children:[e]};n.replaceNode(p),c.vFor++;const d=r&&r(p);return()=>{c.vFor--,d&&d()}}(e,t,n,(t=>{const s=lu(r(Al),[t.source]),i=Ou(e),c=Eu(e,"memo"),l=Tu(e,"key"),u=l&&(6===l.type?iu(l.value.content,!0):l.exp),a=l?su("key",u):null,f=4===t.source.type&&t.source.constType>0,p=f?64:l?128:256;return t.codegenNode=nu(n,r(ml),void 0,s,p+"",void 0,void 0,!0,!f,!1,e.loc),()=>{let l;const{children:p}=t;const d=1!==p.length||1!==p[0].type,h=Pu(e)?e:i&&1===e.children.length&&Pu(e.children[0])?e.children[0]:null;if(h?(l=h.codegenNode,i&&a&&$u(l,a,n)):d?l=nu(n,r(ml),a?ou([a]):void 0,e.children,"64",void 0,void 0,!0,void 0,!1):(l=p[0].codegenNode,i&&a&&$u(l,a,n),l.isBlock!==!f&&(l.isBlock?(o(bl),o(pu(n.inSSR,l.isComponent))):o(fu(n.inSSR,l.isComponent))),l.isBlock=!f,l.isBlock?(r(bl),r(pu(n.inSSR,l.isComponent))):r(fu(n.inSSR,l.isComponent))),c){const e=uu(Ja(t.parseResult,[iu("_cached")]));e.body={type:21,body:[cu(["const _memo = (",c.exp,")"]),cu(["if (_cached",...u?[" && _cached.key === ",u]:[],` && ${n.helperString(Ql)}(_cached, _memo)) return _cached`]),cu(["const _item = ",l]),iu("_item.memo = _memo"),iu("return _item")],loc:tu},s.arguments.push(e,iu("_cache"),iu(String(n.cached++)))}else s.arguments.push(uu(Ja(t.parseResult),l,!0))}}))}));const Wa=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,za=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,Ka=/^\(|\)$/g;function Ga(e,t){const n=e.loc,r=e.content,o=r.match(Wa);if(!o)return;const[,s,i]=o,c={source:qa(n,i.trim(),r.indexOf(i,s.length)),value:void 0,key:void 0,index:void 0};let l=s.trim().replace(Ka,"").trim();const u=s.indexOf(l),a=l.match(za);if(a){l=l.replace(za,"").trim();const e=a[1].trim();let t;if(e&&(t=r.indexOf(e,u+l.length),c.key=qa(n,e,t)),a[2]){const o=a[2].trim();o&&(c.index=qa(n,o,r.indexOf(o,c.key?t+e.length:u+l.length)))}}return l&&(c.value=qa(n,l,u)),c}function qa(e,t,n){return iu(t,!1,Cu(e,n,t.length))}function Ja({value:e,key:t,index:n},r=[]){return function(e){let t=e.length;for(;t--&&!e[t];);return e.slice(0,t+1).map(((e,t)=>e||iu("_".repeat(t+1),!1)))}([e,t,n,...r])}const Ya=iu("undefined",!1),Za=(e,t)=>{if(1===e.type&&(1===e.tagType||3===e.tagType)){const n=Eu(e,"slot");if(n)return n.exp,t.scopes.vSlot++,()=>{t.scopes.vSlot--}}},Xa=(e,t,n)=>uu(e,t,!1,!0,t.length?t[0].loc:n);function Qa(e,t,n=Xa){t.helper(Jl);const{children:r,loc:o}=e,s=[],i=[];let c=t.scopes.vSlot>0||t.scopes.vFor>0;const l=Eu(e,"slot",!0);if(l){const{arg:e,exp:t}=l;e&&!hu(e)&&(c=!0),s.push(su(e||iu("default",!0),n(t,r,o)))}let u=!1,a=!1;const f=[],p=new Set;let d=0;for(let e=0;e{const s=n(e,r,o);return t.compatConfig&&(s.isNonScopedSlot=!0),su("default",s)};u?f.length&&f.some((e=>nf(e)))&&(a?t.onError(hl(39,f[0].loc)):s.push(e(void 0,f))):s.push(e(void 0,r))}const h=c?2:tf(e.children)?3:1;let m=ou(s.concat(su("_",iu(h+"",!1))),o);return i.length&&(m=lu(t.helper($l),[m,ru(i)])),{slots:m,hasDynamicSlots:c}}function ef(e,t,n){const r=[su("name",e),su("fn",t)];return null!=n&&r.push(su("key",iu(String(n),!0))),ou(r)}function tf(e){for(let t=0;tfunction(){if(1!==(e=t.currentNode).type||0!==e.tagType&&1!==e.tagType)return;const{tag:n,props:r}=e,o=1===e.tagType;let s=o?function(e,t,n=!1){let{tag:r}=e;const o=uf(r),s=Tu(e,"is");if(s)if(o||Bu("COMPILER_IS_ON_ELEMENT",t)){const e=6===s.type?s.value&&iu(s.value.content,!0):s.exp;if(e)return lu(t.helper(Rl),[e])}else 6===s.type&&s.value.content.startsWith("vue:")&&(r=s.value.content.slice(4));const i=!o&&Eu(e,"is");if(i&&i.exp)return lu(t.helper(Rl),[i.exp]);const c=gu(r)||t.isBuiltInComponent(r);if(c)return n||t.helper(c),c;return t.helper(Nl),t.components.add(r),Vu(r,"component")}(e,t):`"${n}"`;const i=C(s)&&s.callee===Rl;let c,l,u,a,f,p,d=0,h=i||s===gl||s===vl||!o&&("svg"===n||"foreignObject"===n);if(r.length>0){const n=sf(e,t,void 0,o,i);c=n.props,d=n.patchFlag,f=n.dynamicPropNames;const r=n.directives;p=r&&r.length?ru(r.map((e=>function(e,t){const n=[],r=rf.get(e);r?n.push(t.helperString(r)):(t.helper(Ml),t.directives.add(e.name),n.push(Vu(e.name,"directive")));const{loc:o}=e;e.exp&&n.push(e.exp);e.arg&&(e.exp||n.push("void 0"),n.push(e.arg));if(Object.keys(e.modifiers).length){e.arg||(e.exp||n.push("void 0"),n.push("void 0"));const t=iu("true",!1,o);n.push(ou(e.modifiers.map((e=>su(e,t))),o))}return ru(n,e.loc)}(e,t)))):void 0,n.shouldUseBlock&&(h=!0)}if(e.children.length>0){s===yl&&(h=!0,d|=1024);if(o&&s!==gl&&s!==yl){const{slots:n,hasDynamicSlots:r}=Qa(e,t);l=n,r&&(d|=1024)}else if(1===e.children.length&&s!==gl){const n=e.children[0],r=n.type,o=5===r||8===r;o&&0===ya(n,t)&&(d|=1),l=o||2===r?n:e.children}else l=e.children}0!==d&&(u=String(d),f&&f.length&&(a=function(e){let t="[";for(let n=0,r=e.length;n0;let h=!1,m=0,g=!1,v=!1,y=!1,_=!1,b=!1,S=!1;const C=[],w=e=>{u.length&&(f.push(ou(cf(u),c)),u=[]),e&&f.push(e)},k=({key:e,value:n})=>{if(hu(e)){const s=e.content,i=a(s);if(!i||r&&!o||"onclick"===s.toLowerCase()||"onUpdate:modelValue"===s||M(s)||(_=!0),i&&M(s)&&(S=!0),20===n.type||(4===n.type||8===n.type)&&ya(n,t)>0)return;"ref"===s?g=!0:"class"===s?v=!0:"style"===s?y=!0:"key"===s||C.includes(s)||C.push(s),!r||"class"!==s&&"style"!==s||C.includes(s)||C.push(s)}else b=!0};for(let o=0;o0&&u.push(su(iu("ref_for",!0),iu("true")))),"is"===n&&(uf(i)||r&&r.content.startsWith("vue:")||Bu("COMPILER_IS_ON_ELEMENT",t)))continue;u.push(su(iu(n,!0,Cu(e,0,n.length)),iu(r?r.content:"",o,r?r.loc:e)))}else{const{name:n,arg:o,exp:a,loc:m}=l,g="bind"===n,v="on"===n;if("slot"===n){r||t.onError(hl(40,m));continue}if("once"===n||"memo"===n)continue;if("is"===n||g&&Nu(o,"is")&&(uf(i)||Bu("COMPILER_IS_ON_ELEMENT",t)))continue;if(v&&s)continue;if((g&&Nu(o,"key")||v&&d&&Nu(o,"vue:before-update"))&&(h=!0),g&&Nu(o,"ref")&&t.scopes.vFor>0&&u.push(su(iu("ref_for",!0),iu("true"))),!o&&(g||v)){if(b=!0,a)if(g){if(w(),Bu("COMPILER_V_BIND_OBJECT_ORDER",t)){f.unshift(a);continue}f.push(a)}else w({type:14,loc:m,callee:t.helper(Ul),arguments:r?[a]:[a,"true"]});else t.onError(hl(g?34:35,m));continue}const y=t.directiveTransforms[n];if(y){const{props:n,needRuntime:r}=y(l,e,t);!s&&n.forEach(k),v&&o&&!hu(o)?w(ou(n,c)):u.push(...n),r&&(p.push(l),x(r)&&rf.set(l,r))}else O(n)||(p.push(l),d&&(h=!0))}}let E;if(f.length?(w(),E=f.length>1?lu(t.helper(Vl),f,c):f[0]):u.length&&(E=ou(cf(u),c)),b?m|=16:(v&&!r&&(m|=2),y&&!r&&(m|=4),C.length&&(m|=8),_&&(m|=32)),h||0!==m&&32!==m||!(g||S||p.length>0)||(m|=512),!t.inSSR&&E)switch(E.type){case 15:let e=-1,n=-1,r=!1;for(let t=0;t{if(Pu(e)){const{children:n,loc:r}=e,{slotName:o,slotProps:s}=function(e,t){let n,r='"default"';const o=[];for(let t=0;t0){const{props:r,directives:s}=sf(e,t,o,!1,!1);n=r,s.length&&t.onError(hl(36,s[0].loc))}return{slotName:r,slotProps:n}}(e,t),i=[t.prefixIdentifiers?"_ctx.$slots":"$slots",o,"{}","undefined","true"];let c=2;s&&(i[2]=s,c=3),n.length&&(i[3]=uu([],n,!1,!1,r),c=4),t.scopeId&&!t.slotted&&(c=5),i.splice(c),e.codegenNode=lu(t.helper(Il),i,r)}};const ff=/^\s*([\w$_]+|(async\s*)?\([^)]*?\))\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/,pf=(e,t,n,r)=>{const{loc:o,modifiers:s,arg:i}=e;let c;if(e.exp||s.length||n.onError(hl(35,o)),4===i.type)if(i.isStatic){let e=i.content;0,e.startsWith("vue:")&&(e=`vnode-${e.slice(4)}`);c=iu(0!==t.tagType||e.startsWith("vnode")||!/[A-Z]/.test(e)?L(I(e)):`on:${e}`,!0,i.loc)}else c=cu([`${n.helperString(zl)}(`,i,")"]);else c=i,c.children.unshift(`${n.helperString(zl)}(`),c.children.push(")");let l=e.exp;l&&!l.content.trim()&&(l=void 0);let u=n.cacheHandlers&&!l&&!n.inVOnce;if(l){const e=xu(l.content),t=!(e||ff.test(l.content)),n=l.content.includes(";");0,(t||u&&e)&&(l=cu([`${t?"$event":"(...args)"} => ${n?"{":"("}`,l,n?"}":")"]))}let a={props:[su(c,l||iu("() => {}",!1,o))]};return r&&(a=r(a)),u&&(a.props[0].value=n.cache(a.props[0].value)),a.props.forEach((e=>e.key.isHandlerKey=!0)),a},df=(e,t,n)=>{const{exp:r,modifiers:o,loc:s}=e,i=e.arg;return 4!==i.type?(i.children.unshift("("),i.children.push(') || ""')):i.isStatic||(i.content=`${i.content} || ""`),o.includes("camel")&&(4===i.type?i.isStatic?i.content=I(i.content):i.content=`${n.helperString(Hl)}(${i.content})`:(i.children.unshift(`${n.helperString(Hl)}(`),i.children.push(")"))),n.inSSR||(o.includes("prop")&&hf(i,"."),o.includes("attr")&&hf(i,"^")),!r||4===r.type&&!r.content.trim()?(n.onError(hl(34,s)),{props:[su(i,iu("",!0,s))]}):{props:[su(i,r)]}},hf=(e,t)=>{4===e.type?e.isStatic?e.content=t+e.content:e.content=`\`${t}\${${e.content}}\``:(e.children.unshift(`'${t}' + (`),e.children.push(")"))},mf=(e,t)=>{if(0===e.type||1===e.type||11===e.type||10===e.type)return()=>{const n=e.children;let r,o=!1;for(let e=0;e7===e.type&&!t.directiveTransforms[e.name]))||"template"===e.tag)))for(let e=0;e{if(1===e.type&&Eu(e,"once",!0)){if(gf.has(e)||t.inVOnce||t.inSSR)return;return gf.add(e),t.inVOnce=!0,t.helper(Kl),()=>{t.inVOnce=!1;const e=t.currentNode;e.codegenNode&&(e.codegenNode=t.cache(e.codegenNode,!0))}}},yf=(e,t,n)=>{const{exp:r,arg:o}=e;if(!r)return n.onError(hl(41,e.loc)),_f();const s=r.loc.source,i=4===r.type?r.content:s,c=n.bindingMetadata[s];if("props"===c||"props-aliased"===c)return n.onError(hl(44,r.loc)),_f();if(!i.trim()||!xu(i))return n.onError(hl(42,r.loc)),_f();const l=o||iu("modelValue",!0),u=o?hu(o)?`onUpdate:${I(o.content)}`:cu(['"onUpdate:" + ',o]):"onUpdate:modelValue";let a;a=cu([`${n.isTS?"($event: any)":"$event"} => ((`,r,") = $event)"]);const f=[su(l,e.exp),su(u,a)];if(e.modifiers.length&&1===t.tagType){const t=e.modifiers.map((e=>(yu(e)?e:JSON.stringify(e))+": true")).join(", "),n=o?hu(o)?`${o.content}Modifiers`:cu([o,' + "Modifiers"']):"modelModifiers";f.push(su(n,iu(`{ ${t} }`,!1,e.loc,2)))}return _f(f)};function _f(e=[]){return{props:e}}const bf=/[\w).+\-_$\]]/,Sf=(e,t)=>{Bu("COMPILER_FILTER",t)&&(5===e.type&&xf(e.content,t),1===e.type&&e.props.forEach((e=>{7===e.type&&"for"!==e.name&&e.exp&&xf(e.exp,t)})))};function xf(e,t){if(4===e.type)Cf(e,t);else for(let n=0;n=0&&(e=n.charAt(t)," "===e);t--);e&&bf.test(e)||(a=!0)}}else void 0===i?(h=s+1,i=n.slice(0,s).trim()):g();function g(){m.push(n.slice(h,s).trim()),h=s+1}if(void 0===i?i=n.slice(0,s).trim():0!==h&&g(),m.length){for(s=0;s{if(1===e.type){const n=Eu(e,"memo");if(!n||kf.has(e))return;return kf.add(e),()=>{const r=e.codegenNode||t.currentNode.codegenNode;r&&13===r.type&&(1!==e.tagType&&du(r,t),e.codegenNode=lu(t.helper(Xl),[n.exp,uu(void 0,r),"_cache",String(t.cached++)]))}}};function Tf(e,t={}){const n=t.onError||pl,r="module"===t.mode;!0===t.prefixIdentifiers?n(hl(47)):r&&n(hl(48));t.cacheHandlers&&n(hl(49)),t.scopeId&&!r&&n(hl(50));const o=S(e)?Wu(e,t):e,[s,i]=[[vf,Ba,Ef,Ha,Sf,af,of,Za,mf],{on:pf,bind:df,model:yf}];return ka(o,p({},t,{prefixIdentifiers:false,nodeTransforms:[...s,...t.nodeTransforms||[]],directiveTransforms:p({},i,t.directiveTransforms||{})})),Oa(o,p({},t,{prefixIdentifiers:false}))}const Nf=Symbol(""),Rf=Symbol(""),Mf=Symbol(""),Of=Symbol(""),Pf=Symbol(""),Af=Symbol(""),If=Symbol(""),$f=Symbol(""),Ff=Symbol(""),Vf=Symbol("");var Lf;let Bf;Lf={[Nf]:"vModelRadio",[Rf]:"vModelCheckbox",[Mf]:"vModelText",[Of]:"vModelSelect",[Pf]:"vModelDynamic",[Af]:"withModifiers",[If]:"withKeys",[$f]:"vShow",[Ff]:"Transition",[Vf]:"TransitionGroup"},Object.getOwnPropertySymbols(Lf).forEach((e=>{eu[e]=Lf[e]}));const jf=o("style,iframe,script,noscript",!0),Df={isVoidTag:re,isNativeTag:e=>te(e)||ne(e),isPreTag:e=>"pre"===e,decodeEntities:function(e,t=!1){return Bf||(Bf=document.createElement("div")),t?(Bf.innerHTML=`
`,Bf.children[0].getAttribute("foo")):(Bf.innerHTML=e,Bf.textContent)},isBuiltInComponent:e=>mu(e,"Transition")?Ff:mu(e,"TransitionGroup")?Vf:void 0,getNamespace(e,t){let n=t?t.ns:0;if(t&&2===n)if("annotation-xml"===t.tag){if("svg"===e)return 1;t.props.some((e=>6===e.type&&"encoding"===e.name&&null!=e.value&&("text/html"===e.value.content||"application/xhtml+xml"===e.value.content)))&&(n=0)}else/^m(?:[ions]|text)$/.test(t.tag)&&"mglyph"!==e&&"malignmark"!==e&&(n=0);else t&&1===n&&("foreignObject"!==t.tag&&"desc"!==t.tag&&"title"!==t.tag||(n=0));if(0===n){if("svg"===e)return 1;if("math"===e)return 2}return n},getTextMode({tag:e,ns:t}){if(0===t){if("textarea"===e||"title"===e)return 1;if(jf(e))return 2}return 0}},Uf=(e,t)=>{const n=X(e);return iu(JSON.stringify(n),!1,t,3)};function Hf(e,t){return hl(e,t)}const Wf=o("passive,once,capture"),zf=o("stop,prevent,self,ctrl,shift,alt,meta,exact,middle"),Kf=o("left,right"),Gf=o("onkeyup,onkeydown,onkeypress",!0),qf=(e,t)=>hu(e)&&"onclick"===e.content.toLowerCase()?iu(t,!0):4!==e.type?cu(["(",e,`) === "onClick" ? "${t}" : (`,e,")"]):e;const Jf=(e,t)=>{1!==e.type||0!==e.tagType||"script"!==e.tag&&"style"!==e.tag||t.removeNode()},Yf=[e=>{1===e.type&&e.props.forEach(((t,n)=>{6===t.type&&"style"===t.name&&t.value&&(e.props[n]={type:7,name:"bind",arg:iu("style",!0,t.loc),exp:Uf(t.value.content,t.loc),modifiers:[],loc:t.loc})}))}],Zf={cloak:()=>({props:[]}),html:(e,t,n)=>{const{exp:r,loc:o}=e;return r||n.onError(Hf(53,o)),t.children.length&&(n.onError(Hf(54,o)),t.children.length=0),{props:[su(iu("innerHTML",!0,o),r||iu("",!0))]}},text:(e,t,n)=>{const{exp:r,loc:o}=e;return r||n.onError(Hf(55,o)),t.children.length&&(n.onError(Hf(56,o)),t.children.length=0),{props:[su(iu("textContent",!0),r?ya(r,n)>0?r:lu(n.helperString(Fl),[r],o):iu("",!0))]}},model:(e,t,n)=>{const r=yf(e,t,n);if(!r.props.length||1===t.tagType)return r;e.arg&&n.onError(Hf(58,e.arg.loc));const{tag:o}=t,s=n.isCustomElement(o);if("input"===o||"textarea"===o||"select"===o||s){let i=Mf,c=!1;if("input"===o||s){const r=Tu(t,"type");if(r){if(7===r.type)i=Pf;else if(r.value)switch(r.value.content){case"radio":i=Nf;break;case"checkbox":i=Rf;break;case"file":c=!0,n.onError(Hf(59,e.loc))}}else(function(e){return e.props.some((e=>!(7!==e.type||"bind"!==e.name||e.arg&&4===e.arg.type&&e.arg.isStatic)))})(t)&&(i=Pf)}else"select"===o&&(i=Of);c||(r.needRuntime=n.helper(i))}else n.onError(Hf(57,e.loc));return r.props=r.props.filter((e=>!(4===e.key.type&&"modelValue"===e.key.content))),r},on:(e,t,n)=>pf(e,t,n,(t=>{const{modifiers:r}=e;if(!r.length)return t;let{key:o,value:s}=t.props[0];const{keyModifiers:i,nonKeyModifiers:c,eventOptionModifiers:l}=((e,t,n,r)=>{const o=[],s=[],i=[];for(let r=0;r{const{exp:r,loc:o}=e;return r||n.onError(Hf(61,o)),{props:[],needRuntime:n.helper($f)}}};const Xf=Object.create(null);function Qf(e,t){if(!S(e)){if(!e.nodeType)return c;e=e.innerHTML}const n=e,o=Xf[n];if(o)return o;if("#"===e[0]){const t=document.querySelector(e);0,e=t?t.innerHTML:""}const s=p({hoistStatic:!0,onError:void 0,onWarn:c},t);s.isCustomElement||"undefined"==typeof customElements||(s.isCustomElement=e=>!!customElements.get(e));const{code:i}=function(e,t={}){return Tf(e,p({},Df,t,{nodeTransforms:[Jf,...Yf,...t.nodeTransforms||[]],directiveTransforms:p({},Zf,t.directiveTransforms||{}),transformHoist:null}))}(e,s);const l=new Function("Vue",i)(r);return l._rc=!0,Xf[n]=l}Si(Qf)}}]); \ No newline at end of file diff --git a/modules/system/assets/js/build/manifest.js b/modules/system/assets/js/build/manifest.js index 6bb0026d2..2088606a4 100644 --- a/modules/system/assets/js/build/manifest.js +++ b/modules/system/assets/js/build/manifest.js @@ -1 +1 @@ -!function(){"use strict";var r,n={},e={};function t(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={exports:{}};return n[r](i,i.exports,t),i.exports}t.m=n,r=[],t.O=function(n,e,o,i){if(!e){var u=1/0;for(a=0;a=i)&&Object.keys(t.O).every((function(r){return t.O[r](e[c])}))?e.splice(c--,1):(f=!1,i0&&r[a-1][2]>i;a--)r[a]=r[a-1];r[a]=[e,o,i]},t.d=function(r,n){for(var e in n)t.o(n,e)&&!t.o(r,e)&&Object.defineProperty(r,e,{enumerable:!0,get:n[e]})},t.o=function(r,n){return Object.prototype.hasOwnProperty.call(r,n)},function(){var r={911:0};t.O.j=function(n){return 0===r[n]};var n=function(n,e){var o,i,u=e[0],f=e[1],c=e[2],s=0;if(u.some((function(n){return 0!==r[n]}))){for(o in f)t.o(f,o)&&(t.m[o]=f[o]);if(c)var a=c(t)}for(n&&n(e);s=u)&&Object.keys(t.O).every((function(n){return t.O[n](e[c])}))?e.splice(c--,1):(f=!1,u0&&n[a-1][2]>u;a--)n[a]=n[a-1];n[a]=[e,o,u]},t.n=function(n){var r=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(r,{a:r}),r},t.d=function(n,r){for(var e in r)t.o(r,e)&&!t.o(n,e)&&Object.defineProperty(n,e,{enumerable:!0,get:r[e]})},t.o=function(n,r){return Object.prototype.hasOwnProperty.call(n,r)},function(){var n={911:0};t.O.j=function(r){return 0===n[r]};var r=function(r,e){var o,u,i=e[0],f=e[1],c=e[2],s=0;if(i.some((function(r){return 0!==n[r]}))){for(o in f)t.o(f,o)&&(t.m[o]=f[o]);if(c)var a=c(t)}for(r&&r(e);s0&&e.forEach((e=>{e.classList.add(this.getLoadingClass(e))}))}else void 0!==t.element.dataset.attachLoading&&t.element.classList.add(this.getLoadingClass(t.element))}ajaxDone(e,t){if(t.element)if("FORM"===t.element.tagName){const e=t.element.querySelectorAll("[data-attach-loading]");e.length>0&&e.forEach((e=>{e.classList.remove(this.getLoadingClass(e))}))}else void 0!==t.element.dataset.attachLoading&&t.element.classList.remove(this.getLoadingClass(t.element))}getLoadingClass(e){return void 0!==e.dataset.attachLoading&&""!==e.dataset.attachLoading?e.dataset.attachLoading:"wn-loading"}}},270:function(e,t,s){s.d(t,{Z:function(){return n}});var i=s(579);class n extends i.NG{construct(e,t,s){if(this.message=e,this.type=t||"default",this.duration=Number(s||7),this.duration<0)throw new Error("Flash duration must be a positive number, or zero");this.clear(),this.timer=null,this.flashTimer=null,this.create()}dependencies(){return["transition"]}destruct(){null!==this.timer&&window.clearTimeout(this.timer),this.flashTimer&&this.flashTimer.remove(),this.flash&&(this.flash.remove(),this.flash=null,this.flashTimer=null),super.destruct()}create(){this.snowboard.globalEvent("flash.create",this),this.flash=document.createElement("DIV"),this.flash.innerHTML=this.message,this.flash.classList.add("flash-message",this.type),this.flash.removeAttribute("data-control"),this.flash.addEventListener("click",(()=>this.remove())),this.flash.addEventListener("mouseover",(()=>this.stopTimer())),this.flash.addEventListener("mouseout",(()=>this.startTimer())),this.duration>0?(this.flashTimer=document.createElement("DIV"),this.flashTimer.classList.add("flash-timer"),this.flash.appendChild(this.flashTimer)):this.flash.classList.add("no-timer"),document.body.appendChild(this.flash),this.snowboard.transition(this.flash,"show",(()=>{this.startTimer()}))}remove(){this.snowboard.globalEvent("flash.remove",this),this.stopTimer(),this.snowboard.transition(this.flash,"hide",(()=>{this.flash.remove(),this.flash=null,this.destruct()}))}clear(){document.querySelectorAll("body > div.flash-message").forEach((e=>e.remove()))}startTimer(){0!==this.duration&&(this.timerTrans=this.snowboard.transition(this.flashTimer,"timeout",null,`${this.duration}.0s`,!0),this.timer=window.setTimeout((()=>this.remove()),1e3*this.duration))}stopTimer(){this.timerTrans&&this.timerTrans.cancel(),this.timer&&window.clearTimeout(this.timer)}}},277:function(e,t,s){s.d(t,{Z:function(){return n}});var i=s(579);class n extends i.eG{dependencies(){return["request"]}listens(){return{ready:"ready",ajaxStart:"ajaxStart"}}ready(){this.counter=0,this.createStripe()}ajaxStart(e,t){!1!==t.options.stripe&&(this.show(),e.then((()=>{this.hide()})).catch((()=>{this.hide()})))}createStripe(){this.indicator=document.createElement("DIV"),this.stripe=document.createElement("DIV"),this.stripeLoaded=document.createElement("DIV"),this.indicator.classList.add("stripe-loading-indicator","loaded"),this.stripe.classList.add("stripe"),this.stripeLoaded.classList.add("stripe-loaded"),this.indicator.appendChild(this.stripe),this.indicator.appendChild(this.stripeLoaded),document.body.appendChild(this.indicator)}show(){this.counter+=1;const e=this.stripe.cloneNode(!0);this.indicator.appendChild(e),this.stripe.remove(),this.stripe=e,this.counter>1||(this.indicator.classList.remove("loaded"),document.body.classList.add("wn-loading"))}hide(e){this.counter-=1,!0===e&&(this.counter=0),this.counter<=0&&(this.indicator.classList.add("loaded"),document.body.classList.remove("wn-loading"))}}},32:function(e,t,s){s.d(t,{Z:function(){return n}});var i=s(579);class n extends i.eG{listens(){return{ready:"ready"}}ready(){let e=!1;if(document.querySelectorAll('link[rel="stylesheet"]').forEach((t=>{t.href.endsWith("/modules/system/assets/css/snowboard.extras.css")&&(e=!0)})),!e){const e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("href",this.snowboard.url().asset("/modules/system/assets/css/snowboard.extras.css")),document.head.appendChild(e)}}}},269:function(e,t,s){s.d(t,{Z:function(){return n}});var i=s(579);class n extends i.NG{construct(e,t,s,i,n){if(e instanceof HTMLElement==!1)throw new Error("A HTMLElement must be provided for transitioning");if(this.element=e,"string"!=typeof t)throw new Error("Transition name must be specified as a string");if(this.transition=t,s&&"function"!=typeof s)throw new Error("Callback must be a valid function");this.callback=s,this.duration=i?this.parseDuration(i):null,this.trailTo=!0===n,this.doTransition()}eventClasses(){for(var e=arguments.length,t=new Array(e),s=0;s{const[s,i]=e;-1!==t.indexOf(s)&&n.push(i)})),n}doTransition(){null!==this.duration&&(this.element.style.transitionDuration=this.duration),this.resetClasses(),this.eventClasses("in","active").forEach((e=>{this.element.classList.add(e)})),window.requestAnimationFrame((()=>{"0s"!==window.getComputedStyle(this.element)["transition-duration"]?(this.element.addEventListener("transitionend",(()=>this.onTransitionEnd()),{once:!0}),window.requestAnimationFrame((()=>{this.element.classList.remove(this.eventClasses("in")[0]),this.element.classList.add(this.eventClasses("out")[0])}))):(this.resetClasses(),this.callback&&this.callback.apply(this.element),this.destruct())}))}onTransitionEnd(){this.eventClasses("active",this.trailTo?"":"out").forEach((e=>{this.element.classList.remove(e)})),this.callback&&this.callback.apply(this.element),null!==this.duration&&(this.element.style.transitionDuration=null),this.destruct()}cancel(){this.element.removeEventListener("transitionend",(()=>this.onTransitionEnd),{once:!0}),this.resetClasses(),null!==this.duration&&(this.element.style.transitionDuration=null),this.destruct()}resetClasses(){this.eventClasses().forEach((e=>{this.element.classList.remove(e)}))}parseDuration(e){const t=/^([0-9]+(\.[0-9]+)?)(m?s)?$/.exec(e),s=Number(t[1]);return"sec"===("s"===t[3]?"sec":"msec")?1e3*s+"ms":`${Math.floor(s)}ms`}}},136:function(e,t,s){var i,n=s(270),r=s(269),o=s(553),a=s(277),h=s(32);if(void 0===window.Snowboard)throw new Error("Snowboard must be loaded in order to use the extra plugins.");(i=window.Snowboard).addPlugin("extrasStyles",h.Z),i.addPlugin("transition",r.Z),i.addPlugin("flash",n.Z),i.addPlugin("attachLoading",o.Z),i.addPlugin("stripeLoader",a.Z)},165:function(e,t,s){var i=s(579);(e=>{const t=new i.Jc(!0);e.snowboard=t,e.Snowboard=t,e.SnowBoard=t})(window)},640:function(e,t,s){var i=s(579);function n(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,i)}return s}function r(e){for(var t=1;t{e&&this.doAjax().then((e=>{if(e.cancelled)return this.cancelled=!0,void this.complete();this.responseData=e,this.processUpdate(e).then((()=>{!1===e.X_WINTER_SUCCESS?this.processError(e):this.processResponse(e)}))}),(e=>{this.responseError=e,this.processError(e)}))})):this.doAjax().then((e=>{if(e.cancelled)return this.cancelled=!0,void this.complete();this.responseData=e,this.processUpdate(e).then((()=>{!1===e.X_WINTER_SUCCESS?this.processError(e):this.processResponse(e)}))}),(e=>{this.responseError=e,this.processError(e)})):this.cancelled=!0}else this.cancelled=!0}dependencies(){return["cookie","jsonParser"]}checkRequest(){if(this.element&&this.element instanceof Element==!1)throw new Error("The element provided must be an Element instance");if(void 0===this.handler)throw new Error("The AJAX handler name is not specified.");if(!this.isHandlerName(this.handler))throw new Error('Invalid AJAX handler name. The correct handler name format is: "onEvent".')}getFetch(){return this.fetchOptions=void 0!==this.options.fetchOptions&&"object"==typeof this.options.fetchOptions?this.options.fetchOptions:{method:"POST",headers:this.headers,body:this.data,redirect:"follow",mode:"same-origin"},this.snowboard.globalEvent("ajaxFetchOptions",this.fetchOptions,this),fetch(this.url,this.fetchOptions)}doClientValidation(){return!0!==this.options.browserValidate||!this.form||!1!==this.form.checkValidity()||(this.form.reportValidity(),!1)}doAjax(){if(!1===this.snowboard.globalEvent("ajaxBeforeSend",this))return Promise.resolve({cancelled:!0});const e=new Promise(((e,t)=>{this.getFetch().then((s=>{s.ok||406===s.status?s.headers.has("Content-Type")&&s.headers.get("Content-Type").includes("/json")?s.json().then((t=>{e(r(r({},t),{},{X_WINTER_SUCCESS:406!==s.status,X_WINTER_RESPONSE_CODE:s.status}))}),(e=>{t(this.renderError(`Unable to parse JSON response: ${e}`))})):s.text().then((t=>{e(t)}),(e=>{t(this.renderError(`Unable to process response: ${e}`))})):s.headers.has("Content-Type")&&s.headers.get("Content-Type").includes("/json")?s.json().then((e=>{e.message&&e.exception?t(this.renderError(e.message,e.exception,e.file,e.line,e.trace)):t(e)}),(e=>{t(this.renderError(`Unable to parse JSON response: ${e}`))})):s.text().then((e=>{t(this.renderError(e))}),(e=>{t(this.renderError(`Unable to process response: ${e}`))}))}),(e=>{t(this.renderError(`Unable to retrieve a response from the server: ${e}`))}))}));if(this.snowboard.globalEvent("ajaxStart",e,this),this.element){const t=new Event("ajaxPromise");t.promise=e,this.element.dispatchEvent(t)}return e}processUpdate(e){return new Promise(((t,s)=>{if("function"==typeof this.options.beforeUpdate&&!1===this.options.beforeUpdate.apply(this,[e]))return void t();const i={};if(Object.entries(e).forEach((e=>{const[t,s]=e;"X_WINTER"!==t.substr(0,8)&&(i[t]=s)})),0===Object.keys(i).length)return void(e.X_WINTER_ASSETS?this.processAssets(e.X_WINTER_ASSETS).then((()=>{t()}),(()=>{s()})):t());this.snowboard.globalPromiseEvent("ajaxBeforeUpdate",e,this).then((async()=>{e.X_WINTER_ASSETS&&await this.processAssets(e.X_WINTER_ASSETS),this.doUpdate(i).then((()=>{window.requestAnimationFrame((()=>t()))}),(()=>{s()}))}),(()=>{t()}))}))}doUpdate(e){return new Promise((t=>{const s=[];Object.entries(e).forEach((e=>{const[t,i]=e;let n=this.options.update&&this.options.update[t]?this.options.update[t]:t,r="replace";"@"===n.substr(0,1)?(r="append",n=n.substr(1)):"^"===n.substr(0,1)?(r="prepend",n=n.substr(1)):"#"!==n.substr(0,1)&&"."!==n.substr(0,1)&&(r="noop");const o=document.querySelectorAll(n);o.length>0&&o.forEach((e=>{switch(r){case"append":e.innerHTML+=i;break;case"prepend":e.innerHTML=i+e.innerHTML;break;case"noop":break;default:e.innerHTML=i}s.push(e),this.snowboard.globalEvent("ajaxUpdate",e,i,this);const t=new Event("ajaxUpdate");t.content=i,e.dispatchEvent(t)}))})),this.snowboard.globalEvent("ajaxUpdateComplete",s,this),t()}))}processResponse(e){if((!this.options.success||"function"!=typeof this.options.success||!1!==this.options.success(this.responseData,this))&&!1!==this.snowboard.globalEvent("ajaxSuccess",this.responseData,this)){if(this.element){const e=new Event("ajaxDone",{cancelable:!0});if(e.responseData=this.responseData,e.request=this,this.element.dispatchEvent(e),e.defaultPrevented)return}this.flash&&e.X_WINTER_FLASH_MESSAGES&&this.processFlashMessages(e.X_WINTER_FLASH_MESSAGES),this.redirect||e.X_WINTER_REDIRECT?this.processRedirect(this.redirect||e.X_WINTER_REDIRECT):this.complete()}}processError(e){if((!this.options.error||"function"!=typeof this.options.error||!1!==this.options.error(this.responseError,this))&&!1!==this.snowboard.globalEvent("ajaxError",this.responseError,this)){if(this.element){const e=new Event("ajaxFail",{cancelable:!0});if(e.responseError=this.responseError,e.request=this,this.element.dispatchEvent(e),e.defaultPrevented)return}if(e instanceof Error)this.processErrorMessage(e.message);else{let t=!1;e.X_WINTER_ERROR_FIELDS&&(t=this.processValidationErrors(e.X_WINTER_ERROR_FIELDS)),e.X_WINTER_ERROR_MESSAGE&&!t&&this.processErrorMessage(e.X_WINTER_ERROR_MESSAGE)}this.complete()}}processRedirect(e){"function"==typeof this.options.handleRedirectResponse&&!1===this.options.handleRedirectResponse.apply(this,[e])||!1!==this.snowboard.globalEvent("ajaxRedirect",e,this)&&(window.addEventListener("popstate",(()=>{if(this.element){const e=document.createEvent("CustomEvent");e.eventName="ajaxRedirected",this.element.dispatchEvent(e)}}),{once:!0}),window.location.assign(e))}processErrorMessage(e){"function"==typeof this.options.handleErrorMessage&&!1===this.options.handleErrorMessage.apply(this,[e])||!1!==this.snowboard.globalEvent("ajaxErrorMessage",e,this)&&window.alert(e)}processFlashMessages(e){"function"==typeof this.options.handleFlashMessages&&!1===this.options.handleFlashMessages.apply(this,[e])||this.snowboard.globalEvent("ajaxFlashMessages",e,this)}processValidationErrors(e){return"function"==typeof this.options.handleValidationErrors&&!1===this.options.handleValidationErrors.apply(this,[this.form,e])||!1===this.snowboard.globalEvent("ajaxValidationErrors",this.form,e,this)}processAssets(e){return this.snowboard.globalPromiseEvent("ajaxLoadAssets",e)}async doConfirm(){if("function"==typeof this.options.handleConfirmMessage)return!1!==this.options.handleConfirmMessage.apply(this,[this.confirm]);if(0===this.snowboard.listensToEvent("ajaxConfirmMessage").length)return window.confirm(this.confirm);const e=this.snowboard.globalPromiseEvent("ajaxConfirmMessage",this.confirm,this);try{if(await e)return!0}catch(e){return!1}return!1}complete(){if(this.options.complete&&"function"==typeof this.options.complete&&this.options.complete(this.responseData,this),this.snowboard.globalEvent("ajaxDone",this.responseData,this),this.element){const e=new Event("ajaxAlways");e.request=this,e.responseData=this.responseData,e.responseError=this.responseError,this.element.dispatchEvent(e)}this.destruct()}get form(){return this.options.form?"string"==typeof this.options.form?document.querySelector(this.options.form):this.options.form:this.element?"FORM"===this.element.tagName?this.element:this.element.closest("form"):null}get context(){return{handler:this.handler,options:this.options}}get headers(){const e={"X-Requested-With":"XMLHttpRequest","X-WINTER-REQUEST-HANDLER":this.handler,"X-WINTER-REQUEST-PARTIALS":this.extractPartials(this.options.update||[])};return this.flash&&(e["X-WINTER-REQUEST-FLASH"]=1),this.xsrfToken&&(e["X-XSRF-TOKEN"]=this.xsrfToken),e}get loading(){return this.options.loading||!1}get url(){return this.options.url||window.location.href}get redirect(){return this.options.redirect&&this.options.redirect.length?this.options.redirect:null}get flash(){return this.options.flash||!1}get files(){return!0===this.options.files&&(void 0!==FormData||(this.snowboard.debug("This browser does not support file uploads"),!1))}get xsrfToken(){return this.snowboard.cookie().get("XSRF-TOKEN")}get data(){const e="object"==typeof this.options.data?this.options.data:{},t=new FormData(this.form||void 0);return Object.keys(e).length>0&&Object.entries(e).forEach((e=>{const[s,i]=e;t.append(s,i)})),t}get confirm(){return this.options.confirm||!1}extractPartials(e){return Object.keys(e).join("&")}renderError(e,t,s,i,n){const r=new Error(e);return r.exception=t||null,r.file=s||null,r.line=i||null,r.trace=n||[],r}isHandlerName(e){return/^(?:\w+:{2})?on[A-Z0-9]/.test(e)}}if(void 0===window.Snowboard)throw new Error("Snowboard must be loaded in order to use the Javascript AJAX request feature.");window.Snowboard.addPlugin("request",a)}},function(e){var t=function(t){return e(e.s=t)};e.O(0,[109],(function(){return t(165),t(640),t(136)}));e.O()}]); \ No newline at end of file +"use strict";(self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[]).push([[714,450,988],{553:function(e,t,s){s.d(t,{Z:function(){return n}});var i=s(640);class n extends i.eG{dependencies(){return["request"]}listens(){return{ajaxStart:"ajaxStart",ajaxDone:"ajaxDone"}}ajaxStart(e,t){if(t.element)if("FORM"===t.element.tagName){const e=t.element.querySelectorAll("[data-attach-loading]");e.length>0&&e.forEach((e=>{e.classList.add(this.getLoadingClass(e))}))}else void 0!==t.element.dataset.attachLoading&&t.element.classList.add(this.getLoadingClass(t.element))}ajaxDone(e,t){if(t.element)if("FORM"===t.element.tagName){const e=t.element.querySelectorAll("[data-attach-loading]");e.length>0&&e.forEach((e=>{e.classList.remove(this.getLoadingClass(e))}))}else void 0!==t.element.dataset.attachLoading&&t.element.classList.remove(this.getLoadingClass(t.element))}getLoadingClass(e){return void 0!==e.dataset.attachLoading&&""!==e.dataset.attachLoading?e.dataset.attachLoading:"wn-loading"}}},270:function(e,t,s){s.d(t,{Z:function(){return n}});var i=s(640);class n extends i.NG{construct(e,t,s){if(this.message=e,this.type=t||"default",this.duration=Number(s||7),this.duration<0)throw new Error("Flash duration must be a positive number, or zero");this.clear(),this.timer=null,this.flashTimer=null,this.create()}dependencies(){return["transition"]}destruct(){null!==this.timer&&window.clearTimeout(this.timer),this.flashTimer&&this.flashTimer.remove(),this.flash&&(this.flash.remove(),this.flash=null,this.flashTimer=null),super.destruct()}create(){this.snowboard.globalEvent("flash.create",this),this.flash=document.createElement("DIV"),this.flash.innerHTML=this.message,this.flash.classList.add("flash-message",this.type),this.flash.removeAttribute("data-control"),this.flash.addEventListener("click",(()=>this.remove())),this.flash.addEventListener("mouseover",(()=>this.stopTimer())),this.flash.addEventListener("mouseout",(()=>this.startTimer())),this.duration>0?(this.flashTimer=document.createElement("DIV"),this.flashTimer.classList.add("flash-timer"),this.flash.appendChild(this.flashTimer)):this.flash.classList.add("no-timer"),document.body.appendChild(this.flash),this.snowboard.transition(this.flash,"show",(()=>{this.startTimer()}))}remove(){this.snowboard.globalEvent("flash.remove",this),this.stopTimer(),this.snowboard.transition(this.flash,"hide",(()=>{this.flash.remove(),this.flash=null,this.destruct()}))}clear(){document.querySelectorAll("body > div.flash-message").forEach((e=>e.remove()))}startTimer(){0!==this.duration&&(this.timerTrans=this.snowboard.transition(this.flashTimer,"timeout",null,`${this.duration}.0s`,!0),this.timer=window.setTimeout((()=>this.remove()),1e3*this.duration))}stopTimer(){this.timerTrans&&this.timerTrans.cancel(),this.timer&&window.clearTimeout(this.timer)}}},277:function(e,t,s){s.d(t,{Z:function(){return n}});var i=s(640);class n extends i.eG{dependencies(){return["request"]}listens(){return{ready:"ready",ajaxStart:"ajaxStart"}}ready(){this.counter=0,this.createStripe()}ajaxStart(e,t){!1!==t.options.stripe&&(this.show(),e.then((()=>{this.hide()})).catch((()=>{this.hide()})))}createStripe(){this.indicator=document.createElement("DIV"),this.stripe=document.createElement("DIV"),this.stripeLoaded=document.createElement("DIV"),this.indicator.classList.add("stripe-loading-indicator","loaded"),this.stripe.classList.add("stripe"),this.stripeLoaded.classList.add("stripe-loaded"),this.indicator.appendChild(this.stripe),this.indicator.appendChild(this.stripeLoaded),document.body.appendChild(this.indicator)}show(){this.counter+=1;const e=this.stripe.cloneNode(!0);this.indicator.appendChild(e),this.stripe.remove(),this.stripe=e,this.counter>1||(this.indicator.classList.remove("loaded"),document.body.classList.add("wn-loading"))}hide(e){this.counter-=1,!0===e&&(this.counter=0),this.counter<=0&&(this.indicator.classList.add("loaded"),document.body.classList.remove("wn-loading"))}}},32:function(e,t,s){s.d(t,{Z:function(){return n}});var i=s(640);class n extends i.eG{listens(){return{ready:"ready"}}ready(){let e=!1;if(document.querySelectorAll('link[rel="stylesheet"]').forEach((t=>{t.href.endsWith("/modules/system/assets/css/snowboard.extras.css")&&(e=!0)})),!e){const e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("href",this.snowboard.url().asset("/modules/system/assets/css/snowboard.extras.css")),document.head.appendChild(e)}}}},269:function(e,t,s){s.d(t,{Z:function(){return n}});var i=s(640);class n extends i.NG{construct(e,t,s,i,n){if(e instanceof HTMLElement==!1)throw new Error("A HTMLElement must be provided for transitioning");if(this.element=e,"string"!=typeof t)throw new Error("Transition name must be specified as a string");if(this.transition=t,s&&"function"!=typeof s)throw new Error("Callback must be a valid function");this.callback=s,this.duration=i?this.parseDuration(i):null,this.trailTo=!0===n,this.doTransition()}eventClasses(){for(var e=arguments.length,t=new Array(e),s=0;s{const[s,i]=e;-1!==t.indexOf(s)&&n.push(i)})),n}doTransition(){null!==this.duration&&(this.element.style.transitionDuration=this.duration),this.resetClasses(),this.eventClasses("in","active").forEach((e=>{this.element.classList.add(e)})),window.requestAnimationFrame((()=>{"0s"!==window.getComputedStyle(this.element)["transition-duration"]?(this.element.addEventListener("transitionend",(()=>this.onTransitionEnd()),{once:!0}),window.requestAnimationFrame((()=>{this.element.classList.remove(this.eventClasses("in")[0]),this.element.classList.add(this.eventClasses("out")[0])}))):(this.resetClasses(),this.callback&&this.callback.apply(this.element),this.destruct())}))}onTransitionEnd(){this.eventClasses("active",this.trailTo?"":"out").forEach((e=>{this.element.classList.remove(e)})),this.callback&&this.callback.apply(this.element),null!==this.duration&&(this.element.style.transitionDuration=null),this.destruct()}cancel(){this.element.removeEventListener("transitionend",(()=>this.onTransitionEnd),{once:!0}),this.resetClasses(),null!==this.duration&&(this.element.style.transitionDuration=null),this.destruct()}resetClasses(){this.eventClasses().forEach((e=>{this.element.classList.remove(e)}))}parseDuration(e){const t=/^([0-9]+(\.[0-9]+)?)(m?s)?$/.exec(e),s=Number(t[1]);return"sec"===("s"===t[3]?"sec":"msec")?1e3*s+"ms":`${Math.floor(s)}ms`}}},136:function(e,t,s){var i,n=s(270),r=s(269),o=s(553),a=s(277),h=s(32);if(void 0===window.Snowboard)throw new Error("Snowboard must be loaded in order to use the extra plugins.");(i=window.Snowboard).addPlugin("extrasStyles",h.Z),i.addPlugin("transition",r.Z),i.addPlugin("flash",n.Z),i.addPlugin("attachLoading",o.Z),i.addPlugin("stripeLoader",a.Z)},165:function(e,t,s){var i=s(640);(e=>{const t=new i.Jc(!0);e.snowboard=t,e.Snowboard=t,e.SnowBoard=t})(window)},329:function(e,t,s){var i=s(640);function n(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,i)}return s}function r(e){for(var t=1;t{e&&this.doAjax().then((e=>{if(e.cancelled)return this.cancelled=!0,void this.complete();this.responseData=e,this.processUpdate(e).then((()=>{!1===e.X_WINTER_SUCCESS?this.processError(e):this.processResponse(e)}))}),(e=>{this.responseError=e,this.processError(e)}))})):this.doAjax().then((e=>{if(e.cancelled)return this.cancelled=!0,void this.complete();this.responseData=e,this.processUpdate(e).then((()=>{!1===e.X_WINTER_SUCCESS?this.processError(e):this.processResponse(e)}))}),(e=>{this.responseError=e,this.processError(e)})):this.cancelled=!0}else this.cancelled=!0}dependencies(){return["cookie","jsonParser"]}checkRequest(){if(this.element&&this.element instanceof Element==!1)throw new Error("The element provided must be an Element instance");if(void 0===this.handler)throw new Error("The AJAX handler name is not specified.");if(!this.isHandlerName(this.handler))throw new Error('Invalid AJAX handler name. The correct handler name format is: "onEvent".')}getFetch(){return this.fetchOptions=void 0!==this.options.fetchOptions&&"object"==typeof this.options.fetchOptions?this.options.fetchOptions:{method:"POST",headers:this.headers,body:this.data,redirect:"follow",mode:"same-origin"},this.snowboard.globalEvent("ajaxFetchOptions",this.fetchOptions,this),fetch(this.url,this.fetchOptions)}doClientValidation(){return!0!==this.options.browserValidate||!this.form||!1!==this.form.checkValidity()||(this.form.reportValidity(),!1)}doAjax(){if(!1===this.snowboard.globalEvent("ajaxBeforeSend",this))return Promise.resolve({cancelled:!0});const e=new Promise(((e,t)=>{this.getFetch().then((s=>{s.ok||406===s.status?s.headers.has("Content-Type")&&s.headers.get("Content-Type").includes("/json")?s.json().then((t=>{e(r(r({},t),{},{X_WINTER_SUCCESS:406!==s.status,X_WINTER_RESPONSE_CODE:s.status}))}),(e=>{t(this.renderError(`Unable to parse JSON response: ${e}`))})):s.text().then((t=>{e(t)}),(e=>{t(this.renderError(`Unable to process response: ${e}`))})):s.headers.has("Content-Type")&&s.headers.get("Content-Type").includes("/json")?s.json().then((e=>{e.message&&e.exception?t(this.renderError(e.message,e.exception,e.file,e.line,e.trace)):t(e)}),(e=>{t(this.renderError(`Unable to parse JSON response: ${e}`))})):s.text().then((e=>{t(this.renderError(e))}),(e=>{t(this.renderError(`Unable to process response: ${e}`))}))}),(e=>{t(this.renderError(`Unable to retrieve a response from the server: ${e}`))}))}));if(this.snowboard.globalEvent("ajaxStart",e,this),this.element){const t=new Event("ajaxPromise");t.promise=e,this.element.dispatchEvent(t)}return e}processUpdate(e){return new Promise(((t,s)=>{if("function"==typeof this.options.beforeUpdate&&!1===this.options.beforeUpdate.apply(this,[e]))return void t();const i={};if(Object.entries(e).forEach((e=>{const[t,s]=e;"X_WINTER"!==t.substr(0,8)&&(i[t]=s)})),0===Object.keys(i).length)return void(e.X_WINTER_ASSETS?this.processAssets(e.X_WINTER_ASSETS).then((()=>{t()}),(()=>{s()})):t());this.snowboard.globalPromiseEvent("ajaxBeforeUpdate",e,this).then((async()=>{e.X_WINTER_ASSETS&&await this.processAssets(e.X_WINTER_ASSETS),this.doUpdate(i).then((()=>{window.requestAnimationFrame((()=>t()))}),(()=>{s()}))}),(()=>{t()}))}))}doUpdate(e){return new Promise((t=>{const s=[];Object.entries(e).forEach((e=>{const[t,i]=e;let n=this.options.update&&this.options.update[t]?this.options.update[t]:t,r="replace";"@"===n.substr(0,1)?(r="append",n=n.substr(1)):"^"===n.substr(0,1)?(r="prepend",n=n.substr(1)):"#"!==n.substr(0,1)&&"."!==n.substr(0,1)&&(r="noop");const o=document.querySelectorAll(n);o.length>0&&o.forEach((e=>{switch(r){case"append":e.innerHTML+=i;break;case"prepend":e.innerHTML=i+e.innerHTML;break;case"noop":break;default:e.innerHTML=i}s.push(e),this.snowboard.globalEvent("ajaxUpdate",e,i,this);const t=new Event("ajaxUpdate");t.content=i,e.dispatchEvent(t)}))})),this.snowboard.globalEvent("ajaxUpdateComplete",s,this),t()}))}processResponse(e){if((!this.options.success||"function"!=typeof this.options.success||!1!==this.options.success(this.responseData,this))&&!1!==this.snowboard.globalEvent("ajaxSuccess",this.responseData,this)){if(this.element){const e=new Event("ajaxDone",{cancelable:!0});if(e.responseData=this.responseData,e.request=this,this.element.dispatchEvent(e),e.defaultPrevented)return}this.flash&&e.X_WINTER_FLASH_MESSAGES&&this.processFlashMessages(e.X_WINTER_FLASH_MESSAGES),this.redirect||e.X_WINTER_REDIRECT?this.processRedirect(this.redirect||e.X_WINTER_REDIRECT):this.complete()}}processError(e){if((!this.options.error||"function"!=typeof this.options.error||!1!==this.options.error(this.responseError,this))&&!1!==this.snowboard.globalEvent("ajaxError",this.responseError,this)){if(this.element){const e=new Event("ajaxFail",{cancelable:!0});if(e.responseError=this.responseError,e.request=this,this.element.dispatchEvent(e),e.defaultPrevented)return}if(e instanceof Error)this.processErrorMessage(e.message);else{let t=!1;e.X_WINTER_ERROR_FIELDS&&(t=this.processValidationErrors(e.X_WINTER_ERROR_FIELDS)),e.X_WINTER_ERROR_MESSAGE&&!t&&this.processErrorMessage(e.X_WINTER_ERROR_MESSAGE)}this.complete()}}processRedirect(e){"function"==typeof this.options.handleRedirectResponse&&!1===this.options.handleRedirectResponse.apply(this,[e])||!1!==this.snowboard.globalEvent("ajaxRedirect",e,this)&&(window.addEventListener("popstate",(()=>{if(this.element){const e=document.createEvent("CustomEvent");e.eventName="ajaxRedirected",this.element.dispatchEvent(e)}}),{once:!0}),window.location.assign(e))}processErrorMessage(e){"function"==typeof this.options.handleErrorMessage&&!1===this.options.handleErrorMessage.apply(this,[e])||!1!==this.snowboard.globalEvent("ajaxErrorMessage",e,this)&&window.alert(e)}processFlashMessages(e){"function"==typeof this.options.handleFlashMessages&&!1===this.options.handleFlashMessages.apply(this,[e])||this.snowboard.globalEvent("ajaxFlashMessages",e,this)}processValidationErrors(e){return"function"==typeof this.options.handleValidationErrors&&!1===this.options.handleValidationErrors.apply(this,[this.form,e])||!1===this.snowboard.globalEvent("ajaxValidationErrors",this.form,e,this)}processAssets(e){return this.snowboard.globalPromiseEvent("ajaxLoadAssets",e)}async doConfirm(){if("function"==typeof this.options.handleConfirmMessage)return!1!==this.options.handleConfirmMessage.apply(this,[this.confirm]);if(0===this.snowboard.listensToEvent("ajaxConfirmMessage").length)return window.confirm(this.confirm);const e=this.snowboard.globalPromiseEvent("ajaxConfirmMessage",this.confirm,this);try{if(await e)return!0}catch(e){return!1}return!1}complete(){if(this.options.complete&&"function"==typeof this.options.complete&&this.options.complete(this.responseData,this),this.snowboard.globalEvent("ajaxDone",this.responseData,this),this.element){const e=new Event("ajaxAlways");e.request=this,e.responseData=this.responseData,e.responseError=this.responseError,this.element.dispatchEvent(e)}this.destruct()}get form(){return this.options.form?"string"==typeof this.options.form?document.querySelector(this.options.form):this.options.form:this.element?"FORM"===this.element.tagName?this.element:this.element.closest("form"):null}get context(){return{handler:this.handler,options:this.options}}get headers(){const e={"X-Requested-With":"XMLHttpRequest","X-WINTER-REQUEST-HANDLER":this.handler,"X-WINTER-REQUEST-PARTIALS":this.extractPartials(this.options.update||[])};return this.flash&&(e["X-WINTER-REQUEST-FLASH"]=1),this.xsrfToken&&(e["X-XSRF-TOKEN"]=this.xsrfToken),e}get loading(){return this.options.loading||!1}get url(){return this.options.url||window.location.href}get redirect(){return this.options.redirect&&this.options.redirect.length?this.options.redirect:null}get flash(){return this.options.flash||!1}get files(){return!0===this.options.files&&(void 0!==FormData||(this.snowboard.debug("This browser does not support file uploads"),!1))}get xsrfToken(){return this.snowboard.cookie().get("XSRF-TOKEN")}get data(){const e="object"==typeof this.options.data?this.options.data:{},t=new FormData(this.form||void 0);return Object.keys(e).length>0&&Object.entries(e).forEach((e=>{const[s,i]=e;t.append(s,i)})),t}get confirm(){return this.options.confirm||!1}extractPartials(e){return Object.keys(e).join("&")}renderError(e,t,s,i,n){const r=new Error(e);return r.exception=t||null,r.file=s||null,r.line=i||null,r.trace=n||[],r}isHandlerName(e){return/^(?:\w+:{2})?on[A-Z0-9]/.test(e)}}if(void 0===window.Snowboard)throw new Error("Snowboard must be loaded in order to use the Javascript AJAX request feature.");window.Snowboard.addPlugin("request",a)}},function(e){var t=function(t){return e(e.s=t)};e.O(0,[109],(function(){return t(165),t(329),t(136)}));e.O()}]); \ No newline at end of file diff --git a/modules/system/assets/js/build/system.js b/modules/system/assets/js/build/system.js index 1fd585bfa..393d94917 100644 --- a/modules/system/assets/js/build/system.js +++ b/modules/system/assets/js/build/system.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[]).push([[290,243,988],{553:function(e,t,s){s.d(t,{Z:function(){return n}});var i=s(579);class n extends i.eG{dependencies(){return["request"]}listens(){return{ajaxStart:"ajaxStart",ajaxDone:"ajaxDone"}}ajaxStart(e,t){if(t.element)if("FORM"===t.element.tagName){const e=t.element.querySelectorAll("[data-attach-loading]");e.length>0&&e.forEach((e=>{e.classList.add(this.getLoadingClass(e))}))}else void 0!==t.element.dataset.attachLoading&&t.element.classList.add(this.getLoadingClass(t.element))}ajaxDone(e,t){if(t.element)if("FORM"===t.element.tagName){const e=t.element.querySelectorAll("[data-attach-loading]");e.length>0&&e.forEach((e=>{e.classList.remove(this.getLoadingClass(e))}))}else void 0!==t.element.dataset.attachLoading&&t.element.classList.remove(this.getLoadingClass(t.element))}getLoadingClass(e){return void 0!==e.dataset.attachLoading&&""!==e.dataset.attachLoading?e.dataset.attachLoading:"wn-loading"}}},270:function(e,t,s){s.d(t,{Z:function(){return n}});var i=s(579);class n extends i.NG{construct(e,t,s){if(this.message=e,this.type=t||"default",this.duration=Number(s||7),this.duration<0)throw new Error("Flash duration must be a positive number, or zero");this.clear(),this.timer=null,this.flashTimer=null,this.create()}dependencies(){return["transition"]}destruct(){null!==this.timer&&window.clearTimeout(this.timer),this.flashTimer&&this.flashTimer.remove(),this.flash&&(this.flash.remove(),this.flash=null,this.flashTimer=null),super.destruct()}create(){this.snowboard.globalEvent("flash.create",this),this.flash=document.createElement("DIV"),this.flash.innerHTML=this.message,this.flash.classList.add("flash-message",this.type),this.flash.removeAttribute("data-control"),this.flash.addEventListener("click",(()=>this.remove())),this.flash.addEventListener("mouseover",(()=>this.stopTimer())),this.flash.addEventListener("mouseout",(()=>this.startTimer())),this.duration>0?(this.flashTimer=document.createElement("DIV"),this.flashTimer.classList.add("flash-timer"),this.flash.appendChild(this.flashTimer)):this.flash.classList.add("no-timer"),document.body.appendChild(this.flash),this.snowboard.transition(this.flash,"show",(()=>{this.startTimer()}))}remove(){this.snowboard.globalEvent("flash.remove",this),this.stopTimer(),this.snowboard.transition(this.flash,"hide",(()=>{this.flash.remove(),this.flash=null,this.destruct()}))}clear(){document.querySelectorAll("body > div.flash-message").forEach((e=>e.remove()))}startTimer(){0!==this.duration&&(this.timerTrans=this.snowboard.transition(this.flashTimer,"timeout",null,`${this.duration}.0s`,!0),this.timer=window.setTimeout((()=>this.remove()),1e3*this.duration))}stopTimer(){this.timerTrans&&this.timerTrans.cancel(),this.timer&&window.clearTimeout(this.timer)}}},277:function(e,t,s){s.d(t,{Z:function(){return n}});var i=s(579);class n extends i.eG{dependencies(){return["request"]}listens(){return{ready:"ready",ajaxStart:"ajaxStart"}}ready(){this.counter=0,this.createStripe()}ajaxStart(e,t){!1!==t.options.stripe&&(this.show(),e.then((()=>{this.hide()})).catch((()=>{this.hide()})))}createStripe(){this.indicator=document.createElement("DIV"),this.stripe=document.createElement("DIV"),this.stripeLoaded=document.createElement("DIV"),this.indicator.classList.add("stripe-loading-indicator","loaded"),this.stripe.classList.add("stripe"),this.stripeLoaded.classList.add("stripe-loaded"),this.indicator.appendChild(this.stripe),this.indicator.appendChild(this.stripeLoaded),document.body.appendChild(this.indicator)}show(){this.counter+=1;const e=this.stripe.cloneNode(!0);this.indicator.appendChild(e),this.stripe.remove(),this.stripe=e,this.counter>1||(this.indicator.classList.remove("loaded"),document.body.classList.add("wn-loading"))}hide(e){this.counter-=1,!0===e&&(this.counter=0),this.counter<=0&&(this.indicator.classList.add("loaded"),document.body.classList.remove("wn-loading"))}}},32:function(e,t,s){s.d(t,{Z:function(){return n}});var i=s(579);class n extends i.eG{listens(){return{ready:"ready"}}ready(){let e=!1;if(document.querySelectorAll('link[rel="stylesheet"]').forEach((t=>{t.href.endsWith("/modules/system/assets/css/snowboard.extras.css")&&(e=!0)})),!e){const e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("href",this.snowboard.url().asset("/modules/system/assets/css/snowboard.extras.css")),document.head.appendChild(e)}}}},269:function(e,t,s){s.d(t,{Z:function(){return n}});var i=s(579);class n extends i.NG{construct(e,t,s,i,n){if(e instanceof HTMLElement==!1)throw new Error("A HTMLElement must be provided for transitioning");if(this.element=e,"string"!=typeof t)throw new Error("Transition name must be specified as a string");if(this.transition=t,s&&"function"!=typeof s)throw new Error("Callback must be a valid function");this.callback=s,this.duration=i?this.parseDuration(i):null,this.trailTo=!0===n,this.doTransition()}eventClasses(){for(var e=arguments.length,t=new Array(e),s=0;s{const[s,i]=e;-1!==t.indexOf(s)&&n.push(i)})),n}doTransition(){null!==this.duration&&(this.element.style.transitionDuration=this.duration),this.resetClasses(),this.eventClasses("in","active").forEach((e=>{this.element.classList.add(e)})),window.requestAnimationFrame((()=>{"0s"!==window.getComputedStyle(this.element)["transition-duration"]?(this.element.addEventListener("transitionend",(()=>this.onTransitionEnd()),{once:!0}),window.requestAnimationFrame((()=>{this.element.classList.remove(this.eventClasses("in")[0]),this.element.classList.add(this.eventClasses("out")[0])}))):(this.resetClasses(),this.callback&&this.callback.apply(this.element),this.destruct())}))}onTransitionEnd(){this.eventClasses("active",this.trailTo?"":"out").forEach((e=>{this.element.classList.remove(e)})),this.callback&&this.callback.apply(this.element),null!==this.duration&&(this.element.style.transitionDuration=null),this.destruct()}cancel(){this.element.removeEventListener("transitionend",(()=>this.onTransitionEnd),{once:!0}),this.resetClasses(),null!==this.duration&&(this.element.style.transitionDuration=null),this.destruct()}resetClasses(){this.eventClasses().forEach((e=>{this.element.classList.remove(e)}))}parseDuration(e){const t=/^([0-9]+(\.[0-9]+)?)(m?s)?$/.exec(e),s=Number(t[1]);return"sec"===("s"===t[3]?"sec":"msec")?1e3*s+"ms":`${Math.floor(s)}ms`}}},136:function(e,t,s){var i,n=s(270),r=s(269),o=s(553),a=s(277),h=s(32);if(void 0===window.Snowboard)throw new Error("Snowboard must be loaded in order to use the extra plugins.");(i=window.Snowboard).addPlugin("extrasStyles",h.Z),i.addPlugin("transition",r.Z),i.addPlugin("flash",n.Z),i.addPlugin("attachLoading",o.Z),i.addPlugin("stripeLoader",a.Z)},236:function(e,t,s){var i=s(579);(e=>{const t=new i.Jc;e.snowboard=t,e.Snowboard=t,e.SnowBoard=t})(window)},640:function(e,t,s){var i=s(579);function n(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,i)}return s}function r(e){for(var t=1;t{e&&this.doAjax().then((e=>{if(e.cancelled)return this.cancelled=!0,void this.complete();this.responseData=e,this.processUpdate(e).then((()=>{!1===e.X_WINTER_SUCCESS?this.processError(e):this.processResponse(e)}))}),(e=>{this.responseError=e,this.processError(e)}))})):this.doAjax().then((e=>{if(e.cancelled)return this.cancelled=!0,void this.complete();this.responseData=e,this.processUpdate(e).then((()=>{!1===e.X_WINTER_SUCCESS?this.processError(e):this.processResponse(e)}))}),(e=>{this.responseError=e,this.processError(e)})):this.cancelled=!0}else this.cancelled=!0}dependencies(){return["cookie","jsonParser"]}checkRequest(){if(this.element&&this.element instanceof Element==!1)throw new Error("The element provided must be an Element instance");if(void 0===this.handler)throw new Error("The AJAX handler name is not specified.");if(!this.isHandlerName(this.handler))throw new Error('Invalid AJAX handler name. The correct handler name format is: "onEvent".')}getFetch(){return this.fetchOptions=void 0!==this.options.fetchOptions&&"object"==typeof this.options.fetchOptions?this.options.fetchOptions:{method:"POST",headers:this.headers,body:this.data,redirect:"follow",mode:"same-origin"},this.snowboard.globalEvent("ajaxFetchOptions",this.fetchOptions,this),fetch(this.url,this.fetchOptions)}doClientValidation(){return!0!==this.options.browserValidate||!this.form||!1!==this.form.checkValidity()||(this.form.reportValidity(),!1)}doAjax(){if(!1===this.snowboard.globalEvent("ajaxBeforeSend",this))return Promise.resolve({cancelled:!0});const e=new Promise(((e,t)=>{this.getFetch().then((s=>{s.ok||406===s.status?s.headers.has("Content-Type")&&s.headers.get("Content-Type").includes("/json")?s.json().then((t=>{e(r(r({},t),{},{X_WINTER_SUCCESS:406!==s.status,X_WINTER_RESPONSE_CODE:s.status}))}),(e=>{t(this.renderError(`Unable to parse JSON response: ${e}`))})):s.text().then((t=>{e(t)}),(e=>{t(this.renderError(`Unable to process response: ${e}`))})):s.headers.has("Content-Type")&&s.headers.get("Content-Type").includes("/json")?s.json().then((e=>{e.message&&e.exception?t(this.renderError(e.message,e.exception,e.file,e.line,e.trace)):t(e)}),(e=>{t(this.renderError(`Unable to parse JSON response: ${e}`))})):s.text().then((e=>{t(this.renderError(e))}),(e=>{t(this.renderError(`Unable to process response: ${e}`))}))}),(e=>{t(this.renderError(`Unable to retrieve a response from the server: ${e}`))}))}));if(this.snowboard.globalEvent("ajaxStart",e,this),this.element){const t=new Event("ajaxPromise");t.promise=e,this.element.dispatchEvent(t)}return e}processUpdate(e){return new Promise(((t,s)=>{if("function"==typeof this.options.beforeUpdate&&!1===this.options.beforeUpdate.apply(this,[e]))return void t();const i={};if(Object.entries(e).forEach((e=>{const[t,s]=e;"X_WINTER"!==t.substr(0,8)&&(i[t]=s)})),0===Object.keys(i).length)return void(e.X_WINTER_ASSETS?this.processAssets(e.X_WINTER_ASSETS).then((()=>{t()}),(()=>{s()})):t());this.snowboard.globalPromiseEvent("ajaxBeforeUpdate",e,this).then((async()=>{e.X_WINTER_ASSETS&&await this.processAssets(e.X_WINTER_ASSETS),this.doUpdate(i).then((()=>{window.requestAnimationFrame((()=>t()))}),(()=>{s()}))}),(()=>{t()}))}))}doUpdate(e){return new Promise((t=>{const s=[];Object.entries(e).forEach((e=>{const[t,i]=e;let n=this.options.update&&this.options.update[t]?this.options.update[t]:t,r="replace";"@"===n.substr(0,1)?(r="append",n=n.substr(1)):"^"===n.substr(0,1)?(r="prepend",n=n.substr(1)):"#"!==n.substr(0,1)&&"."!==n.substr(0,1)&&(r="noop");const o=document.querySelectorAll(n);o.length>0&&o.forEach((e=>{switch(r){case"append":e.innerHTML+=i;break;case"prepend":e.innerHTML=i+e.innerHTML;break;case"noop":break;default:e.innerHTML=i}s.push(e),this.snowboard.globalEvent("ajaxUpdate",e,i,this);const t=new Event("ajaxUpdate");t.content=i,e.dispatchEvent(t)}))})),this.snowboard.globalEvent("ajaxUpdateComplete",s,this),t()}))}processResponse(e){if((!this.options.success||"function"!=typeof this.options.success||!1!==this.options.success(this.responseData,this))&&!1!==this.snowboard.globalEvent("ajaxSuccess",this.responseData,this)){if(this.element){const e=new Event("ajaxDone",{cancelable:!0});if(e.responseData=this.responseData,e.request=this,this.element.dispatchEvent(e),e.defaultPrevented)return}this.flash&&e.X_WINTER_FLASH_MESSAGES&&this.processFlashMessages(e.X_WINTER_FLASH_MESSAGES),this.redirect||e.X_WINTER_REDIRECT?this.processRedirect(this.redirect||e.X_WINTER_REDIRECT):this.complete()}}processError(e){if((!this.options.error||"function"!=typeof this.options.error||!1!==this.options.error(this.responseError,this))&&!1!==this.snowboard.globalEvent("ajaxError",this.responseError,this)){if(this.element){const e=new Event("ajaxFail",{cancelable:!0});if(e.responseError=this.responseError,e.request=this,this.element.dispatchEvent(e),e.defaultPrevented)return}if(e instanceof Error)this.processErrorMessage(e.message);else{let t=!1;e.X_WINTER_ERROR_FIELDS&&(t=this.processValidationErrors(e.X_WINTER_ERROR_FIELDS)),e.X_WINTER_ERROR_MESSAGE&&!t&&this.processErrorMessage(e.X_WINTER_ERROR_MESSAGE)}this.complete()}}processRedirect(e){"function"==typeof this.options.handleRedirectResponse&&!1===this.options.handleRedirectResponse.apply(this,[e])||!1!==this.snowboard.globalEvent("ajaxRedirect",e,this)&&(window.addEventListener("popstate",(()=>{if(this.element){const e=document.createEvent("CustomEvent");e.eventName="ajaxRedirected",this.element.dispatchEvent(e)}}),{once:!0}),window.location.assign(e))}processErrorMessage(e){"function"==typeof this.options.handleErrorMessage&&!1===this.options.handleErrorMessage.apply(this,[e])||!1!==this.snowboard.globalEvent("ajaxErrorMessage",e,this)&&window.alert(e)}processFlashMessages(e){"function"==typeof this.options.handleFlashMessages&&!1===this.options.handleFlashMessages.apply(this,[e])||this.snowboard.globalEvent("ajaxFlashMessages",e,this)}processValidationErrors(e){return"function"==typeof this.options.handleValidationErrors&&!1===this.options.handleValidationErrors.apply(this,[this.form,e])||!1===this.snowboard.globalEvent("ajaxValidationErrors",this.form,e,this)}processAssets(e){return this.snowboard.globalPromiseEvent("ajaxLoadAssets",e)}async doConfirm(){if("function"==typeof this.options.handleConfirmMessage)return!1!==this.options.handleConfirmMessage.apply(this,[this.confirm]);if(0===this.snowboard.listensToEvent("ajaxConfirmMessage").length)return window.confirm(this.confirm);const e=this.snowboard.globalPromiseEvent("ajaxConfirmMessage",this.confirm,this);try{if(await e)return!0}catch(e){return!1}return!1}complete(){if(this.options.complete&&"function"==typeof this.options.complete&&this.options.complete(this.responseData,this),this.snowboard.globalEvent("ajaxDone",this.responseData,this),this.element){const e=new Event("ajaxAlways");e.request=this,e.responseData=this.responseData,e.responseError=this.responseError,this.element.dispatchEvent(e)}this.destruct()}get form(){return this.options.form?"string"==typeof this.options.form?document.querySelector(this.options.form):this.options.form:this.element?"FORM"===this.element.tagName?this.element:this.element.closest("form"):null}get context(){return{handler:this.handler,options:this.options}}get headers(){const e={"X-Requested-With":"XMLHttpRequest","X-WINTER-REQUEST-HANDLER":this.handler,"X-WINTER-REQUEST-PARTIALS":this.extractPartials(this.options.update||[])};return this.flash&&(e["X-WINTER-REQUEST-FLASH"]=1),this.xsrfToken&&(e["X-XSRF-TOKEN"]=this.xsrfToken),e}get loading(){return this.options.loading||!1}get url(){return this.options.url||window.location.href}get redirect(){return this.options.redirect&&this.options.redirect.length?this.options.redirect:null}get flash(){return this.options.flash||!1}get files(){return!0===this.options.files&&(void 0!==FormData||(this.snowboard.debug("This browser does not support file uploads"),!1))}get xsrfToken(){return this.snowboard.cookie().get("XSRF-TOKEN")}get data(){const e="object"==typeof this.options.data?this.options.data:{},t=new FormData(this.form||void 0);return Object.keys(e).length>0&&Object.entries(e).forEach((e=>{const[s,i]=e;t.append(s,i)})),t}get confirm(){return this.options.confirm||!1}extractPartials(e){return Object.keys(e).join("&")}renderError(e,t,s,i,n){const r=new Error(e);return r.exception=t||null,r.file=s||null,r.line=i||null,r.trace=n||[],r}isHandlerName(e){return/^(?:\w+:{2})?on[A-Z0-9]/.test(e)}}if(void 0===window.Snowboard)throw new Error("Snowboard must be loaded in order to use the Javascript AJAX request feature.");window.Snowboard.addPlugin("request",a)}},function(e){var t=function(t){return e(e.s=t)};e.O(0,[109],(function(){return t(236),t(640),t(136)}));e.O()}]); \ No newline at end of file +"use strict";(self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[]).push([[290,243,988],{553:function(e,t,s){s.d(t,{Z:function(){return n}});var i=s(640);class n extends i.eG{dependencies(){return["request"]}listens(){return{ajaxStart:"ajaxStart",ajaxDone:"ajaxDone"}}ajaxStart(e,t){if(t.element)if("FORM"===t.element.tagName){const e=t.element.querySelectorAll("[data-attach-loading]");e.length>0&&e.forEach((e=>{e.classList.add(this.getLoadingClass(e))}))}else void 0!==t.element.dataset.attachLoading&&t.element.classList.add(this.getLoadingClass(t.element))}ajaxDone(e,t){if(t.element)if("FORM"===t.element.tagName){const e=t.element.querySelectorAll("[data-attach-loading]");e.length>0&&e.forEach((e=>{e.classList.remove(this.getLoadingClass(e))}))}else void 0!==t.element.dataset.attachLoading&&t.element.classList.remove(this.getLoadingClass(t.element))}getLoadingClass(e){return void 0!==e.dataset.attachLoading&&""!==e.dataset.attachLoading?e.dataset.attachLoading:"wn-loading"}}},270:function(e,t,s){s.d(t,{Z:function(){return n}});var i=s(640);class n extends i.NG{construct(e,t,s){if(this.message=e,this.type=t||"default",this.duration=Number(s||7),this.duration<0)throw new Error("Flash duration must be a positive number, or zero");this.clear(),this.timer=null,this.flashTimer=null,this.create()}dependencies(){return["transition"]}destruct(){null!==this.timer&&window.clearTimeout(this.timer),this.flashTimer&&this.flashTimer.remove(),this.flash&&(this.flash.remove(),this.flash=null,this.flashTimer=null),super.destruct()}create(){this.snowboard.globalEvent("flash.create",this),this.flash=document.createElement("DIV"),this.flash.innerHTML=this.message,this.flash.classList.add("flash-message",this.type),this.flash.removeAttribute("data-control"),this.flash.addEventListener("click",(()=>this.remove())),this.flash.addEventListener("mouseover",(()=>this.stopTimer())),this.flash.addEventListener("mouseout",(()=>this.startTimer())),this.duration>0?(this.flashTimer=document.createElement("DIV"),this.flashTimer.classList.add("flash-timer"),this.flash.appendChild(this.flashTimer)):this.flash.classList.add("no-timer"),document.body.appendChild(this.flash),this.snowboard.transition(this.flash,"show",(()=>{this.startTimer()}))}remove(){this.snowboard.globalEvent("flash.remove",this),this.stopTimer(),this.snowboard.transition(this.flash,"hide",(()=>{this.flash.remove(),this.flash=null,this.destruct()}))}clear(){document.querySelectorAll("body > div.flash-message").forEach((e=>e.remove()))}startTimer(){0!==this.duration&&(this.timerTrans=this.snowboard.transition(this.flashTimer,"timeout",null,`${this.duration}.0s`,!0),this.timer=window.setTimeout((()=>this.remove()),1e3*this.duration))}stopTimer(){this.timerTrans&&this.timerTrans.cancel(),this.timer&&window.clearTimeout(this.timer)}}},277:function(e,t,s){s.d(t,{Z:function(){return n}});var i=s(640);class n extends i.eG{dependencies(){return["request"]}listens(){return{ready:"ready",ajaxStart:"ajaxStart"}}ready(){this.counter=0,this.createStripe()}ajaxStart(e,t){!1!==t.options.stripe&&(this.show(),e.then((()=>{this.hide()})).catch((()=>{this.hide()})))}createStripe(){this.indicator=document.createElement("DIV"),this.stripe=document.createElement("DIV"),this.stripeLoaded=document.createElement("DIV"),this.indicator.classList.add("stripe-loading-indicator","loaded"),this.stripe.classList.add("stripe"),this.stripeLoaded.classList.add("stripe-loaded"),this.indicator.appendChild(this.stripe),this.indicator.appendChild(this.stripeLoaded),document.body.appendChild(this.indicator)}show(){this.counter+=1;const e=this.stripe.cloneNode(!0);this.indicator.appendChild(e),this.stripe.remove(),this.stripe=e,this.counter>1||(this.indicator.classList.remove("loaded"),document.body.classList.add("wn-loading"))}hide(e){this.counter-=1,!0===e&&(this.counter=0),this.counter<=0&&(this.indicator.classList.add("loaded"),document.body.classList.remove("wn-loading"))}}},32:function(e,t,s){s.d(t,{Z:function(){return n}});var i=s(640);class n extends i.eG{listens(){return{ready:"ready"}}ready(){let e=!1;if(document.querySelectorAll('link[rel="stylesheet"]').forEach((t=>{t.href.endsWith("/modules/system/assets/css/snowboard.extras.css")&&(e=!0)})),!e){const e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("href",this.snowboard.url().asset("/modules/system/assets/css/snowboard.extras.css")),document.head.appendChild(e)}}}},269:function(e,t,s){s.d(t,{Z:function(){return n}});var i=s(640);class n extends i.NG{construct(e,t,s,i,n){if(e instanceof HTMLElement==!1)throw new Error("A HTMLElement must be provided for transitioning");if(this.element=e,"string"!=typeof t)throw new Error("Transition name must be specified as a string");if(this.transition=t,s&&"function"!=typeof s)throw new Error("Callback must be a valid function");this.callback=s,this.duration=i?this.parseDuration(i):null,this.trailTo=!0===n,this.doTransition()}eventClasses(){for(var e=arguments.length,t=new Array(e),s=0;s{const[s,i]=e;-1!==t.indexOf(s)&&n.push(i)})),n}doTransition(){null!==this.duration&&(this.element.style.transitionDuration=this.duration),this.resetClasses(),this.eventClasses("in","active").forEach((e=>{this.element.classList.add(e)})),window.requestAnimationFrame((()=>{"0s"!==window.getComputedStyle(this.element)["transition-duration"]?(this.element.addEventListener("transitionend",(()=>this.onTransitionEnd()),{once:!0}),window.requestAnimationFrame((()=>{this.element.classList.remove(this.eventClasses("in")[0]),this.element.classList.add(this.eventClasses("out")[0])}))):(this.resetClasses(),this.callback&&this.callback.apply(this.element),this.destruct())}))}onTransitionEnd(){this.eventClasses("active",this.trailTo?"":"out").forEach((e=>{this.element.classList.remove(e)})),this.callback&&this.callback.apply(this.element),null!==this.duration&&(this.element.style.transitionDuration=null),this.destruct()}cancel(){this.element.removeEventListener("transitionend",(()=>this.onTransitionEnd),{once:!0}),this.resetClasses(),null!==this.duration&&(this.element.style.transitionDuration=null),this.destruct()}resetClasses(){this.eventClasses().forEach((e=>{this.element.classList.remove(e)}))}parseDuration(e){const t=/^([0-9]+(\.[0-9]+)?)(m?s)?$/.exec(e),s=Number(t[1]);return"sec"===("s"===t[3]?"sec":"msec")?1e3*s+"ms":`${Math.floor(s)}ms`}}},136:function(e,t,s){var i,n=s(270),r=s(269),o=s(553),a=s(277),h=s(32);if(void 0===window.Snowboard)throw new Error("Snowboard must be loaded in order to use the extra plugins.");(i=window.Snowboard).addPlugin("extrasStyles",h.Z),i.addPlugin("transition",r.Z),i.addPlugin("flash",n.Z),i.addPlugin("attachLoading",o.Z),i.addPlugin("stripeLoader",a.Z)},236:function(e,t,s){var i=s(640);(e=>{const t=new i.Jc;e.snowboard=t,e.Snowboard=t,e.SnowBoard=t})(window)},329:function(e,t,s){var i=s(640);function n(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,i)}return s}function r(e){for(var t=1;t{e&&this.doAjax().then((e=>{if(e.cancelled)return this.cancelled=!0,void this.complete();this.responseData=e,this.processUpdate(e).then((()=>{!1===e.X_WINTER_SUCCESS?this.processError(e):this.processResponse(e)}))}),(e=>{this.responseError=e,this.processError(e)}))})):this.doAjax().then((e=>{if(e.cancelled)return this.cancelled=!0,void this.complete();this.responseData=e,this.processUpdate(e).then((()=>{!1===e.X_WINTER_SUCCESS?this.processError(e):this.processResponse(e)}))}),(e=>{this.responseError=e,this.processError(e)})):this.cancelled=!0}else this.cancelled=!0}dependencies(){return["cookie","jsonParser"]}checkRequest(){if(this.element&&this.element instanceof Element==!1)throw new Error("The element provided must be an Element instance");if(void 0===this.handler)throw new Error("The AJAX handler name is not specified.");if(!this.isHandlerName(this.handler))throw new Error('Invalid AJAX handler name. The correct handler name format is: "onEvent".')}getFetch(){return this.fetchOptions=void 0!==this.options.fetchOptions&&"object"==typeof this.options.fetchOptions?this.options.fetchOptions:{method:"POST",headers:this.headers,body:this.data,redirect:"follow",mode:"same-origin"},this.snowboard.globalEvent("ajaxFetchOptions",this.fetchOptions,this),fetch(this.url,this.fetchOptions)}doClientValidation(){return!0!==this.options.browserValidate||!this.form||!1!==this.form.checkValidity()||(this.form.reportValidity(),!1)}doAjax(){if(!1===this.snowboard.globalEvent("ajaxBeforeSend",this))return Promise.resolve({cancelled:!0});const e=new Promise(((e,t)=>{this.getFetch().then((s=>{s.ok||406===s.status?s.headers.has("Content-Type")&&s.headers.get("Content-Type").includes("/json")?s.json().then((t=>{e(r(r({},t),{},{X_WINTER_SUCCESS:406!==s.status,X_WINTER_RESPONSE_CODE:s.status}))}),(e=>{t(this.renderError(`Unable to parse JSON response: ${e}`))})):s.text().then((t=>{e(t)}),(e=>{t(this.renderError(`Unable to process response: ${e}`))})):s.headers.has("Content-Type")&&s.headers.get("Content-Type").includes("/json")?s.json().then((e=>{e.message&&e.exception?t(this.renderError(e.message,e.exception,e.file,e.line,e.trace)):t(e)}),(e=>{t(this.renderError(`Unable to parse JSON response: ${e}`))})):s.text().then((e=>{t(this.renderError(e))}),(e=>{t(this.renderError(`Unable to process response: ${e}`))}))}),(e=>{t(this.renderError(`Unable to retrieve a response from the server: ${e}`))}))}));if(this.snowboard.globalEvent("ajaxStart",e,this),this.element){const t=new Event("ajaxPromise");t.promise=e,this.element.dispatchEvent(t)}return e}processUpdate(e){return new Promise(((t,s)=>{if("function"==typeof this.options.beforeUpdate&&!1===this.options.beforeUpdate.apply(this,[e]))return void t();const i={};if(Object.entries(e).forEach((e=>{const[t,s]=e;"X_WINTER"!==t.substr(0,8)&&(i[t]=s)})),0===Object.keys(i).length)return void(e.X_WINTER_ASSETS?this.processAssets(e.X_WINTER_ASSETS).then((()=>{t()}),(()=>{s()})):t());this.snowboard.globalPromiseEvent("ajaxBeforeUpdate",e,this).then((async()=>{e.X_WINTER_ASSETS&&await this.processAssets(e.X_WINTER_ASSETS),this.doUpdate(i).then((()=>{window.requestAnimationFrame((()=>t()))}),(()=>{s()}))}),(()=>{t()}))}))}doUpdate(e){return new Promise((t=>{const s=[];Object.entries(e).forEach((e=>{const[t,i]=e;let n=this.options.update&&this.options.update[t]?this.options.update[t]:t,r="replace";"@"===n.substr(0,1)?(r="append",n=n.substr(1)):"^"===n.substr(0,1)?(r="prepend",n=n.substr(1)):"#"!==n.substr(0,1)&&"."!==n.substr(0,1)&&(r="noop");const o=document.querySelectorAll(n);o.length>0&&o.forEach((e=>{switch(r){case"append":e.innerHTML+=i;break;case"prepend":e.innerHTML=i+e.innerHTML;break;case"noop":break;default:e.innerHTML=i}s.push(e),this.snowboard.globalEvent("ajaxUpdate",e,i,this);const t=new Event("ajaxUpdate");t.content=i,e.dispatchEvent(t)}))})),this.snowboard.globalEvent("ajaxUpdateComplete",s,this),t()}))}processResponse(e){if((!this.options.success||"function"!=typeof this.options.success||!1!==this.options.success(this.responseData,this))&&!1!==this.snowboard.globalEvent("ajaxSuccess",this.responseData,this)){if(this.element){const e=new Event("ajaxDone",{cancelable:!0});if(e.responseData=this.responseData,e.request=this,this.element.dispatchEvent(e),e.defaultPrevented)return}this.flash&&e.X_WINTER_FLASH_MESSAGES&&this.processFlashMessages(e.X_WINTER_FLASH_MESSAGES),this.redirect||e.X_WINTER_REDIRECT?this.processRedirect(this.redirect||e.X_WINTER_REDIRECT):this.complete()}}processError(e){if((!this.options.error||"function"!=typeof this.options.error||!1!==this.options.error(this.responseError,this))&&!1!==this.snowboard.globalEvent("ajaxError",this.responseError,this)){if(this.element){const e=new Event("ajaxFail",{cancelable:!0});if(e.responseError=this.responseError,e.request=this,this.element.dispatchEvent(e),e.defaultPrevented)return}if(e instanceof Error)this.processErrorMessage(e.message);else{let t=!1;e.X_WINTER_ERROR_FIELDS&&(t=this.processValidationErrors(e.X_WINTER_ERROR_FIELDS)),e.X_WINTER_ERROR_MESSAGE&&!t&&this.processErrorMessage(e.X_WINTER_ERROR_MESSAGE)}this.complete()}}processRedirect(e){"function"==typeof this.options.handleRedirectResponse&&!1===this.options.handleRedirectResponse.apply(this,[e])||!1!==this.snowboard.globalEvent("ajaxRedirect",e,this)&&(window.addEventListener("popstate",(()=>{if(this.element){const e=document.createEvent("CustomEvent");e.eventName="ajaxRedirected",this.element.dispatchEvent(e)}}),{once:!0}),window.location.assign(e))}processErrorMessage(e){"function"==typeof this.options.handleErrorMessage&&!1===this.options.handleErrorMessage.apply(this,[e])||!1!==this.snowboard.globalEvent("ajaxErrorMessage",e,this)&&window.alert(e)}processFlashMessages(e){"function"==typeof this.options.handleFlashMessages&&!1===this.options.handleFlashMessages.apply(this,[e])||this.snowboard.globalEvent("ajaxFlashMessages",e,this)}processValidationErrors(e){return"function"==typeof this.options.handleValidationErrors&&!1===this.options.handleValidationErrors.apply(this,[this.form,e])||!1===this.snowboard.globalEvent("ajaxValidationErrors",this.form,e,this)}processAssets(e){return this.snowboard.globalPromiseEvent("ajaxLoadAssets",e)}async doConfirm(){if("function"==typeof this.options.handleConfirmMessage)return!1!==this.options.handleConfirmMessage.apply(this,[this.confirm]);if(0===this.snowboard.listensToEvent("ajaxConfirmMessage").length)return window.confirm(this.confirm);const e=this.snowboard.globalPromiseEvent("ajaxConfirmMessage",this.confirm,this);try{if(await e)return!0}catch(e){return!1}return!1}complete(){if(this.options.complete&&"function"==typeof this.options.complete&&this.options.complete(this.responseData,this),this.snowboard.globalEvent("ajaxDone",this.responseData,this),this.element){const e=new Event("ajaxAlways");e.request=this,e.responseData=this.responseData,e.responseError=this.responseError,this.element.dispatchEvent(e)}this.destruct()}get form(){return this.options.form?"string"==typeof this.options.form?document.querySelector(this.options.form):this.options.form:this.element?"FORM"===this.element.tagName?this.element:this.element.closest("form"):null}get context(){return{handler:this.handler,options:this.options}}get headers(){const e={"X-Requested-With":"XMLHttpRequest","X-WINTER-REQUEST-HANDLER":this.handler,"X-WINTER-REQUEST-PARTIALS":this.extractPartials(this.options.update||[])};return this.flash&&(e["X-WINTER-REQUEST-FLASH"]=1),this.xsrfToken&&(e["X-XSRF-TOKEN"]=this.xsrfToken),e}get loading(){return this.options.loading||!1}get url(){return this.options.url||window.location.href}get redirect(){return this.options.redirect&&this.options.redirect.length?this.options.redirect:null}get flash(){return this.options.flash||!1}get files(){return!0===this.options.files&&(void 0!==FormData||(this.snowboard.debug("This browser does not support file uploads"),!1))}get xsrfToken(){return this.snowboard.cookie().get("XSRF-TOKEN")}get data(){const e="object"==typeof this.options.data?this.options.data:{},t=new FormData(this.form||void 0);return Object.keys(e).length>0&&Object.entries(e).forEach((e=>{const[s,i]=e;t.append(s,i)})),t}get confirm(){return this.options.confirm||!1}extractPartials(e){return Object.keys(e).join("&")}renderError(e,t,s,i,n){const r=new Error(e);return r.exception=t||null,r.file=s||null,r.line=i||null,r.trace=n||[],r}isHandlerName(e){return/^(?:\w+:{2})?on[A-Z0-9]/.test(e)}}if(void 0===window.Snowboard)throw new Error("Snowboard must be loaded in order to use the Javascript AJAX request feature.");window.Snowboard.addPlugin("request",a)}},function(e){var t=function(t){return e(e.s=t)};e.O(0,[109],(function(){return t(236),t(329),t(136)}));e.O()}]); \ No newline at end of file diff --git a/modules/system/assets/js/snowboard/build/snowboard.base.debug.js b/modules/system/assets/js/snowboard/build/snowboard.base.debug.js index 468f6cb15..c6a3e3174 100644 --- a/modules/system/assets/js/snowboard/build/snowboard.base.debug.js +++ b/modules/system/assets/js/snowboard/build/snowboard.base.debug.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[]).push([[450],{165:function(n,s,e){var o=e(579);(n=>{const s=new o.Jc(!0);n.snowboard=s,n.Snowboard=s,n.SnowBoard=s})(window)}},function(n){n.O(0,[109],(function(){return s=165,n(n.s=s);var s}));n.O()}]); \ No newline at end of file +"use strict";(self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[]).push([[450],{165:function(n,s,e){var o=e(640);(n=>{const s=new o.Jc(!0);n.snowboard=s,n.Snowboard=s,n.SnowBoard=s})(window)}},function(n){n.O(0,[109],(function(){return s=165,n(n.s=s);var s}));n.O()}]); \ No newline at end of file diff --git a/modules/system/assets/js/snowboard/build/snowboard.base.js b/modules/system/assets/js/snowboard/build/snowboard.base.js index 3cbe0d689..3a9f7bed0 100644 --- a/modules/system/assets/js/snowboard/build/snowboard.base.js +++ b/modules/system/assets/js/snowboard/build/snowboard.base.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[]).push([[243],{236:function(n,s,e){var o=e(579);(n=>{const s=new o.Jc;n.snowboard=s,n.Snowboard=s,n.SnowBoard=s})(window)}},function(n){n.O(0,[109],(function(){return s=236,n(n.s=s);var s}));n.O()}]); \ No newline at end of file +"use strict";(self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[]).push([[243],{236:function(n,s,e){var o=e(640);(n=>{const s=new o.Jc;n.snowboard=s,n.Snowboard=s,n.SnowBoard=s})(window)}},function(n){n.O(0,[109],(function(){return s=236,n(n.s=s);var s}));n.O()}]); \ No newline at end of file diff --git a/modules/system/assets/js/snowboard/build/snowboard.data-attr.js b/modules/system/assets/js/snowboard/build/snowboard.data-attr.js index 35bc67abf..085f7e4f1 100644 --- a/modules/system/assets/js/snowboard/build/snowboard.data-attr.js +++ b/modules/system/assets/js/snowboard/build/snowboard.data-attr.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[]).push([[806],{974:function(e,t,r){var a=r(579);function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function s(e){for(var t=1;tthis.changeHandler(e))),window.addEventListener("click",(e=>this.clickHandler(e))),window.addEventListener("keydown",(e=>this.keyDownHandler(e))),window.addEventListener("submit",(e=>this.submitHandler(e)))}disableDefaultFormValidation(){document.querySelectorAll("form[data-request]:not([data-browser-validate])").forEach((e=>{e.setAttribute("novalidate",!0)}))}detachHandlers(){window.removeEventListener("change",(e=>this.changeHandler(e))),window.removeEventListener("click",(e=>this.clickHandler(e))),window.removeEventListener("keydown",(e=>this.keyDownHandler(e))),window.removeEventListener("submit",(e=>this.submitHandler(e)))}changeHandler(e){e.target.matches("select[data-request], input[type=radio][data-request], input[type=checkbox][data-request], input[type=file][data-request]")&&this.processRequestOnElement(e.target)}clickHandler(e){let t=e.target;for(;t&&"HTML"!==t.tagName;){if(t.matches("a[data-request], button[data-request], input[type=button][data-request], input[type=submit][data-request]")){e.preventDefault(),this.processRequestOnElement(t);break}t=t.parentElement}}keyDownHandler(e){if(!e.target.matches("input"))return;-1!==["checkbox","color","date","datetime","datetime-local","email","image","month","number","password","radio","range","search","tel","text","time","url","week"].indexOf(e.target.getAttribute("type"))&&("Enter"===e.key&&e.target.matches("*[data-request]")?(this.processRequestOnElement(e.target),e.preventDefault(),e.stopImmediatePropagation()):e.target.matches("*[data-track-input]")&&this.trackInput(e.target))}submitHandler(e){e.target.matches("form[data-request]")&&(e.preventDefault(),this.processRequestOnElement(e.target))}processRequestOnElement(e){const t=e.dataset,r=String(t.request),a={confirm:"requestConfirm"in t?String(t.requestConfirm):null,redirect:"requestRedirect"in t?String(t.requestRedirect):null,loading:"requestLoading"in t?String(t.requestLoading):null,flash:"requestFlash"in t,files:"requestFiles"in t,browserValidate:"requestBrowserValidate"in t,form:"requestForm"in t?String(t.requestForm):null,url:"requestUrl"in t?String(t.requestUrl):null,update:"requestUpdate"in t?this.parseData(String(t.requestUpdate)):[],data:"requestData"in t?this.parseData(String(t.requestData)):[]};this.snowboard.request(e,r,a)}onAjaxSetup(e){if(!e.element)return;const t=e.element.getAttribute("name"),r=s(s({},this.getParentRequestData(e.element)),e.options.data);e.element&&e.element.matches("input, textarea, select, button")&&!e.form&&t&&!e.options.data[t]&&(r[t]=e.element.value),e.options.data=r}getParentRequestData(e){const t=[];let r={},a=e;for(;a.parentElement&&"HTML"!==a.parentElement.tagName;)t.push(a.parentElement),a=a.parentElement;return t.reverse(),t.forEach((e=>{const t=e.dataset;"requestData"in t&&(r=s(s({},r),this.parseData(t.requestData)))})),r}parseData(e){let t;if(void 0===e&&(t=""),"object"==typeof t)return t;try{return this.snowboard.jsonparser().parse(`{${e}}`)}catch(e){throw new Error(`Error parsing the data attribute on element: ${e.message}`)}}trackInput(e){const{lastValue:t}=e.dataset,r=e.dataset.trackInput||300;void 0!==t&&t===e.value||(this.resetTrackInputTimer(e),e.dataset.inputTimer=window.setTimeout((()=>{if(e.dataset.request)return void this.processRequestOnElement(e);let t=e;for(;t.parentElement&&"HTML"!==t.parentElement.tagName;)if(t=t.parentElement,"FORM"===t.tagName&&t.dataset.request){this.processRequestOnElement(t);break}}),r))}resetTrackInputTimer(e){e.dataset.inputTimer&&(window.clearTimeout(e.dataset.inputTimer),e.dataset.inputTimer=null)}}if(void 0===window.Snowboard)throw new Error("Snowboard must be loaded in order to use the HTML data attribute AJAX request feature.");window.Snowboard.addPlugin("attributeRequest",o)}},function(e){e.O(0,[109],(function(){return t=974,e(e.s=t);var t}));e.O()}]); \ No newline at end of file +"use strict";(self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[]).push([[806],{974:function(e,t,r){var a=r(640);function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function s(e){for(var t=1;tthis.changeHandler(e))),window.addEventListener("click",(e=>this.clickHandler(e))),window.addEventListener("keydown",(e=>this.keyDownHandler(e))),window.addEventListener("submit",(e=>this.submitHandler(e)))}disableDefaultFormValidation(){document.querySelectorAll("form[data-request]:not([data-browser-validate])").forEach((e=>{e.setAttribute("novalidate",!0)}))}detachHandlers(){window.removeEventListener("change",(e=>this.changeHandler(e))),window.removeEventListener("click",(e=>this.clickHandler(e))),window.removeEventListener("keydown",(e=>this.keyDownHandler(e))),window.removeEventListener("submit",(e=>this.submitHandler(e)))}changeHandler(e){e.target.matches("select[data-request], input[type=radio][data-request], input[type=checkbox][data-request], input[type=file][data-request]")&&this.processRequestOnElement(e.target)}clickHandler(e){let t=e.target;for(;t&&"HTML"!==t.tagName;){if(t.matches("a[data-request], button[data-request], input[type=button][data-request], input[type=submit][data-request]")){e.preventDefault(),this.processRequestOnElement(t);break}t=t.parentElement}}keyDownHandler(e){if(!e.target.matches("input"))return;-1!==["checkbox","color","date","datetime","datetime-local","email","image","month","number","password","radio","range","search","tel","text","time","url","week"].indexOf(e.target.getAttribute("type"))&&("Enter"===e.key&&e.target.matches("*[data-request]")?(this.processRequestOnElement(e.target),e.preventDefault(),e.stopImmediatePropagation()):e.target.matches("*[data-track-input]")&&this.trackInput(e.target))}submitHandler(e){e.target.matches("form[data-request]")&&(e.preventDefault(),this.processRequestOnElement(e.target))}processRequestOnElement(e){const t=e.dataset,r=String(t.request),a={confirm:"requestConfirm"in t?String(t.requestConfirm):null,redirect:"requestRedirect"in t?String(t.requestRedirect):null,loading:"requestLoading"in t?String(t.requestLoading):null,flash:"requestFlash"in t,files:"requestFiles"in t,browserValidate:"requestBrowserValidate"in t,form:"requestForm"in t?String(t.requestForm):null,url:"requestUrl"in t?String(t.requestUrl):null,update:"requestUpdate"in t?this.parseData(String(t.requestUpdate)):[],data:"requestData"in t?this.parseData(String(t.requestData)):[]};this.snowboard.request(e,r,a)}onAjaxSetup(e){if(!e.element)return;const t=e.element.getAttribute("name"),r=s(s({},this.getParentRequestData(e.element)),e.options.data);e.element&&e.element.matches("input, textarea, select, button")&&!e.form&&t&&!e.options.data[t]&&(r[t]=e.element.value),e.options.data=r}getParentRequestData(e){const t=[];let r={},a=e;for(;a.parentElement&&"HTML"!==a.parentElement.tagName;)t.push(a.parentElement),a=a.parentElement;return t.reverse(),t.forEach((e=>{const t=e.dataset;"requestData"in t&&(r=s(s({},r),this.parseData(t.requestData)))})),r}parseData(e){let t;if(void 0===e&&(t=""),"object"==typeof t)return t;try{return this.snowboard.jsonparser().parse(`{${e}}`)}catch(e){throw new Error(`Error parsing the data attribute on element: ${e.message}`)}}trackInput(e){const{lastValue:t}=e.dataset,r=e.dataset.trackInput||300;void 0!==t&&t===e.value||(this.resetTrackInputTimer(e),e.dataset.inputTimer=window.setTimeout((()=>{if(e.dataset.request)return void this.processRequestOnElement(e);let t=e;for(;t.parentElement&&"HTML"!==t.parentElement.tagName;)if(t=t.parentElement,"FORM"===t.tagName&&t.dataset.request){this.processRequestOnElement(t);break}}),r))}resetTrackInputTimer(e){e.dataset.inputTimer&&(window.clearTimeout(e.dataset.inputTimer),e.dataset.inputTimer=null)}}if(void 0===window.Snowboard)throw new Error("Snowboard must be loaded in order to use the HTML data attribute AJAX request feature.");window.Snowboard.addPlugin("attributeRequest",o)}},function(e){e.O(0,[109],(function(){return t=974,e(e.s=t);var t}));e.O()}]); \ No newline at end of file diff --git a/modules/system/assets/js/snowboard/build/snowboard.extras.js b/modules/system/assets/js/snowboard/build/snowboard.extras.js index 6b35892c6..6978b1823 100644 --- a/modules/system/assets/js/snowboard/build/snowboard.extras.js +++ b/modules/system/assets/js/snowboard/build/snowboard.extras.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[]).push([[459],{553:function(e,t,s){s.d(t,{Z:function(){return i}});var a=s(579);class i extends a.eG{dependencies(){return["request"]}listens(){return{ajaxStart:"ajaxStart",ajaxDone:"ajaxDone"}}ajaxStart(e,t){if(t.element)if("FORM"===t.element.tagName){const e=t.element.querySelectorAll("[data-attach-loading]");e.length>0&&e.forEach((e=>{e.classList.add(this.getLoadingClass(e))}))}else void 0!==t.element.dataset.attachLoading&&t.element.classList.add(this.getLoadingClass(t.element))}ajaxDone(e,t){if(t.element)if("FORM"===t.element.tagName){const e=t.element.querySelectorAll("[data-attach-loading]");e.length>0&&e.forEach((e=>{e.classList.remove(this.getLoadingClass(e))}))}else void 0!==t.element.dataset.attachLoading&&t.element.classList.remove(this.getLoadingClass(t.element))}getLoadingClass(e){return void 0!==e.dataset.attachLoading&&""!==e.dataset.attachLoading?e.dataset.attachLoading:"wn-loading"}}},270:function(e,t,s){s.d(t,{Z:function(){return i}});var a=s(579);class i extends a.NG{construct(e,t,s){if(this.message=e,this.type=t||"default",this.duration=Number(s||7),this.duration<0)throw new Error("Flash duration must be a positive number, or zero");this.clear(),this.timer=null,this.flashTimer=null,this.create()}dependencies(){return["transition"]}destruct(){null!==this.timer&&window.clearTimeout(this.timer),this.flashTimer&&this.flashTimer.remove(),this.flash&&(this.flash.remove(),this.flash=null,this.flashTimer=null),super.destruct()}create(){this.snowboard.globalEvent("flash.create",this),this.flash=document.createElement("DIV"),this.flash.innerHTML=this.message,this.flash.classList.add("flash-message",this.type),this.flash.removeAttribute("data-control"),this.flash.addEventListener("click",(()=>this.remove())),this.flash.addEventListener("mouseover",(()=>this.stopTimer())),this.flash.addEventListener("mouseout",(()=>this.startTimer())),this.duration>0?(this.flashTimer=document.createElement("DIV"),this.flashTimer.classList.add("flash-timer"),this.flash.appendChild(this.flashTimer)):this.flash.classList.add("no-timer"),document.body.appendChild(this.flash),this.snowboard.transition(this.flash,"show",(()=>{this.startTimer()}))}remove(){this.snowboard.globalEvent("flash.remove",this),this.stopTimer(),this.snowboard.transition(this.flash,"hide",(()=>{this.flash.remove(),this.flash=null,this.destruct()}))}clear(){document.querySelectorAll("body > div.flash-message").forEach((e=>e.remove()))}startTimer(){0!==this.duration&&(this.timerTrans=this.snowboard.transition(this.flashTimer,"timeout",null,`${this.duration}.0s`,!0),this.timer=window.setTimeout((()=>this.remove()),1e3*this.duration))}stopTimer(){this.timerTrans&&this.timerTrans.cancel(),this.timer&&window.clearTimeout(this.timer)}}},277:function(e,t,s){s.d(t,{Z:function(){return i}});var a=s(579);class i extends a.eG{dependencies(){return["request"]}listens(){return{ready:"ready",ajaxStart:"ajaxStart"}}ready(){this.counter=0,this.createStripe()}ajaxStart(e,t){!1!==t.options.stripe&&(this.show(),e.then((()=>{this.hide()})).catch((()=>{this.hide()})))}createStripe(){this.indicator=document.createElement("DIV"),this.stripe=document.createElement("DIV"),this.stripeLoaded=document.createElement("DIV"),this.indicator.classList.add("stripe-loading-indicator","loaded"),this.stripe.classList.add("stripe"),this.stripeLoaded.classList.add("stripe-loaded"),this.indicator.appendChild(this.stripe),this.indicator.appendChild(this.stripeLoaded),document.body.appendChild(this.indicator)}show(){this.counter+=1;const e=this.stripe.cloneNode(!0);this.indicator.appendChild(e),this.stripe.remove(),this.stripe=e,this.counter>1||(this.indicator.classList.remove("loaded"),document.body.classList.add("wn-loading"))}hide(e){this.counter-=1,!0===e&&(this.counter=0),this.counter<=0&&(this.indicator.classList.add("loaded"),document.body.classList.remove("wn-loading"))}}},32:function(e,t,s){s.d(t,{Z:function(){return i}});var a=s(579);class i extends a.eG{listens(){return{ready:"ready"}}ready(){let e=!1;if(document.querySelectorAll('link[rel="stylesheet"]').forEach((t=>{t.href.endsWith("/modules/system/assets/css/snowboard.extras.css")&&(e=!0)})),!e){const e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("href",this.snowboard.url().asset("/modules/system/assets/css/snowboard.extras.css")),document.head.appendChild(e)}}}},269:function(e,t,s){s.d(t,{Z:function(){return i}});var a=s(579);class i extends a.NG{construct(e,t,s,a,i){if(e instanceof HTMLElement==!1)throw new Error("A HTMLElement must be provided for transitioning");if(this.element=e,"string"!=typeof t)throw new Error("Transition name must be specified as a string");if(this.transition=t,s&&"function"!=typeof s)throw new Error("Callback must be a valid function");this.callback=s,this.duration=a?this.parseDuration(a):null,this.trailTo=!0===i,this.doTransition()}eventClasses(){for(var e=arguments.length,t=new Array(e),s=0;s{const[s,a]=e;-1!==t.indexOf(s)&&i.push(a)})),i}doTransition(){null!==this.duration&&(this.element.style.transitionDuration=this.duration),this.resetClasses(),this.eventClasses("in","active").forEach((e=>{this.element.classList.add(e)})),window.requestAnimationFrame((()=>{"0s"!==window.getComputedStyle(this.element)["transition-duration"]?(this.element.addEventListener("transitionend",(()=>this.onTransitionEnd()),{once:!0}),window.requestAnimationFrame((()=>{this.element.classList.remove(this.eventClasses("in")[0]),this.element.classList.add(this.eventClasses("out")[0])}))):(this.resetClasses(),this.callback&&this.callback.apply(this.element),this.destruct())}))}onTransitionEnd(){this.eventClasses("active",this.trailTo?"":"out").forEach((e=>{this.element.classList.remove(e)})),this.callback&&this.callback.apply(this.element),null!==this.duration&&(this.element.style.transitionDuration=null),this.destruct()}cancel(){this.element.removeEventListener("transitionend",(()=>this.onTransitionEnd),{once:!0}),this.resetClasses(),null!==this.duration&&(this.element.style.transitionDuration=null),this.destruct()}resetClasses(){this.eventClasses().forEach((e=>{this.element.classList.remove(e)}))}parseDuration(e){const t=/^([0-9]+(\.[0-9]+)?)(m?s)?$/.exec(e),s=Number(t[1]);return"sec"===("s"===t[3]?"sec":"msec")?1e3*s+"ms":`${Math.floor(s)}ms`}}},820:function(e,t,s){var a=s(270),i=s(579);class r extends i.eG{dependencies(){return["flash"]}listens(){return{ready:"ready",ajaxErrorMessage:"ajaxErrorMessage",ajaxFlashMessages:"ajaxFlashMessages"}}ready(){document.querySelectorAll('[data-control="flash-message"]').forEach((e=>{this.snowboard.flash(e.innerHTML,e.dataset.flashType,e.dataset.flashDuration),e.remove()}))}ajaxErrorMessage(e){return this.snowboard.flash(e,"error"),!1}ajaxFlashMessages(e){return Object.entries(e).forEach((e=>{const[t,s]=e;this.snowboard.flash(s,t)})),!1}}class n extends i.eG{construct(){this.errorBags=[]}listens(){return{ready:"ready",ajaxStart:"clearValidation",ajaxValidationErrors:"doValidation"}}ready(){this.collectErrorBags(document)}doValidation(e,t,s){if(s.element&&void 0===s.element.dataset.requestValidate)return null;if(!e)return null;return this.errorBags.filter((t=>t.form===e)).forEach((e=>{this.showErrorBag(e,t)})),!1}clearValidation(e,t){if(t.element&&void 0===t.element.dataset.requestValidate)return;if(!t.form)return;this.errorBags.filter((e=>e.form===t.form)).forEach((e=>{this.hideErrorBag(e)}))}collectErrorBags(e){e.querySelectorAll("[data-validate-error], [data-validate-for]").forEach((e=>{const t=e.closest("form[data-request-validate]");if(!t)return void e.parentNode.removeChild(e);let s=null;e.matches("[data-validate-error]")&&(s=e.querySelector("[data-message]"));const a=document.createComment(""),i={element:e,form:t,validateFor:e.dataset.validateFor?e.dataset.validateFor.split(/\s*,\s*/):"*",placeholder:a,messageListElement:s?s.cloneNode(!0):null,messageListAnchor:null,customMessage:!!e.dataset.validateFor&&(""!==e.textContent||e.childNodes.length>0)};if(s){const e=document.createComment("");s.parentNode.replaceChild(e,s),i.messageListAnchor=e}e.parentNode.replaceChild(a,e),this.errorBags.push(i)}))}hideErrorBag(e){e.element.isConnected&&e.element.parentNode.replaceChild(e.placeholder,e.element)}showErrorBag(e,t){if(this.errorBagValidatesField(e,t))if(e.element.isConnected||e.placeholder.parentNode.replaceChild(e.element,e.placeholder),"*"!==e.validateFor){if(!e.customMessage){const s=Object.keys(t).filter((t=>e.validateFor.includes(t))).shift();[e.element.innerHTML]=t[s]}}else e.messageListElement?(e.element.querySelectorAll("[data-validation-message]").forEach((e=>{e.parentNode.removeChild(e)})),Object.entries(t).forEach((t=>{const[,s]=t;s.forEach((t=>{const s=e.messageListElement.cloneNode(!0);s.dataset.validationMessage="",s.innerHTML=t,e.messageListAnchor.after(s)}))}))):[e.element.innerHTML]=t[Object.keys(t).shift()]}errorBagValidatesField(e,t){return"*"===e.validateFor||Object.keys(t).filter((t=>e.validateFor.includes(t))).length>0}}var o,l=s(269),d=s(553),h=s(277),c=s(32);if(void 0===window.Snowboard)throw new Error("Snowboard must be loaded in order to use the extra plugins.");(o=window.Snowboard).addPlugin("extrasStyles",c.Z),o.addPlugin("transition",l.Z),o.addPlugin("flash",a.Z),o.addPlugin("flashListener",r),o.addPlugin("formValidation",n),o.addPlugin("attachLoading",d.Z),o.addPlugin("stripeLoader",h.Z)}},function(e){e.O(0,[109],(function(){return t=820,e(e.s=t);var t}));e.O()}]); \ No newline at end of file +"use strict";(self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[]).push([[459],{553:function(e,t,s){s.d(t,{Z:function(){return i}});var a=s(640);class i extends a.eG{dependencies(){return["request"]}listens(){return{ajaxStart:"ajaxStart",ajaxDone:"ajaxDone"}}ajaxStart(e,t){if(t.element)if("FORM"===t.element.tagName){const e=t.element.querySelectorAll("[data-attach-loading]");e.length>0&&e.forEach((e=>{e.classList.add(this.getLoadingClass(e))}))}else void 0!==t.element.dataset.attachLoading&&t.element.classList.add(this.getLoadingClass(t.element))}ajaxDone(e,t){if(t.element)if("FORM"===t.element.tagName){const e=t.element.querySelectorAll("[data-attach-loading]");e.length>0&&e.forEach((e=>{e.classList.remove(this.getLoadingClass(e))}))}else void 0!==t.element.dataset.attachLoading&&t.element.classList.remove(this.getLoadingClass(t.element))}getLoadingClass(e){return void 0!==e.dataset.attachLoading&&""!==e.dataset.attachLoading?e.dataset.attachLoading:"wn-loading"}}},270:function(e,t,s){s.d(t,{Z:function(){return i}});var a=s(640);class i extends a.NG{construct(e,t,s){if(this.message=e,this.type=t||"default",this.duration=Number(s||7),this.duration<0)throw new Error("Flash duration must be a positive number, or zero");this.clear(),this.timer=null,this.flashTimer=null,this.create()}dependencies(){return["transition"]}destruct(){null!==this.timer&&window.clearTimeout(this.timer),this.flashTimer&&this.flashTimer.remove(),this.flash&&(this.flash.remove(),this.flash=null,this.flashTimer=null),super.destruct()}create(){this.snowboard.globalEvent("flash.create",this),this.flash=document.createElement("DIV"),this.flash.innerHTML=this.message,this.flash.classList.add("flash-message",this.type),this.flash.removeAttribute("data-control"),this.flash.addEventListener("click",(()=>this.remove())),this.flash.addEventListener("mouseover",(()=>this.stopTimer())),this.flash.addEventListener("mouseout",(()=>this.startTimer())),this.duration>0?(this.flashTimer=document.createElement("DIV"),this.flashTimer.classList.add("flash-timer"),this.flash.appendChild(this.flashTimer)):this.flash.classList.add("no-timer"),document.body.appendChild(this.flash),this.snowboard.transition(this.flash,"show",(()=>{this.startTimer()}))}remove(){this.snowboard.globalEvent("flash.remove",this),this.stopTimer(),this.snowboard.transition(this.flash,"hide",(()=>{this.flash.remove(),this.flash=null,this.destruct()}))}clear(){document.querySelectorAll("body > div.flash-message").forEach((e=>e.remove()))}startTimer(){0!==this.duration&&(this.timerTrans=this.snowboard.transition(this.flashTimer,"timeout",null,`${this.duration}.0s`,!0),this.timer=window.setTimeout((()=>this.remove()),1e3*this.duration))}stopTimer(){this.timerTrans&&this.timerTrans.cancel(),this.timer&&window.clearTimeout(this.timer)}}},277:function(e,t,s){s.d(t,{Z:function(){return i}});var a=s(640);class i extends a.eG{dependencies(){return["request"]}listens(){return{ready:"ready",ajaxStart:"ajaxStart"}}ready(){this.counter=0,this.createStripe()}ajaxStart(e,t){!1!==t.options.stripe&&(this.show(),e.then((()=>{this.hide()})).catch((()=>{this.hide()})))}createStripe(){this.indicator=document.createElement("DIV"),this.stripe=document.createElement("DIV"),this.stripeLoaded=document.createElement("DIV"),this.indicator.classList.add("stripe-loading-indicator","loaded"),this.stripe.classList.add("stripe"),this.stripeLoaded.classList.add("stripe-loaded"),this.indicator.appendChild(this.stripe),this.indicator.appendChild(this.stripeLoaded),document.body.appendChild(this.indicator)}show(){this.counter+=1;const e=this.stripe.cloneNode(!0);this.indicator.appendChild(e),this.stripe.remove(),this.stripe=e,this.counter>1||(this.indicator.classList.remove("loaded"),document.body.classList.add("wn-loading"))}hide(e){this.counter-=1,!0===e&&(this.counter=0),this.counter<=0&&(this.indicator.classList.add("loaded"),document.body.classList.remove("wn-loading"))}}},32:function(e,t,s){s.d(t,{Z:function(){return i}});var a=s(640);class i extends a.eG{listens(){return{ready:"ready"}}ready(){let e=!1;if(document.querySelectorAll('link[rel="stylesheet"]').forEach((t=>{t.href.endsWith("/modules/system/assets/css/snowboard.extras.css")&&(e=!0)})),!e){const e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("href",this.snowboard.url().asset("/modules/system/assets/css/snowboard.extras.css")),document.head.appendChild(e)}}}},269:function(e,t,s){s.d(t,{Z:function(){return i}});var a=s(640);class i extends a.NG{construct(e,t,s,a,i){if(e instanceof HTMLElement==!1)throw new Error("A HTMLElement must be provided for transitioning");if(this.element=e,"string"!=typeof t)throw new Error("Transition name must be specified as a string");if(this.transition=t,s&&"function"!=typeof s)throw new Error("Callback must be a valid function");this.callback=s,this.duration=a?this.parseDuration(a):null,this.trailTo=!0===i,this.doTransition()}eventClasses(){for(var e=arguments.length,t=new Array(e),s=0;s{const[s,a]=e;-1!==t.indexOf(s)&&i.push(a)})),i}doTransition(){null!==this.duration&&(this.element.style.transitionDuration=this.duration),this.resetClasses(),this.eventClasses("in","active").forEach((e=>{this.element.classList.add(e)})),window.requestAnimationFrame((()=>{"0s"!==window.getComputedStyle(this.element)["transition-duration"]?(this.element.addEventListener("transitionend",(()=>this.onTransitionEnd()),{once:!0}),window.requestAnimationFrame((()=>{this.element.classList.remove(this.eventClasses("in")[0]),this.element.classList.add(this.eventClasses("out")[0])}))):(this.resetClasses(),this.callback&&this.callback.apply(this.element),this.destruct())}))}onTransitionEnd(){this.eventClasses("active",this.trailTo?"":"out").forEach((e=>{this.element.classList.remove(e)})),this.callback&&this.callback.apply(this.element),null!==this.duration&&(this.element.style.transitionDuration=null),this.destruct()}cancel(){this.element.removeEventListener("transitionend",(()=>this.onTransitionEnd),{once:!0}),this.resetClasses(),null!==this.duration&&(this.element.style.transitionDuration=null),this.destruct()}resetClasses(){this.eventClasses().forEach((e=>{this.element.classList.remove(e)}))}parseDuration(e){const t=/^([0-9]+(\.[0-9]+)?)(m?s)?$/.exec(e),s=Number(t[1]);return"sec"===("s"===t[3]?"sec":"msec")?1e3*s+"ms":`${Math.floor(s)}ms`}}},820:function(e,t,s){var a=s(270),i=s(640);class r extends i.eG{dependencies(){return["flash"]}listens(){return{ready:"ready",ajaxErrorMessage:"ajaxErrorMessage",ajaxFlashMessages:"ajaxFlashMessages"}}ready(){document.querySelectorAll('[data-control="flash-message"]').forEach((e=>{this.snowboard.flash(e.innerHTML,e.dataset.flashType,e.dataset.flashDuration),e.remove()}))}ajaxErrorMessage(e){return this.snowboard.flash(e,"error"),!1}ajaxFlashMessages(e){return Object.entries(e).forEach((e=>{const[t,s]=e;this.snowboard.flash(s,t)})),!1}}class n extends i.eG{construct(){this.errorBags=[]}listens(){return{ready:"ready",ajaxStart:"clearValidation",ajaxValidationErrors:"doValidation"}}ready(){this.collectErrorBags(document)}doValidation(e,t,s){if(s.element&&void 0===s.element.dataset.requestValidate)return null;if(!e)return null;return this.errorBags.filter((t=>t.form===e)).forEach((e=>{this.showErrorBag(e,t)})),!1}clearValidation(e,t){if(t.element&&void 0===t.element.dataset.requestValidate)return;if(!t.form)return;this.errorBags.filter((e=>e.form===t.form)).forEach((e=>{this.hideErrorBag(e)}))}collectErrorBags(e){e.querySelectorAll("[data-validate-error], [data-validate-for]").forEach((e=>{const t=e.closest("form[data-request-validate]");if(!t)return void e.parentNode.removeChild(e);let s=null;e.matches("[data-validate-error]")&&(s=e.querySelector("[data-message]"));const a=document.createComment(""),i={element:e,form:t,validateFor:e.dataset.validateFor?e.dataset.validateFor.split(/\s*,\s*/):"*",placeholder:a,messageListElement:s?s.cloneNode(!0):null,messageListAnchor:null,customMessage:!!e.dataset.validateFor&&(""!==e.textContent||e.childNodes.length>0)};if(s){const e=document.createComment("");s.parentNode.replaceChild(e,s),i.messageListAnchor=e}e.parentNode.replaceChild(a,e),this.errorBags.push(i)}))}hideErrorBag(e){e.element.isConnected&&e.element.parentNode.replaceChild(e.placeholder,e.element)}showErrorBag(e,t){if(this.errorBagValidatesField(e,t))if(e.element.isConnected||e.placeholder.parentNode.replaceChild(e.element,e.placeholder),"*"!==e.validateFor){if(!e.customMessage){const s=Object.keys(t).filter((t=>e.validateFor.includes(t))).shift();[e.element.innerHTML]=t[s]}}else e.messageListElement?(e.element.querySelectorAll("[data-validation-message]").forEach((e=>{e.parentNode.removeChild(e)})),Object.entries(t).forEach((t=>{const[,s]=t;s.forEach((t=>{const s=e.messageListElement.cloneNode(!0);s.dataset.validationMessage="",s.innerHTML=t,e.messageListAnchor.after(s)}))}))):[e.element.innerHTML]=t[Object.keys(t).shift()]}errorBagValidatesField(e,t){return"*"===e.validateFor||Object.keys(t).filter((t=>e.validateFor.includes(t))).length>0}}var o,l=s(269),d=s(553),h=s(277),c=s(32);if(void 0===window.Snowboard)throw new Error("Snowboard must be loaded in order to use the extra plugins.");(o=window.Snowboard).addPlugin("extrasStyles",c.Z),o.addPlugin("transition",l.Z),o.addPlugin("flash",a.Z),o.addPlugin("flashListener",r),o.addPlugin("formValidation",n),o.addPlugin("attachLoading",d.Z),o.addPlugin("stripeLoader",h.Z)}},function(e){e.O(0,[109],(function(){return t=820,e(e.s=t);var t}));e.O()}]); \ No newline at end of file diff --git a/modules/system/assets/js/snowboard/build/snowboard.request.js b/modules/system/assets/js/snowboard/build/snowboard.request.js index 0f62731ad..b7dfc34ba 100644 --- a/modules/system/assets/js/snowboard/build/snowboard.request.js +++ b/modules/system/assets/js/snowboard/build/snowboard.request.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[]).push([[988],{640:function(e,t,s){var r=s(579);function o(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,r)}return s}function n(e){for(var t=1;t{e&&this.doAjax().then((e=>{if(e.cancelled)return this.cancelled=!0,void this.complete();this.responseData=e,this.processUpdate(e).then((()=>{!1===e.X_WINTER_SUCCESS?this.processError(e):this.processResponse(e)}))}),(e=>{this.responseError=e,this.processError(e)}))})):this.doAjax().then((e=>{if(e.cancelled)return this.cancelled=!0,void this.complete();this.responseData=e,this.processUpdate(e).then((()=>{!1===e.X_WINTER_SUCCESS?this.processError(e):this.processResponse(e)}))}),(e=>{this.responseError=e,this.processError(e)})):this.cancelled=!0}else this.cancelled=!0}dependencies(){return["cookie","jsonParser"]}checkRequest(){if(this.element&&this.element instanceof Element==!1)throw new Error("The element provided must be an Element instance");if(void 0===this.handler)throw new Error("The AJAX handler name is not specified.");if(!this.isHandlerName(this.handler))throw new Error('Invalid AJAX handler name. The correct handler name format is: "onEvent".')}getFetch(){return this.fetchOptions=void 0!==this.options.fetchOptions&&"object"==typeof this.options.fetchOptions?this.options.fetchOptions:{method:"POST",headers:this.headers,body:this.data,redirect:"follow",mode:"same-origin"},this.snowboard.globalEvent("ajaxFetchOptions",this.fetchOptions,this),fetch(this.url,this.fetchOptions)}doClientValidation(){return!0!==this.options.browserValidate||!this.form||!1!==this.form.checkValidity()||(this.form.reportValidity(),!1)}doAjax(){if(!1===this.snowboard.globalEvent("ajaxBeforeSend",this))return Promise.resolve({cancelled:!0});const e=new Promise(((e,t)=>{this.getFetch().then((s=>{s.ok||406===s.status?s.headers.has("Content-Type")&&s.headers.get("Content-Type").includes("/json")?s.json().then((t=>{e(n(n({},t),{},{X_WINTER_SUCCESS:406!==s.status,X_WINTER_RESPONSE_CODE:s.status}))}),(e=>{t(this.renderError(`Unable to parse JSON response: ${e}`))})):s.text().then((t=>{e(t)}),(e=>{t(this.renderError(`Unable to process response: ${e}`))})):s.headers.has("Content-Type")&&s.headers.get("Content-Type").includes("/json")?s.json().then((e=>{e.message&&e.exception?t(this.renderError(e.message,e.exception,e.file,e.line,e.trace)):t(e)}),(e=>{t(this.renderError(`Unable to parse JSON response: ${e}`))})):s.text().then((e=>{t(this.renderError(e))}),(e=>{t(this.renderError(`Unable to process response: ${e}`))}))}),(e=>{t(this.renderError(`Unable to retrieve a response from the server: ${e}`))}))}));if(this.snowboard.globalEvent("ajaxStart",e,this),this.element){const t=new Event("ajaxPromise");t.promise=e,this.element.dispatchEvent(t)}return e}processUpdate(e){return new Promise(((t,s)=>{if("function"==typeof this.options.beforeUpdate&&!1===this.options.beforeUpdate.apply(this,[e]))return void t();const r={};if(Object.entries(e).forEach((e=>{const[t,s]=e;"X_WINTER"!==t.substr(0,8)&&(r[t]=s)})),0===Object.keys(r).length)return void(e.X_WINTER_ASSETS?this.processAssets(e.X_WINTER_ASSETS).then((()=>{t()}),(()=>{s()})):t());this.snowboard.globalPromiseEvent("ajaxBeforeUpdate",e,this).then((async()=>{e.X_WINTER_ASSETS&&await this.processAssets(e.X_WINTER_ASSETS),this.doUpdate(r).then((()=>{window.requestAnimationFrame((()=>t()))}),(()=>{s()}))}),(()=>{t()}))}))}doUpdate(e){return new Promise((t=>{const s=[];Object.entries(e).forEach((e=>{const[t,r]=e;let o=this.options.update&&this.options.update[t]?this.options.update[t]:t,n="replace";"@"===o.substr(0,1)?(n="append",o=o.substr(1)):"^"===o.substr(0,1)?(n="prepend",o=o.substr(1)):"#"!==o.substr(0,1)&&"."!==o.substr(0,1)&&(n="noop");const i=document.querySelectorAll(o);i.length>0&&i.forEach((e=>{switch(n){case"append":e.innerHTML+=r;break;case"prepend":e.innerHTML=r+e.innerHTML;break;case"noop":break;default:e.innerHTML=r}s.push(e),this.snowboard.globalEvent("ajaxUpdate",e,r,this);const t=new Event("ajaxUpdate");t.content=r,e.dispatchEvent(t)}))})),this.snowboard.globalEvent("ajaxUpdateComplete",s,this),t()}))}processResponse(e){if((!this.options.success||"function"!=typeof this.options.success||!1!==this.options.success(this.responseData,this))&&!1!==this.snowboard.globalEvent("ajaxSuccess",this.responseData,this)){if(this.element){const e=new Event("ajaxDone",{cancelable:!0});if(e.responseData=this.responseData,e.request=this,this.element.dispatchEvent(e),e.defaultPrevented)return}this.flash&&e.X_WINTER_FLASH_MESSAGES&&this.processFlashMessages(e.X_WINTER_FLASH_MESSAGES),this.redirect||e.X_WINTER_REDIRECT?this.processRedirect(this.redirect||e.X_WINTER_REDIRECT):this.complete()}}processError(e){if((!this.options.error||"function"!=typeof this.options.error||!1!==this.options.error(this.responseError,this))&&!1!==this.snowboard.globalEvent("ajaxError",this.responseError,this)){if(this.element){const e=new Event("ajaxFail",{cancelable:!0});if(e.responseError=this.responseError,e.request=this,this.element.dispatchEvent(e),e.defaultPrevented)return}if(e instanceof Error)this.processErrorMessage(e.message);else{let t=!1;e.X_WINTER_ERROR_FIELDS&&(t=this.processValidationErrors(e.X_WINTER_ERROR_FIELDS)),e.X_WINTER_ERROR_MESSAGE&&!t&&this.processErrorMessage(e.X_WINTER_ERROR_MESSAGE)}this.complete()}}processRedirect(e){"function"==typeof this.options.handleRedirectResponse&&!1===this.options.handleRedirectResponse.apply(this,[e])||!1!==this.snowboard.globalEvent("ajaxRedirect",e,this)&&(window.addEventListener("popstate",(()=>{if(this.element){const e=document.createEvent("CustomEvent");e.eventName="ajaxRedirected",this.element.dispatchEvent(e)}}),{once:!0}),window.location.assign(e))}processErrorMessage(e){"function"==typeof this.options.handleErrorMessage&&!1===this.options.handleErrorMessage.apply(this,[e])||!1!==this.snowboard.globalEvent("ajaxErrorMessage",e,this)&&window.alert(e)}processFlashMessages(e){"function"==typeof this.options.handleFlashMessages&&!1===this.options.handleFlashMessages.apply(this,[e])||this.snowboard.globalEvent("ajaxFlashMessages",e,this)}processValidationErrors(e){return"function"==typeof this.options.handleValidationErrors&&!1===this.options.handleValidationErrors.apply(this,[this.form,e])||!1===this.snowboard.globalEvent("ajaxValidationErrors",this.form,e,this)}processAssets(e){return this.snowboard.globalPromiseEvent("ajaxLoadAssets",e)}async doConfirm(){if("function"==typeof this.options.handleConfirmMessage)return!1!==this.options.handleConfirmMessage.apply(this,[this.confirm]);if(0===this.snowboard.listensToEvent("ajaxConfirmMessage").length)return window.confirm(this.confirm);const e=this.snowboard.globalPromiseEvent("ajaxConfirmMessage",this.confirm,this);try{if(await e)return!0}catch(e){return!1}return!1}complete(){if(this.options.complete&&"function"==typeof this.options.complete&&this.options.complete(this.responseData,this),this.snowboard.globalEvent("ajaxDone",this.responseData,this),this.element){const e=new Event("ajaxAlways");e.request=this,e.responseData=this.responseData,e.responseError=this.responseError,this.element.dispatchEvent(e)}this.destruct()}get form(){return this.options.form?"string"==typeof this.options.form?document.querySelector(this.options.form):this.options.form:this.element?"FORM"===this.element.tagName?this.element:this.element.closest("form"):null}get context(){return{handler:this.handler,options:this.options}}get headers(){const e={"X-Requested-With":"XMLHttpRequest","X-WINTER-REQUEST-HANDLER":this.handler,"X-WINTER-REQUEST-PARTIALS":this.extractPartials(this.options.update||[])};return this.flash&&(e["X-WINTER-REQUEST-FLASH"]=1),this.xsrfToken&&(e["X-XSRF-TOKEN"]=this.xsrfToken),e}get loading(){return this.options.loading||!1}get url(){return this.options.url||window.location.href}get redirect(){return this.options.redirect&&this.options.redirect.length?this.options.redirect:null}get flash(){return this.options.flash||!1}get files(){return!0===this.options.files&&(void 0!==FormData||(this.snowboard.debug("This browser does not support file uploads"),!1))}get xsrfToken(){return this.snowboard.cookie().get("XSRF-TOKEN")}get data(){const e="object"==typeof this.options.data?this.options.data:{},t=new FormData(this.form||void 0);return Object.keys(e).length>0&&Object.entries(e).forEach((e=>{const[s,r]=e;t.append(s,r)})),t}get confirm(){return this.options.confirm||!1}extractPartials(e){return Object.keys(e).join("&")}renderError(e,t,s,r,o){const n=new Error(e);return n.exception=t||null,n.file=s||null,n.line=r||null,n.trace=o||[],n}isHandlerName(e){return/^(?:\w+:{2})?on[A-Z0-9]/.test(e)}}if(void 0===window.Snowboard)throw new Error("Snowboard must be loaded in order to use the Javascript AJAX request feature.");window.Snowboard.addPlugin("request",a)}},function(e){e.O(0,[109],(function(){return t=640,e(e.s=t);var t}));e.O()}]); \ No newline at end of file +"use strict";(self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[]).push([[988],{329:function(e,t,s){var r=s(640);function o(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,r)}return s}function n(e){for(var t=1;t{e&&this.doAjax().then((e=>{if(e.cancelled)return this.cancelled=!0,void this.complete();this.responseData=e,this.processUpdate(e).then((()=>{!1===e.X_WINTER_SUCCESS?this.processError(e):this.processResponse(e)}))}),(e=>{this.responseError=e,this.processError(e)}))})):this.doAjax().then((e=>{if(e.cancelled)return this.cancelled=!0,void this.complete();this.responseData=e,this.processUpdate(e).then((()=>{!1===e.X_WINTER_SUCCESS?this.processError(e):this.processResponse(e)}))}),(e=>{this.responseError=e,this.processError(e)})):this.cancelled=!0}else this.cancelled=!0}dependencies(){return["cookie","jsonParser"]}checkRequest(){if(this.element&&this.element instanceof Element==!1)throw new Error("The element provided must be an Element instance");if(void 0===this.handler)throw new Error("The AJAX handler name is not specified.");if(!this.isHandlerName(this.handler))throw new Error('Invalid AJAX handler name. The correct handler name format is: "onEvent".')}getFetch(){return this.fetchOptions=void 0!==this.options.fetchOptions&&"object"==typeof this.options.fetchOptions?this.options.fetchOptions:{method:"POST",headers:this.headers,body:this.data,redirect:"follow",mode:"same-origin"},this.snowboard.globalEvent("ajaxFetchOptions",this.fetchOptions,this),fetch(this.url,this.fetchOptions)}doClientValidation(){return!0!==this.options.browserValidate||!this.form||!1!==this.form.checkValidity()||(this.form.reportValidity(),!1)}doAjax(){if(!1===this.snowboard.globalEvent("ajaxBeforeSend",this))return Promise.resolve({cancelled:!0});const e=new Promise(((e,t)=>{this.getFetch().then((s=>{s.ok||406===s.status?s.headers.has("Content-Type")&&s.headers.get("Content-Type").includes("/json")?s.json().then((t=>{e(n(n({},t),{},{X_WINTER_SUCCESS:406!==s.status,X_WINTER_RESPONSE_CODE:s.status}))}),(e=>{t(this.renderError(`Unable to parse JSON response: ${e}`))})):s.text().then((t=>{e(t)}),(e=>{t(this.renderError(`Unable to process response: ${e}`))})):s.headers.has("Content-Type")&&s.headers.get("Content-Type").includes("/json")?s.json().then((e=>{e.message&&e.exception?t(this.renderError(e.message,e.exception,e.file,e.line,e.trace)):t(e)}),(e=>{t(this.renderError(`Unable to parse JSON response: ${e}`))})):s.text().then((e=>{t(this.renderError(e))}),(e=>{t(this.renderError(`Unable to process response: ${e}`))}))}),(e=>{t(this.renderError(`Unable to retrieve a response from the server: ${e}`))}))}));if(this.snowboard.globalEvent("ajaxStart",e,this),this.element){const t=new Event("ajaxPromise");t.promise=e,this.element.dispatchEvent(t)}return e}processUpdate(e){return new Promise(((t,s)=>{if("function"==typeof this.options.beforeUpdate&&!1===this.options.beforeUpdate.apply(this,[e]))return void t();const r={};if(Object.entries(e).forEach((e=>{const[t,s]=e;"X_WINTER"!==t.substr(0,8)&&(r[t]=s)})),0===Object.keys(r).length)return void(e.X_WINTER_ASSETS?this.processAssets(e.X_WINTER_ASSETS).then((()=>{t()}),(()=>{s()})):t());this.snowboard.globalPromiseEvent("ajaxBeforeUpdate",e,this).then((async()=>{e.X_WINTER_ASSETS&&await this.processAssets(e.X_WINTER_ASSETS),this.doUpdate(r).then((()=>{window.requestAnimationFrame((()=>t()))}),(()=>{s()}))}),(()=>{t()}))}))}doUpdate(e){return new Promise((t=>{const s=[];Object.entries(e).forEach((e=>{const[t,r]=e;let o=this.options.update&&this.options.update[t]?this.options.update[t]:t,n="replace";"@"===o.substr(0,1)?(n="append",o=o.substr(1)):"^"===o.substr(0,1)?(n="prepend",o=o.substr(1)):"#"!==o.substr(0,1)&&"."!==o.substr(0,1)&&(n="noop");const i=document.querySelectorAll(o);i.length>0&&i.forEach((e=>{switch(n){case"append":e.innerHTML+=r;break;case"prepend":e.innerHTML=r+e.innerHTML;break;case"noop":break;default:e.innerHTML=r}s.push(e),this.snowboard.globalEvent("ajaxUpdate",e,r,this);const t=new Event("ajaxUpdate");t.content=r,e.dispatchEvent(t)}))})),this.snowboard.globalEvent("ajaxUpdateComplete",s,this),t()}))}processResponse(e){if((!this.options.success||"function"!=typeof this.options.success||!1!==this.options.success(this.responseData,this))&&!1!==this.snowboard.globalEvent("ajaxSuccess",this.responseData,this)){if(this.element){const e=new Event("ajaxDone",{cancelable:!0});if(e.responseData=this.responseData,e.request=this,this.element.dispatchEvent(e),e.defaultPrevented)return}this.flash&&e.X_WINTER_FLASH_MESSAGES&&this.processFlashMessages(e.X_WINTER_FLASH_MESSAGES),this.redirect||e.X_WINTER_REDIRECT?this.processRedirect(this.redirect||e.X_WINTER_REDIRECT):this.complete()}}processError(e){if((!this.options.error||"function"!=typeof this.options.error||!1!==this.options.error(this.responseError,this))&&!1!==this.snowboard.globalEvent("ajaxError",this.responseError,this)){if(this.element){const e=new Event("ajaxFail",{cancelable:!0});if(e.responseError=this.responseError,e.request=this,this.element.dispatchEvent(e),e.defaultPrevented)return}if(e instanceof Error)this.processErrorMessage(e.message);else{let t=!1;e.X_WINTER_ERROR_FIELDS&&(t=this.processValidationErrors(e.X_WINTER_ERROR_FIELDS)),e.X_WINTER_ERROR_MESSAGE&&!t&&this.processErrorMessage(e.X_WINTER_ERROR_MESSAGE)}this.complete()}}processRedirect(e){"function"==typeof this.options.handleRedirectResponse&&!1===this.options.handleRedirectResponse.apply(this,[e])||!1!==this.snowboard.globalEvent("ajaxRedirect",e,this)&&(window.addEventListener("popstate",(()=>{if(this.element){const e=document.createEvent("CustomEvent");e.eventName="ajaxRedirected",this.element.dispatchEvent(e)}}),{once:!0}),window.location.assign(e))}processErrorMessage(e){"function"==typeof this.options.handleErrorMessage&&!1===this.options.handleErrorMessage.apply(this,[e])||!1!==this.snowboard.globalEvent("ajaxErrorMessage",e,this)&&window.alert(e)}processFlashMessages(e){"function"==typeof this.options.handleFlashMessages&&!1===this.options.handleFlashMessages.apply(this,[e])||this.snowboard.globalEvent("ajaxFlashMessages",e,this)}processValidationErrors(e){return"function"==typeof this.options.handleValidationErrors&&!1===this.options.handleValidationErrors.apply(this,[this.form,e])||!1===this.snowboard.globalEvent("ajaxValidationErrors",this.form,e,this)}processAssets(e){return this.snowboard.globalPromiseEvent("ajaxLoadAssets",e)}async doConfirm(){if("function"==typeof this.options.handleConfirmMessage)return!1!==this.options.handleConfirmMessage.apply(this,[this.confirm]);if(0===this.snowboard.listensToEvent("ajaxConfirmMessage").length)return window.confirm(this.confirm);const e=this.snowboard.globalPromiseEvent("ajaxConfirmMessage",this.confirm,this);try{if(await e)return!0}catch(e){return!1}return!1}complete(){if(this.options.complete&&"function"==typeof this.options.complete&&this.options.complete(this.responseData,this),this.snowboard.globalEvent("ajaxDone",this.responseData,this),this.element){const e=new Event("ajaxAlways");e.request=this,e.responseData=this.responseData,e.responseError=this.responseError,this.element.dispatchEvent(e)}this.destruct()}get form(){return this.options.form?"string"==typeof this.options.form?document.querySelector(this.options.form):this.options.form:this.element?"FORM"===this.element.tagName?this.element:this.element.closest("form"):null}get context(){return{handler:this.handler,options:this.options}}get headers(){const e={"X-Requested-With":"XMLHttpRequest","X-WINTER-REQUEST-HANDLER":this.handler,"X-WINTER-REQUEST-PARTIALS":this.extractPartials(this.options.update||[])};return this.flash&&(e["X-WINTER-REQUEST-FLASH"]=1),this.xsrfToken&&(e["X-XSRF-TOKEN"]=this.xsrfToken),e}get loading(){return this.options.loading||!1}get url(){return this.options.url||window.location.href}get redirect(){return this.options.redirect&&this.options.redirect.length?this.options.redirect:null}get flash(){return this.options.flash||!1}get files(){return!0===this.options.files&&(void 0!==FormData||(this.snowboard.debug("This browser does not support file uploads"),!1))}get xsrfToken(){return this.snowboard.cookie().get("XSRF-TOKEN")}get data(){const e="object"==typeof this.options.data?this.options.data:{},t=new FormData(this.form||void 0);return Object.keys(e).length>0&&Object.entries(e).forEach((e=>{const[s,r]=e;t.append(s,r)})),t}get confirm(){return this.options.confirm||!1}extractPartials(e){return Object.keys(e).join("&")}renderError(e,t,s,r,o){const n=new Error(e);return n.exception=t||null,n.file=s||null,n.line=r||null,n.trace=o||[],n}isHandlerName(e){return/^(?:\w+:{2})?on[A-Z0-9]/.test(e)}}if(void 0===window.Snowboard)throw new Error("Snowboard must be loaded in order to use the Javascript AJAX request feature.");window.Snowboard.addPlugin("request",a)}},function(e){e.O(0,[109],(function(){return t=329,e(e.s=t);var t}));e.O()}]); \ No newline at end of file diff --git a/modules/system/assets/js/snowboard/build/snowboard.vendor.js b/modules/system/assets/js/snowboard/build/snowboard.vendor.js index 4724dc97c..51b543248 100644 --- a/modules/system/assets/js/snowboard/build/snowboard.vendor.js +++ b/modules/system/assets/js/snowboard/build/snowboard.vendor.js @@ -1,2 +1,3 @@ -"use strict";(self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[]).push([[109],{579:function(u,e,t){t.d(e,{Jc:function(){return W},NG:function(){return D},eG:function(){return n}});var r={get(u,e,t){if("string"==typeof e){const t=e.toLowerCase();if(u.hasPlugin(t))return(...e)=>Reflect.get(u,"plugins")[t].getInstance(...e)}return Reflect.get(u,e,t)},has(u,e){if("string"==typeof e){const t=e.toLowerCase();if(u.hasPlugin(t))return!0}return Reflect.has(u,e)}};class D{constructor(u){this.snowboard=u}construct(){}dependencies(){return[]}listens(){return{}}destruct(){}destructor(){this.destruct(),this.detach(),delete this.snowboard}}class n extends D{}var i={get(u,e,t){if("string"==typeof e){const t=e.toLowerCase();if(["attachAbstracts","loadUtilities","initialise","initialiseSingletons"].includes(e))throw new Error(`You cannot use the "${e}" Snowboard method within a plugin.`);if(u.hasPlugin(t))return(...e)=>Reflect.get(u,"plugins")[t].getInstance(...e)}return Reflect.get(u,e,t)},has(u,e){if("string"==typeof e){const t=e.toLowerCase();if(["attachAbstracts","loadUtilities","initialise","initialiseSingletons"].includes(e))return!1;if(u.hasPlugin(t))return!0}return Reflect.has(u,e)}};class s{constructor(u,e,t){this.name=u,this.snowboard=new Proxy(e,i),this.instance=t,Object.freeze(this.instance),this.instances=[],this.singleton={initialised:!1},Object.seal(this.singleton),this.mocks={},this.originalFunctions={},Object.freeze(s.prototype),Object.freeze(this)}hasMethod(u){return"function"==typeof this.instance.prototype[u]}callMethod(...u){const e=u,t=e.shift();return this.instance.prototype[t](e)}getInstance(...u){if(!this.dependenciesFulfilled()){const u=this.getDependencies().filter((u=>!this.snowboard.getPluginNames().includes(u)));throw new Error(`The "${this.name}" plugin requires the following plugins: ${u.join(", ")}`)}if(this.isSingleton())return 0===this.instances.length&&this.initialiseSingleton(...u),Object.keys(this.mocks).length>0&&(Object.entries(this.originalFunctions).forEach((u=>{const[e,t]=u;this.instances[0][e]=t})),Object.entries(this.mocks).forEach((u=>{const[e,t]=u;this.instances[0][e]=(...u)=>t(this.instances[0],...u)}))),this.instances[0];const e=new this.instance(this.snowboard,...u);return Object.keys(this.mocks).length>0&&(Object.entries(this.originalFunctions).forEach((u=>{const[t,r]=u;e[t]=r})),Object.entries(this.mocks).forEach((u=>{const[t,r]=u;e[t]=(...u)=>r(e,...u)}))),e.detach=()=>this.instances.splice(this.instances.indexOf(e),1),e.construct(...u),this.loadTraits(e),this.instances.push(e),e}getInstances(){return this.instances}isSingleton(){return this.instance.prototype instanceof n==!0}isInitialised(){return!this.isSingleton()||this.singleton.initialised}initialiseSingleton(...u){if(!this.isSingleton())return;const e=new this.instance(this.snowboard,...u);e.detach=()=>this.instances.splice(this.instances.indexOf(e),1),e.construct(...u),this.loadTraits(e),this.instances.push(e),this.singleton.initialised=!0}getDependencies(){return this.instance.prototype.dependencies().map((u=>u.toLowerCase()))}dependenciesFulfilled(){const u=this.getDependencies();let e=!0;return u.forEach((u=>{this.snowboard.hasPlugin(u)||(e=!1)})),e}mock(u,e){if(!this.instance.prototype[u])throw new Error(`Function "${u}" does not exist and cannot be mocked`);this.mocks[u]=e,this.originalFunctions[u]=this.instance.prototype[u],this.isSingleton()&&0===this.instances.length&&(this.initialiseSingleton(),this.instances[0][u]=(...u)=>e(this,...u))}unmock(u){this.mocks[u]&&(this.isSingleton()&&(this.instances[0][u]=this.originalFunctions[u]),delete this.mocks[u],delete this.originalFunctions[u])}loadTraits(u){const e=[];let t=u;for(;"Object"!==t.constructor.name;){if(t.traits&&"function"==typeof t.traits){const u=t.traits();Array.isArray(u)?u.forEach((u=>{e.includes(u)||e.push({trait:u,config:{}})})):"object"==typeof u&&Object.entries(u).forEach((([u,t])=>{e.includes(u)||e.push({trait:u,config:t})}))}t=Object.getPrototypeOf(t)}e.forEach((e=>{if(!1===this.snowboard.hasTrait(e.trait))return void this.warning(`Trait "${e.trait}" does not exist and cannot be applied to "${this.name}"`);const t=this.snowboard.getTrait(e.trait),r=new t,D=Object.keys(r).reduce(((u,e)=>(u[e]=Object.getOwnPropertyDescriptor(r,e),u)),{});Object.getOwnPropertyNames(t.prototype).forEach((u=>{if(["constructor","construct","destruct","destructor"].includes(u))return;const e=Object.getOwnPropertyDescriptor(t.prototype,u);D[u]=e}));const n=Object.keys(D).filter((e=>void 0===u[e])).reduce(((u,e)=>(u[e]=D[e],u)),{});Object.defineProperties(u,n),r.construct&&r.construct.call(u,e.config)}))}}class o{constructor(){this.instanceConfig={},this.acceptedConfigs={}}construct(u){if(this.element instanceof HTMLElement==!1)throw new Error("Data configuration can only be extracted from HTML elements");Object.defineProperty(this,"acceptAllDataConfigs",{enumerable:!0,writable:!1,configurable:!1,value:u.acceptAllDataConfigs||!1}),this.refreshConfig()}defaults(){return{}}getConfig(u){return void 0===u?this.instanceConfig:void 0!==this.instanceConfig[u]?this.instanceConfig[u]:void 0}setConfig(u,e,t){if(void 0===u)throw new Error("You must provide a configuration key to set");this.instanceConfig[u]=e,!0===t&&(this.element.dataset[u]=e)}refreshConfig(){this.acceptedConfigs=this.getAcceptedConfigs(),this.instanceConfig=this.processConfig()}getAcceptedConfigs(){return void 0!==this.acceptAllDataConfigs&&!0===this.acceptAllDataConfigs||"object"==typeof this.defaults()&&Object.keys(this.defaults())}getDefaultConfig(){return"object"==typeof this.defaults()?this.defaults():{}}processConfig(){const u=this.getDefaultConfig();if(!1===this.acceptedConfigs)return u;for(const e in this.element.dataset)(!0===this.acceptedConfigs||this.acceptedConfigs.includes(e))&&(u[e]=this.coerceConfigValue(this.element.dataset[e],u[e]));return u}coerceConfigValue(u,e){const t=String(u);if("null"===t)return null;if("undefined"!==t){if(t.startsWith("base64:")){const u=t.replace(/^base64:/,""),e=atob(u);return this.coerceConfigValue(e)}if(["true","yes"].includes(t.toLowerCase()))return!0;if(["false","no"].includes(t.toLowerCase()))return!1;if(/^[-+]?[0-9]+(\.[0-9]+)?$/.test(t))return void 0!==e&&"boolean"==typeof e&&["0","1"].includes(t)?1===Number(t):Number(t);try{return this.snowboard.jsonParser().parse(t,!0)}catch(u){return""===t||t}}}}class a{constructor(){this.events=[],this.localEventsOnly=!1}construct(){if(!this.localEventsOnly&&!this.eventPrefix)throw new Error("Event prefix is required if global events are enabled.")}on(u,e){this.events.push({event:u,callback:e})}off(u,e){this.events=this.events.filter((t=>t.event!==u||t.callback!==e))}once(u,e){const t=this.events.push({event:u,callback:(...u)=>{e(...u),this.events.splice(t-1,1)}})}triggerEvent(u,...e){const t=this.events.filter((e=>e.event===u));if(0===t.length)return;let r=!1;t.forEach((u=>{r||!1===u.callback(...e)&&(r=!0)})),r||this.localEventsOnly||this.snowboard.globalEvent(`${this.eventPrefix}.${u}`,...e)}triggerPromiseEvent(u,...e){const t=this.events.filter((e=>e.event===u));if(0===t.length)return;const r=t.filter((u=>null!==u),t.map((u=>u.callback(...e))));Promise.all(r).then((()=>{this.localEventsOnly||this.snowboard.globalPromiseEvent(`${this.eventPrefix}.${u}`,...e)}),(()=>{}))}}class c extends n{listens(){return{ajaxLoadAssets:"load"}}dependencies(){return["url"]}load(u){const e=[];return u.js&&("string"==typeof u.js?e.push(this.loadScript(u.js)):Array.isArray(u.js)&&u.js.length>0&&u.js.forEach((u=>{e.push(this.loadScript(u))}))),u.css&&("string"==typeof u.css?e.push(this.loadStyle(u.css)):Array.isArray(u.css)&&u.css.length>0&&u.css.forEach((u=>{e.push(this.loadStyle(u))}))),u.img&&("string"==typeof u.img?e.push(this.loadImage(u.img)):Array.isArray(u.img)&&u.img.length>0&&u.img.forEach((u=>{e.push(this.loadImage(u))}))),Promise.all(e)}loadScript(u){return new Promise(((e,t)=>{const r=this.snowboard.url().asset(u);if(document.querySelector(`script[src="${r}"]`))return void e();const D=document.createElement("script");D.setAttribute("type","text/javascript"),D.setAttribute("src",r),D.addEventListener("load",(()=>{this.snowboard.globalEvent("assetLoader.loaded","script",u,D),e()})),D.addEventListener("error",(()=>{this.snowboard.globalEvent("assetLoader.error","script",u,D),t(new Error(`Unable to load script file: "${u}"`))})),document.body.append(D)}))}loadStyle(u){return new Promise(((e,t)=>{const r=this.snowboard.url().asset(u);if(document.querySelector(`link[rel="stylesheet"][href="${r}"]`))return void e();const D=document.createElement("link");D.setAttribute("rel","stylesheet"),D.setAttribute("href",r),D.addEventListener("load",(()=>{this.snowboard.globalEvent("assetLoader.loaded","style",u,D),e()})),D.addEventListener("error",(()=>{this.snowboard.globalEvent("assetLoader.error","style",u,D),t(new Error(`Unable to load stylesheet file: "${u}"`))})),document.head.append(D)}))}loadImage(u){return new Promise(((e,t)=>{const r=this.snowboard.url().asset(u),D=new Image;D.addEventListener("load",(()=>{this.snowboard.globalEvent("assetLoader.loaded","image",u,D),e()})),D.addEventListener("error",(()=>{this.snowboard.globalEvent("assetLoader.error","image",u,D),t(new Error(`Unable to load image file: "${u}"`))})),D.src=r}))}} -/*! js-cookie v3.0.5 | MIT */function l(u){for(var e=1;e{const[e,t]=u;void 0!==this.defaults[e]&&(this.defaults[e]=t)}))}getDefaults(){const u={};return Object.entries(this.defaults).forEach((e=>{const[t,r]=e;null!==this.defaults[t]&&(u[t]=r)})),u}get(u){if(void 0===u){const u=C.get();return Object.entries(u).forEach((e=>{const[t,r]=e;this.snowboard.globalEvent("cookie.get",t,r,(e=>{u[t]=e}))})),u}let e=C.get(u);return this.snowboard.globalEvent("cookie.get",u,e,(u=>{e=u})),e}set(u,e,t){let r=e;return this.snowboard.globalEvent("cookie.set",u,e,(u=>{r=u})),C.set(u,r,{...this.getDefaults(),...t})}remove(u,e){C.remove(u,{...this.getDefaults(),...e})}}var A={Space_Separator:/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,ID_Start:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\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\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\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\u0AF9\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-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\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-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\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\u2160-\u2188\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-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\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]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,ID_Continue:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\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\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/},E={isSpaceSeparator(u){return"string"==typeof u&&A.Space_Separator.test(u)},isIdStartChar(u){return"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||"$"===u||"_"===u||A.ID_Start.test(u))},isIdContinueChar(u){return"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||u>="0"&&u<="9"||"$"===u||"_"===u||"‌"===u||"‍"===u||A.ID_Continue.test(u))},isDigit(u){return"string"==typeof u&&/[0-9]/.test(u)},isHexDigit(u){return"string"==typeof u&&/[0-9A-Fa-f]/.test(u)}};let h,d,f,B,g,p,b,m,v;function y(u,e,t){const r=u[e];if(null!=r&&"object"==typeof r)if(Array.isArray(r))for(let u=0;u0;){const e=O();if(!E.isHexDigit(e))throw M(_());u+=_()}return String.fromCodePoint(parseInt(u,16))}const I={start(){if("eof"===b.type)throw R();z()},beforePropertyName(){switch(b.type){case"identifier":case"string":return m=b.value,void(d="afterPropertyName");case"punctuator":return void T();case"eof":throw R()}},afterPropertyName(){if("eof"===b.type)throw R();d="beforePropertyValue"},beforePropertyValue(){if("eof"===b.type)throw R();z()},beforeArrayValue(){if("eof"===b.type)throw R();"punctuator"!==b.type||"]"!==b.value?z():T()},afterPropertyValue(){if("eof"===b.type)throw R();switch(b.value){case",":return void(d="beforePropertyName");case"}":T()}},afterArrayValue(){if("eof"===b.type)throw R();switch(b.value){case",":return void(d="beforeArrayValue");case"]":T()}},end(){}};function z(){let u;switch(b.type){case"punctuator":switch(b.value){case"{":u={};break;case"[":u=[]}break;case"null":case"boolean":case"numeric":case"string":u=b.value}if(void 0===v)v=u;else{const e=f[f.length-1];Array.isArray(e)?e.push(u):Object.defineProperty(e,m,{value:u,writable:!0,enumerable:!0,configurable:!0})}if(null!==u&&"object"==typeof u)f.push(u),d=Array.isArray(u)?"beforeArrayValue":"beforePropertyName";else{const u=f[f.length-1];d=null==u?"end":Array.isArray(u)?"afterArrayValue":"afterPropertyValue"}}function T(){f.pop();const u=f[f.length-1];d=null==u?"end":Array.isArray(u)?"afterArrayValue":"afterPropertyValue"}function M(u){return H(void 0===u?`JSON5: invalid end of input at ${g}:${p}`:`JSON5: invalid character '${J(u)}' at ${g}:${p}`)}function R(){return H(`JSON5: invalid end of input at ${g}:${p}`)}function V(){return p-=5,H(`JSON5: invalid identifier character at ${g}:${p}`)}function J(u){const e={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(e[u])return e[u];if(u<" "){const e=u.charCodeAt(0).toString(16);return"\\x"+("00"+e).substring(e.length)}return u}function H(u){const e=new SyntaxError(u);return e.lineNumber=g,e.columnNumber=p,e}const q={parse:function(u,e){h=String(u),d="start",f=[],B=0,g=1,p=0,b=void 0,m=void 0,v=void 0;do{b=j(),I[d]()}while("eof"!==b.type);return"function"==typeof e?y({"":v},"",e):v},stringify:function(u,e,t){const r=[];let D,n,i,s="",o="";if(null==e||"object"!=typeof e||Array.isArray(e)||(t=e.space,i=e.quote,e=e.replacer),"function"==typeof e)n=e;else if(Array.isArray(e)){D=[];for(const u of e){let e;"string"==typeof u?e=u:("number"==typeof u||u instanceof String||u instanceof Number)&&(e=String(u)),void 0!==e&&D.indexOf(e)<0&&D.push(e)}}return t instanceof Number?t=Number(t):t instanceof String&&(t=String(t)),"number"==typeof t?t>0&&(t=Math.min(10,Math.floor(t)),o=" ".substr(0,t)):"string"==typeof t&&(o=t.substr(0,10)),a("",{"":u});function a(u,e){let t=e[u];switch(null!=t&&("function"==typeof t.toJSON5?t=t.toJSON5(u):"function"==typeof t.toJSON&&(t=t.toJSON(u))),n&&(t=n.call(e,u,t)),t instanceof Number?t=Number(t):t instanceof String?t=String(t):t instanceof Boolean&&(t=t.valueOf()),t){case null:return"null";case!0:return"true";case!1:return"false"}return"string"==typeof t?c(t):"number"==typeof t?String(t):"object"==typeof t?Array.isArray(t)?function(u){if(r.indexOf(u)>=0)throw TypeError("Converting circular structure to JSON5");r.push(u);let e=s;s+=o;let t,D=[];for(let e=0;e=0)throw TypeError("Converting circular structure to JSON5");r.push(u);let e=s;s+=o;let t,n=D||Object.keys(u),i=[];for(const e of n){const t=a(e,u);if(void 0!==t){let u=l(e)+":";""!==o&&(u+=" "),u+=t,i.push(u)}}if(0===i.length)t="{}";else{let u;if(""===o)u=i.join(","),t="{"+u+"}";else{let r=",\n"+s;u=i.join(r),t="{\n"+s+u+",\n"+e+"}"}}return r.pop(),s=e,t}(t):void 0}function c(u){const e={"'":.1,'"':.2},t={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};let r="";for(let D=0;De[u]{const t=u.trim();if("'"===t.substring(0,1)||'"'===t.substring(0,1))return e.strings.push(t),`__STR$(${e.strings.length-1})__`;if("{"===t.substring(0,1)){const u=this.tokenize(t.substring(1,t.length-1),e);return e.objects.push(u),`__OBJ$(${e.objects.length-1})__`}const r=this.tokenize(t.substring(1,t.length-1),e);return e.arrays.push(r),`__ARR$(${e.arrays.length-1})__`}));let r=[];if(t.includes(","))r=t.split(",");else{if(!t.includes(":"))return t;r=[t]}return r.map((u=>{let t="";if(u.includes(":")){const[r,D]=u.split(":");r.trim().match(/^__[A-Z]{3}\$\(\d+\)__$/)?t=r.trim():(e.keys.push(r.trim()),t=`__KEY$(${e.keys.length-1})__`),D.trim().match(/^__[A-Z]{3}\$\(\d+\)__$/)?t=`${t}: ${D.trim()}`:(e.values.push(D.trim()),t=`${t}: __VAL$(${e.values.length-1})__`)}else u.trim().match(/^__[A-Z]{3}\$\(\d+\)__$/)?t=u.trim():(e.values.push(u.trim()),t=`${t}__VAL$(${e.values.length-1})__`);return t})).join(", ")}detokenize(u,e){return u.replace(/__([A-Z]{3})\$\((\d+)\)__/g,((u,t,r)=>{switch(t){case"STR":return e.strings[r].replace(/\n/g,"\\n");case"KEY":return`"${e.keys[r]}"`;case"VAL":try{return Z.parse(e.values[r].replace(/\n/g,"\\n"))}catch(u){return`"${e.values[r].replace(/\n/g,"\\n")}"`}case"ARR":return`[ ${this.detokenize(e.arrays[r],e)} ]`;default:return`{ ${this.detokenize(e.objects[r],e)} }`}}))}}class Y extends n{sanitize(u,e=!0){const t=(new DOMParser).parseFromString(u,"text/html");return this.sanitizeNode(t.getRootNode()),e?t.body.innerHTML:t.documentElement.outerHTML}sanitizeNode(u){if(["SCRIPT","IFRAME","OBJECT"].includes(u.tagName))return void u.remove();this.trimAttributes(u);Array.from(u.children).forEach((u=>{this.sanitizeNode(u)}))}trimAttributes(u){if(u.attributes)for(let e=0;e{this.initialiseSingletons(),this.globalEvent("ready"),this.readiness.dom=!0}))}initialiseSingletons(){Object.values(this.plugins).forEach((u=>{u.isSingleton()&&u.dependenciesFulfilled()&&u.initialiseSingleton()}))}addPlugin(u,e){const t=u.toLowerCase();if(this.hasPlugin(t))throw new Error(`A plugin called "${u}" is already registered.`);if(e.prototype instanceof D==!1)throw new Error("The provided plugin must extend the PluginBase class");if(void 0!==this[u]||void 0!==this[t])throw new Error("The given name is already in use for a property or method of the Snowboard class.");this.plugins[t]=new s(t,this,e),this.debug(`Plugin "${u}" registered`),Object.values(this.getPlugins()).forEach((u=>{if(u.isSingleton()&&!u.isInitialised()&&u.dependenciesFulfilled()&&u.hasMethod("listens")&&Object.keys(u.callMethod("listens")).includes("ready")&&this.readiness.dom){const e=u.callMethod("listens").ready;u.callMethod(e)}}))}removePlugin(u){const e=u.toLowerCase();this.hasPlugin(e)?(this.plugins[e].getInstances().forEach((u=>{u.destructor()})),delete this.plugins[e],delete this[e],delete this[u],this.debug(`Plugin "${u}" removed`)):this.debug(`Plugin "${u}" already removed`)}hasPlugin(u){const e=u.toLowerCase();return void 0!==this.plugins[e]}getPlugins(){return this.plugins}getPluginNames(){return Object.keys(this.plugins)}getPlugin(u){const e=u.toLowerCase();if(!this.hasPlugin(e))throw new Error(`No plugin called "${e}" has been registered.`);return this.plugins[e]}registerTrait(u,e){const t=u.toLowerCase();if(this.hasTrait(t))throw new Error(`A trait called "${u}" is already registered.`);if("function"!=typeof e)throw new Error("The provided trait must be a class.");if(void 0!==this[u]||void 0!==this[t])throw new Error("The given name is already in use for a property or method of the Snowboard class.");this.traits[t]=e,this.debug(`Trait "${u}" registered`)}hasTrait(u){const e=u.toLowerCase();return void 0!==this.traits[e]}getTraits(){return this.traits}getTrait(u){if(!this.hasTrait(u))throw new Error(`No trait called "${u}" has been registered.`);const e=u.toLowerCase();return this.traits[e]}listensToEvent(u){const e=[];return Object.entries(this.plugins).forEach((t=>{const[r,D]=t;if(!D.dependenciesFulfilled())return;const n=D.callMethod("listens");"string"!=typeof n[u]&&"function"!=typeof n[u]||e.push(r)})),e}ready(u){this.readiness.dom&&u(),this.on("ready",u)}on(u,e){this.listeners[u]||(this.listeners[u]=[]),this.listeners[u].includes(e)||this.listeners[u].push(e)}off(u,e){if(!this.listeners[u])return;const t=this.listeners[u].indexOf(e);-1!==t&&this.listeners[u].splice(t,1)}globalEvent(u,...e){this.debug(`Calling global event "${u}"`,...e);let t=!1;const r=this.listensToEvent(u);return 0===r.length?this.debug(`No listeners found for global event "${u}"`):(this.debug(`Listeners found for global event "${u}": ${r.join(", ")}`),r.forEach((r=>{const D=this.getPlugin(r);D.isSingleton()&&0===D.getInstances().length&&D.initialiseSingleton();const n=D.callMethod("listens")[u];D.getInstances().forEach((D=>{if(!t)if("function"==typeof n)try{!1===n.apply(D,e)&&(t=!0)}catch(e){this.error(`Error thrown in "${u}" event by "${r}" plugin.`,e)}else if("string"==typeof n){if(!D[n])throw new Error(`Missing "${n}" method in "${r}" plugin`);try{!1===D[n](...e)&&(t=!0,this.debug(`Global event "${u}" cancelled by "${r}" plugin`))}catch(e){this.error(`Error thrown in "${u}" event by "${r}" plugin.`,e)}}else this.error(`Listen method for "${u}" event in "${r}" plugin is not a function or string.`)}))}))),!t&&this.listeners[u]&&this.listeners[u].length>0&&(this.debug(`Found ${this.listeners[u].length} ad-hoc listener(s) for global event "${u}"`),this.listeners[u].forEach((r=>{if(!t)try{!1===r(...e)&&(t=!0,this.debug(`Global event "${u} cancelled by an ad-hoc listener.`))}catch(e){this.error(`Error thrown in "${u}" event by an ad-hoc listener.`,e)}}))),!t}globalPromiseEvent(u,...e){this.debug(`Calling global promise event "${u}"`);const t=[],r=this.listensToEvent(u);return 0===r.length?this.debug(`No listeners found for global promise event "${u}"`):(this.debug(`Listeners found for global promise event "${u}": ${r.join(", ")}`),r.forEach((r=>{const D=this.getPlugin(r);D.isSingleton()&&0===D.getInstances().length&&D.initialiseSingleton();const n=D.callMethod("listens")[u];D.getInstances().forEach((D=>{if("function"==typeof n)try{const u=n.apply(D,e);if(u instanceof Promise==!1)return;t.push(u)}catch(e){this.error(`Error thrown in "${u}" event by "${r}" plugin.`,e)}else if("string"==typeof n){if(!D[n])throw new Error(`Missing "${n}" method in "${r}" plugin`);try{const u=D[n](...e);if(u instanceof Promise==!1)return;t.push(u)}catch(e){this.error(`Error thrown in "${u}" promise event by "${r}" plugin.`,e)}}else this.error(`Listen method for "${u}" event in "${r}" plugin is not a function or string.`)}))}))),this.listeners[u]&&this.listeners[u].length>0&&(this.debug(`Found ${this.listeners[u].length} ad-hoc listener(s) for global promise event "${u}"`),this.listeners[u].forEach((r=>{try{const u=r(...e);if(u instanceof Promise==!1)return;t.push(u)}catch(e){this.error(`Error thrown in "${u}" promise event by an ad-hoc listener.`,e)}}))),0===t.length?Promise.resolve():Promise.all(t)}logMessage(u,e,t,...r){if(console.groupCollapsed("%c[Snowboard]",`color: ${u}; font-weight: ${e?"bold":"normal"};`,t),r.length){console.groupCollapsed(`%cParameters %c(${r.length})`,"color: rgb(45, 167, 199); font-weight: bold;","color: rgb(88, 88, 88); font-weight: normal;");let u=0;r.forEach((e=>{u+=1,console.log(`%c${u}:`,"color: rgb(88, 88, 88); font-weight: normal;",e)})),console.groupEnd(),console.groupCollapsed("%cTrace","color: rgb(45, 167, 199); font-weight: bold;"),console.trace(),console.groupEnd()}else console.trace();console.groupEnd()}log(u,...e){this.logMessage("rgb(45, 167, 199)",!1,u,...e)}debug(u,...e){this.debugEnabled&&this.logMessage("rgb(45, 167, 199)",!1,u,...e)}warning(u,...e){this.debugEnabled&&this.logMessage("rgb(229, 179, 71)",!0,u,...e)}error(u,...e){this.logMessage("rgb(211, 71, 71)",!0,u,...e)}}}}]); \ No newline at end of file +(self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[]).push([[109],{640:function(u,e,t){"use strict"; +/*! js-cookie v3.0.5 | MIT */ +function r(u){for(var e=1;eReflect.get(u,"plugins")[e.toLowerCase()].getInstance(...t):Reflect.get(u,e,t)},has(u,e){return!("string"!=typeof e||!u.hasAbstract(e))||(!("string"!=typeof e||!u.hasPlugin(e))||Reflect.has(u,e))},deleteProperty(u,e){return!("string"!=typeof e||!u.hasPlugin(e))&&(u.removePlugin(e),!0)}};class o{constructor(u){this.snowboard=u}construct(){}init(){}dependencies(){return[]}listens(){return{}}destruct(){}destructor(){this.destruct(),this.detach(),delete this.snowboard}}class a extends o{}var c={get(u,e,t){if("string"==typeof e){const t=e.toLowerCase();if(["attachAbstracts","loadInbuilt","initialise","initialiseSingletons"].includes(e))throw new Error(`You cannot use the "${e}" Snowboard method within a plugin.`);if(u.hasPlugin(t))return(...e)=>Reflect.get(u,"plugins")[t].getInstance(...e)}return Reflect.get(u,e,t)},has(u,e){if("string"==typeof e){const t=e.toLowerCase();if(["attachAbstracts","loadInbuilt","initialise","initialiseSingletons"].includes(e))return!1;if(u.hasPlugin(t))return!0}return Reflect.has(u,e)}};class l{constructor(u,e,t){this.name=u,this.snowboard=new Proxy(e,c),this.instance=t,Object.freeze(this.instance),this.instances=[],this.singleton={initialised:!1},Object.seal(this.singleton),this.mocks={},this.originalFunctions={},Object.freeze(l.prototype),Object.freeze(this)}hasMethod(u){return"function"==typeof this.instance.prototype[u]}callMethod(...u){const e=u,t=e.shift();return this.instance.prototype[t](e)}getInstance(...u){if(!this.dependenciesFulfilled()){const u=this.getDependencies().filter((u=>!this.snowboard.getPluginNames().includes(u)));throw new Error(`The "${this.name}" plugin requires the following plugins: ${u.join(", ")}`)}if(this.isSingleton())return 0===this.instances.length&&this.initialiseSingleton(...u),Object.keys(this.mocks).length>0&&(Object.entries(this.originalFunctions).forEach((u=>{const[e,t]=u;this.instances[0][e]=t})),Object.entries(this.mocks).forEach((u=>{const[e,t]=u;this.instances[0][e]=(...u)=>t(this.instances[0],...u)}))),this.instances[0];const e=new this.instance(this.snowboard,...u);return Object.keys(this.mocks).length>0&&(Object.entries(this.originalFunctions).forEach((u=>{const[t,r]=u;e[t]=r})),Object.entries(this.mocks).forEach((u=>{const[t,r]=u;e[t]=(...u)=>r(e,...u)}))),e.detach=()=>this.instances.splice(this.instances.indexOf(e),1),e.construct(...u),this.loadTraits(e),e.init(),this.instances.push(e),e}getInstances(){return this.instances}isSingleton(){return this.instance.prototype instanceof a==!0}isInitialised(){return!this.isSingleton()||this.singleton.initialised}initialiseSingleton(...u){if(!this.isSingleton())return;const e=new this.instance(this.snowboard,...u);e.detach=()=>this.instances.splice(this.instances.indexOf(e),1),e.construct(...u),this.loadTraits(e),e.init(),this.instances.push(e),this.singleton.initialised=!0}getDependencies(){return this.instance.prototype.dependencies().map((u=>u.toLowerCase()))}dependenciesFulfilled(){const u=this.getDependencies();let e=!0;return u.forEach((u=>{this.snowboard.hasPlugin(u)||(e=!1)})),e}mock(u,e){if(!this.instance.prototype[u])throw new Error(`Function "${u}" does not exist and cannot be mocked`);this.mocks[u]=e,this.originalFunctions[u]=this.instance.prototype[u],this.isSingleton()&&0===this.instances.length&&(this.initialiseSingleton(),this.instances[0][u]=(...u)=>e(this,...u))}unmock(u){this.mocks[u]&&(this.isSingleton()&&(this.instances[0][u]=this.originalFunctions[u]),delete this.mocks[u],delete this.originalFunctions[u])}loadTraits(u){const e=[];let t=u;for(;"Object"!==t.constructor.name;){if(t.traits&&"function"==typeof t.traits){const u=t.traits();Array.isArray(u)?u.forEach((u=>{e.includes(u)||e.push({trait:u,config:{}})})):"object"==typeof u&&Object.entries(u).forEach((([u,t])=>{e.includes(u)||e.push({trait:u,config:t})}))}t=Object.getPrototypeOf(t)}e.forEach((e=>{if(!1===this.snowboard.hasTrait(e.trait))return void this.warning(`Trait "${e.trait}" does not exist and cannot be applied to "${this.name}"`);const t=this.snowboard.getTrait(e.trait),r=new t,n=Object.keys(r).reduce(((u,e)=>(u[e]=Object.getOwnPropertyDescriptor(r,e),u)),{});Object.getOwnPropertyNames(t.prototype).forEach((u=>{if(["constructor","construct","init","destruct","destructor","detach"].includes(u))return;const e=Object.getOwnPropertyDescriptor(t.prototype,u);n[u]=e}));const i=Object.keys(n).filter((e=>void 0===u[e])).reduce(((u,e)=>(u[e]=n[e],u)),{});Object.defineProperties(u,i),r.construct&&r.construct.call(u,e.config)}))}}class C{constructor(){this.instanceConfig={},this.acceptedConfigs={}}construct(u){if(this.element instanceof HTMLElement==!1)throw new Error("Data configuration can only be extracted from HTML elements");Object.defineProperty(this,"acceptAllDataConfigs",{enumerable:!0,writable:!1,configurable:!1,value:u.acceptAllDataConfigs||!1}),this.refreshConfig()}defaults(){return{}}getConfig(u){return void 0===u?this.instanceConfig:void 0!==this.instanceConfig[u]?this.instanceConfig[u]:void 0}setConfig(u,e,t){if(void 0===u)throw new Error("You must provide a configuration key to set");this.instanceConfig[u]=e,!0===t&&(this.element.dataset[u]=e)}refreshConfig(){this.acceptedConfigs=this.getAcceptedConfigs(),this.instanceConfig=this.processConfig()}getAcceptedConfigs(){return void 0!==this.acceptAllDataConfigs&&!0===this.acceptAllDataConfigs||"object"==typeof this.defaults()&&Object.keys(this.defaults())}getDefaultConfig(){return"object"==typeof this.defaults()?this.defaults():{}}processConfig(){const u=this.getDefaultConfig();if(!1===this.acceptedConfigs)return u;for(const e in this.element.dataset)(!0===this.acceptedConfigs||this.acceptedConfigs.includes(e))&&(u[e]=this.coerceConfigValue(this.element.dataset[e],u[e]));return u}coerceConfigValue(u,e){const t=String(u);if("null"===t)return null;if("undefined"!==t){if(t.startsWith("base64:")){const u=t.replace(/^base64:/,""),e=atob(u);return this.coerceConfigValue(e)}if(["true","yes"].includes(t.toLowerCase()))return!0;if(["false","no"].includes(t.toLowerCase()))return!1;if(/^[-+]?[0-9]+(\.[0-9]+)?$/.test(t))return void 0!==e&&"boolean"==typeof e&&["0","1"].includes(t)?1===Number(t):Number(t);try{return this.snowboard.jsonParser().parse(t,!0)}catch(u){return""===t||t}}}}class F{constructor(){this.eventListeners=[],this.localEventsOnly=!1}construct(){if(!this.localEventsOnly&&!this.eventPrefix)throw new Error("Event prefix is required if global events are enabled.")}on(u,e){this.eventListeners.push({event:u,callback:e})}off(u,e){this.eventListeners=this.eventListeners.filter((t=>t.event!==u||t.callback!==e))}once(u,e){const t=this.eventListeners.push({event:u,callback:(...u)=>{e(...u),this.eventListeners.splice(t-1,1)}})}triggerEvent(u,...e){const t=this.eventListeners.filter((e=>e.event===u));if(0===t.length)return;let r=!1;t.forEach((u=>{r||!1===u.callback(...e)&&(r=!0)})),r||this.localEventsOnly||this.snowboard.globalEvent(`${this.eventPrefix}.${u}`,...e)}triggerPromiseEvent(u,...e){const t=this.eventListeners.filter((e=>e.event===u));if(0===t.length)return;const r=t.filter((u=>null!==u),t.map((u=>u.callback(...e))));Promise.all(r).then((()=>{this.localEventsOnly||this.snowboard.globalPromiseEvent(`${this.eventPrefix}.${u}`,...e)}),(()=>{}))}}class A extends a{listens(){return{ajaxLoadAssets:"load"}}dependencies(){return["url"]}load(u){const e=[];return u.js&&("string"==typeof u.js?e.push(this.loadScript(u.js)):Array.isArray(u.js)&&u.js.length>0&&u.js.forEach((u=>{e.push(this.loadScript(u))}))),u.css&&("string"==typeof u.css?e.push(this.loadStyle(u.css)):Array.isArray(u.css)&&u.css.length>0&&u.css.forEach((u=>{e.push(this.loadStyle(u))}))),u.img&&("string"==typeof u.img?e.push(this.loadImage(u.img)):Array.isArray(u.img)&&u.img.length>0&&u.img.forEach((u=>{e.push(this.loadImage(u))}))),Promise.all(e)}loadScript(u){return new Promise(((e,t)=>{const r=this.snowboard.url().asset(u);if(document.querySelector(`script[src="${r}"]`))return void e();const n=document.createElement("script");n.setAttribute("type","text/javascript"),n.setAttribute("src",r),n.addEventListener("load",(()=>{this.snowboard.globalEvent("assetLoader.loaded","script",u,n),e()})),n.addEventListener("error",(()=>{this.snowboard.globalEvent("assetLoader.error","script",u,n),t(new Error(`Unable to load script file: "${u}"`))})),document.body.append(n)}))}loadStyle(u){return new Promise(((e,t)=>{const r=this.snowboard.url().asset(u);if(document.querySelector(`link[rel="stylesheet"][href="${r}"]`))return void e();const n=document.createElement("link");n.setAttribute("rel","stylesheet"),n.setAttribute("href",r),n.addEventListener("load",(()=>{this.snowboard.globalEvent("assetLoader.loaded","style",u,n),e()})),n.addEventListener("error",(()=>{this.snowboard.globalEvent("assetLoader.error","style",u,n),t(new Error(`Unable to load stylesheet file: "${u}"`))})),document.head.append(n)}))}loadImage(u){return new Promise(((e,t)=>{const r=this.snowboard.url().asset(u),n=new Image;n.addEventListener("load",(()=>{this.snowboard.globalEvent("assetLoader.loaded","image",u,n),e()})),n.addEventListener("error",(()=>{this.snowboard.globalEvent("assetLoader.error","image",u,n),t(new Error(`Unable to load image file: "${u}"`))})),n.src=r}))}}class E extends a{construct(){this.defaults={expires:null,path:"/",domain:null,secure:!1,sameSite:"Lax"}}setDefaults(u){if("object"!=typeof u)throw new Error("Cookie defaults must be provided as an object");Object.entries(u).forEach((u=>{const[e,t]=u;void 0!==this.defaults[e]&&(this.defaults[e]=t)}))}getDefaults(){const u={};return Object.entries(this.defaults).forEach((e=>{const[t,r]=e;null!==this.defaults[t]&&(u[t]=r)})),u}get(u){if(void 0===u){const u=n.get();return Object.entries(u).forEach((e=>{const[t,r]=e;this.snowboard.globalEvent("cookie.get",t,r,(e=>{u[t]=e}))})),u}let e=n.get(u);return this.snowboard.globalEvent("cookie.get",u,e,(u=>{e=u})),e}set(u,e,t){let r=e;return this.snowboard.globalEvent("cookie.set",u,e,(u=>{r=u})),n.set(u,r,{...this.getDefaults(),...t})}remove(u,e){n.remove(u,{...this.getDefaults(),...e})}}class h extends a{parse(u,e=!1){if("undefined"!==u)try{return s().parse(u)}catch(t){const r=this.prepareString(String(u),e);return s().parse(r)}}prepareString(u,e){const t={keys:[],values:[],strings:[],objects:[],arrays:[]},r=this.tokenize(u,t).trim();return r.includes(":")&&!e?`{ ${this.detokenize(r,t)} }`:r.includes(",")&&!e?`[ ${this.detokenize(r,t)} ]`:r.match(/^__[A-Z]{3}\$\(\d+\)__$/)?this.detokenize(r,t):`"${u.replace(/"/g,'\\"').replace(/\n/g,"\\n")}"`}tokenize(u,e){const t=u.trim().replace(/('[^']+'|"[^"]+"|\{.*?\}\s*(?=[,{\]]|$)|\[.*\]\s*(?=[,{\]]|$))/gs,(u=>{const t=u.trim();if("'"===t.substring(0,1)||'"'===t.substring(0,1))return e.strings.push(t),`__STR$(${e.strings.length-1})__`;if("{"===t.substring(0,1)){const u=this.tokenize(t.substring(1,t.length-1),e);return e.objects.push(u),`__OBJ$(${e.objects.length-1})__`}const r=this.tokenize(t.substring(1,t.length-1),e);return e.arrays.push(r),`__ARR$(${e.arrays.length-1})__`}));let r=[];if(t.includes(","))r=t.split(",");else{if(!t.includes(":"))return t;r=[t]}return r.map((u=>{let t="";if(u.includes(":")){const[r,n]=u.split(":");r.trim().match(/^__[A-Z]{3}\$\(\d+\)__$/)?t=r.trim():(e.keys.push(r.trim()),t=`__KEY$(${e.keys.length-1})__`),n.trim().match(/^__[A-Z]{3}\$\(\d+\)__$/)?t=`${t}: ${n.trim()}`:(e.values.push(n.trim()),t=`${t}: __VAL$(${e.values.length-1})__`)}else u.trim().match(/^__[A-Z]{3}\$\(\d+\)__$/)?t=u.trim():(e.values.push(u.trim()),t=`${t}__VAL$(${e.values.length-1})__`);return t})).join(", ")}detokenize(u,e){return u.replace(/__([A-Z]{3})\$\((\d+)\)__/g,((u,t,r)=>{switch(t){case"STR":return e.strings[r].replace(/\n/g,"\\n");case"KEY":return`"${e.keys[r]}"`;case"VAL":try{return s().parse(e.values[r].replace(/\n/g,"\\n"))}catch(u){return`"${e.values[r].replace(/\n/g,"\\n")}"`}case"ARR":return`[ ${this.detokenize(e.arrays[r],e)} ]`;default:return`{ ${this.detokenize(e.objects[r],e)} }`}}))}}class f extends a{sanitize(u,e=!0){const t=(new DOMParser).parseFromString(u,"text/html");return this.sanitizeNode(t.getRootNode()),e?t.body.innerHTML:t.documentElement.outerHTML}sanitizeNode(u){if(["SCRIPT","IFRAME","OBJECT"].includes(u.tagName))return void u.remove();this.trimAttributes(u);Array.from(u.children).forEach((u=>{this.sanitizeNode(u)}))}trimAttributes(u){if(u.attributes)for(let e=0;e{this.initialiseSingletons(),this.globalEvent("ready"),this.readiness.dom=!0};window||u(),window.addEventListener("DOMContentLoaded",u)}initialiseSingletons(){Object.values(this.plugins).forEach((u=>{u.isSingleton()&&u.dependenciesFulfilled()&&u.initialiseSingleton()}))}addPlugin(u,e){if(this.hasPlugin(u)||this.hasAbstract(u))throw new Error(`A plugin or abstract called "${u}" is already registered.`);if(e.prototype instanceof o==!1)throw new Error("The provided plugin must extend the PluginBase class");const t=u.toLowerCase();if(void 0!==this[u]||void 0!==this[t])throw new Error("The given name is already in use for a property or method of the Snowboard class.");this.plugins[t]=new l(t,this,e),this.debug(`Plugin "${u}" registered`),Object.values(this.getPlugins()).forEach((u=>{if(u.isSingleton()&&!u.isInitialised()&&u.dependenciesFulfilled()&&u.hasMethod("listens")&&Object.keys(u.callMethod("listens")).includes("ready")&&this.readiness.dom){const e=u.callMethod("listens").ready;u.callMethod(e)}}))}removePlugin(u){if(!this.hasPlugin(u))return void this.debug(`Plugin "${u}" doesn't exist or is already removed`);const e=u.toLowerCase();this.plugins[e].getInstances().forEach((u=>{u.destructor()})),delete this.plugins[e],this.debug(`Plugin "${u}" removed`)}hasPlugin(u){const e=u.toLowerCase();return void 0!==this.plugins[e]}getPlugins(){return this.plugins}getPluginNames(){return Object.keys(this.plugins)}getPlugin(u){if(!this.hasPlugin(u))throw new Error(`No plugin called "${u}" has been registered.`);return this.plugins[u.toLowerCase()]}registerTrait(u,e){if(this.hasTrait(u))throw new Error(`A trait called "${u}" is already registered.`);if("function"!=typeof e)throw new Error("The provided trait must be a class.");const t=u.toLowerCase();if(void 0!==this[u]||void 0!==this[t])throw new Error("The given name is already in use for a property or method of the Snowboard class.");this.traits[t]=e,this.debug(`Trait "${u}" registered`)}hasTrait(u){const e=u.toLowerCase();return void 0!==this.traits[e]}getTraits(){return this.traits}getTrait(u){if(!this.hasTrait(u))throw new Error(`No trait called "${u}" has been registered.`);const e=u.toLowerCase();return this.traits[e]}listensToEvent(u){const e=[];return Object.entries(this.plugins).forEach((t=>{const[r,n]=t;if(!n.dependenciesFulfilled())return;const i=n.callMethod("listens");"string"!=typeof i[u]&&"function"!=typeof i[u]||e.push(r)})),e}ready(u){this.readiness.dom&&u(),this.on("ready",u)}on(u,e){this.listeners[u]||(this.listeners[u]=[]),this.listeners[u].includes(e)||this.listeners[u].push(e)}off(u,e){if(!this.listeners[u])return;const t=this.listeners[u].indexOf(e);-1!==t&&this.listeners[u].splice(t,1)}globalEvent(u,...e){this.debug(`Calling global event "${u}"`,...e);let t=!1;const r=this.listensToEvent(u);return 0===r.length?this.debug(`No listeners found for global event "${u}"`):(this.debug(`Listeners found for global event "${u}": ${r.join(", ")}`),r.forEach((r=>{const n=this.getPlugin(r);n.isSingleton()&&0===n.getInstances().length&&n.initialiseSingleton();const i=n.callMethod("listens")[u];n.getInstances().forEach((n=>{if(!t)if("function"==typeof i)try{!1===i.apply(n,e)&&(t=!0)}catch(e){this.error(`Error thrown in "${u}" event by "${r}" plugin.`,e)}else if("string"==typeof i){if(!n[i])throw new Error(`Missing "${i}" method in "${r}" plugin`);try{!1===n[i](...e)&&(t=!0,this.debug(`Global event "${u}" cancelled by "${r}" plugin`))}catch(e){this.error(`Error thrown in "${u}" event by "${r}" plugin.`,e)}}else this.error(`Listen method for "${u}" event in "${r}" plugin is not a function or string.`)}))}))),!t&&this.listeners[u]&&this.listeners[u].length>0&&(this.debug(`Found ${this.listeners[u].length} ad-hoc listener(s) for global event "${u}"`),this.listeners[u].forEach((r=>{if(!t)try{!1===r(...e)&&(t=!0,this.debug(`Global event "${u} cancelled by an ad-hoc listener.`))}catch(e){this.error(`Error thrown in "${u}" event by an ad-hoc listener.`,e)}}))),!t}globalPromiseEvent(u,...e){this.debug(`Calling global promise event "${u}"`);const t=[],r=this.listensToEvent(u);return 0===r.length?this.debug(`No listeners found for global promise event "${u}"`):(this.debug(`Listeners found for global promise event "${u}": ${r.join(", ")}`),r.forEach((r=>{const n=this.getPlugin(r);n.isSingleton()&&0===n.getInstances().length&&n.initialiseSingleton();const i=n.callMethod("listens")[u];n.getInstances().forEach((n=>{if("function"==typeof i)try{const u=i.apply(n,e);if(u instanceof Promise==!1)return;t.push(u)}catch(e){this.error(`Error thrown in "${u}" event by "${r}" plugin.`,e)}else if("string"==typeof i){if(!n[i])throw new Error(`Missing "${i}" method in "${r}" plugin`);try{const u=n[i](...e);if(u instanceof Promise==!1)return;t.push(u)}catch(e){this.error(`Error thrown in "${u}" promise event by "${r}" plugin.`,e)}}else this.error(`Listen method for "${u}" event in "${r}" plugin is not a function or string.`)}))}))),this.listeners[u]&&this.listeners[u].length>0&&(this.debug(`Found ${this.listeners[u].length} ad-hoc listener(s) for global promise event "${u}"`),this.listeners[u].forEach((r=>{try{const u=r(...e);if(u instanceof Promise==!1)return;t.push(u)}catch(e){this.error(`Error thrown in "${u}" promise event by an ad-hoc listener.`,e)}}))),0===t.length?Promise.resolve():Promise.all(t)}logMessage(u,e,t,...r){if(console.groupCollapsed("%c[Snowboard]",`color: ${u}; font-weight: ${e?"bold":"normal"};`,t),r.length){console.groupCollapsed(`%cParameters %c(${r.length})`,"color: rgb(45, 167, 199); font-weight: bold;","color: rgb(88, 88, 88); font-weight: normal;");let u=0;r.forEach((e=>{u+=1,console.log(`%c${u}:`,"color: rgb(88, 88, 88); font-weight: normal;",e)})),console.groupEnd(),console.groupCollapsed("%cTrace","color: rgb(45, 167, 199); font-weight: bold;"),console.trace(),console.groupEnd()}else console.trace();console.groupEnd()}log(u,...e){this.logMessage("rgb(45, 167, 199)",!1,u,...e)}debug(u,...e){this.debugEnabled&&this.logMessage("rgb(45, 167, 199)",!1,u,...e)}warning(u,...e){this.debugEnabled&&this.logMessage("rgb(229, 179, 71)",!0,u,...e)}error(u,...e){this.logMessage("rgb(211, 71, 71)",!0,u,...e)}}},111:function(u){u.exports=function(){"use strict";function u(u,e){return u(e={exports:{}},e.exports),e.exports}var e=u((function(u){var e=u.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)})),t=u((function(u){var e=u.exports={version:"2.6.5"};"number"==typeof __e&&(__e=e)})),r=(t.version,function(u){return"object"==typeof u?null!==u:"function"==typeof u}),n=function(u){if(!r(u))throw TypeError(u+" is not an object!");return u},i=function(u){try{return!!u()}catch(u){return!0}},s=!i((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})),D=e.document,o=r(D)&&r(D.createElement),a=function(u){return o?D.createElement(u):{}},c=!s&&!i((function(){return 7!=Object.defineProperty(a("div"),"a",{get:function(){return 7}}).a})),l=function(u,e){if(!r(u))return u;var t,n;if(e&&"function"==typeof(t=u.toString)&&!r(n=t.call(u)))return n;if("function"==typeof(t=u.valueOf)&&!r(n=t.call(u)))return n;if(!e&&"function"==typeof(t=u.toString)&&!r(n=t.call(u)))return n;throw TypeError("Can't convert object to primitive value")},C=Object.defineProperty,F={f:s?Object.defineProperty:function(u,e,t){if(n(u),e=l(e,!0),n(t),c)try{return C(u,e,t)}catch(u){}if("get"in t||"set"in t)throw TypeError("Accessors not supported!");return"value"in t&&(u[e]=t.value),u}},A=function(u,e){return{enumerable:!(1&u),configurable:!(2&u),writable:!(4&u),value:e}},E=s?function(u,e,t){return F.f(u,e,A(1,t))}:function(u,e,t){return u[e]=t,u},h={}.hasOwnProperty,f=function(u,e){return h.call(u,e)},d=0,g=Math.random(),B=function(u){return"Symbol(".concat(void 0===u?"":u,")_",(++d+g).toString(36))},p=!1,v=u((function(u){var r="__core-js_shared__",n=e[r]||(e[r]={});(u.exports=function(u,e){return n[u]||(n[u]=void 0!==e?e:{})})("versions",[]).push({version:t.version,mode:p?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})})),b=v("native-function-to-string",Function.toString),m=u((function(u){var r=B("src"),n="toString",i=(""+b).split(n);t.inspectSource=function(u){return b.call(u)},(u.exports=function(u,t,n,s){var D="function"==typeof n;D&&(f(n,"name")||E(n,"name",t)),u[t]!==n&&(D&&(f(n,r)||E(n,r,u[t]?""+u[t]:i.join(String(t)))),u===e?u[t]=n:s?u[t]?u[t]=n:E(u,t,n):(delete u[t],E(u,t,n)))})(Function.prototype,n,(function(){return"function"==typeof this&&this[r]||b.call(this)}))})),y=function(u){if("function"!=typeof u)throw TypeError(u+" is not a function!");return u},w=function(u,e,t){if(y(u),void 0===e)return u;switch(t){case 1:return function(t){return u.call(e,t)};case 2:return function(t,r){return u.call(e,t,r)};case 3:return function(t,r,n){return u.call(e,t,r,n)}}return function(){return u.apply(e,arguments)}},S="prototype",P=function(u,r,n){var i,s,D,o,a=u&P.F,c=u&P.G,l=u&P.S,C=u&P.P,F=u&P.B,A=c?e:l?e[r]||(e[r]={}):(e[r]||{})[S],h=c?t:t[r]||(t[r]={}),f=h[S]||(h[S]={});for(i in c&&(n=r),n)D=((s=!a&&A&&void 0!==A[i])?A:n)[i],o=F&&s?w(D,e):C&&"function"==typeof D?w(Function.call,D):D,A&&m(A,i,D,u&P.U),h[i]!=D&&E(h,i,o),C&&f[i]!=D&&(f[i]=D)};e.core=t,P.F=1,P.G=2,P.S=4,P.P=8,P.B=16,P.W=32,P.U=64,P.R=128;var $,x=P,j=Math.ceil,_=Math.floor,O=function(u){return isNaN(u=+u)?0:(u>0?_:j)(u)},k=function(u){if(null==u)throw TypeError("Can't call method on "+u);return u},N=($=!1,function(u,e){var t,r,n=String(k(u)),i=O(e),s=n.length;return i<0||i>=s?$?"":void 0:(t=n.charCodeAt(i))<55296||t>56319||i+1===s||(r=n.charCodeAt(i+1))<56320||r>57343?$?n.charAt(i):t:$?n.slice(i,i+2):r-56320+(t-55296<<10)+65536});x(x.P,"String",{codePointAt:function(u){return N(this,u)}}),t.String.codePointAt;var L=Math.max,I=Math.min,U=function(u,e){return(u=O(u))<0?L(u+e,0):I(u,e)},T=String.fromCharCode,M=String.fromCodePoint;x(x.S+x.F*(!!M&&1!=M.length),"String",{fromCodePoint:function(u){for(var e,t=arguments,r=[],n=arguments.length,i=0;n>i;){if(e=+t[i++],U(e,1114111)!==e)throw RangeError(e+" is not a valid code point");r.push(e<65536?T(e):T(55296+((e-=65536)>>10),e%1024+56320))}return r.join("")}}),t.String.fromCodePoint;var z,R,V,J,H,q,Z,G,Y,W,K,X,Q,uu,eu={Space_Separator:/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,ID_Start:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\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\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\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\u0AF9\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-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\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-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\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\u2160-\u2188\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-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\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]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,ID_Continue:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\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\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/},tu={isSpaceSeparator:function(u){return"string"==typeof u&&eu.Space_Separator.test(u)},isIdStartChar:function(u){return"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||"$"===u||"_"===u||eu.ID_Start.test(u))},isIdContinueChar:function(u){return"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||u>="0"&&u<="9"||"$"===u||"_"===u||"‌"===u||"‍"===u||eu.ID_Continue.test(u))},isDigit:function(u){return"string"==typeof u&&/[0-9]/.test(u)},isHexDigit:function(u){return"string"==typeof u&&/[0-9A-Fa-f]/.test(u)}},ru=function(u,e){z=String(u),R="start",V=[],J=0,H=1,q=0,Z=void 0,G=void 0,Y=void 0;do{Z=iu(),Au[R]()}while("eof"!==Z.type);return"function"==typeof e?nu({"":Y},"",e):Y};function nu(u,e,t){var r=u[e];if(null!=r&&"object"==typeof r)if(Array.isArray(r))for(var n=0;n0;){var t=su();if(!tu.isHexDigit(t))throw fu(Du());u+=Du()}return String.fromCodePoint(parseInt(u,16))}var Au={start:function(){if("eof"===Z.type)throw du();Eu()},beforePropertyName:function(){switch(Z.type){case"identifier":case"string":return G=Z.value,void(R="afterPropertyName");case"punctuator":return void hu();case"eof":throw du()}},afterPropertyName:function(){if("eof"===Z.type)throw du();R="beforePropertyValue"},beforePropertyValue:function(){if("eof"===Z.type)throw du();Eu()},beforeArrayValue:function(){if("eof"===Z.type)throw du();"punctuator"!==Z.type||"]"!==Z.value?Eu():hu()},afterPropertyValue:function(){if("eof"===Z.type)throw du();switch(Z.value){case",":return void(R="beforePropertyName");case"}":hu()}},afterArrayValue:function(){if("eof"===Z.type)throw du();switch(Z.value){case",":return void(R="beforeArrayValue");case"]":hu()}},end:function(){}};function Eu(){var u;switch(Z.type){case"punctuator":switch(Z.value){case"{":u={};break;case"[":u=[]}break;case"null":case"boolean":case"numeric":case"string":u=Z.value}if(void 0===Y)Y=u;else{var e=V[V.length-1];Array.isArray(e)?e.push(u):Object.defineProperty(e,G,{value:u,writable:!0,enumerable:!0,configurable:!0})}if(null!==u&&"object"==typeof u)V.push(u),R=Array.isArray(u)?"beforeArrayValue":"beforePropertyName";else{var t=V[V.length-1];R=null==t?"end":Array.isArray(t)?"afterArrayValue":"afterPropertyValue"}}function hu(){V.pop();var u=V[V.length-1];R=null==u?"end":Array.isArray(u)?"afterArrayValue":"afterPropertyValue"}function fu(u){return vu(void 0===u?"JSON5: invalid end of input at "+H+":"+q:"JSON5: invalid character '"+pu(u)+"' at "+H+":"+q)}function du(){return vu("JSON5: invalid end of input at "+H+":"+q)}function gu(){return vu("JSON5: invalid identifier character at "+H+":"+(q-=5))}function Bu(u){console.warn("JSON5: '"+pu(u)+"' in strings is not valid ECMAScript; consider escaping")}function pu(u){var e={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(e[u])return e[u];if(u<" "){var t=u.charCodeAt(0).toString(16);return"\\x"+("00"+t).substring(t.length)}return u}function vu(u){var e=new SyntaxError(u);return e.lineNumber=H,e.columnNumber=q,e}return{parse:ru,stringify:function(u,e,t){var r,n,i,s=[],D="",o="";if(null==e||"object"!=typeof e||Array.isArray(e)||(t=e.space,i=e.quote,e=e.replacer),"function"==typeof e)n=e;else if(Array.isArray(e)){r=[];for(var a=0,c=e;a0&&(t=Math.min(10,Math.floor(t)),o=" ".substr(0,t)):"string"==typeof t&&(o=t.substr(0,10)),F("",{"":u});function F(u,e){var t=e[u];switch(null!=t&&("function"==typeof t.toJSON5?t=t.toJSON5(u):"function"==typeof t.toJSON&&(t=t.toJSON(u))),n&&(t=n.call(e,u,t)),t instanceof Number?t=Number(t):t instanceof String?t=String(t):t instanceof Boolean&&(t=t.valueOf()),t){case null:return"null";case!0:return"true";case!1:return"false"}return"string"==typeof t?A(t,!1):"number"==typeof t?String(t):"object"==typeof t?Array.isArray(t)?f(t):E(t):void 0}function A(u){for(var e={"'":.1,'"':.2},t={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"},r="",n=0;n=0)throw TypeError("Converting circular structure to JSON5");s.push(u);var e=D;D+=o;for(var t,n,i=[],a=0,c=r||Object.keys(u);a=0)throw TypeError("Converting circular structure to JSON5");s.push(u);var e=D;D+=o;for(var t,r=[],n=0;n Date: Wed, 4 Oct 2023 08:56:45 +0800 Subject: [PATCH 3/6] Fix code smells --- modules/system/assets/js/snowboard/ajax/Request.js | 2 +- .../assets/js/snowboard/ajax/handlers/AttributeRequest.js | 2 +- modules/system/assets/js/snowboard/extras/AttachLoading.js | 2 +- modules/system/assets/js/snowboard/extras/Flash.js | 2 +- modules/system/assets/js/snowboard/extras/FlashListener.js | 2 +- modules/system/assets/js/snowboard/extras/FormValidation.js | 2 +- modules/system/assets/js/snowboard/extras/StripeLoader.js | 2 +- modules/system/assets/js/snowboard/extras/StylesheetLoader.js | 2 +- modules/system/assets/js/snowboard/extras/Transition.js | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/modules/system/assets/js/snowboard/ajax/Request.js b/modules/system/assets/js/snowboard/ajax/Request.js index 5dba0cb30..73c192d9c 100644 --- a/modules/system/assets/js/snowboard/ajax/Request.js +++ b/modules/system/assets/js/snowboard/ajax/Request.js @@ -1,4 +1,4 @@ -import { PluginBase } from "@wintercms/snowboard"; +import { PluginBase } from '@wintercms/snowboard'; /** * Request plugin. diff --git a/modules/system/assets/js/snowboard/ajax/handlers/AttributeRequest.js b/modules/system/assets/js/snowboard/ajax/handlers/AttributeRequest.js index d90073d7a..f308389e6 100644 --- a/modules/system/assets/js/snowboard/ajax/handlers/AttributeRequest.js +++ b/modules/system/assets/js/snowboard/ajax/handlers/AttributeRequest.js @@ -1,4 +1,4 @@ -import { Singleton } from "@wintercms/snowboard"; +import { Singleton } from '@wintercms/snowboard'; /** * Enable Data Attributes API for AJAX requests. diff --git a/modules/system/assets/js/snowboard/extras/AttachLoading.js b/modules/system/assets/js/snowboard/extras/AttachLoading.js index 4b082b097..50648760e 100644 --- a/modules/system/assets/js/snowboard/extras/AttachLoading.js +++ b/modules/system/assets/js/snowboard/extras/AttachLoading.js @@ -1,4 +1,4 @@ -import { Singleton } from "@wintercms/snowboard"; +import { Singleton } from '@wintercms/snowboard'; /** * Allows attaching a loading class on elements that an AJAX request is targeting. diff --git a/modules/system/assets/js/snowboard/extras/Flash.js b/modules/system/assets/js/snowboard/extras/Flash.js index 14fc69a78..863f0d29e 100644 --- a/modules/system/assets/js/snowboard/extras/Flash.js +++ b/modules/system/assets/js/snowboard/extras/Flash.js @@ -1,4 +1,4 @@ -import { PluginBase } from "@wintercms/snowboard"; +import { PluginBase } from '@wintercms/snowboard'; /** * Provides flash messages for the CMS. diff --git a/modules/system/assets/js/snowboard/extras/FlashListener.js b/modules/system/assets/js/snowboard/extras/FlashListener.js index 500e95187..a8194fe91 100644 --- a/modules/system/assets/js/snowboard/extras/FlashListener.js +++ b/modules/system/assets/js/snowboard/extras/FlashListener.js @@ -1,4 +1,4 @@ -import { Singleton } from "@wintercms/snowboard"; +import { Singleton } from '@wintercms/snowboard'; /** * Defines a default listener for flash events. diff --git a/modules/system/assets/js/snowboard/extras/FormValidation.js b/modules/system/assets/js/snowboard/extras/FormValidation.js index ea6489ece..af3f671d9 100644 --- a/modules/system/assets/js/snowboard/extras/FormValidation.js +++ b/modules/system/assets/js/snowboard/extras/FormValidation.js @@ -1,4 +1,4 @@ -import { Singleton } from "@wintercms/snowboard"; +import { Singleton } from '@wintercms/snowboard'; /** * Adds AJAX-driven form validation to Snowboard requests. diff --git a/modules/system/assets/js/snowboard/extras/StripeLoader.js b/modules/system/assets/js/snowboard/extras/StripeLoader.js index d66dcb980..b1152f415 100644 --- a/modules/system/assets/js/snowboard/extras/StripeLoader.js +++ b/modules/system/assets/js/snowboard/extras/StripeLoader.js @@ -1,4 +1,4 @@ -import { Singleton } from "@wintercms/snowboard"; +import { Singleton } from '@wintercms/snowboard'; /** * Displays a stripe at the top of the page that indicates loading. diff --git a/modules/system/assets/js/snowboard/extras/StylesheetLoader.js b/modules/system/assets/js/snowboard/extras/StylesheetLoader.js index 8ec36580c..b29bedaff 100644 --- a/modules/system/assets/js/snowboard/extras/StylesheetLoader.js +++ b/modules/system/assets/js/snowboard/extras/StylesheetLoader.js @@ -1,4 +1,4 @@ -import { Singleton } from "@wintercms/snowboard"; +import { Singleton } from '@wintercms/snowboard'; /** * Embeds the "extras" stylesheet into the page, if it is not loaded through the theme. diff --git a/modules/system/assets/js/snowboard/extras/Transition.js b/modules/system/assets/js/snowboard/extras/Transition.js index b7d16492b..48b9a1467 100644 --- a/modules/system/assets/js/snowboard/extras/Transition.js +++ b/modules/system/assets/js/snowboard/extras/Transition.js @@ -1,4 +1,4 @@ -import { PluginBase } from "@wintercms/snowboard"; +import { PluginBase } from '@wintercms/snowboard'; /** * Provides transition support for elements. From cbba26874484f77acdb9788f0aa02a769f918a5a Mon Sep 17 00:00:00 2001 From: Ben Thomson Date: Wed, 4 Oct 2023 09:09:07 +0800 Subject: [PATCH 4/6] Update Snowboard to v0.5.0 --- .../formwidgets/colorpicker/assets/js/dist/colorpicker.js | 4 +--- modules/system/package.json | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/modules/backend/formwidgets/colorpicker/assets/js/dist/colorpicker.js b/modules/backend/formwidgets/colorpicker/assets/js/dist/colorpicker.js index 5fd8bf6d6..d5fd2c593 100644 --- a/modules/backend/formwidgets/colorpicker/assets/js/dist/colorpicker.js +++ b/modules/backend/formwidgets/colorpicker/assets/js/dist/colorpicker.js @@ -1,3 +1 @@ -(self.webpackChunk_wintercms_wn_backend_module=self.webpackChunk_wintercms_wn_backend_module||[]).push([[728],{562:function(t){ -/*! Pickr 1.8.2 MIT | https://github.com/Simonwep/pickr */ -self,t.exports=(()=>{"use strict";var t={d:(e,o)=>{for(var r in o)t.o(o,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:o[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.d(e,{default:()=>E});var o={};function r(t,e,o,r,i={}){e instanceof HTMLCollection||e instanceof NodeList?e=Array.from(e):Array.isArray(e)||(e=[e]),Array.isArray(o)||(o=[o]);for(const n of e)for(const e of o)n[t](e,r,{capture:!1,...i});return Array.prototype.slice.call(arguments,1)}t.r(o),t.d(o,{adjustableInputNumbers:()=>p,createElementFromString:()=>s,createFromTemplate:()=>a,eventPath:()=>c,off:()=>n,on:()=>i,resolveElement:()=>l});const i=r.bind(null,"addEventListener"),n=r.bind(null,"removeEventListener");function s(t){const e=document.createElement("div");return e.innerHTML=t.trim(),e.firstElementChild}function a(t){const e=(t,e)=>{const o=t.getAttribute(e);return t.removeAttribute(e),o},o=(t,r={})=>{const i=e(t,":obj"),n=e(t,":ref"),s=i?r[i]={}:r;n&&(r[n]=t);for(const r of Array.from(t.children)){const t=e(r,":arr"),i=o(r,t?{}:s);t&&(s[t]||(s[t]=[])).push(Object.keys(i).length?i:r)}return r};return o(s(t))}function c(t){let e=t.path||t.composedPath&&t.composedPath();if(e)return e;let o=t.target.parentElement;for(e=[t.target,o];o=o.parentElement;)e.push(o);return e.push(document,window),e}function l(t){return t instanceof Element?t:"string"==typeof t?t.split(/>>/g).reduce(((t,e,o,r)=>(t=t.querySelector(e),ot)){function o(o){const r=[.001,.01,.1][Number(o.shiftKey||2*o.ctrlKey)]*(o.deltaY<0?1:-1);let i=0,n=t.selectionStart;t.value=t.value.replace(/[\d.]+/g,((t,o)=>o<=n&&o+t.length>=n?(n=o,e(Number(t),r,i)):(i++,t))),t.focus(),t.setSelectionRange(n,n),o.preventDefault(),t.dispatchEvent(new Event("input"))}i(t,"focus",(()=>i(window,"wheel",o,{passive:!1}))),i(t,"blur",(()=>n(window,"wheel",o)))}const{min:h,max:u,floor:d,round:g}=Math;function f(t,e,o){e/=100,o/=100;const r=d(t=t/360*6),i=t-r,n=o*(1-e),s=o*(1-i*e),a=o*(1-(1-i)*e),c=r%6;return[255*[o,s,n,n,a,o][c],255*[a,o,o,s,n,n][c],255*[n,n,a,o,o,s][c]]}function m(t,e,o){const r=(2-(e/=100))*(o/=100)/2;return 0!==r&&(e=1===r?0:r<.5?e*o/(2*r):e*o/(2-2*r)),[t,100*e,100*r]}function v(t,e,o){const r=h(t/=255,e/=255,o/=255),i=u(t,e,o),n=i-r;let s,a;if(0===n)s=a=0;else{a=n/i;const r=((i-t)/6+n/2)/n,c=((i-e)/6+n/2)/n,l=((i-o)/6+n/2)/n;t===i?s=l-c:e===i?s=1/3+r-l:o===i&&(s=2/3+c-r),s<0?s+=1:s>1&&(s-=1)}return[360*s,100*a,100*i]}function b(t,e,o,r){return e/=100,o/=100,[...v(255*(1-h(1,(t/=100)*(1-(r/=100))+r)),255*(1-h(1,e*(1-r)+r)),255*(1-h(1,o*(1-r)+r)))]}function k(t,e,o){e/=100;const r=2*(e*=(o/=100)<.5?o:1-o)/(o+e)*100,i=100*(o+e);return[t,isNaN(r)?0:r,i]}function w(t){return v(...t.match(/.{2}/g).map((t=>parseInt(t,16))))}function y(t){t=t.match(/^[a-zA-Z]+$/)?function(t){if("black"===t.toLowerCase())return"#000";const e=document.createElement("canvas").getContext("2d");return e.fillStyle=t,"#000"===e.fillStyle?null:e.fillStyle}(t):t;const e={cmyk:/^cmyk[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)/i,rgba:/^((rgba)|rgb)[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)[\D]*?([\d.]+|$)/i,hsla:/^((hsla)|hsl)[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)[\D]*?([\d.]+|$)/i,hsva:/^((hsva)|hsv)[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)[\D]*?([\d.]+|$)/i,hexa:/^#?(([\dA-Fa-f]{3,4})|([\dA-Fa-f]{6})|([\dA-Fa-f]{8}))$/i},o=t=>t.map((t=>/^(|\d+)\.\d+|\d+$/.test(t)?Number(t):void 0));let r;t:for(const i in e){if(!(r=e[i].exec(t)))continue;const n=t=>!!r[2]==("number"==typeof t);switch(i){case"cmyk":{const[,t,e,n,s]=o(r);if(t>100||e>100||n>100||s>100)break t;return{values:b(t,e,n,s),type:i}}case"rgba":{const[,,,t,e,s,a]=o(r);if(t>255||e>255||s>255||a<0||a>1||!n(a))break t;return{values:[...v(t,e,s),a],a:a,type:i}}case"hexa":{let[,t]=r;4!==t.length&&3!==t.length||(t=t.split("").map((t=>t+t)).join(""));const e=t.substring(0,6);let o=t.substring(6);return o=o?parseInt(o,16)/255:void 0,{values:[...w(e),o],a:o,type:i}}case"hsla":{const[,,,t,e,s,a]=o(r);if(t>360||e>100||s>100||a<0||a>1||!n(a))break t;return{values:[...k(t,e,s),a],a:a,type:i}}case"hsva":{const[,,,t,e,s,a]=o(r);if(t>360||e>100||s>100||a<0||a>1||!n(a))break t;return{values:[t,e,s,a],a:a,type:i}}}}return{values:null,type:null}}function _(t=0,e=0,o=0,r=1){const i=(t,e)=>(o=-1)=>e(~o?t.map((t=>Number(t.toFixed(o)))):t),n={h:t,s:e,v:o,a:r,toHSVA(){const t=[n.h,n.s,n.v,n.a];return t.toString=i(t,(t=>`hsva(${t[0]}, ${t[1]}%, ${t[2]}%, ${n.a})`)),t},toHSLA(){const t=[...m(n.h,n.s,n.v),n.a];return t.toString=i(t,(t=>`hsla(${t[0]}, ${t[1]}%, ${t[2]}%, ${n.a})`)),t},toRGBA(){const t=[...f(n.h,n.s,n.v),n.a];return t.toString=i(t,(t=>`rgba(${t[0]}, ${t[1]}, ${t[2]}, ${n.a})`)),t},toCMYK(){const t=function(t,e,o){const r=f(t,e,o),i=r[0]/255,n=r[1]/255,s=r[2]/255,a=h(1-i,1-n,1-s);return[100*(1===a?0:(1-i-a)/(1-a)),100*(1===a?0:(1-n-a)/(1-a)),100*(1===a?0:(1-s-a)/(1-a)),100*a]}(n.h,n.s,n.v);return t.toString=i(t,(t=>`cmyk(${t[0]}%, ${t[1]}%, ${t[2]}%, ${t[3]}%)`)),t},toHEXA(){const t=function(t,e,o){return f(t,e,o).map((t=>g(t).toString(16).padStart(2,"0")))}(n.h,n.s,n.v),e=n.a>=1?"":Number((255*n.a).toFixed(0)).toString(16).toUpperCase().padStart(2,"0");return e&&t.push(e),t.toString=()=>`#${t.join("").toUpperCase()}`,t},clone:()=>_(n.h,n.s,n.v,n.a)};return n}const C=t=>Math.max(Math.min(t,1),0);function x(t){const e={options:Object.assign({lock:null,onchange:()=>0,onstop:()=>0},t),_keyboard(t){const{options:o}=e,{type:r,key:i}=t;if(document.activeElement===o.wrapper){const{lock:o}=e.options,n="ArrowUp"===i,s="ArrowRight"===i,a="ArrowDown"===i,c="ArrowLeft"===i;if("keydown"===r&&(n||s||a||c)){let r=0,i=0;"v"===o?r=n||s?1:-1:"h"===o?r=n||s?-1:1:(i=n?-1:a?1:0,r=c?-1:s?1:0),e.update(C(e.cache.x+.01*r),C(e.cache.y+.01*i)),t.preventDefault()}else i.startsWith("Arrow")&&(e.options.onstop(),t.preventDefault())}},_tapstart(t){i(document,["mouseup","touchend","touchcancel"],e._tapstop),i(document,["mousemove","touchmove"],e._tapmove),t.cancelable&&t.preventDefault(),e._tapmove(t)},_tapmove(t){const{options:o,cache:r}=e,{lock:i,element:n,wrapper:s}=o,a=s.getBoundingClientRect();let c=0,l=0;if(t){const e=t&&t.touches&&t.touches[0];c=t?(e||t).clientX:0,l=t?(e||t).clientY:0,ca.left+a.width&&(c=a.left+a.width),la.top+a.height&&(l=a.top+a.height),c-=a.left,l-=a.top}else r&&(c=r.x*a.width,l=r.y*a.height);"h"!==i&&(n.style.left=`calc(${c/a.width*100}% - ${n.offsetWidth/2}px)`),"v"!==i&&(n.style.top=`calc(${l/a.height*100}% - ${n.offsetHeight/2}px)`),e.cache={x:c/a.width,y:l/a.height};const p=C(c/a.width),h=C(l/a.height);switch(i){case"v":return o.onchange(p);case"h":return o.onchange(h);default:return o.onchange(p,h)}},_tapstop(){e.options.onstop(),n(document,["mouseup","touchend","touchcancel"],e._tapstop),n(document,["mousemove","touchmove"],e._tapmove)},trigger(){e._tapmove()},update(t=0,o=0){const{left:r,top:i,width:n,height:s}=e.options.wrapper.getBoundingClientRect();"h"===e.options.lock&&(o=t),e._tapmove({clientX:r+n*t,clientY:i+s*o})},destroy(){const{options:t,_tapstart:o,_keyboard:r}=e;n(document,["keydown","keyup"],r),n([t.wrapper,t.element],"mousedown",o),n([t.wrapper,t.element],"touchstart",o,{passive:!1})}},{options:o,_tapstart:r,_keyboard:s}=e;return i([o.wrapper,o.element],"mousedown",r),i([o.wrapper,o.element],"touchstart",r,{passive:!1}),i(document,["keydown","keyup"],s),e}function A(t={}){t=Object.assign({onchange:()=>0,className:"",elements:[]},t);const e=i(t.elements,"click",(e=>{t.elements.forEach((o=>o.classList[e.target===o?"add":"remove"](t.className))),t.onchange(e),e.stopPropagation()}));return{destroy:()=>n(...e)}}const S={variantFlipOrder:{start:"sme",middle:"mse",end:"ems"},positionFlipOrder:{top:"tbrl",right:"rltb",bottom:"btrl",left:"lrbt"},position:"bottom",margin:8},H=(t,e,o)=>{const{container:r,margin:i,position:n,variantFlipOrder:s,positionFlipOrder:a}={container:document.documentElement.getBoundingClientRect(),...S,...o},{left:c,top:l}=e.style;e.style.left="0",e.style.top="0";const p=t.getBoundingClientRect(),h=e.getBoundingClientRect(),u={t:p.top-h.height-i,b:p.bottom+i,r:p.right+i,l:p.left-h.width-i},d={vs:p.left,vm:p.left+p.width/2+-h.width/2,ve:p.left+p.width-h.width,hs:p.top,hm:p.bottom-p.height/2-h.height/2,he:p.bottom-h.height},[g,f="middle"]=n.split("-"),m=a[g],v=s[f],{top:b,left:k,bottom:w,right:y}=r;for(const t of m){const o="t"===t||"b"===t,r=u[t],[i,n]=o?["top","left"]:["left","top"],[s,a]=o?[h.height,h.width]:[h.width,h.height],[c,l]=o?[w,y]:[y,w],[p,g]=o?[b,k]:[k,b];if(!(rc))for(const s of v){const c=d[(o?"v":"h")+s];if(!(cl))return e.style[n]=c-h[n]+"px",e.style[i]=r-h[i]+"px",t+s}}return e.style.left=c,e.style.top=l,null};function V(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}class E{constructor(t){V(this,"_initializingActive",!0),V(this,"_recalc",!0),V(this,"_nanopop",null),V(this,"_root",null),V(this,"_color",_()),V(this,"_lastColor",_()),V(this,"_swatchColors",[]),V(this,"_setupAnimationFrame",null),V(this,"_eventListener",{init:[],save:[],hide:[],show:[],clear:[],change:[],changestop:[],cancel:[],swatchselect:[]}),this.options=t=Object.assign({...E.DEFAULT_OPTIONS},t);const{swatches:e,components:o,theme:r,sliders:i,lockOpacity:n,padding:s}=t;["nano","monolith"].includes(r)&&!i&&(t.sliders="h"),o.interaction||(o.interaction={});const{preview:a,opacity:c,hue:l,palette:p}=o;o.opacity=!n&&c,o.palette=p||a||c||l,this._preBuild(),this._buildComponents(),this._bindEvents(),this._finalBuild(),e&&e.length&&e.forEach((t=>this.addSwatch(t)));const{button:h,app:u}=this._root;this._nanopop=((t,e,o)=>{const r="object"!=typeof t||t instanceof HTMLElement?{reference:t,popper:e,...o}:t;return{update(t=r){const{reference:e,popper:o}=Object.assign(r,t);if(!o||!e)throw new Error("Popper- or reference-element missing.");return H(e,o,r)}}})(h,u,{margin:s}),h.setAttribute("role","button"),h.setAttribute("aria-label",this._t("btn:toggle"));const d=this;this._setupAnimationFrame=requestAnimationFrame((function e(){if(!u.offsetWidth)return requestAnimationFrame(e);d.setColor(t.default),d._rePositioningPicker(),t.defaultRepresentation&&(d._representation=t.defaultRepresentation,d.setColorRepresentation(d._representation)),t.showAlways&&d.show(),d._initializingActive=!1,d._emit("init")}))}_preBuild(){const{options:t}=this;for(const e of["el","container"])t[e]=l(t[e]);this._root=(t=>{const{components:e,useAsButton:o,inline:r,appClass:i,theme:n,lockOpacity:s}=t.options,c=t=>t?"":'style="display:none" hidden',l=e=>t._t(e),p=a(`\n
\n\n ${o?"":''}\n\n
\n
\n
\n \n
\n
\n\n
\n
\n
\n
\n\n
\n
\n
\n
\n\n
\n
\n
\n
\n
\n\n
\n\n
\n \n\n \n \n \n \n \n\n \n \n \n
\n
\n
\n `),h=p.interaction;return h.options.find((t=>!t.hidden&&!t.classList.add("active"))),h.type=()=>h.options.find((t=>t.classList.contains("active"))),p})(this),t.useAsButton&&(this._root.button=t.el),t.container.appendChild(this._root.root)}_finalBuild(){const t=this.options,e=this._root;if(t.container.removeChild(e.root),t.inline){const o=t.el.parentElement;t.el.nextSibling?o.insertBefore(e.app,t.el.nextSibling):o.appendChild(e.app)}else t.container.appendChild(e.app);t.useAsButton?t.inline&&t.el.remove():t.el.parentNode.replaceChild(e.root,t.el),t.disabled&&this.disable(),t.comparison||(e.button.style.transition="none",t.useAsButton||(e.preview.lastColor.style.transition="none")),this.hide()}_buildComponents(){const t=this,e=this.options.components,o=(t.options.sliders||"v").repeat(2),[r,i]=o.match(/^[vh]+$/g)?o:[],n=()=>this._color||(this._color=this._lastColor.clone()),s={palette:x({element:t._root.palette.picker,wrapper:t._root.palette.palette,onstop:()=>t._emit("changestop","slider",t),onchange(o,r){if(!e.palette)return;const i=n(),{_root:s,options:a}=t,{lastColor:c,currentColor:l}=s.preview;t._recalc&&(i.s=100*o,i.v=100-100*r,i.v<0&&(i.v=0),t._updateOutput("slider"));const p=i.toRGBA().toString(0);this.element.style.background=p,this.wrapper.style.background=`\n linear-gradient(to top, rgba(0, 0, 0, ${i.a}), transparent),\n linear-gradient(to left, hsla(${i.h}, 100%, 50%, ${i.a}), rgba(255, 255, 255, ${i.a}))\n `,a.comparison?a.useAsButton||t._lastColor||c.style.setProperty("--pcr-color",p):(s.button.style.setProperty("--pcr-color",p),s.button.classList.remove("clear"));const h=i.toHEXA().toString();for(const{el:e,color:o}of t._swatchColors)e.classList[h===o.toHEXA().toString()?"add":"remove"]("pcr-active");l.style.setProperty("--pcr-color",p)}}),hue:x({lock:"v"===i?"h":"v",element:t._root.hue.picker,wrapper:t._root.hue.slider,onstop:()=>t._emit("changestop","slider",t),onchange(o){if(!e.hue||!e.palette)return;const r=n();t._recalc&&(r.h=360*o),this.element.style.backgroundColor=`hsl(${r.h}, 100%, 50%)`,s.palette.trigger()}}),opacity:x({lock:"v"===r?"h":"v",element:t._root.opacity.picker,wrapper:t._root.opacity.slider,onstop:()=>t._emit("changestop","slider",t),onchange(o){if(!e.opacity||!e.palette)return;const r=n();t._recalc&&(r.a=Math.round(100*o)/100),this.element.style.background=`rgba(0, 0, 0, ${r.a})`,s.palette.trigger()}}),selectable:A({elements:t._root.interaction.options,className:"active",onchange(e){t._representation=e.target.getAttribute("data-type").toUpperCase(),t._recalc&&t._updateOutput("swatch")}})};this._components=s}_bindEvents(){const{_root:t,options:e}=this,o=[i(t.interaction.clear,"click",(()=>this._clearColor())),i([t.interaction.cancel,t.preview.lastColor],"click",(()=>{this.setHSVA(...(this._lastColor||this._color).toHSVA(),!0),this._emit("cancel")})),i(t.interaction.save,"click",(()=>{!this.applyColor()&&!e.showAlways&&this.hide()})),i(t.interaction.result,["keyup","input"],(t=>{this.setColor(t.target.value,!0)&&!this._initializingActive&&(this._emit("change",this._color,"input",this),this._emit("changestop","input",this)),t.stopImmediatePropagation()})),i(t.interaction.result,["focus","blur"],(t=>{this._recalc="blur"===t.type,this._recalc&&this._updateOutput(null)})),i([t.palette.palette,t.palette.picker,t.hue.slider,t.hue.picker,t.opacity.slider,t.opacity.picker],["mousedown","touchstart"],(()=>this._recalc=!0),{passive:!0})];if(!e.showAlways){const r=e.closeWithKey;o.push(i(t.button,"click",(()=>this.isOpen()?this.hide():this.show())),i(document,"keyup",(t=>this.isOpen()&&(t.key===r||t.code===r)&&this.hide())),i(document,["touchstart","mousedown"],(e=>{this.isOpen()&&!c(e).some((e=>e===t.app||e===t.button))&&this.hide()}),{capture:!0}))}if(e.adjustableNumbers){const e={rgba:[255,255,255,1],hsva:[360,100,100,1],hsla:[360,100,100,1],cmyk:[100,100,100,100]};p(t.interaction.result,((t,o,r)=>{const i=e[this.getColorRepresentation().toLowerCase()];if(i){const e=i[r],n=t+(e>=100?1e3*o:o);return n<=0?0:Number((n{r.isOpen()&&(e.closeOnScroll&&r.hide(),null===t?(t=setTimeout((()=>t=null),100),requestAnimationFrame((function e(){r._rePositioningPicker(),null!==t&&requestAnimationFrame(e)}))):(clearTimeout(t),t=setTimeout((()=>t=null),100)))}),{capture:!0}))}this._eventBindings=o}_rePositioningPicker(){const{options:t}=this;if(!t.inline&&!this._nanopop.update({container:document.body.getBoundingClientRect(),position:t.position})){const t=this._root.app,e=t.getBoundingClientRect();t.style.top=(window.innerHeight-e.height)/2+"px",t.style.left=(window.innerWidth-e.width)/2+"px"}}_updateOutput(t){const{_root:e,_color:o,options:r}=this;if(e.interaction.type()){const t=`to${e.interaction.type().getAttribute("data-type")}`;e.interaction.result.value="function"==typeof o[t]?o[t]().toString(r.outputPrecision):""}!this._initializingActive&&this._recalc&&this._emit("change",o,t,this)}_clearColor(t=!1){const{_root:e,options:o}=this;o.useAsButton||e.button.style.setProperty("--pcr-color","rgba(0, 0, 0, 0.15)"),e.button.classList.add("clear"),o.showAlways||this.hide(),this._lastColor=null,this._initializingActive||t||(this._emit("save",null),this._emit("clear"))}_parseLocalColor(t){const{values:e,type:o,a:r}=y(t),{lockOpacity:i}=this.options,n=void 0!==r&&1!==r;return e&&3===e.length&&(e[3]=void 0),{values:!e||i&&n?null:e,type:o}}_t(t){return this.options.i18n[t]||E.I18N_DEFAULTS[t]}_emit(t,...e){this._eventListener[t].forEach((t=>t(...e,this)))}on(t,e){return this._eventListener[t].push(e),this}off(t,e){const o=this._eventListener[t]||[],r=o.indexOf(e);return~r&&o.splice(r,1),this}addSwatch(t){const{values:e}=this._parseLocalColor(t);if(e){const{_swatchColors:t,_root:o}=this,r=_(...e),n=s(`'}\n\n
\n
\n
\n \n
\n
\n\n
\n
\n
\n
\n\n
\n
\n
\n
\n\n
\n
\n
\n
\n
\n\n
\n\n
\n \n\n \n \n \n \n \n\n \n \n \n
\n
\n
\n `),h=p.interaction;return h.options.find((t=>!t.hidden&&!t.classList.add("active"))),h.type=()=>h.options.find((t=>t.classList.contains("active"))),p})(this),t.useAsButton&&(this._root.button=t.el),t.container.appendChild(this._root.root)}_finalBuild(){const t=this.options,e=this._root;if(t.container.removeChild(e.root),t.inline){const o=t.el.parentElement;t.el.nextSibling?o.insertBefore(e.app,t.el.nextSibling):o.appendChild(e.app)}else t.container.appendChild(e.app);t.useAsButton?t.inline&&t.el.remove():t.el.parentNode.replaceChild(e.root,t.el),t.disabled&&this.disable(),t.comparison||(e.button.style.transition="none",t.useAsButton||(e.preview.lastColor.style.transition="none")),this.hide()}_buildComponents(){const t=this,e=this.options.components,o=(t.options.sliders||"v").repeat(2),[r,i]=o.match(/^[vh]+$/g)?o:[],n=()=>this._color||(this._color=this._lastColor.clone()),s={palette:C({element:t._root.palette.picker,wrapper:t._root.palette.palette,onstop:()=>t._emit("changestop","slider",t),onchange(o,r){if(!e.palette)return;const i=n(),{_root:s,options:a}=t,{lastColor:c,currentColor:l}=s.preview;t._recalc&&(i.s=100*o,i.v=100-100*r,i.v<0&&(i.v=0),t._updateOutput("slider"));const p=i.toRGBA().toString(0);this.element.style.background=p,this.wrapper.style.background=`\n linear-gradient(to top, rgba(0, 0, 0, ${i.a}), transparent),\n linear-gradient(to left, hsla(${i.h}, 100%, 50%, ${i.a}), rgba(255, 255, 255, ${i.a}))\n `,a.comparison?a.useAsButton||t._lastColor||c.style.setProperty("--pcr-color",p):(s.button.style.setProperty("--pcr-color",p),s.button.classList.remove("clear"));const h=i.toHEXA().toString();for(const{el:e,color:o}of t._swatchColors)e.classList[h===o.toHEXA().toString()?"add":"remove"]("pcr-active");l.style.setProperty("--pcr-color",p)}}),hue:C({lock:"v"===i?"h":"v",element:t._root.hue.picker,wrapper:t._root.hue.slider,onstop:()=>t._emit("changestop","slider",t),onchange(o){if(!e.hue||!e.palette)return;const r=n();t._recalc&&(r.h=360*o),this.element.style.backgroundColor=`hsl(${r.h}, 100%, 50%)`,s.palette.trigger()}}),opacity:C({lock:"v"===r?"h":"v",element:t._root.opacity.picker,wrapper:t._root.opacity.slider,onstop:()=>t._emit("changestop","slider",t),onchange(o){if(!e.opacity||!e.palette)return;const r=n();t._recalc&&(r.a=Math.round(100*o)/100),this.element.style.background=`rgba(0, 0, 0, ${r.a})`,s.palette.trigger()}}),selectable:x({elements:t._root.interaction.options,className:"active",onchange(e){t._representation=e.target.getAttribute("data-type").toUpperCase(),t._recalc&&t._updateOutput("swatch")}})};this._components=s}_bindEvents(){const{_root:t,options:e}=this,o=[i(t.interaction.clear,"click",(()=>this._clearColor())),i([t.interaction.cancel,t.preview.lastColor],"click",(()=>{this.setHSVA(...(this._lastColor||this._color).toHSVA(),!0),this._emit("cancel")})),i(t.interaction.save,"click",(()=>{!this.applyColor()&&!e.showAlways&&this.hide()})),i(t.interaction.result,["keyup","input"],(t=>{this.setColor(t.target.value,!0)&&!this._initializingActive&&(this._emit("change",this._color,"input",this),this._emit("changestop","input",this)),t.stopImmediatePropagation()})),i(t.interaction.result,["focus","blur"],(t=>{this._recalc="blur"===t.type,this._recalc&&this._updateOutput(null)})),i([t.palette.palette,t.palette.picker,t.hue.slider,t.hue.picker,t.opacity.slider,t.opacity.picker],["mousedown","touchstart"],(()=>this._recalc=!0),{passive:!0})];if(!e.showAlways){const r=e.closeWithKey;o.push(i(t.button,"click",(()=>this.isOpen()?this.hide():this.show())),i(document,"keyup",(t=>this.isOpen()&&(t.key===r||t.code===r)&&this.hide())),i(document,["touchstart","mousedown"],(e=>{this.isOpen()&&!c(e).some((e=>e===t.app||e===t.button))&&this.hide()}),{capture:!0}))}if(e.adjustableNumbers){const e={rgba:[255,255,255,1],hsva:[360,100,100,1],hsla:[360,100,100,1],cmyk:[100,100,100,100]};p(t.interaction.result,((t,o,r)=>{const i=e[this.getColorRepresentation().toLowerCase()];if(i){const e=i[r],n=t+(e>=100?1e3*o:o);return n<=0?0:Number((n{r.isOpen()&&(e.closeOnScroll&&r.hide(),null===t?(t=setTimeout((()=>t=null),100),requestAnimationFrame((function e(){r._rePositioningPicker(),null!==t&&requestAnimationFrame(e)}))):(clearTimeout(t),t=setTimeout((()=>t=null),100)))}),{capture:!0}))}this._eventBindings=o}_rePositioningPicker(){const{options:t}=this;if(!t.inline&&!this._nanopop.update({container:document.body.getBoundingClientRect(),position:t.position})){const t=this._root.app,e=t.getBoundingClientRect();t.style.top=(window.innerHeight-e.height)/2+"px",t.style.left=(window.innerWidth-e.width)/2+"px"}}_updateOutput(t){const{_root:e,_color:o,options:r}=this;if(e.interaction.type()){const t=`to${e.interaction.type().getAttribute("data-type")}`;e.interaction.result.value="function"==typeof o[t]?o[t]().toString(r.outputPrecision):""}!this._initializingActive&&this._recalc&&this._emit("change",o,t,this)}_clearColor(t=!1){const{_root:e,options:o}=this;o.useAsButton||e.button.style.setProperty("--pcr-color","rgba(0, 0, 0, 0.15)"),e.button.classList.add("clear"),o.showAlways||this.hide(),this._lastColor=null,this._initializingActive||t||(this._emit("save",null),this._emit("clear"))}_parseLocalColor(t){const{values:e,type:o,a:r}=function(t){t=t.match(/^[a-zA-Z]+$/)?function(t){if("black"===t.toLowerCase())return"#000";const e=document.createElement("canvas").getContext("2d");return e.fillStyle=t,"#000"===e.fillStyle?null:e.fillStyle}(t):t;const e={cmyk:/^cmyk\D+([\d.]+)\D+([\d.]+)\D+([\d.]+)\D+([\d.]+)/i,rgba:/^rgba?\D+([\d.]+)(%?)\D+([\d.]+)(%?)\D+([\d.]+)(%?)\D*?(([\d.]+)(%?)|$)/i,hsla:/^hsla?\D+([\d.]+)\D+([\d.]+)\D+([\d.]+)\D*?(([\d.]+)(%?)|$)/i,hsva:/^hsva?\D+([\d.]+)\D+([\d.]+)\D+([\d.]+)\D*?(([\d.]+)(%?)|$)/i,hexa:/^#?(([\dA-Fa-f]{3,4})|([\dA-Fa-f]{6})|([\dA-Fa-f]{8}))$/i},o=t=>t.map((t=>/^(|\d+)\.\d+|\d+$/.test(t)?Number(t):void 0));let r;t:for(const i in e)if(r=e[i].exec(t))switch(i){case"cmyk":{const[,t,e,n,s]=o(r);if(t>100||e>100||n>100||s>100)break t;return{values:b(t,e,n,s),type:i}}case"rgba":{let[,t,,e,,n,,,s]=o(r);if(t="%"===r[2]?t/100*255:t,e="%"===r[4]?e/100*255:e,n="%"===r[6]?n/100*255:n,s="%"===r[9]?s/100:s,t>255||e>255||n>255||s<0||s>1)break t;return{values:[...v(t,e,n),s],a:s,type:i}}case"hexa":{let[,t]=r;4!==t.length&&3!==t.length||(t=t.split("").map((t=>t+t)).join(""));const e=t.substring(0,6);let o=t.substring(6);return o=o?parseInt(o,16)/255:void 0,{values:[...w(e),o],a:o,type:i}}case"hsla":{let[,t,e,n,,s]=o(r);if(s="%"===r[6]?s/100:s,t>360||e>100||n>100||s<0||s>1)break t;return{values:[...k(t,e,n),s],a:s,type:i}}case"hsva":{let[,t,e,n,,s]=o(r);if(s="%"===r[6]?s/100:s,t>360||e>100||n>100||s<0||s>1)break t;return{values:[t,e,n,s],a:s,type:i}}}return{values:null,type:null}}(t),{lockOpacity:i}=this.options,n=void 0!==r&&1!==r;return e&&3===e.length&&(e[3]=void 0),{values:!e||i&&n?null:e,type:o}}_t(t){return this.options.i18n[t]||S.I18N_DEFAULTS[t]}_emit(t,...e){this._eventListener[t].forEach((t=>t(...e,this)))}on(t,e){return this._eventListener[t].push(e),this}off(t,e){const o=this._eventListener[t]||[],r=o.indexOf(e);return~r&&o.splice(r,1),this}addSwatch(t){const{values:e}=this._parseLocalColor(t);if(e){const{_swatchColors:t,_root:o}=this,r=y(...e),n=s(`'}\n\n
\n
\n
\n \n
\n
\n\n
\n
\n
\n
\n\n
\n
\n
\n
\n\n
\n
\n
\n
\n
\n\n
\n\n
\n \n\n \n \n \n \n \n\n \n \n \n
\n
\n
\n `),h=p.interaction;return h.options.find((t=>!t.hidden&&!t.classList.add("active"))),h.type=()=>h.options.find((t=>t.classList.contains("active"))),p})(this),t.useAsButton&&(this._root.button=t.el),t.container.appendChild(this._root.root)}_finalBuild(){const t=this.options,e=this._root;if(t.container.removeChild(e.root),t.inline){const o=t.el.parentElement;t.el.nextSibling?o.insertBefore(e.app,t.el.nextSibling):o.appendChild(e.app)}else t.container.appendChild(e.app);t.useAsButton?t.inline&&t.el.remove():t.el.parentNode.replaceChild(e.root,t.el),t.disabled&&this.disable(),t.comparison||(e.button.style.transition="none",t.useAsButton||(e.preview.lastColor.style.transition="none")),this.hide()}_buildComponents(){const t=this,e=this.options.components,o=(t.options.sliders||"v").repeat(2),[r,i]=o.match(/^[vh]+$/g)?o:[],n=()=>this._color||(this._color=this._lastColor.clone()),s={palette:C({element:t._root.palette.picker,wrapper:t._root.palette.palette,onstop:()=>t._emit("changestop","slider",t),onchange(o,r){if(!e.palette)return;const i=n(),{_root:s,options:a}=t,{lastColor:c,currentColor:l}=s.preview;t._recalc&&(i.s=100*o,i.v=100-100*r,i.v<0&&(i.v=0),t._updateOutput("slider"));const p=i.toRGBA().toString(0);this.element.style.background=p,this.wrapper.style.background=`\n linear-gradient(to top, rgba(0, 0, 0, ${i.a}), transparent),\n linear-gradient(to left, hsla(${i.h}, 100%, 50%, ${i.a}), rgba(255, 255, 255, ${i.a}))\n `,a.comparison?a.useAsButton||t._lastColor||c.style.setProperty("--pcr-color",p):(s.button.style.setProperty("--pcr-color",p),s.button.classList.remove("clear"));const h=i.toHEXA().toString();for(const{el:e,color:o}of t._swatchColors)e.classList[h===o.toHEXA().toString()?"add":"remove"]("pcr-active");l.style.setProperty("--pcr-color",p)}}),hue:C({lock:"v"===i?"h":"v",element:t._root.hue.picker,wrapper:t._root.hue.slider,onstop:()=>t._emit("changestop","slider",t),onchange(o){if(!e.hue||!e.palette)return;const r=n();t._recalc&&(r.h=360*o),this.element.style.backgroundColor=`hsl(${r.h}, 100%, 50%)`,s.palette.trigger()}}),opacity:C({lock:"v"===r?"h":"v",element:t._root.opacity.picker,wrapper:t._root.opacity.slider,onstop:()=>t._emit("changestop","slider",t),onchange(o){if(!e.opacity||!e.palette)return;const r=n();t._recalc&&(r.a=Math.round(100*o)/100),this.element.style.background=`rgba(0, 0, 0, ${r.a})`,s.palette.trigger()}}),selectable:x({elements:t._root.interaction.options,className:"active",onchange(e){t._representation=e.target.getAttribute("data-type").toUpperCase(),t._recalc&&t._updateOutput("swatch")}})};this._components=s}_bindEvents(){const{_root:t,options:e}=this,o=[i(t.interaction.clear,"click",(()=>this._clearColor())),i([t.interaction.cancel,t.preview.lastColor],"click",(()=>{this.setHSVA(...(this._lastColor||this._color).toHSVA(),!0),this._emit("cancel")})),i(t.interaction.save,"click",(()=>{!this.applyColor()&&!e.showAlways&&this.hide()})),i(t.interaction.result,["keyup","input"],(t=>{this.setColor(t.target.value,!0)&&!this._initializingActive&&(this._emit("change",this._color,"input",this),this._emit("changestop","input",this)),t.stopImmediatePropagation()})),i(t.interaction.result,["focus","blur"],(t=>{this._recalc="blur"===t.type,this._recalc&&this._updateOutput(null)})),i([t.palette.palette,t.palette.picker,t.hue.slider,t.hue.picker,t.opacity.slider,t.opacity.picker],["mousedown","touchstart"],(()=>this._recalc=!0),{passive:!0})];if(!e.showAlways){const r=e.closeWithKey;o.push(i(t.button,"click",(()=>this.isOpen()?this.hide():this.show())),i(document,"keyup",(t=>this.isOpen()&&(t.key===r||t.code===r)&&this.hide())),i(document,["touchstart","mousedown"],(e=>{this.isOpen()&&!c(e).some((e=>e===t.app||e===t.button))&&this.hide()}),{capture:!0}))}if(e.adjustableNumbers){const e={rgba:[255,255,255,1],hsva:[360,100,100,1],hsla:[360,100,100,1],cmyk:[100,100,100,100]};p(t.interaction.result,((t,o,r)=>{const i=e[this.getColorRepresentation().toLowerCase()];if(i){const e=i[r],n=t+(e>=100?1e3*o:o);return n<=0?0:Number((n{r.isOpen()&&(e.closeOnScroll&&r.hide(),null===t?(t=setTimeout((()=>t=null),100),requestAnimationFrame((function e(){r._rePositioningPicker(),null!==t&&requestAnimationFrame(e)}))):(clearTimeout(t),t=setTimeout((()=>t=null),100)))}),{capture:!0}))}this._eventBindings=o}_rePositioningPicker(){const{options:t}=this;if(!t.inline&&!this._nanopop.update({container:document.body.getBoundingClientRect(),position:t.position})){const t=this._root.app,e=t.getBoundingClientRect();t.style.top=(window.innerHeight-e.height)/2+"px",t.style.left=(window.innerWidth-e.width)/2+"px"}}_updateOutput(t){const{_root:e,_color:o,options:r}=this;if(e.interaction.type()){const t=`to${e.interaction.type().getAttribute("data-type")}`;e.interaction.result.value="function"==typeof o[t]?o[t]().toString(r.outputPrecision):""}!this._initializingActive&&this._recalc&&this._emit("change",o,t,this)}_clearColor(t=!1){const{_root:e,options:o}=this;o.useAsButton||e.button.style.setProperty("--pcr-color","rgba(0, 0, 0, 0.15)"),e.button.classList.add("clear"),o.showAlways||this.hide(),this._lastColor=null,this._initializingActive||t||(this._emit("save",null),this._emit("clear"))}_parseLocalColor(t){const{values:e,type:o,a:r}=function(t){t=t.match(/^[a-zA-Z]+$/)?function(t){if("black"===t.toLowerCase())return"#000";const e=document.createElement("canvas").getContext("2d");return e.fillStyle=t,"#000"===e.fillStyle?null:e.fillStyle}(t):t;const e={cmyk:/^cmyk\D+([\d.]+)\D+([\d.]+)\D+([\d.]+)\D+([\d.]+)/i,rgba:/^rgba?\D+([\d.]+)(%?)\D+([\d.]+)(%?)\D+([\d.]+)(%?)\D*?(([\d.]+)(%?)|$)/i,hsla:/^hsla?\D+([\d.]+)\D+([\d.]+)\D+([\d.]+)\D*?(([\d.]+)(%?)|$)/i,hsva:/^hsva?\D+([\d.]+)\D+([\d.]+)\D+([\d.]+)\D*?(([\d.]+)(%?)|$)/i,hexa:/^#?(([\dA-Fa-f]{3,4})|([\dA-Fa-f]{6})|([\dA-Fa-f]{8}))$/i},o=t=>t.map((t=>/^(|\d+)\.\d+|\d+$/.test(t)?Number(t):void 0));let r;t:for(const i in e)if(r=e[i].exec(t))switch(i){case"cmyk":{const[,t,e,n,s]=o(r);if(t>100||e>100||n>100||s>100)break t;return{values:b(t,e,n,s),type:i}}case"rgba":{let[,t,,e,,n,,,s]=o(r);if(t="%"===r[2]?t/100*255:t,e="%"===r[4]?e/100*255:e,n="%"===r[6]?n/100*255:n,s="%"===r[9]?s/100:s,t>255||e>255||n>255||s<0||s>1)break t;return{values:[...v(t,e,n),s],a:s,type:i}}case"hexa":{let[,t]=r;4!==t.length&&3!==t.length||(t=t.split("").map((t=>t+t)).join(""));const e=t.substring(0,6);let o=t.substring(6);return o=o?parseInt(o,16)/255:void 0,{values:[...w(e),o],a:o,type:i}}case"hsla":{let[,t,e,n,,s]=o(r);if(s="%"===r[6]?s/100:s,t>360||e>100||n>100||s<0||s>1)break t;return{values:[...k(t,e,n),s],a:s,type:i}}case"hsva":{let[,t,e,n,,s]=o(r);if(s="%"===r[6]?s/100:s,t>360||e>100||n>100||s<0||s>1)break t;return{values:[t,e,n,s],a:s,type:i}}}return{values:null,type:null}}(t),{lockOpacity:i}=this.options,n=void 0!==r&&1!==r;return e&&3===e.length&&(e[3]=void 0),{values:!e||i&&n?null:e,type:o}}_t(t){return this.options.i18n[t]||S.I18N_DEFAULTS[t]}_emit(t,...e){this._eventListener[t].forEach((t=>t(...e,this)))}on(t,e){return this._eventListener[t].push(e),this}off(t,e){const o=this._eventListener[t]||[],r=o.indexOf(e);return~r&&o.splice(r,1),this}addSwatch(t){const{values:e}=this._parseLocalColor(t);if(e){const{_swatchColors:t,_root:o}=this,r=y(...e),n=s(`'}\n\n
\n
\n
\n \n
\n
\n\n
\n
\n
\n
\n\n
\n
\n
\n
\n\n
\n
\n
\n
\n
\n\n
\n\n
\n \n\n \n \n \n \n \n\n \n \n \n
\n
\n \n `),h=p.interaction;return h.options.find((t=>!t.hidden&&!t.classList.add("active"))),h.type=()=>h.options.find((t=>t.classList.contains("active"))),p})(this),t.useAsButton&&(this._root.button=t.el),t.container.appendChild(this._root.root)}_finalBuild(){const t=this.options,e=this._root;if(t.container.removeChild(e.root),t.inline){const o=t.el.parentElement;t.el.nextSibling?o.insertBefore(e.app,t.el.nextSibling):o.appendChild(e.app)}else t.container.appendChild(e.app);t.useAsButton?t.inline&&t.el.remove():t.el.parentNode.replaceChild(e.root,t.el),t.disabled&&this.disable(),t.comparison||(e.button.style.transition="none",t.useAsButton||(e.preview.lastColor.style.transition="none")),this.hide()}_buildComponents(){const t=this,e=this.options.components,o=(t.options.sliders||"v").repeat(2),[r,i]=o.match(/^[vh]+$/g)?o:[],n=()=>this._color||(this._color=this._lastColor.clone()),s={palette:_({element:t._root.palette.picker,wrapper:t._root.palette.palette,onstop:()=>t._emit("changestop","slider",t),onchange(o,r){if(!e.palette)return;const i=n(),{_root:s,options:a}=t,{lastColor:c,currentColor:l}=s.preview;t._recalc&&(i.s=100*o,i.v=100-100*r,i.v<0&&(i.v=0),t._updateOutput("slider"));const p=i.toRGBA().toString(0);this.element.style.background=p,this.wrapper.style.background=`\n linear-gradient(to top, rgba(0, 0, 0, ${i.a}), transparent),\n linear-gradient(to left, hsla(${i.h}, 100%, 50%, ${i.a}), rgba(255, 255, 255, ${i.a}))\n `,a.comparison?a.useAsButton||t._lastColor||c.style.setProperty("--pcr-color",p):(s.button.style.setProperty("--pcr-color",p),s.button.classList.remove("clear"));const h=i.toHEXA().toString();for(const{el:e,color:o}of t._swatchColors)e.classList[h===o.toHEXA().toString()?"add":"remove"]("pcr-active");l.style.setProperty("--pcr-color",p)}}),hue:_({lock:"v"===i?"h":"v",element:t._root.hue.picker,wrapper:t._root.hue.slider,onstop:()=>t._emit("changestop","slider",t),onchange(o){if(!e.hue||!e.palette)return;const r=n();t._recalc&&(r.h=360*o),this.element.style.backgroundColor=`hsl(${r.h}, 100%, 50%)`,s.palette.trigger()}}),opacity:_({lock:"v"===r?"h":"v",element:t._root.opacity.picker,wrapper:t._root.opacity.slider,onstop:()=>t._emit("changestop","slider",t),onchange(o){if(!e.opacity||!e.palette)return;const r=n();t._recalc&&(r.a=Math.round(100*o)/100),this.element.style.background=`rgba(0, 0, 0, ${r.a})`,s.palette.trigger()}}),selectable:x({elements:t._root.interaction.options,className:"active",onchange(e){t._representation=e.target.getAttribute("data-type").toUpperCase(),t._recalc&&t._updateOutput("swatch")}})};this._components=s}_bindEvents(){const{_root:t,options:e}=this,o=[i(t.interaction.clear,"click",(()=>this._clearColor())),i([t.interaction.cancel,t.preview.lastColor],"click",(()=>{this.setHSVA(...(this._lastColor||this._color).toHSVA(),!0),this._emit("cancel")})),i(t.interaction.save,"click",(()=>{!this.applyColor()&&!e.showAlways&&this.hide()})),i(t.interaction.result,["keyup","input"],(t=>{this.setColor(t.target.value,!0)&&!this._initializingActive&&(this._emit("change",this._color,"input",this),this._emit("changestop","input",this)),t.stopImmediatePropagation()})),i(t.interaction.result,["focus","blur"],(t=>{this._recalc="blur"===t.type,this._recalc&&this._updateOutput(null)})),i([t.palette.palette,t.palette.picker,t.hue.slider,t.hue.picker,t.opacity.slider,t.opacity.picker],["mousedown","touchstart"],(()=>this._recalc=!0),{passive:!0})];if(!e.showAlways){const r=e.closeWithKey;o.push(i(t.button,"click",(()=>this.isOpen()?this.hide():this.show())),i(document,"keyup",(t=>this.isOpen()&&(t.key===r||t.code===r)&&this.hide())),i(document,["touchstart","mousedown"],(e=>{this.isOpen()&&!c(e).some((e=>e===t.app||e===t.button))&&this.hide()}),{capture:!0}))}if(e.adjustableNumbers){const e={rgba:[255,255,255,1],hsva:[360,100,100,1],hsla:[360,100,100,1],cmyk:[100,100,100,100]};p(t.interaction.result,((t,o,r)=>{const i=e[this.getColorRepresentation().toLowerCase()];if(i){const e=i[r],n=t+(e>=100?1e3*o:o);return n<=0?0:Number((n{r.isOpen()&&(e.closeOnScroll&&r.hide(),null===t?(t=setTimeout((()=>t=null),100),requestAnimationFrame((function e(){r._rePositioningPicker(),null!==t&&requestAnimationFrame(e)}))):(clearTimeout(t),t=setTimeout((()=>t=null),100)))}),{capture:!0}))}this._eventBindings=o}_rePositioningPicker(){const{options:t}=this;if(!t.inline&&!this._nanopop.update({container:document.body.getBoundingClientRect(),position:t.position})){const t=this._root.app,e=t.getBoundingClientRect();t.style.top=(window.innerHeight-e.height)/2+"px",t.style.left=(window.innerWidth-e.width)/2+"px"}}_updateOutput(t){const{_root:e,_color:o,options:r}=this;if(e.interaction.type()){const t=`to${e.interaction.type().getAttribute("data-type")}`;e.interaction.result.value="function"==typeof o[t]?o[t]().toString(r.outputPrecision):""}!this._initializingActive&&this._recalc&&this._emit("change",o,t,this)}_clearColor(t=!1){const{_root:e,options:o}=this;o.useAsButton||e.button.style.setProperty("--pcr-color","rgba(0, 0, 0, 0.15)"),e.button.classList.add("clear"),o.showAlways||this.hide(),this._lastColor=null,this._initializingActive||t||(this._emit("save",null),this._emit("clear"))}_parseLocalColor(t){const{values:e,type:o,a:r}=function(t){t=t.match(/^[a-zA-Z]+$/)?function(t){if("black"===t.toLowerCase())return"#000";const e=document.createElement("canvas").getContext("2d");return e.fillStyle=t,"#000"===e.fillStyle?null:e.fillStyle}(t):t;const e={cmyk:/^cmyk\D+([\d.]+)\D+([\d.]+)\D+([\d.]+)\D+([\d.]+)/i,rgba:/^rgba?\D+([\d.]+)(%?)\D+([\d.]+)(%?)\D+([\d.]+)(%?)\D*?(([\d.]+)(%?)|$)/i,hsla:/^hsla?\D+([\d.]+)\D+([\d.]+)\D+([\d.]+)\D*?(([\d.]+)(%?)|$)/i,hsva:/^hsva?\D+([\d.]+)\D+([\d.]+)\D+([\d.]+)\D*?(([\d.]+)(%?)|$)/i,hexa:/^#?(([\dA-Fa-f]{3,4})|([\dA-Fa-f]{6})|([\dA-Fa-f]{8}))$/i},o=t=>t.map((t=>/^(|\d+)\.\d+|\d+$/.test(t)?Number(t):void 0));let r;t:for(const i in e)if(r=e[i].exec(t))switch(i){case"cmyk":{const[,t,e,n,s]=o(r);if(t>100||e>100||n>100||s>100)break t;return{values:b(t,e,n,s),type:i}}case"rgba":{let[,t,,e,,n,,,s]=o(r);if(t="%"===r[2]?t/100*255:t,e="%"===r[4]?e/100*255:e,n="%"===r[6]?n/100*255:n,s="%"===r[9]?s/100:s,t>255||e>255||n>255||s<0||s>1)break t;return{values:[...v(t,e,n),s],a:s,type:i}}case"hexa":{let[,t]=r;4!==t.length&&3!==t.length||(t=t.split("").map((t=>t+t)).join(""));const e=t.substring(0,6);let o=t.substring(6);return o=o?parseInt(o,16)/255:void 0,{values:[...w(e),o],a:o,type:i}}case"hsla":{let[,t,e,n,,s]=o(r);if(s="%"===r[6]?s/100:s,t>360||e>100||n>100||s<0||s>1)break t;return{values:[...k(t,e,n),s],a:s,type:i}}case"hsva":{let[,t,e,n,,s]=o(r);if(s="%"===r[6]?s/100:s,t>360||e>100||n>100||s<0||s>1)break t;return{values:[t,e,n,s],a:s,type:i}}}return{values:null,type:null}}(t),{lockOpacity:i}=this.options,n=void 0!==r&&1!==r;return e&&3===e.length&&(e[3]=void 0),{values:!e||i&&n?null:e,type:o}}_t(t){return this.options.i18n[t]||S.I18N_DEFAULTS[t]}_emit(t,...e){this._eventListener[t].forEach((t=>t(...e,this)))}on(t,e){return this._eventListener[t].push(e),this}off(t,e){const o=this._eventListener[t]||[],r=o.indexOf(e);return~r&&o.splice(r,1),this}addSwatch(t){const{values:e}=this._parseLocalColor(t);if(e){const{_swatchColors:t,_root:o}=this,r=y(...e),n=s(`'}\n\n
\n
\n
\n \n
\n
\n\n
\n
\n
\n
\n\n
\n
\n
\n
\n\n
\n
\n
\n
\n
\n\n
\n\n
\n \n\n \n \n \n \n \n\n \n \n \n
\n
\n \n `),h=p.interaction;return h.options.find((t=>!t.hidden&&!t.classList.add("active"))),h.type=()=>h.options.find((t=>t.classList.contains("active"))),p})(this),t.useAsButton&&(this._root.button=t.el),t.container.appendChild(this._root.root)}_finalBuild(){const t=this.options,e=this._root;if(t.container.removeChild(e.root),t.inline){const o=t.el.parentElement;t.el.nextSibling?o.insertBefore(e.app,t.el.nextSibling):o.appendChild(e.app)}else t.container.appendChild(e.app);t.useAsButton?t.inline&&t.el.remove():t.el.parentNode.replaceChild(e.root,t.el),t.disabled&&this.disable(),t.comparison||(e.button.style.transition="none",t.useAsButton||(e.preview.lastColor.style.transition="none")),this.hide()}_buildComponents(){const t=this,e=this.options.components,o=(t.options.sliders||"v").repeat(2),[r,i]=o.match(/^[vh]+$/g)?o:[],n=()=>this._color||(this._color=this._lastColor.clone()),s={palette:_({element:t._root.palette.picker,wrapper:t._root.palette.palette,onstop:()=>t._emit("changestop","slider",t),onchange(o,r){if(!e.palette)return;const i=n(),{_root:s,options:a}=t,{lastColor:c,currentColor:l}=s.preview;t._recalc&&(i.s=100*o,i.v=100-100*r,i.v<0&&(i.v=0),t._updateOutput("slider"));const p=i.toRGBA().toString(0);this.element.style.background=p,this.wrapper.style.background=`\n linear-gradient(to top, rgba(0, 0, 0, ${i.a}), transparent),\n linear-gradient(to left, hsla(${i.h}, 100%, 50%, ${i.a}), rgba(255, 255, 255, ${i.a}))\n `,a.comparison?a.useAsButton||t._lastColor||c.style.setProperty("--pcr-color",p):(s.button.style.setProperty("--pcr-color",p),s.button.classList.remove("clear"));const h=i.toHEXA().toString();for(const{el:e,color:o}of t._swatchColors)e.classList[h===o.toHEXA().toString()?"add":"remove"]("pcr-active");l.style.setProperty("--pcr-color",p)}}),hue:_({lock:"v"===i?"h":"v",element:t._root.hue.picker,wrapper:t._root.hue.slider,onstop:()=>t._emit("changestop","slider",t),onchange(o){if(!e.hue||!e.palette)return;const r=n();t._recalc&&(r.h=360*o),this.element.style.backgroundColor=`hsl(${r.h}, 100%, 50%)`,s.palette.trigger()}}),opacity:_({lock:"v"===r?"h":"v",element:t._root.opacity.picker,wrapper:t._root.opacity.slider,onstop:()=>t._emit("changestop","slider",t),onchange(o){if(!e.opacity||!e.palette)return;const r=n();t._recalc&&(r.a=Math.round(100*o)/100),this.element.style.background=`rgba(0, 0, 0, ${r.a})`,s.palette.trigger()}}),selectable:x({elements:t._root.interaction.options,className:"active",onchange(e){t._representation=e.target.getAttribute("data-type").toUpperCase(),t._recalc&&t._updateOutput("swatch")}})};this._components=s}_bindEvents(){const{_root:t,options:e}=this,o=[i(t.interaction.clear,"click",(()=>this._clearColor())),i([t.interaction.cancel,t.preview.lastColor],"click",(()=>{this.setHSVA(...(this._lastColor||this._color).toHSVA(),!0),this._emit("cancel")})),i(t.interaction.save,"click",(()=>{!this.applyColor()&&!e.showAlways&&this.hide()})),i(t.interaction.result,["keyup","input"],(t=>{this.setColor(t.target.value,!0)&&!this._initializingActive&&(this._emit("change",this._color,"input",this),this._emit("changestop","input",this)),t.stopImmediatePropagation()})),i(t.interaction.result,["focus","blur"],(t=>{this._recalc="blur"===t.type,this._recalc&&this._updateOutput(null)})),i([t.palette.palette,t.palette.picker,t.hue.slider,t.hue.picker,t.opacity.slider,t.opacity.picker],["mousedown","touchstart"],(()=>this._recalc=!0),{passive:!0})];if(!e.showAlways){const r=e.closeWithKey;o.push(i(t.button,"click",(()=>this.isOpen()?this.hide():this.show())),i(document,"keyup",(t=>this.isOpen()&&(t.key===r||t.code===r)&&this.hide())),i(document,["touchstart","mousedown"],(e=>{this.isOpen()&&!c(e).some((e=>e===t.app||e===t.button))&&this.hide()}),{capture:!0}))}if(e.adjustableNumbers){const e={rgba:[255,255,255,1],hsva:[360,100,100,1],hsla:[360,100,100,1],cmyk:[100,100,100,100]};p(t.interaction.result,((t,o,r)=>{const i=e[this.getColorRepresentation().toLowerCase()];if(i){const e=i[r],n=t+(e>=100?1e3*o:o);return n<=0?0:Number((n{r.isOpen()&&(e.closeOnScroll&&r.hide(),null===t?(t=setTimeout((()=>t=null),100),requestAnimationFrame((function e(){r._rePositioningPicker(),null!==t&&requestAnimationFrame(e)}))):(clearTimeout(t),t=setTimeout((()=>t=null),100)))}),{capture:!0}))}this._eventBindings=o}_rePositioningPicker(){const{options:t}=this;if(!t.inline&&!this._nanopop.update({container:document.body.getBoundingClientRect(),position:t.position})){const t=this._root.app,e=t.getBoundingClientRect();t.style.top=(window.innerHeight-e.height)/2+"px",t.style.left=(window.innerWidth-e.width)/2+"px"}}_updateOutput(t){const{_root:e,_color:o,options:r}=this;if(e.interaction.type()){const t=`to${e.interaction.type().getAttribute("data-type")}`;e.interaction.result.value="function"==typeof o[t]?o[t]().toString(r.outputPrecision):""}!this._initializingActive&&this._recalc&&this._emit("change",o,t,this)}_clearColor(t=!1){const{_root:e,options:o}=this;o.useAsButton||e.button.style.setProperty("--pcr-color","rgba(0, 0, 0, 0.15)"),e.button.classList.add("clear"),o.showAlways||this.hide(),this._lastColor=null,this._initializingActive||t||(this._emit("save",null),this._emit("clear"))}_parseLocalColor(t){const{values:e,type:o,a:r}=function(t){t=t.match(/^[a-zA-Z]+$/)?function(t){if("black"===t.toLowerCase())return"#000";const e=document.createElement("canvas").getContext("2d");return e.fillStyle=t,"#000"===e.fillStyle?null:e.fillStyle}(t):t;const e={cmyk:/^cmyk\D+([\d.]+)\D+([\d.]+)\D+([\d.]+)\D+([\d.]+)/i,rgba:/^rgba?\D+([\d.]+)(%?)\D+([\d.]+)(%?)\D+([\d.]+)(%?)\D*?(([\d.]+)(%?)|$)/i,hsla:/^hsla?\D+([\d.]+)\D+([\d.]+)\D+([\d.]+)\D*?(([\d.]+)(%?)|$)/i,hsva:/^hsva?\D+([\d.]+)\D+([\d.]+)\D+([\d.]+)\D*?(([\d.]+)(%?)|$)/i,hexa:/^#?(([\dA-Fa-f]{3,4})|([\dA-Fa-f]{6})|([\dA-Fa-f]{8}))$/i},o=t=>t.map((t=>/^(|\d+)\.\d+|\d+$/.test(t)?Number(t):void 0));let r;t:for(const i in e)if(r=e[i].exec(t))switch(i){case"cmyk":{const[,t,e,n,s]=o(r);if(t>100||e>100||n>100||s>100)break t;return{values:b(t,e,n,s),type:i}}case"rgba":{let[,t,,e,,n,,,s]=o(r);if(t="%"===r[2]?t/100*255:t,e="%"===r[4]?e/100*255:e,n="%"===r[6]?n/100*255:n,s="%"===r[9]?s/100:s,t>255||e>255||n>255||s<0||s>1)break t;return{values:[...v(t,e,n),s],a:s,type:i}}case"hexa":{let[,t]=r;4!==t.length&&3!==t.length||(t=t.split("").map((t=>t+t)).join(""));const e=t.substring(0,6);let o=t.substring(6);return o=o?parseInt(o,16)/255:void 0,{values:[...w(e),o],a:o,type:i}}case"hsla":{let[,t,e,n,,s]=o(r);if(s="%"===r[6]?s/100:s,t>360||e>100||n>100||s<0||s>1)break t;return{values:[...k(t,e,n),s],a:s,type:i}}case"hsva":{let[,t,e,n,,s]=o(r);if(s="%"===r[6]?s/100:s,t>360||e>100||n>100||s<0||s>1)break t;return{values:[t,e,n,s],a:s,type:i}}}return{values:null,type:null}}(t),{lockOpacity:i}=this.options,n=void 0!==r&&1!==r;return e&&3===e.length&&(e[3]=void 0),{values:!e||i&&n?null:e,type:o}}_t(t){return this.options.i18n[t]||S.I18N_DEFAULTS[t]}_emit(t,...e){this._eventListener[t].forEach((t=>t(...e,this)))}on(t,e){return this._eventListener[t].push(e),this}off(t,e){const o=this._eventListener[t]||[],r=o.indexOf(e);return~r&&o.splice(r,1),this}addSwatch(t){const{values:e}=this._parseLocalColor(t);if(e){const{_swatchColors:t,_root:o}=this,r=y(...e),n=s(`'}\n\n
\n
\n
\n \n
\n
\n\n
\n
\n
\n
\n\n
\n
\n
\n
\n\n
\n
\n
\n
\n
\n\n
\n\n
\n \n\n \n \n \n \n \n\n \n \n \n
\n
\n \n `),h=p.interaction;return h.options.find((t=>!t.hidden&&!t.classList.add("active"))),h.type=()=>h.options.find((t=>t.classList.contains("active"))),p})(this),t.useAsButton&&(this._root.button=t.el),t.container.appendChild(this._root.root)}_finalBuild(){const t=this.options,e=this._root;if(t.container.removeChild(e.root),t.inline){const o=t.el.parentElement;t.el.nextSibling?o.insertBefore(e.app,t.el.nextSibling):o.appendChild(e.app)}else t.container.appendChild(e.app);t.useAsButton?t.inline&&t.el.remove():t.el.parentNode.replaceChild(e.root,t.el),t.disabled&&this.disable(),t.comparison||(e.button.style.transition="none",t.useAsButton||(e.preview.lastColor.style.transition="none")),this.hide()}_buildComponents(){const t=this,e=this.options.components,o=(t.options.sliders||"v").repeat(2),[r,i]=o.match(/^[vh]+$/g)?o:[],n=()=>this._color||(this._color=this._lastColor.clone()),s={palette:_({element:t._root.palette.picker,wrapper:t._root.palette.palette,onstop:()=>t._emit("changestop","slider",t),onchange(o,r){if(!e.palette)return;const i=n(),{_root:s,options:a}=t,{lastColor:c,currentColor:l}=s.preview;t._recalc&&(i.s=100*o,i.v=100-100*r,i.v<0&&(i.v=0),t._updateOutput("slider"));const p=i.toRGBA().toString(0);this.element.style.background=p,this.wrapper.style.background=`\n linear-gradient(to top, rgba(0, 0, 0, ${i.a}), transparent),\n linear-gradient(to left, hsla(${i.h}, 100%, 50%, ${i.a}), rgba(255, 255, 255, ${i.a}))\n `,a.comparison?a.useAsButton||t._lastColor||c.style.setProperty("--pcr-color",p):(s.button.style.setProperty("--pcr-color",p),s.button.classList.remove("clear"));const h=i.toHEXA().toString();for(const{el:e,color:o}of t._swatchColors)e.classList[h===o.toHEXA().toString()?"add":"remove"]("pcr-active");l.style.setProperty("--pcr-color",p)}}),hue:_({lock:"v"===i?"h":"v",element:t._root.hue.picker,wrapper:t._root.hue.slider,onstop:()=>t._emit("changestop","slider",t),onchange(o){if(!e.hue||!e.palette)return;const r=n();t._recalc&&(r.h=360*o),this.element.style.backgroundColor=`hsl(${r.h}, 100%, 50%)`,s.palette.trigger()}}),opacity:_({lock:"v"===r?"h":"v",element:t._root.opacity.picker,wrapper:t._root.opacity.slider,onstop:()=>t._emit("changestop","slider",t),onchange(o){if(!e.opacity||!e.palette)return;const r=n();t._recalc&&(r.a=Math.round(100*o)/100),this.element.style.background=`rgba(0, 0, 0, ${r.a})`,s.palette.trigger()}}),selectable:x({elements:t._root.interaction.options,className:"active",onchange(e){t._representation=e.target.getAttribute("data-type").toUpperCase(),t._recalc&&t._updateOutput("swatch")}})};this._components=s}_bindEvents(){const{_root:t,options:e}=this,o=[i(t.interaction.clear,"click",(()=>this._clearColor())),i([t.interaction.cancel,t.preview.lastColor],"click",(()=>{this.setHSVA(...(this._lastColor||this._color).toHSVA(),!0),this._emit("cancel")})),i(t.interaction.save,"click",(()=>{!this.applyColor()&&!e.showAlways&&this.hide()})),i(t.interaction.result,["keyup","input"],(t=>{this.setColor(t.target.value,!0)&&!this._initializingActive&&(this._emit("change",this._color,"input",this),this._emit("changestop","input",this)),t.stopImmediatePropagation()})),i(t.interaction.result,["focus","blur"],(t=>{this._recalc="blur"===t.type,this._recalc&&this._updateOutput(null)})),i([t.palette.palette,t.palette.picker,t.hue.slider,t.hue.picker,t.opacity.slider,t.opacity.picker],["mousedown","touchstart"],(()=>this._recalc=!0),{passive:!0})];if(!e.showAlways){const r=e.closeWithKey;o.push(i(t.button,"click",(()=>this.isOpen()?this.hide():this.show())),i(document,"keyup",(t=>this.isOpen()&&(t.key===r||t.code===r)&&this.hide())),i(document,["touchstart","mousedown"],(e=>{this.isOpen()&&!c(e).some((e=>e===t.app||e===t.button))&&this.hide()}),{capture:!0}))}if(e.adjustableNumbers){const e={rgba:[255,255,255,1],hsva:[360,100,100,1],hsla:[360,100,100,1],cmyk:[100,100,100,100]};p(t.interaction.result,((t,o,r)=>{const i=e[this.getColorRepresentation().toLowerCase()];if(i){const e=i[r],n=t+(e>=100?1e3*o:o);return n<=0?0:Number((n{r.isOpen()&&(e.closeOnScroll&&r.hide(),null===t?(t=setTimeout((()=>t=null),100),requestAnimationFrame((function e(){r._rePositioningPicker(),null!==t&&requestAnimationFrame(e)}))):(clearTimeout(t),t=setTimeout((()=>t=null),100)))}),{capture:!0}))}this._eventBindings=o}_rePositioningPicker(){const{options:t}=this;if(!t.inline&&!this._nanopop.update({container:document.body.getBoundingClientRect(),position:t.position})){const t=this._root.app,e=t.getBoundingClientRect();t.style.top=(window.innerHeight-e.height)/2+"px",t.style.left=(window.innerWidth-e.width)/2+"px"}}_updateOutput(t){const{_root:e,_color:o,options:r}=this;if(e.interaction.type()){const t=`to${e.interaction.type().getAttribute("data-type")}`;e.interaction.result.value="function"==typeof o[t]?o[t]().toString(r.outputPrecision):""}!this._initializingActive&&this._recalc&&this._emit("change",o,t,this)}_clearColor(t=!1){const{_root:e,options:o}=this;o.useAsButton||e.button.style.setProperty("--pcr-color","rgba(0, 0, 0, 0.15)"),e.button.classList.add("clear"),o.showAlways||this.hide(),this._lastColor=null,this._initializingActive||t||(this._emit("save",null),this._emit("clear"))}_parseLocalColor(t){const{values:e,type:o,a:r}=function(t){t=t.match(/^[a-zA-Z]+$/)?function(t){if("black"===t.toLowerCase())return"#000";const e=document.createElement("canvas").getContext("2d");return e.fillStyle=t,"#000"===e.fillStyle?null:e.fillStyle}(t):t;const e={cmyk:/^cmyk\D+([\d.]+)\D+([\d.]+)\D+([\d.]+)\D+([\d.]+)/i,rgba:/^rgba?\D+([\d.]+)(%?)\D+([\d.]+)(%?)\D+([\d.]+)(%?)\D*?(([\d.]+)(%?)|$)/i,hsla:/^hsla?\D+([\d.]+)\D+([\d.]+)\D+([\d.]+)\D*?(([\d.]+)(%?)|$)/i,hsva:/^hsva?\D+([\d.]+)\D+([\d.]+)\D+([\d.]+)\D*?(([\d.]+)(%?)|$)/i,hexa:/^#?(([\dA-Fa-f]{3,4})|([\dA-Fa-f]{6})|([\dA-Fa-f]{8}))$/i},o=t=>t.map((t=>/^(|\d+)\.\d+|\d+$/.test(t)?Number(t):void 0));let r;t:for(const i in e)if(r=e[i].exec(t))switch(i){case"cmyk":{const[,t,e,n,s]=o(r);if(t>100||e>100||n>100||s>100)break t;return{values:b(t,e,n,s),type:i}}case"rgba":{let[,t,,e,,n,,,s]=o(r);if(t="%"===r[2]?t/100*255:t,e="%"===r[4]?e/100*255:e,n="%"===r[6]?n/100*255:n,s="%"===r[9]?s/100:s,t>255||e>255||n>255||s<0||s>1)break t;return{values:[...v(t,e,n),s],a:s,type:i}}case"hexa":{let[,t]=r;4!==t.length&&3!==t.length||(t=t.split("").map((t=>t+t)).join(""));const e=t.substring(0,6);let o=t.substring(6);return o=o?parseInt(o,16)/255:void 0,{values:[...w(e),o],a:o,type:i}}case"hsla":{let[,t,e,n,,s]=o(r);if(s="%"===r[6]?s/100:s,t>360||e>100||n>100||s<0||s>1)break t;return{values:[...k(t,e,n),s],a:s,type:i}}case"hsva":{let[,t,e,n,,s]=o(r);if(s="%"===r[6]?s/100:s,t>360||e>100||n>100||s<0||s>1)break t;return{values:[t,e,n,s],a:s,type:i}}}return{values:null,type:null}}(t),{lockOpacity:i}=this.options,n=void 0!==r&&1!==r;return e&&3===e.length&&(e[3]=void 0),{values:!e||i&&n?null:e,type:o}}_t(t){return this.options.i18n[t]||S.I18N_DEFAULTS[t]}_emit(t,...e){this._eventListener[t].forEach((t=>t(...e,this)))}on(t,e){return this._eventListener[t].push(e),this}off(t,e){const o=this._eventListener[t]||[],r=o.indexOf(e);return~r&&o.splice(r,1),this}addSwatch(t){const{values:e}=this._parseLocalColor(t);if(e){const{_swatchColors:t,_root:o}=this,r=y(...e),n=s(`